From 04c0f252a7a18de2cd4c2368f646bc7587dfdeaf Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Mon, 4 Apr 2022 23:44:31 +0200 Subject: [PATCH] Built motion from commit da617fac.|2.6.6 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1195 files changed, 1195 insertions(+), 1195 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9861b69..6535a09 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-04T21:13:09.466Z", + "time": "2022-04-04T21:35:56.346Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index cd57e80..f2523e8 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-04T21:13:09.466Z", + "time": "2022-04-04T21:35:56.346Z", "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 931aec9..a6e2f1f 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 _0xe641=['jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar'];(function(_0x231ebd,_0x282c00){var _0x3d0b78=function(_0x32aeeb){while(--_0x32aeeb){_0x231ebd['push'](_0x231ebd['shift']());}};_0x3d0b78(++_0x282c00);}(_0xe641,0x1ec));var _0x1e64=function(_0x41b46f,_0x2b0bd6){_0x41b46f=_0x41b46f-0x0;var _0x39c398=_0xe641[_0x41b46f];return _0x39c398;};'use strict';var Sequelize=require(_0x1e64('0x0'));module[_0x1e64('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38ff16){return this[_0x1e64('0x2')](_0x1e64('0x3'));}},'action':{'type':Sequelize[_0x1e64('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1e64('0x5'),_0x1e64('0x6'),_0x1e64('0x7'),_0x1e64('0x8'),_0x1e64('0x9'),_0x1e64('0xa'),_0x1e64('0xb'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1e64('0xc')},'data1':{'type':Sequelize[_0x1e64('0x4')](0x1000),'comment':_0x1e64('0xd')},'data2':{'type':Sequelize[_0x1e64('0x4')](0x1000),'comment':_0x1e64('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x1e64('0xf')},'data4':{'type':Sequelize[_0x1e64('0x4')](0x1000),'comments':_0x1e64('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x1e64('0x4')],'comments':_0x1e64('0x11')},'data7':{'type':Sequelize[_0x1e64('0x12')],'comments':_0x1e64('0x13')}}; \ No newline at end of file +var _0xea1f=['TEXT','exports','getDataValue','action','STRING','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x3c180c,_0x52406){var _0xc5f9fe=function(_0xc27d5c){while(--_0xc27d5c){_0x3c180c['push'](_0x3c180c['shift']());}};_0xc5f9fe(++_0x52406);}(_0xea1f,0x6a));var _0xfea1=function(_0x5714dc,_0x3df6e4){_0x5714dc=_0x5714dc-0x0;var _0x58a901=_0xea1f[_0x5714dc];return _0x58a901;};'use strict';var Sequelize=require('sequelize');module[_0xfea1('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x421457){return this[_0xfea1('0x1')](_0xfea1('0x2'));}},'action':{'type':Sequelize[_0xfea1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xfea1('0x4'),_0xfea1('0x5'),'jscripty',_0xfea1('0x6'),'browser',_0xfea1('0x7'),_0xfea1('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xfea1('0x9')},'data1':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comment':_0xfea1('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfea1('0xb')},'data3':{'type':Sequelize[_0xfea1('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[_0xfea1('0x3')](0x1000),'comments':_0xfea1('0xc')},'data5':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfea1('0x3')],'comments':_0xfea1('0xd')},'data7':{'type':Sequelize[_0xfea1('0xe')],'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 6cad00f..a2f5383 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 _0x3b03=['crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','name','send','body','find','params','Action','catch','eml-format','zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x30ae4b,_0x552f2e){var _0x53e6a3=function(_0xd30bbd){while(--_0xd30bbd){_0x30ae4b['push'](_0x30ae4b['shift']());}};_0x53e6a3(++_0x552f2e);}(_0x3b03,0x124));var _0x33b0=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x3b03[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0x33b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33b0('0x1'));var jsonpatch=require(_0x33b0('0x2'));var rp=require('request-promise');var moment=require(_0x33b0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x33b0('0x4'));var ejs=require(_0x33b0('0x5'));var fs=require('fs');var fs_extra=require(_0x33b0('0x6'));var _=require(_0x33b0('0x7'));var squel=require(_0x33b0('0x8'));var crypto=require(_0x33b0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x33b0('0xa'));var toCsv=require(_0x33b0('0x4'));var querystring=require('querystring');var Papa=require(_0x33b0('0xb'));var Redis=require('ioredis');var authService=require(_0x33b0('0xc'));var qs=require(_0x33b0('0xd'));var as=require(_0x33b0('0xe'));var hardwareService=require(_0x33b0('0xf'));var logger=require(_0x33b0('0x10'))('api');var utils=require(_0x33b0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x33b0('0x12'));var db=require(_0x33b0('0x13'))['db'];function respondWithStatusCode(_0x25c8ee,_0x547c59){_0x547c59=_0x547c59||0xcc;return function(_0x523579){if(_0x523579){return _0x25c8ee['sendStatus'](_0x547c59);}return _0x25c8ee[_0x33b0('0x14')](_0x547c59)['end']();};}function respondWithResult(_0x42baf3,_0x1f6fe4){_0x1f6fe4=_0x1f6fe4||0xc8;return function(_0x5c16a5){if(_0x5c16a5){return _0x42baf3['status'](_0x1f6fe4)['json'](_0x5c16a5);}};}function respondWithFilteredResult(_0x4679b9,_0x183f54){return function(_0x424174){if(_0x424174){var _0x5e2097=typeof _0x183f54[_0x33b0('0x15')]===_0x33b0('0x16')&&typeof _0x183f54[_0x33b0('0x17')]===_0x33b0('0x16');var _0x37913f=_0x424174['count'];var _0x56a4a7=_0x5e2097?0x0:_0x183f54[_0x33b0('0x15')];var _0xb9f52a=_0x5e2097?_0x424174[_0x33b0('0x18')]:_0x183f54['offset']+_0x183f54[_0x33b0('0x17')];var _0x20eb7a;if(_0xb9f52a>=_0x37913f){_0xb9f52a=_0x37913f;_0x20eb7a=0xc8;}else{_0x20eb7a=0xce;}_0x4679b9['status'](_0x20eb7a);return _0x4679b9[_0x33b0('0x19')](_0x33b0('0x1a'),_0x56a4a7+'-'+_0xb9f52a+'/'+_0x37913f)[_0x33b0('0x1b')](_0x424174);}return null;};}function patchUpdates(_0x30ecb0){return function(_0x280453){try{jsonpatch[_0x33b0('0x1c')](_0x280453,_0x30ecb0,!![]);}catch(_0x2384d9){return BPromise[_0x33b0('0x1d')](_0x2384d9);}return _0x280453[_0x33b0('0x1e')]();};}function saveUpdates(_0x50b054,_0x53c53a){return function(_0x3e0c69){if(_0x3e0c69){return _0x3e0c69[_0x33b0('0x1f')](_0x50b054)['then'](function(_0x16b68b){return _0x16b68b;});}return null;};}function removeEntity(_0x1d9b92,_0x5842ad){return function(_0x273af7){if(_0x273af7){return _0x273af7[_0x33b0('0x20')]()[_0x33b0('0x21')](function(){_0x1d9b92[_0x33b0('0x14')](0xcc)[_0x33b0('0x22')]();});}};}function handleEntityNotFound(_0x1e0159,_0x41d42b){return function(_0xd80319){if(!_0xd80319){_0x1e0159[_0x33b0('0x23')](0x194);}return _0xd80319;};}function handleError(_0x1db6a3,_0x5c54e9){_0x5c54e9=_0x5c54e9||0x1f4;return function(_0xbb5755){logger['error'](_0xbb5755['stack']);if(_0xbb5755['name']){delete _0xbb5755[_0x33b0('0x24')];}_0x1db6a3[_0x33b0('0x14')](_0x5c54e9)[_0x33b0('0x25')](_0xbb5755);};}exports[_0x33b0('0x1f')]=function(_0x5096b2,_0x51706e){if(_0x5096b2[_0x33b0('0x26')]['id']){delete _0x5096b2['body']['id'];}return db['Action'][_0x33b0('0x27')]({'where':{'id':_0x5096b2[_0x33b0('0x28')]['id']}})[_0x33b0('0x21')](handleEntityNotFound(_0x51706e,null))['then'](saveUpdates(_0x5096b2[_0x33b0('0x26')],null))['then'](respondWithResult(_0x51706e,null))['catch'](handleError(_0x51706e,null));};exports[_0x33b0('0x20')]=function(_0x3fe17a,_0x28ed9f){return db[_0x33b0('0x29')][_0x33b0('0x27')]({'where':{'id':_0x3fe17a[_0x33b0('0x28')]['id']}})[_0x33b0('0x21')](handleEntityNotFound(_0x28ed9f,null))['then'](removeEntity(_0x28ed9f,null))[_0x33b0('0x2a')](handleError(_0x28ed9f,null));}; \ No newline at end of file +var _0x43db=['status','end','json','undefined','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x43db,0x7a));var _0xb43d=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x43db[_0x2d4421];return _0x2d3b01;};'use strict';var emlformat=require(_0xb43d('0x0'));var rimraf=require(_0xb43d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb43d('0x2'));var rp=require(_0xb43d('0x3'));var moment=require(_0xb43d('0x4'));var BPromise=require(_0xb43d('0x5'));var Mustache=require(_0xb43d('0x6'));var util=require(_0xb43d('0x7'));var path=require(_0xb43d('0x8'));var sox=require(_0xb43d('0x9'));var csv=require('to-csv');var ejs=require(_0xb43d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb43d('0xb'));var squel=require(_0xb43d('0xc'));var crypto=require(_0xb43d('0xd'));var jsforce=require(_0xb43d('0xe'));var deskjs=require(_0xb43d('0xf'));var toCsv=require(_0xb43d('0x10'));var querystring=require(_0xb43d('0x11'));var Papa=require(_0xb43d('0x12'));var Redis=require(_0xb43d('0x13'));var authService=require(_0xb43d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb43d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb43d('0x16'))(_0xb43d('0x17'));var utils=require(_0xb43d('0x18'));var config=require(_0xb43d('0x19'));var licenseUtil=require(_0xb43d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371f08,_0x2a3960){_0x2a3960=_0x2a3960||0xcc;return function(_0x219d27){if(_0x219d27){return _0x371f08[_0xb43d('0x1b')](_0x2a3960);}return _0x371f08[_0xb43d('0x1c')](_0x2a3960)[_0xb43d('0x1d')]();};}function respondWithResult(_0x31d79e,_0x2d3f8e){_0x2d3f8e=_0x2d3f8e||0xc8;return function(_0x1dfc82){if(_0x1dfc82){return _0x31d79e[_0xb43d('0x1c')](_0x2d3f8e)[_0xb43d('0x1e')](_0x1dfc82);}};}function respondWithFilteredResult(_0x15c00b,_0x180a47){return function(_0x2be3f6){if(_0x2be3f6){var _0x20db51=typeof _0x180a47['offset']===_0xb43d('0x1f')&&typeof _0x180a47['limit']===_0xb43d('0x1f');var _0x54abc4=_0x2be3f6[_0xb43d('0x20')];var _0x39ff64=_0x20db51?0x0:_0x180a47[_0xb43d('0x21')];var _0x136e79=_0x20db51?_0x2be3f6['count']:_0x180a47['offset']+_0x180a47[_0xb43d('0x22')];var _0x45f8a4;if(_0x136e79>=_0x54abc4){_0x136e79=_0x54abc4;_0x45f8a4=0xc8;}else{_0x45f8a4=0xce;}_0x15c00b[_0xb43d('0x1c')](_0x45f8a4);return _0x15c00b[_0xb43d('0x23')]('Content-Range',_0x39ff64+'-'+_0x136e79+'/'+_0x54abc4)[_0xb43d('0x1e')](_0x2be3f6);}return null;};}function patchUpdates(_0x5eb094){return function(_0x522da3){try{jsonpatch[_0xb43d('0x24')](_0x522da3,_0x5eb094,!![]);}catch(_0xe0536f){return BPromise[_0xb43d('0x25')](_0xe0536f);}return _0x522da3['save']();};}function saveUpdates(_0x412722,_0x18a52b){return function(_0x303fc2){if(_0x303fc2){return _0x303fc2[_0xb43d('0x26')](_0x412722)['then'](function(_0x39eab8){return _0x39eab8;});}return null;};}function removeEntity(_0x7f0a2e,_0x31b537){return function(_0x5fc649){if(_0x5fc649){return _0x5fc649[_0xb43d('0x27')]()[_0xb43d('0x28')](function(){_0x7f0a2e[_0xb43d('0x1c')](0xcc)[_0xb43d('0x1d')]();});}};}function handleEntityNotFound(_0x5896b1,_0x46b0b2){return function(_0x565589){if(!_0x565589){_0x5896b1[_0xb43d('0x1b')](0x194);}return _0x565589;};}function handleError(_0x477fe4,_0x38f9b2){_0x38f9b2=_0x38f9b2||0x1f4;return function(_0x14fb5f){logger[_0xb43d('0x29')](_0x14fb5f[_0xb43d('0x2a')]);if(_0x14fb5f[_0xb43d('0x2b')]){delete _0x14fb5f['name'];}_0x477fe4[_0xb43d('0x1c')](_0x38f9b2)[_0xb43d('0x2c')](_0x14fb5f);};}exports[_0xb43d('0x26')]=function(_0xab1497,_0x83cb18){if(_0xab1497[_0xb43d('0x2d')]['id']){delete _0xab1497[_0xb43d('0x2d')]['id'];}return db['Action'][_0xb43d('0x2e')]({'where':{'id':_0xab1497[_0xb43d('0x2f')]['id']}})[_0xb43d('0x28')](handleEntityNotFound(_0x83cb18,null))['then'](saveUpdates(_0xab1497[_0xb43d('0x2d')],null))[_0xb43d('0x28')](respondWithResult(_0x83cb18,null))[_0xb43d('0x30')](handleError(_0x83cb18,null));};exports['destroy']=function(_0x5088ea,_0x49510){return db[_0xb43d('0x31')]['find']({'where':{'id':_0x5088ea['params']['id']}})[_0xb43d('0x28')](handleEntityNotFound(_0x49510,null))[_0xb43d('0x28')](removeEntity(_0x49510,null))[_0xb43d('0x30')](handleError(_0x49510,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5417455..0490692 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 _0x2802=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x5f486f,_0x1472c5){var _0x5226b6=function(_0xa7da6b){while(--_0xa7da6b){_0x5f486f['push'](_0x5f486f['shift']());}};_0x5226b6(++_0x1472c5);}(_0x2802,0x118));var _0x2280=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0x2802[_0x584291];return _0x4e7d08;};'use strict';var _=require(_0x2280('0x0'));var util=require(_0x2280('0x1'));var logger=require(_0x2280('0x2'))(_0x2280('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2280('0x4'));var fs=require('fs');var path=require(_0x2280('0x5'));var rimraf=require(_0x2280('0x6'));var config=require(_0x2280('0x7'));var attributes=require(_0x2280('0x8'));module[_0x2280('0x9')]=function(_0x809d72,_0x3c971d){return _0x809d72[_0x2280('0xa')](_0x2280('0xb'),attributes,{'tableName':_0x2280('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd933=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x177fdb,_0x702728){var _0x537fe5=function(_0x580ffe){while(--_0x580ffe){_0x177fdb['push'](_0x177fdb['shift']());}};_0x537fe5(++_0x702728);}(_0xd933,0x1c8));var _0x3d93=function(_0x3fc386,_0x413579){_0x3fc386=_0x3fc386-0x0;var _0x42c521=_0xd933[_0x3fc386];return _0x42c521;};'use strict';var _=require(_0x3d93('0x0'));var util=require(_0x3d93('0x1'));var logger=require(_0x3d93('0x2'))('api');var moment=require(_0x3d93('0x3'));var BPromise=require(_0x3d93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d93('0x5'));var rimraf=require('rimraf');var config=require(_0x3d93('0x6'));var attributes=require('./action.attributes');module[_0x3d93('0x7')]=function(_0x56581d,_0x34b7d1){return _0x56581d['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index e823039..85b6d57 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4975,0x86));var _0x5497=function(_0x40ea51,_0x48e7d2){_0x40ea51=_0x40ea51-0x0;var _0x5f2b67=_0x4975[_0x40ea51];return _0x5f2b67;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +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(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 7baf771..ce739ad 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 _0x91b6=['fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','update','isAuthenticated','exports','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91b6,0x105));var _0x691b=function(_0x248cb3,_0x459c47){_0x248cb3=_0x248cb3-0x0;var _0xe0e822=_0x91b6[_0x248cb3];return _0xe0e822;};'use strict';var multer=require('multer');var util=require(_0x691b('0x0'));var path=require('path');var timeout=require(_0x691b('0x1'));var express=require(_0x691b('0x2'));var router=express['Router']();var fs_extra=require(_0x691b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x691b('0x4'));var config=require(_0x691b('0x5'));var controller=require(_0x691b('0x6'));router[_0x691b('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x691b('0x8')]);router['delete']('/:id',auth[_0x691b('0x9')](),controller['destroy']);module[_0x691b('0xa')]=router; \ No newline at end of file +var _0x1eb3=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./action.controller','/:id','update'];(function(_0x103f5f,_0x2d0dd1){var _0x388142=function(_0x44e6c2){while(--_0x44e6c2){_0x103f5f['push'](_0x103f5f['shift']());}};_0x388142(++_0x2d0dd1);}(_0x1eb3,0x9d));var _0x31eb=function(_0x1979f4,_0x3366aa){_0x1979f4=_0x1979f4-0x0;var _0x32a04e=_0x1eb3[_0x1979f4];return _0x32a04e;};'use strict';var multer=require(_0x31eb('0x0'));var util=require(_0x31eb('0x1'));var path=require(_0x31eb('0x2'));var timeout=require(_0x31eb('0x3'));var express=require(_0x31eb('0x4'));var router=express[_0x31eb('0x5')]();var fs_extra=require(_0x31eb('0x6'));var auth=require(_0x31eb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31eb('0x8'));router['put'](_0x31eb('0x9'),auth['isAuthenticated'](),controller[_0x31eb('0xa')]);router[_0x31eb('0xb')](_0x31eb('0x9'),auth[_0x31eb('0xc')](),controller['destroy']);module[_0x31eb('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 56f0932..15b7ae3 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 _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x41aa4d,_0x51e45f){var _0x3fb7d6=function(_0x3833ec){while(--_0x3833ec){_0x41aa4d['push'](_0x41aa4d['shift']());}};_0x3fb7d6(++_0x51e45f);}(_0x6aa7,0x178));var _0x76aa=function(_0x5b2931,_0x1f4531){_0x5b2931=_0x5b2931-0x0;var _0x38a407=_0x6aa7[_0x5b2931];return _0x38a407;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}}; \ No newline at end of file +var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0xcae7af,_0x12ea35){var _0x476c98=function(_0x5e6a77){while(--_0x5e6a77){_0xcae7af['push'](_0xcae7af['shift']());}};_0x476c98(++_0x12ea35);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index adc3c6a..502adac 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 _0x29ae=['rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','ROUND(%s)','ValidationErrorItem','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','../../components/export/','countTable','COUNT(*)','QueryTypes','run','runReport','left_join','MAX(%s)','DESC','clone','rimraf','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','get','CustomReports','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x29ae,0x17e));var _0xe29a=function(_0x2da9fb,_0x3af2d0){_0x2da9fb=_0x2da9fb-0x0;var _0x5345a5=_0x29ae[_0x2da9fb];return _0x5345a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe29a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe29a('0x1'));var BPromise=require(_0xe29a('0x2'));var Mustache=require(_0xe29a('0x3'));var util=require(_0xe29a('0x4'));var path=require(_0xe29a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe29a('0x6'));var squel=require(_0xe29a('0x7'));var crypto=require(_0xe29a('0x8'));var jsforce=require(_0xe29a('0x9'));var deskjs=require(_0xe29a('0xa'));var toCsv=require(_0xe29a('0xb'));var querystring=require(_0xe29a('0xc'));var Papa=require(_0xe29a('0xd'));var Redis=require(_0xe29a('0xe'));var authService=require(_0xe29a('0xf'));var qs=require(_0xe29a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe29a('0x11'));var logger=require('../../config/logger')(_0xe29a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe29a('0x13'));var db=require(_0xe29a('0x14'))['db'];var dbH=require('../../mysqldb')[_0xe29a('0x15')];function respondWithStatusCode(_0x356e36,_0x599402){_0x599402=_0x599402||0xcc;return function(_0x5993de){if(_0x5993de){return _0x356e36[_0xe29a('0x16')](_0x599402);}return _0x356e36[_0xe29a('0x17')](_0x599402)[_0xe29a('0x18')]();};}function respondWithResult(_0x4d7a36,_0x2d609a){_0x2d609a=_0x2d609a||0xc8;return function(_0xbb8ab2){if(_0xbb8ab2){return _0x4d7a36[_0xe29a('0x17')](_0x2d609a)['json'](_0xbb8ab2);}};}function respondWithFilteredResult(_0x4599c2,_0x89a241){return function(_0x1a527d){if(_0x1a527d){var _0x3d178f=typeof _0x89a241['offset']===_0xe29a('0x19')&&typeof _0x89a241[_0xe29a('0x1a')]===_0xe29a('0x19');var _0x3fb2fe=_0x1a527d[_0xe29a('0x1b')];var _0x3a8d25=_0x3d178f?0x0:_0x89a241[_0xe29a('0x1c')];var _0x2ef75a=_0x3d178f?_0x1a527d['count']:_0x89a241['offset']+_0x89a241[_0xe29a('0x1a')];var _0xfa844e;if(_0x2ef75a>=_0x3fb2fe){_0x2ef75a=_0x3fb2fe;_0xfa844e=0xc8;}else{_0xfa844e=0xce;}_0x4599c2[_0xe29a('0x17')](_0xfa844e);return _0x4599c2[_0xe29a('0x1d')](_0xe29a('0x1e'),_0x3a8d25+'-'+_0x2ef75a+'/'+_0x3fb2fe)[_0xe29a('0x1f')](_0x1a527d);}return null;};}function patchUpdates(_0x23b056){return function(_0x2a9b7a){try{jsonpatch[_0xe29a('0x20')](_0x2a9b7a,_0x23b056,!![]);}catch(_0x5288ce){return BPromise[_0xe29a('0x21')](_0x5288ce);}return _0x2a9b7a['save']();};}function saveUpdates(_0xeedbe1,_0x3d7571){return function(_0x31f5b6){if(_0x31f5b6){return _0x31f5b6['update'](_0xeedbe1)[_0xe29a('0x22')](function(_0x2a583b){return _0x2a583b;});}return null;};}function removeEntity(_0x47d4c8,_0x47cc5c){return function(_0x5201db){if(_0x5201db){return _0x5201db[_0xe29a('0x23')]()[_0xe29a('0x22')](function(){var _0x53649b=_0x5201db[_0xe29a('0x24')]({'plain':!![]});var _0x3b20bb=_0xe29a('0x25');return db['UserProfileResource'][_0xe29a('0x23')]({'where':{'type':_0x3b20bb,'resourceId':_0x53649b['id']}})[_0xe29a('0x22')](function(){return _0x5201db;});})[_0xe29a('0x22')](function(){_0x47d4c8[_0xe29a('0x17')](0xcc)[_0xe29a('0x18')]();});}};}function handleEntityNotFound(_0x5d1293,_0x28e550){return function(_0x5ec50f){if(!_0x5ec50f){_0x5d1293[_0xe29a('0x16')](0x194);}return _0x5ec50f;};}function handleError(_0x13a72f,_0x45a93d){_0x45a93d=_0x45a93d||0x1f4;return function(_0xeb7880){logger['error'](_0xeb7880[_0xe29a('0x26')]);if(_0xeb7880[_0xe29a('0x27')]){delete _0xeb7880['name'];}_0x13a72f[_0xe29a('0x17')](_0x45a93d)[_0xe29a('0x28')](_0xeb7880);};}exports['index']=function(_0x4fbfa1,_0x413ab7){var _0x39b30e={},_0x4c823c={},_0x28a740={'count':0x0,'rows':[]};var _0x3528c3=_[_0xe29a('0x29')](db[_0xe29a('0x2a')][_0xe29a('0x2b')],function(_0x299f4c){return{'name':_0x299f4c[_0xe29a('0x2c')],'type':_0x299f4c[_0xe29a('0x2d')][_0xe29a('0x2e')]};});_0x4c823c['model']=_[_0xe29a('0x29')](_0x3528c3,'name');_0x4c823c['query']=_[_0xe29a('0x2f')](_0x4fbfa1['query']);_0x4c823c[_0xe29a('0x30')]=_[_0xe29a('0x31')](_0x4c823c[_0xe29a('0x32')],_0x4c823c[_0xe29a('0x33')]);_0x39b30e[_0xe29a('0x34')]=_[_0xe29a('0x31')](_0x4c823c[_0xe29a('0x32')],qs[_0xe29a('0x35')](_0x4fbfa1['query']['fields']));_0x39b30e[_0xe29a('0x34')]=_0x39b30e[_0xe29a('0x34')][_0xe29a('0x36')]?_0x39b30e[_0xe29a('0x34')]:_0x4c823c[_0xe29a('0x32')];if(!_0x4fbfa1[_0xe29a('0x33')][_0xe29a('0x37')]('nolimit')){_0x39b30e[_0xe29a('0x1a')]=qs['limit'](_0x4fbfa1[_0xe29a('0x33')]['limit']);_0x39b30e[_0xe29a('0x1c')]=qs[_0xe29a('0x1c')](_0x4fbfa1[_0xe29a('0x33')][_0xe29a('0x1c')]);}_0x39b30e[_0xe29a('0x38')]=qs[_0xe29a('0x39')](_0x4fbfa1[_0xe29a('0x33')][_0xe29a('0x39')]);_0x39b30e[_0xe29a('0x3a')]=qs[_0xe29a('0x30')](_[_0xe29a('0x3b')](_0x4fbfa1[_0xe29a('0x33')],_0x4c823c[_0xe29a('0x30')]),_0x3528c3);if(_0x4fbfa1[_0xe29a('0x33')][_0xe29a('0x3c')]){_0x39b30e[_0xe29a('0x3a')]=_[_0xe29a('0x3d')](_0x39b30e[_0xe29a('0x3a')],{'$or':_[_0xe29a('0x29')](_0x3528c3,function(_0x2a68bc){if(_0x2a68bc[_0xe29a('0x2d')]!==_0xe29a('0x3e')){var _0xb8d229={};_0xb8d229[_0x2a68bc[_0xe29a('0x27')]]={'$like':'%'+_0x4fbfa1[_0xe29a('0x33')]['filter']+'%'};return _0xb8d229;}})});}_0x39b30e=_[_0xe29a('0x3d')]({},_0x39b30e,_0x4fbfa1['options']);var _0x5c8e86={'where':_0x39b30e[_0xe29a('0x3a')]};return db[_0xe29a('0x2a')]['count'](_0x5c8e86)[_0xe29a('0x22')](function(_0x47798e){_0x28a740[_0xe29a('0x1b')]=_0x47798e;if(_0x4fbfa1[_0xe29a('0x33')][_0xe29a('0x3f')]){_0x39b30e['include']=[{'all':!![]}];}return db[_0xe29a('0x2a')]['findAll'](_0x39b30e);})[_0xe29a('0x22')](function(_0x5bcfc0){_0x28a740[_0xe29a('0x40')]=_0x5bcfc0;return _0x28a740;})['then'](respondWithFilteredResult(_0x413ab7,_0x39b30e))[_0xe29a('0x41')](handleError(_0x413ab7,null));};exports[_0xe29a('0x42')]=function(_0x571664,_0x5e40d4){var _0x978afd={'raw':![],'where':{'id':_0x571664[_0xe29a('0x43')]['id']}},_0x460765={};_0x460765[_0xe29a('0x32')]=_[_0xe29a('0x2f')](db[_0xe29a('0x2a')][_0xe29a('0x2b')]);_0x460765[_0xe29a('0x33')]=_[_0xe29a('0x2f')](_0x571664[_0xe29a('0x33')]);_0x460765[_0xe29a('0x30')]=_[_0xe29a('0x31')](_0x460765['model'],_0x460765[_0xe29a('0x33')]);_0x978afd[_0xe29a('0x34')]=_[_0xe29a('0x31')](_0x460765[_0xe29a('0x32')],qs['fields'](_0x571664['query'][_0xe29a('0x35')]));_0x978afd[_0xe29a('0x34')]=_0x978afd[_0xe29a('0x34')][_0xe29a('0x36')]?_0x978afd['attributes']:_0x460765[_0xe29a('0x32')];if(_0x571664[_0xe29a('0x33')][_0xe29a('0x3f')]){_0x978afd[_0xe29a('0x44')]=[{'all':!![]}];}_0x978afd=_[_0xe29a('0x3d')]({},_0x978afd,_0x571664[_0xe29a('0x45')]);return db['AnalyticCustomReport'][_0xe29a('0x46')](_0x978afd)[_0xe29a('0x22')](handleEntityNotFound(_0x5e40d4,null))[_0xe29a('0x22')](respondWithResult(_0x5e40d4,null))[_0xe29a('0x41')](handleError(_0x5e40d4,null));};exports['create']=function(_0x502611,_0x2296c0){return db[_0xe29a('0x2a')]['create'](_0x502611[_0xe29a('0x47')],{})[_0xe29a('0x22')](function(_0x334233){var _0x35be4a=_0x502611[_0xe29a('0x48')][_0xe29a('0x24')]({'plain':!![]});if(!_0x35be4a)throw new Error(_0xe29a('0x49'));if(_0x35be4a[_0xe29a('0x4a')]===_0xe29a('0x48')){var _0xee339e=_0x334233['get']({'plain':!![]});var _0x49660f=_0xe29a('0x4b');return db['UserProfileSection'][_0xe29a('0x46')]({'where':{'name':_0x49660f,'userProfileId':_0x35be4a[_0xe29a('0x4c')]},'raw':!![]})[_0xe29a('0x22')](function(_0x4c2383){if(_0x4c2383&&_0x4c2383[_0xe29a('0x4d')]===0x0){return db['UserProfileResource'][_0xe29a('0x4e')]({'name':_0xee339e[_0xe29a('0x27')],'resourceId':_0xee339e['id'],'type':_0xe29a('0x25'),'sectionId':_0x4c2383['id']},{})['then'](function(){return _0x334233;});}else{return _0x334233;}})[_0xe29a('0x41')](function(_0x1f5c78){logger['error'](_0xe29a('0x4f'),_0x1f5c78);throw _0x1f5c78;});}return _0x334233;})[_0xe29a('0x22')](respondWithResult(_0x2296c0,0xc9))[_0xe29a('0x41')](handleError(_0x2296c0,null));};exports[_0xe29a('0x50')]=function(_0x2329ba,_0x41614a){if(_0x2329ba['body']['id']){delete _0x2329ba['body']['id'];}return db['AnalyticCustomReport'][_0xe29a('0x46')]({'where':{'id':_0x2329ba[_0xe29a('0x43')]['id']}})[_0xe29a('0x22')](handleEntityNotFound(_0x41614a,null))[_0xe29a('0x22')](saveUpdates(_0x2329ba[_0xe29a('0x47')],null))[_0xe29a('0x22')](respondWithResult(_0x41614a,null))[_0xe29a('0x41')](handleError(_0x41614a,null));};exports[_0xe29a('0x23')]=function(_0x7d988f,_0x42e894){return db[_0xe29a('0x2a')][_0xe29a('0x46')]({'where':{'id':_0x7d988f[_0xe29a('0x43')]['id']}})[_0xe29a('0x22')](handleEntityNotFound(_0x42e894,null))[_0xe29a('0x22')](removeEntity(_0x42e894,null))[_0xe29a('0x41')](handleError(_0x42e894,null));};exports[_0xe29a('0x51')]=function(_0x554e0b,_0x2a6921){var _0xf96d6d=0xa;var _0x26603c=[_0xe29a('0x52'),'left_join',_0xe29a('0x53'),_0xe29a('0x54')];var _0x203e07={'SUM':'SUM(%s)','COUNT':_0xe29a('0x55'),'COUNT DISTINCT':_0xe29a('0x56'),'MAX':'MAX(%s)','MIN':_0xe29a('0x57'),'AVG':_0xe29a('0x58'),'GROUP_CONCAT':_0xe29a('0x59'),'GROUP_CONCAT ASC':_0xe29a('0x5a'),'GROUP_CONCAT DESC':_0xe29a('0x5b')};var _0x29baad={'SEC_TO_TIME':_0xe29a('0x5c'),'DATE':_0xe29a('0x5d'),'HOUR':_0xe29a('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe29a('0x5f')};var _0x2e3554=function(_0x2e6a6e){return!_[_0xe29a('0x60')]([_0xe29a('0x61'),_0xe29a('0x62'),_0xe29a('0x63'),_0xe29a('0x64')],_0x2e6a6e);};var _0x4e881f=function(_0x2aa3dc){if(!_0x2aa3dc||!_0x2aa3dc['rules'][_0xe29a('0x36')]){return'';}for(var _0x565e9a='(',_0x2a3c53=0x0;_0x2a3c53<_0x2aa3dc[_0xe29a('0x65')][_0xe29a('0x36')];_0x2a3c53+=0x1){_0x2a3c53>0x0&&(_0x565e9a+='\x20'+_0x2aa3dc[_0xe29a('0x66')]+'\x20');_0x565e9a+=_0x2aa3dc[_0xe29a('0x65')][_0x2a3c53][_0xe29a('0x67')]?_0x4e881f(_0x2aa3dc[_0xe29a('0x65')][_0x2a3c53][_0xe29a('0x67')]):_0x2aa3dc[_0xe29a('0x65')][_0x2a3c53][_0xe29a('0x68')]+'\x20'+_0x2aa3dc[_0xe29a('0x65')][_0x2a3c53][_0xe29a('0x69')]+(_0x2e3554(_0x2aa3dc[_0xe29a('0x65')][_0x2a3c53][_0xe29a('0x69')])?'\x20'+_0x2aa3dc[_0xe29a('0x65')][_0x2a3c53][_0xe29a('0x6a')]:'');}return _0x565e9a+')';};var _0x5daca2={'where':{'id':_0x554e0b[_0xe29a('0x43')]['id']}},_0x378b8b,_0x89fe8d,_0x5b8229,_0x3fc891,_0xdc7a87;_0x5daca2=_['merge']({},_0x5daca2,_0x554e0b[_0xe29a('0x45')]);return db[_0xe29a('0x2a')]['find'](_0x5daca2)[_0xe29a('0x22')](function(_0x570ea1){if(_0x570ea1){_0x378b8b=_0x570ea1;return _0x570ea1[_0xe29a('0x6b')]();}return null;})[_0xe29a('0x22')](function(_0x569c4e){if(_0x569c4e){if(!_0x569c4e['length']){throw new db[(_0xe29a('0x6c'))]['ValidationErrorItem'](_0xe29a('0x6d'),0x193);}_0x89fe8d=_0x569c4e;return db[_0xe29a('0x6e')][_0xe29a('0x6f')]({'raw':!![]});}return null;})['then'](function(_0x5bf39f){if(_0x5bf39f){_0x5b8229=_[_0xe29a('0x70')](_0x5bf39f,'id');var _0x43f363;var _0x4e65df=squel[_0xe29a('0x71')]();_0x4e65df[_0xe29a('0x72')](_0x378b8b[_0xe29a('0x73')]);for(var _0xe126c8=0x0;_0xe126c8<_0x89fe8d['length'];_0xe126c8+=0x1){_0x43f363=_0x89fe8d[_0xe126c8]['MetricId']?_0x5b8229[_0x89fe8d[_0xe126c8][_0xe29a('0x74')]][_0xe29a('0x75')]:_0x89fe8d[_0xe126c8][_0xe29a('0x68')];_0x43f363=_0x89fe8d[_0xe126c8][_0xe29a('0x76')]?_[_0xe29a('0x77')](_0x203e07[_0x89fe8d[_0xe126c8][_0xe29a('0x76')]],'%s',_0x43f363):_0x43f363;_0x43f363=_0x89fe8d[_0xe126c8][_0xe29a('0x78')]?_[_0xe29a('0x77')](_0x29baad[_0x89fe8d[_0xe126c8]['format']],'%s',_0x43f363):_0x43f363;if(_0x89fe8d[_0xe126c8][_0xe29a('0x79')]){_0x4e65df[_0xe29a('0x67')](_0x43f363);}_0x89fe8d[_0xe126c8][_0xe29a('0x7a')]&&_0x4e65df[_0xe29a('0x38')](_0x43f363,_0x89fe8d[_0xe126c8][_0xe29a('0x7a')]==='DESC'?![]:!![]);_0x4e65df[_0xe29a('0x68')](_0x43f363,_0x89fe8d[_0xe126c8][_0xe29a('0x7b')]||_0x43f363);}if(_0x378b8b['joins']){_0x378b8b[_0xe29a('0x7c')]=JSON[_0xe29a('0x7d')](_0x378b8b[_0xe29a('0x7c')]);for(var _0x55b00a=0x0;_0x55b00a<_0x378b8b['joins'][_0xe29a('0x36')];_0x55b00a+=0x1){if(_0x378b8b[_0xe29a('0x7c')][_0x55b00a][_0xe29a('0x2d')]&&_['includes'](_0x26603c,_0x378b8b[_0xe29a('0x7c')][_0x55b00a][_0xe29a('0x2d')])&&_0x378b8b['joins'][_0x55b00a][_0xe29a('0x7e')]&&_0x378b8b['joins'][_0x55b00a][_0xe29a('0x7f')]&&_0x378b8b['joins'][_0x55b00a][_0xe29a('0x80')]){_0x4e65df[_0x378b8b['joins'][_0x55b00a]['type']](_0x378b8b[_0xe29a('0x7c')][_0x55b00a][_0xe29a('0x7f')],null,util['format'](_0xe29a('0x81'),_0x378b8b[_0xe29a('0x73')],_0x378b8b[_0xe29a('0x7c')][_0x55b00a][_0xe29a('0x7e')],_0x378b8b[_0xe29a('0x7c')][_0x55b00a]['foreignTable'],_0x378b8b[_0xe29a('0x7c')][_0x55b00a][_0xe29a('0x80')]));}}}if(_0x378b8b[_0xe29a('0x82')]){_0x378b8b[_0xe29a('0x82')]=JSON[_0xe29a('0x7d')](_0x378b8b['conditions']);_0x4e65df['where'](_0x4e881f(_0x378b8b[_0xe29a('0x82')][_0xe29a('0x67')]));}_0xdc7a87=_0x4e65df['clone']();_0x4e65df[_0xe29a('0x1a')](_0xf96d6d);_0x4e65df['offset'](0x0);logger[_0xe29a('0x83')](_0xe29a('0x84'),_0x4e65df[_0xe29a('0x85')]());return dbH['sequelize']['query'](_0x4e65df[_0xe29a('0x85')](),{'type':dbH[_0xe29a('0x86')]['QueryTypes'][_0xe29a('0x87')]});}})[_0xe29a('0x22')](respondWithResult(_0x2a6921,null))['catch'](handleError(_0x2a6921,null));};function runReport(_0x4b3503,_0x574507,_0x35a20e){var _0xe6433e=_0x574507[_0xe29a('0x27')];var _0x51fa3f=0xa;var _0xa45fbb=[_0xe29a('0x52'),'left_join',_0xe29a('0x53'),_0xe29a('0x54')];var _0x2a66e1={'SUM':_0xe29a('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe29a('0x56'),'MAX':'MAX(%s)','MIN':_0xe29a('0x57'),'AVG':_0xe29a('0x58'),'GROUP_CONCAT':_0xe29a('0x59'),'GROUP_CONCAT ASC':_0xe29a('0x5a'),'GROUP_CONCAT DESC':_0xe29a('0x5b')};var _0x11d293={'SEC_TO_TIME':_0xe29a('0x5c'),'DATE':_0xe29a('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xe29a('0x89'),'UNIX_TIMESTAMP':_0xe29a('0x5f')};var _0xf82449=function(_0x59902f){return!_['includes']([_0xe29a('0x61'),_0xe29a('0x62'),_0xe29a('0x63'),_0xe29a('0x64')],_0x59902f);};var _0x482671=function(_0x49632d){if(!_0x49632d||!_0x49632d[_0xe29a('0x65')][_0xe29a('0x36')]){return'';}for(var _0x5b41d9='(',_0x25cc9d=0x0;_0x25cc9d<_0x49632d[_0xe29a('0x65')][_0xe29a('0x36')];_0x25cc9d+=0x1){_0x25cc9d>0x0&&(_0x5b41d9+='\x20'+_0x49632d[_0xe29a('0x66')]+'\x20');_0x5b41d9+=_0x49632d[_0xe29a('0x65')][_0x25cc9d][_0xe29a('0x67')]?_0x482671(_0x49632d[_0xe29a('0x65')][_0x25cc9d]['group']):_0x49632d['rules'][_0x25cc9d][_0xe29a('0x68')]+'\x20'+_0x49632d['rules'][_0x25cc9d][_0xe29a('0x69')]+(_0xf82449(_0x49632d[_0xe29a('0x65')][_0x25cc9d][_0xe29a('0x69')])?'\x20'+_0x49632d[_0xe29a('0x65')][_0x25cc9d][_0xe29a('0x6a')]:'');}return _0x5b41d9+')';};var _0xb96b61={'where':{'id':_0x4b3503['id']}},_0x3ce1c9,_0x4a0c31,_0x10eb44,_0x3be73b,_0x4ca52f;_0xb96b61=_[_0xe29a('0x3d')]({},_0xb96b61,_0x35a20e);return db['AnalyticCustomReport'][_0xe29a('0x46')](_0xb96b61)['then'](function(_0xf1adf5){if(_0xf1adf5){_0x3ce1c9=_0xf1adf5;return _0xf1adf5[_0xe29a('0x6b')]();}return null;})[_0xe29a('0x22')](function(_0x40df2e){if(_0x40df2e){if(!_0x40df2e[_0xe29a('0x36')]){throw new db[(_0xe29a('0x6c'))][(_0xe29a('0x8a'))](_0xe29a('0x6d'),0x193);}_0x4a0c31=_0x40df2e;return db[_0xe29a('0x6e')][_0xe29a('0x6f')]({'raw':!![]});}return null;})['then'](function(_0x3500ea){if(_0x3500ea){_0x10eb44=_[_0xe29a('0x70')](_0x3500ea,'id');var _0x25c688;var _0x4df4ef=squel[_0xe29a('0x71')]();_0x4df4ef['from'](_0x3ce1c9[_0xe29a('0x73')]);for(var _0x31034c=0x0;_0x31034c<_0x4a0c31[_0xe29a('0x36')];_0x31034c+=0x1){_0x25c688=_0x4a0c31[_0x31034c]['MetricId']?_0x10eb44[_0x4a0c31[_0x31034c][_0xe29a('0x74')]][_0xe29a('0x75')]:_0x4a0c31[_0x31034c][_0xe29a('0x68')];_0x25c688=_0x4a0c31[_0x31034c][_0xe29a('0x76')]?_[_0xe29a('0x77')](_0x2a66e1[_0x4a0c31[_0x31034c]['function']],'%s',_0x25c688):_0x25c688;_0x25c688=_0x4a0c31[_0x31034c][_0xe29a('0x78')]?_[_0xe29a('0x77')](_0x11d293[_0x4a0c31[_0x31034c][_0xe29a('0x78')]],'%s',_0x25c688):_0x25c688;if(_0x4a0c31[_0x31034c][_0xe29a('0x79')]){_0x4df4ef[_0xe29a('0x67')](_0x25c688);}_0x4a0c31[_0x31034c][_0xe29a('0x7a')]&&_0x4df4ef[_0xe29a('0x38')](_0x25c688,_0x4a0c31[_0x31034c][_0xe29a('0x7a')]==='DESC'?![]:!![]);_0x4df4ef[_0xe29a('0x68')](_0x25c688,_0x4a0c31[_0x31034c][_0xe29a('0x7b')]||_0x25c688);}if(_0x3ce1c9[_0xe29a('0x7c')]){_0x3ce1c9[_0xe29a('0x7c')]=JSON['parse'](_0x3ce1c9['joins']);for(var _0x40ca4d=0x0;_0x40ca4d<_0x3ce1c9['joins'][_0xe29a('0x36')];_0x40ca4d+=0x1){if(_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d][_0xe29a('0x2d')]&&_['includes'](_0xa45fbb,_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d][_0xe29a('0x2d')])&&_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d]['parentKey']&&_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d][_0xe29a('0x7f')]&&_0x3ce1c9['joins'][_0x40ca4d][_0xe29a('0x80')]){_0x4df4ef[_0x3ce1c9['joins'][_0x40ca4d]['type']](_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d][_0xe29a('0x7f')],null,util[_0xe29a('0x78')](_0xe29a('0x81'),_0x3ce1c9[_0xe29a('0x73')],_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d]['parentKey'],_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d]['foreignTable'],_0x3ce1c9[_0xe29a('0x7c')][_0x40ca4d][_0xe29a('0x80')]));}}}if(_0x3ce1c9[_0xe29a('0x82')]){_0x3ce1c9[_0xe29a('0x82')]=JSON[_0xe29a('0x7d')](_0x3ce1c9[_0xe29a('0x82')]);_0x4df4ef[_0xe29a('0x3a')](_0x482671(_0x3ce1c9[_0xe29a('0x82')][_0xe29a('0x67')]));}_0x4ca52f=_0x4df4ef['clone']();_0x4df4ef[_0xe29a('0x1a')](_0x51fa3f);_0x4df4ef[_0xe29a('0x1c')](0x0);return;}})[_0xe29a('0x22')](function(){if(_0x574507[_0xe29a('0x8b')]===_0xe29a('0x8c')){return null;}var _0x32e3d3=_[_0xe29a('0x3d')](_0x574507,{'name':_0x574507[_0xe29a('0x8d')]||_0x574507['name']||_0x3ce1c9['name'],'basename':_0xe6433e,'savename':util[_0xe29a('0x78')](_0xe29a('0x8e'),_0x574507['name']||_0x3ce1c9[_0xe29a('0x27')],require(_0xe29a('0x8f'))[_0xe29a('0x90')](0x4),_0x574507['output']||_0xe29a('0x91')),'reportId':_0x3ce1c9['id'],'reportType':'custom'});return db[_0xe29a('0x92')][_0xe29a('0x4e')](_0x32e3d3,{'raw':!![]});})[_0xe29a('0x22')](function(_0x5aece1){if(_0x3ce1c9[_0xe29a('0x73')]===_0xe29a('0x93')){_0x4ca52f['where'](_0x3ce1c9[_0xe29a('0x73')]+_0xe29a('0x94'),_0x574507[_0xe29a('0x95')],_0x574507[_0xe29a('0x96')]);}else{_0x4ca52f[_0xe29a('0x3a')](_0x3ce1c9[_0xe29a('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x574507['startDate'],_0x574507[_0xe29a('0x96')]);}if(_0x5aece1){logger['info']('Run\x20Query:',_0x4ca52f['toString']());require('child_process')['fork'](path[_0xe29a('0x52')](__dirname,_0xe29a('0x97'),_0x5aece1['output']),[_0x5aece1['id'],_0x4ca52f['toString'](),path[_0xe29a('0x52')](__dirname,'../../files/reports',_0x5aece1['savename']),_0xe6433e]);return _0x5aece1;}else{var _0x410f64=squel[_0xe29a('0x71')]();_0x410f64['from']('('+_0x4ca52f[_0xe29a('0x85')]()+')',_0xe29a('0x98'));_0x410f64['field'](_0xe29a('0x99'),_0xe29a('0x1b'));_0x4ca52f[_0xe29a('0x1a')](_0x574507[_0xe29a('0x1a')]||_0x51fa3f);_0x4ca52f['offset'](_0x574507[_0xe29a('0x1c')]||0x0);return dbH['sequelize']['query'](_0x410f64[_0xe29a('0x85')](),{'type':dbH[_0xe29a('0x86')][_0xe29a('0x9a')][_0xe29a('0x87')]})[_0xe29a('0x22')](function(_0x36a2e7){if(!_0x36a2e7[_0xe29a('0x36')]){_0x3be73b=0x0;}else{_0x3be73b=_0x36a2e7[0x0]['count']||0x0;}return dbH[_0xe29a('0x86')][_0xe29a('0x33')](_0x4ca52f[_0xe29a('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xe29a('0x87')]});})[_0xe29a('0x22')](function(_0x5a588c){return{'rows':_0x5a588c||[],'count':_0x3be73b};});}});}exports[_0xe29a('0x9b')]=function(_0x486fbd,_0x59e054){return runReport(_0x486fbd[_0xe29a('0x43')],_0x486fbd[_0xe29a('0x33')],_0x486fbd['options'])['then'](respondWithResult(_0x59e054,null))['catch'](handleError(_0x59e054,null));};exports[_0xe29a('0x9c')]=runReport;exports['query']=function(_0x52f969,_0x11f407){var _0x269cfa=0xa;var _0x4a0943=['join',_0xe29a('0x9d'),'right_join','cross_join'];var _0x1f9546={'SUM':_0xe29a('0x88'),'COUNT':_0xe29a('0x55'),'COUNT DISTINCT':_0xe29a('0x56'),'MAX':_0xe29a('0x9e'),'MIN':'MIN(%s)','AVG':_0xe29a('0x58'),'GROUP_CONCAT':_0xe29a('0x59'),'GROUP_CONCAT ASC':_0xe29a('0x5a'),'GROUP_CONCAT DESC':_0xe29a('0x5b')};var _0x305f3a={'SEC_TO_TIME':_0xe29a('0x5c'),'DATE':_0xe29a('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xe29a('0x89'),'UNIX_TIMESTAMP':_0xe29a('0x5f')};var _0x3a0f33=function(_0x5ee41f){return!_[_0xe29a('0x60')]([_0xe29a('0x61'),_0xe29a('0x62'),_0xe29a('0x63'),_0xe29a('0x64')],_0x5ee41f);};var _0x19a9d1=function(_0x4d8ad4){if(!_0x4d8ad4||!_0x4d8ad4[_0xe29a('0x65')]['length']){return'';}for(var _0x4a92d7='(',_0x47d125=0x0;_0x47d125<_0x4d8ad4[_0xe29a('0x65')][_0xe29a('0x36')];_0x47d125+=0x1){_0x47d125>0x0&&(_0x4a92d7+='\x20'+_0x4d8ad4[_0xe29a('0x66')]+'\x20');_0x4a92d7+=_0x4d8ad4[_0xe29a('0x65')][_0x47d125][_0xe29a('0x67')]?_0x19a9d1(_0x4d8ad4[_0xe29a('0x65')][_0x47d125][_0xe29a('0x67')]):_0x4d8ad4['rules'][_0x47d125][_0xe29a('0x68')]+'\x20'+_0x4d8ad4['rules'][_0x47d125]['condition']+(_0x3a0f33(_0x4d8ad4[_0xe29a('0x65')][_0x47d125]['condition'])?'\x20'+_0x4d8ad4[_0xe29a('0x65')][_0x47d125][_0xe29a('0x6a')]:'');}return _0x4a92d7+')';};var _0x2ffbf2={'where':{'id':_0x52f969[_0xe29a('0x43')]['id']}},_0x21ab8e,_0xc18bc3,_0x496afd,_0x172aad,_0x30dfb0;_0x2ffbf2=_[_0xe29a('0x3d')]({},_0x2ffbf2,_0x52f969[_0xe29a('0x45')]);return db[_0xe29a('0x2a')]['find'](_0x2ffbf2)[_0xe29a('0x22')](function(_0x5cd893){if(_0x5cd893){_0x21ab8e=_0x5cd893;return _0x5cd893['getFields']();}return null;})[_0xe29a('0x22')](function(_0x13ffc7){if(_0x13ffc7){if(!_0x13ffc7[_0xe29a('0x36')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe29a('0x6d'),0x193);}_0xc18bc3=_0x13ffc7;return db[_0xe29a('0x6e')][_0xe29a('0x6f')]({'raw':!![]});}return null;})[_0xe29a('0x22')](function(_0x4017d0){if(_0x4017d0){_0x496afd=_[_0xe29a('0x70')](_0x4017d0,'id');var _0x3969e9;var _0x3d66f1=squel[_0xe29a('0x71')]();_0x3d66f1[_0xe29a('0x72')](_0x21ab8e[_0xe29a('0x73')]);for(var _0x3ef721=0x0;_0x3ef721<_0xc18bc3[_0xe29a('0x36')];_0x3ef721+=0x1){_0x3969e9=_0xc18bc3[_0x3ef721][_0xe29a('0x74')]?_0x496afd[_0xc18bc3[_0x3ef721][_0xe29a('0x74')]][_0xe29a('0x75')]:_0xc18bc3[_0x3ef721][_0xe29a('0x68')];_0x3969e9=_0xc18bc3[_0x3ef721][_0xe29a('0x76')]?_[_0xe29a('0x77')](_0x1f9546[_0xc18bc3[_0x3ef721][_0xe29a('0x76')]],'%s',_0x3969e9):_0x3969e9;_0x3969e9=_0xc18bc3[_0x3ef721]['format']?_['replace'](_0x305f3a[_0xc18bc3[_0x3ef721][_0xe29a('0x78')]],'%s',_0x3969e9):_0x3969e9;if(_0xc18bc3[_0x3ef721][_0xe29a('0x79')]){_0x3d66f1[_0xe29a('0x67')](_0x3969e9);}_0xc18bc3[_0x3ef721][_0xe29a('0x7a')]&&_0x3d66f1[_0xe29a('0x38')](_0x3969e9,_0xc18bc3[_0x3ef721]['orderBy']===_0xe29a('0x9f')?![]:!![]);_0x3d66f1[_0xe29a('0x68')](_0x3969e9,_0xc18bc3[_0x3ef721][_0xe29a('0x7b')]||_0x3969e9);}if(_0x21ab8e[_0xe29a('0x7c')]){_0x21ab8e['joins']=JSON[_0xe29a('0x7d')](_0x21ab8e['joins']);for(var _0xf06b6a=0x0;_0xf06b6a<_0x21ab8e[_0xe29a('0x7c')][_0xe29a('0x36')];_0xf06b6a+=0x1){if(_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x2d')]&&_[_0xe29a('0x60')](_0x4a0943,_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a]['type'])&&_0x21ab8e['joins'][_0xf06b6a][_0xe29a('0x7e')]&&_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x7f')]&&_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x80')]){_0x3d66f1[_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x2d')]](_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x7f')],null,util[_0xe29a('0x78')]('%s.%s\x20=\x20%s.%s',_0x21ab8e[_0xe29a('0x73')],_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x7e')],_0x21ab8e[_0xe29a('0x7c')][_0xf06b6a][_0xe29a('0x7f')],_0x21ab8e['joins'][_0xf06b6a][_0xe29a('0x80')]));}}}if(_0x21ab8e[_0xe29a('0x82')]){_0x21ab8e[_0xe29a('0x82')]=JSON[_0xe29a('0x7d')](_0x21ab8e[_0xe29a('0x82')]);_0x3d66f1[_0xe29a('0x3a')](_0x19a9d1(_0x21ab8e[_0xe29a('0x82')][_0xe29a('0x67')]));}_0x30dfb0=_0x3d66f1[_0xe29a('0xa0')]();_0x3d66f1['limit'](_0x269cfa);_0x3d66f1[_0xe29a('0x1c')](0x0);logger[_0xe29a('0x83')](_0xe29a('0x84'),_0x3d66f1[_0xe29a('0x85')]());return dbH[_0xe29a('0x86')][_0xe29a('0x33')](_0x3d66f1[_0xe29a('0x85')](),{'type':dbH[_0xe29a('0x86')][_0xe29a('0x9a')][_0xe29a('0x87')]});}})['then'](function(){return{'sql':_0x30dfb0[_0xe29a('0x85')]()};})[_0xe29a('0x22')](respondWithResult(_0x11f407,null))['catch'](handleError(_0x11f407,null));}; \ No newline at end of file +var _0xf0b0=['groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20NULL','keyBy','replace','alias','output','web','%s-%s.%s','randomstring','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','find','catch','create','body','role','user','Reports','UserProfileSection','UserProfileResource','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','format'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xf0b0,0xd1));var _0x0f0b=function(_0x26a99d,_0x1a746e){_0x26a99d=_0x26a99d-0x0;var _0x231c06=_0xf0b0[_0x26a99d];return _0x231c06;};'use strict';var emlformat=require(_0x0f0b('0x0'));var rimraf=require(_0x0f0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f0b('0x2'));var rp=require(_0x0f0b('0x3'));var moment=require(_0x0f0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0f0b('0x5'));var util=require(_0x0f0b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0f0b('0x7'));var ejs=require(_0x0f0b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f0b('0x9'));var squel=require(_0x0f0b('0xa'));var crypto=require(_0x0f0b('0xb'));var jsforce=require(_0x0f0b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0f0b('0x7'));var querystring=require('querystring');var Papa=require(_0x0f0b('0xd'));var Redis=require('ioredis');var authService=require(_0x0f0b('0xe'));var qs=require(_0x0f0b('0xf'));var as=require(_0x0f0b('0x10'));var hardwareService=require(_0x0f0b('0x11'));var logger=require('../../config/logger')(_0x0f0b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f0b('0x13'));var db=require(_0x0f0b('0x14'))['db'];var dbH=require(_0x0f0b('0x14'))[_0x0f0b('0x15')];function respondWithStatusCode(_0x500eea,_0x47a443){_0x47a443=_0x47a443||0xcc;return function(_0x568a05){if(_0x568a05){return _0x500eea[_0x0f0b('0x16')](_0x47a443);}return _0x500eea[_0x0f0b('0x17')](_0x47a443)[_0x0f0b('0x18')]();};}function respondWithResult(_0x4f4bbf,_0x3fa206){_0x3fa206=_0x3fa206||0xc8;return function(_0x53dedc){if(_0x53dedc){return _0x4f4bbf[_0x0f0b('0x17')](_0x3fa206)[_0x0f0b('0x19')](_0x53dedc);}};}function respondWithFilteredResult(_0x1334e6,_0x5491ab){return function(_0x3a64dc){if(_0x3a64dc){var _0x3d6293=typeof _0x5491ab[_0x0f0b('0x1a')]===_0x0f0b('0x1b')&&typeof _0x5491ab['limit']===_0x0f0b('0x1b');var _0xd0f672=_0x3a64dc[_0x0f0b('0x1c')];var _0x1da8e0=_0x3d6293?0x0:_0x5491ab[_0x0f0b('0x1a')];var _0x148284=_0x3d6293?_0x3a64dc[_0x0f0b('0x1c')]:_0x5491ab['offset']+_0x5491ab[_0x0f0b('0x1d')];var _0x2cd771;if(_0x148284>=_0xd0f672){_0x148284=_0xd0f672;_0x2cd771=0xc8;}else{_0x2cd771=0xce;}_0x1334e6['status'](_0x2cd771);return _0x1334e6[_0x0f0b('0x1e')](_0x0f0b('0x1f'),_0x1da8e0+'-'+_0x148284+'/'+_0xd0f672)[_0x0f0b('0x19')](_0x3a64dc);}return null;};}function patchUpdates(_0x35fe61){return function(_0x5d8060){try{jsonpatch[_0x0f0b('0x20')](_0x5d8060,_0x35fe61,!![]);}catch(_0x5a1a44){return BPromise[_0x0f0b('0x21')](_0x5a1a44);}return _0x5d8060[_0x0f0b('0x22')]();};}function saveUpdates(_0x26b05f,_0x2bf01f){return function(_0x219d06){if(_0x219d06){return _0x219d06[_0x0f0b('0x23')](_0x26b05f)[_0x0f0b('0x24')](function(_0x4930d7){return _0x4930d7;});}return null;};}function removeEntity(_0x5bac1a,_0x3201f4){return function(_0x2f3aa4){if(_0x2f3aa4){return _0x2f3aa4[_0x0f0b('0x25')]()[_0x0f0b('0x24')](function(){var _0x43093c=_0x2f3aa4[_0x0f0b('0x26')]({'plain':!![]});var _0x4d47aa=_0x0f0b('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d47aa,'resourceId':_0x43093c['id']}})['then'](function(){return _0x2f3aa4;});})[_0x0f0b('0x24')](function(){_0x5bac1a[_0x0f0b('0x17')](0xcc)[_0x0f0b('0x18')]();});}};}function handleEntityNotFound(_0x3fb4f7,_0x16de11){return function(_0x2aaa8d){if(!_0x2aaa8d){_0x3fb4f7[_0x0f0b('0x16')](0x194);}return _0x2aaa8d;};}function handleError(_0x7b4193,_0x155902){_0x155902=_0x155902||0x1f4;return function(_0x3ce895){logger[_0x0f0b('0x28')](_0x3ce895[_0x0f0b('0x29')]);if(_0x3ce895[_0x0f0b('0x2a')]){delete _0x3ce895[_0x0f0b('0x2a')];}_0x7b4193[_0x0f0b('0x17')](_0x155902)[_0x0f0b('0x2b')](_0x3ce895);};}exports[_0x0f0b('0x2c')]=function(_0x2f5788,_0x561fa4){var _0x35a6ea={},_0xabb8dc={},_0x4dd243={'count':0x0,'rows':[]};var _0x376b24=_[_0x0f0b('0x2d')](db[_0x0f0b('0x2e')][_0x0f0b('0x2f')],function(_0x2acd9f){return{'name':_0x2acd9f[_0x0f0b('0x30')],'type':_0x2acd9f[_0x0f0b('0x31')][_0x0f0b('0x32')]};});_0xabb8dc['model']=_['map'](_0x376b24,_0x0f0b('0x2a'));_0xabb8dc['query']=_['keys'](_0x2f5788['query']);_0xabb8dc['filters']=_[_0x0f0b('0x33')](_0xabb8dc[_0x0f0b('0x34')],_0xabb8dc[_0x0f0b('0x35')]);_0x35a6ea['attributes']=_['intersection'](_0xabb8dc['model'],qs[_0x0f0b('0x36')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x36')]));_0x35a6ea[_0x0f0b('0x37')]=_0x35a6ea['attributes'][_0x0f0b('0x38')]?_0x35a6ea[_0x0f0b('0x37')]:_0xabb8dc[_0x0f0b('0x34')];if(!_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x39')](_0x0f0b('0x3a'))){_0x35a6ea[_0x0f0b('0x1d')]=qs[_0x0f0b('0x1d')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x1d')]);_0x35a6ea[_0x0f0b('0x1a')]=qs['offset'](_0x2f5788[_0x0f0b('0x35')]['offset']);}_0x35a6ea[_0x0f0b('0x3b')]=qs[_0x0f0b('0x3c')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x3c')]);_0x35a6ea[_0x0f0b('0x3d')]=qs[_0x0f0b('0x3e')](_[_0x0f0b('0x3f')](_0x2f5788[_0x0f0b('0x35')],_0xabb8dc[_0x0f0b('0x3e')]),_0x376b24);if(_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x40')]){_0x35a6ea[_0x0f0b('0x3d')]=_[_0x0f0b('0x41')](_0x35a6ea[_0x0f0b('0x3d')],{'$or':_[_0x0f0b('0x2d')](_0x376b24,function(_0x4f9553){if(_0x4f9553['type']!==_0x0f0b('0x42')){var _0x222efd={};_0x222efd[_0x4f9553[_0x0f0b('0x2a')]]={'$like':'%'+_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x40')]+'%'};return _0x222efd;}})});}_0x35a6ea=_[_0x0f0b('0x41')]({},_0x35a6ea,_0x2f5788[_0x0f0b('0x43')]);var _0x462fae={'where':_0x35a6ea[_0x0f0b('0x3d')]};return db[_0x0f0b('0x2e')][_0x0f0b('0x1c')](_0x462fae)[_0x0f0b('0x24')](function(_0x593476){_0x4dd243[_0x0f0b('0x1c')]=_0x593476;if(_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x44')]){_0x35a6ea[_0x0f0b('0x45')]=[{'all':!![]}];}return db[_0x0f0b('0x2e')][_0x0f0b('0x46')](_0x35a6ea);})[_0x0f0b('0x24')](function(_0x19590a){_0x4dd243['rows']=_0x19590a;return _0x4dd243;})[_0x0f0b('0x24')](respondWithFilteredResult(_0x561fa4,_0x35a6ea))['catch'](handleError(_0x561fa4,null));};exports['show']=function(_0xfa16be,_0xfa3fe6){var _0x568125={'raw':![],'where':{'id':_0xfa16be[_0x0f0b('0x47')]['id']}},_0x11228d={};_0x11228d[_0x0f0b('0x34')]=_[_0x0f0b('0x48')](db[_0x0f0b('0x2e')][_0x0f0b('0x2f')]);_0x11228d[_0x0f0b('0x35')]=_[_0x0f0b('0x48')](_0xfa16be[_0x0f0b('0x35')]);_0x11228d[_0x0f0b('0x3e')]=_[_0x0f0b('0x33')](_0x11228d['model'],_0x11228d[_0x0f0b('0x35')]);_0x568125[_0x0f0b('0x37')]=_['intersection'](_0x11228d[_0x0f0b('0x34')],qs[_0x0f0b('0x36')](_0xfa16be[_0x0f0b('0x35')][_0x0f0b('0x36')]));_0x568125['attributes']=_0x568125[_0x0f0b('0x37')][_0x0f0b('0x38')]?_0x568125[_0x0f0b('0x37')]:_0x11228d[_0x0f0b('0x34')];if(_0xfa16be[_0x0f0b('0x35')][_0x0f0b('0x44')]){_0x568125[_0x0f0b('0x45')]=[{'all':!![]}];}_0x568125=_[_0x0f0b('0x41')]({},_0x568125,_0xfa16be[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0x568125)[_0x0f0b('0x24')](handleEntityNotFound(_0xfa3fe6,null))['then'](respondWithResult(_0xfa3fe6,null))[_0x0f0b('0x4a')](handleError(_0xfa3fe6,null));};exports[_0x0f0b('0x4b')]=function(_0x381118,_0x132526){return db[_0x0f0b('0x2e')]['create'](_0x381118[_0x0f0b('0x4c')],{})['then'](function(_0x20c01c){var _0x238323=_0x381118['user']['get']({'plain':!![]});if(!_0x238323)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x238323[_0x0f0b('0x4d')]===_0x0f0b('0x4e')){var _0x4eacd2=_0x20c01c[_0x0f0b('0x26')]({'plain':!![]});var _0x1e9397=_0x0f0b('0x4f');return db[_0x0f0b('0x50')][_0x0f0b('0x49')]({'where':{'name':_0x1e9397,'userProfileId':_0x238323['userProfileId']},'raw':!![]})[_0x0f0b('0x24')](function(_0x3b1ae9){if(_0x3b1ae9&&_0x3b1ae9['autoAssociation']===0x0){return db[_0x0f0b('0x51')]['create']({'name':_0x4eacd2['name'],'resourceId':_0x4eacd2['id'],'type':_0x0f0b('0x27'),'sectionId':_0x3b1ae9['id']},{})['then'](function(){return _0x20c01c;});}else{return _0x20c01c;}})['catch'](function(_0x44afec){logger[_0x0f0b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44afec);throw _0x44afec;});}return _0x20c01c;})[_0x0f0b('0x24')](respondWithResult(_0x132526,0xc9))[_0x0f0b('0x4a')](handleError(_0x132526,null));};exports[_0x0f0b('0x23')]=function(_0x717119,_0x16f4cd){if(_0x717119[_0x0f0b('0x4c')]['id']){delete _0x717119[_0x0f0b('0x4c')]['id'];}return db[_0x0f0b('0x2e')][_0x0f0b('0x49')]({'where':{'id':_0x717119['params']['id']}})[_0x0f0b('0x24')](handleEntityNotFound(_0x16f4cd,null))[_0x0f0b('0x24')](saveUpdates(_0x717119[_0x0f0b('0x4c')],null))[_0x0f0b('0x24')](respondWithResult(_0x16f4cd,null))['catch'](handleError(_0x16f4cd,null));};exports[_0x0f0b('0x25')]=function(_0x38eefb,_0x2b88f8){return db[_0x0f0b('0x2e')][_0x0f0b('0x49')]({'where':{'id':_0x38eefb['params']['id']}})[_0x0f0b('0x24')](handleEntityNotFound(_0x2b88f8,null))[_0x0f0b('0x24')](removeEntity(_0x2b88f8,null))[_0x0f0b('0x4a')](handleError(_0x2b88f8,null));};exports[_0x0f0b('0x52')]=function(_0x375f0f,_0x2feab2){var _0xd25624=0xa;var _0x4b6520=[_0x0f0b('0x53'),_0x0f0b('0x54'),_0x0f0b('0x55'),_0x0f0b('0x56')];var _0x5c4649={'SUM':'SUM(%s)','COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0f0b('0x58'),'MIN':_0x0f0b('0x59'),'AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0f0b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb61db={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x0f0b('0x5c'),'ROUND':_0x0f0b('0x5d'),'UNIX_TIMESTAMP':_0x0f0b('0x5e')};var _0x27c9b6=function(_0x282005){return!_[_0x0f0b('0x5f')]([_0x0f0b('0x60'),'IS\x20NOT\x20NULL',_0x0f0b('0x61'),_0x0f0b('0x62')],_0x282005);};var _0x100a5e=function(_0x9e852e){if(!_0x9e852e||!_0x9e852e[_0x0f0b('0x63')]['length']){return'';}for(var _0x200963='(',_0x1760c5=0x0;_0x1760c5<_0x9e852e['rules']['length'];_0x1760c5+=0x1){_0x1760c5>0x0&&(_0x200963+='\x20'+_0x9e852e[_0x0f0b('0x64')]+'\x20');_0x200963+=_0x9e852e[_0x0f0b('0x63')][_0x1760c5]['group']?_0x100a5e(_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x65')]):_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x66')]+'\x20'+_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x67')]+(_0x27c9b6(_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x67')])?'\x20'+_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x68')]:'');}return _0x200963+')';};var _0x837d00={'where':{'id':_0x375f0f[_0x0f0b('0x47')]['id']}},_0x1f69a4,_0x352073,_0x23e42e,_0x2c7867,_0x247e35;_0x837d00=_[_0x0f0b('0x41')]({},_0x837d00,_0x375f0f[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0x837d00)[_0x0f0b('0x24')](function(_0x4513ad){if(_0x4513ad){_0x1f69a4=_0x4513ad;return _0x4513ad[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0xf68000){if(_0xf68000){if(!_0xf68000[_0x0f0b('0x38')]){throw new db[(_0x0f0b('0x6a'))][(_0x0f0b('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x352073=_0xf68000;return db[_0x0f0b('0x6c')][_0x0f0b('0x46')]({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x4dda88){if(_0x4dda88){_0x23e42e=_['keyBy'](_0x4dda88,'id');var _0x593af5;var _0x387281=squel[_0x0f0b('0x6d')]();_0x387281[_0x0f0b('0x6e')](_0x1f69a4['table']);for(var _0x2fc598=0x0;_0x2fc598<_0x352073[_0x0f0b('0x38')];_0x2fc598+=0x1){_0x593af5=_0x352073[_0x2fc598]['MetricId']?_0x23e42e[_0x352073[_0x2fc598][_0x0f0b('0x6f')]][_0x0f0b('0x70')]:_0x352073[_0x2fc598][_0x0f0b('0x66')];_0x593af5=_0x352073[_0x2fc598][_0x0f0b('0x71')]?_['replace'](_0x5c4649[_0x352073[_0x2fc598][_0x0f0b('0x71')]],'%s',_0x593af5):_0x593af5;_0x593af5=_0x352073[_0x2fc598][_0x0f0b('0x72')]?_['replace'](_0xb61db[_0x352073[_0x2fc598][_0x0f0b('0x72')]],'%s',_0x593af5):_0x593af5;if(_0x352073[_0x2fc598][_0x0f0b('0x73')]){_0x387281[_0x0f0b('0x65')](_0x593af5);}_0x352073[_0x2fc598][_0x0f0b('0x74')]&&_0x387281['order'](_0x593af5,_0x352073[_0x2fc598]['orderBy']===_0x0f0b('0x75')?![]:!![]);_0x387281[_0x0f0b('0x66')](_0x593af5,_0x352073[_0x2fc598]['alias']||_0x593af5);}if(_0x1f69a4[_0x0f0b('0x76')]){_0x1f69a4[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x1f69a4[_0x0f0b('0x76')]);for(var _0x6343d2=0x0;_0x6343d2<_0x1f69a4[_0x0f0b('0x76')][_0x0f0b('0x38')];_0x6343d2+=0x1){if(_0x1f69a4['joins'][_0x6343d2][_0x0f0b('0x31')]&&_[_0x0f0b('0x5f')](_0x4b6520,_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x31')])&&_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x78')]&&_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x79')]&&_0x1f69a4['joins'][_0x6343d2][_0x0f0b('0x7a')]){_0x387281[_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x31')]](_0x1f69a4['joins'][_0x6343d2]['foreignTable'],null,util['format'](_0x0f0b('0x7b'),_0x1f69a4[_0x0f0b('0x7c')],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x78')],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2]['foreignTable'],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2]['foreignKey']));}}}if(_0x1f69a4['conditions']){_0x1f69a4[_0x0f0b('0x7d')]=JSON[_0x0f0b('0x77')](_0x1f69a4[_0x0f0b('0x7d')]);_0x387281[_0x0f0b('0x3d')](_0x100a5e(_0x1f69a4[_0x0f0b('0x7d')][_0x0f0b('0x65')]));}_0x247e35=_0x387281[_0x0f0b('0x7e')]();_0x387281[_0x0f0b('0x1d')](_0xd25624);_0x387281[_0x0f0b('0x1a')](0x0);logger[_0x0f0b('0x7f')](_0x0f0b('0x80'),_0x387281[_0x0f0b('0x81')]());return dbH[_0x0f0b('0x82')]['query'](_0x387281[_0x0f0b('0x81')](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});}})[_0x0f0b('0x24')](respondWithResult(_0x2feab2,null))['catch'](handleError(_0x2feab2,null));};function runReport(_0x241b12,_0x545300,_0x3f9c7f){var _0x3b6b97=_0x545300['name'];var _0x4b44db=0xa;var _0x2b7045=[_0x0f0b('0x53'),'left_join',_0x0f0b('0x55'),_0x0f0b('0x56')];var _0x27a014={'SUM':_0x0f0b('0x84'),'COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':_0x0f0b('0x85'),'MAX':_0x0f0b('0x58'),'MIN':_0x0f0b('0x59'),'AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0f0b('0x86')};var _0x4c79a5={'SEC_TO_TIME':_0x0f0b('0x87'),'DATE':_0x0f0b('0x88'),'HOUR':'HOUR(%s)','ROUND':_0x0f0b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xee87dd=function(_0x2e169a){return!_[_0x0f0b('0x5f')](['IS\x20NULL',_0x0f0b('0x89'),_0x0f0b('0x61'),_0x0f0b('0x62')],_0x2e169a);};var _0x5e5052=function(_0x5b3fbc){if(!_0x5b3fbc||!_0x5b3fbc[_0x0f0b('0x63')][_0x0f0b('0x38')]){return'';}for(var _0x4d4f01='(',_0x570576=0x0;_0x570576<_0x5b3fbc[_0x0f0b('0x63')]['length'];_0x570576+=0x1){_0x570576>0x0&&(_0x4d4f01+='\x20'+_0x5b3fbc['operator']+'\x20');_0x4d4f01+=_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x65')]?_0x5e5052(_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x65')]):_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x66')]+'\x20'+_0x5b3fbc['rules'][_0x570576][_0x0f0b('0x67')]+(_0xee87dd(_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x67')])?'\x20'+_0x5b3fbc[_0x0f0b('0x63')][_0x570576]['value']:'');}return _0x4d4f01+')';};var _0x1bbe2e={'where':{'id':_0x241b12['id']}},_0x225111,_0x3b14e5,_0x385f5e,_0x152efe,_0x353587;_0x1bbe2e=_[_0x0f0b('0x41')]({},_0x1bbe2e,_0x3f9c7f);return db[_0x0f0b('0x2e')]['find'](_0x1bbe2e)['then'](function(_0x5c7e34){if(_0x5c7e34){_0x225111=_0x5c7e34;return _0x5c7e34[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0x40bc66){if(_0x40bc66){if(!_0x40bc66['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3b14e5=_0x40bc66;return db['AnalyticMetric'][_0x0f0b('0x46')]({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x39fa07){if(_0x39fa07){_0x385f5e=_[_0x0f0b('0x8a')](_0x39fa07,'id');var _0xca7b98;var _0x10b4ec=squel[_0x0f0b('0x6d')]();_0x10b4ec[_0x0f0b('0x6e')](_0x225111['table']);for(var _0x3e2eb6=0x0;_0x3e2eb6<_0x3b14e5[_0x0f0b('0x38')];_0x3e2eb6+=0x1){_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x6f')]?_0x385f5e[_0x3b14e5[_0x3e2eb6][_0x0f0b('0x6f')]]['metric']:_0x3b14e5[_0x3e2eb6]['field'];_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x71')]?_[_0x0f0b('0x8b')](_0x27a014[_0x3b14e5[_0x3e2eb6][_0x0f0b('0x71')]],'%s',_0xca7b98):_0xca7b98;_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x72')]?_[_0x0f0b('0x8b')](_0x4c79a5[_0x3b14e5[_0x3e2eb6]['format']],'%s',_0xca7b98):_0xca7b98;if(_0x3b14e5[_0x3e2eb6]['groupBy']){_0x10b4ec[_0x0f0b('0x65')](_0xca7b98);}_0x3b14e5[_0x3e2eb6]['orderBy']&&_0x10b4ec[_0x0f0b('0x3b')](_0xca7b98,_0x3b14e5[_0x3e2eb6]['orderBy']==='DESC'?![]:!![]);_0x10b4ec[_0x0f0b('0x66')](_0xca7b98,_0x3b14e5[_0x3e2eb6][_0x0f0b('0x8c')]||_0xca7b98);}if(_0x225111['joins']){_0x225111[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x225111[_0x0f0b('0x76')]);for(var _0x2ba180=0x0;_0x2ba180<_0x225111['joins']['length'];_0x2ba180+=0x1){if(_0x225111['joins'][_0x2ba180][_0x0f0b('0x31')]&&_[_0x0f0b('0x5f')](_0x2b7045,_0x225111['joins'][_0x2ba180]['type'])&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x78')]&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x79')]&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x7a')]){_0x10b4ec[_0x225111['joins'][_0x2ba180][_0x0f0b('0x31')]](_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x79')],null,util[_0x0f0b('0x72')](_0x0f0b('0x7b'),_0x225111[_0x0f0b('0x7c')],_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x78')],_0x225111[_0x0f0b('0x76')][_0x2ba180]['foreignTable'],_0x225111['joins'][_0x2ba180][_0x0f0b('0x7a')]));}}}if(_0x225111['conditions']){_0x225111['conditions']=JSON[_0x0f0b('0x77')](_0x225111[_0x0f0b('0x7d')]);_0x10b4ec['where'](_0x5e5052(_0x225111[_0x0f0b('0x7d')][_0x0f0b('0x65')]));}_0x353587=_0x10b4ec[_0x0f0b('0x7e')]();_0x10b4ec['limit'](_0x4b44db);_0x10b4ec[_0x0f0b('0x1a')](0x0);return;}})[_0x0f0b('0x24')](function(){if(_0x545300[_0x0f0b('0x8d')]===_0x0f0b('0x8e')){return null;}var _0xa122dc=_['merge'](_0x545300,{'name':_0x545300['fullPath']||_0x545300[_0x0f0b('0x2a')]||_0x225111[_0x0f0b('0x2a')],'basename':_0x3b6b97,'savename':util[_0x0f0b('0x72')](_0x0f0b('0x8f'),_0x545300[_0x0f0b('0x2a')]||_0x225111['name'],require(_0x0f0b('0x90'))['generate'](0x4),_0x545300[_0x0f0b('0x8d')]||'csv'),'reportId':_0x225111['id'],'reportType':_0x0f0b('0x91')});return db['AnalyticExtractedReport'][_0x0f0b('0x4b')](_0xa122dc,{'raw':!![]});})['then'](function(_0x47d422){if(_0x225111['table']===_0x0f0b('0x92')){_0x353587[_0x0f0b('0x3d')](_0x225111[_0x0f0b('0x7c')]+_0x0f0b('0x93'),_0x545300['startDate'],_0x545300[_0x0f0b('0x94')]);}else{_0x353587[_0x0f0b('0x3d')](_0x225111['table']+_0x0f0b('0x95'),_0x545300[_0x0f0b('0x96')],_0x545300['endDate']);}if(_0x47d422){logger[_0x0f0b('0x97')](_0x0f0b('0x98'),_0x353587[_0x0f0b('0x81')]());require(_0x0f0b('0x99'))['fork'](path[_0x0f0b('0x53')](__dirname,'../../components/export/',_0x47d422[_0x0f0b('0x8d')]),[_0x47d422['id'],_0x353587[_0x0f0b('0x81')](),path[_0x0f0b('0x53')](__dirname,'../../files/reports',_0x47d422[_0x0f0b('0x9a')]),_0x3b6b97]);return _0x47d422;}else{var _0x4ec957=squel[_0x0f0b('0x6d')]();_0x4ec957[_0x0f0b('0x6e')]('('+_0x353587[_0x0f0b('0x81')]()+')',_0x0f0b('0x9b'));_0x4ec957[_0x0f0b('0x66')](_0x0f0b('0x9c'),'count');_0x353587[_0x0f0b('0x1d')](_0x545300[_0x0f0b('0x1d')]||_0x4b44db);_0x353587[_0x0f0b('0x1a')](_0x545300[_0x0f0b('0x1a')]||0x0);return dbH[_0x0f0b('0x82')][_0x0f0b('0x35')](_0x4ec957[_0x0f0b('0x81')](),{'type':dbH['sequelize'][_0x0f0b('0x83')][_0x0f0b('0x9d')]})[_0x0f0b('0x24')](function(_0x4da2a9){if(!_0x4da2a9['length']){_0x152efe=0x0;}else{_0x152efe=_0x4da2a9[0x0][_0x0f0b('0x1c')]||0x0;}return dbH[_0x0f0b('0x82')]['query'](_0x353587['toString'](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});})[_0x0f0b('0x24')](function(_0x1ee745){return{'rows':_0x1ee745||[],'count':_0x152efe};});}});}exports[_0x0f0b('0x9e')]=function(_0x16e285,_0x28bb1a){return runReport(_0x16e285[_0x0f0b('0x47')],_0x16e285[_0x0f0b('0x35')],_0x16e285[_0x0f0b('0x43')])[_0x0f0b('0x24')](respondWithResult(_0x28bb1a,null))[_0x0f0b('0x4a')](handleError(_0x28bb1a,null));};exports[_0x0f0b('0x9f')]=runReport;exports[_0x0f0b('0x35')]=function(_0x210ea4,_0x57d3b2){var _0x1b8ea3=0xa;var _0x23a01b=[_0x0f0b('0x53'),_0x0f0b('0x54'),'right_join',_0x0f0b('0x56')];var _0x5c9b7f={'SUM':_0x0f0b('0x84'),'COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':_0x0f0b('0x85'),'MAX':_0x0f0b('0x58'),'MIN':'MIN(%s)','AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':_0x0f0b('0xa0'),'GROUP_CONCAT ASC':_0x0f0b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x51c664={'SEC_TO_TIME':_0x0f0b('0x87'),'DATE':_0x0f0b('0x88'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0f0b('0x5e')};var _0x140551=function(_0x119e12){return!_['includes']([_0x0f0b('0x60'),_0x0f0b('0x89'),_0x0f0b('0x61'),'IS\x20NOT\x20EMPTY'],_0x119e12);};var _0x1f0338=function(_0x271554){if(!_0x271554||!_0x271554[_0x0f0b('0x63')][_0x0f0b('0x38')]){return'';}for(var _0x53c66b='(',_0x2d8029=0x0;_0x2d8029<_0x271554[_0x0f0b('0x63')][_0x0f0b('0x38')];_0x2d8029+=0x1){_0x2d8029>0x0&&(_0x53c66b+='\x20'+_0x271554[_0x0f0b('0x64')]+'\x20');_0x53c66b+=_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x65')]?_0x1f0338(_0x271554['rules'][_0x2d8029][_0x0f0b('0x65')]):_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x66')]+'\x20'+_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x67')]+(_0x140551(_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x67')])?'\x20'+_0x271554[_0x0f0b('0x63')][_0x2d8029]['value']:'');}return _0x53c66b+')';};var _0xa16e36={'where':{'id':_0x210ea4['params']['id']}},_0x1a3a6b,_0x2ca80c,_0x1c9718,_0x39c043,_0x28087d;_0xa16e36=_['merge']({},_0xa16e36,_0x210ea4[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0xa16e36)[_0x0f0b('0x24')](function(_0x36d195){if(_0x36d195){_0x1a3a6b=_0x36d195;return _0x36d195[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0x2eddcc){if(_0x2eddcc){if(!_0x2eddcc['length']){throw new db[(_0x0f0b('0x6a'))][(_0x0f0b('0x6b'))](_0x0f0b('0xa1'),0x193);}_0x2ca80c=_0x2eddcc;return db[_0x0f0b('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x59d053){if(_0x59d053){_0x1c9718=_[_0x0f0b('0x8a')](_0x59d053,'id');var _0x21e782;var _0x34eb5b=squel[_0x0f0b('0x6d')]();_0x34eb5b[_0x0f0b('0x6e')](_0x1a3a6b[_0x0f0b('0x7c')]);for(var _0x37d017=0x0;_0x37d017<_0x2ca80c['length'];_0x37d017+=0x1){_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x6f')]?_0x1c9718[_0x2ca80c[_0x37d017]['MetricId']][_0x0f0b('0x70')]:_0x2ca80c[_0x37d017][_0x0f0b('0x66')];_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x71')]?_[_0x0f0b('0x8b')](_0x5c9b7f[_0x2ca80c[_0x37d017][_0x0f0b('0x71')]],'%s',_0x21e782):_0x21e782;_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x72')]?_[_0x0f0b('0x8b')](_0x51c664[_0x2ca80c[_0x37d017][_0x0f0b('0x72')]],'%s',_0x21e782):_0x21e782;if(_0x2ca80c[_0x37d017][_0x0f0b('0x73')]){_0x34eb5b[_0x0f0b('0x65')](_0x21e782);}_0x2ca80c[_0x37d017][_0x0f0b('0x74')]&&_0x34eb5b[_0x0f0b('0x3b')](_0x21e782,_0x2ca80c[_0x37d017][_0x0f0b('0x74')]===_0x0f0b('0x75')?![]:!![]);_0x34eb5b[_0x0f0b('0x66')](_0x21e782,_0x2ca80c[_0x37d017][_0x0f0b('0x8c')]||_0x21e782);}if(_0x1a3a6b[_0x0f0b('0x76')]){_0x1a3a6b[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x1a3a6b[_0x0f0b('0x76')]);for(var _0x5c1b8c=0x0;_0x5c1b8c<_0x1a3a6b['joins'][_0x0f0b('0x38')];_0x5c1b8c+=0x1){if(_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x31')]&&_['includes'](_0x23a01b,_0x1a3a6b['joins'][_0x5c1b8c]['type'])&&_0x1a3a6b['joins'][_0x5c1b8c][_0x0f0b('0x78')]&&_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')]&&_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c]['foreignKey']){_0x34eb5b[_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x31')]](_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')],null,util[_0x0f0b('0x72')](_0x0f0b('0x7b'),_0x1a3a6b['table'],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x78')],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x7a')]));}}}if(_0x1a3a6b[_0x0f0b('0x7d')]){_0x1a3a6b[_0x0f0b('0x7d')]=JSON[_0x0f0b('0x77')](_0x1a3a6b[_0x0f0b('0x7d')]);_0x34eb5b[_0x0f0b('0x3d')](_0x1f0338(_0x1a3a6b['conditions'][_0x0f0b('0x65')]));}_0x28087d=_0x34eb5b[_0x0f0b('0x7e')]();_0x34eb5b[_0x0f0b('0x1d')](_0x1b8ea3);_0x34eb5b[_0x0f0b('0x1a')](0x0);logger['debug'](_0x0f0b('0x80'),_0x34eb5b[_0x0f0b('0x81')]());return dbH[_0x0f0b('0x82')][_0x0f0b('0x35')](_0x34eb5b['toString'](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});}})[_0x0f0b('0x24')](function(){return{'sql':_0x28087d[_0x0f0b('0x81')]()};})['then'](respondWithResult(_0x57d3b2,null))[_0x0f0b('0x4a')](handleError(_0x57d3b2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 18ec828..01442a7 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 _0xf4bf=['./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0xf4bf,0x6d));var _0xff4b=function(_0x45ae0d,_0x1ea3b9){_0x45ae0d=_0x45ae0d-0x0;var _0x371826=_0xf4bf[_0x45ae0d];return _0x371826;};'use strict';var _=require(_0xff4b('0x0'));var util=require(_0xff4b('0x1'));var logger=require(_0xff4b('0x2'))('api');var moment=require(_0xff4b('0x3'));var BPromise=require(_0xff4b('0x4'));var rp=require(_0xff4b('0x5'));var fs=require('fs');var path=require(_0xff4b('0x6'));var rimraf=require('rimraf');var config=require(_0xff4b('0x7'));var attributes=require(_0xff4b('0x8'));module[_0xff4b('0x9')]=function(_0x5f41e5,_0x1c75d9){return _0x5f41e5[_0xff4b('0xa')](_0xff4b('0xb'),attributes,{'tableName':_0xff4b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5742=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x2d7766,_0x17b192){var _0x597efb=function(_0x224d6d){while(--_0x224d6d){_0x2d7766['push'](_0x2d7766['shift']());}};_0x597efb(++_0x17b192);}(_0x5742,0x160));var _0x2574=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x5742[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x2574('0x0'));var util=require(_0x2574('0x1'));var logger=require(_0x2574('0x2'))('api');var moment=require(_0x2574('0x3'));var BPromise=require(_0x2574('0x4'));var rp=require(_0x2574('0x5'));var fs=require('fs');var path=require(_0x2574('0x6'));var rimraf=require('rimraf');var config=require(_0x2574('0x7'));var attributes=require(_0x2574('0x8'));module['exports']=function(_0x1a95d2,_0xbed560){return _0x1a95d2['define'](_0x2574('0x9'),attributes,{'tableName':_0x2574('0xa'),'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 3944d17..e23ae88 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 _0xbe00=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x514186,_0x194ee0){var _0x539333=function(_0x26d9ef){while(--_0x26d9ef){_0x514186['push'](_0x514186['shift']());}};_0x539333(++_0x194ee0);}(_0xbe00,0x145));var _0x0be0=function(_0x321318,_0xadfce){_0x321318=_0x321318-0x0;var _0x5044be=_0xbe00[_0x321318];return _0x5044be;};'use strict';var _=require('lodash');var util=require(_0x0be0('0x0'));var moment=require(_0x0be0('0x1'));var BPromise=require(_0x0be0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0be0('0x3'));var db=require(_0x0be0('0x4'))['db'];var utils=require(_0x0be0('0x5'));var logger=require(_0x0be0('0x6'))(_0x0be0('0x7'));var config=require(_0x0be0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0be0('0x9')][_0x0be0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4ea8,_0x8f83ce,_0x3e6528){return new BPromise(function(_0x533e23,_0x516036){return client['request'](_0x2e4ea8,_0x3e6528)[_0x0be0('0xb')](function(_0x12be5d){logger[_0x0be0('0xc')](_0x0be0('0xd'),_0x8f83ce,_0x0be0('0xe'));logger[_0x0be0('0xf')](_0x0be0('0x10'),_0x8f83ce,_0x0be0('0xe'),JSON[_0x0be0('0x11')](_0x12be5d));if(_0x12be5d[_0x0be0('0x12')]){if(_0x12be5d[_0x0be0('0x12')][_0x0be0('0x13')]===0x1f4){logger['error'](_0x0be0('0xd'),_0x8f83ce,_0x12be5d['error'][_0x0be0('0x14')]);return _0x516036(_0x12be5d[_0x0be0('0x12')][_0x0be0('0x14')]);}logger[_0x0be0('0x12')](_0x0be0('0xd'),_0x8f83ce,_0x12be5d[_0x0be0('0x12')]['message']);return _0x533e23(_0x12be5d[_0x0be0('0x12')]['message']);}else{logger[_0x0be0('0xc')](_0x0be0('0xd'),_0x8f83ce,_0x0be0('0xe'));_0x533e23(_0x12be5d['result'][_0x0be0('0x14')]);}})[_0x0be0('0x15')](function(_0x276106){logger[_0x0be0('0x12')](_0x0be0('0xd'),_0x8f83ce,_0x276106);_0x516036(_0x276106);});});} \ No newline at end of file +var _0x6d76=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x4c4b99,_0x3a290f){var _0x150415=function(_0x4b9e37){while(--_0x4b9e37){_0x4c4b99['push'](_0x4c4b99['shift']());}};_0x150415(++_0x3a290f);}(_0x6d76,0x109));var _0x66d7=function(_0x191b08,_0x23f80a){_0x191b08=_0x191b08-0x0;var _0x5d7e91=_0x6d76[_0x191b08];return _0x5d7e91;};'use strict';var _=require(_0x66d7('0x0'));var util=require('util');var moment=require(_0x66d7('0x1'));var BPromise=require(_0x66d7('0x2'));var rs=require(_0x66d7('0x3'));var fs=require('fs');var Redis=require(_0x66d7('0x4'));var db=require(_0x66d7('0x5'))['db'];var utils=require(_0x66d7('0x6'));var logger=require(_0x66d7('0x7'))(_0x66d7('0x8'));var config=require(_0x66d7('0x9'));var jayson=require(_0x66d7('0xa'));var client=jayson[_0x66d7('0xb')][_0x66d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x104ccd,_0x5b9bef,_0x86668c){return new BPromise(function(_0x2fe861,_0x509fff){return client[_0x66d7('0xd')](_0x104ccd,_0x86668c)[_0x66d7('0xe')](function(_0x24f8e7){logger[_0x66d7('0xf')](_0x66d7('0x10'),_0x5b9bef,'request\x20sent');logger['debug'](_0x66d7('0x11'),_0x5b9bef,'request\x20sent',JSON[_0x66d7('0x12')](_0x24f8e7));if(_0x24f8e7[_0x66d7('0x13')]){if(_0x24f8e7[_0x66d7('0x13')][_0x66d7('0x14')]===0x1f4){logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x24f8e7['error']['message']);return _0x509fff(_0x24f8e7['error']['message']);}logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x24f8e7[_0x66d7('0x13')]['message']);return _0x2fe861(_0x24f8e7[_0x66d7('0x13')][_0x66d7('0x15')]);}else{logger[_0x66d7('0xf')](_0x66d7('0x10'),_0x5b9bef,_0x66d7('0x16'));_0x2fe861(_0x24f8e7['result'][_0x66d7('0x15')]);}})[_0x66d7('0x17')](function(_0x5bd07f){logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x5bd07f);_0x509fff(_0x5bd07f);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 810e33c..140e192 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 _0x1322=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0xef7d0a,_0x1b6cd5){var _0x41abf9=function(_0xe90328){while(--_0xe90328){_0xef7d0a['push'](_0xef7d0a['shift']());}};_0x41abf9(++_0x1b6cd5);}(_0x1322,0x1d2));var _0x2132=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x1322[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0x2132('0x0'));var util=require('util');var path=require(_0x2132('0x1'));var timeout=require(_0x2132('0x2'));var express=require(_0x2132('0x3'));var router=express[_0x2132('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2132('0x5'));var config=require(_0x2132('0x6'));var controller=require(_0x2132('0x7'));router[_0x2132('0x8')]('/',auth[_0x2132('0x9')](),controller[_0x2132('0xa')]);router[_0x2132('0x8')](_0x2132('0xb'),auth['isAuthenticated'](),controller[_0x2132('0xc')]);router[_0x2132('0x8')](_0x2132('0xd'),auth['isAuthenticated'](),controller[_0x2132('0xe')]);router[_0x2132('0x8')](_0x2132('0xf'),auth['isAuthenticated'](),controller[_0x2132('0x10')]);router[_0x2132('0x8')](_0x2132('0x11'),auth['isAuthenticated'](),controller[_0x2132('0x12')]);router[_0x2132('0x13')]('/',auth[_0x2132('0x9')](),controller[_0x2132('0x14')]);router[_0x2132('0x15')](_0x2132('0xb'),auth[_0x2132('0x9')](),controller[_0x2132('0x16')]);router[_0x2132('0x17')]('/:id',auth[_0x2132('0x9')](),controller[_0x2132('0x18')]);module[_0x2132('0x19')]=router; \ No newline at end of file +var _0xe072=['put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','create'];(function(_0x53263b,_0x299c08){var _0x3fd94b=function(_0x489939){while(--_0x489939){_0x53263b['push'](_0x53263b['shift']());}};_0x3fd94b(++_0x299c08);}(_0xe072,0x17d));var _0x2e07=function(_0x36221a,_0x37c5b5){_0x36221a=_0x36221a-0x0;var _0x233141=_0xe072[_0x36221a];return _0x233141;};'use strict';var multer=require(_0x2e07('0x0'));var util=require('util');var path=require(_0x2e07('0x1'));var timeout=require(_0x2e07('0x2'));var express=require('express');var router=express[_0x2e07('0x3')]();var fs_extra=require(_0x2e07('0x4'));var auth=require(_0x2e07('0x5'));var interaction=require(_0x2e07('0x6'));var config=require('../../config/environment');var controller=require(_0x2e07('0x7'));router[_0x2e07('0x8')]('/',auth[_0x2e07('0x9')](),controller['index']);router[_0x2e07('0x8')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xb')]);router[_0x2e07('0x8')](_0x2e07('0xc'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xd')]);router[_0x2e07('0x8')](_0x2e07('0xe'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xf')]);router[_0x2e07('0x8')](_0x2e07('0x10'),auth[_0x2e07('0x9')](),controller['query']);router['post']('/',auth[_0x2e07('0x9')](),controller[_0x2e07('0x11')]);router[_0x2e07('0x12')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller['update']);router[_0x2e07('0x13')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller[_0x2e07('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index a4e26fa..5c55fd9 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0xabdd69,_0x4cd0ea){_0xabdd69=_0xabdd69-0x0;var _0x2bdeec=_0x1cb9[_0xabdd69];return _0x2bdeec;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file +var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x55e62b,_0x4f34ac){var _0xa7162f=function(_0x178227){while(--_0x178227){_0x55e62b['push'](_0x55e62b['shift']());}};_0xa7162f(++_0x4f34ac);}(_0x814b,0x1a2));var _0xb814=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x814b[_0x5c6022];return _0x4ab5af;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 8f80582..50fd6a8 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','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','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x56d6fc,_0x1ed9e0){var _0x4e1106=function(_0x57c526){while(--_0x57c526){_0x56d6fc['push'](_0x56d6fc['shift']());}};_0x4e1106(++_0x1ed9e0);}(_0x814b,0x1a2));var _0xb814=function(_0x545e41,_0x55830d){_0x545e41=_0x545e41-0x0;var _0x20ee17=_0x814b[_0x545e41];return _0x20ee17;};'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'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file +var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x31c0e3,_0x3c5cd6){var _0xf34e31=function(_0x312d15){while(--_0x312d15){_0x31c0e3['push'](_0x31c0e3['shift']());}};_0xf34e31(++_0x3c5cd6);}(_0xba34,0x119));var _0x4ba3=function(_0x2106c4,_0x5a3042){_0x2106c4=_0x2106c4-0x0;var _0x287771=_0xba34[_0x2106c4];return _0x287771;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 2b114dc..cbee07a 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 _0x062b=['api','moment','bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x062b,0x1ef));var _0xb062=function(_0x4ced8c,_0x398249){_0x4ced8c=_0x4ced8c-0x0;var _0x56195e=_0x062b[_0x4ced8c];return _0x56195e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb062('0x0'));var moment=require(_0xb062('0x1'));var BPromise=require(_0xb062('0x2'));var rp=require(_0xb062('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb062('0x4'));var attributes=require(_0xb062('0x5'));module[_0xb062('0x6')]=function(_0x3a12e2,_0x2caf1a){return _0x3a12e2[_0xb062('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xb062('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa649=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x32a3c4,_0x1e7e25){var _0x24ddc2=function(_0x31ef94){while(--_0x31ef94){_0x32a3c4['push'](_0x32a3c4['shift']());}};_0x24ddc2(++_0x1e7e25);}(_0xa649,0x12c));var _0x9a64=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa649[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x9a64('0x0'));var util=require(_0x9a64('0x1'));var logger=require(_0x9a64('0x2'))(_0x9a64('0x3'));var moment=require(_0x9a64('0x4'));var BPromise=require(_0x9a64('0x5'));var rp=require(_0x9a64('0x6'));var fs=require('fs');var path=require(_0x9a64('0x7'));var rimraf=require(_0x9a64('0x8'));var config=require(_0x9a64('0x9'));var attributes=require(_0x9a64('0xa'));module[_0x9a64('0xb')]=function(_0x276dc0,_0x145014){return _0x276dc0[_0x9a64('0xc')]('AnalyticDefaultReport',attributes,{'tableName':_0x9a64('0xd'),'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 61ec0c3..34eb131 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 _0xd336=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5b2595,_0x2379e6){var _0x3162be=function(_0x4cb443){while(--_0x4cb443){_0x5b2595['push'](_0x5b2595['shift']());}};_0x3162be(++_0x2379e6);}(_0xd336,0x6c));var _0x6d33=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0xd336[_0x366388];return _0x41c97e;};'use strict';var _=require(_0x6d33('0x0'));var util=require(_0x6d33('0x1'));var moment=require(_0x6d33('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d33('0x3'));var fs=require('fs');var Redis=require(_0x6d33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d33('0x5'));var logger=require(_0x6d33('0x6'))(_0x6d33('0x7'));var config=require(_0x6d33('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d33('0x9')][_0x6d33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca99d,_0x205a7e,_0x42def8){return new BPromise(function(_0x16750b,_0x32afdc){return client[_0x6d33('0xb')](_0x1ca99d,_0x42def8)[_0x6d33('0xc')](function(_0x3b26ca){logger[_0x6d33('0xd')](_0x6d33('0xe'),_0x205a7e,'request\x20sent');logger[_0x6d33('0xf')](_0x6d33('0x10'),_0x205a7e,_0x6d33('0x11'),JSON[_0x6d33('0x12')](_0x3b26ca));if(_0x3b26ca['error']){if(_0x3b26ca[_0x6d33('0x13')][_0x6d33('0x14')]===0x1f4){logger[_0x6d33('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x205a7e,_0x3b26ca[_0x6d33('0x13')][_0x6d33('0x15')]);return _0x32afdc(_0x3b26ca['error']['message']);}logger['error'](_0x6d33('0xe'),_0x205a7e,_0x3b26ca[_0x6d33('0x13')][_0x6d33('0x15')]);return _0x16750b(_0x3b26ca[_0x6d33('0x13')][_0x6d33('0x15')]);}else{logger[_0x6d33('0xd')](_0x6d33('0xe'),_0x205a7e,_0x6d33('0x11'));_0x16750b(_0x3b26ca[_0x6d33('0x16')][_0x6d33('0x15')]);}})[_0x6d33('0x17')](function(_0x53f0d8){logger[_0x6d33('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x205a7e,_0x53f0d8);_0x32afdc(_0x53f0d8);});});} \ No newline at end of file +var _0x466f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x466f,0x9c));var _0xf466=function(_0x18ce99,_0x5ee120){_0x18ce99=_0x18ce99-0x0;var _0x243bfb=_0x466f[_0x18ce99];return _0x243bfb;};'use strict';var _=require('lodash');var util=require(_0xf466('0x0'));var moment=require('moment');var BPromise=require(_0xf466('0x1'));var rs=require(_0xf466('0x2'));var fs=require('fs');var Redis=require(_0xf466('0x3'));var db=require(_0xf466('0x4'))['db'];var utils=require(_0xf466('0x5'));var logger=require(_0xf466('0x6'))('rpc');var config=require(_0xf466('0x7'));var jayson=require(_0xf466('0x8'));var client=jayson[_0xf466('0x9')][_0xf466('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x392209,_0x3388b2,_0x52bb57){return new BPromise(function(_0x3a218d,_0x8cfd4f){return client['request'](_0x392209,_0x52bb57)[_0xf466('0xb')](function(_0x1c716b){logger[_0xf466('0xc')](_0xf466('0xd'),_0x3388b2,_0xf466('0xe'));logger['debug'](_0xf466('0xf'),_0x3388b2,_0xf466('0xe'),JSON['stringify'](_0x1c716b));if(_0x1c716b[_0xf466('0x10')]){if(_0x1c716b[_0xf466('0x10')][_0xf466('0x11')]===0x1f4){logger[_0xf466('0x10')](_0xf466('0xd'),_0x3388b2,_0x1c716b[_0xf466('0x10')]['message']);return _0x8cfd4f(_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);}logger[_0xf466('0x10')](_0xf466('0xd'),_0x3388b2,_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);return _0x3a218d(_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);}else{logger[_0xf466('0xc')](_0xf466('0xd'),_0x3388b2,_0xf466('0xe'));_0x3a218d(_0x1c716b['result'][_0xf466('0x12')]);}})[_0xf466('0x13')](function(_0x593762){logger['error'](_0xf466('0xd'),_0x3388b2,_0x593762);_0x8cfd4f(_0x593762);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index bc990d5..ab95296 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 _0x2825=['/:id/query','post','create','update','delete','exports','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x2825,0x195));var _0x5282=function(_0x41069c,_0x1efd71){_0x41069c=_0x41069c-0x0;var _0x4dab89=_0x2825[_0x41069c];return _0x4dab89;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5282('0x0'));var router=express[_0x5282('0x1')]();var fs_extra=require(_0x5282('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5282('0x3'));var config=require(_0x5282('0x4'));var controller=require(_0x5282('0x5'));router[_0x5282('0x6')]('/',auth['isAuthenticated'](),controller[_0x5282('0x7')]);router['get'](_0x5282('0x8'),auth[_0x5282('0x9')](),controller[_0x5282('0xa')]);router['get'](_0x5282('0xb'),auth[_0x5282('0x9')](),controller[_0x5282('0xc')]);router['get'](_0x5282('0xd'),auth[_0x5282('0x9')](),controller[_0x5282('0xe')]);router[_0x5282('0x6')](_0x5282('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x5282('0x10')]('/',auth[_0x5282('0x9')](),controller[_0x5282('0x11')]);router['put'](_0x5282('0x8'),auth['isAuthenticated'](),controller[_0x5282('0x12')]);router[_0x5282('0x13')](_0x5282('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x5282('0x14')]=router; \ No newline at end of file +var _0x9a4e=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9a4e,0x1ba));var _0xe9a4=function(_0x4742d4,_0x43f49a){_0x4742d4=_0x4742d4-0x0;var _0xc2518f=_0x9a4e[_0x4742d4];return _0xc2518f;};'use strict';var multer=require(_0xe9a4('0x0'));var util=require(_0xe9a4('0x1'));var path=require(_0xe9a4('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9a4('0x3'));var router=express[_0xe9a4('0x4')]();var fs_extra=require(_0xe9a4('0x5'));var auth=require(_0xe9a4('0x6'));var interaction=require(_0xe9a4('0x7'));var config=require('../../config/environment');var controller=require(_0xe9a4('0x8'));router[_0xe9a4('0x9')]('/',auth[_0xe9a4('0xa')](),controller[_0xe9a4('0xb')]);router['get'](_0xe9a4('0xc'),auth['isAuthenticated'](),controller[_0xe9a4('0xd')]);router[_0xe9a4('0x9')](_0xe9a4('0xe'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0xf')]);router[_0xe9a4('0x9')](_0xe9a4('0x10'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x11')]);router[_0xe9a4('0x9')](_0xe9a4('0x12'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x13')]);router[_0xe9a4('0x14')]('/',auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x15')]);router[_0xe9a4('0x16')](_0xe9a4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe9a4('0x17')](_0xe9a4('0xc'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 9874fa4..6c2442a 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 _0x7c0d=['DATE','scheduled','manual','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx'];(function(_0x302f55,_0x31872f){var _0x55ca94=function(_0x477ac3){while(--_0x477ac3){_0x302f55['push'](_0x302f55['shift']());}};_0x55ca94(++_0x31872f);}(_0x7c0d,0x1a6));var _0xd7c0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7c0d[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xd7c0('0x0'));var moment=require(_0xd7c0('0x1'));module['exports']={'name':{'type':Sequelize[_0xd7c0('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd7c0('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd7c0('0x3')](_0xd7c0('0x4'),_0xd7c0('0x5'),_0xd7c0('0x6')),'allowNull':![],'defaultValue':_0xd7c0('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xd7c0('0x7')]},'endDate':{'type':Sequelize[_0xd7c0('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd7c0('0x3')]('manual',_0xd7c0('0x8')),'allowNull':![],'defaultValue':_0xd7c0('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xd7c0('0xa')]},'reportType':{'type':Sequelize[_0xd7c0('0x2')]}}; \ No newline at end of file +var _0xb0b5=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xb0b5,0x12c));var _0x5b0b=function(_0x19cd29,_0x1ac3e7){_0x19cd29=_0x19cd29-0x0;var _0x27c96d=_0xb0b5[_0x19cd29];return _0x27c96d;};'use strict';var Sequelize=require(_0x5b0b('0x0'));var moment=require(_0x5b0b('0x1'));module[_0x5b0b('0x2')]={'name':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x5b0b('0x4')](_0x5b0b('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x5b0b('0x5')},'savename':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5b0b('0x6')]},'endDate':{'type':Sequelize[_0x5b0b('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x5b0b('0x7')},'type':{'type':Sequelize[_0x5b0b('0x4')](_0x5b0b('0x8'),_0x5b0b('0x9')),'allowNull':![],'defaultValue':_0x5b0b('0x8')},'reportId':{'type':Sequelize[_0x5b0b('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5b0b('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 30c6108..fec83ca 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 _0x3f1a=['hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','basename','output','existsSync','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','download','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0xd93406,_0x5041d2){var _0x258da5=function(_0x3b50f1){while(--_0x3b50f1){_0xd93406['push'](_0xd93406['shift']());}};_0x258da5(++_0x5041d2);}(_0x3f1a,0x1b2));var _0xa3f1=function(_0x2099ec,_0x1954b2){_0x2099ec=_0x2099ec-0x0;var _0x5b3621=_0x3f1a[_0x2099ec];return _0x5b3621;};'use strict';var emlformat=require(_0xa3f1('0x0'));var rimraf=require(_0xa3f1('0x1'));var zipdir=require(_0xa3f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3f1('0x3'));var moment=require(_0xa3f1('0x4'));var BPromise=require(_0xa3f1('0x5'));var Mustache=require(_0xa3f1('0x6'));var util=require(_0xa3f1('0x7'));var path=require(_0xa3f1('0x8'));var sox=require('sox');var csv=require(_0xa3f1('0x9'));var ejs=require(_0xa3f1('0xa'));var fs=require('fs');var fs_extra=require(_0xa3f1('0xb'));var _=require(_0xa3f1('0xc'));var squel=require(_0xa3f1('0xd'));var crypto=require('crypto');var jsforce=require(_0xa3f1('0xe'));var deskjs=require(_0xa3f1('0xf'));var toCsv=require(_0xa3f1('0x9'));var querystring=require(_0xa3f1('0x10'));var Papa=require(_0xa3f1('0x11'));var Redis=require(_0xa3f1('0x12'));var authService=require(_0xa3f1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa3f1('0x14'));var hardwareService=require(_0xa3f1('0x15'));var logger=require(_0xa3f1('0x16'))(_0xa3f1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3f1('0x18'));var db=require(_0xa3f1('0x19'))['db'];function respondWithStatusCode(_0xd16f29,_0xcefc64){_0xcefc64=_0xcefc64||0xcc;return function(_0xc2e808){if(_0xc2e808){return _0xd16f29[_0xa3f1('0x1a')](_0xcefc64);}return _0xd16f29['status'](_0xcefc64)[_0xa3f1('0x1b')]();};}function respondWithResult(_0xa06aee,_0x2ad459){_0x2ad459=_0x2ad459||0xc8;return function(_0x3fb889){if(_0x3fb889){return _0xa06aee[_0xa3f1('0x1c')](_0x2ad459)[_0xa3f1('0x1d')](_0x3fb889);}};}function respondWithFilteredResult(_0x170e4d,_0x3ae8bf){return function(_0x3cff6e){if(_0x3cff6e){var _0x54e89e=typeof _0x3ae8bf['offset']===_0xa3f1('0x1e')&&typeof _0x3ae8bf['limit']===_0xa3f1('0x1e');var _0x2f7d35=_0x3cff6e[_0xa3f1('0x1f')];var _0x1684fe=_0x54e89e?0x0:_0x3ae8bf[_0xa3f1('0x20')];var _0x1b929d=_0x54e89e?_0x3cff6e['count']:_0x3ae8bf[_0xa3f1('0x20')]+_0x3ae8bf['limit'];var _0xe02917;if(_0x1b929d>=_0x2f7d35){_0x1b929d=_0x2f7d35;_0xe02917=0xc8;}else{_0xe02917=0xce;}_0x170e4d['status'](_0xe02917);return _0x170e4d[_0xa3f1('0x21')](_0xa3f1('0x22'),_0x1684fe+'-'+_0x1b929d+'/'+_0x2f7d35)[_0xa3f1('0x1d')](_0x3cff6e);}return null;};}function patchUpdates(_0x213810){return function(_0x3ebde3){try{jsonpatch['apply'](_0x3ebde3,_0x213810,!![]);}catch(_0x2520d2){return BPromise['reject'](_0x2520d2);}return _0x3ebde3[_0xa3f1('0x23')]();};}function saveUpdates(_0xadb0eb,_0x28ec44){return function(_0x35d607){if(_0x35d607){return _0x35d607[_0xa3f1('0x24')](_0xadb0eb)[_0xa3f1('0x25')](function(_0x19523f){return _0x19523f;});}return null;};}function removeEntity(_0x18f312,_0xb77088){return function(_0x416e92){if(_0x416e92){return _0x416e92[_0xa3f1('0x26')]()[_0xa3f1('0x25')](function(){var _0x2e6a0c=_0x416e92[_0xa3f1('0x27')]({'plain':!![]});var _0x3bd138='ExtractedReports';return db[_0xa3f1('0x28')]['destroy']({'where':{'type':_0x3bd138,'resourceId':_0x2e6a0c['id']}})[_0xa3f1('0x25')](function(){return _0x416e92;});})[_0xa3f1('0x25')](function(){_0x18f312[_0xa3f1('0x1c')](0xcc)[_0xa3f1('0x1b')]();});}};}function handleEntityNotFound(_0x36bef3,_0x5e9603){return function(_0x4d0ca3){if(!_0x4d0ca3){_0x36bef3['sendStatus'](0x194);}return _0x4d0ca3;};}function handleError(_0x33d7ce,_0x29a961){_0x29a961=_0x29a961||0x1f4;return function(_0x105548){logger['error'](_0x105548[_0xa3f1('0x29')]);if(_0x105548[_0xa3f1('0x2a')]){delete _0x105548[_0xa3f1('0x2a')];}_0x33d7ce[_0xa3f1('0x1c')](_0x29a961)[_0xa3f1('0x2b')](_0x105548);};}exports[_0xa3f1('0x2c')]=function(_0x5e159b,_0x328af3){var _0x546b70={},_0x1f323e={},_0x4c2e68={'count':0x0,'rows':[]};var _0x309e07=_[_0xa3f1('0x2d')](db[_0xa3f1('0x2e')]['rawAttributes'],function(_0x2eb10b){return{'name':_0x2eb10b['fieldName'],'type':_0x2eb10b[_0xa3f1('0x2f')][_0xa3f1('0x30')]};});_0x1f323e[_0xa3f1('0x31')]=_[_0xa3f1('0x2d')](_0x309e07,_0xa3f1('0x2a'));_0x1f323e[_0xa3f1('0x32')]=_[_0xa3f1('0x33')](_0x5e159b[_0xa3f1('0x32')]);_0x1f323e['filters']=_[_0xa3f1('0x34')](_0x1f323e[_0xa3f1('0x31')],_0x1f323e[_0xa3f1('0x32')]);_0x546b70[_0xa3f1('0x35')]=_[_0xa3f1('0x34')](_0x1f323e['model'],qs[_0xa3f1('0x36')](_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x36')]));_0x546b70['attributes']=_0x546b70[_0xa3f1('0x35')][_0xa3f1('0x37')]?_0x546b70['attributes']:_0x1f323e[_0xa3f1('0x31')];if(!_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x38')](_0xa3f1('0x39'))){_0x546b70['limit']=qs['limit'](_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x3a')]);_0x546b70[_0xa3f1('0x20')]=qs[_0xa3f1('0x20')](_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x20')]);}_0x546b70[_0xa3f1('0x3b')]=qs[_0xa3f1('0x3c')](_0x5e159b['query'][_0xa3f1('0x3c')]);_0x546b70['where']=qs[_0xa3f1('0x3d')](_[_0xa3f1('0x3e')](_0x5e159b[_0xa3f1('0x32')],_0x1f323e[_0xa3f1('0x3d')]),_0x309e07);if(_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x3f')]){_0x546b70['where']=_[_0xa3f1('0x40')](_0x546b70[_0xa3f1('0x41')],{'$or':_['map'](_0x309e07,function(_0x2ccb49){if(_0x2ccb49[_0xa3f1('0x2f')]!==_0xa3f1('0x42')){var _0x247895={};_0x247895[_0x2ccb49['name']]={'$like':'%'+_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x3f')]+'%'};return _0x247895;}})});}_0x546b70=_[_0xa3f1('0x40')]({},_0x546b70,_0x5e159b[_0xa3f1('0x43')]);var _0x30fdd3={'where':_0x546b70[_0xa3f1('0x41')]};return db['AnalyticExtractedReport'][_0xa3f1('0x1f')](_0x30fdd3)['then'](function(_0x36dcc7){_0x4c2e68[_0xa3f1('0x1f')]=_0x36dcc7;if(_0x5e159b[_0xa3f1('0x32')][_0xa3f1('0x44')]){_0x546b70[_0xa3f1('0x45')]=[{'all':!![]}];}return db[_0xa3f1('0x2e')][_0xa3f1('0x46')](_0x546b70);})[_0xa3f1('0x25')](function(_0xc3c43a){_0x4c2e68[_0xa3f1('0x47')]=_0xc3c43a;return _0x4c2e68;})[_0xa3f1('0x25')](respondWithFilteredResult(_0x328af3,_0x546b70))[_0xa3f1('0x48')](handleError(_0x328af3,null));};exports[_0xa3f1('0x49')]=function(_0x3c73c7,_0x3c073d){var _0x9c49c0={'raw':!![],'where':{'id':_0x3c73c7[_0xa3f1('0x4a')]['id']}},_0x1b1f09={};_0x1b1f09[_0xa3f1('0x31')]=_[_0xa3f1('0x33')](db[_0xa3f1('0x2e')]['rawAttributes']);_0x1b1f09['query']=_[_0xa3f1('0x33')](_0x3c73c7['query']);_0x1b1f09[_0xa3f1('0x3d')]=_[_0xa3f1('0x34')](_0x1b1f09[_0xa3f1('0x31')],_0x1b1f09[_0xa3f1('0x32')]);_0x9c49c0['attributes']=_['intersection'](_0x1b1f09[_0xa3f1('0x31')],qs['fields'](_0x3c73c7[_0xa3f1('0x32')][_0xa3f1('0x36')]));_0x9c49c0[_0xa3f1('0x35')]=_0x9c49c0['attributes'][_0xa3f1('0x37')]?_0x9c49c0[_0xa3f1('0x35')]:_0x1b1f09[_0xa3f1('0x31')];if(_0x3c73c7[_0xa3f1('0x32')][_0xa3f1('0x44')]){_0x9c49c0['include']=[{'all':!![]}];}_0x9c49c0=_[_0xa3f1('0x40')]({},_0x9c49c0,_0x3c73c7[_0xa3f1('0x43')]);return db[_0xa3f1('0x2e')][_0xa3f1('0x4b')](_0x9c49c0)[_0xa3f1('0x25')](handleEntityNotFound(_0x3c073d,null))[_0xa3f1('0x25')](respondWithResult(_0x3c073d,null))[_0xa3f1('0x48')](handleError(_0x3c073d,null));};exports['create']=function(_0x59cd9e,_0x13abcf){return db['AnalyticExtractedReport'][_0xa3f1('0x4c')](_0x59cd9e[_0xa3f1('0x4d')],{})[_0xa3f1('0x25')](function(_0x14c64c){var _0x5b0904=_0x59cd9e['user'][_0xa3f1('0x27')]({'plain':!![]});if(!_0x5b0904)throw new Error(_0xa3f1('0x4e'));if(_0x5b0904[_0xa3f1('0x4f')]===_0xa3f1('0x50')){var _0x12e091=_0x14c64c['get']({'plain':!![]});var _0x2af8d0='ExtractedReports';return db[_0xa3f1('0x51')]['find']({'where':{'name':_0x2af8d0,'userProfileId':_0x5b0904[_0xa3f1('0x52')]},'raw':!![]})[_0xa3f1('0x25')](function(_0x5afc96){if(_0x5afc96&&_0x5afc96[_0xa3f1('0x53')]===0x0){return db[_0xa3f1('0x28')][_0xa3f1('0x4c')]({'name':_0x12e091[_0xa3f1('0x2a')],'resourceId':_0x12e091['id'],'type':_0x5afc96['name'],'sectionId':_0x5afc96['id']},{})[_0xa3f1('0x25')](function(){return _0x14c64c;});}else{return _0x14c64c;}})[_0xa3f1('0x48')](function(_0x1d19e0){logger[_0xa3f1('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d19e0);throw _0x1d19e0;});}return _0x14c64c;})['then'](respondWithResult(_0x13abcf,0xc9))[_0xa3f1('0x48')](handleError(_0x13abcf,null));};exports[_0xa3f1('0x24')]=function(_0x142964,_0x157f41){if(_0x142964[_0xa3f1('0x4d')]['id']){delete _0x142964[_0xa3f1('0x4d')]['id'];}return db[_0xa3f1('0x2e')][_0xa3f1('0x4b')]({'where':{'id':_0x142964[_0xa3f1('0x4a')]['id']}})[_0xa3f1('0x25')](handleEntityNotFound(_0x157f41,null))['then'](saveUpdates(_0x142964['body'],null))[_0xa3f1('0x25')](respondWithResult(_0x157f41,null))[_0xa3f1('0x48')](handleError(_0x157f41,null));};exports['destroy']=function(_0x19d8c9,_0xfe8255){return db[_0xa3f1('0x2e')][_0xa3f1('0x4b')]({'where':{'id':_0x19d8c9[_0xa3f1('0x4a')]['id']}})[_0xa3f1('0x25')](handleEntityNotFound(_0xfe8255,null))[_0xa3f1('0x25')](removeEntity(_0xfe8255,null))[_0xa3f1('0x48')](handleError(_0xfe8255,null));};exports['download']=function(_0x54e20b,_0x232392,_0x35f344){return db['AnalyticExtractedReport'][_0xa3f1('0x4b')]({'where':{'id':_0x54e20b[_0xa3f1('0x4a')]['id']},'attributes':[_0xa3f1('0x2a'),_0xa3f1('0x55'),'savename',_0xa3f1('0x56')],'raw':!![]})[_0xa3f1('0x25')](handleEntityNotFound(_0x232392,null))['then'](function(_0x43f0f4){if(_0x43f0f4){if(!fs[_0xa3f1('0x57')](path[_0xa3f1('0x58')](config[_0xa3f1('0x59')],_0xa3f1('0x5a'),_0x43f0f4['savename']))){throw new db['Sequelize']['ValidationError'](_0xa3f1('0x5b'));}if(_0x54e20b[_0xa3f1('0x32')][_0xa3f1('0x5c')]){return _0x232392[_0xa3f1('0x1a')](0xc8);}return _0x232392[_0xa3f1('0x5d')](path[_0xa3f1('0x58')](config[_0xa3f1('0x59')],_0xa3f1('0x5a'),_0x43f0f4[_0xa3f1('0x5e')]),util[_0xa3f1('0x5f')](_0xa3f1('0x60'),_0x43f0f4['basename']||_0x43f0f4[_0xa3f1('0x2a')],_0x43f0f4[_0xa3f1('0x56')][_0xa3f1('0x61')]()));}})['catch'](handleError(_0x232392,null));}; \ No newline at end of file +var _0xc7ae=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','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','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc7ae,0x1f0));var _0xec7a=function(_0x286712,_0x6d9ea5){_0x286712=_0x286712-0x0;var _0x3a538c=_0xc7ae[_0x286712];return _0x3a538c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec7a('0x0'));var zipdir=require(_0xec7a('0x1'));var jsonpatch=require(_0xec7a('0x2'));var rp=require(_0xec7a('0x3'));var moment=require(_0xec7a('0x4'));var BPromise=require(_0xec7a('0x5'));var Mustache=require(_0xec7a('0x6'));var util=require(_0xec7a('0x7'));var path=require('path');var sox=require(_0xec7a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec7a('0x9'));var _=require(_0xec7a('0xa'));var squel=require(_0xec7a('0xb'));var crypto=require(_0xec7a('0xc'));var jsforce=require(_0xec7a('0xd'));var deskjs=require(_0xec7a('0xe'));var toCsv=require(_0xec7a('0xf'));var querystring=require(_0xec7a('0x10'));var Papa=require('papaparse');var Redis=require(_0xec7a('0x11'));var authService=require(_0xec7a('0x12'));var qs=require(_0xec7a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec7a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xec7a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec7a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dede9,_0x4f388d){_0x4f388d=_0x4f388d||0xcc;return function(_0x563922){if(_0x563922){return _0x4dede9['sendStatus'](_0x4f388d);}return _0x4dede9['status'](_0x4f388d)[_0xec7a('0x17')]();};}function respondWithResult(_0x196996,_0xd27f94){_0xd27f94=_0xd27f94||0xc8;return function(_0x4d06cc){if(_0x4d06cc){return _0x196996[_0xec7a('0x18')](_0xd27f94)[_0xec7a('0x19')](_0x4d06cc);}};}function respondWithFilteredResult(_0x17afbf,_0x3ecedc){return function(_0x25407e){if(_0x25407e){var _0x57dfd8=typeof _0x3ecedc[_0xec7a('0x1a')]==='undefined'&&typeof _0x3ecedc[_0xec7a('0x1b')]===_0xec7a('0x1c');var _0x4bc54e=_0x25407e[_0xec7a('0x1d')];var _0xfd3ad8=_0x57dfd8?0x0:_0x3ecedc[_0xec7a('0x1a')];var _0x4ce5a9=_0x57dfd8?_0x25407e[_0xec7a('0x1d')]:_0x3ecedc[_0xec7a('0x1a')]+_0x3ecedc[_0xec7a('0x1b')];var _0x21de0d;if(_0x4ce5a9>=_0x4bc54e){_0x4ce5a9=_0x4bc54e;_0x21de0d=0xc8;}else{_0x21de0d=0xce;}_0x17afbf['status'](_0x21de0d);return _0x17afbf[_0xec7a('0x1e')](_0xec7a('0x1f'),_0xfd3ad8+'-'+_0x4ce5a9+'/'+_0x4bc54e)[_0xec7a('0x19')](_0x25407e);}return null;};}function patchUpdates(_0x1683b9){return function(_0x2d44e0){try{jsonpatch[_0xec7a('0x20')](_0x2d44e0,_0x1683b9,!![]);}catch(_0x2e4d71){return BPromise[_0xec7a('0x21')](_0x2e4d71);}return _0x2d44e0[_0xec7a('0x22')]();};}function saveUpdates(_0x4d9e9a,_0x5736b5){return function(_0x31daeb){if(_0x31daeb){return _0x31daeb[_0xec7a('0x23')](_0x4d9e9a)[_0xec7a('0x24')](function(_0x59b441){return _0x59b441;});}return null;};}function removeEntity(_0x3be193,_0x4075fb){return function(_0x21bdbc){if(_0x21bdbc){return _0x21bdbc[_0xec7a('0x25')]()[_0xec7a('0x24')](function(){var _0x301018=_0x21bdbc[_0xec7a('0x26')]({'plain':!![]});var _0xab9ec7=_0xec7a('0x27');return db[_0xec7a('0x28')]['destroy']({'where':{'type':_0xab9ec7,'resourceId':_0x301018['id']}})[_0xec7a('0x24')](function(){return _0x21bdbc;});})[_0xec7a('0x24')](function(){_0x3be193[_0xec7a('0x18')](0xcc)[_0xec7a('0x17')]();});}};}function handleEntityNotFound(_0x22e983,_0x3f4ad4){return function(_0x362a61){if(!_0x362a61){_0x22e983[_0xec7a('0x29')](0x194);}return _0x362a61;};}function handleError(_0x227bef,_0x466340){_0x466340=_0x466340||0x1f4;return function(_0x384902){logger[_0xec7a('0x2a')](_0x384902[_0xec7a('0x2b')]);if(_0x384902[_0xec7a('0x2c')]){delete _0x384902[_0xec7a('0x2c')];}_0x227bef[_0xec7a('0x18')](_0x466340)[_0xec7a('0x2d')](_0x384902);};}exports[_0xec7a('0x2e')]=function(_0x656855,_0x246c6f){var _0x112e44={},_0x3979fa={},_0x3f6bca={'count':0x0,'rows':[]};var _0x55a5c2=_[_0xec7a('0x2f')](db[_0xec7a('0x30')][_0xec7a('0x31')],function(_0x11a57d){return{'name':_0x11a57d[_0xec7a('0x32')],'type':_0x11a57d[_0xec7a('0x33')][_0xec7a('0x34')]};});_0x3979fa['model']=_[_0xec7a('0x2f')](_0x55a5c2,_0xec7a('0x2c'));_0x3979fa[_0xec7a('0x35')]=_[_0xec7a('0x36')](_0x656855[_0xec7a('0x35')]);_0x3979fa[_0xec7a('0x37')]=_[_0xec7a('0x38')](_0x3979fa[_0xec7a('0x39')],_0x3979fa['query']);_0x112e44[_0xec7a('0x3a')]=_[_0xec7a('0x38')](_0x3979fa[_0xec7a('0x39')],qs[_0xec7a('0x3b')](_0x656855[_0xec7a('0x35')][_0xec7a('0x3b')]));_0x112e44['attributes']=_0x112e44[_0xec7a('0x3a')][_0xec7a('0x3c')]?_0x112e44[_0xec7a('0x3a')]:_0x3979fa[_0xec7a('0x39')];if(!_0x656855[_0xec7a('0x35')][_0xec7a('0x3d')](_0xec7a('0x3e'))){_0x112e44[_0xec7a('0x1b')]=qs[_0xec7a('0x1b')](_0x656855[_0xec7a('0x35')][_0xec7a('0x1b')]);_0x112e44[_0xec7a('0x1a')]=qs[_0xec7a('0x1a')](_0x656855[_0xec7a('0x35')]['offset']);}_0x112e44[_0xec7a('0x3f')]=qs[_0xec7a('0x40')](_0x656855['query'][_0xec7a('0x40')]);_0x112e44[_0xec7a('0x41')]=qs[_0xec7a('0x37')](_['pick'](_0x656855[_0xec7a('0x35')],_0x3979fa[_0xec7a('0x37')]),_0x55a5c2);if(_0x656855[_0xec7a('0x35')][_0xec7a('0x42')]){_0x112e44['where']=_[_0xec7a('0x43')](_0x112e44['where'],{'$or':_['map'](_0x55a5c2,function(_0x695bc2){if(_0x695bc2[_0xec7a('0x33')]!==_0xec7a('0x44')){var _0x597ac9={};_0x597ac9[_0x695bc2[_0xec7a('0x2c')]]={'$like':'%'+_0x656855[_0xec7a('0x35')][_0xec7a('0x42')]+'%'};return _0x597ac9;}})});}_0x112e44=_[_0xec7a('0x43')]({},_0x112e44,_0x656855[_0xec7a('0x45')]);var _0x42763a={'where':_0x112e44['where']};return db[_0xec7a('0x30')][_0xec7a('0x1d')](_0x42763a)[_0xec7a('0x24')](function(_0x576cda){_0x3f6bca[_0xec7a('0x1d')]=_0x576cda;if(_0x656855[_0xec7a('0x35')][_0xec7a('0x46')]){_0x112e44[_0xec7a('0x47')]=[{'all':!![]}];}return db[_0xec7a('0x30')][_0xec7a('0x48')](_0x112e44);})[_0xec7a('0x24')](function(_0x4f1f2e){_0x3f6bca[_0xec7a('0x49')]=_0x4f1f2e;return _0x3f6bca;})[_0xec7a('0x24')](respondWithFilteredResult(_0x246c6f,_0x112e44))[_0xec7a('0x4a')](handleError(_0x246c6f,null));};exports['show']=function(_0xbcf6e9,_0x7d293d){var _0x56beec={'raw':!![],'where':{'id':_0xbcf6e9[_0xec7a('0x4b')]['id']}},_0x1566da={};_0x1566da[_0xec7a('0x39')]=_[_0xec7a('0x36')](db[_0xec7a('0x30')]['rawAttributes']);_0x1566da[_0xec7a('0x35')]=_[_0xec7a('0x36')](_0xbcf6e9[_0xec7a('0x35')]);_0x1566da['filters']=_[_0xec7a('0x38')](_0x1566da['model'],_0x1566da['query']);_0x56beec[_0xec7a('0x3a')]=_[_0xec7a('0x38')](_0x1566da[_0xec7a('0x39')],qs['fields'](_0xbcf6e9[_0xec7a('0x35')]['fields']));_0x56beec[_0xec7a('0x3a')]=_0x56beec[_0xec7a('0x3a')]['length']?_0x56beec[_0xec7a('0x3a')]:_0x1566da['model'];if(_0xbcf6e9[_0xec7a('0x35')]['includeAll']){_0x56beec['include']=[{'all':!![]}];}_0x56beec=_[_0xec7a('0x43')]({},_0x56beec,_0xbcf6e9[_0xec7a('0x45')]);return db['AnalyticExtractedReport'][_0xec7a('0x4c')](_0x56beec)['then'](handleEntityNotFound(_0x7d293d,null))['then'](respondWithResult(_0x7d293d,null))[_0xec7a('0x4a')](handleError(_0x7d293d,null));};exports[_0xec7a('0x4d')]=function(_0x5510d8,_0x2fe136){return db[_0xec7a('0x30')][_0xec7a('0x4d')](_0x5510d8[_0xec7a('0x4e')],{})['then'](function(_0x181766){var _0x56e3b6=_0x5510d8[_0xec7a('0x4f')][_0xec7a('0x26')]({'plain':!![]});if(!_0x56e3b6)throw new Error(_0xec7a('0x50'));if(_0x56e3b6[_0xec7a('0x51')]===_0xec7a('0x4f')){var _0x53fcee=_0x181766[_0xec7a('0x26')]({'plain':!![]});var _0x5a6c01=_0xec7a('0x27');return db[_0xec7a('0x52')][_0xec7a('0x4c')]({'where':{'name':_0x5a6c01,'userProfileId':_0x56e3b6[_0xec7a('0x53')]},'raw':!![]})[_0xec7a('0x24')](function(_0x43eae2){if(_0x43eae2&&_0x43eae2[_0xec7a('0x54')]===0x0){return db[_0xec7a('0x28')]['create']({'name':_0x53fcee[_0xec7a('0x2c')],'resourceId':_0x53fcee['id'],'type':_0x43eae2['name'],'sectionId':_0x43eae2['id']},{})[_0xec7a('0x24')](function(){return _0x181766;});}else{return _0x181766;}})[_0xec7a('0x4a')](function(_0x4dd79d){logger[_0xec7a('0x2a')](_0xec7a('0x55'),_0x4dd79d);throw _0x4dd79d;});}return _0x181766;})['then'](respondWithResult(_0x2fe136,0xc9))[_0xec7a('0x4a')](handleError(_0x2fe136,null));};exports[_0xec7a('0x23')]=function(_0x30b559,_0x48c88a){if(_0x30b559[_0xec7a('0x4e')]['id']){delete _0x30b559['body']['id'];}return db[_0xec7a('0x30')][_0xec7a('0x4c')]({'where':{'id':_0x30b559[_0xec7a('0x4b')]['id']}})[_0xec7a('0x24')](handleEntityNotFound(_0x48c88a,null))[_0xec7a('0x24')](saveUpdates(_0x30b559[_0xec7a('0x4e')],null))[_0xec7a('0x24')](respondWithResult(_0x48c88a,null))['catch'](handleError(_0x48c88a,null));};exports[_0xec7a('0x25')]=function(_0x1deadb,_0x5c64ea){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1deadb[_0xec7a('0x4b')]['id']}})[_0xec7a('0x24')](handleEntityNotFound(_0x5c64ea,null))[_0xec7a('0x24')](removeEntity(_0x5c64ea,null))['catch'](handleError(_0x5c64ea,null));};exports['download']=function(_0x288872,_0x27022d,_0x229d3e){return db[_0xec7a('0x30')][_0xec7a('0x4c')]({'where':{'id':_0x288872['params']['id']},'attributes':[_0xec7a('0x2c'),_0xec7a('0x56'),_0xec7a('0x57'),_0xec7a('0x58')],'raw':!![]})[_0xec7a('0x24')](handleEntityNotFound(_0x27022d,null))[_0xec7a('0x24')](function(_0x5d6277){if(_0x5d6277){if(!fs[_0xec7a('0x59')](path[_0xec7a('0x5a')](config['root'],_0xec7a('0x5b'),_0x5d6277[_0xec7a('0x57')]))){throw new db[(_0xec7a('0x5c'))][(_0xec7a('0x5d'))](_0xec7a('0x5e'));}if(_0x288872[_0xec7a('0x35')][_0xec7a('0x5f')]){return _0x27022d['sendStatus'](0xc8);}return _0x27022d[_0xec7a('0x60')](path['join'](config['root'],_0xec7a('0x5b'),_0x5d6277[_0xec7a('0x57')]),util['format']('%s.%s',_0x5d6277[_0xec7a('0x56')]||_0x5d6277[_0xec7a('0x2c')],_0x5d6277[_0xec7a('0x58')][_0xec7a('0x61')]()));}})[_0xec7a('0x4a')](handleError(_0x27022d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index aa1f749..b883fcb 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 _0xe1e0=['AnalyticExtractedReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x3ccaa0,_0x3e2b12){var _0x4ff6c4=function(_0x5ad02c){while(--_0x5ad02c){_0x3ccaa0['push'](_0x3ccaa0['shift']());}};_0x4ff6c4(++_0x3e2b12);}(_0xe1e0,0x146));var _0x0e1e=function(_0x4812ba,_0x4d1a16){_0x4812ba=_0x4812ba-0x0;var _0x185538=_0xe1e0[_0x4812ba];return _0x185538;};'use strict';var _=require(_0x0e1e('0x0'));var util=require('util');var logger=require(_0x0e1e('0x1'))(_0x0e1e('0x2'));var moment=require(_0x0e1e('0x3'));var BPromise=require(_0x0e1e('0x4'));var rp=require(_0x0e1e('0x5'));var fs=require('fs');var path=require(_0x0e1e('0x6'));var rimraf=require(_0x0e1e('0x7'));var config=require(_0x0e1e('0x8'));var attributes=require(_0x0e1e('0x9'));module[_0x0e1e('0xa')]=function(_0x2d8aea,_0x2d6463){return _0x2d8aea[_0x0e1e('0xb')](_0x0e1e('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe535=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','path'];(function(_0x5b83a2,_0x23c6b9){var _0x3e1bb1=function(_0x2762a7){while(--_0x2762a7){_0x5b83a2['push'](_0x5b83a2['shift']());}};_0x3e1bb1(++_0x23c6b9);}(_0xe535,0x1a8));var _0x5e53=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xe535[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x5e53('0x0'));var util=require('util');var logger=require(_0x5e53('0x1'))('api');var moment=require(_0x5e53('0x2'));var BPromise=require(_0x5e53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e53('0x4'));var rimraf=require(_0x5e53('0x5'));var config=require(_0x5e53('0x6'));var attributes=require(_0x5e53('0x7'));module['exports']=function(_0x39672b,_0x12deda){return _0x39672b[_0x5e53('0x8')](_0x5e53('0x9'),attributes,{'tableName':_0x5e53('0xa'),'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 ded96ac..0ab35eb 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 _0xd86a=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xd86a,0x11a));var _0xad86=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xd86a[_0x2bf466];return _0x856885;};'use strict';var _=require(_0xad86('0x0'));var util=require(_0xad86('0x1'));var moment=require(_0xad86('0x2'));var BPromise=require(_0xad86('0x3'));var rs=require(_0xad86('0x4'));var fs=require('fs');var Redis=require(_0xad86('0x5'));var db=require(_0xad86('0x6'))['db'];var utils=require(_0xad86('0x7'));var logger=require(_0xad86('0x8'))(_0xad86('0x9'));var config=require(_0xad86('0xa'));var jayson=require(_0xad86('0xb'));var client=jayson[_0xad86('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462e3c,_0x2b89c5,_0x4e03ae){return new BPromise(function(_0x3b3927,_0x1976b3){return client[_0xad86('0xd')](_0x462e3c,_0x4e03ae)[_0xad86('0xe')](function(_0x144ed8){logger[_0xad86('0xf')](_0xad86('0x10'),_0x2b89c5,_0xad86('0x11'));logger[_0xad86('0x12')](_0xad86('0x13'),_0x2b89c5,_0xad86('0x11'),JSON[_0xad86('0x14')](_0x144ed8));if(_0x144ed8[_0xad86('0x15')]){if(_0x144ed8[_0xad86('0x15')][_0xad86('0x16')]===0x1f4){logger[_0xad86('0x15')](_0xad86('0x10'),_0x2b89c5,_0x144ed8[_0xad86('0x15')][_0xad86('0x17')]);return _0x1976b3(_0x144ed8['error']['message']);}logger[_0xad86('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2b89c5,_0x144ed8['error'][_0xad86('0x17')]);return _0x3b3927(_0x144ed8[_0xad86('0x15')][_0xad86('0x17')]);}else{logger[_0xad86('0xf')](_0xad86('0x10'),_0x2b89c5,_0xad86('0x11'));_0x3b3927(_0x144ed8[_0xad86('0x18')][_0xad86('0x17')]);}})['catch'](function(_0x53bf97){logger[_0xad86('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2b89c5,_0x53bf97);_0x1976b3(_0x53bf97);});});} \ No newline at end of file +var _0xfc73=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','request\x20sent','debug','stringify','code','error','AnalyticExtractedReport,\x20%s,\x20%s','message'];(function(_0x70f557,_0x50e9ce){var _0x4e840b=function(_0x4d9f52){while(--_0x4d9f52){_0x70f557['push'](_0x70f557['shift']());}};_0x4e840b(++_0x50e9ce);}(_0xfc73,0x190));var _0x3fc7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfc73[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var moment=require(_0x3fc7('0x2'));var BPromise=require(_0x3fc7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc7('0x4'));var db=require(_0x3fc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fc7('0x6'));var config=require(_0x3fc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3fc7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a843,_0x595f79,_0x3068db){return new BPromise(function(_0x57f2b5,_0x1c4cab){return client[_0x3fc7('0x9')](_0x16a843,_0x3068db)['then'](function(_0x257b44){logger[_0x3fc7('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));logger[_0x3fc7('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x595f79,'request\x20sent',JSON[_0x3fc7('0xd')](_0x257b44));if(_0x257b44['error']){if(_0x257b44['error'][_0x3fc7('0xe')]===0x1f4){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x257b44[_0x3fc7('0xf')]['message']);return _0x1c4cab(_0x257b44[_0x3fc7('0xf')][_0x3fc7('0x11')]);}logger[_0x3fc7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x257b44['error']['message']);return _0x57f2b5(_0x257b44['error']['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));_0x57f2b5(_0x257b44['result']['message']);}})[_0x3fc7('0x12')](function(_0x989094){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x989094);_0x1c4cab(_0x989094);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d6d2915..14cd990 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 _0x54bd=['download','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0xf28a74,_0x2ca403){var _0xc778bd=function(_0x3c29ec){while(--_0x3c29ec){_0xf28a74['push'](_0xf28a74['shift']());}};_0xc778bd(++_0x2ca403);}(_0x54bd,0x156));var _0xd54b=function(_0x3bc833,_0x47ee59){_0x3bc833=_0x3bc833-0x0;var _0x4dabd4=_0x54bd[_0x3bc833];return _0x4dabd4;};'use strict';var multer=require(_0xd54b('0x0'));var util=require(_0xd54b('0x1'));var path=require(_0xd54b('0x2'));var timeout=require(_0xd54b('0x3'));var express=require(_0xd54b('0x4'));var router=express[_0xd54b('0x5')]();var fs_extra=require(_0xd54b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd54b('0x7'));var config=require(_0xd54b('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xd54b('0x9')]('/',auth[_0xd54b('0xa')](),controller[_0xd54b('0xb')]);router[_0xd54b('0x9')](_0xd54b('0xc'),auth[_0xd54b('0xa')](),controller[_0xd54b('0xd')]);router[_0xd54b('0x9')](_0xd54b('0xe'),auth[_0xd54b('0xa')](),controller[_0xd54b('0xf')]);router[_0xd54b('0x10')]('/',auth[_0xd54b('0xa')](),controller['create']);router[_0xd54b('0x11')](_0xd54b('0xc'),auth[_0xd54b('0xa')](),controller[_0xd54b('0x12')]);router[_0xd54b('0x13')](_0xd54b('0xc'),auth[_0xd54b('0xa')](),controller[_0xd54b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1377=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','show','/:id/download','download','post','create','put'];(function(_0xb36a0c,_0x73a4de){var _0x33f2ab=function(_0x5d375f){while(--_0x5d375f){_0xb36a0c['push'](_0xb36a0c['shift']());}};_0x33f2ab(++_0x73a4de);}(_0x1377,0x146));var _0x7137=function(_0x4ff480,_0x5c99ce){_0x4ff480=_0x4ff480-0x0;var _0x4836a6=_0x1377[_0x4ff480];return _0x4836a6;};'use strict';var multer=require(_0x7137('0x0'));var util=require(_0x7137('0x1'));var path=require(_0x7137('0x2'));var timeout=require(_0x7137('0x3'));var express=require(_0x7137('0x4'));var router=express[_0x7137('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7137('0x6'));var interaction=require(_0x7137('0x7'));var config=require(_0x7137('0x8'));var controller=require(_0x7137('0x9'));router['get']('/',auth[_0x7137('0xa')](),controller[_0x7137('0xb')]);router[_0x7137('0xc')]('/:id',auth[_0x7137('0xa')](),controller[_0x7137('0xd')]);router[_0x7137('0xc')](_0x7137('0xe'),auth[_0x7137('0xa')](),controller[_0x7137('0xf')]);router[_0x7137('0x10')]('/',auth[_0x7137('0xa')](),controller[_0x7137('0x11')]);router[_0x7137('0x12')](_0x7137('0x13'),auth[_0x7137('0xa')](),controller[_0x7137('0x14')]);router['delete'](_0x7137('0x13'),auth[_0x7137('0xa')](),controller[_0x7137('0x15')]);module[_0x7137('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index b80878f..1599703 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 _0xd3f7=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x54b9c6,_0x2c697e){var _0x251824=function(_0x269f7c){while(--_0x269f7c){_0x54b9c6['push'](_0x54b9c6['shift']());}};_0x251824(++_0x2c697e);}(_0xd3f7,0x185));var _0x7d3f=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xd3f7[_0x2d994d];return _0xd54be4;};'use strict';var Sequelize=require(_0x7d3f('0x0'));module['exports']={'field':{'type':Sequelize[_0x7d3f('0x1')]},'alias':{'type':Sequelize[_0x7d3f('0x2')]},'function':{'type':Sequelize[_0x7d3f('0x2')]},'format':{'type':Sequelize[_0x7d3f('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7d3f('0x2')]},'custom':{'type':Sequelize[_0x7d3f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x16ab=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x592a1c,_0x4f773e){var _0x27a3bb=function(_0x6bcfff){while(--_0x6bcfff){_0x592a1c['push'](_0x592a1c['shift']());}};_0x27a3bb(++_0x4f773e);}(_0x16ab,0x1a6));var _0xb16a=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x16ab[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0xb16a('0x0'));module[_0xb16a('0x1')]={'field':{'type':Sequelize[_0xb16a('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb16a('0x3')]},'format':{'type':Sequelize[_0xb16a('0x3')]},'groupBy':{'type':Sequelize[_0xb16a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb16a('0x3')]},'custom':{'type':Sequelize[_0xb16a('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 73f807c..9329526 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 _0xd3c3=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','bulkCreate','body','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xd3c3,0x16c));var _0x3d3c=function(_0x7aad0b,_0x1cbbcc){_0x7aad0b=_0x7aad0b-0x0;var _0x39dbe7=_0xd3c3[_0x7aad0b];return _0x39dbe7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d3c('0x0'));var zipdir=require(_0x3d3c('0x1'));var jsonpatch=require(_0x3d3c('0x2'));var rp=require(_0x3d3c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d3c('0x4'));var util=require('util');var path=require(_0x3d3c('0x5'));var sox=require(_0x3d3c('0x6'));var csv=require(_0x3d3c('0x7'));var ejs=require(_0x3d3c('0x8'));var fs=require('fs');var fs_extra=require(_0x3d3c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d3c('0xa'));var jsforce=require(_0x3d3c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3d3c('0x7'));var querystring=require('querystring');var Papa=require(_0x3d3c('0xc'));var Redis=require(_0x3d3c('0xd'));var authService=require(_0x3d3c('0xe'));var qs=require(_0x3d3c('0xf'));var as=require(_0x3d3c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d3c('0x11'))('api');var utils=require(_0x3d3c('0x12'));var config=require(_0x3d3c('0x13'));var licenseUtil=require(_0x3d3c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d6459,_0x4ad449){_0x4ad449=_0x4ad449||0xcc;return function(_0x4545fc){if(_0x4545fc){return _0x1d6459[_0x3d3c('0x15')](_0x4ad449);}return _0x1d6459[_0x3d3c('0x16')](_0x4ad449)[_0x3d3c('0x17')]();};}function respondWithResult(_0x7e89fd,_0x3d0e76){_0x3d0e76=_0x3d0e76||0xc8;return function(_0x1f4dae){if(_0x1f4dae){return _0x7e89fd[_0x3d3c('0x16')](_0x3d0e76)[_0x3d3c('0x18')](_0x1f4dae);}};}function respondWithFilteredResult(_0x3efe96,_0x3b5ef1){return function(_0x49c367){if(_0x49c367){var _0x22e35e=typeof _0x3b5ef1[_0x3d3c('0x19')]===_0x3d3c('0x1a')&&typeof _0x3b5ef1['limit']===_0x3d3c('0x1a');var _0x298526=_0x49c367[_0x3d3c('0x1b')];var _0x351551=_0x22e35e?0x0:_0x3b5ef1[_0x3d3c('0x19')];var _0x31bed7=_0x22e35e?_0x49c367[_0x3d3c('0x1b')]:_0x3b5ef1[_0x3d3c('0x19')]+_0x3b5ef1['limit'];var _0x13fb0a;if(_0x31bed7>=_0x298526){_0x31bed7=_0x298526;_0x13fb0a=0xc8;}else{_0x13fb0a=0xce;}_0x3efe96[_0x3d3c('0x16')](_0x13fb0a);return _0x3efe96[_0x3d3c('0x1c')](_0x3d3c('0x1d'),_0x351551+'-'+_0x31bed7+'/'+_0x298526)['json'](_0x49c367);}return null;};}function patchUpdates(_0x958550){return function(_0x570eb8){try{jsonpatch[_0x3d3c('0x1e')](_0x570eb8,_0x958550,!![]);}catch(_0x58692a){return BPromise[_0x3d3c('0x1f')](_0x58692a);}return _0x570eb8[_0x3d3c('0x20')]();};}function saveUpdates(_0x185bcd,_0x41862f){return function(_0x29d818){if(_0x29d818){return _0x29d818[_0x3d3c('0x21')](_0x185bcd)[_0x3d3c('0x22')](function(_0x59ae0c){return _0x59ae0c;});}return null;};}function removeEntity(_0x4d42a5,_0x48ecfd){return function(_0x4a686a){if(_0x4a686a){return _0x4a686a[_0x3d3c('0x23')]()[_0x3d3c('0x22')](function(){_0x4d42a5[_0x3d3c('0x16')](0xcc)[_0x3d3c('0x17')]();});}};}function handleEntityNotFound(_0x499480,_0x3fd41e){return function(_0x45cfce){if(!_0x45cfce){_0x499480['sendStatus'](0x194);}return _0x45cfce;};}function handleError(_0x5d62bb,_0x34c020){_0x34c020=_0x34c020||0x1f4;return function(_0x202cee){logger[_0x3d3c('0x24')](_0x202cee[_0x3d3c('0x25')]);if(_0x202cee['name']){delete _0x202cee[_0x3d3c('0x26')];}_0x5d62bb[_0x3d3c('0x16')](_0x34c020)[_0x3d3c('0x27')](_0x202cee);};}exports['index']=function(_0x203f94,_0x4164c0){var _0x6fa54c={},_0x2b1522={},_0x5e98f2={'count':0x0,'rows':[]};var _0x194a30=_[_0x3d3c('0x28')](db[_0x3d3c('0x29')][_0x3d3c('0x2a')],function(_0x3fe718){return{'name':_0x3fe718['fieldName'],'type':_0x3fe718[_0x3d3c('0x2b')][_0x3d3c('0x2c')]};});_0x2b1522[_0x3d3c('0x2d')]=_[_0x3d3c('0x28')](_0x194a30,'name');_0x2b1522[_0x3d3c('0x2e')]=_[_0x3d3c('0x2f')](_0x203f94[_0x3d3c('0x2e')]);_0x2b1522[_0x3d3c('0x30')]=_[_0x3d3c('0x31')](_0x2b1522['model'],_0x2b1522['query']);_0x6fa54c[_0x3d3c('0x32')]=_['intersection'](_0x2b1522[_0x3d3c('0x2d')],qs[_0x3d3c('0x33')](_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x33')]));_0x6fa54c[_0x3d3c('0x32')]=_0x6fa54c[_0x3d3c('0x32')][_0x3d3c('0x34')]?_0x6fa54c[_0x3d3c('0x32')]:_0x2b1522[_0x3d3c('0x2d')];if(!_0x203f94[_0x3d3c('0x2e')]['hasOwnProperty'](_0x3d3c('0x35'))){_0x6fa54c[_0x3d3c('0x36')]=qs[_0x3d3c('0x36')](_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x36')]);_0x6fa54c[_0x3d3c('0x19')]=qs[_0x3d3c('0x19')](_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x19')]);}_0x6fa54c[_0x3d3c('0x37')]=qs[_0x3d3c('0x38')](_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x38')]);_0x6fa54c['where']=qs[_0x3d3c('0x30')](_[_0x3d3c('0x39')](_0x203f94[_0x3d3c('0x2e')],_0x2b1522[_0x3d3c('0x30')]),_0x194a30);if(_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x3a')]){_0x6fa54c[_0x3d3c('0x3b')]=_[_0x3d3c('0x3c')](_0x6fa54c[_0x3d3c('0x3b')],{'$or':_[_0x3d3c('0x28')](_0x194a30,function(_0x5836ef){if(_0x5836ef['type']!==_0x3d3c('0x3d')){var _0x5f1b74={};_0x5f1b74[_0x5836ef['name']]={'$like':'%'+_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x3a')]+'%'};return _0x5f1b74;}})});}_0x6fa54c=_[_0x3d3c('0x3c')]({},_0x6fa54c,_0x203f94[_0x3d3c('0x3e')]);var _0x56bbe7={'where':_0x6fa54c[_0x3d3c('0x3b')]};return db[_0x3d3c('0x29')][_0x3d3c('0x1b')](_0x56bbe7)[_0x3d3c('0x22')](function(_0x254282){_0x5e98f2[_0x3d3c('0x1b')]=_0x254282;if(_0x203f94[_0x3d3c('0x2e')][_0x3d3c('0x3f')]){_0x6fa54c['include']=[{'all':!![]}];}return db[_0x3d3c('0x29')][_0x3d3c('0x40')](_0x6fa54c);})['then'](function(_0x113cc0){_0x5e98f2[_0x3d3c('0x41')]=_0x113cc0;return _0x5e98f2;})[_0x3d3c('0x22')](respondWithFilteredResult(_0x4164c0,_0x6fa54c))[_0x3d3c('0x42')](handleError(_0x4164c0,null));};exports['show']=function(_0x2cea50,_0x27924c){var _0x280759={'raw':![],'where':{'id':_0x2cea50[_0x3d3c('0x43')]['id']}},_0x43093e={};_0x43093e[_0x3d3c('0x2d')]=_[_0x3d3c('0x2f')](db[_0x3d3c('0x29')][_0x3d3c('0x2a')]);_0x43093e[_0x3d3c('0x2e')]=_[_0x3d3c('0x2f')](_0x2cea50['query']);_0x43093e[_0x3d3c('0x30')]=_['intersection'](_0x43093e['model'],_0x43093e['query']);_0x280759[_0x3d3c('0x32')]=_[_0x3d3c('0x31')](_0x43093e[_0x3d3c('0x2d')],qs[_0x3d3c('0x33')](_0x2cea50['query']['fields']));_0x280759['attributes']=_0x280759['attributes'][_0x3d3c('0x34')]?_0x280759[_0x3d3c('0x32')]:_0x43093e[_0x3d3c('0x2d')];if(_0x2cea50[_0x3d3c('0x2e')][_0x3d3c('0x3f')]){_0x280759['include']=[{'all':!![]}];}_0x280759=_[_0x3d3c('0x3c')]({},_0x280759,_0x2cea50[_0x3d3c('0x3e')]);return db[_0x3d3c('0x29')][_0x3d3c('0x44')](_0x280759)[_0x3d3c('0x22')](handleEntityNotFound(_0x27924c,null))[_0x3d3c('0x22')](respondWithResult(_0x27924c,null))['catch'](handleError(_0x27924c,null));};exports[_0x3d3c('0x45')]=function(_0x42ab1a,_0x7e93b){return db[_0x3d3c('0x29')][_0x3d3c('0x45')](_0x42ab1a['body'],{})[_0x3d3c('0x22')](respondWithResult(_0x7e93b,0xc9))[_0x3d3c('0x42')](handleError(_0x7e93b,null));};exports[_0x3d3c('0x46')]=function(_0x1d6231,_0x3f5b0b){return db['AnalyticFieldReport'][_0x3d3c('0x46')](_0x1d6231[_0x3d3c('0x47')],{'raw':![],'individualHooks':!![]})[_0x3d3c('0x22')](respondWithResult(_0x3f5b0b,0xc9))[_0x3d3c('0x42')](handleError(_0x3f5b0b,null));};exports[_0x3d3c('0x21')]=function(_0x599959,_0x19b16c){if(_0x599959[_0x3d3c('0x47')]['id']){delete _0x599959[_0x3d3c('0x47')]['id'];}return db[_0x3d3c('0x29')][_0x3d3c('0x44')]({'where':{'id':_0x599959['params']['id']}})[_0x3d3c('0x22')](handleEntityNotFound(_0x19b16c,null))[_0x3d3c('0x22')](saveUpdates(_0x599959['body'],null))[_0x3d3c('0x22')](respondWithResult(_0x19b16c,null))[_0x3d3c('0x42')](handleError(_0x19b16c,null));};exports[_0x3d3c('0x23')]=function(_0x3ac25e,_0x471268){return db['AnalyticFieldReport'][_0x3d3c('0x44')]({'where':{'id':_0x3ac25e['params']['id']}})['then'](handleEntityNotFound(_0x471268,null))[_0x3d3c('0x22')](removeEntity(_0x471268,null))[_0x3d3c('0x42')](handleError(_0x471268,null));};exports['bulkDestroy']=function(_0x1564dc,_0x445d21){return db[_0x3d3c('0x29')][_0x3d3c('0x23')]({'where':{'id':_0x1564dc['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3d3c('0x22')](respondWithResult(_0x445d21,0xcc))[_0x3d3c('0x42')](handleError(_0x445d21,null));};exports['addFields']=function(_0x4531f1,_0xbcc20f,_0x14508f){return db[_0x3d3c('0x48')][_0x3d3c('0x49')]({'where':{'id':_0x4531f1[_0x3d3c('0x43')]['id']}})[_0x3d3c('0x22')](handleEntityNotFound(_0xbcc20f,null))[_0x3d3c('0x22')](function(_0x1d93a2){if(_0x1d93a2){return db[_0x3d3c('0x4a')]['transaction'](function(_0x1cee91){return db[_0x3d3c('0x29')][_0x3d3c('0x23')]({'where':{'CustomReportId':_0x4531f1['params']['id']},'transaction':_0x1cee91})['then'](function(_0x32e324){var _0x35167c=_[_0x3d3c('0x28')](_0x4531f1['body'],function(_0x4c9745){delete _0x4c9745['id'];_0x4c9745[_0x3d3c('0x4b')]=_0x4531f1[_0x3d3c('0x43')]['id'];return _0x4c9745;});return db[_0x3d3c('0x29')][_0x3d3c('0x46')](_0x35167c,{'transaction':_0x1cee91});});})[_0x3d3c('0x22')](function(){return db['AnalyticFieldReport'][_0x3d3c('0x40')]({'where':{'CustomReportId':_0x4531f1[_0x3d3c('0x43')]['id']}});});}})[_0x3d3c('0x22')](respondWithResult(_0xbcc20f,null))[_0x3d3c('0x42')](handleError(_0xbcc20f,null));}; \ No newline at end of file +var _0xe738=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','update','destroy','stack','name','send','index','map','AnalyticFieldReport','key','model'];(function(_0x65e1d5,_0x463f69){var _0x1aaa37=function(_0x4579ad){while(--_0x4579ad){_0x65e1d5['push'](_0x65e1d5['shift']());}};_0x1aaa37(++_0x463f69);}(_0xe738,0x113));var _0x8e73=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe738[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x8e73('0x0'));var rimraf=require(_0x8e73('0x1'));var zipdir=require(_0x8e73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e73('0x3'));var moment=require(_0x8e73('0x4'));var BPromise=require(_0x8e73('0x5'));var Mustache=require(_0x8e73('0x6'));var util=require(_0x8e73('0x7'));var path=require(_0x8e73('0x8'));var sox=require('sox');var csv=require(_0x8e73('0x9'));var ejs=require(_0x8e73('0xa'));var fs=require('fs');var fs_extra=require(_0x8e73('0xb'));var _=require(_0x8e73('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e73('0xd'));var deskjs=require(_0x8e73('0xe'));var toCsv=require(_0x8e73('0x9'));var querystring=require('querystring');var Papa=require(_0x8e73('0xf'));var Redis=require(_0x8e73('0x10'));var authService=require(_0x8e73('0x11'));var qs=require(_0x8e73('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e73('0x13'));var logger=require(_0x8e73('0x14'))(_0x8e73('0x15'));var utils=require(_0x8e73('0x16'));var config=require(_0x8e73('0x17'));var licenseUtil=require(_0x8e73('0x18'));var db=require(_0x8e73('0x19'))['db'];function respondWithStatusCode(_0x1503bb,_0x5dbd00){_0x5dbd00=_0x5dbd00||0xcc;return function(_0x206780){if(_0x206780){return _0x1503bb[_0x8e73('0x1a')](_0x5dbd00);}return _0x1503bb['status'](_0x5dbd00)[_0x8e73('0x1b')]();};}function respondWithResult(_0x5bbe06,_0x3ecd98){_0x3ecd98=_0x3ecd98||0xc8;return function(_0x529106){if(_0x529106){return _0x5bbe06[_0x8e73('0x1c')](_0x3ecd98)[_0x8e73('0x1d')](_0x529106);}};}function respondWithFilteredResult(_0x53d523,_0x5cf330){return function(_0x5aa3f4){if(_0x5aa3f4){var _0x10c24e=typeof _0x5cf330[_0x8e73('0x1e')]===_0x8e73('0x1f')&&typeof _0x5cf330['limit']===_0x8e73('0x1f');var _0x2ce77c=_0x5aa3f4['count'];var _0x186e33=_0x10c24e?0x0:_0x5cf330[_0x8e73('0x1e')];var _0x3dc6f2=_0x10c24e?_0x5aa3f4[_0x8e73('0x20')]:_0x5cf330['offset']+_0x5cf330['limit'];var _0x2eacad;if(_0x3dc6f2>=_0x2ce77c){_0x3dc6f2=_0x2ce77c;_0x2eacad=0xc8;}else{_0x2eacad=0xce;}_0x53d523[_0x8e73('0x1c')](_0x2eacad);return _0x53d523[_0x8e73('0x21')](_0x8e73('0x22'),_0x186e33+'-'+_0x3dc6f2+'/'+_0x2ce77c)['json'](_0x5aa3f4);}return null;};}function patchUpdates(_0x5e0791){return function(_0x10f76e){try{jsonpatch['apply'](_0x10f76e,_0x5e0791,!![]);}catch(_0x58b25e){return BPromise['reject'](_0x58b25e);}return _0x10f76e['save']();};}function saveUpdates(_0x38fbd5,_0x382511){return function(_0x2154f9){if(_0x2154f9){return _0x2154f9[_0x8e73('0x23')](_0x38fbd5)['then'](function(_0x11f9a2){return _0x11f9a2;});}return null;};}function removeEntity(_0x51bee3,_0x48aec9){return function(_0x1f7e9b){if(_0x1f7e9b){return _0x1f7e9b[_0x8e73('0x24')]()['then'](function(){_0x51bee3[_0x8e73('0x1c')](0xcc)[_0x8e73('0x1b')]();});}};}function handleEntityNotFound(_0x278147,_0x584ecd){return function(_0x1ca89a){if(!_0x1ca89a){_0x278147[_0x8e73('0x1a')](0x194);}return _0x1ca89a;};}function handleError(_0x2ea916,_0x3f4a2e){_0x3f4a2e=_0x3f4a2e||0x1f4;return function(_0x4a804f){logger['error'](_0x4a804f[_0x8e73('0x25')]);if(_0x4a804f[_0x8e73('0x26')]){delete _0x4a804f[_0x8e73('0x26')];}_0x2ea916[_0x8e73('0x1c')](_0x3f4a2e)[_0x8e73('0x27')](_0x4a804f);};}exports[_0x8e73('0x28')]=function(_0x2d2e7a,_0x33b4c9){var _0x42f36a={},_0x5f525a={},_0x395835={'count':0x0,'rows':[]};var _0x4f0662=_[_0x8e73('0x29')](db[_0x8e73('0x2a')]['rawAttributes'],function(_0x5527a0){return{'name':_0x5527a0['fieldName'],'type':_0x5527a0['type'][_0x8e73('0x2b')]};});_0x5f525a[_0x8e73('0x2c')]=_['map'](_0x4f0662,_0x8e73('0x26'));_0x5f525a['query']=_['keys'](_0x2d2e7a[_0x8e73('0x2d')]);_0x5f525a['filters']=_[_0x8e73('0x2e')](_0x5f525a[_0x8e73('0x2c')],_0x5f525a[_0x8e73('0x2d')]);_0x42f36a[_0x8e73('0x2f')]=_[_0x8e73('0x2e')](_0x5f525a[_0x8e73('0x2c')],qs['fields'](_0x2d2e7a['query'][_0x8e73('0x30')]));_0x42f36a[_0x8e73('0x2f')]=_0x42f36a[_0x8e73('0x2f')][_0x8e73('0x31')]?_0x42f36a['attributes']:_0x5f525a[_0x8e73('0x2c')];if(!_0x2d2e7a['query'][_0x8e73('0x32')](_0x8e73('0x33'))){_0x42f36a[_0x8e73('0x34')]=qs['limit'](_0x2d2e7a['query'][_0x8e73('0x34')]);_0x42f36a[_0x8e73('0x1e')]=qs[_0x8e73('0x1e')](_0x2d2e7a['query']['offset']);}_0x42f36a[_0x8e73('0x35')]=qs[_0x8e73('0x36')](_0x2d2e7a[_0x8e73('0x2d')]['sort']);_0x42f36a[_0x8e73('0x37')]=qs[_0x8e73('0x38')](_[_0x8e73('0x39')](_0x2d2e7a['query'],_0x5f525a[_0x8e73('0x38')]),_0x4f0662);if(_0x2d2e7a[_0x8e73('0x2d')]['filter']){_0x42f36a[_0x8e73('0x37')]=_['merge'](_0x42f36a[_0x8e73('0x37')],{'$or':_[_0x8e73('0x29')](_0x4f0662,function(_0x3a4b64){if(_0x3a4b64[_0x8e73('0x3a')]!==_0x8e73('0x3b')){var _0x110d69={};_0x110d69[_0x3a4b64[_0x8e73('0x26')]]={'$like':'%'+_0x2d2e7a[_0x8e73('0x2d')][_0x8e73('0x3c')]+'%'};return _0x110d69;}})});}_0x42f36a=_['merge']({},_0x42f36a,_0x2d2e7a[_0x8e73('0x3d')]);var _0x4d6d35={'where':_0x42f36a[_0x8e73('0x37')]};return db[_0x8e73('0x2a')][_0x8e73('0x20')](_0x4d6d35)[_0x8e73('0x3e')](function(_0x16ca68){_0x395835[_0x8e73('0x20')]=_0x16ca68;if(_0x2d2e7a[_0x8e73('0x2d')][_0x8e73('0x3f')]){_0x42f36a[_0x8e73('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8e73('0x41')](_0x42f36a);})[_0x8e73('0x3e')](function(_0x4264a6){_0x395835[_0x8e73('0x42')]=_0x4264a6;return _0x395835;})[_0x8e73('0x3e')](respondWithFilteredResult(_0x33b4c9,_0x42f36a))[_0x8e73('0x43')](handleError(_0x33b4c9,null));};exports[_0x8e73('0x44')]=function(_0x108b52,_0xb1fda8){var _0x39dfca={'raw':![],'where':{'id':_0x108b52[_0x8e73('0x45')]['id']}},_0x3cc006={};_0x3cc006[_0x8e73('0x2c')]=_[_0x8e73('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x3cc006[_0x8e73('0x2d')]=_[_0x8e73('0x46')](_0x108b52[_0x8e73('0x2d')]);_0x3cc006[_0x8e73('0x38')]=_[_0x8e73('0x2e')](_0x3cc006[_0x8e73('0x2c')],_0x3cc006['query']);_0x39dfca['attributes']=_[_0x8e73('0x2e')](_0x3cc006[_0x8e73('0x2c')],qs[_0x8e73('0x30')](_0x108b52[_0x8e73('0x2d')]['fields']));_0x39dfca[_0x8e73('0x2f')]=_0x39dfca[_0x8e73('0x2f')][_0x8e73('0x31')]?_0x39dfca[_0x8e73('0x2f')]:_0x3cc006[_0x8e73('0x2c')];if(_0x108b52[_0x8e73('0x2d')][_0x8e73('0x3f')]){_0x39dfca[_0x8e73('0x40')]=[{'all':!![]}];}_0x39dfca=_[_0x8e73('0x47')]({},_0x39dfca,_0x108b52[_0x8e73('0x3d')]);return db[_0x8e73('0x2a')][_0x8e73('0x48')](_0x39dfca)[_0x8e73('0x3e')](handleEntityNotFound(_0xb1fda8,null))[_0x8e73('0x3e')](respondWithResult(_0xb1fda8,null))[_0x8e73('0x43')](handleError(_0xb1fda8,null));};exports['create']=function(_0x27b343,_0x2a80dd){return db[_0x8e73('0x2a')][_0x8e73('0x49')](_0x27b343[_0x8e73('0x4a')],{})[_0x8e73('0x3e')](respondWithResult(_0x2a80dd,0xc9))[_0x8e73('0x43')](handleError(_0x2a80dd,null));};exports[_0x8e73('0x4b')]=function(_0x5d82fe,_0x481a03){return db[_0x8e73('0x2a')][_0x8e73('0x4b')](_0x5d82fe['body'],{'raw':![],'individualHooks':!![]})[_0x8e73('0x3e')](respondWithResult(_0x481a03,0xc9))[_0x8e73('0x43')](handleError(_0x481a03,null));};exports[_0x8e73('0x23')]=function(_0x3ee027,_0x5d4352){if(_0x3ee027[_0x8e73('0x4a')]['id']){delete _0x3ee027['body']['id'];}return db[_0x8e73('0x2a')][_0x8e73('0x48')]({'where':{'id':_0x3ee027[_0x8e73('0x45')]['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x5d4352,null))[_0x8e73('0x3e')](saveUpdates(_0x3ee027[_0x8e73('0x4a')],null))[_0x8e73('0x3e')](respondWithResult(_0x5d4352,null))[_0x8e73('0x43')](handleError(_0x5d4352,null));};exports[_0x8e73('0x24')]=function(_0x2f1d0f,_0x4d239c){return db[_0x8e73('0x2a')][_0x8e73('0x48')]({'where':{'id':_0x2f1d0f['params']['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x4d239c,null))['then'](removeEntity(_0x4d239c,null))[_0x8e73('0x43')](handleError(_0x4d239c,null));};exports['bulkDestroy']=function(_0x4efb02,_0x4a0e18){return db['AnalyticFieldReport'][_0x8e73('0x24')]({'where':{'id':_0x4efb02[_0x8e73('0x2d')][_0x8e73('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x8e73('0x3e')](respondWithResult(_0x4a0e18,0xcc))['catch'](handleError(_0x4a0e18,null));};exports[_0x8e73('0x4d')]=function(_0x23a6ad,_0x4a0fb9,_0x20cf36){return db[_0x8e73('0x4e')][_0x8e73('0x4f')]({'where':{'id':_0x23a6ad['params']['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x4a0fb9,null))[_0x8e73('0x3e')](function(_0x11653a){if(_0x11653a){return db['sequelize']['transaction'](function(_0x25020b){return db['AnalyticFieldReport'][_0x8e73('0x24')]({'where':{'CustomReportId':_0x23a6ad[_0x8e73('0x45')]['id']},'transaction':_0x25020b})['then'](function(_0x226f0c){var _0x427f42=_[_0x8e73('0x29')](_0x23a6ad['body'],function(_0x3044d5){delete _0x3044d5['id'];_0x3044d5['CustomReportId']=_0x23a6ad[_0x8e73('0x45')]['id'];return _0x3044d5;});return db[_0x8e73('0x2a')][_0x8e73('0x4b')](_0x427f42,{'transaction':_0x25020b});});})['then'](function(){return db[_0x8e73('0x2a')][_0x8e73('0x41')]({'where':{'CustomReportId':_0x23a6ad['params']['id']}});});}})[_0x8e73('0x3e')](respondWithResult(_0x4a0fb9,null))['catch'](handleError(_0x4a0fb9,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index dd6c2e5..e280f90 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 _0x85d2=['rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x12d504,_0x38cc60){var _0x46a2bc=function(_0x442b5b){while(--_0x442b5b){_0x12d504['push'](_0x12d504['shift']());}};_0x46a2bc(++_0x38cc60);}(_0x85d2,0x109));var _0x285d=function(_0x450845,_0x1327a9){_0x450845=_0x450845-0x0;var _0x1d48b3=_0x85d2[_0x450845];return _0x1d48b3;};'use strict';var _=require(_0x285d('0x0'));var util=require(_0x285d('0x1'));var logger=require(_0x285d('0x2'))(_0x285d('0x3'));var moment=require(_0x285d('0x4'));var BPromise=require(_0x285d('0x5'));var rp=require(_0x285d('0x6'));var fs=require('fs');var path=require(_0x285d('0x7'));var rimraf=require(_0x285d('0x8'));var config=require(_0x285d('0x9'));var attributes=require(_0x285d('0xa'));module['exports']=function(_0x223e75,_0xf50461){return _0x223e75['define'](_0x285d('0xb'),attributes,{'tableName':_0x285d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59b3=['AnalyticFieldReport','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x59b3,0x140));var _0x359b=function(_0xae0c01,_0x449c99){_0xae0c01=_0xae0c01-0x0;var _0x913e86=_0x59b3[_0xae0c01];return _0x913e86;};'use strict';var _=require(_0x359b('0x0'));var util=require(_0x359b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x359b('0x2'));var BPromise=require(_0x359b('0x3'));var rp=require(_0x359b('0x4'));var fs=require('fs');var path=require(_0x359b('0x5'));var rimraf=require(_0x359b('0x6'));var config=require(_0x359b('0x7'));var attributes=require(_0x359b('0x8'));module[_0x359b('0x9')]=function(_0x36031d,_0x34f688){return _0x36031d['define'](_0x359b('0xa'),attributes,{'tableName':'analytics_report_fields','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 2f67e73..f5aef53 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 _0x76ed=['message','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x76ed,0x157));var _0xd76e=function(_0x546efe,_0x51078d){_0x546efe=_0x546efe-0x0;var _0x1bb57b=_0x76ed[_0x546efe];return _0x1bb57b;};'use strict';var _=require(_0xd76e('0x0'));var util=require(_0xd76e('0x1'));var moment=require(_0xd76e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd76e('0x3'))['db'];var utils=require(_0xd76e('0x4'));var logger=require(_0xd76e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd76e('0x6')][_0xd76e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17f92a,_0x40d404,_0x485d04){return new BPromise(function(_0x1c35e2,_0x29e1c5){return client[_0xd76e('0x8')](_0x17f92a,_0x485d04)[_0xd76e('0x9')](function(_0x4e6019){logger[_0xd76e('0xa')](_0xd76e('0xb'),_0x40d404,_0xd76e('0xc'));logger[_0xd76e('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x40d404,_0xd76e('0xc'),JSON[_0xd76e('0xe')](_0x4e6019));if(_0x4e6019[_0xd76e('0xf')]){if(_0x4e6019[_0xd76e('0xf')][_0xd76e('0x10')]===0x1f4){logger[_0xd76e('0xf')](_0xd76e('0xb'),_0x40d404,_0x4e6019[_0xd76e('0xf')][_0xd76e('0x11')]);return _0x29e1c5(_0x4e6019[_0xd76e('0xf')][_0xd76e('0x11')]);}logger[_0xd76e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x40d404,_0x4e6019[_0xd76e('0xf')][_0xd76e('0x11')]);return _0x1c35e2(_0x4e6019[_0xd76e('0xf')][_0xd76e('0x11')]);}else{logger['info'](_0xd76e('0xb'),_0x40d404,'request\x20sent');_0x1c35e2(_0x4e6019['result'][_0xd76e('0x11')]);}})['catch'](function(_0x431787){logger['error'](_0xd76e('0xb'),_0x40d404,_0x431787);_0x29e1c5(_0x431787);});});} \ No newline at end of file +var _0x0130=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x3dfd79,_0x37d23b){var _0x3a2714=function(_0x1114cb){while(--_0x1114cb){_0x3dfd79['push'](_0x3dfd79['shift']());}};_0x3a2714(++_0x37d23b);}(_0x0130,0x11d));var _0x0013=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x0130[_0x4f4c2a];return _0xd15be6;};'use strict';var _=require(_0x0013('0x0'));var util=require('util');var moment=require(_0x0013('0x1'));var BPromise=require(_0x0013('0x2'));var rs=require(_0x0013('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0013('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0013('0x5'));var jayson=require(_0x0013('0x6'));var client=jayson[_0x0013('0x7')][_0x0013('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1053b6,_0x33f663,_0x1b89f6){return new BPromise(function(_0x47e5df,_0x362ce5){return client[_0x0013('0x9')](_0x1053b6,_0x1b89f6)[_0x0013('0xa')](function(_0x3df82a){logger[_0x0013('0xb')](_0x0013('0xc'),_0x33f663,_0x0013('0xd'));logger[_0x0013('0xe')](_0x0013('0xf'),_0x33f663,_0x0013('0xd'),JSON[_0x0013('0x10')](_0x3df82a));if(_0x3df82a[_0x0013('0x11')]){if(_0x3df82a[_0x0013('0x11')][_0x0013('0x12')]===0x1f4){logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x3df82a['error']['message']);return _0x362ce5(_0x3df82a[_0x0013('0x11')][_0x0013('0x13')]);}logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x3df82a['error'][_0x0013('0x13')]);return _0x47e5df(_0x3df82a[_0x0013('0x11')]['message']);}else{logger[_0x0013('0xb')](_0x0013('0xc'),_0x33f663,_0x0013('0xd'));_0x47e5df(_0x3df82a[_0x0013('0x14')][_0x0013('0x13')]);}})['catch'](function(_0x2711ed){logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x2711ed);_0x362ce5(_0x2711ed);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e23061f..b2241f0 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(_0x5e199b,_0x4abbfa){var _0x53931d=function(_0x368754){while(--_0x368754){_0x5e199b['push'](_0x5e199b['shift']());}};_0x53931d(++_0x4abbfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x595d76,_0x18d497){var _0xbac517=function(_0x20baee){while(--_0x20baee){_0x595d76['push'](_0x595d76['shift']());}};_0xbac517(++_0x18d497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 b1ffc79..2681a13 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 _0x7072=['exports','STRING','name','TEXT'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x7072,0x138));var _0x2707=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x7072[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'name':{'type':Sequelize[_0x2707('0x1')],'allowNull':![],'unique':_0x2707('0x2')},'table':{'type':Sequelize[_0x2707('0x1')]},'metric':{'type':Sequelize[_0x2707('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c00=['sequelize','exports','STRING','TEXT'];(function(_0x5ca784,_0x28bea2){var _0x5aa579=function(_0x531234){while(--_0x531234){_0x5ca784['push'](_0x5ca784['shift']());}};_0x5aa579(++_0x28bea2);}(_0x9c00,0x1a0));var _0x09c0=function(_0x308375,_0x3a93cc){_0x308375=_0x308375-0x0;var _0x18d40c=_0x9c00[_0x308375];return _0x18d40c;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x09c0('0x2')]},'metric':{'type':Sequelize[_0x09c0('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 4073806..05f532a 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','sendStatus','end','status','json'];(function(_0x4b3152,_0x2ffdf6){var _0x47c35c=function(_0x3efaba){while(--_0x3efaba){_0x4b3152['push'](_0x4b3152['shift']());}};_0x47c35c(++_0x2ffdf6);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xe5b3[_0x4e697a];return _0x88850c;};'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'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file +var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0x55ca,0x126));var _0xa55c=function(_0x4b3413,_0x58c416){_0x4b3413=_0x4b3413-0x0;var _0x3b01ba=_0x55ca[_0x4b3413];return _0x3b01ba;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index a08c159..a458b08 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 _0x297f=['analytics_metrics','lodash','util','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x443935,_0x3912e0){var _0x5306e2=function(_0x149e18){while(--_0x149e18){_0x443935['push'](_0x443935['shift']());}};_0x5306e2(++_0x3912e0);}(_0x297f,0x1f0));var _0xf297=function(_0x1688c0,_0x405a5e){_0x1688c0=_0x1688c0-0x0;var _0x917e1a=_0x297f[_0x1688c0];return _0x917e1a;};'use strict';var _=require(_0xf297('0x0'));var util=require(_0xf297('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf297('0x2'));var BPromise=require(_0xf297('0x3'));var rp=require(_0xf297('0x4'));var fs=require('fs');var path=require(_0xf297('0x5'));var rimraf=require('rimraf');var config=require(_0xf297('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xf297('0x7')]=function(_0x353e78,_0x2282eb){return _0x353e78['define']('AnalyticMetric',attributes,{'tableName':_0xf297('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd991=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0xd991,0x115));var _0x1d99=function(_0x547a18,_0x3d92c9){_0x547a18=_0x547a18-0x0;var _0x49a74f=_0xd991[_0x547a18];return _0x49a74f;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var logger=require(_0x1d99('0x2'))(_0x1d99('0x3'));var moment=require(_0x1d99('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d99('0x5'));var fs=require('fs');var path=require(_0x1d99('0x6'));var rimraf=require(_0x1d99('0x7'));var config=require(_0x1d99('0x8'));var attributes=require(_0x1d99('0x9'));module[_0x1d99('0xa')]=function(_0x5f3a37,_0x1adbca){return _0x5f3a37[_0x1d99('0xb')]('AnalyticMetric',attributes,{'tableName':_0x1d99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 9dce4f1..de53e47 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 _0x3095=['AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x266291,_0x3cded0){var _0x2f824c=function(_0xc6eacb){while(--_0xc6eacb){_0x266291['push'](_0x266291['shift']());}};_0x2f824c(++_0x3cded0);}(_0x3095,0xf7));var _0x5309=function(_0x24bbc9,_0x49c2c2){_0x24bbc9=_0x24bbc9-0x0;var _0x176a0b=_0x3095[_0x24bbc9];return _0x176a0b;};'use strict';var _=require(_0x5309('0x0'));var util=require('util');var moment=require(_0x5309('0x1'));var BPromise=require(_0x5309('0x2'));var rs=require(_0x5309('0x3'));var fs=require('fs');var Redis=require(_0x5309('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5309('0x5'));var logger=require(_0x5309('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5309('0x7')][_0x5309('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x492748,_0x4f9ffa,_0xfabc70){return new BPromise(function(_0x106cc9,_0x1c5524){return client[_0x5309('0x9')](_0x492748,_0xfabc70)[_0x5309('0xa')](function(_0x1c089e){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x4f9ffa,_0x5309('0xb'));logger[_0x5309('0xc')](_0x5309('0xd'),_0x4f9ffa,'request\x20sent',JSON[_0x5309('0xe')](_0x1c089e));if(_0x1c089e[_0x5309('0xf')]){if(_0x1c089e[_0x5309('0xf')][_0x5309('0x10')]===0x1f4){logger[_0x5309('0xf')](_0x5309('0x11'),_0x4f9ffa,_0x1c089e['error'][_0x5309('0x12')]);return _0x1c5524(_0x1c089e[_0x5309('0xf')][_0x5309('0x12')]);}logger[_0x5309('0xf')](_0x5309('0x11'),_0x4f9ffa,_0x1c089e['error'][_0x5309('0x12')]);return _0x106cc9(_0x1c089e[_0x5309('0xf')][_0x5309('0x12')]);}else{logger[_0x5309('0x13')](_0x5309('0x11'),_0x4f9ffa,_0x5309('0xb'));_0x106cc9(_0x1c089e[_0x5309('0x14')][_0x5309('0x12')]);}})[_0x5309('0x15')](function(_0x13d3a0){logger[_0x5309('0xf')](_0x5309('0x11'),_0x4f9ffa,_0x13d3a0);_0x1c5524(_0x13d3a0);});});} \ No newline at end of file +var _0xc83a=['jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b03a5,_0x812ea1){var _0x12d60d=function(_0x336667){while(--_0x336667){_0x1b03a5['push'](_0x1b03a5['shift']());}};_0x12d60d(++_0x812ea1);}(_0xc83a,0x10a));var _0xac83=function(_0x44757b,_0x1133d4){_0x44757b=_0x44757b-0x0;var _0x2e53d6=_0xc83a[_0x44757b];return _0x2e53d6;};'use strict';var _=require(_0xac83('0x0'));var util=require('util');var moment=require(_0xac83('0x1'));var BPromise=require(_0xac83('0x2'));var rs=require(_0xac83('0x3'));var fs=require('fs');var Redis=require(_0xac83('0x4'));var db=require(_0xac83('0x5'))['db'];var utils=require(_0xac83('0x6'));var logger=require(_0xac83('0x7'))(_0xac83('0x8'));var config=require(_0xac83('0x9'));var jayson=require(_0xac83('0xa'));var client=jayson['client'][_0xac83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1351a2,_0x43a764,_0x442ffb){return new BPromise(function(_0x5c7679,_0x27ec9a){return client[_0xac83('0xc')](_0x1351a2,_0x442ffb)[_0xac83('0xd')](function(_0xc1e695){logger[_0xac83('0xe')](_0xac83('0xf'),_0x43a764,_0xac83('0x10'));logger[_0xac83('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'),JSON['stringify'](_0xc1e695));if(_0xc1e695['error']){if(_0xc1e695[_0xac83('0x12')][_0xac83('0x13')]===0x1f4){logger[_0xac83('0x12')](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')]['message']);return _0x27ec9a(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}logger['error'](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);return _0x5c7679(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}else{logger[_0xac83('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'));_0x5c7679(_0xc1e695[_0xac83('0x15')][_0xac83('0x14')]);}})[_0xac83('0x16')](function(_0x14ebeb){logger[_0xac83('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0x14ebeb);_0x27ec9a(_0x14ebeb);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 6535cae..400ace3 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 _0x23f4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','delete','destroy','util'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x23f4,0x1ee));var _0x423f=function(_0x26e53c,_0x3cd3c9){_0x26e53c=_0x26e53c-0x0;var _0x3f0b3e=_0x23f4[_0x26e53c];return _0x3f0b3e;};'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('0xc')]('/',auth[_0x423f('0x9')](),controller['create']);router['put']('/:id',auth[_0x423f('0x9')](),controller['update']);router[_0x423f('0xd')](_0x423f('0xa'),auth[_0x423f('0x9')](),controller[_0x423f('0xe')]);module['exports']=router; \ No newline at end of file +var _0x37cc=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4752d4,_0x350e24){var _0x567af7=function(_0xf245f2){while(--_0xf245f2){_0x4752d4['push'](_0x4752d4['shift']());}};_0x567af7(++_0x350e24);}(_0x37cc,0x185));var _0xc37c=function(_0x474ef8,_0x543bc0){_0x474ef8=_0x474ef8-0x0;var _0x403ed1=_0x37cc[_0x474ef8];return _0x403ed1;};'use strict';var multer=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var path=require(_0xc37c('0x2'));var timeout=require(_0xc37c('0x3'));var express=require(_0xc37c('0x4'));var router=express[_0xc37c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var controller=require(_0xc37c('0x8'));router[_0xc37c('0x9')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xb')]);router[_0xc37c('0x9')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller['show']);router[_0xc37c('0xd')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xe')]);router[_0xc37c('0xf')](_0xc37c('0xc'),auth['isAuthenticated'](),controller[_0xc37c('0x10')]);router[_0xc37c('0x11')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller[_0xc37c('0x12')]);module[_0xc37c('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 8a76a7c..d02867c 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 _0x046f=['sequelize','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x046f,0x1a2));var _0xf046=function(_0x3d05f1,_0x10fab4){_0x3d05f1=_0x3d05f1-0x0;var _0x38cafd=_0x046f[_0x3d05f1];return _0x38cafd;};'use strict';var Sequelize=require(_0xf046('0x0'));module[_0xf046('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xc663=['TEXT'];(function(_0x46cd90,_0x25b41a){var _0x3320b8=function(_0x2ea9f6){while(--_0x2ea9f6){_0x46cd90['push'](_0x46cd90['shift']());}};_0x3320b8(++_0x25b41a);}(_0xc663,0x1ea));var _0x3c66=function(_0x59400c,_0x364897){_0x59400c=_0x59400c-0x0;var _0x51508d=_0xc663[_0x59400c];return _0x51508d;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x3c66('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 7fd201e..2fc5f30 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 _0xff5c=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0xff5c,0x1b0));var _0xcff5=function(_0x138c5a,_0x4e7f5d){_0x138c5a=_0x138c5a-0x0;var _0x311cfb=_0xff5c[_0x138c5a];return _0x311cfb;};'use strict';var emlformat=require(_0xcff5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcff5('0x1'));var jsonpatch=require(_0xcff5('0x2'));var rp=require(_0xcff5('0x3'));var moment=require('moment');var BPromise=require(_0xcff5('0x4'));var Mustache=require(_0xcff5('0x5'));var util=require(_0xcff5('0x6'));var path=require(_0xcff5('0x7'));var sox=require(_0xcff5('0x8'));var csv=require(_0xcff5('0x9'));var ejs=require(_0xcff5('0xa'));var fs=require('fs');var fs_extra=require(_0xcff5('0xb'));var _=require(_0xcff5('0xc'));var squel=require(_0xcff5('0xd'));var crypto=require(_0xcff5('0xe'));var jsforce=require(_0xcff5('0xf'));var deskjs=require(_0xcff5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcff5('0x11'));var qs=require(_0xcff5('0x12'));var as=require(_0xcff5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcff5('0x14'))(_0xcff5('0x15'));var utils=require('../../config/utils');var config=require(_0xcff5('0x16'));var licenseUtil=require(_0xcff5('0x17'));var db=require(_0xcff5('0x18'))['db'];function respondWithStatusCode(_0x4e2444,_0x140a8a){_0x140a8a=_0x140a8a||0xcc;return function(_0x48c459){if(_0x48c459){return _0x4e2444[_0xcff5('0x19')](_0x140a8a);}return _0x4e2444['status'](_0x140a8a)[_0xcff5('0x1a')]();};}function respondWithResult(_0x1a1ede,_0x30606e){_0x30606e=_0x30606e||0xc8;return function(_0x1ff455){if(_0x1ff455){return _0x1a1ede[_0xcff5('0x1b')](_0x30606e)[_0xcff5('0x1c')](_0x1ff455);}};}function respondWithFilteredResult(_0x2ef783,_0x4ccfcd){return function(_0x19ece5){if(_0x19ece5){var _0x54bdf4=typeof _0x4ccfcd[_0xcff5('0x1d')]===_0xcff5('0x1e')&&typeof _0x4ccfcd['limit']==='undefined';var _0x1e4242=_0x19ece5[_0xcff5('0x1f')];var _0x294aa5=_0x54bdf4?0x0:_0x4ccfcd[_0xcff5('0x1d')];var _0x5335b5=_0x54bdf4?_0x19ece5[_0xcff5('0x1f')]:_0x4ccfcd[_0xcff5('0x1d')]+_0x4ccfcd[_0xcff5('0x20')];var _0x148c8c;if(_0x5335b5>=_0x1e4242){_0x5335b5=_0x1e4242;_0x148c8c=0xc8;}else{_0x148c8c=0xce;}_0x2ef783[_0xcff5('0x1b')](_0x148c8c);return _0x2ef783[_0xcff5('0x21')](_0xcff5('0x22'),_0x294aa5+'-'+_0x5335b5+'/'+_0x1e4242)[_0xcff5('0x1c')](_0x19ece5);}return null;};}function patchUpdates(_0xcd204e){return function(_0x62cc29){try{jsonpatch[_0xcff5('0x23')](_0x62cc29,_0xcd204e,!![]);}catch(_0x4c69bd){return BPromise[_0xcff5('0x24')](_0x4c69bd);}return _0x62cc29[_0xcff5('0x25')]();};}function saveUpdates(_0x31f402,_0x173566){return function(_0x1c3baf){if(_0x1c3baf){return _0x1c3baf[_0xcff5('0x26')](_0x31f402)[_0xcff5('0x27')](function(_0x5e8072){return _0x5e8072;});}return null;};}function removeEntity(_0x479e05,_0xeadbf1){return function(_0x5435f9){if(_0x5435f9){return _0x5435f9[_0xcff5('0x28')]()[_0xcff5('0x27')](function(){_0x479e05[_0xcff5('0x1b')](0xcc)[_0xcff5('0x1a')]();});}};}function handleEntityNotFound(_0x2d2d07,_0x42562a){return function(_0x10e85a){if(!_0x10e85a){_0x2d2d07[_0xcff5('0x19')](0x194);}return _0x10e85a;};}function handleError(_0x34bccc,_0x310441){_0x310441=_0x310441||0x1f4;return function(_0x1ae8fa){logger[_0xcff5('0x29')](_0x1ae8fa[_0xcff5('0x2a')]);if(_0x1ae8fa[_0xcff5('0x2b')]){delete _0x1ae8fa['name'];}_0x34bccc['status'](_0x310441)[_0xcff5('0x2c')](_0x1ae8fa);};}exports['index']=function(_0x6fea2b,_0x13577e){var _0x4ad637={},_0x561d75={},_0x437ffb={'count':0x0,'rows':[]};var _0x4d0fcb=_[_0xcff5('0x2d')](db[_0xcff5('0x2e')][_0xcff5('0x2f')],function(_0x4cb24e){return{'name':_0x4cb24e[_0xcff5('0x30')],'type':_0x4cb24e['type'][_0xcff5('0x31')]};});_0x561d75[_0xcff5('0x32')]=_['map'](_0x4d0fcb,_0xcff5('0x2b'));_0x561d75['query']=_[_0xcff5('0x33')](_0x6fea2b[_0xcff5('0x34')]);_0x561d75['filters']=_[_0xcff5('0x35')](_0x561d75['model'],_0x561d75[_0xcff5('0x34')]);_0x4ad637[_0xcff5('0x36')]=_[_0xcff5('0x35')](_0x561d75[_0xcff5('0x32')],qs[_0xcff5('0x37')](_0x6fea2b[_0xcff5('0x34')]['fields']));_0x4ad637['attributes']=_0x4ad637[_0xcff5('0x36')][_0xcff5('0x38')]?_0x4ad637[_0xcff5('0x36')]:_0x561d75[_0xcff5('0x32')];if(!_0x6fea2b[_0xcff5('0x34')][_0xcff5('0x39')]('nolimit')){_0x4ad637[_0xcff5('0x20')]=qs[_0xcff5('0x20')](_0x6fea2b['query']['limit']);_0x4ad637['offset']=qs[_0xcff5('0x1d')](_0x6fea2b[_0xcff5('0x34')][_0xcff5('0x1d')]);}_0x4ad637['order']=qs[_0xcff5('0x3a')](_0x6fea2b[_0xcff5('0x34')][_0xcff5('0x3a')]);_0x4ad637[_0xcff5('0x3b')]=qs[_0xcff5('0x3c')](_[_0xcff5('0x3d')](_0x6fea2b['query'],_0x561d75['filters']),_0x4d0fcb);if(_0x6fea2b[_0xcff5('0x34')]['filter']){_0x4ad637[_0xcff5('0x3b')]=_[_0xcff5('0x3e')](_0x4ad637[_0xcff5('0x3b')],{'$or':_['map'](_0x4d0fcb,function(_0x5f1c61){if(_0x5f1c61[_0xcff5('0x3f')]!==_0xcff5('0x40')){var _0x38bb2c={};_0x38bb2c[_0x5f1c61[_0xcff5('0x2b')]]={'$like':'%'+_0x6fea2b[_0xcff5('0x34')][_0xcff5('0x41')]+'%'};return _0x38bb2c;}})});}_0x4ad637=_[_0xcff5('0x3e')]({},_0x4ad637,_0x6fea2b[_0xcff5('0x42')]);var _0x379333={'where':_0x4ad637[_0xcff5('0x3b')]};return db[_0xcff5('0x2e')][_0xcff5('0x1f')](_0x379333)[_0xcff5('0x27')](function(_0x1ae535){_0x437ffb[_0xcff5('0x1f')]=_0x1ae535;if(_0x6fea2b[_0xcff5('0x34')][_0xcff5('0x43')]){_0x4ad637[_0xcff5('0x44')]=[{'all':!![]}];}return db[_0xcff5('0x2e')][_0xcff5('0x45')](_0x4ad637);})['then'](function(_0x8eb063){_0x437ffb[_0xcff5('0x46')]=_0x8eb063;return _0x437ffb;})[_0xcff5('0x27')](respondWithFilteredResult(_0x13577e,_0x4ad637))[_0xcff5('0x47')](handleError(_0x13577e,null));};exports[_0xcff5('0x48')]=function(_0x59b1b4,_0x416b9b){var _0x6ba983={'raw':!![],'where':{'id':_0x59b1b4[_0xcff5('0x49')]['id']}},_0x598e15={};_0x598e15[_0xcff5('0x32')]=_['keys'](db[_0xcff5('0x2e')][_0xcff5('0x2f')]);_0x598e15[_0xcff5('0x34')]=_[_0xcff5('0x33')](_0x59b1b4['query']);_0x598e15[_0xcff5('0x3c')]=_[_0xcff5('0x35')](_0x598e15[_0xcff5('0x32')],_0x598e15['query']);_0x6ba983['attributes']=_['intersection'](_0x598e15['model'],qs['fields'](_0x59b1b4[_0xcff5('0x34')]['fields']));_0x6ba983[_0xcff5('0x36')]=_0x6ba983['attributes'][_0xcff5('0x38')]?_0x6ba983[_0xcff5('0x36')]:_0x598e15[_0xcff5('0x32')];if(_0x59b1b4[_0xcff5('0x34')][_0xcff5('0x43')]){_0x6ba983[_0xcff5('0x44')]=[{'all':!![]}];}_0x6ba983=_[_0xcff5('0x3e')]({},_0x6ba983,_0x59b1b4['options']);return db['AnalyticTreeReport'][_0xcff5('0x4a')](_0x6ba983)[_0xcff5('0x27')](handleEntityNotFound(_0x416b9b,null))[_0xcff5('0x27')](respondWithResult(_0x416b9b,null))[_0xcff5('0x47')](handleError(_0x416b9b,null));};exports['create']=function(_0x1e1373,_0x3ab11b){return db[_0xcff5('0x2e')][_0xcff5('0x4b')](_0x1e1373[_0xcff5('0x4c')],{})[_0xcff5('0x27')](respondWithResult(_0x3ab11b,0xc9))['catch'](handleError(_0x3ab11b,null));};exports[_0xcff5('0x26')]=function(_0xd27561,_0x3d5c1e){if(_0xd27561[_0xcff5('0x4c')]['id']){delete _0xd27561[_0xcff5('0x4c')]['id'];}return db[_0xcff5('0x2e')][_0xcff5('0x4a')]({'where':{'id':_0xd27561[_0xcff5('0x49')]['id']}})[_0xcff5('0x27')](handleEntityNotFound(_0x3d5c1e,null))['then'](saveUpdates(_0xd27561['body'],null))['then'](respondWithResult(_0x3d5c1e,null))[_0xcff5('0x47')](handleError(_0x3d5c1e,null));};exports[_0xcff5('0x28')]=function(_0x2903f3,_0x246eb1){return db[_0xcff5('0x2e')]['find']({'where':{'id':_0x2903f3['params']['id']}})[_0xcff5('0x27')](handleEntityNotFound(_0x246eb1,null))[_0xcff5('0x27')](removeEntity(_0x246eb1,null))[_0xcff5('0x47')](handleError(_0x246eb1,null));}; \ No newline at end of file +var _0xa9e7=['query','length','nolimit','order','where','filters','pick','filter','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','intersection','attributes','fields'];(function(_0x53aa46,_0x597524){var _0x5f37f5=function(_0x59b095){while(--_0x59b095){_0x53aa46['push'](_0x53aa46['shift']());}};_0x5f37f5(++_0x597524);}(_0xa9e7,0x185));var _0x7a9e=function(_0x3ff95a,_0x2aeb82){_0x3ff95a=_0x3ff95a-0x0;var _0x172fd5=_0xa9e7[_0x3ff95a];return _0x172fd5;};'use strict';var emlformat=require(_0x7a9e('0x0'));var rimraf=require(_0x7a9e('0x1'));var zipdir=require(_0x7a9e('0x2'));var jsonpatch=require(_0x7a9e('0x3'));var rp=require('request-promise');var moment=require(_0x7a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a9e('0x5'));var util=require(_0x7a9e('0x6'));var path=require(_0x7a9e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a9e('0x8'));var _=require(_0x7a9e('0x9'));var squel=require(_0x7a9e('0xa'));var crypto=require(_0x7a9e('0xb'));var jsforce=require(_0x7a9e('0xc'));var deskjs=require(_0x7a9e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a9e('0xe'));var Papa=require(_0x7a9e('0xf'));var Redis=require('ioredis');var authService=require(_0x7a9e('0x10'));var qs=require(_0x7a9e('0x11'));var as=require(_0x7a9e('0x12'));var hardwareService=require(_0x7a9e('0x13'));var logger=require(_0x7a9e('0x14'))(_0x7a9e('0x15'));var utils=require('../../config/utils');var config=require(_0x7a9e('0x16'));var licenseUtil=require(_0x7a9e('0x17'));var db=require(_0x7a9e('0x18'))['db'];function respondWithStatusCode(_0xd88a5a,_0x35a1fb){_0x35a1fb=_0x35a1fb||0xcc;return function(_0x575248){if(_0x575248){return _0xd88a5a[_0x7a9e('0x19')](_0x35a1fb);}return _0xd88a5a['status'](_0x35a1fb)[_0x7a9e('0x1a')]();};}function respondWithResult(_0x19d33e,_0x5039e2){_0x5039e2=_0x5039e2||0xc8;return function(_0x5b7f91){if(_0x5b7f91){return _0x19d33e[_0x7a9e('0x1b')](_0x5039e2)[_0x7a9e('0x1c')](_0x5b7f91);}};}function respondWithFilteredResult(_0xcfc2c3,_0x122ba8){return function(_0x496078){if(_0x496078){var _0x35ca55=typeof _0x122ba8[_0x7a9e('0x1d')]===_0x7a9e('0x1e')&&typeof _0x122ba8[_0x7a9e('0x1f')]===_0x7a9e('0x1e');var _0x262b8f=_0x496078[_0x7a9e('0x20')];var _0xba9b1=_0x35ca55?0x0:_0x122ba8['offset'];var _0x483be8=_0x35ca55?_0x496078[_0x7a9e('0x20')]:_0x122ba8[_0x7a9e('0x1d')]+_0x122ba8[_0x7a9e('0x1f')];var _0x285383;if(_0x483be8>=_0x262b8f){_0x483be8=_0x262b8f;_0x285383=0xc8;}else{_0x285383=0xce;}_0xcfc2c3[_0x7a9e('0x1b')](_0x285383);return _0xcfc2c3[_0x7a9e('0x21')](_0x7a9e('0x22'),_0xba9b1+'-'+_0x483be8+'/'+_0x262b8f)['json'](_0x496078);}return null;};}function patchUpdates(_0x51aa59){return function(_0x2dad2f){try{jsonpatch[_0x7a9e('0x23')](_0x2dad2f,_0x51aa59,!![]);}catch(_0x252450){return BPromise[_0x7a9e('0x24')](_0x252450);}return _0x2dad2f[_0x7a9e('0x25')]();};}function saveUpdates(_0x58ebf7,_0x422506){return function(_0x5cd019){if(_0x5cd019){return _0x5cd019['update'](_0x58ebf7)[_0x7a9e('0x26')](function(_0x1c289c){return _0x1c289c;});}return null;};}function removeEntity(_0x34a89a,_0x2bbc51){return function(_0x23d40a){if(_0x23d40a){return _0x23d40a[_0x7a9e('0x27')]()[_0x7a9e('0x26')](function(){_0x34a89a['status'](0xcc)[_0x7a9e('0x1a')]();});}};}function handleEntityNotFound(_0x2aca80,_0x1744b3){return function(_0x274a04){if(!_0x274a04){_0x2aca80[_0x7a9e('0x19')](0x194);}return _0x274a04;};}function handleError(_0x102e66,_0x3bf0bd){_0x3bf0bd=_0x3bf0bd||0x1f4;return function(_0x53e2a6){logger[_0x7a9e('0x28')](_0x53e2a6[_0x7a9e('0x29')]);if(_0x53e2a6[_0x7a9e('0x2a')]){delete _0x53e2a6[_0x7a9e('0x2a')];}_0x102e66[_0x7a9e('0x1b')](_0x3bf0bd)[_0x7a9e('0x2b')](_0x53e2a6);};}exports[_0x7a9e('0x2c')]=function(_0x472094,_0x530d4d){var _0x281068={},_0x415d4c={},_0x258270={'count':0x0,'rows':[]};var _0x16a1ca=_['map'](db[_0x7a9e('0x2d')][_0x7a9e('0x2e')],function(_0x17ef91){return{'name':_0x17ef91[_0x7a9e('0x2f')],'type':_0x17ef91[_0x7a9e('0x30')][_0x7a9e('0x31')]};});_0x415d4c[_0x7a9e('0x32')]=_[_0x7a9e('0x33')](_0x16a1ca,_0x7a9e('0x2a'));_0x415d4c['query']=_['keys'](_0x472094['query']);_0x415d4c['filters']=_[_0x7a9e('0x34')](_0x415d4c[_0x7a9e('0x32')],_0x415d4c['query']);_0x281068[_0x7a9e('0x35')]=_[_0x7a9e('0x34')](_0x415d4c[_0x7a9e('0x32')],qs[_0x7a9e('0x36')](_0x472094[_0x7a9e('0x37')]['fields']));_0x281068['attributes']=_0x281068[_0x7a9e('0x35')][_0x7a9e('0x38')]?_0x281068[_0x7a9e('0x35')]:_0x415d4c['model'];if(!_0x472094[_0x7a9e('0x37')]['hasOwnProperty'](_0x7a9e('0x39'))){_0x281068['limit']=qs[_0x7a9e('0x1f')](_0x472094[_0x7a9e('0x37')][_0x7a9e('0x1f')]);_0x281068['offset']=qs[_0x7a9e('0x1d')](_0x472094['query'][_0x7a9e('0x1d')]);}_0x281068[_0x7a9e('0x3a')]=qs['sort'](_0x472094['query']['sort']);_0x281068[_0x7a9e('0x3b')]=qs[_0x7a9e('0x3c')](_[_0x7a9e('0x3d')](_0x472094[_0x7a9e('0x37')],_0x415d4c[_0x7a9e('0x3c')]),_0x16a1ca);if(_0x472094['query']['filter']){_0x281068[_0x7a9e('0x3b')]=_['merge'](_0x281068['where'],{'$or':_[_0x7a9e('0x33')](_0x16a1ca,function(_0x23df03){if(_0x23df03['type']!=='VIRTUAL'){var _0x17b49a={};_0x17b49a[_0x23df03[_0x7a9e('0x2a')]]={'$like':'%'+_0x472094['query'][_0x7a9e('0x3e')]+'%'};return _0x17b49a;}})});}_0x281068=_['merge']({},_0x281068,_0x472094['options']);var _0x564ab8={'where':_0x281068[_0x7a9e('0x3b')]};return db['AnalyticTreeReport']['count'](_0x564ab8)['then'](function(_0x179e0b){_0x258270[_0x7a9e('0x20')]=_0x179e0b;if(_0x472094[_0x7a9e('0x37')][_0x7a9e('0x3f')]){_0x281068[_0x7a9e('0x40')]=[{'all':!![]}];}return db[_0x7a9e('0x2d')][_0x7a9e('0x41')](_0x281068);})[_0x7a9e('0x26')](function(_0x488561){_0x258270[_0x7a9e('0x42')]=_0x488561;return _0x258270;})[_0x7a9e('0x26')](respondWithFilteredResult(_0x530d4d,_0x281068))[_0x7a9e('0x43')](handleError(_0x530d4d,null));};exports['show']=function(_0x12f378,_0x27cccd){var _0x529e35={'raw':!![],'where':{'id':_0x12f378[_0x7a9e('0x44')]['id']}},_0x34b3e8={};_0x34b3e8[_0x7a9e('0x32')]=_[_0x7a9e('0x45')](db['AnalyticTreeReport'][_0x7a9e('0x2e')]);_0x34b3e8[_0x7a9e('0x37')]=_[_0x7a9e('0x45')](_0x12f378[_0x7a9e('0x37')]);_0x34b3e8[_0x7a9e('0x3c')]=_[_0x7a9e('0x34')](_0x34b3e8[_0x7a9e('0x32')],_0x34b3e8[_0x7a9e('0x37')]);_0x529e35[_0x7a9e('0x35')]=_[_0x7a9e('0x34')](_0x34b3e8[_0x7a9e('0x32')],qs[_0x7a9e('0x36')](_0x12f378[_0x7a9e('0x37')]['fields']));_0x529e35[_0x7a9e('0x35')]=_0x529e35[_0x7a9e('0x35')][_0x7a9e('0x38')]?_0x529e35[_0x7a9e('0x35')]:_0x34b3e8['model'];if(_0x12f378[_0x7a9e('0x37')][_0x7a9e('0x3f')]){_0x529e35[_0x7a9e('0x40')]=[{'all':!![]}];}_0x529e35=_['merge']({},_0x529e35,_0x12f378['options']);return db['AnalyticTreeReport'][_0x7a9e('0x46')](_0x529e35)[_0x7a9e('0x26')](handleEntityNotFound(_0x27cccd,null))[_0x7a9e('0x26')](respondWithResult(_0x27cccd,null))[_0x7a9e('0x43')](handleError(_0x27cccd,null));};exports[_0x7a9e('0x47')]=function(_0x235e3,_0x2b5c32){return db['AnalyticTreeReport'][_0x7a9e('0x47')](_0x235e3[_0x7a9e('0x48')],{})[_0x7a9e('0x26')](respondWithResult(_0x2b5c32,0xc9))['catch'](handleError(_0x2b5c32,null));};exports[_0x7a9e('0x49')]=function(_0x2966a2,_0x3498e1){if(_0x2966a2[_0x7a9e('0x48')]['id']){delete _0x2966a2['body']['id'];}return db[_0x7a9e('0x2d')][_0x7a9e('0x46')]({'where':{'id':_0x2966a2[_0x7a9e('0x44')]['id']}})[_0x7a9e('0x26')](handleEntityNotFound(_0x3498e1,null))['then'](saveUpdates(_0x2966a2['body'],null))['then'](respondWithResult(_0x3498e1,null))['catch'](handleError(_0x3498e1,null));};exports[_0x7a9e('0x27')]=function(_0x1d6c20,_0x2ea9e0){return db[_0x7a9e('0x2d')]['find']({'where':{'id':_0x1d6c20[_0x7a9e('0x44')]['id']}})[_0x7a9e('0x26')](handleEntityNotFound(_0x2ea9e0,null))[_0x7a9e('0x26')](removeEntity(_0x2ea9e0,null))[_0x7a9e('0x43')](handleError(_0x2ea9e0,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 42ff4db..ed99622 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 _0x406a=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','util','api','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x406a,0x1c5));var _0xa406=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x406a[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0xa406('0x0'));var logger=require('../../config/logger')(_0xa406('0x1'));var moment=require(_0xa406('0x2'));var BPromise=require(_0xa406('0x3'));var rp=require(_0xa406('0x4'));var fs=require('fs');var path=require(_0xa406('0x5'));var rimraf=require(_0xa406('0x6'));var config=require(_0xa406('0x7'));var attributes=require(_0xa406('0x8'));module['exports']=function(_0x402f0e,_0x5428e3){return _0x402f0e[_0xa406('0x9')](_0xa406('0xa'),attributes,{'tableName':_0xa406('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb78=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x21cb9b,_0x5a2407){var _0x13a6fd=function(_0x1ff1da){while(--_0x1ff1da){_0x21cb9b['push'](_0x21cb9b['shift']());}};_0x13a6fd(++_0x5a2407);}(_0xfb78,0x8d));var _0x8fb7=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0xfb78[_0x44044a];return _0x43bb6e;};'use strict';var _=require(_0x8fb7('0x0'));var util=require(_0x8fb7('0x1'));var logger=require(_0x8fb7('0x2'))(_0x8fb7('0x3'));var moment=require(_0x8fb7('0x4'));var BPromise=require(_0x8fb7('0x5'));var rp=require(_0x8fb7('0x6'));var fs=require('fs');var path=require(_0x8fb7('0x7'));var rimraf=require(_0x8fb7('0x8'));var config=require(_0x8fb7('0x9'));var attributes=require(_0x8fb7('0xa'));module[_0x8fb7('0xb')]=function(_0x38ce80,_0x5b8834){return _0x38ce80[_0x8fb7('0xc')](_0x8fb7('0xd'),attributes,{'tableName':_0x8fb7('0xe'),'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 fe16e9c..ddb4757 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(_0x39838c,_0x4f8e32){var _0x47c136=function(_0x3c8ba0){while(--_0x3c8ba0){_0x39838c['push'](_0x39838c['shift']());}};_0x47c136(++_0x4f8e32);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x493049,_0x15e22d){var _0x10c1c7=function(_0x15d34e){while(--_0x15d34e){_0x493049['push'](_0x493049['shift']());}};_0x10c1c7(++_0x15e22d);}(_0x1261,0x144));var _0x1126=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x1261[_0x57dc85];return _0x563a2e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 9a6a352..71711e8 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 _0x2c6e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','post','create','put','/:id','update','delete','destroy'];(function(_0xbaeba7,_0x578dfa){var _0x4b42e7=function(_0x23bd26){while(--_0x23bd26){_0xbaeba7['push'](_0xbaeba7['shift']());}};_0x4b42e7(++_0x578dfa);}(_0x2c6e,0xb5));var _0xe2c6=function(_0xe62b5a,_0x938648){_0xe62b5a=_0xe62b5a-0x0;var _0x240454=_0x2c6e[_0xe62b5a];return _0x240454;};'use strict';var multer=require('multer');var util=require(_0xe2c6('0x0'));var path=require(_0xe2c6('0x1'));var timeout=require(_0xe2c6('0x2'));var express=require(_0xe2c6('0x3'));var router=express[_0xe2c6('0x4')]();var fs_extra=require(_0xe2c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2c6('0x6'));var config=require(_0xe2c6('0x7'));var controller=require(_0xe2c6('0x8'));router[_0xe2c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2c6('0xa')]);router[_0xe2c6('0x9')]('/:id',auth[_0xe2c6('0xb')](),controller['show']);router[_0xe2c6('0xc')]('/',auth[_0xe2c6('0xb')](),controller[_0xe2c6('0xd')]);router[_0xe2c6('0xe')](_0xe2c6('0xf'),auth[_0xe2c6('0xb')](),controller[_0xe2c6('0x10')]);router[_0xe2c6('0x11')](_0xe2c6('0xf'),auth[_0xe2c6('0xb')](),controller[_0xe2c6('0x12')]);module[_0xe2c6('0x13')]=router; \ No newline at end of file +var _0xe040=['post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe040,0x1af));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0e04('0x0'));var timeout=require('connect-timeout');var express=require(_0x0e04('0x1'));var router=express[_0x0e04('0x2')]();var fs_extra=require(_0x0e04('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0e04('0x4'));var config=require(_0x0e04('0x5'));var controller=require(_0x0e04('0x6'));router[_0x0e04('0x7')]('/',auth[_0x0e04('0x8')](),controller['index']);router[_0x0e04('0x7')](_0x0e04('0x9'),auth[_0x0e04('0x8')](),controller[_0x0e04('0xa')]);router[_0x0e04('0xb')]('/',auth[_0x0e04('0x8')](),controller[_0x0e04('0xc')]);router[_0x0e04('0xd')](_0x0e04('0x9'),auth['isAuthenticated'](),controller[_0x0e04('0xe')]);router[_0x0e04('0xf')](_0x0e04('0x9'),auth[_0x0e04('0x8')](),controller[_0x0e04('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 b5f50aa..fb61029 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 _0x5178=['STRING','exports'];(function(_0x22ff21,_0x17b1e8){var _0x181742=function(_0x305f23){while(--_0x305f23){_0x22ff21['push'](_0x22ff21['shift']());}};_0x181742(++_0x17b1e8);}(_0x5178,0x171));var _0x8517=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5178[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x8517('0x0')]={'name':{'type':Sequelize[_0x8517('0x1')]},'basename':{'type':Sequelize[_0x8517('0x1')]},'type':{'type':Sequelize[_0x8517('0x1')]}}; \ No newline at end of file +var _0xeb79=['STRING'];(function(_0x14b004,_0x297060){var _0x3d501f=function(_0x4a38ac){while(--_0x4a38ac){_0x14b004['push'](_0x14b004['shift']());}};_0x3d501f(++_0x297060);}(_0xeb79,0x87));var _0x9eb7=function(_0x11d10f,_0x275d65){_0x11d10f=_0x11d10f-0x0;var _0x4f3a86=_0xeb79[_0x11d10f];return _0x4f3a86;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9eb7('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9eb7('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 3a0ceb7..291e96d 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 _0x0614=['intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','get','omit','createdAt','updatedAt','body','create','update','find','file','originalname','basename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x18983b,_0x41d586){var _0x3ed24c=function(_0x318485){while(--_0x318485){_0x18983b['push'](_0x18983b['shift']());}};_0x3ed24c(++_0x41d586);}(_0x0614,0x78));var _0x4061=function(_0x485f73,_0x5de6e0){_0x485f73=_0x485f73-0x0;var _0x18f73b=_0x0614[_0x485f73];return _0x18f73b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4061('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4061('0x1'));var rp=require('request-promise');var moment=require(_0x4061('0x2'));var BPromise=require(_0x4061('0x3'));var Mustache=require('mustache');var util=require(_0x4061('0x4'));var path=require('path');var sox=require(_0x4061('0x5'));var csv=require(_0x4061('0x6'));var ejs=require(_0x4061('0x7'));var fs=require('fs');var fs_extra=require(_0x4061('0x8'));var _=require(_0x4061('0x9'));var squel=require(_0x4061('0xa'));var crypto=require(_0x4061('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4061('0xc'));var toCsv=require(_0x4061('0x6'));var querystring=require(_0x4061('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4061('0xe'));var as=require(_0x4061('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4061('0x10'))('api');var utils=require(_0x4061('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4061('0x12'))['db'];function respondWithStatusCode(_0x2aa057,_0x995687){_0x995687=_0x995687||0xcc;return function(_0xb91a0f){if(_0xb91a0f){return _0x2aa057[_0x4061('0x13')](_0x995687);}return _0x2aa057[_0x4061('0x14')](_0x995687)[_0x4061('0x15')]();};}function respondWithResult(_0x31daca,_0x1887c9){_0x1887c9=_0x1887c9||0xc8;return function(_0xc09e06){if(_0xc09e06){return _0x31daca[_0x4061('0x14')](_0x1887c9)[_0x4061('0x16')](_0xc09e06);}};}function respondWithFilteredResult(_0x7f651b,_0x367a23){return function(_0x1ff668){if(_0x1ff668){var _0x2d24cf=typeof _0x367a23[_0x4061('0x17')]===_0x4061('0x18')&&typeof _0x367a23['limit']===_0x4061('0x18');var _0x2a96c7=_0x1ff668[_0x4061('0x19')];var _0x537e40=_0x2d24cf?0x0:_0x367a23[_0x4061('0x17')];var _0x352546=_0x2d24cf?_0x1ff668[_0x4061('0x19')]:_0x367a23[_0x4061('0x17')]+_0x367a23[_0x4061('0x1a')];var _0x5e4362;if(_0x352546>=_0x2a96c7){_0x352546=_0x2a96c7;_0x5e4362=0xc8;}else{_0x5e4362=0xce;}_0x7f651b[_0x4061('0x14')](_0x5e4362);return _0x7f651b[_0x4061('0x1b')](_0x4061('0x1c'),_0x537e40+'-'+_0x352546+'/'+_0x2a96c7)[_0x4061('0x16')](_0x1ff668);}return null;};}function patchUpdates(_0x4caa30){return function(_0x4f5afc){try{jsonpatch[_0x4061('0x1d')](_0x4f5afc,_0x4caa30,!![]);}catch(_0x2db974){return BPromise[_0x4061('0x1e')](_0x2db974);}return _0x4f5afc[_0x4061('0x1f')]();};}function saveUpdates(_0x4e1979,_0x25344c){return function(_0x3fbc7f){if(_0x3fbc7f){return _0x3fbc7f['update'](_0x4e1979)[_0x4061('0x20')](function(_0x249aef){return _0x249aef;});}return null;};}function removeEntity(_0x49f170,_0x29f60f){return function(_0x5bc2b0){if(_0x5bc2b0){return _0x5bc2b0[_0x4061('0x21')]()[_0x4061('0x20')](function(){_0x49f170[_0x4061('0x14')](0xcc)[_0x4061('0x15')]();});}};}function handleEntityNotFound(_0x1e72a3,_0x252ef2){return function(_0x292b48){if(!_0x292b48){_0x1e72a3[_0x4061('0x13')](0x194);}return _0x292b48;};}function handleError(_0x42c678,_0xb54332){_0xb54332=_0xb54332||0x1f4;return function(_0x402d6c){logger[_0x4061('0x22')](_0x402d6c[_0x4061('0x23')]);if(_0x402d6c[_0x4061('0x24')]){delete _0x402d6c[_0x4061('0x24')];}_0x42c678[_0x4061('0x14')](_0xb54332)['send'](_0x402d6c);};}exports[_0x4061('0x25')]=function(_0x4e27cd,_0x4f07d8){var _0x16806c={},_0x4d1271={},_0x10970d={'count':0x0,'rows':[]};var _0x5b35be=_['map'](db[_0x4061('0x26')][_0x4061('0x27')],function(_0x5ad5e3){return{'name':_0x5ad5e3[_0x4061('0x28')],'type':_0x5ad5e3[_0x4061('0x29')][_0x4061('0x2a')]};});_0x4d1271[_0x4061('0x2b')]=_[_0x4061('0x2c')](_0x5b35be,'name');_0x4d1271['query']=_['keys'](_0x4e27cd[_0x4061('0x2d')]);_0x4d1271['filters']=_[_0x4061('0x2e')](_0x4d1271['model'],_0x4d1271[_0x4061('0x2d')]);_0x16806c[_0x4061('0x2f')]=_[_0x4061('0x2e')](_0x4d1271[_0x4061('0x2b')],qs[_0x4061('0x30')](_0x4e27cd[_0x4061('0x2d')]['fields']));_0x16806c['attributes']=_0x16806c[_0x4061('0x2f')][_0x4061('0x31')]?_0x16806c['attributes']:_0x4d1271['model'];if(!_0x4e27cd[_0x4061('0x2d')]['hasOwnProperty'](_0x4061('0x32'))){_0x16806c[_0x4061('0x1a')]=qs[_0x4061('0x1a')](_0x4e27cd['query'][_0x4061('0x1a')]);_0x16806c[_0x4061('0x17')]=qs['offset'](_0x4e27cd['query'][_0x4061('0x17')]);}_0x16806c['order']=qs[_0x4061('0x33')](_0x4e27cd['query'][_0x4061('0x33')]);_0x16806c[_0x4061('0x34')]=qs[_0x4061('0x35')](_[_0x4061('0x36')](_0x4e27cd[_0x4061('0x2d')],_0x4d1271[_0x4061('0x35')]),_0x5b35be);if(_0x4e27cd[_0x4061('0x2d')][_0x4061('0x37')]){_0x16806c['where']=_[_0x4061('0x38')](_0x16806c[_0x4061('0x34')],{'$or':_[_0x4061('0x2c')](_0x5b35be,function(_0x5d97da){if(_0x5d97da[_0x4061('0x29')]!==_0x4061('0x39')){var _0x47d863={};_0x47d863[_0x5d97da[_0x4061('0x24')]]={'$like':'%'+_0x4e27cd[_0x4061('0x2d')][_0x4061('0x37')]+'%'};return _0x47d863;}})});}_0x16806c=_[_0x4061('0x38')]({},_0x16806c,_0x4e27cd[_0x4061('0x3a')]);var _0x58d242={'where':_0x16806c[_0x4061('0x34')]};return db['Attachment']['count'](_0x58d242)[_0x4061('0x20')](function(_0x1264b2){_0x10970d[_0x4061('0x19')]=_0x1264b2;if(_0x4e27cd[_0x4061('0x2d')][_0x4061('0x3b')]){_0x16806c[_0x4061('0x3c')]=[{'all':!![]}];}return db[_0x4061('0x26')]['findAll'](_0x16806c);})[_0x4061('0x20')](function(_0x3c0763){_0x10970d[_0x4061('0x3d')]=_0x3c0763;return _0x10970d;})['then'](respondWithFilteredResult(_0x4f07d8,_0x16806c))[_0x4061('0x3e')](handleError(_0x4f07d8,null));};exports[_0x4061('0x3f')]=function(_0x41db9c,_0x38a807){var _0x342189={'raw':!![],'where':{'id':_0x41db9c[_0x4061('0x40')]['id']}},_0x4c85c1={};_0x4c85c1[_0x4061('0x2b')]=_['keys'](db[_0x4061('0x26')][_0x4061('0x27')]);_0x4c85c1[_0x4061('0x2d')]=_['keys'](_0x41db9c['query']);_0x4c85c1[_0x4061('0x35')]=_[_0x4061('0x2e')](_0x4c85c1[_0x4061('0x2b')],_0x4c85c1['query']);_0x342189[_0x4061('0x2f')]=_[_0x4061('0x2e')](_0x4c85c1[_0x4061('0x2b')],qs[_0x4061('0x30')](_0x41db9c[_0x4061('0x2d')]['fields']));_0x342189[_0x4061('0x2f')]=_0x342189[_0x4061('0x2f')][_0x4061('0x31')]?_0x342189['attributes']:_0x4c85c1[_0x4061('0x2b')];if(_0x41db9c[_0x4061('0x2d')]['includeAll']){_0x342189[_0x4061('0x3c')]=[{'all':!![]}];}_0x342189=_[_0x4061('0x38')]({},_0x342189,_0x41db9c[_0x4061('0x3a')]);return db[_0x4061('0x26')]['find'](_0x342189)[_0x4061('0x20')](handleEntityNotFound(_0x38a807,null))['then'](respondWithResult(_0x38a807,null))['catch'](handleError(_0x38a807,null));};exports['clone']=function(_0x13b78a,_0x1b37bc){var _0x42c2cf={'where':{'id':_0x13b78a[_0x4061('0x40')]['id']}},_0x44076a={};_0x44076a[_0x4061('0x2b')]=_[_0x4061('0x41')](db['Attachment'][_0x4061('0x27')]);_0x42c2cf[_0x4061('0x2f')]=_[_0x4061('0x2e')](_0x44076a[_0x4061('0x2b')],qs['fields'](_0x13b78a[_0x4061('0x2d')]['fields']));_0x42c2cf[_0x4061('0x2f')]=_0x42c2cf[_0x4061('0x2f')][_0x4061('0x31')]?_0x42c2cf[_0x4061('0x2f')]:_0x44076a[_0x4061('0x2b')];if(_0x13b78a[_0x4061('0x2d')][_0x4061('0x3b')]){_0x42c2cf['include']=[{'all':!![]}];}_0x42c2cf=_[_0x4061('0x38')]({},_0x42c2cf,_0x13b78a['options']);return db[_0x4061('0x26')]['find'](_0x42c2cf)[_0x4061('0x20')](handleEntityNotFound(_0x1b37bc,null))[_0x4061('0x20')](function(_0x3941ab){if(_0x3941ab){var _0x1a322f=_0x3941ab[_0x4061('0x42')]({'plain':!![]});_0x1a322f=qs[_0x4061('0x43')](_0x1a322f,['id',_0x4061('0x44'),_0x4061('0x45')]);_0x13b78a[_0x4061('0x46')]=_['omit'](_0x13b78a['body'],['id',_0x4061('0x44'),_0x4061('0x45')]);return db[_0x4061('0x26')][_0x4061('0x47')](_[_0x4061('0x38')](_0x1a322f,_0x13b78a[_0x4061('0x46')]),{'include':_0x13b78a[_0x4061('0x2d')][_0x4061('0x3b')]?[{'all':!![]}]:undefined});}})[_0x4061('0x20')](respondWithResult(_0x1b37bc,0xc9))[_0x4061('0x3e')](handleError(_0x1b37bc,null));};exports[_0x4061('0x48')]=function(_0x10c140,_0x469a8b){if(_0x10c140[_0x4061('0x46')]['id']){delete _0x10c140[_0x4061('0x46')]['id'];}return db[_0x4061('0x26')][_0x4061('0x49')]({'where':{'id':_0x10c140[_0x4061('0x40')]['id']}})['then'](handleEntityNotFound(_0x469a8b,null))[_0x4061('0x20')](saveUpdates(_0x10c140['body'],null))[_0x4061('0x20')](respondWithResult(_0x469a8b,null))[_0x4061('0x3e')](handleError(_0x469a8b,null));};exports[_0x4061('0x21')]=function(_0x4fad0a,_0x124b6a){return db[_0x4061('0x26')][_0x4061('0x49')]({'where':{'id':_0x4fad0a[_0x4061('0x40')]['id']}})[_0x4061('0x20')](handleEntityNotFound(_0x124b6a,null))[_0x4061('0x20')](removeEntity(_0x124b6a,null))[_0x4061('0x3e')](handleError(_0x124b6a,null));};exports[_0x4061('0x47')]=function(_0x332986,_0x3125fb,_0x5ec3ae){_0x332986[_0x4061('0x46')]['name']=_0x332986[_0x4061('0x4a')][_0x4061('0x4b')];_0x332986[_0x4061('0x46')][_0x4061('0x4c')]=_0x332986[_0x4061('0x4a')]['filename'];_0x332986['body']['type']=_0x332986[_0x4061('0x4a')]['mimetype'];return db[_0x4061('0x26')][_0x4061('0x47')](_0x332986[_0x4061('0x46')])['then'](respondWithResult(_0x3125fb,0xc9))[_0x4061('0x3e')](handleError(_0x3125fb,null));};exports[_0x4061('0x4d')]=function(_0x5710fd,_0x4455c2,_0x140e22){return db[_0x4061('0x26')]['findOne']({'where':{'id':_0x5710fd[_0x4061('0x40')]['id']},'raw':!![]})[_0x4061('0x20')](handleEntityNotFound(_0x4455c2,null))['then'](function(_0x2c27a9){if(_0x2c27a9){var _0x789e56=_0x2c27a9[_0x4061('0x4e')]!==null;var _0x58c4b9=path[_0x4061('0x4f')](config[_0x4061('0x50')],_0x4061('0x51'));if(_0x789e56){_0x58c4b9=path['join'](_0x58c4b9,_0x4061('0x52'));}var _0x4cc613=path[_0x4061('0x4f')](_0x58c4b9,_0x2c27a9[_0x4061('0x4c')]);return _0x4455c2[_0x4061('0x4d')](_0x4cc613);}})[_0x4061('0x3e')](handleError(_0x4455c2,null));}; \ No newline at end of file +var _0x2f31=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','options','get','updatedAt','omit','body','createdAt','update','find','params','create','file','originalname','basename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x2f31,0x100));var _0x12f3=function(_0x58404e,_0x179d39){_0x58404e=_0x58404e-0x0;var _0x436571=_0x2f31[_0x58404e];return _0x436571;};'use strict';var emlformat=require(_0x12f3('0x0'));var rimraf=require(_0x12f3('0x1'));var zipdir=require(_0x12f3('0x2'));var jsonpatch=require(_0x12f3('0x3'));var rp=require(_0x12f3('0x4'));var moment=require(_0x12f3('0x5'));var BPromise=require(_0x12f3('0x6'));var Mustache=require(_0x12f3('0x7'));var util=require('util');var path=require(_0x12f3('0x8'));var sox=require(_0x12f3('0x9'));var csv=require(_0x12f3('0xa'));var ejs=require(_0x12f3('0xb'));var fs=require('fs');var fs_extra=require(_0x12f3('0xc'));var _=require(_0x12f3('0xd'));var squel=require('squel');var crypto=require(_0x12f3('0xe'));var jsforce=require(_0x12f3('0xf'));var deskjs=require(_0x12f3('0x10'));var toCsv=require(_0x12f3('0xa'));var querystring=require(_0x12f3('0x11'));var Papa=require(_0x12f3('0x12'));var Redis=require(_0x12f3('0x13'));var authService=require(_0x12f3('0x14'));var qs=require(_0x12f3('0x15'));var as=require(_0x12f3('0x16'));var hardwareService=require(_0x12f3('0x17'));var logger=require(_0x12f3('0x18'))(_0x12f3('0x19'));var utils=require(_0x12f3('0x1a'));var config=require(_0x12f3('0x1b'));var licenseUtil=require(_0x12f3('0x1c'));var db=require(_0x12f3('0x1d'))['db'];function respondWithStatusCode(_0x486961,_0x193461){_0x193461=_0x193461||0xcc;return function(_0x1e5f63){if(_0x1e5f63){return _0x486961[_0x12f3('0x1e')](_0x193461);}return _0x486961[_0x12f3('0x1f')](_0x193461)['end']();};}function respondWithResult(_0x2685d6,_0x2d5722){_0x2d5722=_0x2d5722||0xc8;return function(_0x582b8e){if(_0x582b8e){return _0x2685d6[_0x12f3('0x1f')](_0x2d5722)['json'](_0x582b8e);}};}function respondWithFilteredResult(_0x1e6788,_0x2fd376){return function(_0x431806){if(_0x431806){var _0x5aba51=typeof _0x2fd376[_0x12f3('0x20')]==='undefined'&&typeof _0x2fd376['limit']===_0x12f3('0x21');var _0x2a6aef=_0x431806[_0x12f3('0x22')];var _0x1a7ab0=_0x5aba51?0x0:_0x2fd376[_0x12f3('0x20')];var _0x253ab8=_0x5aba51?_0x431806[_0x12f3('0x22')]:_0x2fd376[_0x12f3('0x20')]+_0x2fd376[_0x12f3('0x23')];var _0x1dfd79;if(_0x253ab8>=_0x2a6aef){_0x253ab8=_0x2a6aef;_0x1dfd79=0xc8;}else{_0x1dfd79=0xce;}_0x1e6788[_0x12f3('0x1f')](_0x1dfd79);return _0x1e6788[_0x12f3('0x24')](_0x12f3('0x25'),_0x1a7ab0+'-'+_0x253ab8+'/'+_0x2a6aef)['json'](_0x431806);}return null;};}function patchUpdates(_0x56f3ae){return function(_0x4b7df3){try{jsonpatch[_0x12f3('0x26')](_0x4b7df3,_0x56f3ae,!![]);}catch(_0x20b50b){return BPromise[_0x12f3('0x27')](_0x20b50b);}return _0x4b7df3['save']();};}function saveUpdates(_0x14d297,_0x17fadc){return function(_0x3b378a){if(_0x3b378a){return _0x3b378a['update'](_0x14d297)['then'](function(_0x5ed878){return _0x5ed878;});}return null;};}function removeEntity(_0x5ca832,_0x28a13b){return function(_0x3ef402){if(_0x3ef402){return _0x3ef402['destroy']()[_0x12f3('0x28')](function(){_0x5ca832['status'](0xcc)[_0x12f3('0x29')]();});}};}function handleEntityNotFound(_0x465e9d,_0x1ade23){return function(_0x18807b){if(!_0x18807b){_0x465e9d['sendStatus'](0x194);}return _0x18807b;};}function handleError(_0x4c11fb,_0x21bc2e){_0x21bc2e=_0x21bc2e||0x1f4;return function(_0x1c73b8){logger[_0x12f3('0x2a')](_0x1c73b8[_0x12f3('0x2b')]);if(_0x1c73b8[_0x12f3('0x2c')]){delete _0x1c73b8[_0x12f3('0x2c')];}_0x4c11fb[_0x12f3('0x1f')](_0x21bc2e)[_0x12f3('0x2d')](_0x1c73b8);};}exports[_0x12f3('0x2e')]=function(_0x115e98,_0x3cbee1){var _0xcf00f5={},_0x231e33={},_0x352f77={'count':0x0,'rows':[]};var _0x156fb4=_['map'](db[_0x12f3('0x2f')][_0x12f3('0x30')],function(_0x3a8d68){return{'name':_0x3a8d68[_0x12f3('0x31')],'type':_0x3a8d68['type'][_0x12f3('0x32')]};});_0x231e33[_0x12f3('0x33')]=_[_0x12f3('0x34')](_0x156fb4,_0x12f3('0x2c'));_0x231e33['query']=_[_0x12f3('0x35')](_0x115e98['query']);_0x231e33[_0x12f3('0x36')]=_[_0x12f3('0x37')](_0x231e33['model'],_0x231e33[_0x12f3('0x38')]);_0xcf00f5['attributes']=_[_0x12f3('0x37')](_0x231e33[_0x12f3('0x33')],qs[_0x12f3('0x39')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x39')]));_0xcf00f5[_0x12f3('0x3a')]=_0xcf00f5['attributes'][_0x12f3('0x3b')]?_0xcf00f5[_0x12f3('0x3a')]:_0x231e33[_0x12f3('0x33')];if(!_0x115e98[_0x12f3('0x38')][_0x12f3('0x3c')]('nolimit')){_0xcf00f5[_0x12f3('0x23')]=qs[_0x12f3('0x23')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x23')]);_0xcf00f5['offset']=qs[_0x12f3('0x20')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x20')]);}_0xcf00f5[_0x12f3('0x3d')]=qs[_0x12f3('0x3e')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x3e')]);_0xcf00f5[_0x12f3('0x3f')]=qs['filters'](_['pick'](_0x115e98[_0x12f3('0x38')],_0x231e33[_0x12f3('0x36')]),_0x156fb4);if(_0x115e98[_0x12f3('0x38')]['filter']){_0xcf00f5[_0x12f3('0x3f')]=_[_0x12f3('0x40')](_0xcf00f5[_0x12f3('0x3f')],{'$or':_[_0x12f3('0x34')](_0x156fb4,function(_0x41cc9d){if(_0x41cc9d[_0x12f3('0x41')]!==_0x12f3('0x42')){var _0xefa749={};_0xefa749[_0x41cc9d['name']]={'$like':'%'+_0x115e98[_0x12f3('0x38')][_0x12f3('0x43')]+'%'};return _0xefa749;}})});}_0xcf00f5=_['merge']({},_0xcf00f5,_0x115e98['options']);var _0x28e32a={'where':_0xcf00f5[_0x12f3('0x3f')]};return db[_0x12f3('0x2f')][_0x12f3('0x22')](_0x28e32a)[_0x12f3('0x28')](function(_0x388fad){_0x352f77[_0x12f3('0x22')]=_0x388fad;if(_0x115e98[_0x12f3('0x38')][_0x12f3('0x44')]){_0xcf00f5[_0x12f3('0x45')]=[{'all':!![]}];}return db[_0x12f3('0x2f')]['findAll'](_0xcf00f5);})[_0x12f3('0x28')](function(_0x5d0867){_0x352f77[_0x12f3('0x46')]=_0x5d0867;return _0x352f77;})[_0x12f3('0x28')](respondWithFilteredResult(_0x3cbee1,_0xcf00f5))[_0x12f3('0x47')](handleError(_0x3cbee1,null));};exports[_0x12f3('0x48')]=function(_0xd5dea7,_0x400fcb){var _0x498ac2={'raw':!![],'where':{'id':_0xd5dea7['params']['id']}},_0x57cfcb={};_0x57cfcb['model']=_[_0x12f3('0x35')](db['Attachment'][_0x12f3('0x30')]);_0x57cfcb['query']=_[_0x12f3('0x35')](_0xd5dea7[_0x12f3('0x38')]);_0x57cfcb[_0x12f3('0x36')]=_[_0x12f3('0x37')](_0x57cfcb[_0x12f3('0x33')],_0x57cfcb[_0x12f3('0x38')]);_0x498ac2[_0x12f3('0x3a')]=_[_0x12f3('0x37')](_0x57cfcb['model'],qs['fields'](_0xd5dea7[_0x12f3('0x38')][_0x12f3('0x39')]));_0x498ac2['attributes']=_0x498ac2[_0x12f3('0x3a')]['length']?_0x498ac2[_0x12f3('0x3a')]:_0x57cfcb['model'];if(_0xd5dea7[_0x12f3('0x38')][_0x12f3('0x44')]){_0x498ac2[_0x12f3('0x45')]=[{'all':!![]}];}_0x498ac2=_[_0x12f3('0x40')]({},_0x498ac2,_0xd5dea7['options']);return db['Attachment']['find'](_0x498ac2)[_0x12f3('0x28')](handleEntityNotFound(_0x400fcb,null))[_0x12f3('0x28')](respondWithResult(_0x400fcb,null))[_0x12f3('0x47')](handleError(_0x400fcb,null));};exports['clone']=function(_0x278cc8,_0x590753){var _0x1ad71b={'where':{'id':_0x278cc8['params']['id']}},_0x16d31b={};_0x16d31b[_0x12f3('0x33')]=_[_0x12f3('0x35')](db['Attachment']['rawAttributes']);_0x1ad71b[_0x12f3('0x3a')]=_[_0x12f3('0x37')](_0x16d31b['model'],qs[_0x12f3('0x39')](_0x278cc8['query'][_0x12f3('0x39')]));_0x1ad71b[_0x12f3('0x3a')]=_0x1ad71b[_0x12f3('0x3a')][_0x12f3('0x3b')]?_0x1ad71b['attributes']:_0x16d31b[_0x12f3('0x33')];if(_0x278cc8[_0x12f3('0x38')][_0x12f3('0x44')]){_0x1ad71b[_0x12f3('0x45')]=[{'all':!![]}];}_0x1ad71b=_['merge']({},_0x1ad71b,_0x278cc8[_0x12f3('0x49')]);return db[_0x12f3('0x2f')]['find'](_0x1ad71b)[_0x12f3('0x28')](handleEntityNotFound(_0x590753,null))['then'](function(_0xc44fd1){if(_0xc44fd1){var _0x307f4c=_0xc44fd1[_0x12f3('0x4a')]({'plain':!![]});_0x307f4c=qs['omit'](_0x307f4c,['id','createdAt',_0x12f3('0x4b')]);_0x278cc8['body']=_[_0x12f3('0x4c')](_0x278cc8[_0x12f3('0x4d')],['id',_0x12f3('0x4e'),_0x12f3('0x4b')]);return db[_0x12f3('0x2f')]['create'](_[_0x12f3('0x40')](_0x307f4c,_0x278cc8[_0x12f3('0x4d')]),{'include':_0x278cc8[_0x12f3('0x38')][_0x12f3('0x44')]?[{'all':!![]}]:undefined});}})[_0x12f3('0x28')](respondWithResult(_0x590753,0xc9))[_0x12f3('0x47')](handleError(_0x590753,null));};exports[_0x12f3('0x4f')]=function(_0x21b1ab,_0x17c04b){if(_0x21b1ab['body']['id']){delete _0x21b1ab[_0x12f3('0x4d')]['id'];}return db[_0x12f3('0x2f')][_0x12f3('0x50')]({'where':{'id':_0x21b1ab[_0x12f3('0x51')]['id']}})['then'](handleEntityNotFound(_0x17c04b,null))[_0x12f3('0x28')](saveUpdates(_0x21b1ab['body'],null))['then'](respondWithResult(_0x17c04b,null))[_0x12f3('0x47')](handleError(_0x17c04b,null));};exports['destroy']=function(_0x2162b3,_0x521a75){return db['Attachment']['find']({'where':{'id':_0x2162b3[_0x12f3('0x51')]['id']}})[_0x12f3('0x28')](handleEntityNotFound(_0x521a75,null))[_0x12f3('0x28')](removeEntity(_0x521a75,null))[_0x12f3('0x47')](handleError(_0x521a75,null));};exports[_0x12f3('0x52')]=function(_0x5c24c3,_0x301e35,_0x520990){_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x2c')]=_0x5c24c3[_0x12f3('0x53')][_0x12f3('0x54')];_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x55')]=_0x5c24c3[_0x12f3('0x53')]['filename'];_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x41')]=_0x5c24c3['file']['mimetype'];return db[_0x12f3('0x2f')][_0x12f3('0x52')](_0x5c24c3[_0x12f3('0x4d')])[_0x12f3('0x28')](respondWithResult(_0x301e35,0xc9))[_0x12f3('0x47')](handleError(_0x301e35,null));};exports['download']=function(_0x58ca65,_0x5ecda0,_0x261fb8){return db[_0x12f3('0x2f')][_0x12f3('0x56')]({'where':{'id':_0x58ca65[_0x12f3('0x51')]['id']},'raw':!![]})[_0x12f3('0x28')](handleEntityNotFound(_0x5ecda0,null))['then'](function(_0xf1e178){if(_0xf1e178){var _0x20f6e4=_0xf1e178[_0x12f3('0x57')]!==null;var _0x5cdf26=path[_0x12f3('0x58')](config[_0x12f3('0x59')],_0x12f3('0x5a'));if(_0x20f6e4){_0x5cdf26=path['join'](_0x5cdf26,_0x12f3('0x5b'));}var _0x192603=path[_0x12f3('0x58')](_0x5cdf26,_0xf1e178['basename']);return _0x5ecda0[_0x12f3('0x5c')](_0x192603);}})[_0x12f3('0x47')](handleError(_0x5ecda0,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b16969f..2079804 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 _0x1c17=['exports','define','Attachment','attachments','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x1c17,0x13f));var _0x71c1=function(_0x283cfb,_0x49429c){_0x283cfb=_0x283cfb-0x0;var _0x85ea4b=_0x1c17[_0x283cfb];return _0x85ea4b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x71c1('0x0'));var BPromise=require(_0x71c1('0x1'));var rp=require(_0x71c1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x71c1('0x3'));var attributes=require(_0x71c1('0x4'));module[_0x71c1('0x5')]=function(_0x360bdf,_0x5d286f){return _0x360bdf[_0x71c1('0x6')](_0x71c1('0x7'),attributes,{'tableName':_0x71c1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9be=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x1c12b9,_0x2e14ed){var _0x2784ec=function(_0x4efebc){while(--_0x4efebc){_0x1c12b9['push'](_0x1c12b9['shift']());}};_0x2784ec(++_0x2e14ed);}(_0xc9be,0xf8));var _0xec9b=function(_0x3a1f2b,_0x1c6ea2){_0x3a1f2b=_0x3a1f2b-0x0;var _0x2c569b=_0xc9be[_0x3a1f2b];return _0x2c569b;};'use strict';var _=require('lodash');var util=require(_0xec9b('0x0'));var logger=require(_0xec9b('0x1'))(_0xec9b('0x2'));var moment=require(_0xec9b('0x3'));var BPromise=require(_0xec9b('0x4'));var rp=require(_0xec9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec9b('0x6'));var config=require(_0xec9b('0x7'));var attributes=require(_0xec9b('0x8'));module[_0xec9b('0x9')]=function(_0x9d0472,_0x348c81){return _0x9d0472[_0xec9b('0xa')]('Attachment',attributes,{'tableName':_0xec9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 3b13eeb..5d0b6e0 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 _0xa4db=['catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','raw','CreateAttachment'];(function(_0x1ffc2a,_0x5d14fc){var _0x14f6cb=function(_0x436cc1){while(--_0x436cc1){_0x1ffc2a['push'](_0x1ffc2a['shift']());}};_0x14f6cb(++_0x5d14fc);}(_0xa4db,0x139));var _0xba4d=function(_0x485161,_0x3476){_0x485161=_0x485161-0x0;var _0x1ac81c=_0xa4db[_0x485161];return _0x1ac81c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xba4d('0x0'));var rs=require(_0xba4d('0x1'));var fs=require('fs');var Redis=require(_0xba4d('0x2'));var db=require(_0xba4d('0x3'))['db'];var utils=require(_0xba4d('0x4'));var logger=require(_0xba4d('0x5'))('rpc');var config=require(_0xba4d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xba4d('0x7')][_0xba4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x325531,_0x14b2fd,_0x2c8823){return new BPromise(function(_0xdfc6bf,_0x2171f4){return client[_0xba4d('0x9')](_0x325531,_0x2c8823)[_0xba4d('0xa')](function(_0x4823a9){logger[_0xba4d('0xb')](_0xba4d('0xc'),_0x14b2fd,_0xba4d('0xd'));logger[_0xba4d('0xe')](_0xba4d('0xf'),_0x14b2fd,_0xba4d('0xd'),JSON[_0xba4d('0x10')](_0x4823a9));if(_0x4823a9[_0xba4d('0x11')]){if(_0x4823a9[_0xba4d('0x11')][_0xba4d('0x12')]===0x1f4){logger[_0xba4d('0x11')](_0xba4d('0xc'),_0x14b2fd,_0x4823a9['error']['message']);return _0x2171f4(_0x4823a9['error'][_0xba4d('0x13')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x14b2fd,_0x4823a9[_0xba4d('0x11')][_0xba4d('0x13')]);return _0xdfc6bf(_0x4823a9[_0xba4d('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x14b2fd,_0xba4d('0xd'));_0xdfc6bf(_0x4823a9[_0xba4d('0x14')][_0xba4d('0x13')]);}})['catch'](function(_0x4ef915){logger['error']('Attachment,\x20%s,\x20%s',_0x14b2fd,_0x4ef915);_0x2171f4(_0x4ef915);});});}exports['CreateAttachment']=function(_0x5e533a){var _0x3a639f=this;return new Promise(function(_0x4c9f27,_0x318a77){return db['Attachment']['create'](_0x5e533a['body'],{'raw':_0x5e533a['options']?_0x5e533a['options'][_0xba4d('0x15')]===undefined?!![]:![]:!![]})[_0xba4d('0xa')](function(_0x4ea891){logger['info'](_0xba4d('0x16'),_0x5e533a);logger['debug'](_0xba4d('0x16'),_0x5e533a,JSON[_0xba4d('0x10')](_0x4ea891));_0x4c9f27(_0x4ea891);})[_0xba4d('0x17')](function(_0x46f7ff){logger[_0xba4d('0x11')](_0xba4d('0x16'),_0x46f7ff[_0xba4d('0x13')],_0x5e533a);_0x318a77(_0x3a639f[_0xba4d('0x11')](0x1f4,_0x46f7ff[_0xba4d('0x13')]));});});}; \ No newline at end of file +var _0x66fa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','catch','Attachment','body','options','raw','CreateAttachment','lodash','util','moment','ioredis'];(function(_0x46ed8e,_0x16dfc8){var _0xc3bb00=function(_0x1633e6){while(--_0x1633e6){_0x46ed8e['push'](_0x46ed8e['shift']());}};_0xc3bb00(++_0x16dfc8);}(_0x66fa,0x168));var _0xa66f=function(_0x245300,_0x17d477){_0x245300=_0x245300-0x0;var _0x206824=_0x66fa[_0x245300];return _0x206824;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});}exports['CreateAttachment']=function(_0x4d5e31){var _0x162a28=this;return new Promise(function(_0x16648b,_0x1b4ab0){return db[_0xa66f('0x17')]['create'](_0x4d5e31[_0xa66f('0x18')],{'raw':_0x4d5e31[_0xa66f('0x19')]?_0x4d5e31['options'][_0xa66f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f4977){logger[_0xa66f('0xe')]('CreateAttachment',_0x4d5e31);logger['debug'](_0xa66f('0x1b'),_0x4d5e31,JSON['stringify'](_0x3f4977));_0x16648b(_0x3f4977);})['catch'](function(_0x59f7aa){logger['error'](_0xa66f('0x1b'),_0x59f7aa[_0xa66f('0x14')],_0x4d5e31);_0x1b4ab0(_0x162a28[_0xa66f('0x13')](0x1f4,_0x59f7aa['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 09f0a03..a0a428c 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 _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(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x230639,_0x20f428){_0x230639=_0x230639-0x0;var _0x5248d7=_0x0b0e[_0x230639];return _0x5248d7;};'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 +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x38562a,_0x53ba1f){var _0x63d8aa=function(_0x33aabe){while(--_0x33aabe){_0x38562a['push'](_0x38562a['shift']());}};_0x63d8aa(++_0x53ba1f);}(_0xadb5,0xad));var _0x5adb=function(_0x1dd4ea,_0x508eb9){_0x1dd4ea=_0x1dd4ea-0x0;var _0x34eabd=_0xadb5[_0x1dd4ea];return _0x34eabd;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 250afd7..70c5887 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 _0xc8ae=['login','ad-login','role','json','User','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blocked','blockedAt','admin','user','agent','name','add','minutes','getLicense','status','message'];(function(_0x3edece,_0x44e63e){var _0x4caa17=function(_0x330b35){while(--_0x330b35){_0x3edece['push'](_0x3edece['shift']());}};_0x4caa17(++_0x44e63e);}(_0xc8ae,0x1d1));var _0xec8a=function(_0x1f487b,_0x285a74){_0x1f487b=_0x1f487b-0x0;var _0x420c12=_0xc8ae[_0x1f487b];return _0x420c12;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xec8a('0x0'))[_0xec8a('0x1')];var moment=require(_0xec8a('0x2'));var ActiveDirectory=require(_0xec8a('0x3'));var BPromise=require(_0xec8a('0x4'));var util=require(_0xec8a('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xec8a('0x6'));var config=require(_0xec8a('0x7'));var logger=require(_0xec8a('0x8'))(_0xec8a('0x9'));function isActiveDirectoryConfigured(_0x1af8c3){var _0x5d610b=![];if(typeof _0x1af8c3['activedirectory']!=='undefined'){_0x5d610b=_0x1af8c3[_0xec8a('0xa')][_0xec8a('0xb')]&&_0x1af8c3[_0xec8a('0xa')][_0xec8a('0xc')]&&_0x1af8c3[_0xec8a('0xa')][_0xec8a('0xd')];}return _0x5d610b;}function adAuthenticate(_0x265b14,_0x1937f5,_0x1f55ba){return new BPromise(function(_0x54fb6b,_0x5f301d){try{var _0x46704c=new ActiveDirectory(_0x265b14);_0x46704c[_0xec8a('0xe')](_0x1937f5,_0x1f55ba,function(_0x41f4b1,_0x2fbd89){if(_0x41f4b1){logger['error'](_0xec8a('0xf'),_0x1937f5,util[_0xec8a('0x10')](_0x41f4b1,{'showHidden':![],'depth':null}));_0x5f301d(_0xec8a('0x11'));}else if(!_0x2fbd89){logger[_0xec8a('0x12')](_0xec8a('0x13'),_0x1937f5);_0x5f301d(_0xec8a('0x11'));}else{_0x54fb6b(_0x2fbd89);}});}catch(_0x3fa0ee){_0x5f301d(_0x3fa0ee);}});}function ActiveDirectoryAuthenticate(_0x1a7792,_0x1c44d4,_0x505646,_0x2d3519){var _0xe57a8d,_0x2bddfc;if(!isActiveDirectoryConfigured(config)){logger[_0xec8a('0x12')](_0xec8a('0x14'),_0x1c44d4);return _0x2d3519(null,![],{'message':_0xec8a('0x11')});}return db[_0xec8a('0x15')][_0xec8a('0x16')]({'where':{'id':0x1},'attributes':[_0xec8a('0x17'),_0xec8a('0x18')],'raw':!![]})[_0xec8a('0x19')](function(_0x5bdfbc){_0xe57a8d=_0x5bdfbc;if(!_0xe57a8d[_0xec8a('0x17')]){logger['error'](_0xec8a('0x1a'),_0x1c44d4);throw new Error(_0xec8a('0x11'));}return _0x1a7792[_0xec8a('0x16')]({'attributes':['id','name',_0xec8a('0x1b'),_0xec8a('0x1c'),'role',_0xec8a('0x1d'),_0xec8a('0x1e'),_0xec8a('0x1f'),'online'],'where':{'name':_0x1c44d4,'role':{'$or':[_0xec8a('0x20'),_0xec8a('0x21'),_0xec8a('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x39cd65){if(!_0x39cd65||_0x39cd65&&_0x39cd65[_0xec8a('0x23')]!==_0x1c44d4){throw new Error(_0xec8a('0x11'));}_0x2bddfc=_0x39cd65;var _0x28adaf=_0x2bddfc[_0xec8a('0x23')]+'@'+config[_0xec8a('0xa')][_0xec8a('0xd')];return adAuthenticate(config[_0xec8a('0xa')],_0x28adaf,_0x505646);})[_0xec8a('0x19')](function(_0x2b47d5){if(_0x2bddfc[_0xec8a('0x1d')]){throw new Error(_0xec8a('0x11'));}if(_0xe57a8d[_0xec8a('0x18')]>0x0){if(_0x2bddfc['blocked']){if(moment(_0x2bddfc['blockedAt'])[_0xec8a('0x24')](_0xe57a8d[_0xec8a('0x18')],_0xec8a('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x2bddfc,0x0,![],null)[_0xec8a('0x19')](function(){return utils[_0xec8a('0x26')](_0x2bddfc);})[_0xec8a('0x19')](function(){return _0x2d3519(null,_0x2bddfc);});}else{return utils[_0xec8a('0x26')](_0x2bddfc)['then'](function(){return _0x2d3519(null,_0x2bddfc);});}}else{return utils[_0xec8a('0x26')](_0x2bddfc)[_0xec8a('0x19')](function(){return _0x2d3519(null,_0x2bddfc);});}})['catch'](function(_0xf96d72){return _0x2d3519(null,![],_0xf96d72);});}function handleError(_0x18e54d,_0xfc3f49,_0x1fdf1c){return _0x18e54d[_0xec8a('0x27')](_0xfc3f49||0x1f4)['send']({'message':_0x1fdf1c?_0x1fdf1c[_0xec8a('0x28')]||_0x1fdf1c:''});}exports[_0xec8a('0x29')]=function(_0x1f15a1,_0x3e8beb,_0x47c059){passport[_0xec8a('0xe')](_0xec8a('0x2a'),function(_0x59eef7,_0x1fd82e,_0x21797e){var _0x562821=_0x59eef7||_0x21797e;if(_0x562821){return handleError(_0x3e8beb,0x191,_0x562821);}if(!_0x1fd82e){return handleError(_0x3e8beb,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5985c8={'payload':{'id':_0x1fd82e['id'],'role':_0x1fd82e[_0xec8a('0x2b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5985c8)[_0xec8a('0x19')](function(_0x37f819){_0x3e8beb[_0xec8a('0x2c')]({'id':_0x1fd82e['id'],'token':_0x37f819,'statusCall':'','isAlreadyLogged':_0x1fd82e['online']});});}})(_0x1f15a1,_0x3e8beb,_0x47c059);};passport['use']('ad-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4e0626,_0x3ee1d2,_0xe34143){return ActiveDirectoryAuthenticate(db[_0xec8a('0x2d')],_0x4e0626,_0x3ee1d2,_0xe34143);})); \ No newline at end of file +var _0x8477=['undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','blockedAt','admin','agent','then','name','add','minutes','getLicense','catch','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8477,0xea));var _0x7847=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x8477[_0x4dc7b9];return _0x3ab114;};'use strict';var passport=require(_0x7847('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0x7847('0x1'));var ActiveDirectory=require(_0x7847('0x2'));var BPromise=require(_0x7847('0x3'));var util=require(_0x7847('0x4'));var db=require(_0x7847('0x5'))['db'];var authService=require(_0x7847('0x6'));var utils=require('../../config/utils');var config=require(_0x7847('0x7'));var logger=require(_0x7847('0x8'))(_0x7847('0x9'));function isActiveDirectoryConfigured(_0x189b7d){var _0x5944d8=![];if(typeof _0x189b7d[_0x7847('0xa')]!==_0x7847('0xb')){_0x5944d8=_0x189b7d[_0x7847('0xa')][_0x7847('0xc')]&&_0x189b7d[_0x7847('0xa')][_0x7847('0xd')]&&_0x189b7d[_0x7847('0xa')][_0x7847('0xe')];}return _0x5944d8;}function adAuthenticate(_0x59c223,_0x2cc6c5,_0x5ca9ba){return new BPromise(function(_0x5c7f02,_0x283f92){try{var _0x4b9763=new ActiveDirectory(_0x59c223);_0x4b9763['authenticate'](_0x2cc6c5,_0x5ca9ba,function(_0x42d0bb,_0x2b14f6){if(_0x42d0bb){logger[_0x7847('0xf')](_0x7847('0x10'),_0x2cc6c5,util['inspect'](_0x42d0bb,{'showHidden':![],'depth':null}));_0x283f92(_0x7847('0x11'));}else if(!_0x2b14f6){logger[_0x7847('0xf')](_0x7847('0x12'),_0x2cc6c5);_0x283f92(_0x7847('0x11'));}else{_0x5c7f02(_0x2b14f6);}});}catch(_0x18a120){_0x283f92(_0x18a120);}});}function ActiveDirectoryAuthenticate(_0x1abe4e,_0x688007,_0x1d5edf,_0x41d22f){var _0xdf74d1,_0x2737cc;if(!isActiveDirectoryConfigured(config)){logger[_0x7847('0xf')](_0x7847('0x13'),_0x688007);return _0x41d22f(null,![],{'message':_0x7847('0x11')});}return db[_0x7847('0x14')][_0x7847('0x15')]({'where':{'id':0x1},'attributes':[_0x7847('0x16'),_0x7847('0x17')],'raw':!![]})['then'](function(_0x180c68){_0xdf74d1=_0x180c68;if(!_0xdf74d1[_0x7847('0x16')]){logger[_0x7847('0xf')](_0x7847('0x18'),_0x688007);throw new Error(_0x7847('0x11'));}return _0x1abe4e[_0x7847('0x15')]({'attributes':['id','name',_0x7847('0x19'),'salt',_0x7847('0x1a'),_0x7847('0x1b'),_0x7847('0x1c'),_0x7847('0x1d'),'online'],'where':{'name':_0x688007,'role':{'$or':[_0x7847('0x1e'),'user',_0x7847('0x1f')]},'adSsoEnabled':!![]}});})[_0x7847('0x20')](function(_0x1b2347){if(!_0x1b2347||_0x1b2347&&_0x1b2347[_0x7847('0x21')]!==_0x688007){throw new Error(_0x7847('0x11'));}_0x2737cc=_0x1b2347;var _0x420a5c=_0x2737cc[_0x7847('0x21')]+'@'+config[_0x7847('0xa')]['domain'];return adAuthenticate(config[_0x7847('0xa')],_0x420a5c,_0x1d5edf);})['then'](function(_0x19cf92){if(_0x2737cc[_0x7847('0x1b')]){throw new Error(_0x7847('0x11'));}if(_0xdf74d1['blockDuration']>0x0){if(_0x2737cc[_0x7847('0x1c')]){if(moment(_0x2737cc[_0x7847('0x1d')])[_0x7847('0x22')](_0xdf74d1[_0x7847('0x17')],_0x7847('0x23'))>moment()){throw new Error(_0x7847('0x11'));}return utils['clearBlockUser'](_0x2737cc,0x0,![],null)['then'](function(){return utils[_0x7847('0x24')](_0x2737cc);})[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}else{return utils[_0x7847('0x24')](_0x2737cc)[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}}else{return utils[_0x7847('0x24')](_0x2737cc)[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}})[_0x7847('0x25')](function(_0xc8c7b2){return _0x41d22f(null,![],_0xc8c7b2);});}function handleError(_0x3e476b,_0x48c02f,_0x42f37b){return _0x3e476b['status'](_0x48c02f||0x1f4)[_0x7847('0x26')]({'message':_0x42f37b?_0x42f37b[_0x7847('0x27')]||_0x42f37b:''});}exports[_0x7847('0x28')]=function(_0x397df7,_0x27ac27,_0x122a18){passport[_0x7847('0x29')](_0x7847('0x2a'),function(_0x13fc8c,_0x44c365,_0x4ac4fd){var _0x3f20b1=_0x13fc8c||_0x4ac4fd;if(_0x3f20b1){return handleError(_0x27ac27,0x191,_0x3f20b1);}if(!_0x44c365){return handleError(_0x27ac27,0x194,{'message':_0x7847('0x2b')});}else{var _0x2facd6={'payload':{'id':_0x44c365['id'],'role':_0x44c365[_0x7847('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x7847('0x2c')](_0x2facd6)[_0x7847('0x20')](function(_0x4900e5){_0x27ac27[_0x7847('0x2d')]({'id':_0x44c365['id'],'token':_0x4900e5,'statusCall':'','isAlreadyLogged':_0x44c365[_0x7847('0x2e')]});});}})(_0x397df7,_0x27ac27,_0x122a18);};passport[_0x7847('0x2f')](_0x7847('0x2a'),new LocalStrategy({'usernameField':_0x7847('0x21'),'passwordField':_0x7847('0x19')},function(_0x4cc548,_0x3a3fcf,_0x2bd48c){return ActiveDirectoryAuthenticate(db[_0x7847('0x30')],_0x4cc548,_0x3a3fcf,_0x2bd48c);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 4229c5d..f485563 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 _0x297b=['Router','./authActiveDirectory.controller','login','express'];(function(_0x190d91,_0x4b05d9){var _0x3ce8cf=function(_0x1d9fd5){while(--_0x1d9fd5){_0x190d91['push'](_0x190d91['shift']());}};_0x3ce8cf(++_0x4b05d9);}(_0x297b,0x6f));var _0xb297=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x297b[_0x2112d4];return _0x434972;};'use strict';var express=require(_0xb297('0x0'));var router=express[_0xb297('0x1')]();var controller=require(_0xb297('0x2'));router['post']('/',controller[_0xb297('0x3')]);module['exports']=router; \ No newline at end of file +var _0x8771=['exports','express','Router','login'];(function(_0x534971,_0x1a8061){var _0x575c2f=function(_0x222f11){while(--_0x222f11){_0x534971['push'](_0x534971['shift']());}};_0x575c2f(++_0x1a8061);}(_0x8771,0x75));var _0x1877=function(_0x3f1718,_0x5360ad){_0x3f1718=_0x3f1718-0x0;var _0x29627e=_0x8771[_0x3f1718];return _0x29627e;};'use strict';var express=require(_0x1877('0x0'));var router=express[_0x1877('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x1877('0x2')]);module[_0x1877('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f13545e..a4aeb5e 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(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef55b,_0x18eb2f){_0x4ef55b=_0x4ef55b-0x0;var _0x96364d=_0x7a54[_0x4ef55b];return _0x96364d;};'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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed583,_0x512eb2){_0x1ed583=_0x1ed583-0x0;var _0x42a452=_0x7a54[_0x1ed583];return _0x42a452;};'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 6cfbc96..8f42b43 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 _0xf0f8=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','login','get','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x31f7f7,_0x4b4e1e){var _0xfcd721=function(_0x2683fd){while(--_0x2683fd){_0x31f7f7['push'](_0x31f7f7['shift']());}};_0xfcd721(++_0x4b4e1e);}(_0xf0f8,0xbb));var _0x8f0f=function(_0x2f8400,_0x84ca65){_0x2f8400=_0x2f8400-0x0;var _0x5c9c39=_0xf0f8[_0x2f8400];return _0x5c9c39;};'use strict';var express=require(_0x8f0f('0x0'));var passport=require(_0x8f0f('0x1'));var router=express[_0x8f0f('0x2')]();var controller=require(_0x8f0f('0x3'));var userController=require(_0x8f0f('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x8f0f('0x5')]);router[_0x8f0f('0x6')](_0x8f0f('0x7'),controller[_0x8f0f('0x8')],authService[_0x8f0f('0x9')],userController[_0x8f0f('0x5')],authService[_0x8f0f('0xa')]);module['exports']=router; \ No newline at end of file +var _0x6412=['get','login','/callback','callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x4e3780,_0x5c62fb){var _0x1d8532=function(_0x1010ab){while(--_0x1010ab){_0x4e3780['push'](_0x4e3780['shift']());}};_0x1d8532(++_0x5c62fb);}(_0x6412,0x1c8));var _0x2641=function(_0x40ae87,_0x29c4c6){_0x40ae87=_0x40ae87-0x0;var _0x49a0bb=_0x6412[_0x40ae87];return _0x49a0bb;};'use strict';var express=require(_0x2641('0x0'));var passport=require(_0x2641('0x1'));var router=express[_0x2641('0x2')]();var controller=require(_0x2641('0x3'));var userController=require(_0x2641('0x4'));var authService=require(_0x2641('0x5'));router[_0x2641('0x6')]('/',controller[_0x2641('0x7')]);router['get'](_0x2641('0x8'),controller[_0x2641('0x9')],authService[_0x2641('0xa')],userController[_0x2641('0x7')],authService['setTokenCookie']);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 393945f..e8e6044 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 _0x3463=['online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','blocked','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','send','message','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x32ccd6,_0x612cf3){var _0x15c41a=function(_0x39e65c){while(--_0x39e65c){_0x32ccd6['push'](_0x32ccd6['shift']());}};_0x15c41a(++_0x612cf3);}(_0x3463,0x1e1));var _0x3346=function(_0x2c3458,_0x1f7efd){_0x2c3458=_0x2c3458-0x0;var _0x3f7e02=_0x3463[_0x2c3458];return _0x3f7e02;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x3346('0x0'));var _=require('lodash');var rs=require(_0x3346('0x1'));var moment=require('moment');var db=require(_0x3346('0x2'))['db'];var authService=require(_0x3346('0x3'));var utils=require(_0x3346('0x4'));var client=jayson[_0x3346('0x5')][_0x3346('0x6')]({'port':0x232b});function localAuthenticate(_0x1085a1,_0x1d2638,_0x18cd93,_0x2f1090){var _0x4c83d8,_0xad86ee;return db[_0x3346('0x7')][_0x3346('0x8')]({'where':{'id':0x1},'attributes':[_0x3346('0x9'),_0x3346('0xa')],'raw':!![]})[_0x3346('0xb')](function(_0x21e6f6){_0x4c83d8=_0x21e6f6;return _0x1085a1[_0x3346('0x8')]({'attributes':['id',_0x3346('0xc'),_0x3346('0xd'),'salt',_0x3346('0xe'),_0x3346('0xf'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x1d2638,'role':{'$or':[_0x3346('0x10'),_0x3346('0x11'),'agent']}}});})['then'](function(_0x4c2bc5){if(!_0x4c2bc5||_0x4c2bc5&&_0x4c2bc5[_0x3346('0xc')]!==_0x1d2638){throw new Error(_0x3346('0x12'));}else{_0xad86ee=_0x4c2bc5;return _0xad86ee;}})[_0x3346('0xb')](function(){_0xad86ee[_0x3346('0x13')](_0x18cd93,function(_0x2ea2db,_0x279d5d){var _0x4a94ce=_0xad86ee['loginAttempts']+0x1;if(_0x2ea2db){return _0x2f1090(_0x2ea2db);}else if(!_0x279d5d){if(_0xad86ee[_0x3346('0xf')]){return _0x2f1090(null,![],{'message':_0x3346('0x12')});}else if(_0x4c83d8[_0x3346('0x9')]>0x0){if(_0xad86ee['blocked']){if(_0x4c83d8[_0x3346('0xa')]>0x0){if(moment(_0xad86ee[_0x3346('0x14')])[_0x3346('0x15')](_0x4c83d8['blockDuration'],_0x3346('0x16'))>moment()){return _0x2f1090(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3346('0x17')](_0xad86ee,_0x4a94ce,![],null)[_0x3346('0xb')](function(){return _0x2f1090(null,![],{'message':_0x3346('0x12')});});}}else{return _0x2f1090(null,![],{'message':_0x3346('0x12')});}}else{if(_0x4a94ce>=_0x4c83d8[_0x3346('0x9')]){return utils[_0x3346('0x17')](_0xad86ee,0x0,!![],moment())[_0x3346('0xb')](function(){return _0x2f1090(null,![],{'message':_0x3346('0x12')});});}else{return utils[_0x3346('0x17')](_0xad86ee,_0x4a94ce,![],null)[_0x3346('0xb')](function(){return _0x2f1090(null,![],{'message':_0x3346('0x12')});});}}}else{return _0x2f1090(null,![],{'message':_0x3346('0x12')});}}else{if(_0xad86ee['disabled']){return _0x2f1090(null,![],{'message':_0x3346('0x12')});}else if(_0x4c83d8[_0x3346('0x9')]>0x0){if(_0xad86ee[_0x3346('0x18')]){if(_0x4c83d8['blockDuration']>0x0){if(moment(_0xad86ee[_0x3346('0x14')])[_0x3346('0x15')](_0x4c83d8[_0x3346('0xa')],_0x3346('0x16'))>moment()){return _0x2f1090(null,![],{'message':_0x3346('0x12')});}else{return utils['clearBlockUser'](_0xad86ee,0x0,![],null)[_0x3346('0xb')](function(){return utils['getLicense'](_0xad86ee);})[_0x3346('0xb')](function(){return _0x2f1090(null,_0xad86ee);});}}else{return _0x2f1090(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3346('0x17')](_0xad86ee,0x0,![],null)[_0x3346('0xb')](function(){return utils['getLicense'](_0xad86ee);})[_0x3346('0xb')](function(){return _0x2f1090(null,_0xad86ee);})['catch'](function(_0x49b43d){return _0x2f1090(null,![],_0x49b43d);});}}else{if(_0xad86ee[_0x3346('0x18')]){return _0x2f1090(null,![],{'message':_0x3346('0x12')});}else{return utils['getLicense'](_0xad86ee)[_0x3346('0xb')](function(){return _0x2f1090(null,_0xad86ee);});}}}});})[_0x3346('0x19')](function(_0x26763e){return _0x2f1090(null,![],_0x26763e);});}function sendServiceMail(_0x2f20c1){return db[_0x3346('0x1a')][_0x3346('0x1b')]({'where':{'service':!![]},'attributes':['id',_0x3346('0xc'),_0x3346('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0x3346('0x1d'),'include':[{'model':db[_0x3346('0x1e')],'as':_0x3346('0x1e')}]}]})[_0x3346('0xb')](function(_0x22d458){if(!_0x22d458){throw new Error(_0x3346('0x1f'));}var _0x20e8f2=_0x22d458['getSmtpOptions']();var _0x32cbf3={'account':_0x20e8f2,'message':_['merge']({'from':util[_0x3346('0x20')](_0x3346('0x21'),_0x22d458['name'],_0x22d458[_0x3346('0x1c')]||_0x22d458[_0x3346('0x1d')][_0x3346('0x11')])},_0x2f20c1)};return client[_0x3346('0x22')](_0x3346('0x23'),_0x32cbf3);})[_0x3346('0xb')](function(_0x391077){if(_0x391077[_0x3346('0x24')]){throw new Error(util[_0x3346('0x20')](_0x3346('0x25'),_0x391077['error']['message']||JSON['stringify'](_0x391077[_0x3346('0x24')])));}return!![];});}function handleError(_0x41a926,_0x3bd1de,_0x387bdb){return _0x41a926['status'](_0x3bd1de||0x1f4)[_0x3346('0x26')]({'message':_0x387bdb?_0x387bdb[_0x3346('0x27')]||_0x387bdb:''});}exports['login']=function(_0x582468,_0x192114,_0xa935cd){passport[_0x3346('0x13')](_0x3346('0x28'),function(_0x542948,_0x50dd80,_0x30df55){var _0x59234d=_0x542948||_0x30df55;if(_0x59234d){return handleError(_0x192114,0x191,_0x59234d);}if(!_0x50dd80){return handleError(_0x192114,0x194,{'message':_0x3346('0x29')});}else{var _0x26ce27={'payload':{'id':_0x50dd80['id'],'role':_0x50dd80[_0x3346('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x3346('0x2a')](_0x26ce27)[_0x3346('0xb')](function(_0x4245e8){_0x192114[_0x3346('0x2b')]({'id':_0x50dd80['id'],'token':_0x4245e8,'statusCall':'','isAlreadyLogged':_0x50dd80[_0x3346('0x2c')]});});}})(_0x582468,_0x192114,_0xa935cd);};exports[_0x3346('0x2d')]=function(_0x4e39b9,_0x573663){if(!_0x4e39b9[_0x3346('0x2e')]['email']){return handleError(_0x573663,0x1f4,{'message':_0x3346('0x2f')});}var _0x1bcbbf=rs[_0x3346('0x30')]();_0x4e39b9[_0x3346('0x2e')][_0x3346('0x1c')]=_0x4e39b9[_0x3346('0x2e')][_0x3346('0x1c')][_0x3346('0x31')]()[_0x3346('0x32')]();var _0x536f48;return db[_0x3346('0x7')][_0x3346('0x8')]({'where':{'id':0x1},'attributes':[_0x3346('0x9'),_0x3346('0xa')],'raw':!![]})[_0x3346('0xb')](function(_0x34c6dc){_0x536f48=_0x34c6dc;return db[_0x3346('0x33')][_0x3346('0x1b')]({'where':{'email':_0x4e39b9[_0x3346('0x2e')][_0x3346('0x1c')]}});})[_0x3346('0xb')](function(_0x3e536a){if(!_0x3e536a){throw new Error(_0x3346('0x34'));}if(_0x3e536a['disabled']){throw new Error(_0x3346('0x35'));}if(_0x3e536a[_0x3346('0x18')]){if(moment(_0x3e536a[_0x3346('0x14')])[_0x3346('0x15')](_0x536f48[_0x3346('0xa')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3e536a[_0x3346('0x18')]=![];_0x3e536a[_0x3346('0x14')]=null;}}_0x3e536a[_0x3346('0x36')]=_0x1bcbbf;_0x3e536a[_0x3346('0x37')]=Date[_0x3346('0x38')]()+0x36ee80;return _0x3e536a['save']();})[_0x3346('0xb')](function(){return sendServiceMail({'to':_0x4e39b9[_0x3346('0x2e')]['email'],'subject':_0x3346('0x39'),'text':_0x3346('0x3a')+_0x3346('0x3b')+_0x3346('0x3c')+_0x4e39b9[_0x3346('0x3d')][_0x3346('0x3e')]+'/reset/'+_0x1bcbbf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x3346('0xb')](function(){_0x573663[_0x3346('0x3f')](0xc8)[_0x3346('0x26')]({'message':_0x3346('0x40')});})[_0x3346('0x19')](function(_0x1b5e5b){return handleError(_0x573663,0x1f4,_0x1b5e5b);});};exports[_0x3346('0x41')]=function(_0x427f2c,_0x436199){return db[_0x3346('0x33')]['find']({'where':{'resetPasswordToken':_0x427f2c[_0x3346('0x42')][_0x3346('0x43')],'resetPasswordExpires':{'$gt':Date[_0x3346('0x38')]()}}})['then'](function(_0x503f6e){if(!_0x503f6e){throw new Error(_0x3346('0x44'));}return db[_0x3346('0x7')][_0x3346('0x8')]({'attributes':['id',_0x3346('0x45'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x3346('0xb')](function(_0x35ee84){if(_0x35ee84['securePassword'])authService[_0x3346('0x46')](_0x427f2c[_0x3346('0x2e')][_0x3346('0xd')]);if(!_0x35ee84[_0x3346('0x47')]||!_0x503f6e[_0x3346('0x48')])return _0x503f6e;authService[_0x3346('0x49')](_0x427f2c[_0x3346('0x2e')]['password'],_0x503f6e[_0x3346('0x48')],_0x35ee84['passwordHistoryLimit']);return _0x503f6e;})['then'](function(){_0x503f6e[_0x3346('0xd')]=_0x427f2c[_0x3346('0x2e')][_0x3346('0xd')];_0x503f6e[_0x3346('0x36')]=null;_0x503f6e[_0x3346('0x37')]=null;return _0x503f6e['save']();});})[_0x3346('0xb')](function(){_0x436199[_0x3346('0x3f')](0xc8)[_0x3346('0x26')]({'message':_0x3346('0x4a')});})[_0x3346('0x19')](function(_0x31ce79){return handleError(_0x436199,0x1f4,_0x31ce79);});};passport['use'](_0x3346('0x28'),new LocalStrategy({'usernameField':_0x3346('0xc'),'passwordField':_0x3346('0xd')},function(_0xeb3f47,_0x114d41,_0xa96a3c){return localAuthenticate(db[_0x3346('0x33')],_0xeb3f47,_0x114d41,_0xa96a3c);})); \ No newline at end of file +var _0xf8a8=['xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','Reset\x20Email\x20sent!','params','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport','passport-local','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blocked','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save'];(function(_0x495869,_0x43e996){var _0x1a5786=function(_0x45192c){while(--_0x45192c){_0x495869['push'](_0x495869['shift']());}};_0x1a5786(++_0x43e996);}(_0xf8a8,0xff));var _0x8f8a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xf8a8[_0x4e9628];return _0x27bc8c;};'use strict';var util=require(_0x8f8a('0x0'));var passport=require(_0x8f8a('0x1'));var LocalStrategy=require(_0x8f8a('0x2'))['Strategy'];var jayson=require(_0x8f8a('0x3'));var _=require(_0x8f8a('0x4'));var rs=require('randomstring');var moment=require(_0x8f8a('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x8f8a('0x6'));var utils=require(_0x8f8a('0x7'));var client=jayson[_0x8f8a('0x8')][_0x8f8a('0x9')]({'port':0x232b});function localAuthenticate(_0x5ef965,_0x1160d0,_0x57ed11,_0x495896){var _0x4c5a10,_0x501ea0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x8f8a('0xa'),_0x8f8a('0xb')],'raw':!![]})[_0x8f8a('0xc')](function(_0x420ddb){_0x4c5a10=_0x420ddb;return _0x5ef965['findOne']({'attributes':['id','name',_0x8f8a('0xd'),_0x8f8a('0xe'),'role',_0x8f8a('0xf'),_0x8f8a('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x1160d0,'role':{'$or':[_0x8f8a('0x11'),_0x8f8a('0x12'),_0x8f8a('0x13')]}}});})['then'](function(_0x1e0646){if(!_0x1e0646||_0x1e0646&&_0x1e0646[_0x8f8a('0x14')]!==_0x1160d0){throw new Error(_0x8f8a('0x15'));}else{_0x501ea0=_0x1e0646;return _0x501ea0;}})[_0x8f8a('0xc')](function(){_0x501ea0[_0x8f8a('0x16')](_0x57ed11,function(_0x57b3c7,_0x33f502){var _0xa8d8a0=_0x501ea0[_0x8f8a('0x17')]+0x1;if(_0x57b3c7){return _0x495896(_0x57b3c7);}else if(!_0x33f502){if(_0x501ea0[_0x8f8a('0xf')]){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else if(_0x4c5a10[_0x8f8a('0xa')]>0x0){if(_0x501ea0[_0x8f8a('0x10')]){if(_0x4c5a10[_0x8f8a('0xb')]>0x0){if(moment(_0x501ea0['blockedAt'])[_0x8f8a('0x18')](_0x4c5a10[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else{return utils[_0x8f8a('0x1a')](_0x501ea0,_0xa8d8a0,![],null)['then'](function(){return _0x495896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{if(_0xa8d8a0>=_0x4c5a10[_0x8f8a('0xa')]){return utils[_0x8f8a('0x1a')](_0x501ea0,0x0,!![],moment())[_0x8f8a('0xc')](function(){return _0x495896(null,![],{'message':_0x8f8a('0x15')});});}else{return utils[_0x8f8a('0x1a')](_0x501ea0,_0xa8d8a0,![],null)[_0x8f8a('0xc')](function(){return _0x495896(null,![],{'message':_0x8f8a('0x15')});});}}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{if(_0x501ea0[_0x8f8a('0xf')]){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else if(_0x4c5a10[_0x8f8a('0xa')]>0x0){if(_0x501ea0[_0x8f8a('0x10')]){if(_0x4c5a10[_0x8f8a('0xb')]>0x0){if(moment(_0x501ea0[_0x8f8a('0x1b')])[_0x8f8a('0x18')](_0x4c5a10[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else{return utils['clearBlockUser'](_0x501ea0,0x0,![],null)[_0x8f8a('0xc')](function(){return utils[_0x8f8a('0x1c')](_0x501ea0);})[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);});}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{return utils[_0x8f8a('0x1a')](_0x501ea0,0x0,![],null)[_0x8f8a('0xc')](function(){return utils['getLicense'](_0x501ea0);})[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);})[_0x8f8a('0x1d')](function(_0xefafe3){return _0x495896(null,![],_0xefafe3);});}}else{if(_0x501ea0[_0x8f8a('0x10')]){return _0x495896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8f8a('0x1c')](_0x501ea0)[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);});}}}});})[_0x8f8a('0x1d')](function(_0x53f446){return _0x495896(null,![],_0x53f446);});}function sendServiceMail(_0x2e9bbd){return db[_0x8f8a('0x1e')][_0x8f8a('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x8f8a('0x20')],'include':[{'model':db[_0x8f8a('0x21')],'as':_0x8f8a('0x22'),'include':[{'model':db[_0x8f8a('0x23')],'as':_0x8f8a('0x23')}]}]})[_0x8f8a('0xc')](function(_0x1687e9){if(!_0x1687e9){throw new Error(_0x8f8a('0x24'));}var _0x5e10ad=_0x1687e9[_0x8f8a('0x25')]();var _0x5a1c6e={'account':_0x5e10ad,'message':_[_0x8f8a('0x26')]({'from':util[_0x8f8a('0x27')](_0x8f8a('0x28'),_0x1687e9[_0x8f8a('0x14')],_0x1687e9[_0x8f8a('0x20')]||_0x1687e9[_0x8f8a('0x22')][_0x8f8a('0x12')])},_0x2e9bbd)};return client['request']('SendMail',_0x5a1c6e);})[_0x8f8a('0xc')](function(_0x5cdeda){if(_0x5cdeda[_0x8f8a('0x29')]){throw new Error(util[_0x8f8a('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5cdeda[_0x8f8a('0x29')][_0x8f8a('0x2a')]||JSON[_0x8f8a('0x2b')](_0x5cdeda[_0x8f8a('0x29')])));}return!![];});}function handleError(_0x5206d0,_0x58075b,_0x1552c1){return _0x5206d0[_0x8f8a('0x2c')](_0x58075b||0x1f4)[_0x8f8a('0x2d')]({'message':_0x1552c1?_0x1552c1['message']||_0x1552c1:''});}exports[_0x8f8a('0x2e')]=function(_0x49af2e,_0x4c5cbb,_0x3f1220){passport[_0x8f8a('0x16')](_0x8f8a('0x2f'),function(_0x5b3dec,_0x3ebb02,_0x5120cc){var _0x31e687=_0x5b3dec||_0x5120cc;if(_0x31e687){return handleError(_0x4c5cbb,0x191,_0x31e687);}if(!_0x3ebb02){return handleError(_0x4c5cbb,0x194,{'message':_0x8f8a('0x30')});}else{var _0x18ee8c={'payload':{'id':_0x3ebb02['id'],'role':_0x3ebb02[_0x8f8a('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x8f8a('0x32')](_0x18ee8c)[_0x8f8a('0xc')](function(_0x212309){_0x4c5cbb['json']({'id':_0x3ebb02['id'],'token':_0x212309,'statusCall':'','isAlreadyLogged':_0x3ebb02[_0x8f8a('0x33')]});});}})(_0x49af2e,_0x4c5cbb,_0x3f1220);};exports[_0x8f8a('0x34')]=function(_0x3a9f93,_0x408617){if(!_0x3a9f93[_0x8f8a('0x35')][_0x8f8a('0x20')]){return handleError(_0x408617,0x1f4,{'message':_0x8f8a('0x36')});}var _0x27def4=rs['generate']();_0x3a9f93[_0x8f8a('0x35')]['email']=_0x3a9f93[_0x8f8a('0x35')]['email'][_0x8f8a('0x37')]()['toLowerCase']();var _0x1c3123;return db[_0x8f8a('0x38')]['findOne']({'where':{'id':0x1},'attributes':[_0x8f8a('0xa'),_0x8f8a('0xb')],'raw':!![]})[_0x8f8a('0xc')](function(_0x2381e5){_0x1c3123=_0x2381e5;return db[_0x8f8a('0x39')][_0x8f8a('0x1f')]({'where':{'email':_0x3a9f93[_0x8f8a('0x35')][_0x8f8a('0x20')]}});})['then'](function(_0x54665c){if(!_0x54665c){throw new Error(_0x8f8a('0x3a'));}if(_0x54665c[_0x8f8a('0xf')]){throw new Error(_0x8f8a('0x3b'));}if(_0x54665c['blocked']){if(moment(_0x54665c[_0x8f8a('0x1b')])[_0x8f8a('0x18')](_0x1c3123[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){throw new Error(_0x8f8a('0x3c'));}else{_0x54665c[_0x8f8a('0x10')]=![];_0x54665c['blockedAt']=null;}}_0x54665c[_0x8f8a('0x3d')]=_0x27def4;_0x54665c[_0x8f8a('0x3e')]=Date[_0x8f8a('0x3f')]()+0x36ee80;return _0x54665c[_0x8f8a('0x40')]();})[_0x8f8a('0xc')](function(){return sendServiceMail({'to':_0x3a9f93['body'][_0x8f8a('0x20')],'subject':_0x8f8a('0x41'),'text':_0x8f8a('0x42')+_0x8f8a('0x43')+_0x8f8a('0x44')+_0x3a9f93['headers'][_0x8f8a('0x45')]+'/reset/'+_0x27def4+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x8f8a('0xc')](function(){_0x408617[_0x8f8a('0x2c')](0xc8)[_0x8f8a('0x2d')]({'message':_0x8f8a('0x46')});})['catch'](function(_0x52bd85){return handleError(_0x408617,0x1f4,_0x52bd85);});};exports['reset']=function(_0x119d21,_0x25bfbd){return db['User']['find']({'where':{'resetPasswordToken':_0x119d21[_0x8f8a('0x47')]['token'],'resetPasswordExpires':{'$gt':Date[_0x8f8a('0x3f')]()}}})[_0x8f8a('0xc')](function(_0x3504a3){if(!_0x3504a3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x8f8a('0x48')]({'attributes':['id',_0x8f8a('0x49'),_0x8f8a('0x4a'),_0x8f8a('0x4b')]})[_0x8f8a('0xc')](function(_0x120fec){if(_0x120fec['securePassword'])authService[_0x8f8a('0x4c')](_0x119d21[_0x8f8a('0x35')][_0x8f8a('0xd')]);if(!_0x120fec[_0x8f8a('0x4a')]||!_0x3504a3[_0x8f8a('0x4d')])return _0x3504a3;authService[_0x8f8a('0x4e')](_0x119d21[_0x8f8a('0x35')]['password'],_0x3504a3[_0x8f8a('0x4d')],_0x120fec[_0x8f8a('0x4b')]);return _0x3504a3;})[_0x8f8a('0xc')](function(){_0x3504a3['password']=_0x119d21[_0x8f8a('0x35')][_0x8f8a('0xd')];_0x3504a3[_0x8f8a('0x3d')]=null;_0x3504a3['resetPasswordExpires']=null;return _0x3504a3[_0x8f8a('0x40')]();});})[_0x8f8a('0xc')](function(){_0x25bfbd[_0x8f8a('0x2c')](0xc8)[_0x8f8a('0x2d')]({'message':'Password\x20reset!'});})[_0x8f8a('0x1d')](function(_0x529aa2){return handleError(_0x25bfbd,0x1f4,_0x529aa2);});};passport[_0x8f8a('0x4f')](_0x8f8a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x8f8a('0xd')},function(_0x205886,_0x12f9fe,_0x4746ab){return localAuthenticate(db[_0x8f8a('0x39')],_0x205886,_0x12f9fe,_0x4746ab);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 60100a6..60ae898 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 _0xfbc1=['./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x252ad5,_0x12b62b){var _0x5e7d9e=function(_0x51f818){while(--_0x51f818){_0x252ad5['push'](_0x252ad5['shift']());}};_0x5e7d9e(++_0x12b62b);}(_0xfbc1,0x12f));var _0x1fbc=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xfbc1[_0x1034bb];return _0x453fdb;};'use strict';var express=require(_0x1fbc('0x0'));var router=express['Router']();var controller=require(_0x1fbc('0x1'));router[_0x1fbc('0x2')]('/',controller['login']);router[_0x1fbc('0x2')](_0x1fbc('0x3'),controller[_0x1fbc('0x4')]);router[_0x1fbc('0x2')](_0x1fbc('0x5'),controller[_0x1fbc('0x6')]);module[_0x1fbc('0x7')]=router; \ No newline at end of file +var _0x6007=['/reset/:token','reset','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x202aa2,_0x584b66){var _0x4e8000=function(_0x400b30){while(--_0x400b30){_0x202aa2['push'](_0x202aa2['shift']());}};_0x4e8000(++_0x584b66);}(_0x6007,0x1b2));var _0x7600=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x6007[_0x3e21f4];return _0x40fc49;};'use strict';var express=require(_0x7600('0x0'));var router=express[_0x7600('0x1')]();var controller=require(_0x7600('0x2'));router[_0x7600('0x3')]('/',controller[_0x7600('0x4')]);router[_0x7600('0x3')](_0x7600('0x5'),controller[_0x7600('0x6')]);router[_0x7600('0x3')](_0x7600('0x7'),controller[_0x7600('0x8')]);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 84b0024..7de711c 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 _0x8c87=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x3d4454,_0x25d4d3){var _0x2425f9=function(_0x6284e5){while(--_0x6284e5){_0x3d4454['push'](_0x3d4454['shift']());}};_0x2425f9(++_0x25d4d3);}(_0x8c87,0xed));var _0x78c8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8c87[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x78c8('0x0'));module['exports']={'name':{'type':Sequelize[_0x78c8('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x78c8('0x1')]},'description':{'type':Sequelize[_0x78c8('0x1')]},'status':{'type':Sequelize[_0x78c8('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x78c8('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x2f4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x2f4a,0x187));var _0xa2f4=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2f4a[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require(_0xa2f4('0x0'));module[_0xa2f4('0x1')]={'name':{'type':Sequelize[_0xa2f4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa2f4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa2f4('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 90298ec..201d585 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 _0xc16a=['addConditions','ids','getConditions','hasOwnProperty','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','filters','pick','filter','merge','options','where','includeAll','findAll','rows','catch','show','params','length','create','find','body','Condition'];(function(_0x2c5d4d,_0x1d4d5e){var _0x14dfe0=function(_0x47a9e4){while(--_0x47a9e4){_0x2c5d4d['push'](_0x2c5d4d['shift']());}};_0x14dfe0(++_0x1d4d5e);}(_0xc16a,0x15c));var _0xac16=function(_0x40eba7,_0x277722){_0x40eba7=_0x40eba7-0x0;var _0x1152fd=_0xc16a[_0x40eba7];return _0x1152fd;};'use strict';var emlformat=require(_0xac16('0x0'));var rimraf=require(_0xac16('0x1'));var zipdir=require(_0xac16('0x2'));var jsonpatch=require(_0xac16('0x3'));var rp=require(_0xac16('0x4'));var moment=require(_0xac16('0x5'));var BPromise=require(_0xac16('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac16('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac16('0x8'));var fs=require('fs');var fs_extra=require(_0xac16('0x9'));var _=require(_0xac16('0xa'));var squel=require(_0xac16('0xb'));var crypto=require('crypto');var jsforce=require(_0xac16('0xc'));var deskjs=require(_0xac16('0xd'));var toCsv=require(_0xac16('0xe'));var querystring=require(_0xac16('0xf'));var Papa=require(_0xac16('0x10'));var Redis=require(_0xac16('0x11'));var authService=require(_0xac16('0x12'));var qs=require(_0xac16('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac16('0x14'));var logger=require('../../config/logger')(_0xac16('0x15'));var utils=require(_0xac16('0x16'));var config=require(_0xac16('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xac16('0x18'))['db'];function respondWithStatusCode(_0x44bfb3,_0x382dee){_0x382dee=_0x382dee||0xcc;return function(_0x5ab5d8){if(_0x5ab5d8){return _0x44bfb3[_0xac16('0x19')](_0x382dee);}return _0x44bfb3[_0xac16('0x1a')](_0x382dee)[_0xac16('0x1b')]();};}function respondWithResult(_0x2a08b4,_0x55bcfa){_0x55bcfa=_0x55bcfa||0xc8;return function(_0x472b45){if(_0x472b45){return _0x2a08b4[_0xac16('0x1a')](_0x55bcfa)[_0xac16('0x1c')](_0x472b45);}};}function respondWithFilteredResult(_0x22a6c2,_0x1913bc){return function(_0x127808){if(_0x127808){var _0xb5854d=typeof _0x1913bc[_0xac16('0x1d')]===_0xac16('0x1e')&&typeof _0x1913bc[_0xac16('0x1f')]==='undefined';var _0x48bae4=_0x127808[_0xac16('0x20')];var _0x859065=_0xb5854d?0x0:_0x1913bc[_0xac16('0x1d')];var _0x489218=_0xb5854d?_0x127808[_0xac16('0x20')]:_0x1913bc['offset']+_0x1913bc['limit'];var _0xa1bd21;if(_0x489218>=_0x48bae4){_0x489218=_0x48bae4;_0xa1bd21=0xc8;}else{_0xa1bd21=0xce;}_0x22a6c2[_0xac16('0x1a')](_0xa1bd21);return _0x22a6c2[_0xac16('0x21')]('Content-Range',_0x859065+'-'+_0x489218+'/'+_0x48bae4)[_0xac16('0x1c')](_0x127808);}return null;};}function patchUpdates(_0x3c9ba7){return function(_0x1cf53f){try{jsonpatch[_0xac16('0x22')](_0x1cf53f,_0x3c9ba7,!![]);}catch(_0x347f3b){return BPromise[_0xac16('0x23')](_0x347f3b);}return _0x1cf53f[_0xac16('0x24')]();};}function saveUpdates(_0x4c1dc7,_0x182b40){return function(_0x365cc3){if(_0x365cc3){return _0x365cc3[_0xac16('0x25')](_0x4c1dc7)[_0xac16('0x26')](function(_0x356e9c){return _0x356e9c;});}return null;};}function removeEntity(_0x30956b,_0x761355){return function(_0x2cade0){if(_0x2cade0){return _0x2cade0[_0xac16('0x27')]()[_0xac16('0x26')](function(){_0x30956b[_0xac16('0x1a')](0xcc)[_0xac16('0x1b')]();});}};}function handleEntityNotFound(_0x490f3c,_0x3f33df){return function(_0x43ed5a){if(!_0x43ed5a){_0x490f3c['sendStatus'](0x194);}return _0x43ed5a;};}function handleError(_0x5e55ff,_0x3947af){_0x3947af=_0x3947af||0x1f4;return function(_0x214dce){logger[_0xac16('0x28')](_0x214dce[_0xac16('0x29')]);if(_0x214dce[_0xac16('0x2a')]){delete _0x214dce[_0xac16('0x2a')];}_0x5e55ff['status'](_0x3947af)[_0xac16('0x2b')](_0x214dce);};}exports[_0xac16('0x2c')]=function(_0x1dfbe6,_0x35d208){var _0x553a38={},_0x580dfd={},_0x3683b4={'count':0x0,'rows':[]};var _0x550919=_[_0xac16('0x2d')](db[_0xac16('0x2e')][_0xac16('0x2f')],function(_0x3e6cf8){return{'name':_0x3e6cf8[_0xac16('0x30')],'type':_0x3e6cf8[_0xac16('0x31')][_0xac16('0x32')]};});_0x580dfd[_0xac16('0x33')]=_['map'](_0x550919,'name');_0x580dfd['query']=_[_0xac16('0x34')](_0x1dfbe6[_0xac16('0x35')]);_0x580dfd['filters']=_[_0xac16('0x36')](_0x580dfd['model'],_0x580dfd[_0xac16('0x35')]);_0x553a38['attributes']=_[_0xac16('0x36')](_0x580dfd[_0xac16('0x33')],qs[_0xac16('0x37')](_0x1dfbe6[_0xac16('0x35')][_0xac16('0x37')]));_0x553a38[_0xac16('0x38')]=_0x553a38[_0xac16('0x38')]['length']?_0x553a38[_0xac16('0x38')]:_0x580dfd['model'];if(!_0x1dfbe6['query']['hasOwnProperty'](_0xac16('0x39'))){_0x553a38[_0xac16('0x1f')]=qs['limit'](_0x1dfbe6['query'][_0xac16('0x1f')]);_0x553a38[_0xac16('0x1d')]=qs[_0xac16('0x1d')](_0x1dfbe6[_0xac16('0x35')]['offset']);}_0x553a38[_0xac16('0x3a')]=qs['sort'](_0x1dfbe6[_0xac16('0x35')][_0xac16('0x3b')]);_0x553a38['where']=qs[_0xac16('0x3c')](_[_0xac16('0x3d')](_0x1dfbe6[_0xac16('0x35')],_0x580dfd['filters']),_0x550919);if(_0x1dfbe6[_0xac16('0x35')][_0xac16('0x3e')]){_0x553a38['where']=_[_0xac16('0x3f')](_0x553a38['where'],{'$or':_['map'](_0x550919,function(_0x33ea1e){if(_0x33ea1e[_0xac16('0x31')]!=='VIRTUAL'){var _0x761d63={};_0x761d63[_0x33ea1e[_0xac16('0x2a')]]={'$like':'%'+_0x1dfbe6[_0xac16('0x35')]['filter']+'%'};return _0x761d63;}})});}_0x553a38=_['merge']({},_0x553a38,_0x1dfbe6[_0xac16('0x40')]);var _0x512e76={'where':_0x553a38[_0xac16('0x41')]};return db[_0xac16('0x2e')][_0xac16('0x20')](_0x512e76)[_0xac16('0x26')](function(_0x59fac4){_0x3683b4['count']=_0x59fac4;if(_0x1dfbe6[_0xac16('0x35')][_0xac16('0x42')]){_0x553a38['include']=[{'all':!![]}];}return db[_0xac16('0x2e')][_0xac16('0x43')](_0x553a38);})[_0xac16('0x26')](function(_0x2d957d){_0x3683b4[_0xac16('0x44')]=_0x2d957d;return _0x3683b4;})[_0xac16('0x26')](respondWithFilteredResult(_0x35d208,_0x553a38))[_0xac16('0x45')](handleError(_0x35d208,null));};exports[_0xac16('0x46')]=function(_0x3ecea2,_0x2f301d){var _0x1f193d={'raw':![],'where':{'id':_0x3ecea2[_0xac16('0x47')]['id']}},_0x554270={};_0x554270[_0xac16('0x33')]=_[_0xac16('0x34')](db[_0xac16('0x2e')][_0xac16('0x2f')]);_0x554270[_0xac16('0x35')]=_['keys'](_0x3ecea2[_0xac16('0x35')]);_0x554270[_0xac16('0x3c')]=_['intersection'](_0x554270['model'],_0x554270['query']);_0x1f193d[_0xac16('0x38')]=_[_0xac16('0x36')](_0x554270[_0xac16('0x33')],qs[_0xac16('0x37')](_0x3ecea2[_0xac16('0x35')][_0xac16('0x37')]));_0x1f193d['attributes']=_0x1f193d[_0xac16('0x38')][_0xac16('0x48')]?_0x1f193d[_0xac16('0x38')]:_0x554270[_0xac16('0x33')];if(_0x3ecea2[_0xac16('0x35')][_0xac16('0x42')]){_0x1f193d['include']=[{'all':!![]}];}_0x1f193d=_[_0xac16('0x3f')]({},_0x1f193d,_0x3ecea2[_0xac16('0x40')]);return db[_0xac16('0x2e')]['find'](_0x1f193d)[_0xac16('0x26')](handleEntityNotFound(_0x2f301d,null))[_0xac16('0x26')](respondWithResult(_0x2f301d,null))['catch'](handleError(_0x2f301d,null));};exports['create']=function(_0x3b07c7,_0x535b2c){return db[_0xac16('0x2e')][_0xac16('0x49')](_0x3b07c7['body'],{})[_0xac16('0x26')](respondWithResult(_0x535b2c,0xc9))[_0xac16('0x45')](handleError(_0x535b2c,null));};exports[_0xac16('0x25')]=function(_0x52adf0,_0x1e246e){if(_0x52adf0['body']['id']){delete _0x52adf0['body']['id'];}return db[_0xac16('0x2e')][_0xac16('0x4a')]({'where':{'id':_0x52adf0[_0xac16('0x47')]['id']}})[_0xac16('0x26')](handleEntityNotFound(_0x1e246e,null))[_0xac16('0x26')](saveUpdates(_0x52adf0[_0xac16('0x4b')],null))[_0xac16('0x26')](respondWithResult(_0x1e246e,null))[_0xac16('0x45')](handleError(_0x1e246e,null));};exports[_0xac16('0x27')]=function(_0x11eac3,_0x121a16){return db[_0xac16('0x2e')][_0xac16('0x4a')]({'where':{'id':_0x11eac3[_0xac16('0x47')]['id']}})[_0xac16('0x26')](handleEntityNotFound(_0x121a16,null))['then'](removeEntity(_0x121a16,null))[_0xac16('0x45')](handleError(_0x121a16,null));};exports['addConditions']=function(_0x4840a5,_0x59d6e5,_0x2c59d9){return db[_0xac16('0x4c')][_0xac16('0x4a')]({'where':{'id':_0x4840a5[_0xac16('0x47')]['id']}})[_0xac16('0x26')](handleEntityNotFound(_0x59d6e5,null))['then'](function(_0x286f73){if(_0x286f73){return _0x286f73[_0xac16('0x4d')](_0x4840a5[_0xac16('0x4b')]['ids'],_['omit'](_0x4840a5[_0xac16('0x4b')],[_0xac16('0x4e'),'id'])||{});}})[_0xac16('0x26')](respondWithResult(_0x59d6e5,null))['catch'](handleError(_0x59d6e5,null));};exports['getConditions']=function(_0x2bfe3f,_0x4f3a9c,_0x37bcc4){var _0x179c5={};var _0x2583b9={};var _0x248c2d;var _0x154f76;return db[_0xac16('0x2e')]['findOne']({'where':{'id':_0x2bfe3f[_0xac16('0x47')]['id']}})[_0xac16('0x26')](handleEntityNotFound(_0x4f3a9c,null))[_0xac16('0x26')](function(_0x175d0a){if(_0x175d0a){_0x248c2d=_0x175d0a;_0x2583b9[_0xac16('0x33')]=_[_0xac16('0x34')](db[_0xac16('0x4c')]['rawAttributes']);_0x2583b9['query']=_[_0xac16('0x34')](_0x2bfe3f[_0xac16('0x35')]);_0x2583b9[_0xac16('0x3c')]=_['intersection'](_0x2583b9['model'],_0x2583b9['query']);_0x179c5['attributes']=_['intersection'](_0x2583b9[_0xac16('0x33')],qs[_0xac16('0x37')](_0x2bfe3f[_0xac16('0x35')]['fields']));_0x179c5[_0xac16('0x38')]=_0x179c5['attributes'][_0xac16('0x48')]?_0x179c5[_0xac16('0x38')]:_0x2583b9['model'];_0x179c5[_0xac16('0x3a')]=qs['sort'](_0x2bfe3f[_0xac16('0x35')][_0xac16('0x3b')]);_0x179c5[_0xac16('0x41')]=qs[_0xac16('0x3c')](_[_0xac16('0x3d')](_0x2bfe3f[_0xac16('0x35')],_0x2583b9[_0xac16('0x3c')]));if(_0x2bfe3f[_0xac16('0x35')]['filter']){_0x179c5['where']=_[_0xac16('0x3f')](_0x179c5[_0xac16('0x41')],{'$or':_[_0xac16('0x2d')](_0x179c5[_0xac16('0x38')],function(_0x5acd05){var _0x3927eb={};_0x3927eb[_0x5acd05]={'$like':'%'+_0x2bfe3f[_0xac16('0x35')]['filter']+'%'};return _0x3927eb;})});}_0x179c5=_[_0xac16('0x3f')]({},_0x179c5,_0x2bfe3f[_0xac16('0x40')]);return _0x248c2d[_0xac16('0x4f')](_0x179c5);}})['then'](function(_0x379d91){if(_0x379d91){_0x154f76=_0x379d91['length'];if(!_0x2bfe3f[_0xac16('0x35')][_0xac16('0x50')](_0xac16('0x39'))){_0x179c5[_0xac16('0x1f')]=qs[_0xac16('0x1f')](_0x2bfe3f['query']['limit']);_0x179c5[_0xac16('0x1d')]=qs[_0xac16('0x1d')](_0x2bfe3f[_0xac16('0x35')][_0xac16('0x1d')]);}return _0x248c2d[_0xac16('0x4f')](_0x179c5);}})[_0xac16('0x26')](function(_0x2c660a){if(_0x2c660a){return _0x2c660a?{'count':_0x154f76,'rows':_0x2c660a}:null;}})[_0xac16('0x26')](respondWithResult(_0x4f3a9c,null))[_0xac16('0x45')](handleError(_0x4f3a9c,null));};exports[_0xac16('0x51')]=function(_0x27f9e0,_0x4c2ec4,_0x5cba6a){return db[_0xac16('0x52')]['find']({'where':{'id':_0x27f9e0[_0xac16('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c2ec4,null))[_0xac16('0x26')](function(_0x2da1a3){if(_0x2da1a3){return _0x2da1a3[_0xac16('0x51')](_0x27f9e0[_0xac16('0x4b')][_0xac16('0x4e')],_['omit'](_0x27f9e0[_0xac16('0x4b')],[_0xac16('0x4e'),'id'])||{});}})[_0xac16('0x26')](respondWithResult(_0x4c2ec4,null))['catch'](handleError(_0x4c2ec4,null));};exports[_0xac16('0x53')]=function(_0x9a3e3,_0x46e7dd,_0x87e1a7){var _0x340930={};var _0x3e142b={};var _0xfe5313;var _0x5b7729;return db['Automation'][_0xac16('0x54')]({'where':{'id':_0x9a3e3[_0xac16('0x47')]['id']}})[_0xac16('0x26')](handleEntityNotFound(_0x46e7dd,null))[_0xac16('0x26')](function(_0x477c31){if(_0x477c31){_0xfe5313=_0x477c31;_0x3e142b[_0xac16('0x33')]=_[_0xac16('0x34')](db[_0xac16('0x52')][_0xac16('0x2f')]);_0x3e142b['query']=_[_0xac16('0x34')](_0x9a3e3[_0xac16('0x35')]);_0x3e142b[_0xac16('0x3c')]=_[_0xac16('0x36')](_0x3e142b['model'],_0x3e142b[_0xac16('0x35')]);_0x340930[_0xac16('0x38')]=_[_0xac16('0x36')](_0x3e142b[_0xac16('0x33')],qs[_0xac16('0x37')](_0x9a3e3['query'][_0xac16('0x37')]));_0x340930[_0xac16('0x38')]=_0x340930[_0xac16('0x38')][_0xac16('0x48')]?_0x340930['attributes']:_0x3e142b[_0xac16('0x33')];_0x340930[_0xac16('0x3a')]=qs[_0xac16('0x3b')](_0x9a3e3[_0xac16('0x35')][_0xac16('0x3b')]);_0x340930['where']=qs[_0xac16('0x3c')](_[_0xac16('0x3d')](_0x9a3e3['query'],_0x3e142b['filters']));if(_0x9a3e3[_0xac16('0x35')][_0xac16('0x3e')]){_0x340930[_0xac16('0x41')]=_[_0xac16('0x3f')](_0x340930[_0xac16('0x41')],{'$or':_[_0xac16('0x2d')](_0x340930[_0xac16('0x38')],function(_0x44d962){var _0x54f547={};_0x54f547[_0x44d962]={'$like':'%'+_0x9a3e3[_0xac16('0x35')][_0xac16('0x3e')]+'%'};return _0x54f547;})});}_0x340930=_['merge']({},_0x340930,_0x9a3e3[_0xac16('0x40')]);return _0xfe5313[_0xac16('0x53')](_0x340930);}})[_0xac16('0x26')](function(_0x31ee61){if(_0x31ee61){_0x5b7729=_0x31ee61[_0xac16('0x48')];if(!_0x9a3e3[_0xac16('0x35')][_0xac16('0x50')](_0xac16('0x39'))){_0x340930[_0xac16('0x1f')]=qs[_0xac16('0x1f')](_0x9a3e3['query'][_0xac16('0x1f')]);_0x340930[_0xac16('0x1d')]=qs[_0xac16('0x1d')](_0x9a3e3[_0xac16('0x35')][_0xac16('0x1d')]);}return _0xfe5313['getActions'](_0x340930);}})[_0xac16('0x26')](function(_0x56e0a3){if(_0x56e0a3){return _0x56e0a3?{'count':_0x5b7729,'rows':_0x56e0a3}:null;}})[_0xac16('0x26')](respondWithResult(_0x46e7dd,null))['catch'](handleError(_0x46e7dd,null));}; \ No newline at end of file +var _0x8fad=['create','body','Condition','addConditions','ids','omit','getConditions','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','Automation','find'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8fad,0x1a4));var _0xd8fa=function(_0x19e540,_0x597c37){_0x19e540=_0x19e540-0x0;var _0x2fefb6=_0x8fad[_0x19e540];return _0x2fefb6;};'use strict';var emlformat=require(_0xd8fa('0x0'));var rimraf=require(_0xd8fa('0x1'));var zipdir=require(_0xd8fa('0x2'));var jsonpatch=require(_0xd8fa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8fa('0x4'));var Mustache=require(_0xd8fa('0x5'));var util=require('util');var path=require(_0xd8fa('0x6'));var sox=require(_0xd8fa('0x7'));var csv=require(_0xd8fa('0x8'));var ejs=require(_0xd8fa('0x9'));var fs=require('fs');var fs_extra=require(_0xd8fa('0xa'));var _=require(_0xd8fa('0xb'));var squel=require(_0xd8fa('0xc'));var crypto=require(_0xd8fa('0xd'));var jsforce=require(_0xd8fa('0xe'));var deskjs=require(_0xd8fa('0xf'));var toCsv=require(_0xd8fa('0x8'));var querystring=require(_0xd8fa('0x10'));var Papa=require(_0xd8fa('0x11'));var Redis=require('ioredis');var authService=require(_0xd8fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd8fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8fa('0x14'))('api');var utils=require(_0xd8fa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd8fa('0x16'));var db=require(_0xd8fa('0x17'))['db'];function respondWithStatusCode(_0x51c64b,_0x272548){_0x272548=_0x272548||0xcc;return function(_0x35d263){if(_0x35d263){return _0x51c64b[_0xd8fa('0x18')](_0x272548);}return _0x51c64b[_0xd8fa('0x19')](_0x272548)[_0xd8fa('0x1a')]();};}function respondWithResult(_0x246819,_0xfaec91){_0xfaec91=_0xfaec91||0xc8;return function(_0x550da5){if(_0x550da5){return _0x246819[_0xd8fa('0x19')](_0xfaec91)[_0xd8fa('0x1b')](_0x550da5);}};}function respondWithFilteredResult(_0x42dc5e,_0x3afa46){return function(_0x3e65e3){if(_0x3e65e3){var _0x1d1afb=typeof _0x3afa46[_0xd8fa('0x1c')]===_0xd8fa('0x1d')&&typeof _0x3afa46[_0xd8fa('0x1e')]===_0xd8fa('0x1d');var _0x468056=_0x3e65e3[_0xd8fa('0x1f')];var _0x48a019=_0x1d1afb?0x0:_0x3afa46['offset'];var _0x54f28d=_0x1d1afb?_0x3e65e3[_0xd8fa('0x1f')]:_0x3afa46[_0xd8fa('0x1c')]+_0x3afa46[_0xd8fa('0x1e')];var _0x313d93;if(_0x54f28d>=_0x468056){_0x54f28d=_0x468056;_0x313d93=0xc8;}else{_0x313d93=0xce;}_0x42dc5e['status'](_0x313d93);return _0x42dc5e[_0xd8fa('0x20')](_0xd8fa('0x21'),_0x48a019+'-'+_0x54f28d+'/'+_0x468056)[_0xd8fa('0x1b')](_0x3e65e3);}return null;};}function patchUpdates(_0x33f94a){return function(_0x3d28c1){try{jsonpatch[_0xd8fa('0x22')](_0x3d28c1,_0x33f94a,!![]);}catch(_0x105286){return BPromise['reject'](_0x105286);}return _0x3d28c1[_0xd8fa('0x23')]();};}function saveUpdates(_0x117f93,_0x37b27b){return function(_0x54e737){if(_0x54e737){return _0x54e737[_0xd8fa('0x24')](_0x117f93)[_0xd8fa('0x25')](function(_0x16e7dc){return _0x16e7dc;});}return null;};}function removeEntity(_0x222c34,_0x55dd27){return function(_0x4e7106){if(_0x4e7106){return _0x4e7106[_0xd8fa('0x26')]()['then'](function(){_0x222c34[_0xd8fa('0x19')](0xcc)[_0xd8fa('0x1a')]();});}};}function handleEntityNotFound(_0x3d679e,_0x2f4b30){return function(_0x5c535f){if(!_0x5c535f){_0x3d679e['sendStatus'](0x194);}return _0x5c535f;};}function handleError(_0x55967c,_0x365982){_0x365982=_0x365982||0x1f4;return function(_0x12ba4f){logger[_0xd8fa('0x27')](_0x12ba4f['stack']);if(_0x12ba4f[_0xd8fa('0x28')]){delete _0x12ba4f[_0xd8fa('0x28')];}_0x55967c[_0xd8fa('0x19')](_0x365982)['send'](_0x12ba4f);};}exports['index']=function(_0x5b37a3,_0x53f446){var _0x23711d={},_0x50e99f={},_0x3d061e={'count':0x0,'rows':[]};var _0xfd6ac=_[_0xd8fa('0x29')](db['Automation'][_0xd8fa('0x2a')],function(_0x5209d7){return{'name':_0x5209d7[_0xd8fa('0x2b')],'type':_0x5209d7[_0xd8fa('0x2c')][_0xd8fa('0x2d')]};});_0x50e99f[_0xd8fa('0x2e')]=_[_0xd8fa('0x29')](_0xfd6ac,_0xd8fa('0x28'));_0x50e99f['query']=_[_0xd8fa('0x2f')](_0x5b37a3['query']);_0x50e99f[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x50e99f['model'],_0x50e99f['query']);_0x23711d['attributes']=_[_0xd8fa('0x31')](_0x50e99f[_0xd8fa('0x2e')],qs['fields'](_0x5b37a3['query']['fields']));_0x23711d['attributes']=_0x23711d[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x23711d[_0xd8fa('0x32')]:_0x50e99f['model'];if(!_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x35')](_0xd8fa('0x36'))){_0x23711d['limit']=qs[_0xd8fa('0x1e')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x1e')]);_0x23711d[_0xd8fa('0x1c')]=qs[_0xd8fa('0x1c')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x1c')]);}_0x23711d[_0xd8fa('0x37')]=qs[_0xd8fa('0x38')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x38')]);_0x23711d[_0xd8fa('0x39')]=qs[_0xd8fa('0x30')](_['pick'](_0x5b37a3[_0xd8fa('0x34')],_0x50e99f[_0xd8fa('0x30')]),_0xfd6ac);if(_0x5b37a3['query'][_0xd8fa('0x3a')]){_0x23711d[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x23711d[_0xd8fa('0x39')],{'$or':_['map'](_0xfd6ac,function(_0x2ac500){if(_0x2ac500[_0xd8fa('0x2c')]!==_0xd8fa('0x3c')){var _0x5726cc={};_0x5726cc[_0x2ac500['name']]={'$like':'%'+_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x5726cc;}})});}_0x23711d=_[_0xd8fa('0x3b')]({},_0x23711d,_0x5b37a3[_0xd8fa('0x3d')]);var _0x650ea7={'where':_0x23711d[_0xd8fa('0x39')]};return db['Automation'][_0xd8fa('0x1f')](_0x650ea7)[_0xd8fa('0x25')](function(_0x18476a){_0x3d061e['count']=_0x18476a;if(_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x3e')]){_0x23711d['include']=[{'all':!![]}];}return db['Automation'][_0xd8fa('0x3f')](_0x23711d);})[_0xd8fa('0x25')](function(_0x209e71){_0x3d061e[_0xd8fa('0x40')]=_0x209e71;return _0x3d061e;})[_0xd8fa('0x25')](respondWithFilteredResult(_0x53f446,_0x23711d))[_0xd8fa('0x41')](handleError(_0x53f446,null));};exports[_0xd8fa('0x42')]=function(_0x83eb25,_0x4702a2){var _0x5269fd={'raw':![],'where':{'id':_0x83eb25[_0xd8fa('0x43')]['id']}},_0x3c2dc5={};_0x3c2dc5[_0xd8fa('0x2e')]=_[_0xd8fa('0x2f')](db['Automation'][_0xd8fa('0x2a')]);_0x3c2dc5[_0xd8fa('0x34')]=_['keys'](_0x83eb25[_0xd8fa('0x34')]);_0x3c2dc5['filters']=_[_0xd8fa('0x31')](_0x3c2dc5['model'],_0x3c2dc5[_0xd8fa('0x34')]);_0x5269fd[_0xd8fa('0x32')]=_[_0xd8fa('0x31')](_0x3c2dc5[_0xd8fa('0x2e')],qs[_0xd8fa('0x44')](_0x83eb25[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x5269fd[_0xd8fa('0x32')]=_0x5269fd[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x5269fd['attributes']:_0x3c2dc5[_0xd8fa('0x2e')];if(_0x83eb25[_0xd8fa('0x34')]['includeAll']){_0x5269fd[_0xd8fa('0x45')]=[{'all':!![]}];}_0x5269fd=_[_0xd8fa('0x3b')]({},_0x5269fd,_0x83eb25[_0xd8fa('0x3d')]);return db[_0xd8fa('0x46')][_0xd8fa('0x47')](_0x5269fd)[_0xd8fa('0x25')](handleEntityNotFound(_0x4702a2,null))[_0xd8fa('0x25')](respondWithResult(_0x4702a2,null))[_0xd8fa('0x41')](handleError(_0x4702a2,null));};exports['create']=function(_0x18840e,_0x48887b){return db[_0xd8fa('0x46')][_0xd8fa('0x48')](_0x18840e[_0xd8fa('0x49')],{})['then'](respondWithResult(_0x48887b,0xc9))[_0xd8fa('0x41')](handleError(_0x48887b,null));};exports[_0xd8fa('0x24')]=function(_0x3725fb,_0x568930){if(_0x3725fb['body']['id']){delete _0x3725fb['body']['id'];}return db[_0xd8fa('0x46')]['find']({'where':{'id':_0x3725fb[_0xd8fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x568930,null))['then'](saveUpdates(_0x3725fb[_0xd8fa('0x49')],null))[_0xd8fa('0x25')](respondWithResult(_0x568930,null))[_0xd8fa('0x41')](handleError(_0x568930,null));};exports['destroy']=function(_0x3428a1,_0x870a57){return db[_0xd8fa('0x46')][_0xd8fa('0x47')]({'where':{'id':_0x3428a1[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x870a57,null))[_0xd8fa('0x25')](removeEntity(_0x870a57,null))[_0xd8fa('0x41')](handleError(_0x870a57,null));};exports['addConditions']=function(_0x1294f5,_0x3b487a,_0xf5b97e){return db[_0xd8fa('0x4a')]['find']({'where':{'id':_0x1294f5[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x3b487a,null))[_0xd8fa('0x25')](function(_0x4d0d5a){if(_0x4d0d5a){return _0x4d0d5a[_0xd8fa('0x4b')](_0x1294f5[_0xd8fa('0x49')][_0xd8fa('0x4c')],_[_0xd8fa('0x4d')](_0x1294f5[_0xd8fa('0x49')],[_0xd8fa('0x4c'),'id'])||{});}})[_0xd8fa('0x25')](respondWithResult(_0x3b487a,null))[_0xd8fa('0x41')](handleError(_0x3b487a,null));};exports['getConditions']=function(_0x306871,_0x304580,_0x1ef13f){var _0x403c7f={};var _0x2608be={};var _0x5462b8;var _0xfa3e8a;return db[_0xd8fa('0x46')]['findOne']({'where':{'id':_0x306871[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x304580,null))[_0xd8fa('0x25')](function(_0x56f4dc){if(_0x56f4dc){_0x5462b8=_0x56f4dc;_0x2608be[_0xd8fa('0x2e')]=_['keys'](db['Condition'][_0xd8fa('0x2a')]);_0x2608be[_0xd8fa('0x34')]=_['keys'](_0x306871[_0xd8fa('0x34')]);_0x2608be[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x2608be[_0xd8fa('0x2e')],_0x2608be['query']);_0x403c7f['attributes']=_['intersection'](_0x2608be[_0xd8fa('0x2e')],qs['fields'](_0x306871[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x403c7f[_0xd8fa('0x32')]=_0x403c7f[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x403c7f[_0xd8fa('0x32')]:_0x2608be[_0xd8fa('0x2e')];_0x403c7f[_0xd8fa('0x37')]=qs['sort'](_0x306871[_0xd8fa('0x34')]['sort']);_0x403c7f[_0xd8fa('0x39')]=qs[_0xd8fa('0x30')](_['pick'](_0x306871['query'],_0x2608be[_0xd8fa('0x30')]));if(_0x306871[_0xd8fa('0x34')]['filter']){_0x403c7f[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x403c7f['where'],{'$or':_['map'](_0x403c7f[_0xd8fa('0x32')],function(_0x445b25){var _0x18c74f={};_0x18c74f[_0x445b25]={'$like':'%'+_0x306871[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x18c74f;})});}_0x403c7f=_[_0xd8fa('0x3b')]({},_0x403c7f,_0x306871[_0xd8fa('0x3d')]);return _0x5462b8[_0xd8fa('0x4e')](_0x403c7f);}})[_0xd8fa('0x25')](function(_0x25d758){if(_0x25d758){_0xfa3e8a=_0x25d758['length'];if(!_0x306871['query'][_0xd8fa('0x35')](_0xd8fa('0x36'))){_0x403c7f['limit']=qs['limit'](_0x306871[_0xd8fa('0x34')][_0xd8fa('0x1e')]);_0x403c7f['offset']=qs[_0xd8fa('0x1c')](_0x306871['query'][_0xd8fa('0x1c')]);}return _0x5462b8[_0xd8fa('0x4e')](_0x403c7f);}})[_0xd8fa('0x25')](function(_0x2e2d32){if(_0x2e2d32){return _0x2e2d32?{'count':_0xfa3e8a,'rows':_0x2e2d32}:null;}})[_0xd8fa('0x25')](respondWithResult(_0x304580,null))[_0xd8fa('0x41')](handleError(_0x304580,null));};exports['addActions']=function(_0x5676a7,_0x22f268,_0xb14774){return db[_0xd8fa('0x4f')][_0xd8fa('0x47')]({'where':{'id':_0x5676a7['params']['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x22f268,null))[_0xd8fa('0x25')](function(_0x54c9c9){if(_0x54c9c9){return _0x54c9c9['addActions'](_0x5676a7[_0xd8fa('0x49')]['ids'],_[_0xd8fa('0x4d')](_0x5676a7[_0xd8fa('0x49')],[_0xd8fa('0x4c'),'id'])||{});}})[_0xd8fa('0x25')](respondWithResult(_0x22f268,null))[_0xd8fa('0x41')](handleError(_0x22f268,null));};exports[_0xd8fa('0x50')]=function(_0x2f38d9,_0x639d0,_0x3d3040){var _0x533caf={};var _0x248982={};var _0x309b9a;var _0x46661a;return db[_0xd8fa('0x46')]['findOne']({'where':{'id':_0x2f38d9[_0xd8fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x639d0,null))['then'](function(_0x45421a){if(_0x45421a){_0x309b9a=_0x45421a;_0x248982[_0xd8fa('0x2e')]=_[_0xd8fa('0x2f')](db[_0xd8fa('0x4f')][_0xd8fa('0x2a')]);_0x248982[_0xd8fa('0x34')]=_['keys'](_0x2f38d9[_0xd8fa('0x34')]);_0x248982[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x248982['model'],_0x248982['query']);_0x533caf[_0xd8fa('0x32')]=_[_0xd8fa('0x31')](_0x248982['model'],qs[_0xd8fa('0x44')](_0x2f38d9[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x533caf[_0xd8fa('0x32')]=_0x533caf['attributes'][_0xd8fa('0x33')]?_0x533caf[_0xd8fa('0x32')]:_0x248982[_0xd8fa('0x2e')];_0x533caf[_0xd8fa('0x37')]=qs[_0xd8fa('0x38')](_0x2f38d9['query'][_0xd8fa('0x38')]);_0x533caf['where']=qs[_0xd8fa('0x30')](_[_0xd8fa('0x51')](_0x2f38d9[_0xd8fa('0x34')],_0x248982[_0xd8fa('0x30')]));if(_0x2f38d9['query'][_0xd8fa('0x3a')]){_0x533caf[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x533caf['where'],{'$or':_[_0xd8fa('0x29')](_0x533caf[_0xd8fa('0x32')],function(_0x428d50){var _0x370eff={};_0x370eff[_0x428d50]={'$like':'%'+_0x2f38d9[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x370eff;})});}_0x533caf=_['merge']({},_0x533caf,_0x2f38d9['options']);return _0x309b9a['getActions'](_0x533caf);}})[_0xd8fa('0x25')](function(_0xc8e648){if(_0xc8e648){_0x46661a=_0xc8e648[_0xd8fa('0x33')];if(!_0x2f38d9[_0xd8fa('0x34')]['hasOwnProperty'](_0xd8fa('0x36'))){_0x533caf[_0xd8fa('0x1e')]=qs[_0xd8fa('0x1e')](_0x2f38d9['query'][_0xd8fa('0x1e')]);_0x533caf[_0xd8fa('0x1c')]=qs[_0xd8fa('0x1c')](_0x2f38d9[_0xd8fa('0x34')]['offset']);}return _0x309b9a[_0xd8fa('0x50')](_0x533caf);}})[_0xd8fa('0x25')](function(_0x118ffc){if(_0x118ffc){return _0x118ffc?{'count':_0x46661a,'rows':_0x118ffc}:null;}})[_0xd8fa('0x25')](respondWithResult(_0x639d0,null))['catch'](handleError(_0x639d0,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index bcdc3da..3ccba71 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 _0x9851=['request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','bluebird'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x9851,0x75));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1985('0x0'));var util=require(_0x1985('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1985('0x2'));var rp=require(_0x1985('0x3'));var fs=require('fs');var path=require(_0x1985('0x4'));var rimraf=require('rimraf');var config=require(_0x1985('0x5'));var attributes=require(_0x1985('0x6'));module[_0x1985('0x7')]=function(_0x5610ab,_0x3872bc){return _0x5610ab[_0x1985('0x8')]('Automation',attributes,{'tableName':_0x1985('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd558=['util','../../config/logger','api','moment','request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xd558,0xb3));var _0x8d55=function(_0x26bf59,_0x3fd050){_0x26bf59=_0x26bf59-0x0;var _0x14a039=_0xd558[_0x26bf59];return _0x14a039;};'use strict';var _=require(_0x8d55('0x0'));var util=require(_0x8d55('0x1'));var logger=require(_0x8d55('0x2'))(_0x8d55('0x3'));var moment=require(_0x8d55('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d55('0x5'));var fs=require('fs');var path=require(_0x8d55('0x6'));var rimraf=require(_0x8d55('0x7'));var config=require('../../config/environment');var attributes=require(_0x8d55('0x8'));module[_0x8d55('0x9')]=function(_0x33e204,_0x4a4317){return _0x33e204[_0x8d55('0xa')]('Automation',attributes,{'tableName':_0x8d55('0xb'),'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 9278ba4..990ee7b 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 _0xa7b5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a4062,_0x45c9b2){var _0x2def78=function(_0x2b5eff){while(--_0x2b5eff){_0x4a4062['push'](_0x4a4062['shift']());}};_0x2def78(++_0x45c9b2);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x56ad8c,_0x1772d1){_0x56ad8c=_0x56ad8c-0x0;var _0x2e2c11=_0xa7b5[_0x56ad8c];return _0x2e2c11;};'use strict';var _=require(_0x5a7b('0x0'));var util=require('util');var moment=require(_0x5a7b('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a7b('0x2'));var fs=require('fs');var Redis=require(_0x5a7b('0x3'));var db=require(_0x5a7b('0x4'))['db'];var utils=require(_0x5a7b('0x5'));var logger=require(_0x5a7b('0x6'))(_0x5a7b('0x7'));var config=require(_0x5a7b('0x8'));var jayson=require(_0x5a7b('0x9'));var client=jayson[_0x5a7b('0xa')][_0x5a7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f8f95,_0x493ae6,_0x2cd623){return new BPromise(function(_0x24b80c,_0x7a3ae){return client[_0x5a7b('0xc')](_0x1f8f95,_0x2cd623)[_0x5a7b('0xd')](function(_0x4070ee){logger['info']('Automation,\x20%s,\x20%s',_0x493ae6,_0x5a7b('0xe'));logger['debug'](_0x5a7b('0xf'),_0x493ae6,_0x5a7b('0xe'),JSON[_0x5a7b('0x10')](_0x4070ee));if(_0x4070ee[_0x5a7b('0x11')]){if(_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x12')]===0x1f4){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x7a3ae(_0x4070ee[_0x5a7b('0x11')]['message']);}logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x24b80c(_0x4070ee['error'][_0x5a7b('0x14')]);}else{logger[_0x5a7b('0x15')]('Automation,\x20%s,\x20%s',_0x493ae6,_0x5a7b('0xe'));_0x24b80c(_0x4070ee['result'][_0x5a7b('0x14')]);}})['catch'](function(_0x340241){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x340241);_0x7a3ae(_0x340241);});});} \ No newline at end of file +var _0xf603=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xf603,0xeb));var _0x3f60=function(_0x34890c,_0x3ca746){_0x34890c=_0x34890c-0x0;var _0x129ef6=_0xf603[_0x34890c];return _0x129ef6;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require(_0x3f60('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))('rpc');var config=require(_0x3f60('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec43c,_0x375f1e,_0x17659b){return new BPromise(function(_0x434249,_0x9282dd){return client['request'](_0x1ec43c,_0x17659b)[_0x3f60('0xa')](function(_0x33dcc8){logger[_0x3f60('0xb')](_0x3f60('0xc'),_0x375f1e,'request\x20sent');logger['debug'](_0x3f60('0xd'),_0x375f1e,_0x3f60('0xe'),JSON[_0x3f60('0xf')](_0x33dcc8));if(_0x33dcc8['error']){if(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x11')]===0x1f4){logger[_0x3f60('0x10')]('Automation,\x20%s,\x20%s',_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x9282dd(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);}logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x434249(_0x33dcc8['error']['message']);}else{logger['info'](_0x3f60('0xc'),_0x375f1e,_0x3f60('0xe'));_0x434249(_0x33dcc8[_0x3f60('0x13')][_0x3f60('0x12')]);}})[_0x3f60('0x14')](function(_0x224982){logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x224982);_0x9282dd(_0x224982);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c693aaa..7aeb653 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 _0xb2b3=['/:id/actions','getActions','post','addConditions','addActions','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions'];(function(_0x9e52a3,_0x48443b){var _0x4ca899=function(_0x5d496a){while(--_0x5d496a){_0x9e52a3['push'](_0x9e52a3['shift']());}};_0x4ca899(++_0x48443b);}(_0xb2b3,0x71));var _0x3b2b=function(_0x18bd30,_0x1f6c5d){_0x18bd30=_0x18bd30-0x0;var _0x20ff41=_0xb2b3[_0x18bd30];return _0x20ff41;};'use strict';var multer=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var path=require(_0x3b2b('0x2'));var timeout=require(_0x3b2b('0x3'));var express=require(_0x3b2b('0x4'));var router=express[_0x3b2b('0x5')]();var fs_extra=require(_0x3b2b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3b2b('0x7'));var config=require(_0x3b2b('0x8'));var controller=require(_0x3b2b('0x9'));router[_0x3b2b('0xa')]('/',auth[_0x3b2b('0xb')](),controller[_0x3b2b('0xc')]);router[_0x3b2b('0xa')](_0x3b2b('0xd'),auth[_0x3b2b('0xb')](),controller[_0x3b2b('0xe')]);router[_0x3b2b('0xa')](_0x3b2b('0xf'),auth['isAuthenticated'](),controller[_0x3b2b('0x10')]);router[_0x3b2b('0xa')](_0x3b2b('0x11'),auth[_0x3b2b('0xb')](),controller[_0x3b2b('0x12')]);router[_0x3b2b('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b2b('0x13')](_0x3b2b('0xf'),auth[_0x3b2b('0xb')](),controller[_0x3b2b('0x14')]);router['post'](_0x3b2b('0x11'),auth[_0x3b2b('0xb')](),controller[_0x3b2b('0x15')]);router[_0x3b2b('0x16')](_0x3b2b('0xd'),auth[_0x3b2b('0xb')](),controller['update']);router[_0x3b2b('0x17')](_0x3b2b('0xd'),auth['isAuthenticated'](),controller[_0x3b2b('0x18')]);module[_0x3b2b('0x19')]=router; \ No newline at end of file +var _0xc5b1=['getActions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x5d0b34,_0x20557b){var _0x472a0f=function(_0x3e7ff9){while(--_0x3e7ff9){_0x5d0b34['push'](_0x5d0b34['shift']());}};_0x472a0f(++_0x20557b);}(_0xc5b1,0x106));var _0x1c5b=function(_0x55889e,_0x466fbf){_0x55889e=_0x55889e-0x0;var _0x48a697=_0xc5b1[_0x55889e];return _0x48a697;};'use strict';var multer=require(_0x1c5b('0x0'));var util=require(_0x1c5b('0x1'));var path=require(_0x1c5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c5b('0x4'));var config=require(_0x1c5b('0x5'));var controller=require('./automation.controller');router[_0x1c5b('0x6')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x7')]);router[_0x1c5b('0x6')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xa')]);router['get'](_0x1c5b('0xb'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xc')]);router[_0x1c5b('0x6')](_0x1c5b('0xd'),auth['isAuthenticated'](),controller[_0x1c5b('0xe')]);router[_0x1c5b('0xf')]('/',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x10')]);router[_0x1c5b('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x1c5b('0x11')]);router['post']('/:id/actions',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x12')]);router[_0x1c5b('0x13')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x14')]);router['delete'](_0x1c5b('0x8'),auth['isAuthenticated'](),controller[_0x1c5b('0x15')]);module[_0x1c5b('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e11fd29..682bf40 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 _0x9b2a=['name','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','BOOLEAN','#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)','ENUM','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)','#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','STRING'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x9b2a,0x8a));var _0xa9b2=function(_0x9816ec,_0xe0a77b){_0x9816ec=_0x9816ec-0x0;var _0x29d374=_0x9b2a[_0x9816ec];return _0x29d374;};'use strict';var Sequelize=require(_0xa9b2('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9b2('0x1')],'unique':_0xa9b2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xa9b2('0x3')},'description':{'type':Sequelize[_0xa9b2('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xa9b2('0x4')](0x4)[_0xa9b2('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa9b2('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa9b2('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa9b2('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa9b2('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa9b2('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa9b2('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa9b2('0x8')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa9b2('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa9b2('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa9b2('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa9b2('0x4')](0x3)[_0xa9b2('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa9b2('0x4')](0x5)[_0xa9b2('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa9b2('0xa')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa9b2('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa9b2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa9b2('0x1')],'defaultValue':_0xa9b2('0xb')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xa9b2('0xc'),_0xa9b2('0xd')),'defaultValue':_0xa9b2('0xe')},'dialAMDActive':{'type':Sequelize[_0xa9b2('0xf')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xa9b2('0x4')](0x9)[_0xa9b2('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa9b2('0x10')},'dialAMDGreeting':{'type':Sequelize[_0xa9b2('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa9b2('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa9b2('0x4')](0x9)[_0xa9b2('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa9b2('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa9b2('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xa9b2('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa9b2('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa9b2('0x4')](0x9)[_0xa9b2('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa9b2('0x4')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa9b2('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa9b2('0x4')](0x5)[_0xa9b2('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa9b2('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa9b2('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa9b2('0x17')](_0xa9b2('0x18'),_0xa9b2('0x19')),'defaultValue':_0xa9b2('0x18')},'dialPrefix':{'type':Sequelize[_0xa9b2('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa9b2('0x4')](0x3)[_0xa9b2('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa9b2('0x1a')},'dialCutDigit':{'type':Sequelize[_0xa9b2('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa9b2('0x4')](0x3)[_0xa9b2('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa9b2('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa9b2('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa9b2('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xa9b2('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa9b2('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa9b2('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa9b2('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa9b2('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa9b2('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa9b2('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa9b2('0x4')](0x5)[_0xa9b2('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa9b2('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa9b2('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa9b2('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa9b2('0x4')](0x5)[_0xa9b2('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa9b2('0x22')}}; \ No newline at end of file +var _0xeb1c=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x193de9,_0x27d9d0){var _0x3c8210=function(_0x20d2e7){while(--_0x20d2e7){_0x193de9['push'](_0x193de9['shift']());}};_0x3c8210(++_0x27d9d0);}(_0xeb1c,0xa0));var _0xceb1=function(_0x19796e,_0x4802dc){_0x19796e=_0x19796e-0x0;var _0x45172a=_0xeb1c[_0x19796e];return _0x45172a;};'use strict';var Sequelize=require(_0xceb1('0x0'));module[_0xceb1('0x1')]={'name':{'type':Sequelize[_0xceb1('0x2')],'unique':_0xceb1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xceb1('0x4')),'allowNull':![],'defaultValue':_0xceb1('0x4')},'description':{'type':Sequelize[_0xceb1('0x2')]},'active':{'type':Sequelize[_0xceb1('0x5')],'defaultValue':0x0,'comment':_0xceb1('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceb1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceb1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xceb1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'comment':_0xceb1('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceb1('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xceb1('0x2')],'defaultValue':_0xceb1('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xceb1('0x11'),'never',_0xceb1('0x12')),'defaultValue':_0xceb1('0x11')},'dialAMDActive':{'type':Sequelize[_0xceb1('0x5')],'defaultValue':0x0,'comment':_0xceb1('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xceb1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceb1('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xceb1('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xceb1('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceb1('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xceb1('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceb1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xceb1('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xceb1('0x1b')]('DESC',_0xceb1('0x1c')),'defaultValue':_0xceb1('0x1d')},'dialPrefix':{'type':Sequelize[_0xceb1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceb1('0x1e')},'dialCutDigit':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index c01af2b..9f54128 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 _0xd1eb=['findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','OrderBy','h.id','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','createdAt','updatedAt','role','userProfileId','autoAssociation','getHoppers'];(function(_0x1baf24,_0x265fac){var _0x47e09c=function(_0x262334){while(--_0x262334){_0x1baf24['push'](_0x1baf24['shift']());}};_0x47e09c(++_0x265fac);}(_0xd1eb,0xc3));var _0xbd1e=function(_0x5e52f8,_0x36c55a){_0x5e52f8=_0x5e52f8-0x0;var _0x10a75b=_0xd1eb[_0x5e52f8];return _0x10a75b;};'use strict';var emlformat=require(_0xbd1e('0x0'));var rimraf=require(_0xbd1e('0x1'));var zipdir=require(_0xbd1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd1e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd1e('0x4'));var util=require(_0xbd1e('0x5'));var path=require(_0xbd1e('0x6'));var sox=require(_0xbd1e('0x7'));var csv=require(_0xbd1e('0x8'));var ejs=require(_0xbd1e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbd1e('0xa'));var crypto=require(_0xbd1e('0xb'));var jsforce=require(_0xbd1e('0xc'));var deskjs=require(_0xbd1e('0xd'));var toCsv=require(_0xbd1e('0x8'));var querystring=require(_0xbd1e('0xe'));var Papa=require(_0xbd1e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd1e('0x10'));var as=require(_0xbd1e('0x11'));var hardwareService=require(_0xbd1e('0x12'));var logger=require(_0xbd1e('0x13'))('api');var utils=require(_0xbd1e('0x14'));var config=require(_0xbd1e('0x15'));var licenseUtil=require(_0xbd1e('0x16'));var db=require(_0xbd1e('0x17'))['db'];function respondWithStatusCode(_0x283446,_0xfcab78){_0xfcab78=_0xfcab78||0xcc;return function(_0x2f1f1e){if(_0x2f1f1e){return _0x283446[_0xbd1e('0x18')](_0xfcab78);}return _0x283446[_0xbd1e('0x19')](_0xfcab78)[_0xbd1e('0x1a')]();};}function respondWithResult(_0x9cf4a7,_0x44588a){_0x44588a=_0x44588a||0xc8;return function(_0x1d4a68){if(_0x1d4a68){return _0x9cf4a7[_0xbd1e('0x19')](_0x44588a)[_0xbd1e('0x1b')](_0x1d4a68);}};}function respondWithFilteredResult(_0x1e1484,_0x5526c7){return function(_0xf2f0b4){if(_0xf2f0b4){var _0x5a5dcf=typeof _0x5526c7[_0xbd1e('0x1c')]===_0xbd1e('0x1d')&&typeof _0x5526c7['limit']===_0xbd1e('0x1d');var _0x1734bf=_0xf2f0b4[_0xbd1e('0x1e')];var _0x211978=_0x5a5dcf?0x0:_0x5526c7['offset'];var _0x1fb242=_0x5a5dcf?_0xf2f0b4['count']:_0x5526c7[_0xbd1e('0x1c')]+_0x5526c7[_0xbd1e('0x1f')];var _0x315288;if(_0x1fb242>=_0x1734bf){_0x1fb242=_0x1734bf;_0x315288=0xc8;}else{_0x315288=0xce;}_0x1e1484[_0xbd1e('0x19')](_0x315288);return _0x1e1484[_0xbd1e('0x20')]('Content-Range',_0x211978+'-'+_0x1fb242+'/'+_0x1734bf)[_0xbd1e('0x1b')](_0xf2f0b4);}return null;};}function patchUpdates(_0x3c8e6d){return function(_0x13f2eb){try{jsonpatch[_0xbd1e('0x21')](_0x13f2eb,_0x3c8e6d,!![]);}catch(_0x1249a4){return BPromise[_0xbd1e('0x22')](_0x1249a4);}return _0x13f2eb[_0xbd1e('0x23')]();};}function saveUpdates(_0x20196f,_0x208932){return function(_0x37d13c){if(_0x37d13c){return _0x37d13c[_0xbd1e('0x24')](_0x20196f)[_0xbd1e('0x25')](function(_0x4bd84a){return _0x4bd84a;});}return null;};}function removeEntity(_0x499ec0,_0x389c79){return function(_0x3011bd){if(_0x3011bd){return _0x3011bd[_0xbd1e('0x26')]()[_0xbd1e('0x25')](function(){var _0x4a2353=_0x3011bd[_0xbd1e('0x27')]({'plain':!![]});var _0x560217=_0xbd1e('0x28');return db[_0xbd1e('0x29')][_0xbd1e('0x26')]({'where':{'type':_0x560217,'resourceId':_0x4a2353['id']}})['then'](function(){return _0x3011bd;});})[_0xbd1e('0x25')](function(){_0x499ec0['status'](0xcc)[_0xbd1e('0x1a')]();});}};}function handleEntityNotFound(_0x5b4a50,_0x43d648){return function(_0x57caca){if(!_0x57caca){_0x5b4a50['sendStatus'](0x194);}return _0x57caca;};}function handleError(_0x35df17,_0x161f39){_0x161f39=_0x161f39||0x1f4;return function(_0x3feb5e){logger['error'](_0x3feb5e[_0xbd1e('0x2a')]);if(_0x3feb5e['name']){delete _0x3feb5e[_0xbd1e('0x2b')];}_0x35df17['status'](_0x161f39)[_0xbd1e('0x2c')](_0x3feb5e);};}exports[_0xbd1e('0x2d')]=function(_0x17794c,_0x28ebc4){var _0x3c0580={},_0x93e3ba={},_0x1004b0={'count':0x0,'rows':[]};var _0x26184a=_[_0xbd1e('0x2e')](db[_0xbd1e('0x2f')][_0xbd1e('0x30')],function(_0x209b61){return{'name':_0x209b61[_0xbd1e('0x31')],'type':_0x209b61['type'][_0xbd1e('0x32')]};});_0x93e3ba[_0xbd1e('0x33')]=_['map'](_0x26184a,_0xbd1e('0x2b'));_0x93e3ba['query']=_['keys'](_0x17794c[_0xbd1e('0x34')]);_0x93e3ba[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x93e3ba[_0xbd1e('0x33')],_0x93e3ba['query']);_0x3c0580[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x93e3ba[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x17794c[_0xbd1e('0x34')]['fields']));_0x3c0580[_0xbd1e('0x37')]=_0x3c0580[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x3c0580[_0xbd1e('0x37')]:_0x93e3ba[_0xbd1e('0x33')];if(!_0x17794c[_0xbd1e('0x34')][_0xbd1e('0x3a')]('nolimit')){_0x3c0580['limit']=qs['limit'](_0x17794c['query'][_0xbd1e('0x1f')]);_0x3c0580['offset']=qs[_0xbd1e('0x1c')](_0x17794c[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x3c0580[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x17794c[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x3c0580[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_[_0xbd1e('0x3e')](_0x17794c[_0xbd1e('0x34')],_0x93e3ba[_0xbd1e('0x35')]),_0x26184a);if(_0x17794c['query'][_0xbd1e('0x3f')]){_0x3c0580[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x3c0580[_0xbd1e('0x3d')],{'$or':_['map'](_0x26184a,function(_0x5f0916){if(_0x5f0916['type']!=='VIRTUAL'){var _0x164060={};_0x164060[_0x5f0916[_0xbd1e('0x2b')]]={'$like':'%'+_0x17794c['query'][_0xbd1e('0x3f')]+'%'};return _0x164060;}})});}_0x3c0580=_[_0xbd1e('0x40')]({},_0x3c0580,_0x17794c[_0xbd1e('0x41')]);var _0x9254d9={'where':_0x3c0580[_0xbd1e('0x3d')]};return db['Campaign']['count'](_0x9254d9)['then'](function(_0x86a7ae){_0x1004b0[_0xbd1e('0x1e')]=_0x86a7ae;if(_0x17794c[_0xbd1e('0x34')]['includeAll']){_0x3c0580[_0xbd1e('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xbd1e('0x43')](_0x3c0580);})['then'](function(_0x1ab70b){_0x1004b0[_0xbd1e('0x44')]=_0x1ab70b;return _0x1004b0;})[_0xbd1e('0x25')](respondWithFilteredResult(_0x28ebc4,_0x3c0580))['catch'](handleError(_0x28ebc4,null));};exports[_0xbd1e('0x45')]=function(_0x63e762,_0x2a7a1b){var _0x108840={'raw':![],'where':{'id':_0x63e762[_0xbd1e('0x46')]['id']}},_0x3fed92={};_0x3fed92['model']=_[_0xbd1e('0x47')](db[_0xbd1e('0x2f')]['rawAttributes']);_0x3fed92['query']=_['keys'](_0x63e762[_0xbd1e('0x34')]);_0x3fed92[_0xbd1e('0x35')]=_['intersection'](_0x3fed92[_0xbd1e('0x33')],_0x3fed92[_0xbd1e('0x34')]);_0x108840[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x3fed92[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x63e762['query'][_0xbd1e('0x38')]));_0x108840[_0xbd1e('0x37')]=_0x108840[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x108840[_0xbd1e('0x37')]:_0x3fed92['model'];if(_0x63e762[_0xbd1e('0x34')]['includeAll']){_0x108840[_0xbd1e('0x42')]=[{'all':!![]}];}_0x108840=_['merge']({},_0x108840,_0x63e762['options']);return db[_0xbd1e('0x2f')][_0xbd1e('0x48')](_0x108840)[_0xbd1e('0x25')](handleEntityNotFound(_0x2a7a1b,null))[_0xbd1e('0x25')](respondWithResult(_0x2a7a1b,null))[_0xbd1e('0x49')](handleError(_0x2a7a1b,null));};exports[_0xbd1e('0x4a')]=function(_0x31c687,_0x1fc9b7){return db['Campaign'][_0xbd1e('0x4a')](_0x31c687[_0xbd1e('0x4b')],{})['then'](function(_0x2196d2){var _0x3904f7=_0x31c687[_0xbd1e('0x4c')][_0xbd1e('0x27')]({'plain':!![]});if(!_0x3904f7)throw new Error(_0xbd1e('0x4d'));if(_0x3904f7['role']===_0xbd1e('0x4c')){var _0x1a2c58=_0x2196d2['get']({'plain':!![]});var _0x4f04fa=_0xbd1e('0x28');return db[_0xbd1e('0x4e')][_0xbd1e('0x48')]({'where':{'name':_0x4f04fa,'userProfileId':_0x3904f7['userProfileId']},'raw':!![]})[_0xbd1e('0x25')](function(_0x3cb005){if(_0x3cb005&&_0x3cb005['autoAssociation']===0x0){return db[_0xbd1e('0x29')][_0xbd1e('0x4a')]({'name':_0x1a2c58[_0xbd1e('0x2b')],'resourceId':_0x1a2c58['id'],'type':_0x3cb005['name'],'sectionId':_0x3cb005['id']},{})[_0xbd1e('0x25')](function(){return _0x2196d2;});}else{return _0x2196d2;}})['catch'](function(_0x190449){logger[_0xbd1e('0x4f')](_0xbd1e('0x50'),_0x190449);throw _0x190449;});}return _0x2196d2;})[_0xbd1e('0x25')](respondWithResult(_0x1fc9b7,0xc9))['catch'](handleError(_0x1fc9b7,null));};exports['clone']=function(_0x337ef8,_0x283ac4){var _0x17899c={'where':{'id':_0x337ef8[_0xbd1e('0x46')]['id']}},_0x5b70fb={};_0x5b70fb[_0xbd1e('0x33')]=_['keys'](db[_0xbd1e('0x2f')][_0xbd1e('0x30')]);_0x17899c[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x5b70fb[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x337ef8[_0xbd1e('0x34')][_0xbd1e('0x38')]));_0x17899c['attributes']=_0x17899c[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x17899c[_0xbd1e('0x37')]:_0x5b70fb[_0xbd1e('0x33')];if(_0x337ef8['query'][_0xbd1e('0x51')]){_0x17899c[_0xbd1e('0x42')]=[{'all':!![]}];}_0x17899c=_['merge']({},_0x17899c,_0x337ef8[_0xbd1e('0x41')]);return db[_0xbd1e('0x2f')][_0xbd1e('0x48')](_0x17899c)[_0xbd1e('0x25')](handleEntityNotFound(_0x283ac4,null))[_0xbd1e('0x25')](function(_0x26a390){if(_0x26a390){var _0x41d46d=_0x26a390['get']({'plain':!![]});_0x41d46d=qs[_0xbd1e('0x52')](_0x41d46d,['id',_0xbd1e('0x53'),_0xbd1e('0x54')]);_0x337ef8['body']=_[_0xbd1e('0x52')](_0x337ef8[_0xbd1e('0x4b')],['id',_0xbd1e('0x53'),_0xbd1e('0x54')]);return db[_0xbd1e('0x2f')][_0xbd1e('0x4a')](_[_0xbd1e('0x40')](_0x41d46d,_0x337ef8[_0xbd1e('0x4b')]),{'include':_0x337ef8[_0xbd1e('0x34')][_0xbd1e('0x51')]?[{'all':!![]}]:undefined})[_0xbd1e('0x25')](function(_0x80a069){var _0x266221=_0x337ef8[_0xbd1e('0x4c')][_0xbd1e('0x27')]({'plain':!![]});if(!_0x266221)throw new Error(_0xbd1e('0x4d'));if(_0x266221[_0xbd1e('0x55')]===_0xbd1e('0x4c')){var _0x18237c=_0x80a069[_0xbd1e('0x27')]({'plain':!![]});var _0x537d47=_0xbd1e('0x28');return db[_0xbd1e('0x4e')][_0xbd1e('0x48')]({'where':{'name':_0x537d47,'userProfileId':_0x266221[_0xbd1e('0x56')]},'raw':!![]})[_0xbd1e('0x25')](function(_0x555c49){if(_0x555c49&&_0x555c49[_0xbd1e('0x57')]===0x0){return db['UserProfileResource'][_0xbd1e('0x4a')]({'name':_0x18237c['name'],'resourceId':_0x18237c['id'],'type':_0x555c49[_0xbd1e('0x2b')],'sectionId':_0x555c49['id']},{})[_0xbd1e('0x25')](function(){return _0x80a069;});}else{return _0x80a069;}})['catch'](function(_0x4a5471){logger[_0xbd1e('0x4f')](_0xbd1e('0x50'),_0x4a5471);throw _0x4a5471;});}return _0x80a069;});}})[_0xbd1e('0x25')](respondWithResult(_0x283ac4,0xc9))[_0xbd1e('0x49')](handleError(_0x283ac4,null));};exports['update']=function(_0x43e757,_0x1c9fdc){if(_0x43e757[_0xbd1e('0x4b')]['id']){delete _0x43e757['body']['id'];}return db[_0xbd1e('0x2f')]['find']({'where':{'id':_0x43e757[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x1c9fdc,null))[_0xbd1e('0x25')](saveUpdates(_0x43e757[_0xbd1e('0x4b')],null))[_0xbd1e('0x25')](respondWithResult(_0x1c9fdc,null))[_0xbd1e('0x49')](handleError(_0x1c9fdc,null));};exports[_0xbd1e('0x26')]=function(_0x3c3de5,_0x4df163){return db[_0xbd1e('0x2f')][_0xbd1e('0x48')]({'where':{'id':_0x3c3de5[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x4df163,null))[_0xbd1e('0x25')](removeEntity(_0x4df163,null))['catch'](handleError(_0x4df163,null));};exports[_0xbd1e('0x58')]=function(_0x11aa66,_0x2a3e98,_0x4ff2b3){var _0x374dd7={'raw':!![],'where':{}};var _0x50729b={};var _0x580303={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x11aa66['params']['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x2a3e98,null))[_0xbd1e('0x25')](function(_0x590ba0){if(_0x590ba0){_0x50729b[_0xbd1e('0x33')]=_[_0xbd1e('0x47')](db[_0xbd1e('0x5a')]['rawAttributes']);_0x50729b[_0xbd1e('0x34')]=_[_0xbd1e('0x47')](_0x11aa66[_0xbd1e('0x34')]);_0x50729b['filters']=_[_0xbd1e('0x36')](_0x50729b[_0xbd1e('0x33')],_0x50729b['query']);_0x374dd7[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x50729b[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x11aa66['query'][_0xbd1e('0x38')]));_0x374dd7[_0xbd1e('0x37')]=_0x374dd7[_0xbd1e('0x37')]['length']?_0x374dd7['attributes']:_0x50729b[_0xbd1e('0x33')];if(!_0x11aa66['query']['hasOwnProperty'](_0xbd1e('0x5b'))){_0x374dd7[_0xbd1e('0x1f')]=qs['limit'](_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x374dd7[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x374dd7[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x374dd7[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_[_0xbd1e('0x3e')](_0x11aa66[_0xbd1e('0x34')],_0x50729b[_0xbd1e('0x35')]));_0x374dd7[_0xbd1e('0x3d')]['CampaignId']=_0x590ba0['id'];if(_0x11aa66[_0xbd1e('0x34')]['filter']){_0x374dd7[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x374dd7['where'],{'$or':_[_0xbd1e('0x2e')](_0x374dd7[_0xbd1e('0x37')],function(_0x18d81f){var _0x390917={};_0x390917[_0x18d81f]={'$like':'%'+_0x11aa66[_0xbd1e('0x34')]['filter']+'%'};return _0x390917;})});}_0x374dd7=_[_0xbd1e('0x40')]({},_0x374dd7,_0x11aa66['options']);return db[_0xbd1e('0x5a')][_0xbd1e('0x1e')]({'where':_0x374dd7['where']})['then'](function(_0x26d2ee){_0x580303[_0xbd1e('0x1e')]=_0x26d2ee;if(_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x51')]){_0x374dd7[_0xbd1e('0x42')]=[{'all':!![]}];}return db[_0xbd1e('0x5a')][_0xbd1e('0x43')](_0x374dd7);})[_0xbd1e('0x25')](function(_0x3e65ee){_0x580303['rows']=_0x3e65ee;return _0x580303;});}})['then'](respondWithFilteredResult(_0x2a3e98,_0x374dd7))[_0xbd1e('0x49')](handleError(_0x2a3e98,null));};exports[_0xbd1e('0x5c')]=function(_0x5d5f63,_0x2a8d61,_0x2c7bef){var _0x3528ea={'raw':!![],'where':{}};var _0x5393a2={};var _0x5ae4ac={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x5d5f63[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x2a8d61,null))[_0xbd1e('0x25')](function(_0x1b6728){if(_0x1b6728){_0x5393a2[_0xbd1e('0x33')]=_['keys'](db[_0xbd1e('0x5d')]['rawAttributes']);_0x5393a2[_0xbd1e('0x34')]=_[_0xbd1e('0x47')](_0x5d5f63[_0xbd1e('0x34')]);_0x5393a2[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x5393a2[_0xbd1e('0x33')],_0x5393a2[_0xbd1e('0x34')]);_0x3528ea[_0xbd1e('0x37')]=_['intersection'](_0x5393a2['model'],qs[_0xbd1e('0x38')](_0x5d5f63[_0xbd1e('0x34')]['fields']));_0x3528ea[_0xbd1e('0x37')]=_0x3528ea['attributes'][_0xbd1e('0x39')]?_0x3528ea[_0xbd1e('0x37')]:_0x5393a2[_0xbd1e('0x33')];if(!_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x3a')](_0xbd1e('0x5b'))){_0x3528ea[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x5d5f63['query'][_0xbd1e('0x1f')]);_0x3528ea[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x3528ea['order']=qs[_0xbd1e('0x3c')](_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x3528ea[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_['pick'](_0x5d5f63[_0xbd1e('0x34')],_0x5393a2[_0xbd1e('0x35')]));_0x3528ea['where'][_0xbd1e('0x5e')]=_0x1b6728['id'];if(_0x5d5f63['query'][_0xbd1e('0x3f')]){_0x3528ea[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x3528ea[_0xbd1e('0x3d')],{'$or':_[_0xbd1e('0x2e')](_0x3528ea['attributes'],function(_0x4ca3cc){var _0x224be9={};_0x224be9[_0x4ca3cc]={'$like':'%'+_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x3f')]+'%'};return _0x224be9;})});}_0x3528ea=_[_0xbd1e('0x40')]({},_0x3528ea,_0x5d5f63[_0xbd1e('0x41')]);return db[_0xbd1e('0x5d')]['count']({'where':_0x3528ea[_0xbd1e('0x3d')]})[_0xbd1e('0x25')](function(_0x4c26ed){_0x5ae4ac[_0xbd1e('0x1e')]=_0x4c26ed;if(_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x51')]){_0x3528ea['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3528ea);})[_0xbd1e('0x25')](function(_0x46fea5){_0x5ae4ac[_0xbd1e('0x44')]=_0x46fea5;return _0x5ae4ac;});}})[_0xbd1e('0x25')](respondWithFilteredResult(_0x2a8d61,_0x3528ea))[_0xbd1e('0x49')](handleError(_0x2a8d61,null));};exports[_0xbd1e('0x5f')]=function(_0x4f3aaf,_0x51e29d,_0x2df9ef){var _0x2ec696={'raw':!![],'where':{}};var _0x2fec5f={};var _0x229553={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x4f3aaf['params']['id']}})['then'](handleEntityNotFound(_0x51e29d,null))[_0xbd1e('0x25')](function(_0x4a96fc){if(_0x4a96fc){_0x2fec5f[_0xbd1e('0x33')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x2fec5f[_0xbd1e('0x34')]=_[_0xbd1e('0x47')](_0x4f3aaf['query']);_0x2fec5f[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x2fec5f[_0xbd1e('0x33')],_0x2fec5f[_0xbd1e('0x34')]);_0x2ec696[_0xbd1e('0x37')]=_['intersection'](_0x2fec5f[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x38')]));_0x2ec696[_0xbd1e('0x37')]=_0x2ec696[_0xbd1e('0x37')]['length']?_0x2ec696[_0xbd1e('0x37')]:_0x2fec5f[_0xbd1e('0x33')];if(!_0x4f3aaf['query'][_0xbd1e('0x3a')]('nolimit')){_0x2ec696[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x2ec696['offset']=qs[_0xbd1e('0x1c')](_0x4f3aaf['query'][_0xbd1e('0x1c')]);}_0x2ec696['order']=qs[_0xbd1e('0x3c')](_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x2ec696['where']=qs[_0xbd1e('0x35')](_['pick'](_0x4f3aaf[_0xbd1e('0x34')],_0x2fec5f['filters']));_0x2ec696[_0xbd1e('0x3d')][_0xbd1e('0x5e')]=_0x4a96fc['id'];if(_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x2ec696[_0xbd1e('0x3d')]=_['merge'](_0x2ec696[_0xbd1e('0x3d')],{'$or':_['map'](_0x2ec696[_0xbd1e('0x37')],function(_0xdd7b5){var _0x606b2e={};_0x606b2e[_0xdd7b5]={'$like':'%'+_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x3f')]+'%'};return _0x606b2e;})});}_0x2ec696=_['merge']({},_0x2ec696,_0x4f3aaf[_0xbd1e('0x41')]);return db['CmHopperFinal'][_0xbd1e('0x1e')]({'where':_0x2ec696[_0xbd1e('0x3d')]})[_0xbd1e('0x25')](function(_0x350fb3){_0x229553['count']=_0x350fb3;if(_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x51')]){_0x2ec696[_0xbd1e('0x42')]=[{'all':!![]}];}return db[_0xbd1e('0x60')][_0xbd1e('0x43')](_0x2ec696);})[_0xbd1e('0x25')](function(_0x3349d9){_0x229553[_0xbd1e('0x44')]=_0x3349d9;return _0x229553;});}})[_0xbd1e('0x25')](respondWithFilteredResult(_0x51e29d,_0x2ec696))[_0xbd1e('0x49')](handleError(_0x51e29d,null));};exports['getHopperBlacks']=function(_0x28119c,_0x252423,_0x16d4c0){var _0x45b415={'raw':!![],'where':{}};var _0x2d3f95={};var _0x42eb83={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x28119c[_0xbd1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x252423,null))[_0xbd1e('0x25')](function(_0x286673){if(_0x286673){_0x2d3f95[_0xbd1e('0x33')]=_[_0xbd1e('0x47')](db['CmHopperBlack']['rawAttributes']);_0x2d3f95[_0xbd1e('0x34')]=_['keys'](_0x28119c['query']);_0x2d3f95[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x2d3f95[_0xbd1e('0x33')],_0x2d3f95[_0xbd1e('0x34')]);_0x45b415[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x2d3f95[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x28119c['query'][_0xbd1e('0x38')]));_0x45b415[_0xbd1e('0x37')]=_0x45b415['attributes'][_0xbd1e('0x39')]?_0x45b415[_0xbd1e('0x37')]:_0x2d3f95['model'];if(!_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x3a')]('nolimit')){_0x45b415[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x28119c['query'][_0xbd1e('0x1f')]);_0x45b415[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x45b415[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x28119c['query'][_0xbd1e('0x3c')]);_0x45b415[_0xbd1e('0x3d')]=qs['filters'](_['pick'](_0x28119c['query'],_0x2d3f95[_0xbd1e('0x35')]));_0x45b415['where']['CampaignId']=_0x286673['id'];if(_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x45b415[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x45b415['where'],{'$or':_[_0xbd1e('0x2e')](_0x45b415[_0xbd1e('0x37')],function(_0x1a83b2){var _0x41a672={};_0x41a672[_0x1a83b2]={'$like':'%'+_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x3f')]+'%'};return _0x41a672;})});}_0x45b415=_[_0xbd1e('0x40')]({},_0x45b415,_0x28119c[_0xbd1e('0x41')]);return db[_0xbd1e('0x61')]['count']({'where':_0x45b415[_0xbd1e('0x3d')]})[_0xbd1e('0x25')](function(_0x25b1cf){_0x42eb83[_0xbd1e('0x1e')]=_0x25b1cf;if(_0x28119c[_0xbd1e('0x34')]['includeAll']){_0x45b415[_0xbd1e('0x42')]=[{'all':!![]}];}return db[_0xbd1e('0x61')]['findAll'](_0x45b415);})[_0xbd1e('0x25')](function(_0x4b635d){_0x42eb83[_0xbd1e('0x44')]=_0x4b635d;return _0x42eb83;});}})[_0xbd1e('0x25')](respondWithFilteredResult(_0x252423,_0x45b415))['catch'](handleError(_0x252423,null));};exports[_0xbd1e('0x62')]=function(_0x4576dd,_0x366f13,_0x20f8b1){var _0x28ea64={};var _0x5b7592={};var _0x106899;var _0x5b8d30;return db[_0xbd1e('0x2f')]['findOne']({'where':{'id':_0x4576dd[_0xbd1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x366f13,null))[_0xbd1e('0x25')](function(_0x220d55){if(_0x220d55){_0x106899=_0x220d55;_0x5b7592[_0xbd1e('0x33')]=_[_0xbd1e('0x47')](db[_0xbd1e('0x63')]['rawAttributes']);_0x5b7592[_0xbd1e('0x34')]=_['keys'](_0x4576dd[_0xbd1e('0x34')]);_0x5b7592[_0xbd1e('0x35')]=_['intersection'](_0x5b7592['model'],_0x5b7592[_0xbd1e('0x34')]);_0x28ea64[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x5b7592[_0xbd1e('0x33')],qs['fields'](_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x38')]));_0x28ea64[_0xbd1e('0x37')]=_0x28ea64['attributes'][_0xbd1e('0x39')]?_0x28ea64[_0xbd1e('0x37')]:_0x5b7592['model'];_0x28ea64[_0xbd1e('0x3b')]=qs['sort'](_0x4576dd[_0xbd1e('0x34')]['sort']);_0x28ea64[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_[_0xbd1e('0x3e')](_0x4576dd['query'],_0x5b7592['filters']));if(_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x28ea64[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x28ea64[_0xbd1e('0x3d')],{'$or':_[_0xbd1e('0x2e')](_0x28ea64['attributes'],function(_0x24ce7d){var _0x24e9b4={};_0x24e9b4[_0x24ce7d]={'$like':'%'+_0x4576dd[_0xbd1e('0x34')]['filter']+'%'};return _0x24e9b4;})});}_0x28ea64=_[_0xbd1e('0x40')]({},_0x28ea64,_0x4576dd[_0xbd1e('0x41')]);return _0x106899[_0xbd1e('0x62')](_0x28ea64);}})[_0xbd1e('0x25')](function(_0x1c2e0a){if(_0x1c2e0a){_0x5b8d30=_0x1c2e0a['length'];if(!_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x3a')](_0xbd1e('0x5b'))){_0x28ea64[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x28ea64['offset']=qs['offset'](_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}return _0x106899[_0xbd1e('0x62')](_0x28ea64);}})[_0xbd1e('0x25')](function(_0x574f74){if(_0x574f74){return _0x574f74?{'count':_0x5b8d30,'rows':_0x574f74}:null;}})[_0xbd1e('0x25')](respondWithResult(_0x366f13,null))[_0xbd1e('0x49')](handleError(_0x366f13,null));};exports[_0xbd1e('0x64')]=function(_0x16180e,_0x44cf7a,_0x39bbab){var _0xa0da91,_0x466e8e;var _0x389535=[];var _0x355edf=moment()[_0xbd1e('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xbd1e('0x2f')][_0xbd1e('0x48')]({'where':{'id':_0x16180e['params']['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x44cf7a,null))[_0xbd1e('0x25')](function(_0x403188){if(_0x403188){_0x466e8e=_0x403188;return _0x403188['addLists'](_0x16180e[_0xbd1e('0x4b')][_0xbd1e('0x66')],_[_0xbd1e('0x52')](_0x16180e[_0xbd1e('0x4b')],[_0xbd1e('0x66'),'id'])||{});}return null;})['spread'](function(_0x20f7db){var _0x205661;var _0x2910b6;_0xa0da91=_0x20f7db||[];var _0xd658d8=[];if(_0x20f7db){for(var _0x492a7f=0x0;_0x492a7f<_0x20f7db['length'];_0x492a7f+=0x1){var _0x50db07=_0x20f7db[_0x492a7f]['get']({'plain':!![]});_0x466e8e['dialCheckDuplicateType']=_0x16180e['body'][_0xbd1e('0x67')]?_0x16180e[_0xbd1e('0x4b')][_0xbd1e('0x67')]:_0x466e8e[_0xbd1e('0x67')];switch(_0x466e8e[_0xbd1e('0x67')]){case'always':_0x205661=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')](_0xbd1e('0x6a'))[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6d'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel['select']()[_0xbd1e('0x70')]('phone',_0xbd1e('0x6c'))[_0xbd1e('0x70')](_0xbd1e('0x71'),_0xbd1e('0x6d'))['field']('id',_0xbd1e('0x6e'))[_0xbd1e('0x70')](_0x50db07[_0xbd1e('0x72')]['toString'](),'ListId')[_0xbd1e('0x70')](_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')](),'CampaignId')[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27','createdAt')['field']('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))[_0xbd1e('0x74')]('cm_contacts')['where'](_0xbd1e('0x75'))[_0xbd1e('0x3d')](_0xbd1e('0x76'),_0x50db07[_0xbd1e('0x72')]['toString']())[_0xbd1e('0x3d')](_0xbd1e('0x77'))[_0xbd1e('0x3d')](_0xbd1e('0x78'),squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x7a'))['from'](_0xbd1e('0x7b'))[_0xbd1e('0x3d')](_0xbd1e('0x7c'),_0x16180e['params']['id'][_0xbd1e('0x73')]()))[_0xbd1e('0x3d')](_0xbd1e('0x78'),squel[_0xbd1e('0x79')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xbd1e('0x3d')](_0xbd1e('0x7c'),_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')]())))['toString']();break;case _0xbd1e('0x7d'):_0x205661=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')](_0xbd1e('0x6a'))[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6d'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),'createdAt',_0xbd1e('0x54')],squel['select']()['field']('phone',_0xbd1e('0x6c'))['field']('NOW()',_0xbd1e('0x6d'))[_0xbd1e('0x70')]('id',_0xbd1e('0x6e'))[_0xbd1e('0x70')](_0x50db07['CmListId'][_0xbd1e('0x73')](),_0xbd1e('0x6f'))[_0xbd1e('0x70')](_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')](),_0xbd1e('0x5e'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x53'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))['from'](_0xbd1e('0x7e'))[_0xbd1e('0x3d')](_0xbd1e('0x75'))[_0xbd1e('0x3d')](_0xbd1e('0x76'),_0x50db07[_0xbd1e('0x72')][_0xbd1e('0x73')]())[_0xbd1e('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xbd1e('0x3d')](_0xbd1e('0x78'),squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x7f'))[_0xbd1e('0x74')]('cm_hopper')[_0xbd1e('0x3d')](_0xbd1e('0x7c'),_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')]())))[_0xbd1e('0x73')]();break;default:_0x205661=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')](_0xbd1e('0x6a'))[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6d'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel[_0xbd1e('0x79')]()['field'](_0xbd1e('0x6c'),_0xbd1e('0x6c'))['field']('NOW()',_0xbd1e('0x6d'))[_0xbd1e('0x70')]('id',_0xbd1e('0x6e'))[_0xbd1e('0x70')](_0x50db07[_0xbd1e('0x72')]['toString'](),_0xbd1e('0x6f'))['field'](_0x16180e[_0xbd1e('0x46')]['id']['toString'](),_0xbd1e('0x5e'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x53'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))['from'](_0xbd1e('0x7e'))[_0xbd1e('0x3d')](_0xbd1e('0x75'))['where'](_0xbd1e('0x76'),_0x50db07[_0xbd1e('0x72')][_0xbd1e('0x73')]())[_0xbd1e('0x3d')](_0xbd1e('0x77')))[_0xbd1e('0x73')]();}_0x2910b6=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')]('cm_hopper_additional_phones')[_0xbd1e('0x6b')](['cmHopperId','scheduledAt',_0xbd1e('0x6c'),_0xbd1e('0x80'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x81'),'id')[_0xbd1e('0x70')](_0xbd1e('0x71'),_0xbd1e('0x6d'))[_0xbd1e('0x70')]('ci.item',_0xbd1e('0x6c'))['field']('ci.OrderBY',_0xbd1e('0x80'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x53'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))[_0xbd1e('0x74')](_0xbd1e('0x82'),'ci')[_0xbd1e('0x83')](_0xbd1e('0x6a'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xbd1e('0x3d')](_0xbd1e('0x84'),_0x50db07[_0xbd1e('0x72')][_0xbd1e('0x73')]())[_0xbd1e('0x3d')](_0xbd1e('0x85'),_0x16180e['params']['id'][_0xbd1e('0x73')]())[_0xbd1e('0x3d')]('h.createdAt\x20=\x20?',_0x355edf))[_0xbd1e('0x73')]();_0xd658d8[_0xbd1e('0x86')](db[_0xbd1e('0x87')][_0xbd1e('0x34')](_0x205661));_0x389535[_0xbd1e('0x86')](db[_0xbd1e('0x87')][_0xbd1e('0x34')](_0x2910b6));}return BPromise[_0xbd1e('0x88')](_0xd658d8);}})[_0xbd1e('0x25')](function(){return BPromise[_0xbd1e('0x88')](_0x389535);})[_0xbd1e('0x25')](function(){return _0xa0da91;})[_0xbd1e('0x25')](respondWithResult(_0x44cf7a,null))[_0xbd1e('0x49')](handleError(_0x44cf7a,null));};exports[_0xbd1e('0x89')]=function(_0x2a27b5,_0x418248,_0x11c401){return db[_0xbd1e('0x2f')]['find']({'where':{'id':_0x2a27b5[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x418248,null))['then'](function(_0x11dfd8){if(_0x11dfd8){return _0x11dfd8[_0xbd1e('0x89')](_0x2a27b5['query'][_0xbd1e('0x66')]);}})[_0xbd1e('0x25')](function(_0x171730){if(_0x171730){return db[_0xbd1e('0x5a')][_0xbd1e('0x26')]({'where':{'ListId':_0x2a27b5[_0xbd1e('0x34')][_0xbd1e('0x66')],'CampaignId':_0x2a27b5[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](function(){return _0x171730;});}})[_0xbd1e('0x25')](respondWithStatusCode(_0x418248,null))['catch'](handleError(_0x418248,null));};exports[_0xbd1e('0x8a')]=function(_0x39302b,_0x36b677,_0x2f2421){var _0x2c61d3={};var _0x5c32b4={};var _0x146c02;var _0x2780e6;return db['Campaign'][_0xbd1e('0x59')]({'where':{'id':_0x39302b['params']['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x36b677,null))[_0xbd1e('0x25')](function(_0x4c45aa){if(_0x4c45aa){_0x146c02=_0x4c45aa;_0x5c32b4[_0xbd1e('0x33')]=_['keys'](db[_0xbd1e('0x63')][_0xbd1e('0x30')]);_0x5c32b4['query']=_[_0xbd1e('0x47')](_0x39302b['query']);_0x5c32b4[_0xbd1e('0x35')]=_['intersection'](_0x5c32b4[_0xbd1e('0x33')],_0x5c32b4['query']);_0x2c61d3[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x5c32b4['model'],qs[_0xbd1e('0x38')](_0x39302b['query'][_0xbd1e('0x38')]));_0x2c61d3['attributes']=_0x2c61d3[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x2c61d3[_0xbd1e('0x37')]:_0x5c32b4[_0xbd1e('0x33')];_0x2c61d3[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x2c61d3[_0xbd1e('0x3d')]=qs['filters'](_['pick'](_0x39302b[_0xbd1e('0x34')],_0x5c32b4['filters']));if(_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x2c61d3[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x2c61d3[_0xbd1e('0x3d')],{'$or':_[_0xbd1e('0x2e')](_0x2c61d3[_0xbd1e('0x37')],function(_0x3e2095){var _0x26fa87={};_0x26fa87[_0x3e2095]={'$like':'%'+_0x39302b['query'][_0xbd1e('0x3f')]+'%'};return _0x26fa87;})});}_0x2c61d3=_[_0xbd1e('0x40')]({},_0x2c61d3,_0x39302b['options']);return _0x146c02[_0xbd1e('0x8a')](_0x2c61d3);}})[_0xbd1e('0x25')](function(_0x3c1952){if(_0x3c1952){_0x2780e6=_0x3c1952[_0xbd1e('0x39')];if(!_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x3a')](_0xbd1e('0x5b'))){_0x2c61d3[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x2c61d3[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}return _0x146c02[_0xbd1e('0x8a')](_0x2c61d3);}})[_0xbd1e('0x25')](function(_0x2dc52f){if(_0x2dc52f){return _0x2dc52f?{'count':_0x2780e6,'rows':_0x2dc52f}:null;}})[_0xbd1e('0x25')](respondWithResult(_0x36b677,null))[_0xbd1e('0x49')](handleError(_0x36b677,null));};exports[_0xbd1e('0x8b')]=function(_0x2d562f,_0x3ec647,_0x186fea){var _0x1f0106,_0x54b9c5;var _0x25abdc=[];var _0x3bded5=moment()[_0xbd1e('0x65')](_0xbd1e('0x8c'));return db[_0xbd1e('0x2f')][_0xbd1e('0x48')]({'where':{'id':_0x2d562f[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x3ec647,null))[_0xbd1e('0x25')](function(_0x15aca5){if(_0x15aca5){_0x54b9c5=_0x15aca5;return _0x15aca5[_0xbd1e('0x8b')](_0x2d562f[_0xbd1e('0x4b')][_0xbd1e('0x66')],_['omit'](_0x2d562f[_0xbd1e('0x4b')],[_0xbd1e('0x66'),'id'])||{});}return null;})['spread'](function(_0xb79cad){var _0x45698c;var _0x58feee;_0x1f0106=_0xb79cad||[];var _0x115abd=[];if(_0xb79cad){for(var _0x1417c3=0x0;_0x1417c3<_0xb79cad[_0xbd1e('0x39')];_0x1417c3+=0x1){var _0x225fe8=_0xb79cad[_0x1417c3][_0xbd1e('0x27')]({'plain':!![]});_0x45698c=squel['insert']()[_0xbd1e('0x69')]('cm_hopper_black')[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x6c'),_0xbd1e('0x6c'))[_0xbd1e('0x70')]('id','ContactId')['field'](_0x225fe8[_0xbd1e('0x72')][_0xbd1e('0x73')](),'ListId')['field'](_0x2d562f['params']['id'][_0xbd1e('0x73')](),'CampaignId')[_0xbd1e('0x70')](_0xbd1e('0x71'),_0xbd1e('0x53'))['field']('NOW()','updatedAt')['from'](_0xbd1e('0x7e'))[_0xbd1e('0x3d')]('deletedAt\x20IS\x20NULL')[_0xbd1e('0x3d')](_0xbd1e('0x76'),_0x225fe8[_0xbd1e('0x72')]['toString']())['where'](_0xbd1e('0x77')))['toString']();_0x115abd[_0xbd1e('0x86')](db[_0xbd1e('0x87')][_0xbd1e('0x34')](_0x45698c));}return BPromise['all'](_0x115abd);}})[_0xbd1e('0x25')](function(){return _0x1f0106;})[_0xbd1e('0x25')](respondWithResult(_0x3ec647,null))['catch'](handleError(_0x3ec647,null));};exports[_0xbd1e('0x8d')]=function(_0x5b067b,_0x2f1241,_0x496831){return db['Campaign']['find']({'where':{'id':_0x5b067b[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x2f1241,null))[_0xbd1e('0x25')](function(_0x239f99){if(_0x239f99){return _0x239f99[_0xbd1e('0x8d')](_0x5b067b[_0xbd1e('0x34')][_0xbd1e('0x66')]);}})['then'](function(_0x52c166){if(_0x52c166){return db[_0xbd1e('0x61')][_0xbd1e('0x26')]({'where':{'ListId':_0x5b067b[_0xbd1e('0x34')][_0xbd1e('0x66')],'CampaignId':_0x5b067b[_0xbd1e('0x46')]['id']}})['then'](function(){return _0x52c166;});}})[_0xbd1e('0x25')](respondWithStatusCode(_0x2f1241,null))['catch'](handleError(_0x2f1241,null));}; \ No newline at end of file +var _0x4f8b=['COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Campaign','includeAll','include','findAll','catch','rawAttributes','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','error','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','insert','into','fromQuery'];(function(_0x18036c,_0x25ac78){var _0x53b19f=function(_0x56f6d0){while(--_0x56f6d0){_0x18036c['push'](_0x18036c['shift']());}};_0x53b19f(++_0x25ac78);}(_0x4f8b,0x12e));var _0xb4f8=function(_0x45a666,_0x1ad7d3){_0x45a666=_0x45a666-0x0;var _0x813b90=_0x4f8b[_0x45a666];return _0x813b90;};'use strict';var emlformat=require(_0xb4f8('0x0'));var rimraf=require(_0xb4f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4f8('0x2'));var moment=require(_0xb4f8('0x3'));var BPromise=require(_0xb4f8('0x4'));var Mustache=require(_0xb4f8('0x5'));var util=require(_0xb4f8('0x6'));var path=require('path');var sox=require(_0xb4f8('0x7'));var csv=require(_0xb4f8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4f8('0x9'));var _=require(_0xb4f8('0xa'));var squel=require('squel');var crypto=require(_0xb4f8('0xb'));var jsforce=require(_0xb4f8('0xc'));var deskjs=require(_0xb4f8('0xd'));var toCsv=require(_0xb4f8('0x8'));var querystring=require(_0xb4f8('0xe'));var Papa=require(_0xb4f8('0xf'));var Redis=require(_0xb4f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4f8('0x11'));var as=require(_0xb4f8('0x12'));var hardwareService=require(_0xb4f8('0x13'));var logger=require(_0xb4f8('0x14'))(_0xb4f8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb4f8('0x16'))['db'];function respondWithStatusCode(_0x55f60b,_0x26c8fb){_0x26c8fb=_0x26c8fb||0xcc;return function(_0x1d0a37){if(_0x1d0a37){return _0x55f60b['sendStatus'](_0x26c8fb);}return _0x55f60b[_0xb4f8('0x17')](_0x26c8fb)[_0xb4f8('0x18')]();};}function respondWithResult(_0xacdbad,_0x309b62){_0x309b62=_0x309b62||0xc8;return function(_0x4d3017){if(_0x4d3017){return _0xacdbad[_0xb4f8('0x17')](_0x309b62)[_0xb4f8('0x19')](_0x4d3017);}};}function respondWithFilteredResult(_0x39ed9e,_0x4f00a0){return function(_0x2061e2){if(_0x2061e2){var _0x47ebe5=typeof _0x4f00a0[_0xb4f8('0x1a')]===_0xb4f8('0x1b')&&typeof _0x4f00a0[_0xb4f8('0x1c')]===_0xb4f8('0x1b');var _0x578e4c=_0x2061e2[_0xb4f8('0x1d')];var _0x4c3e35=_0x47ebe5?0x0:_0x4f00a0[_0xb4f8('0x1a')];var _0x1a50bd=_0x47ebe5?_0x2061e2[_0xb4f8('0x1d')]:_0x4f00a0['offset']+_0x4f00a0[_0xb4f8('0x1c')];var _0x4eff64;if(_0x1a50bd>=_0x578e4c){_0x1a50bd=_0x578e4c;_0x4eff64=0xc8;}else{_0x4eff64=0xce;}_0x39ed9e[_0xb4f8('0x17')](_0x4eff64);return _0x39ed9e['set'](_0xb4f8('0x1e'),_0x4c3e35+'-'+_0x1a50bd+'/'+_0x578e4c)[_0xb4f8('0x19')](_0x2061e2);}return null;};}function patchUpdates(_0x1c1a84){return function(_0x380649){try{jsonpatch[_0xb4f8('0x1f')](_0x380649,_0x1c1a84,!![]);}catch(_0x3ef98c){return BPromise[_0xb4f8('0x20')](_0x3ef98c);}return _0x380649['save']();};}function saveUpdates(_0x53ce83,_0x4415e7){return function(_0x35311c){if(_0x35311c){return _0x35311c[_0xb4f8('0x21')](_0x53ce83)[_0xb4f8('0x22')](function(_0x2bfdf2){return _0x2bfdf2;});}return null;};}function removeEntity(_0x56eb04,_0x3eb502){return function(_0x3a37e9){if(_0x3a37e9){return _0x3a37e9['destroy']()[_0xb4f8('0x22')](function(){var _0x18efcb=_0x3a37e9[_0xb4f8('0x23')]({'plain':!![]});var _0x54e6fc=_0xb4f8('0x24');return db[_0xb4f8('0x25')][_0xb4f8('0x26')]({'where':{'type':_0x54e6fc,'resourceId':_0x18efcb['id']}})['then'](function(){return _0x3a37e9;});})[_0xb4f8('0x22')](function(){_0x56eb04[_0xb4f8('0x17')](0xcc)[_0xb4f8('0x18')]();});}};}function handleEntityNotFound(_0x5ab6ac,_0x46d85e){return function(_0x1847c6){if(!_0x1847c6){_0x5ab6ac[_0xb4f8('0x27')](0x194);}return _0x1847c6;};}function handleError(_0x2801d9,_0x2183e1){_0x2183e1=_0x2183e1||0x1f4;return function(_0x44ed1f){logger['error'](_0x44ed1f[_0xb4f8('0x28')]);if(_0x44ed1f[_0xb4f8('0x29')]){delete _0x44ed1f[_0xb4f8('0x29')];}_0x2801d9[_0xb4f8('0x17')](_0x2183e1)[_0xb4f8('0x2a')](_0x44ed1f);};}exports['index']=function(_0x45cd75,_0xd58c27){var _0xfbd30f={},_0x511bf8={},_0x3b3a40={'count':0x0,'rows':[]};var _0x312f9a=_['map'](db['Campaign']['rawAttributes'],function(_0x5c5899){return{'name':_0x5c5899[_0xb4f8('0x2b')],'type':_0x5c5899[_0xb4f8('0x2c')][_0xb4f8('0x2d')]};});_0x511bf8[_0xb4f8('0x2e')]=_[_0xb4f8('0x2f')](_0x312f9a,_0xb4f8('0x29'));_0x511bf8['query']=_[_0xb4f8('0x30')](_0x45cd75[_0xb4f8('0x31')]);_0x511bf8[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x511bf8[_0xb4f8('0x2e')],_0x511bf8[_0xb4f8('0x31')]);_0xfbd30f['attributes']=_[_0xb4f8('0x33')](_0x511bf8['model'],qs['fields'](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xfbd30f[_0xb4f8('0x35')]=_0xfbd30f['attributes'][_0xb4f8('0x36')]?_0xfbd30f[_0xb4f8('0x35')]:_0x511bf8[_0xb4f8('0x2e')];if(!_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0xfbd30f['limit']=qs[_0xb4f8('0x1c')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xfbd30f['offset']=qs[_0xb4f8('0x1a')](_0x45cd75['query']['offset']);}_0xfbd30f[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xfbd30f[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x45cd75['query'],_0x511bf8[_0xb4f8('0x32')]),_0x312f9a);if(_0x45cd75['query'][_0xb4f8('0x3d')]){_0xfbd30f['where']=_['merge'](_0xfbd30f[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x312f9a,function(_0x45a398){if(_0x45a398[_0xb4f8('0x2c')]!=='VIRTUAL'){var _0x61fbbb={};_0x61fbbb[_0x45a398[_0xb4f8('0x29')]]={'$like':'%'+_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x61fbbb;}})});}_0xfbd30f=_[_0xb4f8('0x3e')]({},_0xfbd30f,_0x45cd75[_0xb4f8('0x3f')]);var _0x541c17={'where':_0xfbd30f['where']};return db[_0xb4f8('0x40')][_0xb4f8('0x1d')](_0x541c17)[_0xb4f8('0x22')](function(_0x468066){_0x3b3a40[_0xb4f8('0x1d')]=_0x468066;if(_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xfbd30f[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x40')][_0xb4f8('0x43')](_0xfbd30f);})[_0xb4f8('0x22')](function(_0x10910c){_0x3b3a40['rows']=_0x10910c;return _0x3b3a40;})['then'](respondWithFilteredResult(_0xd58c27,_0xfbd30f))[_0xb4f8('0x44')](handleError(_0xd58c27,null));};exports['show']=function(_0x3ebe57,_0x2b5526){var _0xb7ccef={'raw':![],'where':{'id':_0x3ebe57['params']['id']}},_0x20d4ef={};_0x20d4ef[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['Campaign'][_0xb4f8('0x45')]);_0x20d4ef[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3ebe57['query']);_0x20d4ef[_0xb4f8('0x32')]=_['intersection'](_0x20d4ef['model'],_0x20d4ef[_0xb4f8('0x31')]);_0xb7ccef[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x20d4ef[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xb7ccef[_0xb4f8('0x35')]=_0xb7ccef[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xb7ccef[_0xb4f8('0x35')]:_0x20d4ef['model'];if(_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xb7ccef[_0xb4f8('0x42')]=[{'all':!![]}];}_0xb7ccef=_['merge']({},_0xb7ccef,_0x3ebe57['options']);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0xb7ccef)[_0xb4f8('0x22')](handleEntityNotFound(_0x2b5526,null))[_0xb4f8('0x22')](respondWithResult(_0x2b5526,null))['catch'](handleError(_0x2b5526,null));};exports['create']=function(_0x354193,_0xd6f96a){return db[_0xb4f8('0x40')]['create'](_0x354193['body'],{})[_0xb4f8('0x22')](function(_0x209080){var _0x5af092=_0x354193['user'][_0xb4f8('0x23')]({'plain':!![]});if(!_0x5af092)throw new Error(_0xb4f8('0x47'));if(_0x5af092[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x764bee=_0x209080[_0xb4f8('0x23')]({'plain':!![]});var _0x2bedde='IvrCampaigns';return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2bedde,'userProfileId':_0x5af092[_0xb4f8('0x4a')]},'raw':!![]})[_0xb4f8('0x22')](function(_0x26b3e9){if(_0x26b3e9&&_0x26b3e9[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x764bee[_0xb4f8('0x29')],'resourceId':_0x764bee['id'],'type':_0x26b3e9[_0xb4f8('0x29')],'sectionId':_0x26b3e9['id']},{})[_0xb4f8('0x22')](function(){return _0x209080;});}else{return _0x209080;}})[_0xb4f8('0x44')](function(_0x2fa127){logger[_0xb4f8('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa127);throw _0x2fa127;});}return _0x209080;})[_0xb4f8('0x22')](respondWithResult(_0xd6f96a,0xc9))[_0xb4f8('0x44')](handleError(_0xd6f96a,null));};exports[_0xb4f8('0x4e')]=function(_0x145972,_0x26ec45){var _0x19723f={'where':{'id':_0x145972[_0xb4f8('0x4f')]['id']}},_0x4f7d97={};_0x4f7d97[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x40')][_0xb4f8('0x45')]);_0x19723f[_0xb4f8('0x35')]=_['intersection'](_0x4f7d97[_0xb4f8('0x2e')],qs['fields'](_0x145972['query'][_0xb4f8('0x34')]));_0x19723f[_0xb4f8('0x35')]=_0x19723f[_0xb4f8('0x35')]['length']?_0x19723f['attributes']:_0x4f7d97[_0xb4f8('0x2e')];if(_0x145972[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x19723f[_0xb4f8('0x42')]=[{'all':!![]}];}_0x19723f=_[_0xb4f8('0x3e')]({},_0x19723f,_0x145972[_0xb4f8('0x3f')]);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0x19723f)['then'](handleEntityNotFound(_0x26ec45,null))[_0xb4f8('0x22')](function(_0x2b5f3b){if(_0x2b5f3b){var _0xb7ff27=_0x2b5f3b[_0xb4f8('0x23')]({'plain':!![]});_0xb7ff27=qs[_0xb4f8('0x50')](_0xb7ff27,['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);_0x145972[_0xb4f8('0x53')]=_[_0xb4f8('0x50')](_0x145972[_0xb4f8('0x53')],['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);return db['Campaign'][_0xb4f8('0x4c')](_[_0xb4f8('0x3e')](_0xb7ff27,_0x145972[_0xb4f8('0x53')]),{'include':_0x145972['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb4f8('0x22')](function(_0x190860){var _0x2b0e43=_0x145972[_0xb4f8('0x49')]['get']({'plain':!![]});if(!_0x2b0e43)throw new Error(_0xb4f8('0x47'));if(_0x2b0e43[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x2b7c6f=_0x190860[_0xb4f8('0x23')]({'plain':!![]});var _0x2ed38c=_0xb4f8('0x24');return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2ed38c,'userProfileId':_0x2b0e43['userProfileId']},'raw':!![]})[_0xb4f8('0x22')](function(_0x4335a2){if(_0x4335a2&&_0x4335a2[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x2b7c6f[_0xb4f8('0x29')],'resourceId':_0x2b7c6f['id'],'type':_0x4335a2[_0xb4f8('0x29')],'sectionId':_0x4335a2['id']},{})[_0xb4f8('0x22')](function(){return _0x190860;});}else{return _0x190860;}})[_0xb4f8('0x44')](function(_0xe413a6){logger['error'](_0xb4f8('0x54'),_0xe413a6);throw _0xe413a6;});}return _0x190860;});}})[_0xb4f8('0x22')](respondWithResult(_0x26ec45,0xc9))['catch'](handleError(_0x26ec45,null));};exports[_0xb4f8('0x21')]=function(_0x5181da,_0x51036a){if(_0x5181da['body']['id']){delete _0x5181da[_0xb4f8('0x53')]['id'];}return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5181da[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x51036a,null))[_0xb4f8('0x22')](saveUpdates(_0x5181da[_0xb4f8('0x53')],null))[_0xb4f8('0x22')](respondWithResult(_0x51036a,null))['catch'](handleError(_0x51036a,null));};exports['destroy']=function(_0x287159,_0x4ad8cc){return db[_0xb4f8('0x40')][_0xb4f8('0x46')]({'where':{'id':_0x287159['params']['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x4ad8cc,null))['then'](removeEntity(_0x4ad8cc,null))[_0xb4f8('0x44')](handleError(_0x4ad8cc,null));};exports[_0xb4f8('0x55')]=function(_0x3d7c55,_0x27957e,_0x5cf35f){var _0x5c61c3={'raw':!![],'where':{}};var _0x2bf0af={};var _0x452fad={'count':0x0,'rows':[]};return db['Campaign'][_0xb4f8('0x56')]({'where':{'id':_0x3d7c55[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x27957e,null))[_0xb4f8('0x22')](function(_0x5b91b7){if(_0x5b91b7){_0x2bf0af[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x57')][_0xb4f8('0x45')]);_0x2bf0af[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3d7c55['query']);_0x2bf0af[_0xb4f8('0x32')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],_0x2bf0af[_0xb4f8('0x31')]);_0x5c61c3[_0xb4f8('0x35')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x5c61c3[_0xb4f8('0x35')]=_0x5c61c3[_0xb4f8('0x35')]['length']?_0x5c61c3[_0xb4f8('0x35')]:_0x2bf0af[_0xb4f8('0x2e')];if(!_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x5c61c3[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x5c61c3[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x5c61c3[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x3d7c55[_0xb4f8('0x31')]['sort']);_0x5c61c3[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x3d7c55[_0xb4f8('0x31')],_0x2bf0af[_0xb4f8('0x32')]));_0x5c61c3[_0xb4f8('0x3b')][_0xb4f8('0x58')]=_0x5b91b7['id'];if(_0x3d7c55[_0xb4f8('0x31')]['filter']){_0x5c61c3[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x5c61c3[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x5c61c3[_0xb4f8('0x35')],function(_0x33d582){var _0x1ebf98={};_0x1ebf98[_0x33d582]={'$like':'%'+_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x1ebf98;})});}_0x5c61c3=_[_0xb4f8('0x3e')]({},_0x5c61c3,_0x3d7c55[_0xb4f8('0x3f')]);return db[_0xb4f8('0x57')][_0xb4f8('0x1d')]({'where':_0x5c61c3[_0xb4f8('0x3b')]})['then'](function(_0x504d70){_0x452fad['count']=_0x504d70;if(_0x3d7c55['query'][_0xb4f8('0x41')]){_0x5c61c3[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0xb4f8('0x43')](_0x5c61c3);})['then'](function(_0x157c94){_0x452fad[_0xb4f8('0x59')]=_0x157c94;return _0x452fad;});}})['then'](respondWithFilteredResult(_0x27957e,_0x5c61c3))[_0xb4f8('0x44')](handleError(_0x27957e,null));};exports[_0xb4f8('0x5a')]=function(_0x3b0a96,_0x143f5e,_0xd679bb){var _0x38cf92={'raw':!![],'where':{}};var _0x10e684={};var _0x38ff42={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x3b0a96[_0xb4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x143f5e,null))[_0xb4f8('0x22')](function(_0x328f16){if(_0x328f16){_0x10e684[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['CmHopperHistory']['rawAttributes']);_0x10e684[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3b0a96[_0xb4f8('0x31')]);_0x10e684[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x10e684[_0xb4f8('0x2e')],_0x10e684[_0xb4f8('0x31')]);_0x38cf92[_0xb4f8('0x35')]=_['intersection'](_0x10e684[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3b0a96['query']['fields']));_0x38cf92[_0xb4f8('0x35')]=_0x38cf92[_0xb4f8('0x35')]['length']?_0x38cf92['attributes']:_0x10e684[_0xb4f8('0x2e')];if(!_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x37')]('nolimit')){_0x38cf92[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x38cf92[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x38cf92[_0xb4f8('0x39')]=qs['sort'](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0x38cf92[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x3b0a96['query'],_0x10e684['filters']));_0x38cf92[_0xb4f8('0x3b')]['CampaignId']=_0x328f16['id'];if(_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x38cf92[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x38cf92[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x38cf92[_0xb4f8('0x35')],function(_0x6fdde9){var _0x56a972={};_0x56a972[_0x6fdde9]={'$like':'%'+_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x56a972;})});}_0x38cf92=_[_0xb4f8('0x3e')]({},_0x38cf92,_0x3b0a96[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5b')]['count']({'where':_0x38cf92['where']})[_0xb4f8('0x22')](function(_0x11107c){_0x38ff42[_0xb4f8('0x1d')]=_0x11107c;if(_0x3b0a96['query'][_0xb4f8('0x41')]){_0x38cf92[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x5b')]['findAll'](_0x38cf92);})[_0xb4f8('0x22')](function(_0x51ac1c){_0x38ff42[_0xb4f8('0x59')]=_0x51ac1c;return _0x38ff42;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x143f5e,_0x38cf92))[_0xb4f8('0x44')](handleError(_0x143f5e,null));};exports[_0xb4f8('0x5c')]=function(_0x2293de,_0x7efc72,_0x28ee6d){var _0x190b52={'raw':!![],'where':{}};var _0x16e5d1={};var _0x5f2268={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x2293de[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x7efc72,null))[_0xb4f8('0x22')](function(_0x260599){if(_0x260599){_0x16e5d1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5d')][_0xb4f8('0x45')]);_0x16e5d1[_0xb4f8('0x31')]=_['keys'](_0x2293de[_0xb4f8('0x31')]);_0x16e5d1[_0xb4f8('0x32')]=_['intersection'](_0x16e5d1[_0xb4f8('0x2e')],_0x16e5d1[_0xb4f8('0x31')]);_0x190b52[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x16e5d1[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x2293de[_0xb4f8('0x31')]['fields']));_0x190b52[_0xb4f8('0x35')]=_0x190b52[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0x190b52[_0xb4f8('0x35')]:_0x16e5d1['model'];if(!_0x2293de['query'][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x190b52[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x190b52[_0xb4f8('0x1a')]=qs['offset'](_0x2293de['query'][_0xb4f8('0x1a')]);}_0x190b52['order']=qs[_0xb4f8('0x3a')](_0x2293de['query'][_0xb4f8('0x3a')]);_0x190b52['where']=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x2293de[_0xb4f8('0x31')],_0x16e5d1[_0xb4f8('0x32')]));_0x190b52['where']['CampaignId']=_0x260599['id'];if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x190b52[_0xb4f8('0x3b')]=_['merge'](_0x190b52[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x190b52[_0xb4f8('0x35')],function(_0x49ce04){var _0x429b74={};_0x429b74[_0x49ce04]={'$like':'%'+_0x2293de[_0xb4f8('0x31')]['filter']+'%'};return _0x429b74;})});}_0x190b52=_[_0xb4f8('0x3e')]({},_0x190b52,_0x2293de[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5d')][_0xb4f8('0x1d')]({'where':_0x190b52[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x317852){_0x5f2268[_0xb4f8('0x1d')]=_0x317852;if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x190b52['include']=[{'all':!![]}];}return db[_0xb4f8('0x5d')][_0xb4f8('0x43')](_0x190b52);})[_0xb4f8('0x22')](function(_0x832959){_0x5f2268[_0xb4f8('0x59')]=_0x832959;return _0x5f2268;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x7efc72,_0x190b52))['catch'](handleError(_0x7efc72,null));};exports['getHopperBlacks']=function(_0x4c3a22,_0x22e240,_0x523834){var _0x1d0f50={'raw':!![],'where':{}};var _0x5cdcf1={};var _0x13ca9c={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x4c3a22['params']['id']}})['then'](handleEntityNotFound(_0x22e240,null))['then'](function(_0xeaf7ea){if(_0xeaf7ea){_0x5cdcf1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5e')][_0xb4f8('0x45')]);_0x5cdcf1[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x4c3a22[_0xb4f8('0x31')]);_0x5cdcf1[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x5cdcf1[_0xb4f8('0x2e')],_0x5cdcf1[_0xb4f8('0x31')]);_0x1d0f50['attributes']=_[_0xb4f8('0x33')](_0x5cdcf1['model'],qs[_0xb4f8('0x34')](_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x1d0f50[_0xb4f8('0x35')]=_0x1d0f50[_0xb4f8('0x35')]['length']?_0x1d0f50[_0xb4f8('0x35')]:_0x5cdcf1[_0xb4f8('0x2e')];if(!_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x1d0f50['limit']=qs[_0xb4f8('0x1c')](_0x4c3a22['query']['limit']);_0x1d0f50[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x4c3a22[_0xb4f8('0x31')]['offset']);}_0x1d0f50[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x4c3a22['query'][_0xb4f8('0x3a')]);_0x1d0f50[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x4c3a22[_0xb4f8('0x31')],_0x5cdcf1[_0xb4f8('0x32')]));_0x1d0f50['where']['CampaignId']=_0xeaf7ea['id'];if(_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x1d0f50[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x1d0f50[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x1d0f50[_0xb4f8('0x35')],function(_0x217727){var _0x402bc5={};_0x402bc5[_0x217727]={'$like':'%'+_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x402bc5;})});}_0x1d0f50=_['merge']({},_0x1d0f50,_0x4c3a22['options']);return db[_0xb4f8('0x5e')][_0xb4f8('0x1d')]({'where':_0x1d0f50[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x2f783c){_0x13ca9c[_0xb4f8('0x1d')]=_0x2f783c;if(_0x4c3a22['query']['includeAll']){_0x1d0f50[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb4f8('0x43')](_0x1d0f50);})[_0xb4f8('0x22')](function(_0x4db640){_0x13ca9c[_0xb4f8('0x59')]=_0x4db640;return _0x13ca9c;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x22e240,_0x1d0f50))[_0xb4f8('0x44')](handleError(_0x22e240,null));};exports['getLists']=function(_0x544389,_0x52dde0,_0x4ad351){var _0x9510d1={};var _0x16a448={};var _0x359578;var _0x1bf012;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x544389[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x52dde0,null))[_0xb4f8('0x22')](function(_0x2fcef7){if(_0x2fcef7){_0x359578=_0x2fcef7;_0x16a448[_0xb4f8('0x2e')]=_['keys'](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x16a448[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x544389[_0xb4f8('0x31')]);_0x16a448['filters']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],_0x16a448[_0xb4f8('0x31')]);_0x9510d1['attributes']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],qs['fields'](_0x544389[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x9510d1['attributes']=_0x9510d1[_0xb4f8('0x35')]['length']?_0x9510d1[_0xb4f8('0x35')]:_0x16a448[_0xb4f8('0x2e')];_0x9510d1[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x544389['query'][_0xb4f8('0x3a')]);_0x9510d1[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x544389[_0xb4f8('0x31')],_0x16a448['filters']));if(_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x9510d1['where']=_[_0xb4f8('0x3e')](_0x9510d1[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x9510d1['attributes'],function(_0x39dfec){var _0x22475={};_0x22475[_0x39dfec]={'$like':'%'+_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x22475;})});}_0x9510d1=_[_0xb4f8('0x3e')]({},_0x9510d1,_0x544389[_0xb4f8('0x3f')]);return _0x359578[_0xb4f8('0x60')](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x650c44){if(_0x650c44){_0x1bf012=_0x650c44[_0xb4f8('0x36')];if(!_0x544389[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x9510d1['limit']=qs[_0xb4f8('0x1c')](_0x544389['query'][_0xb4f8('0x1c')]);_0x9510d1[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x544389['query'][_0xb4f8('0x1a')]);}return _0x359578['getLists'](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x57a8eb){if(_0x57a8eb){return _0x57a8eb?{'count':_0x1bf012,'rows':_0x57a8eb}:null;}})['then'](respondWithResult(_0x52dde0,null))[_0xb4f8('0x44')](handleError(_0x52dde0,null));};exports[_0xb4f8('0x61')]=function(_0x13ff2e,_0x2c3742,_0x261fda){var _0x3377ed,_0xbdc026;var _0x1cdb4e=[];var _0x5e598b=moment()[_0xb4f8('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x13ff2e[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x2c3742,null))[_0xb4f8('0x22')](function(_0x3c6af0){if(_0x3c6af0){_0xbdc026=_0x3c6af0;return _0x3c6af0[_0xb4f8('0x61')](_0x13ff2e[_0xb4f8('0x53')][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x13ff2e[_0xb4f8('0x53')],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x41e7e3){var _0x2da7b7;var _0x2f77e4;_0x3377ed=_0x41e7e3||[];var _0x1a27fd=[];if(_0x41e7e3){for(var _0x223316=0x0;_0x223316<_0x41e7e3[_0xb4f8('0x36')];_0x223316+=0x1){var _0x3c6efe=_0x41e7e3[_0x223316][_0xb4f8('0x23')]({'plain':!![]});_0xbdc026[_0xb4f8('0x65')]=_0x13ff2e['body'][_0xb4f8('0x65')]?_0x13ff2e['body'][_0xb4f8('0x65')]:_0xbdc026[_0xb4f8('0x65')];switch(_0xbdc026[_0xb4f8('0x65')]){case'always':_0x2da7b7=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xb4f8('0x66'),_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId',_0xb4f8('0x51'),_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x66'),_0xb4f8('0x66'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')]('id','ContactId')[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e['params']['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))['from'](_0xb4f8('0x6f'))['where'](_0xb4f8('0x70'))[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())['where'](_0xb4f8('0x71'))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')](_0xb4f8('0x73'))[_0xb4f8('0x74')](_0xb4f8('0x75'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e[_0xb4f8('0x4f')]['id']['toString']()))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('COALESCE(phone,\x27\x27)')[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')]('CampaignId\x20=\x20?',_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;case _0xb4f8('0x78'):_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),'ContactId','ListId','CampaignId',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field']('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id']['toString'](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))['field']('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')]('deletedAt\x20IS\x20NULL')[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x71'))[_0xb4f8('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xb4f8('0x7c'))[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e['params']['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;default:_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')](_0xb4f8('0x77'))[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),_0xb4f8('0x58'),_0xb4f8('0x51'),_0xb4f8('0x52')],squel['select']()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3c6efe['CmListId'][_0xb4f8('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb4f8('0x6e')]();}_0x2f77e4=squel[_0xb4f8('0x79')]()['into'](_0xb4f8('0x7e'))['fromQuery'](['cmHopperId','scheduledAt','phone','OrderBy',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x7f'),'id')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')](_0xb4f8('0x80'),'phone')['field'](_0xb4f8('0x81'),_0xb4f8('0x82'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x83'),'ci')['join'](_0xb4f8('0x77'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xb4f8('0x3b')](_0xb4f8('0x84'),_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x85'),_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())['where']('h.createdAt\x20=\x20?',_0x5e598b))[_0xb4f8('0x6e')]();_0x1a27fd[_0xb4f8('0x86')](db[_0xb4f8('0x87')]['query'](_0x2da7b7));_0x1cdb4e['push'](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x2f77e4));}return BPromise[_0xb4f8('0x88')](_0x1a27fd);}})['then'](function(){return BPromise[_0xb4f8('0x88')](_0x1cdb4e);})[_0xb4f8('0x22')](function(){return _0x3377ed;})[_0xb4f8('0x22')](respondWithResult(_0x2c3742,null))[_0xb4f8('0x44')](handleError(_0x2c3742,null));};exports[_0xb4f8('0x89')]=function(_0x24352f,_0xf312f2,_0x1b8554){return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0xf312f2,null))[_0xb4f8('0x22')](function(_0x24a96c){if(_0x24a96c){return _0x24a96c[_0xb4f8('0x89')](_0x24352f['query'][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x512186){if(_0x512186){return db[_0xb4f8('0x57')][_0xb4f8('0x26')]({'where':{'ListId':_0x24352f[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x512186;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0xf312f2,null))[_0xb4f8('0x44')](handleError(_0xf312f2,null));};exports[_0xb4f8('0x8a')]=function(_0xcb45c2,_0x3fc537,_0x4dc1b7){var _0xd35ee9={};var _0x231489={};var _0x26479;var _0x6448bf;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0xcb45c2[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x3fc537,null))[_0xb4f8('0x22')](function(_0x3cfce2){if(_0x3cfce2){_0x26479=_0x3cfce2;_0x231489[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x231489[_0xb4f8('0x31')]=_['keys'](_0xcb45c2[_0xb4f8('0x31')]);_0x231489[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x231489[_0xb4f8('0x2e')],_0x231489['query']);_0xd35ee9[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x231489['model'],qs[_0xb4f8('0x34')](_0xcb45c2[_0xb4f8('0x31')]['fields']));_0xd35ee9[_0xb4f8('0x35')]=_0xd35ee9[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xd35ee9[_0xb4f8('0x35')]:_0x231489['model'];_0xd35ee9[_0xb4f8('0x39')]=qs['sort'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xd35ee9[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0xcb45c2[_0xb4f8('0x31')],_0x231489['filters']));if(_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0xd35ee9[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0xd35ee9[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0xd35ee9[_0xb4f8('0x35')],function(_0x558c26){var _0x2dda50={};_0x2dda50[_0x558c26]={'$like':'%'+_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x2dda50;})});}_0xd35ee9=_['merge']({},_0xd35ee9,_0xcb45c2[_0xb4f8('0x3f')]);return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x5289c9){if(_0x5289c9){_0x6448bf=_0x5289c9[_0xb4f8('0x36')];if(!_0xcb45c2[_0xb4f8('0x31')]['hasOwnProperty']('nolimit')){_0xd35ee9[_0xb4f8('0x1c')]=qs['limit'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xd35ee9[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x40329d){if(_0x40329d){return _0x40329d?{'count':_0x6448bf,'rows':_0x40329d}:null;}})[_0xb4f8('0x22')](respondWithResult(_0x3fc537,null))[_0xb4f8('0x44')](handleError(_0x3fc537,null));};exports[_0xb4f8('0x8b')]=function(_0x503f08,_0x5a22a0,_0x319c39){var _0x2360b0,_0x48f759;var _0x4f686c=[];var _0x314d21=moment()[_0xb4f8('0x62')](_0xb4f8('0x8c'));return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x503f08[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x5a22a0,null))['then'](function(_0x18c7d3){if(_0x18c7d3){_0x48f759=_0x18c7d3;return _0x18c7d3[_0xb4f8('0x8b')](_0x503f08['body'][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x503f08['body'],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x4abfd0){var _0x19a586;var _0x4b4456;_0x2360b0=_0x4abfd0||[];var _0x53365d=[];if(_0x4abfd0){for(var _0x221c3a=0x0;_0x221c3a<_0x4abfd0['length'];_0x221c3a+=0x1){var _0x3ac0cc=_0x4abfd0[_0x221c3a][_0xb4f8('0x23')]({'plain':!![]});_0x19a586=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper_black')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId','createdAt',_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))[_0xb4f8('0x6b')]('id',_0xb4f8('0x68'))['field'](_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x503f08[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),'CampaignId')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x51'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),'updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x53365d[_0xb4f8('0x86')](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x19a586));}return BPromise[_0xb4f8('0x88')](_0x53365d);}})[_0xb4f8('0x22')](function(){return _0x2360b0;})['then'](respondWithResult(_0x5a22a0,null))[_0xb4f8('0x44')](handleError(_0x5a22a0,null));};exports[_0xb4f8('0x8d')]=function(_0x5100d8,_0x380ca2,_0x13523d){return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x380ca2,null))[_0xb4f8('0x22')](function(_0x1df1a4){if(_0x1df1a4){return _0x1df1a4['removeBlackLists'](_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x19346f){if(_0x19346f){return db[_0xb4f8('0x5e')][_0xb4f8('0x26')]({'where':{'ListId':_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x19346f;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0x380ca2,null))[_0xb4f8('0x44')](handleError(_0x380ca2,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 94cebff..fb720d6 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(_0x284e85,_0x1bfec9){var _0x59ba3d=function(_0x559559){while(--_0x559559){_0x284e85['push'](_0x284e85['shift']());}};_0x59ba3d(++_0x1bfec9);}(_0x7a54,0x106));var _0x47a5=function(_0x52a546,_0x46ad4e){_0x52a546=_0x52a546-0x0;var _0x4178a5=_0x7a54[_0x52a546];return _0x4178a5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index ff3b703..6fa8ce7 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 _0x7846=['../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x485c3c,_0x53bafa){var _0x2e10d4=function(_0x55762c){while(--_0x55762c){_0x485c3c['push'](_0x485c3c['shift']());}};_0x2e10d4(++_0x53bafa);}(_0x7846,0xf4));var _0x6784=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x7846[_0x513047];return _0x15b779;};'use strict';var _=require('lodash');var util=require(_0x6784('0x0'));var moment=require(_0x6784('0x1'));var BPromise=require(_0x6784('0x2'));var rs=require(_0x6784('0x3'));var fs=require('fs');var Redis=require(_0x6784('0x4'));var db=require(_0x6784('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6784('0x6'))(_0x6784('0x7'));var config=require(_0x6784('0x8'));var jayson=require(_0x6784('0x9'));var client=jayson[_0x6784('0xa')][_0x6784('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43df2a,_0x4c3c6d,_0x560e3f){return new BPromise(function(_0x289ae9,_0x36fd9d){return client[_0x6784('0xc')](_0x43df2a,_0x560e3f)[_0x6784('0xd')](function(_0x3cad0a){logger[_0x6784('0xe')](_0x6784('0xf'),_0x4c3c6d,_0x6784('0x10'));logger[_0x6784('0x11')](_0x6784('0x12'),_0x4c3c6d,_0x6784('0x10'),JSON[_0x6784('0x13')](_0x3cad0a));if(_0x3cad0a[_0x6784('0x14')]){if(_0x3cad0a[_0x6784('0x14')][_0x6784('0x15')]===0x1f4){logger[_0x6784('0x14')]('Campaign,\x20%s,\x20%s',_0x4c3c6d,_0x3cad0a[_0x6784('0x14')][_0x6784('0x16')]);return _0x36fd9d(_0x3cad0a[_0x6784('0x14')][_0x6784('0x16')]);}logger['error'](_0x6784('0xf'),_0x4c3c6d,_0x3cad0a[_0x6784('0x14')][_0x6784('0x16')]);return _0x289ae9(_0x3cad0a[_0x6784('0x14')][_0x6784('0x16')]);}else{logger[_0x6784('0xe')](_0x6784('0xf'),_0x4c3c6d,_0x6784('0x10'));_0x289ae9(_0x3cad0a[_0x6784('0x17')][_0x6784('0x16')]);}})[_0x6784('0x18')](function(_0x5f17ca){logger[_0x6784('0x14')](_0x6784('0xf'),_0x4c3c6d,_0x5f17ca);_0x36fd9d(_0x5f17ca);});});}exports[_0x6784('0x19')]=function(_0x2fd8a2){var _0x594ce9=this;return new Promise(function(_0x23f32e,_0x380c09){return db[_0x6784('0x1a')][_0x6784('0x1b')]({'raw':_0x2fd8a2[_0x6784('0x1c')]?_0x2fd8a2['options'][_0x6784('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fd8a2[_0x6784('0x1c')]?_0x2fd8a2['options'][_0x6784('0x1e')]||null:null,'attributes':_0x2fd8a2[_0x6784('0x1c')]?_0x2fd8a2[_0x6784('0x1c')][_0x6784('0x1f')]||null:null,'limit':_0x2fd8a2['options']?_0x2fd8a2[_0x6784('0x1c')][_0x6784('0x20')]||null:null,'include':_0x2fd8a2['options']?_0x2fd8a2[_0x6784('0x1c')][_0x6784('0x21')]?_[_0x6784('0x22')](_0x2fd8a2[_0x6784('0x1c')][_0x6784('0x21')],function(_0x140a38){return{'model':db[_0x140a38['model']],'as':_0x140a38['as'],'attributes':_0x140a38[_0x6784('0x1f')],'include':_0x140a38[_0x6784('0x21')]?_[_0x6784('0x22')](_0x140a38[_0x6784('0x21')],function(_0x4ac355){return{'model':db[_0x4ac355[_0x6784('0x23')]],'as':_0x4ac355['as'],'attributes':_0x4ac355[_0x6784('0x1f')],'include':_0x4ac355[_0x6784('0x21')]?_['map'](_0x4ac355[_0x6784('0x21')],function(_0x543c14){return{'model':db[_0x543c14['model']],'as':_0x543c14['as'],'attributes':_0x543c14['attributes']};}):[]};}):[]};}):[]:[]})[_0x6784('0xd')](function(_0x17346b){logger[_0x6784('0xe')](_0x6784('0x19'),_0x2fd8a2);logger[_0x6784('0x11')](_0x6784('0x19'),_0x2fd8a2,JSON['stringify'](_0x17346b));_0x23f32e(_0x17346b);})[_0x6784('0x18')](function(_0x4b296b){logger['error']('GetCampaign',_0x4b296b[_0x6784('0x16')],_0x2fd8a2);_0x380c09(_0x594ce9[_0x6784('0x14')](0x1f4,_0x4b296b[_0x6784('0x16')]));});});}; \ No newline at end of file +var _0x1fdc=['raw','attributes','limit','include','model','map','GetCampaign','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','findAll','options'];(function(_0x297b65,_0x2f9f76){var _0x58f565=function(_0x33da2b){while(--_0x33da2b){_0x297b65['push'](_0x297b65['shift']());}};_0x58f565(++_0x2f9f76);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x1fdc[_0x178f52];return _0x556f99;};'use strict';var _=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var moment=require('moment');var BPromise=require(_0xc1fd('0x2'));var rs=require(_0xc1fd('0x3'));var fs=require('fs');var Redis=require(_0xc1fd('0x4'));var db=require(_0xc1fd('0x5'))['db'];var utils=require(_0xc1fd('0x6'));var logger=require(_0xc1fd('0x7'))(_0xc1fd('0x8'));var config=require('../../config/environment');var jayson=require(_0xc1fd('0x9'));var client=jayson[_0xc1fd('0xa')][_0xc1fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf6faef,_0x1865d0,_0x3eebe6){return new BPromise(function(_0x43b858,_0x2e06e4){return client[_0xc1fd('0xc')](_0xf6faef,_0x3eebe6)[_0xc1fd('0xd')](function(_0x37fb6c){logger[_0xc1fd('0xe')](_0xc1fd('0xf'),_0x1865d0,'request\x20sent');logger[_0xc1fd('0x10')](_0xc1fd('0x11'),_0x1865d0,'request\x20sent',JSON[_0xc1fd('0x12')](_0x37fb6c));if(_0x37fb6c['error']){if(_0x37fb6c[_0xc1fd('0x13')]['code']===0x1f4){logger[_0xc1fd('0x13')](_0xc1fd('0xf'),_0x1865d0,_0x37fb6c[_0xc1fd('0x13')]['message']);return _0x2e06e4(_0x37fb6c[_0xc1fd('0x13')][_0xc1fd('0x14')]);}logger[_0xc1fd('0x13')](_0xc1fd('0xf'),_0x1865d0,_0x37fb6c['error']['message']);return _0x43b858(_0x37fb6c[_0xc1fd('0x13')][_0xc1fd('0x14')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x1865d0,'request\x20sent');_0x43b858(_0x37fb6c[_0xc1fd('0x15')][_0xc1fd('0x14')]);}})[_0xc1fd('0x16')](function(_0x1ddbff){logger['error'](_0xc1fd('0xf'),_0x1865d0,_0x1ddbff);_0x2e06e4(_0x1ddbff);});});}exports['GetCampaign']=function(_0x3634e3){var _0x115b23=this;return new Promise(function(_0x12398e,_0x3a03a2){return db[_0xc1fd('0x17')][_0xc1fd('0x18')]({'raw':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1a')]===undefined?!![]:![]:!![],'where':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3[_0xc1fd('0x19')]['where']||null:null,'attributes':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3['options'][_0xc1fd('0x1b')]||null:null,'limit':_0x3634e3['options']?_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1c')]||null:null,'include':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3['options'][_0xc1fd('0x1d')]?_['map'](_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1d')],function(_0x3cf4a2){return{'model':db[_0x3cf4a2[_0xc1fd('0x1e')]],'as':_0x3cf4a2['as'],'attributes':_0x3cf4a2[_0xc1fd('0x1b')],'include':_0x3cf4a2[_0xc1fd('0x1d')]?_[_0xc1fd('0x1f')](_0x3cf4a2['include'],function(_0x16509d){return{'model':db[_0x16509d['model']],'as':_0x16509d['as'],'attributes':_0x16509d['attributes'],'include':_0x16509d['include']?_[_0xc1fd('0x1f')](_0x16509d[_0xc1fd('0x1d')],function(_0x236efa){return{'model':db[_0x236efa[_0xc1fd('0x1e')]],'as':_0x236efa['as'],'attributes':_0x236efa[_0xc1fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc1fd('0xd')](function(_0x25bf22){logger['info'](_0xc1fd('0x20'),_0x3634e3);logger[_0xc1fd('0x10')](_0xc1fd('0x20'),_0x3634e3,JSON[_0xc1fd('0x12')](_0x25bf22));_0x12398e(_0x25bf22);})[_0xc1fd('0x16')](function(_0x19bdef){logger[_0xc1fd('0x13')](_0xc1fd('0x20'),_0x19bdef[_0xc1fd('0x14')],_0x3634e3);_0x3a03a2(_0x115b23[_0xc1fd('0x13')](0x1f4,_0x19bdef['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 7051076..b78e907 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 _0xbbfd=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','addBlackLists','put','update','delete','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2fff1f,_0xe506a9){var _0x20080b=function(_0x119d9e){while(--_0x119d9e){_0x2fff1f['push'](_0x2fff1f['shift']());}};_0x20080b(++_0xe506a9);}(_0xbbfd,0x1a8));var _0xdbbf=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xbbfd[_0x1a36a5];return _0x746243;};'use strict';var multer=require('multer');var util=require(_0xdbbf('0x0'));var path=require(_0xdbbf('0x1'));var timeout=require(_0xdbbf('0x2'));var express=require(_0xdbbf('0x3'));var router=express[_0xdbbf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbbf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdbbf('0x6'));var controller=require('./campaign.controller');router[_0xdbbf('0x7')]('/',auth[_0xdbbf('0x8')](),controller[_0xdbbf('0x9')]);router[_0xdbbf('0x7')](_0xdbbf('0xa'),auth[_0xdbbf('0x8')](),controller[_0xdbbf('0xb')]);router[_0xdbbf('0x7')](_0xdbbf('0xc'),auth[_0xdbbf('0x8')](),controller[_0xdbbf('0xd')]);router[_0xdbbf('0x7')](_0xdbbf('0xe'),auth['isAuthenticated'](),controller[_0xdbbf('0xf')]);router[_0xdbbf('0x7')](_0xdbbf('0x10'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xdbbf('0x7')](_0xdbbf('0x11'),auth['isAuthenticated'](),controller[_0xdbbf('0x12')]);router[_0xdbbf('0x7')](_0xdbbf('0x13'),auth[_0xdbbf('0x8')](),controller[_0xdbbf('0x14')]);router[_0xdbbf('0x7')](_0xdbbf('0x15'),auth[_0xdbbf('0x8')](),controller[_0xdbbf('0x16')]);router[_0xdbbf('0x17')]('/',auth[_0xdbbf('0x8')](),controller['create']);router[_0xdbbf('0x17')](_0xdbbf('0x18'),auth[_0xdbbf('0x8')](),controller['clone']);router[_0xdbbf('0x17')]('/:id/lists',auth[_0xdbbf('0x8')](),controller['addLists']);router[_0xdbbf('0x17')](_0xdbbf('0x15'),auth[_0xdbbf('0x8')](),controller[_0xdbbf('0x19')]);router[_0xdbbf('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xdbbf('0x1b')]);router[_0xdbbf('0x1c')](_0xdbbf('0xa'),auth[_0xdbbf('0x8')](),controller['destroy']);router['delete']('/:id/lists',auth[_0xdbbf('0x8')](),controller['removeLists']);router[_0xdbbf('0x1c')](_0xdbbf('0x15'),auth[_0xdbbf('0x8')](),controller[_0xdbbf('0x1d')]);module[_0xdbbf('0x1e')]=router; \ No newline at end of file +var _0x34bd=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','post','addLists','addBlackLists','update','delete','removeLists','removeBlackLists','exports'];(function(_0x25ffd4,_0x16b31d){var _0x414452=function(_0x4440d2){while(--_0x4440d2){_0x25ffd4['push'](_0x25ffd4['shift']());}};_0x414452(++_0x16b31d);}(_0x34bd,0x10e));var _0xd34b=function(_0x4883cb,_0x3df63c){_0x4883cb=_0x4883cb-0x0;var _0x33aad7=_0x34bd[_0x4883cb];return _0x33aad7;};'use strict';var multer=require(_0xd34b('0x0'));var util=require('util');var path=require(_0xd34b('0x1'));var timeout=require(_0xd34b('0x2'));var express=require(_0xd34b('0x3'));var router=express[_0xd34b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd34b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd34b('0x6'));var controller=require(_0xd34b('0x7'));router[_0xd34b('0x8')]('/',auth[_0xd34b('0x9')](),controller['index']);router['get'](_0xd34b('0xa'),auth[_0xd34b('0x9')](),controller['show']);router[_0xd34b('0x8')]('/:id/hoppers',auth[_0xd34b('0x9')](),controller['getHoppers']);router[_0xd34b('0x8')](_0xd34b('0xb'),auth[_0xd34b('0x9')](),controller[_0xd34b('0xc')]);router[_0xd34b('0x8')](_0xd34b('0xd'),auth[_0xd34b('0x9')](),controller[_0xd34b('0xe')]);router[_0xd34b('0x8')](_0xd34b('0xf'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x10')]);router['get'](_0xd34b('0x11'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x12')]);router[_0xd34b('0x8')](_0xd34b('0x13'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xd34b('0x9')](),controller[_0xd34b('0x14')]);router['post'](_0xd34b('0x15'),auth[_0xd34b('0x9')](),controller['clone']);router[_0xd34b('0x16')](_0xd34b('0x11'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x17')]);router[_0xd34b('0x16')](_0xd34b('0x13'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x18')]);router['put'](_0xd34b('0xa'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x19')]);router['delete']('/:id',auth[_0xd34b('0x9')](),controller['destroy']);router[_0xd34b('0x1a')]('/:id/lists',auth[_0xd34b('0x9')](),controller[_0xd34b('0x1b')]);router[_0xd34b('0x1a')](_0xd34b('0x13'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x1c')]);module[_0xd34b('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 1942553..9d22d98 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 _0xfe70=['STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x1e9f4d,_0x293269){var _0x9d6220=function(_0x182a67){while(--_0x182a67){_0x1e9f4d['push'](_0x1e9f4d['shift']());}};_0x9d6220(++_0x293269);}(_0xfe70,0x6a));var _0x0fe7=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xfe70[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x0fe7('0x0'));module[_0x0fe7('0x1')]={'key':{'type':Sequelize[_0x0fe7('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0fe7('0x3')],'get':function(){return this[_0x0fe7('0x4')](_0x0fe7('0x5'));}}}; \ No newline at end of file +var _0xab5e=['STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x2d489a,_0x25ce3c){var _0x11b301=function(_0x2bc6f1){while(--_0x2bc6f1){_0x2d489a['push'](_0x2d489a['shift']());}};_0x11b301(++_0x25ce3c);}(_0xab5e,0x1b8));var _0xeab5=function(_0x2836c2,_0x2524fa){_0x2836c2=_0x2836c2-0x0;var _0x1e6a75=_0xab5e[_0x2836c2];return _0x1e6a75;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0xeab5('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xeab5('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xeab5('0x2')],'get':function(){return this[_0xeab5('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 90cd4da..4709650 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 _0x4be6=['nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','CannedAnswers','end','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','keys','filters','query','intersection','fields','attributes','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4be6,0x7a));var _0x64be=function(_0x2bd0dd,_0x167fb0){_0x2bd0dd=_0x2bd0dd-0x0;var _0x4637bb=_0x4be6[_0x2bd0dd];return _0x4637bb;};'use strict';var emlformat=require(_0x64be('0x0'));var rimraf=require(_0x64be('0x1'));var zipdir=require(_0x64be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64be('0x3'));var moment=require(_0x64be('0x4'));var BPromise=require(_0x64be('0x5'));var Mustache=require('mustache');var util=require(_0x64be('0x6'));var path=require(_0x64be('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x64be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64be('0x9'));var squel=require(_0x64be('0xa'));var crypto=require('crypto');var jsforce=require(_0x64be('0xb'));var deskjs=require(_0x64be('0xc'));var toCsv=require(_0x64be('0xd'));var querystring=require(_0x64be('0xe'));var Papa=require(_0x64be('0xf'));var Redis=require(_0x64be('0x10'));var authService=require(_0x64be('0x11'));var qs=require(_0x64be('0x12'));var as=require(_0x64be('0x13'));var hardwareService=require(_0x64be('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x64be('0x15'));var config=require(_0x64be('0x16'));var licenseUtil=require(_0x64be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x532c02,_0x2bb5cd){_0x2bb5cd=_0x2bb5cd||0xcc;return function(_0x2dd03f){if(_0x2dd03f){return _0x532c02[_0x64be('0x18')](_0x2bb5cd);}return _0x532c02[_0x64be('0x19')](_0x2bb5cd)['end']();};}function respondWithResult(_0x34832b,_0x3d024e){_0x3d024e=_0x3d024e||0xc8;return function(_0x49ede1){if(_0x49ede1){return _0x34832b['status'](_0x3d024e)[_0x64be('0x1a')](_0x49ede1);}};}function respondWithFilteredResult(_0x15cc38,_0x455380){return function(_0x309775){if(_0x309775){var _0x2f16d9=typeof _0x455380[_0x64be('0x1b')]===_0x64be('0x1c')&&typeof _0x455380[_0x64be('0x1d')]===_0x64be('0x1c');var _0x1b2277=_0x309775[_0x64be('0x1e')];var _0x38d75e=_0x2f16d9?0x0:_0x455380[_0x64be('0x1b')];var _0x4fb63f=_0x2f16d9?_0x309775[_0x64be('0x1e')]:_0x455380[_0x64be('0x1b')]+_0x455380[_0x64be('0x1d')];var _0x1d71cb;if(_0x4fb63f>=_0x1b2277){_0x4fb63f=_0x1b2277;_0x1d71cb=0xc8;}else{_0x1d71cb=0xce;}_0x15cc38[_0x64be('0x19')](_0x1d71cb);return _0x15cc38[_0x64be('0x1f')]('Content-Range',_0x38d75e+'-'+_0x4fb63f+'/'+_0x1b2277)['json'](_0x309775);}return null;};}function patchUpdates(_0x4b9a5c){return function(_0x5a09e3){try{jsonpatch['apply'](_0x5a09e3,_0x4b9a5c,!![]);}catch(_0x202d00){return BPromise[_0x64be('0x20')](_0x202d00);}return _0x5a09e3[_0x64be('0x21')]();};}function saveUpdates(_0x1900de,_0x48bf08){return function(_0x1819f2){if(_0x1819f2){return _0x1819f2[_0x64be('0x22')](_0x1900de)[_0x64be('0x23')](function(_0x5558a3){return _0x5558a3;});}return null;};}function removeEntity(_0x2d1740,_0x2f1ad5){return function(_0x1db4e8){if(_0x1db4e8){return _0x1db4e8[_0x64be('0x24')]()[_0x64be('0x23')](function(){var _0x47219c=_0x1db4e8[_0x64be('0x25')]({'plain':!![]});var _0x4b2a8f=_0x64be('0x26');return db['UserProfileResource'][_0x64be('0x24')]({'where':{'type':_0x4b2a8f,'resourceId':_0x47219c['id']}})[_0x64be('0x23')](function(){return _0x1db4e8;});})[_0x64be('0x23')](function(){_0x2d1740['status'](0xcc)[_0x64be('0x27')]();});}};}function handleEntityNotFound(_0x1df124,_0x13a513){return function(_0x4a8787){if(!_0x4a8787){_0x1df124[_0x64be('0x18')](0x194);}return _0x4a8787;};}function handleError(_0x36233b,_0x57e66a){_0x57e66a=_0x57e66a||0x1f4;return function(_0x4736d2){logger[_0x64be('0x28')](_0x4736d2[_0x64be('0x29')]);if(_0x4736d2[_0x64be('0x2a')]){delete _0x4736d2['name'];}_0x36233b['status'](_0x57e66a)[_0x64be('0x2b')](_0x4736d2);};}exports[_0x64be('0x2c')]=function(_0x464841,_0x1e0852){var _0xd3e44a={},_0x2fb94f={},_0x7c0802={'count':0x0,'rows':[]};var _0x24c6ec=_[_0x64be('0x2d')](db[_0x64be('0x2e')][_0x64be('0x2f')],function(_0x3190d1){return{'name':_0x3190d1[_0x64be('0x30')],'type':_0x3190d1['type'][_0x64be('0x31')]};});_0x2fb94f[_0x64be('0x32')]=_['map'](_0x24c6ec,'name');_0x2fb94f['query']=_[_0x64be('0x33')](_0x464841['query']);_0x2fb94f[_0x64be('0x34')]=_['intersection'](_0x2fb94f['model'],_0x2fb94f[_0x64be('0x35')]);_0xd3e44a['attributes']=_[_0x64be('0x36')](_0x2fb94f[_0x64be('0x32')],qs[_0x64be('0x37')](_0x464841[_0x64be('0x35')][_0x64be('0x37')]));_0xd3e44a[_0x64be('0x38')]=_0xd3e44a[_0x64be('0x38')][_0x64be('0x39')]?_0xd3e44a[_0x64be('0x38')]:_0x2fb94f[_0x64be('0x32')];if(!_0x464841[_0x64be('0x35')]['hasOwnProperty'](_0x64be('0x3a'))){_0xd3e44a[_0x64be('0x1d')]=qs[_0x64be('0x1d')](_0x464841[_0x64be('0x35')][_0x64be('0x1d')]);_0xd3e44a[_0x64be('0x1b')]=qs['offset'](_0x464841['query'][_0x64be('0x1b')]);}_0xd3e44a[_0x64be('0x3b')]=qs[_0x64be('0x3c')](_0x464841['query'][_0x64be('0x3c')]);_0xd3e44a[_0x64be('0x3d')]=qs[_0x64be('0x34')](_[_0x64be('0x3e')](_0x464841[_0x64be('0x35')],_0x2fb94f[_0x64be('0x34')]),_0x24c6ec);if(_0x464841[_0x64be('0x35')]['filter']){_0xd3e44a[_0x64be('0x3d')]=_[_0x64be('0x3f')](_0xd3e44a[_0x64be('0x3d')],{'$or':[{'key':{'$like':'%'+_0x464841[_0x64be('0x35')][_0x64be('0x40')]+'%'}},{'value':{'$like':'%'+_0x464841['query'][_0x64be('0x40')]+'%'}}]});}_0xd3e44a=_[_0x64be('0x3f')]({},_0xd3e44a,_0x464841[_0x64be('0x41')]);var _0x43f698={'where':_0xd3e44a[_0x64be('0x3d')]};return db['CannedAnswer'][_0x64be('0x1e')](_0x43f698)[_0x64be('0x23')](function(_0x3f30d2){_0x7c0802[_0x64be('0x1e')]=_0x3f30d2;if(_0x464841['query'][_0x64be('0x42')]){_0xd3e44a[_0x64be('0x43')]=[{'all':!![]}];}return db[_0x64be('0x2e')][_0x64be('0x44')](_0xd3e44a);})[_0x64be('0x23')](function(_0x1a31ff){_0x7c0802[_0x64be('0x45')]=_0x1a31ff;return _0x7c0802;})[_0x64be('0x23')](respondWithFilteredResult(_0x1e0852,_0xd3e44a))[_0x64be('0x46')](handleError(_0x1e0852,null));};exports[_0x64be('0x47')]=function(_0x3262b3,_0x50f51f){var _0x37bfd5={'raw':!![],'where':{'id':_0x3262b3[_0x64be('0x48')]['id']}},_0x377d26={};_0x377d26[_0x64be('0x32')]=_[_0x64be('0x33')](db[_0x64be('0x2e')][_0x64be('0x2f')]);_0x377d26[_0x64be('0x35')]=_[_0x64be('0x33')](_0x3262b3[_0x64be('0x35')]);_0x377d26[_0x64be('0x34')]=_[_0x64be('0x36')](_0x377d26[_0x64be('0x32')],_0x377d26[_0x64be('0x35')]);_0x37bfd5[_0x64be('0x38')]=_[_0x64be('0x36')](_0x377d26[_0x64be('0x32')],qs[_0x64be('0x37')](_0x3262b3[_0x64be('0x35')][_0x64be('0x37')]));_0x37bfd5[_0x64be('0x38')]=_0x37bfd5[_0x64be('0x38')]['length']?_0x37bfd5[_0x64be('0x38')]:_0x377d26['model'];if(_0x3262b3[_0x64be('0x35')][_0x64be('0x42')]){_0x37bfd5[_0x64be('0x43')]=[{'all':!![]}];}_0x37bfd5=_[_0x64be('0x3f')]({},_0x37bfd5,_0x3262b3[_0x64be('0x41')]);return db[_0x64be('0x2e')][_0x64be('0x49')](_0x37bfd5)[_0x64be('0x23')](handleEntityNotFound(_0x50f51f,null))['then'](respondWithResult(_0x50f51f,null))[_0x64be('0x46')](handleError(_0x50f51f,null));};exports['update']=function(_0x15280a,_0x3c8c17){if(_0x15280a[_0x64be('0x4a')]['id']){delete _0x15280a[_0x64be('0x4a')]['id'];}return db[_0x64be('0x2e')]['find']({'where':{'id':_0x15280a['params']['id']}})[_0x64be('0x23')](handleEntityNotFound(_0x3c8c17,null))['then'](saveUpdates(_0x15280a['body'],null))[_0x64be('0x23')](respondWithResult(_0x3c8c17,null))['catch'](handleError(_0x3c8c17,null));};exports[_0x64be('0x24')]=function(_0x371fbf,_0x2856fa){return db[_0x64be('0x2e')][_0x64be('0x49')]({'where':{'id':_0x371fbf[_0x64be('0x48')]['id']}})[_0x64be('0x23')](handleEntityNotFound(_0x2856fa,null))[_0x64be('0x23')](removeEntity(_0x2856fa,null))[_0x64be('0x46')](handleError(_0x2856fa,null));};exports[_0x64be('0x4b')]=function(_0x234257,_0x1c11a4){var _0x550c01={'key':_0x234257['body'][_0x64be('0x31')]};if(_0x234257[_0x64be('0x4a')][_0x64be('0x4c')]){_0x550c01[_0x64be('0x4c')]=_0x234257[_0x64be('0x4a')][_0x64be('0x4c')];}else if(_0x234257[_0x64be('0x4a')][_0x64be('0x4d')]){_0x550c01[_0x64be('0x4d')]=_0x234257[_0x64be('0x4a')][_0x64be('0x4d')];}else if(_0x234257[_0x64be('0x4a')][_0x64be('0x4e')]){_0x550c01[_0x64be('0x4e')]=_0x234257[_0x64be('0x4a')][_0x64be('0x4e')];}else if(_0x234257[_0x64be('0x4a')][_0x64be('0x4f')]){_0x550c01[_0x64be('0x4f')]=_0x234257[_0x64be('0x4a')][_0x64be('0x4f')];}return db[_0x64be('0x2e')][_0x64be('0x49')]({'where':_0x550c01})[_0x64be('0x23')](function(_0xc4828a){if(_0xc4828a){throw new db[(_0x64be('0x50'))][(_0x64be('0x51'))](_0x64be('0x52'));}return db['CannedAnswer']['create'](_0x234257[_0x64be('0x4a')]);})[_0x64be('0x23')](function(_0x19ab72){var _0x1621a7=_0x234257['user'][_0x64be('0x25')]({'plain':!![]});if(!_0x1621a7)throw new Error(_0x64be('0x53'));if(_0x1621a7[_0x64be('0x54')]===_0x64be('0x55')){var _0x551e65=_0x19ab72[_0x64be('0x25')]({'plain':!![]});return db[_0x64be('0x56')][_0x64be('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x1621a7[_0x64be('0x57')]},'raw':!![]})[_0x64be('0x23')](function(_0x38f4b7){if(_0x38f4b7&&_0x38f4b7['autoAssociation']===0x0){return db[_0x64be('0x58')][_0x64be('0x4b')]({'name':_0x551e65[_0x64be('0x2a')],'resourceId':_0x551e65['id'],'type':_0x38f4b7[_0x64be('0x2a')],'sectionId':_0x38f4b7['id']},{})[_0x64be('0x23')](function(){return _0x19ab72;});}else{return _0x19ab72;}})[_0x64be('0x46')](function(_0x4cefe4){logger[_0x64be('0x28')](_0x64be('0x59'),_0x4cefe4);throw _0x4cefe4;});}return _0x19ab72;})[_0x64be('0x23')](respondWithResult(_0x1c11a4,0xc9))[_0x64be('0x46')](handleError(_0x1c11a4,null));}; \ No newline at end of file +var _0xa5fa=['order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x80f331,_0x49a354){var _0x41f184=function(_0x1aa518){while(--_0x1aa518){_0x80f331['push'](_0x80f331['shift']());}};_0x41f184(++_0x49a354);}(_0xa5fa,0x73));var _0xaa5f=function(_0x1bdda0,_0x29dedf){_0x1bdda0=_0x1bdda0-0x0;var _0x269a8f=_0xa5fa[_0x1bdda0];return _0x269a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa5f('0x0'));var jsonpatch=require(_0xaa5f('0x1'));var rp=require(_0xaa5f('0x2'));var moment=require(_0xaa5f('0x3'));var BPromise=require(_0xaa5f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaa5f('0x5'));var sox=require(_0xaa5f('0x6'));var csv=require(_0xaa5f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa5f('0x8'));var _=require('lodash');var squel=require(_0xaa5f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa5f('0xa'));var toCsv=require(_0xaa5f('0x7'));var querystring=require(_0xaa5f('0xb'));var Papa=require('papaparse');var Redis=require(_0xaa5f('0xc'));var authService=require(_0xaa5f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa5f('0xf'))('api');var utils=require(_0xaa5f('0x10'));var config=require(_0xaa5f('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2608bf,_0x2c1676){_0x2c1676=_0x2c1676||0xcc;return function(_0x4ba398){if(_0x4ba398){return _0x2608bf[_0xaa5f('0x12')](_0x2c1676);}return _0x2608bf[_0xaa5f('0x13')](_0x2c1676)[_0xaa5f('0x14')]();};}function respondWithResult(_0x36ce3a,_0xa5de96){_0xa5de96=_0xa5de96||0xc8;return function(_0x3ccc8b){if(_0x3ccc8b){return _0x36ce3a[_0xaa5f('0x13')](_0xa5de96)[_0xaa5f('0x15')](_0x3ccc8b);}};}function respondWithFilteredResult(_0x1d672e,_0x28fa45){return function(_0x5d1d12){if(_0x5d1d12){var _0x25be5f=typeof _0x28fa45[_0xaa5f('0x16')]==='undefined'&&typeof _0x28fa45[_0xaa5f('0x17')]===_0xaa5f('0x18');var _0x3c66f9=_0x5d1d12[_0xaa5f('0x19')];var _0x5a6a14=_0x25be5f?0x0:_0x28fa45['offset'];var _0xefd006=_0x25be5f?_0x5d1d12['count']:_0x28fa45[_0xaa5f('0x16')]+_0x28fa45['limit'];var _0x5b46f5;if(_0xefd006>=_0x3c66f9){_0xefd006=_0x3c66f9;_0x5b46f5=0xc8;}else{_0x5b46f5=0xce;}_0x1d672e['status'](_0x5b46f5);return _0x1d672e[_0xaa5f('0x1a')](_0xaa5f('0x1b'),_0x5a6a14+'-'+_0xefd006+'/'+_0x3c66f9)[_0xaa5f('0x15')](_0x5d1d12);}return null;};}function patchUpdates(_0x3805ea){return function(_0x5b2699){try{jsonpatch[_0xaa5f('0x1c')](_0x5b2699,_0x3805ea,!![]);}catch(_0x5958c7){return BPromise[_0xaa5f('0x1d')](_0x5958c7);}return _0x5b2699[_0xaa5f('0x1e')]();};}function saveUpdates(_0x26e74b,_0x9c0fd){return function(_0x473783){if(_0x473783){return _0x473783[_0xaa5f('0x1f')](_0x26e74b)[_0xaa5f('0x20')](function(_0x3e4933){return _0x3e4933;});}return null;};}function removeEntity(_0x546b6c,_0x4378a2){return function(_0x16b52c){if(_0x16b52c){return _0x16b52c[_0xaa5f('0x21')]()[_0xaa5f('0x20')](function(){var _0x28afde=_0x16b52c[_0xaa5f('0x22')]({'plain':!![]});var _0x15c022='CannedAnswers';return db[_0xaa5f('0x23')][_0xaa5f('0x21')]({'where':{'type':_0x15c022,'resourceId':_0x28afde['id']}})[_0xaa5f('0x20')](function(){return _0x16b52c;});})[_0xaa5f('0x20')](function(){_0x546b6c[_0xaa5f('0x13')](0xcc)[_0xaa5f('0x14')]();});}};}function handleEntityNotFound(_0x1bbce6,_0x1a32cb){return function(_0x5a3ccf){if(!_0x5a3ccf){_0x1bbce6['sendStatus'](0x194);}return _0x5a3ccf;};}function handleError(_0x5652b2,_0xff81f1){_0xff81f1=_0xff81f1||0x1f4;return function(_0x5532e4){logger[_0xaa5f('0x24')](_0x5532e4[_0xaa5f('0x25')]);if(_0x5532e4['name']){delete _0x5532e4[_0xaa5f('0x26')];}_0x5652b2[_0xaa5f('0x13')](_0xff81f1)[_0xaa5f('0x27')](_0x5532e4);};}exports[_0xaa5f('0x28')]=function(_0x2f3d68,_0x3ddaa1){var _0xaa08fb={},_0x181ddc={},_0x269411={'count':0x0,'rows':[]};var _0x2bd8ec=_[_0xaa5f('0x29')](db[_0xaa5f('0x2a')][_0xaa5f('0x2b')],function(_0x4201bd){return{'name':_0x4201bd[_0xaa5f('0x2c')],'type':_0x4201bd['type']['key']};});_0x181ddc['model']=_[_0xaa5f('0x29')](_0x2bd8ec,_0xaa5f('0x26'));_0x181ddc['query']=_['keys'](_0x2f3d68['query']);_0x181ddc[_0xaa5f('0x2d')]=_[_0xaa5f('0x2e')](_0x181ddc[_0xaa5f('0x2f')],_0x181ddc[_0xaa5f('0x30')]);_0xaa08fb[_0xaa5f('0x31')]=_[_0xaa5f('0x2e')](_0x181ddc[_0xaa5f('0x2f')],qs[_0xaa5f('0x32')](_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x32')]));_0xaa08fb[_0xaa5f('0x31')]=_0xaa08fb[_0xaa5f('0x31')][_0xaa5f('0x33')]?_0xaa08fb[_0xaa5f('0x31')]:_0x181ddc['model'];if(!_0x2f3d68[_0xaa5f('0x30')]['hasOwnProperty'](_0xaa5f('0x34'))){_0xaa08fb[_0xaa5f('0x17')]=qs[_0xaa5f('0x17')](_0x2f3d68[_0xaa5f('0x30')]['limit']);_0xaa08fb[_0xaa5f('0x16')]=qs[_0xaa5f('0x16')](_0x2f3d68[_0xaa5f('0x30')]['offset']);}_0xaa08fb[_0xaa5f('0x35')]=qs[_0xaa5f('0x36')](_0x2f3d68['query']['sort']);_0xaa08fb[_0xaa5f('0x37')]=qs[_0xaa5f('0x2d')](_['pick'](_0x2f3d68['query'],_0x181ddc[_0xaa5f('0x2d')]),_0x2bd8ec);if(_0x2f3d68['query'][_0xaa5f('0x38')]){_0xaa08fb[_0xaa5f('0x37')]=_[_0xaa5f('0x39')](_0xaa08fb[_0xaa5f('0x37')],{'$or':[{'key':{'$like':'%'+_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x38')]+'%'}},{'value':{'$like':'%'+_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x38')]+'%'}}]});}_0xaa08fb=_[_0xaa5f('0x39')]({},_0xaa08fb,_0x2f3d68[_0xaa5f('0x3a')]);var _0xb57091={'where':_0xaa08fb[_0xaa5f('0x37')]};return db['CannedAnswer']['count'](_0xb57091)[_0xaa5f('0x20')](function(_0x301d0b){_0x269411[_0xaa5f('0x19')]=_0x301d0b;if(_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x3b')]){_0xaa08fb[_0xaa5f('0x3c')]=[{'all':!![]}];}return db[_0xaa5f('0x2a')][_0xaa5f('0x3d')](_0xaa08fb);})[_0xaa5f('0x20')](function(_0x241223){_0x269411['rows']=_0x241223;return _0x269411;})[_0xaa5f('0x20')](respondWithFilteredResult(_0x3ddaa1,_0xaa08fb))[_0xaa5f('0x3e')](handleError(_0x3ddaa1,null));};exports[_0xaa5f('0x3f')]=function(_0x1491b6,_0xf45aa9){var _0x765dc4={'raw':!![],'where':{'id':_0x1491b6[_0xaa5f('0x40')]['id']}},_0x5f4dbd={};_0x5f4dbd['model']=_[_0xaa5f('0x41')](db[_0xaa5f('0x2a')]['rawAttributes']);_0x5f4dbd['query']=_['keys'](_0x1491b6['query']);_0x5f4dbd[_0xaa5f('0x2d')]=_['intersection'](_0x5f4dbd[_0xaa5f('0x2f')],_0x5f4dbd[_0xaa5f('0x30')]);_0x765dc4[_0xaa5f('0x31')]=_[_0xaa5f('0x2e')](_0x5f4dbd[_0xaa5f('0x2f')],qs[_0xaa5f('0x32')](_0x1491b6['query'][_0xaa5f('0x32')]));_0x765dc4[_0xaa5f('0x31')]=_0x765dc4['attributes'][_0xaa5f('0x33')]?_0x765dc4[_0xaa5f('0x31')]:_0x5f4dbd['model'];if(_0x1491b6[_0xaa5f('0x30')]['includeAll']){_0x765dc4[_0xaa5f('0x3c')]=[{'all':!![]}];}_0x765dc4=_['merge']({},_0x765dc4,_0x1491b6[_0xaa5f('0x3a')]);return db[_0xaa5f('0x2a')][_0xaa5f('0x42')](_0x765dc4)[_0xaa5f('0x20')](handleEntityNotFound(_0xf45aa9,null))[_0xaa5f('0x20')](respondWithResult(_0xf45aa9,null))[_0xaa5f('0x3e')](handleError(_0xf45aa9,null));};exports['update']=function(_0x325169,_0x49c3b8){if(_0x325169[_0xaa5f('0x43')]['id']){delete _0x325169['body']['id'];}return db[_0xaa5f('0x2a')][_0xaa5f('0x42')]({'where':{'id':_0x325169[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x20')](handleEntityNotFound(_0x49c3b8,null))['then'](saveUpdates(_0x325169[_0xaa5f('0x43')],null))[_0xaa5f('0x20')](respondWithResult(_0x49c3b8,null))['catch'](handleError(_0x49c3b8,null));};exports['destroy']=function(_0x443a3d,_0xf32077){return db[_0xaa5f('0x2a')][_0xaa5f('0x42')]({'where':{'id':_0x443a3d[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x20')](handleEntityNotFound(_0xf32077,null))[_0xaa5f('0x20')](removeEntity(_0xf32077,null))[_0xaa5f('0x3e')](handleError(_0xf32077,null));};exports['create']=function(_0x38cdbf,_0x246fd5){var _0x2d9d52={'key':_0x38cdbf['body'][_0xaa5f('0x44')]};if(_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x45')]){_0x2d9d52['MailAccountId']=_0x38cdbf[_0xaa5f('0x43')]['MailAccountId'];}else if(_0x38cdbf[_0xaa5f('0x43')]['SmsAccountId']){_0x2d9d52[_0xaa5f('0x46')]=_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x46')];}else if(_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x47')]){_0x2d9d52[_0xaa5f('0x47')]=_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x47')];}else if(_0x38cdbf['body'][_0xaa5f('0x48')]){_0x2d9d52[_0xaa5f('0x48')]=_0x38cdbf[_0xaa5f('0x43')]['ChatWebsiteId'];}return db[_0xaa5f('0x2a')]['find']({'where':_0x2d9d52})[_0xaa5f('0x20')](function(_0x3252ed){if(_0x3252ed){throw new db[(_0xaa5f('0x49'))][(_0xaa5f('0x4a'))](_0xaa5f('0x4b'));}return db[_0xaa5f('0x2a')]['create'](_0x38cdbf[_0xaa5f('0x43')]);})[_0xaa5f('0x20')](function(_0x4082e7){var _0x388bc2=_0x38cdbf['user'][_0xaa5f('0x22')]({'plain':!![]});if(!_0x388bc2)throw new Error(_0xaa5f('0x4c'));if(_0x388bc2[_0xaa5f('0x4d')]===_0xaa5f('0x4e')){var _0x26fe32=_0x4082e7['get']({'plain':!![]});return db[_0xaa5f('0x4f')][_0xaa5f('0x42')]({'where':{'name':_0xaa5f('0x50'),'userProfileId':_0x388bc2['userProfileId']},'raw':!![]})['then'](function(_0x54d8b8){if(_0x54d8b8&&_0x54d8b8[_0xaa5f('0x51')]===0x0){return db[_0xaa5f('0x23')][_0xaa5f('0x52')]({'name':_0x26fe32['name'],'resourceId':_0x26fe32['id'],'type':_0x54d8b8[_0xaa5f('0x26')],'sectionId':_0x54d8b8['id']},{})[_0xaa5f('0x20')](function(){return _0x4082e7;});}else{return _0x4082e7;}})['catch'](function(_0x36adf1){logger[_0xaa5f('0x24')](_0xaa5f('0x53'),_0x36adf1);throw _0x36adf1;});}return _0x4082e7;})[_0xaa5f('0x20')](respondWithResult(_0x246fd5,0xc9))[_0xaa5f('0x3e')](handleError(_0x246fd5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 0f53ffd..8df0ef5 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 _0x1c52=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','utf8mb4'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x1c52,0xa9));var _0x21c5=function(_0x4c9f9e,_0x2bfb7b){_0x4c9f9e=_0x4c9f9e-0x0;var _0x4f86b0=_0x1c52[_0x4c9f9e];return _0x4f86b0;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var logger=require('../../config/logger')(_0x21c5('0x2'));var moment=require('moment');var BPromise=require(_0x21c5('0x3'));var rp=require(_0x21c5('0x4'));var fs=require('fs');var path=require(_0x21c5('0x5'));var rimraf=require(_0x21c5('0x6'));var config=require(_0x21c5('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x21c5('0x8')]=function(_0x33489a,_0xc7e95b){return _0x33489a[_0x21c5('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21c5('0xa'),'collate':_0x21c5('0xb')});}; \ No newline at end of file +var _0xc27f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x176afa,_0x1b2eaa){var _0x1394c7=function(_0x323b7f){while(--_0x323b7f){_0x176afa['push'](_0x176afa['shift']());}};_0x1394c7(++_0x1b2eaa);}(_0xc27f,0x85));var _0xfc27=function(_0x2718cf,_0x48ebf6){_0x2718cf=_0x2718cf-0x0;var _0x89ce77=_0xc27f[_0x2718cf];return _0x89ce77;};'use strict';var _=require(_0xfc27('0x0'));var util=require(_0xfc27('0x1'));var logger=require(_0xfc27('0x2'))('api');var moment=require(_0xfc27('0x3'));var BPromise=require(_0xfc27('0x4'));var rp=require(_0xfc27('0x5'));var fs=require('fs');var path=require(_0xfc27('0x6'));var rimraf=require(_0xfc27('0x7'));var config=require(_0xfc27('0x8'));var attributes=require(_0xfc27('0x9'));module[_0xfc27('0xa')]=function(_0x14c86a,_0x15c405){return _0x14c86a[_0xfc27('0xb')](_0xfc27('0xc'),attributes,{'tableName':_0xfc27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfc27('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 0bee4d4..a888d5d 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(_0x16ee79,_0x3076f3){var _0x23951e=function(_0x5a1b49){while(--_0x5a1b49){_0x16ee79['push'](_0x16ee79['shift']());}};_0x23951e(++_0x3076f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x22ff5d,_0x171b60){var _0x4d706b=function(_0x163f26){while(--_0x163f26){_0x22ff5d['push'](_0x22ff5d['shift']());}};_0x4d706b(++_0x171b60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 c8d975b..6cde163 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 _0x3002=['fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','/:id','isAuthenticated','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x33fdb7,_0x1582b3){var _0xdd55dd=function(_0x48a3e3){while(--_0x48a3e3){_0x33fdb7['push'](_0x33fdb7['shift']());}};_0xdd55dd(++_0x1582b3);}(_0x3002,0x193));var _0x2300=function(_0x14a28d,_0x37e7c3){_0x14a28d=_0x14a28d-0x0;var _0x5e5336=_0x3002[_0x14a28d];return _0x5e5336;};'use strict';var multer=require(_0x2300('0x0'));var util=require(_0x2300('0x1'));var path=require(_0x2300('0x2'));var timeout=require(_0x2300('0x3'));var express=require(_0x2300('0x4'));var router=express['Router']();var fs_extra=require(_0x2300('0x5'));var auth=require(_0x2300('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2300('0x7'));var controller=require(_0x2300('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2300('0x9'),auth[_0x2300('0xa')](),controller[_0x2300('0xb')]);router[_0x2300('0xc')]('/',auth[_0x2300('0xa')](),controller['create']);router['put'](_0x2300('0x9'),auth[_0x2300('0xa')](),controller[_0x2300('0xd')]);router[_0x2300('0xe')](_0x2300('0x9'),auth[_0x2300('0xa')](),controller[_0x2300('0xf')]);module[_0x2300('0x10')]=router; \ No newline at end of file +var _0x74dd=['/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put'];(function(_0x10dfe6,_0x1a7a72){var _0x34dfe2=function(_0x2db5a8){while(--_0x2db5a8){_0x10dfe6['push'](_0x10dfe6['shift']());}};_0x34dfe2(++_0x1a7a72);}(_0x74dd,0xc3));var _0xd74d=function(_0x165834,_0x49e6d7){_0x165834=_0x165834-0x0;var _0x2f8df1=_0x74dd[_0x165834];return _0x2f8df1;};'use strict';var multer=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var path=require(_0xd74d('0x2'));var timeout=require('connect-timeout');var express=require(_0xd74d('0x3'));var router=express['Router']();var fs_extra=require(_0xd74d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd74d('0x5'));var config=require(_0xd74d('0x6'));var controller=require('./cannedAnswer.controller');router[_0xd74d('0x7')]('/',auth[_0xd74d('0x8')](),controller[_0xd74d('0x9')]);router[_0xd74d('0x7')]('/:id',auth[_0xd74d('0x8')](),controller[_0xd74d('0xa')]);router[_0xd74d('0xb')]('/',auth[_0xd74d('0x8')](),controller['create']);router[_0xd74d('0xc')](_0xd74d('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd74d('0x8')](),controller[_0xd74d('0xe')]);module[_0xd74d('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index c561c53..11f80d2 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 _0xb575=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb575,0xda));var _0x5b57=function(_0x3be2f5,_0x1d0f43){_0x3be2f5=_0x3be2f5-0x0;var _0xd6c45a=_0xb575[_0x3be2f5];return _0xd6c45a;};'use strict';var Sequelize=require(_0x5b57('0x0'));module[_0x5b57('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5b57('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5b57('0x3')]},'channel':{'type':Sequelize[_0x5b57('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5b57('0x3')]},'lastdata':{'type':Sequelize[_0x5b57('0x3')]},'duration':{'type':Sequelize[_0x5b57('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5b57('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5b57('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5b57('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5b57('0x3')]},'linkedid':{'type':Sequelize[_0x5b57('0x3')]},'sequence':{'type':Sequelize[_0x5b57('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5b57('0x3')]},'tag':{'type':Sequelize[_0x5b57('0x3')]}}; \ No newline at end of file +var _0x8bf7=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8bf7,0x139));var _0x78bf=function(_0x1e62f5,_0x4aba3f){_0x1e62f5=_0x1e62f5-0x0;var _0x5dfa2c=_0x8bf7[_0x1e62f5];return _0x5dfa2c;};'use strict';var Sequelize=require(_0x78bf('0x0'));module[_0x78bf('0x1')]={'calldate':{'type':Sequelize[_0x78bf('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x78bf('0x3')]},'src':{'type':Sequelize[_0x78bf('0x3')]},'dst':{'type':Sequelize[_0x78bf('0x3')]},'dcontext':{'type':Sequelize[_0x78bf('0x3')]},'channel':{'type':Sequelize[_0x78bf('0x3')]},'dstchannel':{'type':Sequelize[_0x78bf('0x3')]},'lastapp':{'type':Sequelize[_0x78bf('0x3')]},'lastdata':{'type':Sequelize[_0x78bf('0x3')]},'duration':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x78bf('0x3')]},'amaflags':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x78bf('0x3')]},'userfield':{'type':Sequelize[_0x78bf('0x3')]},'uniqueid':{'type':Sequelize[_0x78bf('0x3')]},'linkedid':{'type':Sequelize[_0x78bf('0x3')]},'sequence':{'type':Sequelize[_0x78bf('0x3')]},'peeraccount':{'type':Sequelize[_0x78bf('0x3')]},'type':{'type':Sequelize[_0x78bf('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e1ebaed..0e183b8 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 _0xfd20=['map','Cdr','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(_0xd88db2,_0x44e190){var _0x5f0c9b=function(_0x1dddd7){while(--_0x1dddd7){_0xd88db2['push'](_0xd88db2['shift']());}};_0x5f0c9b(++_0x44e190);}(_0xfd20,0x66));var _0x0fd2=function(_0x2c416a,_0x732630){_0x2c416a=_0x2c416a-0x0;var _0x4218d5=_0xfd20[_0x2c416a];return _0x4218d5;};'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['Cdr']['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['Cdr'][_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 +var _0xabce=['../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','Cdr','rawAttributes','type','model','query','keys','filters','attributes','fields','length','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','params','intersection','include','options','find','create','body','describe','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'];(function(_0x23e779,_0x1663ff){var _0x3b0649=function(_0x1c4f69){while(--_0x1c4f69){_0x23e779['push'](_0x23e779['shift']());}};_0x3b0649(++_0x1663ff);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'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('0x2b')](_0x149170,_0xeabc('0x28'));_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x31')](_0x48fb52[_0xeabc('0x30')]);_0x2b568f[_0xeabc('0x32')]=_['intersection'](_0x2b568f[_0xeabc('0x2f')],_0x2b568f[_0xeabc('0x30')]);_0x38572d[_0xeabc('0x33')]=_['intersection'](_0x2b568f[_0xeabc('0x2f')],qs[_0xeabc('0x34')](_0x48fb52[_0xeabc('0x30')]['fields']));_0x38572d[_0xeabc('0x33')]=_0x38572d[_0xeabc('0x33')][_0xeabc('0x35')]?_0x38572d['attributes']:_0x2b568f[_0xeabc('0x2f')];if(!_0x48fb52[_0xeabc('0x30')]['hasOwnProperty']('nolimit')){_0x38572d[_0xeabc('0x1d')]=qs[_0xeabc('0x1d')](_0x48fb52['query'][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52[_0xeabc('0x30')][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x36')](_0x48fb52['query'][_0xeabc('0x36')]);_0x38572d[_0xeabc('0x37')]=qs[_0xeabc('0x32')](_['pick'](_0x48fb52['query'],_0x2b568f[_0xeabc('0x32')]),_0x149170);if(_0x48fb52['query'][_0xeabc('0x38')]){_0x38572d['where']=_['merge'](_0x38572d['where'],{'$or':_['map'](_0x149170,function(_0x1e222a){if(_0x1e222a['type']!==_0xeabc('0x39')){var _0x1ebfb6={};_0x1ebfb6[_0x1e222a['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x30')]['filter']+'%'};return _0x1ebfb6;}})});}_0x38572d=_[_0xeabc('0x3a')]({},_0x38572d,_0x48fb52['options']);var _0xbd7f03={'where':_0x38572d[_0xeabc('0x37')]};return db[_0xeabc('0x2c')]['count'](_0xbd7f03)['then'](function(_0x54a3ae){_0x2f8633[_0xeabc('0x1e')]=_0x54a3ae;if(_0x48fb52[_0xeabc('0x30')][_0xeabc('0x3b')]){_0x38572d['include']=[{'all':!![]}];}return db['Cdr'][_0xeabc('0x3c')](_0x38572d);})[_0xeabc('0x25')](function(_0x5e9cb3){_0x2f8633[_0xeabc('0x3d')]=_0x5e9cb3;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))[_0xeabc('0x3e')](handleError(_0x2163e6,null));};exports['show']=function(_0x5defaa,_0x5cd04d){var _0x25958b={'raw':!![],'where':{'id':_0x5defaa[_0xeabc('0x3f')]['id']}},_0x37c926={};_0x37c926[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')]['rawAttributes']);_0x37c926[_0xeabc('0x30')]=_[_0xeabc('0x31')](_0x5defaa[_0xeabc('0x30')]);_0x37c926[_0xeabc('0x32')]=_[_0xeabc('0x40')](_0x37c926['model'],_0x37c926['query']);_0x25958b[_0xeabc('0x33')]=_['intersection'](_0x37c926[_0xeabc('0x2f')],qs[_0xeabc('0x34')](_0x5defaa['query'][_0xeabc('0x34')]));_0x25958b[_0xeabc('0x33')]=_0x25958b[_0xeabc('0x33')][_0xeabc('0x35')]?_0x25958b[_0xeabc('0x33')]:_0x37c926[_0xeabc('0x2f')];if(_0x5defaa[_0xeabc('0x30')]['includeAll']){_0x25958b[_0xeabc('0x41')]=[{'all':!![]}];}_0x25958b=_[_0xeabc('0x3a')]({},_0x25958b,_0x5defaa[_0xeabc('0x42')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0x25958b)[_0xeabc('0x25')](handleEntityNotFound(_0x5cd04d,null))[_0xeabc('0x25')](respondWithResult(_0x5cd04d,null))[_0xeabc('0x3e')](handleError(_0x5cd04d,null));};exports[_0xeabc('0x44')]=function(_0x44e714,_0x5689fc){return db[_0xeabc('0x2c')][_0xeabc('0x44')](_0x44e714[_0xeabc('0x45')],{})[_0xeabc('0x25')](respondWithResult(_0x5689fc,0xc9))[_0xeabc('0x3e')](handleError(_0x5689fc,null));};exports[_0xeabc('0x24')]=function(_0x268d95,_0x48df43){if(_0x268d95[_0xeabc('0x45')]['id']){delete _0x268d95[_0xeabc('0x45')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x268d95[_0xeabc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x48df43,null))[_0xeabc('0x25')](saveUpdates(_0x268d95[_0xeabc('0x45')],null))[_0xeabc('0x25')](respondWithResult(_0x48df43,null))[_0xeabc('0x3e')](handleError(_0x48df43,null));};exports['destroy']=function(_0x400b82,_0x1b3aa4){return db['Cdr'][_0xeabc('0x43')]({'where':{'id':_0x400b82['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1b3aa4,null))['then'](removeEntity(_0x1b3aa4,null))[_0xeabc('0x3e')](handleError(_0x1b3aa4,null));};exports[_0xeabc('0x46')]=function(_0x38f988,_0x1524c3){return db[_0xeabc('0x2c')][_0xeabc('0x46')]()[_0xeabc('0x25')](respondWithResult(_0x1524c3,null))[_0xeabc('0x3e')](handleError(_0x1524c3,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index acb21eb..552800b 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(_0x36804f,_0x2258bb){var _0x5b8c16=function(_0x2dddfb){while(--_0x2dddfb){_0x36804f['push'](_0x36804f['shift']());}};_0x5b8c16(++_0x2258bb);}(_0x7a54,0x106));var _0x47a5=function(_0x85d266,_0x58ce44){_0x85d266=_0x85d266-0x0;var _0x3f94cc=_0x7a54[_0x85d266];return _0x3f94cc;};'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(_0x5a0918,_0x3f3a02){var _0x524d59=function(_0x1a0c72){while(--_0x1a0c72){_0x5a0918['push'](_0x5a0918['shift']());}};_0x524d59(++_0x3f3a02);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index beb7c8f..615d7c0 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 _0xf9b3=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','rpc','../../config/environment','client','http','request','request\x20sent'];(function(_0x4ef151,_0x43c5ab){var _0x4141bf=function(_0x385ed4){while(--_0x385ed4){_0x4ef151['push'](_0x4ef151['shift']());}};_0x4141bf(++_0x43c5ab);}(_0xf9b3,0xbe));var _0x3f9b=function(_0x16f9e7,_0xc36467){_0x16f9e7=_0x16f9e7-0x0;var _0x5ab7d7=_0xf9b3[_0x16f9e7];return _0x5ab7d7;};'use strict';var _=require(_0x3f9b('0x0'));var util=require(_0x3f9b('0x1'));var moment=require('moment');var BPromise=require(_0x3f9b('0x2'));var rs=require(_0x3f9b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3f9b('0x4'));var config=require(_0x3f9b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3f9b('0x6')][_0x3f9b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x353284,_0x60c580,_0x47bc04){return new BPromise(function(_0x57bba5,_0x17148f){return client[_0x3f9b('0x8')](_0x353284,_0x47bc04)['then'](function(_0x32125e){logger['info']('Cdr,\x20%s,\x20%s',_0x60c580,_0x3f9b('0x9'));logger[_0x3f9b('0xa')](_0x3f9b('0xb'),_0x60c580,_0x3f9b('0x9'),JSON[_0x3f9b('0xc')](_0x32125e));if(_0x32125e[_0x3f9b('0xd')]){if(_0x32125e[_0x3f9b('0xd')][_0x3f9b('0xe')]===0x1f4){logger[_0x3f9b('0xd')]('Cdr,\x20%s,\x20%s',_0x60c580,_0x32125e[_0x3f9b('0xd')][_0x3f9b('0xf')]);return _0x17148f(_0x32125e['error'][_0x3f9b('0xf')]);}logger[_0x3f9b('0xd')](_0x3f9b('0x10'),_0x60c580,_0x32125e[_0x3f9b('0xd')]['message']);return _0x57bba5(_0x32125e['error']['message']);}else{logger[_0x3f9b('0x11')](_0x3f9b('0x10'),_0x60c580,'request\x20sent');_0x57bba5(_0x32125e[_0x3f9b('0x12')][_0x3f9b('0xf')]);}})[_0x3f9b('0x13')](function(_0x3f89e9){logger[_0x3f9b('0xd')](_0x3f9b('0x10'),_0x60c580,_0x3f89e9);_0x17148f(_0x3f89e9);});});} \ No newline at end of file +var _0x41d2=['error','code','message','info','request\x20sent','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x164271,_0x55ecdc){var _0xfd6455=function(_0x2b0d25){while(--_0x2b0d25){_0x164271['push'](_0x164271['shift']());}};_0xfd6455(++_0x55ecdc);}(_0x41d2,0x18c));var _0x241d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x41d2[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x241d('0x0'));var util=require(_0x241d('0x1'));var moment=require(_0x241d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x241d('0x3'));var db=require(_0x241d('0x4'))['db'];var utils=require(_0x241d('0x5'));var logger=require(_0x241d('0x6'))(_0x241d('0x7'));var config=require(_0x241d('0x8'));var jayson=require(_0x241d('0x9'));var client=jayson[_0x241d('0xa')][_0x241d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aadd,_0x3c1d54,_0x3447e){return new BPromise(function(_0x39ed5b,_0x60afc2){return client[_0x241d('0xc')](_0x39aadd,_0x3447e)[_0x241d('0xd')](function(_0x282534){logger['info'](_0x241d('0xe'),_0x3c1d54,'request\x20sent');logger[_0x241d('0xf')](_0x241d('0x10'),_0x3c1d54,'request\x20sent',JSON[_0x241d('0x11')](_0x282534));if(_0x282534[_0x241d('0x12')]){if(_0x282534[_0x241d('0x12')][_0x241d('0x13')]===0x1f4){logger[_0x241d('0x12')](_0x241d('0xe'),_0x3c1d54,_0x282534[_0x241d('0x12')][_0x241d('0x14')]);return _0x60afc2(_0x282534[_0x241d('0x12')][_0x241d('0x14')]);}logger['error'](_0x241d('0xe'),_0x3c1d54,_0x282534[_0x241d('0x12')]['message']);return _0x39ed5b(_0x282534[_0x241d('0x12')][_0x241d('0x14')]);}else{logger[_0x241d('0x15')]('Cdr,\x20%s,\x20%s',_0x3c1d54,_0x241d('0x16'));_0x39ed5b(_0x282534['result'][_0x241d('0x14')]);}})['catch'](function(_0x4a0e59){logger['error']('Cdr,\x20%s,\x20%s',_0x3c1d54,_0x4a0e59);_0x60afc2(_0x4a0e59);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 67feabb..938923c 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(_0x3b1582,_0x31a7ff){var _0x3f2d2f=function(_0x3a6914){while(--_0x3a6914){_0x3b1582['push'](_0x3b1582['shift']());}};_0x3f2d2f(++_0x31a7ff);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 d57309a..c7e0f7e 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 _0x527b=['TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x1b578b,_0x5bf84c){var _0x5ba023=function(_0x30a3a3){while(--_0x30a3a3){_0x1b578b['push'](_0x1b578b['shift']());}};_0x5ba023(++_0x5bf84c);}(_0x527b,0x139));var _0xb527=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x527b[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require('sequelize');module[_0xb527('0x0')]={'priority':{'type':Sequelize[_0xb527('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb527('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb527('0x3')],'defaultValue':_0xb527('0x4')}}; \ No newline at end of file +var _0x8750=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x16ca76,_0x258915){var _0xbfbbad=function(_0x5e1266){while(--_0x5e1266){_0x16ca76['push'](_0x16ca76['shift']());}};_0xbfbbad(++_0x258915);}(_0x8750,0x14c));var _0x0875=function(_0xa11dda,_0x4bbf0c){_0xa11dda=_0xa11dda-0x0;var _0x3a2138=_0x8750[_0xa11dda];return _0x3a2138;};'use strict';var Sequelize=require(_0x0875('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0875('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0875('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0875('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0875('0x2')],'defaultValue':_0x0875('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 924deef..a815873 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 _0x6b24=['fast-json-patch','request-promise','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','ChatApplication','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','body','params','rimraf','zip-dir'];(function(_0x9e5cfb,_0x5e1a0f){var _0x5a3140=function(_0x287290){while(--_0x287290){_0x9e5cfb['push'](_0x9e5cfb['shift']());}};_0x5a3140(++_0x5e1a0f);}(_0x6b24,0x1ce));var _0x46b2=function(_0x51fc7c,_0x475586){_0x51fc7c=_0x51fc7c-0x0;var _0x1482a7=_0x6b24[_0x51fc7c];return _0x1482a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46b2('0x0'));var zipdir=require(_0x46b2('0x1'));var jsonpatch=require(_0x46b2('0x2'));var rp=require(_0x46b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46b2('0x4'));var path=require('path');var sox=require(_0x46b2('0x5'));var csv=require('to-csv');var ejs=require(_0x46b2('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46b2('0x7'));var crypto=require(_0x46b2('0x8'));var jsforce=require(_0x46b2('0x9'));var deskjs=require(_0x46b2('0xa'));var toCsv=require(_0x46b2('0xb'));var querystring=require(_0x46b2('0xc'));var Papa=require(_0x46b2('0xd'));var Redis=require(_0x46b2('0xe'));var authService=require(_0x46b2('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46b2('0x10'));var logger=require(_0x46b2('0x11'))(_0x46b2('0x12'));var utils=require('../../config/utils');var config=require(_0x46b2('0x13'));var licenseUtil=require(_0x46b2('0x14'));var db=require(_0x46b2('0x15'))['db'];function respondWithStatusCode(_0x5343fc,_0x468ae9){_0x468ae9=_0x468ae9||0xcc;return function(_0x886e41){if(_0x886e41){return _0x5343fc[_0x46b2('0x16')](_0x468ae9);}return _0x5343fc[_0x46b2('0x17')](_0x468ae9)[_0x46b2('0x18')]();};}function respondWithResult(_0x1cf0f0,_0x3ff25d){_0x3ff25d=_0x3ff25d||0xc8;return function(_0x228261){if(_0x228261){return _0x1cf0f0[_0x46b2('0x17')](_0x3ff25d)[_0x46b2('0x19')](_0x228261);}};}function respondWithFilteredResult(_0x563b05,_0x43e0d9){return function(_0x5b49da){if(_0x5b49da){var _0x49479c=typeof _0x43e0d9[_0x46b2('0x1a')]===_0x46b2('0x1b')&&typeof _0x43e0d9[_0x46b2('0x1c')]===_0x46b2('0x1b');var _0x373c49=_0x5b49da[_0x46b2('0x1d')];var _0x226ab5=_0x49479c?0x0:_0x43e0d9['offset'];var _0x316c39=_0x49479c?_0x5b49da['count']:_0x43e0d9[_0x46b2('0x1a')]+_0x43e0d9[_0x46b2('0x1c')];var _0x9b4723;if(_0x316c39>=_0x373c49){_0x316c39=_0x373c49;_0x9b4723=0xc8;}else{_0x9b4723=0xce;}_0x563b05['status'](_0x9b4723);return _0x563b05[_0x46b2('0x1e')](_0x46b2('0x1f'),_0x226ab5+'-'+_0x316c39+'/'+_0x373c49)[_0x46b2('0x19')](_0x5b49da);}return null;};}function patchUpdates(_0x1e5c35){return function(_0x350f85){try{jsonpatch[_0x46b2('0x20')](_0x350f85,_0x1e5c35,!![]);}catch(_0x3a0ea5){return BPromise[_0x46b2('0x21')](_0x3a0ea5);}return _0x350f85[_0x46b2('0x22')]();};}function saveUpdates(_0x259f2f,_0x29ade9){return function(_0x1b5fbe){if(_0x1b5fbe){return _0x1b5fbe[_0x46b2('0x23')](_0x259f2f)[_0x46b2('0x24')](function(_0x1caa77){return _0x1caa77;});}return null;};}function removeEntity(_0x50011b,_0x209519){return function(_0x4c2983){if(_0x4c2983){return _0x4c2983['destroy']()[_0x46b2('0x24')](function(){_0x50011b[_0x46b2('0x17')](0xcc)[_0x46b2('0x18')]();});}};}function handleEntityNotFound(_0x134526,_0x16f646){return function(_0x58069e){if(!_0x58069e){_0x134526[_0x46b2('0x16')](0x194);}return _0x58069e;};}function handleError(_0x138f6c,_0x5ca1c7){_0x5ca1c7=_0x5ca1c7||0x1f4;return function(_0x3c5997){logger['error'](_0x3c5997[_0x46b2('0x25')]);if(_0x3c5997[_0x46b2('0x26')]){delete _0x3c5997[_0x46b2('0x26')];}_0x138f6c[_0x46b2('0x17')](_0x5ca1c7)[_0x46b2('0x27')](_0x3c5997);};}exports[_0x46b2('0x28')]=function(_0x74615,_0x1a6caf){var _0x429496={'raw':!![],'where':{'id':_0x74615['params']['id']}},_0x20ccb2={};_0x20ccb2['model']=_['keys'](db[_0x46b2('0x29')][_0x46b2('0x2a')]);_0x20ccb2[_0x46b2('0x2b')]=_['keys'](_0x74615[_0x46b2('0x2b')]);_0x20ccb2[_0x46b2('0x2c')]=_['intersection'](_0x20ccb2[_0x46b2('0x2d')],_0x20ccb2[_0x46b2('0x2b')]);_0x429496[_0x46b2('0x2e')]=_[_0x46b2('0x2f')](_0x20ccb2[_0x46b2('0x2d')],qs[_0x46b2('0x30')](_0x74615[_0x46b2('0x2b')][_0x46b2('0x30')]));_0x429496[_0x46b2('0x2e')]=_0x429496['attributes'][_0x46b2('0x31')]?_0x429496[_0x46b2('0x2e')]:_0x20ccb2[_0x46b2('0x2d')];if(_0x74615['query'][_0x46b2('0x32')]){_0x429496[_0x46b2('0x33')]=[{'all':!![]}];}_0x429496=_[_0x46b2('0x34')]({},_0x429496,_0x74615[_0x46b2('0x35')]);return db['ChatApplication'][_0x46b2('0x36')](_0x429496)['then'](handleEntityNotFound(_0x1a6caf,null))[_0x46b2('0x24')](respondWithResult(_0x1a6caf,null))[_0x46b2('0x37')](handleError(_0x1a6caf,null));};exports[_0x46b2('0x23')]=function(_0x8bae67,_0x12c5a5){if(_0x8bae67[_0x46b2('0x38')]['id']){delete _0x8bae67[_0x46b2('0x38')]['id'];}return db['ChatApplication'][_0x46b2('0x36')]({'where':{'id':_0x8bae67[_0x46b2('0x39')]['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x12c5a5,null))[_0x46b2('0x24')](saveUpdates(_0x8bae67[_0x46b2('0x38')],null))[_0x46b2('0x24')](respondWithResult(_0x12c5a5,null))[_0x46b2('0x37')](handleError(_0x12c5a5,null));};exports['destroy']=function(_0x4a2d30,_0x4cb294){return db[_0x46b2('0x29')][_0x46b2('0x36')]({'where':{'id':_0x4a2d30['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x4cb294,null))['then'](removeEntity(_0x4cb294,null))['catch'](handleError(_0x4cb294,null));}; \ No newline at end of file +var _0xce3a=['../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x476d90,_0x459710){var _0x56f307=function(_0x1082fb){while(--_0x1082fb){_0x476d90['push'](_0x476d90['shift']());}};_0x56f307(++_0x459710);}(_0xce3a,0x194));var _0xace3=function(_0x11e1b6,_0x28e796){_0x11e1b6=_0x11e1b6-0x0;var _0x275329=_0xce3a[_0x11e1b6];return _0x275329;};'use strict';var emlformat=require(_0xace3('0x0'));var rimraf=require(_0xace3('0x1'));var zipdir=require(_0xace3('0x2'));var jsonpatch=require(_0xace3('0x3'));var rp=require(_0xace3('0x4'));var moment=require(_0xace3('0x5'));var BPromise=require(_0xace3('0x6'));var Mustache=require(_0xace3('0x7'));var util=require(_0xace3('0x8'));var path=require(_0xace3('0x9'));var sox=require(_0xace3('0xa'));var csv=require(_0xace3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xace3('0xc'));var _=require(_0xace3('0xd'));var squel=require(_0xace3('0xe'));var crypto=require(_0xace3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xace3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xace3('0x11'));var Papa=require(_0xace3('0x12'));var Redis=require(_0xace3('0x13'));var authService=require(_0xace3('0x14'));var qs=require(_0xace3('0x15'));var as=require(_0xace3('0x16'));var hardwareService=require(_0xace3('0x17'));var logger=require(_0xace3('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be1f1,_0x3566ad){_0x3566ad=_0x3566ad||0xcc;return function(_0x5ac505){if(_0x5ac505){return _0x4be1f1[_0xace3('0x1a')](_0x3566ad);}return _0x4be1f1['status'](_0x3566ad)[_0xace3('0x1b')]();};}function respondWithResult(_0x19dc11,_0x16ef3e){_0x16ef3e=_0x16ef3e||0xc8;return function(_0x5983b9){if(_0x5983b9){return _0x19dc11[_0xace3('0x1c')](_0x16ef3e)[_0xace3('0x1d')](_0x5983b9);}};}function respondWithFilteredResult(_0x1cfa39,_0x54ec35){return function(_0x51ed6c){if(_0x51ed6c){var _0x1ad5c0=typeof _0x54ec35[_0xace3('0x1e')]===_0xace3('0x1f')&&typeof _0x54ec35[_0xace3('0x20')]==='undefined';var _0x3debc2=_0x51ed6c[_0xace3('0x21')];var _0x39536d=_0x1ad5c0?0x0:_0x54ec35[_0xace3('0x1e')];var _0x2ef370=_0x1ad5c0?_0x51ed6c[_0xace3('0x21')]:_0x54ec35['offset']+_0x54ec35['limit'];var _0x2ee18d;if(_0x2ef370>=_0x3debc2){_0x2ef370=_0x3debc2;_0x2ee18d=0xc8;}else{_0x2ee18d=0xce;}_0x1cfa39['status'](_0x2ee18d);return _0x1cfa39[_0xace3('0x22')](_0xace3('0x23'),_0x39536d+'-'+_0x2ef370+'/'+_0x3debc2)['json'](_0x51ed6c);}return null;};}function patchUpdates(_0xab91f7){return function(_0x16f406){try{jsonpatch['apply'](_0x16f406,_0xab91f7,!![]);}catch(_0x4b90c9){return BPromise['reject'](_0x4b90c9);}return _0x16f406[_0xace3('0x24')]();};}function saveUpdates(_0x1ed5fe,_0x3bbe41){return function(_0x34a7a5){if(_0x34a7a5){return _0x34a7a5[_0xace3('0x25')](_0x1ed5fe)[_0xace3('0x26')](function(_0xa9b5ed){return _0xa9b5ed;});}return null;};}function removeEntity(_0x3c0a56,_0x5a4c02){return function(_0x5980fe){if(_0x5980fe){return _0x5980fe['destroy']()['then'](function(){_0x3c0a56[_0xace3('0x1c')](0xcc)[_0xace3('0x1b')]();});}};}function handleEntityNotFound(_0x2c137d,_0xf42f4){return function(_0x4b287c){if(!_0x4b287c){_0x2c137d[_0xace3('0x1a')](0x194);}return _0x4b287c;};}function handleError(_0x3b4cb5,_0x144f86){_0x144f86=_0x144f86||0x1f4;return function(_0x32e39d){logger[_0xace3('0x27')](_0x32e39d[_0xace3('0x28')]);if(_0x32e39d[_0xace3('0x29')]){delete _0x32e39d['name'];}_0x3b4cb5[_0xace3('0x1c')](_0x144f86)[_0xace3('0x2a')](_0x32e39d);};}exports[_0xace3('0x2b')]=function(_0x3aa28a,_0x599e73){var _0x56efae={'raw':!![],'where':{'id':_0x3aa28a[_0xace3('0x2c')]['id']}},_0x3b1ad1={};_0x3b1ad1[_0xace3('0x2d')]=_[_0xace3('0x2e')](db['ChatApplication'][_0xace3('0x2f')]);_0x3b1ad1[_0xace3('0x30')]=_[_0xace3('0x2e')](_0x3aa28a[_0xace3('0x30')]);_0x3b1ad1[_0xace3('0x31')]=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],_0x3b1ad1['query']);_0x56efae['attributes']=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],qs[_0xace3('0x33')](_0x3aa28a[_0xace3('0x30')][_0xace3('0x33')]));_0x56efae[_0xace3('0x34')]=_0x56efae[_0xace3('0x34')][_0xace3('0x35')]?_0x56efae[_0xace3('0x34')]:_0x3b1ad1[_0xace3('0x2d')];if(_0x3aa28a[_0xace3('0x30')][_0xace3('0x36')]){_0x56efae[_0xace3('0x37')]=[{'all':!![]}];}_0x56efae=_[_0xace3('0x38')]({},_0x56efae,_0x3aa28a[_0xace3('0x39')]);return db[_0xace3('0x3a')]['find'](_0x56efae)[_0xace3('0x26')](handleEntityNotFound(_0x599e73,null))[_0xace3('0x26')](respondWithResult(_0x599e73,null))[_0xace3('0x3b')](handleError(_0x599e73,null));};exports[_0xace3('0x25')]=function(_0x39a447,_0xe0243b){if(_0x39a447[_0xace3('0x3c')]['id']){delete _0x39a447[_0xace3('0x3c')]['id'];}return db[_0xace3('0x3a')]['find']({'where':{'id':_0x39a447[_0xace3('0x2c')]['id']}})[_0xace3('0x26')](handleEntityNotFound(_0xe0243b,null))[_0xace3('0x26')](saveUpdates(_0x39a447[_0xace3('0x3c')],null))['then'](respondWithResult(_0xe0243b,null))['catch'](handleError(_0xe0243b,null));};exports['destroy']=function(_0x541d51,_0x181d79){return db[_0xace3('0x3a')]['find']({'where':{'id':_0x541d51[_0xace3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x181d79,null))['then'](removeEntity(_0x181d79,null))[_0xace3('0x3b')](handleError(_0x181d79,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 10d3d20..88d3dc8 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 _0xf39b=['../../config/environment','exports','define','chat_applications','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x479217,_0x4aa75b){var _0x58f8d8=function(_0x2e68b6){while(--_0x2e68b6){_0x479217['push'](_0x479217['shift']());}};_0x58f8d8(++_0x4aa75b);}(_0xf39b,0x100));var _0xbf39=function(_0x645eef,_0x2e532b){_0x645eef=_0x645eef-0x0;var _0x4fcbf6=_0xf39b[_0x645eef];return _0x4fcbf6;};'use strict';var _=require(_0xbf39('0x0'));var util=require(_0xbf39('0x1'));var logger=require(_0xbf39('0x2'))('api');var moment=require(_0xbf39('0x3'));var BPromise=require(_0xbf39('0x4'));var rp=require(_0xbf39('0x5'));var fs=require('fs');var path=require(_0xbf39('0x6'));var rimraf=require(_0xbf39('0x7'));var config=require(_0xbf39('0x8'));var attributes=require('./chatApplication.attributes');module[_0xbf39('0x9')]=function(_0x551bac,_0x5a1672){return _0x551bac[_0xbf39('0xa')]('ChatApplication',attributes,{'tableName':_0xbf39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8e0d=['moment','request-promise','path','rimraf','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x8517b6,_0x1e38eb){var _0x2b1844=function(_0x4460b0){while(--_0x4460b0){_0x8517b6['push'](_0x8517b6['shift']());}};_0x2b1844(++_0x1e38eb);}(_0x8e0d,0x82));var _0xd8e0=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x8e0d[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd8e0('0x1'));var moment=require(_0xd8e0('0x2'));var BPromise=require('bluebird');var rp=require(_0xd8e0('0x3'));var fs=require('fs');var path=require(_0xd8e0('0x4'));var rimraf=require(_0xd8e0('0x5'));var config=require(_0xd8e0('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x2e79ab,_0x33ff41){return _0x2e79ab[_0xd8e0('0x7')](_0xd8e0('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8e0('0x9'),'collate':_0xd8e0('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 317a898..64ae0a3 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 _0x1638=['../../config/utils','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3568d3,_0x5dd241){var _0x3e2065=function(_0x599771){while(--_0x599771){_0x3568d3['push'](_0x3568d3['shift']());}};_0x3e2065(++_0x5dd241);}(_0x1638,0x9b));var _0x8163=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0x1638[_0x487131];return _0xf320ff;};'use strict';var _=require(_0x8163('0x0'));var util=require(_0x8163('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8163('0x2'));var fs=require('fs');var Redis=require(_0x8163('0x3'));var db=require(_0x8163('0x4'))['db'];var utils=require(_0x8163('0x5'));var logger=require(_0x8163('0x6'))(_0x8163('0x7'));var config=require('../../config/environment');var jayson=require(_0x8163('0x8'));var client=jayson[_0x8163('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x510c87,_0x2701ec,_0x446dc5){return new BPromise(function(_0xe22fbe,_0x430b71){return client['request'](_0x510c87,_0x446dc5)[_0x8163('0xa')](function(_0x1e049e){logger['info']('ChatApplication,\x20%s,\x20%s',_0x2701ec,_0x8163('0xb'));logger[_0x8163('0xc')](_0x8163('0xd'),_0x2701ec,'request\x20sent',JSON[_0x8163('0xe')](_0x1e049e));if(_0x1e049e[_0x8163('0xf')]){if(_0x1e049e[_0x8163('0xf')][_0x8163('0x10')]===0x1f4){logger[_0x8163('0xf')](_0x8163('0x11'),_0x2701ec,_0x1e049e[_0x8163('0xf')]['message']);return _0x430b71(_0x1e049e[_0x8163('0xf')][_0x8163('0x12')]);}logger['error'](_0x8163('0x11'),_0x2701ec,_0x1e049e['error']['message']);return _0xe22fbe(_0x1e049e[_0x8163('0xf')][_0x8163('0x12')]);}else{logger['info'](_0x8163('0x11'),_0x2701ec,_0x8163('0xb'));_0xe22fbe(_0x1e049e[_0x8163('0x13')]['message']);}})['catch'](function(_0xb66455){logger[_0x8163('0xf')]('ChatApplication,\x20%s,\x20%s',_0x2701ec,_0xb66455);_0x430b71(_0xb66455);});});} \ No newline at end of file +var _0x33dd=['jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x33dd,0x1db));var _0xd33d=function(_0x354264,_0x58e09b){_0x354264=_0x354264-0x0;var _0x3a5e8e=_0x33dd[_0x354264];return _0x3a5e8e;};'use strict';var _=require('lodash');var util=require(_0xd33d('0x0'));var moment=require(_0xd33d('0x1'));var BPromise=require(_0xd33d('0x2'));var rs=require(_0xd33d('0x3'));var fs=require('fs');var Redis=require(_0xd33d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd33d('0x5'));var logger=require(_0xd33d('0x6'))('rpc');var config=require(_0xd33d('0x7'));var jayson=require(_0xd33d('0x8'));var client=jayson['client'][_0xd33d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247d16,_0x4632b7,_0x23ac7a){return new BPromise(function(_0x4f503d,_0x43dfe0){return client[_0xd33d('0xa')](_0x247d16,_0x23ac7a)[_0xd33d('0xb')](function(_0x202625){logger[_0xd33d('0xc')](_0xd33d('0xd'),_0x4632b7,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4632b7,_0xd33d('0xe'),JSON[_0xd33d('0xf')](_0x202625));if(_0x202625[_0xd33d('0x10')]){if(_0x202625[_0xd33d('0x10')][_0xd33d('0x11')]===0x1f4){logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x202625[_0xd33d('0x10')]['message']);return _0x43dfe0(_0x202625['error'][_0xd33d('0x12')]);}logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x202625[_0xd33d('0x10')][_0xd33d('0x12')]);return _0x4f503d(_0x202625[_0xd33d('0x10')]['message']);}else{logger['info'](_0xd33d('0xd'),_0x4632b7,_0xd33d('0xe'));_0x4f503d(_0x202625[_0xd33d('0x13')]['message']);}})[_0xd33d('0x14')](function(_0x5490dd){logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x5490dd);_0x43dfe0(_0x5490dd);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 8189931..27720d5 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 _0x5b71=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x5b71,0x1d3));var _0x15b7=function(_0x159431,_0x59c210){_0x159431=_0x159431-0x0;var _0x5874eb=_0x5b71[_0x159431];return _0x5874eb;};'use strict';var multer=require(_0x15b7('0x0'));var util=require(_0x15b7('0x1'));var path=require(_0x15b7('0x2'));var timeout=require(_0x15b7('0x3'));var express=require(_0x15b7('0x4'));var router=express['Router']();var fs_extra=require(_0x15b7('0x5'));var auth=require(_0x15b7('0x6'));var interaction=require(_0x15b7('0x7'));var config=require(_0x15b7('0x8'));var controller=require('./chatApplication.controller');router['get'](_0x15b7('0x9'),auth[_0x15b7('0xa')](),controller[_0x15b7('0xb')]);router[_0x15b7('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x15b7('0xd')]);router['delete'](_0x15b7('0x9'),auth[_0x15b7('0xa')](),controller[_0x15b7('0xe')]);module[_0x15b7('0xf')]=router; \ No newline at end of file +var _0xe2c0=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x53bea5,_0xfbebf2){var _0x10e9bc=function(_0x565ef6){while(--_0x565ef6){_0x53bea5['push'](_0x53bea5['shift']());}};_0x10e9bc(++_0xfbebf2);}(_0xe2c0,0x126));var _0x0e2c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe2c0[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x0e2c('0x0'));var util=require(_0x0e2c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e2c('0x2'));var router=express[_0x0e2c('0x3')]();var fs_extra=require(_0x0e2c('0x4'));var auth=require(_0x0e2c('0x5'));var interaction=require(_0x0e2c('0x6'));var config=require(_0x0e2c('0x7'));var controller=require(_0x0e2c('0x8'));router['get'](_0x0e2c('0x9'),auth[_0x0e2c('0xa')](),controller[_0x0e2c('0xb')]);router[_0x0e2c('0xc')](_0x0e2c('0x9'),auth['isAuthenticated'](),controller[_0x0e2c('0xd')]);router[_0x0e2c('0xe')]('/:id',auth[_0x0e2c('0xa')](),controller[_0x0e2c('0xf')]);module[_0x0e2c('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 7874338..526073b 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 _0x75b6=['sequelize','STRING','BOOLEAN'];(function(_0x2fea7e,_0x391079){var _0x48f51a=function(_0x428f95){while(--_0x428f95){_0x2fea7e['push'](_0x2fea7e['shift']());}};_0x48f51a(++_0x391079);}(_0x75b6,0x1a4));var _0x675b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75b6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x675b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x675b('0x1')]},'write':{'type':Sequelize[_0x675b('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x110e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2e3f2c,_0x1ff03d){var _0x214fa6=function(_0x1fefce){while(--_0x1fefce){_0x2e3f2c['push'](_0x2e3f2c['shift']());}};_0x214fa6(++_0x1ff03d);}(_0x110e,0x68));var _0xe110=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x110e[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xe110('0x0'));module[_0xe110('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe110('0x2')]},'write':{'type':Sequelize[_0xe110('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index a9a91bc..da110ef 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 _0xc944=['params','intersection','merge','catch','create','body','find','destroy','describe','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','ChatInternalMessage','$gte','split','format','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatGroup.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xc944,0x73));var _0x4c94=function(_0xd2932d,_0x4b2f3f){_0xd2932d=_0xd2932d-0x0;var _0xa15bcb=_0xc944[_0xd2932d];return _0xa15bcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c94('0x0'));var zipdir=require(_0x4c94('0x1'));var jsonpatch=require(_0x4c94('0x2'));var rp=require(_0x4c94('0x3'));var moment=require(_0x4c94('0x4'));var BPromise=require(_0x4c94('0x5'));var Mustache=require(_0x4c94('0x6'));var util=require(_0x4c94('0x7'));var path=require('path');var sox=require(_0x4c94('0x8'));var csv=require(_0x4c94('0x9'));var ejs=require(_0x4c94('0xa'));var fs=require('fs');var fs_extra=require(_0x4c94('0xb'));var _=require(_0x4c94('0xc'));var squel=require('squel');var crypto=require(_0x4c94('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c94('0xe'));var Papa=require(_0x4c94('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4c94('0x10'));var hardwareService=require(_0x4c94('0x11'));var logger=require(_0x4c94('0x12'))(_0x4c94('0x13'));var utils=require(_0x4c94('0x14'));var config=require(_0x4c94('0x15'));var licenseUtil=require(_0x4c94('0x16'));var db=require('../../mysqldb')['db'];config[_0x4c94('0x17')]=_['defaults'](config[_0x4c94('0x17')],{'host':_0x4c94('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c94('0x17')]));require(_0x4c94('0x19'))['register'](socket);function respondWithStatusCode(_0x11e0de,_0x4dc9e4){_0x4dc9e4=_0x4dc9e4||0xcc;return function(_0x451647){if(_0x451647){return _0x11e0de['sendStatus'](_0x4dc9e4);}return _0x11e0de[_0x4c94('0x1a')](_0x4dc9e4)[_0x4c94('0x1b')]();};}function respondWithResult(_0x48d35a,_0x22456e){_0x22456e=_0x22456e||0xc8;return function(_0xedb1b0){if(_0xedb1b0){return _0x48d35a['status'](_0x22456e)['json'](_0xedb1b0);}};}function respondWithFilteredResult(_0x5e21a1,_0x1513a2){return function(_0x1121c1){if(_0x1121c1){var _0x193a86=typeof _0x1513a2[_0x4c94('0x1c')]===_0x4c94('0x1d')&&typeof _0x1513a2[_0x4c94('0x1e')]==='undefined';var _0x5c61de=_0x1121c1[_0x4c94('0x1f')];var _0x29f007=_0x193a86?0x0:_0x1513a2[_0x4c94('0x1c')];var _0x4462ae=_0x193a86?_0x1121c1[_0x4c94('0x1f')]:_0x1513a2['offset']+_0x1513a2[_0x4c94('0x1e')];var _0x2673cf;if(_0x4462ae>=_0x5c61de){_0x4462ae=_0x5c61de;_0x2673cf=0xc8;}else{_0x2673cf=0xce;}_0x5e21a1[_0x4c94('0x1a')](_0x2673cf);return _0x5e21a1[_0x4c94('0x20')](_0x4c94('0x21'),_0x29f007+'-'+_0x4462ae+'/'+_0x5c61de)[_0x4c94('0x22')](_0x1121c1);}return null;};}function patchUpdates(_0x4911e5){return function(_0x39eefa){try{jsonpatch[_0x4c94('0x23')](_0x39eefa,_0x4911e5,!![]);}catch(_0xbf26d7){return BPromise[_0x4c94('0x24')](_0xbf26d7);}return _0x39eefa['save']();};}function saveUpdates(_0x49f5b6,_0x5ce4db){return function(_0x2da797){if(_0x2da797){return _0x2da797[_0x4c94('0x25')](_0x49f5b6)['then'](function(_0x8f0b5f){return _0x8f0b5f;});}return null;};}function removeEntity(_0x2fa754,_0x5e2056){return function(_0x3f56a8){if(_0x3f56a8){return _0x3f56a8['destroy']()[_0x4c94('0x26')](function(){_0x2fa754[_0x4c94('0x1a')](0xcc)[_0x4c94('0x1b')]();});}};}function handleEntityNotFound(_0x282662,_0x6bcf94){return function(_0x3338b5){if(!_0x3338b5){_0x282662[_0x4c94('0x27')](0x194);}return _0x3338b5;};}function handleError(_0x410e8a,_0x1e5fd4){_0x1e5fd4=_0x1e5fd4||0x1f4;return function(_0x553704){logger['error'](_0x553704[_0x4c94('0x28')]);if(_0x553704['name']){delete _0x553704[_0x4c94('0x29')];}_0x410e8a[_0x4c94('0x1a')](_0x1e5fd4)[_0x4c94('0x2a')](_0x553704);};}exports[_0x4c94('0x2b')]=function(_0x180fd4,_0x5a13d3){var _0x5679fd={},_0x17d39f={},_0x35fc5a={'count':0x0,'rows':[]};var _0x524556=_[_0x4c94('0x2c')](db[_0x4c94('0x2d')][_0x4c94('0x2e')],function(_0x5ea2fb){return{'name':_0x5ea2fb[_0x4c94('0x2f')],'type':_0x5ea2fb[_0x4c94('0x30')][_0x4c94('0x31')]};});_0x17d39f[_0x4c94('0x32')]=_[_0x4c94('0x2c')](_0x524556,_0x4c94('0x29'));_0x17d39f[_0x4c94('0x33')]=_[_0x4c94('0x34')](_0x180fd4[_0x4c94('0x33')]);_0x17d39f[_0x4c94('0x35')]=_['intersection'](_0x17d39f[_0x4c94('0x32')],_0x17d39f[_0x4c94('0x33')]);_0x5679fd[_0x4c94('0x36')]=_['intersection'](_0x17d39f[_0x4c94('0x32')],qs[_0x4c94('0x37')](_0x180fd4[_0x4c94('0x33')]['fields']));_0x5679fd[_0x4c94('0x36')]=_0x5679fd[_0x4c94('0x36')][_0x4c94('0x38')]?_0x5679fd[_0x4c94('0x36')]:_0x17d39f[_0x4c94('0x32')];if(!_0x180fd4[_0x4c94('0x33')][_0x4c94('0x39')](_0x4c94('0x3a'))){_0x5679fd[_0x4c94('0x1e')]=qs[_0x4c94('0x1e')](_0x180fd4['query'][_0x4c94('0x1e')]);_0x5679fd[_0x4c94('0x1c')]=qs['offset'](_0x180fd4[_0x4c94('0x33')]['offset']);}_0x5679fd[_0x4c94('0x3b')]=qs[_0x4c94('0x3c')](_0x180fd4[_0x4c94('0x33')][_0x4c94('0x3c')]);_0x5679fd[_0x4c94('0x3d')]=qs[_0x4c94('0x35')](_[_0x4c94('0x3e')](_0x180fd4[_0x4c94('0x33')],_0x17d39f[_0x4c94('0x35')]),_0x524556);if(_0x180fd4[_0x4c94('0x33')][_0x4c94('0x3f')]){_0x5679fd[_0x4c94('0x3d')]=_['merge'](_0x5679fd['where'],{'$or':_['map'](_0x524556,function(_0x1a98b3){if(_0x1a98b3[_0x4c94('0x30')]!==_0x4c94('0x40')){var _0x58e074={};_0x58e074[_0x1a98b3[_0x4c94('0x29')]]={'$like':'%'+_0x180fd4[_0x4c94('0x33')][_0x4c94('0x3f')]+'%'};return _0x58e074;}})});}_0x5679fd=_['merge']({},_0x5679fd,_0x180fd4[_0x4c94('0x41')]);var _0x1e7044={'where':_0x5679fd[_0x4c94('0x3d')]};return db[_0x4c94('0x2d')]['count'](_0x1e7044)[_0x4c94('0x26')](function(_0x1deab5){_0x35fc5a['count']=_0x1deab5;if(_0x180fd4['query'][_0x4c94('0x42')]){_0x5679fd[_0x4c94('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0x4c94('0x44')](_0x5679fd);})[_0x4c94('0x26')](function(_0x5cbac5){_0x35fc5a[_0x4c94('0x45')]=_0x5cbac5;return _0x35fc5a;})[_0x4c94('0x26')](respondWithFilteredResult(_0x5a13d3,_0x5679fd))['catch'](handleError(_0x5a13d3,null));};exports[_0x4c94('0x46')]=function(_0x114d5e,_0x4e6b86){var _0x2060fa={'raw':!![],'where':{'id':_0x114d5e[_0x4c94('0x47')]['id']}},_0x369367={};_0x369367[_0x4c94('0x32')]=_[_0x4c94('0x34')](db[_0x4c94('0x2d')][_0x4c94('0x2e')]);_0x369367[_0x4c94('0x33')]=_[_0x4c94('0x34')](_0x114d5e[_0x4c94('0x33')]);_0x369367[_0x4c94('0x35')]=_[_0x4c94('0x48')](_0x369367[_0x4c94('0x32')],_0x369367[_0x4c94('0x33')]);_0x2060fa['attributes']=_['intersection'](_0x369367[_0x4c94('0x32')],qs['fields'](_0x114d5e[_0x4c94('0x33')][_0x4c94('0x37')]));_0x2060fa[_0x4c94('0x36')]=_0x2060fa[_0x4c94('0x36')][_0x4c94('0x38')]?_0x2060fa['attributes']:_0x369367[_0x4c94('0x32')];if(_0x114d5e[_0x4c94('0x33')][_0x4c94('0x42')]){_0x2060fa['include']=[{'all':!![]}];}_0x2060fa=_[_0x4c94('0x49')]({},_0x2060fa,_0x114d5e[_0x4c94('0x41')]);return db['ChatGroup']['find'](_0x2060fa)[_0x4c94('0x26')](handleEntityNotFound(_0x4e6b86,null))[_0x4c94('0x26')](respondWithResult(_0x4e6b86,null))[_0x4c94('0x4a')](handleError(_0x4e6b86,null));};exports[_0x4c94('0x4b')]=function(_0x1f594b,_0x4b316d){return db[_0x4c94('0x2d')][_0x4c94('0x4b')](_0x1f594b['body'],{})[_0x4c94('0x26')](respondWithResult(_0x4b316d,0xc9))[_0x4c94('0x4a')](handleError(_0x4b316d,null));};exports[_0x4c94('0x25')]=function(_0x5af266,_0x54dff5){if(_0x5af266[_0x4c94('0x4c')]['id']){delete _0x5af266[_0x4c94('0x4c')]['id'];}return db[_0x4c94('0x2d')][_0x4c94('0x4d')]({'where':{'id':_0x5af266[_0x4c94('0x47')]['id']}})[_0x4c94('0x26')](handleEntityNotFound(_0x54dff5,null))[_0x4c94('0x26')](saveUpdates(_0x5af266[_0x4c94('0x4c')],null))[_0x4c94('0x26')](respondWithResult(_0x54dff5,null))[_0x4c94('0x4a')](handleError(_0x54dff5,null));};exports[_0x4c94('0x4e')]=function(_0x2d625e,_0x3d7c29){return db[_0x4c94('0x2d')]['find']({'where':{'id':_0x2d625e[_0x4c94('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d7c29,null))['then'](removeEntity(_0x3d7c29,null))[_0x4c94('0x4a')](handleError(_0x3d7c29,null));};exports['describe']=function(_0x3a7443,_0x1f4837){return db[_0x4c94('0x2d')][_0x4c94('0x4f')]()[_0x4c94('0x26')](respondWithResult(_0x1f4837,null))[_0x4c94('0x4a')](handleError(_0x1f4837,null));};exports['getUnread']=function(_0x27c682,_0x2ef0c1,_0x2c6d90){return db['ChatInternalMessage'][_0x4c94('0x1f')]({'where':{'ChatGroupId':_0x27c682[_0x4c94('0x47')]['id'],'ToId':_0x27c682[_0x4c94('0x50')]['id'],'read':![]}})[_0x4c94('0x26')](function(_0x15fa94){return{'id':_[_0x4c94('0x51')](_0x27c682[_0x4c94('0x47')]['id']),'count':_0x15fa94};})[_0x4c94('0x26')](respondWithResult(_0x2ef0c1,null))['catch'](handleError(_0x2ef0c1,null));};exports[_0x4c94('0x52')]=function(_0x19e26e,_0x557e2f,_0x52557e){return db[_0x4c94('0x2d')][_0x4c94('0x4d')]({'where':{'id':_0x19e26e[_0x4c94('0x47')]['id']}})[_0x4c94('0x26')](handleEntityNotFound(_0x557e2f,null))[_0x4c94('0x26')](function(_0x1a5c9a){if(_0x1a5c9a){return _0x1a5c9a[_0x4c94('0x52')](_0x19e26e[_0x4c94('0x4c')][_0x4c94('0x53')],_['omit'](_0x19e26e[_0x4c94('0x4c')],[_0x4c94('0x53'),'id'])||{});}})[_0x4c94('0x26')](respondWithResult(_0x557e2f,null))[_0x4c94('0x4a')](handleError(_0x557e2f,null));};exports[_0x4c94('0x54')]=function(_0x47c844,_0x417112,_0x365a68){var _0xc0eb58={};var _0x4cc4d5={};var _0x328aab;var _0xf81e27;return db[_0x4c94('0x2d')][_0x4c94('0x55')]({'where':{'id':_0x47c844['params']['id']}})['then'](handleEntityNotFound(_0x417112,null))[_0x4c94('0x26')](function(_0x213bfe){if(_0x213bfe){_0x328aab=_0x213bfe;_0x4cc4d5[_0x4c94('0x32')]=_[_0x4c94('0x34')](db[_0x4c94('0x56')]['rawAttributes']);_0x4cc4d5[_0x4c94('0x33')]=_['keys'](_0x47c844['query']);_0x4cc4d5[_0x4c94('0x35')]=_[_0x4c94('0x48')](_0x4cc4d5[_0x4c94('0x32')],_0x4cc4d5[_0x4c94('0x33')]);_0xc0eb58[_0x4c94('0x36')]=_[_0x4c94('0x48')](_0x4cc4d5[_0x4c94('0x32')],qs[_0x4c94('0x37')](_0x47c844[_0x4c94('0x33')][_0x4c94('0x37')]));_0xc0eb58[_0x4c94('0x36')]=_0xc0eb58['attributes'][_0x4c94('0x38')]?_0xc0eb58[_0x4c94('0x36')]:_0x4cc4d5[_0x4c94('0x32')];_0xc0eb58[_0x4c94('0x3b')]=qs['sort'](_0x47c844['query'][_0x4c94('0x3c')]);_0xc0eb58['where']=qs[_0x4c94('0x35')](_[_0x4c94('0x3e')](_0x47c844['query'],_0x4cc4d5['filters']));if(_0x47c844[_0x4c94('0x33')][_0x4c94('0x3f')]){_0xc0eb58[_0x4c94('0x3d')]=_[_0x4c94('0x49')](_0xc0eb58[_0x4c94('0x3d')],{'$or':_[_0x4c94('0x2c')](_0xc0eb58[_0x4c94('0x36')],function(_0x33473e){var _0x49deb5={};_0x49deb5[_0x33473e]={'$like':'%'+_0x47c844['query'][_0x4c94('0x3f')]+'%'};return _0x49deb5;})});}_0xc0eb58=_[_0x4c94('0x49')]({},_0xc0eb58,_0x47c844[_0x4c94('0x41')]);return _0x328aab[_0x4c94('0x54')](_0xc0eb58);}})[_0x4c94('0x26')](function(_0x570f88){if(_0x570f88){_0xf81e27=_0x570f88[_0x4c94('0x38')];if(!_0x47c844['query'][_0x4c94('0x39')](_0x4c94('0x3a'))){_0xc0eb58[_0x4c94('0x1e')]=qs['limit'](_0x47c844[_0x4c94('0x33')][_0x4c94('0x1e')]);_0xc0eb58[_0x4c94('0x1c')]=qs[_0x4c94('0x1c')](_0x47c844[_0x4c94('0x33')]['offset']);}return _0x328aab[_0x4c94('0x54')](_0xc0eb58);}})[_0x4c94('0x26')](function(_0x5e3729){if(_0x5e3729){return _0x5e3729?{'count':_0xf81e27,'rows':_0x5e3729}:null;}})[_0x4c94('0x26')](respondWithResult(_0x417112,null))[_0x4c94('0x4a')](handleError(_0x417112,null));};exports[_0x4c94('0x57')]=function(_0x3f1a8d,_0x42c0ae,_0x25af70){return db[_0x4c94('0x2d')]['find']({'where':{'id':_0x3f1a8d[_0x4c94('0x47')]['id']}})[_0x4c94('0x26')](handleEntityNotFound(_0x42c0ae,null))[_0x4c94('0x26')](function(_0x4059be){if(_0x4059be){return _0x4059be[_0x4c94('0x57')](_0x3f1a8d['query'][_0x4c94('0x53')]);}})[_0x4c94('0x26')](respondWithStatusCode(_0x42c0ae,null))[_0x4c94('0x4a')](handleError(_0x42c0ae,null));};exports['addMessage']=function(_0xa59876,_0x4efde0,_0x5e952c){if(_0xa59876[_0x4c94('0x4c')]['id']){delete _0xa59876[_0x4c94('0x4c')]['id'];}return db[_0x4c94('0x2d')][_0x4c94('0x4d')]({'where':{'id':_0xa59876['params']['id']}})[_0x4c94('0x26')](handleEntityNotFound(_0x4efde0,null))[_0x4c94('0x26')](function(_0x409d3e){if(_0x409d3e){_0xa59876[_0x4c94('0x4c')]['ChatGroupId']=_0x409d3e['id'];return db[_0x4c94('0x58')][_0x4c94('0x4b')](_0xa59876['body']);}})['then'](respondWithResult(_0x4efde0,null))[_0x4c94('0x4a')](handleError(_0x4efde0,null));};exports['getMessages']=function(_0x217966,_0x54fe1c,_0x12795b){var _0x4e2204={};var _0xe46dde={};var _0x42e51c;var _0x1e8606;return db[_0x4c94('0x2d')][_0x4c94('0x55')]({'where':{'id':_0x217966[_0x4c94('0x47')]['id']}})[_0x4c94('0x26')](handleEntityNotFound(_0x54fe1c,null))[_0x4c94('0x26')](function(_0x208051){if(_0x208051){_0x42e51c=_0x208051;_0xe46dde['model']=_['keys'](db['ChatInternalMessage'][_0x4c94('0x2e')]);_0xe46dde['query']=_[_0x4c94('0x34')](_0x217966[_0x4c94('0x33')]);_0xe46dde[_0x4c94('0x35')]=_[_0x4c94('0x48')](_0xe46dde[_0x4c94('0x32')],_0xe46dde['query']);_0x4e2204[_0x4c94('0x36')]=_[_0x4c94('0x48')](_0xe46dde['model'],qs[_0x4c94('0x37')](_0x217966['query'][_0x4c94('0x37')]));_0x4e2204[_0x4c94('0x36')]=_0x4e2204[_0x4c94('0x36')][_0x4c94('0x38')]?_0x4e2204[_0x4c94('0x36')]:_0xe46dde['model'];_0x4e2204[_0x4c94('0x3b')]=qs['sort'](_0x217966['query'][_0x4c94('0x3c')]);_0x4e2204[_0x4c94('0x3d')]=qs[_0x4c94('0x35')](_[_0x4c94('0x3e')](_0x217966[_0x4c94('0x33')],_0xe46dde[_0x4c94('0x35')]));if(_0x217966[_0x4c94('0x33')][_0x4c94('0x3f')]){_0x4e2204['where']=_[_0x4c94('0x49')](_0x4e2204[_0x4c94('0x3d')],{'$or':_[_0x4c94('0x2c')](_0x4e2204[_0x4c94('0x36')],function(_0x426c71){var _0x26bfd4={};_0x26bfd4[_0x426c71]={'$like':'%'+_0x217966['query'][_0x4c94('0x3f')]+'%'};return _0x26bfd4;})});}if(_0x217966[_0x4c94('0x33')]['$gte']){var _0x10d746=_0x217966[_0x4c94('0x33')][_0x4c94('0x59')][_0x4c94('0x5a')](',');var _0x422eb6={};_0x422eb6[_0x10d746[0x0]]={'$gte':moment(_0x10d746[0x1])[_0x4c94('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4e2204[_0x4c94('0x3d')]=_[_0x4c94('0x49')](_0x4e2204[_0x4c94('0x3d')],_0x422eb6);}_0x4e2204=_['merge']({},_0x4e2204,_0x217966[_0x4c94('0x41')]);return _0x42e51c[_0x4c94('0x5c')](_0x4e2204);}})[_0x4c94('0x26')](function(_0x2162be){if(_0x2162be){_0x1e8606=_0x2162be[_0x4c94('0x38')];if(!_0x217966[_0x4c94('0x33')][_0x4c94('0x39')]('nolimit')){_0x4e2204['limit']=qs[_0x4c94('0x1e')](_0x217966[_0x4c94('0x33')][_0x4c94('0x1e')]);_0x4e2204['offset']=qs[_0x4c94('0x1c')](_0x217966[_0x4c94('0x33')]['offset']);}return _0x42e51c[_0x4c94('0x5c')](_0x4e2204);}})[_0x4c94('0x26')](function(_0x3ce71f){if(_0x3ce71f){return _0x3ce71f?{'count':_0x1e8606,'rows':_0x3ce71f}:null;}})['then'](respondWithResult(_0x54fe1c,null))[_0x4c94('0x4a')](handleError(_0x54fe1c,null));}; \ No newline at end of file +var _0xb450=['format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ChatGroup','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','body','catch','params','ChatInternalMessage','toInteger','ids','getMembers','findOne','User','removeMembers','ChatGroupId','create','getMessages','$gte'];(function(_0x1108d7,_0x16c93c){var _0x1d7eca=function(_0x4925ce){while(--_0x4925ce){_0x1108d7['push'](_0x1108d7['shift']());}};_0x1d7eca(++_0x16c93c);}(_0xb450,0x172));var _0x0b45=function(_0x29e2fe,_0x6b9ce6){_0x29e2fe=_0x29e2fe-0x0;var _0x16f447=_0xb450[_0x29e2fe];return _0x16f447;};'use strict';var emlformat=require(_0x0b45('0x0'));var rimraf=require(_0x0b45('0x1'));var zipdir=require(_0x0b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b45('0x3'));var moment=require(_0x0b45('0x4'));var BPromise=require(_0x0b45('0x5'));var Mustache=require(_0x0b45('0x6'));var util=require(_0x0b45('0x7'));var path=require(_0x0b45('0x8'));var sox=require(_0x0b45('0x9'));var csv=require(_0x0b45('0xa'));var ejs=require(_0x0b45('0xb'));var fs=require('fs');var fs_extra=require(_0x0b45('0xc'));var _=require(_0x0b45('0xd'));var squel=require(_0x0b45('0xe'));var crypto=require(_0x0b45('0xf'));var jsforce=require(_0x0b45('0x10'));var deskjs=require(_0x0b45('0x11'));var toCsv=require(_0x0b45('0xa'));var querystring=require(_0x0b45('0x12'));var Papa=require('papaparse');var Redis=require(_0x0b45('0x13'));var authService=require(_0x0b45('0x14'));var qs=require(_0x0b45('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b45('0x16'));var logger=require('../../config/logger')(_0x0b45('0x17'));var utils=require('../../config/utils');var config=require(_0x0b45('0x18'));var licenseUtil=require(_0x0b45('0x19'));var db=require(_0x0b45('0x1a'))['db'];config[_0x0b45('0x1b')]=_['defaults'](config[_0x0b45('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b45('0x1b')]));require('./chatGroup.socket')[_0x0b45('0x1c')](socket);function respondWithStatusCode(_0x42a563,_0x111582){_0x111582=_0x111582||0xcc;return function(_0x415a6f){if(_0x415a6f){return _0x42a563[_0x0b45('0x1d')](_0x111582);}return _0x42a563['status'](_0x111582)[_0x0b45('0x1e')]();};}function respondWithResult(_0x270272,_0x122f10){_0x122f10=_0x122f10||0xc8;return function(_0x1ce2f7){if(_0x1ce2f7){return _0x270272['status'](_0x122f10)[_0x0b45('0x1f')](_0x1ce2f7);}};}function respondWithFilteredResult(_0x7226ab,_0x1337e5){return function(_0x16a57b){if(_0x16a57b){var _0x2d91ca=typeof _0x1337e5[_0x0b45('0x20')]==='undefined'&&typeof _0x1337e5[_0x0b45('0x21')]==='undefined';var _0x470101=_0x16a57b[_0x0b45('0x22')];var _0x4e9aea=_0x2d91ca?0x0:_0x1337e5[_0x0b45('0x20')];var _0x1c0782=_0x2d91ca?_0x16a57b['count']:_0x1337e5[_0x0b45('0x20')]+_0x1337e5[_0x0b45('0x21')];var _0x251f59;if(_0x1c0782>=_0x470101){_0x1c0782=_0x470101;_0x251f59=0xc8;}else{_0x251f59=0xce;}_0x7226ab[_0x0b45('0x23')](_0x251f59);return _0x7226ab[_0x0b45('0x24')](_0x0b45('0x25'),_0x4e9aea+'-'+_0x1c0782+'/'+_0x470101)[_0x0b45('0x1f')](_0x16a57b);}return null;};}function patchUpdates(_0x493299){return function(_0x29df47){try{jsonpatch[_0x0b45('0x26')](_0x29df47,_0x493299,!![]);}catch(_0x450aec){return BPromise[_0x0b45('0x27')](_0x450aec);}return _0x29df47[_0x0b45('0x28')]();};}function saveUpdates(_0x3bfaf3,_0x5722bf){return function(_0x1c228c){if(_0x1c228c){return _0x1c228c['update'](_0x3bfaf3)[_0x0b45('0x29')](function(_0x38fe15){return _0x38fe15;});}return null;};}function removeEntity(_0x1ef1bd,_0x83206e){return function(_0x10b421){if(_0x10b421){return _0x10b421[_0x0b45('0x2a')]()['then'](function(){_0x1ef1bd['status'](0xcc)[_0x0b45('0x1e')]();});}};}function handleEntityNotFound(_0x919961,_0x43bbfb){return function(_0x1b55f8){if(!_0x1b55f8){_0x919961['sendStatus'](0x194);}return _0x1b55f8;};}function handleError(_0x49f04b,_0x39d81c){_0x39d81c=_0x39d81c||0x1f4;return function(_0x4ba84e){logger[_0x0b45('0x2b')](_0x4ba84e['stack']);if(_0x4ba84e[_0x0b45('0x2c')]){delete _0x4ba84e[_0x0b45('0x2c')];}_0x49f04b[_0x0b45('0x23')](_0x39d81c)[_0x0b45('0x2d')](_0x4ba84e);};}exports[_0x0b45('0x2e')]=function(_0x5abf1b,_0x5c6bc8){var _0x2ede53={},_0x44e25d={},_0x4c536a={'count':0x0,'rows':[]};var _0x5aa47e=_[_0x0b45('0x2f')](db[_0x0b45('0x30')]['rawAttributes'],function(_0x448a5f){return{'name':_0x448a5f[_0x0b45('0x31')],'type':_0x448a5f[_0x0b45('0x32')][_0x0b45('0x33')]};});_0x44e25d['model']=_[_0x0b45('0x2f')](_0x5aa47e,'name');_0x44e25d[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x5abf1b[_0x0b45('0x34')]);_0x44e25d['filters']=_[_0x0b45('0x36')](_0x44e25d['model'],_0x44e25d[_0x0b45('0x34')]);_0x2ede53[_0x0b45('0x37')]=_[_0x0b45('0x36')](_0x44e25d[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x39')]));_0x2ede53[_0x0b45('0x37')]=_0x2ede53['attributes'][_0x0b45('0x3a')]?_0x2ede53['attributes']:_0x44e25d[_0x0b45('0x38')];if(!_0x5abf1b['query'][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x2ede53['limit']=qs[_0x0b45('0x21')](_0x5abf1b[_0x0b45('0x34')]['limit']);_0x2ede53['offset']=qs[_0x0b45('0x20')](_0x5abf1b[_0x0b45('0x34')]['offset']);}_0x2ede53[_0x0b45('0x3d')]=qs[_0x0b45('0x3e')](_0x5abf1b[_0x0b45('0x34')]['sort']);_0x2ede53[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x5abf1b[_0x0b45('0x34')],_0x44e25d[_0x0b45('0x40')]),_0x5aa47e);if(_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x42')]){_0x2ede53[_0x0b45('0x3f')]=_[_0x0b45('0x43')](_0x2ede53['where'],{'$or':_[_0x0b45('0x2f')](_0x5aa47e,function(_0x181b26){if(_0x181b26[_0x0b45('0x32')]!==_0x0b45('0x44')){var _0x50f278={};_0x50f278[_0x181b26[_0x0b45('0x2c')]]={'$like':'%'+_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x50f278;}})});}_0x2ede53=_[_0x0b45('0x43')]({},_0x2ede53,_0x5abf1b[_0x0b45('0x45')]);var _0x427984={'where':_0x2ede53[_0x0b45('0x3f')]};return db[_0x0b45('0x30')]['count'](_0x427984)[_0x0b45('0x29')](function(_0x1c2ab8){_0x4c536a[_0x0b45('0x22')]=_0x1c2ab8;if(_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x46')]){_0x2ede53[_0x0b45('0x47')]=[{'all':!![]}];}return db[_0x0b45('0x30')][_0x0b45('0x48')](_0x2ede53);})[_0x0b45('0x29')](function(_0x1135f0){_0x4c536a[_0x0b45('0x49')]=_0x1135f0;return _0x4c536a;})['then'](respondWithFilteredResult(_0x5c6bc8,_0x2ede53))['catch'](handleError(_0x5c6bc8,null));};exports['show']=function(_0x52eace,_0x547454){var _0x4554f4={'raw':!![],'where':{'id':_0x52eace['params']['id']}},_0x2fa93f={};_0x2fa93f[_0x0b45('0x38')]=_[_0x0b45('0x35')](db[_0x0b45('0x30')][_0x0b45('0x4a')]);_0x2fa93f[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x52eace[_0x0b45('0x34')]);_0x2fa93f[_0x0b45('0x40')]=_[_0x0b45('0x36')](_0x2fa93f['model'],_0x2fa93f['query']);_0x4554f4['attributes']=_['intersection'](_0x2fa93f[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x52eace[_0x0b45('0x34')][_0x0b45('0x39')]));_0x4554f4[_0x0b45('0x37')]=_0x4554f4[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x4554f4['attributes']:_0x2fa93f[_0x0b45('0x38')];if(_0x52eace[_0x0b45('0x34')]['includeAll']){_0x4554f4[_0x0b45('0x47')]=[{'all':!![]}];}_0x4554f4=_[_0x0b45('0x43')]({},_0x4554f4,_0x52eace[_0x0b45('0x45')]);return db[_0x0b45('0x30')][_0x0b45('0x4b')](_0x4554f4)[_0x0b45('0x29')](handleEntityNotFound(_0x547454,null))['then'](respondWithResult(_0x547454,null))['catch'](handleError(_0x547454,null));};exports['create']=function(_0x3fb57b,_0x5a5419){return db[_0x0b45('0x30')]['create'](_0x3fb57b[_0x0b45('0x4c')],{})[_0x0b45('0x29')](respondWithResult(_0x5a5419,0xc9))[_0x0b45('0x4d')](handleError(_0x5a5419,null));};exports['update']=function(_0x52c1c1,_0x4f41cd){if(_0x52c1c1[_0x0b45('0x4c')]['id']){delete _0x52c1c1[_0x0b45('0x4c')]['id'];}return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x52c1c1[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x4f41cd,null))[_0x0b45('0x29')](saveUpdates(_0x52c1c1[_0x0b45('0x4c')],null))[_0x0b45('0x29')](respondWithResult(_0x4f41cd,null))[_0x0b45('0x4d')](handleError(_0x4f41cd,null));};exports[_0x0b45('0x2a')]=function(_0x885922,_0x2344e3){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x885922[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x2344e3,null))[_0x0b45('0x29')](removeEntity(_0x2344e3,null))[_0x0b45('0x4d')](handleError(_0x2344e3,null));};exports['describe']=function(_0x142e68,_0x1c6b98){return db[_0x0b45('0x30')]['describe']()['then'](respondWithResult(_0x1c6b98,null))[_0x0b45('0x4d')](handleError(_0x1c6b98,null));};exports['getUnread']=function(_0x38cbeb,_0x4257c1,_0xc823d9){return db[_0x0b45('0x4f')][_0x0b45('0x22')]({'where':{'ChatGroupId':_0x38cbeb[_0x0b45('0x4e')]['id'],'ToId':_0x38cbeb['user']['id'],'read':![]}})[_0x0b45('0x29')](function(_0x4aaceb){return{'id':_[_0x0b45('0x50')](_0x38cbeb[_0x0b45('0x4e')]['id']),'count':_0x4aaceb};})['then'](respondWithResult(_0x4257c1,null))['catch'](handleError(_0x4257c1,null));};exports['addMembers']=function(_0x1c1f8f,_0x4bc576,_0x295fb8){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x1c1f8f[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x4bc576,null))['then'](function(_0x5cd897){if(_0x5cd897){return _0x5cd897['addMembers'](_0x1c1f8f[_0x0b45('0x4c')][_0x0b45('0x51')],_['omit'](_0x1c1f8f[_0x0b45('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x4bc576,null))[_0x0b45('0x4d')](handleError(_0x4bc576,null));};exports[_0x0b45('0x52')]=function(_0x3d163a,_0x217f27,_0x52ca65){var _0x2af765={};var _0x415669={};var _0xcbced4;var _0x1da544;return db[_0x0b45('0x30')][_0x0b45('0x53')]({'where':{'id':_0x3d163a['params']['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x217f27,null))[_0x0b45('0x29')](function(_0x340504){if(_0x340504){_0xcbced4=_0x340504;_0x415669['model']=_[_0x0b45('0x35')](db[_0x0b45('0x54')][_0x0b45('0x4a')]);_0x415669[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x3d163a[_0x0b45('0x34')]);_0x415669[_0x0b45('0x40')]=_['intersection'](_0x415669[_0x0b45('0x38')],_0x415669[_0x0b45('0x34')]);_0x2af765[_0x0b45('0x37')]=_[_0x0b45('0x36')](_0x415669[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x3d163a[_0x0b45('0x34')][_0x0b45('0x39')]));_0x2af765[_0x0b45('0x37')]=_0x2af765[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x2af765[_0x0b45('0x37')]:_0x415669[_0x0b45('0x38')];_0x2af765['order']=qs[_0x0b45('0x3e')](_0x3d163a[_0x0b45('0x34')][_0x0b45('0x3e')]);_0x2af765[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x3d163a['query'],_0x415669['filters']));if(_0x3d163a['query']['filter']){_0x2af765[_0x0b45('0x3f')]=_['merge'](_0x2af765[_0x0b45('0x3f')],{'$or':_[_0x0b45('0x2f')](_0x2af765[_0x0b45('0x37')],function(_0x19c736){var _0x249cdf={};_0x249cdf[_0x19c736]={'$like':'%'+_0x3d163a[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x249cdf;})});}_0x2af765=_['merge']({},_0x2af765,_0x3d163a['options']);return _0xcbced4['getMembers'](_0x2af765);}})[_0x0b45('0x29')](function(_0x48e435){if(_0x48e435){_0x1da544=_0x48e435['length'];if(!_0x3d163a['query'][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x2af765[_0x0b45('0x21')]=qs[_0x0b45('0x21')](_0x3d163a['query'][_0x0b45('0x21')]);_0x2af765[_0x0b45('0x20')]=qs[_0x0b45('0x20')](_0x3d163a[_0x0b45('0x34')]['offset']);}return _0xcbced4[_0x0b45('0x52')](_0x2af765);}})[_0x0b45('0x29')](function(_0x3d9263){if(_0x3d9263){return _0x3d9263?{'count':_0x1da544,'rows':_0x3d9263}:null;}})[_0x0b45('0x29')](respondWithResult(_0x217f27,null))[_0x0b45('0x4d')](handleError(_0x217f27,null));};exports[_0x0b45('0x55')]=function(_0x3d2906,_0x64b159,_0x5d801a){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x3d2906[_0x0b45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x64b159,null))[_0x0b45('0x29')](function(_0x9a97b8){if(_0x9a97b8){return _0x9a97b8[_0x0b45('0x55')](_0x3d2906[_0x0b45('0x34')][_0x0b45('0x51')]);}})[_0x0b45('0x29')](respondWithStatusCode(_0x64b159,null))[_0x0b45('0x4d')](handleError(_0x64b159,null));};exports['addMessage']=function(_0x4656b1,_0xf0357a,_0x4a3945){if(_0x4656b1[_0x0b45('0x4c')]['id']){delete _0x4656b1[_0x0b45('0x4c')]['id'];}return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x4656b1[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0xf0357a,null))['then'](function(_0x8966b6){if(_0x8966b6){_0x4656b1['body'][_0x0b45('0x56')]=_0x8966b6['id'];return db[_0x0b45('0x4f')][_0x0b45('0x57')](_0x4656b1[_0x0b45('0x4c')]);}})[_0x0b45('0x29')](respondWithResult(_0xf0357a,null))[_0x0b45('0x4d')](handleError(_0xf0357a,null));};exports[_0x0b45('0x58')]=function(_0x4cc2ba,_0x198379,_0x5a6c07){var _0x54fc96={};var _0x1024b4={};var _0x8e4512;var _0x4d4b30;return db[_0x0b45('0x30')]['findOne']({'where':{'id':_0x4cc2ba[_0x0b45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x198379,null))[_0x0b45('0x29')](function(_0x4f4612){if(_0x4f4612){_0x8e4512=_0x4f4612;_0x1024b4[_0x0b45('0x38')]=_[_0x0b45('0x35')](db[_0x0b45('0x4f')][_0x0b45('0x4a')]);_0x1024b4['query']=_[_0x0b45('0x35')](_0x4cc2ba[_0x0b45('0x34')]);_0x1024b4[_0x0b45('0x40')]=_['intersection'](_0x1024b4[_0x0b45('0x38')],_0x1024b4[_0x0b45('0x34')]);_0x54fc96['attributes']=_[_0x0b45('0x36')](_0x1024b4[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x39')]));_0x54fc96['attributes']=_0x54fc96[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x54fc96[_0x0b45('0x37')]:_0x1024b4[_0x0b45('0x38')];_0x54fc96[_0x0b45('0x3d')]=qs[_0x0b45('0x3e')](_0x4cc2ba[_0x0b45('0x34')]['sort']);_0x54fc96[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x4cc2ba[_0x0b45('0x34')],_0x1024b4[_0x0b45('0x40')]));if(_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x42')]){_0x54fc96[_0x0b45('0x3f')]=_['merge'](_0x54fc96[_0x0b45('0x3f')],{'$or':_['map'](_0x54fc96[_0x0b45('0x37')],function(_0x538471){var _0x13b954={};_0x13b954[_0x538471]={'$like':'%'+_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x13b954;})});}if(_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x59')]){var _0x596bf3=_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x59')]['split'](',');var _0x492be4={};_0x492be4[_0x596bf3[0x0]]={'$gte':moment(_0x596bf3[0x1])[_0x0b45('0x5a')](_0x0b45('0x5b'))};_0x54fc96[_0x0b45('0x3f')]=_[_0x0b45('0x43')](_0x54fc96[_0x0b45('0x3f')],_0x492be4);}_0x54fc96=_[_0x0b45('0x43')]({},_0x54fc96,_0x4cc2ba[_0x0b45('0x45')]);return _0x8e4512['getMessages'](_0x54fc96);}})[_0x0b45('0x29')](function(_0xb1c411){if(_0xb1c411){_0x4d4b30=_0xb1c411['length'];if(!_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x54fc96[_0x0b45('0x21')]=qs[_0x0b45('0x21')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x21')]);_0x54fc96[_0x0b45('0x20')]=qs[_0x0b45('0x20')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x20')]);}return _0x8e4512[_0x0b45('0x58')](_0x54fc96);}})['then'](function(_0x710b0c){if(_0x710b0c){return _0x710b0c?{'count':_0x4d4b30,'rows':_0x710b0c}:null;}})[_0x0b45('0x29')](respondWithResult(_0x198379,null))['catch'](handleError(_0x198379,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 996e7a0..3ec2c53 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 _0x444a=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x444a,0x1a1));var _0xa444=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x444a[_0xf26d40];return _0x50b68c;};'use strict';var EventEmitter=require(_0xa444('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa444('0x1')](0x0);var events={'afterCreate':_0xa444('0x2'),'afterUpdate':_0xa444('0x3'),'afterDestroy':_0xa444('0x4')};function emitEvent(_0xb0f5ee){return function(_0x4f3da7,_0x22fa86,_0x2e73d1){ChatGroupEvents[_0xa444('0x5')](_0xb0f5ee+':'+_0x4f3da7['id'],_0x4f3da7);ChatGroupEvents[_0xa444('0x5')](_0xb0f5ee,_0x4f3da7);_0x2e73d1(null);};}for(var e in events){if(events[_0xa444('0x6')](e)){var event=events[e];ChatGroup[_0xa444('0x7')](e,emitEvent(event));}}module[_0xa444('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x1c2f=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hook'];(function(_0x2feb93,_0x572c96){var _0x3254e2=function(_0x573dbd){while(--_0x573dbd){_0x2feb93['push'](_0x2feb93['shift']());}};_0x3254e2(++_0x572c96);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x526889,_0x3f9043){_0x526889=_0x526889-0x0;var _0x21ad5e=_0x1c2f[_0x526889];return _0x21ad5e;};'use strict';var EventEmitter=require(_0xf1c2('0x0'));var ChatGroup=require(_0xf1c2('0x1'))['db'][_0xf1c2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf1c2('0x3')](0x0);var events={'afterCreate':_0xf1c2('0x4'),'afterUpdate':_0xf1c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a5c9b){return function(_0x229abd,_0x1a0233,_0x296405){ChatGroupEvents['emit'](_0x2a5c9b+':'+_0x229abd['id'],_0x229abd);ChatGroupEvents[_0xf1c2('0x6')](_0x2a5c9b,_0x229abd);_0x296405(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf1c2('0x7')](e,emitEvent(event));}}module[_0xf1c2('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 1e19100..b48eed5 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 _0x5451=['api','bluebird','path','rimraf','exports','define','ChatGroup','chat_groups'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5451,0x148));var _0x1545=function(_0x5bb02f,_0x1cdd79){_0x5bb02f=_0x5bb02f-0x0;var _0x3dd32c=_0x5451[_0x5bb02f];return _0x3dd32c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1545('0x0'));var moment=require('moment');var BPromise=require(_0x1545('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1545('0x2'));var rimraf=require(_0x1545('0x3'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x1545('0x4')]=function(_0x3e3c32,_0x46bc12){return _0x3e3c32[_0x1545('0x5')](_0x1545('0x6'),attributes,{'tableName':_0x1545('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x092d=['../../config/logger','bluebird','request-promise','path','../../config/environment','ChatGroup','chat_groups'];(function(_0x5cbad7,_0x54313c){var _0x540c34=function(_0x337b4b){while(--_0x337b4b){_0x5cbad7['push'](_0x5cbad7['shift']());}};_0x540c34(++_0x54313c);}(_0x092d,0xee));var _0xd092=function(_0x1b1c4f,_0x32eb9c){_0x1b1c4f=_0x1b1c4f-0x0;var _0x3f02c1=_0x092d[_0x1b1c4f];return _0x3f02c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd092('0x0'))('api');var moment=require('moment');var BPromise=require(_0xd092('0x1'));var rp=require(_0xd092('0x2'));var fs=require('fs');var path=require(_0xd092('0x3'));var rimraf=require('rimraf');var config=require(_0xd092('0x4'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x32c2b9,_0x836db2){return _0x32c2b9['define'](_0xd092('0x5'),attributes,{'tableName':_0xd092('0x6'),'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 bf71204..5c265da 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 _0x28a2=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','info'];(function(_0xe45c3a,_0x183904){var _0x1bc5e8=function(_0x1c084b){while(--_0x1c084b){_0xe45c3a['push'](_0xe45c3a['shift']());}};_0x1bc5e8(++_0x183904);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var moment=require(_0x228a('0x2'));var BPromise=require(_0x228a('0x3'));var rs=require(_0x228a('0x4'));var fs=require('fs');var Redis=require(_0x228a('0x5'));var db=require(_0x228a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x228a('0x7'))('rpc');var config=require(_0x228a('0x8'));var jayson=require(_0x228a('0x9'));var client=jayson[_0x228a('0xa')][_0x228a('0xb')]({'port':0x232a});config[_0x228a('0xc')]=_['defaults'](config[_0x228a('0xc')],{'host':_0x228a('0xd'),'port':0x18eb});var socket=require(_0x228a('0xe'))(new Redis(config[_0x228a('0xc')]));require('./chatGroup.socket')[_0x228a('0xf')](socket);function respondWithRpcPromise(_0x44dec4,_0x3b20dd,_0x1cb14a){return new BPromise(function(_0x2ccb62,_0x36d5a6){return client[_0x228a('0x10')](_0x44dec4,_0x1cb14a)[_0x228a('0x11')](function(_0x5b74cb){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3b20dd,_0x228a('0x12'));logger[_0x228a('0x13')](_0x228a('0x14'),_0x3b20dd,_0x228a('0x12'),JSON[_0x228a('0x15')](_0x5b74cb));if(_0x5b74cb['error']){if(_0x5b74cb[_0x228a('0x16')][_0x228a('0x17')]===0x1f4){logger[_0x228a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3b20dd,_0x5b74cb['error'][_0x228a('0x18')]);return _0x36d5a6(_0x5b74cb[_0x228a('0x16')][_0x228a('0x18')]);}logger[_0x228a('0x16')](_0x228a('0x19'),_0x3b20dd,_0x5b74cb[_0x228a('0x16')][_0x228a('0x18')]);return _0x2ccb62(_0x5b74cb[_0x228a('0x16')]['message']);}else{logger[_0x228a('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x3b20dd,_0x228a('0x12'));_0x2ccb62(_0x5b74cb[_0x228a('0x1b')][_0x228a('0x18')]);}})[_0x228a('0x1c')](function(_0x492595){logger['error'](_0x228a('0x19'),_0x3b20dd,_0x492595);_0x36d5a6(_0x492595);});});} \ No newline at end of file +var _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x4ce860,_0x24ca0c){var _0x587afc=function(_0xc1a4e8){while(--_0xc1a4e8){_0x4ce860['push'](_0x4ce860['shift']());}};_0x587afc(++_0x24ca0c);}(_0x851c,0x19d));var _0xc851=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x851c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d24b7a3..bea667c 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 _0xe0d5=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x231ad9,_0x252bab){var _0x24403d=function(_0x60a9b9){while(--_0x60a9b9){_0x231ad9['push'](_0x231ad9['shift']());}};_0x24403d(++_0x252bab);}(_0xe0d5,0xf9));var _0x5e0d=function(_0x5c19ca,_0x2eed31){_0x5c19ca=_0x5c19ca-0x0;var _0x40345c=_0xe0d5[_0x5c19ca];return _0x40345c;};'use strict';var ChatGroupEvents=require(_0x5e0d('0x0'));var events=[_0x5e0d('0x1'),_0x5e0d('0x2'),'update'];function createListener(_0x17ee3e,_0x158384){return function(_0x45d118){_0x158384[_0x5e0d('0x3')](_0x17ee3e,_0x45d118);};}function removeListener(_0x5cc040,_0xe0c4f){return function(){ChatGroupEvents[_0x5e0d('0x4')](_0x5cc040,_0xe0c4f);};}exports['register']=function(_0x13c2b7){for(var _0x146e37=0x0,_0x364692=events[_0x5e0d('0x5')];_0x146e37<_0x364692;_0x146e37++){var _0x223053=events[_0x146e37];var _0x386829=createListener(_0x5e0d('0x6')+_0x223053,_0x13c2b7);ChatGroupEvents['on'](_0x223053,_0x386829);}}; \ No newline at end of file +var _0x0e95=['removeListener','register','length','./chatGroup.events','save','remove','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0e95,0x1d1));var _0x50e9=function(_0x2c2c86,_0x58399b){_0x2c2c86=_0x2c2c86-0x0;var _0xe6ede3=_0x0e95[_0x2c2c86];return _0xe6ede3;};'use strict';var ChatGroupEvents=require(_0x50e9('0x0'));var events=[_0x50e9('0x1'),_0x50e9('0x2'),'update'];function createListener(_0x55097d,_0x5712a6){return function(_0x4694f1){_0x5712a6[_0x50e9('0x3')](_0x55097d,_0x4694f1);};}function removeListener(_0x2ae11a,_0x483613){return function(){ChatGroupEvents[_0x50e9('0x4')](_0x2ae11a,_0x483613);};}exports[_0x50e9('0x5')]=function(_0x1be434){for(var _0x4ded02=0x0,_0x2d31d6=events[_0x50e9('0x6')];_0x4ded02<_0x2d31d6;_0x4ded02++){var _0x5e2a43=events[_0x4ded02];var _0x1e2bd1=createListener('chatGroup:'+_0x5e2a43,_0x1be434);ChatGroupEvents['on'](_0x5e2a43,_0x1e2bd1);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index f796d56..07aed85 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 _0xd2e8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','put','update','destroy','delete','removeMembers','exports'];(function(_0x35fc2a,_0x4788f4){var _0x379aa8=function(_0x4b4759){while(--_0x4b4759){_0x35fc2a['push'](_0x35fc2a['shift']());}};_0x379aa8(++_0x4788f4);}(_0xd2e8,0x96));var _0x8d2e=function(_0x3b5e02,_0x535469){_0x3b5e02=_0x3b5e02-0x0;var _0x59464c=_0xd2e8[_0x3b5e02];return _0x59464c;};'use strict';var multer=require(_0x8d2e('0x0'));var util=require('util');var path=require(_0x8d2e('0x1'));var timeout=require(_0x8d2e('0x2'));var express=require(_0x8d2e('0x3'));var router=express[_0x8d2e('0x4')]();var fs_extra=require(_0x8d2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8d2e('0x6'));var config=require(_0x8d2e('0x7'));var controller=require(_0x8d2e('0x8'));router[_0x8d2e('0x9')]('/',auth[_0x8d2e('0xa')](),controller[_0x8d2e('0xb')]);router[_0x8d2e('0x9')](_0x8d2e('0xc'),auth[_0x8d2e('0xa')](),controller[_0x8d2e('0xd')]);router[_0x8d2e('0x9')](_0x8d2e('0xe'),auth[_0x8d2e('0xa')](),controller[_0x8d2e('0xf')]);router[_0x8d2e('0x9')](_0x8d2e('0x10'),auth[_0x8d2e('0xa')](),controller[_0x8d2e('0x11')]);router[_0x8d2e('0x9')](_0x8d2e('0x12'),auth[_0x8d2e('0xa')](),controller[_0x8d2e('0x13')]);router[_0x8d2e('0x9')](_0x8d2e('0x14'),auth[_0x8d2e('0xa')](),controller[_0x8d2e('0x15')]);router[_0x8d2e('0x16')]('/',auth[_0x8d2e('0xa')](),controller[_0x8d2e('0x17')]);router['post']('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x8d2e('0x16')](_0x8d2e('0x14'),auth[_0x8d2e('0xa')](),controller['addMessage']);router[_0x8d2e('0x18')]('/:id',auth[_0x8d2e('0xa')](),controller[_0x8d2e('0x19')]);router['delete'](_0x8d2e('0xe'),auth['isAuthenticated'](),controller[_0x8d2e('0x1a')]);router[_0x8d2e('0x1b')]('/:id/members',auth[_0x8d2e('0xa')](),controller[_0x8d2e('0x1c')]);module[_0x8d2e('0x1d')]=router; \ No newline at end of file +var _0xe6d7=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','removeMembers','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x734baa,_0x4072d5){var _0x1920d4=function(_0x4c02ba){while(--_0x4c02ba){_0x734baa['push'](_0x734baa['shift']());}};_0x1920d4(++_0x4072d5);}(_0xe6d7,0x124));var _0x7e6d=function(_0x4781b1,_0x109c44){_0x4781b1=_0x4781b1-0x0;var _0x13ecb1=_0xe6d7[_0x4781b1];return _0x13ecb1;};'use strict';var multer=require(_0x7e6d('0x0'));var util=require(_0x7e6d('0x1'));var path=require(_0x7e6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e6d('0x3'));var router=express[_0x7e6d('0x4')]();var fs_extra=require(_0x7e6d('0x5'));var auth=require(_0x7e6d('0x6'));var interaction=require(_0x7e6d('0x7'));var config=require(_0x7e6d('0x8'));var controller=require(_0x7e6d('0x9'));router[_0x7e6d('0xa')]('/',auth[_0x7e6d('0xb')](),controller[_0x7e6d('0xc')]);router[_0x7e6d('0xa')](_0x7e6d('0xd'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0xe')]);router[_0x7e6d('0xa')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x10')]);router['get'](_0x7e6d('0x11'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x12')]);router[_0x7e6d('0xa')](_0x7e6d('0x13'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x14')]);router['get'](_0x7e6d('0x15'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e6d('0x17')]);router[_0x7e6d('0x18')](_0x7e6d('0x13'),auth['isAuthenticated'](),controller[_0x7e6d('0x19')]);router[_0x7e6d('0x18')]('/:id/messages',auth[_0x7e6d('0xb')](),controller['addMessage']);router[_0x7e6d('0x1a')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x1b')]);router[_0x7e6d('0x1c')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller['destroy']);router[_0x7e6d('0x1c')](_0x7e6d('0x13'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index e99b134..86ae0d7 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 _0x0490=['thumb','star','TEXT','STRING','DATE','long','out','exports'];(function(_0x4bc114,_0x3419fb){var _0x644fbe=function(_0x5502ec){while(--_0x5502ec){_0x4bc114['push'](_0x4bc114['shift']());}};_0x644fbe(++_0x3419fb);}(_0x0490,0x147));var _0x0049=function(_0x14bfaa,_0x1e94c8){_0x14bfaa=_0x14bfaa-0x0;var _0x2e1010=_0x0490[_0x14bfaa];return _0x2e1010;};'use strict';var Sequelize=require('sequelize');module[_0x0049('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x0049('0x1')),'defaultValue':_0x0049('0x2')},'ratingMessage':{'type':Sequelize[_0x0049('0x3')]},'pathTranscript':{'type':Sequelize[_0x0049('0x3')]},'mailTranscript':{'type':Sequelize[_0x0049('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0049('0x5')]},'disposition':{'type':Sequelize[_0x0049('0x4')]},'secondDisposition':{'type':Sequelize[_0x0049('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0049('0x4')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0049('0x4')]},'browserVersion':{'type':Sequelize[_0x0049('0x4')]},'osName':{'type':Sequelize[_0x0049('0x4')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0049('0x4')]},'deviceVendor':{'type':Sequelize[_0x0049('0x4')]},'deviceType':{'type':Sequelize[_0x0049('0x4')]},'referer':{'type':Sequelize[_0x0049('0x3')]},'customerIp':{'type':Sequelize[_0x0049('0x4')]},'formData':{'type':Sequelize[_0x0049('0x3')](_0x0049('0x6'))},'read1stAt':{'type':Sequelize[_0x0049('0x5')]},'lastMsgAt':{'type':Sequelize[_0x0049('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0049('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0049('0x4')]},'customerPort':{'type':Sequelize[_0x0049('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1152=['long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING'];(function(_0x305cc5,_0x317607){var _0x3ef26f=function(_0x309528){while(--_0x309528){_0x305cc5['push'](_0x305cc5['shift']());}};_0x3ef26f(++_0x317607);}(_0x1152,0x182));var _0x2115=function(_0x23f50a,_0x1e0fbc){_0x23f50a=_0x23f50a-0x0;var _0x3d48e2=_0x1152[_0x23f50a];return _0x3d48e2;};'use strict';var Sequelize=require(_0x2115('0x0'));module[_0x2115('0x1')]={'closed':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2115('0x3')]},'ratingType':{'type':Sequelize[_0x2115('0x4')](_0x2115('0x5'),_0x2115('0x6')),'defaultValue':_0x2115('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2115('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2115('0x8')]},'disposition':{'type':Sequelize[_0x2115('0x9')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x2115('0x9')]},'osVersion':{'type':Sequelize[_0x2115('0x9')]},'deviceModel':{'type':Sequelize[_0x2115('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2115('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2115('0x7')](_0x2115('0xa'))},'read1stAt':{'type':Sequelize[_0x2115('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2115('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2115('0x9')]},'customerPort':{'type':Sequelize[_0x2115('0x9')]},'vidaooSessionId':{'type':Sequelize[_0x2115('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4d720c7..94b8e94 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 _0xf2bb=['direction','read','get','mkdirSync','Account','Owner','N.A.','closed','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','Chat','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','stack','send','merge','contact','agent','account','index','ChatInteraction','type','key','query','user','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','options','find','create','body','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','name','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','originalname','filename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','Messages','%s%d','UserId','customer','Visitor','ContactId','website_alias','agentAlias','alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','addMessage','ids','getMessages','rawAttributes','filters','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','includeAgent','findAll','rows','addTags','setTags','omit','Tag','color','emit','removeTags','server','files','tmp','transcript-%d-%s.zip','push','firstName','lastName','attachments','Attachment'];(function(_0x4cdd4d,_0x3cce1e){var _0x1bbd06=function(_0x4578cf){while(--_0x4578cf){_0x4cdd4d['push'](_0x4cdd4d['shift']());}};_0x1bbd06(++_0x3cce1e);}(_0xf2bb,0xed));var _0xbf2b=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xf2bb[_0xd0b415];return _0x2bdf2c;};'use strict';var rimraf=require(_0xbf2b('0x0'));var zipdir=require(_0xbf2b('0x1'));var rp=require(_0xbf2b('0x2'));var moment=require(_0xbf2b('0x3'));var BPromise=require(_0xbf2b('0x4'));var Mustache=require('mustache');var util=require(_0xbf2b('0x5'));var path=require(_0xbf2b('0x6'));var ejs=require(_0xbf2b('0x7'));var fs=require('fs');var _=require(_0xbf2b('0x8'));var Redis=require(_0xbf2b('0x9'));var interaction=require(_0xbf2b('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0xbf2b('0xb'));var logger=require(_0xbf2b('0xc'))(_0xbf2b('0xd'));var config=require(_0xbf2b('0xe'));var db=require('../../mysqldb')['db'];config[_0xbf2b('0xf')]=_[_0xbf2b('0x10')](config[_0xbf2b('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf2b('0x11'))(new Redis(config[_0xbf2b('0xf')]));require(_0xbf2b('0x12'))[_0xbf2b('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbf2b('0x14')][_0xbf2b('0x15')]({'port':0x232b});var client9004=jayson[_0xbf2b('0x14')][_0xbf2b('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x3db67b,_0x4627c7,_0x27fa8c,_0x12f222){return new BPromise(function(_0x507266,_0x15706f){var _0x4c07ec=_0x12f222||client;return _0x4c07ec[_0xbf2b('0x16')](_0x3db67b,_0x27fa8c)[_0xbf2b('0x17')](function(_0x3d5795){logger[_0xbf2b('0x18')](_0xbf2b('0x19'),_0x4627c7,_0xbf2b('0x1a'));logger[_0xbf2b('0x1b')](_0xbf2b('0x1c'),_0x4627c7,'request\x20sent',JSON[_0xbf2b('0x1d')](_0x3d5795));if(_0x3d5795[_0xbf2b('0x1e')]){if(_0x3d5795[_0xbf2b('0x1e')][_0xbf2b('0x1f')]===0x1f4){logger[_0xbf2b('0x1e')](_0xbf2b('0x19'),_0x4627c7,_0x3d5795['error'][_0xbf2b('0x20')]);return _0x15706f(_0x3d5795['error'][_0xbf2b('0x20')]);}logger[_0xbf2b('0x1e')](_0xbf2b('0x19'),_0x4627c7,_0x3d5795[_0xbf2b('0x1e')][_0xbf2b('0x20')]);return _0x507266(_0x3d5795[_0xbf2b('0x1e')]['message']);}else{logger[_0xbf2b('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4627c7,_0xbf2b('0x1a'));_0x507266(_0x3d5795[_0xbf2b('0x21')][_0xbf2b('0x20')]);}})[_0xbf2b('0x22')](function(_0x2eba96){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4627c7,_0x2eba96);_0x15706f(_0x2eba96);});});}function respondWithStatusCode(_0x2026cb,_0x1ea33a){_0x1ea33a=_0x1ea33a||0xcc;return function(_0x46dafa){if(_0x46dafa){return _0x2026cb[_0xbf2b('0x23')](_0x1ea33a);}return _0x2026cb[_0xbf2b('0x24')](_0x1ea33a)[_0xbf2b('0x25')]();};}function respondWithResult(_0x3bfa21,_0x4a48c0){_0x4a48c0=_0x4a48c0||0xc8;return function(_0x53d797){if(_0x53d797){return _0x3bfa21['status'](_0x4a48c0)[_0xbf2b('0x26')](_0x53d797);}};}function respondWithFilteredResult(_0x4639bc,_0x5d3130){return function(_0x5ab4d0){if(_0x5ab4d0){var _0x1b531e=typeof _0x5d3130[_0xbf2b('0x27')]===_0xbf2b('0x28')&&typeof _0x5d3130[_0xbf2b('0x29')]===_0xbf2b('0x28');var _0x1d9011=_0x5ab4d0[_0xbf2b('0x2a')];var _0x520adc=_0x1b531e?0x0:_0x5d3130['offset'];var _0x585a4b=_0x1b531e?_0x5ab4d0[_0xbf2b('0x2a')]:_0x5d3130[_0xbf2b('0x27')]+_0x5d3130[_0xbf2b('0x29')];var _0x122ecd;if(_0x585a4b>=_0x1d9011){_0x585a4b=_0x1d9011;_0x122ecd=0xc8;}else{_0x122ecd=0xce;}_0x4639bc[_0xbf2b('0x24')](_0x122ecd);return _0x4639bc[_0xbf2b('0x2b')](_0xbf2b('0x2c'),_0x520adc+'-'+_0x585a4b+'/'+_0x1d9011)[_0xbf2b('0x26')](_0x5ab4d0);}return null;};}function saveUpdates(_0x44c42c){return function(_0x2c5946){if(_0x2c5946){return _0x2c5946[_0xbf2b('0x2d')](_0x44c42c)[_0xbf2b('0x17')](function(_0x3bfbf9){return _0x3bfbf9;});}return null;};}function removeEntity(_0x46ee1f){return function(_0x373c85){if(_0x373c85){return _0x373c85['destroy']()[_0xbf2b('0x17')](function(){_0x46ee1f[_0xbf2b('0x24')](0xcc)[_0xbf2b('0x25')]();});}};}function handleEntityNotFound(_0x365f73){return function(_0x231f97){if(!_0x231f97){_0x365f73[_0xbf2b('0x23')](0x194);}return _0x231f97;};}function handleError(_0x69912f,_0x37e5f7){_0x37e5f7=_0x37e5f7||0x1f4;return function(_0xc71953){logger['error'](_0xc71953[_0xbf2b('0x2e')]);if(_0xc71953['name']){delete _0xc71953['name'];}_0x69912f['status'](_0x37e5f7)[_0xbf2b('0x2f')](_0xc71953);};}function getMustacheRender(_0x2f7f0d,_0x418a79){return Mustache['render'](_0x2f7f0d,_[_0xbf2b('0x30')](_0x418a79['body'],{'contact':_0x418a79[_0xbf2b('0x31')],'message':_0x418a79['message'],'agent':_0x418a79[_0xbf2b('0x32')],'interaction':_0x418a79['interaction'],'account':_0x418a79[_0xbf2b('0x33')]}))||'';}exports[_0xbf2b('0x34')]=function(_0x27dc4e,_0x5caa7e){var _0x381b16={};var _0x513a40=_['map'](db[_0xbf2b('0x35')]['rawAttributes'],function(_0x571188){return{'name':_0x571188['fieldName'],'type':_0x571188[_0xbf2b('0x36')][_0xbf2b('0x37')]};});_0x381b16=qs['getOptions'](_0x513a40,_0x27dc4e);return interaction['findAll']('chat',_0x27dc4e[_0xbf2b('0x38')],_0x27dc4e[_0xbf2b('0x39')],_0x381b16,_0x513a40)['then'](respondWithFilteredResult(_0x5caa7e,_0x381b16))['catch'](handleError(_0x5caa7e,null));};exports[_0xbf2b('0x3a')]=function(_0x320ebd,_0x1847ad){var _0xabc739={'raw':![],'where':{'id':_0x320ebd[_0xbf2b('0x3b')]['id']}},_0x298a8f={};_0x298a8f[_0xbf2b('0x3c')]=_[_0xbf2b('0x3d')](db[_0xbf2b('0x35')]['rawAttributes']);_0x298a8f['query']=_[_0xbf2b('0x3d')](_0x320ebd['query']);_0x298a8f['filters']=_[_0xbf2b('0x3e')](_0x298a8f[_0xbf2b('0x3c')],_0x298a8f[_0xbf2b('0x38')]);_0xabc739[_0xbf2b('0x3f')]=_['intersection'](_0x298a8f[_0xbf2b('0x3c')],qs[_0xbf2b('0x40')](_0x320ebd[_0xbf2b('0x38')][_0xbf2b('0x40')]));_0xabc739[_0xbf2b('0x3f')]=_0xabc739['attributes'][_0xbf2b('0x41')]?_0xabc739[_0xbf2b('0x3f')]:_0x298a8f[_0xbf2b('0x3c')];if(_0x320ebd[_0xbf2b('0x38')][_0xbf2b('0x42')]){_0xabc739[_0xbf2b('0x43')]=[{'all':!![]}];}_0xabc739=_['merge']({},_0xabc739,_0x320ebd[_0xbf2b('0x44')]);return db[_0xbf2b('0x35')][_0xbf2b('0x45')](_0xabc739)[_0xbf2b('0x17')](handleEntityNotFound(_0x1847ad,null))[_0xbf2b('0x17')](respondWithResult(_0x1847ad,null))[_0xbf2b('0x22')](handleError(_0x1847ad,null));};exports['create']=function(_0x4f5dc1,_0x3881f3){return db['ChatInteraction'][_0xbf2b('0x46')](_0x4f5dc1[_0xbf2b('0x47')],{})[_0xbf2b('0x17')](respondWithResult(_0x3881f3,0xc9))[_0xbf2b('0x22')](handleError(_0x3881f3,null));};exports['update']=function(_0x44077e,_0x18fbc1){if(_0x44077e[_0xbf2b('0x47')]['id']){delete _0x44077e[_0xbf2b('0x47')]['id'];}return db[_0xbf2b('0x35')][_0xbf2b('0x45')]({'where':{'id':_0x44077e['params']['id']}})['then'](handleEntityNotFound(_0x18fbc1,null))['then'](saveUpdates(_0x44077e[_0xbf2b('0x47')],null))[_0xbf2b('0x17')](respondWithResult(_0x18fbc1,null))['catch'](handleError(_0x18fbc1,null));};exports['destroy']=function(_0x3b8dff,_0x46aa72){return db[_0xbf2b('0x35')]['find']({'where':{'id':_0x3b8dff[_0xbf2b('0x3b')]['id']}})[_0xbf2b('0x17')](handleEntityNotFound(_0x46aa72,null))[_0xbf2b('0x17')](removeEntity(_0x46aa72,null))[_0xbf2b('0x22')](handleError(_0x46aa72,null));};exports[_0xbf2b('0x48')]=function(_0x5cd796,_0x17c5ca){return db[_0xbf2b('0x35')]['describe']()[_0xbf2b('0x17')](respondWithResult(_0x17c5ca,null))[_0xbf2b('0x22')](handleError(_0x17c5ca,null));};exports['createVidaooSession']=function(_0x4ae39b,_0x5e34ec){var _0x2a72f4=_0x4ae39b['params']['id'];var _0x3f9124;var _0x2cbd4d;var _0x139375;return db['ChatInteraction'][_0xbf2b('0x49')]({'where':{'id':_0x2a72f4}})[_0xbf2b('0x17')](function(_0x225444){_0x3f9124=_0x225444;return db['ChatWebsite'][_0xbf2b('0x49')]({'where':{'id':_0x225444[_0xbf2b('0x4a')]},'attributes':['id',_0xbf2b('0x4b'),_0xbf2b('0x4c'),_0xbf2b('0x4d'),_0xbf2b('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xbf2b('0x17')](function(_0x350154){if(_0x350154&&_0x350154['vidaooApiKey']&&_0x350154[_0xbf2b('0x4c')]){_0x2cbd4d=_0x350154;var _0x477b0f={'interaction':{'id':_0x2a72f4},'agent':{'id':_0x4ae39b[_0xbf2b('0x39')]['id'],'name':_0x4ae39b[_0xbf2b('0x39')][_0xbf2b('0x4f')],'fullname':_0x4ae39b[_0xbf2b('0x39')][_0xbf2b('0x50')],'email':_0x4ae39b['user']['email']},'contact':_0x4ae39b[_0xbf2b('0x47')][_0xbf2b('0x31')],'account':_0x4ae39b[_0xbf2b('0x47')][_0xbf2b('0x33')]};var _0x1636db={'rejectUnauthorized':![],'method':_0xbf2b('0x51'),'url':_0xbf2b('0x52'),'headers':{'X-APIKEY':_0x350154[_0xbf2b('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4ae39b['user'][_0xbf2b('0x53')]],'buttons':null,'topic':_0x2cbd4d['vidaooTopic'],'note':_[_0xbf2b('0x54')](_0x2cbd4d[_0xbf2b('0x4e')])?null:getMustacheRender(_0x2cbd4d['vidaooNote'],_0x477b0f),'metadata':null},'redirect':_0xbf2b('0x55'),'json':!![]};try{if(!_['isNull'](_0x2cbd4d[_0xbf2b('0x56')])){var _0x2dbe47=getMustacheRender(_0x2cbd4d[_0xbf2b('0x56')],_0x477b0f);var _0x2c0529=JSON[_0xbf2b('0x57')](_0x2dbe47);_0x1636db[_0xbf2b('0x47')][_0xbf2b('0x58')]=_0x2c0529;}}catch(_0x5885ca){throw new db[(_0xbf2b('0x59'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1636db);}else{throw new db[(_0xbf2b('0x59'))]['ValidationError'](_0xbf2b('0x5a'));}})['then'](function(_0x2d089a){_0x139375=_0x2d089a;if(_0x139375['id']){var _0x427984={'body':_0x139375[_0xbf2b('0x5b')],'ChatWebsiteId':_0x2cbd4d['id'],'ChatInteractionId':_0x3f9124['id'],'direction':_0xbf2b('0x5c'),'UserId':_0x4ae39b[_0xbf2b('0x39')]['id']};return db[_0xbf2b('0x5d')][_0xbf2b('0x46')](_0x427984,{});}else{throw new db[(_0xbf2b('0x59'))][(_0xbf2b('0x5e'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbf2b('0x17')](function(){return _0x3f9124[_0xbf2b('0x5f')]({'vidaooSessionId':_0x139375['id']});})[_0xbf2b('0x17')](respondWithResult(_0x5e34ec,null))[_0xbf2b('0x22')](handleError(_0x5e34ec,null));};exports[_0xbf2b('0x60')]=function(_0x58ada7,_0xa9e7b5){if(_0x58ada7['body']['id']){delete _0x58ada7[_0xbf2b('0x47')]['id'];}return db[_0xbf2b('0x35')][_0xbf2b('0x45')]({'where':{'id':_0x58ada7[_0xbf2b('0x3b')]['id']},'include':[{'model':db[_0xbf2b('0x61')],'as':_0xbf2b('0x62')}]})[_0xbf2b('0x17')](handleEntityNotFound(_0xa9e7b5,null))[_0xbf2b('0x17')](saveUpdates(_0x58ada7[_0xbf2b('0x47')],null))[_0xbf2b('0x17')](respondWithResult(_0xa9e7b5,null))[_0xbf2b('0x22')](handleError(_0xa9e7b5,null));};exports[_0xbf2b('0x63')]=function(_0x3ee321,_0x2c798a){if(_0x3ee321[_0xbf2b('0x47')]['id']){delete _0x3ee321[_0xbf2b('0x47')]['id'];}return db['ChatInteraction'][_0xbf2b('0x45')]({'where':{'id':_0x3ee321[_0xbf2b('0x3b')]['id']}})[_0xbf2b('0x17')](function(_0xd66c32){if(!_0xd66c32){logger[_0xbf2b('0x1e')](_0xbf2b('0x64'),_0xbf2b('0x63'),0x194,_0xbf2b('0x65'));_0x2c798a[_0xbf2b('0x23')](0x194);}else{if(_0xd66c32['UserId']){throw new db[(_0xbf2b('0x59'))][(_0xbf2b('0x5e'))](_0xbf2b('0x66'));}}return _0xd66c32;})[_0xbf2b('0x17')](function(_0x1a85f6){if(_0x1a85f6){return _0x1a85f6[_0xbf2b('0x2d')]({'closed':_0x3ee321[_0xbf2b('0x47')]['closed'],'disposition':_0x3ee321[_0xbf2b('0x47')][_0xbf2b('0x67')]})['then'](function(_0x5241b1){return _0x5241b1;});}})['then'](function(){return respondWithRpcPromise(_0xbf2b('0x68'),_0xbf2b('0x63'),_0x3ee321[_0xbf2b('0x47')],client9004);})[_0xbf2b('0x17')](respondWithResult(_0x2c798a,null))['catch'](handleError(_0x2c798a,null));};exports['attachmentUpload']=function(_0x343080,_0x5c90ba){_0x343080[_0xbf2b('0x47')][_0xbf2b('0x4f')]=_0x343080[_0xbf2b('0x69')][_0xbf2b('0x6a')];_0x343080['body']['basename']=_0x343080[_0xbf2b('0x69')][_0xbf2b('0x6b')];_0x343080[_0xbf2b('0x47')][_0xbf2b('0x36')]=_0x343080[_0xbf2b('0x69')][_0xbf2b('0x6c')];return db['Attachment'][_0xbf2b('0x46')](_0x343080['body'])[_0xbf2b('0x17')](respondWithResult(_0x5c90ba,0xc9))[_0xbf2b('0x22')](handleError(_0x5c90ba,null));};exports[_0xbf2b('0x6d')]=function(_0xcff1fe,_0x5cc341){return db[_0xbf2b('0x35')]['findOne']({'where':{'id':_0xcff1fe[_0xbf2b('0x3b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5cc341,null))[_0xbf2b('0x17')](function(_0x36dea8){if(_0x36dea8){if(_0x36dea8['closed']){return _0x5cc341[_0xbf2b('0x24')](0x193)['json']({'status':0x193,'message':_0xbf2b('0x6e')});}return db['Attachment']['findOne']({'where':{'id':_0xcff1fe[_0xbf2b('0x38')][_0xbf2b('0x6f')]},'raw':!![]})[_0xbf2b('0x17')](handleEntityNotFound(_0x5cc341,null));}})[_0xbf2b('0x17')](function(_0x26af55){if(_0x26af55){var _0x3f85e4=_0x26af55[_0xbf2b('0x70')]!==null;var _0x2f842b=path[_0xbf2b('0x71')](config[_0xbf2b('0x72')],_0xbf2b('0x73'));if(_0x3f85e4){_0x2f842b=path[_0xbf2b('0x71')](_0x2f842b,_0xbf2b('0x74'));}var _0x4f08eb=path[_0xbf2b('0x71')](_0x2f842b,_0x26af55[_0xbf2b('0x75')]);return _0x5cc341[_0xbf2b('0x76')](_0x4f08eb);}})['catch'](handleError(_0x5cc341,null));};exports[_0xbf2b('0x77')]=function(_0x1cc28b,_0xd2812){var _0x5528da=null;var _0x1bd3e6=null;var _0x1e0023=null;if(_0x1cc28b[_0xbf2b('0x47')]['id']){delete _0x1cc28b[_0xbf2b('0x47')]['id'];}if(_0x1cc28b['body']['mailTranscript']){_0x1e0023=path['join'](config[_0xbf2b('0x72')],_0xbf2b('0x78'),util[_0xbf2b('0x79')](_0xbf2b('0x7a'),Date[_0xbf2b('0x7b')]()));_0x1cc28b[_0xbf2b('0x47')][_0xbf2b('0x7c')]=_0x1e0023;}return db[_0xbf2b('0x35')]['find']({'where':{'id':_0x1cc28b[_0xbf2b('0x3b')]['id']},'include':[{'model':db[_0xbf2b('0x5d')],'as':'Messages','include':[{'model':db[_0xbf2b('0x7d')],'as':_0xbf2b('0x7d')}]}]})[_0xbf2b('0x17')](handleEntityNotFound(_0xd2812,null))[_0xbf2b('0x17')](saveUpdates(_0x1cc28b[_0xbf2b('0x47')],null))[_0xbf2b('0x17')](function(_0x25e48f){if(_0x25e48f){_0x5528da=_0x25e48f;return db[_0xbf2b('0x7e')][_0xbf2b('0x45')]({'where':{'id':_0x5528da['ChatWebsiteId']}});}})[_0xbf2b('0x17')](function(_0x247a42){if(_0x247a42){_0x1bd3e6=_0x247a42;return db[_0xbf2b('0x61')][_0xbf2b('0x45')]({'where':{'id':_0x5528da['ContactId']}});}})[_0xbf2b('0x17')](function(_0x5d2dfb){if(_0x5d2dfb){if(_0x1e0023){var _0x45fb94=null;for(var _0x23c75f=0x1;_0x23c75f<_0x5528da[_0xbf2b('0x7f')][_0xbf2b('0x41')];++_0x23c75f){_0x45fb94=_0x5528da['Messages'][_0x23c75f];var _0x2a96e8=_0x45fb94['UserId']?util['format'](_0xbf2b('0x80'),_0x1bd3e6['agentAlias'],_0x45fb94[_0xbf2b('0x81')]):'System';var _0x10ad70=_0x1cc28b['body'][_0xbf2b('0x82')]||util['format']('%s%d',_0xbf2b('0x83'),_0x45fb94[_0xbf2b('0x84')]);switch(_0x1bd3e6['agentIdentifier']){case _0xbf2b('0x85'):_0x2a96e8=_0x45fb94[_0xbf2b('0x81')]?util[_0xbf2b('0x79')](_0xbf2b('0x80'),_0x1bd3e6[_0xbf2b('0x86')],_0x45fb94[_0xbf2b('0x81')]):'System';break;case'agent_alias':_0x2a96e8=_0x45fb94[_0xbf2b('0x81')]?_0x45fb94[_0xbf2b('0x7d')][_0xbf2b('0x87')]||_0x45fb94[_0xbf2b('0x7d')]['fullname']:_0xbf2b('0x88');break;case _0xbf2b('0x89'):_0x2a96e8=_0x45fb94[_0xbf2b('0x81')]?_0x45fb94[_0xbf2b('0x7d')]['fullname']:'System';break;default:_0x2a96e8=_0x45fb94[_0xbf2b('0x81')]?util[_0xbf2b('0x79')](_0xbf2b('0x80'),_0x1bd3e6[_0xbf2b('0x86')],_0x45fb94[_0xbf2b('0x81')]):_0xbf2b('0x88');}var _0xf709fe=util['format'](_0xbf2b('0x8a'),moment(_0x45fb94[_0xbf2b('0x8b')])[_0xbf2b('0x79')](_0xbf2b('0x8c')),_0x45fb94['direction']==='in'?_0x10ad70:_0x2a96e8,_0x45fb94[_0xbf2b('0x47')]);if(!_0x45fb94['secret']){fs[_0xbf2b('0x8d')](_0x1e0023,_0xf709fe);}}return db[_0xbf2b('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbf2b('0x8f')],'as':_0xbf2b('0x90'),'raw':!![],'include':[{'model':db[_0xbf2b('0x91')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xbf2b('0x17')](function(_0x6cd4fc){if(!_0x6cd4fc||!_0x6cd4fc[_0xbf2b('0x90')]||!_0x1cc28b[_0xbf2b('0x47')])return _0x5528da;var _0x1eac1a=_0x6cd4fc[_0xbf2b('0x92')]();return respondWithRpcPromise(_0xbf2b('0x93'),_0xbf2b('0x94'),{'account':_0x1eac1a,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x6cd4fc[_0xbf2b('0x4f')],_0x6cd4fc['email']||_0x6cd4fc[_0xbf2b('0x90')]['user']),'to':_0x1cc28b[_0xbf2b('0x47')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xbf2b('0x79')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1cc28b[_0xbf2b('0x47')]['mailTranscript']),'attachments':[{'path':_0x1e0023}]}})[_0xbf2b('0x17')](function(){return _0x5528da;})['catch'](function(_0x678038){logger[_0xbf2b('0x1e')](_0x678038);});})[_0xbf2b('0x17')](respondWithStatusCode(_0xd2812,0xc8))[_0xbf2b('0x22')](handleError(_0xd2812,null));};exports[_0xbf2b('0x95')]=function(_0x559697,_0x14f9a2){return db['ChatMessage'][_0xbf2b('0x45')]({'where':{'id':_0x559697['params']['id']}})['then'](handleEntityNotFound(_0x14f9a2,null))[_0xbf2b('0x17')](function(_0x802a09){if(_0x802a09){return _0x802a09['addMessage'](_0x559697[_0xbf2b('0x47')][_0xbf2b('0x96')],_['omit'](_0x559697[_0xbf2b('0x47')],[_0xbf2b('0x96'),'id'])||{});}})[_0xbf2b('0x17')](respondWithResult(_0x14f9a2,null))['catch'](handleError(_0x14f9a2,null));};exports[_0xbf2b('0x97')]=function(_0x25fece,_0x5e028d){var _0x590dab={'raw':![],'where':{}};var _0x342ed4={};var _0x5b98b0={'count':0x0,'rows':[]};return db[_0xbf2b('0x35')][_0xbf2b('0x49')]({'where':{'id':_0x25fece[_0xbf2b('0x3b')]['id']}})[_0xbf2b('0x17')](handleEntityNotFound(_0x5e028d,null))[_0xbf2b('0x17')](function(_0x4920cd){if(_0x4920cd){_0x342ed4[_0xbf2b('0x3c')]=_[_0xbf2b('0x3d')](db['ChatMessage'][_0xbf2b('0x98')]);_0x342ed4[_0xbf2b('0x38')]=_[_0xbf2b('0x3d')](_0x25fece['query']);_0x342ed4[_0xbf2b('0x99')]=_[_0xbf2b('0x3e')](_0x342ed4['model'],_0x342ed4[_0xbf2b('0x38')]);_0x590dab['attributes']=_[_0xbf2b('0x3e')](_0x342ed4[_0xbf2b('0x3c')],qs[_0xbf2b('0x40')](_0x25fece[_0xbf2b('0x38')][_0xbf2b('0x40')]));_0x590dab[_0xbf2b('0x3f')]=_0x590dab[_0xbf2b('0x3f')][_0xbf2b('0x41')]?_0x590dab['attributes']:_0x342ed4[_0xbf2b('0x3c')];if(!_0x25fece[_0xbf2b('0x38')][_0xbf2b('0x9a')](_0xbf2b('0x9b'))){_0x590dab[_0xbf2b('0x29')]=qs['limit'](_0x25fece[_0xbf2b('0x38')][_0xbf2b('0x29')]);_0x590dab[_0xbf2b('0x27')]=qs[_0xbf2b('0x27')](_0x25fece[_0xbf2b('0x38')][_0xbf2b('0x27')]);}_0x590dab['order']=qs[_0xbf2b('0x9c')](_0x25fece[_0xbf2b('0x38')][_0xbf2b('0x9c')]);_0x590dab[_0xbf2b('0x9d')]=qs[_0xbf2b('0x99')](_[_0xbf2b('0x9e')](_0x25fece[_0xbf2b('0x38')],_0x342ed4[_0xbf2b('0x99')]));_0x590dab[_0xbf2b('0x9d')][_0xbf2b('0x9f')]=_0x4920cd['id'];if(_0x25fece[_0xbf2b('0x38')]['filter']){_0x590dab['where']=_[_0xbf2b('0x30')](_0x590dab[_0xbf2b('0x9d')],{'$or':_['map'](_0x590dab[_0xbf2b('0x3f')],function(_0x3722b4){var _0x5b679c={};_0x5b679c[_0x3722b4]={'$like':'%'+_0x25fece[_0xbf2b('0x38')][_0xbf2b('0xa0')]+'%'};return _0x5b679c;})});}if(_0x25fece[_0xbf2b('0x38')][_0xbf2b('0xa1')]){var _0x119887=_0x25fece[_0xbf2b('0x38')][_0xbf2b('0xa1')][_0xbf2b('0xa2')](',');var _0x4cb6d9={};_0x4cb6d9[_0x119887[0x0]]={'$gte':moment(_0x119887[0x1])[_0xbf2b('0x79')](_0xbf2b('0xa3'))};_0x590dab[_0xbf2b('0x9d')]=_[_0xbf2b('0x30')](_0x590dab[_0xbf2b('0x9d')],_0x4cb6d9);}_0x590dab=_[_0xbf2b('0x30')]({},_0x590dab,_0x25fece[_0xbf2b('0x44')]);return db[_0xbf2b('0x5d')][_0xbf2b('0x2a')]({'where':_0x590dab[_0xbf2b('0x9d')]})[_0xbf2b('0x17')](function(_0x5ab930){_0x5b98b0[_0xbf2b('0x2a')]=_0x5ab930;if(_0x25fece[_0xbf2b('0x38')][_0xbf2b('0x42')]){_0x590dab[_0xbf2b('0x43')]=[{'all':!![]}];}return db[_0xbf2b('0x5d')]['findAll'](_0x590dab);})[_0xbf2b('0x17')](function(_0x398633){_0x5b98b0['rows']=_0x398633;return _0x5b98b0;});}})[_0xbf2b('0x17')](respondWithFilteredResult(_0x5e028d,_0x590dab))[_0xbf2b('0x22')](handleError(_0x5e028d,null));};exports[_0xbf2b('0xa4')]=function(_0x275990,_0x36cac7){var _0x2b8e54={'where':{}},_0x580a4d={},_0x5e65af={'count':0x0,'rows':[]};return db[_0xbf2b('0x35')]['findOne']({'where':{'id':_0x275990['params']['id']}})['then'](handleEntityNotFound(_0x36cac7,null))['then'](function(_0x2ce960){if(_0x2ce960){_0x580a4d[_0xbf2b('0x3c')]=_[_0xbf2b('0x3d')](db[_0xbf2b('0x5d')]['rawAttributes']);_0x580a4d[_0xbf2b('0x38')]=_[_0xbf2b('0x3d')](_0x275990[_0xbf2b('0x38')]);_0x580a4d['filters']=_['intersection'](_0x580a4d[_0xbf2b('0x3c')],_0x580a4d['query']);_0x2b8e54['attributes']=_[_0xbf2b('0x3e')](_0x580a4d[_0xbf2b('0x3c')],qs[_0xbf2b('0x40')](_0x275990[_0xbf2b('0x38')][_0xbf2b('0x40')]));_0x2b8e54['attributes']=_0x2b8e54[_0xbf2b('0x3f')][_0xbf2b('0x41')]?_0x2b8e54['attributes']:_0x580a4d[_0xbf2b('0x3c')];if(!_0x275990[_0xbf2b('0x38')][_0xbf2b('0x9a')](_0xbf2b('0x9b'))){_0x2b8e54[_0xbf2b('0x29')]=qs[_0xbf2b('0x29')](_0x275990[_0xbf2b('0x38')][_0xbf2b('0x29')]);_0x2b8e54[_0xbf2b('0x27')]=qs[_0xbf2b('0x27')](_0x275990[_0xbf2b('0x38')][_0xbf2b('0x27')]);}_0x2b8e54['order']=qs[_0xbf2b('0x9c')](_0x275990[_0xbf2b('0x38')][_0xbf2b('0x9c')]);_0x2b8e54[_0xbf2b('0x9d')]=qs[_0xbf2b('0x99')](_[_0xbf2b('0x9e')](_0x275990[_0xbf2b('0x38')],_0x580a4d['filters']));_0x2b8e54[_0xbf2b('0x9d')][_0xbf2b('0x9f')]=_0x2ce960['id'];if(_0x275990[_0xbf2b('0x38')][_0xbf2b('0xa0')]){_0x2b8e54[_0xbf2b('0x9d')]=_[_0xbf2b('0x30')](_0x2b8e54[_0xbf2b('0x9d')],{'$or':_['map'](_0x2b8e54[_0xbf2b('0x3f')],function(_0x1393ee){var _0x2682c1={};_0x2682c1[_0x1393ee]={'$like':'%'+_0x275990['query'][_0xbf2b('0xa0')]+'%'};return _0x2682c1;})});}_0x2b8e54[_0xbf2b('0x9d')][_0xbf2b('0xa5')]=![];if(_0x275990[_0xbf2b('0x38')]['id']){_0x2b8e54[_0xbf2b('0x9d')]['id']={'$gt':_0x275990[_0xbf2b('0x38')]['id']};}_0x2b8e54=_['merge']({},_0x2b8e54,_0x275990[_0xbf2b('0x44')]);return db[_0xbf2b('0x5d')]['count']({'where':_0x2b8e54[_0xbf2b('0x9d')]})['then'](function(_0x513334){_0x5e65af[_0xbf2b('0x2a')]=_0x513334;_0x2b8e54[_0xbf2b('0x43')]=[];if(_0x275990[_0xbf2b('0x38')][_0xbf2b('0xa6')]){_0x2b8e54[_0xbf2b('0x43')]['push']({'model':db['User'],'as':'User','attributes':['id',_0xbf2b('0x50'),_0xbf2b('0x87')]});}if(_0x275990[_0xbf2b('0x38')]['includeAll']){_0x2b8e54[_0xbf2b('0x43')]=[{'all':!![]}];}return db[_0xbf2b('0x5d')][_0xbf2b('0xa7')](_0x2b8e54);})[_0xbf2b('0x17')](function(_0x3dee1b){_0x5e65af[_0xbf2b('0xa8')]=_0x3dee1b;return _0x5e65af;});}})['then'](respondWithFilteredResult(_0x36cac7,_0x2b8e54))['catch'](handleError(_0x36cac7,null));};exports[_0xbf2b('0xa9')]=function(_0x4d2187,_0x4cccb2){return db[_0xbf2b('0x35')][_0xbf2b('0x45')]({'where':{'id':_0x4d2187[_0xbf2b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4cccb2,null))[_0xbf2b('0x17')](function(_0xbcec91){if(_0xbcec91){return _0xbcec91[_0xbf2b('0xaa')](_0x4d2187[_0xbf2b('0x47')]['ids'],_[_0xbf2b('0xab')](_0x4d2187[_0xbf2b('0x47')],['ids','id'])||{})['spread'](function(){return db[_0xbf2b('0xac')][_0xbf2b('0xa7')]({'attributes':['id',_0xbf2b('0x4f'),_0xbf2b('0xad')],'where':{'id':_0x4d2187[_0xbf2b('0x47')][_0xbf2b('0x96')]}});})['then'](function(_0x5b971e){socket[_0xbf2b('0xae')]('chatInteractionTags:save',{'id':Number(_0x4d2187['params']['id']),'tags':_0x5b971e||[]});return{'id':Number(_0x4d2187[_0xbf2b('0x3b')]['id']),'tags':_0x5b971e||[]};});}})['then'](respondWithResult(_0x4cccb2,null))[_0xbf2b('0x22')](handleError(_0x4cccb2,null));};exports['removeTags']=function(_0x26f74c,_0x5297e8){return db[_0xbf2b('0x35')][_0xbf2b('0x45')]({'where':{'id':_0x26f74c[_0xbf2b('0x3b')]['id']}})[_0xbf2b('0x17')](handleEntityNotFound(_0x5297e8,null))[_0xbf2b('0x17')](function(_0x6ee08b){if(_0x6ee08b){return _0x6ee08b[_0xbf2b('0xaf')](_0x26f74c[_0xbf2b('0x38')][_0xbf2b('0x96')]);}})[_0xbf2b('0x17')](respondWithStatusCode(_0x5297e8,null))['catch'](handleError(_0x5297e8,null));};exports[_0xbf2b('0x76')]=function(_0xadc254,_0x2d4288){var _0x405edb=moment()['unix']()['toString']();var _0x53f853=path[_0xbf2b('0x71')](config[_0xbf2b('0x72')],_0xbf2b('0xb0'),_0xbf2b('0xb1'),_0xbf2b('0xb2'));var _0x33b7a5=path[_0xbf2b('0x71')](config[_0xbf2b('0x72')],'server',_0xbf2b('0xb1'),'attachments');var _0x1cc173=path['join'](_0x53f853,_0x405edb);var _0x5db5e3=util[_0xbf2b('0x79')](_0xbf2b('0xb3'),_0xadc254[_0xbf2b('0x3b')]['id'],_0x405edb);var _0x3f4f94=path[_0xbf2b('0x71')](_0x53f853,_0x5db5e3);var _0x12fda9=[];_0x12fda9[_0xbf2b('0xb4')]({'model':db[_0xbf2b('0x7d')],'as':'User','attributes':['id',_0xbf2b('0x50')],'raw':!![]});_0x12fda9[_0xbf2b('0xb4')]({'model':db['CmContact'],'as':_0xbf2b('0x62'),'attributes':['id',_0xbf2b('0xb5'),_0xbf2b('0xb6')],'raw':!![]});if(_0xadc254[_0xbf2b('0x38')][_0xbf2b('0xb7')]){_0x12fda9[_0xbf2b('0xb4')]({'model':db[_0xbf2b('0xb8')],'as':_0xbf2b('0xb8'),'raw':!![]});}var _0x43727f=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body',_0xbf2b('0x8b'),_0xbf2b('0xb9'),_0xbf2b('0xa5'),_0xbf2b('0xba')],'include':_0x12fda9}];_0x43727f['push']({'model':db[_0xbf2b('0x7e')],'as':'Account','attributes':['id',_0xbf2b('0x4f')]});_0x43727f[_0xbf2b('0xb4')]({'model':db['User'],'as':'Owner','attributes':['id',_0xbf2b('0x50')]});return db[_0xbf2b('0x35')]['find']({'where':{'id':_0xadc254[_0xbf2b('0x3b')]['id']},'include':_0x43727f})[_0xbf2b('0x17')](handleEntityNotFound(_0x2d4288,null))['then'](function(_0x19fbd8){if(_0x19fbd8){var _0x3ad796=_0x19fbd8[_0xbf2b('0xbb')]({'plain':!![]});fs[_0xbf2b('0xbc')](_0x1cc173);var _0x3f4fab={'channel':'Chat','account':_0x3ad796[_0xbf2b('0xbd')]['name'],'agent':_0x3ad796[_0xbf2b('0xbe')]?_0x3ad796[_0xbf2b('0xbe')][_0xbf2b('0x50')]:_0xbf2b('0xbf'),'createdAt':moment(_0x3ad796[_0xbf2b('0x8b')])[_0xbf2b('0x79')](_0xbf2b('0xa3'))['toString'](),'closedAt':_0x3ad796[_0xbf2b('0xc0')]?moment(_0x3ad796['closedAt'])[_0xbf2b('0x79')](_0xbf2b('0xa3'))[_0xbf2b('0xc1')]():'','disposition':_0x3ad796[_0xbf2b('0x67')],'chatInfo':{'browser':_0x3ad796[_0xbf2b('0xc2')],'os':_0x3ad796[_0xbf2b('0xc3')],'referer':_0x3ad796[_0xbf2b('0xc4')],'customerIp':_0x3ad796[_0xbf2b('0xc5')],'customerPort':_0x3ad796['customerPort']?_0x3ad796[_0xbf2b('0xc6')]:_0xbf2b('0xbf')},'messages':_(_0x3ad796[_0xbf2b('0x7f')])[_0xbf2b('0xc7')]()[_0xbf2b('0xa0')]({'secret':![]})['map'](function(_0x392b71){if(_0x392b71[_0xbf2b('0xb8')]){var _0x2d0dd0=path[_0xbf2b('0x71')](_0x33b7a5,_0x392b71[_0xbf2b('0xb8')][_0xbf2b('0x75')]);if(fs[_0xbf2b('0xc8')](_0x2d0dd0)){fs[_0xbf2b('0xc9')](_0x2d0dd0)[_0xbf2b('0xca')](fs[_0xbf2b('0xcb')](path['join'](_0x1cc173,_0x392b71['Attachment'][_0xbf2b('0x75')])));}}return{'date':moment(_0x392b71[_0xbf2b('0x8b')])['format'](_0xbf2b('0xa3'))[_0xbf2b('0xc1')](),'sender':_0x392b71[_0xbf2b('0xb9')]==='out'?_0x392b71[_0xbf2b('0x7d')]?_0x392b71[_0xbf2b('0x7d')][_0xbf2b('0x50')]:_0xbf2b('0x88'):_0x392b71[_0xbf2b('0x62')][_0xbf2b('0xb5')]+(_0x392b71['Contact'][_0xbf2b('0xb6')]?'\x20'+_0x392b71[_0xbf2b('0x62')][_0xbf2b('0xb6')]:''),'body':_0x392b71['Attachment']?_0x392b71['Attachment'][_0xbf2b('0x75')]:_0x392b71[_0xbf2b('0x47')],'direction':_0x392b71[_0xbf2b('0xb9')]===_0xbf2b('0x5c')?'A':'C','secret':_0x392b71['secret'],'read':_0x392b71[_0xbf2b('0xba')],'attachment':_0x392b71['Attachment']};})[_0xbf2b('0xcc')]()};return ejs[_0xbf2b('0xcd')](path[_0xbf2b('0x71')](config['root'],_0xbf2b('0xb0'),_0xbf2b('0xce'),_0xbf2b('0xcf')),{'interaction':_0x3f4fab})[_0xbf2b('0x17')](function(_0x188ec9){var _0x544664=path[_0xbf2b('0x71')](_0x1cc173,'transcript-'+_0x3ad796['id']+'-'+_0x405edb+'.pdf');var _0x7504a5={'path':_0x544664,'channel':_0xbf2b('0xd0'),'interactionId':_0x3ad796['id']};return pdf['createPdfFromHTML'](_0x188ec9,_0x7504a5);})[_0xbf2b('0x17')](function(){return new Promise(function(_0x1fabf1,_0x5ef1bf){zipdir(_0x1cc173,{'saveTo':_0x3f4f94},function(_0x1f0ced,_0x27bbdd){if(_0x1f0ced)return _0x5ef1bf(_0x1f0ced);return _0x1fabf1(_0x27bbdd);});})[_0xbf2b('0x17')](function(){return new BPromise(function(_0x1f3027,_0x67c1cf){rimraf(_0x1cc173,function(_0x1eb351){if(_0x1eb351)_0x67c1cf(_0x1eb351);return _0x1f3027();});});})[_0xbf2b('0x17')](function(){return _0x2d4288[_0xbf2b('0x76')](_0x3f4f94,_0x5db5e3,function(_0x509b6f){if(_0x509b6f){logger[_0xbf2b('0x1e')](_0xbf2b('0xd1'),_0x509b6f);}else{fs[_0xbf2b('0xd2')](_0x3f4f94);}});});});}else{return _0x2d4288[_0xbf2b('0x23')](0xc8);}})[_0xbf2b('0x22')](handleError(_0x2d4288,null));}; \ No newline at end of file +var _0x3a2d=['rawAttributes','filters','intersection','attributes','fields','includeAll','include','merge','options','create','body','update','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','POST','vidaooTopic','isNull','follow','vidaooMetadata','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ChatWebsiteId','CmContact','ContactId','Messages','length','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','UserId','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','push','rows','addTags','spread','Tag','color','emit','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','createdAt','secret','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','osName','customerIp','customerPort','tail','existsSync','createReadStream','firstName','lastName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','request-promise','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','destroy','stack','name','send','render','contact','agent','account','index','map','type','key','findAll','chat','query','user','catch','params','model','keys','ChatInteraction'];(function(_0xaa87c6,_0x20ed4f){var _0x4df3ed=function(_0x3c8b81){while(--_0x3c8b81){_0xaa87c6['push'](_0xaa87c6['shift']());}};_0x4df3ed(++_0x20ed4f);}(_0x3a2d,0x169));var _0xd3a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a2d[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd3a2('0x0'));var rp=require(_0xd3a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3a2('0x2'));var util=require(_0xd3a2('0x3'));var path=require(_0xd3a2('0x4'));var ejs=require(_0xd3a2('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd3a2('0x6'));var interaction=require(_0xd3a2('0x7'));var qs=require(_0xd3a2('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xd3a2('0x9'))(_0xd3a2('0xa'));var config=require(_0xd3a2('0xb'));var db=require(_0xd3a2('0xc'))['db'];config[_0xd3a2('0xd')]=_['defaults'](config[_0xd3a2('0xd')],{'host':_0xd3a2('0xe'),'port':0x18eb});var socket=require(_0xd3a2('0xf'))(new Redis(config['redis']));require(_0xd3a2('0x10'))[_0xd3a2('0x11')](socket);var jayson=require(_0xd3a2('0x12'));var client=jayson[_0xd3a2('0x13')]['http']({'port':0x232b});var client9004=jayson[_0xd3a2('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4a2891,_0x304a13,_0x5964b0,_0x3afb38){return new BPromise(function(_0x42f1e9,_0x2c1347){var _0x48371f=_0x3afb38||client;return _0x48371f['request'](_0x4a2891,_0x5964b0)[_0xd3a2('0x14')](function(_0x47b003){logger[_0xd3a2('0x15')](_0xd3a2('0x16'),_0x304a13,_0xd3a2('0x17'));logger[_0xd3a2('0x18')](_0xd3a2('0x19'),_0x304a13,_0xd3a2('0x17'),JSON[_0xd3a2('0x1a')](_0x47b003));if(_0x47b003[_0xd3a2('0x1b')]){if(_0x47b003['error']['code']===0x1f4){logger[_0xd3a2('0x1b')](_0xd3a2('0x16'),_0x304a13,_0x47b003[_0xd3a2('0x1b')][_0xd3a2('0x1c')]);return _0x2c1347(_0x47b003[_0xd3a2('0x1b')]['message']);}logger[_0xd3a2('0x1b')](_0xd3a2('0x16'),_0x304a13,_0x47b003['error'][_0xd3a2('0x1c')]);return _0x42f1e9(_0x47b003[_0xd3a2('0x1b')][_0xd3a2('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x304a13,_0xd3a2('0x17'));_0x42f1e9(_0x47b003['result'][_0xd3a2('0x1c')]);}})['catch'](function(_0x50c604){logger['error'](_0xd3a2('0x16'),_0x304a13,_0x50c604);_0x2c1347(_0x50c604);});});}function respondWithStatusCode(_0x301214,_0xcf1792){_0xcf1792=_0xcf1792||0xcc;return function(_0x1ee570){if(_0x1ee570){return _0x301214[_0xd3a2('0x1d')](_0xcf1792);}return _0x301214[_0xd3a2('0x1e')](_0xcf1792)['end']();};}function respondWithResult(_0x29e196,_0x383c92){_0x383c92=_0x383c92||0xc8;return function(_0x546886){if(_0x546886){return _0x29e196[_0xd3a2('0x1e')](_0x383c92)['json'](_0x546886);}};}function respondWithFilteredResult(_0x5822da,_0x49e0af){return function(_0x35a739){if(_0x35a739){var _0x340ce6=typeof _0x49e0af['offset']==='undefined'&&typeof _0x49e0af[_0xd3a2('0x1f')]===_0xd3a2('0x20');var _0x525a4e=_0x35a739[_0xd3a2('0x21')];var _0x315aff=_0x340ce6?0x0:_0x49e0af['offset'];var _0xf9f47f=_0x340ce6?_0x35a739[_0xd3a2('0x21')]:_0x49e0af[_0xd3a2('0x22')]+_0x49e0af[_0xd3a2('0x1f')];var _0x4f3cf8;if(_0xf9f47f>=_0x525a4e){_0xf9f47f=_0x525a4e;_0x4f3cf8=0xc8;}else{_0x4f3cf8=0xce;}_0x5822da['status'](_0x4f3cf8);return _0x5822da[_0xd3a2('0x23')](_0xd3a2('0x24'),_0x315aff+'-'+_0xf9f47f+'/'+_0x525a4e)[_0xd3a2('0x25')](_0x35a739);}return null;};}function saveUpdates(_0x3841f7){return function(_0x229322){if(_0x229322){return _0x229322['update'](_0x3841f7)[_0xd3a2('0x14')](function(_0x39f209){return _0x39f209;});}return null;};}function removeEntity(_0x575937){return function(_0x29bf89){if(_0x29bf89){return _0x29bf89[_0xd3a2('0x26')]()[_0xd3a2('0x14')](function(){_0x575937[_0xd3a2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16afac){return function(_0x5265fa){if(!_0x5265fa){_0x16afac[_0xd3a2('0x1d')](0x194);}return _0x5265fa;};}function handleError(_0x24fb96,_0x46b71c){_0x46b71c=_0x46b71c||0x1f4;return function(_0x56720d){logger['error'](_0x56720d[_0xd3a2('0x27')]);if(_0x56720d[_0xd3a2('0x28')]){delete _0x56720d[_0xd3a2('0x28')];}_0x24fb96[_0xd3a2('0x1e')](_0x46b71c)[_0xd3a2('0x29')](_0x56720d);};}function getMustacheRender(_0x484f5f,_0x1db1d7){return Mustache[_0xd3a2('0x2a')](_0x484f5f,_['merge'](_0x1db1d7['body'],{'contact':_0x1db1d7[_0xd3a2('0x2b')],'message':_0x1db1d7[_0xd3a2('0x1c')],'agent':_0x1db1d7[_0xd3a2('0x2c')],'interaction':_0x1db1d7['interaction'],'account':_0x1db1d7[_0xd3a2('0x2d')]}))||'';}exports[_0xd3a2('0x2e')]=function(_0x336220,_0x1de314){var _0x5a8670={};var _0xab06ac=_[_0xd3a2('0x2f')](db['ChatInteraction']['rawAttributes'],function(_0x565833){return{'name':_0x565833['fieldName'],'type':_0x565833[_0xd3a2('0x30')][_0xd3a2('0x31')]};});_0x5a8670=qs['getOptions'](_0xab06ac,_0x336220);return interaction[_0xd3a2('0x32')](_0xd3a2('0x33'),_0x336220[_0xd3a2('0x34')],_0x336220[_0xd3a2('0x35')],_0x5a8670,_0xab06ac)['then'](respondWithFilteredResult(_0x1de314,_0x5a8670))[_0xd3a2('0x36')](handleError(_0x1de314,null));};exports['show']=function(_0x407be8,_0x3a9615){var _0xc930a3={'raw':![],'where':{'id':_0x407be8[_0xd3a2('0x37')]['id']}},_0x7b2150={};_0x7b2150[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db[_0xd3a2('0x3a')][_0xd3a2('0x3b')]);_0x7b2150[_0xd3a2('0x34')]=_[_0xd3a2('0x39')](_0x407be8['query']);_0x7b2150[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x7b2150[_0xd3a2('0x38')],_0x7b2150['query']);_0xc930a3[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x7b2150['model'],qs[_0xd3a2('0x3f')](_0x407be8[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0xc930a3['attributes']=_0xc930a3['attributes']['length']?_0xc930a3['attributes']:_0x7b2150[_0xd3a2('0x38')];if(_0x407be8['query'][_0xd3a2('0x40')]){_0xc930a3[_0xd3a2('0x41')]=[{'all':!![]}];}_0xc930a3=_[_0xd3a2('0x42')]({},_0xc930a3,_0x407be8[_0xd3a2('0x43')]);return db['ChatInteraction']['find'](_0xc930a3)[_0xd3a2('0x14')](handleEntityNotFound(_0x3a9615,null))['then'](respondWithResult(_0x3a9615,null))['catch'](handleError(_0x3a9615,null));};exports[_0xd3a2('0x44')]=function(_0x3ec1fb,_0x18a672){return db[_0xd3a2('0x3a')]['create'](_0x3ec1fb[_0xd3a2('0x45')],{})[_0xd3a2('0x14')](respondWithResult(_0x18a672,0xc9))[_0xd3a2('0x36')](handleError(_0x18a672,null));};exports[_0xd3a2('0x46')]=function(_0x325c0d,_0x298557){if(_0x325c0d[_0xd3a2('0x45')]['id']){delete _0x325c0d['body']['id'];}return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x325c0d[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x298557,null))[_0xd3a2('0x14')](saveUpdates(_0x325c0d[_0xd3a2('0x45')],null))[_0xd3a2('0x14')](respondWithResult(_0x298557,null))[_0xd3a2('0x36')](handleError(_0x298557,null));};exports['destroy']=function(_0x1dca0a,_0x2719fd){return db['ChatInteraction']['find']({'where':{'id':_0x1dca0a[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x2719fd,null))[_0xd3a2('0x14')](removeEntity(_0x2719fd,null))[_0xd3a2('0x36')](handleError(_0x2719fd,null));};exports[_0xd3a2('0x48')]=function(_0x425a6f,_0x2fa2bd){return db['ChatInteraction'][_0xd3a2('0x48')]()[_0xd3a2('0x14')](respondWithResult(_0x2fa2bd,null))[_0xd3a2('0x36')](handleError(_0x2fa2bd,null));};exports[_0xd3a2('0x49')]=function(_0x1ce12a,_0x5f3da2){var _0x201b34=_0x1ce12a[_0xd3a2('0x37')]['id'];var _0x15d713;var _0x22d4c7;var _0x2e0a42;return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x201b34}})['then'](function(_0x1e8f3a){_0x15d713=_0x1e8f3a;return db[_0xd3a2('0x4b')][_0xd3a2('0x4a')]({'where':{'id':_0x1e8f3a['ChatWebsiteId']},'attributes':['id',_0xd3a2('0x4c'),_0xd3a2('0x4d'),'vidaooTopic',_0xd3a2('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xd3a2('0x14')](function(_0x3f32c8){if(_0x3f32c8&&_0x3f32c8[_0xd3a2('0x4c')]&&_0x3f32c8['vidaooEscalation']){_0x22d4c7=_0x3f32c8;var _0x5b3f2={'interaction':{'id':_0x201b34},'agent':{'id':_0x1ce12a[_0xd3a2('0x35')]['id'],'name':_0x1ce12a[_0xd3a2('0x35')][_0xd3a2('0x28')],'fullname':_0x1ce12a['user'][_0xd3a2('0x4f')],'email':_0x1ce12a['user'][_0xd3a2('0x50')]},'contact':_0x1ce12a[_0xd3a2('0x45')][_0xd3a2('0x2b')],'account':_0x1ce12a[_0xd3a2('0x45')][_0xd3a2('0x2d')]};var _0x1bf660={'rejectUnauthorized':![],'method':_0xd3a2('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3f32c8[_0xd3a2('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ce12a[_0xd3a2('0x35')][_0xd3a2('0x50')]],'buttons':null,'topic':_0x22d4c7[_0xd3a2('0x52')],'note':_[_0xd3a2('0x53')](_0x22d4c7[_0xd3a2('0x4e')])?null:getMustacheRender(_0x22d4c7['vidaooNote'],_0x5b3f2),'metadata':null},'redirect':_0xd3a2('0x54'),'json':!![]};try{if(!_[_0xd3a2('0x53')](_0x22d4c7[_0xd3a2('0x55')])){var _0x59686d=getMustacheRender(_0x22d4c7[_0xd3a2('0x55')],_0x5b3f2);var _0x2bd1de=JSON[_0xd3a2('0x56')](_0x59686d);_0x1bf660[_0xd3a2('0x45')]['metadata']=_0x2bd1de;}}catch(_0x3ca44a){throw new db[(_0xd3a2('0x57'))]['ValidationError'](_0xd3a2('0x58'));}return rp(_0x1bf660);}else{throw new db[(_0xd3a2('0x57'))][(_0xd3a2('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd3a2('0x14')](function(_0x3a2a0d){_0x2e0a42=_0x3a2a0d;if(_0x2e0a42['id']){var _0x315f28={'body':_0x2e0a42[_0xd3a2('0x5a')],'ChatWebsiteId':_0x22d4c7['id'],'ChatInteractionId':_0x15d713['id'],'direction':'out','UserId':_0x1ce12a[_0xd3a2('0x35')]['id']};return db['ChatMessage'][_0xd3a2('0x44')](_0x315f28,{});}else{throw new db[(_0xd3a2('0x57'))]['ValidationError'](_0xd3a2('0x5b'));}})[_0xd3a2('0x14')](function(){return _0x15d713[_0xd3a2('0x5c')]({'vidaooSessionId':_0x2e0a42['id']});})[_0xd3a2('0x14')](respondWithResult(_0x5f3da2,null))[_0xd3a2('0x36')](handleError(_0x5f3da2,null));};exports[_0xd3a2('0x5d')]=function(_0x25290f,_0x5b943f){if(_0x25290f[_0xd3a2('0x45')]['id']){delete _0x25290f[_0xd3a2('0x45')]['id'];}return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x25290f[_0xd3a2('0x37')]['id']},'include':[{'model':db['CmContact'],'as':_0xd3a2('0x5e')}]})['then'](handleEntityNotFound(_0x5b943f,null))[_0xd3a2('0x14')](saveUpdates(_0x25290f[_0xd3a2('0x45')],null))[_0xd3a2('0x14')](respondWithResult(_0x5b943f,null))[_0xd3a2('0x36')](handleError(_0x5b943f,null));};exports[_0xd3a2('0x5f')]=function(_0x424742,_0x20bbc9){if(_0x424742[_0xd3a2('0x45')]['id']){delete _0x424742[_0xd3a2('0x45')]['id'];}return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x424742[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](function(_0x471226){if(!_0x471226){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd3a2('0x5f'),0x194,_0xd3a2('0x60'));_0x20bbc9[_0xd3a2('0x1d')](0x194);}else{if(_0x471226['UserId']){throw new db[(_0xd3a2('0x57'))][(_0xd3a2('0x59'))](_0xd3a2('0x61'));}}return _0x471226;})['then'](function(_0x60a9c1){if(_0x60a9c1){return _0x60a9c1['update']({'closed':_0x424742[_0xd3a2('0x45')][_0xd3a2('0x62')],'disposition':_0x424742[_0xd3a2('0x45')]['disposition']})[_0xd3a2('0x14')](function(_0x587594){return _0x587594;});}})[_0xd3a2('0x14')](function(){return respondWithRpcPromise(_0xd3a2('0x63'),_0xd3a2('0x5f'),_0x424742[_0xd3a2('0x45')],client9004);})[_0xd3a2('0x14')](respondWithResult(_0x20bbc9,null))[_0xd3a2('0x36')](handleError(_0x20bbc9,null));};exports[_0xd3a2('0x64')]=function(_0x401adb,_0x481ab6){_0x401adb[_0xd3a2('0x45')]['name']=_0x401adb['file'][_0xd3a2('0x65')];_0x401adb[_0xd3a2('0x45')][_0xd3a2('0x66')]=_0x401adb[_0xd3a2('0x67')][_0xd3a2('0x68')];_0x401adb[_0xd3a2('0x45')]['type']=_0x401adb[_0xd3a2('0x67')][_0xd3a2('0x69')];return db['Attachment']['create'](_0x401adb[_0xd3a2('0x45')])[_0xd3a2('0x14')](respondWithResult(_0x481ab6,0xc9))[_0xd3a2('0x36')](handleError(_0x481ab6,null));};exports[_0xd3a2('0x6a')]=function(_0x128381,_0x540a05){return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x128381[_0xd3a2('0x37')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x540a05,null))['then'](function(_0x534165){if(_0x534165){if(_0x534165['closed']){return _0x540a05[_0xd3a2('0x1e')](0x193)[_0xd3a2('0x25')]({'status':0x193,'message':_0xd3a2('0x6b')});}return db[_0xd3a2('0x6c')][_0xd3a2('0x4a')]({'where':{'id':_0x128381['query'][_0xd3a2('0x6d')]},'raw':!![]})['then'](handleEntityNotFound(_0x540a05,null));}})[_0xd3a2('0x14')](function(_0x1949f2){if(_0x1949f2){var _0x48b8a2=_0x1949f2[_0xd3a2('0x6e')]!==null;var _0xee6f5d=path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],'server/files/attachments/');if(_0x48b8a2){_0xee6f5d=path[_0xd3a2('0x6f')](_0xee6f5d,_0xd3a2('0x71'));}var _0x33380c=path[_0xd3a2('0x6f')](_0xee6f5d,_0x1949f2['basename']);return _0x540a05[_0xd3a2('0x72')](_0x33380c);}})[_0xd3a2('0x36')](handleError(_0x540a05,null));};exports[_0xd3a2('0x73')]=function(_0x1aac99,_0xbdb1ce){var _0x366162=null;var _0xd94ca7=null;var _0x5b1cd8=null;if(_0x1aac99[_0xd3a2('0x45')]['id']){delete _0x1aac99[_0xd3a2('0x45')]['id'];}if(_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x74')]){_0x5b1cd8=path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],_0xd3a2('0x75'),util[_0xd3a2('0x76')](_0xd3a2('0x77'),Date[_0xd3a2('0x78')]()));_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x79')]=_0x5b1cd8;}return db['ChatInteraction'][_0xd3a2('0x47')]({'where':{'id':_0x1aac99[_0xd3a2('0x37')]['id']},'include':[{'model':db[_0xd3a2('0x7a')],'as':'Messages','include':[{'model':db[_0xd3a2('0x7b')],'as':_0xd3a2('0x7b')}]}]})[_0xd3a2('0x14')](handleEntityNotFound(_0xbdb1ce,null))[_0xd3a2('0x14')](saveUpdates(_0x1aac99[_0xd3a2('0x45')],null))['then'](function(_0x3a7be7){if(_0x3a7be7){_0x366162=_0x3a7be7;return db[_0xd3a2('0x4b')][_0xd3a2('0x47')]({'where':{'id':_0x366162[_0xd3a2('0x7c')]}});}})[_0xd3a2('0x14')](function(_0x2cbbdf){if(_0x2cbbdf){_0xd94ca7=_0x2cbbdf;return db[_0xd3a2('0x7d')][_0xd3a2('0x47')]({'where':{'id':_0x366162[_0xd3a2('0x7e')]}});}})[_0xd3a2('0x14')](function(_0x5f26db){if(_0x5f26db){if(_0x5b1cd8){var _0x1bcdb1=null;for(var _0x9b58e0=0x1;_0x9b58e0<_0x366162[_0xd3a2('0x7f')][_0xd3a2('0x80')];++_0x9b58e0){_0x1bcdb1=_0x366162[_0xd3a2('0x7f')][_0x9b58e0];var _0x5a4a6d=_0x1bcdb1['UserId']?util[_0xd3a2('0x76')](_0xd3a2('0x81'),_0xd94ca7[_0xd3a2('0x82')],_0x1bcdb1['UserId']):_0xd3a2('0x83');var _0x28133c=_0x1aac99['body'][_0xd3a2('0x84')]||util[_0xd3a2('0x76')]('%s%d',_0xd3a2('0x85'),_0x1bcdb1[_0xd3a2('0x7e')]);switch(_0xd94ca7[_0xd3a2('0x86')]){case _0xd3a2('0x87'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?util[_0xd3a2('0x76')](_0xd3a2('0x81'),_0xd94ca7['agentAlias'],_0x1bcdb1[_0xd3a2('0x88')]):'System';break;case _0xd3a2('0x89'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?_0x1bcdb1['User'][_0xd3a2('0x8a')]||_0x1bcdb1[_0xd3a2('0x7b')][_0xd3a2('0x4f')]:_0xd3a2('0x83');break;case _0xd3a2('0x8b'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?_0x1bcdb1[_0xd3a2('0x7b')][_0xd3a2('0x4f')]:_0xd3a2('0x83');break;default:_0x5a4a6d=_0x1bcdb1['UserId']?util[_0xd3a2('0x76')]('%s%d',_0xd94ca7[_0xd3a2('0x82')],_0x1bcdb1[_0xd3a2('0x88')]):_0xd3a2('0x83');}var _0x165cdc=util['format'](_0xd3a2('0x8c'),moment(_0x1bcdb1['createdAt'])[_0xd3a2('0x76')](_0xd3a2('0x8d')),_0x1bcdb1[_0xd3a2('0x8e')]==='in'?_0x28133c:_0x5a4a6d,_0x1bcdb1[_0xd3a2('0x45')]);if(!_0x1bcdb1['secret']){fs[_0xd3a2('0x8f')](_0x5b1cd8,_0x165cdc);}}return db[_0xd3a2('0x90')][_0xd3a2('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xd3a2('0x91')],'as':_0xd3a2('0x92'),'raw':!![],'include':[{'model':db[_0xd3a2('0x93')],'as':_0xd3a2('0x93'),'raw':!![]}]}]});}}})[_0xd3a2('0x14')](function(_0x194a9c){if(!_0x194a9c||!_0x194a9c[_0xd3a2('0x92')]||!_0x1aac99['body'])return _0x366162;var _0x49d030=_0x194a9c['getSmtpOptions']();return respondWithRpcPromise(_0xd3a2('0x94'),'sendMail',{'account':_0x49d030,'message':{'from':util[_0xd3a2('0x76')](_0xd3a2('0x95'),_0x194a9c[_0xd3a2('0x28')],_0x194a9c[_0xd3a2('0x50')]||_0x194a9c[_0xd3a2('0x92')][_0xd3a2('0x35')]),'to':_0x1aac99['body'][_0xd3a2('0x74')],'subject':_0xd3a2('0x96'),'text':util[_0xd3a2('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x74')]),'attachments':[{'path':_0x5b1cd8}]}})[_0xd3a2('0x14')](function(){return _0x366162;})[_0xd3a2('0x36')](function(_0x404d00){logger[_0xd3a2('0x1b')](_0x404d00);});})['then'](respondWithStatusCode(_0xbdb1ce,0xc8))[_0xd3a2('0x36')](handleError(_0xbdb1ce,null));};exports[_0xd3a2('0x97')]=function(_0x40d87b,_0x22837e){return db['ChatMessage'][_0xd3a2('0x47')]({'where':{'id':_0x40d87b['params']['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x22837e,null))['then'](function(_0x31689a){if(_0x31689a){return _0x31689a['addMessage'](_0x40d87b[_0xd3a2('0x45')][_0xd3a2('0x98')],_[_0xd3a2('0x99')](_0x40d87b[_0xd3a2('0x45')],[_0xd3a2('0x98'),'id'])||{});}})[_0xd3a2('0x14')](respondWithResult(_0x22837e,null))['catch'](handleError(_0x22837e,null));};exports[_0xd3a2('0x9a')]=function(_0x31f618,_0x448f1c){var _0x141a62={'raw':![],'where':{}};var _0x52a704={};var _0x3d5ddc={'count':0x0,'rows':[]};return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x31f618['params']['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x448f1c,null))[_0xd3a2('0x14')](function(_0x1ba39b){if(_0x1ba39b){_0x52a704[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db['ChatMessage'][_0xd3a2('0x3b')]);_0x52a704[_0xd3a2('0x34')]=_['keys'](_0x31f618[_0xd3a2('0x34')]);_0x52a704[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x52a704[_0xd3a2('0x38')],_0x52a704[_0xd3a2('0x34')]);_0x141a62[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x52a704['model'],qs[_0xd3a2('0x3f')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0x141a62[_0xd3a2('0x3e')]=_0x141a62[_0xd3a2('0x3e')][_0xd3a2('0x80')]?_0x141a62[_0xd3a2('0x3e')]:_0x52a704['model'];if(!_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x9b')](_0xd3a2('0x9c'))){_0x141a62['limit']=qs[_0xd3a2('0x1f')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x1f')]);_0x141a62[_0xd3a2('0x22')]=qs[_0xd3a2('0x22')](_0x31f618['query'][_0xd3a2('0x22')]);}_0x141a62[_0xd3a2('0x9d')]=qs[_0xd3a2('0x9e')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x9e')]);_0x141a62[_0xd3a2('0x9f')]=qs[_0xd3a2('0x3c')](_[_0xd3a2('0xa0')](_0x31f618[_0xd3a2('0x34')],_0x52a704[_0xd3a2('0x3c')]));_0x141a62['where'][_0xd3a2('0xa1')]=_0x1ba39b['id'];if(_0x31f618['query'][_0xd3a2('0xa2')]){_0x141a62['where']=_['merge'](_0x141a62[_0xd3a2('0x9f')],{'$or':_['map'](_0x141a62[_0xd3a2('0x3e')],function(_0x5f51ac){var _0x519ae9={};_0x519ae9[_0x5f51ac]={'$like':'%'+_0x31f618['query'][_0xd3a2('0xa2')]+'%'};return _0x519ae9;})});}if(_0x31f618[_0xd3a2('0x34')][_0xd3a2('0xa3')]){var _0x13595e=_0x31f618[_0xd3a2('0x34')][_0xd3a2('0xa3')][_0xd3a2('0xa4')](',');var _0x13f07c={};_0x13f07c[_0x13595e[0x0]]={'$gte':moment(_0x13595e[0x1])[_0xd3a2('0x76')](_0xd3a2('0xa5'))};_0x141a62[_0xd3a2('0x9f')]=_[_0xd3a2('0x42')](_0x141a62[_0xd3a2('0x9f')],_0x13f07c);}_0x141a62=_[_0xd3a2('0x42')]({},_0x141a62,_0x31f618[_0xd3a2('0x43')]);return db[_0xd3a2('0x7a')][_0xd3a2('0x21')]({'where':_0x141a62['where']})[_0xd3a2('0x14')](function(_0x442d3d){_0x3d5ddc['count']=_0x442d3d;if(_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x40')]){_0x141a62['include']=[{'all':!![]}];}return db[_0xd3a2('0x7a')][_0xd3a2('0x32')](_0x141a62);})[_0xd3a2('0x14')](function(_0xef8852){_0x3d5ddc['rows']=_0xef8852;return _0x3d5ddc;});}})[_0xd3a2('0x14')](respondWithFilteredResult(_0x448f1c,_0x141a62))[_0xd3a2('0x36')](handleError(_0x448f1c,null));};exports[_0xd3a2('0xa6')]=function(_0x34060d,_0x48dc64){var _0x12f512={'where':{}},_0x209474={},_0x2f9b01={'count':0x0,'rows':[]};return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x34060d['params']['id']}})['then'](handleEntityNotFound(_0x48dc64,null))[_0xd3a2('0x14')](function(_0x468a3e){if(_0x468a3e){_0x209474[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db['ChatMessage'][_0xd3a2('0x3b')]);_0x209474[_0xd3a2('0x34')]=_[_0xd3a2('0x39')](_0x34060d[_0xd3a2('0x34')]);_0x209474[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x209474[_0xd3a2('0x38')],_0x209474[_0xd3a2('0x34')]);_0x12f512[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x209474[_0xd3a2('0x38')],qs[_0xd3a2('0x3f')](_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0x12f512[_0xd3a2('0x3e')]=_0x12f512[_0xd3a2('0x3e')][_0xd3a2('0x80')]?_0x12f512[_0xd3a2('0x3e')]:_0x209474[_0xd3a2('0x38')];if(!_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x9b')](_0xd3a2('0x9c'))){_0x12f512[_0xd3a2('0x1f')]=qs[_0xd3a2('0x1f')](_0x34060d['query'][_0xd3a2('0x1f')]);_0x12f512[_0xd3a2('0x22')]=qs[_0xd3a2('0x22')](_0x34060d[_0xd3a2('0x34')]['offset']);}_0x12f512['order']=qs['sort'](_0x34060d[_0xd3a2('0x34')]['sort']);_0x12f512['where']=qs[_0xd3a2('0x3c')](_[_0xd3a2('0xa0')](_0x34060d['query'],_0x209474[_0xd3a2('0x3c')]));_0x12f512[_0xd3a2('0x9f')]['ChatInteractionId']=_0x468a3e['id'];if(_0x34060d[_0xd3a2('0x34')]['filter']){_0x12f512['where']=_[_0xd3a2('0x42')](_0x12f512['where'],{'$or':_[_0xd3a2('0x2f')](_0x12f512[_0xd3a2('0x3e')],function(_0x4d1030){var _0x51dd1e={};_0x51dd1e[_0x4d1030]={'$like':'%'+_0x34060d[_0xd3a2('0x34')][_0xd3a2('0xa2')]+'%'};return _0x51dd1e;})});}_0x12f512[_0xd3a2('0x9f')]['secret']=![];if(_0x34060d[_0xd3a2('0x34')]['id']){_0x12f512[_0xd3a2('0x9f')]['id']={'$gt':_0x34060d[_0xd3a2('0x34')]['id']};}_0x12f512=_[_0xd3a2('0x42')]({},_0x12f512,_0x34060d[_0xd3a2('0x43')]);return db['ChatMessage'][_0xd3a2('0x21')]({'where':_0x12f512[_0xd3a2('0x9f')]})[_0xd3a2('0x14')](function(_0x106e7b){_0x2f9b01[_0xd3a2('0x21')]=_0x106e7b;_0x12f512[_0xd3a2('0x41')]=[];if(_0x34060d['query'][_0xd3a2('0xa7')]){_0x12f512['include'][_0xd3a2('0xa8')]({'model':db['User'],'as':'User','attributes':['id',_0xd3a2('0x4f'),'alias']});}if(_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x40')]){_0x12f512['include']=[{'all':!![]}];}return db[_0xd3a2('0x7a')][_0xd3a2('0x32')](_0x12f512);})['then'](function(_0x3a62a6){_0x2f9b01[_0xd3a2('0xa9')]=_0x3a62a6;return _0x2f9b01;});}})[_0xd3a2('0x14')](respondWithFilteredResult(_0x48dc64,_0x12f512))['catch'](handleError(_0x48dc64,null));};exports[_0xd3a2('0xaa')]=function(_0x37f23d,_0x3638dc){return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x37f23d[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x3638dc,null))[_0xd3a2('0x14')](function(_0x50e43c){if(_0x50e43c){return _0x50e43c['setTags'](_0x37f23d[_0xd3a2('0x45')][_0xd3a2('0x98')],_[_0xd3a2('0x99')](_0x37f23d[_0xd3a2('0x45')],[_0xd3a2('0x98'),'id'])||{})[_0xd3a2('0xab')](function(){return db[_0xd3a2('0xac')][_0xd3a2('0x32')]({'attributes':['id',_0xd3a2('0x28'),_0xd3a2('0xad')],'where':{'id':_0x37f23d[_0xd3a2('0x45')][_0xd3a2('0x98')]}});})[_0xd3a2('0x14')](function(_0x1e9b25){socket[_0xd3a2('0xae')]('chatInteractionTags:save',{'id':Number(_0x37f23d['params']['id']),'tags':_0x1e9b25||[]});return{'id':Number(_0x37f23d['params']['id']),'tags':_0x1e9b25||[]};});}})[_0xd3a2('0x14')](respondWithResult(_0x3638dc,null))[_0xd3a2('0x36')](handleError(_0x3638dc,null));};exports[_0xd3a2('0xaf')]=function(_0x1569a3,_0x1b2995){return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x1569a3[_0xd3a2('0x37')]['id']}})['then'](handleEntityNotFound(_0x1b2995,null))[_0xd3a2('0x14')](function(_0x26db4b){if(_0x26db4b){return _0x26db4b['removeTags'](_0x1569a3[_0xd3a2('0x34')][_0xd3a2('0x98')]);}})[_0xd3a2('0x14')](respondWithStatusCode(_0x1b2995,null))[_0xd3a2('0x36')](handleError(_0x1b2995,null));};exports[_0xd3a2('0x72')]=function(_0x5e9266,_0x1cb4ae){var _0x1a8cfd=moment()[_0xd3a2('0xb0')]()[_0xd3a2('0xb1')]();var _0x130e6a=path['join'](config[_0xd3a2('0x70')],'server',_0xd3a2('0xb2'),'tmp');var _0xe25068=path['join'](config[_0xd3a2('0x70')],_0xd3a2('0xb3'),'files',_0xd3a2('0xb4'));var _0xd7612e=path[_0xd3a2('0x6f')](_0x130e6a,_0x1a8cfd);var _0x7a7737=util[_0xd3a2('0x76')](_0xd3a2('0xb5'),_0x5e9266[_0xd3a2('0x37')]['id'],_0x1a8cfd);var _0x8cb96f=path['join'](_0x130e6a,_0x7a7737);var _0x2562a0=[];_0x2562a0['push']({'model':db[_0xd3a2('0x7b')],'as':_0xd3a2('0x7b'),'attributes':['id',_0xd3a2('0x4f')],'raw':!![]});_0x2562a0[_0xd3a2('0xa8')]({'model':db[_0xd3a2('0x7d')],'as':_0xd3a2('0x5e'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x5e9266[_0xd3a2('0x34')][_0xd3a2('0xb4')]){_0x2562a0[_0xd3a2('0xa8')]({'model':db[_0xd3a2('0x6c')],'as':_0xd3a2('0x6c'),'raw':!![]});}var _0x27b020=[{'model':db[_0xd3a2('0x7a')],'as':_0xd3a2('0x7f'),'attributes':['id',_0xd3a2('0x45'),_0xd3a2('0xb6'),_0xd3a2('0x8e'),_0xd3a2('0xb7'),_0xd3a2('0xb8')],'include':_0x2562a0}];_0x27b020['push']({'model':db[_0xd3a2('0x4b')],'as':_0xd3a2('0xb9'),'attributes':['id','name']});_0x27b020[_0xd3a2('0xa8')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd3a2('0x4f')]});return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x5e9266[_0xd3a2('0x37')]['id']},'include':_0x27b020})[_0xd3a2('0x14')](handleEntityNotFound(_0x1cb4ae,null))[_0xd3a2('0x14')](function(_0x263f61){if(_0x263f61){var _0x178605=_0x263f61[_0xd3a2('0xba')]({'plain':!![]});fs[_0xd3a2('0xbb')](_0xd7612e);var _0x3d687b={'channel':_0xd3a2('0xbc'),'account':_0x178605['Account']['name'],'agent':_0x178605['Owner']?_0x178605[_0xd3a2('0xbd')][_0xd3a2('0x4f')]:_0xd3a2('0xbe'),'createdAt':moment(_0x178605[_0xd3a2('0xb6')])[_0xd3a2('0x76')](_0xd3a2('0xa5'))[_0xd3a2('0xb1')](),'closedAt':_0x178605[_0xd3a2('0x62')]?moment(_0x178605[_0xd3a2('0xbf')])['format'](_0xd3a2('0xa5'))['toString']():'','disposition':_0x178605[_0xd3a2('0xc0')],'chatInfo':{'browser':_0x178605['browserName'],'os':_0x178605[_0xd3a2('0xc1')],'referer':_0x178605['referer'],'customerIp':_0x178605[_0xd3a2('0xc2')],'customerPort':_0x178605[_0xd3a2('0xc3')]?_0x178605[_0xd3a2('0xc3')]:_0xd3a2('0xbe')},'messages':_(_0x178605[_0xd3a2('0x7f')])[_0xd3a2('0xc4')]()[_0xd3a2('0xa2')]({'secret':![]})[_0xd3a2('0x2f')](function(_0x22a116){if(_0x22a116[_0xd3a2('0x6c')]){var _0x4d0dad=path[_0xd3a2('0x6f')](_0xe25068,_0x22a116['Attachment']['basename']);if(fs[_0xd3a2('0xc5')](_0x4d0dad)){fs[_0xd3a2('0xc6')](_0x4d0dad)['pipe'](fs['createWriteStream'](path[_0xd3a2('0x6f')](_0xd7612e,_0x22a116['Attachment'][_0xd3a2('0x66')])));}}return{'date':moment(_0x22a116['createdAt'])[_0xd3a2('0x76')](_0xd3a2('0xa5'))[_0xd3a2('0xb1')](),'sender':_0x22a116[_0xd3a2('0x8e')]==='out'?_0x22a116['User']?_0x22a116[_0xd3a2('0x7b')]['fullname']:_0xd3a2('0x83'):_0x22a116[_0xd3a2('0x5e')][_0xd3a2('0xc7')]+(_0x22a116[_0xd3a2('0x5e')]['lastName']?'\x20'+_0x22a116['Contact'][_0xd3a2('0xc8')]:''),'body':_0x22a116[_0xd3a2('0x6c')]?_0x22a116[_0xd3a2('0x6c')][_0xd3a2('0x66')]:_0x22a116['body'],'direction':_0x22a116[_0xd3a2('0x8e')]===_0xd3a2('0xc9')?'A':'C','secret':_0x22a116[_0xd3a2('0xb7')],'read':_0x22a116[_0xd3a2('0xb8')],'attachment':_0x22a116[_0xd3a2('0x6c')]};})[_0xd3a2('0xca')]()};return ejs[_0xd3a2('0xcb')](path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],_0xd3a2('0xb3'),_0xd3a2('0xcc'),_0xd3a2('0xcd')),{'interaction':_0x3d687b})[_0xd3a2('0x14')](function(_0xdac1d3){var _0xbde4a8=path['join'](_0xd7612e,_0xd3a2('0xce')+_0x178605['id']+'-'+_0x1a8cfd+_0xd3a2('0xcf'));var _0x150d07={'path':_0xbde4a8,'channel':'Chat','interactionId':_0x178605['id']};return pdf[_0xd3a2('0xd0')](_0xdac1d3,_0x150d07);})['then'](function(){return new Promise(function(_0x59ed47,_0x5b4076){zipdir(_0xd7612e,{'saveTo':_0x8cb96f},function(_0x13283a,_0x4b9e70){if(_0x13283a)return _0x5b4076(_0x13283a);return _0x59ed47(_0x4b9e70);});})[_0xd3a2('0x14')](function(){return new BPromise(function(_0x3d8176,_0x4141d3){rimraf(_0xd7612e,function(_0x3c1df5){if(_0x3c1df5)_0x4141d3(_0x3c1df5);return _0x3d8176();});});})[_0xd3a2('0x14')](function(){return _0x1cb4ae[_0xd3a2('0x72')](_0x8cb96f,_0x7a7737,function(_0x3c84d9){if(_0x3c84d9){logger['error'](_0xd3a2('0xd1'),_0x3c84d9);}else{fs['unlinkSync'](_0x8cb96f);}});});});}else{return _0x1cb4ae[_0xd3a2('0x1d')](0xc8);}})['catch'](handleError(_0x1cb4ae,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 3d06a73..2235edd 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 _0xe892=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe892,0x156));var _0x2e89=function(_0x43e535,_0x1c107c){_0x43e535=_0x43e535-0x0;var _0x5c9d70=_0xe892[_0x43e535];return _0x5c9d70;};'use strict';var EventEmitter=require(_0x2e89('0x0'));var ChatInteraction=require(_0x2e89('0x1'))['db'][_0x2e89('0x2')];var ChatMessage=require(_0x2e89('0x1'))['db'][_0x2e89('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2e89('0x4')](0x0);var events={'afterCreate':_0x2e89('0x5'),'afterUpdate':_0x2e89('0x6'),'afterDestroy':_0x2e89('0x7')};function emitEvent(_0xf884e8){return function(_0x20daef,_0x1f1c9d,_0x3edacd){_0x20daef['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4fef40){_0x20daef['setDataValue'](_0x2e89('0x8'),_0x4fef40[_0x2e89('0x9')](function(_0x154649){return{'id':_0x154649['id']};}));return ChatMessage[_0x2e89('0xa')]({'where':{'ChatInteractionId':_0x20daef['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e89('0xb')](function(_0x4ab55c){_0x20daef[_0x2e89('0xc')](_0x2e89('0xd'),_0x4ab55c['length']);ChatInteractionEvents[_0x2e89('0xe')](_0xf884e8+':'+_0x20daef['id'],_0x20daef);ChatInteractionEvents[_0x2e89('0xe')](_0xf884e8,_0x20daef);_0x3edacd(null);})[_0x2e89('0xf')](_0x3edacd(null));};}for(var e in events){if(events[_0x2e89('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x2e89('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xa273=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0xf49f22,_0x6ee4cf){var _0x3b7136=function(_0x3b0b22){while(--_0x3b0b22){_0xf49f22['push'](_0xf49f22['shift']());}};_0x3b7136(++_0x6ee4cf);}(_0xa273,0x1e7));var _0x3a27=function(_0x3cb704,_0x24fbb4){_0x3cb704=_0x3cb704-0x0;var _0x216b57=_0xa273[_0x3cb704];return _0x216b57;};'use strict';var EventEmitter=require(_0x3a27('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x3a27('0x1'))['db'][_0x3a27('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3a27('0x3')](0x0);var events={'afterCreate':_0x3a27('0x4'),'afterUpdate':'update','afterDestroy':_0x3a27('0x5')};function emitEvent(_0xee8c89){return function(_0x2759b0,_0x2e547b,_0x291555){_0x2759b0[_0x3a27('0x6')]({'attributes':['id'],'raw':!![]})[_0x3a27('0x7')](function(_0x230534){_0x2759b0['setDataValue'](_0x3a27('0x8'),_0x230534[_0x3a27('0x9')](function(_0x2ff5ba){return{'id':_0x2ff5ba['id']};}));return ChatMessage[_0x3a27('0xa')]({'where':{'ChatInteractionId':_0x2759b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3a27('0x7')](function(_0x49e23e){_0x2759b0[_0x3a27('0xb')](_0x3a27('0xc'),_0x49e23e[_0x3a27('0xd')]);ChatInteractionEvents[_0x3a27('0xe')](_0xee8c89+':'+_0x2759b0['id'],_0x2759b0);ChatInteractionEvents[_0x3a27('0xe')](_0xee8c89,_0x2759b0);_0x291555(null);})[_0x3a27('0xf')](_0x291555(null));};}for(var e in events){if(events[_0x3a27('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 07e30e8..96ccdbb 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 _0x6104=['request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x40c9fd,_0x44691d){var _0x78f1c2=function(_0x3db1c1){while(--_0x3db1c1){_0x40c9fd['push'](_0x40c9fd['shift']());}};_0x78f1c2(++_0x44691d);}(_0x6104,0x187));var _0x4610=function(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0x6104[_0x3a7fe5];return _0x18ed66;};'use strict';var _=require('lodash');var util=require(_0x4610('0x0'));var logger=require(_0x4610('0x1'))(_0x4610('0x2'));var moment=require(_0x4610('0x3'));var BPromise=require(_0x4610('0x4'));var rp=require(_0x4610('0x5'));var fs=require('fs');var path=require(_0x4610('0x6'));var rimraf=require('rimraf');var config=require(_0x4610('0x7'));var attributes=require(_0x4610('0x8'));module[_0x4610('0x9')]=function(_0x2a7ec3,_0x4afb65){return _0x2a7ec3['define'](_0x4610('0xa'),attributes,{'tableName':_0x4610('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x427470,_0x153c28,_0x4af7f4){if(_0x427470[_0x4610('0xc')](_0x4610('0xd'))){_0x427470['closedAt']=moment()[_0x4610('0xe')](_0x4610('0xf'));}_0x4af7f4(null,_0x427470);}},'charset':_0x4610('0x10'),'collate':_0x4610('0x11')});}; \ No newline at end of file +var _0x5934=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger'];(function(_0x476402,_0x1afd41){var _0x2b088f=function(_0x2e975a){while(--_0x2e975a){_0x476402['push'](_0x476402['shift']());}};_0x2b088f(++_0x1afd41);}(_0x5934,0x1ec));var _0x4593=function(_0x2b3040,_0x371507){_0x2b3040=_0x2b3040-0x0;var _0x415fed=_0x5934[_0x2b3040];return _0x415fed;};'use strict';var _=require('lodash');var util=require(_0x4593('0x0'));var logger=require(_0x4593('0x1'))(_0x4593('0x2'));var moment=require(_0x4593('0x3'));var BPromise=require(_0x4593('0x4'));var rp=require(_0x4593('0x5'));var fs=require('fs');var path=require(_0x4593('0x6'));var rimraf=require(_0x4593('0x7'));var config=require(_0x4593('0x8'));var attributes=require(_0x4593('0x9'));module[_0x4593('0xa')]=function(_0x973ee1,_0xe1fb6b){return _0x973ee1[_0x4593('0xb')](_0x4593('0xc'),attributes,{'tableName':_0x4593('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31ed94,_0xb17c74,_0x1f9161){if(_0x31ed94['changed'](_0x4593('0xe'))){_0x31ed94[_0x4593('0xf')]=moment()[_0x4593('0x10')](_0x4593('0x11'));}_0x1f9161(null,_0x31ed94);}},'charset':_0x4593('0x12'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b3c474b..53e1a3d 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 _0x1dea=['AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','options','raw','where','limit','catch','find','addTags','body','omit','ids','spread'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x1dea,0x1af));var _0xa1de=function(_0x4d1a25,_0x249ede){_0x4d1a25=_0x4d1a25-0x0;var _0x5392b6=_0x1dea[_0x4d1a25];return _0x5392b6;};'use strict';var _=require(_0xa1de('0x0'));var util=require(_0xa1de('0x1'));var moment=require(_0xa1de('0x2'));var BPromise=require(_0xa1de('0x3'));var rs=require(_0xa1de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1de('0x5'))['db'];var utils=require(_0xa1de('0x6'));var logger=require(_0xa1de('0x7'))(_0xa1de('0x8'));var config=require('../../config/environment');var jayson=require(_0xa1de('0x9'));var client=jayson[_0xa1de('0xa')][_0xa1de('0xb')]({'port':0x232a});config[_0xa1de('0xc')]=_[_0xa1de('0xd')](config[_0xa1de('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1de('0xe'))(new Redis(config['redis']));require(_0xa1de('0xf'))[_0xa1de('0x10')](socket);function respondWithRpcPromise(_0x526155,_0x15012,_0x200d2b){return new BPromise(function(_0x278edc,_0x2840d2){return client[_0xa1de('0x11')](_0x526155,_0x200d2b)[_0xa1de('0x12')](function(_0x5e1013){logger[_0xa1de('0x13')](_0xa1de('0x14'),_0x15012,_0xa1de('0x15'));logger[_0xa1de('0x16')](_0xa1de('0x17'),_0x15012,_0xa1de('0x15'),JSON[_0xa1de('0x18')](_0x5e1013));if(_0x5e1013[_0xa1de('0x19')]){if(_0x5e1013[_0xa1de('0x19')][_0xa1de('0x1a')]===0x1f4){logger[_0xa1de('0x19')](_0xa1de('0x14'),_0x15012,_0x5e1013['error'][_0xa1de('0x1b')]);return _0x2840d2(_0x5e1013['error'][_0xa1de('0x1b')]);}logger[_0xa1de('0x19')](_0xa1de('0x14'),_0x15012,_0x5e1013[_0xa1de('0x19')][_0xa1de('0x1b')]);return _0x278edc(_0x5e1013['error'][_0xa1de('0x1b')]);}else{logger[_0xa1de('0x13')](_0xa1de('0x14'),_0x15012,'request\x20sent');_0x278edc(_0x5e1013[_0xa1de('0x1c')][_0xa1de('0x1b')]);}})['catch'](function(_0x3b0b13){logger[_0xa1de('0x19')](_0xa1de('0x14'),_0x15012,_0x3b0b13);_0x2840d2(_0x3b0b13);});});}exports[_0xa1de('0x1d')]=function(_0x32c0ce){var _0x17f400=this;return new Promise(function(_0x331eb7,_0x10c463){return db[_0xa1de('0x1e')]['update'](_0x32c0ce['body'],{'raw':_0x32c0ce[_0xa1de('0x1f')]?_0x32c0ce[_0xa1de('0x1f')][_0xa1de('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32c0ce[_0xa1de('0x1f')]?_0x32c0ce['options'][_0xa1de('0x21')]||null:null,'attributes':_0x32c0ce[_0xa1de('0x1f')]?_0x32c0ce['options']['attributes']||null:null,'limit':_0x32c0ce[_0xa1de('0x1f')]?_0x32c0ce['options'][_0xa1de('0x22')]||null:null})['then'](function(_0x5ba097){logger[_0xa1de('0x13')](_0xa1de('0x1d'),_0x32c0ce);logger[_0xa1de('0x16')](_0xa1de('0x1d'),_0x32c0ce,JSON[_0xa1de('0x18')](_0x5ba097));_0x331eb7(_0x5ba097);})[_0xa1de('0x23')](function(_0x1e3d70){logger[_0xa1de('0x19')]('UpdateChatInteraction',_0x1e3d70[_0xa1de('0x1b')],_0x32c0ce);_0x10c463(_0x17f400[_0xa1de('0x19')](0x1f4,_0x1e3d70[_0xa1de('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x489668){return new Promise(function(_0x39b1f7,_0x51d972){return db['ChatInteraction'][_0xa1de('0x24')]({'where':_0x489668[_0xa1de('0x1f')]?_0x489668[_0xa1de('0x1f')][_0xa1de('0x21')]||null:null})['then'](function(_0x415018){if(_0x415018){return _0x415018[_0xa1de('0x25')](_0x489668[_0xa1de('0x26')]['ids'],_[_0xa1de('0x27')](_0x489668[_0xa1de('0x26')],[_0xa1de('0x28'),'id'])||{});}})[_0xa1de('0x29')](function(_0x7e47f7){logger[_0xa1de('0x13')](_0xa1de('0x2a'),_0x489668);logger[_0xa1de('0x16')](_0xa1de('0x2a'),_0x489668,JSON[_0xa1de('0x18')](_0x7e47f7));_0x39b1f7(_0x7e47f7);})[_0xa1de('0x23')](function(_0x478d12){logger['error'](_0xa1de('0x2a'),_0x478d12[_0xa1de('0x1b')],_0x489668);_0x51d972(_this['error'](0x1f4,_0x478d12[_0xa1de('0x1b')]));});});}; \ No newline at end of file +var _0x41be=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','body','options','where','attributes','then','UpdateChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags'];(function(_0x41bb2d,_0x534f1f){var _0x23b677=function(_0x4f53de){while(--_0x4f53de){_0x41bb2d['push'](_0x41bb2d['shift']());}};_0x23b677(++_0x534f1f);}(_0x41be,0x186));var _0xe41b=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x41be[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0xe41b('0x0'));var util=require(_0xe41b('0x1'));var moment=require(_0xe41b('0x2'));var BPromise=require(_0xe41b('0x3'));var rs=require(_0xe41b('0x4'));var fs=require('fs');var Redis=require(_0xe41b('0x5'));var db=require(_0xe41b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe41b('0x7'));var jayson=require(_0xe41b('0x8'));var client=jayson[_0xe41b('0x9')][_0xe41b('0xa')]({'port':0x232a});config[_0xe41b('0xb')]=_[_0xe41b('0xc')](config['redis'],{'host':_0xe41b('0xd'),'port':0x18eb});var socket=require(_0xe41b('0xe'))(new Redis(config['redis']));require(_0xe41b('0xf'))[_0xe41b('0x10')](socket);function respondWithRpcPromise(_0x455088,_0x404832,_0x2ae5e1){return new BPromise(function(_0x380cfa,_0x4c5132){return client['request'](_0x455088,_0x2ae5e1)['then'](function(_0x367cd1){logger[_0xe41b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x404832,'request\x20sent');logger[_0xe41b('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x404832,_0xe41b('0x13'),JSON[_0xe41b('0x14')](_0x367cd1));if(_0x367cd1[_0xe41b('0x15')]){if(_0x367cd1[_0xe41b('0x15')][_0xe41b('0x16')]===0x1f4){logger[_0xe41b('0x15')](_0xe41b('0x17'),_0x404832,_0x367cd1[_0xe41b('0x15')][_0xe41b('0x18')]);return _0x4c5132(_0x367cd1['error'][_0xe41b('0x18')]);}logger['error'](_0xe41b('0x17'),_0x404832,_0x367cd1['error'][_0xe41b('0x18')]);return _0x380cfa(_0x367cd1[_0xe41b('0x15')][_0xe41b('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x404832,_0xe41b('0x13'));_0x380cfa(_0x367cd1[_0xe41b('0x19')][_0xe41b('0x18')]);}})[_0xe41b('0x1a')](function(_0x488efa){logger['error'](_0xe41b('0x17'),_0x404832,_0x488efa);_0x4c5132(_0x488efa);});});}exports['UpdateChatInteraction']=function(_0x36f7fc){var _0x5103ac=this;return new Promise(function(_0x24dfc1,_0x27c967){return db['ChatInteraction']['update'](_0x36f7fc[_0xe41b('0x1b')],{'raw':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f7fc['options']?_0x36f7fc[_0xe41b('0x1c')][_0xe41b('0x1d')]||null:null,'attributes':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')][_0xe41b('0x1e')]||null:null,'limit':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')]['limit']||null:null})[_0xe41b('0x1f')](function(_0x299444){logger[_0xe41b('0x11')](_0xe41b('0x20'),_0x36f7fc);logger[_0xe41b('0x12')](_0xe41b('0x20'),_0x36f7fc,JSON[_0xe41b('0x14')](_0x299444));_0x24dfc1(_0x299444);})[_0xe41b('0x1a')](function(_0x455379){logger[_0xe41b('0x15')](_0xe41b('0x20'),_0x455379[_0xe41b('0x18')],_0x36f7fc);_0x27c967(_0x5103ac['error'](0x1f4,_0x455379[_0xe41b('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x1861f6){return new Promise(function(_0x379d7e,_0x36ac72){return db[_0xe41b('0x21')][_0xe41b('0x22')]({'where':_0x1861f6[_0xe41b('0x1c')]?_0x1861f6[_0xe41b('0x1c')][_0xe41b('0x1d')]||null:null})[_0xe41b('0x1f')](function(_0x495b6e){if(_0x495b6e){return _0x495b6e[_0xe41b('0x23')](_0x1861f6[_0xe41b('0x1b')][_0xe41b('0x24')],_['omit'](_0x1861f6[_0xe41b('0x1b')],[_0xe41b('0x24'),'id'])||{});}})[_0xe41b('0x25')](function(_0x2a5cc2){logger[_0xe41b('0x11')](_0xe41b('0x26'),_0x1861f6);logger[_0xe41b('0x12')](_0xe41b('0x26'),_0x1861f6,JSON[_0xe41b('0x14')](_0x2a5cc2));_0x379d7e(_0x2a5cc2);})[_0xe41b('0x1a')](function(_0x5e823d){logger['error'](_0xe41b('0x26'),_0x5e823d[_0xe41b('0x18')],_0x1861f6);_0x36ac72(_this[_0xe41b('0x15')](0x1f4,_0x5e823d[_0xe41b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 01b6279..0d3871b 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 _0x5607=['emit','register','length','save','remove'];(function(_0x2552e2,_0x4fb60a){var _0x27922b=function(_0x3ff1cb){while(--_0x3ff1cb){_0x2552e2['push'](_0x2552e2['shift']());}};_0x27922b(++_0x4fb60a);}(_0x5607,0x8f));var _0x7560=function(_0x1c8899,_0xe398a8){_0x1c8899=_0x1c8899-0x0;var _0x233970=_0x5607[_0x1c8899];return _0x233970;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x7560('0x0'),_0x7560('0x1'),'update'];function createListener(_0x5f0238,_0xd36cb6){return function(_0x5b0ecd){_0xd36cb6[_0x7560('0x2')](_0x5f0238,_0x5b0ecd);};}function removeListener(_0x45281e,_0x20e360){return function(){ChatInteractionEvents['removeListener'](_0x45281e,_0x20e360);};}exports[_0x7560('0x3')]=function(_0x38894a){for(var _0x585c86=0x0,_0x5d7aa7=events[_0x7560('0x4')];_0x585c86<_0x5d7aa7;_0x585c86++){var _0x56b9aa=events[_0x585c86];var _0x420f29=createListener('chatInteraction:'+_0x56b9aa,_0x38894a);ChatInteractionEvents['on'](_0x56b9aa,_0x420f29);}}; \ No newline at end of file +var _0x8b91=['emit','removeListener','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x5e20f6,_0x427b74){var _0x4e96d3=function(_0x1a7d3d){while(--_0x1a7d3d){_0x5e20f6['push'](_0x5e20f6['shift']());}};_0x4e96d3(++_0x427b74);}(_0x8b91,0x17e));var _0x18b9=function(_0x1c0abe,_0x28a701){_0x1c0abe=_0x1c0abe-0x0;var _0x24d9bf=_0x8b91[_0x1c0abe];return _0x24d9bf;};'use strict';var ChatInteractionEvents=require(_0x18b9('0x0'));var events=[_0x18b9('0x1'),_0x18b9('0x2'),'update'];function createListener(_0x194721,_0x3fb7d4){return function(_0xfeb4d3){_0x3fb7d4[_0x18b9('0x3')](_0x194721,_0xfeb4d3);};}function removeListener(_0xa87b43,_0x4071e3){return function(){ChatInteractionEvents[_0x18b9('0x4')](_0xa87b43,_0x4071e3);};}exports[_0x18b9('0x5')]=function(_0x10aa74){for(var _0x1c4e97=0x0,_0x4990c5=events['length'];_0x1c4e97<_0x4990c5;_0x1c4e97++){var _0x1839cf=events[_0x1c4e97];var _0x45dfcd=createListener(_0x18b9('0x6')+_0x1839cf,_0x10aa74);ChatInteractionEvents['on'](_0x1839cf,_0x45dfcd);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 3861df1..4405cd2 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 _0xd836=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util'];(function(_0x164975,_0x319b59){var _0xe1fa91=function(_0x21b7e0){while(--_0x21b7e0){_0x164975['push'](_0x164975['shift']());}};_0xe1fa91(++_0x319b59);}(_0xd836,0x68));var _0x6d83=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd836[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6d83('0x0'));var util=require(_0x6d83('0x1'));var path=require(_0x6d83('0x2'));var timeout=require(_0x6d83('0x3'));var express=require(_0x6d83('0x4'));var router=express[_0x6d83('0x5')]();var fs_extra=require(_0x6d83('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6d83('0x7'));var config=require(_0x6d83('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x6d83('0x9')](),controller['index']);router[_0x6d83('0xa')](_0x6d83('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6d83('0xa')](_0x6d83('0xc'),auth[_0x6d83('0xd')](),controller['show']);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x6d83('0xe')]);router[_0x6d83('0xa')](_0x6d83('0xf'),auth[_0x6d83('0x9')](),controller[_0x6d83('0x10')]);router[_0x6d83('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x6d83('0x11')]);router[_0x6d83('0xa')](_0x6d83('0x12'),auth[_0x6d83('0x9')](),controller[_0x6d83('0x13')]);router[_0x6d83('0x14')]('/',auth[_0x6d83('0x9')](),controller[_0x6d83('0x15')]);router['post'](_0x6d83('0x16'),auth[_0x6d83('0x9')](),controller[_0x6d83('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b6746,_0x51a433,_0x445ce6){_0x445ce6(null,path[_0x6d83('0x18')](config[_0x6d83('0x19')],_0x6d83('0x1a')));},'filename':function(_0x305b98,_0x16171f,_0x4d62cc){_0x4d62cc(null,util[_0x6d83('0x1b')]('%s-%s',Date[_0x6d83('0x1c')](),_0x16171f[_0x6d83('0x1d')][_0x6d83('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6d83('0x14')](_0x6d83('0x1f'),upload[_0x6d83('0x20')]('file'),controller[_0x6d83('0x21')]);router[_0x6d83('0x14')](_0x6d83('0xf'),auth[_0x6d83('0xd')](),controller[_0x6d83('0x22')]);router[_0x6d83('0x14')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x6d83('0x23')](_0x6d83('0x24'),_0x6d83('0x25')),controller[_0x6d83('0x26')]);router[_0x6d83('0x27')](_0x6d83('0xc'),auth[_0x6d83('0x9')](),interaction[_0x6d83('0x23')](_0x6d83('0x24'),_0x6d83('0x28')),controller[_0x6d83('0x29')]);router[_0x6d83('0x27')](_0x6d83('0x2a'),controller['customUpdate']);router[_0x6d83('0x27')](_0x6d83('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x6d83('0x2c')]);router[_0x6d83('0x27')](_0x6d83('0x2d'),controller[_0x6d83('0x2e')]);router[_0x6d83('0x2f')]('/:id',auth[_0x6d83('0x9')](),interaction[_0x6d83('0x23')](_0x6d83('0x24'),_0x6d83('0x30')),controller[_0x6d83('0x31')]);router[_0x6d83('0x2f')](_0x6d83('0x32'),auth[_0x6d83('0x9')](),controller[_0x6d83('0x33')]);module[_0x6d83('0x34')]=router; \ No newline at end of file +var _0xc3f2=['originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','chatinteraction:destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now'];(function(_0x449cee,_0x3d88b0){var _0x58de0a=function(_0x3636a6){while(--_0x3636a6){_0x449cee['push'](_0x449cee['shift']());}};_0x58de0a(++_0x3d88b0);}(_0xc3f2,0x144));var _0x2c3f=function(_0x5c9c01,_0x2d2fc5){_0x5c9c01=_0x5c9c01-0x0;var _0xee7501=_0xc3f2[_0x5c9c01];return _0xee7501;};'use strict';var multer=require(_0x2c3f('0x0'));var util=require('util');var path=require(_0x2c3f('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c3f('0x2'));var router=express[_0x2c3f('0x3')]();var fs_extra=require(_0x2c3f('0x4'));var auth=require(_0x2c3f('0x5'));var interaction=require(_0x2c3f('0x6'));var config=require(_0x2c3f('0x7'));var controller=require(_0x2c3f('0x8'));router[_0x2c3f('0x9')]('/',auth[_0x2c3f('0xa')](),controller[_0x2c3f('0xb')]);router['get']('/describe',auth[_0x2c3f('0xa')](),controller[_0x2c3f('0xc')]);router[_0x2c3f('0x9')](_0x2c3f('0xd'),auth[_0x2c3f('0xe')](),controller[_0x2c3f('0xf')]);router[_0x2c3f('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x2c3f('0x10')]);router[_0x2c3f('0x9')](_0x2c3f('0x11'),auth[_0x2c3f('0xa')](),controller[_0x2c3f('0x12')]);router['get'](_0x2c3f('0x13'),auth[_0x2c3f('0xe')](),controller[_0x2c3f('0x14')]);router[_0x2c3f('0x9')](_0x2c3f('0x15'),auth['isAuthenticated'](),controller[_0x2c3f('0x16')]);router[_0x2c3f('0x17')]('/',auth['isAuthenticated'](),controller[_0x2c3f('0x18')]);router[_0x2c3f('0x17')](_0x2c3f('0x19'),auth[_0x2c3f('0xa')](),controller[_0x2c3f('0x1a')]);var upload=multer({'storage':multer[_0x2c3f('0x1b')]({'destination':function(_0x146ec6,_0x432c19,_0x1c0025){_0x1c0025(null,path[_0x2c3f('0x1c')](config[_0x2c3f('0x1d')],_0x2c3f('0x1e')));},'filename':function(_0x1c8124,_0x3a0770,_0x1c25ea){_0x1c25ea(null,util['format'](_0x2c3f('0x1f'),Date[_0x2c3f('0x20')](),_0x3a0770[_0x2c3f('0x21')][_0x2c3f('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c3f('0x17')](_0x2c3f('0x23'),upload[_0x2c3f('0x24')](_0x2c3f('0x25')),controller[_0x2c3f('0x26')]);router['post']('/:id/messages',auth[_0x2c3f('0xe')](),controller[_0x2c3f('0x27')]);router['post'](_0x2c3f('0x28'),auth['isAuthenticated'](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),'chatinteraction:addtags'),controller[_0x2c3f('0x2b')]);router[_0x2c3f('0x2c')](_0x2c3f('0xd'),auth[_0x2c3f('0xa')](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),_0x2c3f('0x2d')),controller[_0x2c3f('0x2e')]);router['put'](_0x2c3f('0x2f'),controller['customUpdate']);router[_0x2c3f('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x2c3f('0x2c')](_0x2c3f('0x30'),controller[_0x2c3f('0x31')]);router['delete']('/:id',auth[_0x2c3f('0xa')](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),_0x2c3f('0x32')),controller['destroy']);router['delete'](_0x2c3f('0x28'),auth[_0x2c3f('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index be2ba54..c205d55 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 _0xd27d=['TEXT','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x4be16e,_0x362131){var _0x31dc5e=function(_0x2f6ec9){while(--_0x2f6ec9){_0x4be16e['push'](_0x4be16e['shift']());}};_0x31dc5e(++_0x362131);}(_0xd27d,0x170));var _0xdd27=function(_0x1178a1,_0x1b9ac8){_0x1178a1=_0x1178a1-0x0;var _0x4f6545=_0xd27d[_0x1178a1];return _0x4f6545;};'use strict';var Sequelize=require(_0xdd27('0x0'));module[_0xdd27('0x1')]={'body':{'type':Sequelize[_0xdd27('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdd27('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdd27('0x4')]}}; \ No newline at end of file +var _0x8ff2=['sequelize','exports','TEXT','medium'];(function(_0x45ad2b,_0x50d0b9){var _0x289a91=function(_0x2daa30){while(--_0x2daa30){_0x45ad2b['push'](_0x45ad2b['shift']());}};_0x289a91(++_0x50d0b9);}(_0x8ff2,0x190));var _0x28ff=function(_0x5a699d,_0x3327e7){_0x5a699d=_0x5a699d-0x0;var _0x2101f9=_0x8ff2[_0x5a699d];return _0x2101f9;};'use strict';var Sequelize=require(_0x28ff('0x0'));module[_0x28ff('0x1')]={'body':{'type':Sequelize[_0x28ff('0x2')](_0x28ff('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index db5af41..22978ec 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 _0x84cf=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','merge','VIRTUAL','filter','findAll','catch','show','params','includeAll','include','options','find','create','body','update','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Agents','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x84cf,0x133));var _0xf84c=function(_0x5d2a7d,_0x1ca06c){_0x5d2a7d=_0x5d2a7d-0x0;var _0x14e58b=_0x84cf[_0x5d2a7d];return _0x14e58b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf84c('0x0'));var jsonpatch=require(_0xf84c('0x1'));var rp=require(_0xf84c('0x2'));var moment=require(_0xf84c('0x3'));var BPromise=require(_0xf84c('0x4'));var Mustache=require(_0xf84c('0x5'));var util=require(_0xf84c('0x6'));var path=require(_0xf84c('0x7'));var sox=require(_0xf84c('0x8'));var csv=require(_0xf84c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf84c('0xa'));var _=require(_0xf84c('0xb'));var squel=require(_0xf84c('0xc'));var crypto=require(_0xf84c('0xd'));var jsforce=require(_0xf84c('0xe'));var deskjs=require(_0xf84c('0xf'));var toCsv=require(_0xf84c('0x9'));var querystring=require('querystring');var Papa=require(_0xf84c('0x10'));var Redis=require(_0xf84c('0x11'));var authService=require(_0xf84c('0x12'));var qs=require(_0xf84c('0x13'));var as=require(_0xf84c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf84c('0x15'))(_0xf84c('0x16'));var utils=require(_0xf84c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf84c('0x18'));var db=require('../../mysqldb')['db'];config[_0xf84c('0x19')]=_[_0xf84c('0x1a')](config['redis'],{'host':_0xf84c('0x1b'),'port':0x18eb});var socket=require(_0xf84c('0x1c'))(new Redis(config[_0xf84c('0x19')]));require('./chatInternalMessage.socket')[_0xf84c('0x1d')](socket);function respondWithStatusCode(_0x4369a2,_0x267f2a){_0x267f2a=_0x267f2a||0xcc;return function(_0xbbfad8){if(_0xbbfad8){return _0x4369a2[_0xf84c('0x1e')](_0x267f2a);}return _0x4369a2[_0xf84c('0x1f')](_0x267f2a)[_0xf84c('0x20')]();};}function respondWithResult(_0x18d37a,_0x5795ff){_0x5795ff=_0x5795ff||0xc8;return function(_0x5b1024){if(_0x5b1024){return _0x18d37a['status'](_0x5795ff)[_0xf84c('0x21')](_0x5b1024);}};}function respondWithFilteredResult(_0x5d912e,_0x35612d){return function(_0x46c78a){if(_0x46c78a){var _0x5305bc=typeof _0x35612d['offset']===_0xf84c('0x22')&&typeof _0x35612d[_0xf84c('0x23')]==='undefined';var _0x58ce6c=_0x46c78a[_0xf84c('0x24')];var _0xe23f02=_0x5305bc?0x0:_0x35612d[_0xf84c('0x25')];var _0x84f6d3=_0x5305bc?_0x46c78a[_0xf84c('0x24')]:_0x35612d[_0xf84c('0x25')]+_0x35612d[_0xf84c('0x23')];var _0x5e6404;if(_0x84f6d3>=_0x58ce6c){_0x84f6d3=_0x58ce6c;_0x5e6404=0xc8;}else{_0x5e6404=0xce;}_0x5d912e[_0xf84c('0x1f')](_0x5e6404);return _0x5d912e['set'](_0xf84c('0x26'),_0xe23f02+'-'+_0x84f6d3+'/'+_0x58ce6c)[_0xf84c('0x21')](_0x46c78a);}return null;};}function patchUpdates(_0x23eb8d){return function(_0x1ea6de){try{jsonpatch[_0xf84c('0x27')](_0x1ea6de,_0x23eb8d,!![]);}catch(_0x5ee507){return BPromise[_0xf84c('0x28')](_0x5ee507);}return _0x1ea6de[_0xf84c('0x29')]();};}function saveUpdates(_0x45bd99,_0x20dcd5){return function(_0x2dc604){if(_0x2dc604){return _0x2dc604['update'](_0x45bd99)[_0xf84c('0x2a')](function(_0x121e66){return _0x121e66;});}return null;};}function removeEntity(_0x3d23d7,_0x433d2e){return function(_0x1e2b81){if(_0x1e2b81){return _0x1e2b81[_0xf84c('0x2b')]()[_0xf84c('0x2a')](function(){_0x3d23d7[_0xf84c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5f27,_0x5f50ac){return function(_0x2f82ae){if(!_0x2f82ae){_0x5b5f27[_0xf84c('0x1e')](0x194);}return _0x2f82ae;};}function handleError(_0x153260,_0x21b39e){_0x21b39e=_0x21b39e||0x1f4;return function(_0x2f4a82){logger[_0xf84c('0x2c')](_0x2f4a82['stack']);if(_0x2f4a82['name']){delete _0x2f4a82[_0xf84c('0x2d')];}_0x153260[_0xf84c('0x1f')](_0x21b39e)[_0xf84c('0x2e')](_0x2f4a82);};}exports[_0xf84c('0x2f')]=function(_0x1c17d5,_0x4a1aa6){var _0x3d16b2={},_0x1b5e28={},_0x219354={'count':0x0,'rows':[]};var _0xc72665=_[_0xf84c('0x30')](db[_0xf84c('0x31')][_0xf84c('0x32')],function(_0x7bb8f0){return{'name':_0x7bb8f0[_0xf84c('0x33')],'type':_0x7bb8f0[_0xf84c('0x34')][_0xf84c('0x35')]};});_0x1b5e28[_0xf84c('0x36')]=_[_0xf84c('0x30')](_0xc72665,'name');_0x1b5e28[_0xf84c('0x37')]=_[_0xf84c('0x38')](_0x1c17d5['query']);_0x1b5e28[_0xf84c('0x39')]=_[_0xf84c('0x3a')](_0x1b5e28[_0xf84c('0x36')],_0x1b5e28[_0xf84c('0x37')]);_0x3d16b2[_0xf84c('0x3b')]=_[_0xf84c('0x3a')](_0x1b5e28[_0xf84c('0x36')],qs['fields'](_0x1c17d5['query'][_0xf84c('0x3c')]));_0x3d16b2['attributes']=_0x3d16b2['attributes'][_0xf84c('0x3d')]?_0x3d16b2[_0xf84c('0x3b')]:_0x1b5e28[_0xf84c('0x36')];if(!_0x1c17d5['query']['hasOwnProperty']('nolimit')){_0x3d16b2[_0xf84c('0x23')]=qs[_0xf84c('0x23')](_0x1c17d5[_0xf84c('0x37')]['limit']);_0x3d16b2[_0xf84c('0x25')]=qs[_0xf84c('0x25')](_0x1c17d5[_0xf84c('0x37')][_0xf84c('0x25')]);}_0x3d16b2['order']=qs[_0xf84c('0x3e')](_0x1c17d5[_0xf84c('0x37')][_0xf84c('0x3e')]);_0x3d16b2[_0xf84c('0x3f')]=qs[_0xf84c('0x39')](_['pick'](_0x1c17d5[_0xf84c('0x37')],_0x1b5e28[_0xf84c('0x39')]),_0xc72665);if(_0x1c17d5[_0xf84c('0x37')]['filter']){_0x3d16b2[_0xf84c('0x3f')]=_[_0xf84c('0x40')](_0x3d16b2['where'],{'$or':_['map'](_0xc72665,function(_0x535ad3){if(_0x535ad3[_0xf84c('0x34')]!==_0xf84c('0x41')){var _0x4c35e0={};_0x4c35e0[_0x535ad3['name']]={'$like':'%'+_0x1c17d5[_0xf84c('0x37')][_0xf84c('0x42')]+'%'};return _0x4c35e0;}})});}_0x3d16b2=_['merge']({},_0x3d16b2,_0x1c17d5['options']);var _0x52e1db={'where':_0x3d16b2[_0xf84c('0x3f')]};return db[_0xf84c('0x31')]['count'](_0x52e1db)[_0xf84c('0x2a')](function(_0xfb4d8b){_0x219354['count']=_0xfb4d8b;if(_0x1c17d5[_0xf84c('0x37')]['includeAll']){_0x3d16b2['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0xf84c('0x43')](_0x3d16b2);})[_0xf84c('0x2a')](function(_0xcd6b8c){_0x219354['rows']=_0xcd6b8c;return _0x219354;})[_0xf84c('0x2a')](respondWithFilteredResult(_0x4a1aa6,_0x3d16b2))[_0xf84c('0x44')](handleError(_0x4a1aa6,null));};exports[_0xf84c('0x45')]=function(_0x24c534,_0x3cd840){var _0xe026c5={'raw':!![],'where':{'id':_0x24c534[_0xf84c('0x46')]['id']}},_0x1d2f89={};_0x1d2f89['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x1d2f89[_0xf84c('0x37')]=_[_0xf84c('0x38')](_0x24c534['query']);_0x1d2f89[_0xf84c('0x39')]=_['intersection'](_0x1d2f89[_0xf84c('0x36')],_0x1d2f89[_0xf84c('0x37')]);_0xe026c5[_0xf84c('0x3b')]=_[_0xf84c('0x3a')](_0x1d2f89[_0xf84c('0x36')],qs['fields'](_0x24c534[_0xf84c('0x37')][_0xf84c('0x3c')]));_0xe026c5[_0xf84c('0x3b')]=_0xe026c5['attributes']['length']?_0xe026c5['attributes']:_0x1d2f89[_0xf84c('0x36')];if(_0x24c534[_0xf84c('0x37')][_0xf84c('0x47')]){_0xe026c5[_0xf84c('0x48')]=[{'all':!![]}];}_0xe026c5=_[_0xf84c('0x40')]({},_0xe026c5,_0x24c534[_0xf84c('0x49')]);return db[_0xf84c('0x31')][_0xf84c('0x4a')](_0xe026c5)[_0xf84c('0x2a')](handleEntityNotFound(_0x3cd840,null))['then'](respondWithResult(_0x3cd840,null))['catch'](handleError(_0x3cd840,null));};exports[_0xf84c('0x4b')]=function(_0x194283,_0x108f87){return db[_0xf84c('0x31')][_0xf84c('0x4b')](_0x194283[_0xf84c('0x4c')],{})[_0xf84c('0x2a')](respondWithResult(_0x108f87,0xc9))['catch'](handleError(_0x108f87,null));};exports[_0xf84c('0x4d')]=function(_0x35630e,_0x2120c0){if(_0x35630e[_0xf84c('0x4c')]['id']){delete _0x35630e[_0xf84c('0x4c')]['id'];}return db[_0xf84c('0x31')]['find']({'where':{'id':_0x35630e[_0xf84c('0x46')]['id']}})[_0xf84c('0x2a')](handleEntityNotFound(_0x2120c0,null))[_0xf84c('0x2a')](saveUpdates(_0x35630e[_0xf84c('0x4c')],null))[_0xf84c('0x2a')](respondWithResult(_0x2120c0,null))[_0xf84c('0x44')](handleError(_0x2120c0,null));};exports[_0xf84c('0x2b')]=function(_0x33ab46,_0x53aba0){return db[_0xf84c('0x31')]['find']({'where':{'id':_0x33ab46[_0xf84c('0x46')]['id']}})[_0xf84c('0x2a')](handleEntityNotFound(_0x53aba0,null))['then'](removeEntity(_0x53aba0,null))[_0xf84c('0x44')](handleError(_0x53aba0,null));};exports['describe']=function(_0x1fe82c,_0xf807d3){return db['ChatInternalMessage'][_0xf84c('0x4e')]()['then'](respondWithResult(_0xf807d3,null))[_0xf84c('0x44')](handleError(_0xf807d3,null));};function wrapUser(_0x3c54a3){return function(_0x911eb8){var _0x59976d=_0x3c54a3[_0xf84c('0x4f')]({'plain':!![]});_0x59976d['messages']=[];if(_0x911eb8){_0x59976d[_0xf84c('0x50')]=_0x911eb8[_0xf84c('0x51')];_0x59976d[_0xf84c('0x52')]=_0x911eb8;}else{_0x59976d['lastMessageAt']=moment(0x0)[_0xf84c('0x53')](_0xf84c('0x54'));_0x59976d[_0xf84c('0x52')]={};}return _0x59976d;};}exports['getUsers']=function(_0x1eb3a4,_0x153ffe,_0x41a3fe){var _0x484223=[];return db['User'][_0xf84c('0x43')]({'where':{'role':[_0xf84c('0x55'),'admin',_0xf84c('0x56')]},'attributes':['id',_0xf84c('0x57'),_0xf84c('0x2d'),_0xf84c('0x58'),_0xf84c('0x59'),_0xf84c('0x5a'),_0xf84c('0x5b'),_0xf84c('0x5c'),_0xf84c('0x5d'),'showWebBar'],'order':qs[_0xf84c('0x3e')](_0xf84c('0x5e')),'include':[{'model':db[_0xf84c('0x5f')],'as':_0xf84c('0x60'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xf84c('0x2a')](function(_0x51064c){if(_0x51064c){var _0x15bf7b=_0x1eb3a4[_0xf84c('0x56')]['get']({'plain':!![]});if(!_0x15bf7b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15bf7b[_0xf84c('0x58')]===_0xf84c('0x56')){return db['UserProfileSection'][_0xf84c('0x4a')]({'where':{'name':_0xf84c('0x61'),'userProfileId':_0x15bf7b['userProfileId']},'raw':!![]})[_0xf84c('0x2a')](function(_0x8bb3e5){if(_0x8bb3e5){if(_0x8bb3e5['autoAssociation']===0x0){return db[_0xf84c('0x62')][_0xf84c('0x43')]({'where':{'sectionId':_0x8bb3e5['id']},'raw':!![]})[_0xf84c('0x2a')](function(_0x3c636c){var _0x3ef892=[];if(_[_0xf84c('0x63')](_0x3c636c)){_0x3ef892=_[_0xf84c('0x42')](_0x51064c,function(_0x48cca3){if(_0x48cca3[_0xf84c('0x58')]!==_0xf84c('0x55')){return _0x48cca3;}});return _0x3ef892;}else{for(var _0x3104be=0x0;_0x3104be<_0x51064c[_0xf84c('0x3d')];_0x3104be++){var _0x109472=_0x51064c[_0x3104be];if(_0x109472[_0xf84c('0x58')]===_0xf84c('0x55')){var _0x37b92e=_[_0xf84c('0x4a')](_0x3c636c,function(_0x42ae73){return _0x42ae73[_0xf84c('0x64')]===_0x109472['id'];});if(_0x37b92e)_0x3ef892[_0xf84c('0x65')](_0x109472);}else{_0x3ef892[_0xf84c('0x65')](_0x109472);}}return _0x3ef892;}});}else{return _0x51064c;}}else{var _0x3a7fd2=_[_0xf84c('0x42')](_0x51064c,function(_0x1a06d3){if(_0x1a06d3[_0xf84c('0x58')]!==_0xf84c('0x55')){return _0x1a06d3;}});return _0x3a7fd2;}});}else{return _0x51064c;}}})[_0xf84c('0x2a')](function(_0x5ac6b0){var _0x5079f9=[];if(_0x5ac6b0){_0x484223=_0x5ac6b0;for(var _0x21bca1=0x0;_0x21bca1<_0x5ac6b0[_0xf84c('0x3d')];_0x21bca1+=0x1){_0x484223[_0x21bca1]['messages']=[];_0x5079f9[_0xf84c('0x65')](db[_0xf84c('0x31')][_0xf84c('0x4a')]({'where':{'FromId':[_0x1eb3a4[_0xf84c('0x56')]['id'],_0x5ac6b0[_0x21bca1]['id']],'ToId':[_0x1eb3a4[_0xf84c('0x56')]['id'],_0x5ac6b0[_0x21bca1]['id']],'ChatGroupId':null},'attributes':['id',_0xf84c('0x51'),'FromId',_0xf84c('0x66'),_0xf84c('0x67'),_0xf84c('0x4c')],'order':qs[_0xf84c('0x3e')](_0xf84c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf84c('0x2a')](wrapUser(_0x5ac6b0[_0x21bca1])));}return BPromise['all'](_0x5079f9);}return[];})[_0xf84c('0x2a')](function(_0x4fef95){return{'rows':_0x4fef95,'count':_0x4fef95[_0xf84c('0x3d')]};})[_0xf84c('0x2a')](respondWithResult(_0x153ffe,null))[_0xf84c('0x44')](handleError(_0x153ffe,null));}; \ No newline at end of file +var _0x7e88=['options','ChatInternalMessage','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','userpic','internal','online','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','map','rawAttributes','type','key','keys','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e88,0x1d6));var _0x87e8=function(_0x36ff64,_0x9f727a){_0x36ff64=_0x36ff64-0x0;var _0x4ac4b6=_0x7e88[_0x36ff64];return _0x4ac4b6;};'use strict';var emlformat=require(_0x87e8('0x0'));var rimraf=require(_0x87e8('0x1'));var zipdir=require(_0x87e8('0x2'));var jsonpatch=require(_0x87e8('0x3'));var rp=require('request-promise');var moment=require(_0x87e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87e8('0x5'));var path=require(_0x87e8('0x6'));var sox=require(_0x87e8('0x7'));var csv=require('to-csv');var ejs=require(_0x87e8('0x8'));var fs=require('fs');var fs_extra=require(_0x87e8('0x9'));var _=require(_0x87e8('0xa'));var squel=require(_0x87e8('0xb'));var crypto=require('crypto');var jsforce=require(_0x87e8('0xc'));var deskjs=require(_0x87e8('0xd'));var toCsv=require(_0x87e8('0xe'));var querystring=require(_0x87e8('0xf'));var Papa=require(_0x87e8('0x10'));var Redis=require('ioredis');var authService=require(_0x87e8('0x11'));var qs=require(_0x87e8('0x12'));var as=require(_0x87e8('0x13'));var hardwareService=require(_0x87e8('0x14'));var logger=require('../../config/logger')(_0x87e8('0x15'));var utils=require('../../config/utils');var config=require(_0x87e8('0x16'));var licenseUtil=require(_0x87e8('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x87e8('0x18')],{'host':_0x87e8('0x19'),'port':0x18eb});var socket=require(_0x87e8('0x1a'))(new Redis(config[_0x87e8('0x18')]));require(_0x87e8('0x1b'))[_0x87e8('0x1c')](socket);function respondWithStatusCode(_0x36d87d,_0x348486){_0x348486=_0x348486||0xcc;return function(_0x6d918c){if(_0x6d918c){return _0x36d87d[_0x87e8('0x1d')](_0x348486);}return _0x36d87d['status'](_0x348486)[_0x87e8('0x1e')]();};}function respondWithResult(_0x161205,_0x4359d3){_0x4359d3=_0x4359d3||0xc8;return function(_0x321a1b){if(_0x321a1b){return _0x161205[_0x87e8('0x1f')](_0x4359d3)[_0x87e8('0x20')](_0x321a1b);}};}function respondWithFilteredResult(_0x4aab58,_0x34e798){return function(_0x2e430d){if(_0x2e430d){var _0x33d72e=typeof _0x34e798[_0x87e8('0x21')]===_0x87e8('0x22')&&typeof _0x34e798[_0x87e8('0x23')]===_0x87e8('0x22');var _0x5039bf=_0x2e430d[_0x87e8('0x24')];var _0x9a8e2f=_0x33d72e?0x0:_0x34e798[_0x87e8('0x21')];var _0x5969d1=_0x33d72e?_0x2e430d['count']:_0x34e798['offset']+_0x34e798[_0x87e8('0x23')];var _0xa74854;if(_0x5969d1>=_0x5039bf){_0x5969d1=_0x5039bf;_0xa74854=0xc8;}else{_0xa74854=0xce;}_0x4aab58[_0x87e8('0x1f')](_0xa74854);return _0x4aab58[_0x87e8('0x25')]('Content-Range',_0x9a8e2f+'-'+_0x5969d1+'/'+_0x5039bf)['json'](_0x2e430d);}return null;};}function patchUpdates(_0x5657e6){return function(_0x4bdc30){try{jsonpatch[_0x87e8('0x26')](_0x4bdc30,_0x5657e6,!![]);}catch(_0xc0c843){return BPromise[_0x87e8('0x27')](_0xc0c843);}return _0x4bdc30[_0x87e8('0x28')]();};}function saveUpdates(_0x5dac13,_0x31e112){return function(_0x4b3437){if(_0x4b3437){return _0x4b3437[_0x87e8('0x29')](_0x5dac13)['then'](function(_0x1681a2){return _0x1681a2;});}return null;};}function removeEntity(_0x2f53af,_0x3b291a){return function(_0x1f0b9a){if(_0x1f0b9a){return _0x1f0b9a[_0x87e8('0x2a')]()[_0x87e8('0x2b')](function(){_0x2f53af[_0x87e8('0x1f')](0xcc)[_0x87e8('0x1e')]();});}};}function handleEntityNotFound(_0x422916,_0x523564){return function(_0x98fc24){if(!_0x98fc24){_0x422916['sendStatus'](0x194);}return _0x98fc24;};}function handleError(_0x499232,_0x1f8725){_0x1f8725=_0x1f8725||0x1f4;return function(_0x746d1f){logger['error'](_0x746d1f['stack']);if(_0x746d1f[_0x87e8('0x2c')]){delete _0x746d1f[_0x87e8('0x2c')];}_0x499232[_0x87e8('0x1f')](_0x1f8725)[_0x87e8('0x2d')](_0x746d1f);};}exports['index']=function(_0x3c6699,_0x538141){var _0x4e3f7c={},_0x437575={},_0x353f7c={'count':0x0,'rows':[]};var _0x34cfd4=_[_0x87e8('0x2e')](db['ChatInternalMessage'][_0x87e8('0x2f')],function(_0x5253f7){return{'name':_0x5253f7['fieldName'],'type':_0x5253f7[_0x87e8('0x30')][_0x87e8('0x31')]};});_0x437575['model']=_[_0x87e8('0x2e')](_0x34cfd4,_0x87e8('0x2c'));_0x437575['query']=_[_0x87e8('0x32')](_0x3c6699['query']);_0x437575['filters']=_['intersection'](_0x437575[_0x87e8('0x33')],_0x437575[_0x87e8('0x34')]);_0x4e3f7c['attributes']=_['intersection'](_0x437575['model'],qs[_0x87e8('0x35')](_0x3c6699[_0x87e8('0x34')][_0x87e8('0x35')]));_0x4e3f7c[_0x87e8('0x36')]=_0x4e3f7c[_0x87e8('0x36')][_0x87e8('0x37')]?_0x4e3f7c[_0x87e8('0x36')]:_0x437575['model'];if(!_0x3c6699[_0x87e8('0x34')][_0x87e8('0x38')](_0x87e8('0x39'))){_0x4e3f7c[_0x87e8('0x23')]=qs[_0x87e8('0x23')](_0x3c6699['query'][_0x87e8('0x23')]);_0x4e3f7c[_0x87e8('0x21')]=qs[_0x87e8('0x21')](_0x3c6699[_0x87e8('0x34')][_0x87e8('0x21')]);}_0x4e3f7c['order']=qs[_0x87e8('0x3a')](_0x3c6699[_0x87e8('0x34')]['sort']);_0x4e3f7c[_0x87e8('0x3b')]=qs[_0x87e8('0x3c')](_[_0x87e8('0x3d')](_0x3c6699['query'],_0x437575[_0x87e8('0x3c')]),_0x34cfd4);if(_0x3c6699[_0x87e8('0x34')]['filter']){_0x4e3f7c['where']=_[_0x87e8('0x3e')](_0x4e3f7c[_0x87e8('0x3b')],{'$or':_[_0x87e8('0x2e')](_0x34cfd4,function(_0x1dbc63){if(_0x1dbc63[_0x87e8('0x30')]!==_0x87e8('0x3f')){var _0x51d0f5={};_0x51d0f5[_0x1dbc63[_0x87e8('0x2c')]]={'$like':'%'+_0x3c6699['query'][_0x87e8('0x40')]+'%'};return _0x51d0f5;}})});}_0x4e3f7c=_[_0x87e8('0x3e')]({},_0x4e3f7c,_0x3c6699[_0x87e8('0x41')]);var _0x3f7326={'where':_0x4e3f7c[_0x87e8('0x3b')]};return db[_0x87e8('0x42')][_0x87e8('0x24')](_0x3f7326)[_0x87e8('0x2b')](function(_0x72047d){_0x353f7c[_0x87e8('0x24')]=_0x72047d;if(_0x3c6699['query'][_0x87e8('0x43')]){_0x4e3f7c[_0x87e8('0x44')]=[{'all':!![]}];}return db[_0x87e8('0x42')][_0x87e8('0x45')](_0x4e3f7c);})[_0x87e8('0x2b')](function(_0xae5a0a){_0x353f7c['rows']=_0xae5a0a;return _0x353f7c;})['then'](respondWithFilteredResult(_0x538141,_0x4e3f7c))[_0x87e8('0x46')](handleError(_0x538141,null));};exports[_0x87e8('0x47')]=function(_0x2ddc27,_0x58988f){var _0x4f0961={'raw':!![],'where':{'id':_0x2ddc27[_0x87e8('0x48')]['id']}},_0x828275={};_0x828275[_0x87e8('0x33')]=_['keys'](db[_0x87e8('0x42')][_0x87e8('0x2f')]);_0x828275[_0x87e8('0x34')]=_[_0x87e8('0x32')](_0x2ddc27[_0x87e8('0x34')]);_0x828275[_0x87e8('0x3c')]=_[_0x87e8('0x49')](_0x828275['model'],_0x828275[_0x87e8('0x34')]);_0x4f0961[_0x87e8('0x36')]=_[_0x87e8('0x49')](_0x828275[_0x87e8('0x33')],qs[_0x87e8('0x35')](_0x2ddc27[_0x87e8('0x34')]['fields']));_0x4f0961[_0x87e8('0x36')]=_0x4f0961[_0x87e8('0x36')]['length']?_0x4f0961[_0x87e8('0x36')]:_0x828275[_0x87e8('0x33')];if(_0x2ddc27['query'][_0x87e8('0x43')]){_0x4f0961[_0x87e8('0x44')]=[{'all':!![]}];}_0x4f0961=_[_0x87e8('0x3e')]({},_0x4f0961,_0x2ddc27[_0x87e8('0x41')]);return db[_0x87e8('0x42')][_0x87e8('0x4a')](_0x4f0961)[_0x87e8('0x2b')](handleEntityNotFound(_0x58988f,null))[_0x87e8('0x2b')](respondWithResult(_0x58988f,null))[_0x87e8('0x46')](handleError(_0x58988f,null));};exports[_0x87e8('0x4b')]=function(_0x4e71c2,_0x4852a6){return db[_0x87e8('0x42')][_0x87e8('0x4b')](_0x4e71c2['body'],{})['then'](respondWithResult(_0x4852a6,0xc9))[_0x87e8('0x46')](handleError(_0x4852a6,null));};exports[_0x87e8('0x29')]=function(_0x4e0346,_0x51c9c0){if(_0x4e0346[_0x87e8('0x4c')]['id']){delete _0x4e0346[_0x87e8('0x4c')]['id'];}return db[_0x87e8('0x42')][_0x87e8('0x4a')]({'where':{'id':_0x4e0346[_0x87e8('0x48')]['id']}})[_0x87e8('0x2b')](handleEntityNotFound(_0x51c9c0,null))[_0x87e8('0x2b')](saveUpdates(_0x4e0346[_0x87e8('0x4c')],null))[_0x87e8('0x2b')](respondWithResult(_0x51c9c0,null))[_0x87e8('0x46')](handleError(_0x51c9c0,null));};exports[_0x87e8('0x2a')]=function(_0x292240,_0x1a3ba8){return db['ChatInternalMessage'][_0x87e8('0x4a')]({'where':{'id':_0x292240[_0x87e8('0x48')]['id']}})[_0x87e8('0x2b')](handleEntityNotFound(_0x1a3ba8,null))[_0x87e8('0x2b')](removeEntity(_0x1a3ba8,null))[_0x87e8('0x46')](handleError(_0x1a3ba8,null));};exports[_0x87e8('0x4d')]=function(_0x5c022d,_0x204c40){return db[_0x87e8('0x42')]['describe']()['then'](respondWithResult(_0x204c40,null))[_0x87e8('0x46')](handleError(_0x204c40,null));};function wrapUser(_0x3af655){return function(_0x28c8fd){var _0x36b760=_0x3af655['get']({'plain':!![]});_0x36b760['messages']=[];if(_0x28c8fd){_0x36b760['lastMessageAt']=_0x28c8fd['createdAt'];_0x36b760['lastMessage']=_0x28c8fd;}else{_0x36b760[_0x87e8('0x4e')]=moment(0x0)[_0x87e8('0x4f')](_0x87e8('0x50'));_0x36b760[_0x87e8('0x51')]={};}return _0x36b760;};}exports[_0x87e8('0x52')]=function(_0x55eebd,_0x5cfffb,_0x4b2797){var _0x1a0200=[];return db[_0x87e8('0x53')][_0x87e8('0x45')]({'where':{'role':[_0x87e8('0x54'),_0x87e8('0x55'),_0x87e8('0x56')]},'attributes':['id','fullname',_0x87e8('0x2c'),_0x87e8('0x57'),_0x87e8('0x58'),_0x87e8('0x59'),_0x87e8('0x5a'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x87e8('0x3a')](_0x87e8('0x5b')),'include':[{'model':db[_0x87e8('0x5c')],'as':_0x87e8('0x5d'),'attributes':['id',_0x87e8('0x2c'),_0x87e8('0x30')],'through':{'attributes':[]}}]})['then'](function(_0x3d4135){if(_0x3d4135){var _0x323633=_0x55eebd[_0x87e8('0x56')]['get']({'plain':!![]});if(!_0x323633)throw new Error(_0x87e8('0x5e'));if(_0x323633[_0x87e8('0x57')]===_0x87e8('0x56')){return db[_0x87e8('0x5f')][_0x87e8('0x4a')]({'where':{'name':_0x87e8('0x60'),'userProfileId':_0x323633[_0x87e8('0x61')]},'raw':!![]})[_0x87e8('0x2b')](function(_0x34c92e){if(_0x34c92e){if(_0x34c92e['autoAssociation']===0x0){return db[_0x87e8('0x62')]['findAll']({'where':{'sectionId':_0x34c92e['id']},'raw':!![]})['then'](function(_0x593cd2){var _0x3af402=[];if(_[_0x87e8('0x63')](_0x593cd2)){_0x3af402=_[_0x87e8('0x40')](_0x3d4135,function(_0x36eee6){if(_0x36eee6[_0x87e8('0x57')]!==_0x87e8('0x54')){return _0x36eee6;}});return _0x3af402;}else{for(var _0x183a51=0x0;_0x183a51<_0x3d4135['length'];_0x183a51++){var _0x52227a=_0x3d4135[_0x183a51];if(_0x52227a['role']===_0x87e8('0x54')){var _0x320e47=_[_0x87e8('0x4a')](_0x593cd2,function(_0x4ec2b0){return _0x4ec2b0[_0x87e8('0x64')]===_0x52227a['id'];});if(_0x320e47)_0x3af402[_0x87e8('0x65')](_0x52227a);}else{_0x3af402['push'](_0x52227a);}}return _0x3af402;}});}else{return _0x3d4135;}}else{var _0x149401=_[_0x87e8('0x40')](_0x3d4135,function(_0x2c6d4a){if(_0x2c6d4a[_0x87e8('0x57')]!=='agent'){return _0x2c6d4a;}});return _0x149401;}});}else{return _0x3d4135;}}})['then'](function(_0xf11f56){var _0x299463=[];if(_0xf11f56){_0x1a0200=_0xf11f56;for(var _0x49f957=0x0;_0x49f957<_0xf11f56[_0x87e8('0x37')];_0x49f957+=0x1){_0x1a0200[_0x49f957]['messages']=[];_0x299463[_0x87e8('0x65')](db[_0x87e8('0x42')][_0x87e8('0x4a')]({'where':{'FromId':[_0x55eebd['user']['id'],_0xf11f56[_0x49f957]['id']],'ToId':[_0x55eebd['user']['id'],_0xf11f56[_0x49f957]['id']],'ChatGroupId':null},'attributes':['id',_0x87e8('0x66'),_0x87e8('0x67'),'ToId',_0x87e8('0x68'),_0x87e8('0x4c')],'order':qs[_0x87e8('0x3a')](_0x87e8('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x87e8('0x2b')](wrapUser(_0xf11f56[_0x49f957])));}return BPromise[_0x87e8('0x6a')](_0x299463);}return[];})[_0x87e8('0x2b')](function(_0x1716e8){return{'rows':_0x1716e8,'count':_0x1716e8[_0x87e8('0x37')]};})[_0x87e8('0x2b')](respondWithResult(_0x5cfffb,null))[_0x87e8('0x46')](handleError(_0x5cfffb,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5a361ed..ea41d1b 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 _0xd30a=['update','remove','emit','hook','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0x161165,_0x40e238){var _0x245aed=function(_0x186c00){while(--_0x186c00){_0x161165['push'](_0x161165['shift']());}};_0x245aed(++_0x40e238);}(_0xd30a,0x19d));var _0xad30=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xd30a[_0x4bb66f];return _0xf2772f;};'use strict';var EventEmitter=require(_0xad30('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xad30('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xad30('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad30('0x3'),'afterDestroy':_0xad30('0x4')};function emitEvent(_0xd50b07){return function(_0x2d33da,_0x21c67b,_0x1cd806){ChatInternalMessageEvents[_0xad30('0x5')](_0xd50b07+':'+_0x2d33da['id'],_0x2d33da);ChatInternalMessageEvents[_0xad30('0x5')](_0xd50b07,_0x2d33da);_0x1cd806(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xad30('0x6')](e,emitEvent(event));}}module[_0xad30('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1c9e=['save','update','remove','emit','hook','exports','../../mysqldb','ChatInternalMessage'];(function(_0x5da2bd,_0x10eaab){var _0x59b4ce=function(_0x1362ae){while(--_0x1362ae){_0x5da2bd['push'](_0x5da2bd['shift']());}};_0x59b4ce(++_0x10eaab);}(_0x1c9e,0x146));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe1c9('0x0'))['db'][_0xe1c9('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1c9('0x2'),'afterUpdate':_0xe1c9('0x3'),'afterDestroy':_0xe1c9('0x4')};function emitEvent(_0xbd2502){return function(_0x186359,_0x1b8a78,_0x3212b4){ChatInternalMessageEvents['emit'](_0xbd2502+':'+_0x186359['id'],_0x186359);ChatInternalMessageEvents[_0xe1c9('0x5')](_0xbd2502,_0x186359);_0x3212b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xe1c9('0x6')](e,emitEvent(event));}}module[_0xe1c9('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 fbfdee4..c411071 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 _0xeeb0=['lodash','util','api','moment','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0xeeb0,0x114));var _0x0eeb=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xeeb0[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0x0eeb('0x0'));var util=require(_0x0eeb('0x1'));var logger=require('../../config/logger')(_0x0eeb('0x2'));var moment=require(_0x0eeb('0x3'));var BPromise=require('bluebird');var rp=require(_0x0eeb('0x4'));var fs=require('fs');var path=require(_0x0eeb('0x5'));var rimraf=require(_0x0eeb('0x6'));var config=require('../../config/environment');var attributes=require(_0x0eeb('0x7'));module[_0x0eeb('0x8')]=function(_0xfe5b43,_0x168442){return _0xfe5b43[_0x0eeb('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x0eeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0eeb('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9a3b=['../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f044e,_0x56ddcf){var _0x1ff697=function(_0x5c76e4){while(--_0x5c76e4){_0x3f044e['push'](_0x3f044e['shift']());}};_0x1ff697(++_0x56ddcf);}(_0x9a3b,0xbd));var _0xb9a3=function(_0x1411e8,_0x249a68){_0x1411e8=_0x1411e8-0x0;var _0x5b844e=_0x9a3b[_0x1411e8];return _0x5b844e;};'use strict';var _=require(_0xb9a3('0x0'));var util=require(_0xb9a3('0x1'));var logger=require(_0xb9a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb9a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9a3('0x4'));var rimraf=require(_0xb9a3('0x5'));var config=require(_0xb9a3('0x6'));var attributes=require(_0xb9a3('0x7'));module['exports']=function(_0x7b0d5e,_0x2c7631){return _0x7b0d5e[_0xb9a3('0x8')](_0xb9a3('0x9'),attributes,{'tableName':_0xb9a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9a3('0xb'),'collate':_0xb9a3('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 70437d8..8ae9aef 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 _0xbec5=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','request\x20sent','debug','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbec5,0xe5));var _0x5bec=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xbec5[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});} \ No newline at end of file +var _0x6909=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring'];(function(_0x45030e,_0x32b6b8){var _0x4df3be=function(_0x1fe781){while(--_0x1fe781){_0x45030e['push'](_0x45030e['shift']());}};_0x4df3be(++_0x32b6b8);}(_0x6909,0x1e3));var _0x9690=function(_0xc8c5bf,_0x5af025){_0xc8c5bf=_0xc8c5bf-0x0;var _0x5d53af=_0x6909[_0xc8c5bf];return _0x5d53af;};'use strict';var _=require('lodash');var util=require(_0x9690('0x0'));var moment=require('moment');var BPromise=require(_0x9690('0x1'));var rs=require(_0x9690('0x2'));var fs=require('fs');var Redis=require(_0x9690('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9690('0x4'));var logger=require(_0x9690('0x5'))(_0x9690('0x6'));var config=require('../../config/environment');var jayson=require(_0x9690('0x7'));var client=jayson[_0x9690('0x8')][_0x9690('0x9')]({'port':0x232a});config[_0x9690('0xa')]=_[_0x9690('0xb')](config[_0x9690('0xa')],{'host':_0x9690('0xc'),'port':0x18eb});var socket=require(_0x9690('0xd'))(new Redis(config[_0x9690('0xa')]));require(_0x9690('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c89e0,_0x2658c6,_0x24eae8){return new BPromise(function(_0x39847f,_0x12b229){return client[_0x9690('0xf')](_0x3c89e0,_0x24eae8)[_0x9690('0x10')](function(_0x201381){logger[_0x9690('0x11')](_0x9690('0x12'),_0x2658c6,'request\x20sent');logger[_0x9690('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2658c6,'request\x20sent',JSON[_0x9690('0x14')](_0x201381));if(_0x201381[_0x9690('0x15')]){if(_0x201381[_0x9690('0x15')][_0x9690('0x16')]===0x1f4){logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x12b229(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x39847f(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}else{logger['info'](_0x9690('0x12'),_0x2658c6,_0x9690('0x18'));_0x39847f(_0x201381[_0x9690('0x19')][_0x9690('0x17')]);}})[_0x9690('0x1a')](function(_0x3ad729){logger[_0x9690('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2658c6,_0x3ad729);_0x12b229(_0x3ad729);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d77b8df..6191799 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 _0x590d=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x57a2a6,_0x3d21b2){var _0x74724a=function(_0x5918cc){while(--_0x5918cc){_0x57a2a6['push'](_0x57a2a6['shift']());}};_0x74724a(++_0x3d21b2);}(_0x590d,0x16f));var _0xd590=function(_0xa96b73,_0x5d4c0c){_0xa96b73=_0xa96b73-0x0;var _0x4aacc7=_0x590d[_0xa96b73];return _0x4aacc7;};'use strict';var ChatInternalMessageEvents=require(_0xd590('0x0'));var events=[_0xd590('0x1'),_0xd590('0x2'),_0xd590('0x3')];function createListener(_0x25f746,_0x513865){return function(_0x3100d7){_0x513865[_0xd590('0x4')](_0x25f746,_0x3100d7);};}function removeListener(_0x4d7638,_0x5469d6){return function(){ChatInternalMessageEvents[_0xd590('0x5')](_0x4d7638,_0x5469d6);};}exports[_0xd590('0x6')]=function(_0x4c3e0e){for(var _0x190d98=0x0,_0x36d06b=events[_0xd590('0x7')];_0x190d98<_0x36d06b;_0x190d98++){var _0x22788b=events[_0x190d98];var _0x11016a=createListener(_0xd590('0x8')+_0x22788b,_0x4c3e0e);ChatInternalMessageEvents['on'](_0x22788b,_0x11016a);}}; \ No newline at end of file +var _0xeb24=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0xecd71a,_0x3543fd){var _0x445a0a=function(_0x5e68f2){while(--_0x5e68f2){_0xecd71a['push'](_0xecd71a['shift']());}};_0x445a0a(++_0x3543fd);}(_0xeb24,0x9d));var _0x4eb2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xeb24[_0x1694f5];return _0x5b4321;};'use strict';var ChatInternalMessageEvents=require(_0x4eb2('0x0'));var events=[_0x4eb2('0x1'),_0x4eb2('0x2'),_0x4eb2('0x3')];function createListener(_0x2217f5,_0x445280){return function(_0x388845){_0x445280['emit'](_0x2217f5,_0x388845);};}function removeListener(_0x26a55e,_0x3e4ce9){return function(){ChatInternalMessageEvents[_0x4eb2('0x4')](_0x26a55e,_0x3e4ce9);};}exports['register']=function(_0x15df94){for(var _0x5917c9=0x0,_0x230c79=events[_0x4eb2('0x5')];_0x5917c9<_0x230c79;_0x5917c9++){var _0x1c59fc=events[_0x5917c9];var _0x1afc00=createListener(_0x4eb2('0x6')+_0x1c59fc,_0x15df94);ChatInternalMessageEvents['on'](_0x1c59fc,_0x1afc00);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 98bfaad..2faff9f 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 _0xde50=['Router','../../components/auth/service','../../config/environment','index','get','/describe','describe','getUsers','/:id','show','post','create','put','isAuthenticated','destroy','exports','path','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xde50,0x140));var _0x0de5=function(_0x41a1fd,_0x4ac5c7){_0x41a1fd=_0x41a1fd-0x0;var _0x24f1cd=_0xde50[_0x41a1fd];return _0x24f1cd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0de5('0x0'));var timeout=require(_0x0de5('0x1'));var express=require(_0x0de5('0x2'));var router=express[_0x0de5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0de5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0de5('0x5'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0de5('0x6')]);router[_0x0de5('0x7')](_0x0de5('0x8'),auth['isAuthenticated'](),controller[_0x0de5('0x9')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x0de5('0xa')]);router[_0x0de5('0x7')](_0x0de5('0xb'),auth['isAuthenticated'](),controller[_0x0de5('0xc')]);router[_0x0de5('0xd')]('/',auth['isAuthenticated'](),controller[_0x0de5('0xe')]);router[_0x0de5('0xf')](_0x0de5('0xb'),controller['update']);router['delete'](_0x0de5('0xb'),auth[_0x0de5('0x10')](),controller[_0x0de5('0x11')]);module[_0x0de5('0x12')]=router; \ No newline at end of file +var _0x9028=['/describe','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x9028,0x137));var _0x8902=function(_0xfb4ed5,_0x3ebd19){_0xfb4ed5=_0xfb4ed5-0x0;var _0x581224=_0x9028[_0xfb4ed5];return _0x581224;};'use strict';var multer=require(_0x8902('0x0'));var util=require(_0x8902('0x1'));var path=require(_0x8902('0x2'));var timeout=require(_0x8902('0x3'));var express=require(_0x8902('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8902('0x5'));var interaction=require(_0x8902('0x6'));var config=require(_0x8902('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x8902('0x8')]('/',auth[_0x8902('0x9')](),controller[_0x8902('0xa')]);router[_0x8902('0x8')](_0x8902('0xb'),auth[_0x8902('0x9')](),controller[_0x8902('0xc')]);router['get'](_0x8902('0xd'),auth[_0x8902('0x9')](),controller[_0x8902('0xe')]);router[_0x8902('0x8')](_0x8902('0xf'),auth[_0x8902('0x9')](),controller[_0x8902('0x10')]);router[_0x8902('0x11')]('/',auth[_0x8902('0x9')](),controller[_0x8902('0x12')]);router[_0x8902('0x13')]('/:id',controller[_0x8902('0x14')]);router['delete'](_0x8902('0xf'),auth[_0x8902('0x9')](),controller[_0x8902('0x15')]);module[_0x8902('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 7ac5a12..a234ecc 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 _0xa149=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x2c8b95,_0x1cc36f){var _0xc375b1=function(_0x5d1e34){while(--_0x5d1e34){_0x2c8b95['push'](_0x2c8b95['shift']());}};_0xc375b1(++_0x1cc36f);}(_0xa149,0x18c));var _0x9a14=function(_0x1d6908,_0x47aa2b){_0x1d6908=_0x1d6908-0x0;var _0x228450=_0xa149[_0x1d6908];return _0x228450;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'body':{'type':Sequelize[_0x9a14('0x2')](_0x9a14('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a14('0x5')]('in',_0x9a14('0x6')),'defaultValue':_0x9a14('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9a14('0x7')]},'providerResponse':{'type':Sequelize[_0x9a14('0x2')]}}; \ No newline at end of file +var _0xadcc=['TEXT','medium','BOOLEAN','ENUM','DATE','STRING','sequelize'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xadcc,0x76));var _0xcadc=function(_0x52d8ae,_0x372b3e){_0x52d8ae=_0x52d8ae-0x0;var _0x43c27b=_0xadcc[_0x52d8ae];return _0x43c27b;};'use strict';var Sequelize=require(_0xcadc('0x0'));module['exports']={'body':{'type':Sequelize[_0xcadc('0x1')](_0xcadc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcadc('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcadc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcadc('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xcadc('0x5')]},'providerName':{'type':Sequelize[_0xcadc('0x6')]},'providerResponse':{'type':Sequelize[_0xcadc('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index a801feb..fec7052 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 _0xd714=['sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','include','options','create','body','find','params','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','update','isNil','read1stAt','get','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','QueryTypes','rejectmessage','formData','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','name','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd714,0xc3));var _0x4d71=function(_0xed9fea,_0x5ed774){_0xed9fea=_0xed9fea-0x0;var _0x198f12=_0xd714[_0xed9fea];return _0x198f12;};'use strict';var emlformat=require(_0x4d71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d71('0x1'));var jsonpatch=require(_0x4d71('0x2'));var rp=require(_0x4d71('0x3'));var moment=require('moment');var BPromise=require(_0x4d71('0x4'));var Mustache=require(_0x4d71('0x5'));var util=require(_0x4d71('0x6'));var path=require(_0x4d71('0x7'));var sox=require(_0x4d71('0x8'));var csv=require(_0x4d71('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d71('0xa'));var _=require(_0x4d71('0xb'));var squel=require(_0x4d71('0xc'));var crypto=require(_0x4d71('0xd'));var jsforce=require(_0x4d71('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d71('0xf'));var Papa=require('papaparse');var Redis=require(_0x4d71('0x10'));var authService=require(_0x4d71('0x11'));var qs=require(_0x4d71('0x12'));var as=require(_0x4d71('0x13'));var hardwareService=require(_0x4d71('0x14'));var logger=require(_0x4d71('0x15'))(_0x4d71('0x16'));var utils=require('../../config/utils');var config=require(_0x4d71('0x17'));var licenseUtil=require(_0x4d71('0x18'));var db=require(_0x4d71('0x19'))['db'];config['redis']=_[_0x4d71('0x1a')](config[_0x4d71('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d71('0x1c'))(new Redis(config[_0x4d71('0x1b')]));require(_0x4d71('0x1d'))['register'](socket);var jayson=require(_0x4d71('0x1e'));var client=jayson['client'][_0x4d71('0x1f')]({'port':0x232c});var client9002=jayson[_0x4d71('0x20')][_0x4d71('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x38bdf6,_0x222030,_0x2bc0ab,_0x3707f2){return new BPromise(function(_0x1aa80a,_0x47140b){var _0x28529a=_0x3707f2||client;return _0x28529a[_0x4d71('0x21')](_0x38bdf6,_0x2bc0ab)[_0x4d71('0x22')](function(_0x2349e8){logger['info'](_0x4d71('0x23'),_0x222030,_0x4d71('0x24'));logger[_0x4d71('0x25')](_0x4d71('0x26'),_0x222030,_0x4d71('0x24'),JSON[_0x4d71('0x27')](_0x2349e8));if(_0x2349e8[_0x4d71('0x28')]){if(_0x2349e8['error'][_0x4d71('0x29')]===0x1f4){logger['error'](_0x4d71('0x23'),_0x222030,_0x2349e8[_0x4d71('0x28')][_0x4d71('0x2a')]);return _0x47140b(_0x2349e8['error']['message']);}logger['error'](_0x4d71('0x23'),_0x222030,_0x2349e8[_0x4d71('0x28')][_0x4d71('0x2a')]);return _0x1aa80a(_0x2349e8['error'][_0x4d71('0x2a')]);}else{logger['info'](_0x4d71('0x23'),_0x222030,_0x4d71('0x24'));_0x1aa80a(_0x2349e8[_0x4d71('0x2b')]['message']);}})[_0x4d71('0x2c')](function(_0x23ae64){logger[_0x4d71('0x28')](_0x4d71('0x23'),_0x222030,_0x23ae64);_0x47140b(_0x23ae64);});});}function respondWithStatusCode(_0xf24421,_0x2b4c59){_0x2b4c59=_0x2b4c59||0xcc;return function(_0x4d5abb){if(_0x4d5abb){return _0xf24421[_0x4d71('0x2d')](_0x2b4c59);}return _0xf24421['status'](_0x2b4c59)[_0x4d71('0x2e')]();};}function respondWithResult(_0x156dac,_0x19aa09){_0x19aa09=_0x19aa09||0xc8;return function(_0x4cf177){if(_0x4cf177){return _0x156dac[_0x4d71('0x2f')](_0x19aa09)['json'](_0x4cf177);}};}function respondWithFilteredResult(_0xc5af41,_0x149632){return function(_0x34cd1e){if(_0x34cd1e){var _0x17f553=typeof _0x149632[_0x4d71('0x30')]===_0x4d71('0x31')&&typeof _0x149632['limit']===_0x4d71('0x31');var _0x2bae9b=_0x34cd1e['count'];var _0x473fd6=_0x17f553?0x0:_0x149632[_0x4d71('0x30')];var _0x5d28e3=_0x17f553?_0x34cd1e['count']:_0x149632['offset']+_0x149632[_0x4d71('0x32')];var _0x5a6298;if(_0x5d28e3>=_0x2bae9b){_0x5d28e3=_0x2bae9b;_0x5a6298=0xc8;}else{_0x5a6298=0xce;}_0xc5af41[_0x4d71('0x2f')](_0x5a6298);return _0xc5af41[_0x4d71('0x33')](_0x4d71('0x34'),_0x473fd6+'-'+_0x5d28e3+'/'+_0x2bae9b)['json'](_0x34cd1e);}return null;};}function patchUpdates(_0xe96cd5){return function(_0x2c4b89){try{jsonpatch[_0x4d71('0x35')](_0x2c4b89,_0xe96cd5,!![]);}catch(_0x37fec0){return BPromise[_0x4d71('0x36')](_0x37fec0);}return _0x2c4b89[_0x4d71('0x37')]();};}function saveUpdates(_0x4ae075,_0xdb8a9c){return function(_0x57dfbd){if(_0x57dfbd){return _0x57dfbd['update'](_0x4ae075)[_0x4d71('0x22')](function(_0x456611){return _0x456611;});}return null;};}function removeEntity(_0x161007,_0xf56683){return function(_0x261811){if(_0x261811){return _0x261811[_0x4d71('0x38')]()[_0x4d71('0x22')](function(){_0x161007['status'](0xcc)[_0x4d71('0x2e')]();});}};}function handleEntityNotFound(_0x5e3dcf,_0x48f99a){return function(_0x3e45d4){if(!_0x3e45d4){_0x5e3dcf[_0x4d71('0x2d')](0x194);}return _0x3e45d4;};}function handleError(_0x4b9b3c,_0x1a6786){_0x1a6786=_0x1a6786||0x1f4;return function(_0x4706ae){logger[_0x4d71('0x28')](_0x4706ae['stack']);if(_0x4706ae['name']){delete _0x4706ae[_0x4d71('0x39')];}_0x4b9b3c[_0x4d71('0x2f')](_0x1a6786)['send'](_0x4706ae);};}exports['index']=function(_0x51541f,_0x2b3226){var _0x247204={},_0x3ec5c5={},_0x53a3fd={'count':0x0,'rows':[]};var _0xd126c5=_[_0x4d71('0x3a')](db[_0x4d71('0x3b')][_0x4d71('0x3c')],function(_0x56e707){return{'name':_0x56e707[_0x4d71('0x3d')],'type':_0x56e707[_0x4d71('0x3e')][_0x4d71('0x3f')]};});_0x3ec5c5[_0x4d71('0x40')]=_[_0x4d71('0x3a')](_0xd126c5,'name');_0x3ec5c5[_0x4d71('0x41')]=_[_0x4d71('0x42')](_0x51541f[_0x4d71('0x41')]);_0x3ec5c5[_0x4d71('0x43')]=_[_0x4d71('0x44')](_0x3ec5c5['model'],_0x3ec5c5[_0x4d71('0x41')]);_0x247204[_0x4d71('0x45')]=_[_0x4d71('0x44')](_0x3ec5c5[_0x4d71('0x40')],qs[_0x4d71('0x46')](_0x51541f[_0x4d71('0x41')][_0x4d71('0x46')]));_0x247204[_0x4d71('0x45')]=_0x247204[_0x4d71('0x45')][_0x4d71('0x47')]?_0x247204['attributes']:_0x3ec5c5[_0x4d71('0x40')];if(!_0x51541f[_0x4d71('0x41')][_0x4d71('0x48')]('nolimit')){_0x247204['limit']=qs[_0x4d71('0x32')](_0x51541f['query'][_0x4d71('0x32')]);_0x247204[_0x4d71('0x30')]=qs['offset'](_0x51541f[_0x4d71('0x41')][_0x4d71('0x30')]);}_0x247204['order']=qs[_0x4d71('0x49')](_0x51541f[_0x4d71('0x41')][_0x4d71('0x49')]);_0x247204[_0x4d71('0x4a')]=qs[_0x4d71('0x43')](_[_0x4d71('0x4b')](_0x51541f[_0x4d71('0x41')],_0x3ec5c5['filters']),_0xd126c5);if(_0x51541f['query'][_0x4d71('0x4c')]){_0x247204[_0x4d71('0x4a')]=_[_0x4d71('0x4d')](_0x247204[_0x4d71('0x4a')],{'$or':_[_0x4d71('0x3a')](_0xd126c5,function(_0x34acf4){if(_0x34acf4[_0x4d71('0x3e')]!==_0x4d71('0x4e')){var _0x1e1b5f={};_0x1e1b5f[_0x34acf4['name']]={'$like':'%'+_0x51541f[_0x4d71('0x41')][_0x4d71('0x4c')]+'%'};return _0x1e1b5f;}})});}_0x247204=_['merge']({},_0x247204,_0x51541f['options']);var _0x8b07a3={'where':_0x247204[_0x4d71('0x4a')]};return db['ChatMessage'][_0x4d71('0x4f')](_0x8b07a3)[_0x4d71('0x22')](function(_0xeaacac){_0x53a3fd[_0x4d71('0x4f')]=_0xeaacac;if(_0x51541f[_0x4d71('0x41')][_0x4d71('0x50')]){_0x247204['include']=[{'all':!![]}];}return db[_0x4d71('0x3b')][_0x4d71('0x51')](_0x247204);})[_0x4d71('0x22')](function(_0x5218d3){_0x53a3fd[_0x4d71('0x52')]=_0x5218d3;return _0x53a3fd;})[_0x4d71('0x22')](respondWithFilteredResult(_0x2b3226,_0x247204))['catch'](handleError(_0x2b3226,null));};exports[_0x4d71('0x53')]=function(_0x2b2a6e,_0xbffe1e){var _0x540128={'raw':!![],'where':{'id':_0x2b2a6e['params']['id']}},_0x4b7bc3={};_0x4b7bc3[_0x4d71('0x40')]=_['keys'](db[_0x4d71('0x3b')]['rawAttributes']);_0x4b7bc3[_0x4d71('0x41')]=_[_0x4d71('0x42')](_0x2b2a6e[_0x4d71('0x41')]);_0x4b7bc3['filters']=_[_0x4d71('0x44')](_0x4b7bc3[_0x4d71('0x40')],_0x4b7bc3['query']);_0x540128['attributes']=_[_0x4d71('0x44')](_0x4b7bc3[_0x4d71('0x40')],qs[_0x4d71('0x46')](_0x2b2a6e['query']['fields']));_0x540128['attributes']=_0x540128[_0x4d71('0x45')][_0x4d71('0x47')]?_0x540128['attributes']:_0x4b7bc3[_0x4d71('0x40')];if(_0x2b2a6e['query'][_0x4d71('0x50')]){_0x540128[_0x4d71('0x54')]=[{'all':!![]}];}_0x540128=_[_0x4d71('0x4d')]({},_0x540128,_0x2b2a6e[_0x4d71('0x55')]);return db[_0x4d71('0x3b')]['find'](_0x540128)[_0x4d71('0x22')](handleEntityNotFound(_0xbffe1e,null))[_0x4d71('0x22')](respondWithResult(_0xbffe1e,null))['catch'](handleError(_0xbffe1e,null));};exports[_0x4d71('0x56')]=function(_0x2d81e1,_0x3103ed){return db[_0x4d71('0x3b')][_0x4d71('0x56')](_0x2d81e1[_0x4d71('0x57')],{})['then'](respondWithResult(_0x3103ed,0xc9))[_0x4d71('0x2c')](handleError(_0x3103ed,null));};exports['update']=function(_0x308b02,_0x1c3476){if(_0x308b02[_0x4d71('0x57')]['id']){delete _0x308b02[_0x4d71('0x57')]['id'];}return db[_0x4d71('0x3b')][_0x4d71('0x58')]({'where':{'id':_0x308b02[_0x4d71('0x59')]['id']}})[_0x4d71('0x22')](handleEntityNotFound(_0x1c3476,null))[_0x4d71('0x22')](saveUpdates(_0x308b02[_0x4d71('0x57')],null))[_0x4d71('0x22')](respondWithResult(_0x1c3476,null))[_0x4d71('0x2c')](handleError(_0x1c3476,null));};exports[_0x4d71('0x38')]=function(_0x30c451,_0xbe7d4b){return db[_0x4d71('0x3b')][_0x4d71('0x58')]({'where':{'id':_0x30c451[_0x4d71('0x59')]['id']}})[_0x4d71('0x22')](handleEntityNotFound(_0xbe7d4b,null))[_0x4d71('0x22')](removeEntity(_0xbe7d4b,null))[_0x4d71('0x2c')](handleError(_0xbe7d4b,null));};exports['describe']=function(_0x13e2b5,_0x130aba){return db['ChatMessage']['describe']()[_0x4d71('0x22')](respondWithResult(_0x130aba,null))[_0x4d71('0x2c')](handleError(_0x130aba,null));};var interaction_log=require(_0x4d71('0x15'))(_0x4d71('0x5a'));exports[_0x4d71('0x5b')]=function(_0x4058cc,_0x163798,_0x5a01ad){var _0xc5c458={'agent':{},'channel':_0x4d71('0x5c')};if(_0x4058cc['body']['id']){delete _0x4058cc[_0x4d71('0x57')]['id'];}_0x4058cc[_0x4d71('0x57')][_0x4d71('0x5d')]=!![];_0x4058cc[_0x4d71('0x57')][_0x4d71('0x5e')]=moment()[_0x4d71('0x5f')](_0x4d71('0x60'));_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')]=_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')]||_0x4058cc[_0x4d71('0x62')]['id'];_0xc5c458[_0x4d71('0x63')]['id']=_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')];return db[_0x4d71('0x3b')][_0x4d71('0x58')]({'where':{'id':_0x4058cc[_0x4d71('0x59')]['id'],'UserId':null}})[_0x4d71('0x22')](handleEntityNotFound(_0x163798,null))['then'](saveUpdates(_0x4058cc[_0x4d71('0x57')],null))[_0x4d71('0x22')](function(_0x41eac8){if(_0x41eac8){_0xc5c458['message']=_0x41eac8['get']({'plain':!![]});return db['ChatInteraction'][_0x4d71('0x58')]({'where':{'id':_0x41eac8['ChatInteractionId']}});}return null;})[_0x4d71('0x22')](handleEntityNotFound(_0x163798,null))['then'](function(_0x1875aa){if(_0x1875aa){return _0x1875aa[_0x4d71('0x64')]({'UserId':_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')],'read1stAt':_[_0x4d71('0x65')](_0x1875aa[_0x4d71('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4d71('0x22')](function(_0x387451){if(_0x387451){_0xc5c458['interaction']=_0x387451[_0x4d71('0x67')]({'plain':!![]});interaction_log[_0x4d71('0x68')](_0x4d71('0x69'),_0x4058cc[_0x4d71('0x62')]['id'],_0x4058cc[_0x4d71('0x62')][_0x4d71('0x39')],_0x4058cc['user'][_0x4d71('0x6a')],_0xc5c458[_0x4d71('0x6b')]['id'],_0x4058cc[_0x4d71('0x57')]?JSON[_0x4d71('0x27')](_0x4058cc[_0x4d71('0x57')]):_0x4d71('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x4d71('0x6d'),_0xc5c458);}return null;})[_0x4d71('0x22')](function(_0x4fd6e8){var _0x208b39=_0x4d71('0x6e')+_0x4fd6e8[_0x4d71('0x2a')][_0x4d71('0x6f')];return db['sequelize'][_0x4d71('0x41')](_0x208b39,{'type':db[_0x4d71('0x70')]['QueryTypes'][_0x4d71('0x71')],'raw':!![]})[_0x4d71('0x22')](function(_0x9a5e9){return _0x9a5e9;});})[_0x4d71('0x22')](function(_0xd4079f){if(_0xd4079f){_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x72')]=_0xd4079f[0x0];if(!_0x4058cc['body']['UserId'])return;return db[_0x4d71('0x73')]['find']({'where':{'id':_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')],'role':_0x4d71('0x63')},'attributes':['id','name',_0x4d71('0x74'),_0x4d71('0x75'),_0x4d71('0x76')],'raw':!![]});}return null;})['then'](function(_0xb09eb0){if(!_0xb09eb0)return null;_0xc5c458[_0x4d71('0x2a')]['agent']=_0xb09eb0;return _0xc5c458;})['then'](function(_0x471a4f){if(_0x471a4f){if(_0x4058cc['body']['manual']){_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x77')]=util['format'](_0x4d71('0x78'),_0x4058cc[_0x4d71('0x62')]['name']);_0xc5c458['message'][_0x4d71('0x79')]=_0xc5c458[_0x4d71('0x79')];_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x7a')]=_0xc5c458[_0x4d71('0x79')];_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x7b')]='accept';return respondWithRpcPromise(_0x4d71('0x7c'),_0x4d71('0x7c'),{'event':_0x4d71('0x7d'),'message':_[_0x4d71('0x4d')](_0xc5c458[_0x4d71('0x2a')],JSON[_0x4d71('0x7e')](_0xc5c458['interaction']['formData']))},client9002)['then'](function(){return _0xc5c458;});}return _0xc5c458;}return null;})[_0x4d71('0x22')](respondWithResult(_0x163798,null))[_0x4d71('0x2c')](handleError(_0x163798,null));};var interaction_log=require(_0x4d71('0x15'))(_0x4d71('0x5a'));exports[_0x4d71('0x36')]=function(_0x5d3f7b,_0x707c8e,_0x28e243){var _0xcf0ca5={'agent':{},'channel':_0x4d71('0x5c')};if(_0x5d3f7b[_0x4d71('0x57')]['id']){delete _0x5d3f7b[_0x4d71('0x57')]['id'];}_0x5d3f7b[_0x4d71('0x57')]['UserId']=_0x5d3f7b[_0x4d71('0x57')][_0x4d71('0x61')]||_0x5d3f7b[_0x4d71('0x62')]['id'];_0xcf0ca5[_0x4d71('0x63')]['id']=_0x5d3f7b['body'][_0x4d71('0x61')];return db['ChatMessage'][_0x4d71('0x58')]({'where':{'id':_0x5d3f7b[_0x4d71('0x59')]['id'],'UserId':null}})[_0x4d71('0x22')](handleEntityNotFound(_0x707c8e,null))[_0x4d71('0x22')](function(_0x20e41e){if(_0x20e41e){_0xcf0ca5['message']=_0x20e41e[_0x4d71('0x67')]({'plain':!![]});return db[_0x4d71('0x7f')][_0x4d71('0x58')]({'where':{'id':_0x20e41e[_0x4d71('0x80')]}});}return null;})[_0x4d71('0x22')](handleEntityNotFound(_0x707c8e,null))[_0x4d71('0x22')](function(_0x49df43){if(_0x49df43){_0xcf0ca5['interaction']=_0x49df43[_0x4d71('0x67')]({'plain':!![]});interaction_log['info'](_0x4d71('0x81'),_0x5d3f7b[_0x4d71('0x62')]['id'],_0x5d3f7b[_0x4d71('0x62')][_0x4d71('0x39')],_0x5d3f7b[_0x4d71('0x62')]['role'],_0xcf0ca5['interaction']['id'],_0x5d3f7b[_0x4d71('0x57')]?JSON[_0x4d71('0x27')](_0x5d3f7b[_0x4d71('0x57')]):_0x4d71('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xcf0ca5);}return null;})[_0x4d71('0x22')](function(_0x2a1bbb){var _0x119f92=_0x4d71('0x6e')+_0x2a1bbb[_0x4d71('0x2a')][_0x4d71('0x6f')];return db[_0x4d71('0x82')][_0x4d71('0x41')](_0x119f92,{'type':db[_0x4d71('0x70')][_0x4d71('0x83')][_0x4d71('0x71')],'raw':!![]})['then'](function(_0x26098c){return _0x26098c;});})['then'](function(_0x8c5d3){if(_0x8c5d3){_0xcf0ca5[_0x4d71('0x2a')][_0x4d71('0x72')]=_0x8c5d3[0x0];if(!_0x5d3f7b[_0x4d71('0x57')][_0x4d71('0x61')])return;return db[_0x4d71('0x73')]['find']({'where':{'id':_0x5d3f7b['body'][_0x4d71('0x61')],'role':_0x4d71('0x63')},'attributes':['id',_0x4d71('0x39'),_0x4d71('0x74'),'email',_0x4d71('0x76')],'raw':!![]});}return null;})[_0x4d71('0x22')](function(_0x1f33f6){if(!_0x1f33f6)return null;_0xcf0ca5[_0x4d71('0x2a')][_0x4d71('0x63')]=_0x1f33f6;return _0xcf0ca5;})[_0x4d71('0x22')](function(_0xd36461){if(_0xd36461){_0xd36461[_0x4d71('0x2a')][_0x4d71('0x77')]=util[_0x4d71('0x5f')](_0x4d71('0x78'),_0x5d3f7b[_0x4d71('0x62')][_0x4d71('0x39')]);_0xd36461['message'][_0x4d71('0x79')]=_0xcf0ca5[_0x4d71('0x79')];_0xd36461[_0x4d71('0x2a')][_0x4d71('0x7a')]=_0xcf0ca5[_0x4d71('0x79')];_0xd36461[_0x4d71('0x2a')]['event']='reject';respondWithRpcPromise(_0x4d71('0x7c'),_0x4d71('0x7c'),{'event':_0x4d71('0x84'),'message':_[_0x4d71('0x4d')](_0xcf0ca5['message'],JSON['parse'](_0xcf0ca5[_0x4d71('0x6b')][_0x4d71('0x85')]))},client9002);return _0xcf0ca5;}return null;})[_0x4d71('0x22')](respondWithResult(_0x707c8e,null))[_0x4d71('0x2c')](handleError(_0x707c8e,null));}; \ No newline at end of file +var _0xb13a=['apply','save','update','sendStatus','name','send','index','map','ChatMessage','rawAttributes','type','key','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','Sequelize','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','http','client','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','end','json','offset','undefined','limit','count','status','Content-Range'];(function(_0x438dab,_0x2d002a){var _0x416056=function(_0x14715a){while(--_0x14715a){_0x438dab['push'](_0x438dab['shift']());}};_0x416056(++_0x2d002a);}(_0xb13a,0x1ee));var _0xab13=function(_0x4480a6,_0x8cd58e){_0x4480a6=_0x4480a6-0x0;var _0x162965=_0xb13a[_0x4480a6];return _0x162965;};'use strict';var emlformat=require(_0xab13('0x0'));var rimraf=require(_0xab13('0x1'));var zipdir=require(_0xab13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab13('0x3'));var moment=require(_0xab13('0x4'));var BPromise=require(_0xab13('0x5'));var Mustache=require(_0xab13('0x6'));var util=require(_0xab13('0x7'));var path=require(_0xab13('0x8'));var sox=require(_0xab13('0x9'));var csv=require(_0xab13('0xa'));var ejs=require(_0xab13('0xb'));var fs=require('fs');var fs_extra=require(_0xab13('0xc'));var _=require(_0xab13('0xd'));var squel=require('squel');var crypto=require(_0xab13('0xe'));var jsforce=require(_0xab13('0xf'));var deskjs=require(_0xab13('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab13('0x11'));var Redis=require(_0xab13('0x12'));var authService=require(_0xab13('0x13'));var qs=require(_0xab13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab13('0x15'));var logger=require(_0xab13('0x16'))(_0xab13('0x17'));var utils=require(_0xab13('0x18'));var config=require(_0xab13('0x19'));var licenseUtil=require(_0xab13('0x1a'));var db=require(_0xab13('0x1b'))['db'];config[_0xab13('0x1c')]=_[_0xab13('0x1d')](config['redis'],{'host':_0xab13('0x1e'),'port':0x18eb});var socket=require(_0xab13('0x1f'))(new Redis(config[_0xab13('0x1c')]));require(_0xab13('0x20'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xab13('0x21')]({'port':0x232c});var client9002=jayson[_0xab13('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2cfd,_0x42e85e,_0x5b9b66,_0x3cb6f4){return new BPromise(function(_0xcfb8d8,_0x4868a9){var _0x608187=_0x3cb6f4||client;return _0x608187['request'](_0x2d2cfd,_0x5b9b66)[_0xab13('0x23')](function(_0x4c8cf9){logger[_0xab13('0x24')]('ChatMessage,\x20%s,\x20%s',_0x42e85e,'request\x20sent');logger[_0xab13('0x25')](_0xab13('0x26'),_0x42e85e,_0xab13('0x27'),JSON[_0xab13('0x28')](_0x4c8cf9));if(_0x4c8cf9['error']){if(_0x4c8cf9['error'][_0xab13('0x29')]===0x1f4){logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x4c8cf9[_0xab13('0x2a')][_0xab13('0x2c')]);return _0x4868a9(_0x4c8cf9[_0xab13('0x2a')]['message']);}logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x4c8cf9[_0xab13('0x2a')][_0xab13('0x2c')]);return _0xcfb8d8(_0x4c8cf9['error'][_0xab13('0x2c')]);}else{logger['info'](_0xab13('0x2b'),_0x42e85e,_0xab13('0x27'));_0xcfb8d8(_0x4c8cf9[_0xab13('0x2d')]['message']);}})['catch'](function(_0x32f8ce){logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x32f8ce);_0x4868a9(_0x32f8ce);});});}function respondWithStatusCode(_0x16d52b,_0x5e3a5a){_0x5e3a5a=_0x5e3a5a||0xcc;return function(_0x5f38f4){if(_0x5f38f4){return _0x16d52b['sendStatus'](_0x5e3a5a);}return _0x16d52b['status'](_0x5e3a5a)[_0xab13('0x2e')]();};}function respondWithResult(_0x351126,_0x203ba6){_0x203ba6=_0x203ba6||0xc8;return function(_0x13576a){if(_0x13576a){return _0x351126['status'](_0x203ba6)[_0xab13('0x2f')](_0x13576a);}};}function respondWithFilteredResult(_0x1f8d22,_0x32703d){return function(_0x38e41a){if(_0x38e41a){var _0x33664f=typeof _0x32703d[_0xab13('0x30')]===_0xab13('0x31')&&typeof _0x32703d[_0xab13('0x32')]===_0xab13('0x31');var _0x24b5c4=_0x38e41a[_0xab13('0x33')];var _0x54a1da=_0x33664f?0x0:_0x32703d[_0xab13('0x30')];var _0x388629=_0x33664f?_0x38e41a[_0xab13('0x33')]:_0x32703d['offset']+_0x32703d[_0xab13('0x32')];var _0x59521f;if(_0x388629>=_0x24b5c4){_0x388629=_0x24b5c4;_0x59521f=0xc8;}else{_0x59521f=0xce;}_0x1f8d22[_0xab13('0x34')](_0x59521f);return _0x1f8d22['set'](_0xab13('0x35'),_0x54a1da+'-'+_0x388629+'/'+_0x24b5c4)['json'](_0x38e41a);}return null;};}function patchUpdates(_0x31a475){return function(_0x1a136f){try{jsonpatch[_0xab13('0x36')](_0x1a136f,_0x31a475,!![]);}catch(_0x358e1b){return BPromise['reject'](_0x358e1b);}return _0x1a136f[_0xab13('0x37')]();};}function saveUpdates(_0x3d14e2,_0x5cfd7a){return function(_0x47e893){if(_0x47e893){return _0x47e893[_0xab13('0x38')](_0x3d14e2)[_0xab13('0x23')](function(_0x3b81f7){return _0x3b81f7;});}return null;};}function removeEntity(_0x23a57d,_0x2546b1){return function(_0x224718){if(_0x224718){return _0x224718['destroy']()[_0xab13('0x23')](function(){_0x23a57d[_0xab13('0x34')](0xcc)[_0xab13('0x2e')]();});}};}function handleEntityNotFound(_0x32b9ea,_0x120b0e){return function(_0x401dc8){if(!_0x401dc8){_0x32b9ea[_0xab13('0x39')](0x194);}return _0x401dc8;};}function handleError(_0x70bcda,_0x543107){_0x543107=_0x543107||0x1f4;return function(_0x299f25){logger['error'](_0x299f25['stack']);if(_0x299f25[_0xab13('0x3a')]){delete _0x299f25[_0xab13('0x3a')];}_0x70bcda[_0xab13('0x34')](_0x543107)[_0xab13('0x3b')](_0x299f25);};}exports[_0xab13('0x3c')]=function(_0x55a19b,_0x59432d){var _0x5245a5={},_0x58254f={},_0x3e7461={'count':0x0,'rows':[]};var _0x2dd284=_[_0xab13('0x3d')](db[_0xab13('0x3e')][_0xab13('0x3f')],function(_0x507519){return{'name':_0x507519['fieldName'],'type':_0x507519[_0xab13('0x40')][_0xab13('0x41')]};});_0x58254f['model']=_[_0xab13('0x3d')](_0x2dd284,'name');_0x58254f['query']=_['keys'](_0x55a19b['query']);_0x58254f[_0xab13('0x42')]=_[_0xab13('0x43')](_0x58254f[_0xab13('0x44')],_0x58254f['query']);_0x5245a5[_0xab13('0x45')]=_[_0xab13('0x43')](_0x58254f['model'],qs[_0xab13('0x46')](_0x55a19b[_0xab13('0x47')][_0xab13('0x46')]));_0x5245a5[_0xab13('0x45')]=_0x5245a5[_0xab13('0x45')][_0xab13('0x48')]?_0x5245a5[_0xab13('0x45')]:_0x58254f['model'];if(!_0x55a19b['query'][_0xab13('0x49')](_0xab13('0x4a'))){_0x5245a5[_0xab13('0x32')]=qs[_0xab13('0x32')](_0x55a19b[_0xab13('0x47')][_0xab13('0x32')]);_0x5245a5[_0xab13('0x30')]=qs[_0xab13('0x30')](_0x55a19b[_0xab13('0x47')][_0xab13('0x30')]);}_0x5245a5[_0xab13('0x4b')]=qs[_0xab13('0x4c')](_0x55a19b[_0xab13('0x47')]['sort']);_0x5245a5[_0xab13('0x4d')]=qs[_0xab13('0x42')](_[_0xab13('0x4e')](_0x55a19b[_0xab13('0x47')],_0x58254f[_0xab13('0x42')]),_0x2dd284);if(_0x55a19b[_0xab13('0x47')][_0xab13('0x4f')]){_0x5245a5[_0xab13('0x4d')]=_[_0xab13('0x50')](_0x5245a5[_0xab13('0x4d')],{'$or':_[_0xab13('0x3d')](_0x2dd284,function(_0xe2558b){if(_0xe2558b[_0xab13('0x40')]!==_0xab13('0x51')){var _0x312efb={};_0x312efb[_0xe2558b[_0xab13('0x3a')]]={'$like':'%'+_0x55a19b[_0xab13('0x47')]['filter']+'%'};return _0x312efb;}})});}_0x5245a5=_[_0xab13('0x50')]({},_0x5245a5,_0x55a19b['options']);var _0x842ad8={'where':_0x5245a5[_0xab13('0x4d')]};return db[_0xab13('0x3e')]['count'](_0x842ad8)[_0xab13('0x23')](function(_0x3a2c32){_0x3e7461['count']=_0x3a2c32;if(_0x55a19b[_0xab13('0x47')][_0xab13('0x52')]){_0x5245a5[_0xab13('0x53')]=[{'all':!![]}];}return db[_0xab13('0x3e')][_0xab13('0x54')](_0x5245a5);})['then'](function(_0xc7273c){_0x3e7461[_0xab13('0x55')]=_0xc7273c;return _0x3e7461;})[_0xab13('0x23')](respondWithFilteredResult(_0x59432d,_0x5245a5))[_0xab13('0x56')](handleError(_0x59432d,null));};exports[_0xab13('0x57')]=function(_0xd24b55,_0x5abc13){var _0x427c57={'raw':!![],'where':{'id':_0xd24b55[_0xab13('0x58')]['id']}},_0x42914a={};_0x42914a[_0xab13('0x44')]=_[_0xab13('0x59')](db[_0xab13('0x3e')][_0xab13('0x3f')]);_0x42914a[_0xab13('0x47')]=_[_0xab13('0x59')](_0xd24b55[_0xab13('0x47')]);_0x42914a[_0xab13('0x42')]=_[_0xab13('0x43')](_0x42914a[_0xab13('0x44')],_0x42914a[_0xab13('0x47')]);_0x427c57['attributes']=_[_0xab13('0x43')](_0x42914a[_0xab13('0x44')],qs['fields'](_0xd24b55[_0xab13('0x47')]['fields']));_0x427c57[_0xab13('0x45')]=_0x427c57['attributes']['length']?_0x427c57[_0xab13('0x45')]:_0x42914a[_0xab13('0x44')];if(_0xd24b55[_0xab13('0x47')][_0xab13('0x52')]){_0x427c57[_0xab13('0x53')]=[{'all':!![]}];}_0x427c57=_[_0xab13('0x50')]({},_0x427c57,_0xd24b55[_0xab13('0x5a')]);return db[_0xab13('0x3e')][_0xab13('0x5b')](_0x427c57)[_0xab13('0x23')](handleEntityNotFound(_0x5abc13,null))[_0xab13('0x23')](respondWithResult(_0x5abc13,null))[_0xab13('0x56')](handleError(_0x5abc13,null));};exports[_0xab13('0x5c')]=function(_0x31390b,_0x5b514e){return db[_0xab13('0x3e')][_0xab13('0x5c')](_0x31390b[_0xab13('0x5d')],{})[_0xab13('0x23')](respondWithResult(_0x5b514e,0xc9))['catch'](handleError(_0x5b514e,null));};exports['update']=function(_0x21394d,_0x27731a){if(_0x21394d['body']['id']){delete _0x21394d[_0xab13('0x5d')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x21394d['params']['id']}})[_0xab13('0x23')](handleEntityNotFound(_0x27731a,null))[_0xab13('0x23')](saveUpdates(_0x21394d[_0xab13('0x5d')],null))['then'](respondWithResult(_0x27731a,null))[_0xab13('0x56')](handleError(_0x27731a,null));};exports['destroy']=function(_0x1b9adc,_0x133437){return db['ChatMessage'][_0xab13('0x5b')]({'where':{'id':_0x1b9adc[_0xab13('0x58')]['id']}})['then'](handleEntityNotFound(_0x133437,null))[_0xab13('0x23')](removeEntity(_0x133437,null))[_0xab13('0x56')](handleError(_0x133437,null));};exports['describe']=function(_0x305792,_0x4ae8fb){return db['ChatMessage']['describe']()[_0xab13('0x23')](respondWithResult(_0x4ae8fb,null))['catch'](handleError(_0x4ae8fb,null));};var interaction_log=require(_0xab13('0x16'))('chat-interactions');exports['accept']=function(_0x431eac,_0x542ae8,_0x3b5f16){var _0x2ab668={'agent':{},'channel':_0xab13('0x5e')};if(_0x431eac[_0xab13('0x5d')]['id']){delete _0x431eac['body']['id'];}_0x431eac['body'][_0xab13('0x5f')]=!![];_0x431eac[_0xab13('0x5d')][_0xab13('0x60')]=moment()['format'](_0xab13('0x61'));_0x431eac[_0xab13('0x5d')]['UserId']=_0x431eac['body'][_0xab13('0x62')]||_0x431eac[_0xab13('0x63')]['id'];_0x2ab668['agent']['id']=_0x431eac[_0xab13('0x5d')][_0xab13('0x62')];return db['ChatMessage'][_0xab13('0x5b')]({'where':{'id':_0x431eac[_0xab13('0x58')]['id'],'UserId':null}})[_0xab13('0x23')](handleEntityNotFound(_0x542ae8,null))[_0xab13('0x23')](saveUpdates(_0x431eac['body'],null))['then'](function(_0x4649e9){if(_0x4649e9){_0x2ab668[_0xab13('0x2c')]=_0x4649e9['get']({'plain':!![]});return db[_0xab13('0x64')][_0xab13('0x5b')]({'where':{'id':_0x4649e9[_0xab13('0x65')]}});}return null;})[_0xab13('0x23')](handleEntityNotFound(_0x542ae8,null))[_0xab13('0x23')](function(_0x214338){if(_0x214338){return _0x214338[_0xab13('0x38')]({'UserId':_0x431eac['body']['UserId'],'read1stAt':_[_0xab13('0x66')](_0x214338[_0xab13('0x67')])?moment()['format'](_0xab13('0x61')):undefined});}return null;})[_0xab13('0x23')](function(_0xf9b0cf){if(_0xf9b0cf){_0x2ab668[_0xab13('0x68')]=_0xf9b0cf['get']({'plain':!![]});interaction_log['info'](_0xab13('0x69'),_0x431eac[_0xab13('0x63')]['id'],_0x431eac[_0xab13('0x63')][_0xab13('0x3a')],_0x431eac[_0xab13('0x63')][_0xab13('0x6a')],_0x2ab668[_0xab13('0x68')]['id'],_0x431eac[_0xab13('0x5d')]?JSON['stringify'](_0x431eac['body']):_0xab13('0x6b'));return respondWithRpcPromise(_0xab13('0x6c'),_0xab13('0x6d'),_0x2ab668);}return null;})['then'](function(_0x5041f6){var _0xb0b8ec=_0xab13('0x6e')+_0x5041f6[_0xab13('0x2c')]['ContactId'];return db['sequelize']['query'](_0xb0b8ec,{'type':db['Sequelize'][_0xab13('0x6f')][_0xab13('0x70')],'raw':!![]})[_0xab13('0x23')](function(_0x723896){return _0x723896;});})[_0xab13('0x23')](function(_0x358758){if(_0x358758){_0x2ab668[_0xab13('0x2c')][_0xab13('0x71')]=_0x358758[0x0];if(!_0x431eac[_0xab13('0x5d')][_0xab13('0x62')])return;return db[_0xab13('0x72')][_0xab13('0x5b')]({'where':{'id':_0x431eac[_0xab13('0x5d')][_0xab13('0x62')],'role':_0xab13('0x73')},'attributes':['id','name',_0xab13('0x74'),_0xab13('0x75'),_0xab13('0x76')],'raw':!![]});}return null;})[_0xab13('0x23')](function(_0x4e9ef6){if(!_0x4e9ef6)return null;_0x2ab668[_0xab13('0x2c')][_0xab13('0x73')]=_0x4e9ef6;return _0x2ab668;})[_0xab13('0x23')](function(_0x153717){if(_0x153717){if(_0x431eac[_0xab13('0x5d')][_0xab13('0x77')]){_0x2ab668[_0xab13('0x2c')]['interface']=util['format']('SIP/%s',_0x431eac[_0xab13('0x63')][_0xab13('0x3a')]);_0x2ab668[_0xab13('0x2c')][_0xab13('0x78')]=_0x2ab668['channel'];_0x2ab668[_0xab13('0x2c')][_0xab13('0x79')]=_0x2ab668[_0xab13('0x78')];_0x2ab668[_0xab13('0x2c')][_0xab13('0x7a')]=_0xab13('0x7b');return respondWithRpcPromise(_0xab13('0x7c'),'EventManager',{'event':_0xab13('0x7d'),'message':_[_0xab13('0x50')](_0x2ab668[_0xab13('0x2c')],JSON[_0xab13('0x7e')](_0x2ab668[_0xab13('0x68')][_0xab13('0x7f')]))},client9002)[_0xab13('0x23')](function(){return _0x2ab668;});}return _0x2ab668;}return null;})[_0xab13('0x23')](respondWithResult(_0x542ae8,null))[_0xab13('0x56')](handleError(_0x542ae8,null));};var interaction_log=require(_0xab13('0x16'))(_0xab13('0x80'));exports['reject']=function(_0x571d49,_0xbde7b4,_0x2de912){var _0x57ee36={'agent':{},'channel':_0xab13('0x5e')};if(_0x571d49[_0xab13('0x5d')]['id']){delete _0x571d49[_0xab13('0x5d')]['id'];}_0x571d49[_0xab13('0x5d')][_0xab13('0x62')]=_0x571d49[_0xab13('0x5d')][_0xab13('0x62')]||_0x571d49[_0xab13('0x63')]['id'];_0x57ee36[_0xab13('0x73')]['id']=_0x571d49[_0xab13('0x5d')][_0xab13('0x62')];return db[_0xab13('0x3e')][_0xab13('0x5b')]({'where':{'id':_0x571d49[_0xab13('0x58')]['id'],'UserId':null}})[_0xab13('0x23')](handleEntityNotFound(_0xbde7b4,null))['then'](function(_0x117dec){if(_0x117dec){_0x57ee36[_0xab13('0x2c')]=_0x117dec[_0xab13('0x81')]({'plain':!![]});return db[_0xab13('0x64')][_0xab13('0x5b')]({'where':{'id':_0x117dec[_0xab13('0x65')]}});}return null;})[_0xab13('0x23')](handleEntityNotFound(_0xbde7b4,null))[_0xab13('0x23')](function(_0x3a1dc3){if(_0x3a1dc3){_0x57ee36['interaction']=_0x3a1dc3[_0xab13('0x81')]({'plain':!![]});interaction_log[_0xab13('0x24')](_0xab13('0x82'),_0x571d49[_0xab13('0x63')]['id'],_0x571d49[_0xab13('0x63')][_0xab13('0x3a')],_0x571d49[_0xab13('0x63')][_0xab13('0x6a')],_0x57ee36[_0xab13('0x68')]['id'],_0x571d49['body']?JSON[_0xab13('0x28')](_0x571d49[_0xab13('0x5d')]):'null');return respondWithRpcPromise(_0xab13('0x83'),'rejectMessage',_0x57ee36);}return null;})[_0xab13('0x23')](function(_0x26613e){var _0x389b58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26613e[_0xab13('0x2c')][_0xab13('0x84')];return db[_0xab13('0x85')][_0xab13('0x47')](_0x389b58,{'type':db[_0xab13('0x86')][_0xab13('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x4dbe30){return _0x4dbe30;});})[_0xab13('0x23')](function(_0x113459){if(_0x113459){_0x57ee36[_0xab13('0x2c')][_0xab13('0x71')]=_0x113459[0x0];if(!_0x571d49[_0xab13('0x5d')]['UserId'])return;return db['User']['find']({'where':{'id':_0x571d49[_0xab13('0x5d')][_0xab13('0x62')],'role':_0xab13('0x73')},'attributes':['id',_0xab13('0x3a'),_0xab13('0x74'),_0xab13('0x75'),_0xab13('0x76')],'raw':!![]});}return null;})['then'](function(_0x33d718){if(!_0x33d718)return null;_0x57ee36[_0xab13('0x2c')][_0xab13('0x73')]=_0x33d718;return _0x57ee36;})[_0xab13('0x23')](function(_0x88cd6c){if(_0x88cd6c){_0x88cd6c[_0xab13('0x2c')][_0xab13('0x87')]=util['format']('SIP/%s',_0x571d49[_0xab13('0x63')][_0xab13('0x3a')]);_0x88cd6c[_0xab13('0x2c')]['channel']=_0x57ee36[_0xab13('0x78')];_0x88cd6c['message'][_0xab13('0x79')]=_0x57ee36[_0xab13('0x78')];_0x88cd6c[_0xab13('0x2c')]['event']='reject';respondWithRpcPromise(_0xab13('0x7c'),_0xab13('0x7c'),{'event':_0xab13('0x88'),'message':_['merge'](_0x57ee36[_0xab13('0x2c')],JSON[_0xab13('0x7e')](_0x57ee36[_0xab13('0x68')][_0xab13('0x7f')]))},client9002);return _0x57ee36;}return null;})['then'](respondWithResult(_0xbde7b4,null))[_0xab13('0x56')](handleError(_0xbde7b4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index e026382..c91aa73 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 _0x1efc=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x2621f0,_0x509108){var _0x55e12c=function(_0x4b13eb){while(--_0x4b13eb){_0x2621f0['push'](_0x2621f0['shift']());}};_0x55e12c(++_0x509108);}(_0x1efc,0x1a1));var _0xc1ef=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x1efc[_0x45fe9c];return _0x233d48;};'use strict';var EventEmitter=require(_0xc1ef('0x0'));var ChatMessage=require(_0xc1ef('0x1'))['db'][_0xc1ef('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc1ef('0x3')](0x0);var events={'afterCreate':_0xc1ef('0x4'),'afterUpdate':_0xc1ef('0x5'),'afterDestroy':_0xc1ef('0x6')};function emitEvent(_0x1621c8){return function(_0xf18497,_0x49ba85,_0xc6a863){ChatMessageEvents['emit'](_0x1621c8+':'+_0xf18497['id'],_0xf18497);ChatMessageEvents[_0xc1ef('0x7')](_0x1621c8,_0xf18497);_0xc6a863(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc1ef('0x8')](e,emitEvent(event));}}module[_0xc1ef('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x3b59=['hook','exports','events','../../mysqldb','ChatMessage','save','remove','emit'];(function(_0x31fc7d,_0x1b97e5){var _0x50b1bb=function(_0x506980){while(--_0x506980){_0x31fc7d['push'](_0x31fc7d['shift']());}};_0x50b1bb(++_0x1b97e5);}(_0x3b59,0xb2));var _0x93b5=function(_0x3f7a85,_0x165430){_0x3f7a85=_0x3f7a85-0x0;var _0x3bddbd=_0x3b59[_0x3f7a85];return _0x3bddbd;};'use strict';var EventEmitter=require(_0x93b5('0x0'));var ChatMessage=require(_0x93b5('0x1'))['db'][_0x93b5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93b5('0x3'),'afterUpdate':'update','afterDestroy':_0x93b5('0x4')};function emitEvent(_0xb42f55){return function(_0x166110,_0x3280e4,_0x109e73){ChatMessageEvents['emit'](_0xb42f55+':'+_0x166110['id'],_0x166110);ChatMessageEvents[_0x93b5('0x5')](_0xb42f55,_0x166110);_0x109e73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x93b5('0x6')](e,emitEvent(event));}}module[_0x93b5('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index ca02dcc..8a71839 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 _0x6666=['lodash','bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','toLowerCase','out','secret','findOne','then','createdAt','direction','catch','error'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x6666,0x6e));var _0x6666=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x6666[_0xc7348b];return _0x307cec;};'use strict';var _=require(_0x6666('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6666('0x1'));var rp=require(_0x6666('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6666('0x3'));var attributes=require(_0x6666('0x4'));module[_0x6666('0x5')]=function(_0x1cf748,_0xfb7053){return _0x1cf748[_0x6666('0x6')](_0x6666('0x7'),attributes,{'tableName':_0x6666('0x8'),'paranoid':![],'indexes':[{'name':_0x6666('0x9'),'fields':['body'],'type':_0x6666('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42ec03,_0x20b6fe,_0x504ee4){var _0x5c74e0=_0x1cf748[_0x6666('0xb')];var _0x5e1ba9=_0x42ec03[_0x6666('0xc')]({'plain':!![]});if(_0x5e1ba9['direction'][_0x6666('0xd')]()==='in'||_0x5e1ba9['direction'][_0x6666('0xd')]()===_0x6666('0xe')&&!_0x5e1ba9[_0x6666('0xf')]&&!_['isNil'](_0x5e1ba9['UserId'])){_0x5c74e0['ChatInteraction'][_0x6666('0x10')]({'where':{'id':_0x5e1ba9['ChatInteractionId']}})[_0x6666('0x11')](function(_0x43e04d){if(_0x43e04d){_0x43e04d['update']({'lastMsgAt':_0x5e1ba9[_0x6666('0x12')],'lastMsgDirection':_0x5e1ba9[_0x6666('0x13')][_0x6666('0xd')]()});}})[_0x6666('0x14')](function(_0x181358){console[_0x6666('0x15')](_0x181358);});}_0x504ee4();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x048f=['isNil','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','toLowerCase','direction','out'];(function(_0x21322f,_0x483b21){var _0x33e9d1=function(_0x24b3c5){while(--_0x24b3c5){_0x21322f['push'](_0x21322f['shift']());}};_0x33e9d1(++_0x483b21);}(_0x048f,0xcd));var _0xf048=function(_0x3d91a1,_0x35073a){_0x3d91a1=_0x3d91a1-0x0;var _0x1c2f8f=_0x048f[_0x3d91a1];return _0x1c2f8f;};'use strict';var _=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var logger=require(_0xf048('0x2'))(_0xf048('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf048('0x4'));var fs=require('fs');var path=require(_0xf048('0x5'));var rimraf=require(_0xf048('0x6'));var config=require(_0xf048('0x7'));var attributes=require(_0xf048('0x8'));module[_0xf048('0x9')]=function(_0x766333,_0xa9a18b){return _0x766333[_0xf048('0xa')](_0xf048('0xb'),attributes,{'tableName':_0xf048('0xc'),'paranoid':![],'indexes':[{'name':_0xf048('0xd'),'fields':['body'],'type':_0xf048('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x513f6c,_0x3faa04,_0x2a160c){var _0x477835=_0x766333[_0xf048('0xf')];var _0x34e4f9=_0x513f6c['get']({'plain':!![]});if(_0x34e4f9['direction'][_0xf048('0x10')]()==='in'||_0x34e4f9[_0xf048('0x11')][_0xf048('0x10')]()===_0xf048('0x12')&&!_0x34e4f9['secret']&&!_[_0xf048('0x13')](_0x34e4f9['UserId'])){_0x477835[_0xf048('0x14')][_0xf048('0x15')]({'where':{'id':_0x34e4f9[_0xf048('0x16')]}})[_0xf048('0x17')](function(_0x202932){if(_0x202932){_0x202932['update']({'lastMsgAt':_0x34e4f9['createdAt'],'lastMsgDirection':_0x34e4f9['direction'][_0xf048('0x10')]()});}})[_0xf048('0x18')](function(_0x53f2a5){console[_0xf048('0x19')](_0x53f2a5);});}_0x2a160c();}},'charset':_0xf048('0x1a'),'collate':_0xf048('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 5bc9a12..68552c7 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 _0xbb17=['then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x5b44f9,_0x4dd04a){var _0x3c402d=function(_0x193633){while(--_0x193633){_0x5b44f9['push'](_0x5b44f9['shift']());}};_0x3c402d(++_0x4dd04a);}(_0xbb17,0x142));var _0x7bb1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbb17[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7bb1('0x0'));var util=require(_0x7bb1('0x1'));var moment=require(_0x7bb1('0x2'));var BPromise=require(_0x7bb1('0x3'));var rs=require(_0x7bb1('0x4'));var fs=require('fs');var Redis=require(_0x7bb1('0x5'));var db=require(_0x7bb1('0x6'))['db'];var utils=require(_0x7bb1('0x7'));var logger=require(_0x7bb1('0x8'))('rpc');var config=require(_0x7bb1('0x9'));var jayson=require(_0x7bb1('0xa'));var client=jayson['client'][_0x7bb1('0xb')]({'port':0x232a});config[_0x7bb1('0xc')]=_[_0x7bb1('0xd')](config['redis'],{'host':_0x7bb1('0xe'),'port':0x18eb});var socket=require(_0x7bb1('0xf'))(new Redis(config['redis']));require(_0x7bb1('0x10'))[_0x7bb1('0x11')](socket);function respondWithRpcPromise(_0x11a75d,_0x3d8aaa,_0x29b4e5){return new BPromise(function(_0xb6dee5,_0x1247f0){return client['request'](_0x11a75d,_0x29b4e5)[_0x7bb1('0x12')](function(_0x2fcfa0){logger[_0x7bb1('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3d8aaa,_0x7bb1('0x14'));logger[_0x7bb1('0x15')](_0x7bb1('0x16'),_0x3d8aaa,_0x7bb1('0x14'),JSON['stringify'](_0x2fcfa0));if(_0x2fcfa0[_0x7bb1('0x17')]){if(_0x2fcfa0['error'][_0x7bb1('0x18')]===0x1f4){logger[_0x7bb1('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3d8aaa,_0x2fcfa0['error']['message']);return _0x1247f0(_0x2fcfa0[_0x7bb1('0x17')]['message']);}logger[_0x7bb1('0x17')](_0x7bb1('0x19'),_0x3d8aaa,_0x2fcfa0[_0x7bb1('0x17')][_0x7bb1('0x1a')]);return _0xb6dee5(_0x2fcfa0[_0x7bb1('0x17')][_0x7bb1('0x1a')]);}else{logger[_0x7bb1('0x13')](_0x7bb1('0x19'),_0x3d8aaa,'request\x20sent');_0xb6dee5(_0x2fcfa0['result'][_0x7bb1('0x1a')]);}})[_0x7bb1('0x1b')](function(_0xa0c864){logger[_0x7bb1('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3d8aaa,_0xa0c864);_0x1247f0(_0xa0c864);});});}exports[_0x7bb1('0x1c')]=function(_0x3c6754){var _0x22da43=this;return new Promise(function(_0x16462f,_0xf17dc2){return db[_0x7bb1('0x1d')]['create'](_0x3c6754[_0x7bb1('0x1e')],{'raw':_0x3c6754[_0x7bb1('0x1f')]?_0x3c6754['options'][_0x7bb1('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x5c482f){logger['info'](_0x7bb1('0x1c'),_0x3c6754);logger[_0x7bb1('0x15')](_0x7bb1('0x1c'),_0x3c6754,JSON[_0x7bb1('0x21')](_0x5c482f));_0x16462f(_0x5c482f);})[_0x7bb1('0x1b')](function(_0x30b658){logger['error'](_0x7bb1('0x1c'),_0x30b658[_0x7bb1('0x1a')],_0x3c6754);_0xf17dc2(_0x22da43['error'](0x1f4,_0x30b658[_0x7bb1('0x1a')]));});});}; \ No newline at end of file +var _0x427e=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x78d885,_0x19dec7){var _0x317585=function(_0x3da287){while(--_0x3da287){_0x78d885['push'](_0x78d885['shift']());}};_0x317585(++_0x19dec7);}(_0x427e,0x11a));var _0xe427=function(_0x108c50,_0x1d4f5e){_0x108c50=_0x108c50-0x0;var _0x12b058=_0x427e[_0x108c50];return _0x12b058;};'use strict';var _=require(_0xe427('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe427('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe427('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe427('0x3'))(_0xe427('0x4'));var config=require('../../config/environment');var jayson=require(_0xe427('0x5'));var client=jayson[_0xe427('0x6')][_0xe427('0x7')]({'port':0x232a});config[_0xe427('0x8')]=_[_0xe427('0x9')](config[_0xe427('0x8')],{'host':_0xe427('0xa'),'port':0x18eb});var socket=require(_0xe427('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe427('0xc')](socket);function respondWithRpcPromise(_0x1416b6,_0x381c7f,_0x25a1bc){return new BPromise(function(_0x3b3f9d,_0x2aecd7){return client[_0xe427('0xd')](_0x1416b6,_0x25a1bc)[_0xe427('0xe')](function(_0x5f2fad){logger['info'](_0xe427('0xf'),_0x381c7f,_0xe427('0x10'));logger['debug'](_0xe427('0x11'),_0x381c7f,_0xe427('0x10'),JSON[_0xe427('0x12')](_0x5f2fad));if(_0x5f2fad[_0xe427('0x13')]){if(_0x5f2fad[_0xe427('0x13')][_0xe427('0x14')]===0x1f4){logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x5f2fad[_0xe427('0x13')]['message']);return _0x2aecd7(_0x5f2fad['error'][_0xe427('0x15')]);}logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x5f2fad['error'][_0xe427('0x15')]);return _0x3b3f9d(_0x5f2fad[_0xe427('0x13')][_0xe427('0x15')]);}else{logger[_0xe427('0x16')](_0xe427('0xf'),_0x381c7f,'request\x20sent');_0x3b3f9d(_0x5f2fad[_0xe427('0x17')][_0xe427('0x15')]);}})[_0xe427('0x18')](function(_0x58637e){logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x58637e);_0x2aecd7(_0x58637e);});});}exports[_0xe427('0x19')]=function(_0x1c49dc){var _0x5bc6ac=this;return new Promise(function(_0x5b1ef9,_0x219dde){return db[_0xe427('0x1a')][_0xe427('0x1b')](_0x1c49dc[_0xe427('0x1c')],{'raw':_0x1c49dc[_0xe427('0x1d')]?_0x1c49dc[_0xe427('0x1d')][_0xe427('0x1e')]===undefined?!![]:![]:!![]})[_0xe427('0xe')](function(_0x283bc4){logger['info'](_0xe427('0x19'),_0x1c49dc);logger[_0xe427('0x1f')](_0xe427('0x19'),_0x1c49dc,JSON[_0xe427('0x12')](_0x283bc4));_0x5b1ef9(_0x283bc4);})[_0xe427('0x18')](function(_0x90c4ce){logger['error'](_0xe427('0x19'),_0x90c4ce[_0xe427('0x15')],_0x1c49dc);_0x219dde(_0x5bc6ac['error'](0x1f4,_0x90c4ce[_0xe427('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 6779994..de89a6f 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 _0x7da7=['save','remove','register','chatMessage:','./chatMessage.events'];(function(_0x53ea96,_0x304e0e){var _0x4fdf7a=function(_0x491528){while(--_0x491528){_0x53ea96['push'](_0x53ea96['shift']());}};_0x4fdf7a(++_0x304e0e);}(_0x7da7,0x10d));var _0x77da=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0x7da7[_0x301dab];return _0x2500a2;};'use strict';var ChatMessageEvents=require(_0x77da('0x0'));var events=[_0x77da('0x1'),_0x77da('0x2'),'update'];function createListener(_0x59892b,_0x37667b){return function(_0xaaefb1){_0x37667b['emit'](_0x59892b,_0xaaefb1);};}function removeListener(_0x3a9fa6,_0x37b3d9){return function(){ChatMessageEvents['removeListener'](_0x3a9fa6,_0x37b3d9);};}exports[_0x77da('0x3')]=function(_0xc54a12){for(var _0x47da81=0x0,_0x30afe0=events['length'];_0x47da81<_0x30afe0;_0x47da81++){var _0x1191de=events[_0x47da81];var _0x13992e=createListener(_0x77da('0x4')+_0x1191de,_0xc54a12);ChatMessageEvents['on'](_0x1191de,_0x13992e);}}; \ No newline at end of file +var _0x10af=['./chatMessage.events','remove','update','emit','register','length','chatMessage:'];(function(_0x37d6d4,_0x143af3){var _0x179d36=function(_0x4be729){while(--_0x4be729){_0x37d6d4['push'](_0x37d6d4['shift']());}};_0x179d36(++_0x143af3);}(_0x10af,0xfc));var _0xf10a=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x10af[_0xac151d];return _0x111dba;};'use strict';var ChatMessageEvents=require(_0xf10a('0x0'));var events=['save',_0xf10a('0x1'),_0xf10a('0x2')];function createListener(_0x1e42f5,_0x211890){return function(_0x453e1a){_0x211890[_0xf10a('0x3')](_0x1e42f5,_0x453e1a);};}function removeListener(_0xbffc71,_0x13b338){return function(){ChatMessageEvents['removeListener'](_0xbffc71,_0x13b338);};}exports[_0xf10a('0x4')]=function(_0xf86ea1){for(var _0x5c9a4c=0x0,_0x4cd7e4=events[_0xf10a('0x5')];_0x5c9a4c<_0x4cd7e4;_0x5c9a4c++){var _0x1563fb=events[_0x5c9a4c];var _0x2ade36=createListener(_0xf10a('0x6')+_0x1563fb,_0xf86ea1);ChatMessageEvents['on'](_0x1563fb,_0x2ade36);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6454400..87805af 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 _0xa6aa=['accept','reject','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','post','chat','chatmessage:create','create','update','put','/:id/accept'];(function(_0x116b9f,_0x420014){var _0x54add5=function(_0x219528){while(--_0x219528){_0x116b9f['push'](_0x116b9f['shift']());}};_0x54add5(++_0x420014);}(_0xa6aa,0x1c6));var _0xaa6a=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xa6aa[_0x2f9467];return _0x39894c;};'use strict';var multer=require(_0xaa6a('0x0'));var util=require(_0xaa6a('0x1'));var path=require(_0xaa6a('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa6a('0x3'));var router=express[_0xaa6a('0x4')]();var fs_extra=require(_0xaa6a('0x5'));var auth=require(_0xaa6a('0x6'));var interaction=require(_0xaa6a('0x7'));var config=require('../../config/environment');var controller=require(_0xaa6a('0x8'));router[_0xaa6a('0x9')]('/',auth[_0xaa6a('0xa')](),controller[_0xaa6a('0xb')]);router['get'](_0xaa6a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xaa6a('0x9')](_0xaa6a('0xd'),auth[_0xaa6a('0xa')](),controller['show']);router[_0xaa6a('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xaa6a('0xf'),_0xaa6a('0x10')),controller[_0xaa6a('0x11')]);router['put'](_0xaa6a('0xd'),controller[_0xaa6a('0x12')]);router[_0xaa6a('0x13')](_0xaa6a('0x14'),auth[_0xaa6a('0xa')](),controller[_0xaa6a('0x15')]);router[_0xaa6a('0x13')]('/:id/reject',auth[_0xaa6a('0xa')](),controller[_0xaa6a('0x16')]);router[_0xaa6a('0x17')](_0xaa6a('0xd'),auth[_0xaa6a('0xa')](),controller['destroy']);module[_0xaa6a('0x18')]=router; \ No newline at end of file +var _0x2d1b=['get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x2d1b,0x12b));var _0xb2d1=function(_0x1b04d2,_0x43190c){_0x1b04d2=_0x1b04d2-0x0;var _0x95da=_0x2d1b[_0x1b04d2];return _0x95da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2d1('0x0'));var timeout=require(_0xb2d1('0x1'));var express=require(_0xb2d1('0x2'));var router=express[_0xb2d1('0x3')]();var fs_extra=require(_0xb2d1('0x4'));var auth=require(_0xb2d1('0x5'));var interaction=require(_0xb2d1('0x6'));var config=require(_0xb2d1('0x7'));var controller=require(_0xb2d1('0x8'));router[_0xb2d1('0x9')]('/',auth[_0xb2d1('0xa')](),controller[_0xb2d1('0xb')]);router['get'](_0xb2d1('0xc'),auth['isAuthenticated'](),controller[_0xb2d1('0xd')]);router[_0xb2d1('0x9')](_0xb2d1('0xe'),auth['isAuthenticated'](),controller[_0xb2d1('0xf')]);router[_0xb2d1('0x10')]('/',auth['isAuthenticated'](),interaction[_0xb2d1('0x11')]('chat',_0xb2d1('0x12')),controller[_0xb2d1('0x13')]);router[_0xb2d1('0x14')]('/:id',controller['update']);router[_0xb2d1('0x14')](_0xb2d1('0x15'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x16')]);router[_0xb2d1('0x14')](_0xb2d1('0x17'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x18')]);router[_0xb2d1('0x19')](_0xb2d1('0xe'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x1a')]);module[_0xb2d1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 2eb17f1..5b78079 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['medium','TEXT','exports'];(function(_0x517650,_0x30f19b){var _0x43ecfd=function(_0x3de775){while(--_0x3de775){_0x517650['push'](_0x517650['shift']());}};_0x43ecfd(++_0x30f19b);}(_0xadb5,0xad));var _0x5adb=function(_0x469805,_0x16f6b4){_0x469805=_0x469805-0x0;var _0xa82657=_0xadb5[_0x469805];return _0xa82657;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x3a7941,_0x55edac){var _0x1aa996=function(_0x3a3d50){while(--_0x3a3d50){_0x3a7941['push'](_0x3a7941['shift']());}};_0x1aa996(++_0x55edac);}(_0x2032,0xd9));var _0x2203=function(_0x44827b,_0x19bce6){_0x44827b=_0x44827b-0x0;var _0x63346b=_0x2032[_0x44827b];return _0x63346b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a69d02d..e14d4c9 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(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7a54,0x106));var _0x47a5=function(_0x40f720,_0xc84a6e){_0x40f720=_0x40f720-0x0;var _0x12b1e2=_0x7a54[_0x40f720];return _0x12b1e2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5a73ad,_0x2a42fb){var _0x35cffc=function(_0x4dec93){while(--_0x4dec93){_0x5a73ad['push'](_0x5a73ad['shift']());}};_0x35cffc(++_0x2a42fb);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index b22e5a4..8880626 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 _0xd51b=['emit','hook','exports','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x425dd8,_0x8d4aef){var _0x2671aa=function(_0x509147){while(--_0x509147){_0x425dd8['push'](_0x425dd8['shift']());}};_0x2671aa(++_0x8d4aef);}(_0xd51b,0xe3));var _0xbd51=function(_0x35452d,_0x4587e0){_0x35452d=_0x35452d-0x0;var _0x3cacc7=_0xd51b[_0x35452d];return _0x3cacc7;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0xbd51('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xbd51('0x1')](0x0);var events={'afterCreate':_0xbd51('0x2'),'afterUpdate':_0xbd51('0x3'),'afterDestroy':_0xbd51('0x4')};function emitEvent(_0xd09c43){return function(_0x5a5512,_0x208d78,_0x2c70db){ChatOfflineMessageEvents[_0xbd51('0x5')](_0xd09c43+':'+_0x5a5512['id'],_0x5a5512);ChatOfflineMessageEvents[_0xbd51('0x5')](_0xd09c43,_0x5a5512);_0x2c70db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xbd51('0x6')](e,emitEvent(event));}}module[_0xbd51('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x49b9=['hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x49b9,0xaa));var _0x949b=function(_0x19901f,_0x52bc26){_0x19901f=_0x19901f-0x0;var _0x12b88a=_0x49b9[_0x19901f];return _0x12b88a;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x949b('0x0'))['db'][_0x949b('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x949b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x949b('0x3'),'afterDestroy':_0x949b('0x4')};function emitEvent(_0x1ded3c){return function(_0x1e77d1,_0x202b64,_0x134f2b){ChatOfflineMessageEvents[_0x949b('0x5')](_0x1ded3c+':'+_0x1e77d1['id'],_0x1e77d1);ChatOfflineMessageEvents[_0x949b('0x5')](_0x1ded3c,_0x1e77d1);_0x134f2b(null);};}for(var e in events){if(events[_0x949b('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x949b('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 48f3904..4b865a4 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 _0xc003=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0xc003,0x106));var _0x3c00=function(_0x3c0aa8,_0x46552e){_0x3c0aa8=_0x3c0aa8-0x0;var _0x4b89be=_0xc003[_0x3c0aa8];return _0x4b89be;};'use strict';var attributes=require(_0x3c00('0x0'));module[_0x3c00('0x1')]=function(_0x355712){return _0x355712[_0x3c00('0x2')](_0x3c00('0x3'),attributes,{'tableName':_0x3c00('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3c00('0x5')});}; \ No newline at end of file +var _0x5ae4=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x5ae4,0x12f));var _0x45ae=function(_0x35e5dd,_0x1ffea9){_0x35e5dd=_0x35e5dd-0x0;var _0xa8bef7=_0x5ae4[_0x35e5dd];return _0xa8bef7;};'use strict';var attributes=require(_0x45ae('0x0'));module[_0x45ae('0x1')]=function(_0x2e76dc){return _0x2e76dc['define']('ChatOfflineMessage',attributes,{'tableName':_0x45ae('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45ae('0x3'),'collate':_0x45ae('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7640870..c640954 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 _0xc83b=['info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc83b,0xa4));var _0xbc83=function(_0x4b3fa1,_0x497557){_0x4b3fa1=_0x4b3fa1-0x0;var _0x3a9c0a=_0xc83b[_0x4b3fa1];return _0x3a9c0a;};'use strict';var _=require(_0xbc83('0x0'));var util=require(_0xbc83('0x1'));var moment=require(_0xbc83('0x2'));var BPromise=require(_0xbc83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc83('0x4'));var db=require(_0xbc83('0x5'))['db'];var utils=require(_0xbc83('0x6'));var logger=require(_0xbc83('0x7'))(_0xbc83('0x8'));var config=require('../../config/environment');var jayson=require(_0xbc83('0x9'));var client=jayson[_0xbc83('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109543,_0xa2ac6f,_0x5447f8){return new BPromise(function(_0x285181,_0x425179){return client['request'](_0x109543,_0x5447f8)[_0xbc83('0xb')](function(_0x4101e6){logger[_0xbc83('0xc')](_0xbc83('0xd'),_0xa2ac6f,'request\x20sent');logger[_0xbc83('0xe')](_0xbc83('0xf'),_0xa2ac6f,'request\x20sent',JSON['stringify'](_0x4101e6));if(_0x4101e6[_0xbc83('0x10')]){if(_0x4101e6[_0xbc83('0x10')][_0xbc83('0x11')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xa2ac6f,_0x4101e6[_0xbc83('0x10')]['message']);return _0x425179(_0x4101e6[_0xbc83('0x10')][_0xbc83('0x12')]);}logger['error'](_0xbc83('0xd'),_0xa2ac6f,_0x4101e6[_0xbc83('0x10')][_0xbc83('0x12')]);return _0x285181(_0x4101e6[_0xbc83('0x10')][_0xbc83('0x12')]);}else{logger[_0xbc83('0xc')](_0xbc83('0xd'),_0xa2ac6f,_0xbc83('0x13'));_0x285181(_0x4101e6[_0xbc83('0x14')]['message']);}})[_0xbc83('0x15')](function(_0xd2f722){logger[_0xbc83('0x10')](_0xbc83('0xd'),_0xa2ac6f,_0xd2f722);_0x425179(_0xd2f722);});});} \ No newline at end of file +var _0x63b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x63b7,0x1e2));var _0x763b=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x63b7[_0x4fbb15];return _0x436338;};'use strict';var _=require('lodash');var util=require(_0x763b('0x0'));var moment=require('moment');var BPromise=require(_0x763b('0x1'));var rs=require(_0x763b('0x2'));var fs=require('fs');var Redis=require(_0x763b('0x3'));var db=require(_0x763b('0x4'))['db'];var utils=require(_0x763b('0x5'));var logger=require('../../config/logger')(_0x763b('0x6'));var config=require(_0x763b('0x7'));var jayson=require(_0x763b('0x8'));var client=jayson['client'][_0x763b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe9cf0,_0x464ab0,_0x218a1f){return new BPromise(function(_0xffb979,_0x476fc4){return client[_0x763b('0xa')](_0xbe9cf0,_0x218a1f)[_0x763b('0xb')](function(_0x2833b2){logger['info'](_0x763b('0xc'),_0x464ab0,_0x763b('0xd'));logger[_0x763b('0xe')](_0x763b('0xf'),_0x464ab0,_0x763b('0xd'),JSON[_0x763b('0x10')](_0x2833b2));if(_0x2833b2['error']){if(_0x2833b2[_0x763b('0x11')][_0x763b('0x12')]===0x1f4){logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0x476fc4(_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);}logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0xffb979(_0x2833b2['error'][_0x763b('0x13')]);}else{logger[_0x763b('0x14')](_0x763b('0xc'),_0x464ab0,'request\x20sent');_0xffb979(_0x2833b2[_0x763b('0x15')]['message']);}})[_0x763b('0x16')](function(_0x493346){logger[_0x763b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x464ab0,_0x493346);_0x476fc4(_0x493346);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index bcb15c0..d826b4f 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 _0xfcc1=['fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','destroy','multer','util','connect-timeout','Router'];(function(_0x2292d9,_0x1d2698){var _0x2f5b29=function(_0x51f940){while(--_0x51f940){_0x2292d9['push'](_0x2292d9['shift']());}};_0x2f5b29(++_0x1d2698);}(_0xfcc1,0x11d));var _0x1fcc=function(_0x24655a,_0x7fa437){_0x24655a=_0x24655a-0x0;var _0x5f4ad4=_0xfcc1[_0x24655a];return _0x5f4ad4;};'use strict';var multer=require(_0x1fcc('0x0'));var util=require(_0x1fcc('0x1'));var path=require('path');var timeout=require(_0x1fcc('0x2'));var express=require('express');var router=express[_0x1fcc('0x3')]();var fs_extra=require(_0x1fcc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1fcc('0x5'));var config=require('../../config/environment');var controller=require(_0x1fcc('0x6'));router[_0x1fcc('0x7')]('/',auth[_0x1fcc('0x8')](),controller[_0x1fcc('0x9')]);router[_0x1fcc('0x7')]('/describe',auth[_0x1fcc('0x8')](),controller[_0x1fcc('0xa')]);router[_0x1fcc('0x7')](_0x1fcc('0xb'),auth[_0x1fcc('0x8')](),controller[_0x1fcc('0xc')]);router['post']('/',auth[_0x1fcc('0x8')](),controller[_0x1fcc('0xd')]);router[_0x1fcc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1fcc('0xf')]);router['delete'](_0x1fcc('0xb'),auth[_0x1fcc('0x8')](),controller[_0x1fcc('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3d39=['describe','/:id','post','create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x326c48,_0x31eee6){var _0xf71bc5=function(_0x391b95){while(--_0x391b95){_0x326c48['push'](_0x326c48['shift']());}};_0xf71bc5(++_0x31eee6);}(_0x3d39,0x1d6));var _0x93d3=function(_0x288339,_0x1b55cb){_0x288339=_0x288339-0x0;var _0x31d315=_0x3d39[_0x288339];return _0x31d315;};'use strict';var multer=require('multer');var util=require(_0x93d3('0x0'));var path=require('path');var timeout=require(_0x93d3('0x1'));var express=require(_0x93d3('0x2'));var router=express[_0x93d3('0x3')]();var fs_extra=require(_0x93d3('0x4'));var auth=require(_0x93d3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93d3('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x93d3('0x7')]('/',auth[_0x93d3('0x8')](),controller[_0x93d3('0x9')]);router[_0x93d3('0x7')]('/describe',auth[_0x93d3('0x8')](),controller[_0x93d3('0xa')]);router['get'](_0x93d3('0xb'),auth[_0x93d3('0x8')](),controller['show']);router[_0x93d3('0xc')]('/',auth[_0x93d3('0x8')](),controller[_0x93d3('0xd')]);router['put'](_0x93d3('0xb'),auth['isAuthenticated'](),controller[_0x93d3('0xe')]);router['delete'](_0x93d3('0xb'),auth[_0x93d3('0x8')](),controller[_0x93d3('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index de3e81e..2fe1625 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 _0xd11b=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x318e91,_0x38779d){var _0x403cea=function(_0xf7d76a){while(--_0xf7d76a){_0x318e91['push'](_0x318e91['shift']());}};_0x403cea(++_0x38779d);}(_0xd11b,0xaa));var _0xbd11=function(_0x5efdfc,_0x1a78ca){_0x5efdfc=_0x5efdfc-0x0;var _0x3c36fa=_0xd11b[_0x5efdfc];return _0x3c36fa;};'use strict';var Sequelize=require(_0xbd11('0x0'));module[_0xbd11('0x1')]={'name':{'type':Sequelize[_0xbd11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbd11('0x3')](_0xbd11('0x4'),_0xbd11('0x5')),'defaultValue':_0xbd11('0x4')},'selector':{'type':Sequelize[_0xbd11('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x08cb=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x558d22,_0x43749f){var _0x1c20af=function(_0x382fcd){while(--_0x382fcd){_0x558d22['push'](_0x558d22['shift']());}};_0x1c20af(++_0x43749f);}(_0x08cb,0x135));var _0xb08c=function(_0x381b14,_0x44738b){_0x381b14=_0x381b14-0x0;var _0x271127=_0x08cb[_0x381b14];return _0x271127;};'use strict';var Sequelize=require(_0xb08c('0x0'));module[_0xb08c('0x1')]={'name':{'type':Sequelize[_0xb08c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb08c('0x3')](_0xb08c('0x4'),_0xb08c('0x5')),'defaultValue':_0xb08c('0x4')},'selector':{'type':Sequelize[_0xb08c('0x2')]},'timeout':{'type':Sequelize[_0xb08c('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7e8a82e..9f788d5 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 _0x57cf=['include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','offset','count','set','apply','reject','save','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','fields'];(function(_0x4e4001,_0x3486ef){var _0x30923e=function(_0x591d10){while(--_0x591d10){_0x4e4001['push'](_0x4e4001['shift']());}};_0x30923e(++_0x3486ef);}(_0x57cf,0x11b));var _0xf57c=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x57cf[_0x1e3c16];return _0x47a0c9;};'use strict';var emlformat=require(_0xf57c('0x0'));var rimraf=require(_0xf57c('0x1'));var zipdir=require(_0xf57c('0x2'));var jsonpatch=require(_0xf57c('0x3'));var rp=require(_0xf57c('0x4'));var moment=require(_0xf57c('0x5'));var BPromise=require(_0xf57c('0x6'));var Mustache=require(_0xf57c('0x7'));var util=require(_0xf57c('0x8'));var path=require(_0xf57c('0x9'));var sox=require('sox');var csv=require(_0xf57c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf57c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf57c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf57c('0xd'));var toCsv=require(_0xf57c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf57c('0xe'));var authService=require(_0xf57c('0xf'));var qs=require(_0xf57c('0x10'));var as=require(_0xf57c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf57c('0x12'))(_0xf57c('0x13'));var utils=require(_0xf57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf57c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27de1b,_0x15e264){_0x15e264=_0x15e264||0xcc;return function(_0x4cc38b){if(_0x4cc38b){return _0x27de1b[_0xf57c('0x16')](_0x15e264);}return _0x27de1b['status'](_0x15e264)[_0xf57c('0x17')]();};}function respondWithResult(_0x598342,_0x23c2b5){_0x23c2b5=_0x23c2b5||0xc8;return function(_0xc56c5){if(_0xc56c5){return _0x598342[_0xf57c('0x18')](_0x23c2b5)[_0xf57c('0x19')](_0xc56c5);}};}function respondWithFilteredResult(_0x168f5c,_0x3d12a0){return function(_0x1fb5f5){if(_0x1fb5f5){var _0x3163eb=typeof _0x3d12a0['offset']===_0xf57c('0x1a')&&typeof _0x3d12a0['limit']===_0xf57c('0x1a');var _0x2d8386=_0x1fb5f5['count'];var _0x385a4f=_0x3163eb?0x0:_0x3d12a0[_0xf57c('0x1b')];var _0x3eb951=_0x3163eb?_0x1fb5f5[_0xf57c('0x1c')]:_0x3d12a0[_0xf57c('0x1b')]+_0x3d12a0['limit'];var _0x3c6e33;if(_0x3eb951>=_0x2d8386){_0x3eb951=_0x2d8386;_0x3c6e33=0xc8;}else{_0x3c6e33=0xce;}_0x168f5c[_0xf57c('0x18')](_0x3c6e33);return _0x168f5c[_0xf57c('0x1d')]('Content-Range',_0x385a4f+'-'+_0x3eb951+'/'+_0x2d8386)['json'](_0x1fb5f5);}return null;};}function patchUpdates(_0x3ac299){return function(_0x1f8a65){try{jsonpatch[_0xf57c('0x1e')](_0x1f8a65,_0x3ac299,!![]);}catch(_0x23a827){return BPromise[_0xf57c('0x1f')](_0x23a827);}return _0x1f8a65[_0xf57c('0x20')]();};}function saveUpdates(_0xea8ee8,_0x396e18){return function(_0xf3baee){if(_0xf3baee){return _0xf3baee['update'](_0xea8ee8)[_0xf57c('0x21')](function(_0x177e74){return _0x177e74;});}return null;};}function removeEntity(_0x551cf0,_0x5ad03e){return function(_0x3c4923){if(_0x3c4923){return _0x3c4923['destroy']()[_0xf57c('0x21')](function(){_0x551cf0[_0xf57c('0x18')](0xcc)[_0xf57c('0x17')]();});}};}function handleEntityNotFound(_0x584bc3,_0xc70f3e){return function(_0x195ae5){if(!_0x195ae5){_0x584bc3['sendStatus'](0x194);}return _0x195ae5;};}function handleError(_0x387d7c,_0x2ac666){_0x2ac666=_0x2ac666||0x1f4;return function(_0x1b12ff){logger[_0xf57c('0x22')](_0x1b12ff[_0xf57c('0x23')]);if(_0x1b12ff[_0xf57c('0x24')]){delete _0x1b12ff[_0xf57c('0x24')];}_0x387d7c[_0xf57c('0x18')](_0x2ac666)[_0xf57c('0x25')](_0x1b12ff);};}exports['show']=function(_0x35e6f8,_0x1f5f3b){var _0x56726f={'raw':!![],'where':{'id':_0x35e6f8[_0xf57c('0x26')]['id']}},_0x2e69e9={};_0x2e69e9[_0xf57c('0x27')]=_[_0xf57c('0x28')](db[_0xf57c('0x29')][_0xf57c('0x2a')]);_0x2e69e9[_0xf57c('0x2b')]=_[_0xf57c('0x28')](_0x35e6f8[_0xf57c('0x2b')]);_0x2e69e9[_0xf57c('0x2c')]=_['intersection'](_0x2e69e9[_0xf57c('0x27')],_0x2e69e9[_0xf57c('0x2b')]);_0x56726f[_0xf57c('0x2d')]=_['intersection'](_0x2e69e9['model'],qs['fields'](_0x35e6f8[_0xf57c('0x2b')][_0xf57c('0x2e')]));_0x56726f[_0xf57c('0x2d')]=_0x56726f[_0xf57c('0x2d')]['length']?_0x56726f[_0xf57c('0x2d')]:_0x2e69e9[_0xf57c('0x27')];if(_0x35e6f8[_0xf57c('0x2b')]['includeAll']){_0x56726f[_0xf57c('0x2f')]=[{'all':!![]}];}_0x56726f=_[_0xf57c('0x30')]({},_0x56726f,_0x35e6f8[_0xf57c('0x31')]);return db[_0xf57c('0x29')][_0xf57c('0x32')](_0x56726f)[_0xf57c('0x21')](handleEntityNotFound(_0x1f5f3b,null))['then'](respondWithResult(_0x1f5f3b,null))[_0xf57c('0x33')](handleError(_0x1f5f3b,null));};exports[_0xf57c('0x34')]=function(_0x4da04a,_0x533795){return db[_0xf57c('0x29')]['create'](_0x4da04a[_0xf57c('0x35')],{})['then'](respondWithResult(_0x533795,0xc9))[_0xf57c('0x33')](handleError(_0x533795,null));};exports[_0xf57c('0x36')]=function(_0x17e8dc,_0x136304){if(_0x17e8dc['body']['id']){delete _0x17e8dc[_0xf57c('0x35')]['id'];}return db['ChatProactiveAction'][_0xf57c('0x32')]({'where':{'id':_0x17e8dc[_0xf57c('0x26')]['id']}})[_0xf57c('0x21')](handleEntityNotFound(_0x136304,null))[_0xf57c('0x21')](saveUpdates(_0x17e8dc[_0xf57c('0x35')],null))[_0xf57c('0x21')](respondWithResult(_0x136304,null))['catch'](handleError(_0x136304,null));};exports['destroy']=function(_0x1d5bf9,_0x26a65b){return db[_0xf57c('0x29')]['find']({'where':{'id':_0x1d5bf9[_0xf57c('0x26')]['id']}})['then'](handleEntityNotFound(_0x26a65b,null))[_0xf57c('0x21')](removeEntity(_0x26a65b,null))[_0xf57c('0x33')](handleError(_0x26a65b,null));}; \ No newline at end of file +var _0xe64a=['length','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','keys','query','filters','intersection','model','attributes','fields'];(function(_0x1e1962,_0x5a2061){var _0x3c06be=function(_0x37761b){while(--_0x37761b){_0x1e1962['push'](_0x1e1962['shift']());}};_0x3c06be(++_0x5a2061);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae64('0x0'));var rimraf=require(_0xae64('0x1'));var zipdir=require(_0xae64('0x2'));var jsonpatch=require(_0xae64('0x3'));var rp=require(_0xae64('0x4'));var moment=require(_0xae64('0x5'));var BPromise=require(_0xae64('0x6'));var Mustache=require(_0xae64('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae64('0x8'));var fs=require('fs');var fs_extra=require(_0xae64('0x9'));var _=require(_0xae64('0xa'));var squel=require(_0xae64('0xb'));var crypto=require(_0xae64('0xc'));var jsforce=require(_0xae64('0xd'));var deskjs=require(_0xae64('0xe'));var toCsv=require(_0xae64('0xf'));var querystring=require(_0xae64('0x10'));var Papa=require(_0xae64('0x11'));var Redis=require(_0xae64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xae64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae64('0x14'))(_0xae64('0x15'));var utils=require(_0xae64('0x16'));var config=require(_0xae64('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xae64('0x18'))['db'];function respondWithStatusCode(_0x58d0de,_0x59b60a){_0x59b60a=_0x59b60a||0xcc;return function(_0x345caf){if(_0x345caf){return _0x58d0de[_0xae64('0x19')](_0x59b60a);}return _0x58d0de[_0xae64('0x1a')](_0x59b60a)['end']();};}function respondWithResult(_0x1247b0,_0x760b31){_0x760b31=_0x760b31||0xc8;return function(_0x306804){if(_0x306804){return _0x1247b0[_0xae64('0x1a')](_0x760b31)[_0xae64('0x1b')](_0x306804);}};}function respondWithFilteredResult(_0x4c7d1c,_0x2950c5){return function(_0x37bc58){if(_0x37bc58){var _0x717724=typeof _0x2950c5[_0xae64('0x1c')]===_0xae64('0x1d')&&typeof _0x2950c5['limit']===_0xae64('0x1d');var _0x21c285=_0x37bc58[_0xae64('0x1e')];var _0x4613d9=_0x717724?0x0:_0x2950c5[_0xae64('0x1c')];var _0x227223=_0x717724?_0x37bc58[_0xae64('0x1e')]:_0x2950c5[_0xae64('0x1c')]+_0x2950c5['limit'];var _0x3cdd98;if(_0x227223>=_0x21c285){_0x227223=_0x21c285;_0x3cdd98=0xc8;}else{_0x3cdd98=0xce;}_0x4c7d1c[_0xae64('0x1a')](_0x3cdd98);return _0x4c7d1c[_0xae64('0x1f')](_0xae64('0x20'),_0x4613d9+'-'+_0x227223+'/'+_0x21c285)[_0xae64('0x1b')](_0x37bc58);}return null;};}function patchUpdates(_0x20ca7f){return function(_0x49bab9){try{jsonpatch[_0xae64('0x21')](_0x49bab9,_0x20ca7f,!![]);}catch(_0x4a4c4e){return BPromise[_0xae64('0x22')](_0x4a4c4e);}return _0x49bab9[_0xae64('0x23')]();};}function saveUpdates(_0x12d94d,_0x394afa){return function(_0x4406dc){if(_0x4406dc){return _0x4406dc[_0xae64('0x24')](_0x12d94d)[_0xae64('0x25')](function(_0x127ae2){return _0x127ae2;});}return null;};}function removeEntity(_0x24a35f,_0x2e6852){return function(_0x131225){if(_0x131225){return _0x131225[_0xae64('0x26')]()[_0xae64('0x25')](function(){_0x24a35f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6eb56,_0xd5ecaf){return function(_0x22d91a){if(!_0x22d91a){_0x6eb56[_0xae64('0x19')](0x194);}return _0x22d91a;};}function handleError(_0x4d987f,_0x518969){_0x518969=_0x518969||0x1f4;return function(_0x562c2d){logger[_0xae64('0x27')](_0x562c2d[_0xae64('0x28')]);if(_0x562c2d['name']){delete _0x562c2d[_0xae64('0x29')];}_0x4d987f[_0xae64('0x1a')](_0x518969)[_0xae64('0x2a')](_0x562c2d);};}exports['show']=function(_0x3b946c,_0x562eb4){var _0x55f53d={'raw':!![],'where':{'id':_0x3b946c[_0xae64('0x2b')]['id']}},_0x5e4b2c={};_0x5e4b2c['model']=_[_0xae64('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x5e4b2c['query']=_[_0xae64('0x2c')](_0x3b946c[_0xae64('0x2d')]);_0x5e4b2c[_0xae64('0x2e')]=_[_0xae64('0x2f')](_0x5e4b2c[_0xae64('0x30')],_0x5e4b2c[_0xae64('0x2d')]);_0x55f53d[_0xae64('0x31')]=_[_0xae64('0x2f')](_0x5e4b2c[_0xae64('0x30')],qs['fields'](_0x3b946c[_0xae64('0x2d')][_0xae64('0x32')]));_0x55f53d[_0xae64('0x31')]=_0x55f53d[_0xae64('0x31')][_0xae64('0x33')]?_0x55f53d[_0xae64('0x31')]:_0x5e4b2c['model'];if(_0x3b946c[_0xae64('0x2d')]['includeAll']){_0x55f53d['include']=[{'all':!![]}];}_0x55f53d=_[_0xae64('0x34')]({},_0x55f53d,_0x3b946c[_0xae64('0x35')]);return db[_0xae64('0x36')][_0xae64('0x37')](_0x55f53d)[_0xae64('0x25')](handleEntityNotFound(_0x562eb4,null))[_0xae64('0x25')](respondWithResult(_0x562eb4,null))[_0xae64('0x38')](handleError(_0x562eb4,null));};exports['create']=function(_0xe53734,_0x4437e9){return db[_0xae64('0x36')][_0xae64('0x39')](_0xe53734[_0xae64('0x3a')],{})[_0xae64('0x25')](respondWithResult(_0x4437e9,0xc9))['catch'](handleError(_0x4437e9,null));};exports[_0xae64('0x24')]=function(_0x28269b,_0x3afc79){if(_0x28269b[_0xae64('0x3a')]['id']){delete _0x28269b['body']['id'];}return db[_0xae64('0x36')][_0xae64('0x37')]({'where':{'id':_0x28269b['params']['id']}})[_0xae64('0x25')](handleEntityNotFound(_0x3afc79,null))[_0xae64('0x25')](saveUpdates(_0x28269b['body'],null))[_0xae64('0x25')](respondWithResult(_0x3afc79,null))[_0xae64('0x38')](handleError(_0x3afc79,null));};exports[_0xae64('0x26')]=function(_0x19a5b7,_0x4c55b3){return db[_0xae64('0x36')][_0xae64('0x37')]({'where':{'id':_0x19a5b7[_0xae64('0x2b')]['id']}})[_0xae64('0x25')](handleEntityNotFound(_0x4c55b3,null))[_0xae64('0x25')](removeEntity(_0x4c55b3,null))[_0xae64('0x38')](handleError(_0x4c55b3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 90936f5..702ba23 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 _0xb0c4=['../../config/logger','api','moment','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x3f5e5e,_0x532de2){var _0x35ebd7=function(_0x1b9750){while(--_0x1b9750){_0x3f5e5e['push'](_0x3f5e5e['shift']());}};_0x35ebd7(++_0x532de2);}(_0xb0c4,0x111));var _0x4b0c=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0xb0c4[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0x4b0c('0x0'));var util=require(_0x4b0c('0x1'));var logger=require(_0x4b0c('0x2'))(_0x4b0c('0x3'));var moment=require(_0x4b0c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b0c('0x5'));var attributes=require(_0x4b0c('0x6'));module[_0x4b0c('0x7')]=function(_0x39da7e,_0x497285){return _0x39da7e[_0x4b0c('0x8')](_0x4b0c('0x9'),attributes,{'tableName':_0x4b0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b4e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x2f0eba,_0x21bcdf){var _0x586783=function(_0x261d26){while(--_0x261d26){_0x2f0eba['push'](_0x2f0eba['shift']());}};_0x586783(++_0x21bcdf);}(_0x1b4e,0x14c));var _0xe1b4=function(_0xa80bab,_0x1a6417){_0xa80bab=_0xa80bab-0x0;var _0xcae729=_0x1b4e[_0xa80bab];return _0xcae729;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var logger=require(_0xe1b4('0x2'))(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var BPromise=require(_0xe1b4('0x5'));var rp=require(_0xe1b4('0x6'));var fs=require('fs');var path=require(_0xe1b4('0x7'));var rimraf=require(_0xe1b4('0x8'));var config=require(_0xe1b4('0x9'));var attributes=require(_0xe1b4('0xa'));module['exports']=function(_0x560488,_0x4278b4){return _0x560488[_0xe1b4('0xb')](_0xe1b4('0xc'),attributes,{'tableName':_0xe1b4('0xd'),'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 a0800f2..e6281ba 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 _0xf643=['ChatProactiveAction,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf643,0xde));var _0x3f64=function(_0x27af08,_0x192c31){_0x27af08=_0x27af08-0x0;var _0x49eb8e=_0xf643[_0x27af08];return _0x49eb8e;};'use strict';var _=require(_0x3f64('0x0'));var util=require(_0x3f64('0x1'));var moment=require(_0x3f64('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f64('0x3'));var fs=require('fs');var Redis=require(_0x3f64('0x4'));var db=require(_0x3f64('0x5'))['db'];var utils=require(_0x3f64('0x6'));var logger=require(_0x3f64('0x7'))(_0x3f64('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3f64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce1d1,_0x1ecb67,_0x2ba99b){return new BPromise(function(_0x29c7cc,_0x5dec7c){return client[_0x3f64('0xa')](_0x2ce1d1,_0x2ba99b)['then'](function(_0x4cacfc){logger[_0x3f64('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ecb67,_0x3f64('0xc'));logger[_0x3f64('0xd')](_0x3f64('0xe'),_0x1ecb67,_0x3f64('0xc'),JSON[_0x3f64('0xf')](_0x4cacfc));if(_0x4cacfc['error']){if(_0x4cacfc[_0x3f64('0x10')][_0x3f64('0x11')]===0x1f4){logger[_0x3f64('0x10')](_0x3f64('0x12'),_0x1ecb67,_0x4cacfc[_0x3f64('0x10')]['message']);return _0x5dec7c(_0x4cacfc['error']['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1ecb67,_0x4cacfc['error'][_0x3f64('0x13')]);return _0x29c7cc(_0x4cacfc[_0x3f64('0x10')][_0x3f64('0x13')]);}else{logger[_0x3f64('0xb')](_0x3f64('0x12'),_0x1ecb67,_0x3f64('0xc'));_0x29c7cc(_0x4cacfc['result'][_0x3f64('0x13')]);}})['catch'](function(_0x365575){logger[_0x3f64('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ecb67,_0x365575);_0x5dec7c(_0x365575);});});} \ No newline at end of file +var _0xd0c8=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0c8,0x119));var _0x8d0c=function(_0x46c947,_0x32abe8){_0x46c947=_0x46c947-0x0;var _0x530a46=_0xd0c8[_0x46c947];return _0x530a46;};'use strict';var _=require('lodash');var util=require(_0x8d0c('0x0'));var moment=require(_0x8d0c('0x1'));var BPromise=require(_0x8d0c('0x2'));var rs=require(_0x8d0c('0x3'));var fs=require('fs');var Redis=require(_0x8d0c('0x4'));var db=require(_0x8d0c('0x5'))['db'];var utils=require(_0x8d0c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8d0c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d0c('0x8')][_0x8d0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b3cf8,_0x4ed527,_0x1e2d7b){return new BPromise(function(_0x509623,_0x57e4cd){return client[_0x8d0c('0xa')](_0x9b3cf8,_0x1e2d7b)[_0x8d0c('0xb')](function(_0x1b24bc){logger[_0x8d0c('0xc')](_0x8d0c('0xd'),_0x4ed527,_0x8d0c('0xe'));logger[_0x8d0c('0xf')](_0x8d0c('0x10'),_0x4ed527,_0x8d0c('0xe'),JSON[_0x8d0c('0x11')](_0x1b24bc));if(_0x1b24bc[_0x8d0c('0x12')]){if(_0x1b24bc['error'][_0x8d0c('0x13')]===0x1f4){logger[_0x8d0c('0x12')](_0x8d0c('0xd'),_0x4ed527,_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);return _0x57e4cd(_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4ed527,_0x1b24bc[_0x8d0c('0x12')]['message']);return _0x509623(_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);}else{logger[_0x8d0c('0xc')](_0x8d0c('0xd'),_0x4ed527,_0x8d0c('0xe'));_0x509623(_0x1b24bc[_0x8d0c('0x15')]['message']);}})[_0x8d0c('0x16')](function(_0x2a8ebe){logger[_0x8d0c('0x12')](_0x8d0c('0xd'),_0x4ed527,_0x2a8ebe);_0x57e4cd(_0x2a8ebe);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 355462c..9cf87e6 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 _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0xec0158,_0x26a319){var _0x539645=function(_0x1c4b7a){while(--_0x1c4b7a){_0xec0158['push'](_0xec0158['shift']());}};_0x539645(++_0x26a319);}(_0x5fd1,0x155));var _0x15fd=function(_0x578ee6,_0x3c2492){_0x578ee6=_0x578ee6-0x0;var _0x4974eb=_0x5fd1[_0x578ee6];return _0x4974eb;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5f2000,_0x11e9f7){var _0x11e7ee=function(_0x2e27e7){while(--_0x2e27e7){_0x5f2000['push'](_0x5f2000['shift']());}};_0x11e7ee(++_0x11e9f7);}(_0x032e,0x124));var _0xe032=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x032e[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 4880efc..2cbda1f 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 _0xe289=['beepall','roundrobin','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x2c79b6,_0x31ea63){var _0x4e817c=function(_0x1bd18d){while(--_0x1bd18d){_0x2c79b6['push'](_0x2c79b6['shift']());}};_0x4e817c(++_0x31ea63);}(_0xe289,0x79));var _0x9e28=function(_0x20941c,_0x196c90){_0x20941c=_0x20941c-0x0;var _0x64587e=_0xe289[_0x20941c];return _0x64587e;};'use strict';var Sequelize=require(_0x9e28('0x0'));module[_0x9e28('0x1')]={'name':{'type':Sequelize[_0x9e28('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9e28('0x3')](_0x9e28('0x4'),_0x9e28('0x5'),_0x9e28('0x6'))}}; \ No newline at end of file +var _0x8ed7=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x248b46,_0x4d7f9d){var _0x21b566=function(_0x192675){while(--_0x192675){_0x248b46['push'](_0x248b46['shift']());}};_0x21b566(++_0x4d7f9d);}(_0x8ed7,0xe6));var _0x78ed=function(_0x132987,_0x2ff9f6){_0x132987=_0x132987-0x0;var _0x4a8073=_0x8ed7[_0x132987];return _0x4a8073;};'use strict';var Sequelize=require(_0x78ed('0x0'));module[_0x78ed('0x1')]={'name':{'type':Sequelize[_0x78ed('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x78ed('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78ed('0x4')](_0x78ed('0x5'),_0x78ed('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 98f8a7d..0440ff0 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 _0x4017=['interface','flatMap','sequelize','transaction','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','client','http','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','ChatQueues','UserProfileResource','destroy','end','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','map','VIRTUAL','ChatQueue','includeAll','include','rows','show','params','keys','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','hasOwnProperty','ChatQueueId','findAll','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','pick','getTeams','addTeams','ids','Agents','online','voicePause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4017,0x157));var _0x7401=function(_0x378255,_0xe7ea62){_0x378255=_0x378255-0x0;var _0x458d4e=_0x4017[_0x378255];return _0x458d4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7401('0x0'));var zipdir=require(_0x7401('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7401('0x2'));var moment=require(_0x7401('0x3'));var BPromise=require(_0x7401('0x4'));var Mustache=require(_0x7401('0x5'));var util=require('util');var path=require(_0x7401('0x6'));var sox=require(_0x7401('0x7'));var csv=require(_0x7401('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7401('0x9'));var _=require(_0x7401('0xa'));var squel=require(_0x7401('0xb'));var crypto=require(_0x7401('0xc'));var jsforce=require(_0x7401('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7401('0xe'));var Papa=require('papaparse');var Redis=require(_0x7401('0xf'));var authService=require(_0x7401('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7401('0x11'));var hardwareService=require(_0x7401('0x12'));var logger=require(_0x7401('0x13'))('api');var utils=require(_0x7401('0x14'));var config=require(_0x7401('0x15'));var licenseUtil=require(_0x7401('0x16'));var db=require(_0x7401('0x17'))['db'];config[_0x7401('0x18')]=_[_0x7401('0x19')](config[_0x7401('0x18')],{'host':_0x7401('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7401('0x18')]));require(_0x7401('0x1b'))[_0x7401('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7401('0x1d')][_0x7401('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x35e75a,_0x2d0b84,_0x2a5c89,_0x2bef9f){return new BPromise(function(_0x372f79,_0x228fc8){var _0x3baa03=_0x2bef9f||client;return _0x3baa03['request'](_0x35e75a,_0x2a5c89)[_0x7401('0x1f')](function(_0x5ab2ca){logger[_0x7401('0x20')]('ChatQueue,\x20%s,\x20%s',_0x2d0b84,_0x7401('0x21'));logger[_0x7401('0x22')](_0x7401('0x23'),_0x2d0b84,'request\x20sent',JSON[_0x7401('0x24')](_0x5ab2ca));if(_0x5ab2ca['error']){if(_0x5ab2ca[_0x7401('0x25')][_0x7401('0x26')]===0x1f4){logger[_0x7401('0x25')](_0x7401('0x27'),_0x2d0b84,_0x5ab2ca[_0x7401('0x25')][_0x7401('0x28')]);return _0x228fc8(_0x5ab2ca['error'][_0x7401('0x28')]);}logger[_0x7401('0x25')](_0x7401('0x27'),_0x2d0b84,_0x5ab2ca[_0x7401('0x25')][_0x7401('0x28')]);return _0x372f79(_0x5ab2ca[_0x7401('0x25')]['message']);}else{logger[_0x7401('0x20')]('ChatQueue,\x20%s,\x20%s',_0x2d0b84,'request\x20sent');_0x372f79(_0x5ab2ca[_0x7401('0x29')][_0x7401('0x28')]);}})[_0x7401('0x2a')](function(_0x444dfd){logger['error'](_0x7401('0x27'),_0x2d0b84,_0x444dfd);_0x228fc8(_0x444dfd);});});}function respondWithStatusCode(_0x478b4c,_0x5c46f4){_0x5c46f4=_0x5c46f4||0xcc;return function(_0x249e7f){if(_0x249e7f){return _0x478b4c[_0x7401('0x2b')](_0x5c46f4);}return _0x478b4c[_0x7401('0x2c')](_0x5c46f4)['end']();};}function respondWithResult(_0x5e355d,_0x162555){_0x162555=_0x162555||0xc8;return function(_0x30aac8){if(_0x30aac8){return _0x5e355d[_0x7401('0x2c')](_0x162555)[_0x7401('0x2d')](_0x30aac8);}};}function respondWithFilteredResult(_0x21eb44,_0x424eb7){return function(_0x230e27){if(_0x230e27){var _0x582f1c=typeof _0x424eb7[_0x7401('0x2e')]===_0x7401('0x2f')&&typeof _0x424eb7[_0x7401('0x30')]===_0x7401('0x2f');var _0xa04d89=_0x230e27[_0x7401('0x31')];var _0x5c4f52=_0x582f1c?0x0:_0x424eb7[_0x7401('0x2e')];var _0x3aac1d=_0x582f1c?_0x230e27[_0x7401('0x31')]:_0x424eb7['offset']+_0x424eb7[_0x7401('0x30')];var _0x5c4546;if(_0x3aac1d>=_0xa04d89){_0x3aac1d=_0xa04d89;_0x5c4546=0xc8;}else{_0x5c4546=0xce;}_0x21eb44[_0x7401('0x2c')](_0x5c4546);return _0x21eb44[_0x7401('0x32')](_0x7401('0x33'),_0x5c4f52+'-'+_0x3aac1d+'/'+_0xa04d89)[_0x7401('0x2d')](_0x230e27);}return null;};}function patchUpdates(_0x46239c){return function(_0x17e650){try{jsonpatch[_0x7401('0x34')](_0x17e650,_0x46239c,!![]);}catch(_0x3f878c){return BPromise[_0x7401('0x35')](_0x3f878c);}return _0x17e650['save']();};}function saveUpdates(_0x1764de,_0x4e3845){return function(_0x4c4c5b){if(_0x4c4c5b){return _0x4c4c5b[_0x7401('0x36')](_0x1764de)[_0x7401('0x1f')](function(_0x234e31){return _0x234e31;});}return null;};}function removeEntity(_0x1d9bee,_0x82a32a){return function(_0x387a95){if(_0x387a95){return _0x387a95['destroy']()['then'](function(){var _0x10be54=_0x387a95[_0x7401('0x37')]({'plain':!![]});var _0x4316b2=_0x7401('0x38');return db[_0x7401('0x39')][_0x7401('0x3a')]({'where':{'type':_0x4316b2,'resourceId':_0x10be54['id']}})[_0x7401('0x1f')](function(){return _0x387a95;});})[_0x7401('0x1f')](function(){_0x1d9bee[_0x7401('0x2c')](0xcc)[_0x7401('0x3b')]();});}};}function handleEntityNotFound(_0x30abc4,_0x2c71db){return function(_0x39fff8){if(!_0x39fff8){_0x30abc4[_0x7401('0x2b')](0x194);}return _0x39fff8;};}function handleError(_0x473291,_0xe71f84){_0xe71f84=_0xe71f84||0x1f4;return function(_0x2e2e6b){logger['error'](_0x2e2e6b['stack']);if(_0x2e2e6b['name']){delete _0x2e2e6b[_0x7401('0x3c')];}_0x473291[_0x7401('0x2c')](_0xe71f84)[_0x7401('0x3d')](_0x2e2e6b);};}exports['index']=function(_0x5400fe,_0x5af08f){var _0x4926c3={},_0x195fdd={},_0x2032d9={'count':0x0,'rows':[]};var _0xb5f6fb=_['map'](db['ChatQueue'][_0x7401('0x3e')],function(_0x28032d){return{'name':_0x28032d[_0x7401('0x3f')],'type':_0x28032d[_0x7401('0x40')][_0x7401('0x41')]};});_0x195fdd[_0x7401('0x42')]=_['map'](_0xb5f6fb,'name');_0x195fdd[_0x7401('0x43')]=_['keys'](_0x5400fe['query']);_0x195fdd[_0x7401('0x44')]=_[_0x7401('0x45')](_0x195fdd[_0x7401('0x42')],_0x195fdd[_0x7401('0x43')]);_0x4926c3['attributes']=_[_0x7401('0x45')](_0x195fdd[_0x7401('0x42')],qs['fields'](_0x5400fe['query'][_0x7401('0x46')]));_0x4926c3[_0x7401('0x47')]=_0x4926c3[_0x7401('0x47')][_0x7401('0x48')]?_0x4926c3[_0x7401('0x47')]:_0x195fdd[_0x7401('0x42')];if(!_0x5400fe[_0x7401('0x43')]['hasOwnProperty'](_0x7401('0x49'))){_0x4926c3[_0x7401('0x30')]=qs[_0x7401('0x30')](_0x5400fe[_0x7401('0x43')]['limit']);_0x4926c3[_0x7401('0x2e')]=qs[_0x7401('0x2e')](_0x5400fe[_0x7401('0x43')]['offset']);}_0x4926c3[_0x7401('0x4a')]=qs[_0x7401('0x4b')](_0x5400fe['query'][_0x7401('0x4b')]);_0x4926c3[_0x7401('0x4c')]=qs[_0x7401('0x44')](_['pick'](_0x5400fe[_0x7401('0x43')],_0x195fdd['filters']),_0xb5f6fb);if(_0x5400fe['query'][_0x7401('0x4d')]){_0x4926c3[_0x7401('0x4c')]=_['merge'](_0x4926c3[_0x7401('0x4c')],{'$or':_[_0x7401('0x4e')](_0xb5f6fb,function(_0x41ddc5){if(_0x41ddc5['type']!==_0x7401('0x4f')){var _0x12136a={};_0x12136a[_0x41ddc5[_0x7401('0x3c')]]={'$like':'%'+_0x5400fe['query'][_0x7401('0x4d')]+'%'};return _0x12136a;}})});}_0x4926c3=_['merge']({},_0x4926c3,_0x5400fe['options']);var _0xb7268f={'where':_0x4926c3[_0x7401('0x4c')]};return db[_0x7401('0x50')][_0x7401('0x31')](_0xb7268f)[_0x7401('0x1f')](function(_0x18e29e){_0x2032d9[_0x7401('0x31')]=_0x18e29e;if(_0x5400fe['query'][_0x7401('0x51')]){_0x4926c3[_0x7401('0x52')]=[{'all':!![]}];}return db[_0x7401('0x50')]['findAll'](_0x4926c3);})[_0x7401('0x1f')](function(_0x4ac35d){_0x2032d9[_0x7401('0x53')]=_0x4ac35d;return _0x2032d9;})['then'](respondWithFilteredResult(_0x5af08f,_0x4926c3))[_0x7401('0x2a')](handleError(_0x5af08f,null));};exports[_0x7401('0x54')]=function(_0x2bbeea,_0x280c73){var _0x45a878={'raw':!![],'where':{'id':_0x2bbeea[_0x7401('0x55')]['id']}},_0x2591d2={};_0x2591d2[_0x7401('0x42')]=_[_0x7401('0x56')](db[_0x7401('0x50')]['rawAttributes']);_0x2591d2[_0x7401('0x43')]=_[_0x7401('0x56')](_0x2bbeea[_0x7401('0x43')]);_0x2591d2['filters']=_[_0x7401('0x45')](_0x2591d2[_0x7401('0x42')],_0x2591d2[_0x7401('0x43')]);_0x45a878[_0x7401('0x47')]=_['intersection'](_0x2591d2[_0x7401('0x42')],qs['fields'](_0x2bbeea['query']['fields']));_0x45a878[_0x7401('0x47')]=_0x45a878[_0x7401('0x47')][_0x7401('0x48')]?_0x45a878[_0x7401('0x47')]:_0x2591d2['model'];if(_0x2bbeea['query'][_0x7401('0x51')]){_0x45a878['include']=[{'all':!![]}];}_0x45a878=_[_0x7401('0x57')]({},_0x45a878,_0x2bbeea[_0x7401('0x58')]);return db['ChatQueue'][_0x7401('0x59')](_0x45a878)[_0x7401('0x1f')](handleEntityNotFound(_0x280c73,null))[_0x7401('0x1f')](respondWithResult(_0x280c73,null))['catch'](handleError(_0x280c73,null));};exports['create']=function(_0x4036bf,_0x142a6e){return db[_0x7401('0x50')][_0x7401('0x5a')](_0x4036bf[_0x7401('0x5b')],{})['then'](function(_0x204817){var _0x242d1c=_0x4036bf[_0x7401('0x5c')][_0x7401('0x37')]({'plain':!![]});if(!_0x242d1c)throw new Error(_0x7401('0x5d'));if(_0x242d1c[_0x7401('0x5e')]===_0x7401('0x5c')){var _0x3224cb=_0x204817[_0x7401('0x37')]({'plain':!![]});var _0x144d76='ChatQueues';return db['UserProfileSection'][_0x7401('0x59')]({'where':{'name':_0x144d76,'userProfileId':_0x242d1c['userProfileId']},'raw':!![]})[_0x7401('0x1f')](function(_0x1e9f8e){if(_0x1e9f8e&&_0x1e9f8e[_0x7401('0x5f')]===0x0){return db[_0x7401('0x39')][_0x7401('0x5a')]({'name':_0x3224cb['name'],'resourceId':_0x3224cb['id'],'type':_0x1e9f8e[_0x7401('0x3c')],'sectionId':_0x1e9f8e['id']},{})[_0x7401('0x1f')](function(){return _0x204817;});}else{return _0x204817;}})['catch'](function(_0x55fdb8){logger[_0x7401('0x25')](_0x7401('0x60'),_0x55fdb8);throw _0x55fdb8;});}return _0x204817;})[_0x7401('0x1f')](respondWithResult(_0x142a6e,0xc9))[_0x7401('0x2a')](handleError(_0x142a6e,null));};exports[_0x7401('0x36')]=function(_0x2f7bd9,_0x25cfa7){if(_0x2f7bd9[_0x7401('0x5b')]['id']){delete _0x2f7bd9[_0x7401('0x5b')]['id'];}return db[_0x7401('0x50')][_0x7401('0x59')]({'where':{'id':_0x2f7bd9['params']['id']}})[_0x7401('0x1f')](handleEntityNotFound(_0x25cfa7,null))[_0x7401('0x1f')](saveUpdates(_0x2f7bd9[_0x7401('0x5b')],null))['then'](respondWithResult(_0x25cfa7,null))[_0x7401('0x2a')](handleError(_0x25cfa7,null));};exports[_0x7401('0x3a')]=function(_0x3d639e,_0xb4313){return db[_0x7401('0x50')][_0x7401('0x59')]({'where':{'id':_0x3d639e[_0x7401('0x55')]['id']}})[_0x7401('0x1f')](handleEntityNotFound(_0xb4313,null))[_0x7401('0x1f')](removeEntity(_0xb4313,null))['catch'](handleError(_0xb4313,null));};exports[_0x7401('0x61')]=function(_0x7e7cb,_0x552ddc){return db[_0x7401('0x50')][_0x7401('0x61')]()['then'](respondWithResult(_0x552ddc,null))[_0x7401('0x2a')](handleError(_0x552ddc,null));};exports['getMembers']=function(_0x57eb39,_0x59251b,_0x2d6808){var _0x33c18c={'raw':!![],'where':{}},_0x495e3f={},_0x2d0d3f;return db[_0x7401('0x50')][_0x7401('0x62')]({'where':{'id':_0x57eb39['params']['id']}})[_0x7401('0x1f')](handleEntityNotFound(_0x59251b,null))[_0x7401('0x1f')](function(_0x51e19e){if(_0x51e19e){_0x2d0d3f=_0x51e19e[_0x7401('0x37')]({'plain':!![]});_0x495e3f[_0x7401('0x42')]=_[_0x7401('0x56')](db['UserChatQueue'][_0x7401('0x3e')]);_0x495e3f[_0x7401('0x43')]=_[_0x7401('0x56')](_0x57eb39['query']);_0x495e3f[_0x7401('0x44')]=_['intersection'](_0x495e3f[_0x7401('0x42')],_0x495e3f[_0x7401('0x43')]);_0x33c18c[_0x7401('0x47')]=_['intersection'](_0x495e3f[_0x7401('0x42')],qs[_0x7401('0x46')](_0x57eb39['query'][_0x7401('0x46')]));_0x33c18c['attributes']=_0x33c18c[_0x7401('0x47')][_0x7401('0x48')]?_0x33c18c['attributes']:_0x495e3f[_0x7401('0x42')];if(!_0x57eb39['query'][_0x7401('0x63')](_0x7401('0x49'))){_0x33c18c['limit']=qs[_0x7401('0x30')](_0x57eb39[_0x7401('0x43')]['limit']);_0x33c18c[_0x7401('0x2e')]=qs[_0x7401('0x2e')](_0x57eb39[_0x7401('0x43')][_0x7401('0x2e')]);}_0x33c18c[_0x7401('0x4a')]=qs[_0x7401('0x4b')](_0x57eb39[_0x7401('0x43')][_0x7401('0x4b')]);_0x33c18c[_0x7401('0x4c')]=qs['filters'](_['pick'](_0x57eb39['query'],_0x495e3f[_0x7401('0x44')]));_0x33c18c[_0x7401('0x4c')][_0x7401('0x64')]=_0x51e19e['id'];if(_0x57eb39['query'][_0x7401('0x4d')]){_0x33c18c[_0x7401('0x4c')]=_[_0x7401('0x57')](_0x33c18c[_0x7401('0x4c')],{'$or':_[_0x7401('0x4e')](_0x33c18c[_0x7401('0x47')],function(_0xfa8954){var _0x398975={};_0x398975[_0xfa8954]={'$like':'%'+_0x57eb39[_0x7401('0x43')][_0x7401('0x4d')]+'%'};return _0x398975;})});}_0x33c18c=_[_0x7401('0x57')]({},_0x33c18c,_0x57eb39[_0x7401('0x58')]);return db['UserChatQueue'][_0x7401('0x65')](_0x33c18c);}})[_0x7401('0x1f')](function(_0x3756f9){if(_0x3756f9){return db[_0x7401('0x66')][_0x7401('0x67')]({'where':{'id':_[_0x7401('0x4e')](_0x3756f9,_0x7401('0x68')),'role':'agent'},'attributes':['id',_0x7401('0x3c'),_0x7401('0x69'),_0x7401('0x6a'),_0x7401('0x6b')]});}})[_0x7401('0x1f')](function(_0x254779){if(_0x254779){return{'count':_0x254779[_0x7401('0x31')],'rows':_[_0x7401('0x4e')](_0x254779[_0x7401('0x53')],function(_0x35ef09){return{'membername':_0x35ef09['name'],'UserId':_0x35ef09['id'],'queue_name':_0x2d0d3f[_0x7401('0x3c')],'ChatQueueId':_0x2d0d3f['id'],'interface':util[_0x7401('0x6c')](_0x7401('0x6d'),_0x7401('0x6e'),_0x35ef09[_0x7401('0x3c')]),'penalty':0x0,'paused':_0x35ef09[_0x7401('0x69')],'createdAt':_0x35ef09[_0x7401('0x6b')],'updatedAt':_0x35ef09['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7401('0x1f')](respondWithFilteredResult(_0x59251b,_0x33c18c))[_0x7401('0x2a')](handleError(_0x59251b,null));};exports['getTeams']=function(_0x4a47a2,_0x16860c,_0x2e547a){var _0x4b99ff={};var _0x10cc28={};var _0x3a4826;var _0x5534a4;return db['ChatQueue'][_0x7401('0x62')]({'where':{'id':_0x4a47a2[_0x7401('0x55')]['id']}})[_0x7401('0x1f')](handleEntityNotFound(_0x16860c,null))[_0x7401('0x1f')](function(_0x132ffe){if(_0x132ffe){_0x3a4826=_0x132ffe;_0x10cc28['model']=_[_0x7401('0x56')](db[_0x7401('0x6f')][_0x7401('0x3e')]);_0x10cc28[_0x7401('0x43')]=_[_0x7401('0x56')](_0x4a47a2[_0x7401('0x43')]);_0x10cc28[_0x7401('0x44')]=_[_0x7401('0x45')](_0x10cc28[_0x7401('0x42')],_0x10cc28[_0x7401('0x43')]);_0x4b99ff['attributes']=_[_0x7401('0x45')](_0x10cc28['model'],qs[_0x7401('0x46')](_0x4a47a2[_0x7401('0x43')][_0x7401('0x46')]));_0x4b99ff[_0x7401('0x47')]=_0x4b99ff[_0x7401('0x47')]['length']?_0x4b99ff[_0x7401('0x47')]:_0x10cc28[_0x7401('0x42')];_0x4b99ff[_0x7401('0x4a')]=qs[_0x7401('0x4b')](_0x4a47a2[_0x7401('0x43')][_0x7401('0x4b')]);_0x4b99ff['where']=qs[_0x7401('0x44')](_[_0x7401('0x70')](_0x4a47a2['query'],_0x10cc28[_0x7401('0x44')]));if(_0x4a47a2['query'][_0x7401('0x4d')]){_0x4b99ff[_0x7401('0x4c')]=_['merge'](_0x4b99ff[_0x7401('0x4c')],{'$or':_[_0x7401('0x4e')](_0x4b99ff[_0x7401('0x47')],function(_0x3e0e6c){var _0x1e190f={};_0x1e190f[_0x3e0e6c]={'$like':'%'+_0x4a47a2[_0x7401('0x43')][_0x7401('0x4d')]+'%'};return _0x1e190f;})});}_0x4b99ff=_[_0x7401('0x57')]({},_0x4b99ff,_0x4a47a2['options']);return _0x3a4826[_0x7401('0x71')](_0x4b99ff);}})['then'](function(_0x1624e0){if(_0x1624e0){_0x5534a4=_0x1624e0[_0x7401('0x48')];if(!_0x4a47a2[_0x7401('0x43')][_0x7401('0x63')](_0x7401('0x49'))){_0x4b99ff[_0x7401('0x30')]=qs[_0x7401('0x30')](_0x4a47a2['query'][_0x7401('0x30')]);_0x4b99ff[_0x7401('0x2e')]=qs[_0x7401('0x2e')](_0x4a47a2[_0x7401('0x43')]['offset']);}return _0x3a4826[_0x7401('0x71')](_0x4b99ff);}})[_0x7401('0x1f')](function(_0x1d0bb5){if(_0x1d0bb5){return _0x1d0bb5?{'count':_0x5534a4,'rows':_0x1d0bb5}:null;}})[_0x7401('0x1f')](respondWithResult(_0x16860c,null))[_0x7401('0x2a')](handleError(_0x16860c,null));};exports[_0x7401('0x72')]=function(_0x1883e3,_0x1c65d0,_0x429a08){var _0x850df3=_0x1883e3[_0x7401('0x5b')][_0x7401('0x73')];return db[_0x7401('0x6f')][_0x7401('0x65')]({'where':{'id':_0x850df3},'attributes':['id'],'include':[{'model':db[_0x7401('0x66')],'as':_0x7401('0x74'),'attributes':['id',_0x7401('0x3c'),_0x7401('0x75'),_0x7401('0x76'),_0x7401('0x77')],'raw':!![]}]})[_0x7401('0x1f')](function(_0x2d3f6a){if(_0x2d3f6a){var _0x2a160d=_[_0x7401('0x78')](_0x2d3f6a,function(_0x4f2df5){var _0x4e7cdd=_0x4f2df5['get']({'plain':!![]});return _0x4e7cdd[_0x7401('0x74')];});return db['ChatQueue'][_0x7401('0x59')]({'where':{'id':_0x1883e3[_0x7401('0x55')]['id']}})['then'](function(_0x2d780c){return db[_0x7401('0x79')][_0x7401('0x7a')](function(_0x30b1de){return _0x2d780c[_0x7401('0x72')](_0x850df3,{'transaction':_0x30b1de})[_0x7401('0x1f')](function(){return BPromise['each'](_0x2a160d,function(_0x23ebac){return db[_0x7401('0x7b')][_0x7401('0x7c')]({'where':{'UserId':_0x23ebac['id'],'ChatQueueId':_0x1883e3[_0x7401('0x55')]['id']},'transaction':_0x30b1de});});})[_0x7401('0x1f')](function(){_0x2a160d[_0x7401('0x7d')](function(_0x18b769){socket[_0x7401('0x7e')](_0x7401('0x7f'),{'UserId':_0x18b769['id'],'ChatQueueId':_0x2d780c['id']});});});});});}})[_0x7401('0x1f')](respondWithStatusCode(_0x1c65d0,null))['catch'](handleError(_0x1c65d0,null));};exports['removeTeams']=function(_0x513d21,_0x2f61f3,_0x765f93){return db[_0x7401('0x6f')]['findAll']({'where':{'id':_0x513d21['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x7401('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7401('0x1f')](handleEntityNotFound(_0x2f61f3,null))[_0x7401('0x1f')](function(_0x323bf8){var _0x1091ef=_[_0x7401('0x4e')](_0x323bf8,'id');var _0x95c568=[];var _0x1c249a=[];var _0x81c489=squel[_0x7401('0x80')]();_0x81c489[_0x7401('0x81')](_0x7401('0x82'))[_0x7401('0x83')](_0x7401('0x84'),'tq')[_0x7401('0x85')](_0x7401('0x86'),'ut',_0x7401('0x87'))[_0x7401('0x4c')](_0x7401('0x88'),_0x513d21[_0x7401('0x55')]['id']);for(var _0x3f0e75=0x0;_0x3f0e75<_0x323bf8[_0x7401('0x48')];_0x3f0e75+=0x1){let _0xbe432f=_0x323bf8[_0x3f0e75];for(var _0x211ac9=0x0;_0x211ac9<_0xbe432f[_0x7401('0x74')][_0x7401('0x48')];_0x211ac9+=0x1){let _0x3662a0=_0xbe432f['Agents'][_0x211ac9];var _0x21cfbe=_0x81c489[_0x7401('0x89')]();_0x21cfbe[_0x7401('0x4c')]('ut.UserId\x20=\x20?',_0x3662a0['id']);_0x1c249a[_0x7401('0x8a')](db['sequelize'][_0x7401('0x43')](_0x21cfbe[_0x7401('0x8b')](),{'type':db[_0x7401('0x79')][_0x7401('0x8c')]['SELECT']})[_0x7401('0x1f')](function(_0xf9f31f){if(_0xf9f31f['length']===0x1){return _0x3662a0['id'];}else{var _0x1f34fe=_[_0x7401('0x8d')](_['map'](_0xf9f31f,'TeamId'),function(_0x471b1e){return _[_0x7401('0x8e')](_0x1091ef,_0x471b1e);});if(_0x1f34fe){return _0x3662a0['id'];}}}));}}return BPromise['all'](_0x1c249a)[_0x7401('0x1f')](function(_0x566049){_0x95c568=_(_0x95c568)[_0x7401('0x8f')](_0x566049)[_0x7401('0x90')]()[_0x7401('0x91')]();return db[_0x7401('0x50')][_0x7401('0x59')]({'where':{'id':_0x513d21[_0x7401('0x55')]['id']}})[_0x7401('0x1f')](function(_0x2b9f87){return db['sequelize'][_0x7401('0x7a')](function(_0x2d0609){return _0x2b9f87['removeTeams'](_0x513d21['query'][_0x7401('0x73')],{'transaction':_0x2d0609})[_0x7401('0x1f')](function(){if(!_[_0x7401('0x92')](_0x95c568)){return _0x2b9f87[_0x7401('0x93')](_0x95c568,{'transaction':_0x2d0609});}})[_0x7401('0x1f')](function(){_0x95c568[_0x7401('0x7d')](function(_0x5e5c79){socket['emit'](_0x7401('0x94'),{'UserId':_0x5e5c79,'ChatQueueId':_0x2b9f87['id']});});});});});});})[_0x7401('0x1f')](respondWithStatusCode(_0x2f61f3,null))[_0x7401('0x2a')](handleError(_0x2f61f3,null));};exports[_0x7401('0x95')]=function(_0xc4a8e4,_0x264a24,_0x461e64){return db['ChatQueue'][_0x7401('0x59')]({'where':{'id':_0xc4a8e4[_0x7401('0x55')]['id']}})[_0x7401('0x1f')](handleEntityNotFound(_0x264a24,null))[_0x7401('0x1f')](function(_0x1c4dbd){if(_0x1c4dbd){return _0x1c4dbd[_0x7401('0x95')](_0xc4a8e4[_0x7401('0x5b')]['ids'],_[_0x7401('0x96')](_0xc4a8e4[_0x7401('0x5b')],[_0x7401('0x73'),'id'])||{})[_0x7401('0x97')](function(_0x3ab0ab){for(var _0x3c3571=0x0;_0x3c3571<_0xc4a8e4[_0x7401('0x5b')]['ids'][_0x7401('0x48')];_0x3c3571+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0xc4a8e4[_0x7401('0x5b')]['ids'][_0x3c3571]),'ChatQueueId':Number(_0xc4a8e4[_0x7401('0x55')]['id'])});}return _0x3ab0ab;});}})[_0x7401('0x1f')](respondWithResult(_0x264a24,null))[_0x7401('0x2a')](handleError(_0x264a24,null));};exports[_0x7401('0x93')]=function(_0x1e11d5,_0x168dfd,_0x58e072){return db[_0x7401('0x50')]['find']({'where':{'id':_0x1e11d5[_0x7401('0x55')]['id']}})[_0x7401('0x1f')](handleEntityNotFound(_0x168dfd,null))['then'](function(_0x31e082){if(_0x31e082){return _0x31e082[_0x7401('0x93')](_0x1e11d5[_0x7401('0x43')][_0x7401('0x73')])[_0x7401('0x1f')](function(){if(_[_0x7401('0x98')](_0x1e11d5[_0x7401('0x43')][_0x7401('0x73')])){for(var _0x2bf4ef=0x0;_0x2bf4ef<_0x1e11d5[_0x7401('0x43')][_0x7401('0x73')]['length'];_0x2bf4ef+=0x1){socket[_0x7401('0x7e')](_0x7401('0x94'),{'UserId':Number(_0x1e11d5[_0x7401('0x43')][_0x7401('0x73')][_0x2bf4ef]),'ChatQueueId':Number(_0x1e11d5['params']['id'])});}}else{socket[_0x7401('0x7e')](_0x7401('0x94'),{'UserId':Number(_0x1e11d5[_0x7401('0x43')][_0x7401('0x73')]),'ChatQueueId':Number(_0x1e11d5[_0x7401('0x55')]['id'])});}});}})[_0x7401('0x1f')](respondWithStatusCode(_0x168dfd,null))[_0x7401('0x2a')](handleError(_0x168dfd,null));};exports[_0x7401('0x99')]=function(_0x2b104a,_0x584e10,_0x3b0f41){var _0x133699={};var _0x5d5aa3={};var _0x25ae14;var _0x368fe5;return db[_0x7401('0x50')][_0x7401('0x62')]({'where':{'id':_0x2b104a[_0x7401('0x55')]['id']}})['then'](handleEntityNotFound(_0x584e10,null))[_0x7401('0x1f')](function(_0x37e477){if(_0x37e477){_0x25ae14=_0x37e477;_0x5d5aa3[_0x7401('0x42')]=_['keys'](db[_0x7401('0x66')]['rawAttributes']);_0x5d5aa3['query']=_[_0x7401('0x56')](_0x2b104a[_0x7401('0x43')]);_0x5d5aa3[_0x7401('0x44')]=_[_0x7401('0x45')](_0x5d5aa3[_0x7401('0x42')],_0x5d5aa3[_0x7401('0x43')]);_0x133699[_0x7401('0x47')]=_[_0x7401('0x45')](_0x5d5aa3[_0x7401('0x42')],qs[_0x7401('0x46')](_0x2b104a[_0x7401('0x43')][_0x7401('0x46')]));_0x133699[_0x7401('0x47')]=_0x133699['attributes'][_0x7401('0x48')]?_0x133699['attributes']:_0x5d5aa3['model'];_0x133699[_0x7401('0x4a')]=qs[_0x7401('0x4b')](_0x2b104a[_0x7401('0x43')][_0x7401('0x4b')]);_0x133699[_0x7401('0x4c')]=qs[_0x7401('0x44')](_[_0x7401('0x70')](_0x2b104a[_0x7401('0x43')],_0x5d5aa3[_0x7401('0x44')]));if(_0x2b104a['query'][_0x7401('0x4d')]){_0x133699[_0x7401('0x4c')]=_[_0x7401('0x57')](_0x133699[_0x7401('0x4c')],{'$or':_[_0x7401('0x4e')](_0x133699[_0x7401('0x47')],function(_0x92b6ae){var _0x1646a6={};_0x1646a6[_0x92b6ae]={'$like':'%'+_0x2b104a[_0x7401('0x43')][_0x7401('0x4d')]+'%'};return _0x1646a6;})});}_0x133699=_['merge']({},_0x133699,_0x2b104a[_0x7401('0x58')]);return _0x25ae14[_0x7401('0x99')](_0x133699);}})[_0x7401('0x1f')](function(_0x3925d4){if(_0x3925d4){_0x368fe5=_0x3925d4[_0x7401('0x48')];if(!_0x2b104a[_0x7401('0x43')]['hasOwnProperty'](_0x7401('0x49'))){_0x133699[_0x7401('0x30')]=qs[_0x7401('0x30')](_0x2b104a[_0x7401('0x43')][_0x7401('0x30')]);_0x133699[_0x7401('0x2e')]=qs[_0x7401('0x2e')](_0x2b104a[_0x7401('0x43')][_0x7401('0x2e')]);}return _0x25ae14[_0x7401('0x99')](_0x133699);}})[_0x7401('0x1f')](function(_0x14091f){if(_0x14091f){return _0x14091f?{'count':_0x368fe5,'rows':_0x14091f}:null;}})[_0x7401('0x1f')](respondWithResult(_0x584e10,null))[_0x7401('0x2a')](handleError(_0x584e10,null));}; \ No newline at end of file +var _0x6713=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','name','map','ChatQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','length','nolimit','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x263149,_0x1529c5){var _0x49c433=function(_0x189a39){while(--_0x189a39){_0x263149['push'](_0x263149['shift']());}};_0x49c433(++_0x1529c5);}(_0x6713,0x112));var _0x3671=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x6713[_0x343090];return _0x3ff3e8;};'use strict';var emlformat=require(_0x3671('0x0'));var rimraf=require(_0x3671('0x1'));var zipdir=require(_0x3671('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3671('0x3'));var moment=require(_0x3671('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3671('0x5'));var path=require('path');var sox=require(_0x3671('0x6'));var csv=require('to-csv');var ejs=require(_0x3671('0x7'));var fs=require('fs');var fs_extra=require(_0x3671('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3671('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3671('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3671('0xb'));var Papa=require(_0x3671('0xc'));var Redis=require(_0x3671('0xd'));var authService=require(_0x3671('0xe'));var qs=require(_0x3671('0xf'));var as=require(_0x3671('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3671('0x11'))('api');var utils=require(_0x3671('0x12'));var config=require(_0x3671('0x13'));var licenseUtil=require(_0x3671('0x14'));var db=require(_0x3671('0x15'))['db'];config['redis']=_[_0x3671('0x16')](config[_0x3671('0x17')],{'host':_0x3671('0x18'),'port':0x18eb});var socket=require(_0x3671('0x19'))(new Redis(config[_0x3671('0x17')]));require('./chatQueue.socket')[_0x3671('0x1a')](socket);var jayson=require(_0x3671('0x1b'));var client=jayson[_0x3671('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b9df,_0x508f5d,_0x765daa,_0x2d65f9){return new BPromise(function(_0x50bcce,_0x57adb9){var _0x186d85=_0x2d65f9||client;return _0x186d85[_0x3671('0x1d')](_0x53b9df,_0x765daa)[_0x3671('0x1e')](function(_0x2cbaba){logger[_0x3671('0x1f')](_0x3671('0x20'),_0x508f5d,_0x3671('0x21'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x508f5d,_0x3671('0x21'),JSON[_0x3671('0x22')](_0x2cbaba));if(_0x2cbaba[_0x3671('0x23')]){if(_0x2cbaba[_0x3671('0x23')][_0x3671('0x24')]===0x1f4){logger[_0x3671('0x23')](_0x3671('0x20'),_0x508f5d,_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);return _0x57adb9(_0x2cbaba['error']['message']);}logger['error'](_0x3671('0x20'),_0x508f5d,_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);return _0x50bcce(_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);}else{logger[_0x3671('0x1f')](_0x3671('0x20'),_0x508f5d,_0x3671('0x21'));_0x50bcce(_0x2cbaba[_0x3671('0x26')]['message']);}})['catch'](function(_0x1c566e){logger['error'](_0x3671('0x20'),_0x508f5d,_0x1c566e);_0x57adb9(_0x1c566e);});});}function respondWithStatusCode(_0x1ca26b,_0xbc35f6){_0xbc35f6=_0xbc35f6||0xcc;return function(_0x1bf11d){if(_0x1bf11d){return _0x1ca26b[_0x3671('0x27')](_0xbc35f6);}return _0x1ca26b[_0x3671('0x28')](_0xbc35f6)[_0x3671('0x29')]();};}function respondWithResult(_0x491465,_0x10e6b9){_0x10e6b9=_0x10e6b9||0xc8;return function(_0x184302){if(_0x184302){return _0x491465[_0x3671('0x28')](_0x10e6b9)[_0x3671('0x2a')](_0x184302);}};}function respondWithFilteredResult(_0x2720f2,_0x32d258){return function(_0x5cf443){if(_0x5cf443){var _0x5a487e=typeof _0x32d258[_0x3671('0x2b')]==='undefined'&&typeof _0x32d258[_0x3671('0x2c')]===_0x3671('0x2d');var _0xb44e80=_0x5cf443[_0x3671('0x2e')];var _0x4b17e8=_0x5a487e?0x0:_0x32d258[_0x3671('0x2b')];var _0x7dbdbf=_0x5a487e?_0x5cf443['count']:_0x32d258[_0x3671('0x2b')]+_0x32d258['limit'];var _0x5b30aa;if(_0x7dbdbf>=_0xb44e80){_0x7dbdbf=_0xb44e80;_0x5b30aa=0xc8;}else{_0x5b30aa=0xce;}_0x2720f2['status'](_0x5b30aa);return _0x2720f2[_0x3671('0x2f')](_0x3671('0x30'),_0x4b17e8+'-'+_0x7dbdbf+'/'+_0xb44e80)['json'](_0x5cf443);}return null;};}function patchUpdates(_0x38bf26){return function(_0x5e77ff){try{jsonpatch['apply'](_0x5e77ff,_0x38bf26,!![]);}catch(_0x2b39d6){return BPromise['reject'](_0x2b39d6);}return _0x5e77ff['save']();};}function saveUpdates(_0x14f95a,_0x2c3b42){return function(_0x462416){if(_0x462416){return _0x462416[_0x3671('0x31')](_0x14f95a)[_0x3671('0x1e')](function(_0x2b2ac3){return _0x2b2ac3;});}return null;};}function removeEntity(_0x2e2a48,_0x3e3806){return function(_0x2e51ca){if(_0x2e51ca){return _0x2e51ca[_0x3671('0x32')]()[_0x3671('0x1e')](function(){var _0x2777ba=_0x2e51ca[_0x3671('0x33')]({'plain':!![]});var _0x152ddf='ChatQueues';return db[_0x3671('0x34')]['destroy']({'where':{'type':_0x152ddf,'resourceId':_0x2777ba['id']}})[_0x3671('0x1e')](function(){return _0x2e51ca;});})[_0x3671('0x1e')](function(){_0x2e2a48['status'](0xcc)[_0x3671('0x29')]();});}};}function handleEntityNotFound(_0x17e22a,_0x56509a){return function(_0x5167b5){if(!_0x5167b5){_0x17e22a[_0x3671('0x27')](0x194);}return _0x5167b5;};}function handleError(_0xb7a8ee,_0x2ce012){_0x2ce012=_0x2ce012||0x1f4;return function(_0x5172b5){logger[_0x3671('0x23')](_0x5172b5['stack']);if(_0x5172b5[_0x3671('0x35')]){delete _0x5172b5[_0x3671('0x35')];}_0xb7a8ee['status'](_0x2ce012)['send'](_0x5172b5);};}exports['index']=function(_0x28a233,_0x52f145){var _0xe04a0c={},_0x2aa638={},_0x16a270={'count':0x0,'rows':[]};var _0x30e1dc=_[_0x3671('0x36')](db[_0x3671('0x37')][_0x3671('0x38')],function(_0x266a4d){return{'name':_0x266a4d[_0x3671('0x39')],'type':_0x266a4d[_0x3671('0x3a')]['key']};});_0x2aa638[_0x3671('0x3b')]=_[_0x3671('0x36')](_0x30e1dc,_0x3671('0x35'));_0x2aa638[_0x3671('0x3c')]=_['keys'](_0x28a233[_0x3671('0x3c')]);_0x2aa638[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x2aa638[_0x3671('0x3b')],_0x2aa638['query']);_0xe04a0c[_0x3671('0x3f')]=_['intersection'](_0x2aa638[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x28a233['query'][_0x3671('0x40')]));_0xe04a0c[_0x3671('0x3f')]=_0xe04a0c[_0x3671('0x3f')]['length']?_0xe04a0c[_0x3671('0x3f')]:_0x2aa638[_0x3671('0x3b')];if(!_0x28a233[_0x3671('0x3c')][_0x3671('0x41')]('nolimit')){_0xe04a0c[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0x28a233['query']['limit']);_0xe04a0c['offset']=qs['offset'](_0x28a233['query'][_0x3671('0x2b')]);}_0xe04a0c['order']=qs['sort'](_0x28a233['query'][_0x3671('0x42')]);_0xe04a0c[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0x28a233[_0x3671('0x3c')],_0x2aa638[_0x3671('0x3d')]),_0x30e1dc);if(_0x28a233[_0x3671('0x3c')][_0x3671('0x45')]){_0xe04a0c[_0x3671('0x43')]=_['merge'](_0xe04a0c[_0x3671('0x43')],{'$or':_[_0x3671('0x36')](_0x30e1dc,function(_0x5098bf){if(_0x5098bf[_0x3671('0x3a')]!==_0x3671('0x46')){var _0x51c92d={};_0x51c92d[_0x5098bf[_0x3671('0x35')]]={'$like':'%'+_0x28a233['query'][_0x3671('0x45')]+'%'};return _0x51c92d;}})});}_0xe04a0c=_[_0x3671('0x47')]({},_0xe04a0c,_0x28a233[_0x3671('0x48')]);var _0x132b52={'where':_0xe04a0c[_0x3671('0x43')]};return db[_0x3671('0x37')][_0x3671('0x2e')](_0x132b52)[_0x3671('0x1e')](function(_0x5ad692){_0x16a270['count']=_0x5ad692;if(_0x28a233[_0x3671('0x3c')]['includeAll']){_0xe04a0c[_0x3671('0x49')]=[{'all':!![]}];}return db['ChatQueue'][_0x3671('0x4a')](_0xe04a0c);})[_0x3671('0x1e')](function(_0x40d309){_0x16a270[_0x3671('0x4b')]=_0x40d309;return _0x16a270;})[_0x3671('0x1e')](respondWithFilteredResult(_0x52f145,_0xe04a0c))['catch'](handleError(_0x52f145,null));};exports[_0x3671('0x4c')]=function(_0x2c9cf7,_0x25c942){var _0x159be2={'raw':!![],'where':{'id':_0x2c9cf7[_0x3671('0x4d')]['id']}},_0x5222a4={};_0x5222a4[_0x3671('0x3b')]=_[_0x3671('0x4e')](db[_0x3671('0x37')][_0x3671('0x38')]);_0x5222a4[_0x3671('0x3c')]=_[_0x3671('0x4e')](_0x2c9cf7[_0x3671('0x3c')]);_0x5222a4['filters']=_[_0x3671('0x3e')](_0x5222a4['model'],_0x5222a4[_0x3671('0x3c')]);_0x159be2[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x5222a4[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x2c9cf7[_0x3671('0x3c')][_0x3671('0x40')]));_0x159be2['attributes']=_0x159be2[_0x3671('0x3f')]['length']?_0x159be2[_0x3671('0x3f')]:_0x5222a4[_0x3671('0x3b')];if(_0x2c9cf7[_0x3671('0x3c')]['includeAll']){_0x159be2[_0x3671('0x49')]=[{'all':!![]}];}_0x159be2=_['merge']({},_0x159be2,_0x2c9cf7[_0x3671('0x48')]);return db[_0x3671('0x37')][_0x3671('0x4f')](_0x159be2)[_0x3671('0x1e')](handleEntityNotFound(_0x25c942,null))[_0x3671('0x1e')](respondWithResult(_0x25c942,null))[_0x3671('0x50')](handleError(_0x25c942,null));};exports[_0x3671('0x51')]=function(_0x16e3c5,_0x57aa7d){return db[_0x3671('0x37')]['create'](_0x16e3c5['body'],{})[_0x3671('0x1e')](function(_0xa96db8){var _0x42fcb8=_0x16e3c5[_0x3671('0x52')][_0x3671('0x33')]({'plain':!![]});if(!_0x42fcb8)throw new Error(_0x3671('0x53'));if(_0x42fcb8[_0x3671('0x54')]===_0x3671('0x52')){var _0x12a95=_0xa96db8[_0x3671('0x33')]({'plain':!![]});var _0x3d6d28='ChatQueues';return db[_0x3671('0x55')][_0x3671('0x4f')]({'where':{'name':_0x3d6d28,'userProfileId':_0x42fcb8[_0x3671('0x56')]},'raw':!![]})[_0x3671('0x1e')](function(_0x2c3595){if(_0x2c3595&&_0x2c3595[_0x3671('0x57')]===0x0){return db['UserProfileResource'][_0x3671('0x51')]({'name':_0x12a95[_0x3671('0x35')],'resourceId':_0x12a95['id'],'type':_0x2c3595[_0x3671('0x35')],'sectionId':_0x2c3595['id']},{})[_0x3671('0x1e')](function(){return _0xa96db8;});}else{return _0xa96db8;}})[_0x3671('0x50')](function(_0x25c0a1){logger[_0x3671('0x23')](_0x3671('0x58'),_0x25c0a1);throw _0x25c0a1;});}return _0xa96db8;})[_0x3671('0x1e')](respondWithResult(_0x57aa7d,0xc9))[_0x3671('0x50')](handleError(_0x57aa7d,null));};exports[_0x3671('0x31')]=function(_0x46a19a,_0x541be8){if(_0x46a19a[_0x3671('0x59')]['id']){delete _0x46a19a[_0x3671('0x59')]['id'];}return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x46a19a[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x541be8,null))[_0x3671('0x1e')](saveUpdates(_0x46a19a[_0x3671('0x59')],null))[_0x3671('0x1e')](respondWithResult(_0x541be8,null))[_0x3671('0x50')](handleError(_0x541be8,null));};exports[_0x3671('0x32')]=function(_0x21ba83,_0x3a9fa7){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x21ba83[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x3a9fa7,null))[_0x3671('0x1e')](removeEntity(_0x3a9fa7,null))[_0x3671('0x50')](handleError(_0x3a9fa7,null));};exports[_0x3671('0x5a')]=function(_0x5abba8,_0x15ce03){return db[_0x3671('0x37')][_0x3671('0x5a')]()[_0x3671('0x1e')](respondWithResult(_0x15ce03,null))[_0x3671('0x50')](handleError(_0x15ce03,null));};exports['getMembers']=function(_0x5a0ece,_0x2be030,_0x1d3683){var _0x45075c={'raw':!![],'where':{}},_0x9256ef={},_0x51586e;return db[_0x3671('0x37')][_0x3671('0x5b')]({'where':{'id':_0x5a0ece['params']['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x2be030,null))[_0x3671('0x1e')](function(_0x56d7db){if(_0x56d7db){_0x51586e=_0x56d7db[_0x3671('0x33')]({'plain':!![]});_0x9256ef['model']=_[_0x3671('0x4e')](db[_0x3671('0x5c')][_0x3671('0x38')]);_0x9256ef[_0x3671('0x3c')]=_['keys'](_0x5a0ece[_0x3671('0x3c')]);_0x9256ef[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x9256ef[_0x3671('0x3b')],_0x9256ef[_0x3671('0x3c')]);_0x45075c[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x9256ef[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x5a0ece[_0x3671('0x3c')][_0x3671('0x40')]));_0x45075c[_0x3671('0x3f')]=_0x45075c[_0x3671('0x3f')][_0x3671('0x5d')]?_0x45075c[_0x3671('0x3f')]:_0x9256ef['model'];if(!_0x5a0ece[_0x3671('0x3c')][_0x3671('0x41')](_0x3671('0x5e'))){_0x45075c[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0x5a0ece['query'][_0x3671('0x2c')]);_0x45075c['offset']=qs[_0x3671('0x2b')](_0x5a0ece[_0x3671('0x3c')]['offset']);}_0x45075c[_0x3671('0x5f')]=qs['sort'](_0x5a0ece['query'][_0x3671('0x42')]);_0x45075c[_0x3671('0x43')]=qs['filters'](_[_0x3671('0x44')](_0x5a0ece[_0x3671('0x3c')],_0x9256ef[_0x3671('0x3d')]));_0x45075c['where'][_0x3671('0x60')]=_0x56d7db['id'];if(_0x5a0ece[_0x3671('0x3c')][_0x3671('0x45')]){_0x45075c[_0x3671('0x43')]=_[_0x3671('0x47')](_0x45075c['where'],{'$or':_[_0x3671('0x36')](_0x45075c[_0x3671('0x3f')],function(_0x1ab6ce){var _0x5e4557={};_0x5e4557[_0x1ab6ce]={'$like':'%'+_0x5a0ece[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x5e4557;})});}_0x45075c=_[_0x3671('0x47')]({},_0x45075c,_0x5a0ece['options']);return db[_0x3671('0x5c')][_0x3671('0x4a')](_0x45075c);}})[_0x3671('0x1e')](function(_0x3942c2){if(_0x3942c2){return db[_0x3671('0x61')]['findAndCountAll']({'where':{'id':_[_0x3671('0x36')](_0x3942c2,_0x3671('0x62')),'role':_0x3671('0x63')},'attributes':['id',_0x3671('0x35'),_0x3671('0x64'),_0x3671('0x65'),_0x3671('0x66')]});}})['then'](function(_0x2a08cf){if(_0x2a08cf){return{'count':_0x2a08cf['count'],'rows':_[_0x3671('0x36')](_0x2a08cf[_0x3671('0x4b')],function(_0x36e1c6){return{'membername':_0x36e1c6[_0x3671('0x35')],'UserId':_0x36e1c6['id'],'queue_name':_0x51586e[_0x3671('0x35')],'ChatQueueId':_0x51586e['id'],'interface':util[_0x3671('0x67')](_0x3671('0x68'),_0x3671('0x69'),_0x36e1c6[_0x3671('0x35')]),'penalty':0x0,'paused':_0x36e1c6[_0x3671('0x64')],'createdAt':_0x36e1c6[_0x3671('0x66')],'updatedAt':_0x36e1c6[_0x3671('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3671('0x1e')](respondWithFilteredResult(_0x2be030,_0x45075c))[_0x3671('0x50')](handleError(_0x2be030,null));};exports[_0x3671('0x6a')]=function(_0xaf3d09,_0x567c1d,_0x23b647){var _0x5e7528={};var _0x3fb376={};var _0x4bd66b;var _0xa342b;return db[_0x3671('0x37')]['findOne']({'where':{'id':_0xaf3d09[_0x3671('0x4d')]['id']}})['then'](handleEntityNotFound(_0x567c1d,null))[_0x3671('0x1e')](function(_0x5adf6a){if(_0x5adf6a){_0x4bd66b=_0x5adf6a;_0x3fb376[_0x3671('0x3b')]=_[_0x3671('0x4e')](db[_0x3671('0x6b')]['rawAttributes']);_0x3fb376[_0x3671('0x3c')]=_['keys'](_0xaf3d09[_0x3671('0x3c')]);_0x3fb376[_0x3671('0x3d')]=_['intersection'](_0x3fb376[_0x3671('0x3b')],_0x3fb376[_0x3671('0x3c')]);_0x5e7528[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x3fb376[_0x3671('0x3b')],qs[_0x3671('0x40')](_0xaf3d09['query']['fields']));_0x5e7528[_0x3671('0x3f')]=_0x5e7528[_0x3671('0x3f')][_0x3671('0x5d')]?_0x5e7528[_0x3671('0x3f')]:_0x3fb376[_0x3671('0x3b')];_0x5e7528[_0x3671('0x5f')]=qs['sort'](_0xaf3d09[_0x3671('0x3c')][_0x3671('0x42')]);_0x5e7528[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0xaf3d09[_0x3671('0x3c')],_0x3fb376[_0x3671('0x3d')]));if(_0xaf3d09[_0x3671('0x3c')][_0x3671('0x45')]){_0x5e7528['where']=_[_0x3671('0x47')](_0x5e7528['where'],{'$or':_[_0x3671('0x36')](_0x5e7528['attributes'],function(_0x41d937){var _0x4e743e={};_0x4e743e[_0x41d937]={'$like':'%'+_0xaf3d09[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x4e743e;})});}_0x5e7528=_['merge']({},_0x5e7528,_0xaf3d09['options']);return _0x4bd66b[_0x3671('0x6a')](_0x5e7528);}})['then'](function(_0x2b61ae){if(_0x2b61ae){_0xa342b=_0x2b61ae[_0x3671('0x5d')];if(!_0xaf3d09[_0x3671('0x3c')]['hasOwnProperty'](_0x3671('0x5e'))){_0x5e7528[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0xaf3d09['query'][_0x3671('0x2c')]);_0x5e7528[_0x3671('0x2b')]=qs[_0x3671('0x2b')](_0xaf3d09['query']['offset']);}return _0x4bd66b[_0x3671('0x6a')](_0x5e7528);}})[_0x3671('0x1e')](function(_0x5b0ee0){if(_0x5b0ee0){return _0x5b0ee0?{'count':_0xa342b,'rows':_0x5b0ee0}:null;}})[_0x3671('0x1e')](respondWithResult(_0x567c1d,null))['catch'](handleError(_0x567c1d,null));};exports[_0x3671('0x6c')]=function(_0x5de147,_0xc3dfcf,_0xf3f272){var _0x28278f=_0x5de147[_0x3671('0x59')][_0x3671('0x6d')];return db['Team']['findAll']({'where':{'id':_0x28278f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x3671('0x35'),_0x3671('0x6e'),_0x3671('0x6f'),_0x3671('0x70')],'raw':!![]}]})[_0x3671('0x1e')](function(_0x288f49){if(_0x288f49){var _0x2a94e8=_[_0x3671('0x71')](_0x288f49,function(_0x309ee9){var _0xaf8224=_0x309ee9[_0x3671('0x33')]({'plain':!![]});return _0xaf8224['Agents'];});return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x5de147[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](function(_0x2efd82){return db[_0x3671('0x72')]['transaction'](function(_0x53d32f){return _0x2efd82[_0x3671('0x6c')](_0x28278f,{'transaction':_0x53d32f})[_0x3671('0x1e')](function(){return BPromise[_0x3671('0x73')](_0x2a94e8,function(_0x5f3bf3){return db['UserChatQueue'][_0x3671('0x74')]({'where':{'UserId':_0x5f3bf3['id'],'ChatQueueId':_0x5de147[_0x3671('0x4d')]['id']},'transaction':_0x53d32f});});})[_0x3671('0x1e')](function(){_0x2a94e8[_0x3671('0x75')](function(_0x59efa9){socket[_0x3671('0x76')](_0x3671('0x77'),{'UserId':_0x59efa9['id'],'ChatQueueId':_0x2efd82['id']});});});});});}})[_0x3671('0x1e')](respondWithStatusCode(_0xc3dfcf,null))[_0x3671('0x50')](handleError(_0xc3dfcf,null));};exports[_0x3671('0x78')]=function(_0x2da42d,_0x1e5b25,_0x151133){return db[_0x3671('0x6b')][_0x3671('0x4a')]({'where':{'id':_0x2da42d[_0x3671('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3671('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3671('0x1e')](handleEntityNotFound(_0x1e5b25,null))[_0x3671('0x1e')](function(_0x59f3e8){var _0x135d86=_[_0x3671('0x36')](_0x59f3e8,'id');var _0xd7b0f3=[];var _0xba0076=[];var _0x412051=squel['select']();_0x412051['field'](_0x3671('0x79'))[_0x3671('0x7a')](_0x3671('0x7b'),'tq')['join'](_0x3671('0x7c'),'ut',_0x3671('0x7d'))[_0x3671('0x43')](_0x3671('0x7e'),_0x2da42d[_0x3671('0x4d')]['id']);for(var _0x5143ab=0x0;_0x5143ab<_0x59f3e8[_0x3671('0x5d')];_0x5143ab+=0x1){let _0x4f12da=_0x59f3e8[_0x5143ab];for(var _0x13b51d=0x0;_0x13b51d<_0x4f12da['Agents'][_0x3671('0x5d')];_0x13b51d+=0x1){let _0x3f10e4=_0x4f12da['Agents'][_0x13b51d];var _0x2c983a=_0x412051['clone']();_0x2c983a[_0x3671('0x43')](_0x3671('0x7f'),_0x3f10e4['id']);_0xba0076[_0x3671('0x80')](db['sequelize'][_0x3671('0x3c')](_0x2c983a[_0x3671('0x81')](),{'type':db[_0x3671('0x72')][_0x3671('0x82')][_0x3671('0x83')]})[_0x3671('0x1e')](function(_0x17c69f){if(_0x17c69f['length']===0x1){return _0x3f10e4['id'];}else{var _0x3e09c5=_['every'](_[_0x3671('0x36')](_0x17c69f,_0x3671('0x84')),function(_0x3c9799){return _[_0x3671('0x85')](_0x135d86,_0x3c9799);});if(_0x3e09c5){return _0x3f10e4['id'];}}}));}}return BPromise['all'](_0xba0076)['then'](function(_0x1c80db){_0xd7b0f3=_(_0xd7b0f3)[_0x3671('0x86')](_0x1c80db)[_0x3671('0x87')]()['value']();return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x2da42d['params']['id']}})[_0x3671('0x1e')](function(_0x56b57a){return db[_0x3671('0x72')][_0x3671('0x88')](function(_0x9d7615){return _0x56b57a[_0x3671('0x78')](_0x2da42d[_0x3671('0x3c')][_0x3671('0x6d')],{'transaction':_0x9d7615})[_0x3671('0x1e')](function(){if(!_[_0x3671('0x89')](_0xd7b0f3)){return _0x56b57a[_0x3671('0x8a')](_0xd7b0f3,{'transaction':_0x9d7615});}})['then'](function(){_0xd7b0f3['forEach'](function(_0x27f129){socket['emit'](_0x3671('0x8b'),{'UserId':_0x27f129,'ChatQueueId':_0x56b57a['id']});});});});});});})['then'](respondWithStatusCode(_0x1e5b25,null))[_0x3671('0x50')](handleError(_0x1e5b25,null));};exports[_0x3671('0x8c')]=function(_0x3ccf90,_0x4361a0,_0x4bda5a){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x3ccf90[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x4361a0,null))[_0x3671('0x1e')](function(_0x236714){if(_0x236714){return _0x236714[_0x3671('0x8c')](_0x3ccf90[_0x3671('0x59')][_0x3671('0x6d')],_[_0x3671('0x8d')](_0x3ccf90[_0x3671('0x59')],[_0x3671('0x6d'),'id'])||{})['spread'](function(_0x29d083){for(var _0x14d685=0x0;_0x14d685<_0x3ccf90[_0x3671('0x59')]['ids'][_0x3671('0x5d')];_0x14d685+=0x1){socket[_0x3671('0x76')](_0x3671('0x77'),{'UserId':Number(_0x3ccf90[_0x3671('0x59')][_0x3671('0x6d')][_0x14d685]),'ChatQueueId':Number(_0x3ccf90[_0x3671('0x4d')]['id'])});}return _0x29d083;});}})[_0x3671('0x1e')](respondWithResult(_0x4361a0,null))[_0x3671('0x50')](handleError(_0x4361a0,null));};exports['removeAgents']=function(_0xbaea02,_0x1db395,_0x243062){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0xbaea02[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x1db395,null))['then'](function(_0x195fea){if(_0x195fea){return _0x195fea[_0x3671('0x8a')](_0xbaea02['query'][_0x3671('0x6d')])[_0x3671('0x1e')](function(){if(_[_0x3671('0x8e')](_0xbaea02[_0x3671('0x3c')][_0x3671('0x6d')])){for(var _0x19b2fc=0x0;_0x19b2fc<_0xbaea02['query'][_0x3671('0x6d')][_0x3671('0x5d')];_0x19b2fc+=0x1){socket[_0x3671('0x76')]('userChatQueue:remove',{'UserId':Number(_0xbaea02[_0x3671('0x3c')]['ids'][_0x19b2fc]),'ChatQueueId':Number(_0xbaea02[_0x3671('0x4d')]['id'])});}}else{socket[_0x3671('0x76')](_0x3671('0x8b'),{'UserId':Number(_0xbaea02[_0x3671('0x3c')]['ids']),'ChatQueueId':Number(_0xbaea02[_0x3671('0x4d')]['id'])});}});}})[_0x3671('0x1e')](respondWithStatusCode(_0x1db395,null))[_0x3671('0x50')](handleError(_0x1db395,null));};exports[_0x3671('0x8f')]=function(_0xbc2696,_0x3d3bc9,_0x135286){var _0x1469b9={};var _0x4cf558={};var _0x588e23;var _0xcca819;return db[_0x3671('0x37')][_0x3671('0x5b')]({'where':{'id':_0xbc2696[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x3d3bc9,null))[_0x3671('0x1e')](function(_0x19ff6c){if(_0x19ff6c){_0x588e23=_0x19ff6c;_0x4cf558['model']=_[_0x3671('0x4e')](db[_0x3671('0x61')][_0x3671('0x38')]);_0x4cf558['query']=_[_0x3671('0x4e')](_0xbc2696['query']);_0x4cf558[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x4cf558[_0x3671('0x3b')],_0x4cf558[_0x3671('0x3c')]);_0x1469b9[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x4cf558[_0x3671('0x3b')],qs['fields'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x40')]));_0x1469b9[_0x3671('0x3f')]=_0x1469b9[_0x3671('0x3f')]['length']?_0x1469b9[_0x3671('0x3f')]:_0x4cf558[_0x3671('0x3b')];_0x1469b9['order']=qs['sort'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x42')]);_0x1469b9[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0xbc2696['query'],_0x4cf558[_0x3671('0x3d')]));if(_0xbc2696[_0x3671('0x3c')]['filter']){_0x1469b9['where']=_[_0x3671('0x47')](_0x1469b9[_0x3671('0x43')],{'$or':_['map'](_0x1469b9[_0x3671('0x3f')],function(_0x552667){var _0x1af9f2={};_0x1af9f2[_0x552667]={'$like':'%'+_0xbc2696[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x1af9f2;})});}_0x1469b9=_['merge']({},_0x1469b9,_0xbc2696[_0x3671('0x48')]);return _0x588e23[_0x3671('0x8f')](_0x1469b9);}})['then'](function(_0x47b3af){if(_0x47b3af){_0xcca819=_0x47b3af['length'];if(!_0xbc2696[_0x3671('0x3c')][_0x3671('0x41')](_0x3671('0x5e'))){_0x1469b9[_0x3671('0x2c')]=qs['limit'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x2c')]);_0x1469b9[_0x3671('0x2b')]=qs[_0x3671('0x2b')](_0xbc2696[_0x3671('0x3c')][_0x3671('0x2b')]);}return _0x588e23[_0x3671('0x8f')](_0x1469b9);}})['then'](function(_0x9ac553){if(_0x9ac553){return _0x9ac553?{'count':_0xcca819,'rows':_0x9ac553}:null;}})[_0x3671('0x1e')](respondWithResult(_0x3d3bc9,null))['catch'](handleError(_0x3d3bc9,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 304c523..775a539 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 _0x1be2=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x24887c,_0x590c42){var _0x47ccce=function(_0x4f09ff){while(--_0x4f09ff){_0x24887c['push'](_0x24887c['shift']());}};_0x47ccce(++_0x590c42);}(_0x1be2,0x181));var _0x21be=function(_0x171f39,_0x409908){_0x171f39=_0x171f39-0x0;var _0x5ac531=_0x1be2[_0x171f39];return _0x5ac531;};'use strict';var EventEmitter=require(_0x21be('0x0'));var ChatQueue=require(_0x21be('0x1'))['db'][_0x21be('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x21be('0x3')](0x0);var events={'afterCreate':_0x21be('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a2500){return function(_0x5bec9a,_0x55e8e4,_0x318576){ChatQueueEvents[_0x21be('0x5')](_0x4a2500+':'+_0x5bec9a['id'],_0x5bec9a);ChatQueueEvents[_0x21be('0x5')](_0x4a2500,_0x5bec9a);_0x318576(null);};}for(var e in events){if(events[_0x21be('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x21be('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x75df=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove'];(function(_0x2ed95a,_0x334656){var _0x57cd63=function(_0x5d36d9){while(--_0x5d36d9){_0x2ed95a['push'](_0x2ed95a['shift']());}};_0x57cd63(++_0x334656);}(_0x75df,0x1e9));var _0xf75d=function(_0xf88ceb,_0x151528){_0xf88ceb=_0xf88ceb-0x0;var _0x217c3a=_0x75df[_0xf88ceb];return _0x217c3a;};'use strict';var EventEmitter=require(_0xf75d('0x0'));var ChatQueue=require(_0xf75d('0x1'))['db'][_0xf75d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf75d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf75d('0x4'),'afterDestroy':_0xf75d('0x5')};function emitEvent(_0x397c53){return function(_0x359de0,_0x306aec,_0x4f8bcf){ChatQueueEvents[_0xf75d('0x6')](_0x397c53+':'+_0x359de0['id'],_0x359de0);ChatQueueEvents[_0xf75d('0x6')](_0x397c53,_0x359de0);_0x4f8bcf(null);};}for(var e in events){if(events[_0xf75d('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf75d('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 27e431a..f4a1f68 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 _0x38bf=['../../config/environment','exports','define','chat_queues','lodash','api','moment','request-promise','path'];(function(_0x40a07e,_0xd73e78){var _0x2e4529=function(_0x3d9c50){while(--_0x3d9c50){_0x40a07e['push'](_0x40a07e['shift']());}};_0x2e4529(++_0xd73e78);}(_0x38bf,0x94));var _0xf38b=function(_0x94da2a,_0x97856e){_0x94da2a=_0x94da2a-0x0;var _0x42bf5c=_0x38bf[_0x94da2a];return _0x42bf5c;};'use strict';var _=require(_0xf38b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf38b('0x1'));var moment=require(_0xf38b('0x2'));var BPromise=require('bluebird');var rp=require(_0xf38b('0x3'));var fs=require('fs');var path=require(_0xf38b('0x4'));var rimraf=require('rimraf');var config=require(_0xf38b('0x5'));var attributes=require('./chatQueue.attributes');module[_0xf38b('0x6')]=function(_0x3afdd8,_0x2b4081){return _0x3afdd8[_0xf38b('0x7')]('ChatQueue',attributes,{'tableName':_0xf38b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0390=['../../config/logger','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x23b38e,_0x5df2a5){var _0x28723b=function(_0x4e6420){while(--_0x4e6420){_0x23b38e['push'](_0x23b38e['shift']());}};_0x28723b(++_0x5df2a5);}(_0x0390,0x112));var _0x0039=function(_0x80ee51,_0x3ca199){_0x80ee51=_0x80ee51-0x0;var _0x4f20ef=_0x0390[_0x80ee51];return _0x4f20ef;};'use strict';var _=require(_0x0039('0x0'));var util=require(_0x0039('0x1'));var logger=require(_0x0039('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0039('0x3'));var rp=require(_0x0039('0x4'));var fs=require('fs');var path=require(_0x0039('0x5'));var rimraf=require(_0x0039('0x6'));var config=require('../../config/environment');var attributes=require(_0x0039('0x7'));module[_0x0039('0x8')]=function(_0x42cc63,_0x1bfd94){return _0x42cc63[_0x0039('0x9')](_0x0039('0xa'),attributes,{'tableName':_0x0039('0xb'),'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 13e8872..6dd25f2 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 _0x4255=['ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','ShowChatQueue','find','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then'];(function(_0x51b829,_0xb2594c){var _0x12437a=function(_0x480822){while(--_0x480822){_0x51b829['push'](_0x51b829['shift']());}};_0x12437a(++_0xb2594c);}(_0x4255,0x1bb));var _0x5425=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x4255[_0x31eb67];return _0x2a8cb8;};'use strict';var _=require(_0x5425('0x0'));var util=require('util');var moment=require(_0x5425('0x1'));var BPromise=require(_0x5425('0x2'));var rs=require(_0x5425('0x3'));var fs=require('fs');var Redis=require(_0x5425('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5425('0x5'));var logger=require(_0x5425('0x6'))(_0x5425('0x7'));var config=require(_0x5425('0x8'));var jayson=require(_0x5425('0x9'));var client=jayson[_0x5425('0xa')][_0x5425('0xb')]({'port':0x232a});config[_0x5425('0xc')]=_[_0x5425('0xd')](config[_0x5425('0xc')],{'host':_0x5425('0xe'),'port':0x18eb});var socket=require(_0x5425('0xf'))(new Redis(config['redis']));require(_0x5425('0x10'))[_0x5425('0x11')](socket);function respondWithRpcPromise(_0x5dc37b,_0x362828,_0x5868a2){return new BPromise(function(_0x5f1de6,_0xd7cce2){return client['request'](_0x5dc37b,_0x5868a2)[_0x5425('0x12')](function(_0x3ec0f4){logger['info'](_0x5425('0x13'),_0x362828,'request\x20sent');logger[_0x5425('0x14')](_0x5425('0x15'),_0x362828,_0x5425('0x16'),JSON['stringify'](_0x3ec0f4));if(_0x3ec0f4[_0x5425('0x17')]){if(_0x3ec0f4['error'][_0x5425('0x18')]===0x1f4){logger['error'](_0x5425('0x13'),_0x362828,_0x3ec0f4[_0x5425('0x17')][_0x5425('0x19')]);return _0xd7cce2(_0x3ec0f4[_0x5425('0x17')][_0x5425('0x19')]);}logger[_0x5425('0x17')]('ChatQueue,\x20%s,\x20%s',_0x362828,_0x3ec0f4[_0x5425('0x17')]['message']);return _0x5f1de6(_0x3ec0f4[_0x5425('0x17')][_0x5425('0x19')]);}else{logger[_0x5425('0x1a')](_0x5425('0x13'),_0x362828,'request\x20sent');_0x5f1de6(_0x3ec0f4[_0x5425('0x1b')]['message']);}})[_0x5425('0x1c')](function(_0x5744fe){logger[_0x5425('0x17')]('ChatQueue,\x20%s,\x20%s',_0x362828,_0x5744fe);_0xd7cce2(_0x5744fe);});});}exports[_0x5425('0x1d')]=function(_0x545b31){var _0x2bd987=this;return new Promise(function(_0x57865d,_0x440c2e){return db[_0x5425('0x1e')][_0x5425('0x1f')]({'raw':_0x545b31[_0x5425('0x20')]?_0x545b31[_0x5425('0x20')][_0x5425('0x21')]===undefined?!![]:![]:!![],'where':_0x545b31[_0x5425('0x20')]?_0x545b31[_0x5425('0x20')]['where']||null:null,'attributes':_0x545b31[_0x5425('0x20')]?_0x545b31[_0x5425('0x20')][_0x5425('0x22')]||null:null,'limit':_0x545b31[_0x5425('0x20')]?_0x545b31[_0x5425('0x20')][_0x5425('0x23')]||null:null,'include':_0x545b31['options']?_0x545b31[_0x5425('0x20')][_0x5425('0x24')]?_[_0x5425('0x25')](_0x545b31['options'][_0x5425('0x24')],function(_0x52ae71){return{'model':db[_0x52ae71[_0x5425('0x26')]],'as':_0x52ae71['as'],'attributes':_0x52ae71[_0x5425('0x22')],'include':_0x52ae71[_0x5425('0x24')]?_[_0x5425('0x25')](_0x52ae71[_0x5425('0x24')],function(_0x470c15){return{'model':db[_0x470c15['model']],'as':_0x470c15['as'],'attributes':_0x470c15[_0x5425('0x22')],'include':_0x470c15[_0x5425('0x24')]?_['map'](_0x470c15[_0x5425('0x24')],function(_0x38809b){return{'model':db[_0x38809b[_0x5425('0x26')]],'as':_0x38809b['as'],'attributes':_0x38809b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5425('0x12')](function(_0xf67695){logger['info']('GetChatQueue',_0x545b31);logger['debug'](_0x5425('0x1d'),_0x545b31,JSON['stringify'](_0xf67695));_0x57865d(_0xf67695);})[_0x5425('0x1c')](function(_0x4d0f9b){logger[_0x5425('0x17')](_0x5425('0x1d'),_0x4d0f9b[_0x5425('0x19')],_0x545b31);_0x440c2e(_0x2bd987[_0x5425('0x17')](0x1f4,_0x4d0f9b['message']));});});};exports[_0x5425('0x27')]=function(_0x1fd424){var _0x5c1619=this;return new Promise(function(_0x3eadfc,_0x5aa53e){return db['ChatQueue'][_0x5425('0x28')]({'raw':_0x1fd424[_0x5425('0x20')]?_0x1fd424['options'][_0x5425('0x21')]===undefined?!![]:![]:!![],'where':_0x1fd424[_0x5425('0x20')]?_0x1fd424['options']['where']||null:null,'attributes':_0x1fd424[_0x5425('0x20')]?_0x1fd424['options'][_0x5425('0x22')]||null:null,'include':_0x1fd424['options']?_0x1fd424[_0x5425('0x20')][_0x5425('0x24')]?_['map'](_0x1fd424[_0x5425('0x20')][_0x5425('0x24')],function(_0xa86e02){return{'model':db[_0xa86e02[_0x5425('0x26')]],'as':_0xa86e02['as'],'attributes':_0xa86e02['attributes'],'include':_0xa86e02['include']?_[_0x5425('0x25')](_0xa86e02['include'],function(_0x998212){return{'model':db[_0x998212[_0x5425('0x26')]],'as':_0x998212['as'],'attributes':_0x998212[_0x5425('0x22')],'include':_0x998212[_0x5425('0x24')]?_['map'](_0x998212['include'],function(_0x50895d){return{'model':db[_0x50895d['model']],'as':_0x50895d['as'],'attributes':_0x50895d[_0x5425('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5425('0x12')](function(_0x39cb54){logger[_0x5425('0x1a')](_0x5425('0x27'),_0x1fd424);logger[_0x5425('0x14')](_0x5425('0x27'),_0x1fd424,JSON[_0x5425('0x29')](_0x39cb54));_0x3eadfc(_0x39cb54);})[_0x5425('0x1c')](function(_0x49f8cf){logger[_0x5425('0x17')](_0x5425('0x27'),_0x49f8cf[_0x5425('0x19')],_0x1fd424);_0x5aa53e(_0x5c1619['error'](0x1f4,_0x49f8cf[_0x5425('0x19')]));});});}; \ No newline at end of file +var _0x3276=['model','map','ShowChatQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x318248,_0x3d2dbc){var _0x3eb033=function(_0xb4dce){while(--_0xb4dce){_0x318248['push'](_0x318248['shift']());}};_0x3eb033(++_0x3d2dbc);}(_0x3276,0xc7));var _0x6327=function(_0x4c6e82,_0x1cfb6f){_0x4c6e82=_0x4c6e82-0x0;var _0x30785b=_0x3276[_0x4c6e82];return _0x30785b;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6327('0x1'));var rs=require(_0x6327('0x2'));var fs=require('fs');var Redis=require(_0x6327('0x3'));var db=require(_0x6327('0x4'))['db'];var utils=require(_0x6327('0x5'));var logger=require(_0x6327('0x6'))(_0x6327('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6327('0x8')][_0x6327('0x9')]({'port':0x232a});config[_0x6327('0xa')]=_['defaults'](config[_0x6327('0xa')],{'host':_0x6327('0xb'),'port':0x18eb});var socket=require(_0x6327('0xc'))(new Redis(config[_0x6327('0xa')]));require('./chatQueue.socket')[_0x6327('0xd')](socket);function respondWithRpcPromise(_0x1687c4,_0x4e8256,_0x443b6f){return new BPromise(function(_0x289415,_0x572a9f){return client[_0x6327('0xe')](_0x1687c4,_0x443b6f)[_0x6327('0xf')](function(_0x95c9be){logger['info'](_0x6327('0x10'),_0x4e8256,_0x6327('0x11'));logger[_0x6327('0x12')](_0x6327('0x13'),_0x4e8256,_0x6327('0x11'),JSON[_0x6327('0x14')](_0x95c9be));if(_0x95c9be[_0x6327('0x15')]){if(_0x95c9be[_0x6327('0x15')][_0x6327('0x16')]===0x1f4){logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x95c9be[_0x6327('0x15')]['message']);return _0x572a9f(_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);}logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);return _0x289415(_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);}else{logger[_0x6327('0x18')](_0x6327('0x10'),_0x4e8256,_0x6327('0x11'));_0x289415(_0x95c9be[_0x6327('0x19')][_0x6327('0x17')]);}})[_0x6327('0x1a')](function(_0x7168f7){logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x7168f7);_0x572a9f(_0x7168f7);});});}exports[_0x6327('0x1b')]=function(_0x12c33f){var _0x29b061=this;return new Promise(function(_0x341916,_0x4cbc80){return db['ChatQueue'][_0x6327('0x1c')]({'raw':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x1e')]===undefined?!![]:![]:!![],'where':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x1f')]||null:null,'attributes':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x20')]||null:null,'limit':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x21')]||null:null,'include':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x22')]?_['map'](_0x12c33f['options'][_0x6327('0x22')],function(_0x499321){return{'model':db[_0x499321[_0x6327('0x23')]],'as':_0x499321['as'],'attributes':_0x499321['attributes'],'include':_0x499321[_0x6327('0x22')]?_['map'](_0x499321[_0x6327('0x22')],function(_0x1eae65){return{'model':db[_0x1eae65['model']],'as':_0x1eae65['as'],'attributes':_0x1eae65[_0x6327('0x20')],'include':_0x1eae65[_0x6327('0x22')]?_[_0x6327('0x24')](_0x1eae65[_0x6327('0x22')],function(_0x894157){return{'model':db[_0x894157[_0x6327('0x23')]],'as':_0x894157['as'],'attributes':_0x894157[_0x6327('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6327('0xf')](function(_0x58b590){logger[_0x6327('0x18')](_0x6327('0x1b'),_0x12c33f);logger['debug'](_0x6327('0x1b'),_0x12c33f,JSON[_0x6327('0x14')](_0x58b590));_0x341916(_0x58b590);})['catch'](function(_0x43bcd0){logger[_0x6327('0x15')](_0x6327('0x1b'),_0x43bcd0['message'],_0x12c33f);_0x4cbc80(_0x29b061[_0x6327('0x15')](0x1f4,_0x43bcd0[_0x6327('0x17')]));});});};exports[_0x6327('0x25')]=function(_0x2c986a){var _0x523b52=this;return new Promise(function(_0xf7b0a3,_0x543d31){return db['ChatQueue'][_0x6327('0x26')]({'raw':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')][_0x6327('0x1e')]===undefined?!![]:![]:!![],'where':_0x2c986a['options']?_0x2c986a[_0x6327('0x1d')][_0x6327('0x1f')]||null:null,'attributes':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')]['attributes']||null:null,'include':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')][_0x6327('0x22')]?_['map'](_0x2c986a[_0x6327('0x1d')][_0x6327('0x22')],function(_0x456090){return{'model':db[_0x456090['model']],'as':_0x456090['as'],'attributes':_0x456090['attributes'],'include':_0x456090[_0x6327('0x22')]?_['map'](_0x456090[_0x6327('0x22')],function(_0x4b3d89){return{'model':db[_0x4b3d89[_0x6327('0x23')]],'as':_0x4b3d89['as'],'attributes':_0x4b3d89[_0x6327('0x20')],'include':_0x4b3d89[_0x6327('0x22')]?_[_0x6327('0x24')](_0x4b3d89[_0x6327('0x22')],function(_0x2b1982){return{'model':db[_0x2b1982['model']],'as':_0x2b1982['as'],'attributes':_0x2b1982[_0x6327('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6327('0xf')](function(_0x154733){logger[_0x6327('0x18')]('ShowChatQueue',_0x2c986a);logger['debug'](_0x6327('0x25'),_0x2c986a,JSON[_0x6327('0x14')](_0x154733));_0xf7b0a3(_0x154733);})[_0x6327('0x1a')](function(_0x2b1b3f){logger[_0x6327('0x15')]('ShowChatQueue',_0x2b1b3f[_0x6327('0x17')],_0x2c986a);_0x543d31(_0x523b52[_0x6327('0x15')](0x1f4,_0x2b1b3f[_0x6327('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3dbeb73..bff65b2 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 _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x2356b0,_0xd4749e){var _0x3adba4=function(_0x5d0710){while(--_0x5d0710){_0x2356b0['push'](_0x2356b0['shift']());}};_0x3adba4(++_0xd4749e);}(_0x303a,0x1a0));var _0xa303=function(_0x1f7928,_0xdafed0){_0x1f7928=_0x1f7928-0x0;var _0x498443=_0x303a[_0x1f7928];return _0x498443;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}}; \ No newline at end of file +var _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xb903,0x185));var _0x3b90=function(_0x13d403,_0x21edc6){_0x13d403=_0x13d403-0x0;var _0x56d417=_0xb903[_0x13d403];return _0x56d417;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4a59664..3b1855c 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x18f3ac,_0x59881c){_0x18f3ac=_0x18f3ac-0x0;var _0x1e6827=_0x3e74[_0x18f3ac];return _0x1e6827;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=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(_0x160ad5,_0x596e86){var _0x11fb42=function(_0x1fdaa5){while(--_0x1fdaa5){_0x160ad5['push'](_0x160ad5['shift']());}};_0x11fb42(++_0x596e86);}(_0x008c,0x188));var _0xc008=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0x008c[_0x32084f];return _0x187302;};'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 f1658a7..894fe54 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 _0x584f=['moment','sequelize','STRING','DATE'];(function(_0x22ca83,_0x269b98){var _0x555363=function(_0x3c5f3d){while(--_0x3c5f3d){_0x22ca83['push'](_0x22ca83['shift']());}};_0x555363(++_0x269b98);}(_0x584f,0x108));var _0xf584=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0x584f[_0x45dd0e];return _0x50e5ca;};'use strict';var moment=require(_0xf584('0x0'));var Sequelize=require(_0xf584('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf584('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf584('0x2')]},'joinAt':{'type':Sequelize[_0xf584('0x3')]},'leaveAt':{'type':Sequelize[_0xf584('0x3')]},'acceptAt':{'type':Sequelize[_0xf584('0x3')]},'exitAt':{'type':Sequelize[_0xf584('0x3')]},'reason':{'type':Sequelize[_0xf584('0x2')]}}; \ No newline at end of file +var _0xf304=['STRING','DATE','moment','sequelize','exports'];(function(_0x67788c,_0x3d2b63){var _0x49d59a=function(_0x5883ab){while(--_0x5883ab){_0x67788c['push'](_0x67788c['shift']());}};_0x49d59a(++_0x3d2b63);}(_0xf304,0x1c4));var _0x4f30=function(_0x327fd2,_0x22bb1a){_0x327fd2=_0x327fd2-0x0;var _0x30f4f3=_0xf304[_0x327fd2];return _0x30f4f3;};'use strict';var moment=require(_0x4f30('0x0'));var Sequelize=require(_0x4f30('0x1'));module[_0x4f30('0x2')]={'uniqueid':{'type':Sequelize[_0x4f30('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4f30('0x3')]},'joinAt':{'type':Sequelize[_0x4f30('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4f30('0x4')]},'reason':{'type':Sequelize[_0x4f30('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1f586ef..52a86c8 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 _0x187d=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create','body','describe','eml-format'];(function(_0x173386,_0x300183){var _0x589e0b=function(_0x2fe892){while(--_0x2fe892){_0x173386['push'](_0x173386['shift']());}};_0x589e0b(++_0x300183);}(_0x187d,0x93));var _0xd187=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x187d[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));};exports[_0xd187('0x49')]=function(_0x3aaeaa,_0x1b12c4){return db[_0xd187('0x2d')]['describe']()[_0xd187('0x3f')](respondWithResult(_0x1b12c4,null))['catch'](handleError(_0x1b12c4,null));}; \ No newline at end of file +var _0x9962=['type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatQueueReport','count','includeAll','include','rows','catch','keys','rawAttributes','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName'];(function(_0x382ddf,_0x2b149a){var _0x23914c=function(_0x3b0cb8){while(--_0x3b0cb8){_0x382ddf['push'](_0x382ddf['shift']());}};_0x23914c(++_0x2b149a);}(_0x9962,0xb8));var _0x2996=function(_0x574b67,_0x38cfc1){_0x574b67=_0x574b67-0x0;var _0x5a8ccd=_0x9962[_0x574b67];return _0x5a8ccd;};'use strict';var emlformat=require(_0x2996('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2996('0x1'));var jsonpatch=require(_0x2996('0x2'));var rp=require(_0x2996('0x3'));var moment=require('moment');var BPromise=require(_0x2996('0x4'));var Mustache=require('mustache');var util=require(_0x2996('0x5'));var path=require(_0x2996('0x6'));var sox=require('sox');var csv=require(_0x2996('0x7'));var ejs=require(_0x2996('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2996('0x9'));var squel=require(_0x2996('0xa'));var crypto=require(_0x2996('0xb'));var jsforce=require(_0x2996('0xc'));var deskjs=require(_0x2996('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2996('0xe'));var Papa=require('papaparse');var Redis=require(_0x2996('0xf'));var authService=require(_0x2996('0x10'));var qs=require(_0x2996('0x11'));var as=require(_0x2996('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2996('0x13'))(_0x2996('0x14'));var utils=require(_0x2996('0x15'));var config=require(_0x2996('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2996('0x17'))['db'];function respondWithStatusCode(_0x21f096,_0x10a958){_0x10a958=_0x10a958||0xcc;return function(_0x30b5e4){if(_0x30b5e4){return _0x21f096['sendStatus'](_0x10a958);}return _0x21f096[_0x2996('0x18')](_0x10a958)['end']();};}function respondWithResult(_0x4117f5,_0x468a4f){_0x468a4f=_0x468a4f||0xc8;return function(_0x5b942f){if(_0x5b942f){return _0x4117f5[_0x2996('0x18')](_0x468a4f)[_0x2996('0x19')](_0x5b942f);}};}function respondWithFilteredResult(_0x39b18e,_0x43e380){return function(_0xc267fb){if(_0xc267fb){var _0xb50801=typeof _0x43e380[_0x2996('0x1a')]==='undefined'&&typeof _0x43e380['limit']===_0x2996('0x1b');var _0x5d8236=_0xc267fb['count'];var _0x4c29bd=_0xb50801?0x0:_0x43e380[_0x2996('0x1a')];var _0x149c68=_0xb50801?_0xc267fb['count']:_0x43e380[_0x2996('0x1a')]+_0x43e380[_0x2996('0x1c')];var _0x9743ee;if(_0x149c68>=_0x5d8236){_0x149c68=_0x5d8236;_0x9743ee=0xc8;}else{_0x9743ee=0xce;}_0x39b18e[_0x2996('0x18')](_0x9743ee);return _0x39b18e[_0x2996('0x1d')](_0x2996('0x1e'),_0x4c29bd+'-'+_0x149c68+'/'+_0x5d8236)[_0x2996('0x19')](_0xc267fb);}return null;};}function patchUpdates(_0x232ec9){return function(_0x2c5cb3){try{jsonpatch[_0x2996('0x1f')](_0x2c5cb3,_0x232ec9,!![]);}catch(_0x5bfc6d){return BPromise[_0x2996('0x20')](_0x5bfc6d);}return _0x2c5cb3[_0x2996('0x21')]();};}function saveUpdates(_0x43e835,_0x64a05b){return function(_0xa39f6d){if(_0xa39f6d){return _0xa39f6d['update'](_0x43e835)[_0x2996('0x22')](function(_0x42e5f5){return _0x42e5f5;});}return null;};}function removeEntity(_0x2bfb2b,_0x4de34d){return function(_0xbc555a){if(_0xbc555a){return _0xbc555a[_0x2996('0x23')]()[_0x2996('0x22')](function(){_0x2bfb2b['status'](0xcc)[_0x2996('0x24')]();});}};}function handleEntityNotFound(_0x88f1c5,_0x2177b1){return function(_0x53c636){if(!_0x53c636){_0x88f1c5[_0x2996('0x25')](0x194);}return _0x53c636;};}function handleError(_0x15ab22,_0x5636eb){_0x5636eb=_0x5636eb||0x1f4;return function(_0x229fad){logger[_0x2996('0x26')](_0x229fad[_0x2996('0x27')]);if(_0x229fad[_0x2996('0x28')]){delete _0x229fad['name'];}_0x15ab22[_0x2996('0x18')](_0x5636eb)[_0x2996('0x29')](_0x229fad);};}exports['index']=function(_0x52b2e6,_0x12959f){var _0x4941c3={},_0x3adddd={},_0x3a509f={'count':0x0,'rows':[]};var _0x13bfc0=_[_0x2996('0x2a')](db['ChatQueueReport']['rawAttributes'],function(_0x365ea1){return{'name':_0x365ea1[_0x2996('0x2b')],'type':_0x365ea1[_0x2996('0x2c')][_0x2996('0x2d')]};});_0x3adddd[_0x2996('0x2e')]=_[_0x2996('0x2a')](_0x13bfc0,_0x2996('0x28'));_0x3adddd[_0x2996('0x2f')]=_['keys'](_0x52b2e6[_0x2996('0x2f')]);_0x3adddd[_0x2996('0x30')]=_['intersection'](_0x3adddd[_0x2996('0x2e')],_0x3adddd['query']);_0x4941c3[_0x2996('0x31')]=_[_0x2996('0x32')](_0x3adddd[_0x2996('0x2e')],qs['fields'](_0x52b2e6['query'][_0x2996('0x33')]));_0x4941c3['attributes']=_0x4941c3[_0x2996('0x31')][_0x2996('0x34')]?_0x4941c3['attributes']:_0x3adddd[_0x2996('0x2e')];if(!_0x52b2e6[_0x2996('0x2f')][_0x2996('0x35')](_0x2996('0x36'))){_0x4941c3[_0x2996('0x1c')]=qs[_0x2996('0x1c')](_0x52b2e6['query']['limit']);_0x4941c3[_0x2996('0x1a')]=qs[_0x2996('0x1a')](_0x52b2e6[_0x2996('0x2f')][_0x2996('0x1a')]);}_0x4941c3[_0x2996('0x37')]=qs[_0x2996('0x38')](_0x52b2e6['query'][_0x2996('0x38')]);_0x4941c3[_0x2996('0x39')]=qs['filters'](_['pick'](_0x52b2e6[_0x2996('0x2f')],_0x3adddd[_0x2996('0x30')]),_0x13bfc0);if(_0x52b2e6['query'][_0x2996('0x3a')]){_0x4941c3[_0x2996('0x39')]=_[_0x2996('0x3b')](_0x4941c3[_0x2996('0x39')],{'$or':_[_0x2996('0x2a')](_0x13bfc0,function(_0x32c13f){if(_0x32c13f[_0x2996('0x2c')]!==_0x2996('0x3c')){var _0x4fb862={};_0x4fb862[_0x32c13f[_0x2996('0x28')]]={'$like':'%'+_0x52b2e6[_0x2996('0x2f')][_0x2996('0x3a')]+'%'};return _0x4fb862;}})});}_0x4941c3=_['merge']({},_0x4941c3,_0x52b2e6[_0x2996('0x3d')]);var _0x4d825e={'where':_0x4941c3[_0x2996('0x39')]};return db[_0x2996('0x3e')][_0x2996('0x3f')](_0x4d825e)[_0x2996('0x22')](function(_0x308984){_0x3a509f[_0x2996('0x3f')]=_0x308984;if(_0x52b2e6[_0x2996('0x2f')][_0x2996('0x40')]){_0x4941c3[_0x2996('0x41')]=[{'all':!![]}];}return db[_0x2996('0x3e')]['findAll'](_0x4941c3);})[_0x2996('0x22')](function(_0x329c71){_0x3a509f[_0x2996('0x42')]=_0x329c71;return _0x3a509f;})['then'](respondWithFilteredResult(_0x12959f,_0x4941c3))[_0x2996('0x43')](handleError(_0x12959f,null));};exports['show']=function(_0x59965f,_0x19eeae){var _0x256190={'raw':!![],'where':{'id':_0x59965f['params']['id']}},_0x134437={};_0x134437[_0x2996('0x2e')]=_[_0x2996('0x44')](db[_0x2996('0x3e')][_0x2996('0x45')]);_0x134437[_0x2996('0x2f')]=_[_0x2996('0x44')](_0x59965f['query']);_0x134437['filters']=_[_0x2996('0x32')](_0x134437[_0x2996('0x2e')],_0x134437[_0x2996('0x2f')]);_0x256190[_0x2996('0x31')]=_[_0x2996('0x32')](_0x134437[_0x2996('0x2e')],qs[_0x2996('0x33')](_0x59965f[_0x2996('0x2f')]['fields']));_0x256190['attributes']=_0x256190['attributes'][_0x2996('0x34')]?_0x256190[_0x2996('0x31')]:_0x134437['model'];if(_0x59965f[_0x2996('0x2f')][_0x2996('0x40')]){_0x256190[_0x2996('0x41')]=[{'all':!![]}];}_0x256190=_['merge']({},_0x256190,_0x59965f[_0x2996('0x3d')]);return db[_0x2996('0x3e')][_0x2996('0x46')](_0x256190)[_0x2996('0x22')](handleEntityNotFound(_0x19eeae,null))[_0x2996('0x22')](respondWithResult(_0x19eeae,null))[_0x2996('0x43')](handleError(_0x19eeae,null));};exports[_0x2996('0x47')]=function(_0xf9427e,_0x246351){return db[_0x2996('0x3e')]['create'](_0xf9427e['body'],{})['then'](respondWithResult(_0x246351,0xc9))[_0x2996('0x43')](handleError(_0x246351,null));};exports[_0x2996('0x48')]=function(_0x1a4ea5,_0x7d35b5){if(_0x1a4ea5[_0x2996('0x49')]['id']){delete _0x1a4ea5[_0x2996('0x49')]['id'];}return db[_0x2996('0x3e')][_0x2996('0x46')]({'where':{'id':_0x1a4ea5[_0x2996('0x4a')]['id']}})[_0x2996('0x22')](handleEntityNotFound(_0x7d35b5,null))['then'](saveUpdates(_0x1a4ea5['body'],null))[_0x2996('0x22')](respondWithResult(_0x7d35b5,null))[_0x2996('0x43')](handleError(_0x7d35b5,null));};exports[_0x2996('0x23')]=function(_0x2ecb3a,_0x17c346){return db[_0x2996('0x3e')][_0x2996('0x46')]({'where':{'id':_0x2ecb3a['params']['id']}})[_0x2996('0x22')](handleEntityNotFound(_0x17c346,null))[_0x2996('0x22')](removeEntity(_0x17c346,null))[_0x2996('0x43')](handleError(_0x17c346,null));};exports[_0x2996('0x4b')]=function(_0x223fba,_0x1805fd){return db['ChatQueueReport'][_0x2996('0x4b')]()[_0x2996('0x22')](respondWithResult(_0x1805fd,null))[_0x2996('0x43')](handleError(_0x1805fd,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d694a3e..fa15de0 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(_0x4218d0,_0x18aa4c){var _0x2c142c=function(_0x27a612){while(--_0x27a612){_0x4218d0['push'](_0x4218d0['shift']());}};_0x2c142c(++_0x18aa4c);}(_0xb10b,0x12a));var _0xbb10=function(_0x9f721,_0x14bcc5){_0x9f721=_0x9f721-0x0;var _0x20052d=_0xb10b[_0x9f721];return _0x20052d;};'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(_0x2f256e,_0x37b94a){var _0x425d16=function(_0x5303b5){while(--_0x5303b5){_0x2f256e['push'](_0x2f256e['shift']());}};_0x425d16(++_0x37b94a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'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 18997ca..4010cc5 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 _0x8ce7=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','then','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x8ce7,0x98));var _0x78ce=function(_0xe17fa4,_0x5e9a7d){_0xe17fa4=_0xe17fa4-0x0;var _0x51c079=_0x8ce7[_0xe17fa4];return _0x51c079;};'use strict';var _=require(_0x78ce('0x0'));var util=require(_0x78ce('0x1'));var moment=require('moment');var BPromise=require(_0x78ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78ce('0x3'));var db=require(_0x78ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78ce('0x5'));var config=require(_0x78ce('0x6'));var jayson=require(_0x78ce('0x7'));var client=jayson[_0x78ce('0x8')][_0x78ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3544c6,_0x587b29,_0x72c20c){return new BPromise(function(_0x17e2f9,_0x20540d){return client[_0x78ce('0xa')](_0x3544c6,_0x72c20c)['then'](function(_0x59a381){logger[_0x78ce('0xb')](_0x78ce('0xc'),_0x587b29,_0x78ce('0xd'));logger[_0x78ce('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x587b29,_0x78ce('0xd'),JSON[_0x78ce('0xf')](_0x59a381));if(_0x59a381[_0x78ce('0x10')]){if(_0x59a381['error'][_0x78ce('0x11')]===0x1f4){logger[_0x78ce('0x10')](_0x78ce('0xc'),_0x587b29,_0x59a381[_0x78ce('0x10')][_0x78ce('0x12')]);return _0x20540d(_0x59a381[_0x78ce('0x10')][_0x78ce('0x12')]);}logger[_0x78ce('0x10')](_0x78ce('0xc'),_0x587b29,_0x59a381[_0x78ce('0x10')][_0x78ce('0x12')]);return _0x17e2f9(_0x59a381[_0x78ce('0x10')]['message']);}else{logger[_0x78ce('0xb')](_0x78ce('0xc'),_0x587b29,_0x78ce('0xd'));_0x17e2f9(_0x59a381[_0x78ce('0x13')][_0x78ce('0x12')]);}})[_0x78ce('0x14')](function(_0x59b1b0){logger[_0x78ce('0x10')](_0x78ce('0xc'),_0x587b29,_0x59b1b0);_0x20540d(_0x59b1b0);});});}exports[_0x78ce('0x15')]=function(_0x59fc59){var _0x4ca4ce=this;return new Promise(function(_0x23de96,_0x41ef02){return db[_0x78ce('0x16')][_0x78ce('0x17')](_0x59fc59[_0x78ce('0x18')],{'raw':_0x59fc59[_0x78ce('0x19')]?_0x59fc59[_0x78ce('0x19')][_0x78ce('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x45e408){logger[_0x78ce('0xb')](_0x78ce('0x15'),_0x59fc59);logger[_0x78ce('0xe')](_0x78ce('0x15'),_0x59fc59,JSON[_0x78ce('0xf')](_0x45e408));_0x23de96(_0x45e408);})[_0x78ce('0x14')](function(_0x3c0370){logger[_0x78ce('0x10')](_0x78ce('0x15'),_0x3c0370[_0x78ce('0x12')],_0x59fc59);_0x41ef02(_0x4ca4ce[_0x78ce('0x10')](0x1f4,_0x3c0370['message']));});});};exports[_0x78ce('0x1b')]=function(_0x516365){var _0x57655e=this;return new Promise(function(_0x618ce9,_0x593d4b){return db[_0x78ce('0x16')][_0x78ce('0x1c')](_0x516365['body'],{'raw':_0x516365[_0x78ce('0x19')]?_0x516365[_0x78ce('0x19')][_0x78ce('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x516365['options']?_0x516365[_0x78ce('0x19')][_0x78ce('0x1d')]||null:null,'attributes':_0x516365[_0x78ce('0x19')]?_0x516365[_0x78ce('0x19')][_0x78ce('0x1e')]||null:null,'limit':_0x516365[_0x78ce('0x19')]?_0x516365['options'][_0x78ce('0x1f')]||null:null})[_0x78ce('0x20')](function(_0x31c0ad){logger['info'](_0x78ce('0x1b'),_0x516365);logger[_0x78ce('0xe')](_0x78ce('0x1b'),_0x516365,JSON['stringify'](_0x31c0ad));_0x618ce9(_0x31c0ad);})['catch'](function(_0x144361){logger[_0x78ce('0x10')](_0x78ce('0x1b'),_0x144361['message'],_0x516365);_0x593d4b(_0x57655e[_0x78ce('0x10')](0x1f4,_0x144361[_0x78ce('0x12')]));});});}; \ No newline at end of file +var _0x0c29=['error','code','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d3ef6,_0x1e4798){var _0xa4be17=function(_0x492d8a){while(--_0x492d8a){_0x4d3ef6['push'](_0x4d3ef6['shift']());}};_0xa4be17(++_0x1e4798);}(_0x0c29,0x69));var _0x90c2=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x0c29[_0x32c012];return _0x48562e;};'use strict';var _=require(_0x90c2('0x0'));var util=require('util');var moment=require(_0x90c2('0x1'));var BPromise=require(_0x90c2('0x2'));var rs=require(_0x90c2('0x3'));var fs=require('fs');var Redis=require(_0x90c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90c2('0x5'));var config=require(_0x90c2('0x6'));var jayson=require(_0x90c2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30ba30,_0x279aae,_0x14b516){return new BPromise(function(_0xed30ba,_0x103cfa){return client['request'](_0x30ba30,_0x14b516)[_0x90c2('0x8')](function(_0x53aaea){logger[_0x90c2('0x9')](_0x90c2('0xa'),_0x279aae,_0x90c2('0xb'));logger[_0x90c2('0xc')](_0x90c2('0xd'),_0x279aae,_0x90c2('0xb'),JSON[_0x90c2('0xe')](_0x53aaea));if(_0x53aaea['error']){if(_0x53aaea[_0x90c2('0xf')][_0x90c2('0x10')]===0x1f4){logger[_0x90c2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x279aae,_0x53aaea[_0x90c2('0xf')][_0x90c2('0x11')]);return _0x103cfa(_0x53aaea[_0x90c2('0xf')][_0x90c2('0x11')]);}logger[_0x90c2('0xf')](_0x90c2('0xa'),_0x279aae,_0x53aaea[_0x90c2('0xf')]['message']);return _0xed30ba(_0x53aaea[_0x90c2('0xf')]['message']);}else{logger['info'](_0x90c2('0xa'),_0x279aae,_0x90c2('0xb'));_0xed30ba(_0x53aaea[_0x90c2('0x12')][_0x90c2('0x11')]);}})['catch'](function(_0x357f42){logger[_0x90c2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x279aae,_0x357f42);_0x103cfa(_0x357f42);});});}exports[_0x90c2('0x13')]=function(_0xe8b6a9){var _0x5b338c=this;return new Promise(function(_0x5097ec,_0xddb970){return db[_0x90c2('0x14')]['create'](_0xe8b6a9['body'],{'raw':_0xe8b6a9['options']?_0xe8b6a9[_0x90c2('0x15')][_0x90c2('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x348db2){logger[_0x90c2('0x9')](_0x90c2('0x13'),_0xe8b6a9);logger['debug'](_0x90c2('0x13'),_0xe8b6a9,JSON['stringify'](_0x348db2));_0x5097ec(_0x348db2);})[_0x90c2('0x17')](function(_0x2184d4){logger[_0x90c2('0xf')](_0x90c2('0x13'),_0x2184d4[_0x90c2('0x11')],_0xe8b6a9);_0xddb970(_0x5b338c['error'](0x1f4,_0x2184d4[_0x90c2('0x11')]));});});};exports[_0x90c2('0x18')]=function(_0x409baf){var _0xe4cd8=this;return new Promise(function(_0x447adc,_0x54e6da){return db[_0x90c2('0x14')][_0x90c2('0x19')](_0x409baf[_0x90c2('0x1a')],{'raw':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1b')]||null:null,'attributes':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1c')]||null:null,'limit':_0x409baf['options']?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1d')]||null:null})[_0x90c2('0x8')](function(_0x1e5463){logger[_0x90c2('0x9')](_0x90c2('0x18'),_0x409baf);logger[_0x90c2('0xc')](_0x90c2('0x18'),_0x409baf,JSON[_0x90c2('0xe')](_0x1e5463));_0x447adc(_0x1e5463);})[_0x90c2('0x17')](function(_0xb88f91){logger['error'](_0x90c2('0x18'),_0xb88f91[_0x90c2('0x11')],_0x409baf);_0x54e6da(_0xe4cd8[_0x90c2('0xf')](0x1f4,_0xb88f91['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 18cdd07..7e6c8af 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 _0xf2e7=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy'];(function(_0x24379c,_0x3e04da){var _0x565c8d=function(_0x286ffa){while(--_0x286ffa){_0x24379c['push'](_0x24379c['shift']());}};_0x565c8d(++_0x3e04da);}(_0xf2e7,0x1dc));var _0x7f2e=function(_0xc7e459,_0x569f8c){_0xc7e459=_0xc7e459-0x0;var _0xeaebb0=_0xf2e7[_0xc7e459];return _0xeaebb0;};'use strict';var multer=require(_0x7f2e('0x0'));var util=require(_0x7f2e('0x1'));var path=require('path');var timeout=require(_0x7f2e('0x2'));var express=require(_0x7f2e('0x3'));var router=express[_0x7f2e('0x4')]();var fs_extra=require(_0x7f2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7f2e('0x6'));var config=require('../../config/environment');var controller=require(_0x7f2e('0x7'));router[_0x7f2e('0x8')]('/',auth[_0x7f2e('0x9')](),controller['index']);router[_0x7f2e('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7f2e('0xa')]);router[_0x7f2e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7f2e('0xb')]);router[_0x7f2e('0xc')]('/',auth[_0x7f2e('0x9')](),controller['create']);router[_0x7f2e('0xd')](_0x7f2e('0xe'),auth[_0x7f2e('0x9')](),controller[_0x7f2e('0xf')]);router[_0x7f2e('0x10')](_0x7f2e('0xe'),auth[_0x7f2e('0x9')](),controller[_0x7f2e('0x11')]);module[_0x7f2e('0x12')]=router; \ No newline at end of file +var _0x8eae=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x8eae,0xfc));var _0xe8ea=function(_0xf7dd0f,_0x396c3b){_0xf7dd0f=_0xf7dd0f-0x0;var _0x3fc64b=_0x8eae[_0xf7dd0f];return _0x3fc64b;};'use strict';var multer=require(_0xe8ea('0x0'));var util=require(_0xe8ea('0x1'));var path=require(_0xe8ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8ea('0x3')]();var fs_extra=require(_0xe8ea('0x4'));var auth=require(_0xe8ea('0x5'));var interaction=require(_0xe8ea('0x6'));var config=require(_0xe8ea('0x7'));var controller=require(_0xe8ea('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8ea('0x9')]);router['get'](_0xe8ea('0xa'),auth[_0xe8ea('0xb')](),controller[_0xe8ea('0xc')]);router[_0xe8ea('0xd')](_0xe8ea('0xe'),auth['isAuthenticated'](),controller[_0xe8ea('0xf')]);router['post']('/',auth[_0xe8ea('0xb')](),controller['create']);router[_0xe8ea('0x10')]('/:id',auth[_0xe8ea('0xb')](),controller[_0xe8ea('0x11')]);router[_0xe8ea('0x12')]('/:id',auth[_0xe8ea('0xb')](),controller[_0xe8ea('0x13')]);module[_0xe8ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 57efc66..f3bc246 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1a6b42,_0x6b1752){var _0x48bd00=function(_0x22ce96){while(--_0x22ce96){_0x1a6b42['push'](_0x1a6b42['shift']());}};_0x48bd00(++_0x6b1752);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1a96db,_0x3e9f20){_0x1a96db=_0x1a96db-0x0;var _0x5a4091=_0xb43b[_0x1a96db];return _0x5a4091;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 3de0361..588a931 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 _0x1d0f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','keys','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','rows','catch','params','intersection','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x26c323,_0x559fa7){var _0xaa4f94=function(_0x7b9080){while(--_0x7b9080){_0x26c323['push'](_0x26c323['shift']());}};_0xaa4f94(++_0x559fa7);}(_0x1d0f,0x88));var _0xf1d0=function(_0xeef71,_0x5d70e7){_0xeef71=_0xeef71-0x0;var _0x10453e=_0x1d0f[_0xeef71];return _0x10453e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1d0('0x0'));var zipdir=require(_0xf1d0('0x1'));var jsonpatch=require(_0xf1d0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf1d0('0x3'));var util=require(_0xf1d0('0x4'));var path=require(_0xf1d0('0x5'));var sox=require('sox');var csv=require(_0xf1d0('0x6'));var ejs=require(_0xf1d0('0x7'));var fs=require('fs');var fs_extra=require(_0xf1d0('0x8'));var _=require(_0xf1d0('0x9'));var squel=require(_0xf1d0('0xa'));var crypto=require(_0xf1d0('0xb'));var jsforce=require(_0xf1d0('0xc'));var deskjs=require(_0xf1d0('0xd'));var toCsv=require(_0xf1d0('0x6'));var querystring=require(_0xf1d0('0xe'));var Papa=require(_0xf1d0('0xf'));var Redis=require(_0xf1d0('0x10'));var authService=require(_0xf1d0('0x11'));var qs=require(_0xf1d0('0x12'));var as=require(_0xf1d0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d0('0x14'))(_0xf1d0('0x15'));var utils=require(_0xf1d0('0x16'));var config=require(_0xf1d0('0x17'));var licenseUtil=require(_0xf1d0('0x18'));var db=require(_0xf1d0('0x19'))['db'];function respondWithStatusCode(_0x5c4d8a,_0x2f63c1){_0x2f63c1=_0x2f63c1||0xcc;return function(_0x4213c4){if(_0x4213c4){return _0x5c4d8a[_0xf1d0('0x1a')](_0x2f63c1);}return _0x5c4d8a[_0xf1d0('0x1b')](_0x2f63c1)[_0xf1d0('0x1c')]();};}function respondWithResult(_0x5498e0,_0x206676){_0x206676=_0x206676||0xc8;return function(_0x306327){if(_0x306327){return _0x5498e0[_0xf1d0('0x1b')](_0x206676)[_0xf1d0('0x1d')](_0x306327);}};}function respondWithFilteredResult(_0x1569bf,_0xb4810d){return function(_0x150c78){if(_0x150c78){var _0x5a5db4=typeof _0xb4810d[_0xf1d0('0x1e')]===_0xf1d0('0x1f')&&typeof _0xb4810d[_0xf1d0('0x20')]===_0xf1d0('0x1f');var _0x3f53b8=_0x150c78[_0xf1d0('0x21')];var _0x1c21a4=_0x5a5db4?0x0:_0xb4810d[_0xf1d0('0x1e')];var _0x1112b8=_0x5a5db4?_0x150c78['count']:_0xb4810d[_0xf1d0('0x1e')]+_0xb4810d[_0xf1d0('0x20')];var _0x5b947f;if(_0x1112b8>=_0x3f53b8){_0x1112b8=_0x3f53b8;_0x5b947f=0xc8;}else{_0x5b947f=0xce;}_0x1569bf[_0xf1d0('0x1b')](_0x5b947f);return _0x1569bf[_0xf1d0('0x22')](_0xf1d0('0x23'),_0x1c21a4+'-'+_0x1112b8+'/'+_0x3f53b8)[_0xf1d0('0x1d')](_0x150c78);}return null;};}function patchUpdates(_0x147f95){return function(_0x12a981){try{jsonpatch[_0xf1d0('0x24')](_0x12a981,_0x147f95,!![]);}catch(_0x7de731){return BPromise['reject'](_0x7de731);}return _0x12a981[_0xf1d0('0x25')]();};}function saveUpdates(_0x4fe25a,_0x2524a2){return function(_0x3e0989){if(_0x3e0989){return _0x3e0989['update'](_0x4fe25a)['then'](function(_0x3c87d1){return _0x3c87d1;});}return null;};}function removeEntity(_0x505f51,_0x10ffd3){return function(_0x1772eb){if(_0x1772eb){return _0x1772eb[_0xf1d0('0x26')]()[_0xf1d0('0x27')](function(){_0x505f51[_0xf1d0('0x1b')](0xcc)[_0xf1d0('0x1c')]();});}};}function handleEntityNotFound(_0x3069e8,_0x4eeca3){return function(_0x4421c7){if(!_0x4421c7){_0x3069e8[_0xf1d0('0x1a')](0x194);}return _0x4421c7;};}function handleError(_0x237529,_0x5cb29a){_0x5cb29a=_0x5cb29a||0x1f4;return function(_0x168745){logger[_0xf1d0('0x28')](_0x168745[_0xf1d0('0x29')]);if(_0x168745[_0xf1d0('0x2a')]){delete _0x168745['name'];}_0x237529[_0xf1d0('0x1b')](_0x5cb29a)[_0xf1d0('0x2b')](_0x168745);};}exports[_0xf1d0('0x2c')]=function(_0x316b19,_0x2a1a67){var _0x318b52={},_0x11aa83={},_0x25b627={'count':0x0,'rows':[]};var _0x43d81f=_[_0xf1d0('0x2d')](db[_0xf1d0('0x2e')][_0xf1d0('0x2f')],function(_0x5d72ae){return{'name':_0x5d72ae[_0xf1d0('0x30')],'type':_0x5d72ae['type']['key']};});_0x11aa83[_0xf1d0('0x31')]=_[_0xf1d0('0x2d')](_0x43d81f,_0xf1d0('0x2a'));_0x11aa83[_0xf1d0('0x32')]=_[_0xf1d0('0x33')](_0x316b19[_0xf1d0('0x32')]);_0x11aa83[_0xf1d0('0x34')]=_['intersection'](_0x11aa83[_0xf1d0('0x31')],_0x11aa83[_0xf1d0('0x32')]);_0x318b52['attributes']=_['intersection'](_0x11aa83['model'],qs[_0xf1d0('0x35')](_0x316b19['query']['fields']));_0x318b52['attributes']=_0x318b52['attributes'][_0xf1d0('0x36')]?_0x318b52[_0xf1d0('0x37')]:_0x11aa83[_0xf1d0('0x31')];if(!_0x316b19['query'][_0xf1d0('0x38')](_0xf1d0('0x39'))){_0x318b52[_0xf1d0('0x20')]=qs[_0xf1d0('0x20')](_0x316b19['query']['limit']);_0x318b52[_0xf1d0('0x1e')]=qs[_0xf1d0('0x1e')](_0x316b19[_0xf1d0('0x32')][_0xf1d0('0x1e')]);}_0x318b52[_0xf1d0('0x3a')]=qs[_0xf1d0('0x3b')](_0x316b19['query']['sort']);_0x318b52['where']=qs['filters'](_[_0xf1d0('0x3c')](_0x316b19['query'],_0x11aa83[_0xf1d0('0x34')]),_0x43d81f);if(_0x316b19[_0xf1d0('0x32')][_0xf1d0('0x3d')]){_0x318b52[_0xf1d0('0x3e')]=_[_0xf1d0('0x3f')](_0x318b52['where'],{'$or':_[_0xf1d0('0x2d')](_0x43d81f,function(_0x79b5d0){if(_0x79b5d0[_0xf1d0('0x40')]!==_0xf1d0('0x41')){var _0xa1b9da={};_0xa1b9da[_0x79b5d0[_0xf1d0('0x2a')]]={'$like':'%'+_0x316b19[_0xf1d0('0x32')][_0xf1d0('0x3d')]+'%'};return _0xa1b9da;}})});}_0x318b52=_[_0xf1d0('0x3f')]({},_0x318b52,_0x316b19[_0xf1d0('0x42')]);var _0x541ee8={'where':_0x318b52[_0xf1d0('0x3e')]};return db[_0xf1d0('0x2e')][_0xf1d0('0x21')](_0x541ee8)[_0xf1d0('0x27')](function(_0x27c2a6){_0x25b627[_0xf1d0('0x21')]=_0x27c2a6;if(_0x316b19[_0xf1d0('0x32')]['includeAll']){_0x318b52[_0xf1d0('0x43')]=[{'all':!![]}];}return db[_0xf1d0('0x2e')]['findAll'](_0x318b52);})['then'](function(_0x330e74){_0x25b627[_0xf1d0('0x44')]=_0x330e74;return _0x25b627;})['then'](respondWithFilteredResult(_0x2a1a67,_0x318b52))[_0xf1d0('0x45')](handleError(_0x2a1a67,null));};exports['show']=function(_0x929c3,_0x59cccf){var _0x4afb0c={'raw':!![],'where':{'id':_0x929c3[_0xf1d0('0x46')]['id']}},_0x33905f={};_0x33905f['model']=_[_0xf1d0('0x33')](db[_0xf1d0('0x2e')][_0xf1d0('0x2f')]);_0x33905f[_0xf1d0('0x32')]=_[_0xf1d0('0x33')](_0x929c3['query']);_0x33905f[_0xf1d0('0x34')]=_['intersection'](_0x33905f[_0xf1d0('0x31')],_0x33905f[_0xf1d0('0x32')]);_0x4afb0c[_0xf1d0('0x37')]=_[_0xf1d0('0x47')](_0x33905f[_0xf1d0('0x31')],qs[_0xf1d0('0x35')](_0x929c3[_0xf1d0('0x32')][_0xf1d0('0x35')]));_0x4afb0c[_0xf1d0('0x37')]=_0x4afb0c[_0xf1d0('0x37')][_0xf1d0('0x36')]?_0x4afb0c[_0xf1d0('0x37')]:_0x33905f[_0xf1d0('0x31')];if(_0x929c3['query'][_0xf1d0('0x48')]){_0x4afb0c[_0xf1d0('0x43')]=[{'all':!![]}];}_0x4afb0c=_[_0xf1d0('0x3f')]({},_0x4afb0c,_0x929c3['options']);return db[_0xf1d0('0x2e')]['find'](_0x4afb0c)[_0xf1d0('0x27')](handleEntityNotFound(_0x59cccf,null))[_0xf1d0('0x27')](respondWithResult(_0x59cccf,null))[_0xf1d0('0x45')](handleError(_0x59cccf,null));};exports[_0xf1d0('0x49')]=function(_0x260ae9,_0x500ce3){return db['ChatTransferReport']['create'](_0x260ae9['body'],{})[_0xf1d0('0x27')](respondWithResult(_0x500ce3,0xc9))[_0xf1d0('0x45')](handleError(_0x500ce3,null));};exports['update']=function(_0x339455,_0x265b7b){if(_0x339455[_0xf1d0('0x4a')]['id']){delete _0x339455[_0xf1d0('0x4a')]['id'];}return db[_0xf1d0('0x2e')][_0xf1d0('0x4b')]({'where':{'id':_0x339455[_0xf1d0('0x46')]['id']}})[_0xf1d0('0x27')](handleEntityNotFound(_0x265b7b,null))[_0xf1d0('0x27')](saveUpdates(_0x339455[_0xf1d0('0x4a')],null))['then'](respondWithResult(_0x265b7b,null))[_0xf1d0('0x45')](handleError(_0x265b7b,null));};exports[_0xf1d0('0x26')]=function(_0x4098e9,_0x3a02db){return db[_0xf1d0('0x2e')][_0xf1d0('0x4b')]({'where':{'id':_0x4098e9[_0xf1d0('0x46')]['id']}})[_0xf1d0('0x27')](handleEntityNotFound(_0x3a02db,null))[_0xf1d0('0x27')](removeEntity(_0x3a02db,null))[_0xf1d0('0x45')](handleError(_0x3a02db,null));};exports['describe']=function(_0x29a1be,_0x51f69f){return db[_0xf1d0('0x2e')][_0xf1d0('0x4c')]()[_0xf1d0('0x27')](respondWithResult(_0x51f69f,null))[_0xf1d0('0x45')](handleError(_0x51f69f,null));}; \ No newline at end of file +var _0xd112=['Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count'];(function(_0x5d2999,_0x3a6edd){var _0x59aec0=function(_0x159fab){while(--_0x159fab){_0x5d2999['push'](_0x5d2999['shift']());}};_0x59aec0(++_0x3a6edd);}(_0xd112,0x10a));var _0x2d11=function(_0x568e7c,_0x5ea152){_0x568e7c=_0x568e7c-0x0;var _0x4682a7=_0xd112[_0x568e7c];return _0x4682a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d11('0x0'));var zipdir=require(_0x2d11('0x1'));var jsonpatch=require(_0x2d11('0x2'));var rp=require(_0x2d11('0x3'));var moment=require(_0x2d11('0x4'));var BPromise=require(_0x2d11('0x5'));var Mustache=require(_0x2d11('0x6'));var util=require(_0x2d11('0x7'));var path=require('path');var sox=require(_0x2d11('0x8'));var csv=require('to-csv');var ejs=require(_0x2d11('0x9'));var fs=require('fs');var fs_extra=require(_0x2d11('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d11('0xb'));var jsforce=require(_0x2d11('0xc'));var deskjs=require(_0x2d11('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d11('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2d11('0xf'));var hardwareService=require(_0x2d11('0x10'));var logger=require(_0x2d11('0x11'))(_0x2d11('0x12'));var utils=require(_0x2d11('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2d11('0x14'));var db=require(_0x2d11('0x15'))['db'];function respondWithStatusCode(_0x3b7209,_0x4051fe){_0x4051fe=_0x4051fe||0xcc;return function(_0x389aff){if(_0x389aff){return _0x3b7209[_0x2d11('0x16')](_0x4051fe);}return _0x3b7209[_0x2d11('0x17')](_0x4051fe)[_0x2d11('0x18')]();};}function respondWithResult(_0x247c79,_0x4dfa4e){_0x4dfa4e=_0x4dfa4e||0xc8;return function(_0x400e2e){if(_0x400e2e){return _0x247c79[_0x2d11('0x17')](_0x4dfa4e)[_0x2d11('0x19')](_0x400e2e);}};}function respondWithFilteredResult(_0x427bbc,_0x33906b){return function(_0x4a1c71){if(_0x4a1c71){var _0x39648d=typeof _0x33906b['offset']==='undefined'&&typeof _0x33906b[_0x2d11('0x1a')]===_0x2d11('0x1b');var _0x33f7d9=_0x4a1c71['count'];var _0x2a7a49=_0x39648d?0x0:_0x33906b[_0x2d11('0x1c')];var _0x28233f=_0x39648d?_0x4a1c71[_0x2d11('0x1d')]:_0x33906b[_0x2d11('0x1c')]+_0x33906b['limit'];var _0xbdf6a4;if(_0x28233f>=_0x33f7d9){_0x28233f=_0x33f7d9;_0xbdf6a4=0xc8;}else{_0xbdf6a4=0xce;}_0x427bbc[_0x2d11('0x17')](_0xbdf6a4);return _0x427bbc['set'](_0x2d11('0x1e'),_0x2a7a49+'-'+_0x28233f+'/'+_0x33f7d9)['json'](_0x4a1c71);}return null;};}function patchUpdates(_0x2dd685){return function(_0x4498ba){try{jsonpatch[_0x2d11('0x1f')](_0x4498ba,_0x2dd685,!![]);}catch(_0x15c3d4){return BPromise[_0x2d11('0x20')](_0x15c3d4);}return _0x4498ba[_0x2d11('0x21')]();};}function saveUpdates(_0x32b4c9,_0x34d0fb){return function(_0x43a366){if(_0x43a366){return _0x43a366[_0x2d11('0x22')](_0x32b4c9)[_0x2d11('0x23')](function(_0x49f64c){return _0x49f64c;});}return null;};}function removeEntity(_0x3959f0,_0x442959){return function(_0x4a7103){if(_0x4a7103){return _0x4a7103[_0x2d11('0x24')]()[_0x2d11('0x23')](function(){_0x3959f0[_0x2d11('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c1c0b,_0xbb6f9c){return function(_0x1e5e5f){if(!_0x1e5e5f){_0x2c1c0b[_0x2d11('0x16')](0x194);}return _0x1e5e5f;};}function handleError(_0x3b6448,_0x11d4a4){_0x11d4a4=_0x11d4a4||0x1f4;return function(_0x2990ad){logger[_0x2d11('0x25')](_0x2990ad['stack']);if(_0x2990ad[_0x2d11('0x26')]){delete _0x2990ad[_0x2d11('0x26')];}_0x3b6448[_0x2d11('0x17')](_0x11d4a4)[_0x2d11('0x27')](_0x2990ad);};}exports[_0x2d11('0x28')]=function(_0x5bb753,_0x4da22e){var _0x5c327c={},_0x2e2169={},_0x294343={'count':0x0,'rows':[]};var _0x282045=_[_0x2d11('0x29')](db[_0x2d11('0x2a')][_0x2d11('0x2b')],function(_0x1391a1){return{'name':_0x1391a1[_0x2d11('0x2c')],'type':_0x1391a1[_0x2d11('0x2d')][_0x2d11('0x2e')]};});_0x2e2169[_0x2d11('0x2f')]=_[_0x2d11('0x29')](_0x282045,'name');_0x2e2169['query']=_['keys'](_0x5bb753[_0x2d11('0x30')]);_0x2e2169[_0x2d11('0x31')]=_[_0x2d11('0x32')](_0x2e2169[_0x2d11('0x2f')],_0x2e2169[_0x2d11('0x30')]);_0x5c327c[_0x2d11('0x33')]=_[_0x2d11('0x32')](_0x2e2169[_0x2d11('0x2f')],qs[_0x2d11('0x34')](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x34')]));_0x5c327c[_0x2d11('0x33')]=_0x5c327c[_0x2d11('0x33')][_0x2d11('0x35')]?_0x5c327c['attributes']:_0x2e2169[_0x2d11('0x2f')];if(!_0x5bb753[_0x2d11('0x30')]['hasOwnProperty'](_0x2d11('0x36'))){_0x5c327c['limit']=qs['limit'](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x1a')]);_0x5c327c[_0x2d11('0x1c')]=qs['offset'](_0x5bb753[_0x2d11('0x30')]['offset']);}_0x5c327c[_0x2d11('0x37')]=qs[_0x2d11('0x38')](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x38')]);_0x5c327c[_0x2d11('0x39')]=qs[_0x2d11('0x31')](_[_0x2d11('0x3a')](_0x5bb753[_0x2d11('0x30')],_0x2e2169['filters']),_0x282045);if(_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3b')]){_0x5c327c[_0x2d11('0x39')]=_[_0x2d11('0x3c')](_0x5c327c[_0x2d11('0x39')],{'$or':_['map'](_0x282045,function(_0x33c4f2){if(_0x33c4f2['type']!==_0x2d11('0x3d')){var _0x4629bc={};_0x4629bc[_0x33c4f2[_0x2d11('0x26')]]={'$like':'%'+_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3b')]+'%'};return _0x4629bc;}})});}_0x5c327c=_[_0x2d11('0x3c')]({},_0x5c327c,_0x5bb753[_0x2d11('0x3e')]);var _0x267bac={'where':_0x5c327c['where']};return db[_0x2d11('0x2a')][_0x2d11('0x1d')](_0x267bac)[_0x2d11('0x23')](function(_0xcfd2c8){_0x294343[_0x2d11('0x1d')]=_0xcfd2c8;if(_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3f')]){_0x5c327c[_0x2d11('0x40')]=[{'all':!![]}];}return db[_0x2d11('0x2a')][_0x2d11('0x41')](_0x5c327c);})['then'](function(_0x702954){_0x294343[_0x2d11('0x42')]=_0x702954;return _0x294343;})[_0x2d11('0x23')](respondWithFilteredResult(_0x4da22e,_0x5c327c))[_0x2d11('0x43')](handleError(_0x4da22e,null));};exports['show']=function(_0x184a4e,_0x195c53){var _0x34e9bc={'raw':!![],'where':{'id':_0x184a4e[_0x2d11('0x44')]['id']}},_0x18198b={};_0x18198b[_0x2d11('0x2f')]=_[_0x2d11('0x45')](db[_0x2d11('0x2a')][_0x2d11('0x2b')]);_0x18198b[_0x2d11('0x30')]=_['keys'](_0x184a4e[_0x2d11('0x30')]);_0x18198b[_0x2d11('0x31')]=_['intersection'](_0x18198b[_0x2d11('0x2f')],_0x18198b[_0x2d11('0x30')]);_0x34e9bc[_0x2d11('0x33')]=_[_0x2d11('0x32')](_0x18198b[_0x2d11('0x2f')],qs[_0x2d11('0x34')](_0x184a4e[_0x2d11('0x30')][_0x2d11('0x34')]));_0x34e9bc[_0x2d11('0x33')]=_0x34e9bc[_0x2d11('0x33')]['length']?_0x34e9bc[_0x2d11('0x33')]:_0x18198b[_0x2d11('0x2f')];if(_0x184a4e[_0x2d11('0x30')]['includeAll']){_0x34e9bc[_0x2d11('0x40')]=[{'all':!![]}];}_0x34e9bc=_[_0x2d11('0x3c')]({},_0x34e9bc,_0x184a4e[_0x2d11('0x3e')]);return db[_0x2d11('0x2a')]['find'](_0x34e9bc)[_0x2d11('0x23')](handleEntityNotFound(_0x195c53,null))[_0x2d11('0x23')](respondWithResult(_0x195c53,null))[_0x2d11('0x43')](handleError(_0x195c53,null));};exports['create']=function(_0x4874de,_0x15aef8){return db['ChatTransferReport'][_0x2d11('0x46')](_0x4874de[_0x2d11('0x47')],{})[_0x2d11('0x23')](respondWithResult(_0x15aef8,0xc9))[_0x2d11('0x43')](handleError(_0x15aef8,null));};exports[_0x2d11('0x22')]=function(_0x299f8f,_0x457fab){if(_0x299f8f[_0x2d11('0x47')]['id']){delete _0x299f8f[_0x2d11('0x47')]['id'];}return db[_0x2d11('0x2a')]['find']({'where':{'id':_0x299f8f[_0x2d11('0x44')]['id']}})['then'](handleEntityNotFound(_0x457fab,null))['then'](saveUpdates(_0x299f8f[_0x2d11('0x47')],null))['then'](respondWithResult(_0x457fab,null))[_0x2d11('0x43')](handleError(_0x457fab,null));};exports[_0x2d11('0x24')]=function(_0x3bedb1,_0x2b515b){return db[_0x2d11('0x2a')][_0x2d11('0x48')]({'where':{'id':_0x3bedb1[_0x2d11('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b515b,null))[_0x2d11('0x23')](removeEntity(_0x2b515b,null))[_0x2d11('0x43')](handleError(_0x2b515b,null));};exports[_0x2d11('0x49')]=function(_0x21ec11,_0x38a2d5){return db[_0x2d11('0x2a')][_0x2d11('0x49')]()[_0x2d11('0x23')](respondWithResult(_0x38a2d5,null))[_0x2d11('0x43')](handleError(_0x38a2d5,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 5ce8065..3936301 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 _0x5149=['report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport'];(function(_0x1299b5,_0x1042e9){var _0x4587bf=function(_0x20fe95){while(--_0x20fe95){_0x1299b5['push'](_0x1299b5['shift']());}};_0x4587bf(++_0x1042e9);}(_0x5149,0x1bc));var _0x9514=function(_0x564bec,_0x4e98e2){_0x564bec=_0x564bec-0x0;var _0x8dc0f7=_0x5149[_0x564bec];return _0x8dc0f7;};'use strict';var _=require(_0x9514('0x0'));var util=require(_0x9514('0x1'));var logger=require('../../config/logger')(_0x9514('0x2'));var moment=require(_0x9514('0x3'));var BPromise=require(_0x9514('0x4'));var rp=require(_0x9514('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9514('0x6'));var config=require(_0x9514('0x7'));var attributes=require(_0x9514('0x8'));module[_0x9514('0x9')]=function(_0x3815c5,_0x50859d){return _0x3815c5['define'](_0x9514('0xa'),attributes,{'tableName':_0x9514('0xb'),'paranoid':![],'indexes':[{'name':_0x9514('0xc'),'fields':[_0x9514('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb49=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatTransferReport.attributes'];(function(_0x836cfe,_0x3654f5){var _0x102c56=function(_0x8c5895){while(--_0x8c5895){_0x836cfe['push'](_0x836cfe['shift']());}};_0x102c56(++_0x3654f5);}(_0xcb49,0x109));var _0x9cb4=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0xcb49[_0x3c9a89];return _0x1eb47b;};'use strict';var _=require('lodash');var util=require(_0x9cb4('0x0'));var logger=require(_0x9cb4('0x1'))(_0x9cb4('0x2'));var moment=require(_0x9cb4('0x3'));var BPromise=require(_0x9cb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cb4('0x5'));var rimraf=require(_0x9cb4('0x6'));var config=require('../../config/environment');var attributes=require(_0x9cb4('0x7'));module[_0x9cb4('0x8')]=function(_0x3a48ad,_0x119b69){return _0x3a48ad[_0x9cb4('0x9')](_0x9cb4('0xa'),attributes,{'tableName':_0x9cb4('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9cb4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 7429658..344a68f 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 _0x3aa9=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x37768b,_0xedcc5a){var _0x1f3c43=function(_0x292056){while(--_0x292056){_0x37768b['push'](_0x37768b['shift']());}};_0x1f3c43(++_0xedcc5a);}(_0x3aa9,0x9a));var _0x93aa=function(_0x1d2de6,_0x1b2b54){_0x1d2de6=_0x1d2de6-0x0;var _0x284d97=_0x3aa9[_0x1d2de6];return _0x284d97;};'use strict';var _=require(_0x93aa('0x0'));var util=require('util');var moment=require(_0x93aa('0x1'));var BPromise=require(_0x93aa('0x2'));var rs=require(_0x93aa('0x3'));var fs=require('fs');var Redis=require(_0x93aa('0x4'));var db=require(_0x93aa('0x5'))['db'];var utils=require(_0x93aa('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x93aa('0x7'));var jayson=require(_0x93aa('0x8'));var client=jayson[_0x93aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c19e4,_0x34c3e1,_0x2d50dc){return new BPromise(function(_0x435f7d,_0xbbc61a){return client[_0x93aa('0xa')](_0x1c19e4,_0x2d50dc)[_0x93aa('0xb')](function(_0x3c82cf){logger[_0x93aa('0xc')](_0x93aa('0xd'),_0x34c3e1,_0x93aa('0xe'));logger[_0x93aa('0xf')](_0x93aa('0x10'),_0x34c3e1,_0x93aa('0xe'),JSON[_0x93aa('0x11')](_0x3c82cf));if(_0x3c82cf['error']){if(_0x3c82cf[_0x93aa('0x12')][_0x93aa('0x13')]===0x1f4){logger['error'](_0x93aa('0xd'),_0x34c3e1,_0x3c82cf[_0x93aa('0x12')][_0x93aa('0x14')]);return _0xbbc61a(_0x3c82cf[_0x93aa('0x12')][_0x93aa('0x14')]);}logger['error'](_0x93aa('0xd'),_0x34c3e1,_0x3c82cf[_0x93aa('0x12')][_0x93aa('0x14')]);return _0x435f7d(_0x3c82cf[_0x93aa('0x12')][_0x93aa('0x14')]);}else{logger[_0x93aa('0xc')](_0x93aa('0xd'),_0x34c3e1,'request\x20sent');_0x435f7d(_0x3c82cf[_0x93aa('0x15')][_0x93aa('0x14')]);}})['catch'](function(_0x4a7ab1){logger[_0x93aa('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x34c3e1,_0x4a7ab1);_0xbbc61a(_0x4a7ab1);});});} \ No newline at end of file +var _0x0423=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils'];(function(_0x5c5fe7,_0x2a64eb){var _0xd817f=function(_0x54b2f2){while(--_0x54b2f2){_0x5c5fe7['push'](_0x5c5fe7['shift']());}};_0xd817f(++_0x2a64eb);}(_0x0423,0x18b));var _0x3042=function(_0x43028e,_0x33a648){_0x43028e=_0x43028e-0x0;var _0x2fed6d=_0x0423[_0x43028e];return _0x2fed6d;};'use strict';var _=require(_0x3042('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3042('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3042('0x2'))['db'];var utils=require(_0x3042('0x3'));var logger=require(_0x3042('0x4'))(_0x3042('0x5'));var config=require(_0x3042('0x6'));var jayson=require(_0x3042('0x7'));var client=jayson['client'][_0x3042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21a40d,_0x298fff,_0x55ce30){return new BPromise(function(_0x37daed,_0x373f35){return client[_0x3042('0x9')](_0x21a40d,_0x55ce30)[_0x3042('0xa')](function(_0x514e3a){logger['info'](_0x3042('0xb'),_0x298fff,_0x3042('0xc'));logger['debug'](_0x3042('0xd'),_0x298fff,'request\x20sent',JSON[_0x3042('0xe')](_0x514e3a));if(_0x514e3a[_0x3042('0xf')]){if(_0x514e3a[_0x3042('0xf')]['code']===0x1f4){logger[_0x3042('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);return _0x373f35(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x514e3a['error'][_0x3042('0x10')]);return _0x37daed(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x3042('0xc'));_0x37daed(_0x514e3a[_0x3042('0x11')][_0x3042('0x10')]);}})[_0x3042('0x12')](function(_0x41884d){logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x41884d);_0x373f35(_0x41884d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9dcef04..06bb73c 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 _0xe89d=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x1bd8d2,_0x274468){var _0x145048=function(_0x20b58b){while(--_0x20b58b){_0x1bd8d2['push'](_0x1bd8d2['shift']());}};_0x145048(++_0x274468);}(_0xe89d,0x8b));var _0xde89=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xe89d[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0xde89('0x0'));var util=require(_0xde89('0x1'));var path=require(_0xde89('0x2'));var timeout=require('connect-timeout');var express=require(_0xde89('0x3'));var router=express[_0xde89('0x4')]();var fs_extra=require(_0xde89('0x5'));var auth=require(_0xde89('0x6'));var interaction=require(_0xde89('0x7'));var config=require(_0xde89('0x8'));var controller=require(_0xde89('0x9'));router[_0xde89('0xa')]('/',auth[_0xde89('0xb')](),controller[_0xde89('0xc')]);router[_0xde89('0xa')](_0xde89('0xd'),auth[_0xde89('0xb')](),controller[_0xde89('0xe')]);router[_0xde89('0xa')](_0xde89('0xf'),auth[_0xde89('0xb')](),controller['show']);router[_0xde89('0x10')]('/',auth[_0xde89('0xb')](),controller[_0xde89('0x11')]);router[_0xde89('0x12')](_0xde89('0xf'),auth['isAuthenticated'](),controller[_0xde89('0x13')]);router[_0xde89('0x14')](_0xde89('0xf'),auth['isAuthenticated'](),controller[_0xde89('0x15')]);module[_0xde89('0x16')]=router; \ No newline at end of file +var _0x88ce=['create','/:id','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','/describe','isAuthenticated','describe','get','show','post'];(function(_0x3abbbc,_0x2ad6e6){var _0x4d33de=function(_0x3fd049){while(--_0x3fd049){_0x3abbbc['push'](_0x3abbbc['shift']());}};_0x4d33de(++_0x2ad6e6);}(_0x88ce,0x159));var _0xe88c=function(_0x479127,_0x43686d){_0x479127=_0x479127-0x0;var _0x16eb43=_0x88ce[_0x479127];return _0x16eb43;};'use strict';var multer=require(_0xe88c('0x0'));var util=require(_0xe88c('0x1'));var path=require('path');var timeout=require(_0xe88c('0x2'));var express=require('express');var router=express[_0xe88c('0x3')]();var fs_extra=require(_0xe88c('0x4'));var auth=require(_0xe88c('0x5'));var interaction=require(_0xe88c('0x6'));var config=require('../../config/environment');var controller=require(_0xe88c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe88c('0x8')]);router['get'](_0xe88c('0x9'),auth[_0xe88c('0xa')](),controller[_0xe88c('0xb')]);router[_0xe88c('0xc')]('/:id',auth[_0xe88c('0xa')](),controller[_0xe88c('0xd')]);router[_0xe88c('0xe')]('/',auth[_0xe88c('0xa')](),controller[_0xe88c('0xf')]);router['put'](_0xe88c('0x10'),auth[_0xe88c('0xa')](),controller[_0xe88c('0x11')]);router[_0xe88c('0x12')]('/:id',auth[_0xe88c('0xa')](),controller['destroy']);module[_0xe88c('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 8d5cf54..b0fd0c1 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 _0x9bde=['setDataValue','stringify','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','INTEGER','input','text','name','getDataValue','onlineForm','parse'];(function(_0x57201d,_0x7e4ec7){var _0x2f29e5=function(_0x5178a1){while(--_0x5178a1){_0x57201d['push'](_0x57201d['shift']());}};_0x2f29e5(++_0x7e4ec7);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1612db,_0xba3f45){_0x1612db=_0x1612db-0x0;var _0x14aac1=_0x9bde[_0x1612db];return _0x14aac1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe9bd('0x0'));module['exports']={'name':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9bd('0x2')},'description':{'type':Sequelize[_0xe9bd('0x1')]},'mapKey':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x3')},'mapKeyOffline':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x3')},'key':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x4')},'customerAlias':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe9bd('0x8')](_0xe9bd('0x9'),'squared'),'defaultValue':_0xe9bd('0x9')},'header_online':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xa')},'start_chat_button':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xb')},'download_transcript':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe9bd('0xd')]},'closingQuestion':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x10')},'noteTitle':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x12')},'closingMessage':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x13')},'closingMessageButton':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x14')},'ratingType':{'type':Sequelize[_0xe9bd('0x8')](_0xe9bd('0x15'),_0xe9bd('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe9bd('0x17')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xe9bd('0x18'),'variable':null,'config':{'placeholder':'name','type':_0xe9bd('0x19'),'required':!![]},'props':{'title':_0xe9bd('0x1a'),'helpText':''}},{'type':_0xe9bd('0x18'),'props':{'title':_0xe9bd('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xe9bd('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe9bd('0x1b')](_0xe9bd('0x1c'))?JSON[_0xe9bd('0x1d')](this[_0xe9bd('0x1b')](_0xe9bd('0x1c'))):{};},'set':function(_0x399f3c){return this[_0xe9bd('0x1e')](_0xe9bd('0x1c'),JSON['stringify'](_0x399f3c));}},'offlineForm':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':function(){return JSON[_0xe9bd('0x1f')]({'items':[{'type':'input','props':{'title':_0xe9bd('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9bd('0x3'),'type':_0xe9bd('0x3')},'variable':null},{'type':_0xe9bd('0x20'),'config':{'placeholder':_0xe9bd('0x21')},'props':{'title':_0xe9bd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xe9bd('0x22'))?JSON['parse'](this[_0xe9bd('0x1b')](_0xe9bd('0x22'))):{};},'set':function(_0x27f80c){return this[_0xe9bd('0x1e')](_0xe9bd('0x22'),JSON['stringify'](_0x27f80c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe9bd('0x23')]();}},'autoclose':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe9bd('0x1')]},'forwardOffline':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe9bd('0x1')]},'waitingTitle':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x27')},'skipUnmanaged':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x28')},'sendUnmanaged':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x29')},'enableCustomerAttachment':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe9bd('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe9bd('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':function(){return _0xe9bd('0x2a');}},'notificationSound':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe9bd('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xe9bd('0x17')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x2b')},'defaultTitle':{'type':Sequelize[_0xe9bd('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe9bd('0x17')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe9bd('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe9bd('0x17')],'comment':_0xe9bd('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![],'comment':_0xe9bd('0x2e'),'set':function(_0x253359){if(!_0x253359)this[_0xe9bd('0x1e')](_0xe9bd('0x2f'),null);this[_0xe9bd('0x1e')](_0xe9bd('0x30'),_0x253359);}},'vidaooEscalation':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9bd('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xe9bd('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x2a8f2d,_0xd027fa){var _0x1084c4=function(_0xe3cac2){while(--_0xe3cac2){_0x2a8f2d['push'](_0x2a8f2d['shift']());}};_0x1084c4(++_0xd027fa);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4587bb,_0xcea66a){_0x4587bb=_0x4587bb-0x0;var _0x46b1a2=_0xee5b[_0x4587bb];return _0x46b1a2;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ded1b25..e33c076 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 _0x05fd=['originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','chatLicenseExceeded','all','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','ISOLATION_LEVELS','ChatApplication','findAndCountAll','stack','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','status','end','offset','undefined','count','Content-Range','json','update','destroy','ChatWebsites','sendStatus','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','length','includeAll','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','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','List','Contacts','DESC','Applications','account','list','applications','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','files','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId'];(function(_0x223534,_0xac7a7e){var _0x4c2a90=function(_0x3dfc8f){while(--_0x3dfc8f){_0x223534['push'](_0x223534['shift']());}};_0x4c2a90(++_0xac7a7e);}(_0x05fd,0x16e));var _0xd05f=function(_0x9f05ab,_0xf65d99){_0x9f05ab=_0x9f05ab-0x0;var _0x383ca7=_0x05fd[_0x9f05ab];return _0x383ca7;};'use strict';var BPromise=require(_0xd05f('0x0'));var Mustache=require(_0xd05f('0x1'));var util=require(_0xd05f('0x2'));var path=require(_0xd05f('0x3'));var ejs=require(_0xd05f('0x4'));var fs=require('fs');var fs_extra=require(_0xd05f('0x5'));var _=require(_0xd05f('0x6'));var querystring=require('querystring');var Redis=require(_0xd05f('0x7'));var qs=require(_0xd05f('0x8'));var logger=require(_0xd05f('0x9'))(_0xd05f('0xa'));var config=require(_0xd05f('0xb'));var db=require(_0xd05f('0xc'))['db'];config[_0xd05f('0xd')]=_[_0xd05f('0xe')](config[_0xd05f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd05f('0xf'))(new Redis(config[_0xd05f('0xd')]));require(_0xd05f('0x10'))[_0xd05f('0x11')](socket);var htmlToText=require(_0xd05f('0x12'));var jayson=require(_0xd05f('0x13'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xd05f('0x14')]['http']({'port':0x232a});var client9003=jayson[_0xd05f('0x14')][_0xd05f('0x15')]({'port':0x232b});var client9001=jayson['client'][_0xd05f('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x477c4b,_0x5364d7,_0x25ea1a,_0x2a0e8e){return new BPromise(function(_0x282da6,_0x1d0dc9){var _0x5a62a0=_0x2a0e8e||client;return _0x5a62a0[_0xd05f('0x16')](_0x477c4b,_0x25ea1a)[_0xd05f('0x17')](function(_0x1daea2){logger[_0xd05f('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x5364d7,'request\x20sent');logger[_0xd05f('0x19')](_0xd05f('0x1a'),_0x5364d7,'request\x20sent',JSON[_0xd05f('0x1b')](_0x1daea2));if(_0x1daea2[_0xd05f('0x1c')]){if(_0x1daea2['error']['code']===0x1f4){logger[_0xd05f('0x1c')](_0xd05f('0x1d'),_0x5364d7,_0x1daea2['error']['message']);return _0x1d0dc9(_0x1daea2[_0xd05f('0x1c')][_0xd05f('0x1e')]);}logger['error'](_0xd05f('0x1d'),_0x5364d7,_0x1daea2[_0xd05f('0x1c')]['message']);return _0x282da6(_0x1daea2[_0xd05f('0x1c')][_0xd05f('0x1e')]);}else{logger[_0xd05f('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x5364d7,'request\x20sent');_0x282da6(_0x1daea2[_0xd05f('0x1f')]['message']);}})['catch'](function(_0x27b4cd){logger[_0xd05f('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5364d7,_0x27b4cd);_0x1d0dc9(_0x27b4cd);});});}function respondWithStatusCode(_0xbadc63,_0x13dc23){_0x13dc23=_0x13dc23||0xcc;return function(_0x18bfc8){if(_0x18bfc8){return _0xbadc63['sendStatus'](_0x13dc23);}return _0xbadc63[_0xd05f('0x20')](_0x13dc23)[_0xd05f('0x21')]();};}function respondWithResult(_0x4838e0,_0x401007){_0x401007=_0x401007||0xc8;return function(_0x3fc570){if(_0x3fc570){return _0x4838e0[_0xd05f('0x20')](_0x401007)['json'](_0x3fc570);}};}function respondWithFilteredResult(_0x1c6c6a,_0x3f61a7){return function(_0x38eb92){if(_0x38eb92){var _0x49f564=typeof _0x3f61a7[_0xd05f('0x22')]===_0xd05f('0x23')&&typeof _0x3f61a7['limit']===_0xd05f('0x23');var _0x5570c9=_0x38eb92['count'];var _0xbdd443=_0x49f564?0x0:_0x3f61a7[_0xd05f('0x22')];var _0x6d6275=_0x49f564?_0x38eb92[_0xd05f('0x24')]:_0x3f61a7[_0xd05f('0x22')]+_0x3f61a7['limit'];var _0x1d53a6;if(_0x6d6275>=_0x5570c9){_0x6d6275=_0x5570c9;_0x1d53a6=0xc8;}else{_0x1d53a6=0xce;}_0x1c6c6a[_0xd05f('0x20')](_0x1d53a6);return _0x1c6c6a['set'](_0xd05f('0x25'),_0xbdd443+'-'+_0x6d6275+'/'+_0x5570c9)[_0xd05f('0x26')](_0x38eb92);}return null;};}function saveUpdates(_0x507254){return function(_0x1c80fa){if(_0x1c80fa){return _0x1c80fa[_0xd05f('0x27')](_0x507254)[_0xd05f('0x17')](function(_0x38a3b2){return _0x38a3b2;});}return null;};}function removeEntity(_0x2db9c4){return function(_0x27faab){if(_0x27faab){return _0x27faab[_0xd05f('0x28')]()[_0xd05f('0x17')](function(){var _0x545e2c=_0x27faab['get']({'plain':!![]});var _0x20044a=_0xd05f('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x20044a,'resourceId':_0x545e2c['id']}})[_0xd05f('0x17')](function(){return _0x27faab;});})['then'](function(){_0x2db9c4[_0xd05f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26aa55){return function(_0x106b80){if(!_0x106b80){_0x26aa55[_0xd05f('0x2a')](0x194);}return _0x106b80;};}function handleError(_0x1af455,_0x4c000a){_0x4c000a=_0x4c000a||0x1f4;return function(_0x4d9b8){logger['error'](_0x4d9b8['stack']);if(_0x4d9b8[_0xd05f('0x2b')]){delete _0x4d9b8[_0xd05f('0x2b')];}_0x1af455[_0xd05f('0x20')](_0x4c000a)[_0xd05f('0x2c')](_0x4d9b8);};}exports['index']=function(_0x2e20c4,_0x324564){var _0x1d7d86={'include':[{'model':db[_0xd05f('0x2d')],'as':_0xd05f('0x2e')}]},_0x4014b0={},_0x2d78e1={'count':0x0,'rows':[]};var _0xabd428=_[_0xd05f('0x2f')](db[_0xd05f('0x30')][_0xd05f('0x31')],function(_0x3dc006){return{'name':_0x3dc006[_0xd05f('0x32')],'type':_0x3dc006['type'][_0xd05f('0x33')]};});_0x4014b0[_0xd05f('0x34')]=_[_0xd05f('0x2f')](_0xabd428,_0xd05f('0x2b'));_0x4014b0[_0xd05f('0x35')]=_[_0xd05f('0x36')](_0x2e20c4[_0xd05f('0x35')]);_0x4014b0[_0xd05f('0x37')]=_[_0xd05f('0x38')](_0x4014b0[_0xd05f('0x34')],_0x4014b0[_0xd05f('0x35')]);_0x1d7d86[_0xd05f('0x39')]=_[_0xd05f('0x38')](_0x4014b0[_0xd05f('0x34')],qs[_0xd05f('0x3a')](_0x2e20c4['query'][_0xd05f('0x3a')]));_0x1d7d86[_0xd05f('0x39')]=_0x1d7d86[_0xd05f('0x39')]['length']?_0x1d7d86[_0xd05f('0x39')]:_0x4014b0[_0xd05f('0x34')];if(!_0x2e20c4[_0xd05f('0x35')]['hasOwnProperty'](_0xd05f('0x3b'))){_0x1d7d86['limit']=qs[_0xd05f('0x3c')](_0x2e20c4['query'][_0xd05f('0x3c')]);_0x1d7d86[_0xd05f('0x22')]=qs[_0xd05f('0x22')](_0x2e20c4[_0xd05f('0x35')][_0xd05f('0x22')]);}_0x1d7d86[_0xd05f('0x3d')]=qs[_0xd05f('0x3e')](_0x2e20c4[_0xd05f('0x35')][_0xd05f('0x3e')]);_0x1d7d86['where']=qs[_0xd05f('0x37')](_[_0xd05f('0x3f')](_0x2e20c4['query'],_0x4014b0['filters']),_0xabd428);if(_0x2e20c4[_0xd05f('0x35')][_0xd05f('0x40')]){_0x1d7d86['where']=_['merge'](_0x1d7d86[_0xd05f('0x41')],{'$or':_[_0xd05f('0x2f')](_0xabd428,function(_0x437e43){if(_0x437e43['type']!==_0xd05f('0x42')){var _0x34b476={};_0x34b476[_0x437e43[_0xd05f('0x2b')]]={'$like':'%'+_0x2e20c4['query'][_0xd05f('0x40')]+'%'};return _0x34b476;}})});}_0x1d7d86=_[_0xd05f('0x43')]({},_0x1d7d86,_0x2e20c4[_0xd05f('0x44')]);var _0x170275={'where':_0x1d7d86['where']};return db[_0xd05f('0x30')]['count'](_0x170275)['then'](function(_0x5538cc){_0x2d78e1[_0xd05f('0x24')]=_0x5538cc;if(_0x2e20c4[_0xd05f('0x35')]['includeAll']){_0x1d7d86[_0xd05f('0x45')]=[{'all':!![]}];}return db['ChatWebsite'][_0xd05f('0x46')](_0x1d7d86);})[_0xd05f('0x17')](function(_0x246d67){_0x2d78e1[_0xd05f('0x47')]=_0x246d67;return _0x2d78e1;})['then'](respondWithFilteredResult(_0x324564,_0x1d7d86))[_0xd05f('0x48')](handleError(_0x324564,null));};exports[_0xd05f('0x49')]=function(_0x2d4c9d,_0x11561a){var _0x572b02={'raw':![],'where':{'id':_0x2d4c9d['params']['id']},'include':[{'model':db[_0xd05f('0x2d')],'as':_0xd05f('0x2e')}]},_0x3e3aad={};_0x3e3aad['model']=_[_0xd05f('0x36')](db[_0xd05f('0x30')]['rawAttributes']);_0x3e3aad['query']=_[_0xd05f('0x36')](_0x2d4c9d['query']);_0x3e3aad[_0xd05f('0x37')]=_['intersection'](_0x3e3aad['model'],_0x3e3aad[_0xd05f('0x35')]);_0x572b02[_0xd05f('0x39')]=_[_0xd05f('0x38')](_0x3e3aad[_0xd05f('0x34')],qs[_0xd05f('0x3a')](_0x2d4c9d[_0xd05f('0x35')][_0xd05f('0x3a')]));_0x572b02[_0xd05f('0x39')]=_0x572b02[_0xd05f('0x39')][_0xd05f('0x4a')]?_0x572b02[_0xd05f('0x39')]:_0x3e3aad[_0xd05f('0x34')];if(_0x2d4c9d[_0xd05f('0x35')][_0xd05f('0x4b')]){_0x572b02['include']=[{'all':!![]}];}_0x572b02=_[_0xd05f('0x43')]({},_0x572b02,_0x2d4c9d[_0xd05f('0x44')]);return db[_0xd05f('0x30')][_0xd05f('0x4c')](_0x572b02)[_0xd05f('0x17')](handleEntityNotFound(_0x11561a,null))[_0xd05f('0x17')](respondWithResult(_0x11561a,null))[_0xd05f('0x48')](handleError(_0x11561a,null));};exports[_0xd05f('0x4d')]=function(_0x2f1687,_0x532791){return db[_0xd05f('0x30')][_0xd05f('0x4d')](_0x2f1687['body'],{})[_0xd05f('0x17')](function(_0x28f687){var _0x4c07e6=_0x2f1687[_0xd05f('0x4e')][_0xd05f('0x4f')]({'plain':!![]});if(!_0x4c07e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c07e6['role']===_0xd05f('0x4e')){var _0x538490=_0x28f687[_0xd05f('0x4f')]({'plain':!![]});var _0x42b2a2=_0xd05f('0x29');return db[_0xd05f('0x50')]['find']({'where':{'name':_0x42b2a2,'userProfileId':_0x4c07e6[_0xd05f('0x51')]},'raw':!![]})[_0xd05f('0x17')](function(_0x439e6b){if(_0x439e6b&&_0x439e6b[_0xd05f('0x52')]===0x0){return db[_0xd05f('0x53')][_0xd05f('0x4d')]({'name':_0x538490[_0xd05f('0x2b')],'resourceId':_0x538490['id'],'type':_0x439e6b[_0xd05f('0x2b')],'sectionId':_0x439e6b['id']},{})['then'](function(){return _0x28f687;});}else{return _0x28f687;}})[_0xd05f('0x48')](function(_0x12b46f){logger[_0xd05f('0x1c')](_0xd05f('0x54'),_0x12b46f);throw _0x12b46f;});}return _0x28f687;})[_0xd05f('0x17')](respondWithResult(_0x532791,0xc9))[_0xd05f('0x48')](handleError(_0x532791,null));};exports[_0xd05f('0x27')]=function(_0x77beb4,_0x59a7c9){if(_0x77beb4['body']['id']){delete _0x77beb4[_0xd05f('0x55')]['id'];}return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x77beb4[_0xd05f('0x56')]['id']},'include':[{'model':db[_0xd05f('0x2d')],'as':_0xd05f('0x2e')}]})[_0xd05f('0x17')](handleEntityNotFound(_0x59a7c9,null))['then'](saveUpdates(_0x77beb4['body'],null))[_0xd05f('0x17')](respondWithResult(_0x59a7c9,null))[_0xd05f('0x48')](handleError(_0x59a7c9,null));};exports[_0xd05f('0x28')]=function(_0x231955,_0x207c92){return db['ChatWebsite']['find']({'where':{'id':_0x231955[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x207c92,null))[_0xd05f('0x17')](removeEntity(_0x207c92,null))[_0xd05f('0x48')](handleError(_0x207c92,null));};exports['describe']=function(_0x457917,_0x15bfef){return db[_0xd05f('0x30')][_0xd05f('0x57')]()['then'](respondWithResult(_0x15bfef,null))[_0xd05f('0x48')](handleError(_0x15bfef,null));};exports[_0xd05f('0x58')]=function(_0x40033d,_0x3b8f09){if(_0x40033d['body']['id']){delete _0x40033d[_0xd05f('0x55')]['id'];}return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x40033d[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x3b8f09,null))[_0xd05f('0x17')](function(_0x248dfb){if(_0x248dfb){_0x40033d['body'][_0xd05f('0x59')]=_0x248dfb['id'];return db[_0xd05f('0x5a')]['create'](_0x40033d[_0xd05f('0x55')]);}})[_0xd05f('0x17')](respondWithResult(_0x3b8f09,null))[_0xd05f('0x48')](handleError(_0x3b8f09,null));};exports['getDispositions']=function(_0x4641fc,_0x484063){var _0x46f825={'raw':![],'where':{}};var _0x6f9e56={};var _0x44d44d={'count':0x0,'rows':[]};return db[_0xd05f('0x30')]['findOne']({'where':{'id':_0x4641fc[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x484063,null))[_0xd05f('0x17')](function(_0x42225e){if(_0x42225e){_0x6f9e56[_0xd05f('0x34')]=_[_0xd05f('0x36')](db[_0xd05f('0x5a')][_0xd05f('0x31')]);_0x6f9e56[_0xd05f('0x35')]=_[_0xd05f('0x36')](_0x4641fc[_0xd05f('0x35')]);_0x6f9e56[_0xd05f('0x37')]=_[_0xd05f('0x38')](_0x6f9e56[_0xd05f('0x34')],_0x6f9e56[_0xd05f('0x35')]);_0x46f825[_0xd05f('0x39')]=_[_0xd05f('0x38')](_0x6f9e56[_0xd05f('0x34')],qs[_0xd05f('0x3a')](_0x4641fc[_0xd05f('0x35')][_0xd05f('0x3a')]));_0x46f825['attributes']=_0x46f825['attributes'][_0xd05f('0x4a')]?_0x46f825['attributes']:_0x6f9e56[_0xd05f('0x34')];if(!_0x4641fc[_0xd05f('0x35')][_0xd05f('0x5b')](_0xd05f('0x3b'))){_0x46f825[_0xd05f('0x3c')]=qs[_0xd05f('0x3c')](_0x4641fc[_0xd05f('0x35')][_0xd05f('0x3c')]);_0x46f825[_0xd05f('0x22')]=qs[_0xd05f('0x22')](_0x4641fc[_0xd05f('0x35')][_0xd05f('0x22')]);}_0x46f825[_0xd05f('0x3d')]=qs['sort'](_0x4641fc[_0xd05f('0x35')][_0xd05f('0x3e')]);_0x46f825['where']=qs['filters'](_[_0xd05f('0x3f')](_0x4641fc[_0xd05f('0x35')],_0x6f9e56[_0xd05f('0x37')]));_0x46f825[_0xd05f('0x41')]['ChatWebsiteId']=_0x42225e['id'];if(_0x4641fc[_0xd05f('0x35')][_0xd05f('0x40')]){_0x46f825['where']=_[_0xd05f('0x43')](_0x46f825[_0xd05f('0x41')],{'$or':_['map'](_0x46f825[_0xd05f('0x39')],function(_0x4f3b67){var _0x35ecb3={};_0x35ecb3[_0x4f3b67]={'$like':'%'+_0x4641fc[_0xd05f('0x35')]['filter']+'%'};return _0x35ecb3;})});}_0x46f825=_[_0xd05f('0x43')]({},_0x46f825,_0x4641fc[_0xd05f('0x44')]);return db[_0xd05f('0x5a')][_0xd05f('0x24')]({'where':_0x46f825[_0xd05f('0x41')]})[_0xd05f('0x17')](function(_0x28f2ba){_0x44d44d[_0xd05f('0x24')]=_0x28f2ba;if(_0x4641fc[_0xd05f('0x35')][_0xd05f('0x4b')]){_0x46f825[_0xd05f('0x45')]=[{'all':!![]}];}return db['Disposition'][_0xd05f('0x46')](_0x46f825);})[_0xd05f('0x17')](function(_0x402bc5){_0x44d44d[_0xd05f('0x47')]=_0x402bc5;return _0x44d44d;});}})['then'](respondWithFilteredResult(_0x484063,_0x46f825))['catch'](handleError(_0x484063,null));};exports[_0xd05f('0x5c')]=function(_0x385974,_0x1f5a88){return db['ChatWebsite'][_0xd05f('0x4c')]({'where':{'id':_0x385974[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x1f5a88,null))[_0xd05f('0x17')](function(_0x526cf0){if(_0x526cf0){return _0x526cf0['removeDispositions'](_0x385974['query'][_0xd05f('0x5d')]);}})[_0xd05f('0x17')](respondWithStatusCode(_0x1f5a88,null))[_0xd05f('0x48')](handleError(_0x1f5a88,null));};exports[_0xd05f('0x5e')]=function(_0x57e4d0,_0xfff89f){if(_0x57e4d0[_0xd05f('0x55')]['id']){delete _0x57e4d0[_0xd05f('0x55')]['id'];}return db[_0xd05f('0x30')]['find']({'where':{'id':_0x57e4d0[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0xfff89f,null))[_0xd05f('0x17')](function(_0x5a5686){if(_0x5a5686){_0x57e4d0['body']['ChatWebsiteId']=_0x5a5686['id'];return db['CannedAnswer'][_0xd05f('0x4d')](_0x57e4d0['body']);}})[_0xd05f('0x17')](respondWithResult(_0xfff89f,null))['catch'](handleError(_0xfff89f,null));};exports['getAnswers']=function(_0x2808eb,_0x17ddd9){var _0x265c29={'raw':![],'where':{}};var _0x3ab662={};var _0x1259d1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd05f('0x5f')]({'where':{'id':_0x2808eb[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x17ddd9,null))[_0xd05f('0x17')](function(_0x5744a2){if(_0x5744a2){_0x3ab662['model']=_[_0xd05f('0x36')](db[_0xd05f('0x60')][_0xd05f('0x31')]);_0x3ab662[_0xd05f('0x35')]=_[_0xd05f('0x36')](_0x2808eb[_0xd05f('0x35')]);_0x3ab662['filters']=_[_0xd05f('0x38')](_0x3ab662[_0xd05f('0x34')],_0x3ab662[_0xd05f('0x35')]);_0x265c29[_0xd05f('0x39')]=_['intersection'](_0x3ab662[_0xd05f('0x34')],qs[_0xd05f('0x3a')](_0x2808eb[_0xd05f('0x35')]['fields']));_0x265c29[_0xd05f('0x39')]=_0x265c29[_0xd05f('0x39')][_0xd05f('0x4a')]?_0x265c29[_0xd05f('0x39')]:_0x3ab662[_0xd05f('0x34')];if(!_0x2808eb[_0xd05f('0x35')]['hasOwnProperty'](_0xd05f('0x3b'))){_0x265c29[_0xd05f('0x3c')]=qs['limit'](_0x2808eb[_0xd05f('0x35')][_0xd05f('0x3c')]);_0x265c29[_0xd05f('0x22')]=qs['offset'](_0x2808eb[_0xd05f('0x35')][_0xd05f('0x22')]);}_0x265c29['order']=qs[_0xd05f('0x3e')](_0x2808eb['query'][_0xd05f('0x3e')]);_0x265c29['where']=qs[_0xd05f('0x37')](_[_0xd05f('0x3f')](_0x2808eb[_0xd05f('0x35')],_0x3ab662[_0xd05f('0x37')]));_0x265c29[_0xd05f('0x41')][_0xd05f('0x59')]=_0x5744a2['id'];if(_0x2808eb['query'][_0xd05f('0x40')]){_0x265c29[_0xd05f('0x41')]=_[_0xd05f('0x43')](_0x265c29[_0xd05f('0x41')],{'$or':_[_0xd05f('0x2f')](_0x265c29[_0xd05f('0x39')],function(_0x42816f){var _0x365778={};_0x365778[_0x42816f]={'$like':'%'+_0x2808eb[_0xd05f('0x35')]['filter']+'%'};return _0x365778;})});}_0x265c29=_[_0xd05f('0x43')]({},_0x265c29,_0x2808eb['options']);return db[_0xd05f('0x60')]['count']({'where':_0x265c29[_0xd05f('0x41')]})[_0xd05f('0x17')](function(_0x4adfa9){_0x1259d1[_0xd05f('0x24')]=_0x4adfa9;if(_0x2808eb[_0xd05f('0x35')][_0xd05f('0x4b')]){_0x265c29[_0xd05f('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd05f('0x46')](_0x265c29);})['then'](function(_0x2d3405){_0x1259d1[_0xd05f('0x47')]=_0x2d3405;return _0x1259d1;});}})['then'](respondWithFilteredResult(_0x17ddd9,_0x265c29))['catch'](handleError(_0x17ddd9,null));};exports[_0xd05f('0x61')]=function(_0x1dc3df,_0x5c8b01){return db['ChatWebsite'][_0xd05f('0x4c')]({'where':{'id':_0x1dc3df['params']['id']}})['then'](handleEntityNotFound(_0x5c8b01,null))[_0xd05f('0x17')](function(_0x23b3a4){if(_0x23b3a4){return _0x23b3a4['removeAnswers'](_0x1dc3df[_0xd05f('0x35')][_0xd05f('0x5d')]);}})['then'](respondWithStatusCode(_0x5c8b01,null))[_0xd05f('0x48')](handleError(_0x5c8b01,null));};exports[_0xd05f('0x62')]=function(_0x3fb634,_0x111c8a){_0x3fb634[_0xd05f('0x55')]['sitepic']=_0x3fb634[_0xd05f('0x63')][_0xd05f('0x64')];return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x3fb634['params']['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x111c8a,null))[_0xd05f('0x17')](saveUpdates(_0x3fb634['body'],null))[_0xd05f('0x17')](respondWithResult(_0x111c8a,null))[_0xd05f('0x48')](handleError(_0x111c8a,null));};exports[_0xd05f('0x65')]=function(_0x1992f0,_0x1782fd){_0x1992f0[_0xd05f('0x55')][_0xd05f('0x66')]=_0x1992f0[_0xd05f('0x63')][_0xd05f('0x64')];return db[_0xd05f('0x30')]['find']({'where':{'id':_0x1992f0[_0xd05f('0x56')]['id']}})['then'](handleEntityNotFound(_0x1782fd,null))[_0xd05f('0x17')](saveUpdates(_0x1992f0[_0xd05f('0x55')],null))[_0xd05f('0x17')](respondWithResult(_0x1782fd,null))[_0xd05f('0x48')](handleError(_0x1782fd,null));};exports['addCustomerAvatar']=function(_0x3ac9b7,_0x6e969e){_0x3ac9b7[_0xd05f('0x55')][_0xd05f('0x67')]=_0x3ac9b7[_0xd05f('0x63')]['filename'];return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x3ac9b7[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x6e969e,null))[_0xd05f('0x17')](saveUpdates(_0x3ac9b7[_0xd05f('0x55')],null))[_0xd05f('0x17')](respondWithResult(_0x6e969e,null))['catch'](handleError(_0x6e969e,null));};exports[_0xd05f('0x68')]=function(_0x16f684,_0x179d73){_0x16f684['body']['systemAvatar']=_0x16f684[_0xd05f('0x63')][_0xd05f('0x64')];return db['ChatWebsite'][_0xd05f('0x4c')]({'where':{'id':_0x16f684['params']['id']}})['then'](handleEntityNotFound(_0x179d73,null))[_0xd05f('0x17')](saveUpdates(_0x16f684[_0xd05f('0x55')],null))[_0xd05f('0x17')](respondWithResult(_0x179d73,null))['catch'](handleError(_0x179d73,null));};exports[_0xd05f('0x69')]=function(_0x26562d,_0x3d2b30){var _0x4d0fbb=path['join'](config[_0xd05f('0x6a')],_0xd05f('0x6b'));var _0xa8783d={'where':{'id':_0x26562d[_0xd05f('0x56')]['id']},'attributes':['id',_0xd05f('0x6c')],'raw':!![]};var _0x5152dc=![];return require('../../config/license/util')['getLicense']()[_0xd05f('0x17')](function(_0x15ab2a){if(_0x15ab2a){_0x5152dc=_0x15ab2a['custom'];}})[_0xd05f('0x17')](function(){return db['ChatWebsite'][_0xd05f('0x4c')](_0xa8783d);})[_0xd05f('0x17')](handleEntityNotFound(_0x3d2b30,null))[_0xd05f('0x17')](function(_0x2ee628){if(_0x2ee628){if(!_['isNil'](_0x2ee628[_0xd05f('0x6c')])){if(fs[_0xd05f('0x6d')](path[_0xd05f('0x6e')](config['root'],_0xd05f('0x6f'),_0x2ee628['sitepic']))&&_0x5152dc){_0x4d0fbb=path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],_0xd05f('0x6f'),_0x2ee628[_0xd05f('0x6c')]);}}return _0x3d2b30[_0xd05f('0x70')](_0x4d0fbb);}})['catch'](handleError(_0x3d2b30,null));};exports['getAvatar']=function(_0x30ef80,_0x423ca0){var _0x25ac3d=path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],_0xd05f('0x71'));var _0xf3c1a5={'where':{'id':_0x30ef80[_0xd05f('0x56')]['id']},'attributes':['id',_0xd05f('0x66')],'raw':!![]};return db[_0xd05f('0x30')][_0xd05f('0x4c')](_0xf3c1a5)['then'](handleEntityNotFound(_0x423ca0,null))['then'](function(_0x39ae17){if(_0x39ae17){if(!_[_0xd05f('0x72')](_0x39ae17[_0xd05f('0x66')])){if(fs[_0xd05f('0x6d')](path['join'](config[_0xd05f('0x6a')],_0xd05f('0x73'),_0x39ae17[_0xd05f('0x66')]))){_0x25ac3d=path['join'](config[_0xd05f('0x6a')],_0xd05f('0x73'),_0x39ae17['agentAvatar']);}}return _0x423ca0[_0xd05f('0x70')](_0x25ac3d);}})[_0xd05f('0x48')](handleError(_0x423ca0,null));};exports[_0xd05f('0x74')]=function(_0x2519ba,_0x1fc99f){var _0x1c47ea=path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],_0xd05f('0x75'));var _0x5470c5={'where':{'id':_0x2519ba[_0xd05f('0x56')]['id']},'attributes':['id','customerAvatar',_0xd05f('0x76')],'raw':!![]};return db[_0xd05f('0x30')]['find'](_0x5470c5)[_0xd05f('0x17')](handleEntityNotFound(_0x1fc99f,null))[_0xd05f('0x17')](function(_0x5ca8af){if(_0x5ca8af){if(!_[_0xd05f('0x72')](_0x5ca8af[_0xd05f('0x67')])){if(fs[_0xd05f('0x6d')](path[_0xd05f('0x6e')](config['root'],'server/files/images/avatars/',_0x5ca8af[_0xd05f('0x67')]))&&_0x5ca8af['showCustomerAvatar']){_0x1c47ea=path['join'](config['root'],_0xd05f('0x73'),_0x5ca8af['customerAvatar']);}}return _0x1fc99f[_0xd05f('0x70')](_0x1c47ea);}})[_0xd05f('0x48')](handleError(_0x1fc99f,null));};exports[_0xd05f('0x77')]=function(_0x1d2ef3,_0x5f519d){var _0x56eac7=path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],_0xd05f('0x78'));var _0xc7e4f={'where':{'id':_0x1d2ef3[_0xd05f('0x56')]['id']},'attributes':['id',_0xd05f('0x79')],'raw':!![]};return db[_0xd05f('0x30')][_0xd05f('0x4c')](_0xc7e4f)[_0xd05f('0x17')](handleEntityNotFound(_0x5f519d,null))[_0xd05f('0x17')](function(_0x567a8d){if(_0x567a8d){if(!_['isNil'](_0x567a8d[_0xd05f('0x79')])){if(fs['existsSync'](path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],_0xd05f('0x73'),_0x567a8d[_0xd05f('0x79')]))){_0x56eac7=path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],_0xd05f('0x73'),_0x567a8d[_0xd05f('0x79')]);}}return _0x5f519d[_0xd05f('0x70')](_0x56eac7);}})[_0xd05f('0x48')](handleError(_0x5f519d,null));};exports['notify']=function(_0x5c3a2b,_0x236654){var _0x96f312=require(_0xd05f('0x7a'));var _0x14633f=new _0x96f312();var _0x59ecf3=_0x14633f['setUA'](_0x5c3a2b[_0xd05f('0x7b')][_0xd05f('0x7c')])['getResult']();var _0x2dad37={'body':_0x5c3a2b[_0xd05f('0x55')],'channel':_0xd05f('0x7d')};var _0x2bc305=[];var _0x125cea=[];var _0x35416d={};var _0x458d5b=![];return db[_0xd05f('0x7e')][_0xd05f('0x57')]()[_0xd05f('0x17')](function(_0x52e308){if(!_0x52e308){throw new db[(_0xd05f('0x7f'))]['ValidationError'](_0xd05f('0x80'));}_0x2bc305=_[_0xd05f('0x81')](_[_0xd05f('0x36')](_0x52e308),[_0xd05f('0x82'),_0xd05f('0x83')]);_0x125cea=_[_0xd05f('0x81')](_[_0xd05f('0x36')](_0x52e308),[_0xd05f('0x82'),_0xd05f('0x83'),_0xd05f('0x84'),_0xd05f('0x85')]);if(_0x5c3a2b[_0xd05f('0x55')]['id']){delete _0x5c3a2b[_0xd05f('0x55')]['id'];}if(_[_0xd05f('0x72')](_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x86')])){throw new db[(_0xd05f('0x7f'))][(_0xd05f('0x87'))](_0xd05f('0x88'));}if(_[_0xd05f('0x72')](_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x55')])||_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x55')]===''){throw new db[(_0xd05f('0x7f'))][(_0xd05f('0x87'))](_0xd05f('0x89'));}if(_[_0xd05f('0x72')](_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x8a')])){throw new db[(_0xd05f('0x7f'))]['ValidationError'](_0xd05f('0x8b')+_0x125cea);}if(!_[_0xd05f('0x8c')](_0x125cea,_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x8a')])){throw new db[(_0xd05f('0x7f'))][(_0xd05f('0x87'))](_0xd05f('0x8d')+_0x125cea);}_0x35416d[_0x5c3a2b['body'][_0xd05f('0x8a')]]=_0x5c3a2b[_0xd05f('0x55')]['from'];})[_0xd05f('0x17')](function(){return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x5c3a2b['params']['id']},'include':[{'model':db[_0xd05f('0x8e')],'as':_0xd05f('0x8f'),'include':[{'model':db[_0xd05f('0x7e')],'as':_0xd05f('0x90'),'where':_0x35416d,'limit':0x1,'order':[[_0xd05f('0x83'),_0xd05f('0x91')]]}]},{'model':db['ChatApplication'],'as':_0xd05f('0x92')}]});})['then'](handleEntityNotFound(_0x236654,null))[_0xd05f('0x17')](function(_0x52a047){if(_0x52a047&&_0x52a047[_0xd05f('0x8f')]){_0x2dad37[_0xd05f('0x93')]=_0x52a047;_0x2dad37['applications']=_0x52a047[_0xd05f('0x92')];_0x2dad37[_0xd05f('0x94')]=_0x52a047[_0xd05f('0x8f')];_0x2dad37[_0xd05f('0x95')]=_[_0xd05f('0x96')](_0x2dad37[_0xd05f('0x95')],['priority'],[_0xd05f('0x97')]);if(_0x2dad37[_0xd05f('0x93')][_0xd05f('0x92')]){delete _0x2dad37[_0xd05f('0x93')][_0xd05f('0x92')];}if(_0x2dad37['account']['List']&&_0x2dad37[_0xd05f('0x93')]['List']['Contacts'][_0xd05f('0x4a')]){return _0x2dad37[_0xd05f('0x93')]['List']['Contacts'][0x0];}var _0x321174=_[_0xd05f('0xe')](_0x5c3a2b['body'],{'firstName':_0x5c3a2b['body']['from'],'ListId':_0x52a047[_0xd05f('0x85')]});_0x321174[_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x8a')]]=_0x5c3a2b[_0xd05f('0x55')]['from'];return db[_0xd05f('0x7e')][_0xd05f('0x4d')](_0x321174,{'fields':_0x2bc305,'raw':!![]});}})[_0xd05f('0x17')](handleEntityNotFound(_0x236654,null))[_0xd05f('0x17')](function(_0x5ae4e4){_0x2dad37[_0xd05f('0x98')]=_0x5ae4e4;var _0x5843c5=_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0x99')];if(_0x5c3a2b['headers'][_0xd05f('0x9a')]){_0x5843c5=_0x5c3a2b[_0xd05f('0x7b')][_0xd05f('0x9a')];}else if(_0x5c3a2b[_0xd05f('0x7b')]['x-forwarded-for']){_0x5843c5=_['first'](_0x5c3a2b[_0xd05f('0x7b')][_0xd05f('0x9b')]['split'](','));}if(_0x5ae4e4){var _0x912e2b={'ContactId':_0x5ae4e4['id'],'ChatWebsiteId':_0x5c3a2b[_0xd05f('0x56')]['id'],'from':(_0x5ae4e4[_0xd05f('0x9c')]||'')+'\x20'+(_0x5ae4e4[_0xd05f('0x9d')]||''),'customerIp':_0x5843c5,'customerPort':_0x5c3a2b[_0xd05f('0x7b')][_0xd05f('0x9e')]?_0x5c3a2b[_0xd05f('0x7b')][_0xd05f('0x9e')]:null,'referer':_0x5c3a2b[_0xd05f('0x55')]['referer'],'browserName':_0x59ecf3[_0xd05f('0x9f')][_0xd05f('0x2b')]&&_0x59ecf3[_0xd05f('0x9f')][_0xd05f('0xa0')]?util[_0xd05f('0xa1')](_0xd05f('0xa2'),_0x59ecf3[_0xd05f('0x9f')][_0xd05f('0x2b')],_0x59ecf3[_0xd05f('0x9f')][_0xd05f('0xa0')]):_0xd05f('0xa3'),'browserVersion':_0x59ecf3['browser'][_0xd05f('0xa0')]||_0xd05f('0xa3'),'osName':util['format']('%s\x20%s',_0x59ecf3['os'][_0xd05f('0x2b')],_0x59ecf3['os'][_0xd05f('0xa0')]),'osVersion':_0x59ecf3['os'][_0xd05f('0xa0')],'deviceModel':_0x59ecf3[_0xd05f('0xa4')][_0xd05f('0x34')]&&_0x59ecf3[_0xd05f('0xa4')][_0xd05f('0xa5')]?util[_0xd05f('0xa1')]('%s\x20%s\x20%s',_0x59ecf3[_0xd05f('0xa4')][_0xd05f('0x34')],_0x59ecf3[_0xd05f('0xa4')][_0xd05f('0xa5')],_0x59ecf3[_0xd05f('0xa4')][_0xd05f('0xa6')]):null,'deviceVendor':_0x59ecf3[_0xd05f('0xa4')]['vendor'],'deviceType':_0x59ecf3[_0xd05f('0xa4')][_0xd05f('0xa6')],'formData':JSON['stringify'](_0x5c3a2b[_0xd05f('0x55')])};var _0x42bf01={'ChatWebsiteId':_0x5c3a2b[_0xd05f('0x56')]['id'],'closed':![]};if(_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xa7')]){_0x42bf01[_0xd05f('0xa7')]=_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xa7')];return db[_0xd05f('0xa8')][_0xd05f('0x4c')]({'where':_0x42bf01})['then'](function(_0x20b0d8){if(_0x20b0d8){return[_0x20b0d8,![]];}_0x912e2b['threadId']=_0x5c3a2b['body']['threadId'];_0x912e2b[_0xd05f('0xa9')]=_0x5c3a2b['body']['externalUrl'];return db[_0xd05f('0xa8')][_0xd05f('0x4d')](_0x912e2b)[_0xd05f('0x17')](function(_0x4f4f36){return[_0x4f4f36,!![]];});});}_0x42bf01[_0xd05f('0xaa')]=_0x5ae4e4['id'];if(_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xab')]&&_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xab')]['id']){_0x42bf01['id']=_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xab')]['id'];return db[_0xd05f('0xa8')]['find']({'where':_0x42bf01})[_0xd05f('0x17')](function(_0x133c8b){if(_0x133c8b){return[_0x133c8b,![]];}return db[_0xd05f('0xa8')][_0xd05f('0x4d')](_0x912e2b)[_0xd05f('0x17')](function(_0x23363b){return[_0x23363b,!![]];});});}return db['ChatInteraction'][_0xd05f('0x4d')](_0x912e2b)[_0xd05f('0x17')](function(_0x2597c9){return[_0x2597c9,!![]];});}})[_0xd05f('0xac')](function(_0x2ad829,_0x57c96b){if(_0x2ad829){_0x458d5b=_0x57c96b;if(!_0x57c96b){var _0x376285={'from':(_0x2dad37[_0xd05f('0x98')]['firstName']||'')+'\x20'+(_0x2dad37[_0xd05f('0x98')][_0xd05f('0x9d')]||'')};if(_0x5c3a2b['body'][_0xd05f('0xa7')]&&_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xad')]&&_0x5c3a2b['body'][_0xd05f('0xa7')]!=_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xad')]){_0x376285[_0xd05f('0xa7')]=_0x5c3a2b['body'][_0xd05f('0xad')];}return _0x2ad829['update'](_0x376285);}else{return _0x2ad829;}}})[_0xd05f('0x17')](function(_0x187313){_0x2dad37[_0xd05f('0xab')]=_0x187313[_0xd05f('0x4f')]({'plain':!![]});_0x2dad37[_0xd05f('0xab')][_0xd05f('0xae')]=_0x458d5b;if(_0x2dad37[_0xd05f('0xab')][_0xd05f('0xae')]){if(_0x2dad37[_0xd05f('0x93')]['autoclose']){_0x2dad37[_0xd05f('0x95')][_0xd05f('0xaf')]({'id':0x0,'priority':_0x2dad37['applications'][_0xd05f('0x4a')]+0x1,'app':_0xd05f('0xb0'),'appdata':_0xd05f('0xb1'),'interval':_0xd05f('0xb2')});}}return db['ChatMessage']['create']({'body':_0x5c3a2b['body'][_0xd05f('0x55')],'ChatWebsiteId':_0x5c3a2b[_0xd05f('0x56')]['id'],'ChatInteractionId':_0x187313['id'],'direction':'in','ContactId':_0x2dad37[_0xd05f('0x98')]['id'],'AttachmentId':_0x5c3a2b[_0xd05f('0x55')][_0xd05f('0xb3')]});})[_0xd05f('0x17')](function(_0x35d6dc){_0x2dad37['message']=_0x35d6dc;if(_0x2dad37[_0xd05f('0xab')][_0xd05f('0xb4')]){return db['User'][_0xd05f('0x4c')]({'attributes':['id','name'],'where':{'id':_0x2dad37[_0xd05f('0xab')][_0xd05f('0xb4')]}})[_0xd05f('0x17')](function(_0x1731c4){if(_0x1731c4){_0x2dad37[_0xd05f('0x95')][_0xd05f('0xb5')]({'id':0x0,'priority':0x0,'app':_0xd05f('0xb6'),'appdata':_0x1731c4[_0xd05f('0x2b')]+','+(_0x2dad37[_0xd05f('0x93')][_0xd05f('0xb7')]||0xa),'interval':_0xd05f('0xb2')});_0x2dad37[_0xd05f('0xb8')]=!![];}return respondWithRpcPromise(_0xd05f('0xb9'),_0xd05f('0xba'),_0x2dad37);});}return respondWithRpcPromise(_0xd05f('0xb9'),_0xd05f('0xba'),_0x2dad37);})[_0xd05f('0x17')](function(_0x17b876){respondWithRpcPromise(_0xd05f('0xbb'),_0xd05f('0xbb'),{'event':_0xd05f('0xbc'),'message':_0x17b876},client9002);return _0x17b876;})[_0xd05f('0x17')](respondWithResult(_0x236654,null))[_0xd05f('0x48')](handleError(_0x236654,null));};exports[_0xd05f('0xbd')]=function(_0x16e866,_0x4bb8e7){var _0x37dce4,_0x21fe14,_0x262cf8;var _0x3b168b=[];var _0x4f49b6={};var _0x2f9f11=_0x16e866['files']||[];var _0x465fc2=[];var _0x40685c;return db[_0xd05f('0x7e')][_0xd05f('0x57')]()[_0xd05f('0x17')](function(_0x22aa34){if(!_0x22aa34){throw new db[(_0xd05f('0x7f'))][(_0xd05f('0x87'))](_0xd05f('0x80'));}_0x3b168b=_[_0xd05f('0x81')](_[_0xd05f('0x36')](_0x22aa34),['createdAt','updatedAt',_0xd05f('0x84'),_0xd05f('0x85')]);if(_0x16e866[_0xd05f('0x55')]['id']){delete _0x16e866['body']['id'];}if(_[_0xd05f('0x72')](_0x16e866[_0xd05f('0x55')]['from'])){throw _0x4bb8e7['status'](0x1f4)[_0xd05f('0x2c')](new db[(_0xd05f('0x7f'))][(_0xd05f('0x87'))]('from\x20is\x20mandatory'));}if(_[_0xd05f('0x72')](_0x16e866[_0xd05f('0x55')][_0xd05f('0x55')])||_0x16e866[_0xd05f('0x55')]['body']===''){throw _0x4bb8e7[_0xd05f('0x20')](0x1f4)['send'](new db[(_0xd05f('0x7f'))][(_0xd05f('0x87'))](_0xd05f('0x89')));}if(_[_0xd05f('0x72')](_0x16e866[_0xd05f('0x55')][_0xd05f('0xbe')])){throw _0x4bb8e7[_0xd05f('0x20')](0x1f4)[_0xd05f('0x2c')](new db['Sequelize'][(_0xd05f('0x87'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b168b));}if(!_[_0xd05f('0x8c')](_0x3b168b,_0x16e866[_0xd05f('0x55')][_0xd05f('0xbe')])){throw _0x4bb8e7['status'](0x1f4)[_0xd05f('0x2c')](new db[(_0xd05f('0x7f'))]['ValidationError'](_0xd05f('0xbf')+_0x3b168b));}_0x4f49b6[_0x16e866[_0xd05f('0x55')]['mapKeyOffline']]=_0x16e866[_0xd05f('0x55')][_0xd05f('0x86')];})[_0xd05f('0x17')](function(){return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x16e866[_0xd05f('0x56')]['id']},'include':[{'model':db[_0xd05f('0x8e')],'as':_0xd05f('0x8f')},{'model':db[_0xd05f('0xc0')],'as':_0xd05f('0xc0')}]});})['then'](handleEntityNotFound(_0x4bb8e7,null))['then'](function(_0x50ca3a){if(_0x50ca3a&&_0x50ca3a['List']){_0x21fe14=_0x50ca3a;var _0x1db89a=_['defaults'](_0x16e866[_0xd05f('0x55')],{'firstName':_0x16e866[_0xd05f('0x55')][_0xd05f('0x86')],'phone':_0x16e866[_0xd05f('0x55')][_0xd05f('0x86')],'ListId':_0x50ca3a[_0xd05f('0x85')]});_0x1db89a[_0x16e866[_0xd05f('0x55')][_0xd05f('0xbe')]]=_0x16e866[_0xd05f('0x55')][_0xd05f('0x86')];return db['CmContact'][_0xd05f('0xc1')]({'where':_0x4f49b6,'defaults':_0x1db89a});}})['spread'](function(_0x5a2602){if(_0x5a2602){_0x262cf8=_0x5a2602;var _0x11dd62=fs[_0xd05f('0xc2')](path['join'](config[_0xd05f('0x6a')],_0xd05f('0xc3')),_0xd05f('0xc4'));var _0x3fcda6=ejs[_0xd05f('0xc5')](_0x11dd62,{'body':_['toPairs'](_0x16e866[_0xd05f('0x55')][_0xd05f('0x55')]),'bodyTitle':_0x21fe14[_0xd05f('0xc6')]});return db[_0xd05f('0xc7')][_0xd05f('0x4d')]({'body':_0x3fcda6,'plainBody':htmlToText[_0xd05f('0xc8')](_0x3fcda6),'ContactId':_0x5a2602['id'],'ChatWebsiteId':_0x21fe14['id']});}})[_0xd05f('0x17')](function(_0x1746b6){_0x40685c=_0x1746b6;if(_0x2f9f11['length']){var _0x4167d9=_0x2f9f11[_0xd05f('0x2f')](function(_0x71975a){return{'name':_0x71975a['originalname'],'basename':_0x71975a[_0xd05f('0x64')],'type':_0x71975a[_0xd05f('0xc9')],'ChatOfflineMessageId':_0x1746b6['id']};});_0x465fc2=_0x4167d9[_0xd05f('0x2f')](_0x55320=>{var _0x42bd96={'filename':_0x55320[_0xd05f('0x2b')],'path':path[_0xd05f('0x6e')](config['root'],'server',_0xd05f('0xca'),'attachments',_0xd05f('0xcb'),_0x55320['basename'])};return _0x42bd96;});if(!_0x21fe14[_0xd05f('0xcc')]){return db[_0xd05f('0xcd')][_0xd05f('0xce')](function(_0x3a2f24){return db[_0xd05f('0xcf')][_0xd05f('0xd0')](_0x4167d9,{'transaction':_0x3a2f24});});}}})[_0xd05f('0x17')](function(){if(_0x40685c){_0x37dce4=_0x40685c;return db['MailAccount'][_0xd05f('0x5f')]({'where':{'service':!![]},'include':[{'model':db[_0xd05f('0xd1')],'as':_0xd05f('0xd2'),'raw':!![],'include':[{'model':db[_0xd05f('0xd3')],'as':_0xd05f('0xd3'),'raw':!![]}]}]});}})['then'](function(_0x3e9ae6){if(_0x3e9ae6&&_0x3e9ae6[_0xd05f('0xd2')]&&_0x21fe14[_0xd05f('0xd4')]&&_0x21fe14[_0xd05f('0xd5')]){var _0x22c229=_0x3e9ae6[_0xd05f('0xd6')]();return respondWithRpcPromise(_0xd05f('0xd7'),'sendMail',{'account':_0x22c229,'message':{'from':util['format'](_0xd05f('0xd8'),_0x3e9ae6[_0xd05f('0x2b')],_0x3e9ae6[_0xd05f('0xd9')]||_0x3e9ae6[_0xd05f('0xd2')][_0xd05f('0x4e')]),'to':_0x21fe14[_0xd05f('0xd5')],'subject':_0x21fe14[_0xd05f('0xda')],'html':_0x37dce4[_0xd05f('0x55')],'attachments':_0x465fc2}},client9003)[_0xd05f('0x17')](function(){return _0x37dce4;})[_0xd05f('0x48')](function(_0x31239d){logger['error'](_0x31239d);});}})[_0xd05f('0x17')](function(){if(_0x21fe14&&_0x21fe14[_0xd05f('0xcc')]&&_0x21fe14[_0xd05f('0xdb')]){var _0x13c0bc=[];if(_0x2f9f11[_0xd05f('0x4a')]){_0x13c0bc=_0x2f9f11['map'](function(_0x12755d){return{'name':_0x12755d[_0xd05f('0xdc')],'basename':_0x12755d[_0xd05f('0x64')],'type':_0x12755d[_0xd05f('0xc9')],'ChatOfflineMessageId':_0x40685c['id']};});}var _0x849e76;if(!_['isNil'](_0x21fe14[_0xd05f('0xdd')])){var _0x276c81=_[_0xd05f('0x2f')](_0x16e866[_0xd05f('0x55')],function(_0x147ec4){return _0x147ec4;});var _0x5ae523=_[_0xd05f('0xde')](_0x276c81)[0x0];var _0x211afe=_[_0xd05f('0xdf')](_0x5ae523,function(_0x344e4c){return _0x344e4c;});_0x849e76=_0x211afe[0x1][_0x21fe14['subjectOffline']];}var _0x73beda={'from':_0x262cf8[_0xd05f('0xd9')],'firstName':_0x262cf8[_0xd05f('0x9c')],'lastName':_0x262cf8['lastName'],'mapKey':_0xd05f('0xd9'),'message':{'from':_0x262cf8['email'],'to':_0x21fe14[_0xd05f('0xc0')][_0xd05f('0xd9')],'cc':'','subject':_['isNil'](_0x849e76)?_0x21fe14[_0xd05f('0xda')]:_0x849e76,'messageId':'','sentAt':new Date(),'attach':_0x13c0bc[_0xd05f('0x4a')],'attachments':_0x13c0bc,'originChannel':_0xd05f('0xe0'),'ChatWebsiteId':_0x21fe14['id'],'ChatOfflineMessageId':_0x37dce4['id'],'originTo':_0x21fe14[_0xd05f('0xc0')]['email']},'body':_0x37dce4['body']};var _0x47bb96={'account':{'id':_0x21fe14[_0xd05f('0xdb')]},'body':_0x73beda,'log':_0xd05f('0xe1')};return respondWithRpcPromise(_0xd05f('0xe1'),_0xd05f('0xe2'),_0x47bb96,client9001)[_0xd05f('0x17')](function(){return _0x37dce4;})[_0xd05f('0x48')](function(_0x23f008){logger['error'](_0x23f008);});}return;})['then'](function(){if(_0x37dce4){return _0x37dce4;}})['then'](respondWithResult(_0x4bb8e7,null))[_0xd05f('0x48')](function(_0x41e2e2){logger[_0xd05f('0x1c')](_0xd05f('0x48'),_0x41e2e2);for(var _0x58d324 of _0x2f9f11){var _0x37c5aa=path[_0xd05f('0x6e')](config['root'],_0xd05f('0xe3'),_0xd05f('0xca'),_0xd05f('0xe4'),_0xd05f('0xcb'),_0x58d324['filename']);fs_extra[_0xd05f('0xe5')](_0x37c5aa)[_0xd05f('0x48')](function(_0xbf21b0){logger['error'](_0xd05f('0xe6'),_0x37c5aa,_0xbf21b0);});}});};exports[_0xd05f('0xe7')]=function(_0x1fea75,_0x50867e){return db['ChatInteraction'][_0xd05f('0x4c')]({'where':{'id':_0x1fea75['params']['id']}})['then'](handleEntityNotFound(_0x50867e,null))[_0xd05f('0x17')](function(_0x43c772){if(_0x43c772){return _0x43c772[_0xd05f('0xe7')](_0x1fea75[_0xd05f('0x55')][_0xd05f('0x5d')],_[_0xd05f('0xe8')](_0x1fea75[_0xd05f('0x55')],[_0xd05f('0x5d'),'id'])||{});}})[_0xd05f('0x17')](respondWithResult(_0x50867e,null))[_0xd05f('0x48')](handleError(_0x50867e,null));};exports[_0xd05f('0xe9')]=function(_0x59aba5,_0x1ff064){var _0x477be4={'raw':![],'where':{}};var _0x5d2a3d={};var _0x18b360={'count':0x0,'rows':[]};return db[_0xd05f('0x30')]['findOne']({'where':{'id':_0x59aba5['params']['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x1ff064,null))[_0xd05f('0x17')](function(_0x1d5874){if(_0x1d5874){_0x5d2a3d[_0xd05f('0x34')]=_[_0xd05f('0x36')](db[_0xd05f('0xa8')][_0xd05f('0x31')]);_0x5d2a3d[_0xd05f('0x35')]=_[_0xd05f('0x36')](_0x59aba5[_0xd05f('0x35')]);_0x5d2a3d[_0xd05f('0x37')]=_['intersection'](_0x5d2a3d[_0xd05f('0x34')],_0x5d2a3d[_0xd05f('0x35')]);_0x477be4[_0xd05f('0x39')]=_[_0xd05f('0x38')](_0x5d2a3d[_0xd05f('0x34')],qs['fields'](_0x59aba5[_0xd05f('0x35')][_0xd05f('0x3a')]));_0x477be4[_0xd05f('0x39')]=_0x477be4[_0xd05f('0x39')][_0xd05f('0x4a')]?_0x477be4[_0xd05f('0x39')]:_0x5d2a3d[_0xd05f('0x34')];if(!_0x59aba5[_0xd05f('0x35')][_0xd05f('0x5b')](_0xd05f('0x3b'))){_0x477be4['limit']=qs['limit'](_0x59aba5[_0xd05f('0x35')][_0xd05f('0x3c')]);_0x477be4[_0xd05f('0x22')]=qs[_0xd05f('0x22')](_0x59aba5[_0xd05f('0x35')][_0xd05f('0x22')]);}_0x477be4[_0xd05f('0x3d')]=qs['sort'](_0x59aba5['query'][_0xd05f('0x3e')]);_0x477be4[_0xd05f('0x41')]=qs[_0xd05f('0x37')](_[_0xd05f('0x3f')](_0x59aba5['query'],_0x5d2a3d[_0xd05f('0x37')]));_0x477be4['where']['ChatWebsiteId']=_0x1d5874['id'];if(_0x59aba5[_0xd05f('0x35')][_0xd05f('0x40')]){_0x477be4['where']=_[_0xd05f('0x43')](_0x477be4[_0xd05f('0x41')],{'$or':_[_0xd05f('0x2f')](_0x477be4[_0xd05f('0x39')],function(_0x53c889){var _0x3996e0={};_0x3996e0[_0x53c889]={'$like':'%'+_0x59aba5[_0xd05f('0x35')][_0xd05f('0x40')]+'%'};return _0x3996e0;})});}_0x477be4=_[_0xd05f('0x43')]({},_0x477be4,_0x59aba5[_0xd05f('0x44')]);return db['ChatInteraction']['count']({'where':_0x477be4['where']})[_0xd05f('0x17')](function(_0x3d74fd){_0x18b360['count']=_0x3d74fd;if(_0x59aba5[_0xd05f('0x35')]['includeAll']){_0x477be4[_0xd05f('0x45')]=[{'model':db[_0xd05f('0x7e')],'as':_0xd05f('0xea'),'required':![]},{'model':db['User'],'as':_0xd05f('0xeb'),'attributes':[_0xd05f('0x2b'),'fullname',_0xd05f('0xec')],'required':![]},{'model':db[_0xd05f('0xed')],'as':_0xd05f('0xee'),'attributes':['id',_0xd05f('0x2b'),_0xd05f('0xef')],'where':_0x59aba5[_0xd05f('0x35')][_0xd05f('0xf0')]?{'id':_0x59aba5[_0xd05f('0x35')]['tag']}:undefined,'required':_0x59aba5[_0xd05f('0x35')][_0xd05f('0xf0')]?!![]:![]}];}return db[_0xd05f('0xa8')][_0xd05f('0x46')](_0x477be4);})[_0xd05f('0x17')](function(_0x28e43f){_0x18b360[_0xd05f('0x47')]=_0x28e43f;return _0x18b360;});}})['then'](respondWithFilteredResult(_0x1ff064,_0x477be4))['catch'](handleError(_0x1ff064,null));};function iftimePromise(_0x5ef574,_0x38c35e){return respondWithRpcPromise(_0xd05f('0xf1'),'getSnippet',{'command':_0x38c35e[_0xd05f('0xf2')]?util[_0xd05f('0xa1')](_0xd05f('0xf3'),_0x5ef574[_0xd05f('0xf4')],_0x38c35e[_0xd05f('0xf2')]):util[_0xd05f('0xa1')](_0xd05f('0xf5'),_0x5ef574['interval'])},client9002)[_0xd05f('0x17')](function(_0x12b681){var _0x3ed0f3=_0x12b681&&_0x12b681['indexOf'](_0xd05f('0xf6'))>=0x0?!![]:![];logger['info'](_0xd05f('0xf7'),_0x38c35e['id'],_0x5ef574['id'],_0x5ef574[_0xd05f('0xf4')],_0x3ed0f3?_0xd05f('0xf8'):_0xd05f('0xf9'),_0x38c35e[_0xd05f('0xf2')]?_0x38c35e[_0xd05f('0xf2')]:_0xd05f('0xfa'));return _0x3ed0f3;})[_0xd05f('0x48')](function(_0x223afb){logger[_0xd05f('0x1c')](_0xd05f('0xf7'),_0x38c35e['id'],_0x5ef574['id'],_0x5ef574['interval'],util['inspect'](_0x223afb,{'showHidden':![],'depth':null}),_0x38c35e[_0xd05f('0xf2')]?_0x38c35e[_0xd05f('0xf2')]:_0xd05f('0xfa'));return![];});}exports['getSnippet']=function(_0x89a7a3,_0x5ed007){var _0x5361d5=0x0;var _0xc068f3=0x0;var _0x241211=![];var _0x1bb8b5;var _0x315cef;return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x89a7a3[_0xd05f('0x56')]['id']},'include':[{'model':db[_0xd05f('0xfb')],'as':'Interval','include':[{'model':db[_0xd05f('0xfb')],'as':_0xd05f('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xd05f('0x17')](handleEntityNotFound(_0x5ed007,null))[_0xd05f('0x17')](function(_0x252e3f){if(_0x252e3f){_0x1bb8b5=_0x252e3f;return _0x252e3f[_0xd05f('0xfd')]({'raw':!![]});}})['then'](function(_0x1d2c16){if(_0x1bb8b5){if(_0x1d2c16){_0x315cef=_0x1d2c16;}}return require(_0xd05f('0xfe'))['getLicense']();})[_0xd05f('0x17')](function(_0x317992){if(_0x317992){_0xc068f3=_0x317992[_0xd05f('0xff')];_0x241211=_0x317992[_0xd05f('0x100')];}})[_0xd05f('0x17')](function(){return db[_0xd05f('0xa8')]['count']({'where':{'closed':![]}});})[_0xd05f('0x17')](function(_0x3063d6){_0x5361d5=_0x3063d6;if(_0xc068f3&&_0x3063d6>_0xc068f3){return db[_0xd05f('0x101')][_0xd05f('0x5f')]({'where':{'id':0x1}})[_0xd05f('0x17')](function(_0x8fbb1e){if(_0x8fbb1e){_0x8fbb1e['increment'](_0xd05f('0x102'));}});}})[_0xd05f('0x17')](function(){if(_0x1bb8b5[_0xd05f('0xfb')]&&_0x1bb8b5['Interval'][_0xd05f('0xfc')]){var _0x2fa928=[];for(var _0x464662=0x0;_0x464662<_0x1bb8b5['Interval'][_0xd05f('0xfc')][_0xd05f('0x4a')];_0x464662++){var _0x42f66e=_0x1bb8b5[_0xd05f('0xfb')][_0xd05f('0xfc')][_0x464662][_0xd05f('0x4f')]({'plain':!![]});_0x2fa928['push'](iftimePromise(_0x42f66e,_0x1bb8b5));}return BPromise[_0xd05f('0x103')](_0x2fa928)[_0xd05f('0x17')](function(_0x48e8ea){return _['some'](_0x48e8ea);});}else{return!![];}})[_0xd05f('0x17')](function(_0x4b9d8e){var _0xbd9ff9=fs[_0xd05f('0xc2')](path[_0xd05f('0x6e')](config[_0xd05f('0x6a')],'server/files/chat/iframe.ejs'),_0xd05f('0xc4'));var _0x758023={'remote':_0x1bb8b5[_0xd05f('0x104')],'query':querystring[_0xd05f('0x1b')](_[_0xd05f('0x43')](_0x1bb8b5[_0xd05f('0x4f')]({'plain':!![]}),{'customerIp':_0x89a7a3[_0xd05f('0x7b')][_0xd05f('0x9b')]||_0x89a7a3[_0xd05f('0x7b')][_0xd05f('0x105')]||_0x89a7a3[_0xd05f('0x106')][_0xd05f('0x107')]||_0x89a7a3['ip'],'referer':_0x89a7a3[_0xd05f('0x7b')][_0xd05f('0x108')],'openedInteractions':_0x5361d5,'maxInteractions':_0xc068f3,'virtual':_0x241211['virtual'],'online':_0x4b9d8e,'custom':_0x241211}))[_0xd05f('0x109')](/'/g,'\x5c\x27')};_0x5ed007[_0xd05f('0x2c')](ejs[_0xd05f('0xc5')](Mustache[_0xd05f('0xc5')](_0xbd9ff9,_0x758023),{'proactiveActions':_0x315cef,'alignment':_0x1bb8b5[_0xd05f('0x10a')],'verticalAlignment':_0x1bb8b5[_0xd05f('0x10b')],'div_color':_0x1bb8b5[_0xd05f('0xef')],'labelText':_0x1bb8b5['labelText'],'text_color':_0x1bb8b5[_0xd05f('0x10c')],'text_button_color':_0x1bb8b5['textButtonColor'],'button_color':_0x1bb8b5['color_button'],'background_color':_0x1bb8b5[_0xd05f('0x10d')],'hideWhenOffline':_0x1bb8b5['hideWhenOffline'],'interval':_0x1bb8b5['IntervalId']}));})[_0xd05f('0x48')](handleError(_0x5ed007,null));};exports[_0xd05f('0x10e')]=function(_0x38ba7d,_0x5ee4aa){var _0x281636=_0x38ba7d[_0xd05f('0x56')]['id'];var _0x1e6e6d=_0x38ba7d[_0xd05f('0x55')];var _0x593db2=0xc8;var _0x5e6d2e=null;return db[_0xd05f('0xcd')][_0xd05f('0xce')]({'isolationLevel':db[_0xd05f('0xcd')]['Transaction'][_0xd05f('0x10f')]['READ_COMMITTED']},function(_0x3e07ca){return db['ChatWebsite']['findOne']({'where':{'id':_0x281636},'transaction':_0x3e07ca})[_0xd05f('0x17')](function(_0x2cb6d0){if(_0x2cb6d0){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x281636},'transaction':_0x3e07ca})['then'](function(){var _0x41bbf0=_[_0xd05f('0x2f')](_0x1e6e6d,function(_0x530b9d){_0x530b9d[_0xd05f('0x59')]=_0x281636;return _0x530b9d;});return db[_0xd05f('0x110')][_0xd05f('0xd0')](_0x41bbf0,{'transaction':_0x3e07ca});});}else{_0x593db2=0x194;_0x5e6d2e=[];}});})[_0xd05f('0x17')](function(){if(_0x593db2!==0x194){return db[_0xd05f('0x110')][_0xd05f('0x111')]({'where':{'ChatWebsiteId':_0x281636},'order':'priority'})['then'](function(_0x15c3b0){_0x5e6d2e=_0x15c3b0;});}})[_0xd05f('0x48')](function(_0x29863){_0x593db2=0x1f4;logger[_0xd05f('0x1c')](_0x29863[_0xd05f('0x112')]);if(_0x29863[_0xd05f('0x2b')]){delete _0x29863['name'];}_0x5e6d2e=_0x29863;})[_0xd05f('0x113')](function(){if(_0x5e6d2e===null){_0x5ee4aa[_0xd05f('0x2a')](_0x593db2);}else{if(_0x593db2===0x1f4){_0x5ee4aa[_0xd05f('0x20')](_0x593db2)[_0xd05f('0x2c')](_0x5e6d2e);}else{_0x5ee4aa[_0xd05f('0x20')](_0x593db2)[_0xd05f('0x26')](_0x5e6d2e);}}});};exports[_0xd05f('0x114')]=function(_0x3c4e54,_0x2306f0){var _0x1597a9={};var _0x36e793={};var _0xe65c2b;var _0x62200f;return db[_0xd05f('0x30')][_0xd05f('0x5f')]({'where':{'id':_0x3c4e54[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x2306f0,null))[_0xd05f('0x17')](function(_0x19ded4){if(_0x19ded4){_0xe65c2b=_0x19ded4;_0x36e793['model']=_[_0xd05f('0x36')](db[_0xd05f('0x110')][_0xd05f('0x31')]);_0x36e793[_0xd05f('0x35')]=_[_0xd05f('0x36')](_0x3c4e54[_0xd05f('0x35')]);_0x36e793[_0xd05f('0x37')]=_[_0xd05f('0x38')](_0x36e793[_0xd05f('0x34')],_0x36e793[_0xd05f('0x35')]);_0x1597a9['attributes']=_[_0xd05f('0x38')](_0x36e793[_0xd05f('0x34')],qs[_0xd05f('0x3a')](_0x3c4e54[_0xd05f('0x35')]['fields']));_0x1597a9[_0xd05f('0x39')]=_0x1597a9[_0xd05f('0x39')][_0xd05f('0x4a')]?_0x1597a9[_0xd05f('0x39')]:_0x36e793[_0xd05f('0x34')];_0x1597a9['order']=qs[_0xd05f('0x3e')](_0x3c4e54['query'][_0xd05f('0x3e')]);_0x1597a9['where']=qs[_0xd05f('0x37')](_['pick'](_0x3c4e54['query'],_0x36e793[_0xd05f('0x37')]));if(_0x3c4e54[_0xd05f('0x35')]['filter']){_0x1597a9[_0xd05f('0x41')]=_[_0xd05f('0x43')](_0x1597a9[_0xd05f('0x41')],{'$or':_['map'](_0x1597a9[_0xd05f('0x39')],function(_0x1b91a3){var _0x54e517={};_0x54e517[_0x1b91a3]={'$like':'%'+_0x3c4e54[_0xd05f('0x35')][_0xd05f('0x40')]+'%'};return _0x54e517;})});}_0x1597a9=_[_0xd05f('0x43')]({},_0x1597a9,_0x3c4e54[_0xd05f('0x44')]);return _0xe65c2b[_0xd05f('0x114')](_0x1597a9);}})[_0xd05f('0x17')](function(_0x4e42bb){if(_0x4e42bb){_0x62200f=_0x4e42bb[_0xd05f('0x4a')];if(!_0x3c4e54[_0xd05f('0x35')]['hasOwnProperty']('nolimit')){_0x1597a9[_0xd05f('0x3c')]=qs['limit'](_0x3c4e54[_0xd05f('0x35')][_0xd05f('0x3c')]);_0x1597a9['offset']=qs[_0xd05f('0x22')](_0x3c4e54[_0xd05f('0x35')]['offset']);}return _0xe65c2b[_0xd05f('0x114')](_0x1597a9);}})['then'](function(_0x42e0d1){if(_0x42e0d1){return _0x42e0d1?{'count':_0x62200f,'rows':_0x42e0d1}:null;}})[_0xd05f('0x17')](respondWithResult(_0x2306f0,null))[_0xd05f('0x48')](handleError(_0x2306f0,null));};exports['addProactiveActions']=function(_0x2262a4,_0x1cf04f){return db[_0xd05f('0x115')]['find']({'where':{'id':_0x2262a4['params']['id']}})['then'](handleEntityNotFound(_0x1cf04f,null))[_0xd05f('0x17')](function(_0x379aba){if(_0x379aba){return _0x379aba['addProactiveActions'](_0x2262a4[_0xd05f('0x55')][_0xd05f('0x5d')],_[_0xd05f('0xe8')](_0x2262a4[_0xd05f('0x55')],[_0xd05f('0x5d'),'id'])||{});}})[_0xd05f('0x17')](respondWithResult(_0x1cf04f,null))[_0xd05f('0x48')](handleError(_0x1cf04f,null));};exports['getProactiveActions']=function(_0x10a651,_0x470eee){var _0x2fc82c={};var _0x28c2e7={};var _0x3cd4ed;var _0x3f9bb4;return db[_0xd05f('0x30')][_0xd05f('0x5f')]({'where':{'id':_0x10a651['params']['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x470eee,null))['then'](function(_0x2f2ed6){if(_0x2f2ed6){_0x3cd4ed=_0x2f2ed6;_0x28c2e7[_0xd05f('0x34')]=_['keys'](db[_0xd05f('0x116')]['rawAttributes']);_0x28c2e7[_0xd05f('0x35')]=_['keys'](_0x10a651[_0xd05f('0x35')]);_0x28c2e7[_0xd05f('0x37')]=_[_0xd05f('0x38')](_0x28c2e7['model'],_0x28c2e7[_0xd05f('0x35')]);_0x2fc82c[_0xd05f('0x39')]=_['intersection'](_0x28c2e7[_0xd05f('0x34')],qs[_0xd05f('0x3a')](_0x10a651[_0xd05f('0x35')]['fields']));_0x2fc82c[_0xd05f('0x39')]=_0x2fc82c[_0xd05f('0x39')]['length']?_0x2fc82c[_0xd05f('0x39')]:_0x28c2e7['model'];_0x2fc82c[_0xd05f('0x3d')]=qs[_0xd05f('0x3e')](_0x10a651[_0xd05f('0x35')]['sort']);_0x2fc82c['where']=qs[_0xd05f('0x37')](_['pick'](_0x10a651['query'],_0x28c2e7['filters']));if(_0x10a651[_0xd05f('0x35')]['filter']){_0x2fc82c[_0xd05f('0x41')]=_[_0xd05f('0x43')](_0x2fc82c[_0xd05f('0x41')],{'$or':_['map'](_0x2fc82c['attributes'],function(_0x239d27){var _0x42861b={};_0x42861b[_0x239d27]={'$like':'%'+_0x10a651[_0xd05f('0x35')]['filter']+'%'};return _0x42861b;})});}_0x2fc82c=_['merge']({},_0x2fc82c,_0x10a651[_0xd05f('0x44')]);return _0x3cd4ed[_0xd05f('0xfd')](_0x2fc82c);}})[_0xd05f('0x17')](function(_0x38bc17){if(_0x38bc17){_0x3f9bb4=_0x38bc17[_0xd05f('0x4a')];if(!_0x10a651[_0xd05f('0x35')][_0xd05f('0x5b')](_0xd05f('0x3b'))){_0x2fc82c[_0xd05f('0x3c')]=qs[_0xd05f('0x3c')](_0x10a651[_0xd05f('0x35')][_0xd05f('0x3c')]);_0x2fc82c['offset']=qs[_0xd05f('0x22')](_0x10a651[_0xd05f('0x35')][_0xd05f('0x22')]);}return _0x3cd4ed[_0xd05f('0xfd')](_0x2fc82c);}})[_0xd05f('0x17')](function(_0x91942a){if(_0x91942a){return _0x91942a?{'count':_0x3f9bb4,'rows':_0x91942a}:null;}})['then'](respondWithResult(_0x470eee,null))[_0xd05f('0x48')](handleError(_0x470eee,null));};exports[_0xd05f('0x117')]=function(_0x42a106,_0x300087){var _0x462fdb=_0x42a106[_0xd05f('0x35')]['online']==='false'?_0xd05f('0x118'):'onlineForm';return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'attributes':['id',_0x462fdb],'where':{'id':_0x42a106[_0xd05f('0x56')]['id']}})['then'](handleEntityNotFound(_0x300087,null))['then'](function(_0x298a29){if(_0x298a29){var _0x497c57=_0x298a29[_0x462fdb];var _0x594c7d=_0x497c57&&_0x497c57['items']?_0x497c57[_0xd05f('0x119')]:[];_0x300087[_0xd05f('0x2c')]({'fromKey':_[_0xd05f('0x72')](_0x497c57[_0xd05f('0x11a')])?undefined:_0x497c57[_0xd05f('0x11a')],'count':_0x594c7d['length'],'rows':_0x594c7d});}})[_0xd05f('0x48')](handleError(_0x300087,null));};exports[_0xd05f('0x11b')]=function(_0xb5be94,_0x5ba4db){var _0x29bf43={'raw':![],'where':{}};var _0x3a465d={};var _0x2120d1={'count':0x0,'rows':[]};return db[_0xd05f('0x30')]['findOne']({'where':{'id':_0xb5be94[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x5ba4db,null))[_0xd05f('0x17')](function(_0x36eb8b){if(_0x36eb8b){_0x3a465d[_0xd05f('0x34')]=_[_0xd05f('0x36')](db['ChatOfflineMessage'][_0xd05f('0x31')]);_0x3a465d[_0xd05f('0x35')]=_[_0xd05f('0x36')](_0xb5be94[_0xd05f('0x35')]);_0x3a465d[_0xd05f('0x37')]=_[_0xd05f('0x38')](_0x3a465d['model'],_0x3a465d[_0xd05f('0x35')]);_0x29bf43[_0xd05f('0x39')]=_[_0xd05f('0x38')](_0x3a465d['model'],qs[_0xd05f('0x3a')](_0xb5be94[_0xd05f('0x35')][_0xd05f('0x3a')]));_0x29bf43['attributes']=_0x29bf43['attributes'][_0xd05f('0x4a')]?_0x29bf43[_0xd05f('0x39')]:_0x3a465d[_0xd05f('0x34')];if(!_0xb5be94[_0xd05f('0x35')][_0xd05f('0x5b')](_0xd05f('0x3b'))){_0x29bf43[_0xd05f('0x3c')]=qs['limit'](_0xb5be94[_0xd05f('0x35')]['limit']);_0x29bf43['offset']=qs[_0xd05f('0x22')](_0xb5be94['query'][_0xd05f('0x22')]);}_0x29bf43[_0xd05f('0x3d')]=qs[_0xd05f('0x3e')](_0xb5be94['query']['sort']);_0x29bf43[_0xd05f('0x41')]=qs[_0xd05f('0x37')](_[_0xd05f('0x3f')](_0xb5be94[_0xd05f('0x35')],_0x3a465d[_0xd05f('0x37')]));_0x29bf43[_0xd05f('0x41')][_0xd05f('0x59')]=_0x36eb8b['id'];if(_0xb5be94[_0xd05f('0x35')]['filter']){_0x29bf43[_0xd05f('0x41')]=_[_0xd05f('0x43')](_0x29bf43[_0xd05f('0x41')],{'$or':_[_0xd05f('0x2f')](_0x29bf43[_0xd05f('0x39')],function(_0xaa2b9b){var _0xb99766={};_0xb99766[_0xaa2b9b]={'$like':'%'+_0xb5be94['query']['filter']+'%'};return _0xb99766;})});}_0x29bf43=_[_0xd05f('0x43')]({},_0x29bf43,_0xb5be94[_0xd05f('0x44')]);return db[_0xd05f('0xc7')][_0xd05f('0x24')]({'where':_0x29bf43['where']})[_0xd05f('0x17')](function(_0x43a0cc){_0x2120d1['count']=_0x43a0cc;if(_0xb5be94[_0xd05f('0x35')][_0xd05f('0x4b')]){_0x29bf43[_0xd05f('0x45')]=[{'all':!![]}];}else{_0x29bf43[_0xd05f('0x45')]=[{'model':db[_0xd05f('0x7e')],'as':_0xd05f('0xea'),'required':![]},{'model':db[_0xd05f('0xcf')],'as':_0xd05f('0x11c'),'required':![]}];}return db[_0xd05f('0xc7')][_0xd05f('0x46')](_0x29bf43);})['then'](function(_0x479d7f){_0x2120d1[_0xd05f('0x47')]=_0x479d7f;return _0x2120d1;});}})[_0xd05f('0x17')](respondWithFilteredResult(_0x5ba4db,_0x29bf43))[_0xd05f('0x48')](handleError(_0x5ba4db,null));};exports['addAgents']=function(_0x1f4ea0,_0x470be9){return db[_0xd05f('0x30')][_0xd05f('0x4c')]({'where':{'id':_0x1f4ea0[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x470be9,null))['then'](function(_0x5183d4){if(_0x5183d4){return _0x5183d4[_0xd05f('0x11d')](_0x1f4ea0[_0xd05f('0x55')][_0xd05f('0x5d')],_['omit'](_0x1f4ea0[_0xd05f('0x55')],['ids','id'])||{})['spread'](function(_0x5cd7bc){for(var _0xe96198=0x0;_0xe96198<_0x1f4ea0[_0xd05f('0x55')]['ids'][_0xd05f('0x4a')];_0xe96198+=0x1){socket[_0xd05f('0x11e')](_0xd05f('0x11f'),{'UserId':Number(_0x1f4ea0['body'][_0xd05f('0x5d')][_0xe96198]),'ChatWebsiteId':Number(_0x1f4ea0[_0xd05f('0x56')]['id'])});}return _0x5cd7bc;});}})[_0xd05f('0x17')](respondWithResult(_0x470be9,null))['catch'](handleError(_0x470be9,null));};exports['removeAgents']=function(_0x2e3f72,_0xf015a4){return db['ChatWebsite'][_0xd05f('0x4c')]({'where':{'id':_0x2e3f72['params']['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0xf015a4,null))[_0xd05f('0x17')](function(_0x245558){if(_0x245558){return _0x245558[_0xd05f('0x120')](_0x2e3f72[_0xd05f('0x35')][_0xd05f('0x5d')])[_0xd05f('0x17')](function(){if(_[_0xd05f('0x121')](_0x2e3f72[_0xd05f('0x35')]['ids'])){for(var _0x1d515a=0x0;_0x1d515a<_0x2e3f72[_0xd05f('0x35')]['ids'][_0xd05f('0x4a')];_0x1d515a+=0x1){socket['emit'](_0xd05f('0x122'),{'UserId':Number(_0x2e3f72['query'][_0xd05f('0x5d')][_0x1d515a]),'ChatWebsiteId':Number(_0x2e3f72[_0xd05f('0x56')]['id'])});}}else{socket[_0xd05f('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x2e3f72['query'][_0xd05f('0x5d')]),'ChatWebsiteId':Number(_0x2e3f72[_0xd05f('0x56')]['id'])});}});}})[_0xd05f('0x17')](respondWithStatusCode(_0xf015a4,null))[_0xd05f('0x48')](handleError(_0xf015a4,null));};exports[_0xd05f('0x123')]=function(_0xd79c25,_0x5a251c){var _0x1560e2={};var _0x51849b={};var _0x10eb5a;var _0x137453;return db['ChatWebsite'][_0xd05f('0x5f')]({'where':{'id':_0xd79c25[_0xd05f('0x56')]['id']}})[_0xd05f('0x17')](handleEntityNotFound(_0x5a251c,null))['then'](function(_0x4de315){if(_0x4de315){_0x10eb5a=_0x4de315;_0x51849b[_0xd05f('0x34')]=_[_0xd05f('0x36')](db[_0xd05f('0x124')][_0xd05f('0x31')]);_0x51849b['query']=_[_0xd05f('0x36')](_0xd79c25[_0xd05f('0x35')]);_0x51849b['filters']=_[_0xd05f('0x38')](_0x51849b['model'],_0x51849b[_0xd05f('0x35')]);_0x1560e2[_0xd05f('0x39')]=_[_0xd05f('0x38')](_0x51849b[_0xd05f('0x34')],qs['fields'](_0xd79c25[_0xd05f('0x35')][_0xd05f('0x3a')]));_0x1560e2[_0xd05f('0x39')]=_0x1560e2[_0xd05f('0x39')][_0xd05f('0x4a')]?_0x1560e2[_0xd05f('0x39')]:_0x51849b[_0xd05f('0x34')];_0x1560e2[_0xd05f('0x3d')]=qs[_0xd05f('0x3e')](_0xd79c25[_0xd05f('0x35')][_0xd05f('0x3e')]);_0x1560e2['where']=qs['filters'](_[_0xd05f('0x3f')](_0xd79c25[_0xd05f('0x35')],_0x51849b[_0xd05f('0x37')]));if(_0xd79c25[_0xd05f('0x35')][_0xd05f('0x40')]){_0x1560e2[_0xd05f('0x41')]=_[_0xd05f('0x43')](_0x1560e2[_0xd05f('0x41')],{'$or':_['map'](_0x1560e2[_0xd05f('0x39')],function(_0xaa1149){var _0x3f2c6a={};_0x3f2c6a[_0xaa1149]={'$like':'%'+_0xd79c25[_0xd05f('0x35')]['filter']+'%'};return _0x3f2c6a;})});}_0x1560e2=_[_0xd05f('0x43')]({},_0x1560e2,_0xd79c25['options']);return _0x10eb5a[_0xd05f('0x123')](_0x1560e2);}})[_0xd05f('0x17')](function(_0x531611){if(_0x531611){_0x137453=_0x531611['length'];if(!_0xd79c25[_0xd05f('0x35')][_0xd05f('0x5b')](_0xd05f('0x3b'))){_0x1560e2[_0xd05f('0x3c')]=qs[_0xd05f('0x3c')](_0xd79c25['query'][_0xd05f('0x3c')]);_0x1560e2[_0xd05f('0x22')]=qs[_0xd05f('0x22')](_0xd79c25[_0xd05f('0x35')][_0xd05f('0x22')]);}return _0x10eb5a['getAgents'](_0x1560e2);}})[_0xd05f('0x17')](function(_0x51a585){if(_0x51a585){return _0x51a585?{'count':_0x137453,'rows':_0x51a585}:null;}})[_0xd05f('0x17')](respondWithResult(_0x5a251c,null))[_0xd05f('0x48')](handleError(_0x5a251c,null));}; \ No newline at end of file +var _0x7a82=['priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','forcedOwnership','startRouting','Start','EventManager','offline','files','CompanyId','from\x20is\x20mandatory','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','attachments','addInteraction','ids','getInteractions','Contact','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','omit','userChatWebsite:save','isArray','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','include','rows','removeDispositions','CannedAnswer','getAnswers','order','removeAnswers','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list'];(function(_0x31bf14,_0x2c3fd3){var _0x9e9c5c=function(_0x2c8ccb){while(--_0x2c8ccb){_0x31bf14['push'](_0x31bf14['shift']());}};_0x9e9c5c(++_0x2c3fd3);}(_0x7a82,0x1aa));var _0x27a8=function(_0x13a11e,_0x472c7b){_0x13a11e=_0x13a11e-0x0;var _0x34e24=_0x7a82[_0x13a11e];return _0x34e24;};'use strict';var BPromise=require(_0x27a8('0x0'));var Mustache=require(_0x27a8('0x1'));var util=require(_0x27a8('0x2'));var path=require(_0x27a8('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x27a8('0x4'));var Redis=require(_0x27a8('0x5'));var qs=require(_0x27a8('0x6'));var logger=require(_0x27a8('0x7'))(_0x27a8('0x8'));var config=require(_0x27a8('0x9'));var db=require(_0x27a8('0xa'))['db'];config['redis']=_[_0x27a8('0xb')](config[_0x27a8('0xc')],{'host':_0x27a8('0xd'),'port':0x18eb});var socket=require(_0x27a8('0xe'))(new Redis(config[_0x27a8('0xc')]));require(_0x27a8('0xf'))[_0x27a8('0x10')](socket);var htmlToText=require(_0x27a8('0x11'));var jayson=require(_0x27a8('0x12'));var client=jayson['client'][_0x27a8('0x13')]({'port':0x232c});var client9002=jayson[_0x27a8('0x14')][_0x27a8('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x27a8('0x13')]({'port':0x232b});var client9001=jayson[_0x27a8('0x14')][_0x27a8('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x332399,_0x16005b,_0x360bd7,_0x36c180){return new BPromise(function(_0xf04bae,_0x509522){var _0x18439a=_0x36c180||client;return _0x18439a['request'](_0x332399,_0x360bd7)[_0x27a8('0x15')](function(_0x448357){logger[_0x27a8('0x16')](_0x27a8('0x17'),_0x16005b,'request\x20sent');logger[_0x27a8('0x18')](_0x27a8('0x19'),_0x16005b,_0x27a8('0x1a'),JSON[_0x27a8('0x1b')](_0x448357));if(_0x448357[_0x27a8('0x1c')]){if(_0x448357[_0x27a8('0x1c')]['code']===0x1f4){logger['error'](_0x27a8('0x17'),_0x16005b,_0x448357[_0x27a8('0x1c')][_0x27a8('0x1d')]);return _0x509522(_0x448357[_0x27a8('0x1c')]['message']);}logger[_0x27a8('0x1c')](_0x27a8('0x17'),_0x16005b,_0x448357[_0x27a8('0x1c')][_0x27a8('0x1d')]);return _0xf04bae(_0x448357[_0x27a8('0x1c')]['message']);}else{logger[_0x27a8('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x16005b,_0x27a8('0x1a'));_0xf04bae(_0x448357['result'][_0x27a8('0x1d')]);}})[_0x27a8('0x1e')](function(_0x233f85){logger[_0x27a8('0x1c')](_0x27a8('0x17'),_0x16005b,_0x233f85);_0x509522(_0x233f85);});});}function respondWithStatusCode(_0x5b0bf4,_0x32fee7){_0x32fee7=_0x32fee7||0xcc;return function(_0x5760d2){if(_0x5760d2){return _0x5b0bf4[_0x27a8('0x1f')](_0x32fee7);}return _0x5b0bf4[_0x27a8('0x20')](_0x32fee7)[_0x27a8('0x21')]();};}function respondWithResult(_0x1e4e98,_0x8ea839){_0x8ea839=_0x8ea839||0xc8;return function(_0x15fbf1){if(_0x15fbf1){return _0x1e4e98[_0x27a8('0x20')](_0x8ea839)[_0x27a8('0x22')](_0x15fbf1);}};}function respondWithFilteredResult(_0x89a919,_0x36074f){return function(_0x29f49b){if(_0x29f49b){var _0x3f4bf7=typeof _0x36074f[_0x27a8('0x23')]===_0x27a8('0x24')&&typeof _0x36074f[_0x27a8('0x25')]===_0x27a8('0x24');var _0x407eaf=_0x29f49b[_0x27a8('0x26')];var _0x465c7e=_0x3f4bf7?0x0:_0x36074f[_0x27a8('0x23')];var _0x37ae32=_0x3f4bf7?_0x29f49b[_0x27a8('0x26')]:_0x36074f['offset']+_0x36074f[_0x27a8('0x25')];var _0x25af59;if(_0x37ae32>=_0x407eaf){_0x37ae32=_0x407eaf;_0x25af59=0xc8;}else{_0x25af59=0xce;}_0x89a919[_0x27a8('0x20')](_0x25af59);return _0x89a919[_0x27a8('0x27')](_0x27a8('0x28'),_0x465c7e+'-'+_0x37ae32+'/'+_0x407eaf)[_0x27a8('0x22')](_0x29f49b);}return null;};}function saveUpdates(_0x5107a5){return function(_0x1911d4){if(_0x1911d4){return _0x1911d4['update'](_0x5107a5)[_0x27a8('0x15')](function(_0xb9962b){return _0xb9962b;});}return null;};}function removeEntity(_0x528863){return function(_0x55beaf){if(_0x55beaf){return _0x55beaf[_0x27a8('0x29')]()[_0x27a8('0x15')](function(){var _0x2573c5=_0x55beaf[_0x27a8('0x2a')]({'plain':!![]});var _0x4f2de4=_0x27a8('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x4f2de4,'resourceId':_0x2573c5['id']}})['then'](function(){return _0x55beaf;});})['then'](function(){_0x528863['status'](0xcc)[_0x27a8('0x21')]();});}};}function handleEntityNotFound(_0x3f1580){return function(_0x43d24f){if(!_0x43d24f){_0x3f1580[_0x27a8('0x1f')](0x194);}return _0x43d24f;};}function handleError(_0x38469b,_0x2f7032){_0x2f7032=_0x2f7032||0x1f4;return function(_0x5281e1){logger['error'](_0x5281e1[_0x27a8('0x2c')]);if(_0x5281e1[_0x27a8('0x2d')]){delete _0x5281e1[_0x27a8('0x2d')];}_0x38469b[_0x27a8('0x20')](_0x2f7032)[_0x27a8('0x2e')](_0x5281e1);};}exports[_0x27a8('0x2f')]=function(_0x4599cd,_0x406272){var _0x20c0a7={'include':[{'model':db['Pause'],'as':_0x27a8('0x30')}]},_0x3a3d95={},_0x2d9fc0={'count':0x0,'rows':[]};var _0x512600=_[_0x27a8('0x31')](db[_0x27a8('0x32')][_0x27a8('0x33')],function(_0x3e3a73){return{'name':_0x3e3a73[_0x27a8('0x34')],'type':_0x3e3a73[_0x27a8('0x35')][_0x27a8('0x36')]};});_0x3a3d95[_0x27a8('0x37')]=_[_0x27a8('0x31')](_0x512600,'name');_0x3a3d95[_0x27a8('0x38')]=_['keys'](_0x4599cd['query']);_0x3a3d95[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x3a3d95['model'],_0x3a3d95['query']);_0x20c0a7[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x3a3d95['model'],qs[_0x27a8('0x3c')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x20c0a7[_0x27a8('0x3b')]=_0x20c0a7[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x20c0a7[_0x27a8('0x3b')]:_0x3a3d95[_0x27a8('0x37')];if(!_0x4599cd['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x20c0a7[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x4599cd[_0x27a8('0x38')]['limit']);_0x20c0a7[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x20c0a7['order']=qs[_0x27a8('0x40')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x40')]);_0x20c0a7['where']=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x4599cd[_0x27a8('0x38')],_0x3a3d95[_0x27a8('0x39')]),_0x512600);if(_0x4599cd['query'][_0x27a8('0x42')]){_0x20c0a7[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x20c0a7[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x512600,function(_0x4a7eb7){if(_0x4a7eb7['type']!==_0x27a8('0x45')){var _0x328fd4={};_0x328fd4[_0x4a7eb7[_0x27a8('0x2d')]]={'$like':'%'+_0x4599cd['query'][_0x27a8('0x42')]+'%'};return _0x328fd4;}})});}_0x20c0a7=_[_0x27a8('0x44')]({},_0x20c0a7,_0x4599cd[_0x27a8('0x46')]);var _0x9082a4={'where':_0x20c0a7[_0x27a8('0x43')]};return db[_0x27a8('0x32')][_0x27a8('0x26')](_0x9082a4)['then'](function(_0x3704b4){_0x2d9fc0[_0x27a8('0x26')]=_0x3704b4;if(_0x4599cd[_0x27a8('0x38')][_0x27a8('0x47')]){_0x20c0a7['include']=[{'all':!![]}];}return db[_0x27a8('0x32')][_0x27a8('0x48')](_0x20c0a7);})['then'](function(_0x2e0088){_0x2d9fc0['rows']=_0x2e0088;return _0x2d9fc0;})[_0x27a8('0x15')](respondWithFilteredResult(_0x406272,_0x20c0a7))[_0x27a8('0x1e')](handleError(_0x406272,null));};exports[_0x27a8('0x49')]=function(_0x37d886,_0x1cfb24){var _0x15f9ea={'raw':![],'where':{'id':_0x37d886[_0x27a8('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x27a8('0x30')}]},_0x3f54c3={};_0x3f54c3[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db[_0x27a8('0x32')]['rawAttributes']);_0x3f54c3[_0x27a8('0x38')]=_['keys'](_0x37d886['query']);_0x3f54c3[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x3f54c3[_0x27a8('0x37')],_0x3f54c3['query']);_0x15f9ea['attributes']=_[_0x27a8('0x3a')](_0x3f54c3[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x37d886[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x15f9ea[_0x27a8('0x3b')]=_0x15f9ea[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x15f9ea[_0x27a8('0x3b')]:_0x3f54c3[_0x27a8('0x37')];if(_0x37d886['query'][_0x27a8('0x47')]){_0x15f9ea['include']=[{'all':!![]}];}_0x15f9ea=_[_0x27a8('0x44')]({},_0x15f9ea,_0x37d886[_0x27a8('0x46')]);return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x15f9ea)[_0x27a8('0x15')](handleEntityNotFound(_0x1cfb24,null))[_0x27a8('0x15')](respondWithResult(_0x1cfb24,null))['catch'](handleError(_0x1cfb24,null));};exports[_0x27a8('0x4d')]=function(_0xbba4dc,_0x1f1df7){return db[_0x27a8('0x32')][_0x27a8('0x4d')](_0xbba4dc[_0x27a8('0x4e')],{})[_0x27a8('0x15')](function(_0x1ad217){var _0x273823=_0xbba4dc[_0x27a8('0x4f')]['get']({'plain':!![]});if(!_0x273823)throw new Error(_0x27a8('0x50'));if(_0x273823[_0x27a8('0x51')]===_0x27a8('0x4f')){var _0x45d039=_0x1ad217[_0x27a8('0x2a')]({'plain':!![]});var _0x594c63=_0x27a8('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x594c63,'userProfileId':_0x273823[_0x27a8('0x52')]},'raw':!![]})[_0x27a8('0x15')](function(_0x114725){if(_0x114725&&_0x114725[_0x27a8('0x53')]===0x0){return db[_0x27a8('0x54')]['create']({'name':_0x45d039['name'],'resourceId':_0x45d039['id'],'type':_0x114725[_0x27a8('0x2d')],'sectionId':_0x114725['id']},{})[_0x27a8('0x15')](function(){return _0x1ad217;});}else{return _0x1ad217;}})[_0x27a8('0x1e')](function(_0xfe4ea7){logger['error'](_0x27a8('0x55'),_0xfe4ea7);throw _0xfe4ea7;});}return _0x1ad217;})[_0x27a8('0x15')](respondWithResult(_0x1f1df7,0xc9))['catch'](handleError(_0x1f1df7,null));};exports[_0x27a8('0x56')]=function(_0x4223f9,_0x3b855f){if(_0x4223f9[_0x27a8('0x4e')]['id']){delete _0x4223f9[_0x27a8('0x4e')]['id'];}return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x4223f9['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x27a8('0x15')](handleEntityNotFound(_0x3b855f,null))[_0x27a8('0x15')](saveUpdates(_0x4223f9[_0x27a8('0x4e')],null))[_0x27a8('0x15')](respondWithResult(_0x3b855f,null))[_0x27a8('0x1e')](handleError(_0x3b855f,null));};exports['destroy']=function(_0x51411a,_0x271648){return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x51411a['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x271648,null))[_0x27a8('0x15')](removeEntity(_0x271648,null))[_0x27a8('0x1e')](handleError(_0x271648,null));};exports['describe']=function(_0x55cfda,_0x2574a7){return db['ChatWebsite']['describe']()[_0x27a8('0x15')](respondWithResult(_0x2574a7,null))['catch'](handleError(_0x2574a7,null));};exports[_0x27a8('0x57')]=function(_0x5212ca,_0x2aaa29){if(_0x5212ca[_0x27a8('0x4e')]['id']){delete _0x5212ca[_0x27a8('0x4e')]['id'];}return db[_0x27a8('0x32')]['find']({'where':{'id':_0x5212ca[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2aaa29,null))[_0x27a8('0x15')](function(_0x36b449){if(_0x36b449){_0x5212ca['body'][_0x27a8('0x58')]=_0x36b449['id'];return db[_0x27a8('0x59')][_0x27a8('0x4d')](_0x5212ca[_0x27a8('0x4e')]);}})[_0x27a8('0x15')](respondWithResult(_0x2aaa29,null))[_0x27a8('0x1e')](handleError(_0x2aaa29,null));};exports[_0x27a8('0x5a')]=function(_0x3fa588,_0x4a8dc4){var _0x5ab9bc={'raw':![],'where':{}};var _0x5492f5={};var _0x500a7e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x27a8('0x5b')]({'where':{'id':_0x3fa588[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x4a8dc4,null))[_0x27a8('0x15')](function(_0x36c339){if(_0x36c339){_0x5492f5['model']=_['keys'](db['Disposition'][_0x27a8('0x33')]);_0x5492f5[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x3fa588[_0x27a8('0x38')]);_0x5492f5['filters']=_[_0x27a8('0x3a')](_0x5492f5['model'],_0x5492f5[_0x27a8('0x38')]);_0x5ab9bc['attributes']=_[_0x27a8('0x3a')](_0x5492f5[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x3fa588[_0x27a8('0x38')]['fields']));_0x5ab9bc[_0x27a8('0x3b')]=_0x5ab9bc['attributes'][_0x27a8('0x3d')]?_0x5ab9bc[_0x27a8('0x3b')]:_0x5492f5[_0x27a8('0x37')];if(!_0x3fa588['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x5ab9bc[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x3fa588[_0x27a8('0x38')]['limit']);_0x5ab9bc[_0x27a8('0x23')]=qs['offset'](_0x3fa588[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x5ab9bc['order']=qs[_0x27a8('0x40')](_0x3fa588[_0x27a8('0x38')][_0x27a8('0x40')]);_0x5ab9bc[_0x27a8('0x43')]=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x3fa588[_0x27a8('0x38')],_0x5492f5['filters']));_0x5ab9bc['where'][_0x27a8('0x58')]=_0x36c339['id'];if(_0x3fa588['query'][_0x27a8('0x42')]){_0x5ab9bc[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x5ab9bc['where'],{'$or':_[_0x27a8('0x31')](_0x5ab9bc[_0x27a8('0x3b')],function(_0x328b23){var _0x838e53={};_0x838e53[_0x328b23]={'$like':'%'+_0x3fa588['query'][_0x27a8('0x42')]+'%'};return _0x838e53;})});}_0x5ab9bc=_[_0x27a8('0x44')]({},_0x5ab9bc,_0x3fa588[_0x27a8('0x46')]);return db[_0x27a8('0x59')][_0x27a8('0x26')]({'where':_0x5ab9bc['where']})[_0x27a8('0x15')](function(_0x1cb673){_0x500a7e[_0x27a8('0x26')]=_0x1cb673;if(_0x3fa588[_0x27a8('0x38')][_0x27a8('0x47')]){_0x5ab9bc[_0x27a8('0x5c')]=[{'all':!![]}];}return db[_0x27a8('0x59')]['findAll'](_0x5ab9bc);})['then'](function(_0x1e2940){_0x500a7e[_0x27a8('0x5d')]=_0x1e2940;return _0x500a7e;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0x4a8dc4,_0x5ab9bc))[_0x27a8('0x1e')](handleError(_0x4a8dc4,null));};exports[_0x27a8('0x5e')]=function(_0x32c81a,_0x3b5901){return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x32c81a['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x3b5901,null))[_0x27a8('0x15')](function(_0x9dbf72){if(_0x9dbf72){return _0x9dbf72[_0x27a8('0x5e')](_0x32c81a['query']['ids']);}})[_0x27a8('0x15')](respondWithStatusCode(_0x3b5901,null))[_0x27a8('0x1e')](handleError(_0x3b5901,null));};exports['addAnswer']=function(_0x15331b,_0x10921a){if(_0x15331b[_0x27a8('0x4e')]['id']){delete _0x15331b[_0x27a8('0x4e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x15331b[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10921a,null))[_0x27a8('0x15')](function(_0xcdf3b2){if(_0xcdf3b2){_0x15331b[_0x27a8('0x4e')][_0x27a8('0x58')]=_0xcdf3b2['id'];return db[_0x27a8('0x5f')][_0x27a8('0x4d')](_0x15331b[_0x27a8('0x4e')]);}})['then'](respondWithResult(_0x10921a,null))[_0x27a8('0x1e')](handleError(_0x10921a,null));};exports[_0x27a8('0x60')]=function(_0x3c3065,_0xff14db){var _0x39b3b9={'raw':![],'where':{}};var _0x18ecb5={};var _0x2a9ae1={'count':0x0,'rows':[]};return db[_0x27a8('0x32')]['findOne']({'where':{'id':_0x3c3065[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0xff14db,null))[_0x27a8('0x15')](function(_0xeb1d8){if(_0xeb1d8){_0x18ecb5['model']=_[_0x27a8('0x4b')](db[_0x27a8('0x5f')][_0x27a8('0x33')]);_0x18ecb5[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x3c3065[_0x27a8('0x38')]);_0x18ecb5[_0x27a8('0x39')]=_['intersection'](_0x18ecb5[_0x27a8('0x37')],_0x18ecb5['query']);_0x39b3b9[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x18ecb5[_0x27a8('0x37')],qs['fields'](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x39b3b9['attributes']=_0x39b3b9[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x39b3b9[_0x27a8('0x3b')]:_0x18ecb5[_0x27a8('0x37')];if(!_0x3c3065[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x39b3b9[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x25')]);_0x39b3b9[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x3c3065[_0x27a8('0x38')]['offset']);}_0x39b3b9[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x40')]);_0x39b3b9[_0x27a8('0x43')]=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x3c3065[_0x27a8('0x38')],_0x18ecb5[_0x27a8('0x39')]));_0x39b3b9['where']['ChatWebsiteId']=_0xeb1d8['id'];if(_0x3c3065[_0x27a8('0x38')]['filter']){_0x39b3b9['where']=_[_0x27a8('0x44')](_0x39b3b9[_0x27a8('0x43')],{'$or':_['map'](_0x39b3b9['attributes'],function(_0x25d8a2){var _0x53d7f7={};_0x53d7f7[_0x25d8a2]={'$like':'%'+_0x3c3065['query']['filter']+'%'};return _0x53d7f7;})});}_0x39b3b9=_[_0x27a8('0x44')]({},_0x39b3b9,_0x3c3065[_0x27a8('0x46')]);return db[_0x27a8('0x5f')][_0x27a8('0x26')]({'where':_0x39b3b9['where']})['then'](function(_0x4aef7d){_0x2a9ae1['count']=_0x4aef7d;if(_0x3c3065[_0x27a8('0x38')]['includeAll']){_0x39b3b9[_0x27a8('0x5c')]=[{'all':!![]}];}return db[_0x27a8('0x5f')][_0x27a8('0x48')](_0x39b3b9);})[_0x27a8('0x15')](function(_0x5833de){_0x2a9ae1[_0x27a8('0x5d')]=_0x5833de;return _0x2a9ae1;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0xff14db,_0x39b3b9))[_0x27a8('0x1e')](handleError(_0xff14db,null));};exports[_0x27a8('0x62')]=function(_0x193003,_0x2fb868){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x193003[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2fb868,null))['then'](function(_0x30dc7d){if(_0x30dc7d){return _0x30dc7d[_0x27a8('0x62')](_0x193003[_0x27a8('0x38')]['ids']);}})[_0x27a8('0x15')](respondWithStatusCode(_0x2fb868,null))['catch'](handleError(_0x2fb868,null));};exports['addLogo']=function(_0x52435d,_0x2321b7){_0x52435d['body'][_0x27a8('0x63')]=_0x52435d[_0x27a8('0x64')][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x52435d[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2321b7,null))[_0x27a8('0x15')](saveUpdates(_0x52435d[_0x27a8('0x4e')],null))['then'](respondWithResult(_0x2321b7,null))['catch'](handleError(_0x2321b7,null));};exports['addAvatar']=function(_0x3c8b5f,_0x2d2627){_0x3c8b5f[_0x27a8('0x4e')]['agentAvatar']=_0x3c8b5f[_0x27a8('0x64')]['filename'];return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x3c8b5f[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2d2627,null))[_0x27a8('0x15')](saveUpdates(_0x3c8b5f[_0x27a8('0x4e')],null))[_0x27a8('0x15')](respondWithResult(_0x2d2627,null))[_0x27a8('0x1e')](handleError(_0x2d2627,null));};exports[_0x27a8('0x66')]=function(_0x1f23b6,_0x1d9a88){_0x1f23b6[_0x27a8('0x4e')][_0x27a8('0x67')]=_0x1f23b6[_0x27a8('0x64')][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x1f23b6['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x1d9a88,null))[_0x27a8('0x15')](saveUpdates(_0x1f23b6['body'],null))['then'](respondWithResult(_0x1d9a88,null))['catch'](handleError(_0x1d9a88,null));};exports[_0x27a8('0x68')]=function(_0x1652b5,_0x7348be){_0x1652b5['body'][_0x27a8('0x69')]=_0x1652b5['file'][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x1652b5[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x7348be,null))['then'](saveUpdates(_0x1652b5['body'],null))[_0x27a8('0x15')](respondWithResult(_0x7348be,null))[_0x27a8('0x1e')](handleError(_0x7348be,null));};exports[_0x27a8('0x6a')]=function(_0x281b11,_0x9cb4b0){var _0x5c0c6f=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],'server/files/images/logos/default_logo.svg');var _0xc9f49a={'where':{'id':_0x281b11[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x63')],'raw':!![]};var _0x20f334=![];return require(_0x27a8('0x6d'))[_0x27a8('0x6e')]()['then'](function(_0x247fe8){if(_0x247fe8){_0x20f334=_0x247fe8[_0x27a8('0x6f')];}})[_0x27a8('0x15')](function(){return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0xc9f49a);})[_0x27a8('0x15')](handleEntityNotFound(_0x9cb4b0,null))[_0x27a8('0x15')](function(_0x37ec00){if(_0x37ec00){if(!_[_0x27a8('0x70')](_0x37ec00[_0x27a8('0x63')])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x72'),_0x37ec00[_0x27a8('0x63')]))&&_0x20f334){_0x5c0c6f=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x72'),_0x37ec00[_0x27a8('0x63')]);}}return _0x9cb4b0[_0x27a8('0x73')](_0x5c0c6f);}})[_0x27a8('0x1e')](handleError(_0x9cb4b0,null));};exports[_0x27a8('0x74')]=function(_0x45f655,_0x182339){var _0x25fc49=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x75'));var _0x4c2068={'where':{'id':_0x45f655['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x4c2068)['then'](handleEntityNotFound(_0x182339,null))[_0x27a8('0x15')](function(_0x130a44){if(_0x130a44){if(!_['isNil'](_0x130a44[_0x27a8('0x76')])){if(fs[_0x27a8('0x71')](path['join'](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x130a44[_0x27a8('0x76')]))){_0x25fc49=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],'server/files/images/avatars/',_0x130a44[_0x27a8('0x76')]);}}return _0x182339[_0x27a8('0x73')](_0x25fc49);}})[_0x27a8('0x1e')](handleError(_0x182339,null));};exports[_0x27a8('0x78')]=function(_0x4b1404,_0x1a0a07){var _0x284100=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x79'));var _0x370398={'where':{'id':_0x4b1404[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x67'),_0x27a8('0x7a')],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x370398)['then'](handleEntityNotFound(_0x1a0a07,null))[_0x27a8('0x15')](function(_0x1abd35){if(_0x1abd35){if(!_['isNil'](_0x1abd35['customerAvatar'])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config['root'],_0x27a8('0x77'),_0x1abd35[_0x27a8('0x67')]))&&_0x1abd35[_0x27a8('0x7a')]){_0x284100=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x1abd35[_0x27a8('0x67')]);}}return _0x1a0a07[_0x27a8('0x73')](_0x284100);}})[_0x27a8('0x1e')](handleError(_0x1a0a07,null));};exports[_0x27a8('0x7b')]=function(_0x3f75a3,_0x3a6515){var _0x2f95cc=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x7c'));var _0x37578b={'where':{'id':_0x3f75a3[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x69')],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x37578b)['then'](handleEntityNotFound(_0x3a6515,null))['then'](function(_0x18c9a5){if(_0x18c9a5){if(!_[_0x27a8('0x70')](_0x18c9a5[_0x27a8('0x69')])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x18c9a5[_0x27a8('0x69')]))){_0x2f95cc=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x18c9a5[_0x27a8('0x69')]);}}return _0x3a6515[_0x27a8('0x73')](_0x2f95cc);}})[_0x27a8('0x1e')](handleError(_0x3a6515,null));};exports[_0x27a8('0x7d')]=function(_0x38df5b,_0xcab211){var _0x1d4272=require(_0x27a8('0x7e'));var _0xc9995c=new _0x1d4272();var _0xc8723b=_0xc9995c[_0x27a8('0x7f')](_0x38df5b[_0x27a8('0x80')]['user-agent'])[_0x27a8('0x81')]();var _0x39c32b={'body':_0x38df5b[_0x27a8('0x4e')],'channel':_0x27a8('0x82')};var _0x3f500e=[];var _0x14092b=[];var _0x5b262f={};var _0x32fa91=![];return db[_0x27a8('0x83')][_0x27a8('0x84')]()[_0x27a8('0x15')](function(_0x335e12){if(!_0x335e12){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x87'));}_0x3f500e=_[_0x27a8('0x88')](_[_0x27a8('0x4b')](_0x335e12),[_0x27a8('0x89'),_0x27a8('0x8a')]);_0x14092b=_['difference'](_[_0x27a8('0x4b')](_0x335e12),[_0x27a8('0x89'),_0x27a8('0x8a'),'CompanyId',_0x27a8('0x8b')]);if(_0x38df5b[_0x27a8('0x4e')]['id']){delete _0x38df5b[_0x27a8('0x4e')]['id'];}if(_['isNil'](_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x8c')])){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('from\x20is\x20mandatory');}if(_[_0x27a8('0x70')](_0x38df5b['body'][_0x27a8('0x4e')])||_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x4e')]===''){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x8d'));}if(_[_0x27a8('0x70')](_0x38df5b['body']['mapKey'])){throw new db['Sequelize'][(_0x27a8('0x86'))](_0x27a8('0x8e')+_0x14092b);}if(!_[_0x27a8('0x8f')](_0x14092b,_0x38df5b[_0x27a8('0x4e')]['mapKey'])){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14092b);}_0x5b262f[_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x90')]]=_0x38df5b[_0x27a8('0x4e')]['from'];})[_0x27a8('0x15')](function(){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x38df5b[_0x27a8('0x4a')]['id']},'include':[{'model':db[_0x27a8('0x91')],'as':'List','include':[{'model':db['CmContact'],'as':_0x27a8('0x92'),'where':_0x5b262f,'limit':0x1,'order':[[_0x27a8('0x8a'),_0x27a8('0x93')]]}]},{'model':db[_0x27a8('0x94')],'as':_0x27a8('0x95')}]});})['then'](handleEntityNotFound(_0xcab211,null))['then'](function(_0x433de3){if(_0x433de3&&_0x433de3[_0x27a8('0x96')]){_0x39c32b[_0x27a8('0x97')]=_0x433de3;_0x39c32b[_0x27a8('0x98')]=_0x433de3['Applications'];_0x39c32b[_0x27a8('0x99')]=_0x433de3[_0x27a8('0x96')];_0x39c32b[_0x27a8('0x98')]=_['orderBy'](_0x39c32b['applications'],[_0x27a8('0x9a')],[_0x27a8('0x9b')]);if(_0x39c32b[_0x27a8('0x97')][_0x27a8('0x95')]){delete _0x39c32b['account'][_0x27a8('0x95')];}if(_0x39c32b['account'][_0x27a8('0x96')]&&_0x39c32b[_0x27a8('0x97')][_0x27a8('0x96')][_0x27a8('0x92')][_0x27a8('0x3d')]){return _0x39c32b[_0x27a8('0x97')]['List']['Contacts'][0x0];}var _0x754075=_[_0x27a8('0xb')](_0x38df5b[_0x27a8('0x4e')],{'firstName':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x8c')],'ListId':_0x433de3[_0x27a8('0x8b')]});_0x754075[_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x90')]]=_0x38df5b['body'][_0x27a8('0x8c')];return db[_0x27a8('0x83')]['create'](_0x754075,{'fields':_0x3f500e,'raw':!![]});}})[_0x27a8('0x15')](handleEntityNotFound(_0xcab211,null))[_0x27a8('0x15')](function(_0x4b9d1a){_0x39c32b[_0x27a8('0x9c')]=_0x4b9d1a;var _0x397d60=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x9d')];if(_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9e')]){_0x397d60=_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9e')];}else if(_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9f')]){_0x397d60=_[_0x27a8('0xa0')](_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9f')][_0x27a8('0xa1')](','));}if(_0x4b9d1a){var _0x21b562={'ContactId':_0x4b9d1a['id'],'ChatWebsiteId':_0x38df5b[_0x27a8('0x4a')]['id'],'from':(_0x4b9d1a[_0x27a8('0xa2')]||'')+'\x20'+(_0x4b9d1a[_0x27a8('0xa3')]||''),'customerIp':_0x397d60,'customerPort':_0x38df5b[_0x27a8('0x80')][_0x27a8('0xa4')]?_0x38df5b['headers'][_0x27a8('0xa4')]:null,'referer':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xa5')],'browserName':_0xc8723b[_0x27a8('0xa6')][_0x27a8('0x2d')]&&_0xc8723b[_0x27a8('0xa6')][_0x27a8('0xa7')]?util['format'](_0x27a8('0xa8'),_0xc8723b[_0x27a8('0xa6')]['name'],_0xc8723b['browser']['version']):_0x27a8('0xa9'),'browserVersion':_0xc8723b[_0x27a8('0xa6')]['version']||_0x27a8('0xa9'),'osName':util[_0x27a8('0xaa')]('%s\x20%s',_0xc8723b['os'][_0x27a8('0x2d')],_0xc8723b['os'][_0x27a8('0xa7')]),'osVersion':_0xc8723b['os'][_0x27a8('0xa7')],'deviceModel':_0xc8723b[_0x27a8('0xab')][_0x27a8('0x37')]&&_0xc8723b['device'][_0x27a8('0xac')]?util[_0x27a8('0xaa')](_0x27a8('0xad'),_0xc8723b[_0x27a8('0xab')][_0x27a8('0x37')],_0xc8723b['device'][_0x27a8('0xac')],_0xc8723b[_0x27a8('0xab')][_0x27a8('0x35')]):null,'deviceVendor':_0xc8723b[_0x27a8('0xab')][_0x27a8('0xac')],'deviceType':_0xc8723b[_0x27a8('0xab')][_0x27a8('0x35')],'formData':JSON[_0x27a8('0x1b')](_0x38df5b[_0x27a8('0x4e')])};var _0x6384d4={'ChatWebsiteId':_0x38df5b['params']['id'],'closed':![]};if(_0x38df5b['body'][_0x27a8('0xae')]){_0x6384d4[_0x27a8('0xae')]=_0x38df5b['body'][_0x27a8('0xae')];return db['ChatInteraction'][_0x27a8('0x4c')]({'where':_0x6384d4})[_0x27a8('0x15')](function(_0x226a52){if(_0x226a52){return[_0x226a52,![]];}_0x21b562[_0x27a8('0xae')]=_0x38df5b['body'][_0x27a8('0xae')];_0x21b562[_0x27a8('0xaf')]=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xaf')];return db[_0x27a8('0xb0')][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x3b69db){return[_0x3b69db,!![]];});});}_0x6384d4['ContactId']=_0x4b9d1a['id'];if(_0x38df5b[_0x27a8('0x4e')]['interaction']&&_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb1')]['id']){_0x6384d4['id']=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb1')]['id'];return db['ChatInteraction'][_0x27a8('0x4c')]({'where':_0x6384d4})['then'](function(_0x2ed05a){if(_0x2ed05a){return[_0x2ed05a,![]];}return db['ChatInteraction'][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x4b2005){return[_0x4b2005,!![]];});});}return db[_0x27a8('0xb0')][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x539c1e){return[_0x539c1e,!![]];});}})[_0x27a8('0xb2')](function(_0x24e81b,_0x149012){if(_0x24e81b){_0x32fa91=_0x149012;if(!_0x149012){var _0x4b9240={'from':(_0x39c32b[_0x27a8('0x9c')][_0x27a8('0xa2')]||'')+'\x20'+(_0x39c32b[_0x27a8('0x9c')]['lastName']||'')};if(_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xae')]&&_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')]&&_0x38df5b[_0x27a8('0x4e')]['threadId']!=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')]){_0x4b9240[_0x27a8('0xae')]=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')];}return _0x24e81b['update'](_0x4b9240);}else{return _0x24e81b;}}})['then'](function(_0x320a29){_0x39c32b[_0x27a8('0xb1')]=_0x320a29[_0x27a8('0x2a')]({'plain':!![]});_0x39c32b['interaction'][_0x27a8('0xb4')]=_0x32fa91;if(_0x39c32b['interaction'][_0x27a8('0xb4')]){if(_0x39c32b[_0x27a8('0x97')]['autoclose']){_0x39c32b['applications'][_0x27a8('0xb5')]({'id':0x0,'priority':_0x39c32b[_0x27a8('0x98')][_0x27a8('0x3d')]+0x1,'app':_0x27a8('0xb6'),'appdata':_0x27a8('0xb7'),'interval':'*,*,*,*'});}}return db[_0x27a8('0xb8')][_0x27a8('0x4d')]({'body':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x4e')],'ChatWebsiteId':_0x38df5b[_0x27a8('0x4a')]['id'],'ChatInteractionId':_0x320a29['id'],'direction':'in','ContactId':_0x39c32b[_0x27a8('0x9c')]['id'],'AttachmentId':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb9')]});})['then'](function(_0x5977e0){_0x39c32b[_0x27a8('0x1d')]=_0x5977e0;if(_0x39c32b[_0x27a8('0xb1')]['UserId']){return db['User'][_0x27a8('0x4c')]({'attributes':['id',_0x27a8('0x2d')],'where':{'id':_0x39c32b[_0x27a8('0xb1')][_0x27a8('0xba')]}})[_0x27a8('0x15')](function(_0x5ec681){if(_0x5ec681){_0x39c32b[_0x27a8('0x98')][_0x27a8('0xbb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ec681[_0x27a8('0x2d')]+','+(_0x39c32b['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x39c32b[_0x27a8('0xbc')]=!![];}return respondWithRpcPromise('Start',_0x27a8('0xbd'),_0x39c32b);});}return respondWithRpcPromise(_0x27a8('0xbe'),_0x27a8('0xbd'),_0x39c32b);})[_0x27a8('0x15')](function(_0x568d9b){respondWithRpcPromise(_0x27a8('0xbf'),_0x27a8('0xbf'),{'event':'notify','message':_0x568d9b},client9002);return _0x568d9b;})[_0x27a8('0x15')](respondWithResult(_0xcab211,null))['catch'](handleError(_0xcab211,null));};exports[_0x27a8('0xc0')]=function(_0x1ed75b,_0x5454c2){var _0x457cd1,_0x2ce6dd,_0x406b0e;var _0x2a5b45=[];var _0xdeb614={};var _0x37cd9e=_0x1ed75b[_0x27a8('0xc1')]||[];var _0x44d8e8=[];var _0x172ab1;return db[_0x27a8('0x83')][_0x27a8('0x84')]()[_0x27a8('0x15')](function(_0x39fbf2){if(!_0x39fbf2){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('no\x20available\x20attributes');}_0x2a5b45=_[_0x27a8('0x88')](_[_0x27a8('0x4b')](_0x39fbf2),[_0x27a8('0x89'),_0x27a8('0x8a'),_0x27a8('0xc2'),_0x27a8('0x8b')]);if(_0x1ed75b[_0x27a8('0x4e')]['id']){delete _0x1ed75b[_0x27a8('0x4e')]['id'];}if(_[_0x27a8('0x70')](_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x8c')])){throw _0x5454c2['status'](0x1f4)['send'](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0xc3')));}if(_[_0x27a8('0x70')](_0x1ed75b[_0x27a8('0x4e')]['body'])||_0x1ed75b['body'][_0x27a8('0x4e')]===''){throw _0x5454c2[_0x27a8('0x20')](0x1f4)[_0x27a8('0x2e')](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x8d')));}if(_[_0x27a8('0x70')](_0x1ed75b['body'][_0x27a8('0xc4')])){throw _0x5454c2[_0x27a8('0x20')](0x1f4)[_0x27a8('0x2e')](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a5b45));}if(!_[_0x27a8('0x8f')](_0x2a5b45,_0x1ed75b['body'][_0x27a8('0xc4')])){throw _0x5454c2[_0x27a8('0x20')](0x1f4)['send'](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a5b45));}_0xdeb614[_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0xc4')]]=_0x1ed75b[_0x27a8('0x4e')]['from'];})[_0x27a8('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1ed75b[_0x27a8('0x4a')]['id']},'include':[{'model':db[_0x27a8('0x91')],'as':_0x27a8('0x96')},{'model':db[_0x27a8('0xc5')],'as':_0x27a8('0xc5')}]});})[_0x27a8('0x15')](handleEntityNotFound(_0x5454c2,null))[_0x27a8('0x15')](function(_0x50456b){if(_0x50456b&&_0x50456b[_0x27a8('0x96')]){_0x2ce6dd=_0x50456b;var _0x57961c=_[_0x27a8('0xb')](_0x1ed75b['body'],{'firstName':_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x8c')],'phone':_0x1ed75b[_0x27a8('0x4e')]['from'],'ListId':_0x50456b[_0x27a8('0x8b')]});_0x57961c[_0x1ed75b[_0x27a8('0x4e')]['mapKeyOffline']]=_0x1ed75b[_0x27a8('0x4e')]['from'];return db['CmContact'][_0x27a8('0xc6')]({'where':_0xdeb614,'defaults':_0x57961c});}})[_0x27a8('0xb2')](function(_0xf09e8e){if(_0xf09e8e){_0x406b0e=_0xf09e8e;var _0x213df4=fs[_0x27a8('0xc7')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0xc8')),_0x27a8('0xc9'));var _0x27faa3=ejs[_0x27a8('0xca')](_0x213df4,{'body':_['toPairs'](_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x4e')]),'bodyTitle':_0x2ce6dd['offlineMessageBody']});return db['ChatOfflineMessage'][_0x27a8('0x4d')]({'body':_0x27faa3,'plainBody':htmlToText[_0x27a8('0xcb')](_0x27faa3),'ContactId':_0xf09e8e['id'],'ChatWebsiteId':_0x2ce6dd['id']});}})['then'](function(_0x32df13){_0x172ab1=_0x32df13;if(_0x37cd9e[_0x27a8('0x3d')]){var _0xd09318=_0x37cd9e[_0x27a8('0x31')](function(_0x68cc7a){return{'name':_0x68cc7a[_0x27a8('0xcc')],'basename':_0x68cc7a[_0x27a8('0x65')],'type':_0x68cc7a[_0x27a8('0xcd')],'ChatOfflineMessageId':_0x32df13['id']};});_0x44d8e8=_0xd09318[_0x27a8('0x31')](_0x8509c5=>{var _0x2cecfc={'filename':_0x8509c5[_0x27a8('0x2d')],'path':path['join'](config[_0x27a8('0x6c')],_0x27a8('0xce'),'files','attachments',_0x27a8('0xcf'),_0x8509c5[_0x27a8('0xd0')])};return _0x2cecfc;});if(!_0x2ce6dd[_0x27a8('0xd1')]){return db['sequelize'][_0x27a8('0xd2')](function(_0x1fd9de){return db[_0x27a8('0xd3')]['bulkCreate'](_0xd09318,{'transaction':_0x1fd9de});});}}})[_0x27a8('0x15')](function(){if(_0x172ab1){_0x457cd1=_0x172ab1;return db['MailAccount'][_0x27a8('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x27a8('0xd4')],'as':_0x27a8('0xd5'),'raw':!![],'include':[{'model':db[_0x27a8('0xd6')],'as':_0x27a8('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x46318c){if(_0x46318c&&_0x46318c[_0x27a8('0xd5')]&&_0x2ce6dd[_0x27a8('0xd7')]&&_0x2ce6dd[_0x27a8('0xd8')]){var _0x1f7a58=_0x46318c[_0x27a8('0xd9')]();return respondWithRpcPromise(_0x27a8('0xda'),_0x27a8('0xdb'),{'account':_0x1f7a58,'message':{'from':util[_0x27a8('0xaa')](_0x27a8('0xdc'),_0x46318c[_0x27a8('0x2d')],_0x46318c['email']||_0x46318c[_0x27a8('0xd5')][_0x27a8('0x4f')]),'to':_0x2ce6dd[_0x27a8('0xd8')],'subject':_0x2ce6dd[_0x27a8('0xdd')],'html':_0x457cd1[_0x27a8('0x4e')],'attachments':_0x44d8e8}},client9003)[_0x27a8('0x15')](function(){return _0x457cd1;})[_0x27a8('0x1e')](function(_0xf8b1e8){logger[_0x27a8('0x1c')](_0xf8b1e8);});}})[_0x27a8('0x15')](function(){if(_0x2ce6dd&&_0x2ce6dd[_0x27a8('0xd1')]&&_0x2ce6dd[_0x27a8('0xde')]){var _0x5771c7=[];if(_0x37cd9e['length']){_0x5771c7=_0x37cd9e[_0x27a8('0x31')](function(_0x31768d){return{'name':_0x31768d[_0x27a8('0xcc')],'basename':_0x31768d[_0x27a8('0x65')],'type':_0x31768d['mimetype'],'ChatOfflineMessageId':_0x172ab1['id']};});}var _0x85d97;if(!_[_0x27a8('0x70')](_0x2ce6dd[_0x27a8('0xdf')])){var _0xed8c32=_[_0x27a8('0x31')](_0x1ed75b['body'],function(_0x1fdb16){return _0x1fdb16;});var _0x362f58=_[_0x27a8('0xe0')](_0xed8c32)[0x0];var _0x1d17e8=_[_0x27a8('0xe1')](_0x362f58,function(_0x283f30){return _0x283f30;});_0x85d97=_0x1d17e8[0x1][_0x2ce6dd[_0x27a8('0xdf')]];}var _0x3e7f89={'from':_0x406b0e[_0x27a8('0xe2')],'firstName':_0x406b0e[_0x27a8('0xa2')],'lastName':_0x406b0e['lastName'],'mapKey':_0x27a8('0xe2'),'message':{'from':_0x406b0e[_0x27a8('0xe2')],'to':_0x2ce6dd[_0x27a8('0xc5')][_0x27a8('0xe2')],'cc':'','subject':_['isNil'](_0x85d97)?_0x2ce6dd[_0x27a8('0xdd')]:_0x85d97,'messageId':'','sentAt':new Date(),'attach':_0x5771c7[_0x27a8('0x3d')],'attachments':_0x5771c7,'originChannel':'Chat','ChatWebsiteId':_0x2ce6dd['id'],'ChatOfflineMessageId':_0x457cd1['id'],'originTo':_0x2ce6dd[_0x27a8('0xc5')][_0x27a8('0xe2')]},'body':_0x457cd1['body']};var _0x2096a1={'account':{'id':_0x2ce6dd[_0x27a8('0xde')]},'body':_0x3e7f89,'log':_0x27a8('0xe3')};return respondWithRpcPromise(_0x27a8('0xe3'),_0x27a8('0xe4'),_0x2096a1,client9001)[_0x27a8('0x15')](function(){return _0x457cd1;})['catch'](function(_0x2cc2d4){logger[_0x27a8('0x1c')](_0x2cc2d4);});}return;})[_0x27a8('0x15')](function(){if(_0x457cd1){return _0x457cd1;}})[_0x27a8('0x15')](respondWithResult(_0x5454c2,null))[_0x27a8('0x1e')](function(_0x1eff23){logger[_0x27a8('0x1c')](_0x27a8('0x1e'),_0x1eff23);for(var _0x2432fe of _0x37cd9e){var _0x17f099=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0xce'),_0x27a8('0xc1'),_0x27a8('0xe5'),_0x27a8('0xcf'),_0x2432fe[_0x27a8('0x65')]);fs_extra['remove'](_0x17f099)['catch'](function(_0x161705){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x17f099,_0x161705);});}});};exports[_0x27a8('0xe6')]=function(_0x199387,_0x8d9f9c){return db[_0x27a8('0xb0')][_0x27a8('0x4c')]({'where':{'id':_0x199387['params']['id']}})['then'](handleEntityNotFound(_0x8d9f9c,null))[_0x27a8('0x15')](function(_0x314206){if(_0x314206){return _0x314206[_0x27a8('0xe6')](_0x199387[_0x27a8('0x4e')][_0x27a8('0xe7')],_['omit'](_0x199387['body'],[_0x27a8('0xe7'),'id'])||{});}})[_0x27a8('0x15')](respondWithResult(_0x8d9f9c,null))[_0x27a8('0x1e')](handleError(_0x8d9f9c,null));};exports[_0x27a8('0xe8')]=function(_0x1c6c8c,_0x3c4ab1){var _0x2b3e00={'raw':![],'where':{}};var _0x161f6f={};var _0x2541e5={'count':0x0,'rows':[]};return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x1c6c8c['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x3c4ab1,null))['then'](function(_0x1d2664){if(_0x1d2664){_0x161f6f[_0x27a8('0x37')]=_['keys'](db['ChatInteraction'][_0x27a8('0x33')]);_0x161f6f['query']=_['keys'](_0x1c6c8c[_0x27a8('0x38')]);_0x161f6f[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x161f6f[_0x27a8('0x37')],_0x161f6f['query']);_0x2b3e00[_0x27a8('0x3b')]=_['intersection'](_0x161f6f[_0x27a8('0x37')],qs['fields'](_0x1c6c8c['query']['fields']));_0x2b3e00['attributes']=_0x2b3e00[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x2b3e00[_0x27a8('0x3b')]:_0x161f6f[_0x27a8('0x37')];if(!_0x1c6c8c['query']['hasOwnProperty'](_0x27a8('0x3f'))){_0x2b3e00[_0x27a8('0x25')]=qs['limit'](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x25')]);_0x2b3e00['offset']=qs['offset'](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x2b3e00[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x40')]);_0x2b3e00['where']=qs['filters'](_[_0x27a8('0x41')](_0x1c6c8c[_0x27a8('0x38')],_0x161f6f[_0x27a8('0x39')]));_0x2b3e00[_0x27a8('0x43')]['ChatWebsiteId']=_0x1d2664['id'];if(_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x42')]){_0x2b3e00[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x2b3e00[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x2b3e00[_0x27a8('0x3b')],function(_0x22692f){var _0x346323={};_0x346323[_0x22692f]={'$like':'%'+_0x1c6c8c[_0x27a8('0x38')]['filter']+'%'};return _0x346323;})});}_0x2b3e00=_['merge']({},_0x2b3e00,_0x1c6c8c['options']);return db['ChatInteraction'][_0x27a8('0x26')]({'where':_0x2b3e00[_0x27a8('0x43')]})['then'](function(_0x280528){_0x2541e5[_0x27a8('0x26')]=_0x280528;if(_0x1c6c8c['query']['includeAll']){_0x2b3e00['include']=[{'model':db[_0x27a8('0x83')],'as':_0x27a8('0xe9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x27a8('0xea'),_0x27a8('0xeb')],'required':![]},{'model':db[_0x27a8('0xec')],'as':'Tags','attributes':['id',_0x27a8('0x2d'),_0x27a8('0xed')],'where':_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0xee')]?{'id':_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0xee')]}:undefined,'required':_0x1c6c8c['query']['tag']?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x2b3e00);})['then'](function(_0x261aaf){_0x2541e5[_0x27a8('0x5d')]=_0x261aaf;return _0x2541e5;});}})['then'](respondWithFilteredResult(_0x3c4ab1,_0x2b3e00))[_0x27a8('0x1e')](handleError(_0x3c4ab1,null));};function iftimePromise(_0x2e593f,_0x4bae04){return respondWithRpcPromise(_0x27a8('0xef'),_0x27a8('0xf0'),{'command':_0x4bae04[_0x27a8('0xf1')]?util[_0x27a8('0xaa')]('iftime\x20%s,%s',_0x2e593f['interval'],_0x4bae04[_0x27a8('0xf1')]):util['format'](_0x27a8('0xf2'),_0x2e593f['interval'])},client9002)[_0x27a8('0x15')](function(_0x6c3943){var _0xb9ce30=_0x6c3943&&_0x6c3943['indexOf'](_0x27a8('0xf3'))>=0x0?!![]:![];logger[_0x27a8('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4bae04['id'],_0x2e593f['id'],_0x2e593f['interval'],_0xb9ce30?_0x27a8('0xf4'):_0x27a8('0xf5'),_0x4bae04[_0x27a8('0xf1')]?_0x4bae04[_0x27a8('0xf1')]:_0x27a8('0xf6'));return _0xb9ce30;})['catch'](function(_0x3f1f40){logger[_0x27a8('0x1c')](_0x27a8('0xf7'),_0x4bae04['id'],_0x2e593f['id'],_0x2e593f['interval'],util[_0x27a8('0xf8')](_0x3f1f40,{'showHidden':![],'depth':null}),_0x4bae04[_0x27a8('0xf1')]?_0x4bae04[_0x27a8('0xf1')]:_0x27a8('0xf6'));return![];});}exports[_0x27a8('0xf0')]=function(_0x4e6888,_0x32c4c8){var _0x4d1abd=0x0;var _0x20c8ff=0x0;var _0x766c78=![];var _0x45b2fb;var _0x27baf5;return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x4e6888['params']['id']},'include':[{'model':db['Interval'],'as':_0x27a8('0xf9'),'include':[{'model':db[_0x27a8('0xf9')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x27a8('0x15')](handleEntityNotFound(_0x32c4c8,null))[_0x27a8('0x15')](function(_0x467130){if(_0x467130){_0x45b2fb=_0x467130;return _0x467130[_0x27a8('0xfa')]({'raw':!![]});}})[_0x27a8('0x15')](function(_0x3fda45){if(_0x45b2fb){if(_0x3fda45){_0x27baf5=_0x3fda45;}}return require(_0x27a8('0x6d'))[_0x27a8('0x6e')]();})[_0x27a8('0x15')](function(_0x44dea6){if(_0x44dea6){_0x20c8ff=_0x44dea6['virtual'];_0x766c78=_0x44dea6['custom'];}})[_0x27a8('0x15')](function(){return db['ChatInteraction'][_0x27a8('0x26')]({'where':{'closed':![]}});})[_0x27a8('0x15')](function(_0x24f062){_0x4d1abd=_0x24f062;if(_0x20c8ff&&_0x24f062>_0x20c8ff){return db[_0x27a8('0xfb')][_0x27a8('0x5b')]({'where':{'id':0x1}})[_0x27a8('0x15')](function(_0x1c9d01){if(_0x1c9d01){_0x1c9d01['increment'](_0x27a8('0xfc'));}});}})[_0x27a8('0x15')](function(){if(_0x45b2fb[_0x27a8('0xf9')]&&_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')]){var _0x3a57bf=[];for(var _0x12fc5b=0x0;_0x12fc5b<_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')][_0x27a8('0x3d')];_0x12fc5b++){var _0x4c44e0=_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')][_0x12fc5b][_0x27a8('0x2a')]({'plain':!![]});_0x3a57bf[_0x27a8('0xb5')](iftimePromise(_0x4c44e0,_0x45b2fb));}return BPromise[_0x27a8('0xfe')](_0x3a57bf)[_0x27a8('0x15')](function(_0x4da9f4){return _[_0x27a8('0xff')](_0x4da9f4);});}else{return!![];}})[_0x27a8('0x15')](function(_0x22dcc7){var _0x2df73d=fs['readFileSync'](path[_0x27a8('0x6b')](config['root'],_0x27a8('0x100')),_0x27a8('0xc9'));var _0x10c754={'remote':_0x45b2fb[_0x27a8('0x101')],'query':querystring[_0x27a8('0x1b')](_[_0x27a8('0x44')](_0x45b2fb['get']({'plain':!![]}),{'customerIp':_0x4e6888['headers'][_0x27a8('0x9f')]||_0x4e6888['headers']['x-real-ip']||_0x4e6888['connection']['remoteAddress']||_0x4e6888['ip'],'referer':_0x4e6888[_0x27a8('0x80')]['referer'],'openedInteractions':_0x4d1abd,'maxInteractions':_0x20c8ff,'virtual':_0x766c78['virtual'],'online':_0x22dcc7,'custom':_0x766c78}))[_0x27a8('0x102')](/'/g,'\x5c\x27')};_0x32c4c8[_0x27a8('0x2e')](ejs[_0x27a8('0xca')](Mustache[_0x27a8('0xca')](_0x2df73d,_0x10c754),{'proactiveActions':_0x27baf5,'alignment':_0x45b2fb[_0x27a8('0x103')],'verticalAlignment':_0x45b2fb['verticalAlignment'],'div_color':_0x45b2fb[_0x27a8('0xed')],'labelText':_0x45b2fb[_0x27a8('0x104')],'text_color':_0x45b2fb[_0x27a8('0x105')],'text_button_color':_0x45b2fb[_0x27a8('0x106')],'button_color':_0x45b2fb[_0x27a8('0x107')],'background_color':_0x45b2fb[_0x27a8('0x108')],'hideWhenOffline':_0x45b2fb['hideWhenOffline'],'interval':_0x45b2fb[_0x27a8('0x109')]}));})[_0x27a8('0x1e')](handleError(_0x32c4c8,null));};exports['addApplications']=function(_0xd5fbb9,_0x3c54d4){var _0x395a8d=_0xd5fbb9[_0x27a8('0x4a')]['id'];var _0x613c6e=_0xd5fbb9[_0x27a8('0x4e')];var _0x265ea9=0xc8;var _0x2f7065=null;return db['sequelize'][_0x27a8('0xd2')]({'isolationLevel':db[_0x27a8('0x10a')][_0x27a8('0x10b')][_0x27a8('0x10c')][_0x27a8('0x10d')]},function(_0x2db188){return db['ChatWebsite'][_0x27a8('0x5b')]({'where':{'id':_0x395a8d},'transaction':_0x2db188})[_0x27a8('0x15')](function(_0x5dbb93){if(_0x5dbb93){return db[_0x27a8('0x94')][_0x27a8('0x29')]({'where':{'ChatWebsiteId':_0x395a8d},'transaction':_0x2db188})[_0x27a8('0x15')](function(){var _0x9d3337=_[_0x27a8('0x31')](_0x613c6e,function(_0xf38248){_0xf38248[_0x27a8('0x58')]=_0x395a8d;return _0xf38248;});return db['ChatApplication'][_0x27a8('0x10e')](_0x9d3337,{'transaction':_0x2db188});});}else{_0x265ea9=0x194;_0x2f7065=[];}});})[_0x27a8('0x15')](function(){if(_0x265ea9!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x395a8d},'order':_0x27a8('0x9a')})[_0x27a8('0x15')](function(_0x2bc8a3){_0x2f7065=_0x2bc8a3;});}})[_0x27a8('0x1e')](function(_0xd6ee99){_0x265ea9=0x1f4;logger['error'](_0xd6ee99['stack']);if(_0xd6ee99[_0x27a8('0x2d')]){delete _0xd6ee99[_0x27a8('0x2d')];}_0x2f7065=_0xd6ee99;})[_0x27a8('0x10f')](function(){if(_0x2f7065===null){_0x3c54d4[_0x27a8('0x1f')](_0x265ea9);}else{if(_0x265ea9===0x1f4){_0x3c54d4[_0x27a8('0x20')](_0x265ea9)[_0x27a8('0x2e')](_0x2f7065);}else{_0x3c54d4[_0x27a8('0x20')](_0x265ea9)[_0x27a8('0x22')](_0x2f7065);}}});};exports[_0x27a8('0x110')]=function(_0x6ea4ae,_0x59d4fe){var _0x32e56f={};var _0x20b9dd={};var _0x5c879d;var _0x4ef215;return db[_0x27a8('0x32')]['findOne']({'where':{'id':_0x6ea4ae[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x59d4fe,null))[_0x27a8('0x15')](function(_0x1ddac9){if(_0x1ddac9){_0x5c879d=_0x1ddac9;_0x20b9dd[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db['ChatApplication']['rawAttributes']);_0x20b9dd[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x6ea4ae['query']);_0x20b9dd[_0x27a8('0x39')]=_['intersection'](_0x20b9dd[_0x27a8('0x37')],_0x20b9dd['query']);_0x32e56f[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x20b9dd[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x32e56f[_0x27a8('0x3b')]=_0x32e56f[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x32e56f['attributes']:_0x20b9dd[_0x27a8('0x37')];_0x32e56f[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x6ea4ae[_0x27a8('0x38')]['sort']);_0x32e56f['where']=qs['filters'](_[_0x27a8('0x41')](_0x6ea4ae[_0x27a8('0x38')],_0x20b9dd[_0x27a8('0x39')]));if(_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x42')]){_0x32e56f['where']=_['merge'](_0x32e56f[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x32e56f[_0x27a8('0x3b')],function(_0x5e82be){var _0x227ac0={};_0x227ac0[_0x5e82be]={'$like':'%'+_0x6ea4ae[_0x27a8('0x38')]['filter']+'%'};return _0x227ac0;})});}_0x32e56f=_[_0x27a8('0x44')]({},_0x32e56f,_0x6ea4ae['options']);return _0x5c879d[_0x27a8('0x110')](_0x32e56f);}})[_0x27a8('0x15')](function(_0x17d410){if(_0x17d410){_0x4ef215=_0x17d410['length'];if(!_0x6ea4ae['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x32e56f[_0x27a8('0x25')]=qs['limit'](_0x6ea4ae[_0x27a8('0x38')]['limit']);_0x32e56f[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x5c879d['getApplications'](_0x32e56f);}})[_0x27a8('0x15')](function(_0x14fce6){if(_0x14fce6){return _0x14fce6?{'count':_0x4ef215,'rows':_0x14fce6}:null;}})[_0x27a8('0x15')](respondWithResult(_0x59d4fe,null))[_0x27a8('0x1e')](handleError(_0x59d4fe,null));};exports[_0x27a8('0x111')]=function(_0x2b4cac,_0x245de7){return db[_0x27a8('0x112')][_0x27a8('0x4c')]({'where':{'id':_0x2b4cac[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x245de7,null))['then'](function(_0x644328){if(_0x644328){return _0x644328['addProactiveActions'](_0x2b4cac[_0x27a8('0x4e')]['ids'],_['omit'](_0x2b4cac[_0x27a8('0x4e')],['ids','id'])||{});}})[_0x27a8('0x15')](respondWithResult(_0x245de7,null))['catch'](handleError(_0x245de7,null));};exports['getProactiveActions']=function(_0x306d58,_0x2a6e64){var _0x40ddbc={};var _0x31f722={};var _0x497948;var _0x472fbf;return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x306d58[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2a6e64,null))[_0x27a8('0x15')](function(_0x8d9d90){if(_0x8d9d90){_0x497948=_0x8d9d90;_0x31f722[_0x27a8('0x37')]=_['keys'](db['ChatProactiveAction'][_0x27a8('0x33')]);_0x31f722[_0x27a8('0x38')]=_['keys'](_0x306d58[_0x27a8('0x38')]);_0x31f722[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x31f722[_0x27a8('0x37')],_0x31f722[_0x27a8('0x38')]);_0x40ddbc[_0x27a8('0x3b')]=_['intersection'](_0x31f722['model'],qs['fields'](_0x306d58[_0x27a8('0x38')]['fields']));_0x40ddbc[_0x27a8('0x3b')]=_0x40ddbc[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x40ddbc[_0x27a8('0x3b')]:_0x31f722[_0x27a8('0x37')];_0x40ddbc['order']=qs[_0x27a8('0x40')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x40')]);_0x40ddbc['where']=qs['filters'](_[_0x27a8('0x41')](_0x306d58[_0x27a8('0x38')],_0x31f722[_0x27a8('0x39')]));if(_0x306d58[_0x27a8('0x38')][_0x27a8('0x42')]){_0x40ddbc[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x40ddbc[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x40ddbc[_0x27a8('0x3b')],function(_0xc5dfa9){var _0x1e2921={};_0x1e2921[_0xc5dfa9]={'$like':'%'+_0x306d58[_0x27a8('0x38')]['filter']+'%'};return _0x1e2921;})});}_0x40ddbc=_[_0x27a8('0x44')]({},_0x40ddbc,_0x306d58[_0x27a8('0x46')]);return _0x497948[_0x27a8('0xfa')](_0x40ddbc);}})[_0x27a8('0x15')](function(_0x306f19){if(_0x306f19){_0x472fbf=_0x306f19[_0x27a8('0x3d')];if(!_0x306d58[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x40ddbc[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x25')]);_0x40ddbc[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x497948[_0x27a8('0xfa')](_0x40ddbc);}})[_0x27a8('0x15')](function(_0x3442a7){if(_0x3442a7){return _0x3442a7?{'count':_0x472fbf,'rows':_0x3442a7}:null;}})[_0x27a8('0x15')](respondWithResult(_0x2a6e64,null))[_0x27a8('0x1e')](handleError(_0x2a6e64,null));};exports[_0x27a8('0x113')]=function(_0x1b0a3b,_0x5b7b4c){var _0x168439=_0x1b0a3b[_0x27a8('0x38')]['online']===_0x27a8('0x114')?_0x27a8('0x115'):_0x27a8('0x116');return db[_0x27a8('0x32')]['find']({'attributes':['id',_0x168439],'where':{'id':_0x1b0a3b[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x5b7b4c,null))[_0x27a8('0x15')](function(_0x97777a){if(_0x97777a){var _0x4d4ecf=_0x97777a[_0x168439];var _0x4b3552=_0x4d4ecf&&_0x4d4ecf[_0x27a8('0x117')]?_0x4d4ecf[_0x27a8('0x117')]:[];_0x5b7b4c[_0x27a8('0x2e')]({'fromKey':_[_0x27a8('0x70')](_0x4d4ecf['fromKey'])?undefined:_0x4d4ecf[_0x27a8('0x118')],'count':_0x4b3552[_0x27a8('0x3d')],'rows':_0x4b3552});}})[_0x27a8('0x1e')](handleError(_0x5b7b4c,null));};exports['getOfflineMessages']=function(_0x25dc08,_0x7740f5){var _0x3a2083={'raw':![],'where':{}};var _0x1d20d2={};var _0x24d204={'count':0x0,'rows':[]};return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x25dc08[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7740f5,null))[_0x27a8('0x15')](function(_0x170cf9){if(_0x170cf9){_0x1d20d2[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db['ChatOfflineMessage'][_0x27a8('0x33')]);_0x1d20d2[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x25dc08[_0x27a8('0x38')]);_0x1d20d2['filters']=_[_0x27a8('0x3a')](_0x1d20d2[_0x27a8('0x37')],_0x1d20d2[_0x27a8('0x38')]);_0x3a2083['attributes']=_[_0x27a8('0x3a')](_0x1d20d2[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x25dc08[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x3a2083['attributes']=_0x3a2083[_0x27a8('0x3b')]['length']?_0x3a2083[_0x27a8('0x3b')]:_0x1d20d2[_0x27a8('0x37')];if(!_0x25dc08[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x3a2083[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x25dc08[_0x27a8('0x38')][_0x27a8('0x25')]);_0x3a2083[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x25dc08['query']['offset']);}_0x3a2083['order']=qs[_0x27a8('0x40')](_0x25dc08[_0x27a8('0x38')]['sort']);_0x3a2083['where']=qs['filters'](_[_0x27a8('0x41')](_0x25dc08[_0x27a8('0x38')],_0x1d20d2['filters']));_0x3a2083['where'][_0x27a8('0x58')]=_0x170cf9['id'];if(_0x25dc08[_0x27a8('0x38')][_0x27a8('0x42')]){_0x3a2083[_0x27a8('0x43')]=_['merge'](_0x3a2083[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x3a2083[_0x27a8('0x3b')],function(_0x31b13e){var _0x3b32f8={};_0x3b32f8[_0x31b13e]={'$like':'%'+_0x25dc08[_0x27a8('0x38')]['filter']+'%'};return _0x3b32f8;})});}_0x3a2083=_[_0x27a8('0x44')]({},_0x3a2083,_0x25dc08['options']);return db[_0x27a8('0x119')][_0x27a8('0x26')]({'where':_0x3a2083[_0x27a8('0x43')]})[_0x27a8('0x15')](function(_0x5a8976){_0x24d204['count']=_0x5a8976;if(_0x25dc08[_0x27a8('0x38')][_0x27a8('0x47')]){_0x3a2083[_0x27a8('0x5c')]=[{'all':!![]}];}else{_0x3a2083[_0x27a8('0x5c')]=[{'model':db[_0x27a8('0x83')],'as':_0x27a8('0xe9'),'required':![]},{'model':db[_0x27a8('0xd3')],'as':_0x27a8('0x11a'),'required':![]}];}return db[_0x27a8('0x119')]['findAll'](_0x3a2083);})[_0x27a8('0x15')](function(_0x13e046){_0x24d204[_0x27a8('0x5d')]=_0x13e046;return _0x24d204;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0x7740f5,_0x3a2083))[_0x27a8('0x1e')](handleError(_0x7740f5,null));};exports['addAgents']=function(_0x3d1c19,_0x5d8ce9){return db[_0x27a8('0x32')]['find']({'where':{'id':_0x3d1c19[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x5d8ce9,null))['then'](function(_0x13ec03){if(_0x13ec03){return _0x13ec03['addAgents'](_0x3d1c19[_0x27a8('0x4e')][_0x27a8('0xe7')],_[_0x27a8('0x11b')](_0x3d1c19[_0x27a8('0x4e')],['ids','id'])||{})[_0x27a8('0xb2')](function(_0x495bbd){for(var _0x1368cd=0x0;_0x1368cd<_0x3d1c19[_0x27a8('0x4e')][_0x27a8('0xe7')][_0x27a8('0x3d')];_0x1368cd+=0x1){socket['emit'](_0x27a8('0x11c'),{'UserId':Number(_0x3d1c19['body'][_0x27a8('0xe7')][_0x1368cd]),'ChatWebsiteId':Number(_0x3d1c19[_0x27a8('0x4a')]['id'])});}return _0x495bbd;});}})[_0x27a8('0x15')](respondWithResult(_0x5d8ce9,null))[_0x27a8('0x1e')](handleError(_0x5d8ce9,null));};exports['removeAgents']=function(_0x2704b2,_0x10e447){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x2704b2[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x10e447,null))[_0x27a8('0x15')](function(_0xc00666){if(_0xc00666){return _0xc00666['removeAgents'](_0x2704b2['query'][_0x27a8('0xe7')])['then'](function(){if(_[_0x27a8('0x11d')](_0x2704b2[_0x27a8('0x38')][_0x27a8('0xe7')])){for(var _0xcb15b9=0x0;_0xcb15b9<_0x2704b2[_0x27a8('0x38')]['ids'][_0x27a8('0x3d')];_0xcb15b9+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2704b2['query']['ids'][_0xcb15b9]),'ChatWebsiteId':Number(_0x2704b2[_0x27a8('0x4a')]['id'])});}}else{socket[_0x27a8('0x11e')](_0x27a8('0x11f'),{'UserId':Number(_0x2704b2[_0x27a8('0x38')][_0x27a8('0xe7')]),'ChatWebsiteId':Number(_0x2704b2[_0x27a8('0x4a')]['id'])});}});}})[_0x27a8('0x15')](respondWithStatusCode(_0x10e447,null))['catch'](handleError(_0x10e447,null));};exports[_0x27a8('0x120')]=function(_0x47307c,_0x11026e){var _0x46f5d3={};var _0x555d59={};var _0x52daa9;var _0x19bbaa;return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x47307c['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x11026e,null))['then'](function(_0x22bd18){if(_0x22bd18){_0x52daa9=_0x22bd18;_0x555d59['model']=_[_0x27a8('0x4b')](db[_0x27a8('0x121')][_0x27a8('0x33')]);_0x555d59[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x47307c[_0x27a8('0x38')]);_0x555d59[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x555d59[_0x27a8('0x37')],_0x555d59[_0x27a8('0x38')]);_0x46f5d3[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x555d59[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x47307c[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x46f5d3['attributes']=_0x46f5d3[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x46f5d3[_0x27a8('0x3b')]:_0x555d59[_0x27a8('0x37')];_0x46f5d3['order']=qs['sort'](_0x47307c[_0x27a8('0x38')][_0x27a8('0x40')]);_0x46f5d3['where']=qs['filters'](_[_0x27a8('0x41')](_0x47307c[_0x27a8('0x38')],_0x555d59[_0x27a8('0x39')]));if(_0x47307c['query'][_0x27a8('0x42')]){_0x46f5d3[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x46f5d3[_0x27a8('0x43')],{'$or':_['map'](_0x46f5d3['attributes'],function(_0xd15ec9){var _0x3a7d58={};_0x3a7d58[_0xd15ec9]={'$like':'%'+_0x47307c['query'][_0x27a8('0x42')]+'%'};return _0x3a7d58;})});}_0x46f5d3=_[_0x27a8('0x44')]({},_0x46f5d3,_0x47307c[_0x27a8('0x46')]);return _0x52daa9[_0x27a8('0x120')](_0x46f5d3);}})['then'](function(_0x337722){if(_0x337722){_0x19bbaa=_0x337722['length'];if(!_0x47307c[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x46f5d3[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x47307c[_0x27a8('0x38')]['limit']);_0x46f5d3['offset']=qs['offset'](_0x47307c[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x52daa9[_0x27a8('0x120')](_0x46f5d3);}})[_0x27a8('0x15')](function(_0x8c1c0a){if(_0x8c1c0a){return _0x8c1c0a?{'count':_0x19bbaa,'rows':_0x8c1c0a}:null;}})[_0x27a8('0x15')](respondWithResult(_0x11026e,null))[_0x27a8('0x1e')](handleError(_0x11026e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 6d6a479..3d1feaf 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 _0x3351=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x5e016b,_0x5d2b28){var _0x4fe212=function(_0x4a32be){while(--_0x4a32be){_0x5e016b['push'](_0x5e016b['shift']());}};_0x4fe212(++_0x5d2b28);}(_0x3351,0x1b4));var _0x1335=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3351[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x1335('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1335('0x1')](0x0);var events={'afterCreate':_0x1335('0x2'),'afterUpdate':_0x1335('0x3'),'afterDestroy':_0x1335('0x4')};function emitEvent(_0x21ea3d){return function(_0x173f26,_0x1f635d,_0x4d503a){ChatWebsiteEvents[_0x1335('0x5')](_0x21ea3d+':'+_0x173f26['id'],_0x173f26);ChatWebsiteEvents[_0x1335('0x5')](_0x21ea3d,_0x173f26);_0x4d503a(null);};}for(var e in events){if(events[_0x1335('0x6')](e)){var event=events[e];ChatWebsite[_0x1335('0x7')](e,emitEvent(event));}}module[_0x1335('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xc01b=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x142ea2,_0x49f3dd){var _0x181e26=function(_0x2bd79c){while(--_0x2bd79c){_0x142ea2['push'](_0x142ea2['shift']());}};_0x181e26(++_0x49f3dd);}(_0xc01b,0x65));var _0xbc01=function(_0x3ebe26,_0x4e880f){_0x3ebe26=_0x3ebe26-0x0;var _0x3e7ac7=_0xc01b[_0x3ebe26];return _0x3e7ac7;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var ChatWebsite=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc01('0x4'),'afterDestroy':_0xbc01('0x5')};function emitEvent(_0x48fa3f){return function(_0x538b32,_0x52b070,_0x17f136){ChatWebsiteEvents[_0xbc01('0x6')](_0x48fa3f+':'+_0x538b32['id'],_0x538b32);ChatWebsiteEvents['emit'](_0x48fa3f,_0x538b32);_0x17f136(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xbc01('0x7')](e,emitEvent(event));}}module[_0xbc01('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 88f1999..3e6beb9 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 _0x7e03=['api','moment','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x90653a,_0x20e4a2){var _0x55b77c=function(_0x23e3a8){while(--_0x23e3a8){_0x90653a['push'](_0x90653a['shift']());}};_0x55b77c(++_0x20e4a2);}(_0x7e03,0xa6));var _0x37e0=function(_0x2818cc,_0x1e6de9){_0x2818cc=_0x2818cc-0x0;var _0x498eab=_0x7e03[_0x2818cc];return _0x498eab;};'use strict';var _=require(_0x37e0('0x0'));var util=require(_0x37e0('0x1'));var logger=require(_0x37e0('0x2'))(_0x37e0('0x3'));var moment=require(_0x37e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37e0('0x5'));var rimraf=require(_0x37e0('0x6'));var config=require(_0x37e0('0x7'));var attributes=require(_0x37e0('0x8'));module[_0x37e0('0x9')]=function(_0x394f30,_0x41d1eb){return _0x394f30[_0x37e0('0xa')](_0x37e0('0xb'),attributes,{'tableName':_0x37e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5973=['request-promise','path','rimraf','./chatWebsite.attributes','lodash','../../config/logger','api','bluebird'];(function(_0x4909de,_0x5bc251){var _0x384a9f=function(_0x5226b4){while(--_0x5226b4){_0x4909de['push'](_0x4909de['shift']());}};_0x384a9f(++_0x5bc251);}(_0x5973,0x10c));var _0x3597=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x5973[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0x3597('0x0'));var util=require('util');var logger=require(_0x3597('0x1'))(_0x3597('0x2'));var moment=require('moment');var BPromise=require(_0x3597('0x3'));var rp=require(_0x3597('0x4'));var fs=require('fs');var path=require(_0x3597('0x5'));var rimraf=require(_0x3597('0x6'));var config=require('../../config/environment');var attributes=require(_0x3597('0x7'));module['exports']=function(_0x19e278,_0x2d25cd){return _0x19e278['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index ed1d931..0fa3e0b 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 _0x3b0a=['ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x3b0a,0x1c2));var _0xa3b0=function(_0x1fedd9,_0x5352b2){_0x1fedd9=_0x1fedd9-0x0;var _0x426583=_0x3b0a[_0x1fedd9];return _0x426583;};'use strict';var _=require(_0xa3b0('0x0'));var util=require('util');var moment=require(_0xa3b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa3b0('0x2'));var fs=require('fs');var Redis=require(_0xa3b0('0x3'));var db=require(_0xa3b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa3b0('0x5'))('rpc');var config=require(_0xa3b0('0x6'));var jayson=require(_0xa3b0('0x7'));var client=jayson[_0xa3b0('0x8')][_0xa3b0('0x9')]({'port':0x232a});config[_0xa3b0('0xa')]=_[_0xa3b0('0xb')](config[_0xa3b0('0xa')],{'host':_0xa3b0('0xc'),'port':0x18eb});var socket=require(_0xa3b0('0xd'))(new Redis(config[_0xa3b0('0xa')]));require('./chatWebsite.socket')[_0xa3b0('0xe')](socket);function respondWithRpcPromise(_0x15273f,_0x15d32b,_0xfde187){return new BPromise(function(_0x42e0b4,_0x517fef){return client[_0xa3b0('0xf')](_0x15273f,_0xfde187)[_0xa3b0('0x10')](function(_0x38efc2){logger[_0xa3b0('0x11')](_0xa3b0('0x12'),_0x15d32b,'request\x20sent');logger['debug'](_0xa3b0('0x13'),_0x15d32b,_0xa3b0('0x14'),JSON[_0xa3b0('0x15')](_0x38efc2));if(_0x38efc2[_0xa3b0('0x16')]){if(_0x38efc2[_0xa3b0('0x16')]['code']===0x1f4){logger[_0xa3b0('0x16')](_0xa3b0('0x12'),_0x15d32b,_0x38efc2[_0xa3b0('0x16')][_0xa3b0('0x17')]);return _0x517fef(_0x38efc2[_0xa3b0('0x16')][_0xa3b0('0x17')]);}logger[_0xa3b0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x15d32b,_0x38efc2[_0xa3b0('0x16')][_0xa3b0('0x17')]);return _0x42e0b4(_0x38efc2['error']['message']);}else{logger[_0xa3b0('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15d32b,_0xa3b0('0x14'));_0x42e0b4(_0x38efc2[_0xa3b0('0x18')]['message']);}})[_0xa3b0('0x19')](function(_0x4001ad){logger[_0xa3b0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x15d32b,_0x4001ad);_0x517fef(_0x4001ad);});});} \ No newline at end of file +var _0x1b5d=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1b5d,0x183));var _0xd1b5=function(_0x5a0b6c,_0x175969){_0x5a0b6c=_0x5a0b6c-0x0;var _0x539441=_0x1b5d[_0x5a0b6c];return _0x539441;};'use strict';var _=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var moment=require(_0xd1b5('0x2'));var BPromise=require(_0xd1b5('0x3'));var rs=require(_0xd1b5('0x4'));var fs=require('fs');var Redis=require(_0xd1b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1b5('0x6'));var logger=require('../../config/logger')(_0xd1b5('0x7'));var config=require(_0xd1b5('0x8'));var jayson=require(_0xd1b5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd1b5('0xa')]=_[_0xd1b5('0xb')](config['redis'],{'host':_0xd1b5('0xc'),'port':0x18eb});var socket=require(_0xd1b5('0xd'))(new Redis(config['redis']));require(_0xd1b5('0xe'))[_0xd1b5('0xf')](socket);function respondWithRpcPromise(_0x5d7dd8,_0x1c7d48,_0x41c233){return new BPromise(function(_0x53070c,_0x110800){return client[_0xd1b5('0x10')](_0x5d7dd8,_0x41c233)['then'](function(_0x9dc7fc){logger[_0xd1b5('0x11')](_0xd1b5('0x12'),_0x1c7d48,'request\x20sent');logger[_0xd1b5('0x13')](_0xd1b5('0x14'),_0x1c7d48,'request\x20sent',JSON[_0xd1b5('0x15')](_0x9dc7fc));if(_0x9dc7fc[_0xd1b5('0x16')]){if(_0x9dc7fc[_0xd1b5('0x16')][_0xd1b5('0x17')]===0x1f4){logger['error'](_0xd1b5('0x12'),_0x1c7d48,_0x9dc7fc['error']['message']);return _0x110800(_0x9dc7fc[_0xd1b5('0x16')][_0xd1b5('0x18')]);}logger[_0xd1b5('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c7d48,_0x9dc7fc[_0xd1b5('0x16')]['message']);return _0x53070c(_0x9dc7fc[_0xd1b5('0x16')]['message']);}else{logger[_0xd1b5('0x11')](_0xd1b5('0x12'),_0x1c7d48,_0xd1b5('0x19'));_0x53070c(_0x9dc7fc['result'][_0xd1b5('0x18')]);}})['catch'](function(_0x20d430){logger['error'](_0xd1b5('0x12'),_0x1c7d48,_0x20d430);_0x110800(_0x20d430);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2149b2c..7408d20 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 _0x5f21=['removeListener','register','length','chatWebsite:','save','remove'];(function(_0x254c1d,_0x7027c9){var _0x4dae64=function(_0xb8e354){while(--_0xb8e354){_0x254c1d['push'](_0x254c1d['shift']());}};_0x4dae64(++_0x7027c9);}(_0x5f21,0x1de));var _0x15f2=function(_0x4d09d3,_0x57b3fb){_0x4d09d3=_0x4d09d3-0x0;var _0x3452f9=_0x5f21[_0x4d09d3];return _0x3452f9;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x15f2('0x0'),_0x15f2('0x1'),'update'];function createListener(_0x394217,_0xbe26b7){return function(_0x3187bb){_0xbe26b7['emit'](_0x394217,_0x3187bb);};}function removeListener(_0x982e35,_0x59dd23){return function(){ChatWebsiteEvents[_0x15f2('0x2')](_0x982e35,_0x59dd23);};}exports[_0x15f2('0x3')]=function(_0x57b387){for(var _0x5920a4=0x0,_0x9d4afe=events[_0x15f2('0x4')];_0x5920a4<_0x9d4afe;_0x5920a4++){var _0x54fb02=events[_0x5920a4];var _0x56cf50=createListener(_0x15f2('0x5')+_0x54fb02,_0x57b387);ChatWebsiteEvents['on'](_0x54fb02,_0x56cf50);}}; \ No newline at end of file +var _0x5587=['update','removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x14bf27,_0x4888c5){var _0x3fbf35=function(_0x2a36e9){while(--_0x2a36e9){_0x14bf27['push'](_0x14bf27['shift']());}};_0x3fbf35(++_0x4888c5);}(_0x5587,0x1ee));var _0x7558=function(_0x3e1a3c,_0x2292fc){_0x3e1a3c=_0x3e1a3c-0x0;var _0x246da8=_0x5587[_0x3e1a3c];return _0x246da8;};'use strict';var ChatWebsiteEvents=require(_0x7558('0x0'));var events=[_0x7558('0x1'),_0x7558('0x2'),_0x7558('0x3')];function createListener(_0x22fa8e,_0x5868f9){return function(_0x47412b){_0x5868f9['emit'](_0x22fa8e,_0x47412b);};}function removeListener(_0x2a953e,_0x2afc0c){return function(){ChatWebsiteEvents[_0x7558('0x4')](_0x2a953e,_0x2afc0c);};}exports[_0x7558('0x5')]=function(_0x506fe5){for(var _0x37124e=0x0,_0x1a754d=events['length'];_0x37124e<_0x1a754d;_0x37124e++){var _0x125e34=events[_0x37124e];var _0x3026df=createListener(_0x7558('0x6')+_0x125e34,_0x506fe5);ChatWebsiteEvents['on'](_0x125e34,_0x3026df);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 9ce1e6c..6932fed 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 _0x57f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0x57f0,0x94));var _0x057f=function(_0x266e98,_0x597291){_0x266e98=_0x266e98-0x0;var _0x29e243=_0x57f0[_0x266e98];return _0x29e243;};'use strict';var multer=require(_0x057f('0x0'));var util=require(_0x057f('0x1'));var path=require(_0x057f('0x2'));var timeout=require(_0x057f('0x3'));var express=require(_0x057f('0x4'));var router=express[_0x057f('0x5')]();var fs_extra=require(_0x057f('0x6'));var auth=require(_0x057f('0x7'));var interaction=require(_0x057f('0x8'));var config=require(_0x057f('0x9'));var controller=require(_0x057f('0xa'));router[_0x057f('0xb')]('/',auth[_0x057f('0xc')](),controller[_0x057f('0xd')]);router[_0x057f('0xb')](_0x057f('0xe'),auth[_0x057f('0xc')](),controller[_0x057f('0xf')]);router[_0x057f('0xb')]('/:id',auth[_0x057f('0xc')](),controller[_0x057f('0x10')]);router[_0x057f('0xb')](_0x057f('0x11'),auth[_0x057f('0xc')](),controller[_0x057f('0x12')]);router[_0x057f('0xb')](_0x057f('0x13'),auth['isAuthenticated'](),controller[_0x057f('0x14')]);router[_0x057f('0xb')](_0x057f('0x15'),controller['getLogo']);router[_0x057f('0xb')](_0x057f('0x16'),controller[_0x057f('0x17')]);router[_0x057f('0xb')]('/:id/customer_avatar',controller[_0x057f('0x18')]);router['get'](_0x057f('0x19'),controller['getSystemAvatar']);router[_0x057f('0xb')](_0x057f('0x1a'),auth['isAuthenticated'](),controller[_0x057f('0x1b')]);router['get'](_0x057f('0x1c'),controller[_0x057f('0x1d')]);router[_0x057f('0xb')]('/:id/applications',auth[_0x057f('0xc')](),controller[_0x057f('0x1e')]);router[_0x057f('0xb')](_0x057f('0x1f'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x057f('0xb')](_0x057f('0x20'),controller['getFields']);router[_0x057f('0xb')](_0x057f('0x21'),auth[_0x057f('0xc')](),controller['getOfflineMessages']);router[_0x057f('0xb')]('/:id/users',auth[_0x057f('0xc')](),controller['getAgents']);router[_0x057f('0x22')]('/',auth['isAuthenticated'](),controller[_0x057f('0x23')]);router[_0x057f('0x22')](_0x057f('0x11'),auth[_0x057f('0xc')](),controller['addDisposition']);router[_0x057f('0x22')](_0x057f('0x13'),auth['isAuthenticated'](),controller[_0x057f('0x24')]);var upload=multer({'storage':multer[_0x057f('0x25')]({'destination':function(_0x45682b,_0x774481,_0x1e411b){_0x1e411b(null,path[_0x057f('0x26')](config[_0x057f('0x27')],_0x057f('0x28')));},'filename':function(_0x527474,_0x2c8a08,_0x4fcbdf){_0x4fcbdf(null,util[_0x057f('0x29')](_0x057f('0x2a'),Date[_0x057f('0x2b')](),_0x2c8a08[_0x057f('0x2c')]));}})});router['post'](_0x057f('0x15'),upload['single'](_0x057f('0x2d')),controller[_0x057f('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f4a70,_0x1c8f33,_0x5e7c25){_0x5e7c25(null,path[_0x057f('0x26')](config[_0x057f('0x27')],'server/files/images/avatars/'));},'filename':function(_0x47462c,_0x55ef37,_0x31e1a7){_0x31e1a7(null,util['format'](_0x057f('0x2a'),Date['now'](),_0x55ef37[_0x057f('0x2c')]));}})});router[_0x057f('0x22')](_0x057f('0x16'),upload[_0x057f('0x2f')](_0x057f('0x2d')),controller[_0x057f('0x30')]);var upload=multer({'storage':multer[_0x057f('0x25')]({'destination':function(_0x53c31d,_0x273712,_0x2d65a1){_0x2d65a1(null,path[_0x057f('0x26')](config[_0x057f('0x27')],'server/files/images/avatars/'));},'filename':function(_0x1d8059,_0xe6b4c9,_0x4ca788){_0x4ca788(null,util['format'](_0x057f('0x2a'),Date[_0x057f('0x2b')](),_0xe6b4c9['originalname']));}})});router[_0x057f('0x22')](_0x057f('0x31'),upload[_0x057f('0x2f')](_0x057f('0x2d')),controller[_0x057f('0x32')]);var upload=multer({'storage':multer[_0x057f('0x25')]({'destination':function(_0x2f17d9,_0x42ce96,_0x146721){_0x146721(null,path[_0x057f('0x26')](config[_0x057f('0x27')],_0x057f('0x33')));},'filename':function(_0x5714d6,_0x55ffe9,_0x228f07){_0x228f07(null,util[_0x057f('0x29')](_0x057f('0x2a'),Date[_0x057f('0x2b')](),_0x55ffe9[_0x057f('0x2c')]));}})});router[_0x057f('0x22')](_0x057f('0x19'),upload[_0x057f('0x2f')](_0x057f('0x2d')),controller[_0x057f('0x34')]);router[_0x057f('0x22')](_0x057f('0x35'),controller[_0x057f('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x91cdda,_0x46305a,_0x2c2b5){const _0xe11d42=path[_0x057f('0x26')](config[_0x057f('0x27')],_0x057f('0x37'),_0x057f('0x38'),_0x057f('0x39'));fs_extra[_0x057f('0x3a')](_0xe11d42,function(){_0x2c2b5(null,_0xe11d42);});},'filename':function(_0x3127a8,_0x2728f8,_0x3815ec){const _0x1247e8=_0x2728f8[_0x057f('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3f814b=path[_0x057f('0x3b')](_0x1247e8);const _0x46d9d4=Date['now']()+'-'+_0x1247e8[_0x057f('0x3c')](_0x3f814b,'')+_0x3f814b;_0x3815ec(null,_0x46d9d4);}})});router[_0x057f('0x22')]('/:id/offline',offlineUploadMulter[_0x057f('0x3d')](),controller[_0x057f('0x3e')]);router[_0x057f('0x22')](_0x057f('0x1a'),auth[_0x057f('0xc')](),controller[_0x057f('0x3f')]);router[_0x057f('0x22')](_0x057f('0x40'),auth[_0x057f('0xc')](),controller[_0x057f('0x41')]);router[_0x057f('0x22')](_0x057f('0x1f'),auth[_0x057f('0xc')](),controller[_0x057f('0x42')]);router[_0x057f('0x22')](_0x057f('0x43'),auth[_0x057f('0xc')](),controller[_0x057f('0x44')]);router[_0x057f('0x45')](_0x057f('0x46'),auth[_0x057f('0xc')](),controller[_0x057f('0x47')]);router[_0x057f('0x48')](_0x057f('0x46'),auth[_0x057f('0xc')](),controller[_0x057f('0x49')]);router[_0x057f('0x48')](_0x057f('0x11'),auth[_0x057f('0xc')](),controller[_0x057f('0x4a')]);router[_0x057f('0x48')](_0x057f('0x13'),auth['isAuthenticated'](),controller[_0x057f('0x4b')]);router[_0x057f('0x48')]('/:id/users',auth[_0x057f('0xc')](),controller['removeAgents']);module[_0x057f('0x4c')]=router; \ No newline at end of file +var _0x837e=['replace','/:id/offline','addInteraction','/:id/applications','addApplications','addAgents','put','/:id','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/system_avatar','getInteractions','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','root','server/files/images/logos/','%s-%s','originalname','/:id/logo','file','addLogo','now','single','addAvatar','join','server/files/images/avatars/','format','/:id/customer_avatar','addCustomerAvatar','diskStorage','addSystemAvatar','/:id/notify','attachments','offline-chat','ensureDir','extname'];(function(_0x18fab5,_0x26cc8f){var _0x4dedae=function(_0x4cf737){while(--_0x4cf737){_0x18fab5['push'](_0x18fab5['shift']());}};_0x4dedae(++_0x26cc8f);}(_0x837e,0x90));var _0xe837=function(_0x5200ec,_0x5401b2){_0x5200ec=_0x5200ec-0x0;var _0x27ab97=_0x837e[_0x5200ec];return _0x27ab97;};'use strict';var multer=require(_0xe837('0x0'));var util=require(_0xe837('0x1'));var path=require(_0xe837('0x2'));var timeout=require(_0xe837('0x3'));var express=require(_0xe837('0x4'));var router=express[_0xe837('0x5')]();var fs_extra=require(_0xe837('0x6'));var auth=require(_0xe837('0x7'));var interaction=require(_0xe837('0x8'));var config=require(_0xe837('0x9'));var controller=require('./chatWebsite.controller');router[_0xe837('0xa')]('/',auth[_0xe837('0xb')](),controller['index']);router['get'](_0xe837('0xc'),auth[_0xe837('0xb')](),controller[_0xe837('0xd')]);router['get']('/:id',auth[_0xe837('0xb')](),controller[_0xe837('0xe')]);router['get'](_0xe837('0xf'),auth[_0xe837('0xb')](),controller['getDispositions']);router[_0xe837('0xa')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller[_0xe837('0x11')]);router['get']('/:id/logo',controller[_0xe837('0x12')]);router[_0xe837('0xa')](_0xe837('0x13'),controller['getAvatar']);router[_0xe837('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xe837('0xa')](_0xe837('0x14'),controller['getSystemAvatar']);router[_0xe837('0xa')]('/:id/interactions',auth[_0xe837('0xb')](),controller[_0xe837('0x15')]);router[_0xe837('0xa')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0xe837('0xb')](),controller['getApplications']);router[_0xe837('0xa')](_0xe837('0x16'),auth[_0xe837('0xb')](),controller['getProactiveActions']);router[_0xe837('0xa')](_0xe837('0x17'),controller['getFields']);router[_0xe837('0xa')](_0xe837('0x18'),auth[_0xe837('0xb')](),controller[_0xe837('0x19')]);router[_0xe837('0xa')](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller['getAgents']);router[_0xe837('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe837('0x1b')](_0xe837('0xf'),auth[_0xe837('0xb')](),controller[_0xe837('0x1c')]);router[_0xe837('0x1b')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37595e,_0xdf1739,_0x353189){_0x353189(null,path['join'](config[_0xe837('0x1d')],_0xe837('0x1e')));},'filename':function(_0x128bc1,_0x59c59b,_0xc515d1){_0xc515d1(null,util['format'](_0xe837('0x1f'),Date['now'](),_0x59c59b[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x21'),upload['single'](_0xe837('0x22')),controller[_0xe837('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51fc12,_0x11cfe8,_0x18a954){_0x18a954(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3b73a0,_0x728779,_0x208e2b){_0x208e2b(null,util['format']('%s-%s',Date[_0xe837('0x24')](),_0x728779[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x13'),upload[_0xe837('0x25')](_0xe837('0x22')),controller[_0xe837('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a53ee,_0x3f96fa,_0x5e7e0d){_0x5e7e0d(null,path[_0xe837('0x27')](config['root'],_0xe837('0x28')));},'filename':function(_0x1eda6f,_0x1cc840,_0x5523b2){_0x5523b2(null,util[_0xe837('0x29')](_0xe837('0x1f'),Date[_0xe837('0x24')](),_0x1cc840[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x2a'),upload[_0xe837('0x25')](_0xe837('0x22')),controller[_0xe837('0x2b')]);var upload=multer({'storage':multer[_0xe837('0x2c')]({'destination':function(_0x38d555,_0x4fe8bd,_0xb05bca){_0xb05bca(null,path[_0xe837('0x27')](config[_0xe837('0x1d')],_0xe837('0x28')));},'filename':function(_0x533f92,_0x52f361,_0xb1a4fb){_0xb1a4fb(null,util['format'](_0xe837('0x1f'),Date[_0xe837('0x24')](),_0x52f361['originalname']));}})});router[_0xe837('0x1b')](_0xe837('0x14'),upload['single'](_0xe837('0x22')),controller[_0xe837('0x2d')]);router[_0xe837('0x1b')](_0xe837('0x2e'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xe837('0x2c')]({'destination':function(_0x2c7fa0,_0x16230c,_0x26f57c){const _0x30c0c9=path[_0xe837('0x27')](config[_0xe837('0x1d')],'server/files',_0xe837('0x2f'),_0xe837('0x30'));fs_extra[_0xe837('0x31')](_0x30c0c9,function(){_0x26f57c(null,_0x30c0c9);});},'filename':function(_0x202ca3,_0x68022e,_0x3cb680){const _0x12df1d=_0x68022e[_0xe837('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x398dc9=path[_0xe837('0x32')](_0x12df1d);const _0x33d998=Date[_0xe837('0x24')]()+'-'+_0x12df1d[_0xe837('0x33')](_0x398dc9,'')+_0x398dc9;_0x3cb680(null,_0x33d998);}})});router[_0xe837('0x1b')](_0xe837('0x34'),offlineUploadMulter['any'](),controller['offline']);router[_0xe837('0x1b')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xe837('0x35')]);router['post'](_0xe837('0x36'),auth[_0xe837('0xb')](),controller[_0xe837('0x37')]);router[_0xe837('0x1b')]('/:id/proactive_actions',auth[_0xe837('0xb')](),controller['addProactiveActions']);router['post'](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller[_0xe837('0x38')]);router[_0xe837('0x39')](_0xe837('0x3a'),auth[_0xe837('0xb')](),controller['update']);router['delete'](_0xe837('0x3a'),auth[_0xe837('0xb')](),controller[_0xe837('0x3b')]);router[_0xe837('0x3c')](_0xe837('0xf'),auth[_0xe837('0xb')](),controller[_0xe837('0x3d')]);router[_0xe837('0x3c')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller[_0xe837('0x3e')]);router[_0xe837('0x3c')](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller[_0xe837('0x3f')]);module[_0xe837('0x40')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 7b2fdc1..02bec9f 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 _0x9e0d=['isAuthenticated','beaver-logger/server','express','Router','env','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x2cde2f,_0x17ccfe){var _0x510ffb=function(_0x388dc8){while(--_0x388dc8){_0x2cde2f['push'](_0x2cde2f['shift']());}};_0x510ffb(++_0x17ccfe);}(_0x9e0d,0xf3));var _0xd9e0=function(_0x1869b8,_0x3441af){_0x1869b8=_0x1869b8-0x0;var _0xe8a423=_0x9e0d[_0x1869b8];return _0xe8a423;};var beaverLogger=require(_0xd9e0('0x0'));var express=require(_0xd9e0('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0xd9e0('0x2')]();var isProduction=config[_0xd9e0('0x3')]===_0xd9e0('0x4')||![];function clientSideLogs(_0x1e2283,_0xc1cfee,_0x1de16c){var _0x2da4cb=_0x1e2283['app'][_0xd9e0('0x5')]('client-side-logger');if(!_0x2da4cb){throw new Error(_0xd9e0('0x6'));}return beaverLogger[_0xd9e0('0x7')]({'uri':_0xd9e0('0x8'),'logger':_0x2da4cb,'enableCors':!isProduction})(_0x1e2283,_0xc1cfee,_0x1de16c);}router[_0xd9e0('0x9')](auth[_0xd9e0('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x8d16=['/client-logs','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d16,0xac));var _0x68d1=function(_0x56db77,_0x36c201){_0x56db77=_0x56db77-0x0;var _0x1536b5=_0x8d16[_0x56db77];return _0x1536b5;};var beaverLogger=require(_0x68d1('0x0'));var express=require('express');var auth=require(_0x68d1('0x1'));var config=require(_0x68d1('0x2'));var router=express[_0x68d1('0x3')]();var isProduction=config['env']===_0x68d1('0x4')||![];function clientSideLogs(_0x159c69,_0x239eb5,_0x350e3d){var _0x227d4b=_0x159c69[_0x68d1('0x5')][_0x68d1('0x6')](_0x68d1('0x7'));if(!_0x227d4b){throw new Error(_0x68d1('0x8'));}return beaverLogger[_0x68d1('0x9')]({'uri':_0x68d1('0xa'),'logger':_0x227d4b,'enableCors':!isProduction})(_0x159c69,_0x239eb5,_0x350e3d);}router[_0x68d1('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x68d1('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 3dccfb4..0b99df9 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 _0x004b=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x52c408,_0x35f852){var _0x31ad08=function(_0x42da3f){while(--_0x42da3f){_0x52c408['push'](_0x52c408['shift']());}};_0x31ad08(++_0x35f852);}(_0x004b,0x162));var _0xb004=function(_0x260fc7,_0x22448e){_0x260fc7=_0x260fc7-0x0;var _0x247891=_0x004b[_0x260fc7];return _0x247891;};'use strict';var Sequelize=require(_0xb004('0x0'));module['exports']={'name':{'type':Sequelize[_0xb004('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb004('0x2')](_0xb004('0x3'),_0xb004('0x4'),_0xb004('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb004('0x2')](_0xb004('0x6'),_0xb004('0x7'))},'data1':{'type':Sequelize[_0xb004('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xb004('0x1')],'comment':_0xb004('0x8')},'data3':{'type':Sequelize[_0xb004('0x1')],'comment':_0xb004('0x9')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xb004('0xa')],'comment':_0xb004('0xb')},'data6':{'type':Sequelize[_0xb004('0xa')],'comment':_0xb004('0xc')},'data7':{'type':Sequelize[_0xb004('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xff86=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x3dd3b9,_0xe55c40){var _0x1e70f0=function(_0x38a5a5){while(--_0x38a5a5){_0x3dd3b9['push'](_0x3dd3b9['shift']());}};_0x1e70f0(++_0xe55c40);}(_0xff86,0xff));var _0x6ff8=function(_0x360a3b,_0x10b3a6){_0x360a3b=_0x360a3b-0x0;var _0x3a8938=_0xff86[_0x360a3b];return _0x3a8938;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6ff8('0x0')](_0x6ff8('0x1'),_0x6ff8('0x2'),_0x6ff8('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6ff8('0x0')](_0x6ff8('0x4'),_0x6ff8('0x5'))},'data1':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x7')},'data2':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x8')},'data3':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x9')},'data4':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x6ff8('0xb')],'comment':_0x6ff8('0xc')},'data7':{'type':Sequelize[_0x6ff8('0xb')],'comment':_0x6ff8('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index b2af5a2..37aa1dc 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 _0x4d34=['Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','set','Content-Range','update','then','destroy','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','count','findAll','rows','service','data3','catch','show','params','includeAll','include','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','MicrosoftAzure','encryptString','create','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success'];(function(_0x3142ce,_0xd0df8b){var _0x540eb1=function(_0x69dcf5){while(--_0x69dcf5){_0x3142ce['push'](_0x3142ce['shift']());}};_0x540eb1(++_0xd0df8b);}(_0x4d34,0x121));var _0x44d3=function(_0xf7366a,_0x5a7c7a){_0xf7366a=_0xf7366a-0x0;var _0x2c422c=_0x4d34[_0xf7366a];return _0x2c422c;};'use strict';var _=require(_0x44d3('0x0'));var Redis=require(_0x44d3('0x1'));var qs=require(_0x44d3('0x2'));var encryptor=require(_0x44d3('0x3'));var config=require(_0x44d3('0x4'));var logger=require('../../config/logger')(_0x44d3('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x44d3('0x6'));config['redis']=_['defaults'](config[_0x44d3('0x7')],{'host':_0x44d3('0x8'),'port':0x18eb});var socket=require(_0x44d3('0x9'))(new Redis(config[_0x44d3('0x7')]));var redis=new Redis(config[_0x44d3('0x7')]);function respondWithStatusCode(_0x3527a1,_0x11ed14){_0x11ed14=_0x11ed14||0xcc;return function(_0x44010b){if(_0x44010b){return _0x3527a1[_0x44d3('0xa')](_0x11ed14);}return _0x3527a1[_0x44d3('0xb')](_0x11ed14)[_0x44d3('0xc')]();};}function respondWithResult(_0x2a1dae,_0x30f020){_0x30f020=_0x30f020||0xc8;return function(_0x2fbf24){if(_0x2fbf24){return _0x2a1dae['status'](_0x30f020)['json'](_0x2fbf24);}};}function respondWithFilteredResult(_0xaff257,_0x2048f3){return function(_0x47d286){if(_0x47d286){var _0x13e039=typeof _0x2048f3[_0x44d3('0xd')]===_0x44d3('0xe')&&typeof _0x2048f3['limit']===_0x44d3('0xe');var _0x126a21=_0x47d286['count'];var _0x11c2eb=_0x13e039?0x0:_0x2048f3[_0x44d3('0xd')];var _0x4fd527=_0x13e039?_0x47d286['count']:_0x2048f3['offset']+_0x2048f3[_0x44d3('0xf')];var _0x550cb4;if(_0x4fd527>=_0x126a21){_0x4fd527=_0x126a21;_0x550cb4=0xc8;}else{_0x550cb4=0xce;}_0xaff257[_0x44d3('0xb')](_0x550cb4);return _0xaff257[_0x44d3('0x10')](_0x44d3('0x11'),_0x11c2eb+'-'+_0x4fd527+'/'+_0x126a21)['json'](_0x47d286);}return null;};}function saveUpdates(_0x4aa8d5){return function(_0xcf8d21){if(_0xcf8d21){return _0xcf8d21[_0x44d3('0x12')](_0x4aa8d5)[_0x44d3('0x13')](function(_0x5e6b4f){return _0x5e6b4f;});}return null;};}function removeEntity(_0x54c58f){return function(_0x12f261){if(_0x12f261){return _0x12f261[_0x44d3('0x14')]()[_0x44d3('0x13')](function(){_0x54c58f[_0x44d3('0xb')](0xcc)[_0x44d3('0xc')]();});}};}function handleEntityNotFound(_0x189c1c){return function(_0x2d6c06){if(!_0x2d6c06){_0x189c1c[_0x44d3('0xa')](0x194);}return _0x2d6c06;};}function handleError(_0x17ad6f,_0x271e56){_0x271e56=_0x271e56||0x1f4;return function(_0x5f0244){logger['error'](_0x5f0244[_0x44d3('0x15')]);if(_0x5f0244[_0x44d3('0x16')]){delete _0x5f0244[_0x44d3('0x16')];}_0x17ad6f['status'](_0x271e56)[_0x44d3('0x17')](_0x5f0244);};}function maskClientSecret(_0x4e2e89){return _[_0x44d3('0x18')](_0x4e2e89['slice'](0x0,0x3),0x14,'*');}exports[_0x44d3('0x19')]=function(_0x4db0c2,_0x39747d){var _0x53f34c={},_0x2f2258={},_0x254f0b={'count':0x0,'rows':[]};var _0x4181aa=_[_0x44d3('0x1a')](db[_0x44d3('0x1b')][_0x44d3('0x1c')],function(_0x1ae7aa){return{'name':_0x1ae7aa['fieldName'],'type':_0x1ae7aa[_0x44d3('0x1d')]['key']};});_0x2f2258[_0x44d3('0x1e')]=_['map'](_0x4181aa,_0x44d3('0x16'));_0x2f2258['query']=_[_0x44d3('0x1f')](_0x4db0c2[_0x44d3('0x20')]);_0x2f2258[_0x44d3('0x21')]=_['intersection'](_0x2f2258[_0x44d3('0x1e')],_0x2f2258[_0x44d3('0x20')]);_0x53f34c[_0x44d3('0x22')]=_[_0x44d3('0x23')](_0x2f2258[_0x44d3('0x1e')],qs[_0x44d3('0x24')](_0x4db0c2[_0x44d3('0x20')][_0x44d3('0x24')]));_0x53f34c[_0x44d3('0x22')]=_0x53f34c['attributes'][_0x44d3('0x25')]?_0x53f34c[_0x44d3('0x22')]:_0x2f2258['model'];if(!_0x4db0c2[_0x44d3('0x20')][_0x44d3('0x26')](_0x44d3('0x27'))){_0x53f34c[_0x44d3('0xf')]=qs['limit'](_0x4db0c2[_0x44d3('0x20')][_0x44d3('0xf')]);_0x53f34c[_0x44d3('0xd')]=qs[_0x44d3('0xd')](_0x4db0c2[_0x44d3('0x20')][_0x44d3('0xd')]);}_0x53f34c[_0x44d3('0x28')]=qs['sort'](_0x4db0c2['query'][_0x44d3('0x29')]);_0x53f34c[_0x44d3('0x2a')]=qs[_0x44d3('0x21')](_[_0x44d3('0x2b')](_0x4db0c2[_0x44d3('0x20')],_0x2f2258[_0x44d3('0x21')]),_0x4181aa);if(_0x4db0c2[_0x44d3('0x20')]['filter']){_0x53f34c[_0x44d3('0x2a')]=_[_0x44d3('0x2c')](_0x53f34c[_0x44d3('0x2a')],{'$or':_[_0x44d3('0x1a')](_0x4181aa,function(_0x198696){if(_0x198696[_0x44d3('0x1d')]!=='VIRTUAL'){var _0x564a69={};_0x564a69[_0x198696[_0x44d3('0x16')]]={'$like':'%'+_0x4db0c2[_0x44d3('0x20')][_0x44d3('0x2d')]+'%'};return _0x564a69;}})});}_0x53f34c=_[_0x44d3('0x2c')]({},_0x53f34c,_0x4db0c2[_0x44d3('0x2e')]);var _0x781d02={'where':_0x53f34c[_0x44d3('0x2a')]};return db[_0x44d3('0x1b')][_0x44d3('0x2f')](_0x781d02)[_0x44d3('0x13')](function(_0x16851a){_0x254f0b[_0x44d3('0x2f')]=_0x16851a;if(_0x4db0c2[_0x44d3('0x20')]['includeAll']){_0x53f34c['include']=[{'all':!![]}];}return db[_0x44d3('0x1b')][_0x44d3('0x30')](_0x53f34c);})['then'](function(_0x170b09){_0x254f0b[_0x44d3('0x31')]=_['map'](_0x170b09,function(_0x224bdf){if(_0x224bdf[_0x44d3('0x32')]==='MicrosoftAzure'){var _0x3bac2e=encryptor['decryptString'](_0x224bdf['data3']);_0x224bdf[_0x44d3('0x33')]=maskClientSecret(_0x3bac2e);}return _0x224bdf;});return _0x254f0b;})[_0x44d3('0x13')](respondWithFilteredResult(_0x39747d,_0x53f34c))[_0x44d3('0x34')](handleError(_0x39747d,null));};exports[_0x44d3('0x35')]=function(_0x320571,_0x58e9cd){var _0x57535c={'raw':!![],'where':{'id':_0x320571[_0x44d3('0x36')]['id']}},_0x357ca2={};_0x357ca2['model']=_[_0x44d3('0x1f')](db['CloudProvider'][_0x44d3('0x1c')]);_0x357ca2[_0x44d3('0x20')]=_[_0x44d3('0x1f')](_0x320571[_0x44d3('0x20')]);_0x357ca2[_0x44d3('0x21')]=_[_0x44d3('0x23')](_0x357ca2[_0x44d3('0x1e')],_0x357ca2[_0x44d3('0x20')]);_0x57535c['attributes']=_[_0x44d3('0x23')](_0x357ca2['model'],qs['fields'](_0x320571[_0x44d3('0x20')]['fields']));_0x57535c['attributes']=_0x57535c[_0x44d3('0x22')][_0x44d3('0x25')]?_0x57535c[_0x44d3('0x22')]:_0x357ca2[_0x44d3('0x1e')];if(_0x320571[_0x44d3('0x20')][_0x44d3('0x37')]){_0x57535c[_0x44d3('0x38')]=[{'all':!![]}];}_0x57535c=_['merge']({},_0x57535c,_0x320571['options']);return db['CloudProvider'][_0x44d3('0x39')](_0x57535c)[_0x44d3('0x13')](handleEntityNotFound(_0x58e9cd,null))[_0x44d3('0x13')](function(_0x4a76d8){if(_0x4a76d8[_0x44d3('0x32')]==='MicrosoftAzure'){var _0x3f2d7a=encryptor[_0x44d3('0x3a')](_0x4a76d8[_0x44d3('0x33')]);_0x4a76d8[_0x44d3('0x33')]=maskClientSecret(_0x3f2d7a);}return _0x4a76d8;})[_0x44d3('0x13')](respondWithResult(_0x58e9cd,null))[_0x44d3('0x34')](handleError(_0x58e9cd,null));};exports['create']=function(_0x55d6f5,_0x4d0c0f){if(!_0x55d6f5[_0x44d3('0x3b')][_0x44d3('0x16')])throw new Error(_0x44d3('0x3c'));if(!_0x55d6f5[_0x44d3('0x3b')][_0x44d3('0x32')])throw new Error(_0x44d3('0x3d'));var _0x4c31ed=db[_0x44d3('0x1b')][_0x44d3('0x1c')][_0x44d3('0x32')][_0x44d3('0x3e')];if(!_0x4c31ed[_0x44d3('0x3f')](_0x55d6f5['body']['service']))throw new Error(_0x44d3('0x40')+_0x4c31ed['join'](',\x20'));if(_0x55d6f5['body'][_0x44d3('0x32')]===_0x44d3('0x41')&&_0x55d6f5[_0x44d3('0x3b')][_0x44d3('0x33')]){_0x55d6f5[_0x44d3('0x3b')]['data3']=encryptor[_0x44d3('0x42')](_0x55d6f5['body'][_0x44d3('0x33')]);}return db[_0x44d3('0x1b')][_0x44d3('0x43')](_0x55d6f5[_0x44d3('0x3b')],{})['then'](respondWithResult(_0x4d0c0f,0xc9))[_0x44d3('0x34')](handleError(_0x4d0c0f,null));};exports['update']=function(_0x24896f,_0x323599){if(_0x24896f['body']['id']){delete _0x24896f[_0x44d3('0x3b')]['id'];}return db['CloudProvider'][_0x44d3('0x39')]({'where':{'id':_0x24896f['params']['id']}})[_0x44d3('0x13')](handleEntityNotFound(_0x323599,null))[_0x44d3('0x13')](function(_0x196af2){if(_0x196af2[_0x44d3('0x32')]===_0x44d3('0x41')&&_0x24896f['body'][_0x44d3('0x33')]){_0x24896f[_0x44d3('0x3b')][_0x44d3('0x33')]=encryptor[_0x44d3('0x42')](_0x24896f[_0x44d3('0x3b')][_0x44d3('0x33')]);}return _0x196af2;})[_0x44d3('0x13')](saveUpdates(_0x24896f['body'],null))['then'](respondWithResult(_0x323599,null))[_0x44d3('0x34')](handleError(_0x323599,null));};exports[_0x44d3('0x14')]=function(_0x3f7bc9,_0x48c364){return db[_0x44d3('0x1b')][_0x44d3('0x39')]({'where':{'id':_0x3f7bc9[_0x44d3('0x36')]['id']}})[_0x44d3('0x13')](handleEntityNotFound(_0x48c364,null))['then'](removeEntity(_0x48c364,null))['catch'](handleError(_0x48c364,null));};exports[_0x44d3('0x44')]=function(_0x632e78,_0x9a2e14){return db['CloudProvider']['findOne']({'where':{'id':_0x632e78[_0x44d3('0x36')]['id']},'raw':!![]})[_0x44d3('0x13')](function(_0x4a0434){if(!_0x4a0434)return _0x9a2e14[_0x44d3('0xa')](0x194);return{'url':oauth[_0x44d3('0x45')](_0x4a0434,_0x632e78[_0x44d3('0x46')]['id'])};})[_0x44d3('0x13')](respondWithResult(_0x9a2e14,null))[_0x44d3('0x34')](handleError(_0x9a2e14,null));};exports[_0x44d3('0x47')]=function(_0x4ec5cf,_0x2ef5e7){var _0x37d1ba=_0x4ec5cf[_0x44d3('0x3b')];var _0x5c570d;var _0x25b881;if(_0x37d1ba[_0x44d3('0x48')])throw _0x37d1ba;redis['get'](_0x37d1ba[_0x44d3('0x49')])[_0x44d3('0x13')](function(_0x403803){if(!_0x403803)throw new Error(_0x44d3('0x4a'));_0x5c570d=JSON['parse'](_0x403803);var _0x59bcf5=Buffer[_0x44d3('0x4b')](_0x37d1ba[_0x44d3('0x49')],_0x44d3('0x4c'))[_0x44d3('0x4d')](_0x44d3('0x4e'));_0x25b881=JSON[_0x44d3('0x4f')](_0x59bcf5);if(!oauth['isValidIdToken'](_0x37d1ba['id_token'],_0x5c570d[_0x44d3('0x50')]))throw new Error(_0x44d3('0x51'));redis[_0x44d3('0x52')](_0x37d1ba['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x37d1ba[_0x44d3('0x53')],_0x5c570d);})[_0x44d3('0x13')](function(_0x1ab7a){_0x5c570d[_0x44d3('0x54')]=_0x1ab7a[_0x44d3('0x55')];_0x5c570d[_0x44d3('0x56')]=_0x1ab7a[_0x44d3('0x57')];return db[_0x44d3('0x1b')][_0x44d3('0x12')]({'data5':_0x5c570d[_0x44d3('0x54')],'data6':_0x5c570d[_0x44d3('0x56')]},{'where':{'id':_0x5c570d['id']}});})[_0x44d3('0x13')](function(){oauth[_0x44d3('0x58')](_0x5c570d);socket[_0x44d3('0x59')](_0x44d3('0x5a'),{'id':_0x25b881['id']});return;})[_0x44d3('0x13')](respondWithStatusCode(_0x2ef5e7,null))['catch'](function(_0x3840b1){if(_0x25b881){socket[_0x44d3('0x59')]('microsoftAuthorization:error',{'id':_0x25b881['id']});}if(!_0x5c570d){logger[_0x44d3('0x48')](_0x44d3('0x5b'),_0x3840b1);return _0x2ef5e7[_0x44d3('0xb')](0x1f4)[_0x44d3('0x17')](_0x3840b1[_0x44d3('0x5c')]);}logger[_0x44d3('0x48')](_0x44d3('0x5d'),_0x5c570d['id'],JSON[_0x44d3('0x5e')](_0x3840b1));});}; \ No newline at end of file +var _0x09a0=['find','Name\x20parameter\x20not\x20specified','body','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','sendStatus','status','end','json','offset','count','limit','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','length'];(function(_0x324642,_0x1adc4e){var _0x16d6f6=function(_0x30d3c5){while(--_0x30d3c5){_0x324642['push'](_0x324642['shift']());}};_0x16d6f6(++_0x1adc4e);}(_0x09a0,0x191));var _0x009a=function(_0x212212,_0x45c310){_0x212212=_0x212212-0x0;var _0x351f5a=_0x09a0[_0x212212];return _0x351f5a;};'use strict';var _=require(_0x009a('0x0'));var Redis=require(_0x009a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x009a('0x2'));var config=require(_0x009a('0x3'));var logger=require(_0x009a('0x4'))(_0x009a('0x5'));var db=require(_0x009a('0x6'))['db'];var oauth=require(_0x009a('0x7'));config['redis']=_[_0x009a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x009a('0x9')]);function respondWithStatusCode(_0x347559,_0x4770ce){_0x4770ce=_0x4770ce||0xcc;return function(_0x545155){if(_0x545155){return _0x347559[_0x009a('0xa')](_0x4770ce);}return _0x347559[_0x009a('0xb')](_0x4770ce)[_0x009a('0xc')]();};}function respondWithResult(_0x50e3c1,_0x31bb9d){_0x31bb9d=_0x31bb9d||0xc8;return function(_0x473512){if(_0x473512){return _0x50e3c1['status'](_0x31bb9d)[_0x009a('0xd')](_0x473512);}};}function respondWithFilteredResult(_0x318ea1,_0x5d48b3){return function(_0x5addfd){if(_0x5addfd){var _0x511b81=typeof _0x5d48b3[_0x009a('0xe')]==='undefined'&&typeof _0x5d48b3['limit']==='undefined';var _0x62b735=_0x5addfd[_0x009a('0xf')];var _0x41c02a=_0x511b81?0x0:_0x5d48b3['offset'];var _0x10897b=_0x511b81?_0x5addfd['count']:_0x5d48b3['offset']+_0x5d48b3[_0x009a('0x10')];var _0x1316f7;if(_0x10897b>=_0x62b735){_0x10897b=_0x62b735;_0x1316f7=0xc8;}else{_0x1316f7=0xce;}_0x318ea1[_0x009a('0xb')](_0x1316f7);return _0x318ea1[_0x009a('0x11')](_0x009a('0x12'),_0x41c02a+'-'+_0x10897b+'/'+_0x62b735)[_0x009a('0xd')](_0x5addfd);}return null;};}function saveUpdates(_0x1643ad){return function(_0x7d7837){if(_0x7d7837){return _0x7d7837[_0x009a('0x13')](_0x1643ad)[_0x009a('0x14')](function(_0xeccff){return _0xeccff;});}return null;};}function removeEntity(_0x10677e){return function(_0x5acc9f){if(_0x5acc9f){return _0x5acc9f[_0x009a('0x15')]()['then'](function(){_0x10677e[_0x009a('0xb')](0xcc)[_0x009a('0xc')]();});}};}function handleEntityNotFound(_0x29bfbe){return function(_0x2e7f14){if(!_0x2e7f14){_0x29bfbe['sendStatus'](0x194);}return _0x2e7f14;};}function handleError(_0xd66d51,_0x30cf18){_0x30cf18=_0x30cf18||0x1f4;return function(_0x2f0b3c){logger[_0x009a('0x16')](_0x2f0b3c['stack']);if(_0x2f0b3c[_0x009a('0x17')]){delete _0x2f0b3c[_0x009a('0x17')];}_0xd66d51[_0x009a('0xb')](_0x30cf18)[_0x009a('0x18')](_0x2f0b3c);};}function maskClientSecret(_0x527506){return _[_0x009a('0x19')](_0x527506[_0x009a('0x1a')](0x0,0x3),0x14,'*');}exports[_0x009a('0x1b')]=function(_0x5ab2a4,_0x2c8b3a){var _0x1381de={},_0x10fa70={},_0x12ff93={'count':0x0,'rows':[]};var _0x3dc4fb=_[_0x009a('0x1c')](db[_0x009a('0x1d')][_0x009a('0x1e')],function(_0x22160f){return{'name':_0x22160f[_0x009a('0x1f')],'type':_0x22160f[_0x009a('0x20')][_0x009a('0x21')]};});_0x10fa70['model']=_[_0x009a('0x1c')](_0x3dc4fb,_0x009a('0x17'));_0x10fa70[_0x009a('0x22')]=_[_0x009a('0x23')](_0x5ab2a4['query']);_0x10fa70[_0x009a('0x24')]=_[_0x009a('0x25')](_0x10fa70[_0x009a('0x26')],_0x10fa70[_0x009a('0x22')]);_0x1381de[_0x009a('0x27')]=_[_0x009a('0x25')](_0x10fa70[_0x009a('0x26')],qs['fields'](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x28')]));_0x1381de['attributes']=_0x1381de[_0x009a('0x27')]['length']?_0x1381de['attributes']:_0x10fa70[_0x009a('0x26')];if(!_0x5ab2a4[_0x009a('0x22')][_0x009a('0x29')](_0x009a('0x2a'))){_0x1381de[_0x009a('0x10')]=qs['limit'](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x10')]);_0x1381de[_0x009a('0xe')]=qs[_0x009a('0xe')](_0x5ab2a4[_0x009a('0x22')][_0x009a('0xe')]);}_0x1381de['order']=qs[_0x009a('0x2b')](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x2b')]);_0x1381de['where']=qs[_0x009a('0x24')](_['pick'](_0x5ab2a4[_0x009a('0x22')],_0x10fa70['filters']),_0x3dc4fb);if(_0x5ab2a4['query'][_0x009a('0x2c')]){_0x1381de[_0x009a('0x2d')]=_[_0x009a('0x2e')](_0x1381de['where'],{'$or':_[_0x009a('0x1c')](_0x3dc4fb,function(_0x57603e){if(_0x57603e[_0x009a('0x20')]!==_0x009a('0x2f')){var _0x2c27fc={};_0x2c27fc[_0x57603e[_0x009a('0x17')]]={'$like':'%'+_0x5ab2a4[_0x009a('0x22')][_0x009a('0x2c')]+'%'};return _0x2c27fc;}})});}_0x1381de=_[_0x009a('0x2e')]({},_0x1381de,_0x5ab2a4[_0x009a('0x30')]);var _0x37312d={'where':_0x1381de[_0x009a('0x2d')]};return db[_0x009a('0x1d')][_0x009a('0xf')](_0x37312d)[_0x009a('0x14')](function(_0x11f701){_0x12ff93[_0x009a('0xf')]=_0x11f701;if(_0x5ab2a4[_0x009a('0x22')][_0x009a('0x31')]){_0x1381de['include']=[{'all':!![]}];}return db[_0x009a('0x1d')][_0x009a('0x32')](_0x1381de);})[_0x009a('0x14')](function(_0x98012e){_0x12ff93['rows']=_[_0x009a('0x1c')](_0x98012e,function(_0x43ea5b){if(_0x43ea5b[_0x009a('0x33')]===_0x009a('0x34')){var _0x45241e=encryptor[_0x009a('0x35')](_0x43ea5b['data3']);_0x43ea5b[_0x009a('0x36')]=maskClientSecret(_0x45241e);}return _0x43ea5b;});return _0x12ff93;})[_0x009a('0x14')](respondWithFilteredResult(_0x2c8b3a,_0x1381de))[_0x009a('0x37')](handleError(_0x2c8b3a,null));};exports[_0x009a('0x38')]=function(_0x2a97a6,_0x2c4aa6){var _0x4d923f={'raw':!![],'where':{'id':_0x2a97a6[_0x009a('0x39')]['id']}},_0x40d44e={};_0x40d44e[_0x009a('0x26')]=_[_0x009a('0x23')](db['CloudProvider'][_0x009a('0x1e')]);_0x40d44e[_0x009a('0x22')]=_[_0x009a('0x23')](_0x2a97a6['query']);_0x40d44e['filters']=_[_0x009a('0x25')](_0x40d44e[_0x009a('0x26')],_0x40d44e['query']);_0x4d923f[_0x009a('0x27')]=_['intersection'](_0x40d44e[_0x009a('0x26')],qs[_0x009a('0x28')](_0x2a97a6[_0x009a('0x22')][_0x009a('0x28')]));_0x4d923f['attributes']=_0x4d923f['attributes'][_0x009a('0x3a')]?_0x4d923f[_0x009a('0x27')]:_0x40d44e[_0x009a('0x26')];if(_0x2a97a6[_0x009a('0x22')][_0x009a('0x31')]){_0x4d923f['include']=[{'all':!![]}];}_0x4d923f=_['merge']({},_0x4d923f,_0x2a97a6[_0x009a('0x30')]);return db[_0x009a('0x1d')][_0x009a('0x3b')](_0x4d923f)['then'](handleEntityNotFound(_0x2c4aa6,null))[_0x009a('0x14')](function(_0x565175){if(_0x565175[_0x009a('0x33')]==='MicrosoftAzure'){var _0x3be605=encryptor[_0x009a('0x35')](_0x565175[_0x009a('0x36')]);_0x565175[_0x009a('0x36')]=maskClientSecret(_0x3be605);}return _0x565175;})[_0x009a('0x14')](respondWithResult(_0x2c4aa6,null))['catch'](handleError(_0x2c4aa6,null));};exports['create']=function(_0x2de557,_0x1c77fc){if(!_0x2de557['body'][_0x009a('0x17')])throw new Error(_0x009a('0x3c'));if(!_0x2de557[_0x009a('0x3d')][_0x009a('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x22bfa0=db[_0x009a('0x1d')][_0x009a('0x1e')][_0x009a('0x33')][_0x009a('0x3e')];if(!_0x22bfa0['includes'](_0x2de557['body'][_0x009a('0x33')]))throw new Error(_0x009a('0x3f')+_0x22bfa0[_0x009a('0x40')](',\x20'));if(_0x2de557['body'][_0x009a('0x33')]===_0x009a('0x34')&&_0x2de557['body'][_0x009a('0x36')]){_0x2de557[_0x009a('0x3d')][_0x009a('0x36')]=encryptor['encryptString'](_0x2de557['body'][_0x009a('0x36')]);}return db[_0x009a('0x1d')]['create'](_0x2de557[_0x009a('0x3d')],{})[_0x009a('0x14')](respondWithResult(_0x1c77fc,0xc9))[_0x009a('0x37')](handleError(_0x1c77fc,null));};exports[_0x009a('0x13')]=function(_0xed6156,_0x3ddb8e){if(_0xed6156['body']['id']){delete _0xed6156[_0x009a('0x3d')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0xed6156[_0x009a('0x39')]['id']}})[_0x009a('0x14')](handleEntityNotFound(_0x3ddb8e,null))['then'](function(_0x235f2f){if(_0x235f2f[_0x009a('0x33')]===_0x009a('0x34')&&_0xed6156['body'][_0x009a('0x36')]){_0xed6156[_0x009a('0x3d')][_0x009a('0x36')]=encryptor[_0x009a('0x41')](_0xed6156[_0x009a('0x3d')][_0x009a('0x36')]);}return _0x235f2f;})[_0x009a('0x14')](saveUpdates(_0xed6156['body'],null))[_0x009a('0x14')](respondWithResult(_0x3ddb8e,null))[_0x009a('0x37')](handleError(_0x3ddb8e,null));};exports['destroy']=function(_0x45e8bb,_0x23c94b){return db[_0x009a('0x1d')]['find']({'where':{'id':_0x45e8bb[_0x009a('0x39')]['id']}})['then'](handleEntityNotFound(_0x23c94b,null))[_0x009a('0x14')](removeEntity(_0x23c94b,null))[_0x009a('0x37')](handleError(_0x23c94b,null));};exports[_0x009a('0x42')]=function(_0x42c4e1,_0x6bb874){return db[_0x009a('0x1d')]['findOne']({'where':{'id':_0x42c4e1[_0x009a('0x39')]['id']},'raw':!![]})[_0x009a('0x14')](function(_0x5d1bcd){if(!_0x5d1bcd)return _0x6bb874[_0x009a('0xa')](0x194);return{'url':oauth[_0x009a('0x43')](_0x5d1bcd,_0x42c4e1['user']['id'])};})[_0x009a('0x14')](respondWithResult(_0x6bb874,null))[_0x009a('0x37')](handleError(_0x6bb874,null));};exports[_0x009a('0x44')]=function(_0x535c63,_0x291286){var _0x13593c=_0x535c63[_0x009a('0x3d')];var _0x1ebeaa;var _0x3d0121;if(_0x13593c[_0x009a('0x16')])throw _0x13593c;redis[_0x009a('0x45')](_0x13593c['state'])[_0x009a('0x14')](function(_0x2980bc){if(!_0x2980bc)throw new Error(_0x009a('0x46'));_0x1ebeaa=JSON[_0x009a('0x47')](_0x2980bc);var _0x297e94=Buffer[_0x009a('0x48')](_0x13593c[_0x009a('0x49')],'base64')[_0x009a('0x4a')](_0x009a('0x4b'));_0x3d0121=JSON[_0x009a('0x47')](_0x297e94);if(!oauth[_0x009a('0x4c')](_0x13593c[_0x009a('0x4d')],_0x1ebeaa[_0x009a('0x4e')]))throw new Error(_0x009a('0x4f'));redis['del'](_0x13593c['state']);return oauth[_0x009a('0x50')](_0x13593c[_0x009a('0x51')],_0x1ebeaa);})[_0x009a('0x14')](function(_0x2a3a72){_0x1ebeaa[_0x009a('0x52')]=_0x2a3a72['access_token'];_0x1ebeaa[_0x009a('0x53')]=_0x2a3a72[_0x009a('0x54')];return db['CloudProvider']['update']({'data5':_0x1ebeaa['data5'],'data6':_0x1ebeaa[_0x009a('0x53')]},{'where':{'id':_0x1ebeaa['id']}});})[_0x009a('0x14')](function(){oauth[_0x009a('0x55')](_0x1ebeaa);socket['emit'](_0x009a('0x56'),{'id':_0x3d0121['id']});return;})[_0x009a('0x14')](respondWithStatusCode(_0x291286,null))['catch'](function(_0x5d9796){if(_0x3d0121){socket[_0x009a('0x57')]('microsoftAuthorization:error',{'id':_0x3d0121['id']});}if(!_0x1ebeaa){logger[_0x009a('0x16')](_0x009a('0x58'),_0x5d9796);return _0x291286[_0x009a('0xb')](0x1f4)[_0x009a('0x18')](_0x5d9796[_0x009a('0x59')]);}logger[_0x009a('0x16')](_0x009a('0x5a'),_0x1ebeaa['id'],JSON[_0x009a('0x5b')](_0x5d9796));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e9cac32..485d8b8 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 _0x7f09=['api','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x2d961e,_0x51e682){var _0xabd471=function(_0x26dbe2){while(--_0x26dbe2){_0x2d961e['push'](_0x2d961e['shift']());}};_0xabd471(++_0x51e682);}(_0x7f09,0xd9));var _0x97f0=function(_0x30d285,_0x125164){_0x30d285=_0x30d285-0x0;var _0x35f09b=_0x7f09[_0x30d285];return _0x35f09b;};'use strict';var _=require(_0x97f0('0x0'));var util=require(_0x97f0('0x1'));var logger=require(_0x97f0('0x2'))(_0x97f0('0x3'));var moment=require('moment');var BPromise=require(_0x97f0('0x4'));var rp=require(_0x97f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97f0('0x6'));var config=require(_0x97f0('0x7'));var attributes=require(_0x97f0('0x8'));module[_0x97f0('0x9')]=function(_0x446704,_0xafab84){return _0x446704[_0x97f0('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf57e=['path','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','api','moment'];(function(_0x2391d5,_0x1073a5){var _0x1387b1=function(_0x38e514){while(--_0x38e514){_0x2391d5['push'](_0x2391d5['shift']());}};_0x1387b1(++_0x1073a5);}(_0xf57e,0xa6));var _0xef57=function(_0x1066e1,_0x433c9d){_0x1066e1=_0x1066e1-0x0;var _0x83cf2f=_0xf57e[_0x1066e1];return _0x83cf2f;};'use strict';var _=require(_0xef57('0x0'));var util=require(_0xef57('0x1'));var logger=require('../../config/logger')(_0xef57('0x2'));var moment=require(_0xef57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xef57('0x4'));var rimraf=require('rimraf');var config=require(_0xef57('0x5'));var attributes=require(_0xef57('0x6'));module[_0xef57('0x7')]=function(_0x1b9591,_0x1715f1){return _0x1b9591[_0xef57('0x8')]('CloudProvider',attributes,{'tableName':_0xef57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 2d7296b..2e6a7c0 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 _0x1cf7=['randomBytes','hex','data1','response_type','join','data4','response_mode','form_post','scope','state','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','resolve','data3','CloudProvider','findOne','then','refresh_token','POST','data5','access_token','data6','catch','error','authorization_code','intervals','bind','findAll','map','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','ioredis','request-promise','util','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','data7','Outlook365','/.default','replace','{TENANT_ID}','data2','from','stringify','toString','base64'];(function(_0x310f48,_0x52fd82){var _0x14ccf7=function(_0x50339c){while(--_0x50339c){_0x310f48['push'](_0x310f48['shift']());}};_0x14ccf7(++_0x52fd82);}(_0x1cf7,0x15d));var _0x71cf=function(_0x566067,_0x3998ed){_0x566067=_0x566067-0x0;var _0x4bff03=_0x1cf7[_0x566067];return _0x4bff03;};'use strict';var _=require(_0x71cf('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x71cf('0x1'));var rp=require(_0x71cf('0x2'));var util=require(_0x71cf('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x71cf('0x4'));var logger=require('../../config/logger')(_0x71cf('0x5'));var schedule=require(_0x71cf('0x6'));var db=require(_0x71cf('0x7'))['db'];config['redis']=_[_0x71cf('0x8')](config['redis'],{'host':_0x71cf('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x71cf('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x71cf('0xb'),_0x71cf('0xc'),_0x71cf('0xd'),_0x71cf('0xe'),_0x71cf('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x71cf('0x10')],'Dynamics365':[_0x71cf('0xb'),_0x71cf('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x71cf('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3f24ca){var _0x3ef07d=_['map'](AZURE_AUTH_SCOPES[_0x3f24ca[_0x71cf('0x12')]]);if(_0x3f24ca[_0x71cf('0x12')]===_0x71cf('0x13'))_0x3ef07d[_0x71cf('0x14')](_0x3f24ca[_0x71cf('0x15')]+'/.default');return _0x3ef07d['join']('\x20');}function getAccessTokenScope(_0x1fb605){if(_0x1fb605[_0x71cf('0x12')]===_0x71cf('0x16'))return _0x71cf('0xf');if(_0x1fb605[_0x71cf('0x12')]===_0x71cf('0x13'))return _0x1fb605[_0x71cf('0x15')]+_0x71cf('0x17');}function generateMicrosoftAuthorizationUrl(_0x2586eb,_0x2f5bfe){var _0x3949d0=MICROSOFT_AUTH_URL[_0x71cf('0x18')](_0x71cf('0x19'),_0x2586eb[_0x71cf('0x1a')]);var _0x53d661=['code','id_token'];var _0x1fb476=Buffer[_0x71cf('0x1b')](JSON[_0x71cf('0x1c')]({'id':_0x2f5bfe}))[_0x71cf('0x1d')](_0x71cf('0x1e'));var _0x4fb019=crypto[_0x71cf('0x1f')](0x10)[_0x71cf('0x1d')](_0x71cf('0x20'));var _0x1ceeb9=getAuthorizationScopes(_0x2586eb);var _0x41bb57=[{'key':'client_id','value':_0x2586eb[_0x71cf('0x21')]},{'key':_0x71cf('0x22'),'value':encodeURIComponent(_0x53d661[_0x71cf('0x23')]('\x20'))},{'key':'redirect_uri','value':_0x2586eb[_0x71cf('0x24')]},{'key':_0x71cf('0x25'),'value':_0x71cf('0x26')},{'key':_0x71cf('0x27'),'value':encodeURIComponent(_0x1ceeb9)},{'key':_0x71cf('0x28'),'value':_0x1fb476},{'key':'nonce','value':_0x4fb019},{'key':_0x71cf('0x29'),'value':_0x71cf('0x2a')}];var _0x553752=_0x3949d0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x41bb57,function(_0x72c26d){return _0x72c26d[_0x71cf('0x2b')]+'='+_0x72c26d[_0x71cf('0x2c')];})[_0x71cf('0x23')]('&');_0x2586eb[_0x71cf('0x2d')]={'issuer':_0x3949d0['replace'](_0x71cf('0x2e'),''),'audience':_0x2586eb['data1'],'state':_0x1fb476,'nonce':_0x4fb019};redis['set'](_0x1fb476,JSON[_0x71cf('0x1c')](_0x2586eb));return _0x553752;}function isValidIdToken(_0x168fed,_0x4cf61c){try{var _0x5e6ea8=jwt[_0x71cf('0x2f')](_0x168fed,{'complete':!![]});var _0xf820=_0x5e6ea8[_0x71cf('0x30')];if(_0xf820[_0x71cf('0x31')]!==_0x4cf61c[_0x71cf('0x32')])return![];if(_0xf820[_0x71cf('0x33')]!==_0x4cf61c[_0x71cf('0x34')])return![];if(_0xf820[_0x71cf('0x35')]!==_0x4cf61c['nonce'])return![];if(moment()[_0x71cf('0x36')](moment[_0x71cf('0x37')](_0xf820['exp'])))return![];return!![];}catch(_0x21142b){throw _0x21142b;}}function refreshOauth2MicrosoftAccessToken(_0x3b3182){return Promise[_0x71cf('0x38')]()['then'](function(){if(_0x3b3182[_0x71cf('0x39')])return _0x3b3182;return db[_0x71cf('0x3a')][_0x71cf('0x3b')]({'where':{'id':_0x3b3182['id']},'raw':!![]});})[_0x71cf('0x3c')](function(_0xf36153){var _0x4728fe={'grant_type':_0x71cf('0x3d'),'refresh_token':_0xf36153['data6'],'scope':getAccessTokenScope(_0xf36153),'redirect_uri':_0xf36153['data4'],'client_id':_0xf36153['data1'],'client_secret':encryptor['decryptString'](_0xf36153['data3'])};var _0x4694c6={'method':_0x71cf('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x71cf('0x18')]('{TENANT_ID}',_0xf36153[_0x71cf('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4728fe,'json':!![]};return rp(_0x4694c6);})[_0x71cf('0x3c')](function(_0x42056a){_0x3b3182[_0x71cf('0x3f')]=_0x42056a[_0x71cf('0x40')];_0x3b3182[_0x71cf('0x41')]=_0x42056a['refresh_token'];return db[_0x71cf('0x3a')]['update']({'data5':_0x3b3182[_0x71cf('0x3f')],'data6':_0x3b3182[_0x71cf('0x41')]},{'where':{'id':_0x3b3182['id']}});})[_0x71cf('0x3c')](function(){return _0x3b3182;})[_0x71cf('0x42')](function(_0xb07acb){logger[_0x71cf('0x43')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x3b3182['id'],_0xb07acb);});}function getOauth2MicrosoftAccessToken(_0xaa00e,_0xe0654){var _0x2b746c={'grant_type':_0x71cf('0x44'),'code':_0xaa00e,'scope':getAccessTokenScope(_0xe0654),'redirect_uri':_0xe0654[_0x71cf('0x24')],'client_id':_0xe0654[_0x71cf('0x21')],'client_secret':encryptor['decryptString'](_0xe0654[_0x71cf('0x39')])};var _0x21cfae={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x71cf('0x18')](_0x71cf('0x19'),_0xe0654[_0x71cf('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2b746c,'json':!![]};return rp(_0x21cfae);}function startRefreshInterval(_0x315d36){var _0x48e9a0=schedule[_0x71cf('0x45')];if(_0x48e9a0[_0x315d36['id']])clearInterval(_0x48e9a0[_0x315d36['id']]);_0x48e9a0[_0x315d36['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x71cf('0x46')](this,{'id':_0x315d36['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x71cf('0x45')]=_0x48e9a0;}function startAllRefreshIntervals(){return db[_0x71cf('0x3a')][_0x71cf('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x71cf('0x3c')](function(_0x431335){var _0x37ff99=_0x431335[_0x71cf('0x48')](function(_0x4f02ea){return refreshOauth2MicrosoftAccessToken(_0x4f02ea)[_0x71cf('0x3c')](function(_0x193c26){startRefreshInterval(_0x193c26);});});return Promise['all'](_0x37ff99);})[_0x71cf('0x42')](function(_0x4ecc6f){var _0xbb0118=_0x4ecc6f?util[_0x71cf('0x49')](_0x4ecc6f,{'showHidden':![],'depth':null}):'';logger['error'](_0x71cf('0x4a'),_0xbb0118);});}module[_0x71cf('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x0e93=['client_id','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key','value','oauth2/','data1','decode','aud','audience','unix','resolve','findOne','then','data6','decryptString','data3','POST','data5','access_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data2','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','from','stringify','toString','base64','randomBytes'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0e93,0x1e7));var _0x30e9=function(_0x38f953,_0x3f66bd){_0x38f953=_0x38f953-0x0;var _0x4a7531=_0x0e93[_0x38f953];return _0x4a7531;};'use strict';var _=require('lodash');var crypto=require(_0x30e9('0x0'));var jwt=require(_0x30e9('0x1'));var moment=require(_0x30e9('0x2'));var Redis=require(_0x30e9('0x3'));var rp=require(_0x30e9('0x4'));var util=require(_0x30e9('0x5'));var encryptor=require(_0x30e9('0x6'));var config=require(_0x30e9('0x7'));var logger=require('../../config/logger')(_0x30e9('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x30e9('0x9'))['db'];config['redis']=_[_0x30e9('0xa')](config[_0x30e9('0xb')],{'host':_0x30e9('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x30e9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x30e9('0xe'),_0x30e9('0xf'),_0x30e9('0x10'),_0x30e9('0x11'),_0x30e9('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x30e9('0x13')],'Dynamics365':[_0x30e9('0xe'),_0x30e9('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x30e9('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x30e9('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x580044){var _0x24eace=_[_0x30e9('0x16')](AZURE_AUTH_SCOPES[_0x580044[_0x30e9('0x17')]]);if(_0x580044[_0x30e9('0x17')]===_0x30e9('0x18'))_0x24eace[_0x30e9('0x19')](_0x580044[_0x30e9('0x1a')]+_0x30e9('0x1b'));return _0x24eace[_0x30e9('0x1c')]('\x20');}function getAccessTokenScope(_0x3128f5){if(_0x3128f5[_0x30e9('0x17')]===_0x30e9('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3128f5[_0x30e9('0x17')]===_0x30e9('0x18'))return _0x3128f5[_0x30e9('0x1a')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xcabd73,_0x99cfc2){var _0x2496e3=MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0xcabd73['data2']);var _0x264a84=[_0x30e9('0x20'),'id_token'];var _0x34d9f2=Buffer[_0x30e9('0x21')](JSON[_0x30e9('0x22')]({'id':_0x99cfc2}))[_0x30e9('0x23')](_0x30e9('0x24'));var _0x1111d7=crypto[_0x30e9('0x25')](0x10)[_0x30e9('0x23')]('hex');var _0x6e7e51=getAuthorizationScopes(_0xcabd73);var _0x2f7a83=[{'key':_0x30e9('0x26'),'value':_0xcabd73['data1']},{'key':_0x30e9('0x27'),'value':encodeURIComponent(_0x264a84[_0x30e9('0x1c')]('\x20'))},{'key':_0x30e9('0x28'),'value':_0xcabd73[_0x30e9('0x29')]},{'key':_0x30e9('0x2a'),'value':'form_post'},{'key':_0x30e9('0x2b'),'value':encodeURIComponent(_0x6e7e51)},{'key':_0x30e9('0x2c'),'value':_0x34d9f2},{'key':_0x30e9('0x2d'),'value':_0x1111d7},{'key':_0x30e9('0x2e'),'value':_0x30e9('0x2f')}];var _0x2ed3e7=_0x2496e3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x30e9('0x16')](_0x2f7a83,function(_0x328818){return _0x328818[_0x30e9('0x30')]+'='+_0x328818[_0x30e9('0x31')];})[_0x30e9('0x1c')]('&');_0xcabd73['oauth2Claims']={'issuer':_0x2496e3[_0x30e9('0x1e')](_0x30e9('0x32'),''),'audience':_0xcabd73[_0x30e9('0x33')],'state':_0x34d9f2,'nonce':_0x1111d7};redis['set'](_0x34d9f2,JSON['stringify'](_0xcabd73));return _0x2ed3e7;}function isValidIdToken(_0x3f27cb,_0x59ce56){try{var _0x58fa30=jwt[_0x30e9('0x34')](_0x3f27cb,{'complete':!![]});var _0x2cfde3=_0x58fa30['payload'];if(_0x2cfde3['iss']!==_0x59ce56['issuer'])return![];if(_0x2cfde3[_0x30e9('0x35')]!==_0x59ce56[_0x30e9('0x36')])return![];if(_0x2cfde3[_0x30e9('0x2d')]!==_0x59ce56[_0x30e9('0x2d')])return![];if(moment()['isAfter'](moment[_0x30e9('0x37')](_0x2cfde3['exp'])))return![];return!![];}catch(_0x403716){throw _0x403716;}}function refreshOauth2MicrosoftAccessToken(_0x2232c0){return Promise[_0x30e9('0x38')]()['then'](function(){if(_0x2232c0['data3'])return _0x2232c0;return db['CloudProvider'][_0x30e9('0x39')]({'where':{'id':_0x2232c0['id']},'raw':!![]});})[_0x30e9('0x3a')](function(_0x526103){var _0x2e74f6={'grant_type':'refresh_token','refresh_token':_0x526103[_0x30e9('0x3b')],'scope':getAccessTokenScope(_0x526103),'redirect_uri':_0x526103[_0x30e9('0x29')],'client_id':_0x526103[_0x30e9('0x33')],'client_secret':encryptor[_0x30e9('0x3c')](_0x526103[_0x30e9('0x3d')])};var _0xfac8bc={'method':_0x30e9('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0x526103['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e74f6,'json':!![]};return rp(_0xfac8bc);})[_0x30e9('0x3a')](function(_0x325409){_0x2232c0[_0x30e9('0x3f')]=_0x325409[_0x30e9('0x40')];_0x2232c0[_0x30e9('0x3b')]=_0x325409['refresh_token'];return db[_0x30e9('0x41')]['update']({'data5':_0x2232c0[_0x30e9('0x3f')],'data6':_0x2232c0[_0x30e9('0x3b')]},{'where':{'id':_0x2232c0['id']}});})[_0x30e9('0x3a')](function(){return _0x2232c0;})[_0x30e9('0x42')](function(_0x350c99){logger[_0x30e9('0x43')](_0x30e9('0x44'),_0x2232c0['id'],_0x350c99);});}function getOauth2MicrosoftAccessToken(_0x203ca0,_0x3fa448){var _0x44997f={'grant_type':_0x30e9('0x45'),'code':_0x203ca0,'scope':getAccessTokenScope(_0x3fa448),'redirect_uri':_0x3fa448[_0x30e9('0x29')],'client_id':_0x3fa448[_0x30e9('0x33')],'client_secret':encryptor['decryptString'](_0x3fa448[_0x30e9('0x3d')])};var _0x3d7335={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0x3fa448[_0x30e9('0x46')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x44997f,'json':!![]};return rp(_0x3d7335);}function startRefreshInterval(_0x149a50){var _0x280a92=schedule['intervals'];if(_0x280a92[_0x149a50['id']])clearInterval(_0x280a92[_0x149a50['id']]);_0x280a92[_0x149a50['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x149a50['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x280a92;}function startAllRefreshIntervals(){return db[_0x30e9('0x41')][_0x30e9('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x30e9('0x3a')](function(_0x340ed7){var _0x62ed43=_0x340ed7[_0x30e9('0x16')](function(_0x4d0df1){return refreshOauth2MicrosoftAccessToken(_0x4d0df1)['then'](function(_0x2813a1){startRefreshInterval(_0x2813a1);});});return Promise[_0x30e9('0x48')](_0x62ed43);})[_0x30e9('0x42')](function(_0xe776b4){var _0xb5f0de=_0xe776b4?util[_0x30e9('0x49')](_0xe776b4,{'showHidden':![],'depth':null}):'';logger[_0x30e9('0x43')](_0x30e9('0x4a'),_0xb5f0de);});}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 5ab3109..bbfe184 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 _0x9e63=['../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x9e63,0x65));var _0x39e6=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x9e63[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var moment=require(_0x39e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e6('0x3'));var fs=require('fs');var Redis=require(_0x39e6('0x4'));var db=require(_0x39e6('0x5'))['db'];var utils=require(_0x39e6('0x6'));var logger=require(_0x39e6('0x7'))(_0x39e6('0x8'));var config=require(_0x39e6('0x9'));var jayson=require(_0x39e6('0xa'));var client=jayson['client'][_0x39e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2224,_0x3f2fa2,_0x554392){return new BPromise(function(_0x21938f,_0xddc291){return client['request'](_0x3c2224,_0x554392)[_0x39e6('0xc')](function(_0x4ee158){logger['info'](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));logger[_0x39e6('0xf')](_0x39e6('0x10'),_0x3f2fa2,_0x39e6('0xe'),JSON['stringify'](_0x4ee158));if(_0x4ee158['error']){if(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x12')]===0x1f4){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158[_0x39e6('0x11')]['message']);return _0xddc291(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158['error']['message']);return _0x21938f(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}else{logger[_0x39e6('0x14')](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));_0x21938f(_0x4ee158['result'][_0x39e6('0x13')]);}})[_0x39e6('0x15')](function(_0x32ad13){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x32ad13);_0xddc291(_0x32ad13);});});} \ No newline at end of file +var _0x3d3d=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1e729a,_0x52f00e){var _0x3a8044=function(_0x303fa0){while(--_0x303fa0){_0x1e729a['push'](_0x1e729a['shift']());}};_0x3a8044(++_0x52f00e);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var moment=require(_0xd3d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3d3('0x2'));var fs=require('fs');var Redis=require(_0xd3d3('0x3'));var db=require(_0xd3d3('0x4'))['db'];var utils=require(_0xd3d3('0x5'));var logger=require(_0xd3d3('0x6'))(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var jayson=require(_0xd3d3('0x9'));var client=jayson[_0xd3d3('0xa')][_0xd3d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa421,_0x1f47fe,_0x263940){return new BPromise(function(_0x3fe58e,_0x2ed96f){return client['request'](_0x4aa421,_0x263940)[_0xd3d3('0xc')](function(_0x412054){logger[_0xd3d3('0xd')](_0xd3d3('0xe'),_0x1f47fe,'request\x20sent');logger[_0xd3d3('0xf')](_0xd3d3('0x10'),_0x1f47fe,_0xd3d3('0x11'),JSON[_0xd3d3('0x12')](_0x412054));if(_0x412054[_0xd3d3('0x13')]){if(_0x412054[_0xd3d3('0x13')]['code']===0x1f4){logger[_0xd3d3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1f47fe,_0x412054['error']['message']);return _0x2ed96f(_0x412054[_0xd3d3('0x13')]['message']);}logger['error'](_0xd3d3('0xe'),_0x1f47fe,_0x412054[_0xd3d3('0x13')]['message']);return _0x3fe58e(_0x412054[_0xd3d3('0x13')]['message']);}else{logger['info'](_0xd3d3('0xe'),_0x1f47fe,_0xd3d3('0x11'));_0x3fe58e(_0x412054[_0xd3d3('0x14')][_0xd3d3('0x15')]);}})[_0xd3d3('0x16')](function(_0x5c3462){logger[_0xd3d3('0x13')](_0xd3d3('0xe'),_0x1f47fe,_0x5c3462);_0x2ed96f(_0x5c3462);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 2396505..6ddeaf8 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(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23793e,_0x275a38){_0x23793e=_0x23793e-0x0;var _0xa8c46f=_0x5f2f[_0x23793e];return _0xa8c46f;};'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(_0x2192d5,_0x58909a){var _0x2e7eb9=function(_0x48c970){while(--_0x48c970){_0x2192d5['push'](_0x2192d5['shift']());}};_0x2e7eb9(++_0x58909a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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 3b6081a..b0ccce4 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 _0x684d=['exports','STRING','name'];(function(_0x400e46,_0x525bbf){var _0x17fa5f=function(_0x28f0f8){while(--_0x28f0f8){_0x400e46['push'](_0x400e46['shift']());}};_0x17fa5f(++_0x525bbf);}(_0x684d,0x174));var _0xd684=function(_0x48ed22,_0x526605){_0x48ed22=_0x48ed22-0x0;var _0x1782d6=_0x684d[_0x48ed22];return _0x1782d6;};'use strict';var Sequelize=require('sequelize');module[_0xd684('0x0')]={'name':{'type':Sequelize[_0xd684('0x1')],'unique':_0xd684('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xd684('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd684('0x1')]},'fax':{'type':Sequelize[_0xd684('0x1')]},'type':{'type':Sequelize[_0xd684('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd684('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd684('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd684('0x1')]},'sStreet':{'type':Sequelize[_0xd684('0x1')]},'sPostalCode':{'type':Sequelize[_0xd684('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd684('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd0a7=['STRING'];(function(_0x25fd8b,_0x4f6771){var _0x2ebe10=function(_0x13cd93){while(--_0x13cd93){_0x25fd8b['push'](_0x25fd8b['shift']());}};_0x2ebe10(++_0x4f6771);}(_0xd0a7,0x11b));var _0x7d0a=function(_0x4b54f8,_0x419eca){_0x4b54f8=_0x4b54f8-0x0;var _0x3c1443=_0xd0a7[_0x4b54f8];return _0x3c1443;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d0a('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7d0a('0x0')]},'companyId':{'type':Sequelize[_0x7d0a('0x0')]},'website':{'type':Sequelize[_0x7d0a('0x0')]},'phone':{'type':Sequelize[_0x7d0a('0x0')]},'fax':{'type':Sequelize[_0x7d0a('0x0')]},'type':{'type':Sequelize[_0x7d0a('0x0')]},'street':{'type':Sequelize[_0x7d0a('0x0')]},'postalCode':{'type':Sequelize[_0x7d0a('0x0')]},'city':{'type':Sequelize[_0x7d0a('0x0')]},'country':{'type':Sequelize[_0x7d0a('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7d0a('0x0')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7d0a('0x0')]},'sCity':{'type':Sequelize[_0x7d0a('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7d0a('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 0620cc1..113f499 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 _0x9280=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','filter','options','includeAll','include','catch','show','params','rawAttributes','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x5d7754,_0x1e16d4){var _0x2d60c5=function(_0xb09554){while(--_0xb09554){_0x5d7754['push'](_0x5d7754['shift']());}};_0x2d60c5(++_0x1e16d4);}(_0x9280,0x196));var _0x0928=function(_0x2c4c97,_0x590f10){_0x2c4c97=_0x2c4c97-0x0;var _0x472337=_0x9280[_0x2c4c97];return _0x472337;};'use strict';var emlformat=require(_0x0928('0x0'));var rimraf=require(_0x0928('0x1'));var zipdir=require(_0x0928('0x2'));var jsonpatch=require(_0x0928('0x3'));var rp=require('request-promise');var moment=require(_0x0928('0x4'));var BPromise=require(_0x0928('0x5'));var Mustache=require(_0x0928('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0928('0x7'));var csv=require(_0x0928('0x8'));var ejs=require(_0x0928('0x9'));var fs=require('fs');var fs_extra=require(_0x0928('0xa'));var _=require('lodash');var squel=require(_0x0928('0xb'));var crypto=require(_0x0928('0xc'));var jsforce=require(_0x0928('0xd'));var deskjs=require(_0x0928('0xe'));var toCsv=require(_0x0928('0x8'));var querystring=require(_0x0928('0xf'));var Papa=require(_0x0928('0x10'));var Redis=require('ioredis');var authService=require(_0x0928('0x11'));var qs=require(_0x0928('0x12'));var as=require(_0x0928('0x13'));var hardwareService=require(_0x0928('0x14'));var logger=require(_0x0928('0x15'))(_0x0928('0x16'));var utils=require(_0x0928('0x17'));var config=require(_0x0928('0x18'));var licenseUtil=require(_0x0928('0x19'));var db=require(_0x0928('0x1a'))['db'];function respondWithStatusCode(_0x16a62b,_0x54c2d4){_0x54c2d4=_0x54c2d4||0xcc;return function(_0xdbb2f7){if(_0xdbb2f7){return _0x16a62b['sendStatus'](_0x54c2d4);}return _0x16a62b['status'](_0x54c2d4)['end']();};}function respondWithResult(_0x33aa7a,_0x4f92e6){_0x4f92e6=_0x4f92e6||0xc8;return function(_0x3a5fe5){if(_0x3a5fe5){return _0x33aa7a[_0x0928('0x1b')](_0x4f92e6)[_0x0928('0x1c')](_0x3a5fe5);}};}function respondWithFilteredResult(_0x2da57d,_0x23c5da){return function(_0x5dfa1c){if(_0x5dfa1c){var _0x596705=typeof _0x23c5da[_0x0928('0x1d')]==='undefined'&&typeof _0x23c5da[_0x0928('0x1e')]==='undefined';var _0x49392b=_0x5dfa1c[_0x0928('0x1f')];var _0xac6831=_0x596705?0x0:_0x23c5da['offset'];var _0x2dadf1=_0x596705?_0x5dfa1c[_0x0928('0x1f')]:_0x23c5da[_0x0928('0x1d')]+_0x23c5da[_0x0928('0x1e')];var _0xd07617;if(_0x2dadf1>=_0x49392b){_0x2dadf1=_0x49392b;_0xd07617=0xc8;}else{_0xd07617=0xce;}_0x2da57d[_0x0928('0x1b')](_0xd07617);return _0x2da57d[_0x0928('0x20')]('Content-Range',_0xac6831+'-'+_0x2dadf1+'/'+_0x49392b)[_0x0928('0x1c')](_0x5dfa1c);}return null;};}function patchUpdates(_0xf16099){return function(_0x392cbc){try{jsonpatch['apply'](_0x392cbc,_0xf16099,!![]);}catch(_0x8e386c){return BPromise['reject'](_0x8e386c);}return _0x392cbc[_0x0928('0x21')]();};}function saveUpdates(_0x9886d,_0x284fa2){return function(_0x5ed97c){if(_0x5ed97c){return _0x5ed97c[_0x0928('0x22')](_0x9886d)[_0x0928('0x23')](function(_0x59b689){return _0x59b689;});}return null;};}function removeEntity(_0x5e67dc,_0x1187c1){return function(_0x33322f){if(_0x33322f){return _0x33322f[_0x0928('0x24')]()[_0x0928('0x23')](function(){var _0x316f91=_0x33322f[_0x0928('0x25')]({'plain':!![]});var _0x5d8121=_0x0928('0x26');return db[_0x0928('0x27')][_0x0928('0x24')]({'where':{'type':_0x5d8121,'resourceId':_0x316f91['id']}})[_0x0928('0x23')](function(){return _0x33322f;});})[_0x0928('0x23')](function(){_0x5e67dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ecae9,_0x2cd781){return function(_0x217196){if(!_0x217196){_0x4ecae9[_0x0928('0x28')](0x194);}return _0x217196;};}function handleError(_0x5f48fa,_0x394775){_0x394775=_0x394775||0x1f4;return function(_0x496343){logger['error'](_0x496343[_0x0928('0x29')]);if(_0x496343['name']){delete _0x496343['name'];}_0x5f48fa['status'](_0x394775)[_0x0928('0x2a')](_0x496343);};}exports[_0x0928('0x2b')]=function(_0x2ae2d4,_0x1acee2){var _0x1c8984={},_0x48a9d5={},_0x3c5abd={'count':0x0,'rows':[]};return db[_0x0928('0x2c')][_0x0928('0x2d')]()['then'](function(_0x1fc084){_0x48a9d5[_0x0928('0x2e')]=_[_0x0928('0x2f')](_0x1fc084);_0x48a9d5[_0x0928('0x30')]=_[_0x0928('0x2f')](_0x2ae2d4[_0x0928('0x30')]);_0x48a9d5['filters']=_[_0x0928('0x31')](_0x48a9d5['model'],_0x48a9d5[_0x0928('0x30')]);_0x1c8984[_0x0928('0x32')]=_[_0x0928('0x31')](_0x48a9d5[_0x0928('0x2e')],qs[_0x0928('0x33')](_0x2ae2d4[_0x0928('0x30')]['fields']));_0x1c8984[_0x0928('0x32')]=_0x1c8984['attributes']['length']?_0x1c8984[_0x0928('0x32')]:_0x48a9d5[_0x0928('0x2e')];if(!_0x2ae2d4[_0x0928('0x30')][_0x0928('0x34')](_0x0928('0x35'))){_0x1c8984[_0x0928('0x1e')]=qs[_0x0928('0x1e')](_0x2ae2d4[_0x0928('0x30')][_0x0928('0x1e')]);_0x1c8984[_0x0928('0x1d')]=qs[_0x0928('0x1d')](_0x2ae2d4['query'][_0x0928('0x1d')]);}_0x1c8984[_0x0928('0x36')]=qs[_0x0928('0x37')](_0x2ae2d4['query'][_0x0928('0x37')]);_0x1c8984[_0x0928('0x38')]=qs['filters'](_[_0x0928('0x39')](_0x2ae2d4[_0x0928('0x30')],_0x48a9d5[_0x0928('0x3a')]),_0x1fc084);if(_0x2ae2d4[_0x0928('0x30')]['filter']){_0x1c8984[_0x0928('0x38')]=_[_0x0928('0x3b')](_0x1c8984['where'],{'$or':_[_0x0928('0x3c')](_0x1c8984[_0x0928('0x32')],function(_0x30c0d7){var _0x2c5044={};_0x2c5044[_0x30c0d7]={'$like':'%'+_0x2ae2d4[_0x0928('0x30')][_0x0928('0x3d')]+'%'};return _0x2c5044;})});}_0x1c8984=_[_0x0928('0x3b')]({},_0x1c8984,_0x2ae2d4[_0x0928('0x3e')]);var _0x1330dd={'where':_0x1c8984[_0x0928('0x38')]};return db[_0x0928('0x2c')]['count'](_0x1330dd)[_0x0928('0x23')](function(_0x2446ee){_0x3c5abd[_0x0928('0x1f')]=_0x2446ee;if(_0x2ae2d4[_0x0928('0x30')][_0x0928('0x3f')]){_0x1c8984[_0x0928('0x40')]=[{'all':!![]}];}return db[_0x0928('0x2c')]['findAll'](_0x1c8984);})[_0x0928('0x23')](function(_0x2d640c){_0x3c5abd['rows']=_0x2d640c;return _0x3c5abd;})[_0x0928('0x23')](respondWithFilteredResult(_0x1acee2,_0x1c8984))['catch'](handleError(_0x1acee2,null));})[_0x0928('0x41')](handleError(_0x1acee2,null));};exports[_0x0928('0x42')]=function(_0x39e5ec,_0xdcba36){var _0x40cf25={'raw':![],'where':{'id':_0x39e5ec[_0x0928('0x43')]['id']}},_0x32f20f={};_0x32f20f[_0x0928('0x2e')]=_[_0x0928('0x2f')](db['CmCompany'][_0x0928('0x44')]);_0x32f20f['query']=_[_0x0928('0x2f')](_0x39e5ec['query']);_0x32f20f[_0x0928('0x3a')]=_[_0x0928('0x31')](_0x32f20f[_0x0928('0x2e')],_0x32f20f[_0x0928('0x30')]);_0x40cf25[_0x0928('0x32')]=_[_0x0928('0x31')](_0x32f20f[_0x0928('0x2e')],qs[_0x0928('0x33')](_0x39e5ec[_0x0928('0x30')]['fields']));_0x40cf25[_0x0928('0x32')]=_0x40cf25[_0x0928('0x32')][_0x0928('0x45')]?_0x40cf25[_0x0928('0x32')]:_0x32f20f[_0x0928('0x2e')];if(_0x39e5ec['query'][_0x0928('0x3f')]){_0x40cf25[_0x0928('0x40')]=[{'all':!![]}];}_0x40cf25=_[_0x0928('0x3b')]({},_0x40cf25,_0x39e5ec[_0x0928('0x3e')]);return db[_0x0928('0x2c')]['find'](_0x40cf25)['then'](handleEntityNotFound(_0xdcba36,null))[_0x0928('0x23')](respondWithResult(_0xdcba36,null))[_0x0928('0x41')](handleError(_0xdcba36,null));};exports[_0x0928('0x46')]=function(_0x5bfdcb,_0x232122){return db[_0x0928('0x2c')][_0x0928('0x46')](_0x5bfdcb[_0x0928('0x47')],{})[_0x0928('0x23')](function(_0x3a9d65){var _0x3c5e5b=_0x5bfdcb[_0x0928('0x48')][_0x0928('0x25')]({'plain':!![]});if(!_0x3c5e5b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c5e5b[_0x0928('0x49')]==='user'){var _0x35dd08=_0x3a9d65['get']({'plain':!![]});var _0x59b9c7=_0x0928('0x26');return db[_0x0928('0x4a')][_0x0928('0x4b')]({'where':{'name':_0x59b9c7,'userProfileId':_0x3c5e5b[_0x0928('0x4c')]},'raw':!![]})[_0x0928('0x23')](function(_0x15156b){if(_0x15156b&&_0x15156b[_0x0928('0x4d')]===0x0){return db[_0x0928('0x27')]['create']({'name':_0x35dd08[_0x0928('0x4e')],'resourceId':_0x35dd08['id'],'type':_0x15156b[_0x0928('0x4e')],'sectionId':_0x15156b['id']},{})['then'](function(){return _0x3a9d65;});}else{return _0x3a9d65;}})['catch'](function(_0xd93a0c){logger[_0x0928('0x4f')](_0x0928('0x50'),_0xd93a0c);throw _0xd93a0c;});}return _0x3a9d65;})[_0x0928('0x23')](respondWithResult(_0x232122,0xc9))[_0x0928('0x41')](handleError(_0x232122,null));};exports[_0x0928('0x22')]=function(_0x4ea67f,_0x62b38f){if(_0x4ea67f[_0x0928('0x47')]['id']){delete _0x4ea67f[_0x0928('0x47')]['id'];}return db[_0x0928('0x2c')]['find']({'where':{'id':_0x4ea67f['params']['id']}})[_0x0928('0x23')](handleEntityNotFound(_0x62b38f,null))['then'](saveUpdates(_0x4ea67f['body'],null))[_0x0928('0x23')](respondWithResult(_0x62b38f,null))[_0x0928('0x41')](handleError(_0x62b38f,null));};exports[_0x0928('0x24')]=function(_0x44ee54,_0x5947ea){return db[_0x0928('0x2c')]['find']({'where':{'id':_0x44ee54[_0x0928('0x43')]['id']}})[_0x0928('0x23')](handleEntityNotFound(_0x5947ea,null))['then'](removeEntity(_0x5947ea,null))[_0x0928('0x41')](handleError(_0x5947ea,null));};exports[_0x0928('0x2d')]=function(_0x4a8b14,_0x3e9f81){return db[_0x0928('0x2c')][_0x0928('0x2d')]()[_0x0928('0x23')](respondWithResult(_0x3e9f81,null))['catch'](handleError(_0x3e9f81,null));};exports['addContacts']=function(_0x4fc0c9,_0x4f475c,_0x3604ab){return db[_0x0928('0x51')][_0x0928('0x4b')]({'where':{'id':_0x4fc0c9['params']['id']}})[_0x0928('0x23')](handleEntityNotFound(_0x4f475c,null))['then'](function(_0x5ae46f){if(_0x5ae46f){return _0x5ae46f[_0x0928('0x52')](_0x4fc0c9[_0x0928('0x47')][_0x0928('0x53')],_['omit'](_0x4fc0c9['body'],['ids','id'])||{});}})[_0x0928('0x23')](respondWithResult(_0x4f475c,null))[_0x0928('0x41')](handleError(_0x4f475c,null));};exports[_0x0928('0x54')]=function(_0x46f6c8,_0x541c15,_0x5ebc2f){var _0x501a83={};var _0x4a4068={};var _0x176869;var _0x186b77;return db[_0x0928('0x2c')]['findOne']({'where':{'id':_0x46f6c8['params']['id']}})['then'](handleEntityNotFound(_0x541c15,null))['then'](function(_0x112196){if(_0x112196){_0x176869=_0x112196;_0x4a4068[_0x0928('0x2e')]=_[_0x0928('0x2f')](db['CmContact'][_0x0928('0x44')]);_0x4a4068['query']=_['keys'](_0x46f6c8[_0x0928('0x30')]);_0x4a4068[_0x0928('0x3a')]=_[_0x0928('0x31')](_0x4a4068[_0x0928('0x2e')],_0x4a4068[_0x0928('0x30')]);_0x501a83[_0x0928('0x32')]=_['intersection'](_0x4a4068[_0x0928('0x2e')],qs[_0x0928('0x33')](_0x46f6c8[_0x0928('0x30')]['fields']));_0x501a83[_0x0928('0x32')]=_0x501a83[_0x0928('0x32')][_0x0928('0x45')]?_0x501a83[_0x0928('0x32')]:_0x4a4068[_0x0928('0x2e')];_0x501a83[_0x0928('0x36')]=qs[_0x0928('0x37')](_0x46f6c8[_0x0928('0x30')][_0x0928('0x37')]);_0x501a83[_0x0928('0x38')]=qs['filters'](_['pick'](_0x46f6c8[_0x0928('0x30')],_0x4a4068['filters']));if(_0x46f6c8[_0x0928('0x30')]['filter']){_0x501a83[_0x0928('0x38')]=_['merge'](_0x501a83[_0x0928('0x38')],{'$or':_['map'](_0x501a83[_0x0928('0x32')],function(_0x2b2ce6){var _0x2bdbeb={};_0x2bdbeb[_0x2b2ce6]={'$like':'%'+_0x46f6c8[_0x0928('0x30')][_0x0928('0x3d')]+'%'};return _0x2bdbeb;})});}_0x501a83=_[_0x0928('0x3b')]({},_0x501a83,_0x46f6c8[_0x0928('0x3e')]);return _0x176869[_0x0928('0x54')](_0x501a83);}})[_0x0928('0x23')](function(_0x310661){if(_0x310661){_0x186b77=_0x310661[_0x0928('0x45')];if(!_0x46f6c8[_0x0928('0x30')]['hasOwnProperty'](_0x0928('0x35'))){_0x501a83[_0x0928('0x1e')]=qs[_0x0928('0x1e')](_0x46f6c8[_0x0928('0x30')][_0x0928('0x1e')]);_0x501a83['offset']=qs[_0x0928('0x1d')](_0x46f6c8['query'][_0x0928('0x1d')]);}return _0x176869[_0x0928('0x54')](_0x501a83);}})[_0x0928('0x23')](function(_0x33dd2c){if(_0x33dd2c){return _0x33dd2c?{'count':_0x186b77,'rows':_0x33dd2c}:null;}})[_0x0928('0x23')](respondWithResult(_0x541c15,null))[_0x0928('0x41')](handleError(_0x541c15,null));}; \ No newline at end of file +var _0x56e3=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','omit','ids','rawAttributes','getContacts','eml-format','rimraf','zip-dir'];(function(_0x2c4d2c,_0x433527){var _0x769dcf=function(_0x3c31db){while(--_0x3c31db){_0x2c4d2c['push'](_0x2c4d2c['shift']());}};_0x769dcf(++_0x433527);}(_0x56e3,0xb1));var _0x356e=function(_0x532c60,_0x408037){_0x532c60=_0x532c60-0x0;var _0x49daa9=_0x56e3[_0x532c60];return _0x49daa9;};'use strict';var emlformat=require(_0x356e('0x0'));var rimraf=require(_0x356e('0x1'));var zipdir=require(_0x356e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x356e('0x3'));var moment=require(_0x356e('0x4'));var BPromise=require(_0x356e('0x5'));var Mustache=require(_0x356e('0x6'));var util=require(_0x356e('0x7'));var path=require('path');var sox=require(_0x356e('0x8'));var csv=require(_0x356e('0x9'));var ejs=require(_0x356e('0xa'));var fs=require('fs');var fs_extra=require(_0x356e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x356e('0xc'));var jsforce=require(_0x356e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x356e('0xe'));var Papa=require(_0x356e('0xf'));var Redis=require(_0x356e('0x10'));var authService=require(_0x356e('0x11'));var qs=require(_0x356e('0x12'));var as=require(_0x356e('0x13'));var hardwareService=require(_0x356e('0x14'));var logger=require(_0x356e('0x15'))('api');var utils=require(_0x356e('0x16'));var config=require(_0x356e('0x17'));var licenseUtil=require(_0x356e('0x18'));var db=require(_0x356e('0x19'))['db'];function respondWithStatusCode(_0x2b3c82,_0x319c7e){_0x319c7e=_0x319c7e||0xcc;return function(_0x14cb35){if(_0x14cb35){return _0x2b3c82[_0x356e('0x1a')](_0x319c7e);}return _0x2b3c82[_0x356e('0x1b')](_0x319c7e)[_0x356e('0x1c')]();};}function respondWithResult(_0x3f9341,_0x347b3f){_0x347b3f=_0x347b3f||0xc8;return function(_0x50b4a3){if(_0x50b4a3){return _0x3f9341[_0x356e('0x1b')](_0x347b3f)['json'](_0x50b4a3);}};}function respondWithFilteredResult(_0xf79876,_0x3e0b82){return function(_0x1c79f1){if(_0x1c79f1){var _0x640a31=typeof _0x3e0b82[_0x356e('0x1d')]===_0x356e('0x1e')&&typeof _0x3e0b82[_0x356e('0x1f')]===_0x356e('0x1e');var _0x2d0f65=_0x1c79f1[_0x356e('0x20')];var _0x237ce2=_0x640a31?0x0:_0x3e0b82[_0x356e('0x1d')];var _0x3f3a49=_0x640a31?_0x1c79f1[_0x356e('0x20')]:_0x3e0b82[_0x356e('0x1d')]+_0x3e0b82['limit'];var _0x21cdad;if(_0x3f3a49>=_0x2d0f65){_0x3f3a49=_0x2d0f65;_0x21cdad=0xc8;}else{_0x21cdad=0xce;}_0xf79876['status'](_0x21cdad);return _0xf79876[_0x356e('0x21')]('Content-Range',_0x237ce2+'-'+_0x3f3a49+'/'+_0x2d0f65)[_0x356e('0x22')](_0x1c79f1);}return null;};}function patchUpdates(_0x49cf69){return function(_0x28a4be){try{jsonpatch[_0x356e('0x23')](_0x28a4be,_0x49cf69,!![]);}catch(_0x444515){return BPromise[_0x356e('0x24')](_0x444515);}return _0x28a4be[_0x356e('0x25')]();};}function saveUpdates(_0xfb013d,_0x2a274c){return function(_0x47f546){if(_0x47f546){return _0x47f546[_0x356e('0x26')](_0xfb013d)[_0x356e('0x27')](function(_0x3546ab){return _0x3546ab;});}return null;};}function removeEntity(_0xd95b04,_0x2eec8e){return function(_0x2c633f){if(_0x2c633f){return _0x2c633f['destroy']()[_0x356e('0x27')](function(){var _0x25b65b=_0x2c633f[_0x356e('0x28')]({'plain':!![]});var _0x522675='Companies';return db[_0x356e('0x29')]['destroy']({'where':{'type':_0x522675,'resourceId':_0x25b65b['id']}})[_0x356e('0x27')](function(){return _0x2c633f;});})[_0x356e('0x27')](function(){_0xd95b04['status'](0xcc)[_0x356e('0x1c')]();});}};}function handleEntityNotFound(_0x39c3d8,_0x2e347e){return function(_0xedbf05){if(!_0xedbf05){_0x39c3d8[_0x356e('0x1a')](0x194);}return _0xedbf05;};}function handleError(_0x341b2a,_0x4db357){_0x4db357=_0x4db357||0x1f4;return function(_0x140593){logger[_0x356e('0x2a')](_0x140593[_0x356e('0x2b')]);if(_0x140593[_0x356e('0x2c')]){delete _0x140593['name'];}_0x341b2a['status'](_0x4db357)['send'](_0x140593);};}exports['index']=function(_0x5989d6,_0x245f1e){var _0x48a1ff={},_0x3eaa35={},_0x4c2aa7={'count':0x0,'rows':[]};return db[_0x356e('0x2d')][_0x356e('0x2e')]()['then'](function(_0xac1a77){_0x3eaa35[_0x356e('0x2f')]=_['keys'](_0xac1a77);_0x3eaa35[_0x356e('0x30')]=_[_0x356e('0x31')](_0x5989d6['query']);_0x3eaa35[_0x356e('0x32')]=_[_0x356e('0x33')](_0x3eaa35[_0x356e('0x2f')],_0x3eaa35[_0x356e('0x30')]);_0x48a1ff[_0x356e('0x34')]=_[_0x356e('0x33')](_0x3eaa35['model'],qs[_0x356e('0x35')](_0x5989d6['query'][_0x356e('0x35')]));_0x48a1ff['attributes']=_0x48a1ff[_0x356e('0x34')]['length']?_0x48a1ff[_0x356e('0x34')]:_0x3eaa35[_0x356e('0x2f')];if(!_0x5989d6[_0x356e('0x30')][_0x356e('0x36')](_0x356e('0x37'))){_0x48a1ff[_0x356e('0x1f')]=qs[_0x356e('0x1f')](_0x5989d6[_0x356e('0x30')]['limit']);_0x48a1ff[_0x356e('0x1d')]=qs[_0x356e('0x1d')](_0x5989d6[_0x356e('0x30')][_0x356e('0x1d')]);}_0x48a1ff[_0x356e('0x38')]=qs[_0x356e('0x39')](_0x5989d6[_0x356e('0x30')]['sort']);_0x48a1ff[_0x356e('0x3a')]=qs['filters'](_[_0x356e('0x3b')](_0x5989d6[_0x356e('0x30')],_0x3eaa35[_0x356e('0x32')]),_0xac1a77);if(_0x5989d6['query'][_0x356e('0x3c')]){_0x48a1ff[_0x356e('0x3a')]=_[_0x356e('0x3d')](_0x48a1ff['where'],{'$or':_[_0x356e('0x3e')](_0x48a1ff[_0x356e('0x34')],function(_0x4a6a78){var _0x5dc2b4={};_0x5dc2b4[_0x4a6a78]={'$like':'%'+_0x5989d6['query'][_0x356e('0x3c')]+'%'};return _0x5dc2b4;})});}_0x48a1ff=_[_0x356e('0x3d')]({},_0x48a1ff,_0x5989d6[_0x356e('0x3f')]);var _0x4e0ce5={'where':_0x48a1ff[_0x356e('0x3a')]};return db[_0x356e('0x2d')][_0x356e('0x20')](_0x4e0ce5)[_0x356e('0x27')](function(_0x59b4db){_0x4c2aa7['count']=_0x59b4db;if(_0x5989d6[_0x356e('0x30')]['includeAll']){_0x48a1ff[_0x356e('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x356e('0x41')](_0x48a1ff);})[_0x356e('0x27')](function(_0x256def){_0x4c2aa7[_0x356e('0x42')]=_0x256def;return _0x4c2aa7;})[_0x356e('0x27')](respondWithFilteredResult(_0x245f1e,_0x48a1ff))[_0x356e('0x43')](handleError(_0x245f1e,null));})[_0x356e('0x43')](handleError(_0x245f1e,null));};exports[_0x356e('0x44')]=function(_0x327571,_0x2a239c){var _0x2da428={'raw':![],'where':{'id':_0x327571[_0x356e('0x45')]['id']}},_0xa528ef={};_0xa528ef[_0x356e('0x2f')]=_['keys'](db['CmCompany']['rawAttributes']);_0xa528ef[_0x356e('0x30')]=_[_0x356e('0x31')](_0x327571[_0x356e('0x30')]);_0xa528ef['filters']=_[_0x356e('0x33')](_0xa528ef[_0x356e('0x2f')],_0xa528ef['query']);_0x2da428[_0x356e('0x34')]=_[_0x356e('0x33')](_0xa528ef[_0x356e('0x2f')],qs['fields'](_0x327571['query']['fields']));_0x2da428['attributes']=_0x2da428[_0x356e('0x34')][_0x356e('0x46')]?_0x2da428[_0x356e('0x34')]:_0xa528ef['model'];if(_0x327571[_0x356e('0x30')][_0x356e('0x47')]){_0x2da428[_0x356e('0x40')]=[{'all':!![]}];}_0x2da428=_[_0x356e('0x3d')]({},_0x2da428,_0x327571[_0x356e('0x3f')]);return db['CmCompany']['find'](_0x2da428)['then'](handleEntityNotFound(_0x2a239c,null))[_0x356e('0x27')](respondWithResult(_0x2a239c,null))[_0x356e('0x43')](handleError(_0x2a239c,null));};exports[_0x356e('0x48')]=function(_0x1a6981,_0x4fca88){return db[_0x356e('0x2d')]['create'](_0x1a6981[_0x356e('0x49')],{})['then'](function(_0x36c7bb){var _0x2616e5=_0x1a6981[_0x356e('0x4a')]['get']({'plain':!![]});if(!_0x2616e5)throw new Error(_0x356e('0x4b'));if(_0x2616e5[_0x356e('0x4c')]===_0x356e('0x4a')){var _0x4772b7=_0x36c7bb[_0x356e('0x28')]({'plain':!![]});var _0x45be74=_0x356e('0x4d');return db[_0x356e('0x4e')][_0x356e('0x4f')]({'where':{'name':_0x45be74,'userProfileId':_0x2616e5[_0x356e('0x50')]},'raw':!![]})['then'](function(_0x419784){if(_0x419784&&_0x419784[_0x356e('0x51')]===0x0){return db[_0x356e('0x29')][_0x356e('0x48')]({'name':_0x4772b7[_0x356e('0x2c')],'resourceId':_0x4772b7['id'],'type':_0x419784[_0x356e('0x2c')],'sectionId':_0x419784['id']},{})[_0x356e('0x27')](function(){return _0x36c7bb;});}else{return _0x36c7bb;}})[_0x356e('0x43')](function(_0x3d6f94){logger[_0x356e('0x2a')](_0x356e('0x52'),_0x3d6f94);throw _0x3d6f94;});}return _0x36c7bb;})[_0x356e('0x27')](respondWithResult(_0x4fca88,0xc9))[_0x356e('0x43')](handleError(_0x4fca88,null));};exports['update']=function(_0x256b8d,_0x258c45){if(_0x256b8d[_0x356e('0x49')]['id']){delete _0x256b8d[_0x356e('0x49')]['id'];}return db[_0x356e('0x2d')][_0x356e('0x4f')]({'where':{'id':_0x256b8d[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x258c45,null))[_0x356e('0x27')](saveUpdates(_0x256b8d[_0x356e('0x49')],null))[_0x356e('0x27')](respondWithResult(_0x258c45,null))['catch'](handleError(_0x258c45,null));};exports[_0x356e('0x53')]=function(_0x432f5f,_0x1e4d4d){return db[_0x356e('0x2d')][_0x356e('0x4f')]({'where':{'id':_0x432f5f[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x1e4d4d,null))[_0x356e('0x27')](removeEntity(_0x1e4d4d,null))[_0x356e('0x43')](handleError(_0x1e4d4d,null));};exports['describe']=function(_0x5bafd9,_0x1c69d4){return db[_0x356e('0x2d')][_0x356e('0x2e')]()['then'](respondWithResult(_0x1c69d4,null))['catch'](handleError(_0x1c69d4,null));};exports[_0x356e('0x54')]=function(_0x4a0522,_0x44d1b0,_0x102270){return db[_0x356e('0x55')][_0x356e('0x4f')]({'where':{'id':_0x4a0522[_0x356e('0x45')]['id']}})['then'](handleEntityNotFound(_0x44d1b0,null))[_0x356e('0x27')](function(_0x3a6ea7){if(_0x3a6ea7){return _0x3a6ea7[_0x356e('0x54')](_0x4a0522[_0x356e('0x49')]['ids'],_[_0x356e('0x56')](_0x4a0522[_0x356e('0x49')],[_0x356e('0x57'),'id'])||{});}})['then'](respondWithResult(_0x44d1b0,null))['catch'](handleError(_0x44d1b0,null));};exports['getContacts']=function(_0x32fcb0,_0x4b64c7,_0x587bf2){var _0x4ad12a={};var _0x3e4d17={};var _0x4980fc;var _0x40ca20;return db[_0x356e('0x2d')]['findOne']({'where':{'id':_0x32fcb0[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x4b64c7,null))[_0x356e('0x27')](function(_0x3868c4){if(_0x3868c4){_0x4980fc=_0x3868c4;_0x3e4d17[_0x356e('0x2f')]=_[_0x356e('0x31')](db[_0x356e('0x55')][_0x356e('0x58')]);_0x3e4d17[_0x356e('0x30')]=_['keys'](_0x32fcb0[_0x356e('0x30')]);_0x3e4d17[_0x356e('0x32')]=_[_0x356e('0x33')](_0x3e4d17[_0x356e('0x2f')],_0x3e4d17[_0x356e('0x30')]);_0x4ad12a[_0x356e('0x34')]=_['intersection'](_0x3e4d17[_0x356e('0x2f')],qs[_0x356e('0x35')](_0x32fcb0[_0x356e('0x30')]['fields']));_0x4ad12a[_0x356e('0x34')]=_0x4ad12a['attributes'][_0x356e('0x46')]?_0x4ad12a[_0x356e('0x34')]:_0x3e4d17['model'];_0x4ad12a[_0x356e('0x38')]=qs['sort'](_0x32fcb0[_0x356e('0x30')]['sort']);_0x4ad12a['where']=qs[_0x356e('0x32')](_[_0x356e('0x3b')](_0x32fcb0[_0x356e('0x30')],_0x3e4d17[_0x356e('0x32')]));if(_0x32fcb0[_0x356e('0x30')]['filter']){_0x4ad12a[_0x356e('0x3a')]=_[_0x356e('0x3d')](_0x4ad12a[_0x356e('0x3a')],{'$or':_[_0x356e('0x3e')](_0x4ad12a[_0x356e('0x34')],function(_0x29749b){var _0x339331={};_0x339331[_0x29749b]={'$like':'%'+_0x32fcb0[_0x356e('0x30')][_0x356e('0x3c')]+'%'};return _0x339331;})});}_0x4ad12a=_[_0x356e('0x3d')]({},_0x4ad12a,_0x32fcb0[_0x356e('0x3f')]);return _0x4980fc['getContacts'](_0x4ad12a);}})[_0x356e('0x27')](function(_0x5cb3ae){if(_0x5cb3ae){_0x40ca20=_0x5cb3ae[_0x356e('0x46')];if(!_0x32fcb0[_0x356e('0x30')][_0x356e('0x36')](_0x356e('0x37'))){_0x4ad12a[_0x356e('0x1f')]=qs['limit'](_0x32fcb0[_0x356e('0x30')][_0x356e('0x1f')]);_0x4ad12a['offset']=qs[_0x356e('0x1d')](_0x32fcb0[_0x356e('0x30')]['offset']);}return _0x4980fc[_0x356e('0x59')](_0x4ad12a);}})[_0x356e('0x27')](function(_0x3a175b){if(_0x3a175b){return _0x3a175b?{'count':_0x40ca20,'rows':_0x3a175b}:null;}})[_0x356e('0x27')](respondWithResult(_0x4b64c7,null))[_0x356e('0x43')](handleError(_0x4b64c7,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 48c3df3..d56adc5 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 _0xe4f8=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','CmCompany','cm_companies','lodash'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xe4f8,0x11f));var _0x8e4f=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0xe4f8[_0x5d8631];return _0x34c15e;};'use strict';var _=require(_0x8e4f('0x0'));var util=require(_0x8e4f('0x1'));var logger=require(_0x8e4f('0x2'))(_0x8e4f('0x3'));var moment=require(_0x8e4f('0x4'));var BPromise=require(_0x8e4f('0x5'));var rp=require(_0x8e4f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e4f('0x7'));var config=require(_0x8e4f('0x8'));var attributes=require('./cmCompany.attributes');module[_0x8e4f('0x9')]=function(_0x5dca78,_0x29ded0){return _0x5dca78['define'](_0x8e4f('0xa'),attributes,{'tableName':_0x8e4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10cc=['cm_companies','lodash','moment','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x4ef48d,_0x373152){var _0x1e9115=function(_0xa99fb6){while(--_0xa99fb6){_0x4ef48d['push'](_0x4ef48d['shift']());}};_0x1e9115(++_0x373152);}(_0x10cc,0x6f));var _0xc10c=function(_0x1e7600,_0x11348d){_0x1e7600=_0x1e7600-0x0;var _0x80b052=_0x10cc[_0x1e7600];return _0x80b052;};'use strict';var _=require(_0xc10c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc10c('0x1'));var BPromise=require('bluebird');var rp=require(_0xc10c('0x2'));var fs=require('fs');var path=require(_0xc10c('0x3'));var rimraf=require(_0xc10c('0x4'));var config=require('../../config/environment');var attributes=require(_0xc10c('0x5'));module[_0xc10c('0x6')]=function(_0x482cc2,_0x3a9e2f){return _0x482cc2[_0xc10c('0x7')](_0xc10c('0x8'),attributes,{'tableName':_0xc10c('0x9'),'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 ac4aabb..ff512c7 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 _0xaf98=['message','result','catch','util','moment','bluebird','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaf98,0x7b));var _0x8af9=function(_0x1e3c99,_0x5705cc){_0x1e3c99=_0x1e3c99-0x0;var _0x2f6c7f=_0xaf98[_0x1e3c99];return _0x2f6c7f;};'use strict';var _=require('lodash');var util=require(_0x8af9('0x0'));var moment=require(_0x8af9('0x1'));var BPromise=require(_0x8af9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8af9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8af9('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8af9('0x5'));var client=jayson[_0x8af9('0x6')][_0x8af9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5524ac,_0xf96169,_0x267da5){return new BPromise(function(_0x3d98b7,_0x52353e){return client[_0x8af9('0x8')](_0x5524ac,_0x267da5)[_0x8af9('0x9')](function(_0x2fa197){logger[_0x8af9('0xa')](_0x8af9('0xb'),_0xf96169,_0x8af9('0xc'));logger[_0x8af9('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xf96169,'request\x20sent',JSON[_0x8af9('0xe')](_0x2fa197));if(_0x2fa197['error']){if(_0x2fa197[_0x8af9('0xf')][_0x8af9('0x10')]===0x1f4){logger['error'](_0x8af9('0xb'),_0xf96169,_0x2fa197[_0x8af9('0xf')]['message']);return _0x52353e(_0x2fa197['error'][_0x8af9('0x11')]);}logger['error'](_0x8af9('0xb'),_0xf96169,_0x2fa197['error'][_0x8af9('0x11')]);return _0x3d98b7(_0x2fa197['error'][_0x8af9('0x11')]);}else{logger[_0x8af9('0xa')]('CmCompany,\x20%s,\x20%s',_0xf96169,_0x8af9('0xc'));_0x3d98b7(_0x2fa197[_0x8af9('0x12')][_0x8af9('0x11')]);}})[_0x8af9('0x13')](function(_0x2393df){logger['error'](_0x8af9('0xb'),_0xf96169,_0x2393df);_0x52353e(_0x2393df);});});} \ No newline at end of file +var _0xd483=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xd483,0x158));var _0x3d48=function(_0x493f9b,_0x3df205){_0x493f9b=_0x493f9b-0x0;var _0x1cb2e4=_0xd483[_0x493f9b];return _0x1cb2e4;};'use strict';var _=require('lodash');var util=require(_0x3d48('0x0'));var moment=require(_0x3d48('0x1'));var BPromise=require(_0x3d48('0x2'));var rs=require(_0x3d48('0x3'));var fs=require('fs');var Redis=require(_0x3d48('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d48('0x5'))(_0x3d48('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d48('0x7')][_0x3d48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c1f9e,_0x19d8f0,_0x423c26){return new BPromise(function(_0x1899eb,_0x504d53){return client[_0x3d48('0x9')](_0x3c1f9e,_0x423c26)[_0x3d48('0xa')](function(_0x373278){logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x19d8f0,_0x3d48('0xd'));logger[_0x3d48('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x19d8f0,_0x3d48('0xd'),JSON[_0x3d48('0xf')](_0x373278));if(_0x373278[_0x3d48('0x10')]){if(_0x373278['error']['code']===0x1f4){logger[_0x3d48('0x10')](_0x3d48('0xc'),_0x19d8f0,_0x373278[_0x3d48('0x10')][_0x3d48('0x11')]);return _0x504d53(_0x373278[_0x3d48('0x10')]['message']);}logger[_0x3d48('0x10')]('CmCompany,\x20%s,\x20%s',_0x19d8f0,_0x373278[_0x3d48('0x10')][_0x3d48('0x11')]);return _0x1899eb(_0x373278[_0x3d48('0x10')]['message']);}else{logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x19d8f0,_0x3d48('0xd'));_0x1899eb(_0x373278[_0x3d48('0x12')][_0x3d48('0x11')]);}})[_0x3d48('0x13')](function(_0x53a278){logger['error']('CmCompany,\x20%s,\x20%s',_0x19d8f0,_0x53a278);_0x504d53(_0x53a278);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d73e41b..b646b02 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 _0x0b2b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x212721,_0x1c0edc){var _0x369f08=function(_0x1c6077){while(--_0x1c6077){_0x212721['push'](_0x212721['shift']());}};_0x369f08(++_0x1c0edc);}(_0x0b2b,0xb5));var _0xb0b2=function(_0x229422,_0x5477c6){_0x229422=_0x229422-0x0;var _0x245f88=_0x0b2b[_0x229422];return _0x245f88;};'use strict';var multer=require(_0xb0b2('0x0'));var util=require(_0xb0b2('0x1'));var path=require(_0xb0b2('0x2'));var timeout=require(_0xb0b2('0x3'));var express=require(_0xb0b2('0x4'));var router=express[_0xb0b2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb0b2('0x6'));var interaction=require(_0xb0b2('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0xb0b2('0x8')](),controller[_0xb0b2('0x9')]);router[_0xb0b2('0xa')](_0xb0b2('0xb'),auth[_0xb0b2('0x8')](),controller['describe']);router[_0xb0b2('0xa')]('/:id',auth[_0xb0b2('0x8')](),controller[_0xb0b2('0xc')]);router[_0xb0b2('0xa')](_0xb0b2('0xd'),auth[_0xb0b2('0x8')](),controller[_0xb0b2('0xe')]);router[_0xb0b2('0xf')]('/',auth[_0xb0b2('0x8')](),controller[_0xb0b2('0x10')]);router[_0xb0b2('0xf')](_0xb0b2('0xd'),auth[_0xb0b2('0x8')](),controller[_0xb0b2('0x11')]);router[_0xb0b2('0x12')](_0xb0b2('0x13'),auth['isAuthenticated'](),controller[_0xb0b2('0x14')]);router[_0xb0b2('0x15')](_0xb0b2('0x13'),auth['isAuthenticated'](),controller[_0xb0b2('0x16')]);module['exports']=router; \ No newline at end of file +var _0x910f=['post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','/:id/contacts','getContacts'];(function(_0x3ac2d9,_0x74b171){var _0x226f20=function(_0x508369){while(--_0x508369){_0x3ac2d9['push'](_0x3ac2d9['shift']());}};_0x226f20(++_0x74b171);}(_0x910f,0xb0));var _0xf910=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x910f[_0x2850c0];return _0x21e830;};'use strict';var multer=require(_0xf910('0x0'));var util=require(_0xf910('0x1'));var path=require(_0xf910('0x2'));var timeout=require(_0xf910('0x3'));var express=require(_0xf910('0x4'));var router=express[_0xf910('0x5')]();var fs_extra=require(_0xf910('0x6'));var auth=require(_0xf910('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0xf910('0x8')](),controller[_0xf910('0x9')]);router[_0xf910('0xa')](_0xf910('0xb'),auth[_0xf910('0x8')](),controller['describe']);router[_0xf910('0xa')](_0xf910('0xc'),auth[_0xf910('0x8')](),controller[_0xf910('0xd')]);router[_0xf910('0xa')](_0xf910('0xe'),auth['isAuthenticated'](),controller[_0xf910('0xf')]);router[_0xf910('0x10')]('/',auth[_0xf910('0x8')](),controller[_0xf910('0x11')]);router[_0xf910('0x10')]('/:id/contacts',auth[_0xf910('0x8')](),controller[_0xf910('0x12')]);router[_0xf910('0x13')](_0xf910('0xc'),auth['isAuthenticated'](),controller[_0xf910('0x14')]);router[_0xf910('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf910('0x16')]);module[_0xf910('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 9e3a4cf..90a564c 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 _0xc12f=['sequelize','exports','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x1fc86e,_0x3125d6){var _0x3b8c86=function(_0x16f652){while(--_0x16f652){_0x1fc86e['push'](_0x1fc86e['shift']());}};_0x3b8c86(++_0x3125d6);}(_0xc12f,0x10f));var _0xfc12=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0xc12f[_0x4fdcc0];return _0xc0ce94;};'use strict';var _=require(_0xfc12('0x0'));var Sequelize=require(_0xfc12('0x1'));module[_0xfc12('0x2')]={'firstName':{'type':Sequelize[_0xfc12('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xfc12('0x3')]},'street':{'type':Sequelize[_0xfc12('0x3')]},'postalCode':{'type':Sequelize[_0xfc12('0x3')]},'city':{'type':Sequelize[_0xfc12('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xfc12('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xfc12('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfc12('0x3')]},'email':{'type':Sequelize[_0xfc12('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xfc12('0x3')]},'fb_data':{'type':Sequelize[_0xfc12('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xfc12('0x3')]},'teams':{'type':Sequelize[_0xfc12('0x3')]},'viber':{'type':Sequelize[_0xfc12('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xfc12('0x3')]},'telegram':{'type':Sequelize[_0xfc12('0x3')]},'UserId':{'type':Sequelize[_0xfc12('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xfc12('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xfc12('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfc12('0x6')],'defaultValue':Sequelize[_0xfc12('0x7')]},'dialTimezone':{'type':Sequelize[_0xfc12('0x3')]},'utcOffset':{'type':Sequelize[_0xfc12('0x4')]}}; \ No newline at end of file +var _0x1d50=['lodash','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1d50,0xfc));var _0x01d5=function(_0x5023ff,_0x3b7100){_0x5023ff=_0x5023ff-0x0;var _0x409ec3=_0x1d50[_0x5023ff];return _0x409ec3;};'use strict';var _=require(_0x01d5('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x01d5('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x01d5('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x01d5('0x1')]},'description':{'type':Sequelize[_0x01d5('0x2')]},'phone':{'type':Sequelize[_0x01d5('0x1')]},'mobile':{'type':Sequelize[_0x01d5('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x01d5('0x1')]},'facebook':{'type':Sequelize[_0x01d5('0x1')]},'fb_data':{'type':Sequelize[_0x01d5('0x1')]},'twitter':{'type':Sequelize[_0x01d5('0x1')]},'skype':{'type':Sequelize[_0x01d5('0x1')]},'teams':{'type':Sequelize[_0x01d5('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x01d5('0x1')]},'wechat':{'type':Sequelize[_0x01d5('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x01d5('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x01d5('0x1')]},'priority':{'type':Sequelize[_0x01d5('0x3')](0x2)[_0x01d5('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x01d5('0x5')],'defaultValue':Sequelize[_0x01d5('0x6')]},'dialTimezone':{'type':Sequelize[_0x01d5('0x1')]},'utcOffset':{'type':Sequelize[_0x01d5('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d7f2f1c..4ec716d 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index ec27708..1fc8572 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 _0xb504=['exports','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit'];(function(_0x394d6c,_0x149414){var _0x3554ab=function(_0x51d764){while(--_0x51d764){_0x394d6c['push'](_0x394d6c['shift']());}};_0x3554ab(++_0x149414);}(_0xb504,0x171));var _0x4b50=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb504[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x4b50('0x0'))['db'][_0x4b50('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4b50('0x2')](0x0);var events={'afterCreate':_0x4b50('0x3'),'afterUpdate':_0x4b50('0x4'),'afterDestroy':_0x4b50('0x5')};function emitEvent(_0x4d3c62){return function(_0x184d49,_0xdac994,_0x1cb3d2){CmContactEvents['emit'](_0x4d3c62+':'+_0x184d49['id'],_0x184d49);CmContactEvents[_0x4b50('0x6')](_0x4d3c62,_0x184d49);_0x1cb3d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x4b50('0x7')]=CmContactEvents; \ No newline at end of file +var _0x5992=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x424f2e,_0x1c3e1a){var _0x4bee9a=function(_0x150fa1){while(--_0x150fa1){_0x424f2e['push'](_0x424f2e['shift']());}};_0x4bee9a(++_0x1c3e1a);}(_0x5992,0x177));var _0x2599=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x5992[_0x24061a];return _0x82054e;};'use strict';var EventEmitter=require(_0x2599('0x0'));var CmContact=require(_0x2599('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x2599('0x2')](0x0);var events={'afterCreate':_0x2599('0x3'),'afterUpdate':_0x2599('0x4'),'afterDestroy':_0x2599('0x5')};function emitEvent(_0x6becd8){return function(_0x412dcc,_0x48568f,_0x3863f5){CmContactEvents['emit'](_0x6becd8+':'+_0x412dcc['id'],_0x412dcc);CmContactEvents[_0x2599('0x6')](_0x6becd8,_0x412dcc);_0x3863f5(null);};}for(var e in events){if(events[_0x2599('0x7')](e)){var event=events[e];CmContact[_0x2599('0x8')](e,emitEvent(event));}}module[_0x2599('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 21e5fdd..f8fb611 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 _0x5cea=['CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','findOne','then','timezones','dialTimezone','utcOffset','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','inspect','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','length','always','findAll','CmHopperBlack','cmContact,\x20%s,\x20%s','message','BlackLists','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define'];(function(_0x4adce1,_0x41d240){var _0x9110fa=function(_0x4c3c85){while(--_0x4c3c85){_0x4adce1['push'](_0x4adce1['shift']());}};_0x9110fa(++_0x41d240);}(_0x5cea,0x8f));var _0xa5ce=function(_0x4cb424,_0x25319b){_0x4cb424=_0x4cb424-0x0;var _0xc4cc18=_0x5cea[_0x4cb424];return _0xc4cc18;};'use strict';var _=require(_0xa5ce('0x0'));var util=require('util');var logger=require(_0xa5ce('0x1'))(_0xa5ce('0x2'));var moment=require(_0xa5ce('0x3'));var BPromise=require('bluebird');var rp=require(_0xa5ce('0x4'));var fs=require('fs');var path=require(_0xa5ce('0x5'));var rimraf=require(_0xa5ce('0x6'));var config=require(_0xa5ce('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0xa5ce('0x8'));module[_0xa5ce('0x9')]=function(_0x31fde9,_0x438aa8){return _0x31fde9[_0xa5ce('0xa')](_0xa5ce('0xb'),attributes,{'tableName':_0xa5ce('0xc'),'paranoid':!![],'indexes':[{'name':_0xa5ce('0xd'),'fields':[_0xa5ce('0xd')]},{'name':_0xa5ce('0xe'),'fields':['firstName',_0xa5ce('0xf'),_0xa5ce('0xd'),_0xa5ce('0x10'),_0xa5ce('0x11'),_0xa5ce('0x12')],'type':_0xa5ce('0x13')}],'timestamps':!![],'charset':_0xa5ce('0x14'),'collate':_0xa5ce('0x15'),'hooks':{'afterCreate':function(_0x586881,_0x24b11e,_0x358219){var _0x16adec=_0x31fde9[_0xa5ce('0x16')];var _0x58850e=_0x586881[_0xa5ce('0x17')]({'plain':!![]});function _0x5947ab(){return function(_0x38a6b7){logger[_0xa5ce('0x18')](_0xa5ce('0x19'),_0xa5ce('0x1a'),util['inspect'](_0x38a6b7,{'showHidden':![],'depth':null}));};}function _0x87dc1e(_0x389bc5,_0x424ddc){var _0x459864=_0x424ddc[_0xa5ce('0x1b')]?_0x424ddc['scheduledat']:moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d'));return new BPromise(function(_0x7f65cb,_0x448e7f){if(_[_0xa5ce('0x1e')](_0x424ddc['dialTimezone'])){_0x7f65cb({'ret':_0x459864});}else{_0x16adec['VoiceQueue'][_0xa5ce('0x1f')]({'where':{'id':_0x389bc5['id']}})[_0xa5ce('0x20')](function(_0x2756e8){if(!_['isNil'](_0x2756e8)){var _0x219fc4=_0x2756e8['dialTimezone'];if(!_[_0xa5ce('0x1e')](_0x219fc4)){var _0x100b46=shared[_0xa5ce('0x21')];var _0x3d9154=_0x100b46[_0x219fc4];var _0x20e8f3=_0x100b46[_0x424ddc[_0xa5ce('0x22')]];if(!_[_0xa5ce('0x1e')](_0x3d9154)&&!_['isNil'](_0x20e8f3)){var _0x57a4f4=_0x3d9154[_0xa5ce('0x23')]-_0x20e8f3[_0xa5ce('0x23')];_0x459864=_0x424ddc[_0xa5ce('0x1b')]?_0x424ddc[_0xa5ce('0x1b')]:moment();var _0x57ed97=moment(_0x459864)['add'](_0x57a4f4,_0xa5ce('0x24'));_0x7f65cb({'ret':_0x57ed97[_0xa5ce('0x1c')](_0xa5ce('0x1d'))});}else _0x7f65cb({'ret':_0x459864});}else _0x7f65cb({'ret':_0x459864});}else{_0x7f65cb({'ret':_0x459864});}});}});return 0xa;}var _0x219eec=function(_0x1f1d89){return new BPromise(function(_0x57da9d,_0x35ed74){_0x87dc1e(_0x1f1d89,_0x58850e)[_0xa5ce('0x20')](function(_0x3ec852){_0x58850e[_0xa5ce('0x1b')]=_0x3ec852[_0xa5ce('0x25')];_0x16adec[_0xa5ce('0x26')]['findOne']({'where':{'phone':_0x58850e['phone'],'VoiceQueueId':_0x1f1d89['id']}})['then'](function(_0xb8de7d){if(!_[_0xa5ce('0x1e')](_0xb8de7d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x58850e[_0xa5ce('0xd')]+_0xa5ce('0x27')+_0x1f1d89['id']);}return _0x16adec[_0xa5ce('0x26')][_0xa5ce('0x28')]({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'priority':_0x58850e[_0xa5ce('0x2a')]?_0x58850e['priority']:0x2,'scheduledat':_0x58850e[_0xa5ce('0x1b')]?_0x58850e['scheduledat']:moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')),'callback':_0x58850e[_0xa5ce('0x2b')]?!![]:![],'callbackuniqueid':_0x58850e[_0xa5ce('0x2b')]?_0x58850e[_0xa5ce('0x2b')]:undefined,'callbackat':_0x58850e[_0xa5ce('0x2b')]?moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')):undefined,'VoiceQueueId':_0x1f1d89['id']});})[_0xa5ce('0x2c')](function(_0x551751){_0x35ed74(_0x551751);});});});};var _0x10e054=function(_0x3be7cd){return new BPromise(function(_0x44b6fd,_0x2eeed8){_0x87dc1e(_0x3be7cd,_0x58850e)[_0xa5ce('0x20')](function(_0x7a81bc){_0x58850e[_0xa5ce('0x1b')]=_0x7a81bc[_0xa5ce('0x25')];_0x16adec[_0xa5ce('0x26')]['findOne']({'where':{'phone':_0x58850e[_0xa5ce('0xd')],'VoiceQueueId':_0x3be7cd['id']}})[_0xa5ce('0x20')](function(_0x460f83){if(!_[_0xa5ce('0x1e')](_0x460f83)){throw new Error(_0xa5ce('0x2d')+_0x58850e[_0xa5ce('0xd')]+_0xa5ce('0x2e')+_0x3be7cd['id']);}return _0x16adec[_0xa5ce('0x2f')][_0xa5ce('0x1f')]({'where':{'calleridnum':_0x58850e[_0xa5ce('0xd')],'VoiceQueueId':_0x3be7cd['id']}});})[_0xa5ce('0x20')](function(_0xfb9cc3){if(!_[_0xa5ce('0x1e')](_0xfb9cc3)){throw new Error(_0xa5ce('0x30')+_0x58850e[_0xa5ce('0xd')]+_0xa5ce('0x31')+_0x3be7cd['id']);}return _0x16adec['CmHopper'][_0xa5ce('0x28')]({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'priority':_0x58850e[_0xa5ce('0x2a')]?_0x58850e[_0xa5ce('0x2a')]:0x2,'scheduledat':_0x58850e[_0xa5ce('0x1b')]?_0x58850e['scheduledat']:moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')),'callback':_0x58850e[_0xa5ce('0x2b')]?!![]:![],'callbackuniqueid':_0x58850e[_0xa5ce('0x2b')]?_0x58850e[_0xa5ce('0x2b')]:undefined,'callbackat':_0x58850e['callbackUniqueid']?moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')):undefined,'VoiceQueueId':_0x3be7cd['id']});})[_0xa5ce('0x2c')](function(_0x2501f){_0x2eeed8(_0x2501f);});});});};function _0x571acf(){return function(_0x50542e){logger[_0xa5ce('0x18')](_0xa5ce('0x19'),'afterCreate',util[_0xa5ce('0x32')](_0x50542e,{'showHidden':![],'depth':null}));};}function _0xa036ee(_0x1e9e4f,_0x379acd){var _0x3a6c74=_0x379acd[_0xa5ce('0x1b')]?_0x379acd[_0xa5ce('0x1b')]:moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d'));return new BPromise(function(_0x4f4c45,_0x1eae02){if(_[_0xa5ce('0x1e')](_0x379acd[_0xa5ce('0x22')])){_0x4f4c45({'ret':_0x3a6c74});}else{_0x16adec[_0xa5ce('0x33')][_0xa5ce('0x1f')]({'where':{'id':_0x1e9e4f['id']}})['then'](function(_0x462ccf){if(!_[_0xa5ce('0x1e')](_0x462ccf)){var _0x3fc3c7=_0x462ccf[_0xa5ce('0x22')];if(!_[_0xa5ce('0x1e')](_0x3fc3c7)){var _0x3c1622=shared[_0xa5ce('0x21')];var _0x620cf9=_0x3c1622[_0x3fc3c7];var _0x17d421=_0x3c1622[_0x379acd['dialTimezone']];if(!_[_0xa5ce('0x1e')](_0x620cf9)&&!_[_0xa5ce('0x1e')](_0x17d421)){var _0x22e5d3=_0x620cf9[_0xa5ce('0x23')]-_0x17d421[_0xa5ce('0x23')];_0x3a6c74=_0x379acd[_0xa5ce('0x1b')]?_0x379acd['scheduledat']:moment();var _0x50fdd7=moment(_0x3a6c74)[_0xa5ce('0x34')](_0x22e5d3,_0xa5ce('0x24'));_0x4f4c45({'ret':_0x50fdd7[_0xa5ce('0x1c')](_0xa5ce('0x1d'))});}else _0x4f4c45({'ret':_0x3a6c74});}else _0x4f4c45({'ret':_0x3a6c74});}else{_0x4f4c45({'ret':_0x3a6c74});}});}});return 0xa;}var _0x28ff06=function(_0x34978e){return new BPromise(function(_0xd7de65,_0x409c66){_0xa036ee(_0x34978e,_0x58850e)[_0xa5ce('0x20')](function(_0x557d3f){_0x58850e['scheduledat']=_0x557d3f[_0xa5ce('0x25')];_0x16adec[_0xa5ce('0x26')][_0xa5ce('0x1f')]({'where':{'phone':_0x58850e[_0xa5ce('0xd')],'CampaignId':_0x34978e['id']}})['then'](function(_0x59a6aa){if(!_['isNil'](_0x59a6aa)){throw new Error(_0xa5ce('0x2d')+_0x58850e[_0xa5ce('0xd')]+_0xa5ce('0x35')+_0x34978e['id']);}return _0x16adec['CmHopper']['create']({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'priority':_0x58850e[_0xa5ce('0x2a')]?_0x58850e[_0xa5ce('0x2a')]:0x2,'scheduledat':_0x58850e[_0xa5ce('0x1b')]?_0x58850e['scheduledat']:moment()['format'](_0xa5ce('0x1d')),'callback':_0x58850e[_0xa5ce('0x2b')]?!![]:![],'callbackuniqueid':_0x58850e['callbackUniqueid']?_0x58850e[_0xa5ce('0x2b')]:undefined,'callbackat':_0x58850e[_0xa5ce('0x2b')]?moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')):undefined,'CampaignId':_0x34978e['id']});})[_0xa5ce('0x2c')](function(_0x30bcb8){_0x409c66(_0x30bcb8);});});});};var _0x4f94a9=function(_0x48b862){return new BPromise(function(_0x83ce75,_0x759d64){_0xa036ee(_0x48b862,_0x58850e)[_0xa5ce('0x20')](function(_0x45fa4a){_0x58850e[_0xa5ce('0x1b')]=_0x45fa4a[_0xa5ce('0x25')];_0x16adec[_0xa5ce('0x26')][_0xa5ce('0x1f')]({'where':{'phone':_0x58850e['phone'],'CampaignId':_0x48b862['id']}})[_0xa5ce('0x20')](function(_0x6bbd7f){if(!_['isNil'](_0x6bbd7f)){throw new Error(_0xa5ce('0x2d')+_0x58850e['phone']+_0xa5ce('0x36')+_0x48b862['id']);}return _0x16adec[_0xa5ce('0x2f')][_0xa5ce('0x1f')]({'where':{'calleridnum':_0x58850e[_0xa5ce('0xd')],'CampaignId':_0x48b862['id']}});})[_0xa5ce('0x20')](function(_0x5026b8){if(!_['isNil'](_0x5026b8)){throw new Error(_0xa5ce('0x30')+_0x58850e[_0xa5ce('0xd')]+_0xa5ce('0x37')+_0x48b862['id']);}return _0x16adec['CmHopper'][_0xa5ce('0x28')]({'phone':_0x58850e['phone'],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'priority':_0x58850e[_0xa5ce('0x2a')]?_0x58850e[_0xa5ce('0x2a')]:0x2,'scheduledat':_0x58850e[_0xa5ce('0x1b')]?_0x58850e[_0xa5ce('0x1b')]:moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')),'callback':_0x58850e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x58850e[_0xa5ce('0x2b')]?_0x58850e[_0xa5ce('0x2b')]:undefined,'callbackat':_0x58850e[_0xa5ce('0x2b')]?moment()['format'](_0xa5ce('0x1d')):undefined,'CampaignId':_0x48b862['id']});})[_0xa5ce('0x2c')](function(_0x587005){_0x759d64(_0x587005);});});});};if(_0x58850e[_0xa5ce('0x29')]){_0x16adec[_0xa5ce('0x38')]['findAll']({'where':{'type':_0xa5ce('0x39')},'attributes':['id',_0xa5ce('0x3a'),'dialTimezone'],'include':[{'model':_0x16adec[_0xa5ce('0x3b')],'as':_0xa5ce('0x3c'),'where':{'id':_0x58850e[_0xa5ce('0x29')]}}]})['then'](function(_0x26382f){if(_0x26382f){var _0x10d6d4=[];for(var _0x1f60a4=0x0,_0x4d0480;_0x1f60a4<_0x26382f[_0xa5ce('0x3d')];_0x1f60a4+=0x1){_0x4d0480=_0x26382f[_0x1f60a4][_0xa5ce('0x17')]({'plain':!![]});switch(_0x4d0480[_0xa5ce('0x3a')]){case _0xa5ce('0x3e'):_0x10e054(_0x4d0480)[_0xa5ce('0x2c')](_0x5947ab());break;case'onlyIfOpen':_0x219eec(_0x4d0480)[_0xa5ce('0x2c')](_0x5947ab());break;default:_0xa036ee(_0x4d0480,_0x58850e)['then'](function(_0x118f31){_0x58850e[_0xa5ce('0x1b')]=_0x118f31[_0xa5ce('0x25')];_0x16adec['CmHopper'][_0xa5ce('0x28')]({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'scheduledat':_0x58850e[_0xa5ce('0x1b')]?_0x58850e[_0xa5ce('0x1b')]:moment()[_0xa5ce('0x1c')](_0xa5ce('0x1d')),'priority':_0x58850e['priority']?_0x58850e[_0xa5ce('0x2a')]:0x2,'callback':_0x58850e[_0xa5ce('0x2b')]?!![]:![],'callbackuniqueid':_0x58850e[_0xa5ce('0x2b')]?_0x58850e[_0xa5ce('0x2b')]:undefined,'callbackat':_0x58850e[_0xa5ce('0x2b')]?moment()[_0xa5ce('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4d0480['id']})[_0xa5ce('0x2c')](_0x5947ab());});}}}})['then'](function(){return _0x16adec[_0xa5ce('0x38')][_0xa5ce('0x3f')]({'where':{'type':_0xa5ce('0x39')},'attributes':['id'],'include':[{'model':_0x16adec[_0xa5ce('0x3b')],'as':'BlackLists','where':{'id':_0x58850e['ListId']}}]})[_0xa5ce('0x20')](function(_0x528825){if(_0x528825){var _0x2b055f=[];for(var _0x1da7bd=0x0,_0x408cea;_0x1da7bd<_0x528825[_0xa5ce('0x3d')];_0x1da7bd+=0x1){_0x408cea=_0x528825[_0x1da7bd]['get']({'plain':!![]});_0x16adec[_0xa5ce('0x40')][_0xa5ce('0x28')]({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'VoiceQueueId':_0x408cea['id']})['catch'](function(_0x3392df){logger[_0xa5ce('0x18')](_0xa5ce('0x41'),'afterCreate',_0x3392df[_0xa5ce('0x42')]);});}}});})[_0xa5ce('0x20')](function(){return _0x16adec[_0xa5ce('0x33')][_0xa5ce('0x3f')]({'attributes':['id','dialCheckDuplicateType',_0xa5ce('0x22')],'include':[{'model':_0x16adec[_0xa5ce('0x3b')],'as':'Lists','where':{'id':_0x58850e[_0xa5ce('0x29')]}}]})[_0xa5ce('0x20')](function(_0x3070d6){if(_0x3070d6){var _0x1c860c=[];for(var _0x224f4c=0x0,_0x1e0e86;_0x224f4c<_0x3070d6[_0xa5ce('0x3d')];_0x224f4c+=0x1){_0x1e0e86=_0x3070d6[_0x224f4c][_0xa5ce('0x17')]({'plain':!![]});switch(_0x1e0e86[_0xa5ce('0x3a')]){case _0xa5ce('0x3e'):_0x4f94a9(_0x1e0e86)['catch'](_0x571acf());break;case'onlyIfOpen':_0x28ff06(_0x1e0e86)[_0xa5ce('0x2c')](_0x571acf());break;default:_0x16adec[_0xa5ce('0x26')][_0xa5ce('0x28')]({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e['ListId'],'scheduledat':_0x58850e[_0xa5ce('0x1b')]?_0x58850e[_0xa5ce('0x1b')]:moment()[_0xa5ce('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x58850e[_0xa5ce('0x2a')]?_0x58850e[_0xa5ce('0x2a')]:0x2,'callback':_0x58850e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x58850e[_0xa5ce('0x2b')]?_0x58850e[_0xa5ce('0x2b')]:undefined,'callbackat':_0x58850e[_0xa5ce('0x2b')]?moment()[_0xa5ce('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1e0e86['id']})[_0xa5ce('0x2c')](_0x571acf());}}}});})[_0xa5ce('0x20')](function(){return _0x16adec[_0xa5ce('0x33')][_0xa5ce('0x3f')]({'attributes':['id'],'include':[{'model':_0x16adec[_0xa5ce('0x3b')],'as':_0xa5ce('0x43'),'where':{'id':_0x58850e[_0xa5ce('0x29')]}}]})[_0xa5ce('0x20')](function(_0x56bdcf){if(_0x56bdcf){var _0x145326=[];for(var _0x51d7b2=0x0,_0x2e8078;_0x51d7b2<_0x56bdcf['length'];_0x51d7b2+=0x1){_0x2e8078=_0x56bdcf[_0x51d7b2]['get']({'plain':!![]});_0x16adec[_0xa5ce('0x40')][_0xa5ce('0x28')]({'phone':_0x58850e[_0xa5ce('0xd')],'ContactId':_0x58850e['id'],'ListId':_0x58850e[_0xa5ce('0x29')],'CampaignId':_0x2e8078['id']})[_0xa5ce('0x2c')](function(_0x185f44){logger[_0xa5ce('0x18')](_0xa5ce('0x41'),'afterCreate',_0x185f44[_0xa5ce('0x42')]);});}}});})[_0xa5ce('0x20')](function(){_0x358219();})[_0xa5ce('0x2c')](function(_0x36473d){logger['error'](_0xa5ce('0x41'),_0xa5ce('0x1a'),_0x36473d[_0xa5ce('0x42')]);_0x358219(_0x36473d);});}else{_0x358219(new Error(_0xa5ce('0x44')));}},'afterDestroy':function(_0x1babef,_0x11854c,_0x428d4c){var _0x5e072c=_0x31fde9[_0xa5ce('0x16')];var _0x55a27d=_0x1babef[_0xa5ce('0x17')]({'plain':!![]});return _0x5e072c[_0xa5ce('0x26')]['findAll']({'raw':!![],'where':{'ListId':_0x55a27d[_0xa5ce('0x29')],'ContactId':_0x55a27d['id']}})[_0xa5ce('0x20')](function(_0x12bb99){if(!_[_0xa5ce('0x45')](_0x12bb99)){var _0x2edd9a=[];for(var _0xfd558d=0x0;_0xfd558d<_0x12bb99[_0xa5ce('0x3d')];_0xfd558d+=0x1){var _0x328e28=_0x5e072c[_0xa5ce('0x26')][_0xa5ce('0x46')]({'where':{'ListId':_0x12bb99[_0xfd558d]['ListId'],'ContactId':_0x12bb99[_0xfd558d]['ContactId'],'VoiceQueueId':_0x12bb99[_0xfd558d][_0xa5ce('0x47')],'CampaignId':_0x12bb99[_0xfd558d][_0xa5ce('0x48')]}});_0x2edd9a[_0xa5ce('0x49')](_0x328e28);}return BPromise[_0xa5ce('0x4a')](_0x2edd9a);}})[_0xa5ce('0x20')](function(_0x29f567){logger[_0xa5ce('0x4b')](_0xa5ce('0x4c'),util[_0xa5ce('0x32')](_0x29f567,{'showHidden':![],'depth':null}));_0x428d4c();})[_0xa5ce('0x2c')](function(_0x5a78c1){logger[_0xa5ce('0x18')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x5a78c1,{'showHidden':![],'depth':null}));_0x428d4c(_0x5a78c1);});}}});}; \ No newline at end of file +var _0xd9e7=['CmHopperFinal','cmContact,\x20afterCreate,\x20','ListId','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','length','get','VoiceQueue','CmList','BlackLists','CmHopperBlack','afterCreate','always','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','error','cmContact','inspect','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','isNil','timezones','utcOffset','scheduledat','minutes','then','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xd9e7,0x177));var _0x7d9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xd9e7[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x7d9e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d9e('0x1'));var moment=require(_0x7d9e('0x2'));var BPromise=require(_0x7d9e('0x3'));var rp=require(_0x7d9e('0x4'));var fs=require('fs');var path=require(_0x7d9e('0x5'));var rimraf=require('rimraf');var config=require(_0x7d9e('0x6'));var shared=require(_0x7d9e('0x7'));var attributes=require(_0x7d9e('0x8'));module[_0x7d9e('0x9')]=function(_0x522fa6,_0x477196){return _0x522fa6['define'](_0x7d9e('0xa'),attributes,{'tableName':_0x7d9e('0xb'),'paranoid':!![],'indexes':[{'name':_0x7d9e('0xc'),'fields':['phone']},{'name':_0x7d9e('0xd'),'fields':['firstName','lastName',_0x7d9e('0xc'),'mobile','fax',_0x7d9e('0xe')],'type':_0x7d9e('0xf')}],'timestamps':!![],'charset':_0x7d9e('0x10'),'collate':_0x7d9e('0x11'),'hooks':{'afterCreate':function(_0x2608b5,_0x587789,_0xf55945){var _0x1a70d1=_0x522fa6['models'];var _0x2386ab=_0x2608b5['get']({'plain':!![]});function _0x26661b(){return function(_0x293a6b){logger[_0x7d9e('0x12')](_0x7d9e('0x13'),'afterCreate',util[_0x7d9e('0x14')](_0x293a6b,{'showHidden':![],'depth':null}));};}function _0x15729c(_0x229a11,_0x63f6e2){var _0x23411b=_0x63f6e2['scheduledat']?_0x63f6e2['scheduledat']:moment()[_0x7d9e('0x15')](_0x7d9e('0x16'));return new BPromise(function(_0xbfe01d,_0x2b847f){if(_['isNil'](_0x63f6e2[_0x7d9e('0x17')])){_0xbfe01d({'ret':_0x23411b});}else{_0x1a70d1['VoiceQueue']['findOne']({'where':{'id':_0x229a11['id']}})['then'](function(_0x4e8742){if(!_['isNil'](_0x4e8742)){var _0x20dfa2=_0x4e8742[_0x7d9e('0x17')];if(!_[_0x7d9e('0x18')](_0x20dfa2)){var _0x445eda=shared[_0x7d9e('0x19')];var _0x18b342=_0x445eda[_0x20dfa2];var _0xa2823e=_0x445eda[_0x63f6e2['dialTimezone']];if(!_[_0x7d9e('0x18')](_0x18b342)&&!_[_0x7d9e('0x18')](_0xa2823e)){var _0x3d6253=_0x18b342[_0x7d9e('0x1a')]-_0xa2823e[_0x7d9e('0x1a')];_0x23411b=_0x63f6e2[_0x7d9e('0x1b')]?_0x63f6e2[_0x7d9e('0x1b')]:moment();var _0x4da768=moment(_0x23411b)['add'](_0x3d6253,_0x7d9e('0x1c'));_0xbfe01d({'ret':_0x4da768[_0x7d9e('0x15')](_0x7d9e('0x16'))});}else _0xbfe01d({'ret':_0x23411b});}else _0xbfe01d({'ret':_0x23411b});}else{_0xbfe01d({'ret':_0x23411b});}});}});return 0xa;}var _0x15ad46=function(_0x22c421){return new BPromise(function(_0x11b150,_0x69d0cf){_0x15729c(_0x22c421,_0x2386ab)[_0x7d9e('0x1d')](function(_0x53e647){_0x2386ab[_0x7d9e('0x1b')]=_0x53e647[_0x7d9e('0x1e')];_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x20')]({'where':{'phone':_0x2386ab[_0x7d9e('0xc')],'VoiceQueueId':_0x22c421['id']}})[_0x7d9e('0x1d')](function(_0x4ff2d7){if(!_['isNil'](_0x4ff2d7)){throw new Error(_0x7d9e('0x21')+_0x2386ab[_0x7d9e('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x22c421['id']);}return _0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab['phone'],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab['ListId'],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab[_0x7d9e('0x1b')]:moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab['callbackUniqueid']?_0x2386ab[_0x7d9e('0x24')]:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'VoiceQueueId':_0x22c421['id']});})[_0x7d9e('0x25')](function(_0x242916){_0x69d0cf(_0x242916);});});});};var _0x1efc20=function(_0x5b86dd){return new BPromise(function(_0x54f2b8,_0x398965){_0x15729c(_0x5b86dd,_0x2386ab)[_0x7d9e('0x1d')](function(_0x2dca4c){_0x2386ab[_0x7d9e('0x1b')]=_0x2dca4c[_0x7d9e('0x1e')];_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x20')]({'where':{'phone':_0x2386ab['phone'],'VoiceQueueId':_0x5b86dd['id']}})[_0x7d9e('0x1d')](function(_0x46377e){if(!_[_0x7d9e('0x18')](_0x46377e)){throw new Error(_0x7d9e('0x21')+_0x2386ab[_0x7d9e('0xc')]+_0x7d9e('0x26')+_0x5b86dd['id']);}return _0x1a70d1[_0x7d9e('0x27')][_0x7d9e('0x20')]({'where':{'calleridnum':_0x2386ab['phone'],'VoiceQueueId':_0x5b86dd['id']}});})[_0x7d9e('0x1d')](function(_0x18612f){if(!_[_0x7d9e('0x18')](_0x18612f)){throw new Error(_0x7d9e('0x28')+_0x2386ab['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5b86dd['id']);}return _0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab['phone'],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab['priority']:0x2,'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab[_0x7d9e('0x1b')]:moment()['format'](_0x7d9e('0x16')),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab['callbackUniqueid']?_0x2386ab[_0x7d9e('0x24')]:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()['format'](_0x7d9e('0x16')):undefined,'VoiceQueueId':_0x5b86dd['id']});})[_0x7d9e('0x25')](function(_0x3a7d75){_0x398965(_0x3a7d75);});});});};function _0x5ddb6a(){return function(_0x17158c){logger[_0x7d9e('0x12')](_0x7d9e('0x13'),'afterCreate',util[_0x7d9e('0x14')](_0x17158c,{'showHidden':![],'depth':null}));};}function _0x3f4f5a(_0x2b142a,_0x1a240d){var _0x2ce55b=_0x1a240d[_0x7d9e('0x1b')]?_0x1a240d[_0x7d9e('0x1b')]:moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2b324c,_0x5f5b64){if(_[_0x7d9e('0x18')](_0x1a240d[_0x7d9e('0x17')])){_0x2b324c({'ret':_0x2ce55b});}else{_0x1a70d1[_0x7d9e('0x2a')][_0x7d9e('0x20')]({'where':{'id':_0x2b142a['id']}})['then'](function(_0x503bb3){if(!_[_0x7d9e('0x18')](_0x503bb3)){var _0x1d817d=_0x503bb3[_0x7d9e('0x17')];if(!_['isNil'](_0x1d817d)){var _0x20f7e2=shared[_0x7d9e('0x19')];var _0x38d85a=_0x20f7e2[_0x1d817d];var _0x23ffd3=_0x20f7e2[_0x1a240d[_0x7d9e('0x17')]];if(!_[_0x7d9e('0x18')](_0x38d85a)&&!_[_0x7d9e('0x18')](_0x23ffd3)){var _0x5c4f1b=_0x38d85a['utcOffset']-_0x23ffd3['utcOffset'];_0x2ce55b=_0x1a240d['scheduledat']?_0x1a240d[_0x7d9e('0x1b')]:moment();var _0x538eaf=moment(_0x2ce55b)['add'](_0x5c4f1b,'minutes');_0x2b324c({'ret':_0x538eaf[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2b324c({'ret':_0x2ce55b});}else _0x2b324c({'ret':_0x2ce55b});}else{_0x2b324c({'ret':_0x2ce55b});}});}});return 0xa;}var _0x4ceb5d=function(_0x3d3510){return new BPromise(function(_0x1666e6,_0x30bba0){_0x3f4f5a(_0x3d3510,_0x2386ab)[_0x7d9e('0x1d')](function(_0x559919){_0x2386ab[_0x7d9e('0x1b')]=_0x559919[_0x7d9e('0x1e')];_0x1a70d1['CmHopper']['findOne']({'where':{'phone':_0x2386ab[_0x7d9e('0xc')],'CampaignId':_0x3d3510['id']}})[_0x7d9e('0x1d')](function(_0x404d8e){if(!_[_0x7d9e('0x18')](_0x404d8e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2386ab['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3d3510['id']);}return _0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab[_0x7d9e('0x1b')]:moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab[_0x7d9e('0x24')]:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'CampaignId':_0x3d3510['id']});})['catch'](function(_0x294e6e){_0x30bba0(_0x294e6e);});});});};var _0xdeb077=function(_0x1bff35){return new BPromise(function(_0x431c02,_0x49da92){_0x3f4f5a(_0x1bff35,_0x2386ab)[_0x7d9e('0x1d')](function(_0x4f29e7){_0x2386ab[_0x7d9e('0x1b')]=_0x4f29e7[_0x7d9e('0x1e')];_0x1a70d1['CmHopper'][_0x7d9e('0x20')]({'where':{'phone':_0x2386ab['phone'],'CampaignId':_0x1bff35['id']}})[_0x7d9e('0x1d')](function(_0x2a00f6){if(!_[_0x7d9e('0x18')](_0x2a00f6)){throw new Error(_0x7d9e('0x21')+_0x2386ab[_0x7d9e('0xc')]+_0x7d9e('0x2b')+_0x1bff35['id']);}return _0x1a70d1[_0x7d9e('0x27')]['findOne']({'where':{'calleridnum':_0x2386ab[_0x7d9e('0xc')],'CampaignId':_0x1bff35['id']}});})[_0x7d9e('0x1d')](function(_0x49fce7){if(!_[_0x7d9e('0x18')](_0x49fce7)){throw new Error(_0x7d9e('0x28')+_0x2386ab[_0x7d9e('0xc')]+_0x7d9e('0x2c')+_0x1bff35['id']);}return _0x1a70d1['CmHopper'][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'scheduledat':_0x2386ab['scheduledat']?_0x2386ab['scheduledat']:moment()[_0x7d9e('0x15')](_0x7d9e('0x16')),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab['callbackUniqueid']:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'CampaignId':_0x1bff35['id']});})[_0x7d9e('0x25')](function(_0x443f99){_0x49da92(_0x443f99);});});});};if(_0x2386ab['ListId']){_0x1a70d1['VoiceQueue'][_0x7d9e('0x2d')]({'where':{'type':_0x7d9e('0x2e')},'attributes':['id',_0x7d9e('0x2f'),_0x7d9e('0x17')],'include':[{'model':_0x1a70d1['CmList'],'as':'Lists','where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})[_0x7d9e('0x1d')](function(_0x114e3b){if(_0x114e3b){var _0x236897=[];for(var _0x3435ea=0x0,_0x3140fc;_0x3435ea<_0x114e3b[_0x7d9e('0x30')];_0x3435ea+=0x1){_0x3140fc=_0x114e3b[_0x3435ea][_0x7d9e('0x31')]({'plain':!![]});switch(_0x3140fc[_0x7d9e('0x2f')]){case'always':_0x1efc20(_0x3140fc)[_0x7d9e('0x25')](_0x26661b());break;case'onlyIfOpen':_0x15ad46(_0x3140fc)[_0x7d9e('0x25')](_0x26661b());break;default:_0x3f4f5a(_0x3140fc,_0x2386ab)[_0x7d9e('0x1d')](function(_0x350879){_0x2386ab['scheduledat']=_0x350879[_0x7d9e('0x1e')];_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab['scheduledat']:moment()[_0x7d9e('0x15')](_0x7d9e('0x16')),'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab['callbackUniqueid']:undefined,'callbackat':_0x2386ab[_0x7d9e('0x24')]?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'VoiceQueueId':_0x3140fc['id']})[_0x7d9e('0x25')](_0x26661b());});}}}})[_0x7d9e('0x1d')](function(){return _0x1a70d1[_0x7d9e('0x32')][_0x7d9e('0x2d')]({'where':{'type':_0x7d9e('0x2e')},'attributes':['id'],'include':[{'model':_0x1a70d1[_0x7d9e('0x33')],'as':_0x7d9e('0x34'),'where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})['then'](function(_0x2fcce2){if(_0x2fcce2){var _0x1c175f=[];for(var _0x29d2e=0x0,_0x44e4e6;_0x29d2e<_0x2fcce2[_0x7d9e('0x30')];_0x29d2e+=0x1){_0x44e4e6=_0x2fcce2[_0x29d2e][_0x7d9e('0x31')]({'plain':!![]});_0x1a70d1[_0x7d9e('0x35')][_0x7d9e('0x22')]({'phone':_0x2386ab['phone'],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'VoiceQueueId':_0x44e4e6['id']})[_0x7d9e('0x25')](function(_0x4f681c){logger[_0x7d9e('0x12')]('cmContact,\x20%s,\x20%s',_0x7d9e('0x36'),_0x4f681c['message']);});}}});})[_0x7d9e('0x1d')](function(){return _0x1a70d1[_0x7d9e('0x2a')][_0x7d9e('0x2d')]({'attributes':['id',_0x7d9e('0x2f'),_0x7d9e('0x17')],'include':[{'model':_0x1a70d1['CmList'],'as':'Lists','where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})[_0x7d9e('0x1d')](function(_0x2fc0b1){if(_0x2fc0b1){var _0x5f2587=[];for(var _0x18d256=0x0,_0x425454;_0x18d256<_0x2fc0b1[_0x7d9e('0x30')];_0x18d256+=0x1){_0x425454=_0x2fc0b1[_0x18d256][_0x7d9e('0x31')]({'plain':!![]});switch(_0x425454[_0x7d9e('0x2f')]){case _0x7d9e('0x37'):_0xdeb077(_0x425454)[_0x7d9e('0x25')](_0x5ddb6a());break;case'onlyIfOpen':_0x4ceb5d(_0x425454)[_0x7d9e('0x25')](_0x5ddb6a());break;default:_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab['scheduledat']:moment()['format'](_0x7d9e('0x16')),'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab['priority']:0x2,'callback':_0x2386ab['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab['callbackUniqueid']:undefined,'callbackat':_0x2386ab[_0x7d9e('0x24')]?moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x425454['id']})[_0x7d9e('0x25')](_0x5ddb6a());}}}});})[_0x7d9e('0x1d')](function(){return _0x1a70d1['Campaign'][_0x7d9e('0x2d')]({'attributes':['id'],'include':[{'model':_0x1a70d1['CmList'],'as':'BlackLists','where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})[_0x7d9e('0x1d')](function(_0x3774ce){if(_0x3774ce){var _0x53c30d=[];for(var _0x1ed18f=0x0,_0x1b39f7;_0x1ed18f<_0x3774ce[_0x7d9e('0x30')];_0x1ed18f+=0x1){_0x1b39f7=_0x3774ce[_0x1ed18f][_0x7d9e('0x31')]({'plain':!![]});_0x1a70d1[_0x7d9e('0x35')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'CampaignId':_0x1b39f7['id']})[_0x7d9e('0x25')](function(_0x5f1199){logger[_0x7d9e('0x12')](_0x7d9e('0x38'),_0x7d9e('0x36'),_0x5f1199[_0x7d9e('0x39')]);});}}});})['then'](function(){_0xf55945();})['catch'](function(_0x6c9575){logger[_0x7d9e('0x12')](_0x7d9e('0x38'),_0x7d9e('0x36'),_0x6c9575[_0x7d9e('0x39')]);_0xf55945(_0x6c9575);});}else{_0xf55945(new Error(_0x7d9e('0x3a')));}},'afterDestroy':function(_0x2591de,_0x24b2c8,_0x3eb064){var _0x538296=_0x522fa6[_0x7d9e('0x3b')];var _0x34f98f=_0x2591de['get']({'plain':!![]});return _0x538296[_0x7d9e('0x1f')][_0x7d9e('0x2d')]({'raw':!![],'where':{'ListId':_0x34f98f[_0x7d9e('0x29')],'ContactId':_0x34f98f['id']}})['then'](function(_0x4d1ee){if(!_[_0x7d9e('0x3c')](_0x4d1ee)){var _0x481770=[];for(var _0x1658c7=0x0;_0x1658c7<_0x4d1ee['length'];_0x1658c7+=0x1){var _0x436cff=_0x538296[_0x7d9e('0x1f')][_0x7d9e('0x3d')]({'where':{'ListId':_0x4d1ee[_0x1658c7][_0x7d9e('0x29')],'ContactId':_0x4d1ee[_0x1658c7][_0x7d9e('0x3e')],'VoiceQueueId':_0x4d1ee[_0x1658c7][_0x7d9e('0x3f')],'CampaignId':_0x4d1ee[_0x1658c7][_0x7d9e('0x40')]}});_0x481770[_0x7d9e('0x41')](_0x436cff);}return BPromise[_0x7d9e('0x42')](_0x481770);}})[_0x7d9e('0x1d')](function(_0x4afada){logger['info'](_0x7d9e('0x43'),util['inspect'](_0x4afada,{'showHidden':![],'depth':null}));_0x3eb064();})['catch'](function(_0xa548d1){logger[_0x7d9e('0x12')](_0x7d9e('0x44'),util[_0x7d9e('0x14')](_0xa548d1,{'showHidden':![],'depth':null}));_0x3eb064(_0xa548d1);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 820ea73..46cd91f 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x35aac9,_0x5399e1){var _0x43816c=function(_0x465844){while(--_0x465844){_0x35aac9['push'](_0x35aac9['shift']());}};_0x43816c(++_0x5399e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index bfa97de..72b2b98 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 _0xc18a=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xc18a,0x1cf));var _0xac18=function(_0x233f1d,_0x135978){_0x233f1d=_0x233f1d-0x0;var _0x5d9166=_0xc18a[_0x233f1d];return _0x5d9166;};'use strict';var Sequelize=require(_0xac18('0x0'));module[_0xac18('0x1')]={'CmContactId':{'type':Sequelize[_0xac18('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xac18('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xac18('0x3')],'defaultValue':_0xac18('0x4')},'OrderBy':{'type':Sequelize[_0xac18('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xac18('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x48ea=['sequelize','INTEGER','STRING'];(function(_0x9d6c39,_0x5dfa2f){var _0x512fe4=function(_0x246fab){while(--_0x246fab){_0x9d6c39['push'](_0x9d6c39['shift']());}};_0x512fe4(++_0x5dfa2f);}(_0x48ea,0x9c));var _0xa48e=function(_0x41240e,_0x61ca91){_0x41240e=_0x41240e-0x0;var _0x5f4e58=_0x48ea[_0x41240e];return _0x5f4e58;};'use strict';var Sequelize=require(_0xa48e('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xa48e('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xa48e('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa48e('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xa48e('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 7c33400..b4e3b87 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 _0x5818=['../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','CmContactHasItems','end','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','body','user','get','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x542ce8,_0x475277){var _0x2409eb=function(_0x1c1e37){while(--_0x1c1e37){_0x542ce8['push'](_0x542ce8['shift']());}};_0x2409eb(++_0x475277);}(_0x5818,0x17c));var _0x8581=function(_0xfb02b5,_0x39bc2b){_0xfb02b5=_0xfb02b5-0x0;var _0x22ba3e=_0x5818[_0xfb02b5];return _0x22ba3e;};'use strict';var emlformat=require(_0x8581('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8581('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8581('0x2'));var moment=require('moment');var BPromise=require(_0x8581('0x3'));var Mustache=require(_0x8581('0x4'));var util=require(_0x8581('0x5'));var path=require('path');var sox=require(_0x8581('0x6'));var csv=require(_0x8581('0x7'));var ejs=require(_0x8581('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8581('0x9'));var crypto=require(_0x8581('0xa'));var jsforce=require(_0x8581('0xb'));var deskjs=require(_0x8581('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8581('0xd'));var Papa=require(_0x8581('0xe'));var Redis=require(_0x8581('0xf'));var authService=require(_0x8581('0x10'));var qs=require(_0x8581('0x11'));var as=require(_0x8581('0x12'));var hardwareService=require(_0x8581('0x13'));var logger=require(_0x8581('0x14'))(_0x8581('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8581('0x16'));var db=require(_0x8581('0x17'))['db'];function respondWithStatusCode(_0x41d78,_0x4079f2){_0x4079f2=_0x4079f2||0xcc;return function(_0x3e5027){if(_0x3e5027){return _0x41d78['sendStatus'](_0x4079f2);}return _0x41d78[_0x8581('0x18')](_0x4079f2)['end']();};}function respondWithResult(_0x1c0f35,_0x514eac){_0x514eac=_0x514eac||0xc8;return function(_0x5089c1){if(_0x5089c1){return _0x1c0f35[_0x8581('0x18')](_0x514eac)[_0x8581('0x19')](_0x5089c1);}};}function respondWithFilteredResult(_0x34a22f,_0x364fda){return function(_0x29aabe){if(_0x29aabe){var _0x272577=typeof _0x364fda[_0x8581('0x1a')]===_0x8581('0x1b')&&typeof _0x364fda[_0x8581('0x1c')]===_0x8581('0x1b');var _0x1d5eb5=_0x29aabe[_0x8581('0x1d')];var _0x5e50bf=_0x272577?0x0:_0x364fda['offset'];var _0x82a457=_0x272577?_0x29aabe[_0x8581('0x1d')]:_0x364fda[_0x8581('0x1a')]+_0x364fda[_0x8581('0x1c')];var _0x5690b0;if(_0x82a457>=_0x1d5eb5){_0x82a457=_0x1d5eb5;_0x5690b0=0xc8;}else{_0x5690b0=0xce;}_0x34a22f[_0x8581('0x18')](_0x5690b0);return _0x34a22f['set'](_0x8581('0x1e'),_0x5e50bf+'-'+_0x82a457+'/'+_0x1d5eb5)['json'](_0x29aabe);}return null;};}function patchUpdates(_0x2071b3){return function(_0x19eee8){try{jsonpatch[_0x8581('0x1f')](_0x19eee8,_0x2071b3,!![]);}catch(_0x124c2e){return BPromise[_0x8581('0x20')](_0x124c2e);}return _0x19eee8['save']();};}function saveUpdates(_0x20f966,_0x4d58b1){return function(_0x3b20b8){if(_0x3b20b8){return _0x3b20b8[_0x8581('0x21')](_0x20f966)['then'](function(_0x2f29a9){return _0x2f29a9;});}return null;};}function removeEntity(_0x2214fd,_0x646dce){return function(_0xbc2a02){if(_0xbc2a02){return _0xbc2a02[_0x8581('0x22')]()[_0x8581('0x23')](function(){var _0x2b8d3e=_0xbc2a02['get']({'plain':!![]});var _0x22be52=_0x8581('0x24');return db['UserProfileResource'][_0x8581('0x22')]({'where':{'type':_0x22be52,'resourceId':_0x2b8d3e['id']}})[_0x8581('0x23')](function(){return _0xbc2a02;});})[_0x8581('0x23')](function(){_0x2214fd[_0x8581('0x18')](0xcc)[_0x8581('0x25')]();});}};}function handleEntityNotFound(_0x328927,_0x2b91fc){return function(_0x529350){if(!_0x529350){_0x328927['sendStatus'](0x194);}return _0x529350;};}function handleError(_0xe57245,_0x5b67d7){_0x5b67d7=_0x5b67d7||0x1f4;return function(_0x5dd9b7){logger['error'](_0x5dd9b7[_0x8581('0x26')]);if(_0x5dd9b7[_0x8581('0x27')]){delete _0x5dd9b7['name'];}_0xe57245[_0x8581('0x18')](_0x5b67d7)[_0x8581('0x28')](_0x5dd9b7);};}exports[_0x8581('0x29')]=function(_0x54f6d4,_0x50e7ac){var _0x1d9765={},_0x53ad47={},_0x5763ba={'count':0x0,'rows':[]};var _0x331b35=_[_0x8581('0x2a')](db[_0x8581('0x2b')][_0x8581('0x2c')],function(_0x5e62ee){return{'name':_0x5e62ee[_0x8581('0x2d')],'type':_0x5e62ee[_0x8581('0x2e')][_0x8581('0x2f')]};});_0x53ad47[_0x8581('0x30')]=_[_0x8581('0x2a')](_0x331b35,_0x8581('0x27'));_0x53ad47[_0x8581('0x31')]=_[_0x8581('0x32')](_0x54f6d4[_0x8581('0x31')]);_0x53ad47[_0x8581('0x33')]=_['intersection'](_0x53ad47[_0x8581('0x30')],_0x53ad47[_0x8581('0x31')]);_0x1d9765['attributes']=_[_0x8581('0x34')](_0x53ad47[_0x8581('0x30')],qs[_0x8581('0x35')](_0x54f6d4[_0x8581('0x31')][_0x8581('0x35')]));_0x1d9765[_0x8581('0x36')]=_0x1d9765[_0x8581('0x36')]['length']?_0x1d9765[_0x8581('0x36')]:_0x53ad47[_0x8581('0x30')];if(!_0x54f6d4[_0x8581('0x31')][_0x8581('0x37')](_0x8581('0x38'))){_0x1d9765[_0x8581('0x1c')]=qs['limit'](_0x54f6d4['query'][_0x8581('0x1c')]);_0x1d9765['offset']=qs[_0x8581('0x1a')](_0x54f6d4['query'][_0x8581('0x1a')]);}_0x1d9765['order']=qs['sort'](_0x54f6d4[_0x8581('0x31')][_0x8581('0x39')]);_0x1d9765[_0x8581('0x3a')]=qs['filters'](_[_0x8581('0x3b')](_0x54f6d4['query'],_0x53ad47[_0x8581('0x33')]),_0x331b35);if(_0x54f6d4[_0x8581('0x31')][_0x8581('0x3c')]){_0x1d9765[_0x8581('0x3a')]=_[_0x8581('0x3d')](_0x1d9765['where'],{'$or':_[_0x8581('0x2a')](_0x331b35,function(_0x15ce0f){if(_0x15ce0f[_0x8581('0x2e')]!==_0x8581('0x3e')){var _0x537d51={};_0x537d51[_0x15ce0f[_0x8581('0x27')]]={'$like':'%'+_0x54f6d4[_0x8581('0x31')]['filter']+'%'};return _0x537d51;}})});}_0x1d9765=_['merge']({},_0x1d9765,_0x54f6d4[_0x8581('0x3f')]);var _0x5a5a16={'where':_0x1d9765[_0x8581('0x3a')]};return db[_0x8581('0x2b')][_0x8581('0x1d')](_0x5a5a16)[_0x8581('0x23')](function(_0x5ef9ee){_0x5763ba[_0x8581('0x1d')]=_0x5ef9ee;if(_0x54f6d4[_0x8581('0x31')][_0x8581('0x40')]){_0x1d9765[_0x8581('0x41')]=[{'all':!![]}];}return db[_0x8581('0x2b')][_0x8581('0x42')](_0x1d9765);})[_0x8581('0x23')](function(_0x15ac53){_0x5763ba['rows']=_0x15ac53;return _0x5763ba;})['then'](respondWithFilteredResult(_0x50e7ac,_0x1d9765))[_0x8581('0x43')](handleError(_0x50e7ac,null));};exports['show']=function(_0x5efe1f,_0x2d20c5){var _0x54f4db={'raw':!![],'where':{'id':_0x5efe1f[_0x8581('0x44')]['id']}},_0x3476bf={};_0x3476bf[_0x8581('0x30')]=_['keys'](db[_0x8581('0x2b')][_0x8581('0x2c')]);_0x3476bf[_0x8581('0x31')]=_[_0x8581('0x32')](_0x5efe1f[_0x8581('0x31')]);_0x3476bf[_0x8581('0x33')]=_[_0x8581('0x34')](_0x3476bf[_0x8581('0x30')],_0x3476bf[_0x8581('0x31')]);_0x54f4db[_0x8581('0x36')]=_[_0x8581('0x34')](_0x3476bf[_0x8581('0x30')],qs['fields'](_0x5efe1f[_0x8581('0x31')][_0x8581('0x35')]));_0x54f4db['attributes']=_0x54f4db[_0x8581('0x36')][_0x8581('0x45')]?_0x54f4db[_0x8581('0x36')]:_0x3476bf[_0x8581('0x30')];if(_0x5efe1f[_0x8581('0x31')][_0x8581('0x40')]){_0x54f4db[_0x8581('0x41')]=[{'all':!![]}];}_0x54f4db=_[_0x8581('0x3d')]({},_0x54f4db,_0x5efe1f[_0x8581('0x3f')]);return db[_0x8581('0x2b')][_0x8581('0x46')](_0x54f4db)['then'](handleEntityNotFound(_0x2d20c5,null))[_0x8581('0x23')](respondWithResult(_0x2d20c5,null))[_0x8581('0x43')](handleError(_0x2d20c5,null));};exports['create']=function(_0x1a7b25,_0x79b66d){return db[_0x8581('0x2b')][_0x8581('0x47')](_0x1a7b25[_0x8581('0x48')],{})[_0x8581('0x23')](function(_0x4106f1){var _0x1abaf6=_0x1a7b25[_0x8581('0x49')][_0x8581('0x4a')]({'plain':!![]});if(!_0x1abaf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1abaf6[_0x8581('0x4b')]==='user'){var _0x1ee88c=_0x4106f1[_0x8581('0x4a')]({'plain':!![]});var _0x5c934a='CmContactHasItems';return db[_0x8581('0x4c')][_0x8581('0x46')]({'where':{'name':_0x5c934a,'userProfileId':_0x1abaf6[_0x8581('0x4d')]},'raw':!![]})[_0x8581('0x23')](function(_0x46505a){if(_0x46505a&&_0x46505a['autoAssociation']===0x0){return db['UserProfileResource'][_0x8581('0x47')]({'name':_0x1ee88c[_0x8581('0x27')],'resourceId':_0x1ee88c['id'],'type':_0x46505a[_0x8581('0x27')],'sectionId':_0x46505a['id']},{})[_0x8581('0x23')](function(){return _0x4106f1;});}else{return _0x4106f1;}})[_0x8581('0x43')](function(_0x332231){logger[_0x8581('0x4e')](_0x8581('0x4f'),_0x332231);throw _0x332231;});}return _0x4106f1;})['then'](respondWithResult(_0x79b66d,0xc9))[_0x8581('0x43')](handleError(_0x79b66d,null));};exports['update']=function(_0x2c9c5b,_0x2cda50){if(_0x2c9c5b[_0x8581('0x48')]['id']){delete _0x2c9c5b['body']['id'];}return db['CmContactHasItem'][_0x8581('0x46')]({'where':{'id':_0x2c9c5b[_0x8581('0x44')]['id']}})[_0x8581('0x23')](handleEntityNotFound(_0x2cda50,null))[_0x8581('0x23')](saveUpdates(_0x2c9c5b[_0x8581('0x48')],null))['then'](respondWithResult(_0x2cda50,null))['catch'](handleError(_0x2cda50,null));};exports['destroy']=function(_0x8e4ef8,_0x4af0d9){return db['CmContactHasItem']['find']({'where':{'id':_0x8e4ef8[_0x8581('0x44')]['id']}})[_0x8581('0x23')](handleEntityNotFound(_0x4af0d9,null))[_0x8581('0x23')](removeEntity(_0x4af0d9,null))[_0x8581('0x43')](handleError(_0x4af0d9,null));}; \ No newline at end of file +var _0xa1de=['sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','show','params','rawAttributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','CmContactHasItems','name','map','CmContactHasItem','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa1de,0x1f1));var _0xea1d=function(_0x5f20d8,_0x500714){_0x5f20d8=_0x5f20d8-0x0;var _0x3065d1=_0xa1de[_0x5f20d8];return _0x3065d1;};'use strict';var emlformat=require(_0xea1d('0x0'));var rimraf=require(_0xea1d('0x1'));var zipdir=require(_0xea1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea1d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea1d('0x4'));var util=require(_0xea1d('0x5'));var path=require(_0xea1d('0x6'));var sox=require(_0xea1d('0x7'));var csv=require('to-csv');var ejs=require(_0xea1d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea1d('0x9'));var squel=require('squel');var crypto=require(_0xea1d('0xa'));var jsforce=require(_0xea1d('0xb'));var deskjs=require(_0xea1d('0xc'));var toCsv=require(_0xea1d('0xd'));var querystring=require(_0xea1d('0xe'));var Papa=require(_0xea1d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea1d('0x10'));var as=require(_0xea1d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea1d('0x12'))(_0xea1d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xea1d('0x14'));var db=require(_0xea1d('0x15'))['db'];function respondWithStatusCode(_0x76281c,_0x3cc70f){_0x3cc70f=_0x3cc70f||0xcc;return function(_0x388300){if(_0x388300){return _0x76281c[_0xea1d('0x16')](_0x3cc70f);}return _0x76281c[_0xea1d('0x17')](_0x3cc70f)[_0xea1d('0x18')]();};}function respondWithResult(_0x52c200,_0x30b663){_0x30b663=_0x30b663||0xc8;return function(_0x38a1c4){if(_0x38a1c4){return _0x52c200[_0xea1d('0x17')](_0x30b663)[_0xea1d('0x19')](_0x38a1c4);}};}function respondWithFilteredResult(_0x38c528,_0x48c9bb){return function(_0x401dee){if(_0x401dee){var _0x1f58f4=typeof _0x48c9bb[_0xea1d('0x1a')]===_0xea1d('0x1b')&&typeof _0x48c9bb[_0xea1d('0x1c')]===_0xea1d('0x1b');var _0x1fbc33=_0x401dee[_0xea1d('0x1d')];var _0x2ab401=_0x1f58f4?0x0:_0x48c9bb[_0xea1d('0x1a')];var _0x27e156=_0x1f58f4?_0x401dee[_0xea1d('0x1d')]:_0x48c9bb['offset']+_0x48c9bb[_0xea1d('0x1c')];var _0x55787f;if(_0x27e156>=_0x1fbc33){_0x27e156=_0x1fbc33;_0x55787f=0xc8;}else{_0x55787f=0xce;}_0x38c528[_0xea1d('0x17')](_0x55787f);return _0x38c528[_0xea1d('0x1e')](_0xea1d('0x1f'),_0x2ab401+'-'+_0x27e156+'/'+_0x1fbc33)['json'](_0x401dee);}return null;};}function patchUpdates(_0x5a19af){return function(_0x509eb6){try{jsonpatch[_0xea1d('0x20')](_0x509eb6,_0x5a19af,!![]);}catch(_0x9cf80){return BPromise['reject'](_0x9cf80);}return _0x509eb6[_0xea1d('0x21')]();};}function saveUpdates(_0x40a91a,_0x2d060e){return function(_0x3058ba){if(_0x3058ba){return _0x3058ba[_0xea1d('0x22')](_0x40a91a)['then'](function(_0x5f1b58){return _0x5f1b58;});}return null;};}function removeEntity(_0xede85f,_0x24d66c){return function(_0xe93ef0){if(_0xe93ef0){return _0xe93ef0[_0xea1d('0x23')]()[_0xea1d('0x24')](function(){var _0x1a00aa=_0xe93ef0[_0xea1d('0x25')]({'plain':!![]});var _0x37b1e7=_0xea1d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x37b1e7,'resourceId':_0x1a00aa['id']}})[_0xea1d('0x24')](function(){return _0xe93ef0;});})[_0xea1d('0x24')](function(){_0xede85f[_0xea1d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590c92,_0x54a5b9){return function(_0xec0b0b){if(!_0xec0b0b){_0x590c92[_0xea1d('0x16')](0x194);}return _0xec0b0b;};}function handleError(_0x12dadb,_0x1243d5){_0x1243d5=_0x1243d5||0x1f4;return function(_0x3a738f){logger['error'](_0x3a738f['stack']);if(_0x3a738f[_0xea1d('0x27')]){delete _0x3a738f['name'];}_0x12dadb[_0xea1d('0x17')](_0x1243d5)['send'](_0x3a738f);};}exports['index']=function(_0x5cd4f2,_0x371577){var _0x1d5d6d={},_0x378df5={},_0x5f3a36={'count':0x0,'rows':[]};var _0x1c1512=_[_0xea1d('0x28')](db[_0xea1d('0x29')]['rawAttributes'],function(_0x444222){return{'name':_0x444222[_0xea1d('0x2a')],'type':_0x444222[_0xea1d('0x2b')][_0xea1d('0x2c')]};});_0x378df5[_0xea1d('0x2d')]=_['map'](_0x1c1512,_0xea1d('0x27'));_0x378df5['query']=_[_0xea1d('0x2e')](_0x5cd4f2['query']);_0x378df5[_0xea1d('0x2f')]=_[_0xea1d('0x30')](_0x378df5[_0xea1d('0x2d')],_0x378df5[_0xea1d('0x31')]);_0x1d5d6d[_0xea1d('0x32')]=_[_0xea1d('0x30')](_0x378df5['model'],qs[_0xea1d('0x33')](_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x33')]));_0x1d5d6d[_0xea1d('0x32')]=_0x1d5d6d[_0xea1d('0x32')][_0xea1d('0x34')]?_0x1d5d6d['attributes']:_0x378df5['model'];if(!_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x35')](_0xea1d('0x36'))){_0x1d5d6d[_0xea1d('0x1c')]=qs[_0xea1d('0x1c')](_0x5cd4f2['query'][_0xea1d('0x1c')]);_0x1d5d6d[_0xea1d('0x1a')]=qs[_0xea1d('0x1a')](_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x1a')]);}_0x1d5d6d[_0xea1d('0x37')]=qs[_0xea1d('0x38')](_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x38')]);_0x1d5d6d['where']=qs[_0xea1d('0x2f')](_[_0xea1d('0x39')](_0x5cd4f2[_0xea1d('0x31')],_0x378df5['filters']),_0x1c1512);if(_0x5cd4f2['query'][_0xea1d('0x3a')]){_0x1d5d6d[_0xea1d('0x3b')]=_['merge'](_0x1d5d6d[_0xea1d('0x3b')],{'$or':_[_0xea1d('0x28')](_0x1c1512,function(_0x225236){if(_0x225236[_0xea1d('0x2b')]!==_0xea1d('0x3c')){var _0x4ee6b9={};_0x4ee6b9[_0x225236[_0xea1d('0x27')]]={'$like':'%'+_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x3a')]+'%'};return _0x4ee6b9;}})});}_0x1d5d6d=_[_0xea1d('0x3d')]({},_0x1d5d6d,_0x5cd4f2[_0xea1d('0x3e')]);var _0x12a05b={'where':_0x1d5d6d[_0xea1d('0x3b')]};return db[_0xea1d('0x29')]['count'](_0x12a05b)[_0xea1d('0x24')](function(_0x57255e){_0x5f3a36[_0xea1d('0x1d')]=_0x57255e;if(_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x3f')]){_0x1d5d6d[_0xea1d('0x40')]=[{'all':!![]}];}return db[_0xea1d('0x29')]['findAll'](_0x1d5d6d);})[_0xea1d('0x24')](function(_0x1ab3c3){_0x5f3a36['rows']=_0x1ab3c3;return _0x5f3a36;})[_0xea1d('0x24')](respondWithFilteredResult(_0x371577,_0x1d5d6d))['catch'](handleError(_0x371577,null));};exports[_0xea1d('0x41')]=function(_0x1a17c4,_0x33f46f){var _0xcc97ad={'raw':!![],'where':{'id':_0x1a17c4[_0xea1d('0x42')]['id']}},_0x24ab08={};_0x24ab08[_0xea1d('0x2d')]=_[_0xea1d('0x2e')](db[_0xea1d('0x29')][_0xea1d('0x43')]);_0x24ab08[_0xea1d('0x31')]=_[_0xea1d('0x2e')](_0x1a17c4[_0xea1d('0x31')]);_0x24ab08[_0xea1d('0x2f')]=_['intersection'](_0x24ab08[_0xea1d('0x2d')],_0x24ab08[_0xea1d('0x31')]);_0xcc97ad[_0xea1d('0x32')]=_[_0xea1d('0x30')](_0x24ab08[_0xea1d('0x2d')],qs[_0xea1d('0x33')](_0x1a17c4['query'][_0xea1d('0x33')]));_0xcc97ad[_0xea1d('0x32')]=_0xcc97ad[_0xea1d('0x32')][_0xea1d('0x34')]?_0xcc97ad['attributes']:_0x24ab08['model'];if(_0x1a17c4[_0xea1d('0x31')][_0xea1d('0x3f')]){_0xcc97ad['include']=[{'all':!![]}];}_0xcc97ad=_['merge']({},_0xcc97ad,_0x1a17c4[_0xea1d('0x3e')]);return db[_0xea1d('0x29')][_0xea1d('0x44')](_0xcc97ad)['then'](handleEntityNotFound(_0x33f46f,null))[_0xea1d('0x24')](respondWithResult(_0x33f46f,null))[_0xea1d('0x45')](handleError(_0x33f46f,null));};exports[_0xea1d('0x46')]=function(_0x4c6088,_0x4caf16){return db['CmContactHasItem'][_0xea1d('0x46')](_0x4c6088['body'],{})[_0xea1d('0x24')](function(_0x5cab8c){var _0x160583=_0x4c6088['user']['get']({'plain':!![]});if(!_0x160583)throw new Error(_0xea1d('0x47'));if(_0x160583[_0xea1d('0x48')]===_0xea1d('0x49')){var _0x293f30=_0x5cab8c[_0xea1d('0x25')]({'plain':!![]});var _0x3ce76f=_0xea1d('0x26');return db[_0xea1d('0x4a')][_0xea1d('0x44')]({'where':{'name':_0x3ce76f,'userProfileId':_0x160583['userProfileId']},'raw':!![]})[_0xea1d('0x24')](function(_0x5bc6ff){if(_0x5bc6ff&&_0x5bc6ff[_0xea1d('0x4b')]===0x0){return db[_0xea1d('0x4c')][_0xea1d('0x46')]({'name':_0x293f30['name'],'resourceId':_0x293f30['id'],'type':_0x5bc6ff[_0xea1d('0x27')],'sectionId':_0x5bc6ff['id']},{})[_0xea1d('0x24')](function(){return _0x5cab8c;});}else{return _0x5cab8c;}})[_0xea1d('0x45')](function(_0xcbb5ca){logger['error'](_0xea1d('0x4d'),_0xcbb5ca);throw _0xcbb5ca;});}return _0x5cab8c;})[_0xea1d('0x24')](respondWithResult(_0x4caf16,0xc9))[_0xea1d('0x45')](handleError(_0x4caf16,null));};exports[_0xea1d('0x22')]=function(_0x2b0530,_0x40bb15){if(_0x2b0530[_0xea1d('0x4e')]['id']){delete _0x2b0530[_0xea1d('0x4e')]['id'];}return db[_0xea1d('0x29')][_0xea1d('0x44')]({'where':{'id':_0x2b0530['params']['id']}})[_0xea1d('0x24')](handleEntityNotFound(_0x40bb15,null))[_0xea1d('0x24')](saveUpdates(_0x2b0530[_0xea1d('0x4e')],null))[_0xea1d('0x24')](respondWithResult(_0x40bb15,null))[_0xea1d('0x45')](handleError(_0x40bb15,null));};exports['destroy']=function(_0x4217d0,_0x23a583){return db[_0xea1d('0x29')][_0xea1d('0x44')]({'where':{'id':_0x4217d0[_0xea1d('0x42')]['id']}})[_0xea1d('0x24')](handleEntityNotFound(_0x23a583,null))[_0xea1d('0x24')](removeEntity(_0x23a583,null))['catch'](handleError(_0x23a583,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 6b7a28c..91c6edd 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 _0xb763=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','CmContactHasItem','cm_contact_has_items','lodash','util'];(function(_0x5a49a9,_0x5d0159){var _0x3fb113=function(_0x2220bd){while(--_0x2220bd){_0x5a49a9['push'](_0x5a49a9['shift']());}};_0x3fb113(++_0x5d0159);}(_0xb763,0x153));var _0x3b76=function(_0x31bd80,_0x23f700){_0x31bd80=_0x31bd80-0x0;var _0x17ac6c=_0xb763[_0x31bd80];return _0x17ac6c;};'use strict';var _=require(_0x3b76('0x0'));var util=require(_0x3b76('0x1'));var logger=require(_0x3b76('0x2'))(_0x3b76('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b76('0x4'));var fs=require('fs');var path=require(_0x3b76('0x5'));var rimraf=require(_0x3b76('0x6'));var config=require(_0x3b76('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0x3b76('0x8')]=function(_0x3ad717,_0x3c962d){return _0x3ad717['define'](_0x3b76('0x9'),attributes,{'tableName':_0x3b76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf289=['rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4e9a9e,_0x583a24){var _0x53c489=function(_0x3e82de){while(--_0x3e82de){_0x4e9a9e['push'](_0x4e9a9e['shift']());}};_0x53c489(++_0x583a24);}(_0xf289,0x132));var _0x9f28=function(_0x5309ee,_0x854b81){_0x5309ee=_0x5309ee-0x0;var _0x550a7e=_0xf289[_0x5309ee];return _0x550a7e;};'use strict';var _=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9f28('0x2'));var BPromise=require(_0x9f28('0x3'));var rp=require(_0x9f28('0x4'));var fs=require('fs');var path=require(_0x9f28('0x5'));var rimraf=require(_0x9f28('0x6'));var config=require(_0x9f28('0x7'));var attributes=require(_0x9f28('0x8'));module[_0x9f28('0x9')]=function(_0x3ddc27,_0x3fa468){return _0x3ddc27[_0x9f28('0xa')](_0x9f28('0xb'),attributes,{'tableName':_0x9f28('0xc'),'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 3ec973b..a6991c1 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 _0xc34c=['error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x61286b,_0x4b20e3){var _0x2a3b3d=function(_0x4fd856){while(--_0x4fd856){_0x61286b['push'](_0x61286b['shift']());}};_0x2a3b3d(++_0x4b20e3);}(_0xc34c,0x6b));var _0xcc34=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc34c[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xcc34('0x0'));var util=require(_0xcc34('0x1'));var moment=require(_0xcc34('0x2'));var BPromise=require(_0xcc34('0x3'));var rs=require(_0xcc34('0x4'));var fs=require('fs');var Redis=require(_0xcc34('0x5'));var db=require(_0xcc34('0x6'))['db'];var utils=require(_0xcc34('0x7'));var logger=require(_0xcc34('0x8'))(_0xcc34('0x9'));var config=require(_0xcc34('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcc34('0xb')][_0xcc34('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31c65d,_0x2f7d45,_0x12607c){return new BPromise(function(_0x51deff,_0x356183){return client[_0xcc34('0xd')](_0x31c65d,_0x12607c)[_0xcc34('0xe')](function(_0x347f92){logger['info'](_0xcc34('0xf'),_0x2f7d45,'request\x20sent');logger['debug'](_0xcc34('0x10'),_0x2f7d45,'request\x20sent',JSON[_0xcc34('0x11')](_0x347f92));if(_0x347f92['error']){if(_0x347f92[_0xcc34('0x12')][_0xcc34('0x13')]===0x1f4){logger['error'](_0xcc34('0xf'),_0x2f7d45,_0x347f92[_0xcc34('0x12')]['message']);return _0x356183(_0x347f92[_0xcc34('0x12')][_0xcc34('0x14')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x2f7d45,_0x347f92[_0xcc34('0x12')][_0xcc34('0x14')]);return _0x51deff(_0x347f92[_0xcc34('0x12')][_0xcc34('0x14')]);}else{logger[_0xcc34('0x15')](_0xcc34('0xf'),_0x2f7d45,_0xcc34('0x16'));_0x51deff(_0x347f92[_0xcc34('0x17')]['message']);}})[_0xcc34('0x18')](function(_0xc250fb){logger[_0xcc34('0x12')](_0xcc34('0xf'),_0x2f7d45,_0xc250fb);_0x356183(_0xc250fb);});});} \ No newline at end of file +var _0x463e=['client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','randomstring','../../config/logger','rpc','jayson/promise'];(function(_0x4a5237,_0xf1b3ef){var _0x57d0ff=function(_0x43b4fe){while(--_0x43b4fe){_0x4a5237['push'](_0x4a5237['shift']());}};_0x57d0ff(++_0xf1b3ef);}(_0x463e,0x10a));var _0xe463=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x463e[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xe463('0x0'));var moment=require(_0xe463('0x1'));var BPromise=require('bluebird');var rs=require(_0xe463('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe463('0x3'))(_0xe463('0x4'));var config=require('../../config/environment');var jayson=require(_0xe463('0x5'));var client=jayson[_0xe463('0x6')][_0xe463('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b6356,_0x2a19ba,_0x1e1210){return new BPromise(function(_0x343494,_0x5e98cd){return client['request'](_0x2b6356,_0x1e1210)[_0xe463('0x8')](function(_0x1b4b18){logger[_0xe463('0x9')](_0xe463('0xa'),_0x2a19ba,_0xe463('0xb'));logger[_0xe463('0xc')](_0xe463('0xd'),_0x2a19ba,'request\x20sent',JSON['stringify'](_0x1b4b18));if(_0x1b4b18['error']){if(_0x1b4b18['error']['code']===0x1f4){logger['error'](_0xe463('0xa'),_0x2a19ba,_0x1b4b18[_0xe463('0xe')]['message']);return _0x5e98cd(_0x1b4b18[_0xe463('0xe')][_0xe463('0xf')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x2a19ba,_0x1b4b18[_0xe463('0xe')][_0xe463('0xf')]);return _0x343494(_0x1b4b18[_0xe463('0xe')][_0xe463('0xf')]);}else{logger[_0xe463('0x9')](_0xe463('0xa'),_0x2a19ba,_0xe463('0xb'));_0x343494(_0x1b4b18[_0xe463('0x10')]['message']);}})['catch'](function(_0x1cadd9){logger[_0xe463('0xe')](_0xe463('0xa'),_0x2a19ba,_0x1cadd9);_0x5e98cd(_0x1cadd9);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e855c3e..cd60a59 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 _0x23c4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x23c4,0x163));var _0x423c=function(_0x2234bd,_0x259d9d){_0x2234bd=_0x2234bd-0x0;var _0x2aa4bd=_0x23c4[_0x2234bd];return _0x2aa4bd;};'use strict';var multer=require(_0x423c('0x0'));var util=require('util');var path=require(_0x423c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x423c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x423c('0x3'));var interaction=require(_0x423c('0x4'));var config=require(_0x423c('0x5'));var controller=require(_0x423c('0x6'));router[_0x423c('0x7')]('/',auth[_0x423c('0x8')](),controller[_0x423c('0x9')]);router[_0x423c('0x7')](_0x423c('0xa'),auth['isAuthenticated'](),controller[_0x423c('0xb')]);router[_0x423c('0xc')]('/',auth[_0x423c('0x8')](),controller['create']);router[_0x423c('0xd')]('/:id',auth[_0x423c('0x8')](),controller[_0x423c('0xe')]);router['delete'](_0x423c('0xa'),auth[_0x423c('0x8')](),controller[_0x423c('0xf')]);module[_0x423c('0x10')]=router; \ No newline at end of file +var _0x629b=['post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2c7a5e,_0x2727d4){var _0xa86cd3=function(_0x22f41d){while(--_0x22f41d){_0x2c7a5e['push'](_0x2c7a5e['shift']());}};_0xa86cd3(++_0x2727d4);}(_0x629b,0x1e1));var _0xb629=function(_0x1d9119,_0x5b41a6){_0x1d9119=_0x1d9119-0x0;var _0x2b8ad3=_0x629b[_0x1d9119];return _0x2b8ad3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb629('0x0'));var timeout=require(_0xb629('0x1'));var express=require(_0xb629('0x2'));var router=express[_0xb629('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb629('0x4'));var interaction=require(_0xb629('0x5'));var config=require(_0xb629('0x6'));var controller=require(_0xb629('0x7'));router[_0xb629('0x8')]('/',auth[_0xb629('0x9')](),controller[_0xb629('0xa')]);router['get'](_0xb629('0xb'),auth[_0xb629('0x9')](),controller[_0xb629('0xc')]);router[_0xb629('0xd')]('/',auth[_0xb629('0x9')](),controller[_0xb629('0xe')]);router[_0xb629('0xf')]('/:id',auth[_0xb629('0x9')](),controller['update']);router[_0xb629('0x10')](_0xb629('0xb'),auth[_0xb629('0x9')](),controller[_0xb629('0x11')]);module[_0xb629('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 49fe612..2ee47ef 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 _0x8c08=['alias','STRING','name','TEXT','long','type','parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue'];(function(_0x203aff,_0x151444){var _0xa1817b=function(_0x1247b9){while(--_0x1247b9){_0x203aff['push'](_0x203aff['shift']());}};_0xa1817b(++_0x151444);}(_0x8c08,0xaf));var _0x88c0=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x8c08[_0x170772];return _0x3ef69c;};'use strict';var Sequelize=require(_0x88c0('0x0'));var _=require(_0x88c0('0x1'));module[_0x88c0('0x2')]={'name':{'type':Sequelize[_0x88c0('0x3')],'get':function(_0x1261aa){return this[_0x88c0('0x4')](_0x88c0('0x5'));}},'alias':{'type':Sequelize[_0x88c0('0x6')],'allowNull':![],'set':function(_0x4228d6){this['setDataValue'](_0x88c0('0x5'),_0x4228d6?_0x4228d6:this[_0x88c0('0x4')](_0x88c0('0x7')));}},'type':{'type':Sequelize[_0x88c0('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x88c0('0x8')](_0x88c0('0x9')),'get':function(){if(this[_0x88c0('0x4')](_0x88c0('0xa'))==='select'){return JSON[_0x88c0('0xb')](this[_0x88c0('0x4')]('values'));}else{return this[_0x88c0('0x4')](_0x88c0('0xc'));}},'set':function(_0x355fed){if(Array[_0x88c0('0xd')](_0x355fed)){this[_0x88c0('0xe')]('values',JSON['stringify'](_0x355fed));}else{this['setDataValue'](_0x88c0('0xc'),_0x355fed);}}},'required':{'type':Sequelize[_0x88c0('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x88c0('0x10')](_0x88c0('0x11'))}}; \ No newline at end of file +var _0x26e8=['values','ENUM','voice','sequelize','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','parse'];(function(_0x3c29e3,_0x43f921){var _0x536b6c=function(_0x691600){while(--_0x691600){_0x3c29e3['push'](_0x3c29e3['shift']());}};_0x536b6c(++_0x43f921);}(_0x26e8,0x120));var _0x826e=function(_0x5d1696,_0x1a2f5b){_0x5d1696=_0x5d1696-0x0;var _0x49d673=_0x26e8[_0x5d1696];return _0x49d673;};'use strict';var Sequelize=require(_0x826e('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x826e('0x1')],'get':function(_0x2031eb){return this[_0x826e('0x2')](_0x826e('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1c534c){this[_0x826e('0x4')](_0x826e('0x3'),_0x1c534c?_0x1c534c:this[_0x826e('0x2')](_0x826e('0x5')));}},'type':{'type':Sequelize[_0x826e('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x826e('0x7')](_0x826e('0x8')),'get':function(){if(this[_0x826e('0x2')](_0x826e('0x9'))===_0x826e('0xa')){return JSON[_0x826e('0xb')](this[_0x826e('0x2')](_0x826e('0xc')));}else{return this[_0x826e('0x2')](_0x826e('0xc'));}},'set':function(_0x361b5f){if(Array['isArray'](_0x361b5f)){this[_0x826e('0x4')](_0x826e('0xc'),JSON['stringify'](_0x361b5f));}else{this[_0x826e('0x4')](_0x826e('0xc'),_0x361b5f);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x826e('0xd')](_0x826e('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 53511da..5614eea 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 _0x73a8=['Content-Range','reject','save','update','then','name','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','destroy','create','transaction','Sequelize','TEXT','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','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'];(function(_0x1b3891,_0x13b0f7){var _0x244b6e=function(_0x11e6e3){while(--_0x11e6e3){_0x1b3891['push'](_0x1b3891['shift']());}};_0x244b6e(++_0x13b0f7);}(_0x73a8,0x136));var _0x873a=function(_0x58c581,_0x33df34){_0x58c581=_0x58c581-0x0;var _0x22bc3a=_0x73a8[_0x58c581];return _0x22bc3a;};'use strict';var emlformat=require(_0x873a('0x0'));var rimraf=require(_0x873a('0x1'));var zipdir=require(_0x873a('0x2'));var jsonpatch=require(_0x873a('0x3'));var rp=require(_0x873a('0x4'));var moment=require(_0x873a('0x5'));var BPromise=require(_0x873a('0x6'));var Mustache=require(_0x873a('0x7'));var util=require('util');var path=require(_0x873a('0x8'));var sox=require('sox');var csv=require(_0x873a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x873a('0xa'));var _=require(_0x873a('0xb'));var squel=require(_0x873a('0xc'));var crypto=require(_0x873a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x873a('0xe'));var Papa=require('papaparse');var Redis=require(_0x873a('0xf'));var authService=require(_0x873a('0x10'));var qs=require(_0x873a('0x11'));var as=require(_0x873a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x873a('0x13'))(_0x873a('0x14'));var utils=require(_0x873a('0x15'));var config=require(_0x873a('0x16'));var licenseUtil=require(_0x873a('0x17'));var db=require(_0x873a('0x18'))['db'];function respondWithStatusCode(_0x43c006,_0x2193ab){_0x2193ab=_0x2193ab||0xcc;return function(_0x14d67b){if(_0x14d67b){return _0x43c006[_0x873a('0x19')](_0x2193ab);}return _0x43c006[_0x873a('0x1a')](_0x2193ab)[_0x873a('0x1b')]();};}function respondWithResult(_0x1a263b,_0x37542a){_0x37542a=_0x37542a||0xc8;return function(_0x3b039e){if(_0x3b039e){return _0x1a263b[_0x873a('0x1a')](_0x37542a)[_0x873a('0x1c')](_0x3b039e);}};}function respondWithFilteredResult(_0x54fd04,_0x424006){return function(_0x1a6e58){if(_0x1a6e58){var _0x1a58eb=typeof _0x424006[_0x873a('0x1d')]===_0x873a('0x1e')&&typeof _0x424006[_0x873a('0x1f')]===_0x873a('0x1e');var _0x1f57b8=_0x1a6e58[_0x873a('0x20')];var _0x408928=_0x1a58eb?0x0:_0x424006[_0x873a('0x1d')];var _0x3b39fa=_0x1a58eb?_0x1a6e58[_0x873a('0x20')]:_0x424006['offset']+_0x424006[_0x873a('0x1f')];var _0x444510;if(_0x3b39fa>=_0x1f57b8){_0x3b39fa=_0x1f57b8;_0x444510=0xc8;}else{_0x444510=0xce;}_0x54fd04['status'](_0x444510);return _0x54fd04[_0x873a('0x21')](_0x873a('0x22'),_0x408928+'-'+_0x3b39fa+'/'+_0x1f57b8)[_0x873a('0x1c')](_0x1a6e58);}return null;};}function patchUpdates(_0xaafd56){return function(_0x27d97f){try{jsonpatch['apply'](_0x27d97f,_0xaafd56,!![]);}catch(_0x239e16){return BPromise[_0x873a('0x23')](_0x239e16);}return _0x27d97f[_0x873a('0x24')]();};}function saveUpdates(_0x36e424,_0x3fd732){return function(_0x3b651d){if(_0x3b651d){return _0x3b651d[_0x873a('0x25')](_0x36e424)['then'](function(_0x50653a){return _0x50653a;});}return null;};}function removeEntity(_0x5bf47a,_0x364519){return function(_0x257d13){if(_0x257d13){return _0x257d13['destroy']()[_0x873a('0x26')](function(){_0x5bf47a[_0x873a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1df3,_0x293c69){return function(_0x1418c5){if(!_0x1418c5){_0x4f1df3[_0x873a('0x19')](0x194);}return _0x1418c5;};}function handleError(_0x5a5be6,_0x538954){_0x538954=_0x538954||0x1f4;return function(_0x55bd5d){logger['error'](_0x55bd5d['stack']);if(_0x55bd5d[_0x873a('0x27')]){delete _0x55bd5d[_0x873a('0x27')];}_0x5a5be6['status'](_0x538954)['send'](_0x55bd5d);};}exports[_0x873a('0x28')]=function(_0x4c4331,_0x512e99){var _0x427951={},_0x3cd8cb={},_0x813081={'count':0x0,'rows':[]};var _0x2885ce=_[_0x873a('0x29')](db[_0x873a('0x2a')][_0x873a('0x2b')],function(_0x483817){return{'name':_0x483817['fieldName'],'type':_0x483817[_0x873a('0x2c')][_0x873a('0x2d')]};});_0x3cd8cb[_0x873a('0x2e')]=_[_0x873a('0x2f')](_[_0x873a('0x29')](_0x2885ce,_0x873a('0x27')),['name']);_0x3cd8cb['query']=_['keys'](_0x4c4331[_0x873a('0x30')]);_0x3cd8cb[_0x873a('0x31')]=_[_0x873a('0x32')](_0x3cd8cb['model'],_0x3cd8cb['query']);_0x427951['attributes']=_[_0x873a('0x32')](_0x3cd8cb[_0x873a('0x2e')],qs[_0x873a('0x33')](_0x4c4331['query'][_0x873a('0x33')]));_0x427951[_0x873a('0x34')]=_0x427951[_0x873a('0x34')][_0x873a('0x35')]?_0x427951['attributes']:_0x3cd8cb[_0x873a('0x2e')];if(!_0x4c4331[_0x873a('0x30')][_0x873a('0x36')]('nolimit')){_0x427951[_0x873a('0x1f')]=qs[_0x873a('0x1f')](_0x4c4331[_0x873a('0x30')][_0x873a('0x1f')]);_0x427951[_0x873a('0x1d')]=qs[_0x873a('0x1d')](_0x4c4331['query'][_0x873a('0x1d')]);}_0x427951[_0x873a('0x37')]=qs['sort'](_0x4c4331[_0x873a('0x30')][_0x873a('0x38')]);_0x427951['where']=qs[_0x873a('0x31')](_[_0x873a('0x39')](_0x4c4331[_0x873a('0x30')],_0x3cd8cb[_0x873a('0x31')]),_0x2885ce);if(_0x4c4331[_0x873a('0x30')][_0x873a('0x3a')]){_0x427951['where']=_[_0x873a('0x3b')](_0x427951[_0x873a('0x3c')],{'$or':_['map'](_0x2885ce,function(_0x2a786d){if(_0x2a786d[_0x873a('0x2c')]!==_0x873a('0x3d')){var _0x1e1d1c={};_0x1e1d1c[_0x2a786d[_0x873a('0x27')]]={'$like':'%'+_0x4c4331[_0x873a('0x30')][_0x873a('0x3a')]+'%'};return _0x1e1d1c;}})});}_0x427951=_[_0x873a('0x3b')]({},_0x427951,_0x4c4331[_0x873a('0x3e')]);var _0x536cfe={'where':_0x427951[_0x873a('0x3c')]};return db[_0x873a('0x2a')][_0x873a('0x20')](_0x536cfe)[_0x873a('0x26')](function(_0x47b65e){_0x813081[_0x873a('0x20')]=_0x47b65e;if(_0x4c4331[_0x873a('0x30')][_0x873a('0x3f')]){_0x427951[_0x873a('0x40')]=[{'all':!![]}];}return db[_0x873a('0x2a')][_0x873a('0x41')](_0x427951);})[_0x873a('0x26')](function(_0xfd147f){_0x813081[_0x873a('0x42')]=_0xfd147f;return _0x813081;})['then'](respondWithFilteredResult(_0x512e99,_0x427951))['catch'](handleError(_0x512e99,null));};exports[_0x873a('0x43')]=function(_0xc85756,_0x5d2350){var _0xb71520={'raw':!![],'where':{'id':_0xc85756[_0x873a('0x44')]['id']}},_0x54f96c={};_0x54f96c[_0x873a('0x2e')]=_[_0x873a('0x45')](db[_0x873a('0x2a')][_0x873a('0x2b')]);_0x54f96c['query']=_[_0x873a('0x45')](_0xc85756[_0x873a('0x30')]);_0x54f96c[_0x873a('0x31')]=_['intersection'](_0x54f96c[_0x873a('0x2e')],_0x54f96c[_0x873a('0x30')]);_0xb71520[_0x873a('0x34')]=_[_0x873a('0x32')](_0x54f96c[_0x873a('0x2e')],qs['fields'](_0xc85756[_0x873a('0x30')][_0x873a('0x33')]));_0xb71520[_0x873a('0x34')]=_0xb71520[_0x873a('0x34')][_0x873a('0x35')]?_0xb71520[_0x873a('0x34')]:_0x54f96c[_0x873a('0x2e')];if(_0xc85756['query']['includeAll']){_0xb71520[_0x873a('0x40')]=[{'all':!![]}];}_0xb71520=_['merge']({},_0xb71520,_0xc85756['options']);return db[_0x873a('0x2a')][_0x873a('0x46')](_0xb71520)[_0x873a('0x26')](handleEntityNotFound(_0x5d2350,null))[_0x873a('0x26')](respondWithResult(_0x5d2350,null))[_0x873a('0x47')](handleError(_0x5d2350,null));};exports[_0x873a('0x25')]=function(_0x3ef665,_0x147c5e){if(_0x3ef665[_0x873a('0x48')]['id']){delete _0x3ef665[_0x873a('0x48')]['id'];}return db['CmCustomField'][_0x873a('0x46')]({'where':{'id':_0x3ef665[_0x873a('0x44')]['id']}})[_0x873a('0x26')](handleEntityNotFound(_0x147c5e,null))[_0x873a('0x26')](saveUpdates(_0x3ef665[_0x873a('0x48')],null))[_0x873a('0x26')](respondWithResult(_0x147c5e,null))[_0x873a('0x47')](handleError(_0x147c5e,null));};exports[_0x873a('0x49')]=function(_0x263d3a,_0x2186bb){return db[_0x873a('0x2a')][_0x873a('0x46')]({'where':{'id':_0x263d3a[_0x873a('0x44')]['id']}})[_0x873a('0x26')](handleEntityNotFound(_0x2186bb,null))['then'](removeEntity(_0x2186bb,null))[_0x873a('0x47')](handleError(_0x2186bb,null));};exports[_0x873a('0x4a')]=function(_0x5f4fce,_0x34461a){var _0x1f6618;return db['sequelize'][_0x873a('0x4b')](function(_0x5d7735){return db[_0x873a('0x2a')][_0x873a('0x4a')](_0x5f4fce['body'],{'transaction':_0x5d7735})[_0x873a('0x26')](function(_0x4f85a8){_0x1f6618=_0x4f85a8;var _0x2ebabe={'type':db[_0x873a('0x4c')]['TEXT'],'transaction':_0x5d7735};switch(_0x5f4fce['body'][_0x873a('0x2c')]){case'text':_0x2ebabe[_0x873a('0x2c')]=db[_0x873a('0x4c')][_0x873a('0x4d')];break;case _0x873a('0x4e'):_0x2ebabe[_0x873a('0x2c')]=db['Sequelize'][_0x873a('0x4f')];break;case _0x873a('0x50'):_0x2ebabe[_0x873a('0x2c')]=db[_0x873a('0x4c')]['BOOLEAN'];_0x2ebabe[_0x873a('0x51')]=![];break;default:}return db[_0x873a('0x52')][_0x873a('0x53')][_0x873a('0x54')]('cm_contacts',util['format'](_0x873a('0x55'),_0x1f6618['id']),_0x2ebabe);})['then'](function(){return _0x1f6618;});})['then'](respondWithResult(_0x34461a,0xc9))['catch'](handleError(_0x34461a,null));}; \ No newline at end of file +var _0x0d79=['destroy','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','CmCustomField','includeAll','findAll','rows','catch','show','params','keys','include','options','find','body'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x0d79,0x6e));var _0x90d7=function(_0x2b2e44,_0x36b38a){_0x2b2e44=_0x2b2e44-0x0;var _0x2d0b45=_0x0d79[_0x2b2e44];return _0x2d0b45;};'use strict';var emlformat=require(_0x90d7('0x0'));var rimraf=require(_0x90d7('0x1'));var zipdir=require(_0x90d7('0x2'));var jsonpatch=require(_0x90d7('0x3'));var rp=require(_0x90d7('0x4'));var moment=require(_0x90d7('0x5'));var BPromise=require(_0x90d7('0x6'));var Mustache=require(_0x90d7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x90d7('0x8'));var csv=require(_0x90d7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90d7('0xa'));var _=require(_0x90d7('0xb'));var squel=require(_0x90d7('0xc'));var crypto=require(_0x90d7('0xd'));var jsforce=require(_0x90d7('0xe'));var deskjs=require(_0x90d7('0xf'));var toCsv=require(_0x90d7('0x9'));var querystring=require(_0x90d7('0x10'));var Papa=require(_0x90d7('0x11'));var Redis=require(_0x90d7('0x12'));var authService=require(_0x90d7('0x13'));var qs=require(_0x90d7('0x14'));var as=require(_0x90d7('0x15'));var hardwareService=require(_0x90d7('0x16'));var logger=require(_0x90d7('0x17'))(_0x90d7('0x18'));var utils=require(_0x90d7('0x19'));var config=require(_0x90d7('0x1a'));var licenseUtil=require(_0x90d7('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10ad74,_0x2010f8){_0x2010f8=_0x2010f8||0xcc;return function(_0x3608c1){if(_0x3608c1){return _0x10ad74['sendStatus'](_0x2010f8);}return _0x10ad74[_0x90d7('0x1c')](_0x2010f8)[_0x90d7('0x1d')]();};}function respondWithResult(_0x2d6a06,_0x22e342){_0x22e342=_0x22e342||0xc8;return function(_0x2bc53b){if(_0x2bc53b){return _0x2d6a06[_0x90d7('0x1c')](_0x22e342)[_0x90d7('0x1e')](_0x2bc53b);}};}function respondWithFilteredResult(_0x51d6df,_0x21c702){return function(_0x5ce4a7){if(_0x5ce4a7){var _0x5855bf=typeof _0x21c702[_0x90d7('0x1f')]===_0x90d7('0x20')&&typeof _0x21c702[_0x90d7('0x21')]===_0x90d7('0x20');var _0x205c4e=_0x5ce4a7[_0x90d7('0x22')];var _0x26bae9=_0x5855bf?0x0:_0x21c702[_0x90d7('0x1f')];var _0x36cd09=_0x5855bf?_0x5ce4a7[_0x90d7('0x22')]:_0x21c702[_0x90d7('0x1f')]+_0x21c702[_0x90d7('0x21')];var _0x457aa3;if(_0x36cd09>=_0x205c4e){_0x36cd09=_0x205c4e;_0x457aa3=0xc8;}else{_0x457aa3=0xce;}_0x51d6df['status'](_0x457aa3);return _0x51d6df['set']('Content-Range',_0x26bae9+'-'+_0x36cd09+'/'+_0x205c4e)['json'](_0x5ce4a7);}return null;};}function patchUpdates(_0x4c15c2){return function(_0x5da2b6){try{jsonpatch['apply'](_0x5da2b6,_0x4c15c2,!![]);}catch(_0x2be1de){return BPromise[_0x90d7('0x23')](_0x2be1de);}return _0x5da2b6[_0x90d7('0x24')]();};}function saveUpdates(_0x314352,_0xa2987c){return function(_0x3b70b0){if(_0x3b70b0){return _0x3b70b0[_0x90d7('0x25')](_0x314352)[_0x90d7('0x26')](function(_0x779309){return _0x779309;});}return null;};}function removeEntity(_0x2c00cd,_0x73d943){return function(_0x477e70){if(_0x477e70){return _0x477e70['destroy']()[_0x90d7('0x26')](function(){_0x2c00cd[_0x90d7('0x1c')](0xcc)[_0x90d7('0x1d')]();});}};}function handleEntityNotFound(_0x1d7686,_0x2f51f3){return function(_0x138d8a){if(!_0x138d8a){_0x1d7686[_0x90d7('0x27')](0x194);}return _0x138d8a;};}function handleError(_0x4ff1b6,_0x1fb548){_0x1fb548=_0x1fb548||0x1f4;return function(_0x5bc7c1){logger[_0x90d7('0x28')](_0x5bc7c1['stack']);if(_0x5bc7c1[_0x90d7('0x29')]){delete _0x5bc7c1[_0x90d7('0x29')];}_0x4ff1b6[_0x90d7('0x1c')](_0x1fb548)[_0x90d7('0x2a')](_0x5bc7c1);};}exports[_0x90d7('0x2b')]=function(_0x4a85c7,_0x2ce0ab){var _0x1f41cc={},_0x491f10={},_0x41252d={'count':0x0,'rows':[]};var _0x599381=_[_0x90d7('0x2c')](db['CmCustomField'][_0x90d7('0x2d')],function(_0x4afcdd){return{'name':_0x4afcdd[_0x90d7('0x2e')],'type':_0x4afcdd[_0x90d7('0x2f')][_0x90d7('0x30')]};});_0x491f10[_0x90d7('0x31')]=_[_0x90d7('0x32')](_['map'](_0x599381,_0x90d7('0x29')),[_0x90d7('0x29')]);_0x491f10['query']=_['keys'](_0x4a85c7[_0x90d7('0x33')]);_0x491f10[_0x90d7('0x34')]=_['intersection'](_0x491f10['model'],_0x491f10[_0x90d7('0x33')]);_0x1f41cc[_0x90d7('0x35')]=_[_0x90d7('0x36')](_0x491f10['model'],qs[_0x90d7('0x37')](_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x37')]));_0x1f41cc[_0x90d7('0x35')]=_0x1f41cc[_0x90d7('0x35')][_0x90d7('0x38')]?_0x1f41cc[_0x90d7('0x35')]:_0x491f10[_0x90d7('0x31')];if(!_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x39')](_0x90d7('0x3a'))){_0x1f41cc[_0x90d7('0x21')]=qs[_0x90d7('0x21')](_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x21')]);_0x1f41cc[_0x90d7('0x1f')]=qs[_0x90d7('0x1f')](_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x1f')]);}_0x1f41cc[_0x90d7('0x3b')]=qs[_0x90d7('0x3c')](_0x4a85c7['query'][_0x90d7('0x3c')]);_0x1f41cc['where']=qs[_0x90d7('0x34')](_['pick'](_0x4a85c7[_0x90d7('0x33')],_0x491f10[_0x90d7('0x34')]),_0x599381);if(_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x3d')]){_0x1f41cc['where']=_[_0x90d7('0x3e')](_0x1f41cc[_0x90d7('0x3f')],{'$or':_[_0x90d7('0x2c')](_0x599381,function(_0x4132d9){if(_0x4132d9[_0x90d7('0x2f')]!=='VIRTUAL'){var _0x587748={};_0x587748[_0x4132d9[_0x90d7('0x29')]]={'$like':'%'+_0x4a85c7[_0x90d7('0x33')]['filter']+'%'};return _0x587748;}})});}_0x1f41cc=_['merge']({},_0x1f41cc,_0x4a85c7['options']);var _0x20aebb={'where':_0x1f41cc[_0x90d7('0x3f')]};return db[_0x90d7('0x40')][_0x90d7('0x22')](_0x20aebb)[_0x90d7('0x26')](function(_0x3e9628){_0x41252d[_0x90d7('0x22')]=_0x3e9628;if(_0x4a85c7['query'][_0x90d7('0x41')]){_0x1f41cc['include']=[{'all':!![]}];}return db['CmCustomField'][_0x90d7('0x42')](_0x1f41cc);})['then'](function(_0x34f4c3){_0x41252d[_0x90d7('0x43')]=_0x34f4c3;return _0x41252d;})[_0x90d7('0x26')](respondWithFilteredResult(_0x2ce0ab,_0x1f41cc))[_0x90d7('0x44')](handleError(_0x2ce0ab,null));};exports[_0x90d7('0x45')]=function(_0x1a4373,_0x380fe1){var _0x20b12e={'raw':!![],'where':{'id':_0x1a4373[_0x90d7('0x46')]['id']}},_0x4a516b={};_0x4a516b['model']=_[_0x90d7('0x47')](db[_0x90d7('0x40')][_0x90d7('0x2d')]);_0x4a516b['query']=_[_0x90d7('0x47')](_0x1a4373[_0x90d7('0x33')]);_0x4a516b[_0x90d7('0x34')]=_[_0x90d7('0x36')](_0x4a516b[_0x90d7('0x31')],_0x4a516b[_0x90d7('0x33')]);_0x20b12e[_0x90d7('0x35')]=_[_0x90d7('0x36')](_0x4a516b[_0x90d7('0x31')],qs[_0x90d7('0x37')](_0x1a4373[_0x90d7('0x33')][_0x90d7('0x37')]));_0x20b12e[_0x90d7('0x35')]=_0x20b12e[_0x90d7('0x35')][_0x90d7('0x38')]?_0x20b12e[_0x90d7('0x35')]:_0x4a516b[_0x90d7('0x31')];if(_0x1a4373[_0x90d7('0x33')][_0x90d7('0x41')]){_0x20b12e[_0x90d7('0x48')]=[{'all':!![]}];}_0x20b12e=_[_0x90d7('0x3e')]({},_0x20b12e,_0x1a4373[_0x90d7('0x49')]);return db[_0x90d7('0x40')][_0x90d7('0x4a')](_0x20b12e)[_0x90d7('0x26')](handleEntityNotFound(_0x380fe1,null))[_0x90d7('0x26')](respondWithResult(_0x380fe1,null))['catch'](handleError(_0x380fe1,null));};exports[_0x90d7('0x25')]=function(_0xc5749,_0x382972){if(_0xc5749[_0x90d7('0x4b')]['id']){delete _0xc5749[_0x90d7('0x4b')]['id'];}return db[_0x90d7('0x40')]['find']({'where':{'id':_0xc5749[_0x90d7('0x46')]['id']}})[_0x90d7('0x26')](handleEntityNotFound(_0x382972,null))[_0x90d7('0x26')](saveUpdates(_0xc5749[_0x90d7('0x4b')],null))['then'](respondWithResult(_0x382972,null))[_0x90d7('0x44')](handleError(_0x382972,null));};exports[_0x90d7('0x4c')]=function(_0x12447e,_0x35e160){return db[_0x90d7('0x40')][_0x90d7('0x4a')]({'where':{'id':_0x12447e[_0x90d7('0x46')]['id']}})[_0x90d7('0x26')](handleEntityNotFound(_0x35e160,null))['then'](removeEntity(_0x35e160,null))[_0x90d7('0x44')](handleError(_0x35e160,null));};exports[_0x90d7('0x4d')]=function(_0x4316e8,_0x57d1dd){var _0x1d5433;return db[_0x90d7('0x4e')][_0x90d7('0x4f')](function(_0x1c8b52){return db[_0x90d7('0x40')][_0x90d7('0x4d')](_0x4316e8[_0x90d7('0x4b')],{'transaction':_0x1c8b52})[_0x90d7('0x26')](function(_0x47a31d){_0x1d5433=_0x47a31d;var _0x544395={'type':db[_0x90d7('0x50')][_0x90d7('0x51')],'transaction':_0x1c8b52};switch(_0x4316e8[_0x90d7('0x4b')][_0x90d7('0x2f')]){case _0x90d7('0x52'):_0x544395[_0x90d7('0x2f')]=db[_0x90d7('0x50')][_0x90d7('0x51')];break;case _0x90d7('0x53'):_0x544395['type']=db['Sequelize'][_0x90d7('0x54')];break;case _0x90d7('0x55'):_0x544395[_0x90d7('0x2f')]=db[_0x90d7('0x50')][_0x90d7('0x56')];_0x544395[_0x90d7('0x57')]=![];break;default:}return db[_0x90d7('0x4e')][_0x90d7('0x58')][_0x90d7('0x59')](_0x90d7('0x5a'),util[_0x90d7('0x5b')](_0x90d7('0x5c'),_0x1d5433['id']),_0x544395);})[_0x90d7('0x26')](function(){return _0x1d5433;});})[_0x90d7('0x26')](respondWithResult(_0x57d1dd,0xc9))[_0x90d7('0x44')](handleError(_0x57d1dd,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a3344d4..4c2cf63 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 _0x4dfd=['moment','request-promise','path','../../config/environment','./cmCustomField.attributes','define','CmCustomField','lodash','util','../../config/logger'];(function(_0x527adf,_0x108774){var _0x458f47=function(_0x5ac932){while(--_0x5ac932){_0x527adf['push'](_0x527adf['shift']());}};_0x458f47(++_0x108774);}(_0x4dfd,0xed));var _0xd4df=function(_0x310a35,_0x352b1d){_0x310a35=_0x310a35-0x0;var _0xa1dd18=_0x4dfd[_0x310a35];return _0xa1dd18;};'use strict';var _=require(_0xd4df('0x0'));var util=require(_0xd4df('0x1'));var logger=require(_0xd4df('0x2'))('api');var moment=require(_0xd4df('0x3'));var BPromise=require('bluebird');var rp=require(_0xd4df('0x4'));var fs=require('fs');var path=require(_0xd4df('0x5'));var rimraf=require('rimraf');var config=require(_0xd4df('0x6'));var attributes=require(_0xd4df('0x7'));module['exports']=function(_0x5de15e,_0x18a9dd){return _0x5de15e[_0xd4df('0x8')](_0xd4df('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3372=['api','moment','request-promise','path','rimraf','../../config/environment','define','lodash','util','../../config/logger'];(function(_0x2996a2,_0xe05735){var _0x33dabe=function(_0x4417c7){while(--_0x4417c7){_0x2996a2['push'](_0x2996a2['shift']());}};_0x33dabe(++_0xe05735);}(_0x3372,0x179));var _0x2337=function(_0x32aeef,_0x1dc19c){_0x32aeef=_0x32aeef-0x0;var _0x3c2a10=_0x3372[_0x32aeef];return _0x3c2a10;};'use strict';var _=require(_0x2337('0x0'));var util=require(_0x2337('0x1'));var logger=require(_0x2337('0x2'))(_0x2337('0x3'));var moment=require(_0x2337('0x4'));var BPromise=require('bluebird');var rp=require(_0x2337('0x5'));var fs=require('fs');var path=require(_0x2337('0x6'));var rimraf=require(_0x2337('0x7'));var config=require(_0x2337('0x8'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x217b52,_0x2b00b2){return _0x217b52[_0x2337('0x9')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 11b9dc6..c84adf9 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 _0x8138=['jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8138,0x1da));var _0x8813=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x8138[_0x5e8eae];return _0xdd09cd;};'use strict';var _=require(_0x8813('0x0'));var util=require('util');var moment=require(_0x8813('0x1'));var BPromise=require(_0x8813('0x2'));var rs=require(_0x8813('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8813('0x4'))['db'];var utils=require(_0x8813('0x5'));var logger=require(_0x8813('0x6'))(_0x8813('0x7'));var config=require(_0x8813('0x8'));var jayson=require(_0x8813('0x9'));var client=jayson[_0x8813('0xa')][_0x8813('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x461647,_0x180537,_0x1e57c3){return new BPromise(function(_0x1a3056,_0x3a77c9){return client[_0x8813('0xc')](_0x461647,_0x1e57c3)[_0x8813('0xd')](function(_0x172250){logger[_0x8813('0xe')](_0x8813('0xf'),_0x180537,'request\x20sent');logger[_0x8813('0x10')](_0x8813('0x11'),_0x180537,'request\x20sent',JSON['stringify'](_0x172250));if(_0x172250[_0x8813('0x12')]){if(_0x172250['error']['code']===0x1f4){logger[_0x8813('0x12')]('CmCustomField,\x20%s,\x20%s',_0x180537,_0x172250[_0x8813('0x12')][_0x8813('0x13')]);return _0x3a77c9(_0x172250[_0x8813('0x12')]['message']);}logger[_0x8813('0x12')](_0x8813('0xf'),_0x180537,_0x172250[_0x8813('0x12')][_0x8813('0x13')]);return _0x1a3056(_0x172250['error'][_0x8813('0x13')]);}else{logger[_0x8813('0xe')](_0x8813('0xf'),_0x180537,_0x8813('0x14'));_0x1a3056(_0x172250[_0x8813('0x15')]['message']);}})[_0x8813('0x16')](function(_0x2435c9){logger[_0x8813('0x12')](_0x8813('0xf'),_0x180537,_0x2435c9);_0x3a77c9(_0x2435c9);});});} \ No newline at end of file +var _0x7adb=['result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27ef37,_0x52cb2f){var _0x5d8bd8=function(_0x11027d){while(--_0x11027d){_0x27ef37['push'](_0x27ef37['shift']());}};_0x5d8bd8(++_0x52cb2f);}(_0x7adb,0x7f));var _0xb7ad=function(_0x1c05c8,_0x1b93ee){_0x1c05c8=_0x1c05c8-0x0;var _0x10789b=_0x7adb[_0x1c05c8];return _0x10789b;};'use strict';var _=require('lodash');var util=require(_0xb7ad('0x0'));var moment=require(_0xb7ad('0x1'));var BPromise=require('bluebird');var rs=require(_0xb7ad('0x2'));var fs=require('fs');var Redis=require(_0xb7ad('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7ad('0x4'));var logger=require(_0xb7ad('0x5'))(_0xb7ad('0x6'));var config=require('../../config/environment');var jayson=require(_0xb7ad('0x7'));var client=jayson['client'][_0xb7ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ad4a5,_0x5057cb,_0x40ea6e){return new BPromise(function(_0x59c3c4,_0x30dad8){return client[_0xb7ad('0x9')](_0x5ad4a5,_0x40ea6e)[_0xb7ad('0xa')](function(_0x4238e1){logger[_0xb7ad('0xb')](_0xb7ad('0xc'),_0x5057cb,_0xb7ad('0xd'));logger[_0xb7ad('0xe')](_0xb7ad('0xf'),_0x5057cb,_0xb7ad('0xd'),JSON[_0xb7ad('0x10')](_0x4238e1));if(_0x4238e1['error']){if(_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x12')]===0x1f4){logger[_0xb7ad('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5057cb,_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x13')]);return _0x30dad8(_0x4238e1[_0xb7ad('0x11')]['message']);}logger['error'](_0xb7ad('0xc'),_0x5057cb,_0x4238e1['error'][_0xb7ad('0x13')]);return _0x59c3c4(_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x13')]);}else{logger[_0xb7ad('0xb')]('CmCustomField,\x20%s,\x20%s',_0x5057cb,'request\x20sent');_0x59c3c4(_0x4238e1[_0xb7ad('0x14')][_0xb7ad('0x13')]);}})['catch'](function(_0x1a017b){logger[_0xb7ad('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5057cb,_0x1a017b);_0x30dad8(_0x1a017b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index c00a1ad..973dabd 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 _0xbe2a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util'];(function(_0x49d511,_0x38e1a5){var _0x36001b=function(_0x50f87d){while(--_0x50f87d){_0x49d511['push'](_0x49d511['shift']());}};_0x36001b(++_0x38e1a5);}(_0xbe2a,0x1d9));var _0xabe2=function(_0xdc1177,_0x212ccd){_0xdc1177=_0xdc1177-0x0;var _0x24c7b9=_0xbe2a[_0xdc1177];return _0x24c7b9;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var fs_extra=require(_0xabe2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xabe2('0x7'));var config=require('../../config/environment');var controller=require(_0xabe2('0x8'));router[_0xabe2('0x9')]('/',auth[_0xabe2('0xa')](),controller[_0xabe2('0xb')]);router[_0xabe2('0x9')](_0xabe2('0xc'),auth['isAuthenticated'](),controller[_0xabe2('0xd')]);router[_0xabe2('0xe')]('/',auth[_0xabe2('0xa')](),controller[_0xabe2('0xf')]);router[_0xabe2('0x10')](_0xabe2('0xc'),auth['isAuthenticated'](),controller[_0xabe2('0x11')]);router[_0xabe2('0x12')](_0xabe2('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2f91=['isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x44414f,_0x27a407){var _0x3edcc3=function(_0x51ed21){while(--_0x51ed21){_0x44414f['push'](_0x44414f['shift']());}};_0x3edcc3(++_0x27a407);}(_0x2f91,0x98));var _0x12f9=function(_0x1fe224,_0x110738){_0x1fe224=_0x1fe224-0x0;var _0x300515=_0x2f91[_0x1fe224];return _0x300515;};'use strict';var multer=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var path=require(_0x12f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x12f9('0x3'));var router=express[_0x12f9('0x4')]();var fs_extra=require(_0x12f9('0x5'));var auth=require(_0x12f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12f9('0x7'));var controller=require(_0x12f9('0x8'));router[_0x12f9('0x9')]('/',auth[_0x12f9('0xa')](),controller['index']);router[_0x12f9('0x9')](_0x12f9('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x12f9('0xa')](),controller[_0x12f9('0xc')]);router[_0x12f9('0xd')](_0x12f9('0xb'),auth[_0x12f9('0xa')](),controller[_0x12f9('0xe')]);router[_0x12f9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x12f9('0x10')]);module[_0x12f9('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index ca2d45e..3ce5859 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 _0x0614=['exports','STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment'];(function(_0x187813,_0x8b838a){var _0x182ae0=function(_0x2e7e03){while(--_0x2e7e03){_0x187813['push'](_0x187813['shift']());}};_0x182ae0(++_0x8b838a);}(_0x0614,0x194));var _0x4061=function(_0x5dbb90,_0x355ab6){_0x5dbb90=_0x5dbb90-0x0;var _0x4e6b70=_0x0614[_0x5dbb90];return _0x4e6b70;};'use strict';var moment=require(_0x4061('0x0'));var Sequelize=require('sequelize');module[_0x4061('0x1')]={'phone':{'type':Sequelize[_0x4061('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4061('0x3')],'defaultValue':moment()[_0x4061('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4061('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4061('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4061('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4061('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4061('0x5')],'unique':_0x4061('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x4061('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x4061('0x5')],'unique':_0x4061('0x8')},'CampaignId':{'type':Sequelize[_0x4061('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4061('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x4061('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x4061('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xb987=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format'];(function(_0x1e6956,_0xb7be5c){var _0x52d73e=function(_0x365846){while(--_0x365846){_0x1e6956['push'](_0x1e6956['shift']());}};_0x52d73e(++_0xb7be5c);}(_0xb987,0x16c));var _0x7b98=function(_0x444b13,_0x119afe){_0x444b13=_0x444b13-0x0;var _0x1c12dc=_0xb987[_0x444b13];return _0x1c12dc;};'use strict';var moment=require(_0x7b98('0x0'));var Sequelize=require(_0x7b98('0x1'));module['exports']={'phone':{'type':Sequelize[_0x7b98('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7b98('0x4')],'defaultValue':moment()[_0x7b98('0x5')](_0x7b98('0x6'))},'countbusyretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7b98('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7b98('0x4')]},'priority':{'type':Sequelize[_0x7b98('0x7')](0x2)[_0x7b98('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7b98('0x7')],'unique':_0x7b98('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x7b98('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x7b98('0x7')],'unique':_0x7b98('0x9')},'CampaignId':{'type':Sequelize[_0x7b98('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7b98('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7b98('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x7b98('0x4')],'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 de5e3c0..0765e3c 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 _0x8819=['dialActive','getPreviewRecall','transaction','findOne','CmCompany','List','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','getTimezone','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','limit','count','offset','set','sendStatus','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','$and','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','find','body','update','describe','destroy','params','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','create','CmHopperAdditionalPhone','getPreview','CmContact','getVoiceQueues','preview','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','Company','CmList'];(function(_0x225a75,_0x43c1de){var _0xee995d=function(_0x31a816){while(--_0x31a816){_0x225a75['push'](_0x225a75['shift']());}};_0xee995d(++_0x43c1de);}(_0x8819,0x94));var _0x9881=function(_0x360dfd,_0x226108){_0x360dfd=_0x360dfd-0x0;var _0x5e6a2f=_0x8819[_0x360dfd];return _0x5e6a2f;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x9881('0x0'));var logger=require(_0x9881('0x1'))(_0x9881('0x2'));var shared=require(_0x9881('0x3'));var db=require(_0x9881('0x4'))['db'];function respondWithResult(_0x5e52c5,_0x333d6f){_0x333d6f=_0x333d6f||0xc8;return function(_0x446deb){if(_0x446deb){return _0x5e52c5[_0x9881('0x5')](_0x333d6f)[_0x9881('0x6')](_0x446deb);}};}function respondWithFilteredResult(_0x1791fd,_0x2a3664){return function(_0x5f1d45){if(_0x5f1d45){var _0x353966=typeof _0x2a3664['offset']==='undefined'&&typeof _0x2a3664[_0x9881('0x7')]==='undefined';var _0x5c2c0f=_0x5f1d45[_0x9881('0x8')];var _0x4adf62=_0x353966?0x0:_0x2a3664[_0x9881('0x9')];var _0x39122e=_0x353966?_0x5f1d45[_0x9881('0x8')]:_0x2a3664['offset']+_0x2a3664[_0x9881('0x7')];var _0x1327e8;if(_0x39122e>=_0x5c2c0f){_0x39122e=_0x5c2c0f;_0x1327e8=0xc8;}else{_0x1327e8=0xce;}_0x1791fd[_0x9881('0x5')](_0x1327e8);return _0x1791fd[_0x9881('0xa')]('Content-Range',_0x4adf62+'-'+_0x39122e+'/'+_0x5c2c0f)[_0x9881('0x6')](_0x5f1d45);}return null;};}function saveUpdates(_0x26ee3f,_0x5c6d2d){return function(_0x42850e){if(_0x42850e){return _0x42850e['update'](_0x26ee3f)['then'](function(_0x48cfe1){return _0x48cfe1;});}return null;};}function handleEntityNotFound(_0x58f526,_0x12794f){return function(_0x3178d7){if(!_0x3178d7){_0x58f526[_0x9881('0xb')](0x194);}return _0x3178d7;};}function handleError(_0x1947e8,_0x39d127){_0x39d127=_0x39d127||0x1f4;return function(_0x1d57ea){logger['error'](_0x1d57ea[_0x9881('0xc')]);if(_0x1d57ea[_0x9881('0xd')]){delete _0x1d57ea[_0x9881('0xd')];}_0x1947e8['status'](_0x39d127)['send'](_0x1d57ea);};}exports['index']=function(_0x280ea2,_0x4c3493){var _0x620a9a={},_0x5a9848={},_0x59ff56={'count':0x0,'rows':[]};var _0x1f6e20=_[_0x9881('0xe')](db[_0x9881('0xf')][_0x9881('0x10')],function(_0x43f8a2){return{'name':_0x43f8a2[_0x9881('0x11')],'type':_0x43f8a2[_0x9881('0x12')][_0x9881('0x13')]};});_0x5a9848[_0x9881('0x14')]=_[_0x9881('0xe')](_0x1f6e20,_0x9881('0xd'));_0x5a9848[_0x9881('0x15')]=_[_0x9881('0x16')](_0x280ea2[_0x9881('0x15')]);_0x5a9848[_0x9881('0x17')]=_['intersection'](_0x5a9848['model'],_0x5a9848[_0x9881('0x15')]);_0x5a9848['filters']=_['concat'](_0x5a9848[_0x9881('0x17')],[_0x9881('0x18'),'$or','$gt',_0x9881('0x19'),'$lt',_0x9881('0x1a'),_0x9881('0x1b'),_0x9881('0x1c'),_0x9881('0x1d'),_0x9881('0x1e'),_0x9881('0x1f'),_0x9881('0x20'),_0x9881('0x21'),_0x9881('0x22'),_0x9881('0x23'),_0x9881('0x24'),_0x9881('0x25'),_0x9881('0x22'),'$overlap',_0x9881('0x26'),_0x9881('0x27'),'$any']);_0x620a9a[_0x9881('0x28')]=_[_0x9881('0x29')](_0x5a9848['model'],qs[_0x9881('0x2a')](_0x280ea2[_0x9881('0x15')][_0x9881('0x2a')]));_0x620a9a[_0x9881('0x28')]=_0x620a9a[_0x9881('0x28')][_0x9881('0x2b')]?_0x620a9a[_0x9881('0x28')]:_0x5a9848[_0x9881('0x14')];if(!_0x280ea2['query'][_0x9881('0x2c')](_0x9881('0x2d'))){_0x620a9a[_0x9881('0x7')]=qs[_0x9881('0x7')](_0x280ea2[_0x9881('0x15')][_0x9881('0x7')]);_0x620a9a['offset']=qs[_0x9881('0x9')](_0x280ea2[_0x9881('0x15')]['offset']);}_0x620a9a[_0x9881('0x2e')]=qs[_0x9881('0x2f')](_0x280ea2[_0x9881('0x15')][_0x9881('0x2f')]);_0x620a9a[_0x9881('0x30')]=qs['filters'](_[_0x9881('0x31')](_0x280ea2[_0x9881('0x15')],_0x5a9848[_0x9881('0x17')]),_0x1f6e20);if(_0x280ea2[_0x9881('0x15')][_0x9881('0x32')]){_0x620a9a[_0x9881('0x30')]=_[_0x9881('0x33')](_0x620a9a[_0x9881('0x30')],{'$or':_[_0x9881('0xe')](_0x1f6e20,function(_0x26c829){if(_0x26c829[_0x9881('0x12')]!==_0x9881('0x34')){var _0xfff6a5={};_0xfff6a5[_0x26c829[_0x9881('0xd')]]={'$like':'%'+_0x280ea2[_0x9881('0x15')][_0x9881('0x32')]+'%'};return _0xfff6a5;}})});}_0x620a9a=_['merge']({},_0x620a9a,_0x280ea2[_0x9881('0x35')]);var _0x5f14d5={'where':_0x620a9a[_0x9881('0x30')]};return db['CmHopper'][_0x9881('0x8')](_0x5f14d5)[_0x9881('0x36')](function(_0x4c865e){_0x59ff56[_0x9881('0x8')]=_0x4c865e;if(_0x280ea2['query'][_0x9881('0x37')]){_0x620a9a[_0x9881('0x38')]=[{'all':!![]}];}return db[_0x9881('0xf')][_0x9881('0x39')](_0x620a9a);})['then'](function(_0x2b2a0b){_0x59ff56[_0x9881('0x3a')]=_0x2b2a0b;return _0x59ff56;})[_0x9881('0x36')](respondWithFilteredResult(_0x4c3493,_0x620a9a))[_0x9881('0x3b')](handleError(_0x4c3493,null));};exports[_0x9881('0x3c')]=function(_0x201dcd,_0x100139){var _0x4feb70={'raw':!![],'where':{'id':_0x201dcd['params']['id']}},_0x3f25db={};_0x3f25db[_0x9881('0x14')]=_[_0x9881('0x16')](db[_0x9881('0xf')]['rawAttributes']);_0x3f25db[_0x9881('0x15')]=_[_0x9881('0x16')](_0x201dcd[_0x9881('0x15')]);_0x3f25db['filters']=_[_0x9881('0x29')](_0x3f25db[_0x9881('0x14')],_0x3f25db['query']);_0x4feb70[_0x9881('0x28')]=_[_0x9881('0x29')](_0x3f25db[_0x9881('0x14')],qs[_0x9881('0x2a')](_0x201dcd[_0x9881('0x15')][_0x9881('0x2a')]));_0x4feb70[_0x9881('0x28')]=_0x4feb70[_0x9881('0x28')][_0x9881('0x2b')]?_0x4feb70[_0x9881('0x28')]:_0x3f25db['model'];if(_0x201dcd[_0x9881('0x15')][_0x9881('0x37')]){_0x4feb70[_0x9881('0x38')]=[{'all':!![]}];}_0x4feb70=_[_0x9881('0x33')]({},_0x4feb70,_0x201dcd[_0x9881('0x35')]);return db['CmHopper'][_0x9881('0x3d')](_0x4feb70)[_0x9881('0x36')](handleEntityNotFound(_0x100139,null))[_0x9881('0x36')](respondWithResult(_0x100139,null))[_0x9881('0x3b')](handleError(_0x100139,null));};exports['create']=function(_0x28f0c0,_0xc9713c){return db[_0x9881('0xf')]['create'](_0x28f0c0[_0x9881('0x3e')],{})[_0x9881('0x36')](respondWithResult(_0xc9713c,0xc9))[_0x9881('0x3b')](handleError(_0xc9713c,null));};exports[_0x9881('0x3f')]=function(_0x193c45,_0x391777){if(_0x193c45[_0x9881('0x3e')]['id']){delete _0x193c45[_0x9881('0x3e')]['id'];}return db[_0x9881('0xf')][_0x9881('0x3d')]({'where':{'id':_0x193c45['params']['id']}})[_0x9881('0x36')](handleEntityNotFound(_0x391777,null))[_0x9881('0x36')](saveUpdates(_0x193c45[_0x9881('0x3e')],null))['then'](respondWithResult(_0x391777,null))[_0x9881('0x3b')](handleError(_0x391777,null));};exports[_0x9881('0x40')]=function(_0x1e1f0f,_0x573b4f){return db['CmHopper'][_0x9881('0x40')]()[_0x9881('0x36')](respondWithResult(_0x573b4f,null))[_0x9881('0x3b')](handleError(_0x573b4f,null));};exports[_0x9881('0x41')]=function(_0x49c478,_0x514263){var _0x3689d7;var _0x355357=_0x49c478[_0x9881('0x42')]['id'];return db['CmHopper'][_0x9881('0x3d')]({'where':{'id':_0x49c478[_0x9881('0x42')]['id']}})['then'](handleEntityNotFound(_0x514263,null))[_0x9881('0x36')](function(_0x262b8b){if(_0x262b8b){return _0x262b8b[_0x9881('0x41')]()[_0x9881('0x36')](function(_0x21720a){return _0x21720a;});}})[_0x9881('0x36')](function(_0x43f17d){_0x3689d7=_0x43f17d;if(_0x43f17d){if(_0x43f17d['VoiceQueueId']||_0x43f17d[_0x9881('0x43')]){return db[_0x43f17d['VoiceQueueId']?_0x9881('0x44'):_0x9881('0x45')][_0x9881('0x3d')]({'where':{'id':_0x43f17d[_0x9881('0x46')]?_0x43f17d['VoiceQueueId']:_0x43f17d['CampaignId']},'attributes':['id',_0x9881('0xd')],'raw':!![]});}}})[_0x9881('0x36')](function(_0x2fdba2){var _0x49d8b6={};if(_0x2fdba2){_[_0x9881('0x33')](_0x49d8b6,_[_0x9881('0x47')](_0x3689d7[_0x9881('0x48')],[_0x9881('0x49'),_0x9881('0x4a'),'id']));_0x49d8b6[_0x9881('0x4b')]=0x15;_0x49d8b6['statedesc']=_0x9881('0x4c');_0x49d8b6[_0x9881('0x4d')]=_0x2fdba2[_0x9881('0xd')];_0x49d8b6[_0x9881('0x4e')]=_0x49c478[_0x9881('0x4f')]['name'];_0x49d8b6['UserId']=_0x49c478['user']['id'];_0x49d8b6[_0x9881('0x4c')]=!![];_0x49d8b6[_0x9881('0x50')]=moment()[_0x9881('0x51')](_0x9881('0x52'));_0x49d8b6[_0x9881('0x53')]=_0x3689d7[_0x9881('0x54')];_0x49d8b6['campaigntype']=_0x3689d7['VoiceQueueId']?_0x9881('0x55'):_0x9881('0x56');return db['CmContact'][_0x9881('0x3d')]({'where':{'id':_0x49d8b6[_0x9881('0x57')]},'attributes':[_0x9881('0x58'),_0x9881('0x59')]})['then'](function(_0x3efda3){if(!_['isNil'](_0x514263)&&!_[_0x9881('0x5a')](_0x3efda3[_0x9881('0x58')])){_0x49d8b6[_0x9881('0x5b')]=_0x3efda3['firstName'];if(!_['isNil'](_0x3efda3['lastName'])){_0x49d8b6[_0x9881('0x5b')]+='\x20'+_0x3efda3[_0x9881('0x59')];}}})['finally'](function(){return db[_0x9881('0x5c')][_0x9881('0x5d')](_0x49d8b6);});}})[_0x9881('0x36')](function(_0x165274){return db[_0x9881('0x5e')][_0x9881('0x41')]({'where':{'CmHopperId':_0x355357}});})[_0x9881('0x36')](function(){return _0x514263[_0x9881('0x5')](0xcc)['end']();})['catch'](handleError(_0x514263,null));};exports[_0x9881('0x5f')]=function(_0x4012d9,_0xb9d0ac){var _0x12f6eb=[];return db[_0x9881('0x60')][_0x9881('0x40')]()['then'](function(_0x438a14){_0x12f6eb=_[_0x9881('0x16')](_0x438a14);return _0x4012d9[_0x9881('0x4f')][_0x9881('0x61')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9881('0x62')},'attributes':['id','dialOrderByScheduledAt',_0x9881('0x63')],'raw':!![]});})[_0x9881('0x36')](function(_0xc1fd9b){if(_0xc1fd9b&&_0xc1fd9b[_0x9881('0x2b')]){return db['sequelize']['transaction'](function(_0x23f6cf){var _0x5d218e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9881('0x52'))},'VoiceQueueId':{'$in':_[_0x9881('0xe')](_0xc1fd9b,'id')},'$or':[{'UserId':null},{'UserId':_0x4012d9[_0x9881('0x4f')]['id']}]};var _0x4b5491={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xc1fd9b)[_0x9881('0x32')]([_0x9881('0x63'),0x0])['map']('id')[_0x9881('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x4012d9[_0x9881('0x4f')]['id']}]};var _0x4d5ea0={'$or':[_0x5d218e,_0x4b5491]};var _0x21503c=[];if(_0x4012d9['body'][_0x9881('0x65')]&&_0x4012d9[_0x9881('0x3e')][_0x9881('0x65')]===_0x9881('0x66')){if(!_[_0x9881('0x67')](_0x4012d9[_0x9881('0x3e')]['hopperIds'])){_0x4d5ea0['id']={'$in':_0x4012d9[_0x9881('0x3e')][_0x9881('0x68')]};}_0x21503c=[[_0x9881('0x69'),_0x9881('0x6a')],[_0x9881('0x6b'),_0xc1fd9b[0x0][_0x9881('0x6c')]===_0x9881('0x6a')?_0x9881('0x6d'):_0x9881('0x6a')],db[_0x9881('0x6e')][_0x9881('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x9881('0x6d')]];}else{if(!_[_0x9881('0x67')](_0x4012d9['body'][_0x9881('0x68')])){_0x4d5ea0['id']={'$notIn':_0x4012d9[_0x9881('0x3e')]['hopperIds']};}_0x21503c=[[_0x9881('0x69'),_0x9881('0x6d')],[_0x9881('0x6b'),_0xc1fd9b[0x0][_0x9881('0x6c')]],db[_0x9881('0x6e')]['literal'](_0x9881('0x70')),['id',_0x9881('0x6a')]];}return db[_0x9881('0xf')]['findOne']({'attributes':['id',_0x9881('0x71'),_0x9881('0x54'),_0x9881('0x72')],'where':_0x4d5ea0,'order':_0x21503c,'transaction':_0x23f6cf,'lock':_0x23f6cf[_0x9881('0x73')][_0x9881('0x74')],'include':[{'model':db['CmContact'],'as':_0x9881('0x75'),'attributes':_0x12f6eb,'include':[{'model':db['CmCompany'],'as':_0x9881('0x76'),'attributes':['id',_0x9881('0xd')]}]},{'model':db[_0x9881('0x77')],'as':'List','attributes':['id',_0x9881('0xd')]},{'model':db[_0x9881('0x44')],'as':'Queue','attributes':['id',_0x9881('0xd'),_0x9881('0x78')]}]})[_0x9881('0x36')](function(_0x4263ac){if(_0x4263ac){return _0x4263ac[_0x9881('0x3f')]({'UserId':_0x4012d9[_0x9881('0x4f')]['id']},{'transaction':_0x23f6cf});}});});}})['then'](handleEntityNotFound(_0xb9d0ac,null))[_0x9881('0x36')](respondWithResult(_0xb9d0ac,null))[_0x9881('0x3b')](handleError(_0xb9d0ac,null));};exports[_0x9881('0x79')]=function(_0x15f887,_0x578ac5,_0x1489cf){var _0x30bd50=[];var _0x5125c1=_0x15f887[_0x9881('0x42')]['id'];var _0x30a343=_0x15f887[_0x9881('0x4f')]['id'];return db['CmContact']['describe']()['then'](function(_0x57c931){_0x30bd50=_[_0x9881('0x16')](_0x57c931);return db[_0x9881('0x6e')][_0x9881('0x7a')](function(_0x237757){const _0x47739f={'id':_0x5125c1};return db[_0x9881('0xf')][_0x9881('0x7b')]({'attributes':['id',_0x9881('0x71'),'recallme'],'where':_0x47739f,'transaction':_0x237757,'lock':_0x237757[_0x9881('0x73')][_0x9881('0x74')],'include':[{'model':db[_0x9881('0x60')],'as':'Contact','attributes':_0x30bd50,'include':[{'model':db[_0x9881('0x7c')],'as':_0x9881('0x76'),'attributes':['id',_0x9881('0xd')]}]},{'model':db[_0x9881('0x77')],'as':_0x9881('0x7d'),'attributes':['id',_0x9881('0xd')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x9881('0xd'),_0x9881('0x78')]}]})[_0x9881('0x36')](function(_0x54af49){if(_0x54af49){return _0x54af49[_0x9881('0x3f')]({'UserId':_0x30a343},{'transaction':_0x237757});}});});})[_0x9881('0x36')](handleEntityNotFound(_0x578ac5,null))[_0x9881('0x36')](respondWithResult(_0x578ac5,null))['catch'](handleError(_0x578ac5,null));};exports[_0x9881('0x7e')]=function(_0x13dc4d,_0x2f654f){return _0x13dc4d[_0x9881('0x4f')][_0x9881('0x61')]({'where':{'type':_0x9881('0x7f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x21bc73){if(_0x21bc73&&_0x21bc73[_0x9881('0x2b')]){return db['CmHopper'][_0x9881('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9881('0x51')](_0x9881('0x52'))},'VoiceQueueId':{'$in':_[_0x9881('0xe')](_0x21bc73,'id')},'$or':[{'UserId':null},{'UserId':_0x13dc4d['user']['id']}]}});}return 0x0;})[_0x9881('0x36')](function(_0x569561){if(!_[_0x9881('0x5a')](_0x569561)&&_[_0x9881('0x80')](_0x569561)){return _0x2f654f[_0x9881('0x5')](0xc8)['json']({'contacts':_0x569561});}else{logger['error'](_0x9881('0x81'),_0x9881('0x7e'),0x194,_0x9881('0x82'));_0x2f654f['sendStatus'](0x194);}})[_0x9881('0x3b')](handleError(_0x2f654f,null));};exports[_0x9881('0x83')]=function(_0x942159,_0x1c8218){var _0x19937d=shared[_0x9881('0x84')];var _0x5f26da=[];_[_0x9881('0xe')](_0x19937d,function(_0x487668){_0x5f26da['push']({'id':_0x487668[_0x9881('0xd')],'name':_0x487668[_0x9881('0xd')],'utcOffset':_0x487668['utcOffset']});});return _0x1c8218[_0x9881('0x5')](0xc8)['json']({'tz':_0x5f26da});};exports[_0x9881('0x85')]=function(_0x21a524,_0x2d598b){var _0x5e8c3a=shared[_0x9881('0x84')];var _0x49ea3d={};if(!_[_0x9881('0x5a')](_0x5e8c3a[_0x21a524[_0x9881('0x3e')]['id']]))_0x49ea3d=_0x5e8c3a[_0x21a524[_0x9881('0x3e')]['id']];return _0x2d598b[_0x9881('0x5')](0xc8)[_0x9881('0x6')](_0x49ea3d);}; \ No newline at end of file +var _0xb717=['LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','scheduledat','recallme','Contact','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','then','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$or','$gte','$lt','$lte','$ne','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$any','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','UserId','user','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne'];(function(_0x3e9d48,_0x4079a4){var _0x4050ba=function(_0x4a2b79){while(--_0x4a2b79){_0x3e9d48['push'](_0x3e9d48['shift']());}};_0x4050ba(++_0x4079a4);}(_0xb717,0x1b4));var _0x7b71=function(_0x126d27,_0x3d45de){_0x126d27=_0x126d27-0x0;var _0x8f915a=_0xb717[_0x126d27];return _0x8f915a;};'use strict';var moment=require(_0x7b71('0x0'));var _=require('lodash');var qs=require(_0x7b71('0x1'));var logger=require('../../config/logger')(_0x7b71('0x2'));var shared=require(_0x7b71('0x3'));var db=require(_0x7b71('0x4'))['db'];function respondWithResult(_0x52c5dd,_0x238319){_0x238319=_0x238319||0xc8;return function(_0x2e583f){if(_0x2e583f){return _0x52c5dd[_0x7b71('0x5')](_0x238319)[_0x7b71('0x6')](_0x2e583f);}};}function respondWithFilteredResult(_0x3d3643,_0x593c15){return function(_0x217efe){if(_0x217efe){var _0x27b060=typeof _0x593c15[_0x7b71('0x7')]===_0x7b71('0x8')&&typeof _0x593c15[_0x7b71('0x9')]==='undefined';var _0x18867f=_0x217efe[_0x7b71('0xa')];var _0x53857a=_0x27b060?0x0:_0x593c15[_0x7b71('0x7')];var _0x45bbcd=_0x27b060?_0x217efe[_0x7b71('0xa')]:_0x593c15['offset']+_0x593c15[_0x7b71('0x9')];var _0x4a39d4;if(_0x45bbcd>=_0x18867f){_0x45bbcd=_0x18867f;_0x4a39d4=0xc8;}else{_0x4a39d4=0xce;}_0x3d3643[_0x7b71('0x5')](_0x4a39d4);return _0x3d3643['set'](_0x7b71('0xb'),_0x53857a+'-'+_0x45bbcd+'/'+_0x18867f)[_0x7b71('0x6')](_0x217efe);}return null;};}function saveUpdates(_0x291ba5,_0x101181){return function(_0x45c890){if(_0x45c890){return _0x45c890['update'](_0x291ba5)[_0x7b71('0xc')](function(_0x481d32){return _0x481d32;});}return null;};}function handleEntityNotFound(_0x121e8f,_0x22114a){return function(_0x4f1f41){if(!_0x4f1f41){_0x121e8f[_0x7b71('0xd')](0x194);}return _0x4f1f41;};}function handleError(_0x3598cc,_0x4266e5){_0x4266e5=_0x4266e5||0x1f4;return function(_0x5888f9){logger['error'](_0x5888f9[_0x7b71('0xe')]);if(_0x5888f9[_0x7b71('0xf')]){delete _0x5888f9[_0x7b71('0xf')];}_0x3598cc[_0x7b71('0x5')](_0x4266e5)['send'](_0x5888f9);};}exports[_0x7b71('0x10')]=function(_0x5ca420,_0x4adce8){var _0x1fd67d={},_0xbde25={},_0x2c35c4={'count':0x0,'rows':[]};var _0x46c47d=_[_0x7b71('0x11')](db['CmHopper'][_0x7b71('0x12')],function(_0x1cdbd0){return{'name':_0x1cdbd0[_0x7b71('0x13')],'type':_0x1cdbd0[_0x7b71('0x14')][_0x7b71('0x15')]};});_0xbde25[_0x7b71('0x16')]=_['map'](_0x46c47d,_0x7b71('0xf'));_0xbde25[_0x7b71('0x17')]=_[_0x7b71('0x18')](_0x5ca420[_0x7b71('0x17')]);_0xbde25['filters']=_['intersection'](_0xbde25[_0x7b71('0x16')],_0xbde25[_0x7b71('0x17')]);_0xbde25[_0x7b71('0x19')]=_[_0x7b71('0x1a')](_0xbde25[_0x7b71('0x19')],['$and',_0x7b71('0x1b'),'$gt',_0x7b71('0x1c'),_0x7b71('0x1d'),_0x7b71('0x1e'),_0x7b71('0x1f'),'$eq','$not',_0x7b71('0x20'),_0x7b71('0x21'),'$in',_0x7b71('0x22'),_0x7b71('0x23'),_0x7b71('0x24'),_0x7b71('0x25'),_0x7b71('0x26'),'$like','$overlap',_0x7b71('0x27'),'$contained',_0x7b71('0x28')]);_0x1fd67d['attributes']=_[_0x7b71('0x29')](_0xbde25[_0x7b71('0x16')],qs[_0x7b71('0x2a')](_0x5ca420['query'][_0x7b71('0x2a')]));_0x1fd67d[_0x7b71('0x2b')]=_0x1fd67d[_0x7b71('0x2b')]['length']?_0x1fd67d[_0x7b71('0x2b')]:_0xbde25[_0x7b71('0x16')];if(!_0x5ca420[_0x7b71('0x17')][_0x7b71('0x2c')](_0x7b71('0x2d'))){_0x1fd67d[_0x7b71('0x9')]=qs[_0x7b71('0x9')](_0x5ca420[_0x7b71('0x17')]['limit']);_0x1fd67d[_0x7b71('0x7')]=qs[_0x7b71('0x7')](_0x5ca420[_0x7b71('0x17')]['offset']);}_0x1fd67d[_0x7b71('0x2e')]=qs[_0x7b71('0x2f')](_0x5ca420[_0x7b71('0x17')][_0x7b71('0x2f')]);_0x1fd67d[_0x7b71('0x30')]=qs[_0x7b71('0x19')](_['pick'](_0x5ca420[_0x7b71('0x17')],_0xbde25[_0x7b71('0x19')]),_0x46c47d);if(_0x5ca420[_0x7b71('0x17')][_0x7b71('0x31')]){_0x1fd67d[_0x7b71('0x30')]=_['merge'](_0x1fd67d[_0x7b71('0x30')],{'$or':_[_0x7b71('0x11')](_0x46c47d,function(_0x28bb40){if(_0x28bb40[_0x7b71('0x14')]!==_0x7b71('0x32')){var _0x27c98c={};_0x27c98c[_0x28bb40[_0x7b71('0xf')]]={'$like':'%'+_0x5ca420[_0x7b71('0x17')]['filter']+'%'};return _0x27c98c;}})});}_0x1fd67d=_[_0x7b71('0x33')]({},_0x1fd67d,_0x5ca420[_0x7b71('0x34')]);var _0x2a3330={'where':_0x1fd67d[_0x7b71('0x30')]};return db[_0x7b71('0x35')][_0x7b71('0xa')](_0x2a3330)[_0x7b71('0xc')](function(_0x4d58d5){_0x2c35c4[_0x7b71('0xa')]=_0x4d58d5;if(_0x5ca420[_0x7b71('0x17')][_0x7b71('0x36')]){_0x1fd67d[_0x7b71('0x37')]=[{'all':!![]}];}return db['CmHopper'][_0x7b71('0x38')](_0x1fd67d);})[_0x7b71('0xc')](function(_0x3cd757){_0x2c35c4[_0x7b71('0x39')]=_0x3cd757;return _0x2c35c4;})[_0x7b71('0xc')](respondWithFilteredResult(_0x4adce8,_0x1fd67d))[_0x7b71('0x3a')](handleError(_0x4adce8,null));};exports[_0x7b71('0x3b')]=function(_0x343d7e,_0x30e9d1){var _0x6cc0ab={'raw':!![],'where':{'id':_0x343d7e[_0x7b71('0x3c')]['id']}},_0xa1db9f={};_0xa1db9f['model']=_[_0x7b71('0x18')](db[_0x7b71('0x35')]['rawAttributes']);_0xa1db9f[_0x7b71('0x17')]=_[_0x7b71('0x18')](_0x343d7e[_0x7b71('0x17')]);_0xa1db9f[_0x7b71('0x19')]=_[_0x7b71('0x29')](_0xa1db9f['model'],_0xa1db9f[_0x7b71('0x17')]);_0x6cc0ab[_0x7b71('0x2b')]=_[_0x7b71('0x29')](_0xa1db9f[_0x7b71('0x16')],qs[_0x7b71('0x2a')](_0x343d7e['query']['fields']));_0x6cc0ab[_0x7b71('0x2b')]=_0x6cc0ab['attributes'][_0x7b71('0x3d')]?_0x6cc0ab[_0x7b71('0x2b')]:_0xa1db9f[_0x7b71('0x16')];if(_0x343d7e[_0x7b71('0x17')][_0x7b71('0x36')]){_0x6cc0ab[_0x7b71('0x37')]=[{'all':!![]}];}_0x6cc0ab=_[_0x7b71('0x33')]({},_0x6cc0ab,_0x343d7e['options']);return db[_0x7b71('0x35')][_0x7b71('0x3e')](_0x6cc0ab)['then'](handleEntityNotFound(_0x30e9d1,null))[_0x7b71('0xc')](respondWithResult(_0x30e9d1,null))[_0x7b71('0x3a')](handleError(_0x30e9d1,null));};exports[_0x7b71('0x3f')]=function(_0x443e61,_0x1b8fc3){return db[_0x7b71('0x35')][_0x7b71('0x3f')](_0x443e61[_0x7b71('0x40')],{})[_0x7b71('0xc')](respondWithResult(_0x1b8fc3,0xc9))[_0x7b71('0x3a')](handleError(_0x1b8fc3,null));};exports[_0x7b71('0x41')]=function(_0x1080e2,_0x153084){if(_0x1080e2['body']['id']){delete _0x1080e2[_0x7b71('0x40')]['id'];}return db[_0x7b71('0x35')]['find']({'where':{'id':_0x1080e2['params']['id']}})['then'](handleEntityNotFound(_0x153084,null))[_0x7b71('0xc')](saveUpdates(_0x1080e2[_0x7b71('0x40')],null))[_0x7b71('0xc')](respondWithResult(_0x153084,null))['catch'](handleError(_0x153084,null));};exports[_0x7b71('0x42')]=function(_0x3f6ae9,_0x50173b){return db[_0x7b71('0x35')][_0x7b71('0x42')]()[_0x7b71('0xc')](respondWithResult(_0x50173b,null))['catch'](handleError(_0x50173b,null));};exports[_0x7b71('0x43')]=function(_0x18cb19,_0x945c68){var _0xc3c557;var _0x20e9ed=_0x18cb19[_0x7b71('0x3c')]['id'];return db[_0x7b71('0x35')][_0x7b71('0x3e')]({'where':{'id':_0x18cb19[_0x7b71('0x3c')]['id']}})[_0x7b71('0xc')](handleEntityNotFound(_0x945c68,null))[_0x7b71('0xc')](function(_0xe6825d){if(_0xe6825d){return _0xe6825d['destroy']()[_0x7b71('0xc')](function(_0x504cdf){return _0x504cdf;});}})[_0x7b71('0xc')](function(_0x154f72){_0xc3c557=_0x154f72;if(_0x154f72){if(_0x154f72[_0x7b71('0x44')]||_0x154f72[_0x7b71('0x45')]){return db[_0x154f72[_0x7b71('0x44')]?_0x7b71('0x46'):'Campaign'][_0x7b71('0x3e')]({'where':{'id':_0x154f72['VoiceQueueId']?_0x154f72['VoiceQueueId']:_0x154f72[_0x7b71('0x45')]},'attributes':['id','name'],'raw':!![]});}}})[_0x7b71('0xc')](function(_0x1e8092){var _0x3bb43f={};if(_0x1e8092){_[_0x7b71('0x33')](_0x3bb43f,_[_0x7b71('0x47')](_0xc3c557[_0x7b71('0x48')],[_0x7b71('0x49'),_0x7b71('0x4a'),'id']));_0x3bb43f[_0x7b71('0x4b')]=0x15;_0x3bb43f[_0x7b71('0x4c')]=_0x7b71('0x4d');_0x3bb43f['campaign']=_0x1e8092['name'];_0x3bb43f[_0x7b71('0x4e')]=_0x18cb19['user'][_0x7b71('0xf')];_0x3bb43f[_0x7b71('0x4f')]=_0x18cb19[_0x7b71('0x50')]['id'];_0x3bb43f['deleted']=!![];_0x3bb43f['deletedat']=moment()['format'](_0x7b71('0x51'));_0x3bb43f['calleridnum']=_0xc3c557[_0x7b71('0x52')];_0x3bb43f[_0x7b71('0x53')]=_0xc3c557['VoiceQueueId']?_0x7b71('0x54'):'ivr';return db[_0x7b71('0x55')]['find']({'where':{'id':_0x3bb43f[_0x7b71('0x56')]},'attributes':['firstName',_0x7b71('0x57')]})['then'](function(_0x1c1f3c){if(!_['isNil'](_0x945c68)&&!_[_0x7b71('0x58')](_0x1c1f3c[_0x7b71('0x59')])){_0x3bb43f[_0x7b71('0x5a')]=_0x1c1f3c['firstName'];if(!_['isNil'](_0x1c1f3c[_0x7b71('0x57')])){_0x3bb43f[_0x7b71('0x5a')]+='\x20'+_0x1c1f3c[_0x7b71('0x57')];}}})[_0x7b71('0x5b')](function(){return db[_0x7b71('0x5c')][_0x7b71('0x3f')](_0x3bb43f);});}})['then'](function(_0x1f7cec){return db[_0x7b71('0x5d')]['destroy']({'where':{'CmHopperId':_0x20e9ed}});})[_0x7b71('0xc')](function(){return _0x945c68['status'](0xcc)[_0x7b71('0x5e')]();})[_0x7b71('0x3a')](handleError(_0x945c68,null));};exports[_0x7b71('0x5f')]=function(_0x357e11,_0x4e478d){var _0x38dbd7=[];return db[_0x7b71('0x55')][_0x7b71('0x42')]()[_0x7b71('0xc')](function(_0x4448a2){_0x38dbd7=_[_0x7b71('0x18')](_0x4448a2);return _0x357e11[_0x7b71('0x50')][_0x7b71('0x60')]({'where':{'type':_0x7b71('0x61'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x7b71('0x62'),_0x7b71('0x63')],'raw':!![]});})[_0x7b71('0xc')](function(_0x1180ed){if(_0x1180ed&&_0x1180ed[_0x7b71('0x3d')]){return db[_0x7b71('0x64')][_0x7b71('0x65')](function(_0x2f1b0b){var _0x144906={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7b71('0x66')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x7b71('0x11')](_0x1180ed,'id')},'$or':[{'UserId':null},{'UserId':_0x357e11['user']['id']}]};var _0x498df3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1180ed)[_0x7b71('0x31')]([_0x7b71('0x63'),0x0])[_0x7b71('0x11')]('id')[_0x7b71('0x67')]()},'$or':[{'UserId':null},{'UserId':_0x357e11[_0x7b71('0x50')]['id']}]};var _0x3fd1f9={'$or':[_0x144906,_0x498df3]};var _0x430edc=[];if(_0x357e11[_0x7b71('0x40')][_0x7b71('0x68')]&&_0x357e11['body'][_0x7b71('0x68')]===_0x7b71('0x69')){if(!_[_0x7b71('0x6a')](_0x357e11['body'][_0x7b71('0x6b')])){_0x3fd1f9['id']={'$in':_0x357e11[_0x7b71('0x40')][_0x7b71('0x6b')]};}_0x430edc=[[_0x7b71('0x6c'),'ASC'],['scheduledAt',_0x1180ed[0x0][_0x7b71('0x62')]===_0x7b71('0x6d')?_0x7b71('0x6e'):_0x7b71('0x6d')],db[_0x7b71('0x64')][_0x7b71('0x6f')](_0x7b71('0x70')),['id',_0x7b71('0x6e')]];}else{if(!_[_0x7b71('0x6a')](_0x357e11['body'][_0x7b71('0x6b')])){_0x3fd1f9['id']={'$notIn':_0x357e11[_0x7b71('0x40')][_0x7b71('0x6b')]};}_0x430edc=[[_0x7b71('0x6c'),_0x7b71('0x6e')],[_0x7b71('0x71'),_0x1180ed[0x0][_0x7b71('0x62')]],db[_0x7b71('0x64')]['literal'](_0x7b71('0x72')),['id',_0x7b71('0x6d')]];}return db['CmHopper'][_0x7b71('0x73')]({'attributes':['id','scheduledat','phone','recallme'],'where':_0x3fd1f9,'order':_0x430edc,'transaction':_0x2f1b0b,'lock':_0x2f1b0b[_0x7b71('0x74')][_0x7b71('0x75')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x38dbd7,'include':[{'model':db[_0x7b71('0x76')],'as':_0x7b71('0x77'),'attributes':['id',_0x7b71('0xf')]}]},{'model':db[_0x7b71('0x78')],'as':_0x7b71('0x79'),'attributes':['id',_0x7b71('0xf')]},{'model':db[_0x7b71('0x46')],'as':_0x7b71('0x7a'),'attributes':['id',_0x7b71('0xf'),_0x7b71('0x7b')]}]})[_0x7b71('0xc')](function(_0x2d0ef1){if(_0x2d0ef1){return _0x2d0ef1[_0x7b71('0x41')]({'UserId':_0x357e11[_0x7b71('0x50')]['id']},{'transaction':_0x2f1b0b});}});});}})[_0x7b71('0xc')](handleEntityNotFound(_0x4e478d,null))[_0x7b71('0xc')](respondWithResult(_0x4e478d,null))[_0x7b71('0x3a')](handleError(_0x4e478d,null));};exports[_0x7b71('0x7c')]=function(_0x58d4a5,_0x55f34c,_0x564b69){var _0x4269a6=[];var _0x58ed1d=_0x58d4a5[_0x7b71('0x3c')]['id'];var _0xe5e271=_0x58d4a5[_0x7b71('0x50')]['id'];return db[_0x7b71('0x55')][_0x7b71('0x42')]()[_0x7b71('0xc')](function(_0x5baa81){_0x4269a6=_[_0x7b71('0x18')](_0x5baa81);return db[_0x7b71('0x64')][_0x7b71('0x65')](function(_0x23b852){const _0x392a99={'id':_0x58ed1d};return db['CmHopper']['findOne']({'attributes':['id',_0x7b71('0x7d'),_0x7b71('0x7e')],'where':_0x392a99,'transaction':_0x23b852,'lock':_0x23b852[_0x7b71('0x74')][_0x7b71('0x75')],'include':[{'model':db[_0x7b71('0x55')],'as':_0x7b71('0x7f'),'attributes':_0x4269a6,'include':[{'model':db[_0x7b71('0x76')],'as':_0x7b71('0x77'),'attributes':['id',_0x7b71('0xf')]}]},{'model':db[_0x7b71('0x78')],'as':_0x7b71('0x79'),'attributes':['id','name']},{'model':db[_0x7b71('0x46')],'as':'Queue','attributes':['id','name',_0x7b71('0x7b')]}]})['then'](function(_0x10b311){if(_0x10b311){return _0x10b311['update']({'UserId':_0xe5e271},{'transaction':_0x23b852});}});});})['then'](handleEntityNotFound(_0x55f34c,null))[_0x7b71('0xc')](respondWithResult(_0x55f34c,null))[_0x7b71('0x3a')](handleError(_0x55f34c,null));};exports[_0x7b71('0x80')]=function(_0x4f91b9,_0x88d1cf){return _0x4f91b9[_0x7b71('0x50')][_0x7b71('0x60')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7b71('0x81')},'attributes':['id'],'raw':!![]})[_0x7b71('0xc')](function(_0x4458f8){if(_0x4458f8&&_0x4458f8[_0x7b71('0x3d')]){return db['CmHopper'][_0x7b71('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7b71('0x66')](_0x7b71('0x51'))},'VoiceQueueId':{'$in':_[_0x7b71('0x11')](_0x4458f8,'id')},'$or':[{'UserId':null},{'UserId':_0x4f91b9[_0x7b71('0x50')]['id']}]}});}return 0x0;})[_0x7b71('0xc')](function(_0x25f71c){if(!_[_0x7b71('0x58')](_0x25f71c)&&_[_0x7b71('0x82')](_0x25f71c)){return _0x88d1cf[_0x7b71('0x5')](0xc8)[_0x7b71('0x6')]({'contacts':_0x25f71c});}else{logger[_0x7b71('0x83')](_0x7b71('0x84'),_0x7b71('0x80'),0x194,'entity\x20not\x20found');_0x88d1cf['sendStatus'](0x194);}})[_0x7b71('0x3a')](handleError(_0x88d1cf,null));};exports[_0x7b71('0x85')]=function(_0x9e404c,_0x3553de){var _0x457115=shared['timezones'];var _0x25c02f=[];_[_0x7b71('0x11')](_0x457115,function(_0x46d05a){_0x25c02f[_0x7b71('0x86')]({'id':_0x46d05a[_0x7b71('0xf')],'name':_0x46d05a[_0x7b71('0xf')],'utcOffset':_0x46d05a[_0x7b71('0x87')]});});return _0x3553de[_0x7b71('0x5')](0xc8)['json']({'tz':_0x25c02f});};exports[_0x7b71('0x88')]=function(_0x57cc1e,_0x56f4d0){var _0x5768b5=shared[_0x7b71('0x89')];var _0x268d9b={};if(!_[_0x7b71('0x58')](_0x5768b5[_0x57cc1e['body']['id']]))_0x268d9b=_0x5768b5[_0x57cc1e[_0x7b71('0x40')]['id']];return _0x56f4d0[_0x7b71('0x5')](0xc8)[_0x7b71('0x6')](_0x268d9b);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 536294b..87636e1 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 _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x5b289f,_0x3c064c){var _0x5922f9=function(_0x4e8330){while(--_0x4e8330){_0x5b289f['push'](_0x5b289f['shift']());}};_0x5922f9(++_0x3c064c);}(_0xeff8,0x186));var _0x8eff=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xeff8[_0x52e363];return _0x3fc2b5;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0xce51e,_0x5d388f){_0xce51e=_0xce51e-0x0;var _0x442be7=_0x687b[_0xce51e];return _0x442be7;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]},{'name':'phone','fields':[_0xb687('0xd')]},{'name':_0xb687('0xe'),'fields':[_0xb687('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 b617920..a323682 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 _0x9fd0=['active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','voicePause','length','UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','describe','all','GetContactRecallMe','GetCmHopperPreview','Contact','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','\x20MINUTE','NOW()','User','Agent','CmList','List','lodash','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','model','attributes','map','catch','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]'];(function(_0x39fede,_0x1de02d){var _0x5f3067=function(_0x788738){while(--_0x788738){_0x39fede['push'](_0x39fede['shift']());}};_0x5f3067(++_0x1de02d);}(_0x9fd0,0x1c2));var _0x09fd=function(_0x4e7ab9,_0x3f6e8a){_0x4e7ab9=_0x4e7ab9-0x0;var _0xbfb8cc=_0x9fd0[_0x4e7ab9];return _0xbfb8cc;};'use strict';var _=require(_0x09fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x09fd('0x1'))['db'];var logger=require(_0x09fd('0x2'))(_0x09fd('0x3'));var jayson=require(_0x09fd('0x4'));var client=jayson[_0x09fd('0x5')][_0x09fd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2da39e,_0x40e6d8,_0x509521){return new BPromise(function(_0x2b9262,_0x161604){return client[_0x09fd('0x7')](_0x2da39e,_0x509521)[_0x09fd('0x8')](function(_0xced1bc){logger[_0x09fd('0x9')](_0x09fd('0xa'),_0x40e6d8,_0x09fd('0xb'));logger[_0x09fd('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x40e6d8,_0x09fd('0xb'),JSON[_0x09fd('0xd')](_0xced1bc));if(_0xced1bc['error']){if(_0xced1bc[_0x09fd('0xe')][_0x09fd('0xf')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x40e6d8,_0xced1bc[_0x09fd('0xe')][_0x09fd('0x10')]);return _0x161604(_0xced1bc['error'][_0x09fd('0x10')]);}logger[_0x09fd('0xe')]('CmHopper,\x20%s,\x20%s',_0x40e6d8,_0xced1bc[_0x09fd('0xe')]['message']);return _0x2b9262(_0xced1bc[_0x09fd('0xe')]['message']);}else{logger[_0x09fd('0x9')](_0x09fd('0xa'),_0x40e6d8,_0x09fd('0xb'));_0x2b9262(_0xced1bc['result']['message']);}})['catch'](function(_0x3aaeea){logger[_0x09fd('0xe')](_0x09fd('0xa'),_0x40e6d8,_0x3aaeea);_0x161604(_0x3aaeea);});});}exports[_0x09fd('0x11')]=function(_0x102bae){var _0x515db7=this;return new Promise(function(_0x2f9d7e,_0x14fc45){return db[_0x09fd('0x12')][_0x09fd('0x13')]({'raw':_0x102bae[_0x09fd('0x14')]?_0x102bae[_0x09fd('0x14')][_0x09fd('0x15')]===undefined?!![]:![]:!![],'where':_0x102bae['options']?_0x102bae['options'][_0x09fd('0x16')]||null:null,'attributes':_0x102bae[_0x09fd('0x14')]?_0x102bae['options']['attributes']||null:null,'limit':_0x102bae[_0x09fd('0x14')]?_0x102bae[_0x09fd('0x14')][_0x09fd('0x17')]||null:null,'include':_0x102bae[_0x09fd('0x14')]?_0x102bae[_0x09fd('0x14')]['include']?_['map'](_0x102bae[_0x09fd('0x14')][_0x09fd('0x18')],function(_0xb183a6){return{'model':db[_0xb183a6[_0x09fd('0x19')]],'as':_0xb183a6['as'],'attributes':_0xb183a6[_0x09fd('0x1a')],'include':_0xb183a6['include']?_[_0x09fd('0x1b')](_0xb183a6[_0x09fd('0x18')],function(_0x7d8706){return{'model':db[_0x7d8706['model']],'as':_0x7d8706['as'],'attributes':_0x7d8706[_0x09fd('0x1a')],'include':_0x7d8706['include']?_[_0x09fd('0x1b')](_0x7d8706[_0x09fd('0x18')],function(_0x1c5861){return{'model':db[_0x1c5861[_0x09fd('0x19')]],'as':_0x1c5861['as'],'attributes':_0x1c5861['attributes']};}):[]};}):[]};}):[]:[]})[_0x09fd('0x8')](function(_0x2f8e1b){logger[_0x09fd('0x9')](_0x09fd('0x11'),_0x102bae);logger[_0x09fd('0xc')](_0x09fd('0x11'),_0x102bae,JSON['stringify'](_0x2f8e1b));_0x2f9d7e(_0x2f8e1b);})[_0x09fd('0x1c')](function(_0x2ed08a){logger[_0x09fd('0xe')](_0x09fd('0x11'),_0x2ed08a[_0x09fd('0x10')],_0x102bae);_0x14fc45(_0x515db7[_0x09fd('0xe')](0x1f4,_0x2ed08a['message']));});});};exports[_0x09fd('0x1d')]=function(_0x56f52d){var _0x172cbe=this;return new Promise(function(_0x10bb1d,_0x2b181f){return db[_0x09fd('0x12')]['find']({'raw':_0x56f52d[_0x09fd('0x14')]?_0x56f52d[_0x09fd('0x14')][_0x09fd('0x15')]===undefined?!![]:![]:!![],'where':_0x56f52d[_0x09fd('0x14')]?_0x56f52d[_0x09fd('0x14')][_0x09fd('0x16')]||null:null,'attributes':_0x56f52d[_0x09fd('0x14')]?_0x56f52d[_0x09fd('0x14')][_0x09fd('0x1a')]||null:null,'include':_0x56f52d['options']?_0x56f52d[_0x09fd('0x14')][_0x09fd('0x18')]?_[_0x09fd('0x1b')](_0x56f52d[_0x09fd('0x14')][_0x09fd('0x18')],function(_0x1e07d4){return{'model':db[_0x1e07d4[_0x09fd('0x19')]],'as':_0x1e07d4['as'],'attributes':_0x1e07d4[_0x09fd('0x1a')],'include':_0x1e07d4['include']?_[_0x09fd('0x1b')](_0x1e07d4[_0x09fd('0x18')],function(_0x1ab18e){return{'model':db[_0x1ab18e[_0x09fd('0x19')]],'as':_0x1ab18e['as'],'attributes':_0x1ab18e[_0x09fd('0x1a')],'include':_0x1ab18e[_0x09fd('0x18')]?_[_0x09fd('0x1b')](_0x1ab18e[_0x09fd('0x18')],function(_0x4760eb){return{'model':db[_0x4760eb[_0x09fd('0x19')]],'as':_0x4760eb['as'],'attributes':_0x4760eb[_0x09fd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x09fd('0x8')](function(_0x578726){logger[_0x09fd('0x9')]('ShowCmHopper',_0x56f52d);logger[_0x09fd('0xc')]('ShowCmHopper',_0x56f52d,JSON[_0x09fd('0xd')](_0x578726));_0x10bb1d(_0x578726);})[_0x09fd('0x1c')](function(_0x4351b4){logger[_0x09fd('0xe')](_0x09fd('0x1d'),_0x4351b4[_0x09fd('0x10')],_0x56f52d);_0x2b181f(_0x172cbe[_0x09fd('0xe')](0x1f4,_0x4351b4[_0x09fd('0x10')]));});});};exports[_0x09fd('0x1e')]=function(_0x4cbe39){var _0x4ecc8a=this;return new Promise(function(_0x3fba61,_0x4320b6){return db['CmHopper'][_0x09fd('0x1f')](_0x4cbe39[_0x09fd('0x20')],{'raw':_0x4cbe39['options']?_0x4cbe39[_0x09fd('0x14')][_0x09fd('0x15')]===undefined?!![]:![]:!![]})[_0x09fd('0x8')](function(_0x53fc0f){logger[_0x09fd('0x9')](_0x09fd('0x1e'),_0x4cbe39);logger[_0x09fd('0xc')]('CreateCmHopper',_0x4cbe39,JSON['stringify'](_0x53fc0f));_0x3fba61(_0x53fc0f);})[_0x09fd('0x1c')](function(_0x511ab7){logger['error'](_0x09fd('0x1e'),_0x511ab7[_0x09fd('0x10')],_0x4cbe39);_0x4320b6(_0x4ecc8a[_0x09fd('0xe')](0x1f4,_0x511ab7[_0x09fd('0x10')]));});});};exports[_0x09fd('0x21')]=function(_0x153164){var _0x694f17=this;return new Promise(function(_0x2c853f,_0x21ab50){return db[_0x09fd('0x12')][_0x09fd('0x22')](_0x153164['body'],{'raw':_0x153164['options']?_0x153164[_0x09fd('0x14')][_0x09fd('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153164[_0x09fd('0x14')]?_0x153164[_0x09fd('0x14')][_0x09fd('0x16')]||null:null,'attributes':_0x153164[_0x09fd('0x14')]?_0x153164[_0x09fd('0x14')][_0x09fd('0x1a')]||null:null,'limit':_0x153164['options']?_0x153164['options']['limit']||null:null})['then'](function(_0x328c5a){logger[_0x09fd('0x9')]('UpdateCmHopper',_0x153164);logger['info'](_0x09fd('0x23'),JSON[_0x09fd('0xd')](_0x153164[_0x09fd('0x14')][_0x09fd('0x16')]),_0x153164[_0x09fd('0x20')][_0x09fd('0x24')]);logger['debug'](_0x09fd('0x21'),_0x153164,JSON[_0x09fd('0xd')](_0x328c5a));_0x2c853f(_0x328c5a);})['catch'](function(_0x3d0458){logger['error'](_0x09fd('0x21'),_0x3d0458[_0x09fd('0x10')],_0x153164);_0x21ab50(_0x694f17[_0x09fd('0xe')](0x1f4,_0x3d0458[_0x09fd('0x10')]));});});};exports[_0x09fd('0x25')]=function(_0x4e360b){var _0x1e1e1e=this;return new Promise(function(_0x6aa453,_0x1c1773){return db[_0x09fd('0x12')][_0x09fd('0x26')]({'where':_0x4e360b[_0x09fd('0x14')]?_0x4e360b[_0x09fd('0x14')][_0x09fd('0x16')]||null:null})[_0x09fd('0x8')](function(_0x48ed2b){logger['info'](_0x09fd('0x25'),_0x4e360b);logger[_0x09fd('0xc')](_0x09fd('0x25'),_0x4e360b,JSON[_0x09fd('0xd')](_0x48ed2b));_0x6aa453(_0x48ed2b);})['catch'](function(_0x5e3732){logger[_0x09fd('0xe')](_0x09fd('0x25'),_0x5e3732[_0x09fd('0x10')],_0x4e360b);_0x1c1773(_0x1e1e1e[_0x09fd('0xe')](0x1f4,_0x5e3732[_0x09fd('0x10')]));});});};exports[_0x09fd('0x27')]=function(_0x4d52f6){var _0x8565c0=this;return new Promise(function(_0x243467,_0xc81c08){return db[_0x09fd('0x28')]['describe']()[_0x09fd('0x8')](function(_0x5cf0a9){return db[_0x09fd('0x29')]['transaction'](function(_0x4db575){return db[_0x09fd('0x12')][_0x09fd('0x13')]({'where':_0x4d52f6[_0x09fd('0x14')]?_0x4d52f6[_0x09fd('0x14')][_0x09fd('0x16')]||null:null,'attributes':_0x4d52f6[_0x09fd('0x14')]?_0x4d52f6[_0x09fd('0x14')][_0x09fd('0x1a')]||null:null,'limit':_0x4d52f6[_0x09fd('0x14')]?_0x4d52f6[_0x09fd('0x14')][_0x09fd('0x17')]||null:null,'order':_0x4d52f6[_0x09fd('0x14')]?_0x4d52f6['options']['order']||null:null,'transaction':_0x4db575,'lock':_0x4db575['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_['keys'](_0x5cf0a9)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x09fd('0x2a')]}]})[_0x09fd('0x8')](function(_0xc76a55){var _0x6c232c=[];var _0x582fbd=[];for(var _0x3c6ebc=0x0;_0x3c6ebc<_0xc76a55[_0x09fd('0x2b')];_0x3c6ebc+=0x1){var _0x20c0c9=_0xc76a55[_0x3c6ebc][_0x09fd('0x2c')];if(_0x20c0c9===null){_0x6c232c[_0x09fd('0x2d')](_0xc76a55[_0x3c6ebc][_0x09fd('0x22')](_0x4d52f6['body'],{'transaction':_0x4db575}));}else if(!_0x582fbd[_0x09fd('0x2e')](_0x20c0c9)){_0x582fbd[_0x09fd('0x2d')](_0x20c0c9);_0x6c232c[_0x09fd('0x2d')](_0xc76a55[_0x3c6ebc][_0x09fd('0x22')](_0x4d52f6[_0x09fd('0x20')],{'transaction':_0x4db575}));}}return BPromise['all'](_0x6c232c);});})[_0x09fd('0x8')](function(_0x32c18b){logger[_0x09fd('0x9')](_0x09fd('0x27'),_0x4d52f6);if(_0x32c18b['length']>0x0){logger[_0x09fd('0x9')](_0x09fd('0x2f'),_0x32c18b[0x0][_0x09fd('0x30')]['id'],_0x32c18b[0x0][_0x09fd('0x30')][_0x09fd('0x31')],_0x32c18b[0x0][_0x09fd('0x30')]['active']);}logger['debug'](_0x09fd('0x27'),_0x4d52f6,JSON[_0x09fd('0xd')](_0x32c18b));_0x243467(_0x32c18b);})['catch'](function(_0x3e1bf5){logger[_0x09fd('0xe')]('GetContactDialer',_0x3e1bf5[_0x09fd('0x10')],_0x4d52f6);_0xc81c08(_0x8565c0[_0x09fd('0xe')](0x1f4,_0x3e1bf5[_0x09fd('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x5171a0){var _0x586b89=this;return new Promise(function(_0x3d1bf7,_0x5f019b){return db[_0x09fd('0x29')][_0x09fd('0x32')](function(_0x24f73f){return db[_0x09fd('0x33')][_0x09fd('0x1f')](_0x5171a0['body'],{'raw':_0x5171a0[_0x09fd('0x14')]?_0x5171a0[_0x09fd('0x14')][_0x09fd('0x15')]===undefined?!![]:![]:!![],'transaction':_0x24f73f})[_0x09fd('0x8')](function(){logger[_0x09fd('0x9')](_0x09fd('0x34'),JSON['stringify'](_0x5171a0[_0x09fd('0x14')][_0x09fd('0x16')]),_0x5171a0[_0x09fd('0x14')][_0x09fd('0x16')][_0x09fd('0x24')]);return db['CmHopper']['destroy']({'where':_0x5171a0[_0x09fd('0x14')]?_0x5171a0['options'][_0x09fd('0x16')]||null:null,'transaction':_0x24f73f});});})[_0x09fd('0x8')](function(_0x3ecc52){logger[_0x09fd('0x9')](_0x09fd('0x35'),_0x5171a0);logger[_0x09fd('0xc')](_0x09fd('0x35'),_0x5171a0,JSON['stringify'](_0x3ecc52));_0x3d1bf7(_0x3ecc52);})[_0x09fd('0x1c')](function(_0x3c3dff){logger[_0x09fd('0xe')]('MoveContactManagedDialer',_0x3c3dff[_0x09fd('0x10')],_0x5171a0);_0x5f019b(_0x586b89[_0x09fd('0xe')](0x1f4,_0x3c3dff[_0x09fd('0x10')]));});});};exports['CountReScheduled']=function(_0x5e5816){var _0x1588af=this;return new Promise(function(_0x46f2d3,_0x341705){return db[_0x09fd('0x12')][_0x09fd('0x13')]({'raw':_0x5e5816[_0x09fd('0x14')]?_0x5e5816['options']['raw']===undefined?!![]:![]:!![],'where':_0x5e5816['options']?_0x5e5816[_0x09fd('0x14')]['where']||null:null,'attributes':[[db[_0x09fd('0x29')]['fn'](_0x09fd('0x36'),db[_0x09fd('0x29')]['fn']('IF',db[_0x09fd('0x29')][_0x09fd('0x37')]('`scheduledat`\x20>=\x20'+util[_0x09fd('0x38')](_0x09fd('0x39'),moment()[_0x09fd('0x38')](_0x09fd('0x3a')))+_0x09fd('0x3b')))),_0x09fd('0x3c')]]})[_0x09fd('0x8')](function(_0x58c0f1){logger[_0x09fd('0x9')](_0x09fd('0x3d'),_0x5e5816);logger[_0x09fd('0xc')]('CountReScheduled',_0x5e5816,JSON[_0x09fd('0xd')](_0x58c0f1));_0x46f2d3(_0x58c0f1);})[_0x09fd('0x1c')](function(_0x3271f2){logger[_0x09fd('0xe')](_0x09fd('0x3d'),_0x3271f2[_0x09fd('0x10')],_0x5e5816);_0x341705(_0x1588af[_0x09fd('0xe')](0x1f4,_0x3271f2[_0x09fd('0x10')]));});});};exports['GetContactRecallMe']=function(_0x1b5399){var _0x58c9ad=this;return new Promise(function(_0x39148d,_0x50848d){return db[_0x09fd('0x28')][_0x09fd('0x3e')]()['then'](function(_0x2eb36a){return db[_0x09fd('0x29')]['transaction'](function(_0x4c5d42){return db[_0x09fd('0x12')][_0x09fd('0x13')]({'where':_0x1b5399[_0x09fd('0x14')]?_0x1b5399[_0x09fd('0x14')][_0x09fd('0x16')]||null:null,'attributes':_0x1b5399['options']?_0x1b5399[_0x09fd('0x14')][_0x09fd('0x1a')]||null:null,'limit':0x1,'order':_0x1b5399[_0x09fd('0x14')]?_0x1b5399[_0x09fd('0x14')]['order']||null:null,'group':db[_0x09fd('0x12')][_0x09fd('0x2c')],'transaction':_0x4c5d42,'lock':_0x4c5d42['LOCK']['UPDATE'],'include':_0x1b5399[_0x09fd('0x14')]?_0x1b5399[_0x09fd('0x14')][_0x09fd('0x18')]?_[_0x09fd('0x1b')](_0x1b5399[_0x09fd('0x14')]['include'],function(_0x4d29a8){return{'model':db[_0x4d29a8[_0x09fd('0x19')]],'as':_0x4d29a8['as'],'attributes':_0x4d29a8[_0x09fd('0x1a')],'include':_0x4d29a8[_0x09fd('0x18')]?_[_0x09fd('0x1b')](_0x4d29a8[_0x09fd('0x18')],function(_0x276068){return{'model':db[_0x276068[_0x09fd('0x19')]],'as':_0x276068['as'],'attributes':_0x276068['attributes'],'include':_0x276068[_0x09fd('0x18')]?_[_0x09fd('0x1b')](_0x276068[_0x09fd('0x18')],function(_0x24b79e){return{'model':db[_0x24b79e[_0x09fd('0x19')]],'as':_0x24b79e['as'],'attributes':_0x24b79e[_0x09fd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dcd92){var _0x6a3047=[];for(var _0x13f91c=0x0;_0x13f91c<_0x5dcd92[_0x09fd('0x2b')];_0x13f91c+=0x1){_0x6a3047[_0x09fd('0x2d')](_0x5dcd92[_0x13f91c][_0x09fd('0x22')](_0x1b5399['body'],{'transaction':_0x4c5d42}));}return BPromise[_0x09fd('0x3f')](_0x6a3047);});})['then'](function(_0x25689a){logger[_0x09fd('0x9')](_0x09fd('0x40'),_0x1b5399);logger[_0x09fd('0xc')](_0x09fd('0x40'),_0x1b5399,JSON[_0x09fd('0xd')](_0x25689a));_0x39148d(_0x25689a);})[_0x09fd('0x1c')](function(_0x1cbc88){logger['error'](_0x09fd('0x40'),_0x1cbc88['message'],_0x1b5399);_0x50848d(_0x58c9ad[_0x09fd('0xe')](0x1f4,_0x1cbc88[_0x09fd('0x10')]));});});});};exports[_0x09fd('0x41')]=function(_0x556fb0){var _0x34126a=this;return new Promise(function(_0x22cff8,_0x17aad2){db[_0x09fd('0x28')]['describe']()[_0x09fd('0x8')](function(_0x1b165c){return db[_0x09fd('0x12')]['findAll']({'raw':_0x556fb0[_0x09fd('0x14')]?_0x556fb0[_0x09fd('0x14')][_0x09fd('0x15')]===undefined?!![]:![]:!![],'where':_0x556fb0[_0x09fd('0x14')]?_0x556fb0[_0x09fd('0x14')][_0x09fd('0x16')]||null:null,'attributes':_0x556fb0['options']?_0x556fb0[_0x09fd('0x14')]['attributes']||null:null,'limit':_0x556fb0[_0x09fd('0x14')]?_0x556fb0[_0x09fd('0x14')][_0x09fd('0x17')]||null:null,'include':_0x556fb0[_0x09fd('0x14')]?_0x556fb0[_0x09fd('0x14')][_0x09fd('0x18')]?_[_0x09fd('0x1b')](_0x556fb0[_0x09fd('0x14')][_0x09fd('0x18')],function(_0x19e68e){return{'model':db[_0x19e68e[_0x09fd('0x19')]],'as':_0x19e68e['as'],'attributes':_0x19e68e['as']===_0x09fd('0x42')?_['keys'](_0x1b165c):_0x19e68e[_0x09fd('0x1a')],'include':_0x19e68e['include']?_['map'](_0x19e68e['include'],function(_0x42722d){return{'model':db[_0x42722d[_0x09fd('0x19')]],'as':_0x42722d['as'],'attributes':_0x42722d[_0x09fd('0x1a')],'include':_0x42722d['include']?_[_0x09fd('0x1b')](_0x42722d[_0x09fd('0x18')],function(_0x52b4dc){return{'model':db[_0x52b4dc['model']],'as':_0x52b4dc['as'],'attributes':_0x52b4dc[_0x09fd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x09fd('0x8')](function(_0x117794){logger[_0x09fd('0x9')]('GetCmHopper',_0x556fb0);logger[_0x09fd('0xc')]('GetCmHopper',_0x556fb0,JSON[_0x09fd('0xd')](_0x117794));_0x22cff8(_0x117794);})[_0x09fd('0x1c')](function(_0x5ea4b5){logger[_0x09fd('0xe')]('GetCmHopper',_0x5ea4b5['message'],_0x556fb0);_0x17aad2(_0x34126a[_0x09fd('0xe')](0x1f4,_0x5ea4b5[_0x09fd('0x10')]));});});});};exports['GetContactByPhone']=function(_0x5bdfa0){var _0x4dd965=this;return new Promise(function(_0x18be94,_0x2e692){return db[_0x09fd('0x28')][_0x09fd('0x43')]({'raw':!![],'where':{'phone':_0x5bdfa0[_0x09fd('0x14')][_0x09fd('0x16')][_0x09fd('0x44')]},'attributes':['id',_0x09fd('0x45')],'order':[['id','DESC']]})[_0x09fd('0x8')](function(_0x45dd08){logger[_0x09fd('0x9')](_0x09fd('0x46'),_0x5bdfa0);logger[_0x09fd('0xc')]('getContactByPhone',_0x5bdfa0,JSON[_0x09fd('0xd')](_0x45dd08));_0x18be94(_0x45dd08);})[_0x09fd('0x1c')](function(_0x170e1a){logger['error'](_0x09fd('0x46'),_0x170e1a[_0x09fd('0x10')],_0x5bdfa0);_0x2e692(_0x4dd965[_0x09fd('0xe')](0x1f4,_0x170e1a['message']));});});};exports[_0x09fd('0x47')]=function(_0x576732){var _0x47e9b7=this;return new Promise(function(_0x4f88ec,_0x3f3687){return db[_0x09fd('0x29')][_0x09fd('0x32')](function(_0x264112){return db[_0x09fd('0x12')][_0x09fd('0x22')](_0x576732[_0x09fd('0x20')],{'where':{},'transaction':_0x264112})[_0x09fd('0x8')](function(_0x20c1bb){logger[_0x09fd('0x9')]('ResetActiveCalls',_0x576732);logger[_0x09fd('0xc')](_0x09fd('0x47'),_0x576732,JSON[_0x09fd('0xd')](_0x20c1bb));_0x4f88ec(_0x20c1bb);})[_0x09fd('0x1c')](function(_0x4b6066){logger['error'](_0x09fd('0x47'),_0x4b6066['message'],_0x576732);_0x3f3687(_0x47e9b7[_0x09fd('0xe')](0x1f4,_0x4b6066[_0x09fd('0x10')]));});});});};exports[_0x09fd('0x48')]=function(_0x53c9e2){var _0xbb8327=this;var _0x2e177c=_0x53c9e2[_0x09fd('0x20')]['where']['voiceQueueIds'];var _0x4bced4=_0x53c9e2['body']['where'][_0x09fd('0x49')];var _0x3b26c1=_0x53c9e2[_0x09fd('0x20')][_0x09fd('0x16')][_0x09fd('0x4a')];return new Promise(function(_0x48fa6f,_0x500ab8){return db[_0x09fd('0x12')][_0x09fd('0x13')]({'where':{'voiceQueueId':{'$in':_0x2e177c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x09fd('0x29')][_0x09fd('0x37')]('NOW()\x20+\x20INTERVAL\x20'+_0x4bced4+_0x09fd('0x4b')),'$gt':db['sequelize'][_0x09fd('0x37')](_0x09fd('0x4c'))}},'UserId':{'$in':_0x3b26c1}},'include':[{'model':db[_0x09fd('0x28')],'as':_0x09fd('0x42')},{'model':db[_0x09fd('0x4d')],'as':_0x09fd('0x4e'),'attributes':['id','name',_0x09fd('0x2a')]},{'model':db[_0x09fd('0x4f')],'as':_0x09fd('0x50')}]})[_0x09fd('0x8')](function(_0x4f2dda){if(_0x4f2dda[_0x09fd('0x2b')]>0x0){return db[_0x09fd('0x29')][_0x09fd('0x32')](function(_0x5b1f3c){return db[_0x09fd('0x12')][_0x09fd('0x22')]({'recallmeNotifiedDate':db[_0x09fd('0x29')][_0x09fd('0x37')]('NOW()')},{'where':{'id':{'$in':_[_0x09fd('0x1b')](_0x4f2dda,'id')}},'transaction':_0x5b1f3c})['then'](function(){_0x48fa6f(_0x4f2dda);})['catch'](function(_0x55b20b){logger['error'](_0x09fd('0x48'),_0x55b20b[_0x09fd('0x10')],_0x53c9e2);_0x500ab8(_0xbb8327[_0x09fd('0xe')](0x1f4,_0x55b20b[_0x09fd('0x10')]));});})[_0x09fd('0x1c')](function(_0x4bbd7d){logger[_0x09fd('0xe')](_0x09fd('0x48'),_0x4bbd7d[_0x09fd('0x10')],_0x53c9e2);_0x500ab8(_0xbb8327[_0x09fd('0xe')](0x1f4,_0x4bbd7d['message']));});}else{_0x48fa6f(_0x4f2dda);}});});}; \ No newline at end of file +var _0xaf5a=['CountReScheduled','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','describe','UserId','GetContactRecallMe','GetCmHopperPreview','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','name','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopper','findAll','options','raw','include','map','model','attributes','info','stringify','CmHopper','find','where','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','transaction','order','LOCK','UPDATE','Contact','keys','User','voicePause','length','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','MoveContactManagedDialer'];(function(_0x4d911b,_0x5781b6){var _0x472305=function(_0x5d906e){while(--_0x5d906e){_0x4d911b['push'](_0x4d911b['shift']());}};_0x472305(++_0x5781b6);}(_0xaf5a,0x71));var _0xaaf5=function(_0x1106f4,_0x36cfdb){_0x1106f4=_0x1106f4-0x0;var _0x383deb=_0xaf5a[_0x1106f4];return _0x383deb;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var moment=require(_0xaaf5('0x1'));var BPromise=require('bluebird');var db=require(_0xaaf5('0x2'))['db'];var logger=require(_0xaaf5('0x3'))(_0xaaf5('0x4'));var jayson=require(_0xaaf5('0x5'));var client=jayson['client'][_0xaaf5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x518eb7,_0x3f9991,_0x5660a6){return new BPromise(function(_0x19d6f7,_0x37d9e3){return client['request'](_0x518eb7,_0x5660a6)[_0xaaf5('0x7')](function(_0x46123f){logger['info'](_0xaaf5('0x8'),_0x3f9991,_0xaaf5('0x9'));logger[_0xaaf5('0xa')](_0xaaf5('0xb'),_0x3f9991,_0xaaf5('0x9'),JSON['stringify'](_0x46123f));if(_0x46123f[_0xaaf5('0xc')]){if(_0x46123f[_0xaaf5('0xc')]['code']===0x1f4){logger[_0xaaf5('0xc')](_0xaaf5('0x8'),_0x3f9991,_0x46123f['error'][_0xaaf5('0xd')]);return _0x37d9e3(_0x46123f[_0xaaf5('0xc')][_0xaaf5('0xd')]);}logger[_0xaaf5('0xc')](_0xaaf5('0x8'),_0x3f9991,_0x46123f[_0xaaf5('0xc')][_0xaaf5('0xd')]);return _0x19d6f7(_0x46123f[_0xaaf5('0xc')]['message']);}else{logger['info'](_0xaaf5('0x8'),_0x3f9991,_0xaaf5('0x9'));_0x19d6f7(_0x46123f[_0xaaf5('0xe')][_0xaaf5('0xd')]);}})[_0xaaf5('0xf')](function(_0x15a658){logger[_0xaaf5('0xc')](_0xaaf5('0x8'),_0x3f9991,_0x15a658);_0x37d9e3(_0x15a658);});});}exports[_0xaaf5('0x10')]=function(_0x2abe2c){var _0x225b89=this;return new Promise(function(_0x169372,_0x35d8df){return db['CmHopper'][_0xaaf5('0x11')]({'raw':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c[_0xaaf5('0x12')][_0xaaf5('0x13')]===undefined?!![]:![]:!![],'where':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c['options']['where']||null:null,'attributes':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c[_0xaaf5('0x12')]['attributes']||null:null,'limit':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c['options']['limit']||null:null,'include':_0x2abe2c['options']?_0x2abe2c['options'][_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x2abe2c[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x1aa4b0){return{'model':db[_0x1aa4b0[_0xaaf5('0x16')]],'as':_0x1aa4b0['as'],'attributes':_0x1aa4b0[_0xaaf5('0x17')],'include':_0x1aa4b0[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x1aa4b0[_0xaaf5('0x14')],function(_0x1eef63){return{'model':db[_0x1eef63[_0xaaf5('0x16')]],'as':_0x1eef63['as'],'attributes':_0x1eef63[_0xaaf5('0x17')],'include':_0x1eef63['include']?_[_0xaaf5('0x15')](_0x1eef63[_0xaaf5('0x14')],function(_0x5e95bd){return{'model':db[_0x5e95bd[_0xaaf5('0x16')]],'as':_0x5e95bd['as'],'attributes':_0x5e95bd[_0xaaf5('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20b7b5){logger[_0xaaf5('0x18')](_0xaaf5('0x10'),_0x2abe2c);logger['debug'](_0xaaf5('0x10'),_0x2abe2c,JSON[_0xaaf5('0x19')](_0x20b7b5));_0x169372(_0x20b7b5);})[_0xaaf5('0xf')](function(_0x17bc82){logger[_0xaaf5('0xc')](_0xaaf5('0x10'),_0x17bc82[_0xaaf5('0xd')],_0x2abe2c);_0x35d8df(_0x225b89[_0xaaf5('0xc')](0x1f4,_0x17bc82['message']));});});};exports['ShowCmHopper']=function(_0x2d573b){var _0x2155e3=this;return new Promise(function(_0x1f2979,_0x11af8f){return db[_0xaaf5('0x1a')][_0xaaf5('0x1b')]({'raw':_0x2d573b[_0xaaf5('0x12')]?_0x2d573b['options'][_0xaaf5('0x13')]===undefined?!![]:![]:!![],'where':_0x2d573b[_0xaaf5('0x12')]?_0x2d573b['options'][_0xaaf5('0x1c')]||null:null,'attributes':_0x2d573b['options']?_0x2d573b['options'][_0xaaf5('0x17')]||null:null,'include':_0x2d573b[_0xaaf5('0x12')]?_0x2d573b[_0xaaf5('0x12')][_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x2d573b[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x466e04){return{'model':db[_0x466e04['model']],'as':_0x466e04['as'],'attributes':_0x466e04[_0xaaf5('0x17')],'include':_0x466e04['include']?_[_0xaaf5('0x15')](_0x466e04[_0xaaf5('0x14')],function(_0x3c9b82){return{'model':db[_0x3c9b82[_0xaaf5('0x16')]],'as':_0x3c9b82['as'],'attributes':_0x3c9b82[_0xaaf5('0x17')],'include':_0x3c9b82[_0xaaf5('0x14')]?_['map'](_0x3c9b82[_0xaaf5('0x14')],function(_0x3a3375){return{'model':db[_0x3a3375['model']],'as':_0x3a3375['as'],'attributes':_0x3a3375['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaf5('0x7')](function(_0x2a189d){logger[_0xaaf5('0x18')](_0xaaf5('0x1d'),_0x2d573b);logger[_0xaaf5('0xa')](_0xaaf5('0x1d'),_0x2d573b,JSON[_0xaaf5('0x19')](_0x2a189d));_0x1f2979(_0x2a189d);})[_0xaaf5('0xf')](function(_0x4d75fc){logger[_0xaaf5('0xc')](_0xaaf5('0x1d'),_0x4d75fc[_0xaaf5('0xd')],_0x2d573b);_0x11af8f(_0x2155e3[_0xaaf5('0xc')](0x1f4,_0x4d75fc[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x1e')]=function(_0x476116){var _0x7b6a4=this;return new Promise(function(_0x41ab32,_0x30be57){return db[_0xaaf5('0x1a')][_0xaaf5('0x1f')](_0x476116[_0xaaf5('0x20')],{'raw':_0x476116[_0xaaf5('0x12')]?_0x476116[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![]})[_0xaaf5('0x7')](function(_0x39eee4){logger[_0xaaf5('0x18')](_0xaaf5('0x1e'),_0x476116);logger[_0xaaf5('0xa')]('CreateCmHopper',_0x476116,JSON[_0xaaf5('0x19')](_0x39eee4));_0x41ab32(_0x39eee4);})[_0xaaf5('0xf')](function(_0x57a89b){logger['error'](_0xaaf5('0x1e'),_0x57a89b[_0xaaf5('0xd')],_0x476116);_0x30be57(_0x7b6a4[_0xaaf5('0xc')](0x1f4,_0x57a89b[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x21')]=function(_0x373648){var _0x1ed174=this;return new Promise(function(_0x14213a,_0x393512){return db[_0xaaf5('0x1a')]['update'](_0x373648[_0xaaf5('0x20')],{'raw':_0x373648[_0xaaf5('0x12')]?_0x373648[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x373648['options']?_0x373648[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x373648[_0xaaf5('0x12')]?_0x373648['options'][_0xaaf5('0x17')]||null:null,'limit':_0x373648[_0xaaf5('0x12')]?_0x373648[_0xaaf5('0x12')][_0xaaf5('0x22')]||null:null})['then'](function(_0x40c5f8){logger[_0xaaf5('0x18')]('UpdateCmHopper',_0x373648);logger[_0xaaf5('0x18')](_0xaaf5('0x23'),JSON[_0xaaf5('0x19')](_0x373648[_0xaaf5('0x12')][_0xaaf5('0x1c')]),_0x373648[_0xaaf5('0x20')][_0xaaf5('0x24')]);logger[_0xaaf5('0xa')](_0xaaf5('0x21'),_0x373648,JSON[_0xaaf5('0x19')](_0x40c5f8));_0x14213a(_0x40c5f8);})[_0xaaf5('0xf')](function(_0x218721){logger['error'](_0xaaf5('0x21'),_0x218721[_0xaaf5('0xd')],_0x373648);_0x393512(_0x1ed174['error'](0x1f4,_0x218721[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x25')]=function(_0x26cccc){var _0xe9c6d2=this;return new Promise(function(_0x25c96a,_0x5b0b68){return db[_0xaaf5('0x1a')]['destroy']({'where':_0x26cccc[_0xaaf5('0x12')]?_0x26cccc[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null})[_0xaaf5('0x7')](function(_0x1c9830){logger[_0xaaf5('0x18')]('DestroyCmHopper',_0x26cccc);logger[_0xaaf5('0xa')](_0xaaf5('0x25'),_0x26cccc,JSON[_0xaaf5('0x19')](_0x1c9830));_0x25c96a(_0x1c9830);})[_0xaaf5('0xf')](function(_0x1b3e89){logger[_0xaaf5('0xc')](_0xaaf5('0x25'),_0x1b3e89[_0xaaf5('0xd')],_0x26cccc);_0x5b0b68(_0xe9c6d2['error'](0x1f4,_0x1b3e89[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x26')]=function(_0x468cef){var _0x44ace4=this;return new Promise(function(_0x918607,_0x1c6131){return db[_0xaaf5('0x27')]['describe']()[_0xaaf5('0x7')](function(_0x13e2b7){return db['sequelize'][_0xaaf5('0x28')](function(_0x5e1ae6){return db[_0xaaf5('0x1a')][_0xaaf5('0x11')]({'where':_0x468cef['options']?_0x468cef[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x468cef['options']?_0x468cef[_0xaaf5('0x12')]['attributes']||null:null,'limit':_0x468cef['options']?_0x468cef['options'][_0xaaf5('0x22')]||null:null,'order':_0x468cef[_0xaaf5('0x12')]?_0x468cef[_0xaaf5('0x12')][_0xaaf5('0x29')]||null:null,'transaction':_0x5e1ae6,'lock':_0x5e1ae6[_0xaaf5('0x2a')][_0xaaf5('0x2b')],'include':[{'model':db[_0xaaf5('0x27')],'as':_0xaaf5('0x2c'),'attributes':_[_0xaaf5('0x2d')](_0x13e2b7)},{'model':db[_0xaaf5('0x2e')],'as':'Agent','attributes':['id','name',_0xaaf5('0x2f')]}]})[_0xaaf5('0x7')](function(_0x226102){var _0x31e04e=[];var _0x494876=[];for(var _0x235b7f=0x0;_0x235b7f<_0x226102[_0xaaf5('0x30')];_0x235b7f+=0x1){var _0x1d6a0a=_0x226102[_0x235b7f]['UserId'];if(_0x1d6a0a===null){_0x31e04e[_0xaaf5('0x31')](_0x226102[_0x235b7f][_0xaaf5('0x32')](_0x468cef[_0xaaf5('0x20')],{'transaction':_0x5e1ae6}));}else if(!_0x494876['includes'](_0x1d6a0a)){_0x494876[_0xaaf5('0x31')](_0x1d6a0a);_0x31e04e[_0xaaf5('0x31')](_0x226102[_0x235b7f]['update'](_0x468cef['body'],{'transaction':_0x5e1ae6}));}}return BPromise[_0xaaf5('0x33')](_0x31e04e);});})['then'](function(_0x45fc61){logger[_0xaaf5('0x18')](_0xaaf5('0x26'),_0x468cef);if(_0x45fc61['length']>0x0){logger[_0xaaf5('0x18')](_0xaaf5('0x34'),_0x45fc61[0x0][_0xaaf5('0x35')]['id'],_0x45fc61[0x0][_0xaaf5('0x35')][_0xaaf5('0x36')],_0x45fc61[0x0][_0xaaf5('0x35')]['active']);}logger['debug'](_0xaaf5('0x26'),_0x468cef,JSON[_0xaaf5('0x19')](_0x45fc61));_0x918607(_0x45fc61);})[_0xaaf5('0xf')](function(_0x51c37c){logger['error'](_0xaaf5('0x26'),_0x51c37c['message'],_0x468cef);_0x1c6131(_0x44ace4['error'](0x1f4,_0x51c37c[_0xaaf5('0xd')]));});});});};exports['MoveContactManagedDialer']=function(_0x3061a9){var _0x3d0da4=this;return new Promise(function(_0x7b07f5,_0x5dfaf9){return db['sequelize']['transaction'](function(_0x21c0fc){return db[_0xaaf5('0x37')][_0xaaf5('0x1f')](_0x3061a9['body'],{'raw':_0x3061a9[_0xaaf5('0x12')]?_0x3061a9[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![],'transaction':_0x21c0fc})[_0xaaf5('0x7')](function(){logger[_0xaaf5('0x18')](_0xaaf5('0x38'),JSON[_0xaaf5('0x19')](_0x3061a9[_0xaaf5('0x12')]['where']),_0x3061a9['options'][_0xaaf5('0x1c')][_0xaaf5('0x24')]);return db[_0xaaf5('0x1a')][_0xaaf5('0x39')]({'where':_0x3061a9['options']?_0x3061a9[_0xaaf5('0x12')]['where']||null:null,'transaction':_0x21c0fc});});})[_0xaaf5('0x7')](function(_0x465961){logger[_0xaaf5('0x18')](_0xaaf5('0x3a'),_0x3061a9);logger[_0xaaf5('0xa')](_0xaaf5('0x3a'),_0x3061a9,JSON[_0xaaf5('0x19')](_0x465961));_0x7b07f5(_0x465961);})['catch'](function(_0x1e8938){logger[_0xaaf5('0xc')](_0xaaf5('0x3a'),_0x1e8938[_0xaaf5('0xd')],_0x3061a9);_0x5dfaf9(_0x3d0da4[_0xaaf5('0xc')](0x1f4,_0x1e8938[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x3b')]=function(_0x58570d){var _0x45f723=this;return new Promise(function(_0xbd5f45,_0x5d0df4){return db['CmHopper'][_0xaaf5('0x11')]({'raw':_0x58570d[_0xaaf5('0x12')]?_0x58570d['options'][_0xaaf5('0x13')]===undefined?!![]:![]:!![],'where':_0x58570d['options']?_0x58570d['options'][_0xaaf5('0x1c')]||null:null,'attributes':[[db[_0xaaf5('0x3c')]['fn']('COUNT',db[_0xaaf5('0x3c')]['fn']('IF',db[_0xaaf5('0x3c')][_0xaaf5('0x3d')](_0xaaf5('0x3e')+util[_0xaaf5('0x3f')](_0xaaf5('0x40'),moment()[_0xaaf5('0x3f')](_0xaaf5('0x41')))+'\x20,\x201,\x20null'))),_0xaaf5('0x42')]]})[_0xaaf5('0x7')](function(_0x59dcb1){logger['info'](_0xaaf5('0x3b'),_0x58570d);logger[_0xaaf5('0xa')]('CountReScheduled',_0x58570d,JSON['stringify'](_0x59dcb1));_0xbd5f45(_0x59dcb1);})[_0xaaf5('0xf')](function(_0x22d076){logger[_0xaaf5('0xc')]('CountReScheduled',_0x22d076[_0xaaf5('0xd')],_0x58570d);_0x5d0df4(_0x45f723['error'](0x1f4,_0x22d076[_0xaaf5('0xd')]));});});};exports['GetContactRecallMe']=function(_0x44e425){var _0x47a134=this;return new Promise(function(_0x58267f,_0x15739c){return db[_0xaaf5('0x27')][_0xaaf5('0x43')]()['then'](function(_0x2b5035){return db[_0xaaf5('0x3c')]['transaction'](function(_0x57aaa2){return db['CmHopper'][_0xaaf5('0x11')]({'where':_0x44e425['options']?_0x44e425[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x44e425[_0xaaf5('0x12')]?_0x44e425['options'][_0xaaf5('0x17')]||null:null,'limit':0x1,'order':_0x44e425[_0xaaf5('0x12')]?_0x44e425[_0xaaf5('0x12')]['order']||null:null,'group':db['CmHopper'][_0xaaf5('0x44')],'transaction':_0x57aaa2,'lock':_0x57aaa2['LOCK'][_0xaaf5('0x2b')],'include':_0x44e425[_0xaaf5('0x12')]?_0x44e425[_0xaaf5('0x12')]['include']?_['map'](_0x44e425[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x3e7446){return{'model':db[_0x3e7446['model']],'as':_0x3e7446['as'],'attributes':_0x3e7446[_0xaaf5('0x17')],'include':_0x3e7446[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x3e7446[_0xaaf5('0x14')],function(_0x23b70d){return{'model':db[_0x23b70d['model']],'as':_0x23b70d['as'],'attributes':_0x23b70d[_0xaaf5('0x17')],'include':_0x23b70d[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x23b70d['include'],function(_0x5534ca){return{'model':db[_0x5534ca[_0xaaf5('0x16')]],'as':_0x5534ca['as'],'attributes':_0x5534ca[_0xaaf5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xaaf5('0x7')](function(_0x47186b){var _0x569359=[];for(var _0x9da04a=0x0;_0x9da04a<_0x47186b['length'];_0x9da04a+=0x1){_0x569359['push'](_0x47186b[_0x9da04a][_0xaaf5('0x32')](_0x44e425[_0xaaf5('0x20')],{'transaction':_0x57aaa2}));}return BPromise[_0xaaf5('0x33')](_0x569359);});})['then'](function(_0x587612){logger['info'](_0xaaf5('0x45'),_0x44e425);logger[_0xaaf5('0xa')](_0xaaf5('0x45'),_0x44e425,JSON[_0xaaf5('0x19')](_0x587612));_0x58267f(_0x587612);})[_0xaaf5('0xf')](function(_0x40f9dd){logger[_0xaaf5('0xc')]('GetContactRecallMe',_0x40f9dd[_0xaaf5('0xd')],_0x44e425);_0x15739c(_0x47a134[_0xaaf5('0xc')](0x1f4,_0x40f9dd[_0xaaf5('0xd')]));});});});};exports[_0xaaf5('0x46')]=function(_0x40e7d5){var _0xddc7fd=this;return new Promise(function(_0x38aff0,_0x59fa2f){db[_0xaaf5('0x27')][_0xaaf5('0x43')]()[_0xaaf5('0x7')](function(_0x6f697f){return db['CmHopper'][_0xaaf5('0x11')]({'raw':_0x40e7d5[_0xaaf5('0x12')]?_0x40e7d5[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x40e7d5['options']?_0x40e7d5[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x40e7d5['options']?_0x40e7d5[_0xaaf5('0x12')][_0xaaf5('0x17')]||null:null,'limit':_0x40e7d5[_0xaaf5('0x12')]?_0x40e7d5[_0xaaf5('0x12')]['limit']||null:null,'include':_0x40e7d5[_0xaaf5('0x12')]?_0x40e7d5[_0xaaf5('0x12')]['include']?_[_0xaaf5('0x15')](_0x40e7d5[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x6b254f){return{'model':db[_0x6b254f[_0xaaf5('0x16')]],'as':_0x6b254f['as'],'attributes':_0x6b254f['as']===_0xaaf5('0x2c')?_[_0xaaf5('0x2d')](_0x6f697f):_0x6b254f['attributes'],'include':_0x6b254f['include']?_[_0xaaf5('0x15')](_0x6b254f[_0xaaf5('0x14')],function(_0x2edf1a){return{'model':db[_0x2edf1a['model']],'as':_0x2edf1a['as'],'attributes':_0x2edf1a[_0xaaf5('0x17')],'include':_0x2edf1a[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x2edf1a[_0xaaf5('0x14')],function(_0x3cfdb7){return{'model':db[_0x3cfdb7[_0xaaf5('0x16')]],'as':_0x3cfdb7['as'],'attributes':_0x3cfdb7['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaf5('0x7')](function(_0x4287f3){logger[_0xaaf5('0x18')](_0xaaf5('0x10'),_0x40e7d5);logger[_0xaaf5('0xa')](_0xaaf5('0x10'),_0x40e7d5,JSON[_0xaaf5('0x19')](_0x4287f3));_0x38aff0(_0x4287f3);})[_0xaaf5('0xf')](function(_0x3882db){logger[_0xaaf5('0xc')]('GetCmHopper',_0x3882db['message'],_0x40e7d5);_0x59fa2f(_0xddc7fd[_0xaaf5('0xc')](0x1f4,_0x3882db[_0xaaf5('0xd')]));});});});};exports['GetContactByPhone']=function(_0x36d1c1){var _0x43f4b8=this;return new Promise(function(_0xc87901,_0x2ec44b){return db[_0xaaf5('0x27')]['findOne']({'raw':!![],'where':{'phone':_0x36d1c1[_0xaaf5('0x12')]['where'][_0xaaf5('0x47')]},'attributes':['id',_0xaaf5('0x48')],'order':[['id',_0xaaf5('0x49')]]})[_0xaaf5('0x7')](function(_0x359856){logger[_0xaaf5('0x18')](_0xaaf5('0x4a'),_0x36d1c1);logger[_0xaaf5('0xa')](_0xaaf5('0x4a'),_0x36d1c1,JSON[_0xaaf5('0x19')](_0x359856));_0xc87901(_0x359856);})[_0xaaf5('0xf')](function(_0x3c208e){logger[_0xaaf5('0xc')](_0xaaf5('0x4a'),_0x3c208e[_0xaaf5('0xd')],_0x36d1c1);_0x2ec44b(_0x43f4b8['error'](0x1f4,_0x3c208e[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x4b')]=function(_0x415311){var _0x598ee2=this;return new Promise(function(_0x78aee9,_0x38287e){return db['sequelize'][_0xaaf5('0x28')](function(_0x3e371b){return db[_0xaaf5('0x1a')][_0xaaf5('0x32')](_0x415311[_0xaaf5('0x20')],{'where':{},'transaction':_0x3e371b})[_0xaaf5('0x7')](function(_0xa7c057){logger[_0xaaf5('0x18')](_0xaaf5('0x4b'),_0x415311);logger[_0xaaf5('0xa')]('ResetActiveCalls',_0x415311,JSON[_0xaaf5('0x19')](_0xa7c057));_0x78aee9(_0xa7c057);})[_0xaaf5('0xf')](function(_0x480e1f){logger[_0xaaf5('0xc')](_0xaaf5('0x4b'),_0x480e1f[_0xaaf5('0xd')],_0x415311);_0x38287e(_0x598ee2[_0xaaf5('0xc')](0x1f4,_0x480e1f[_0xaaf5('0xd')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3de78a){var _0x164199=this;var _0x3266e7=_0x3de78a[_0xaaf5('0x20')][_0xaaf5('0x1c')][_0xaaf5('0x4c')];var _0x50b33f=_0x3de78a[_0xaaf5('0x20')][_0xaaf5('0x1c')][_0xaaf5('0x4d')];var _0x5db161=_0x3de78a['body'][_0xaaf5('0x1c')]['availableAgentsIds'];return new Promise(function(_0x201a82,_0x462037){return db[_0xaaf5('0x1a')][_0xaaf5('0x11')]({'where':{'voiceQueueId':{'$in':_0x3266e7},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xaaf5('0x3c')][_0xaaf5('0x3d')](_0xaaf5('0x4e')+_0x50b33f+_0xaaf5('0x4f')),'$gt':db[_0xaaf5('0x3c')]['literal'](_0xaaf5('0x50'))}},'UserId':{'$in':_0x5db161}},'include':[{'model':db[_0xaaf5('0x27')],'as':_0xaaf5('0x2c')},{'model':db['User'],'as':_0xaaf5('0x51'),'attributes':['id',_0xaaf5('0x52'),_0xaaf5('0x2f')]},{'model':db[_0xaaf5('0x53')],'as':_0xaaf5('0x54')}]})[_0xaaf5('0x7')](function(_0x123ab3){if(_0x123ab3[_0xaaf5('0x30')]>0x0){return db[_0xaaf5('0x3c')]['transaction'](function(_0x391b15){return db[_0xaaf5('0x1a')][_0xaaf5('0x32')]({'recallmeNotifiedDate':db[_0xaaf5('0x3c')]['literal'](_0xaaf5('0x50'))},{'where':{'id':{'$in':_['map'](_0x123ab3,'id')}},'transaction':_0x391b15})[_0xaaf5('0x7')](function(){_0x201a82(_0x123ab3);})[_0xaaf5('0xf')](function(_0x3d6c7e){logger[_0xaaf5('0xc')](_0xaaf5('0x55'),_0x3d6c7e[_0xaaf5('0xd')],_0x3de78a);_0x462037(_0x164199[_0xaaf5('0xc')](0x1f4,_0x3d6c7e[_0xaaf5('0xd')]));});})[_0xaaf5('0xf')](function(_0x429f4d){logger[_0xaaf5('0xc')](_0xaaf5('0x55'),_0x429f4d[_0xaaf5('0xd')],_0x3de78a);_0x462037(_0x164199[_0xaaf5('0xc')](0x1f4,_0x429f4d[_0xaaf5('0xd')]));});}else{_0x201a82(_0x123ab3);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8ea0c71..ed8c63d 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 _0xe081=['/:id/previewrecall','post','create','getPreview','/timezone','getTimezone','put','delete','exports','express','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/timezones','/:id'];(function(_0x36b964,_0x5ce51f){var _0x315174=function(_0x1b2f15){while(--_0x1b2f15){_0x36b964['push'](_0x36b964['shift']());}};_0x315174(++_0x5ce51f);}(_0xe081,0x7b));var _0x1e08=function(_0x2adc9e,_0x205e9d){_0x2adc9e=_0x2adc9e-0x0;var _0x4846e5=_0xe081[_0x2adc9e];return _0x4846e5;};'use strict';var express=require(_0x1e08('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1e08('0x1'));router[_0x1e08('0x2')]('/',auth[_0x1e08('0x3')](),controller['index']);router[_0x1e08('0x2')](_0x1e08('0x4'),auth[_0x1e08('0x3')](),controller[_0x1e08('0x5')]);router[_0x1e08('0x2')](_0x1e08('0x6'),auth[_0x1e08('0x3')](),controller[_0x1e08('0x7')]);router['get'](_0x1e08('0x8'),auth[_0x1e08('0x3')](),controller['getTimezones']);router[_0x1e08('0x2')](_0x1e08('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1e08('0x2')](_0x1e08('0xa'),auth[_0x1e08('0x3')](),controller['getPreviewRecall']);router[_0x1e08('0xb')]('/',auth[_0x1e08('0x3')](),controller[_0x1e08('0xc')]);router[_0x1e08('0xb')]('/preview',auth[_0x1e08('0x3')](),controller[_0x1e08('0xd')]);router[_0x1e08('0xb')](_0x1e08('0xe'),auth['isAuthenticated'](),controller[_0x1e08('0xf')]);router[_0x1e08('0x10')]('/:id',auth[_0x1e08('0x3')](),controller['update']);router[_0x1e08('0x11')](_0x1e08('0x9'),auth[_0x1e08('0x3')](),controller['destroy']);module[_0x1e08('0x12')]=router; \ No newline at end of file +var _0x0bf2=['/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','/:id','update','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','/describe','describe','get','/opencontacts','getOpenContacts'];(function(_0x5cac54,_0x431445){var _0x399d30=function(_0x58722d){while(--_0x58722d){_0x5cac54['push'](_0x5cac54['shift']());}};_0x399d30(++_0x431445);}(_0x0bf2,0xf9));var _0x20bf=function(_0x98df36,_0x3008fc){_0x98df36=_0x98df36-0x0;var _0x55c56a=_0x0bf2[_0x98df36];return _0x55c56a;};'use strict';var express=require(_0x20bf('0x0'));var router=express[_0x20bf('0x1')]();var auth=require(_0x20bf('0x2'));var controller=require(_0x20bf('0x3'));router['get']('/',auth[_0x20bf('0x4')](),controller[_0x20bf('0x5')]);router['get'](_0x20bf('0x6'),auth['isAuthenticated'](),controller[_0x20bf('0x7')]);router[_0x20bf('0x8')](_0x20bf('0x9'),auth['isAuthenticated'](),controller[_0x20bf('0xa')]);router['get'](_0x20bf('0xb'),auth[_0x20bf('0x4')](),controller[_0x20bf('0xc')]);router[_0x20bf('0x8')]('/:id',auth[_0x20bf('0x4')](),controller[_0x20bf('0xd')]);router[_0x20bf('0x8')](_0x20bf('0xe'),auth[_0x20bf('0x4')](),controller[_0x20bf('0xf')]);router[_0x20bf('0x10')]('/',auth[_0x20bf('0x4')](),controller[_0x20bf('0x11')]);router[_0x20bf('0x10')](_0x20bf('0x12'),auth['isAuthenticated'](),controller[_0x20bf('0x13')]);router[_0x20bf('0x10')](_0x20bf('0x14'),auth[_0x20bf('0x4')](),controller[_0x20bf('0x15')]);router['put'](_0x20bf('0x16'),auth[_0x20bf('0x4')](),controller[_0x20bf('0x17')]);router['delete'](_0x20bf('0x16'),auth['isAuthenticated'](),controller[_0x20bf('0x18')]);module[_0x20bf('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 6b46a8f..01beddb 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 _0x0cac=['INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x436714,_0x384c53){var _0x503589=function(_0x50cb60){while(--_0x50cb60){_0x436714['push'](_0x436714['shift']());}};_0x503589(++_0x384c53);}(_0x0cac,0x1c4));var _0xc0ca=function(_0x1d3a3b,_0x49e405){_0x1d3a3b=_0x1d3a3b-0x0;var _0x59b26f=_0x0cac[_0x1d3a3b];return _0x59b26f;};'use strict';var moment=require(_0xc0ca('0x0'));var Sequelize=require(_0xc0ca('0x1'));module[_0xc0ca('0x2')]={'CmHopperId':{'type':Sequelize[_0xc0ca('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xc0ca('0x4')],'defaultValue':moment()[_0xc0ca('0x5')](_0xc0ca('0x6'))},'countbusyretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc0ca('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbb32=['sequelize','exports','INTEGER','DATE','format'];(function(_0x1c31a9,_0x35c105){var _0x14187a=function(_0x481c81){while(--_0x481c81){_0x1c31a9['push'](_0x1c31a9['shift']());}};_0x14187a(++_0x35c105);}(_0xbb32,0xdc));var _0x2bb3=function(_0x73e4cf,_0x2a8375){_0x73e4cf=_0x73e4cf-0x0;var _0x1e1bf8=_0xbb32[_0x73e4cf];return _0x1e1bf8;};'use strict';var moment=require('moment');var Sequelize=require(_0x2bb3('0x0'));module[_0x2bb3('0x1')]={'CmHopperId':{'type':Sequelize[_0x2bb3('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2bb3('0x3')],'defaultValue':moment()[_0x2bb3('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2bb3('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 fce9781..1d0cb62 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 _0x2236=['then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','show','params','catch','create','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x2236,0x138));var _0x6223=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x2236[_0x3fa7d3];return _0x4c51bd;};'use strict';var emlformat=require(_0x6223('0x0'));var rimraf=require(_0x6223('0x1'));var zipdir=require(_0x6223('0x2'));var jsonpatch=require(_0x6223('0x3'));var rp=require(_0x6223('0x4'));var moment=require(_0x6223('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6223('0x6'));var util=require(_0x6223('0x7'));var path=require(_0x6223('0x8'));var sox=require(_0x6223('0x9'));var csv=require(_0x6223('0xa'));var ejs=require(_0x6223('0xb'));var fs=require('fs');var fs_extra=require(_0x6223('0xc'));var _=require(_0x6223('0xd'));var squel=require(_0x6223('0xe'));var crypto=require(_0x6223('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6223('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6223('0x11'));var Papa=require(_0x6223('0x12'));var Redis=require(_0x6223('0x13'));var authService=require(_0x6223('0x14'));var qs=require(_0x6223('0x15'));var as=require(_0x6223('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6223('0x17'))(_0x6223('0x18'));var utils=require('../../config/utils');var config=require(_0x6223('0x19'));var licenseUtil=require(_0x6223('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dd207,_0x555bdb){_0x555bdb=_0x555bdb||0xcc;return function(_0x3d29d4){if(_0x3d29d4){return _0x2dd207[_0x6223('0x1b')](_0x555bdb);}return _0x2dd207[_0x6223('0x1c')](_0x555bdb)[_0x6223('0x1d')]();};}function respondWithResult(_0x9c44a8,_0x34dd98){_0x34dd98=_0x34dd98||0xc8;return function(_0x56a88b){if(_0x56a88b){return _0x9c44a8[_0x6223('0x1c')](_0x34dd98)[_0x6223('0x1e')](_0x56a88b);}};}function respondWithFilteredResult(_0x86c7bc,_0xb2b86){return function(_0x395162){if(_0x395162){var _0x5458ed=typeof _0xb2b86['offset']===_0x6223('0x1f')&&typeof _0xb2b86[_0x6223('0x20')]===_0x6223('0x1f');var _0x110fb1=_0x395162[_0x6223('0x21')];var _0x58c700=_0x5458ed?0x0:_0xb2b86[_0x6223('0x22')];var _0x3f28e5=_0x5458ed?_0x395162[_0x6223('0x21')]:_0xb2b86[_0x6223('0x22')]+_0xb2b86[_0x6223('0x20')];var _0x1b809b;if(_0x3f28e5>=_0x110fb1){_0x3f28e5=_0x110fb1;_0x1b809b=0xc8;}else{_0x1b809b=0xce;}_0x86c7bc[_0x6223('0x1c')](_0x1b809b);return _0x86c7bc['set'](_0x6223('0x23'),_0x58c700+'-'+_0x3f28e5+'/'+_0x110fb1)['json'](_0x395162);}return null;};}function patchUpdates(_0x31d1d1){return function(_0x19e9f4){try{jsonpatch[_0x6223('0x24')](_0x19e9f4,_0x31d1d1,!![]);}catch(_0x770b99){return BPromise[_0x6223('0x25')](_0x770b99);}return _0x19e9f4[_0x6223('0x26')]();};}function saveUpdates(_0xb4dd55,_0x536fd0){return function(_0x10c5af){if(_0x10c5af){return _0x10c5af[_0x6223('0x27')](_0xb4dd55)[_0x6223('0x28')](function(_0x453f1f){return _0x453f1f;});}return null;};}function removeEntity(_0x5d7909,_0x1ab467){return function(_0x30e1d6){if(_0x30e1d6){return _0x30e1d6['destroy']()[_0x6223('0x28')](function(){var _0xaed482=_0x30e1d6[_0x6223('0x29')]({'plain':!![]});var _0x13ca56=_0x6223('0x2a');return db[_0x6223('0x2b')][_0x6223('0x2c')]({'where':{'type':_0x13ca56,'resourceId':_0xaed482['id']}})[_0x6223('0x28')](function(){return _0x30e1d6;});})[_0x6223('0x28')](function(){_0x5d7909[_0x6223('0x1c')](0xcc)[_0x6223('0x1d')]();});}};}function handleEntityNotFound(_0x870e40,_0x247463){return function(_0x1236de){if(!_0x1236de){_0x870e40[_0x6223('0x1b')](0x194);}return _0x1236de;};}function handleError(_0x26498a,_0x4ca0e7){_0x4ca0e7=_0x4ca0e7||0x1f4;return function(_0x43efb7){logger['error'](_0x43efb7[_0x6223('0x2d')]);if(_0x43efb7[_0x6223('0x2e')]){delete _0x43efb7['name'];}_0x26498a[_0x6223('0x1c')](_0x4ca0e7)[_0x6223('0x2f')](_0x43efb7);};}exports[_0x6223('0x30')]=function(_0x4e0141,_0x3f1e38){var _0xf2f61={},_0xb161e7={},_0x5e25d5={'count':0x0,'rows':[]};var _0x218660=_[_0x6223('0x31')](db['CmHopperAdditionalPhone'][_0x6223('0x32')],function(_0x59e00b){return{'name':_0x59e00b[_0x6223('0x33')],'type':_0x59e00b[_0x6223('0x34')][_0x6223('0x35')]};});_0xb161e7['model']=_['map'](_0x218660,'name');_0xb161e7[_0x6223('0x36')]=_[_0x6223('0x37')](_0x4e0141[_0x6223('0x36')]);_0xb161e7[_0x6223('0x38')]=_[_0x6223('0x39')](_0xb161e7[_0x6223('0x3a')],_0xb161e7['query']);_0xf2f61['attributes']=_[_0x6223('0x39')](_0xb161e7[_0x6223('0x3a')],qs[_0x6223('0x3b')](_0x4e0141['query']['fields']));_0xf2f61[_0x6223('0x3c')]=_0xf2f61[_0x6223('0x3c')][_0x6223('0x3d')]?_0xf2f61[_0x6223('0x3c')]:_0xb161e7[_0x6223('0x3a')];if(!_0x4e0141[_0x6223('0x36')][_0x6223('0x3e')](_0x6223('0x3f'))){_0xf2f61[_0x6223('0x20')]=qs[_0x6223('0x20')](_0x4e0141[_0x6223('0x36')]['limit']);_0xf2f61[_0x6223('0x22')]=qs[_0x6223('0x22')](_0x4e0141['query'][_0x6223('0x22')]);}_0xf2f61[_0x6223('0x40')]=qs[_0x6223('0x41')](_0x4e0141[_0x6223('0x36')][_0x6223('0x41')]);_0xf2f61[_0x6223('0x42')]=qs[_0x6223('0x38')](_[_0x6223('0x43')](_0x4e0141[_0x6223('0x36')],_0xb161e7['filters']),_0x218660);if(_0x4e0141[_0x6223('0x36')][_0x6223('0x44')]){_0xf2f61['where']=_[_0x6223('0x45')](_0xf2f61[_0x6223('0x42')],{'$or':_['map'](_0x218660,function(_0x1a65ef){if(_0x1a65ef[_0x6223('0x34')]!==_0x6223('0x46')){var _0x357d48={};_0x357d48[_0x1a65ef[_0x6223('0x2e')]]={'$like':'%'+_0x4e0141[_0x6223('0x36')][_0x6223('0x44')]+'%'};return _0x357d48;}})});}_0xf2f61=_['merge']({},_0xf2f61,_0x4e0141[_0x6223('0x47')]);var _0x5b0567={'where':_0xf2f61[_0x6223('0x42')]};return db[_0x6223('0x48')][_0x6223('0x21')](_0x5b0567)[_0x6223('0x28')](function(_0x2c1432){_0x5e25d5[_0x6223('0x21')]=_0x2c1432;if(_0x4e0141['query'][_0x6223('0x49')]){_0xf2f61[_0x6223('0x4a')]=[{'all':!![]}];}return db[_0x6223('0x48')][_0x6223('0x4b')](_0xf2f61);})['then'](function(_0x19d40d){_0x5e25d5[_0x6223('0x4c')]=_0x19d40d;return _0x5e25d5;})['then'](respondWithFilteredResult(_0x3f1e38,_0xf2f61))['catch'](handleError(_0x3f1e38,null));};exports[_0x6223('0x4d')]=function(_0x3dfdd2,_0x2c80d6){var _0x31d330={'raw':!![],'where':{'id':_0x3dfdd2[_0x6223('0x4e')]['id']}},_0x270c39={};_0x270c39[_0x6223('0x3a')]=_[_0x6223('0x37')](db[_0x6223('0x48')][_0x6223('0x32')]);_0x270c39[_0x6223('0x36')]=_[_0x6223('0x37')](_0x3dfdd2[_0x6223('0x36')]);_0x270c39['filters']=_[_0x6223('0x39')](_0x270c39[_0x6223('0x3a')],_0x270c39[_0x6223('0x36')]);_0x31d330[_0x6223('0x3c')]=_['intersection'](_0x270c39[_0x6223('0x3a')],qs[_0x6223('0x3b')](_0x3dfdd2['query'][_0x6223('0x3b')]));_0x31d330[_0x6223('0x3c')]=_0x31d330[_0x6223('0x3c')]['length']?_0x31d330[_0x6223('0x3c')]:_0x270c39['model'];if(_0x3dfdd2[_0x6223('0x36')][_0x6223('0x49')]){_0x31d330['include']=[{'all':!![]}];}_0x31d330=_[_0x6223('0x45')]({},_0x31d330,_0x3dfdd2['options']);return db[_0x6223('0x48')]['find'](_0x31d330)[_0x6223('0x28')](handleEntityNotFound(_0x2c80d6,null))[_0x6223('0x28')](respondWithResult(_0x2c80d6,null))[_0x6223('0x4f')](handleError(_0x2c80d6,null));};exports[_0x6223('0x50')]=function(_0x1b2299,_0x4bbc45){return db['CmHopperAdditionalPhone'][_0x6223('0x50')](_0x1b2299['body'],{})[_0x6223('0x28')](function(_0x4beb25){var _0x1b330=_0x1b2299[_0x6223('0x51')][_0x6223('0x29')]({'plain':!![]});if(!_0x1b330)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b330['role']==='user'){var _0x1147f9=_0x4beb25[_0x6223('0x29')]({'plain':!![]});var _0x332e45='CmHopperAdditionalPhones';return db[_0x6223('0x52')]['find']({'where':{'name':_0x332e45,'userProfileId':_0x1b330[_0x6223('0x53')]},'raw':!![]})[_0x6223('0x28')](function(_0x3171d7){if(_0x3171d7&&_0x3171d7['autoAssociation']===0x0){return db[_0x6223('0x2b')]['create']({'name':_0x1147f9[_0x6223('0x2e')],'resourceId':_0x1147f9['id'],'type':_0x3171d7[_0x6223('0x2e')],'sectionId':_0x3171d7['id']},{})[_0x6223('0x28')](function(){return _0x4beb25;});}else{return _0x4beb25;}})[_0x6223('0x4f')](function(_0xa76dfc){logger[_0x6223('0x54')](_0x6223('0x55'),_0xa76dfc);throw _0xa76dfc;});}return _0x4beb25;})[_0x6223('0x28')](respondWithResult(_0x4bbc45,0xc9))[_0x6223('0x4f')](handleError(_0x4bbc45,null));};exports[_0x6223('0x27')]=function(_0x21764e,_0x210765){if(_0x21764e[_0x6223('0x56')]['id']){delete _0x21764e['body']['id'];}return db['CmHopperAdditionalPhone'][_0x6223('0x57')]({'where':{'id':_0x21764e['params']['id']}})[_0x6223('0x28')](handleEntityNotFound(_0x210765,null))[_0x6223('0x28')](saveUpdates(_0x21764e[_0x6223('0x56')],null))[_0x6223('0x28')](respondWithResult(_0x210765,null))['catch'](handleError(_0x210765,null));};exports[_0x6223('0x2c')]=function(_0x2c04db,_0x3c3bc8){return db[_0x6223('0x48')][_0x6223('0x57')]({'where':{'id':_0x2c04db['params']['id']}})[_0x6223('0x28')](handleEntityNotFound(_0x3c3bc8,null))[_0x6223('0x28')](removeEntity(_0x3c3bc8,null))['catch'](handleError(_0x3c3bc8,null));}; \ No newline at end of file +var _0x8ffb=['hasOwnProperty','limit','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','attributes','merge','create','body','get','user','CmHopperAdditionalPhones','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperAdditionalPhone','fieldName','key','model','map','query','intersection','fields','length'];(function(_0x58806e,_0x4310bc){var _0x4c6ea3=function(_0x24df51){while(--_0x24df51){_0x58806e['push'](_0x58806e['shift']());}};_0x4c6ea3(++_0x4310bc);}(_0x8ffb,0x1eb));var _0xb8ff=function(_0x58ceee,_0x2be7ab){_0x58ceee=_0x58ceee-0x0;var _0x2c5da6=_0x8ffb[_0x58ceee];return _0x2c5da6;};'use strict';var emlformat=require(_0xb8ff('0x0'));var rimraf=require(_0xb8ff('0x1'));var zipdir=require(_0xb8ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8ff('0x3'));var moment=require(_0xb8ff('0x4'));var BPromise=require(_0xb8ff('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb8ff('0x6'));var csv=require(_0xb8ff('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8ff('0x8'));var _=require(_0xb8ff('0x9'));var squel=require('squel');var crypto=require(_0xb8ff('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb8ff('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb8ff('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb8ff('0xd'));var qs=require(_0xb8ff('0xe'));var as=require(_0xb8ff('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8ff('0x10'))(_0xb8ff('0x11'));var utils=require('../../config/utils');var config=require(_0xb8ff('0x12'));var licenseUtil=require(_0xb8ff('0x13'));var db=require(_0xb8ff('0x14'))['db'];function respondWithStatusCode(_0x29f59a,_0x7b42b1){_0x7b42b1=_0x7b42b1||0xcc;return function(_0x343477){if(_0x343477){return _0x29f59a['sendStatus'](_0x7b42b1);}return _0x29f59a[_0xb8ff('0x15')](_0x7b42b1)[_0xb8ff('0x16')]();};}function respondWithResult(_0x20c0e5,_0x4b5c60){_0x4b5c60=_0x4b5c60||0xc8;return function(_0x110589){if(_0x110589){return _0x20c0e5[_0xb8ff('0x15')](_0x4b5c60)[_0xb8ff('0x17')](_0x110589);}};}function respondWithFilteredResult(_0x328159,_0x18e93c){return function(_0x575ea6){if(_0x575ea6){var _0x50f478=typeof _0x18e93c['offset']===_0xb8ff('0x18')&&typeof _0x18e93c['limit']===_0xb8ff('0x18');var _0x2fe761=_0x575ea6[_0xb8ff('0x19')];var _0x406778=_0x50f478?0x0:_0x18e93c[_0xb8ff('0x1a')];var _0x450a12=_0x50f478?_0x575ea6[_0xb8ff('0x19')]:_0x18e93c[_0xb8ff('0x1a')]+_0x18e93c['limit'];var _0x12de79;if(_0x450a12>=_0x2fe761){_0x450a12=_0x2fe761;_0x12de79=0xc8;}else{_0x12de79=0xce;}_0x328159[_0xb8ff('0x15')](_0x12de79);return _0x328159[_0xb8ff('0x1b')](_0xb8ff('0x1c'),_0x406778+'-'+_0x450a12+'/'+_0x2fe761)['json'](_0x575ea6);}return null;};}function patchUpdates(_0xd258c8){return function(_0x3d0a44){try{jsonpatch['apply'](_0x3d0a44,_0xd258c8,!![]);}catch(_0x15f1a5){return BPromise[_0xb8ff('0x1d')](_0x15f1a5);}return _0x3d0a44['save']();};}function saveUpdates(_0x1119a1,_0x112229){return function(_0x31fdc5){if(_0x31fdc5){return _0x31fdc5[_0xb8ff('0x1e')](_0x1119a1)[_0xb8ff('0x1f')](function(_0x816807){return _0x816807;});}return null;};}function removeEntity(_0x227e78,_0x2dcbc7){return function(_0x59166b){if(_0x59166b){return _0x59166b[_0xb8ff('0x20')]()[_0xb8ff('0x1f')](function(){var _0x86e426=_0x59166b['get']({'plain':!![]});var _0x3f9275='CmHopperAdditionalPhones';return db['UserProfileResource'][_0xb8ff('0x20')]({'where':{'type':_0x3f9275,'resourceId':_0x86e426['id']}})[_0xb8ff('0x1f')](function(){return _0x59166b;});})[_0xb8ff('0x1f')](function(){_0x227e78[_0xb8ff('0x15')](0xcc)[_0xb8ff('0x16')]();});}};}function handleEntityNotFound(_0x53b921,_0x48b411){return function(_0x40af3c){if(!_0x40af3c){_0x53b921[_0xb8ff('0x21')](0x194);}return _0x40af3c;};}function handleError(_0x431282,_0x32c71c){_0x32c71c=_0x32c71c||0x1f4;return function(_0x540d39){logger[_0xb8ff('0x22')](_0x540d39[_0xb8ff('0x23')]);if(_0x540d39[_0xb8ff('0x24')]){delete _0x540d39[_0xb8ff('0x24')];}_0x431282[_0xb8ff('0x15')](_0x32c71c)[_0xb8ff('0x25')](_0x540d39);};}exports[_0xb8ff('0x26')]=function(_0x2a3346,_0x5bd0c4){var _0x2c4c42={},_0x465b99={},_0x2d6c56={'count':0x0,'rows':[]};var _0x24d323=_['map'](db[_0xb8ff('0x27')]['rawAttributes'],function(_0x31a9a1){return{'name':_0x31a9a1[_0xb8ff('0x28')],'type':_0x31a9a1['type'][_0xb8ff('0x29')]};});_0x465b99[_0xb8ff('0x2a')]=_[_0xb8ff('0x2b')](_0x24d323,_0xb8ff('0x24'));_0x465b99[_0xb8ff('0x2c')]=_['keys'](_0x2a3346[_0xb8ff('0x2c')]);_0x465b99['filters']=_[_0xb8ff('0x2d')](_0x465b99[_0xb8ff('0x2a')],_0x465b99['query']);_0x2c4c42['attributes']=_['intersection'](_0x465b99[_0xb8ff('0x2a')],qs[_0xb8ff('0x2e')](_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x2e')]));_0x2c4c42['attributes']=_0x2c4c42['attributes'][_0xb8ff('0x2f')]?_0x2c4c42['attributes']:_0x465b99[_0xb8ff('0x2a')];if(!_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x30')]('nolimit')){_0x2c4c42[_0xb8ff('0x31')]=qs[_0xb8ff('0x31')](_0x2a3346[_0xb8ff('0x2c')]['limit']);_0x2c4c42[_0xb8ff('0x1a')]=qs['offset'](_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x1a')]);}_0x2c4c42['order']=qs[_0xb8ff('0x32')](_0x2a3346[_0xb8ff('0x2c')]['sort']);_0x2c4c42[_0xb8ff('0x33')]=qs['filters'](_[_0xb8ff('0x34')](_0x2a3346['query'],_0x465b99[_0xb8ff('0x35')]),_0x24d323);if(_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x36')]){_0x2c4c42[_0xb8ff('0x33')]=_['merge'](_0x2c4c42[_0xb8ff('0x33')],{'$or':_[_0xb8ff('0x2b')](_0x24d323,function(_0x1fdc37){if(_0x1fdc37[_0xb8ff('0x37')]!==_0xb8ff('0x38')){var _0x469df1={};_0x469df1[_0x1fdc37[_0xb8ff('0x24')]]={'$like':'%'+_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x36')]+'%'};return _0x469df1;}})});}_0x2c4c42=_['merge']({},_0x2c4c42,_0x2a3346[_0xb8ff('0x39')]);var _0x2ffcdc={'where':_0x2c4c42['where']};return db['CmHopperAdditionalPhone'][_0xb8ff('0x19')](_0x2ffcdc)['then'](function(_0x58cd58){_0x2d6c56[_0xb8ff('0x19')]=_0x58cd58;if(_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x3a')]){_0x2c4c42[_0xb8ff('0x3b')]=[{'all':!![]}];}return db[_0xb8ff('0x27')][_0xb8ff('0x3c')](_0x2c4c42);})[_0xb8ff('0x1f')](function(_0xb25dc7){_0x2d6c56[_0xb8ff('0x3d')]=_0xb25dc7;return _0x2d6c56;})[_0xb8ff('0x1f')](respondWithFilteredResult(_0x5bd0c4,_0x2c4c42))[_0xb8ff('0x3e')](handleError(_0x5bd0c4,null));};exports[_0xb8ff('0x3f')]=function(_0x27ed15,_0x5bfbd5){var _0x55f198={'raw':!![],'where':{'id':_0x27ed15['params']['id']}},_0x3c2fcc={};_0x3c2fcc[_0xb8ff('0x2a')]=_[_0xb8ff('0x40')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x3c2fcc['query']=_[_0xb8ff('0x40')](_0x27ed15['query']);_0x3c2fcc[_0xb8ff('0x35')]=_[_0xb8ff('0x2d')](_0x3c2fcc[_0xb8ff('0x2a')],_0x3c2fcc[_0xb8ff('0x2c')]);_0x55f198[_0xb8ff('0x41')]=_[_0xb8ff('0x2d')](_0x3c2fcc[_0xb8ff('0x2a')],qs[_0xb8ff('0x2e')](_0x27ed15[_0xb8ff('0x2c')][_0xb8ff('0x2e')]));_0x55f198[_0xb8ff('0x41')]=_0x55f198['attributes'][_0xb8ff('0x2f')]?_0x55f198[_0xb8ff('0x41')]:_0x3c2fcc[_0xb8ff('0x2a')];if(_0x27ed15[_0xb8ff('0x2c')]['includeAll']){_0x55f198[_0xb8ff('0x3b')]=[{'all':!![]}];}_0x55f198=_[_0xb8ff('0x42')]({},_0x55f198,_0x27ed15['options']);return db[_0xb8ff('0x27')]['find'](_0x55f198)[_0xb8ff('0x1f')](handleEntityNotFound(_0x5bfbd5,null))[_0xb8ff('0x1f')](respondWithResult(_0x5bfbd5,null))[_0xb8ff('0x3e')](handleError(_0x5bfbd5,null));};exports[_0xb8ff('0x43')]=function(_0x36338c,_0x23fe0a){return db[_0xb8ff('0x27')][_0xb8ff('0x43')](_0x36338c[_0xb8ff('0x44')],{})['then'](function(_0x5a7641){var _0x45e579=_0x36338c['user'][_0xb8ff('0x45')]({'plain':!![]});if(!_0x45e579)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45e579['role']===_0xb8ff('0x46')){var _0x242d8b=_0x5a7641[_0xb8ff('0x45')]({'plain':!![]});var _0x334ec8=_0xb8ff('0x47');return db[_0xb8ff('0x48')][_0xb8ff('0x49')]({'where':{'name':_0x334ec8,'userProfileId':_0x45e579[_0xb8ff('0x4a')]},'raw':!![]})[_0xb8ff('0x1f')](function(_0x1ef006){if(_0x1ef006&&_0x1ef006['autoAssociation']===0x0){return db[_0xb8ff('0x4b')][_0xb8ff('0x43')]({'name':_0x242d8b['name'],'resourceId':_0x242d8b['id'],'type':_0x1ef006[_0xb8ff('0x24')],'sectionId':_0x1ef006['id']},{})[_0xb8ff('0x1f')](function(){return _0x5a7641;});}else{return _0x5a7641;}})['catch'](function(_0x193955){logger[_0xb8ff('0x22')](_0xb8ff('0x4c'),_0x193955);throw _0x193955;});}return _0x5a7641;})['then'](respondWithResult(_0x23fe0a,0xc9))['catch'](handleError(_0x23fe0a,null));};exports[_0xb8ff('0x1e')]=function(_0x314d30,_0x203e09){if(_0x314d30[_0xb8ff('0x44')]['id']){delete _0x314d30[_0xb8ff('0x44')]['id'];}return db[_0xb8ff('0x27')][_0xb8ff('0x49')]({'where':{'id':_0x314d30['params']['id']}})[_0xb8ff('0x1f')](handleEntityNotFound(_0x203e09,null))[_0xb8ff('0x1f')](saveUpdates(_0x314d30[_0xb8ff('0x44')],null))[_0xb8ff('0x1f')](respondWithResult(_0x203e09,null))[_0xb8ff('0x3e')](handleError(_0x203e09,null));};exports[_0xb8ff('0x20')]=function(_0x4dd994,_0x46de29){return db[_0xb8ff('0x27')][_0xb8ff('0x49')]({'where':{'id':_0x4dd994['params']['id']}})['then'](handleEntityNotFound(_0x46de29,null))[_0xb8ff('0x1f')](removeEntity(_0x46de29,null))[_0xb8ff('0x3e')](handleError(_0x46de29,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index cc31e33..77dc216 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 _0x9a4a=['moment','bluebird','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x9a4a,0xb2));var _0xa9a4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9a4a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa9a4('0x0'));var util=require(_0xa9a4('0x1'));var logger=require(_0xa9a4('0x2'))(_0xa9a4('0x3'));var moment=require(_0xa9a4('0x4'));var BPromise=require(_0xa9a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9a4('0x6'));var rimraf=require(_0xa9a4('0x7'));var config=require('../../config/environment');var attributes=require(_0xa9a4('0x8'));module[_0xa9a4('0x9')]=function(_0x47023d,_0xfa4895){return _0x47023d[_0xa9a4('0xa')](_0xa9a4('0xb'),attributes,{'tableName':_0xa9a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2001=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports'];(function(_0x3736ba,_0x16ef6b){var _0x2c066a=function(_0x119f35){while(--_0x119f35){_0x3736ba['push'](_0x3736ba['shift']());}};_0x2c066a(++_0x16ef6b);}(_0x2001,0xf3));var _0x1200=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2001[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x1200('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1200('0x1'));var moment=require(_0x1200('0x2'));var BPromise=require(_0x1200('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1200('0x4'));var rimraf=require(_0x1200('0x5'));var config=require(_0x1200('0x6'));var attributes=require(_0x1200('0x7'));module[_0x1200('0x8')]=function(_0x1bba62,_0x3db51e){return _0x1bba62[_0x1200('0x9')](_0x1200('0xa'),attributes,{'tableName':_0x1200('0xb'),'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 86303c8..93b809c 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 _0xdcda=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','countagentrejectretry','VoiceQueueId','waitTime','duration','isNil','scheduledat','add','minutes','phone','countnoanswerretry','updatedAt','createdAt','sequelize','transaction','CmHopper','update','activateAdditionalPhone','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','CampaignId','OrderBy','ASC','countbusyretry'];(function(_0xb72818,_0xd5575a){var _0x37dc47=function(_0x4c9faf){while(--_0x4c9faf){_0xb72818['push'](_0xb72818['shift']());}};_0x37dc47(++_0xd5575a);}(_0xdcda,0x101));var _0xadcd=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdcda[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xadcd('0x0'));var util=require(_0xadcd('0x1'));var moment=require(_0xadcd('0x2'));var BPromise=require(_0xadcd('0x3'));var rs=require(_0xadcd('0x4'));var fs=require('fs');var Redis=require(_0xadcd('0x5'));var db=require(_0xadcd('0x6'))['db'];var utils=require(_0xadcd('0x7'));var logger=require(_0xadcd('0x8'))(_0xadcd('0x9'));var config=require(_0xadcd('0xa'));var jayson=require(_0xadcd('0xb'));var client=jayson[_0xadcd('0xc')][_0xadcd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x525c1d,_0x1104ce,_0x415bb6){return new BPromise(function(_0x22647b,_0x229e9a){return client[_0xadcd('0xe')](_0x525c1d,_0x415bb6)[_0xadcd('0xf')](function(_0x45c8c4){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1104ce,_0xadcd('0x10'));logger['debug'](_0xadcd('0x11'),_0x1104ce,'request\x20sent',JSON[_0xadcd('0x12')](_0x45c8c4));if(_0x45c8c4['error']){if(_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x14')]===0x1f4){logger[_0xadcd('0x13')](_0xadcd('0x15'),_0x1104ce,_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x16')]);return _0x229e9a(_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x16')]);}logger[_0xadcd('0x13')](_0xadcd('0x15'),_0x1104ce,_0x45c8c4['error']['message']);return _0x22647b(_0x45c8c4[_0xadcd('0x13')][_0xadcd('0x16')]);}else{logger['info'](_0xadcd('0x15'),_0x1104ce,_0xadcd('0x10'));_0x22647b(_0x45c8c4[_0xadcd('0x17')]['message']);}})[_0xadcd('0x18')](function(_0x6aeba0){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1104ce,_0x6aeba0);_0x229e9a(_0x6aeba0);});});}exports[_0xadcd('0x19')]=function(_0x28c355){var _0x2b0e6d=this;return new Promise(function(_0x2a3dda,_0x1e9e06){return db['CmHopper'][_0xadcd('0x1a')]({'raw':!![],'where':{'ContactId':_0x28c355[_0xadcd('0x1b')][_0xadcd('0x1c')],'ListId':_0x28c355['body']['ListId'],'VoiceQueueId':_0x28c355['body']['VoiceQueueId']===undefined?null:_0x28c355[_0xadcd('0x1b')]['VoiceQueueId'],'CampaignId':_0x28c355['body'][_0xadcd('0x1d')]===undefined?null:_0x28c355[_0xadcd('0x1b')][_0xadcd('0x1d')]}})[_0xadcd('0xf')](function(_0x5c9775){if(_0x5c9775!=null){return db['CmHopperAdditionalPhone'][_0xadcd('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x5c9775['id'],'OrderBy':{'$gt':_0x5c9775[_0xadcd('0x1e')]}},'order':[[_0xadcd('0x1e'),_0xadcd('0x1f')]]})[_0xadcd('0xf')](function(_0x459334){var _0x55e7df=0x0;if(_0x459334){if(_0x459334[_0xadcd('0x20')]+_0x459334['countcongestionretry']+_0x459334['countnoanswerretry']+_0x459334[_0xadcd('0x21')]+_0x459334[_0xadcd('0x22')]+_0x459334[_0xadcd('0x23')]+_0x459334[_0xadcd('0x24')]+_0x459334['countagentrejectretry']<_0x28c355[_0xadcd('0x25')][_0xadcd('0x26')])_0x55e7df=0x1;_0x2a3dda({'additional':_0x55e7df});}else{return db[_0xadcd('0x27')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5c9775['id']},'order':[[_0xadcd('0x1e'),_0xadcd('0x1f')]]})['then'](function(_0x54b9ee){var _0x14042a=0x0;if(_0x54b9ee){if(_0x54b9ee[_0xadcd('0x20')]+_0x54b9ee[_0xadcd('0x28')]+_0x54b9ee['countnoanswerretry']+_0x54b9ee[_0xadcd('0x21')]+_0x54b9ee[_0xadcd('0x22')]+_0x54b9ee[_0xadcd('0x23')]+_0x54b9ee[_0xadcd('0x24')]+_0x54b9ee[_0xadcd('0x29')]<_0x28c355[_0xadcd('0x25')][_0xadcd('0x26')])_0x14042a=0x1;_0x2a3dda({'additional':_0x14042a});}else{_0x2a3dda({'additional':0x0});}})['catch'](function(_0x3e05b0){logger[_0xadcd('0x13')](_0xadcd('0x19'),_0x3e05b0['message']);_0x1e9e06(_0x2b0e6d[_0xadcd('0x13')](0x1f4,_0x3e05b0[_0xadcd('0x16')]));});}})[_0xadcd('0x18')](function(_0x1ab058){logger[_0xadcd('0x13')](_0xadcd('0x19'),_0x1ab058[_0xadcd('0x16')]);_0x1e9e06(_0x2b0e6d['error'](0x1f4,_0x1ab058['message']));});}else _0x2a3dda({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x458fc9){var _0x1d8591=this;return new Promise(function(_0x4176e9,_0x6ca8d8){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x1c')],'ListId':_0x458fc9[_0xadcd('0x1b')]['ListId'],'VoiceQueueId':_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x2a')]===undefined?null:_0x458fc9['body'][_0xadcd('0x2a')],'CampaignId':_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x1d')]===undefined?null:_0x458fc9[_0xadcd('0x1b')][_0xadcd('0x1d')]}})[_0xadcd('0xf')](function(_0x332787){if(_0x332787!=null){return db[_0xadcd('0x27')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x332787['id'],'OrderBy':{'$gte':_0x332787['OrderBy']}},'order':[[_0xadcd('0x1e'),_0xadcd('0x1f')]]})[_0xadcd('0xf')](function(_0x475f6e){if(_0x475f6e)return activateAdditionalPhone(_0x332787,_0x458fc9[_0xadcd('0x1b')],_0x475f6e,_0x458fc9['duration'],_0x458fc9[_0xadcd('0x2b')])[_0xadcd('0xf')](function(_0x47f33f){_0x4176e9(_0x47f33f);});else{return db[_0xadcd('0x27')][_0xadcd('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x332787['id']},'order':[['OrderBy',_0xadcd('0x1f')]]})[_0xadcd('0xf')](function(_0x570ff2){if(_0x570ff2)return activateAdditionalPhone(_0x332787,_0x458fc9[_0xadcd('0x1b')],_0x570ff2,_0x458fc9[_0xadcd('0x2c')],_0x458fc9[_0xadcd('0x2b')])[_0xadcd('0xf')](function(_0x3e1bf8){_0x4176e9(_0x3e1bf8);});else{_0x4176e9({'id':_0x332787['id'],'phone':''});}})[_0xadcd('0x18')](function(_0x3c5ead){logger[_0xadcd('0x13')]('VerifyAdditionalPhones',_0x3c5ead['message']);_0x6ca8d8(_0x1d8591[_0xadcd('0x13')](0x1f4,_0x3c5ead[_0xadcd('0x16')]));});}})[_0xadcd('0x18')](function(_0x15ce75){logger['error'](_0xadcd('0x19'),_0x15ce75[_0xadcd('0x16')]);_0x6ca8d8(_0x1d8591[_0xadcd('0x13')](0x1f4,_0x15ce75[_0xadcd('0x16')]));});}else _0x4176e9(0x1);});});};function activateAdditionalPhone(_0x1ae04c,_0x33866a,_0x3d5c64,_0x1d05bc,_0xa69556){return new Promise(function(_0x3638f2,_0x1e7934){var _0xe9a630;if(_[_0xadcd('0x2d')](_0x3d5c64[_0xadcd('0x2e')])){_0x3d5c64[_0xadcd('0x2e')]=moment();}if(moment()>moment(_0x3d5c64['scheduledat'])){_0xe9a630=moment()[_0xadcd('0x2f')](_0xa69556||0x3,_0xadcd('0x30'));}else{if(_0x3d5c64[_0xadcd('0x1e')]==0x0){_0xe9a630=moment(_0x3d5c64['scheduledat']);}else{_0xe9a630=moment()[_0xadcd('0x2f')](_0xa69556||0x3,_0xadcd('0x30'));}}if(_[_0xadcd('0x2d')](_0xe9a630)){_0xe9a630=moment()[_0xadcd('0x2f')](_0xa69556||0x3,_0xadcd('0x30'));}var _0x121da8={'phone':_0x1ae04c[_0xadcd('0x31')],'active':0x0,'OrderBy':_[_0xadcd('0x2d')](_0x1ae04c[_0xadcd('0x1e')])?0x0:_0x1ae04c[_0xadcd('0x1e')],'scheduledat':moment()['add'](_0x1d05bc||0x1,_0xadcd('0x30')),'countbusyretry':_0x33866a[_0xadcd('0x20')],'countcongestionretry':_0x33866a[_0xadcd('0x28')],'countnoanswerretry':_0x33866a[_0xadcd('0x32')],'countnosuchnumberretry':_0x33866a[_0xadcd('0x21')],'countdropretry':_0x33866a[_0xadcd('0x22')],'countabandonedretry':_0x33866a[_0xadcd('0x23')],'countmachineretry':_0x33866a['countmachineretry'],'countagentrejectretry':_0x33866a[_0xadcd('0x29')],'createdAt':_0x33866a['createdAt'],'updatedAt':_0x33866a[_0xadcd('0x33')]};var _0x3566a2={'CmHopperId':_0x1ae04c['id'],'phone':_0x3d5c64[_0xadcd('0x31')],'active':0x0,'OrderBy':_[_0xadcd('0x2d')](_0x3d5c64[_0xadcd('0x1e')])?0x0:_0x3d5c64[_0xadcd('0x1e')],'scheduledat':_0xe9a630,'countbusyretry':_0x3d5c64[_0xadcd('0x20')],'countcongestionretry':_0x3d5c64[_0xadcd('0x28')],'countnoanswerretry':_0x3d5c64[_0xadcd('0x32')],'countnosuchnumberretry':_0x3d5c64[_0xadcd('0x21')],'countdropretry':_0x3d5c64[_0xadcd('0x22')],'countabandonedretry':_0x3d5c64[_0xadcd('0x23')],'countmachineretry':_0x3d5c64[_0xadcd('0x24')],'countagentrejectretry':_0x3d5c64[_0xadcd('0x29')],'createdAt':_0x3d5c64[_0xadcd('0x34')],'updatedAt':_0x3d5c64[_0xadcd('0x33')]};return db[_0xadcd('0x35')][_0xadcd('0x36')](function(_0x371396){return db['CmHopperAdditionalPhone']['update'](_0x121da8,{'where':{'id':_0x3d5c64['id']}},{'transaction':_0x371396})[_0xadcd('0xf')](function(){return db[_0xadcd('0x37')][_0xadcd('0x38')](_0x3566a2,{'where':{'id':_0x1ae04c['id']}},{'transaction':_0x371396});});})[_0xadcd('0xf')](function(_0x374ce8){_0x3638f2({'id':_0x1ae04c['id'],'phone':_0x3d5c64[_0xadcd('0x31')]});})['catch'](function(_0xd70c4a){logger[_0xadcd('0x13')](_0xadcd('0x39'),_0xd70c4a[_0xadcd('0x16')]);_0x1e7934({'error':_0xd70c4a['message']});});});}exports['IncrementPreviewCounters']=function(_0x54a27f){var _0x417c55=this;return new Promise(function(_0x1efb8f,_0x41d09a){return db[_0xadcd('0x37')]['update'](_0x54a27f[_0xadcd('0x1b')]['field'],{'where':{'id':_0x54a27f['body']['id']}})[_0xadcd('0xf')](function(_0x45e8ce){_0x1efb8f(_0x45e8ce);})[_0xadcd('0x18')](function(_0x563acb){logger[_0xadcd('0x13')]('IncrementPreviewCounters',_0x563acb[_0xadcd('0x16')]);_0x41d09a(_0x417c55[_0xadcd('0x13')](0x1f4,_0x563acb[_0xadcd('0x16')]));});});}; \ No newline at end of file +var _0xb0fe=['ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countnoanswerretry','countdropretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','CmHopper','findOne','body'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0xb0fe,0xd2));var _0xeb0f=function(_0x1faa61,_0x1bd7e2){_0x1faa61=_0x1faa61-0x0;var _0x3f0e58=_0xb0fe[_0x1faa61];return _0x3f0e58;};'use strict';var _=require('lodash');var util=require(_0xeb0f('0x0'));var moment=require(_0xeb0f('0x1'));var BPromise=require(_0xeb0f('0x2'));var rs=require(_0xeb0f('0x3'));var fs=require('fs');var Redis=require(_0xeb0f('0x4'));var db=require(_0xeb0f('0x5'))['db'];var utils=require(_0xeb0f('0x6'));var logger=require('../../config/logger')(_0xeb0f('0x7'));var config=require(_0xeb0f('0x8'));var jayson=require(_0xeb0f('0x9'));var client=jayson['client'][_0xeb0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a19cb,_0x29502d,_0x219fa5){return new BPromise(function(_0x34e0fe,_0x1106f7){return client[_0xeb0f('0xb')](_0x3a19cb,_0x219fa5)[_0xeb0f('0xc')](function(_0x4524f8){logger[_0xeb0f('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x29502d,'request\x20sent');logger[_0xeb0f('0xe')](_0xeb0f('0xf'),_0x29502d,_0xeb0f('0x10'),JSON['stringify'](_0x4524f8));if(_0x4524f8[_0xeb0f('0x11')]){if(_0x4524f8['error'][_0xeb0f('0x12')]===0x1f4){logger[_0xeb0f('0x11')](_0xeb0f('0x13'),_0x29502d,_0x4524f8[_0xeb0f('0x11')][_0xeb0f('0x14')]);return _0x1106f7(_0x4524f8['error'][_0xeb0f('0x14')]);}logger[_0xeb0f('0x11')](_0xeb0f('0x13'),_0x29502d,_0x4524f8[_0xeb0f('0x11')]['message']);return _0x34e0fe(_0x4524f8[_0xeb0f('0x11')]['message']);}else{logger[_0xeb0f('0xd')](_0xeb0f('0x13'),_0x29502d,'request\x20sent');_0x34e0fe(_0x4524f8[_0xeb0f('0x15')][_0xeb0f('0x14')]);}})[_0xeb0f('0x16')](function(_0x543f94){logger[_0xeb0f('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x29502d,_0x543f94);_0x1106f7(_0x543f94);});});}exports['VerifyAdditionalPhones']=function(_0xd5fa6c){var _0x4e91fe=this;return new Promise(function(_0x441688,_0x4aed6e){return db[_0xeb0f('0x17')][_0xeb0f('0x18')]({'raw':!![],'where':{'ContactId':_0xd5fa6c[_0xeb0f('0x19')][_0xeb0f('0x1a')],'ListId':_0xd5fa6c[_0xeb0f('0x19')][_0xeb0f('0x1b')],'VoiceQueueId':_0xd5fa6c['body'][_0xeb0f('0x1c')]===undefined?null:_0xd5fa6c[_0xeb0f('0x19')][_0xeb0f('0x1c')],'CampaignId':_0xd5fa6c[_0xeb0f('0x19')]['CampaignId']===undefined?null:_0xd5fa6c['body'][_0xeb0f('0x1d')]}})['then'](function(_0x260625){if(_0x260625!=null){return db[_0xeb0f('0x1e')][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x260625['id'],'OrderBy':{'$gt':_0x260625['OrderBy']}},'order':[[_0xeb0f('0x1f'),_0xeb0f('0x20')]]})['then'](function(_0x4d6f1){var _0x4c9e69=0x0;if(_0x4d6f1){if(_0x4d6f1[_0xeb0f('0x21')]+_0x4d6f1[_0xeb0f('0x22')]+_0x4d6f1['countnoanswerretry']+_0x4d6f1[_0xeb0f('0x23')]+_0x4d6f1['countdropretry']+_0x4d6f1[_0xeb0f('0x24')]+_0x4d6f1[_0xeb0f('0x25')]+_0x4d6f1[_0xeb0f('0x26')]<_0xd5fa6c[_0xeb0f('0x27')]['dialGlobalMaxRetry'])_0x4c9e69=0x1;_0x441688({'additional':_0x4c9e69});}else{return db[_0xeb0f('0x1e')][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x260625['id']},'order':[[_0xeb0f('0x1f'),_0xeb0f('0x20')]]})[_0xeb0f('0xc')](function(_0x3aee93){var _0x2cd79b=0x0;if(_0x3aee93){if(_0x3aee93[_0xeb0f('0x21')]+_0x3aee93[_0xeb0f('0x22')]+_0x3aee93[_0xeb0f('0x28')]+_0x3aee93[_0xeb0f('0x23')]+_0x3aee93[_0xeb0f('0x29')]+_0x3aee93[_0xeb0f('0x24')]+_0x3aee93[_0xeb0f('0x25')]+_0x3aee93[_0xeb0f('0x26')]<_0xd5fa6c[_0xeb0f('0x27')][_0xeb0f('0x2a')])_0x2cd79b=0x1;_0x441688({'additional':_0x2cd79b});}else{_0x441688({'additional':0x0});}})['catch'](function(_0x492d4e){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x492d4e[_0xeb0f('0x14')]);_0x4aed6e(_0x4e91fe['error'](0x1f4,_0x492d4e[_0xeb0f('0x14')]));});}})['catch'](function(_0x3880d9){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x3880d9[_0xeb0f('0x14')]);_0x4aed6e(_0x4e91fe[_0xeb0f('0x11')](0x1f4,_0x3880d9[_0xeb0f('0x14')]));});}else _0x441688({'additional':0x0});});});};exports[_0xeb0f('0x2c')]=function(_0x2ac8bf){var _0x45a171=this;return new Promise(function(_0x27b06e,_0x1df63b){return db[_0xeb0f('0x17')][_0xeb0f('0x18')]({'raw':!![],'where':{'ContactId':_0x2ac8bf['body'][_0xeb0f('0x1a')],'ListId':_0x2ac8bf['body'][_0xeb0f('0x1b')],'VoiceQueueId':_0x2ac8bf[_0xeb0f('0x19')][_0xeb0f('0x1c')]===undefined?null:_0x2ac8bf['body'][_0xeb0f('0x1c')],'CampaignId':_0x2ac8bf[_0xeb0f('0x19')][_0xeb0f('0x1d')]===undefined?null:_0x2ac8bf[_0xeb0f('0x19')][_0xeb0f('0x1d')]}})[_0xeb0f('0xc')](function(_0x37010b){if(_0x37010b!=null){return db[_0xeb0f('0x1e')][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x37010b['id'],'OrderBy':{'$gte':_0x37010b[_0xeb0f('0x1f')]}},'order':[['OrderBy',_0xeb0f('0x20')]]})[_0xeb0f('0xc')](function(_0x2a0104){if(_0x2a0104)return activateAdditionalPhone(_0x37010b,_0x2ac8bf[_0xeb0f('0x19')],_0x2a0104,_0x2ac8bf[_0xeb0f('0x2d')],_0x2ac8bf[_0xeb0f('0x2e')])[_0xeb0f('0xc')](function(_0x1f85ff){_0x27b06e(_0x1f85ff);});else{return db['CmHopperAdditionalPhone'][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x37010b['id']},'order':[['OrderBy',_0xeb0f('0x20')]]})[_0xeb0f('0xc')](function(_0x52a024){if(_0x52a024)return activateAdditionalPhone(_0x37010b,_0x2ac8bf['body'],_0x52a024,_0x2ac8bf[_0xeb0f('0x2d')],_0x2ac8bf[_0xeb0f('0x2e')])['then'](function(_0x39355d){_0x27b06e(_0x39355d);});else{_0x27b06e({'id':_0x37010b['id'],'phone':''});}})[_0xeb0f('0x16')](function(_0x4b4757){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x4b4757[_0xeb0f('0x14')]);_0x1df63b(_0x45a171[_0xeb0f('0x11')](0x1f4,_0x4b4757[_0xeb0f('0x14')]));});}})['catch'](function(_0x34571a){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x34571a[_0xeb0f('0x14')]);_0x1df63b(_0x45a171[_0xeb0f('0x11')](0x1f4,_0x34571a[_0xeb0f('0x14')]));});}else _0x27b06e(0x1);});});};function activateAdditionalPhone(_0xe56a84,_0x241c07,_0x3c540f,_0xe7a55,_0x1de0f4){return new Promise(function(_0x5a844c,_0x3d5da6){var _0x3f9ade;if(_['isNil'](_0x3c540f[_0xeb0f('0x2f')])){_0x3c540f[_0xeb0f('0x2f')]=moment();}if(moment()>moment(_0x3c540f['scheduledat'])){_0x3f9ade=moment()['add'](_0x1de0f4||0x3,'minutes');}else{if(_0x3c540f[_0xeb0f('0x1f')]==0x0){_0x3f9ade=moment(_0x3c540f[_0xeb0f('0x2f')]);}else{_0x3f9ade=moment()[_0xeb0f('0x30')](_0x1de0f4||0x3,_0xeb0f('0x31'));}}if(_[_0xeb0f('0x32')](_0x3f9ade)){_0x3f9ade=moment()[_0xeb0f('0x30')](_0x1de0f4||0x3,_0xeb0f('0x31'));}var _0x4e03c9={'phone':_0xe56a84[_0xeb0f('0x33')],'active':0x0,'OrderBy':_[_0xeb0f('0x32')](_0xe56a84[_0xeb0f('0x1f')])?0x0:_0xe56a84[_0xeb0f('0x1f')],'scheduledat':moment()[_0xeb0f('0x30')](_0xe7a55||0x1,_0xeb0f('0x31')),'countbusyretry':_0x241c07[_0xeb0f('0x21')],'countcongestionretry':_0x241c07[_0xeb0f('0x22')],'countnoanswerretry':_0x241c07['countnoanswerretry'],'countnosuchnumberretry':_0x241c07['countnosuchnumberretry'],'countdropretry':_0x241c07[_0xeb0f('0x29')],'countabandonedretry':_0x241c07[_0xeb0f('0x24')],'countmachineretry':_0x241c07['countmachineretry'],'countagentrejectretry':_0x241c07[_0xeb0f('0x26')],'createdAt':_0x241c07[_0xeb0f('0x34')],'updatedAt':_0x241c07[_0xeb0f('0x35')]};var _0x5bc0cc={'CmHopperId':_0xe56a84['id'],'phone':_0x3c540f['phone'],'active':0x0,'OrderBy':_[_0xeb0f('0x32')](_0x3c540f[_0xeb0f('0x1f')])?0x0:_0x3c540f[_0xeb0f('0x1f')],'scheduledat':_0x3f9ade,'countbusyretry':_0x3c540f[_0xeb0f('0x21')],'countcongestionretry':_0x3c540f[_0xeb0f('0x22')],'countnoanswerretry':_0x3c540f[_0xeb0f('0x28')],'countnosuchnumberretry':_0x3c540f[_0xeb0f('0x23')],'countdropretry':_0x3c540f[_0xeb0f('0x29')],'countabandonedretry':_0x3c540f['countabandonedretry'],'countmachineretry':_0x3c540f[_0xeb0f('0x25')],'countagentrejectretry':_0x3c540f[_0xeb0f('0x26')],'createdAt':_0x3c540f['createdAt'],'updatedAt':_0x3c540f[_0xeb0f('0x35')]};return db[_0xeb0f('0x36')]['transaction'](function(_0x2fb259){return db[_0xeb0f('0x1e')][_0xeb0f('0x37')](_0x4e03c9,{'where':{'id':_0x3c540f['id']}},{'transaction':_0x2fb259})[_0xeb0f('0xc')](function(){return db[_0xeb0f('0x17')][_0xeb0f('0x37')](_0x5bc0cc,{'where':{'id':_0xe56a84['id']}},{'transaction':_0x2fb259});});})[_0xeb0f('0xc')](function(_0x3a7785){_0x5a844c({'id':_0xe56a84['id'],'phone':_0x3c540f[_0xeb0f('0x33')]});})['catch'](function(_0x4775d6){logger[_0xeb0f('0x11')](_0xeb0f('0x38'),_0x4775d6[_0xeb0f('0x14')]);_0x3d5da6({'error':_0x4775d6[_0xeb0f('0x14')]});});});}exports[_0xeb0f('0x39')]=function(_0x56af02){var _0x5ca23f=this;return new Promise(function(_0x4bea0d,_0x1ed26f){return db[_0xeb0f('0x17')][_0xeb0f('0x37')](_0x56af02[_0xeb0f('0x19')][_0xeb0f('0x3a')],{'where':{'id':_0x56af02[_0xeb0f('0x19')]['id']}})[_0xeb0f('0xc')](function(_0x1430f1){_0x4bea0d(_0x1430f1);})['catch'](function(_0x34f625){logger[_0xeb0f('0x11')](_0xeb0f('0x39'),_0x34f625['message']);_0x1ed26f(_0x5ca23f[_0xeb0f('0x11')](0x1f4,_0x34f625[_0xeb0f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index a8ad76e..e2cc10a 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 _0x8c11=['../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x50cd2b,_0xbd483e){var _0x2e4d84=function(_0x1e3f0f){while(--_0x1e3f0f){_0x50cd2b['push'](_0x50cd2b['shift']());}};_0x2e4d84(++_0xbd483e);}(_0x8c11,0xf5));var _0x18c1=function(_0x4339af,_0x29b500){_0x4339af=_0x4339af-0x0;var _0x3e9c12=_0x8c11[_0x4339af];return _0x3e9c12;};'use strict';var multer=require(_0x18c1('0x0'));var util=require(_0x18c1('0x1'));var path=require(_0x18c1('0x2'));var timeout=require(_0x18c1('0x3'));var express=require(_0x18c1('0x4'));var router=express[_0x18c1('0x5')]();var fs_extra=require(_0x18c1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x18c1('0x7'));var config=require(_0x18c1('0x8'));var controller=require(_0x18c1('0x9'));router[_0x18c1('0xa')]('/',auth[_0x18c1('0xb')](),controller[_0x18c1('0xc')]);router[_0x18c1('0xa')](_0x18c1('0xd'),auth['isAuthenticated'](),controller[_0x18c1('0xe')]);router[_0x18c1('0xf')]('/',auth['isAuthenticated'](),controller[_0x18c1('0x10')]);router[_0x18c1('0x11')](_0x18c1('0xd'),auth['isAuthenticated'](),controller[_0x18c1('0x12')]);router['delete']('/:id',auth[_0x18c1('0xb')](),controller[_0x18c1('0x13')]);module[_0x18c1('0x14')]=router; \ No newline at end of file +var _0xd5de=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','put','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5de,0x176));var _0xed5d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd5de[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0xed5d('0x0'));var util=require('util');var path=require(_0xed5d('0x1'));var timeout=require(_0xed5d('0x2'));var express=require(_0xed5d('0x3'));var router=express[_0xed5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed5d('0x5'));var interaction=require(_0xed5d('0x6'));var config=require(_0xed5d('0x7'));var controller=require(_0xed5d('0x8'));router['get']('/',auth[_0xed5d('0x9')](),controller[_0xed5d('0xa')]);router[_0xed5d('0xb')](_0xed5d('0xc'),auth[_0xed5d('0x9')](),controller['show']);router['post']('/',auth[_0xed5d('0x9')](),controller['create']);router[_0xed5d('0xd')](_0xed5d('0xc'),auth[_0xed5d('0x9')](),controller[_0xed5d('0xe')]);router['delete'](_0xed5d('0xc'),auth[_0xed5d('0x9')](),controller[_0xed5d('0xf')]);module[_0xed5d('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 17a3c53..c74bc5f 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 _0x4fe0=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x502e15,_0x49ff8f){var _0xadd0c4=function(_0xa1776){while(--_0xa1776){_0x502e15['push'](_0x502e15['shift']());}};_0xadd0c4(++_0x49ff8f);}(_0x4fe0,0x195));var _0x04fe=function(_0x511850,_0x4ab474){_0x511850=_0x511850-0x0;var _0x1eea4f=_0x4fe0[_0x511850];return _0x1eea4f;};'use strict';var moment=require('moment');var Sequelize=require(_0x04fe('0x0'));module[_0x04fe('0x1')]={'phone':{'type':Sequelize[_0x04fe('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x04fe('0x3')],'unique':_0x04fe('0x4')},'ListId':{'type':Sequelize[_0x04fe('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x04fe('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xd86a=['exports','contactListQueue','INTEGER','moment','sequelize'];(function(_0x4552ea,_0x5c6323){var _0x45499a=function(_0x174340){while(--_0x174340){_0x4552ea['push'](_0x4552ea['shift']());}};_0x45499a(++_0x5c6323);}(_0xd86a,0xf3));var _0xad86=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xd86a[_0x339129];return _0x1570df;};'use strict';var moment=require(_0xad86('0x0'));var Sequelize=require(_0xad86('0x1'));module[_0xad86('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xad86('0x3')},'ListId':{'type':Sequelize[_0xad86('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xad86('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 5e89486..c107645 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 _0xd072=['show','params','keys','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','offset','count','status','set','Content-Range','apply','save','then','destroy','stack','name','index','CmHopperBlack','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd072,0x9a));var _0x2d07=function(_0xe4354e,_0x2de609){_0xe4354e=_0xe4354e-0x0;var _0xddcb2a=_0xd072[_0xe4354e];return _0xddcb2a;};'use strict';var emlformat=require(_0x2d07('0x0'));var rimraf=require(_0x2d07('0x1'));var zipdir=require(_0x2d07('0x2'));var jsonpatch=require(_0x2d07('0x3'));var rp=require(_0x2d07('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d07('0x5'));var path=require(_0x2d07('0x6'));var sox=require('sox');var csv=require(_0x2d07('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d07('0x8'));var _=require(_0x2d07('0x9'));var squel=require(_0x2d07('0xa'));var crypto=require(_0x2d07('0xb'));var jsforce=require(_0x2d07('0xc'));var deskjs=require(_0x2d07('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2d07('0xe'));var Papa=require('papaparse');var Redis=require(_0x2d07('0xf'));var authService=require(_0x2d07('0x10'));var qs=require(_0x2d07('0x11'));var as=require(_0x2d07('0x12'));var hardwareService=require(_0x2d07('0x13'));var logger=require(_0x2d07('0x14'))(_0x2d07('0x15'));var utils=require(_0x2d07('0x16'));var config=require(_0x2d07('0x17'));var licenseUtil=require(_0x2d07('0x18'));var db=require(_0x2d07('0x19'))['db'];function respondWithStatusCode(_0x4e5204,_0x11ee90){_0x11ee90=_0x11ee90||0xcc;return function(_0x230fcd){if(_0x230fcd){return _0x4e5204[_0x2d07('0x1a')](_0x11ee90);}return _0x4e5204['status'](_0x11ee90)['end']();};}function respondWithResult(_0x13d479,_0xf21aec){_0xf21aec=_0xf21aec||0xc8;return function(_0x3ab583){if(_0x3ab583){return _0x13d479['status'](_0xf21aec)['json'](_0x3ab583);}};}function respondWithFilteredResult(_0x211cc5,_0x44462a){return function(_0x230345){if(_0x230345){var _0x2ff22f=typeof _0x44462a['offset']===_0x2d07('0x1b')&&typeof _0x44462a[_0x2d07('0x1c')]==='undefined';var _0x598878=_0x230345['count'];var _0x1097b7=_0x2ff22f?0x0:_0x44462a[_0x2d07('0x1d')];var _0x5d0305=_0x2ff22f?_0x230345[_0x2d07('0x1e')]:_0x44462a[_0x2d07('0x1d')]+_0x44462a[_0x2d07('0x1c')];var _0x13e059;if(_0x5d0305>=_0x598878){_0x5d0305=_0x598878;_0x13e059=0xc8;}else{_0x13e059=0xce;}_0x211cc5[_0x2d07('0x1f')](_0x13e059);return _0x211cc5[_0x2d07('0x20')](_0x2d07('0x21'),_0x1097b7+'-'+_0x5d0305+'/'+_0x598878)['json'](_0x230345);}return null;};}function patchUpdates(_0x4414cc){return function(_0x1012f8){try{jsonpatch[_0x2d07('0x22')](_0x1012f8,_0x4414cc,!![]);}catch(_0x4d9ad2){return BPromise['reject'](_0x4d9ad2);}return _0x1012f8[_0x2d07('0x23')]();};}function saveUpdates(_0xce80d7,_0x4a276b){return function(_0x384216){if(_0x384216){return _0x384216['update'](_0xce80d7)[_0x2d07('0x24')](function(_0x2a52c9){return _0x2a52c9;});}return null;};}function removeEntity(_0x581dd7,_0x319f52){return function(_0xba1fd4){if(_0xba1fd4){return _0xba1fd4[_0x2d07('0x25')]()[_0x2d07('0x24')](function(){_0x581dd7[_0x2d07('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3225a9,_0x2ecf1b){return function(_0x366fcc){if(!_0x366fcc){_0x3225a9[_0x2d07('0x1a')](0x194);}return _0x366fcc;};}function handleError(_0x15ff7d,_0x127095){_0x127095=_0x127095||0x1f4;return function(_0x41acd0){logger['error'](_0x41acd0[_0x2d07('0x26')]);if(_0x41acd0[_0x2d07('0x27')]){delete _0x41acd0['name'];}_0x15ff7d[_0x2d07('0x1f')](_0x127095)['send'](_0x41acd0);};}exports[_0x2d07('0x28')]=function(_0x5488a6,_0x487732){var _0x2993a7={},_0x579110={},_0x39a688={'count':0x0,'rows':[]};var _0x5580ab=_['map'](db[_0x2d07('0x29')][_0x2d07('0x2a')],function(_0x46f706){return{'name':_0x46f706[_0x2d07('0x2b')],'type':_0x46f706['type'][_0x2d07('0x2c')]};});_0x579110[_0x2d07('0x2d')]=_['map'](_0x5580ab,_0x2d07('0x27'));_0x579110['query']=_['keys'](_0x5488a6[_0x2d07('0x2e')]);_0x579110[_0x2d07('0x2f')]=_[_0x2d07('0x30')](_0x579110[_0x2d07('0x2d')],_0x579110[_0x2d07('0x2e')]);_0x2993a7[_0x2d07('0x31')]=_[_0x2d07('0x30')](_0x579110[_0x2d07('0x2d')],qs[_0x2d07('0x32')](_0x5488a6[_0x2d07('0x2e')][_0x2d07('0x32')]));_0x2993a7[_0x2d07('0x31')]=_0x2993a7[_0x2d07('0x31')][_0x2d07('0x33')]?_0x2993a7[_0x2d07('0x31')]:_0x579110[_0x2d07('0x2d')];if(!_0x5488a6[_0x2d07('0x2e')][_0x2d07('0x34')](_0x2d07('0x35'))){_0x2993a7[_0x2d07('0x1c')]=qs['limit'](_0x5488a6[_0x2d07('0x2e')]['limit']);_0x2993a7[_0x2d07('0x1d')]=qs[_0x2d07('0x1d')](_0x5488a6['query'][_0x2d07('0x1d')]);}_0x2993a7[_0x2d07('0x36')]=qs[_0x2d07('0x37')](_0x5488a6[_0x2d07('0x2e')][_0x2d07('0x37')]);_0x2993a7[_0x2d07('0x38')]=qs[_0x2d07('0x2f')](_[_0x2d07('0x39')](_0x5488a6[_0x2d07('0x2e')],_0x579110['filters']),_0x5580ab);if(_0x5488a6['query'][_0x2d07('0x3a')]){_0x2993a7[_0x2d07('0x38')]=_[_0x2d07('0x3b')](_0x2993a7[_0x2d07('0x38')],{'$or':_[_0x2d07('0x3c')](_0x5580ab,function(_0x155245){if(_0x155245[_0x2d07('0x3d')]!==_0x2d07('0x3e')){var _0x415240={};_0x415240[_0x155245[_0x2d07('0x27')]]={'$like':'%'+_0x5488a6[_0x2d07('0x2e')][_0x2d07('0x3a')]+'%'};return _0x415240;}})});}_0x2993a7=_[_0x2d07('0x3b')]({},_0x2993a7,_0x5488a6[_0x2d07('0x3f')]);var _0x4710fb={'where':_0x2993a7[_0x2d07('0x38')]};return db[_0x2d07('0x29')]['count'](_0x4710fb)[_0x2d07('0x24')](function(_0x55881e){_0x39a688[_0x2d07('0x1e')]=_0x55881e;if(_0x5488a6[_0x2d07('0x2e')][_0x2d07('0x40')]){_0x2993a7[_0x2d07('0x41')]=[{'all':!![]}];}return db[_0x2d07('0x29')][_0x2d07('0x42')](_0x2993a7);})[_0x2d07('0x24')](function(_0x5bc965){_0x39a688['rows']=_0x5bc965;return _0x39a688;})[_0x2d07('0x24')](respondWithFilteredResult(_0x487732,_0x2993a7))[_0x2d07('0x43')](handleError(_0x487732,null));};exports[_0x2d07('0x44')]=function(_0xd926ef,_0x380543){var _0x5922ab={'raw':!![],'where':{'id':_0xd926ef[_0x2d07('0x45')]['id']}},_0x399593={};_0x399593[_0x2d07('0x2d')]=_[_0x2d07('0x46')](db[_0x2d07('0x29')][_0x2d07('0x2a')]);_0x399593['query']=_[_0x2d07('0x46')](_0xd926ef['query']);_0x399593[_0x2d07('0x2f')]=_[_0x2d07('0x30')](_0x399593[_0x2d07('0x2d')],_0x399593['query']);_0x5922ab['attributes']=_[_0x2d07('0x30')](_0x399593['model'],qs[_0x2d07('0x32')](_0xd926ef['query'][_0x2d07('0x32')]));_0x5922ab[_0x2d07('0x31')]=_0x5922ab[_0x2d07('0x31')]['length']?_0x5922ab[_0x2d07('0x31')]:_0x399593[_0x2d07('0x2d')];if(_0xd926ef[_0x2d07('0x2e')]['includeAll']){_0x5922ab[_0x2d07('0x41')]=[{'all':!![]}];}_0x5922ab=_[_0x2d07('0x3b')]({},_0x5922ab,_0xd926ef['options']);return db[_0x2d07('0x29')]['find'](_0x5922ab)['then'](handleEntityNotFound(_0x380543,null))[_0x2d07('0x24')](respondWithResult(_0x380543,null))[_0x2d07('0x43')](handleError(_0x380543,null));};exports['update']=function(_0x9e25a4,_0x5333ae){if(_0x9e25a4['body']['id']){delete _0x9e25a4[_0x2d07('0x47')]['id'];}return db['CmHopperBlack'][_0x2d07('0x48')]({'where':{'id':_0x9e25a4['params']['id']}})[_0x2d07('0x24')](handleEntityNotFound(_0x5333ae,null))['then'](saveUpdates(_0x9e25a4[_0x2d07('0x47')],null))[_0x2d07('0x24')](respondWithResult(_0x5333ae,null))[_0x2d07('0x43')](handleError(_0x5333ae,null));};exports['destroy']=function(_0x34aaac,_0xf617bf){return db['CmHopperBlack'][_0x2d07('0x48')]({'where':{'id':_0x34aaac['params']['id']}})[_0x2d07('0x24')](handleEntityNotFound(_0xf617bf,null))[_0x2d07('0x24')](removeEntity(_0xf617bf,null))[_0x2d07('0x43')](handleError(_0xf617bf,null));};exports['describe']=function(_0x50fc44,_0x45dcbf){return db[_0x2d07('0x29')][_0x2d07('0x49')]()[_0x2d07('0x24')](respondWithResult(_0x45dcbf,null))['catch'](handleError(_0x45dcbf,null));}; \ No newline at end of file +var _0xf3dc=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3dc,0x1a5));var _0xcf3d=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0xf3dc[_0x1e2671];return _0x492489;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf3d('0x0'));var jsonpatch=require(_0xcf3d('0x1'));var rp=require(_0xcf3d('0x2'));var moment=require(_0xcf3d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcf3d('0x4'));var sox=require(_0xcf3d('0x5'));var csv=require(_0xcf3d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf3d('0x7'));var _=require(_0xcf3d('0x8'));var squel=require(_0xcf3d('0x9'));var crypto=require(_0xcf3d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf3d('0x6'));var querystring=require(_0xcf3d('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcf3d('0xc'));var qs=require(_0xcf3d('0xd'));var as=require(_0xcf3d('0xe'));var hardwareService=require(_0xcf3d('0xf'));var logger=require(_0xcf3d('0x10'))(_0xcf3d('0x11'));var utils=require(_0xcf3d('0x12'));var config=require(_0xcf3d('0x13'));var licenseUtil=require(_0xcf3d('0x14'));var db=require(_0xcf3d('0x15'))['db'];function respondWithStatusCode(_0x35ef3f,_0x2986a6){_0x2986a6=_0x2986a6||0xcc;return function(_0x21973d){if(_0x21973d){return _0x35ef3f[_0xcf3d('0x16')](_0x2986a6);}return _0x35ef3f['status'](_0x2986a6)[_0xcf3d('0x17')]();};}function respondWithResult(_0x521e2c,_0x4d5795){_0x4d5795=_0x4d5795||0xc8;return function(_0x39eaee){if(_0x39eaee){return _0x521e2c[_0xcf3d('0x18')](_0x4d5795)['json'](_0x39eaee);}};}function respondWithFilteredResult(_0x172268,_0x755730){return function(_0x331fc1){if(_0x331fc1){var _0x102483=typeof _0x755730[_0xcf3d('0x19')]===_0xcf3d('0x1a')&&typeof _0x755730[_0xcf3d('0x1b')]==='undefined';var _0x43f567=_0x331fc1[_0xcf3d('0x1c')];var _0x523f44=_0x102483?0x0:_0x755730[_0xcf3d('0x19')];var _0x3a4f9f=_0x102483?_0x331fc1[_0xcf3d('0x1c')]:_0x755730['offset']+_0x755730['limit'];var _0x5b49df;if(_0x3a4f9f>=_0x43f567){_0x3a4f9f=_0x43f567;_0x5b49df=0xc8;}else{_0x5b49df=0xce;}_0x172268[_0xcf3d('0x18')](_0x5b49df);return _0x172268[_0xcf3d('0x1d')]('Content-Range',_0x523f44+'-'+_0x3a4f9f+'/'+_0x43f567)[_0xcf3d('0x1e')](_0x331fc1);}return null;};}function patchUpdates(_0x1b7d58){return function(_0x191f86){try{jsonpatch[_0xcf3d('0x1f')](_0x191f86,_0x1b7d58,!![]);}catch(_0x555f4a){return BPromise[_0xcf3d('0x20')](_0x555f4a);}return _0x191f86[_0xcf3d('0x21')]();};}function saveUpdates(_0x4c936b,_0x9f492e){return function(_0x254e2e){if(_0x254e2e){return _0x254e2e[_0xcf3d('0x22')](_0x4c936b)[_0xcf3d('0x23')](function(_0x3136c6){return _0x3136c6;});}return null;};}function removeEntity(_0x175ae6,_0x39fc91){return function(_0x425388){if(_0x425388){return _0x425388[_0xcf3d('0x24')]()[_0xcf3d('0x23')](function(){_0x175ae6[_0xcf3d('0x18')](0xcc)[_0xcf3d('0x17')]();});}};}function handleEntityNotFound(_0x185865,_0x58dae4){return function(_0x3af7fe){if(!_0x3af7fe){_0x185865[_0xcf3d('0x16')](0x194);}return _0x3af7fe;};}function handleError(_0x41dacf,_0x1adafc){_0x1adafc=_0x1adafc||0x1f4;return function(_0x30e3c4){logger[_0xcf3d('0x25')](_0x30e3c4[_0xcf3d('0x26')]);if(_0x30e3c4['name']){delete _0x30e3c4[_0xcf3d('0x27')];}_0x41dacf[_0xcf3d('0x18')](_0x1adafc)[_0xcf3d('0x28')](_0x30e3c4);};}exports[_0xcf3d('0x29')]=function(_0x54dd26,_0x13ee10){var _0x181dc9={},_0xb3b55f={},_0x1ab3c7={'count':0x0,'rows':[]};var _0x2ec466=_[_0xcf3d('0x2a')](db[_0xcf3d('0x2b')][_0xcf3d('0x2c')],function(_0x2e3028){return{'name':_0x2e3028[_0xcf3d('0x2d')],'type':_0x2e3028[_0xcf3d('0x2e')][_0xcf3d('0x2f')]};});_0xb3b55f[_0xcf3d('0x30')]=_[_0xcf3d('0x2a')](_0x2ec466,_0xcf3d('0x27'));_0xb3b55f[_0xcf3d('0x31')]=_[_0xcf3d('0x32')](_0x54dd26[_0xcf3d('0x31')]);_0xb3b55f[_0xcf3d('0x33')]=_['intersection'](_0xb3b55f[_0xcf3d('0x30')],_0xb3b55f[_0xcf3d('0x31')]);_0x181dc9[_0xcf3d('0x34')]=_[_0xcf3d('0x35')](_0xb3b55f[_0xcf3d('0x30')],qs['fields'](_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x36')]));_0x181dc9[_0xcf3d('0x34')]=_0x181dc9['attributes']['length']?_0x181dc9[_0xcf3d('0x34')]:_0xb3b55f['model'];if(!_0x54dd26['query'][_0xcf3d('0x37')](_0xcf3d('0x38'))){_0x181dc9[_0xcf3d('0x1b')]=qs[_0xcf3d('0x1b')](_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x1b')]);_0x181dc9['offset']=qs[_0xcf3d('0x19')](_0x54dd26[_0xcf3d('0x31')]['offset']);}_0x181dc9[_0xcf3d('0x39')]=qs[_0xcf3d('0x3a')](_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x3a')]);_0x181dc9['where']=qs['filters'](_[_0xcf3d('0x3b')](_0x54dd26['query'],_0xb3b55f[_0xcf3d('0x33')]),_0x2ec466);if(_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x3c')]){_0x181dc9['where']=_[_0xcf3d('0x3d')](_0x181dc9[_0xcf3d('0x3e')],{'$or':_[_0xcf3d('0x2a')](_0x2ec466,function(_0x4a4551){if(_0x4a4551[_0xcf3d('0x2e')]!==_0xcf3d('0x3f')){var _0x37cc9f={};_0x37cc9f[_0x4a4551[_0xcf3d('0x27')]]={'$like':'%'+_0x54dd26[_0xcf3d('0x31')]['filter']+'%'};return _0x37cc9f;}})});}_0x181dc9=_[_0xcf3d('0x3d')]({},_0x181dc9,_0x54dd26[_0xcf3d('0x40')]);var _0x564af9={'where':_0x181dc9[_0xcf3d('0x3e')]};return db[_0xcf3d('0x2b')][_0xcf3d('0x1c')](_0x564af9)[_0xcf3d('0x23')](function(_0x4319a5){_0x1ab3c7[_0xcf3d('0x1c')]=_0x4319a5;if(_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x41')]){_0x181dc9[_0xcf3d('0x42')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x181dc9);})[_0xcf3d('0x23')](function(_0x1150ca){_0x1ab3c7[_0xcf3d('0x43')]=_0x1150ca;return _0x1ab3c7;})[_0xcf3d('0x23')](respondWithFilteredResult(_0x13ee10,_0x181dc9))['catch'](handleError(_0x13ee10,null));};exports[_0xcf3d('0x44')]=function(_0x34bc7,_0x9ca4f0){var _0x306408={'raw':!![],'where':{'id':_0x34bc7[_0xcf3d('0x45')]['id']}},_0x4e7946={};_0x4e7946[_0xcf3d('0x30')]=_['keys'](db['CmHopperBlack'][_0xcf3d('0x2c')]);_0x4e7946[_0xcf3d('0x31')]=_[_0xcf3d('0x32')](_0x34bc7[_0xcf3d('0x31')]);_0x4e7946['filters']=_[_0xcf3d('0x35')](_0x4e7946[_0xcf3d('0x30')],_0x4e7946[_0xcf3d('0x31')]);_0x306408[_0xcf3d('0x34')]=_['intersection'](_0x4e7946[_0xcf3d('0x30')],qs[_0xcf3d('0x36')](_0x34bc7[_0xcf3d('0x31')]['fields']));_0x306408[_0xcf3d('0x34')]=_0x306408['attributes'][_0xcf3d('0x46')]?_0x306408['attributes']:_0x4e7946[_0xcf3d('0x30')];if(_0x34bc7[_0xcf3d('0x31')]['includeAll']){_0x306408[_0xcf3d('0x42')]=[{'all':!![]}];}_0x306408=_['merge']({},_0x306408,_0x34bc7[_0xcf3d('0x40')]);return db[_0xcf3d('0x2b')]['find'](_0x306408)[_0xcf3d('0x23')](handleEntityNotFound(_0x9ca4f0,null))[_0xcf3d('0x23')](respondWithResult(_0x9ca4f0,null))[_0xcf3d('0x47')](handleError(_0x9ca4f0,null));};exports[_0xcf3d('0x22')]=function(_0x94d374,_0x53c2c2){if(_0x94d374[_0xcf3d('0x48')]['id']){delete _0x94d374[_0xcf3d('0x48')]['id'];}return db[_0xcf3d('0x2b')]['find']({'where':{'id':_0x94d374[_0xcf3d('0x45')]['id']}})[_0xcf3d('0x23')](handleEntityNotFound(_0x53c2c2,null))[_0xcf3d('0x23')](saveUpdates(_0x94d374[_0xcf3d('0x48')],null))[_0xcf3d('0x23')](respondWithResult(_0x53c2c2,null))[_0xcf3d('0x47')](handleError(_0x53c2c2,null));};exports[_0xcf3d('0x24')]=function(_0x2b2d05,_0x57010b){return db['CmHopperBlack'][_0xcf3d('0x49')]({'where':{'id':_0x2b2d05[_0xcf3d('0x45')]['id']}})[_0xcf3d('0x23')](handleEntityNotFound(_0x57010b,null))[_0xcf3d('0x23')](removeEntity(_0x57010b,null))[_0xcf3d('0x47')](handleError(_0x57010b,null));};exports[_0xcf3d('0x4a')]=function(_0x5bab28,_0x80c089){return db[_0xcf3d('0x2b')][_0xcf3d('0x4a')]()['then'](respondWithResult(_0x80c089,null))['catch'](handleError(_0x80c089,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index f5bc5bf..ac2af71 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 _0x369f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black'];(function(_0x2b0ab6,_0x545877){var _0x15e701=function(_0x1c5d47){while(--_0x1c5d47){_0x2b0ab6['push'](_0x2b0ab6['shift']());}};_0x15e701(++_0x545877);}(_0x369f,0x111));var _0xf369=function(_0x1fc234,_0x146715){_0x1fc234=_0x1fc234-0x0;var _0x5061c3=_0x369f[_0x1fc234];return _0x5061c3;};'use strict';var _=require('lodash');var util=require(_0xf369('0x0'));var logger=require(_0xf369('0x1'))(_0xf369('0x2'));var moment=require(_0xf369('0x3'));var BPromise=require('bluebird');var rp=require(_0xf369('0x4'));var fs=require('fs');var path=require(_0xf369('0x5'));var rimraf=require(_0xf369('0x6'));var config=require(_0xf369('0x7'));var attributes=require(_0xf369('0x8'));module[_0xf369('0x9')]=function(_0x31f3c5,_0xf3163){return _0x31f3c5[_0xf369('0xa')](_0xf369('0xb'),attributes,{'tableName':_0xf369('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dad=['cm_hopper_black','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x5cd1c9,_0x5127b3){var _0x5b6728=function(_0x5d0797){while(--_0x5d0797){_0x5cd1c9['push'](_0x5cd1c9['shift']());}};_0x5b6728(++_0x5127b3);}(_0x5dad,0x105));var _0xd5da=function(_0x385432,_0x3ff55a){_0x385432=_0x385432-0x0;var _0x509b08=_0x5dad[_0x385432];return _0x509b08;};'use strict';var _=require('lodash');var util=require(_0xd5da('0x0'));var logger=require('../../config/logger')(_0xd5da('0x1'));var moment=require(_0xd5da('0x2'));var BPromise=require(_0xd5da('0x3'));var rp=require(_0xd5da('0x4'));var fs=require('fs');var path=require(_0xd5da('0x5'));var rimraf=require(_0xd5da('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0xd5da('0x7')]=function(_0x5912ce,_0x3c2fbd){return _0x5912ce[_0xd5da('0x8')]('CmHopperBlack',attributes,{'tableName':_0xd5da('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 41b2a51..86e266c 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 _0x7cba=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','include','map','GetCmHopperBlack','debug','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7cba,0x92));var _0xa7cb=function(_0x125990,_0x56fa85){_0x125990=_0x125990-0x0;var _0x46b4ec=_0x7cba[_0x125990];return _0x46b4ec;};'use strict';var _=require(_0xa7cb('0x0'));var util=require('util');var moment=require(_0xa7cb('0x1'));var BPromise=require(_0xa7cb('0x2'));var rs=require(_0xa7cb('0x3'));var fs=require('fs');var Redis=require(_0xa7cb('0x4'));var db=require(_0xa7cb('0x5'))['db'];var utils=require(_0xa7cb('0x6'));var logger=require(_0xa7cb('0x7'))('rpc');var config=require(_0xa7cb('0x8'));var jayson=require(_0xa7cb('0x9'));var client=jayson[_0xa7cb('0xa')][_0xa7cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45183a,_0x1bbc14,_0x524a8d){return new BPromise(function(_0x2914a8,_0x22b35b){return client[_0xa7cb('0xc')](_0x45183a,_0x524a8d)[_0xa7cb('0xd')](function(_0x39cc29){logger[_0xa7cb('0xe')](_0xa7cb('0xf'),_0x1bbc14,_0xa7cb('0x10'));logger['debug'](_0xa7cb('0x11'),_0x1bbc14,_0xa7cb('0x10'),JSON[_0xa7cb('0x12')](_0x39cc29));if(_0x39cc29[_0xa7cb('0x13')]){if(_0x39cc29['error'][_0xa7cb('0x14')]===0x1f4){logger[_0xa7cb('0x13')](_0xa7cb('0xf'),_0x1bbc14,_0x39cc29[_0xa7cb('0x13')][_0xa7cb('0x15')]);return _0x22b35b(_0x39cc29[_0xa7cb('0x13')][_0xa7cb('0x15')]);}logger['error'](_0xa7cb('0xf'),_0x1bbc14,_0x39cc29['error'][_0xa7cb('0x15')]);return _0x2914a8(_0x39cc29['error'][_0xa7cb('0x15')]);}else{logger[_0xa7cb('0xe')](_0xa7cb('0xf'),_0x1bbc14,_0xa7cb('0x10'));_0x2914a8(_0x39cc29[_0xa7cb('0x16')][_0xa7cb('0x15')]);}})[_0xa7cb('0x17')](function(_0x52f6da){logger['error'](_0xa7cb('0xf'),_0x1bbc14,_0x52f6da);_0x22b35b(_0x52f6da);});});}exports['GetCmHopperBlack']=function(_0x43f4f7){var _0x39ec88=this;return new Promise(function(_0x21cd6a,_0x4902f5){return db['CmHopperBlack']['findAll']({'raw':_0x43f4f7[_0xa7cb('0x18')]?_0x43f4f7[_0xa7cb('0x18')][_0xa7cb('0x19')]===undefined?!![]:![]:!![],'where':_0x43f4f7[_0xa7cb('0x18')]?_0x43f4f7[_0xa7cb('0x18')][_0xa7cb('0x1a')]||null:null,'attributes':_0x43f4f7[_0xa7cb('0x18')]?_0x43f4f7['options'][_0xa7cb('0x1b')]||null:null,'limit':_0x43f4f7['options']?_0x43f4f7[_0xa7cb('0x18')]['limit']||null:null,'include':_0x43f4f7[_0xa7cb('0x18')]?_0x43f4f7[_0xa7cb('0x18')][_0xa7cb('0x1c')]?_[_0xa7cb('0x1d')](_0x43f4f7[_0xa7cb('0x18')][_0xa7cb('0x1c')],function(_0x1d432f){return{'model':db[_0x1d432f['model']],'as':_0x1d432f['as'],'attributes':_0x1d432f[_0xa7cb('0x1b')],'include':_0x1d432f[_0xa7cb('0x1c')]?_[_0xa7cb('0x1d')](_0x1d432f[_0xa7cb('0x1c')],function(_0xf895a7){return{'model':db[_0xf895a7['model']],'as':_0xf895a7['as'],'attributes':_0xf895a7[_0xa7cb('0x1b')],'include':_0xf895a7[_0xa7cb('0x1c')]?_[_0xa7cb('0x1d')](_0xf895a7[_0xa7cb('0x1c')],function(_0x5975c0){return{'model':db[_0x5975c0['model']],'as':_0x5975c0['as'],'attributes':_0x5975c0[_0xa7cb('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bfacc){logger['info'](_0xa7cb('0x1e'),_0x43f4f7);logger[_0xa7cb('0x1f')]('GetCmHopperBlack',_0x43f4f7,JSON[_0xa7cb('0x12')](_0x5bfacc));_0x21cd6a(_0x5bfacc);})['catch'](function(_0x4130d8){logger[_0xa7cb('0x13')]('GetCmHopperBlack',_0x4130d8[_0xa7cb('0x15')],_0x43f4f7);_0x4902f5(_0x39ec88[_0xa7cb('0x13')](0x1f4,_0x4130d8['message']));});});};exports[_0xa7cb('0x20')]=function(_0x4dc43c){var _0x42198d=this;return new Promise(function(_0x453154,_0x3d6297){return db[_0xa7cb('0x21')]['update'](_0x4dc43c[_0xa7cb('0x22')],{'raw':_0x4dc43c[_0xa7cb('0x18')]?_0x4dc43c[_0xa7cb('0x18')][_0xa7cb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dc43c[_0xa7cb('0x18')]?_0x4dc43c[_0xa7cb('0x18')][_0xa7cb('0x1a')]||null:null,'attributes':_0x4dc43c[_0xa7cb('0x18')]?_0x4dc43c[_0xa7cb('0x18')][_0xa7cb('0x1b')]||null:null,'limit':_0x4dc43c[_0xa7cb('0x18')]?_0x4dc43c[_0xa7cb('0x18')]['limit']||null:null})[_0xa7cb('0xd')](function(_0x1d8fa2){logger[_0xa7cb('0xe')](_0xa7cb('0x20'),_0x4dc43c);logger[_0xa7cb('0x1f')](_0xa7cb('0x20'),_0x4dc43c,JSON[_0xa7cb('0x12')](_0x1d8fa2));_0x453154(_0x1d8fa2);})[_0xa7cb('0x17')](function(_0x3d93ca){logger['error'](_0xa7cb('0x20'),_0x3d93ca[_0xa7cb('0x15')],_0x4dc43c);_0x3d6297(_0x42198d[_0xa7cb('0x13')](0x1f4,_0x3d93ca[_0xa7cb('0x15')]));});});};exports[_0xa7cb('0x23')]=function(_0x1202bb){var _0x2a2f19=this;return new Promise(function(_0x527c9f,_0x4d868d){return db[_0xa7cb('0x21')][_0xa7cb('0x24')]({'where':_0x1202bb[_0xa7cb('0x18')]?_0x1202bb['options']['where']||null:null})['then'](function(_0x35bf44){logger[_0xa7cb('0xe')](_0xa7cb('0x23'),_0x1202bb);logger[_0xa7cb('0x1f')](_0xa7cb('0x23'),_0x1202bb,JSON[_0xa7cb('0x12')](_0x35bf44));_0x527c9f(_0x35bf44);})['catch'](function(_0x286e27){logger[_0xa7cb('0x13')]('DestroyCmHopperBlack',_0x286e27['message'],_0x1202bb);_0x4d868d(_0x2a2f19['error'](0x1f4,_0x286e27[_0xa7cb('0x15')]));});});}; \ No newline at end of file +var _0x1844=['UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','stringify'];(function(_0x29b37f,_0x50117a){var _0x3025eb=function(_0x50b857){while(--_0x50b857){_0x29b37f['push'](_0x29b37f['shift']());}};_0x3025eb(++_0x50117a);}(_0x1844,0x1da));var _0x4184=function(_0x3acf41,_0x12370b){_0x3acf41=_0x3acf41-0x0;var _0x4a72f1=_0x1844[_0x3acf41];return _0x4a72f1;};'use strict';var _=require(_0x4184('0x0'));var util=require('util');var moment=require(_0x4184('0x1'));var BPromise=require(_0x4184('0x2'));var rs=require(_0x4184('0x3'));var fs=require('fs');var Redis=require(_0x4184('0x4'));var db=require(_0x4184('0x5'))['db'];var utils=require(_0x4184('0x6'));var logger=require(_0x4184('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4184('0x8'));var client=jayson[_0x4184('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279832,_0x37e57f,_0xc8d2d8){return new BPromise(function(_0x1be8bd,_0x29b779){return client[_0x4184('0xa')](_0x279832,_0xc8d2d8)[_0x4184('0xb')](function(_0x153027){logger[_0x4184('0xc')](_0x4184('0xd'),_0x37e57f,'request\x20sent');logger[_0x4184('0xe')](_0x4184('0xf'),_0x37e57f,_0x4184('0x10'),JSON['stringify'](_0x153027));if(_0x153027[_0x4184('0x11')]){if(_0x153027[_0x4184('0x11')][_0x4184('0x12')]===0x1f4){logger[_0x4184('0x11')](_0x4184('0xd'),_0x37e57f,_0x153027[_0x4184('0x11')][_0x4184('0x13')]);return _0x29b779(_0x153027['error'][_0x4184('0x13')]);}logger[_0x4184('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x37e57f,_0x153027[_0x4184('0x11')]['message']);return _0x1be8bd(_0x153027[_0x4184('0x11')]['message']);}else{logger['info'](_0x4184('0xd'),_0x37e57f,'request\x20sent');_0x1be8bd(_0x153027[_0x4184('0x14')][_0x4184('0x13')]);}})[_0x4184('0x15')](function(_0x51a597){logger[_0x4184('0x11')](_0x4184('0xd'),_0x37e57f,_0x51a597);_0x29b779(_0x51a597);});});}exports[_0x4184('0x16')]=function(_0x1d9d06){var _0x1951ca=this;return new Promise(function(_0x5cafeb,_0x3d4ea1){return db['CmHopperBlack'][_0x4184('0x17')]({'raw':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06[_0x4184('0x18')][_0x4184('0x19')]===undefined?!![]:![]:!![],'where':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06['options'][_0x4184('0x1a')]||null:null,'attributes':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06[_0x4184('0x18')][_0x4184('0x1b')]||null:null,'limit':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06['options'][_0x4184('0x1c')]||null:null,'include':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06[_0x4184('0x18')][_0x4184('0x1d')]?_[_0x4184('0x1e')](_0x1d9d06['options'][_0x4184('0x1d')],function(_0x3021ae){return{'model':db[_0x3021ae[_0x4184('0x1f')]],'as':_0x3021ae['as'],'attributes':_0x3021ae['attributes'],'include':_0x3021ae[_0x4184('0x1d')]?_[_0x4184('0x1e')](_0x3021ae[_0x4184('0x1d')],function(_0x4ee1ab){return{'model':db[_0x4ee1ab['model']],'as':_0x4ee1ab['as'],'attributes':_0x4ee1ab[_0x4184('0x1b')],'include':_0x4ee1ab[_0x4184('0x1d')]?_[_0x4184('0x1e')](_0x4ee1ab[_0x4184('0x1d')],function(_0x20fd2b){return{'model':db[_0x20fd2b[_0x4184('0x1f')]],'as':_0x20fd2b['as'],'attributes':_0x20fd2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4184('0xb')](function(_0x7766c1){logger[_0x4184('0xc')](_0x4184('0x16'),_0x1d9d06);logger[_0x4184('0xe')](_0x4184('0x16'),_0x1d9d06,JSON[_0x4184('0x20')](_0x7766c1));_0x5cafeb(_0x7766c1);})['catch'](function(_0x1e2677){logger[_0x4184('0x11')](_0x4184('0x16'),_0x1e2677[_0x4184('0x13')],_0x1d9d06);_0x3d4ea1(_0x1951ca['error'](0x1f4,_0x1e2677[_0x4184('0x13')]));});});};exports[_0x4184('0x21')]=function(_0x57b801){var _0x5bc092=this;return new Promise(function(_0x2057df,_0xe4749a){return db[_0x4184('0x22')][_0x4184('0x23')](_0x57b801[_0x4184('0x24')],{'raw':_0x57b801[_0x4184('0x18')]?_0x57b801[_0x4184('0x18')][_0x4184('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b801['options']?_0x57b801[_0x4184('0x18')]['where']||null:null,'attributes':_0x57b801[_0x4184('0x18')]?_0x57b801[_0x4184('0x18')][_0x4184('0x1b')]||null:null,'limit':_0x57b801[_0x4184('0x18')]?_0x57b801[_0x4184('0x18')][_0x4184('0x1c')]||null:null})[_0x4184('0xb')](function(_0x2b1a0a){logger[_0x4184('0xc')](_0x4184('0x21'),_0x57b801);logger[_0x4184('0xe')](_0x4184('0x21'),_0x57b801,JSON['stringify'](_0x2b1a0a));_0x2057df(_0x2b1a0a);})[_0x4184('0x15')](function(_0x11f9d2){logger[_0x4184('0x11')]('UpdateCmHopperBlack',_0x11f9d2[_0x4184('0x13')],_0x57b801);_0xe4749a(_0x5bc092[_0x4184('0x11')](0x1f4,_0x11f9d2['message']));});});};exports[_0x4184('0x25')]=function(_0x4eccbb){var _0x58a754=this;return new Promise(function(_0x294e12,_0x28048e){return db[_0x4184('0x22')][_0x4184('0x26')]({'where':_0x4eccbb[_0x4184('0x18')]?_0x4eccbb[_0x4184('0x18')][_0x4184('0x1a')]||null:null})['then'](function(_0x20d2d6){logger[_0x4184('0xc')](_0x4184('0x25'),_0x4eccbb);logger['debug']('DestroyCmHopperBlack',_0x4eccbb,JSON['stringify'](_0x20d2d6));_0x294e12(_0x20d2d6);})[_0x4184('0x15')](function(_0x4af8ae){logger['error']('DestroyCmHopperBlack',_0x4af8ae['message'],_0x4eccbb);_0x28048e(_0x58a754['error'](0x1f4,_0x4af8ae['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8dfdc0e..938ba1e 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 _0x2eb2=['/describe','describe','/:id','show','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0xd519a5,_0x5407cb){var _0x5e42c3=function(_0xff5140){while(--_0xff5140){_0xd519a5['push'](_0xd519a5['shift']());}};_0x5e42c3(++_0x5407cb);}(_0x2eb2,0x19f));var _0x22eb=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x2eb2[_0xea8947];return _0x2455e9;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x22eb('0x7')]('/',auth[_0x22eb('0x8')](),controller[_0x22eb('0x9')]);router[_0x22eb('0x7')](_0x22eb('0xa'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x7')](_0x22eb('0xc'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')]('/:id',auth[_0x22eb('0x8')](),controller['update']);router['delete'](_0x22eb('0xc'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);module[_0x22eb('0x10')]=router; \ No newline at end of file +var _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0xb49cb8,_0x39474b){var _0x879ead=function(_0x596639){while(--_0x596639){_0xb49cb8['push'](_0xb49cb8['shift']());}};_0x879ead(++_0x39474b);}(_0x4fb4,0x190));var _0x44fb=function(_0x3e71d5,_0xd5fcd2){_0x3e71d5=_0x3e71d5-0x0;var _0x92f22a=_0x4fb4[_0x3e71d5];return _0x92f22a;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);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 afe1160..46b02c5 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 _0x31fc=['followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x31fc,0x85));var _0xc31f=function(_0x329e45,_0x2a09db){_0x329e45=_0x329e45-0x0;var _0x25c632=_0x31fc[_0x329e45];return _0x25c632;};'use strict';var Sequelize=require(_0xc31f('0x0'));var moment=require(_0xc31f('0x1'));module[_0xc31f('0x2')]={'state':{'type':Sequelize[_0xc31f('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xc31f('0x4')]},'scheduledat':{'type':Sequelize[_0xc31f('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc31f('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xc31f('0x4')]},'calleridnum':{'type':Sequelize[_0xc31f('0x4')]},'calleridname':{'type':Sequelize[_0xc31f('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc31f('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xc31f('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc31f('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xc31f('0x4')]},'membername':{'type':Sequelize[_0xc31f('0x4')]},'reason':{'type':Sequelize[_0xc31f('0x4')]},'disposition':{'type':Sequelize[_0xc31f('0x4')]},'secondDisposition':{'type':Sequelize[_0xc31f('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc31f('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x28a90d){var _0xc86251=this['getDataValue'](_0xc31f('0x6'));if(_0xc86251&&_0x28a90d){this['setDataValue'](_0xc31f('0x7'),moment(_0x28a90d)[_0xc31f('0x8')](moment(_0xc86251),'seconds'));}}},'amd':{'type':Sequelize[_0xc31f('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc31f('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc31f('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc31f('0x5')]},'callback':{'type':Sequelize[_0xc31f('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc31f('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc31f('0x5')]},'deleted':{'type':Sequelize[_0xc31f('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc31f('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc31f('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc31f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8e1=['INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','DATE'];(function(_0x52c38c,_0x5f059f){var _0x2cc213=function(_0x5bf78d){while(--_0x5bf78d){_0x52c38c['push'](_0x52c38c['shift']());}};_0x2cc213(++_0x5f059f);}(_0xd8e1,0x7e));var _0x1d8e=function(_0x4264ee,_0x520320){_0x4264ee=_0x4264ee-0x0;var _0x46d043=_0xd8e1[_0x4264ee];return _0x46d043;};'use strict';var Sequelize=require(_0x1d8e('0x0'));var moment=require(_0x1d8e('0x1'));module[_0x1d8e('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1d8e('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1d8e('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x1d8e('0x5')]},'originatecalleridname':{'type':Sequelize[_0x1d8e('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1d8e('0x5')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1d8e('0x3')]},'answertime':{'type':Sequelize[_0x1d8e('0x3')]},'droptime':{'type':Sequelize[_0x1d8e('0x3')]},'endtime':{'type':Sequelize[_0x1d8e('0x3')]},'ringtime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1d8e('0x5')]},'campaign':{'type':Sequelize[_0x1d8e('0x5')]},'campaigntype':{'type':Sequelize[_0x1d8e('0x5')]},'membername':{'type':Sequelize[_0x1d8e('0x5')]},'reason':{'type':Sequelize[_0x1d8e('0x5')]},'disposition':{'type':Sequelize[_0x1d8e('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1d8e('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3be18f){var _0x250129=this[_0x1d8e('0x6')](_0x1d8e('0x7'));if(_0x250129&&_0x3be18f){this[_0x1d8e('0x8')](_0x1d8e('0x9'),moment(_0x3be18f)[_0x1d8e('0xa')](moment(_0x250129),_0x1d8e('0xb')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1d8e('0x3')]},'callback':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1d8e('0x3')]},'deleted':{'type':Sequelize[_0x1d8e('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1d8e('0x3')]},'recallme':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1d8e('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1d8e('0x4')],'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 2100983..07e5e1a 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 _0x7c09=['sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x3746d2,_0x36305a){var _0x2e7275=function(_0x481623){while(--_0x481623){_0x3746d2['push'](_0x3746d2['shift']());}};_0x2e7275(++_0x36305a);}(_0x7c09,0x102));var _0x97c0=function(_0x344d59,_0x161cf6){_0x344d59=_0x344d59-0x0;var _0x55dea6=_0x7c09[_0x344d59];return _0x55dea6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['CmHopperFinal'][_0x97c0('0x48')]()[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,null))[_0x97c0('0x43')](handleError(_0x4ff0a5,null));};exports['update']=function(_0x3e09d5,_0xac56ac){if(_0x3e09d5[_0x97c0('0x49')][_0x97c0('0x4a')]){delete _0x3e09d5[_0x97c0('0x49')]['uniqueid'];}return db[_0x97c0('0x2b')][_0x97c0('0x47')]({'where':{'uniqueid':_0x3e09d5[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0xac56ac,null))['then'](saveUpdates(_0x3e09d5[_0x97c0('0x49')],null))['then'](respondWithResult(_0xac56ac,null))['catch'](handleError(_0xac56ac,null));};exports[_0x97c0('0x4b')]=function(_0x20e2a5,_0x23c7ad,_0x53a255){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x20e2a5[_0x97c0('0x45')]['id']},'attributes':[[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x4f')))),'noSuchContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x50')))),'noAnswerContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x53')))),_0x97c0('0x54')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x55')))),_0x97c0('0x56')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x59')))),'reCallContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x97c0('0x5a')]]})[_0x97c0('0x24')](handleEntityNotFound(_0x23c7ad,null))[_0x97c0('0x24')](respondWithResult(_0x23c7ad,null))[_0x97c0('0x43')](handleError(_0x23c7ad,null));};exports[_0x97c0('0x5b')]=function(_0x2bb5d3,_0x52643e,_0x3349df){return db[_0x97c0('0x2b')][_0x97c0('0x41')]({'raw':![],'where':{'CampaignId':_0x2bb5d3[_0x97c0('0x45')]['id']},'attributes':[[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0x97c0('0x5c')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x50')))),_0x97c0('0x5d')],[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),_0x97c0('0x54')],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x59')))),_0x97c0('0x5e')],[db[_0x97c0('0x4c')]['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x5f')))),_0x97c0('0x5a')]]})['then'](handleEntityNotFound(_0x52643e,null))[_0x97c0('0x24')](respondWithResult(_0x52643e,null))[_0x97c0('0x43')](handleError(_0x52643e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x4116c9,_0x30ffa8,_0x1cfe22){return db['VoiceQueue'][_0x97c0('0x47')]({'where':{'id':_0x4116c9[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x30ffa8,null))[_0x97c0('0x24')](function(_0x4d40cd){var _0x4ee6a2;if(_0x4d40cd){_0x4ee6a2=squel['insert']()[_0x97c0('0x60')](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),_0x97c0('0x66'),_0x97c0('0x67'),'createdAt','updatedAt'],squel[_0x97c0('0x68')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x64'))[_0x97c0('0x69')](_0x97c0('0x6b'),'ContactId')['field'](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x6d'),'VoiceQueueId')[_0x97c0('0x69')]('NOW()',_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x74'),_0x4116c9['body']['state'][_0x97c0('0x73')]())[_0x97c0('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x97c0('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x97c0('0x68')]()[_0x97c0('0x69')]('phone')[_0x97c0('0x70')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]()))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9['params']['id'][_0x97c0('0x73')]())['where']('state\x20=\x204'))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')]['query'](_0x4ee6a2);}return[];})[_0x97c0('0x24')](respondWithResult(_0x30ffa8,null))[_0x97c0('0x43')](handleError(_0x30ffa8,null));};exports[_0x97c0('0x78')]=function(_0x5bb9de,_0x388ba1,_0x550a68){return db[_0x97c0('0x79')][_0x97c0('0x47')]({'where':{'id':_0x5bb9de[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x388ba1,null))[_0x97c0('0x24')](function(_0x44f6bc){var _0x37cdb3;if(_0x44f6bc){_0x37cdb3=squel[_0x97c0('0x7a')]()['into'](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),'ListId',_0x97c0('0x7b'),_0x97c0('0x6e'),'updatedAt'],squel['select']()[_0x97c0('0x69')](_0x97c0('0x7c'),_0x97c0('0x63'))['field']('NOW()',_0x97c0('0x64'))['field'](_0x97c0('0x6b'),_0x97c0('0x65'))[_0x97c0('0x69')](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x7d'),'CampaignId')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x74'),_0x5bb9de['body'][_0x97c0('0x7f')][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x80'))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x63'))[_0x97c0('0x70')](_0x97c0('0x61'))[_0x97c0('0x39')]('CampaignId\x20=\x20?',_0x5bb9de[_0x97c0('0x45')]['id']['toString']()))[_0x97c0('0x39')](_0x97c0('0x75'),squel[_0x97c0('0x68')]()['field'](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de['params']['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x81')))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')][_0x97c0('0x2f')](_0x37cdb3);}return[];})[_0x97c0('0x24')](respondWithResult(_0x388ba1,null))[_0x97c0('0x43')](handleError(_0x388ba1,null));};exports[_0x97c0('0x82')]=function(_0x3ebd11,_0x44b374,_0x493e62){return db[_0x97c0('0x83')][_0x97c0('0x84')]({'where':{'VoiceQueueId':_0x3ebd11[_0x97c0('0x49')]['VoiceQueueId'],'CampaignId':_0x3ebd11['body'][_0x97c0('0x7b')],'ContactId':_0x3ebd11[_0x97c0('0x49')][_0x97c0('0x65')]}})[_0x97c0('0x24')](handleEntityNotFound(_0x44b374,null))[_0x97c0('0x24')](function(_0x120d78){if(_0x120d78){return _0x120d78;}return null;})[_0x97c0('0x24')](respondWithResult(_0x44b374,null))[_0x97c0('0x43')](handleError(_0x44b374,null));}; \ No newline at end of file +var _0xda19=['map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperFinal','includeAll','findAll','catch','show','uniqueid','body','find','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','ListId','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send'];(function(_0x298b0d,_0x1f3a6a){var _0x3c3a87=function(_0x38c989){while(--_0x38c989){_0x298b0d['push'](_0x298b0d['shift']());}};_0x3c3a87(++_0x1f3a6a);}(_0xda19,0xd5));var _0x9da1=function(_0x193bdc,_0x9734ea){_0x193bdc=_0x193bdc-0x0;var _0x21ba96=_0xda19[_0x193bdc];return _0x21ba96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['CmHopperFinal'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['describe']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['describe']()[_0x9da1('0x24')](respondWithResult(_0x351d4d,null))['catch'](handleError(_0x351d4d,null));};exports['update']=function(_0xfbdde9,_0x43c47d){if(_0xfbdde9['body'][_0x9da1('0x43')]){delete _0xfbdde9[_0x9da1('0x44')]['uniqueid'];}return db[_0x9da1('0x3e')][_0x9da1('0x45')]({'where':{'uniqueid':_0xfbdde9[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x43c47d,null))[_0x9da1('0x24')](saveUpdates(_0xfbdde9[_0x9da1('0x44')],null))[_0x9da1('0x24')](respondWithResult(_0x43c47d,null))[_0x9da1('0x41')](handleError(_0x43c47d,null));};exports[_0x9da1('0x47')]=function(_0x5c9b46,_0x147c65,_0xe6c667){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x5c9b46['params']['id']},'attributes':[[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4b')))),_0x9da1('0x4c')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4d')))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),'busyContacts'],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db['sequelize']['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9da1('0x55')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x147c65,null))[_0x9da1('0x24')](respondWithResult(_0x147c65,null))[_0x9da1('0x41')](handleError(_0x147c65,null));};exports[_0x9da1('0x57')]=function(_0x562e05,_0x1a9df0,_0x5c236e){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'CampaignId':_0x562e05[_0x9da1('0x46')]['id']},'attributes':[[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x4b')))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize'][_0x9da1('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),_0x9da1('0x58')],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x59')))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x5a')))),'reCallContacts'],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x1a9df0,null))['then'](respondWithResult(_0x1a9df0,null))[_0x9da1('0x41')](handleError(_0x1a9df0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7cfa7e,_0xdd3997,_0x44b6c0){return db[_0x9da1('0x5b')]['find']({'where':{'id':_0x7cfa7e['params']['id']}})['then'](handleEntityNotFound(_0xdd3997,null))[_0x9da1('0x24')](function(_0x2b1a71){var _0x266533;if(_0x2b1a71){_0x266533=squel[_0x9da1('0x5c')]()['into']('cm_hopper')[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),'ContactId','ListId',_0x9da1('0x60'),_0x9da1('0x61'),_0x9da1('0x62')],squel['select']()['field'](_0x9da1('0x63'),_0x9da1('0x5e'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))['field'](_0x9da1('0x66'),_0x9da1('0x67'))[_0x9da1('0x64')](_0x9da1('0x68'),'ListId')[_0x9da1('0x64')](_0x9da1('0x69'),_0x9da1('0x60'))['field'](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')]('NOW()',_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')]('VoiceQueueId\x20=\x20?',_0x7cfa7e[_0x9da1('0x46')]['id']['toString']())[_0x9da1('0x38')](_0x9da1('0x6b'),_0x7cfa7e[_0x9da1('0x44')][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x5e'))[_0x9da1('0x6a')]('cm_hopper')[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('calleridnum')['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))[_0x9da1('0x74')](_0x9da1('0x67')))[_0x9da1('0x6d')]();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x266533);}return[];})[_0x9da1('0x24')](respondWithResult(_0xdd3997,null))['catch'](handleError(_0xdd3997,null));};exports[_0x9da1('0x75')]=function(_0x3a0a84,_0x3f9782,_0x30b6fc){return db[_0x9da1('0x76')]['find']({'where':{'id':_0x3a0a84[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x3f9782,null))['then'](function(_0x33b625){var _0x5a0533;if(_0x33b625){_0x5a0533=squel[_0x9da1('0x5c')]()['into'](_0x9da1('0x77'))[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x67'),_0x9da1('0x78'),_0x9da1('0x79'),_0x9da1('0x61'),_0x9da1('0x62')],squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x63'),'phone')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))[_0x9da1('0x64')](_0x9da1('0x66'),_0x9da1('0x67'))['field']('ANY_VALUE(ListId)',_0x9da1('0x78'))[_0x9da1('0x64')](_0x9da1('0x7a'),'CampaignId')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84['params']['id']['toString']())[_0x9da1('0x38')]('state\x20=\x20?',_0x3a0a84['body'][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('phone')['from'](_0x9da1('0x77'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()['field'](_0x9da1('0x7c'))['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))['group'](_0x9da1('0x67')))['toString']();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x5a0533);}return[];})[_0x9da1('0x24')](respondWithResult(_0x3f9782,null))[_0x9da1('0x41')](handleError(_0x3f9782,null));};exports['checkContactHopper']=function(_0x3310af,_0x1f93bf,_0x2afe1e){return db[_0x9da1('0x7d')][_0x9da1('0x7e')]({'where':{'VoiceQueueId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x60')],'CampaignId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x79')],'ContactId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x67')]}})[_0x9da1('0x24')](handleEntityNotFound(_0x1f93bf,null))[_0x9da1('0x24')](function(_0x32ff53){if(_0x32ff53){return _0x32ff53;}return null;})['then'](respondWithResult(_0x1f93bf,null))[_0x9da1('0x41')](handleError(_0x1f93bf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 652a075..aa2950e 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 _0x9ed9=['rimraf','../../config/environment','exports','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','path'];(function(_0x532b78,_0x3ca094){var _0x4bcc54=function(_0x1192d7){while(--_0x1192d7){_0x532b78['push'](_0x532b78['shift']());}};_0x4bcc54(++_0x3ca094);}(_0x9ed9,0x1ce));var _0x99ed=function(_0x327a89,_0x202166){_0x327a89=_0x327a89-0x0;var _0x2bf987=_0x9ed9[_0x327a89];return _0x2bf987;};'use strict';var _=require(_0x99ed('0x0'));var util=require(_0x99ed('0x1'));var logger=require('../../config/logger')(_0x99ed('0x2'));var moment=require(_0x99ed('0x3'));var BPromise=require(_0x99ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99ed('0x5'));var rimraf=require(_0x99ed('0x6'));var config=require(_0x99ed('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x99ed('0x8')]=function(_0x6d4a78,_0x5ca385){return _0x6d4a78['define']('CmHopperFinal',attributes,{'tableName':_0x99ed('0x9'),'paranoid':![],'indexes':[{'name':_0x99ed('0xa'),'fields':[_0x99ed('0xa')]},{'name':_0x99ed('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb4b=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','util'];(function(_0x5807c9,_0x556d63){var _0xe912f6=function(_0x1c63fb){while(--_0x1c63fb){_0x5807c9['push'](_0x5807c9['shift']());}};_0xe912f6(++_0x556d63);}(_0xfb4b,0x192));var _0xbfb4=function(_0x3ebdb3,_0x38f046){_0x3ebdb3=_0x3ebdb3-0x0;var _0x82ed19=_0xfb4b[_0x3ebdb3];return _0x82ed19;};'use strict';var _=require('lodash');var util=require(_0xbfb4('0x0'));var logger=require(_0xbfb4('0x1'))(_0xbfb4('0x2'));var moment=require('moment');var BPromise=require(_0xbfb4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfb4('0x4'));var rimraf=require(_0xbfb4('0x5'));var config=require(_0xbfb4('0x6'));var attributes=require(_0xbfb4('0x7'));module[_0xbfb4('0x8')]=function(_0x525b26,_0x3dce2f){return _0x525b26[_0xbfb4('0x9')](_0xbfb4('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xbfb4('0xb'),'fields':[_0xbfb4('0xb')]},{'name':_0xbfb4('0xc'),'fields':[_0xbfb4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2641a7c..42575aa 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(_0x12b0ba,_0x2ae0c8){var _0xb54a38=function(_0xac14ac){while(--_0xac14ac){_0x12b0ba['push'](_0x12b0ba['shift']());}};_0xb54a38(++_0x2ae0c8);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0xb10b[_0x4ce1b9];return _0x2bb15d;};'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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x42dcfa,_0x39f34f){var _0x27d30c=function(_0x399347){while(--_0x399347){_0x42dcfa['push'](_0x42dcfa['shift']());}};_0x27d30c(++_0x39f34f);}(_0x7a54,0x106));var _0x47a5=function(_0x22b1df,_0x1b701f){_0x22b1df=_0x22b1df-0x0;var _0x588f5e=_0x7a54[_0x22b1df];return _0x588f5e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index f5f2530..2f97a91 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 _0xfea2=['moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id'];(function(_0x1c5294,_0x4765c5){var _0x5e1821=function(_0x4be641){while(--_0x4be641){_0x1c5294['push'](_0x1c5294['shift']());}};_0x5e1821(++_0x4765c5);}(_0xfea2,0xa4));var _0x2fea=function(_0x415260,_0x135fcb){_0x415260=_0x415260-0x0;var _0x490f21=_0xfea2[_0x415260];return _0x490f21;};'use strict';var multer=require('multer');var util=require(_0x2fea('0x0'));var path=require('path');var timeout=require(_0x2fea('0x1'));var express=require(_0x2fea('0x2'));var router=express[_0x2fea('0x3')]();var fs_extra=require(_0x2fea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2fea('0x5'));var config=require(_0x2fea('0x6'));var controller=require(_0x2fea('0x7'));router[_0x2fea('0x8')]('/',auth[_0x2fea('0x9')](),controller[_0x2fea('0xa')]);router[_0x2fea('0x8')](_0x2fea('0xb'),auth[_0x2fea('0x9')](),controller['describe']);router[_0x2fea('0x8')](_0x2fea('0xc'),auth[_0x2fea('0x9')](),controller[_0x2fea('0xd')]);router[_0x2fea('0x8')]('/voice/queue/countAttributes/:id',auth[_0x2fea('0x9')](),controller[_0x2fea('0xe')]);router['get']('/campaign/countAttributes/:id',auth[_0x2fea('0x9')](),controller[_0x2fea('0xf')]);router[_0x2fea('0x10')](_0x2fea('0x11'),auth[_0x2fea('0x9')](),controller[_0x2fea('0x12')]);router['post'](_0x2fea('0x13'),auth['isAuthenticated'](),controller[_0x2fea('0x14')]);router['post'](_0x2fea('0x15'),auth[_0x2fea('0x9')](),controller[_0x2fea('0x16')]);router[_0x2fea('0x17')]('/:id',auth[_0x2fea('0x9')](),controller[_0x2fea('0x18')]);module[_0x2fea('0x19')]=router; \ No newline at end of file +var _0x6951=['index','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0x5efe3f,_0x337564){var _0x39bbf9=function(_0x560397){while(--_0x560397){_0x5efe3f['push'](_0x5efe3f['shift']());}};_0x39bbf9(++_0x337564);}(_0x6951,0x9d));var _0x1695=function(_0x3af4ab,_0x4744f2){_0x3af4ab=_0x3af4ab-0x0;var _0x132195=_0x6951[_0x3af4ab];return _0x132195;};'use strict';var multer=require('multer');var util=require(_0x1695('0x0'));var path=require('path');var timeout=require(_0x1695('0x1'));var express=require(_0x1695('0x2'));var router=express[_0x1695('0x3')]();var fs_extra=require(_0x1695('0x4'));var auth=require(_0x1695('0x5'));var interaction=require(_0x1695('0x6'));var config=require(_0x1695('0x7'));var controller=require(_0x1695('0x8'));router[_0x1695('0x9')]('/',auth[_0x1695('0xa')](),controller[_0x1695('0xb')]);router[_0x1695('0x9')]('/describe',auth[_0x1695('0xa')](),controller[_0x1695('0xc')]);router[_0x1695('0x9')]('/:id',auth[_0x1695('0xa')](),controller[_0x1695('0xd')]);router[_0x1695('0x9')](_0x1695('0xe'),auth[_0x1695('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x1695('0x9')](_0x1695('0xf'),auth['isAuthenticated'](),controller[_0x1695('0x10')]);router[_0x1695('0x11')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x1695('0x11')](_0x1695('0x12'),auth[_0x1695('0xa')](),controller[_0x1695('0x13')]);router['post']('/checkContactHopper',auth[_0x1695('0xa')](),controller[_0x1695('0x14')]);router[_0x1695('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1695('0x16')]);module[_0x1695('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index bc9550a..89612d7 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 _0xda81=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x34dad8,_0x504fe2){var _0x5526f1=function(_0x25518c){while(--_0x25518c){_0x34dad8['push'](_0x34dad8['shift']());}};_0x5526f1(++_0x504fe2);}(_0xda81,0x1c3));var _0x1da8=function(_0x2bf865,_0xe37c8b){_0x2bf865=_0x2bf865-0x0;var _0x267e87=_0xda81[_0x2bf865];return _0x267e87;};'use strict';var Sequelize=require(_0x1da8('0x0'));module[_0x1da8('0x1')]={'state':{'type':Sequelize[_0x1da8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1da8('0x3')]},'countbusyretry':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1da8('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x1da8('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1da8('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1da8('0x3')]},'responsetime':{'type':Sequelize[_0x1da8('0x3')]},'answertime':{'type':Sequelize[_0x1da8('0x3')]},'droptime':{'type':Sequelize[_0x1da8('0x3')]},'endtime':{'type':Sequelize[_0x1da8('0x3')]},'ringtime':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1da8('0x4')]},'campaigntype':{'type':Sequelize[_0x1da8('0x4')]},'membername':{'type':Sequelize[_0x1da8('0x4')]},'reason':{'type':Sequelize[_0x1da8('0x4')]},'amd':{'type':Sequelize[_0x1da8('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x1da8('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1da8('0x3')]},'recallme':{'type':Sequelize[_0x1da8('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1da8('0x3')]},'edited':{'type':Sequelize[_0x1da8('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1da8('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1da8('0x4')]}}; \ No newline at end of file +var _0xeca8=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x4a6979,_0x5f3d1a){var _0x226f93=function(_0x471572){while(--_0x471572){_0x4a6979['push'](_0x4a6979['shift']());}};_0x226f93(++_0x5f3d1a);}(_0xeca8,0x1f2));var _0x8eca=function(_0x50256a,_0x1ec1ad){_0x50256a=_0x50256a-0x0;var _0xcd4fc2=_0xeca8[_0x50256a];return _0xcd4fc2;};'use strict';var Sequelize=require(_0x8eca('0x0'));module[_0x8eca('0x1')]={'state':{'type':Sequelize[_0x8eca('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8eca('0x3')]},'scheduledat':{'type':Sequelize[_0x8eca('0x4')]},'countbusyretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8eca('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8eca('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8eca('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8eca('0x3')]},'starttime':{'type':Sequelize[_0x8eca('0x4')]},'responsetime':{'type':Sequelize[_0x8eca('0x4')]},'answertime':{'type':Sequelize[_0x8eca('0x4')]},'droptime':{'type':Sequelize[_0x8eca('0x4')]},'endtime':{'type':Sequelize[_0x8eca('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8eca('0x3')]},'campaign':{'type':Sequelize[_0x8eca('0x3')]},'campaigntype':{'type':Sequelize[_0x8eca('0x3')]},'membername':{'type':Sequelize[_0x8eca('0x3')]},'reason':{'type':Sequelize[_0x8eca('0x3')]},'amd':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8eca('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8eca('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8eca('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index e0e3b98..15c58b7 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 _0x1637=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','length','include','find','create','describe','update','body','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x12d0f6,_0x54eafe){var _0x52a2e0=function(_0x5f4026){while(--_0x5f4026){_0x12d0f6['push'](_0x12d0f6['shift']());}};_0x52a2e0(++_0x54eafe);}(_0x1637,0x17d));var _0x7163=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x1637[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require(_0x7163('0x0'));var rimraf=require(_0x7163('0x1'));var zipdir=require(_0x7163('0x2'));var jsonpatch=require(_0x7163('0x3'));var rp=require(_0x7163('0x4'));var moment=require(_0x7163('0x5'));var BPromise=require(_0x7163('0x6'));var Mustache=require(_0x7163('0x7'));var util=require(_0x7163('0x8'));var path=require(_0x7163('0x9'));var sox=require(_0x7163('0xa'));var csv=require(_0x7163('0xb'));var ejs=require(_0x7163('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7163('0xd'));var squel=require(_0x7163('0xe'));var crypto=require(_0x7163('0xf'));var jsforce=require(_0x7163('0x10'));var deskjs=require(_0x7163('0x11'));var toCsv=require(_0x7163('0xb'));var querystring=require(_0x7163('0x12'));var Papa=require(_0x7163('0x13'));var Redis=require(_0x7163('0x14'));var authService=require(_0x7163('0x15'));var qs=require(_0x7163('0x16'));var as=require(_0x7163('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7163('0x18'));var utils=require(_0x7163('0x19'));var config=require(_0x7163('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7163('0x1b'))['db'];function respondWithStatusCode(_0x5d87c9,_0x7d8a51){_0x7d8a51=_0x7d8a51||0xcc;return function(_0x20a03a){if(_0x20a03a){return _0x5d87c9[_0x7163('0x1c')](_0x7d8a51);}return _0x5d87c9[_0x7163('0x1d')](_0x7d8a51)[_0x7163('0x1e')]();};}function respondWithResult(_0x3fff67,_0x55dacf){_0x55dacf=_0x55dacf||0xc8;return function(_0x3c3ea8){if(_0x3c3ea8){return _0x3fff67[_0x7163('0x1d')](_0x55dacf)[_0x7163('0x1f')](_0x3c3ea8);}};}function respondWithFilteredResult(_0x1c2bba,_0x57d394){return function(_0xdc8b0d){if(_0xdc8b0d){var _0x4c9b62=typeof _0x57d394[_0x7163('0x20')]===_0x7163('0x21')&&typeof _0x57d394['limit']===_0x7163('0x21');var _0x36e3f1=_0xdc8b0d[_0x7163('0x22')];var _0x5e2136=_0x4c9b62?0x0:_0x57d394[_0x7163('0x20')];var _0x41f830=_0x4c9b62?_0xdc8b0d[_0x7163('0x22')]:_0x57d394[_0x7163('0x20')]+_0x57d394['limit'];var _0x548ebe;if(_0x41f830>=_0x36e3f1){_0x41f830=_0x36e3f1;_0x548ebe=0xc8;}else{_0x548ebe=0xce;}_0x1c2bba[_0x7163('0x1d')](_0x548ebe);return _0x1c2bba[_0x7163('0x23')](_0x7163('0x24'),_0x5e2136+'-'+_0x41f830+'/'+_0x36e3f1)[_0x7163('0x1f')](_0xdc8b0d);}return null;};}function patchUpdates(_0x56ea1f){return function(_0x10fd1b){try{jsonpatch[_0x7163('0x25')](_0x10fd1b,_0x56ea1f,!![]);}catch(_0x4607ad){return BPromise['reject'](_0x4607ad);}return _0x10fd1b[_0x7163('0x26')]();};}function saveUpdates(_0x5678c3,_0x103b22){return function(_0x3ff493){if(_0x3ff493){return _0x3ff493['update'](_0x5678c3)[_0x7163('0x27')](function(_0x1d5be7){return _0x1d5be7;});}return null;};}function removeEntity(_0x2f0861,_0x531b19){return function(_0x426705){if(_0x426705){return _0x426705['destroy']()[_0x7163('0x27')](function(){_0x2f0861['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a8ee,_0xdd9713){return function(_0x257c9e){if(!_0x257c9e){_0x22a8ee['sendStatus'](0x194);}return _0x257c9e;};}function handleError(_0x3f7704,_0x270b1a){_0x270b1a=_0x270b1a||0x1f4;return function(_0x8e68b6){logger[_0x7163('0x28')](_0x8e68b6[_0x7163('0x29')]);if(_0x8e68b6[_0x7163('0x2a')]){delete _0x8e68b6[_0x7163('0x2a')];}_0x3f7704['status'](_0x270b1a)[_0x7163('0x2b')](_0x8e68b6);};}exports[_0x7163('0x2c')]=function(_0x3a638b,_0x3b74ab){var _0x3de534={},_0x4aa05c={},_0x3a1908={'count':0x0,'rows':[]};var _0x6299ed=_[_0x7163('0x2d')](db[_0x7163('0x2e')][_0x7163('0x2f')],function(_0x186bd5){return{'name':_0x186bd5[_0x7163('0x30')],'type':_0x186bd5[_0x7163('0x31')]['key']};});_0x4aa05c[_0x7163('0x32')]=_[_0x7163('0x2d')](_0x6299ed,_0x7163('0x2a'));_0x4aa05c[_0x7163('0x33')]=_[_0x7163('0x34')](_0x3a638b['query']);_0x4aa05c[_0x7163('0x35')]=_[_0x7163('0x36')](_0x4aa05c[_0x7163('0x32')],_0x4aa05c[_0x7163('0x33')]);_0x3de534[_0x7163('0x37')]=_[_0x7163('0x36')](_0x4aa05c[_0x7163('0x32')],qs[_0x7163('0x38')](_0x3a638b[_0x7163('0x33')]['fields']));_0x3de534[_0x7163('0x37')]=_0x3de534[_0x7163('0x37')]['length']?_0x3de534[_0x7163('0x37')]:_0x4aa05c['model'];if(!_0x3a638b[_0x7163('0x33')][_0x7163('0x39')]('nolimit')){_0x3de534['limit']=qs[_0x7163('0x3a')](_0x3a638b[_0x7163('0x33')][_0x7163('0x3a')]);_0x3de534[_0x7163('0x20')]=qs[_0x7163('0x20')](_0x3a638b[_0x7163('0x33')][_0x7163('0x20')]);}_0x3de534[_0x7163('0x3b')]=qs[_0x7163('0x3c')](_0x3a638b[_0x7163('0x33')][_0x7163('0x3c')]);_0x3de534[_0x7163('0x3d')]=qs[_0x7163('0x35')](_['pick'](_0x3a638b['query'],_0x4aa05c[_0x7163('0x35')]),_0x6299ed);if(_0x3a638b[_0x7163('0x33')]['filter']){_0x3de534[_0x7163('0x3d')]=_['merge'](_0x3de534[_0x7163('0x3d')],{'$or':_[_0x7163('0x2d')](_0x6299ed,function(_0x25d149){if(_0x25d149['type']!==_0x7163('0x3e')){var _0x13e2c1={};_0x13e2c1[_0x25d149[_0x7163('0x2a')]]={'$like':'%'+_0x3a638b[_0x7163('0x33')][_0x7163('0x3f')]+'%'};return _0x13e2c1;}})});}_0x3de534=_[_0x7163('0x40')]({},_0x3de534,_0x3a638b['options']);var _0x2b636e={'where':_0x3de534[_0x7163('0x3d')]};return db[_0x7163('0x2e')][_0x7163('0x22')](_0x2b636e)['then'](function(_0x48d97a){_0x3a1908['count']=_0x48d97a;if(_0x3a638b[_0x7163('0x33')][_0x7163('0x41')]){_0x3de534['include']=[{'all':!![]}];}return db[_0x7163('0x2e')][_0x7163('0x42')](_0x3de534);})[_0x7163('0x27')](function(_0x55103c){_0x3a1908[_0x7163('0x43')]=_0x55103c;return _0x3a1908;})[_0x7163('0x27')](respondWithFilteredResult(_0x3b74ab,_0x3de534))[_0x7163('0x44')](handleError(_0x3b74ab,null));};exports['show']=function(_0x3a6cac,_0x16a9e3){var _0x38e0d1={'raw':!![],'where':{'id':_0x3a6cac['params']['id']}},_0x302d49={};_0x302d49[_0x7163('0x32')]=_[_0x7163('0x34')](db[_0x7163('0x2e')][_0x7163('0x2f')]);_0x302d49[_0x7163('0x33')]=_[_0x7163('0x34')](_0x3a6cac[_0x7163('0x33')]);_0x302d49[_0x7163('0x35')]=_[_0x7163('0x36')](_0x302d49[_0x7163('0x32')],_0x302d49[_0x7163('0x33')]);_0x38e0d1[_0x7163('0x37')]=_[_0x7163('0x36')](_0x302d49[_0x7163('0x32')],qs[_0x7163('0x38')](_0x3a6cac[_0x7163('0x33')]['fields']));_0x38e0d1[_0x7163('0x37')]=_0x38e0d1[_0x7163('0x37')][_0x7163('0x45')]?_0x38e0d1[_0x7163('0x37')]:_0x302d49[_0x7163('0x32')];if(_0x3a6cac[_0x7163('0x33')]['includeAll']){_0x38e0d1[_0x7163('0x46')]=[{'all':!![]}];}_0x38e0d1=_['merge']({},_0x38e0d1,_0x3a6cac['options']);return db[_0x7163('0x2e')][_0x7163('0x47')](_0x38e0d1)[_0x7163('0x27')](handleEntityNotFound(_0x16a9e3,null))[_0x7163('0x27')](respondWithResult(_0x16a9e3,null))[_0x7163('0x44')](handleError(_0x16a9e3,null));};exports['create']=function(_0x23fc76,_0x4999e0){return db[_0x7163('0x2e')][_0x7163('0x48')](_0x23fc76['body'],{})[_0x7163('0x27')](respondWithResult(_0x4999e0,0xc9))[_0x7163('0x44')](handleError(_0x4999e0,null));};exports[_0x7163('0x49')]=function(_0x23fbf2,_0x490b24){return db[_0x7163('0x2e')]['describe']()[_0x7163('0x27')](respondWithResult(_0x490b24,null))['catch'](handleError(_0x490b24,null));};exports[_0x7163('0x4a')]=function(_0x44466b,_0x1a0dc3){if(_0x44466b[_0x7163('0x4b')][_0x7163('0x4c')]){delete _0x44466b[_0x7163('0x4b')][_0x7163('0x4c')];}return db['CmHopperHistory'][_0x7163('0x47')]({'where':{'uniqueid':_0x44466b[_0x7163('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a0dc3,null))[_0x7163('0x27')](saveUpdates(_0x44466b[_0x7163('0x4b')],null))[_0x7163('0x27')](respondWithResult(_0x1a0dc3,null))[_0x7163('0x44')](handleError(_0x1a0dc3,null));}; \ No newline at end of file +var _0x4d84=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','rows','show','length','includeAll','find','create','body','catch','describe','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x387a18,_0x4d00c6){var _0x219016=function(_0x5c343b){while(--_0x5c343b){_0x387a18['push'](_0x387a18['shift']());}};_0x219016(++_0x4d00c6);}(_0x4d84,0xf9));var _0x44d8=function(_0x2edf70,_0x3b24e1){_0x2edf70=_0x2edf70-0x0;var _0x193515=_0x4d84[_0x2edf70];return _0x193515;};'use strict';var emlformat=require(_0x44d8('0x0'));var rimraf=require(_0x44d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44d8('0x2'));var rp=require(_0x44d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44d8('0x4'));var util=require(_0x44d8('0x5'));var path=require(_0x44d8('0x6'));var sox=require(_0x44d8('0x7'));var csv=require(_0x44d8('0x8'));var ejs=require(_0x44d8('0x9'));var fs=require('fs');var fs_extra=require(_0x44d8('0xa'));var _=require(_0x44d8('0xb'));var squel=require('squel');var crypto=require(_0x44d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x44d8('0xd'));var toCsv=require(_0x44d8('0x8'));var querystring=require(_0x44d8('0xe'));var Papa=require('papaparse');var Redis=require(_0x44d8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x44d8('0x10'));var as=require(_0x44d8('0x11'));var hardwareService=require(_0x44d8('0x12'));var logger=require(_0x44d8('0x13'))(_0x44d8('0x14'));var utils=require(_0x44d8('0x15'));var config=require(_0x44d8('0x16'));var licenseUtil=require(_0x44d8('0x17'));var db=require(_0x44d8('0x18'))['db'];function respondWithStatusCode(_0x51f32e,_0x26bc7e){_0x26bc7e=_0x26bc7e||0xcc;return function(_0x26b3b0){if(_0x26b3b0){return _0x51f32e['sendStatus'](_0x26bc7e);}return _0x51f32e[_0x44d8('0x19')](_0x26bc7e)['end']();};}function respondWithResult(_0x4e80a9,_0x1d82a8){_0x1d82a8=_0x1d82a8||0xc8;return function(_0x2fb39e){if(_0x2fb39e){return _0x4e80a9[_0x44d8('0x19')](_0x1d82a8)[_0x44d8('0x1a')](_0x2fb39e);}};}function respondWithFilteredResult(_0x46e0e5,_0x3a6514){return function(_0x20dfd9){if(_0x20dfd9){var _0x56d95f=typeof _0x3a6514[_0x44d8('0x1b')]===_0x44d8('0x1c')&&typeof _0x3a6514[_0x44d8('0x1d')]===_0x44d8('0x1c');var _0x3996c8=_0x20dfd9[_0x44d8('0x1e')];var _0x3258a3=_0x56d95f?0x0:_0x3a6514[_0x44d8('0x1b')];var _0x1e2e3a=_0x56d95f?_0x20dfd9[_0x44d8('0x1e')]:_0x3a6514[_0x44d8('0x1b')]+_0x3a6514[_0x44d8('0x1d')];var _0x1b6602;if(_0x1e2e3a>=_0x3996c8){_0x1e2e3a=_0x3996c8;_0x1b6602=0xc8;}else{_0x1b6602=0xce;}_0x46e0e5[_0x44d8('0x19')](_0x1b6602);return _0x46e0e5['set'](_0x44d8('0x1f'),_0x3258a3+'-'+_0x1e2e3a+'/'+_0x3996c8)['json'](_0x20dfd9);}return null;};}function patchUpdates(_0x422ebc){return function(_0x24f74d){try{jsonpatch['apply'](_0x24f74d,_0x422ebc,!![]);}catch(_0x33db4c){return BPromise[_0x44d8('0x20')](_0x33db4c);}return _0x24f74d[_0x44d8('0x21')]();};}function saveUpdates(_0x13839b,_0x4d5998){return function(_0x1573a3){if(_0x1573a3){return _0x1573a3[_0x44d8('0x22')](_0x13839b)[_0x44d8('0x23')](function(_0x313d18){return _0x313d18;});}return null;};}function removeEntity(_0x587568,_0x91a5f4){return function(_0x57bf04){if(_0x57bf04){return _0x57bf04[_0x44d8('0x24')]()[_0x44d8('0x23')](function(){_0x587568[_0x44d8('0x19')](0xcc)[_0x44d8('0x25')]();});}};}function handleEntityNotFound(_0x46645a,_0x3e42f5){return function(_0x598705){if(!_0x598705){_0x46645a['sendStatus'](0x194);}return _0x598705;};}function handleError(_0x444fa3,_0x17d6d4){_0x17d6d4=_0x17d6d4||0x1f4;return function(_0xafee8f){logger[_0x44d8('0x26')](_0xafee8f[_0x44d8('0x27')]);if(_0xafee8f[_0x44d8('0x28')]){delete _0xafee8f[_0x44d8('0x28')];}_0x444fa3[_0x44d8('0x19')](_0x17d6d4)['send'](_0xafee8f);};}exports[_0x44d8('0x29')]=function(_0x35e157,_0x5595af){var _0x350569={},_0x5898a0={},_0x43e3d8={'count':0x0,'rows':[]};var _0x42c017=_[_0x44d8('0x2a')](db[_0x44d8('0x2b')][_0x44d8('0x2c')],function(_0x21070e){return{'name':_0x21070e[_0x44d8('0x2d')],'type':_0x21070e[_0x44d8('0x2e')][_0x44d8('0x2f')]};});_0x5898a0[_0x44d8('0x30')]=_['map'](_0x42c017,_0x44d8('0x28'));_0x5898a0[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0x35e157['query']);_0x5898a0[_0x44d8('0x33')]=_[_0x44d8('0x34')](_0x5898a0[_0x44d8('0x30')],_0x5898a0['query']);_0x350569['attributes']=_[_0x44d8('0x34')](_0x5898a0[_0x44d8('0x30')],qs['fields'](_0x35e157[_0x44d8('0x31')][_0x44d8('0x35')]));_0x350569[_0x44d8('0x36')]=_0x350569[_0x44d8('0x36')]['length']?_0x350569[_0x44d8('0x36')]:_0x5898a0[_0x44d8('0x30')];if(!_0x35e157[_0x44d8('0x31')][_0x44d8('0x37')](_0x44d8('0x38'))){_0x350569['limit']=qs[_0x44d8('0x1d')](_0x35e157[_0x44d8('0x31')][_0x44d8('0x1d')]);_0x350569[_0x44d8('0x1b')]=qs['offset'](_0x35e157[_0x44d8('0x31')][_0x44d8('0x1b')]);}_0x350569[_0x44d8('0x39')]=qs['sort'](_0x35e157[_0x44d8('0x31')][_0x44d8('0x3a')]);_0x350569[_0x44d8('0x3b')]=qs[_0x44d8('0x33')](_['pick'](_0x35e157[_0x44d8('0x31')],_0x5898a0[_0x44d8('0x33')]),_0x42c017);if(_0x35e157[_0x44d8('0x31')]['filter']){_0x350569['where']=_[_0x44d8('0x3c')](_0x350569[_0x44d8('0x3b')],{'$or':_['map'](_0x42c017,function(_0x469318){if(_0x469318[_0x44d8('0x2e')]!=='VIRTUAL'){var _0x59ec2c={};_0x59ec2c[_0x469318[_0x44d8('0x28')]]={'$like':'%'+_0x35e157[_0x44d8('0x31')][_0x44d8('0x3d')]+'%'};return _0x59ec2c;}})});}_0x350569=_[_0x44d8('0x3c')]({},_0x350569,_0x35e157[_0x44d8('0x3e')]);var _0x565db9={'where':_0x350569['where']};return db[_0x44d8('0x2b')][_0x44d8('0x1e')](_0x565db9)['then'](function(_0x8ceb6e){_0x43e3d8[_0x44d8('0x1e')]=_0x8ceb6e;if(_0x35e157[_0x44d8('0x31')]['includeAll']){_0x350569[_0x44d8('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x44d8('0x40')](_0x350569);})[_0x44d8('0x23')](function(_0x1b1c19){_0x43e3d8[_0x44d8('0x41')]=_0x1b1c19;return _0x43e3d8;})['then'](respondWithFilteredResult(_0x5595af,_0x350569))['catch'](handleError(_0x5595af,null));};exports[_0x44d8('0x42')]=function(_0xa8c8fe,_0x5111ed){var _0x107645={'raw':!![],'where':{'id':_0xa8c8fe['params']['id']}},_0x2c6943={};_0x2c6943[_0x44d8('0x30')]=_[_0x44d8('0x32')](db[_0x44d8('0x2b')][_0x44d8('0x2c')]);_0x2c6943[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0xa8c8fe[_0x44d8('0x31')]);_0x2c6943[_0x44d8('0x33')]=_['intersection'](_0x2c6943[_0x44d8('0x30')],_0x2c6943['query']);_0x107645['attributes']=_['intersection'](_0x2c6943[_0x44d8('0x30')],qs[_0x44d8('0x35')](_0xa8c8fe[_0x44d8('0x31')][_0x44d8('0x35')]));_0x107645[_0x44d8('0x36')]=_0x107645[_0x44d8('0x36')][_0x44d8('0x43')]?_0x107645[_0x44d8('0x36')]:_0x2c6943[_0x44d8('0x30')];if(_0xa8c8fe[_0x44d8('0x31')][_0x44d8('0x44')]){_0x107645[_0x44d8('0x3f')]=[{'all':!![]}];}_0x107645=_[_0x44d8('0x3c')]({},_0x107645,_0xa8c8fe['options']);return db[_0x44d8('0x2b')][_0x44d8('0x45')](_0x107645)[_0x44d8('0x23')](handleEntityNotFound(_0x5111ed,null))[_0x44d8('0x23')](respondWithResult(_0x5111ed,null))['catch'](handleError(_0x5111ed,null));};exports[_0x44d8('0x46')]=function(_0x2b4f32,_0x162b46){return db[_0x44d8('0x2b')]['create'](_0x2b4f32[_0x44d8('0x47')],{})[_0x44d8('0x23')](respondWithResult(_0x162b46,0xc9))[_0x44d8('0x48')](handleError(_0x162b46,null));};exports[_0x44d8('0x49')]=function(_0x51abb1,_0x5f33df){return db['CmHopperHistory'][_0x44d8('0x49')]()['then'](respondWithResult(_0x5f33df,null))['catch'](handleError(_0x5f33df,null));};exports[_0x44d8('0x22')]=function(_0x2a3cd0,_0x53e74a){if(_0x2a3cd0['body']['uniqueid']){delete _0x2a3cd0[_0x44d8('0x47')]['uniqueid'];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x2a3cd0[_0x44d8('0x4a')]['id']}})[_0x44d8('0x23')](handleEntityNotFound(_0x53e74a,null))['then'](saveUpdates(_0x2a3cd0[_0x44d8('0x47')],null))[_0x44d8('0x23')](respondWithResult(_0x53e74a,null))['catch'](handleError(_0x53e74a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6654a3d..2fe0c3f 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 _0xffc0=['request-promise','path','rimraf','../../config/environment','exports','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x25f0e8,_0x100ad3){_0x25f0e8=_0x25f0e8-0x0;var _0x189e66=_0xffc0[_0x25f0e8];return _0x189e66;};'use strict';var _=require('lodash');var util=require(_0x0ffc('0x0'));var logger=require('../../config/logger')(_0x0ffc('0x1'));var moment=require(_0x0ffc('0x2'));var BPromise=require(_0x0ffc('0x3'));var rp=require(_0x0ffc('0x4'));var fs=require('fs');var path=require(_0x0ffc('0x5'));var rimraf=require(_0x0ffc('0x6'));var config=require(_0x0ffc('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x0ffc('0x8')]=function(_0x23d3e0,_0x426ce2){return _0x23d3e0['define']('CmHopperHistory',attributes,{'tableName':_0x0ffc('0x9'),'paranoid':![],'indexes':[{'name':_0x0ffc('0xa'),'fields':[_0x0ffc('0xa')]},{'name':_0x0ffc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7880=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x240645,_0x49729a){var _0x47b1b8=function(_0x29a312){while(--_0x29a312){_0x240645['push'](_0x240645['shift']());}};_0x47b1b8(++_0x49729a);}(_0x7880,0x1f4));var _0x0788=function(_0x49b59f,_0x1f3a28){_0x49b59f=_0x49b59f-0x0;var _0x46f0de=_0x7880[_0x49b59f];return _0x46f0de;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[{'name':_0x0788('0xd'),'fields':['endtime']},{'name':_0x0788('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 731351b..d54d935 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 _0x16d2=['debug','GetVoiceQueueHopperHistory','findAll','raw','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','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','create','options','AvgHandleTime','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x1fc6f7,_0x34e9d7){var _0x50ab6b=function(_0x17328a){while(--_0x17328a){_0x1fc6f7['push'](_0x1fc6f7['shift']());}};_0x50ab6b(++_0x34e9d7);}(_0x16d2,0x123));var _0x216d=function(_0x25e812,_0x1342a2){_0x25e812=_0x25e812-0x0;var _0x727c56=_0x16d2[_0x25e812];return _0x727c56;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var moment=require(_0x216d('0x2'));var BPromise=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var fs=require('fs');var Redis=require(_0x216d('0x5'));var db=require(_0x216d('0x6'))['db'];var utils=require(_0x216d('0x7'));var logger=require(_0x216d('0x8'))('rpc');var config=require(_0x216d('0x9'));var jayson=require(_0x216d('0xa'));var client=jayson[_0x216d('0xb')][_0x216d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dd8e2,_0x24c831,_0x3e0ada){return new BPromise(function(_0x28da14,_0x57accc){return client[_0x216d('0xd')](_0x1dd8e2,_0x3e0ada)[_0x216d('0xe')](function(_0x35abcf){logger[_0x216d('0xf')](_0x216d('0x10'),_0x24c831,_0x216d('0x11'));logger['debug'](_0x216d('0x12'),_0x24c831,'request\x20sent',JSON[_0x216d('0x13')](_0x35abcf));if(_0x35abcf[_0x216d('0x14')]){if(_0x35abcf[_0x216d('0x14')][_0x216d('0x15')]===0x1f4){logger[_0x216d('0x14')](_0x216d('0x10'),_0x24c831,_0x35abcf['error'][_0x216d('0x16')]);return _0x57accc(_0x35abcf['error'][_0x216d('0x16')]);}logger[_0x216d('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x24c831,_0x35abcf[_0x216d('0x14')][_0x216d('0x16')]);return _0x28da14(_0x35abcf['error'][_0x216d('0x16')]);}else{logger['info'](_0x216d('0x10'),_0x24c831,_0x216d('0x11'));_0x28da14(_0x35abcf[_0x216d('0x17')][_0x216d('0x16')]);}})[_0x216d('0x18')](function(_0x304dfa){logger[_0x216d('0x14')](_0x216d('0x10'),_0x24c831,_0x304dfa);_0x57accc(_0x304dfa);});});}exports[_0x216d('0x19')]=function(_0x53d464){var _0x3b60dd=this;return new Promise(function(_0x5124ab,_0x4ddc51){return db[_0x216d('0x1a')][_0x216d('0x1b')](_0x53d464['body'],{'raw':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x216d('0xe')](function(_0x13b8e0){logger[_0x216d('0xf')](_0x216d('0x19'),_0x53d464);logger['debug'](_0x216d('0x19'),_0x53d464,JSON[_0x216d('0x13')](_0x13b8e0));_0x5124ab(_0x13b8e0);})[_0x216d('0x18')](function(_0x438981){logger[_0x216d('0x14')]('CreateCmHopperHistory',_0x438981[_0x216d('0x16')],_0x53d464);_0x4ddc51(_0x3b60dd[_0x216d('0x14')](0x1f4,_0x438981[_0x216d('0x16')]));});});};exports[_0x216d('0x1d')]=function(_0x6fa4b3){var _0x54d96f=this;return new Promise(function(_0x68d7,_0xab672){return db[_0x216d('0x1a')]['findAll']({'raw':_0x6fa4b3['options']?_0x6fa4b3['options']['raw']===undefined?!![]:![]:!![],'where':_0x6fa4b3['options']?_0x6fa4b3[_0x216d('0x1c')][_0x216d('0x1e')]||null:null,'attributes':[[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x216d('0x1f')]['fn']('COUNT',db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x22')))),_0x216d('0x23')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x24')))),_0x216d('0x25')],[db[_0x216d('0x1f')]['fn']('COUNT',db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x216d('0x26')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x27'),db[_0x216d('0x1f')]['fn']('IF',db['sequelize'][_0x216d('0x21')](_0x216d('0x28')))),_0x216d('0x29')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x27'),db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x2a')))),_0x216d('0x2b')]]})[_0x216d('0xe')](function(_0x4a2caa){logger[_0x216d('0xf')](_0x216d('0x1d'),_0x6fa4b3);logger[_0x216d('0x2c')]('AvgHandleTime',_0x6fa4b3,JSON[_0x216d('0x13')](_0x4a2caa));_0x68d7(_0x4a2caa);})[_0x216d('0x18')](function(_0x5701d2){logger[_0x216d('0x14')]('AvgHandleTime',_0x5701d2['message'],_0x6fa4b3);_0xab672(_0x54d96f[_0x216d('0x14')](0x1f4,_0x5701d2[_0x216d('0x16')]));});});};exports[_0x216d('0x2d')]=function(_0x2469e0){var _0x5c3f7c=this;return new Promise(function(_0x4fd477,_0x4e4c44){return db[_0x216d('0x1a')][_0x216d('0x2e')]({'raw':_0x2469e0['options']?_0x2469e0[_0x216d('0x1c')][_0x216d('0x2f')]===undefined?!![]:![]:!![],'where':_0x2469e0['options']?_0x2469e0[_0x216d('0x1c')][_0x216d('0x1e')]||null:null,'attributes':[[_0x216d('0x30'),_0x216d('0x31')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x216d('0x32')],[db[_0x216d('0x1f')]['fn']('COUNT',db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x216d('0x33')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['fn']('IF',db['sequelize'][_0x216d('0x21')](_0x216d('0x22')))),'outboundAnswerCallsDay'],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x216d('0x21')](_0x216d('0x34')))),_0x216d('0x35')],[db['sequelize']['fn'](_0x216d('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x216d('0x21')](_0x216d('0x36')))),_0x216d('0x37')],[db['sequelize']['fn'](_0x216d('0x20'),db['sequelize']['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x38')))),'outboundDropCallsDayTimeout'],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x39')))),_0x216d('0x3a')],[db[_0x216d('0x1f')]['fn']('COUNT',db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x3b')))),'outboundBlacklistCallsDay'],[db[_0x216d('0x1f')]['fn']('COUNT',db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x3c')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x216d('0x20'),db['sequelize']['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x216d('0x1f')]['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x3d')))),_0x216d('0x3e')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db['sequelize']['fn']('IF',db[_0x216d('0x1f')][_0x216d('0x21')](_0x216d('0x3f')))),'outboundReCallsDay']],'group':[_0x216d('0x30')]})[_0x216d('0xe')](function(_0x2c7c67){logger[_0x216d('0xf')]('GetVoiceQueueHopperHistory',_0x2469e0);logger[_0x216d('0x2c')](_0x216d('0x2d'),_0x2469e0,JSON[_0x216d('0x13')](_0x2c7c67));_0x4fd477(_0x2c7c67);})[_0x216d('0x18')](function(_0x4d7705){logger[_0x216d('0x14')](_0x216d('0x2d'),_0x4d7705['message'],_0x2469e0);_0x4e4c44(_0x5c3f7c[_0x216d('0x14')](0x1f4,_0x4d7705['message']));});});};exports[_0x216d('0x40')]=function(_0x40d07b){var _0x22e025=this;return new Promise(function(_0xe65193,_0x345196){return db[_0x216d('0x1a')][_0x216d('0x2e')]({'raw':_0x40d07b[_0x216d('0x1c')]?_0x40d07b[_0x216d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40d07b[_0x216d('0x1c')]?_0x40d07b[_0x216d('0x1c')]['where']||null:null,'attributes':[[_0x216d('0x30'),_0x216d('0x31')],[db['sequelize']['fn']('COUNT',db[_0x216d('0x1f')]['col']('id')),_0x216d('0x41')],[db[_0x216d('0x1f')]['fn'](_0x216d('0x20'),db['sequelize']['fn']('IF',db[_0x216d('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x216d('0x42')]],'group':[_0x216d('0x30')]})['then'](function(_0x181b8a){logger[_0x216d('0xf')](_0x216d('0x40'),_0x40d07b);logger[_0x216d('0x2c')](_0x216d('0x40'),_0x40d07b,JSON[_0x216d('0x13')](_0x181b8a));_0xe65193(_0x181b8a);})['catch'](function(_0x5d324e){logger[_0x216d('0x14')](_0x216d('0x40'),_0x5d324e[_0x216d('0x16')],_0x40d07b);_0x345196(_0x22e025[_0x216d('0x14')](0x1f4,_0x5d324e[_0x216d('0x16')]));});});}; \ No newline at end of file +var _0x4517=['ivrTotalCallsDays','GetCampaignHopperHistory','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','COUNT','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','where','campaign','name'];(function(_0x38bf5f,_0x18d825){var _0x3d65c8=function(_0x1321e1){while(--_0x1321e1){_0x38bf5f['push'](_0x38bf5f['shift']());}};_0x3d65c8(++_0x18d825);}(_0x4517,0x112));var _0x7451=function(_0x5860c4,_0x16e0f6){_0x5860c4=_0x5860c4-0x0;var _0x311879=_0x4517[_0x5860c4];return _0x311879;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var moment=require(_0x7451('0x1'));var BPromise=require('bluebird');var rs=require(_0x7451('0x2'));var fs=require('fs');var Redis=require(_0x7451('0x3'));var db=require(_0x7451('0x4'))['db'];var utils=require(_0x7451('0x5'));var logger=require(_0x7451('0x6'))(_0x7451('0x7'));var config=require(_0x7451('0x8'));var jayson=require(_0x7451('0x9'));var client=jayson[_0x7451('0xa')][_0x7451('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ac271,_0x1bfc08,_0x26306e){return new BPromise(function(_0x443b80,_0x2c2ace){return client[_0x7451('0xc')](_0x3ac271,_0x26306e)[_0x7451('0xd')](function(_0x4b7888){logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));logger[_0x7451('0x11')](_0x7451('0x12'),_0x1bfc08,_0x7451('0x10'),JSON[_0x7451('0x13')](_0x4b7888));if(_0x4b7888['error']){if(_0x4b7888['error'][_0x7451('0x14')]===0x1f4){logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')]['message']);return _0x2c2ace(_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);}logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);return _0x443b80(_0x4b7888[_0x7451('0x15')]['message']);}else{logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));_0x443b80(_0x4b7888['result']['message']);}})[_0x7451('0x17')](function(_0x1db688){logger[_0x7451('0x15')](_0x7451('0xf'),_0x1bfc08,_0x1db688);_0x2c2ace(_0x1db688);});});}exports[_0x7451('0x18')]=function(_0xd47ee4){var _0x31a4b2=this;return new Promise(function(_0x1120b1,_0x125ab1){return db['CmHopperHistory'][_0x7451('0x19')](_0xd47ee4[_0x7451('0x1a')],{'raw':_0xd47ee4[_0x7451('0x1b')]?_0xd47ee4['options'][_0x7451('0x1c')]===undefined?!![]:![]:!![]})[_0x7451('0xd')](function(_0x3ffb08){logger[_0x7451('0xe')](_0x7451('0x18'),_0xd47ee4);logger[_0x7451('0x11')](_0x7451('0x18'),_0xd47ee4,JSON['stringify'](_0x3ffb08));_0x1120b1(_0x3ffb08);})[_0x7451('0x17')](function(_0x309be0){logger['error'](_0x7451('0x18'),_0x309be0[_0x7451('0x16')],_0xd47ee4);_0x125ab1(_0x31a4b2[_0x7451('0x15')](0x1f4,_0x309be0['message']));});});};exports[_0x7451('0x1d')]=function(_0x21dd67){var _0x21cc22=this;return new Promise(function(_0x1fc076,_0x37bc47){return db[_0x7451('0x1e')][_0x7451('0x1f')]({'raw':_0x21dd67[_0x7451('0x1b')]?_0x21dd67[_0x7451('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21dd67[_0x7451('0x1b')]?_0x21dd67[_0x7451('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')][_0x7451('0x22')]('id')),_0x7451('0x23')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db['sequelize']['fn']('IF',db[_0x7451('0x21')]['literal'](_0x7451('0x24')))),_0x7451('0x25')],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db['sequelize'][_0x7451('0x26')](_0x7451('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0x7451('0x29'),db[_0x7451('0x21')]['fn']('IF',db['sequelize']['literal'](_0x7451('0x2a')))),_0x7451('0x2b')],[db[_0x7451('0x21')]['fn'](_0x7451('0x29'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x2c')))),'predictiveIntervalAvgTalktime']]})[_0x7451('0xd')](function(_0x11aead){logger['info'](_0x7451('0x1d'),_0x21dd67);logger[_0x7451('0x11')](_0x7451('0x1d'),_0x21dd67,JSON[_0x7451('0x13')](_0x11aead));_0x1fc076(_0x11aead);})[_0x7451('0x17')](function(_0x40af89){logger['error'](_0x7451('0x1d'),_0x40af89[_0x7451('0x16')],_0x21dd67);_0x37bc47(_0x21cc22['error'](0x1f4,_0x40af89[_0x7451('0x16')]));});});};exports[_0x7451('0x2d')]=function(_0x4e761d){var _0x5820e2=this;return new Promise(function(_0x59393b,_0x54b60f){return db['CmHopperHistory'][_0x7451('0x1f')]({'raw':_0x4e761d[_0x7451('0x1b')]?_0x4e761d[_0x7451('0x1b')][_0x7451('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e761d[_0x7451('0x1b')]?_0x4e761d['options']['where']||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x2e')))),_0x7451('0x2f')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x7451('0x21')]['fn']('COUNT',db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7451('0x30')],[db['sequelize']['fn'](_0x7451('0x20'),db['sequelize']['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')]('`state`\x20=\x205,\x201,\x20null'))),_0x7451('0x31')],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x32')))),_0x7451('0x33')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x34')))),_0x7451('0x35')],[db[_0x7451('0x21')]['fn']('COUNT',db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x36')))),'outboundDropCallsDayCallersExit'],[db[_0x7451('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x7451('0x37')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db['sequelize']['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x38')))),_0x7451('0x39')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x7451('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x3a')))),_0x7451('0x3b')],[db[_0x7451('0x21')]['fn']('COUNT',db[_0x7451('0x21')]['fn']('IF',db['sequelize'][_0x7451('0x26')](_0x7451('0x3c')))),_0x7451('0x3d')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x3e')))),'outboundReCallsDay']],'group':['campaign']})[_0x7451('0xd')](function(_0x94f802){logger['info']('GetVoiceQueueHopperHistory',_0x4e761d);logger['debug'](_0x7451('0x2d'),_0x4e761d,JSON[_0x7451('0x13')](_0x94f802));_0x59393b(_0x94f802);})[_0x7451('0x17')](function(_0x22c4db){logger[_0x7451('0x15')](_0x7451('0x2d'),_0x22c4db['message'],_0x4e761d);_0x54b60f(_0x5820e2[_0x7451('0x15')](0x1f4,_0x22c4db['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5e6649){var _0x107039=this;return new Promise(function(_0x3db1fe,_0x2548be){return db[_0x7451('0x1e')][_0x7451('0x1f')]({'raw':_0x5e6649[_0x7451('0x1b')]?_0x5e6649[_0x7451('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5e6649[_0x7451('0x1b')]?_0x5e6649[_0x7451('0x1b')][_0x7451('0x3f')]||null:null,'attributes':[[_0x7451('0x40'),_0x7451('0x41')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db['sequelize'][_0x7451('0x22')]('id')),_0x7451('0x42')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')]['literal'](_0x7451('0x24')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x7451('0xd')](function(_0x2282b9){logger[_0x7451('0xe')](_0x7451('0x43'),_0x5e6649);logger[_0x7451('0x11')](_0x7451('0x43'),_0x5e6649,JSON['stringify'](_0x2282b9));_0x3db1fe(_0x2282b9);})[_0x7451('0x17')](function(_0x528c4b){logger[_0x7451('0x15')](_0x7451('0x43'),_0x528c4b['message'],_0x5e6649);_0x2548be(_0x107039['error'](0x1f4,_0x528c4b['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 99820b3..3e4f8ba 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 _0x8706=['isAuthenticated','describe','show','post','put','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x1bb31c,_0xfba3f1){var _0x3b9fcf=function(_0x1570b4){while(--_0x1570b4){_0x1bb31c['push'](_0x1bb31c['shift']());}};_0x3b9fcf(++_0xfba3f1);}(_0x8706,0xf4));var _0x6870=function(_0xf69e3c,_0xb098fe){_0xf69e3c=_0xf69e3c-0x0;var _0x2e253a=_0x8706[_0xf69e3c];return _0x2e253a;};'use strict';var multer=require(_0x6870('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6870('0x1'));var express=require(_0x6870('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6870('0x3'));var interaction=require(_0x6870('0x4'));var config=require(_0x6870('0x5'));var controller=require(_0x6870('0x6'));router[_0x6870('0x7')]('/',auth[_0x6870('0x8')](),controller['index']);router[_0x6870('0x7')]('/describe',auth[_0x6870('0x8')](),controller[_0x6870('0x9')]);router[_0x6870('0x7')]('/:id',auth[_0x6870('0x8')](),controller[_0x6870('0xa')]);router[_0x6870('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6870('0xc')]('/:id',auth[_0x6870('0x8')](),controller['update']);module[_0x6870('0xd')]=router; \ No newline at end of file +var _0xd6a6=['/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xd6a6,0x126));var _0x6d6a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6a6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6d6a('0x0'));var util=require(_0x6d6a('0x1'));var path=require(_0x6d6a('0x2'));var timeout=require(_0x6d6a('0x3'));var express=require('express');var router=express[_0x6d6a('0x4')]();var fs_extra=require(_0x6d6a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d6a('0x6'));var controller=require(_0x6d6a('0x7'));router[_0x6d6a('0x8')]('/',auth[_0x6d6a('0x9')](),controller['index']);router[_0x6d6a('0x8')](_0x6d6a('0xa'),auth[_0x6d6a('0x9')](),controller[_0x6d6a('0xb')]);router[_0x6d6a('0x8')](_0x6d6a('0xc'),auth[_0x6d6a('0x9')](),controller[_0x6d6a('0xd')]);router[_0x6d6a('0xe')]('/',auth['isAuthenticated'](),controller[_0x6d6a('0xf')]);router[_0x6d6a('0x10')](_0x6d6a('0xc'),auth[_0x6d6a('0x9')](),controller[_0x6d6a('0x11')]);module[_0x6d6a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index eccb342..bfd8424 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 _0xe647=['STRING','sequelize','exports','name'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xe647,0x16d));var _0x7e64=function(_0x42c7e7,_0x2ae3f6){_0x42c7e7=_0x42c7e7-0x0;var _0x534232=_0xe647[_0x42c7e7];return _0x534232;};'use strict';var Sequelize=require(_0x7e64('0x0'));module[_0x7e64('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7e64('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7e64('0x3')]},'dialPrefix':{'type':Sequelize[_0x7e64('0x3')]}}; \ No newline at end of file +var _0x308a=['STRING','name','sequelize'];(function(_0x20be95,_0x3a60f8){var _0x661441=function(_0x59925b){while(--_0x59925b){_0x20be95['push'](_0x20be95['shift']());}};_0x661441(++_0x3a60f8);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa308('0x0'));module['exports']={'name':{'type':Sequelize[_0xa308('0x1')],'unique':_0xa308('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa308('0x1')]},'dialPrefix':{'type':Sequelize[_0xa308('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 24a2b90..140b0b8 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 _0x6383=['../../mysqldb','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','map','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','CmList','include','rows','show','params','rawAttributes','length','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','destroy','describe','addDisposition','ListId','getDispositions','Disposition','pick','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','c.cf_','customField_','field','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','queryInterface','addColumn','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','message','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x49bacf,_0x423e98){var _0x4c2361=function(_0x59ee45){while(--_0x59ee45){_0x49bacf['push'](_0x49bacf['shift']());}};_0x4c2361(++_0x423e98);}(_0x6383,0x124));var _0x3638=function(_0xb68b6b,_0x4d96b9){_0xb68b6b=_0xb68b6b-0x0;var _0x4ba4b2=_0x6383[_0xb68b6b];return _0x4ba4b2;};'use strict';var emlformat=require(_0x3638('0x0'));var rimraf=require(_0x3638('0x1'));var zipdir=require(_0x3638('0x2'));var jsonpatch=require(_0x3638('0x3'));var rp=require(_0x3638('0x4'));var moment=require(_0x3638('0x5'));var BPromise=require(_0x3638('0x6'));var Mustache=require(_0x3638('0x7'));var util=require(_0x3638('0x8'));var path=require(_0x3638('0x9'));var sox=require('sox');var csv=require(_0x3638('0xa'));var ejs=require(_0x3638('0xb'));var fs=require('fs');var fs_extra=require(_0x3638('0xc'));var _=require(_0x3638('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3638('0xe'));var deskjs=require(_0x3638('0xf'));var toCsv=require(_0x3638('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3638('0x10'));var as=require(_0x3638('0x11'));var hardwareService=require(_0x3638('0x12'));var logger=require('../../config/logger')(_0x3638('0x13'));var utils=require('../../config/utils');var config=require(_0x3638('0x14'));var licenseUtil=require(_0x3638('0x15'));var db=require(_0x3638('0x16'))['db'];var csv_results;config[_0x3638('0x17')]=_[_0x3638('0x18')](config[_0x3638('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3638('0x19'))(new Redis(config[_0x3638('0x17')]));require('./cmList.socket')[_0x3638('0x1a')](socket);function respondWithStatusCode(_0x293e4f,_0x237fc1){_0x237fc1=_0x237fc1||0xcc;return function(_0x1367ca){if(_0x1367ca){return _0x293e4f['sendStatus'](_0x237fc1);}return _0x293e4f['status'](_0x237fc1)[_0x3638('0x1b')]();};}function respondWithResult(_0x757315,_0x4e1865){_0x4e1865=_0x4e1865||0xc8;return function(_0x150a3d){if(_0x150a3d){return _0x757315[_0x3638('0x1c')](_0x4e1865)[_0x3638('0x1d')](_0x150a3d);}};}function respondWithFilteredResult(_0x34f48e,_0x22baac){return function(_0x3b0186){if(_0x3b0186){var _0x4e29ad=typeof _0x22baac[_0x3638('0x1e')]==='undefined'&&typeof _0x22baac['limit']===_0x3638('0x1f');var _0x49315e=_0x3b0186[_0x3638('0x20')];var _0x19fa40=_0x4e29ad?0x0:_0x22baac['offset'];var _0x545087=_0x4e29ad?_0x3b0186[_0x3638('0x20')]:_0x22baac[_0x3638('0x1e')]+_0x22baac['limit'];var _0x3ea561;if(_0x545087>=_0x49315e){_0x545087=_0x49315e;_0x3ea561=0xc8;}else{_0x3ea561=0xce;}_0x34f48e['status'](_0x3ea561);return _0x34f48e['set'](_0x3638('0x21'),_0x19fa40+'-'+_0x545087+'/'+_0x49315e)['json'](_0x3b0186);}return null;};}function patchUpdates(_0x26c179){return function(_0x50dc9c){try{jsonpatch[_0x3638('0x22')](_0x50dc9c,_0x26c179,!![]);}catch(_0x1019c5){return BPromise[_0x3638('0x23')](_0x1019c5);}return _0x50dc9c[_0x3638('0x24')]();};}function saveUpdates(_0x4e2e7f,_0x489fc3){return function(_0x4cf41a){if(_0x4cf41a){return _0x4cf41a[_0x3638('0x25')](_0x4e2e7f)['then'](function(_0x386643){return _0x386643;});}return null;};}function removeEntity(_0x6f5db1,_0x445f50){return function(_0x37e3c5){if(_0x37e3c5){return _0x37e3c5['destroy']()[_0x3638('0x26')](function(){var _0x3d8dc9=_0x37e3c5[_0x3638('0x27')]({'plain':!![]});var _0x27766b='Lists';return db[_0x3638('0x28')]['destroy']({'where':{'type':_0x27766b,'resourceId':_0x3d8dc9['id']}})['then'](function(){return _0x37e3c5;});})[_0x3638('0x26')](function(){_0x6f5db1[_0x3638('0x1c')](0xcc)[_0x3638('0x1b')]();});}};}function handleEntityNotFound(_0x129d99,_0x3f9634){return function(_0xd4ea76){if(!_0xd4ea76){_0x129d99['sendStatus'](0x194);}return _0xd4ea76;};}function handleError(_0xd163a0,_0x24ded6){_0x24ded6=_0x24ded6||0x1f4;return function(_0x429977){logger[_0x3638('0x29')](_0x429977[_0x3638('0x2a')]);if(_0x429977[_0x3638('0x2b')]){delete _0x429977[_0x3638('0x2b')];}_0xd163a0[_0x3638('0x1c')](_0x24ded6)['send'](_0x429977);};}exports['index']=function(_0x405062,_0x354304){var _0x571f84={},_0x3e217a={},_0x3edc34={'count':0x0,'rows':[]};var _0x3ea384=_[_0x3638('0x2c')](db['CmList']['rawAttributes'],function(_0x1f05d8){return{'name':_0x1f05d8['fieldName'],'type':_0x1f05d8[_0x3638('0x2d')][_0x3638('0x2e')]};});_0x3e217a['model']=_[_0x3638('0x2c')](_0x3ea384,_0x3638('0x2b'));_0x3e217a[_0x3638('0x2f')]=_[_0x3638('0x30')](_0x405062['query']);_0x3e217a[_0x3638('0x31')]=_['intersection'](_0x3e217a[_0x3638('0x32')],_0x3e217a['query']);_0x571f84[_0x3638('0x33')]=_[_0x3638('0x34')](_0x3e217a['model'],qs[_0x3638('0x35')](_0x405062['query'][_0x3638('0x35')]));_0x571f84[_0x3638('0x33')]=_0x571f84[_0x3638('0x33')]['length']?_0x571f84[_0x3638('0x33')]:_0x3e217a[_0x3638('0x32')];if(!_0x405062[_0x3638('0x2f')][_0x3638('0x36')](_0x3638('0x37'))){_0x571f84[_0x3638('0x38')]=qs[_0x3638('0x38')](_0x405062[_0x3638('0x2f')][_0x3638('0x38')]);_0x571f84[_0x3638('0x1e')]=qs[_0x3638('0x1e')](_0x405062[_0x3638('0x2f')][_0x3638('0x1e')]);}_0x571f84[_0x3638('0x39')]=qs[_0x3638('0x3a')](_0x405062[_0x3638('0x2f')][_0x3638('0x3a')]);_0x571f84['where']=qs[_0x3638('0x31')](_['pick'](_0x405062[_0x3638('0x2f')],_0x3e217a[_0x3638('0x31')]),_0x3ea384);if(_0x405062[_0x3638('0x2f')][_0x3638('0x3b')]){_0x571f84[_0x3638('0x3c')]=_[_0x3638('0x3d')](_0x571f84[_0x3638('0x3c')],{'$or':_[_0x3638('0x2c')](_0x3ea384,function(_0x5cf40e){if(_0x5cf40e[_0x3638('0x2d')]!==_0x3638('0x3e')){var _0x39f832={};_0x39f832[_0x5cf40e[_0x3638('0x2b')]]={'$like':'%'+_0x405062[_0x3638('0x2f')][_0x3638('0x3b')]+'%'};return _0x39f832;}})});}_0x571f84=_[_0x3638('0x3d')]({},_0x571f84,_0x405062[_0x3638('0x3f')]);var _0x50ba22={'where':_0x571f84[_0x3638('0x3c')]};return db[_0x3638('0x40')][_0x3638('0x20')](_0x50ba22)['then'](function(_0xa3b503){_0x3edc34[_0x3638('0x20')]=_0xa3b503;if(_0x405062['query']['includeAll']){_0x571f84[_0x3638('0x41')]=[{'all':!![]}];}return db[_0x3638('0x40')]['findAll'](_0x571f84);})[_0x3638('0x26')](function(_0x4b329a){_0x3edc34[_0x3638('0x42')]=_0x4b329a;return _0x3edc34;})[_0x3638('0x26')](respondWithFilteredResult(_0x354304,_0x571f84))['catch'](handleError(_0x354304,null));};exports[_0x3638('0x43')]=function(_0x57f3cd,_0x88ecd9){var _0x26f587={'raw':![],'where':{'id':_0x57f3cd[_0x3638('0x44')]['id']}},_0x4e0095={};_0x4e0095['model']=_[_0x3638('0x30')](db[_0x3638('0x40')][_0x3638('0x45')]);_0x4e0095[_0x3638('0x2f')]=_['keys'](_0x57f3cd['query']);_0x4e0095[_0x3638('0x31')]=_[_0x3638('0x34')](_0x4e0095['model'],_0x4e0095[_0x3638('0x2f')]);_0x26f587[_0x3638('0x33')]=_[_0x3638('0x34')](_0x4e0095[_0x3638('0x32')],qs[_0x3638('0x35')](_0x57f3cd[_0x3638('0x2f')][_0x3638('0x35')]));_0x26f587[_0x3638('0x33')]=_0x26f587['attributes'][_0x3638('0x46')]?_0x26f587[_0x3638('0x33')]:_0x4e0095[_0x3638('0x32')];if(_0x57f3cd[_0x3638('0x2f')][_0x3638('0x47')]){_0x26f587['include']=[{'all':!![]}];}_0x26f587=_[_0x3638('0x3d')]({},_0x26f587,_0x57f3cd[_0x3638('0x3f')]);return db[_0x3638('0x40')]['find'](_0x26f587)[_0x3638('0x26')](handleEntityNotFound(_0x88ecd9,null))[_0x3638('0x26')](respondWithResult(_0x88ecd9,null))[_0x3638('0x48')](handleError(_0x88ecd9,null));};exports[_0x3638('0x49')]=function(_0x57cee9,_0x3fd014){return db[_0x3638('0x40')][_0x3638('0x49')](_0x57cee9[_0x3638('0x4a')],{})[_0x3638('0x26')](function(_0x3f05f0){var _0x598df7=_0x57cee9[_0x3638('0x4b')][_0x3638('0x27')]({'plain':!![]});if(!_0x598df7)throw new Error(_0x3638('0x4c'));if(_0x598df7[_0x3638('0x4d')]===_0x3638('0x4b')){var _0x5c5a2d=_0x3f05f0[_0x3638('0x27')]({'plain':!![]});var _0xe65c6d='Lists';return db['UserProfileSection'][_0x3638('0x4e')]({'where':{'name':_0xe65c6d,'userProfileId':_0x598df7[_0x3638('0x4f')]},'raw':!![]})[_0x3638('0x26')](function(_0x54a263){if(_0x54a263&&_0x54a263[_0x3638('0x50')]===0x0){return db[_0x3638('0x28')][_0x3638('0x49')]({'name':_0x5c5a2d[_0x3638('0x2b')],'resourceId':_0x5c5a2d['id'],'type':_0x54a263[_0x3638('0x2b')],'sectionId':_0x54a263['id']},{})[_0x3638('0x26')](function(){return _0x3f05f0;});}else{return _0x3f05f0;}})['catch'](function(_0x171d7f){logger[_0x3638('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x171d7f);throw _0x171d7f;});}return _0x3f05f0;})['then'](respondWithResult(_0x3fd014,0xc9))[_0x3638('0x48')](handleError(_0x3fd014,null));};exports[_0x3638('0x25')]=function(_0x24ce96,_0x485249){if(_0x24ce96[_0x3638('0x4a')]['id']){delete _0x24ce96[_0x3638('0x4a')]['id'];}return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x24ce96[_0x3638('0x44')]['id']}})[_0x3638('0x26')](handleEntityNotFound(_0x485249,null))[_0x3638('0x26')](saveUpdates(_0x24ce96[_0x3638('0x4a')],null))[_0x3638('0x26')](respondWithResult(_0x485249,null))[_0x3638('0x48')](handleError(_0x485249,null));};exports[_0x3638('0x51')]=function(_0x3213a1,_0x16df21){return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x3213a1[_0x3638('0x44')]['id']}})[_0x3638('0x26')](handleEntityNotFound(_0x16df21,null))[_0x3638('0x26')](removeEntity(_0x16df21,null))[_0x3638('0x48')](handleError(_0x16df21,null));};exports[_0x3638('0x52')]=function(_0x18b7de,_0x32cc45){return db['CmList'][_0x3638('0x52')]()['then'](respondWithResult(_0x32cc45,null))['catch'](handleError(_0x32cc45,null));};exports[_0x3638('0x53')]=function(_0x117af3,_0x195f5c,_0x5e0bdb){if(_0x117af3[_0x3638('0x4a')]['id']){delete _0x117af3[_0x3638('0x4a')]['id'];}return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x117af3['params']['id']}})['then'](handleEntityNotFound(_0x195f5c,null))[_0x3638('0x26')](function(_0x58b46e){if(_0x58b46e){_0x117af3[_0x3638('0x4a')][_0x3638('0x54')]=_0x58b46e['id'];return db['Disposition'][_0x3638('0x49')](_0x117af3['body']);}})[_0x3638('0x26')](respondWithResult(_0x195f5c,null))[_0x3638('0x48')](handleError(_0x195f5c,null));};exports[_0x3638('0x55')]=function(_0x545fcc,_0x26dbcd,_0x311bbf){var _0xba4dd4={'raw':![],'where':{}};var _0x1354fe={};var _0x18637a={'count':0x0,'rows':[]};return db[_0x3638('0x40')]['findOne']({'where':{'id':_0x545fcc[_0x3638('0x44')]['id']}})['then'](handleEntityNotFound(_0x26dbcd,null))[_0x3638('0x26')](function(_0x3821b4){if(_0x3821b4){_0x1354fe[_0x3638('0x32')]=_[_0x3638('0x30')](db[_0x3638('0x56')][_0x3638('0x45')]);_0x1354fe['query']=_[_0x3638('0x30')](_0x545fcc[_0x3638('0x2f')]);_0x1354fe[_0x3638('0x31')]=_['intersection'](_0x1354fe[_0x3638('0x32')],_0x1354fe[_0x3638('0x2f')]);_0xba4dd4[_0x3638('0x33')]=_[_0x3638('0x34')](_0x1354fe[_0x3638('0x32')],qs[_0x3638('0x35')](_0x545fcc[_0x3638('0x2f')][_0x3638('0x35')]));_0xba4dd4[_0x3638('0x33')]=_0xba4dd4[_0x3638('0x33')][_0x3638('0x46')]?_0xba4dd4[_0x3638('0x33')]:_0x1354fe['model'];if(!_0x545fcc[_0x3638('0x2f')][_0x3638('0x36')](_0x3638('0x37'))){_0xba4dd4['limit']=qs[_0x3638('0x38')](_0x545fcc[_0x3638('0x2f')]['limit']);_0xba4dd4['offset']=qs[_0x3638('0x1e')](_0x545fcc[_0x3638('0x2f')]['offset']);}_0xba4dd4[_0x3638('0x39')]=qs[_0x3638('0x3a')](_0x545fcc[_0x3638('0x2f')][_0x3638('0x3a')]);_0xba4dd4[_0x3638('0x3c')]=qs[_0x3638('0x31')](_[_0x3638('0x57')](_0x545fcc[_0x3638('0x2f')],_0x1354fe[_0x3638('0x31')]));_0xba4dd4[_0x3638('0x3c')]['ListId']=_0x3821b4['id'];if(_0x545fcc[_0x3638('0x2f')]['filter']){_0xba4dd4['where']=_[_0x3638('0x3d')](_0xba4dd4[_0x3638('0x3c')],{'$or':_[_0x3638('0x2c')](_0xba4dd4[_0x3638('0x33')],function(_0x317529){var _0x2ae60c={};_0x2ae60c[_0x317529]={'$like':'%'+_0x545fcc['query']['filter']+'%'};return _0x2ae60c;})});}_0xba4dd4=_[_0x3638('0x3d')]({},_0xba4dd4,_0x545fcc[_0x3638('0x3f')]);return db['Disposition'][_0x3638('0x20')]({'where':_0xba4dd4[_0x3638('0x3c')]})[_0x3638('0x26')](function(_0x4013a7){_0x18637a[_0x3638('0x20')]=_0x4013a7;if(_0x545fcc[_0x3638('0x2f')][_0x3638('0x47')]){_0xba4dd4[_0x3638('0x41')]=[{'all':!![]}];}return db['Disposition'][_0x3638('0x58')](_0xba4dd4);})[_0x3638('0x26')](function(_0x2e6df4){_0x18637a[_0x3638('0x42')]=_0x2e6df4;return _0x18637a;});}})['then'](respondWithFilteredResult(_0x26dbcd,_0xba4dd4))[_0x3638('0x48')](handleError(_0x26dbcd,null));};exports['removeDispositions']=function(_0x5464bb,_0x4d347b,_0x200514){return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x5464bb['params']['id']}})[_0x3638('0x26')](handleEntityNotFound(_0x4d347b,null))[_0x3638('0x26')](function(_0x2dd347){if(_0x2dd347){return _0x2dd347[_0x3638('0x59')](_0x5464bb[_0x3638('0x2f')][_0x3638('0x5a')]);}})['then'](respondWithStatusCode(_0x4d347b,null))[_0x3638('0x48')](handleError(_0x4d347b,null));};exports[_0x3638('0x5b')]=function(_0x2c17a8,_0x20d127,_0x3ae79f){return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x2c17a8[_0x3638('0x44')]['id']}})[_0x3638('0x26')](handleEntityNotFound(_0x20d127,null))[_0x3638('0x26')](function(_0x2240c1){if(_0x2240c1){var _0x47b4b1=[];var _0x58c55f={'success':[],'errors':[]};return db[_0x3638('0x5c')][_0x3638('0x52')]()[_0x3638('0x26')](function(_0x4f22c3){if(_0x2c17a8['body'][_0x3638('0x5d')]&&_[_0x3638('0x5e')](_0x2c17a8[_0x3638('0x4a')][_0x3638('0x5d')])){if(_0x2c17a8[_0x3638('0x4a')][_0x3638('0x5d')]['length']){_0x2c17a8['body']['tags']=_0x2c17a8[_0x3638('0x4a')][_0x3638('0x5d')]['join'](';')+';';}else{_0x2c17a8[_0x3638('0x4a')][_0x3638('0x5d')]=null;}}else{_0x2c17a8['body'][_0x3638('0x5d')]=null;}if(_0x2c17a8['body']&&_[_0x3638('0x5e')](_0x2c17a8[_0x3638('0x4a')])){for(var _0x6dcfd8=0x0;_0x6dcfd8<_0x2c17a8[_0x3638('0x4a')]['length'];_0x6dcfd8+=0x1){_0x2c17a8[_0x3638('0x4a')][_0x6dcfd8]['ListId']=_0x2c17a8['params']['id'];_0x47b4b1[_0x3638('0x5f')](_0x2c17a8[_0x3638('0x4a')][_0x6dcfd8]);}return BPromise['each'](_0x47b4b1,function(_0x471016){return db[_0x3638('0x5c')][_0x3638('0x49')](_['omit'](_0x471016,['ids','id'])||{},{'fields':_[_0x3638('0x30')](_0x4f22c3),'raw':!![]})[_0x3638('0x26')](function(_0x4d868d){_0x58c55f[_0x3638('0x60')][_0x3638('0x5f')](_0x4d868d[_0x3638('0x61')]);})[_0x3638('0x48')](function(_0x168b22){_0x58c55f[_0x3638('0x62')][_0x3638('0x5f')]({'data':_0x471016,'error':_0x168b22['message']});});})['then'](function(_0x3b3c8d){return _0x58c55f;})[_0x3638('0x48')](function(_0x4c7d44){return _0x4c7d44;});}else{_0x20d127[_0x3638('0x1c')](0x190)[_0x3638('0x1d')]({'message':_0x3638('0x63')});}});}})['then'](respondWithResult(_0x20d127,null))[_0x3638('0x48')](handleError(_0x20d127,null));};exports[_0x3638('0x64')]=function(_0x4a7e13,_0x1735cb,_0x27c7a6){var _0x2a5080;return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x4a7e13[_0x3638('0x44')]['id']},'include':[{'model':db[_0x3638('0x65')],'as':_0x3638('0x66')}]})['then'](handleEntityNotFound(_0x1735cb,null))[_0x3638('0x26')](function(_0x454e33){if(_0x454e33){_0x2a5080=_0x454e33;return db[_0x3638('0x5c')]['rawAttributes'];}})[_0x3638('0x26')](function(_0x3f67cd){if(_0x3f67cd){var _0x27c754={};var _0x2fe5dd={};_0x2fe5dd[_0x3638('0x32')]=_[_0x3638('0x67')](_['keys'](_0x3f67cd),_[_0x3638('0x2c')](_0x2a5080[_0x3638('0x66')],function(_0x273a76){return util[_0x3638('0x68')](_0x3638('0x69'),_0x273a76['id']);}));_0x2fe5dd[_0x3638('0x2f')]=_[_0x3638('0x30')](_0x4a7e13[_0x3638('0x2f')]);_0x2fe5dd['filters']=_['intersection'](_0x2fe5dd['model'],_0x2fe5dd['query']);_0x27c754[_0x3638('0x33')]=_['intersection'](_0x2fe5dd[_0x3638('0x32')],qs['fields'](_0x4a7e13[_0x3638('0x2f')][_0x3638('0x35')]));_0x27c754['attributes']=_0x27c754[_0x3638('0x33')]['length']?_0x27c754['attributes']:_0x2fe5dd[_0x3638('0x32')];if(!_0x4a7e13['query'][_0x3638('0x36')](_0x3638('0x37'))){_0x27c754[_0x3638('0x38')]=qs[_0x3638('0x38')](_0x4a7e13[_0x3638('0x2f')][_0x3638('0x38')]);_0x27c754[_0x3638('0x1e')]=qs[_0x3638('0x1e')](_0x4a7e13[_0x3638('0x2f')][_0x3638('0x1e')]);}_0x27c754[_0x3638('0x39')]=qs[_0x3638('0x3a')](_0x4a7e13[_0x3638('0x2f')][_0x3638('0x3a')]);_0x27c754['where']=qs['filters'](_[_0x3638('0x57')](_0x4a7e13[_0x3638('0x2f')],_0x2fe5dd['filters']));_0x27c754[_0x3638('0x6a')]=!![];if(_0x4a7e13['query'][_0x3638('0x3b')]){_0x27c754[_0x3638('0x3c')]=_[_0x3638('0x3d')](_0x27c754[_0x3638('0x3c')],{'$or':_[_0x3638('0x2c')](_0x27c754['attributes'],function(_0x246f6e){var _0x8a06a6={};_0x8a06a6[_0x246f6e]={'$like':'%'+_0x4a7e13[_0x3638('0x2f')]['filter']+'%'};return _0x8a06a6;})});}_0x27c754=_[_0x3638('0x3d')]({},_0x27c754,_0x4a7e13[_0x3638('0x3f')]);return _0x2a5080[_0x3638('0x64')](_0x27c754);}})[_0x3638('0x26')](respondWithResult(_0x1735cb,null))['catch'](handleError(_0x1735cb,null));};exports[_0x3638('0x6b')]=function(_0x1736a9,_0x3d9504,_0x408562){var _0x55bbb4;var _0x12425f;var _0x50633a;var _0x257ee2=_0x1736a9[_0x3638('0x44')]['id'];csv_results=[];return db[_0x3638('0x6c')]['findAll']({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x3638('0x26')](function(_0x119dac){_0x55bbb4=_0x119dac;var _0x85ccad=_[_0x3638('0x30')](db[_0x3638('0x5c')]['rawAttributes']);return db[_0x3638('0x65')][_0x3638('0x58')]({'raw':!![],'attributes':['id',_0x3638('0x6d')]})[_0x3638('0x26')](function(_0x5851af){_0x12425f=_0x5851af;var _0x5336c5=squel[_0x3638('0x6e')]()['fields'](_0x85ccad)[_0x3638('0x6f')](_0x3638('0x70'),'c')[_0x3638('0x3c')](_0x3638('0x71'),_0x257ee2)[_0x3638('0x3c')]('c.deletedAt\x20is\x20null')[_0x3638('0x72')]();for(var _0x1099ec=0x0;_0x1099ec<_0x12425f[_0x3638('0x46')];_0x1099ec++){_0x5336c5['field'](_0x3638('0x73')+_0x12425f[_0x1099ec]['id'],_0x3638('0x74')+_0x12425f[_0x1099ec]['alias']);}for(var _0x1099ec=0x0;_0x1099ec<_0x55bbb4[_0x3638('0x46')];_0x1099ec++){_0x5336c5[_0x3638('0x75')](squel[_0x3638('0x6e')]()['field'](_0x3638('0x76'))['from'](_0x3638('0x77'))[_0x3638('0x3c')]('ItemTypeId\x20=\x20?',_0x55bbb4[_0x1099ec]['id'])['where'](_0x3638('0x78')),_0x3638('0x79')+_0x55bbb4[_0x1099ec][_0x3638('0x2b')]);_0x5336c5[_0x3638('0x75')](squel['select']()['field'](_0x3638('0x7a'))[_0x3638('0x6f')](_0x3638('0x77'))[_0x3638('0x3c')]('ItemTypeId\x20=\x20?',_0x55bbb4[_0x1099ec]['id'])[_0x3638('0x3c')](_0x3638('0x78')),_0x3638('0x7b')+_0x55bbb4[_0x1099ec][_0x3638('0x2b')]);}var _0x42d07a=[];_0x42d07a['push'](_0x5336c5[_0x3638('0x7c')]());BPromise['each'](_0x42d07a,handleQuery)[_0x3638('0x26')](function(_0x25c677){handleQuery(_0x5336c5[_0x3638('0x7c')]());var _0x5272e1=csv_results[0x0];if(!_['isEmpty'](_0x5272e1)){var _0x48e2ce=toCsv(_0x5272e1);var _0x175cc6=Date[_0x3638('0x7d')]();fs[_0x3638('0x7e')](util[_0x3638('0x68')](_0x3638('0x7f'),_0x257ee2,_0x175cc6),_0x48e2ce);_0x3d9504[_0x3638('0x80')](_0x3638('0x81'),_0x3638('0x82')+util['format'](_0x3638('0x83'),_0x257ee2,_0x175cc6));_0x3d9504[_0x3638('0x80')](_0x3638('0x84'),'text/csv');return _0x3d9504['download'](util[_0x3638('0x68')](_0x3638('0x7f'),_0x257ee2,_0x175cc6));}else{return _0x3d9504['sendStatus'](0xcc);}});});});};exports[_0x3638('0x85')]=function(_0x39b685,_0x2d31ab,_0x80984d){var _0x45b4c6;delete _0x39b685['body']['id'];return db[_0x3638('0x40')][_0x3638('0x86')]({'where':{'id':_0x39b685[_0x3638('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d31ab,null))['then'](function(_0x1cd920){if(_0x1cd920){return db[_0x3638('0x87')][_0x3638('0x88')](function(_0x194db6){return db[_0x3638('0x65')][_0x3638('0x49')](_0x39b685[_0x3638('0x4a')],{'transaction':_0x194db6})['then'](function(_0x2e0486){_0x45b4c6=_0x2e0486;return _0x1cd920[_0x3638('0x89')](_0x2e0486,{'transaction':_0x194db6});})[_0x3638('0x26')](function(){var _0x42448c={'type':db[_0x3638('0x8a')][_0x3638('0x8b')],'transaction':_0x194db6};switch(_0x39b685[_0x3638('0x4a')][_0x3638('0x2d')]){case _0x3638('0x8c'):_0x42448c['type']=db['Sequelize'][_0x3638('0x8b')];break;case'number':_0x42448c[_0x3638('0x2d')]=db[_0x3638('0x8a')][_0x3638('0x8d')];break;case _0x3638('0x8e'):_0x42448c[_0x3638('0x2d')]=db[_0x3638('0x8a')][_0x3638('0x8f')];_0x42448c['defaultValue']=![];break;default:}return db[_0x3638('0x87')][_0x3638('0x90')][_0x3638('0x91')](_0x3638('0x70'),util[_0x3638('0x68')]('cf_%s',_0x45b4c6['id']),_0x42448c);})[_0x3638('0x26')](function(){return _0x45b4c6;});});}})['then'](respondWithResult(_0x2d31ab,null))[_0x3638('0x48')](handleError(_0x2d31ab,null));};exports['getCustomFields']=function(_0x739846,_0x4ec45b,_0x22edf9){var _0x2322e7={};var _0x36d883={};var _0x1b34f3;var _0x4e899e;return db[_0x3638('0x40')][_0x3638('0x86')]({'where':{'id':_0x739846[_0x3638('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ec45b,null))[_0x3638('0x26')](function(_0x4ea425){if(_0x4ea425){_0x1b34f3=_0x4ea425;_0x36d883[_0x3638('0x32')]=_[_0x3638('0x30')](db[_0x3638('0x65')]['rawAttributes']);_0x36d883[_0x3638('0x2f')]=_[_0x3638('0x30')](_0x739846[_0x3638('0x2f')]);_0x36d883[_0x3638('0x31')]=_[_0x3638('0x34')](_0x36d883[_0x3638('0x32')],_0x36d883[_0x3638('0x2f')]);_0x2322e7[_0x3638('0x33')]=_[_0x3638('0x34')](_0x36d883[_0x3638('0x32')],qs[_0x3638('0x35')](_0x739846[_0x3638('0x2f')][_0x3638('0x35')]));_0x2322e7[_0x3638('0x33')]=_0x2322e7[_0x3638('0x33')][_0x3638('0x46')]?_0x2322e7[_0x3638('0x33')]:_0x36d883['model'];_0x2322e7[_0x3638('0x39')]=qs[_0x3638('0x3a')](_0x739846['query'][_0x3638('0x3a')]);_0x2322e7['where']=qs[_0x3638('0x31')](_[_0x3638('0x57')](_0x739846[_0x3638('0x2f')],_0x36d883['filters']));_0x2322e7[_0x3638('0x3c')]=_[_0x3638('0x3d')](_0x2322e7['where'],{'$or':[{'ListId':_0x4ea425['id']},{'ListId':null}]});if(_0x739846[_0x3638('0x2f')][_0x3638('0x3b')]){_0x2322e7['where']=_[_0x3638('0x3d')](_0x2322e7[_0x3638('0x3c')],{'$or':_['map'](_0x2322e7[_0x3638('0x33')],function(_0x20c523){var _0x538d4c={};_0x538d4c[_0x20c523]={'$like':'%'+_0x739846[_0x3638('0x2f')][_0x3638('0x3b')]+'%'};return _0x538d4c;})});}_0x2322e7=_[_0x3638('0x3d')]({},_0x2322e7,_0x739846[_0x3638('0x3f')]);return db[_0x3638('0x65')][_0x3638('0x92')](_0x2322e7);}})['then'](respondWithResult(_0x4ec45b,null))[_0x3638('0x48')](handleError(_0x4ec45b,null));};exports['getGlobalCustomFields']=function(_0x2557b1,_0x1bc834){return db[_0x3638('0x65')][_0x3638('0x92')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1bc834,null))[_0x3638('0x26')](function(_0xb1a8dd){return _0xb1a8dd;})['then'](respondWithResult(_0x1bc834,null))[_0x3638('0x48')](handleError(_0x1bc834,null));};exports[_0x3638('0x93')]=function(_0x38fc26,_0x429ea2,_0x1418df){return db[_0x3638('0x40')][_0x3638('0x4e')]({'where':{'id':_0x38fc26['params']['id']}})[_0x3638('0x26')](handleEntityNotFound(_0x429ea2,null))[_0x3638('0x26')](function(_0x2053d4){if(_0x2053d4){return _0x2053d4[_0x3638('0x93')](_0x38fc26[_0x3638('0x4a')][_0x3638('0x5a')],_[_0x3638('0x94')](_0x38fc26['body'],[_0x3638('0x5a'),'id'])||{})[_0x3638('0x95')](function(_0x1c90f6){for(var _0x5b9675=0x0;_0x5b9675<_0x38fc26[_0x3638('0x4a')][_0x3638('0x5a')]['length'];_0x5b9675+=0x1){socket[_0x3638('0x96')](_0x3638('0x97'),{'UserId':Number(_0x38fc26[_0x3638('0x4a')][_0x3638('0x5a')][_0x5b9675]),'CmListId':Number(_0x38fc26[_0x3638('0x44')]['id'])});}return _0x1c90f6;});}})[_0x3638('0x26')](respondWithResult(_0x429ea2,null))['catch'](handleError(_0x429ea2,null));};exports[_0x3638('0x98')]=function(_0x20f030,_0x197848,_0x3c9bfd){return db[_0x3638('0x40')]['find']({'where':{'id':_0x20f030[_0x3638('0x44')]['id']}})['then'](handleEntityNotFound(_0x197848,null))[_0x3638('0x26')](function(_0x173ad2){if(_0x173ad2){return _0x173ad2[_0x3638('0x98')](_0x20f030[_0x3638('0x2f')]['ids'])['then'](function(){if(_[_0x3638('0x5e')](_0x20f030[_0x3638('0x2f')][_0x3638('0x5a')])){for(var _0x26b247=0x0;_0x26b247<_0x20f030[_0x3638('0x2f')][_0x3638('0x5a')][_0x3638('0x46')];_0x26b247+=0x1){socket[_0x3638('0x96')](_0x3638('0x99'),{'UserId':Number(_0x20f030['query'][_0x3638('0x5a')][_0x26b247]),'CmListId':Number(_0x20f030[_0x3638('0x44')]['id'])});}}else{socket[_0x3638('0x96')]('userCmList:remove',{'UserId':Number(_0x20f030[_0x3638('0x2f')][_0x3638('0x5a')]),'CmListId':Number(_0x20f030['params']['id'])});}});}})['then'](respondWithStatusCode(_0x197848,null))[_0x3638('0x48')](handleError(_0x197848,null));};exports[_0x3638('0x9a')]=function(_0x4b0c89,_0x1c49e7,_0xc35dc9){var _0x43194e={};var _0x23319c={};var _0x3b276c;var _0x5f0551;return db[_0x3638('0x40')][_0x3638('0x86')]({'where':{'id':_0x4b0c89[_0x3638('0x44')]['id']}})[_0x3638('0x26')](handleEntityNotFound(_0x1c49e7,null))[_0x3638('0x26')](function(_0x910ab0){if(_0x910ab0){_0x3b276c=_0x910ab0;_0x23319c[_0x3638('0x32')]=_['keys'](db[_0x3638('0x9b')][_0x3638('0x45')]);_0x23319c[_0x3638('0x2f')]=_['keys'](_0x4b0c89[_0x3638('0x2f')]);_0x23319c[_0x3638('0x31')]=_['intersection'](_0x23319c['model'],_0x23319c[_0x3638('0x2f')]);_0x43194e[_0x3638('0x33')]=_[_0x3638('0x34')](_0x23319c[_0x3638('0x32')],qs[_0x3638('0x35')](_0x4b0c89[_0x3638('0x2f')]['fields']));_0x43194e[_0x3638('0x33')]=_0x43194e[_0x3638('0x33')][_0x3638('0x46')]?_0x43194e['attributes']:_0x23319c[_0x3638('0x32')];_0x43194e[_0x3638('0x39')]=qs[_0x3638('0x3a')](_0x4b0c89[_0x3638('0x2f')][_0x3638('0x3a')]);_0x43194e['where']=qs[_0x3638('0x31')](_[_0x3638('0x57')](_0x4b0c89['query'],_0x23319c['filters']));if(_0x4b0c89[_0x3638('0x2f')]['filter']){_0x43194e[_0x3638('0x3c')]=_[_0x3638('0x3d')](_0x43194e[_0x3638('0x3c')],{'$or':_[_0x3638('0x2c')](_0x43194e[_0x3638('0x33')],function(_0x25902c){var _0x568370={};_0x568370[_0x25902c]={'$like':'%'+_0x4b0c89['query'][_0x3638('0x3b')]+'%'};return _0x568370;})});}_0x43194e=_[_0x3638('0x3d')]({},_0x43194e,_0x4b0c89['options']);return _0x3b276c['getAgents'](_0x43194e);}})[_0x3638('0x26')](function(_0x28c1ba){if(_0x28c1ba){_0x5f0551=_0x28c1ba[_0x3638('0x46')];if(!_0x4b0c89[_0x3638('0x2f')][_0x3638('0x36')]('nolimit')){_0x43194e['limit']=qs[_0x3638('0x38')](_0x4b0c89[_0x3638('0x2f')][_0x3638('0x38')]);_0x43194e[_0x3638('0x1e')]=qs['offset'](_0x4b0c89[_0x3638('0x2f')][_0x3638('0x1e')]);}return _0x3b276c[_0x3638('0x9a')](_0x43194e);}})[_0x3638('0x26')](function(_0x46445d){if(_0x46445d){return _0x46445d?{'count':_0x5f0551,'rows':_0x46445d}:null;}})[_0x3638('0x26')](respondWithResult(_0x1c49e7,null))['catch'](handleError(_0x1c49e7,null));};function handleQuery(_0x29504d){logger['info'](_0x29504d);return db[_0x3638('0x87')][_0x3638('0x2f')](_0x29504d)['spread'](function(_0x449785){csv_results[_0x3638('0x5f')](_0x449785);})[_0x3638('0x48')](function(_0x3cfb0){logger[_0x3638('0x29')](_0x3cfb0[_0x3638('0x9c')]);});} \ No newline at end of file +var _0x32bf=['describe','addDisposition','params','ListId','Disposition','findOne','nolimit','filter','findAll','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','show','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x32bf,0xf9));var _0xf32b=function(_0x23f2be,_0x21e788){_0x23f2be=_0x23f2be-0x0;var _0x5eea88=_0x32bf[_0x23f2be];return _0x5eea88;};'use strict';var emlformat=require(_0xf32b('0x0'));var rimraf=require(_0xf32b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf32b('0x2'));var rp=require('request-promise');var moment=require(_0xf32b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf32b('0x4'));var util=require(_0xf32b('0x5'));var path=require(_0xf32b('0x6'));var sox=require('sox');var csv=require(_0xf32b('0x7'));var ejs=require(_0xf32b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf32b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf32b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf32b('0x7'));var querystring=require('querystring');var Papa=require(_0xf32b('0xb'));var Redis=require('ioredis');var authService=require(_0xf32b('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xf32b('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf32b('0xe'))(_0xf32b('0xf'));var utils=require(_0xf32b('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0xf32b('0x11')]=_[_0xf32b('0x12')](config[_0xf32b('0x11')],{'host':_0xf32b('0x13'),'port':0x18eb});var socket=require(_0xf32b('0x14'))(new Redis(config[_0xf32b('0x11')]));require(_0xf32b('0x15'))[_0xf32b('0x16')](socket);function respondWithStatusCode(_0x2940b4,_0x47cc47){_0x47cc47=_0x47cc47||0xcc;return function(_0xc43765){if(_0xc43765){return _0x2940b4[_0xf32b('0x17')](_0x47cc47);}return _0x2940b4[_0xf32b('0x18')](_0x47cc47)[_0xf32b('0x19')]();};}function respondWithResult(_0x231560,_0x4c3356){_0x4c3356=_0x4c3356||0xc8;return function(_0x347feb){if(_0x347feb){return _0x231560['status'](_0x4c3356)[_0xf32b('0x1a')](_0x347feb);}};}function respondWithFilteredResult(_0x1fbf7e,_0x54266f){return function(_0x148639){if(_0x148639){var _0x2ab137=typeof _0x54266f[_0xf32b('0x1b')]===_0xf32b('0x1c')&&typeof _0x54266f[_0xf32b('0x1d')]===_0xf32b('0x1c');var _0x27cc12=_0x148639[_0xf32b('0x1e')];var _0x46f045=_0x2ab137?0x0:_0x54266f[_0xf32b('0x1b')];var _0x2c0f4e=_0x2ab137?_0x148639[_0xf32b('0x1e')]:_0x54266f['offset']+_0x54266f['limit'];var _0x4f3040;if(_0x2c0f4e>=_0x27cc12){_0x2c0f4e=_0x27cc12;_0x4f3040=0xc8;}else{_0x4f3040=0xce;}_0x1fbf7e[_0xf32b('0x18')](_0x4f3040);return _0x1fbf7e['set'](_0xf32b('0x1f'),_0x46f045+'-'+_0x2c0f4e+'/'+_0x27cc12)[_0xf32b('0x1a')](_0x148639);}return null;};}function patchUpdates(_0x4c7982){return function(_0x58a0ae){try{jsonpatch['apply'](_0x58a0ae,_0x4c7982,!![]);}catch(_0x44a51b){return BPromise[_0xf32b('0x20')](_0x44a51b);}return _0x58a0ae[_0xf32b('0x21')]();};}function saveUpdates(_0x1e943f,_0x9744ff){return function(_0x5a4886){if(_0x5a4886){return _0x5a4886[_0xf32b('0x22')](_0x1e943f)[_0xf32b('0x23')](function(_0x6ce394){return _0x6ce394;});}return null;};}function removeEntity(_0x197d83,_0x42dc8f){return function(_0x3540b5){if(_0x3540b5){return _0x3540b5[_0xf32b('0x24')]()['then'](function(){var _0x8a2e13=_0x3540b5[_0xf32b('0x25')]({'plain':!![]});var _0xad781b='Lists';return db['UserProfileResource'][_0xf32b('0x24')]({'where':{'type':_0xad781b,'resourceId':_0x8a2e13['id']}})[_0xf32b('0x23')](function(){return _0x3540b5;});})[_0xf32b('0x23')](function(){_0x197d83['status'](0xcc)[_0xf32b('0x19')]();});}};}function handleEntityNotFound(_0x481615,_0x57df47){return function(_0x21d8f8){if(!_0x21d8f8){_0x481615[_0xf32b('0x17')](0x194);}return _0x21d8f8;};}function handleError(_0x508257,_0x1d82f3){_0x1d82f3=_0x1d82f3||0x1f4;return function(_0x307852){logger[_0xf32b('0x26')](_0x307852[_0xf32b('0x27')]);if(_0x307852[_0xf32b('0x28')]){delete _0x307852[_0xf32b('0x28')];}_0x508257[_0xf32b('0x18')](_0x1d82f3)['send'](_0x307852);};}exports[_0xf32b('0x29')]=function(_0x5519ef,_0x432727){var _0x1454db={},_0x39132d={},_0x10578c={'count':0x0,'rows':[]};var _0x11f7ab=_[_0xf32b('0x2a')](db[_0xf32b('0x2b')][_0xf32b('0x2c')],function(_0x41c0cf){return{'name':_0x41c0cf[_0xf32b('0x2d')],'type':_0x41c0cf[_0xf32b('0x2e')][_0xf32b('0x2f')]};});_0x39132d[_0xf32b('0x30')]=_[_0xf32b('0x2a')](_0x11f7ab,'name');_0x39132d[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x5519ef['query']);_0x39132d[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0x39132d[_0xf32b('0x30')],_0x39132d['query']);_0x1454db[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0x39132d[_0xf32b('0x30')],qs[_0xf32b('0x36')](_0x5519ef['query'][_0xf32b('0x36')]));_0x1454db[_0xf32b('0x35')]=_0x1454db[_0xf32b('0x35')]['length']?_0x1454db['attributes']:_0x39132d['model'];if(!_0x5519ef[_0xf32b('0x31')][_0xf32b('0x37')]('nolimit')){_0x1454db[_0xf32b('0x1d')]=qs[_0xf32b('0x1d')](_0x5519ef[_0xf32b('0x31')][_0xf32b('0x1d')]);_0x1454db[_0xf32b('0x1b')]=qs['offset'](_0x5519ef[_0xf32b('0x31')][_0xf32b('0x1b')]);}_0x1454db[_0xf32b('0x38')]=qs[_0xf32b('0x39')](_0x5519ef[_0xf32b('0x31')][_0xf32b('0x39')]);_0x1454db[_0xf32b('0x3a')]=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x5519ef[_0xf32b('0x31')],_0x39132d['filters']),_0x11f7ab);if(_0x5519ef[_0xf32b('0x31')]['filter']){_0x1454db[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x1454db['where'],{'$or':_[_0xf32b('0x2a')](_0x11f7ab,function(_0x1944cd){if(_0x1944cd['type']!==_0xf32b('0x3d')){var _0x33434e={};_0x33434e[_0x1944cd[_0xf32b('0x28')]]={'$like':'%'+_0x5519ef[_0xf32b('0x31')]['filter']+'%'};return _0x33434e;}})});}_0x1454db=_['merge']({},_0x1454db,_0x5519ef['options']);var _0x4334dd={'where':_0x1454db[_0xf32b('0x3a')]};return db['CmList'][_0xf32b('0x1e')](_0x4334dd)[_0xf32b('0x23')](function(_0x7bda7c){_0x10578c[_0xf32b('0x1e')]=_0x7bda7c;if(_0x5519ef[_0xf32b('0x31')][_0xf32b('0x3e')]){_0x1454db[_0xf32b('0x3f')]=[{'all':!![]}];}return db[_0xf32b('0x2b')]['findAll'](_0x1454db);})[_0xf32b('0x23')](function(_0x3ffd66){_0x10578c['rows']=_0x3ffd66;return _0x10578c;})[_0xf32b('0x23')](respondWithFilteredResult(_0x432727,_0x1454db))['catch'](handleError(_0x432727,null));};exports[_0xf32b('0x40')]=function(_0x2dfda7,_0x3df429){var _0x49ed45={'raw':![],'where':{'id':_0x2dfda7['params']['id']}},_0x3968ba={};_0x3968ba['model']=_[_0xf32b('0x32')](db['CmList']['rawAttributes']);_0x3968ba['query']=_[_0xf32b('0x32')](_0x2dfda7[_0xf32b('0x31')]);_0x3968ba[_0xf32b('0x33')]=_['intersection'](_0x3968ba[_0xf32b('0x30')],_0x3968ba[_0xf32b('0x31')]);_0x49ed45[_0xf32b('0x35')]=_['intersection'](_0x3968ba[_0xf32b('0x30')],qs[_0xf32b('0x36')](_0x2dfda7[_0xf32b('0x31')]['fields']));_0x49ed45[_0xf32b('0x35')]=_0x49ed45[_0xf32b('0x35')][_0xf32b('0x41')]?_0x49ed45[_0xf32b('0x35')]:_0x3968ba[_0xf32b('0x30')];if(_0x2dfda7[_0xf32b('0x31')]['includeAll']){_0x49ed45[_0xf32b('0x3f')]=[{'all':!![]}];}_0x49ed45=_['merge']({},_0x49ed45,_0x2dfda7[_0xf32b('0x42')]);return db[_0xf32b('0x2b')][_0xf32b('0x43')](_0x49ed45)[_0xf32b('0x23')](handleEntityNotFound(_0x3df429,null))[_0xf32b('0x23')](respondWithResult(_0x3df429,null))[_0xf32b('0x44')](handleError(_0x3df429,null));};exports[_0xf32b('0x45')]=function(_0x46bce9,_0x2a4b9c){return db[_0xf32b('0x2b')][_0xf32b('0x45')](_0x46bce9[_0xf32b('0x46')],{})[_0xf32b('0x23')](function(_0x577b3f){var _0x30c58a=_0x46bce9[_0xf32b('0x47')][_0xf32b('0x25')]({'plain':!![]});if(!_0x30c58a)throw new Error(_0xf32b('0x48'));if(_0x30c58a[_0xf32b('0x49')]===_0xf32b('0x47')){var _0x53edd7=_0x577b3f['get']({'plain':!![]});var _0x4851c0=_0xf32b('0x4a');return db[_0xf32b('0x4b')][_0xf32b('0x43')]({'where':{'name':_0x4851c0,'userProfileId':_0x30c58a[_0xf32b('0x4c')]},'raw':!![]})['then'](function(_0x2044a1){if(_0x2044a1&&_0x2044a1['autoAssociation']===0x0){return db[_0xf32b('0x4d')][_0xf32b('0x45')]({'name':_0x53edd7[_0xf32b('0x28')],'resourceId':_0x53edd7['id'],'type':_0x2044a1['name'],'sectionId':_0x2044a1['id']},{})[_0xf32b('0x23')](function(){return _0x577b3f;});}else{return _0x577b3f;}})[_0xf32b('0x44')](function(_0xac69b6){logger[_0xf32b('0x26')](_0xf32b('0x4e'),_0xac69b6);throw _0xac69b6;});}return _0x577b3f;})[_0xf32b('0x23')](respondWithResult(_0x2a4b9c,0xc9))['catch'](handleError(_0x2a4b9c,null));};exports['update']=function(_0x59ac1b,_0x37d567){if(_0x59ac1b[_0xf32b('0x46')]['id']){delete _0x59ac1b[_0xf32b('0x46')]['id'];}return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x59ac1b['params']['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x37d567,null))[_0xf32b('0x23')](saveUpdates(_0x59ac1b[_0xf32b('0x46')],null))[_0xf32b('0x23')](respondWithResult(_0x37d567,null))[_0xf32b('0x44')](handleError(_0x37d567,null));};exports[_0xf32b('0x24')]=function(_0x58048e,_0x51460c){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x58048e['params']['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x51460c,null))[_0xf32b('0x23')](removeEntity(_0x51460c,null))[_0xf32b('0x44')](handleError(_0x51460c,null));};exports[_0xf32b('0x4f')]=function(_0x5b428e,_0x211c21){return db[_0xf32b('0x2b')][_0xf32b('0x4f')]()[_0xf32b('0x23')](respondWithResult(_0x211c21,null))[_0xf32b('0x44')](handleError(_0x211c21,null));};exports[_0xf32b('0x50')]=function(_0x3c6102,_0x58c372,_0x247385){if(_0x3c6102['body']['id']){delete _0x3c6102['body']['id'];}return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x3c6102[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x58c372,null))[_0xf32b('0x23')](function(_0x499e8a){if(_0x499e8a){_0x3c6102[_0xf32b('0x46')][_0xf32b('0x52')]=_0x499e8a['id'];return db[_0xf32b('0x53')][_0xf32b('0x45')](_0x3c6102[_0xf32b('0x46')]);}})[_0xf32b('0x23')](respondWithResult(_0x58c372,null))[_0xf32b('0x44')](handleError(_0x58c372,null));};exports['getDispositions']=function(_0x2e8c32,_0x122ac7,_0x3321bc){var _0x550ac3={'raw':![],'where':{}};var _0x16302f={};var _0x452beb={'count':0x0,'rows':[]};return db[_0xf32b('0x2b')][_0xf32b('0x54')]({'where':{'id':_0x2e8c32[_0xf32b('0x51')]['id']}})['then'](handleEntityNotFound(_0x122ac7,null))['then'](function(_0x36992e){if(_0x36992e){_0x16302f[_0xf32b('0x30')]=_[_0xf32b('0x32')](db[_0xf32b('0x53')][_0xf32b('0x2c')]);_0x16302f[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x2e8c32[_0xf32b('0x31')]);_0x16302f[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0x16302f[_0xf32b('0x30')],_0x16302f[_0xf32b('0x31')]);_0x550ac3[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0x16302f['model'],qs[_0xf32b('0x36')](_0x2e8c32[_0xf32b('0x31')]['fields']));_0x550ac3[_0xf32b('0x35')]=_0x550ac3[_0xf32b('0x35')][_0xf32b('0x41')]?_0x550ac3[_0xf32b('0x35')]:_0x16302f[_0xf32b('0x30')];if(!_0x2e8c32['query'][_0xf32b('0x37')](_0xf32b('0x55'))){_0x550ac3[_0xf32b('0x1d')]=qs[_0xf32b('0x1d')](_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x1d')]);_0x550ac3['offset']=qs[_0xf32b('0x1b')](_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x1b')]);}_0x550ac3[_0xf32b('0x38')]=qs['sort'](_0x2e8c32[_0xf32b('0x31')]['sort']);_0x550ac3['where']=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x2e8c32['query'],_0x16302f[_0xf32b('0x33')]));_0x550ac3[_0xf32b('0x3a')][_0xf32b('0x52')]=_0x36992e['id'];if(_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x56')]){_0x550ac3[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x550ac3[_0xf32b('0x3a')],{'$or':_[_0xf32b('0x2a')](_0x550ac3[_0xf32b('0x35')],function(_0x14a770){var _0x38abf5={};_0x38abf5[_0x14a770]={'$like':'%'+_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x56')]+'%'};return _0x38abf5;})});}_0x550ac3=_[_0xf32b('0x3c')]({},_0x550ac3,_0x2e8c32[_0xf32b('0x42')]);return db[_0xf32b('0x53')][_0xf32b('0x1e')]({'where':_0x550ac3[_0xf32b('0x3a')]})[_0xf32b('0x23')](function(_0x2b3394){_0x452beb['count']=_0x2b3394;if(_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x3e')]){_0x550ac3['include']=[{'all':!![]}];}return db[_0xf32b('0x53')][_0xf32b('0x57')](_0x550ac3);})[_0xf32b('0x23')](function(_0x219278){_0x452beb[_0xf32b('0x58')]=_0x219278;return _0x452beb;});}})[_0xf32b('0x23')](respondWithFilteredResult(_0x122ac7,_0x550ac3))['catch'](handleError(_0x122ac7,null));};exports[_0xf32b('0x59')]=function(_0x367007,_0xc7834e,_0x29592a){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x367007[_0xf32b('0x51')]['id']}})['then'](handleEntityNotFound(_0xc7834e,null))[_0xf32b('0x23')](function(_0x5b8cf2){if(_0x5b8cf2){return _0x5b8cf2[_0xf32b('0x59')](_0x367007[_0xf32b('0x31')]['ids']);}})[_0xf32b('0x23')](respondWithStatusCode(_0xc7834e,null))[_0xf32b('0x44')](handleError(_0xc7834e,null));};exports[_0xf32b('0x5a')]=function(_0x5762b1,_0x44ba1b,_0x5960aa){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x5762b1[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x44ba1b,null))[_0xf32b('0x23')](function(_0x7c015b){if(_0x7c015b){var _0x4e1d29=[];var _0x250a46={'success':[],'errors':[]};return db[_0xf32b('0x5b')][_0xf32b('0x4f')]()[_0xf32b('0x23')](function(_0x15dbaa){if(_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')]&&_[_0xf32b('0x5d')](_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')])){if(_0x5762b1[_0xf32b('0x46')]['tags'][_0xf32b('0x41')]){_0x5762b1['body'][_0xf32b('0x5c')]=_0x5762b1['body'][_0xf32b('0x5c')][_0xf32b('0x5e')](';')+';';}else{_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')]=null;}}else{_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')]=null;}if(_0x5762b1['body']&&_['isArray'](_0x5762b1[_0xf32b('0x46')])){for(var _0x341d40=0x0;_0x341d40<_0x5762b1['body'][_0xf32b('0x41')];_0x341d40+=0x1){_0x5762b1['body'][_0x341d40]['ListId']=_0x5762b1[_0xf32b('0x51')]['id'];_0x4e1d29[_0xf32b('0x5f')](_0x5762b1['body'][_0x341d40]);}return BPromise[_0xf32b('0x60')](_0x4e1d29,function(_0x40216e){return db[_0xf32b('0x5b')][_0xf32b('0x45')](_['omit'](_0x40216e,[_0xf32b('0x61'),'id'])||{},{'fields':_[_0xf32b('0x32')](_0x15dbaa),'raw':!![]})[_0xf32b('0x23')](function(_0x15a608){_0x250a46[_0xf32b('0x62')]['push'](_0x15a608[_0xf32b('0x63')]);})[_0xf32b('0x44')](function(_0x4926a3){_0x250a46[_0xf32b('0x64')][_0xf32b('0x5f')]({'data':_0x40216e,'error':_0x4926a3[_0xf32b('0x65')]});});})[_0xf32b('0x23')](function(_0x2e2b0c){return _0x250a46;})['catch'](function(_0x1a6bd1){return _0x1a6bd1;});}else{_0x44ba1b[_0xf32b('0x18')](0x190)[_0xf32b('0x1a')]({'message':_0xf32b('0x66')});}});}})['then'](respondWithResult(_0x44ba1b,null))[_0xf32b('0x44')](handleError(_0x44ba1b,null));};exports[_0xf32b('0x67')]=function(_0x2ca96d,_0x3dc2a5,_0x4aa3af){var _0x129e0f;return db[_0xf32b('0x2b')]['find']({'where':{'id':_0x2ca96d[_0xf32b('0x51')]['id']},'include':[{'model':db[_0xf32b('0x68')],'as':'CustomFields'}]})[_0xf32b('0x23')](handleEntityNotFound(_0x3dc2a5,null))[_0xf32b('0x23')](function(_0x1f679c){if(_0x1f679c){_0x129e0f=_0x1f679c;return db[_0xf32b('0x5b')][_0xf32b('0x2c')];}})['then'](function(_0xe3615f){if(_0xe3615f){var _0x26a3b8={};var _0x177883={};_0x177883[_0xf32b('0x30')]=_[_0xf32b('0x69')](_[_0xf32b('0x32')](_0xe3615f),_['map'](_0x129e0f[_0xf32b('0x6a')],function(_0x503fb6){return util[_0xf32b('0x6b')](_0xf32b('0x6c'),_0x503fb6['id']);}));_0x177883[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x2ca96d[_0xf32b('0x31')]);_0x177883['filters']=_[_0xf32b('0x34')](_0x177883[_0xf32b('0x30')],_0x177883[_0xf32b('0x31')]);_0x26a3b8[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0x177883['model'],qs[_0xf32b('0x36')](_0x2ca96d[_0xf32b('0x31')]['fields']));_0x26a3b8[_0xf32b('0x35')]=_0x26a3b8[_0xf32b('0x35')]['length']?_0x26a3b8[_0xf32b('0x35')]:_0x177883[_0xf32b('0x30')];if(!_0x2ca96d['query'][_0xf32b('0x37')](_0xf32b('0x55'))){_0x26a3b8['limit']=qs[_0xf32b('0x1d')](_0x2ca96d['query'][_0xf32b('0x1d')]);_0x26a3b8[_0xf32b('0x1b')]=qs[_0xf32b('0x1b')](_0x2ca96d[_0xf32b('0x31')][_0xf32b('0x1b')]);}_0x26a3b8[_0xf32b('0x38')]=qs['sort'](_0x2ca96d[_0xf32b('0x31')][_0xf32b('0x39')]);_0x26a3b8['where']=qs['filters'](_[_0xf32b('0x3b')](_0x2ca96d[_0xf32b('0x31')],_0x177883['filters']));_0x26a3b8[_0xf32b('0x6d')]=!![];if(_0x2ca96d[_0xf32b('0x31')][_0xf32b('0x56')]){_0x26a3b8[_0xf32b('0x3a')]=_['merge'](_0x26a3b8['where'],{'$or':_['map'](_0x26a3b8[_0xf32b('0x35')],function(_0x3e8230){var _0x30021b={};_0x30021b[_0x3e8230]={'$like':'%'+_0x2ca96d['query']['filter']+'%'};return _0x30021b;})});}_0x26a3b8=_['merge']({},_0x26a3b8,_0x2ca96d[_0xf32b('0x42')]);return _0x129e0f[_0xf32b('0x67')](_0x26a3b8);}})[_0xf32b('0x23')](respondWithResult(_0x3dc2a5,null))[_0xf32b('0x44')](handleError(_0x3dc2a5,null));};exports[_0xf32b('0x6e')]=function(_0x1c657e,_0x172d4a,_0x346d96){var _0x181b08;var _0x48c461;var _0x421c35;var _0x5994a5=_0x1c657e[_0xf32b('0x51')]['id'];csv_results=[];return db[_0xf32b('0x6f')][_0xf32b('0x57')]({'attributes':['id',_0xf32b('0x28')],'raw':!![],'order':[_0xf32b('0x70')]})[_0xf32b('0x23')](function(_0x344a3d){_0x181b08=_0x344a3d;var _0x41d116=_[_0xf32b('0x32')](db[_0xf32b('0x5b')]['rawAttributes']);return db[_0xf32b('0x68')][_0xf32b('0x57')]({'raw':!![],'attributes':['id',_0xf32b('0x71')]})[_0xf32b('0x23')](function(_0x379e4e){_0x48c461=_0x379e4e;var _0x40e949=squel[_0xf32b('0x72')]()['fields'](_0x41d116)[_0xf32b('0x73')](_0xf32b('0x74'),'c')[_0xf32b('0x3a')](_0xf32b('0x75'),_0x5994a5)[_0xf32b('0x3a')](_0xf32b('0x76'))[_0xf32b('0x77')]();for(var _0x4f678d=0x0;_0x4f678d<_0x48c461[_0xf32b('0x41')];_0x4f678d++){_0x40e949[_0xf32b('0x78')](_0xf32b('0x79')+_0x48c461[_0x4f678d]['id'],_0xf32b('0x7a')+_0x48c461[_0x4f678d][_0xf32b('0x71')]);}for(var _0x4f678d=0x0;_0x4f678d<_0x181b08[_0xf32b('0x41')];_0x4f678d++){_0x40e949['field'](squel[_0xf32b('0x72')]()[_0xf32b('0x78')](_0xf32b('0x7b'))[_0xf32b('0x73')](_0xf32b('0x7c'))['where'](_0xf32b('0x7d'),_0x181b08[_0x4f678d]['id'])[_0xf32b('0x3a')]('CmContactId\x20=\x20c.id'),_0xf32b('0x7e')+_0x181b08[_0x4f678d][_0xf32b('0x28')]);_0x40e949[_0xf32b('0x78')](squel[_0xf32b('0x72')]()[_0xf32b('0x78')](_0xf32b('0x7f'))[_0xf32b('0x73')](_0xf32b('0x7c'))['where']('ItemTypeId\x20=\x20?',_0x181b08[_0x4f678d]['id'])[_0xf32b('0x3a')](_0xf32b('0x80')),'description_additionalPhone_'+_0x181b08[_0x4f678d]['name']);}var _0x5d5066=[];_0x5d5066[_0xf32b('0x5f')](_0x40e949[_0xf32b('0x81')]());BPromise[_0xf32b('0x60')](_0x5d5066,handleQuery)[_0xf32b('0x23')](function(_0x4e453a){handleQuery(_0x40e949[_0xf32b('0x81')]());var _0x237242=csv_results[0x0];if(!_[_0xf32b('0x82')](_0x237242)){var _0x5182c8=toCsv(_0x237242);var _0x41b48e=Date[_0xf32b('0x83')]();fs[_0xf32b('0x84')](util[_0xf32b('0x6b')](_0xf32b('0x85'),_0x5994a5,_0x41b48e),_0x5182c8);_0x172d4a['setHeader'](_0xf32b('0x86'),_0xf32b('0x87')+util[_0xf32b('0x6b')](_0xf32b('0x88'),_0x5994a5,_0x41b48e));_0x172d4a[_0xf32b('0x89')](_0xf32b('0x8a'),_0xf32b('0x8b'));return _0x172d4a['download'](util[_0xf32b('0x6b')](_0xf32b('0x85'),_0x5994a5,_0x41b48e));}else{return _0x172d4a[_0xf32b('0x17')](0xcc);}});});});};exports['addCustomField']=function(_0x999d6d,_0x2f089e,_0x11bb73){var _0x131fb9;delete _0x999d6d[_0xf32b('0x46')]['id'];return db[_0xf32b('0x2b')][_0xf32b('0x54')]({'where':{'id':_0x999d6d[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x2f089e,null))[_0xf32b('0x23')](function(_0x548105){if(_0x548105){return db[_0xf32b('0x8c')][_0xf32b('0x8d')](function(_0x58e320){return db['CmCustomField']['create'](_0x999d6d['body'],{'transaction':_0x58e320})['then'](function(_0x1bc9d1){_0x131fb9=_0x1bc9d1;return _0x548105[_0xf32b('0x8e')](_0x1bc9d1,{'transaction':_0x58e320});})[_0xf32b('0x23')](function(){var _0x3ce490={'type':db[_0xf32b('0x8f')][_0xf32b('0x90')],'transaction':_0x58e320};switch(_0x999d6d[_0xf32b('0x46')][_0xf32b('0x2e')]){case'text':_0x3ce490[_0xf32b('0x2e')]=db['Sequelize'][_0xf32b('0x90')];break;case _0xf32b('0x91'):_0x3ce490['type']=db[_0xf32b('0x8f')][_0xf32b('0x92')];break;case _0xf32b('0x93'):_0x3ce490['type']=db[_0xf32b('0x8f')]['BOOLEAN'];_0x3ce490['defaultValue']=![];break;default:}return db[_0xf32b('0x8c')][_0xf32b('0x94')][_0xf32b('0x95')]('cm_contacts',util['format'](_0xf32b('0x96'),_0x131fb9['id']),_0x3ce490);})[_0xf32b('0x23')](function(){return _0x131fb9;});});}})[_0xf32b('0x23')](respondWithResult(_0x2f089e,null))[_0xf32b('0x44')](handleError(_0x2f089e,null));};exports[_0xf32b('0x97')]=function(_0x460e18,_0x5a533f,_0x123e1c){var _0x5973f7={};var _0x210e5e={};var _0x5e16de;var _0x484c91;return db[_0xf32b('0x2b')]['findOne']({'where':{'id':_0x460e18['params']['id']}})['then'](handleEntityNotFound(_0x5a533f,null))[_0xf32b('0x23')](function(_0x3dd896){if(_0x3dd896){_0x5e16de=_0x3dd896;_0x210e5e[_0xf32b('0x30')]=_[_0xf32b('0x32')](db[_0xf32b('0x68')]['rawAttributes']);_0x210e5e[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x460e18[_0xf32b('0x31')]);_0x210e5e[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0x210e5e[_0xf32b('0x30')],_0x210e5e[_0xf32b('0x31')]);_0x5973f7[_0xf32b('0x35')]=_['intersection'](_0x210e5e['model'],qs[_0xf32b('0x36')](_0x460e18[_0xf32b('0x31')][_0xf32b('0x36')]));_0x5973f7[_0xf32b('0x35')]=_0x5973f7['attributes'][_0xf32b('0x41')]?_0x5973f7[_0xf32b('0x35')]:_0x210e5e[_0xf32b('0x30')];_0x5973f7[_0xf32b('0x38')]=qs[_0xf32b('0x39')](_0x460e18[_0xf32b('0x31')]['sort']);_0x5973f7[_0xf32b('0x3a')]=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x460e18[_0xf32b('0x31')],_0x210e5e[_0xf32b('0x33')]));_0x5973f7[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x5973f7[_0xf32b('0x3a')],{'$or':[{'ListId':_0x3dd896['id']},{'ListId':null}]});if(_0x460e18[_0xf32b('0x31')][_0xf32b('0x56')]){_0x5973f7[_0xf32b('0x3a')]=_['merge'](_0x5973f7[_0xf32b('0x3a')],{'$or':_[_0xf32b('0x2a')](_0x5973f7[_0xf32b('0x35')],function(_0x2821ee){var _0x4703e3={};_0x4703e3[_0x2821ee]={'$like':'%'+_0x460e18[_0xf32b('0x31')][_0xf32b('0x56')]+'%'};return _0x4703e3;})});}_0x5973f7=_[_0xf32b('0x3c')]({},_0x5973f7,_0x460e18[_0xf32b('0x42')]);return db[_0xf32b('0x68')][_0xf32b('0x98')](_0x5973f7);}})[_0xf32b('0x23')](respondWithResult(_0x5a533f,null))[_0xf32b('0x44')](handleError(_0x5a533f,null));};exports[_0xf32b('0x99')]=function(_0x18e48f,_0x4596f3){return db[_0xf32b('0x68')][_0xf32b('0x98')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4596f3,null))[_0xf32b('0x23')](function(_0x22b2d7){return _0x22b2d7;})[_0xf32b('0x23')](respondWithResult(_0x4596f3,null))['catch'](handleError(_0x4596f3,null));};exports[_0xf32b('0x9a')]=function(_0x2b5168,_0x4a5606,_0x13260b){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x2b5168[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x4a5606,null))['then'](function(_0x27aabe){if(_0x27aabe){return _0x27aabe[_0xf32b('0x9a')](_0x2b5168['body']['ids'],_[_0xf32b('0x9b')](_0x2b5168['body'],[_0xf32b('0x61'),'id'])||{})[_0xf32b('0x9c')](function(_0x3441d8){for(var _0x215279=0x0;_0x215279<_0x2b5168[_0xf32b('0x46')][_0xf32b('0x61')][_0xf32b('0x41')];_0x215279+=0x1){socket[_0xf32b('0x9d')](_0xf32b('0x9e'),{'UserId':Number(_0x2b5168[_0xf32b('0x46')][_0xf32b('0x61')][_0x215279]),'CmListId':Number(_0x2b5168[_0xf32b('0x51')]['id'])});}return _0x3441d8;});}})['then'](respondWithResult(_0x4a5606,null))[_0xf32b('0x44')](handleError(_0x4a5606,null));};exports[_0xf32b('0x9f')]=function(_0x9d90fc,_0x4dffec,_0x16bd6f){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x9d90fc[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x4dffec,null))[_0xf32b('0x23')](function(_0x53764a){if(_0x53764a){return _0x53764a[_0xf32b('0x9f')](_0x9d90fc['query'][_0xf32b('0x61')])['then'](function(){if(_[_0xf32b('0x5d')](_0x9d90fc[_0xf32b('0x31')][_0xf32b('0x61')])){for(var _0x3c75bc=0x0;_0x3c75bc<_0x9d90fc[_0xf32b('0x31')][_0xf32b('0x61')][_0xf32b('0x41')];_0x3c75bc+=0x1){socket[_0xf32b('0x9d')](_0xf32b('0xa0'),{'UserId':Number(_0x9d90fc['query'][_0xf32b('0x61')][_0x3c75bc]),'CmListId':Number(_0x9d90fc['params']['id'])});}}else{socket[_0xf32b('0x9d')](_0xf32b('0xa0'),{'UserId':Number(_0x9d90fc['query'][_0xf32b('0x61')]),'CmListId':Number(_0x9d90fc['params']['id'])});}});}})[_0xf32b('0x23')](respondWithStatusCode(_0x4dffec,null))[_0xf32b('0x44')](handleError(_0x4dffec,null));};exports[_0xf32b('0xa1')]=function(_0x183066,_0x22f89f,_0x2ed169){var _0x3f975c={};var _0xf2e82a={};var _0x5a7d3c;var _0x2e2b76;return db[_0xf32b('0x2b')][_0xf32b('0x54')]({'where':{'id':_0x183066['params']['id']}})['then'](handleEntityNotFound(_0x22f89f,null))[_0xf32b('0x23')](function(_0x5b4ab3){if(_0x5b4ab3){_0x5a7d3c=_0x5b4ab3;_0xf2e82a[_0xf32b('0x30')]=_[_0xf32b('0x32')](db[_0xf32b('0xa2')][_0xf32b('0x2c')]);_0xf2e82a[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x183066[_0xf32b('0x31')]);_0xf2e82a[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0xf2e82a[_0xf32b('0x30')],_0xf2e82a['query']);_0x3f975c[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0xf2e82a['model'],qs[_0xf32b('0x36')](_0x183066['query'][_0xf32b('0x36')]));_0x3f975c[_0xf32b('0x35')]=_0x3f975c[_0xf32b('0x35')]['length']?_0x3f975c[_0xf32b('0x35')]:_0xf2e82a['model'];_0x3f975c['order']=qs[_0xf32b('0x39')](_0x183066[_0xf32b('0x31')]['sort']);_0x3f975c[_0xf32b('0x3a')]=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x183066['query'],_0xf2e82a[_0xf32b('0x33')]));if(_0x183066['query']['filter']){_0x3f975c[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x3f975c[_0xf32b('0x3a')],{'$or':_[_0xf32b('0x2a')](_0x3f975c[_0xf32b('0x35')],function(_0x52bbf5){var _0x3c9435={};_0x3c9435[_0x52bbf5]={'$like':'%'+_0x183066[_0xf32b('0x31')]['filter']+'%'};return _0x3c9435;})});}_0x3f975c=_[_0xf32b('0x3c')]({},_0x3f975c,_0x183066[_0xf32b('0x42')]);return _0x5a7d3c['getAgents'](_0x3f975c);}})[_0xf32b('0x23')](function(_0xc75f8e){if(_0xc75f8e){_0x2e2b76=_0xc75f8e[_0xf32b('0x41')];if(!_0x183066[_0xf32b('0x31')]['hasOwnProperty'](_0xf32b('0x55'))){_0x3f975c[_0xf32b('0x1d')]=qs['limit'](_0x183066['query'][_0xf32b('0x1d')]);_0x3f975c[_0xf32b('0x1b')]=qs['offset'](_0x183066[_0xf32b('0x31')][_0xf32b('0x1b')]);}return _0x5a7d3c[_0xf32b('0xa1')](_0x3f975c);}})[_0xf32b('0x23')](function(_0xedf72b){if(_0xedf72b){return _0xedf72b?{'count':_0x2e2b76,'rows':_0xedf72b}:null;}})['then'](respondWithResult(_0x22f89f,null))[_0xf32b('0x44')](handleError(_0x22f89f,null));};function handleQuery(_0x4a9b5a){logger[_0xf32b('0xa3')](_0x4a9b5a);return db[_0xf32b('0x8c')][_0xf32b('0x31')](_0x4a9b5a)[_0xf32b('0x9c')](function(_0x10632f){csv_results[_0xf32b('0x5f')](_0x10632f);})[_0xf32b('0x44')](function(_0x559df5){logger[_0xf32b('0x26')](_0x559df5[_0xf32b('0x65')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c2ad932..98cb708 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x548eae,_0xad69de){var _0x5b1a01=function(_0x358051){while(--_0x358051){_0x548eae['push'](_0x548eae['shift']());}};_0x5b1a01(++_0xad69de);}(_0x814b,0x1a2));var _0xb814=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x814b[_0x16938f];return _0x5c66e9;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x55ca,0x126));var _0xa55c=function(_0x3367b7,_0x1e0234){_0x3367b7=_0x3367b7-0x0;var _0x52bb97=_0x55ca[_0x3367b7];return _0x52bb97;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index badb4db..0670598 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 _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xe5b5[_0x999b85];return _0x1d7124;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x43ab88,_0x389b5d){var _0x1c8e83=function(_0x2820a8){while(--_0x2820a8){_0x43ab88['push'](_0x43ab88['shift']());}};_0x1c8e83(++_0x389b5d);}(_0x1339,0x1ed));var _0x9133=function(_0x37cd6f,_0x46982d){_0x37cd6f=_0x37cd6f-0x0;var _0x1bde0b=_0x1339[_0x37cd6f];return _0x1bde0b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 9ae90f0..ba765c2 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 _0x1b3e=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1d30b4,_0x5d44d2){var _0x3cb697=function(_0x23bbea){while(--_0x23bbea){_0x1d30b4['push'](_0x1d30b4['shift']());}};_0x3cb697(++_0x5d44d2);}(_0x1b3e,0x1d6));var _0xe1b3=function(_0x1ea405,_0x325090){_0x1ea405=_0x1ea405-0x0;var _0xfef21e=_0x1b3e[_0x1ea405];return _0xfef21e;};'use strict';var _=require('lodash');var util=require(_0xe1b3('0x0'));var moment=require(_0xe1b3('0x1'));var BPromise=require(_0xe1b3('0x2'));var rs=require(_0xe1b3('0x3'));var fs=require('fs');var Redis=require(_0xe1b3('0x4'));var db=require(_0xe1b3('0x5'))['db'];var utils=require(_0xe1b3('0x6'));var logger=require(_0xe1b3('0x7'))('rpc');var config=require(_0xe1b3('0x8'));var jayson=require(_0xe1b3('0x9'));var client=jayson[_0xe1b3('0xa')][_0xe1b3('0xb')]({'port':0x232a});config[_0xe1b3('0xc')]=_[_0xe1b3('0xd')](config['redis'],{'host':_0xe1b3('0xe'),'port':0x18eb});var socket=require(_0xe1b3('0xf'))(new Redis(config[_0xe1b3('0xc')]));require('./cmList.socket')[_0xe1b3('0x10')](socket);function respondWithRpcPromise(_0xde750f,_0x335fdf,_0x50fb2a){return new BPromise(function(_0xa03191,_0x257426){return client[_0xe1b3('0x11')](_0xde750f,_0x50fb2a)[_0xe1b3('0x12')](function(_0x373f62){logger[_0xe1b3('0x13')](_0xe1b3('0x14'),_0x335fdf,'request\x20sent');logger[_0xe1b3('0x15')](_0xe1b3('0x16'),_0x335fdf,_0xe1b3('0x17'),JSON[_0xe1b3('0x18')](_0x373f62));if(_0x373f62[_0xe1b3('0x19')]){if(_0x373f62[_0xe1b3('0x19')][_0xe1b3('0x1a')]===0x1f4){logger[_0xe1b3('0x19')](_0xe1b3('0x14'),_0x335fdf,_0x373f62[_0xe1b3('0x19')][_0xe1b3('0x1b')]);return _0x257426(_0x373f62[_0xe1b3('0x19')]['message']);}logger[_0xe1b3('0x19')]('CmList,\x20%s,\x20%s',_0x335fdf,_0x373f62[_0xe1b3('0x19')]['message']);return _0xa03191(_0x373f62[_0xe1b3('0x19')][_0xe1b3('0x1b')]);}else{logger[_0xe1b3('0x13')](_0xe1b3('0x14'),_0x335fdf,_0xe1b3('0x17'));_0xa03191(_0x373f62[_0xe1b3('0x1c')][_0xe1b3('0x1b')]);}})[_0xe1b3('0x1d')](function(_0x2d605e){logger[_0xe1b3('0x19')](_0xe1b3('0x14'),_0x335fdf,_0x2d605e);_0x257426(_0x2d605e);});});} \ No newline at end of file +var _0x59d0=['error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x34bb68,_0x5b0079){var _0x3db9fb=function(_0x2c87bd){while(--_0x2c87bd){_0x34bb68['push'](_0x34bb68['shift']());}};_0x3db9fb(++_0x5b0079);}(_0x59d0,0xad));var _0x059d=function(_0x1a6817,_0x3cbd16){_0x1a6817=_0x1a6817-0x0;var _0x1ecee3=_0x59d0[_0x1a6817];return _0x1ecee3;};'use strict';var _=require(_0x059d('0x0'));var util=require(_0x059d('0x1'));var moment=require(_0x059d('0x2'));var BPromise=require('bluebird');var rs=require(_0x059d('0x3'));var fs=require('fs');var Redis=require(_0x059d('0x4'));var db=require(_0x059d('0x5'))['db'];var utils=require(_0x059d('0x6'));var logger=require(_0x059d('0x7'))('rpc');var config=require(_0x059d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x059d('0x9')][_0x059d('0xa')]({'port':0x232a});config[_0x059d('0xb')]=_[_0x059d('0xc')](config[_0x059d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x059d('0xd'))(new Redis(config['redis']));require(_0x059d('0xe'))[_0x059d('0xf')](socket);function respondWithRpcPromise(_0x28deed,_0x3ff977,_0x706df3){return new BPromise(function(_0xde161c,_0xbcb429){return client[_0x059d('0x10')](_0x28deed,_0x706df3)[_0x059d('0x11')](function(_0x588c8e){logger['info'](_0x059d('0x12'),_0x3ff977,'request\x20sent');logger[_0x059d('0x13')](_0x059d('0x14'),_0x3ff977,_0x059d('0x15'),JSON[_0x059d('0x16')](_0x588c8e));if(_0x588c8e['error']){if(_0x588c8e[_0x059d('0x17')][_0x059d('0x18')]===0x1f4){logger[_0x059d('0x17')](_0x059d('0x12'),_0x3ff977,_0x588c8e[_0x059d('0x17')][_0x059d('0x19')]);return _0xbcb429(_0x588c8e[_0x059d('0x17')][_0x059d('0x19')]);}logger[_0x059d('0x17')](_0x059d('0x12'),_0x3ff977,_0x588c8e[_0x059d('0x17')][_0x059d('0x19')]);return _0xde161c(_0x588c8e['error'][_0x059d('0x19')]);}else{logger[_0x059d('0x1a')](_0x059d('0x12'),_0x3ff977,_0x059d('0x15'));_0xde161c(_0x588c8e['result'][_0x059d('0x19')]);}})[_0x059d('0x1b')](function(_0x1e661a){logger['error'](_0x059d('0x12'),_0x3ff977,_0x1e661a);_0xbcb429(_0x1e661a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 89e56e9..9cd9558 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 _0x32c3=['length','cmList:','./cmList.events','remove','update','emit','removeListener','register'];(function(_0x2927e1,_0x1e98ff){var _0x38cc3a=function(_0x2158fc){while(--_0x2158fc){_0x2927e1['push'](_0x2927e1['shift']());}};_0x38cc3a(++_0x1e98ff);}(_0x32c3,0x1a2));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var CmListEvents=require(_0x332c('0x0'));var events=['save',_0x332c('0x1'),_0x332c('0x2')];function createListener(_0x2ce755,_0x9b8481){return function(_0x35341f){_0x9b8481[_0x332c('0x3')](_0x2ce755,_0x35341f);};}function removeListener(_0x1e3a09,_0x328b39){return function(){CmListEvents[_0x332c('0x4')](_0x1e3a09,_0x328b39);};}exports[_0x332c('0x5')]=function(_0x5eb958){for(var _0x4a78c=0x0,_0x461c04=events[_0x332c('0x6')];_0x4a78c<_0x461c04;_0x4a78c++){var _0x45cde6=events[_0x4a78c];var _0x3c3c56=createListener(_0x332c('0x7')+_0x45cde6,_0x5eb958);CmListEvents['on'](_0x45cde6,_0x3c3c56);}}; \ No newline at end of file +var _0x9ea3=['remove','update','removeListener','length','cmList:','./cmList.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ea3,0x12b));var _0x39ea=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x9ea3[_0x2b9b7f];return _0x4ed19a;};'use strict';var CmListEvents=require(_0x39ea('0x0'));var events=[_0x39ea('0x1'),_0x39ea('0x2'),_0x39ea('0x3')];function createListener(_0x29fa61,_0xe542cc){return function(_0x42ebe8){_0xe542cc['emit'](_0x29fa61,_0x42ebe8);};}function removeListener(_0xc887b3,_0x129660){return function(){CmListEvents[_0x39ea('0x4')](_0xc887b3,_0x129660);};}exports['register']=function(_0x42db10){for(var _0x48469e=0x0,_0x509a46=events[_0x39ea('0x5')];_0x48469e<_0x509a46;_0x48469e++){var _0x3f9ee0=events[_0x48469e];var _0x460dcd=createListener(_0x39ea('0x6')+_0x3f9ee0,_0x42db10);CmListEvents['on'](_0x3f9ee0,_0x460dcd);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b1e3771..9b5874e 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 _0x9479=['delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/global_fields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','destroy'];(function(_0x5ceb96,_0x12d6df){var _0x154ccd=function(_0x4c53aa){while(--_0x4c53aa){_0x5ceb96['push'](_0x5ceb96['shift']());}};_0x154ccd(++_0x12d6df);}(_0x9479,0x10c));var _0x9947=function(_0x1041da,_0x3bc4fd){_0x1041da=_0x1041da-0x0;var _0x246513=_0x9479[_0x1041da];return _0x246513;};'use strict';var multer=require(_0x9947('0x0'));var util=require(_0x9947('0x1'));var path=require(_0x9947('0x2'));var timeout=require(_0x9947('0x3'));var express=require(_0x9947('0x4'));var router=express[_0x9947('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9947('0x6'));var interaction=require(_0x9947('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x9947('0x8')]('/',auth[_0x9947('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9947('0xa')]);router[_0x9947('0x8')](_0x9947('0xb'),auth['isAuthenticated'](),controller['getGlobalCustomFields']);router[_0x9947('0x8')](_0x9947('0xc'),auth[_0x9947('0x9')](),controller[_0x9947('0xd')]);router[_0x9947('0x8')](_0x9947('0xe'),auth[_0x9947('0x9')](),controller[_0x9947('0xf')]);router['get']('/:id/contacts',auth[_0x9947('0x9')](),controller['getContacts']);router['get'](_0x9947('0x10'),auth[_0x9947('0x9')](),controller[_0x9947('0x11')]);router[_0x9947('0x8')]('/:id/fields',auth[_0x9947('0x9')](),controller['getCustomFields']);router[_0x9947('0x8')](_0x9947('0x12'),auth[_0x9947('0x9')](),controller[_0x9947('0x13')]);router[_0x9947('0x14')]('/',auth[_0x9947('0x9')](),controller[_0x9947('0x15')]);router['post'](_0x9947('0xe'),auth[_0x9947('0x9')](),controller[_0x9947('0x16')]);router[_0x9947('0x14')]('/:id/contacts',auth[_0x9947('0x9')](),controller[_0x9947('0x17')]);router[_0x9947('0x14')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9947('0x18')]);router[_0x9947('0x14')](_0x9947('0x12'),auth[_0x9947('0x9')](),controller[_0x9947('0x19')]);router[_0x9947('0x1a')](_0x9947('0xc'),auth[_0x9947('0x9')](),controller[_0x9947('0x1b')]);router['delete'](_0x9947('0xc'),auth[_0x9947('0x9')](),controller[_0x9947('0x1c')]);router[_0x9947('0x1d')]('/:id/dispositions',auth[_0x9947('0x9')](),controller[_0x9947('0x1e')]);router[_0x9947('0x1d')](_0x9947('0x12'),auth[_0x9947('0x9')](),controller[_0x9947('0x1f')]);module[_0x9947('0x20')]=router; \ No newline at end of file +var _0x6b94=['isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addContacts','addCustomField','put','delete','removeDispositions','removeAgents','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get'];(function(_0x450bf7,_0x1d4752){var _0x134163=function(_0x4ea7a8){while(--_0x4ea7a8){_0x450bf7['push'](_0x450bf7['shift']());}};_0x134163(++_0x1d4752);}(_0x6b94,0x78));var _0x46b9=function(_0x38630a,_0x1a5823){_0x38630a=_0x38630a-0x0;var _0x6fd946=_0x6b94[_0x38630a];return _0x6fd946;};'use strict';var multer=require(_0x46b9('0x0'));var util=require(_0x46b9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x46b9('0x2'));var router=express[_0x46b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x46b9('0x4'));var interaction=require(_0x46b9('0x5'));var config=require('../../config/environment');var controller=require(_0x46b9('0x6'));router[_0x46b9('0x7')]('/',auth[_0x46b9('0x8')](),controller[_0x46b9('0x9')]);router[_0x46b9('0x7')](_0x46b9('0xa'),auth[_0x46b9('0x8')](),controller[_0x46b9('0xb')]);router[_0x46b9('0x7')](_0x46b9('0xc'),auth[_0x46b9('0x8')](),controller[_0x46b9('0xd')]);router['get'](_0x46b9('0xe'),auth[_0x46b9('0x8')](),controller[_0x46b9('0xf')]);router[_0x46b9('0x7')](_0x46b9('0x10'),auth['isAuthenticated'](),controller[_0x46b9('0x11')]);router['get'](_0x46b9('0x12'),auth[_0x46b9('0x8')](),controller['getContacts']);router[_0x46b9('0x7')](_0x46b9('0x13'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x14')]);router[_0x46b9('0x7')](_0x46b9('0x15'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x16')]);router['get'](_0x46b9('0x17'),auth[_0x46b9('0x8')](),controller['getAgents']);router[_0x46b9('0x18')]('/',auth[_0x46b9('0x8')](),controller[_0x46b9('0x19')]);router['post']('/:id/dispositions',auth[_0x46b9('0x8')](),controller['addDisposition']);router[_0x46b9('0x18')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x46b9('0x1a')]);router['post'](_0x46b9('0x15'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x1b')]);router[_0x46b9('0x18')]('/:id/users',auth[_0x46b9('0x8')](),controller['addAgents']);router[_0x46b9('0x1c')](_0x46b9('0xe'),auth[_0x46b9('0x8')](),controller['update']);router[_0x46b9('0x1d')]('/:id',auth[_0x46b9('0x8')](),controller['destroy']);router[_0x46b9('0x1d')](_0x46b9('0x10'),auth['isAuthenticated'](),controller[_0x46b9('0x1e')]);router[_0x46b9('0x1d')](_0x46b9('0x17'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x1f')]);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 ab29ad4..296fbc8 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 _0x237c=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x3926a9,_0xc3fda5){var _0x2831cd=function(_0x4cd20e){while(--_0x4cd20e){_0x3926a9['push'](_0x3926a9['shift']());}};_0x2831cd(++_0xc3fda5);}(_0x237c,0x151));var _0xc237=function(_0x14ac6a,_0x303b68){_0x14ac6a=_0x14ac6a-0x0;var _0x5c5e82=_0x237c[_0x14ac6a];return _0x5c5e82;};'use strict';var Sequelize=require(_0xc237('0x0'));module[_0xc237('0x1')]={'name':{'type':Sequelize[_0xc237('0x2')],'get':function(_0xffee81){return this[_0xc237('0x3')](_0xc237('0x4'));}},'field':{'type':Sequelize[_0xc237('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xc237('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xc237('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x3a4d=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x36bed9,_0x79c1cb){var _0x5bf8e1=function(_0x199d4b){while(--_0x199d4b){_0x36bed9['push'](_0x36bed9['shift']());}};_0x5bf8e1(++_0x79c1cb);}(_0x3a4d,0xd5));var _0xd3a4=function(_0x4ff939,_0x5f54ea){_0x4ff939=_0x4ff939-0x0;var _0x3f8ba8=_0x3a4d[_0x4ff939];return _0x3f8ba8;};'use strict';var Sequelize=require(_0xd3a4('0x0'));module[_0xd3a4('0x1')]={'name':{'type':Sequelize[_0xd3a4('0x2')],'get':function(_0x19f1c9){return this[_0xd3a4('0x3')](_0xd3a4('0x4'));}},'field':{'type':Sequelize[_0xd3a4('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xd3a4('0x5')],'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 58a56fb..fbf3e09 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x41b3a5,_0x47d727){var _0x1c1ca6=function(_0x2be118){while(--_0x2be118){_0x41b3a5['push'](_0x41b3a5['shift']());}};_0x1c1ca6(++_0x47d727);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x479034,_0x3bc665){var _0x3f1b69=function(_0x53a5ae){while(--_0x53a5ae){_0x479034['push'](_0x479034['shift']());}};_0x3f1b69(++_0x3bc665);}(_0x7a54,0x106));var _0x47a5=function(_0x560750,_0x48b57a){_0x560750=_0x560750-0x0;var _0x263126=_0x7a54[_0x560750];return _0x263126;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 58c3091..b3aecc5 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 _0x8b8e=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','lodash','util','api','moment','bluebird'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0x8b8e,0x73));var _0xe8b8=function(_0x5bafe9,_0x537a6d){_0x5bafe9=_0x5bafe9-0x0;var _0x1e4fca=_0x8b8e[_0x5bafe9];return _0x1e4fca;};'use strict';var _=require(_0xe8b8('0x0'));var util=require(_0xe8b8('0x1'));var logger=require('../../config/logger')(_0xe8b8('0x2'));var moment=require(_0xe8b8('0x3'));var BPromise=require(_0xe8b8('0x4'));var rp=require(_0xe8b8('0x5'));var fs=require('fs');var path=require(_0xe8b8('0x6'));var rimraf=require(_0xe8b8('0x7'));var config=require(_0xe8b8('0x8'));var attributes=require(_0xe8b8('0x9'));module[_0xe8b8('0xa')]=function(_0x4f156e,_0x472c47){return _0x4f156e[_0xe8b8('0xb')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51a2=['tools_conditions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./condition.attributes','define'];(function(_0x7dad80,_0x5aa23f){var _0x2d9b68=function(_0x37aa85){while(--_0x37aa85){_0x7dad80['push'](_0x7dad80['shift']());}};_0x2d9b68(++_0x5aa23f);}(_0x51a2,0xa1));var _0x251a=function(_0x1236b7,_0x1c53bf){_0x1236b7=_0x1236b7-0x0;var _0x58e712=_0x51a2[_0x1236b7];return _0x58e712;};'use strict';var _=require(_0x251a('0x0'));var util=require(_0x251a('0x1'));var logger=require(_0x251a('0x2'))(_0x251a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x251a('0x4'));var fs=require('fs');var path=require(_0x251a('0x5'));var rimraf=require('rimraf');var config=require(_0x251a('0x6'));var attributes=require(_0x251a('0x7'));module['exports']=function(_0x12649d,_0x4eafe6){return _0x12649d[_0x251a('0x8')]('Condition',attributes,{'tableName':_0x251a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index ffdea39..37947d5 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 _0xa581=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x1d1854,_0x4a83b1){var _0x5b2acb=function(_0x29ae13){while(--_0x29ae13){_0x1d1854['push'](_0x1d1854['shift']());}};_0x5b2acb(++_0x4a83b1);}(_0xa581,0x18b));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a58('0x0'));var util=require(_0x1a58('0x1'));var moment=require(_0x1a58('0x2'));var BPromise=require(_0x1a58('0x3'));var rs=require(_0x1a58('0x4'));var fs=require('fs');var Redis=require(_0x1a58('0x5'));var db=require(_0x1a58('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a58('0x7'));var config=require(_0x1a58('0x8'));var jayson=require(_0x1a58('0x9'));var client=jayson[_0x1a58('0xa')][_0x1a58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x70d26d,_0x19f71a,_0x5721cf){return new BPromise(function(_0x4570fc,_0xd4657){return client['request'](_0x70d26d,_0x5721cf)[_0x1a58('0xc')](function(_0xa57d9f){logger['info'](_0x1a58('0xd'),_0x19f71a,'request\x20sent');logger['debug'](_0x1a58('0xe'),_0x19f71a,_0x1a58('0xf'),JSON[_0x1a58('0x10')](_0xa57d9f));if(_0xa57d9f[_0x1a58('0x11')]){if(_0xa57d9f['error'][_0x1a58('0x12')]===0x1f4){logger[_0x1a58('0x11')](_0x1a58('0xd'),_0x19f71a,_0xa57d9f[_0x1a58('0x11')]['message']);return _0xd4657(_0xa57d9f['error'][_0x1a58('0x13')]);}logger['error'](_0x1a58('0xd'),_0x19f71a,_0xa57d9f['error'][_0x1a58('0x13')]);return _0x4570fc(_0xa57d9f[_0x1a58('0x11')][_0x1a58('0x13')]);}else{logger[_0x1a58('0x14')](_0x1a58('0xd'),_0x19f71a,_0x1a58('0xf'));_0x4570fc(_0xa57d9f[_0x1a58('0x15')]['message']);}})['catch'](function(_0x1f3270){logger['error'](_0x1a58('0xd'),_0x19f71a,_0x1f3270);_0xd4657(_0x1f3270);});});} \ No newline at end of file +var _0x803f=['client','http','info','Condition,\x20%s,\x20%s','debug','request\x20sent','code','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34ac63,_0x40f4da){var _0x44aee2=function(_0x5a1140){while(--_0x5a1140){_0x34ac63['push'](_0x34ac63['shift']());}};_0x44aee2(++_0x40f4da);}(_0x803f,0x10e));var _0xf803=function(_0x1a2793,_0x8c946d){_0x1a2793=_0x1a2793-0x0;var _0x580695=_0x803f[_0x1a2793];return _0x580695;};'use strict';var _=require(_0xf803('0x0'));var util=require('util');var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require(_0xf803('0x3'));var fs=require('fs');var Redis=require(_0xf803('0x4'));var db=require(_0xf803('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require(_0xf803('0x8'));var jayson=require(_0xf803('0x9'));var client=jayson[_0xf803('0xa')][_0xf803('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1080ac,_0x3d7ccb,_0x32a09e){return new BPromise(function(_0x33f2b4,_0x5d83d3){return client['request'](_0x1080ac,_0x32a09e)['then'](function(_0x56dd99){logger[_0xf803('0xc')](_0xf803('0xd'),_0x3d7ccb,'request\x20sent');logger[_0xf803('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x3d7ccb,_0xf803('0xf'),JSON['stringify'](_0x56dd99));if(_0x56dd99['error']){if(_0x56dd99['error'][_0xf803('0x10')]===0x1f4){logger[_0xf803('0x11')](_0xf803('0xd'),_0x3d7ccb,_0x56dd99[_0xf803('0x11')]['message']);return _0x5d83d3(_0x56dd99['error']['message']);}logger[_0xf803('0x11')](_0xf803('0xd'),_0x3d7ccb,_0x56dd99[_0xf803('0x11')][_0xf803('0x12')]);return _0x33f2b4(_0x56dd99[_0xf803('0x11')][_0xf803('0x12')]);}else{logger[_0xf803('0xc')](_0xf803('0xd'),_0x3d7ccb,'request\x20sent');_0x33f2b4(_0x56dd99['result'][_0xf803('0x12')]);}})[_0xf803('0x13')](function(_0x50e02a){logger[_0xf803('0x11')](_0xf803('0xd'),_0x3d7ccb,_0x50e02a);_0x5d83d3(_0x50e02a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 95c3c6b..01c1561 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 _0x6b81=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','destroy','exports','multer'];(function(_0x3d0914,_0x5f1566){var _0x5508ed=function(_0xb2c861){while(--_0xb2c861){_0x3d0914['push'](_0x3d0914['shift']());}};_0x5508ed(++_0x5f1566);}(_0x6b81,0x16a));var _0x16b8=function(_0x2b7f97,_0x3fe5c6){_0x2b7f97=_0x2b7f97-0x0;var _0x3c2339=_0x6b81[_0x2b7f97];return _0x3c2339;};'use strict';var multer=require(_0x16b8('0x0'));var util=require(_0x16b8('0x1'));var path=require('path');var timeout=require(_0x16b8('0x2'));var express=require(_0x16b8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x16b8('0x4'));var interaction=require(_0x16b8('0x5'));var config=require(_0x16b8('0x6'));var controller=require(_0x16b8('0x7'));router['put'](_0x16b8('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x16b8('0x9')]);module[_0x16b8('0xa')]=router; \ No newline at end of file +var _0x759f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x759f,0xef));var _0xf759=function(_0x7b02ad,_0x2b4b59){_0x7b02ad=_0x7b02ad-0x0;var _0x4c1303=_0x759f[_0x7b02ad];return _0x4c1303;};'use strict';var multer=require('multer');var util=require(_0xf759('0x0'));var path=require(_0xf759('0x1'));var timeout=require(_0xf759('0x2'));var express=require(_0xf759('0x3'));var router=express[_0xf759('0x4')]();var fs_extra=require(_0xf759('0x5'));var auth=require(_0xf759('0x6'));var interaction=require(_0xf759('0x7'));var config=require('../../config/environment');var controller=require(_0xf759('0x8'));router[_0xf759('0x9')](_0xf759('0xa'),auth[_0xf759('0xb')](),controller['update']);router[_0xf759('0xc')](_0xf759('0xa'),auth[_0xf759('0xb')](),controller[_0xf759('0xd')]);module[_0xf759('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 7281ace..c8369f0 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 _0xc0b8=['STRING','name','INTEGER','exports'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xc0b8,0x123));var _0x8c0b=function(_0x2c5c05,_0x50d667){_0x2c5c05=_0x2c5c05-0x0;var _0x21c69c=_0xc0b8[_0x2c5c05];return _0x21c69c;};'use strict';var Sequelize=require('sequelize');module[_0x8c0b('0x0')]={'name':{'type':Sequelize[_0x8c0b('0x1')],'allowNull':![],'unique':_0x8c0b('0x2')},'OrderBy':{'type':Sequelize[_0x8c0b('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8c0b('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x0f73=['exports','STRING','sequelize'];(function(_0x584f18,_0x44690d){var _0x30cff1=function(_0x5a57ad){while(--_0x5a57ad){_0x584f18['push'](_0x584f18['shift']());}};_0x30cff1(++_0x44690d);}(_0x0f73,0x146));var _0x30f7=function(_0x4ca652,_0x4fa38a){_0x4ca652=_0x4ca652-0x0;var _0x5361a1=_0x0f73[_0x4ca652];return _0x5361a1;};'use strict';var Sequelize=require(_0x30f7('0x0'));module[_0x30f7('0x1')]={'name':{'type':Sequelize[_0x30f7('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x30f7('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 43cd3b2..e1340fb 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 _0x8f4c=['merge','options','includeAll','include','rows','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','ContactItemTypes','error','stack','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8f4c,0x113));var _0xc8f4=function(_0x19754a,_0x3050aa){_0x19754a=_0x19754a-0x0;var _0x4f8f3f=_0x8f4c[_0x19754a];return _0x4f8f3f;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){var _0x3782fd=_0x5d54a9['get']({'plain':!![]});var _0x177a44=_0xc8f4('0x26');return db['UserProfileResource'][_0xc8f4('0x25')]({'where':{'type':_0x177a44,'resourceId':_0x3782fd['id']}})[_0xc8f4('0x24')](function(){return _0x5d54a9;});})[_0xc8f4('0x24')](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db490,_0x3484b6){return function(_0x5db666){if(!_0x5db666){_0x3db490[_0xc8f4('0x17')](0x194);}return _0x5db666;};}function handleError(_0x37957c,_0x157ad5){_0x157ad5=_0x157ad5||0x1f4;return function(_0x1b70bc){logger[_0xc8f4('0x27')](_0x1b70bc[_0xc8f4('0x28')]);if(_0x1b70bc['name']){delete _0x1b70bc[_0xc8f4('0x29')];}_0x37957c[_0xc8f4('0x18')](_0x157ad5)[_0xc8f4('0x2a')](_0x1b70bc);};}exports['index']=function(_0xf4a556,_0x3a4b1b){var _0x5ab6cb={},_0x56ec4b={},_0x4d6c43={'count':0x0,'rows':[]};var _0x2717ff=_[_0xc8f4('0x2b')](db[_0xc8f4('0x2c')][_0xc8f4('0x2d')],function(_0x273e73){return{'name':_0x273e73[_0xc8f4('0x2e')],'type':_0x273e73[_0xc8f4('0x2f')][_0xc8f4('0x30')]};});_0x56ec4b['model']=_[_0xc8f4('0x2b')](_0x2717ff,_0xc8f4('0x29'));_0x56ec4b[_0xc8f4('0x31')]=_['keys'](_0xf4a556[_0xc8f4('0x31')]);_0x56ec4b[_0xc8f4('0x32')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],_0x56ec4b[_0xc8f4('0x31')]);_0x5ab6cb[_0xc8f4('0x34')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0xf4a556[_0xc8f4('0x31')]['fields']));_0x5ab6cb[_0xc8f4('0x34')]=_0x5ab6cb[_0xc8f4('0x34')][_0xc8f4('0x36')]?_0x5ab6cb[_0xc8f4('0x34')]:_0x56ec4b[_0xc8f4('0x33')];if(!_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0x5ab6cb[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0x5ab6cb[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1d')]);}_0x5ab6cb['order']=qs[_0xc8f4('0x39')](_0xf4a556['query'][_0xc8f4('0x39')]);_0x5ab6cb['where']=qs[_0xc8f4('0x32')](_[_0xc8f4('0x3a')](_0xf4a556[_0xc8f4('0x31')],_0x56ec4b[_0xc8f4('0x32')]),_0x2717ff);if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]){_0x5ab6cb[_0xc8f4('0x3c')]=_['merge'](_0x5ab6cb[_0xc8f4('0x3c')],{'$or':_[_0xc8f4('0x2b')](_0x2717ff,function(_0x3963f4){if(_0x3963f4[_0xc8f4('0x2f')]!=='VIRTUAL'){var _0x172836={};_0x172836[_0x3963f4[_0xc8f4('0x29')]]={'$like':'%'+_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x172836;}})});}_0x5ab6cb=_[_0xc8f4('0x3d')]({},_0x5ab6cb,_0xf4a556[_0xc8f4('0x3e')]);var _0xca3cc={'where':_0x5ab6cb[_0xc8f4('0x3c')]};return db[_0xc8f4('0x2c')][_0xc8f4('0x1c')](_0xca3cc)[_0xc8f4('0x24')](function(_0xd56415){_0x4d6c43['count']=_0xd56415;if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x5ab6cb[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x2c')]['findAll'](_0x5ab6cb);})['then'](function(_0x413a55){_0x4d6c43[_0xc8f4('0x41')]=_0x413a55;return _0x4d6c43;})['then'](respondWithFilteredResult(_0x3a4b1b,_0x5ab6cb))[_0xc8f4('0x42')](handleError(_0x3a4b1b,null));};exports[_0xc8f4('0x43')]=function(_0x530b69,_0x5a85bb){var _0x3c8569={'raw':!![],'where':{'id':_0x530b69[_0xc8f4('0x44')]['id']}},_0x342c28={};_0x342c28[_0xc8f4('0x33')]=_[_0xc8f4('0x45')](db[_0xc8f4('0x2c')]['rawAttributes']);_0x342c28['query']=_[_0xc8f4('0x45')](_0x530b69[_0xc8f4('0x31')]);_0x342c28[_0xc8f4('0x32')]=_['intersection'](_0x342c28['model'],_0x342c28['query']);_0x3c8569['attributes']=_['intersection'](_0x342c28[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0x530b69[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x3c8569[_0xc8f4('0x34')]=_0x3c8569[_0xc8f4('0x34')]['length']?_0x3c8569[_0xc8f4('0x34')]:_0x342c28[_0xc8f4('0x33')];if(_0x530b69['query']['includeAll']){_0x3c8569[_0xc8f4('0x40')]=[{'all':!![]}];}_0x3c8569=_[_0xc8f4('0x3d')]({},_0x3c8569,_0x530b69[_0xc8f4('0x3e')]);return db[_0xc8f4('0x2c')]['find'](_0x3c8569)['then'](handleEntityNotFound(_0x5a85bb,null))[_0xc8f4('0x24')](respondWithResult(_0x5a85bb,null))[_0xc8f4('0x42')](handleError(_0x5a85bb,null));};exports[_0xc8f4('0x46')]=function(_0x2bc4db,_0x141f81){return db[_0xc8f4('0x2c')]['create'](_0x2bc4db['body'],{})[_0xc8f4('0x24')](function(_0x447473){var _0x199b7d=_0x2bc4db[_0xc8f4('0x47')][_0xc8f4('0x48')]({'plain':!![]});if(!_0x199b7d)throw new Error(_0xc8f4('0x49'));if(_0x199b7d[_0xc8f4('0x4a')]===_0xc8f4('0x47')){var _0x3d9d67=_0x447473['get']({'plain':!![]});var _0x5c7768=_0xc8f4('0x26');return db[_0xc8f4('0x4b')][_0xc8f4('0x4c')]({'where':{'name':_0x5c7768,'userProfileId':_0x199b7d[_0xc8f4('0x4d')]},'raw':!![]})[_0xc8f4('0x24')](function(_0x165aac){if(_0x165aac&&_0x165aac[_0xc8f4('0x4e')]===0x0){return db[_0xc8f4('0x4f')][_0xc8f4('0x46')]({'name':_0x3d9d67[_0xc8f4('0x29')],'resourceId':_0x3d9d67['id'],'type':_0x165aac[_0xc8f4('0x29')],'sectionId':_0x165aac['id']},{})[_0xc8f4('0x24')](function(){return _0x447473;});}else{return _0x447473;}})[_0xc8f4('0x42')](function(_0x4ec67d){logger[_0xc8f4('0x27')](_0xc8f4('0x50'),_0x4ec67d);throw _0x4ec67d;});}return _0x447473;})[_0xc8f4('0x24')](respondWithResult(_0x141f81,0xc9))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports['update']=function(_0xd6052d,_0x450059){if(_0xd6052d['body']['id']){delete _0xd6052d['body']['id'];}return db[_0xc8f4('0x2c')]['find']({'where':{'id':_0xd6052d[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x450059,null))[_0xc8f4('0x24')](saveUpdates(_0xd6052d[_0xc8f4('0x51')],null))[_0xc8f4('0x24')](respondWithResult(_0x450059,null))[_0xc8f4('0x42')](handleError(_0x450059,null));};exports[_0xc8f4('0x25')]=function(_0x1f7602,_0x172c77){return db[_0xc8f4('0x2c')][_0xc8f4('0x4c')]({'where':{'id':_0x1f7602['params']['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x172c77,null))[_0xc8f4('0x24')](db[_0xc8f4('0x52')][_0xc8f4('0x53')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1f7602['params']['id']}}))[_0xc8f4('0x24')](removeEntity(_0x172c77,null))['catch'](handleError(_0x172c77,null));}; \ No newline at end of file +var _0xb44a=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ContactItemTypes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','CmContactHasItem','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','error','stack','name','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xb44a,0x1c2));var _0xab44=function(_0x3f7861,_0x13619b){_0x3f7861=_0x3f7861-0x0;var _0x36fdae=_0xb44a[_0x3f7861];return _0x36fdae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){var _0x1d4a2f=_0x43f1c6['get']({'plain':!![]});var _0x2439f3='ContactItemTypes';return db[_0xab44('0x24')]['destroy']({'where':{'type':_0x2439f3,'resourceId':_0x1d4a2f['id']}})['then'](function(){return _0x43f1c6;});})[_0xab44('0x23')](function(){_0x11f0b[_0xab44('0x18')](0xcc)[_0xab44('0x17')]();});}};}function handleEntityNotFound(_0x4620ed,_0x132bf6){return function(_0x4e820c){if(!_0x4e820c){_0x4620ed[_0xab44('0x16')](0x194);}return _0x4e820c;};}function handleError(_0x5587fe,_0x5071f3){_0x5071f3=_0x5071f3||0x1f4;return function(_0x887b0d){logger[_0xab44('0x25')](_0x887b0d[_0xab44('0x26')]);if(_0x887b0d[_0xab44('0x27')]){delete _0x887b0d[_0xab44('0x27')];}_0x5587fe[_0xab44('0x18')](_0x5071f3)['send'](_0x887b0d);};}exports[_0xab44('0x28')]=function(_0x43a42d,_0x36f9b6){var _0x47e1be={},_0x54cac8={},_0x106d3a={'count':0x0,'rows':[]};var _0x5082e4=_['map'](db[_0xab44('0x29')][_0xab44('0x2a')],function(_0x160177){return{'name':_0x160177[_0xab44('0x2b')],'type':_0x160177[_0xab44('0x2c')][_0xab44('0x2d')]};});_0x54cac8[_0xab44('0x2e')]=_[_0xab44('0x2f')](_0x5082e4,_0xab44('0x27'));_0x54cac8[_0xab44('0x30')]=_[_0xab44('0x31')](_0x43a42d[_0xab44('0x30')]);_0x54cac8[_0xab44('0x32')]=_[_0xab44('0x33')](_0x54cac8['model'],_0x54cac8['query']);_0x47e1be[_0xab44('0x34')]=_[_0xab44('0x33')](_0x54cac8['model'],qs[_0xab44('0x35')](_0x43a42d[_0xab44('0x30')][_0xab44('0x35')]));_0x47e1be[_0xab44('0x34')]=_0x47e1be[_0xab44('0x34')][_0xab44('0x36')]?_0x47e1be[_0xab44('0x34')]:_0x54cac8[_0xab44('0x2e')];if(!_0x43a42d[_0xab44('0x30')][_0xab44('0x37')](_0xab44('0x38'))){_0x47e1be[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x43a42d[_0xab44('0x30')][_0xab44('0x1c')]);_0x47e1be[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x43a42d[_0xab44('0x30')]['offset']);}_0x47e1be[_0xab44('0x39')]=qs[_0xab44('0x3a')](_0x43a42d[_0xab44('0x30')][_0xab44('0x3a')]);_0x47e1be['where']=qs[_0xab44('0x32')](_[_0xab44('0x3b')](_0x43a42d[_0xab44('0x30')],_0x54cac8[_0xab44('0x32')]),_0x5082e4);if(_0x43a42d[_0xab44('0x30')]['filter']){_0x47e1be[_0xab44('0x3c')]=_[_0xab44('0x3d')](_0x47e1be[_0xab44('0x3c')],{'$or':_['map'](_0x5082e4,function(_0x3ef5ea){if(_0x3ef5ea[_0xab44('0x2c')]!==_0xab44('0x3e')){var _0xf80acf={};_0xf80acf[_0x3ef5ea[_0xab44('0x27')]]={'$like':'%'+_0x43a42d['query'][_0xab44('0x3f')]+'%'};return _0xf80acf;}})});}_0x47e1be=_['merge']({},_0x47e1be,_0x43a42d[_0xab44('0x40')]);var _0x4f2b94={'where':_0x47e1be['where']};return db['ContactItemType']['count'](_0x4f2b94)['then'](function(_0x120585){_0x106d3a[_0xab44('0x1d')]=_0x120585;if(_0x43a42d[_0xab44('0x30')][_0xab44('0x41')]){_0x47e1be[_0xab44('0x42')]=[{'all':!![]}];}return db[_0xab44('0x29')][_0xab44('0x43')](_0x47e1be);})[_0xab44('0x23')](function(_0x4429e6){_0x106d3a[_0xab44('0x44')]=_0x4429e6;return _0x106d3a;})['then'](respondWithFilteredResult(_0x36f9b6,_0x47e1be))[_0xab44('0x45')](handleError(_0x36f9b6,null));};exports[_0xab44('0x46')]=function(_0x3cb9fc,_0x9a6da5){var _0x54f603={'raw':!![],'where':{'id':_0x3cb9fc[_0xab44('0x47')]['id']}},_0x3e9a79={};_0x3e9a79[_0xab44('0x2e')]=_[_0xab44('0x31')](db[_0xab44('0x29')][_0xab44('0x2a')]);_0x3e9a79['query']=_['keys'](_0x3cb9fc[_0xab44('0x30')]);_0x3e9a79[_0xab44('0x32')]=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],_0x3e9a79[_0xab44('0x30')]);_0x54f603['attributes']=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],qs[_0xab44('0x35')](_0x3cb9fc[_0xab44('0x30')]['fields']));_0x54f603[_0xab44('0x34')]=_0x54f603[_0xab44('0x34')][_0xab44('0x36')]?_0x54f603['attributes']:_0x3e9a79[_0xab44('0x2e')];if(_0x3cb9fc[_0xab44('0x30')][_0xab44('0x41')]){_0x54f603[_0xab44('0x42')]=[{'all':!![]}];}_0x54f603=_['merge']({},_0x54f603,_0x3cb9fc[_0xab44('0x40')]);return db['ContactItemType'][_0xab44('0x48')](_0x54f603)[_0xab44('0x23')](handleEntityNotFound(_0x9a6da5,null))[_0xab44('0x23')](respondWithResult(_0x9a6da5,null))[_0xab44('0x45')](handleError(_0x9a6da5,null));};exports['create']=function(_0x328891,_0x5497a3){return db[_0xab44('0x29')][_0xab44('0x49')](_0x328891[_0xab44('0x4a')],{})[_0xab44('0x23')](function(_0x14bd54){var _0x4eeef0=_0x328891[_0xab44('0x4b')]['get']({'plain':!![]});if(!_0x4eeef0)throw new Error(_0xab44('0x4c'));if(_0x4eeef0[_0xab44('0x4d')]===_0xab44('0x4b')){var _0x50b705=_0x14bd54[_0xab44('0x4e')]({'plain':!![]});var _0x105a89=_0xab44('0x4f');return db[_0xab44('0x50')][_0xab44('0x48')]({'where':{'name':_0x105a89,'userProfileId':_0x4eeef0['userProfileId']},'raw':!![]})['then'](function(_0xe5302b){if(_0xe5302b&&_0xe5302b[_0xab44('0x51')]===0x0){return db[_0xab44('0x24')]['create']({'name':_0x50b705[_0xab44('0x27')],'resourceId':_0x50b705['id'],'type':_0xe5302b[_0xab44('0x27')],'sectionId':_0xe5302b['id']},{})[_0xab44('0x23')](function(){return _0x14bd54;});}else{return _0x14bd54;}})[_0xab44('0x45')](function(_0x4eb2eb){logger['error'](_0xab44('0x52'),_0x4eb2eb);throw _0x4eb2eb;});}return _0x14bd54;})[_0xab44('0x23')](respondWithResult(_0x5497a3,0xc9))[_0xab44('0x45')](handleError(_0x5497a3,null));};exports[_0xab44('0x22')]=function(_0x109f38,_0x2234c0){if(_0x109f38[_0xab44('0x4a')]['id']){delete _0x109f38[_0xab44('0x4a')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x109f38[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x2234c0,null))[_0xab44('0x23')](saveUpdates(_0x109f38[_0xab44('0x4a')],null))[_0xab44('0x23')](respondWithResult(_0x2234c0,null))[_0xab44('0x45')](handleError(_0x2234c0,null));};exports[_0xab44('0x53')]=function(_0x411bac,_0x1e606b){return db['ContactItemType'][_0xab44('0x48')]({'where':{'id':_0x411bac[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x1e606b,null))[_0xab44('0x23')](db[_0xab44('0x54')][_0xab44('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x411bac[_0xab44('0x47')]['id']}}))[_0xab44('0x23')](removeEntity(_0x1e606b,null))['catch'](handleError(_0x1e606b,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index e22cf94..8c5abf2 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 _0x6677=['ContactItemType','tools_contact_item_types','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1e001d,_0x2d0895){var _0x1f86f9=function(_0x122940){while(--_0x122940){_0x1e001d['push'](_0x1e001d['shift']());}};_0x1f86f9(++_0x2d0895);}(_0x6677,0x1d8));var _0x7667=function(_0x10ff67,_0xfdd717){_0x10ff67=_0x10ff67-0x0;var _0x295d2a=_0x6677[_0x10ff67];return _0x295d2a;};'use strict';var _=require('lodash');var util=require(_0x7667('0x0'));var logger=require(_0x7667('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7667('0x2'));var rp=require(_0x7667('0x3'));var fs=require('fs');var path=require(_0x7667('0x4'));var rimraf=require(_0x7667('0x5'));var config=require(_0x7667('0x6'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x5e71b9,_0x2a575c){return _0x5e71b9[_0x7667('0x7')](_0x7667('0x8'),attributes,{'tableName':_0x7667('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf96e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','lodash','util'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xf96e,0x1ae));var _0xef96=function(_0x6f8f05,_0x29fece){_0x6f8f05=_0x6f8f05-0x0;var _0x1602a8=_0xf96e[_0x6f8f05];return _0x1602a8;};'use strict';var _=require(_0xef96('0x0'));var util=require(_0xef96('0x1'));var logger=require(_0xef96('0x2'))(_0xef96('0x3'));var moment=require(_0xef96('0x4'));var BPromise=require('bluebird');var rp=require(_0xef96('0x5'));var fs=require('fs');var path=require(_0xef96('0x6'));var rimraf=require(_0xef96('0x7'));var config=require(_0xef96('0x8'));var attributes=require(_0xef96('0x9'));module[_0xef96('0xa')]=function(_0x3b115a,_0x507a5e){return _0x3b115a[_0xef96('0xb')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','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 8f13da7..f3e5eff 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 _0xa63f=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','message','ContactItemType,\x20%s,\x20%s','result','catch'];(function(_0x182306,_0x1c38d5){var _0x4a0759=function(_0x385008){while(--_0x385008){_0x182306['push'](_0x182306['shift']());}};_0x4a0759(++_0x1c38d5);}(_0xa63f,0x1b8));var _0xfa63=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0xa63f[_0x6465b0];return _0x4884fe;};'use strict';var _=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var moment=require(_0xfa63('0x2'));var BPromise=require(_0xfa63('0x3'));var rs=require(_0xfa63('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa63('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa63('0x6'))(_0xfa63('0x7'));var config=require(_0xfa63('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfa63('0x9')][_0xfa63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee1b4,_0xd4f74c,_0x456b6a){return new BPromise(function(_0x3e9501,_0x1bd543){return client[_0xfa63('0xb')](_0x2ee1b4,_0x456b6a)['then'](function(_0x1754cf){logger[_0xfa63('0xc')]('ContactItemType,\x20%s,\x20%s',_0xd4f74c,_0xfa63('0xd'));logger[_0xfa63('0xe')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0xd4f74c,_0xfa63('0xd'),JSON[_0xfa63('0xf')](_0x1754cf));if(_0x1754cf[_0xfa63('0x10')]){if(_0x1754cf[_0xfa63('0x10')][_0xfa63('0x11')]===0x1f4){logger[_0xfa63('0x10')]('ContactItemType,\x20%s,\x20%s',_0xd4f74c,_0x1754cf[_0xfa63('0x10')][_0xfa63('0x12')]);return _0x1bd543(_0x1754cf[_0xfa63('0x10')][_0xfa63('0x12')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0xd4f74c,_0x1754cf[_0xfa63('0x10')][_0xfa63('0x12')]);return _0x3e9501(_0x1754cf[_0xfa63('0x10')]['message']);}else{logger['info'](_0xfa63('0x13'),_0xd4f74c,_0xfa63('0xd'));_0x3e9501(_0x1754cf[_0xfa63('0x14')]['message']);}})[_0xfa63('0x15')](function(_0x2241c0){logger[_0xfa63('0x10')]('ContactItemType,\x20%s,\x20%s',_0xd4f74c,_0x2241c0);_0x1bd543(_0x2241c0);});});} \ No newline at end of file +var _0xbafb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x14cb58,_0x214d62){var _0x5f097e=function(_0x5b8666){while(--_0x5b8666){_0x14cb58['push'](_0x14cb58['shift']());}};_0x5f097e(++_0x214d62);}(_0xbafb,0xf0));var _0xbbaf=function(_0x22c7fd,_0x363269){_0x22c7fd=_0x22c7fd-0x0;var _0x4ca673=_0xbafb[_0x22c7fd];return _0x4ca673;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbbaf('0x0'));var rs=require(_0xbbaf('0x1'));var fs=require('fs');var Redis=require(_0xbbaf('0x2'));var db=require(_0xbbaf('0x3'))['db'];var utils=require(_0xbbaf('0x4'));var logger=require(_0xbbaf('0x5'))(_0xbbaf('0x6'));var config=require('../../config/environment');var jayson=require(_0xbbaf('0x7'));var client=jayson['client'][_0xbbaf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c7004,_0x3f6862,_0x751f84){return new BPromise(function(_0x52baa6,_0x211314){return client[_0xbbaf('0x9')](_0x3c7004,_0x751f84)[_0xbbaf('0xa')](function(_0x263dc5){logger['info'](_0xbbaf('0xb'),_0x3f6862,_0xbbaf('0xc'));logger[_0xbbaf('0xd')](_0xbbaf('0xe'),_0x3f6862,_0xbbaf('0xc'),JSON[_0xbbaf('0xf')](_0x263dc5));if(_0x263dc5[_0xbbaf('0x10')]){if(_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x11')]===0x1f4){logger[_0xbbaf('0x10')](_0xbbaf('0xb'),_0x3f6862,_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);return _0x211314(_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);}logger[_0xbbaf('0x10')](_0xbbaf('0xb'),_0x3f6862,_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);return _0x52baa6(_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);}else{logger[_0xbbaf('0x13')](_0xbbaf('0xb'),_0x3f6862,'request\x20sent');_0x52baa6(_0x263dc5['result'][_0xbbaf('0x12')]);}})['catch'](function(_0x327f67){logger[_0xbbaf('0x10')](_0xbbaf('0xb'),_0x3f6862,_0x327f67);_0x211314(_0x327f67);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index be1828e..5617b93 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 _0xea7c=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','post','/:id','update','delete','destroy','exports'];(function(_0x13052e,_0x3fb64d){var _0x217a6f=function(_0x51d8c3){while(--_0x51d8c3){_0x13052e['push'](_0x13052e['shift']());}};_0x217a6f(++_0x3fb64d);}(_0xea7c,0x72));var _0xcea7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xea7c[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xcea7('0x0'));var util=require('util');var path=require(_0xcea7('0x1'));var timeout=require(_0xcea7('0x2'));var express=require(_0xcea7('0x3'));var router=express[_0xcea7('0x4')]();var fs_extra=require(_0xcea7('0x5'));var auth=require(_0xcea7('0x6'));var interaction=require(_0xcea7('0x7'));var config=require(_0xcea7('0x8'));var controller=require(_0xcea7('0x9'));router[_0xcea7('0xa')]('/',auth[_0xcea7('0xb')](),controller[_0xcea7('0xc')]);router[_0xcea7('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcea7('0xd')]('/',auth[_0xcea7('0xb')](),controller['create']);router['put'](_0xcea7('0xe'),auth[_0xcea7('0xb')](),controller[_0xcea7('0xf')]);router[_0xcea7('0x10')](_0xcea7('0xe'),auth[_0xcea7('0xb')](),controller[_0xcea7('0x11')]);module[_0xcea7('0x12')]=router; \ No newline at end of file +var _0x79c7=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show'];(function(_0x86b88f,_0x12d21f){var _0x3e3bc4=function(_0xc3bdd){while(--_0xc3bdd){_0x86b88f['push'](_0x86b88f['shift']());}};_0x3e3bc4(++_0x12d21f);}(_0x79c7,0x154));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x779c('0x0'));var util=require(_0x779c('0x1'));var path=require(_0x779c('0x2'));var timeout=require(_0x779c('0x3'));var express=require(_0x779c('0x4'));var router=express[_0x779c('0x5')]();var fs_extra=require(_0x779c('0x6'));var auth=require(_0x779c('0x7'));var interaction=require(_0x779c('0x8'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router['get']('/',auth[_0x779c('0x9')](),controller['index']);router['get'](_0x779c('0xa'),auth['isAuthenticated'](),controller[_0x779c('0xb')]);router['post']('/',auth[_0x779c('0x9')](),controller[_0x779c('0xc')]);router['put'](_0x779c('0xa'),auth[_0x779c('0x9')](),controller['update']);router[_0x779c('0xd')]('/:id',auth[_0x779c('0x9')](),controller[_0x779c('0xe')]);module[_0x779c('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index dd282e8..b65bf88 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 _0xe706=['STRING','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe706,0xa3));var _0x6e70=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0xe706[_0xdd827a];return _0x2f46f1;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x4e3557,_0x31c9e4){var _0x3e82d5=function(_0x55e147){while(--_0x55e147){_0x4e3557['push'](_0x4e3557['shift']());}};_0x3e82d5(++_0x31c9e4);}(_0xb10b,0x12a));var _0xbb10=function(_0x441fae,_0x3ab2ee){_0x441fae=_0x441fae-0x0;var _0x189025=_0xb10b[_0x441fae];return _0x189025;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 2eed9af..0098fa4 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 _0xd2f1=['filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','catch','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','updatedAt','omit','createdAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','web-report','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','order','pick','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','end','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2fdeab,_0x16ed2a){var _0x39bbf9=function(_0x482658){while(--_0x482658){_0x2fdeab['push'](_0x2fdeab['shift']());}};_0x39bbf9(++_0x16ed2a);}(_0xd2f1,0xbe));var _0x1d2f=function(_0x1e21e0,_0x457de4){_0x1e21e0=_0x1e21e0-0x0;var _0x4ef9fe=_0xd2f1[_0x1e21e0];return _0x4ef9fe;};'use strict';var emlformat=require(_0x1d2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d2f('0x1'));var jsonpatch=require(_0x1d2f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1d2f('0x3'));var Mustache=require(_0x1d2f('0x4'));var util=require(_0x1d2f('0x5'));var path=require(_0x1d2f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d2f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d2f('0x8'));var squel=require('squel');var crypto=require(_0x1d2f('0x9'));var jsforce=require(_0x1d2f('0xa'));var deskjs=require(_0x1d2f('0xb'));var toCsv=require(_0x1d2f('0xc'));var querystring=require('querystring');var Papa=require(_0x1d2f('0xd'));var Redis=require(_0x1d2f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1d2f('0xf'));var as=require(_0x1d2f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d2f('0x11'));var utils=require(_0x1d2f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1d2f('0x13'));var db=require('../../mysqldb')['db'];config[_0x1d2f('0x14')]=_[_0x1d2f('0x15')](config[_0x1d2f('0x14')],{'host':_0x1d2f('0x16'),'port':0x18eb});var socket=require(_0x1d2f('0x17'))(new Redis(config['redis']));require('./dashboard.socket')[_0x1d2f('0x18')](socket);function respondWithStatusCode(_0x2aa1aa,_0x577b81){_0x577b81=_0x577b81||0xcc;return function(_0x3a2da3){if(_0x3a2da3){return _0x2aa1aa[_0x1d2f('0x19')](_0x577b81);}return _0x2aa1aa[_0x1d2f('0x1a')](_0x577b81)['end']();};}function respondWithResult(_0x5eb2e3,_0x2b2da4){_0x2b2da4=_0x2b2da4||0xc8;return function(_0x46d7b2){if(_0x46d7b2){return _0x5eb2e3[_0x1d2f('0x1a')](_0x2b2da4)[_0x1d2f('0x1b')](_0x46d7b2);}};}function respondWithFilteredResult(_0x3acd6d,_0x4d96d6){return function(_0x38a60e){if(_0x38a60e){var _0x5eaa30=typeof _0x4d96d6[_0x1d2f('0x1c')]==='undefined'&&typeof _0x4d96d6['limit']===_0x1d2f('0x1d');var _0x5625cc=_0x38a60e[_0x1d2f('0x1e')];var _0x2966d3=_0x5eaa30?0x0:_0x4d96d6[_0x1d2f('0x1c')];var _0x37fa25=_0x5eaa30?_0x38a60e[_0x1d2f('0x1e')]:_0x4d96d6[_0x1d2f('0x1c')]+_0x4d96d6[_0x1d2f('0x1f')];var _0x2c867b;if(_0x37fa25>=_0x5625cc){_0x37fa25=_0x5625cc;_0x2c867b=0xc8;}else{_0x2c867b=0xce;}_0x3acd6d['status'](_0x2c867b);return _0x3acd6d[_0x1d2f('0x20')](_0x1d2f('0x21'),_0x2966d3+'-'+_0x37fa25+'/'+_0x5625cc)[_0x1d2f('0x1b')](_0x38a60e);}return null;};}function patchUpdates(_0x5b63a1){return function(_0x276ff9){try{jsonpatch['apply'](_0x276ff9,_0x5b63a1,!![]);}catch(_0x252885){return BPromise[_0x1d2f('0x22')](_0x252885);}return _0x276ff9[_0x1d2f('0x23')]();};}function saveUpdates(_0x37b504,_0x2e43ad){return function(_0x474805){if(_0x474805){return _0x474805['update'](_0x37b504)[_0x1d2f('0x24')](function(_0x10d460){return _0x10d460;});}return null;};}function removeEntity(_0x19ee71,_0x1f9126){return function(_0x1ac6b){if(_0x1ac6b){return _0x1ac6b[_0x1d2f('0x25')]()['then'](function(){var _0x1b6594=_0x1ac6b[_0x1d2f('0x26')]({'plain':!![]});var _0x3332ac=_0x1d2f('0x27');return db[_0x1d2f('0x28')][_0x1d2f('0x25')]({'where':{'type':_0x3332ac,'resourceId':_0x1b6594['id']}})[_0x1d2f('0x24')](function(){return _0x1ac6b;});})[_0x1d2f('0x24')](function(){_0x19ee71[_0x1d2f('0x1a')](0xcc)[_0x1d2f('0x29')]();});}};}function handleEntityNotFound(_0x8c181e,_0x350101){return function(_0x11b85f){if(!_0x11b85f){_0x8c181e[_0x1d2f('0x19')](0x194);}return _0x11b85f;};}function handleError(_0x47592f,_0x48bb53){_0x48bb53=_0x48bb53||0x1f4;return function(_0x97095){logger['error'](_0x97095['stack']);if(_0x97095[_0x1d2f('0x2a')]){delete _0x97095['name'];}_0x47592f[_0x1d2f('0x1a')](_0x48bb53)[_0x1d2f('0x2b')](_0x97095);};}exports[_0x1d2f('0x2c')]=function(_0x6d6184,_0x4a94b7){var _0xcdcb4d={},_0x261f71={},_0x16a472={'count':0x0,'rows':[]};var _0x3a68db=_['map'](db[_0x1d2f('0x2d')][_0x1d2f('0x2e')],function(_0x3a418e){return{'name':_0x3a418e[_0x1d2f('0x2f')],'type':_0x3a418e[_0x1d2f('0x30')][_0x1d2f('0x31')]};});_0x261f71[_0x1d2f('0x32')]=_[_0x1d2f('0x33')](_0x3a68db,'name');_0x261f71[_0x1d2f('0x34')]=_[_0x1d2f('0x35')](_0x6d6184[_0x1d2f('0x34')]);_0x261f71[_0x1d2f('0x36')]=_[_0x1d2f('0x37')](_0x261f71[_0x1d2f('0x32')],_0x261f71[_0x1d2f('0x34')]);_0xcdcb4d[_0x1d2f('0x38')]=_[_0x1d2f('0x37')](_0x261f71[_0x1d2f('0x32')],qs[_0x1d2f('0x39')](_0x6d6184[_0x1d2f('0x34')][_0x1d2f('0x39')]));_0xcdcb4d[_0x1d2f('0x38')]=_0xcdcb4d[_0x1d2f('0x38')][_0x1d2f('0x3a')]?_0xcdcb4d[_0x1d2f('0x38')]:_0x261f71[_0x1d2f('0x32')];if(!_0x6d6184['query'][_0x1d2f('0x3b')](_0x1d2f('0x3c'))){_0xcdcb4d[_0x1d2f('0x1f')]=qs[_0x1d2f('0x1f')](_0x6d6184[_0x1d2f('0x34')][_0x1d2f('0x1f')]);_0xcdcb4d[_0x1d2f('0x1c')]=qs[_0x1d2f('0x1c')](_0x6d6184[_0x1d2f('0x34')]['offset']);}_0xcdcb4d['order']=qs[_0x1d2f('0x3d')](_0x6d6184['query'][_0x1d2f('0x3d')]);_0xcdcb4d['where']=qs[_0x1d2f('0x36')](_['pick'](_0x6d6184[_0x1d2f('0x34')],_0x261f71[_0x1d2f('0x36')]),_0x3a68db);if(_0x6d6184['query'][_0x1d2f('0x3e')]){_0xcdcb4d[_0x1d2f('0x3f')]=_[_0x1d2f('0x40')](_0xcdcb4d[_0x1d2f('0x3f')],{'$or':_[_0x1d2f('0x33')](_0x3a68db,function(_0x1ee33a){if(_0x1ee33a[_0x1d2f('0x30')]!==_0x1d2f('0x41')){var _0x164e2a={};_0x164e2a[_0x1ee33a[_0x1d2f('0x2a')]]={'$like':'%'+_0x6d6184[_0x1d2f('0x34')][_0x1d2f('0x3e')]+'%'};return _0x164e2a;}})});}_0xcdcb4d=_[_0x1d2f('0x40')]({},_0xcdcb4d,_0x6d6184[_0x1d2f('0x42')]);var _0xed3bf={'where':_0xcdcb4d[_0x1d2f('0x3f')]};return db[_0x1d2f('0x2d')]['count'](_0xed3bf)[_0x1d2f('0x24')](function(_0x1dab04){_0x16a472[_0x1d2f('0x1e')]=_0x1dab04;if(_0x6d6184[_0x1d2f('0x34')][_0x1d2f('0x43')]){_0xcdcb4d['include']=[{'all':!![]}];}return db[_0x1d2f('0x2d')][_0x1d2f('0x44')](_0xcdcb4d);})['then'](function(_0x54ab60){_0x16a472['rows']=_0x54ab60;return _0x16a472;})[_0x1d2f('0x24')](respondWithFilteredResult(_0x4a94b7,_0xcdcb4d))['catch'](handleError(_0x4a94b7,null));};exports[_0x1d2f('0x45')]=function(_0x3a3bc4,_0x12e416){var _0x55b8e2={'raw':![],'where':{'id':_0x3a3bc4[_0x1d2f('0x46')]['id']}},_0x5a1140={};_0x5a1140['model']=_[_0x1d2f('0x35')](db[_0x1d2f('0x2d')][_0x1d2f('0x2e')]);_0x5a1140[_0x1d2f('0x34')]=_['keys'](_0x3a3bc4[_0x1d2f('0x34')]);_0x5a1140[_0x1d2f('0x36')]=_[_0x1d2f('0x37')](_0x5a1140[_0x1d2f('0x32')],_0x5a1140['query']);_0x55b8e2[_0x1d2f('0x38')]=_[_0x1d2f('0x37')](_0x5a1140[_0x1d2f('0x32')],qs[_0x1d2f('0x39')](_0x3a3bc4[_0x1d2f('0x34')][_0x1d2f('0x39')]));_0x55b8e2[_0x1d2f('0x38')]=_0x55b8e2[_0x1d2f('0x38')][_0x1d2f('0x3a')]?_0x55b8e2[_0x1d2f('0x38')]:_0x5a1140['model'];if(_0x3a3bc4[_0x1d2f('0x34')][_0x1d2f('0x43')]){_0x55b8e2[_0x1d2f('0x47')]=[{'all':!![]}];}_0x55b8e2=_[_0x1d2f('0x40')]({},_0x55b8e2,_0x3a3bc4[_0x1d2f('0x42')]);return db[_0x1d2f('0x2d')][_0x1d2f('0x48')](_0x55b8e2)['then'](handleEntityNotFound(_0x12e416,null))[_0x1d2f('0x24')](respondWithResult(_0x12e416,null))[_0x1d2f('0x49')](handleError(_0x12e416,null));};exports[_0x1d2f('0x4a')]=function(_0x31b660,_0x29c8f8){return db['Dashboard']['create'](_0x31b660[_0x1d2f('0x4b')],{})[_0x1d2f('0x24')](function(_0x5475da){var _0x38882c=_0x31b660[_0x1d2f('0x4c')]['get']({'plain':!![]});if(!_0x38882c)throw new Error(_0x1d2f('0x4d'));if(_0x38882c[_0x1d2f('0x4e')]==='user'){var _0x59d49f=_0x5475da[_0x1d2f('0x26')]({'plain':!![]});var _0x4c7161='CustomDashboards';return db[_0x1d2f('0x4f')][_0x1d2f('0x48')]({'where':{'name':_0x4c7161,'userProfileId':_0x38882c[_0x1d2f('0x50')]},'raw':!![]})['then'](function(_0x4fbbd4){if(_0x4fbbd4&&_0x4fbbd4[_0x1d2f('0x51')]===0x0){return db[_0x1d2f('0x28')]['create']({'name':_0x59d49f[_0x1d2f('0x2a')],'resourceId':_0x59d49f['id'],'type':_0x4fbbd4[_0x1d2f('0x2a')],'sectionId':_0x4fbbd4['id']},{})[_0x1d2f('0x24')](function(){return _0x5475da;});}else{return _0x5475da;}})[_0x1d2f('0x49')](function(_0x27014b){logger[_0x1d2f('0x52')](_0x1d2f('0x53'),_0x27014b);throw _0x27014b;});}return _0x5475da;})[_0x1d2f('0x24')](respondWithResult(_0x29c8f8,0xc9))[_0x1d2f('0x49')](handleError(_0x29c8f8,null));};exports['clone']=function(_0x2b3568,_0x2fcd6a){var _0x1663af={'where':{'id':_0x2b3568[_0x1d2f('0x46')]['id']}},_0xa555f2={};_0xa555f2[_0x1d2f('0x32')]=_[_0x1d2f('0x35')](db['Dashboard'][_0x1d2f('0x2e')]);_0x1663af[_0x1d2f('0x38')]=_[_0x1d2f('0x37')](_0xa555f2[_0x1d2f('0x32')],qs[_0x1d2f('0x39')](_0x2b3568['query']['fields']));_0x1663af[_0x1d2f('0x38')]=_0x1663af['attributes']['length']?_0x1663af[_0x1d2f('0x38')]:_0xa555f2[_0x1d2f('0x32')];if(_0x2b3568[_0x1d2f('0x34')][_0x1d2f('0x43')]){_0x1663af[_0x1d2f('0x47')]=[{'all':!![]}];}_0x1663af=_[_0x1d2f('0x40')]({},_0x1663af,_0x2b3568['options']);return db[_0x1d2f('0x2d')][_0x1d2f('0x48')](_0x1663af)[_0x1d2f('0x24')](handleEntityNotFound(_0x2fcd6a,null))['then'](function(_0x1c5dc4){if(_0x1c5dc4){var _0x4d0cf3=_0x1c5dc4[_0x1d2f('0x26')]({'plain':!![]});_0x4d0cf3=qs['omit'](_0x4d0cf3,['id','createdAt',_0x1d2f('0x54')]);_0x2b3568[_0x1d2f('0x4b')]=_[_0x1d2f('0x55')](_0x2b3568[_0x1d2f('0x4b')],['id',_0x1d2f('0x56'),_0x1d2f('0x54')]);return db[_0x1d2f('0x2d')][_0x1d2f('0x4a')](_[_0x1d2f('0x40')](_0x4d0cf3,_0x2b3568[_0x1d2f('0x4b')]),{'include':_0x2b3568['query'][_0x1d2f('0x43')]?[{'all':!![]}]:undefined})[_0x1d2f('0x24')](function(_0x59f2b0){var _0x3b9e08=_0x2b3568[_0x1d2f('0x4c')][_0x1d2f('0x26')]({'plain':!![]});if(!_0x3b9e08)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b9e08[_0x1d2f('0x4e')]===_0x1d2f('0x4c')){var _0x354179=_0x59f2b0[_0x1d2f('0x26')]({'plain':!![]});var _0x39b98e=_0x1d2f('0x27');return db[_0x1d2f('0x4f')][_0x1d2f('0x48')]({'where':{'name':_0x39b98e,'userProfileId':_0x3b9e08[_0x1d2f('0x50')]},'raw':!![]})[_0x1d2f('0x24')](function(_0x5996ff){if(_0x5996ff&&_0x5996ff[_0x1d2f('0x51')]===0x0){return db[_0x1d2f('0x28')][_0x1d2f('0x4a')]({'name':_0x354179['name'],'resourceId':_0x354179['id'],'type':_0x5996ff['name'],'sectionId':_0x5996ff['id']},{})[_0x1d2f('0x24')](function(){return _0x59f2b0;});}else{return _0x59f2b0;}})[_0x1d2f('0x49')](function(_0x2d493e){logger[_0x1d2f('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d493e);throw _0x2d493e;});}return _0x59f2b0;});}})['then'](respondWithResult(_0x2fcd6a,0xc9))[_0x1d2f('0x49')](handleError(_0x2fcd6a,null));};exports['update']=function(_0x384fcc,_0x7f8658){if(_0x384fcc['body']['id']){delete _0x384fcc[_0x1d2f('0x4b')]['id'];}return db[_0x1d2f('0x2d')][_0x1d2f('0x48')]({'where':{'id':_0x384fcc[_0x1d2f('0x46')]['id']}})[_0x1d2f('0x24')](handleEntityNotFound(_0x7f8658,null))[_0x1d2f('0x24')](saveUpdates(_0x384fcc[_0x1d2f('0x4b')],null))['then'](respondWithResult(_0x7f8658,null))[_0x1d2f('0x49')](handleError(_0x7f8658,null));};exports[_0x1d2f('0x25')]=function(_0x2913a9,_0x1d371f){return db['Dashboard'][_0x1d2f('0x48')]({'where':{'id':_0x2913a9[_0x1d2f('0x46')]['id']}})[_0x1d2f('0x24')](handleEntityNotFound(_0x1d371f,null))[_0x1d2f('0x24')](removeEntity(_0x1d371f,null))['catch'](handleError(_0x1d371f,null));};function widgetAttributes(_0x21cebb){try{switch(_0x21cebb['type']){case _0x1d2f('0x57'):return[{'name':_0x1d2f('0x58'),'value':_0x21cebb[_0x1d2f('0x58')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb['attrs'][0x0][_0x1d2f('0x5a')]:undefined)||_0x1d2f('0x5b')}];case _0x1d2f('0x5c'):return[{'name':'attrPath','value':_0x21cebb[_0x1d2f('0x5d')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb[_0x1d2f('0x59')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x21cebb[_0x1d2f('0x5e')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb[_0x1d2f('0x59')][0x0][_0x1d2f('0x5a')]:undefined)||_0x1d2f('0x5f')},{'name':'attrTimezone','value':_0x21cebb[_0x1d2f('0x60')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x1]?_0x21cebb['attrs'][0x1][_0x1d2f('0x5a')]:undefined)||_0x1d2f('0x61')},{'name':_0x1d2f('0x62'),'value':_0x21cebb[_0x1d2f('0x62')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x2]?_0x21cebb[_0x1d2f('0x59')][0x2][_0x1d2f('0x5a')]:undefined)||0xc}];case _0x1d2f('0x63'):return[{'name':_0x1d2f('0x64'),'value':_0x21cebb['attrMetric']||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb['attrs'][0x0][_0x1d2f('0x5a')]:undefined)||_0x1d2f('0x65')},{'name':_0x1d2f('0x66'),'value':_0x21cebb[_0x1d2f('0x66')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x1]?_0x21cebb[_0x1d2f('0x59')][0x1][_0x1d2f('0x5a')]:undefined)||[]},{'name':_0x1d2f('0x62'),'value':_0x21cebb[_0x1d2f('0x62')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb['attrs'][0x2]?_0x21cebb[_0x1d2f('0x59')][0x2][_0x1d2f('0x5a')]:undefined)||0x14},{'name':'attrChannel','value':_0x21cebb['attrChannel']||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb['attrs'][0x3]?_0x21cebb[_0x1d2f('0x59')][0x3][_0x1d2f('0x5a')]:undefined)||_0x1d2f('0x67')},{'name':_0x1d2f('0x68'),'value':_0x21cebb[_0x1d2f('0x68')]||(_0x21cebb['attrs']&&_0x21cebb[_0x1d2f('0x59')][0x4]?_0x21cebb[_0x1d2f('0x59')][0x4][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x69'),'value':_0x21cebb[_0x1d2f('0x69')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x5]?_0x21cebb[_0x1d2f('0x59')][0x5]['value']:undefined)||''},{'name':_0x1d2f('0x6a'),'value':_0x21cebb[_0x1d2f('0x6a')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x6]?_0x21cebb['attrs'][0x6][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x6b'),'value':_0x21cebb[_0x1d2f('0x6b')]||(_0x21cebb['attrs']&&_0x21cebb[_0x1d2f('0x59')][0x7]?_0x21cebb[_0x1d2f('0x59')][0x7][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x6c'),'value':_0x21cebb[_0x1d2f('0x6c')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x8]?_0x21cebb['attrs'][0x8][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x6d'),'value':_0x21cebb[_0x1d2f('0x6d')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x9]?_0x21cebb[_0x1d2f('0x59')][0x9]['value']:undefined)||''}];case _0x1d2f('0x6e'):case _0x1d2f('0x6f'):return[{'name':_0x1d2f('0x70'),'value':_0x21cebb[_0x1d2f('0x70')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb['attrs'][0x0][_0x1d2f('0x5a')]:undefined)||_0x1d2f('0x65')},{'name':_0x1d2f('0x71'),'value':_0x21cebb[_0x1d2f('0x71')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x1]?_0x21cebb['attrs'][0x1][_0x1d2f('0x5a')]:undefined)||null},{'name':_0x1d2f('0x72'),'value':_0x21cebb[_0x1d2f('0x72')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x2]?_0x21cebb[_0x1d2f('0x59')][0x2]['value']:undefined)||null},{'name':_0x1d2f('0x66'),'value':_0x21cebb[_0x1d2f('0x66')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x3]?_0x21cebb[_0x1d2f('0x59')][0x3][_0x1d2f('0x5a')]:undefined)||[]},{'name':_0x1d2f('0x73'),'value':_0x21cebb[_0x1d2f('0x73')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x4]?_0x21cebb[_0x1d2f('0x59')][0x4]['value']:undefined)||_0x1d2f('0x67')},{'name':_0x1d2f('0x68'),'value':_0x21cebb[_0x1d2f('0x68')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x5]?_0x21cebb[_0x1d2f('0x59')][0x5][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x69'),'value':_0x21cebb[_0x1d2f('0x69')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x6]?_0x21cebb[_0x1d2f('0x59')][0x6]['value']:undefined)||''},{'name':_0x1d2f('0x6a'),'value':_0x21cebb[_0x1d2f('0x6a')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x7]?_0x21cebb[_0x1d2f('0x59')][0x7][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x6b'),'value':_0x21cebb[_0x1d2f('0x6b')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x8]?_0x21cebb[_0x1d2f('0x59')][0x8][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x6c'),'value':_0x21cebb[_0x1d2f('0x6c')]||(_0x21cebb['attrs']&&_0x21cebb[_0x1d2f('0x59')][0x9]?_0x21cebb[_0x1d2f('0x59')][0x9][_0x1d2f('0x5a')]:undefined)||''},{'name':_0x1d2f('0x6d'),'value':_0x21cebb[_0x1d2f('0x6d')]||(_0x21cebb['attrs']&&_0x21cebb['attrs'][0xa]?_0x21cebb['attrs'][0xa]['value']:undefined)||''}];case _0x1d2f('0x74'):return[{'name':'attrReport','type':_0x21cebb['reportType']||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb[_0x1d2f('0x59')][0x0][_0x1d2f('0x30')]:undefined)||null,'value':_0x21cebb[_0x1d2f('0x75')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb[_0x1d2f('0x59')][0x0]?_0x21cebb['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x21cebb[_0x1d2f('0x76')]||(_0x21cebb[_0x1d2f('0x59')]&&_0x21cebb['attrs'][0x1]?_0x21cebb[_0x1d2f('0x59')][0x1][_0x1d2f('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0xcd3189){logger[_0x1d2f('0x52')]('widgetAttributes:\x20%s',JSON[_0x1d2f('0x77')](_0xcd3189));return[];}}exports['addItem']=function(_0x1394cd,_0x43c12d,_0x56b038){if(_0x1394cd[_0x1d2f('0x4b')]['id']){delete _0x1394cd[_0x1d2f('0x4b')]['id'];}return db['Dashboard'][_0x1d2f('0x48')]({'where':{'id':_0x1394cd[_0x1d2f('0x46')]['id']}})[_0x1d2f('0x24')](handleEntityNotFound(_0x43c12d,null))[_0x1d2f('0x24')](function(_0x13e6d9){if(_0x13e6d9){_0x1394cd[_0x1d2f('0x4b')][_0x1d2f('0x78')]=_0x13e6d9['id'];_0x1394cd[_0x1d2f('0x4b')][_0x1d2f('0x59')]=widgetAttributes(_0x1394cd[_0x1d2f('0x4b')]);return db[_0x1d2f('0x79')][_0x1d2f('0x4a')](_0x1394cd[_0x1d2f('0x4b')]);}})[_0x1d2f('0x24')](respondWithResult(_0x43c12d,null))[_0x1d2f('0x49')](handleError(_0x43c12d,null));};exports[_0x1d2f('0x7a')]=function(_0x529e6b,_0x162ddc,_0x10aeff){var _0x4cef39={};var _0x4293c7={};var _0x299a2e;var _0x3128c8;return db[_0x1d2f('0x2d')][_0x1d2f('0x7b')]({'where':{'id':_0x529e6b[_0x1d2f('0x46')]['id']}})[_0x1d2f('0x24')](handleEntityNotFound(_0x162ddc,null))[_0x1d2f('0x24')](function(_0x57c425){if(_0x57c425){_0x299a2e=_0x57c425;_0x4293c7[_0x1d2f('0x32')]=_[_0x1d2f('0x35')](db[_0x1d2f('0x79')]['rawAttributes']);_0x4293c7[_0x1d2f('0x34')]=_[_0x1d2f('0x35')](_0x529e6b[_0x1d2f('0x34')]);_0x4293c7['filters']=_[_0x1d2f('0x37')](_0x4293c7[_0x1d2f('0x32')],_0x4293c7[_0x1d2f('0x34')]);_0x4cef39[_0x1d2f('0x38')]=_[_0x1d2f('0x37')](_0x4293c7[_0x1d2f('0x32')],qs['fields'](_0x529e6b[_0x1d2f('0x34')][_0x1d2f('0x39')]));_0x4cef39[_0x1d2f('0x38')]=_0x4cef39['attributes'][_0x1d2f('0x3a')]?_0x4cef39[_0x1d2f('0x38')]:_0x4293c7[_0x1d2f('0x32')];_0x4cef39[_0x1d2f('0x7c')]=qs[_0x1d2f('0x3d')](_0x529e6b[_0x1d2f('0x34')][_0x1d2f('0x3d')]);_0x4cef39[_0x1d2f('0x3f')]=qs[_0x1d2f('0x36')](_[_0x1d2f('0x7d')](_0x529e6b[_0x1d2f('0x34')],_0x4293c7['filters']));if(_0x529e6b['query'][_0x1d2f('0x3e')]){_0x4cef39[_0x1d2f('0x3f')]=_[_0x1d2f('0x40')](_0x4cef39['where'],{'$or':_[_0x1d2f('0x33')](_0x4cef39[_0x1d2f('0x38')],function(_0x25264f){var _0x1310af={};_0x1310af[_0x25264f]={'$like':'%'+_0x529e6b[_0x1d2f('0x34')][_0x1d2f('0x3e')]+'%'};return _0x1310af;})});}_0x4cef39=_[_0x1d2f('0x40')]({},_0x4cef39,_0x529e6b['options']);return _0x299a2e[_0x1d2f('0x7a')](_0x4cef39);}})['then'](function(_0x3e168f){if(_0x3e168f){_0x3128c8=_0x3e168f['length'];if(!_0x529e6b[_0x1d2f('0x34')][_0x1d2f('0x3b')](_0x1d2f('0x3c'))){_0x4cef39[_0x1d2f('0x1f')]=qs[_0x1d2f('0x1f')](_0x529e6b[_0x1d2f('0x34')][_0x1d2f('0x1f')]);_0x4cef39[_0x1d2f('0x1c')]=qs[_0x1d2f('0x1c')](_0x529e6b['query'][_0x1d2f('0x1c')]);}return _0x299a2e[_0x1d2f('0x7a')](_0x4cef39);}})[_0x1d2f('0x24')](function(_0x4d1778){if(_0x4d1778){return _0x4d1778?{'count':_0x3128c8,'rows':_0x4d1778}:null;}})[_0x1d2f('0x24')](respondWithResult(_0x162ddc,null))[_0x1d2f('0x49')](handleError(_0x162ddc,null));}; \ No newline at end of file +var _0xbfe0=['undefined','limit','count','set','apply','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','body','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrFaxAccounts','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset'];(function(_0x3e6ac0,_0x34b200){var _0xe1dee5=function(_0x8864a8){while(--_0x8864a8){_0x3e6ac0['push'](_0x3e6ac0['shift']());}};_0xe1dee5(++_0x34b200);}(_0xbfe0,0xeb));var _0x0bfe=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xbfe0[_0x18fb16];return _0x147b0d;};'use strict';var emlformat=require(_0x0bfe('0x0'));var rimraf=require(_0x0bfe('0x1'));var zipdir=require(_0x0bfe('0x2'));var jsonpatch=require(_0x0bfe('0x3'));var rp=require('request-promise');var moment=require(_0x0bfe('0x4'));var BPromise=require(_0x0bfe('0x5'));var Mustache=require('mustache');var util=require(_0x0bfe('0x6'));var path=require(_0x0bfe('0x7'));var sox=require(_0x0bfe('0x8'));var csv=require(_0x0bfe('0x9'));var ejs=require(_0x0bfe('0xa'));var fs=require('fs');var fs_extra=require(_0x0bfe('0xb'));var _=require(_0x0bfe('0xc'));var squel=require(_0x0bfe('0xd'));var crypto=require(_0x0bfe('0xe'));var jsforce=require(_0x0bfe('0xf'));var deskjs=require(_0x0bfe('0x10'));var toCsv=require(_0x0bfe('0x9'));var querystring=require(_0x0bfe('0x11'));var Papa=require(_0x0bfe('0x12'));var Redis=require('ioredis');var authService=require(_0x0bfe('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bfe('0x14'));var logger=require('../../config/logger')(_0x0bfe('0x15'));var utils=require(_0x0bfe('0x16'));var config=require(_0x0bfe('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bfe('0x18'))['db'];config[_0x0bfe('0x19')]=_[_0x0bfe('0x1a')](config[_0x0bfe('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0bfe('0x1b'))(new Redis(config[_0x0bfe('0x19')]));require(_0x0bfe('0x1c'))['register'](socket);function respondWithStatusCode(_0x3d6e16,_0x2a975a){_0x2a975a=_0x2a975a||0xcc;return function(_0x518676){if(_0x518676){return _0x3d6e16[_0x0bfe('0x1d')](_0x2a975a);}return _0x3d6e16[_0x0bfe('0x1e')](_0x2a975a)['end']();};}function respondWithResult(_0x57ae1e,_0x5c8d9f){_0x5c8d9f=_0x5c8d9f||0xc8;return function(_0x3b63e6){if(_0x3b63e6){return _0x57ae1e[_0x0bfe('0x1e')](_0x5c8d9f)[_0x0bfe('0x1f')](_0x3b63e6);}};}function respondWithFilteredResult(_0x199588,_0x26f465){return function(_0x1b7342){if(_0x1b7342){var _0x335f1d=typeof _0x26f465[_0x0bfe('0x20')]===_0x0bfe('0x21')&&typeof _0x26f465[_0x0bfe('0x22')]===_0x0bfe('0x21');var _0x7b91dd=_0x1b7342[_0x0bfe('0x23')];var _0x13bb3f=_0x335f1d?0x0:_0x26f465[_0x0bfe('0x20')];var _0x47ead3=_0x335f1d?_0x1b7342['count']:_0x26f465['offset']+_0x26f465[_0x0bfe('0x22')];var _0x52af65;if(_0x47ead3>=_0x7b91dd){_0x47ead3=_0x7b91dd;_0x52af65=0xc8;}else{_0x52af65=0xce;}_0x199588[_0x0bfe('0x1e')](_0x52af65);return _0x199588[_0x0bfe('0x24')]('Content-Range',_0x13bb3f+'-'+_0x47ead3+'/'+_0x7b91dd)['json'](_0x1b7342);}return null;};}function patchUpdates(_0x2e71d6){return function(_0x13b2bc){try{jsonpatch[_0x0bfe('0x25')](_0x13b2bc,_0x2e71d6,!![]);}catch(_0x4aacb2){return BPromise['reject'](_0x4aacb2);}return _0x13b2bc[_0x0bfe('0x26')]();};}function saveUpdates(_0x4e871b,_0xcd7559){return function(_0x1f7451){if(_0x1f7451){return _0x1f7451[_0x0bfe('0x27')](_0x4e871b)[_0x0bfe('0x28')](function(_0x5adf01){return _0x5adf01;});}return null;};}function removeEntity(_0x2cae7d,_0x575df4){return function(_0x57edfc){if(_0x57edfc){return _0x57edfc[_0x0bfe('0x29')]()[_0x0bfe('0x28')](function(){var _0x2fa328=_0x57edfc['get']({'plain':!![]});var _0x43c392=_0x0bfe('0x2a');return db[_0x0bfe('0x2b')]['destroy']({'where':{'type':_0x43c392,'resourceId':_0x2fa328['id']}})['then'](function(){return _0x57edfc;});})['then'](function(){_0x2cae7d[_0x0bfe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5845,_0x194d41){return function(_0x1a33fc){if(!_0x1a33fc){_0x2f5845['sendStatus'](0x194);}return _0x1a33fc;};}function handleError(_0x87c8e0,_0x36963a){_0x36963a=_0x36963a||0x1f4;return function(_0x537e5f){logger[_0x0bfe('0x2c')](_0x537e5f[_0x0bfe('0x2d')]);if(_0x537e5f[_0x0bfe('0x2e')]){delete _0x537e5f[_0x0bfe('0x2e')];}_0x87c8e0['status'](_0x36963a)[_0x0bfe('0x2f')](_0x537e5f);};}exports[_0x0bfe('0x30')]=function(_0x18c08d,_0x25aa22){var _0x4cc14e={},_0x103aeb={},_0x128988={'count':0x0,'rows':[]};var _0x53c5f6=_['map'](db[_0x0bfe('0x31')]['rawAttributes'],function(_0x23c08b){return{'name':_0x23c08b[_0x0bfe('0x32')],'type':_0x23c08b[_0x0bfe('0x33')][_0x0bfe('0x34')]};});_0x103aeb[_0x0bfe('0x35')]=_[_0x0bfe('0x36')](_0x53c5f6,_0x0bfe('0x2e'));_0x103aeb[_0x0bfe('0x37')]=_[_0x0bfe('0x38')](_0x18c08d[_0x0bfe('0x37')]);_0x103aeb[_0x0bfe('0x39')]=_[_0x0bfe('0x3a')](_0x103aeb[_0x0bfe('0x35')],_0x103aeb[_0x0bfe('0x37')]);_0x4cc14e[_0x0bfe('0x3b')]=_[_0x0bfe('0x3a')](_0x103aeb[_0x0bfe('0x35')],qs[_0x0bfe('0x3c')](_0x18c08d['query']['fields']));_0x4cc14e['attributes']=_0x4cc14e[_0x0bfe('0x3b')]['length']?_0x4cc14e['attributes']:_0x103aeb['model'];if(!_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x3d')](_0x0bfe('0x3e'))){_0x4cc14e[_0x0bfe('0x22')]=qs['limit'](_0x18c08d['query'][_0x0bfe('0x22')]);_0x4cc14e[_0x0bfe('0x20')]=qs[_0x0bfe('0x20')](_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x20')]);}_0x4cc14e['order']=qs[_0x0bfe('0x3f')](_0x18c08d['query'][_0x0bfe('0x3f')]);_0x4cc14e[_0x0bfe('0x40')]=qs[_0x0bfe('0x39')](_['pick'](_0x18c08d[_0x0bfe('0x37')],_0x103aeb[_0x0bfe('0x39')]),_0x53c5f6);if(_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x41')]){_0x4cc14e['where']=_['merge'](_0x4cc14e[_0x0bfe('0x40')],{'$or':_[_0x0bfe('0x36')](_0x53c5f6,function(_0x1074ac){if(_0x1074ac[_0x0bfe('0x33')]!==_0x0bfe('0x42')){var _0x5f29a6={};_0x5f29a6[_0x1074ac['name']]={'$like':'%'+_0x18c08d['query'][_0x0bfe('0x41')]+'%'};return _0x5f29a6;}})});}_0x4cc14e=_[_0x0bfe('0x43')]({},_0x4cc14e,_0x18c08d['options']);var _0xd8f324={'where':_0x4cc14e[_0x0bfe('0x40')]};return db['Dashboard'][_0x0bfe('0x23')](_0xd8f324)[_0x0bfe('0x28')](function(_0x5e182f){_0x128988[_0x0bfe('0x23')]=_0x5e182f;if(_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x44')]){_0x4cc14e[_0x0bfe('0x45')]=[{'all':!![]}];}return db[_0x0bfe('0x31')][_0x0bfe('0x46')](_0x4cc14e);})['then'](function(_0x254d2e){_0x128988[_0x0bfe('0x47')]=_0x254d2e;return _0x128988;})[_0x0bfe('0x28')](respondWithFilteredResult(_0x25aa22,_0x4cc14e))[_0x0bfe('0x48')](handleError(_0x25aa22,null));};exports[_0x0bfe('0x49')]=function(_0x1ea8e1,_0xab9c67){var _0x54d80e={'raw':![],'where':{'id':_0x1ea8e1[_0x0bfe('0x4a')]['id']}},_0x24c7ec={};_0x24c7ec[_0x0bfe('0x35')]=_[_0x0bfe('0x38')](db[_0x0bfe('0x31')][_0x0bfe('0x4b')]);_0x24c7ec['query']=_[_0x0bfe('0x38')](_0x1ea8e1['query']);_0x24c7ec[_0x0bfe('0x39')]=_[_0x0bfe('0x3a')](_0x24c7ec[_0x0bfe('0x35')],_0x24c7ec[_0x0bfe('0x37')]);_0x54d80e[_0x0bfe('0x3b')]=_[_0x0bfe('0x3a')](_0x24c7ec[_0x0bfe('0x35')],qs[_0x0bfe('0x3c')](_0x1ea8e1[_0x0bfe('0x37')][_0x0bfe('0x3c')]));_0x54d80e['attributes']=_0x54d80e[_0x0bfe('0x3b')]['length']?_0x54d80e[_0x0bfe('0x3b')]:_0x24c7ec[_0x0bfe('0x35')];if(_0x1ea8e1['query'][_0x0bfe('0x44')]){_0x54d80e[_0x0bfe('0x45')]=[{'all':!![]}];}_0x54d80e=_[_0x0bfe('0x43')]({},_0x54d80e,_0x1ea8e1[_0x0bfe('0x4c')]);return db[_0x0bfe('0x31')][_0x0bfe('0x4d')](_0x54d80e)['then'](handleEntityNotFound(_0xab9c67,null))[_0x0bfe('0x28')](respondWithResult(_0xab9c67,null))['catch'](handleError(_0xab9c67,null));};exports[_0x0bfe('0x4e')]=function(_0x3ae67e,_0x21b0b1){return db[_0x0bfe('0x31')][_0x0bfe('0x4e')](_0x3ae67e['body'],{})[_0x0bfe('0x28')](function(_0x15a07e){var _0x13a978=_0x3ae67e[_0x0bfe('0x4f')][_0x0bfe('0x50')]({'plain':!![]});if(!_0x13a978)throw new Error(_0x0bfe('0x51'));if(_0x13a978[_0x0bfe('0x52')]===_0x0bfe('0x4f')){var _0x6c7ed4=_0x15a07e[_0x0bfe('0x50')]({'plain':!![]});var _0x2125fc=_0x0bfe('0x2a');return db[_0x0bfe('0x53')][_0x0bfe('0x4d')]({'where':{'name':_0x2125fc,'userProfileId':_0x13a978[_0x0bfe('0x54')]},'raw':!![]})[_0x0bfe('0x28')](function(_0xecd966){if(_0xecd966&&_0xecd966[_0x0bfe('0x55')]===0x0){return db[_0x0bfe('0x2b')][_0x0bfe('0x4e')]({'name':_0x6c7ed4[_0x0bfe('0x2e')],'resourceId':_0x6c7ed4['id'],'type':_0xecd966[_0x0bfe('0x2e')],'sectionId':_0xecd966['id']},{})['then'](function(){return _0x15a07e;});}else{return _0x15a07e;}})[_0x0bfe('0x48')](function(_0x49fa0b){logger['error'](_0x0bfe('0x56'),_0x49fa0b);throw _0x49fa0b;});}return _0x15a07e;})[_0x0bfe('0x28')](respondWithResult(_0x21b0b1,0xc9))[_0x0bfe('0x48')](handleError(_0x21b0b1,null));};exports['clone']=function(_0x6030ef,_0x2779f4){var _0x47088a={'where':{'id':_0x6030ef[_0x0bfe('0x4a')]['id']}},_0x115dcb={};_0x115dcb[_0x0bfe('0x35')]=_[_0x0bfe('0x38')](db[_0x0bfe('0x31')][_0x0bfe('0x4b')]);_0x47088a[_0x0bfe('0x3b')]=_['intersection'](_0x115dcb['model'],qs[_0x0bfe('0x3c')](_0x6030ef[_0x0bfe('0x37')][_0x0bfe('0x3c')]));_0x47088a[_0x0bfe('0x3b')]=_0x47088a[_0x0bfe('0x3b')][_0x0bfe('0x57')]?_0x47088a['attributes']:_0x115dcb['model'];if(_0x6030ef['query']['includeAll']){_0x47088a[_0x0bfe('0x45')]=[{'all':!![]}];}_0x47088a=_['merge']({},_0x47088a,_0x6030ef[_0x0bfe('0x4c')]);return db[_0x0bfe('0x31')][_0x0bfe('0x4d')](_0x47088a)[_0x0bfe('0x28')](handleEntityNotFound(_0x2779f4,null))[_0x0bfe('0x28')](function(_0x542ada){if(_0x542ada){var _0x29cafc=_0x542ada['get']({'plain':!![]});_0x29cafc=qs[_0x0bfe('0x58')](_0x29cafc,['id',_0x0bfe('0x59'),_0x0bfe('0x5a')]);_0x6030ef[_0x0bfe('0x5b')]=_[_0x0bfe('0x58')](_0x6030ef[_0x0bfe('0x5b')],['id',_0x0bfe('0x59'),_0x0bfe('0x5a')]);return db[_0x0bfe('0x31')]['create'](_['merge'](_0x29cafc,_0x6030ef['body']),{'include':_0x6030ef[_0x0bfe('0x37')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2635d0){var _0x589ec1=_0x6030ef['user'][_0x0bfe('0x50')]({'plain':!![]});if(!_0x589ec1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x589ec1['role']===_0x0bfe('0x4f')){var _0x356d4d=_0x2635d0[_0x0bfe('0x50')]({'plain':!![]});var _0x2fd00e=_0x0bfe('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x2fd00e,'userProfileId':_0x589ec1[_0x0bfe('0x54')]},'raw':!![]})[_0x0bfe('0x28')](function(_0x589ff2){if(_0x589ff2&&_0x589ff2['autoAssociation']===0x0){return db[_0x0bfe('0x2b')]['create']({'name':_0x356d4d[_0x0bfe('0x2e')],'resourceId':_0x356d4d['id'],'type':_0x589ff2[_0x0bfe('0x2e')],'sectionId':_0x589ff2['id']},{})[_0x0bfe('0x28')](function(){return _0x2635d0;});}else{return _0x2635d0;}})[_0x0bfe('0x48')](function(_0x4741e5){logger[_0x0bfe('0x2c')](_0x0bfe('0x56'),_0x4741e5);throw _0x4741e5;});}return _0x2635d0;});}})[_0x0bfe('0x28')](respondWithResult(_0x2779f4,0xc9))[_0x0bfe('0x48')](handleError(_0x2779f4,null));};exports[_0x0bfe('0x27')]=function(_0xddbe99,_0x1c58a9){if(_0xddbe99[_0x0bfe('0x5b')]['id']){delete _0xddbe99[_0x0bfe('0x5b')]['id'];}return db['Dashboard'][_0x0bfe('0x4d')]({'where':{'id':_0xddbe99[_0x0bfe('0x4a')]['id']}})[_0x0bfe('0x28')](handleEntityNotFound(_0x1c58a9,null))[_0x0bfe('0x28')](saveUpdates(_0xddbe99[_0x0bfe('0x5b')],null))['then'](respondWithResult(_0x1c58a9,null))['catch'](handleError(_0x1c58a9,null));};exports['destroy']=function(_0x157bf9,_0x1b61e8){return db[_0x0bfe('0x31')][_0x0bfe('0x4d')]({'where':{'id':_0x157bf9['params']['id']}})['then'](handleEntityNotFound(_0x1b61e8,null))[_0x0bfe('0x28')](removeEntity(_0x1b61e8,null))[_0x0bfe('0x48')](handleError(_0x1b61e8,null));};function widgetAttributes(_0x507953){try{switch(_0x507953['type']){case'iframe':return[{'name':_0x0bfe('0x5c'),'value':_0x507953[_0x0bfe('0x5c')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953['attrs'][0x0][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x5f')}];case _0x0bfe('0x60'):return[{'name':_0x0bfe('0x61'),'value':_0x507953[_0x0bfe('0x61')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0x0]?_0x507953[_0x0bfe('0x5d')][0x0][_0x0bfe('0x5e')]:undefined)||''}];case _0x0bfe('0x62'):return[{'name':_0x0bfe('0x63'),'value':_0x507953[_0x0bfe('0x63')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953['attrs'][0x0][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x64')},{'name':_0x0bfe('0x65'),'value':_0x507953[_0x0bfe('0x65')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1]['value']:undefined)||_0x0bfe('0x66')},{'name':_0x0bfe('0x67'),'value':_0x507953[_0x0bfe('0x67')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x2]?_0x507953[_0x0bfe('0x5d')][0x2][_0x0bfe('0x5e')]:undefined)||0xc}];case _0x0bfe('0x68'):return[{'name':'attrMetric','value':_0x507953[_0x0bfe('0x69')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953[_0x0bfe('0x5d')][0x0][_0x0bfe('0x5e')]:undefined)||'total'},{'name':_0x0bfe('0x6a'),'value':_0x507953['attrVoiceQueues']||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1][_0x0bfe('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x507953['attrFontSize']||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x2]?_0x507953[_0x0bfe('0x5d')][0x2][_0x0bfe('0x5e')]:undefined)||0x14},{'name':'attrChannel','value':_0x507953[_0x0bfe('0x6b')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x3]?_0x507953[_0x0bfe('0x5d')][0x3][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x6c')},{'name':_0x0bfe('0x6d'),'value':_0x507953[_0x0bfe('0x6d')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x4]?_0x507953[_0x0bfe('0x5d')][0x4][_0x0bfe('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x507953['attrFaxAccounts']||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x5]?_0x507953[_0x0bfe('0x5d')][0x5][_0x0bfe('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x507953[_0x0bfe('0x6e')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x6]?_0x507953['attrs'][0x6][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x6f'),'value':_0x507953[_0x0bfe('0x6f')]||(_0x507953['attrs']&&_0x507953['attrs'][0x7]?_0x507953['attrs'][0x7][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x70'),'value':_0x507953[_0x0bfe('0x70')]||(_0x507953['attrs']&&_0x507953['attrs'][0x8]?_0x507953[_0x0bfe('0x5d')][0x8][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x71'),'value':_0x507953[_0x0bfe('0x71')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x9]?_0x507953[_0x0bfe('0x5d')][0x9][_0x0bfe('0x5e')]:undefined)||''}];case _0x0bfe('0x72'):case _0x0bfe('0x73'):return[{'name':'attrSerie1','value':_0x507953[_0x0bfe('0x74')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953[_0x0bfe('0x5d')][0x0][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x75')},{'name':_0x0bfe('0x76'),'value':_0x507953[_0x0bfe('0x76')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1][_0x0bfe('0x5e')]:undefined)||null},{'name':_0x0bfe('0x77'),'value':_0x507953['attrSerie3']||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x2]?_0x507953['attrs'][0x2]['value']:undefined)||null},{'name':_0x0bfe('0x6a'),'value':_0x507953[_0x0bfe('0x6a')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x3]?_0x507953['attrs'][0x3][_0x0bfe('0x5e')]:undefined)||[]},{'name':'attrChannel','value':_0x507953[_0x0bfe('0x6b')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0x4]?_0x507953[_0x0bfe('0x5d')][0x4]['value']:undefined)||_0x0bfe('0x6c')},{'name':_0x0bfe('0x6d'),'value':_0x507953[_0x0bfe('0x6d')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x5]?_0x507953['attrs'][0x5][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x78'),'value':_0x507953[_0x0bfe('0x78')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0x6]?_0x507953[_0x0bfe('0x5d')][0x6][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x6e'),'value':_0x507953[_0x0bfe('0x6e')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x7]?_0x507953[_0x0bfe('0x5d')][0x7]['value']:undefined)||''},{'name':_0x0bfe('0x6f'),'value':_0x507953[_0x0bfe('0x6f')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x8]?_0x507953[_0x0bfe('0x5d')][0x8][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x70'),'value':_0x507953[_0x0bfe('0x70')]||(_0x507953['attrs']&&_0x507953['attrs'][0x9]?_0x507953[_0x0bfe('0x5d')][0x9][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x71'),'value':_0x507953[_0x0bfe('0x71')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0xa]?_0x507953['attrs'][0xa]['value']:undefined)||''}];case _0x0bfe('0x79'):return[{'name':'attrReport','type':_0x507953[_0x0bfe('0x7a')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953['attrs'][0x0][_0x0bfe('0x33')]:undefined)||null,'value':_0x507953[_0x0bfe('0x7b')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953[_0x0bfe('0x5d')][0x0]['value']:undefined)||null},{'name':_0x0bfe('0x7c'),'value':_0x507953[_0x0bfe('0x7c')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1][_0x0bfe('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x4015e6){logger[_0x0bfe('0x2c')](_0x0bfe('0x7d'),JSON[_0x0bfe('0x7e')](_0x4015e6));return[];}}exports[_0x0bfe('0x7f')]=function(_0x3d1aac,_0x22c591,_0x351de1){if(_0x3d1aac[_0x0bfe('0x5b')]['id']){delete _0x3d1aac[_0x0bfe('0x5b')]['id'];}return db[_0x0bfe('0x31')][_0x0bfe('0x4d')]({'where':{'id':_0x3d1aac[_0x0bfe('0x4a')]['id']}})[_0x0bfe('0x28')](handleEntityNotFound(_0x22c591,null))[_0x0bfe('0x28')](function(_0x4941b8){if(_0x4941b8){_0x3d1aac[_0x0bfe('0x5b')][_0x0bfe('0x80')]=_0x4941b8['id'];_0x3d1aac['body'][_0x0bfe('0x5d')]=widgetAttributes(_0x3d1aac[_0x0bfe('0x5b')]);return db[_0x0bfe('0x81')]['create'](_0x3d1aac[_0x0bfe('0x5b')]);}})[_0x0bfe('0x28')](respondWithResult(_0x22c591,null))['catch'](handleError(_0x22c591,null));};exports[_0x0bfe('0x82')]=function(_0x105454,_0x2e8572,_0x322ce8){var _0x3a9a1f={};var _0xc88b64={};var _0x31683e;var _0x1b763a;return db[_0x0bfe('0x31')][_0x0bfe('0x83')]({'where':{'id':_0x105454[_0x0bfe('0x4a')]['id']}})[_0x0bfe('0x28')](handleEntityNotFound(_0x2e8572,null))[_0x0bfe('0x28')](function(_0x5da56a){if(_0x5da56a){_0x31683e=_0x5da56a;_0xc88b64['model']=_['keys'](db['DashboardItem'][_0x0bfe('0x4b')]);_0xc88b64['query']=_[_0x0bfe('0x38')](_0x105454[_0x0bfe('0x37')]);_0xc88b64[_0x0bfe('0x39')]=_[_0x0bfe('0x3a')](_0xc88b64[_0x0bfe('0x35')],_0xc88b64[_0x0bfe('0x37')]);_0x3a9a1f[_0x0bfe('0x3b')]=_['intersection'](_0xc88b64[_0x0bfe('0x35')],qs[_0x0bfe('0x3c')](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x3c')]));_0x3a9a1f['attributes']=_0x3a9a1f[_0x0bfe('0x3b')]['length']?_0x3a9a1f[_0x0bfe('0x3b')]:_0xc88b64[_0x0bfe('0x35')];_0x3a9a1f[_0x0bfe('0x84')]=qs[_0x0bfe('0x3f')](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x3f')]);_0x3a9a1f[_0x0bfe('0x40')]=qs[_0x0bfe('0x39')](_[_0x0bfe('0x85')](_0x105454[_0x0bfe('0x37')],_0xc88b64[_0x0bfe('0x39')]));if(_0x105454['query'][_0x0bfe('0x41')]){_0x3a9a1f[_0x0bfe('0x40')]=_['merge'](_0x3a9a1f['where'],{'$or':_[_0x0bfe('0x36')](_0x3a9a1f[_0x0bfe('0x3b')],function(_0x5aaa27){var _0x25a9ba={};_0x25a9ba[_0x5aaa27]={'$like':'%'+_0x105454[_0x0bfe('0x37')][_0x0bfe('0x41')]+'%'};return _0x25a9ba;})});}_0x3a9a1f=_[_0x0bfe('0x43')]({},_0x3a9a1f,_0x105454['options']);return _0x31683e['getItems'](_0x3a9a1f);}})[_0x0bfe('0x28')](function(_0x667d9c){if(_0x667d9c){_0x1b763a=_0x667d9c[_0x0bfe('0x57')];if(!_0x105454['query'][_0x0bfe('0x3d')](_0x0bfe('0x3e'))){_0x3a9a1f[_0x0bfe('0x22')]=qs['limit'](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x22')]);_0x3a9a1f[_0x0bfe('0x20')]=qs[_0x0bfe('0x20')](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x20')]);}return _0x31683e[_0x0bfe('0x82')](_0x3a9a1f);}})[_0x0bfe('0x28')](function(_0x4fe857){if(_0x4fe857){return _0x4fe857?{'count':_0x1b763a,'rows':_0x4fe857}:null;}})['then'](respondWithResult(_0x2e8572,null))[_0x0bfe('0x48')](handleError(_0x2e8572,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 3bcacf1..7d3fc07 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 _0x975b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x975b,0x1c9));var _0xb975=function(_0x5189c1,_0x274995){_0x5189c1=_0x5189c1-0x0;var _0x404706=_0x975b[_0x5189c1];return _0x404706;};'use strict';var EventEmitter=require(_0xb975('0x0'));var Dashboard=require(_0xb975('0x1'))['db'][_0xb975('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb975('0x3')](0x0);var events={'afterCreate':_0xb975('0x4'),'afterUpdate':_0xb975('0x5'),'afterDestroy':_0xb975('0x6')};function emitEvent(_0x5e662b){return function(_0xa92c72,_0xfb173,_0x2007e4){DashboardEvents[_0xb975('0x7')](_0x5e662b+':'+_0xa92c72['id'],_0xa92c72);DashboardEvents[_0xb975('0x7')](_0x5e662b,_0xa92c72);_0x2007e4(null);};}for(var e in events){if(events[_0xb975('0x8')](e)){var event=events[e];Dashboard[_0xb975('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x1cce=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x274253,_0x259430){var _0x46179a=function(_0x5869cd){while(--_0x5869cd){_0x274253['push'](_0x274253['shift']());}};_0x46179a(++_0x259430);}(_0x1cce,0x80));var _0xe1cc=function(_0x53080e,_0x252127){_0x53080e=_0x53080e-0x0;var _0x1a0c14=_0x1cce[_0x53080e];return _0x1a0c14;};'use strict';var EventEmitter=require(_0xe1cc('0x0'));var Dashboard=require(_0xe1cc('0x1'))['db'][_0xe1cc('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe1cc('0x3')](0x0);var events={'afterCreate':_0xe1cc('0x4'),'afterUpdate':_0xe1cc('0x5'),'afterDestroy':_0xe1cc('0x6')};function emitEvent(_0x5c168b){return function(_0x5720e8,_0x434241,_0x5de6a9){DashboardEvents[_0xe1cc('0x7')](_0x5c168b+':'+_0x5720e8['id'],_0x5720e8);DashboardEvents[_0xe1cc('0x7')](_0x5c168b,_0x5720e8);_0x5de6a9(null);};}for(var e in events){if(events[_0xe1cc('0x8')](e)){var event=events[e];Dashboard[_0xe1cc('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index f928505..18182e8 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 _0x0fe8=['dashboards','lodash','util','../../config/logger','bluebird','request-promise','path','exports'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x0fe8,0x89));var _0x80fe=function(_0x84e373,_0x5473c7){_0x84e373=_0x84e373-0x0;var _0x4fdc83=_0x0fe8[_0x84e373];return _0x4fdc83;};'use strict';var _=require(_0x80fe('0x0'));var util=require(_0x80fe('0x1'));var logger=require(_0x80fe('0x2'))('api');var moment=require('moment');var BPromise=require(_0x80fe('0x3'));var rp=require(_0x80fe('0x4'));var fs=require('fs');var path=require(_0x80fe('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x80fe('0x6')]=function(_0x57833b,_0x18de86){return _0x57833b['define']('Dashboard',attributes,{'tableName':_0x80fe('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55be=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x55be,0x1ce));var _0xe55b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x55be[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe55b('0x0'));var util=require(_0xe55b('0x1'));var logger=require(_0xe55b('0x2'))('api');var moment=require(_0xe55b('0x3'));var BPromise=require(_0xe55b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe55b('0x5'));var rimraf=require(_0xe55b('0x6'));var config=require(_0xe55b('0x7'));var attributes=require(_0xe55b('0x8'));module[_0xe55b('0x9')]=function(_0x1eebac,_0x50c3eb){return _0x1eebac[_0xe55b('0xa')](_0xe55b('0xb'),attributes,{'tableName':_0xe55b('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 5ad7e9e..c290078 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 _0x37a5=['redis','localhost','./dashboard.socket','request','then','debug','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x2bcc8d,_0x5691d1){var _0x123b6a=function(_0xbe08e8){while(--_0xbe08e8){_0x2bcc8d['push'](_0x2bcc8d['shift']());}};_0x123b6a(++_0x5691d1);}(_0x37a5,0x12d));var _0x537a=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x37a5[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0x537a('0x0'));var moment=require(_0x537a('0x1'));var BPromise=require(_0x537a('0x2'));var rs=require(_0x537a('0x3'));var fs=require('fs');var Redis=require(_0x537a('0x4'));var db=require(_0x537a('0x5'))['db'];var utils=require(_0x537a('0x6'));var logger=require(_0x537a('0x7'))(_0x537a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x537a('0x9')][_0x537a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x537a('0xb')],{'host':_0x537a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x537a('0xd'))['register'](socket);function respondWithRpcPromise(_0x255ab8,_0x35eee0,_0x3e6719){return new BPromise(function(_0x126865,_0x1b2805){return client[_0x537a('0xe')](_0x255ab8,_0x3e6719)[_0x537a('0xf')](function(_0x536816){logger['info']('Dashboard,\x20%s,\x20%s',_0x35eee0,'request\x20sent');logger[_0x537a('0x10')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x35eee0,_0x537a('0x11'),JSON[_0x537a('0x12')](_0x536816));if(_0x536816[_0x537a('0x13')]){if(_0x536816['error'][_0x537a('0x14')]===0x1f4){logger[_0x537a('0x13')](_0x537a('0x15'),_0x35eee0,_0x536816[_0x537a('0x13')][_0x537a('0x16')]);return _0x1b2805(_0x536816[_0x537a('0x13')][_0x537a('0x16')]);}logger['error'](_0x537a('0x15'),_0x35eee0,_0x536816[_0x537a('0x13')][_0x537a('0x16')]);return _0x126865(_0x536816[_0x537a('0x13')][_0x537a('0x16')]);}else{logger[_0x537a('0x17')]('Dashboard,\x20%s,\x20%s',_0x35eee0,'request\x20sent');_0x126865(_0x536816[_0x537a('0x18')][_0x537a('0x16')]);}})[_0x537a('0x19')](function(_0x8b5507){logger[_0x537a('0x13')](_0x537a('0x15'),_0x35eee0,_0x8b5507);_0x1b2805(_0x8b5507);});});} \ No newline at end of file +var _0x622f=['redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x622f,0xe9));var _0xf622=function(_0x5db810,_0x140222){_0x5db810=_0x5db810-0x0;var _0x14a975=_0x622f[_0x5db810];return _0x14a975;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf622('0x0'));var BPromise=require(_0xf622('0x1'));var rs=require(_0xf622('0x2'));var fs=require('fs');var Redis=require(_0xf622('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf622('0x4'))(_0xf622('0x5'));var config=require(_0xf622('0x6'));var jayson=require(_0xf622('0x7'));var client=jayson[_0xf622('0x8')][_0xf622('0x9')]({'port':0x232a});config[_0xf622('0xa')]=_['defaults'](config['redis'],{'host':_0xf622('0xb'),'port':0x18eb});var socket=require(_0xf622('0xc'))(new Redis(config[_0xf622('0xa')]));require(_0xf622('0xd'))[_0xf622('0xe')](socket);function respondWithRpcPromise(_0x286aef,_0x2ee4ff,_0x1ede4a){return new BPromise(function(_0x3cee86,_0x111f8a){return client[_0xf622('0xf')](_0x286aef,_0x1ede4a)[_0xf622('0x10')](function(_0x2feaab){logger[_0xf622('0x11')](_0xf622('0x12'),_0x2ee4ff,_0xf622('0x13'));logger[_0xf622('0x14')](_0xf622('0x15'),_0x2ee4ff,_0xf622('0x13'),JSON[_0xf622('0x16')](_0x2feaab));if(_0x2feaab['error']){if(_0x2feaab['error'][_0xf622('0x17')]===0x1f4){logger[_0xf622('0x18')](_0xf622('0x12'),_0x2ee4ff,_0x2feaab[_0xf622('0x18')][_0xf622('0x19')]);return _0x111f8a(_0x2feaab[_0xf622('0x18')]['message']);}logger[_0xf622('0x18')](_0xf622('0x12'),_0x2ee4ff,_0x2feaab[_0xf622('0x18')][_0xf622('0x19')]);return _0x3cee86(_0x2feaab[_0xf622('0x18')][_0xf622('0x19')]);}else{logger[_0xf622('0x11')](_0xf622('0x12'),_0x2ee4ff,'request\x20sent');_0x3cee86(_0x2feaab[_0xf622('0x1a')]['message']);}})['catch'](function(_0x20add4){logger['error'](_0xf622('0x12'),_0x2ee4ff,_0x20add4);_0x111f8a(_0x20add4);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5554b92..9ad13fb 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 _0xe6ff=['update','removeListener','register','save','remove'];(function(_0x125573,_0x522623){var _0x1bf0f2=function(_0x124069){while(--_0x124069){_0x125573['push'](_0x125573['shift']());}};_0x1bf0f2(++_0x522623);}(_0xe6ff,0x1a2));var _0xfe6f=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe6ff[_0x1928c9];return _0x51b5fb;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xfe6f('0x0'),_0xfe6f('0x1'),_0xfe6f('0x2')];function createListener(_0x38aa22,_0x18561d){return function(_0x266276){_0x18561d['emit'](_0x38aa22,_0x266276);};}function removeListener(_0x5d06a7,_0x1c29af){return function(){DashboardEvents[_0xfe6f('0x3')](_0x5d06a7,_0x1c29af);};}exports[_0xfe6f('0x4')]=function(_0x13f452){for(var _0x3d98d7=0x0,_0x224de6=events['length'];_0x3d98d7<_0x224de6;_0x3d98d7++){var _0x2cfd2d=events[_0x3d98d7];var _0x4655c7=createListener('dashboard:'+_0x2cfd2d,_0x13f452);DashboardEvents['on'](_0x2cfd2d,_0x4655c7);}}; \ No newline at end of file +var _0x3450=['update','emit','removeListener','register','dashboard:','./dashboard.events','remove'];(function(_0xfe56d3,_0x12ea3d){var _0x22b265=function(_0x41786b){while(--_0x41786b){_0xfe56d3['push'](_0xfe56d3['shift']());}};_0x22b265(++_0x12ea3d);}(_0x3450,0x75));var _0x0345=function(_0x458848,_0x2dcecd){_0x458848=_0x458848-0x0;var _0x20469e=_0x3450[_0x458848];return _0x20469e;};'use strict';var DashboardEvents=require(_0x0345('0x0'));var events=['save',_0x0345('0x1'),_0x0345('0x2')];function createListener(_0x416cbd,_0x168395){return function(_0x513f9f){_0x168395[_0x0345('0x3')](_0x416cbd,_0x513f9f);};}function removeListener(_0x239110,_0x43d3d8){return function(){DashboardEvents[_0x0345('0x4')](_0x239110,_0x43d3d8);};}exports[_0x0345('0x5')]=function(_0xdfe6ce){for(var _0x4dca6f=0x0,_0xb7a5fb=events['length'];_0x4dca6f<_0xb7a5fb;_0x4dca6f++){var _0xa25973=events[_0x4dca6f];var _0x1b2d7b=createListener(_0x0345('0x6')+_0xa25973,_0xdfe6ce);DashboardEvents['on'](_0xa25973,_0x1b2d7b);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 650db42..397e68c 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 _0x14da=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','/:id','isAuthenticated','show','get','post','/:id/clone','clone','put','delete','destroy','exports','util','path','express','Router'];(function(_0x5bd3c8,_0x3e6fb5){var _0xb784cc=function(_0x248c35){while(--_0x248c35){_0x5bd3c8['push'](_0x5bd3c8['shift']());}};_0xb784cc(++_0x3e6fb5);}(_0x14da,0xb0));var _0xa14d=function(_0x294975,_0xba7309){_0x294975=_0x294975-0x0;var _0x523628=_0x14da[_0x294975];return _0x523628;};'use strict';var multer=require('multer');var util=require(_0xa14d('0x0'));var path=require(_0xa14d('0x1'));var timeout=require('connect-timeout');var express=require(_0xa14d('0x2'));var router=express[_0xa14d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa14d('0x4'));var interaction=require(_0xa14d('0x5'));var config=require(_0xa14d('0x6'));var controller=require(_0xa14d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa14d('0x8')]);router['get'](_0xa14d('0x9'),auth[_0xa14d('0xa')](),controller[_0xa14d('0xb')]);router[_0xa14d('0xc')]('/:id/items',auth[_0xa14d('0xa')](),controller['getItems']);router['post']('/',auth[_0xa14d('0xa')](),controller['create']);router[_0xa14d('0xd')](_0xa14d('0xe'),auth[_0xa14d('0xa')](),controller[_0xa14d('0xf')]);router['post']('/:id/items',auth['isAuthenticated'](),controller['addItem']);router[_0xa14d('0x10')]('/:id',auth[_0xa14d('0xa')](),controller['update']);router[_0xa14d('0x11')]('/:id',auth[_0xa14d('0xa')](),controller[_0xa14d('0x12')]);module[_0xa14d('0x13')]=router; \ No newline at end of file +var _0xede9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','multer','util','path','express'];(function(_0x3bd89a,_0x35056d){var _0x37c2e9=function(_0x3d2af2){while(--_0x3d2af2){_0x3bd89a['push'](_0x3bd89a['shift']());}};_0x37c2e9(++_0x35056d);}(_0xede9,0x92));var _0x9ede=function(_0x74708,_0x258c50){_0x74708=_0x74708-0x0;var _0x18b05d=_0xede9[_0x74708];return _0x18b05d;};'use strict';var multer=require(_0x9ede('0x0'));var util=require(_0x9ede('0x1'));var path=require(_0x9ede('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ede('0x3'));var router=express[_0x9ede('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ede('0x5'));var interaction=require(_0x9ede('0x6'));var config=require(_0x9ede('0x7'));var controller=require(_0x9ede('0x8'));router[_0x9ede('0x9')]('/',auth[_0x9ede('0xa')](),controller[_0x9ede('0xb')]);router[_0x9ede('0x9')](_0x9ede('0xc'),auth[_0x9ede('0xa')](),controller[_0x9ede('0xd')]);router[_0x9ede('0x9')]('/:id/items',auth[_0x9ede('0xa')](),controller[_0x9ede('0xe')]);router[_0x9ede('0xf')]('/',auth[_0x9ede('0xa')](),controller[_0x9ede('0x10')]);router[_0x9ede('0xf')](_0x9ede('0x11'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x12')]);router['post'](_0x9ede('0x13'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x14')]);router[_0x9ede('0x15')](_0x9ede('0xc'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x16')]);router[_0x9ede('0x17')](_0x9ede('0xc'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index eb256ad..90e85d6 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 _0x1883=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x1883,0xab));var _0x3188=function(_0x48681d,_0x5ebf32){_0x48681d=_0x48681d-0x0;var _0x49d6b7=_0x1883[_0x48681d];return _0x49d6b7;};'use strict';var Sequelize=require(_0x3188('0x0'));var squel=require(_0x3188('0x1'));var _=require(_0x3188('0x2'));module[_0x3188('0x3')]={'title':{'type':Sequelize[_0x3188('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6')),'get':function(){try{return JSON[_0x3188('0x7')](this[_0x3188('0x8')](_0x3188('0x9')));}catch(_0x345612){return[];}},'set':function(_0x408ae0){try{this[_0x3188('0xa')](_0x3188('0x9'),JSON[_0x3188('0xb')](_0x408ae0));}catch(_0x3e3afb){this['setDataValue'](_0x3188('0x9'),JSON[_0x3188('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3188('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3188('0xc')]},'background':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':_0x3188('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3188('0x4')]},'titleFontSize':{'type':Sequelize[_0x3188('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x33de54,_0x5434b9){var _0x18fe1f=function(_0x3fe66c){while(--_0x3fe66c){_0x33de54['push'](_0x33de54['shift']());}};_0x18fe1f(++_0x5434b9);}(_0xeda8,0x104));var _0x8eda=function(_0x32a970,_0x9f2d36){_0x32a970=_0x32a970-0x0;var _0x2a1c89=_0xeda8[_0x32a970];return _0x2a1c89;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 971fe65..fe20ddd 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 _0xbdb9=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','show','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrChatWebsites','attrReport','type','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3f9d52,_0x481e95){var _0x46881a=function(_0x2984bc){while(--_0x2984bc){_0x3f9d52['push'](_0x3f9d52['shift']());}};_0x46881a(++_0x481e95);}(_0xbdb9,0xac));var _0x9bdb=function(_0x3795dc,_0xb01d5d){_0x3795dc=_0x3795dc-0x0;var _0x3d94eb=_0xbdb9[_0x3795dc];return _0x3d94eb;};'use strict';var emlformat=require(_0x9bdb('0x0'));var rimraf=require(_0x9bdb('0x1'));var zipdir=require(_0x9bdb('0x2'));var jsonpatch=require(_0x9bdb('0x3'));var rp=require(_0x9bdb('0x4'));var moment=require('moment');var BPromise=require(_0x9bdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9bdb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bdb('0x7'));var _=require('lodash');var squel=require(_0x9bdb('0x8'));var crypto=require(_0x9bdb('0x9'));var jsforce=require(_0x9bdb('0xa'));var deskjs=require(_0x9bdb('0xb'));var toCsv=require(_0x9bdb('0x6'));var querystring=require(_0x9bdb('0xc'));var Papa=require(_0x9bdb('0xd'));var Redis=require('ioredis');var authService=require(_0x9bdb('0xe'));var qs=require(_0x9bdb('0xf'));var as=require(_0x9bdb('0x10'));var hardwareService=require(_0x9bdb('0x11'));var logger=require(_0x9bdb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9bdb('0x13'));var licenseUtil=require(_0x9bdb('0x14'));var db=require(_0x9bdb('0x15'))['db'];config[_0x9bdb('0x16')]=_[_0x9bdb('0x17')](config[_0x9bdb('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bdb('0x18'))(new Redis(config[_0x9bdb('0x16')]));require(_0x9bdb('0x19'))[_0x9bdb('0x1a')](socket);function respondWithStatusCode(_0x17b647,_0x4af695){_0x4af695=_0x4af695||0xcc;return function(_0x1378e0){if(_0x1378e0){return _0x17b647[_0x9bdb('0x1b')](_0x4af695);}return _0x17b647[_0x9bdb('0x1c')](_0x4af695)['end']();};}function respondWithResult(_0x3d759e,_0xfc16a4){_0xfc16a4=_0xfc16a4||0xc8;return function(_0x1cb06d){if(_0x1cb06d){return _0x3d759e[_0x9bdb('0x1c')](_0xfc16a4)[_0x9bdb('0x1d')](_0x1cb06d);}};}function respondWithFilteredResult(_0x13c07b,_0xf5ca10){return function(_0x112d0f){if(_0x112d0f){var _0x1f4e49=typeof _0xf5ca10[_0x9bdb('0x1e')]==='undefined'&&typeof _0xf5ca10[_0x9bdb('0x1f')]===_0x9bdb('0x20');var _0x5204ba=_0x112d0f[_0x9bdb('0x21')];var _0x16a953=_0x1f4e49?0x0:_0xf5ca10[_0x9bdb('0x1e')];var _0x582a46=_0x1f4e49?_0x112d0f[_0x9bdb('0x21')]:_0xf5ca10[_0x9bdb('0x1e')]+_0xf5ca10[_0x9bdb('0x1f')];var _0x4da7a5;if(_0x582a46>=_0x5204ba){_0x582a46=_0x5204ba;_0x4da7a5=0xc8;}else{_0x4da7a5=0xce;}_0x13c07b[_0x9bdb('0x1c')](_0x4da7a5);return _0x13c07b[_0x9bdb('0x22')](_0x9bdb('0x23'),_0x16a953+'-'+_0x582a46+'/'+_0x5204ba)[_0x9bdb('0x1d')](_0x112d0f);}return null;};}function patchUpdates(_0x41a213){return function(_0x310256){try{jsonpatch['apply'](_0x310256,_0x41a213,!![]);}catch(_0x5b5262){return BPromise[_0x9bdb('0x24')](_0x5b5262);}return _0x310256[_0x9bdb('0x25')]();};}function saveUpdates(_0x1bba44,_0x5b84cf){return function(_0x4062a3){if(_0x4062a3){return _0x4062a3[_0x9bdb('0x26')](_0x1bba44)[_0x9bdb('0x27')](function(_0x1725aa){return _0x1725aa;});}return null;};}function removeEntity(_0x561f9f,_0x37a02a){return function(_0x5958c0){if(_0x5958c0){return _0x5958c0[_0x9bdb('0x28')]()[_0x9bdb('0x27')](function(){_0x561f9f[_0x9bdb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158604,_0xab83c9){return function(_0x1f2c23){if(!_0x1f2c23){_0x158604[_0x9bdb('0x1b')](0x194);}return _0x1f2c23;};}function handleError(_0x4368c4,_0x14fb6a){_0x14fb6a=_0x14fb6a||0x1f4;return function(_0x426390){logger[_0x9bdb('0x29')](_0x426390[_0x9bdb('0x2a')]);if(_0x426390[_0x9bdb('0x2b')]){delete _0x426390['name'];}_0x4368c4[_0x9bdb('0x1c')](_0x14fb6a)[_0x9bdb('0x2c')](_0x426390);};}exports[_0x9bdb('0x2d')]=function(_0x1e2a89,_0x38e02f){var _0x264466={'raw':![],'where':{'id':_0x1e2a89['params']['id']}},_0x106160={};_0x106160[_0x9bdb('0x2e')]=_['keys'](db[_0x9bdb('0x2f')][_0x9bdb('0x30')]);_0x106160[_0x9bdb('0x31')]=_[_0x9bdb('0x32')](_0x1e2a89[_0x9bdb('0x31')]);_0x106160[_0x9bdb('0x33')]=_[_0x9bdb('0x34')](_0x106160['model'],_0x106160[_0x9bdb('0x31')]);_0x264466[_0x9bdb('0x35')]=_[_0x9bdb('0x34')](_0x106160['model'],qs['fields'](_0x1e2a89['query'][_0x9bdb('0x36')]));_0x264466['attributes']=_0x264466[_0x9bdb('0x35')][_0x9bdb('0x37')]?_0x264466[_0x9bdb('0x35')]:_0x106160[_0x9bdb('0x2e')];if(_0x1e2a89[_0x9bdb('0x31')][_0x9bdb('0x38')]){_0x264466[_0x9bdb('0x39')]=[{'all':!![]}];}_0x264466=_['merge']({},_0x264466,_0x1e2a89[_0x9bdb('0x3a')]);return db[_0x9bdb('0x2f')][_0x9bdb('0x3b')](_0x264466)[_0x9bdb('0x27')](handleEntityNotFound(_0x38e02f,null))[_0x9bdb('0x27')](respondWithResult(_0x38e02f,null))['catch'](handleError(_0x38e02f,null));};exports[_0x9bdb('0x28')]=function(_0x35e567,_0x232043){return db['DashboardItem'][_0x9bdb('0x3b')]({'where':{'id':_0x35e567['params']['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x232043,null))[_0x9bdb('0x27')](removeEntity(_0x232043,null))[_0x9bdb('0x3c')](handleError(_0x232043,null));};function widgetAttributes(_0x4e6c37){try{switch(_0x4e6c37['type']){case'iframe':return[{'name':_0x9bdb('0x3d'),'value':_0x4e6c37[_0x9bdb('0x3d')]||(_0x4e6c37['attrs']&&_0x4e6c37[_0x9bdb('0x3e')][0x0]?_0x4e6c37['attrs'][0x0][_0x9bdb('0x3f')]:undefined)||'https://'}];case _0x9bdb('0x40'):return[{'name':_0x9bdb('0x41'),'value':_0x4e6c37[_0x9bdb('0x41')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x0]?_0x4e6c37[_0x9bdb('0x3e')][0x0]['value']:undefined)||''}];case _0x9bdb('0x42'):return[{'name':_0x9bdb('0x43'),'value':_0x4e6c37['attrHourFormat']||(_0x4e6c37['attrs']&&_0x4e6c37[_0x9bdb('0x3e')][0x0]?_0x4e6c37['attrs'][0x0][_0x9bdb('0x3f')]:undefined)||_0x9bdb('0x44')},{'name':'attrTimezone','value':_0x4e6c37[_0x9bdb('0x45')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x1]?_0x4e6c37[_0x9bdb('0x3e')][0x1][_0x9bdb('0x3f')]:undefined)||'0.00'},{'name':_0x9bdb('0x46'),'value':_0x4e6c37['attrFontSize']||(_0x4e6c37['attrs']&&_0x4e6c37[_0x9bdb('0x3e')][0x2]?_0x4e6c37['attrs'][0x2]['value']:undefined)||0xc}];case _0x9bdb('0x47'):return[{'name':_0x9bdb('0x48'),'value':_0x4e6c37['attrMetric']||(_0x4e6c37['attrs']&&_0x4e6c37[_0x9bdb('0x3e')][0x0]?_0x4e6c37[_0x9bdb('0x3e')][0x0][_0x9bdb('0x3f')]:undefined)||_0x9bdb('0x49')},{'name':_0x9bdb('0x4a'),'value':_0x4e6c37[_0x9bdb('0x4a')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37['attrs'][0x1]?_0x4e6c37[_0x9bdb('0x3e')][0x1]['value']:undefined)||[]},{'name':_0x9bdb('0x46'),'value':_0x4e6c37[_0x9bdb('0x46')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x2]?_0x4e6c37[_0x9bdb('0x3e')][0x2][_0x9bdb('0x3f')]:undefined)||0x14},{'name':_0x9bdb('0x4b'),'value':_0x4e6c37['attrChannel']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x3]?_0x4e6c37['attrs'][0x3][_0x9bdb('0x3f')]:undefined)||_0x9bdb('0x4c')},{'name':_0x9bdb('0x4d'),'value':_0x4e6c37['attrEmailAccounts']||(_0x4e6c37['attrs']&&_0x4e6c37['attrs'][0x4]?_0x4e6c37[_0x9bdb('0x3e')][0x4][_0x9bdb('0x3f')]:undefined)||''},{'name':_0x9bdb('0x4e'),'value':_0x4e6c37['attrFaxAccounts']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x5]?_0x4e6c37['attrs'][0x5]['value']:undefined)||''},{'name':_0x9bdb('0x4f'),'value':_0x4e6c37['attrSmsAccounts']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x6]?_0x4e6c37[_0x9bdb('0x3e')][0x6][_0x9bdb('0x3f')]:undefined)||''},{'name':_0x9bdb('0x50'),'value':_0x4e6c37[_0x9bdb('0x50')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x7]?_0x4e6c37['attrs'][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4e6c37[_0x9bdb('0x51')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x8]?_0x4e6c37[_0x9bdb('0x3e')][0x8][_0x9bdb('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4e6c37['attrChatWebsites']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37['attrs'][0x9]?_0x4e6c37[_0x9bdb('0x3e')][0x9][_0x9bdb('0x3f')]:undefined)||''}];case _0x9bdb('0x52'):case _0x9bdb('0x53'):return[{'name':_0x9bdb('0x54'),'value':_0x4e6c37[_0x9bdb('0x54')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x0]?_0x4e6c37['attrs'][0x0][_0x9bdb('0x3f')]:undefined)||_0x9bdb('0x49')},{'name':_0x9bdb('0x55'),'value':_0x4e6c37['attrSerie2']||(_0x4e6c37['attrs']&&_0x4e6c37['attrs'][0x1]?_0x4e6c37['attrs'][0x1][_0x9bdb('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x4e6c37['attrSerie3']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x2]?_0x4e6c37[_0x9bdb('0x3e')][0x2][_0x9bdb('0x3f')]:undefined)||null},{'name':_0x9bdb('0x4a'),'value':_0x4e6c37[_0x9bdb('0x4a')]||(_0x4e6c37['attrs']&&_0x4e6c37['attrs'][0x3]?_0x4e6c37[_0x9bdb('0x3e')][0x3]['value']:undefined)||[]},{'name':_0x9bdb('0x4b'),'value':_0x4e6c37['attrChannel']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37['attrs'][0x4]?_0x4e6c37[_0x9bdb('0x3e')][0x4]['value']:undefined)||'voice'},{'name':_0x9bdb('0x4d'),'value':_0x4e6c37['attrEmailAccounts']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37['attrs'][0x5]?_0x4e6c37[_0x9bdb('0x3e')][0x5][_0x9bdb('0x3f')]:undefined)||''},{'name':_0x9bdb('0x4e'),'value':_0x4e6c37[_0x9bdb('0x4e')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x6]?_0x4e6c37[_0x9bdb('0x3e')][0x6][_0x9bdb('0x3f')]:undefined)||''},{'name':_0x9bdb('0x4f'),'value':_0x4e6c37[_0x9bdb('0x4f')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x7]?_0x4e6c37[_0x9bdb('0x3e')][0x7][_0x9bdb('0x3f')]:undefined)||''},{'name':_0x9bdb('0x50'),'value':_0x4e6c37[_0x9bdb('0x50')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x8]?_0x4e6c37[_0x9bdb('0x3e')][0x8]['value']:undefined)||''},{'name':_0x9bdb('0x51'),'value':_0x4e6c37[_0x9bdb('0x51')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37['attrs'][0x9]?_0x4e6c37[_0x9bdb('0x3e')][0x9][_0x9bdb('0x3f')]:undefined)||''},{'name':_0x9bdb('0x56'),'value':_0x4e6c37['attrChatWebsites']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0xa]?_0x4e6c37[_0x9bdb('0x3e')][0xa][_0x9bdb('0x3f')]:undefined)||''}];case'web-report':return[{'name':_0x9bdb('0x57'),'type':_0x4e6c37['reportType']||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37['attrs'][0x0]?_0x4e6c37[_0x9bdb('0x3e')][0x0][_0x9bdb('0x58')]:undefined)||null,'value':_0x4e6c37[_0x9bdb('0x57')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x0]?_0x4e6c37[_0x9bdb('0x3e')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x4e6c37[_0x9bdb('0x59')]||(_0x4e6c37[_0x9bdb('0x3e')]&&_0x4e6c37[_0x9bdb('0x3e')][0x1]?_0x4e6c37[_0x9bdb('0x3e')][0x1][_0x9bdb('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x27dd7f){logger[_0x9bdb('0x29')](_0x9bdb('0x5a'),JSON['stringify'](_0x27dd7f));return[];}}exports[_0x9bdb('0x5b')]=function(_0x452c21,_0x135b6a){if(_0x452c21[_0x9bdb('0x5c')]){_0x452c21[_0x9bdb('0x5c')][_0x9bdb('0x3e')]=widgetAttributes(_0x452c21['body']);}return db[_0x9bdb('0x2f')][_0x9bdb('0x5b')](_0x452c21[_0x9bdb('0x5c')],{})['then'](respondWithResult(_0x135b6a,0xc9))[_0x9bdb('0x3c')](handleError(_0x135b6a,null));};exports[_0x9bdb('0x26')]=function(_0x3306d7,_0x10776b){if(_0x3306d7[_0x9bdb('0x5c')]['id']){delete _0x3306d7[_0x9bdb('0x5c')]['id'];}_0x3306d7[_0x9bdb('0x5c')]['attrs']=widgetAttributes(_0x3306d7[_0x9bdb('0x5c')]);return db[_0x9bdb('0x2f')][_0x9bdb('0x3b')]({'where':{'id':_0x3306d7['params']['id']}})['then'](handleEntityNotFound(_0x10776b,null))['then'](saveUpdates(_0x3306d7[_0x9bdb('0x5c')],null))[_0x9bdb('0x27')](respondWithResult(_0x10776b,null))[_0x9bdb('0x3c')](handleError(_0x10776b,null));}; \ No newline at end of file +var _0x4f0d=['reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','DashboardItem','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','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','attrReport','reportType','attrRefresh','stringify','body','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0x4f0d[_0x423549];return _0xdcb104;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd4f0('0x0'));var BPromise=require(_0xd4f0('0x1'));var Mustache=require(_0xd4f0('0x2'));var util=require('util');var path=require(_0xd4f0('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd4f0('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f0('0x5'));var squel=require(_0xd4f0('0x6'));var crypto=require('crypto');var jsforce=require(_0xd4f0('0x7'));var deskjs=require(_0xd4f0('0x8'));var toCsv=require(_0xd4f0('0x9'));var querystring=require(_0xd4f0('0xa'));var Papa=require(_0xd4f0('0xb'));var Redis=require('ioredis');var authService=require(_0xd4f0('0xc'));var qs=require(_0xd4f0('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4f0('0xe'))(_0xd4f0('0xf'));var utils=require('../../config/utils');var config=require(_0xd4f0('0x10'));var licenseUtil=require(_0xd4f0('0x11'));var db=require(_0xd4f0('0x12'))['db'];config[_0xd4f0('0x13')]=_[_0xd4f0('0x14')](config['redis'],{'host':_0xd4f0('0x15'),'port':0x18eb});var socket=require(_0xd4f0('0x16'))(new Redis(config[_0xd4f0('0x13')]));require(_0xd4f0('0x17'))[_0xd4f0('0x18')](socket);function respondWithStatusCode(_0x544936,_0x100cd4){_0x100cd4=_0x100cd4||0xcc;return function(_0x386f84){if(_0x386f84){return _0x544936[_0xd4f0('0x19')](_0x100cd4);}return _0x544936[_0xd4f0('0x1a')](_0x100cd4)[_0xd4f0('0x1b')]();};}function respondWithResult(_0x2dd02d,_0x4f8e76){_0x4f8e76=_0x4f8e76||0xc8;return function(_0x5adf8a){if(_0x5adf8a){return _0x2dd02d[_0xd4f0('0x1a')](_0x4f8e76)[_0xd4f0('0x1c')](_0x5adf8a);}};}function respondWithFilteredResult(_0xff90e,_0x7b2ca4){return function(_0x4d0dcc){if(_0x4d0dcc){var _0x5bf265=typeof _0x7b2ca4[_0xd4f0('0x1d')]===_0xd4f0('0x1e')&&typeof _0x7b2ca4[_0xd4f0('0x1f')]===_0xd4f0('0x1e');var _0x7560d6=_0x4d0dcc[_0xd4f0('0x20')];var _0x57d418=_0x5bf265?0x0:_0x7b2ca4[_0xd4f0('0x1d')];var _0x2f0b79=_0x5bf265?_0x4d0dcc[_0xd4f0('0x20')]:_0x7b2ca4['offset']+_0x7b2ca4[_0xd4f0('0x1f')];var _0x474c22;if(_0x2f0b79>=_0x7560d6){_0x2f0b79=_0x7560d6;_0x474c22=0xc8;}else{_0x474c22=0xce;}_0xff90e[_0xd4f0('0x1a')](_0x474c22);return _0xff90e['set'](_0xd4f0('0x21'),_0x57d418+'-'+_0x2f0b79+'/'+_0x7560d6)[_0xd4f0('0x1c')](_0x4d0dcc);}return null;};}function patchUpdates(_0x655480){return function(_0x5b94bb){try{jsonpatch[_0xd4f0('0x22')](_0x5b94bb,_0x655480,!![]);}catch(_0x174e52){return BPromise[_0xd4f0('0x23')](_0x174e52);}return _0x5b94bb[_0xd4f0('0x24')]();};}function saveUpdates(_0x4fd650,_0x1552e9){return function(_0x3345c6){if(_0x3345c6){return _0x3345c6[_0xd4f0('0x25')](_0x4fd650)[_0xd4f0('0x26')](function(_0x5f4858){return _0x5f4858;});}return null;};}function removeEntity(_0x37e8a1,_0x49b94b){return function(_0x15e310){if(_0x15e310){return _0x15e310[_0xd4f0('0x27')]()[_0xd4f0('0x26')](function(){_0x37e8a1[_0xd4f0('0x1a')](0xcc)[_0xd4f0('0x1b')]();});}};}function handleEntityNotFound(_0x2f4291,_0x1dd584){return function(_0xe25e57){if(!_0xe25e57){_0x2f4291[_0xd4f0('0x19')](0x194);}return _0xe25e57;};}function handleError(_0x2c1f4f,_0xe2bf28){_0xe2bf28=_0xe2bf28||0x1f4;return function(_0x4ea8aa){logger[_0xd4f0('0x28')](_0x4ea8aa[_0xd4f0('0x29')]);if(_0x4ea8aa[_0xd4f0('0x2a')]){delete _0x4ea8aa[_0xd4f0('0x2a')];}_0x2c1f4f['status'](_0xe2bf28)[_0xd4f0('0x2b')](_0x4ea8aa);};}exports[_0xd4f0('0x2c')]=function(_0x401a5b,_0x40da73){var _0x4b8244={'raw':![],'where':{'id':_0x401a5b[_0xd4f0('0x2d')]['id']}},_0x39c44a={};_0x39c44a[_0xd4f0('0x2e')]=_[_0xd4f0('0x2f')](db['DashboardItem'][_0xd4f0('0x30')]);_0x39c44a[_0xd4f0('0x31')]=_[_0xd4f0('0x2f')](_0x401a5b[_0xd4f0('0x31')]);_0x39c44a[_0xd4f0('0x32')]=_[_0xd4f0('0x33')](_0x39c44a[_0xd4f0('0x2e')],_0x39c44a[_0xd4f0('0x31')]);_0x4b8244[_0xd4f0('0x34')]=_[_0xd4f0('0x33')](_0x39c44a[_0xd4f0('0x2e')],qs['fields'](_0x401a5b[_0xd4f0('0x31')][_0xd4f0('0x35')]));_0x4b8244[_0xd4f0('0x34')]=_0x4b8244[_0xd4f0('0x34')][_0xd4f0('0x36')]?_0x4b8244['attributes']:_0x39c44a[_0xd4f0('0x2e')];if(_0x401a5b[_0xd4f0('0x31')]['includeAll']){_0x4b8244[_0xd4f0('0x37')]=[{'all':!![]}];}_0x4b8244=_[_0xd4f0('0x38')]({},_0x4b8244,_0x401a5b[_0xd4f0('0x39')]);return db['DashboardItem'][_0xd4f0('0x3a')](_0x4b8244)['then'](handleEntityNotFound(_0x40da73,null))['then'](respondWithResult(_0x40da73,null))['catch'](handleError(_0x40da73,null));};exports[_0xd4f0('0x27')]=function(_0x33c1ea,_0x23283b){return db[_0xd4f0('0x3b')][_0xd4f0('0x3a')]({'where':{'id':_0x33c1ea['params']['id']}})['then'](handleEntityNotFound(_0x23283b,null))[_0xd4f0('0x26')](removeEntity(_0x23283b,null))[_0xd4f0('0x3c')](handleError(_0x23283b,null));};function widgetAttributes(_0x386ec3){try{switch(_0x386ec3['type']){case _0xd4f0('0x3d'):return[{'name':_0xd4f0('0x3e'),'value':_0x386ec3[_0xd4f0('0x3e')]||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x41')}];case _0xd4f0('0x42'):return[{'name':_0xd4f0('0x43'),'value':_0x386ec3[_0xd4f0('0x43')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x44'):return[{'name':'attrHourFormat','value':_0x386ec3[_0xd4f0('0x45')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x46')},{'name':'attrTimezone','value':_0x386ec3[_0xd4f0('0x47')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x48')},{'name':'attrFontSize','value':_0x386ec3[_0xd4f0('0x49')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x2]?_0x386ec3['attrs'][0x2][_0xd4f0('0x40')]:undefined)||0xc}];case _0xd4f0('0x4a'):return[{'name':_0xd4f0('0x4b'),'value':_0x386ec3['attrMetric']||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x4c')},{'name':_0xd4f0('0x4d'),'value':_0x386ec3[_0xd4f0('0x4d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||[]},{'name':_0xd4f0('0x49'),'value':_0x386ec3[_0xd4f0('0x49')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x2]?_0x386ec3[_0xd4f0('0x3f')][0x2]['value']:undefined)||0x14},{'name':_0xd4f0('0x4e'),'value':_0x386ec3['attrChannel']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x3]?_0x386ec3[_0xd4f0('0x3f')][0x3]['value']:undefined)||_0xd4f0('0x4f')},{'name':_0xd4f0('0x50'),'value':_0x386ec3['attrEmailAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x4]?_0x386ec3[_0xd4f0('0x3f')][0x4][_0xd4f0('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x386ec3[_0xd4f0('0x51')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x5]?_0x386ec3[_0xd4f0('0x3f')][0x5][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x52'),'value':_0x386ec3[_0xd4f0('0x52')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x6]?_0x386ec3[_0xd4f0('0x3f')][0x6][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x53'),'value':_0x386ec3['attrOpenchannelAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x7]?_0x386ec3[_0xd4f0('0x3f')][0x7][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x54'),'value':_0x386ec3['attrWhatsappAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x8]?_0x386ec3[_0xd4f0('0x3f')][0x8][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x55'),'value':_0x386ec3[_0xd4f0('0x55')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x9]?_0x386ec3[_0xd4f0('0x3f')][0x9][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x56'):case _0xd4f0('0x57'):return[{'name':_0xd4f0('0x58'),'value':_0x386ec3[_0xd4f0('0x58')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0]['value']:undefined)||_0xd4f0('0x4c')},{'name':_0xd4f0('0x59'),'value':_0x386ec3[_0xd4f0('0x59')]||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1]['value']:undefined)||null},{'name':_0xd4f0('0x5a'),'value':_0x386ec3[_0xd4f0('0x5a')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x2]?_0x386ec3['attrs'][0x2][_0xd4f0('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x386ec3[_0xd4f0('0x4d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x3]?_0x386ec3[_0xd4f0('0x3f')][0x3][_0xd4f0('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x386ec3['attrChannel']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x4]?_0x386ec3[_0xd4f0('0x3f')][0x4][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x4f')},{'name':_0xd4f0('0x50'),'value':_0x386ec3[_0xd4f0('0x50')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x5]?_0x386ec3['attrs'][0x5][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x51'),'value':_0x386ec3['attrFaxAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x6]?_0x386ec3[_0xd4f0('0x3f')][0x6][_0xd4f0('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x386ec3['attrSmsAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x7]?_0x386ec3['attrs'][0x7]['value']:undefined)||''},{'name':_0xd4f0('0x53'),'value':_0x386ec3[_0xd4f0('0x53')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x8]?_0x386ec3[_0xd4f0('0x3f')][0x8][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x54'),'value':_0x386ec3[_0xd4f0('0x54')]||(_0x386ec3['attrs']&&_0x386ec3['attrs'][0x9]?_0x386ec3[_0xd4f0('0x3f')][0x9]['value']:undefined)||''},{'name':_0xd4f0('0x55'),'value':_0x386ec3['attrChatWebsites']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0xa]?_0x386ec3['attrs'][0xa][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x5b'):return[{'name':_0xd4f0('0x5c'),'type':_0x386ec3[_0xd4f0('0x5d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0]['type']:undefined)||null,'value':_0x386ec3['attrReport']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x386ec3[_0xd4f0('0x5e')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3d4979){logger[_0xd4f0('0x28')]('widgetAttributes:\x20%s',JSON[_0xd4f0('0x5f')](_0x3d4979));return[];}}exports['create']=function(_0x1c0afe,_0x41da67){if(_0x1c0afe[_0xd4f0('0x60')]){_0x1c0afe[_0xd4f0('0x60')][_0xd4f0('0x3f')]=widgetAttributes(_0x1c0afe['body']);}return db[_0xd4f0('0x3b')]['create'](_0x1c0afe[_0xd4f0('0x60')],{})[_0xd4f0('0x26')](respondWithResult(_0x41da67,0xc9))['catch'](handleError(_0x41da67,null));};exports[_0xd4f0('0x25')]=function(_0x45427c,_0x5e330c){if(_0x45427c[_0xd4f0('0x60')]['id']){delete _0x45427c[_0xd4f0('0x60')]['id'];}_0x45427c[_0xd4f0('0x60')][_0xd4f0('0x3f')]=widgetAttributes(_0x45427c[_0xd4f0('0x60')]);return db[_0xd4f0('0x3b')]['find']({'where':{'id':_0x45427c[_0xd4f0('0x2d')]['id']}})[_0xd4f0('0x26')](handleEntityNotFound(_0x5e330c,null))[_0xd4f0('0x26')](saveUpdates(_0x45427c['body'],null))[_0xd4f0('0x26')](respondWithResult(_0x5e330c,null))[_0xd4f0('0x3c')](handleError(_0x5e330c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9438b84..80baf09 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 _0xe8cc=['exports','setMaxListeners','save','emit','hook'];(function(_0x146ef3,_0x1c7bb0){var _0x5d9bae=function(_0x3b70f7){while(--_0x3b70f7){_0x146ef3['push'](_0x146ef3['shift']());}};_0x5d9bae(++_0x1c7bb0);}(_0xe8cc,0x1cd));var _0xce8c=function(_0x479515,_0x25ae1c){_0x479515=_0x479515-0x0;var _0x21214a=_0xe8cc[_0x479515];return _0x21214a;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xce8c('0x0')](0x0);var events={'afterCreate':_0xce8c('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e7cd4){return function(_0x33fca3,_0x5f2af4,_0x1c995b){DashboardItemEvents[_0xce8c('0x2')](_0x1e7cd4+':'+_0x33fca3['id'],_0x33fca3);DashboardItemEvents[_0xce8c('0x2')](_0x1e7cd4,_0x33fca3);_0x1c995b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xce8c('0x3')](e,emitEvent(event));}}module[_0xce8c('0x4')]=DashboardItemEvents; \ No newline at end of file +var _0xa363=['update','remove','hook','exports','events','setMaxListeners','save'];(function(_0x2568e6,_0x11db36){var _0x22d5eb=function(_0x2eede4){while(--_0x2eede4){_0x2568e6['push'](_0x2568e6['shift']());}};_0x22d5eb(++_0x11db36);}(_0xa363,0x1af));var _0x3a36=function(_0x5719d4,_0x10ebb3){_0x5719d4=_0x5719d4-0x0;var _0x128cc9=_0xa363[_0x5719d4];return _0x128cc9;};'use strict';var EventEmitter=require(_0x3a36('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3a36('0x1')](0x0);var events={'afterCreate':_0x3a36('0x2'),'afterUpdate':_0x3a36('0x3'),'afterDestroy':_0x3a36('0x4')};function emitEvent(_0x287be1){return function(_0x128058,_0x500641,_0x898ae7){DashboardItemEvents['emit'](_0x287be1+':'+_0x128058['id'],_0x128058);DashboardItemEvents['emit'](_0x287be1,_0x128058);_0x898ae7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x3a36('0x5')](e,emitEvent(event));}}module[_0x3a36('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 197c28f..3af7bd1 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 _0x245e=['moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x5d3b19,_0x56f35b){var _0x389436=function(_0x4d9fb1){while(--_0x4d9fb1){_0x5d3b19['push'](_0x5d3b19['shift']());}};_0x389436(++_0x56f35b);}(_0x245e,0x11d));var _0xe245=function(_0xb0336d,_0x106a81){_0xb0336d=_0xb0336d-0x0;var _0x28e10e=_0x245e[_0xb0336d];return _0x28e10e;};'use strict';var _=require(_0xe245('0x0'));var util=require(_0xe245('0x1'));var logger=require(_0xe245('0x2'))('api');var moment=require(_0xe245('0x3'));var BPromise=require(_0xe245('0x4'));var rp=require(_0xe245('0x5'));var fs=require('fs');var path=require(_0xe245('0x6'));var rimraf=require('rimraf');var config=require(_0xe245('0x7'));var attributes=require(_0xe245('0x8'));module['exports']=function(_0x42b5b5,_0x230478){return _0x42b5b5[_0xe245('0x9')](_0xe245('0xa'),attributes,{'tableName':_0xe245('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab1e=['dashboard_items','api','moment','bluebird','request-promise','path','./dashboardItem.attributes','define'];(function(_0x21d691,_0x114a69){var _0x5b6fe6=function(_0x141727){while(--_0x141727){_0x21d691['push'](_0x21d691['shift']());}};_0x5b6fe6(++_0x114a69);}(_0xab1e,0x81));var _0xeab1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xab1e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xeab1('0x0'));var moment=require(_0xeab1('0x1'));var BPromise=require(_0xeab1('0x2'));var rp=require(_0xeab1('0x3'));var fs=require('fs');var path=require(_0xeab1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeab1('0x5'));module['exports']=function(_0x34cab1,_0x4c6daf){return _0x34cab1[_0xeab1('0x6')]('DashboardItem',attributes,{'tableName':_0xeab1('0x7'),'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 93441ba..f5e7f6b 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 _0x186c=['DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x186c,0xa3));var _0xc186=function(_0x434ab9,_0x2c3eef){_0x434ab9=_0x434ab9-0x0;var _0x2ca0d9=_0x186c[_0x434ab9];return _0x2ca0d9;};'use strict';var _=require(_0xc186('0x0'));var util=require(_0xc186('0x1'));var moment=require(_0xc186('0x2'));var BPromise=require(_0xc186('0x3'));var rs=require(_0xc186('0x4'));var fs=require('fs');var Redis=require(_0xc186('0x5'));var db=require(_0xc186('0x6'))['db'];var utils=require(_0xc186('0x7'));var logger=require(_0xc186('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc186('0x9'));var client=jayson[_0xc186('0xa')][_0xc186('0xb')]({'port':0x232a});config[_0xc186('0xc')]=_[_0xc186('0xd')](config[_0xc186('0xc')],{'host':_0xc186('0xe'),'port':0x18eb});var socket=require(_0xc186('0xf'))(new Redis(config[_0xc186('0xc')]));require(_0xc186('0x10'))[_0xc186('0x11')](socket);function respondWithRpcPromise(_0x3ec90f,_0x55ba62,_0x17088f){return new BPromise(function(_0x52c08c,_0x3a1fbc){return client[_0xc186('0x12')](_0x3ec90f,_0x17088f)[_0xc186('0x13')](function(_0x2340f1){logger[_0xc186('0x14')](_0xc186('0x15'),_0x55ba62,'request\x20sent');logger[_0xc186('0x16')](_0xc186('0x17'),_0x55ba62,_0xc186('0x18'),JSON[_0xc186('0x19')](_0x2340f1));if(_0x2340f1[_0xc186('0x1a')]){if(_0x2340f1[_0xc186('0x1a')][_0xc186('0x1b')]===0x1f4){logger['error'](_0xc186('0x15'),_0x55ba62,_0x2340f1['error'][_0xc186('0x1c')]);return _0x3a1fbc(_0x2340f1[_0xc186('0x1a')][_0xc186('0x1c')]);}logger[_0xc186('0x1a')](_0xc186('0x15'),_0x55ba62,_0x2340f1[_0xc186('0x1a')][_0xc186('0x1c')]);return _0x52c08c(_0x2340f1['error'][_0xc186('0x1c')]);}else{logger[_0xc186('0x14')](_0xc186('0x15'),_0x55ba62,_0xc186('0x18'));_0x52c08c(_0x2340f1[_0xc186('0x1d')][_0xc186('0x1c')]);}})[_0xc186('0x1e')](function(_0x565527){logger[_0xc186('0x1a')](_0xc186('0x15'),_0x55ba62,_0x565527);_0x3a1fbc(_0x565527);});});} \ No newline at end of file +var _0xf338=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xf338,0x109));var _0x8f33=function(_0x36f688,_0x136a34){_0x36f688=_0x36f688-0x0;var _0x5483e4=_0xf338[_0x36f688];return _0x5483e4;};'use strict';var _=require(_0x8f33('0x0'));var util=require(_0x8f33('0x1'));var moment=require(_0x8f33('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f33('0x3'));var fs=require('fs');var Redis=require(_0x8f33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f33('0x5'));var logger=require(_0x8f33('0x6'))(_0x8f33('0x7'));var config=require(_0x8f33('0x8'));var jayson=require(_0x8f33('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8f33('0xa')]=_['defaults'](config['redis'],{'host':_0x8f33('0xb'),'port':0x18eb});var socket=require(_0x8f33('0xc'))(new Redis(config[_0x8f33('0xa')]));require(_0x8f33('0xd'))[_0x8f33('0xe')](socket);function respondWithRpcPromise(_0x564d5b,_0x59d014,_0xf1aa61){return new BPromise(function(_0x213efc,_0x2d5722){return client[_0x8f33('0xf')](_0x564d5b,_0xf1aa61)[_0x8f33('0x10')](function(_0x2f9f30){logger[_0x8f33('0x11')](_0x8f33('0x12'),_0x59d014,_0x8f33('0x13'));logger[_0x8f33('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x59d014,_0x8f33('0x13'),JSON[_0x8f33('0x15')](_0x2f9f30));if(_0x2f9f30[_0x8f33('0x16')]){if(_0x2f9f30[_0x8f33('0x16')][_0x8f33('0x17')]===0x1f4){logger[_0x8f33('0x16')]('DashboardItem,\x20%s,\x20%s',_0x59d014,_0x2f9f30[_0x8f33('0x16')]['message']);return _0x2d5722(_0x2f9f30[_0x8f33('0x16')][_0x8f33('0x18')]);}logger[_0x8f33('0x16')](_0x8f33('0x12'),_0x59d014,_0x2f9f30[_0x8f33('0x16')]['message']);return _0x213efc(_0x2f9f30[_0x8f33('0x16')][_0x8f33('0x18')]);}else{logger[_0x8f33('0x11')](_0x8f33('0x12'),_0x59d014,'request\x20sent');_0x213efc(_0x2f9f30[_0x8f33('0x19')][_0x8f33('0x18')]);}})['catch'](function(_0x386be8){logger[_0x8f33('0x16')](_0x8f33('0x12'),_0x59d014,_0x386be8);_0x2d5722(_0x386be8);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 6e6838e..2c4feb7 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 _0xb974=['emit','removeListener','register','length','./dashboardItem.events','remove'];(function(_0x1cfb84,_0x17ceb4){var _0xdee636=function(_0x5ead67){while(--_0x5ead67){_0x1cfb84['push'](_0x1cfb84['shift']());}};_0xdee636(++_0x17ceb4);}(_0xb974,0x12a));var _0x4b97=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb974[_0x3bf83f];return _0x22c4a9;};'use strict';var DashboardItemEvents=require(_0x4b97('0x0'));var events=['save',_0x4b97('0x1'),'update'];function createListener(_0x253f98,_0x278c7e){return function(_0x2784fe){_0x278c7e[_0x4b97('0x2')](_0x253f98,_0x2784fe);};}function removeListener(_0x478ae1,_0x254483){return function(){DashboardItemEvents[_0x4b97('0x3')](_0x478ae1,_0x254483);};}exports[_0x4b97('0x4')]=function(_0xe4e89d){for(var _0x49774d=0x0,_0x4300ed=events[_0x4b97('0x5')];_0x49774d<_0x4300ed;_0x49774d++){var _0x3062f1=events[_0x49774d];var _0x29c897=createListener('dashboardItem:'+_0x3062f1,_0xe4e89d);DashboardItemEvents['on'](_0x3062f1,_0x29c897);}}; \ No newline at end of file +var _0x176b=['save','remove','update','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x48fddb,_0x37a2d3){var _0x22dad1=function(_0x4d32d6){while(--_0x4d32d6){_0x48fddb['push'](_0x48fddb['shift']());}};_0x22dad1(++_0x37a2d3);}(_0x176b,0xe7));var _0xb176=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x176b[_0x5e07a7];return _0x22ced5;};'use strict';var DashboardItemEvents=require(_0xb176('0x0'));var events=[_0xb176('0x1'),_0xb176('0x2'),_0xb176('0x3')];function createListener(_0x5e26da,_0x2fa66c){return function(_0x4cc6bb){_0x2fa66c[_0xb176('0x4')](_0x5e26da,_0x4cc6bb);};}function removeListener(_0x441fc1,_0x5dfdf7){return function(){DashboardItemEvents[_0xb176('0x5')](_0x441fc1,_0x5dfdf7);};}exports[_0xb176('0x6')]=function(_0x4060ef){for(var _0x22cbb9=0x0,_0x2aece9=events['length'];_0x22cbb9<_0x2aece9;_0x22cbb9++){var _0xfe7733=events[_0x22cbb9];var _0x1285c0=createListener(_0xb176('0x7')+_0xfe7733,_0x4060ef);DashboardItemEvents['on'](_0xfe7733,_0x1285c0);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f3be780..7ba42fb 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 _0x800a=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x800a,0x65));var _0xa800=function(_0x193ade,_0x109108){_0x193ade=_0x193ade-0x0;var _0x5aa435=_0x800a[_0x193ade];return _0x5aa435;};'use strict';var multer=require(_0xa800('0x0'));var util=require(_0xa800('0x1'));var path=require(_0xa800('0x2'));var timeout=require(_0xa800('0x3'));var express=require(_0xa800('0x4'));var router=express[_0xa800('0x5')]();var fs_extra=require(_0xa800('0x6'));var auth=require(_0xa800('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa800('0x8'));var controller=require('./dashboardItem.controller');router[_0xa800('0x9')](_0xa800('0xa'),auth[_0xa800('0xb')](),controller[_0xa800('0xc')]);router[_0xa800('0xd')]('/',auth[_0xa800('0xb')](),controller[_0xa800('0xe')]);router[_0xa800('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa800('0x10')]);router[_0xa800('0x11')](_0xa800('0xa'),auth['isAuthenticated'](),controller[_0xa800('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5659=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','put','update','delete','util','path'];(function(_0x3988c6,_0x18fb1d){var _0x12633a=function(_0x4a64cd){while(--_0x4a64cd){_0x3988c6['push'](_0x3988c6['shift']());}};_0x12633a(++_0x18fb1d);}(_0x5659,0x1da));var _0x9565=function(_0x276f6d,_0x10a50e){_0x276f6d=_0x276f6d-0x0;var _0xda31b5=_0x5659[_0x276f6d];return _0xda31b5;};'use strict';var multer=require('multer');var util=require(_0x9565('0x0'));var path=require(_0x9565('0x1'));var timeout=require(_0x9565('0x2'));var express=require(_0x9565('0x3'));var router=express[_0x9565('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9565('0x5'));var config=require(_0x9565('0x6'));var controller=require(_0x9565('0x7'));router['get'](_0x9565('0x8'),auth[_0x9565('0x9')](),controller['show']);router[_0x9565('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9565('0xb')](_0x9565('0x8'),auth[_0x9565('0x9')](),controller[_0x9565('0xc')]);router[_0x9565('0xd')](_0x9565('0x8'),auth[_0x9565('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 95b6b06..58411e7 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 _0x4827=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x57122a,_0x5994b4){var _0x92b19c=function(_0x4cda22){while(--_0x4cda22){_0x57122a['push'](_0x57122a['shift']());}};_0x92b19c(++_0x5994b4);}(_0x4827,0x7e));var _0x7482=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4827[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7482('0x0'));module[_0x7482('0x1')]={'name':{'type':Sequelize[_0x7482('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7482('0x3')](_0x7482('0x4'),_0x7482('0x5'),_0x7482('0x6')),'allowNull':![],'defaultValue':_0x7482('0x4')},'description':{'type':Sequelize[_0x7482('0x2')]}}; \ No newline at end of file +var _0x078f=['ENUM','first','second','third','sequelize','exports','STRING'];(function(_0x4ed5d7,_0x1a61a8){var _0x9a927c=function(_0x6b6e9a){while(--_0x6b6e9a){_0x4ed5d7['push'](_0x4ed5d7['shift']());}};_0x9a927c(++_0x1a61a8);}(_0x078f,0xc1));var _0xf078=function(_0x39d2de,_0x25dcb6){_0x39d2de=_0x39d2de-0x0;var _0x211d52=_0x078f[_0x39d2de];return _0x211d52;};'use strict';var Sequelize=require(_0xf078('0x0'));module[_0xf078('0x1')]={'name':{'type':Sequelize[_0xf078('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x4'),_0xf078('0x5'),_0xf078('0x6')),'allowNull':![],'defaultValue':_0xf078('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 4527413..571c1e8 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 _0x743d=['moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise'];(function(_0x1240aa,_0x8a97b8){var _0x749864=function(_0x58ec50){while(--_0x58ec50){_0x1240aa['push'](_0x1240aa['shift']());}};_0x749864(++_0x8a97b8);}(_0x743d,0xa1));var _0xd743=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x743d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd743('0x0'));var jsonpatch=require(_0xd743('0x1'));var rp=require(_0xd743('0x2'));var moment=require(_0xd743('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd743('0x4'));var util=require('util');var path=require(_0xd743('0x5'));var sox=require('sox');var csv=require(_0xd743('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd743('0x7'));var squel=require(_0xd743('0x8'));var crypto=require(_0xd743('0x9'));var jsforce=require(_0xd743('0xa'));var deskjs=require(_0xd743('0xb'));var toCsv=require(_0xd743('0x6'));var querystring=require(_0xd743('0xc'));var Papa=require('papaparse');var Redis=require(_0xd743('0xd'));var authService=require(_0xd743('0xe'));var qs=require(_0xd743('0xf'));var as=require(_0xd743('0x10'));var hardwareService=require(_0xd743('0x11'));var logger=require(_0xd743('0x12'))(_0xd743('0x13'));var utils=require('../../config/utils');var config=require(_0xd743('0x14'));var licenseUtil=require(_0xd743('0x15'));var db=require(_0xd743('0x16'))['db'];function respondWithStatusCode(_0x3304d4,_0x31e24f){_0x31e24f=_0x31e24f||0xcc;return function(_0x277e4c){if(_0x277e4c){return _0x3304d4[_0xd743('0x17')](_0x31e24f);}return _0x3304d4[_0xd743('0x18')](_0x31e24f)[_0xd743('0x19')]();};}function respondWithResult(_0x153a12,_0x3d663c){_0x3d663c=_0x3d663c||0xc8;return function(_0x3b01a1){if(_0x3b01a1){return _0x153a12[_0xd743('0x18')](_0x3d663c)[_0xd743('0x1a')](_0x3b01a1);}};}function respondWithFilteredResult(_0x4a82f1,_0x37c5b3){return function(_0x1876e7){if(_0x1876e7){var _0x579f43=typeof _0x37c5b3['offset']===_0xd743('0x1b')&&typeof _0x37c5b3[_0xd743('0x1c')]===_0xd743('0x1b');var _0x2443e0=_0x1876e7[_0xd743('0x1d')];var _0x33722d=_0x579f43?0x0:_0x37c5b3[_0xd743('0x1e')];var _0x1bf247=_0x579f43?_0x1876e7[_0xd743('0x1d')]:_0x37c5b3[_0xd743('0x1e')]+_0x37c5b3[_0xd743('0x1c')];var _0x50aa93;if(_0x1bf247>=_0x2443e0){_0x1bf247=_0x2443e0;_0x50aa93=0xc8;}else{_0x50aa93=0xce;}_0x4a82f1[_0xd743('0x18')](_0x50aa93);return _0x4a82f1[_0xd743('0x1f')](_0xd743('0x20'),_0x33722d+'-'+_0x1bf247+'/'+_0x2443e0)[_0xd743('0x1a')](_0x1876e7);}return null;};}function patchUpdates(_0x2fe8e8){return function(_0x2c5a66){try{jsonpatch[_0xd743('0x21')](_0x2c5a66,_0x2fe8e8,!![]);}catch(_0x1db056){return BPromise[_0xd743('0x22')](_0x1db056);}return _0x2c5a66[_0xd743('0x23')]();};}function saveUpdates(_0x3a8503,_0x27c293){return function(_0x4e654f){if(_0x4e654f){return _0x4e654f[_0xd743('0x24')](_0x3a8503)[_0xd743('0x25')](function(_0x3e531c){return _0x3e531c;});}return null;};}function removeEntity(_0xc1a9a4,_0x28e8e0){return function(_0x3b4bab){if(_0x3b4bab){return _0x3b4bab[_0xd743('0x26')]()['then'](function(){var _0x45a7ed=_0x3b4bab[_0xd743('0x27')]({'plain':!![]});var _0xe64536=_0xd743('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0xe64536,'resourceId':_0x45a7ed['id']}})['then'](function(){return _0x3b4bab;});})['then'](function(){_0xc1a9a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9ee7,_0x3a1a6d){return function(_0x41b42a){if(!_0x41b42a){_0x2f9ee7[_0xd743('0x17')](0x194);}return _0x41b42a;};}function handleError(_0x5a95d2,_0x310172){_0x310172=_0x310172||0x1f4;return function(_0x59f174){logger['error'](_0x59f174[_0xd743('0x29')]);if(_0x59f174[_0xd743('0x2a')]){delete _0x59f174[_0xd743('0x2a')];}_0x5a95d2[_0xd743('0x18')](_0x310172)[_0xd743('0x2b')](_0x59f174);};}exports[_0xd743('0x2c')]=function(_0x2139eb,_0x64c55){var _0x27c865={},_0x932fbc={},_0x33e4e6={'count':0x0,'rows':[]};var _0x35cce9=_['map'](db[_0xd743('0x2d')][_0xd743('0x2e')],function(_0x5d077d){return{'name':_0x5d077d[_0xd743('0x2f')],'type':_0x5d077d[_0xd743('0x30')][_0xd743('0x31')]};});_0x932fbc[_0xd743('0x32')]=_[_0xd743('0x33')](_0x35cce9,_0xd743('0x2a'));_0x932fbc[_0xd743('0x34')]=_[_0xd743('0x35')](_0x2139eb['query']);_0x932fbc[_0xd743('0x36')]=_[_0xd743('0x37')](_0x932fbc[_0xd743('0x32')],_0x932fbc[_0xd743('0x34')]);_0x27c865[_0xd743('0x38')]=_[_0xd743('0x37')](_0x932fbc[_0xd743('0x32')],qs[_0xd743('0x39')](_0x2139eb[_0xd743('0x34')][_0xd743('0x39')]));_0x27c865[_0xd743('0x38')]=_0x27c865[_0xd743('0x38')][_0xd743('0x3a')]?_0x27c865[_0xd743('0x38')]:_0x932fbc[_0xd743('0x32')];if(!_0x2139eb[_0xd743('0x34')][_0xd743('0x3b')]('nolimit')){_0x27c865[_0xd743('0x1c')]=qs[_0xd743('0x1c')](_0x2139eb[_0xd743('0x34')]['limit']);_0x27c865['offset']=qs['offset'](_0x2139eb[_0xd743('0x34')]['offset']);}_0x27c865[_0xd743('0x3c')]=qs[_0xd743('0x3d')](_0x2139eb[_0xd743('0x34')][_0xd743('0x3d')]);_0x27c865[_0xd743('0x3e')]=qs[_0xd743('0x36')](_[_0xd743('0x3f')](_0x2139eb[_0xd743('0x34')],_0x932fbc[_0xd743('0x36')]),_0x35cce9);if(_0x2139eb[_0xd743('0x34')][_0xd743('0x40')]){_0x27c865[_0xd743('0x3e')]=_[_0xd743('0x41')](_0x27c865[_0xd743('0x3e')],{'$or':_[_0xd743('0x33')](_0x35cce9,function(_0x50a4be){if(_0x50a4be[_0xd743('0x30')]!==_0xd743('0x42')){var _0x1c2bfb={};_0x1c2bfb[_0x50a4be[_0xd743('0x2a')]]={'$like':'%'+_0x2139eb[_0xd743('0x34')][_0xd743('0x40')]+'%'};return _0x1c2bfb;}})});}_0x27c865=_[_0xd743('0x41')]({},_0x27c865,_0x2139eb[_0xd743('0x43')]);var _0x1dfbe6={'where':_0x27c865[_0xd743('0x3e')]};return db[_0xd743('0x2d')][_0xd743('0x1d')](_0x1dfbe6)[_0xd743('0x25')](function(_0x58cbad){_0x33e4e6[_0xd743('0x1d')]=_0x58cbad;if(_0x2139eb['query'][_0xd743('0x44')]){_0x27c865[_0xd743('0x45')]=[{'all':!![]}];}return db[_0xd743('0x2d')][_0xd743('0x46')](_0x27c865);})[_0xd743('0x25')](function(_0x815cec){_0x33e4e6[_0xd743('0x47')]=_0x815cec;return _0x33e4e6;})[_0xd743('0x25')](respondWithFilteredResult(_0x64c55,_0x27c865))[_0xd743('0x48')](handleError(_0x64c55,null));};exports['show']=function(_0x232774,_0x58c60e){var _0x456a5c={'raw':!![],'where':{'id':_0x232774[_0xd743('0x49')]['id']}},_0x3462d9={};_0x3462d9[_0xd743('0x32')]=_['keys'](db[_0xd743('0x2d')][_0xd743('0x2e')]);_0x3462d9['query']=_[_0xd743('0x35')](_0x232774[_0xd743('0x34')]);_0x3462d9['filters']=_[_0xd743('0x37')](_0x3462d9[_0xd743('0x32')],_0x3462d9['query']);_0x456a5c['attributes']=_[_0xd743('0x37')](_0x3462d9[_0xd743('0x32')],qs['fields'](_0x232774[_0xd743('0x34')]['fields']));_0x456a5c['attributes']=_0x456a5c[_0xd743('0x38')][_0xd743('0x3a')]?_0x456a5c['attributes']:_0x3462d9['model'];if(_0x232774[_0xd743('0x34')]['includeAll']){_0x456a5c[_0xd743('0x45')]=[{'all':!![]}];}_0x456a5c=_[_0xd743('0x41')]({},_0x456a5c,_0x232774[_0xd743('0x43')]);return db[_0xd743('0x2d')][_0xd743('0x4a')](_0x456a5c)[_0xd743('0x25')](handleEntityNotFound(_0x58c60e,null))[_0xd743('0x25')](respondWithResult(_0x58c60e,null))[_0xd743('0x48')](handleError(_0x58c60e,null));};exports['create']=function(_0x4081f6,_0x5bc637){return db['Disposition'][_0xd743('0x4b')](_0x4081f6[_0xd743('0x4c')],{})['then'](function(_0x60d5da){var _0x1d948a=_0x4081f6['user'][_0xd743('0x27')]({'plain':!![]});if(!_0x1d948a)throw new Error(_0xd743('0x4d'));if(_0x1d948a['role']===_0xd743('0x4e')){var _0x50d580=_0x60d5da['get']({'plain':!![]});var _0xd53244=_0xd743('0x28');return db[_0xd743('0x4f')][_0xd743('0x4a')]({'where':{'name':_0xd53244,'userProfileId':_0x1d948a['userProfileId']},'raw':!![]})[_0xd743('0x25')](function(_0x2da198){if(_0x2da198&&_0x2da198[_0xd743('0x50')]===0x0){return db['UserProfileResource'][_0xd743('0x4b')]({'name':_0x50d580['name'],'resourceId':_0x50d580['id'],'type':_0x2da198[_0xd743('0x2a')],'sectionId':_0x2da198['id']},{})[_0xd743('0x25')](function(){return _0x60d5da;});}else{return _0x60d5da;}})[_0xd743('0x48')](function(_0x1fd6aa){logger['error'](_0xd743('0x51'),_0x1fd6aa);throw _0x1fd6aa;});}return _0x60d5da;})['then'](respondWithResult(_0x5bc637,0xc9))[_0xd743('0x48')](handleError(_0x5bc637,null));};exports['update']=function(_0x10ba31,_0xba0fe0){if(_0x10ba31['body']['id']){delete _0x10ba31['body']['id'];}return db[_0xd743('0x2d')][_0xd743('0x4a')]({'where':{'id':_0x10ba31[_0xd743('0x49')]['id']}})[_0xd743('0x25')](handleEntityNotFound(_0xba0fe0,null))[_0xd743('0x25')](saveUpdates(_0x10ba31['body'],null))[_0xd743('0x25')](respondWithResult(_0xba0fe0,null))[_0xd743('0x48')](handleError(_0xba0fe0,null));};exports['destroy']=function(_0x5ad386,_0x3d2b9f){return db['Disposition'][_0xd743('0x4a')]({'where':{'id':_0x5ad386[_0xd743('0x49')]['id']}})[_0xd743('0x25')](handleEntityNotFound(_0x3d2b9f,null))[_0xd743('0x25')](removeEntity(_0x3d2b9f,null))[_0xd743('0x48')](handleError(_0x3d2b9f,null));}; \ No newline at end of file +var _0xf446=['then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update'];(function(_0x1e5abc,_0x48f83a){var _0x3cfab7=function(_0x3ca178){while(--_0x3ca178){_0x1e5abc['push'](_0x1e5abc['shift']());}};_0x3cfab7(++_0x48f83a);}(_0xf446,0x1c0));var _0x6f44=function(_0x141e5b,_0x44b460){_0x141e5b=_0x141e5b-0x0;var _0x1ce0ee=_0xf446[_0x141e5b];return _0x1ce0ee;};'use strict';var emlformat=require(_0x6f44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f44('0x1'));var jsonpatch=require(_0x6f44('0x2'));var rp=require('request-promise');var moment=require(_0x6f44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f44('0x4'));var util=require(_0x6f44('0x5'));var path=require('path');var sox=require(_0x6f44('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var licenseUtil=require(_0x6f44('0x13'));var db=require(_0x6f44('0x14'))['db'];function respondWithStatusCode(_0x4bacc0,_0x305757){_0x305757=_0x305757||0xcc;return function(_0x381112){if(_0x381112){return _0x4bacc0[_0x6f44('0x15')](_0x305757);}return _0x4bacc0[_0x6f44('0x16')](_0x305757)['end']();};}function respondWithResult(_0x82c009,_0x4f1b19){_0x4f1b19=_0x4f1b19||0xc8;return function(_0x310dec){if(_0x310dec){return _0x82c009['status'](_0x4f1b19)['json'](_0x310dec);}};}function respondWithFilteredResult(_0x33e088,_0xe5c968){return function(_0x33a130){if(_0x33a130){var _0x22200e=typeof _0xe5c968[_0x6f44('0x17')]===_0x6f44('0x18')&&typeof _0xe5c968[_0x6f44('0x19')]===_0x6f44('0x18');var _0x16021b=_0x33a130[_0x6f44('0x1a')];var _0x27062e=_0x22200e?0x0:_0xe5c968['offset'];var _0x11b488=_0x22200e?_0x33a130[_0x6f44('0x1a')]:_0xe5c968[_0x6f44('0x17')]+_0xe5c968[_0x6f44('0x19')];var _0x46c693;if(_0x11b488>=_0x16021b){_0x11b488=_0x16021b;_0x46c693=0xc8;}else{_0x46c693=0xce;}_0x33e088['status'](_0x46c693);return _0x33e088[_0x6f44('0x1b')]('Content-Range',_0x27062e+'-'+_0x11b488+'/'+_0x16021b)[_0x6f44('0x1c')](_0x33a130);}return null;};}function patchUpdates(_0x57d6a2){return function(_0x3c1265){try{jsonpatch['apply'](_0x3c1265,_0x57d6a2,!![]);}catch(_0x415cce){return BPromise[_0x6f44('0x1d')](_0x415cce);}return _0x3c1265[_0x6f44('0x1e')]();};}function saveUpdates(_0xf1a57c,_0x1137db){return function(_0x1418e1){if(_0x1418e1){return _0x1418e1[_0x6f44('0x1f')](_0xf1a57c)[_0x6f44('0x20')](function(_0x3e121e){return _0x3e121e;});}return null;};}function removeEntity(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(_0x3583c7){return _0x3583c7[_0x6f44('0x21')]()[_0x6f44('0x20')](function(){var _0x3cdc68=_0x3583c7[_0x6f44('0x22')]({'plain':!![]});var _0x2681a9='Dispositions';return db[_0x6f44('0x23')][_0x6f44('0x21')]({'where':{'type':_0x2681a9,'resourceId':_0x3cdc68['id']}})['then'](function(){return _0x3583c7;});})['then'](function(){_0x50bbad[_0x6f44('0x16')](0xcc)[_0x6f44('0x24')]();});}};}function handleEntityNotFound(_0x2a8d41,_0x3773dd){return function(_0xe22f1e){if(!_0xe22f1e){_0x2a8d41[_0x6f44('0x15')](0x194);}return _0xe22f1e;};}function handleError(_0x4c994b,_0x2de691){_0x2de691=_0x2de691||0x1f4;return function(_0x47feea){logger[_0x6f44('0x25')](_0x47feea[_0x6f44('0x26')]);if(_0x47feea[_0x6f44('0x27')]){delete _0x47feea['name'];}_0x4c994b[_0x6f44('0x16')](_0x2de691)[_0x6f44('0x28')](_0x47feea);};}exports[_0x6f44('0x29')]=function(_0x5d9b58,_0x5e7651){var _0x1d8a0e={},_0x2fb85f={},_0x21ef32={'count':0x0,'rows':[]};var _0x5b1562=_[_0x6f44('0x2a')](db[_0x6f44('0x2b')][_0x6f44('0x2c')],function(_0x417ec8){return{'name':_0x417ec8[_0x6f44('0x2d')],'type':_0x417ec8[_0x6f44('0x2e')][_0x6f44('0x2f')]};});_0x2fb85f[_0x6f44('0x30')]=_[_0x6f44('0x2a')](_0x5b1562,_0x6f44('0x27'));_0x2fb85f[_0x6f44('0x31')]=_[_0x6f44('0x32')](_0x5d9b58['query']);_0x2fb85f['filters']=_[_0x6f44('0x33')](_0x2fb85f[_0x6f44('0x30')],_0x2fb85f[_0x6f44('0x31')]);_0x1d8a0e['attributes']=_[_0x6f44('0x33')](_0x2fb85f[_0x6f44('0x30')],qs[_0x6f44('0x34')](_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x34')]));_0x1d8a0e[_0x6f44('0x35')]=_0x1d8a0e[_0x6f44('0x35')][_0x6f44('0x36')]?_0x1d8a0e[_0x6f44('0x35')]:_0x2fb85f['model'];if(!_0x5d9b58[_0x6f44('0x31')]['hasOwnProperty']('nolimit')){_0x1d8a0e['limit']=qs[_0x6f44('0x19')](_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x19')]);_0x1d8a0e[_0x6f44('0x17')]=qs[_0x6f44('0x17')](_0x5d9b58['query'][_0x6f44('0x17')]);}_0x1d8a0e[_0x6f44('0x37')]=qs[_0x6f44('0x38')](_0x5d9b58['query'][_0x6f44('0x38')]);_0x1d8a0e[_0x6f44('0x39')]=qs[_0x6f44('0x3a')](_[_0x6f44('0x3b')](_0x5d9b58[_0x6f44('0x31')],_0x2fb85f['filters']),_0x5b1562);if(_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x3c')]){_0x1d8a0e[_0x6f44('0x39')]=_['merge'](_0x1d8a0e['where'],{'$or':_['map'](_0x5b1562,function(_0x3d3b96){if(_0x3d3b96['type']!==_0x6f44('0x3d')){var _0x580f15={};_0x580f15[_0x3d3b96[_0x6f44('0x27')]]={'$like':'%'+_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x3c')]+'%'};return _0x580f15;}})});}_0x1d8a0e=_[_0x6f44('0x3e')]({},_0x1d8a0e,_0x5d9b58[_0x6f44('0x3f')]);var _0x1227c3={'where':_0x1d8a0e['where']};return db[_0x6f44('0x2b')][_0x6f44('0x1a')](_0x1227c3)[_0x6f44('0x20')](function(_0x297999){_0x21ef32[_0x6f44('0x1a')]=_0x297999;if(_0x5d9b58['query'][_0x6f44('0x40')]){_0x1d8a0e[_0x6f44('0x41')]=[{'all':!![]}];}return db[_0x6f44('0x2b')][_0x6f44('0x42')](_0x1d8a0e);})[_0x6f44('0x20')](function(_0x3d1162){_0x21ef32[_0x6f44('0x43')]=_0x3d1162;return _0x21ef32;})[_0x6f44('0x20')](respondWithFilteredResult(_0x5e7651,_0x1d8a0e))[_0x6f44('0x44')](handleError(_0x5e7651,null));};exports['show']=function(_0x241beb,_0x50f3ae){var _0x1b763a={'raw':!![],'where':{'id':_0x241beb[_0x6f44('0x45')]['id']}},_0x37ec2d={};_0x37ec2d[_0x6f44('0x30')]=_['keys'](db[_0x6f44('0x2b')][_0x6f44('0x2c')]);_0x37ec2d['query']=_[_0x6f44('0x32')](_0x241beb[_0x6f44('0x31')]);_0x37ec2d[_0x6f44('0x3a')]=_[_0x6f44('0x33')](_0x37ec2d[_0x6f44('0x30')],_0x37ec2d[_0x6f44('0x31')]);_0x1b763a[_0x6f44('0x35')]=_[_0x6f44('0x33')](_0x37ec2d['model'],qs[_0x6f44('0x34')](_0x241beb[_0x6f44('0x31')]['fields']));_0x1b763a[_0x6f44('0x35')]=_0x1b763a['attributes']['length']?_0x1b763a['attributes']:_0x37ec2d[_0x6f44('0x30')];if(_0x241beb['query']['includeAll']){_0x1b763a[_0x6f44('0x41')]=[{'all':!![]}];}_0x1b763a=_[_0x6f44('0x3e')]({},_0x1b763a,_0x241beb[_0x6f44('0x3f')]);return db[_0x6f44('0x2b')][_0x6f44('0x46')](_0x1b763a)['then'](handleEntityNotFound(_0x50f3ae,null))[_0x6f44('0x20')](respondWithResult(_0x50f3ae,null))[_0x6f44('0x44')](handleError(_0x50f3ae,null));};exports[_0x6f44('0x47')]=function(_0x35668c,_0x1fe022){return db['Disposition'][_0x6f44('0x47')](_0x35668c[_0x6f44('0x48')],{})[_0x6f44('0x20')](function(_0x2087f7){var _0x45c6df=_0x35668c['user']['get']({'plain':!![]});if(!_0x45c6df)throw new Error(_0x6f44('0x49'));if(_0x45c6df['role']===_0x6f44('0x4a')){var _0x55bda4=_0x2087f7['get']({'plain':!![]});var _0x39cc92=_0x6f44('0x4b');return db[_0x6f44('0x4c')][_0x6f44('0x46')]({'where':{'name':_0x39cc92,'userProfileId':_0x45c6df[_0x6f44('0x4d')]},'raw':!![]})['then'](function(_0x2f188f){if(_0x2f188f&&_0x2f188f[_0x6f44('0x4e')]===0x0){return db[_0x6f44('0x23')][_0x6f44('0x47')]({'name':_0x55bda4['name'],'resourceId':_0x55bda4['id'],'type':_0x2f188f[_0x6f44('0x27')],'sectionId':_0x2f188f['id']},{})[_0x6f44('0x20')](function(){return _0x2087f7;});}else{return _0x2087f7;}})[_0x6f44('0x44')](function(_0x170fb3){logger[_0x6f44('0x25')](_0x6f44('0x4f'),_0x170fb3);throw _0x170fb3;});}return _0x2087f7;})[_0x6f44('0x20')](respondWithResult(_0x1fe022,0xc9))[_0x6f44('0x44')](handleError(_0x1fe022,null));};exports['update']=function(_0x14c5bc,_0x5a5d79){if(_0x14c5bc[_0x6f44('0x48')]['id']){delete _0x14c5bc[_0x6f44('0x48')]['id'];}return db['Disposition'][_0x6f44('0x46')]({'where':{'id':_0x14c5bc[_0x6f44('0x45')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x5a5d79,null))[_0x6f44('0x20')](saveUpdates(_0x14c5bc['body'],null))['then'](respondWithResult(_0x5a5d79,null))[_0x6f44('0x44')](handleError(_0x5a5d79,null));};exports[_0x6f44('0x21')]=function(_0x86ef2d,_0x34925f){return db[_0x6f44('0x2b')][_0x6f44('0x46')]({'where':{'id':_0x86ef2d[_0x6f44('0x45')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x34925f,null))[_0x6f44('0x20')](removeEntity(_0x34925f,null))['catch'](handleError(_0x34925f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 30b6d70..fefc859 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 _0x15e3=['MailAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail'];(function(_0x1e0f42,_0x2567e5){var _0x4e9c54=function(_0x519f2d){while(--_0x519f2d){_0x1e0f42['push'](_0x1e0f42['shift']());}};_0x4e9c54(++_0x2567e5);}(_0x15e3,0x11a));var _0x315e=function(_0x4857de,_0x21bcbc){_0x4857de=_0x4857de-0x0;var _0x7823b0=_0x15e3[_0x4857de];return _0x7823b0;};'use strict';var _=require(_0x315e('0x0'));var util=require('util');var logger=require(_0x315e('0x1'))('api');var moment=require(_0x315e('0x2'));var BPromise=require('bluebird');var rp=require(_0x315e('0x3'));var fs=require('fs');var path=require(_0x315e('0x4'));var rimraf=require(_0x315e('0x5'));var config=require(_0x315e('0x6'));var attributes=require(_0x315e('0x7'));module['exports']=function(_0x54a76f,_0x7520ba){return _0x54a76f[_0x315e('0x8')](_0x315e('0x9'),attributes,{'tableName':_0x315e('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x315e('0xb'),'fields':[_0x315e('0xc'),_0x315e('0xd')]},{'unique':!![],'name':_0x315e('0xe'),'fields':[_0x315e('0xc'),_0x315e('0xf')]},{'unique':!![],'name':_0x315e('0x10'),'fields':[_0x315e('0xc'),_0x315e('0x11')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0x315e('0x12')]},{'unique':!![],'name':_0x315e('0x13'),'fields':['name',_0x315e('0x14')]},{'unique':!![],'name':_0x315e('0x15'),'fields':[_0x315e('0xc'),_0x315e('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d78=['name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','tools_dispositions','name_voice'];(function(_0x511a9d,_0x1fa193){var _0x3d2b65=function(_0x8859d1){while(--_0x8859d1){_0x511a9d['push'](_0x511a9d['shift']());}};_0x3d2b65(++_0x1fa193);}(_0x6d78,0x105));var _0x86d7=function(_0x417a23,_0x2a228d){_0x417a23=_0x417a23-0x0;var _0x3aeb3f=_0x6d78[_0x417a23];return _0x3aeb3f;};'use strict';var _=require(_0x86d7('0x0'));var util=require('util');var logger=require(_0x86d7('0x1'))(_0x86d7('0x2'));var moment=require(_0x86d7('0x3'));var BPromise=require(_0x86d7('0x4'));var rp=require(_0x86d7('0x5'));var fs=require('fs');var path=require(_0x86d7('0x6'));var rimraf=require('rimraf');var config=require(_0x86d7('0x7'));var attributes=require('./disposition.attributes');module[_0x86d7('0x8')]=function(_0xf178c7,_0x4634db){return _0xf178c7[_0x86d7('0x9')]('Disposition',attributes,{'tableName':_0x86d7('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x86d7('0xb'),'fields':[_0x86d7('0xc'),_0x86d7('0xd')]},{'unique':!![],'name':_0x86d7('0xe'),'fields':[_0x86d7('0xc'),_0x86d7('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x86d7('0xc'),'MailAccountId']},{'unique':!![],'name':_0x86d7('0x10'),'fields':[_0x86d7('0xc'),_0x86d7('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x86d7('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x86d7('0x12'),'fields':[_0x86d7('0xc'),_0x86d7('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x86d7('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index f5408f0..662577b 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(_0x61160c,_0x1f2044){var _0x2e1faa=function(_0x5b5550){while(--_0x5b5550){_0x61160c['push'](_0x61160c['shift']());}};_0x2e1faa(++_0x1f2044);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x4f9c5a,_0x3fc99e){var _0x23def1=function(_0x50f172){while(--_0x50f172){_0x4f9c5a['push'](_0x4f9c5a['shift']());}};_0x23def1(++_0x3fc99e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 bc7bd0b..b522734 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 _0x46f1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x1018fb,_0x2342ee){var _0x45ff28=function(_0x1a1fe0){while(--_0x1a1fe0){_0x1018fb['push'](_0x1018fb['shift']());}};_0x45ff28(++_0x2342ee);}(_0x46f1,0x1da));var _0x146f=function(_0x1899d7,_0x37391e){_0x1899d7=_0x1899d7-0x0;var _0x53d454=_0x46f1[_0x1899d7];return _0x53d454;};'use strict';var multer=require(_0x146f('0x0'));var util=require(_0x146f('0x1'));var path=require('path');var timeout=require(_0x146f('0x2'));var express=require(_0x146f('0x3'));var router=express[_0x146f('0x4')]();var fs_extra=require(_0x146f('0x5'));var auth=require(_0x146f('0x6'));var interaction=require(_0x146f('0x7'));var config=require('../../config/environment');var controller=require(_0x146f('0x8'));router['get']('/',auth[_0x146f('0x9')](),controller['index']);router['get'](_0x146f('0xa'),auth[_0x146f('0x9')](),controller[_0x146f('0xb')]);router[_0x146f('0xc')]('/',auth[_0x146f('0x9')](),controller[_0x146f('0xd')]);router['put'](_0x146f('0xa'),auth[_0x146f('0x9')](),controller[_0x146f('0xe')]);router['delete'](_0x146f('0xa'),auth['isAuthenticated'](),controller[_0x146f('0xf')]);module[_0x146f('0x10')]=router; \ No newline at end of file +var _0x592d=['index','show','create','/:id','update','delete','express','Router','fs-extra','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x2f0e20,_0x4e75f2){var _0x2ebd44=function(_0x1e7296){while(--_0x1e7296){_0x2f0e20['push'](_0x2f0e20['shift']());}};_0x2ebd44(++_0x4e75f2);}(_0x592d,0x1cd));var _0xd592=function(_0x4db470,_0x1662db){_0x4db470=_0x4db470-0x0;var _0x2415f1=_0x592d[_0x4db470];return _0x2415f1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd592('0x0'));var router=express[_0xd592('0x1')]();var fs_extra=require(_0xd592('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd592('0x3'));var controller=require(_0xd592('0x4'));router[_0xd592('0x5')]('/',auth[_0xd592('0x6')](),controller[_0xd592('0x7')]);router[_0xd592('0x5')]('/:id',auth[_0xd592('0x6')](),controller[_0xd592('0x8')]);router['post']('/',auth[_0xd592('0x6')](),controller[_0xd592('0x9')]);router['put'](_0xd592('0xa'),auth[_0xd592('0x6')](),controller[_0xd592('0xb')]);router[_0xd592('0xc')]('/:id',auth[_0xd592('0x6')](),controller['destroy']);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 69bb10c..1b20ac2 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 _0x8b2c=['SIP','IAX','DADHI','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','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','12000','14400','INTEGER'];(function(_0x8d68ce,_0x135a7f){var _0x2e1f64=function(_0x1e8aed){while(--_0x1e8aed){_0x8d68ce['push'](_0x8d68ce['shift']());}};_0x2e1f64(++_0x135a7f);}(_0x8b2c,0x1d4));var _0xc8b2=function(_0x5724d1,_0x35807e){_0x5724d1=_0x5724d1-0x0;var _0x535ba2=_0x8b2c[_0x5724d1];return _0x535ba2;};'use strict';var Sequelize=require(_0xc8b2('0x0'));module[_0xc8b2('0x1')]={'name':{'type':Sequelize[_0xc8b2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc8b2('0x2')]},'ecm':{'type':Sequelize[_0xc8b2('0x3')](_0xc8b2('0x4'),'no'),'defaultValue':_0xc8b2('0x4')},'headerinfo':{'type':Sequelize[_0xc8b2('0x2')],'defaultValue':_0xc8b2('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xc8b2('0x3')](_0xc8b2('0x6'),_0xc8b2('0x7'),_0xc8b2('0x8'),'9600',_0xc8b2('0x9'),_0xc8b2('0xa')),'defaultValue':_0xc8b2('0x7')},'maxrate':{'type':Sequelize['ENUM']('2400','4800','7200','9600',_0xc8b2('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xc8b2('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc8b2('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc8b2('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc8b2('0x3')](_0xc8b2('0xc'),_0xc8b2('0xd'),_0xc8b2('0xe'),'KHOMP'),'defaultValue':_0xc8b2('0xc')},'key':{'type':Sequelize[_0xc8b2('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc8b2('0xf');}},'notificationSound':{'type':Sequelize[_0xc8b2('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc8b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc8b2('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc8b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc8b2('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc8b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc8b2('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xc8b2('0x10')],'defaultValue':![],'comment':_0xc8b2('0x12'),'set':function(_0x3e255b){if(!_0x3e255b)this[_0xc8b2('0x13')]('mandatoryDispositionPauseId',null);this[_0xc8b2('0x13')]('mandatoryDisposition',_0x3e255b);}}}; \ No newline at end of file +var _0xe163=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','KHOMP','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING'];(function(_0x162c87,_0x3b82e7){var _0x4ae338=function(_0x3879f8){while(--_0x3879f8){_0x162c87['push'](_0x162c87['shift']());}};_0x4ae338(++_0x3b82e7);}(_0xe163,0x1b2));var _0x3e16=function(_0x3b31f1,_0x42b2ac){_0x3b31f1=_0x3b31f1-0x0;var _0x4d7832=_0xe163[_0x3b31f1];return _0x4d7832;};'use strict';var Sequelize=require(_0x3e16('0x0'));module[_0x3e16('0x1')]={'name':{'type':Sequelize[_0x3e16('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3e16('0x2')]},'ecm':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0x4'),'no'),'defaultValue':_0x3e16('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x3e16('0x5')},'localstationid':{'type':Sequelize[_0x3e16('0x2')],'unique':_0x3e16('0x6')},'minrate':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0x7'),_0x3e16('0x8'),_0x3e16('0x9'),_0x3e16('0xa'),_0x3e16('0xb'),_0x3e16('0xc')),'defaultValue':_0x3e16('0x8')},'maxrate':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0x7'),_0x3e16('0x8'),_0x3e16('0x9'),_0x3e16('0xa'),_0x3e16('0xb'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x3e16('0x2')],'defaultValue':_0x3e16('0xd')},'gateway':{'type':Sequelize[_0x3e16('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3e16('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0xe'),_0x3e16('0xf'),'DADHI',_0x3e16('0x10')),'defaultValue':_0x3e16('0xe')},'key':{'type':Sequelize[_0x3e16('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3e16('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e16('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3e16('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e16('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':![],'comment':_0x3e16('0x14'),'set':function(_0x55d0c5){if(!_0x55d0c5)this['setDataValue'](_0x3e16('0x15'),null);this[_0x3e16('0x16')]('mandatoryDisposition',_0x55d0c5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 08c54b4..7976eb8 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 _0x3d22=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','params','mandatoryDispositionPause','keys','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','FaxAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','ids','omit','getInteractions','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','appdata','push','Answer','ecm','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x26284f,_0x22577a){var _0xf0d62c=function(_0x57e801){while(--_0x57e801){_0x26284f['push'](_0x26284f['shift']());}};_0xf0d62c(++_0x22577a);}(_0x3d22,0xad));var _0x23d2=function(_0x3a25e6,_0x5ad935){_0x3a25e6=_0x3a25e6-0x0;var _0x5a173a=_0x3d22[_0x3a25e6];return _0x5a173a;};'use strict';var emlformat=require(_0x23d2('0x0'));var rimraf=require(_0x23d2('0x1'));var zipdir=require(_0x23d2('0x2'));var jsonpatch=require(_0x23d2('0x3'));var rp=require('request-promise');var moment=require(_0x23d2('0x4'));var BPromise=require(_0x23d2('0x5'));var Mustache=require(_0x23d2('0x6'));var util=require(_0x23d2('0x7'));var path=require(_0x23d2('0x8'));var sox=require(_0x23d2('0x9'));var csv=require('to-csv');var ejs=require(_0x23d2('0xa'));var fs=require('fs');var fs_extra=require(_0x23d2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x23d2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x23d2('0xd'));var toCsv=require(_0x23d2('0xe'));var querystring=require(_0x23d2('0xf'));var Papa=require(_0x23d2('0x10'));var Redis=require(_0x23d2('0x11'));var authService=require(_0x23d2('0x12'));var qs=require(_0x23d2('0x13'));var as=require(_0x23d2('0x14'));var hardwareService=require(_0x23d2('0x15'));var logger=require(_0x23d2('0x16'))(_0x23d2('0x17'));var utils=require(_0x23d2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x23d2('0x19'))['db'];config[_0x23d2('0x1a')]=_[_0x23d2('0x1b')](config[_0x23d2('0x1a')],{'host':_0x23d2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0x23d2('0x1d')](socket);var jayson=require(_0x23d2('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x23d2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5a4aa1,_0x3e9deb,_0x4a2354,_0x15e34f){return new BPromise(function(_0x535469,_0x14e9e6){var _0x534920=_0x15e34f||client;return _0x534920[_0x23d2('0x20')](_0x5a4aa1,_0x4a2354)[_0x23d2('0x21')](function(_0x290b27){logger[_0x23d2('0x22')]('FaxAccount,\x20%s,\x20%s',_0x3e9deb,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3e9deb,_0x23d2('0x23'),JSON[_0x23d2('0x24')](_0x290b27));if(_0x290b27[_0x23d2('0x25')]){if(_0x290b27[_0x23d2('0x25')][_0x23d2('0x26')]===0x1f4){logger[_0x23d2('0x25')](_0x23d2('0x27'),_0x3e9deb,_0x290b27['error'][_0x23d2('0x28')]);return _0x14e9e6(_0x290b27[_0x23d2('0x25')][_0x23d2('0x28')]);}logger['error'](_0x23d2('0x27'),_0x3e9deb,_0x290b27[_0x23d2('0x25')]['message']);return _0x535469(_0x290b27[_0x23d2('0x25')][_0x23d2('0x28')]);}else{logger[_0x23d2('0x22')]('FaxAccount,\x20%s,\x20%s',_0x3e9deb,_0x23d2('0x23'));_0x535469(_0x290b27[_0x23d2('0x29')][_0x23d2('0x28')]);}})[_0x23d2('0x2a')](function(_0x9a1f67){logger[_0x23d2('0x25')](_0x23d2('0x27'),_0x3e9deb,_0x9a1f67);_0x14e9e6(_0x9a1f67);});});}function respondWithStatusCode(_0x5b5e68,_0x4ef482){_0x4ef482=_0x4ef482||0xcc;return function(_0x31761d){if(_0x31761d){return _0x5b5e68[_0x23d2('0x2b')](_0x4ef482);}return _0x5b5e68[_0x23d2('0x2c')](_0x4ef482)['end']();};}function respondWithResult(_0x2005cb,_0x1be880){_0x1be880=_0x1be880||0xc8;return function(_0x505c26){if(_0x505c26){return _0x2005cb['status'](_0x1be880)[_0x23d2('0x2d')](_0x505c26);}};}function respondWithFilteredResult(_0x120880,_0x2ea14c){return function(_0x168df0){if(_0x168df0){var _0x3dd156=typeof _0x2ea14c[_0x23d2('0x2e')]===_0x23d2('0x2f')&&typeof _0x2ea14c[_0x23d2('0x30')]==='undefined';var _0x1cac4f=_0x168df0['count'];var _0x4e4a37=_0x3dd156?0x0:_0x2ea14c[_0x23d2('0x2e')];var _0x4d8b9a=_0x3dd156?_0x168df0['count']:_0x2ea14c['offset']+_0x2ea14c[_0x23d2('0x30')];var _0x307726;if(_0x4d8b9a>=_0x1cac4f){_0x4d8b9a=_0x1cac4f;_0x307726=0xc8;}else{_0x307726=0xce;}_0x120880[_0x23d2('0x2c')](_0x307726);return _0x120880['set'](_0x23d2('0x31'),_0x4e4a37+'-'+_0x4d8b9a+'/'+_0x1cac4f)['json'](_0x168df0);}return null;};}function patchUpdates(_0x17c854){return function(_0x2d8269){try{jsonpatch[_0x23d2('0x32')](_0x2d8269,_0x17c854,!![]);}catch(_0xf0456b){return BPromise['reject'](_0xf0456b);}return _0x2d8269[_0x23d2('0x33')]();};}function saveUpdates(_0x40aa00,_0x179817){return function(_0x222b73){if(_0x222b73){return _0x222b73[_0x23d2('0x34')](_0x40aa00)[_0x23d2('0x21')](function(_0x3a7e11){return _0x3a7e11;});}return null;};}function removeEntity(_0x10aeb5,_0x5d4d23){return function(_0x1cb43b){if(_0x1cb43b){return _0x1cb43b[_0x23d2('0x35')]()[_0x23d2('0x21')](function(){var _0x280ccd=_0x1cb43b[_0x23d2('0x36')]({'plain':!![]});var _0xdfcc53='FaxAccounts';return db[_0x23d2('0x37')]['destroy']({'where':{'type':_0xdfcc53,'resourceId':_0x280ccd['id']}})[_0x23d2('0x21')](function(){return _0x1cb43b;});})['then'](function(){_0x10aeb5[_0x23d2('0x2c')](0xcc)[_0x23d2('0x38')]();});}};}function handleEntityNotFound(_0x14bfce,_0x26e88b){return function(_0x11f87a){if(!_0x11f87a){_0x14bfce['sendStatus'](0x194);}return _0x11f87a;};}function handleError(_0x480963,_0x572887){_0x572887=_0x572887||0x1f4;return function(_0x45001c){logger[_0x23d2('0x25')](_0x45001c[_0x23d2('0x39')]);if(_0x45001c['name']){delete _0x45001c[_0x23d2('0x3a')];}_0x480963[_0x23d2('0x2c')](_0x572887)[_0x23d2('0x3b')](_0x45001c);};}exports['index']=function(_0x3c160b,_0x3be0b9){var _0x58bc62={'include':[{'model':db[_0x23d2('0x3c')],'as':'mandatoryDispositionPause'}]},_0x247fd1={},_0xcc4214={'count':0x0,'rows':[]};var _0x18c1ef=_[_0x23d2('0x3d')](db[_0x23d2('0x3e')][_0x23d2('0x3f')],function(_0x3f8105){return{'name':_0x3f8105[_0x23d2('0x40')],'type':_0x3f8105['type']['key']};});_0x247fd1[_0x23d2('0x41')]=_[_0x23d2('0x3d')](_0x18c1ef,_0x23d2('0x3a'));_0x247fd1[_0x23d2('0x42')]=_['keys'](_0x3c160b[_0x23d2('0x42')]);_0x247fd1[_0x23d2('0x43')]=_['intersection'](_0x247fd1[_0x23d2('0x41')],_0x247fd1[_0x23d2('0x42')]);_0x58bc62[_0x23d2('0x44')]=_['intersection'](_0x247fd1[_0x23d2('0x41')],qs[_0x23d2('0x45')](_0x3c160b[_0x23d2('0x42')][_0x23d2('0x45')]));_0x58bc62[_0x23d2('0x44')]=_0x58bc62[_0x23d2('0x44')][_0x23d2('0x46')]?_0x58bc62[_0x23d2('0x44')]:_0x247fd1[_0x23d2('0x41')];if(!_0x3c160b[_0x23d2('0x42')]['hasOwnProperty'](_0x23d2('0x47'))){_0x58bc62[_0x23d2('0x30')]=qs[_0x23d2('0x30')](_0x3c160b[_0x23d2('0x42')][_0x23d2('0x30')]);_0x58bc62[_0x23d2('0x2e')]=qs['offset'](_0x3c160b[_0x23d2('0x42')][_0x23d2('0x2e')]);}_0x58bc62[_0x23d2('0x48')]=qs[_0x23d2('0x49')](_0x3c160b[_0x23d2('0x42')][_0x23d2('0x49')]);_0x58bc62[_0x23d2('0x4a')]=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x3c160b['query'],_0x247fd1[_0x23d2('0x43')]),_0x18c1ef);if(_0x3c160b[_0x23d2('0x42')][_0x23d2('0x4c')]){_0x58bc62['where']=_[_0x23d2('0x4d')](_0x58bc62['where'],{'$or':_[_0x23d2('0x3d')](_0x18c1ef,function(_0x3e94e2){if(_0x3e94e2[_0x23d2('0x4e')]!==_0x23d2('0x4f')){var _0x299a7d={};_0x299a7d[_0x3e94e2[_0x23d2('0x3a')]]={'$like':'%'+_0x3c160b['query'][_0x23d2('0x4c')]+'%'};return _0x299a7d;}})});}_0x58bc62=_[_0x23d2('0x4d')]({},_0x58bc62,_0x3c160b[_0x23d2('0x50')]);var _0x52cceb={'where':_0x58bc62[_0x23d2('0x4a')]};return db[_0x23d2('0x3e')][_0x23d2('0x51')](_0x52cceb)['then'](function(_0x136689){_0xcc4214[_0x23d2('0x51')]=_0x136689;if(_0x3c160b[_0x23d2('0x42')][_0x23d2('0x52')]){_0x58bc62[_0x23d2('0x53')]=[{'all':!![]}];}return db[_0x23d2('0x3e')][_0x23d2('0x54')](_0x58bc62);})[_0x23d2('0x21')](function(_0x799239){_0xcc4214[_0x23d2('0x55')]=_0x799239;return _0xcc4214;})[_0x23d2('0x21')](respondWithFilteredResult(_0x3be0b9,_0x58bc62))['catch'](handleError(_0x3be0b9,null));};exports['show']=function(_0x390686,_0xac816e){var _0x5d9701={'raw':![],'where':{'id':_0x390686[_0x23d2('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x23d2('0x57')}]},_0x19c349={};_0x19c349[_0x23d2('0x41')]=_[_0x23d2('0x58')](db[_0x23d2('0x3e')][_0x23d2('0x3f')]);_0x19c349[_0x23d2('0x42')]=_[_0x23d2('0x58')](_0x390686[_0x23d2('0x42')]);_0x19c349[_0x23d2('0x43')]=_[_0x23d2('0x59')](_0x19c349[_0x23d2('0x41')],_0x19c349[_0x23d2('0x42')]);_0x5d9701[_0x23d2('0x44')]=_[_0x23d2('0x59')](_0x19c349[_0x23d2('0x41')],qs[_0x23d2('0x45')](_0x390686[_0x23d2('0x42')]['fields']));_0x5d9701[_0x23d2('0x44')]=_0x5d9701[_0x23d2('0x44')][_0x23d2('0x46')]?_0x5d9701[_0x23d2('0x44')]:_0x19c349['model'];if(_0x390686[_0x23d2('0x42')][_0x23d2('0x52')]){_0x5d9701[_0x23d2('0x53')]=[{'all':!![]}];}_0x5d9701=_[_0x23d2('0x4d')]({},_0x5d9701,_0x390686[_0x23d2('0x50')]);return db['FaxAccount']['find'](_0x5d9701)['then'](handleEntityNotFound(_0xac816e,null))[_0x23d2('0x21')](respondWithResult(_0xac816e,null))[_0x23d2('0x2a')](handleError(_0xac816e,null));};exports[_0x23d2('0x5a')]=function(_0x28b8c7,_0x177c9f){return db['FaxAccount'][_0x23d2('0x5a')](_0x28b8c7[_0x23d2('0x5b')],{})['then'](function(_0x358295){var _0x577b35=_0x28b8c7[_0x23d2('0x5c')]['get']({'plain':!![]});if(!_0x577b35)throw new Error(_0x23d2('0x5d'));if(_0x577b35[_0x23d2('0x5e')]===_0x23d2('0x5c')){var _0x1ecca4=_0x358295[_0x23d2('0x36')]({'plain':!![]});var _0x39d4f6=_0x23d2('0x5f');return db[_0x23d2('0x60')][_0x23d2('0x61')]({'where':{'name':_0x39d4f6,'userProfileId':_0x577b35['userProfileId']},'raw':!![]})[_0x23d2('0x21')](function(_0x1eae01){if(_0x1eae01&&_0x1eae01['autoAssociation']===0x0){return db[_0x23d2('0x37')]['create']({'name':_0x1ecca4['name'],'resourceId':_0x1ecca4['id'],'type':_0x1eae01['name'],'sectionId':_0x1eae01['id']},{})[_0x23d2('0x21')](function(){return _0x358295;});}else{return _0x358295;}})[_0x23d2('0x2a')](function(_0x199804){logger[_0x23d2('0x25')](_0x23d2('0x62'),_0x199804);throw _0x199804;});}return _0x358295;})['then'](respondWithResult(_0x177c9f,0xc9))[_0x23d2('0x2a')](handleError(_0x177c9f,null));};exports['update']=function(_0x5b8100,_0x20542c){if(_0x5b8100['body']['id']){delete _0x5b8100[_0x23d2('0x5b')]['id'];}return db[_0x23d2('0x3e')][_0x23d2('0x61')]({'where':{'id':_0x5b8100[_0x23d2('0x56')]['id']},'include':[{'model':db[_0x23d2('0x3c')],'as':_0x23d2('0x57')}]})[_0x23d2('0x21')](handleEntityNotFound(_0x20542c,null))[_0x23d2('0x21')](saveUpdates(_0x5b8100[_0x23d2('0x5b')],null))[_0x23d2('0x21')](respondWithResult(_0x20542c,null))[_0x23d2('0x2a')](handleError(_0x20542c,null));};exports[_0x23d2('0x35')]=function(_0x21401e,_0x82e818){return db[_0x23d2('0x3e')][_0x23d2('0x61')]({'where':{'id':_0x21401e[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x82e818,null))[_0x23d2('0x21')](removeEntity(_0x82e818,null))['catch'](handleError(_0x82e818,null));};exports[_0x23d2('0x63')]=function(_0xa58312,_0x252654){return db[_0x23d2('0x3e')][_0x23d2('0x63')]()[_0x23d2('0x21')](respondWithResult(_0x252654,null))[_0x23d2('0x2a')](handleError(_0x252654,null));};exports[_0x23d2('0x64')]=function(_0x383768,_0xf857fc,_0xd06b71){if(_0x383768['body']['id']){delete _0x383768[_0x23d2('0x5b')]['id'];}return db[_0x23d2('0x3e')][_0x23d2('0x61')]({'where':{'id':_0x383768['params']['id']}})['then'](handleEntityNotFound(_0xf857fc,null))[_0x23d2('0x21')](function(_0x47adb1){if(_0x47adb1){_0x383768[_0x23d2('0x5b')]['FaxAccountId']=_0x47adb1['id'];return db[_0x23d2('0x65')][_0x23d2('0x5a')](_0x383768[_0x23d2('0x5b')]);}})[_0x23d2('0x21')](respondWithResult(_0xf857fc,null))[_0x23d2('0x2a')](handleError(_0xf857fc,null));};exports['getDispositions']=function(_0x30a4ac,_0xf0a0b5,_0x4b1029){var _0x3aba86={'raw':![],'where':{}};var _0x29547b={};var _0x4b1b8c={'count':0x0,'rows':[]};return db[_0x23d2('0x3e')][_0x23d2('0x66')]({'where':{'id':_0x30a4ac[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0xf0a0b5,null))['then'](function(_0x8f02f8){if(_0x8f02f8){_0x29547b[_0x23d2('0x41')]=_['keys'](db['Disposition'][_0x23d2('0x3f')]);_0x29547b['query']=_['keys'](_0x30a4ac[_0x23d2('0x42')]);_0x29547b['filters']=_[_0x23d2('0x59')](_0x29547b['model'],_0x29547b[_0x23d2('0x42')]);_0x3aba86[_0x23d2('0x44')]=_['intersection'](_0x29547b[_0x23d2('0x41')],qs[_0x23d2('0x45')](_0x30a4ac[_0x23d2('0x42')][_0x23d2('0x45')]));_0x3aba86[_0x23d2('0x44')]=_0x3aba86['attributes'][_0x23d2('0x46')]?_0x3aba86[_0x23d2('0x44')]:_0x29547b[_0x23d2('0x41')];if(!_0x30a4ac[_0x23d2('0x42')][_0x23d2('0x67')](_0x23d2('0x47'))){_0x3aba86[_0x23d2('0x30')]=qs[_0x23d2('0x30')](_0x30a4ac['query'][_0x23d2('0x30')]);_0x3aba86['offset']=qs['offset'](_0x30a4ac[_0x23d2('0x42')][_0x23d2('0x2e')]);}_0x3aba86[_0x23d2('0x48')]=qs[_0x23d2('0x49')](_0x30a4ac[_0x23d2('0x42')][_0x23d2('0x49')]);_0x3aba86[_0x23d2('0x4a')]=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x30a4ac['query'],_0x29547b[_0x23d2('0x43')]));_0x3aba86[_0x23d2('0x4a')][_0x23d2('0x68')]=_0x8f02f8['id'];if(_0x30a4ac['query'][_0x23d2('0x4c')]){_0x3aba86[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x3aba86['where'],{'$or':_[_0x23d2('0x3d')](_0x3aba86[_0x23d2('0x44')],function(_0x4a6d80){var _0x435db5={};_0x435db5[_0x4a6d80]={'$like':'%'+_0x30a4ac[_0x23d2('0x42')][_0x23d2('0x4c')]+'%'};return _0x435db5;})});}_0x3aba86=_[_0x23d2('0x4d')]({},_0x3aba86,_0x30a4ac[_0x23d2('0x50')]);return db[_0x23d2('0x65')][_0x23d2('0x51')]({'where':_0x3aba86[_0x23d2('0x4a')]})[_0x23d2('0x21')](function(_0x2f1b38){_0x4b1b8c[_0x23d2('0x51')]=_0x2f1b38;if(_0x30a4ac[_0x23d2('0x42')]['includeAll']){_0x3aba86[_0x23d2('0x53')]=[{'all':!![]}];}return db[_0x23d2('0x65')][_0x23d2('0x54')](_0x3aba86);})[_0x23d2('0x21')](function(_0x5edfc3){_0x4b1b8c[_0x23d2('0x55')]=_0x5edfc3;return _0x4b1b8c;});}})[_0x23d2('0x21')](respondWithFilteredResult(_0xf0a0b5,_0x3aba86))['catch'](handleError(_0xf0a0b5,null));};exports['removeDispositions']=function(_0x25d0a7,_0x1fc3d,_0x2aa033){return db[_0x23d2('0x3e')]['find']({'where':{'id':_0x25d0a7[_0x23d2('0x56')]['id']}})['then'](handleEntityNotFound(_0x1fc3d,null))['then'](function(_0x1cb8e8){if(_0x1cb8e8){return _0x1cb8e8[_0x23d2('0x69')](_0x25d0a7[_0x23d2('0x42')]['ids']);}})[_0x23d2('0x21')](respondWithStatusCode(_0x1fc3d,null))['catch'](handleError(_0x1fc3d,null));};exports[_0x23d2('0x6a')]=function(_0x470717,_0x28a97d,_0x3dae9b){if(_0x470717[_0x23d2('0x5b')]['id']){delete _0x470717[_0x23d2('0x5b')]['id'];}return db[_0x23d2('0x3e')][_0x23d2('0x61')]({'where':{'id':_0x470717['params']['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x28a97d,null))['then'](function(_0x44f16e){if(_0x44f16e){_0x470717['body']['FaxAccountId']=_0x44f16e['id'];return db[_0x23d2('0x6b')][_0x23d2('0x5a')](_0x470717[_0x23d2('0x5b')]);}})['then'](respondWithResult(_0x28a97d,null))[_0x23d2('0x2a')](handleError(_0x28a97d,null));};exports['getAnswers']=function(_0x50fe6b,_0x121ac1,_0x31dfe6){var _0x202fad={'raw':![],'where':{}};var _0x25f7cd={};var _0x563e35={'count':0x0,'rows':[]};return db[_0x23d2('0x3e')][_0x23d2('0x66')]({'where':{'id':_0x50fe6b[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x121ac1,null))[_0x23d2('0x21')](function(_0x4cd1c3){if(_0x4cd1c3){_0x25f7cd[_0x23d2('0x41')]=_['keys'](db[_0x23d2('0x6b')][_0x23d2('0x3f')]);_0x25f7cd[_0x23d2('0x42')]=_[_0x23d2('0x58')](_0x50fe6b[_0x23d2('0x42')]);_0x25f7cd[_0x23d2('0x43')]=_[_0x23d2('0x59')](_0x25f7cd['model'],_0x25f7cd['query']);_0x202fad[_0x23d2('0x44')]=_[_0x23d2('0x59')](_0x25f7cd[_0x23d2('0x41')],qs[_0x23d2('0x45')](_0x50fe6b[_0x23d2('0x42')]['fields']));_0x202fad['attributes']=_0x202fad[_0x23d2('0x44')][_0x23d2('0x46')]?_0x202fad[_0x23d2('0x44')]:_0x25f7cd['model'];if(!_0x50fe6b['query'][_0x23d2('0x67')](_0x23d2('0x47'))){_0x202fad['limit']=qs[_0x23d2('0x30')](_0x50fe6b[_0x23d2('0x42')][_0x23d2('0x30')]);_0x202fad['offset']=qs['offset'](_0x50fe6b[_0x23d2('0x42')]['offset']);}_0x202fad[_0x23d2('0x48')]=qs[_0x23d2('0x49')](_0x50fe6b['query']['sort']);_0x202fad['where']=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x50fe6b[_0x23d2('0x42')],_0x25f7cd[_0x23d2('0x43')]));_0x202fad['where'][_0x23d2('0x68')]=_0x4cd1c3['id'];if(_0x50fe6b[_0x23d2('0x42')]['filter']){_0x202fad[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x202fad[_0x23d2('0x4a')],{'$or':_[_0x23d2('0x3d')](_0x202fad[_0x23d2('0x44')],function(_0xc3bd18){var _0x16f789={};_0x16f789[_0xc3bd18]={'$like':'%'+_0x50fe6b[_0x23d2('0x42')][_0x23d2('0x4c')]+'%'};return _0x16f789;})});}_0x202fad=_[_0x23d2('0x4d')]({},_0x202fad,_0x50fe6b[_0x23d2('0x50')]);return db[_0x23d2('0x6b')][_0x23d2('0x51')]({'where':_0x202fad[_0x23d2('0x4a')]})[_0x23d2('0x21')](function(_0x30b1b5){_0x563e35['count']=_0x30b1b5;if(_0x50fe6b[_0x23d2('0x42')][_0x23d2('0x52')]){_0x202fad['include']=[{'all':!![]}];}return db[_0x23d2('0x6b')][_0x23d2('0x54')](_0x202fad);})[_0x23d2('0x21')](function(_0x38d162){_0x563e35[_0x23d2('0x55')]=_0x38d162;return _0x563e35;});}})[_0x23d2('0x21')](respondWithFilteredResult(_0x121ac1,_0x202fad))[_0x23d2('0x2a')](handleError(_0x121ac1,null));};exports[_0x23d2('0x6c')]=function(_0x584d3e,_0x2d77dc,_0xe6af90){return db[_0x23d2('0x3e')][_0x23d2('0x61')]({'where':{'id':_0x584d3e['params']['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x2d77dc,null))[_0x23d2('0x21')](function(_0xaced03){if(_0xaced03){return _0xaced03[_0x23d2('0x6c')](_0x584d3e[_0x23d2('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x2d77dc,null))[_0x23d2('0x2a')](handleError(_0x2d77dc,null));};exports['addInteraction']=function(_0x44e8f8,_0x25bfe0,_0x30503c){return db[_0x23d2('0x6d')][_0x23d2('0x61')]({'where':{'id':_0x44e8f8['params']['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x25bfe0,null))[_0x23d2('0x21')](function(_0x2942c4){if(_0x2942c4){return _0x2942c4[_0x23d2('0x6e')](_0x44e8f8[_0x23d2('0x5b')][_0x23d2('0x6f')],_[_0x23d2('0x70')](_0x44e8f8[_0x23d2('0x5b')],[_0x23d2('0x6f'),'id'])||{});}})[_0x23d2('0x21')](respondWithResult(_0x25bfe0,null))['catch'](handleError(_0x25bfe0,null));};exports[_0x23d2('0x71')]=function(_0x76d223,_0x3447d9,_0x417919){var _0x3d4829={'raw':![],'where':{}};var _0xbe7385={};var _0x3b711c={'count':0x0,'rows':[]};return db[_0x23d2('0x3e')][_0x23d2('0x66')]({'where':{'id':_0x76d223['params']['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x3447d9,null))[_0x23d2('0x21')](function(_0x3178c6){if(_0x3178c6){_0xbe7385[_0x23d2('0x41')]=_[_0x23d2('0x58')](db[_0x23d2('0x6d')][_0x23d2('0x3f')]);_0xbe7385['query']=_[_0x23d2('0x58')](_0x76d223[_0x23d2('0x42')]);_0xbe7385['filters']=_[_0x23d2('0x59')](_0xbe7385[_0x23d2('0x41')],_0xbe7385[_0x23d2('0x42')]);_0x3d4829[_0x23d2('0x44')]=_[_0x23d2('0x59')](_0xbe7385['model'],qs[_0x23d2('0x45')](_0x76d223['query'][_0x23d2('0x45')]));_0x3d4829[_0x23d2('0x44')]=_0x3d4829[_0x23d2('0x44')]['length']?_0x3d4829[_0x23d2('0x44')]:_0xbe7385['model'];if(!_0x76d223[_0x23d2('0x42')][_0x23d2('0x67')](_0x23d2('0x47'))){_0x3d4829[_0x23d2('0x30')]=qs['limit'](_0x76d223[_0x23d2('0x42')][_0x23d2('0x30')]);_0x3d4829[_0x23d2('0x2e')]=qs['offset'](_0x76d223['query'][_0x23d2('0x2e')]);}_0x3d4829[_0x23d2('0x48')]=qs[_0x23d2('0x49')](_0x76d223[_0x23d2('0x42')][_0x23d2('0x49')]);_0x3d4829['where']=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x76d223[_0x23d2('0x42')],_0xbe7385[_0x23d2('0x43')]));_0x3d4829[_0x23d2('0x4a')][_0x23d2('0x68')]=_0x3178c6['id'];if(_0x76d223[_0x23d2('0x42')][_0x23d2('0x4c')]){_0x3d4829[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x3d4829[_0x23d2('0x4a')],{'$or':_[_0x23d2('0x3d')](_0x3d4829[_0x23d2('0x44')],function(_0x3138b9){var _0x21a37b={};_0x21a37b[_0x3138b9]={'$like':'%'+_0x76d223[_0x23d2('0x42')]['filter']+'%'};return _0x21a37b;})});}_0x3d4829=_['merge']({},_0x3d4829,_0x76d223[_0x23d2('0x50')]);return db[_0x23d2('0x6d')]['count']({'where':_0x3d4829[_0x23d2('0x4a')]})[_0x23d2('0x21')](function(_0x5f4279){_0x3b711c['count']=_0x5f4279;if(_0x76d223['query'][_0x23d2('0x52')]){_0x3d4829['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x23d2('0x72')],'as':_0x23d2('0x73'),'attributes':['name','fullname',_0x23d2('0x74')],'required':![]},{'model':db[_0x23d2('0x75')],'as':_0x23d2('0x76'),'attributes':['id',_0x23d2('0x3a'),_0x23d2('0x77')],'where':_0x76d223[_0x23d2('0x42')][_0x23d2('0x78')]?{'id':_0x76d223[_0x23d2('0x42')][_0x23d2('0x78')]}:undefined,'required':_0x76d223[_0x23d2('0x42')][_0x23d2('0x78')]?!![]:![]}];}return db[_0x23d2('0x6d')][_0x23d2('0x54')](_0x3d4829);})['then'](function(_0x593759){_0x3b711c[_0x23d2('0x55')]=_0x593759;return _0x3b711c;});}})[_0x23d2('0x21')](respondWithFilteredResult(_0x3447d9,_0x3d4829))[_0x23d2('0x2a')](handleError(_0x3447d9,null));};exports[_0x23d2('0x79')]=function(_0x4cf470,_0x5b2670){var _0x5579b5=_0x4cf470[_0x23d2('0x56')]['id'];var _0x39ef75=_0x4cf470[_0x23d2('0x5b')];var _0x4bb7b1=0xc8;var _0x2b6a16=null;return db[_0x23d2('0x7a')][_0x23d2('0x7b')]({'isolationLevel':db[_0x23d2('0x7a')]['Transaction'][_0x23d2('0x7c')][_0x23d2('0x7d')]},function(_0x3d15db){return db[_0x23d2('0x3e')]['findOne']({'where':{'id':_0x5579b5},'transaction':_0x3d15db})[_0x23d2('0x21')](function(_0x43295d){if(_0x43295d){return db[_0x23d2('0x7e')][_0x23d2('0x35')]({'where':{'FaxAccountId':_0x5579b5},'transaction':_0x3d15db})[_0x23d2('0x21')](function(){var _0x322b70=_[_0x23d2('0x3d')](_0x39ef75,function(_0x5054eb){_0x5054eb[_0x23d2('0x68')]=_0x5579b5;return _0x5054eb;});return db[_0x23d2('0x7e')][_0x23d2('0x7f')](_0x322b70,{'transaction':_0x3d15db});});}else{_0x4bb7b1=0x194;_0x2b6a16=[];}});})[_0x23d2('0x21')](function(){if(_0x4bb7b1!==0x194){return db['FaxApplication'][_0x23d2('0x80')]({'where':{'FaxAccountId':_0x5579b5},'order':_0x23d2('0x81')})[_0x23d2('0x21')](function(_0x4618bf){_0x2b6a16=_0x4618bf;});}})['catch'](function(_0x13bbfa){_0x4bb7b1=0x1f4;logger[_0x23d2('0x25')](_0x13bbfa[_0x23d2('0x39')]);if(_0x13bbfa[_0x23d2('0x3a')]){delete _0x13bbfa[_0x23d2('0x3a')];}_0x2b6a16=_0x13bbfa;})['finally'](function(){if(_0x2b6a16===null){_0x5b2670[_0x23d2('0x2b')](_0x4bb7b1);}else{if(_0x4bb7b1===0x1f4){_0x5b2670[_0x23d2('0x2c')](_0x4bb7b1)[_0x23d2('0x3b')](_0x2b6a16);}else{_0x5b2670['status'](_0x4bb7b1)[_0x23d2('0x2d')](_0x2b6a16);}}});};exports[_0x23d2('0x82')]=function(_0x5daffd,_0x2209a8,_0x1a052d){var _0x5e0b6f={};var _0x4a61ba={};var _0x3491cb;var _0x45a759;return db[_0x23d2('0x3e')][_0x23d2('0x66')]({'where':{'id':_0x5daffd[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x2209a8,null))['then'](function(_0x5d4873){if(_0x5d4873){_0x3491cb=_0x5d4873;_0x4a61ba['model']=_['keys'](db[_0x23d2('0x7e')][_0x23d2('0x3f')]);_0x4a61ba[_0x23d2('0x42')]=_[_0x23d2('0x58')](_0x5daffd['query']);_0x4a61ba['filters']=_[_0x23d2('0x59')](_0x4a61ba[_0x23d2('0x41')],_0x4a61ba[_0x23d2('0x42')]);_0x5e0b6f[_0x23d2('0x44')]=_['intersection'](_0x4a61ba[_0x23d2('0x41')],qs[_0x23d2('0x45')](_0x5daffd[_0x23d2('0x42')][_0x23d2('0x45')]));_0x5e0b6f['attributes']=_0x5e0b6f[_0x23d2('0x44')]['length']?_0x5e0b6f[_0x23d2('0x44')]:_0x4a61ba['model'];_0x5e0b6f['order']=qs[_0x23d2('0x49')](_0x5daffd['query']['sort']);_0x5e0b6f[_0x23d2('0x4a')]=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x5daffd[_0x23d2('0x42')],_0x4a61ba[_0x23d2('0x43')]));if(_0x5daffd[_0x23d2('0x42')][_0x23d2('0x4c')]){_0x5e0b6f[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x5e0b6f[_0x23d2('0x4a')],{'$or':_['map'](_0x5e0b6f[_0x23d2('0x44')],function(_0x25c7f4){var _0x5ed4bb={};_0x5ed4bb[_0x25c7f4]={'$like':'%'+_0x5daffd[_0x23d2('0x42')][_0x23d2('0x4c')]+'%'};return _0x5ed4bb;})});}_0x5e0b6f=_['merge']({},_0x5e0b6f,_0x5daffd[_0x23d2('0x50')]);return _0x3491cb[_0x23d2('0x82')](_0x5e0b6f);}})[_0x23d2('0x21')](function(_0x2f2da3){if(_0x2f2da3){_0x45a759=_0x2f2da3[_0x23d2('0x46')];if(!_0x5daffd[_0x23d2('0x42')][_0x23d2('0x67')](_0x23d2('0x47'))){_0x5e0b6f[_0x23d2('0x30')]=qs['limit'](_0x5daffd[_0x23d2('0x42')]['limit']);_0x5e0b6f[_0x23d2('0x2e')]=qs[_0x23d2('0x2e')](_0x5daffd['query'][_0x23d2('0x2e')]);}return _0x3491cb['getApplications'](_0x5e0b6f);}})[_0x23d2('0x21')](function(_0x19f52e){if(_0x19f52e){return _0x19f52e?{'count':_0x45a759,'rows':_0x19f52e}:null;}})[_0x23d2('0x21')](respondWithResult(_0x2209a8,null))['catch'](handleError(_0x2209a8,null));};function Extension(_0x73c6a6,_0x265359,_0x43a64a,_0x408c77){this[_0x23d2('0x83')]='from-voip-provider';this[_0x23d2('0x84')]=_0x73c6a6[_0x23d2('0x85')];this[_0x23d2('0x86')]=_0x408c77;this[_0x23d2('0x4e')]=_0x23d2('0x87');this[_0x23d2('0x88')]='Fax\x20Extension';this[_0x23d2('0x68')]=_0x73c6a6['id'];this[_0x23d2('0x81')]=_0x265359;this[_0x23d2('0x89')]=_0x43a64a;}function createExtensionsReciveFax(_0x1978b7){var _0xe99b2c=0x1;var _0x108439=[];_0x108439[_0x23d2('0x8a')](new Extension(_0x1978b7,_0xe99b2c,'',_0x23d2('0x8b')));_0xe99b2c+=0x1;_0x108439['push'](new Extension(_0x1978b7,_0xe99b2c,'CDR(type)=inbound-fax','Set'));_0xe99b2c+=0x1;for(var _0x5a3e25 in _0x1978b7){if(_0x1978b7[_0x23d2('0x67')](_0x5a3e25)&&(_0x5a3e25===_0x23d2('0x8c')||_0x5a3e25===_0x23d2('0x85')||_0x5a3e25==='gateway'||_0x5a3e25===_0x23d2('0x8d')||_0x5a3e25===_0x23d2('0x8e')||_0x5a3e25===_0x23d2('0x8f')||_0x5a3e25==='minrate'||_0x5a3e25===_0x23d2('0x90')||_0x5a3e25===_0x23d2('0x91'))){_0x108439[_0x23d2('0x8a')](new Extension(_0x1978b7,_0xe99b2c,_0x23d2('0x92')+_0x5a3e25+')='+_0x1978b7[_0x5a3e25],'Set'));_0xe99b2c+=0x1;}}_0x108439[_0x23d2('0x8a')](new Extension(_0x1978b7,_0xe99b2c,'6',_0x23d2('0x93')));_0xe99b2c+=0x1;_0x108439['push'](new Extension(_0x1978b7,_0xe99b2c,_0x23d2('0x94'),_0x23d2('0x95')));_0xe99b2c=0x0;return _0x108439;}exports[_0x23d2('0x96')]=function(_0x25978a,_0x447b05,_0xe4f362){var _0x296542;return db[_0x23d2('0x7a')][_0x23d2('0x7b')](function(_0x11ca29){return db[_0x23d2('0x3e')]['create'](_0x25978a[_0x23d2('0x5b')],{'transaction':_0x11ca29})[_0x23d2('0x21')](function(_0x4d7e21){_0x296542=_0x4d7e21[_0x23d2('0x36')]({'plain':!![]});return db[_0x23d2('0x97')][_0x23d2('0x7f')](createExtensionsReciveFax(_0x296542),{'transaction':_0x11ca29});});})[_0x23d2('0x21')](function(){return _0x296542;})[_0x23d2('0x21')](respondWithResult(_0x447b05,null))['catch'](handleError(_0x447b05,null));};exports[_0x23d2('0x98')]=function(_0x12a3e9,_0x13cbe4,_0x5a9e07){var _0x300abd;return db[_0x23d2('0x7a')][_0x23d2('0x7b')](function(_0x37f578){return db[_0x23d2('0x3e')][_0x23d2('0x34')](_0x12a3e9[_0x23d2('0x5b')],{'where':{'id':_0x12a3e9[_0x23d2('0x5b')]['id']},'transaction':_0x37f578})[_0x23d2('0x21')](function(_0x497c76){return db[_0x23d2('0x97')][_0x23d2('0x35')]({'where':{'FaxAccountId':_0x12a3e9['body']['id']},'transaction':_0x37f578})[_0x23d2('0x21')](function(_0x51ff7a){return db[_0x23d2('0x97')][_0x23d2('0x7f')](createExtensionsReciveFax(_['omit'](_0x12a3e9['body'],[_0x23d2('0x99'),_0x23d2('0x9a'),_0x23d2('0x9b'),_0x23d2('0x9c'),_0x23d2('0x9d'),_0x23d2('0x9e')])),{'transaction':_0x37f578});});});})[_0x23d2('0x21')](function(){return db[_0x23d2('0x3e')][_0x23d2('0x9f')](_0x12a3e9[_0x23d2('0x5b')]['id']);})[_0x23d2('0x21')](respondWithResult(_0x13cbe4,null))[_0x23d2('0x2a')](handleError(_0x13cbe4,null));};exports['getMessages']=function(_0x5c2e80,_0x4a8127,_0x1b69db){var _0x528e21={'raw':!![],'where':{}};var _0x46c0fe={};var _0x319d09={'count':0x0,'rows':[]};return db[_0x23d2('0x3e')][_0x23d2('0x66')]({'where':{'id':_0x5c2e80['params']['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x4a8127,null))[_0x23d2('0x21')](function(_0x88eea6){if(_0x88eea6){_0x46c0fe[_0x23d2('0x41')]=_['keys'](db[_0x23d2('0xa0')][_0x23d2('0x3f')]);_0x46c0fe[_0x23d2('0x42')]=_[_0x23d2('0x58')](_0x5c2e80['query']);_0x46c0fe[_0x23d2('0x43')]=_[_0x23d2('0x59')](_0x46c0fe['model'],_0x46c0fe[_0x23d2('0x42')]);_0x528e21[_0x23d2('0x44')]=_[_0x23d2('0x59')](_0x46c0fe['model'],qs[_0x23d2('0x45')](_0x5c2e80[_0x23d2('0x42')][_0x23d2('0x45')]));_0x528e21[_0x23d2('0x44')]=_0x528e21[_0x23d2('0x44')]['length']?_0x528e21[_0x23d2('0x44')]:_0x46c0fe['model'];if(!_0x5c2e80['query']['hasOwnProperty'](_0x23d2('0x47'))){_0x528e21[_0x23d2('0x30')]=qs[_0x23d2('0x30')](_0x5c2e80[_0x23d2('0x42')]['limit']);_0x528e21[_0x23d2('0x2e')]=qs['offset'](_0x5c2e80['query']['offset']);}_0x528e21[_0x23d2('0x48')]=qs[_0x23d2('0x49')](_0x5c2e80[_0x23d2('0x42')][_0x23d2('0x49')]);_0x528e21[_0x23d2('0x4a')]=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x5c2e80[_0x23d2('0x42')],_0x46c0fe['filters']));_0x528e21['where'][_0x23d2('0x68')]=_0x88eea6['id'];if(_0x5c2e80['query']['filter']){_0x528e21[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x528e21[_0x23d2('0x4a')],{'$or':_[_0x23d2('0x3d')](_0x528e21[_0x23d2('0x44')],function(_0x279c82){var _0x1ce790={};_0x1ce790[_0x279c82]={'$like':'%'+_0x5c2e80[_0x23d2('0x42')][_0x23d2('0x4c')]+'%'};return _0x1ce790;})});}if(_0x5c2e80['query']['$gte']){var _0xcc3cca=_0x5c2e80[_0x23d2('0x42')][_0x23d2('0xa1')][_0x23d2('0xa2')](',');var _0x5b706e={};_0x5b706e[_0xcc3cca[0x0]]={'$gte':moment(_0xcc3cca[0x1])[_0x23d2('0xa3')](_0x23d2('0xa4'))};_0x528e21[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x528e21[_0x23d2('0x4a')],_0x5b706e);}_0x528e21=_[_0x23d2('0x4d')]({},_0x528e21,_0x5c2e80[_0x23d2('0x50')]);return db[_0x23d2('0xa0')][_0x23d2('0x51')]({'where':_0x528e21[_0x23d2('0x4a')]})[_0x23d2('0x21')](function(_0x38aada){_0x319d09['count']=_0x38aada;if(_0x5c2e80[_0x23d2('0x42')]['includeAll']){_0x528e21[_0x23d2('0x53')]=[{'all':!![]}];}return db[_0x23d2('0xa0')]['findAll'](_0x528e21);})[_0x23d2('0x21')](function(_0x243a61){_0x319d09[_0x23d2('0x55')]=_0x243a61;return _0x319d09;});}})['then'](respondWithFilteredResult(_0x4a8127,_0x528e21))[_0x23d2('0x2a')](handleError(_0x4a8127,null));};exports[_0x23d2('0x3b')]=function(_0x4be5f5,_0xa4a882,_0x24ef52){var _0x43010a,_0xd47422={},_0x18d647;if(_0x4be5f5[_0x23d2('0x5b')]['to']){_0x18d647=_0x4be5f5[_0x23d2('0x5b')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x4be5f5[_0x23d2('0x56')]['id']},'include':[{'model':db[_0x23d2('0xa5')],'as':_0x23d2('0xa6'),'include':[{'model':db['CmContact'],'as':_0x23d2('0xa7'),'where':{'fax':_0x18d647},'limit':0x1,'order':[[_0x23d2('0x9c'),_0x23d2('0xa8')]]}]}]})[_0x23d2('0x21')](handleEntityNotFound(_0xa4a882,null))[_0x23d2('0x21')](function(_0x10faab){_0x43010a=_0x10faab;if(_0x4be5f5['body'][_0x23d2('0xa9')]&&_0x4be5f5['body'][_0x23d2('0xa9')][_0x23d2('0x46')]){for(var _0xc28d46=0x0;_0xc28d46<_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')]['length'];_0xc28d46+=0x1){_0x4be5f5[_0x23d2('0x5b')]['attachments'][_0xc28d46]={'filename':_0x4be5f5['body'][_0x23d2('0xa9')][_0xc28d46][_0x23d2('0x3a')],'id':_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][_0xc28d46]['id'],'path':path[_0x23d2('0xaa')](config['root'],_0x23d2('0xab'),_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][_0xc28d46][_0x23d2('0xac')])};}}return respondWithRpcPromise(_0x23d2('0xad'),_0x23d2('0xad'),{'FaxAccountId':_[_0x23d2('0xae')](_0x4be5f5['params']['id'])?undefined:_0x4be5f5['params']['id'],'path':_[_0x23d2('0xae')](_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0][_0x23d2('0x8')])?undefined:_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0][_0x23d2('0x8')],'fax':_['isNil'](_0x4be5f5[_0x23d2('0x5b')]['to'][0x0])?undefined:_0x4be5f5['body']['to'][0x0]},client9002);})[_0x23d2('0x21')](function(){if(_0x43010a){if(_['isNil'](_0x4be5f5[_0x23d2('0x5b')]['from'])){_0x4be5f5[_0x23d2('0x5b')]['from']=util[_0x23d2('0xa3')](_0x23d2('0xaf'),_0x43010a[_0x23d2('0x3a')],_0x43010a['fax']);}if(_0x43010a['List']){if(_0x43010a[_0x23d2('0xa6')][_0x23d2('0xa7')][_0x23d2('0x46')]){return _0x43010a[_0x23d2('0xa6')][_0x23d2('0xa7')][0x0];}else{return db[_0x23d2('0xb0')][_0x23d2('0x5a')](_[_0x23d2('0x1b')](_0x4be5f5['body'],{'firstName':_0x4be5f5[_0x23d2('0x5b')]['to'][0x0],'phone':_0x4be5f5[_0x23d2('0x5b')]['to'][0x0],'fax':_0x4be5f5[_0x23d2('0x5b')]['to'][0x0],'ListId':_0x43010a['ListId']}));}}else{throw new Error(_0x23d2('0xb1'));}}else{throw new Error(_0x23d2('0xb2'));}})[_0x23d2('0x21')](function(_0x4c2007){if(_0x4c2007){return db[_0x23d2('0x6d')][_0x23d2('0x61')]({'where':{'ContactId':_0x4c2007['id'],'closed':![],'FaxAccountId':_0x43010a['id']}})[_0x23d2('0x21')](function(_0x505359){if(_0x505359){return[_0x505359,![]];}return db[_0x23d2('0x6d')][_0x23d2('0x5a')]({'UserId':_0x4be5f5[_0x23d2('0x5c')]['id'],'ContactId':_0x4c2007['id'],'FaxAccountId':_0x43010a['id'],'fax':_0x4be5f5[_0x23d2('0x5b')]['to'][0x0],'firstMsgDirection':_0x23d2('0xb3'),'Messages':[_[_0x23d2('0x4d')](_0x4be5f5[_0x23d2('0x5b')],{'read':![],'body':_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0][_0x23d2('0xb4')],'FaxAccountId':_0x43010a['id'],'UserId':_0x4be5f5[_0x23d2('0x5c')]['id'],'ContactId':_0x4c2007['id'],'AttachmentId':_0x4be5f5[_0x23d2('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x23d2('0x21')](function(_0x5aa2d0){return[_0x5aa2d0,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x23d2('0xb5')](function(_0x5945f4,_0x556515){if(_0x556515){return _0x5945f4;}return db[_0x23d2('0xa0')][_0x23d2('0x5a')]({'direction':_0x23d2('0xb3'),'read':![],'body':_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0]['filename'],'FaxAccountId':_0x43010a['id'],'FaxInteractionId':_0x5945f4['id'],'UserId':_0x4be5f5['user']['id'],'ContactId':_0x5945f4[_0x23d2('0xb6')],'AttachmentId':_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0]['id']})[_0x23d2('0x21')](function(_0x52a408){_0x5945f4[_0x23d2('0xb7')]['Messages']=[];_0x5945f4['dataValues']['Messages'][_0x23d2('0x8a')](_0x52a408[_0x23d2('0xb7')]);return _0x5945f4;});})[_0x23d2('0x21')](function(_0x25382a){respondWithRpcPromise(_0x23d2('0xb8'),'SendFax',{'FaxAccountId':_[_0x23d2('0xae')](_0x4be5f5[_0x23d2('0x56')]['id'])?undefined:_0x4be5f5[_0x23d2('0x56')]['id'],'path':_['isNil'](_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0][_0x23d2('0x8')])?undefined:_0x4be5f5[_0x23d2('0x5b')][_0x23d2('0xa9')][0x0][_0x23d2('0x8')],'fax':_[_0x23d2('0xae')](_0x4be5f5[_0x23d2('0x5b')]['to'][0x0])?undefined:_0x4be5f5[_0x23d2('0x5b')]['to'][0x0],'AttachmentId':_0x4be5f5['body']['attachments'][0x0]['id']},client9002)[_0x23d2('0x21')](function(_0x3450f3){logger[_0x23d2('0x22')](_0x23d2('0xb9'),_0x3450f3);})[_0x23d2('0x2a')](function(_0x273dfc){logger[_0x23d2('0x22')](_0x23d2('0xb9'),_0x273dfc);});return _0x25382a;})[_0x23d2('0x21')](respondWithResult(_0xa4a882,null))[_0x23d2('0x2a')](handleError(_0xa4a882,null));};exports[_0x23d2('0xba')]=function(_0x370c7f,_0x5a4006,_0x23bea7){return db[_0x23d2('0x3e')]['find']({'where':{'id':_0x370c7f[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x5a4006,null))[_0x23d2('0x21')](function(_0x18dc36){if(_0x18dc36){return _0x18dc36['addAgents'](_0x370c7f[_0x23d2('0x5b')][_0x23d2('0x6f')],_[_0x23d2('0x70')](_0x370c7f[_0x23d2('0x5b')],['ids','id'])||{})[_0x23d2('0xb5')](function(_0x200cb1){for(var _0x425631=0x0;_0x425631<_0x370c7f[_0x23d2('0x5b')][_0x23d2('0x6f')][_0x23d2('0x46')];_0x425631+=0x1){socket[_0x23d2('0xbb')](_0x23d2('0xbc'),{'UserId':Number(_0x370c7f[_0x23d2('0x5b')]['ids'][_0x425631]),'FaxAccountId':Number(_0x370c7f[_0x23d2('0x56')]['id'])});}return _0x200cb1;});}})['then'](respondWithResult(_0x5a4006,null))[_0x23d2('0x2a')](handleError(_0x5a4006,null));};exports[_0x23d2('0xbd')]=function(_0x295594,_0x59a2a2,_0x33ad3d){return db[_0x23d2('0x3e')][_0x23d2('0x61')]({'where':{'id':_0x295594[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x59a2a2,null))['then'](function(_0xeed5cc){if(_0xeed5cc){return _0xeed5cc['removeAgents'](_0x295594[_0x23d2('0x42')][_0x23d2('0x6f')])[_0x23d2('0x21')](function(){if(_['isArray'](_0x295594[_0x23d2('0x42')][_0x23d2('0x6f')])){for(var _0x281aae=0x0;_0x281aae<_0x295594['query'][_0x23d2('0x6f')]['length'];_0x281aae+=0x1){socket['emit'](_0x23d2('0xbe'),{'UserId':Number(_0x295594[_0x23d2('0x42')][_0x23d2('0x6f')][_0x281aae]),'FaxAccountId':Number(_0x295594[_0x23d2('0x56')]['id'])});}}else{socket[_0x23d2('0xbb')]('userFaxAccount:remove',{'UserId':Number(_0x295594['query'][_0x23d2('0x6f')]),'FaxAccountId':Number(_0x295594[_0x23d2('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x59a2a2,null))['catch'](handleError(_0x59a2a2,null));};exports['getAgents']=function(_0x15a433,_0x489627,_0x190124){var _0x4a6e45={};var _0x1a0cd6={};var _0x3905a4;var _0x3bf5b9;return db[_0x23d2('0x3e')][_0x23d2('0x66')]({'where':{'id':_0x15a433[_0x23d2('0x56')]['id']}})[_0x23d2('0x21')](handleEntityNotFound(_0x489627,null))[_0x23d2('0x21')](function(_0x1d4c1d){if(_0x1d4c1d){_0x3905a4=_0x1d4c1d;_0x1a0cd6[_0x23d2('0x41')]=_['keys'](db[_0x23d2('0x72')][_0x23d2('0x3f')]);_0x1a0cd6[_0x23d2('0x42')]=_[_0x23d2('0x58')](_0x15a433[_0x23d2('0x42')]);_0x1a0cd6[_0x23d2('0x43')]=_[_0x23d2('0x59')](_0x1a0cd6['model'],_0x1a0cd6[_0x23d2('0x42')]);_0x4a6e45[_0x23d2('0x44')]=_[_0x23d2('0x59')](_0x1a0cd6[_0x23d2('0x41')],qs[_0x23d2('0x45')](_0x15a433[_0x23d2('0x42')][_0x23d2('0x45')]));_0x4a6e45[_0x23d2('0x44')]=_0x4a6e45[_0x23d2('0x44')][_0x23d2('0x46')]?_0x4a6e45[_0x23d2('0x44')]:_0x1a0cd6[_0x23d2('0x41')];_0x4a6e45[_0x23d2('0x48')]=qs['sort'](_0x15a433[_0x23d2('0x42')][_0x23d2('0x49')]);_0x4a6e45[_0x23d2('0x4a')]=qs[_0x23d2('0x43')](_[_0x23d2('0x4b')](_0x15a433['query'],_0x1a0cd6[_0x23d2('0x43')]));if(_0x15a433[_0x23d2('0x42')][_0x23d2('0x4c')]){_0x4a6e45[_0x23d2('0x4a')]=_[_0x23d2('0x4d')](_0x4a6e45['where'],{'$or':_['map'](_0x4a6e45['attributes'],function(_0x41a7e9){var _0x44146c={};_0x44146c[_0x41a7e9]={'$like':'%'+_0x15a433['query'][_0x23d2('0x4c')]+'%'};return _0x44146c;})});}_0x4a6e45=_['merge']({},_0x4a6e45,_0x15a433[_0x23d2('0x50')]);return _0x3905a4[_0x23d2('0xbf')](_0x4a6e45);}})[_0x23d2('0x21')](function(_0x5b424a){if(_0x5b424a){_0x3bf5b9=_0x5b424a[_0x23d2('0x46')];if(!_0x15a433[_0x23d2('0x42')][_0x23d2('0x67')](_0x23d2('0x47'))){_0x4a6e45[_0x23d2('0x30')]=qs[_0x23d2('0x30')](_0x15a433['query'][_0x23d2('0x30')]);_0x4a6e45[_0x23d2('0x2e')]=qs['offset'](_0x15a433[_0x23d2('0x42')][_0x23d2('0x2e')]);}return _0x3905a4[_0x23d2('0xbf')](_0x4a6e45);}})[_0x23d2('0x21')](function(_0x2909be){if(_0x2909be){return _0x2909be?{'count':_0x3bf5b9,'rows':_0x2909be}:null;}})['then'](respondWithResult(_0x489627,null))[_0x23d2('0x2a')](handleError(_0x489627,null));}; \ No newline at end of file +var _0xea29=['FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','priority','finally','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','TrunkId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','CmContact','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','fieldName','key','map','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition'];(function(_0x1ce979,_0x1dc8aa){var _0x5cd3f1=function(_0xcf768){while(--_0xcf768){_0x1ce979['push'](_0x1ce979['shift']());}};_0x5cd3f1(++_0x1dc8aa);}(_0xea29,0x1ed));var _0x9ea2=function(_0x494368,_0x56d9a3){_0x494368=_0x494368-0x0;var _0x1491a3=_0xea29[_0x494368];return _0x1491a3;};'use strict';var emlformat=require(_0x9ea2('0x0'));var rimraf=require(_0x9ea2('0x1'));var zipdir=require(_0x9ea2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ea2('0x3'));var moment=require('moment');var BPromise=require(_0x9ea2('0x4'));var Mustache=require(_0x9ea2('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9ea2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ea2('0x7'));var _=require(_0x9ea2('0x8'));var squel=require(_0x9ea2('0x9'));var crypto=require(_0x9ea2('0xa'));var jsforce=require(_0x9ea2('0xb'));var deskjs=require(_0x9ea2('0xc'));var toCsv=require(_0x9ea2('0x6'));var querystring=require(_0x9ea2('0xd'));var Papa=require(_0x9ea2('0xe'));var Redis=require(_0x9ea2('0xf'));var authService=require(_0x9ea2('0x10'));var qs=require(_0x9ea2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ea2('0x12'));var logger=require(_0x9ea2('0x13'))(_0x9ea2('0x14'));var utils=require(_0x9ea2('0x15'));var config=require(_0x9ea2('0x16'));var licenseUtil=require(_0x9ea2('0x17'));var db=require(_0x9ea2('0x18'))['db'];config[_0x9ea2('0x19')]=_[_0x9ea2('0x1a')](config['redis'],{'host':_0x9ea2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ea2('0x19')]));require(_0x9ea2('0x1c'))[_0x9ea2('0x1d')](socket);var jayson=require(_0x9ea2('0x1e'));var client=jayson['client'][_0x9ea2('0x1f')]({'port':0x232c});var client9002=jayson[_0x9ea2('0x20')][_0x9ea2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x366766,_0x15ca6a,_0x2dca0b,_0x172489){return new BPromise(function(_0x3cdf7c,_0x3b6fd4){var _0x49487a=_0x172489||client;return _0x49487a[_0x9ea2('0x21')](_0x366766,_0x2dca0b)['then'](function(_0x56515a){logger[_0x9ea2('0x22')](_0x9ea2('0x23'),_0x15ca6a,_0x9ea2('0x24'));logger['debug'](_0x9ea2('0x25'),_0x15ca6a,_0x9ea2('0x24'),JSON[_0x9ea2('0x26')](_0x56515a));if(_0x56515a[_0x9ea2('0x27')]){if(_0x56515a['error'][_0x9ea2('0x28')]===0x1f4){logger[_0x9ea2('0x27')](_0x9ea2('0x23'),_0x15ca6a,_0x56515a[_0x9ea2('0x27')][_0x9ea2('0x29')]);return _0x3b6fd4(_0x56515a['error'][_0x9ea2('0x29')]);}logger['error'](_0x9ea2('0x23'),_0x15ca6a,_0x56515a['error'][_0x9ea2('0x29')]);return _0x3cdf7c(_0x56515a[_0x9ea2('0x27')][_0x9ea2('0x29')]);}else{logger['info'](_0x9ea2('0x23'),_0x15ca6a,_0x9ea2('0x24'));_0x3cdf7c(_0x56515a[_0x9ea2('0x2a')]['message']);}})[_0x9ea2('0x2b')](function(_0x3265ff){logger[_0x9ea2('0x27')](_0x9ea2('0x23'),_0x15ca6a,_0x3265ff);_0x3b6fd4(_0x3265ff);});});}function respondWithStatusCode(_0x425768,_0x4f57ca){_0x4f57ca=_0x4f57ca||0xcc;return function(_0x5875c8){if(_0x5875c8){return _0x425768['sendStatus'](_0x4f57ca);}return _0x425768[_0x9ea2('0x2c')](_0x4f57ca)[_0x9ea2('0x2d')]();};}function respondWithResult(_0x49f22c,_0x36576e){_0x36576e=_0x36576e||0xc8;return function(_0xfcb9f0){if(_0xfcb9f0){return _0x49f22c[_0x9ea2('0x2c')](_0x36576e)[_0x9ea2('0x2e')](_0xfcb9f0);}};}function respondWithFilteredResult(_0x22fc3d,_0x2a38ae){return function(_0x1a69b3){if(_0x1a69b3){var _0x5dc8e7=typeof _0x2a38ae[_0x9ea2('0x2f')]===_0x9ea2('0x30')&&typeof _0x2a38ae[_0x9ea2('0x31')]===_0x9ea2('0x30');var _0x198223=_0x1a69b3[_0x9ea2('0x32')];var _0x27b96f=_0x5dc8e7?0x0:_0x2a38ae[_0x9ea2('0x2f')];var _0x526e18=_0x5dc8e7?_0x1a69b3[_0x9ea2('0x32')]:_0x2a38ae[_0x9ea2('0x2f')]+_0x2a38ae[_0x9ea2('0x31')];var _0x3b8c28;if(_0x526e18>=_0x198223){_0x526e18=_0x198223;_0x3b8c28=0xc8;}else{_0x3b8c28=0xce;}_0x22fc3d[_0x9ea2('0x2c')](_0x3b8c28);return _0x22fc3d[_0x9ea2('0x33')]('Content-Range',_0x27b96f+'-'+_0x526e18+'/'+_0x198223)[_0x9ea2('0x2e')](_0x1a69b3);}return null;};}function patchUpdates(_0x1e2b3b){return function(_0x12e453){try{jsonpatch[_0x9ea2('0x34')](_0x12e453,_0x1e2b3b,!![]);}catch(_0x4926db){return BPromise[_0x9ea2('0x35')](_0x4926db);}return _0x12e453[_0x9ea2('0x36')]();};}function saveUpdates(_0x52ffa1,_0x38cf07){return function(_0x3d9d4a){if(_0x3d9d4a){return _0x3d9d4a[_0x9ea2('0x37')](_0x52ffa1)[_0x9ea2('0x38')](function(_0x3d9098){return _0x3d9098;});}return null;};}function removeEntity(_0x2e21f3,_0x5e34de){return function(_0x432651){if(_0x432651){return _0x432651[_0x9ea2('0x39')]()[_0x9ea2('0x38')](function(){var _0x4d04ae=_0x432651['get']({'plain':!![]});var _0x2daeb3=_0x9ea2('0x3a');return db[_0x9ea2('0x3b')]['destroy']({'where':{'type':_0x2daeb3,'resourceId':_0x4d04ae['id']}})[_0x9ea2('0x38')](function(){return _0x432651;});})[_0x9ea2('0x38')](function(){_0x2e21f3[_0x9ea2('0x2c')](0xcc)[_0x9ea2('0x2d')]();});}};}function handleEntityNotFound(_0x48fc8b,_0x2489da){return function(_0x2733d2){if(!_0x2733d2){_0x48fc8b[_0x9ea2('0x3c')](0x194);}return _0x2733d2;};}function handleError(_0xfa8d7,_0x14a5eb){_0x14a5eb=_0x14a5eb||0x1f4;return function(_0xede113){logger[_0x9ea2('0x27')](_0xede113[_0x9ea2('0x3d')]);if(_0xede113[_0x9ea2('0x3e')]){delete _0xede113[_0x9ea2('0x3e')];}_0xfa8d7[_0x9ea2('0x2c')](_0x14a5eb)[_0x9ea2('0x3f')](_0xede113);};}exports[_0x9ea2('0x40')]=function(_0x328436,_0x3ea8e4){var _0x1cf82c={'include':[{'model':db[_0x9ea2('0x41')],'as':_0x9ea2('0x42')}]},_0x49481c={},_0x1f2f70={'count':0x0,'rows':[]};var _0x1762e1=_['map'](db[_0x9ea2('0x43')]['rawAttributes'],function(_0x413667){return{'name':_0x413667[_0x9ea2('0x44')],'type':_0x413667['type'][_0x9ea2('0x45')]};});_0x49481c['model']=_[_0x9ea2('0x46')](_0x1762e1,_0x9ea2('0x3e'));_0x49481c['query']=_['keys'](_0x328436[_0x9ea2('0x47')]);_0x49481c['filters']=_['intersection'](_0x49481c[_0x9ea2('0x48')],_0x49481c[_0x9ea2('0x47')]);_0x1cf82c[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x49481c[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x328436['query']['fields']));_0x1cf82c['attributes']=_0x1cf82c[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x1cf82c[_0x9ea2('0x49')]:_0x49481c[_0x9ea2('0x48')];if(!_0x328436[_0x9ea2('0x47')]['hasOwnProperty'](_0x9ea2('0x4d'))){_0x1cf82c['limit']=qs[_0x9ea2('0x31')](_0x328436[_0x9ea2('0x47')][_0x9ea2('0x31')]);_0x1cf82c[_0x9ea2('0x2f')]=qs['offset'](_0x328436[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x1cf82c[_0x9ea2('0x4e')]=qs[_0x9ea2('0x4f')](_0x328436[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x1cf82c[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x328436['query'],_0x49481c[_0x9ea2('0x51')]),_0x1762e1);if(_0x328436[_0x9ea2('0x47')]['filter']){_0x1cf82c[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x1cf82c[_0x9ea2('0x50')],{'$or':_[_0x9ea2('0x46')](_0x1762e1,function(_0x282e62){if(_0x282e62['type']!=='VIRTUAL'){var _0xf548fa={};_0xf548fa[_0x282e62[_0x9ea2('0x3e')]]={'$like':'%'+_0x328436[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0xf548fa;}})});}_0x1cf82c=_['merge']({},_0x1cf82c,_0x328436[_0x9ea2('0x55')]);var _0x40fbf8={'where':_0x1cf82c[_0x9ea2('0x50')]};return db['FaxAccount'][_0x9ea2('0x32')](_0x40fbf8)[_0x9ea2('0x38')](function(_0x5e03d7){_0x1f2f70[_0x9ea2('0x32')]=_0x5e03d7;if(_0x328436['query'][_0x9ea2('0x56')]){_0x1cf82c[_0x9ea2('0x57')]=[{'all':!![]}];}return db[_0x9ea2('0x43')][_0x9ea2('0x58')](_0x1cf82c);})[_0x9ea2('0x38')](function(_0xa3879f){_0x1f2f70[_0x9ea2('0x59')]=_0xa3879f;return _0x1f2f70;})['then'](respondWithFilteredResult(_0x3ea8e4,_0x1cf82c))[_0x9ea2('0x2b')](handleError(_0x3ea8e4,null));};exports[_0x9ea2('0x5a')]=function(_0x3aa84f,_0x304177){var _0x5f8b9c={'raw':![],'where':{'id':_0x3aa84f[_0x9ea2('0x5b')]['id']},'include':[{'model':db[_0x9ea2('0x41')],'as':_0x9ea2('0x42')}]},_0x26f465={};_0x26f465[_0x9ea2('0x48')]=_['keys'](db['FaxAccount'][_0x9ea2('0x5c')]);_0x26f465[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x3aa84f[_0x9ea2('0x47')]);_0x26f465['filters']=_['intersection'](_0x26f465[_0x9ea2('0x48')],_0x26f465[_0x9ea2('0x47')]);_0x5f8b9c[_0x9ea2('0x49')]=_['intersection'](_0x26f465['model'],qs[_0x9ea2('0x4b')](_0x3aa84f['query'][_0x9ea2('0x4b')]));_0x5f8b9c[_0x9ea2('0x49')]=_0x5f8b9c[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x5f8b9c[_0x9ea2('0x49')]:_0x26f465['model'];if(_0x3aa84f[_0x9ea2('0x47')][_0x9ea2('0x56')]){_0x5f8b9c[_0x9ea2('0x57')]=[{'all':!![]}];}_0x5f8b9c=_[_0x9ea2('0x53')]({},_0x5f8b9c,_0x3aa84f[_0x9ea2('0x55')]);return db['FaxAccount'][_0x9ea2('0x5e')](_0x5f8b9c)[_0x9ea2('0x38')](handleEntityNotFound(_0x304177,null))[_0x9ea2('0x38')](respondWithResult(_0x304177,null))[_0x9ea2('0x2b')](handleError(_0x304177,null));};exports[_0x9ea2('0x5f')]=function(_0x140112,_0x2961a2){return db[_0x9ea2('0x43')]['create'](_0x140112[_0x9ea2('0x60')],{})[_0x9ea2('0x38')](function(_0x10d6c4){var _0x56adee=_0x140112[_0x9ea2('0x61')]['get']({'plain':!![]});if(!_0x56adee)throw new Error(_0x9ea2('0x62'));if(_0x56adee[_0x9ea2('0x63')]===_0x9ea2('0x61')){var _0x54a2fc=_0x10d6c4[_0x9ea2('0x64')]({'plain':!![]});var _0x47fc2a=_0x9ea2('0x3a');return db[_0x9ea2('0x65')][_0x9ea2('0x5e')]({'where':{'name':_0x47fc2a,'userProfileId':_0x56adee[_0x9ea2('0x66')]},'raw':!![]})[_0x9ea2('0x38')](function(_0x43a305){if(_0x43a305&&_0x43a305[_0x9ea2('0x67')]===0x0){return db[_0x9ea2('0x3b')][_0x9ea2('0x5f')]({'name':_0x54a2fc['name'],'resourceId':_0x54a2fc['id'],'type':_0x43a305['name'],'sectionId':_0x43a305['id']},{})['then'](function(){return _0x10d6c4;});}else{return _0x10d6c4;}})[_0x9ea2('0x2b')](function(_0x5df2ed){logger[_0x9ea2('0x27')](_0x9ea2('0x68'),_0x5df2ed);throw _0x5df2ed;});}return _0x10d6c4;})[_0x9ea2('0x38')](respondWithResult(_0x2961a2,0xc9))[_0x9ea2('0x2b')](handleError(_0x2961a2,null));};exports[_0x9ea2('0x37')]=function(_0x52d1b7,_0x414f54){if(_0x52d1b7[_0x9ea2('0x60')]['id']){delete _0x52d1b7[_0x9ea2('0x60')]['id'];}return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x52d1b7[_0x9ea2('0x5b')]['id']},'include':[{'model':db[_0x9ea2('0x41')],'as':_0x9ea2('0x42')}]})[_0x9ea2('0x38')](handleEntityNotFound(_0x414f54,null))[_0x9ea2('0x38')](saveUpdates(_0x52d1b7[_0x9ea2('0x60')],null))[_0x9ea2('0x38')](respondWithResult(_0x414f54,null))[_0x9ea2('0x2b')](handleError(_0x414f54,null));};exports[_0x9ea2('0x39')]=function(_0x20e2a6,_0x55c73c){return db['FaxAccount'][_0x9ea2('0x5e')]({'where':{'id':_0x20e2a6[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x55c73c,null))[_0x9ea2('0x38')](removeEntity(_0x55c73c,null))['catch'](handleError(_0x55c73c,null));};exports[_0x9ea2('0x69')]=function(_0x284c35,_0x57d482){return db[_0x9ea2('0x43')][_0x9ea2('0x69')]()[_0x9ea2('0x38')](respondWithResult(_0x57d482,null))[_0x9ea2('0x2b')](handleError(_0x57d482,null));};exports[_0x9ea2('0x6a')]=function(_0x5ce0c6,_0x5a3c26,_0x312579){if(_0x5ce0c6[_0x9ea2('0x60')]['id']){delete _0x5ce0c6[_0x9ea2('0x60')]['id'];}return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x5ce0c6['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x5a3c26,null))[_0x9ea2('0x38')](function(_0x1c229c){if(_0x1c229c){_0x5ce0c6[_0x9ea2('0x60')][_0x9ea2('0x6b')]=_0x1c229c['id'];return db[_0x9ea2('0x6c')]['create'](_0x5ce0c6['body']);}})[_0x9ea2('0x38')](respondWithResult(_0x5a3c26,null))[_0x9ea2('0x2b')](handleError(_0x5a3c26,null));};exports[_0x9ea2('0x6d')]=function(_0x200d59,_0x2ae061,_0x4a7c75){var _0x3333b9={'raw':![],'where':{}};var _0x2039ba={};var _0x24f517={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x200d59[_0x9ea2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2ae061,null))[_0x9ea2('0x38')](function(_0x2c6696){if(_0x2c6696){_0x2039ba[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db[_0x9ea2('0x6c')]['rawAttributes']);_0x2039ba[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x200d59[_0x9ea2('0x47')]);_0x2039ba[_0x9ea2('0x51')]=_[_0x9ea2('0x4a')](_0x2039ba[_0x9ea2('0x48')],_0x2039ba[_0x9ea2('0x47')]);_0x3333b9[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x2039ba[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x200d59['query'][_0x9ea2('0x4b')]));_0x3333b9['attributes']=_0x3333b9['attributes']['length']?_0x3333b9[_0x9ea2('0x49')]:_0x2039ba[_0x9ea2('0x48')];if(!_0x200d59['query'][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x3333b9[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x200d59['query'][_0x9ea2('0x31')]);_0x3333b9['offset']=qs[_0x9ea2('0x2f')](_0x200d59[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x3333b9['order']=qs[_0x9ea2('0x4f')](_0x200d59[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x3333b9[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x200d59[_0x9ea2('0x47')],_0x2039ba[_0x9ea2('0x51')]));_0x3333b9[_0x9ea2('0x50')]['FaxAccountId']=_0x2c6696['id'];if(_0x200d59[_0x9ea2('0x47')][_0x9ea2('0x54')]){_0x3333b9[_0x9ea2('0x50')]=_['merge'](_0x3333b9[_0x9ea2('0x50')],{'$or':_[_0x9ea2('0x46')](_0x3333b9[_0x9ea2('0x49')],function(_0x285cc6){var _0x1f9955={};_0x1f9955[_0x285cc6]={'$like':'%'+_0x200d59[_0x9ea2('0x47')]['filter']+'%'};return _0x1f9955;})});}_0x3333b9=_[_0x9ea2('0x53')]({},_0x3333b9,_0x200d59['options']);return db['Disposition'][_0x9ea2('0x32')]({'where':_0x3333b9['where']})[_0x9ea2('0x38')](function(_0x2e926e){_0x24f517[_0x9ea2('0x32')]=_0x2e926e;if(_0x200d59[_0x9ea2('0x47')]['includeAll']){_0x3333b9['include']=[{'all':!![]}];}return db[_0x9ea2('0x6c')][_0x9ea2('0x58')](_0x3333b9);})[_0x9ea2('0x38')](function(_0x5d4b28){_0x24f517[_0x9ea2('0x59')]=_0x5d4b28;return _0x24f517;});}})[_0x9ea2('0x38')](respondWithFilteredResult(_0x2ae061,_0x3333b9))[_0x9ea2('0x2b')](handleError(_0x2ae061,null));};exports[_0x9ea2('0x70')]=function(_0x1346c2,_0x2b92f2,_0x22148d){return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x1346c2[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x2b92f2,null))[_0x9ea2('0x38')](function(_0xde7b46){if(_0xde7b46){return _0xde7b46[_0x9ea2('0x70')](_0x1346c2[_0x9ea2('0x47')][_0x9ea2('0x71')]);}})['then'](respondWithStatusCode(_0x2b92f2,null))[_0x9ea2('0x2b')](handleError(_0x2b92f2,null));};exports[_0x9ea2('0x72')]=function(_0x18540d,_0x5643e1,_0x3b880e){if(_0x18540d[_0x9ea2('0x60')]['id']){delete _0x18540d[_0x9ea2('0x60')]['id'];}return db['FaxAccount'][_0x9ea2('0x5e')]({'where':{'id':_0x18540d[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x5643e1,null))[_0x9ea2('0x38')](function(_0x5c80a4){if(_0x5c80a4){_0x18540d['body'][_0x9ea2('0x6b')]=_0x5c80a4['id'];return db[_0x9ea2('0x73')]['create'](_0x18540d[_0x9ea2('0x60')]);}})[_0x9ea2('0x38')](respondWithResult(_0x5643e1,null))[_0x9ea2('0x2b')](handleError(_0x5643e1,null));};exports[_0x9ea2('0x74')]=function(_0x7bdbb5,_0x3c2cff,_0x44b2b0){var _0x12fae4={'raw':![],'where':{}};var _0x4e3cf2={};var _0x6ec025={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')]['findOne']({'where':{'id':_0x7bdbb5['params']['id']}})['then'](handleEntityNotFound(_0x3c2cff,null))[_0x9ea2('0x38')](function(_0x49aae5){if(_0x49aae5){_0x4e3cf2[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db['CannedAnswer']['rawAttributes']);_0x4e3cf2[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x7bdbb5[_0x9ea2('0x47')]);_0x4e3cf2[_0x9ea2('0x51')]=_['intersection'](_0x4e3cf2[_0x9ea2('0x48')],_0x4e3cf2[_0x9ea2('0x47')]);_0x12fae4[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x4e3cf2['model'],qs[_0x9ea2('0x4b')](_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x4b')]));_0x12fae4[_0x9ea2('0x49')]=_0x12fae4[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x12fae4['attributes']:_0x4e3cf2[_0x9ea2('0x48')];if(!_0x7bdbb5['query'][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x12fae4['limit']=qs['limit'](_0x7bdbb5['query']['limit']);_0x12fae4[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x12fae4[_0x9ea2('0x4e')]=qs[_0x9ea2('0x4f')](_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x12fae4[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x7bdbb5[_0x9ea2('0x47')],_0x4e3cf2[_0x9ea2('0x51')]));_0x12fae4[_0x9ea2('0x50')][_0x9ea2('0x6b')]=_0x49aae5['id'];if(_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x54')]){_0x12fae4[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x12fae4[_0x9ea2('0x50')],{'$or':_['map'](_0x12fae4[_0x9ea2('0x49')],function(_0x1a52a3){var _0x5cf0c3={};_0x5cf0c3[_0x1a52a3]={'$like':'%'+_0x7bdbb5['query'][_0x9ea2('0x54')]+'%'};return _0x5cf0c3;})});}_0x12fae4=_[_0x9ea2('0x53')]({},_0x12fae4,_0x7bdbb5[_0x9ea2('0x55')]);return db[_0x9ea2('0x73')][_0x9ea2('0x32')]({'where':_0x12fae4[_0x9ea2('0x50')]})['then'](function(_0x574a10){_0x6ec025[_0x9ea2('0x32')]=_0x574a10;if(_0x7bdbb5[_0x9ea2('0x47')]['includeAll']){_0x12fae4[_0x9ea2('0x57')]=[{'all':!![]}];}return db[_0x9ea2('0x73')][_0x9ea2('0x58')](_0x12fae4);})[_0x9ea2('0x38')](function(_0x49f965){_0x6ec025[_0x9ea2('0x59')]=_0x49f965;return _0x6ec025;});}})[_0x9ea2('0x38')](respondWithFilteredResult(_0x3c2cff,_0x12fae4))['catch'](handleError(_0x3c2cff,null));};exports['removeAnswers']=function(_0x3aedbb,_0x1b3904,_0x12575f){return db[_0x9ea2('0x43')]['find']({'where':{'id':_0x3aedbb['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x1b3904,null))[_0x9ea2('0x38')](function(_0x557704){if(_0x557704){return _0x557704[_0x9ea2('0x75')](_0x3aedbb['query'][_0x9ea2('0x71')]);}})[_0x9ea2('0x38')](respondWithStatusCode(_0x1b3904,null))['catch'](handleError(_0x1b3904,null));};exports[_0x9ea2('0x76')]=function(_0x3beb42,_0x22ebe6,_0x1a9f44){return db[_0x9ea2('0x77')][_0x9ea2('0x5e')]({'where':{'id':_0x3beb42[_0x9ea2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x22ebe6,null))[_0x9ea2('0x38')](function(_0x309094){if(_0x309094){return _0x309094[_0x9ea2('0x76')](_0x3beb42['body'][_0x9ea2('0x71')],_[_0x9ea2('0x78')](_0x3beb42[_0x9ea2('0x60')],[_0x9ea2('0x71'),'id'])||{});}})[_0x9ea2('0x38')](respondWithResult(_0x22ebe6,null))[_0x9ea2('0x2b')](handleError(_0x22ebe6,null));};exports['getInteractions']=function(_0x3ef466,_0x99304c,_0x2eaff5){var _0x29f947={'raw':![],'where':{}};var _0x27ba65={};var _0x3675aa={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x3ef466['params']['id']}})['then'](handleEntityNotFound(_0x99304c,null))[_0x9ea2('0x38')](function(_0x486b9c){if(_0x486b9c){_0x27ba65[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db[_0x9ea2('0x77')][_0x9ea2('0x5c')]);_0x27ba65[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x3ef466[_0x9ea2('0x47')]);_0x27ba65[_0x9ea2('0x51')]=_[_0x9ea2('0x4a')](_0x27ba65[_0x9ea2('0x48')],_0x27ba65['query']);_0x29f947['attributes']=_[_0x9ea2('0x4a')](_0x27ba65[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x3ef466[_0x9ea2('0x47')]['fields']));_0x29f947[_0x9ea2('0x49')]=_0x29f947[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x29f947[_0x9ea2('0x49')]:_0x27ba65['model'];if(!_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x6f')]('nolimit')){_0x29f947[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x31')]);_0x29f947['offset']=qs[_0x9ea2('0x2f')](_0x3ef466[_0x9ea2('0x47')]['offset']);}_0x29f947[_0x9ea2('0x4e')]=qs[_0x9ea2('0x4f')](_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x29f947[_0x9ea2('0x50')]=qs['filters'](_['pick'](_0x3ef466[_0x9ea2('0x47')],_0x27ba65['filters']));_0x29f947[_0x9ea2('0x50')][_0x9ea2('0x6b')]=_0x486b9c['id'];if(_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x54')]){_0x29f947[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x29f947[_0x9ea2('0x50')],{'$or':_['map'](_0x29f947['attributes'],function(_0xf8c456){var _0x58977={};_0x58977[_0xf8c456]={'$like':'%'+_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0x58977;})});}_0x29f947=_['merge']({},_0x29f947,_0x3ef466['options']);return db[_0x9ea2('0x77')][_0x9ea2('0x32')]({'where':_0x29f947[_0x9ea2('0x50')]})[_0x9ea2('0x38')](function(_0x3c0fd5){_0x3675aa[_0x9ea2('0x32')]=_0x3c0fd5;if(_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x56')]){_0x29f947[_0x9ea2('0x57')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x9ea2('0x79')],'as':_0x9ea2('0x7a'),'attributes':['name',_0x9ea2('0x7b'),_0x9ea2('0x7c')],'required':![]},{'model':db[_0x9ea2('0x7d')],'as':_0x9ea2('0x7e'),'attributes':['id',_0x9ea2('0x3e'),_0x9ea2('0x7f')],'where':_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x80')]?{'id':_0x3ef466[_0x9ea2('0x47')]['tag']}:undefined,'required':_0x3ef466['query'][_0x9ea2('0x80')]?!![]:![]}];}return db[_0x9ea2('0x77')][_0x9ea2('0x58')](_0x29f947);})[_0x9ea2('0x38')](function(_0x25f297){_0x3675aa[_0x9ea2('0x59')]=_0x25f297;return _0x3675aa;});}})[_0x9ea2('0x38')](respondWithFilteredResult(_0x99304c,_0x29f947))[_0x9ea2('0x2b')](handleError(_0x99304c,null));};exports[_0x9ea2('0x81')]=function(_0x5e79f2,_0x3cb70e){var _0x205c7a=_0x5e79f2[_0x9ea2('0x5b')]['id'];var _0x55effb=_0x5e79f2[_0x9ea2('0x60')];var _0xf835c4=0xc8;var _0x22e671=null;return db[_0x9ea2('0x82')]['transaction']({'isolationLevel':db[_0x9ea2('0x82')][_0x9ea2('0x83')][_0x9ea2('0x84')][_0x9ea2('0x85')]},function(_0x1c1749){return db['FaxAccount']['findOne']({'where':{'id':_0x205c7a},'transaction':_0x1c1749})[_0x9ea2('0x38')](function(_0x483fed){if(_0x483fed){return db['FaxApplication'][_0x9ea2('0x39')]({'where':{'FaxAccountId':_0x205c7a},'transaction':_0x1c1749})[_0x9ea2('0x38')](function(){var _0x6197d4=_[_0x9ea2('0x46')](_0x55effb,function(_0xad8c78){_0xad8c78[_0x9ea2('0x6b')]=_0x205c7a;return _0xad8c78;});return db['FaxApplication'][_0x9ea2('0x86')](_0x6197d4,{'transaction':_0x1c1749});});}else{_0xf835c4=0x194;_0x22e671=[];}});})['then'](function(){if(_0xf835c4!==0x194){return db[_0x9ea2('0x87')]['findAndCountAll']({'where':{'FaxAccountId':_0x205c7a},'order':_0x9ea2('0x88')})['then'](function(_0x14bd59){_0x22e671=_0x14bd59;});}})[_0x9ea2('0x2b')](function(_0x3ceeb6){_0xf835c4=0x1f4;logger[_0x9ea2('0x27')](_0x3ceeb6[_0x9ea2('0x3d')]);if(_0x3ceeb6['name']){delete _0x3ceeb6[_0x9ea2('0x3e')];}_0x22e671=_0x3ceeb6;})[_0x9ea2('0x89')](function(){if(_0x22e671===null){_0x3cb70e[_0x9ea2('0x3c')](_0xf835c4);}else{if(_0xf835c4===0x1f4){_0x3cb70e[_0x9ea2('0x2c')](_0xf835c4)[_0x9ea2('0x3f')](_0x22e671);}else{_0x3cb70e[_0x9ea2('0x2c')](_0xf835c4)['json'](_0x22e671);}}});};exports[_0x9ea2('0x8a')]=function(_0x1d924a,_0x76a550,_0x4fc877){var _0x3d25e9={};var _0x825188={};var _0x157be0;var _0x308768;return db['FaxAccount'][_0x9ea2('0x6e')]({'where':{'id':_0x1d924a['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x76a550,null))[_0x9ea2('0x38')](function(_0x52ca79){if(_0x52ca79){_0x157be0=_0x52ca79;_0x825188[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db['FaxApplication'][_0x9ea2('0x5c')]);_0x825188[_0x9ea2('0x47')]=_['keys'](_0x1d924a[_0x9ea2('0x47')]);_0x825188['filters']=_[_0x9ea2('0x4a')](_0x825188[_0x9ea2('0x48')],_0x825188[_0x9ea2('0x47')]);_0x3d25e9[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x825188['model'],qs[_0x9ea2('0x4b')](_0x1d924a[_0x9ea2('0x47')]['fields']));_0x3d25e9[_0x9ea2('0x49')]=_0x3d25e9[_0x9ea2('0x49')]['length']?_0x3d25e9[_0x9ea2('0x49')]:_0x825188[_0x9ea2('0x48')];_0x3d25e9['order']=qs[_0x9ea2('0x4f')](_0x1d924a[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x3d25e9[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x1d924a[_0x9ea2('0x47')],_0x825188[_0x9ea2('0x51')]));if(_0x1d924a[_0x9ea2('0x47')]['filter']){_0x3d25e9[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x3d25e9['where'],{'$or':_[_0x9ea2('0x46')](_0x3d25e9[_0x9ea2('0x49')],function(_0x2e8acb){var _0x257acb={};_0x257acb[_0x2e8acb]={'$like':'%'+_0x1d924a[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0x257acb;})});}_0x3d25e9=_[_0x9ea2('0x53')]({},_0x3d25e9,_0x1d924a[_0x9ea2('0x55')]);return _0x157be0[_0x9ea2('0x8a')](_0x3d25e9);}})[_0x9ea2('0x38')](function(_0x3cab2c){if(_0x3cab2c){_0x308768=_0x3cab2c[_0x9ea2('0x4c')];if(!_0x1d924a[_0x9ea2('0x47')]['hasOwnProperty'](_0x9ea2('0x4d'))){_0x3d25e9[_0x9ea2('0x31')]=qs['limit'](_0x1d924a['query'][_0x9ea2('0x31')]);_0x3d25e9[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x1d924a[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}return _0x157be0[_0x9ea2('0x8a')](_0x3d25e9);}})['then'](function(_0x382f11){if(_0x382f11){return _0x382f11?{'count':_0x308768,'rows':_0x382f11}:null;}})['then'](respondWithResult(_0x76a550,null))[_0x9ea2('0x2b')](handleError(_0x76a550,null));};function Extension(_0x5a733d,_0x374fd2,_0x2f5c60,_0x4f3301){this['context']=_0x9ea2('0x8b');this[_0x9ea2('0x8c')]=_0x5a733d[_0x9ea2('0x8d')];this[_0x9ea2('0x8e')]=_0x4f3301;this['type']=_0x9ea2('0x8f');this['description']=_0x9ea2('0x90');this[_0x9ea2('0x6b')]=_0x5a733d['id'];this[_0x9ea2('0x88')]=_0x374fd2;this[_0x9ea2('0x91')]=_0x2f5c60;}function createExtensionsReciveFax(_0x38f74f){var _0x13fd84=0x1;var _0x34e4a4=[];_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,'',_0x9ea2('0x93')));_0x13fd84+=0x1;_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,_0x9ea2('0x94'),'Set'));_0x13fd84+=0x1;for(var _0x2eeab4 in _0x38f74f){if(_0x38f74f[_0x9ea2('0x6f')](_0x2eeab4)&&(_0x2eeab4==='ecm'||_0x2eeab4===_0x9ea2('0x8d')||_0x2eeab4===_0x9ea2('0x95')||_0x2eeab4===_0x9ea2('0x96')||_0x2eeab4===_0x9ea2('0x97')||_0x2eeab4===_0x9ea2('0x98')||_0x2eeab4===_0x9ea2('0x99')||_0x2eeab4===_0x9ea2('0x9a')||_0x2eeab4===_0x9ea2('0x9b'))){_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,_0x9ea2('0x9c')+_0x2eeab4+')='+_0x38f74f[_0x2eeab4],_0x9ea2('0x9d')));_0x13fd84+=0x1;}}_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,'6',_0x9ea2('0x9e')));_0x13fd84+=0x1;_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,_0x9ea2('0x9f'),_0x9ea2('0xa0')));_0x13fd84=0x0;return _0x34e4a4;}exports[_0x9ea2('0xa1')]=function(_0x14ba7a,_0x47ff6b,_0x2701c3){var _0x4d5318;return db[_0x9ea2('0x82')]['transaction'](function(_0x2b92cf){return db[_0x9ea2('0x43')][_0x9ea2('0x5f')](_0x14ba7a[_0x9ea2('0x60')],{'transaction':_0x2b92cf})['then'](function(_0x4716f9){_0x4d5318=_0x4716f9[_0x9ea2('0x64')]({'plain':!![]});return db[_0x9ea2('0xa2')]['bulkCreate'](createExtensionsReciveFax(_0x4d5318),{'transaction':_0x2b92cf});});})[_0x9ea2('0x38')](function(){return _0x4d5318;})[_0x9ea2('0x38')](respondWithResult(_0x47ff6b,null))[_0x9ea2('0x2b')](handleError(_0x47ff6b,null));};exports[_0x9ea2('0xa3')]=function(_0xe5a30a,_0x30f8ea,_0x4b6396){var _0x2fa701;return db[_0x9ea2('0x82')]['transaction'](function(_0x1a8c7b){return db[_0x9ea2('0x43')][_0x9ea2('0x37')](_0xe5a30a['body'],{'where':{'id':_0xe5a30a[_0x9ea2('0x60')]['id']},'transaction':_0x1a8c7b})[_0x9ea2('0x38')](function(_0x1dc66a){return db[_0x9ea2('0xa2')][_0x9ea2('0x39')]({'where':{'FaxAccountId':_0xe5a30a['body']['id']},'transaction':_0x1a8c7b})['then'](function(_0x54c751){return db[_0x9ea2('0xa2')][_0x9ea2('0x86')](createExtensionsReciveFax(_[_0x9ea2('0x78')](_0xe5a30a['body'],['tech',_0x9ea2('0x45'),'createdAt','updatedAt',_0x9ea2('0xa4'),'ListId'])),{'transaction':_0x1a8c7b});});});})['then'](function(){return db[_0x9ea2('0x43')]['findById'](_0xe5a30a[_0x9ea2('0x60')]['id']);})['then'](respondWithResult(_0x30f8ea,null))['catch'](handleError(_0x30f8ea,null));};exports[_0x9ea2('0xa5')]=function(_0x38b89c,_0x51ea74,_0x2d7cfe){var _0x4dbab7={'raw':!![],'where':{}};var _0x496a5f={};var _0x33e1fe={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x38b89c['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x51ea74,null))[_0x9ea2('0x38')](function(_0x57506a){if(_0x57506a){_0x496a5f[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db['FaxMessage'][_0x9ea2('0x5c')]);_0x496a5f[_0x9ea2('0x47')]=_['keys'](_0x38b89c[_0x9ea2('0x47')]);_0x496a5f[_0x9ea2('0x51')]=_['intersection'](_0x496a5f['model'],_0x496a5f[_0x9ea2('0x47')]);_0x4dbab7[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x496a5f[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x38b89c[_0x9ea2('0x47')]['fields']));_0x4dbab7[_0x9ea2('0x49')]=_0x4dbab7[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x4dbab7[_0x9ea2('0x49')]:_0x496a5f[_0x9ea2('0x48')];if(!_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x4dbab7[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x31')]);_0x4dbab7[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x4dbab7[_0x9ea2('0x4e')]=qs['sort'](_0x38b89c[_0x9ea2('0x47')]['sort']);_0x4dbab7[_0x9ea2('0x50')]=qs['filters'](_[_0x9ea2('0x52')](_0x38b89c['query'],_0x496a5f[_0x9ea2('0x51')]));_0x4dbab7['where']['FaxAccountId']=_0x57506a['id'];if(_0x38b89c['query'][_0x9ea2('0x54')]){_0x4dbab7['where']=_[_0x9ea2('0x53')](_0x4dbab7[_0x9ea2('0x50')],{'$or':_['map'](_0x4dbab7[_0x9ea2('0x49')],function(_0x4eb1c7){var _0x50b102={};_0x50b102[_0x4eb1c7]={'$like':'%'+_0x38b89c[_0x9ea2('0x47')]['filter']+'%'};return _0x50b102;})});}if(_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0xa6')]){var _0x4a7f07=_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0xa6')]['split'](',');var _0x5c9f56={};_0x5c9f56[_0x4a7f07[0x0]]={'$gte':moment(_0x4a7f07[0x1])[_0x9ea2('0xa7')](_0x9ea2('0xa8'))};_0x4dbab7[_0x9ea2('0x50')]=_['merge'](_0x4dbab7[_0x9ea2('0x50')],_0x5c9f56);}_0x4dbab7=_[_0x9ea2('0x53')]({},_0x4dbab7,_0x38b89c[_0x9ea2('0x55')]);return db[_0x9ea2('0xa9')][_0x9ea2('0x32')]({'where':_0x4dbab7[_0x9ea2('0x50')]})[_0x9ea2('0x38')](function(_0x143abd){_0x33e1fe[_0x9ea2('0x32')]=_0x143abd;if(_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x56')]){_0x4dbab7[_0x9ea2('0x57')]=[{'all':!![]}];}return db[_0x9ea2('0xa9')][_0x9ea2('0x58')](_0x4dbab7);})[_0x9ea2('0x38')](function(_0x42da60){_0x33e1fe['rows']=_0x42da60;return _0x33e1fe;});}})['then'](respondWithFilteredResult(_0x51ea74,_0x4dbab7))[_0x9ea2('0x2b')](handleError(_0x51ea74,null));};exports[_0x9ea2('0x3f')]=function(_0x4a8f3a,_0xd27033,_0x6a42da){var _0xe9aff7,_0x5d0109={},_0x43187b;if(_0x4a8f3a[_0x9ea2('0x60')]['to']){_0x43187b=_0x4a8f3a['body']['to'][0x0];}return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x4a8f3a[_0x9ea2('0x5b')]['id']},'include':[{'model':db[_0x9ea2('0xaa')],'as':_0x9ea2('0xab'),'include':[{'model':db['CmContact'],'as':_0x9ea2('0xac'),'where':{'fax':_0x43187b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x9ea2('0x38')](handleEntityNotFound(_0xd27033,null))[_0x9ea2('0x38')](function(_0x43d14a){_0xe9aff7=_0x43d14a;if(_0x4a8f3a['body'][_0x9ea2('0xad')]&&_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][_0x9ea2('0x4c')]){for(var _0x215111=0x0;_0x215111<_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][_0x9ea2('0x4c')];_0x215111+=0x1){_0x4a8f3a['body'][_0x9ea2('0xad')][_0x215111]={'filename':_0x4a8f3a['body'][_0x9ea2('0xad')][_0x215111][_0x9ea2('0x3e')],'id':_0x4a8f3a[_0x9ea2('0x60')]['attachments'][_0x215111]['id'],'path':path[_0x9ea2('0xae')](config[_0x9ea2('0xaf')],'server/files/attachments',_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][_0x215111][_0x9ea2('0xb0')])};}}return respondWithRpcPromise(_0x9ea2('0xb1'),_0x9ea2('0xb1'),{'FaxAccountId':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x5b')]['id'])?undefined:_0x4a8f3a[_0x9ea2('0x5b')]['id'],'path':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x60')]['attachments'][0x0][_0x9ea2('0xb3')])?undefined:_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][0x0][_0x9ea2('0xb3')],'fax':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0])?undefined:_0x4a8f3a['body']['to'][0x0]},client9002);})[_0x9ea2('0x38')](function(){if(_0xe9aff7){if(_['isNil'](_0x4a8f3a[_0x9ea2('0x60')]['from'])){_0x4a8f3a['body'][_0x9ea2('0xb4')]=util[_0x9ea2('0xa7')](_0x9ea2('0xb5'),_0xe9aff7[_0x9ea2('0x3e')],_0xe9aff7[_0x9ea2('0xb6')]);}if(_0xe9aff7[_0x9ea2('0xab')]){if(_0xe9aff7[_0x9ea2('0xab')][_0x9ea2('0xac')]['length']){return _0xe9aff7[_0x9ea2('0xab')][_0x9ea2('0xac')][0x0];}else{return db[_0x9ea2('0xb7')][_0x9ea2('0x5f')](_[_0x9ea2('0x1a')](_0x4a8f3a[_0x9ea2('0x60')],{'firstName':_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'phone':_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'fax':_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'ListId':_0xe9aff7[_0x9ea2('0xb8')]}));}}else{throw new Error(_0x9ea2('0xb9'));}}else{throw new Error(_0x9ea2('0xba'));}})[_0x9ea2('0x38')](function(_0x2ba120){if(_0x2ba120){return db[_0x9ea2('0x77')][_0x9ea2('0x5e')]({'where':{'ContactId':_0x2ba120['id'],'closed':![],'FaxAccountId':_0xe9aff7['id']}})['then'](function(_0x46a3f7){if(_0x46a3f7){return[_0x46a3f7,![]];}return db['FaxInteraction'][_0x9ea2('0x5f')]({'UserId':_0x4a8f3a[_0x9ea2('0x61')]['id'],'ContactId':_0x2ba120['id'],'FaxAccountId':_0xe9aff7['id'],'fax':_0x4a8f3a['body']['to'][0x0],'firstMsgDirection':_0x9ea2('0xbb'),'Messages':[_[_0x9ea2('0x53')](_0x4a8f3a[_0x9ea2('0x60')],{'read':![],'body':_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][0x0]['filename'],'FaxAccountId':_0xe9aff7['id'],'UserId':_0x4a8f3a[_0x9ea2('0x61')]['id'],'ContactId':_0x2ba120['id'],'AttachmentId':_0x4a8f3a['body'][_0x9ea2('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x9ea2('0xa9')],'as':_0x9ea2('0xbc')}]})[_0x9ea2('0x38')](function(_0x2b9e82){return[_0x2b9e82,!![]];});});}else{throw new Error(_0x9ea2('0xbd'));}})[_0x9ea2('0xbe')](function(_0x3f3b9a,_0x2ebfed){if(_0x2ebfed){return _0x3f3b9a;}return db[_0x9ea2('0xa9')]['create']({'direction':_0x9ea2('0xbb'),'read':![],'body':_0x4a8f3a['body']['attachments'][0x0][_0x9ea2('0xbf')],'FaxAccountId':_0xe9aff7['id'],'FaxInteractionId':_0x3f3b9a['id'],'UserId':_0x4a8f3a[_0x9ea2('0x61')]['id'],'ContactId':_0x3f3b9a['ContactId'],'AttachmentId':_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][0x0]['id']})[_0x9ea2('0x38')](function(_0x53ff23){_0x3f3b9a[_0x9ea2('0xc0')][_0x9ea2('0xbc')]=[];_0x3f3b9a[_0x9ea2('0xc0')]['Messages'][_0x9ea2('0x92')](_0x53ff23['dataValues']);return _0x3f3b9a;});})[_0x9ea2('0x38')](function(_0x4f5d0c){respondWithRpcPromise(_0x9ea2('0xc1'),_0x9ea2('0xc1'),{'FaxAccountId':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x5b')]['id'])?undefined:_0x4a8f3a['params']['id'],'path':_[_0x9ea2('0xb2')](_0x4a8f3a['body'][_0x9ea2('0xad')][0x0][_0x9ea2('0xb3')])?undefined:_0x4a8f3a['body'][_0x9ea2('0xad')][0x0][_0x9ea2('0xb3')],'fax':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0])?undefined:_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'AttachmentId':_0x4a8f3a[_0x9ea2('0x60')]['attachments'][0x0]['id']},client9002)['then'](function(_0x131012){logger[_0x9ea2('0x22')]('SendFaxRpc,\x20%s',_0x131012);})['catch'](function(_0x2bbe67){logger[_0x9ea2('0x22')](_0x9ea2('0xc2'),_0x2bbe67);});return _0x4f5d0c;})[_0x9ea2('0x38')](respondWithResult(_0xd27033,null))['catch'](handleError(_0xd27033,null));};exports['addAgents']=function(_0x16a584,_0x52cf68,_0x5b6799){return db['FaxAccount']['find']({'where':{'id':_0x16a584['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x52cf68,null))['then'](function(_0x5265ba){if(_0x5265ba){return _0x5265ba[_0x9ea2('0xc3')](_0x16a584['body'][_0x9ea2('0x71')],_[_0x9ea2('0x78')](_0x16a584[_0x9ea2('0x60')],[_0x9ea2('0x71'),'id'])||{})[_0x9ea2('0xbe')](function(_0x280d7e){for(var _0x87831=0x0;_0x87831<_0x16a584[_0x9ea2('0x60')][_0x9ea2('0x71')]['length'];_0x87831+=0x1){socket['emit'](_0x9ea2('0xc4'),{'UserId':Number(_0x16a584[_0x9ea2('0x60')]['ids'][_0x87831]),'FaxAccountId':Number(_0x16a584[_0x9ea2('0x5b')]['id'])});}return _0x280d7e;});}})[_0x9ea2('0x38')](respondWithResult(_0x52cf68,null))['catch'](handleError(_0x52cf68,null));};exports[_0x9ea2('0xc5')]=function(_0x3ca842,_0x1dad9f,_0x345f91){return db[_0x9ea2('0x43')]['find']({'where':{'id':_0x3ca842['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x1dad9f,null))['then'](function(_0x10b659){if(_0x10b659){return _0x10b659[_0x9ea2('0xc5')](_0x3ca842['query'][_0x9ea2('0x71')])[_0x9ea2('0x38')](function(){if(_['isArray'](_0x3ca842[_0x9ea2('0x47')][_0x9ea2('0x71')])){for(var _0x32a774=0x0;_0x32a774<_0x3ca842[_0x9ea2('0x47')][_0x9ea2('0x71')][_0x9ea2('0x4c')];_0x32a774+=0x1){socket[_0x9ea2('0xc6')]('userFaxAccount:remove',{'UserId':Number(_0x3ca842[_0x9ea2('0x47')][_0x9ea2('0x71')][_0x32a774]),'FaxAccountId':Number(_0x3ca842[_0x9ea2('0x5b')]['id'])});}}else{socket[_0x9ea2('0xc6')]('userFaxAccount:remove',{'UserId':Number(_0x3ca842['query'][_0x9ea2('0x71')]),'FaxAccountId':Number(_0x3ca842['params']['id'])});}});}})[_0x9ea2('0x38')](respondWithStatusCode(_0x1dad9f,null))[_0x9ea2('0x2b')](handleError(_0x1dad9f,null));};exports[_0x9ea2('0xc7')]=function(_0x1fb5eb,_0x52c50b,_0x371cd1){var _0x567bcc={};var _0x1aa9dd={};var _0x24125c;var _0xfa20ba;return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x1fb5eb[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x52c50b,null))['then'](function(_0x340ff2){if(_0x340ff2){_0x24125c=_0x340ff2;_0x1aa9dd['model']=_[_0x9ea2('0x5d')](db['User'][_0x9ea2('0x5c')]);_0x1aa9dd[_0x9ea2('0x47')]=_['keys'](_0x1fb5eb['query']);_0x1aa9dd['filters']=_['intersection'](_0x1aa9dd[_0x9ea2('0x48')],_0x1aa9dd[_0x9ea2('0x47')]);_0x567bcc[_0x9ea2('0x49')]=_['intersection'](_0x1aa9dd[_0x9ea2('0x48')],qs['fields'](_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x4b')]));_0x567bcc[_0x9ea2('0x49')]=_0x567bcc[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x567bcc['attributes']:_0x1aa9dd[_0x9ea2('0x48')];_0x567bcc['order']=qs['sort'](_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x567bcc['where']=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x1fb5eb[_0x9ea2('0x47')],_0x1aa9dd[_0x9ea2('0x51')]));if(_0x1fb5eb['query'][_0x9ea2('0x54')]){_0x567bcc['where']=_[_0x9ea2('0x53')](_0x567bcc[_0x9ea2('0x50')],{'$or':_[_0x9ea2('0x46')](_0x567bcc[_0x9ea2('0x49')],function(_0x484ade){var _0x2a9977={};_0x2a9977[_0x484ade]={'$like':'%'+_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0x2a9977;})});}_0x567bcc=_[_0x9ea2('0x53')]({},_0x567bcc,_0x1fb5eb[_0x9ea2('0x55')]);return _0x24125c[_0x9ea2('0xc7')](_0x567bcc);}})['then'](function(_0x584d79){if(_0x584d79){_0xfa20ba=_0x584d79['length'];if(!_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x567bcc[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x1fb5eb['query']['limit']);_0x567bcc[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x1fb5eb[_0x9ea2('0x47')]['offset']);}return _0x24125c[_0x9ea2('0xc7')](_0x567bcc);}})[_0x9ea2('0x38')](function(_0x56a1b7){if(_0x56a1b7){return _0x56a1b7?{'count':_0xfa20ba,'rows':_0x56a1b7}:null;}})[_0x9ea2('0x38')](respondWithResult(_0x52c50b,null))[_0x9ea2('0x2b')](handleError(_0x52c50b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4c1109f..3cf1054 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 _0xeb7e=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x1c55cf,_0xb7f596){var _0x221da7=function(_0x4d46fc){while(--_0x4d46fc){_0x1c55cf['push'](_0x1c55cf['shift']());}};_0x221da7(++_0xb7f596);}(_0xeb7e,0x1f2));var _0xeeb7=function(_0x1217a4,_0x5d603f){_0x1217a4=_0x1217a4-0x0;var _0x898fb2=_0xeb7e[_0x1217a4];return _0x898fb2;};'use strict';var EventEmitter=require(_0xeeb7('0x0'));var FaxAccount=require(_0xeeb7('0x1'))['db'][_0xeeb7('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xeeb7('0x3')](0x0);var events={'afterCreate':_0xeeb7('0x4'),'afterUpdate':_0xeeb7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23c03f){return function(_0x277faa,_0x198cd2,_0x5e0121){FaxAccountEvents[_0xeeb7('0x6')](_0x23c03f+':'+_0x277faa['id'],_0x277faa);FaxAccountEvents[_0xeeb7('0x6')](_0x23c03f,_0x277faa);_0x5e0121(null);};}for(var e in events){if(events[_0xeeb7('0x7')](e)){var event=events[e];FaxAccount[_0xeeb7('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x8731=['save','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x8731,0x193));var _0x1873=function(_0x3fec83,_0x59591f){_0x3fec83=_0x3fec83-0x0;var _0x5b37dd=_0x8731[_0x3fec83];return _0x5b37dd;};'use strict';var EventEmitter=require(_0x1873('0x0'));var FaxAccount=require(_0x1873('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1873('0x2')](0x0);var events={'afterCreate':_0x1873('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a77d3){return function(_0x4cb726,_0x1ba46e,_0x49835a){FaxAccountEvents['emit'](_0x4a77d3+':'+_0x4cb726['id'],_0x4cb726);FaxAccountEvents['emit'](_0x4a77d3,_0x4cb726);_0x49835a(null);};}for(var e in events){if(events[_0x1873('0x4')](e)){var event=events[e];FaxAccount[_0x1873('0x5')](e,emitEvent(event));}}module[_0x1873('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 6a1bcb1..e6d9006 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 _0x6d0d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0x51d848,_0x1bf713){var _0x49cda1=function(_0x14dbc5){while(--_0x14dbc5){_0x51d848['push'](_0x51d848['shift']());}};_0x49cda1(++_0x1bf713);}(_0x6d0d,0x98));var _0xd6d0=function(_0xb2747b,_0x23e7e2){_0xb2747b=_0xb2747b-0x0;var _0x3590f1=_0x6d0d[_0xb2747b];return _0x3590f1;};'use strict';var _=require(_0xd6d0('0x0'));var util=require(_0xd6d0('0x1'));var logger=require(_0xd6d0('0x2'))('api');var moment=require(_0xd6d0('0x3'));var BPromise=require(_0xd6d0('0x4'));var rp=require(_0xd6d0('0x5'));var fs=require('fs');var path=require(_0xd6d0('0x6'));var rimraf=require(_0xd6d0('0x7'));var config=require(_0xd6d0('0x8'));var attributes=require('./faxAccount.attributes');module[_0xd6d0('0x9')]=function(_0x1af16a,_0x44da74){return _0x1af16a[_0xd6d0('0xa')](_0xd6d0('0xb'),attributes,{'tableName':_0xd6d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x876b=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x3c0c9e,_0x3ecdee){var _0x5ba5fe=function(_0x1f4a60){while(--_0x1f4a60){_0x3c0c9e['push'](_0x3c0c9e['shift']());}};_0x5ba5fe(++_0x3ecdee);}(_0x876b,0x78));var _0xb876=function(_0x2dacf3,_0x135506){_0x2dacf3=_0x2dacf3-0x0;var _0x5c64ac=_0x876b[_0x2dacf3];return _0x5c64ac;};'use strict';var _=require(_0xb876('0x0'));var util=require(_0xb876('0x1'));var logger=require(_0xb876('0x2'))('api');var moment=require(_0xb876('0x3'));var BPromise=require('bluebird');var rp=require(_0xb876('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb876('0x5'));var config=require(_0xb876('0x6'));var attributes=require(_0xb876('0x7'));module[_0xb876('0x8')]=function(_0x5aea53,_0x5890ea){return _0x5aea53[_0xb876('0x9')](_0xb876('0xa'),attributes,{'tableName':_0xb876('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 6cd339e..f02199c 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 _0x5166=['includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','account','CmList','List','CmContact','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','create','find','Contact\x20not\x20found','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','include','map','model','attributes','GetFaxAccount','debug','NotifyFaxAccount','body','fax','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize'];(function(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0x5166,0x196));var _0x6516=function(_0x4c4fb1,_0x3a5db2){_0x4c4fb1=_0x4c4fb1-0x0;var _0x5105ff=_0x5166[_0x4c4fb1];return _0x5105ff;};'use strict';var _=require(_0x6516('0x0'));var util=require(_0x6516('0x1'));var moment=require(_0x6516('0x2'));var BPromise=require(_0x6516('0x3'));var rs=require(_0x6516('0x4'));var fs=require('fs');var Redis=require(_0x6516('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6516('0x6'));var logger=require(_0x6516('0x7'))(_0x6516('0x8'));var config=require(_0x6516('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6516('0xa')]['http']({'port':0x232c});config[_0x6516('0xb')]=_[_0x6516('0xc')](config[_0x6516('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6516('0xd'))(new Redis(config[_0x6516('0xb')]));require(_0x6516('0xe'))[_0x6516('0xf')](socket);function respondWithRpcPromise(_0x591a64,_0x362cea,_0x6b4de2){return new BPromise(function(_0x301381,_0x39bed6){return client[_0x6516('0x10')](_0x591a64,_0x6b4de2)[_0x6516('0x11')](function(_0x50d375){logger[_0x6516('0x12')](_0x6516('0x13'),_0x362cea,'request\x20sent');logger['debug'](_0x6516('0x14'),_0x362cea,_0x6516('0x15'),JSON[_0x6516('0x16')](_0x50d375));if(_0x50d375[_0x6516('0x17')]){if(_0x50d375['error'][_0x6516('0x18')]===0x1f4){logger[_0x6516('0x17')](_0x6516('0x13'),_0x362cea,_0x50d375['error'][_0x6516('0x19')]);return _0x39bed6(_0x50d375[_0x6516('0x17')][_0x6516('0x19')]);}logger[_0x6516('0x17')](_0x6516('0x13'),_0x362cea,_0x50d375[_0x6516('0x17')]['message']);return _0x301381(_0x50d375['error'][_0x6516('0x19')]);}else{logger[_0x6516('0x12')]('FaxAccount,\x20%s,\x20%s',_0x362cea,_0x6516('0x15'));_0x301381(_0x50d375[_0x6516('0x1a')][_0x6516('0x19')]);}})[_0x6516('0x1b')](function(_0x4a523a){logger[_0x6516('0x17')](_0x6516('0x13'),_0x362cea,_0x4a523a);_0x39bed6(_0x4a523a);});});}exports['GetFaxAccount']=function(_0x1beca2){var _0x506b0b=this;return new Promise(function(_0x14bc2b,_0x37733a){return db['FaxAccount'][_0x6516('0x1c')]({'raw':_0x1beca2[_0x6516('0x1d')]?_0x1beca2[_0x6516('0x1d')][_0x6516('0x1e')]===undefined?!![]:![]:!![],'where':_0x1beca2['options']?_0x1beca2[_0x6516('0x1d')][_0x6516('0x1f')]||null:null,'attributes':_0x1beca2['options']?_0x1beca2[_0x6516('0x1d')]['attributes']||null:null,'limit':_0x1beca2[_0x6516('0x1d')]?_0x1beca2[_0x6516('0x1d')]['limit']||null:null,'include':_0x1beca2[_0x6516('0x1d')]?_0x1beca2['options'][_0x6516('0x20')]?_[_0x6516('0x21')](_0x1beca2[_0x6516('0x1d')]['include'],function(_0x223147){return{'model':db[_0x223147[_0x6516('0x22')]],'as':_0x223147['as'],'attributes':_0x223147[_0x6516('0x23')],'include':_0x223147['include']?_['map'](_0x223147['include'],function(_0x4bcda2){return{'model':db[_0x4bcda2[_0x6516('0x22')]],'as':_0x4bcda2['as'],'attributes':_0x4bcda2[_0x6516('0x23')],'include':_0x4bcda2['include']?_[_0x6516('0x21')](_0x4bcda2[_0x6516('0x20')],function(_0x21db4b){return{'model':db[_0x21db4b['model']],'as':_0x21db4b['as'],'attributes':_0x21db4b[_0x6516('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6804c0){logger[_0x6516('0x12')](_0x6516('0x24'),_0x1beca2);logger[_0x6516('0x25')]('GetFaxAccount',_0x1beca2,JSON[_0x6516('0x16')](_0x6804c0));_0x14bc2b(_0x6804c0);})[_0x6516('0x1b')](function(_0x1fee38){logger['error'](_0x6516('0x24'),_0x1fee38['message'],_0x1beca2);_0x37733a(_0x506b0b[_0x6516('0x17')](0x1f4,_0x1fee38[_0x6516('0x19')]));});});};exports[_0x6516('0x26')]=function(_0x10f337,_0x341c35,_0x4e229e){var _0x1e32cc=this;return new Promise(function(_0x5cd452,_0x5ec3c6){var _0x9c1fad={'body':_0x10f337[_0x6516('0x27')],'channel':_0x6516('0x28')};var _0x6c6c52=[];var _0x2363d=[];var _0x2b98d6={};return db['CmContact'][_0x6516('0x29')]()[_0x6516('0x11')](function(_0x5d60be){if(!_0x5d60be){throw new db['Sequelize'][(_0x6516('0x2a'))](_0x6516('0x2b'));}_0x6c6c52=_['difference'](_[_0x6516('0x2c')](_0x5d60be),[_0x6516('0x2d'),'updatedAt']);_0x2363d=_['difference'](_[_0x6516('0x2c')](_0x5d60be),[_0x6516('0x2d'),_0x6516('0x2e'),_0x6516('0x2f'),_0x6516('0x30')]);if(_0x10f337[_0x6516('0x27')]['id']){delete _0x10f337['body']['id'];}if(_[_0x6516('0x31')](_0x10f337[_0x6516('0x27')]['from'])){throw new db['Sequelize'][(_0x6516('0x2a'))](_0x6516('0x32'));}if(_[_0x6516('0x31')](_0x10f337[_0x6516('0x27')][_0x6516('0x27')])||_0x10f337[_0x6516('0x27')][_0x6516('0x27')]===''){throw new db['Sequelize'][(_0x6516('0x2a'))](_0x6516('0x33'));}if(_['isNil'](_0x10f337[_0x6516('0x27')][_0x6516('0x34')])){throw new db[(_0x6516('0x35'))][(_0x6516('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2363d);}if(!_[_0x6516('0x36')](_0x2363d,_0x10f337['body'][_0x6516('0x34')])){throw new db[(_0x6516('0x35'))][(_0x6516('0x2a'))](_0x6516('0x37')+_0x2363d);}_0x2b98d6[_0x10f337['body'][_0x6516('0x34')]]=_0x10f337[_0x6516('0x27')][_0x6516('0x38')];})[_0x6516('0x11')](function(){return db[_0x6516('0x39')]['find']({'where':{'id':_0x10f337[_0x6516('0x3a')]['id']},'include':[{'model':db[_0x6516('0x3b')],'as':_0x6516('0x3c'),'include':[{'model':db[_0x6516('0x3d')],'as':'Contacts','where':_0x2b98d6,'limit':0x1,'order':[[_0x6516('0x2e'),_0x6516('0x3e')]]}]},{'model':db[_0x6516('0x3f')],'as':_0x6516('0x40')}]});})['then'](function(_0x29ed69){if(_0x29ed69&&_0x29ed69['List']){var _0x17baca=_0x29ed69[_0x6516('0x41')]({'plain':!![]});_0x9c1fad['account']=_0x17baca;_0x9c1fad[_0x6516('0x42')]=_0x17baca[_0x6516('0x40')];_0x9c1fad[_0x6516('0x43')]=_0x17baca[_0x6516('0x3c')];_0x9c1fad[_0x6516('0x42')]=_[_0x6516('0x44')](_0x9c1fad['applications'],[_0x6516('0x45')],[_0x6516('0x46')]);if(_0x9c1fad[_0x6516('0x3a')][_0x6516('0x40')]){delete _0x9c1fad[_0x6516('0x3a')][_0x6516('0x40')];}if(_0x9c1fad[_0x6516('0x3a')][_0x6516('0x3c')]&&_0x9c1fad[_0x6516('0x3a')][_0x6516('0x3c')][_0x6516('0x47')][_0x6516('0x48')]){return _0x9c1fad[_0x6516('0x3a')]['List'][_0x6516('0x47')][0x0];}var _0x259c0b=_[_0x6516('0xc')](_0x10f337[_0x6516('0x27')],{'firstName':_0x10f337[_0x6516('0x27')]['from'],'ListId':_0x17baca['ListId']});_0x259c0b[_0x10f337['body'][_0x6516('0x34')]]=_0x10f337[_0x6516('0x27')][_0x6516('0x38')];return db['CmContact'][_0x6516('0x49')](_0x259c0b,{'fields':_0x6c6c52,'raw':!![]});}})[_0x6516('0x11')](function(_0x532409){_0x9c1fad['contact']=_0x532409;if(_0x532409){var _0xaa1f43={'ContactId':_0x532409['id'],'FaxAccountId':_0x10f337[_0x6516('0x3a')]['id'],'fax':_0x532409['fax']};return db['FaxInteraction'][_0x6516('0x4a')]({'where':{'ContactId':_0x532409['id'],'closed':![],'FaxAccountId':_0x10f337[_0x6516('0x3a')]['id']}})[_0x6516('0x11')](function(_0x5ee6fa){if(_0x5ee6fa){return[_0x5ee6fa,![]];}return db['FaxInteraction'][_0x6516('0x49')](_0xaa1f43)[_0x6516('0x11')](function(_0x57a506){return[_0x57a506,!![]];});});}else{throw new Error(_0x6516('0x4b'));}})['spread'](function(_0xbf8b13,_0x1dcc22){var _0x1b615a=_0xbf8b13[_0x6516('0x41')]({'plain':!![]});if(_0x1dcc22){if(_0x9c1fad['account'][_0x6516('0x4c')]){_0x9c1fad['applications']['push']({'id':0x0,'priority':_0x9c1fad[_0x6516('0x42')][_0x6516('0x48')]+0x1,'app':_0x6516('0x4d'),'appdata':_0x6516('0x4e'),'interval':_0x6516('0x4f')});}_0x1b615a[_0x6516('0x50')]=!![];}else{_0x1b615a[_0x6516('0x50')]=![];}_0x9c1fad[_0x6516('0x51')]=_0x1b615a;return db[_0x6516('0x52')][_0x6516('0x49')]({'body':_0x10f337[_0x6516('0x27')][_0x6516('0x27')],'FaxAccountId':_0x10f337['account']['id'],'FaxInteractionId':_0xbf8b13['id'],'direction':'in','ContactId':_0xbf8b13[_0x6516('0x53')],'AttachmentId':_0x10f337[_0x6516('0x27')][_0x6516('0x54')]});})[_0x6516('0x11')](function(_0x2e8d01){_0x9c1fad[_0x6516('0x19')]=_0x2e8d01;if(_0x9c1fad[_0x6516('0x51')]['UserId']){return db[_0x6516('0x55')]['find']({'attributes':['id',_0x6516('0x56')],'where':{'id':_0x9c1fad[_0x6516('0x51')][_0x6516('0x57')]}})[_0x6516('0x11')](function(_0x1d9a58){if(_0x1d9a58){_0x9c1fad['applications'][_0x6516('0x58')]({'id':0x0,'priority':0x0,'app':_0x6516('0x59'),'appdata':_0x1d9a58[_0x6516('0x56')]+','+(_0x9c1fad['account']['waitForTheAssignedAgent']||0xa),'interval':_0x6516('0x4f')});}return respondWithRpcPromise(_0x6516('0x5a'),'startRouting',_0x9c1fad);});}return respondWithRpcPromise('Start',_0x6516('0x5b'),_0x9c1fad);})[_0x6516('0x11')](function(_0x11f798){_0x5cd452(_0x11f798);})['catch'](function(_0x357305){_0x5ec3c6(_0x1e32cc[_0x6516('0x17')](0x1f4,_0x357305[_0x6516('0x19')]));});});}; \ No newline at end of file +var _0x008b=['ContactId','AttachmentId','UserId','name','agent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','NotifyFaxAccount','body','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','priority','asc','length','CmContact','create','contact','fax','FaxInteraction','find','Contact\x20not\x20found','push','unmanaged','*,*,*,*','created','interaction','FaxMessage'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x008b,0x1c4));var _0xb008=function(_0x1bfd60,_0x11cad){_0x1bfd60=_0x1bfd60-0x0;var _0x168c28=_0x008b[_0x1bfd60];return _0x168c28;};'use strict';var _=require(_0xb008('0x0'));var util=require(_0xb008('0x1'));var moment=require(_0xb008('0x2'));var BPromise=require('bluebird');var rs=require(_0xb008('0x3'));var fs=require('fs');var Redis=require(_0xb008('0x4'));var db=require(_0xb008('0x5'))['db'];var utils=require(_0xb008('0x6'));var logger=require('../../config/logger')(_0xb008('0x7'));var config=require(_0xb008('0x8'));var jayson=require(_0xb008('0x9'));var client=jayson[_0xb008('0xa')][_0xb008('0xb')]({'port':0x232c});config[_0xb008('0xc')]=_[_0xb008('0xd')](config[_0xb008('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb008('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1cb2f6,_0x409199,_0xd9d3a1){return new BPromise(function(_0x88b469,_0x33c44e){return client[_0xb008('0xf')](_0x1cb2f6,_0xd9d3a1)[_0xb008('0x10')](function(_0x11967a){logger[_0xb008('0x11')]('FaxAccount,\x20%s,\x20%s',_0x409199,_0xb008('0x12'));logger[_0xb008('0x13')](_0xb008('0x14'),_0x409199,'request\x20sent',JSON[_0xb008('0x15')](_0x11967a));if(_0x11967a[_0xb008('0x16')]){if(_0x11967a[_0xb008('0x16')]['code']===0x1f4){logger[_0xb008('0x16')]('FaxAccount,\x20%s,\x20%s',_0x409199,_0x11967a[_0xb008('0x16')]['message']);return _0x33c44e(_0x11967a[_0xb008('0x16')][_0xb008('0x17')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x409199,_0x11967a[_0xb008('0x16')]['message']);return _0x88b469(_0x11967a[_0xb008('0x16')][_0xb008('0x17')]);}else{logger[_0xb008('0x11')](_0xb008('0x18'),_0x409199,'request\x20sent');_0x88b469(_0x11967a[_0xb008('0x19')][_0xb008('0x17')]);}})[_0xb008('0x1a')](function(_0x1845b5){logger['error'](_0xb008('0x18'),_0x409199,_0x1845b5);_0x33c44e(_0x1845b5);});});}exports[_0xb008('0x1b')]=function(_0x3132dc){var _0x495747=this;return new Promise(function(_0xff03a1,_0x3c4cd5){return db[_0xb008('0x1c')][_0xb008('0x1d')]({'raw':_0x3132dc[_0xb008('0x1e')]?_0x3132dc[_0xb008('0x1e')][_0xb008('0x1f')]===undefined?!![]:![]:!![],'where':_0x3132dc['options']?_0x3132dc[_0xb008('0x1e')][_0xb008('0x20')]||null:null,'attributes':_0x3132dc['options']?_0x3132dc['options']['attributes']||null:null,'limit':_0x3132dc[_0xb008('0x1e')]?_0x3132dc[_0xb008('0x1e')][_0xb008('0x21')]||null:null,'include':_0x3132dc[_0xb008('0x1e')]?_0x3132dc[_0xb008('0x1e')][_0xb008('0x22')]?_[_0xb008('0x23')](_0x3132dc[_0xb008('0x1e')]['include'],function(_0x539296){return{'model':db[_0x539296[_0xb008('0x24')]],'as':_0x539296['as'],'attributes':_0x539296[_0xb008('0x25')],'include':_0x539296[_0xb008('0x22')]?_[_0xb008('0x23')](_0x539296[_0xb008('0x22')],function(_0x370953){return{'model':db[_0x370953[_0xb008('0x24')]],'as':_0x370953['as'],'attributes':_0x370953[_0xb008('0x25')],'include':_0x370953[_0xb008('0x22')]?_[_0xb008('0x23')](_0x370953['include'],function(_0x2fa9f8){return{'model':db[_0x2fa9f8[_0xb008('0x24')]],'as':_0x2fa9f8['as'],'attributes':_0x2fa9f8[_0xb008('0x25')]};}):[]};}):[]};}):[]:[]})[_0xb008('0x10')](function(_0xddafa5){logger[_0xb008('0x11')](_0xb008('0x1b'),_0x3132dc);logger[_0xb008('0x13')](_0xb008('0x1b'),_0x3132dc,JSON[_0xb008('0x15')](_0xddafa5));_0xff03a1(_0xddafa5);})[_0xb008('0x1a')](function(_0x415f19){logger[_0xb008('0x16')](_0xb008('0x1b'),_0x415f19[_0xb008('0x17')],_0x3132dc);_0x3c4cd5(_0x495747[_0xb008('0x16')](0x1f4,_0x415f19[_0xb008('0x17')]));});});};exports[_0xb008('0x26')]=function(_0x5f1a25,_0x21cf7c,_0x1074b2){var _0x49d04c=this;return new Promise(function(_0x1df491,_0x96274a){var _0x5bf4bc={'body':_0x5f1a25[_0xb008('0x27')],'channel':'fax'};var _0x49148b=[];var _0x3a76ae=[];var _0x26ccc4={};return db['CmContact']['describe']()[_0xb008('0x10')](function(_0x368839){if(!_0x368839){throw new db[(_0xb008('0x28'))][(_0xb008('0x29'))](_0xb008('0x2a'));}_0x49148b=_[_0xb008('0x2b')](_['keys'](_0x368839),[_0xb008('0x2c'),_0xb008('0x2d')]);_0x3a76ae=_[_0xb008('0x2b')](_['keys'](_0x368839),['createdAt',_0xb008('0x2d'),_0xb008('0x2e'),_0xb008('0x2f')]);if(_0x5f1a25[_0xb008('0x27')]['id']){delete _0x5f1a25['body']['id'];}if(_['isNil'](_0x5f1a25['body']['from'])){throw new db['Sequelize']['ValidationError'](_0xb008('0x30'));}if(_[_0xb008('0x31')](_0x5f1a25[_0xb008('0x27')][_0xb008('0x27')])||_0x5f1a25[_0xb008('0x27')][_0xb008('0x27')]===''){throw new db[(_0xb008('0x28'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5f1a25[_0xb008('0x27')][_0xb008('0x32')])){throw new db[(_0xb008('0x28'))]['ValidationError'](_0xb008('0x33')+_0x3a76ae);}if(!_[_0xb008('0x34')](_0x3a76ae,_0x5f1a25[_0xb008('0x27')][_0xb008('0x32')])){throw new db['Sequelize'][(_0xb008('0x29'))](_0xb008('0x35')+_0x3a76ae);}_0x26ccc4[_0x5f1a25[_0xb008('0x27')]['mapKey']]=_0x5f1a25[_0xb008('0x27')][_0xb008('0x36')];})['then'](function(){return db[_0xb008('0x1c')]['find']({'where':{'id':_0x5f1a25[_0xb008('0x37')]['id']},'include':[{'model':db[_0xb008('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb008('0x39'),'where':_0x26ccc4,'limit':0x1,'order':[['updatedAt',_0xb008('0x3a')]]}]},{'model':db[_0xb008('0x3b')],'as':_0xb008('0x3c')}]});})['then'](function(_0x3ceb9f){if(_0x3ceb9f&&_0x3ceb9f[_0xb008('0x3d')]){var _0x183e1a=_0x3ceb9f[_0xb008('0x3e')]({'plain':!![]});_0x5bf4bc[_0xb008('0x37')]=_0x183e1a;_0x5bf4bc[_0xb008('0x3f')]=_0x183e1a[_0xb008('0x3c')];_0x5bf4bc[_0xb008('0x40')]=_0x183e1a[_0xb008('0x3d')];_0x5bf4bc[_0xb008('0x3f')]=_[_0xb008('0x41')](_0x5bf4bc[_0xb008('0x3f')],[_0xb008('0x42')],[_0xb008('0x43')]);if(_0x5bf4bc[_0xb008('0x37')][_0xb008('0x3c')]){delete _0x5bf4bc[_0xb008('0x37')][_0xb008('0x3c')];}if(_0x5bf4bc[_0xb008('0x37')][_0xb008('0x3d')]&&_0x5bf4bc[_0xb008('0x37')][_0xb008('0x3d')][_0xb008('0x39')][_0xb008('0x44')]){return _0x5bf4bc[_0xb008('0x37')][_0xb008('0x3d')][_0xb008('0x39')][0x0];}var _0x6c7c23=_[_0xb008('0xd')](_0x5f1a25['body'],{'firstName':_0x5f1a25['body']['from'],'ListId':_0x183e1a[_0xb008('0x2f')]});_0x6c7c23[_0x5f1a25['body'][_0xb008('0x32')]]=_0x5f1a25[_0xb008('0x27')][_0xb008('0x36')];return db[_0xb008('0x45')][_0xb008('0x46')](_0x6c7c23,{'fields':_0x49148b,'raw':!![]});}})[_0xb008('0x10')](function(_0x12d432){_0x5bf4bc[_0xb008('0x47')]=_0x12d432;if(_0x12d432){var _0x55a788={'ContactId':_0x12d432['id'],'FaxAccountId':_0x5f1a25[_0xb008('0x37')]['id'],'fax':_0x12d432[_0xb008('0x48')]};return db[_0xb008('0x49')][_0xb008('0x4a')]({'where':{'ContactId':_0x12d432['id'],'closed':![],'FaxAccountId':_0x5f1a25[_0xb008('0x37')]['id']}})[_0xb008('0x10')](function(_0x1e8c7c){if(_0x1e8c7c){return[_0x1e8c7c,![]];}return db['FaxInteraction']['create'](_0x55a788)['then'](function(_0x7db97b){return[_0x7db97b,!![]];});});}else{throw new Error(_0xb008('0x4b'));}})['spread'](function(_0x4518c1,_0x5c2283){var _0x301716=_0x4518c1[_0xb008('0x3e')]({'plain':!![]});if(_0x5c2283){if(_0x5bf4bc['account']['autoclose']){_0x5bf4bc['applications'][_0xb008('0x4c')]({'id':0x0,'priority':_0x5bf4bc[_0xb008('0x3f')][_0xb008('0x44')]+0x1,'app':'close','appdata':_0xb008('0x4d'),'interval':_0xb008('0x4e')});}_0x301716[_0xb008('0x4f')]=!![];}else{_0x301716[_0xb008('0x4f')]=![];}_0x5bf4bc[_0xb008('0x50')]=_0x301716;return db[_0xb008('0x51')][_0xb008('0x46')]({'body':_0x5f1a25[_0xb008('0x27')][_0xb008('0x27')],'FaxAccountId':_0x5f1a25['account']['id'],'FaxInteractionId':_0x4518c1['id'],'direction':'in','ContactId':_0x4518c1[_0xb008('0x52')],'AttachmentId':_0x5f1a25[_0xb008('0x27')][_0xb008('0x53')]});})[_0xb008('0x10')](function(_0x52bf71){_0x5bf4bc['message']=_0x52bf71;if(_0x5bf4bc[_0xb008('0x50')][_0xb008('0x54')]){return db['User'][_0xb008('0x4a')]({'attributes':['id',_0xb008('0x55')],'where':{'id':_0x5bf4bc['interaction'][_0xb008('0x54')]}})[_0xb008('0x10')](function(_0x571499){if(_0x571499){_0x5bf4bc[_0xb008('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb008('0x56'),'appdata':_0x571499[_0xb008('0x55')]+','+(_0x5bf4bc[_0xb008('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0xb008('0x4e')});}return respondWithRpcPromise(_0xb008('0x57'),'startRouting',_0x5bf4bc);});}return respondWithRpcPromise(_0xb008('0x57'),_0xb008('0x58'),_0x5bf4bc);})['then'](function(_0x1b7e24){_0x1df491(_0x1b7e24);})['catch'](function(_0x375b37){_0x96274a(_0x49d04c[_0xb008('0x16')](0x1f4,_0x375b37[_0xb008('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ffb8c6c..a11e95a 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 _0xcb0f=['removeListener','register','faxAccount:','./faxAccount.events','remove','emit'];(function(_0x1e121e,_0x436cdf){var _0x47ce46=function(_0x2f9638){while(--_0x2f9638){_0x1e121e['push'](_0x1e121e['shift']());}};_0x47ce46(++_0x436cdf);}(_0xcb0f,0x9f));var _0xfcb0=function(_0x69c0fd,_0x36dbee){_0x69c0fd=_0x69c0fd-0x0;var _0x28b1b3=_0xcb0f[_0x69c0fd];return _0x28b1b3;};'use strict';var FaxAccountEvents=require(_0xfcb0('0x0'));var events=['save',_0xfcb0('0x1'),'update'];function createListener(_0x37c24c,_0x3641d6){return function(_0x1a9fb5){_0x3641d6[_0xfcb0('0x2')](_0x37c24c,_0x1a9fb5);};}function removeListener(_0x274c8c,_0x5a2d3e){return function(){FaxAccountEvents[_0xfcb0('0x3')](_0x274c8c,_0x5a2d3e);};}exports[_0xfcb0('0x4')]=function(_0x1da9ff){for(var _0xee358=0x0,_0xf7f3d6=events['length'];_0xee358<_0xf7f3d6;_0xee358++){var _0xf4ab82=events[_0xee358];var _0xb0fbff=createListener(_0xfcb0('0x5')+_0xf4ab82,_0x1da9ff);FaxAccountEvents['on'](_0xf4ab82,_0xb0fbff);}}; \ No newline at end of file +var _0xee99=['remove','update','emit','removeListener','faxAccount:','./faxAccount.events','save'];(function(_0x2c0ff7,_0x5dd45e){var _0x57742=function(_0x5562ce){while(--_0x5562ce){_0x2c0ff7['push'](_0x2c0ff7['shift']());}};_0x57742(++_0x5dd45e);}(_0xee99,0x19b));var _0x9ee9=function(_0x298546,_0x588e3a){_0x298546=_0x298546-0x0;var _0x1cb95c=_0xee99[_0x298546];return _0x1cb95c;};'use strict';var FaxAccountEvents=require(_0x9ee9('0x0'));var events=[_0x9ee9('0x1'),_0x9ee9('0x2'),_0x9ee9('0x3')];function createListener(_0x331156,_0x4c85e4){return function(_0x1da634){_0x4c85e4[_0x9ee9('0x4')](_0x331156,_0x1da634);};}function removeListener(_0x204946,_0x51ae1a){return function(){FaxAccountEvents[_0x9ee9('0x5')](_0x204946,_0x51ae1a);};}exports['register']=function(_0x1cbe2f){for(var _0x3965fc=0x0,_0x329aaf=events['length'];_0x3965fc<_0x329aaf;_0x3965fc++){var _0x488fe5=events[_0x3965fc];var _0x1f362f=createListener(_0x9ee9('0x6')+_0x488fe5,_0x1cbe2f);FaxAccountEvents['on'](_0x488fe5,_0x1f362f);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 65e4ab5..9a2b5a7 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(_0x273efa,_0x5e221d){var _0x29226e=function(_0x12f4b4){while(--_0x12f4b4){_0x273efa['push'](_0x273efa['shift']());}};_0x29226e(++_0x5e221d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/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(_0x8efa6d,_0x51a861){var _0x3ce69a=function(_0x2bd97d){while(--_0x2bd97d){_0x8efa6d['push'](_0x8efa6d['shift']());}};_0x3ce69a(++_0x51a861);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 a507d07..84b204f 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 _0xb8a0=['exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x57dae8,_0x14f493){var _0x2da89a=function(_0x498a30){while(--_0x498a30){_0x57dae8['push'](_0x57dae8['shift']());}};_0x2da89a(++_0x14f493);}(_0xb8a0,0xa5));var _0x0b8a=function(_0x346f64,_0x137e1b){_0x346f64=_0x346f64-0x0;var _0x18561b=_0xb8a0[_0x346f64];return _0x18561b;};'use strict';var Sequelize=require('sequelize');module[_0x0b8a('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0b8a('0x1')],'allowNull':![],'defaultValue':_0x0b8a('0x2')},'appdata':{'type':Sequelize[_0x0b8a('0x3')]()},'description':{'type':Sequelize[_0x0b8a('0x1')]},'interval':{'type':Sequelize[_0x0b8a('0x1')],'defaultValue':_0x0b8a('0x4')}}; \ No newline at end of file +var _0x7761=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4ab504,_0x32273f){var _0x2aa2c5=function(_0x5046d5){while(--_0x5046d5){_0x4ab504['push'](_0x4ab504['shift']());}};_0x2aa2c5(++_0x32273f);}(_0x7761,0x1c6));var _0x1776=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7761[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1776('0x0'));module[_0x1776('0x1')]={'priority':{'type':Sequelize[_0x1776('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1776('0x3')],'allowNull':![],'defaultValue':_0x1776('0x4')},'appdata':{'type':Sequelize[_0x1776('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1776('0x3')],'defaultValue':_0x1776('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d068c77..27690c8 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 _0xa74d=['stack','name','map','FaxApplication','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','update','then','end','error'];(function(_0x55e3d5,_0x2656cc){var _0xdad6e4=function(_0x1d15f8){while(--_0x1d15f8){_0x55e3d5['push'](_0x55e3d5['shift']());}};_0xdad6e4(++_0x2656cc);}(_0xa74d,0x68));var _0xda74=function(_0x6cb902,_0x27d8cd){_0x6cb902=_0x6cb902-0x0;var _0x49c8e0=_0xa74d[_0x6cb902];return _0x49c8e0;};'use strict';var emlformat=require(_0xda74('0x0'));var rimraf=require(_0xda74('0x1'));var zipdir=require(_0xda74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda74('0x3'));var moment=require('moment');var BPromise=require(_0xda74('0x4'));var Mustache=require(_0xda74('0x5'));var util=require(_0xda74('0x6'));var path=require('path');var sox=require(_0xda74('0x7'));var csv=require(_0xda74('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda74('0x9'));var _=require(_0xda74('0xa'));var squel=require(_0xda74('0xb'));var crypto=require('crypto');var jsforce=require(_0xda74('0xc'));var deskjs=require(_0xda74('0xd'));var toCsv=require(_0xda74('0x8'));var querystring=require(_0xda74('0xe'));var Papa=require(_0xda74('0xf'));var Redis=require(_0xda74('0x10'));var authService=require(_0xda74('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xda74('0x12'));var hardwareService=require(_0xda74('0x13'));var logger=require(_0xda74('0x14'))(_0xda74('0x15'));var utils=require(_0xda74('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda74('0x17'));var db=require(_0xda74('0x18'))['db'];function respondWithStatusCode(_0x181013,_0x5d36dc){_0x5d36dc=_0x5d36dc||0xcc;return function(_0x5ddf2e){if(_0x5ddf2e){return _0x181013[_0xda74('0x19')](_0x5d36dc);}return _0x181013[_0xda74('0x1a')](_0x5d36dc)['end']();};}function respondWithResult(_0x536066,_0x472d2b){_0x472d2b=_0x472d2b||0xc8;return function(_0x26ca88){if(_0x26ca88){return _0x536066[_0xda74('0x1a')](_0x472d2b)[_0xda74('0x1b')](_0x26ca88);}};}function respondWithFilteredResult(_0xd91db3,_0x35508d){return function(_0x391ff3){if(_0x391ff3){var _0x20ae41=typeof _0x35508d[_0xda74('0x1c')]==='undefined'&&typeof _0x35508d[_0xda74('0x1d')]===_0xda74('0x1e');var _0x357481=_0x391ff3[_0xda74('0x1f')];var _0x584c7e=_0x20ae41?0x0:_0x35508d[_0xda74('0x1c')];var _0x17247a=_0x20ae41?_0x391ff3[_0xda74('0x1f')]:_0x35508d[_0xda74('0x1c')]+_0x35508d[_0xda74('0x1d')];var _0xb99d9d;if(_0x17247a>=_0x357481){_0x17247a=_0x357481;_0xb99d9d=0xc8;}else{_0xb99d9d=0xce;}_0xd91db3['status'](_0xb99d9d);return _0xd91db3[_0xda74('0x20')]('Content-Range',_0x584c7e+'-'+_0x17247a+'/'+_0x357481)['json'](_0x391ff3);}return null;};}function patchUpdates(_0x16880b){return function(_0x39756a){try{jsonpatch['apply'](_0x39756a,_0x16880b,!![]);}catch(_0x3b4a9b){return BPromise[_0xda74('0x21')](_0x3b4a9b);}return _0x39756a['save']();};}function saveUpdates(_0x55a9c9,_0x31ac59){return function(_0x4a19bb){if(_0x4a19bb){return _0x4a19bb[_0xda74('0x22')](_0x55a9c9)[_0xda74('0x23')](function(_0x1e1861){return _0x1e1861;});}return null;};}function removeEntity(_0x2e1397,_0x26b0eb){return function(_0x2c5fef){if(_0x2c5fef){return _0x2c5fef['destroy']()[_0xda74('0x23')](function(){_0x2e1397[_0xda74('0x1a')](0xcc)[_0xda74('0x24')]();});}};}function handleEntityNotFound(_0x53dfcc,_0x55b941){return function(_0x51b283){if(!_0x51b283){_0x53dfcc[_0xda74('0x19')](0x194);}return _0x51b283;};}function handleError(_0x46df73,_0x2fddd1){_0x2fddd1=_0x2fddd1||0x1f4;return function(_0x2638f1){logger[_0xda74('0x25')](_0x2638f1[_0xda74('0x26')]);if(_0x2638f1[_0xda74('0x27')]){delete _0x2638f1[_0xda74('0x27')];}_0x46df73['status'](_0x2fddd1)['send'](_0x2638f1);};}exports['index']=function(_0x522a2b,_0x26835d){var _0xbe4a70={},_0x23aece={},_0xa30eae={'count':0x0,'rows':[]};var _0x3e844d=_[_0xda74('0x28')](db[_0xda74('0x29')]['rawAttributes'],function(_0x4c8ef9){return{'name':_0x4c8ef9[_0xda74('0x2a')],'type':_0x4c8ef9[_0xda74('0x2b')][_0xda74('0x2c')]};});_0x23aece['model']=_['map'](_0x3e844d,_0xda74('0x27'));_0x23aece[_0xda74('0x2d')]=_[_0xda74('0x2e')](_0x522a2b[_0xda74('0x2d')]);_0x23aece['filters']=_[_0xda74('0x2f')](_0x23aece[_0xda74('0x30')],_0x23aece[_0xda74('0x2d')]);_0xbe4a70[_0xda74('0x31')]=_['intersection'](_0x23aece[_0xda74('0x30')],qs[_0xda74('0x32')](_0x522a2b[_0xda74('0x2d')][_0xda74('0x32')]));_0xbe4a70[_0xda74('0x31')]=_0xbe4a70[_0xda74('0x31')][_0xda74('0x33')]?_0xbe4a70[_0xda74('0x31')]:_0x23aece[_0xda74('0x30')];if(!_0x522a2b['query']['hasOwnProperty'](_0xda74('0x34'))){_0xbe4a70[_0xda74('0x1d')]=qs[_0xda74('0x1d')](_0x522a2b[_0xda74('0x2d')][_0xda74('0x1d')]);_0xbe4a70[_0xda74('0x1c')]=qs[_0xda74('0x1c')](_0x522a2b[_0xda74('0x2d')][_0xda74('0x1c')]);}_0xbe4a70[_0xda74('0x35')]=qs[_0xda74('0x36')](_0x522a2b[_0xda74('0x2d')][_0xda74('0x36')]);_0xbe4a70[_0xda74('0x37')]=qs[_0xda74('0x38')](_[_0xda74('0x39')](_0x522a2b[_0xda74('0x2d')],_0x23aece[_0xda74('0x38')]),_0x3e844d);if(_0x522a2b['query']['filter']){_0xbe4a70[_0xda74('0x37')]=_[_0xda74('0x3a')](_0xbe4a70[_0xda74('0x37')],{'$or':_[_0xda74('0x28')](_0x3e844d,function(_0x1ee1e4){if(_0x1ee1e4['type']!==_0xda74('0x3b')){var _0x90aefb={};_0x90aefb[_0x1ee1e4[_0xda74('0x27')]]={'$like':'%'+_0x522a2b[_0xda74('0x2d')][_0xda74('0x3c')]+'%'};return _0x90aefb;}})});}_0xbe4a70=_[_0xda74('0x3a')]({},_0xbe4a70,_0x522a2b['options']);var _0xca0e60={'where':_0xbe4a70[_0xda74('0x37')]};return db[_0xda74('0x29')][_0xda74('0x1f')](_0xca0e60)[_0xda74('0x23')](function(_0x4498fe){_0xa30eae['count']=_0x4498fe;if(_0x522a2b[_0xda74('0x2d')][_0xda74('0x3d')]){_0xbe4a70[_0xda74('0x3e')]=[{'all':!![]}];}return db['FaxApplication'][_0xda74('0x3f')](_0xbe4a70);})[_0xda74('0x23')](function(_0x59f9e6){_0xa30eae['rows']=_0x59f9e6;return _0xa30eae;})[_0xda74('0x23')](respondWithFilteredResult(_0x26835d,_0xbe4a70))[_0xda74('0x40')](handleError(_0x26835d,null));};exports['show']=function(_0x37f9ea,_0x58727f){var _0x12d5d6={'raw':!![],'where':{'id':_0x37f9ea[_0xda74('0x41')]['id']}},_0x425e0b={};_0x425e0b[_0xda74('0x30')]=_[_0xda74('0x2e')](db[_0xda74('0x29')][_0xda74('0x42')]);_0x425e0b[_0xda74('0x2d')]=_['keys'](_0x37f9ea[_0xda74('0x2d')]);_0x425e0b['filters']=_[_0xda74('0x2f')](_0x425e0b[_0xda74('0x30')],_0x425e0b[_0xda74('0x2d')]);_0x12d5d6[_0xda74('0x31')]=_[_0xda74('0x2f')](_0x425e0b[_0xda74('0x30')],qs['fields'](_0x37f9ea[_0xda74('0x2d')]['fields']));_0x12d5d6[_0xda74('0x31')]=_0x12d5d6[_0xda74('0x31')][_0xda74('0x33')]?_0x12d5d6[_0xda74('0x31')]:_0x425e0b[_0xda74('0x30')];if(_0x37f9ea[_0xda74('0x2d')][_0xda74('0x3d')]){_0x12d5d6['include']=[{'all':!![]}];}_0x12d5d6=_[_0xda74('0x3a')]({},_0x12d5d6,_0x37f9ea[_0xda74('0x43')]);return db[_0xda74('0x29')][_0xda74('0x44')](_0x12d5d6)[_0xda74('0x23')](handleEntityNotFound(_0x58727f,null))[_0xda74('0x23')](respondWithResult(_0x58727f,null))[_0xda74('0x40')](handleError(_0x58727f,null));};exports['create']=function(_0x44cbcd,_0x16c1a9){return db[_0xda74('0x29')][_0xda74('0x45')](_0x44cbcd[_0xda74('0x46')],{})[_0xda74('0x23')](respondWithResult(_0x16c1a9,0xc9))[_0xda74('0x40')](handleError(_0x16c1a9,null));};exports[_0xda74('0x22')]=function(_0x45d4f4,_0x4ec217){if(_0x45d4f4[_0xda74('0x46')]['id']){delete _0x45d4f4['body']['id'];}return db['FaxApplication'][_0xda74('0x44')]({'where':{'id':_0x45d4f4[_0xda74('0x41')]['id']}})[_0xda74('0x23')](handleEntityNotFound(_0x4ec217,null))[_0xda74('0x23')](saveUpdates(_0x45d4f4[_0xda74('0x46')],null))['then'](respondWithResult(_0x4ec217,null))['catch'](handleError(_0x4ec217,null));};exports['destroy']=function(_0x57253e,_0x3cfabd){return db[_0xda74('0x29')][_0xda74('0x44')]({'where':{'id':_0x57253e[_0xda74('0x41')]['id']}})[_0xda74('0x23')](handleEntityNotFound(_0x3cfabd,null))[_0xda74('0x23')](removeEntity(_0x3cfabd,null))[_0xda74('0x40')](handleError(_0x3cfabd,null));}; \ No newline at end of file +var _0xd362=['VIRTUAL','options','FaxApplication','include','findAll','rows','show','params','keys','fields','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge'];(function(_0xa61555,_0x1bc1a5){var _0x2e248d=function(_0x4f491c){while(--_0x4f491c){_0xa61555['push'](_0xa61555['shift']());}};_0x2e248d(++_0x1bc1a5);}(_0xd362,0xe9));var _0x2d36=function(_0x3ff372,_0xe314){_0x3ff372=_0x3ff372-0x0;var _0x328737=_0xd362[_0x3ff372];return _0x328737;};'use strict';var emlformat=require(_0x2d36('0x0'));var rimraf=require(_0x2d36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d36('0x2'));var rp=require(_0x2d36('0x3'));var moment=require(_0x2d36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d36('0x5'));var util=require('util');var path=require(_0x2d36('0x6'));var sox=require(_0x2d36('0x7'));var csv=require(_0x2d36('0x8'));var ejs=require(_0x2d36('0x9'));var fs=require('fs');var fs_extra=require(_0x2d36('0xa'));var _=require(_0x2d36('0xb'));var squel=require(_0x2d36('0xc'));var crypto=require(_0x2d36('0xd'));var jsforce=require(_0x2d36('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2d36('0x8'));var querystring=require(_0x2d36('0xf'));var Papa=require(_0x2d36('0x10'));var Redis=require(_0x2d36('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d36('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d36('0x13'))('api');var utils=require(_0x2d36('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d36('0x15'));var db=require(_0x2d36('0x16'))['db'];function respondWithStatusCode(_0x1f191f,_0x137829){_0x137829=_0x137829||0xcc;return function(_0xe648db){if(_0xe648db){return _0x1f191f[_0x2d36('0x17')](_0x137829);}return _0x1f191f[_0x2d36('0x18')](_0x137829)[_0x2d36('0x19')]();};}function respondWithResult(_0x23039a,_0x57bdfe){_0x57bdfe=_0x57bdfe||0xc8;return function(_0x4085bd){if(_0x4085bd){return _0x23039a[_0x2d36('0x18')](_0x57bdfe)[_0x2d36('0x1a')](_0x4085bd);}};}function respondWithFilteredResult(_0xb84598,_0x86a060){return function(_0x23b3f1){if(_0x23b3f1){var _0x2a5678=typeof _0x86a060[_0x2d36('0x1b')]===_0x2d36('0x1c')&&typeof _0x86a060['limit']==='undefined';var _0x17c9e1=_0x23b3f1[_0x2d36('0x1d')];var _0x3df147=_0x2a5678?0x0:_0x86a060[_0x2d36('0x1b')];var _0x4ccb10=_0x2a5678?_0x23b3f1[_0x2d36('0x1d')]:_0x86a060['offset']+_0x86a060[_0x2d36('0x1e')];var _0x3a926c;if(_0x4ccb10>=_0x17c9e1){_0x4ccb10=_0x17c9e1;_0x3a926c=0xc8;}else{_0x3a926c=0xce;}_0xb84598['status'](_0x3a926c);return _0xb84598[_0x2d36('0x1f')]('Content-Range',_0x3df147+'-'+_0x4ccb10+'/'+_0x17c9e1)[_0x2d36('0x1a')](_0x23b3f1);}return null;};}function patchUpdates(_0x2e2f64){return function(_0x5a9b03){try{jsonpatch['apply'](_0x5a9b03,_0x2e2f64,!![]);}catch(_0x3221ab){return BPromise[_0x2d36('0x20')](_0x3221ab);}return _0x5a9b03[_0x2d36('0x21')]();};}function saveUpdates(_0x5e8dc2,_0x1f408d){return function(_0x415684){if(_0x415684){return _0x415684[_0x2d36('0x22')](_0x5e8dc2)['then'](function(_0x55d43a){return _0x55d43a;});}return null;};}function removeEntity(_0x5ba4a7,_0x5b6cfb){return function(_0x13f370){if(_0x13f370){return _0x13f370[_0x2d36('0x23')]()[_0x2d36('0x24')](function(){_0x5ba4a7[_0x2d36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cd096,_0x55addd){return function(_0x3b131a){if(!_0x3b131a){_0x1cd096[_0x2d36('0x17')](0x194);}return _0x3b131a;};}function handleError(_0x4ebeaa,_0x24b975){_0x24b975=_0x24b975||0x1f4;return function(_0x349afa){logger['error'](_0x349afa[_0x2d36('0x25')]);if(_0x349afa['name']){delete _0x349afa[_0x2d36('0x26')];}_0x4ebeaa[_0x2d36('0x18')](_0x24b975)[_0x2d36('0x27')](_0x349afa);};}exports[_0x2d36('0x28')]=function(_0xcc1554,_0x120f0d){var _0x41a784={},_0x24716d={},_0x2b8b5e={'count':0x0,'rows':[]};var _0x53880b=_[_0x2d36('0x29')](db['FaxApplication'][_0x2d36('0x2a')],function(_0x109b3e){return{'name':_0x109b3e['fieldName'],'type':_0x109b3e[_0x2d36('0x2b')][_0x2d36('0x2c')]};});_0x24716d[_0x2d36('0x2d')]=_[_0x2d36('0x29')](_0x53880b,_0x2d36('0x26'));_0x24716d[_0x2d36('0x2e')]=_['keys'](_0xcc1554['query']);_0x24716d['filters']=_[_0x2d36('0x2f')](_0x24716d[_0x2d36('0x2d')],_0x24716d[_0x2d36('0x2e')]);_0x41a784['attributes']=_[_0x2d36('0x2f')](_0x24716d['model'],qs['fields'](_0xcc1554[_0x2d36('0x2e')]['fields']));_0x41a784[_0x2d36('0x30')]=_0x41a784[_0x2d36('0x30')][_0x2d36('0x31')]?_0x41a784[_0x2d36('0x30')]:_0x24716d[_0x2d36('0x2d')];if(!_0xcc1554[_0x2d36('0x2e')][_0x2d36('0x32')](_0x2d36('0x33'))){_0x41a784[_0x2d36('0x1e')]=qs[_0x2d36('0x1e')](_0xcc1554[_0x2d36('0x2e')][_0x2d36('0x1e')]);_0x41a784[_0x2d36('0x1b')]=qs[_0x2d36('0x1b')](_0xcc1554['query'][_0x2d36('0x1b')]);}_0x41a784[_0x2d36('0x34')]=qs[_0x2d36('0x35')](_0xcc1554[_0x2d36('0x2e')]['sort']);_0x41a784[_0x2d36('0x36')]=qs['filters'](_[_0x2d36('0x37')](_0xcc1554[_0x2d36('0x2e')],_0x24716d[_0x2d36('0x38')]),_0x53880b);if(_0xcc1554['query'][_0x2d36('0x39')]){_0x41a784['where']=_[_0x2d36('0x3a')](_0x41a784[_0x2d36('0x36')],{'$or':_['map'](_0x53880b,function(_0xf1b43c){if(_0xf1b43c[_0x2d36('0x2b')]!==_0x2d36('0x3b')){var _0x1db01a={};_0x1db01a[_0xf1b43c[_0x2d36('0x26')]]={'$like':'%'+_0xcc1554[_0x2d36('0x2e')][_0x2d36('0x39')]+'%'};return _0x1db01a;}})});}_0x41a784=_[_0x2d36('0x3a')]({},_0x41a784,_0xcc1554[_0x2d36('0x3c')]);var _0x182ef5={'where':_0x41a784['where']};return db[_0x2d36('0x3d')][_0x2d36('0x1d')](_0x182ef5)['then'](function(_0x11318b){_0x2b8b5e[_0x2d36('0x1d')]=_0x11318b;if(_0xcc1554[_0x2d36('0x2e')]['includeAll']){_0x41a784[_0x2d36('0x3e')]=[{'all':!![]}];}return db[_0x2d36('0x3d')][_0x2d36('0x3f')](_0x41a784);})['then'](function(_0x2f59c9){_0x2b8b5e[_0x2d36('0x40')]=_0x2f59c9;return _0x2b8b5e;})[_0x2d36('0x24')](respondWithFilteredResult(_0x120f0d,_0x41a784))['catch'](handleError(_0x120f0d,null));};exports[_0x2d36('0x41')]=function(_0x4cea3e,_0x137bd6){var _0x149167={'raw':!![],'where':{'id':_0x4cea3e[_0x2d36('0x42')]['id']}},_0x4c1c4d={};_0x4c1c4d[_0x2d36('0x2d')]=_[_0x2d36('0x43')](db[_0x2d36('0x3d')][_0x2d36('0x2a')]);_0x4c1c4d[_0x2d36('0x2e')]=_[_0x2d36('0x43')](_0x4cea3e['query']);_0x4c1c4d[_0x2d36('0x38')]=_[_0x2d36('0x2f')](_0x4c1c4d[_0x2d36('0x2d')],_0x4c1c4d[_0x2d36('0x2e')]);_0x149167[_0x2d36('0x30')]=_[_0x2d36('0x2f')](_0x4c1c4d[_0x2d36('0x2d')],qs[_0x2d36('0x44')](_0x4cea3e[_0x2d36('0x2e')][_0x2d36('0x44')]));_0x149167[_0x2d36('0x30')]=_0x149167['attributes'][_0x2d36('0x31')]?_0x149167['attributes']:_0x4c1c4d[_0x2d36('0x2d')];if(_0x4cea3e['query']['includeAll']){_0x149167[_0x2d36('0x3e')]=[{'all':!![]}];}_0x149167=_[_0x2d36('0x3a')]({},_0x149167,_0x4cea3e[_0x2d36('0x3c')]);return db['FaxApplication'][_0x2d36('0x45')](_0x149167)[_0x2d36('0x24')](handleEntityNotFound(_0x137bd6,null))[_0x2d36('0x24')](respondWithResult(_0x137bd6,null))[_0x2d36('0x46')](handleError(_0x137bd6,null));};exports[_0x2d36('0x47')]=function(_0x49a01b,_0x54a71e){return db[_0x2d36('0x3d')]['create'](_0x49a01b[_0x2d36('0x48')],{})[_0x2d36('0x24')](respondWithResult(_0x54a71e,0xc9))[_0x2d36('0x46')](handleError(_0x54a71e,null));};exports[_0x2d36('0x22')]=function(_0x38c1ea,_0x29abd1){if(_0x38c1ea[_0x2d36('0x48')]['id']){delete _0x38c1ea[_0x2d36('0x48')]['id'];}return db[_0x2d36('0x3d')][_0x2d36('0x45')]({'where':{'id':_0x38c1ea[_0x2d36('0x42')]['id']}})[_0x2d36('0x24')](handleEntityNotFound(_0x29abd1,null))[_0x2d36('0x24')](saveUpdates(_0x38c1ea[_0x2d36('0x48')],null))[_0x2d36('0x24')](respondWithResult(_0x29abd1,null))[_0x2d36('0x46')](handleError(_0x29abd1,null));};exports['destroy']=function(_0x283eef,_0x49745f){return db['FaxApplication']['find']({'where':{'id':_0x283eef[_0x2d36('0x42')]['id']}})['then'](handleEntityNotFound(_0x49745f,null))[_0x2d36('0x24')](removeEntity(_0x49745f,null))[_0x2d36('0x46')](handleError(_0x49745f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f2530c6..93c1fe4 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 _0xb123=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x41f904,_0x191336){var _0x449d09=function(_0x5d3adf){while(--_0x5d3adf){_0x41f904['push'](_0x41f904['shift']());}};_0x449d09(++_0x191336);}(_0xb123,0x187));var _0x3b12=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xb123[_0x519756];return _0x37047e;};'use strict';var _=require(_0x3b12('0x0'));var util=require('util');var logger=require(_0x3b12('0x1'))(_0x3b12('0x2'));var moment=require(_0x3b12('0x3'));var BPromise=require(_0x3b12('0x4'));var rp=require(_0x3b12('0x5'));var fs=require('fs');var path=require(_0x3b12('0x6'));var rimraf=require(_0x3b12('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x13e425,_0x199054){return _0x13e425[_0x3b12('0x8')](_0x3b12('0x9'),attributes,{'tableName':_0x3b12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b12('0xb'),'collate':_0x3b12('0xc')});}; \ No newline at end of file +var _0x3ff0=['../../config/logger','bluebird','request-promise','path','rimraf','./faxApplication.attributes','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x8d4a5c,_0x59ee6e){var _0x4714ba=function(_0x5ba9ba){while(--_0x5ba9ba){_0x8d4a5c['push'](_0x8d4a5c['shift']());}};_0x4714ba(++_0x59ee6e);}(_0x3ff0,0xdb));var _0x03ff=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x3ff0[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x03ff('0x0'));var util=require('util');var logger=require(_0x03ff('0x1'))('api');var moment=require('moment');var BPromise=require(_0x03ff('0x2'));var rp=require(_0x03ff('0x3'));var fs=require('fs');var path=require(_0x03ff('0x4'));var rimraf=require(_0x03ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x03ff('0x6'));module['exports']=function(_0x33f38e,_0x52dbf8){return _0x33f38e['define']('FaxApplication',attributes,{'tableName':_0x03ff('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03ff('0x8'),'collate':_0x03ff('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index cf12f81..079c5e6 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 _0xdd32=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0xdd32,0x14a));var _0x2dd3=function(_0x27cf38,_0x4f4d7c){_0x27cf38=_0x27cf38-0x0;var _0x58629f=_0xdd32[_0x27cf38];return _0x58629f;};'use strict';var _=require('lodash');var util=require(_0x2dd3('0x0'));var moment=require(_0x2dd3('0x1'));var BPromise=require(_0x2dd3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2dd3('0x3'))['db'];var utils=require(_0x2dd3('0x4'));var logger=require(_0x2dd3('0x5'))(_0x2dd3('0x6'));var config=require(_0x2dd3('0x7'));var jayson=require(_0x2dd3('0x8'));var client=jayson[_0x2dd3('0x9')][_0x2dd3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e1fd1,_0x302cc6,_0x13e111){return new BPromise(function(_0x5e5b5e,_0x311f06){return client[_0x2dd3('0xb')](_0x3e1fd1,_0x13e111)[_0x2dd3('0xc')](function(_0x5636d7){logger['info'](_0x2dd3('0xd'),_0x302cc6,_0x2dd3('0xe'));logger[_0x2dd3('0xf')](_0x2dd3('0x10'),_0x302cc6,_0x2dd3('0xe'),JSON[_0x2dd3('0x11')](_0x5636d7));if(_0x5636d7[_0x2dd3('0x12')]){if(_0x5636d7[_0x2dd3('0x12')][_0x2dd3('0x13')]===0x1f4){logger[_0x2dd3('0x12')](_0x2dd3('0xd'),_0x302cc6,_0x5636d7[_0x2dd3('0x12')]['message']);return _0x311f06(_0x5636d7['error']['message']);}logger[_0x2dd3('0x12')]('FaxApplication,\x20%s,\x20%s',_0x302cc6,_0x5636d7[_0x2dd3('0x12')][_0x2dd3('0x14')]);return _0x5e5b5e(_0x5636d7[_0x2dd3('0x12')][_0x2dd3('0x14')]);}else{logger[_0x2dd3('0x15')](_0x2dd3('0xd'),_0x302cc6,_0x2dd3('0xe'));_0x5e5b5e(_0x5636d7[_0x2dd3('0x16')][_0x2dd3('0x14')]);}})[_0x2dd3('0x17')](function(_0x226221){logger[_0x2dd3('0x12')]('FaxApplication,\x20%s,\x20%s',_0x302cc6,_0x226221);_0x311f06(_0x226221);});});}exports[_0x2dd3('0x18')]=function(_0xf62d50){var _0x18ffd8=this;return new Promise(function(_0x5ca561,_0x1c9ad8){return db[_0x2dd3('0x19')][_0x2dd3('0x1a')](_0xf62d50[_0x2dd3('0x1b')],{'raw':_0xf62d50['options']?_0xf62d50[_0x2dd3('0x1c')][_0x2dd3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf62d50['options']?_0xf62d50[_0x2dd3('0x1c')][_0x2dd3('0x1e')]||null:null,'attributes':_0xf62d50[_0x2dd3('0x1c')]?_0xf62d50[_0x2dd3('0x1c')][_0x2dd3('0x1f')]||null:null,'limit':_0xf62d50['options']?_0xf62d50[_0x2dd3('0x1c')][_0x2dd3('0x20')]||null:null})['then'](function(_0xead5cb){logger[_0x2dd3('0x15')](_0x2dd3('0x18'),_0xf62d50);logger['debug'](_0x2dd3('0x18'),_0xf62d50,JSON[_0x2dd3('0x11')](_0xead5cb));_0x5ca561(_0xead5cb);})[_0x2dd3('0x17')](function(_0x11926d){logger['error'](_0x2dd3('0x18'),_0x11926d['message'],_0xf62d50);_0x1c9ad8(_0x18ffd8[_0x2dd3('0x12')](0x1f4,_0x11926d[_0x2dd3('0x14')]));});});}; \ No newline at end of file +var _0x3f32=['http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x580a59,_0x21266c){var _0x19da51=function(_0x772ac8){while(--_0x772ac8){_0x580a59['push'](_0x580a59['shift']());}};_0x19da51(++_0x21266c);}(_0x3f32,0x160));var _0x23f3=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0x3f32[_0x2e067a];return _0xc64976;};'use strict';var _=require(_0x23f3('0x0'));var util=require(_0x23f3('0x1'));var moment=require(_0x23f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23f3('0x3'));var fs=require('fs');var Redis=require(_0x23f3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x23f3('0x5'));var logger=require(_0x23f3('0x6'))(_0x23f3('0x7'));var config=require(_0x23f3('0x8'));var jayson=require(_0x23f3('0x9'));var client=jayson[_0x23f3('0xa')][_0x23f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e926,_0x462a6e,_0x23acf7){return new BPromise(function(_0x5db79b,_0x5e3900){return client[_0x23f3('0xc')](_0x12e926,_0x23acf7)[_0x23f3('0xd')](function(_0x2af775){logger[_0x23f3('0xe')](_0x23f3('0xf'),_0x462a6e,_0x23f3('0x10'));logger[_0x23f3('0x11')](_0x23f3('0x12'),_0x462a6e,_0x23f3('0x10'),JSON['stringify'](_0x2af775));if(_0x2af775[_0x23f3('0x13')]){if(_0x2af775['error'][_0x23f3('0x14')]===0x1f4){logger[_0x23f3('0x13')]('FaxApplication,\x20%s,\x20%s',_0x462a6e,_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);return _0x5e3900(_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);}logger['error'](_0x23f3('0xf'),_0x462a6e,_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);return _0x5db79b(_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);}else{logger[_0x23f3('0xe')]('FaxApplication,\x20%s,\x20%s',_0x462a6e,_0x23f3('0x10'));_0x5db79b(_0x2af775[_0x23f3('0x16')][_0x23f3('0x15')]);}})[_0x23f3('0x17')](function(_0x578e12){logger[_0x23f3('0x13')](_0x23f3('0xf'),_0x462a6e,_0x578e12);_0x5e3900(_0x578e12);});});}exports[_0x23f3('0x18')]=function(_0x45c239){var _0x1dcc7f=this;return new Promise(function(_0x1b1ce9,_0x220b91){return db[_0x23f3('0x19')][_0x23f3('0x1a')](_0x45c239[_0x23f3('0x1b')],{'raw':_0x45c239[_0x23f3('0x1c')]?_0x45c239[_0x23f3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45c239[_0x23f3('0x1c')]?_0x45c239[_0x23f3('0x1c')][_0x23f3('0x1d')]||null:null,'attributes':_0x45c239['options']?_0x45c239['options'][_0x23f3('0x1e')]||null:null,'limit':_0x45c239['options']?_0x45c239['options'][_0x23f3('0x1f')]||null:null})[_0x23f3('0xd')](function(_0x540709){logger[_0x23f3('0xe')](_0x23f3('0x18'),_0x45c239);logger['debug']('UpdateFaxApplication',_0x45c239,JSON[_0x23f3('0x20')](_0x540709));_0x1b1ce9(_0x540709);})[_0x23f3('0x17')](function(_0x34ffd4){logger['error'](_0x23f3('0x18'),_0x34ffd4[_0x23f3('0x15')],_0x45c239);_0x220b91(_0x1dcc7f[_0x23f3('0x13')](0x1f4,_0x34ffd4[_0x23f3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d1dc031..d931859 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 _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x8603,0x190));var _0x3860=function(_0x58cd9c,_0x584d3d){_0x58cd9c=_0x58cd9c-0x0;var _0x93fd95=_0x8603[_0x58cd9c];return _0x93fd95;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x4317d0,_0x2d972b){var _0x25ce3a=function(_0x429110){while(--_0x429110){_0x4317d0['push'](_0x4317d0['shift']());}};_0x25ce3a(++_0x2d972b);}(_0x5c00,0x17e));var _0x05c0=function(_0x4cb231,_0x3d3c5b){_0x4cb231=_0x4cb231-0x0;var _0x4d5063=_0x5c00[_0x4cb231];return _0x4d5063;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c542638..028a2b9 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 _0xe338=['exports','BOOLEAN','STRING','DATE','ENUM','sequelize'];(function(_0x462e02,_0x4d9ef6){var _0x2867ef=function(_0x5d1849){while(--_0x5d1849){_0x462e02['push'](_0x462e02['shift']());}};_0x2867ef(++_0x4d9ef6);}(_0xe338,0x107));var _0x8e33=function(_0x44f486,_0x2f8bdc){_0x44f486=_0x44f486-0x0;var _0x30e508=_0xe338[_0x44f486];return _0x30e508;};'use strict';var Sequelize=require(_0x8e33('0x0'));module[_0x8e33('0x1')]={'closed':{'type':Sequelize[_0x8e33('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8e33('0x3')]},'secondDisposition':{'type':Sequelize[_0x8e33('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8e33('0x3')]},'note':{'type':Sequelize[_0x8e33('0x3')]},'read1stAt':{'type':Sequelize[_0x8e33('0x4')]},'fax':{'type':Sequelize[_0x8e33('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8e33('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8e33('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8e33('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4646=['out','BOOLEAN','STRING','DATE','ENUM'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4646,0x191));var _0x6464=function(_0x335586,_0x249160){_0x335586=_0x335586-0x0;var _0x4c5d42=_0x4646[_0x335586];return _0x4c5d42;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6464('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6464('0x1')]},'secondDisposition':{'type':Sequelize[_0x6464('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6464('0x1')]},'read1stAt':{'type':Sequelize[_0x6464('0x2')]},'fax':{'type':Sequelize[_0x6464('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x6464('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6464('0x3')]('in',_0x6464('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 7eb3aa0..e2b26b0 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 _0x1998=['YYYY-MM-DD\x20HH:mm:ss','merge','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve','download','log','unlinkSync','rimraf','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','fax','query','user','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','options','find','catch','create','body','FaxInteraction','addMessage','ids','omit','getMessages','findOne','FaxMessage','fields','hasOwnProperty','nolimit','sort','where','pick','FaxInteractionId','filter','$gte','split','format'];(function(_0x477e54,_0x37cd04){var _0x17f02a=function(_0x2057bb){while(--_0x2057bb){_0x477e54['push'](_0x477e54['shift']());}};_0x17f02a(++_0x37cd04);}(_0x1998,0x1bb));var _0x8199=function(_0x31144c,_0x1d9f6c){_0x31144c=_0x31144c-0x0;var _0x3e1aa6=_0x1998[_0x31144c];return _0x3e1aa6;};'use strict';var rimraf=require(_0x8199('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x8199('0x1'));var util=require(_0x8199('0x2'));var path=require(_0x8199('0x3'));var fs=require('fs');var _=require(_0x8199('0x4'));var Redis=require('ioredis');var interaction=require(_0x8199('0x5'));var qs=require(_0x8199('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x8199('0x7'));var db=require('../../mysqldb')['db'];config[_0x8199('0x8')]=_['defaults'](config['redis'],{'host':_0x8199('0x9'),'port':0x18eb});var socket=require(_0x8199('0xa'))(new Redis(config['redis']));require(_0x8199('0xb'))[_0x8199('0xc')](socket);function respondWithStatusCode(_0x42c9d5,_0x112ef0){_0x112ef0=_0x112ef0||0xcc;return function(_0x3b55ec){if(_0x3b55ec){return _0x42c9d5[_0x8199('0xd')](_0x112ef0);}return _0x42c9d5[_0x8199('0xe')](_0x112ef0)[_0x8199('0xf')]();};}function respondWithResult(_0x1e3fb2,_0x113b9b){_0x113b9b=_0x113b9b||0xc8;return function(_0x2bdb33){if(_0x2bdb33){return _0x1e3fb2['status'](_0x113b9b)[_0x8199('0x10')](_0x2bdb33);}};}function respondWithFilteredResult(_0x5ec227,_0x339edf){return function(_0x7db9f1){if(_0x7db9f1){var _0x1aa939=typeof _0x339edf['offset']===_0x8199('0x11')&&typeof _0x339edf[_0x8199('0x12')]===_0x8199('0x11');var _0x2a61e8=_0x7db9f1[_0x8199('0x13')];var _0x359b1b=_0x1aa939?0x0:_0x339edf[_0x8199('0x14')];var _0x527550=_0x1aa939?_0x7db9f1['count']:_0x339edf[_0x8199('0x14')]+_0x339edf[_0x8199('0x12')];var _0x4c9198;if(_0x527550>=_0x2a61e8){_0x527550=_0x2a61e8;_0x4c9198=0xc8;}else{_0x4c9198=0xce;}_0x5ec227[_0x8199('0xe')](_0x4c9198);return _0x5ec227[_0x8199('0x15')]('Content-Range',_0x359b1b+'-'+_0x527550+'/'+_0x2a61e8)['json'](_0x7db9f1);}return null;};}function saveUpdates(_0x3b4430){return function(_0x569881){if(_0x569881){return _0x569881[_0x8199('0x16')](_0x3b4430)[_0x8199('0x17')](function(_0x2c6b66){return _0x2c6b66;});}return null;};}function removeEntity(_0x5ac6ec){return function(_0x488dab){if(_0x488dab){return _0x488dab[_0x8199('0x18')]()[_0x8199('0x17')](function(){_0x5ac6ec[_0x8199('0xe')](0xcc)[_0x8199('0xf')]();});}};}function handleEntityNotFound(_0x1a7734){return function(_0x3212a3){if(!_0x3212a3){_0x1a7734['sendStatus'](0x194);}return _0x3212a3;};}function handleError(_0x595bae,_0x4e4833){_0x4e4833=_0x4e4833||0x1f4;return function(_0x1ee3da){logger[_0x8199('0x19')](_0x1ee3da[_0x8199('0x1a')]);if(_0x1ee3da[_0x8199('0x1b')]){delete _0x1ee3da[_0x8199('0x1b')];}_0x595bae[_0x8199('0xe')](_0x4e4833)[_0x8199('0x1c')](_0x1ee3da);};}exports[_0x8199('0x1d')]=function(_0x25408e,_0x4e20e3){var _0x17a503={};var _0x4b362f=_[_0x8199('0x1e')](db['FaxInteraction'][_0x8199('0x1f')],function(_0x2ca867){return{'name':_0x2ca867[_0x8199('0x20')],'type':_0x2ca867[_0x8199('0x21')][_0x8199('0x22')]};});_0x17a503=qs[_0x8199('0x23')](_0x4b362f,_0x25408e);return interaction['findAll'](_0x8199('0x24'),_0x25408e[_0x8199('0x25')],_0x25408e[_0x8199('0x26')],_0x17a503,_0x4b362f)['then'](respondWithFilteredResult(_0x4e20e3,_0x17a503))['catch'](handleError(_0x4e20e3,null));};exports[_0x8199('0x27')]=function(_0x26bf6b,_0x270e82){var _0x190952={'raw':![],'where':{'id':_0x26bf6b[_0x8199('0x28')]['id']}},_0x2b89a2={};_0x2b89a2[_0x8199('0x29')]=_[_0x8199('0x2a')](db['FaxInteraction'][_0x8199('0x1f')]);_0x2b89a2[_0x8199('0x25')]=_[_0x8199('0x2a')](_0x26bf6b['query']);_0x2b89a2[_0x8199('0x2b')]=_[_0x8199('0x2c')](_0x2b89a2[_0x8199('0x29')],_0x2b89a2['query']);_0x190952[_0x8199('0x2d')]=_['intersection'](_0x2b89a2[_0x8199('0x29')],qs['fields'](_0x26bf6b[_0x8199('0x25')]['fields']));_0x190952['attributes']=_0x190952['attributes'][_0x8199('0x2e')]?_0x190952['attributes']:_0x2b89a2['model'];if(_0x26bf6b['query'][_0x8199('0x2f')]){_0x190952[_0x8199('0x30')]=[{'all':!![]}];}_0x190952=_['merge']({},_0x190952,_0x26bf6b[_0x8199('0x31')]);return db['FaxInteraction'][_0x8199('0x32')](_0x190952)[_0x8199('0x17')](handleEntityNotFound(_0x270e82,null))[_0x8199('0x17')](respondWithResult(_0x270e82,null))[_0x8199('0x33')](handleError(_0x270e82,null));};exports[_0x8199('0x34')]=function(_0x1bc7d2,_0x50e08c){return db['FaxInteraction'][_0x8199('0x34')](_0x1bc7d2[_0x8199('0x35')],{})[_0x8199('0x17')](respondWithResult(_0x50e08c,0xc9))[_0x8199('0x33')](handleError(_0x50e08c,null));};exports['update']=function(_0x4444ae,_0x727942){if(_0x4444ae[_0x8199('0x35')]['id']){delete _0x4444ae['body']['id'];}return db['FaxInteraction'][_0x8199('0x32')]({'where':{'id':_0x4444ae[_0x8199('0x28')]['id']}})[_0x8199('0x17')](handleEntityNotFound(_0x727942,null))[_0x8199('0x17')](saveUpdates(_0x4444ae[_0x8199('0x35')],null))[_0x8199('0x17')](respondWithResult(_0x727942,null))['catch'](handleError(_0x727942,null));};exports[_0x8199('0x18')]=function(_0xa1471,_0x564d38){return db[_0x8199('0x36')][_0x8199('0x32')]({'where':{'id':_0xa1471[_0x8199('0x28')]['id']}})['then'](handleEntityNotFound(_0x564d38,null))[_0x8199('0x17')](removeEntity(_0x564d38,null))[_0x8199('0x33')](handleError(_0x564d38,null));};exports['describe']=function(_0x538d84,_0x1bde7e){return db[_0x8199('0x36')]['describe']()['then'](respondWithResult(_0x1bde7e,null))['catch'](handleError(_0x1bde7e,null));};exports[_0x8199('0x37')]=function(_0x325f5f,_0xb931f9){return db['FaxMessage'][_0x8199('0x32')]({'where':{'id':_0x325f5f[_0x8199('0x28')]['id']}})['then'](handleEntityNotFound(_0xb931f9,null))['then'](function(_0x19d237){if(_0x19d237){return _0x19d237[_0x8199('0x37')](_0x325f5f['body'][_0x8199('0x38')],_[_0x8199('0x39')](_0x325f5f[_0x8199('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0xb931f9,null))[_0x8199('0x33')](handleError(_0xb931f9,null));};exports[_0x8199('0x3a')]=function(_0x4dd01a,_0x31d8a1){var _0x5ee886={'raw':![],'where':{}};var _0x3369e5={};var _0x591892={'count':0x0,'rows':[]};return db[_0x8199('0x36')][_0x8199('0x3b')]({'where':{'id':_0x4dd01a['params']['id']}})[_0x8199('0x17')](handleEntityNotFound(_0x31d8a1,null))[_0x8199('0x17')](function(_0x178af2){if(_0x178af2){_0x3369e5[_0x8199('0x29')]=_[_0x8199('0x2a')](db[_0x8199('0x3c')][_0x8199('0x1f')]);_0x3369e5[_0x8199('0x25')]=_[_0x8199('0x2a')](_0x4dd01a['query']);_0x3369e5[_0x8199('0x2b')]=_['intersection'](_0x3369e5[_0x8199('0x29')],_0x3369e5[_0x8199('0x25')]);_0x5ee886[_0x8199('0x2d')]=_[_0x8199('0x2c')](_0x3369e5[_0x8199('0x29')],qs[_0x8199('0x3d')](_0x4dd01a[_0x8199('0x25')][_0x8199('0x3d')]));_0x5ee886[_0x8199('0x2d')]=_0x5ee886['attributes'][_0x8199('0x2e')]?_0x5ee886[_0x8199('0x2d')]:_0x3369e5[_0x8199('0x29')];if(!_0x4dd01a[_0x8199('0x25')][_0x8199('0x3e')](_0x8199('0x3f'))){_0x5ee886[_0x8199('0x12')]=qs[_0x8199('0x12')](_0x4dd01a['query'][_0x8199('0x12')]);_0x5ee886[_0x8199('0x14')]=qs[_0x8199('0x14')](_0x4dd01a[_0x8199('0x25')]['offset']);}_0x5ee886['order']=qs[_0x8199('0x40')](_0x4dd01a['query']['sort']);_0x5ee886[_0x8199('0x41')]=qs['filters'](_[_0x8199('0x42')](_0x4dd01a[_0x8199('0x25')],_0x3369e5[_0x8199('0x2b')]));_0x5ee886['where'][_0x8199('0x43')]=_0x178af2['id'];if(_0x4dd01a[_0x8199('0x25')][_0x8199('0x44')]){_0x5ee886[_0x8199('0x41')]=_['merge'](_0x5ee886[_0x8199('0x41')],{'$or':_[_0x8199('0x1e')](_0x5ee886[_0x8199('0x2d')],function(_0x2af702){var _0x4f53f0={};_0x4f53f0[_0x2af702]={'$like':'%'+_0x4dd01a[_0x8199('0x25')][_0x8199('0x44')]+'%'};return _0x4f53f0;})});}if(_0x4dd01a[_0x8199('0x25')][_0x8199('0x45')]){var _0x563b6c=_0x4dd01a[_0x8199('0x25')]['$gte'][_0x8199('0x46')](',');var _0x52208c={};_0x52208c[_0x563b6c[0x0]]={'$gte':moment(_0x563b6c[0x1])[_0x8199('0x47')](_0x8199('0x48'))};_0x5ee886[_0x8199('0x41')]=_[_0x8199('0x49')](_0x5ee886[_0x8199('0x41')],_0x52208c);}_0x5ee886=_[_0x8199('0x49')]({},_0x5ee886,_0x4dd01a[_0x8199('0x31')]);return db['FaxMessage'][_0x8199('0x13')]({'where':_0x5ee886[_0x8199('0x41')]})[_0x8199('0x17')](function(_0x32756e){_0x591892[_0x8199('0x13')]=_0x32756e;if(_0x4dd01a[_0x8199('0x25')][_0x8199('0x2f')]){_0x5ee886['include']=[{'all':!![]}];}return db[_0x8199('0x3c')][_0x8199('0x4a')](_0x5ee886);})['then'](function(_0x558e7a){_0x591892['rows']=_0x558e7a;return _0x591892;});}})['then'](respondWithFilteredResult(_0x31d8a1,_0x5ee886))[_0x8199('0x33')](handleError(_0x31d8a1,null));};exports[_0x8199('0x4b')]=function(_0x526ab9,_0x58fad2){return db[_0x8199('0x36')][_0x8199('0x32')]({'where':{'id':_0x526ab9[_0x8199('0x28')]['id']}})['then'](handleEntityNotFound(_0x58fad2,null))[_0x8199('0x17')](function(_0x51579f){if(_0x51579f){return _0x51579f[_0x8199('0x4c')](_0x526ab9[_0x8199('0x35')]['ids'],_[_0x8199('0x39')](_0x526ab9[_0x8199('0x35')],[_0x8199('0x38'),'id'])||{})[_0x8199('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x8199('0x4e')],'where':{'id':_0x526ab9['body'][_0x8199('0x38')]}});})[_0x8199('0x17')](function(_0x5f4760){socket[_0x8199('0x4f')](_0x8199('0x50'),{'id':Number(_0x526ab9[_0x8199('0x28')]['id']),'tags':_0x5f4760||[]});return{'id':Number(_0x526ab9[_0x8199('0x28')]['id']),'tags':_0x5f4760||[]};});}})[_0x8199('0x17')](respondWithResult(_0x58fad2,null))[_0x8199('0x33')](handleError(_0x58fad2,null));};exports[_0x8199('0x51')]=function(_0x2161fd,_0x209fc1){return db[_0x8199('0x36')]['find']({'where':{'id':_0x2161fd[_0x8199('0x28')]['id']}})[_0x8199('0x17')](handleEntityNotFound(_0x209fc1,null))[_0x8199('0x17')](function(_0x3034df){if(_0x3034df){return _0x3034df[_0x8199('0x51')](_0x2161fd[_0x8199('0x25')]['ids']);}})[_0x8199('0x17')](respondWithStatusCode(_0x209fc1,null))[_0x8199('0x33')](handleError(_0x209fc1,null));};exports['download']=function(_0x4099be,_0x173831){var _0x506696=moment()[_0x8199('0x52')]()[_0x8199('0x53')]();var _0x802802=path[_0x8199('0x54')](config[_0x8199('0x55')],_0x8199('0x56'),_0x8199('0x57'),_0x8199('0x58'));var _0x38060b=path['join'](config[_0x8199('0x55')],_0x8199('0x56'),_0x8199('0x57'),_0x8199('0x59'));var _0x4b24dc=path[_0x8199('0x54')](_0x802802,_0x506696);var _0x53c601=util[_0x8199('0x47')](_0x8199('0x5a'),_0x4099be[_0x8199('0x28')]['id'],_0x506696);var _0x3134bb=path[_0x8199('0x54')](_0x802802,_0x53c601);var _0x544d58=[];_0x544d58['push']({'model':db[_0x8199('0x5b')],'as':_0x8199('0x5b'),'raw':!![]});var _0x4d1589=[{'model':db[_0x8199('0x3c')],'as':'Messages','attributes':['id',_0x8199('0x35'),_0x8199('0x5c')],'include':_0x544d58}];return db[_0x8199('0x36')][_0x8199('0x32')]({'where':{'id':_0x4099be[_0x8199('0x28')]['id']},'include':_0x4d1589})[_0x8199('0x17')](handleEntityNotFound(_0x173831,null))[_0x8199('0x17')](function(_0x332f31){if(_0x332f31&&_0x332f31[_0x8199('0x5d')]){var _0x49f950=_0x332f31['get']({'plain':!![]});fs[_0x8199('0x5e')](_0x4b24dc);for(var _0x2022c4=0x0;_0x2022c4<_0x49f950[_0x8199('0x5d')][_0x8199('0x2e')];_0x2022c4++){var _0x3b2241=_0x49f950['Messages'][_0x2022c4][_0x8199('0x5b')];if(_0x3b2241){var _0x499327=path[_0x8199('0x54')](_0x38060b,_0x3b2241[_0x8199('0x5f')]);if(fs[_0x8199('0x60')](_0x499327)){fs[_0x8199('0x61')](_0x499327)['pipe'](fs[_0x8199('0x62')](path[_0x8199('0x54')](_0x4b24dc,_0x3b2241['basename'])));}}}return BPromise[_0x8199('0x63')]()[_0x8199('0x17')](function(){return new BPromise(function(_0x32b761,_0x7d31d9){zipdir(_0x4b24dc,{'saveTo':_0x3134bb},function(_0x507f79,_0x1161c1){if(_0x507f79)return _0x7d31d9(_0x507f79);return _0x32b761(_0x1161c1);});})[_0x8199('0x17')](function(){return new BPromise(function(_0x4acc8b,_0x55ad87){rimraf(_0x4b24dc,function(_0x54c8b5){if(_0x54c8b5)_0x55ad87(_0x54c8b5);return _0x4acc8b();});});})[_0x8199('0x17')](function(){return _0x173831[_0x8199('0x64')](_0x3134bb,_0x53c601,function(_0x44f9c0){if(_0x44f9c0){console[_0x8199('0x65')]('err',_0x44f9c0);}else{fs[_0x8199('0x66')](_0x3134bb);}});});});}else{return _0x173831[_0x8199('0xd')](0xc8);}})['catch'](handleError(_0x173831,null));}; \ No newline at end of file +var _0xa704=['download','toString','join','root','files','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','status','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','findAll','fax','query','user','catch','show','params','model','keys','attributes','intersection','fields','includeAll','merge','options','find','body','update','describe','FaxMessage','addMessage','omit','getMessages','filters','length','nolimit','order','where','pick','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','ids','spread','Tag','color','emit','faxInteractionTags:save','removeTags'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa704,0x1b7));var _0x4a70=function(_0x29a134,_0x194c27){_0x29a134=_0x29a134-0x0;var _0x136398=_0xa704[_0x29a134];return _0x136398;};'use strict';var rimraf=require(_0x4a70('0x0'));var zipdir=require('zip-dir');var moment=require(_0x4a70('0x1'));var BPromise=require(_0x4a70('0x2'));var util=require(_0x4a70('0x3'));var path=require(_0x4a70('0x4'));var fs=require('fs');var _=require(_0x4a70('0x5'));var Redis=require(_0x4a70('0x6'));var interaction=require(_0x4a70('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x4a70('0x8'))(_0x4a70('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4a70('0xa')]=_[_0x4a70('0xb')](config['redis'],{'host':_0x4a70('0xc'),'port':0x18eb});var socket=require(_0x4a70('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x4a70('0xe')](socket);function respondWithStatusCode(_0x49bbe4,_0x5c12da){_0x5c12da=_0x5c12da||0xcc;return function(_0xd6b26c){if(_0xd6b26c){return _0x49bbe4[_0x4a70('0xf')](_0x5c12da);}return _0x49bbe4['status'](_0x5c12da)[_0x4a70('0x10')]();};}function respondWithResult(_0x3f7658,_0xf6f486){_0xf6f486=_0xf6f486||0xc8;return function(_0x3c59ce){if(_0x3c59ce){return _0x3f7658['status'](_0xf6f486)[_0x4a70('0x11')](_0x3c59ce);}};}function respondWithFilteredResult(_0x246b6b,_0x3f55b3){return function(_0x33d30c){if(_0x33d30c){var _0x4c1cc1=typeof _0x3f55b3[_0x4a70('0x12')]===_0x4a70('0x13')&&typeof _0x3f55b3[_0x4a70('0x14')]===_0x4a70('0x13');var _0x377a86=_0x33d30c[_0x4a70('0x15')];var _0x5b400b=_0x4c1cc1?0x0:_0x3f55b3['offset'];var _0x26920f=_0x4c1cc1?_0x33d30c[_0x4a70('0x15')]:_0x3f55b3['offset']+_0x3f55b3[_0x4a70('0x14')];var _0x5d79a7;if(_0x26920f>=_0x377a86){_0x26920f=_0x377a86;_0x5d79a7=0xc8;}else{_0x5d79a7=0xce;}_0x246b6b['status'](_0x5d79a7);return _0x246b6b[_0x4a70('0x16')](_0x4a70('0x17'),_0x5b400b+'-'+_0x26920f+'/'+_0x377a86)[_0x4a70('0x11')](_0x33d30c);}return null;};}function saveUpdates(_0xa7ca00){return function(_0x249074){if(_0x249074){return _0x249074['update'](_0xa7ca00)[_0x4a70('0x18')](function(_0x5bbd4b){return _0x5bbd4b;});}return null;};}function removeEntity(_0x524d50){return function(_0x4f031f){if(_0x4f031f){return _0x4f031f[_0x4a70('0x19')]()[_0x4a70('0x18')](function(){_0x524d50[_0x4a70('0x1a')](0xcc)[_0x4a70('0x10')]();});}};}function handleEntityNotFound(_0x181e3d){return function(_0x41d485){if(!_0x41d485){_0x181e3d[_0x4a70('0xf')](0x194);}return _0x41d485;};}function handleError(_0x3a231d,_0x221407){_0x221407=_0x221407||0x1f4;return function(_0x490304){logger[_0x4a70('0x1b')](_0x490304[_0x4a70('0x1c')]);if(_0x490304[_0x4a70('0x1d')]){delete _0x490304[_0x4a70('0x1d')];}_0x3a231d['status'](_0x221407)[_0x4a70('0x1e')](_0x490304);};}exports[_0x4a70('0x1f')]=function(_0x52546a,_0x4fb05d){var _0x573987={};var _0x22186c=_[_0x4a70('0x20')](db[_0x4a70('0x21')][_0x4a70('0x22')],function(_0x111853){return{'name':_0x111853[_0x4a70('0x23')],'type':_0x111853[_0x4a70('0x24')]['key']};});_0x573987=qs['getOptions'](_0x22186c,_0x52546a);return interaction[_0x4a70('0x25')](_0x4a70('0x26'),_0x52546a[_0x4a70('0x27')],_0x52546a[_0x4a70('0x28')],_0x573987,_0x22186c)[_0x4a70('0x18')](respondWithFilteredResult(_0x4fb05d,_0x573987))[_0x4a70('0x29')](handleError(_0x4fb05d,null));};exports[_0x4a70('0x2a')]=function(_0x4b643b,_0x4a79d4){var _0x2afebb={'raw':![],'where':{'id':_0x4b643b[_0x4a70('0x2b')]['id']}},_0xb9b72a={};_0xb9b72a[_0x4a70('0x2c')]=_[_0x4a70('0x2d')](db['FaxInteraction'][_0x4a70('0x22')]);_0xb9b72a[_0x4a70('0x27')]=_[_0x4a70('0x2d')](_0x4b643b[_0x4a70('0x27')]);_0xb9b72a['filters']=_['intersection'](_0xb9b72a[_0x4a70('0x2c')],_0xb9b72a[_0x4a70('0x27')]);_0x2afebb[_0x4a70('0x2e')]=_[_0x4a70('0x2f')](_0xb9b72a[_0x4a70('0x2c')],qs[_0x4a70('0x30')](_0x4b643b[_0x4a70('0x27')][_0x4a70('0x30')]));_0x2afebb[_0x4a70('0x2e')]=_0x2afebb[_0x4a70('0x2e')]['length']?_0x2afebb[_0x4a70('0x2e')]:_0xb9b72a[_0x4a70('0x2c')];if(_0x4b643b['query'][_0x4a70('0x31')]){_0x2afebb['include']=[{'all':!![]}];}_0x2afebb=_[_0x4a70('0x32')]({},_0x2afebb,_0x4b643b[_0x4a70('0x33')]);return db[_0x4a70('0x21')][_0x4a70('0x34')](_0x2afebb)['then'](handleEntityNotFound(_0x4a79d4,null))[_0x4a70('0x18')](respondWithResult(_0x4a79d4,null))[_0x4a70('0x29')](handleError(_0x4a79d4,null));};exports['create']=function(_0x5d1271,_0x288612){return db['FaxInteraction']['create'](_0x5d1271[_0x4a70('0x35')],{})[_0x4a70('0x18')](respondWithResult(_0x288612,0xc9))[_0x4a70('0x29')](handleError(_0x288612,null));};exports[_0x4a70('0x36')]=function(_0x55388e,_0x258bf3){if(_0x55388e[_0x4a70('0x35')]['id']){delete _0x55388e['body']['id'];}return db['FaxInteraction'][_0x4a70('0x34')]({'where':{'id':_0x55388e[_0x4a70('0x2b')]['id']}})['then'](handleEntityNotFound(_0x258bf3,null))[_0x4a70('0x18')](saveUpdates(_0x55388e[_0x4a70('0x35')],null))[_0x4a70('0x18')](respondWithResult(_0x258bf3,null))[_0x4a70('0x29')](handleError(_0x258bf3,null));};exports['destroy']=function(_0x98aa36,_0xa0afd7){return db[_0x4a70('0x21')]['find']({'where':{'id':_0x98aa36[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0xa0afd7,null))['then'](removeEntity(_0xa0afd7,null))[_0x4a70('0x29')](handleError(_0xa0afd7,null));};exports[_0x4a70('0x37')]=function(_0xe3620d,_0x58d1b3){return db[_0x4a70('0x21')][_0x4a70('0x37')]()[_0x4a70('0x18')](respondWithResult(_0x58d1b3,null))[_0x4a70('0x29')](handleError(_0x58d1b3,null));};exports['addMessage']=function(_0x20b252,_0x3318d1){return db[_0x4a70('0x38')]['find']({'where':{'id':_0x20b252[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0x3318d1,null))['then'](function(_0x5ec442){if(_0x5ec442){return _0x5ec442[_0x4a70('0x39')](_0x20b252['body']['ids'],_[_0x4a70('0x3a')](_0x20b252[_0x4a70('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x3318d1,null))[_0x4a70('0x29')](handleError(_0x3318d1,null));};exports[_0x4a70('0x3b')]=function(_0x568ef8,_0x18b246){var _0x56cf84={'raw':![],'where':{}};var _0x50a0d1={};var _0x381822={'count':0x0,'rows':[]};return db[_0x4a70('0x21')]['findOne']({'where':{'id':_0x568ef8[_0x4a70('0x2b')]['id']}})['then'](handleEntityNotFound(_0x18b246,null))[_0x4a70('0x18')](function(_0x7792e0){if(_0x7792e0){_0x50a0d1['model']=_[_0x4a70('0x2d')](db[_0x4a70('0x38')][_0x4a70('0x22')]);_0x50a0d1['query']=_[_0x4a70('0x2d')](_0x568ef8['query']);_0x50a0d1[_0x4a70('0x3c')]=_[_0x4a70('0x2f')](_0x50a0d1[_0x4a70('0x2c')],_0x50a0d1[_0x4a70('0x27')]);_0x56cf84[_0x4a70('0x2e')]=_[_0x4a70('0x2f')](_0x50a0d1[_0x4a70('0x2c')],qs[_0x4a70('0x30')](_0x568ef8[_0x4a70('0x27')][_0x4a70('0x30')]));_0x56cf84[_0x4a70('0x2e')]=_0x56cf84[_0x4a70('0x2e')][_0x4a70('0x3d')]?_0x56cf84[_0x4a70('0x2e')]:_0x50a0d1[_0x4a70('0x2c')];if(!_0x568ef8[_0x4a70('0x27')]['hasOwnProperty'](_0x4a70('0x3e'))){_0x56cf84[_0x4a70('0x14')]=qs['limit'](_0x568ef8['query'][_0x4a70('0x14')]);_0x56cf84[_0x4a70('0x12')]=qs[_0x4a70('0x12')](_0x568ef8[_0x4a70('0x27')][_0x4a70('0x12')]);}_0x56cf84[_0x4a70('0x3f')]=qs['sort'](_0x568ef8['query']['sort']);_0x56cf84[_0x4a70('0x40')]=qs[_0x4a70('0x3c')](_[_0x4a70('0x41')](_0x568ef8[_0x4a70('0x27')],_0x50a0d1[_0x4a70('0x3c')]));_0x56cf84[_0x4a70('0x40')]['FaxInteractionId']=_0x7792e0['id'];if(_0x568ef8[_0x4a70('0x27')][_0x4a70('0x42')]){_0x56cf84[_0x4a70('0x40')]=_['merge'](_0x56cf84[_0x4a70('0x40')],{'$or':_[_0x4a70('0x20')](_0x56cf84['attributes'],function(_0x16138f){var _0x5df17d={};_0x5df17d[_0x16138f]={'$like':'%'+_0x568ef8[_0x4a70('0x27')][_0x4a70('0x42')]+'%'};return _0x5df17d;})});}if(_0x568ef8[_0x4a70('0x27')]['$gte']){var _0xfc7f66=_0x568ef8[_0x4a70('0x27')]['$gte'][_0x4a70('0x43')](',');var _0x1038ed={};_0x1038ed[_0xfc7f66[0x0]]={'$gte':moment(_0xfc7f66[0x1])[_0x4a70('0x44')](_0x4a70('0x45'))};_0x56cf84[_0x4a70('0x40')]=_[_0x4a70('0x32')](_0x56cf84[_0x4a70('0x40')],_0x1038ed);}_0x56cf84=_[_0x4a70('0x32')]({},_0x56cf84,_0x568ef8['options']);return db['FaxMessage'][_0x4a70('0x15')]({'where':_0x56cf84[_0x4a70('0x40')]})[_0x4a70('0x18')](function(_0x3fd4e4){_0x381822[_0x4a70('0x15')]=_0x3fd4e4;if(_0x568ef8[_0x4a70('0x27')][_0x4a70('0x31')]){_0x56cf84[_0x4a70('0x46')]=[{'all':!![]}];}return db['FaxMessage'][_0x4a70('0x25')](_0x56cf84);})['then'](function(_0x5b62b7){_0x381822[_0x4a70('0x47')]=_0x5b62b7;return _0x381822;});}})['then'](respondWithFilteredResult(_0x18b246,_0x56cf84))[_0x4a70('0x29')](handleError(_0x18b246,null));};exports[_0x4a70('0x48')]=function(_0x574c87,_0x1fe795){return db['FaxInteraction'][_0x4a70('0x34')]({'where':{'id':_0x574c87[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0x1fe795,null))[_0x4a70('0x18')](function(_0x541faa){if(_0x541faa){return _0x541faa[_0x4a70('0x49')](_0x574c87[_0x4a70('0x35')][_0x4a70('0x4a')],_[_0x4a70('0x3a')](_0x574c87[_0x4a70('0x35')],[_0x4a70('0x4a'),'id'])||{})[_0x4a70('0x4b')](function(){return db[_0x4a70('0x4c')][_0x4a70('0x25')]({'attributes':['id',_0x4a70('0x1d'),_0x4a70('0x4d')],'where':{'id':_0x574c87[_0x4a70('0x35')]['ids']}});})[_0x4a70('0x18')](function(_0x3c5d40){socket[_0x4a70('0x4e')](_0x4a70('0x4f'),{'id':Number(_0x574c87[_0x4a70('0x2b')]['id']),'tags':_0x3c5d40||[]});return{'id':Number(_0x574c87[_0x4a70('0x2b')]['id']),'tags':_0x3c5d40||[]};});}})[_0x4a70('0x18')](respondWithResult(_0x1fe795,null))[_0x4a70('0x29')](handleError(_0x1fe795,null));};exports[_0x4a70('0x50')]=function(_0x3b26c3,_0x45534a){return db[_0x4a70('0x21')][_0x4a70('0x34')]({'where':{'id':_0x3b26c3[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0x45534a,null))[_0x4a70('0x18')](function(_0x221a40){if(_0x221a40){return _0x221a40['removeTags'](_0x3b26c3['query']['ids']);}})[_0x4a70('0x18')](respondWithStatusCode(_0x45534a,null))[_0x4a70('0x29')](handleError(_0x45534a,null));};exports[_0x4a70('0x51')]=function(_0x2291f6,_0xf6de97){var _0xb9ddfa=moment()['unix']()[_0x4a70('0x52')]();var _0x97632f=path[_0x4a70('0x53')](config[_0x4a70('0x54')],'server',_0x4a70('0x55'),'tmp');var _0x6780f2=path[_0x4a70('0x53')](config[_0x4a70('0x54')],_0x4a70('0x56'),'files',_0x4a70('0x57'));var _0x1110a5=path[_0x4a70('0x53')](_0x97632f,_0xb9ddfa);var _0x1032b7=util[_0x4a70('0x44')](_0x4a70('0x58'),_0x2291f6[_0x4a70('0x2b')]['id'],_0xb9ddfa);var _0x35fe8d=path['join'](_0x97632f,_0x1032b7);var _0x2114b0=[];_0x2114b0[_0x4a70('0x59')]({'model':db[_0x4a70('0x5a')],'as':_0x4a70('0x5a'),'raw':!![]});var _0x202e48=[{'model':db[_0x4a70('0x38')],'as':_0x4a70('0x5b'),'attributes':['id',_0x4a70('0x35'),_0x4a70('0x5c')],'include':_0x2114b0}];return db[_0x4a70('0x21')][_0x4a70('0x34')]({'where':{'id':_0x2291f6[_0x4a70('0x2b')]['id']},'include':_0x202e48})['then'](handleEntityNotFound(_0xf6de97,null))[_0x4a70('0x18')](function(_0x150652){if(_0x150652&&_0x150652[_0x4a70('0x5b')]){var _0xe6d97c=_0x150652[_0x4a70('0x5d')]({'plain':!![]});fs[_0x4a70('0x5e')](_0x1110a5);for(var _0x2494dc=0x0;_0x2494dc<_0xe6d97c[_0x4a70('0x5b')][_0x4a70('0x3d')];_0x2494dc++){var _0x210dad=_0xe6d97c[_0x4a70('0x5b')][_0x2494dc][_0x4a70('0x5a')];if(_0x210dad){var _0x1ab3e0=path[_0x4a70('0x53')](_0x6780f2,_0x210dad[_0x4a70('0x5f')]);if(fs[_0x4a70('0x60')](_0x1ab3e0)){fs[_0x4a70('0x61')](_0x1ab3e0)[_0x4a70('0x62')](fs[_0x4a70('0x63')](path[_0x4a70('0x53')](_0x1110a5,_0x210dad[_0x4a70('0x5f')])));}}}return BPromise[_0x4a70('0x64')]()[_0x4a70('0x18')](function(){return new BPromise(function(_0x4228c7,_0x444780){zipdir(_0x1110a5,{'saveTo':_0x35fe8d},function(_0x398191,_0x4f409c){if(_0x398191)return _0x444780(_0x398191);return _0x4228c7(_0x4f409c);});})[_0x4a70('0x18')](function(){return new BPromise(function(_0x3f32c0,_0x1a2c6c){rimraf(_0x1110a5,function(_0x1e8b9b){if(_0x1e8b9b)_0x1a2c6c(_0x1e8b9b);return _0x3f32c0();});});})['then'](function(){return _0xf6de97[_0x4a70('0x51')](_0x35fe8d,_0x1032b7,function(_0x483b01){if(_0x483b01){console[_0x4a70('0x65')](_0x4a70('0x66'),_0x483b01);}else{fs[_0x4a70('0x67')](_0x35fe8d);}});});});}else{return _0xf6de97[_0x4a70('0xf')](0xc8);}})['catch'](handleError(_0xf6de97,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b7ea103..b7ea8b2 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 _0x2c04=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x2c84e5,_0x58a7c7){var _0x4990ec=function(_0x5b02b0){while(--_0x5b02b0){_0x2c84e5['push'](_0x2c84e5['shift']());}};_0x4990ec(++_0x58a7c7);}(_0x2c04,0xe7));var _0x42c0=function(_0x56768a,_0x2daafa){_0x56768a=_0x56768a-0x0;var _0x3508dc=_0x2c04[_0x56768a];return _0x3508dc;};'use strict';var EventEmitter=require(_0x42c0('0x0'));var FaxInteraction=require(_0x42c0('0x1'))['db'][_0x42c0('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x42c0('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x42c0('0x4')](0x0);var events={'afterCreate':_0x42c0('0x5'),'afterUpdate':_0x42c0('0x6'),'afterDestroy':'remove'};function emitEvent(_0x65db3){return function(_0x528a23,_0x11a186,_0x179139){_0x528a23[_0x42c0('0x7')]({'attributes':['id'],'raw':!![]})[_0x42c0('0x8')](function(_0x55e9b9){_0x528a23[_0x42c0('0x9')](_0x42c0('0xa'),_0x55e9b9[_0x42c0('0xb')](function(_0x3c0c57){return{'id':_0x3c0c57['id']};}));return FaxMessage[_0x42c0('0xc')]({'where':{'FaxInteractionId':_0x528a23['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x36f88b){_0x528a23[_0x42c0('0x9')](_0x42c0('0xd'),_0x36f88b['length']);FaxInteractionEvents['emit'](_0x65db3+':'+_0x528a23['id'],_0x528a23);FaxInteractionEvents['emit'](_0x65db3,_0x528a23);_0x179139(null);})['catch'](_0x179139(null));};}for(var e in events){if(events[_0x42c0('0xe')](e)){var event=events[e];FaxInteraction[_0x42c0('0xf')](e,emitEvent(event));}}module[_0x42c0('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xa18a=['map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xa18a,0xa0));var _0xaa18=function(_0x42fa36,_0x3f72f5){_0x42fa36=_0x42fa36-0x0;var _0x2a02c4=_0xa18a[_0x42fa36];return _0x2a02c4;};'use strict';var EventEmitter=require(_0xaa18('0x0'));var FaxInteraction=require(_0xaa18('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xaa18('0x1'))['db'][_0xaa18('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xaa18('0x3')](0x0);var events={'afterCreate':_0xaa18('0x4'),'afterUpdate':_0xaa18('0x5'),'afterDestroy':_0xaa18('0x6')};function emitEvent(_0x40abd6){return function(_0x57b5ea,_0x1f94bf,_0x58f914){_0x57b5ea[_0xaa18('0x7')]({'attributes':['id'],'raw':!![]})[_0xaa18('0x8')](function(_0x57b9a9){_0x57b5ea[_0xaa18('0x9')](_0xaa18('0xa'),_0x57b9a9[_0xaa18('0xb')](function(_0x2297da){return{'id':_0x2297da['id']};}));return FaxMessage[_0xaa18('0xc')]({'where':{'FaxInteractionId':_0x57b5ea['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa18('0x8')](function(_0x120b09){_0x57b5ea['setDataValue'](_0xaa18('0xd'),_0x120b09[_0xaa18('0xe')]);FaxInteractionEvents[_0xaa18('0xf')](_0x40abd6+':'+_0x57b5ea['id'],_0x57b5ea);FaxInteractionEvents['emit'](_0x40abd6,_0x57b5ea);_0x58f914(null);})[_0xaa18('0x10')](_0x58f914(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xaa18('0x11')](e,emitEvent(event));}}module[_0xaa18('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 f63b81a..7e642ef 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 _0x8cb8=['YYYY-MM-DD\x20HH:mm:ss','util','api','request-promise','path','rimraf','exports','FaxInteraction','closed','closedAt','format'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8cb8,0x1da));var _0x88cb=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x8cb8[_0x9df3d8];return _0x366da1;};'use strict';var _=require('lodash');var util=require(_0x88cb('0x0'));var logger=require('../../config/logger')(_0x88cb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x88cb('0x2'));var fs=require('fs');var path=require(_0x88cb('0x3'));var rimraf=require(_0x88cb('0x4'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x88cb('0x5')]=function(_0x31cbd9,_0x5bd916){return _0x31cbd9['define'](_0x88cb('0x6'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x549b92,_0x163174,_0x5eb110){if(_0x549b92['changed'](_0x88cb('0x7'))){_0x549b92[_0x88cb('0x8')]=moment()[_0x88cb('0x9')](_0x88cb('0xa'));}_0x5eb110(null,_0x549b92);}}});}; \ No newline at end of file +var _0xd9c4=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x36fe1e,_0x175199){var _0x3368ef=function(_0x74679f){while(--_0x74679f){_0x36fe1e['push'](_0x36fe1e['shift']());}};_0x3368ef(++_0x175199);}(_0xd9c4,0xee));var _0x4d9c=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xd9c4[_0x339129];return _0x1570df;};'use strict';var _=require(_0x4d9c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4d9c('0x1'));var moment=require(_0x4d9c('0x2'));var BPromise=require(_0x4d9c('0x3'));var rp=require(_0x4d9c('0x4'));var fs=require('fs');var path=require(_0x4d9c('0x5'));var rimraf=require(_0x4d9c('0x6'));var config=require(_0x4d9c('0x7'));var attributes=require(_0x4d9c('0x8'));module[_0x4d9c('0x9')]=function(_0x1fa517,_0x1ee9e9){return _0x1fa517[_0x4d9c('0xa')]('FaxInteraction',attributes,{'tableName':_0x4d9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe9ce3c,_0x386bbb,_0x4b863b){if(_0xe9ce3c[_0x4d9c('0xc')](_0x4d9c('0xd'))){_0xe9ce3c[_0x4d9c('0xe')]=moment()[_0x4d9c('0xf')](_0x4d9c('0x10'));}_0x4b863b(null,_0xe9ce3c);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 38e3481..5ac28a6 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 _0xe909=['then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateFaxInteraction','body','options','raw','limit','catch','FaxInteraction','find','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request'];(function(_0x1e399a,_0x351c59){var _0x539897=function(_0x2986fa){while(--_0x2986fa){_0x1e399a['push'](_0x1e399a['shift']());}};_0x539897(++_0x351c59);}(_0xe909,0x13e));var _0x9e90=function(_0x279985,_0x182c0a){_0x279985=_0x279985-0x0;var _0xe09bc7=_0xe909[_0x279985];return _0xe09bc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9e90('0x0'));var rs=require(_0x9e90('0x1'));var fs=require('fs');var Redis=require(_0x9e90('0x2'));var db=require(_0x9e90('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e90('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e90('0x5'));var client=jayson[_0x9e90('0x6')][_0x9e90('0x7')]({'port':0x232a});config['redis']=_[_0x9e90('0x8')](config[_0x9e90('0x9')],{'host':_0x9e90('0xa'),'port':0x18eb});var socket=require(_0x9e90('0xb'))(new Redis(config['redis']));require(_0x9e90('0xc'))[_0x9e90('0xd')](socket);function respondWithRpcPromise(_0xe1410b,_0x1d6e82,_0x57f9d2){return new BPromise(function(_0x4fc077,_0x34144e){return client[_0x9e90('0xe')](_0xe1410b,_0x57f9d2)[_0x9e90('0xf')](function(_0x4fab11){logger[_0x9e90('0x10')](_0x9e90('0x11'),_0x1d6e82,_0x9e90('0x12'));logger[_0x9e90('0x13')](_0x9e90('0x14'),_0x1d6e82,_0x9e90('0x12'),JSON[_0x9e90('0x15')](_0x4fab11));if(_0x4fab11[_0x9e90('0x16')]){if(_0x4fab11['error']['code']===0x1f4){logger[_0x9e90('0x16')](_0x9e90('0x11'),_0x1d6e82,_0x4fab11[_0x9e90('0x16')][_0x9e90('0x17')]);return _0x34144e(_0x4fab11[_0x9e90('0x16')][_0x9e90('0x17')]);}logger[_0x9e90('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x1d6e82,_0x4fab11[_0x9e90('0x16')][_0x9e90('0x17')]);return _0x4fc077(_0x4fab11['error'][_0x9e90('0x17')]);}else{logger[_0x9e90('0x10')](_0x9e90('0x11'),_0x1d6e82,'request\x20sent');_0x4fc077(_0x4fab11[_0x9e90('0x18')]['message']);}})['catch'](function(_0x6e014b){logger[_0x9e90('0x16')](_0x9e90('0x11'),_0x1d6e82,_0x6e014b);_0x34144e(_0x6e014b);});});}exports[_0x9e90('0x19')]=function(_0x5a944c){var _0x1d50a5=this;return new Promise(function(_0x3d9aa6,_0x1998bf){return db['FaxInteraction']['update'](_0x5a944c[_0x9e90('0x1a')],{'raw':_0x5a944c['options']?_0x5a944c[_0x9e90('0x1b')][_0x9e90('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a944c[_0x9e90('0x1b')]?_0x5a944c[_0x9e90('0x1b')]['where']||null:null,'attributes':_0x5a944c[_0x9e90('0x1b')]?_0x5a944c[_0x9e90('0x1b')]['attributes']||null:null,'limit':_0x5a944c[_0x9e90('0x1b')]?_0x5a944c[_0x9e90('0x1b')][_0x9e90('0x1d')]||null:null})[_0x9e90('0xf')](function(_0x7ca210){logger[_0x9e90('0x10')](_0x9e90('0x19'),_0x5a944c);logger[_0x9e90('0x13')]('UpdateFaxInteraction',_0x5a944c,JSON[_0x9e90('0x15')](_0x7ca210));_0x3d9aa6(_0x7ca210);})[_0x9e90('0x1e')](function(_0xbd96be){logger['error'](_0x9e90('0x19'),_0xbd96be['message'],_0x5a944c);_0x1998bf(_0x1d50a5[_0x9e90('0x16')](0x1f4,_0xbd96be[_0x9e90('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x119c71){return new Promise(function(_0x5db9ab,_0x2844ef){return db[_0x9e90('0x1f')][_0x9e90('0x20')]({'where':_0x119c71['options']?_0x119c71[_0x9e90('0x1b')]['where']||null:null})[_0x9e90('0xf')](function(_0x8d0d55){if(_0x8d0d55){return _0x8d0d55['addTags'](_0x119c71[_0x9e90('0x1a')][_0x9e90('0x21')],_[_0x9e90('0x22')](_0x119c71[_0x9e90('0x1a')],['ids','id'])||{});}})[_0x9e90('0x23')](function(_0x39905f){logger['info']('AddTags',_0x119c71);logger[_0x9e90('0x13')](_0x9e90('0x24'),_0x119c71,JSON['stringify'](_0x39905f));_0x5db9ab(_0x39905f);})[_0x9e90('0x1e')](function(_0x49ff87){logger['error'](_0x9e90('0x24'),_0x49ff87[_0x9e90('0x17')],_0x119c71);_0x2844ef(_this['error'](0x1f4,_0x49ff87['message']));});});}; \ No newline at end of file +var _0xd9fb=['omit','spread','AddTags','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','addTags','ids'];(function(_0x19f9ba,_0x5c2938){var _0x556aef=function(_0x2579da){while(--_0x2579da){_0x19f9ba['push'](_0x19f9ba['shift']());}};_0x556aef(++_0x5c2938);}(_0xd9fb,0x88));var _0xbd9f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xd9fb[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xbd9f('0x0'));var util=require('util');var moment=require(_0xbd9f('0x1'));var BPromise=require(_0xbd9f('0x2'));var rs=require(_0xbd9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd9f('0x5'))(_0xbd9f('0x6'));var config=require(_0xbd9f('0x7'));var jayson=require(_0xbd9f('0x8'));var client=jayson[_0xbd9f('0x9')][_0xbd9f('0xa')]({'port':0x232a});config['redis']=_[_0xbd9f('0xb')](config[_0xbd9f('0xc')],{'host':_0xbd9f('0xd'),'port':0x18eb});var socket=require(_0xbd9f('0xe'))(new Redis(config['redis']));require(_0xbd9f('0xf'))[_0xbd9f('0x10')](socket);function respondWithRpcPromise(_0x1e10a8,_0x390b36,_0x6c2e7){return new BPromise(function(_0x5ec584,_0x2f3f80){return client[_0xbd9f('0x11')](_0x1e10a8,_0x6c2e7)[_0xbd9f('0x12')](function(_0x14fe7d){logger[_0xbd9f('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x390b36,_0xbd9f('0x14'));logger[_0xbd9f('0x15')](_0xbd9f('0x16'),_0x390b36,'request\x20sent',JSON['stringify'](_0x14fe7d));if(_0x14fe7d['error']){if(_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x18')]===0x1f4){logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x1a')]);return _0x2f3f80(_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x1a')]);}logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x14fe7d['error'][_0xbd9f('0x1a')]);return _0x5ec584(_0x14fe7d['error'][_0xbd9f('0x1a')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x390b36,_0xbd9f('0x14'));_0x5ec584(_0x14fe7d[_0xbd9f('0x1b')]['message']);}})[_0xbd9f('0x1c')](function(_0x4d28d1){logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x4d28d1);_0x2f3f80(_0x4d28d1);});});}exports['UpdateFaxInteraction']=function(_0x2acca2){var _0x48e637=this;return new Promise(function(_0x29471b,_0x4ddf40){return db['FaxInteraction'][_0xbd9f('0x1d')](_0x2acca2[_0xbd9f('0x1e')],{'raw':_0x2acca2['options']?_0x2acca2[_0xbd9f('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acca2[_0xbd9f('0x1f')]?_0x2acca2['options'][_0xbd9f('0x20')]||null:null,'attributes':_0x2acca2[_0xbd9f('0x1f')]?_0x2acca2[_0xbd9f('0x1f')][_0xbd9f('0x21')]||null:null,'limit':_0x2acca2['options']?_0x2acca2[_0xbd9f('0x1f')][_0xbd9f('0x22')]||null:null})[_0xbd9f('0x12')](function(_0x75b16b){logger[_0xbd9f('0x13')](_0xbd9f('0x23'),_0x2acca2);logger['debug'](_0xbd9f('0x23'),_0x2acca2,JSON['stringify'](_0x75b16b));_0x29471b(_0x75b16b);})['catch'](function(_0x2f0698){logger[_0xbd9f('0x17')](_0xbd9f('0x23'),_0x2f0698[_0xbd9f('0x1a')],_0x2acca2);_0x4ddf40(_0x48e637['error'](0x1f4,_0x2f0698[_0xbd9f('0x1a')]));});});};exports[_0xbd9f('0x24')]=function(_0x4fb83e){return new Promise(function(_0x470258,_0x36982c){return db[_0xbd9f('0x25')]['find']({'where':_0x4fb83e[_0xbd9f('0x1f')]?_0x4fb83e[_0xbd9f('0x1f')][_0xbd9f('0x20')]||null:null})[_0xbd9f('0x12')](function(_0x1c32fc){if(_0x1c32fc){return _0x1c32fc[_0xbd9f('0x26')](_0x4fb83e[_0xbd9f('0x1e')][_0xbd9f('0x27')],_[_0xbd9f('0x28')](_0x4fb83e[_0xbd9f('0x1e')],[_0xbd9f('0x27'),'id'])||{});}})[_0xbd9f('0x29')](function(_0x56e8bc){logger['info'](_0xbd9f('0x2a'),_0x4fb83e);logger[_0xbd9f('0x15')](_0xbd9f('0x2a'),_0x4fb83e,JSON[_0xbd9f('0x2b')](_0x56e8bc));_0x470258(_0x56e8bc);})[_0xbd9f('0x1c')](function(_0x4ca3a1){logger[_0xbd9f('0x17')](_0xbd9f('0x2a'),_0x4ca3a1['message'],_0x4fb83e);_0x36982c(_this[_0xbd9f('0x17')](0x1f4,_0x4ca3a1[_0xbd9f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 60240bc..7943cc2 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 _0x651a=['emit','removeListener','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0x651a,0x135));var _0xa651=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x651a[_0x2f3ecd];return _0xffdc44;};'use strict';var FaxInteractionEvents=require(_0xa651('0x0'));var events=[_0xa651('0x1'),_0xa651('0x2'),'update'];function createListener(_0x5ced0d,_0x20ba14){return function(_0x5e2625){_0x20ba14[_0xa651('0x3')](_0x5ced0d,_0x5e2625);};}function removeListener(_0x592790,_0x2026e9){return function(){FaxInteractionEvents[_0xa651('0x4')](_0x592790,_0x2026e9);};}exports['register']=function(_0x38a876){for(var _0x33d3ad=0x0,_0x4d0a9a=events['length'];_0x33d3ad<_0x4d0a9a;_0x33d3ad++){var _0x53f05e=events[_0x33d3ad];var _0x46e04f=createListener(_0xa651('0x5')+_0x53f05e,_0x38a876);FaxInteractionEvents['on'](_0x53f05e,_0x46e04f);}}; \ No newline at end of file +var _0xf7e5=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf7e5,0x11d));var _0x5f7e=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xf7e5[_0xe6e78c];return _0x2a09c8;};'use strict';var FaxInteractionEvents=require(_0x5f7e('0x0'));var events=['save',_0x5f7e('0x1'),_0x5f7e('0x2')];function createListener(_0x2d6de6,_0x4692ba){return function(_0x414340){_0x4692ba['emit'](_0x2d6de6,_0x414340);};}function removeListener(_0x5e965d,_0x4732b8){return function(){FaxInteractionEvents[_0x5f7e('0x3')](_0x5e965d,_0x4732b8);};}exports[_0x5f7e('0x4')]=function(_0x273955){for(var _0xe6bde7=0x0,_0x375c0e=events[_0x5f7e('0x5')];_0xe6bde7<_0x375c0e;_0xe6bde7++){var _0x30e935=events[_0xe6bde7];var _0x3a7001=createListener(_0x5f7e('0x6')+_0x30e935,_0x273955);FaxInteractionEvents['on'](_0x30e935,_0x3a7001);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b9138d5..f975d2e 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 _0xd7a5=['addMessage','post','/:id/tags','tracked','faxinteraction:addtags','put','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','Router','fs-extra','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getMessages','create','/:id/messages'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0xd7a5,0xb4));var _0x5d7a=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xd7a5[_0x2d994d];return _0xd54be4;};'use strict';var multer=require(_0x5d7a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5d7a('0x1'));var express=require('express');var router=express[_0x5d7a('0x2')]();var fs_extra=require(_0x5d7a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5d7a('0x4'));var controller=require(_0x5d7a('0x5'));router[_0x5d7a('0x6')]('/',auth['isAuthenticated'](),controller[_0x5d7a('0x7')]);router[_0x5d7a('0x6')](_0x5d7a('0x8'),auth[_0x5d7a('0x9')](),controller[_0x5d7a('0xa')]);router[_0x5d7a('0x6')](_0x5d7a('0xb'),auth['isAuthenticated'](),controller[_0x5d7a('0xc')]);router[_0x5d7a('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5d7a('0xd')]);router[_0x5d7a('0x6')]('/:id/download',auth[_0x5d7a('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x5d7a('0xe')]);router['post'](_0x5d7a('0xf'),auth['isAuthenticated'](),controller[_0x5d7a('0x10')]);router[_0x5d7a('0x11')](_0x5d7a('0x12'),auth[_0x5d7a('0x9')](),interaction[_0x5d7a('0x13')]('fax',_0x5d7a('0x14')),controller['addTags']);router[_0x5d7a('0x15')](_0x5d7a('0xb'),auth['isAuthenticated'](),interaction['tracked']('fax','faxinteraction:update'),controller[_0x5d7a('0x16')]);router[_0x5d7a('0x17')]('/:id',auth[_0x5d7a('0x9')](),interaction['tracked']('fax',_0x5d7a('0x18')),controller[_0x5d7a('0x19')]);router[_0x5d7a('0x17')](_0x5d7a('0x12'),auth['isAuthenticated'](),controller[_0x5d7a('0x1a')]);module[_0x5d7a('0x1b')]=router; \ No newline at end of file +var _0x93e2=['faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax'];(function(_0x5d15e3,_0x360f9a){var _0x17dab8=function(_0xfb03f1){while(--_0xfb03f1){_0x5d15e3['push'](_0x5d15e3['shift']());}};_0x17dab8(++_0x360f9a);}(_0x93e2,0x106));var _0x293e=function(_0x3bdc0f,_0x4f0015){_0x3bdc0f=_0x3bdc0f-0x0;var _0xb5ec5b=_0x93e2[_0x3bdc0f];return _0xb5ec5b;};'use strict';var multer=require('multer');var util=require(_0x293e('0x0'));var path=require(_0x293e('0x1'));var timeout=require(_0x293e('0x2'));var express=require(_0x293e('0x3'));var router=express[_0x293e('0x4')]();var fs_extra=require(_0x293e('0x5'));var auth=require(_0x293e('0x6'));var interaction=require(_0x293e('0x7'));var config=require(_0x293e('0x8'));var controller=require('./faxInteraction.controller');router[_0x293e('0x9')]('/',auth[_0x293e('0xa')](),controller[_0x293e('0xb')]);router[_0x293e('0x9')](_0x293e('0xc'),auth[_0x293e('0xa')](),controller[_0x293e('0xd')]);router['get'](_0x293e('0xe'),auth[_0x293e('0xa')](),controller[_0x293e('0xf')]);router[_0x293e('0x9')](_0x293e('0x10'),auth[_0x293e('0xa')](),controller[_0x293e('0x11')]);router[_0x293e('0x9')](_0x293e('0x12'),auth['isAuthenticated'](),controller[_0x293e('0x13')]);router[_0x293e('0x14')]('/',auth[_0x293e('0xa')](),controller[_0x293e('0x15')]);router[_0x293e('0x14')](_0x293e('0x10'),auth['isAuthenticated'](),controller[_0x293e('0x16')]);router[_0x293e('0x14')](_0x293e('0x17'),auth[_0x293e('0xa')](),interaction[_0x293e('0x18')](_0x293e('0x19'),_0x293e('0x1a')),controller[_0x293e('0x1b')]);router[_0x293e('0x1c')]('/:id',auth[_0x293e('0xa')](),interaction[_0x293e('0x18')](_0x293e('0x19'),_0x293e('0x1d')),controller[_0x293e('0x1e')]);router[_0x293e('0x1f')]('/:id',auth['isAuthenticated'](),interaction[_0x293e('0x18')]('fax',_0x293e('0x20')),controller[_0x293e('0x21')]);router[_0x293e('0x1f')](_0x293e('0x17'),auth[_0x293e('0xa')](),controller[_0x293e('0x22')]);module[_0x293e('0x23')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ce80da1..766150f 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 _0xeddd=['medium','ENUM','out','sequelize','exports','TEXT'];(function(_0x2665a3,_0x3bac99){var _0x586de6=function(_0x1034d7){while(--_0x1034d7){_0x2665a3['push'](_0x2665a3['shift']());}};_0x586de6(++_0x3bac99);}(_0xeddd,0x69));var _0xdedd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xeddd[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'body':{'type':Sequelize[_0xdedd('0x2')](_0xdedd('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdedd('0x4')]('in','out'),'defaultValue':_0xdedd('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdedd('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xe198=['ENUM','out','TEXT','sequelize','exports','BOOLEAN'];(function(_0x2507c8,_0x270912){var _0x598c9a=function(_0x53487b){while(--_0x53487b){_0x2507c8['push'](_0x2507c8['shift']());}};_0x598c9a(++_0x270912);}(_0xe198,0x6f));var _0x8e19=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xe198[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8e19('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8e19('0x3')]('in',_0x8e19('0x4')),'defaultValue':_0x8e19('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8e19('0x5')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3d7919c..16f94a3 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 _0x6af6=['interface','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','User','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','Attachment','download','eml-format','fast-json-patch','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','sendStatus','name','map','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FaxMessage','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','body','describe','accept','fax','read','readAt','format','user','agent','get','FaxInteraction','FaxInteractionId','UserId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual'];(function(_0x4cb5a5,_0x32cd53){var _0x5a5db8=function(_0x321d97){while(--_0x321d97){_0x4cb5a5['push'](_0x4cb5a5['shift']());}};_0x5a5db8(++_0x32cd53);}(_0x6af6,0x1c3));var _0x66af=function(_0xb6ee69,_0x3ee4ca){_0xb6ee69=_0xb6ee69-0x0;var _0x182d46=_0x6af6[_0xb6ee69];return _0x182d46;};'use strict';var emlformat=require(_0x66af('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x66af('0x1'));var rp=require('request-promise');var moment=require(_0x66af('0x2'));var BPromise=require(_0x66af('0x3'));var Mustache=require(_0x66af('0x4'));var util=require(_0x66af('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66af('0x6'));var _=require(_0x66af('0x7'));var squel=require(_0x66af('0x8'));var crypto=require(_0x66af('0x9'));var jsforce=require(_0x66af('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x66af('0xb'));var querystring=require(_0x66af('0xc'));var Papa=require(_0x66af('0xd'));var Redis=require(_0x66af('0xe'));var authService=require(_0x66af('0xf'));var qs=require(_0x66af('0x10'));var as=require(_0x66af('0x11'));var hardwareService=require(_0x66af('0x12'));var logger=require(_0x66af('0x13'))('api');var utils=require(_0x66af('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x66af('0x15'));var db=require(_0x66af('0x16'))['db'];config[_0x66af('0x17')]=_['defaults'](config[_0x66af('0x17')],{'host':_0x66af('0x18'),'port':0x18eb});var socket=require(_0x66af('0x19'))(new Redis(config['redis']));require(_0x66af('0x1a'))[_0x66af('0x1b')](socket);var jayson=require(_0x66af('0x1c'));var client=jayson[_0x66af('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x66af('0x1d')][_0x66af('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xea3d9e,_0xc6cee6,_0x4b642e,_0x271c41){return new BPromise(function(_0x3d5a7c,_0x525c66){var _0xc6dfd9=_0x271c41||client;return _0xc6dfd9[_0x66af('0x1f')](_0xea3d9e,_0x4b642e)[_0x66af('0x20')](function(_0x3e6da1){logger[_0x66af('0x21')](_0x66af('0x22'),_0xc6cee6,'request\x20sent');logger[_0x66af('0x23')](_0x66af('0x24'),_0xc6cee6,_0x66af('0x25'),JSON[_0x66af('0x26')](_0x3e6da1));if(_0x3e6da1[_0x66af('0x27')]){if(_0x3e6da1[_0x66af('0x27')][_0x66af('0x28')]===0x1f4){logger['error'](_0x66af('0x22'),_0xc6cee6,_0x3e6da1[_0x66af('0x27')][_0x66af('0x29')]);return _0x525c66(_0x3e6da1[_0x66af('0x27')][_0x66af('0x29')]);}logger[_0x66af('0x27')]('FaxMessage,\x20%s,\x20%s',_0xc6cee6,_0x3e6da1[_0x66af('0x27')][_0x66af('0x29')]);return _0x3d5a7c(_0x3e6da1[_0x66af('0x27')][_0x66af('0x29')]);}else{logger['info'](_0x66af('0x22'),_0xc6cee6,_0x66af('0x25'));_0x3d5a7c(_0x3e6da1[_0x66af('0x2a')]['message']);}})['catch'](function(_0x47f856){logger['error'](_0x66af('0x22'),_0xc6cee6,_0x47f856);_0x525c66(_0x47f856);});});}function respondWithStatusCode(_0x11c820,_0x302381){_0x302381=_0x302381||0xcc;return function(_0x4710b7){if(_0x4710b7){return _0x11c820['sendStatus'](_0x302381);}return _0x11c820['status'](_0x302381)['end']();};}function respondWithResult(_0x35765c,_0x2fa745){_0x2fa745=_0x2fa745||0xc8;return function(_0x59b472){if(_0x59b472){return _0x35765c[_0x66af('0x2b')](_0x2fa745)[_0x66af('0x2c')](_0x59b472);}};}function respondWithFilteredResult(_0x2dd537,_0x20f73a){return function(_0x9877ee){if(_0x9877ee){var _0x15b6c9=typeof _0x20f73a[_0x66af('0x2d')]===_0x66af('0x2e')&&typeof _0x20f73a[_0x66af('0x2f')]===_0x66af('0x2e');var _0x682f9c=_0x9877ee[_0x66af('0x30')];var _0x2cec36=_0x15b6c9?0x0:_0x20f73a[_0x66af('0x2d')];var _0x4ddb0a=_0x15b6c9?_0x9877ee[_0x66af('0x30')]:_0x20f73a[_0x66af('0x2d')]+_0x20f73a['limit'];var _0x3235a0;if(_0x4ddb0a>=_0x682f9c){_0x4ddb0a=_0x682f9c;_0x3235a0=0xc8;}else{_0x3235a0=0xce;}_0x2dd537[_0x66af('0x2b')](_0x3235a0);return _0x2dd537[_0x66af('0x31')](_0x66af('0x32'),_0x2cec36+'-'+_0x4ddb0a+'/'+_0x682f9c)[_0x66af('0x2c')](_0x9877ee);}return null;};}function patchUpdates(_0x13027f){return function(_0x20a2f5){try{jsonpatch[_0x66af('0x33')](_0x20a2f5,_0x13027f,!![]);}catch(_0xf789d){return BPromise[_0x66af('0x34')](_0xf789d);}return _0x20a2f5['save']();};}function saveUpdates(_0x3c4aea,_0x3af062){return function(_0x102419){if(_0x102419){return _0x102419[_0x66af('0x35')](_0x3c4aea)[_0x66af('0x20')](function(_0x2c0c7d){return _0x2c0c7d;});}return null;};}function removeEntity(_0x2d03a6,_0x493dec){return function(_0x40afdd){if(_0x40afdd){return _0x40afdd[_0x66af('0x36')]()[_0x66af('0x20')](function(){_0x2d03a6[_0x66af('0x2b')](0xcc)[_0x66af('0x37')]();});}};}function handleEntityNotFound(_0x33f12a,_0x251270){return function(_0x2217e7){if(!_0x2217e7){_0x33f12a[_0x66af('0x38')](0x194);}return _0x2217e7;};}function handleError(_0x2fc005,_0x2a8a20){_0x2a8a20=_0x2a8a20||0x1f4;return function(_0x8d8657){logger[_0x66af('0x27')](_0x8d8657['stack']);if(_0x8d8657['name']){delete _0x8d8657[_0x66af('0x39')];}_0x2fc005[_0x66af('0x2b')](_0x2a8a20)['send'](_0x8d8657);};}exports['index']=function(_0xd5c0fe,_0x58f052){var _0x163883={},_0xbb25da={},_0x307612={'count':0x0,'rows':[]};var _0x3c97ae=_[_0x66af('0x3a')](db['FaxMessage']['rawAttributes'],function(_0x12d4a7){return{'name':_0x12d4a7['fieldName'],'type':_0x12d4a7['type']['key']};});_0xbb25da[_0x66af('0x3b')]=_[_0x66af('0x3a')](_0x3c97ae,_0x66af('0x39'));_0xbb25da[_0x66af('0x3c')]=_['keys'](_0xd5c0fe[_0x66af('0x3c')]);_0xbb25da[_0x66af('0x3d')]=_[_0x66af('0x3e')](_0xbb25da[_0x66af('0x3b')],_0xbb25da[_0x66af('0x3c')]);_0x163883[_0x66af('0x3f')]=_[_0x66af('0x3e')](_0xbb25da[_0x66af('0x3b')],qs[_0x66af('0x40')](_0xd5c0fe['query'][_0x66af('0x40')]));_0x163883['attributes']=_0x163883[_0x66af('0x3f')][_0x66af('0x41')]?_0x163883[_0x66af('0x3f')]:_0xbb25da[_0x66af('0x3b')];if(!_0xd5c0fe[_0x66af('0x3c')]['hasOwnProperty'](_0x66af('0x42'))){_0x163883[_0x66af('0x2f')]=qs[_0x66af('0x2f')](_0xd5c0fe[_0x66af('0x3c')][_0x66af('0x2f')]);_0x163883[_0x66af('0x2d')]=qs[_0x66af('0x2d')](_0xd5c0fe[_0x66af('0x3c')][_0x66af('0x2d')]);}_0x163883[_0x66af('0x43')]=qs[_0x66af('0x44')](_0xd5c0fe[_0x66af('0x3c')][_0x66af('0x44')]);_0x163883[_0x66af('0x45')]=qs[_0x66af('0x3d')](_[_0x66af('0x46')](_0xd5c0fe[_0x66af('0x3c')],_0xbb25da[_0x66af('0x3d')]),_0x3c97ae);if(_0xd5c0fe['query'][_0x66af('0x47')]){_0x163883[_0x66af('0x45')]=_[_0x66af('0x48')](_0x163883[_0x66af('0x45')],{'$or':_[_0x66af('0x3a')](_0x3c97ae,function(_0x13b884){if(_0x13b884[_0x66af('0x49')]!==_0x66af('0x4a')){var _0x14f386={};_0x14f386[_0x13b884['name']]={'$like':'%'+_0xd5c0fe['query'][_0x66af('0x47')]+'%'};return _0x14f386;}})});}_0x163883=_[_0x66af('0x48')]({},_0x163883,_0xd5c0fe[_0x66af('0x4b')]);var _0x58735e={'where':_0x163883[_0x66af('0x45')]};return db[_0x66af('0x4c')][_0x66af('0x30')](_0x58735e)[_0x66af('0x20')](function(_0x1217df){_0x307612['count']=_0x1217df;if(_0xd5c0fe['query'][_0x66af('0x4d')]){_0x163883['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x163883);})[_0x66af('0x20')](function(_0x3efaee){_0x307612[_0x66af('0x4e')]=_0x3efaee;return _0x307612;})[_0x66af('0x20')](respondWithFilteredResult(_0x58f052,_0x163883))[_0x66af('0x4f')](handleError(_0x58f052,null));};exports[_0x66af('0x50')]=function(_0x21c8c0,_0x3a76bc){var _0x5c735c={'raw':!![],'where':{'id':_0x21c8c0[_0x66af('0x51')]['id']}},_0x3503a0={};_0x3503a0[_0x66af('0x3b')]=_[_0x66af('0x52')](db[_0x66af('0x4c')][_0x66af('0x53')]);_0x3503a0['query']=_['keys'](_0x21c8c0[_0x66af('0x3c')]);_0x3503a0['filters']=_[_0x66af('0x3e')](_0x3503a0['model'],_0x3503a0[_0x66af('0x3c')]);_0x5c735c[_0x66af('0x3f')]=_[_0x66af('0x3e')](_0x3503a0[_0x66af('0x3b')],qs[_0x66af('0x40')](_0x21c8c0[_0x66af('0x3c')]['fields']));_0x5c735c[_0x66af('0x3f')]=_0x5c735c[_0x66af('0x3f')][_0x66af('0x41')]?_0x5c735c[_0x66af('0x3f')]:_0x3503a0[_0x66af('0x3b')];if(_0x21c8c0[_0x66af('0x3c')][_0x66af('0x4d')]){_0x5c735c[_0x66af('0x54')]=[{'all':!![]}];}_0x5c735c=_[_0x66af('0x48')]({},_0x5c735c,_0x21c8c0[_0x66af('0x4b')]);return db[_0x66af('0x4c')][_0x66af('0x55')](_0x5c735c)['then'](handleEntityNotFound(_0x3a76bc,null))[_0x66af('0x20')](respondWithResult(_0x3a76bc,null))['catch'](handleError(_0x3a76bc,null));};exports[_0x66af('0x35')]=function(_0x162d3c,_0x10c940){if(_0x162d3c[_0x66af('0x56')]['id']){delete _0x162d3c[_0x66af('0x56')]['id'];}return db['FaxMessage'][_0x66af('0x55')]({'where':{'id':_0x162d3c[_0x66af('0x51')]['id']}})[_0x66af('0x20')](handleEntityNotFound(_0x10c940,null))[_0x66af('0x20')](saveUpdates(_0x162d3c[_0x66af('0x56')],null))[_0x66af('0x20')](respondWithResult(_0x10c940,null))['catch'](handleError(_0x10c940,null));};exports[_0x66af('0x36')]=function(_0x3daac1,_0x16eb9b){return db[_0x66af('0x4c')]['find']({'where':{'id':_0x3daac1[_0x66af('0x51')]['id']}})[_0x66af('0x20')](handleEntityNotFound(_0x16eb9b,null))[_0x66af('0x20')](removeEntity(_0x16eb9b,null))[_0x66af('0x4f')](handleError(_0x16eb9b,null));};exports[_0x66af('0x57')]=function(_0x1c7d8d,_0x33abf1){return db['FaxMessage']['describe']()[_0x66af('0x20')](respondWithResult(_0x33abf1,null))[_0x66af('0x4f')](handleError(_0x33abf1,null));};var interaction_log=require(_0x66af('0x13'))('fax-interactions');exports[_0x66af('0x58')]=function(_0x1851cb,_0xc8bfec,_0x3064ec){var _0xd41256={'agent':{},'channel':_0x66af('0x59')};if(_0x1851cb[_0x66af('0x56')]['id']){delete _0x1851cb[_0x66af('0x56')]['id'];}_0x1851cb[_0x66af('0x56')][_0x66af('0x5a')]=!![];_0x1851cb[_0x66af('0x56')][_0x66af('0x5b')]=moment()[_0x66af('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x1851cb[_0x66af('0x56')]['UserId']=_0x1851cb['body']['UserId']||_0x1851cb[_0x66af('0x5d')]['id'];_0xd41256[_0x66af('0x5e')]['id']=_0x1851cb[_0x66af('0x56')]['UserId'];return db[_0x66af('0x4c')][_0x66af('0x55')]({'where':{'id':_0x1851cb['params']['id'],'UserId':null}})[_0x66af('0x20')](handleEntityNotFound(_0xc8bfec,null))[_0x66af('0x20')](saveUpdates(_0x1851cb[_0x66af('0x56')],null))['then'](function(_0x3f6ecb){if(_0x3f6ecb){_0xd41256[_0x66af('0x29')]=_0x3f6ecb[_0x66af('0x5f')]({'plain':!![]});return db[_0x66af('0x60')][_0x66af('0x55')]({'where':{'id':_0x3f6ecb[_0x66af('0x61')]}});}return null;})[_0x66af('0x20')](handleEntityNotFound(_0xc8bfec,null))[_0x66af('0x20')](function(_0x92291a){if(_0x92291a){return _0x92291a[_0x66af('0x35')]({'UserId':_0x1851cb[_0x66af('0x56')][_0x66af('0x62')],'read1stAt':_[_0x66af('0x63')](_0x92291a[_0x66af('0x64')])?moment()[_0x66af('0x5c')](_0x66af('0x65')):undefined});}return null;})[_0x66af('0x20')](function(_0xdd166a){if(_0xdd166a){_0xd41256[_0x66af('0x66')]=_0xdd166a[_0x66af('0x5f')]({'plain':!![]});interaction_log[_0x66af('0x21')](_0x66af('0x67'),_0x1851cb[_0x66af('0x5d')]['id'],_0x1851cb['user']['name'],_0x1851cb['user'][_0x66af('0x68')],_0xd41256['interaction']['id'],_0x1851cb[_0x66af('0x56')]?JSON['stringify'](_0x1851cb['body']):_0x66af('0x69'));return respondWithRpcPromise(_0x66af('0x6a'),'acceptMessage',_0xd41256);}return null;})['then'](function(_0x10ac04){var _0x1266d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x10ac04[_0x66af('0x29')][_0x66af('0x6b')];return db[_0x66af('0x6c')][_0x66af('0x3c')](_0x1266d,{'type':db[_0x66af('0x6d')][_0x66af('0x6e')][_0x66af('0x6f')],'raw':!![]})['then'](function(_0x2a011a){return _0x2a011a;});})[_0x66af('0x20')](function(_0x80489c){if(_0x80489c){_0xd41256[_0x66af('0x29')][_0x66af('0x70')]=_0x80489c[0x0];if(!_0x1851cb[_0x66af('0x56')][_0x66af('0x62')])return;return db['User'][_0x66af('0x55')]({'where':{'id':_0x1851cb[_0x66af('0x56')]['UserId'],'role':_0x66af('0x5e')},'attributes':['id',_0x66af('0x39'),_0x66af('0x71'),_0x66af('0x72'),_0x66af('0x73')],'raw':!![]});}return null;})[_0x66af('0x20')](function(_0x326968){if(!_0x326968)return null;_0xd41256[_0x66af('0x29')][_0x66af('0x5e')]=_0x326968;return _0xd41256;})[_0x66af('0x20')](function(_0x307ee9){if(_0x307ee9){if(_0x1851cb[_0x66af('0x56')][_0x66af('0x74')]){_0xd41256[_0x66af('0x29')][_0x66af('0x75')]=util[_0x66af('0x5c')]('SIP/%s',_0x1851cb[_0x66af('0x5d')][_0x66af('0x39')]);_0xd41256[_0x66af('0x29')][_0x66af('0x76')]=_0xd41256[_0x66af('0x76')];_0xd41256['message'][_0x66af('0x77')]=_0xd41256[_0x66af('0x76')];_0xd41256[_0x66af('0x29')][_0x66af('0x78')]=_0x66af('0x58');return respondWithRpcPromise(_0x66af('0x79'),_0x66af('0x79'),{'event':_0x66af('0x7a'),'message':_0xd41256['message']},client9002)[_0x66af('0x20')](function(){return _0xd41256;});}return _0xd41256;}return null;})[_0x66af('0x20')](respondWithResult(_0xc8bfec,null))[_0x66af('0x4f')](handleError(_0xc8bfec,null));};var interaction_log=require(_0x66af('0x13'))(_0x66af('0x7b'));exports[_0x66af('0x34')]=function(_0x988bda,_0x27fb83,_0x107ae1){var _0x22f351={'agent':{},'channel':_0x66af('0x59')};if(_0x988bda[_0x66af('0x56')]['id']){delete _0x988bda['body']['id'];}_0x988bda[_0x66af('0x56')][_0x66af('0x62')]=_0x988bda[_0x66af('0x56')][_0x66af('0x62')]||_0x988bda['user']['id'];_0x22f351['agent']['id']=_0x988bda[_0x66af('0x56')][_0x66af('0x62')];return db[_0x66af('0x4c')][_0x66af('0x55')]({'where':{'id':_0x988bda[_0x66af('0x51')]['id'],'UserId':null}})[_0x66af('0x20')](handleEntityNotFound(_0x27fb83,null))[_0x66af('0x20')](function(_0x55fc2e){if(_0x55fc2e){_0x22f351['message']=_0x55fc2e[_0x66af('0x5f')]({'plain':!![]});return db[_0x66af('0x60')]['find']({'where':{'id':_0x55fc2e['FaxInteractionId']}});}return null;})[_0x66af('0x20')](handleEntityNotFound(_0x27fb83,null))[_0x66af('0x20')](function(_0x497660){if(_0x497660){_0x22f351[_0x66af('0x66')]=_0x497660[_0x66af('0x5f')]({'plain':!![]});interaction_log['info'](_0x66af('0x7c'),_0x988bda[_0x66af('0x5d')]['id'],_0x988bda[_0x66af('0x5d')][_0x66af('0x39')],_0x988bda[_0x66af('0x5d')][_0x66af('0x68')],_0x22f351[_0x66af('0x66')]['id'],_0x988bda[_0x66af('0x56')]?JSON[_0x66af('0x26')](_0x988bda['body']):_0x66af('0x69'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x22f351);}return null;})[_0x66af('0x20')](function(_0x5b00dc){var _0x8f2f2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b00dc['message']['ContactId'];return db[_0x66af('0x6c')][_0x66af('0x3c')](_0x8f2f2e,{'type':db[_0x66af('0x6d')][_0x66af('0x6e')][_0x66af('0x6f')],'raw':!![]})['then'](function(_0xd993fb){return _0xd993fb;});})[_0x66af('0x20')](function(_0x1f49d6){if(_0x1f49d6){_0x22f351[_0x66af('0x29')]['contact']=_0x1f49d6[0x0];if(!_0x988bda[_0x66af('0x56')]['UserId'])return;return db[_0x66af('0x7d')]['find']({'where':{'id':_0x988bda[_0x66af('0x56')][_0x66af('0x62')],'role':_0x66af('0x5e')},'attributes':['id',_0x66af('0x39'),'fullname',_0x66af('0x72'),'internal'],'raw':!![]});}return null;})[_0x66af('0x20')](function(_0x246543){if(!_0x246543)return null;_0x22f351['message'][_0x66af('0x5e')]=_0x246543;return _0x22f351;})[_0x66af('0x20')](function(_0x199b87){if(_0x199b87){_0x199b87[_0x66af('0x29')][_0x66af('0x75')]=util[_0x66af('0x5c')]('SIP/%s',_0x988bda[_0x66af('0x5d')]['name']);_0x199b87[_0x66af('0x29')][_0x66af('0x76')]=_0x22f351[_0x66af('0x76')];_0x199b87[_0x66af('0x29')][_0x66af('0x77')]=_0x22f351[_0x66af('0x76')];_0x199b87[_0x66af('0x29')][_0x66af('0x78')]=_0x66af('0x34');respondWithRpcPromise('EventManager',_0x66af('0x79'),{'event':_0x66af('0x7e'),'message':_0x199b87[_0x66af('0x29')]},client9002);return _0x22f351;}return null;})[_0x66af('0x20')](respondWithResult(_0x27fb83,null))[_0x66af('0x4f')](handleError(_0x27fb83,null));};exports[_0x66af('0x7f')]=function(_0x3a3a68,_0xe120b){var _0x46bfb9;return db[_0x66af('0x4c')][_0x66af('0x7f')](_0x3a3a68[_0x66af('0x56')],{})['then'](function(_0x59d8cf){_0x46bfb9=_0x59d8cf;return db[_0x66af('0x80')][_0x66af('0x81')]({'where':{'id':_0x46bfb9[_0x66af('0x6b')]}});})[_0x66af('0x20')](function(_0x2144a4){if(_[_0x66af('0x63')](_0x2144a4)){return;}else{_0x46bfb9['fax']=_0x2144a4[_0x66af('0x59')];return db['Attachment']['findOne']({'where':{'id':_0x46bfb9[_0x66af('0x82')]}});}})[_0x66af('0x20')](function(_0x331295){return respondWithRpcPromise('SendFax',_0x66af('0x83'),{'FaxAccountId':_[_0x66af('0x63')](_0x3a3a68[_0x66af('0x56')])?undefined:_0x3a3a68[_0x66af('0x56')][_0x66af('0x84')],'path':_[_0x66af('0x63')](_0x331295)?undefined:util[_0x66af('0x5c')](_0x66af('0x85'),_0x331295[_0x66af('0x86')]),'fax':_[_0x66af('0x63')](_0x46bfb9['fax'])?undefined:_0x46bfb9['fax'],'AttachmentId':_0x46bfb9[_0x66af('0x82')]},client9002);})[_0x66af('0x20')](respondWithResult(_0xe120b,0xc9))[_0x66af('0x4f')](handleError(_0xe120b,null));};exports['download']=function(_0x5cd27b,_0x2b0c4f){var _0x196638=path[_0x66af('0x87')](config[_0x66af('0x88')],_0x66af('0x89'),_0x66af('0x8a'),_0x66af('0x8b'));return db['FaxMessage'][_0x66af('0x55')]({'where':{'id':_0x5cd27b['params']['id']},'include':[{'model':db[_0x66af('0x8c')],'as':_0x66af('0x8c')}]})['then'](handleEntityNotFound(_0x2b0c4f,null))[_0x66af('0x20')](function(_0x526661){if(_0x526661){return _0x2b0c4f[_0x66af('0x8d')](path['join'](_0x196638,_0x526661[_0x66af('0x8c')]['basename']));}})[_0x66af('0x4f')](handleError(_0x2b0c4f,null));}; \ No newline at end of file +var _0x7555=['YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','FaxInteractionId','RejectMessage','contact','agent','internal','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','length','find','body','destroy','params','describe','fax-interactions','fax','read','readAt','format'];(function(_0x5b8bf3,_0x3637b9){var _0x1c0a36=function(_0x3df331){while(--_0x3df331){_0x5b8bf3['push'](_0x5b8bf3['shift']());}};_0x1c0a36(++_0x3637b9);}(_0x7555,0xc5));var _0x5755=function(_0x4445d4,_0x38ae54){_0x4445d4=_0x4445d4-0x0;var _0x3cbd43=_0x7555[_0x4445d4];return _0x3cbd43;};'use strict';var emlformat=require(_0x5755('0x0'));var rimraf=require(_0x5755('0x1'));var zipdir=require(_0x5755('0x2'));var jsonpatch=require(_0x5755('0x3'));var rp=require(_0x5755('0x4'));var moment=require(_0x5755('0x5'));var BPromise=require(_0x5755('0x6'));var Mustache=require('mustache');var util=require(_0x5755('0x7'));var path=require(_0x5755('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5755('0x9'));var fs=require('fs');var fs_extra=require(_0x5755('0xa'));var _=require(_0x5755('0xb'));var squel=require(_0x5755('0xc'));var crypto=require('crypto');var jsforce=require(_0x5755('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5755('0xe'));var Papa=require(_0x5755('0xf'));var Redis=require(_0x5755('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5755('0x11'));var as=require(_0x5755('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5755('0x13'))(_0x5755('0x14'));var utils=require(_0x5755('0x15'));var config=require(_0x5755('0x16'));var licenseUtil=require(_0x5755('0x17'));var db=require(_0x5755('0x18'))['db'];config['redis']=_[_0x5755('0x19')](config[_0x5755('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5755('0x1b'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x5755('0x1c')](socket);var jayson=require(_0x5755('0x1d'));var client=jayson['client'][_0x5755('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x5755('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ca68b,_0x45f189,_0x20f7a1,_0x1d93e3){return new BPromise(function(_0xa0e585,_0x42313a){var _0x472889=_0x1d93e3||client;return _0x472889[_0x5755('0x1f')](_0x5ca68b,_0x20f7a1)[_0x5755('0x20')](function(_0x384f5b){logger[_0x5755('0x21')](_0x5755('0x22'),_0x45f189,_0x5755('0x23'));logger['debug'](_0x5755('0x24'),_0x45f189,_0x5755('0x23'),JSON['stringify'](_0x384f5b));if(_0x384f5b[_0x5755('0x25')]){if(_0x384f5b[_0x5755('0x25')][_0x5755('0x26')]===0x1f4){logger[_0x5755('0x25')](_0x5755('0x22'),_0x45f189,_0x384f5b[_0x5755('0x25')][_0x5755('0x27')]);return _0x42313a(_0x384f5b[_0x5755('0x25')][_0x5755('0x27')]);}logger[_0x5755('0x25')](_0x5755('0x22'),_0x45f189,_0x384f5b['error'][_0x5755('0x27')]);return _0xa0e585(_0x384f5b['error'][_0x5755('0x27')]);}else{logger[_0x5755('0x21')](_0x5755('0x22'),_0x45f189,'request\x20sent');_0xa0e585(_0x384f5b[_0x5755('0x28')][_0x5755('0x27')]);}})[_0x5755('0x29')](function(_0x11ba43){logger[_0x5755('0x25')]('FaxMessage,\x20%s,\x20%s',_0x45f189,_0x11ba43);_0x42313a(_0x11ba43);});});}function respondWithStatusCode(_0x3985bc,_0x18babc){_0x18babc=_0x18babc||0xcc;return function(_0x21e715){if(_0x21e715){return _0x3985bc[_0x5755('0x2a')](_0x18babc);}return _0x3985bc[_0x5755('0x2b')](_0x18babc)[_0x5755('0x2c')]();};}function respondWithResult(_0x41d534,_0xc67872){_0xc67872=_0xc67872||0xc8;return function(_0x4cfc56){if(_0x4cfc56){return _0x41d534['status'](_0xc67872)[_0x5755('0x2d')](_0x4cfc56);}};}function respondWithFilteredResult(_0x39dc3a,_0x41a0cb){return function(_0x370374){if(_0x370374){var _0x85053f=typeof _0x41a0cb['offset']===_0x5755('0x2e')&&typeof _0x41a0cb[_0x5755('0x2f')]===_0x5755('0x2e');var _0x2c2d9b=_0x370374['count'];var _0x28c479=_0x85053f?0x0:_0x41a0cb['offset'];var _0x1f354b=_0x85053f?_0x370374[_0x5755('0x30')]:_0x41a0cb[_0x5755('0x31')]+_0x41a0cb[_0x5755('0x2f')];var _0x1205eb;if(_0x1f354b>=_0x2c2d9b){_0x1f354b=_0x2c2d9b;_0x1205eb=0xc8;}else{_0x1205eb=0xce;}_0x39dc3a['status'](_0x1205eb);return _0x39dc3a[_0x5755('0x32')](_0x5755('0x33'),_0x28c479+'-'+_0x1f354b+'/'+_0x2c2d9b)[_0x5755('0x2d')](_0x370374);}return null;};}function patchUpdates(_0x4462da){return function(_0x4251e8){try{jsonpatch[_0x5755('0x34')](_0x4251e8,_0x4462da,!![]);}catch(_0xc4ee3e){return BPromise[_0x5755('0x35')](_0xc4ee3e);}return _0x4251e8[_0x5755('0x36')]();};}function saveUpdates(_0x4fed30,_0x517041){return function(_0x1f8a3e){if(_0x1f8a3e){return _0x1f8a3e[_0x5755('0x37')](_0x4fed30)[_0x5755('0x20')](function(_0x21fe5a){return _0x21fe5a;});}return null;};}function removeEntity(_0x2e9199,_0x2d8a48){return function(_0x261f48){if(_0x261f48){return _0x261f48['destroy']()[_0x5755('0x20')](function(){_0x2e9199[_0x5755('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f95f,_0xb8b588){return function(_0x23786a){if(!_0x23786a){_0x47f95f['sendStatus'](0x194);}return _0x23786a;};}function handleError(_0x1f0bd2,_0x511372){_0x511372=_0x511372||0x1f4;return function(_0x456c53){logger[_0x5755('0x25')](_0x456c53[_0x5755('0x38')]);if(_0x456c53[_0x5755('0x39')]){delete _0x456c53[_0x5755('0x39')];}_0x1f0bd2[_0x5755('0x2b')](_0x511372)['send'](_0x456c53);};}exports[_0x5755('0x3a')]=function(_0x967b7e,_0x22d435){var _0x1c51c5={},_0x379e5b={},_0x2e911d={'count':0x0,'rows':[]};var _0xce4f0=_[_0x5755('0x3b')](db[_0x5755('0x3c')][_0x5755('0x3d')],function(_0x2908a8){return{'name':_0x2908a8[_0x5755('0x3e')],'type':_0x2908a8[_0x5755('0x3f')][_0x5755('0x40')]};});_0x379e5b[_0x5755('0x41')]=_[_0x5755('0x3b')](_0xce4f0,'name');_0x379e5b[_0x5755('0x42')]=_['keys'](_0x967b7e[_0x5755('0x42')]);_0x379e5b[_0x5755('0x43')]=_['intersection'](_0x379e5b[_0x5755('0x41')],_0x379e5b[_0x5755('0x42')]);_0x1c51c5[_0x5755('0x44')]=_[_0x5755('0x45')](_0x379e5b[_0x5755('0x41')],qs[_0x5755('0x46')](_0x967b7e[_0x5755('0x42')][_0x5755('0x46')]));_0x1c51c5['attributes']=_0x1c51c5[_0x5755('0x44')]['length']?_0x1c51c5[_0x5755('0x44')]:_0x379e5b[_0x5755('0x41')];if(!_0x967b7e[_0x5755('0x42')][_0x5755('0x47')](_0x5755('0x48'))){_0x1c51c5[_0x5755('0x2f')]=qs[_0x5755('0x2f')](_0x967b7e[_0x5755('0x42')]['limit']);_0x1c51c5[_0x5755('0x31')]=qs[_0x5755('0x31')](_0x967b7e['query'][_0x5755('0x31')]);}_0x1c51c5[_0x5755('0x49')]=qs[_0x5755('0x4a')](_0x967b7e['query'][_0x5755('0x4a')]);_0x1c51c5[_0x5755('0x4b')]=qs[_0x5755('0x43')](_[_0x5755('0x4c')](_0x967b7e[_0x5755('0x42')],_0x379e5b['filters']),_0xce4f0);if(_0x967b7e[_0x5755('0x42')][_0x5755('0x4d')]){_0x1c51c5[_0x5755('0x4b')]=_['merge'](_0x1c51c5['where'],{'$or':_[_0x5755('0x3b')](_0xce4f0,function(_0xc94b40){if(_0xc94b40[_0x5755('0x3f')]!==_0x5755('0x4e')){var _0x45fdcd={};_0x45fdcd[_0xc94b40[_0x5755('0x39')]]={'$like':'%'+_0x967b7e[_0x5755('0x42')][_0x5755('0x4d')]+'%'};return _0x45fdcd;}})});}_0x1c51c5=_[_0x5755('0x4f')]({},_0x1c51c5,_0x967b7e[_0x5755('0x50')]);var _0x4183e2={'where':_0x1c51c5[_0x5755('0x4b')]};return db[_0x5755('0x3c')][_0x5755('0x30')](_0x4183e2)[_0x5755('0x20')](function(_0x568c6e){_0x2e911d[_0x5755('0x30')]=_0x568c6e;if(_0x967b7e[_0x5755('0x42')][_0x5755('0x51')]){_0x1c51c5[_0x5755('0x52')]=[{'all':!![]}];}return db[_0x5755('0x3c')][_0x5755('0x53')](_0x1c51c5);})['then'](function(_0x801785){_0x2e911d['rows']=_0x801785;return _0x2e911d;})[_0x5755('0x20')](respondWithFilteredResult(_0x22d435,_0x1c51c5))[_0x5755('0x29')](handleError(_0x22d435,null));};exports[_0x5755('0x54')]=function(_0x1a22bf,_0x31f611){var _0x3da44c={'raw':!![],'where':{'id':_0x1a22bf['params']['id']}},_0x4a139f={};_0x4a139f[_0x5755('0x41')]=_[_0x5755('0x55')](db['FaxMessage'][_0x5755('0x3d')]);_0x4a139f[_0x5755('0x42')]=_['keys'](_0x1a22bf[_0x5755('0x42')]);_0x4a139f[_0x5755('0x43')]=_[_0x5755('0x45')](_0x4a139f[_0x5755('0x41')],_0x4a139f[_0x5755('0x42')]);_0x3da44c[_0x5755('0x44')]=_[_0x5755('0x45')](_0x4a139f[_0x5755('0x41')],qs[_0x5755('0x46')](_0x1a22bf[_0x5755('0x42')][_0x5755('0x46')]));_0x3da44c['attributes']=_0x3da44c[_0x5755('0x44')][_0x5755('0x56')]?_0x3da44c[_0x5755('0x44')]:_0x4a139f['model'];if(_0x1a22bf[_0x5755('0x42')]['includeAll']){_0x3da44c[_0x5755('0x52')]=[{'all':!![]}];}_0x3da44c=_[_0x5755('0x4f')]({},_0x3da44c,_0x1a22bf['options']);return db[_0x5755('0x3c')][_0x5755('0x57')](_0x3da44c)[_0x5755('0x20')](handleEntityNotFound(_0x31f611,null))[_0x5755('0x20')](respondWithResult(_0x31f611,null))['catch'](handleError(_0x31f611,null));};exports[_0x5755('0x37')]=function(_0x3087f9,_0x496952){if(_0x3087f9[_0x5755('0x58')]['id']){delete _0x3087f9[_0x5755('0x58')]['id'];}return db[_0x5755('0x3c')][_0x5755('0x57')]({'where':{'id':_0x3087f9['params']['id']}})[_0x5755('0x20')](handleEntityNotFound(_0x496952,null))[_0x5755('0x20')](saveUpdates(_0x3087f9[_0x5755('0x58')],null))[_0x5755('0x20')](respondWithResult(_0x496952,null))[_0x5755('0x29')](handleError(_0x496952,null));};exports[_0x5755('0x59')]=function(_0x3bd469,_0x4e6b45){return db[_0x5755('0x3c')][_0x5755('0x57')]({'where':{'id':_0x3bd469[_0x5755('0x5a')]['id']}})[_0x5755('0x20')](handleEntityNotFound(_0x4e6b45,null))[_0x5755('0x20')](removeEntity(_0x4e6b45,null))['catch'](handleError(_0x4e6b45,null));};exports[_0x5755('0x5b')]=function(_0x1eeb35,_0x7d616e){return db[_0x5755('0x3c')][_0x5755('0x5b')]()[_0x5755('0x20')](respondWithResult(_0x7d616e,null))[_0x5755('0x29')](handleError(_0x7d616e,null));};var interaction_log=require(_0x5755('0x13'))(_0x5755('0x5c'));exports['accept']=function(_0x5f50c,_0x211119,_0x39a55f){var _0x754fe2={'agent':{},'channel':_0x5755('0x5d')};if(_0x5f50c['body']['id']){delete _0x5f50c[_0x5755('0x58')]['id'];}_0x5f50c[_0x5755('0x58')][_0x5755('0x5e')]=!![];_0x5f50c[_0x5755('0x58')][_0x5755('0x5f')]=moment()[_0x5755('0x60')](_0x5755('0x61'));_0x5f50c['body'][_0x5755('0x62')]=_0x5f50c['body']['UserId']||_0x5f50c['user']['id'];_0x754fe2['agent']['id']=_0x5f50c[_0x5755('0x58')][_0x5755('0x62')];return db[_0x5755('0x3c')][_0x5755('0x57')]({'where':{'id':_0x5f50c[_0x5755('0x5a')]['id'],'UserId':null}})[_0x5755('0x20')](handleEntityNotFound(_0x211119,null))[_0x5755('0x20')](saveUpdates(_0x5f50c[_0x5755('0x58')],null))['then'](function(_0x5a2525){if(_0x5a2525){_0x754fe2['message']=_0x5a2525[_0x5755('0x63')]({'plain':!![]});return db[_0x5755('0x64')][_0x5755('0x57')]({'where':{'id':_0x5a2525['FaxInteractionId']}});}return null;})[_0x5755('0x20')](handleEntityNotFound(_0x211119,null))[_0x5755('0x20')](function(_0x392532){if(_0x392532){return _0x392532['update']({'UserId':_0x5f50c[_0x5755('0x58')][_0x5755('0x62')],'read1stAt':_[_0x5755('0x65')](_0x392532[_0x5755('0x66')])?moment()[_0x5755('0x60')](_0x5755('0x61')):undefined});}return null;})[_0x5755('0x20')](function(_0x50a73c){if(_0x50a73c){_0x754fe2[_0x5755('0x67')]=_0x50a73c[_0x5755('0x63')]({'plain':!![]});interaction_log[_0x5755('0x21')](_0x5755('0x68'),_0x5f50c[_0x5755('0x69')]['id'],_0x5f50c['user'][_0x5755('0x39')],_0x5f50c[_0x5755('0x69')][_0x5755('0x6a')],_0x754fe2[_0x5755('0x67')]['id'],_0x5f50c[_0x5755('0x58')]?JSON[_0x5755('0x6b')](_0x5f50c[_0x5755('0x58')]):_0x5755('0x6c'));return respondWithRpcPromise(_0x5755('0x6d'),_0x5755('0x6e'),_0x754fe2);}return null;})[_0x5755('0x20')](function(_0x1d5c11){var _0x169722='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d5c11[_0x5755('0x27')][_0x5755('0x6f')];return db[_0x5755('0x70')][_0x5755('0x42')](_0x169722,{'type':db[_0x5755('0x71')]['QueryTypes'][_0x5755('0x72')],'raw':!![]})['then'](function(_0x4fbe26){return _0x4fbe26;});})[_0x5755('0x20')](function(_0x33bb64){if(_0x33bb64){_0x754fe2[_0x5755('0x27')]['contact']=_0x33bb64[0x0];if(!_0x5f50c['body']['UserId'])return;return db['User'][_0x5755('0x57')]({'where':{'id':_0x5f50c[_0x5755('0x58')][_0x5755('0x62')],'role':'agent'},'attributes':['id',_0x5755('0x39'),_0x5755('0x73'),_0x5755('0x74'),'internal'],'raw':!![]});}return null;})[_0x5755('0x20')](function(_0x12154b){if(!_0x12154b)return null;_0x754fe2[_0x5755('0x27')]['agent']=_0x12154b;return _0x754fe2;})[_0x5755('0x20')](function(_0x998b50){if(_0x998b50){if(_0x5f50c[_0x5755('0x58')][_0x5755('0x75')]){_0x754fe2[_0x5755('0x27')][_0x5755('0x76')]=util['format'](_0x5755('0x77'),_0x5f50c[_0x5755('0x69')][_0x5755('0x39')]);_0x754fe2['message'][_0x5755('0x78')]=_0x754fe2['channel'];_0x754fe2['message'][_0x5755('0x79')]=_0x754fe2['channel'];_0x754fe2[_0x5755('0x27')][_0x5755('0x7a')]=_0x5755('0x7b');return respondWithRpcPromise(_0x5755('0x7c'),'EventManager',{'event':_0x5755('0x7d'),'message':_0x754fe2[_0x5755('0x27')]},client9002)['then'](function(){return _0x754fe2;});}return _0x754fe2;}return null;})[_0x5755('0x20')](respondWithResult(_0x211119,null))[_0x5755('0x29')](handleError(_0x211119,null));};var interaction_log=require(_0x5755('0x13'))(_0x5755('0x5c'));exports[_0x5755('0x35')]=function(_0x2d4f04,_0x1239c5,_0x2fcfe3){var _0x5b3931={'agent':{},'channel':_0x5755('0x5d')};if(_0x2d4f04[_0x5755('0x58')]['id']){delete _0x2d4f04['body']['id'];}_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')]=_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')]||_0x2d4f04[_0x5755('0x69')]['id'];_0x5b3931['agent']['id']=_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')];return db[_0x5755('0x3c')]['find']({'where':{'id':_0x2d4f04[_0x5755('0x5a')]['id'],'UserId':null}})[_0x5755('0x20')](handleEntityNotFound(_0x1239c5,null))[_0x5755('0x20')](function(_0x1fa1af){if(_0x1fa1af){_0x5b3931[_0x5755('0x27')]=_0x1fa1af['get']({'plain':!![]});return db[_0x5755('0x64')][_0x5755('0x57')]({'where':{'id':_0x1fa1af[_0x5755('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x1239c5,null))[_0x5755('0x20')](function(_0x388aaf){if(_0x388aaf){_0x5b3931[_0x5755('0x67')]=_0x388aaf[_0x5755('0x63')]({'plain':!![]});interaction_log[_0x5755('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d4f04[_0x5755('0x69')]['id'],_0x2d4f04[_0x5755('0x69')][_0x5755('0x39')],_0x2d4f04[_0x5755('0x69')][_0x5755('0x6a')],_0x5b3931[_0x5755('0x67')]['id'],_0x2d4f04[_0x5755('0x58')]?JSON[_0x5755('0x6b')](_0x2d4f04['body']):_0x5755('0x6c'));return respondWithRpcPromise(_0x5755('0x7f'),'rejectMessage',_0x5b3931);}return null;})[_0x5755('0x20')](function(_0x3c30de){var _0x5c1928='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3c30de['message'][_0x5755('0x6f')];return db[_0x5755('0x70')][_0x5755('0x42')](_0x5c1928,{'type':db[_0x5755('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5755('0x20')](function(_0x2f5ae0){return _0x2f5ae0;});})[_0x5755('0x20')](function(_0x4c4f77){if(_0x4c4f77){_0x5b3931[_0x5755('0x27')][_0x5755('0x80')]=_0x4c4f77[0x0];if(!_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')])return;return db['User']['find']({'where':{'id':_0x2d4f04['body'][_0x5755('0x62')],'role':_0x5755('0x81')},'attributes':['id',_0x5755('0x39'),'fullname',_0x5755('0x74'),_0x5755('0x82')],'raw':!![]});}return null;})[_0x5755('0x20')](function(_0x13bda8){if(!_0x13bda8)return null;_0x5b3931[_0x5755('0x27')][_0x5755('0x81')]=_0x13bda8;return _0x5b3931;})[_0x5755('0x20')](function(_0x544041){if(_0x544041){_0x544041[_0x5755('0x27')]['interface']=util[_0x5755('0x60')](_0x5755('0x77'),_0x2d4f04[_0x5755('0x69')][_0x5755('0x39')]);_0x544041[_0x5755('0x27')][_0x5755('0x78')]=_0x5b3931[_0x5755('0x78')];_0x544041[_0x5755('0x27')][_0x5755('0x79')]=_0x5b3931[_0x5755('0x78')];_0x544041[_0x5755('0x27')][_0x5755('0x7a')]='reject';respondWithRpcPromise(_0x5755('0x7c'),_0x5755('0x7c'),{'event':_0x5755('0x83'),'message':_0x544041['message']},client9002);return _0x5b3931;}return null;})['then'](respondWithResult(_0x1239c5,null))[_0x5755('0x29')](handleError(_0x1239c5,null));};exports[_0x5755('0x84')]=function(_0xff8c5f,_0xfdded5){var _0x5b9876;return db[_0x5755('0x3c')][_0x5755('0x84')](_0xff8c5f[_0x5755('0x58')],{})['then'](function(_0x58581e){_0x5b9876=_0x58581e;return db[_0x5755('0x85')][_0x5755('0x86')]({'where':{'id':_0x5b9876['ContactId']}});})['then'](function(_0x272d90){if(_[_0x5755('0x65')](_0x272d90)){return;}else{_0x5b9876['fax']=_0x272d90[_0x5755('0x5d')];return db['Attachment'][_0x5755('0x86')]({'where':{'id':_0x5b9876[_0x5755('0x87')]}});}})[_0x5755('0x20')](function(_0x506835){return respondWithRpcPromise(_0x5755('0x88'),_0x5755('0x88'),{'FaxAccountId':_['isNil'](_0xff8c5f['body'])?undefined:_0xff8c5f[_0x5755('0x58')][_0x5755('0x89')],'path':_[_0x5755('0x65')](_0x506835)?undefined:util[_0x5755('0x60')](_0x5755('0x8a'),_0x506835[_0x5755('0x8b')]),'fax':_[_0x5755('0x65')](_0x5b9876[_0x5755('0x5d')])?undefined:_0x5b9876[_0x5755('0x5d')],'AttachmentId':_0x5b9876[_0x5755('0x87')]},client9002);})['then'](respondWithResult(_0xfdded5,0xc9))[_0x5755('0x29')](handleError(_0xfdded5,null));};exports[_0x5755('0x8c')]=function(_0xa19b3f,_0x505c97){var _0x10e8d6=path[_0x5755('0x8d')](config[_0x5755('0x8e')],_0x5755('0x8f'),_0x5755('0x90'),_0x5755('0x91'));return db[_0x5755('0x3c')]['find']({'where':{'id':_0xa19b3f[_0x5755('0x5a')]['id']},'include':[{'model':db[_0x5755('0x92')],'as':_0x5755('0x92')}]})[_0x5755('0x20')](handleEntityNotFound(_0x505c97,null))[_0x5755('0x20')](function(_0x52083b){if(_0x52083b){return _0x505c97[_0x5755('0x8c')](path['join'](_0x10e8d6,_0x52083b[_0x5755('0x92')][_0x5755('0x8b')]));}})[_0x5755('0x29')](handleError(_0x505c97,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 84d2fdb..02d5f73 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 _0xdd68=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','FaxMessage'];(function(_0x448afc,_0x2fbd6a){var _0x2a10c5=function(_0x16efc6){while(--_0x16efc6){_0x448afc['push'](_0x448afc['shift']());}};_0x2a10c5(++_0x2fbd6a);}(_0xdd68,0x196));var _0x8dd6=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0xdd68[_0x1627ae];return _0x34b38f;};'use strict';var EventEmitter=require(_0x8dd6('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x8dd6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':_0x8dd6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b71c){return function(_0x469e0c,_0x5c7c72,_0x310895){FaxMessageEvents[_0x8dd6('0x5')](_0x37b71c+':'+_0x469e0c['id'],_0x469e0c);FaxMessageEvents['emit'](_0x37b71c,_0x469e0c);_0x310895(null);};}for(var e in events){if(events[_0x8dd6('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x8dd6('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x3714=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x52b0b5,_0x2ced39){var _0x1a57cc=function(_0x5f3f46){while(--_0x5f3f46){_0x52b0b5['push'](_0x52b0b5['shift']());}};_0x1a57cc(++_0x2ced39);}(_0x3714,0x95));var _0x4371=function(_0x2a992b,_0x3dd1e0){_0x2a992b=_0x2a992b-0x0;var _0x44777c=_0x3714[_0x2a992b];return _0x44777c;};'use strict';var EventEmitter=require(_0x4371('0x0'));var FaxMessage=require(_0x4371('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4371('0x2')](0x0);var events={'afterCreate':_0x4371('0x3'),'afterUpdate':_0x4371('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21bccf){return function(_0x20929e,_0x2c0435,_0x5a2ffa){FaxMessageEvents[_0x4371('0x5')](_0x21bccf+':'+_0x20929e['id'],_0x20929e);FaxMessageEvents['emit'](_0x21bccf,_0x20929e);_0x5a2ffa(null);};}for(var e in events){if(events[_0x4371('0x6')](e)){var event=events[e];FaxMessage[_0x4371('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4f4c9b4..4c733e2 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 _0x1882=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x47a5f1,_0x104531){var _0x5a07f6=function(_0x301423){while(--_0x301423){_0x47a5f1['push'](_0x47a5f1['shift']());}};_0x5a07f6(++_0x104531);}(_0x1882,0xfc));var _0x2188=function(_0x30e3b2,_0x1684ea){_0x30e3b2=_0x30e3b2-0x0;var _0x1ab4ad=_0x1882[_0x30e3b2];return _0x1ab4ad;};'use strict';var _=require('lodash');var util=require(_0x2188('0x0'));var logger=require(_0x2188('0x1'))(_0x2188('0x2'));var moment=require(_0x2188('0x3'));var BPromise=require(_0x2188('0x4'));var rp=require(_0x2188('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2188('0x6'));var attributes=require('./faxMessage.attributes');module[_0x2188('0x7')]=function(_0x26102b,_0x3590bd){return _0x26102b[_0x2188('0x8')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x2188('0x9')],'type':_0x2188('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24aed4,_0x48e029,_0x5aec32){var _0x14153d=_0x26102b[_0x2188('0xb')];var _0x2d1a8a=_0x24aed4[_0x2188('0xc')]({'plain':!![]});if(_0x2d1a8a[_0x2188('0xd')][_0x2188('0xe')]()==='in'||_0x2d1a8a[_0x2188('0xd')]['toLowerCase']()==='out'&&!_0x2d1a8a[_0x2188('0xf')]&&!_[_0x2188('0x10')](_0x2d1a8a[_0x2188('0x11')])){_0x14153d[_0x2188('0x12')][_0x2188('0x13')]({'where':{'id':_0x2d1a8a[_0x2188('0x14')]}})[_0x2188('0x15')](function(_0x115de5){if(_0x115de5){_0x115de5[_0x2188('0x16')]({'lastMsgAt':_0x2d1a8a[_0x2188('0x17')],'lastMsgDirection':_0x2d1a8a[_0x2188('0xd')][_0x2188('0xe')]()});}})[_0x2188('0x18')](function(_0x473dca){console[_0x2188('0x19')](_0x473dca);});}_0x5aec32();}},'charset':_0x2188('0x1a'),'collate':_0x2188('0x1b')});}; \ No newline at end of file +var _0x95af=['moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger'];(function(_0x4f6988,_0x2b2ae2){var _0x366a93=function(_0x5f469c){while(--_0x5f469c){_0x4f6988['push'](_0x4f6988['shift']());}};_0x366a93(++_0x2b2ae2);}(_0x95af,0xb3));var _0xf95a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95af[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf95a('0x0'));var util=require(_0xf95a('0x1'));var logger=require(_0xf95a('0x2'))('api');var moment=require(_0xf95a('0x3'));var BPromise=require(_0xf95a('0x4'));var rp=require(_0xf95a('0x5'));var fs=require('fs');var path=require(_0xf95a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf95a('0x7'));module[_0xf95a('0x8')]=function(_0x189783,_0x3c6549){return _0x189783[_0xf95a('0x9')](_0xf95a('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xf95a('0xb')],'type':_0xf95a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27372d,_0x25b9ed,_0x28748a){var _0x591bce=_0x189783[_0xf95a('0xd')];var _0xa05122=_0x27372d[_0xf95a('0xe')]({'plain':!![]});if(_0xa05122[_0xf95a('0xf')][_0xf95a('0x10')]()==='in'||_0xa05122['direction']['toLowerCase']()==='out'&&!_0xa05122['secret']&&!_[_0xf95a('0x11')](_0xa05122[_0xf95a('0x12')])){_0x591bce['FaxInteraction'][_0xf95a('0x13')]({'where':{'id':_0xa05122['FaxInteractionId']}})[_0xf95a('0x14')](function(_0x43f7e8){if(_0x43f7e8){_0x43f7e8[_0xf95a('0x15')]({'lastMsgAt':_0xa05122[_0xf95a('0x16')],'lastMsgDirection':_0xa05122[_0xf95a('0xf')][_0xf95a('0x10')]()});}})[_0xf95a('0x17')](function(_0x5044a4){console[_0xf95a('0x18')](_0x5044a4);});}_0x28748a();}},'charset':_0xf95a('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 0c174a2..810e420 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 _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x56104a,_0x465e0a){var _0x28d3e4=function(_0x55e2be){while(--_0x55e2be){_0x56104a['push'](_0x56104a['shift']());}};_0x28d3e4(++_0x465e0a);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4ed56a,_0xd1f8a8){_0x4ed56a=_0x4ed56a-0x0;var _0x4cdf94=_0xd6d6[_0x4ed56a];return _0x4cdf94;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});}; \ No newline at end of file +var _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x5b2eef,_0x3aab32){var _0x44a109=function(_0x2fbbd9){while(--_0x2fbbd9){_0x5b2eef['push'](_0x5b2eef['shift']());}};_0x44a109(++_0x3aab32);}(_0x6aa7,0x178));var _0x76aa=function(_0x312c66,_0x4ddaeb){_0x312c66=_0x312c66-0x0;var _0x106387=_0x6aa7[_0x312c66];return _0x106387;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 297d21f..10f0f79 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 _0x383f=['length','./faxMessage.events','save','update','emit','removeListener','register'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x383f,0x190));var _0xf383=function(_0x3425dc,_0x37a8d5){_0x3425dc=_0x3425dc-0x0;var _0x42deb9=_0x383f[_0x3425dc];return _0x42deb9;};'use strict';var FaxMessageEvents=require(_0xf383('0x0'));var events=[_0xf383('0x1'),'remove',_0xf383('0x2')];function createListener(_0x25edca,_0x53ab37){return function(_0x36403b){_0x53ab37[_0xf383('0x3')](_0x25edca,_0x36403b);};}function removeListener(_0x26d104,_0x1d1775){return function(){FaxMessageEvents[_0xf383('0x4')](_0x26d104,_0x1d1775);};}exports[_0xf383('0x5')]=function(_0x347df5){for(var _0x2b1042=0x0,_0x55ee10=events[_0xf383('0x6')];_0x2b1042<_0x55ee10;_0x2b1042++){var _0x2ba0fb=events[_0x2b1042];var _0x4a0374=createListener('faxMessage:'+_0x2ba0fb,_0x347df5);FaxMessageEvents['on'](_0x2ba0fb,_0x4a0374);}}; \ No newline at end of file +var _0x65f8=['register','length','./faxMessage.events','save','emit'];(function(_0x426e8f,_0x158d3c){var _0x369f29=function(_0x3d394b){while(--_0x3d394b){_0x426e8f['push'](_0x426e8f['shift']());}};_0x369f29(++_0x158d3c);}(_0x65f8,0xd9));var _0x865f=function(_0x3af016,_0x33ce3b){_0x3af016=_0x3af016-0x0;var _0xdb337b=_0x65f8[_0x3af016];return _0xdb337b;};'use strict';var FaxMessageEvents=require(_0x865f('0x0'));var events=[_0x865f('0x1'),'remove','update'];function createListener(_0x17bb43,_0x5a218a){return function(_0x1253d1){_0x5a218a[_0x865f('0x2')](_0x17bb43,_0x1253d1);};}function removeListener(_0xc4dec8,_0x1498e1){return function(){FaxMessageEvents['removeListener'](_0xc4dec8,_0x1498e1);};}exports[_0x865f('0x3')]=function(_0x208502){for(var _0x1a074f=0x0,_0x4053c5=events[_0x865f('0x4')];_0x1a074f<_0x4053c5;_0x1a074f++){var _0x3eb088=events[_0x1a074f];var _0x4d2c00=createListener('faxMessage:'+_0x3eb088,_0x208502);FaxMessageEvents['on'](_0x3eb088,_0x4d2c00);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 5c6b0ce..415cef9 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 _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x34145f,_0x34e0a1){var _0x3b226d=function(_0x4920d6){while(--_0x4920d6){_0x34145f['push'](_0x34145f['shift']());}};_0x3b226d(++_0x34e0a1);}(_0xec56,0x1bd));var _0x6ec5=function(_0x23dd5b,_0x8b40e4){_0x23dd5b=_0x23dd5b-0x0;var _0x1dbc1a=_0xec56[_0x23dd5b];return _0x1dbc1a;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'faxmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router; \ No newline at end of file +var _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express'];(function(_0x2495f3,_0x4cbf1c){var _0x29bd4a=function(_0x7696bd){while(--_0x7696bd){_0x2495f3['push'](_0x2495f3['shift']());}};_0x29bd4a(++_0x4cbf1c);}(_0xf72b,0x1d9));var _0xbf72=function(_0x19f7b9,_0x55d570){_0x19f7b9=_0x19f7b9-0x0;var _0x337418=_0xf72b[_0x19f7b9];return _0x337418;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['download']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),interaction[_0xbf72('0x10')](_0xbf72('0x11'),_0xbf72('0x12')),controller[_0xbf72('0x13')]);router[_0xbf72('0x14')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0x15')]);router[_0xbf72('0x14')](_0xbf72('0x16'),auth['isAuthenticated'](),controller[_0xbf72('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xbf72('0x18')]);router[_0xbf72('0x19')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1a')]);module[_0xbf72('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index a0b5a44..2b91b46 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 _0x417b=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x2a9a2c,_0x4f2d2b){var _0x188c25=function(_0x49faa8){while(--_0x49faa8){_0x2a9a2c['push'](_0x2a9a2c['shift']());}};_0x188c25(++_0x4f2d2b);}(_0x417b,0x1ab));var _0xb417=function(_0x51a8c3,_0x93203){_0x51a8c3=_0x51a8c3-0x0;var _0x427022=_0x417b[_0x51a8c3];return _0x427022;};'use strict';var Sequelize=require(_0xb417('0x0'));module[_0xb417('0x1')]={'name':{'type':Sequelize[_0xb417('0x2')],'unique':_0xb417('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb417('0x2')]},'timeout':{'type':Sequelize[_0xb417('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb417('0x5'),_0xb417('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e8d=['name','INTEGER','ENUM','sequelize','exports','STRING'];(function(_0x5ce8e6,_0xba66d5){var _0x11bd61=function(_0x2b2de9){while(--_0x2b2de9){_0x5ce8e6['push'](_0x5ce8e6['shift']());}};_0x11bd61(++_0xba66d5);}(_0x8e8d,0x141));var _0xd8e8=function(_0x1b4c3b,_0x438db8){_0x1b4c3b=_0x1b4c3b-0x0;var _0x295897=_0x8e8d[_0x1b4c3b];return _0x295897;};'use strict';var Sequelize=require(_0xd8e8('0x0'));module[_0xd8e8('0x1')]={'name':{'type':Sequelize[_0xd8e8('0x2')],'unique':_0xd8e8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd8e8('0x2')]},'timeout':{'type':Sequelize[_0xd8e8('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd8e8('0x5')]('rrmemory','beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd8e8('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 4ab97b7..fa3fa4c 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 _0x0e87=['VIRTUAL','includeAll','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserFaxQueue','FaxQueueId','options','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','findOne','Team','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge'];(function(_0x47640d,_0x109c5a){var _0x22246f=function(_0x35af66){while(--_0x35af66){_0x47640d['push'](_0x47640d['shift']());}};_0x22246f(++_0x109c5a);}(_0x0e87,0xdc));var _0x70e8=function(_0x4ff651,_0x2b684d){_0x4ff651=_0x4ff651-0x0;var _0x117967=_0x0e87[_0x4ff651];return _0x117967;};'use strict';var emlformat=require(_0x70e8('0x0'));var rimraf=require(_0x70e8('0x1'));var zipdir=require(_0x70e8('0x2'));var jsonpatch=require(_0x70e8('0x3'));var rp=require(_0x70e8('0x4'));var moment=require(_0x70e8('0x5'));var BPromise=require(_0x70e8('0x6'));var Mustache=require('mustache');var util=require(_0x70e8('0x7'));var path=require(_0x70e8('0x8'));var sox=require(_0x70e8('0x9'));var csv=require(_0x70e8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70e8('0xb'));var _=require(_0x70e8('0xc'));var squel=require(_0x70e8('0xd'));var crypto=require(_0x70e8('0xe'));var jsforce=require(_0x70e8('0xf'));var deskjs=require(_0x70e8('0x10'));var toCsv=require(_0x70e8('0xa'));var querystring=require('querystring');var Papa=require(_0x70e8('0x11'));var Redis=require(_0x70e8('0x12'));var authService=require(_0x70e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x70e8('0x14'));var hardwareService=require(_0x70e8('0x15'));var logger=require(_0x70e8('0x16'))(_0x70e8('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x70e8('0x18'));var db=require(_0x70e8('0x19'))['db'];config[_0x70e8('0x1a')]=_['defaults'](config[_0x70e8('0x1a')],{'host':_0x70e8('0x1b'),'port':0x18eb});var socket=require(_0x70e8('0x1c'))(new Redis(config[_0x70e8('0x1a')]));require(_0x70e8('0x1d'))[_0x70e8('0x1e')](socket);function respondWithStatusCode(_0x2ea964,_0x52d55d){_0x52d55d=_0x52d55d||0xcc;return function(_0x3482ce){if(_0x3482ce){return _0x2ea964[_0x70e8('0x1f')](_0x52d55d);}return _0x2ea964[_0x70e8('0x20')](_0x52d55d)[_0x70e8('0x21')]();};}function respondWithResult(_0x12958d,_0x1478ab){_0x1478ab=_0x1478ab||0xc8;return function(_0x917298){if(_0x917298){return _0x12958d[_0x70e8('0x20')](_0x1478ab)[_0x70e8('0x22')](_0x917298);}};}function respondWithFilteredResult(_0x52cf09,_0x2181ae){return function(_0x15d611){if(_0x15d611){var _0x1c2b7d=typeof _0x2181ae['offset']===_0x70e8('0x23')&&typeof _0x2181ae['limit']===_0x70e8('0x23');var _0xcc8bb0=_0x15d611[_0x70e8('0x24')];var _0x1e4d75=_0x1c2b7d?0x0:_0x2181ae[_0x70e8('0x25')];var _0x2526b0=_0x1c2b7d?_0x15d611['count']:_0x2181ae['offset']+_0x2181ae['limit'];var _0x18f9d9;if(_0x2526b0>=_0xcc8bb0){_0x2526b0=_0xcc8bb0;_0x18f9d9=0xc8;}else{_0x18f9d9=0xce;}_0x52cf09['status'](_0x18f9d9);return _0x52cf09[_0x70e8('0x26')](_0x70e8('0x27'),_0x1e4d75+'-'+_0x2526b0+'/'+_0xcc8bb0)[_0x70e8('0x22')](_0x15d611);}return null;};}function patchUpdates(_0x25dd90){return function(_0x2d20d3){try{jsonpatch[_0x70e8('0x28')](_0x2d20d3,_0x25dd90,!![]);}catch(_0xe9e51e){return BPromise[_0x70e8('0x29')](_0xe9e51e);}return _0x2d20d3[_0x70e8('0x2a')]();};}function saveUpdates(_0x5cb8eb,_0x5e2203){return function(_0x316a49){if(_0x316a49){return _0x316a49[_0x70e8('0x2b')](_0x5cb8eb)[_0x70e8('0x2c')](function(_0x14aa43){return _0x14aa43;});}return null;};}function removeEntity(_0x4e905a,_0x27419b){return function(_0x94c106){if(_0x94c106){return _0x94c106[_0x70e8('0x2d')]()['then'](function(){var _0x27e683=_0x94c106[_0x70e8('0x2e')]({'plain':!![]});var _0x3d019f=_0x70e8('0x2f');return db[_0x70e8('0x30')]['destroy']({'where':{'type':_0x3d019f,'resourceId':_0x27e683['id']}})[_0x70e8('0x2c')](function(){return _0x94c106;});})[_0x70e8('0x2c')](function(){_0x4e905a[_0x70e8('0x20')](0xcc)[_0x70e8('0x21')]();});}};}function handleEntityNotFound(_0x90cc41,_0x1dac7a){return function(_0x4d1a46){if(!_0x4d1a46){_0x90cc41[_0x70e8('0x1f')](0x194);}return _0x4d1a46;};}function handleError(_0x5e32b1,_0x263ba3){_0x263ba3=_0x263ba3||0x1f4;return function(_0x46cd50){logger['error'](_0x46cd50[_0x70e8('0x31')]);if(_0x46cd50[_0x70e8('0x32')]){delete _0x46cd50[_0x70e8('0x32')];}_0x5e32b1['status'](_0x263ba3)[_0x70e8('0x33')](_0x46cd50);};}exports[_0x70e8('0x34')]=function(_0x4a1cf0,_0x962dc){var _0x49c24e={},_0x28fab4={},_0x2e1052={'count':0x0,'rows':[]};var _0x47e452=_[_0x70e8('0x35')](db[_0x70e8('0x36')][_0x70e8('0x37')],function(_0x2ee572){return{'name':_0x2ee572['fieldName'],'type':_0x2ee572[_0x70e8('0x38')][_0x70e8('0x39')]};});_0x28fab4[_0x70e8('0x3a')]=_['map'](_0x47e452,_0x70e8('0x32'));_0x28fab4[_0x70e8('0x3b')]=_['keys'](_0x4a1cf0[_0x70e8('0x3b')]);_0x28fab4['filters']=_[_0x70e8('0x3c')](_0x28fab4[_0x70e8('0x3a')],_0x28fab4['query']);_0x49c24e[_0x70e8('0x3d')]=_[_0x70e8('0x3c')](_0x28fab4[_0x70e8('0x3a')],qs['fields'](_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x3e')]));_0x49c24e['attributes']=_0x49c24e['attributes'][_0x70e8('0x3f')]?_0x49c24e[_0x70e8('0x3d')]:_0x28fab4[_0x70e8('0x3a')];if(!_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x40')](_0x70e8('0x41'))){_0x49c24e['limit']=qs['limit'](_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x42')]);_0x49c24e[_0x70e8('0x25')]=qs['offset'](_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x25')]);}_0x49c24e[_0x70e8('0x43')]=qs[_0x70e8('0x44')](_0x4a1cf0['query'][_0x70e8('0x44')]);_0x49c24e[_0x70e8('0x45')]=qs['filters'](_[_0x70e8('0x46')](_0x4a1cf0[_0x70e8('0x3b')],_0x28fab4[_0x70e8('0x47')]),_0x47e452);if(_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x48')]){_0x49c24e[_0x70e8('0x45')]=_[_0x70e8('0x49')](_0x49c24e[_0x70e8('0x45')],{'$or':_[_0x70e8('0x35')](_0x47e452,function(_0x51285b){if(_0x51285b[_0x70e8('0x38')]!==_0x70e8('0x4a')){var _0x576d28={};_0x576d28[_0x51285b[_0x70e8('0x32')]]={'$like':'%'+_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x48')]+'%'};return _0x576d28;}})});}_0x49c24e=_[_0x70e8('0x49')]({},_0x49c24e,_0x4a1cf0['options']);var _0x226806={'where':_0x49c24e[_0x70e8('0x45')]};return db['FaxQueue'][_0x70e8('0x24')](_0x226806)[_0x70e8('0x2c')](function(_0x1832a7){_0x2e1052[_0x70e8('0x24')]=_0x1832a7;if(_0x4a1cf0[_0x70e8('0x3b')][_0x70e8('0x4b')]){_0x49c24e['include']=[{'all':!![]}];}return db[_0x70e8('0x36')][_0x70e8('0x4c')](_0x49c24e);})[_0x70e8('0x2c')](function(_0x4359fa){_0x2e1052[_0x70e8('0x4d')]=_0x4359fa;return _0x2e1052;})[_0x70e8('0x2c')](respondWithFilteredResult(_0x962dc,_0x49c24e))[_0x70e8('0x4e')](handleError(_0x962dc,null));};exports[_0x70e8('0x4f')]=function(_0x49dc92,_0x278324){var _0x566f46={'raw':!![],'where':{'id':_0x49dc92['params']['id']}},_0x1f7a07={};_0x1f7a07[_0x70e8('0x3a')]=_[_0x70e8('0x50')](db['FaxQueue'][_0x70e8('0x37')]);_0x1f7a07['query']=_[_0x70e8('0x50')](_0x49dc92[_0x70e8('0x3b')]);_0x1f7a07['filters']=_[_0x70e8('0x3c')](_0x1f7a07[_0x70e8('0x3a')],_0x1f7a07[_0x70e8('0x3b')]);_0x566f46['attributes']=_[_0x70e8('0x3c')](_0x1f7a07['model'],qs[_0x70e8('0x3e')](_0x49dc92[_0x70e8('0x3b')]['fields']));_0x566f46['attributes']=_0x566f46[_0x70e8('0x3d')][_0x70e8('0x3f')]?_0x566f46[_0x70e8('0x3d')]:_0x1f7a07[_0x70e8('0x3a')];if(_0x49dc92['query']['includeAll']){_0x566f46['include']=[{'all':!![]}];}_0x566f46=_['merge']({},_0x566f46,_0x49dc92['options']);return db[_0x70e8('0x36')][_0x70e8('0x51')](_0x566f46)['then'](handleEntityNotFound(_0x278324,null))['then'](respondWithResult(_0x278324,null))[_0x70e8('0x4e')](handleError(_0x278324,null));};exports['create']=function(_0x13ce44,_0x5ed243){return db[_0x70e8('0x36')][_0x70e8('0x52')](_0x13ce44[_0x70e8('0x53')],{})[_0x70e8('0x2c')](function(_0x5ace3a){var _0x43d5a7=_0x13ce44[_0x70e8('0x54')][_0x70e8('0x2e')]({'plain':!![]});if(!_0x43d5a7)throw new Error(_0x70e8('0x55'));if(_0x43d5a7[_0x70e8('0x56')]===_0x70e8('0x54')){var _0x1bb3d3=_0x5ace3a['get']({'plain':!![]});var _0x2c9a03='FaxQueues';return db[_0x70e8('0x57')][_0x70e8('0x51')]({'where':{'name':_0x2c9a03,'userProfileId':_0x43d5a7[_0x70e8('0x58')]},'raw':!![]})[_0x70e8('0x2c')](function(_0x7e11d4){if(_0x7e11d4&&_0x7e11d4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1bb3d3['name'],'resourceId':_0x1bb3d3['id'],'type':_0x7e11d4[_0x70e8('0x32')],'sectionId':_0x7e11d4['id']},{})['then'](function(){return _0x5ace3a;});}else{return _0x5ace3a;}})[_0x70e8('0x4e')](function(_0x103f01){logger['error'](_0x70e8('0x59'),_0x103f01);throw _0x103f01;});}return _0x5ace3a;})[_0x70e8('0x2c')](respondWithResult(_0x5ed243,0xc9))[_0x70e8('0x4e')](handleError(_0x5ed243,null));};exports['update']=function(_0x5e1572,_0x4c02c5){if(_0x5e1572[_0x70e8('0x53')]['id']){delete _0x5e1572[_0x70e8('0x53')]['id'];}return db['FaxQueue'][_0x70e8('0x51')]({'where':{'id':_0x5e1572[_0x70e8('0x5a')]['id']}})[_0x70e8('0x2c')](handleEntityNotFound(_0x4c02c5,null))[_0x70e8('0x2c')](saveUpdates(_0x5e1572[_0x70e8('0x53')],null))[_0x70e8('0x2c')](respondWithResult(_0x4c02c5,null))[_0x70e8('0x4e')](handleError(_0x4c02c5,null));};exports['destroy']=function(_0x36197d,_0x3debff){return db[_0x70e8('0x36')]['find']({'where':{'id':_0x36197d[_0x70e8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3debff,null))[_0x70e8('0x2c')](removeEntity(_0x3debff,null))[_0x70e8('0x4e')](handleError(_0x3debff,null));};exports['describe']=function(_0x2516cf,_0x5cf22b){return db[_0x70e8('0x36')]['describe']()[_0x70e8('0x2c')](respondWithResult(_0x5cf22b,null))['catch'](handleError(_0x5cf22b,null));};exports[_0x70e8('0x5b')]=function(_0x113443,_0x4920cc,_0x3dfd25){var _0x568b2f={'raw':!![],'where':{}},_0x40238c={},_0x1e5e3f;return db['FaxQueue']['findOne']({'where':{'id':_0x113443['params']['id']}})['then'](handleEntityNotFound(_0x4920cc,null))[_0x70e8('0x2c')](function(_0x507cf9){if(_0x507cf9){_0x1e5e3f=_0x507cf9['get']({'plain':!![]});_0x40238c[_0x70e8('0x3a')]=_[_0x70e8('0x50')](db[_0x70e8('0x5c')]['rawAttributes']);_0x40238c[_0x70e8('0x3b')]=_[_0x70e8('0x50')](_0x113443[_0x70e8('0x3b')]);_0x40238c[_0x70e8('0x47')]=_[_0x70e8('0x3c')](_0x40238c[_0x70e8('0x3a')],_0x40238c[_0x70e8('0x3b')]);_0x568b2f[_0x70e8('0x3d')]=_[_0x70e8('0x3c')](_0x40238c[_0x70e8('0x3a')],qs[_0x70e8('0x3e')](_0x113443[_0x70e8('0x3b')]['fields']));_0x568b2f['attributes']=_0x568b2f[_0x70e8('0x3d')][_0x70e8('0x3f')]?_0x568b2f[_0x70e8('0x3d')]:_0x40238c[_0x70e8('0x3a')];if(!_0x113443[_0x70e8('0x3b')][_0x70e8('0x40')](_0x70e8('0x41'))){_0x568b2f[_0x70e8('0x42')]=qs[_0x70e8('0x42')](_0x113443[_0x70e8('0x3b')][_0x70e8('0x42')]);_0x568b2f[_0x70e8('0x25')]=qs[_0x70e8('0x25')](_0x113443['query'][_0x70e8('0x25')]);}_0x568b2f['order']=qs[_0x70e8('0x44')](_0x113443['query'][_0x70e8('0x44')]);_0x568b2f[_0x70e8('0x45')]=qs['filters'](_[_0x70e8('0x46')](_0x113443[_0x70e8('0x3b')],_0x40238c[_0x70e8('0x47')]));_0x568b2f[_0x70e8('0x45')][_0x70e8('0x5d')]=_0x507cf9['id'];if(_0x113443[_0x70e8('0x3b')][_0x70e8('0x48')]){_0x568b2f[_0x70e8('0x45')]=_['merge'](_0x568b2f[_0x70e8('0x45')],{'$or':_[_0x70e8('0x35')](_0x568b2f[_0x70e8('0x3d')],function(_0x2497fc){var _0x2d4a62={};_0x2d4a62[_0x2497fc]={'$like':'%'+_0x113443[_0x70e8('0x3b')][_0x70e8('0x48')]+'%'};return _0x2d4a62;})});}_0x568b2f=_[_0x70e8('0x49')]({},_0x568b2f,_0x113443[_0x70e8('0x5e')]);return db[_0x70e8('0x5c')][_0x70e8('0x4c')](_0x568b2f);}})[_0x70e8('0x2c')](function(_0x54719d){if(_0x54719d){return db[_0x70e8('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x54719d,_0x70e8('0x60')),'role':_0x70e8('0x61')},'attributes':['id','name',_0x70e8('0x62'),_0x70e8('0x63'),_0x70e8('0x64')]});}})[_0x70e8('0x2c')](function(_0xd43937){if(_0xd43937){return{'count':_0xd43937[_0x70e8('0x24')],'rows':_[_0x70e8('0x35')](_0xd43937[_0x70e8('0x4d')],function(_0x15412c){return{'membername':_0x15412c[_0x70e8('0x32')],'UserId':_0x15412c['id'],'queue_name':_0x1e5e3f[_0x70e8('0x32')],'FaxQueueId':_0x1e5e3f['id'],'interface':util[_0x70e8('0x65')](_0x70e8('0x66'),'SIP',_0x15412c[_0x70e8('0x32')]),'penalty':0x0,'paused':_0x15412c['faxPause'],'createdAt':_0x15412c[_0x70e8('0x64')],'updatedAt':_0x15412c[_0x70e8('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x70e8('0x2c')](respondWithFilteredResult(_0x4920cc,_0x568b2f))[_0x70e8('0x4e')](handleError(_0x4920cc,null));};exports['getTeams']=function(_0x2afdfc,_0xc9bd02,_0x4a8f25){var _0x3f5357={};var _0x33a954={};var _0x21307f;var _0x36cb25;return db[_0x70e8('0x36')][_0x70e8('0x67')]({'where':{'id':_0x2afdfc[_0x70e8('0x5a')]['id']}})[_0x70e8('0x2c')](handleEntityNotFound(_0xc9bd02,null))[_0x70e8('0x2c')](function(_0x13a5d2){if(_0x13a5d2){_0x21307f=_0x13a5d2;_0x33a954[_0x70e8('0x3a')]=_[_0x70e8('0x50')](db[_0x70e8('0x68')]['rawAttributes']);_0x33a954[_0x70e8('0x3b')]=_[_0x70e8('0x50')](_0x2afdfc[_0x70e8('0x3b')]);_0x33a954['filters']=_[_0x70e8('0x3c')](_0x33a954['model'],_0x33a954[_0x70e8('0x3b')]);_0x3f5357[_0x70e8('0x3d')]=_[_0x70e8('0x3c')](_0x33a954[_0x70e8('0x3a')],qs[_0x70e8('0x3e')](_0x2afdfc[_0x70e8('0x3b')][_0x70e8('0x3e')]));_0x3f5357[_0x70e8('0x3d')]=_0x3f5357[_0x70e8('0x3d')][_0x70e8('0x3f')]?_0x3f5357[_0x70e8('0x3d')]:_0x33a954[_0x70e8('0x3a')];_0x3f5357[_0x70e8('0x43')]=qs[_0x70e8('0x44')](_0x2afdfc[_0x70e8('0x3b')][_0x70e8('0x44')]);_0x3f5357['where']=qs[_0x70e8('0x47')](_[_0x70e8('0x46')](_0x2afdfc[_0x70e8('0x3b')],_0x33a954[_0x70e8('0x47')]));if(_0x2afdfc[_0x70e8('0x3b')][_0x70e8('0x48')]){_0x3f5357['where']=_['merge'](_0x3f5357[_0x70e8('0x45')],{'$or':_['map'](_0x3f5357[_0x70e8('0x3d')],function(_0x4b8914){var _0x3a6a35={};_0x3a6a35[_0x4b8914]={'$like':'%'+_0x2afdfc[_0x70e8('0x3b')][_0x70e8('0x48')]+'%'};return _0x3a6a35;})});}_0x3f5357=_[_0x70e8('0x49')]({},_0x3f5357,_0x2afdfc[_0x70e8('0x5e')]);return _0x21307f['getTeams'](_0x3f5357);}})[_0x70e8('0x2c')](function(_0x4e7ceb){if(_0x4e7ceb){_0x36cb25=_0x4e7ceb[_0x70e8('0x3f')];if(!_0x2afdfc['query'][_0x70e8('0x40')](_0x70e8('0x41'))){_0x3f5357['limit']=qs['limit'](_0x2afdfc['query'][_0x70e8('0x42')]);_0x3f5357[_0x70e8('0x25')]=qs[_0x70e8('0x25')](_0x2afdfc[_0x70e8('0x3b')][_0x70e8('0x25')]);}return _0x21307f[_0x70e8('0x69')](_0x3f5357);}})[_0x70e8('0x2c')](function(_0x26f9d7){if(_0x26f9d7){return _0x26f9d7?{'count':_0x36cb25,'rows':_0x26f9d7}:null;}})['then'](respondWithResult(_0xc9bd02,null))[_0x70e8('0x4e')](handleError(_0xc9bd02,null));};exports[_0x70e8('0x6a')]=function(_0xcfdc6e,_0x1d4422,_0x47329f){var _0x249df9=_0xcfdc6e['body'][_0x70e8('0x6b')];return db[_0x70e8('0x68')][_0x70e8('0x4c')]({'where':{'id':_0x249df9},'attributes':['id'],'include':[{'model':db[_0x70e8('0x5f')],'as':'Agents','attributes':['id',_0x70e8('0x32'),_0x70e8('0x6c'),_0x70e8('0x6d'),'interface'],'raw':!![]}]})[_0x70e8('0x2c')](function(_0x104318){if(_0x104318){var _0x2e1241=_[_0x70e8('0x6e')](_0x104318,function(_0x22a10b){var _0x311213=_0x22a10b[_0x70e8('0x2e')]({'plain':!![]});return _0x311213[_0x70e8('0x6f')];});return db['FaxQueue'][_0x70e8('0x51')]({'where':{'id':_0xcfdc6e[_0x70e8('0x5a')]['id']}})['then'](function(_0x4b11b0){return db[_0x70e8('0x70')][_0x70e8('0x71')](function(_0x3c714f){return _0x4b11b0[_0x70e8('0x6a')](_0x249df9,{'transaction':_0x3c714f})[_0x70e8('0x2c')](function(){return BPromise[_0x70e8('0x72')](_0x2e1241,function(_0x16ac20){return db[_0x70e8('0x5c')][_0x70e8('0x73')]({'where':{'UserId':_0x16ac20['id'],'FaxQueueId':_0xcfdc6e[_0x70e8('0x5a')]['id']},'transaction':_0x3c714f});});})[_0x70e8('0x2c')](function(){_0x2e1241[_0x70e8('0x74')](function(_0x2be85a){socket[_0x70e8('0x75')](_0x70e8('0x76'),{'UserId':_0x2be85a['id'],'FaxQueueId':_0x4b11b0['id']});});});});});}})['then'](respondWithStatusCode(_0x1d4422,null))[_0x70e8('0x4e')](handleError(_0x1d4422,null));};exports['removeTeams']=function(_0x5b85b3,_0x1a8a39,_0x4fc333){return db['Team'][_0x70e8('0x4c')]({'where':{'id':_0x5b85b3[_0x70e8('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x70e8('0x5f')],'as':_0x70e8('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1a8a39,null))[_0x70e8('0x2c')](function(_0x39d7d9){var _0x259d81=_[_0x70e8('0x35')](_0x39d7d9,'id');var _0x1ccbf4=[];var _0x496759=[];var _0x2a3eb3=squel[_0x70e8('0x77')]();_0x2a3eb3[_0x70e8('0x78')](_0x70e8('0x79'))[_0x70e8('0x7a')](_0x70e8('0x7b'),'tq')[_0x70e8('0x7c')](_0x70e8('0x7d'),'ut',_0x70e8('0x7e'))['where'](_0x70e8('0x7f'),_0x5b85b3[_0x70e8('0x5a')]['id']);for(var _0x5d7322=0x0;_0x5d7322<_0x39d7d9[_0x70e8('0x3f')];_0x5d7322+=0x1){let _0x285c20=_0x39d7d9[_0x5d7322];for(var _0x17c296=0x0;_0x17c296<_0x285c20[_0x70e8('0x6f')][_0x70e8('0x3f')];_0x17c296+=0x1){let _0x9d7fe4=_0x285c20['Agents'][_0x17c296];var _0x1e3723=_0x2a3eb3[_0x70e8('0x80')]();_0x1e3723['where'](_0x70e8('0x81'),_0x9d7fe4['id']);_0x496759[_0x70e8('0x82')](db['sequelize'][_0x70e8('0x3b')](_0x1e3723['toString'](),{'type':db['sequelize']['QueryTypes'][_0x70e8('0x83')]})[_0x70e8('0x2c')](function(_0x3efd67){if(_0x3efd67[_0x70e8('0x3f')]===0x1){return _0x9d7fe4['id'];}else{var _0x39e273=_[_0x70e8('0x84')](_[_0x70e8('0x35')](_0x3efd67,_0x70e8('0x85')),function(_0x5bd66a){return _[_0x70e8('0x86')](_0x259d81,_0x5bd66a);});if(_0x39e273){return _0x9d7fe4['id'];}}}));}}return BPromise[_0x70e8('0x87')](_0x496759)[_0x70e8('0x2c')](function(_0x255ba6){_0x1ccbf4=_(_0x1ccbf4)['union'](_0x255ba6)[_0x70e8('0x88')]()[_0x70e8('0x89')]();return db[_0x70e8('0x36')][_0x70e8('0x51')]({'where':{'id':_0x5b85b3[_0x70e8('0x5a')]['id']}})[_0x70e8('0x2c')](function(_0x2980c9){return db[_0x70e8('0x70')]['transaction'](function(_0x514bf3){return _0x2980c9[_0x70e8('0x8a')](_0x5b85b3[_0x70e8('0x3b')][_0x70e8('0x6b')],{'transaction':_0x514bf3})['then'](function(){if(!_[_0x70e8('0x8b')](_0x1ccbf4)){return _0x2980c9[_0x70e8('0x8c')](_0x1ccbf4,{'transaction':_0x514bf3});}})[_0x70e8('0x2c')](function(){_0x1ccbf4['forEach'](function(_0x58f229){socket[_0x70e8('0x75')](_0x70e8('0x8d'),{'UserId':_0x58f229,'FaxQueueId':_0x2980c9['id']});});});});});});})[_0x70e8('0x2c')](respondWithStatusCode(_0x1a8a39,null))[_0x70e8('0x4e')](handleError(_0x1a8a39,null));};exports[_0x70e8('0x8e')]=function(_0x506c8c,_0x5f03c2,_0x51a5a4){return db[_0x70e8('0x36')][_0x70e8('0x51')]({'where':{'id':_0x506c8c[_0x70e8('0x5a')]['id']}})[_0x70e8('0x2c')](handleEntityNotFound(_0x5f03c2,null))['then'](function(_0x1ffb4b){if(_0x1ffb4b){return _0x1ffb4b[_0x70e8('0x8e')](_0x506c8c[_0x70e8('0x53')][_0x70e8('0x6b')],_[_0x70e8('0x8f')](_0x506c8c[_0x70e8('0x53')],['ids','id'])||{})[_0x70e8('0x90')](function(_0x4ebcbd){for(var _0x15da97=0x0;_0x15da97<_0x506c8c[_0x70e8('0x53')][_0x70e8('0x6b')]['length'];_0x15da97+=0x1){socket[_0x70e8('0x75')](_0x70e8('0x76'),{'UserId':Number(_0x506c8c[_0x70e8('0x53')]['ids'][_0x15da97]),'FaxQueueId':Number(_0x506c8c[_0x70e8('0x5a')]['id'])});}return _0x4ebcbd;});}})[_0x70e8('0x2c')](respondWithResult(_0x5f03c2,null))[_0x70e8('0x4e')](handleError(_0x5f03c2,null));};exports[_0x70e8('0x8c')]=function(_0x390d73,_0x342745,_0x1e4d24){return db[_0x70e8('0x36')][_0x70e8('0x51')]({'where':{'id':_0x390d73[_0x70e8('0x5a')]['id']}})[_0x70e8('0x2c')](handleEntityNotFound(_0x342745,null))[_0x70e8('0x2c')](function(_0x258bab){if(_0x258bab){return _0x258bab[_0x70e8('0x8c')](_0x390d73[_0x70e8('0x3b')][_0x70e8('0x6b')])[_0x70e8('0x2c')](function(){if(_[_0x70e8('0x91')](_0x390d73['query']['ids'])){for(var _0x3c8e4f=0x0;_0x3c8e4f<_0x390d73[_0x70e8('0x3b')][_0x70e8('0x6b')][_0x70e8('0x3f')];_0x3c8e4f+=0x1){socket[_0x70e8('0x75')](_0x70e8('0x8d'),{'UserId':Number(_0x390d73['query'][_0x70e8('0x6b')][_0x3c8e4f]),'FaxQueueId':Number(_0x390d73[_0x70e8('0x5a')]['id'])});}}else{socket['emit'](_0x70e8('0x8d'),{'UserId':Number(_0x390d73[_0x70e8('0x3b')]['ids']),'FaxQueueId':Number(_0x390d73[_0x70e8('0x5a')]['id'])});}});}})[_0x70e8('0x2c')](respondWithStatusCode(_0x342745,null))['catch'](handleError(_0x342745,null));};exports[_0x70e8('0x92')]=function(_0x16b735,_0xb8ee06,_0x54c840){var _0x359c7c={};var _0x27a46e={};var _0x417b44;var _0x4d7ca9;return db[_0x70e8('0x36')][_0x70e8('0x67')]({'where':{'id':_0x16b735[_0x70e8('0x5a')]['id']}})[_0x70e8('0x2c')](handleEntityNotFound(_0xb8ee06,null))[_0x70e8('0x2c')](function(_0x37ad32){if(_0x37ad32){_0x417b44=_0x37ad32;_0x27a46e[_0x70e8('0x3a')]=_['keys'](db['User']['rawAttributes']);_0x27a46e[_0x70e8('0x3b')]=_[_0x70e8('0x50')](_0x16b735[_0x70e8('0x3b')]);_0x27a46e[_0x70e8('0x47')]=_[_0x70e8('0x3c')](_0x27a46e[_0x70e8('0x3a')],_0x27a46e[_0x70e8('0x3b')]);_0x359c7c['attributes']=_[_0x70e8('0x3c')](_0x27a46e[_0x70e8('0x3a')],qs[_0x70e8('0x3e')](_0x16b735[_0x70e8('0x3b')][_0x70e8('0x3e')]));_0x359c7c[_0x70e8('0x3d')]=_0x359c7c[_0x70e8('0x3d')]['length']?_0x359c7c[_0x70e8('0x3d')]:_0x27a46e['model'];_0x359c7c['order']=qs['sort'](_0x16b735[_0x70e8('0x3b')][_0x70e8('0x44')]);_0x359c7c['where']=qs['filters'](_[_0x70e8('0x46')](_0x16b735[_0x70e8('0x3b')],_0x27a46e[_0x70e8('0x47')]));if(_0x16b735[_0x70e8('0x3b')][_0x70e8('0x48')]){_0x359c7c[_0x70e8('0x45')]=_[_0x70e8('0x49')](_0x359c7c[_0x70e8('0x45')],{'$or':_['map'](_0x359c7c[_0x70e8('0x3d')],function(_0x278852){var _0x27f07f={};_0x27f07f[_0x278852]={'$like':'%'+_0x16b735['query'][_0x70e8('0x48')]+'%'};return _0x27f07f;})});}_0x359c7c=_[_0x70e8('0x49')]({},_0x359c7c,_0x16b735[_0x70e8('0x5e')]);return _0x417b44['getAgents'](_0x359c7c);}})['then'](function(_0x3a3ea8){if(_0x3a3ea8){_0x4d7ca9=_0x3a3ea8[_0x70e8('0x3f')];if(!_0x16b735[_0x70e8('0x3b')]['hasOwnProperty']('nolimit')){_0x359c7c['limit']=qs[_0x70e8('0x42')](_0x16b735['query'][_0x70e8('0x42')]);_0x359c7c[_0x70e8('0x25')]=qs[_0x70e8('0x25')](_0x16b735['query'][_0x70e8('0x25')]);}return _0x417b44[_0x70e8('0x92')](_0x359c7c);}})[_0x70e8('0x2c')](function(_0xc56e03){if(_0xc56e03){return _0xc56e03?{'count':_0x4d7ca9,'rows':_0xc56e03}:null;}})[_0x70e8('0x2c')](respondWithResult(_0xb8ee06,null))[_0x70e8('0x4e')](handleError(_0xb8ee06,null));}; \ No newline at end of file +var _0x327c=['sequelize','toString','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','transaction','findOrCreate','emit','ids','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push'];(function(_0x36a6d7,_0x4e56e6){var _0x277b5e=function(_0xddfda4){while(--_0xddfda4){_0x36a6d7['push'](_0x36a6d7['shift']());}};_0x277b5e(++_0x4e56e6);}(_0x327c,0x1b8));var _0xc327=function(_0x17fb07,_0x2a5f45){_0x17fb07=_0x17fb07-0x0;var _0x2b3613=_0x327c[_0x17fb07];return _0x2b3613;};'use strict';var emlformat=require(_0xc327('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc327('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc327('0x2'));var moment=require(_0xc327('0x3'));var BPromise=require(_0xc327('0x4'));var Mustache=require(_0xc327('0x5'));var util=require(_0xc327('0x6'));var path=require(_0xc327('0x7'));var sox=require(_0xc327('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc327('0x9'));var _=require(_0xc327('0xa'));var squel=require(_0xc327('0xb'));var crypto=require(_0xc327('0xc'));var jsforce=require(_0xc327('0xd'));var deskjs=require(_0xc327('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc327('0xf'));var Papa=require(_0xc327('0x10'));var Redis=require('ioredis');var authService=require(_0xc327('0x11'));var qs=require(_0xc327('0x12'));var as=require(_0xc327('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc327('0x14'))(_0xc327('0x15'));var utils=require('../../config/utils');var config=require(_0xc327('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc327('0x17'))['db'];config[_0xc327('0x18')]=_[_0xc327('0x19')](config[_0xc327('0x18')],{'host':_0xc327('0x1a'),'port':0x18eb});var socket=require(_0xc327('0x1b'))(new Redis(config[_0xc327('0x18')]));require(_0xc327('0x1c'))[_0xc327('0x1d')](socket);function respondWithStatusCode(_0x4da981,_0x2794ae){_0x2794ae=_0x2794ae||0xcc;return function(_0x390fd0){if(_0x390fd0){return _0x4da981['sendStatus'](_0x2794ae);}return _0x4da981[_0xc327('0x1e')](_0x2794ae)[_0xc327('0x1f')]();};}function respondWithResult(_0x471ac2,_0x401344){_0x401344=_0x401344||0xc8;return function(_0x576eef){if(_0x576eef){return _0x471ac2[_0xc327('0x1e')](_0x401344)[_0xc327('0x20')](_0x576eef);}};}function respondWithFilteredResult(_0x3112d5,_0x1d4513){return function(_0x28b671){if(_0x28b671){var _0x513351=typeof _0x1d4513[_0xc327('0x21')]===_0xc327('0x22')&&typeof _0x1d4513[_0xc327('0x23')]===_0xc327('0x22');var _0x256db8=_0x28b671[_0xc327('0x24')];var _0x13116e=_0x513351?0x0:_0x1d4513[_0xc327('0x21')];var _0x53abdb=_0x513351?_0x28b671[_0xc327('0x24')]:_0x1d4513[_0xc327('0x21')]+_0x1d4513['limit'];var _0x3da6d8;if(_0x53abdb>=_0x256db8){_0x53abdb=_0x256db8;_0x3da6d8=0xc8;}else{_0x3da6d8=0xce;}_0x3112d5[_0xc327('0x1e')](_0x3da6d8);return _0x3112d5['set'](_0xc327('0x25'),_0x13116e+'-'+_0x53abdb+'/'+_0x256db8)['json'](_0x28b671);}return null;};}function patchUpdates(_0x47f2f2){return function(_0x4d3936){try{jsonpatch[_0xc327('0x26')](_0x4d3936,_0x47f2f2,!![]);}catch(_0x121f2e){return BPromise[_0xc327('0x27')](_0x121f2e);}return _0x4d3936[_0xc327('0x28')]();};}function saveUpdates(_0x452c01,_0x2ad5bf){return function(_0x45b0ca){if(_0x45b0ca){return _0x45b0ca['update'](_0x452c01)[_0xc327('0x29')](function(_0xef90f6){return _0xef90f6;});}return null;};}function removeEntity(_0x109add,_0x576dc6){return function(_0x2da442){if(_0x2da442){return _0x2da442['destroy']()[_0xc327('0x29')](function(){var _0x37ca8e=_0x2da442[_0xc327('0x2a')]({'plain':!![]});var _0x3f428d=_0xc327('0x2b');return db[_0xc327('0x2c')][_0xc327('0x2d')]({'where':{'type':_0x3f428d,'resourceId':_0x37ca8e['id']}})[_0xc327('0x29')](function(){return _0x2da442;});})['then'](function(){_0x109add['status'](0xcc)[_0xc327('0x1f')]();});}};}function handleEntityNotFound(_0x442ce4,_0x2b7d8c){return function(_0x202106){if(!_0x202106){_0x442ce4[_0xc327('0x2e')](0x194);}return _0x202106;};}function handleError(_0x171e4d,_0x3dbc19){_0x3dbc19=_0x3dbc19||0x1f4;return function(_0x2b2e75){logger[_0xc327('0x2f')](_0x2b2e75[_0xc327('0x30')]);if(_0x2b2e75[_0xc327('0x31')]){delete _0x2b2e75[_0xc327('0x31')];}_0x171e4d['status'](_0x3dbc19)[_0xc327('0x32')](_0x2b2e75);};}exports['index']=function(_0x48be43,_0x2f40c8){var _0x23903d={},_0x139349={},_0x4eda1d={'count':0x0,'rows':[]};var _0x37be69=_[_0xc327('0x33')](db[_0xc327('0x34')][_0xc327('0x35')],function(_0x175acc){return{'name':_0x175acc[_0xc327('0x36')],'type':_0x175acc[_0xc327('0x37')][_0xc327('0x38')]};});_0x139349[_0xc327('0x39')]=_[_0xc327('0x33')](_0x37be69,'name');_0x139349[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x48be43[_0xc327('0x3a')]);_0x139349[_0xc327('0x3c')]=_['intersection'](_0x139349['model'],_0x139349[_0xc327('0x3a')]);_0x23903d[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x139349['model'],qs[_0xc327('0x3f')](_0x48be43[_0xc327('0x3a')][_0xc327('0x3f')]));_0x23903d[_0xc327('0x3d')]=_0x23903d[_0xc327('0x3d')][_0xc327('0x40')]?_0x23903d['attributes']:_0x139349['model'];if(!_0x48be43[_0xc327('0x3a')][_0xc327('0x41')](_0xc327('0x42'))){_0x23903d[_0xc327('0x23')]=qs[_0xc327('0x23')](_0x48be43[_0xc327('0x3a')][_0xc327('0x23')]);_0x23903d[_0xc327('0x21')]=qs[_0xc327('0x21')](_0x48be43[_0xc327('0x3a')][_0xc327('0x21')]);}_0x23903d[_0xc327('0x43')]=qs['sort'](_0x48be43[_0xc327('0x3a')][_0xc327('0x44')]);_0x23903d[_0xc327('0x45')]=qs[_0xc327('0x3c')](_[_0xc327('0x46')](_0x48be43[_0xc327('0x3a')],_0x139349[_0xc327('0x3c')]),_0x37be69);if(_0x48be43[_0xc327('0x3a')][_0xc327('0x47')]){_0x23903d['where']=_[_0xc327('0x48')](_0x23903d[_0xc327('0x45')],{'$or':_[_0xc327('0x33')](_0x37be69,function(_0x591d0f){if(_0x591d0f[_0xc327('0x37')]!==_0xc327('0x49')){var _0x4f0166={};_0x4f0166[_0x591d0f[_0xc327('0x31')]]={'$like':'%'+_0x48be43[_0xc327('0x3a')][_0xc327('0x47')]+'%'};return _0x4f0166;}})});}_0x23903d=_[_0xc327('0x48')]({},_0x23903d,_0x48be43[_0xc327('0x4a')]);var _0x2dc5f5={'where':_0x23903d[_0xc327('0x45')]};return db[_0xc327('0x34')][_0xc327('0x24')](_0x2dc5f5)[_0xc327('0x29')](function(_0x3b0751){_0x4eda1d[_0xc327('0x24')]=_0x3b0751;if(_0x48be43['query'][_0xc327('0x4b')]){_0x23903d[_0xc327('0x4c')]=[{'all':!![]}];}return db['FaxQueue'][_0xc327('0x4d')](_0x23903d);})['then'](function(_0x11cbfb){_0x4eda1d[_0xc327('0x4e')]=_0x11cbfb;return _0x4eda1d;})[_0xc327('0x29')](respondWithFilteredResult(_0x2f40c8,_0x23903d))[_0xc327('0x4f')](handleError(_0x2f40c8,null));};exports['show']=function(_0x9b5f63,_0x2a8457){var _0x38a596={'raw':!![],'where':{'id':_0x9b5f63['params']['id']}},_0x15a5e3={};_0x15a5e3[_0xc327('0x39')]=_[_0xc327('0x3b')](db[_0xc327('0x34')][_0xc327('0x35')]);_0x15a5e3[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x9b5f63['query']);_0x15a5e3['filters']=_[_0xc327('0x3e')](_0x15a5e3[_0xc327('0x39')],_0x15a5e3[_0xc327('0x3a')]);_0x38a596[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x15a5e3['model'],qs[_0xc327('0x3f')](_0x9b5f63[_0xc327('0x3a')][_0xc327('0x3f')]));_0x38a596[_0xc327('0x3d')]=_0x38a596['attributes'][_0xc327('0x40')]?_0x38a596[_0xc327('0x3d')]:_0x15a5e3[_0xc327('0x39')];if(_0x9b5f63['query']['includeAll']){_0x38a596['include']=[{'all':!![]}];}_0x38a596=_['merge']({},_0x38a596,_0x9b5f63[_0xc327('0x4a')]);return db[_0xc327('0x34')][_0xc327('0x50')](_0x38a596)[_0xc327('0x29')](handleEntityNotFound(_0x2a8457,null))['then'](respondWithResult(_0x2a8457,null))[_0xc327('0x4f')](handleError(_0x2a8457,null));};exports[_0xc327('0x51')]=function(_0x1acb5e,_0x32e81b){return db[_0xc327('0x34')][_0xc327('0x51')](_0x1acb5e[_0xc327('0x52')],{})[_0xc327('0x29')](function(_0xfe0392){var _0x53af60=_0x1acb5e[_0xc327('0x53')][_0xc327('0x2a')]({'plain':!![]});if(!_0x53af60)throw new Error(_0xc327('0x54'));if(_0x53af60[_0xc327('0x55')]===_0xc327('0x53')){var _0x2e9da0=_0xfe0392[_0xc327('0x2a')]({'plain':!![]});var _0xaa539b='FaxQueues';return db['UserProfileSection'][_0xc327('0x50')]({'where':{'name':_0xaa539b,'userProfileId':_0x53af60[_0xc327('0x56')]},'raw':!![]})[_0xc327('0x29')](function(_0x431fcf){if(_0x431fcf&&_0x431fcf[_0xc327('0x57')]===0x0){return db[_0xc327('0x2c')][_0xc327('0x51')]({'name':_0x2e9da0[_0xc327('0x31')],'resourceId':_0x2e9da0['id'],'type':_0x431fcf[_0xc327('0x31')],'sectionId':_0x431fcf['id']},{})[_0xc327('0x29')](function(){return _0xfe0392;});}else{return _0xfe0392;}})[_0xc327('0x4f')](function(_0x208920){logger[_0xc327('0x2f')](_0xc327('0x58'),_0x208920);throw _0x208920;});}return _0xfe0392;})[_0xc327('0x29')](respondWithResult(_0x32e81b,0xc9))[_0xc327('0x4f')](handleError(_0x32e81b,null));};exports[_0xc327('0x59')]=function(_0x1343ef,_0x36eed0){if(_0x1343ef['body']['id']){delete _0x1343ef[_0xc327('0x52')]['id'];}return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x1343ef[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x36eed0,null))[_0xc327('0x29')](saveUpdates(_0x1343ef[_0xc327('0x52')],null))[_0xc327('0x29')](respondWithResult(_0x36eed0,null))[_0xc327('0x4f')](handleError(_0x36eed0,null));};exports[_0xc327('0x2d')]=function(_0x14619d,_0x50ff26){return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x14619d[_0xc327('0x5a')]['id']}})['then'](handleEntityNotFound(_0x50ff26,null))['then'](removeEntity(_0x50ff26,null))[_0xc327('0x4f')](handleError(_0x50ff26,null));};exports['describe']=function(_0x550ce3,_0x2a6e9b){return db['FaxQueue']['describe']()[_0xc327('0x29')](respondWithResult(_0x2a6e9b,null))['catch'](handleError(_0x2a6e9b,null));};exports[_0xc327('0x5b')]=function(_0xcfb445,_0x16f872,_0x394a61){var _0x5d0769={'raw':!![],'where':{}},_0x43c30d={},_0x37c799;return db['FaxQueue'][_0xc327('0x5c')]({'where':{'id':_0xcfb445[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x16f872,null))[_0xc327('0x29')](function(_0x24e9e3){if(_0x24e9e3){_0x37c799=_0x24e9e3[_0xc327('0x2a')]({'plain':!![]});_0x43c30d['model']=_[_0xc327('0x3b')](db[_0xc327('0x5d')][_0xc327('0x35')]);_0x43c30d['query']=_[_0xc327('0x3b')](_0xcfb445['query']);_0x43c30d[_0xc327('0x3c')]=_['intersection'](_0x43c30d['model'],_0x43c30d['query']);_0x5d0769['attributes']=_['intersection'](_0x43c30d['model'],qs[_0xc327('0x3f')](_0xcfb445[_0xc327('0x3a')]['fields']));_0x5d0769[_0xc327('0x3d')]=_0x5d0769[_0xc327('0x3d')][_0xc327('0x40')]?_0x5d0769[_0xc327('0x3d')]:_0x43c30d[_0xc327('0x39')];if(!_0xcfb445['query'][_0xc327('0x41')](_0xc327('0x42'))){_0x5d0769[_0xc327('0x23')]=qs['limit'](_0xcfb445[_0xc327('0x3a')][_0xc327('0x23')]);_0x5d0769[_0xc327('0x21')]=qs['offset'](_0xcfb445['query']['offset']);}_0x5d0769[_0xc327('0x43')]=qs[_0xc327('0x44')](_0xcfb445[_0xc327('0x3a')][_0xc327('0x44')]);_0x5d0769[_0xc327('0x45')]=qs[_0xc327('0x3c')](_[_0xc327('0x46')](_0xcfb445[_0xc327('0x3a')],_0x43c30d[_0xc327('0x3c')]));_0x5d0769[_0xc327('0x45')][_0xc327('0x5e')]=_0x24e9e3['id'];if(_0xcfb445['query'][_0xc327('0x47')]){_0x5d0769[_0xc327('0x45')]=_[_0xc327('0x48')](_0x5d0769[_0xc327('0x45')],{'$or':_[_0xc327('0x33')](_0x5d0769[_0xc327('0x3d')],function(_0x398012){var _0x3a7303={};_0x3a7303[_0x398012]={'$like':'%'+_0xcfb445[_0xc327('0x3a')][_0xc327('0x47')]+'%'};return _0x3a7303;})});}_0x5d0769=_['merge']({},_0x5d0769,_0xcfb445[_0xc327('0x4a')]);return db['UserFaxQueue'][_0xc327('0x4d')](_0x5d0769);}})['then'](function(_0x5a5bba){if(_0x5a5bba){return db[_0xc327('0x5f')][_0xc327('0x60')]({'where':{'id':_['map'](_0x5a5bba,_0xc327('0x61')),'role':_0xc327('0x62')},'attributes':['id',_0xc327('0x31'),_0xc327('0x63'),'updatedAt',_0xc327('0x64')]});}})['then'](function(_0x52c582){if(_0x52c582){return{'count':_0x52c582['count'],'rows':_[_0xc327('0x33')](_0x52c582[_0xc327('0x4e')],function(_0x222d99){return{'membername':_0x222d99[_0xc327('0x31')],'UserId':_0x222d99['id'],'queue_name':_0x37c799[_0xc327('0x31')],'FaxQueueId':_0x37c799['id'],'interface':util[_0xc327('0x65')]('%s/%s',_0xc327('0x66'),_0x222d99[_0xc327('0x31')]),'penalty':0x0,'paused':_0x222d99[_0xc327('0x63')],'createdAt':_0x222d99[_0xc327('0x64')],'updatedAt':_0x222d99['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc327('0x29')](respondWithFilteredResult(_0x16f872,_0x5d0769))[_0xc327('0x4f')](handleError(_0x16f872,null));};exports[_0xc327('0x67')]=function(_0x14cf29,_0x1bba72,_0x5d4058){var _0x1b32e4={};var _0x4bf37a={};var _0xe33da4;var _0x4de125;return db['FaxQueue'][_0xc327('0x5c')]({'where':{'id':_0x14cf29[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x1bba72,null))[_0xc327('0x29')](function(_0x5ee166){if(_0x5ee166){_0xe33da4=_0x5ee166;_0x4bf37a[_0xc327('0x39')]=_[_0xc327('0x3b')](db[_0xc327('0x68')][_0xc327('0x35')]);_0x4bf37a[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x14cf29[_0xc327('0x3a')]);_0x4bf37a[_0xc327('0x3c')]=_['intersection'](_0x4bf37a[_0xc327('0x39')],_0x4bf37a[_0xc327('0x3a')]);_0x1b32e4[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x4bf37a['model'],qs[_0xc327('0x3f')](_0x14cf29[_0xc327('0x3a')][_0xc327('0x3f')]));_0x1b32e4[_0xc327('0x3d')]=_0x1b32e4[_0xc327('0x3d')][_0xc327('0x40')]?_0x1b32e4[_0xc327('0x3d')]:_0x4bf37a['model'];_0x1b32e4[_0xc327('0x43')]=qs['sort'](_0x14cf29['query'][_0xc327('0x44')]);_0x1b32e4[_0xc327('0x45')]=qs[_0xc327('0x3c')](_['pick'](_0x14cf29[_0xc327('0x3a')],_0x4bf37a[_0xc327('0x3c')]));if(_0x14cf29[_0xc327('0x3a')]['filter']){_0x1b32e4[_0xc327('0x45')]=_['merge'](_0x1b32e4[_0xc327('0x45')],{'$or':_['map'](_0x1b32e4[_0xc327('0x3d')],function(_0x4144aa){var _0x364d2b={};_0x364d2b[_0x4144aa]={'$like':'%'+_0x14cf29[_0xc327('0x3a')]['filter']+'%'};return _0x364d2b;})});}_0x1b32e4=_[_0xc327('0x48')]({},_0x1b32e4,_0x14cf29['options']);return _0xe33da4[_0xc327('0x67')](_0x1b32e4);}})[_0xc327('0x29')](function(_0xae17f8){if(_0xae17f8){_0x4de125=_0xae17f8[_0xc327('0x40')];if(!_0x14cf29[_0xc327('0x3a')][_0xc327('0x41')](_0xc327('0x42'))){_0x1b32e4[_0xc327('0x23')]=qs[_0xc327('0x23')](_0x14cf29[_0xc327('0x3a')][_0xc327('0x23')]);_0x1b32e4[_0xc327('0x21')]=qs['offset'](_0x14cf29[_0xc327('0x3a')]['offset']);}return _0xe33da4[_0xc327('0x67')](_0x1b32e4);}})[_0xc327('0x29')](function(_0x10a95a){if(_0x10a95a){return _0x10a95a?{'count':_0x4de125,'rows':_0x10a95a}:null;}})[_0xc327('0x29')](respondWithResult(_0x1bba72,null))['catch'](handleError(_0x1bba72,null));};exports[_0xc327('0x69')]=function(_0x5a6b4f,_0x1d287d,_0x5d9c88){var _0x3af4fd=_0x5a6b4f['body']['ids'];return db['Team'][_0xc327('0x4d')]({'where':{'id':_0x3af4fd},'attributes':['id'],'include':[{'model':db[_0xc327('0x5f')],'as':'Agents','attributes':['id',_0xc327('0x31'),_0xc327('0x6a'),_0xc327('0x6b'),_0xc327('0x6c')],'raw':!![]}]})['then'](function(_0x4a5e1d){if(_0x4a5e1d){var _0x4a937e=_[_0xc327('0x6d')](_0x4a5e1d,function(_0x7a27b4){var _0xc7e317=_0x7a27b4['get']({'plain':!![]});return _0xc7e317['Agents'];});return db['FaxQueue'][_0xc327('0x50')]({'where':{'id':_0x5a6b4f['params']['id']}})['then'](function(_0x556627){return db['sequelize'][_0xc327('0x6e')](function(_0x48f5f8){return _0x556627[_0xc327('0x69')](_0x3af4fd,{'transaction':_0x48f5f8})['then'](function(){return BPromise['each'](_0x4a937e,function(_0x2327de){return db[_0xc327('0x5d')][_0xc327('0x6f')]({'where':{'UserId':_0x2327de['id'],'FaxQueueId':_0x5a6b4f[_0xc327('0x5a')]['id']},'transaction':_0x48f5f8});});})[_0xc327('0x29')](function(){_0x4a937e['forEach'](function(_0x37a8e8){socket[_0xc327('0x70')]('userFaxQueue:save',{'UserId':_0x37a8e8['id'],'FaxQueueId':_0x556627['id']});});});});});}})[_0xc327('0x29')](respondWithStatusCode(_0x1d287d,null))[_0xc327('0x4f')](handleError(_0x1d287d,null));};exports['removeTeams']=function(_0x1e0859,_0x2f87d9,_0x59b21d){return db[_0xc327('0x68')]['findAll']({'where':{'id':_0x1e0859[_0xc327('0x3a')][_0xc327('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc327('0x5f')],'as':_0xc327('0x72'),'attributes':['id'],'raw':!![]}]})[_0xc327('0x29')](handleEntityNotFound(_0x2f87d9,null))[_0xc327('0x29')](function(_0x52acb5){var _0xb85406=_[_0xc327('0x33')](_0x52acb5,'id');var _0x941d8a=[];var _0x41efb4=[];var _0x2ad3c3=squel[_0xc327('0x73')]();_0x2ad3c3[_0xc327('0x74')](_0xc327('0x75'))[_0xc327('0x76')](_0xc327('0x77'),'tq')[_0xc327('0x78')]('user_has_teams','ut',_0xc327('0x79'))[_0xc327('0x45')]('FaxQueueId\x20=\x20?',_0x1e0859['params']['id']);for(var _0x1fb724=0x0;_0x1fb724<_0x52acb5[_0xc327('0x40')];_0x1fb724+=0x1){let _0x274c1a=_0x52acb5[_0x1fb724];for(var _0x1dbc95=0x0;_0x1dbc95<_0x274c1a['Agents'][_0xc327('0x40')];_0x1dbc95+=0x1){let _0x511bfa=_0x274c1a[_0xc327('0x72')][_0x1dbc95];var _0x28a26b=_0x2ad3c3[_0xc327('0x7a')]();_0x28a26b[_0xc327('0x45')]('ut.UserId\x20=\x20?',_0x511bfa['id']);_0x41efb4[_0xc327('0x7b')](db[_0xc327('0x7c')][_0xc327('0x3a')](_0x28a26b[_0xc327('0x7d')](),{'type':db[_0xc327('0x7c')]['QueryTypes'][_0xc327('0x7e')]})['then'](function(_0x26a351){if(_0x26a351[_0xc327('0x40')]===0x1){return _0x511bfa['id'];}else{var _0x47f5a0=_[_0xc327('0x7f')](_[_0xc327('0x33')](_0x26a351,'TeamId'),function(_0x3d0eea){return _[_0xc327('0x80')](_0xb85406,_0x3d0eea);});if(_0x47f5a0){return _0x511bfa['id'];}}}));}}return BPromise[_0xc327('0x81')](_0x41efb4)[_0xc327('0x29')](function(_0x1c55f7){_0x941d8a=_(_0x941d8a)['union'](_0x1c55f7)[_0xc327('0x82')]()[_0xc327('0x83')]();return db[_0xc327('0x34')]['find']({'where':{'id':_0x1e0859[_0xc327('0x5a')]['id']}})['then'](function(_0x401793){return db[_0xc327('0x7c')][_0xc327('0x6e')](function(_0x407aea){return _0x401793[_0xc327('0x84')](_0x1e0859['query'][_0xc327('0x71')],{'transaction':_0x407aea})['then'](function(){if(!_[_0xc327('0x85')](_0x941d8a)){return _0x401793[_0xc327('0x86')](_0x941d8a,{'transaction':_0x407aea});}})[_0xc327('0x29')](function(){_0x941d8a[_0xc327('0x87')](function(_0x22ca90){socket[_0xc327('0x70')](_0xc327('0x88'),{'UserId':_0x22ca90,'FaxQueueId':_0x401793['id']});});});});});});})[_0xc327('0x29')](respondWithStatusCode(_0x2f87d9,null))[_0xc327('0x4f')](handleError(_0x2f87d9,null));};exports[_0xc327('0x89')]=function(_0x47c73c,_0x35c50f,_0x81b775){return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x47c73c[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x35c50f,null))[_0xc327('0x29')](function(_0x1f8493){if(_0x1f8493){return _0x1f8493[_0xc327('0x89')](_0x47c73c[_0xc327('0x52')][_0xc327('0x71')],_[_0xc327('0x8a')](_0x47c73c[_0xc327('0x52')],[_0xc327('0x71'),'id'])||{})[_0xc327('0x8b')](function(_0x4d0e2f){for(var _0x470de0=0x0;_0x470de0<_0x47c73c[_0xc327('0x52')][_0xc327('0x71')]['length'];_0x470de0+=0x1){socket[_0xc327('0x70')]('userFaxQueue:save',{'UserId':Number(_0x47c73c[_0xc327('0x52')]['ids'][_0x470de0]),'FaxQueueId':Number(_0x47c73c[_0xc327('0x5a')]['id'])});}return _0x4d0e2f;});}})[_0xc327('0x29')](respondWithResult(_0x35c50f,null))[_0xc327('0x4f')](handleError(_0x35c50f,null));};exports[_0xc327('0x86')]=function(_0x374623,_0x3ce130,_0x66fb92){return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x374623[_0xc327('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ce130,null))['then'](function(_0x3943fb){if(_0x3943fb){return _0x3943fb[_0xc327('0x86')](_0x374623[_0xc327('0x3a')]['ids'])[_0xc327('0x29')](function(){if(_['isArray'](_0x374623[_0xc327('0x3a')][_0xc327('0x71')])){for(var _0x234996=0x0;_0x234996<_0x374623[_0xc327('0x3a')][_0xc327('0x71')][_0xc327('0x40')];_0x234996+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x374623[_0xc327('0x3a')][_0xc327('0x71')][_0x234996]),'FaxQueueId':Number(_0x374623['params']['id'])});}}else{socket['emit'](_0xc327('0x88'),{'UserId':Number(_0x374623[_0xc327('0x3a')]['ids']),'FaxQueueId':Number(_0x374623[_0xc327('0x5a')]['id'])});}});}})[_0xc327('0x29')](respondWithStatusCode(_0x3ce130,null))[_0xc327('0x4f')](handleError(_0x3ce130,null));};exports['getAgents']=function(_0x6512f1,_0x3f2768,_0x541314){var _0x40de0f={};var _0x161229={};var _0x1d1209;var _0x24ad6;return db[_0xc327('0x34')][_0xc327('0x5c')]({'where':{'id':_0x6512f1[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x3f2768,null))[_0xc327('0x29')](function(_0x178e55){if(_0x178e55){_0x1d1209=_0x178e55;_0x161229[_0xc327('0x39')]=_[_0xc327('0x3b')](db[_0xc327('0x5f')][_0xc327('0x35')]);_0x161229[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x6512f1[_0xc327('0x3a')]);_0x161229[_0xc327('0x3c')]=_['intersection'](_0x161229[_0xc327('0x39')],_0x161229[_0xc327('0x3a')]);_0x40de0f[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x161229[_0xc327('0x39')],qs['fields'](_0x6512f1[_0xc327('0x3a')][_0xc327('0x3f')]));_0x40de0f[_0xc327('0x3d')]=_0x40de0f['attributes'][_0xc327('0x40')]?_0x40de0f[_0xc327('0x3d')]:_0x161229[_0xc327('0x39')];_0x40de0f[_0xc327('0x43')]=qs['sort'](_0x6512f1[_0xc327('0x3a')]['sort']);_0x40de0f[_0xc327('0x45')]=qs[_0xc327('0x3c')](_[_0xc327('0x46')](_0x6512f1[_0xc327('0x3a')],_0x161229[_0xc327('0x3c')]));if(_0x6512f1[_0xc327('0x3a')][_0xc327('0x47')]){_0x40de0f[_0xc327('0x45')]=_[_0xc327('0x48')](_0x40de0f['where'],{'$or':_[_0xc327('0x33')](_0x40de0f['attributes'],function(_0x4ddc70){var _0x42b7fd={};_0x42b7fd[_0x4ddc70]={'$like':'%'+_0x6512f1[_0xc327('0x3a')]['filter']+'%'};return _0x42b7fd;})});}_0x40de0f=_[_0xc327('0x48')]({},_0x40de0f,_0x6512f1[_0xc327('0x4a')]);return _0x1d1209[_0xc327('0x8c')](_0x40de0f);}})[_0xc327('0x29')](function(_0x252ec3){if(_0x252ec3){_0x24ad6=_0x252ec3[_0xc327('0x40')];if(!_0x6512f1[_0xc327('0x3a')][_0xc327('0x41')](_0xc327('0x42'))){_0x40de0f['limit']=qs[_0xc327('0x23')](_0x6512f1[_0xc327('0x3a')][_0xc327('0x23')]);_0x40de0f[_0xc327('0x21')]=qs[_0xc327('0x21')](_0x6512f1[_0xc327('0x3a')][_0xc327('0x21')]);}return _0x1d1209[_0xc327('0x8c')](_0x40de0f);}})[_0xc327('0x29')](function(_0x197333){if(_0x197333){return _0x197333?{'count':_0x24ad6,'rows':_0x197333}:null;}})[_0xc327('0x29')](respondWithResult(_0x3f2768,null))[_0xc327('0x4f')](handleError(_0x3f2768,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 0e5bf0c..601eea6 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 _0x5ebd=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue'];(function(_0x28388,_0x5b1b84){var _0x43f559=function(_0x4916ec){while(--_0x4916ec){_0x28388['push'](_0x28388['shift']());}};_0x43f559(++_0x5b1b84);}(_0x5ebd,0xbb));var _0xd5eb=function(_0x5acef4,_0x434e7c){_0x5acef4=_0x5acef4-0x0;var _0x5bf891=_0x5ebd[_0x5acef4];return _0x5bf891;};'use strict';var EventEmitter=require(_0xd5eb('0x0'));var FaxQueue=require(_0xd5eb('0x1'))['db'][_0xd5eb('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5eb('0x3'),'afterUpdate':_0xd5eb('0x4'),'afterDestroy':_0xd5eb('0x5')};function emitEvent(_0xda0a0c){return function(_0x140867,_0x310fd2,_0x43a60f){FaxQueueEvents[_0xd5eb('0x6')](_0xda0a0c+':'+_0x140867['id'],_0x140867);FaxQueueEvents[_0xd5eb('0x6')](_0xda0a0c,_0x140867);_0x43a60f(null);};}for(var e in events){if(events[_0xd5eb('0x7')](e)){var event=events[e];FaxQueue[_0xd5eb('0x8')](e,emitEvent(event));}}module[_0xd5eb('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x6e34=['hasOwnProperty','exports','events','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e34,0x1e2));var _0x46e3=function(_0x2bb33a,_0x3947d6){_0x2bb33a=_0x2bb33a-0x0;var _0x53aaee=_0x6e34[_0x2bb33a];return _0x53aaee;};'use strict';var EventEmitter=require(_0x46e3('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x46e3('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x46e3('0x2')](0x0);var events={'afterCreate':_0x46e3('0x3'),'afterUpdate':_0x46e3('0x4'),'afterDestroy':_0x46e3('0x5')};function emitEvent(_0x7761d){return function(_0x4d744a,_0x217c88,_0x47b397){FaxQueueEvents['emit'](_0x7761d+':'+_0x4d744a['id'],_0x4d744a);FaxQueueEvents['emit'](_0x7761d,_0x4d744a);_0x47b397(null);};}for(var e in events){if(events[_0x46e3('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x46e3('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 d8afce6..c9ee6f9 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 _0xfca3=['api','moment','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','lodash','util'];(function(_0x1005d4,_0x5199ab){var _0x421977=function(_0x30c727){while(--_0x30c727){_0x1005d4['push'](_0x1005d4['shift']());}};_0x421977(++_0x5199ab);}(_0xfca3,0x142));var _0x3fca=function(_0x389ff5,_0x224876){_0x389ff5=_0x389ff5-0x0;var _0x540e85=_0xfca3[_0x389ff5];return _0x540e85;};'use strict';var _=require(_0x3fca('0x0'));var util=require(_0x3fca('0x1'));var logger=require('../../config/logger')(_0x3fca('0x2'));var moment=require(_0x3fca('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fca('0x4'));var rimraf=require(_0x3fca('0x5'));var config=require(_0x3fca('0x6'));var attributes=require(_0x3fca('0x7'));module['exports']=function(_0x31e266,_0x576e38){return _0x31e266['define'](_0x3fca('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfd2=['util','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x1f613c,_0x249921){var _0x466955=function(_0x307b7e){while(--_0x307b7e){_0x1f613c['push'](_0x1f613c['shift']());}};_0x466955(++_0x249921);}(_0xcfd2,0xf0));var _0x2cfd=function(_0x4f9023,_0x49df18){_0x4f9023=_0x4f9023-0x0;var _0x2f8b6d=_0xcfd2[_0x4f9023];return _0x2f8b6d;};'use strict';var _=require('lodash');var util=require(_0x2cfd('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2cfd('0x1'));var rp=require(_0x2cfd('0x2'));var fs=require('fs');var path=require(_0x2cfd('0x3'));var rimraf=require(_0x2cfd('0x4'));var config=require('../../config/environment');var attributes=require(_0x2cfd('0x5'));module[_0x2cfd('0x6')]=function(_0x500297,_0x3336aa){return _0x500297[_0x2cfd('0x7')](_0x2cfd('0x8'),attributes,{'tableName':_0x2cfd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index efedc69..5f497fc 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 _0x7e61=['info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','options','where','attributes','limit','include','map','model','ShowFaxQueue','FaxQueue','find','raw','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request'];(function(_0x1e91d7,_0x562013){var _0x5f0025=function(_0x2ad4ab){while(--_0x2ad4ab){_0x1e91d7['push'](_0x1e91d7['shift']());}};_0x5f0025(++_0x562013);}(_0x7e61,0x19b));var _0x17e6=function(_0x2d9196,_0x417816){_0x2d9196=_0x2d9196-0x0;var _0xa05f65=_0x7e61[_0x2d9196];return _0xa05f65;};'use strict';var _=require(_0x17e6('0x0'));var util=require(_0x17e6('0x1'));var moment=require(_0x17e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x17e6('0x3'));var fs=require('fs');var Redis=require(_0x17e6('0x4'));var db=require(_0x17e6('0x5'))['db'];var utils=require(_0x17e6('0x6'));var logger=require(_0x17e6('0x7'))(_0x17e6('0x8'));var config=require(_0x17e6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17e6('0xa')][_0x17e6('0xb')]({'port':0x232a});config[_0x17e6('0xc')]=_[_0x17e6('0xd')](config[_0x17e6('0xc')],{'host':_0x17e6('0xe'),'port':0x18eb});var socket=require(_0x17e6('0xf'))(new Redis(config[_0x17e6('0xc')]));require(_0x17e6('0x10'))[_0x17e6('0x11')](socket);function respondWithRpcPromise(_0x1bd46b,_0x34ebc9,_0x35ecb0){return new BPromise(function(_0x45e309,_0x156362){return client[_0x17e6('0x12')](_0x1bd46b,_0x35ecb0)['then'](function(_0x27eba9){logger[_0x17e6('0x13')](_0x17e6('0x14'),_0x34ebc9,_0x17e6('0x15'));logger[_0x17e6('0x16')](_0x17e6('0x17'),_0x34ebc9,'request\x20sent',JSON['stringify'](_0x27eba9));if(_0x27eba9[_0x17e6('0x18')]){if(_0x27eba9['error'][_0x17e6('0x19')]===0x1f4){logger[_0x17e6('0x18')](_0x17e6('0x14'),_0x34ebc9,_0x27eba9[_0x17e6('0x18')]['message']);return _0x156362(_0x27eba9['error'][_0x17e6('0x1a')]);}logger[_0x17e6('0x18')](_0x17e6('0x14'),_0x34ebc9,_0x27eba9[_0x17e6('0x18')][_0x17e6('0x1a')]);return _0x45e309(_0x27eba9[_0x17e6('0x18')][_0x17e6('0x1a')]);}else{logger['info'](_0x17e6('0x14'),_0x34ebc9,_0x17e6('0x15'));_0x45e309(_0x27eba9[_0x17e6('0x1b')][_0x17e6('0x1a')]);}})[_0x17e6('0x1c')](function(_0x2d9e57){logger[_0x17e6('0x18')](_0x17e6('0x14'),_0x34ebc9,_0x2d9e57);_0x156362(_0x2d9e57);});});}exports[_0x17e6('0x1d')]=function(_0x415955){var _0x1ae32a=this;return new Promise(function(_0x2f3a76,_0x5ed1cd){return db['FaxQueue']['findAll']({'raw':_0x415955[_0x17e6('0x1e')]?_0x415955[_0x17e6('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x415955[_0x17e6('0x1e')]?_0x415955[_0x17e6('0x1e')][_0x17e6('0x1f')]||null:null,'attributes':_0x415955[_0x17e6('0x1e')]?_0x415955[_0x17e6('0x1e')][_0x17e6('0x20')]||null:null,'limit':_0x415955[_0x17e6('0x1e')]?_0x415955[_0x17e6('0x1e')][_0x17e6('0x21')]||null:null,'include':_0x415955[_0x17e6('0x1e')]?_0x415955[_0x17e6('0x1e')][_0x17e6('0x22')]?_[_0x17e6('0x23')](_0x415955['options'][_0x17e6('0x22')],function(_0x3f2347){return{'model':db[_0x3f2347[_0x17e6('0x24')]],'as':_0x3f2347['as'],'attributes':_0x3f2347[_0x17e6('0x20')],'include':_0x3f2347[_0x17e6('0x22')]?_[_0x17e6('0x23')](_0x3f2347['include'],function(_0x149324){return{'model':db[_0x149324[_0x17e6('0x24')]],'as':_0x149324['as'],'attributes':_0x149324[_0x17e6('0x20')],'include':_0x149324[_0x17e6('0x22')]?_[_0x17e6('0x23')](_0x149324[_0x17e6('0x22')],function(_0x110e52){return{'model':db[_0x110e52[_0x17e6('0x24')]],'as':_0x110e52['as'],'attributes':_0x110e52[_0x17e6('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22d72e){logger[_0x17e6('0x13')](_0x17e6('0x1d'),_0x415955);logger[_0x17e6('0x16')](_0x17e6('0x1d'),_0x415955,JSON['stringify'](_0x22d72e));_0x2f3a76(_0x22d72e);})['catch'](function(_0x186aef){logger[_0x17e6('0x18')](_0x17e6('0x1d'),_0x186aef[_0x17e6('0x1a')],_0x415955);_0x5ed1cd(_0x1ae32a[_0x17e6('0x18')](0x1f4,_0x186aef['message']));});});};exports[_0x17e6('0x25')]=function(_0x30d4ea){var _0x49e17f=this;return new Promise(function(_0x4c2dc7,_0x2928a4){return db[_0x17e6('0x26')][_0x17e6('0x27')]({'raw':_0x30d4ea[_0x17e6('0x1e')]?_0x30d4ea[_0x17e6('0x1e')][_0x17e6('0x28')]===undefined?!![]:![]:!![],'where':_0x30d4ea[_0x17e6('0x1e')]?_0x30d4ea['options'][_0x17e6('0x1f')]||null:null,'attributes':_0x30d4ea[_0x17e6('0x1e')]?_0x30d4ea[_0x17e6('0x1e')][_0x17e6('0x20')]||null:null,'include':_0x30d4ea[_0x17e6('0x1e')]?_0x30d4ea[_0x17e6('0x1e')]['include']?_[_0x17e6('0x23')](_0x30d4ea['options']['include'],function(_0x220dcc){return{'model':db[_0x220dcc[_0x17e6('0x24')]],'as':_0x220dcc['as'],'attributes':_0x220dcc[_0x17e6('0x20')],'include':_0x220dcc['include']?_[_0x17e6('0x23')](_0x220dcc[_0x17e6('0x22')],function(_0x501ed7){return{'model':db[_0x501ed7[_0x17e6('0x24')]],'as':_0x501ed7['as'],'attributes':_0x501ed7[_0x17e6('0x20')],'include':_0x501ed7[_0x17e6('0x22')]?_[_0x17e6('0x23')](_0x501ed7[_0x17e6('0x22')],function(_0x3e218b){return{'model':db[_0x3e218b['model']],'as':_0x3e218b['as'],'attributes':_0x3e218b[_0x17e6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x17e6('0x29')](function(_0x34bb3c){logger[_0x17e6('0x13')]('ShowFaxQueue',_0x30d4ea);logger[_0x17e6('0x16')](_0x17e6('0x25'),_0x30d4ea,JSON[_0x17e6('0x2a')](_0x34bb3c));_0x4c2dc7(_0x34bb3c);})['catch'](function(_0x4f9eb3){logger[_0x17e6('0x18')](_0x17e6('0x25'),_0x4f9eb3[_0x17e6('0x1a')],_0x30d4ea);_0x2928a4(_0x49e17f['error'](0x1f4,_0x4f9eb3[_0x17e6('0x1a')]));});});}; \ No newline at end of file +var _0xe507=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x490dbd,_0x34b90f){var _0x521b5b=function(_0x5400f3){while(--_0x5400f3){_0x490dbd['push'](_0x490dbd['shift']());}};_0x521b5b(++_0x34b90f);}(_0xe507,0x1bd));var _0x7e50=function(_0x3c424f,_0x1c61c2){_0x3c424f=_0x3c424f-0x0;var _0x3fee82=_0xe507[_0x3c424f];return _0x3fee82;};'use strict';var _=require(_0x7e50('0x0'));var util=require(_0x7e50('0x1'));var moment=require(_0x7e50('0x2'));var BPromise=require(_0x7e50('0x3'));var rs=require(_0x7e50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e50('0x5'))['db'];var utils=require(_0x7e50('0x6'));var logger=require(_0x7e50('0x7'))(_0x7e50('0x8'));var config=require(_0x7e50('0x9'));var jayson=require(_0x7e50('0xa'));var client=jayson['client'][_0x7e50('0xb')]({'port':0x232a});config[_0x7e50('0xc')]=_[_0x7e50('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e50('0xe'))(new Redis(config[_0x7e50('0xc')]));require(_0x7e50('0xf'))[_0x7e50('0x10')](socket);function respondWithRpcPromise(_0x5aea8c,_0x24cbbe,_0x57d5e2){return new BPromise(function(_0x5af5e4,_0x406a6d){return client[_0x7e50('0x11')](_0x5aea8c,_0x57d5e2)[_0x7e50('0x12')](function(_0x2527fb){logger[_0x7e50('0x13')](_0x7e50('0x14'),_0x24cbbe,_0x7e50('0x15'));logger[_0x7e50('0x16')](_0x7e50('0x17'),_0x24cbbe,_0x7e50('0x15'),JSON['stringify'](_0x2527fb));if(_0x2527fb[_0x7e50('0x18')]){if(_0x2527fb[_0x7e50('0x18')][_0x7e50('0x19')]===0x1f4){logger[_0x7e50('0x18')](_0x7e50('0x14'),_0x24cbbe,_0x2527fb[_0x7e50('0x18')]['message']);return _0x406a6d(_0x2527fb[_0x7e50('0x18')][_0x7e50('0x1a')]);}logger[_0x7e50('0x18')](_0x7e50('0x14'),_0x24cbbe,_0x2527fb[_0x7e50('0x18')][_0x7e50('0x1a')]);return _0x5af5e4(_0x2527fb[_0x7e50('0x18')]['message']);}else{logger['info'](_0x7e50('0x14'),_0x24cbbe,'request\x20sent');_0x5af5e4(_0x2527fb['result'][_0x7e50('0x1a')]);}})[_0x7e50('0x1b')](function(_0x3750aa){logger[_0x7e50('0x18')](_0x7e50('0x14'),_0x24cbbe,_0x3750aa);_0x406a6d(_0x3750aa);});});}exports[_0x7e50('0x1c')]=function(_0x464c66){var _0x4d0cad=this;return new Promise(function(_0x5e1ead,_0x2176db){return db[_0x7e50('0x1d')]['findAll']({'raw':_0x464c66[_0x7e50('0x1e')]?_0x464c66['options'][_0x7e50('0x1f')]===undefined?!![]:![]:!![],'where':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x20')]||null:null,'attributes':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x21')]||null:null,'limit':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x22')]||null:null,'include':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x23')]?_[_0x7e50('0x24')](_0x464c66[_0x7e50('0x1e')][_0x7e50('0x23')],function(_0x18c74b){return{'model':db[_0x18c74b[_0x7e50('0x25')]],'as':_0x18c74b['as'],'attributes':_0x18c74b[_0x7e50('0x21')],'include':_0x18c74b['include']?_['map'](_0x18c74b[_0x7e50('0x23')],function(_0x4d5d79){return{'model':db[_0x4d5d79[_0x7e50('0x25')]],'as':_0x4d5d79['as'],'attributes':_0x4d5d79[_0x7e50('0x21')],'include':_0x4d5d79['include']?_[_0x7e50('0x24')](_0x4d5d79[_0x7e50('0x23')],function(_0x15534f){return{'model':db[_0x15534f[_0x7e50('0x25')]],'as':_0x15534f['as'],'attributes':_0x15534f[_0x7e50('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e50('0x12')](function(_0x4783ae){logger[_0x7e50('0x13')](_0x7e50('0x1c'),_0x464c66);logger[_0x7e50('0x16')](_0x7e50('0x1c'),_0x464c66,JSON[_0x7e50('0x26')](_0x4783ae));_0x5e1ead(_0x4783ae);})[_0x7e50('0x1b')](function(_0xceb6a7){logger[_0x7e50('0x18')](_0x7e50('0x1c'),_0xceb6a7[_0x7e50('0x1a')],_0x464c66);_0x2176db(_0x4d0cad[_0x7e50('0x18')](0x1f4,_0xceb6a7[_0x7e50('0x1a')]));});});};exports[_0x7e50('0x27')]=function(_0x3ff3c7){var _0x44923c=this;return new Promise(function(_0x5825ec,_0x145442){return db[_0x7e50('0x1d')][_0x7e50('0x28')]({'raw':_0x3ff3c7['options']?_0x3ff3c7[_0x7e50('0x1e')][_0x7e50('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ff3c7[_0x7e50('0x1e')]?_0x3ff3c7[_0x7e50('0x1e')][_0x7e50('0x20')]||null:null,'attributes':_0x3ff3c7[_0x7e50('0x1e')]?_0x3ff3c7['options'][_0x7e50('0x21')]||null:null,'include':_0x3ff3c7[_0x7e50('0x1e')]?_0x3ff3c7['options']['include']?_[_0x7e50('0x24')](_0x3ff3c7['options'][_0x7e50('0x23')],function(_0x5b3d16){return{'model':db[_0x5b3d16['model']],'as':_0x5b3d16['as'],'attributes':_0x5b3d16['attributes'],'include':_0x5b3d16[_0x7e50('0x23')]?_[_0x7e50('0x24')](_0x5b3d16[_0x7e50('0x23')],function(_0x387ae1){return{'model':db[_0x387ae1[_0x7e50('0x25')]],'as':_0x387ae1['as'],'attributes':_0x387ae1[_0x7e50('0x21')],'include':_0x387ae1[_0x7e50('0x23')]?_[_0x7e50('0x24')](_0x387ae1[_0x7e50('0x23')],function(_0x5341d4){return{'model':db[_0x5341d4[_0x7e50('0x25')]],'as':_0x5341d4['as'],'attributes':_0x5341d4[_0x7e50('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e50('0x12')](function(_0x5f3471){logger[_0x7e50('0x13')](_0x7e50('0x27'),_0x3ff3c7);logger[_0x7e50('0x16')](_0x7e50('0x27'),_0x3ff3c7,JSON[_0x7e50('0x26')](_0x5f3471));_0x5825ec(_0x5f3471);})[_0x7e50('0x1b')](function(_0x4bb55d){logger['error'](_0x7e50('0x27'),_0x4bb55d[_0x7e50('0x1a')],_0x3ff3c7);_0x145442(_0x44923c[_0x7e50('0x18')](0x1f4,_0x4bb55d[_0x7e50('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e41f7d9..337019b 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 _0xf6ca=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xf6ca,0x11e));var _0xaf6c=function(_0x4c2679,_0x2c0a2f){_0x4c2679=_0x4c2679-0x0;var _0x1e6555=_0xf6ca[_0x4c2679];return _0x1e6555;};'use strict';var FaxQueueEvents=require(_0xaf6c('0x0'));var events=[_0xaf6c('0x1'),_0xaf6c('0x2'),'update'];function createListener(_0x2d08cb,_0xfe4cf2){return function(_0x5c1632){_0xfe4cf2[_0xaf6c('0x3')](_0x2d08cb,_0x5c1632);};}function removeListener(_0x37f2eb,_0x9512b6){return function(){FaxQueueEvents[_0xaf6c('0x4')](_0x37f2eb,_0x9512b6);};}exports['register']=function(_0x39fefe){for(var _0x3973dc=0x0,_0x422496=events[_0xaf6c('0x5')];_0x3973dc<_0x422496;_0x3973dc++){var _0x11c047=events[_0x3973dc];var _0x2302af=createListener(_0xaf6c('0x6')+_0x11c047,_0x39fefe);FaxQueueEvents['on'](_0x11c047,_0x2302af);}}; \ No newline at end of file +var _0x86ae=['update','removeListener','register','faxQueue:','save','remove'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x86ae,0xfa));var _0xe86a=function(_0x2457c0,_0x15fd6b){_0x2457c0=_0x2457c0-0x0;var _0x1354b2=_0x86ae[_0x2457c0];return _0x1354b2;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xe86a('0x0'),_0xe86a('0x1'),_0xe86a('0x2')];function createListener(_0x19ee7c,_0x2af036){return function(_0x463292){_0x2af036['emit'](_0x19ee7c,_0x463292);};}function removeListener(_0x5ea753,_0x20efe3){return function(){FaxQueueEvents[_0xe86a('0x3')](_0x5ea753,_0x20efe3);};}exports[_0xe86a('0x4')]=function(_0xe7da9f){for(var _0x5328ed=0x0,_0x39fe5a=events['length'];_0x5328ed<_0x39fe5a;_0x5328ed++){var _0x1003ba=events[_0x5328ed];var _0x4ef640=createListener(_0xe86a('0x5')+_0x1003ba,_0xe7da9f);FaxQueueEvents['on'](_0x1003ba,_0x4ef640);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9ee49a4..ac8d8e2 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 _0xaa64=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x500d77,_0x2a564d){var _0x56e2e7=function(_0x559490){while(--_0x559490){_0x500d77['push'](_0x500d77['shift']());}};_0x56e2e7(++_0x2a564d);}(_0xaa64,0xf7));var _0x4aa6=function(_0x3d31b9,_0x14c843){_0x3d31b9=_0x3d31b9-0x0;var _0x203d77=_0xaa64[_0x3d31b9];return _0x203d77;};'use strict';var multer=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var path=require('path');var timeout=require(_0x4aa6('0x2'));var express=require('express');var router=express[_0x4aa6('0x3')]();var fs_extra=require(_0x4aa6('0x4'));var auth=require(_0x4aa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa6('0x6'));var controller=require(_0x4aa6('0x7'));router[_0x4aa6('0x8')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xa')]);router[_0x4aa6('0x8')](_0x4aa6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4aa6('0x8')](_0x4aa6('0xc'),auth['isAuthenticated'](),controller[_0x4aa6('0xd')]);router['get'](_0x4aa6('0xe'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xf')]);router[_0x4aa6('0x8')]('/:id/teams',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x10')]);router[_0x4aa6('0x8')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x12')]);router[_0x4aa6('0x13')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x14')]);router[_0x4aa6('0x13')]('/:id/teams',auth[_0x4aa6('0x9')](),controller['addTeams']);router['post'](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x15')]);router[_0x4aa6('0x16')](_0x4aa6('0xc'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x17')]);router[_0x4aa6('0x18')]('/:id',auth[_0x4aa6('0x9')](),controller['destroy']);router[_0x4aa6('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4aa6('0x19')]);router[_0x4aa6('0x18')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x1a')]);module[_0x4aa6('0x1b')]=router; \ No newline at end of file +var _0xafc4=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','update','delete','destroy','removeTeams','removeAgents'];(function(_0xa3e07c,_0x479916){var _0x4f85e9=function(_0x2e2ac2){while(--_0x2e2ac2){_0xa3e07c['push'](_0xa3e07c['shift']());}};_0x4f85e9(++_0x479916);}(_0xafc4,0x69));var _0x4afc=function(_0x2bf2eb,_0x1aafeb){_0x2bf2eb=_0x2bf2eb-0x0;var _0x660889=_0xafc4[_0x2bf2eb];return _0x660889;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0x6')](_0x4afc('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x4afc('0x6')]('/:id/teams',auth[_0x4afc('0x7')](),controller[_0x4afc('0xd')]);router['get'](_0x4afc('0xe'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xf')]);router[_0x4afc('0x10')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x11')]);router[_0x4afc('0x10')](_0x4afc('0x12'),auth['isAuthenticated'](),controller[_0x4afc('0x13')]);router[_0x4afc('0x10')](_0x4afc('0xe'),auth[_0x4afc('0x7')](),controller['addAgents']);router['put'](_0x4afc('0xa'),auth['isAuthenticated'](),controller[_0x4afc('0x14')]);router[_0x4afc('0x15')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0x16')]);router[_0x4afc('0x15')](_0x4afc('0x12'),auth[_0x4afc('0x7')](),controller[_0x4afc('0x17')]);router[_0x4afc('0x15')](_0x4afc('0xe'),auth['isAuthenticated'](),controller[_0x4afc('0x18')]);module[_0x4afc('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 63f5a34..e181ae4 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 _0xc43b=['sequelize','exports','DATE','moment'];(function(_0x3c2961,_0x18cd8b){var _0x1379a6=function(_0x3e83af){while(--_0x3e83af){_0x3c2961['push'](_0x3c2961['shift']());}};_0x1379a6(++_0x18cd8b);}(_0xc43b,0x1e3));var _0xbc43=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xc43b[_0x1b6186];return _0x186121;};'use strict';var moment=require(_0xbc43('0x0'));var Sequelize=require(_0xbc43('0x1'));module[_0xbc43('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbc43('0x3')]},'leaveAt':{'type':Sequelize[_0xbc43('0x3')]},'acceptAt':{'type':Sequelize[_0xbc43('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa393=['exports','STRING','DATE','moment'];(function(_0x19d7c6,_0x1b9530){var _0x475431=function(_0x32289d){while(--_0x32289d){_0x19d7c6['push'](_0x19d7c6['shift']());}};_0x475431(++_0x1b9530);}(_0xa393,0x1c3));var _0x3a39=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xa393[_0x11ce46];return _0x368a1e;};'use strict';var moment=require(_0x3a39('0x0'));var Sequelize=require('sequelize');module[_0x3a39('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3a39('0x2')]},'joinAt':{'type':Sequelize[_0x3a39('0x3')]},'leaveAt':{'type':Sequelize[_0x3a39('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3a39('0x3')]},'reason':{'type':Sequelize[_0x3a39('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 6738b47..d50e0f9 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 _0x2ceb=['destroy','then','sendStatus','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update'];(function(_0x396b95,_0x58082b){var _0x38b7a7=function(_0x57464a){while(--_0x57464a){_0x396b95['push'](_0x396b95['shift']());}};_0x38b7a7(++_0x58082b);}(_0x2ceb,0x110));var _0xb2ce=function(_0x48de80,_0xf98a95){_0x48de80=_0x48de80-0x0;var _0x54f9f2=_0x2ceb[_0x48de80];return _0x54f9f2;};'use strict';var emlformat=require(_0xb2ce('0x0'));var rimraf=require(_0xb2ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2ce('0x2'));var rp=require(_0xb2ce('0x3'));var moment=require(_0xb2ce('0x4'));var BPromise=require(_0xb2ce('0x5'));var Mustache=require(_0xb2ce('0x6'));var util=require(_0xb2ce('0x7'));var path=require('path');var sox=require(_0xb2ce('0x8'));var csv=require(_0xb2ce('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2ce('0xa'));var _=require(_0xb2ce('0xb'));var squel=require('squel');var crypto=require(_0xb2ce('0xc'));var jsforce=require(_0xb2ce('0xd'));var deskjs=require(_0xb2ce('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb2ce('0xf'));var Redis=require(_0xb2ce('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb2ce('0x11'));var as=require(_0xb2ce('0x12'));var hardwareService=require(_0xb2ce('0x13'));var logger=require(_0xb2ce('0x14'))(_0xb2ce('0x15'));var utils=require(_0xb2ce('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb2ce('0x17'));var db=require(_0xb2ce('0x18'))['db'];function respondWithStatusCode(_0x20054d,_0x2bad3c){_0x2bad3c=_0x2bad3c||0xcc;return function(_0x28c1de){if(_0x28c1de){return _0x20054d['sendStatus'](_0x2bad3c);}return _0x20054d['status'](_0x2bad3c)[_0xb2ce('0x19')]();};}function respondWithResult(_0x1b5b92,_0x16fb1c){_0x16fb1c=_0x16fb1c||0xc8;return function(_0x1cc91e){if(_0x1cc91e){return _0x1b5b92[_0xb2ce('0x1a')](_0x16fb1c)[_0xb2ce('0x1b')](_0x1cc91e);}};}function respondWithFilteredResult(_0x1b413a,_0x25a66b){return function(_0x994130){if(_0x994130){var _0x227fae=typeof _0x25a66b[_0xb2ce('0x1c')]===_0xb2ce('0x1d')&&typeof _0x25a66b[_0xb2ce('0x1e')]===_0xb2ce('0x1d');var _0x41f63a=_0x994130[_0xb2ce('0x1f')];var _0x2e0336=_0x227fae?0x0:_0x25a66b[_0xb2ce('0x1c')];var _0x2563f6=_0x227fae?_0x994130[_0xb2ce('0x1f')]:_0x25a66b[_0xb2ce('0x1c')]+_0x25a66b[_0xb2ce('0x1e')];var _0x3d7e7e;if(_0x2563f6>=_0x41f63a){_0x2563f6=_0x41f63a;_0x3d7e7e=0xc8;}else{_0x3d7e7e=0xce;}_0x1b413a[_0xb2ce('0x1a')](_0x3d7e7e);return _0x1b413a['set'](_0xb2ce('0x20'),_0x2e0336+'-'+_0x2563f6+'/'+_0x41f63a)[_0xb2ce('0x1b')](_0x994130);}return null;};}function patchUpdates(_0x4d3f52){return function(_0x1a4156){try{jsonpatch['apply'](_0x1a4156,_0x4d3f52,!![]);}catch(_0x53250e){return BPromise[_0xb2ce('0x21')](_0x53250e);}return _0x1a4156[_0xb2ce('0x22')]();};}function saveUpdates(_0x4575c2,_0x59d256){return function(_0x50ebc9){if(_0x50ebc9){return _0x50ebc9[_0xb2ce('0x23')](_0x4575c2)['then'](function(_0x1f8fd3){return _0x1f8fd3;});}return null;};}function removeEntity(_0x4feb6,_0x534806){return function(_0xfdbed0){if(_0xfdbed0){return _0xfdbed0[_0xb2ce('0x24')]()[_0xb2ce('0x25')](function(){_0x4feb6[_0xb2ce('0x1a')](0xcc)[_0xb2ce('0x19')]();});}};}function handleEntityNotFound(_0x4f547e,_0x31e541){return function(_0x5d7058){if(!_0x5d7058){_0x4f547e[_0xb2ce('0x26')](0x194);}return _0x5d7058;};}function handleError(_0x5590e6,_0x5894a8){_0x5894a8=_0x5894a8||0x1f4;return function(_0x367e18){logger[_0xb2ce('0x27')](_0x367e18[_0xb2ce('0x28')]);if(_0x367e18['name']){delete _0x367e18[_0xb2ce('0x29')];}_0x5590e6[_0xb2ce('0x1a')](_0x5894a8)['send'](_0x367e18);};}exports[_0xb2ce('0x2a')]=function(_0x415e62,_0x1d4918){var _0x49c448={},_0x1add93={},_0x36d8e9={'count':0x0,'rows':[]};var _0x121c76=_[_0xb2ce('0x2b')](db[_0xb2ce('0x2c')][_0xb2ce('0x2d')],function(_0x16dbfd){return{'name':_0x16dbfd[_0xb2ce('0x2e')],'type':_0x16dbfd[_0xb2ce('0x2f')][_0xb2ce('0x30')]};});_0x1add93[_0xb2ce('0x31')]=_[_0xb2ce('0x2b')](_0x121c76,'name');_0x1add93[_0xb2ce('0x32')]=_[_0xb2ce('0x33')](_0x415e62['query']);_0x1add93[_0xb2ce('0x34')]=_[_0xb2ce('0x35')](_0x1add93[_0xb2ce('0x31')],_0x1add93[_0xb2ce('0x32')]);_0x49c448['attributes']=_[_0xb2ce('0x35')](_0x1add93[_0xb2ce('0x31')],qs[_0xb2ce('0x36')](_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x36')]));_0x49c448[_0xb2ce('0x37')]=_0x49c448['attributes'][_0xb2ce('0x38')]?_0x49c448[_0xb2ce('0x37')]:_0x1add93[_0xb2ce('0x31')];if(!_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x39')](_0xb2ce('0x3a'))){_0x49c448['limit']=qs['limit'](_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x1e')]);_0x49c448[_0xb2ce('0x1c')]=qs[_0xb2ce('0x1c')](_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x1c')]);}_0x49c448[_0xb2ce('0x3b')]=qs[_0xb2ce('0x3c')](_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x3c')]);_0x49c448['where']=qs[_0xb2ce('0x34')](_[_0xb2ce('0x3d')](_0x415e62['query'],_0x1add93[_0xb2ce('0x34')]),_0x121c76);if(_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x3e')]){_0x49c448[_0xb2ce('0x3f')]=_[_0xb2ce('0x40')](_0x49c448[_0xb2ce('0x3f')],{'$or':_[_0xb2ce('0x2b')](_0x121c76,function(_0x18e380){if(_0x18e380[_0xb2ce('0x2f')]!=='VIRTUAL'){var _0x284d54={};_0x284d54[_0x18e380['name']]={'$like':'%'+_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x3e')]+'%'};return _0x284d54;}})});}_0x49c448=_[_0xb2ce('0x40')]({},_0x49c448,_0x415e62[_0xb2ce('0x41')]);var _0x35f050={'where':_0x49c448[_0xb2ce('0x3f')]};return db['FaxQueueReport'][_0xb2ce('0x1f')](_0x35f050)['then'](function(_0x1deaff){_0x36d8e9[_0xb2ce('0x1f')]=_0x1deaff;if(_0x415e62[_0xb2ce('0x32')][_0xb2ce('0x42')]){_0x49c448['include']=[{'all':!![]}];}return db[_0xb2ce('0x2c')][_0xb2ce('0x43')](_0x49c448);})['then'](function(_0x2a4673){_0x36d8e9[_0xb2ce('0x44')]=_0x2a4673;return _0x36d8e9;})['then'](respondWithFilteredResult(_0x1d4918,_0x49c448))[_0xb2ce('0x45')](handleError(_0x1d4918,null));};exports[_0xb2ce('0x46')]=function(_0x5d0db9,_0x27ce5b){var _0x1ad94c={'raw':!![],'where':{'id':_0x5d0db9[_0xb2ce('0x47')]['id']}},_0x1dc19b={};_0x1dc19b[_0xb2ce('0x31')]=_['keys'](db[_0xb2ce('0x2c')][_0xb2ce('0x2d')]);_0x1dc19b[_0xb2ce('0x32')]=_[_0xb2ce('0x33')](_0x5d0db9['query']);_0x1dc19b['filters']=_[_0xb2ce('0x35')](_0x1dc19b['model'],_0x1dc19b[_0xb2ce('0x32')]);_0x1ad94c['attributes']=_['intersection'](_0x1dc19b[_0xb2ce('0x31')],qs[_0xb2ce('0x36')](_0x5d0db9[_0xb2ce('0x32')][_0xb2ce('0x36')]));_0x1ad94c[_0xb2ce('0x37')]=_0x1ad94c[_0xb2ce('0x37')][_0xb2ce('0x38')]?_0x1ad94c[_0xb2ce('0x37')]:_0x1dc19b[_0xb2ce('0x31')];if(_0x5d0db9['query']['includeAll']){_0x1ad94c[_0xb2ce('0x48')]=[{'all':!![]}];}_0x1ad94c=_[_0xb2ce('0x40')]({},_0x1ad94c,_0x5d0db9['options']);return db['FaxQueueReport'][_0xb2ce('0x49')](_0x1ad94c)[_0xb2ce('0x25')](handleEntityNotFound(_0x27ce5b,null))[_0xb2ce('0x25')](respondWithResult(_0x27ce5b,null))[_0xb2ce('0x45')](handleError(_0x27ce5b,null));};exports[_0xb2ce('0x4a')]=function(_0x1784d4,_0x2e4d08){return db[_0xb2ce('0x2c')][_0xb2ce('0x4a')](_0x1784d4[_0xb2ce('0x4b')],{})[_0xb2ce('0x25')](respondWithResult(_0x2e4d08,0xc9))[_0xb2ce('0x45')](handleError(_0x2e4d08,null));};exports[_0xb2ce('0x23')]=function(_0x521e6e,_0x529ec0){if(_0x521e6e['body']['id']){delete _0x521e6e[_0xb2ce('0x4b')]['id'];}return db[_0xb2ce('0x2c')][_0xb2ce('0x49')]({'where':{'id':_0x521e6e[_0xb2ce('0x47')]['id']}})['then'](handleEntityNotFound(_0x529ec0,null))[_0xb2ce('0x25')](saveUpdates(_0x521e6e['body'],null))[_0xb2ce('0x25')](respondWithResult(_0x529ec0,null))[_0xb2ce('0x45')](handleError(_0x529ec0,null));};exports['destroy']=function(_0x568005,_0x1ecff5){return db['FaxQueueReport']['find']({'where':{'id':_0x568005['params']['id']}})[_0xb2ce('0x25')](handleEntityNotFound(_0x1ecff5,null))[_0xb2ce('0x25')](removeEntity(_0x1ecff5,null))['catch'](handleError(_0x1ecff5,null));};exports[_0xb2ce('0x4c')]=function(_0x20a11f,_0x1d38fa){return db[_0xb2ce('0x2c')]['describe']()[_0xb2ce('0x25')](respondWithResult(_0x1d38fa,null))[_0xb2ce('0x45')](handleError(_0x1d38fa,null));}; \ No newline at end of file +var _0x80c7=['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','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','fields','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2cd1c9,_0xed80d0){var _0x4ed5df=function(_0xe0f038){while(--_0xe0f038){_0x2cd1c9['push'](_0x2cd1c9['shift']());}};_0x4ed5df(++_0xed80d0);}(_0x80c7,0x8d));var _0x780c=function(_0x11323e,_0x2772d0){_0x11323e=_0x11323e-0x0;var _0x521145=_0x80c7[_0x11323e];return _0x521145;};'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(){_0x1d0c8a['status'](0xcc)[_0x780c('0x1d')]();});}};}function handleEntityNotFound(_0x121199,_0x38810b){return function(_0x27e326){if(!_0x27e326){_0x121199[_0x780c('0x1b')](0x194);}return _0x27e326;};}function handleError(_0x41a58b,_0x5d675c){_0x5d675c=_0x5d675c||0x1f4;return function(_0x1cb65e){logger[_0x780c('0x2a')](_0x1cb65e[_0x780c('0x2b')]);if(_0x1cb65e['name']){delete _0x1cb65e[_0x780c('0x2c')];}_0x41a58b[_0x780c('0x1c')](_0x5d675c)[_0x780c('0x2d')](_0x1cb65e);};}exports[_0x780c('0x2e')]=function(_0x26708b,_0x1819bf){var _0x37d6c8={},_0x35b97a={},_0x2a19b1={'count':0x0,'rows':[]};var _0x21f84e=_[_0x780c('0x2f')](db[_0x780c('0x30')][_0x780c('0x31')],function(_0x1216b4){return{'name':_0x1216b4['fieldName'],'type':_0x1216b4[_0x780c('0x32')][_0x780c('0x33')]};});_0x35b97a[_0x780c('0x34')]=_[_0x780c('0x2f')](_0x21f84e,_0x780c('0x2c'));_0x35b97a[_0x780c('0x35')]=_['keys'](_0x26708b[_0x780c('0x35')]);_0x35b97a[_0x780c('0x36')]=_[_0x780c('0x37')](_0x35b97a[_0x780c('0x34')],_0x35b97a['query']);_0x37d6c8['attributes']=_[_0x780c('0x37')](_0x35b97a[_0x780c('0x34')],qs['fields'](_0x26708b['query']['fields']));_0x37d6c8[_0x780c('0x38')]=_0x37d6c8[_0x780c('0x38')][_0x780c('0x39')]?_0x37d6c8['attributes']:_0x35b97a[_0x780c('0x34')];if(!_0x26708b['query']['hasOwnProperty'](_0x780c('0x3a'))){_0x37d6c8[_0x780c('0x20')]=qs[_0x780c('0x20')](_0x26708b[_0x780c('0x35')][_0x780c('0x20')]);_0x37d6c8[_0x780c('0x1e')]=qs['offset'](_0x26708b[_0x780c('0x35')][_0x780c('0x1e')]);}_0x37d6c8['order']=qs['sort'](_0x26708b[_0x780c('0x35')][_0x780c('0x3b')]);_0x37d6c8[_0x780c('0x3c')]=qs[_0x780c('0x36')](_[_0x780c('0x3d')](_0x26708b[_0x780c('0x35')],_0x35b97a[_0x780c('0x36')]),_0x21f84e);if(_0x26708b[_0x780c('0x35')][_0x780c('0x3e')]){_0x37d6c8[_0x780c('0x3c')]=_['merge'](_0x37d6c8[_0x780c('0x3c')],{'$or':_[_0x780c('0x2f')](_0x21f84e,function(_0x4c16b1){if(_0x4c16b1[_0x780c('0x32')]!==_0x780c('0x3f')){var _0x55ab16={};_0x55ab16[_0x4c16b1[_0x780c('0x2c')]]={'$like':'%'+_0x26708b['query'][_0x780c('0x3e')]+'%'};return _0x55ab16;}})});}_0x37d6c8=_[_0x780c('0x40')]({},_0x37d6c8,_0x26708b[_0x780c('0x41')]);var _0x5b2dfb={'where':_0x37d6c8['where']};return db[_0x780c('0x30')][_0x780c('0x21')](_0x5b2dfb)[_0x780c('0x28')](function(_0x71748b){_0x2a19b1[_0x780c('0x21')]=_0x71748b;if(_0x26708b[_0x780c('0x35')][_0x780c('0x42')]){_0x37d6c8[_0x780c('0x43')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x780c('0x44')](_0x37d6c8);})[_0x780c('0x28')](function(_0x5db660){_0x2a19b1[_0x780c('0x45')]=_0x5db660;return _0x2a19b1;})[_0x780c('0x28')](respondWithFilteredResult(_0x1819bf,_0x37d6c8))[_0x780c('0x46')](handleError(_0x1819bf,null));};exports['show']=function(_0x23cba0,_0x14a5d9){var _0x37d547={'raw':!![],'where':{'id':_0x23cba0['params']['id']}},_0x4be864={};_0x4be864[_0x780c('0x34')]=_[_0x780c('0x47')](db[_0x780c('0x30')][_0x780c('0x31')]);_0x4be864[_0x780c('0x35')]=_[_0x780c('0x47')](_0x23cba0[_0x780c('0x35')]);_0x4be864['filters']=_['intersection'](_0x4be864[_0x780c('0x34')],_0x4be864[_0x780c('0x35')]);_0x37d547[_0x780c('0x38')]=_[_0x780c('0x37')](_0x4be864[_0x780c('0x34')],qs[_0x780c('0x48')](_0x23cba0[_0x780c('0x35')][_0x780c('0x48')]));_0x37d547['attributes']=_0x37d547[_0x780c('0x38')][_0x780c('0x39')]?_0x37d547[_0x780c('0x38')]:_0x4be864['model'];if(_0x23cba0['query'][_0x780c('0x42')]){_0x37d547[_0x780c('0x43')]=[{'all':!![]}];}_0x37d547=_[_0x780c('0x40')]({},_0x37d547,_0x23cba0[_0x780c('0x41')]);return db[_0x780c('0x30')]['find'](_0x37d547)[_0x780c('0x28')](handleEntityNotFound(_0x14a5d9,null))[_0x780c('0x28')](respondWithResult(_0x14a5d9,null))['catch'](handleError(_0x14a5d9,null));};exports['create']=function(_0x412f72,_0x59be69){return db['FaxQueueReport']['create'](_0x412f72[_0x780c('0x49')],{})['then'](respondWithResult(_0x59be69,0xc9))[_0x780c('0x46')](handleError(_0x59be69,null));};exports['update']=function(_0x2deec6,_0x4eda4f){if(_0x2deec6[_0x780c('0x49')]['id']){delete _0x2deec6[_0x780c('0x49')]['id'];}return db[_0x780c('0x30')][_0x780c('0x4a')]({'where':{'id':_0x2deec6[_0x780c('0x4b')]['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x4eda4f,null))[_0x780c('0x28')](saveUpdates(_0x2deec6[_0x780c('0x49')],null))['then'](respondWithResult(_0x4eda4f,null))[_0x780c('0x46')](handleError(_0x4eda4f,null));};exports[_0x780c('0x29')]=function(_0x3bae2d,_0x4e780e){return db[_0x780c('0x30')][_0x780c('0x4a')]({'where':{'id':_0x3bae2d['params']['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x4e780e,null))[_0x780c('0x28')](removeEntity(_0x4e780e,null))[_0x780c('0x46')](handleError(_0x4e780e,null));};exports['describe']=function(_0x43f08b,_0x539358){return db[_0x780c('0x30')][_0x780c('0x4c')]()[_0x780c('0x28')](respondWithResult(_0x539358,null))['catch'](handleError(_0x539358,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b12b579..a2ed135 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16456c,_0x4018c1){var _0x503918=function(_0x2d3579){while(--_0x2d3579){_0x16456c['push'](_0x16456c['shift']());}};_0x503918(++_0x4018c1);}(_0x4975,0x86));var _0x5497=function(_0x256992,_0x4c1782){_0x256992=_0x256992-0x0;var _0x5612b0=_0x4975[_0x256992];return _0x5612b0;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3ba2d6,_0x4910cb){var _0x6f362a=function(_0x4ac813){while(--_0x4ac813){_0x3ba2d6['push'](_0x3ba2d6['shift']());}};_0x6f362a(++_0x4910cb);}(_0xabce,0x103));var _0xeabc=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xabce[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 004e1a5..6a100df 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 _0xd96d=['result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','then','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd96d,0x16c));var _0xdd96=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xd96d[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xdd96('0x0'));var util=require(_0xdd96('0x1'));var moment=require(_0xdd96('0x2'));var BPromise=require(_0xdd96('0x3'));var rs=require(_0xdd96('0x4'));var fs=require('fs');var Redis=require(_0xdd96('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd96('0x6'));var logger=require(_0xdd96('0x7'))('rpc');var config=require(_0xdd96('0x8'));var jayson=require(_0xdd96('0x9'));var client=jayson[_0xdd96('0xa')][_0xdd96('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e921d,_0x2b9c06,_0x257fe0){return new BPromise(function(_0x3d3768,_0x4a2492){return client[_0xdd96('0xc')](_0x3e921d,_0x257fe0)['then'](function(_0xca153){logger[_0xdd96('0xd')](_0xdd96('0xe'),_0x2b9c06,_0xdd96('0xf'));logger[_0xdd96('0x10')](_0xdd96('0x11'),_0x2b9c06,_0xdd96('0xf'),JSON[_0xdd96('0x12')](_0xca153));if(_0xca153[_0xdd96('0x13')]){if(_0xca153[_0xdd96('0x13')]['code']===0x1f4){logger[_0xdd96('0x13')](_0xdd96('0xe'),_0x2b9c06,_0xca153[_0xdd96('0x13')][_0xdd96('0x14')]);return _0x4a2492(_0xca153[_0xdd96('0x13')][_0xdd96('0x14')]);}logger[_0xdd96('0x13')](_0xdd96('0xe'),_0x2b9c06,_0xca153['error']['message']);return _0x3d3768(_0xca153[_0xdd96('0x13')][_0xdd96('0x14')]);}else{logger[_0xdd96('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2b9c06,'request\x20sent');_0x3d3768(_0xca153[_0xdd96('0x15')][_0xdd96('0x14')]);}})[_0xdd96('0x16')](function(_0x248916){logger['error'](_0xdd96('0xe'),_0x2b9c06,_0x248916);_0x4a2492(_0x248916);});});}exports[_0xdd96('0x17')]=function(_0x229820){var _0x3e5a69=this;return new Promise(function(_0xf54a09,_0x3bd0d8){return db[_0xdd96('0x18')][_0xdd96('0x19')](_0x229820[_0xdd96('0x1a')],{'raw':_0x229820[_0xdd96('0x1b')]?_0x229820[_0xdd96('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xdd96('0x1c')](function(_0x58f6ef){logger[_0xdd96('0xd')]('CreateFaxQueueReport',_0x229820);logger['debug'](_0xdd96('0x17'),_0x229820,JSON[_0xdd96('0x12')](_0x58f6ef));_0xf54a09(_0x58f6ef);})[_0xdd96('0x16')](function(_0x397d64){logger[_0xdd96('0x13')]('CreateFaxQueueReport',_0x397d64[_0xdd96('0x14')],_0x229820);_0x3bd0d8(_0x3e5a69[_0xdd96('0x13')](0x1f4,_0x397d64[_0xdd96('0x14')]));});});};exports[_0xdd96('0x1d')]=function(_0x4db789){var _0x227836=this;return new Promise(function(_0x3823a0,_0x4ea6f9){return db['FaxQueueReport'][_0xdd96('0x1e')](_0x4db789[_0xdd96('0x1a')],{'raw':_0x4db789[_0xdd96('0x1b')]?_0x4db789[_0xdd96('0x1b')][_0xdd96('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db789[_0xdd96('0x1b')]?_0x4db789[_0xdd96('0x1b')][_0xdd96('0x20')]||null:null,'attributes':_0x4db789[_0xdd96('0x1b')]?_0x4db789['options'][_0xdd96('0x21')]||null:null,'limit':_0x4db789[_0xdd96('0x1b')]?_0x4db789['options'][_0xdd96('0x22')]||null:null})['then'](function(_0x1904ee){logger[_0xdd96('0xd')]('UpdateFaxQueueReport',_0x4db789);logger[_0xdd96('0x10')](_0xdd96('0x1d'),_0x4db789,JSON[_0xdd96('0x12')](_0x1904ee));_0x3823a0(_0x1904ee);})[_0xdd96('0x16')](function(_0x172aef){logger[_0xdd96('0x13')](_0xdd96('0x1d'),_0x172aef['message'],_0x4db789);_0x4ea6f9(_0x227836['error'](0x1f4,_0x172aef[_0xdd96('0x14')]));});});}; \ No newline at end of file +var _0x3788=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','update','where','attributes','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1ce4e0,_0x3b2428){var _0xd1a086=function(_0x23d940){while(--_0x23d940){_0x1ce4e0['push'](_0x1ce4e0['shift']());}};_0xd1a086(++_0x3b2428);}(_0x3788,0xd8));var _0x8378=function(_0x218b67,_0x643e13){_0x218b67=_0x218b67-0x0;var _0x102dd5=_0x3788[_0x218b67];return _0x102dd5;};'use strict';var _=require(_0x8378('0x0'));var util=require(_0x8378('0x1'));var moment=require('moment');var BPromise=require(_0x8378('0x2'));var rs=require(_0x8378('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8378('0x4'))['db'];var utils=require(_0x8378('0x5'));var logger=require(_0x8378('0x6'))(_0x8378('0x7'));var config=require('../../config/environment');var jayson=require(_0x8378('0x8'));var client=jayson[_0x8378('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e3ad5,_0x1cc4f2,_0x2e45bb){return new BPromise(function(_0xaaabfd,_0x2ff46f){return client[_0x8378('0xa')](_0x1e3ad5,_0x2e45bb)[_0x8378('0xb')](function(_0x5df56b){logger[_0x8378('0xc')](_0x8378('0xd'),_0x1cc4f2,_0x8378('0xe'));logger[_0x8378('0xf')](_0x8378('0x10'),_0x1cc4f2,_0x8378('0xe'),JSON[_0x8378('0x11')](_0x5df56b));if(_0x5df56b['error']){if(_0x5df56b[_0x8378('0x12')][_0x8378('0x13')]===0x1f4){logger[_0x8378('0x12')](_0x8378('0xd'),_0x1cc4f2,_0x5df56b['error'][_0x8378('0x14')]);return _0x2ff46f(_0x5df56b['error']['message']);}logger[_0x8378('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x1cc4f2,_0x5df56b[_0x8378('0x12')]['message']);return _0xaaabfd(_0x5df56b[_0x8378('0x12')]['message']);}else{logger[_0x8378('0xc')](_0x8378('0xd'),_0x1cc4f2,_0x8378('0xe'));_0xaaabfd(_0x5df56b[_0x8378('0x15')][_0x8378('0x14')]);}})[_0x8378('0x16')](function(_0x3503a7){logger[_0x8378('0x12')](_0x8378('0xd'),_0x1cc4f2,_0x3503a7);_0x2ff46f(_0x3503a7);});});}exports['CreateFaxQueueReport']=function(_0x3dc960){var _0x54ba01=this;return new Promise(function(_0x156322,_0x26fe4c){return db[_0x8378('0x17')][_0x8378('0x18')](_0x3dc960[_0x8378('0x19')],{'raw':_0x3dc960[_0x8378('0x1a')]?_0x3dc960['options'][_0x8378('0x1b')]===undefined?!![]:![]:!![]})[_0x8378('0xb')](function(_0x37a553){logger[_0x8378('0xc')]('CreateFaxQueueReport',_0x3dc960);logger[_0x8378('0xf')](_0x8378('0x1c'),_0x3dc960,JSON[_0x8378('0x11')](_0x37a553));_0x156322(_0x37a553);})[_0x8378('0x16')](function(_0x52e081){logger[_0x8378('0x12')](_0x8378('0x1c'),_0x52e081[_0x8378('0x14')],_0x3dc960);_0x26fe4c(_0x54ba01['error'](0x1f4,_0x52e081['message']));});});};exports['UpdateFaxQueueReport']=function(_0x33fb8f){var _0x597fc3=this;return new Promise(function(_0xc78b5a,_0x124051){return db[_0x8378('0x17')][_0x8378('0x1d')](_0x33fb8f['body'],{'raw':_0x33fb8f[_0x8378('0x1a')]?_0x33fb8f[_0x8378('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33fb8f[_0x8378('0x1a')]?_0x33fb8f[_0x8378('0x1a')][_0x8378('0x1e')]||null:null,'attributes':_0x33fb8f['options']?_0x33fb8f[_0x8378('0x1a')][_0x8378('0x1f')]||null:null,'limit':_0x33fb8f[_0x8378('0x1a')]?_0x33fb8f[_0x8378('0x1a')]['limit']||null:null})[_0x8378('0xb')](function(_0xc7fbed){logger[_0x8378('0xc')](_0x8378('0x20'),_0x33fb8f);logger[_0x8378('0xf')](_0x8378('0x20'),_0x33fb8f,JSON[_0x8378('0x11')](_0xc7fbed));_0xc78b5a(_0xc7fbed);})[_0x8378('0x16')](function(_0x45d932){logger['error'](_0x8378('0x20'),_0x45d932[_0x8378('0x14')],_0x33fb8f);_0x124051(_0x597fc3[_0x8378('0x12')](0x1f4,_0x45d932[_0x8378('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ffb3956..3fe7299 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 _0x7d27=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2a4d76,_0x57a9f1){var _0x8c1e17=function(_0x35c703){while(--_0x35c703){_0x2a4d76['push'](_0x2a4d76['shift']());}};_0x8c1e17(++_0x57a9f1);}(_0x7d27,0x139));var _0x77d2=function(_0x4a4a32,_0x2ba798){_0x4a4a32=_0x4a4a32-0x0;var _0x154d37=_0x7d27[_0x4a4a32];return _0x154d37;};'use strict';var multer=require(_0x77d2('0x0'));var util=require(_0x77d2('0x1'));var path=require(_0x77d2('0x2'));var timeout=require('connect-timeout');var express=require(_0x77d2('0x3'));var router=express[_0x77d2('0x4')]();var fs_extra=require(_0x77d2('0x5'));var auth=require(_0x77d2('0x6'));var interaction=require(_0x77d2('0x7'));var config=require('../../config/environment');var controller=require(_0x77d2('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x77d2('0x9')]);router['get'](_0x77d2('0xa'),auth[_0x77d2('0xb')](),controller[_0x77d2('0xc')]);router['get'](_0x77d2('0xd'),auth[_0x77d2('0xb')](),controller['show']);router[_0x77d2('0xe')]('/',auth[_0x77d2('0xb')](),controller[_0x77d2('0xf')]);router[_0x77d2('0x10')](_0x77d2('0xd'),auth['isAuthenticated'](),controller[_0x77d2('0x11')]);router[_0x77d2('0x12')]('/:id',auth[_0x77d2('0xb')](),controller[_0x77d2('0x13')]);module[_0x77d2('0x14')]=router; \ No newline at end of file +var _0x0291=['express','./faxQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x200fb6,_0x533d95){var _0x38a14c=function(_0x5336d1){while(--_0x5336d1){_0x200fb6['push'](_0x200fb6['shift']());}};_0x38a14c(++_0x533d95);}(_0x0291,0x11d));var _0x1029=function(_0x487e88,_0x57c1ab){_0x487e88=_0x487e88-0x0;var _0x12c276=_0x0291[_0x487e88];return _0x12c276;};'use strict';var multer=require(_0x1029('0x0'));var util=require(_0x1029('0x1'));var path=require(_0x1029('0x2'));var timeout=require('connect-timeout');var express=require(_0x1029('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1029('0x4'));router[_0x1029('0x5')]('/',auth[_0x1029('0x6')](),controller['index']);router['get'](_0x1029('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x1029('0x5')](_0x1029('0x8'),auth[_0x1029('0x6')](),controller[_0x1029('0x9')]);router[_0x1029('0xa')]('/',auth[_0x1029('0x6')](),controller[_0x1029('0xb')]);router['put'](_0x1029('0x8'),auth[_0x1029('0x6')](),controller[_0x1029('0xc')]);router[_0x1029('0xd')]('/:id',auth[_0x1029('0x6')](),controller[_0x1029('0xe')]);module[_0x1029('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4e43466..4c99740 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x54ef,0x112));var _0xf54e=function(_0x32f517,_0x3fc0b0){_0x32f517=_0x32f517-0x0;var _0xb380e9=_0x54ef[_0x32f517];return _0xb380e9;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x31ee0d,_0x5865b3){var _0x2dc36f=function(_0x208752){while(--_0x208752){_0x31ee0d['push'](_0x31ee0d['shift']());}};_0x2dc36f(++_0x5865b3);}(_0x70e0,0x17b));var _0x070e=function(_0x1c0bca,_0x585b7e){_0x1c0bca=_0x1c0bca-0x0;var _0x21b9f4=_0x70e0[_0x1c0bca];return _0x21b9f4;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 487e459..35b641d 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 _0xbbdf=['map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','findAll','catch','show','params','includeAll','include','merge','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','index'];(function(_0x415f42,_0x4cb715){var _0x41e016=function(_0x5ac784){while(--_0x5ac784){_0x415f42['push'](_0x415f42['shift']());}};_0x41e016(++_0x4cb715);}(_0xbbdf,0xb4));var _0xfbbd=function(_0x69f883,_0x5c785d){_0x69f883=_0x69f883-0x0;var _0x5472ee=_0xbbdf[_0x69f883];return _0x5472ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbbd('0x0'));var jsonpatch=require(_0xfbbd('0x1'));var rp=require(_0xfbbd('0x2'));var moment=require(_0xfbbd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfbbd('0x4'));var util=require(_0xfbbd('0x5'));var path=require('path');var sox=require(_0xfbbd('0x6'));var csv=require(_0xfbbd('0x7'));var ejs=require(_0xfbbd('0x8'));var fs=require('fs');var fs_extra=require(_0xfbbd('0x9'));var _=require(_0xfbbd('0xa'));var squel=require('squel');var crypto=require(_0xfbbd('0xb'));var jsforce=require(_0xfbbd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfbbd('0xd'));var Papa=require(_0xfbbd('0xe'));var Redis=require(_0xfbbd('0xf'));var authService=require(_0xfbbd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfbbd('0x11'));var hardwareService=require(_0xfbbd('0x12'));var logger=require('../../config/logger')(_0xfbbd('0x13'));var utils=require(_0xfbbd('0x14'));var config=require(_0xfbbd('0x15'));var licenseUtil=require(_0xfbbd('0x16'));var db=require(_0xfbbd('0x17'))['db'];function respondWithStatusCode(_0x37e39e,_0x54dc37){_0x54dc37=_0x54dc37||0xcc;return function(_0xc86254){if(_0xc86254){return _0x37e39e[_0xfbbd('0x18')](_0x54dc37);}return _0x37e39e[_0xfbbd('0x19')](_0x54dc37)['end']();};}function respondWithResult(_0x4b2d2d,_0x454705){_0x454705=_0x454705||0xc8;return function(_0x25c49b){if(_0x25c49b){return _0x4b2d2d[_0xfbbd('0x19')](_0x454705)['json'](_0x25c49b);}};}function respondWithFilteredResult(_0x3fefbd,_0x4c71c0){return function(_0x1e2571){if(_0x1e2571){var _0x2cf388=typeof _0x4c71c0[_0xfbbd('0x1a')]===_0xfbbd('0x1b')&&typeof _0x4c71c0[_0xfbbd('0x1c')]===_0xfbbd('0x1b');var _0xfaceca=_0x1e2571[_0xfbbd('0x1d')];var _0x3502d1=_0x2cf388?0x0:_0x4c71c0[_0xfbbd('0x1a')];var _0x2e266c=_0x2cf388?_0x1e2571[_0xfbbd('0x1d')]:_0x4c71c0[_0xfbbd('0x1a')]+_0x4c71c0[_0xfbbd('0x1c')];var _0x5daa59;if(_0x2e266c>=_0xfaceca){_0x2e266c=_0xfaceca;_0x5daa59=0xc8;}else{_0x5daa59=0xce;}_0x3fefbd[_0xfbbd('0x19')](_0x5daa59);return _0x3fefbd[_0xfbbd('0x1e')](_0xfbbd('0x1f'),_0x3502d1+'-'+_0x2e266c+'/'+_0xfaceca)[_0xfbbd('0x20')](_0x1e2571);}return null;};}function patchUpdates(_0x15816e){return function(_0x4314e2){try{jsonpatch[_0xfbbd('0x21')](_0x4314e2,_0x15816e,!![]);}catch(_0x5b6563){return BPromise[_0xfbbd('0x22')](_0x5b6563);}return _0x4314e2['save']();};}function saveUpdates(_0x172111,_0xf1fb4c){return function(_0x298cf7){if(_0x298cf7){return _0x298cf7[_0xfbbd('0x23')](_0x172111)[_0xfbbd('0x24')](function(_0x498f57){return _0x498f57;});}return null;};}function removeEntity(_0x12e685,_0x4cea9a){return function(_0x1bb29f){if(_0x1bb29f){return _0x1bb29f[_0xfbbd('0x25')]()[_0xfbbd('0x24')](function(){_0x12e685[_0xfbbd('0x19')](0xcc)[_0xfbbd('0x26')]();});}};}function handleEntityNotFound(_0x1f4726,_0x32edf9){return function(_0x2b6637){if(!_0x2b6637){_0x1f4726['sendStatus'](0x194);}return _0x2b6637;};}function handleError(_0x3a433c,_0x5a1ffa){_0x5a1ffa=_0x5a1ffa||0x1f4;return function(_0x5ec599){logger[_0xfbbd('0x27')](_0x5ec599['stack']);if(_0x5ec599[_0xfbbd('0x28')]){delete _0x5ec599[_0xfbbd('0x28')];}_0x3a433c[_0xfbbd('0x19')](_0x5a1ffa)['send'](_0x5ec599);};}exports[_0xfbbd('0x29')]=function(_0x26c666,_0x407fe9){var _0x167caa={},_0x339d81={},_0x421ce4={'count':0x0,'rows':[]};var _0x25ca78=_[_0xfbbd('0x2a')](db[_0xfbbd('0x2b')][_0xfbbd('0x2c')],function(_0x111230){return{'name':_0x111230[_0xfbbd('0x2d')],'type':_0x111230[_0xfbbd('0x2e')][_0xfbbd('0x2f')]};});_0x339d81[_0xfbbd('0x30')]=_[_0xfbbd('0x2a')](_0x25ca78,_0xfbbd('0x28'));_0x339d81[_0xfbbd('0x31')]=_[_0xfbbd('0x32')](_0x26c666[_0xfbbd('0x31')]);_0x339d81[_0xfbbd('0x33')]=_['intersection'](_0x339d81[_0xfbbd('0x30')],_0x339d81['query']);_0x167caa[_0xfbbd('0x34')]=_[_0xfbbd('0x35')](_0x339d81[_0xfbbd('0x30')],qs['fields'](_0x26c666['query'][_0xfbbd('0x36')]));_0x167caa[_0xfbbd('0x34')]=_0x167caa[_0xfbbd('0x34')]['length']?_0x167caa[_0xfbbd('0x34')]:_0x339d81[_0xfbbd('0x30')];if(!_0x26c666[_0xfbbd('0x31')][_0xfbbd('0x37')](_0xfbbd('0x38'))){_0x167caa[_0xfbbd('0x1c')]=qs['limit'](_0x26c666['query']['limit']);_0x167caa[_0xfbbd('0x1a')]=qs['offset'](_0x26c666['query'][_0xfbbd('0x1a')]);}_0x167caa[_0xfbbd('0x39')]=qs[_0xfbbd('0x3a')](_0x26c666[_0xfbbd('0x31')][_0xfbbd('0x3a')]);_0x167caa[_0xfbbd('0x3b')]=qs[_0xfbbd('0x33')](_['pick'](_0x26c666[_0xfbbd('0x31')],_0x339d81[_0xfbbd('0x33')]),_0x25ca78);if(_0x26c666[_0xfbbd('0x31')][_0xfbbd('0x3c')]){_0x167caa['where']=_['merge'](_0x167caa[_0xfbbd('0x3b')],{'$or':_[_0xfbbd('0x2a')](_0x25ca78,function(_0x59a9eb){if(_0x59a9eb[_0xfbbd('0x2e')]!==_0xfbbd('0x3d')){var _0x2061fa={};_0x2061fa[_0x59a9eb[_0xfbbd('0x28')]]={'$like':'%'+_0x26c666[_0xfbbd('0x31')]['filter']+'%'};return _0x2061fa;}})});}_0x167caa=_['merge']({},_0x167caa,_0x26c666['options']);var _0x284bf4={'where':_0x167caa[_0xfbbd('0x3b')]};return db[_0xfbbd('0x2b')][_0xfbbd('0x1d')](_0x284bf4)['then'](function(_0x1563ba){_0x421ce4[_0xfbbd('0x1d')]=_0x1563ba;if(_0x26c666[_0xfbbd('0x31')]['includeAll']){_0x167caa['include']=[{'all':!![]}];}return db[_0xfbbd('0x2b')][_0xfbbd('0x3e')](_0x167caa);})[_0xfbbd('0x24')](function(_0x57522a){_0x421ce4['rows']=_0x57522a;return _0x421ce4;})[_0xfbbd('0x24')](respondWithFilteredResult(_0x407fe9,_0x167caa))[_0xfbbd('0x3f')](handleError(_0x407fe9,null));};exports[_0xfbbd('0x40')]=function(_0x4ed2f9,_0x283534){var _0x305b2a={'raw':!![],'where':{'id':_0x4ed2f9[_0xfbbd('0x41')]['id']}},_0x5e437b={};_0x5e437b['model']=_[_0xfbbd('0x32')](db[_0xfbbd('0x2b')][_0xfbbd('0x2c')]);_0x5e437b['query']=_[_0xfbbd('0x32')](_0x4ed2f9['query']);_0x5e437b['filters']=_[_0xfbbd('0x35')](_0x5e437b[_0xfbbd('0x30')],_0x5e437b[_0xfbbd('0x31')]);_0x305b2a[_0xfbbd('0x34')]=_[_0xfbbd('0x35')](_0x5e437b[_0xfbbd('0x30')],qs[_0xfbbd('0x36')](_0x4ed2f9[_0xfbbd('0x31')][_0xfbbd('0x36')]));_0x305b2a[_0xfbbd('0x34')]=_0x305b2a[_0xfbbd('0x34')]['length']?_0x305b2a['attributes']:_0x5e437b[_0xfbbd('0x30')];if(_0x4ed2f9[_0xfbbd('0x31')][_0xfbbd('0x42')]){_0x305b2a[_0xfbbd('0x43')]=[{'all':!![]}];}_0x305b2a=_[_0xfbbd('0x44')]({},_0x305b2a,_0x4ed2f9[_0xfbbd('0x45')]);return db[_0xfbbd('0x2b')][_0xfbbd('0x46')](_0x305b2a)[_0xfbbd('0x24')](handleEntityNotFound(_0x283534,null))[_0xfbbd('0x24')](respondWithResult(_0x283534,null))[_0xfbbd('0x3f')](handleError(_0x283534,null));};exports['create']=function(_0x4cfec7,_0x30fa45){return db[_0xfbbd('0x2b')][_0xfbbd('0x47')](_0x4cfec7['body'],{})[_0xfbbd('0x24')](respondWithResult(_0x30fa45,0xc9))['catch'](handleError(_0x30fa45,null));};exports[_0xfbbd('0x23')]=function(_0x131bca,_0x2445aa){if(_0x131bca[_0xfbbd('0x48')]['id']){delete _0x131bca[_0xfbbd('0x48')]['id'];}return db['FaxTransferReport'][_0xfbbd('0x46')]({'where':{'id':_0x131bca[_0xfbbd('0x41')]['id']}})[_0xfbbd('0x24')](handleEntityNotFound(_0x2445aa,null))['then'](saveUpdates(_0x131bca[_0xfbbd('0x48')],null))[_0xfbbd('0x24')](respondWithResult(_0x2445aa,null))[_0xfbbd('0x3f')](handleError(_0x2445aa,null));};exports[_0xfbbd('0x25')]=function(_0x1229a9,_0x5682a3){return db['FaxTransferReport']['find']({'where':{'id':_0x1229a9[_0xfbbd('0x41')]['id']}})[_0xfbbd('0x24')](handleEntityNotFound(_0x5682a3,null))[_0xfbbd('0x24')](removeEntity(_0x5682a3,null))[_0xfbbd('0x3f')](handleError(_0x5682a3,null));};exports[_0xfbbd('0x49')]=function(_0x5a7b39,_0x25c5f1){return db[_0xfbbd('0x2b')]['describe']()[_0xfbbd('0x24')](respondWithResult(_0x25c5f1,null))[_0xfbbd('0x3f')](handleError(_0x25c5f1,null));}; \ No newline at end of file +var _0x4851=['undefined','limit','count','offset','Content-Range','apply','reject','save','update','error','stack','name','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x116dc4,_0x30994c){var _0x2619f3=function(_0x497152){while(--_0x497152){_0x116dc4['push'](_0x116dc4['shift']());}};_0x2619f3(++_0x30994c);}(_0x4851,0xc2));var _0x1485=function(_0x19f4a4,_0x50396f){_0x19f4a4=_0x19f4a4-0x0;var _0x4c1ca5=_0x4851[_0x19f4a4];return _0x4c1ca5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1485('0x0'));var zipdir=require(_0x1485('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1485('0x2'));var moment=require('moment');var BPromise=require(_0x1485('0x3'));var Mustache=require(_0x1485('0x4'));var util=require(_0x1485('0x5'));var path=require(_0x1485('0x6'));var sox=require(_0x1485('0x7'));var csv=require(_0x1485('0x8'));var ejs=require(_0x1485('0x9'));var fs=require('fs');var fs_extra=require(_0x1485('0xa'));var _=require(_0x1485('0xb'));var squel=require('squel');var crypto=require(_0x1485('0xc'));var jsforce=require(_0x1485('0xd'));var deskjs=require(_0x1485('0xe'));var toCsv=require(_0x1485('0x8'));var querystring=require('querystring');var Papa=require(_0x1485('0xf'));var Redis=require(_0x1485('0x10'));var authService=require(_0x1485('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1485('0x12'));var hardwareService=require(_0x1485('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1485('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1485('0x15'))['db'];function respondWithStatusCode(_0x41abbd,_0x538b12){_0x538b12=_0x538b12||0xcc;return function(_0x124fb6){if(_0x124fb6){return _0x41abbd[_0x1485('0x16')](_0x538b12);}return _0x41abbd[_0x1485('0x17')](_0x538b12)['end']();};}function respondWithResult(_0x523ecd,_0x28eda4){_0x28eda4=_0x28eda4||0xc8;return function(_0x5a30db){if(_0x5a30db){return _0x523ecd[_0x1485('0x17')](_0x28eda4)[_0x1485('0x18')](_0x5a30db);}};}function respondWithFilteredResult(_0x137447,_0x242bad){return function(_0x129586){if(_0x129586){var _0x15d7f5=typeof _0x242bad['offset']===_0x1485('0x19')&&typeof _0x242bad[_0x1485('0x1a')]===_0x1485('0x19');var _0x678855=_0x129586[_0x1485('0x1b')];var _0x449cbf=_0x15d7f5?0x0:_0x242bad[_0x1485('0x1c')];var _0xdf04b7=_0x15d7f5?_0x129586[_0x1485('0x1b')]:_0x242bad[_0x1485('0x1c')]+_0x242bad[_0x1485('0x1a')];var _0xb1e289;if(_0xdf04b7>=_0x678855){_0xdf04b7=_0x678855;_0xb1e289=0xc8;}else{_0xb1e289=0xce;}_0x137447['status'](_0xb1e289);return _0x137447['set'](_0x1485('0x1d'),_0x449cbf+'-'+_0xdf04b7+'/'+_0x678855)['json'](_0x129586);}return null;};}function patchUpdates(_0xf2992c){return function(_0x143a3a){try{jsonpatch[_0x1485('0x1e')](_0x143a3a,_0xf2992c,!![]);}catch(_0x4d9440){return BPromise[_0x1485('0x1f')](_0x4d9440);}return _0x143a3a[_0x1485('0x20')]();};}function saveUpdates(_0x29fcd9,_0x23799b){return function(_0x49f75a){if(_0x49f75a){return _0x49f75a[_0x1485('0x21')](_0x29fcd9)['then'](function(_0x5cee08){return _0x5cee08;});}return null;};}function removeEntity(_0x56638b,_0x3576d5){return function(_0x4c6e3c){if(_0x4c6e3c){return _0x4c6e3c['destroy']()['then'](function(){_0x56638b[_0x1485('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1450f2,_0x268261){return function(_0x49820f){if(!_0x49820f){_0x1450f2[_0x1485('0x16')](0x194);}return _0x49820f;};}function handleError(_0x58d2ad,_0x3cd0fa){_0x3cd0fa=_0x3cd0fa||0x1f4;return function(_0x164c35){logger[_0x1485('0x22')](_0x164c35[_0x1485('0x23')]);if(_0x164c35[_0x1485('0x24')]){delete _0x164c35[_0x1485('0x24')];}_0x58d2ad[_0x1485('0x17')](_0x3cd0fa)['send'](_0x164c35);};}exports['index']=function(_0x46dc54,_0x56b37b){var _0x42bc59={},_0x1ac38f={},_0xf8a2b={'count':0x0,'rows':[]};var _0x24f9a8=_['map'](db[_0x1485('0x25')][_0x1485('0x26')],function(_0x4fd24a){return{'name':_0x4fd24a[_0x1485('0x27')],'type':_0x4fd24a[_0x1485('0x28')][_0x1485('0x29')]};});_0x1ac38f[_0x1485('0x2a')]=_['map'](_0x24f9a8,_0x1485('0x24'));_0x1ac38f[_0x1485('0x2b')]=_[_0x1485('0x2c')](_0x46dc54[_0x1485('0x2b')]);_0x1ac38f[_0x1485('0x2d')]=_[_0x1485('0x2e')](_0x1ac38f[_0x1485('0x2a')],_0x1ac38f[_0x1485('0x2b')]);_0x42bc59[_0x1485('0x2f')]=_[_0x1485('0x2e')](_0x1ac38f[_0x1485('0x2a')],qs[_0x1485('0x30')](_0x46dc54[_0x1485('0x2b')]['fields']));_0x42bc59[_0x1485('0x2f')]=_0x42bc59[_0x1485('0x2f')][_0x1485('0x31')]?_0x42bc59[_0x1485('0x2f')]:_0x1ac38f['model'];if(!_0x46dc54[_0x1485('0x2b')]['hasOwnProperty'](_0x1485('0x32'))){_0x42bc59['limit']=qs[_0x1485('0x1a')](_0x46dc54['query'][_0x1485('0x1a')]);_0x42bc59['offset']=qs['offset'](_0x46dc54[_0x1485('0x2b')][_0x1485('0x1c')]);}_0x42bc59[_0x1485('0x33')]=qs[_0x1485('0x34')](_0x46dc54['query']['sort']);_0x42bc59['where']=qs[_0x1485('0x2d')](_[_0x1485('0x35')](_0x46dc54[_0x1485('0x2b')],_0x1ac38f[_0x1485('0x2d')]),_0x24f9a8);if(_0x46dc54[_0x1485('0x2b')][_0x1485('0x36')]){_0x42bc59[_0x1485('0x37')]=_['merge'](_0x42bc59['where'],{'$or':_[_0x1485('0x38')](_0x24f9a8,function(_0x1181f3){if(_0x1181f3[_0x1485('0x28')]!==_0x1485('0x39')){var _0x5479f0={};_0x5479f0[_0x1181f3[_0x1485('0x24')]]={'$like':'%'+_0x46dc54[_0x1485('0x2b')][_0x1485('0x36')]+'%'};return _0x5479f0;}})});}_0x42bc59=_[_0x1485('0x3a')]({},_0x42bc59,_0x46dc54[_0x1485('0x3b')]);var _0x6b16a4={'where':_0x42bc59[_0x1485('0x37')]};return db[_0x1485('0x25')]['count'](_0x6b16a4)[_0x1485('0x3c')](function(_0x341cf1){_0xf8a2b[_0x1485('0x1b')]=_0x341cf1;if(_0x46dc54[_0x1485('0x2b')][_0x1485('0x3d')]){_0x42bc59['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x1485('0x3e')](_0x42bc59);})[_0x1485('0x3c')](function(_0x4301f1){_0xf8a2b[_0x1485('0x3f')]=_0x4301f1;return _0xf8a2b;})[_0x1485('0x3c')](respondWithFilteredResult(_0x56b37b,_0x42bc59))[_0x1485('0x40')](handleError(_0x56b37b,null));};exports[_0x1485('0x41')]=function(_0x135c6a,_0xa55888){var _0x420eb8={'raw':!![],'where':{'id':_0x135c6a['params']['id']}},_0xa0e138={};_0xa0e138['model']=_[_0x1485('0x2c')](db[_0x1485('0x25')][_0x1485('0x26')]);_0xa0e138['query']=_[_0x1485('0x2c')](_0x135c6a[_0x1485('0x2b')]);_0xa0e138['filters']=_['intersection'](_0xa0e138[_0x1485('0x2a')],_0xa0e138[_0x1485('0x2b')]);_0x420eb8[_0x1485('0x2f')]=_[_0x1485('0x2e')](_0xa0e138[_0x1485('0x2a')],qs[_0x1485('0x30')](_0x135c6a[_0x1485('0x2b')][_0x1485('0x30')]));_0x420eb8[_0x1485('0x2f')]=_0x420eb8[_0x1485('0x2f')][_0x1485('0x31')]?_0x420eb8[_0x1485('0x2f')]:_0xa0e138[_0x1485('0x2a')];if(_0x135c6a[_0x1485('0x2b')]['includeAll']){_0x420eb8[_0x1485('0x42')]=[{'all':!![]}];}_0x420eb8=_[_0x1485('0x3a')]({},_0x420eb8,_0x135c6a[_0x1485('0x3b')]);return db['FaxTransferReport'][_0x1485('0x43')](_0x420eb8)[_0x1485('0x3c')](handleEntityNotFound(_0xa55888,null))[_0x1485('0x3c')](respondWithResult(_0xa55888,null))['catch'](handleError(_0xa55888,null));};exports[_0x1485('0x44')]=function(_0x4cf39f,_0x13c3ad){return db[_0x1485('0x25')]['create'](_0x4cf39f[_0x1485('0x45')],{})[_0x1485('0x3c')](respondWithResult(_0x13c3ad,0xc9))[_0x1485('0x40')](handleError(_0x13c3ad,null));};exports[_0x1485('0x21')]=function(_0x3297d7,_0x46809e){if(_0x3297d7[_0x1485('0x45')]['id']){delete _0x3297d7[_0x1485('0x45')]['id'];}return db['FaxTransferReport'][_0x1485('0x43')]({'where':{'id':_0x3297d7[_0x1485('0x46')]['id']}})[_0x1485('0x3c')](handleEntityNotFound(_0x46809e,null))[_0x1485('0x3c')](saveUpdates(_0x3297d7['body'],null))[_0x1485('0x3c')](respondWithResult(_0x46809e,null))[_0x1485('0x40')](handleError(_0x46809e,null));};exports[_0x1485('0x47')]=function(_0x147c9a,_0x59c7d1){return db['FaxTransferReport']['find']({'where':{'id':_0x147c9a['params']['id']}})['then'](handleEntityNotFound(_0x59c7d1,null))[_0x1485('0x3c')](removeEntity(_0x59c7d1,null))[_0x1485('0x40')](handleError(_0x59c7d1,null));};exports[_0x1485('0x48')]=function(_0x175c13,_0x26b918){return db[_0x1485('0x25')][_0x1485('0x48')]()[_0x1485('0x3c')](respondWithResult(_0x26b918,null))[_0x1485('0x40')](handleError(_0x26b918,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 8ccae68..30159b4 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 _0x412a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x46259b,_0x331d2c){var _0x362076=function(_0x1e6216){while(--_0x1e6216){_0x46259b['push'](_0x46259b['shift']());}};_0x362076(++_0x331d2c);}(_0x412a,0x17f));var _0xa412=function(_0x34115c,_0x10d58b){_0x34115c=_0x34115c-0x0;var _0x4b1b40=_0x412a[_0x34115c];return _0x4b1b40;};'use strict';var _=require(_0xa412('0x0'));var util=require(_0xa412('0x1'));var logger=require(_0xa412('0x2'))(_0xa412('0x3'));var moment=require('moment');var BPromise=require(_0xa412('0x4'));var rp=require(_0xa412('0x5'));var fs=require('fs');var path=require(_0xa412('0x6'));var rimraf=require(_0xa412('0x7'));var config=require('../../config/environment');var attributes=require(_0xa412('0x8'));module['exports']=function(_0x59cc20,_0x482709){return _0x59cc20['define'](_0xa412('0x9'),attributes,{'tableName':_0xa412('0xa'),'paranoid':![],'indexes':[{'name':_0xa412('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3611=['../../config/environment','exports','define','report_fax_transfer','lodash','api','request-promise','path','rimraf'];(function(_0x14958f,_0x1e3d9c){var _0x349065=function(_0x5ae625){while(--_0x5ae625){_0x14958f['push'](_0x14958f['shift']());}};_0x349065(++_0x1e3d9c);}(_0x3611,0x136));var _0x1361=function(_0x4a5610,_0x2246d5){_0x4a5610=_0x4a5610-0x0;var _0x47c64f=_0x3611[_0x4a5610];return _0x47c64f;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1361('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1361('0x2'));var fs=require('fs');var path=require(_0x1361('0x3'));var rimraf=require(_0x1361('0x4'));var config=require(_0x1361('0x5'));var attributes=require('./faxTransferReport.attributes');module[_0x1361('0x6')]=function(_0x304832,_0x5aa5dc){return _0x304832[_0x1361('0x7')]('FaxTransferReport',attributes,{'tableName':_0x1361('0x8'),'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 4baa089..6f57d72 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 _0x1cd7=['bluebird','randomstring','rpc','../../config/environment','client','http','then','FaxTransferReport,\x20%s,\x20%s','debug','error','message','info','result','catch','util'];(function(_0xe10326,_0x5a8de6){var _0x433c15=function(_0x532385){while(--_0x532385){_0xe10326['push'](_0xe10326['shift']());}};_0x433c15(++_0x5a8de6);}(_0x1cd7,0x158));var _0x71cd=function(_0x383c15,_0x4b75c2){_0x383c15=_0x383c15-0x0;var _0x5d1345=_0x1cd7[_0x383c15];return _0x5d1345;};'use strict';var _=require('lodash');var util=require(_0x71cd('0x0'));var moment=require('moment');var BPromise=require(_0x71cd('0x1'));var rs=require(_0x71cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x71cd('0x3'));var config=require(_0x71cd('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x71cd('0x5')][_0x71cd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x116d7a,_0x3cc3c0,_0x38ee62){return new BPromise(function(_0x3322c6,_0x22ac78){return client['request'](_0x116d7a,_0x38ee62)[_0x71cd('0x7')](function(_0x28097c){logger['info'](_0x71cd('0x8'),_0x3cc3c0,'request\x20sent');logger[_0x71cd('0x9')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3cc3c0,'request\x20sent',JSON['stringify'](_0x28097c));if(_0x28097c[_0x71cd('0xa')]){if(_0x28097c['error']['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x3cc3c0,_0x28097c[_0x71cd('0xa')]['message']);return _0x22ac78(_0x28097c[_0x71cd('0xa')][_0x71cd('0xb')]);}logger['error'](_0x71cd('0x8'),_0x3cc3c0,_0x28097c[_0x71cd('0xa')]['message']);return _0x3322c6(_0x28097c[_0x71cd('0xa')][_0x71cd('0xb')]);}else{logger[_0x71cd('0xc')](_0x71cd('0x8'),_0x3cc3c0,'request\x20sent');_0x3322c6(_0x28097c[_0x71cd('0xd')][_0x71cd('0xb')]);}})[_0x71cd('0xe')](function(_0xd46b54){logger['error'](_0x71cd('0x8'),_0x3cc3c0,_0xd46b54);_0x22ac78(_0xd46b54);});});} \ No newline at end of file +var _0xcdc3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdc3,0x70));var _0x3cdc=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xcdc3[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x3cdc('0x0'));var util=require(_0x3cdc('0x1'));var moment=require(_0x3cdc('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cdc('0x3'));var fs=require('fs');var Redis=require(_0x3cdc('0x4'));var db=require(_0x3cdc('0x5'))['db'];var utils=require(_0x3cdc('0x6'));var logger=require(_0x3cdc('0x7'))('rpc');var config=require(_0x3cdc('0x8'));var jayson=require(_0x3cdc('0x9'));var client=jayson[_0x3cdc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d9a37,_0x2175bb,_0x4c74a0){return new BPromise(function(_0x28b8b0,_0x2fac78){return client[_0x3cdc('0xb')](_0x2d9a37,_0x4c74a0)['then'](function(_0x36bb6f){logger['info'](_0x3cdc('0xc'),_0x2175bb,_0x3cdc('0xd'));logger[_0x3cdc('0xe')](_0x3cdc('0xf'),_0x2175bb,_0x3cdc('0xd'),JSON[_0x3cdc('0x10')](_0x36bb6f));if(_0x36bb6f[_0x3cdc('0x11')]){if(_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x12')]===0x1f4){logger[_0x3cdc('0x11')](_0x3cdc('0xc'),_0x2175bb,_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);return _0x2fac78(_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);}logger[_0x3cdc('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x2175bb,_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);return _0x28b8b0(_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);}else{logger[_0x3cdc('0x14')](_0x3cdc('0xc'),_0x2175bb,_0x3cdc('0xd'));_0x28b8b0(_0x36bb6f[_0x3cdc('0x15')][_0x3cdc('0x13')]);}})[_0x3cdc('0x16')](function(_0x386496){logger[_0x3cdc('0x11')](_0x3cdc('0xc'),_0x2175bb,_0x386496);_0x2fac78(_0x386496);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index cae1483..614a0a1 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 _0x1de5=['get','index','/describe','isAuthenticated','describe','/:id','post','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x542dd1,_0x3d5a5b){var _0x11ff84=function(_0x59a5a9){while(--_0x59a5a9){_0x542dd1['push'](_0x542dd1['shift']());}};_0x11ff84(++_0x3d5a5b);}(_0x1de5,0x1ba));var _0x51de=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x1de5[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0x51de('0x0'));var util=require('util');var path=require(_0x51de('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x51de('0x2')]();var fs_extra=require(_0x51de('0x3'));var auth=require(_0x51de('0x4'));var interaction=require(_0x51de('0x5'));var config=require(_0x51de('0x6'));var controller=require(_0x51de('0x7'));router[_0x51de('0x8')]('/',auth['isAuthenticated'](),controller[_0x51de('0x9')]);router['get'](_0x51de('0xa'),auth[_0x51de('0xb')](),controller[_0x51de('0xc')]);router[_0x51de('0x8')](_0x51de('0xd'),auth[_0x51de('0xb')](),controller['show']);router[_0x51de('0xe')]('/',auth[_0x51de('0xb')](),controller['create']);router[_0x51de('0xf')](_0x51de('0xd'),auth[_0x51de('0xb')](),controller[_0x51de('0x10')]);router[_0x51de('0x11')](_0x51de('0xd'),auth[_0x51de('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb066=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','show','post','put','update','destroy','exports','multer'];(function(_0x13fef7,_0x40e369){var _0x455f14=function(_0x24611a){while(--_0x24611a){_0x13fef7['push'](_0x13fef7['shift']());}};_0x455f14(++_0x40e369);}(_0xb066,0x155));var _0x6b06=function(_0x554155,_0x4469c3){_0x554155=_0x554155-0x0;var _0x188758=_0xb066[_0x554155];return _0x188758;};'use strict';var multer=require(_0x6b06('0x0'));var util=require(_0x6b06('0x1'));var path=require(_0x6b06('0x2'));var timeout=require(_0x6b06('0x3'));var express=require(_0x6b06('0x4'));var router=express[_0x6b06('0x5')]();var fs_extra=require(_0x6b06('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6b06('0x7'));var config=require('../../config/environment');var controller=require(_0x6b06('0x8'));router[_0x6b06('0x9')]('/',auth[_0x6b06('0xa')](),controller['index']);router['get'](_0x6b06('0xb'),auth[_0x6b06('0xa')](),controller['describe']);router[_0x6b06('0x9')]('/:id',auth[_0x6b06('0xa')](),controller[_0x6b06('0xc')]);router[_0x6b06('0xd')]('/',auth[_0x6b06('0xa')](),controller['create']);router[_0x6b06('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6b06('0xf')]);router['delete']('/:id',auth[_0x6b06('0xa')](),controller[_0x6b06('0x10')]);module[_0x6b06('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index cc9613b..36c65f7 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 _0x45af=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45af,0xa0));var _0xf45a=function(_0x1b0a80,_0x174491){_0x1b0a80=_0x1b0a80-0x0;var _0x2508f3=_0x45af[_0x1b0a80];return _0x2508f3;};'use strict';var multer=require(_0xf45a('0x0'));var util=require(_0xf45a('0x1'));var path=require(_0xf45a('0x2'));var timeout=require(_0xf45a('0x3'));var express=require(_0xf45a('0x4'));var router=express[_0xf45a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf45a('0x6'));var interaction=require(_0xf45a('0x7'));var config=require(_0xf45a('0x8'));var controller=require('./intDeskAccount.controller');router[_0xf45a('0x9')]('/',auth[_0xf45a('0xa')](),controller[_0xf45a('0xb')]);router[_0xf45a('0x9')](_0xf45a('0xc'),auth[_0xf45a('0xa')](),controller[_0xf45a('0xd')]);router[_0xf45a('0x9')](_0xf45a('0xe'),auth[_0xf45a('0xa')](),controller[_0xf45a('0xf')]);router[_0xf45a('0x9')](_0xf45a('0x10'),auth[_0xf45a('0xa')](),controller[_0xf45a('0x11')]);router[_0xf45a('0x12')]('/',auth[_0xf45a('0xa')](),controller[_0xf45a('0x13')]);router[_0xf45a('0x12')](_0xf45a('0xe'),auth[_0xf45a('0xa')](),controller[_0xf45a('0x14')]);router[_0xf45a('0x15')](_0xf45a('0xc'),auth[_0xf45a('0xa')](),controller[_0xf45a('0x16')]);router[_0xf45a('0x17')]('/:id',auth[_0xf45a('0xa')](),controller[_0xf45a('0x18')]);module[_0xf45a('0x19')]=router; \ No newline at end of file +var _0x5359=['/:id','update','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put'];(function(_0x13d816,_0x37ca7){var _0x5ab9fe=function(_0x10dd3d){while(--_0x10dd3d){_0x13d816['push'](_0x13d816['shift']());}};_0x5ab9fe(++_0x37ca7);}(_0x5359,0x144));var _0x9535=function(_0x2a9de5,_0xbc4a67){_0x2a9de5=_0x2a9de5-0x0;var _0x12e9d2=_0x5359[_0x2a9de5];return _0x12e9d2;};'use strict';var multer=require(_0x9535('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9535('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9535('0x2'));var auth=require(_0x9535('0x3'));var interaction=require(_0x9535('0x4'));var config=require(_0x9535('0x5'));var controller=require(_0x9535('0x6'));router[_0x9535('0x7')]('/',auth[_0x9535('0x8')](),controller['index']);router['get']('/:id',auth[_0x9535('0x8')](),controller['show']);router[_0x9535('0x7')](_0x9535('0x9'),auth['isAuthenticated'](),controller[_0x9535('0xa')]);router[_0x9535('0x7')](_0x9535('0xb'),auth['isAuthenticated'](),controller[_0x9535('0xc')]);router['post']('/',auth[_0x9535('0x8')](),controller[_0x9535('0xd')]);router[_0x9535('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9535('0xf')](_0x9535('0x10'),auth['isAuthenticated'](),controller[_0x9535('0x11')]);router['delete']('/:id',auth[_0x9535('0x8')](),controller[_0x9535('0x12')]);module[_0x9535('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e653418..e430e51 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 _0xb15c=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb15c,0x1e7));var _0xcb15=function(_0x281335,_0x409a4b){_0x281335=_0x281335-0x0;var _0x3f9da7=_0xb15c[_0x281335];return _0x3f9da7;};'use strict';var Sequelize=require(_0xcb15('0x0'));module[_0xcb15('0x1')]={'name':{'type':Sequelize[_0xcb15('0x2')]},'description':{'type':Sequelize[_0xcb15('0x2')]},'username':{'type':Sequelize[_0xcb15('0x2')]},'remoteUri':{'type':Sequelize[_0xcb15('0x2')]},'authType':{'type':Sequelize[_0xcb15('0x3')](_0xcb15('0x4')),'defaultValue':_0xcb15('0x4')},'password':{'type':Sequelize[_0xcb15('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xcb15('0x2')]},'token':{'type':Sequelize[_0xcb15('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcb15('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0xcb15('0x5')}}; \ No newline at end of file +var _0x15a7=['basic','ENUM','newTab','sequelize','exports','STRING'];(function(_0x393e26,_0x375503){var _0x55243c=function(_0x24c9f9){while(--_0x24c9f9){_0x393e26['push'](_0x393e26['shift']());}};_0x55243c(++_0x375503);}(_0x15a7,0x1b9));var _0x715a=function(_0x78f9b9,_0x486f81){_0x78f9b9=_0x78f9b9-0x0;var _0x1a6e67=_0x15a7[_0x78f9b9];return _0x1a6e67;};'use strict';var Sequelize=require(_0x715a('0x0'));module[_0x715a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x715a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x715a('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x715a('0x3')),'defaultValue':_0x715a('0x3')},'password':{'type':Sequelize[_0x715a('0x2')]},'consumerKey':{'type':Sequelize[_0x715a('0x2')]},'consumerSecret':{'type':Sequelize[_0x715a('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x715a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x715a('0x4')]('integrationTab',_0x715a('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 2725d1b..dc57cab 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 _0x7216=['%s:%s','toString','base64','_embedded','entries','active','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getConfigurations','findOne','DeskConfiguration','order','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','username','password','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization'];(function(_0x10230f,_0xcaecbe){var _0x4a5d3e=function(_0xf9e10d){while(--_0xf9e10d){_0x10230f['push'](_0x10230f['shift']());}};_0x4a5d3e(++_0xcaecbe);}(_0x7216,0x80));var _0x6721=function(_0x46b9ee,_0x46054c){_0x46b9ee=_0x46b9ee-0x0;var _0x266c0b=_0x7216[_0x46b9ee];return _0x266c0b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6721('0x0'));var rp=require(_0x6721('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6721('0x2'));var util=require(_0x6721('0x3'));var path=require('path');var sox=require(_0x6721('0x4'));var csv=require(_0x6721('0x5'));var ejs=require(_0x6721('0x6'));var fs=require('fs');var fs_extra=require(_0x6721('0x7'));var _=require(_0x6721('0x8'));var squel=require(_0x6721('0x9'));var crypto=require(_0x6721('0xa'));var jsforce=require(_0x6721('0xb'));var deskjs=require(_0x6721('0xc'));var toCsv=require(_0x6721('0x5'));var querystring=require(_0x6721('0xd'));var Papa=require(_0x6721('0xe'));var Redis=require(_0x6721('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6721('0x10'));var as=require(_0x6721('0x11'));var hardwareService=require(_0x6721('0x12'));var logger=require(_0x6721('0x13'))(_0x6721('0x14'));var utils=require(_0x6721('0x15'));var config=require(_0x6721('0x16'));var licenseUtil=require(_0x6721('0x17'));var db=require(_0x6721('0x18'))['db'];var integrations=require(_0x6721('0x19'));function respondWithStatusCode(_0x5a85ad,_0x43f2da){_0x43f2da=_0x43f2da||0xcc;return function(_0x23d281){if(_0x23d281){return _0x5a85ad[_0x6721('0x1a')](_0x43f2da);}return _0x5a85ad[_0x6721('0x1b')](_0x43f2da)[_0x6721('0x1c')]();};}function respondWithResult(_0x27a67a,_0x4cbcf5){_0x4cbcf5=_0x4cbcf5||0xc8;return function(_0x26d61c){if(_0x26d61c){return _0x27a67a[_0x6721('0x1b')](_0x4cbcf5)[_0x6721('0x1d')](_0x26d61c);}};}function respondWithFilteredResult(_0x486edb,_0x39aa77){return function(_0x110f44){if(_0x110f44){var _0x37cb67=typeof _0x39aa77['offset']==='undefined'&&typeof _0x39aa77[_0x6721('0x1e')]===_0x6721('0x1f');var _0x3a8e33=_0x110f44['count'];var _0x2e027c=_0x37cb67?0x0:_0x39aa77[_0x6721('0x20')];var _0x59cf9b=_0x37cb67?_0x110f44[_0x6721('0x21')]:_0x39aa77[_0x6721('0x20')]+_0x39aa77[_0x6721('0x1e')];var _0x293ea1;if(_0x59cf9b>=_0x3a8e33){_0x59cf9b=_0x3a8e33;_0x293ea1=0xc8;}else{_0x293ea1=0xce;}_0x486edb[_0x6721('0x1b')](_0x293ea1);return _0x486edb[_0x6721('0x22')](_0x6721('0x23'),_0x2e027c+'-'+_0x59cf9b+'/'+_0x3a8e33)['json'](_0x110f44);}return null;};}function patchUpdates(_0x1e810a){return function(_0x1b3bcd){try{jsonpatch['apply'](_0x1b3bcd,_0x1e810a,!![]);}catch(_0x146f5a){return BPromise[_0x6721('0x24')](_0x146f5a);}return _0x1b3bcd[_0x6721('0x25')]();};}function saveUpdates(_0x1d1771,_0x3ba8e6){return function(_0x315277){if(_0x315277){return _0x315277[_0x6721('0x26')](_0x1d1771)['then'](function(_0x1f4de0){return _0x1f4de0;});}return null;};}function removeEntity(_0x177c06,_0x3dfb50){return function(_0x7664d5){if(_0x7664d5){return _0x7664d5[_0x6721('0x27')]()[_0x6721('0x28')](function(){_0x177c06[_0x6721('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21757b,_0x4a7217){return function(_0x4226fe){if(!_0x4226fe){_0x21757b[_0x6721('0x1a')](0x194);}return _0x4226fe;};}function handleError(_0x295717,_0x98853c){_0x98853c=_0x98853c||0x1f4;return function(_0x5b46e5){logger['error'](_0x5b46e5[_0x6721('0x29')]);if(_0x5b46e5[_0x6721('0x2a')]){delete _0x5b46e5[_0x6721('0x2a')];}_0x295717[_0x6721('0x1b')](_0x98853c)[_0x6721('0x2b')](_0x5b46e5);};}exports[_0x6721('0x2c')]=function(_0x30b1a7,_0x5f2fb2){var _0x1d7d15={},_0x103ffa={},_0x409fe1={'count':0x0,'rows':[]};var _0x7a5181=_[_0x6721('0x2d')](db[_0x6721('0x2e')][_0x6721('0x2f')],function(_0x24fa4b){return{'name':_0x24fa4b[_0x6721('0x30')],'type':_0x24fa4b['type'][_0x6721('0x31')]};});_0x103ffa[_0x6721('0x32')]=_[_0x6721('0x2d')](_0x7a5181,_0x6721('0x2a'));_0x103ffa[_0x6721('0x33')]=_[_0x6721('0x34')](_0x30b1a7[_0x6721('0x33')]);_0x103ffa[_0x6721('0x35')]=_[_0x6721('0x36')](_0x103ffa['model'],_0x103ffa[_0x6721('0x33')]);_0x1d7d15[_0x6721('0x37')]=_[_0x6721('0x36')](_0x103ffa[_0x6721('0x32')],qs['fields'](_0x30b1a7[_0x6721('0x33')]['fields']));_0x1d7d15[_0x6721('0x37')]=_0x1d7d15[_0x6721('0x37')][_0x6721('0x38')]?_0x1d7d15[_0x6721('0x37')]:_0x103ffa[_0x6721('0x32')];if(!_0x30b1a7['query'][_0x6721('0x39')](_0x6721('0x3a'))){_0x1d7d15[_0x6721('0x1e')]=qs[_0x6721('0x1e')](_0x30b1a7[_0x6721('0x33')][_0x6721('0x1e')]);_0x1d7d15[_0x6721('0x20')]=qs[_0x6721('0x20')](_0x30b1a7[_0x6721('0x33')][_0x6721('0x20')]);}_0x1d7d15['order']=qs['sort'](_0x30b1a7[_0x6721('0x33')][_0x6721('0x3b')]);_0x1d7d15['where']=qs['filters'](_[_0x6721('0x3c')](_0x30b1a7[_0x6721('0x33')],_0x103ffa[_0x6721('0x35')]),_0x7a5181);if(_0x30b1a7[_0x6721('0x33')][_0x6721('0x3d')]){_0x1d7d15[_0x6721('0x3e')]=_[_0x6721('0x3f')](_0x1d7d15[_0x6721('0x3e')],{'$or':_['map'](_0x7a5181,function(_0x5d782f){if(_0x5d782f[_0x6721('0x40')]!==_0x6721('0x41')){var _0x3cc643={};_0x3cc643[_0x5d782f[_0x6721('0x2a')]]={'$like':'%'+_0x30b1a7[_0x6721('0x33')][_0x6721('0x3d')]+'%'};return _0x3cc643;}})});}_0x1d7d15=_[_0x6721('0x3f')]({},_0x1d7d15,_0x30b1a7[_0x6721('0x42')]);var _0x1355b0={'where':_0x1d7d15[_0x6721('0x3e')]};return db['DeskAccount']['count'](_0x1355b0)[_0x6721('0x28')](function(_0x4b2765){_0x409fe1['count']=_0x4b2765;if(_0x30b1a7[_0x6721('0x33')][_0x6721('0x43')]){_0x1d7d15[_0x6721('0x44')]=[{'all':!![]}];}return db[_0x6721('0x2e')][_0x6721('0x45')](_0x1d7d15);})['then'](function(_0x2482c9){_0x409fe1[_0x6721('0x46')]=_0x2482c9;return _0x409fe1;})[_0x6721('0x28')](respondWithFilteredResult(_0x5f2fb2,_0x1d7d15))[_0x6721('0x47')](handleError(_0x5f2fb2,null));};exports[_0x6721('0x48')]=function(_0x2dbdd7,_0x234c9f){var _0x15486e={'raw':![],'where':{'id':_0x2dbdd7[_0x6721('0x49')]['id']}},_0x596160={};_0x596160[_0x6721('0x32')]=_['keys'](db[_0x6721('0x2e')][_0x6721('0x2f')]);_0x596160[_0x6721('0x33')]=_[_0x6721('0x34')](_0x2dbdd7[_0x6721('0x33')]);_0x596160[_0x6721('0x35')]=_['intersection'](_0x596160[_0x6721('0x32')],_0x596160[_0x6721('0x33')]);_0x15486e['attributes']=_[_0x6721('0x36')](_0x596160[_0x6721('0x32')],qs[_0x6721('0x4a')](_0x2dbdd7[_0x6721('0x33')][_0x6721('0x4a')]));_0x15486e[_0x6721('0x37')]=_0x15486e[_0x6721('0x37')][_0x6721('0x38')]?_0x15486e[_0x6721('0x37')]:_0x596160[_0x6721('0x32')];if(_0x2dbdd7[_0x6721('0x33')][_0x6721('0x43')]){_0x15486e[_0x6721('0x44')]=[{'all':!![]}];}_0x15486e=_[_0x6721('0x3f')]({},_0x15486e,_0x2dbdd7[_0x6721('0x42')]);return db['DeskAccount'][_0x6721('0x4b')](_0x15486e)[_0x6721('0x28')](handleEntityNotFound(_0x234c9f,null))[_0x6721('0x28')](respondWithResult(_0x234c9f,null))[_0x6721('0x47')](handleError(_0x234c9f,null));};exports['create']=function(_0x265d45,_0xfd5efa){return db[_0x6721('0x2e')][_0x6721('0x4c')](_0x265d45[_0x6721('0x4d')],{})[_0x6721('0x28')](respondWithResult(_0xfd5efa,0xc9))[_0x6721('0x47')](handleError(_0xfd5efa,null));};exports['update']=function(_0x551e71,_0x36e7dc){if(_0x551e71['body']['id']){delete _0x551e71['body']['id'];}return db[_0x6721('0x2e')][_0x6721('0x4b')]({'where':{'id':_0x551e71['params']['id']}})[_0x6721('0x28')](handleEntityNotFound(_0x36e7dc,null))[_0x6721('0x28')](saveUpdates(_0x551e71[_0x6721('0x4d')],null))[_0x6721('0x28')](respondWithResult(_0x36e7dc,null))[_0x6721('0x47')](handleError(_0x36e7dc,null));};exports['destroy']=function(_0x232c64,_0x9c004){return db[_0x6721('0x2e')]['find']({'where':{'id':_0x232c64[_0x6721('0x49')]['id']}})[_0x6721('0x28')](handleEntityNotFound(_0x9c004,null))['then'](removeEntity(_0x9c004,null))[_0x6721('0x47')](handleError(_0x9c004,null));};exports[_0x6721('0x4e')]=function(_0x4c0a4f,_0x25de44,_0x536d44){var _0x25c1a5={};var _0x5e04c6={};var _0x13649b;var _0x237704;return db[_0x6721('0x2e')][_0x6721('0x4f')]({'where':{'id':_0x4c0a4f['params']['id']}})[_0x6721('0x28')](handleEntityNotFound(_0x25de44,null))[_0x6721('0x28')](function(_0xfcabc2){if(_0xfcabc2){_0x13649b=_0xfcabc2;_0x5e04c6[_0x6721('0x32')]=_['keys'](db[_0x6721('0x50')][_0x6721('0x2f')]);_0x5e04c6[_0x6721('0x33')]=_[_0x6721('0x34')](_0x4c0a4f['query']);_0x5e04c6[_0x6721('0x35')]=_['intersection'](_0x5e04c6['model'],_0x5e04c6[_0x6721('0x33')]);_0x25c1a5[_0x6721('0x37')]=_[_0x6721('0x36')](_0x5e04c6['model'],qs[_0x6721('0x4a')](_0x4c0a4f[_0x6721('0x33')]['fields']));_0x25c1a5[_0x6721('0x37')]=_0x25c1a5[_0x6721('0x37')][_0x6721('0x38')]?_0x25c1a5[_0x6721('0x37')]:_0x5e04c6['model'];_0x25c1a5[_0x6721('0x51')]=qs[_0x6721('0x3b')](_0x4c0a4f['query']['sort']);_0x25c1a5[_0x6721('0x3e')]=qs[_0x6721('0x35')](_['pick'](_0x4c0a4f[_0x6721('0x33')],_0x5e04c6['filters']));if(_0x4c0a4f[_0x6721('0x33')]['filter']){_0x25c1a5[_0x6721('0x3e')]=_['merge'](_0x25c1a5[_0x6721('0x3e')],{'$or':_[_0x6721('0x2d')](_0x25c1a5['attributes'],function(_0x4f2e6e){var _0x5b5c1c={};_0x5b5c1c[_0x4f2e6e]={'$like':'%'+_0x4c0a4f[_0x6721('0x33')][_0x6721('0x3d')]+'%'};return _0x5b5c1c;})});}_0x25c1a5=_[_0x6721('0x3f')]({},_0x25c1a5,_0x4c0a4f[_0x6721('0x42')]);return _0x13649b[_0x6721('0x4e')](_0x25c1a5);}})[_0x6721('0x28')](function(_0x39c7a3){if(_0x39c7a3){_0x237704=_0x39c7a3[_0x6721('0x38')];if(!_0x4c0a4f[_0x6721('0x33')][_0x6721('0x39')]('nolimit')){_0x25c1a5[_0x6721('0x1e')]=qs[_0x6721('0x1e')](_0x4c0a4f[_0x6721('0x33')]['limit']);_0x25c1a5[_0x6721('0x20')]=qs[_0x6721('0x20')](_0x4c0a4f[_0x6721('0x33')][_0x6721('0x20')]);}return _0x13649b[_0x6721('0x4e')](_0x25c1a5);}})['then'](function(_0x465abc){if(_0x465abc){return _0x465abc?{'count':_0x237704,'rows':_0x465abc}:null;}})['then'](respondWithResult(_0x25de44,null))['catch'](handleError(_0x25de44,null));};exports['addConfiguration']=function(_0x3e3536,_0x20fe9a,_0x5404ed){if(_0x3e3536[_0x6721('0x4d')]['id']){delete _0x3e3536[_0x6721('0x4d')]['id'];}return db[_0x6721('0x2e')][_0x6721('0x4f')]({'where':{'id':_0x3e3536[_0x6721('0x49')]['id']}})['then'](handleEntityNotFound(_0x20fe9a,null))['then'](function(_0x242441){if(_0x242441){_0x3e3536[_0x6721('0x4d')]['AccountId']=_0x242441['id'];_0x3e3536[_0x6721('0x4d')][_0x6721('0x52')]=integrations['getSubjects'](_0x3e3536[_0x6721('0x4d')][_0x6721('0x53')],_0x3e3536[_0x6721('0x4d')][_0x6721('0x40')]);_0x3e3536['body'][_0x6721('0x54')]=integrations[_0x6721('0x55')](_0x3e3536[_0x6721('0x4d')][_0x6721('0x53')],_0x3e3536[_0x6721('0x4d')][_0x6721('0x40')]);return db['DeskConfiguration'][_0x6721('0x4c')](_0x3e3536[_0x6721('0x4d')],{'include':[{'model':db['DeskField'],'as':_0x6721('0x52')},{'model':db[_0x6721('0x56')],'as':_0x6721('0x54')}]});}return null;})[_0x6721('0x28')](respondWithResult(_0x20fe9a,null))[_0x6721('0x47')](handleError(_0x20fe9a,null));};exports[_0x6721('0x57')]=function(_0x2a3110,_0x11afc9,_0x4e8c2b){var _0x4a45f3=[{'name':_0x6721('0x58'),'label':_0x6721('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 _0x7659a9='';return db[_0x6721('0x2e')]['findOne']({'where':{'id':_0x2a3110[_0x6721('0x49')]['id']},'attributes':['id','remoteUri','authType',_0x6721('0x59'),_0x6721('0x5a'),_0x6721('0x5b'),_0x6721('0x5c'),'token',_0x6721('0x5d')]})[_0x6721('0x28')](handleEntityNotFound(_0x11afc9,null))[_0x6721('0x28')](function(_0x621e2f){if(_0x621e2f){_0x7659a9=_0x621e2f['remoteUri'];var _0x5b6019=_0x7659a9['slice'](-0x1);if(_0x5b6019==='/'){_0x7659a9=_0x7659a9[_0x6721('0x5e')](0x0,_0x7659a9[_0x6721('0x5f')](_0x5b6019));}var _0x2a5f7d={'method':_0x6721('0x60'),'uri':util[_0x6721('0x61')](_0x6721('0x62'),_0x7659a9),'headers':{'Content-Type':'application/json','Accept':_0x6721('0x63')},'json':!![]};if(_0x621e2f[_0x6721('0x64')]===_0x6721('0x65')){_0x2a5f7d[_0x6721('0x66')][_0x6721('0x67')]=util[_0x6721('0x61')]('Basic\x20%s',new Buffer(util[_0x6721('0x61')](_0x6721('0x68'),_0x621e2f[_0x6721('0x59')],_0x621e2f['password']))[_0x6721('0x69')](_0x6721('0x6a')));}return rp(_0x2a5f7d)['then'](function(_0x3dde75){return _0x4a45f3['concat'](_[_0x6721('0x2d')](_0x3dde75[_0x6721('0x6b')][_0x6721('0x6c')],function(_0x4c566d){return{'id':_0x4c566d[_0x6721('0x2a')],'name':_0x4c566d[_0x6721('0x2a')],'type':_0x4c566d[_0x6721('0x40')],'active':_0x4c566d[_0x6721('0x6d')],'label':_0x4c566d['label'],'custom':!![]};}));});}})[_0x6721('0x28')](function(_0x3803b5){return{'count':_0x3803b5['length'],'rows':_0x3803b5};})[_0x6721('0x28')](respondWithResult(_0x11afc9,null))[_0x6721('0x47')](function(_0x55a2ae){var _0x581bb3=_0x2a3110[_0x6721('0x33')][_0x6721('0x6e')]?0x1f4:_0x55a2ae['statusCode']||0x1f4;logger[_0x6721('0x6f')](_0x6721('0x70'),'getFields',_0x581bb3,JSON[_0x6721('0x71')](_0x55a2ae));delete _0x55a2ae[_0x6721('0x2a')];if(_0x581bb3===0x191){_0x581bb3=0x190;}_0x11afc9[_0x6721('0x1b')](_0x581bb3)['send'](_0x2a3110['query'][_0x6721('0x6e')]?{'message':_0x6721('0x72'),'statusCode':_0x55a2ae[_0x6721('0x73')]}:_0x55a2ae);});}; \ No newline at end of file +var _0xadc0=['save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','DeskAccount','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','format','application/json','basic','headers','Basic\x20%s','password','toString','base64','concat','_embedded','active','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x25a386,_0x4acd61){var _0x4d3d47=function(_0x2e4efb){while(--_0x2e4efb){_0x25a386['push'](_0x25a386['shift']());}};_0x4d3d47(++_0x4acd61);}(_0xadc0,0x125));var _0x0adc=function(_0x4e9b99,_0x124be9){_0x4e9b99=_0x4e9b99-0x0;var _0x2c63dd=_0xadc0[_0x4e9b99];return _0x2c63dd;};'use strict';var emlformat=require(_0x0adc('0x0'));var rimraf=require(_0x0adc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0adc('0x2'));var rp=require(_0x0adc('0x3'));var moment=require(_0x0adc('0x4'));var BPromise=require(_0x0adc('0x5'));var Mustache=require(_0x0adc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0adc('0x7'));var csv=require('to-csv');var ejs=require(_0x0adc('0x8'));var fs=require('fs');var fs_extra=require(_0x0adc('0x9'));var _=require(_0x0adc('0xa'));var squel=require(_0x0adc('0xb'));var crypto=require(_0x0adc('0xc'));var jsforce=require(_0x0adc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0adc('0xe'));var querystring=require('querystring');var Papa=require(_0x0adc('0xf'));var Redis=require(_0x0adc('0x10'));var authService=require(_0x0adc('0x11'));var qs=require(_0x0adc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0adc('0x13'));var logger=require(_0x0adc('0x14'))('api');var utils=require(_0x0adc('0x15'));var config=require(_0x0adc('0x16'));var licenseUtil=require(_0x0adc('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0adc('0x18'));function respondWithStatusCode(_0x233dda,_0x3d09eb){_0x3d09eb=_0x3d09eb||0xcc;return function(_0x12c998){if(_0x12c998){return _0x233dda[_0x0adc('0x19')](_0x3d09eb);}return _0x233dda[_0x0adc('0x1a')](_0x3d09eb)['end']();};}function respondWithResult(_0x262448,_0x1a669b){_0x1a669b=_0x1a669b||0xc8;return function(_0xea8097){if(_0xea8097){return _0x262448[_0x0adc('0x1a')](_0x1a669b)[_0x0adc('0x1b')](_0xea8097);}};}function respondWithFilteredResult(_0x383a46,_0x25f780){return function(_0x580dc9){if(_0x580dc9){var _0x425126=typeof _0x25f780['offset']===_0x0adc('0x1c')&&typeof _0x25f780[_0x0adc('0x1d')]===_0x0adc('0x1c');var _0x4f566=_0x580dc9[_0x0adc('0x1e')];var _0x4198f5=_0x425126?0x0:_0x25f780[_0x0adc('0x1f')];var _0x2cfd03=_0x425126?_0x580dc9[_0x0adc('0x1e')]:_0x25f780[_0x0adc('0x1f')]+_0x25f780[_0x0adc('0x1d')];var _0x386bba;if(_0x2cfd03>=_0x4f566){_0x2cfd03=_0x4f566;_0x386bba=0xc8;}else{_0x386bba=0xce;}_0x383a46[_0x0adc('0x1a')](_0x386bba);return _0x383a46['set'](_0x0adc('0x20'),_0x4198f5+'-'+_0x2cfd03+'/'+_0x4f566)['json'](_0x580dc9);}return null;};}function patchUpdates(_0x244360){return function(_0x98318c){try{jsonpatch[_0x0adc('0x21')](_0x98318c,_0x244360,!![]);}catch(_0x4cbded){return BPromise['reject'](_0x4cbded);}return _0x98318c[_0x0adc('0x22')]();};}function saveUpdates(_0x30e75d,_0x47ced2){return function(_0x2d373b){if(_0x2d373b){return _0x2d373b[_0x0adc('0x23')](_0x30e75d)[_0x0adc('0x24')](function(_0xd2113a){return _0xd2113a;});}return null;};}function removeEntity(_0x27a7f3,_0x5e4692){return function(_0x1e0581){if(_0x1e0581){return _0x1e0581[_0x0adc('0x25')]()['then'](function(){_0x27a7f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x478263,_0x3f0c33){return function(_0x4f4c5a){if(!_0x4f4c5a){_0x478263[_0x0adc('0x19')](0x194);}return _0x4f4c5a;};}function handleError(_0x2715d5,_0x3d74fd){_0x3d74fd=_0x3d74fd||0x1f4;return function(_0x4beb08){logger['error'](_0x4beb08['stack']);if(_0x4beb08[_0x0adc('0x26')]){delete _0x4beb08[_0x0adc('0x26')];}_0x2715d5[_0x0adc('0x1a')](_0x3d74fd)[_0x0adc('0x27')](_0x4beb08);};}exports[_0x0adc('0x28')]=function(_0x1bac44,_0x331689){var _0x41d856={},_0xf74b03={},_0x12fa08={'count':0x0,'rows':[]};var _0x51cdec=_['map'](db['DeskAccount'][_0x0adc('0x29')],function(_0x16e86f){return{'name':_0x16e86f[_0x0adc('0x2a')],'type':_0x16e86f[_0x0adc('0x2b')][_0x0adc('0x2c')]};});_0xf74b03['model']=_['map'](_0x51cdec,_0x0adc('0x26'));_0xf74b03[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x1bac44[_0x0adc('0x2d')]);_0xf74b03[_0x0adc('0x2f')]=_[_0x0adc('0x30')](_0xf74b03['model'],_0xf74b03['query']);_0x41d856['attributes']=_['intersection'](_0xf74b03[_0x0adc('0x31')],qs[_0x0adc('0x32')](_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x32')]));_0x41d856[_0x0adc('0x33')]=_0x41d856[_0x0adc('0x33')][_0x0adc('0x34')]?_0x41d856[_0x0adc('0x33')]:_0xf74b03['model'];if(!_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x35')](_0x0adc('0x36'))){_0x41d856[_0x0adc('0x1d')]=qs[_0x0adc('0x1d')](_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x1d')]);_0x41d856[_0x0adc('0x1f')]=qs[_0x0adc('0x1f')](_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x1f')]);}_0x41d856[_0x0adc('0x37')]=qs[_0x0adc('0x38')](_0x1bac44['query'][_0x0adc('0x38')]);_0x41d856[_0x0adc('0x39')]=qs['filters'](_[_0x0adc('0x3a')](_0x1bac44[_0x0adc('0x2d')],_0xf74b03['filters']),_0x51cdec);if(_0x1bac44['query'][_0x0adc('0x3b')]){_0x41d856[_0x0adc('0x39')]=_[_0x0adc('0x3c')](_0x41d856[_0x0adc('0x39')],{'$or':_[_0x0adc('0x3d')](_0x51cdec,function(_0xe65d38){if(_0xe65d38[_0x0adc('0x2b')]!==_0x0adc('0x3e')){var _0x398a02={};_0x398a02[_0xe65d38[_0x0adc('0x26')]]={'$like':'%'+_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x3b')]+'%'};return _0x398a02;}})});}_0x41d856=_['merge']({},_0x41d856,_0x1bac44['options']);var _0x1f1c69={'where':_0x41d856[_0x0adc('0x39')]};return db['DeskAccount'][_0x0adc('0x1e')](_0x1f1c69)[_0x0adc('0x24')](function(_0x127dec){_0x12fa08[_0x0adc('0x1e')]=_0x127dec;if(_0x1bac44[_0x0adc('0x2d')]['includeAll']){_0x41d856[_0x0adc('0x3f')]=[{'all':!![]}];}return db[_0x0adc('0x40')]['findAll'](_0x41d856);})['then'](function(_0x1476ef){_0x12fa08[_0x0adc('0x41')]=_0x1476ef;return _0x12fa08;})[_0x0adc('0x24')](respondWithFilteredResult(_0x331689,_0x41d856))[_0x0adc('0x42')](handleError(_0x331689,null));};exports[_0x0adc('0x43')]=function(_0x1a2365,_0x3dab35){var _0x27400f={'raw':![],'where':{'id':_0x1a2365[_0x0adc('0x44')]['id']}},_0x97ea4={};_0x97ea4[_0x0adc('0x31')]=_[_0x0adc('0x2e')](db[_0x0adc('0x40')][_0x0adc('0x29')]);_0x97ea4[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x1a2365[_0x0adc('0x2d')]);_0x97ea4[_0x0adc('0x2f')]=_[_0x0adc('0x30')](_0x97ea4['model'],_0x97ea4['query']);_0x27400f[_0x0adc('0x33')]=_[_0x0adc('0x30')](_0x97ea4[_0x0adc('0x31')],qs[_0x0adc('0x32')](_0x1a2365[_0x0adc('0x2d')]['fields']));_0x27400f['attributes']=_0x27400f[_0x0adc('0x33')]['length']?_0x27400f[_0x0adc('0x33')]:_0x97ea4['model'];if(_0x1a2365[_0x0adc('0x2d')]['includeAll']){_0x27400f[_0x0adc('0x3f')]=[{'all':!![]}];}_0x27400f=_[_0x0adc('0x3c')]({},_0x27400f,_0x1a2365[_0x0adc('0x45')]);return db[_0x0adc('0x40')][_0x0adc('0x46')](_0x27400f)['then'](handleEntityNotFound(_0x3dab35,null))[_0x0adc('0x24')](respondWithResult(_0x3dab35,null))[_0x0adc('0x42')](handleError(_0x3dab35,null));};exports[_0x0adc('0x47')]=function(_0x345dc7,_0x17347a){return db[_0x0adc('0x40')]['create'](_0x345dc7[_0x0adc('0x48')],{})[_0x0adc('0x24')](respondWithResult(_0x17347a,0xc9))[_0x0adc('0x42')](handleError(_0x17347a,null));};exports['update']=function(_0x55b9d1,_0x2ed30b){if(_0x55b9d1[_0x0adc('0x48')]['id']){delete _0x55b9d1['body']['id'];}return db[_0x0adc('0x40')][_0x0adc('0x46')]({'where':{'id':_0x55b9d1[_0x0adc('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ed30b,null))[_0x0adc('0x24')](saveUpdates(_0x55b9d1['body'],null))[_0x0adc('0x24')](respondWithResult(_0x2ed30b,null))[_0x0adc('0x42')](handleError(_0x2ed30b,null));};exports[_0x0adc('0x25')]=function(_0x164555,_0x3fc14c){return db[_0x0adc('0x40')][_0x0adc('0x46')]({'where':{'id':_0x164555[_0x0adc('0x44')]['id']}})[_0x0adc('0x24')](handleEntityNotFound(_0x3fc14c,null))[_0x0adc('0x24')](removeEntity(_0x3fc14c,null))[_0x0adc('0x42')](handleError(_0x3fc14c,null));};exports[_0x0adc('0x49')]=function(_0x43e4dd,_0x47083e,_0x41a5b3){var _0x5256c3={};var _0x1da100={};var _0x4c237e;var _0x3ed42d;return db['DeskAccount'][_0x0adc('0x4a')]({'where':{'id':_0x43e4dd['params']['id']}})[_0x0adc('0x24')](handleEntityNotFound(_0x47083e,null))[_0x0adc('0x24')](function(_0x10227d){if(_0x10227d){_0x4c237e=_0x10227d;_0x1da100[_0x0adc('0x31')]=_[_0x0adc('0x2e')](db[_0x0adc('0x4b')][_0x0adc('0x29')]);_0x1da100[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x43e4dd['query']);_0x1da100[_0x0adc('0x2f')]=_[_0x0adc('0x30')](_0x1da100[_0x0adc('0x31')],_0x1da100[_0x0adc('0x2d')]);_0x5256c3[_0x0adc('0x33')]=_[_0x0adc('0x30')](_0x1da100[_0x0adc('0x31')],qs['fields'](_0x43e4dd['query'][_0x0adc('0x32')]));_0x5256c3['attributes']=_0x5256c3['attributes'][_0x0adc('0x34')]?_0x5256c3['attributes']:_0x1da100[_0x0adc('0x31')];_0x5256c3[_0x0adc('0x37')]=qs[_0x0adc('0x38')](_0x43e4dd[_0x0adc('0x2d')][_0x0adc('0x38')]);_0x5256c3['where']=qs[_0x0adc('0x2f')](_['pick'](_0x43e4dd['query'],_0x1da100[_0x0adc('0x2f')]));if(_0x43e4dd['query'][_0x0adc('0x3b')]){_0x5256c3[_0x0adc('0x39')]=_[_0x0adc('0x3c')](_0x5256c3['where'],{'$or':_[_0x0adc('0x3d')](_0x5256c3['attributes'],function(_0x4f888e){var _0x33756c={};_0x33756c[_0x4f888e]={'$like':'%'+_0x43e4dd[_0x0adc('0x2d')][_0x0adc('0x3b')]+'%'};return _0x33756c;})});}_0x5256c3=_[_0x0adc('0x3c')]({},_0x5256c3,_0x43e4dd[_0x0adc('0x45')]);return _0x4c237e[_0x0adc('0x49')](_0x5256c3);}})[_0x0adc('0x24')](function(_0x27619b){if(_0x27619b){_0x3ed42d=_0x27619b[_0x0adc('0x34')];if(!_0x43e4dd['query'][_0x0adc('0x35')](_0x0adc('0x36'))){_0x5256c3[_0x0adc('0x1d')]=qs[_0x0adc('0x1d')](_0x43e4dd['query']['limit']);_0x5256c3[_0x0adc('0x1f')]=qs[_0x0adc('0x1f')](_0x43e4dd[_0x0adc('0x2d')][_0x0adc('0x1f')]);}return _0x4c237e[_0x0adc('0x49')](_0x5256c3);}})[_0x0adc('0x24')](function(_0x2dac70){if(_0x2dac70){return _0x2dac70?{'count':_0x3ed42d,'rows':_0x2dac70}:null;}})['then'](respondWithResult(_0x47083e,null))[_0x0adc('0x42')](handleError(_0x47083e,null));};exports[_0x0adc('0x4c')]=function(_0x4859c7,_0x215847,_0x1323c1){if(_0x4859c7[_0x0adc('0x48')]['id']){delete _0x4859c7['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x4859c7[_0x0adc('0x44')]['id']}})[_0x0adc('0x24')](handleEntityNotFound(_0x215847,null))[_0x0adc('0x24')](function(_0xe7fa9f){if(_0xe7fa9f){_0x4859c7[_0x0adc('0x48')][_0x0adc('0x4d')]=_0xe7fa9f['id'];_0x4859c7[_0x0adc('0x48')][_0x0adc('0x4e')]=integrations[_0x0adc('0x4f')](_0x4859c7[_0x0adc('0x48')]['channel'],_0x4859c7[_0x0adc('0x48')]['type']);_0x4859c7[_0x0adc('0x48')]['Descriptions']=integrations['getDescriptions'](_0x4859c7[_0x0adc('0x48')][_0x0adc('0x50')],_0x4859c7[_0x0adc('0x48')][_0x0adc('0x2b')]);return db[_0x0adc('0x4b')][_0x0adc('0x47')](_0x4859c7[_0x0adc('0x48')],{'include':[{'model':db[_0x0adc('0x51')],'as':_0x0adc('0x4e')},{'model':db[_0x0adc('0x51')],'as':'Descriptions'}]});}return null;})[_0x0adc('0x24')](respondWithResult(_0x215847,null))[_0x0adc('0x42')](handleError(_0x215847,null));};exports[_0x0adc('0x52')]=function(_0x1dfc11,_0x141304,_0x17fdc9){var _0x353823=[{'name':_0x0adc('0x53'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x368120='';return db[_0x0adc('0x40')][_0x0adc('0x4a')]({'where':{'id':_0x1dfc11[_0x0adc('0x44')]['id']},'attributes':['id',_0x0adc('0x54'),_0x0adc('0x55'),_0x0adc('0x56'),'password',_0x0adc('0x57'),_0x0adc('0x58'),_0x0adc('0x59'),_0x0adc('0x5a')]})[_0x0adc('0x24')](handleEntityNotFound(_0x141304,null))[_0x0adc('0x24')](function(_0x48c597){if(_0x48c597){_0x368120=_0x48c597['remoteUri'];var _0x2ecc99=_0x368120['slice'](-0x1);if(_0x2ecc99==='/'){_0x368120=_0x368120[_0x0adc('0x5b')](0x0,_0x368120[_0x0adc('0x5c')](_0x2ecc99));}var _0x5ed466={'method':'GET','uri':util[_0x0adc('0x5d')]('%s/custom_fields',_0x368120),'headers':{'Content-Type':_0x0adc('0x5e'),'Accept':_0x0adc('0x5e')},'json':!![]};if(_0x48c597[_0x0adc('0x55')]===_0x0adc('0x5f')){_0x5ed466[_0x0adc('0x60')]['Authorization']=util[_0x0adc('0x5d')](_0x0adc('0x61'),new Buffer(util[_0x0adc('0x5d')]('%s:%s',_0x48c597['username'],_0x48c597[_0x0adc('0x62')]))[_0x0adc('0x63')](_0x0adc('0x64')));}return rp(_0x5ed466)[_0x0adc('0x24')](function(_0x365655){return _0x353823[_0x0adc('0x65')](_[_0x0adc('0x3d')](_0x365655[_0x0adc('0x66')]['entries'],function(_0x808483){return{'id':_0x808483[_0x0adc('0x26')],'name':_0x808483['name'],'type':_0x808483[_0x0adc('0x2b')],'active':_0x808483[_0x0adc('0x67')],'label':_0x808483['label'],'custom':!![]};}));});}})[_0x0adc('0x24')](function(_0x124a85){return{'count':_0x124a85[_0x0adc('0x34')],'rows':_0x124a85};})[_0x0adc('0x24')](respondWithResult(_0x141304,null))[_0x0adc('0x42')](function(_0x44a9af){var _0x4363e5=_0x1dfc11[_0x0adc('0x2d')][_0x0adc('0x68')]?0x1f4:_0x44a9af['statusCode']||0x1f4;logger[_0x0adc('0x69')](_0x0adc('0x6a'),_0x0adc('0x52'),_0x4363e5,JSON[_0x0adc('0x6b')](_0x44a9af));delete _0x44a9af[_0x0adc('0x26')];if(_0x4363e5===0x191){_0x4363e5=0x190;}_0x141304[_0x0adc('0x1a')](_0x4363e5)[_0x0adc('0x27')](_0x1dfc11[_0x0adc('0x2d')][_0x0adc('0x68')]?{'message':_0x0adc('0x6c'),'statusCode':_0x44a9af['statusCode']}:_0x44a9af);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index f1ab3c5..cbf6716 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 _0x5324=['bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5324,0x87));var _0x4532=function(_0x31e613,_0x5743c6){_0x31e613=_0x31e613-0x0;var _0x1c5bf6=_0x5324[_0x31e613];return _0x1c5bf6;};'use strict';var _=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var logger=require(_0x4532('0x2'))(_0x4532('0x3'));var moment=require(_0x4532('0x4'));var BPromise=require(_0x4532('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4532('0x6'));var rimraf=require(_0x4532('0x7'));var config=require(_0x4532('0x8'));var attributes=require(_0x4532('0x9'));var integrations=require(_0x4532('0xa'));module[_0x4532('0xb')]=function(_0x59b200,_0xd8f52f){return _0x59b200['define'](_0x4532('0xc'),attributes,{'tableName':_0x4532('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95ba=['../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0xaf662b,_0x496ede){var _0x34104e=function(_0x4ebb1b){while(--_0x4ebb1b){_0xaf662b['push'](_0xaf662b['shift']());}};_0x34104e(++_0x496ede);}(_0x95ba,0x1a9));var _0xa95b=function(_0x1790f3,_0x527f3d){_0x1790f3=_0x1790f3-0x0;var _0x386b9d=_0x95ba[_0x1790f3];return _0x386b9d;};'use strict';var _=require(_0xa95b('0x0'));var util=require(_0xa95b('0x1'));var logger=require(_0xa95b('0x2'))(_0xa95b('0x3'));var moment=require('moment');var BPromise=require(_0xa95b('0x4'));var rp=require(_0xa95b('0x5'));var fs=require('fs');var path=require(_0xa95b('0x6'));var rimraf=require(_0xa95b('0x7'));var config=require(_0xa95b('0x8'));var attributes=require(_0xa95b('0x9'));var integrations=require(_0xa95b('0xa'));module[_0xa95b('0xb')]=function(_0x249976,_0x1bf360){return _0x249976[_0xa95b('0xc')](_0xa95b('0xd'),attributes,{'tableName':_0xa95b('0xe'),'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 a284682..ea3016b 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 _0x8b50=['debug','where','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x230e10,_0x90aede){var _0x2f960f=function(_0xf7835a){while(--_0xf7835a){_0x230e10['push'](_0x230e10['shift']());}};_0x2f960f(++_0x90aede);}(_0x8b50,0x1bf));var _0x08b5=function(_0x19e0ce,_0x4b1c27){_0x19e0ce=_0x19e0ce-0x0;var _0x867c1e=_0x8b50[_0x19e0ce];return _0x867c1e;};'use strict';var _=require(_0x08b5('0x0'));var util=require(_0x08b5('0x1'));var moment=require(_0x08b5('0x2'));var BPromise=require(_0x08b5('0x3'));var rs=require(_0x08b5('0x4'));var fs=require('fs');var Redis=require(_0x08b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x08b5('0x6'));var logger=require('../../config/logger')(_0x08b5('0x7'));var config=require(_0x08b5('0x8'));var jayson=require(_0x08b5('0x9'));var client=jayson[_0x08b5('0xa')][_0x08b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4469c2,_0x2c0850,_0x58785e){return new BPromise(function(_0x2ea647,_0x24ae3e){return client[_0x08b5('0xc')](_0x4469c2,_0x58785e)[_0x08b5('0xd')](function(_0x5bb82e){logger[_0x08b5('0xe')](_0x08b5('0xf'),_0x2c0850,_0x08b5('0x10'));logger['debug'](_0x08b5('0x11'),_0x2c0850,_0x08b5('0x10'),JSON[_0x08b5('0x12')](_0x5bb82e));if(_0x5bb82e[_0x08b5('0x13')]){if(_0x5bb82e[_0x08b5('0x13')][_0x08b5('0x14')]===0x1f4){logger[_0x08b5('0x13')](_0x08b5('0xf'),_0x2c0850,_0x5bb82e[_0x08b5('0x13')][_0x08b5('0x15')]);return _0x24ae3e(_0x5bb82e[_0x08b5('0x13')][_0x08b5('0x15')]);}logger[_0x08b5('0x13')](_0x08b5('0xf'),_0x2c0850,_0x5bb82e[_0x08b5('0x13')][_0x08b5('0x15')]);return _0x2ea647(_0x5bb82e[_0x08b5('0x13')][_0x08b5('0x15')]);}else{logger[_0x08b5('0xe')](_0x08b5('0xf'),_0x2c0850,_0x08b5('0x10'));_0x2ea647(_0x5bb82e[_0x08b5('0x16')][_0x08b5('0x15')]);}})[_0x08b5('0x17')](function(_0x537a13){logger[_0x08b5('0x13')](_0x08b5('0xf'),_0x2c0850,_0x537a13);_0x24ae3e(_0x537a13);});});}exports[_0x08b5('0x18')]=function(_0x183fb4){var _0x156141=this;return new Promise(function(_0x5978a0,_0xd2f3cf){return db[_0x08b5('0x19')][_0x08b5('0x1a')]({'raw':_0x183fb4[_0x08b5('0x1b')]?_0x183fb4[_0x08b5('0x1b')][_0x08b5('0x1c')]===undefined?!![]:![]:!![],'where':_0x183fb4['options']?_0x183fb4[_0x08b5('0x1b')]['where']||null:null,'attributes':_0x183fb4['options']?_0x183fb4[_0x08b5('0x1b')][_0x08b5('0x1d')]||null:null,'limit':_0x183fb4[_0x08b5('0x1b')]?_0x183fb4[_0x08b5('0x1b')][_0x08b5('0x1e')]||null:null,'include':_0x183fb4[_0x08b5('0x1b')]?_0x183fb4[_0x08b5('0x1b')][_0x08b5('0x1f')]?_[_0x08b5('0x20')](_0x183fb4['options'][_0x08b5('0x1f')],function(_0x31c684){return{'model':db[_0x31c684[_0x08b5('0x21')]],'as':_0x31c684['as'],'attributes':_0x31c684[_0x08b5('0x1d')],'include':_0x31c684[_0x08b5('0x1f')]?_['map'](_0x31c684[_0x08b5('0x1f')],function(_0x1a684c){return{'model':db[_0x1a684c[_0x08b5('0x21')]],'as':_0x1a684c['as'],'attributes':_0x1a684c[_0x08b5('0x1d')],'include':_0x1a684c['include']?_[_0x08b5('0x20')](_0x1a684c[_0x08b5('0x1f')],function(_0x197835){return{'model':db[_0x197835['model']],'as':_0x197835['as'],'attributes':_0x197835['attributes']};}):[]};}):[]};}):[]:[]})[_0x08b5('0xd')](function(_0x28bfb2){logger[_0x08b5('0xe')](_0x08b5('0x18'),_0x183fb4);logger[_0x08b5('0x22')](_0x08b5('0x18'),_0x183fb4,JSON[_0x08b5('0x12')](_0x28bfb2));_0x5978a0(_0x28bfb2);})[_0x08b5('0x17')](function(_0x210927){logger['error'](_0x08b5('0x18'),_0x210927[_0x08b5('0x15')],_0x183fb4);_0xd2f3cf(_0x156141[_0x08b5('0x13')](0x1f4,_0x210927['message']));});});};exports['ShowDeskAccount']=function(_0x3f13a8){var _0x1dde29=this;return new Promise(function(_0x3d0049,_0x20debb){return db[_0x08b5('0x19')]['find']({'raw':_0x3f13a8['options']?_0x3f13a8[_0x08b5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f13a8[_0x08b5('0x1b')]?_0x3f13a8[_0x08b5('0x1b')][_0x08b5('0x23')]||null:null,'attributes':_0x3f13a8[_0x08b5('0x1b')]?_0x3f13a8[_0x08b5('0x1b')][_0x08b5('0x1d')]||null:null,'include':_0x3f13a8[_0x08b5('0x1b')]?_0x3f13a8[_0x08b5('0x1b')]['include']?_[_0x08b5('0x20')](_0x3f13a8[_0x08b5('0x1b')]['include'],function(_0x2be7e3){return{'model':db[_0x2be7e3[_0x08b5('0x21')]],'as':_0x2be7e3['as'],'attributes':_0x2be7e3[_0x08b5('0x1d')],'include':_0x2be7e3[_0x08b5('0x1f')]?_[_0x08b5('0x20')](_0x2be7e3['include'],function(_0x2e8cf9){return{'model':db[_0x2e8cf9[_0x08b5('0x21')]],'as':_0x2e8cf9['as'],'attributes':_0x2e8cf9[_0x08b5('0x1d')],'include':_0x2e8cf9[_0x08b5('0x1f')]?_[_0x08b5('0x20')](_0x2e8cf9[_0x08b5('0x1f')],function(_0x359afe){return{'model':db[_0x359afe['model']],'as':_0x359afe['as'],'attributes':_0x359afe['attributes']};}):[]};}):[]};}):[]:[]})[_0x08b5('0xd')](function(_0xf8f382){logger['info'](_0x08b5('0x24'),_0x3f13a8);logger['debug'](_0x08b5('0x24'),_0x3f13a8,JSON[_0x08b5('0x12')](_0xf8f382));_0x3d0049(_0xf8f382);})[_0x08b5('0x17')](function(_0x1994ca){logger[_0x08b5('0x13')]('ShowDeskAccount',_0x1994ca[_0x08b5('0x15')],_0x3f13a8);_0x20debb(_0x1dde29[_0x08b5('0x13')](0x1f4,_0x1994ca[_0x08b5('0x15')]));});});}; \ No newline at end of file +var _0xc75e=['include','map','model','GetDeskAccount','catch','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','DeskAccount','findAll','options','where','attributes','limit'];(function(_0x2ed429,_0x66b75a){var _0x18a52c=function(_0x463aef){while(--_0x463aef){_0x2ed429['push'](_0x2ed429['shift']());}};_0x18a52c(++_0x66b75a);}(_0xc75e,0x17c));var _0xec75=function(_0x1ed99b,_0x2e0fbd){_0x1ed99b=_0x1ed99b-0x0;var _0x1ac199=_0xc75e[_0x1ed99b];return _0x1ac199;};'use strict';var _=require(_0xec75('0x0'));var util=require(_0xec75('0x1'));var moment=require(_0xec75('0x2'));var BPromise=require(_0xec75('0x3'));var rs=require(_0xec75('0x4'));var fs=require('fs');var Redis=require(_0xec75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec75('0x6'));var logger=require(_0xec75('0x7'))(_0xec75('0x8'));var config=require(_0xec75('0x9'));var jayson=require(_0xec75('0xa'));var client=jayson['client'][_0xec75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f1110,_0xb6d201,_0xf0da77){return new BPromise(function(_0xfadbbc,_0xcf8077){return client['request'](_0x1f1110,_0xf0da77)[_0xec75('0xc')](function(_0x545048){logger[_0xec75('0xd')](_0xec75('0xe'),_0xb6d201,_0xec75('0xf'));logger[_0xec75('0x10')](_0xec75('0x11'),_0xb6d201,_0xec75('0xf'),JSON[_0xec75('0x12')](_0x545048));if(_0x545048['error']){if(_0x545048[_0xec75('0x13')]['code']===0x1f4){logger[_0xec75('0x13')](_0xec75('0xe'),_0xb6d201,_0x545048['error'][_0xec75('0x14')]);return _0xcf8077(_0x545048[_0xec75('0x13')][_0xec75('0x14')]);}logger['error'](_0xec75('0xe'),_0xb6d201,_0x545048[_0xec75('0x13')][_0xec75('0x14')]);return _0xfadbbc(_0x545048[_0xec75('0x13')][_0xec75('0x14')]);}else{logger[_0xec75('0xd')](_0xec75('0xe'),_0xb6d201,_0xec75('0xf'));_0xfadbbc(_0x545048[_0xec75('0x15')][_0xec75('0x14')]);}})['catch'](function(_0x4cfb68){logger[_0xec75('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb6d201,_0x4cfb68);_0xcf8077(_0x4cfb68);});});}exports['GetDeskAccount']=function(_0x3a9916){var _0x20ab84=this;return new Promise(function(_0x33e96e,_0x4f91c7){return db[_0xec75('0x16')][_0xec75('0x17')]({'raw':_0x3a9916[_0xec75('0x18')]?_0x3a9916[_0xec75('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3a9916[_0xec75('0x18')]?_0x3a9916['options'][_0xec75('0x19')]||null:null,'attributes':_0x3a9916[_0xec75('0x18')]?_0x3a9916[_0xec75('0x18')][_0xec75('0x1a')]||null:null,'limit':_0x3a9916[_0xec75('0x18')]?_0x3a9916[_0xec75('0x18')][_0xec75('0x1b')]||null:null,'include':_0x3a9916[_0xec75('0x18')]?_0x3a9916['options'][_0xec75('0x1c')]?_[_0xec75('0x1d')](_0x3a9916[_0xec75('0x18')][_0xec75('0x1c')],function(_0x1a3a21){return{'model':db[_0x1a3a21[_0xec75('0x1e')]],'as':_0x1a3a21['as'],'attributes':_0x1a3a21[_0xec75('0x1a')],'include':_0x1a3a21[_0xec75('0x1c')]?_[_0xec75('0x1d')](_0x1a3a21[_0xec75('0x1c')],function(_0x4e3308){return{'model':db[_0x4e3308[_0xec75('0x1e')]],'as':_0x4e3308['as'],'attributes':_0x4e3308[_0xec75('0x1a')],'include':_0x4e3308[_0xec75('0x1c')]?_[_0xec75('0x1d')](_0x4e3308[_0xec75('0x1c')],function(_0x2c2fe7){return{'model':db[_0x2c2fe7[_0xec75('0x1e')]],'as':_0x2c2fe7['as'],'attributes':_0x2c2fe7[_0xec75('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xec75('0xc')](function(_0x771bc){logger[_0xec75('0xd')](_0xec75('0x1f'),_0x3a9916);logger['debug'](_0xec75('0x1f'),_0x3a9916,JSON[_0xec75('0x12')](_0x771bc));_0x33e96e(_0x771bc);})[_0xec75('0x20')](function(_0x2e73dc){logger['error']('GetDeskAccount',_0x2e73dc[_0xec75('0x14')],_0x3a9916);_0x4f91c7(_0x20ab84[_0xec75('0x13')](0x1f4,_0x2e73dc[_0xec75('0x14')]));});});};exports[_0xec75('0x21')]=function(_0x37eac4){var _0x1ca47c=this;return new Promise(function(_0x307a11,_0x93500a){return db[_0xec75('0x16')]['find']({'raw':_0x37eac4[_0xec75('0x18')]?_0x37eac4['options']['raw']===undefined?!![]:![]:!![],'where':_0x37eac4['options']?_0x37eac4[_0xec75('0x18')][_0xec75('0x19')]||null:null,'attributes':_0x37eac4[_0xec75('0x18')]?_0x37eac4[_0xec75('0x18')][_0xec75('0x1a')]||null:null,'include':_0x37eac4[_0xec75('0x18')]?_0x37eac4['options'][_0xec75('0x1c')]?_['map'](_0x37eac4['options']['include'],function(_0x3285c7){return{'model':db[_0x3285c7['model']],'as':_0x3285c7['as'],'attributes':_0x3285c7['attributes'],'include':_0x3285c7[_0xec75('0x1c')]?_['map'](_0x3285c7[_0xec75('0x1c')],function(_0x5523f4){return{'model':db[_0x5523f4['model']],'as':_0x5523f4['as'],'attributes':_0x5523f4['attributes'],'include':_0x5523f4[_0xec75('0x1c')]?_['map'](_0x5523f4[_0xec75('0x1c')],function(_0x896f5a){return{'model':db[_0x896f5a['model']],'as':_0x896f5a['as'],'attributes':_0x896f5a[_0xec75('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ce1ce){logger[_0xec75('0xd')]('ShowDeskAccount',_0x37eac4);logger['debug']('ShowDeskAccount',_0x37eac4,JSON['stringify'](_0x3ce1ce));_0x307a11(_0x3ce1ce);})['catch'](function(_0x1676dc){logger['error'](_0xec75('0x21'),_0x1676dc[_0xec75('0x14')],_0x37eac4);_0x93500a(_0x1ca47c[_0xec75('0x13')](0x1f4,_0x1676dc['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5eac733..5a625d3 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e35c9,_0x3e3631){var _0x3a8de0=function(_0x5691b2){while(--_0x5691b2){_0x4e35c9['push'](_0x4e35c9['shift']());}};_0x3a8de0(++_0x3e3631);}(_0x008c,0x188));var _0xc008=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x008c[_0xd7b0a4];return _0x184e9e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d8132,_0x47eca8){var _0x5bf0ca=function(_0x46f66c){while(--_0x46f66c){_0x4d8132['push'](_0x4d8132['shift']());}};_0x5bf0ca(++_0x47eca8);}(_0x008c,0x188));var _0xc008=function(_0x3ffb80,_0x209661){_0x3ffb80=_0x3ffb80-0x0;var _0x3a8a4c=_0x008c[_0x3ffb80];return _0x3a8a4c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a294d67..aaa95e4 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 _0xb8ea=['sequelize','exports','STRING'];(function(_0x372c7f,_0x124b2f){var _0x486adf=function(_0x2e9cc3){while(--_0x2e9cc3){_0x372c7f['push'](_0x372c7f['shift']());}};_0x486adf(++_0x124b2f);}(_0xb8ea,0x174));var _0xab8e=function(_0x626ab7,_0x3d8964){_0x626ab7=_0x626ab7-0x0;var _0x48b72c=_0xb8ea[_0x626ab7];return _0x48b72c;};'use strict';var Sequelize=require(_0xab8e('0x0'));module[_0xab8e('0x1')]={'name':{'type':Sequelize[_0xab8e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc063=['STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc063,0x6b));var _0x3c06=function(_0x1dee0c,_0x13b016){_0x1dee0c=_0x1dee0c-0x0;var _0x12d97e=_0xc063[_0x1dee0c];return _0x12d97e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3c06('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index cacc7ee..41b6ad1 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 _0xd65e=['fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','keys','filters','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','DeskConfiguration','includeAll','include','rows','catch','show','create','body','find','params','getFields','DeskField','order','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir'];(function(_0x2913a7,_0x4268b7){var _0x59e65c=function(_0x51f57b){while(--_0x51f57b){_0x2913a7['push'](_0x2913a7['shift']());}};_0x59e65c(++_0x4268b7);}(_0xd65e,0x1a1));var _0xed65=function(_0x3f1b38,_0x584f4e){_0x3f1b38=_0x3f1b38-0x0;var _0x569583=_0xd65e[_0x3f1b38];return _0x569583;};'use strict';var emlformat=require(_0xed65('0x0'));var rimraf=require(_0xed65('0x1'));var zipdir=require(_0xed65('0x2'));var jsonpatch=require(_0xed65('0x3'));var rp=require(_0xed65('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed65('0x5'));var util=require(_0xed65('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xed65('0x7'));var ejs=require(_0xed65('0x8'));var fs=require('fs');var fs_extra=require(_0xed65('0x9'));var _=require(_0xed65('0xa'));var squel=require(_0xed65('0xb'));var crypto=require(_0xed65('0xc'));var jsforce=require(_0xed65('0xd'));var deskjs=require(_0xed65('0xe'));var toCsv=require(_0xed65('0x7'));var querystring=require(_0xed65('0xf'));var Papa=require(_0xed65('0x10'));var Redis=require(_0xed65('0x11'));var authService=require(_0xed65('0x12'));var qs=require(_0xed65('0x13'));var as=require(_0xed65('0x14'));var hardwareService=require(_0xed65('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xed65('0x16'));var config=require(_0xed65('0x17'));var licenseUtil=require(_0xed65('0x18'));var db=require(_0xed65('0x19'))['db'];function respondWithStatusCode(_0x3ca2fb,_0x2afdaa){_0x2afdaa=_0x2afdaa||0xcc;return function(_0x7eef5b){if(_0x7eef5b){return _0x3ca2fb[_0xed65('0x1a')](_0x2afdaa);}return _0x3ca2fb[_0xed65('0x1b')](_0x2afdaa)['end']();};}function respondWithResult(_0x341528,_0x4e37f7){_0x4e37f7=_0x4e37f7||0xc8;return function(_0x3128dc){if(_0x3128dc){return _0x341528[_0xed65('0x1b')](_0x4e37f7)['json'](_0x3128dc);}};}function respondWithFilteredResult(_0x1b70a5,_0xa4e5e3){return function(_0xc716b8){if(_0xc716b8){var _0x1bc1b5=typeof _0xa4e5e3[_0xed65('0x1c')]===_0xed65('0x1d')&&typeof _0xa4e5e3[_0xed65('0x1e')]===_0xed65('0x1d');var _0x527014=_0xc716b8[_0xed65('0x1f')];var _0x3ec6e6=_0x1bc1b5?0x0:_0xa4e5e3[_0xed65('0x1c')];var _0x5698e8=_0x1bc1b5?_0xc716b8['count']:_0xa4e5e3[_0xed65('0x1c')]+_0xa4e5e3['limit'];var _0x52b30f;if(_0x5698e8>=_0x527014){_0x5698e8=_0x527014;_0x52b30f=0xc8;}else{_0x52b30f=0xce;}_0x1b70a5[_0xed65('0x1b')](_0x52b30f);return _0x1b70a5[_0xed65('0x20')](_0xed65('0x21'),_0x3ec6e6+'-'+_0x5698e8+'/'+_0x527014)['json'](_0xc716b8);}return null;};}function patchUpdates(_0x4b7239){return function(_0x156164){try{jsonpatch['apply'](_0x156164,_0x4b7239,!![]);}catch(_0x2f73aa){return BPromise[_0xed65('0x22')](_0x2f73aa);}return _0x156164[_0xed65('0x23')]();};}function saveUpdates(_0x4cbfc2,_0x928d80){return function(_0x2fa1cc){if(_0x2fa1cc){return _0x2fa1cc[_0xed65('0x24')](_0x4cbfc2)[_0xed65('0x25')](function(_0x1d2909){return _0x1d2909;});}return null;};}function removeEntity(_0x465f23,_0x8f84fb){return function(_0x15af7b){if(_0x15af7b){return _0x15af7b[_0xed65('0x26')]()[_0xed65('0x25')](function(){_0x465f23[_0xed65('0x1b')](0xcc)[_0xed65('0x27')]();});}};}function handleEntityNotFound(_0x40d486,_0x140daa){return function(_0xa214b5){if(!_0xa214b5){_0x40d486[_0xed65('0x1a')](0x194);}return _0xa214b5;};}function handleError(_0x541491,_0x4cf46e){_0x4cf46e=_0x4cf46e||0x1f4;return function(_0x400a0b){logger[_0xed65('0x28')](_0x400a0b['stack']);if(_0x400a0b[_0xed65('0x29')]){delete _0x400a0b[_0xed65('0x29')];}_0x541491[_0xed65('0x1b')](_0x4cf46e)[_0xed65('0x2a')](_0x400a0b);};}exports[_0xed65('0x2b')]=function(_0x1c1109,_0x11e3ba){var _0x10f11f={},_0xe499a7={},_0x3ea5b0={'count':0x0,'rows':[]};var _0x4d772b=_[_0xed65('0x2c')](db['DeskConfiguration'][_0xed65('0x2d')],function(_0x31ea58){return{'name':_0x31ea58['fieldName'],'type':_0x31ea58[_0xed65('0x2e')][_0xed65('0x2f')]};});_0xe499a7['model']=_[_0xed65('0x2c')](_0x4d772b,_0xed65('0x29'));_0xe499a7['query']=_[_0xed65('0x30')](_0x1c1109['query']);_0xe499a7[_0xed65('0x31')]=_['intersection'](_0xe499a7['model'],_0xe499a7[_0xed65('0x32')]);_0x10f11f[_0xed65('0x33')]=_[_0xed65('0x34')](_0xe499a7[_0xed65('0x35')],qs[_0xed65('0x36')](_0x1c1109[_0xed65('0x32')][_0xed65('0x36')]));_0x10f11f[_0xed65('0x33')]=_0x10f11f[_0xed65('0x33')][_0xed65('0x37')]?_0x10f11f[_0xed65('0x33')]:_0xe499a7['model'];if(!_0x1c1109['query'][_0xed65('0x38')](_0xed65('0x39'))){_0x10f11f[_0xed65('0x1e')]=qs['limit'](_0x1c1109[_0xed65('0x32')][_0xed65('0x1e')]);_0x10f11f[_0xed65('0x1c')]=qs[_0xed65('0x1c')](_0x1c1109[_0xed65('0x32')][_0xed65('0x1c')]);}_0x10f11f['order']=qs[_0xed65('0x3a')](_0x1c1109[_0xed65('0x32')]['sort']);_0x10f11f[_0xed65('0x3b')]=qs[_0xed65('0x31')](_[_0xed65('0x3c')](_0x1c1109[_0xed65('0x32')],_0xe499a7[_0xed65('0x31')]),_0x4d772b);if(_0x1c1109['query']['filter']){_0x10f11f['where']=_[_0xed65('0x3d')](_0x10f11f[_0xed65('0x3b')],{'$or':_[_0xed65('0x2c')](_0x4d772b,function(_0x1aeefa){if(_0x1aeefa['type']!=='VIRTUAL'){var _0x1f737a={};_0x1f737a[_0x1aeefa[_0xed65('0x29')]]={'$like':'%'+_0x1c1109[_0xed65('0x32')][_0xed65('0x3e')]+'%'};return _0x1f737a;}})});}_0x10f11f=_[_0xed65('0x3d')]({},_0x10f11f,_0x1c1109[_0xed65('0x3f')]);var _0x27533d={'where':_0x10f11f[_0xed65('0x3b')]};return db[_0xed65('0x40')]['count'](_0x27533d)['then'](function(_0x163256){_0x3ea5b0[_0xed65('0x1f')]=_0x163256;if(_0x1c1109[_0xed65('0x32')][_0xed65('0x41')]){_0x10f11f[_0xed65('0x42')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x10f11f);})['then'](function(_0x4ed0b1){_0x3ea5b0[_0xed65('0x43')]=_0x4ed0b1;return _0x3ea5b0;})[_0xed65('0x25')](respondWithFilteredResult(_0x11e3ba,_0x10f11f))[_0xed65('0x44')](handleError(_0x11e3ba,null));};exports[_0xed65('0x45')]=function(_0x48a278,_0x105142){var _0x5c0869={'raw':![],'where':{'id':_0x48a278['params']['id']}},_0x4f5137={};_0x4f5137[_0xed65('0x35')]=_['keys'](db[_0xed65('0x40')][_0xed65('0x2d')]);_0x4f5137['query']=_[_0xed65('0x30')](_0x48a278[_0xed65('0x32')]);_0x4f5137[_0xed65('0x31')]=_['intersection'](_0x4f5137[_0xed65('0x35')],_0x4f5137[_0xed65('0x32')]);_0x5c0869[_0xed65('0x33')]=_[_0xed65('0x34')](_0x4f5137[_0xed65('0x35')],qs[_0xed65('0x36')](_0x48a278[_0xed65('0x32')][_0xed65('0x36')]));_0x5c0869[_0xed65('0x33')]=_0x5c0869[_0xed65('0x33')][_0xed65('0x37')]?_0x5c0869[_0xed65('0x33')]:_0x4f5137[_0xed65('0x35')];if(_0x48a278[_0xed65('0x32')][_0xed65('0x41')]){_0x5c0869[_0xed65('0x42')]=[{'all':!![]}];}_0x5c0869=_[_0xed65('0x3d')]({},_0x5c0869,_0x48a278['options']);return db['DeskConfiguration']['find'](_0x5c0869)[_0xed65('0x25')](handleEntityNotFound(_0x105142,null))[_0xed65('0x25')](respondWithResult(_0x105142,null))[_0xed65('0x44')](handleError(_0x105142,null));};exports[_0xed65('0x46')]=function(_0x9abad7,_0x20fdc1){return db[_0xed65('0x40')][_0xed65('0x46')](_0x9abad7[_0xed65('0x47')],{})['then'](respondWithResult(_0x20fdc1,0xc9))[_0xed65('0x44')](handleError(_0x20fdc1,null));};exports[_0xed65('0x24')]=function(_0x48bacb,_0x1cd79b){if(_0x48bacb[_0xed65('0x47')]['id']){delete _0x48bacb[_0xed65('0x47')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x48bacb['params']['id']}})[_0xed65('0x25')](handleEntityNotFound(_0x1cd79b,null))[_0xed65('0x25')](saveUpdates(_0x48bacb['body'],null))['then'](respondWithResult(_0x1cd79b,null))[_0xed65('0x44')](handleError(_0x1cd79b,null));};exports[_0xed65('0x26')]=function(_0x37cf24,_0x5c8280){return db[_0xed65('0x40')][_0xed65('0x48')]({'where':{'id':_0x37cf24[_0xed65('0x49')]['id']}})[_0xed65('0x25')](handleEntityNotFound(_0x5c8280,null))[_0xed65('0x25')](removeEntity(_0x5c8280,null))[_0xed65('0x44')](handleError(_0x5c8280,null));};exports[_0xed65('0x4a')]=function(_0x29026c,_0x5b1ae0,_0x4e30c5){var _0x41a0e6={};var _0x5aa7a3={};var _0x4b00bf;var _0x104f24;return db[_0xed65('0x40')]['findOne']({'where':{'id':_0x29026c[_0xed65('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b1ae0,null))[_0xed65('0x25')](function(_0x1a2b3e){if(_0x1a2b3e){_0x4b00bf=_0x1a2b3e;_0x5aa7a3[_0xed65('0x35')]=_[_0xed65('0x30')](db[_0xed65('0x4b')][_0xed65('0x2d')]);_0x5aa7a3[_0xed65('0x32')]=_[_0xed65('0x30')](_0x29026c[_0xed65('0x32')]);_0x5aa7a3[_0xed65('0x31')]=_[_0xed65('0x34')](_0x5aa7a3['model'],_0x5aa7a3[_0xed65('0x32')]);_0x41a0e6[_0xed65('0x33')]=_[_0xed65('0x34')](_0x5aa7a3[_0xed65('0x35')],qs['fields'](_0x29026c[_0xed65('0x32')][_0xed65('0x36')]));_0x41a0e6[_0xed65('0x33')]=_0x41a0e6['attributes']['length']?_0x41a0e6['attributes']:_0x5aa7a3[_0xed65('0x35')];_0x41a0e6[_0xed65('0x4c')]=qs[_0xed65('0x3a')](_0x29026c[_0xed65('0x32')][_0xed65('0x3a')]);_0x41a0e6[_0xed65('0x3b')]=qs[_0xed65('0x31')](_[_0xed65('0x3c')](_0x29026c['query'],_0x5aa7a3[_0xed65('0x31')]));if(_0x29026c['query'][_0xed65('0x3e')]){_0x41a0e6['where']=_['merge'](_0x41a0e6[_0xed65('0x3b')],{'$or':_['map'](_0x41a0e6[_0xed65('0x33')],function(_0x1759bb){var _0x7a7dc4={};_0x7a7dc4[_0x1759bb]={'$like':'%'+_0x29026c[_0xed65('0x32')][_0xed65('0x3e')]+'%'};return _0x7a7dc4;})});}_0x41a0e6=_[_0xed65('0x3d')]({},_0x41a0e6,_0x29026c[_0xed65('0x3f')]);return _0x4b00bf[_0xed65('0x4a')](_0x41a0e6);}})[_0xed65('0x25')](function(_0x2ae220){if(_0x2ae220){_0x104f24=_0x2ae220[_0xed65('0x37')];if(!_0x29026c[_0xed65('0x32')]['hasOwnProperty'](_0xed65('0x39'))){_0x41a0e6['limit']=qs[_0xed65('0x1e')](_0x29026c[_0xed65('0x32')][_0xed65('0x1e')]);_0x41a0e6[_0xed65('0x1c')]=qs[_0xed65('0x1c')](_0x29026c[_0xed65('0x32')][_0xed65('0x1c')]);}return _0x4b00bf[_0xed65('0x4a')](_0x41a0e6);}})[_0xed65('0x25')](function(_0x50af1a){if(_0x50af1a){return _0x50af1a?{'count':_0x104f24,'rows':_0x50af1a}:null;}})[_0xed65('0x25')](respondWithResult(_0x5b1ae0,null))['catch'](handleError(_0x5b1ae0,null));};exports['getSubjects']=function(_0x582e26,_0x862c9d,_0x3e331b){var _0x40c074={};var _0x3be62c={};var _0x2b5ca3;var _0x177cf6;return db[_0xed65('0x40')][_0xed65('0x4d')]({'where':{'id':_0x582e26[_0xed65('0x49')]['id']}})['then'](handleEntityNotFound(_0x862c9d,null))[_0xed65('0x25')](function(_0x1f05de){if(_0x1f05de){_0x2b5ca3=_0x1f05de;_0x3be62c[_0xed65('0x35')]=_[_0xed65('0x30')](db['DeskField']['rawAttributes']);_0x3be62c[_0xed65('0x32')]=_[_0xed65('0x30')](_0x582e26[_0xed65('0x32')]);_0x3be62c['filters']=_[_0xed65('0x34')](_0x3be62c[_0xed65('0x35')],_0x3be62c[_0xed65('0x32')]);_0x40c074[_0xed65('0x33')]=_[_0xed65('0x34')](_0x3be62c[_0xed65('0x35')],qs[_0xed65('0x36')](_0x582e26[_0xed65('0x32')][_0xed65('0x36')]));_0x40c074['attributes']=_0x40c074['attributes']['length']?_0x40c074['attributes']:_0x3be62c[_0xed65('0x35')];_0x40c074['order']=qs[_0xed65('0x3a')](_0x582e26[_0xed65('0x32')][_0xed65('0x3a')]);_0x40c074[_0xed65('0x3b')]=qs[_0xed65('0x31')](_[_0xed65('0x3c')](_0x582e26[_0xed65('0x32')],_0x3be62c[_0xed65('0x31')]));if(_0x582e26[_0xed65('0x32')][_0xed65('0x3e')]){_0x40c074[_0xed65('0x3b')]=_[_0xed65('0x3d')](_0x40c074[_0xed65('0x3b')],{'$or':_[_0xed65('0x2c')](_0x40c074[_0xed65('0x33')],function(_0x47b51e){var _0x332cdb={};_0x332cdb[_0x47b51e]={'$like':'%'+_0x582e26['query'][_0xed65('0x3e')]+'%'};return _0x332cdb;})});}_0x40c074=_['merge']({},_0x40c074,_0x582e26[_0xed65('0x3f')]);return _0x2b5ca3['getSubjects'](_0x40c074);}})['then'](function(_0x148837){if(_0x148837){_0x177cf6=_0x148837[_0xed65('0x37')];if(!_0x582e26[_0xed65('0x32')][_0xed65('0x38')](_0xed65('0x39'))){_0x40c074[_0xed65('0x1e')]=qs[_0xed65('0x1e')](_0x582e26['query'][_0xed65('0x1e')]);_0x40c074['offset']=qs[_0xed65('0x1c')](_0x582e26[_0xed65('0x32')][_0xed65('0x1c')]);}return _0x2b5ca3[_0xed65('0x4e')](_0x40c074);}})[_0xed65('0x25')](function(_0x5d65c9){if(_0x5d65c9){return _0x5d65c9?{'count':_0x177cf6,'rows':_0x5d65c9}:null;}})[_0xed65('0x25')](respondWithResult(_0x862c9d,null))[_0xed65('0x44')](handleError(_0x862c9d,null));};exports['getDescriptions']=function(_0x3adfa5,_0x3a4239,_0x22c3de){var _0x14be9c={};var _0x4052e4={};var _0x33b345;var _0x45568c;return db['DeskConfiguration'][_0xed65('0x4d')]({'where':{'id':_0x3adfa5[_0xed65('0x49')]['id']}})[_0xed65('0x25')](handleEntityNotFound(_0x3a4239,null))['then'](function(_0x46fa83){if(_0x46fa83){_0x33b345=_0x46fa83;_0x4052e4[_0xed65('0x35')]=_['keys'](db[_0xed65('0x4b')][_0xed65('0x2d')]);_0x4052e4['query']=_[_0xed65('0x30')](_0x3adfa5[_0xed65('0x32')]);_0x4052e4[_0xed65('0x31')]=_[_0xed65('0x34')](_0x4052e4[_0xed65('0x35')],_0x4052e4[_0xed65('0x32')]);_0x14be9c[_0xed65('0x33')]=_['intersection'](_0x4052e4[_0xed65('0x35')],qs['fields'](_0x3adfa5[_0xed65('0x32')][_0xed65('0x36')]));_0x14be9c[_0xed65('0x33')]=_0x14be9c[_0xed65('0x33')]['length']?_0x14be9c['attributes']:_0x4052e4[_0xed65('0x35')];_0x14be9c[_0xed65('0x4c')]=qs[_0xed65('0x3a')](_0x3adfa5[_0xed65('0x32')][_0xed65('0x3a')]);_0x14be9c[_0xed65('0x3b')]=qs[_0xed65('0x31')](_[_0xed65('0x3c')](_0x3adfa5[_0xed65('0x32')],_0x4052e4['filters']));if(_0x3adfa5['query'][_0xed65('0x3e')]){_0x14be9c[_0xed65('0x3b')]=_['merge'](_0x14be9c[_0xed65('0x3b')],{'$or':_[_0xed65('0x2c')](_0x14be9c[_0xed65('0x33')],function(_0xa163a5){var _0x2f45e6={};_0x2f45e6[_0xa163a5]={'$like':'%'+_0x3adfa5[_0xed65('0x32')][_0xed65('0x3e')]+'%'};return _0x2f45e6;})});}_0x14be9c=_[_0xed65('0x3d')]({},_0x14be9c,_0x3adfa5['options']);return _0x33b345[_0xed65('0x4f')](_0x14be9c);}})[_0xed65('0x25')](function(_0xa79dc5){if(_0xa79dc5){_0x45568c=_0xa79dc5[_0xed65('0x37')];if(!_0x3adfa5[_0xed65('0x32')][_0xed65('0x38')](_0xed65('0x39'))){_0x14be9c[_0xed65('0x1e')]=qs['limit'](_0x3adfa5['query'][_0xed65('0x1e')]);_0x14be9c[_0xed65('0x1c')]=qs[_0xed65('0x1c')](_0x3adfa5[_0xed65('0x32')][_0xed65('0x1c')]);}return _0x33b345[_0xed65('0x4f')](_0x14be9c);}})[_0xed65('0x25')](function(_0x537cb0){if(_0x537cb0){return _0x537cb0?{'count':_0x45568c,'rows':_0x537cb0}:null;}})[_0xed65('0x25')](respondWithResult(_0x3a4239,null))[_0xed65('0x44')](handleError(_0x3a4239,null));};exports[_0xed65('0x50')]=function(_0x41b810,_0x2c9044,_0x30b1dd){var _0x12287d={};var _0x115cf6={};var _0x558272;var _0x565d92;return db[_0xed65('0x40')][_0xed65('0x4d')]({'where':{'id':_0x41b810['params']['id']}})[_0xed65('0x25')](handleEntityNotFound(_0x2c9044,null))[_0xed65('0x25')](function(_0x55e35e){if(_0x55e35e){_0x558272=_0x55e35e;_0x115cf6[_0xed65('0x35')]=_[_0xed65('0x30')](db[_0xed65('0x51')]['rawAttributes']);_0x115cf6[_0xed65('0x32')]=_[_0xed65('0x30')](_0x41b810[_0xed65('0x32')]);_0x115cf6[_0xed65('0x31')]=_[_0xed65('0x34')](_0x115cf6['model'],_0x115cf6[_0xed65('0x32')]);_0x12287d[_0xed65('0x33')]=_[_0xed65('0x34')](_0x115cf6[_0xed65('0x35')],qs[_0xed65('0x36')](_0x41b810[_0xed65('0x32')]['fields']));_0x12287d[_0xed65('0x33')]=_0x12287d[_0xed65('0x33')][_0xed65('0x37')]?_0x12287d[_0xed65('0x33')]:_0x115cf6['model'];_0x12287d[_0xed65('0x4c')]=qs[_0xed65('0x3a')](_0x41b810['query']['sort']);_0x12287d[_0xed65('0x3b')]=qs[_0xed65('0x31')](_[_0xed65('0x3c')](_0x41b810['query'],_0x115cf6[_0xed65('0x31')]));if(_0x41b810[_0xed65('0x32')][_0xed65('0x3e')]){_0x12287d[_0xed65('0x3b')]=_[_0xed65('0x3d')](_0x12287d[_0xed65('0x3b')],{'$or':_[_0xed65('0x2c')](_0x12287d[_0xed65('0x33')],function(_0x2c27cc){var _0xb6887f={};_0xb6887f[_0x2c27cc]={'$like':'%'+_0x41b810[_0xed65('0x32')][_0xed65('0x3e')]+'%'};return _0xb6887f;})});}_0x12287d=_[_0xed65('0x3d')]({},_0x12287d,_0x41b810[_0xed65('0x3f')]);return _0x558272['getTags'](_0x12287d);}})[_0xed65('0x25')](function(_0x5183c6){if(_0x5183c6){_0x565d92=_0x5183c6[_0xed65('0x37')];if(!_0x41b810[_0xed65('0x32')][_0xed65('0x38')]('nolimit')){_0x12287d[_0xed65('0x1e')]=qs[_0xed65('0x1e')](_0x41b810['query'][_0xed65('0x1e')]);_0x12287d['offset']=qs['offset'](_0x41b810[_0xed65('0x32')][_0xed65('0x1c')]);}return _0x558272[_0xed65('0x50')](_0x12287d);}})[_0xed65('0x25')](function(_0x40e59d){if(_0x40e59d){return _0x40e59d?{'count':_0x565d92,'rows':_0x40e59d}:null;}})['then'](respondWithResult(_0x2c9044,null))[_0xed65('0x44')](handleError(_0x2c9044,null));};exports['setTags']=function(_0x386236,_0x925955,_0x519f3f){if(_0x386236[_0xed65('0x47')]['id']){delete _0x386236[_0xed65('0x47')]['id'];}return db[_0xed65('0x40')]['findOne']({'where':{'id':_0x386236[_0xed65('0x49')]['id']}})[_0xed65('0x25')](handleEntityNotFound(_0x925955,null))[_0xed65('0x25')](function(_0x1128e6){if(_0x1128e6){return _0x1128e6[_0xed65('0x52')](_0x386236['body'][_0xed65('0x53')]||[]);}return null;})[_0xed65('0x25')](respondWithResult(_0x925955,null))[_0xed65('0x44')](handleError(_0x925955,null));}; \ No newline at end of file +var _0x18bd=['destroy','then','end','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','keys','length','includeAll','options','find','create','catch','body','params','getFields','DeskField','order','sort','nolimit','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','update'];(function(_0x3b2bf3,_0x35a6c6){var _0x470b7e=function(_0x3081e){while(--_0x3081e){_0x3b2bf3['push'](_0x3b2bf3['shift']());}};_0x470b7e(++_0x35a6c6);}(_0x18bd,0x7b));var _0xd18b=function(_0xb9ca38,_0x2e9368){_0xb9ca38=_0xb9ca38-0x0;var _0x54663f=_0x18bd[_0xb9ca38];return _0x54663f;};'use strict';var emlformat=require(_0xd18b('0x0'));var rimraf=require(_0xd18b('0x1'));var zipdir=require(_0xd18b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd18b('0x3'));var Mustache=require(_0xd18b('0x4'));var util=require(_0xd18b('0x5'));var path=require(_0xd18b('0x6'));var sox=require('sox');var csv=require(_0xd18b('0x7'));var ejs=require(_0xd18b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd18b('0x9'));var squel=require(_0xd18b('0xa'));var crypto=require(_0xd18b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd18b('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd18b('0xd'));var hardwareService=require(_0xd18b('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd18b('0xf'));var licenseUtil=require(_0xd18b('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcf13,_0x418b35){_0x418b35=_0x418b35||0xcc;return function(_0x2ec544){if(_0x2ec544){return _0x3bcf13[_0xd18b('0x11')](_0x418b35);}return _0x3bcf13[_0xd18b('0x12')](_0x418b35)['end']();};}function respondWithResult(_0x577d0c,_0x3967b0){_0x3967b0=_0x3967b0||0xc8;return function(_0xe90964){if(_0xe90964){return _0x577d0c['status'](_0x3967b0)[_0xd18b('0x13')](_0xe90964);}};}function respondWithFilteredResult(_0x2f0dd8,_0x235f6c){return function(_0x2df45f){if(_0x2df45f){var _0x1a5133=typeof _0x235f6c[_0xd18b('0x14')]==='undefined'&&typeof _0x235f6c[_0xd18b('0x15')]===_0xd18b('0x16');var _0x47a8a0=_0x2df45f[_0xd18b('0x17')];var _0x3a83b0=_0x1a5133?0x0:_0x235f6c[_0xd18b('0x14')];var _0x1704bf=_0x1a5133?_0x2df45f[_0xd18b('0x17')]:_0x235f6c[_0xd18b('0x14')]+_0x235f6c[_0xd18b('0x15')];var _0x4c4af3;if(_0x1704bf>=_0x47a8a0){_0x1704bf=_0x47a8a0;_0x4c4af3=0xc8;}else{_0x4c4af3=0xce;}_0x2f0dd8['status'](_0x4c4af3);return _0x2f0dd8[_0xd18b('0x18')]('Content-Range',_0x3a83b0+'-'+_0x1704bf+'/'+_0x47a8a0)[_0xd18b('0x13')](_0x2df45f);}return null;};}function patchUpdates(_0x4f9039){return function(_0x1e17d5){try{jsonpatch['apply'](_0x1e17d5,_0x4f9039,!![]);}catch(_0x269809){return BPromise[_0xd18b('0x19')](_0x269809);}return _0x1e17d5['save']();};}function saveUpdates(_0x270455,_0x289500){return function(_0x4a2567){if(_0x4a2567){return _0x4a2567[_0xd18b('0x1a')](_0x270455)['then'](function(_0x4fbaf8){return _0x4fbaf8;});}return null;};}function removeEntity(_0x27009c,_0xce0de1){return function(_0x25a426){if(_0x25a426){return _0x25a426[_0xd18b('0x1b')]()[_0xd18b('0x1c')](function(){_0x27009c[_0xd18b('0x12')](0xcc)[_0xd18b('0x1d')]();});}};}function handleEntityNotFound(_0x2b870c,_0x1c4ca9){return function(_0xd9471f){if(!_0xd9471f){_0x2b870c[_0xd18b('0x11')](0x194);}return _0xd9471f;};}function handleError(_0x42fd94,_0x2c4b01){_0x2c4b01=_0x2c4b01||0x1f4;return function(_0x3f695e){logger[_0xd18b('0x1e')](_0x3f695e['stack']);if(_0x3f695e[_0xd18b('0x1f')]){delete _0x3f695e[_0xd18b('0x1f')];}_0x42fd94['status'](_0x2c4b01)[_0xd18b('0x20')](_0x3f695e);};}exports[_0xd18b('0x21')]=function(_0x9d386b,_0x34bab6){var _0xc34b0e={},_0x507e7e={},_0x53f11d={'count':0x0,'rows':[]};var _0x32822c=_[_0xd18b('0x22')](db[_0xd18b('0x23')][_0xd18b('0x24')],function(_0x14c5dd){return{'name':_0x14c5dd[_0xd18b('0x25')],'type':_0x14c5dd[_0xd18b('0x26')][_0xd18b('0x27')]};});_0x507e7e[_0xd18b('0x28')]=_[_0xd18b('0x22')](_0x32822c,_0xd18b('0x1f'));_0x507e7e[_0xd18b('0x29')]=_['keys'](_0x9d386b[_0xd18b('0x29')]);_0x507e7e['filters']=_[_0xd18b('0x2a')](_0x507e7e['model'],_0x507e7e[_0xd18b('0x29')]);_0xc34b0e[_0xd18b('0x2b')]=_['intersection'](_0x507e7e[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0x9d386b[_0xd18b('0x29')][_0xd18b('0x2c')]));_0xc34b0e[_0xd18b('0x2b')]=_0xc34b0e[_0xd18b('0x2b')]['length']?_0xc34b0e[_0xd18b('0x2b')]:_0x507e7e['model'];if(!_0x9d386b['query'][_0xd18b('0x2d')]('nolimit')){_0xc34b0e['limit']=qs[_0xd18b('0x15')](_0x9d386b[_0xd18b('0x29')][_0xd18b('0x15')]);_0xc34b0e['offset']=qs['offset'](_0x9d386b[_0xd18b('0x29')][_0xd18b('0x14')]);}_0xc34b0e['order']=qs['sort'](_0x9d386b[_0xd18b('0x29')]['sort']);_0xc34b0e[_0xd18b('0x2e')]=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x9d386b[_0xd18b('0x29')],_0x507e7e['filters']),_0x32822c);if(_0x9d386b[_0xd18b('0x29')][_0xd18b('0x31')]){_0xc34b0e['where']=_[_0xd18b('0x32')](_0xc34b0e['where'],{'$or':_[_0xd18b('0x22')](_0x32822c,function(_0x53baef){if(_0x53baef[_0xd18b('0x26')]!==_0xd18b('0x33')){var _0x2b78b6={};_0x2b78b6[_0x53baef[_0xd18b('0x1f')]]={'$like':'%'+_0x9d386b[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x2b78b6;}})});}_0xc34b0e=_[_0xd18b('0x32')]({},_0xc34b0e,_0x9d386b['options']);var _0x18ac35={'where':_0xc34b0e[_0xd18b('0x2e')]};return db['DeskConfiguration'][_0xd18b('0x17')](_0x18ac35)['then'](function(_0x9f5474){_0x53f11d[_0xd18b('0x17')]=_0x9f5474;if(_0x9d386b[_0xd18b('0x29')]['includeAll']){_0xc34b0e[_0xd18b('0x34')]=[{'all':!![]}];}return db[_0xd18b('0x23')][_0xd18b('0x35')](_0xc34b0e);})[_0xd18b('0x1c')](function(_0x39f307){_0x53f11d[_0xd18b('0x36')]=_0x39f307;return _0x53f11d;})[_0xd18b('0x1c')](respondWithFilteredResult(_0x34bab6,_0xc34b0e))['catch'](handleError(_0x34bab6,null));};exports[_0xd18b('0x37')]=function(_0x5933bf,_0x25494c){var _0x5d8bb7={'raw':![],'where':{'id':_0x5933bf['params']['id']}},_0xf09a44={};_0xf09a44[_0xd18b('0x28')]=_[_0xd18b('0x38')](db[_0xd18b('0x23')][_0xd18b('0x24')]);_0xf09a44[_0xd18b('0x29')]=_['keys'](_0x5933bf['query']);_0xf09a44[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0xf09a44[_0xd18b('0x28')],_0xf09a44[_0xd18b('0x29')]);_0x5d8bb7['attributes']=_['intersection'](_0xf09a44[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0x5933bf[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x5d8bb7[_0xd18b('0x2b')]=_0x5d8bb7[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x5d8bb7[_0xd18b('0x2b')]:_0xf09a44[_0xd18b('0x28')];if(_0x5933bf[_0xd18b('0x29')][_0xd18b('0x3a')]){_0x5d8bb7[_0xd18b('0x34')]=[{'all':!![]}];}_0x5d8bb7=_[_0xd18b('0x32')]({},_0x5d8bb7,_0x5933bf[_0xd18b('0x3b')]);return db['DeskConfiguration'][_0xd18b('0x3c')](_0x5d8bb7)[_0xd18b('0x1c')](handleEntityNotFound(_0x25494c,null))['then'](respondWithResult(_0x25494c,null))['catch'](handleError(_0x25494c,null));};exports['create']=function(_0x261826,_0x480614){return db[_0xd18b('0x23')][_0xd18b('0x3d')](_0x261826['body'],{})[_0xd18b('0x1c')](respondWithResult(_0x480614,0xc9))[_0xd18b('0x3e')](handleError(_0x480614,null));};exports[_0xd18b('0x1a')]=function(_0x4e9da9,_0x2996c5){if(_0x4e9da9['body']['id']){delete _0x4e9da9[_0xd18b('0x3f')]['id'];}return db[_0xd18b('0x23')][_0xd18b('0x3c')]({'where':{'id':_0x4e9da9[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x2996c5,null))[_0xd18b('0x1c')](saveUpdates(_0x4e9da9[_0xd18b('0x3f')],null))[_0xd18b('0x1c')](respondWithResult(_0x2996c5,null))[_0xd18b('0x3e')](handleError(_0x2996c5,null));};exports[_0xd18b('0x1b')]=function(_0x15c428,_0x53eb60){return db['DeskConfiguration'][_0xd18b('0x3c')]({'where':{'id':_0x15c428[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x53eb60,null))[_0xd18b('0x1c')](removeEntity(_0x53eb60,null))[_0xd18b('0x3e')](handleError(_0x53eb60,null));};exports[_0xd18b('0x41')]=function(_0x36932d,_0x289740,_0x31dd7c){var _0x5b66d1={};var _0x750608={};var _0x497449;var _0x5120a7;return db[_0xd18b('0x23')]['findOne']({'where':{'id':_0x36932d['params']['id']}})['then'](handleEntityNotFound(_0x289740,null))['then'](function(_0xb38531){if(_0xb38531){_0x497449=_0xb38531;_0x750608['model']=_['keys'](db[_0xd18b('0x42')][_0xd18b('0x24')]);_0x750608[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0x36932d[_0xd18b('0x29')]);_0x750608[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0x750608['model'],_0x750608['query']);_0x5b66d1[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x750608['model'],qs[_0xd18b('0x2c')](_0x36932d[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x5b66d1['attributes']=_0x5b66d1[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x5b66d1['attributes']:_0x750608[_0xd18b('0x28')];_0x5b66d1[_0xd18b('0x43')]=qs[_0xd18b('0x44')](_0x36932d[_0xd18b('0x29')]['sort']);_0x5b66d1['where']=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x36932d[_0xd18b('0x29')],_0x750608['filters']));if(_0x36932d['query'][_0xd18b('0x31')]){_0x5b66d1[_0xd18b('0x2e')]=_['merge'](_0x5b66d1['where'],{'$or':_['map'](_0x5b66d1[_0xd18b('0x2b')],function(_0x2af025){var _0x4bd947={};_0x4bd947[_0x2af025]={'$like':'%'+_0x36932d[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x4bd947;})});}_0x5b66d1=_[_0xd18b('0x32')]({},_0x5b66d1,_0x36932d[_0xd18b('0x3b')]);return _0x497449[_0xd18b('0x41')](_0x5b66d1);}})['then'](function(_0x476637){if(_0x476637){_0x5120a7=_0x476637['length'];if(!_0x36932d['query'][_0xd18b('0x2d')](_0xd18b('0x45'))){_0x5b66d1[_0xd18b('0x15')]=qs[_0xd18b('0x15')](_0x36932d[_0xd18b('0x29')][_0xd18b('0x15')]);_0x5b66d1[_0xd18b('0x14')]=qs[_0xd18b('0x14')](_0x36932d[_0xd18b('0x29')][_0xd18b('0x14')]);}return _0x497449[_0xd18b('0x41')](_0x5b66d1);}})[_0xd18b('0x1c')](function(_0x3f7b74){if(_0x3f7b74){return _0x3f7b74?{'count':_0x5120a7,'rows':_0x3f7b74}:null;}})['then'](respondWithResult(_0x289740,null))[_0xd18b('0x3e')](handleError(_0x289740,null));};exports['getSubjects']=function(_0x37bada,_0x2b446b,_0x4fe167){var _0x3c55c9={};var _0x29d848={};var _0x308315;var _0x1862b6;return db[_0xd18b('0x23')][_0xd18b('0x46')]({'where':{'id':_0x37bada['params']['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x2b446b,null))[_0xd18b('0x1c')](function(_0x54f5d2){if(_0x54f5d2){_0x308315=_0x54f5d2;_0x29d848['model']=_[_0xd18b('0x38')](db[_0xd18b('0x42')][_0xd18b('0x24')]);_0x29d848[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0x37bada[_0xd18b('0x29')]);_0x29d848[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0x29d848['model'],_0x29d848['query']);_0x3c55c9[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x29d848[_0xd18b('0x28')],qs['fields'](_0x37bada['query'][_0xd18b('0x2c')]));_0x3c55c9['attributes']=_0x3c55c9[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x3c55c9[_0xd18b('0x2b')]:_0x29d848[_0xd18b('0x28')];_0x3c55c9[_0xd18b('0x43')]=qs[_0xd18b('0x44')](_0x37bada[_0xd18b('0x29')][_0xd18b('0x44')]);_0x3c55c9[_0xd18b('0x2e')]=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x37bada[_0xd18b('0x29')],_0x29d848[_0xd18b('0x2f')]));if(_0x37bada[_0xd18b('0x29')][_0xd18b('0x31')]){_0x3c55c9['where']=_['merge'](_0x3c55c9[_0xd18b('0x2e')],{'$or':_[_0xd18b('0x22')](_0x3c55c9[_0xd18b('0x2b')],function(_0x2f5f9c){var _0x49eca0={};_0x49eca0[_0x2f5f9c]={'$like':'%'+_0x37bada['query'][_0xd18b('0x31')]+'%'};return _0x49eca0;})});}_0x3c55c9=_['merge']({},_0x3c55c9,_0x37bada['options']);return _0x308315['getSubjects'](_0x3c55c9);}})['then'](function(_0x34c0da){if(_0x34c0da){_0x1862b6=_0x34c0da[_0xd18b('0x39')];if(!_0x37bada[_0xd18b('0x29')][_0xd18b('0x2d')](_0xd18b('0x45'))){_0x3c55c9['limit']=qs[_0xd18b('0x15')](_0x37bada[_0xd18b('0x29')][_0xd18b('0x15')]);_0x3c55c9[_0xd18b('0x14')]=qs[_0xd18b('0x14')](_0x37bada[_0xd18b('0x29')]['offset']);}return _0x308315['getSubjects'](_0x3c55c9);}})['then'](function(_0x559550){if(_0x559550){return _0x559550?{'count':_0x1862b6,'rows':_0x559550}:null;}})[_0xd18b('0x1c')](respondWithResult(_0x2b446b,null))[_0xd18b('0x3e')](handleError(_0x2b446b,null));};exports['getDescriptions']=function(_0xd8c507,_0x150a9c,_0x2506f4){var _0x1973a={};var _0x158391={};var _0x1a0bb6;var _0x266529;return db['DeskConfiguration'][_0xd18b('0x46')]({'where':{'id':_0xd8c507[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x150a9c,null))[_0xd18b('0x1c')](function(_0x17cb7e){if(_0x17cb7e){_0x1a0bb6=_0x17cb7e;_0x158391[_0xd18b('0x28')]=_[_0xd18b('0x38')](db[_0xd18b('0x42')][_0xd18b('0x24')]);_0x158391[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0xd8c507[_0xd18b('0x29')]);_0x158391['filters']=_[_0xd18b('0x2a')](_0x158391[_0xd18b('0x28')],_0x158391[_0xd18b('0x29')]);_0x1973a[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x158391[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0xd8c507[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x1973a[_0xd18b('0x2b')]=_0x1973a[_0xd18b('0x2b')]['length']?_0x1973a['attributes']:_0x158391[_0xd18b('0x28')];_0x1973a[_0xd18b('0x43')]=qs['sort'](_0xd8c507['query']['sort']);_0x1973a[_0xd18b('0x2e')]=qs[_0xd18b('0x2f')](_['pick'](_0xd8c507[_0xd18b('0x29')],_0x158391[_0xd18b('0x2f')]));if(_0xd8c507[_0xd18b('0x29')][_0xd18b('0x31')]){_0x1973a[_0xd18b('0x2e')]=_[_0xd18b('0x32')](_0x1973a[_0xd18b('0x2e')],{'$or':_['map'](_0x1973a[_0xd18b('0x2b')],function(_0x1a4683){var _0x46d604={};_0x46d604[_0x1a4683]={'$like':'%'+_0xd8c507[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x46d604;})});}_0x1973a=_[_0xd18b('0x32')]({},_0x1973a,_0xd8c507[_0xd18b('0x3b')]);return _0x1a0bb6[_0xd18b('0x47')](_0x1973a);}})[_0xd18b('0x1c')](function(_0x2bcb9){if(_0x2bcb9){_0x266529=_0x2bcb9[_0xd18b('0x39')];if(!_0xd8c507[_0xd18b('0x29')][_0xd18b('0x2d')](_0xd18b('0x45'))){_0x1973a[_0xd18b('0x15')]=qs[_0xd18b('0x15')](_0xd8c507[_0xd18b('0x29')][_0xd18b('0x15')]);_0x1973a[_0xd18b('0x14')]=qs[_0xd18b('0x14')](_0xd8c507['query'][_0xd18b('0x14')]);}return _0x1a0bb6[_0xd18b('0x47')](_0x1973a);}})[_0xd18b('0x1c')](function(_0x232d72){if(_0x232d72){return _0x232d72?{'count':_0x266529,'rows':_0x232d72}:null;}})[_0xd18b('0x1c')](respondWithResult(_0x150a9c,null))[_0xd18b('0x3e')](handleError(_0x150a9c,null));};exports[_0xd18b('0x48')]=function(_0x1cbdda,_0x50f32a,_0x1d4bd8){var _0x3c1802={};var _0x343fae={};var _0x3f0076;var _0xc88e9f;return db[_0xd18b('0x23')][_0xd18b('0x46')]({'where':{'id':_0x1cbdda['params']['id']}})['then'](handleEntityNotFound(_0x50f32a,null))[_0xd18b('0x1c')](function(_0x2bced2){if(_0x2bced2){_0x3f0076=_0x2bced2;_0x343fae['model']=_['keys'](db[_0xd18b('0x49')][_0xd18b('0x24')]);_0x343fae[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0x1cbdda[_0xd18b('0x29')]);_0x343fae[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0x343fae[_0xd18b('0x28')],_0x343fae[_0xd18b('0x29')]);_0x3c1802[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x343fae[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x3c1802['attributes']=_0x3c1802[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x3c1802[_0xd18b('0x2b')]:_0x343fae[_0xd18b('0x28')];_0x3c1802[_0xd18b('0x43')]=qs[_0xd18b('0x44')](_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x44')]);_0x3c1802['where']=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x1cbdda[_0xd18b('0x29')],_0x343fae['filters']));if(_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x31')]){_0x3c1802[_0xd18b('0x2e')]=_[_0xd18b('0x32')](_0x3c1802[_0xd18b('0x2e')],{'$or':_[_0xd18b('0x22')](_0x3c1802[_0xd18b('0x2b')],function(_0x5e615a){var _0x47821c={};_0x47821c[_0x5e615a]={'$like':'%'+_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x47821c;})});}_0x3c1802=_['merge']({},_0x3c1802,_0x1cbdda['options']);return _0x3f0076[_0xd18b('0x48')](_0x3c1802);}})[_0xd18b('0x1c')](function(_0x38b61a){if(_0x38b61a){_0xc88e9f=_0x38b61a[_0xd18b('0x39')];if(!_0x1cbdda[_0xd18b('0x29')]['hasOwnProperty'](_0xd18b('0x45'))){_0x3c1802[_0xd18b('0x15')]=qs[_0xd18b('0x15')](_0x1cbdda['query'][_0xd18b('0x15')]);_0x3c1802['offset']=qs[_0xd18b('0x14')](_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x14')]);}return _0x3f0076[_0xd18b('0x48')](_0x3c1802);}})[_0xd18b('0x1c')](function(_0x526dea){if(_0x526dea){return _0x526dea?{'count':_0xc88e9f,'rows':_0x526dea}:null;}})[_0xd18b('0x1c')](respondWithResult(_0x50f32a,null))[_0xd18b('0x3e')](handleError(_0x50f32a,null));};exports['setTags']=function(_0x572685,_0x3fa294,_0x5b0d10){if(_0x572685['body']['id']){delete _0x572685[_0xd18b('0x3f')]['id'];}return db['DeskConfiguration'][_0xd18b('0x46')]({'where':{'id':_0x572685[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x3fa294,null))[_0xd18b('0x1c')](function(_0x5e7653){if(_0x5e7653){return _0x5e7653['setTags'](_0x572685[_0xd18b('0x3f')][_0xd18b('0x4a')]||[]);}return null;})[_0xd18b('0x1c')](respondWithResult(_0x3fa294,null))[_0xd18b('0x3e')](handleError(_0x3fa294,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0955463..f38ebd9 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 _0xfd13=['./intDeskConfiguration.attributes','exports','define','int_desk_configurations','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5429d7,_0x33e1ac){var _0x24c31f=function(_0x4796e4){while(--_0x4796e4){_0x5429d7['push'](_0x5429d7['shift']());}};_0x24c31f(++_0x33e1ac);}(_0xfd13,0x13a));var _0x3fd1=function(_0x2db5af,_0x1749b4){_0x2db5af=_0x2db5af-0x0;var _0x1c9b8d=_0xfd13[_0x2db5af];return _0x1c9b8d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3fd1('0x0'))(_0x3fd1('0x1'));var moment=require(_0x3fd1('0x2'));var BPromise=require(_0x3fd1('0x3'));var rp=require(_0x3fd1('0x4'));var fs=require('fs');var path=require(_0x3fd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fd1('0x6'));module[_0x3fd1('0x7')]=function(_0x124f72,_0x5cddf7){return _0x124f72[_0x3fd1('0x8')]('DeskConfiguration',attributes,{'tableName':_0x3fd1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb13b=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','path'];(function(_0x31f212,_0x6e94ee){var _0x2ed1f0=function(_0x25ac0e){while(--_0x25ac0e){_0x31f212['push'](_0x31f212['shift']());}};_0x2ed1f0(++_0x6e94ee);}(_0xb13b,0xc7));var _0xbb13=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb13b[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var logger=require(_0xbb13('0x1'))(_0xbb13('0x2'));var moment=require(_0xbb13('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb13('0x4'));var rimraf=require(_0xbb13('0x5'));var config=require(_0xbb13('0x6'));var attributes=require(_0xbb13('0x7'));module[_0xbb13('0x8')]=function(_0x3f1e99,_0x30e699){return _0x3f1e99[_0xbb13('0x9')](_0xbb13('0xa'),attributes,{'tableName':_0xbb13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 7e0edd3..450ad47 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 _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x1a7656,_0x4b7c9d){var _0x3f0fac=function(_0x1a3f1c){while(--_0x1a3f1c){_0x1a7656['push'](_0x1a7656['shift']());}};_0x3f0fac(++_0x4b7c9d);}(_0x1a85,0x178));var _0x51a8=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x1a85[_0x3238ea];return _0x4aaac2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file +var _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3f945f,_0x1ccbd4){var _0x3581a8=function(_0x2479d2){while(--_0x2479d2){_0x3f945f['push'](_0x3f945f['shift']());}};_0x3581a8(++_0x1ccbd4);}(_0x7916,0x128));var _0x6791=function(_0x4fe4d2,_0x7995c4){_0x4fe4d2=_0x4fe4d2-0x0;var _0x56541d=_0x7916[_0x4fe4d2];return _0x56541d;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index fae07f1..876c48b 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 _0x85f8=['Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x302c0a,_0x4f5393){var _0x2af80c=function(_0x4530f6){while(--_0x4530f6){_0x302c0a['push'](_0x302c0a['shift']());}};_0x2af80c(++_0x4f5393);}(_0x85f8,0xd7));var _0x885f=function(_0x3f8007,_0x517e5f){_0x3f8007=_0x3f8007-0x0;var _0x3af9fc=_0x85f8[_0x3f8007];return _0x3af9fc;};'use strict';var multer=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var path=require(_0x885f('0x2'));var timeout=require(_0x885f('0x3'));var express=require(_0x885f('0x4'));var router=express[_0x885f('0x5')]();var fs_extra=require(_0x885f('0x6'));var auth=require(_0x885f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x885f('0x8'));var controller=require(_0x885f('0x9'));router[_0x885f('0xa')]('/',auth['isAuthenticated'](),controller[_0x885f('0xb')]);router[_0x885f('0xa')](_0x885f('0xc'),auth[_0x885f('0xd')](),controller[_0x885f('0xe')]);router[_0x885f('0xf')]('/',auth[_0x885f('0xd')](),controller[_0x885f('0x10')]);router[_0x885f('0x11')](_0x885f('0xc'),auth[_0x885f('0xd')](),controller[_0x885f('0x12')]);router[_0x885f('0x13')](_0x885f('0xc'),auth['isAuthenticated'](),controller[_0x885f('0x14')]);module[_0x885f('0x15')]=router; \ No newline at end of file +var _0x8bca=['./intDeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36d809,_0x36bf6c){var _0x15561d=function(_0x53c0ae){while(--_0x53c0ae){_0x36d809['push'](_0x36d809['shift']());}};_0x15561d(++_0x36bf6c);}(_0x8bca,0x12b));var _0xa8bc=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x8bca[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0xa8bc('0x0'));var util=require(_0xa8bc('0x1'));var path=require(_0xa8bc('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8bc('0x3'));var router=express[_0xa8bc('0x4')]();var fs_extra=require(_0xa8bc('0x5'));var auth=require(_0xa8bc('0x6'));var interaction=require(_0xa8bc('0x7'));var config=require(_0xa8bc('0x8'));var controller=require(_0xa8bc('0x9'));router[_0xa8bc('0xa')]('/',auth[_0xa8bc('0xb')](),controller[_0xa8bc('0xc')]);router[_0xa8bc('0xa')]('/:id',auth[_0xa8bc('0xb')](),controller[_0xa8bc('0xd')]);router[_0xa8bc('0xe')]('/',auth[_0xa8bc('0xb')](),controller[_0xa8bc('0xf')]);router[_0xa8bc('0x10')](_0xa8bc('0x11'),auth[_0xa8bc('0xb')](),controller[_0xa8bc('0x12')]);router[_0xa8bc('0x13')](_0xa8bc('0x11'),auth[_0xa8bc('0xb')](),controller[_0xa8bc('0x14')]);module[_0xa8bc('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 08867a8..ca8bf2d 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 _0xf0e3=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5e29a7,_0x32e9fb){var _0x4805ab=function(_0x30fc30){while(--_0x30fc30){_0x5e29a7['push'](_0x5e29a7['shift']());}};_0x4805ab(++_0x32e9fb);}(_0xf0e3,0x181));var _0x3f0e=function(_0x53e3f8,_0x2ba110){_0x53e3f8=_0x53e3f8-0x0;var _0x4761f4=_0xf0e3[_0x53e3f8];return _0x4761f4;};'use strict';var Sequelize=require(_0x3f0e('0x0'));module[_0x3f0e('0x1')]={'type':{'type':Sequelize[_0x3f0e('0x2')](_0x3f0e('0x3'),_0x3f0e('0x4'),_0x3f0e('0x5'),_0x3f0e('0x6'),_0x3f0e('0x7')),'defaultValue':_0x3f0e('0x3')},'content':{'type':Sequelize[_0x3f0e('0x8')]},'key':{'type':Sequelize[_0x3f0e('0x8')]},'keyType':{'type':Sequelize[_0x3f0e('0x2')](_0x3f0e('0x3'),_0x3f0e('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x3f0e('0x8')]},'idField':{'type':Sequelize[_0x3f0e('0x8')]},'nameField':{'type':Sequelize[_0x3f0e('0x8')]},'customField':{'type':Sequelize[_0x3f0e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeb99=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x43ca39,_0x3f0b5a){var _0x1b0929=function(_0x40cb24){while(--_0x40cb24){_0x43ca39['push'](_0x43ca39['shift']());}};_0x1b0929(++_0x3f0b5a);}(_0xeb99,0x160));var _0x9eb9=function(_0x4b96bd,_0xe341d){_0x4b96bd=_0x4b96bd-0x0;var _0x515ad8=_0xeb99[_0x4b96bd];return _0x515ad8;};'use strict';var Sequelize=require('sequelize');module[_0x9eb9('0x0')]={'type':{'type':Sequelize[_0x9eb9('0x1')](_0x9eb9('0x2'),_0x9eb9('0x3'),_0x9eb9('0x4'),_0x9eb9('0x5'),'picklist'),'defaultValue':_0x9eb9('0x2')},'content':{'type':Sequelize[_0x9eb9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9eb9('0x1')]('string',_0x9eb9('0x3'),_0x9eb9('0x4'))},'keyContent':{'type':Sequelize[_0x9eb9('0x6')]},'idField':{'type':Sequelize[_0x9eb9('0x6')]},'nameField':{'type':Sequelize[_0x9eb9('0x6')]},'customField':{'type':Sequelize[_0x9eb9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9eb9('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7782118..270e26f 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 _0x43d6=['rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','params','options','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','apply','reject','update','destroy','error','name','send','map','DeskField'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x43d6,0xe9));var _0x643d=function(_0x5463dd,_0x4f667b){_0x5463dd=_0x5463dd-0x0;var _0x1f1c1b=_0x43d6[_0x5463dd];return _0x1f1c1b;};'use strict';var emlformat=require(_0x643d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x643d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x643d('0x2'));var BPromise=require(_0x643d('0x3'));var Mustache=require(_0x643d('0x4'));var util=require(_0x643d('0x5'));var path=require('path');var sox=require(_0x643d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x643d('0x7'));var _=require(_0x643d('0x8'));var squel=require('squel');var crypto=require(_0x643d('0x9'));var jsforce=require(_0x643d('0xa'));var deskjs=require(_0x643d('0xb'));var toCsv=require(_0x643d('0xc'));var querystring=require(_0x643d('0xd'));var Papa=require(_0x643d('0xe'));var Redis=require(_0x643d('0xf'));var authService=require(_0x643d('0x10'));var qs=require(_0x643d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x643d('0x12'));var utils=require(_0x643d('0x13'));var config=require(_0x643d('0x14'));var licenseUtil=require(_0x643d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47ea38,_0x4bdcaa){_0x4bdcaa=_0x4bdcaa||0xcc;return function(_0xdb302e){if(_0xdb302e){return _0x47ea38[_0x643d('0x16')](_0x4bdcaa);}return _0x47ea38['status'](_0x4bdcaa)[_0x643d('0x17')]();};}function respondWithResult(_0x1c3202,_0x5941c7){_0x5941c7=_0x5941c7||0xc8;return function(_0x4ac391){if(_0x4ac391){return _0x1c3202[_0x643d('0x18')](_0x5941c7)[_0x643d('0x19')](_0x4ac391);}};}function respondWithFilteredResult(_0x3903b3,_0x465796){return function(_0x1b1129){if(_0x1b1129){var _0x239e3f=typeof _0x465796['offset']===_0x643d('0x1a')&&typeof _0x465796[_0x643d('0x1b')]===_0x643d('0x1a');var _0x416f6d=_0x1b1129[_0x643d('0x1c')];var _0x51cd4c=_0x239e3f?0x0:_0x465796[_0x643d('0x1d')];var _0x1c0116=_0x239e3f?_0x1b1129[_0x643d('0x1c')]:_0x465796[_0x643d('0x1d')]+_0x465796[_0x643d('0x1b')];var _0x20b02a;if(_0x1c0116>=_0x416f6d){_0x1c0116=_0x416f6d;_0x20b02a=0xc8;}else{_0x20b02a=0xce;}_0x3903b3[_0x643d('0x18')](_0x20b02a);return _0x3903b3['set']('Content-Range',_0x51cd4c+'-'+_0x1c0116+'/'+_0x416f6d)[_0x643d('0x19')](_0x1b1129);}return null;};}function patchUpdates(_0x2c4582){return function(_0x338372){try{jsonpatch[_0x643d('0x1e')](_0x338372,_0x2c4582,!![]);}catch(_0x4556d7){return BPromise[_0x643d('0x1f')](_0x4556d7);}return _0x338372['save']();};}function saveUpdates(_0x48513,_0x367b1c){return function(_0x2ea6ee){if(_0x2ea6ee){return _0x2ea6ee[_0x643d('0x20')](_0x48513)['then'](function(_0x559197){return _0x559197;});}return null;};}function removeEntity(_0x299dcf,_0x51ec05){return function(_0x26507c){if(_0x26507c){return _0x26507c[_0x643d('0x21')]()['then'](function(){_0x299dcf['status'](0xcc)[_0x643d('0x17')]();});}};}function handleEntityNotFound(_0x5ebcb6,_0x270034){return function(_0x5b579e){if(!_0x5b579e){_0x5ebcb6[_0x643d('0x16')](0x194);}return _0x5b579e;};}function handleError(_0x468a44,_0x32ef85){_0x32ef85=_0x32ef85||0x1f4;return function(_0x35ccdc){logger[_0x643d('0x22')](_0x35ccdc['stack']);if(_0x35ccdc[_0x643d('0x23')]){delete _0x35ccdc[_0x643d('0x23')];}_0x468a44[_0x643d('0x18')](_0x32ef85)[_0x643d('0x24')](_0x35ccdc);};}exports['index']=function(_0x5f9dc4,_0x4e0193){var _0x1e950c={},_0x57d597={},_0x5075d7={'count':0x0,'rows':[]};var _0x48f7ee=_[_0x643d('0x25')](db[_0x643d('0x26')][_0x643d('0x27')],function(_0x26ba91){return{'name':_0x26ba91[_0x643d('0x28')],'type':_0x26ba91[_0x643d('0x29')][_0x643d('0x2a')]};});_0x57d597[_0x643d('0x2b')]=_[_0x643d('0x25')](_0x48f7ee,_0x643d('0x23'));_0x57d597['query']=_[_0x643d('0x2c')](_0x5f9dc4[_0x643d('0x2d')]);_0x57d597[_0x643d('0x2e')]=_[_0x643d('0x2f')](_0x57d597[_0x643d('0x2b')],_0x57d597[_0x643d('0x2d')]);_0x1e950c['attributes']=_[_0x643d('0x2f')](_0x57d597[_0x643d('0x2b')],qs[_0x643d('0x30')](_0x5f9dc4[_0x643d('0x2d')][_0x643d('0x30')]));_0x1e950c[_0x643d('0x31')]=_0x1e950c[_0x643d('0x31')][_0x643d('0x32')]?_0x1e950c[_0x643d('0x31')]:_0x57d597[_0x643d('0x2b')];if(!_0x5f9dc4[_0x643d('0x2d')][_0x643d('0x33')](_0x643d('0x34'))){_0x1e950c['limit']=qs[_0x643d('0x1b')](_0x5f9dc4[_0x643d('0x2d')]['limit']);_0x1e950c[_0x643d('0x1d')]=qs['offset'](_0x5f9dc4['query']['offset']);}_0x1e950c[_0x643d('0x35')]=qs['sort'](_0x5f9dc4[_0x643d('0x2d')]['sort']);_0x1e950c[_0x643d('0x36')]=qs[_0x643d('0x2e')](_[_0x643d('0x37')](_0x5f9dc4[_0x643d('0x2d')],_0x57d597[_0x643d('0x2e')]),_0x48f7ee);if(_0x5f9dc4[_0x643d('0x2d')][_0x643d('0x38')]){_0x1e950c[_0x643d('0x36')]=_[_0x643d('0x39')](_0x1e950c[_0x643d('0x36')],{'$or':_['map'](_0x48f7ee,function(_0x1e22e8){if(_0x1e22e8[_0x643d('0x29')]!==_0x643d('0x3a')){var _0x575126={};_0x575126[_0x1e22e8[_0x643d('0x23')]]={'$like':'%'+_0x5f9dc4['query']['filter']+'%'};return _0x575126;}})});}_0x1e950c=_[_0x643d('0x39')]({},_0x1e950c,_0x5f9dc4['options']);var _0x37bd86={'where':_0x1e950c['where']};return db[_0x643d('0x26')][_0x643d('0x1c')](_0x37bd86)[_0x643d('0x3b')](function(_0x658fad){_0x5075d7['count']=_0x658fad;if(_0x5f9dc4[_0x643d('0x2d')][_0x643d('0x3c')]){_0x1e950c[_0x643d('0x3d')]=[{'all':!![]}];}return db[_0x643d('0x26')][_0x643d('0x3e')](_0x1e950c);})[_0x643d('0x3b')](function(_0x25ecac){_0x5075d7['rows']=_0x25ecac;return _0x5075d7;})[_0x643d('0x3b')](respondWithFilteredResult(_0x4e0193,_0x1e950c))[_0x643d('0x3f')](handleError(_0x4e0193,null));};exports['show']=function(_0x3178c5,_0x586bc7){var _0x441cb4={'raw':!![],'where':{'id':_0x3178c5[_0x643d('0x40')]['id']}},_0x1df554={};_0x1df554[_0x643d('0x2b')]=_['keys'](db['DeskField'][_0x643d('0x27')]);_0x1df554[_0x643d('0x2d')]=_[_0x643d('0x2c')](_0x3178c5['query']);_0x1df554[_0x643d('0x2e')]=_[_0x643d('0x2f')](_0x1df554[_0x643d('0x2b')],_0x1df554[_0x643d('0x2d')]);_0x441cb4[_0x643d('0x31')]=_[_0x643d('0x2f')](_0x1df554['model'],qs[_0x643d('0x30')](_0x3178c5['query'][_0x643d('0x30')]));_0x441cb4[_0x643d('0x31')]=_0x441cb4[_0x643d('0x31')]['length']?_0x441cb4[_0x643d('0x31')]:_0x1df554[_0x643d('0x2b')];if(_0x3178c5[_0x643d('0x2d')]['includeAll']){_0x441cb4[_0x643d('0x3d')]=[{'all':!![]}];}_0x441cb4=_[_0x643d('0x39')]({},_0x441cb4,_0x3178c5[_0x643d('0x41')]);return db[_0x643d('0x26')]['find'](_0x441cb4)['then'](handleEntityNotFound(_0x586bc7,null))['then'](respondWithResult(_0x586bc7,null))[_0x643d('0x3f')](handleError(_0x586bc7,null));};exports[_0x643d('0x42')]=function(_0x517f2f,_0x48a187){return db[_0x643d('0x26')][_0x643d('0x42')](_0x517f2f[_0x643d('0x43')],{})[_0x643d('0x3b')](respondWithResult(_0x48a187,0xc9))[_0x643d('0x3f')](handleError(_0x48a187,null));};exports[_0x643d('0x20')]=function(_0x5c05db,_0x41d171){if(_0x5c05db[_0x643d('0x43')]['id']){delete _0x5c05db[_0x643d('0x43')]['id'];}return db['DeskField']['find']({'where':{'id':_0x5c05db[_0x643d('0x40')]['id']}})['then'](handleEntityNotFound(_0x41d171,null))[_0x643d('0x3b')](saveUpdates(_0x5c05db[_0x643d('0x43')],null))[_0x643d('0x3b')](respondWithResult(_0x41d171,null))[_0x643d('0x3f')](handleError(_0x41d171,null));};exports['destroy']=function(_0x27e606,_0x4a0988){return db[_0x643d('0x26')]['find']({'where':{'id':_0x27e606['params']['id']}})[_0x643d('0x3b')](handleEntityNotFound(_0x4a0988,null))['then'](removeEntity(_0x4a0988,null))[_0x643d('0x3f')](handleError(_0x4a0988,null));}; \ No newline at end of file +var _0xea31=['send','index','map','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','DeskField','includeAll','include','findAll','catch','params','keys','length','options','create','update','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name'];(function(_0x1b88a0,_0x16572c){var _0x48d6d4=function(_0x9f231e){while(--_0x9f231e){_0x1b88a0['push'](_0x1b88a0['shift']());}};_0x48d6d4(++_0x16572c);}(_0xea31,0x6b));var _0x1ea3=function(_0x4d7940,_0x400a42){_0x4d7940=_0x4d7940-0x0;var _0x40d7b1=_0xea31[_0x4d7940];return _0x40d7b1;};'use strict';var emlformat=require(_0x1ea3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ea3('0x1'));var jsonpatch=require(_0x1ea3('0x2'));var rp=require(_0x1ea3('0x3'));var moment=require(_0x1ea3('0x4'));var BPromise=require(_0x1ea3('0x5'));var Mustache=require(_0x1ea3('0x6'));var util=require(_0x1ea3('0x7'));var path=require('path');var sox=require(_0x1ea3('0x8'));var csv=require(_0x1ea3('0x9'));var ejs=require(_0x1ea3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ea3('0xb'));var _=require(_0x1ea3('0xc'));var squel=require('squel');var crypto=require(_0x1ea3('0xd'));var jsforce=require(_0x1ea3('0xe'));var deskjs=require(_0x1ea3('0xf'));var toCsv=require(_0x1ea3('0x9'));var querystring=require(_0x1ea3('0x10'));var Papa=require(_0x1ea3('0x11'));var Redis=require('ioredis');var authService=require(_0x1ea3('0x12'));var qs=require(_0x1ea3('0x13'));var as=require(_0x1ea3('0x14'));var hardwareService=require(_0x1ea3('0x15'));var logger=require(_0x1ea3('0x16'))(_0x1ea3('0x17'));var utils=require(_0x1ea3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe537,_0x2fc7f4){_0x2fc7f4=_0x2fc7f4||0xcc;return function(_0x4305d3){if(_0x4305d3){return _0x3fe537['sendStatus'](_0x2fc7f4);}return _0x3fe537[_0x1ea3('0x1a')](_0x2fc7f4)[_0x1ea3('0x1b')]();};}function respondWithResult(_0x2fd1c9,_0x4b0af9){_0x4b0af9=_0x4b0af9||0xc8;return function(_0x1624ee){if(_0x1624ee){return _0x2fd1c9[_0x1ea3('0x1a')](_0x4b0af9)[_0x1ea3('0x1c')](_0x1624ee);}};}function respondWithFilteredResult(_0x3d0e71,_0x319de8){return function(_0x3fe673){if(_0x3fe673){var _0x29ceac=typeof _0x319de8['offset']===_0x1ea3('0x1d')&&typeof _0x319de8[_0x1ea3('0x1e')]===_0x1ea3('0x1d');var _0x2f6e6f=_0x3fe673[_0x1ea3('0x1f')];var _0x541e18=_0x29ceac?0x0:_0x319de8[_0x1ea3('0x20')];var _0x2a8b47=_0x29ceac?_0x3fe673[_0x1ea3('0x1f')]:_0x319de8['offset']+_0x319de8[_0x1ea3('0x1e')];var _0x21364e;if(_0x2a8b47>=_0x2f6e6f){_0x2a8b47=_0x2f6e6f;_0x21364e=0xc8;}else{_0x21364e=0xce;}_0x3d0e71[_0x1ea3('0x1a')](_0x21364e);return _0x3d0e71['set'](_0x1ea3('0x21'),_0x541e18+'-'+_0x2a8b47+'/'+_0x2f6e6f)['json'](_0x3fe673);}return null;};}function patchUpdates(_0x276e4d){return function(_0x405ec0){try{jsonpatch[_0x1ea3('0x22')](_0x405ec0,_0x276e4d,!![]);}catch(_0x5bad21){return BPromise[_0x1ea3('0x23')](_0x5bad21);}return _0x405ec0['save']();};}function saveUpdates(_0x4582af,_0x498455){return function(_0x941a50){if(_0x941a50){return _0x941a50['update'](_0x4582af)[_0x1ea3('0x24')](function(_0x388019){return _0x388019;});}return null;};}function removeEntity(_0x246231,_0x5ad8ff){return function(_0x50703d){if(_0x50703d){return _0x50703d[_0x1ea3('0x25')]()['then'](function(){_0x246231[_0x1ea3('0x1a')](0xcc)[_0x1ea3('0x1b')]();});}};}function handleEntityNotFound(_0x3c42f3,_0x91abee){return function(_0xa2b868){if(!_0xa2b868){_0x3c42f3['sendStatus'](0x194);}return _0xa2b868;};}function handleError(_0x50e511,_0x30cf8d){_0x30cf8d=_0x30cf8d||0x1f4;return function(_0x2edfb4){logger[_0x1ea3('0x26')](_0x2edfb4[_0x1ea3('0x27')]);if(_0x2edfb4[_0x1ea3('0x28')]){delete _0x2edfb4[_0x1ea3('0x28')];}_0x50e511[_0x1ea3('0x1a')](_0x30cf8d)[_0x1ea3('0x29')](_0x2edfb4);};}exports[_0x1ea3('0x2a')]=function(_0x3d9b63,_0x3bc186){var _0x33f5f2={},_0x2c29d7={},_0x1a020e={'count':0x0,'rows':[]};var _0xdbd7e3=_[_0x1ea3('0x2b')](db['DeskField'][_0x1ea3('0x2c')],function(_0x366312){return{'name':_0x366312[_0x1ea3('0x2d')],'type':_0x366312[_0x1ea3('0x2e')][_0x1ea3('0x2f')]};});_0x2c29d7['model']=_['map'](_0xdbd7e3,_0x1ea3('0x28'));_0x2c29d7[_0x1ea3('0x30')]=_['keys'](_0x3d9b63[_0x1ea3('0x30')]);_0x2c29d7[_0x1ea3('0x31')]=_['intersection'](_0x2c29d7['model'],_0x2c29d7[_0x1ea3('0x30')]);_0x33f5f2[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x2c29d7[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x33f5f2[_0x1ea3('0x32')]=_0x33f5f2[_0x1ea3('0x32')]['length']?_0x33f5f2[_0x1ea3('0x32')]:_0x2c29d7[_0x1ea3('0x34')];if(!_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x36')](_0x1ea3('0x37'))){_0x33f5f2[_0x1ea3('0x1e')]=qs[_0x1ea3('0x1e')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x1e')]);_0x33f5f2[_0x1ea3('0x20')]=qs['offset'](_0x3d9b63[_0x1ea3('0x30')]['offset']);}_0x33f5f2[_0x1ea3('0x38')]=qs['sort'](_0x3d9b63['query'][_0x1ea3('0x39')]);_0x33f5f2['where']=qs['filters'](_['pick'](_0x3d9b63[_0x1ea3('0x30')],_0x2c29d7[_0x1ea3('0x31')]),_0xdbd7e3);if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]){_0x33f5f2[_0x1ea3('0x3b')]=_['merge'](_0x33f5f2[_0x1ea3('0x3b')],{'$or':_['map'](_0xdbd7e3,function(_0x441442){if(_0x441442[_0x1ea3('0x2e')]!=='VIRTUAL'){var _0x102757={};_0x102757[_0x441442[_0x1ea3('0x28')]]={'$like':'%'+_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]+'%'};return _0x102757;}})});}_0x33f5f2=_[_0x1ea3('0x3c')]({},_0x33f5f2,_0x3d9b63['options']);var _0x12da5a={'where':_0x33f5f2['where']};return db[_0x1ea3('0x3d')][_0x1ea3('0x1f')](_0x12da5a)[_0x1ea3('0x24')](function(_0x47028d){_0x1a020e[_0x1ea3('0x1f')]=_0x47028d;if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x33f5f2[_0x1ea3('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x1ea3('0x40')](_0x33f5f2);})[_0x1ea3('0x24')](function(_0x2108e8){_0x1a020e['rows']=_0x2108e8;return _0x1a020e;})[_0x1ea3('0x24')](respondWithFilteredResult(_0x3bc186,_0x33f5f2))[_0x1ea3('0x41')](handleError(_0x3bc186,null));};exports['show']=function(_0x15f00a,_0x43c48d){var _0x58ba87={'raw':!![],'where':{'id':_0x15f00a[_0x1ea3('0x42')]['id']}},_0x133f48={};_0x133f48[_0x1ea3('0x34')]=_[_0x1ea3('0x43')](db[_0x1ea3('0x3d')][_0x1ea3('0x2c')]);_0x133f48['query']=_[_0x1ea3('0x43')](_0x15f00a[_0x1ea3('0x30')]);_0x133f48[_0x1ea3('0x31')]=_['intersection'](_0x133f48[_0x1ea3('0x34')],_0x133f48[_0x1ea3('0x30')]);_0x58ba87[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x133f48[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x58ba87[_0x1ea3('0x32')]=_0x58ba87[_0x1ea3('0x32')][_0x1ea3('0x44')]?_0x58ba87['attributes']:_0x133f48[_0x1ea3('0x34')];if(_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x58ba87[_0x1ea3('0x3f')]=[{'all':!![]}];}_0x58ba87=_['merge']({},_0x58ba87,_0x15f00a[_0x1ea3('0x45')]);return db[_0x1ea3('0x3d')]['find'](_0x58ba87)[_0x1ea3('0x24')](handleEntityNotFound(_0x43c48d,null))[_0x1ea3('0x24')](respondWithResult(_0x43c48d,null))[_0x1ea3('0x41')](handleError(_0x43c48d,null));};exports[_0x1ea3('0x46')]=function(_0x454156,_0x28955f){return db[_0x1ea3('0x3d')]['create'](_0x454156['body'],{})['then'](respondWithResult(_0x28955f,0xc9))[_0x1ea3('0x41')](handleError(_0x28955f,null));};exports[_0x1ea3('0x47')]=function(_0xf69557,_0x2de88d){if(_0xf69557[_0x1ea3('0x48')]['id']){delete _0xf69557['body']['id'];}return db[_0x1ea3('0x3d')]['find']({'where':{'id':_0xf69557[_0x1ea3('0x42')]['id']}})[_0x1ea3('0x24')](handleEntityNotFound(_0x2de88d,null))['then'](saveUpdates(_0xf69557['body'],null))[_0x1ea3('0x24')](respondWithResult(_0x2de88d,null))[_0x1ea3('0x41')](handleError(_0x2de88d,null));};exports[_0x1ea3('0x25')]=function(_0x43f296,_0x4822b2){return db[_0x1ea3('0x3d')][_0x1ea3('0x49')]({'where':{'id':_0x43f296['params']['id']}})['then'](handleEntityNotFound(_0x4822b2,null))[_0x1ea3('0x24')](removeEntity(_0x4822b2,null))['catch'](handleError(_0x4822b2,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4bdb9e3..f9b8bae 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 _0xa038=['rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0xa038,0x11c));var _0x8a03=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xa038[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0x8a03('0x0'));var util=require(_0x8a03('0x1'));var logger=require(_0x8a03('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8a03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8a03('0x4'));var config=require(_0x8a03('0x5'));var attributes=require(_0x8a03('0x6'));module['exports']=function(_0x53dbea,_0x34a0b7){return _0x53dbea['define'](_0x8a03('0x7'),attributes,{'tableName':_0x8a03('0x8'),'paranoid':![],'indexes':[{'name':_0x8a03('0x9'),'fields':[_0x8a03('0xa'),_0x8a03('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf37e=['exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0xf37e,0x6f));var _0xef37=function(_0x9d93fc,_0x28038c){_0x9d93fc=_0x9d93fc-0x0;var _0x33d4bd=_0xf37e[_0x9d93fc];return _0x33d4bd;};'use strict';var _=require(_0xef37('0x0'));var util=require('util');var logger=require(_0xef37('0x1'))(_0xef37('0x2'));var moment=require(_0xef37('0x3'));var BPromise=require(_0xef37('0x4'));var rp=require(_0xef37('0x5'));var fs=require('fs');var path=require(_0xef37('0x6'));var rimraf=require('rimraf');var config=require(_0xef37('0x7'));var attributes=require(_0xef37('0x8'));module[_0xef37('0x9')]=function(_0x592f67,_0x4caa00){return _0x592f67[_0xef37('0xa')](_0xef37('0xb'),attributes,{'tableName':_0xef37('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xef37('0xd'),_0xef37('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 7c56745..162ac4e 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 _0xa7c0=['jayson/promise','client','http','request','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x31d8c7,_0x557464){var _0x4c32cf=function(_0x3dd2fb){while(--_0x3dd2fb){_0x31d8c7['push'](_0x31d8c7['shift']());}};_0x4c32cf(++_0x557464);}(_0xa7c0,0x19a));var _0x0a7c=function(_0x524b30,_0x4e086a){_0x524b30=_0x524b30-0x0;var _0xbdfe4a=_0xa7c0[_0x524b30];return _0xbdfe4a;};'use strict';var _=require(_0x0a7c('0x0'));var util=require(_0x0a7c('0x1'));var moment=require(_0x0a7c('0x2'));var BPromise=require(_0x0a7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a7c('0x5'))(_0x0a7c('0x6'));var config=require(_0x0a7c('0x7'));var jayson=require(_0x0a7c('0x8'));var client=jayson[_0x0a7c('0x9')][_0x0a7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc282a9,_0xccd0a3,_0x39b1ed){return new BPromise(function(_0x22c4ed,_0x4966e8){return client[_0x0a7c('0xb')](_0xc282a9,_0x39b1ed)['then'](function(_0x4c05b9){logger[_0x0a7c('0xc')]('DeskField,\x20%s,\x20%s',_0xccd0a3,'request\x20sent');logger[_0x0a7c('0xd')](_0x0a7c('0xe'),_0xccd0a3,_0x0a7c('0xf'),JSON['stringify'](_0x4c05b9));if(_0x4c05b9[_0x0a7c('0x10')]){if(_0x4c05b9['error'][_0x0a7c('0x11')]===0x1f4){logger[_0x0a7c('0x10')](_0x0a7c('0x12'),_0xccd0a3,_0x4c05b9[_0x0a7c('0x10')][_0x0a7c('0x13')]);return _0x4966e8(_0x4c05b9[_0x0a7c('0x10')][_0x0a7c('0x13')]);}logger[_0x0a7c('0x10')](_0x0a7c('0x12'),_0xccd0a3,_0x4c05b9[_0x0a7c('0x10')][_0x0a7c('0x13')]);return _0x22c4ed(_0x4c05b9[_0x0a7c('0x10')][_0x0a7c('0x13')]);}else{logger['info'](_0x0a7c('0x12'),_0xccd0a3,'request\x20sent');_0x22c4ed(_0x4c05b9[_0x0a7c('0x14')][_0x0a7c('0x13')]);}})[_0x0a7c('0x15')](function(_0x5af77c){logger[_0x0a7c('0x10')](_0x0a7c('0x12'),_0xccd0a3,_0x5af77c);_0x4966e8(_0x5af77c);});});} \ No newline at end of file +var _0x4777=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','code','error','message','DeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x4777,0x10b));var _0x7477=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x4777[_0x95942];return _0x6d7f81;};'use strict';var _=require(_0x7477('0x0'));var util=require(_0x7477('0x1'));var moment=require(_0x7477('0x2'));var BPromise=require(_0x7477('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7477('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7477('0x5'));var logger=require('../../config/logger')(_0x7477('0x6'));var config=require('../../config/environment');var jayson=require(_0x7477('0x7'));var client=jayson[_0x7477('0x8')][_0x7477('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ba420,_0x49386f,_0x32be45){return new BPromise(function(_0x272963,_0x4ba565){return client[_0x7477('0xa')](_0x1ba420,_0x32be45)[_0x7477('0xb')](function(_0x47369d){logger['info']('DeskField,\x20%s,\x20%s',_0x49386f,_0x7477('0xc'));logger[_0x7477('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x49386f,_0x7477('0xc'),JSON[_0x7477('0xe')](_0x47369d));if(_0x47369d['error']){if(_0x47369d['error'][_0x7477('0xf')]===0x1f4){logger[_0x7477('0x10')]('DeskField,\x20%s,\x20%s',_0x49386f,_0x47369d[_0x7477('0x10')]['message']);return _0x4ba565(_0x47369d[_0x7477('0x10')][_0x7477('0x11')]);}logger[_0x7477('0x10')](_0x7477('0x12'),_0x49386f,_0x47369d[_0x7477('0x10')][_0x7477('0x11')]);return _0x272963(_0x47369d[_0x7477('0x10')][_0x7477('0x11')]);}else{logger['info'](_0x7477('0x12'),_0x49386f,'request\x20sent');_0x272963(_0x47369d[_0x7477('0x13')][_0x7477('0x11')]);}})[_0x7477('0x14')](function(_0x1a3295){logger[_0x7477('0x10')](_0x7477('0x12'),_0x49386f,_0x1a3295);_0x4ba565(_0x1a3295);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 0b8570d..a9c4e05 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 _0xe556=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','/:id/configurations','getFields','post','addConfiguration','put','update','exports','multer','util'];(function(_0x155af3,_0x4ad336){var _0x315081=function(_0x4daff2){while(--_0x4daff2){_0x155af3['push'](_0x155af3['shift']());}};_0x315081(++_0x4ad336);}(_0xe556,0x10c));var _0x6e55=function(_0x590dc4,_0x436b22){_0x590dc4=_0x590dc4-0x0;var _0xee5613=_0xe556[_0x590dc4];return _0xee5613;};'use strict';var multer=require(_0x6e55('0x0'));var util=require(_0x6e55('0x1'));var path=require('path');var timeout=require(_0x6e55('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6e55('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6e55('0x4'));var config=require(_0x6e55('0x5'));var controller=require(_0x6e55('0x6'));router['get']('/',auth[_0x6e55('0x7')](),controller[_0x6e55('0x8')]);router[_0x6e55('0x9')](_0x6e55('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6e55('0x9')](_0x6e55('0xb'),auth[_0x6e55('0x7')](),controller['getConfigurations']);router[_0x6e55('0x9')]('/:id/fields',auth[_0x6e55('0x7')](),controller[_0x6e55('0xc')]);router[_0x6e55('0xd')]('/',auth[_0x6e55('0x7')](),controller['create']);router[_0x6e55('0xd')]('/:id/configurations',auth[_0x6e55('0x7')](),controller[_0x6e55('0xe')]);router[_0x6e55('0xf')]('/:id',auth[_0x6e55('0x7')](),controller[_0x6e55('0x10')]);router['delete']('/:id',auth[_0x6e55('0x7')](),controller['destroy']);module[_0x6e55('0x11')]=router; \ No newline at end of file +var _0x1ad7=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x101f71,_0x4d3daa){var _0x2f7aad=function(_0x2530d8){while(--_0x2530d8){_0x101f71['push'](_0x101f71['shift']());}};_0x2f7aad(++_0x4d3daa);}(_0x1ad7,0x19e));var _0x71ad=function(_0x46e82f,_0x8ff37e){_0x46e82f=_0x46e82f-0x0;var _0x14323c=_0x1ad7[_0x46e82f];return _0x14323c;};'use strict';var multer=require(_0x71ad('0x0'));var util=require(_0x71ad('0x1'));var path=require(_0x71ad('0x2'));var timeout=require(_0x71ad('0x3'));var express=require(_0x71ad('0x4'));var router=express['Router']();var fs_extra=require(_0x71ad('0x5'));var auth=require(_0x71ad('0x6'));var interaction=require(_0x71ad('0x7'));var config=require(_0x71ad('0x8'));var controller=require(_0x71ad('0x9'));router[_0x71ad('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x71ad('0xa')](_0x71ad('0xb'),auth[_0x71ad('0xc')](),controller[_0x71ad('0xd')]);router[_0x71ad('0xa')](_0x71ad('0xe'),auth[_0x71ad('0xc')](),controller[_0x71ad('0xf')]);router[_0x71ad('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x71ad('0x10')]('/',auth[_0x71ad('0xc')](),controller['create']);router['post'](_0x71ad('0xe'),auth['isAuthenticated'](),controller[_0x71ad('0x11')]);router['put'](_0x71ad('0xb'),auth[_0x71ad('0xc')](),controller[_0x71ad('0x12')]);router[_0x71ad('0x13')](_0x71ad('0xb'),auth['isAuthenticated'](),controller[_0x71ad('0x14')]);module[_0x71ad('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 1939edb..a311e0f 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 _0xdd68=['BOOLEAN','sequelize','STRING'];(function(_0x4aba5e,_0x2b0e14){var _0xeea674=function(_0x2122fa){while(--_0x2122fa){_0x4aba5e['push'](_0x4aba5e['shift']());}};_0xeea674(++_0x2b0e14);}(_0xdd68,0x196));var _0x8dd6=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0xdd68[_0x9b5bb2];return _0x2e1e92;};'use strict';var Sequelize=require(_0x8dd6('0x0'));module['exports']={'name':{'type':Sequelize[_0x8dd6('0x1')]},'username':{'type':Sequelize[_0x8dd6('0x1')]},'password':{'type':Sequelize[_0x8dd6('0x1')]},'remoteUri':{'type':Sequelize[_0x8dd6('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x8dd6('0x1')]},'clientSecret':{'type':Sequelize[_0x8dd6('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8dd6('0x1')]},'modernAuthentication':{'type':Sequelize[_0x8dd6('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x294b=['sequelize','STRING','BOOLEAN'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb294('0x0'));module['exports']={'name':{'type':Sequelize[_0xb294('0x1')]},'username':{'type':Sequelize[_0xb294('0x1')]},'password':{'type':Sequelize[_0xb294('0x1')]},'remoteUri':{'type':Sequelize[_0xb294('0x1')]},'tenantId':{'type':Sequelize[_0xb294('0x1')]},'clientId':{'type':Sequelize[_0xb294('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb294('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb294('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 da42c5d..df9e8a3 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 _0x2545=['getDescriptions','Dynamics365Field','substring','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridname','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','slaname','statecode','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(','remove','includes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','MetadataId','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions'];(function(_0x7b4a3,_0x494462){var _0x212f15=function(_0x2d3148){while(--_0x2d3148){_0x7b4a3['push'](_0x7b4a3['shift']());}};_0x212f15(++_0x494462);}(_0x2545,0x1e4));var _0x5254=function(_0x21e7b7,_0x30f659){_0x21e7b7=_0x21e7b7-0x0;var _0x2c2237=_0x2545[_0x21e7b7];return _0x2c2237;};'use strict';var rp=require(_0x5254('0x0'));var util=require(_0x5254('0x1'));var _=require(_0x5254('0x2'));var qs=require(_0x5254('0x3'));var logger=require(_0x5254('0x4'))('api');var db=require(_0x5254('0x5'))['db'];var integrations=require(_0x5254('0x6'));function respondWithResult(_0x5cddb3,_0x237a86){_0x237a86=_0x237a86||0xc8;return function(_0x1fad39){if(_0x1fad39){return _0x5cddb3[_0x5254('0x7')](_0x237a86)[_0x5254('0x8')](_0x1fad39);}};}function respondWithFilteredResult(_0x35991c,_0x43dd09){return function(_0x2fa1ff){if(_0x2fa1ff){var _0x86d666=typeof _0x43dd09[_0x5254('0x9')]===_0x5254('0xa')&&typeof _0x43dd09[_0x5254('0xb')]===_0x5254('0xa');var _0x78ad68=_0x2fa1ff[_0x5254('0xc')];var _0x3fe1bf=_0x86d666?0x0:_0x43dd09['offset'];var _0x570bf8=_0x86d666?_0x2fa1ff[_0x5254('0xc')]:_0x43dd09[_0x5254('0x9')]+_0x43dd09[_0x5254('0xb')];var _0x352435;if(_0x570bf8>=_0x78ad68){_0x570bf8=_0x78ad68;_0x352435=0xc8;}else{_0x352435=0xce;}_0x35991c['status'](_0x352435);return _0x35991c[_0x5254('0xd')]('Content-Range',_0x3fe1bf+'-'+_0x570bf8+'/'+_0x78ad68)[_0x5254('0x8')](_0x2fa1ff);}return null;};}function saveUpdates(_0x273dc4){return function(_0x517fdb){if(_0x517fdb){return _0x517fdb['update'](_0x273dc4)[_0x5254('0xe')](function(_0x29d716){return _0x29d716;});}return null;};}function removeEntity(_0x3b0254){return function(_0x16b370){if(_0x16b370){return _0x16b370[_0x5254('0xf')]()['then'](function(){_0x3b0254[_0x5254('0x7')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ebfd1){return function(_0x4fb067){if(!_0x4fb067){_0x4ebfd1[_0x5254('0x10')](0x194);}return _0x4fb067;};}function handleError(_0x5b1c5d,_0x2ea4c8){_0x2ea4c8=_0x2ea4c8||0x1f4;return function(_0x1479e7){logger[_0x5254('0x11')](_0x1479e7[_0x5254('0x12')]);if(_0x1479e7[_0x5254('0x13')]){delete _0x1479e7['name'];}_0x5b1c5d[_0x5254('0x7')](_0x2ea4c8)[_0x5254('0x14')](_0x1479e7);};}exports[_0x5254('0x15')]=function(_0x1d71ae,_0x2cf606){var _0x184c86={},_0x29eef8={},_0x165384={'count':0x0,'rows':[]};var _0x19f688=_[_0x5254('0x16')](db[_0x5254('0x17')][_0x5254('0x18')],function(_0x14633e){return{'name':_0x14633e['fieldName'],'type':_0x14633e['type'][_0x5254('0x19')]};});_0x29eef8['model']=_[_0x5254('0x16')](_0x19f688,_0x5254('0x13'));_0x29eef8[_0x5254('0x1a')]=_[_0x5254('0x1b')](_0x1d71ae['query']);_0x29eef8[_0x5254('0x1c')]=_[_0x5254('0x1d')](_0x29eef8['model'],_0x29eef8[_0x5254('0x1a')]);_0x184c86[_0x5254('0x1e')]=_[_0x5254('0x1d')](_0x29eef8[_0x5254('0x1f')],qs[_0x5254('0x20')](_0x1d71ae[_0x5254('0x1a')][_0x5254('0x20')]));_0x184c86[_0x5254('0x1e')]=_0x184c86[_0x5254('0x1e')][_0x5254('0x21')]?_0x184c86[_0x5254('0x1e')]:_0x29eef8['model'];if(!_0x1d71ae['query']['hasOwnProperty'](_0x5254('0x22'))){_0x184c86[_0x5254('0xb')]=qs[_0x5254('0xb')](_0x1d71ae[_0x5254('0x1a')][_0x5254('0xb')]);_0x184c86[_0x5254('0x9')]=qs[_0x5254('0x9')](_0x1d71ae[_0x5254('0x1a')][_0x5254('0x9')]);}_0x184c86[_0x5254('0x23')]=qs['sort'](_0x1d71ae[_0x5254('0x1a')][_0x5254('0x24')]);_0x184c86[_0x5254('0x25')]=qs[_0x5254('0x1c')](_['pick'](_0x1d71ae[_0x5254('0x1a')],_0x29eef8[_0x5254('0x1c')]),_0x19f688);if(_0x1d71ae['query'][_0x5254('0x26')]){_0x184c86[_0x5254('0x25')]=_[_0x5254('0x27')](_0x184c86[_0x5254('0x25')],{'$or':_[_0x5254('0x16')](_0x19f688,function(_0x5ee22d){if(_0x5ee22d[_0x5254('0x28')]!==_0x5254('0x29')){var _0x164ab7={};_0x164ab7[_0x5ee22d[_0x5254('0x13')]]={'$like':'%'+_0x1d71ae[_0x5254('0x1a')]['filter']+'%'};return _0x164ab7;}})});}_0x184c86=_['merge']({},_0x184c86,_0x1d71ae[_0x5254('0x2a')]);var _0x10aaac={'where':_0x184c86[_0x5254('0x25')]};return db[_0x5254('0x17')][_0x5254('0xc')](_0x10aaac)[_0x5254('0xe')](function(_0x47c993){_0x165384[_0x5254('0xc')]=_0x47c993;if(_0x1d71ae[_0x5254('0x1a')][_0x5254('0x2b')]){_0x184c86[_0x5254('0x2c')]=[{'all':!![]}];}return db[_0x5254('0x17')][_0x5254('0x2d')](_0x184c86);})[_0x5254('0xe')](function(_0x1f5cc7){_0x165384[_0x5254('0x2e')]=_0x1f5cc7;return _0x165384;})[_0x5254('0xe')](respondWithFilteredResult(_0x2cf606,_0x184c86))[_0x5254('0x2f')](handleError(_0x2cf606,null));};exports['show']=function(_0x5b28e8,_0x5e36d8){var _0x418732={'raw':![],'where':{'id':_0x5b28e8['params']['id']}},_0x3d78b1={};_0x3d78b1[_0x5254('0x1f')]=_[_0x5254('0x1b')](db[_0x5254('0x17')][_0x5254('0x18')]);_0x3d78b1[_0x5254('0x1a')]=_['keys'](_0x5b28e8[_0x5254('0x1a')]);_0x3d78b1[_0x5254('0x1c')]=_[_0x5254('0x1d')](_0x3d78b1[_0x5254('0x1f')],_0x3d78b1[_0x5254('0x1a')]);_0x418732['attributes']=_[_0x5254('0x1d')](_0x3d78b1[_0x5254('0x1f')],qs[_0x5254('0x20')](_0x5b28e8[_0x5254('0x1a')][_0x5254('0x20')]));_0x418732['attributes']=_0x418732['attributes']['length']?_0x418732[_0x5254('0x1e')]:_0x3d78b1[_0x5254('0x1f')];if(_0x5b28e8[_0x5254('0x1a')]['includeAll']){_0x418732[_0x5254('0x2c')]=[{'all':!![]}];}_0x418732=_[_0x5254('0x27')]({},_0x418732,_0x5b28e8[_0x5254('0x2a')]);return db[_0x5254('0x17')][_0x5254('0x30')](_0x418732)[_0x5254('0xe')](handleEntityNotFound(_0x5e36d8,null))['then'](respondWithResult(_0x5e36d8,null))[_0x5254('0x2f')](handleError(_0x5e36d8,null));};exports[_0x5254('0x31')]=function(_0x5adfb4,_0xd45a45){return db[_0x5254('0x17')]['create'](_0x5adfb4[_0x5254('0x32')],{})[_0x5254('0xe')](respondWithResult(_0xd45a45,0xc9))[_0x5254('0x2f')](handleError(_0xd45a45,null));};exports['update']=function(_0x361e76,_0x3e93c5){if(_0x361e76[_0x5254('0x32')]['id']){delete _0x361e76[_0x5254('0x32')]['id'];}return db[_0x5254('0x17')][_0x5254('0x30')]({'where':{'id':_0x361e76[_0x5254('0x33')]['id']}})['then'](handleEntityNotFound(_0x3e93c5,null))['then'](saveUpdates(_0x361e76[_0x5254('0x32')],null))[_0x5254('0xe')](respondWithResult(_0x3e93c5,null))[_0x5254('0x2f')](handleError(_0x3e93c5,null));};exports[_0x5254('0xf')]=function(_0x359c9d,_0x5d9eb7){return db[_0x5254('0x17')]['find']({'where':{'id':_0x359c9d[_0x5254('0x33')]['id']}})['then'](handleEntityNotFound(_0x5d9eb7,null))[_0x5254('0xe')](removeEntity(_0x5d9eb7,null))[_0x5254('0x2f')](handleError(_0x5d9eb7,null));};exports[_0x5254('0x34')]=function(_0x3dfe7b,_0x39bc12){var _0x46c570={};var _0x1bfd5b={};var _0x5733e5;var _0x22e792;return db[_0x5254('0x17')][_0x5254('0x35')]({'where':{'id':_0x3dfe7b[_0x5254('0x33')]['id']}})['then'](handleEntityNotFound(_0x39bc12,null))[_0x5254('0xe')](function(_0x40484d){if(_0x40484d){_0x5733e5=_0x40484d;_0x1bfd5b[_0x5254('0x1f')]=_[_0x5254('0x1b')](db[_0x5254('0x36')][_0x5254('0x18')]);_0x1bfd5b[_0x5254('0x1a')]=_[_0x5254('0x1b')](_0x3dfe7b['query']);_0x1bfd5b[_0x5254('0x1c')]=_[_0x5254('0x1d')](_0x1bfd5b[_0x5254('0x1f')],_0x1bfd5b['query']);_0x46c570['attributes']=_['intersection'](_0x1bfd5b['model'],qs['fields'](_0x3dfe7b[_0x5254('0x1a')][_0x5254('0x20')]));_0x46c570[_0x5254('0x1e')]=_0x46c570[_0x5254('0x1e')][_0x5254('0x21')]?_0x46c570[_0x5254('0x1e')]:_0x1bfd5b[_0x5254('0x1f')];_0x46c570[_0x5254('0x23')]=qs[_0x5254('0x24')](_0x3dfe7b['query'][_0x5254('0x24')]);_0x46c570[_0x5254('0x25')]=qs[_0x5254('0x1c')](_[_0x5254('0x37')](_0x3dfe7b[_0x5254('0x1a')],_0x1bfd5b[_0x5254('0x1c')]));if(_0x3dfe7b[_0x5254('0x1a')][_0x5254('0x26')]){_0x46c570['where']=_[_0x5254('0x27')](_0x46c570[_0x5254('0x25')],{'$or':_['map'](_0x46c570[_0x5254('0x1e')],function(_0xcf9710){var _0x58c80e={};_0x58c80e[_0xcf9710]={'$like':'%'+_0x3dfe7b[_0x5254('0x1a')][_0x5254('0x26')]+'%'};return _0x58c80e;})});}_0x46c570=_[_0x5254('0x27')]({},_0x46c570,_0x3dfe7b[_0x5254('0x2a')]);return _0x5733e5[_0x5254('0x34')](_0x46c570);}})[_0x5254('0xe')](function(_0x2bf869){if(_0x2bf869){_0x22e792=_0x2bf869['length'];if(!_0x3dfe7b[_0x5254('0x1a')][_0x5254('0x38')](_0x5254('0x22'))){_0x46c570['limit']=qs[_0x5254('0xb')](_0x3dfe7b['query']['limit']);_0x46c570[_0x5254('0x9')]=qs[_0x5254('0x9')](_0x3dfe7b[_0x5254('0x1a')][_0x5254('0x9')]);}return _0x5733e5[_0x5254('0x34')](_0x46c570);}})[_0x5254('0xe')](function(_0x3fc6c2){if(_0x3fc6c2){return _0x3fc6c2?{'count':_0x22e792,'rows':_0x3fc6c2}:null;}})[_0x5254('0xe')](respondWithResult(_0x39bc12,null))[_0x5254('0x2f')](handleError(_0x39bc12,null));};exports[_0x5254('0x39')]=function(_0x3ca45e,_0x116d21){if(_0x3ca45e[_0x5254('0x32')]['id']){delete _0x3ca45e[_0x5254('0x32')]['id'];}return db['Dynamics365Account'][_0x5254('0x35')]({'where':{'id':_0x3ca45e[_0x5254('0x33')]['id']}})['then'](handleEntityNotFound(_0x116d21,null))['then'](function(_0x93ae4a){if(_0x93ae4a){_0x3ca45e[_0x5254('0x32')][_0x5254('0x3a')]=_0x93ae4a['id'];_0x3ca45e[_0x5254('0x32')][_0x5254('0x3b')]=integrations['getSubjects'](_0x3ca45e[_0x5254('0x32')][_0x5254('0x3c')],_0x3ca45e[_0x5254('0x32')]['type']);_0x3ca45e[_0x5254('0x32')][_0x5254('0x3d')]=integrations[_0x5254('0x3e')](_0x3ca45e[_0x5254('0x32')][_0x5254('0x3c')],_0x3ca45e['body'][_0x5254('0x28')]);return db[_0x5254('0x36')][_0x5254('0x31')](_0x3ca45e[_0x5254('0x32')],{'include':[{'model':db[_0x5254('0x3f')],'as':_0x5254('0x3b')},{'model':db['Dynamics365Field'],'as':_0x5254('0x3d')}]});}return null;})[_0x5254('0xe')](respondWithResult(_0x116d21,null))['catch'](handleError(_0x116d21,null));};function sanitizeRemoteUri(_0xd4dbd7){var _0x59bc1c=_0xd4dbd7['slice'](-0x1);if(_0x59bc1c==='/')return _0xd4dbd7[_0x5254('0x40')](0x0,_0xd4dbd7['lastIndexOf'](_0x59bc1c));return _0xd4dbd7;}function getWebApiUrl(_0xcdbb8e){return util['format']('%s/api/data/v9.0/',_0xcdbb8e);}exports[_0x5254('0x41')]=function(_0xd216ba,_0x86d73f){var _0x30e162=_0xd216ba[_0x5254('0x1a')][_0x5254('0x42')];var _0x4b8c91=_0x30e162===_0x5254('0x43')?_0x5254('0x44'):_0x5254('0x45');var _0x59d1ca='';var _0x4cca6c='';var _0x20a902='';var _0x54aaa0='';var _0x23e37b='';var _0x5a24de='';var _0x3e4cc9='';var _0x270745='';var _0x5e5303=[_0x5254('0x46'),_0x5254('0x47'),_0x5254('0x48'),_0x5254('0x49'),_0x5254('0x4a'),_0x5254('0x4b'),_0x5254('0x4c'),_0x5254('0x4d'),'directioncode',_0x5254('0x4e')];var _0x30ed44=['accountidname',_0x5254('0x4f'),_0x5254('0x50'),_0x5254('0x51'),'contactidname',_0x5254('0x52'),_0x5254('0x53'),_0x5254('0x54'),_0x5254('0x55'),_0x5254('0x56'),_0x5254('0x57'),_0x5254('0x58'),_0x5254('0x59'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x5254('0x5a'),'customeridtype','customeridyominame','emailaddress','entitlementidname',_0x5254('0x5b'),_0x5254('0x5c'),'escalatedon',_0x5254('0x5d'),'firstresponsebykpiidname',_0x5254('0x5e'),_0x5254('0x5f'),'influencescore',_0x5254('0x60'),_0x5254('0x61'),'masteridname','modifiedbyexternalpartyname',_0x5254('0x62'),_0x5254('0x63'),_0x5254('0x64'),_0x5254('0x65'),'modifiedonbehalfbyname',_0x5254('0x66'),_0x5254('0x67'),_0x5254('0x68'),_0x5254('0x69'),_0x5254('0x6a'),_0x5254('0x6b'),_0x5254('0x6c'),_0x5254('0x6d'),_0x5254('0x6e'),_0x5254('0x6f'),_0x5254('0x70'),_0x5254('0x71'),_0x5254('0x72'),_0x5254('0x73'),_0x5254('0x74'),_0x5254('0x75'),_0x5254('0x76'),_0x5254('0x77'),'responsiblecontactidname',_0x5254('0x78'),'sentimentvalue','slainvokedidname',_0x5254('0x79'),'socialprofileidname',_0x5254('0x7a'),'statuscode','subjectidname','ticketnumber','timezoneruleversionnumber',_0x5254('0x7b'),_0x5254('0x7c'),'utcconversiontimezonecode',_0x5254('0x7d')];var _0x3e7c57=_0x5e5303[_0x5254('0x7e')](_0x30ed44);return db[_0x5254('0x17')]['findOne']({'where':{'id':_0xd216ba[_0x5254('0x33')]['id']},'attributes':['id',_0x5254('0x7f'),_0x5254('0x80'),_0x5254('0x81'),_0x5254('0x82'),_0x5254('0x83'),_0x5254('0x84'),_0x5254('0x85')],'include':[{'model':db[_0x5254('0x86')],'as':_0x5254('0x86'),'attributes':['id','data5',_0x5254('0x87')]}]})['then'](handleEntityNotFound(_0x86d73f,null))[_0x5254('0xe')](function(_0x14283e){if(_0x14283e){if(_0x14283e[_0x5254('0x85')]){_0x14283e[_0x5254('0x88')]=_0x14283e[_0x5254('0x86')][_0x5254('0x89')];_0x270745=sanitizeRemoteUri(_0x14283e[_0x5254('0x86')][_0x5254('0x87')]);_0x3e4cc9=getWebApiUrl(_0x270745);return _0x14283e;}_0x270745=sanitizeRemoteUri(_0x14283e[_0x5254('0x81')]);_0x3e4cc9=getWebApiUrl(_0x270745);var _0x355a61={'method':_0x5254('0x8a'),'uri':_0x5254('0x8b')+_0x14283e['tenantId']+'/oauth2/token','form':{'client_id':_0x14283e[_0x5254('0x83')],'resource':_0x270745,'username':_0x14283e[_0x5254('0x7f')],'password':_0x14283e[_0x5254('0x80')],'grant_type':_0x5254('0x80'),'client_secret':_0x14283e[_0x5254('0x84')]},'json':!![]};return rp(_0x355a61);}})[_0x5254('0xe')](function(_0x2c0fd7){_0x5a24de=_0x2c0fd7[_0x5254('0x88')];var _0x301ffa={'method':_0x5254('0x8c'),'uri':encodeURI(_0x3e4cc9+_0x5254('0x8d')+_0x4b8c91+'\x27'),'headers':{'Authorization':_0x5254('0x8e')+_0x5a24de,'If-None-Match':null,'OData-Version':_0x5254('0x8f')},'json':!![]};return rp(_0x301ffa);})['then'](function(_0x17da42){var _0x3a20ed=_0x17da42['value'][0x0];var _0x421ec9=_0x3a20ed['MetadataId'];var _0x2186e8={'method':'GET','uri':_0x3e4cc9+_0x5254('0x90')+_0x421ec9+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x5254('0x8e')+_0x5a24de,'If-None-Match':null,'OData-Version':_0x5254('0x8f')},'json':!![]};return rp(_0x2186e8);})[_0x5254('0xe')](function(_0x395211){_0x59d1ca=_0x395211;_0x4cca6c=_0x59d1ca['Attributes'];_0x4cca6c=_[_0x5254('0x91')](_0x4cca6c,function(_0xb670fb){return!_0x3e7c57[_0x5254('0x92')](_0xb670fb[_0x5254('0x93')]);});var _0x48f8a9=[];var _0x577ff8=[];_0x4cca6c['forEach'](function(_0x39f6ee){if(_0x39f6ee[_0x5254('0x94')]){var _0x19d7cb=_0x39f6ee['@odata.type'][_0x5254('0x40')](_0x39f6ee[_0x5254('0x94')][_0x5254('0x95')]('.')+0x1);if(_0x19d7cb===_0x5254('0x96')){_0x48f8a9[_0x5254('0x97')](getSelectList(_0x3e4cc9,_0x30e162,_0x577ff8,_0x59d1ca[_0x5254('0x98')],_0x39f6ee['MetadataId'],_0x5a24de));}}});return Promise[_0x5254('0x99')](_0x48f8a9);})['then'](function(_0x87f6d0){_0x20a902=_0x87f6d0[0x0];var _0x43dcf9=[];var _0x54838f=[];_0x4cca6c[_0x5254('0x9a')](function(_0x1a1de3){if(!_[_0x5254('0x9b')](_0x1a1de3[_0x5254('0x94')])){var _0x1d1565=_0x1a1de3[_0x5254('0x94')]['substring'](_0x1a1de3['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1d1565===_0x5254('0x9c')){_0x43dcf9['push'](getBooleanList(_0x3e4cc9,_0x30e162,_0x54838f,_0x59d1ca['MetadataId'],_0x1a1de3[_0x5254('0x98')],_0x5a24de));}}});return Promise[_0x5254('0x99')](_0x43dcf9);})[_0x5254('0xe')](function(_0x3c9d61){_0x54aaa0=_0x3c9d61[0x0];var _0x59f50a=[];var _0x259ab3=[];_0x4cca6c[_0x5254('0x9a')](function(_0x4d6a04){if(_0x4d6a04['@odata.type']){var _0x5d4de0=_0x4d6a04['@odata.type'][_0x5254('0x40')](_0x4d6a04['@odata.type'][_0x5254('0x95')]('.')+0x1);if(_0x5d4de0===_0x5254('0x9d')||_0x5d4de0==='DoubleAttributeMetadata'||_0x5d4de0===_0x5254('0x9e')||_0x5d4de0===_0x5254('0x9f')||_0x5d4de0===_0x5254('0xa0')||_0x5d4de0===_0x5254('0xa1')||_0x5d4de0===_0x5254('0xa2')||_0x5d4de0==='EntityNameAttributeMetadata'||_0x5d4de0===_0x5254('0xa3')||_0x5d4de0===_0x5254('0xa4')){_0x59f50a['push'](getInputList(_0x3e4cc9,_0x30e162,_0x5d4de0,_0x259ab3,_0x59d1ca[_0x5254('0x98')],_0x4d6a04[_0x5254('0x98')],_0x5a24de));}}});return Promise[_0x5254('0x99')](_0x59f50a);})[_0x5254('0xe')](function(_0x38eeff){_0x23e37b=_0x38eeff[0x0];var _0x29fb11=_0x20a902[_0x5254('0x7e')](_0x54aaa0)['concat'](_0x23e37b);var _0x3c6a1d={'count':_0x29fb11[_0x5254('0x21')],'rows':_0x29fb11};return _0x3c6a1d;})['then'](respondWithResult(_0x86d73f,null))[_0x5254('0x2f')](function(_0x4b626a){var _0x269f71=_0xd216ba[_0x5254('0x1a')]['test']?0x1f4:_0x4b626a[_0x5254('0xa5')]||0x1f4;logger[_0x5254('0x11')](_0x4b626a[_0x5254('0x12')]);delete _0x4b626a[_0x5254('0x13')];if(_0x269f71===0x191){_0x269f71=0x190;}_0x86d73f[_0x5254('0x7')](_0x269f71)[_0x5254('0x14')](_0xd216ba['query'][_0x5254('0xa6')]?{'message':_0x5254('0xa7'),'statusCode':_0x4b626a[_0x5254('0xa5')]}:_0x4b626a);});};function getSelectList(_0x206f85,_0xcaa419,_0x52f230,_0x4b70d1,_0x397a46,_0x4b3ce7){var _0x2a53f5={'method':_0x5254('0x8c'),'uri':_0x206f85+_0x5254('0x90')+_0x4b70d1+_0x5254('0xa8')+_0x397a46+_0x5254('0xa9')+_0x5254('0xaa'),'headers':{'Authorization':_0x5254('0x8e')+_0x4b3ce7,'If-None-Match':null,'OData-Version':_0x5254('0x8f')},'json':!![]};return rp(_0x2a53f5)[_0x5254('0xe')](function(_0x5b073f){var _0x3cb9cd=[];var _0x33d8ed=_0x5b073f[_0x5254('0xab')][_0x5254('0xac')];_0x33d8ed['forEach'](function(_0x1183c8){_0x3cb9cd['push']({'name':_0x1183c8[_0x5254('0xad')][_0x5254('0xae')]['Label'],'value':String(_0x1183c8[_0x5254('0xaf')])});});var _0x268ca3={'id':_0xcaa419+'_'+_0x5b073f[_0x5254('0x93')],'name':_0x5b073f[_0x5254('0xb0')][_0x5254('0xae')][_0x5254('0xad')],'custom':![],'options':_0x3cb9cd};_0x52f230[_0x5254('0x97')](_0x268ca3);return _0x52f230;});}function getBooleanList(_0x28a447,_0x10d916,_0x1e3b96,_0x53478a,_0x52228b,_0x41a849){var _0x3d5151={'method':_0x5254('0x8c'),'uri':_0x28a447+_0x5254('0x90')+_0x53478a+_0x5254('0xa8')+_0x52228b+_0x5254('0xb1'),'headers':{'Authorization':_0x5254('0x8e')+_0x41a849,'If-None-Match':null,'OData-Version':_0x5254('0x8f')},'json':!![]};return rp(_0x3d5151)['then'](function(_0x212368){var _0x23f1ff=[];_0x23f1ff['push']({'name':_0x212368[_0x5254('0xab')][_0x5254('0xb2')]['Label'][_0x5254('0xae')][_0x5254('0xad')],'value':_0x5254('0xb3')},{'name':_0x212368['OptionSet']['FalseOption'][_0x5254('0xad')][_0x5254('0xae')][_0x5254('0xad')],'value':_0x5254('0xb4')});var _0x52d7db={'id':_0x10d916+'_'+_0x212368[_0x5254('0x93')],'name':_0x212368[_0x5254('0xb0')][_0x5254('0xae')][_0x5254('0xad')],'custom':![],'options':_0x23f1ff};_0x1e3b96[_0x5254('0x97')](_0x52d7db);return _0x1e3b96;});}function getInputList(_0x409451,_0x1b0a5e,_0x4bac90,_0x5ed002,_0xe5309c,_0x302fc9,_0x47e3c9){var _0x57ed7d={'method':_0x5254('0x8c'),'uri':_0x409451+_0x5254('0x90')+_0xe5309c+_0x5254('0xa8')+_0x302fc9+_0x5254('0xb5')+_0x4bac90+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5254('0x8e')+_0x47e3c9,'If-None-Match':null,'OData-Version':_0x5254('0x8f')},'json':!![]};return rp(_0x57ed7d)['then'](function(_0x115594){var _0x6137c8={'id':_0x1b0a5e+'_'+_0x115594[_0x5254('0x93')],'name':_0x115594['DisplayName'][_0x5254('0xae')]?_0x115594[_0x5254('0xb0')][_0x5254('0xae')][_0x5254('0xad')]:_0x115594[_0x5254('0x93')],'custom':![],'options':[]};_0x5ed002[_0x5254('0x97')](_0x6137c8);return _0x5ed002;});} \ No newline at end of file +var _0x0fc6=['UserLocalizedLabel','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','modernAuthentication','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','forEach','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Bearer\x20','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption'];(function(_0x2141e1,_0x523aff){var _0x59db37=function(_0x1ffc7c){while(--_0x1ffc7c){_0x2141e1['push'](_0x2141e1['shift']());}};_0x59db37(++_0x523aff);}(_0x0fc6,0x176));var _0x60fc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0fc6[_0x42cae2];return _0x5f256f;};'use strict';var rp=require(_0x60fc('0x0'));var util=require(_0x60fc('0x1'));var _=require(_0x60fc('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x60fc('0x3'))(_0x60fc('0x4'));var db=require(_0x60fc('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x322322,_0x4eaa25){_0x4eaa25=_0x4eaa25||0xc8;return function(_0x23c1d7){if(_0x23c1d7){return _0x322322[_0x60fc('0x6')](_0x4eaa25)['json'](_0x23c1d7);}};}function respondWithFilteredResult(_0x3491cc,_0x823732){return function(_0x2b5923){if(_0x2b5923){var _0x1cf074=typeof _0x823732[_0x60fc('0x7')]===_0x60fc('0x8')&&typeof _0x823732[_0x60fc('0x9')]==='undefined';var _0x1de3a6=_0x2b5923[_0x60fc('0xa')];var _0x396740=_0x1cf074?0x0:_0x823732[_0x60fc('0x7')];var _0x5a7536=_0x1cf074?_0x2b5923[_0x60fc('0xa')]:_0x823732[_0x60fc('0x7')]+_0x823732['limit'];var _0x11d555;if(_0x5a7536>=_0x1de3a6){_0x5a7536=_0x1de3a6;_0x11d555=0xc8;}else{_0x11d555=0xce;}_0x3491cc[_0x60fc('0x6')](_0x11d555);return _0x3491cc[_0x60fc('0xb')]('Content-Range',_0x396740+'-'+_0x5a7536+'/'+_0x1de3a6)['json'](_0x2b5923);}return null;};}function saveUpdates(_0xb6d714){return function(_0x2c836a){if(_0x2c836a){return _0x2c836a[_0x60fc('0xc')](_0xb6d714)[_0x60fc('0xd')](function(_0x175070){return _0x175070;});}return null;};}function removeEntity(_0x58ef07){return function(_0x435f22){if(_0x435f22){return _0x435f22[_0x60fc('0xe')]()[_0x60fc('0xd')](function(){_0x58ef07[_0x60fc('0x6')](0xcc)[_0x60fc('0xf')]();});}};}function handleEntityNotFound(_0xc75a8c){return function(_0x4e9bf6){if(!_0x4e9bf6){_0xc75a8c[_0x60fc('0x10')](0x194);}return _0x4e9bf6;};}function handleError(_0x3816e2,_0x522902){_0x522902=_0x522902||0x1f4;return function(_0x4d76c2){logger[_0x60fc('0x11')](_0x4d76c2['stack']);if(_0x4d76c2['name']){delete _0x4d76c2[_0x60fc('0x12')];}_0x3816e2[_0x60fc('0x6')](_0x522902)[_0x60fc('0x13')](_0x4d76c2);};}exports[_0x60fc('0x14')]=function(_0x4f236f,_0x307e51){var _0x25e5e8={},_0x27ab90={},_0x37f09d={'count':0x0,'rows':[]};var _0x4a9b8e=_[_0x60fc('0x15')](db[_0x60fc('0x16')][_0x60fc('0x17')],function(_0x2284b0){return{'name':_0x2284b0[_0x60fc('0x18')],'type':_0x2284b0[_0x60fc('0x19')]['key']};});_0x27ab90['model']=_[_0x60fc('0x15')](_0x4a9b8e,_0x60fc('0x12'));_0x27ab90[_0x60fc('0x1a')]=_[_0x60fc('0x1b')](_0x4f236f[_0x60fc('0x1a')]);_0x27ab90[_0x60fc('0x1c')]=_[_0x60fc('0x1d')](_0x27ab90['model'],_0x27ab90[_0x60fc('0x1a')]);_0x25e5e8[_0x60fc('0x1e')]=_['intersection'](_0x27ab90[_0x60fc('0x1f')],qs[_0x60fc('0x20')](_0x4f236f['query']['fields']));_0x25e5e8[_0x60fc('0x1e')]=_0x25e5e8[_0x60fc('0x1e')][_0x60fc('0x21')]?_0x25e5e8[_0x60fc('0x1e')]:_0x27ab90[_0x60fc('0x1f')];if(!_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x22')]('nolimit')){_0x25e5e8[_0x60fc('0x9')]=qs[_0x60fc('0x9')](_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x9')]);_0x25e5e8[_0x60fc('0x7')]=qs[_0x60fc('0x7')](_0x4f236f[_0x60fc('0x1a')]['offset']);}_0x25e5e8[_0x60fc('0x23')]=qs[_0x60fc('0x24')](_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x24')]);_0x25e5e8['where']=qs[_0x60fc('0x1c')](_['pick'](_0x4f236f[_0x60fc('0x1a')],_0x27ab90['filters']),_0x4a9b8e);if(_0x4f236f['query'][_0x60fc('0x25')]){_0x25e5e8[_0x60fc('0x26')]=_[_0x60fc('0x27')](_0x25e5e8['where'],{'$or':_[_0x60fc('0x15')](_0x4a9b8e,function(_0xdc3bc5){if(_0xdc3bc5[_0x60fc('0x19')]!=='VIRTUAL'){var _0x59dfd1={};_0x59dfd1[_0xdc3bc5[_0x60fc('0x12')]]={'$like':'%'+_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x25')]+'%'};return _0x59dfd1;}})});}_0x25e5e8=_['merge']({},_0x25e5e8,_0x4f236f['options']);var _0x2fc68e={'where':_0x25e5e8[_0x60fc('0x26')]};return db[_0x60fc('0x16')][_0x60fc('0xa')](_0x2fc68e)[_0x60fc('0xd')](function(_0x5d30ab){_0x37f09d[_0x60fc('0xa')]=_0x5d30ab;if(_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x28')]){_0x25e5e8[_0x60fc('0x29')]=[{'all':!![]}];}return db[_0x60fc('0x16')]['findAll'](_0x25e5e8);})[_0x60fc('0xd')](function(_0x3cb6ec){_0x37f09d[_0x60fc('0x2a')]=_0x3cb6ec;return _0x37f09d;})[_0x60fc('0xd')](respondWithFilteredResult(_0x307e51,_0x25e5e8))[_0x60fc('0x2b')](handleError(_0x307e51,null));};exports[_0x60fc('0x2c')]=function(_0x363a02,_0x70f9ce){var _0x43e1f8={'raw':![],'where':{'id':_0x363a02[_0x60fc('0x2d')]['id']}},_0x152e3={};_0x152e3[_0x60fc('0x1f')]=_['keys'](db[_0x60fc('0x16')][_0x60fc('0x17')]);_0x152e3[_0x60fc('0x1a')]=_[_0x60fc('0x1b')](_0x363a02[_0x60fc('0x1a')]);_0x152e3[_0x60fc('0x1c')]=_[_0x60fc('0x1d')](_0x152e3[_0x60fc('0x1f')],_0x152e3[_0x60fc('0x1a')]);_0x43e1f8[_0x60fc('0x1e')]=_[_0x60fc('0x1d')](_0x152e3[_0x60fc('0x1f')],qs['fields'](_0x363a02[_0x60fc('0x1a')][_0x60fc('0x20')]));_0x43e1f8['attributes']=_0x43e1f8[_0x60fc('0x1e')]['length']?_0x43e1f8[_0x60fc('0x1e')]:_0x152e3[_0x60fc('0x1f')];if(_0x363a02[_0x60fc('0x1a')][_0x60fc('0x28')]){_0x43e1f8[_0x60fc('0x29')]=[{'all':!![]}];}_0x43e1f8=_['merge']({},_0x43e1f8,_0x363a02['options']);return db[_0x60fc('0x16')][_0x60fc('0x2e')](_0x43e1f8)[_0x60fc('0xd')](handleEntityNotFound(_0x70f9ce,null))['then'](respondWithResult(_0x70f9ce,null))['catch'](handleError(_0x70f9ce,null));};exports[_0x60fc('0x2f')]=function(_0x45cc96,_0x1693dd){return db['Dynamics365Account'][_0x60fc('0x2f')](_0x45cc96[_0x60fc('0x30')],{})[_0x60fc('0xd')](respondWithResult(_0x1693dd,0xc9))['catch'](handleError(_0x1693dd,null));};exports['update']=function(_0x4aa923,_0x2474de){if(_0x4aa923[_0x60fc('0x30')]['id']){delete _0x4aa923['body']['id'];}return db[_0x60fc('0x16')][_0x60fc('0x2e')]({'where':{'id':_0x4aa923[_0x60fc('0x2d')]['id']}})[_0x60fc('0xd')](handleEntityNotFound(_0x2474de,null))[_0x60fc('0xd')](saveUpdates(_0x4aa923[_0x60fc('0x30')],null))[_0x60fc('0xd')](respondWithResult(_0x2474de,null))[_0x60fc('0x2b')](handleError(_0x2474de,null));};exports[_0x60fc('0xe')]=function(_0x8b8f6a,_0x524e17){return db[_0x60fc('0x16')]['find']({'where':{'id':_0x8b8f6a[_0x60fc('0x2d')]['id']}})['then'](handleEntityNotFound(_0x524e17,null))[_0x60fc('0xd')](removeEntity(_0x524e17,null))[_0x60fc('0x2b')](handleError(_0x524e17,null));};exports[_0x60fc('0x31')]=function(_0x24ec45,_0x58af1d){var _0x1dd032={};var _0x5b6a9c={};var _0xeee94d;var _0x5becaf;return db[_0x60fc('0x16')][_0x60fc('0x32')]({'where':{'id':_0x24ec45['params']['id']}})['then'](handleEntityNotFound(_0x58af1d,null))[_0x60fc('0xd')](function(_0x4669e3){if(_0x4669e3){_0xeee94d=_0x4669e3;_0x5b6a9c['model']=_[_0x60fc('0x1b')](db[_0x60fc('0x33')][_0x60fc('0x17')]);_0x5b6a9c[_0x60fc('0x1a')]=_[_0x60fc('0x1b')](_0x24ec45[_0x60fc('0x1a')]);_0x5b6a9c[_0x60fc('0x1c')]=_['intersection'](_0x5b6a9c[_0x60fc('0x1f')],_0x5b6a9c[_0x60fc('0x1a')]);_0x1dd032[_0x60fc('0x1e')]=_[_0x60fc('0x1d')](_0x5b6a9c[_0x60fc('0x1f')],qs[_0x60fc('0x20')](_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x20')]));_0x1dd032[_0x60fc('0x1e')]=_0x1dd032[_0x60fc('0x1e')][_0x60fc('0x21')]?_0x1dd032[_0x60fc('0x1e')]:_0x5b6a9c['model'];_0x1dd032['order']=qs[_0x60fc('0x24')](_0x24ec45['query'][_0x60fc('0x24')]);_0x1dd032[_0x60fc('0x26')]=qs['filters'](_['pick'](_0x24ec45[_0x60fc('0x1a')],_0x5b6a9c['filters']));if(_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x25')]){_0x1dd032[_0x60fc('0x26')]=_[_0x60fc('0x27')](_0x1dd032[_0x60fc('0x26')],{'$or':_[_0x60fc('0x15')](_0x1dd032['attributes'],function(_0x16c692){var _0x8fbd06={};_0x8fbd06[_0x16c692]={'$like':'%'+_0x24ec45['query'][_0x60fc('0x25')]+'%'};return _0x8fbd06;})});}_0x1dd032=_['merge']({},_0x1dd032,_0x24ec45['options']);return _0xeee94d[_0x60fc('0x31')](_0x1dd032);}})[_0x60fc('0xd')](function(_0x1f59fa){if(_0x1f59fa){_0x5becaf=_0x1f59fa['length'];if(!_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x22')]('nolimit')){_0x1dd032[_0x60fc('0x9')]=qs['limit'](_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x9')]);_0x1dd032[_0x60fc('0x7')]=qs[_0x60fc('0x7')](_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x7')]);}return _0xeee94d[_0x60fc('0x31')](_0x1dd032);}})[_0x60fc('0xd')](function(_0xdcf72a){if(_0xdcf72a){return _0xdcf72a?{'count':_0x5becaf,'rows':_0xdcf72a}:null;}})[_0x60fc('0xd')](respondWithResult(_0x58af1d,null))[_0x60fc('0x2b')](handleError(_0x58af1d,null));};exports[_0x60fc('0x34')]=function(_0x56cba8,_0xed6430){if(_0x56cba8[_0x60fc('0x30')]['id']){delete _0x56cba8['body']['id'];}return db[_0x60fc('0x16')][_0x60fc('0x32')]({'where':{'id':_0x56cba8[_0x60fc('0x2d')]['id']}})[_0x60fc('0xd')](handleEntityNotFound(_0xed6430,null))['then'](function(_0x2323f0){if(_0x2323f0){_0x56cba8[_0x60fc('0x30')][_0x60fc('0x35')]=_0x2323f0['id'];_0x56cba8[_0x60fc('0x30')][_0x60fc('0x36')]=integrations[_0x60fc('0x37')](_0x56cba8[_0x60fc('0x30')][_0x60fc('0x38')],_0x56cba8[_0x60fc('0x30')][_0x60fc('0x19')]);_0x56cba8[_0x60fc('0x30')]['Descriptions']=integrations[_0x60fc('0x39')](_0x56cba8[_0x60fc('0x30')][_0x60fc('0x38')],_0x56cba8['body']['type']);return db[_0x60fc('0x33')][_0x60fc('0x2f')](_0x56cba8[_0x60fc('0x30')],{'include':[{'model':db[_0x60fc('0x3a')],'as':_0x60fc('0x36')},{'model':db[_0x60fc('0x3a')],'as':_0x60fc('0x3b')}]});}return null;})[_0x60fc('0xd')](respondWithResult(_0xed6430,null))['catch'](handleError(_0xed6430,null));};function sanitizeRemoteUri(_0x2da367){var _0x190694=_0x2da367[_0x60fc('0x3c')](-0x1);if(_0x190694==='/')return _0x2da367[_0x60fc('0x3d')](0x0,_0x2da367[_0x60fc('0x3e')](_0x190694));return _0x2da367;}function getWebApiUrl(_0x22ac78){return util[_0x60fc('0x3f')](_0x60fc('0x40'),_0x22ac78);}exports[_0x60fc('0x41')]=function(_0x89db9c,_0x3389d0){var _0x247dac=_0x89db9c[_0x60fc('0x1a')][_0x60fc('0x42')];var _0x3af3ea=_0x247dac===_0x60fc('0x43')?_0x60fc('0x44'):_0x60fc('0x45');var _0x5a24fa='';var _0x3c9492='';var _0x22292f='';var _0x405c9b='';var _0x258afe='';var _0x5a2a01='';var _0x197687='';var _0x146423='';var _0x381fee=['title',_0x60fc('0x46'),'customerid',_0x60fc('0x47'),_0x60fc('0x48'),'subject',_0x60fc('0x49'),_0x60fc('0x4a'),_0x60fc('0x4b'),_0x60fc('0x4c')];var _0x145986=[_0x60fc('0x4d'),_0x60fc('0x4e'),_0x60fc('0x4f'),_0x60fc('0x50'),_0x60fc('0x51'),_0x60fc('0x52'),'contractdetailidname',_0x60fc('0x53'),_0x60fc('0x54'),'createdbyexternalpartyyominame',_0x60fc('0x55'),'createdbyyominame',_0x60fc('0x56'),'createdonbehalfbyname',_0x60fc('0x57'),'customeridname','customeridtype',_0x60fc('0x58'),'emailaddress',_0x60fc('0x59'),_0x60fc('0x5a'),_0x60fc('0x5b'),_0x60fc('0x5c'),_0x60fc('0x5d'),_0x60fc('0x5e'),_0x60fc('0x5f'),_0x60fc('0x60'),_0x60fc('0x61'),_0x60fc('0x62'),_0x60fc('0x63'),_0x60fc('0x64'),_0x60fc('0x65'),_0x60fc('0x66'),'modifiedbyname',_0x60fc('0x67'),_0x60fc('0x68'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x60fc('0x69'),_0x60fc('0x6a'),_0x60fc('0x6b'),_0x60fc('0x6c'),'overriddencreatedon','owneridname','owneridtype',_0x60fc('0x6d'),_0x60fc('0x6e'),_0x60fc('0x6f'),_0x60fc('0x70'),'prioritycodename','productidname','productserialnumber',_0x60fc('0x71'),_0x60fc('0x72'),_0x60fc('0x73'),_0x60fc('0x74'),_0x60fc('0x75'),'sentimentvalue','slainvokedidname',_0x60fc('0x76'),'socialprofileidname','statecode','statuscode','subjectidname',_0x60fc('0x77'),_0x60fc('0x78'),_0x60fc('0x79'),_0x60fc('0x7a'),_0x60fc('0x7b'),_0x60fc('0x7c')];var _0x17926f=_0x381fee[_0x60fc('0x7d')](_0x145986);return db[_0x60fc('0x16')][_0x60fc('0x32')]({'where':{'id':_0x89db9c['params']['id']},'attributes':['id',_0x60fc('0x7e'),'password',_0x60fc('0x7f'),_0x60fc('0x80'),_0x60fc('0x81'),_0x60fc('0x82'),'modernAuthentication'],'include':[{'model':db[_0x60fc('0x83')],'as':_0x60fc('0x83'),'attributes':['id',_0x60fc('0x84'),'data7']}]})[_0x60fc('0xd')](handleEntityNotFound(_0x3389d0,null))[_0x60fc('0xd')](function(_0x3e25fd){if(_0x3e25fd){if(_0x3e25fd[_0x60fc('0x85')]){_0x3e25fd[_0x60fc('0x86')]=_0x3e25fd['CloudProvider'][_0x60fc('0x84')];_0x146423=sanitizeRemoteUri(_0x3e25fd[_0x60fc('0x83')][_0x60fc('0x87')]);_0x197687=getWebApiUrl(_0x146423);return _0x3e25fd;}_0x146423=sanitizeRemoteUri(_0x3e25fd[_0x60fc('0x7f')]);_0x197687=getWebApiUrl(_0x146423);var _0x5a6ed4={'method':_0x60fc('0x88'),'uri':_0x60fc('0x89')+_0x3e25fd[_0x60fc('0x80')]+_0x60fc('0x8a'),'form':{'client_id':_0x3e25fd['clientId'],'resource':_0x146423,'username':_0x3e25fd['username'],'password':_0x3e25fd['password'],'grant_type':'password','client_secret':_0x3e25fd[_0x60fc('0x82')]},'json':!![]};return rp(_0x5a6ed4);}})[_0x60fc('0xd')](function(_0x49342a){_0x5a2a01=_0x49342a[_0x60fc('0x86')];var _0x1a68fd={'method':_0x60fc('0x8b'),'uri':encodeURI(_0x197687+_0x60fc('0x8c')+_0x3af3ea+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5a2a01,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a68fd);})[_0x60fc('0xd')](function(_0x1f5740){var _0x89c4ed=_0x1f5740[_0x60fc('0x8d')][0x0];var _0x15fa99=_0x89c4ed['MetadataId'];var _0x18fee4={'method':_0x60fc('0x8b'),'uri':_0x197687+_0x60fc('0x8e')+_0x15fa99+_0x60fc('0x8f'),'headers':{'Authorization':'Bearer\x20'+_0x5a2a01,'If-None-Match':null,'OData-Version':_0x60fc('0x90')},'json':!![]};return rp(_0x18fee4);})['then'](function(_0x4669cb){_0x5a24fa=_0x4669cb;_0x3c9492=_0x5a24fa['Attributes'];_0x3c9492=_[_0x60fc('0x91')](_0x3c9492,function(_0x29c16a){return!_0x17926f[_0x60fc('0x92')](_0x29c16a[_0x60fc('0x93')]);});var _0x558069=[];var _0x12eb0c=[];_0x3c9492['forEach'](function(_0x5b2313){if(_0x5b2313[_0x60fc('0x94')]){var _0x1fc26d=_0x5b2313[_0x60fc('0x94')][_0x60fc('0x3d')](_0x5b2313[_0x60fc('0x94')][_0x60fc('0x3e')]('.')+0x1);if(_0x1fc26d===_0x60fc('0x95')){_0x558069[_0x60fc('0x96')](getSelectList(_0x197687,_0x247dac,_0x12eb0c,_0x5a24fa[_0x60fc('0x97')],_0x5b2313[_0x60fc('0x97')],_0x5a2a01));}}});return Promise['all'](_0x558069);})[_0x60fc('0xd')](function(_0x48cb52){_0x22292f=_0x48cb52[0x0];var _0x55f150=[];var _0x4a71bc=[];_0x3c9492[_0x60fc('0x98')](function(_0xe429b7){if(!_['isNil'](_0xe429b7[_0x60fc('0x94')])){var _0x3c9973=_0xe429b7[_0x60fc('0x94')]['substring'](_0xe429b7['@odata.type'][_0x60fc('0x3e')]('.')+0x1);if(_0x3c9973===_0x60fc('0x99')){_0x55f150[_0x60fc('0x96')](getBooleanList(_0x197687,_0x247dac,_0x4a71bc,_0x5a24fa['MetadataId'],_0xe429b7['MetadataId'],_0x5a2a01));}}});return Promise['all'](_0x55f150);})[_0x60fc('0xd')](function(_0x33d9fb){_0x405c9b=_0x33d9fb[0x0];var _0x1d9c5b=[];var _0x2ce374=[];_0x3c9492[_0x60fc('0x98')](function(_0x224e9c){if(_0x224e9c[_0x60fc('0x94')]){var _0x563d70=_0x224e9c[_0x60fc('0x94')][_0x60fc('0x3d')](_0x224e9c[_0x60fc('0x94')][_0x60fc('0x3e')]('.')+0x1);if(_0x563d70===_0x60fc('0x9a')||_0x563d70===_0x60fc('0x9b')||_0x563d70===_0x60fc('0x9c')||_0x563d70===_0x60fc('0x9d')||_0x563d70===_0x60fc('0x9e')||_0x563d70===_0x60fc('0x9f')||_0x563d70===_0x60fc('0xa0')||_0x563d70===_0x60fc('0xa1')||_0x563d70===_0x60fc('0xa2')||_0x563d70===_0x60fc('0xa3')){_0x1d9c5b[_0x60fc('0x96')](getInputList(_0x197687,_0x247dac,_0x563d70,_0x2ce374,_0x5a24fa[_0x60fc('0x97')],_0x224e9c[_0x60fc('0x97')],_0x5a2a01));}}});return Promise[_0x60fc('0xa4')](_0x1d9c5b);})['then'](function(_0x33e084){_0x258afe=_0x33e084[0x0];var _0x1e5738=_0x22292f[_0x60fc('0x7d')](_0x405c9b)[_0x60fc('0x7d')](_0x258afe);var _0xe0e255={'count':_0x1e5738[_0x60fc('0x21')],'rows':_0x1e5738};return _0xe0e255;})[_0x60fc('0xd')](respondWithResult(_0x3389d0,null))[_0x60fc('0x2b')](function(_0x396e18){var _0x19a4b3=_0x89db9c[_0x60fc('0x1a')][_0x60fc('0xa5')]?0x1f4:_0x396e18[_0x60fc('0xa6')]||0x1f4;logger[_0x60fc('0x11')](_0x396e18['stack']);delete _0x396e18[_0x60fc('0x12')];if(_0x19a4b3===0x191){_0x19a4b3=0x190;}_0x3389d0[_0x60fc('0x6')](_0x19a4b3)['send'](_0x89db9c[_0x60fc('0x1a')]['test']?{'message':_0x60fc('0xa7'),'statusCode':_0x396e18[_0x60fc('0xa6')]}:_0x396e18);});};function getSelectList(_0x56afb2,_0x5c7b05,_0x5444f1,_0x5015e5,_0x1d1651,_0x55096b){var _0x2361a9={'method':_0x60fc('0x8b'),'uri':_0x56afb2+_0x60fc('0x8e')+_0x5015e5+_0x60fc('0xa8')+_0x1d1651+_0x60fc('0xa9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x60fc('0xaa')+_0x55096b,'If-None-Match':null,'OData-Version':_0x60fc('0x90')},'json':!![]};return rp(_0x2361a9)[_0x60fc('0xd')](function(_0x5ce310){var _0x34cf67=[];var _0x2a2356=_0x5ce310[_0x60fc('0xab')][_0x60fc('0xac')];_0x2a2356['forEach'](function(_0x5361c9){_0x34cf67[_0x60fc('0x96')]({'name':_0x5361c9[_0x60fc('0xad')]['UserLocalizedLabel'][_0x60fc('0xad')],'value':String(_0x5361c9[_0x60fc('0xae')])});});var _0x4394d0={'id':_0x5c7b05+'_'+_0x5ce310[_0x60fc('0x93')],'name':_0x5ce310[_0x60fc('0xaf')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x34cf67};_0x5444f1[_0x60fc('0x96')](_0x4394d0);return _0x5444f1;});}function getBooleanList(_0x1775e6,_0x3b2a2c,_0x21074f,_0x300e39,_0x3ea096,_0x3897e2){var _0x2dbd0d={'method':_0x60fc('0x8b'),'uri':_0x1775e6+'EntityDefinitions('+_0x300e39+_0x60fc('0xa8')+_0x3ea096+_0x60fc('0xb0'),'headers':{'Authorization':_0x60fc('0xaa')+_0x3897e2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2dbd0d)['then'](function(_0x639680){var _0x58d11c=[];_0x58d11c[_0x60fc('0x96')]({'name':_0x639680['OptionSet'][_0x60fc('0xb1')][_0x60fc('0xad')][_0x60fc('0xb2')]['Label'],'value':_0x60fc('0xb3')},{'name':_0x639680['OptionSet'][_0x60fc('0xb4')][_0x60fc('0xad')][_0x60fc('0xb2')][_0x60fc('0xad')],'value':_0x60fc('0xb5')});var _0x578f91={'id':_0x3b2a2c+'_'+_0x639680[_0x60fc('0x93')],'name':_0x639680[_0x60fc('0xaf')][_0x60fc('0xb2')][_0x60fc('0xad')],'custom':![],'options':_0x58d11c};_0x21074f['push'](_0x578f91);return _0x21074f;});}function getInputList(_0x3cac52,_0x57a016,_0x34021d,_0x254df6,_0x2b2d57,_0x2d910a,_0x1e6520){var _0x89a297={'method':_0x60fc('0x8b'),'uri':_0x3cac52+'EntityDefinitions('+_0x2b2d57+_0x60fc('0xa8')+_0x2d910a+_0x60fc('0xb6')+_0x34021d+_0x60fc('0xb7'),'headers':{'Authorization':'Bearer\x20'+_0x1e6520,'If-None-Match':null,'OData-Version':_0x60fc('0x90')},'json':!![]};return rp(_0x89a297)[_0x60fc('0xd')](function(_0x4ad9f1){var _0x2f947c={'id':_0x57a016+'_'+_0x4ad9f1['LogicalName'],'name':_0x4ad9f1[_0x60fc('0xaf')][_0x60fc('0xb2')]?_0x4ad9f1[_0x60fc('0xaf')][_0x60fc('0xb2')][_0x60fc('0xad')]:_0x4ad9f1[_0x60fc('0x93')],'custom':![],'options':[]};_0x254df6[_0x60fc('0x96')](_0x2f947c);return _0x254df6;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index d325b3a..1be224b 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cfdde,_0x2beace){var _0x179ab5=function(_0x1ceefd){while(--_0x1ceefd){_0x5cfdde['push'](_0x5cfdde['shift']());}};_0x179ab5(++_0x2beace);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x42da3c,_0x52ed26){var _0x3006af=function(_0x1ebabf){while(--_0x1ebabf){_0x42da3c['push'](_0x42da3c['shift']());}};_0x3006af(++_0x52ed26);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'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 bfb748e..0a24b6b 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 _0x752d=['request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','catch','options','raw','where','attributes','include','map','model','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x2005bf,_0x541d17){var _0x24c5a6=function(_0x7dc383){while(--_0x7dc383){_0x2005bf['push'](_0x2005bf['shift']());}};_0x24c5a6(++_0x541d17);}(_0x752d,0x150));var _0xd752=function(_0xbfb7bc,_0x89e46f){_0xbfb7bc=_0xbfb7bc-0x0;var _0x1136a8=_0x752d[_0xbfb7bc];return _0x1136a8;};'use strict';var _=require('lodash');var util=require(_0xd752('0x0'));var moment=require(_0xd752('0x1'));var BPromise=require(_0xd752('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd752('0x3'))['db'];var utils=require(_0xd752('0x4'));var logger=require('../../config/logger')(_0xd752('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd752('0x6')][_0xd752('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37ac40,_0x4ccf5c,_0x30d000){return new BPromise(function(_0x310a99,_0x4a28d3){return client[_0xd752('0x8')](_0x37ac40,_0x30d000)[_0xd752('0x9')](function(_0x5b4345){logger[_0xd752('0xa')](_0xd752('0xb'),_0x4ccf5c,_0xd752('0xc'));logger[_0xd752('0xd')](_0xd752('0xe'),_0x4ccf5c,'request\x20sent',JSON['stringify'](_0x5b4345));if(_0x5b4345['error']){if(_0x5b4345[_0xd752('0xf')][_0xd752('0x10')]===0x1f4){logger['error'](_0xd752('0xb'),_0x4ccf5c,_0x5b4345['error'][_0xd752('0x11')]);return _0x4a28d3(_0x5b4345[_0xd752('0xf')]['message']);}logger[_0xd752('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x4ccf5c,_0x5b4345[_0xd752('0xf')][_0xd752('0x11')]);return _0x310a99(_0x5b4345[_0xd752('0xf')][_0xd752('0x11')]);}else{logger[_0xd752('0xa')](_0xd752('0xb'),_0x4ccf5c,_0xd752('0xc'));_0x310a99(_0x5b4345['result'][_0xd752('0x11')]);}})[_0xd752('0x12')](function(_0x1c7cad){logger['error'](_0xd752('0xb'),_0x4ccf5c,_0x1c7cad);_0x4a28d3(_0x1c7cad);});});}exports['GetDynamics365Account']=function(_0x18ccba){var _0x17ca17=this;return new Promise(function(_0x8eed42,_0x22d96c){return db['Dynamics365Account']['findAll']({'raw':_0x18ccba[_0xd752('0x13')]?_0x18ccba[_0xd752('0x13')][_0xd752('0x14')]===undefined?!![]:![]:!![],'where':_0x18ccba[_0xd752('0x13')]?_0x18ccba['options'][_0xd752('0x15')]||null:null,'attributes':_0x18ccba[_0xd752('0x13')]?_0x18ccba[_0xd752('0x13')][_0xd752('0x16')]||null:null,'limit':_0x18ccba[_0xd752('0x13')]?_0x18ccba['options']['limit']||null:null,'include':_0x18ccba[_0xd752('0x13')]?_0x18ccba[_0xd752('0x13')][_0xd752('0x17')]?_[_0xd752('0x18')](_0x18ccba['options'][_0xd752('0x17')],function(_0x57c214){return{'model':db[_0x57c214[_0xd752('0x19')]],'as':_0x57c214['as'],'attributes':_0x57c214[_0xd752('0x16')],'include':_0x57c214[_0xd752('0x17')]?_[_0xd752('0x18')](_0x57c214[_0xd752('0x17')],function(_0x4b7e1d){return{'model':db[_0x4b7e1d['model']],'as':_0x4b7e1d['as'],'attributes':_0x4b7e1d['attributes'],'include':_0x4b7e1d[_0xd752('0x17')]?_[_0xd752('0x18')](_0x4b7e1d[_0xd752('0x17')],function(_0x95608f){return{'model':db[_0x95608f[_0xd752('0x19')]],'as':_0x95608f['as'],'attributes':_0x95608f['attributes']};}):[]};}):[]};}):[]:[]})[_0xd752('0x9')](function(_0x47004b){logger[_0xd752('0xa')](_0xd752('0x1a'),_0x18ccba);logger[_0xd752('0xd')](_0xd752('0x1a'),_0x18ccba,JSON['stringify'](_0x47004b));_0x8eed42(_0x47004b);})[_0xd752('0x12')](function(_0xa77f11){logger['error']('GetDynamics365Account',_0xa77f11['message'],_0x18ccba);_0x22d96c(_0x17ca17['error'](0x1f4,_0xa77f11[_0xd752('0x11')]));});});};exports[_0xd752('0x1b')]=function(_0x21ea61){var _0x3d2b62=this;return new Promise(function(_0x322081,_0x52aaa9){return db[_0xd752('0x1c')]['find']({'raw':_0x21ea61[_0xd752('0x13')]?_0x21ea61[_0xd752('0x13')][_0xd752('0x14')]===undefined?!![]:![]:!![],'where':_0x21ea61[_0xd752('0x13')]?_0x21ea61[_0xd752('0x13')][_0xd752('0x15')]||null:null,'attributes':_0x21ea61[_0xd752('0x13')]?_0x21ea61[_0xd752('0x13')][_0xd752('0x16')]||null:null,'include':_0x21ea61['options']?_0x21ea61['options'][_0xd752('0x17')]?_['map'](_0x21ea61[_0xd752('0x13')]['include'],function(_0x5c10bb){return{'model':db[_0x5c10bb[_0xd752('0x19')]],'as':_0x5c10bb['as'],'attributes':_0x5c10bb['attributes'],'include':_0x5c10bb[_0xd752('0x17')]?_[_0xd752('0x18')](_0x5c10bb[_0xd752('0x17')],function(_0x161ffc){return{'model':db[_0x161ffc[_0xd752('0x19')]],'as':_0x161ffc['as'],'attributes':_0x161ffc[_0xd752('0x16')],'include':_0x161ffc[_0xd752('0x17')]?_[_0xd752('0x18')](_0x161ffc[_0xd752('0x17')],function(_0x5709b9){return{'model':db[_0x5709b9[_0xd752('0x19')]],'as':_0x5709b9['as'],'attributes':_0x5709b9[_0xd752('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd752('0x9')](function(_0x2213e6){logger[_0xd752('0xa')](_0xd752('0x1b'),_0x21ea61);logger['debug'](_0xd752('0x1b'),_0x21ea61,JSON['stringify'](_0x2213e6));_0x322081(_0x2213e6);})[_0xd752('0x12')](function(_0x2ea8c6){logger['error']('ShowDynamics365Account',_0x2ea8c6[_0xd752('0x11')],_0x21ea61);_0x52aaa9(_0x3d2b62[_0xd752('0xf')](0x1f4,_0x2ea8c6[_0xd752('0x11')]));});});}; \ No newline at end of file +var _0xf40f=['stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','map','include','model','attributes','then','debug','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x5ebda9,_0x2badfe){var _0x3a99ee=function(_0x1354a5){while(--_0x1354a5){_0x5ebda9['push'](_0x5ebda9['shift']());}};_0x3a99ee(++_0x2badfe);}(_0xf40f,0x124));var _0xff40=function(_0x32672c,_0x13eca8){_0x32672c=_0x32672c-0x0;var _0x5e2a97=_0xf40f[_0x32672c];return _0x5e2a97;};'use strict';var _=require(_0xff40('0x0'));var util=require(_0xff40('0x1'));var moment=require(_0xff40('0x2'));var BPromise=require(_0xff40('0x3'));var rs=require(_0xff40('0x4'));var fs=require('fs');var Redis=require(_0xff40('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xff40('0x6'));var jayson=require(_0xff40('0x7'));var client=jayson[_0xff40('0x8')][_0xff40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4513a0,_0x1240f0,_0x30131a){return new BPromise(function(_0x19016c,_0x116598){return client[_0xff40('0xa')](_0x4513a0,_0x30131a)['then'](function(_0x643b9f){logger[_0xff40('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x1240f0,_0xff40('0xc'));logger['debug'](_0xff40('0xd'),_0x1240f0,'request\x20sent',JSON[_0xff40('0xe')](_0x643b9f));if(_0x643b9f[_0xff40('0xf')]){if(_0x643b9f[_0xff40('0xf')][_0xff40('0x10')]===0x1f4){logger['error'](_0xff40('0x11'),_0x1240f0,_0x643b9f[_0xff40('0xf')][_0xff40('0x12')]);return _0x116598(_0x643b9f['error']['message']);}logger[_0xff40('0xf')](_0xff40('0x11'),_0x1240f0,_0x643b9f[_0xff40('0xf')][_0xff40('0x12')]);return _0x19016c(_0x643b9f[_0xff40('0xf')][_0xff40('0x12')]);}else{logger[_0xff40('0xb')](_0xff40('0x11'),_0x1240f0,_0xff40('0xc'));_0x19016c(_0x643b9f['result'][_0xff40('0x12')]);}})[_0xff40('0x13')](function(_0x27ae2c){logger[_0xff40('0xf')](_0xff40('0x11'),_0x1240f0,_0x27ae2c);_0x116598(_0x27ae2c);});});}exports[_0xff40('0x14')]=function(_0x4f3098){var _0x37c119=this;return new Promise(function(_0xcd0ada,_0x2654d5){return db[_0xff40('0x15')][_0xff40('0x16')]({'raw':_0x4f3098[_0xff40('0x17')]?_0x4f3098[_0xff40('0x17')][_0xff40('0x18')]===undefined?!![]:![]:!![],'where':_0x4f3098[_0xff40('0x17')]?_0x4f3098[_0xff40('0x17')][_0xff40('0x19')]||null:null,'attributes':_0x4f3098['options']?_0x4f3098[_0xff40('0x17')]['attributes']||null:null,'limit':_0x4f3098[_0xff40('0x17')]?_0x4f3098['options']['limit']||null:null,'include':_0x4f3098[_0xff40('0x17')]?_0x4f3098[_0xff40('0x17')]['include']?_[_0xff40('0x1a')](_0x4f3098[_0xff40('0x17')][_0xff40('0x1b')],function(_0x17dccd){return{'model':db[_0x17dccd[_0xff40('0x1c')]],'as':_0x17dccd['as'],'attributes':_0x17dccd[_0xff40('0x1d')],'include':_0x17dccd['include']?_['map'](_0x17dccd['include'],function(_0x151902){return{'model':db[_0x151902['model']],'as':_0x151902['as'],'attributes':_0x151902['attributes'],'include':_0x151902['include']?_[_0xff40('0x1a')](_0x151902[_0xff40('0x1b')],function(_0xfad76a){return{'model':db[_0xfad76a[_0xff40('0x1c')]],'as':_0xfad76a['as'],'attributes':_0xfad76a['attributes']};}):[]};}):[]};}):[]:[]})[_0xff40('0x1e')](function(_0x3a3726){logger[_0xff40('0xb')](_0xff40('0x14'),_0x4f3098);logger[_0xff40('0x1f')]('GetDynamics365Account',_0x4f3098,JSON[_0xff40('0xe')](_0x3a3726));_0xcd0ada(_0x3a3726);})[_0xff40('0x13')](function(_0x37df6c){logger[_0xff40('0xf')]('GetDynamics365Account',_0x37df6c[_0xff40('0x12')],_0x4f3098);_0x2654d5(_0x37c119[_0xff40('0xf')](0x1f4,_0x37df6c['message']));});});};exports[_0xff40('0x20')]=function(_0x103c56){var _0x4372bc=this;return new Promise(function(_0xb8ad7c,_0x3aba3e){return db['Dynamics365Account'][_0xff40('0x21')]({'raw':_0x103c56[_0xff40('0x17')]?_0x103c56[_0xff40('0x17')][_0xff40('0x18')]===undefined?!![]:![]:!![],'where':_0x103c56['options']?_0x103c56[_0xff40('0x17')][_0xff40('0x19')]||null:null,'attributes':_0x103c56[_0xff40('0x17')]?_0x103c56[_0xff40('0x17')][_0xff40('0x1d')]||null:null,'include':_0x103c56[_0xff40('0x17')]?_0x103c56[_0xff40('0x17')][_0xff40('0x1b')]?_[_0xff40('0x1a')](_0x103c56['options'][_0xff40('0x1b')],function(_0x3918c9){return{'model':db[_0x3918c9[_0xff40('0x1c')]],'as':_0x3918c9['as'],'attributes':_0x3918c9[_0xff40('0x1d')],'include':_0x3918c9['include']?_[_0xff40('0x1a')](_0x3918c9[_0xff40('0x1b')],function(_0x132ae0){return{'model':db[_0x132ae0[_0xff40('0x1c')]],'as':_0x132ae0['as'],'attributes':_0x132ae0['attributes'],'include':_0x132ae0[_0xff40('0x1b')]?_[_0xff40('0x1a')](_0x132ae0[_0xff40('0x1b')],function(_0x1ee7e8){return{'model':db[_0x1ee7e8[_0xff40('0x1c')]],'as':_0x1ee7e8['as'],'attributes':_0x1ee7e8[_0xff40('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xff40('0x1e')](function(_0x568675){logger[_0xff40('0xb')](_0xff40('0x20'),_0x103c56);logger['debug'](_0xff40('0x20'),_0x103c56,JSON[_0xff40('0xe')](_0x568675));_0xb8ad7c(_0x568675);})[_0xff40('0x13')](function(_0x2b0700){logger[_0xff40('0xf')](_0xff40('0x20'),_0x2b0700[_0xff40('0x12')],_0x103c56);_0x3aba3e(_0x4372bc[_0xff40('0xf')](0x1f4,_0x2b0700['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c8cc965..c306c00 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 _0x38d2=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','update','destroy'];(function(_0x46ed1b,_0x38c977){var _0x496471=function(_0x5aea03){while(--_0x5aea03){_0x46ed1b['push'](_0x46ed1b['shift']());}};_0x496471(++_0x38c977);}(_0x38d2,0x112));var _0x238d=function(_0x183cd1,_0x43eaa1){_0x183cd1=_0x183cd1-0x0;var _0x41e9d6=_0x38d2[_0x183cd1];return _0x41e9d6;};'use strict';var multer=require('multer');var util=require(_0x238d('0x0'));var path=require(_0x238d('0x1'));var timeout=require(_0x238d('0x2'));var express=require(_0x238d('0x3'));var router=express[_0x238d('0x4')]();var fs_extra=require(_0x238d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x238d('0x6'));var config=require(_0x238d('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x238d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x238d('0x8')](_0x238d('0x9'),auth[_0x238d('0xa')](),controller[_0x238d('0xb')]);router[_0x238d('0x8')](_0x238d('0xc'),auth[_0x238d('0xa')](),controller[_0x238d('0xd')]);router[_0x238d('0x8')](_0x238d('0xe'),auth['isAuthenticated'](),controller[_0x238d('0xf')]);router['get']('/:id/descriptions',auth[_0x238d('0xa')](),controller['getDescriptions']);router[_0x238d('0x10')]('/',auth[_0x238d('0xa')](),controller[_0x238d('0x11')]);router['put'](_0x238d('0x9'),auth[_0x238d('0xa')](),controller[_0x238d('0x12')]);router['delete']('/:id',auth[_0x238d('0xa')](),controller[_0x238d('0x13')]);module[_0x238d('0x14')]=router; \ No newline at end of file +var _0x56e7=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xf2a3bf,_0x30b52d){var _0x1d5527=function(_0x3e10d6){while(--_0x3e10d6){_0xf2a3bf['push'](_0xf2a3bf['shift']());}};_0x1d5527(++_0x30b52d);}(_0x56e7,0x93));var _0x756e=function(_0x1b9558,_0x245efa){_0x1b9558=_0x1b9558-0x0;var _0x15f33d=_0x56e7[_0x1b9558];return _0x15f33d;};'use strict';var multer=require(_0x756e('0x0'));var util=require(_0x756e('0x1'));var path=require(_0x756e('0x2'));var timeout=require(_0x756e('0x3'));var express=require(_0x756e('0x4'));var router=express[_0x756e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x756e('0x6'));var interaction=require(_0x756e('0x7'));var config=require(_0x756e('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x756e('0x9')]('/',auth[_0x756e('0xa')](),controller['index']);router['get'](_0x756e('0xb'),auth[_0x756e('0xa')](),controller['show']);router['get']('/:id/fields',auth[_0x756e('0xa')](),controller[_0x756e('0xc')]);router[_0x756e('0x9')](_0x756e('0xd'),auth[_0x756e('0xa')](),controller['getSubjects']);router[_0x756e('0x9')]('/:id/descriptions',auth[_0x756e('0xa')](),controller[_0x756e('0xe')]);router[_0x756e('0xf')]('/',auth['isAuthenticated'](),controller[_0x756e('0x10')]);router[_0x756e('0x11')](_0x756e('0xb'),auth['isAuthenticated'](),controller[_0x756e('0x12')]);router[_0x756e('0x13')](_0x756e('0xb'),auth[_0x756e('0xa')](),controller[_0x756e('0x14')]);module[_0x756e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 16161cc..404a532 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 _0x588e=['incident','phonecall','ENUM','contact','nothing','BOOLEAN','sequelize','STRING'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x588e,0x96));var _0xe588=function(_0x494f4d,_0x2807fa){_0x494f4d=_0x494f4d-0x0;var _0x3e7dfc=_0x588e[_0x494f4d];return _0x3e7dfc;};'use strict';var Sequelize=require(_0xe588('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe588('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xe588('0x2'),_0xe588('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xe588('0x4')](_0xe588('0x5'),_0xe588('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xe588('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe588('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1743=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall','nothing'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x1743,0xbf));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3174('0x0'));module[_0x3174('0x1')]={'name':{'type':Sequelize[_0x3174('0x2')]},'description':{'type':Sequelize[_0x3174('0x2')]},'ticketType':{'type':Sequelize[_0x3174('0x3')](_0x3174('0x4'),_0x3174('0x5')),'defaultValue':_0x3174('0x4')},'moduleCreate':{'type':Sequelize[_0x3174('0x3')]('contact',_0x3174('0x6')),'defaultValue':_0x3174('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x3174('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3174('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index d3bea84..e30c9b1 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 _0x2988=['findAll','rows','catch','show','find','create','body','params','destroy','findOne','filter','getFields','nolimit','getSubjects','Dynamics365Field','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include'];(function(_0x1206ad,_0x2f0689){var _0x62d498=function(_0x277bcd){while(--_0x277bcd){_0x1206ad['push'](_0x1206ad['shift']());}};_0x62d498(++_0x2f0689);}(_0x2988,0x150));var _0x8298=function(_0x821241,_0x8dab74){_0x821241=_0x821241-0x0;var _0x24b3a0=_0x2988[_0x821241];return _0x24b3a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8298('0x0'));var zipdir=require(_0x8298('0x1'));var jsonpatch=require(_0x8298('0x2'));var rp=require(_0x8298('0x3'));var moment=require('moment');var BPromise=require(_0x8298('0x4'));var Mustache=require(_0x8298('0x5'));var util=require(_0x8298('0x6'));var path=require('path');var sox=require(_0x8298('0x7'));var csv=require(_0x8298('0x8'));var ejs=require(_0x8298('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8298('0xa'));var squel=require(_0x8298('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8298('0xc'));var toCsv=require(_0x8298('0x8'));var querystring=require(_0x8298('0xd'));var Papa=require(_0x8298('0xe'));var Redis=require(_0x8298('0xf'));var authService=require(_0x8298('0x10'));var qs=require(_0x8298('0x11'));var as=require(_0x8298('0x12'));var hardwareService=require(_0x8298('0x13'));var logger=require(_0x8298('0x14'))(_0x8298('0x15'));var utils=require(_0x8298('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8298('0x17'))['db'];function respondWithStatusCode(_0x33e07b,_0x297672){_0x297672=_0x297672||0xcc;return function(_0x7616eb){if(_0x7616eb){return _0x33e07b[_0x8298('0x18')](_0x297672);}return _0x33e07b[_0x8298('0x19')](_0x297672)[_0x8298('0x1a')]();};}function respondWithResult(_0x5e73fe,_0x21597f){_0x21597f=_0x21597f||0xc8;return function(_0x283ceb){if(_0x283ceb){return _0x5e73fe['status'](_0x21597f)[_0x8298('0x1b')](_0x283ceb);}};}function respondWithFilteredResult(_0x714492,_0x2cd8ec){return function(_0x2888e9){if(_0x2888e9){var _0x5f0aa1=typeof _0x2cd8ec[_0x8298('0x1c')]===_0x8298('0x1d')&&typeof _0x2cd8ec[_0x8298('0x1e')]===_0x8298('0x1d');var _0x4a06d4=_0x2888e9[_0x8298('0x1f')];var _0xc1b406=_0x5f0aa1?0x0:_0x2cd8ec['offset'];var _0x5ce4e4=_0x5f0aa1?_0x2888e9[_0x8298('0x1f')]:_0x2cd8ec[_0x8298('0x1c')]+_0x2cd8ec[_0x8298('0x1e')];var _0x5b8501;if(_0x5ce4e4>=_0x4a06d4){_0x5ce4e4=_0x4a06d4;_0x5b8501=0xc8;}else{_0x5b8501=0xce;}_0x714492['status'](_0x5b8501);return _0x714492[_0x8298('0x20')]('Content-Range',_0xc1b406+'-'+_0x5ce4e4+'/'+_0x4a06d4)['json'](_0x2888e9);}return null;};}function patchUpdates(_0x577425){return function(_0x4b87bc){try{jsonpatch[_0x8298('0x21')](_0x4b87bc,_0x577425,!![]);}catch(_0x29c926){return BPromise[_0x8298('0x22')](_0x29c926);}return _0x4b87bc['save']();};}function saveUpdates(_0x43a726,_0x247a19){return function(_0x5ca780){if(_0x5ca780){return _0x5ca780[_0x8298('0x23')](_0x43a726)[_0x8298('0x24')](function(_0x597cf6){return _0x597cf6;});}return null;};}function removeEntity(_0x5e6075,_0x669589){return function(_0x58ea7d){if(_0x58ea7d){return _0x58ea7d['destroy']()[_0x8298('0x24')](function(){_0x5e6075['status'](0xcc)[_0x8298('0x1a')]();});}};}function handleEntityNotFound(_0x186acd,_0x4c1c93){return function(_0x645591){if(!_0x645591){_0x186acd['sendStatus'](0x194);}return _0x645591;};}function handleError(_0x4d4ec5,_0x4f7f60){_0x4f7f60=_0x4f7f60||0x1f4;return function(_0x2e3267){logger[_0x8298('0x25')](_0x2e3267[_0x8298('0x26')]);if(_0x2e3267[_0x8298('0x27')]){delete _0x2e3267[_0x8298('0x27')];}_0x4d4ec5[_0x8298('0x19')](_0x4f7f60)['send'](_0x2e3267);};}exports[_0x8298('0x28')]=function(_0x268a94,_0x271be8){var _0x342409={},_0x5a6ce0={},_0x1d428b={'count':0x0,'rows':[]};var _0x1fcdd7=_[_0x8298('0x29')](db[_0x8298('0x2a')][_0x8298('0x2b')],function(_0x3d8f83){return{'name':_0x3d8f83[_0x8298('0x2c')],'type':_0x3d8f83[_0x8298('0x2d')][_0x8298('0x2e')]};});_0x5a6ce0[_0x8298('0x2f')]=_['map'](_0x1fcdd7,'name');_0x5a6ce0[_0x8298('0x30')]=_[_0x8298('0x31')](_0x268a94[_0x8298('0x30')]);_0x5a6ce0[_0x8298('0x32')]=_[_0x8298('0x33')](_0x5a6ce0[_0x8298('0x2f')],_0x5a6ce0['query']);_0x342409['attributes']=_[_0x8298('0x33')](_0x5a6ce0[_0x8298('0x2f')],qs[_0x8298('0x34')](_0x268a94[_0x8298('0x30')][_0x8298('0x34')]));_0x342409[_0x8298('0x35')]=_0x342409['attributes'][_0x8298('0x36')]?_0x342409[_0x8298('0x35')]:_0x5a6ce0[_0x8298('0x2f')];if(!_0x268a94[_0x8298('0x30')][_0x8298('0x37')]('nolimit')){_0x342409[_0x8298('0x1e')]=qs[_0x8298('0x1e')](_0x268a94['query'][_0x8298('0x1e')]);_0x342409['offset']=qs[_0x8298('0x1c')](_0x268a94['query'][_0x8298('0x1c')]);}_0x342409[_0x8298('0x38')]=qs[_0x8298('0x39')](_0x268a94[_0x8298('0x30')]['sort']);_0x342409[_0x8298('0x3a')]=qs[_0x8298('0x32')](_[_0x8298('0x3b')](_0x268a94[_0x8298('0x30')],_0x5a6ce0[_0x8298('0x32')]),_0x1fcdd7);if(_0x268a94['query']['filter']){_0x342409[_0x8298('0x3a')]=_[_0x8298('0x3c')](_0x342409[_0x8298('0x3a')],{'$or':_[_0x8298('0x29')](_0x1fcdd7,function(_0x1fe514){if(_0x1fe514[_0x8298('0x2d')]!=='VIRTUAL'){var _0xefde97={};_0xefde97[_0x1fe514['name']]={'$like':'%'+_0x268a94[_0x8298('0x30')]['filter']+'%'};return _0xefde97;}})});}_0x342409=_[_0x8298('0x3c')]({},_0x342409,_0x268a94[_0x8298('0x3d')]);var _0x3127a7={'where':_0x342409[_0x8298('0x3a')]};return db['Dynamics365Configuration'][_0x8298('0x1f')](_0x3127a7)[_0x8298('0x24')](function(_0x33039c){_0x1d428b[_0x8298('0x1f')]=_0x33039c;if(_0x268a94[_0x8298('0x30')][_0x8298('0x3e')]){_0x342409[_0x8298('0x3f')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x8298('0x40')](_0x342409);})['then'](function(_0x5867d2){_0x1d428b[_0x8298('0x41')]=_0x5867d2;return _0x1d428b;})[_0x8298('0x24')](respondWithFilteredResult(_0x271be8,_0x342409))[_0x8298('0x42')](handleError(_0x271be8,null));};exports[_0x8298('0x43')]=function(_0x11ae68,_0x448b9d){var _0x5d767a={'raw':![],'where':{'id':_0x11ae68['params']['id']}},_0x11017f={};_0x11017f[_0x8298('0x2f')]=_[_0x8298('0x31')](db[_0x8298('0x2a')][_0x8298('0x2b')]);_0x11017f[_0x8298('0x30')]=_[_0x8298('0x31')](_0x11ae68[_0x8298('0x30')]);_0x11017f[_0x8298('0x32')]=_[_0x8298('0x33')](_0x11017f[_0x8298('0x2f')],_0x11017f[_0x8298('0x30')]);_0x5d767a[_0x8298('0x35')]=_[_0x8298('0x33')](_0x11017f[_0x8298('0x2f')],qs['fields'](_0x11ae68[_0x8298('0x30')][_0x8298('0x34')]));_0x5d767a[_0x8298('0x35')]=_0x5d767a['attributes'][_0x8298('0x36')]?_0x5d767a[_0x8298('0x35')]:_0x11017f[_0x8298('0x2f')];if(_0x11ae68[_0x8298('0x30')][_0x8298('0x3e')]){_0x5d767a[_0x8298('0x3f')]=[{'all':!![]}];}_0x5d767a=_[_0x8298('0x3c')]({},_0x5d767a,_0x11ae68[_0x8298('0x3d')]);return db['Dynamics365Configuration'][_0x8298('0x44')](_0x5d767a)[_0x8298('0x24')](handleEntityNotFound(_0x448b9d,null))['then'](respondWithResult(_0x448b9d,null))['catch'](handleError(_0x448b9d,null));};exports[_0x8298('0x45')]=function(_0x481442,_0x26ece4){return db[_0x8298('0x2a')][_0x8298('0x45')](_0x481442[_0x8298('0x46')],{})['then'](respondWithResult(_0x26ece4,0xc9))[_0x8298('0x42')](handleError(_0x26ece4,null));};exports['update']=function(_0x551c25,_0xba3e3f){if(_0x551c25['body']['id']){delete _0x551c25[_0x8298('0x46')]['id'];}return db[_0x8298('0x2a')]['find']({'where':{'id':_0x551c25[_0x8298('0x47')]['id']}})[_0x8298('0x24')](handleEntityNotFound(_0xba3e3f,null))[_0x8298('0x24')](saveUpdates(_0x551c25[_0x8298('0x46')],null))[_0x8298('0x24')](respondWithResult(_0xba3e3f,null))[_0x8298('0x42')](handleError(_0xba3e3f,null));};exports[_0x8298('0x48')]=function(_0x38cd0e,_0x3d53ef){return db[_0x8298('0x2a')]['find']({'where':{'id':_0x38cd0e['params']['id']}})[_0x8298('0x24')](handleEntityNotFound(_0x3d53ef,null))['then'](removeEntity(_0x3d53ef,null))['catch'](handleError(_0x3d53ef,null));};exports['getFields']=function(_0x4a9e1c,_0x4ffe71,_0x5abfe6){var _0x4794ca={};var _0x5172cb={};var _0xd44bbb;var _0x57e7bd;return db[_0x8298('0x2a')][_0x8298('0x49')]({'where':{'id':_0x4a9e1c[_0x8298('0x47')]['id']}})[_0x8298('0x24')](handleEntityNotFound(_0x4ffe71,null))['then'](function(_0x360cf9){if(_0x360cf9){_0xd44bbb=_0x360cf9;_0x5172cb[_0x8298('0x2f')]=_['keys'](db['Dynamics365Field'][_0x8298('0x2b')]);_0x5172cb[_0x8298('0x30')]=_[_0x8298('0x31')](_0x4a9e1c[_0x8298('0x30')]);_0x5172cb['filters']=_['intersection'](_0x5172cb[_0x8298('0x2f')],_0x5172cb[_0x8298('0x30')]);_0x4794ca[_0x8298('0x35')]=_[_0x8298('0x33')](_0x5172cb['model'],qs['fields'](_0x4a9e1c[_0x8298('0x30')][_0x8298('0x34')]));_0x4794ca[_0x8298('0x35')]=_0x4794ca['attributes']['length']?_0x4794ca[_0x8298('0x35')]:_0x5172cb[_0x8298('0x2f')];_0x4794ca[_0x8298('0x38')]=qs[_0x8298('0x39')](_0x4a9e1c[_0x8298('0x30')][_0x8298('0x39')]);_0x4794ca[_0x8298('0x3a')]=qs[_0x8298('0x32')](_[_0x8298('0x3b')](_0x4a9e1c[_0x8298('0x30')],_0x5172cb[_0x8298('0x32')]));if(_0x4a9e1c[_0x8298('0x30')][_0x8298('0x4a')]){_0x4794ca[_0x8298('0x3a')]=_[_0x8298('0x3c')](_0x4794ca[_0x8298('0x3a')],{'$or':_['map'](_0x4794ca[_0x8298('0x35')],function(_0x436716){var _0x3d5996={};_0x3d5996[_0x436716]={'$like':'%'+_0x4a9e1c[_0x8298('0x30')][_0x8298('0x4a')]+'%'};return _0x3d5996;})});}_0x4794ca=_[_0x8298('0x3c')]({},_0x4794ca,_0x4a9e1c['options']);return _0xd44bbb[_0x8298('0x4b')](_0x4794ca);}})[_0x8298('0x24')](function(_0x4b82b1){if(_0x4b82b1){_0x57e7bd=_0x4b82b1[_0x8298('0x36')];if(!_0x4a9e1c[_0x8298('0x30')][_0x8298('0x37')](_0x8298('0x4c'))){_0x4794ca[_0x8298('0x1e')]=qs[_0x8298('0x1e')](_0x4a9e1c[_0x8298('0x30')][_0x8298('0x1e')]);_0x4794ca[_0x8298('0x1c')]=qs['offset'](_0x4a9e1c[_0x8298('0x30')]['offset']);}return _0xd44bbb[_0x8298('0x4b')](_0x4794ca);}})[_0x8298('0x24')](function(_0x4dcf77){if(_0x4dcf77){return _0x4dcf77?{'count':_0x57e7bd,'rows':_0x4dcf77}:null;}})[_0x8298('0x24')](respondWithResult(_0x4ffe71,null))[_0x8298('0x42')](handleError(_0x4ffe71,null));};exports[_0x8298('0x4d')]=function(_0x20018f,_0x2ed7dc,_0x10fd4f){var _0x5e056f={};var _0x59ca65={};var _0x5c8e5e;var _0x1462f9;return db[_0x8298('0x2a')][_0x8298('0x49')]({'where':{'id':_0x20018f[_0x8298('0x47')]['id']}})[_0x8298('0x24')](handleEntityNotFound(_0x2ed7dc,null))['then'](function(_0x12cb19){if(_0x12cb19){_0x5c8e5e=_0x12cb19;_0x59ca65[_0x8298('0x2f')]=_[_0x8298('0x31')](db[_0x8298('0x4e')]['rawAttributes']);_0x59ca65['query']=_[_0x8298('0x31')](_0x20018f[_0x8298('0x30')]);_0x59ca65['filters']=_[_0x8298('0x33')](_0x59ca65['model'],_0x59ca65['query']);_0x5e056f[_0x8298('0x35')]=_[_0x8298('0x33')](_0x59ca65[_0x8298('0x2f')],qs[_0x8298('0x34')](_0x20018f['query'][_0x8298('0x34')]));_0x5e056f[_0x8298('0x35')]=_0x5e056f[_0x8298('0x35')][_0x8298('0x36')]?_0x5e056f['attributes']:_0x59ca65['model'];_0x5e056f[_0x8298('0x38')]=qs['sort'](_0x20018f['query'][_0x8298('0x39')]);_0x5e056f[_0x8298('0x3a')]=qs[_0x8298('0x32')](_[_0x8298('0x3b')](_0x20018f['query'],_0x59ca65[_0x8298('0x32')]));if(_0x20018f['query'][_0x8298('0x4a')]){_0x5e056f['where']=_[_0x8298('0x3c')](_0x5e056f['where'],{'$or':_[_0x8298('0x29')](_0x5e056f[_0x8298('0x35')],function(_0x5ae476){var _0x56db69={};_0x56db69[_0x5ae476]={'$like':'%'+_0x20018f['query']['filter']+'%'};return _0x56db69;})});}_0x5e056f=_[_0x8298('0x3c')]({},_0x5e056f,_0x20018f[_0x8298('0x3d')]);return _0x5c8e5e[_0x8298('0x4d')](_0x5e056f);}})[_0x8298('0x24')](function(_0x273334){if(_0x273334){_0x1462f9=_0x273334[_0x8298('0x36')];if(!_0x20018f['query'][_0x8298('0x37')](_0x8298('0x4c'))){_0x5e056f[_0x8298('0x1e')]=qs['limit'](_0x20018f[_0x8298('0x30')]['limit']);_0x5e056f[_0x8298('0x1c')]=qs[_0x8298('0x1c')](_0x20018f[_0x8298('0x30')][_0x8298('0x1c')]);}return _0x5c8e5e[_0x8298('0x4d')](_0x5e056f);}})[_0x8298('0x24')](function(_0x4fdcbe){if(_0x4fdcbe){return _0x4fdcbe?{'count':_0x1462f9,'rows':_0x4fdcbe}:null;}})[_0x8298('0x24')](respondWithResult(_0x2ed7dc,null))['catch'](handleError(_0x2ed7dc,null));};exports[_0x8298('0x4f')]=function(_0x5b8428,_0x433f1b,_0x5e42bd){var _0x4bf933={};var _0x57c473={};var _0x55518c;var _0x5e9db5;return db[_0x8298('0x2a')][_0x8298('0x49')]({'where':{'id':_0x5b8428[_0x8298('0x47')]['id']}})['then'](handleEntityNotFound(_0x433f1b,null))['then'](function(_0x103211){if(_0x103211){_0x55518c=_0x103211;_0x57c473[_0x8298('0x2f')]=_[_0x8298('0x31')](db['Dynamics365Field'][_0x8298('0x2b')]);_0x57c473[_0x8298('0x30')]=_[_0x8298('0x31')](_0x5b8428['query']);_0x57c473[_0x8298('0x32')]=_['intersection'](_0x57c473[_0x8298('0x2f')],_0x57c473[_0x8298('0x30')]);_0x4bf933['attributes']=_['intersection'](_0x57c473[_0x8298('0x2f')],qs[_0x8298('0x34')](_0x5b8428[_0x8298('0x30')][_0x8298('0x34')]));_0x4bf933[_0x8298('0x35')]=_0x4bf933['attributes'][_0x8298('0x36')]?_0x4bf933['attributes']:_0x57c473[_0x8298('0x2f')];_0x4bf933[_0x8298('0x38')]=qs[_0x8298('0x39')](_0x5b8428[_0x8298('0x30')][_0x8298('0x39')]);_0x4bf933[_0x8298('0x3a')]=qs[_0x8298('0x32')](_['pick'](_0x5b8428[_0x8298('0x30')],_0x57c473['filters']));if(_0x5b8428[_0x8298('0x30')]['filter']){_0x4bf933[_0x8298('0x3a')]=_[_0x8298('0x3c')](_0x4bf933['where'],{'$or':_[_0x8298('0x29')](_0x4bf933[_0x8298('0x35')],function(_0x57c307){var _0x166f97={};_0x166f97[_0x57c307]={'$like':'%'+_0x5b8428[_0x8298('0x30')][_0x8298('0x4a')]+'%'};return _0x166f97;})});}_0x4bf933=_[_0x8298('0x3c')]({},_0x4bf933,_0x5b8428[_0x8298('0x3d')]);return _0x55518c['getDescriptions'](_0x4bf933);}})['then'](function(_0x22dbb5){if(_0x22dbb5){_0x5e9db5=_0x22dbb5[_0x8298('0x36')];if(!_0x5b8428[_0x8298('0x30')]['hasOwnProperty'](_0x8298('0x4c'))){_0x4bf933[_0x8298('0x1e')]=qs[_0x8298('0x1e')](_0x5b8428['query'][_0x8298('0x1e')]);_0x4bf933[_0x8298('0x1c')]=qs[_0x8298('0x1c')](_0x5b8428[_0x8298('0x30')][_0x8298('0x1c')]);}return _0x55518c[_0x8298('0x4f')](_0x4bf933);}})[_0x8298('0x24')](function(_0x6a1a5e){if(_0x6a1a5e){return _0x6a1a5e?{'count':_0x5e9db5,'rows':_0x6a1a5e}:null;}})[_0x8298('0x24')](respondWithResult(_0x433f1b,null))[_0x8298('0x42')](handleError(_0x433f1b,null));}; \ No newline at end of file +var _0xfba3=['../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Dynamics365Configuration','include','findAll','rows','show','params','includeAll','find','catch','create','body','Dynamics365Field','getFields','getDescriptions','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x254094,_0x16a405){var _0x322a4b=function(_0x216aba){while(--_0x216aba){_0x254094['push'](_0x254094['shift']());}};_0x322a4b(++_0x16a405);}(_0xfba3,0x82));var _0x3fba=function(_0x2422f1,_0x1c6afd){_0x2422f1=_0x2422f1-0x0;var _0x40a692=_0xfba3[_0x2422f1];return _0x40a692;};'use strict';var emlformat=require(_0x3fba('0x0'));var rimraf=require(_0x3fba('0x1'));var zipdir=require(_0x3fba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fba('0x3'));var moment=require(_0x3fba('0x4'));var BPromise=require(_0x3fba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3fba('0x6'));var csv=require(_0x3fba('0x7'));var ejs=require(_0x3fba('0x8'));var fs=require('fs');var fs_extra=require(_0x3fba('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3fba('0xa'));var jsforce=require(_0x3fba('0xb'));var deskjs=require(_0x3fba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3fba('0xd'));var Papa=require(_0x3fba('0xe'));var Redis=require('ioredis');var authService=require(_0x3fba('0xf'));var qs=require(_0x3fba('0x10'));var as=require(_0x3fba('0x11'));var hardwareService=require(_0x3fba('0x12'));var logger=require(_0x3fba('0x13'))(_0x3fba('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3fba('0x15'))['db'];function respondWithStatusCode(_0x44989b,_0x4dcd0a){_0x4dcd0a=_0x4dcd0a||0xcc;return function(_0x3569cb){if(_0x3569cb){return _0x44989b['sendStatus'](_0x4dcd0a);}return _0x44989b['status'](_0x4dcd0a)[_0x3fba('0x16')]();};}function respondWithResult(_0x54d3f1,_0x11702c){_0x11702c=_0x11702c||0xc8;return function(_0x7ac65d){if(_0x7ac65d){return _0x54d3f1[_0x3fba('0x17')](_0x11702c)['json'](_0x7ac65d);}};}function respondWithFilteredResult(_0xe8737f,_0x5d5eb5){return function(_0x5e259a){if(_0x5e259a){var _0xd9bcdf=typeof _0x5d5eb5[_0x3fba('0x18')]===_0x3fba('0x19')&&typeof _0x5d5eb5[_0x3fba('0x1a')]===_0x3fba('0x19');var _0x78af54=_0x5e259a[_0x3fba('0x1b')];var _0x6f3aa9=_0xd9bcdf?0x0:_0x5d5eb5[_0x3fba('0x18')];var _0x20c0c8=_0xd9bcdf?_0x5e259a[_0x3fba('0x1b')]:_0x5d5eb5[_0x3fba('0x18')]+_0x5d5eb5[_0x3fba('0x1a')];var _0x2940fa;if(_0x20c0c8>=_0x78af54){_0x20c0c8=_0x78af54;_0x2940fa=0xc8;}else{_0x2940fa=0xce;}_0xe8737f[_0x3fba('0x17')](_0x2940fa);return _0xe8737f['set'](_0x3fba('0x1c'),_0x6f3aa9+'-'+_0x20c0c8+'/'+_0x78af54)[_0x3fba('0x1d')](_0x5e259a);}return null;};}function patchUpdates(_0x33400a){return function(_0x51d39f){try{jsonpatch['apply'](_0x51d39f,_0x33400a,!![]);}catch(_0x54c4a2){return BPromise['reject'](_0x54c4a2);}return _0x51d39f['save']();};}function saveUpdates(_0x2a36c2,_0x5b1659){return function(_0x10d930){if(_0x10d930){return _0x10d930[_0x3fba('0x1e')](_0x2a36c2)[_0x3fba('0x1f')](function(_0x3988ba){return _0x3988ba;});}return null;};}function removeEntity(_0x505726,_0x5dd8a9){return function(_0x341b34){if(_0x341b34){return _0x341b34['destroy']()[_0x3fba('0x1f')](function(){_0x505726[_0x3fba('0x17')](0xcc)[_0x3fba('0x16')]();});}};}function handleEntityNotFound(_0x10b7c8,_0xddc95c){return function(_0x4ea543){if(!_0x4ea543){_0x10b7c8['sendStatus'](0x194);}return _0x4ea543;};}function handleError(_0x573ff1,_0x9f99e6){_0x9f99e6=_0x9f99e6||0x1f4;return function(_0x321a7d){logger[_0x3fba('0x20')](_0x321a7d[_0x3fba('0x21')]);if(_0x321a7d[_0x3fba('0x22')]){delete _0x321a7d[_0x3fba('0x22')];}_0x573ff1[_0x3fba('0x17')](_0x9f99e6)['send'](_0x321a7d);};}exports[_0x3fba('0x23')]=function(_0x530484,_0x395580){var _0x1925f1={},_0x49dba4={},_0x4b9c07={'count':0x0,'rows':[]};var _0x5b7496=_[_0x3fba('0x24')](db['Dynamics365Configuration'][_0x3fba('0x25')],function(_0x53b6c7){return{'name':_0x53b6c7[_0x3fba('0x26')],'type':_0x53b6c7['type'][_0x3fba('0x27')]};});_0x49dba4[_0x3fba('0x28')]=_['map'](_0x5b7496,_0x3fba('0x22'));_0x49dba4[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x530484[_0x3fba('0x29')]);_0x49dba4['filters']=_['intersection'](_0x49dba4[_0x3fba('0x28')],_0x49dba4[_0x3fba('0x29')]);_0x1925f1['attributes']=_[_0x3fba('0x2b')](_0x49dba4[_0x3fba('0x28')],qs['fields'](_0x530484[_0x3fba('0x29')][_0x3fba('0x2c')]));_0x1925f1[_0x3fba('0x2d')]=_0x1925f1[_0x3fba('0x2d')][_0x3fba('0x2e')]?_0x1925f1['attributes']:_0x49dba4[_0x3fba('0x28')];if(!_0x530484[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x1925f1[_0x3fba('0x1a')]=qs[_0x3fba('0x1a')](_0x530484[_0x3fba('0x29')][_0x3fba('0x1a')]);_0x1925f1[_0x3fba('0x18')]=qs[_0x3fba('0x18')](_0x530484[_0x3fba('0x29')][_0x3fba('0x18')]);}_0x1925f1[_0x3fba('0x31')]=qs[_0x3fba('0x32')](_0x530484[_0x3fba('0x29')][_0x3fba('0x32')]);_0x1925f1[_0x3fba('0x33')]=qs[_0x3fba('0x34')](_[_0x3fba('0x35')](_0x530484[_0x3fba('0x29')],_0x49dba4[_0x3fba('0x34')]),_0x5b7496);if(_0x530484['query'][_0x3fba('0x36')]){_0x1925f1[_0x3fba('0x33')]=_[_0x3fba('0x37')](_0x1925f1['where'],{'$or':_['map'](_0x5b7496,function(_0x1d8434){if(_0x1d8434[_0x3fba('0x38')]!==_0x3fba('0x39')){var _0x4f571e={};_0x4f571e[_0x1d8434[_0x3fba('0x22')]]={'$like':'%'+_0x530484[_0x3fba('0x29')][_0x3fba('0x36')]+'%'};return _0x4f571e;}})});}_0x1925f1=_['merge']({},_0x1925f1,_0x530484[_0x3fba('0x3a')]);var _0x537770={'where':_0x1925f1[_0x3fba('0x33')]};return db[_0x3fba('0x3b')]['count'](_0x537770)[_0x3fba('0x1f')](function(_0x21cda7){_0x4b9c07['count']=_0x21cda7;if(_0x530484['query']['includeAll']){_0x1925f1[_0x3fba('0x3c')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3fba('0x3d')](_0x1925f1);})['then'](function(_0x1984d5){_0x4b9c07[_0x3fba('0x3e')]=_0x1984d5;return _0x4b9c07;})[_0x3fba('0x1f')](respondWithFilteredResult(_0x395580,_0x1925f1))['catch'](handleError(_0x395580,null));};exports[_0x3fba('0x3f')]=function(_0x1757d5,_0x1013f5){var _0x43a8bd={'raw':![],'where':{'id':_0x1757d5[_0x3fba('0x40')]['id']}},_0x44aa8b={};_0x44aa8b[_0x3fba('0x28')]=_['keys'](db[_0x3fba('0x3b')][_0x3fba('0x25')]);_0x44aa8b[_0x3fba('0x29')]=_['keys'](_0x1757d5['query']);_0x44aa8b[_0x3fba('0x34')]=_[_0x3fba('0x2b')](_0x44aa8b['model'],_0x44aa8b['query']);_0x43a8bd[_0x3fba('0x2d')]=_[_0x3fba('0x2b')](_0x44aa8b[_0x3fba('0x28')],qs['fields'](_0x1757d5['query']['fields']));_0x43a8bd[_0x3fba('0x2d')]=_0x43a8bd[_0x3fba('0x2d')]['length']?_0x43a8bd[_0x3fba('0x2d')]:_0x44aa8b[_0x3fba('0x28')];if(_0x1757d5[_0x3fba('0x29')][_0x3fba('0x41')]){_0x43a8bd['include']=[{'all':!![]}];}_0x43a8bd=_[_0x3fba('0x37')]({},_0x43a8bd,_0x1757d5['options']);return db['Dynamics365Configuration'][_0x3fba('0x42')](_0x43a8bd)[_0x3fba('0x1f')](handleEntityNotFound(_0x1013f5,null))[_0x3fba('0x1f')](respondWithResult(_0x1013f5,null))[_0x3fba('0x43')](handleError(_0x1013f5,null));};exports[_0x3fba('0x44')]=function(_0x915180,_0x585879){return db['Dynamics365Configuration'][_0x3fba('0x44')](_0x915180[_0x3fba('0x45')],{})[_0x3fba('0x1f')](respondWithResult(_0x585879,0xc9))['catch'](handleError(_0x585879,null));};exports['update']=function(_0x270a0a,_0x450edb){if(_0x270a0a[_0x3fba('0x45')]['id']){delete _0x270a0a[_0x3fba('0x45')]['id'];}return db[_0x3fba('0x3b')][_0x3fba('0x42')]({'where':{'id':_0x270a0a[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0x450edb,null))[_0x3fba('0x1f')](saveUpdates(_0x270a0a[_0x3fba('0x45')],null))[_0x3fba('0x1f')](respondWithResult(_0x450edb,null))[_0x3fba('0x43')](handleError(_0x450edb,null));};exports['destroy']=function(_0x28ddaa,_0x55e1aa){return db[_0x3fba('0x3b')][_0x3fba('0x42')]({'where':{'id':_0x28ddaa[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0x55e1aa,null))[_0x3fba('0x1f')](removeEntity(_0x55e1aa,null))[_0x3fba('0x43')](handleError(_0x55e1aa,null));};exports['getFields']=function(_0x560009,_0xd6269a,_0x5cacdd){var _0x5d75c9={};var _0xbe7e7e={};var _0x34aa06;var _0x530566;return db[_0x3fba('0x3b')]['findOne']({'where':{'id':_0x560009[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0xd6269a,null))['then'](function(_0x10ffc0){if(_0x10ffc0){_0x34aa06=_0x10ffc0;_0xbe7e7e[_0x3fba('0x28')]=_[_0x3fba('0x2a')](db[_0x3fba('0x46')][_0x3fba('0x25')]);_0xbe7e7e[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x560009[_0x3fba('0x29')]);_0xbe7e7e[_0x3fba('0x34')]=_[_0x3fba('0x2b')](_0xbe7e7e[_0x3fba('0x28')],_0xbe7e7e[_0x3fba('0x29')]);_0x5d75c9['attributes']=_[_0x3fba('0x2b')](_0xbe7e7e['model'],qs[_0x3fba('0x2c')](_0x560009[_0x3fba('0x29')]['fields']));_0x5d75c9[_0x3fba('0x2d')]=_0x5d75c9['attributes'][_0x3fba('0x2e')]?_0x5d75c9['attributes']:_0xbe7e7e['model'];_0x5d75c9['order']=qs[_0x3fba('0x32')](_0x560009[_0x3fba('0x29')][_0x3fba('0x32')]);_0x5d75c9[_0x3fba('0x33')]=qs[_0x3fba('0x34')](_[_0x3fba('0x35')](_0x560009['query'],_0xbe7e7e[_0x3fba('0x34')]));if(_0x560009['query'][_0x3fba('0x36')]){_0x5d75c9[_0x3fba('0x33')]=_[_0x3fba('0x37')](_0x5d75c9[_0x3fba('0x33')],{'$or':_[_0x3fba('0x24')](_0x5d75c9['attributes'],function(_0x4d663e){var _0x37ec7e={};_0x37ec7e[_0x4d663e]={'$like':'%'+_0x560009[_0x3fba('0x29')][_0x3fba('0x36')]+'%'};return _0x37ec7e;})});}_0x5d75c9=_[_0x3fba('0x37')]({},_0x5d75c9,_0x560009['options']);return _0x34aa06[_0x3fba('0x47')](_0x5d75c9);}})['then'](function(_0x4f93c8){if(_0x4f93c8){_0x530566=_0x4f93c8[_0x3fba('0x2e')];if(!_0x560009[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x5d75c9[_0x3fba('0x1a')]=qs[_0x3fba('0x1a')](_0x560009[_0x3fba('0x29')][_0x3fba('0x1a')]);_0x5d75c9['offset']=qs[_0x3fba('0x18')](_0x560009[_0x3fba('0x29')][_0x3fba('0x18')]);}return _0x34aa06[_0x3fba('0x47')](_0x5d75c9);}})[_0x3fba('0x1f')](function(_0x309687){if(_0x309687){return _0x309687?{'count':_0x530566,'rows':_0x309687}:null;}})[_0x3fba('0x1f')](respondWithResult(_0xd6269a,null))['catch'](handleError(_0xd6269a,null));};exports['getSubjects']=function(_0x2763b6,_0xe2eac,_0x444e64){var _0x11d9ed={};var _0x89a403={};var _0xcd32bf;var _0x4efbe4;return db[_0x3fba('0x3b')]['findOne']({'where':{'id':_0x2763b6['params']['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0xe2eac,null))[_0x3fba('0x1f')](function(_0xc6bb0d){if(_0xc6bb0d){_0xcd32bf=_0xc6bb0d;_0x89a403[_0x3fba('0x28')]=_[_0x3fba('0x2a')](db[_0x3fba('0x46')][_0x3fba('0x25')]);_0x89a403[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x2763b6['query']);_0x89a403['filters']=_[_0x3fba('0x2b')](_0x89a403[_0x3fba('0x28')],_0x89a403[_0x3fba('0x29')]);_0x11d9ed['attributes']=_['intersection'](_0x89a403[_0x3fba('0x28')],qs[_0x3fba('0x2c')](_0x2763b6[_0x3fba('0x29')]['fields']));_0x11d9ed[_0x3fba('0x2d')]=_0x11d9ed['attributes']['length']?_0x11d9ed['attributes']:_0x89a403[_0x3fba('0x28')];_0x11d9ed[_0x3fba('0x31')]=qs[_0x3fba('0x32')](_0x2763b6[_0x3fba('0x29')][_0x3fba('0x32')]);_0x11d9ed['where']=qs[_0x3fba('0x34')](_[_0x3fba('0x35')](_0x2763b6[_0x3fba('0x29')],_0x89a403['filters']));if(_0x2763b6[_0x3fba('0x29')][_0x3fba('0x36')]){_0x11d9ed['where']=_[_0x3fba('0x37')](_0x11d9ed['where'],{'$or':_[_0x3fba('0x24')](_0x11d9ed[_0x3fba('0x2d')],function(_0x23746d){var _0x30e9b5={};_0x30e9b5[_0x23746d]={'$like':'%'+_0x2763b6[_0x3fba('0x29')][_0x3fba('0x36')]+'%'};return _0x30e9b5;})});}_0x11d9ed=_['merge']({},_0x11d9ed,_0x2763b6[_0x3fba('0x3a')]);return _0xcd32bf['getSubjects'](_0x11d9ed);}})['then'](function(_0x45121d){if(_0x45121d){_0x4efbe4=_0x45121d[_0x3fba('0x2e')];if(!_0x2763b6[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x11d9ed['limit']=qs['limit'](_0x2763b6['query'][_0x3fba('0x1a')]);_0x11d9ed[_0x3fba('0x18')]=qs['offset'](_0x2763b6[_0x3fba('0x29')]['offset']);}return _0xcd32bf['getSubjects'](_0x11d9ed);}})[_0x3fba('0x1f')](function(_0x13d1f1){if(_0x13d1f1){return _0x13d1f1?{'count':_0x4efbe4,'rows':_0x13d1f1}:null;}})[_0x3fba('0x1f')](respondWithResult(_0xe2eac,null))[_0x3fba('0x43')](handleError(_0xe2eac,null));};exports[_0x3fba('0x48')]=function(_0x4b1c3f,_0x4af0cd,_0x28a9d3){var _0x423c9a={};var _0x17d60d={};var _0x54f380;var _0x3c08a9;return db[_0x3fba('0x3b')][_0x3fba('0x49')]({'where':{'id':_0x4b1c3f[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0x4af0cd,null))[_0x3fba('0x1f')](function(_0x5ebce1){if(_0x5ebce1){_0x54f380=_0x5ebce1;_0x17d60d[_0x3fba('0x28')]=_[_0x3fba('0x2a')](db[_0x3fba('0x46')][_0x3fba('0x25')]);_0x17d60d[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x4b1c3f['query']);_0x17d60d[_0x3fba('0x34')]=_[_0x3fba('0x2b')](_0x17d60d[_0x3fba('0x28')],_0x17d60d[_0x3fba('0x29')]);_0x423c9a[_0x3fba('0x2d')]=_[_0x3fba('0x2b')](_0x17d60d[_0x3fba('0x28')],qs[_0x3fba('0x2c')](_0x4b1c3f[_0x3fba('0x29')]['fields']));_0x423c9a['attributes']=_0x423c9a[_0x3fba('0x2d')][_0x3fba('0x2e')]?_0x423c9a[_0x3fba('0x2d')]:_0x17d60d[_0x3fba('0x28')];_0x423c9a[_0x3fba('0x31')]=qs[_0x3fba('0x32')](_0x4b1c3f[_0x3fba('0x29')]['sort']);_0x423c9a[_0x3fba('0x33')]=qs[_0x3fba('0x34')](_['pick'](_0x4b1c3f[_0x3fba('0x29')],_0x17d60d['filters']));if(_0x4b1c3f[_0x3fba('0x29')][_0x3fba('0x36')]){_0x423c9a[_0x3fba('0x33')]=_[_0x3fba('0x37')](_0x423c9a[_0x3fba('0x33')],{'$or':_['map'](_0x423c9a[_0x3fba('0x2d')],function(_0x3abb0f){var _0x40f608={};_0x40f608[_0x3abb0f]={'$like':'%'+_0x4b1c3f[_0x3fba('0x29')]['filter']+'%'};return _0x40f608;})});}_0x423c9a=_['merge']({},_0x423c9a,_0x4b1c3f[_0x3fba('0x3a')]);return _0x54f380['getDescriptions'](_0x423c9a);}})[_0x3fba('0x1f')](function(_0x505883){if(_0x505883){_0x3c08a9=_0x505883[_0x3fba('0x2e')];if(!_0x4b1c3f[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x423c9a[_0x3fba('0x1a')]=qs[_0x3fba('0x1a')](_0x4b1c3f[_0x3fba('0x29')][_0x3fba('0x1a')]);_0x423c9a['offset']=qs[_0x3fba('0x18')](_0x4b1c3f[_0x3fba('0x29')]['offset']);}return _0x54f380[_0x3fba('0x48')](_0x423c9a);}})[_0x3fba('0x1f')](function(_0x5298cf){if(_0x5298cf){return _0x5298cf?{'count':_0x3c08a9,'rows':_0x5298cf}:null;}})[_0x3fba('0x1f')](respondWithResult(_0x4af0cd,null))[_0x3fba('0x43')](handleError(_0x4af0cd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index dae167a..bbe5a24 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0x4b84[_0x409deb];return _0x15a4f7;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x3424e0,_0x46a3c5){var _0x129368=function(_0x3d2403){while(--_0x3d2403){_0x3424e0['push'](_0x3424e0['shift']());}};_0x129368(++_0x46a3c5);}(_0x84ab,0x12f));var _0xb84a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x84ab[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 93950c2..8b2f4b0 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 _0x1be0=['info','request\x20sent','debug','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1be0,0x1ad));var _0x01be=function(_0xfc55f1,_0x7825bc){_0xfc55f1=_0xfc55f1-0x0;var _0x5000f1=_0x1be0[_0xfc55f1];return _0x5000f1;};'use strict';var _=require(_0x01be('0x0'));var util=require(_0x01be('0x1'));var moment=require(_0x01be('0x2'));var BPromise=require('bluebird');var rs=require(_0x01be('0x3'));var fs=require('fs');var Redis=require(_0x01be('0x4'));var db=require(_0x01be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01be('0x6'))('rpc');var config=require(_0x01be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x01be('0x8')][_0x01be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ab2ed,_0x43b61a,_0x39b235){return new BPromise(function(_0x4f606f,_0x4d43c9){return client['request'](_0x1ab2ed,_0x39b235)[_0x01be('0xa')](function(_0x2f1010){logger[_0x01be('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43b61a,_0x01be('0xc'));logger[_0x01be('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x43b61a,_0x01be('0xc'),JSON[_0x01be('0xe')](_0x2f1010));if(_0x2f1010[_0x01be('0xf')]){if(_0x2f1010[_0x01be('0xf')][_0x01be('0x10')]===0x1f4){logger[_0x01be('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43b61a,_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);return _0x4d43c9(_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);}logger[_0x01be('0xf')](_0x01be('0x12'),_0x43b61a,_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);return _0x4f606f(_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);}else{logger[_0x01be('0xb')](_0x01be('0x12'),_0x43b61a,_0x01be('0xc'));_0x4f606f(_0x2f1010['result']['message']);}})[_0x01be('0x13')](function(_0x3e1960){logger[_0x01be('0xf')](_0x01be('0x12'),_0x43b61a,_0x3e1960);_0x4d43c9(_0x3e1960);});});} \ No newline at end of file +var _0x0e5e=['request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x0e5e,0x136));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe0e5('0x0'));var util=require(_0xe0e5('0x1'));var moment=require(_0xe0e5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0e5('0x3'));var db=require(_0xe0e5('0x4'))['db'];var utils=require(_0xe0e5('0x5'));var logger=require(_0xe0e5('0x6'))(_0xe0e5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe0e5('0x8')][_0xe0e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23fba8,_0xcd7ba5,_0x55edec){return new BPromise(function(_0x5e9666,_0x57b4bf){return client[_0xe0e5('0xa')](_0x23fba8,_0x55edec)[_0xe0e5('0xb')](function(_0x5b9728){logger['info'](_0xe0e5('0xc'),_0xcd7ba5,_0xe0e5('0xd'));logger['debug'](_0xe0e5('0xe'),_0xcd7ba5,_0xe0e5('0xd'),JSON['stringify'](_0x5b9728));if(_0x5b9728[_0xe0e5('0xf')]){if(_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x10')]===0x1f4){logger[_0xe0e5('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0xcd7ba5,_0x5b9728['error'][_0xe0e5('0x11')]);return _0x57b4bf(_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x11')]);}logger[_0xe0e5('0xf')](_0xe0e5('0xc'),_0xcd7ba5,_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x11')]);return _0x5e9666(_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x11')]);}else{logger[_0xe0e5('0x12')](_0xe0e5('0xc'),_0xcd7ba5,_0xe0e5('0xd'));_0x5e9666(_0x5b9728['result']['message']);}})[_0xe0e5('0x13')](function(_0x35f5bb){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xcd7ba5,_0x35f5bb);_0x57b4bf(_0x35f5bb);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index a579a77..cc9279f 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 _0xe2af=['exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy'];(function(_0x5ef4d6,_0x445040){var _0x4c60c5=function(_0x7e9626){while(--_0x7e9626){_0x5ef4d6['push'](_0x5ef4d6['shift']());}};_0x4c60c5(++_0x445040);}(_0xe2af,0x7f));var _0xfe2a=function(_0x38ba73,_0x38ea3f){_0x38ba73=_0x38ba73-0x0;var _0x39680d=_0xe2af[_0x38ba73];return _0x39680d;};'use strict';var multer=require(_0xfe2a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfe2a('0x1'));var express=require(_0xfe2a('0x2'));var router=express['Router']();var fs_extra=require(_0xfe2a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfe2a('0x4'));var config=require(_0xfe2a('0x5'));var controller=require(_0xfe2a('0x6'));router[_0xfe2a('0x7')]('/',auth['isAuthenticated'](),controller[_0xfe2a('0x8')]);router[_0xfe2a('0x7')](_0xfe2a('0x9'),auth['isAuthenticated'](),controller[_0xfe2a('0xa')]);router[_0xfe2a('0xb')]('/',auth[_0xfe2a('0xc')](),controller['create']);router[_0xfe2a('0xd')](_0xfe2a('0x9'),auth[_0xfe2a('0xc')](),controller[_0xfe2a('0xe')]);router[_0xfe2a('0xf')](_0xfe2a('0x9'),auth[_0xfe2a('0xc')](),controller[_0xfe2a('0x10')]);module[_0xfe2a('0x11')]=router; \ No newline at end of file +var _0xfd4e=['isAuthenticated','/:id','post','create','put','delete','destroy','multer','path','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x29ef06,_0x3e54b7){var _0x57bd49=function(_0x21e644){while(--_0x21e644){_0x29ef06['push'](_0x29ef06['shift']());}};_0x57bd49(++_0x3e54b7);}(_0xfd4e,0xbd));var _0xefd4=function(_0x3ea868,_0x247a31){_0x3ea868=_0x3ea868-0x0;var _0x5d1977=_0xfd4e[_0x3ea868];return _0x5d1977;};'use strict';var multer=require(_0xefd4('0x0'));var util=require('util');var path=require(_0xefd4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xefd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xefd4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xefd4('0x4'));var controller=require(_0xefd4('0x5'));router[_0xefd4('0x6')]('/',auth[_0xefd4('0x7')](),controller['index']);router['get'](_0xefd4('0x8'),auth[_0xefd4('0x7')](),controller['show']);router[_0xefd4('0x9')]('/',auth[_0xefd4('0x7')](),controller[_0xefd4('0xa')]);router[_0xefd4('0xb')](_0xefd4('0x8'),auth[_0xefd4('0x7')](),controller['update']);router[_0xefd4('0xc')](_0xefd4('0x8'),auth[_0xefd4('0x7')](),controller[_0xefd4('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0c290d9..7e84b79 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 _0x7f35=['string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0x7f35,0x127));var _0x57f3=function(_0x416a14,_0x1d374b){_0x416a14=_0x416a14-0x0;var _0x4dea99=_0x7f35[_0x416a14];return _0x4dea99;};'use strict';var Sequelize=require(_0x57f3('0x0'));module[_0x57f3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x57f3('0x2'),_0x57f3('0x3'),'customVariable','keyValue',_0x57f3('0x4')),'defaultValue':_0x57f3('0x2')},'content':{'type':Sequelize[_0x57f3('0x5')]},'key':{'type':Sequelize[_0x57f3('0x5')]},'keyType':{'type':Sequelize[_0x57f3('0x6')](_0x57f3('0x2'),'variable',_0x57f3('0x7'))},'keyContent':{'type':Sequelize[_0x57f3('0x5')]},'idField':{'type':Sequelize[_0x57f3('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x57f3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfe3e=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x4604f0,_0x34d0a7){var _0x3f39f5=function(_0x11060b){while(--_0x11060b){_0x4604f0['push'](_0x4604f0['shift']());}};_0x3f39f5(++_0x34d0a7);}(_0xfe3e,0xd5));var _0xefe3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfe3e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xefe3('0x0')]={'type':{'type':Sequelize[_0xefe3('0x1')]('string',_0xefe3('0x2'),_0xefe3('0x3'),_0xefe3('0x4'),_0xefe3('0x5')),'defaultValue':_0xefe3('0x6')},'content':{'type':Sequelize[_0xefe3('0x7')]},'key':{'type':Sequelize[_0xefe3('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xefe3('0x6'),_0xefe3('0x2'),_0xefe3('0x3'))},'keyContent':{'type':Sequelize[_0xefe3('0x7')]},'idField':{'type':Sequelize[_0xefe3('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xefe3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 910d10d..a095eb3 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 _0x3bb7=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','send','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x9647da,_0x1f7117){var _0x25c414=function(_0x260ce6){while(--_0x260ce6){_0x9647da['push'](_0x9647da['shift']());}};_0x25c414(++_0x1f7117);}(_0x3bb7,0x14a));var _0x73bb=function(_0x1e5a0c,_0x3a16fc){_0x1e5a0c=_0x1e5a0c-0x0;var _0x5cc15b=_0x3bb7[_0x1e5a0c];return _0x5cc15b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x73bb('0x0'));var zipdir=require(_0x73bb('0x1'));var jsonpatch=require(_0x73bb('0x2'));var rp=require(_0x73bb('0x3'));var moment=require(_0x73bb('0x4'));var BPromise=require(_0x73bb('0x5'));var Mustache=require(_0x73bb('0x6'));var util=require(_0x73bb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x73bb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73bb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x73bb('0xa'));var deskjs=require(_0x73bb('0xb'));var toCsv=require(_0x73bb('0x8'));var querystring=require(_0x73bb('0xc'));var Papa=require('papaparse');var Redis=require(_0x73bb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x73bb('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73bb('0xf'));var logger=require('../../config/logger')(_0x73bb('0x10'));var utils=require(_0x73bb('0x11'));var config=require(_0x73bb('0x12'));var licenseUtil=require(_0x73bb('0x13'));var db=require(_0x73bb('0x14'))['db'];function respondWithStatusCode(_0x34c017,_0x510296){_0x510296=_0x510296||0xcc;return function(_0x35b2b1){if(_0x35b2b1){return _0x34c017[_0x73bb('0x15')](_0x510296);}return _0x34c017[_0x73bb('0x16')](_0x510296)[_0x73bb('0x17')]();};}function respondWithResult(_0x1c2251,_0x1c370e){_0x1c370e=_0x1c370e||0xc8;return function(_0x13163e){if(_0x13163e){return _0x1c2251[_0x73bb('0x16')](_0x1c370e)[_0x73bb('0x18')](_0x13163e);}};}function respondWithFilteredResult(_0x2188db,_0x5730f1){return function(_0x31db93){if(_0x31db93){var _0x4ef8ab=typeof _0x5730f1[_0x73bb('0x19')]===_0x73bb('0x1a')&&typeof _0x5730f1[_0x73bb('0x1b')]==='undefined';var _0x5abbfa=_0x31db93[_0x73bb('0x1c')];var _0xac33f1=_0x4ef8ab?0x0:_0x5730f1[_0x73bb('0x19')];var _0x4aac68=_0x4ef8ab?_0x31db93['count']:_0x5730f1[_0x73bb('0x19')]+_0x5730f1['limit'];var _0x2f0fce;if(_0x4aac68>=_0x5abbfa){_0x4aac68=_0x5abbfa;_0x2f0fce=0xc8;}else{_0x2f0fce=0xce;}_0x2188db[_0x73bb('0x16')](_0x2f0fce);return _0x2188db[_0x73bb('0x1d')]('Content-Range',_0xac33f1+'-'+_0x4aac68+'/'+_0x5abbfa)['json'](_0x31db93);}return null;};}function patchUpdates(_0x46629d){return function(_0x4a8bb7){try{jsonpatch[_0x73bb('0x1e')](_0x4a8bb7,_0x46629d,!![]);}catch(_0x498867){return BPromise[_0x73bb('0x1f')](_0x498867);}return _0x4a8bb7[_0x73bb('0x20')]();};}function saveUpdates(_0x28ff3c,_0x41de93){return function(_0x4d50fc){if(_0x4d50fc){return _0x4d50fc[_0x73bb('0x21')](_0x28ff3c)['then'](function(_0x220c09){return _0x220c09;});}return null;};}function removeEntity(_0x325779,_0x40be24){return function(_0x191ff0){if(_0x191ff0){return _0x191ff0[_0x73bb('0x22')]()[_0x73bb('0x23')](function(){_0x325779[_0x73bb('0x16')](0xcc)[_0x73bb('0x17')]();});}};}function handleEntityNotFound(_0x2c240a,_0x185c28){return function(_0x338813){if(!_0x338813){_0x2c240a[_0x73bb('0x15')](0x194);}return _0x338813;};}function handleError(_0x8b3a4,_0x3de248){_0x3de248=_0x3de248||0x1f4;return function(_0x3dd81c){logger[_0x73bb('0x24')](_0x3dd81c[_0x73bb('0x25')]);if(_0x3dd81c['name']){delete _0x3dd81c['name'];}_0x8b3a4['status'](_0x3de248)[_0x73bb('0x26')](_0x3dd81c);};}exports['index']=function(_0x242aa7,_0x57d1ab){var _0x94a63f={},_0x1b4b21={},_0x5ca22f={'count':0x0,'rows':[]};var _0x16c019=_['map'](db[_0x73bb('0x27')][_0x73bb('0x28')],function(_0x4d9673){return{'name':_0x4d9673[_0x73bb('0x29')],'type':_0x4d9673[_0x73bb('0x2a')][_0x73bb('0x2b')]};});_0x1b4b21[_0x73bb('0x2c')]=_[_0x73bb('0x2d')](_0x16c019,'name');_0x1b4b21[_0x73bb('0x2e')]=_[_0x73bb('0x2f')](_0x242aa7['query']);_0x1b4b21[_0x73bb('0x30')]=_[_0x73bb('0x31')](_0x1b4b21['model'],_0x1b4b21[_0x73bb('0x2e')]);_0x94a63f[_0x73bb('0x32')]=_['intersection'](_0x1b4b21[_0x73bb('0x2c')],qs[_0x73bb('0x33')](_0x242aa7[_0x73bb('0x2e')][_0x73bb('0x33')]));_0x94a63f[_0x73bb('0x32')]=_0x94a63f['attributes']['length']?_0x94a63f[_0x73bb('0x32')]:_0x1b4b21['model'];if(!_0x242aa7[_0x73bb('0x2e')][_0x73bb('0x34')](_0x73bb('0x35'))){_0x94a63f['limit']=qs[_0x73bb('0x1b')](_0x242aa7['query'][_0x73bb('0x1b')]);_0x94a63f[_0x73bb('0x19')]=qs[_0x73bb('0x19')](_0x242aa7[_0x73bb('0x2e')][_0x73bb('0x19')]);}_0x94a63f['order']=qs[_0x73bb('0x36')](_0x242aa7['query']['sort']);_0x94a63f[_0x73bb('0x37')]=qs[_0x73bb('0x30')](_[_0x73bb('0x38')](_0x242aa7[_0x73bb('0x2e')],_0x1b4b21[_0x73bb('0x30')]),_0x16c019);if(_0x242aa7['query']['filter']){_0x94a63f[_0x73bb('0x37')]=_['merge'](_0x94a63f[_0x73bb('0x37')],{'$or':_[_0x73bb('0x2d')](_0x16c019,function(_0x3487c7){if(_0x3487c7[_0x73bb('0x2a')]!=='VIRTUAL'){var _0x3504f3={};_0x3504f3[_0x3487c7['name']]={'$like':'%'+_0x242aa7[_0x73bb('0x2e')][_0x73bb('0x39')]+'%'};return _0x3504f3;}})});}_0x94a63f=_['merge']({},_0x94a63f,_0x242aa7[_0x73bb('0x3a')]);var _0x5cf6f3={'where':_0x94a63f['where']};return db['Dynamics365Field'][_0x73bb('0x1c')](_0x5cf6f3)['then'](function(_0x2eed1f){_0x5ca22f['count']=_0x2eed1f;if(_0x242aa7[_0x73bb('0x2e')][_0x73bb('0x3b')]){_0x94a63f[_0x73bb('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x73bb('0x3d')](_0x94a63f);})['then'](function(_0x1a893e){_0x5ca22f['rows']=_0x1a893e;return _0x5ca22f;})[_0x73bb('0x23')](respondWithFilteredResult(_0x57d1ab,_0x94a63f))[_0x73bb('0x3e')](handleError(_0x57d1ab,null));};exports[_0x73bb('0x3f')]=function(_0x2f29f6,_0x31f107){var _0x14099d={'raw':!![],'where':{'id':_0x2f29f6[_0x73bb('0x40')]['id']}},_0x1d1d5a={};_0x1d1d5a[_0x73bb('0x2c')]=_['keys'](db[_0x73bb('0x27')][_0x73bb('0x28')]);_0x1d1d5a[_0x73bb('0x2e')]=_[_0x73bb('0x2f')](_0x2f29f6[_0x73bb('0x2e')]);_0x1d1d5a['filters']=_[_0x73bb('0x31')](_0x1d1d5a[_0x73bb('0x2c')],_0x1d1d5a[_0x73bb('0x2e')]);_0x14099d[_0x73bb('0x32')]=_[_0x73bb('0x31')](_0x1d1d5a['model'],qs[_0x73bb('0x33')](_0x2f29f6['query'][_0x73bb('0x33')]));_0x14099d[_0x73bb('0x32')]=_0x14099d[_0x73bb('0x32')][_0x73bb('0x41')]?_0x14099d[_0x73bb('0x32')]:_0x1d1d5a['model'];if(_0x2f29f6[_0x73bb('0x2e')]['includeAll']){_0x14099d['include']=[{'all':!![]}];}_0x14099d=_['merge']({},_0x14099d,_0x2f29f6['options']);return db[_0x73bb('0x27')][_0x73bb('0x42')](_0x14099d)[_0x73bb('0x23')](handleEntityNotFound(_0x31f107,null))[_0x73bb('0x23')](respondWithResult(_0x31f107,null))['catch'](handleError(_0x31f107,null));};exports[_0x73bb('0x43')]=function(_0x2409d3,_0x6039d4){return db[_0x73bb('0x27')][_0x73bb('0x43')](_0x2409d3['body'],{})[_0x73bb('0x23')](respondWithResult(_0x6039d4,0xc9))[_0x73bb('0x3e')](handleError(_0x6039d4,null));};exports['update']=function(_0x377d58,_0x37623c){if(_0x377d58[_0x73bb('0x44')]['id']){delete _0x377d58[_0x73bb('0x44')]['id'];}return db['Dynamics365Field'][_0x73bb('0x42')]({'where':{'id':_0x377d58['params']['id']}})[_0x73bb('0x23')](handleEntityNotFound(_0x37623c,null))[_0x73bb('0x23')](saveUpdates(_0x377d58[_0x73bb('0x44')],null))[_0x73bb('0x23')](respondWithResult(_0x37623c,null))[_0x73bb('0x3e')](handleError(_0x37623c,null));};exports[_0x73bb('0x22')]=function(_0x320e36,_0x3c3815){return db[_0x73bb('0x27')]['find']({'where':{'id':_0x320e36['params']['id']}})[_0x73bb('0x23')](handleEntityNotFound(_0x3c3815,null))[_0x73bb('0x23')](removeEntity(_0x3c3815,null))[_0x73bb('0x3e')](handleError(_0x3c3815,null));}; \ No newline at end of file +var _0xebfe=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xebfe,0x139));var _0xeebf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xebfe[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xeebf('0x0'));var rimraf=require(_0xeebf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeebf('0x2'));var rp=require(_0xeebf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeebf('0x4'));var util=require(_0xeebf('0x5'));var path=require(_0xeebf('0x6'));var sox=require(_0xeebf('0x7'));var csv=require(_0xeebf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeebf('0x9'));var _=require('lodash');var squel=require(_0xeebf('0xa'));var crypto=require(_0xeebf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeebf('0x8'));var querystring=require(_0xeebf('0xc'));var Papa=require(_0xeebf('0xd'));var Redis=require(_0xeebf('0xe'));var authService=require(_0xeebf('0xf'));var qs=require(_0xeebf('0x10'));var as=require(_0xeebf('0x11'));var hardwareService=require(_0xeebf('0x12'));var logger=require(_0xeebf('0x13'))(_0xeebf('0x14'));var utils=require('../../config/utils');var config=require(_0xeebf('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26b27f,_0x1504fe){_0x1504fe=_0x1504fe||0xcc;return function(_0x3b7037){if(_0x3b7037){return _0x26b27f[_0xeebf('0x16')](_0x1504fe);}return _0x26b27f[_0xeebf('0x17')](_0x1504fe)[_0xeebf('0x18')]();};}function respondWithResult(_0x4ccbfc,_0x208f7c){_0x208f7c=_0x208f7c||0xc8;return function(_0x272e45){if(_0x272e45){return _0x4ccbfc[_0xeebf('0x17')](_0x208f7c)[_0xeebf('0x19')](_0x272e45);}};}function respondWithFilteredResult(_0x1f3d6c,_0x39b8b7){return function(_0x4340cb){if(_0x4340cb){var _0x41959d=typeof _0x39b8b7[_0xeebf('0x1a')]===_0xeebf('0x1b')&&typeof _0x39b8b7[_0xeebf('0x1c')]===_0xeebf('0x1b');var _0x8c1b83=_0x4340cb['count'];var _0x369673=_0x41959d?0x0:_0x39b8b7[_0xeebf('0x1a')];var _0x28f893=_0x41959d?_0x4340cb[_0xeebf('0x1d')]:_0x39b8b7['offset']+_0x39b8b7[_0xeebf('0x1c')];var _0x39b653;if(_0x28f893>=_0x8c1b83){_0x28f893=_0x8c1b83;_0x39b653=0xc8;}else{_0x39b653=0xce;}_0x1f3d6c[_0xeebf('0x17')](_0x39b653);return _0x1f3d6c[_0xeebf('0x1e')](_0xeebf('0x1f'),_0x369673+'-'+_0x28f893+'/'+_0x8c1b83)[_0xeebf('0x19')](_0x4340cb);}return null;};}function patchUpdates(_0x3c4125){return function(_0x5b2711){try{jsonpatch[_0xeebf('0x20')](_0x5b2711,_0x3c4125,!![]);}catch(_0x25a604){return BPromise[_0xeebf('0x21')](_0x25a604);}return _0x5b2711[_0xeebf('0x22')]();};}function saveUpdates(_0x64c2f9,_0x866a6c){return function(_0x57a744){if(_0x57a744){return _0x57a744[_0xeebf('0x23')](_0x64c2f9)[_0xeebf('0x24')](function(_0x1b8bc9){return _0x1b8bc9;});}return null;};}function removeEntity(_0x4e896d,_0x3c9b01){return function(_0x53e45e){if(_0x53e45e){return _0x53e45e['destroy']()['then'](function(){_0x4e896d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ea89c,_0x4bd622){return function(_0x464aa6){if(!_0x464aa6){_0x4ea89c[_0xeebf('0x16')](0x194);}return _0x464aa6;};}function handleError(_0x24285f,_0x26a7b6){_0x26a7b6=_0x26a7b6||0x1f4;return function(_0x4a312c){logger[_0xeebf('0x25')](_0x4a312c['stack']);if(_0x4a312c[_0xeebf('0x26')]){delete _0x4a312c[_0xeebf('0x26')];}_0x24285f['status'](_0x26a7b6)[_0xeebf('0x27')](_0x4a312c);};}exports[_0xeebf('0x28')]=function(_0x2a27cf,_0x5aa34b){var _0x5665e7={},_0x55d13d={},_0x3ff4cd={'count':0x0,'rows':[]};var _0x101359=_[_0xeebf('0x29')](db[_0xeebf('0x2a')][_0xeebf('0x2b')],function(_0x3215a4){return{'name':_0x3215a4[_0xeebf('0x2c')],'type':_0x3215a4['type'][_0xeebf('0x2d')]};});_0x55d13d[_0xeebf('0x2e')]=_['map'](_0x101359,_0xeebf('0x26'));_0x55d13d[_0xeebf('0x2f')]=_[_0xeebf('0x30')](_0x2a27cf['query']);_0x55d13d[_0xeebf('0x31')]=_[_0xeebf('0x32')](_0x55d13d[_0xeebf('0x2e')],_0x55d13d['query']);_0x5665e7[_0xeebf('0x33')]=_[_0xeebf('0x32')](_0x55d13d[_0xeebf('0x2e')],qs[_0xeebf('0x34')](_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x34')]));_0x5665e7['attributes']=_0x5665e7['attributes'][_0xeebf('0x35')]?_0x5665e7[_0xeebf('0x33')]:_0x55d13d[_0xeebf('0x2e')];if(!_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x36')](_0xeebf('0x37'))){_0x5665e7[_0xeebf('0x1c')]=qs[_0xeebf('0x1c')](_0x2a27cf[_0xeebf('0x2f')]['limit']);_0x5665e7[_0xeebf('0x1a')]=qs[_0xeebf('0x1a')](_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x1a')]);}_0x5665e7[_0xeebf('0x38')]=qs[_0xeebf('0x39')](_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x39')]);_0x5665e7['where']=qs[_0xeebf('0x31')](_[_0xeebf('0x3a')](_0x2a27cf['query'],_0x55d13d[_0xeebf('0x31')]),_0x101359);if(_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x3b')]){_0x5665e7[_0xeebf('0x3c')]=_[_0xeebf('0x3d')](_0x5665e7[_0xeebf('0x3c')],{'$or':_['map'](_0x101359,function(_0x520dfc){if(_0x520dfc[_0xeebf('0x3e')]!==_0xeebf('0x3f')){var _0x308cfc={};_0x308cfc[_0x520dfc['name']]={'$like':'%'+_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x3b')]+'%'};return _0x308cfc;}})});}_0x5665e7=_[_0xeebf('0x3d')]({},_0x5665e7,_0x2a27cf['options']);var _0x2203e5={'where':_0x5665e7[_0xeebf('0x3c')]};return db['Dynamics365Field'][_0xeebf('0x1d')](_0x2203e5)[_0xeebf('0x24')](function(_0x3eb286){_0x3ff4cd[_0xeebf('0x1d')]=_0x3eb286;if(_0x2a27cf['query'][_0xeebf('0x40')]){_0x5665e7[_0xeebf('0x41')]=[{'all':!![]}];}return db[_0xeebf('0x2a')][_0xeebf('0x42')](_0x5665e7);})[_0xeebf('0x24')](function(_0x36b818){_0x3ff4cd[_0xeebf('0x43')]=_0x36b818;return _0x3ff4cd;})[_0xeebf('0x24')](respondWithFilteredResult(_0x5aa34b,_0x5665e7))[_0xeebf('0x44')](handleError(_0x5aa34b,null));};exports['show']=function(_0x50acc2,_0x3f7e42){var _0x560fa6={'raw':!![],'where':{'id':_0x50acc2[_0xeebf('0x45')]['id']}},_0x3faf5c={};_0x3faf5c['model']=_[_0xeebf('0x30')](db[_0xeebf('0x2a')][_0xeebf('0x2b')]);_0x3faf5c[_0xeebf('0x2f')]=_[_0xeebf('0x30')](_0x50acc2[_0xeebf('0x2f')]);_0x3faf5c[_0xeebf('0x31')]=_[_0xeebf('0x32')](_0x3faf5c['model'],_0x3faf5c[_0xeebf('0x2f')]);_0x560fa6[_0xeebf('0x33')]=_['intersection'](_0x3faf5c['model'],qs['fields'](_0x50acc2[_0xeebf('0x2f')]['fields']));_0x560fa6[_0xeebf('0x33')]=_0x560fa6[_0xeebf('0x33')][_0xeebf('0x35')]?_0x560fa6[_0xeebf('0x33')]:_0x3faf5c['model'];if(_0x50acc2[_0xeebf('0x2f')][_0xeebf('0x40')]){_0x560fa6[_0xeebf('0x41')]=[{'all':!![]}];}_0x560fa6=_[_0xeebf('0x3d')]({},_0x560fa6,_0x50acc2['options']);return db[_0xeebf('0x2a')][_0xeebf('0x46')](_0x560fa6)[_0xeebf('0x24')](handleEntityNotFound(_0x3f7e42,null))['then'](respondWithResult(_0x3f7e42,null))[_0xeebf('0x44')](handleError(_0x3f7e42,null));};exports[_0xeebf('0x47')]=function(_0x8610aa,_0x4ec017){return db[_0xeebf('0x2a')][_0xeebf('0x47')](_0x8610aa[_0xeebf('0x48')],{})[_0xeebf('0x24')](respondWithResult(_0x4ec017,0xc9))[_0xeebf('0x44')](handleError(_0x4ec017,null));};exports[_0xeebf('0x23')]=function(_0x495530,_0x4e54c8){if(_0x495530[_0xeebf('0x48')]['id']){delete _0x495530[_0xeebf('0x48')]['id'];}return db[_0xeebf('0x2a')][_0xeebf('0x46')]({'where':{'id':_0x495530[_0xeebf('0x45')]['id']}})[_0xeebf('0x24')](handleEntityNotFound(_0x4e54c8,null))['then'](saveUpdates(_0x495530[_0xeebf('0x48')],null))[_0xeebf('0x24')](respondWithResult(_0x4e54c8,null))[_0xeebf('0x44')](handleError(_0x4e54c8,null));};exports['destroy']=function(_0x1e0f87,_0x52b98c){return db[_0xeebf('0x2a')][_0xeebf('0x46')]({'where':{'id':_0x1e0f87['params']['id']}})[_0xeebf('0x24')](handleEntityNotFound(_0x52b98c,null))[_0xeebf('0x24')](removeEntity(_0x52b98c,null))[_0xeebf('0x44')](handleError(_0x52b98c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 298fc9c..a4df514 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 _0x7a4e=['./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x7a4e,0x96));var _0xe7a4=function(_0x40bcf9,_0x409033){_0x40bcf9=_0x40bcf9-0x0;var _0x10ab13=_0x7a4e[_0x40bcf9];return _0x10ab13;};'use strict';var _=require(_0xe7a4('0x0'));var util=require(_0xe7a4('0x1'));var logger=require('../../config/logger')(_0xe7a4('0x2'));var moment=require(_0xe7a4('0x3'));var BPromise=require(_0xe7a4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7a4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7a4('0x6'));module[_0xe7a4('0x7')]=function(_0x411448,_0x54c36e){return _0x411448['define'](_0xe7a4('0x8'),attributes,{'tableName':_0xe7a4('0x9'),'paranoid':![],'indexes':[{'name':_0xe7a4('0xa'),'fields':[_0xe7a4('0xb'),_0xe7a4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb3b=['moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbb3b,0x1ab));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbbb3('0x0'))(_0xbbb3('0x1'));var moment=require(_0xbbb3('0x2'));var BPromise=require(_0xbbb3('0x3'));var rp=require(_0xbbb3('0x4'));var fs=require('fs');var path=require(_0xbbb3('0x5'));var rimraf=require('rimraf');var config=require(_0xbbb3('0x6'));var attributes=require(_0xbbb3('0x7'));module[_0xbbb3('0x8')]=function(_0x2be37a,_0x4d9f8c){return _0x2be37a['define'](_0xbbb3('0x9'),attributes,{'tableName':_0xbbb3('0xa'),'paranoid':![],'indexes':[{'name':_0xbbb3('0xb'),'fields':['idField',_0xbbb3('0xc')],'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 f800225..9d1b632 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 _0xc9b4=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x226ea2,_0x1909e4){var _0x4f3d04=function(_0x4922a2){while(--_0x4922a2){_0x226ea2['push'](_0x226ea2['shift']());}};_0x4f3d04(++_0x1909e4);}(_0xc9b4,0x1e6));var _0x4c9b=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0xc9b4[_0x29ce14];return _0x48f289;};'use strict';var _=require(_0x4c9b('0x0'));var util=require(_0x4c9b('0x1'));var moment=require(_0x4c9b('0x2'));var BPromise=require(_0x4c9b('0x3'));var rs=require(_0x4c9b('0x4'));var fs=require('fs');var Redis=require(_0x4c9b('0x5'));var db=require(_0x4c9b('0x6'))['db'];var utils=require(_0x4c9b('0x7'));var logger=require(_0x4c9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c9b('0x9'));var client=jayson[_0x4c9b('0xa')][_0x4c9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xebb0fb,_0x2b148f,_0x12b28b){return new BPromise(function(_0x57f2b2,_0x21f749){return client[_0x4c9b('0xc')](_0xebb0fb,_0x12b28b)[_0x4c9b('0xd')](function(_0x21c1b0){logger['info'](_0x4c9b('0xe'),_0x2b148f,'request\x20sent');logger[_0x4c9b('0xf')](_0x4c9b('0x10'),_0x2b148f,_0x4c9b('0x11'),JSON[_0x4c9b('0x12')](_0x21c1b0));if(_0x21c1b0['error']){if(_0x21c1b0[_0x4c9b('0x13')][_0x4c9b('0x14')]===0x1f4){logger[_0x4c9b('0x13')](_0x4c9b('0xe'),_0x2b148f,_0x21c1b0[_0x4c9b('0x13')]['message']);return _0x21f749(_0x21c1b0[_0x4c9b('0x13')][_0x4c9b('0x15')]);}logger[_0x4c9b('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x2b148f,_0x21c1b0[_0x4c9b('0x13')][_0x4c9b('0x15')]);return _0x57f2b2(_0x21c1b0[_0x4c9b('0x13')]['message']);}else{logger['info'](_0x4c9b('0xe'),_0x2b148f,'request\x20sent');_0x57f2b2(_0x21c1b0[_0x4c9b('0x16')][_0x4c9b('0x15')]);}})[_0x4c9b('0x17')](function(_0x47c972){logger[_0x4c9b('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x2b148f,_0x47c972);_0x21f749(_0x47c972);});});} \ No newline at end of file +var _0x0803=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x43235e,_0x4c3638){var _0x46f122=function(_0x35acbe){while(--_0x35acbe){_0x43235e['push'](_0x43235e['shift']());}};_0x46f122(++_0x4c3638);}(_0x0803,0x174));var _0x3080=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0803[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3080('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3080('0x1'));var rs=require(_0x3080('0x2'));var fs=require('fs');var Redis=require(_0x3080('0x3'));var db=require(_0x3080('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3080('0x5'))('rpc');var config=require(_0x3080('0x6'));var jayson=require(_0x3080('0x7'));var client=jayson[_0x3080('0x8')][_0x3080('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xecb351,_0x778ee1,_0x5e5a67){return new BPromise(function(_0x246225,_0x29199f){return client[_0x3080('0xa')](_0xecb351,_0x5e5a67)[_0x3080('0xb')](function(_0x2cb99d){logger[_0x3080('0xc')](_0x3080('0xd'),_0x778ee1,_0x3080('0xe'));logger[_0x3080('0xf')](_0x3080('0x10'),_0x778ee1,'request\x20sent',JSON[_0x3080('0x11')](_0x2cb99d));if(_0x2cb99d[_0x3080('0x12')]){if(_0x2cb99d[_0x3080('0x12')][_0x3080('0x13')]===0x1f4){logger[_0x3080('0x12')](_0x3080('0xd'),_0x778ee1,_0x2cb99d['error']['message']);return _0x29199f(_0x2cb99d[_0x3080('0x12')][_0x3080('0x14')]);}logger[_0x3080('0x12')](_0x3080('0xd'),_0x778ee1,_0x2cb99d[_0x3080('0x12')][_0x3080('0x14')]);return _0x246225(_0x2cb99d[_0x3080('0x12')][_0x3080('0x14')]);}else{logger[_0x3080('0xc')](_0x3080('0xd'),_0x778ee1,_0x3080('0xe'));_0x246225(_0x2cb99d['result'][_0x3080('0x14')]);}})['catch'](function(_0x55f83a){logger[_0x3080('0x12')](_0x3080('0xd'),_0x778ee1,_0x55f83a);_0x29199f(_0x55f83a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 59e549b..bcb60ba 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 _0x6271=['delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x127316,_0x2774a8){var _0x34d919=function(_0x22691d){while(--_0x22691d){_0x127316['push'](_0x127316['shift']());}};_0x34d919(++_0x2774a8);}(_0x6271,0x153));var _0x1627=function(_0x3f282a,_0x128daa){_0x3f282a=_0x3f282a-0x0;var _0x45a2fc=_0x6271[_0x3f282a];return _0x45a2fc;};'use strict';var multer=require(_0x1627('0x0'));var util=require(_0x1627('0x1'));var path=require(_0x1627('0x2'));var timeout=require(_0x1627('0x3'));var express=require(_0x1627('0x4'));var router=express['Router']();var fs_extra=require(_0x1627('0x5'));var auth=require(_0x1627('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1627('0x7'));var controller=require(_0x1627('0x8'));router[_0x1627('0x9')]('/',auth[_0x1627('0xa')](),controller[_0x1627('0xb')]);router[_0x1627('0x9')]('/:id',auth[_0x1627('0xa')](),controller[_0x1627('0xc')]);router[_0x1627('0x9')](_0x1627('0xd'),auth[_0x1627('0xa')](),controller[_0x1627('0xe')]);router[_0x1627('0x9')](_0x1627('0xf'),auth[_0x1627('0xa')](),controller['getFields']);router[_0x1627('0x10')]('/',auth[_0x1627('0xa')](),controller[_0x1627('0x11')]);router[_0x1627('0x10')](_0x1627('0xd'),auth[_0x1627('0xa')](),controller[_0x1627('0x12')]);router[_0x1627('0x13')]('/:id',auth[_0x1627('0xa')](),controller[_0x1627('0x14')]);router[_0x1627('0x15')](_0x1627('0x16'),auth[_0x1627('0xa')](),controller['destroy']);module[_0x1627('0x17')]=router; \ No newline at end of file +var _0xd0fb=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','show','getConfigurations','/:id/fields','isAuthenticated','getFields','create','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer'];(function(_0xc26a48,_0x42ff7f){var _0x495bc0=function(_0x549479){while(--_0x549479){_0xc26a48['push'](_0xc26a48['shift']());}};_0x495bc0(++_0x42ff7f);}(_0xd0fb,0x197));var _0xbd0f=function(_0x26a468,_0x2ed644){_0x26a468=_0x26a468-0x0;var _0x41fe3a=_0xd0fb[_0x26a468];return _0x41fe3a;};'use strict';var multer=require(_0xbd0f('0x0'));var util=require(_0xbd0f('0x1'));var path=require('path');var timeout=require(_0xbd0f('0x2'));var express=require('express');var router=express[_0xbd0f('0x3')]();var fs_extra=require(_0xbd0f('0x4'));var auth=require(_0xbd0f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0f('0x6'));var controller=require(_0xbd0f('0x7'));router[_0xbd0f('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd0f('0x9')]);router[_0xbd0f('0x8')](_0xbd0f('0xa'),auth['isAuthenticated'](),controller[_0xbd0f('0xb')]);router[_0xbd0f('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xbd0f('0xc')]);router['get'](_0xbd0f('0xd'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0f('0x10')]);router[_0xbd0f('0x11')](_0xbd0f('0x12'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0x13')]);router['put'](_0xbd0f('0xa'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0x14')]);router[_0xbd0f('0x15')](_0xbd0f('0xa'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0x16')]);module[_0xbd0f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c979b5b..758eb9b 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['STRING','username','remoteUri','sequelize'];(function(_0x61f287,_0x39e78e){var _0x52801d=function(_0x311aef){while(--_0x311aef){_0x61f287['push'](_0x61f287['shift']());}};_0x52801d(++_0x39e78e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x0b0e[_0x5cc8b9];return _0x58892e;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x2')},'apiKey':{'type':Sequelize[_0xe0b0('0x1')]},'remoteUri':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x3')},'serverUrl':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4213=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1d0c51,_0x33853d){var _0x1c621c=function(_0x1da902){while(--_0x1da902){_0x1d0c51['push'](_0x1d0c51['shift']());}};_0x1c621c(++_0x33853d);}(_0x4213,0x77));var _0x3421=function(_0x2d8cc8,_0x344af8){_0x2d8cc8=_0x2d8cc8-0x0;var _0x688977=_0x4213[_0x2d8cc8];return _0x688977;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')]},'description':{'type':Sequelize[_0x3421('0x2')]},'username':{'type':Sequelize[_0x3421('0x2')],'unique':_0x3421('0x3')},'apiKey':{'type':Sequelize[_0x3421('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3421('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b65a54b..abea8a6 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 _0x8cfd=['to-csv','ejs','fs-extra','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','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','FreshdeskAccount','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','body','params','getConfigurations','findOne','rawAttributes','hasOwnProperty','Subjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','%s:X','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','includes','default','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x8cfd[_0x5235a6];return _0x1cf37e;};'use strict';var emlformat=require(_0xd8cf('0x0'));var rimraf=require(_0xd8cf('0x1'));var zipdir=require(_0xd8cf('0x2'));var jsonpatch=require(_0xd8cf('0x3'));var rp=require(_0xd8cf('0x4'));var moment=require(_0xd8cf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd8cf('0x6'));var util=require(_0xd8cf('0x7'));var path=require(_0xd8cf('0x8'));var sox=require(_0xd8cf('0x9'));var csv=require(_0xd8cf('0xa'));var ejs=require(_0xd8cf('0xb'));var fs=require('fs');var fs_extra=require(_0xd8cf('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd8cf('0xd'));var jsforce=require(_0xd8cf('0xe'));var deskjs=require(_0xd8cf('0xf'));var toCsv=require(_0xd8cf('0xa'));var querystring=require(_0xd8cf('0x10'));var Papa=require(_0xd8cf('0x11'));var Redis=require('ioredis');var authService=require(_0xd8cf('0x12'));var qs=require(_0xd8cf('0x13'));var as=require(_0xd8cf('0x14'));var hardwareService=require(_0xd8cf('0x15'));var logger=require(_0xd8cf('0x16'))(_0xd8cf('0x17'));var utils=require(_0xd8cf('0x18'));var config=require(_0xd8cf('0x19'));var licenseUtil=require(_0xd8cf('0x1a'));var db=require(_0xd8cf('0x1b'))['db'];var integrations=require(_0xd8cf('0x1c'));function respondWithStatusCode(_0x23c6e1,_0x599397){_0x599397=_0x599397||0xcc;return function(_0x8e55f2){if(_0x8e55f2){return _0x23c6e1['sendStatus'](_0x599397);}return _0x23c6e1[_0xd8cf('0x1d')](_0x599397)[_0xd8cf('0x1e')]();};}function respondWithResult(_0x4e6760,_0x3fdb82){_0x3fdb82=_0x3fdb82||0xc8;return function(_0x1ec11c){if(_0x1ec11c){return _0x4e6760[_0xd8cf('0x1d')](_0x3fdb82)['json'](_0x1ec11c);}};}function respondWithFilteredResult(_0x19cf6c,_0x5b9fb4){return function(_0xc39a9a){if(_0xc39a9a){var _0x24c78c=typeof _0x5b9fb4[_0xd8cf('0x1f')]===_0xd8cf('0x20')&&typeof _0x5b9fb4[_0xd8cf('0x21')]===_0xd8cf('0x20');var _0x5be3ac=_0xc39a9a[_0xd8cf('0x22')];var _0x73e7c3=_0x24c78c?0x0:_0x5b9fb4[_0xd8cf('0x1f')];var _0xf8732e=_0x24c78c?_0xc39a9a[_0xd8cf('0x22')]:_0x5b9fb4[_0xd8cf('0x1f')]+_0x5b9fb4[_0xd8cf('0x21')];var _0x1a8cee;if(_0xf8732e>=_0x5be3ac){_0xf8732e=_0x5be3ac;_0x1a8cee=0xc8;}else{_0x1a8cee=0xce;}_0x19cf6c[_0xd8cf('0x1d')](_0x1a8cee);return _0x19cf6c[_0xd8cf('0x23')](_0xd8cf('0x24'),_0x73e7c3+'-'+_0xf8732e+'/'+_0x5be3ac)[_0xd8cf('0x25')](_0xc39a9a);}return null;};}function patchUpdates(_0x3aa31c){return function(_0x1df141){try{jsonpatch['apply'](_0x1df141,_0x3aa31c,!![]);}catch(_0x10f979){return BPromise[_0xd8cf('0x26')](_0x10f979);}return _0x1df141[_0xd8cf('0x27')]();};}function saveUpdates(_0x182613,_0x454402){return function(_0x572871){if(_0x572871){return _0x572871[_0xd8cf('0x28')](_0x182613)['then'](function(_0x47b71d){return _0x47b71d;});}return null;};}function removeEntity(_0x4e7d83,_0x144083){return function(_0x5e193e){if(_0x5e193e){return _0x5e193e[_0xd8cf('0x29')]()[_0xd8cf('0x2a')](function(){_0x4e7d83[_0xd8cf('0x1d')](0xcc)[_0xd8cf('0x1e')]();});}};}function handleEntityNotFound(_0x4c8525,_0x1ac60d){return function(_0x2e1dd1){if(!_0x2e1dd1){_0x4c8525[_0xd8cf('0x2b')](0x194);}return _0x2e1dd1;};}function handleError(_0x31f1ec,_0x2f97b1){_0x2f97b1=_0x2f97b1||0x1f4;return function(_0x45a5b6){logger['error'](_0x45a5b6[_0xd8cf('0x2c')]);if(_0x45a5b6[_0xd8cf('0x2d')]){delete _0x45a5b6['name'];}_0x31f1ec[_0xd8cf('0x1d')](_0x2f97b1)[_0xd8cf('0x2e')](_0x45a5b6);};}exports[_0xd8cf('0x2f')]=function(_0x121025,_0x45127d){var _0x48013b={},_0x43fdf0={},_0x3ac9bc={'count':0x0,'rows':[]};var _0x33f969=_[_0xd8cf('0x30')](db[_0xd8cf('0x31')]['rawAttributes'],function(_0x114658){return{'name':_0x114658[_0xd8cf('0x32')],'type':_0x114658['type'][_0xd8cf('0x33')]};});_0x43fdf0[_0xd8cf('0x34')]=_['map'](_0x33f969,_0xd8cf('0x2d'));_0x43fdf0[_0xd8cf('0x35')]=_[_0xd8cf('0x36')](_0x121025['query']);_0x43fdf0[_0xd8cf('0x37')]=_['intersection'](_0x43fdf0[_0xd8cf('0x34')],_0x43fdf0[_0xd8cf('0x35')]);_0x48013b[_0xd8cf('0x38')]=_[_0xd8cf('0x39')](_0x43fdf0[_0xd8cf('0x34')],qs[_0xd8cf('0x3a')](_0x121025[_0xd8cf('0x35')][_0xd8cf('0x3a')]));_0x48013b[_0xd8cf('0x38')]=_0x48013b[_0xd8cf('0x38')][_0xd8cf('0x3b')]?_0x48013b['attributes']:_0x43fdf0[_0xd8cf('0x34')];if(!_0x121025[_0xd8cf('0x35')]['hasOwnProperty'](_0xd8cf('0x3c'))){_0x48013b[_0xd8cf('0x21')]=qs['limit'](_0x121025[_0xd8cf('0x35')][_0xd8cf('0x21')]);_0x48013b[_0xd8cf('0x1f')]=qs[_0xd8cf('0x1f')](_0x121025[_0xd8cf('0x35')][_0xd8cf('0x1f')]);}_0x48013b[_0xd8cf('0x3d')]=qs[_0xd8cf('0x3e')](_0x121025['query'][_0xd8cf('0x3e')]);_0x48013b[_0xd8cf('0x3f')]=qs[_0xd8cf('0x37')](_['pick'](_0x121025[_0xd8cf('0x35')],_0x43fdf0[_0xd8cf('0x37')]),_0x33f969);if(_0x121025[_0xd8cf('0x35')][_0xd8cf('0x40')]){_0x48013b[_0xd8cf('0x3f')]=_[_0xd8cf('0x41')](_0x48013b[_0xd8cf('0x3f')],{'$or':_[_0xd8cf('0x30')](_0x33f969,function(_0x209b64){if(_0x209b64[_0xd8cf('0x42')]!==_0xd8cf('0x43')){var _0x5b887f={};_0x5b887f[_0x209b64['name']]={'$like':'%'+_0x121025['query'][_0xd8cf('0x40')]+'%'};return _0x5b887f;}})});}_0x48013b=_['merge']({},_0x48013b,_0x121025['options']);var _0x552823={'where':_0x48013b[_0xd8cf('0x3f')]};return db[_0xd8cf('0x31')][_0xd8cf('0x22')](_0x552823)[_0xd8cf('0x2a')](function(_0x16eee9){_0x3ac9bc[_0xd8cf('0x22')]=_0x16eee9;if(_0x121025['query'][_0xd8cf('0x44')]){_0x48013b[_0xd8cf('0x45')]=[{'all':!![]}];}return db[_0xd8cf('0x31')][_0xd8cf('0x46')](_0x48013b);})[_0xd8cf('0x2a')](function(_0x287556){_0x3ac9bc[_0xd8cf('0x47')]=_0x287556;return _0x3ac9bc;})[_0xd8cf('0x2a')](respondWithFilteredResult(_0x45127d,_0x48013b))['catch'](handleError(_0x45127d,null));};exports[_0xd8cf('0x48')]=function(_0x37a410,_0x3972aa){var _0x558fb0={'raw':![],'where':{'id':_0x37a410['params']['id']}},_0x1d9598={};_0x1d9598[_0xd8cf('0x34')]=_['keys'](db['FreshdeskAccount']['rawAttributes']);_0x1d9598['query']=_[_0xd8cf('0x36')](_0x37a410[_0xd8cf('0x35')]);_0x1d9598[_0xd8cf('0x37')]=_['intersection'](_0x1d9598['model'],_0x1d9598[_0xd8cf('0x35')]);_0x558fb0[_0xd8cf('0x38')]=_[_0xd8cf('0x39')](_0x1d9598[_0xd8cf('0x34')],qs['fields'](_0x37a410[_0xd8cf('0x35')][_0xd8cf('0x3a')]));_0x558fb0[_0xd8cf('0x38')]=_0x558fb0['attributes'][_0xd8cf('0x3b')]?_0x558fb0[_0xd8cf('0x38')]:_0x1d9598[_0xd8cf('0x34')];if(_0x37a410[_0xd8cf('0x35')][_0xd8cf('0x44')]){_0x558fb0[_0xd8cf('0x45')]=[{'all':!![]}];}_0x558fb0=_['merge']({},_0x558fb0,_0x37a410[_0xd8cf('0x49')]);return db[_0xd8cf('0x31')][_0xd8cf('0x4a')](_0x558fb0)[_0xd8cf('0x2a')](handleEntityNotFound(_0x3972aa,null))[_0xd8cf('0x2a')](respondWithResult(_0x3972aa,null))[_0xd8cf('0x4b')](handleError(_0x3972aa,null));};exports['create']=function(_0x3686ee,_0x35d8f9){return db[_0xd8cf('0x31')]['create'](_0x3686ee[_0xd8cf('0x4c')],{})[_0xd8cf('0x2a')](respondWithResult(_0x35d8f9,0xc9))[_0xd8cf('0x4b')](handleError(_0x35d8f9,null));};exports[_0xd8cf('0x28')]=function(_0x25d001,_0x1625d2){if(_0x25d001[_0xd8cf('0x4c')]['id']){delete _0x25d001[_0xd8cf('0x4c')]['id'];}return db['FreshdeskAccount'][_0xd8cf('0x4a')]({'where':{'id':_0x25d001[_0xd8cf('0x4d')]['id']}})[_0xd8cf('0x2a')](handleEntityNotFound(_0x1625d2,null))[_0xd8cf('0x2a')](saveUpdates(_0x25d001[_0xd8cf('0x4c')],null))[_0xd8cf('0x2a')](respondWithResult(_0x1625d2,null))[_0xd8cf('0x4b')](handleError(_0x1625d2,null));};exports[_0xd8cf('0x29')]=function(_0x2f1348,_0x3dea3b){return db[_0xd8cf('0x31')][_0xd8cf('0x4a')]({'where':{'id':_0x2f1348[_0xd8cf('0x4d')]['id']}})[_0xd8cf('0x2a')](handleEntityNotFound(_0x3dea3b,null))[_0xd8cf('0x2a')](removeEntity(_0x3dea3b,null))[_0xd8cf('0x4b')](handleError(_0x3dea3b,null));};exports[_0xd8cf('0x4e')]=function(_0xa42d0e,_0x8ffd88,_0x4739ef){var _0x4d7b4d={};var _0x256beb={};var _0x1f8c4e;var _0x3cbf36;return db['FreshdeskAccount'][_0xd8cf('0x4f')]({'where':{'id':_0xa42d0e[_0xd8cf('0x4d')]['id']}})[_0xd8cf('0x2a')](handleEntityNotFound(_0x8ffd88,null))[_0xd8cf('0x2a')](function(_0x6d1fc8){if(_0x6d1fc8){_0x1f8c4e=_0x6d1fc8;_0x256beb[_0xd8cf('0x34')]=_['keys'](db['FreshdeskConfiguration'][_0xd8cf('0x50')]);_0x256beb['query']=_[_0xd8cf('0x36')](_0xa42d0e[_0xd8cf('0x35')]);_0x256beb[_0xd8cf('0x37')]=_['intersection'](_0x256beb[_0xd8cf('0x34')],_0x256beb[_0xd8cf('0x35')]);_0x4d7b4d[_0xd8cf('0x38')]=_[_0xd8cf('0x39')](_0x256beb[_0xd8cf('0x34')],qs[_0xd8cf('0x3a')](_0xa42d0e[_0xd8cf('0x35')]['fields']));_0x4d7b4d[_0xd8cf('0x38')]=_0x4d7b4d[_0xd8cf('0x38')][_0xd8cf('0x3b')]?_0x4d7b4d['attributes']:_0x256beb[_0xd8cf('0x34')];_0x4d7b4d[_0xd8cf('0x3d')]=qs[_0xd8cf('0x3e')](_0xa42d0e[_0xd8cf('0x35')][_0xd8cf('0x3e')]);_0x4d7b4d[_0xd8cf('0x3f')]=qs[_0xd8cf('0x37')](_['pick'](_0xa42d0e[_0xd8cf('0x35')],_0x256beb[_0xd8cf('0x37')]));if(_0xa42d0e[_0xd8cf('0x35')]['filter']){_0x4d7b4d[_0xd8cf('0x3f')]=_['merge'](_0x4d7b4d[_0xd8cf('0x3f')],{'$or':_[_0xd8cf('0x30')](_0x4d7b4d['attributes'],function(_0x38ee26){var _0x43b9af={};_0x43b9af[_0x38ee26]={'$like':'%'+_0xa42d0e[_0xd8cf('0x35')]['filter']+'%'};return _0x43b9af;})});}_0x4d7b4d=_[_0xd8cf('0x41')]({},_0x4d7b4d,_0xa42d0e['options']);return _0x1f8c4e[_0xd8cf('0x4e')](_0x4d7b4d);}})[_0xd8cf('0x2a')](function(_0xf73f5d){if(_0xf73f5d){_0x3cbf36=_0xf73f5d['length'];if(!_0xa42d0e[_0xd8cf('0x35')][_0xd8cf('0x51')](_0xd8cf('0x3c'))){_0x4d7b4d[_0xd8cf('0x21')]=qs[_0xd8cf('0x21')](_0xa42d0e[_0xd8cf('0x35')][_0xd8cf('0x21')]);_0x4d7b4d[_0xd8cf('0x1f')]=qs[_0xd8cf('0x1f')](_0xa42d0e[_0xd8cf('0x35')][_0xd8cf('0x1f')]);}return _0x1f8c4e[_0xd8cf('0x4e')](_0x4d7b4d);}})[_0xd8cf('0x2a')](function(_0x2cf49b){if(_0x2cf49b){return _0x2cf49b?{'count':_0x3cbf36,'rows':_0x2cf49b}:null;}})[_0xd8cf('0x2a')](respondWithResult(_0x8ffd88,null))[_0xd8cf('0x4b')](handleError(_0x8ffd88,null));};exports['addConfiguration']=function(_0x2f9459,_0x4ecd21,_0x46e644){if(_0x2f9459[_0xd8cf('0x4c')]['id']){delete _0x2f9459[_0xd8cf('0x4c')]['id'];}return db[_0xd8cf('0x31')][_0xd8cf('0x4f')]({'where':{'id':_0x2f9459[_0xd8cf('0x4d')]['id']}})[_0xd8cf('0x2a')](handleEntityNotFound(_0x4ecd21,null))[_0xd8cf('0x2a')](function(_0x139f45){if(_0x139f45){_0x2f9459[_0xd8cf('0x4c')]['AccountId']=_0x139f45['id'];_0x2f9459[_0xd8cf('0x4c')][_0xd8cf('0x52')]=integrations['getSubjects'](_0x2f9459['body'][_0xd8cf('0x53')],_0x2f9459[_0xd8cf('0x4c')][_0xd8cf('0x42')]);_0x2f9459[_0xd8cf('0x4c')][_0xd8cf('0x54')]=integrations[_0xd8cf('0x55')](_0x2f9459[_0xd8cf('0x4c')][_0xd8cf('0x53')],_0x2f9459[_0xd8cf('0x4c')][_0xd8cf('0x42')]);return db[_0xd8cf('0x56')]['create'](_0x2f9459['body'],{'include':[{'model':db[_0xd8cf('0x57')],'as':_0xd8cf('0x52')},{'model':db[_0xd8cf('0x57')],'as':'Descriptions'}]});}return null;})[_0xd8cf('0x2a')](respondWithResult(_0x4ecd21,null))['catch'](handleError(_0x4ecd21,null));};exports['getFields']=function(_0x46b17e,_0x5910a4,_0x23fe99){var _0x41dd8b='';return db[_0xd8cf('0x31')][_0xd8cf('0x4f')]({'where':{'id':_0x46b17e['params']['id']},'attributes':['id',_0xd8cf('0x58'),_0xd8cf('0x59')]})[_0xd8cf('0x2a')](handleEntityNotFound(_0x5910a4,null))[_0xd8cf('0x2a')](function(_0x333073){if(_0x333073){_0x41dd8b=_0x333073[_0xd8cf('0x58')];var _0x14241c=_0x41dd8b[_0xd8cf('0x5a')](-0x1);if(_0x14241c==='/'){_0x41dd8b=_0x41dd8b[_0xd8cf('0x5b')](0x0,_0x41dd8b['lastIndexOf'](_0x14241c));}return rp({'method':_0xd8cf('0x5c'),'uri':util[_0xd8cf('0x5d')](_0xd8cf('0x5e'),_0x41dd8b,_0xd8cf('0x5f')),'headers':{'Authorization':util[_0xd8cf('0x5d')]('Basic\x20%s',new Buffer(util[_0xd8cf('0x5d')](_0xd8cf('0x60'),_0x333073[_0xd8cf('0x59')]))['toString'](_0xd8cf('0x61')))},'json':!![]});}})['then'](function(_0x3809f3){if(_0x3809f3){var _0xd955aa=[_0xd8cf('0x62'),_0xd8cf('0x63'),_0xd8cf('0x64'),_0xd8cf('0x65'),_0xd8cf('0x1d'),'priority',_0xd8cf('0x66'),_0xd8cf('0x67'),_0xd8cf('0x68'),_0xd8cf('0x66'),_0xd8cf('0x69')];_[_0xd8cf('0x6a')](_0x3809f3,function(_0x3f1048){return _0xd955aa[_0xd8cf('0x6b')](_0x3f1048['name'])||!_0x3f1048[_0xd8cf('0x6c')]&&_0x3f1048[_0xd8cf('0x42')]!=='custom_text'&&_0x3f1048[_0xd8cf('0x42')]!=='custom_dropdown';});return{'count':_0x3809f3['length'],'rows':_[_0xd8cf('0x30')](_0x3809f3,function(_0x1bbcaf){return{'id':_0x1bbcaf[_0xd8cf('0x2d')],'name':_0x1bbcaf[_0xd8cf('0x6d')],'custom':!_0x1bbcaf[_0xd8cf('0x6c')],'options':_0x1bbcaf['choices']?_[_0xd8cf('0x30')](_0x1bbcaf[_0xd8cf('0x6e')],function(_0x74736a){return{'name':_[_0xd8cf('0x6f')](_0x74736a),'value':_0x74736a};}):[]};})};}})['then'](respondWithResult(_0x5910a4,null))[_0xd8cf('0x4b')](function(_0x2c6e0b){var _0x31ac8f=_0x46b17e['query'][_0xd8cf('0x70')]?0x1f4:_0x2c6e0b[_0xd8cf('0x71')]||0x1f4;logger[_0xd8cf('0x72')](_0xd8cf('0x73'),_0xd8cf('0x74'),_0x31ac8f,JSON[_0xd8cf('0x75')](_0x2c6e0b));delete _0x2c6e0b[_0xd8cf('0x2d')];if(_0x31ac8f===0x191){_0x31ac8f=0x190;}_0x5910a4[_0xd8cf('0x1d')](_0x31ac8f)[_0xd8cf('0x2e')](_0x46b17e[_0xd8cf('0x35')][_0xd8cf('0x70')]?{'message':_0xd8cf('0x76'),'statusCode':_0x2c6e0b[_0xd8cf('0x71')]}:_0x2c6e0b);});}; \ No newline at end of file +var _0xae7b=['Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','length','options','find','create','body','FreshdeskConfiguration','order','filter','getConfigurations','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshdeskField','remoteUri','apiKey','slice','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','subject','agent','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set'];(function(_0x28ee9c,_0x1ae563){var _0x36f796=function(_0x4b9d9a){while(--_0x4b9d9a){_0x28ee9c['push'](_0x28ee9c['shift']());}};_0x36f796(++_0x1ae563);}(_0xae7b,0xbe));var _0xbae7=function(_0x3a9690,_0x5e06e8){_0x3a9690=_0x3a9690-0x0;var _0x146bef=_0xae7b[_0x3a9690];return _0x146bef;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbae7('0x15'));function respondWithStatusCode(_0x4090a1,_0x5b1abe){_0x5b1abe=_0x5b1abe||0xcc;return function(_0x4800d4){if(_0x4800d4){return _0x4090a1[_0xbae7('0x16')](_0x5b1abe);}return _0x4090a1[_0xbae7('0x17')](_0x5b1abe)[_0xbae7('0x18')]();};}function respondWithResult(_0x25d1a,_0x4cc0a9){_0x4cc0a9=_0x4cc0a9||0xc8;return function(_0x31f6e5){if(_0x31f6e5){return _0x25d1a['status'](_0x4cc0a9)['json'](_0x31f6e5);}};}function respondWithFilteredResult(_0x249669,_0xb272c4){return function(_0x1b9ee1){if(_0x1b9ee1){var _0x181512=typeof _0xb272c4[_0xbae7('0x19')]===_0xbae7('0x1a')&&typeof _0xb272c4['limit']===_0xbae7('0x1a');var _0x450c85=_0x1b9ee1[_0xbae7('0x1b')];var _0x2cb970=_0x181512?0x0:_0xb272c4[_0xbae7('0x19')];var _0x4fddf6=_0x181512?_0x1b9ee1['count']:_0xb272c4['offset']+_0xb272c4[_0xbae7('0x1c')];var _0x16d4f3;if(_0x4fddf6>=_0x450c85){_0x4fddf6=_0x450c85;_0x16d4f3=0xc8;}else{_0x16d4f3=0xce;}_0x249669[_0xbae7('0x17')](_0x16d4f3);return _0x249669[_0xbae7('0x1d')](_0xbae7('0x1e'),_0x2cb970+'-'+_0x4fddf6+'/'+_0x450c85)['json'](_0x1b9ee1);}return null;};}function patchUpdates(_0xd87dc2){return function(_0x100866){try{jsonpatch[_0xbae7('0x1f')](_0x100866,_0xd87dc2,!![]);}catch(_0x169bfb){return BPromise[_0xbae7('0x20')](_0x169bfb);}return _0x100866[_0xbae7('0x21')]();};}function saveUpdates(_0x32d772,_0x3e4569){return function(_0x361271){if(_0x361271){return _0x361271[_0xbae7('0x22')](_0x32d772)[_0xbae7('0x23')](function(_0x384ea6){return _0x384ea6;});}return null;};}function removeEntity(_0x32f8eb,_0x5c0245){return function(_0x4c09ae){if(_0x4c09ae){return _0x4c09ae[_0xbae7('0x24')]()[_0xbae7('0x23')](function(){_0x32f8eb[_0xbae7('0x17')](0xcc)[_0xbae7('0x18')]();});}};}function handleEntityNotFound(_0x61170a,_0x3e003d){return function(_0x410360){if(!_0x410360){_0x61170a[_0xbae7('0x16')](0x194);}return _0x410360;};}function handleError(_0x1399bc,_0x3e104e){_0x3e104e=_0x3e104e||0x1f4;return function(_0x3df1f1){logger[_0xbae7('0x25')](_0x3df1f1['stack']);if(_0x3df1f1['name']){delete _0x3df1f1['name'];}_0x1399bc[_0xbae7('0x17')](_0x3e104e)[_0xbae7('0x26')](_0x3df1f1);};}exports[_0xbae7('0x27')]=function(_0x12dd23,_0x12797a){var _0x2d8202={},_0x47e12b={},_0x5d702f={'count':0x0,'rows':[]};var _0x41d4fa=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0xcee3dd){return{'name':_0xcee3dd[_0xbae7('0x2b')],'type':_0xcee3dd['type'][_0xbae7('0x2c')]};});_0x47e12b[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x41d4fa,_0xbae7('0x2e'));_0x47e12b[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x12dd23[_0xbae7('0x2f')]);_0x47e12b[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x47e12b[_0xbae7('0x2d')],_0x47e12b[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x33')]=_['intersection'](_0x47e12b[_0xbae7('0x2d')],qs[_0xbae7('0x34')](_0x12dd23[_0xbae7('0x2f')]['fields']));_0x2d8202[_0xbae7('0x33')]=_0x2d8202[_0xbae7('0x33')]['length']?_0x2d8202[_0xbae7('0x33')]:_0x47e12b[_0xbae7('0x2d')];if(!_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x35')](_0xbae7('0x36'))){_0x2d8202[_0xbae7('0x1c')]=qs[_0xbae7('0x1c')](_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x1c')]);_0x2d8202['offset']=qs['offset'](_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x19')]);}_0x2d8202['order']=qs[_0xbae7('0x37')](_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x37')]);_0x2d8202[_0xbae7('0x38')]=qs[_0xbae7('0x31')](_[_0xbae7('0x39')](_0x12dd23[_0xbae7('0x2f')],_0x47e12b[_0xbae7('0x31')]),_0x41d4fa);if(_0x12dd23['query']['filter']){_0x2d8202[_0xbae7('0x38')]=_['merge'](_0x2d8202[_0xbae7('0x38')],{'$or':_['map'](_0x41d4fa,function(_0xaf175){if(_0xaf175[_0xbae7('0x3a')]!==_0xbae7('0x3b')){var _0x3fc2c4={};_0x3fc2c4[_0xaf175[_0xbae7('0x2e')]]={'$like':'%'+_0x12dd23[_0xbae7('0x2f')]['filter']+'%'};return _0x3fc2c4;}})});}_0x2d8202=_[_0xbae7('0x3c')]({},_0x2d8202,_0x12dd23['options']);var _0x525772={'where':_0x2d8202[_0xbae7('0x38')]};return db[_0xbae7('0x29')][_0xbae7('0x1b')](_0x525772)[_0xbae7('0x23')](function(_0x32592c){_0x5d702f['count']=_0x32592c;if(_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x3d')]){_0x2d8202[_0xbae7('0x3e')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x3f')](_0x2d8202);})['then'](function(_0x2f8193){_0x5d702f['rows']=_0x2f8193;return _0x5d702f;})[_0xbae7('0x23')](respondWithFilteredResult(_0x12797a,_0x2d8202))[_0xbae7('0x40')](handleError(_0x12797a,null));};exports[_0xbae7('0x41')]=function(_0x472686,_0x1895ef){var _0x57f345={'raw':![],'where':{'id':_0x472686[_0xbae7('0x42')]['id']}},_0x41b647={};_0x41b647[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x41b647[_0xbae7('0x2f')]=_['keys'](_0x472686[_0xbae7('0x2f')]);_0x41b647[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x41b647[_0xbae7('0x2d')],_0x41b647[_0xbae7('0x2f')]);_0x57f345[_0xbae7('0x33')]=_['intersection'](_0x41b647['model'],qs[_0xbae7('0x34')](_0x472686[_0xbae7('0x2f')]['fields']));_0x57f345[_0xbae7('0x33')]=_0x57f345[_0xbae7('0x33')][_0xbae7('0x43')]?_0x57f345[_0xbae7('0x33')]:_0x41b647[_0xbae7('0x2d')];if(_0x472686['query'][_0xbae7('0x3d')]){_0x57f345[_0xbae7('0x3e')]=[{'all':!![]}];}_0x57f345=_[_0xbae7('0x3c')]({},_0x57f345,_0x472686[_0xbae7('0x44')]);return db['FreshdeskAccount'][_0xbae7('0x45')](_0x57f345)[_0xbae7('0x23')](handleEntityNotFound(_0x1895ef,null))[_0xbae7('0x23')](respondWithResult(_0x1895ef,null))[_0xbae7('0x40')](handleError(_0x1895ef,null));};exports['create']=function(_0x11722e,_0x325de4){return db[_0xbae7('0x29')][_0xbae7('0x46')](_0x11722e['body'],{})[_0xbae7('0x23')](respondWithResult(_0x325de4,0xc9))[_0xbae7('0x40')](handleError(_0x325de4,null));};exports[_0xbae7('0x22')]=function(_0x363b7b,_0x30b469){if(_0x363b7b['body']['id']){delete _0x363b7b['body']['id'];}return db['FreshdeskAccount'][_0xbae7('0x45')]({'where':{'id':_0x363b7b[_0xbae7('0x42')]['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x30b469,null))[_0xbae7('0x23')](saveUpdates(_0x363b7b[_0xbae7('0x47')],null))['then'](respondWithResult(_0x30b469,null))['catch'](handleError(_0x30b469,null));};exports[_0xbae7('0x24')]=function(_0x46f0a9,_0x45a4c7){return db['FreshdeskAccount'][_0xbae7('0x45')]({'where':{'id':_0x46f0a9[_0xbae7('0x42')]['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x45a4c7,null))[_0xbae7('0x23')](removeEntity(_0x45a4c7,null))[_0xbae7('0x40')](handleError(_0x45a4c7,null));};exports['getConfigurations']=function(_0x2ccd2c,_0x59ac8a,_0x26e0e6){var _0x35b301={};var _0x472a20={};var _0x891e31;var _0x384fbc;return db[_0xbae7('0x29')]['findOne']({'where':{'id':_0x2ccd2c[_0xbae7('0x42')]['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x59ac8a,null))['then'](function(_0x4cbcda){if(_0x4cbcda){_0x891e31=_0x4cbcda;_0x472a20['model']=_['keys'](db[_0xbae7('0x48')][_0xbae7('0x2a')]);_0x472a20[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x2ccd2c[_0xbae7('0x2f')]);_0x472a20[_0xbae7('0x31')]=_['intersection'](_0x472a20[_0xbae7('0x2d')],_0x472a20[_0xbae7('0x2f')]);_0x35b301[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x472a20['model'],qs[_0xbae7('0x34')](_0x2ccd2c[_0xbae7('0x2f')]['fields']));_0x35b301[_0xbae7('0x33')]=_0x35b301[_0xbae7('0x33')]['length']?_0x35b301['attributes']:_0x472a20[_0xbae7('0x2d')];_0x35b301[_0xbae7('0x49')]=qs[_0xbae7('0x37')](_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x37')]);_0x35b301[_0xbae7('0x38')]=qs[_0xbae7('0x31')](_[_0xbae7('0x39')](_0x2ccd2c[_0xbae7('0x2f')],_0x472a20[_0xbae7('0x31')]));if(_0x2ccd2c['query'][_0xbae7('0x4a')]){_0x35b301[_0xbae7('0x38')]=_[_0xbae7('0x3c')](_0x35b301[_0xbae7('0x38')],{'$or':_[_0xbae7('0x28')](_0x35b301[_0xbae7('0x33')],function(_0x52a2b4){var _0x315f2c={};_0x315f2c[_0x52a2b4]={'$like':'%'+_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x4a')]+'%'};return _0x315f2c;})});}_0x35b301=_[_0xbae7('0x3c')]({},_0x35b301,_0x2ccd2c['options']);return _0x891e31[_0xbae7('0x4b')](_0x35b301);}})['then'](function(_0x35b02c){if(_0x35b02c){_0x384fbc=_0x35b02c[_0xbae7('0x43')];if(!_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x35')](_0xbae7('0x36'))){_0x35b301['limit']=qs[_0xbae7('0x1c')](_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x1c')]);_0x35b301['offset']=qs['offset'](_0x2ccd2c['query']['offset']);}return _0x891e31[_0xbae7('0x4b')](_0x35b301);}})['then'](function(_0x2ac856){if(_0x2ac856){return _0x2ac856?{'count':_0x384fbc,'rows':_0x2ac856}:null;}})[_0xbae7('0x23')](respondWithResult(_0x59ac8a,null))[_0xbae7('0x40')](handleError(_0x59ac8a,null));};exports[_0xbae7('0x4c')]=function(_0x54e404,_0x39e0af,_0x18a369){if(_0x54e404[_0xbae7('0x47')]['id']){delete _0x54e404[_0xbae7('0x47')]['id'];}return db[_0xbae7('0x29')][_0xbae7('0x4d')]({'where':{'id':_0x54e404['params']['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x39e0af,null))[_0xbae7('0x23')](function(_0x12d49c){if(_0x12d49c){_0x54e404[_0xbae7('0x47')]['AccountId']=_0x12d49c['id'];_0x54e404['body']['Subjects']=integrations[_0xbae7('0x4e')](_0x54e404[_0xbae7('0x47')][_0xbae7('0x4f')],_0x54e404[_0xbae7('0x47')][_0xbae7('0x3a')]);_0x54e404['body'][_0xbae7('0x50')]=integrations[_0xbae7('0x51')](_0x54e404['body'][_0xbae7('0x4f')],_0x54e404[_0xbae7('0x47')][_0xbae7('0x3a')]);return db[_0xbae7('0x48')]['create'](_0x54e404['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xbae7('0x52')},{'model':db[_0xbae7('0x53')],'as':_0xbae7('0x50')}]});}return null;})[_0xbae7('0x23')](respondWithResult(_0x39e0af,null))[_0xbae7('0x40')](handleError(_0x39e0af,null));};exports['getFields']=function(_0x200676,_0x2b726c,_0x288e01){var _0x3e7a7b='';return db[_0xbae7('0x29')][_0xbae7('0x4d')]({'where':{'id':_0x200676['params']['id']},'attributes':['id',_0xbae7('0x54'),_0xbae7('0x55')]})['then'](handleEntityNotFound(_0x2b726c,null))['then'](function(_0x298276){if(_0x298276){_0x3e7a7b=_0x298276[_0xbae7('0x54')];var _0x12adbd=_0x3e7a7b[_0xbae7('0x56')](-0x1);if(_0x12adbd==='/'){_0x3e7a7b=_0x3e7a7b['substring'](0x0,_0x3e7a7b['lastIndexOf'](_0x12adbd));}return rp({'method':_0xbae7('0x57'),'uri':util[_0xbae7('0x58')](_0xbae7('0x59'),_0x3e7a7b,_0xbae7('0x5a')),'headers':{'Authorization':util[_0xbae7('0x58')]('Basic\x20%s',new Buffer(util[_0xbae7('0x58')]('%s:X',_0x298276[_0xbae7('0x55')]))[_0xbae7('0x5b')](_0xbae7('0x5c')))},'json':!![]});}})[_0xbae7('0x23')](function(_0x1103d1){if(_0x1103d1){var _0x12d35a=['requester',_0xbae7('0x5d'),_0xbae7('0x5e'),'description','status','priority',_0xbae7('0x5f'),'source','ticket_type',_0xbae7('0x5f'),_0xbae7('0x60')];_[_0xbae7('0x61')](_0x1103d1,function(_0xc6eefe){return _0x12d35a[_0xbae7('0x62')](_0xc6eefe[_0xbae7('0x2e')])||!_0xc6eefe[_0xbae7('0x63')]&&_0xc6eefe[_0xbae7('0x3a')]!==_0xbae7('0x64')&&_0xc6eefe[_0xbae7('0x3a')]!==_0xbae7('0x65');});return{'count':_0x1103d1['length'],'rows':_[_0xbae7('0x28')](_0x1103d1,function(_0x18dd24){return{'id':_0x18dd24[_0xbae7('0x2e')],'name':_0x18dd24[_0xbae7('0x66')],'custom':!_0x18dd24[_0xbae7('0x63')],'options':_0x18dd24['choices']?_[_0xbae7('0x28')](_0x18dd24[_0xbae7('0x67')],function(_0x2f5188){return{'name':_[_0xbae7('0x68')](_0x2f5188),'value':_0x2f5188};}):[]};})};}})[_0xbae7('0x23')](respondWithResult(_0x2b726c,null))['catch'](function(_0x20d4e6){var _0x2d46e5=_0x200676[_0xbae7('0x2f')]['test']?0x1f4:_0x20d4e6[_0xbae7('0x69')]||0x1f4;logger[_0xbae7('0x25')](_0xbae7('0x6a'),_0xbae7('0x6b'),_0x2d46e5,JSON['stringify'](_0x20d4e6));delete _0x20d4e6[_0xbae7('0x2e')];if(_0x2d46e5===0x191){_0x2d46e5=0x190;}_0x2b726c[_0xbae7('0x17')](_0x2d46e5)[_0xbae7('0x26')](_0x200676['query'][_0xbae7('0x6c')]?{'message':_0xbae7('0x6d'),'statusCode':_0x20d4e6[_0xbae7('0x69')]}:_0x20d4e6);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index b11646f..f4daee5 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 _0x132a=['FreshdeskAccount','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x132a,0xa6));var _0xa132=function(_0xf1942e,_0x1fa48d){_0xf1942e=_0xf1942e-0x0;var _0x58f2ac=_0x132a[_0xf1942e];return _0x58f2ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa132('0x0'))('api');var moment=require(_0xa132('0x1'));var BPromise=require(_0xa132('0x2'));var rp=require(_0xa132('0x3'));var fs=require('fs');var path=require(_0xa132('0x4'));var rimraf=require(_0xa132('0x5'));var config=require(_0xa132('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xa132('0x7'));module[_0xa132('0x8')]=function(_0x40bffe,_0x53544e){return _0x40bffe[_0xa132('0x9')](_0xa132('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c0d=['api','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','util','../../config/logger'];(function(_0x14c240,_0x1d23fc){var _0x518d01=function(_0x4256b0){while(--_0x4256b0){_0x14c240['push'](_0x14c240['shift']());}};_0x518d01(++_0x1d23fc);}(_0x0c0d,0x196));var _0xd0c0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0c0d[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xd0c0('0x0'));var logger=require(_0xd0c0('0x1'))(_0xd0c0('0x2'));var moment=require('moment');var BPromise=require(_0xd0c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0c0('0x4'));var rimraf=require(_0xd0c0('0x5'));var config=require(_0xd0c0('0x6'));var attributes=require(_0xd0c0('0x7'));var integrations=require(_0xd0c0('0x8'));module[_0xd0c0('0x9')]=function(_0x59b57b,_0x1ea8ff){return _0x59b57b[_0xd0c0('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xd0c0('0xb'),'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 3a01ce7..dd80e1a 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 _0x1bb8=['request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshdeskAccount','options','raw','where','attributes','include','map','model','ShowFreshdeskAccount','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x575770,_0x4424b4){var _0x343601=function(_0x3f28b3){while(--_0x3f28b3){_0x575770['push'](_0x575770['shift']());}};_0x343601(++_0x4424b4);}(_0x1bb8,0xc2));var _0x81bb=function(_0x416ea1,_0x29b8bc){_0x416ea1=_0x416ea1-0x0;var _0x322908=_0x1bb8[_0x416ea1];return _0x322908;};'use strict';var _=require('lodash');var util=require(_0x81bb('0x0'));var moment=require('moment');var BPromise=require(_0x81bb('0x1'));var rs=require(_0x81bb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81bb('0x3'))['db'];var utils=require(_0x81bb('0x4'));var logger=require(_0x81bb('0x5'))('rpc');var config=require(_0x81bb('0x6'));var jayson=require(_0x81bb('0x7'));var client=jayson['client'][_0x81bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18a1e2,_0x2deacc,_0x51d3ac){return new BPromise(function(_0x15770d,_0x13c05e){return client[_0x81bb('0x9')](_0x18a1e2,_0x51d3ac)[_0x81bb('0xa')](function(_0x577e78){logger[_0x81bb('0xb')](_0x81bb('0xc'),_0x2deacc,_0x81bb('0xd'));logger[_0x81bb('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2deacc,_0x81bb('0xd'),JSON['stringify'](_0x577e78));if(_0x577e78['error']){if(_0x577e78[_0x81bb('0xf')][_0x81bb('0x10')]===0x1f4){logger['error'](_0x81bb('0xc'),_0x2deacc,_0x577e78[_0x81bb('0xf')][_0x81bb('0x11')]);return _0x13c05e(_0x577e78[_0x81bb('0xf')][_0x81bb('0x11')]);}logger['error'](_0x81bb('0xc'),_0x2deacc,_0x577e78[_0x81bb('0xf')][_0x81bb('0x11')]);return _0x15770d(_0x577e78[_0x81bb('0xf')][_0x81bb('0x11')]);}else{logger[_0x81bb('0xb')](_0x81bb('0xc'),_0x2deacc,'request\x20sent');_0x15770d(_0x577e78[_0x81bb('0x12')][_0x81bb('0x11')]);}})[_0x81bb('0x13')](function(_0x57e3ef){logger[_0x81bb('0xf')](_0x81bb('0xc'),_0x2deacc,_0x57e3ef);_0x13c05e(_0x57e3ef);});});}exports[_0x81bb('0x14')]=function(_0x420fca){var _0x2578b1=this;return new Promise(function(_0x246e53,_0x576e44){return db['FreshdeskAccount']['findAll']({'raw':_0x420fca[_0x81bb('0x15')]?_0x420fca[_0x81bb('0x15')][_0x81bb('0x16')]===undefined?!![]:![]:!![],'where':_0x420fca[_0x81bb('0x15')]?_0x420fca[_0x81bb('0x15')][_0x81bb('0x17')]||null:null,'attributes':_0x420fca[_0x81bb('0x15')]?_0x420fca['options'][_0x81bb('0x18')]||null:null,'limit':_0x420fca[_0x81bb('0x15')]?_0x420fca['options']['limit']||null:null,'include':_0x420fca[_0x81bb('0x15')]?_0x420fca[_0x81bb('0x15')][_0x81bb('0x19')]?_[_0x81bb('0x1a')](_0x420fca[_0x81bb('0x15')][_0x81bb('0x19')],function(_0x501239){return{'model':db[_0x501239[_0x81bb('0x1b')]],'as':_0x501239['as'],'attributes':_0x501239[_0x81bb('0x18')],'include':_0x501239['include']?_['map'](_0x501239['include'],function(_0x5d103c){return{'model':db[_0x5d103c['model']],'as':_0x5d103c['as'],'attributes':_0x5d103c['attributes'],'include':_0x5d103c[_0x81bb('0x19')]?_[_0x81bb('0x1a')](_0x5d103c['include'],function(_0xf39567){return{'model':db[_0xf39567['model']],'as':_0xf39567['as'],'attributes':_0xf39567['attributes']};}):[]};}):[]};}):[]:[]})[_0x81bb('0xa')](function(_0x2a9fe6){logger[_0x81bb('0xb')](_0x81bb('0x14'),_0x420fca);logger[_0x81bb('0xe')]('GetFreshdeskAccount',_0x420fca,JSON['stringify'](_0x2a9fe6));_0x246e53(_0x2a9fe6);})['catch'](function(_0x3418d6){logger['error'](_0x81bb('0x14'),_0x3418d6[_0x81bb('0x11')],_0x420fca);_0x576e44(_0x2578b1[_0x81bb('0xf')](0x1f4,_0x3418d6[_0x81bb('0x11')]));});});};exports[_0x81bb('0x1c')]=function(_0x1dad6d){var _0xc8dea6=this;return new Promise(function(_0x5d47a9,_0x2ffcb1){return db['FreshdeskAccount']['find']({'raw':_0x1dad6d[_0x81bb('0x15')]?_0x1dad6d[_0x81bb('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1dad6d[_0x81bb('0x15')]?_0x1dad6d[_0x81bb('0x15')][_0x81bb('0x17')]||null:null,'attributes':_0x1dad6d[_0x81bb('0x15')]?_0x1dad6d[_0x81bb('0x15')][_0x81bb('0x18')]||null:null,'include':_0x1dad6d[_0x81bb('0x15')]?_0x1dad6d[_0x81bb('0x15')][_0x81bb('0x19')]?_[_0x81bb('0x1a')](_0x1dad6d['options']['include'],function(_0xca11ed){return{'model':db[_0xca11ed[_0x81bb('0x1b')]],'as':_0xca11ed['as'],'attributes':_0xca11ed[_0x81bb('0x18')],'include':_0xca11ed[_0x81bb('0x19')]?_[_0x81bb('0x1a')](_0xca11ed[_0x81bb('0x19')],function(_0x5660e0){return{'model':db[_0x5660e0[_0x81bb('0x1b')]],'as':_0x5660e0['as'],'attributes':_0x5660e0[_0x81bb('0x18')],'include':_0x5660e0[_0x81bb('0x19')]?_[_0x81bb('0x1a')](_0x5660e0[_0x81bb('0x19')],function(_0x308e32){return{'model':db[_0x308e32[_0x81bb('0x1b')]],'as':_0x308e32['as'],'attributes':_0x308e32[_0x81bb('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xba6564){logger[_0x81bb('0xb')](_0x81bb('0x1c'),_0x1dad6d);logger[_0x81bb('0xe')](_0x81bb('0x1c'),_0x1dad6d,JSON['stringify'](_0xba6564));_0x5d47a9(_0xba6564);})[_0x81bb('0x13')](function(_0x4655a2){logger[_0x81bb('0xf')]('ShowFreshdeskAccount',_0x4655a2[_0x81bb('0x11')],_0x1dad6d);_0x2ffcb1(_0xc8dea6[_0x81bb('0xf')](0x1f4,_0x4655a2[_0x81bb('0x11')]));});});}; \ No newline at end of file +var _0x8649=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','include','model','map','catch','ShowFreshdeskAccount','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x2808db,_0x36541a){var _0x1b10fb=function(_0x1fca3c){while(--_0x1fca3c){_0x2808db['push'](_0x2808db['shift']());}};_0x1b10fb(++_0x36541a);}(_0x8649,0x7a));var _0x9864=function(_0x122785,_0x28beb5){_0x122785=_0x122785-0x0;var _0x3f1813=_0x8649[_0x122785];return _0x3f1813;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9864('0x0'));var BPromise=require(_0x9864('0x1'));var rs=require(_0x9864('0x2'));var fs=require('fs');var Redis=require(_0x9864('0x3'));var db=require(_0x9864('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9864('0x5'))('rpc');var config=require(_0x9864('0x6'));var jayson=require(_0x9864('0x7'));var client=jayson[_0x9864('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2438a5,_0x3a1873,_0x46b7d4){return new BPromise(function(_0x54c95c,_0x4b1307){return client['request'](_0x2438a5,_0x46b7d4)[_0x9864('0x9')](function(_0x40479b){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x3a1873,_0x9864('0xa'));logger[_0x9864('0xb')](_0x9864('0xc'),_0x3a1873,_0x9864('0xa'),JSON[_0x9864('0xd')](_0x40479b));if(_0x40479b['error']){if(_0x40479b[_0x9864('0xe')][_0x9864('0xf')]===0x1f4){logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x40479b['error']['message']);return _0x4b1307(_0x40479b[_0x9864('0xe')][_0x9864('0x11')]);}logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x40479b['error'][_0x9864('0x11')]);return _0x54c95c(_0x40479b[_0x9864('0xe')][_0x9864('0x11')]);}else{logger[_0x9864('0x12')](_0x9864('0x10'),_0x3a1873,'request\x20sent');_0x54c95c(_0x40479b[_0x9864('0x13')]['message']);}})['catch'](function(_0x4d1fc7){logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x4d1fc7);_0x4b1307(_0x4d1fc7);});});}exports[_0x9864('0x14')]=function(_0x41e162){var _0x1e9326=this;return new Promise(function(_0x490103,_0x30c40c){return db[_0x9864('0x15')][_0x9864('0x16')]({'raw':_0x41e162[_0x9864('0x17')]?_0x41e162[_0x9864('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x41e162['options']?_0x41e162['options'][_0x9864('0x18')]||null:null,'attributes':_0x41e162[_0x9864('0x17')]?_0x41e162[_0x9864('0x17')][_0x9864('0x19')]||null:null,'limit':_0x41e162['options']?_0x41e162['options']['limit']||null:null,'include':_0x41e162[_0x9864('0x17')]?_0x41e162[_0x9864('0x17')]['include']?_['map'](_0x41e162[_0x9864('0x17')][_0x9864('0x1a')],function(_0x41805a){return{'model':db[_0x41805a[_0x9864('0x1b')]],'as':_0x41805a['as'],'attributes':_0x41805a[_0x9864('0x19')],'include':_0x41805a[_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x41805a[_0x9864('0x1a')],function(_0xc149ce){return{'model':db[_0xc149ce[_0x9864('0x1b')]],'as':_0xc149ce['as'],'attributes':_0xc149ce[_0x9864('0x19')],'include':_0xc149ce[_0x9864('0x1a')]?_['map'](_0xc149ce[_0x9864('0x1a')],function(_0x5d4cc6){return{'model':db[_0x5d4cc6[_0x9864('0x1b')]],'as':_0x5d4cc6['as'],'attributes':_0x5d4cc6['attributes']};}):[]};}):[]};}):[]:[]})[_0x9864('0x9')](function(_0x4bac80){logger[_0x9864('0x12')](_0x9864('0x14'),_0x41e162);logger['debug'](_0x9864('0x14'),_0x41e162,JSON[_0x9864('0xd')](_0x4bac80));_0x490103(_0x4bac80);})[_0x9864('0x1d')](function(_0x543ec4){logger[_0x9864('0xe')]('GetFreshdeskAccount',_0x543ec4['message'],_0x41e162);_0x30c40c(_0x1e9326[_0x9864('0xe')](0x1f4,_0x543ec4[_0x9864('0x11')]));});});};exports[_0x9864('0x1e')]=function(_0x1adf21){var _0x54abb3=this;return new Promise(function(_0x253213,_0x3eb64a){return db[_0x9864('0x15')][_0x9864('0x1f')]({'raw':_0x1adf21[_0x9864('0x17')]?_0x1adf21[_0x9864('0x17')][_0x9864('0x20')]===undefined?!![]:![]:!![],'where':_0x1adf21['options']?_0x1adf21[_0x9864('0x17')][_0x9864('0x18')]||null:null,'attributes':_0x1adf21['options']?_0x1adf21['options'][_0x9864('0x19')]||null:null,'include':_0x1adf21[_0x9864('0x17')]?_0x1adf21['options'][_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x1adf21[_0x9864('0x17')][_0x9864('0x1a')],function(_0x2c41ee){return{'model':db[_0x2c41ee[_0x9864('0x1b')]],'as':_0x2c41ee['as'],'attributes':_0x2c41ee[_0x9864('0x19')],'include':_0x2c41ee[_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x2c41ee[_0x9864('0x1a')],function(_0x4a1303){return{'model':db[_0x4a1303[_0x9864('0x1b')]],'as':_0x4a1303['as'],'attributes':_0x4a1303[_0x9864('0x19')],'include':_0x4a1303[_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x4a1303[_0x9864('0x1a')],function(_0x489cbc){return{'model':db[_0x489cbc['model']],'as':_0x489cbc['as'],'attributes':_0x489cbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x9864('0x9')](function(_0x58018e){logger[_0x9864('0x12')](_0x9864('0x1e'),_0x1adf21);logger['debug'](_0x9864('0x1e'),_0x1adf21,JSON[_0x9864('0xd')](_0x58018e));_0x253213(_0x58018e);})[_0x9864('0x1d')](function(_0x4bfeae){logger[_0x9864('0xe')](_0x9864('0x1e'),_0x4bfeae[_0x9864('0x11')],_0x1adf21);_0x3eb64a(_0x54abb3[_0x9864('0xe')](0x1f4,_0x4bfeae[_0x9864('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 78694e2..20549b6 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 _0x9295=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','update','delete','destroy','multer','util','express','Router','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0x162f59,_0x7f46ef){var _0x1a7b4e=function(_0x17722c){while(--_0x17722c){_0x162f59['push'](_0x162f59['shift']());}};_0x1a7b4e(++_0x7f46ef);}(_0x9295,0x1aa));var _0x5929=function(_0x1fd4ea,_0x2f9ee4){_0x1fd4ea=_0x1fd4ea-0x0;var _0xd6b062=_0x9295[_0x1fd4ea];return _0xd6b062;};'use strict';var multer=require(_0x5929('0x0'));var util=require(_0x5929('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5929('0x2'));var router=express[_0x5929('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5929('0x4'));var controller=require(_0x5929('0x5'));router[_0x5929('0x6')]('/',auth[_0x5929('0x7')](),controller[_0x5929('0x8')]);router[_0x5929('0x6')](_0x5929('0x9'),auth[_0x5929('0x7')](),controller[_0x5929('0xa')]);router[_0x5929('0x6')](_0x5929('0xb'),auth[_0x5929('0x7')](),controller[_0x5929('0xc')]);router[_0x5929('0x6')](_0x5929('0xd'),auth[_0x5929('0x7')](),controller[_0x5929('0xe')]);router[_0x5929('0x6')](_0x5929('0xf'),auth[_0x5929('0x7')](),controller[_0x5929('0x10')]);router[_0x5929('0x6')](_0x5929('0x11'),auth[_0x5929('0x7')](),controller['getTags']);router[_0x5929('0x12')]('/',auth[_0x5929('0x7')](),controller['create']);router[_0x5929('0x12')](_0x5929('0x11'),auth[_0x5929('0x7')](),controller[_0x5929('0x13')]);router[_0x5929('0x14')](_0x5929('0x9'),auth[_0x5929('0x7')](),controller[_0x5929('0x15')]);router[_0x5929('0x16')]('/:id',auth[_0x5929('0x7')](),controller[_0x5929('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2e9f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','util','path'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0x2e9f,0xf8));var _0xf2e9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x2e9f[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require(_0xf2e9('0x0'));var path=require(_0xf2e9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2e9('0x2')]();var fs_extra=require(_0xf2e9('0x3'));var auth=require(_0xf2e9('0x4'));var interaction=require(_0xf2e9('0x5'));var config=require('../../config/environment');var controller=require(_0xf2e9('0x6'));router[_0xf2e9('0x7')]('/',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x9')]);router[_0xf2e9('0x7')](_0xf2e9('0xa'),auth[_0xf2e9('0x8')](),controller[_0xf2e9('0xb')]);router[_0xf2e9('0x7')](_0xf2e9('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf2e9('0x7')](_0xf2e9('0xd'),auth[_0xf2e9('0x8')](),controller[_0xf2e9('0xe')]);router[_0xf2e9('0x7')](_0xf2e9('0xf'),auth[_0xf2e9('0x8')](),controller['getDescriptions']);router[_0xf2e9('0x7')](_0xf2e9('0x10'),auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x11')]);router[_0xf2e9('0x12')]('/',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x13')]);router[_0xf2e9('0x12')]('/:id/tags',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x14')]);router[_0xf2e9('0x15')]('/:id',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x16')]);router[_0xf2e9('0x17')]('/:id',auth[_0xf2e9('0x8')](),controller['destroy']);module[_0xf2e9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5d26406..e0adcee 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 _0x2cf8=['exports','STRING'];(function(_0x4c0405,_0x5b9d0b){var _0x1445de=function(_0x41a322){while(--_0x41a322){_0x4c0405['push'](_0x4c0405['shift']());}};_0x1445de(++_0x5b9d0b);}(_0x2cf8,0x14e));var _0x82cf=function(_0x595c4e,_0x444249){_0x595c4e=_0x595c4e-0x0;var _0x1e224c=_0x2cf8[_0x595c4e];return _0x1e224c;};'use strict';var Sequelize=require('sequelize');module[_0x82cf('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x82cf('0x1')]}}; \ No newline at end of file +var _0x56f0=['sequelize','exports','STRING'];(function(_0x40a4d6,_0x23d696){var _0x45b62a=function(_0x3268d6){while(--_0x3268d6){_0x40a4d6['push'](_0x40a4d6['shift']());}};_0x45b62a(++_0x23d696);}(_0x56f0,0x114));var _0x056f=function(_0x3158d2,_0x277d23){_0x3158d2=_0x3158d2-0x0;var _0x57c15a=_0x56f0[_0x3158d2];return _0x57c15a;};'use strict';var Sequelize=require(_0x056f('0x0'));module[_0x056f('0x1')]={'name':{'type':Sequelize[_0x056f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 3c82b8f..2035015 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 _0x6cc0=['query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','findOne','FreshdeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','model'];(function(_0x8ca686,_0x47859b){var _0x447292=function(_0x2a1415){while(--_0x2a1415){_0x8ca686['push'](_0x8ca686['shift']());}};_0x447292(++_0x47859b);}(_0x6cc0,0x12a));var _0x06cc=function(_0x898275,_0x108173){_0x898275=_0x898275-0x0;var _0x2610ce=_0x6cc0[_0x898275];return _0x2610ce;};'use strict';var emlformat=require(_0x06cc('0x0'));var rimraf=require(_0x06cc('0x1'));var zipdir=require(_0x06cc('0x2'));var jsonpatch=require(_0x06cc('0x3'));var rp=require(_0x06cc('0x4'));var moment=require(_0x06cc('0x5'));var BPromise=require(_0x06cc('0x6'));var Mustache=require(_0x06cc('0x7'));var util=require(_0x06cc('0x8'));var path=require(_0x06cc('0x9'));var sox=require(_0x06cc('0xa'));var csv=require(_0x06cc('0xb'));var ejs=require(_0x06cc('0xc'));var fs=require('fs');var fs_extra=require(_0x06cc('0xd'));var _=require(_0x06cc('0xe'));var squel=require('squel');var crypto=require(_0x06cc('0xf'));var jsforce=require(_0x06cc('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x06cc('0x11'));var Papa=require('papaparse');var Redis=require(_0x06cc('0x12'));var authService=require(_0x06cc('0x13'));var qs=require(_0x06cc('0x14'));var as=require(_0x06cc('0x15'));var hardwareService=require(_0x06cc('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x06cc('0x17'));var licenseUtil=require(_0x06cc('0x18'));var db=require(_0x06cc('0x19'))['db'];function respondWithStatusCode(_0x38ef7c,_0x1c216b){_0x1c216b=_0x1c216b||0xcc;return function(_0x4828e5){if(_0x4828e5){return _0x38ef7c[_0x06cc('0x1a')](_0x1c216b);}return _0x38ef7c['status'](_0x1c216b)[_0x06cc('0x1b')]();};}function respondWithResult(_0x351403,_0xe8f84b){_0xe8f84b=_0xe8f84b||0xc8;return function(_0x25691e){if(_0x25691e){return _0x351403[_0x06cc('0x1c')](_0xe8f84b)[_0x06cc('0x1d')](_0x25691e);}};}function respondWithFilteredResult(_0x5a90f5,_0x13c6be){return function(_0x54dce3){if(_0x54dce3){var _0x5d8427=typeof _0x13c6be[_0x06cc('0x1e')]===_0x06cc('0x1f')&&typeof _0x13c6be['limit']===_0x06cc('0x1f');var _0x303b71=_0x54dce3[_0x06cc('0x20')];var _0x4e9be8=_0x5d8427?0x0:_0x13c6be[_0x06cc('0x1e')];var _0xc6203a=_0x5d8427?_0x54dce3[_0x06cc('0x20')]:_0x13c6be[_0x06cc('0x1e')]+_0x13c6be[_0x06cc('0x21')];var _0x54f0f5;if(_0xc6203a>=_0x303b71){_0xc6203a=_0x303b71;_0x54f0f5=0xc8;}else{_0x54f0f5=0xce;}_0x5a90f5[_0x06cc('0x1c')](_0x54f0f5);return _0x5a90f5[_0x06cc('0x22')](_0x06cc('0x23'),_0x4e9be8+'-'+_0xc6203a+'/'+_0x303b71)[_0x06cc('0x1d')](_0x54dce3);}return null;};}function patchUpdates(_0x45d597){return function(_0x5afa34){try{jsonpatch[_0x06cc('0x24')](_0x5afa34,_0x45d597,!![]);}catch(_0x1cfcee){return BPromise[_0x06cc('0x25')](_0x1cfcee);}return _0x5afa34[_0x06cc('0x26')]();};}function saveUpdates(_0x184bdf,_0xadf402){return function(_0x111528){if(_0x111528){return _0x111528[_0x06cc('0x27')](_0x184bdf)[_0x06cc('0x28')](function(_0x30e7e4){return _0x30e7e4;});}return null;};}function removeEntity(_0x211ab2,_0x317821){return function(_0x16b611){if(_0x16b611){return _0x16b611[_0x06cc('0x29')]()[_0x06cc('0x28')](function(){_0x211ab2[_0x06cc('0x1c')](0xcc)[_0x06cc('0x1b')]();});}};}function handleEntityNotFound(_0x1d084d,_0x56884b){return function(_0x12ec41){if(!_0x12ec41){_0x1d084d[_0x06cc('0x1a')](0x194);}return _0x12ec41;};}function handleError(_0x510434,_0x53b7a8){_0x53b7a8=_0x53b7a8||0x1f4;return function(_0x2e0198){logger[_0x06cc('0x2a')](_0x2e0198['stack']);if(_0x2e0198[_0x06cc('0x2b')]){delete _0x2e0198['name'];}_0x510434[_0x06cc('0x1c')](_0x53b7a8)[_0x06cc('0x2c')](_0x2e0198);};}exports['index']=function(_0x318fd1,_0x257d01){var _0x2b8a12={},_0x268ade={},_0x6eadbb={'count':0x0,'rows':[]};var _0x466541=_[_0x06cc('0x2d')](db['FreshdeskConfiguration'][_0x06cc('0x2e')],function(_0x3176ce){return{'name':_0x3176ce[_0x06cc('0x2f')],'type':_0x3176ce[_0x06cc('0x30')]['key']};});_0x268ade[_0x06cc('0x31')]=_[_0x06cc('0x2d')](_0x466541,_0x06cc('0x2b'));_0x268ade[_0x06cc('0x32')]=_[_0x06cc('0x33')](_0x318fd1[_0x06cc('0x32')]);_0x268ade[_0x06cc('0x34')]=_['intersection'](_0x268ade[_0x06cc('0x31')],_0x268ade[_0x06cc('0x32')]);_0x2b8a12[_0x06cc('0x35')]=_[_0x06cc('0x36')](_0x268ade[_0x06cc('0x31')],qs[_0x06cc('0x37')](_0x318fd1[_0x06cc('0x32')]['fields']));_0x2b8a12['attributes']=_0x2b8a12[_0x06cc('0x35')][_0x06cc('0x38')]?_0x2b8a12[_0x06cc('0x35')]:_0x268ade[_0x06cc('0x31')];if(!_0x318fd1['query']['hasOwnProperty'](_0x06cc('0x39'))){_0x2b8a12[_0x06cc('0x21')]=qs['limit'](_0x318fd1['query'][_0x06cc('0x21')]);_0x2b8a12[_0x06cc('0x1e')]=qs['offset'](_0x318fd1[_0x06cc('0x32')][_0x06cc('0x1e')]);}_0x2b8a12[_0x06cc('0x3a')]=qs[_0x06cc('0x3b')](_0x318fd1[_0x06cc('0x32')][_0x06cc('0x3b')]);_0x2b8a12[_0x06cc('0x3c')]=qs['filters'](_[_0x06cc('0x3d')](_0x318fd1[_0x06cc('0x32')],_0x268ade[_0x06cc('0x34')]),_0x466541);if(_0x318fd1[_0x06cc('0x32')][_0x06cc('0x3e')]){_0x2b8a12[_0x06cc('0x3c')]=_['merge'](_0x2b8a12['where'],{'$or':_[_0x06cc('0x2d')](_0x466541,function(_0xf0cefc){if(_0xf0cefc[_0x06cc('0x30')]!==_0x06cc('0x3f')){var _0xa463a1={};_0xa463a1[_0xf0cefc[_0x06cc('0x2b')]]={'$like':'%'+_0x318fd1[_0x06cc('0x32')][_0x06cc('0x3e')]+'%'};return _0xa463a1;}})});}_0x2b8a12=_['merge']({},_0x2b8a12,_0x318fd1[_0x06cc('0x40')]);var _0x36da04={'where':_0x2b8a12['where']};return db[_0x06cc('0x41')][_0x06cc('0x20')](_0x36da04)['then'](function(_0x599849){_0x6eadbb[_0x06cc('0x20')]=_0x599849;if(_0x318fd1['query'][_0x06cc('0x42')]){_0x2b8a12[_0x06cc('0x43')]=[{'all':!![]}];}return db[_0x06cc('0x41')][_0x06cc('0x44')](_0x2b8a12);})[_0x06cc('0x28')](function(_0x1018b0){_0x6eadbb[_0x06cc('0x45')]=_0x1018b0;return _0x6eadbb;})[_0x06cc('0x28')](respondWithFilteredResult(_0x257d01,_0x2b8a12))[_0x06cc('0x46')](handleError(_0x257d01,null));};exports[_0x06cc('0x47')]=function(_0x9ea61,_0x4efaf9){var _0x32790c={'raw':![],'where':{'id':_0x9ea61['params']['id']}},_0x1ed00e={};_0x1ed00e[_0x06cc('0x31')]=_[_0x06cc('0x33')](db[_0x06cc('0x41')][_0x06cc('0x2e')]);_0x1ed00e['query']=_[_0x06cc('0x33')](_0x9ea61[_0x06cc('0x32')]);_0x1ed00e[_0x06cc('0x34')]=_[_0x06cc('0x36')](_0x1ed00e[_0x06cc('0x31')],_0x1ed00e[_0x06cc('0x32')]);_0x32790c[_0x06cc('0x35')]=_[_0x06cc('0x36')](_0x1ed00e[_0x06cc('0x31')],qs[_0x06cc('0x37')](_0x9ea61[_0x06cc('0x32')][_0x06cc('0x37')]));_0x32790c['attributes']=_0x32790c[_0x06cc('0x35')]['length']?_0x32790c['attributes']:_0x1ed00e[_0x06cc('0x31')];if(_0x9ea61[_0x06cc('0x32')]['includeAll']){_0x32790c[_0x06cc('0x43')]=[{'all':!![]}];}_0x32790c=_[_0x06cc('0x48')]({},_0x32790c,_0x9ea61['options']);return db['FreshdeskConfiguration'][_0x06cc('0x49')](_0x32790c)[_0x06cc('0x28')](handleEntityNotFound(_0x4efaf9,null))[_0x06cc('0x28')](respondWithResult(_0x4efaf9,null))[_0x06cc('0x46')](handleError(_0x4efaf9,null));};exports[_0x06cc('0x4a')]=function(_0x52efc9,_0x54ba0e){return db[_0x06cc('0x41')][_0x06cc('0x4a')](_0x52efc9[_0x06cc('0x4b')],{})[_0x06cc('0x28')](respondWithResult(_0x54ba0e,0xc9))[_0x06cc('0x46')](handleError(_0x54ba0e,null));};exports[_0x06cc('0x27')]=function(_0x3f1aa0,_0x25b0d4){if(_0x3f1aa0[_0x06cc('0x4b')]['id']){delete _0x3f1aa0[_0x06cc('0x4b')]['id'];}return db[_0x06cc('0x41')][_0x06cc('0x49')]({'where':{'id':_0x3f1aa0[_0x06cc('0x4c')]['id']}})[_0x06cc('0x28')](handleEntityNotFound(_0x25b0d4,null))[_0x06cc('0x28')](saveUpdates(_0x3f1aa0[_0x06cc('0x4b')],null))[_0x06cc('0x28')](respondWithResult(_0x25b0d4,null))[_0x06cc('0x46')](handleError(_0x25b0d4,null));};exports[_0x06cc('0x29')]=function(_0x379daa,_0x51fc8b){return db['FreshdeskConfiguration'][_0x06cc('0x49')]({'where':{'id':_0x379daa[_0x06cc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51fc8b,null))['then'](removeEntity(_0x51fc8b,null))[_0x06cc('0x46')](handleError(_0x51fc8b,null));};exports['getFields']=function(_0x5b6c33,_0x25bdcd,_0xfc72d0){var _0x19513e={};var _0x46b3db={};var _0x265eb2;var _0x3c5b9d;return db[_0x06cc('0x41')][_0x06cc('0x4d')]({'where':{'id':_0x5b6c33[_0x06cc('0x4c')]['id']}})[_0x06cc('0x28')](handleEntityNotFound(_0x25bdcd,null))[_0x06cc('0x28')](function(_0x1b7c82){if(_0x1b7c82){_0x265eb2=_0x1b7c82;_0x46b3db[_0x06cc('0x31')]=_[_0x06cc('0x33')](db[_0x06cc('0x4e')][_0x06cc('0x2e')]);_0x46b3db[_0x06cc('0x32')]=_[_0x06cc('0x33')](_0x5b6c33[_0x06cc('0x32')]);_0x46b3db['filters']=_[_0x06cc('0x36')](_0x46b3db[_0x06cc('0x31')],_0x46b3db['query']);_0x19513e[_0x06cc('0x35')]=_[_0x06cc('0x36')](_0x46b3db[_0x06cc('0x31')],qs[_0x06cc('0x37')](_0x5b6c33[_0x06cc('0x32')][_0x06cc('0x37')]));_0x19513e[_0x06cc('0x35')]=_0x19513e[_0x06cc('0x35')][_0x06cc('0x38')]?_0x19513e[_0x06cc('0x35')]:_0x46b3db['model'];_0x19513e[_0x06cc('0x3a')]=qs[_0x06cc('0x3b')](_0x5b6c33[_0x06cc('0x32')][_0x06cc('0x3b')]);_0x19513e[_0x06cc('0x3c')]=qs['filters'](_[_0x06cc('0x3d')](_0x5b6c33[_0x06cc('0x32')],_0x46b3db['filters']));if(_0x5b6c33['query']['filter']){_0x19513e[_0x06cc('0x3c')]=_[_0x06cc('0x48')](_0x19513e['where'],{'$or':_[_0x06cc('0x2d')](_0x19513e[_0x06cc('0x35')],function(_0x50629c){var _0x40f1da={};_0x40f1da[_0x50629c]={'$like':'%'+_0x5b6c33[_0x06cc('0x32')][_0x06cc('0x3e')]+'%'};return _0x40f1da;})});}_0x19513e=_['merge']({},_0x19513e,_0x5b6c33[_0x06cc('0x40')]);return _0x265eb2[_0x06cc('0x4f')](_0x19513e);}})[_0x06cc('0x28')](function(_0x596f82){if(_0x596f82){_0x3c5b9d=_0x596f82[_0x06cc('0x38')];if(!_0x5b6c33['query'][_0x06cc('0x50')]('nolimit')){_0x19513e[_0x06cc('0x21')]=qs['limit'](_0x5b6c33[_0x06cc('0x32')][_0x06cc('0x21')]);_0x19513e[_0x06cc('0x1e')]=qs[_0x06cc('0x1e')](_0x5b6c33['query'][_0x06cc('0x1e')]);}return _0x265eb2[_0x06cc('0x4f')](_0x19513e);}})[_0x06cc('0x28')](function(_0x51eb6a){if(_0x51eb6a){return _0x51eb6a?{'count':_0x3c5b9d,'rows':_0x51eb6a}:null;}})[_0x06cc('0x28')](respondWithResult(_0x25bdcd,null))['catch'](handleError(_0x25bdcd,null));};exports[_0x06cc('0x51')]=function(_0x48e2bc,_0xdab240,_0x3f2946){var _0x4d9d57={};var _0x335757={};var _0x23ee8b;var _0x3b16ea;return db[_0x06cc('0x41')][_0x06cc('0x4d')]({'where':{'id':_0x48e2bc[_0x06cc('0x4c')]['id']}})[_0x06cc('0x28')](handleEntityNotFound(_0xdab240,null))['then'](function(_0x55dfdf){if(_0x55dfdf){_0x23ee8b=_0x55dfdf;_0x335757[_0x06cc('0x31')]=_[_0x06cc('0x33')](db[_0x06cc('0x4e')][_0x06cc('0x2e')]);_0x335757[_0x06cc('0x32')]=_['keys'](_0x48e2bc[_0x06cc('0x32')]);_0x335757[_0x06cc('0x34')]=_['intersection'](_0x335757[_0x06cc('0x31')],_0x335757[_0x06cc('0x32')]);_0x4d9d57[_0x06cc('0x35')]=_['intersection'](_0x335757[_0x06cc('0x31')],qs[_0x06cc('0x37')](_0x48e2bc[_0x06cc('0x32')]['fields']));_0x4d9d57['attributes']=_0x4d9d57[_0x06cc('0x35')]['length']?_0x4d9d57[_0x06cc('0x35')]:_0x335757['model'];_0x4d9d57[_0x06cc('0x3a')]=qs[_0x06cc('0x3b')](_0x48e2bc[_0x06cc('0x32')][_0x06cc('0x3b')]);_0x4d9d57[_0x06cc('0x3c')]=qs['filters'](_[_0x06cc('0x3d')](_0x48e2bc[_0x06cc('0x32')],_0x335757[_0x06cc('0x34')]));if(_0x48e2bc[_0x06cc('0x32')][_0x06cc('0x3e')]){_0x4d9d57[_0x06cc('0x3c')]=_['merge'](_0x4d9d57['where'],{'$or':_[_0x06cc('0x2d')](_0x4d9d57['attributes'],function(_0x439d53){var _0x2b69a9={};_0x2b69a9[_0x439d53]={'$like':'%'+_0x48e2bc[_0x06cc('0x32')]['filter']+'%'};return _0x2b69a9;})});}_0x4d9d57=_['merge']({},_0x4d9d57,_0x48e2bc[_0x06cc('0x40')]);return _0x23ee8b[_0x06cc('0x51')](_0x4d9d57);}})[_0x06cc('0x28')](function(_0x557c76){if(_0x557c76){_0x3b16ea=_0x557c76[_0x06cc('0x38')];if(!_0x48e2bc[_0x06cc('0x32')][_0x06cc('0x50')](_0x06cc('0x39'))){_0x4d9d57[_0x06cc('0x21')]=qs[_0x06cc('0x21')](_0x48e2bc[_0x06cc('0x32')][_0x06cc('0x21')]);_0x4d9d57[_0x06cc('0x1e')]=qs[_0x06cc('0x1e')](_0x48e2bc[_0x06cc('0x32')][_0x06cc('0x1e')]);}return _0x23ee8b[_0x06cc('0x51')](_0x4d9d57);}})['then'](function(_0x1658f5){if(_0x1658f5){return _0x1658f5?{'count':_0x3b16ea,'rows':_0x1658f5}:null;}})[_0x06cc('0x28')](respondWithResult(_0xdab240,null))[_0x06cc('0x46')](handleError(_0xdab240,null));};exports[_0x06cc('0x52')]=function(_0x29ef7b,_0x2eebf9,_0x288696){var _0x2f1806={};var _0x44092c={};var _0x545afd;var _0x1c11c3;return db[_0x06cc('0x41')][_0x06cc('0x4d')]({'where':{'id':_0x29ef7b[_0x06cc('0x4c')]['id']}})[_0x06cc('0x28')](handleEntityNotFound(_0x2eebf9,null))[_0x06cc('0x28')](function(_0x412c19){if(_0x412c19){_0x545afd=_0x412c19;_0x44092c[_0x06cc('0x31')]=_[_0x06cc('0x33')](db['FreshdeskField'][_0x06cc('0x2e')]);_0x44092c['query']=_[_0x06cc('0x33')](_0x29ef7b[_0x06cc('0x32')]);_0x44092c[_0x06cc('0x34')]=_['intersection'](_0x44092c['model'],_0x44092c[_0x06cc('0x32')]);_0x2f1806['attributes']=_[_0x06cc('0x36')](_0x44092c['model'],qs[_0x06cc('0x37')](_0x29ef7b[_0x06cc('0x32')]['fields']));_0x2f1806['attributes']=_0x2f1806[_0x06cc('0x35')]['length']?_0x2f1806[_0x06cc('0x35')]:_0x44092c['model'];_0x2f1806['order']=qs[_0x06cc('0x3b')](_0x29ef7b['query'][_0x06cc('0x3b')]);_0x2f1806[_0x06cc('0x3c')]=qs['filters'](_[_0x06cc('0x3d')](_0x29ef7b['query'],_0x44092c[_0x06cc('0x34')]));if(_0x29ef7b['query'][_0x06cc('0x3e')]){_0x2f1806[_0x06cc('0x3c')]=_[_0x06cc('0x48')](_0x2f1806[_0x06cc('0x3c')],{'$or':_[_0x06cc('0x2d')](_0x2f1806[_0x06cc('0x35')],function(_0x4ebb8d){var _0x17d325={};_0x17d325[_0x4ebb8d]={'$like':'%'+_0x29ef7b[_0x06cc('0x32')][_0x06cc('0x3e')]+'%'};return _0x17d325;})});}_0x2f1806=_[_0x06cc('0x48')]({},_0x2f1806,_0x29ef7b[_0x06cc('0x40')]);return _0x545afd[_0x06cc('0x52')](_0x2f1806);}})[_0x06cc('0x28')](function(_0x24a366){if(_0x24a366){_0x1c11c3=_0x24a366['length'];if(!_0x29ef7b[_0x06cc('0x32')][_0x06cc('0x50')]('nolimit')){_0x2f1806[_0x06cc('0x21')]=qs['limit'](_0x29ef7b[_0x06cc('0x32')][_0x06cc('0x21')]);_0x2f1806[_0x06cc('0x1e')]=qs[_0x06cc('0x1e')](_0x29ef7b[_0x06cc('0x32')]['offset']);}return _0x545afd[_0x06cc('0x52')](_0x2f1806);}})['then'](function(_0x523251){if(_0x523251){return _0x523251?{'count':_0x1c11c3,'rows':_0x523251}:null;}})['then'](respondWithResult(_0x2eebf9,null))['catch'](handleError(_0x2eebf9,null));};exports[_0x06cc('0x53')]=function(_0x592cd2,_0x14256a,_0x17036f){var _0x2430a9={};var _0x1a9b79={};var _0x5c839e;var _0x4217ab;return db[_0x06cc('0x41')]['findOne']({'where':{'id':_0x592cd2[_0x06cc('0x4c')]['id']}})[_0x06cc('0x28')](handleEntityNotFound(_0x14256a,null))['then'](function(_0x51a04d){if(_0x51a04d){_0x5c839e=_0x51a04d;_0x1a9b79[_0x06cc('0x31')]=_[_0x06cc('0x33')](db[_0x06cc('0x54')]['rawAttributes']);_0x1a9b79[_0x06cc('0x32')]=_[_0x06cc('0x33')](_0x592cd2['query']);_0x1a9b79['filters']=_['intersection'](_0x1a9b79[_0x06cc('0x31')],_0x1a9b79[_0x06cc('0x32')]);_0x2430a9[_0x06cc('0x35')]=_[_0x06cc('0x36')](_0x1a9b79[_0x06cc('0x31')],qs[_0x06cc('0x37')](_0x592cd2[_0x06cc('0x32')]['fields']));_0x2430a9[_0x06cc('0x35')]=_0x2430a9['attributes'][_0x06cc('0x38')]?_0x2430a9['attributes']:_0x1a9b79['model'];_0x2430a9[_0x06cc('0x3a')]=qs[_0x06cc('0x3b')](_0x592cd2[_0x06cc('0x32')]['sort']);_0x2430a9[_0x06cc('0x3c')]=qs[_0x06cc('0x34')](_['pick'](_0x592cd2['query'],_0x1a9b79[_0x06cc('0x34')]));if(_0x592cd2[_0x06cc('0x32')][_0x06cc('0x3e')]){_0x2430a9[_0x06cc('0x3c')]=_[_0x06cc('0x48')](_0x2430a9[_0x06cc('0x3c')],{'$or':_[_0x06cc('0x2d')](_0x2430a9[_0x06cc('0x35')],function(_0xdd6206){var _0x289aef={};_0x289aef[_0xdd6206]={'$like':'%'+_0x592cd2['query'][_0x06cc('0x3e')]+'%'};return _0x289aef;})});}_0x2430a9=_[_0x06cc('0x48')]({},_0x2430a9,_0x592cd2['options']);return _0x5c839e[_0x06cc('0x53')](_0x2430a9);}})[_0x06cc('0x28')](function(_0x4d4c30){if(_0x4d4c30){_0x4217ab=_0x4d4c30[_0x06cc('0x38')];if(!_0x592cd2[_0x06cc('0x32')]['hasOwnProperty'](_0x06cc('0x39'))){_0x2430a9[_0x06cc('0x21')]=qs[_0x06cc('0x21')](_0x592cd2[_0x06cc('0x32')][_0x06cc('0x21')]);_0x2430a9[_0x06cc('0x1e')]=qs[_0x06cc('0x1e')](_0x592cd2[_0x06cc('0x32')][_0x06cc('0x1e')]);}return _0x5c839e['getTags'](_0x2430a9);}})[_0x06cc('0x28')](function(_0x10eb1f){if(_0x10eb1f){return _0x10eb1f?{'count':_0x4217ab,'rows':_0x10eb1f}:null;}})[_0x06cc('0x28')](respondWithResult(_0x14256a,null))[_0x06cc('0x46')](handleError(_0x14256a,null));};exports[_0x06cc('0x55')]=function(_0x16e6da,_0x3f7197,_0x326352){if(_0x16e6da['body']['id']){delete _0x16e6da['body']['id'];}return db[_0x06cc('0x41')][_0x06cc('0x4d')]({'where':{'id':_0x16e6da[_0x06cc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3f7197,null))[_0x06cc('0x28')](function(_0x30ab08){if(_0x30ab08){return _0x30ab08['setTags'](_0x16e6da[_0x06cc('0x4b')][_0x06cc('0x56')]||[]);}return null;})[_0x06cc('0x28')](respondWithResult(_0x3f7197,null))['catch'](handleError(_0x3f7197,null));}; \ No newline at end of file +var _0x4b1a=['../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','then','destroy','error','name','FreshdeskConfiguration','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','params','findOne','FreshdeskField','offset','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5a58ad,_0x4eda9f){var _0x5e7811=function(_0x32fae9){while(--_0x32fae9){_0x5a58ad['push'](_0x5a58ad['shift']());}};_0x5e7811(++_0x4eda9f);}(_0x4b1a,0x183));var _0xa4b1=function(_0x285e60,_0x2fa315){_0x285e60=_0x285e60-0x0;var _0x5a3fc4=_0x4b1a[_0x285e60];return _0x5a3fc4;};'use strict';var emlformat=require(_0xa4b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4b1('0x1'));var jsonpatch=require(_0xa4b1('0x2'));var rp=require(_0xa4b1('0x3'));var moment=require(_0xa4b1('0x4'));var BPromise=require(_0xa4b1('0x5'));var Mustache=require(_0xa4b1('0x6'));var util=require(_0xa4b1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa4b1('0x8'));var ejs=require(_0xa4b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4b1('0xa'));var squel=require(_0xa4b1('0xb'));var crypto=require('crypto');var jsforce=require(_0xa4b1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa4b1('0xd'));var Papa=require(_0xa4b1('0xe'));var Redis=require(_0xa4b1('0xf'));var authService=require(_0xa4b1('0x10'));var qs=require(_0xa4b1('0x11'));var as=require(_0xa4b1('0x12'));var hardwareService=require(_0xa4b1('0x13'));var logger=require(_0xa4b1('0x14'))(_0xa4b1('0x15'));var utils=require(_0xa4b1('0x16'));var config=require(_0xa4b1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4b1('0x18'))['db'];function respondWithStatusCode(_0x3a539f,_0x232ac6){_0x232ac6=_0x232ac6||0xcc;return function(_0x3baf99){if(_0x3baf99){return _0x3a539f[_0xa4b1('0x19')](_0x232ac6);}return _0x3a539f[_0xa4b1('0x1a')](_0x232ac6)[_0xa4b1('0x1b')]();};}function respondWithResult(_0x4978cb,_0x31f95a){_0x31f95a=_0x31f95a||0xc8;return function(_0x502f63){if(_0x502f63){return _0x4978cb[_0xa4b1('0x1a')](_0x31f95a)[_0xa4b1('0x1c')](_0x502f63);}};}function respondWithFilteredResult(_0x567bfe,_0x2fb36a){return function(_0xa9ab14){if(_0xa9ab14){var _0x2e72a2=typeof _0x2fb36a['offset']===_0xa4b1('0x1d')&&typeof _0x2fb36a[_0xa4b1('0x1e')]===_0xa4b1('0x1d');var _0xba5601=_0xa9ab14[_0xa4b1('0x1f')];var _0x127b4e=_0x2e72a2?0x0:_0x2fb36a['offset'];var _0x514e39=_0x2e72a2?_0xa9ab14['count']:_0x2fb36a['offset']+_0x2fb36a[_0xa4b1('0x1e')];var _0x3c5d5e;if(_0x514e39>=_0xba5601){_0x514e39=_0xba5601;_0x3c5d5e=0xc8;}else{_0x3c5d5e=0xce;}_0x567bfe[_0xa4b1('0x1a')](_0x3c5d5e);return _0x567bfe[_0xa4b1('0x20')]('Content-Range',_0x127b4e+'-'+_0x514e39+'/'+_0xba5601)[_0xa4b1('0x1c')](_0xa9ab14);}return null;};}function patchUpdates(_0x271ef1){return function(_0x5d5bbe){try{jsonpatch['apply'](_0x5d5bbe,_0x271ef1,!![]);}catch(_0x145c08){return BPromise[_0xa4b1('0x21')](_0x145c08);}return _0x5d5bbe[_0xa4b1('0x22')]();};}function saveUpdates(_0x47bd81,_0x177d2c){return function(_0x4f2c9c){if(_0x4f2c9c){return _0x4f2c9c[_0xa4b1('0x23')](_0x47bd81)[_0xa4b1('0x24')](function(_0x56d17c){return _0x56d17c;});}return null;};}function removeEntity(_0x24b0f3,_0x45e5a1){return function(_0x366dba){if(_0x366dba){return _0x366dba[_0xa4b1('0x25')]()[_0xa4b1('0x24')](function(){_0x24b0f3['status'](0xcc)[_0xa4b1('0x1b')]();});}};}function handleEntityNotFound(_0xd4986f,_0x3ed7fe){return function(_0x24c877){if(!_0x24c877){_0xd4986f[_0xa4b1('0x19')](0x194);}return _0x24c877;};}function handleError(_0xafda14,_0x2120ae){_0x2120ae=_0x2120ae||0x1f4;return function(_0x4031ec){logger[_0xa4b1('0x26')](_0x4031ec['stack']);if(_0x4031ec[_0xa4b1('0x27')]){delete _0x4031ec[_0xa4b1('0x27')];}_0xafda14['status'](_0x2120ae)['send'](_0x4031ec);};}exports['index']=function(_0x45778d,_0x2160be){var _0x2ac1d1={},_0x44cd03={},_0x2306d4={'count':0x0,'rows':[]};var _0x326daf=_['map'](db[_0xa4b1('0x28')]['rawAttributes'],function(_0x287422){return{'name':_0x287422[_0xa4b1('0x29')],'type':_0x287422[_0xa4b1('0x2a')][_0xa4b1('0x2b')]};});_0x44cd03[_0xa4b1('0x2c')]=_[_0xa4b1('0x2d')](_0x326daf,_0xa4b1('0x27'));_0x44cd03[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x45778d[_0xa4b1('0x2e')]);_0x44cd03[_0xa4b1('0x30')]=_['intersection'](_0x44cd03[_0xa4b1('0x2c')],_0x44cd03['query']);_0x2ac1d1[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0x44cd03['model'],qs[_0xa4b1('0x33')](_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x33')]));_0x2ac1d1[_0xa4b1('0x31')]=_0x2ac1d1[_0xa4b1('0x31')]['length']?_0x2ac1d1[_0xa4b1('0x31')]:_0x44cd03['model'];if(!_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x34')](_0xa4b1('0x35'))){_0x2ac1d1[_0xa4b1('0x1e')]=qs['limit'](_0x45778d['query']['limit']);_0x2ac1d1['offset']=qs['offset'](_0x45778d[_0xa4b1('0x2e')]['offset']);}_0x2ac1d1[_0xa4b1('0x36')]=qs['sort'](_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x2ac1d1['where']=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x45778d[_0xa4b1('0x2e')],_0x44cd03[_0xa4b1('0x30')]),_0x326daf);if(_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x39')]){_0x2ac1d1[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x2ac1d1[_0xa4b1('0x3a')],{'$or':_['map'](_0x326daf,function(_0x39ecd7){if(_0x39ecd7[_0xa4b1('0x2a')]!==_0xa4b1('0x3c')){var _0x2c5201={};_0x2c5201[_0x39ecd7[_0xa4b1('0x27')]]={'$like':'%'+_0x45778d['query']['filter']+'%'};return _0x2c5201;}})});}_0x2ac1d1=_[_0xa4b1('0x3b')]({},_0x2ac1d1,_0x45778d[_0xa4b1('0x3d')]);var _0x20f625={'where':_0x2ac1d1[_0xa4b1('0x3a')]};return db[_0xa4b1('0x28')][_0xa4b1('0x1f')](_0x20f625)[_0xa4b1('0x24')](function(_0x9468a){_0x2306d4[_0xa4b1('0x1f')]=_0x9468a;if(_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x3e')]){_0x2ac1d1[_0xa4b1('0x3f')]=[{'all':!![]}];}return db[_0xa4b1('0x28')][_0xa4b1('0x40')](_0x2ac1d1);})['then'](function(_0xfe28a4){_0x2306d4[_0xa4b1('0x41')]=_0xfe28a4;return _0x2306d4;})[_0xa4b1('0x24')](respondWithFilteredResult(_0x2160be,_0x2ac1d1))[_0xa4b1('0x42')](handleError(_0x2160be,null));};exports['show']=function(_0x5de72,_0x167d68){var _0x1a3c66={'raw':![],'where':{'id':_0x5de72['params']['id']}},_0xb5082a={};_0xb5082a[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db[_0xa4b1('0x28')][_0xa4b1('0x43')]);_0xb5082a[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x5de72[_0xa4b1('0x2e')]);_0xb5082a[_0xa4b1('0x30')]=_[_0xa4b1('0x32')](_0xb5082a[_0xa4b1('0x2c')],_0xb5082a[_0xa4b1('0x2e')]);_0x1a3c66[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0xb5082a[_0xa4b1('0x2c')],qs[_0xa4b1('0x33')](_0x5de72['query'][_0xa4b1('0x33')]));_0x1a3c66['attributes']=_0x1a3c66[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x1a3c66[_0xa4b1('0x31')]:_0xb5082a[_0xa4b1('0x2c')];if(_0x5de72[_0xa4b1('0x2e')]['includeAll']){_0x1a3c66['include']=[{'all':!![]}];}_0x1a3c66=_['merge']({},_0x1a3c66,_0x5de72[_0xa4b1('0x3d')]);return db[_0xa4b1('0x28')][_0xa4b1('0x45')](_0x1a3c66)[_0xa4b1('0x24')](handleEntityNotFound(_0x167d68,null))[_0xa4b1('0x24')](respondWithResult(_0x167d68,null))['catch'](handleError(_0x167d68,null));};exports['create']=function(_0x118f44,_0x55244e){return db[_0xa4b1('0x28')][_0xa4b1('0x46')](_0x118f44['body'],{})[_0xa4b1('0x24')](respondWithResult(_0x55244e,0xc9))['catch'](handleError(_0x55244e,null));};exports[_0xa4b1('0x23')]=function(_0x145b2a,_0x5da8b7){if(_0x145b2a[_0xa4b1('0x47')]['id']){delete _0x145b2a['body']['id'];}return db[_0xa4b1('0x28')]['find']({'where':{'id':_0x145b2a[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x5da8b7,null))[_0xa4b1('0x24')](saveUpdates(_0x145b2a[_0xa4b1('0x47')],null))[_0xa4b1('0x24')](respondWithResult(_0x5da8b7,null))['catch'](handleError(_0x5da8b7,null));};exports['destroy']=function(_0x3e7e57,_0x3b5848){return db[_0xa4b1('0x28')][_0xa4b1('0x45')]({'where':{'id':_0x3e7e57[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b5848,null))[_0xa4b1('0x24')](removeEntity(_0x3b5848,null))[_0xa4b1('0x42')](handleError(_0x3b5848,null));};exports['getFields']=function(_0x3e0b83,_0x58054a,_0x403c52){var _0x1b078d={};var _0x20b47e={};var _0x24bb67;var _0x3f1ab4;return db[_0xa4b1('0x28')][_0xa4b1('0x49')]({'where':{'id':_0x3e0b83[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x58054a,null))[_0xa4b1('0x24')](function(_0x3e483a){if(_0x3e483a){_0x24bb67=_0x3e483a;_0x20b47e[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db[_0xa4b1('0x4a')]['rawAttributes']);_0x20b47e[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x3e0b83[_0xa4b1('0x2e')]);_0x20b47e[_0xa4b1('0x30')]=_['intersection'](_0x20b47e[_0xa4b1('0x2c')],_0x20b47e[_0xa4b1('0x2e')]);_0x1b078d['attributes']=_[_0xa4b1('0x32')](_0x20b47e[_0xa4b1('0x2c')],qs['fields'](_0x3e0b83['query']['fields']));_0x1b078d[_0xa4b1('0x31')]=_0x1b078d[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x1b078d[_0xa4b1('0x31')]:_0x20b47e['model'];_0x1b078d[_0xa4b1('0x36')]=qs[_0xa4b1('0x37')](_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x1b078d[_0xa4b1('0x3a')]=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x3e0b83[_0xa4b1('0x2e')],_0x20b47e['filters']));if(_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x39')]){_0x1b078d[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x1b078d[_0xa4b1('0x3a')],{'$or':_[_0xa4b1('0x2d')](_0x1b078d[_0xa4b1('0x31')],function(_0x44dae5){var _0xaed262={};_0xaed262[_0x44dae5]={'$like':'%'+_0x3e0b83['query'][_0xa4b1('0x39')]+'%'};return _0xaed262;})});}_0x1b078d=_['merge']({},_0x1b078d,_0x3e0b83[_0xa4b1('0x3d')]);return _0x24bb67['getFields'](_0x1b078d);}})['then'](function(_0x6f2862){if(_0x6f2862){_0x3f1ab4=_0x6f2862['length'];if(!_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x34')]('nolimit')){_0x1b078d[_0xa4b1('0x1e')]=qs[_0xa4b1('0x1e')](_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x1e')]);_0x1b078d[_0xa4b1('0x4b')]=qs[_0xa4b1('0x4b')](_0x3e0b83[_0xa4b1('0x2e')]['offset']);}return _0x24bb67[_0xa4b1('0x4c')](_0x1b078d);}})[_0xa4b1('0x24')](function(_0x9d4a36){if(_0x9d4a36){return _0x9d4a36?{'count':_0x3f1ab4,'rows':_0x9d4a36}:null;}})[_0xa4b1('0x24')](respondWithResult(_0x58054a,null))[_0xa4b1('0x42')](handleError(_0x58054a,null));};exports[_0xa4b1('0x4d')]=function(_0x5515a6,_0x5a2417,_0x4772af){var _0x211822={};var _0x1a2ccf={};var _0x12f4ee;var _0x2f59d2;return db['FreshdeskConfiguration'][_0xa4b1('0x49')]({'where':{'id':_0x5515a6[_0xa4b1('0x48')]['id']}})[_0xa4b1('0x24')](handleEntityNotFound(_0x5a2417,null))[_0xa4b1('0x24')](function(_0x51b6a4){if(_0x51b6a4){_0x12f4ee=_0x51b6a4;_0x1a2ccf[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db['FreshdeskField'][_0xa4b1('0x43')]);_0x1a2ccf[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x5515a6[_0xa4b1('0x2e')]);_0x1a2ccf[_0xa4b1('0x30')]=_[_0xa4b1('0x32')](_0x1a2ccf[_0xa4b1('0x2c')],_0x1a2ccf[_0xa4b1('0x2e')]);_0x211822[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0x1a2ccf[_0xa4b1('0x2c')],qs['fields'](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x33')]));_0x211822[_0xa4b1('0x31')]=_0x211822[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x211822['attributes']:_0x1a2ccf['model'];_0x211822[_0xa4b1('0x36')]=qs[_0xa4b1('0x37')](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x211822['where']=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x5515a6[_0xa4b1('0x2e')],_0x1a2ccf[_0xa4b1('0x30')]));if(_0x5515a6[_0xa4b1('0x2e')]['filter']){_0x211822[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x211822[_0xa4b1('0x3a')],{'$or':_[_0xa4b1('0x2d')](_0x211822['attributes'],function(_0x27362a){var _0x385b60={};_0x385b60[_0x27362a]={'$like':'%'+_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x39')]+'%'};return _0x385b60;})});}_0x211822=_[_0xa4b1('0x3b')]({},_0x211822,_0x5515a6[_0xa4b1('0x3d')]);return _0x12f4ee[_0xa4b1('0x4d')](_0x211822);}})[_0xa4b1('0x24')](function(_0x32e9f9){if(_0x32e9f9){_0x2f59d2=_0x32e9f9[_0xa4b1('0x44')];if(!_0x5515a6['query'][_0xa4b1('0x34')](_0xa4b1('0x35'))){_0x211822[_0xa4b1('0x1e')]=qs[_0xa4b1('0x1e')](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x1e')]);_0x211822['offset']=qs[_0xa4b1('0x4b')](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x4b')]);}return _0x12f4ee[_0xa4b1('0x4d')](_0x211822);}})['then'](function(_0x4319da){if(_0x4319da){return _0x4319da?{'count':_0x2f59d2,'rows':_0x4319da}:null;}})[_0xa4b1('0x24')](respondWithResult(_0x5a2417,null))['catch'](handleError(_0x5a2417,null));};exports[_0xa4b1('0x4e')]=function(_0x57c6ce,_0x368167,_0x435fbb){var _0x86a38c={};var _0x317143={};var _0x54ecae;var _0x42b4ea;return db['FreshdeskConfiguration'][_0xa4b1('0x49')]({'where':{'id':_0x57c6ce[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x368167,null))['then'](function(_0x1b5c02){if(_0x1b5c02){_0x54ecae=_0x1b5c02;_0x317143['model']=_['keys'](db[_0xa4b1('0x4a')][_0xa4b1('0x43')]);_0x317143[_0xa4b1('0x2e')]=_['keys'](_0x57c6ce[_0xa4b1('0x2e')]);_0x317143[_0xa4b1('0x30')]=_['intersection'](_0x317143['model'],_0x317143[_0xa4b1('0x2e')]);_0x86a38c[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0x317143[_0xa4b1('0x2c')],qs[_0xa4b1('0x33')](_0x57c6ce[_0xa4b1('0x2e')][_0xa4b1('0x33')]));_0x86a38c[_0xa4b1('0x31')]=_0x86a38c['attributes'][_0xa4b1('0x44')]?_0x86a38c[_0xa4b1('0x31')]:_0x317143[_0xa4b1('0x2c')];_0x86a38c['order']=qs[_0xa4b1('0x37')](_0x57c6ce[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x86a38c[_0xa4b1('0x3a')]=qs['filters'](_[_0xa4b1('0x38')](_0x57c6ce[_0xa4b1('0x2e')],_0x317143[_0xa4b1('0x30')]));if(_0x57c6ce['query'][_0xa4b1('0x39')]){_0x86a38c[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x86a38c[_0xa4b1('0x3a')],{'$or':_['map'](_0x86a38c[_0xa4b1('0x31')],function(_0x5bca16){var _0x23136e={};_0x23136e[_0x5bca16]={'$like':'%'+_0x57c6ce[_0xa4b1('0x2e')][_0xa4b1('0x39')]+'%'};return _0x23136e;})});}_0x86a38c=_[_0xa4b1('0x3b')]({},_0x86a38c,_0x57c6ce[_0xa4b1('0x3d')]);return _0x54ecae[_0xa4b1('0x4e')](_0x86a38c);}})[_0xa4b1('0x24')](function(_0x6a50db){if(_0x6a50db){_0x42b4ea=_0x6a50db['length'];if(!_0x57c6ce['query'][_0xa4b1('0x34')](_0xa4b1('0x35'))){_0x86a38c[_0xa4b1('0x1e')]=qs[_0xa4b1('0x1e')](_0x57c6ce['query'][_0xa4b1('0x1e')]);_0x86a38c[_0xa4b1('0x4b')]=qs[_0xa4b1('0x4b')](_0x57c6ce[_0xa4b1('0x2e')]['offset']);}return _0x54ecae[_0xa4b1('0x4e')](_0x86a38c);}})[_0xa4b1('0x24')](function(_0xc5a262){if(_0xc5a262){return _0xc5a262?{'count':_0x42b4ea,'rows':_0xc5a262}:null;}})['then'](respondWithResult(_0x368167,null))[_0xa4b1('0x42')](handleError(_0x368167,null));};exports[_0xa4b1('0x4f')]=function(_0x4e7c84,_0x285f81,_0x297ad2){var _0x1fae37={};var _0xc1ceca={};var _0x263e3;var _0x3121e6;return db[_0xa4b1('0x28')][_0xa4b1('0x49')]({'where':{'id':_0x4e7c84['params']['id']}})[_0xa4b1('0x24')](handleEntityNotFound(_0x285f81,null))[_0xa4b1('0x24')](function(_0x59b607){if(_0x59b607){_0x263e3=_0x59b607;_0xc1ceca[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db[_0xa4b1('0x50')][_0xa4b1('0x43')]);_0xc1ceca[_0xa4b1('0x2e')]=_['keys'](_0x4e7c84[_0xa4b1('0x2e')]);_0xc1ceca[_0xa4b1('0x30')]=_['intersection'](_0xc1ceca[_0xa4b1('0x2c')],_0xc1ceca[_0xa4b1('0x2e')]);_0x1fae37[_0xa4b1('0x31')]=_['intersection'](_0xc1ceca[_0xa4b1('0x2c')],qs[_0xa4b1('0x33')](_0x4e7c84['query'][_0xa4b1('0x33')]));_0x1fae37[_0xa4b1('0x31')]=_0x1fae37[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x1fae37[_0xa4b1('0x31')]:_0xc1ceca['model'];_0x1fae37['order']=qs[_0xa4b1('0x37')](_0x4e7c84[_0xa4b1('0x2e')]['sort']);_0x1fae37[_0xa4b1('0x3a')]=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x4e7c84[_0xa4b1('0x2e')],_0xc1ceca['filters']));if(_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x39')]){_0x1fae37['where']=_[_0xa4b1('0x3b')](_0x1fae37[_0xa4b1('0x3a')],{'$or':_[_0xa4b1('0x2d')](_0x1fae37[_0xa4b1('0x31')],function(_0x45ac2d){var _0x2ff306={};_0x2ff306[_0x45ac2d]={'$like':'%'+_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x39')]+'%'};return _0x2ff306;})});}_0x1fae37=_['merge']({},_0x1fae37,_0x4e7c84[_0xa4b1('0x3d')]);return _0x263e3[_0xa4b1('0x4f')](_0x1fae37);}})[_0xa4b1('0x24')](function(_0x51d661){if(_0x51d661){_0x3121e6=_0x51d661[_0xa4b1('0x44')];if(!_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x34')]('nolimit')){_0x1fae37[_0xa4b1('0x1e')]=qs['limit'](_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x1e')]);_0x1fae37[_0xa4b1('0x4b')]=qs[_0xa4b1('0x4b')](_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x4b')]);}return _0x263e3[_0xa4b1('0x4f')](_0x1fae37);}})[_0xa4b1('0x24')](function(_0x5cd3f4){if(_0x5cd3f4){return _0x5cd3f4?{'count':_0x3121e6,'rows':_0x5cd3f4}:null;}})['then'](respondWithResult(_0x285f81,null))[_0xa4b1('0x42')](handleError(_0x285f81,null));};exports['setTags']=function(_0x3951c0,_0x21ef75,_0x358c8a){if(_0x3951c0[_0xa4b1('0x47')]['id']){delete _0x3951c0[_0xa4b1('0x47')]['id'];}return db[_0xa4b1('0x28')][_0xa4b1('0x49')]({'where':{'id':_0x3951c0['params']['id']}})[_0xa4b1('0x24')](handleEntityNotFound(_0x21ef75,null))[_0xa4b1('0x24')](function(_0x50c03b){if(_0x50c03b){return _0x50c03b[_0xa4b1('0x51')](_0x3951c0[_0xa4b1('0x47')]['ids']||[]);}return null;})[_0xa4b1('0x24')](respondWithResult(_0x21ef75,null))[_0xa4b1('0x42')](handleError(_0x21ef75,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 0dda55e..e156241 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 _0xdd17=['moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x3961c1,_0x1d1785){var _0x15dbbf=function(_0x190d87){while(--_0x190d87){_0x3961c1['push'](_0x3961c1['shift']());}};_0x15dbbf(++_0x1d1785);}(_0xdd17,0x105));var _0x7dd1=function(_0x2fa707,_0x32b4df){_0x2fa707=_0x2fa707-0x0;var _0x536bcc=_0xdd17[_0x2fa707];return _0x536bcc;};'use strict';var _=require(_0x7dd1('0x0'));var util=require(_0x7dd1('0x1'));var logger=require(_0x7dd1('0x2'))('api');var moment=require(_0x7dd1('0x3'));var BPromise=require(_0x7dd1('0x4'));var rp=require(_0x7dd1('0x5'));var fs=require('fs');var path=require(_0x7dd1('0x6'));var rimraf=require('rimraf');var config=require(_0x7dd1('0x7'));var attributes=require(_0x7dd1('0x8'));module[_0x7dd1('0x9')]=function(_0x3fa825,_0x470044){return _0x3fa825['define'](_0x7dd1('0xa'),attributes,{'tableName':_0x7dd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd552=['int_freshdesk_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x1f8536,_0x56bbe6){var _0x5f1873=function(_0x4c7cda){while(--_0x4c7cda){_0x1f8536['push'](_0x1f8536['shift']());}};_0x5f1873(++_0x56bbe6);}(_0xd552,0xb7));var _0x2d55=function(_0x55a4fe,_0x4ccc18){_0x55a4fe=_0x55a4fe-0x0;var _0x1890cf=_0xd552[_0x55a4fe];return _0x1890cf;};'use strict';var _=require('lodash');var util=require(_0x2d55('0x0'));var logger=require(_0x2d55('0x1'))(_0x2d55('0x2'));var moment=require(_0x2d55('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d55('0x4'));var fs=require('fs');var path=require(_0x2d55('0x5'));var rimraf=require(_0x2d55('0x6'));var config=require(_0x2d55('0x7'));var attributes=require(_0x2d55('0x8'));module[_0x2d55('0x9')]=function(_0x569306,_0x33fb1e){return _0x569306[_0x2d55('0xa')](_0x2d55('0xb'),attributes,{'tableName':_0x2d55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 0957116..66754e8 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 _0xa7b7=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http'];(function(_0x247179,_0x204859){var _0x273407=function(_0x276265){while(--_0x276265){_0x247179['push'](_0x247179['shift']());}};_0x273407(++_0x204859);}(_0xa7b7,0x196));var _0x7a7b=function(_0x5b3e74,_0x345b38){_0x5b3e74=_0x5b3e74-0x0;var _0x4cd9ce=_0xa7b7[_0x5b3e74];return _0x4cd9ce;};'use strict';var _=require('lodash');var util=require(_0x7a7b('0x0'));var moment=require(_0x7a7b('0x1'));var BPromise=require(_0x7a7b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a7b('0x3'));var db=require(_0x7a7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a7b('0x6'));var client=jayson['client'][_0x7a7b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x272f71,_0x5edf82,_0x46165a){return new BPromise(function(_0x55a6c9,_0x3e1c53){return client['request'](_0x272f71,_0x46165a)[_0x7a7b('0x8')](function(_0x24c1e6){logger[_0x7a7b('0x9')](_0x7a7b('0xa'),_0x5edf82,_0x7a7b('0xb'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5edf82,_0x7a7b('0xb'),JSON[_0x7a7b('0xc')](_0x24c1e6));if(_0x24c1e6[_0x7a7b('0xd')]){if(_0x24c1e6[_0x7a7b('0xd')][_0x7a7b('0xe')]===0x1f4){logger['error'](_0x7a7b('0xa'),_0x5edf82,_0x24c1e6[_0x7a7b('0xd')][_0x7a7b('0xf')]);return _0x3e1c53(_0x24c1e6[_0x7a7b('0xd')][_0x7a7b('0xf')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5edf82,_0x24c1e6[_0x7a7b('0xd')][_0x7a7b('0xf')]);return _0x55a6c9(_0x24c1e6[_0x7a7b('0xd')]['message']);}else{logger['info'](_0x7a7b('0xa'),_0x5edf82,_0x7a7b('0xb'));_0x55a6c9(_0x24c1e6[_0x7a7b('0x10')][_0x7a7b('0xf')]);}})[_0x7a7b('0x11')](function(_0x431afb){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5edf82,_0x431afb);_0x3e1c53(_0x431afb);});});} \ No newline at end of file +var _0xd740=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x13f6bb,_0x1d625f){var _0x413673=function(_0x6dacf6){while(--_0x6dacf6){_0x13f6bb['push'](_0x13f6bb['shift']());}};_0x413673(++_0x1d625f);}(_0xd740,0x1f0));var _0x0d74=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xd740[_0x41582d];return _0x59c504;};'use strict';var _=require(_0x0d74('0x0'));var util=require(_0x0d74('0x1'));var moment=require(_0x0d74('0x2'));var BPromise=require(_0x0d74('0x3'));var rs=require(_0x0d74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d74('0x6'))(_0x0d74('0x7'));var config=require(_0x0d74('0x8'));var jayson=require(_0x0d74('0x9'));var client=jayson[_0x0d74('0xa')][_0x0d74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48b377,_0x3df505,_0x22b2eb){return new BPromise(function(_0x4a6597,_0x379564){return client[_0x0d74('0xc')](_0x48b377,_0x22b2eb)['then'](function(_0x56d910){logger[_0x0d74('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3df505,_0x0d74('0xe'));logger[_0x0d74('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3df505,_0x0d74('0xe'),JSON['stringify'](_0x56d910));if(_0x56d910[_0x0d74('0x10')]){if(_0x56d910[_0x0d74('0x10')]['code']===0x1f4){logger[_0x0d74('0x10')](_0x0d74('0x11'),_0x3df505,_0x56d910['error'][_0x0d74('0x12')]);return _0x379564(_0x56d910[_0x0d74('0x10')][_0x0d74('0x12')]);}logger[_0x0d74('0x10')](_0x0d74('0x11'),_0x3df505,_0x56d910[_0x0d74('0x10')]['message']);return _0x4a6597(_0x56d910[_0x0d74('0x10')][_0x0d74('0x12')]);}else{logger[_0x0d74('0xd')](_0x0d74('0x11'),_0x3df505,'request\x20sent');_0x4a6597(_0x56d910['result']['message']);}})[_0x0d74('0x13')](function(_0xf3bc7c){logger[_0x0d74('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3df505,_0xf3bc7c);_0x379564(_0xf3bc7c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index aa5bd53..b124f8b 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 _0xd72d=['isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get'];(function(_0x2808fa,_0x4f0da5){var _0x21940b=function(_0x1e75fc){while(--_0x1e75fc){_0x2808fa['push'](_0x2808fa['shift']());}};_0x21940b(++_0x4f0da5);}(_0xd72d,0x80));var _0xdd72=function(_0x34c44c,_0x4fc55b){_0x34c44c=_0x34c44c-0x0;var _0x1a6461=_0xd72d[_0x34c44c];return _0x1a6461;};'use strict';var multer=require(_0xdd72('0x0'));var util=require(_0xdd72('0x1'));var path=require(_0xdd72('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd72('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdd72('0x4'));var interaction=require(_0xdd72('0x5'));var config=require('../../config/environment');var controller=require(_0xdd72('0x6'));router[_0xdd72('0x7')]('/',auth[_0xdd72('0x8')](),controller[_0xdd72('0x9')]);router[_0xdd72('0x7')](_0xdd72('0xa'),auth[_0xdd72('0x8')](),controller[_0xdd72('0xb')]);router[_0xdd72('0xc')]('/',auth['isAuthenticated'](),controller[_0xdd72('0xd')]);router['put'](_0xdd72('0xa'),auth[_0xdd72('0x8')](),controller[_0xdd72('0xe')]);router[_0xdd72('0xf')](_0xdd72('0xa'),auth[_0xdd72('0x8')](),controller['destroy']);module[_0xdd72('0x10')]=router; \ No newline at end of file +var _0x8569=['get','/:id','post','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index'];(function(_0x321a51,_0x5305cb){var _0x5365d9=function(_0x21c4c2){while(--_0x21c4c2){_0x321a51['push'](_0x321a51['shift']());}};_0x5365d9(++_0x5305cb);}(_0x8569,0x15b));var _0x9856=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x8569[_0x4d40dd];return _0x1c51f2;};'use strict';var multer=require(_0x9856('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9856('0x1'));var express=require(_0x9856('0x2'));var router=express[_0x9856('0x3')]();var fs_extra=require(_0x9856('0x4'));var auth=require(_0x9856('0x5'));var interaction=require(_0x9856('0x6'));var config=require('../../config/environment');var controller=require(_0x9856('0x7'));router['get']('/',auth[_0x9856('0x8')](),controller[_0x9856('0x9')]);router[_0x9856('0xa')](_0x9856('0xb'),auth[_0x9856('0x8')](),controller['show']);router[_0x9856('0xc')]('/',auth[_0x9856('0x8')](),controller[_0x9856('0xd')]);router['put'](_0x9856('0xb'),auth['isAuthenticated'](),controller[_0x9856('0xe')]);router[_0x9856('0xf')](_0x9856('0xb'),auth[_0x9856('0x8')](),controller[_0x9856('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 4504cac..b6d9efa 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 _0x6582=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x8a6124,_0x1f100a){var _0x4e5a23=function(_0x35f78e){while(--_0x35f78e){_0x8a6124['push'](_0x8a6124['shift']());}};_0x4e5a23(++_0x1f100a);}(_0x6582,0x1a3));var _0x2658=function(_0x52c538,_0x48f45a){_0x52c538=_0x52c538-0x0;var _0x33cb72=_0x6582[_0x52c538];return _0x33cb72;};'use strict';var Sequelize=require(_0x2658('0x0'));module['exports']={'type':{'type':Sequelize[_0x2658('0x1')]('string',_0x2658('0x2'),_0x2658('0x3'),_0x2658('0x4'),_0x2658('0x5')),'defaultValue':_0x2658('0x6')},'content':{'type':Sequelize[_0x2658('0x7')]},'key':{'type':Sequelize[_0x2658('0x7')]},'keyType':{'type':Sequelize[_0x2658('0x1')](_0x2658('0x6'),_0x2658('0x2'),_0x2658('0x3'))},'keyContent':{'type':Sequelize[_0x2658('0x7')]},'idField':{'type':Sequelize[_0x2658('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2658('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2658('0x7')]}}; \ No newline at end of file +var _0x80ad=['ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports'];(function(_0x1ea02b,_0x1de0e3){var _0x1df7a1=function(_0x1bf718){while(--_0x1bf718){_0x1ea02b['push'](_0x1ea02b['shift']());}};_0x1df7a1(++_0x1de0e3);}(_0x80ad,0x120));var _0xd80a=function(_0x374ff6,_0x30546f){_0x374ff6=_0x374ff6-0x0;var _0x58203b=_0x80ad[_0x374ff6];return _0x58203b;};'use strict';var Sequelize=require(_0xd80a('0x0'));module[_0xd80a('0x1')]={'type':{'type':Sequelize[_0xd80a('0x2')]('string',_0xd80a('0x3'),_0xd80a('0x4'),_0xd80a('0x5'),_0xd80a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd80a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd80a('0x2')](_0xd80a('0x8'),_0xd80a('0x3'),_0xd80a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd80a('0x7')]},'customField':{'type':Sequelize[_0xd80a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd80a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4bf2087..47df9b4 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 _0xcffe=['apply','reject','save','then','error','name','send','FreshdeskField','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range'];(function(_0xacd38e,_0x5b1c09){var _0x421421=function(_0x349a0e){while(--_0x349a0e){_0xacd38e['push'](_0xacd38e['shift']());}};_0x421421(++_0x5b1c09);}(_0xcffe,0x1a1));var _0xecff=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0xcffe[_0x38aeea];return _0x5e8d2c;};'use strict';var emlformat=require(_0xecff('0x0'));var rimraf=require(_0xecff('0x1'));var zipdir=require(_0xecff('0x2'));var jsonpatch=require(_0xecff('0x3'));var rp=require(_0xecff('0x4'));var moment=require(_0xecff('0x5'));var BPromise=require(_0xecff('0x6'));var Mustache=require(_0xecff('0x7'));var util=require(_0xecff('0x8'));var path=require(_0xecff('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xecff('0xa'));var fs=require('fs');var fs_extra=require(_0xecff('0xb'));var _=require(_0xecff('0xc'));var squel=require(_0xecff('0xd'));var crypto=require(_0xecff('0xe'));var jsforce=require(_0xecff('0xf'));var deskjs=require(_0xecff('0x10'));var toCsv=require('to-csv');var querystring=require(_0xecff('0x11'));var Papa=require(_0xecff('0x12'));var Redis=require(_0xecff('0x13'));var authService=require(_0xecff('0x14'));var qs=require(_0xecff('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecff('0x16'));var logger=require(_0xecff('0x17'))(_0xecff('0x18'));var utils=require(_0xecff('0x19'));var config=require(_0xecff('0x1a'));var licenseUtil=require(_0xecff('0x1b'));var db=require(_0xecff('0x1c'))['db'];function respondWithStatusCode(_0x32627c,_0x3e907d){_0x3e907d=_0x3e907d||0xcc;return function(_0x151a79){if(_0x151a79){return _0x32627c[_0xecff('0x1d')](_0x3e907d);}return _0x32627c[_0xecff('0x1e')](_0x3e907d)[_0xecff('0x1f')]();};}function respondWithResult(_0xb8745f,_0x5495f9){_0x5495f9=_0x5495f9||0xc8;return function(_0x4b1893){if(_0x4b1893){return _0xb8745f[_0xecff('0x1e')](_0x5495f9)[_0xecff('0x20')](_0x4b1893);}};}function respondWithFilteredResult(_0x558ecd,_0x35ce1f){return function(_0x362ed0){if(_0x362ed0){var _0x3a7623=typeof _0x35ce1f['offset']==='undefined'&&typeof _0x35ce1f[_0xecff('0x21')]===_0xecff('0x22');var _0x53ff8e=_0x362ed0[_0xecff('0x23')];var _0x3adc81=_0x3a7623?0x0:_0x35ce1f[_0xecff('0x24')];var _0x2393db=_0x3a7623?_0x362ed0[_0xecff('0x23')]:_0x35ce1f[_0xecff('0x24')]+_0x35ce1f['limit'];var _0x229728;if(_0x2393db>=_0x53ff8e){_0x2393db=_0x53ff8e;_0x229728=0xc8;}else{_0x229728=0xce;}_0x558ecd[_0xecff('0x1e')](_0x229728);return _0x558ecd[_0xecff('0x25')](_0xecff('0x26'),_0x3adc81+'-'+_0x2393db+'/'+_0x53ff8e)['json'](_0x362ed0);}return null;};}function patchUpdates(_0x4bb94e){return function(_0x2e2bdd){try{jsonpatch[_0xecff('0x27')](_0x2e2bdd,_0x4bb94e,!![]);}catch(_0x333eb7){return BPromise[_0xecff('0x28')](_0x333eb7);}return _0x2e2bdd[_0xecff('0x29')]();};}function saveUpdates(_0x494754,_0x14378d){return function(_0x520d6d){if(_0x520d6d){return _0x520d6d['update'](_0x494754)[_0xecff('0x2a')](function(_0x4fdc8e){return _0x4fdc8e;});}return null;};}function removeEntity(_0x2447da,_0x49c0cd){return function(_0x389281){if(_0x389281){return _0x389281['destroy']()[_0xecff('0x2a')](function(){_0x2447da[_0xecff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f173d,_0x18f4d4){return function(_0x393312){if(!_0x393312){_0x9f173d[_0xecff('0x1d')](0x194);}return _0x393312;};}function handleError(_0x19202e,_0x493465){_0x493465=_0x493465||0x1f4;return function(_0x4f987b){logger[_0xecff('0x2b')](_0x4f987b['stack']);if(_0x4f987b[_0xecff('0x2c')]){delete _0x4f987b[_0xecff('0x2c')];}_0x19202e[_0xecff('0x1e')](_0x493465)[_0xecff('0x2d')](_0x4f987b);};}exports['index']=function(_0x4e7afa,_0x55502f){var _0x202ee0={},_0xabe5da={},_0x230d04={'count':0x0,'rows':[]};var _0x1e3175=_['map'](db[_0xecff('0x2e')][_0xecff('0x2f')],function(_0x1926a5){return{'name':_0x1926a5['fieldName'],'type':_0x1926a5[_0xecff('0x30')][_0xecff('0x31')]};});_0xabe5da[_0xecff('0x32')]=_[_0xecff('0x33')](_0x1e3175,'name');_0xabe5da[_0xecff('0x34')]=_[_0xecff('0x35')](_0x4e7afa['query']);_0xabe5da[_0xecff('0x36')]=_[_0xecff('0x37')](_0xabe5da[_0xecff('0x32')],_0xabe5da[_0xecff('0x34')]);_0x202ee0['attributes']=_[_0xecff('0x37')](_0xabe5da[_0xecff('0x32')],qs[_0xecff('0x38')](_0x4e7afa['query'][_0xecff('0x38')]));_0x202ee0[_0xecff('0x39')]=_0x202ee0[_0xecff('0x39')][_0xecff('0x3a')]?_0x202ee0[_0xecff('0x39')]:_0xabe5da[_0xecff('0x32')];if(!_0x4e7afa['query']['hasOwnProperty']('nolimit')){_0x202ee0[_0xecff('0x21')]=qs['limit'](_0x4e7afa[_0xecff('0x34')][_0xecff('0x21')]);_0x202ee0['offset']=qs[_0xecff('0x24')](_0x4e7afa[_0xecff('0x34')][_0xecff('0x24')]);}_0x202ee0['order']=qs[_0xecff('0x3b')](_0x4e7afa[_0xecff('0x34')][_0xecff('0x3b')]);_0x202ee0['where']=qs[_0xecff('0x36')](_[_0xecff('0x3c')](_0x4e7afa[_0xecff('0x34')],_0xabe5da[_0xecff('0x36')]),_0x1e3175);if(_0x4e7afa[_0xecff('0x34')][_0xecff('0x3d')]){_0x202ee0[_0xecff('0x3e')]=_[_0xecff('0x3f')](_0x202ee0[_0xecff('0x3e')],{'$or':_[_0xecff('0x33')](_0x1e3175,function(_0xb9a367){if(_0xb9a367['type']!==_0xecff('0x40')){var _0x23c8f1={};_0x23c8f1[_0xb9a367[_0xecff('0x2c')]]={'$like':'%'+_0x4e7afa[_0xecff('0x34')][_0xecff('0x3d')]+'%'};return _0x23c8f1;}})});}_0x202ee0=_[_0xecff('0x3f')]({},_0x202ee0,_0x4e7afa[_0xecff('0x41')]);var _0x2ed2ab={'where':_0x202ee0['where']};return db[_0xecff('0x2e')]['count'](_0x2ed2ab)[_0xecff('0x2a')](function(_0x344108){_0x230d04[_0xecff('0x23')]=_0x344108;if(_0x4e7afa[_0xecff('0x34')][_0xecff('0x42')]){_0x202ee0[_0xecff('0x43')]=[{'all':!![]}];}return db[_0xecff('0x2e')]['findAll'](_0x202ee0);})[_0xecff('0x2a')](function(_0x3dc857){_0x230d04['rows']=_0x3dc857;return _0x230d04;})['then'](respondWithFilteredResult(_0x55502f,_0x202ee0))[_0xecff('0x44')](handleError(_0x55502f,null));};exports[_0xecff('0x45')]=function(_0x27f0dd,_0x1f095e){var _0x47084b={'raw':!![],'where':{'id':_0x27f0dd['params']['id']}},_0xb9117c={};_0xb9117c[_0xecff('0x32')]=_[_0xecff('0x35')](db['FreshdeskField'][_0xecff('0x2f')]);_0xb9117c[_0xecff('0x34')]=_[_0xecff('0x35')](_0x27f0dd[_0xecff('0x34')]);_0xb9117c[_0xecff('0x36')]=_[_0xecff('0x37')](_0xb9117c['model'],_0xb9117c[_0xecff('0x34')]);_0x47084b[_0xecff('0x39')]=_[_0xecff('0x37')](_0xb9117c['model'],qs[_0xecff('0x38')](_0x27f0dd[_0xecff('0x34')][_0xecff('0x38')]));_0x47084b[_0xecff('0x39')]=_0x47084b['attributes'][_0xecff('0x3a')]?_0x47084b[_0xecff('0x39')]:_0xb9117c['model'];if(_0x27f0dd[_0xecff('0x34')][_0xecff('0x42')]){_0x47084b['include']=[{'all':!![]}];}_0x47084b=_[_0xecff('0x3f')]({},_0x47084b,_0x27f0dd['options']);return db[_0xecff('0x2e')][_0xecff('0x46')](_0x47084b)[_0xecff('0x2a')](handleEntityNotFound(_0x1f095e,null))[_0xecff('0x2a')](respondWithResult(_0x1f095e,null))[_0xecff('0x44')](handleError(_0x1f095e,null));};exports[_0xecff('0x47')]=function(_0x563f68,_0x596eb8){return db[_0xecff('0x2e')][_0xecff('0x47')](_0x563f68[_0xecff('0x48')],{})[_0xecff('0x2a')](respondWithResult(_0x596eb8,0xc9))[_0xecff('0x44')](handleError(_0x596eb8,null));};exports[_0xecff('0x49')]=function(_0x36c50f,_0x3ac749){if(_0x36c50f['body']['id']){delete _0x36c50f[_0xecff('0x48')]['id'];}return db[_0xecff('0x2e')]['find']({'where':{'id':_0x36c50f[_0xecff('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3ac749,null))[_0xecff('0x2a')](saveUpdates(_0x36c50f[_0xecff('0x48')],null))['then'](respondWithResult(_0x3ac749,null))[_0xecff('0x44')](handleError(_0x3ac749,null));};exports[_0xecff('0x4b')]=function(_0x3e79f9,_0x188d08){return db[_0xecff('0x2e')]['find']({'where':{'id':_0x3e79f9['params']['id']}})[_0xecff('0x2a')](handleEntityNotFound(_0x188d08,null))[_0xecff('0x2a')](removeEntity(_0x188d08,null))[_0xecff('0x44')](handleError(_0x188d08,null));}; \ No newline at end of file +var _0xad95=['offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','FreshdeskField','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0xad95,0x70));var _0x5ad9=function(_0x59309b,_0x29e43a){_0x59309b=_0x59309b-0x0;var _0x5c1f6d=_0xad95[_0x59309b];return _0x5c1f6d;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){_0x5b816d[_0x5ad9('0x14')](0xcc)[_0x5ad9('0x20')]();});}};}function handleEntityNotFound(_0x1252e6,_0x36da5f){return function(_0x11d919){if(!_0x11d919){_0x1252e6['sendStatus'](0x194);}return _0x11d919;};}function handleError(_0x54e9dd,_0xe6540f){_0xe6540f=_0xe6540f||0x1f4;return function(_0x4f3889){logger[_0x5ad9('0x21')](_0x4f3889['stack']);if(_0x4f3889[_0x5ad9('0x22')]){delete _0x4f3889['name'];}_0x54e9dd['status'](_0xe6540f)[_0x5ad9('0x23')](_0x4f3889);};}exports[_0x5ad9('0x24')]=function(_0x49b3df,_0x509d41){var _0x3942fa={},_0x129804={},_0x1b6faf={'count':0x0,'rows':[]};var _0x2ad078=_[_0x5ad9('0x25')](db[_0x5ad9('0x26')]['rawAttributes'],function(_0x132ec6){return{'name':_0x132ec6[_0x5ad9('0x27')],'type':_0x132ec6[_0x5ad9('0x28')][_0x5ad9('0x29')]};});_0x129804['model']=_['map'](_0x2ad078,_0x5ad9('0x22'));_0x129804[_0x5ad9('0x2a')]=_['keys'](_0x49b3df['query']);_0x129804['filters']=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],_0x129804['query']);_0x3942fa[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],qs[_0x5ad9('0x2e')](_0x49b3df['query']['fields']));_0x3942fa[_0x5ad9('0x2d')]=_0x3942fa[_0x5ad9('0x2d')][_0x5ad9('0x2f')]?_0x3942fa[_0x5ad9('0x2d')]:_0x129804[_0x5ad9('0x2c')];if(!_0x49b3df['query'][_0x5ad9('0x30')](_0x5ad9('0x31'))){_0x3942fa[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x18')]);_0x3942fa['offset']=qs[_0x5ad9('0x16')](_0x49b3df[_0x5ad9('0x2a')]['offset']);}_0x3942fa[_0x5ad9('0x32')]=qs[_0x5ad9('0x33')](_0x49b3df['query'][_0x5ad9('0x33')]);_0x3942fa[_0x5ad9('0x34')]=qs[_0x5ad9('0x35')](_['pick'](_0x49b3df[_0x5ad9('0x2a')],_0x129804[_0x5ad9('0x35')]),_0x2ad078);if(_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x36')]){_0x3942fa['where']=_[_0x5ad9('0x37')](_0x3942fa[_0x5ad9('0x34')],{'$or':_[_0x5ad9('0x25')](_0x2ad078,function(_0x143700){if(_0x143700[_0x5ad9('0x28')]!==_0x5ad9('0x38')){var _0x1f0c06={};_0x1f0c06[_0x143700[_0x5ad9('0x22')]]={'$like':'%'+_0x49b3df[_0x5ad9('0x2a')]['filter']+'%'};return _0x1f0c06;}})});}_0x3942fa=_[_0x5ad9('0x37')]({},_0x3942fa,_0x49b3df[_0x5ad9('0x39')]);var _0x41d733={'where':_0x3942fa[_0x5ad9('0x34')]};return db[_0x5ad9('0x26')]['count'](_0x41d733)[_0x5ad9('0x1f')](function(_0xbbfaa0){_0x1b6faf[_0x5ad9('0x19')]=_0xbbfaa0;if(_0x49b3df['query'][_0x5ad9('0x3a')]){_0x3942fa[_0x5ad9('0x3b')]=[{'all':!![]}];}return db[_0x5ad9('0x26')]['findAll'](_0x3942fa);})[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x1b6faf['rows']=_0x5cfe5b;return _0x1b6faf;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x509d41,_0x3942fa))[_0x5ad9('0x3c')](handleError(_0x509d41,null));};exports[_0x5ad9('0x3d')]=function(_0x24f377,_0x5b8608){var _0x526fda={'raw':!![],'where':{'id':_0x24f377['params']['id']}},_0x552c39={};_0x552c39[_0x5ad9('0x2c')]=_['keys'](db[_0x5ad9('0x26')]['rawAttributes']);_0x552c39[_0x5ad9('0x2a')]=_[_0x5ad9('0x3e')](_0x24f377[_0x5ad9('0x2a')]);_0x552c39[_0x5ad9('0x35')]=_[_0x5ad9('0x2b')](_0x552c39[_0x5ad9('0x2c')],_0x552c39[_0x5ad9('0x2a')]);_0x526fda[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x552c39['model'],qs[_0x5ad9('0x2e')](_0x24f377[_0x5ad9('0x2a')][_0x5ad9('0x2e')]));_0x526fda[_0x5ad9('0x2d')]=_0x526fda[_0x5ad9('0x2d')]['length']?_0x526fda[_0x5ad9('0x2d')]:_0x552c39['model'];if(_0x24f377['query']['includeAll']){_0x526fda[_0x5ad9('0x3b')]=[{'all':!![]}];}_0x526fda=_[_0x5ad9('0x37')]({},_0x526fda,_0x24f377[_0x5ad9('0x39')]);return db['FreshdeskField'][_0x5ad9('0x3f')](_0x526fda)[_0x5ad9('0x1f')](handleEntityNotFound(_0x5b8608,null))[_0x5ad9('0x1f')](respondWithResult(_0x5b8608,null))[_0x5ad9('0x3c')](handleError(_0x5b8608,null));};exports['create']=function(_0x126086,_0x420677){return db[_0x5ad9('0x26')][_0x5ad9('0x40')](_0x126086['body'],{})[_0x5ad9('0x1f')](respondWithResult(_0x420677,0xc9))[_0x5ad9('0x3c')](handleError(_0x420677,null));};exports[_0x5ad9('0x1d')]=function(_0x1e03f,_0x479bbc){if(_0x1e03f[_0x5ad9('0x41')]['id']){delete _0x1e03f[_0x5ad9('0x41')]['id'];}return db['FreshdeskField'][_0x5ad9('0x3f')]({'where':{'id':_0x1e03f['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x479bbc,null))[_0x5ad9('0x1f')](saveUpdates(_0x1e03f[_0x5ad9('0x41')],null))[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,null))[_0x5ad9('0x3c')](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1e')]=function(_0xa0f426,_0x2c3945){return db[_0x5ad9('0x26')][_0x5ad9('0x3f')]({'where':{'id':_0xa0f426[_0x5ad9('0x42')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x2c3945,null))[_0x5ad9('0x1f')](removeEntity(_0x2c3945,null))[_0x5ad9('0x3c')](handleError(_0x2c3945,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e2c131d..dc1b6ec 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 _0xade7=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x594f36,_0x4b4389){var _0x529fae=function(_0x22fcdb){while(--_0x22fcdb){_0x594f36['push'](_0x594f36['shift']());}};_0x529fae(++_0x4b4389);}(_0xade7,0xd8));var _0x7ade=function(_0x4c9e31,_0x13568b){_0x4c9e31=_0x4c9e31-0x0;var _0x386208=_0xade7[_0x4c9e31];return _0x386208;};'use strict';var _=require(_0x7ade('0x0'));var util=require(_0x7ade('0x1'));var logger=require('../../config/logger')(_0x7ade('0x2'));var moment=require(_0x7ade('0x3'));var BPromise=require(_0x7ade('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ade('0x5'));var config=require(_0x7ade('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x7ade('0x7')]=function(_0x499c20,_0x12f2c7){return _0x499c20[_0x7ade('0x8')](_0x7ade('0x9'),attributes,{'tableName':_0x7ade('0xa'),'paranoid':![],'indexes':[{'name':_0x7ade('0xb'),'fields':[_0x7ade('0xc'),_0x7ade('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe43d=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','idField','../../config/logger','api','moment'];(function(_0x48bd02,_0x46cfbe){var _0x44f7e0=function(_0x4fb8a3){while(--_0x4fb8a3){_0x48bd02['push'](_0x48bd02['shift']());}};_0x44f7e0(++_0x46cfbe);}(_0xe43d,0x75));var _0xde43=function(_0x1602fd,_0x847115){_0x1602fd=_0x1602fd-0x0;var _0x1eaf42=_0xe43d[_0x1602fd];return _0x1eaf42;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde43('0x0'))(_0xde43('0x1'));var moment=require(_0xde43('0x2'));var BPromise=require(_0xde43('0x3'));var rp=require(_0xde43('0x4'));var fs=require('fs');var path=require(_0xde43('0x5'));var rimraf=require(_0xde43('0x6'));var config=require(_0xde43('0x7'));var attributes=require(_0xde43('0x8'));module['exports']=function(_0x4dce9d,_0x5b21e6){return _0x4dce9d[_0xde43('0x9')](_0xde43('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xde43('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index cc96e14..0207a0e 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 _0x69af=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x69af,0x17b));var _0xf69a=function(_0x4f6db1,_0x25745f){_0x4f6db1=_0x4f6db1-0x0;var _0x14fd09=_0x69af[_0x4f6db1];return _0x14fd09;};'use strict';var _=require('lodash');var util=require(_0xf69a('0x0'));var moment=require(_0xf69a('0x1'));var BPromise=require(_0xf69a('0x2'));var rs=require(_0xf69a('0x3'));var fs=require('fs');var Redis=require(_0xf69a('0x4'));var db=require(_0xf69a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69a('0x6'))(_0xf69a('0x7'));var config=require(_0xf69a('0x8'));var jayson=require(_0xf69a('0x9'));var client=jayson[_0xf69a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c1b0,_0x3669ef,_0xb0233d){return new BPromise(function(_0x4ffe11,_0x4a3496){return client[_0xf69a('0xb')](_0x10c1b0,_0xb0233d)[_0xf69a('0xc')](function(_0x16a06e){logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3669ef,_0xf69a('0xf'),JSON[_0xf69a('0x10')](_0x16a06e));if(_0x16a06e[_0xf69a('0x11')]){if(_0x16a06e[_0xf69a('0x11')]['code']===0x1f4){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4a3496(_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);}logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4ffe11(_0x16a06e['error'][_0xf69a('0x12')]);}else{logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,_0xf69a('0xf'));_0x4ffe11(_0x16a06e['result'][_0xf69a('0x12')]);}})[_0xf69a('0x13')](function(_0x17660b){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x17660b);_0x4a3496(_0x17660b);});});} \ No newline at end of file +var _0xbedd=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xbedd,0x126));var _0xdbed=function(_0x4c4a8b,_0x402020){_0x4c4a8b=_0x4c4a8b-0x0;var _0x20fa14=_0xbedd[_0x4c4a8b];return _0x20fa14;};'use strict';var _=require(_0xdbed('0x0'));var util=require(_0xdbed('0x1'));var moment=require(_0xdbed('0x2'));var BPromise=require(_0xdbed('0x3'));var rs=require(_0xdbed('0x4'));var fs=require('fs');var Redis=require(_0xdbed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbed('0x6'));var logger=require('../../config/logger')(_0xdbed('0x7'));var config=require(_0xdbed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdbed('0x9')][_0xdbed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x579f76,_0x4dd47d,_0x372278){return new BPromise(function(_0x302b8b,_0x47e797){return client[_0xdbed('0xb')](_0x579f76,_0x372278)['then'](function(_0x3df3d7){logger[_0xdbed('0xc')](_0xdbed('0xd'),_0x4dd47d,'request\x20sent');logger[_0xdbed('0xe')](_0xdbed('0xf'),_0x4dd47d,_0xdbed('0x10'),JSON[_0xdbed('0x11')](_0x3df3d7));if(_0x3df3d7['error']){if(_0x3df3d7[_0xdbed('0x12')][_0xdbed('0x13')]===0x1f4){logger[_0xdbed('0x12')](_0xdbed('0xd'),_0x4dd47d,_0x3df3d7['error'][_0xdbed('0x14')]);return _0x47e797(_0x3df3d7[_0xdbed('0x12')]['message']);}logger[_0xdbed('0x12')](_0xdbed('0xd'),_0x4dd47d,_0x3df3d7[_0xdbed('0x12')][_0xdbed('0x14')]);return _0x302b8b(_0x3df3d7[_0xdbed('0x12')]['message']);}else{logger[_0xdbed('0xc')](_0xdbed('0xd'),_0x4dd47d,'request\x20sent');_0x302b8b(_0x3df3d7[_0xdbed('0x15')][_0xdbed('0x14')]);}})['catch'](function(_0x28759b){logger['error'](_0xdbed('0xd'),_0x4dd47d,_0x28759b);_0x47e797(_0x28759b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0a28974..53f9916 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 _0xe706=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x1d5f68,_0x5d9d3f){var _0x4b8437=function(_0x5b8e8d){while(--_0x5b8e8d){_0x1d5f68['push'](_0x1d5f68['shift']());}};_0x4b8437(++_0x5d9d3f);}(_0xe706,0xa3));var _0x6e70=function(_0x24e0c9,_0x284109){_0x24e0c9=_0x24e0c9-0x0;var _0x4448f0=_0xe706[_0x24e0c9];return _0x4448f0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),controller['create']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x18')]=router; \ No newline at end of file +var _0x1c7c=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x52d4ee,_0x64e207){var _0x51d053=function(_0x32b659){while(--_0x32b659){_0x52d4ee['push'](_0x52d4ee['shift']());}};_0x51d053(++_0x64e207);}(_0x1c7c,0x164));var _0xc1c7=function(_0x59fbd9,_0x1a4e48){_0x59fbd9=_0x59fbd9-0x0;var _0x12f3df=_0x1c7c[_0x59fbd9];return _0x12f3df;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1c7('0x5'));var interaction=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var controller=require(_0xc1c7('0x8'));router[_0xc1c7('0x9')]('/',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xb')]);router[_0xc1c7('0x9')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xd')]);router[_0xc1c7('0x9')](_0xc1c7('0xe'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xf')]);router[_0xc1c7('0x9')](_0xc1c7('0x10'),auth['isAuthenticated'](),controller[_0xc1c7('0x11')]);router[_0xc1c7('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1c7('0x13')]);router[_0xc1c7('0x12')](_0xc1c7('0xe'),auth['isAuthenticated'](),controller[_0xc1c7('0x14')]);router[_0xc1c7('0x15')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x16')]);router[_0xc1c7('0x17')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x18')]);module[_0xc1c7('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b35dcae..3067f3c 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 _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x41ad38,_0x160262){var _0x5c240b=function(_0x580d62){while(--_0x580d62){_0x41ad38['push'](_0x41ad38['shift']());}};_0x5c240b(++_0x160262);}(_0xd943,0x15d));var _0x3d94=function(_0x4f15e8,_0xd1e2c2){_0x4f15e8=_0x4f15e8-0x0;var _0xc4a1f2=_0xd943[_0x4f15e8];return _0xc4a1f2;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x32f4=['sequelize','exports','STRING','username','remoteUri'];(function(_0x1306f3,_0x1da761){var _0xc1c7bf=function(_0x1ca08e){while(--_0x1ca08e){_0x1306f3['push'](_0x1306f3['shift']());}};_0xc1c7bf(++_0x1da761);}(_0x32f4,0x154));var _0x432f=function(_0x104699,_0x231d25){_0x104699=_0x104699-0x0;var _0x515a00=_0x32f4[_0x104699];return _0x515a00;};'use strict';var Sequelize=require(_0x432f('0x0'));module[_0x432f('0x1')]={'name':{'type':Sequelize[_0x432f('0x2')]},'description':{'type':Sequelize[_0x432f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x432f('0x3')},'apiKey':{'type':Sequelize[_0x432f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x432f('0x4')},'serverUrl':{'type':Sequelize[_0x432f('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 f17183f..315ad87 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 _0xac3e=['undefined','count','set','apply','save','then','destroy','error','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','where','filter','merge','includeAll','include','findAll','show','params','length','options','find','catch','create','body','update','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x4fbdc0,_0x5bf025){var _0x2ed5b4=function(_0x1d87f0){while(--_0x1d87f0){_0x4fbdc0['push'](_0x4fbdc0['shift']());}};_0x2ed5b4(++_0x5bf025);}(_0xac3e,0x164));var _0xeac3=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0xac3e[_0x5db99b];return _0x4b2d0e;};'use strict';var emlformat=require(_0xeac3('0x0'));var rimraf=require(_0xeac3('0x1'));var zipdir=require(_0xeac3('0x2'));var jsonpatch=require(_0xeac3('0x3'));var rp=require('request-promise');var moment=require(_0xeac3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeac3('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeac3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeac3('0x7'));var squel=require(_0xeac3('0x8'));var crypto=require(_0xeac3('0x9'));var jsforce=require(_0xeac3('0xa'));var deskjs=require(_0xeac3('0xb'));var toCsv=require(_0xeac3('0xc'));var querystring=require(_0xeac3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeac3('0xe'));var qs=require(_0xeac3('0xf'));var as=require(_0xeac3('0x10'));var hardwareService=require(_0xeac3('0x11'));var logger=require('../../config/logger')(_0xeac3('0x12'));var utils=require('../../config/utils');var config=require(_0xeac3('0x13'));var licenseUtil=require(_0xeac3('0x14'));var db=require(_0xeac3('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2c381f,_0x502d92){_0x502d92=_0x502d92||0xcc;return function(_0x31d63d){if(_0x31d63d){return _0x2c381f[_0xeac3('0x16')](_0x502d92);}return _0x2c381f[_0xeac3('0x17')](_0x502d92)[_0xeac3('0x18')]();};}function respondWithResult(_0x58c186,_0xcf2ac4){_0xcf2ac4=_0xcf2ac4||0xc8;return function(_0x4285b8){if(_0x4285b8){return _0x58c186['status'](_0xcf2ac4)[_0xeac3('0x19')](_0x4285b8);}};}function respondWithFilteredResult(_0x444ded,_0x2e4daa){return function(_0x44b082){if(_0x44b082){var _0x10152b=typeof _0x2e4daa[_0xeac3('0x1a')]==='undefined'&&typeof _0x2e4daa[_0xeac3('0x1b')]===_0xeac3('0x1c');var _0x199108=_0x44b082[_0xeac3('0x1d')];var _0x3404ed=_0x10152b?0x0:_0x2e4daa[_0xeac3('0x1a')];var _0x2267a8=_0x10152b?_0x44b082[_0xeac3('0x1d')]:_0x2e4daa[_0xeac3('0x1a')]+_0x2e4daa['limit'];var _0x43c321;if(_0x2267a8>=_0x199108){_0x2267a8=_0x199108;_0x43c321=0xc8;}else{_0x43c321=0xce;}_0x444ded[_0xeac3('0x17')](_0x43c321);return _0x444ded[_0xeac3('0x1e')]('Content-Range',_0x3404ed+'-'+_0x2267a8+'/'+_0x199108)[_0xeac3('0x19')](_0x44b082);}return null;};}function patchUpdates(_0x269d2c){return function(_0x4d2e66){try{jsonpatch[_0xeac3('0x1f')](_0x4d2e66,_0x269d2c,!![]);}catch(_0xf4a0c3){return BPromise['reject'](_0xf4a0c3);}return _0x4d2e66[_0xeac3('0x20')]();};}function saveUpdates(_0x20e3c2,_0x5efa9e){return function(_0x3ee41e){if(_0x3ee41e){return _0x3ee41e['update'](_0x20e3c2)[_0xeac3('0x21')](function(_0xa82d4b){return _0xa82d4b;});}return null;};}function removeEntity(_0x2a6df0,_0xa66171){return function(_0x3c85a7){if(_0x3c85a7){return _0x3c85a7[_0xeac3('0x22')]()[_0xeac3('0x21')](function(){_0x2a6df0[_0xeac3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8172,_0x15813e){return function(_0x163f7d){if(!_0x163f7d){_0x5c8172[_0xeac3('0x16')](0x194);}return _0x163f7d;};}function handleError(_0x2fd0a9,_0x28340e){_0x28340e=_0x28340e||0x1f4;return function(_0x34ad48){logger[_0xeac3('0x23')](_0x34ad48['stack']);if(_0x34ad48['name']){delete _0x34ad48[_0xeac3('0x24')];}_0x2fd0a9['status'](_0x28340e)[_0xeac3('0x25')](_0x34ad48);};}exports[_0xeac3('0x26')]=function(_0x30aea,_0x1218a7){var _0x67ec2e={},_0x1d3df3={},_0x213374={'count':0x0,'rows':[]};var _0x53fc59=_['map'](db[_0xeac3('0x27')][_0xeac3('0x28')],function(_0x57d89f){return{'name':_0x57d89f[_0xeac3('0x29')],'type':_0x57d89f[_0xeac3('0x2a')]['key']};});_0x1d3df3[_0xeac3('0x2b')]=_[_0xeac3('0x2c')](_0x53fc59,_0xeac3('0x24'));_0x1d3df3[_0xeac3('0x2d')]=_[_0xeac3('0x2e')](_0x30aea[_0xeac3('0x2d')]);_0x1d3df3['filters']=_[_0xeac3('0x2f')](_0x1d3df3[_0xeac3('0x2b')],_0x1d3df3['query']);_0x67ec2e[_0xeac3('0x30')]=_[_0xeac3('0x2f')](_0x1d3df3[_0xeac3('0x2b')],qs[_0xeac3('0x31')](_0x30aea[_0xeac3('0x2d')][_0xeac3('0x31')]));_0x67ec2e['attributes']=_0x67ec2e[_0xeac3('0x30')]['length']?_0x67ec2e[_0xeac3('0x30')]:_0x1d3df3['model'];if(!_0x30aea['query']['hasOwnProperty'](_0xeac3('0x32'))){_0x67ec2e[_0xeac3('0x1b')]=qs[_0xeac3('0x1b')](_0x30aea[_0xeac3('0x2d')][_0xeac3('0x1b')]);_0x67ec2e[_0xeac3('0x1a')]=qs[_0xeac3('0x1a')](_0x30aea[_0xeac3('0x2d')][_0xeac3('0x1a')]);}_0x67ec2e[_0xeac3('0x33')]=qs[_0xeac3('0x34')](_0x30aea[_0xeac3('0x2d')][_0xeac3('0x34')]);_0x67ec2e['where']=qs[_0xeac3('0x35')](_[_0xeac3('0x36')](_0x30aea[_0xeac3('0x2d')],_0x1d3df3[_0xeac3('0x35')]),_0x53fc59);if(_0x30aea[_0xeac3('0x2d')]['filter']){_0x67ec2e[_0xeac3('0x37')]=_['merge'](_0x67ec2e['where'],{'$or':_[_0xeac3('0x2c')](_0x53fc59,function(_0x1ea804){if(_0x1ea804['type']!=='VIRTUAL'){var _0x30f0d7={};_0x30f0d7[_0x1ea804[_0xeac3('0x24')]]={'$like':'%'+_0x30aea['query'][_0xeac3('0x38')]+'%'};return _0x30f0d7;}})});}_0x67ec2e=_[_0xeac3('0x39')]({},_0x67ec2e,_0x30aea['options']);var _0x150875={'where':_0x67ec2e[_0xeac3('0x37')]};return db['FreshsalesAccount']['count'](_0x150875)[_0xeac3('0x21')](function(_0x83a7fe){_0x213374[_0xeac3('0x1d')]=_0x83a7fe;if(_0x30aea[_0xeac3('0x2d')][_0xeac3('0x3a')]){_0x67ec2e[_0xeac3('0x3b')]=[{'all':!![]}];}return db[_0xeac3('0x27')][_0xeac3('0x3c')](_0x67ec2e);})['then'](function(_0x20295f){_0x213374['rows']=_0x20295f;return _0x213374;})[_0xeac3('0x21')](respondWithFilteredResult(_0x1218a7,_0x67ec2e))['catch'](handleError(_0x1218a7,null));};exports[_0xeac3('0x3d')]=function(_0x51e9ad,_0x248ba1){var _0xbb6c4e={'raw':![],'where':{'id':_0x51e9ad[_0xeac3('0x3e')]['id']}},_0x52be66={};_0x52be66[_0xeac3('0x2b')]=_['keys'](db[_0xeac3('0x27')][_0xeac3('0x28')]);_0x52be66[_0xeac3('0x2d')]=_[_0xeac3('0x2e')](_0x51e9ad[_0xeac3('0x2d')]);_0x52be66[_0xeac3('0x35')]=_['intersection'](_0x52be66[_0xeac3('0x2b')],_0x52be66[_0xeac3('0x2d')]);_0xbb6c4e['attributes']=_[_0xeac3('0x2f')](_0x52be66[_0xeac3('0x2b')],qs[_0xeac3('0x31')](_0x51e9ad[_0xeac3('0x2d')][_0xeac3('0x31')]));_0xbb6c4e['attributes']=_0xbb6c4e[_0xeac3('0x30')][_0xeac3('0x3f')]?_0xbb6c4e[_0xeac3('0x30')]:_0x52be66[_0xeac3('0x2b')];if(_0x51e9ad[_0xeac3('0x2d')][_0xeac3('0x3a')]){_0xbb6c4e[_0xeac3('0x3b')]=[{'all':!![]}];}_0xbb6c4e=_['merge']({},_0xbb6c4e,_0x51e9ad[_0xeac3('0x40')]);return db['FreshsalesAccount'][_0xeac3('0x41')](_0xbb6c4e)[_0xeac3('0x21')](handleEntityNotFound(_0x248ba1,null))[_0xeac3('0x21')](respondWithResult(_0x248ba1,null))[_0xeac3('0x42')](handleError(_0x248ba1,null));};exports['create']=function(_0x319a79,_0x3d9b73){return db[_0xeac3('0x27')][_0xeac3('0x43')](_0x319a79[_0xeac3('0x44')],{})[_0xeac3('0x21')](respondWithResult(_0x3d9b73,0xc9))[_0xeac3('0x42')](handleError(_0x3d9b73,null));};exports[_0xeac3('0x45')]=function(_0x18eac7,_0x343a58){if(_0x18eac7[_0xeac3('0x44')]['id']){delete _0x18eac7[_0xeac3('0x44')]['id'];}return db[_0xeac3('0x27')][_0xeac3('0x41')]({'where':{'id':_0x18eac7[_0xeac3('0x3e')]['id']}})[_0xeac3('0x21')](handleEntityNotFound(_0x343a58,null))[_0xeac3('0x21')](saveUpdates(_0x18eac7[_0xeac3('0x44')],null))[_0xeac3('0x21')](respondWithResult(_0x343a58,null))['catch'](handleError(_0x343a58,null));};exports['destroy']=function(_0x1b4691,_0x21ab1e){return db[_0xeac3('0x27')][_0xeac3('0x41')]({'where':{'id':_0x1b4691[_0xeac3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x21ab1e,null))[_0xeac3('0x21')](removeEntity(_0x21ab1e,null))[_0xeac3('0x42')](handleError(_0x21ab1e,null));};exports[_0xeac3('0x46')]=function(_0x36f83c,_0x8796e5,_0x27c7b2){var _0x1c8852={};var _0x520c66={};var _0x1243ec;var _0x3f3f50;return db['FreshsalesAccount'][_0xeac3('0x47')]({'where':{'id':_0x36f83c[_0xeac3('0x3e')]['id']}})[_0xeac3('0x21')](handleEntityNotFound(_0x8796e5,null))['then'](function(_0x263b6b){if(_0x263b6b){_0x1243ec=_0x263b6b;_0x520c66[_0xeac3('0x2b')]=_[_0xeac3('0x2e')](db[_0xeac3('0x48')]['rawAttributes']);_0x520c66[_0xeac3('0x2d')]=_[_0xeac3('0x2e')](_0x36f83c[_0xeac3('0x2d')]);_0x520c66[_0xeac3('0x35')]=_[_0xeac3('0x2f')](_0x520c66[_0xeac3('0x2b')],_0x520c66['query']);_0x1c8852[_0xeac3('0x30')]=_[_0xeac3('0x2f')](_0x520c66[_0xeac3('0x2b')],qs[_0xeac3('0x31')](_0x36f83c[_0xeac3('0x2d')][_0xeac3('0x31')]));_0x1c8852[_0xeac3('0x30')]=_0x1c8852['attributes'][_0xeac3('0x3f')]?_0x1c8852[_0xeac3('0x30')]:_0x520c66[_0xeac3('0x2b')];_0x1c8852[_0xeac3('0x33')]=qs[_0xeac3('0x34')](_0x36f83c['query'][_0xeac3('0x34')]);_0x1c8852[_0xeac3('0x37')]=qs[_0xeac3('0x35')](_['pick'](_0x36f83c[_0xeac3('0x2d')],_0x520c66[_0xeac3('0x35')]));if(_0x36f83c['query']['filter']){_0x1c8852[_0xeac3('0x37')]=_[_0xeac3('0x39')](_0x1c8852[_0xeac3('0x37')],{'$or':_['map'](_0x1c8852[_0xeac3('0x30')],function(_0x526755){var _0x3fb593={};_0x3fb593[_0x526755]={'$like':'%'+_0x36f83c[_0xeac3('0x2d')]['filter']+'%'};return _0x3fb593;})});}_0x1c8852=_[_0xeac3('0x39')]({},_0x1c8852,_0x36f83c[_0xeac3('0x40')]);return _0x1243ec[_0xeac3('0x46')](_0x1c8852);}})[_0xeac3('0x21')](function(_0x266afe){if(_0x266afe){_0x3f3f50=_0x266afe[_0xeac3('0x3f')];if(!_0x36f83c[_0xeac3('0x2d')][_0xeac3('0x49')](_0xeac3('0x32'))){_0x1c8852['limit']=qs[_0xeac3('0x1b')](_0x36f83c[_0xeac3('0x2d')]['limit']);_0x1c8852[_0xeac3('0x1a')]=qs[_0xeac3('0x1a')](_0x36f83c[_0xeac3('0x2d')]['offset']);}return _0x1243ec[_0xeac3('0x46')](_0x1c8852);}})[_0xeac3('0x21')](function(_0x5d2972){if(_0x5d2972){return _0x5d2972?{'count':_0x3f3f50,'rows':_0x5d2972}:null;}})[_0xeac3('0x21')](respondWithResult(_0x8796e5,null))['catch'](handleError(_0x8796e5,null));};exports[_0xeac3('0x4a')]=function(_0x407de9,_0x4b3f71,_0x47eb58){if(_0x407de9['body']['id']){delete _0x407de9[_0xeac3('0x44')]['id'];}return db[_0xeac3('0x27')][_0xeac3('0x47')]({'where':{'id':_0x407de9[_0xeac3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4b3f71,null))[_0xeac3('0x21')](function(_0x18bc03){if(_0x18bc03){_0x407de9['body'][_0xeac3('0x4b')]=_0x18bc03['id'];_0x407de9[_0xeac3('0x44')][_0xeac3('0x4c')]=integrations['getSubjects'](_0x407de9[_0xeac3('0x44')][_0xeac3('0x4d')],_0x407de9[_0xeac3('0x44')]['type']);_0x407de9[_0xeac3('0x44')][_0xeac3('0x4e')]=integrations[_0xeac3('0x4f')](_0x407de9[_0xeac3('0x44')][_0xeac3('0x4d')],_0x407de9['body'][_0xeac3('0x2a')]);return db[_0xeac3('0x48')][_0xeac3('0x43')](_0x407de9[_0xeac3('0x44')],{'include':[{'model':db[_0xeac3('0x50')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0xeac3('0x21')](respondWithResult(_0x4b3f71,null))[_0xeac3('0x42')](handleError(_0x4b3f71,null));};exports['getFields']=function(_0x501314,_0x488ff3,_0x5c1002){var _0x398eae='';var _0x4e8a96='';return db[_0xeac3('0x27')][_0xeac3('0x47')]({'where':{'id':_0x501314[_0xeac3('0x3e')]['id']},'attributes':['id',_0xeac3('0x51'),_0xeac3('0x52'),_0xeac3('0x53')]})[_0xeac3('0x21')](handleEntityNotFound(_0x488ff3,null))['then'](function(_0x3e0852){if(_0x3e0852){_0x4e8a96=_0x3e0852[_0xeac3('0x51')];_0x398eae=_0x3e0852[_0xeac3('0x52')];var _0x1c8cfa=_0x3e0852[_0xeac3('0x52')][_0xeac3('0x54')](-0x1);if(_0x1c8cfa==='/'){_0x398eae=_0x398eae[_0xeac3('0x55')](0x0,_0x398eae[_0xeac3('0x56')](_0x1c8cfa));}return rp({'method':_0xeac3('0x57'),'uri':util['format'](_0xeac3('0x58'),_0x398eae,'/api/selector/owners'),'headers':{'Authorization':_0xeac3('0x59')+_0x3e0852[_0xeac3('0x53')]},'json':!![]});}})[_0xeac3('0x21')](function(_0x566f03){if(_0x566f03){var _0x2a970f=_0x566f03[_0xeac3('0x5a')];var _0x580584=![];var _0x445fcb=null;for(_0x445fcb=0x0;_0x445fcb<_0x2a970f['length'];_0x445fcb++){if(_0x2a970f[_0x445fcb]['email']===_0x4e8a96){_0x580584=!![];}}if(_0x580584){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xeac3('0x5b')});}}})[_0xeac3('0x21')](respondWithResult(_0x488ff3,null))[_0xeac3('0x42')](function(_0x312a10){var _0x4cbefc=_0x501314[_0xeac3('0x2d')][_0xeac3('0x5c')]?0x1f4:_0x312a10[_0xeac3('0x5d')]||0x1f4;logger[_0xeac3('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4cbefc,JSON[_0xeac3('0x5e')](_0x312a10));delete _0x312a10['name'];if(_0x4cbefc===0x191){_0x4cbefc=0x190;}_0x488ff3['status'](_0x4cbefc)[_0xeac3('0x25')](_0x501314[_0xeac3('0x2d')][_0xeac3('0x5c')]?{'message':_0xeac3('0x5f'),'statusCode':_0x312a10[_0xeac3('0x5d')]}:_0x312a10);});}; \ No newline at end of file +var _0x3b65=['count','set','Content-Range','apply','save','then','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','getConfigurations','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','test','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','util','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit'];(function(_0x110c22,_0x4be638){var _0x121869=function(_0x2a7468){while(--_0x2a7468){_0x110c22['push'](_0x110c22['shift']());}};_0x121869(++_0x4be638);}(_0x3b65,0x163));var _0x53b6=function(_0x13161b,_0x498638){_0x13161b=_0x13161b-0x0;var _0x396bd1=_0x3b65[_0x13161b];return _0x396bd1;};'use strict';var emlformat=require(_0x53b6('0x0'));var rimraf=require(_0x53b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53b6('0x2'));var rp=require(_0x53b6('0x3'));var moment=require(_0x53b6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x53b6('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53b6('0x6'));var squel=require(_0x53b6('0x7'));var crypto=require(_0x53b6('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x53b6('0x9'));var toCsv=require(_0x53b6('0xa'));var querystring=require(_0x53b6('0xb'));var Papa=require(_0x53b6('0xc'));var Redis=require(_0x53b6('0xd'));var authService=require(_0x53b6('0xe'));var qs=require(_0x53b6('0xf'));var as=require(_0x53b6('0x10'));var hardwareService=require(_0x53b6('0x11'));var logger=require(_0x53b6('0x12'))(_0x53b6('0x13'));var utils=require(_0x53b6('0x14'));var config=require(_0x53b6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x53b6('0x16'))['db'];var integrations=require(_0x53b6('0x17'));function respondWithStatusCode(_0x313e19,_0x5a4f48){_0x5a4f48=_0x5a4f48||0xcc;return function(_0xea208a){if(_0xea208a){return _0x313e19['sendStatus'](_0x5a4f48);}return _0x313e19[_0x53b6('0x18')](_0x5a4f48)[_0x53b6('0x19')]();};}function respondWithResult(_0x4ecec9,_0x424e50){_0x424e50=_0x424e50||0xc8;return function(_0x28b453){if(_0x28b453){return _0x4ecec9[_0x53b6('0x18')](_0x424e50)[_0x53b6('0x1a')](_0x28b453);}};}function respondWithFilteredResult(_0xef9dd0,_0x4351eb){return function(_0x21fec3){if(_0x21fec3){var _0x1028c0=typeof _0x4351eb[_0x53b6('0x1b')]==='undefined'&&typeof _0x4351eb[_0x53b6('0x1c')]==='undefined';var _0x3be130=_0x21fec3[_0x53b6('0x1d')];var _0x5abad4=_0x1028c0?0x0:_0x4351eb[_0x53b6('0x1b')];var _0x58e719=_0x1028c0?_0x21fec3[_0x53b6('0x1d')]:_0x4351eb[_0x53b6('0x1b')]+_0x4351eb[_0x53b6('0x1c')];var _0x215773;if(_0x58e719>=_0x3be130){_0x58e719=_0x3be130;_0x215773=0xc8;}else{_0x215773=0xce;}_0xef9dd0['status'](_0x215773);return _0xef9dd0[_0x53b6('0x1e')](_0x53b6('0x1f'),_0x5abad4+'-'+_0x58e719+'/'+_0x3be130)[_0x53b6('0x1a')](_0x21fec3);}return null;};}function patchUpdates(_0x4feea4){return function(_0x5cf60e){try{jsonpatch[_0x53b6('0x20')](_0x5cf60e,_0x4feea4,!![]);}catch(_0x1e5549){return BPromise['reject'](_0x1e5549);}return _0x5cf60e[_0x53b6('0x21')]();};}function saveUpdates(_0x1e3bc8,_0xe61609){return function(_0x437d69){if(_0x437d69){return _0x437d69['update'](_0x1e3bc8)['then'](function(_0x15213c){return _0x15213c;});}return null;};}function removeEntity(_0x220060,_0x26f204){return function(_0x2ad13a){if(_0x2ad13a){return _0x2ad13a['destroy']()[_0x53b6('0x22')](function(){_0x220060[_0x53b6('0x18')](0xcc)[_0x53b6('0x19')]();});}};}function handleEntityNotFound(_0x3be9a8,_0x451430){return function(_0x5c43cd){if(!_0x5c43cd){_0x3be9a8['sendStatus'](0x194);}return _0x5c43cd;};}function handleError(_0x322c58,_0x49f117){_0x49f117=_0x49f117||0x1f4;return function(_0x491a69){logger[_0x53b6('0x23')](_0x491a69[_0x53b6('0x24')]);if(_0x491a69[_0x53b6('0x25')]){delete _0x491a69[_0x53b6('0x25')];}_0x322c58[_0x53b6('0x18')](_0x49f117)[_0x53b6('0x26')](_0x491a69);};}exports['index']=function(_0xa89094,_0x227d00){var _0x405bc4={},_0x49c610={},_0x89286f={'count':0x0,'rows':[]};var _0x572cbd=_[_0x53b6('0x27')](db[_0x53b6('0x28')][_0x53b6('0x29')],function(_0x4b191b){return{'name':_0x4b191b['fieldName'],'type':_0x4b191b[_0x53b6('0x2a')]['key']};});_0x49c610[_0x53b6('0x2b')]=_[_0x53b6('0x27')](_0x572cbd,'name');_0x49c610[_0x53b6('0x2c')]=_[_0x53b6('0x2d')](_0xa89094[_0x53b6('0x2c')]);_0x49c610['filters']=_['intersection'](_0x49c610['model'],_0x49c610['query']);_0x405bc4[_0x53b6('0x2e')]=_[_0x53b6('0x2f')](_0x49c610[_0x53b6('0x2b')],qs['fields'](_0xa89094[_0x53b6('0x2c')][_0x53b6('0x30')]));_0x405bc4[_0x53b6('0x2e')]=_0x405bc4[_0x53b6('0x2e')][_0x53b6('0x31')]?_0x405bc4[_0x53b6('0x2e')]:_0x49c610[_0x53b6('0x2b')];if(!_0xa89094['query']['hasOwnProperty'](_0x53b6('0x32'))){_0x405bc4[_0x53b6('0x1c')]=qs[_0x53b6('0x1c')](_0xa89094[_0x53b6('0x2c')]['limit']);_0x405bc4[_0x53b6('0x1b')]=qs['offset'](_0xa89094[_0x53b6('0x2c')][_0x53b6('0x1b')]);}_0x405bc4['order']=qs[_0x53b6('0x33')](_0xa89094[_0x53b6('0x2c')][_0x53b6('0x33')]);_0x405bc4[_0x53b6('0x34')]=qs[_0x53b6('0x35')](_[_0x53b6('0x36')](_0xa89094['query'],_0x49c610[_0x53b6('0x35')]),_0x572cbd);if(_0xa89094[_0x53b6('0x2c')][_0x53b6('0x37')]){_0x405bc4[_0x53b6('0x34')]=_['merge'](_0x405bc4[_0x53b6('0x34')],{'$or':_[_0x53b6('0x27')](_0x572cbd,function(_0x444170){if(_0x444170['type']!==_0x53b6('0x38')){var _0x146412={};_0x146412[_0x444170[_0x53b6('0x25')]]={'$like':'%'+_0xa89094[_0x53b6('0x2c')]['filter']+'%'};return _0x146412;}})});}_0x405bc4=_[_0x53b6('0x39')]({},_0x405bc4,_0xa89094[_0x53b6('0x3a')]);var _0x5b526b={'where':_0x405bc4[_0x53b6('0x34')]};return db['FreshsalesAccount'][_0x53b6('0x1d')](_0x5b526b)[_0x53b6('0x22')](function(_0x14e516){_0x89286f['count']=_0x14e516;if(_0xa89094['query'][_0x53b6('0x3b')]){_0x405bc4[_0x53b6('0x3c')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x53b6('0x3d')](_0x405bc4);})[_0x53b6('0x22')](function(_0x1d5150){_0x89286f[_0x53b6('0x3e')]=_0x1d5150;return _0x89286f;})['then'](respondWithFilteredResult(_0x227d00,_0x405bc4))[_0x53b6('0x3f')](handleError(_0x227d00,null));};exports['show']=function(_0x4822f1,_0x1e57a7){var _0xc40c5e={'raw':![],'where':{'id':_0x4822f1[_0x53b6('0x40')]['id']}},_0x33edc6={};_0x33edc6[_0x53b6('0x2b')]=_[_0x53b6('0x2d')](db[_0x53b6('0x28')][_0x53b6('0x29')]);_0x33edc6[_0x53b6('0x2c')]=_['keys'](_0x4822f1[_0x53b6('0x2c')]);_0x33edc6[_0x53b6('0x35')]=_['intersection'](_0x33edc6[_0x53b6('0x2b')],_0x33edc6[_0x53b6('0x2c')]);_0xc40c5e['attributes']=_[_0x53b6('0x2f')](_0x33edc6[_0x53b6('0x2b')],qs[_0x53b6('0x30')](_0x4822f1['query']['fields']));_0xc40c5e[_0x53b6('0x2e')]=_0xc40c5e[_0x53b6('0x2e')][_0x53b6('0x31')]?_0xc40c5e[_0x53b6('0x2e')]:_0x33edc6[_0x53b6('0x2b')];if(_0x4822f1[_0x53b6('0x2c')][_0x53b6('0x3b')]){_0xc40c5e[_0x53b6('0x3c')]=[{'all':!![]}];}_0xc40c5e=_[_0x53b6('0x39')]({},_0xc40c5e,_0x4822f1['options']);return db['FreshsalesAccount'][_0x53b6('0x41')](_0xc40c5e)[_0x53b6('0x22')](handleEntityNotFound(_0x1e57a7,null))[_0x53b6('0x22')](respondWithResult(_0x1e57a7,null))[_0x53b6('0x3f')](handleError(_0x1e57a7,null));};exports[_0x53b6('0x42')]=function(_0x26a796,_0xa3704f){return db[_0x53b6('0x28')][_0x53b6('0x42')](_0x26a796[_0x53b6('0x43')],{})[_0x53b6('0x22')](respondWithResult(_0xa3704f,0xc9))[_0x53b6('0x3f')](handleError(_0xa3704f,null));};exports[_0x53b6('0x44')]=function(_0x478fe3,_0x2d636f){if(_0x478fe3[_0x53b6('0x43')]['id']){delete _0x478fe3[_0x53b6('0x43')]['id'];}return db[_0x53b6('0x28')][_0x53b6('0x41')]({'where':{'id':_0x478fe3[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0x2d636f,null))[_0x53b6('0x22')](saveUpdates(_0x478fe3[_0x53b6('0x43')],null))[_0x53b6('0x22')](respondWithResult(_0x2d636f,null))['catch'](handleError(_0x2d636f,null));};exports[_0x53b6('0x45')]=function(_0x4f4e11,_0x1f1f4c){return db[_0x53b6('0x28')][_0x53b6('0x41')]({'where':{'id':_0x4f4e11[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0x1f1f4c,null))[_0x53b6('0x22')](removeEntity(_0x1f1f4c,null))['catch'](handleError(_0x1f1f4c,null));};exports[_0x53b6('0x46')]=function(_0x5c0a89,_0x3a6d83,_0x9157f2){var _0x1f06c1={};var _0x2c7900={};var _0x44969d;var _0x28657b;return db[_0x53b6('0x28')]['findOne']({'where':{'id':_0x5c0a89[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0x3a6d83,null))['then'](function(_0x39b76b){if(_0x39b76b){_0x44969d=_0x39b76b;_0x2c7900['model']=_[_0x53b6('0x2d')](db['FreshsalesConfiguration'][_0x53b6('0x29')]);_0x2c7900[_0x53b6('0x2c')]=_[_0x53b6('0x2d')](_0x5c0a89[_0x53b6('0x2c')]);_0x2c7900[_0x53b6('0x35')]=_['intersection'](_0x2c7900[_0x53b6('0x2b')],_0x2c7900[_0x53b6('0x2c')]);_0x1f06c1[_0x53b6('0x2e')]=_[_0x53b6('0x2f')](_0x2c7900[_0x53b6('0x2b')],qs[_0x53b6('0x30')](_0x5c0a89[_0x53b6('0x2c')][_0x53b6('0x30')]));_0x1f06c1[_0x53b6('0x2e')]=_0x1f06c1['attributes']['length']?_0x1f06c1['attributes']:_0x2c7900[_0x53b6('0x2b')];_0x1f06c1[_0x53b6('0x47')]=qs[_0x53b6('0x33')](_0x5c0a89[_0x53b6('0x2c')]['sort']);_0x1f06c1['where']=qs[_0x53b6('0x35')](_[_0x53b6('0x36')](_0x5c0a89['query'],_0x2c7900['filters']));if(_0x5c0a89[_0x53b6('0x2c')][_0x53b6('0x37')]){_0x1f06c1[_0x53b6('0x34')]=_[_0x53b6('0x39')](_0x1f06c1[_0x53b6('0x34')],{'$or':_['map'](_0x1f06c1[_0x53b6('0x2e')],function(_0x4c0e75){var _0x112fe7={};_0x112fe7[_0x4c0e75]={'$like':'%'+_0x5c0a89['query']['filter']+'%'};return _0x112fe7;})});}_0x1f06c1=_['merge']({},_0x1f06c1,_0x5c0a89[_0x53b6('0x3a')]);return _0x44969d[_0x53b6('0x46')](_0x1f06c1);}})[_0x53b6('0x22')](function(_0x2004f2){if(_0x2004f2){_0x28657b=_0x2004f2['length'];if(!_0x5c0a89[_0x53b6('0x2c')][_0x53b6('0x48')]('nolimit')){_0x1f06c1[_0x53b6('0x1c')]=qs['limit'](_0x5c0a89['query']['limit']);_0x1f06c1[_0x53b6('0x1b')]=qs['offset'](_0x5c0a89[_0x53b6('0x2c')]['offset']);}return _0x44969d[_0x53b6('0x46')](_0x1f06c1);}})['then'](function(_0x22e9b7){if(_0x22e9b7){return _0x22e9b7?{'count':_0x28657b,'rows':_0x22e9b7}:null;}})[_0x53b6('0x22')](respondWithResult(_0x3a6d83,null))[_0x53b6('0x3f')](handleError(_0x3a6d83,null));};exports[_0x53b6('0x49')]=function(_0x432b59,_0xa8f171,_0x10e683){if(_0x432b59[_0x53b6('0x43')]['id']){delete _0x432b59[_0x53b6('0x43')]['id'];}return db['FreshsalesAccount'][_0x53b6('0x4a')]({'where':{'id':_0x432b59[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0xa8f171,null))['then'](function(_0x9656e5){if(_0x9656e5){_0x432b59[_0x53b6('0x43')][_0x53b6('0x4b')]=_0x9656e5['id'];_0x432b59[_0x53b6('0x43')][_0x53b6('0x4c')]=integrations['getSubjects'](_0x432b59[_0x53b6('0x43')][_0x53b6('0x4d')],_0x432b59['body'][_0x53b6('0x2a')]);_0x432b59[_0x53b6('0x43')][_0x53b6('0x4e')]=integrations[_0x53b6('0x4f')](_0x432b59['body'][_0x53b6('0x4d')],_0x432b59[_0x53b6('0x43')][_0x53b6('0x2a')]);return db[_0x53b6('0x50')][_0x53b6('0x42')](_0x432b59[_0x53b6('0x43')],{'include':[{'model':db[_0x53b6('0x51')],'as':'Subjects'},{'model':db[_0x53b6('0x51')],'as':'Descriptions'}]});}return null;})[_0x53b6('0x22')](respondWithResult(_0xa8f171,null))[_0x53b6('0x3f')](handleError(_0xa8f171,null));};exports[_0x53b6('0x52')]=function(_0x44bcfc,_0x1ec95e,_0x5d068d){var _0x10fec6='';var _0x19bb3b='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x44bcfc[_0x53b6('0x40')]['id']},'attributes':['id',_0x53b6('0x53'),_0x53b6('0x54'),_0x53b6('0x55')]})[_0x53b6('0x22')](handleEntityNotFound(_0x1ec95e,null))[_0x53b6('0x22')](function(_0x31e5e0){if(_0x31e5e0){_0x19bb3b=_0x31e5e0[_0x53b6('0x53')];_0x10fec6=_0x31e5e0[_0x53b6('0x54')];var _0x16b9fc=_0x31e5e0[_0x53b6('0x54')][_0x53b6('0x56')](-0x1);if(_0x16b9fc==='/'){_0x10fec6=_0x10fec6[_0x53b6('0x57')](0x0,_0x10fec6[_0x53b6('0x58')](_0x16b9fc));}return rp({'method':_0x53b6('0x59'),'uri':util[_0x53b6('0x5a')](_0x53b6('0x5b'),_0x10fec6,_0x53b6('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x31e5e0['apiKey']},'json':!![]});}})[_0x53b6('0x22')](function(_0x412ee6){if(_0x412ee6){var _0x367cf8=_0x412ee6['users'];var _0x262b80=![];var _0x235864=null;for(_0x235864=0x0;_0x235864<_0x367cf8[_0x53b6('0x31')];_0x235864++){if(_0x367cf8[_0x235864][_0x53b6('0x5d')]===_0x19bb3b){_0x262b80=!![];}}if(_0x262b80){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x53b6('0x22')](respondWithResult(_0x1ec95e,null))[_0x53b6('0x3f')](function(_0x77fba5){var _0x136e82=_0x44bcfc[_0x53b6('0x2c')][_0x53b6('0x5e')]?0x1f4:_0x77fba5['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x53b6('0x52'),_0x136e82,JSON['stringify'](_0x77fba5));delete _0x77fba5[_0x53b6('0x25')];if(_0x136e82===0x191){_0x136e82=0x190;}_0x1ec95e['status'](_0x136e82)['send'](_0x44bcfc['query'][_0x53b6('0x5e')]?{'message':'Wrong\x20credentials','statusCode':_0x77fba5[_0x53b6('0x5f')]}:_0x77fba5);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d946b7a..497209c 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 _0x68b3=['moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x130b53,_0x5cda8e){var _0x2bfb79=function(_0x5d602d){while(--_0x5d602d){_0x130b53['push'](_0x130b53['shift']());}};_0x2bfb79(++_0x5cda8e);}(_0x68b3,0x1d8));var _0x368b=function(_0x31c801,_0x1d9a39){_0x31c801=_0x31c801-0x0;var _0x36e427=_0x68b3[_0x31c801];return _0x36e427;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var logger=require(_0x368b('0x2'))(_0x368b('0x3'));var moment=require(_0x368b('0x4'));var BPromise=require('bluebird');var rp=require(_0x368b('0x5'));var fs=require('fs');var path=require(_0x368b('0x6'));var rimraf=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x368b('0x9'));module[_0x368b('0xa')]=function(_0x104dad,_0x23584a){return _0x104dad[_0x368b('0xb')](_0x368b('0xc'),attributes,{'tableName':_0x368b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e3=['int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount'];(function(_0x98c3f,_0x551153){var _0xecff7d=function(_0x3f862b){while(--_0x3f862b){_0x98c3f['push'](_0x98c3f['shift']());}};_0xecff7d(++_0x551153);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf2e3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x3f2e('0xa')]=function(_0xdd6b3e,_0x3c0864){return _0xdd6b3e[_0x3f2e('0xb')](_0x3f2e('0xc'),attributes,{'tableName':_0x3f2e('0xd'),'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 c806366..7555e7c 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 _0xa6b0=['http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','map','then','GetFreshsalesAccount','ShowFreshsalesAccount','FreshsalesAccount','find','where','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3c3a03,_0x3c0da1){var _0x57ff53=function(_0xd08f4a){while(--_0xd08f4a){_0x3c3a03['push'](_0x3c3a03['shift']());}};_0x57ff53(++_0x3c0da1);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5ad522,_0x2f37ca){_0x5ad522=_0x5ad522-0x0;var _0x2bf6e1=_0xa6b0[_0x5ad522];return _0x2bf6e1;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});}exports['GetFreshsalesAccount']=function(_0xcb412){var _0x31f347=this;return new Promise(function(_0x2cb10b,_0x1ad45d){return db['FreshsalesAccount'][_0x0a6b('0x17')]({'raw':_0xcb412[_0x0a6b('0x18')]?_0xcb412['options'][_0x0a6b('0x19')]===undefined?!![]:![]:!![],'where':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')]['where']||null:null,'attributes':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1a')]||null:null,'limit':_0xcb412['options']?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1b')]||null:null,'include':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1c')]?_['map'](_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1c')],function(_0x3d153f){return{'model':db[_0x3d153f['model']],'as':_0x3d153f['as'],'attributes':_0x3d153f[_0x0a6b('0x1a')],'include':_0x3d153f[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3d153f[_0x0a6b('0x1c')],function(_0x3b12a2){return{'model':db[_0x3b12a2['model']],'as':_0x3b12a2['as'],'attributes':_0x3b12a2[_0x0a6b('0x1a')],'include':_0x3b12a2[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3b12a2['include'],function(_0x3a9092){return{'model':db[_0x3a9092['model']],'as':_0x3a9092['as'],'attributes':_0x3a9092[_0x0a6b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0a6b('0x1e')](function(_0x45ae97){logger['info']('GetFreshsalesAccount',_0xcb412);logger[_0x0a6b('0xf')](_0x0a6b('0x1f'),_0xcb412,JSON[_0x0a6b('0x11')](_0x45ae97));_0x2cb10b(_0x45ae97);})[_0x0a6b('0x16')](function(_0x1935a3){logger[_0x0a6b('0x12')]('GetFreshsalesAccount',_0x1935a3[_0x0a6b('0x14')],_0xcb412);_0x1ad45d(_0x31f347[_0x0a6b('0x12')](0x1f4,_0x1935a3['message']));});});};exports[_0x0a6b('0x20')]=function(_0x554145){var _0x4eb516=this;return new Promise(function(_0xbf2f1a,_0x24e96a){return db[_0x0a6b('0x21')][_0x0a6b('0x22')]({'raw':_0x554145[_0x0a6b('0x18')]?_0x554145['options']['raw']===undefined?!![]:![]:!![],'where':_0x554145[_0x0a6b('0x18')]?_0x554145[_0x0a6b('0x18')][_0x0a6b('0x23')]||null:null,'attributes':_0x554145[_0x0a6b('0x18')]?_0x554145['options'][_0x0a6b('0x1a')]||null:null,'include':_0x554145[_0x0a6b('0x18')]?_0x554145['options']['include']?_[_0x0a6b('0x1d')](_0x554145[_0x0a6b('0x18')]['include'],function(_0x3c3c23){return{'model':db[_0x3c3c23[_0x0a6b('0x24')]],'as':_0x3c3c23['as'],'attributes':_0x3c3c23[_0x0a6b('0x1a')],'include':_0x3c3c23[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3c3c23[_0x0a6b('0x1c')],function(_0x1f6f82){return{'model':db[_0x1f6f82[_0x0a6b('0x24')]],'as':_0x1f6f82['as'],'attributes':_0x1f6f82[_0x0a6b('0x1a')],'include':_0x1f6f82[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x1f6f82[_0x0a6b('0x1c')],function(_0x49fa53){return{'model':db[_0x49fa53[_0x0a6b('0x24')]],'as':_0x49fa53['as'],'attributes':_0x49fa53[_0x0a6b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x390d62){logger[_0x0a6b('0xc')](_0x0a6b('0x20'),_0x554145);logger[_0x0a6b('0xf')](_0x0a6b('0x20'),_0x554145,JSON[_0x0a6b('0x11')](_0x390d62));_0xbf2f1a(_0x390d62);})[_0x0a6b('0x16')](function(_0x3f1be6){logger[_0x0a6b('0x12')]('ShowFreshsalesAccount',_0x3f1be6[_0x0a6b('0x14')],_0x554145);_0x24e96a(_0x4eb516[_0x0a6b('0x12')](0x1f4,_0x3f1be6[_0x0a6b('0x14')]));});});}; \ No newline at end of file +var _0x627e=['request','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','raw','options','where','map','model','attributes','include','then','debug','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0x627e,0x14a));var _0xe627=function(_0x424687,_0x1c8baf){_0x424687=_0x424687-0x0;var _0x288f96=_0x627e[_0x424687];return _0x288f96;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}exports[_0xe627('0x14')]=function(_0x56559b){var _0x2fe46a=this;return new Promise(function(_0x538b22,_0x24fddd){return db['FreshsalesAccount'][_0xe627('0x15')]({'raw':_0x56559b['options']?_0x56559b['options'][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x56559b['options']?_0x56559b[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x56559b['options']?_0x56559b['options']['attributes']||null:null,'limit':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['limit']||null:null,'include':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['include']?_[_0xe627('0x19')](_0x56559b[_0xe627('0x17')]['include'],function(_0x42f3d1){return{'model':db[_0x42f3d1[_0xe627('0x1a')]],'as':_0x42f3d1['as'],'attributes':_0x42f3d1[_0xe627('0x1b')],'include':_0x42f3d1['include']?_[_0xe627('0x19')](_0x42f3d1[_0xe627('0x1c')],function(_0x1a5081){return{'model':db[_0x1a5081[_0xe627('0x1a')]],'as':_0x1a5081['as'],'attributes':_0x1a5081['attributes'],'include':_0x1a5081[_0xe627('0x1c')]?_[_0xe627('0x19')](_0x1a5081[_0xe627('0x1c')],function(_0x29eb8e){return{'model':db[_0x29eb8e[_0xe627('0x1a')]],'as':_0x29eb8e['as'],'attributes':_0x29eb8e[_0xe627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x44c9f7){logger[_0xe627('0xb')]('GetFreshsalesAccount',_0x56559b);logger[_0xe627('0x1e')]('GetFreshsalesAccount',_0x56559b,JSON['stringify'](_0x44c9f7));_0x538b22(_0x44c9f7);})[_0xe627('0x13')](function(_0xdf63c8){logger['error'](_0xe627('0x14'),_0xdf63c8['message'],_0x56559b);_0x24fddd(_0x2fe46a[_0xe627('0x10')](0x1f4,_0xdf63c8['message']));});});};exports[_0xe627('0x1f')]=function(_0x26833a){var _0x5d8992=this;return new Promise(function(_0x33e9dd,_0x4f92c9){return db[_0xe627('0x20')][_0xe627('0x21')]({'raw':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x1b')]||null:null,'include':_0x26833a['options']?_0x26833a['options'][_0xe627('0x1c')]?_['map'](_0x26833a[_0xe627('0x17')]['include'],function(_0x56d1d7){return{'model':db[_0x56d1d7[_0xe627('0x1a')]],'as':_0x56d1d7['as'],'attributes':_0x56d1d7['attributes'],'include':_0x56d1d7['include']?_[_0xe627('0x19')](_0x56d1d7[_0xe627('0x1c')],function(_0x55f001){return{'model':db[_0x55f001['model']],'as':_0x55f001['as'],'attributes':_0x55f001['attributes'],'include':_0x55f001['include']?_[_0xe627('0x19')](_0x55f001['include'],function(_0x39338c){return{'model':db[_0x39338c[_0xe627('0x1a')]],'as':_0x39338c['as'],'attributes':_0x39338c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x35a303){logger['info'](_0xe627('0x1f'),_0x26833a);logger[_0xe627('0x1e')](_0xe627('0x1f'),_0x26833a,JSON[_0xe627('0xf')](_0x35a303));_0x33e9dd(_0x35a303);})[_0xe627('0x13')](function(_0x28fd59){logger['error'](_0xe627('0x1f'),_0x28fd59['message'],_0x26833a);_0x4f92c9(_0x5d8992[_0xe627('0x10')](0x1f4,_0x28fd59['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0438598..db761c4 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 _0xcf0a=['./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','/:id/subjects','getSubjects','getDescriptions','getFields','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1f9491,_0x17bca1){var _0x444f3e=function(_0x181984){while(--_0x181984){_0x1f9491['push'](_0x1f9491['shift']());}};_0x444f3e(++_0x17bca1);}(_0xcf0a,0xe0));var _0xacf0=function(_0x575108,_0x572fbb){_0x575108=_0x575108-0x0;var _0x4f7ed7=_0xcf0a[_0x575108];return _0x4f7ed7;};'use strict';var multer=require(_0xacf0('0x0'));var util=require('util');var path=require(_0xacf0('0x1'));var timeout=require(_0xacf0('0x2'));var express=require(_0xacf0('0x3'));var router=express['Router']();var fs_extra=require(_0xacf0('0x4'));var auth=require(_0xacf0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xacf0('0x6'));var controller=require(_0xacf0('0x7'));router[_0xacf0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xacf0('0x8')](_0xacf0('0x9'),auth[_0xacf0('0xa')](),controller['show']);router[_0xacf0('0x8')](_0xacf0('0xb'),auth[_0xacf0('0xa')](),controller[_0xacf0('0xc')]);router['get']('/:id/descriptions',auth[_0xacf0('0xa')](),controller[_0xacf0('0xd')]);router[_0xacf0('0x8')]('/:id/fields',auth[_0xacf0('0xa')](),controller[_0xacf0('0xe')]);router[_0xacf0('0xf')]('/',auth[_0xacf0('0xa')](),controller[_0xacf0('0x10')]);router[_0xacf0('0x11')](_0xacf0('0x9'),auth[_0xacf0('0xa')](),controller[_0xacf0('0x12')]);router['delete']('/:id',auth[_0xacf0('0xa')](),controller[_0xacf0('0x13')]);module[_0xacf0('0x14')]=router; \ No newline at end of file +var _0x24ed=['isAuthenticated','/:id','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get'];(function(_0x4c2583,_0x525ae8){var _0x2f9315=function(_0x226ddd){while(--_0x226ddd){_0x4c2583['push'](_0x4c2583['shift']());}};_0x2f9315(++_0x525ae8);}(_0x24ed,0x7d));var _0xd24e=function(_0x1fc22e,_0x279f42){_0x1fc22e=_0x1fc22e-0x0;var _0x40f369=_0x24ed[_0x1fc22e];return _0x40f369;};'use strict';var multer=require(_0xd24e('0x0'));var util=require(_0xd24e('0x1'));var path=require('path');var timeout=require(_0xd24e('0x2'));var express=require(_0xd24e('0x3'));var router=express['Router']();var fs_extra=require(_0xd24e('0x4'));var auth=require(_0xd24e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd24e('0x6'));router[_0xd24e('0x7')]('/',auth[_0xd24e('0x8')](),controller['index']);router['get'](_0xd24e('0x9'),auth[_0xd24e('0x8')](),controller['show']);router[_0xd24e('0x7')](_0xd24e('0xa'),auth[_0xd24e('0x8')](),controller['getSubjects']);router[_0xd24e('0x7')](_0xd24e('0xb'),auth[_0xd24e('0x8')](),controller[_0xd24e('0xc')]);router['get']('/:id/fields',auth[_0xd24e('0x8')](),controller[_0xd24e('0xd')]);router[_0xd24e('0xe')]('/',auth['isAuthenticated'](),controller[_0xd24e('0xf')]);router[_0xd24e('0x10')](_0xd24e('0x9'),auth[_0xd24e('0x8')](),controller[_0xd24e('0x11')]);router[_0xd24e('0x12')](_0xd24e('0x9'),auth[_0xd24e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index df3ef24..a03edff 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 _0x47f3=['STRING','exports'];(function(_0x325386,_0x148083){var _0x47a3ce=function(_0x68201){while(--_0x68201){_0x325386['push'](_0x325386['shift']());}};_0x47a3ce(++_0x148083);}(_0x47f3,0x11d));var _0x347f=function(_0x976771,_0x357f4a){_0x976771=_0x976771-0x0;var _0x4ba3c7=_0x47f3[_0x976771];return _0x4ba3c7;};'use strict';var Sequelize=require('sequelize');module[_0x347f('0x0')]={'name':{'type':Sequelize[_0x347f('0x1')]},'description':{'type':Sequelize[_0x347f('0x1')]}}; \ No newline at end of file +var _0x8181=['STRING'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8181,0x195));var _0x1818=function(_0x54899d,_0x548b25){_0x54899d=_0x54899d-0x0;var _0xc5d0e=_0x8181[_0x54899d];return _0xc5d0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1818('0x0')]},'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 458de38..8e6a0c9 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 _0xef0e=['fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','findOne','order','getSubjects','nolimit','getDescriptions','getFields','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection'];(function(_0x2ae278,_0x5eb5a4){var _0x412c37=function(_0xcaab64){while(--_0xcaab64){_0x2ae278['push'](_0x2ae278['shift']());}};_0x412c37(++_0x5eb5a4);}(_0xef0e,0x106));var _0xeef0=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xef0e[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeef0('0x0'));var rp=require(_0xeef0('0x1'));var moment=require(_0xeef0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xeef0('0x3'));var util=require('util');var path=require(_0xeef0('0x4'));var sox=require(_0xeef0('0x5'));var csv=require(_0xeef0('0x6'));var ejs=require(_0xeef0('0x7'));var fs=require('fs');var fs_extra=require(_0xeef0('0x8'));var _=require(_0xeef0('0x9'));var squel=require(_0xeef0('0xa'));var crypto=require(_0xeef0('0xb'));var jsforce=require(_0xeef0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeef0('0x6'));var querystring=require('querystring');var Papa=require(_0xeef0('0xd'));var Redis=require(_0xeef0('0xe'));var authService=require(_0xeef0('0xf'));var qs=require(_0xeef0('0x10'));var as=require(_0xeef0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeef0('0x12'));var utils=require(_0xeef0('0x13'));var config=require(_0xeef0('0x14'));var licenseUtil=require(_0xeef0('0x15'));var db=require(_0xeef0('0x16'))['db'];function respondWithStatusCode(_0x48bb4d,_0x1b0e9d){_0x1b0e9d=_0x1b0e9d||0xcc;return function(_0x4d21c9){if(_0x4d21c9){return _0x48bb4d[_0xeef0('0x17')](_0x1b0e9d);}return _0x48bb4d[_0xeef0('0x18')](_0x1b0e9d)[_0xeef0('0x19')]();};}function respondWithResult(_0x4d24d0,_0x240cc6){_0x240cc6=_0x240cc6||0xc8;return function(_0x33525d){if(_0x33525d){return _0x4d24d0[_0xeef0('0x18')](_0x240cc6)[_0xeef0('0x1a')](_0x33525d);}};}function respondWithFilteredResult(_0xbbba9b,_0x491dac){return function(_0x43d5ac){if(_0x43d5ac){var _0x5dce0e=typeof _0x491dac[_0xeef0('0x1b')]===_0xeef0('0x1c')&&typeof _0x491dac[_0xeef0('0x1d')]==='undefined';var _0x53b24f=_0x43d5ac[_0xeef0('0x1e')];var _0xbd8051=_0x5dce0e?0x0:_0x491dac['offset'];var _0x590415=_0x5dce0e?_0x43d5ac[_0xeef0('0x1e')]:_0x491dac['offset']+_0x491dac['limit'];var _0x3cd30c;if(_0x590415>=_0x53b24f){_0x590415=_0x53b24f;_0x3cd30c=0xc8;}else{_0x3cd30c=0xce;}_0xbbba9b[_0xeef0('0x18')](_0x3cd30c);return _0xbbba9b[_0xeef0('0x1f')](_0xeef0('0x20'),_0xbd8051+'-'+_0x590415+'/'+_0x53b24f)['json'](_0x43d5ac);}return null;};}function patchUpdates(_0x2b25f8){return function(_0x4c8497){try{jsonpatch[_0xeef0('0x21')](_0x4c8497,_0x2b25f8,!![]);}catch(_0x58ccbd){return BPromise[_0xeef0('0x22')](_0x58ccbd);}return _0x4c8497[_0xeef0('0x23')]();};}function saveUpdates(_0x2f39b7,_0x4ca1f0){return function(_0x5b6c56){if(_0x5b6c56){return _0x5b6c56[_0xeef0('0x24')](_0x2f39b7)[_0xeef0('0x25')](function(_0x2ea759){return _0x2ea759;});}return null;};}function removeEntity(_0x148fdd,_0x29629c){return function(_0x4a6fd4){if(_0x4a6fd4){return _0x4a6fd4[_0xeef0('0x26')]()['then'](function(){_0x148fdd[_0xeef0('0x18')](0xcc)[_0xeef0('0x19')]();});}};}function handleEntityNotFound(_0x1cc8a2,_0xee70f0){return function(_0x135012){if(!_0x135012){_0x1cc8a2[_0xeef0('0x17')](0x194);}return _0x135012;};}function handleError(_0x30aa9c,_0x448706){_0x448706=_0x448706||0x1f4;return function(_0x3ce697){logger[_0xeef0('0x27')](_0x3ce697['stack']);if(_0x3ce697[_0xeef0('0x28')]){delete _0x3ce697[_0xeef0('0x28')];}_0x30aa9c[_0xeef0('0x18')](_0x448706)[_0xeef0('0x29')](_0x3ce697);};}exports[_0xeef0('0x2a')]=function(_0x4ad004,_0x3434d0){var _0xf0dae3={},_0x538a6a={},_0x57b3ae={'count':0x0,'rows':[]};var _0x288c5e=_['map'](db[_0xeef0('0x2b')][_0xeef0('0x2c')],function(_0x1ce8d6){return{'name':_0x1ce8d6['fieldName'],'type':_0x1ce8d6[_0xeef0('0x2d')][_0xeef0('0x2e')]};});_0x538a6a[_0xeef0('0x2f')]=_[_0xeef0('0x30')](_0x288c5e,_0xeef0('0x28'));_0x538a6a[_0xeef0('0x31')]=_[_0xeef0('0x32')](_0x4ad004['query']);_0x538a6a[_0xeef0('0x33')]=_['intersection'](_0x538a6a['model'],_0x538a6a[_0xeef0('0x31')]);_0xf0dae3[_0xeef0('0x34')]=_[_0xeef0('0x35')](_0x538a6a['model'],qs[_0xeef0('0x36')](_0x4ad004[_0xeef0('0x31')][_0xeef0('0x36')]));_0xf0dae3['attributes']=_0xf0dae3[_0xeef0('0x34')][_0xeef0('0x37')]?_0xf0dae3[_0xeef0('0x34')]:_0x538a6a[_0xeef0('0x2f')];if(!_0x4ad004[_0xeef0('0x31')][_0xeef0('0x38')]('nolimit')){_0xf0dae3[_0xeef0('0x1d')]=qs[_0xeef0('0x1d')](_0x4ad004[_0xeef0('0x31')][_0xeef0('0x1d')]);_0xf0dae3[_0xeef0('0x1b')]=qs[_0xeef0('0x1b')](_0x4ad004[_0xeef0('0x31')]['offset']);}_0xf0dae3['order']=qs[_0xeef0('0x39')](_0x4ad004[_0xeef0('0x31')][_0xeef0('0x39')]);_0xf0dae3[_0xeef0('0x3a')]=qs[_0xeef0('0x33')](_[_0xeef0('0x3b')](_0x4ad004[_0xeef0('0x31')],_0x538a6a['filters']),_0x288c5e);if(_0x4ad004[_0xeef0('0x31')][_0xeef0('0x3c')]){_0xf0dae3[_0xeef0('0x3a')]=_['merge'](_0xf0dae3[_0xeef0('0x3a')],{'$or':_['map'](_0x288c5e,function(_0x275006){if(_0x275006[_0xeef0('0x2d')]!==_0xeef0('0x3d')){var _0x3dc294={};_0x3dc294[_0x275006['name']]={'$like':'%'+_0x4ad004[_0xeef0('0x31')]['filter']+'%'};return _0x3dc294;}})});}_0xf0dae3=_[_0xeef0('0x3e')]({},_0xf0dae3,_0x4ad004[_0xeef0('0x3f')]);var _0x10ceda={'where':_0xf0dae3[_0xeef0('0x3a')]};return db[_0xeef0('0x2b')][_0xeef0('0x1e')](_0x10ceda)[_0xeef0('0x25')](function(_0x5725cf){_0x57b3ae['count']=_0x5725cf;if(_0x4ad004['query'][_0xeef0('0x40')]){_0xf0dae3[_0xeef0('0x41')]=[{'all':!![]}];}return db[_0xeef0('0x2b')]['findAll'](_0xf0dae3);})[_0xeef0('0x25')](function(_0x237ca4){_0x57b3ae[_0xeef0('0x42')]=_0x237ca4;return _0x57b3ae;})[_0xeef0('0x25')](respondWithFilteredResult(_0x3434d0,_0xf0dae3))[_0xeef0('0x43')](handleError(_0x3434d0,null));};exports[_0xeef0('0x44')]=function(_0x41402e,_0x245c31){var _0x170b47={'raw':![],'where':{'id':_0x41402e[_0xeef0('0x45')]['id']}},_0xbfba42={};_0xbfba42[_0xeef0('0x2f')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0xbfba42[_0xeef0('0x31')]=_[_0xeef0('0x32')](_0x41402e[_0xeef0('0x31')]);_0xbfba42[_0xeef0('0x33')]=_[_0xeef0('0x35')](_0xbfba42[_0xeef0('0x2f')],_0xbfba42['query']);_0x170b47[_0xeef0('0x34')]=_[_0xeef0('0x35')](_0xbfba42[_0xeef0('0x2f')],qs[_0xeef0('0x36')](_0x41402e[_0xeef0('0x31')][_0xeef0('0x36')]));_0x170b47[_0xeef0('0x34')]=_0x170b47[_0xeef0('0x34')][_0xeef0('0x37')]?_0x170b47[_0xeef0('0x34')]:_0xbfba42['model'];if(_0x41402e[_0xeef0('0x31')]['includeAll']){_0x170b47[_0xeef0('0x41')]=[{'all':!![]}];}_0x170b47=_['merge']({},_0x170b47,_0x41402e['options']);return db[_0xeef0('0x2b')][_0xeef0('0x46')](_0x170b47)[_0xeef0('0x25')](handleEntityNotFound(_0x245c31,null))[_0xeef0('0x25')](respondWithResult(_0x245c31,null))['catch'](handleError(_0x245c31,null));};exports[_0xeef0('0x47')]=function(_0x5282e8,_0x4c0bd2){return db['FreshsalesConfiguration']['create'](_0x5282e8[_0xeef0('0x48')],{})['then'](respondWithResult(_0x4c0bd2,0xc9))[_0xeef0('0x43')](handleError(_0x4c0bd2,null));};exports[_0xeef0('0x24')]=function(_0x545f5d,_0x3792b4){if(_0x545f5d[_0xeef0('0x48')]['id']){delete _0x545f5d[_0xeef0('0x48')]['id'];}return db[_0xeef0('0x2b')][_0xeef0('0x46')]({'where':{'id':_0x545f5d[_0xeef0('0x45')]['id']}})['then'](handleEntityNotFound(_0x3792b4,null))[_0xeef0('0x25')](saveUpdates(_0x545f5d['body'],null))[_0xeef0('0x25')](respondWithResult(_0x3792b4,null))['catch'](handleError(_0x3792b4,null));};exports[_0xeef0('0x26')]=function(_0x19f35c,_0x552998){return db['FreshsalesConfiguration'][_0xeef0('0x46')]({'where':{'id':_0x19f35c[_0xeef0('0x45')]['id']}})[_0xeef0('0x25')](handleEntityNotFound(_0x552998,null))[_0xeef0('0x25')](removeEntity(_0x552998,null))['catch'](handleError(_0x552998,null));};exports['getSubjects']=function(_0x5d03b9,_0x5af7b0,_0x4ed378){var _0x4ea8e1={};var _0x3a42b1={};var _0x4b328d;var _0x3a8fd2;return db[_0xeef0('0x2b')][_0xeef0('0x49')]({'where':{'id':_0x5d03b9[_0xeef0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5af7b0,null))[_0xeef0('0x25')](function(_0x2c6f56){if(_0x2c6f56){_0x4b328d=_0x2c6f56;_0x3a42b1[_0xeef0('0x2f')]=_[_0xeef0('0x32')](db['FreshsalesField'][_0xeef0('0x2c')]);_0x3a42b1[_0xeef0('0x31')]=_[_0xeef0('0x32')](_0x5d03b9[_0xeef0('0x31')]);_0x3a42b1[_0xeef0('0x33')]=_['intersection'](_0x3a42b1[_0xeef0('0x2f')],_0x3a42b1[_0xeef0('0x31')]);_0x4ea8e1['attributes']=_['intersection'](_0x3a42b1[_0xeef0('0x2f')],qs[_0xeef0('0x36')](_0x5d03b9[_0xeef0('0x31')][_0xeef0('0x36')]));_0x4ea8e1[_0xeef0('0x34')]=_0x4ea8e1[_0xeef0('0x34')][_0xeef0('0x37')]?_0x4ea8e1[_0xeef0('0x34')]:_0x3a42b1[_0xeef0('0x2f')];_0x4ea8e1[_0xeef0('0x4a')]=qs[_0xeef0('0x39')](_0x5d03b9[_0xeef0('0x31')][_0xeef0('0x39')]);_0x4ea8e1[_0xeef0('0x3a')]=qs[_0xeef0('0x33')](_[_0xeef0('0x3b')](_0x5d03b9[_0xeef0('0x31')],_0x3a42b1[_0xeef0('0x33')]));if(_0x5d03b9['query'][_0xeef0('0x3c')]){_0x4ea8e1[_0xeef0('0x3a')]=_[_0xeef0('0x3e')](_0x4ea8e1[_0xeef0('0x3a')],{'$or':_[_0xeef0('0x30')](_0x4ea8e1[_0xeef0('0x34')],function(_0xe116d2){var _0xbba95a={};_0xbba95a[_0xe116d2]={'$like':'%'+_0x5d03b9[_0xeef0('0x31')][_0xeef0('0x3c')]+'%'};return _0xbba95a;})});}_0x4ea8e1=_[_0xeef0('0x3e')]({},_0x4ea8e1,_0x5d03b9['options']);return _0x4b328d[_0xeef0('0x4b')](_0x4ea8e1);}})[_0xeef0('0x25')](function(_0x5d389e){if(_0x5d389e){_0x3a8fd2=_0x5d389e[_0xeef0('0x37')];if(!_0x5d03b9['query'][_0xeef0('0x38')](_0xeef0('0x4c'))){_0x4ea8e1['limit']=qs[_0xeef0('0x1d')](_0x5d03b9['query'][_0xeef0('0x1d')]);_0x4ea8e1[_0xeef0('0x1b')]=qs[_0xeef0('0x1b')](_0x5d03b9['query']['offset']);}return _0x4b328d[_0xeef0('0x4b')](_0x4ea8e1);}})[_0xeef0('0x25')](function(_0x2c8134){if(_0x2c8134){return _0x2c8134?{'count':_0x3a8fd2,'rows':_0x2c8134}:null;}})[_0xeef0('0x25')](respondWithResult(_0x5af7b0,null))['catch'](handleError(_0x5af7b0,null));};exports[_0xeef0('0x4d')]=function(_0x151d9b,_0x1a9269,_0x477cb3){var _0x393ae3={};var _0x3c3f9f={};var _0x3daead;var _0x11641c;return db['FreshsalesConfiguration'][_0xeef0('0x49')]({'where':{'id':_0x151d9b[_0xeef0('0x45')]['id']}})[_0xeef0('0x25')](handleEntityNotFound(_0x1a9269,null))[_0xeef0('0x25')](function(_0xa92ac1){if(_0xa92ac1){_0x3daead=_0xa92ac1;_0x3c3f9f[_0xeef0('0x2f')]=_[_0xeef0('0x32')](db['FreshsalesField']['rawAttributes']);_0x3c3f9f[_0xeef0('0x31')]=_[_0xeef0('0x32')](_0x151d9b['query']);_0x3c3f9f[_0xeef0('0x33')]=_['intersection'](_0x3c3f9f[_0xeef0('0x2f')],_0x3c3f9f[_0xeef0('0x31')]);_0x393ae3[_0xeef0('0x34')]=_[_0xeef0('0x35')](_0x3c3f9f[_0xeef0('0x2f')],qs[_0xeef0('0x36')](_0x151d9b[_0xeef0('0x31')]['fields']));_0x393ae3[_0xeef0('0x34')]=_0x393ae3[_0xeef0('0x34')][_0xeef0('0x37')]?_0x393ae3['attributes']:_0x3c3f9f[_0xeef0('0x2f')];_0x393ae3['order']=qs[_0xeef0('0x39')](_0x151d9b['query'][_0xeef0('0x39')]);_0x393ae3[_0xeef0('0x3a')]=qs['filters'](_[_0xeef0('0x3b')](_0x151d9b['query'],_0x3c3f9f[_0xeef0('0x33')]));if(_0x151d9b[_0xeef0('0x31')][_0xeef0('0x3c')]){_0x393ae3['where']=_[_0xeef0('0x3e')](_0x393ae3[_0xeef0('0x3a')],{'$or':_[_0xeef0('0x30')](_0x393ae3[_0xeef0('0x34')],function(_0x2219f1){var _0x13b88d={};_0x13b88d[_0x2219f1]={'$like':'%'+_0x151d9b[_0xeef0('0x31')]['filter']+'%'};return _0x13b88d;})});}_0x393ae3=_[_0xeef0('0x3e')]({},_0x393ae3,_0x151d9b[_0xeef0('0x3f')]);return _0x3daead[_0xeef0('0x4d')](_0x393ae3);}})[_0xeef0('0x25')](function(_0xb438d6){if(_0xb438d6){_0x11641c=_0xb438d6[_0xeef0('0x37')];if(!_0x151d9b[_0xeef0('0x31')]['hasOwnProperty']('nolimit')){_0x393ae3['limit']=qs[_0xeef0('0x1d')](_0x151d9b[_0xeef0('0x31')][_0xeef0('0x1d')]);_0x393ae3[_0xeef0('0x1b')]=qs['offset'](_0x151d9b[_0xeef0('0x31')][_0xeef0('0x1b')]);}return _0x3daead[_0xeef0('0x4d')](_0x393ae3);}})[_0xeef0('0x25')](function(_0x167638){if(_0x167638){return _0x167638?{'count':_0x11641c,'rows':_0x167638}:null;}})[_0xeef0('0x25')](respondWithResult(_0x1a9269,null))[_0xeef0('0x43')](handleError(_0x1a9269,null));};exports[_0xeef0('0x4e')]=function(_0x54179d,_0x3ee2d9,_0x4d3d03){var _0x48b855={};var _0x25f5d1={};var _0x1aa6ff;var _0xa09813;return db[_0xeef0('0x2b')]['findOne']({'where':{'id':_0x54179d[_0xeef0('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ee2d9,null))[_0xeef0('0x25')](function(_0x22dc6d){if(_0x22dc6d){_0x1aa6ff=_0x22dc6d;_0x25f5d1[_0xeef0('0x2f')]=_[_0xeef0('0x32')](db['FreshsalesField']['rawAttributes']);_0x25f5d1[_0xeef0('0x31')]=_[_0xeef0('0x32')](_0x54179d[_0xeef0('0x31')]);_0x25f5d1[_0xeef0('0x33')]=_['intersection'](_0x25f5d1['model'],_0x25f5d1[_0xeef0('0x31')]);_0x48b855[_0xeef0('0x34')]=_[_0xeef0('0x35')](_0x25f5d1['model'],qs[_0xeef0('0x36')](_0x54179d[_0xeef0('0x31')][_0xeef0('0x36')]));_0x48b855['attributes']=_0x48b855[_0xeef0('0x34')][_0xeef0('0x37')]?_0x48b855[_0xeef0('0x34')]:_0x25f5d1[_0xeef0('0x2f')];_0x48b855[_0xeef0('0x4a')]=qs[_0xeef0('0x39')](_0x54179d['query']['sort']);_0x48b855[_0xeef0('0x3a')]=qs[_0xeef0('0x33')](_[_0xeef0('0x3b')](_0x54179d['query'],_0x25f5d1['filters']));if(_0x54179d['query']['filter']){_0x48b855[_0xeef0('0x3a')]=_['merge'](_0x48b855['where'],{'$or':_[_0xeef0('0x30')](_0x48b855[_0xeef0('0x34')],function(_0x19d06f){var _0x39030e={};_0x39030e[_0x19d06f]={'$like':'%'+_0x54179d[_0xeef0('0x31')][_0xeef0('0x3c')]+'%'};return _0x39030e;})});}_0x48b855=_[_0xeef0('0x3e')]({},_0x48b855,_0x54179d[_0xeef0('0x3f')]);return _0x1aa6ff[_0xeef0('0x4e')](_0x48b855);}})['then'](function(_0x395204){if(_0x395204){_0xa09813=_0x395204[_0xeef0('0x37')];if(!_0x54179d[_0xeef0('0x31')]['hasOwnProperty'](_0xeef0('0x4c'))){_0x48b855['limit']=qs[_0xeef0('0x1d')](_0x54179d[_0xeef0('0x31')][_0xeef0('0x1d')]);_0x48b855[_0xeef0('0x1b')]=qs[_0xeef0('0x1b')](_0x54179d[_0xeef0('0x31')]['offset']);}return _0x1aa6ff[_0xeef0('0x4e')](_0x48b855);}})[_0xeef0('0x25')](function(_0x4fc934){if(_0x4fc934){return _0x4fc934?{'count':_0xa09813,'rows':_0x4fc934}:null;}})['then'](respondWithResult(_0x3ee2d9,null))[_0xeef0('0x43')](handleError(_0x3ee2d9,null));}; \ No newline at end of file +var _0x262a=['jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','FreshsalesConfiguration','rawAttributes','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','fields','include','find','create','body','getSubjects','findOne','nolimit','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto'];(function(_0x5aec8d,_0x466086){var _0x51e3b3=function(_0x4686f3){while(--_0x4686f3){_0x5aec8d['push'](_0x5aec8d['shift']());}};_0x51e3b3(++_0x466086);}(_0x262a,0x178));var _0xa262=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0x262a[_0x4cf8d4];return _0x2c1beb;};'use strict';var emlformat=require(_0xa262('0x0'));var rimraf=require(_0xa262('0x1'));var zipdir=require(_0xa262('0x2'));var jsonpatch=require(_0xa262('0x3'));var rp=require(_0xa262('0x4'));var moment=require(_0xa262('0x5'));var BPromise=require(_0xa262('0x6'));var Mustache=require(_0xa262('0x7'));var util=require(_0xa262('0x8'));var path=require(_0xa262('0x9'));var sox=require(_0xa262('0xa'));var csv=require(_0xa262('0xb'));var ejs=require(_0xa262('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa262('0xd'));var jsforce=require(_0xa262('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa262('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa262('0xf'));var authService=require(_0xa262('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa262('0x11'));var hardwareService=require(_0xa262('0x12'));var logger=require(_0xa262('0x13'))('api');var utils=require(_0xa262('0x14'));var config=require(_0xa262('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa262('0x16'))['db'];function respondWithStatusCode(_0x3eb8b5,_0x497bdf){_0x497bdf=_0x497bdf||0xcc;return function(_0x3a4cf9){if(_0x3a4cf9){return _0x3eb8b5[_0xa262('0x17')](_0x497bdf);}return _0x3eb8b5[_0xa262('0x18')](_0x497bdf)[_0xa262('0x19')]();};}function respondWithResult(_0x4adf28,_0x2a841d){_0x2a841d=_0x2a841d||0xc8;return function(_0x1efbf2){if(_0x1efbf2){return _0x4adf28['status'](_0x2a841d)['json'](_0x1efbf2);}};}function respondWithFilteredResult(_0x327069,_0x31d62a){return function(_0x4ec5a9){if(_0x4ec5a9){var _0x8b71de=typeof _0x31d62a['offset']===_0xa262('0x1a')&&typeof _0x31d62a[_0xa262('0x1b')]==='undefined';var _0x55313b=_0x4ec5a9[_0xa262('0x1c')];var _0xb6fe97=_0x8b71de?0x0:_0x31d62a['offset'];var _0x36f7f0=_0x8b71de?_0x4ec5a9['count']:_0x31d62a[_0xa262('0x1d')]+_0x31d62a['limit'];var _0x5d5295;if(_0x36f7f0>=_0x55313b){_0x36f7f0=_0x55313b;_0x5d5295=0xc8;}else{_0x5d5295=0xce;}_0x327069[_0xa262('0x18')](_0x5d5295);return _0x327069[_0xa262('0x1e')](_0xa262('0x1f'),_0xb6fe97+'-'+_0x36f7f0+'/'+_0x55313b)[_0xa262('0x20')](_0x4ec5a9);}return null;};}function patchUpdates(_0x222ba3){return function(_0x127301){try{jsonpatch[_0xa262('0x21')](_0x127301,_0x222ba3,!![]);}catch(_0x287b01){return BPromise[_0xa262('0x22')](_0x287b01);}return _0x127301[_0xa262('0x23')]();};}function saveUpdates(_0x58dc2c,_0x16ddcd){return function(_0x47a346){if(_0x47a346){return _0x47a346[_0xa262('0x24')](_0x58dc2c)[_0xa262('0x25')](function(_0x24e2c7){return _0x24e2c7;});}return null;};}function removeEntity(_0x31f497,_0x2c3c62){return function(_0x5cee88){if(_0x5cee88){return _0x5cee88[_0xa262('0x26')]()['then'](function(){_0x31f497[_0xa262('0x18')](0xcc)[_0xa262('0x19')]();});}};}function handleEntityNotFound(_0x182305,_0xe49df8){return function(_0x1e4abf){if(!_0x1e4abf){_0x182305[_0xa262('0x17')](0x194);}return _0x1e4abf;};}function handleError(_0x38aa8f,_0x5c92d4){_0x5c92d4=_0x5c92d4||0x1f4;return function(_0x7fd8c6){logger['error'](_0x7fd8c6[_0xa262('0x27')]);if(_0x7fd8c6[_0xa262('0x28')]){delete _0x7fd8c6[_0xa262('0x28')];}_0x38aa8f[_0xa262('0x18')](_0x5c92d4)[_0xa262('0x29')](_0x7fd8c6);};}exports['index']=function(_0x5f2412,_0x2bbf5f){var _0x1e6147={},_0x343b29={},_0x1ddaf4={'count':0x0,'rows':[]};var _0x1bda70=_['map'](db[_0xa262('0x2a')][_0xa262('0x2b')],function(_0x4cfacc){return{'name':_0x4cfacc['fieldName'],'type':_0x4cfacc['type']['key']};});_0x343b29[_0xa262('0x2c')]=_[_0xa262('0x2d')](_0x1bda70,_0xa262('0x28'));_0x343b29[_0xa262('0x2e')]=_['keys'](_0x5f2412[_0xa262('0x2e')]);_0x343b29[_0xa262('0x2f')]=_[_0xa262('0x30')](_0x343b29[_0xa262('0x2c')],_0x343b29[_0xa262('0x2e')]);_0x1e6147[_0xa262('0x31')]=_[_0xa262('0x30')](_0x343b29[_0xa262('0x2c')],qs['fields'](_0x5f2412['query']['fields']));_0x1e6147['attributes']=_0x1e6147[_0xa262('0x31')][_0xa262('0x32')]?_0x1e6147[_0xa262('0x31')]:_0x343b29[_0xa262('0x2c')];if(!_0x5f2412['query'][_0xa262('0x33')]('nolimit')){_0x1e6147[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0x5f2412[_0xa262('0x2e')]['limit']);_0x1e6147[_0xa262('0x1d')]=qs[_0xa262('0x1d')](_0x5f2412[_0xa262('0x2e')]['offset']);}_0x1e6147[_0xa262('0x34')]=qs[_0xa262('0x35')](_0x5f2412['query'][_0xa262('0x35')]);_0x1e6147[_0xa262('0x36')]=qs[_0xa262('0x2f')](_[_0xa262('0x37')](_0x5f2412[_0xa262('0x2e')],_0x343b29[_0xa262('0x2f')]),_0x1bda70);if(_0x5f2412[_0xa262('0x2e')][_0xa262('0x38')]){_0x1e6147['where']=_[_0xa262('0x39')](_0x1e6147[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x1bda70,function(_0x118cf2){if(_0x118cf2[_0xa262('0x3a')]!==_0xa262('0x3b')){var _0x15dc53={};_0x15dc53[_0x118cf2[_0xa262('0x28')]]={'$like':'%'+_0x5f2412[_0xa262('0x2e')][_0xa262('0x38')]+'%'};return _0x15dc53;}})});}_0x1e6147=_[_0xa262('0x39')]({},_0x1e6147,_0x5f2412[_0xa262('0x3c')]);var _0x5f1283={'where':_0x1e6147['where']};return db[_0xa262('0x2a')][_0xa262('0x1c')](_0x5f1283)[_0xa262('0x25')](function(_0x1843c3){_0x1ddaf4[_0xa262('0x1c')]=_0x1843c3;if(_0x5f2412[_0xa262('0x2e')][_0xa262('0x3d')]){_0x1e6147['include']=[{'all':!![]}];}return db[_0xa262('0x2a')][_0xa262('0x3e')](_0x1e6147);})['then'](function(_0x32cc4f){_0x1ddaf4['rows']=_0x32cc4f;return _0x1ddaf4;})['then'](respondWithFilteredResult(_0x2bbf5f,_0x1e6147))[_0xa262('0x3f')](handleError(_0x2bbf5f,null));};exports[_0xa262('0x40')]=function(_0x1e911e,_0x2c4b81){var _0x2f64ca={'raw':![],'where':{'id':_0x1e911e[_0xa262('0x41')]['id']}},_0x37e643={};_0x37e643['model']=_[_0xa262('0x42')](db['FreshsalesConfiguration'][_0xa262('0x2b')]);_0x37e643[_0xa262('0x2e')]=_['keys'](_0x1e911e[_0xa262('0x2e')]);_0x37e643['filters']=_[_0xa262('0x30')](_0x37e643[_0xa262('0x2c')],_0x37e643[_0xa262('0x2e')]);_0x2f64ca[_0xa262('0x31')]=_[_0xa262('0x30')](_0x37e643[_0xa262('0x2c')],qs[_0xa262('0x43')](_0x1e911e[_0xa262('0x2e')][_0xa262('0x43')]));_0x2f64ca[_0xa262('0x31')]=_0x2f64ca['attributes'][_0xa262('0x32')]?_0x2f64ca[_0xa262('0x31')]:_0x37e643[_0xa262('0x2c')];if(_0x1e911e[_0xa262('0x2e')][_0xa262('0x3d')]){_0x2f64ca[_0xa262('0x44')]=[{'all':!![]}];}_0x2f64ca=_[_0xa262('0x39')]({},_0x2f64ca,_0x1e911e[_0xa262('0x3c')]);return db['FreshsalesConfiguration'][_0xa262('0x45')](_0x2f64ca)[_0xa262('0x25')](handleEntityNotFound(_0x2c4b81,null))[_0xa262('0x25')](respondWithResult(_0x2c4b81,null))[_0xa262('0x3f')](handleError(_0x2c4b81,null));};exports[_0xa262('0x46')]=function(_0x987690,_0x1749be){return db[_0xa262('0x2a')][_0xa262('0x46')](_0x987690[_0xa262('0x47')],{})['then'](respondWithResult(_0x1749be,0xc9))[_0xa262('0x3f')](handleError(_0x1749be,null));};exports[_0xa262('0x24')]=function(_0x17bda8,_0x807c82){if(_0x17bda8['body']['id']){delete _0x17bda8[_0xa262('0x47')]['id'];}return db[_0xa262('0x2a')][_0xa262('0x45')]({'where':{'id':_0x17bda8[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x807c82,null))[_0xa262('0x25')](saveUpdates(_0x17bda8[_0xa262('0x47')],null))[_0xa262('0x25')](respondWithResult(_0x807c82,null))[_0xa262('0x3f')](handleError(_0x807c82,null));};exports[_0xa262('0x26')]=function(_0x52ccad,_0x333aab){return db[_0xa262('0x2a')][_0xa262('0x45')]({'where':{'id':_0x52ccad[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x333aab,null))[_0xa262('0x25')](removeEntity(_0x333aab,null))['catch'](handleError(_0x333aab,null));};exports[_0xa262('0x48')]=function(_0x1fc8d3,_0x428022,_0x1dfec0){var _0x2c463c={};var _0x5297fd={};var _0x4798e8;var _0x466b3b;return db[_0xa262('0x2a')][_0xa262('0x49')]({'where':{'id':_0x1fc8d3[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x428022,null))[_0xa262('0x25')](function(_0x128448){if(_0x128448){_0x4798e8=_0x128448;_0x5297fd['model']=_[_0xa262('0x42')](db['FreshsalesField']['rawAttributes']);_0x5297fd['query']=_[_0xa262('0x42')](_0x1fc8d3[_0xa262('0x2e')]);_0x5297fd[_0xa262('0x2f')]=_[_0xa262('0x30')](_0x5297fd[_0xa262('0x2c')],_0x5297fd['query']);_0x2c463c['attributes']=_[_0xa262('0x30')](_0x5297fd[_0xa262('0x2c')],qs[_0xa262('0x43')](_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x43')]));_0x2c463c[_0xa262('0x31')]=_0x2c463c[_0xa262('0x31')][_0xa262('0x32')]?_0x2c463c['attributes']:_0x5297fd['model'];_0x2c463c[_0xa262('0x34')]=qs[_0xa262('0x35')](_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x35')]);_0x2c463c[_0xa262('0x36')]=qs['filters'](_[_0xa262('0x37')](_0x1fc8d3[_0xa262('0x2e')],_0x5297fd['filters']));if(_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x38')]){_0x2c463c[_0xa262('0x36')]=_[_0xa262('0x39')](_0x2c463c[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x2c463c[_0xa262('0x31')],function(_0x2ea4e0){var _0x415175={};_0x415175[_0x2ea4e0]={'$like':'%'+_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x38')]+'%'};return _0x415175;})});}_0x2c463c=_[_0xa262('0x39')]({},_0x2c463c,_0x1fc8d3[_0xa262('0x3c')]);return _0x4798e8[_0xa262('0x48')](_0x2c463c);}})['then'](function(_0x4e4260){if(_0x4e4260){_0x466b3b=_0x4e4260[_0xa262('0x32')];if(!_0x1fc8d3['query'][_0xa262('0x33')](_0xa262('0x4a'))){_0x2c463c[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0x1fc8d3['query'][_0xa262('0x1b')]);_0x2c463c['offset']=qs[_0xa262('0x1d')](_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x1d')]);}return _0x4798e8['getSubjects'](_0x2c463c);}})['then'](function(_0x1c2e81){if(_0x1c2e81){return _0x1c2e81?{'count':_0x466b3b,'rows':_0x1c2e81}:null;}})['then'](respondWithResult(_0x428022,null))[_0xa262('0x3f')](handleError(_0x428022,null));};exports[_0xa262('0x4b')]=function(_0xafda7c,_0x59d407,_0x3bece4){var _0x4e110e={};var _0x19111b={};var _0x468eab;var _0x5c055b;return db[_0xa262('0x2a')][_0xa262('0x49')]({'where':{'id':_0xafda7c[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x59d407,null))['then'](function(_0x5220f2){if(_0x5220f2){_0x468eab=_0x5220f2;_0x19111b[_0xa262('0x2c')]=_[_0xa262('0x42')](db[_0xa262('0x4c')]['rawAttributes']);_0x19111b[_0xa262('0x2e')]=_['keys'](_0xafda7c[_0xa262('0x2e')]);_0x19111b['filters']=_[_0xa262('0x30')](_0x19111b[_0xa262('0x2c')],_0x19111b[_0xa262('0x2e')]);_0x4e110e['attributes']=_['intersection'](_0x19111b[_0xa262('0x2c')],qs['fields'](_0xafda7c[_0xa262('0x2e')][_0xa262('0x43')]));_0x4e110e[_0xa262('0x31')]=_0x4e110e[_0xa262('0x31')][_0xa262('0x32')]?_0x4e110e[_0xa262('0x31')]:_0x19111b['model'];_0x4e110e[_0xa262('0x34')]=qs[_0xa262('0x35')](_0xafda7c[_0xa262('0x2e')]['sort']);_0x4e110e['where']=qs[_0xa262('0x2f')](_[_0xa262('0x37')](_0xafda7c[_0xa262('0x2e')],_0x19111b[_0xa262('0x2f')]));if(_0xafda7c[_0xa262('0x2e')][_0xa262('0x38')]){_0x4e110e[_0xa262('0x36')]=_[_0xa262('0x39')](_0x4e110e[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x4e110e[_0xa262('0x31')],function(_0x4959ab){var _0x2f72d9={};_0x2f72d9[_0x4959ab]={'$like':'%'+_0xafda7c['query'][_0xa262('0x38')]+'%'};return _0x2f72d9;})});}_0x4e110e=_[_0xa262('0x39')]({},_0x4e110e,_0xafda7c[_0xa262('0x3c')]);return _0x468eab[_0xa262('0x4b')](_0x4e110e);}})['then'](function(_0xcb30aa){if(_0xcb30aa){_0x5c055b=_0xcb30aa[_0xa262('0x32')];if(!_0xafda7c['query'][_0xa262('0x33')](_0xa262('0x4a'))){_0x4e110e[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0xafda7c[_0xa262('0x2e')][_0xa262('0x1b')]);_0x4e110e[_0xa262('0x1d')]=qs['offset'](_0xafda7c[_0xa262('0x2e')]['offset']);}return _0x468eab[_0xa262('0x4b')](_0x4e110e);}})[_0xa262('0x25')](function(_0x571f5e){if(_0x571f5e){return _0x571f5e?{'count':_0x5c055b,'rows':_0x571f5e}:null;}})[_0xa262('0x25')](respondWithResult(_0x59d407,null))[_0xa262('0x3f')](handleError(_0x59d407,null));};exports[_0xa262('0x4d')]=function(_0x2917d8,_0x3e9ae7,_0x83e4bd){var _0x3d5d0c={};var _0x156534={};var _0xb610a7;var _0x2bdff8;return db[_0xa262('0x2a')][_0xa262('0x49')]({'where':{'id':_0x2917d8['params']['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x3e9ae7,null))[_0xa262('0x25')](function(_0x5f0db6){if(_0x5f0db6){_0xb610a7=_0x5f0db6;_0x156534[_0xa262('0x2c')]=_[_0xa262('0x42')](db[_0xa262('0x4c')][_0xa262('0x2b')]);_0x156534[_0xa262('0x2e')]=_[_0xa262('0x42')](_0x2917d8['query']);_0x156534[_0xa262('0x2f')]=_[_0xa262('0x30')](_0x156534[_0xa262('0x2c')],_0x156534['query']);_0x3d5d0c[_0xa262('0x31')]=_[_0xa262('0x30')](_0x156534[_0xa262('0x2c')],qs[_0xa262('0x43')](_0x2917d8[_0xa262('0x2e')]['fields']));_0x3d5d0c[_0xa262('0x31')]=_0x3d5d0c[_0xa262('0x31')]['length']?_0x3d5d0c[_0xa262('0x31')]:_0x156534['model'];_0x3d5d0c['order']=qs['sort'](_0x2917d8['query'][_0xa262('0x35')]);_0x3d5d0c[_0xa262('0x36')]=qs[_0xa262('0x2f')](_['pick'](_0x2917d8['query'],_0x156534['filters']));if(_0x2917d8[_0xa262('0x2e')][_0xa262('0x38')]){_0x3d5d0c[_0xa262('0x36')]=_['merge'](_0x3d5d0c[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x3d5d0c[_0xa262('0x31')],function(_0x344def){var _0x1c0d09={};_0x1c0d09[_0x344def]={'$like':'%'+_0x2917d8[_0xa262('0x2e')]['filter']+'%'};return _0x1c0d09;})});}_0x3d5d0c=_[_0xa262('0x39')]({},_0x3d5d0c,_0x2917d8[_0xa262('0x3c')]);return _0xb610a7[_0xa262('0x4d')](_0x3d5d0c);}})[_0xa262('0x25')](function(_0x3226f7){if(_0x3226f7){_0x2bdff8=_0x3226f7['length'];if(!_0x2917d8[_0xa262('0x2e')][_0xa262('0x33')](_0xa262('0x4a'))){_0x3d5d0c[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0x2917d8['query'][_0xa262('0x1b')]);_0x3d5d0c['offset']=qs[_0xa262('0x1d')](_0x2917d8[_0xa262('0x2e')][_0xa262('0x1d')]);}return _0xb610a7['getFields'](_0x3d5d0c);}})[_0xa262('0x25')](function(_0x3679a6){if(_0x3679a6){return _0x3679a6?{'count':_0x2bdff8,'rows':_0x3679a6}:null;}})[_0xa262('0x25')](respondWithResult(_0x3e9ae7,null))[_0xa262('0x3f')](handleError(_0x3e9ae7,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d990f24..e2077c2 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 _0x37e4=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3f7e2a,_0x5a8d7e){var _0x4ea758=function(_0x17e871){while(--_0x17e871){_0x3f7e2a['push'](_0x3f7e2a['shift']());}};_0x4ea758(++_0x5a8d7e);}(_0x37e4,0xcc));var _0x437e=function(_0x3de21e,_0x4f085c){_0x3de21e=_0x3de21e-0x0;var _0x4b9b1f=_0x37e4[_0x3de21e];return _0x4b9b1f;};'use strict';var _=require('lodash');var util=require(_0x437e('0x0'));var logger=require(_0x437e('0x1'))('api');var moment=require(_0x437e('0x2'));var BPromise=require(_0x437e('0x3'));var rp=require(_0x437e('0x4'));var fs=require('fs');var path=require(_0x437e('0x5'));var rimraf=require(_0x437e('0x6'));var config=require(_0x437e('0x7'));var attributes=require(_0x437e('0x8'));module[_0x437e('0x9')]=function(_0x29f90c,_0x4b6844){return _0x29f90c['define']('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01ff=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x507222,_0x3cebc6){var _0x3edbca=function(_0x1f6558){while(--_0x1f6558){_0x507222['push'](_0x507222['shift']());}};_0x3edbca(++_0x3cebc6);}(_0x01ff,0x176));var _0xf01f=function(_0x40a58f,_0xd17f13){_0x40a58f=_0x40a58f-0x0;var _0x596928=_0x01ff[_0x40a58f];return _0x596928;};'use strict';var _=require(_0xf01f('0x0'));var util=require(_0xf01f('0x1'));var logger=require(_0xf01f('0x2'))(_0xf01f('0x3'));var moment=require(_0xf01f('0x4'));var BPromise=require(_0xf01f('0x5'));var rp=require(_0xf01f('0x6'));var fs=require('fs');var path=require(_0xf01f('0x7'));var rimraf=require(_0xf01f('0x8'));var config=require(_0xf01f('0x9'));var attributes=require(_0xf01f('0xa'));module[_0xf01f('0xb')]=function(_0xf9ddbe,_0x316b48){return _0xf9ddbe[_0xf01f('0xc')](_0xf01f('0xd'),attributes,{'tableName':_0xf01f('0xe'),'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 fc9497a..2d09421 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 _0xdd09=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2398ad,_0x2efd5){var _0x521e48=function(_0x11a4bd){while(--_0x11a4bd){_0x2398ad['push'](_0x2398ad['shift']());}};_0x521e48(++_0x2efd5);}(_0xdd09,0x1a4));var _0x9dd0=function(_0xb97b6,_0x57a1be){_0xb97b6=_0xb97b6-0x0;var _0xd9ad14=_0xdd09[_0xb97b6];return _0xd9ad14;};'use strict';var _=require(_0x9dd0('0x0'));var util=require(_0x9dd0('0x1'));var moment=require(_0x9dd0('0x2'));var BPromise=require('bluebird');var rs=require(_0x9dd0('0x3'));var fs=require('fs');var Redis=require(_0x9dd0('0x4'));var db=require(_0x9dd0('0x5'))['db'];var utils=require(_0x9dd0('0x6'));var logger=require(_0x9dd0('0x7'))(_0x9dd0('0x8'));var config=require(_0x9dd0('0x9'));var jayson=require(_0x9dd0('0xa'));var client=jayson[_0x9dd0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29edec,_0x2e72c9,_0x5abc9d){return new BPromise(function(_0x2ef9e3,_0x76792f){return client[_0x9dd0('0xc')](_0x29edec,_0x5abc9d)[_0x9dd0('0xd')](function(_0x33c540){logger[_0x9dd0('0xe')](_0x9dd0('0xf'),_0x2e72c9,_0x9dd0('0x10'));logger[_0x9dd0('0x11')](_0x9dd0('0x12'),_0x2e72c9,_0x9dd0('0x10'),JSON['stringify'](_0x33c540));if(_0x33c540['error']){if(_0x33c540[_0x9dd0('0x13')][_0x9dd0('0x14')]===0x1f4){logger[_0x9dd0('0x13')](_0x9dd0('0xf'),_0x2e72c9,_0x33c540[_0x9dd0('0x13')][_0x9dd0('0x15')]);return _0x76792f(_0x33c540[_0x9dd0('0x13')][_0x9dd0('0x15')]);}logger[_0x9dd0('0x13')](_0x9dd0('0xf'),_0x2e72c9,_0x33c540['error'][_0x9dd0('0x15')]);return _0x2ef9e3(_0x33c540[_0x9dd0('0x13')][_0x9dd0('0x15')]);}else{logger[_0x9dd0('0xe')](_0x9dd0('0xf'),_0x2e72c9,_0x9dd0('0x10'));_0x2ef9e3(_0x33c540[_0x9dd0('0x16')]['message']);}})[_0x9dd0('0x17')](function(_0x27d6e8){logger[_0x9dd0('0x13')](_0x9dd0('0xf'),_0x2e72c9,_0x27d6e8);_0x76792f(_0x27d6e8);});});} \ No newline at end of file +var _0x59fa=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x59fa,0x74));var _0xa59f=function(_0x1d0cc0,_0x4091f2){_0x1d0cc0=_0x1d0cc0-0x0;var _0xa3fd94=_0x59fa[_0x1d0cc0];return _0xa3fd94;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa59f('0x0'));var rs=require(_0xa59f('0x1'));var fs=require('fs');var Redis=require(_0xa59f('0x2'));var db=require(_0xa59f('0x3'))['db'];var utils=require(_0xa59f('0x4'));var logger=require(_0xa59f('0x5'))(_0xa59f('0x6'));var config=require('../../config/environment');var jayson=require(_0xa59f('0x7'));var client=jayson[_0xa59f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e7e9,_0x239c51,_0x6647f8){return new BPromise(function(_0x276c24,_0x307b4f){return client[_0xa59f('0x9')](_0x37e7e9,_0x6647f8)['then'](function(_0x3122e6){logger[_0xa59f('0xa')](_0xa59f('0xb'),_0x239c51,'request\x20sent');logger[_0xa59f('0xc')](_0xa59f('0xd'),_0x239c51,_0xa59f('0xe'),JSON['stringify'](_0x3122e6));if(_0x3122e6['error']){if(_0x3122e6[_0xa59f('0xf')][_0xa59f('0x10')]===0x1f4){logger[_0xa59f('0xf')](_0xa59f('0xb'),_0x239c51,_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);return _0x307b4f(_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);}logger[_0xa59f('0xf')](_0xa59f('0xb'),_0x239c51,_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);return _0x276c24(_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);}else{logger['info'](_0xa59f('0xb'),_0x239c51,_0xa59f('0xe'));_0x276c24(_0x3122e6[_0xa59f('0x12')][_0xa59f('0x11')]);}})[_0xa59f('0x13')](function(_0x5db3fe){logger[_0xa59f('0xf')](_0xa59f('0xb'),_0x239c51,_0x5db3fe);_0x307b4f(_0x5db3fe);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 4ecbe0b..ebc75c3 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 _0x710e=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','isAuthenticated','show','post','update','delete'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x710e,0xb6));var _0xe710=function(_0x405e66,_0x38e21a){_0x405e66=_0x405e66-0x0;var _0x4cc766=_0x710e[_0x405e66];return _0x4cc766;};'use strict';var multer=require(_0xe710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe710('0x1'));var express=require(_0xe710('0x2'));var router=express[_0xe710('0x3')]();var fs_extra=require(_0xe710('0x4'));var auth=require(_0xe710('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe710('0x6'));var controller=require(_0xe710('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe710('0x8')]);router[_0xe710('0x9')](_0xe710('0xa'),auth[_0xe710('0xb')](),controller[_0xe710('0xc')]);router[_0xe710('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe710('0xa'),auth[_0xe710('0xb')](),controller[_0xe710('0xe')]);router[_0xe710('0xf')](_0xe710('0xa'),auth[_0xe710('0xb')](),controller[_0xe710('0x10')]);module[_0xe710('0x11')]=router; \ No newline at end of file +var _0xbbb8=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','create','put'];(function(_0x33824d,_0x5b5148){var _0xf3d06b=function(_0x19b333){while(--_0x19b333){_0x33824d['push'](_0x33824d['shift']());}};_0xf3d06b(++_0x5b5148);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x128b37,_0x2f8599){_0x128b37=_0x128b37-0x0;var _0x4d11d6=_0xbbb8[_0x128b37];return _0x4d11d6;};'use strict';var multer=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var path=require('path');var timeout=require(_0x8bbb('0x2'));var express=require(_0x8bbb('0x3'));var router=express['Router']();var fs_extra=require(_0x8bbb('0x4'));var auth=require(_0x8bbb('0x5'));var interaction=require(_0x8bbb('0x6'));var config=require(_0x8bbb('0x7'));var controller=require(_0x8bbb('0x8'));router[_0x8bbb('0x9')]('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xb')]);router[_0x8bbb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8bbb('0xc')]('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xd')]);router[_0x8bbb('0xe')](_0x8bbb('0xf'),auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x10')]);router[_0x8bbb('0x11')]('/:id',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x12')]);module[_0x8bbb('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 19adfe6..3cacff0 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 _0x1124=['customVariable','picklist','STRING','string','sequelize','ENUM','variable'];(function(_0x247342,_0x47523f){var _0x15df54=function(_0xa4738f){while(--_0xa4738f){_0x247342['push'](_0x247342['shift']());}};_0x15df54(++_0x47523f);}(_0x1124,0x7b));var _0x4112=function(_0x34786e,_0x1f0a24){_0x34786e=_0x34786e-0x0;var _0x28b149=_0x1124[_0x34786e];return _0x28b149;};'use strict';var Sequelize=require(_0x4112('0x0'));module['exports']={'type':{'type':Sequelize[_0x4112('0x1')]('string',_0x4112('0x2'),_0x4112('0x3'),'keyValue',_0x4112('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4112('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4112('0x1')](_0x4112('0x6'),_0x4112('0x2'),_0x4112('0x3'))},'keyContent':{'type':Sequelize[_0x4112('0x5')]},'idField':{'type':Sequelize[_0x4112('0x5')]},'nameField':{'type':Sequelize[_0x4112('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4112('0x5')]}}; \ No newline at end of file +var _0xab1c=['exports','ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0xab1c,0x104));var _0xcab1=function(_0x227e83,_0x217eb5){_0x227e83=_0x227e83-0x0;var _0x575c66=_0xab1c[_0x227e83];return _0x575c66;};'use strict';var Sequelize=require(_0xcab1('0x0'));module[_0xcab1('0x1')]={'type':{'type':Sequelize[_0xcab1('0x2')]('string',_0xcab1('0x3'),_0xcab1('0x4'),_0xcab1('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xcab1('0x6')]},'key':{'type':Sequelize[_0xcab1('0x6')]},'keyType':{'type':Sequelize[_0xcab1('0x2')](_0xcab1('0x7'),_0xcab1('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xcab1('0x6')]},'idField':{'type':Sequelize[_0xcab1('0x6')]},'nameField':{'type':Sequelize[_0xcab1('0x6')]},'customField':{'type':Sequelize[_0xcab1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcab1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 2b24103..7269e61 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 _0x9e4b=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','model','query','filters','intersection'];(function(_0x509258,_0x255532){var _0x2cbbdb=function(_0x274af5){while(--_0x274af5){_0x509258['push'](_0x509258['shift']());}};_0x2cbbdb(++_0x255532);}(_0x9e4b,0x1e1));var _0xb9e4=function(_0x4e690d,_0x947a77){_0x4e690d=_0x4e690d-0x0;var _0x2e07b5=_0x9e4b[_0x4e690d];return _0x2e07b5;};'use strict';var emlformat=require(_0xb9e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9e4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb9e4('0x3'));var util=require(_0xb9e4('0x4'));var path=require(_0xb9e4('0x5'));var sox=require(_0xb9e4('0x6'));var csv=require(_0xb9e4('0x7'));var ejs=require(_0xb9e4('0x8'));var fs=require('fs');var fs_extra=require(_0xb9e4('0x9'));var _=require(_0xb9e4('0xa'));var squel=require(_0xb9e4('0xb'));var crypto=require(_0xb9e4('0xc'));var jsforce=require(_0xb9e4('0xd'));var deskjs=require(_0xb9e4('0xe'));var toCsv=require(_0xb9e4('0x7'));var querystring=require(_0xb9e4('0xf'));var Papa=require(_0xb9e4('0x10'));var Redis=require(_0xb9e4('0x11'));var authService=require(_0xb9e4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb9e4('0x13'));var hardwareService=require(_0xb9e4('0x14'));var logger=require(_0xb9e4('0x15'))(_0xb9e4('0x16'));var utils=require('../../config/utils');var config=require(_0xb9e4('0x17'));var licenseUtil=require(_0xb9e4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36731e,_0x4f95ac){_0x4f95ac=_0x4f95ac||0xcc;return function(_0xcbf61d){if(_0xcbf61d){return _0x36731e[_0xb9e4('0x19')](_0x4f95ac);}return _0x36731e[_0xb9e4('0x1a')](_0x4f95ac)[_0xb9e4('0x1b')]();};}function respondWithResult(_0x529bc7,_0xa58d38){_0xa58d38=_0xa58d38||0xc8;return function(_0x4d9426){if(_0x4d9426){return _0x529bc7['status'](_0xa58d38)['json'](_0x4d9426);}};}function respondWithFilteredResult(_0x4edd01,_0x16e52a){return function(_0x38587f){if(_0x38587f){var _0x26f000=typeof _0x16e52a[_0xb9e4('0x1c')]==='undefined'&&typeof _0x16e52a['limit']===_0xb9e4('0x1d');var _0x499522=_0x38587f['count'];var _0x115883=_0x26f000?0x0:_0x16e52a[_0xb9e4('0x1c')];var _0x2a502f=_0x26f000?_0x38587f[_0xb9e4('0x1e')]:_0x16e52a['offset']+_0x16e52a[_0xb9e4('0x1f')];var _0x3ceaa3;if(_0x2a502f>=_0x499522){_0x2a502f=_0x499522;_0x3ceaa3=0xc8;}else{_0x3ceaa3=0xce;}_0x4edd01[_0xb9e4('0x1a')](_0x3ceaa3);return _0x4edd01[_0xb9e4('0x20')]('Content-Range',_0x115883+'-'+_0x2a502f+'/'+_0x499522)['json'](_0x38587f);}return null;};}function patchUpdates(_0x38ec62){return function(_0x391f56){try{jsonpatch[_0xb9e4('0x21')](_0x391f56,_0x38ec62,!![]);}catch(_0x282508){return BPromise[_0xb9e4('0x22')](_0x282508);}return _0x391f56[_0xb9e4('0x23')]();};}function saveUpdates(_0x1418e9,_0x5793b7){return function(_0x4e6e1b){if(_0x4e6e1b){return _0x4e6e1b['update'](_0x1418e9)['then'](function(_0x34b267){return _0x34b267;});}return null;};}function removeEntity(_0x2a938d,_0x4d2ac1){return function(_0x16ccc3){if(_0x16ccc3){return _0x16ccc3[_0xb9e4('0x24')]()[_0xb9e4('0x25')](function(){_0x2a938d['status'](0xcc)[_0xb9e4('0x1b')]();});}};}function handleEntityNotFound(_0xb8cf3e,_0x4e8794){return function(_0x3c92b0){if(!_0x3c92b0){_0xb8cf3e[_0xb9e4('0x19')](0x194);}return _0x3c92b0;};}function handleError(_0x2d6a41,_0x1521ed){_0x1521ed=_0x1521ed||0x1f4;return function(_0x58aa06){logger[_0xb9e4('0x26')](_0x58aa06[_0xb9e4('0x27')]);if(_0x58aa06['name']){delete _0x58aa06[_0xb9e4('0x28')];}_0x2d6a41[_0xb9e4('0x1a')](_0x1521ed)[_0xb9e4('0x29')](_0x58aa06);};}exports[_0xb9e4('0x2a')]=function(_0x2af155,_0x375b67){var _0x1cde24={},_0x9c8cb={},_0x227810={'count':0x0,'rows':[]};var _0xc8b7f5=_[_0xb9e4('0x2b')](db[_0xb9e4('0x2c')][_0xb9e4('0x2d')],function(_0x397c05){return{'name':_0x397c05[_0xb9e4('0x2e')],'type':_0x397c05['type']['key']};});_0x9c8cb[_0xb9e4('0x2f')]=_['map'](_0xc8b7f5,_0xb9e4('0x28'));_0x9c8cb[_0xb9e4('0x30')]=_['keys'](_0x2af155[_0xb9e4('0x30')]);_0x9c8cb[_0xb9e4('0x31')]=_[_0xb9e4('0x32')](_0x9c8cb['model'],_0x9c8cb[_0xb9e4('0x30')]);_0x1cde24['attributes']=_['intersection'](_0x9c8cb[_0xb9e4('0x2f')],qs['fields'](_0x2af155[_0xb9e4('0x30')][_0xb9e4('0x33')]));_0x1cde24[_0xb9e4('0x34')]=_0x1cde24[_0xb9e4('0x34')][_0xb9e4('0x35')]?_0x1cde24[_0xb9e4('0x34')]:_0x9c8cb[_0xb9e4('0x2f')];if(!_0x2af155[_0xb9e4('0x30')][_0xb9e4('0x36')](_0xb9e4('0x37'))){_0x1cde24[_0xb9e4('0x1f')]=qs[_0xb9e4('0x1f')](_0x2af155[_0xb9e4('0x30')][_0xb9e4('0x1f')]);_0x1cde24['offset']=qs['offset'](_0x2af155[_0xb9e4('0x30')][_0xb9e4('0x1c')]);}_0x1cde24[_0xb9e4('0x38')]=qs[_0xb9e4('0x39')](_0x2af155[_0xb9e4('0x30')][_0xb9e4('0x39')]);_0x1cde24[_0xb9e4('0x3a')]=qs[_0xb9e4('0x31')](_[_0xb9e4('0x3b')](_0x2af155['query'],_0x9c8cb[_0xb9e4('0x31')]),_0xc8b7f5);if(_0x2af155[_0xb9e4('0x30')]['filter']){_0x1cde24[_0xb9e4('0x3a')]=_[_0xb9e4('0x3c')](_0x1cde24[_0xb9e4('0x3a')],{'$or':_[_0xb9e4('0x2b')](_0xc8b7f5,function(_0x71eaa){if(_0x71eaa[_0xb9e4('0x3d')]!==_0xb9e4('0x3e')){var _0x20a766={};_0x20a766[_0x71eaa['name']]={'$like':'%'+_0x2af155[_0xb9e4('0x30')]['filter']+'%'};return _0x20a766;}})});}_0x1cde24=_[_0xb9e4('0x3c')]({},_0x1cde24,_0x2af155[_0xb9e4('0x3f')]);var _0xac2ec6={'where':_0x1cde24['where']};return db[_0xb9e4('0x2c')][_0xb9e4('0x1e')](_0xac2ec6)[_0xb9e4('0x25')](function(_0x26d93e){_0x227810[_0xb9e4('0x1e')]=_0x26d93e;if(_0x2af155[_0xb9e4('0x30')][_0xb9e4('0x40')]){_0x1cde24[_0xb9e4('0x41')]=[{'all':!![]}];}return db[_0xb9e4('0x2c')][_0xb9e4('0x42')](_0x1cde24);})[_0xb9e4('0x25')](function(_0x4b94fa){_0x227810[_0xb9e4('0x43')]=_0x4b94fa;return _0x227810;})[_0xb9e4('0x25')](respondWithFilteredResult(_0x375b67,_0x1cde24))[_0xb9e4('0x44')](handleError(_0x375b67,null));};exports[_0xb9e4('0x45')]=function(_0x58a82b,_0x2af7a8){var _0x1aa862={'raw':!![],'where':{'id':_0x58a82b[_0xb9e4('0x46')]['id']}},_0x3f876a={};_0x3f876a[_0xb9e4('0x2f')]=_[_0xb9e4('0x47')](db[_0xb9e4('0x2c')]['rawAttributes']);_0x3f876a[_0xb9e4('0x30')]=_[_0xb9e4('0x47')](_0x58a82b[_0xb9e4('0x30')]);_0x3f876a[_0xb9e4('0x31')]=_[_0xb9e4('0x32')](_0x3f876a[_0xb9e4('0x2f')],_0x3f876a[_0xb9e4('0x30')]);_0x1aa862[_0xb9e4('0x34')]=_['intersection'](_0x3f876a['model'],qs[_0xb9e4('0x33')](_0x58a82b['query'][_0xb9e4('0x33')]));_0x1aa862['attributes']=_0x1aa862['attributes'][_0xb9e4('0x35')]?_0x1aa862['attributes']:_0x3f876a[_0xb9e4('0x2f')];if(_0x58a82b['query'][_0xb9e4('0x40')]){_0x1aa862[_0xb9e4('0x41')]=[{'all':!![]}];}_0x1aa862=_[_0xb9e4('0x3c')]({},_0x1aa862,_0x58a82b[_0xb9e4('0x3f')]);return db['FreshsalesField'][_0xb9e4('0x48')](_0x1aa862)[_0xb9e4('0x25')](handleEntityNotFound(_0x2af7a8,null))[_0xb9e4('0x25')](respondWithResult(_0x2af7a8,null))[_0xb9e4('0x44')](handleError(_0x2af7a8,null));};exports[_0xb9e4('0x49')]=function(_0x174914,_0x5d392e){return db[_0xb9e4('0x2c')][_0xb9e4('0x49')](_0x174914[_0xb9e4('0x4a')],{})['then'](respondWithResult(_0x5d392e,0xc9))[_0xb9e4('0x44')](handleError(_0x5d392e,null));};exports[_0xb9e4('0x4b')]=function(_0x1f43b5,_0x8b2c66){if(_0x1f43b5[_0xb9e4('0x4a')]['id']){delete _0x1f43b5[_0xb9e4('0x4a')]['id'];}return db[_0xb9e4('0x2c')][_0xb9e4('0x48')]({'where':{'id':_0x1f43b5['params']['id']}})[_0xb9e4('0x25')](handleEntityNotFound(_0x8b2c66,null))[_0xb9e4('0x25')](saveUpdates(_0x1f43b5[_0xb9e4('0x4a')],null))['then'](respondWithResult(_0x8b2c66,null))[_0xb9e4('0x44')](handleError(_0x8b2c66,null));};exports['destroy']=function(_0x5413c2,_0x172b94){return db[_0xb9e4('0x2c')][_0xb9e4('0x48')]({'where':{'id':_0x5413c2['params']['id']}})[_0xb9e4('0x25')](handleEntityNotFound(_0x172b94,null))[_0xb9e4('0x25')](removeEntity(_0x172b94,null))[_0xb9e4('0x44')](handleError(_0x172b94,null));}; \ No newline at end of file +var _0x903d=['reject','save','then','destroy','sendStatus','error','name','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','status','end','json','offset','limit','undefined','count','apply'];(function(_0x34a6e9,_0x25cabe){var _0x11015c=function(_0x5c2ced){while(--_0x5c2ced){_0x34a6e9['push'](_0x34a6e9['shift']());}};_0x11015c(++_0x25cabe);}(_0x903d,0xba));var _0xd903=function(_0x2ab2ed,_0x1fd241){_0x2ab2ed=_0x2ab2ed-0x0;var _0x24d4d1=_0x903d[_0x2ab2ed];return _0x24d4d1;};'use strict';var emlformat=require(_0xd903('0x0'));var rimraf=require(_0xd903('0x1'));var zipdir=require(_0xd903('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd903('0x3'));var moment=require('moment');var BPromise=require(_0xd903('0x4'));var Mustache=require(_0xd903('0x5'));var util=require(_0xd903('0x6'));var path=require(_0xd903('0x7'));var sox=require('sox');var csv=require(_0xd903('0x8'));var ejs=require(_0xd903('0x9'));var fs=require('fs');var fs_extra=require(_0xd903('0xa'));var _=require(_0xd903('0xb'));var squel=require(_0xd903('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd903('0x8'));var querystring=require(_0xd903('0xd'));var Papa=require('papaparse');var Redis=require(_0xd903('0xe'));var authService=require(_0xd903('0xf'));var qs=require(_0xd903('0x10'));var as=require(_0xd903('0x11'));var hardwareService=require(_0xd903('0x12'));var logger=require(_0xd903('0x13'))(_0xd903('0x14'));var utils=require(_0xd903('0x15'));var config=require(_0xd903('0x16'));var licenseUtil=require(_0xd903('0x17'));var db=require(_0xd903('0x18'))['db'];function respondWithStatusCode(_0x382277,_0x1d18da){_0x1d18da=_0x1d18da||0xcc;return function(_0x34d5c1){if(_0x34d5c1){return _0x382277['sendStatus'](_0x1d18da);}return _0x382277[_0xd903('0x19')](_0x1d18da)[_0xd903('0x1a')]();};}function respondWithResult(_0x2a653a,_0x17804e){_0x17804e=_0x17804e||0xc8;return function(_0x43685a){if(_0x43685a){return _0x2a653a['status'](_0x17804e)[_0xd903('0x1b')](_0x43685a);}};}function respondWithFilteredResult(_0x998801,_0x277e23){return function(_0x87abad){if(_0x87abad){var _0x10dfe3=typeof _0x277e23[_0xd903('0x1c')]==='undefined'&&typeof _0x277e23[_0xd903('0x1d')]===_0xd903('0x1e');var _0x5d5202=_0x87abad[_0xd903('0x1f')];var _0x2cecfe=_0x10dfe3?0x0:_0x277e23[_0xd903('0x1c')];var _0x466e27=_0x10dfe3?_0x87abad[_0xd903('0x1f')]:_0x277e23['offset']+_0x277e23['limit'];var _0x15f35d;if(_0x466e27>=_0x5d5202){_0x466e27=_0x5d5202;_0x15f35d=0xc8;}else{_0x15f35d=0xce;}_0x998801[_0xd903('0x19')](_0x15f35d);return _0x998801['set']('Content-Range',_0x2cecfe+'-'+_0x466e27+'/'+_0x5d5202)[_0xd903('0x1b')](_0x87abad);}return null;};}function patchUpdates(_0x2807fd){return function(_0x50c238){try{jsonpatch[_0xd903('0x20')](_0x50c238,_0x2807fd,!![]);}catch(_0x3e53ed){return BPromise[_0xd903('0x21')](_0x3e53ed);}return _0x50c238[_0xd903('0x22')]();};}function saveUpdates(_0x197498,_0x5bb35e){return function(_0xf94177){if(_0xf94177){return _0xf94177['update'](_0x197498)[_0xd903('0x23')](function(_0x18a065){return _0x18a065;});}return null;};}function removeEntity(_0x16b37c,_0x222239){return function(_0x151936){if(_0x151936){return _0x151936[_0xd903('0x24')]()['then'](function(){_0x16b37c[_0xd903('0x19')](0xcc)[_0xd903('0x1a')]();});}};}function handleEntityNotFound(_0x44055f,_0x4e3468){return function(_0x45a278){if(!_0x45a278){_0x44055f[_0xd903('0x25')](0x194);}return _0x45a278;};}function handleError(_0x27e126,_0x4c6635){_0x4c6635=_0x4c6635||0x1f4;return function(_0x3e23d0){logger[_0xd903('0x26')](_0x3e23d0['stack']);if(_0x3e23d0[_0xd903('0x27')]){delete _0x3e23d0['name'];}_0x27e126[_0xd903('0x19')](_0x4c6635)['send'](_0x3e23d0);};}exports['index']=function(_0x4c0d42,_0x21bbfd){var _0x4b5a97={},_0x3cf74c={},_0x1f528f={'count':0x0,'rows':[]};var _0x1194ba=_[_0xd903('0x28')](db[_0xd903('0x29')][_0xd903('0x2a')],function(_0x23cb02){return{'name':_0x23cb02[_0xd903('0x2b')],'type':_0x23cb02[_0xd903('0x2c')]['key']};});_0x3cf74c[_0xd903('0x2d')]=_[_0xd903('0x28')](_0x1194ba,_0xd903('0x27'));_0x3cf74c[_0xd903('0x2e')]=_[_0xd903('0x2f')](_0x4c0d42['query']);_0x3cf74c[_0xd903('0x30')]=_[_0xd903('0x31')](_0x3cf74c['model'],_0x3cf74c[_0xd903('0x2e')]);_0x4b5a97[_0xd903('0x32')]=_[_0xd903('0x31')](_0x3cf74c['model'],qs['fields'](_0x4c0d42[_0xd903('0x2e')][_0xd903('0x33')]));_0x4b5a97[_0xd903('0x32')]=_0x4b5a97[_0xd903('0x32')][_0xd903('0x34')]?_0x4b5a97[_0xd903('0x32')]:_0x3cf74c[_0xd903('0x2d')];if(!_0x4c0d42[_0xd903('0x2e')][_0xd903('0x35')]('nolimit')){_0x4b5a97['limit']=qs[_0xd903('0x1d')](_0x4c0d42[_0xd903('0x2e')]['limit']);_0x4b5a97['offset']=qs[_0xd903('0x1c')](_0x4c0d42[_0xd903('0x2e')][_0xd903('0x1c')]);}_0x4b5a97[_0xd903('0x36')]=qs[_0xd903('0x37')](_0x4c0d42['query'][_0xd903('0x37')]);_0x4b5a97[_0xd903('0x38')]=qs[_0xd903('0x30')](_[_0xd903('0x39')](_0x4c0d42['query'],_0x3cf74c['filters']),_0x1194ba);if(_0x4c0d42[_0xd903('0x2e')][_0xd903('0x3a')]){_0x4b5a97[_0xd903('0x38')]=_[_0xd903('0x3b')](_0x4b5a97[_0xd903('0x38')],{'$or':_[_0xd903('0x28')](_0x1194ba,function(_0x1fcb4a){if(_0x1fcb4a['type']!==_0xd903('0x3c')){var _0x2f18fd={};_0x2f18fd[_0x1fcb4a[_0xd903('0x27')]]={'$like':'%'+_0x4c0d42[_0xd903('0x2e')]['filter']+'%'};return _0x2f18fd;}})});}_0x4b5a97=_[_0xd903('0x3b')]({},_0x4b5a97,_0x4c0d42[_0xd903('0x3d')]);var _0x13aeb4={'where':_0x4b5a97['where']};return db['FreshsalesField']['count'](_0x13aeb4)['then'](function(_0x539f6c){_0x1f528f[_0xd903('0x1f')]=_0x539f6c;if(_0x4c0d42[_0xd903('0x2e')][_0xd903('0x3e')]){_0x4b5a97['include']=[{'all':!![]}];}return db[_0xd903('0x29')][_0xd903('0x3f')](_0x4b5a97);})[_0xd903('0x23')](function(_0x27a0dd){_0x1f528f[_0xd903('0x40')]=_0x27a0dd;return _0x1f528f;})[_0xd903('0x23')](respondWithFilteredResult(_0x21bbfd,_0x4b5a97))['catch'](handleError(_0x21bbfd,null));};exports[_0xd903('0x41')]=function(_0x46d928,_0x285bac){var _0x2c6dff={'raw':!![],'where':{'id':_0x46d928[_0xd903('0x42')]['id']}},_0x42cde4={};_0x42cde4[_0xd903('0x2d')]=_[_0xd903('0x2f')](db[_0xd903('0x29')]['rawAttributes']);_0x42cde4['query']=_[_0xd903('0x2f')](_0x46d928[_0xd903('0x2e')]);_0x42cde4[_0xd903('0x30')]=_[_0xd903('0x31')](_0x42cde4[_0xd903('0x2d')],_0x42cde4[_0xd903('0x2e')]);_0x2c6dff[_0xd903('0x32')]=_[_0xd903('0x31')](_0x42cde4[_0xd903('0x2d')],qs[_0xd903('0x33')](_0x46d928[_0xd903('0x2e')][_0xd903('0x33')]));_0x2c6dff[_0xd903('0x32')]=_0x2c6dff[_0xd903('0x32')][_0xd903('0x34')]?_0x2c6dff[_0xd903('0x32')]:_0x42cde4['model'];if(_0x46d928[_0xd903('0x2e')][_0xd903('0x3e')]){_0x2c6dff[_0xd903('0x43')]=[{'all':!![]}];}_0x2c6dff=_[_0xd903('0x3b')]({},_0x2c6dff,_0x46d928['options']);return db[_0xd903('0x29')][_0xd903('0x44')](_0x2c6dff)['then'](handleEntityNotFound(_0x285bac,null))['then'](respondWithResult(_0x285bac,null))[_0xd903('0x45')](handleError(_0x285bac,null));};exports[_0xd903('0x46')]=function(_0x1b16d0,_0x17373a){return db[_0xd903('0x29')]['create'](_0x1b16d0[_0xd903('0x47')],{})['then'](respondWithResult(_0x17373a,0xc9))['catch'](handleError(_0x17373a,null));};exports[_0xd903('0x48')]=function(_0x3458c7,_0x402ee4){if(_0x3458c7[_0xd903('0x47')]['id']){delete _0x3458c7[_0xd903('0x47')]['id'];}return db[_0xd903('0x29')]['find']({'where':{'id':_0x3458c7[_0xd903('0x42')]['id']}})[_0xd903('0x23')](handleEntityNotFound(_0x402ee4,null))[_0xd903('0x23')](saveUpdates(_0x3458c7[_0xd903('0x47')],null))[_0xd903('0x23')](respondWithResult(_0x402ee4,null))['catch'](handleError(_0x402ee4,null));};exports[_0xd903('0x24')]=function(_0x3ccd8f,_0x4ec309){return db[_0xd903('0x29')]['find']({'where':{'id':_0x3ccd8f[_0xd903('0x42')]['id']}})[_0xd903('0x23')](handleEntityNotFound(_0x4ec309,null))[_0xd903('0x23')](removeEntity(_0x4ec309,null))[_0xd903('0x45')](handleError(_0x4ec309,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 38f4c3b..01cc841 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 _0xa3db=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0xa3db,0x10c));var _0xba3d=function(_0x56e6e9,_0x291627){_0x56e6e9=_0x56e6e9-0x0;var _0x5e3a01=_0xa3db[_0x56e6e9];return _0x5e3a01;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var logger=require(_0xba3d('0x2'))(_0xba3d('0x3'));var moment=require(_0xba3d('0x4'));var BPromise=require(_0xba3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba3d('0x6'));var config=require('../../config/environment');var attributes=require(_0xba3d('0x7'));module['exports']=function(_0x3f8f46,_0x12481b){return _0x3f8f46[_0xba3d('0x8')](_0xba3d('0x9'),attributes,{'tableName':_0xba3d('0xa'),'paranoid':![],'indexes':[{'name':_0xba3d('0xb'),'fields':[_0xba3d('0xc'),_0xba3d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdec3=['moment','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','../../config/logger','api'];(function(_0x3c59b5,_0x40975c){var _0x40a8a1=function(_0x2c38c8){while(--_0x2c38c8){_0x3c59b5['push'](_0x3c59b5['shift']());}};_0x40a8a1(++_0x40975c);}(_0xdec3,0x89));var _0x3dec=function(_0xbddf5d,_0x442a60){_0xbddf5d=_0xbddf5d-0x0;var _0x227959=_0xdec3[_0xbddf5d];return _0x227959;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var logger=require(_0x3dec('0x1'))(_0x3dec('0x2'));var moment=require(_0x3dec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dec('0x4'));var fs=require('fs');var path=require(_0x3dec('0x5'));var rimraf=require(_0x3dec('0x6'));var config=require(_0x3dec('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x3dec('0x8')]=function(_0x2894eb,_0x347c06){return _0x2894eb[_0x3dec('0x9')](_0x3dec('0xa'),attributes,{'tableName':_0x3dec('0xb'),'paranoid':![],'indexes':[{'name':_0x3dec('0xc'),'fields':['idField',_0x3dec('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 d176d99..83cce6f 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x1bd636,_0x447d90){var _0x51d175=function(_0x35da0c){while(--_0x35da0c){_0x1bd636['push'](_0x1bd636['shift']());}};_0x51d175(++_0x447d90);}(_0x2675,0x75));var _0x5267=function(_0x35ac44,_0x5ccee7){_0x35ac44=_0x35ac44-0x0;var _0x5290ff=_0x2675[_0x35ac44];return _0x5290ff;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x33aa8c,_0x156a5a){var _0x4d8f8=function(_0x5291c4){while(--_0x5291c4){_0x33aa8c['push'](_0x33aa8c['shift']());}};_0x4d8f8(++_0x156a5a);}(_0x5496,0x175));var _0x6549=function(_0x1169f5,_0x3794b8){_0x1169f5=_0x1169f5-0x0;var _0x4e9153=_0x5496[_0x1169f5];return _0x4e9153;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ee24139..b2e05ff 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(_0xd295dd,_0x37dd2e){var _0x31aa3c=function(_0x453735){while(--_0x453735){_0xd295dd['push'](_0xd295dd['shift']());}};_0x31aa3c(++_0x37dd2e);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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(_0x4eb657,_0x2e9d9e){var _0x48cbbb=function(_0x3a4688){while(--_0x3a4688){_0x4eb657['push'](_0x4eb657['shift']());}};_0x48cbbb(++_0x2e9d9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 d452abd..e2cad23 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 _0xdbc6=['STRING','username','ENUM','newTab','integrationTab'];(function(_0x3bfe0b,_0x59da21){var _0x2f64c3=function(_0xf8fdd7){while(--_0xf8fdd7){_0x3bfe0b['push'](_0x3bfe0b['shift']());}};_0x2f64c3(++_0x59da21);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x1e868a,_0x1ddf9e){_0x1e868a=_0x1e868a-0x0;var _0x5bd745=_0xdbc6[_0x1e868a];return _0x5bd745;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6dbc('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6dbc('0x0')],'unique':_0x6dbc('0x1')},'remoteUri':{'type':Sequelize[_0x6dbc('0x0')]},'password':{'type':Sequelize[_0x6dbc('0x0')]},'clientId':{'type':Sequelize[_0x6dbc('0x0')]},'clientSecret':{'type':Sequelize[_0x6dbc('0x0')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6dbc('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x6dbc('0x2')]('integrationTab',_0x6dbc('0x3')),'defaultValue':_0x6dbc('0x4')}}; \ No newline at end of file +var _0x7510=['newTab','exports','STRING','username'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x7510,0xa9));var _0x0751=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7510[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0751('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0751('0x1')]},'username':{'type':Sequelize[_0x0751('0x1')],'unique':_0x0751('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0751('0x1')]},'clientId':{'type':Sequelize[_0x0751('0x1')]},'clientSecret':{'type':Sequelize[_0x0751('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x0751('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4f7d9f9..1d723ab 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 _0x70b1=['slice','substring','lastIndexOf','Connection','clientSecret','login','password','concat','isNil','ticketType','describe','OwnerId','IsReminderSet','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','false','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','sendStatus','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','findOne','SalesforceConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','remoteUri','clientId','securityToken'];(function(_0x25ca44,_0x111633){var _0x4897c1=function(_0xf344b9){while(--_0xf344b9){_0x25ca44['push'](_0x25ca44['shift']());}};_0x4897c1(++_0x111633);}(_0x70b1,0x19a));var _0x170b=function(_0x258ae1,_0x1c3801){_0x258ae1=_0x258ae1-0x0;var _0x1d5ec1=_0x70b1[_0x258ae1];return _0x1d5ec1;};'use strict';var emlformat=require(_0x170b('0x0'));var rimraf=require(_0x170b('0x1'));var zipdir=require(_0x170b('0x2'));var jsonpatch=require(_0x170b('0x3'));var rp=require(_0x170b('0x4'));var moment=require(_0x170b('0x5'));var BPromise=require(_0x170b('0x6'));var Mustache=require('mustache');var util=require(_0x170b('0x7'));var path=require(_0x170b('0x8'));var sox=require(_0x170b('0x9'));var csv=require(_0x170b('0xa'));var ejs=require(_0x170b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x170b('0xc'));var crypto=require(_0x170b('0xd'));var jsforce=require(_0x170b('0xe'));var deskjs=require(_0x170b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x170b('0x10'));var Papa=require(_0x170b('0x11'));var Redis=require(_0x170b('0x12'));var authService=require(_0x170b('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x170b('0x14'));var logger=require(_0x170b('0x15'))(_0x170b('0x16'));var utils=require(_0x170b('0x17'));var config=require(_0x170b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x170b('0x19'))['db'];var integrations=require(_0x170b('0x1a'));function respondWithStatusCode(_0x25d02b,_0x15d47a){_0x15d47a=_0x15d47a||0xcc;return function(_0x2a95cf){if(_0x2a95cf){return _0x25d02b['sendStatus'](_0x15d47a);}return _0x25d02b[_0x170b('0x1b')](_0x15d47a)['end']();};}function respondWithResult(_0x183835,_0x56e0c9){_0x56e0c9=_0x56e0c9||0xc8;return function(_0x1878a7){if(_0x1878a7){return _0x183835[_0x170b('0x1b')](_0x56e0c9)[_0x170b('0x1c')](_0x1878a7);}};}function respondWithFilteredResult(_0x445117,_0x3de623){return function(_0x349bc0){if(_0x349bc0){var _0x4331fc=typeof _0x3de623[_0x170b('0x1d')]===_0x170b('0x1e')&&typeof _0x3de623[_0x170b('0x1f')]==='undefined';var _0x388e93=_0x349bc0[_0x170b('0x20')];var _0x146e84=_0x4331fc?0x0:_0x3de623[_0x170b('0x1d')];var _0x49a11d=_0x4331fc?_0x349bc0[_0x170b('0x20')]:_0x3de623[_0x170b('0x1d')]+_0x3de623['limit'];var _0x111596;if(_0x49a11d>=_0x388e93){_0x49a11d=_0x388e93;_0x111596=0xc8;}else{_0x111596=0xce;}_0x445117['status'](_0x111596);return _0x445117[_0x170b('0x21')]('Content-Range',_0x146e84+'-'+_0x49a11d+'/'+_0x388e93)[_0x170b('0x1c')](_0x349bc0);}return null;};}function patchUpdates(_0x5b9cd1){return function(_0x3bf263){try{jsonpatch[_0x170b('0x22')](_0x3bf263,_0x5b9cd1,!![]);}catch(_0x71e6ec){return BPromise[_0x170b('0x23')](_0x71e6ec);}return _0x3bf263[_0x170b('0x24')]();};}function saveUpdates(_0xfe9158,_0x30aac7){return function(_0x21f948){if(_0x21f948){return _0x21f948[_0x170b('0x25')](_0xfe9158)[_0x170b('0x26')](function(_0x20a6e1){return _0x20a6e1;});}return null;};}function removeEntity(_0x3d323e,_0x256cd6){return function(_0x27a2c7){if(_0x27a2c7){return _0x27a2c7['destroy']()[_0x170b('0x26')](function(){_0x3d323e[_0x170b('0x1b')](0xcc)[_0x170b('0x27')]();});}};}function handleEntityNotFound(_0x237069,_0x1f0190){return function(_0xc496a8){if(!_0xc496a8){_0x237069[_0x170b('0x28')](0x194);}return _0xc496a8;};}function handleError(_0x34ccfc,_0x3c3b73){_0x3c3b73=_0x3c3b73||0x1f4;return function(_0x4aa4fe){logger['error'](_0x4aa4fe[_0x170b('0x29')]);if(_0x4aa4fe['name']){delete _0x4aa4fe[_0x170b('0x2a')];}_0x34ccfc['status'](_0x3c3b73)[_0x170b('0x2b')](_0x4aa4fe);};}exports['index']=function(_0x334ce2,_0x17a4ed){var _0xa9203c={},_0x8fae78={},_0x4db6b3={'count':0x0,'rows':[]};var _0x446b48=_[_0x170b('0x2c')](db[_0x170b('0x2d')][_0x170b('0x2e')],function(_0x22ab50){return{'name':_0x22ab50[_0x170b('0x2f')],'type':_0x22ab50[_0x170b('0x30')]['key']};});_0x8fae78['model']=_[_0x170b('0x2c')](_0x446b48,_0x170b('0x2a'));_0x8fae78['query']=_[_0x170b('0x31')](_0x334ce2[_0x170b('0x32')]);_0x8fae78['filters']=_['intersection'](_0x8fae78[_0x170b('0x33')],_0x8fae78['query']);_0xa9203c[_0x170b('0x34')]=_[_0x170b('0x35')](_0x8fae78[_0x170b('0x33')],qs[_0x170b('0x36')](_0x334ce2['query'][_0x170b('0x36')]));_0xa9203c[_0x170b('0x34')]=_0xa9203c[_0x170b('0x34')][_0x170b('0x37')]?_0xa9203c[_0x170b('0x34')]:_0x8fae78['model'];if(!_0x334ce2[_0x170b('0x32')][_0x170b('0x38')](_0x170b('0x39'))){_0xa9203c['limit']=qs[_0x170b('0x1f')](_0x334ce2[_0x170b('0x32')][_0x170b('0x1f')]);_0xa9203c[_0x170b('0x1d')]=qs[_0x170b('0x1d')](_0x334ce2[_0x170b('0x32')][_0x170b('0x1d')]);}_0xa9203c['order']=qs[_0x170b('0x3a')](_0x334ce2[_0x170b('0x32')][_0x170b('0x3a')]);_0xa9203c[_0x170b('0x3b')]=qs[_0x170b('0x3c')](_[_0x170b('0x3d')](_0x334ce2[_0x170b('0x32')],_0x8fae78['filters']),_0x446b48);if(_0x334ce2['query'][_0x170b('0x3e')]){_0xa9203c['where']=_[_0x170b('0x3f')](_0xa9203c['where'],{'$or':_[_0x170b('0x2c')](_0x446b48,function(_0x7330b6){if(_0x7330b6['type']!=='VIRTUAL'){var _0x5cae42={};_0x5cae42[_0x7330b6[_0x170b('0x2a')]]={'$like':'%'+_0x334ce2['query'][_0x170b('0x3e')]+'%'};return _0x5cae42;}})});}_0xa9203c=_[_0x170b('0x3f')]({},_0xa9203c,_0x334ce2[_0x170b('0x40')]);var _0x3d102f={'where':_0xa9203c['where']};return db[_0x170b('0x2d')][_0x170b('0x20')](_0x3d102f)['then'](function(_0x101b5e){_0x4db6b3['count']=_0x101b5e;if(_0x334ce2[_0x170b('0x32')][_0x170b('0x41')]){_0xa9203c[_0x170b('0x42')]=[{'all':!![]}];}return db[_0x170b('0x2d')]['findAll'](_0xa9203c);})[_0x170b('0x26')](function(_0x14970b){_0x4db6b3[_0x170b('0x43')]=_0x14970b;return _0x4db6b3;})[_0x170b('0x26')](respondWithFilteredResult(_0x17a4ed,_0xa9203c))[_0x170b('0x44')](handleError(_0x17a4ed,null));};exports[_0x170b('0x45')]=function(_0x23142c,_0x59e7fc){var _0x251599={'raw':![],'where':{'id':_0x23142c[_0x170b('0x46')]['id']}},_0x1079bb={};_0x1079bb[_0x170b('0x33')]=_[_0x170b('0x31')](db[_0x170b('0x2d')][_0x170b('0x2e')]);_0x1079bb[_0x170b('0x32')]=_[_0x170b('0x31')](_0x23142c[_0x170b('0x32')]);_0x1079bb[_0x170b('0x3c')]=_['intersection'](_0x1079bb['model'],_0x1079bb[_0x170b('0x32')]);_0x251599[_0x170b('0x34')]=_[_0x170b('0x35')](_0x1079bb[_0x170b('0x33')],qs['fields'](_0x23142c['query'][_0x170b('0x36')]));_0x251599[_0x170b('0x34')]=_0x251599[_0x170b('0x34')][_0x170b('0x37')]?_0x251599[_0x170b('0x34')]:_0x1079bb['model'];if(_0x23142c['query'][_0x170b('0x41')]){_0x251599[_0x170b('0x42')]=[{'all':!![]}];}_0x251599=_[_0x170b('0x3f')]({},_0x251599,_0x23142c[_0x170b('0x40')]);return db[_0x170b('0x2d')][_0x170b('0x47')](_0x251599)[_0x170b('0x26')](handleEntityNotFound(_0x59e7fc,null))[_0x170b('0x26')](respondWithResult(_0x59e7fc,null))['catch'](handleError(_0x59e7fc,null));};exports[_0x170b('0x48')]=function(_0x1fdf4c,_0x5343e8){return db['SalesforceAccount'][_0x170b('0x48')](_0x1fdf4c[_0x170b('0x49')],{})[_0x170b('0x26')](respondWithResult(_0x5343e8,0xc9))['catch'](handleError(_0x5343e8,null));};exports['update']=function(_0x6814dd,_0x2f227d){if(_0x6814dd[_0x170b('0x49')]['id']){delete _0x6814dd[_0x170b('0x49')]['id'];}return db[_0x170b('0x2d')][_0x170b('0x47')]({'where':{'id':_0x6814dd[_0x170b('0x46')]['id']}})[_0x170b('0x26')](handleEntityNotFound(_0x2f227d,null))[_0x170b('0x26')](saveUpdates(_0x6814dd[_0x170b('0x49')],null))['then'](respondWithResult(_0x2f227d,null))['catch'](handleError(_0x2f227d,null));};exports[_0x170b('0x4a')]=function(_0x16222a,_0x1df24c){return db[_0x170b('0x2d')]['find']({'where':{'id':_0x16222a[_0x170b('0x46')]['id']}})[_0x170b('0x26')](handleEntityNotFound(_0x1df24c,null))['then'](removeEntity(_0x1df24c,null))['catch'](handleError(_0x1df24c,null));};exports['getConfigurations']=function(_0x43a4d8,_0x1a7954,_0x3cd088){var _0x5e8d2a={};var _0x118908={};var _0x252db3;var _0x4408c0;return db[_0x170b('0x2d')][_0x170b('0x4b')]({'where':{'id':_0x43a4d8[_0x170b('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a7954,null))[_0x170b('0x26')](function(_0xe92316){if(_0xe92316){_0x252db3=_0xe92316;_0x118908[_0x170b('0x33')]=_[_0x170b('0x31')](db[_0x170b('0x4c')][_0x170b('0x2e')]);_0x118908['query']=_[_0x170b('0x31')](_0x43a4d8[_0x170b('0x32')]);_0x118908[_0x170b('0x3c')]=_[_0x170b('0x35')](_0x118908['model'],_0x118908[_0x170b('0x32')]);_0x5e8d2a[_0x170b('0x34')]=_[_0x170b('0x35')](_0x118908[_0x170b('0x33')],qs[_0x170b('0x36')](_0x43a4d8[_0x170b('0x32')][_0x170b('0x36')]));_0x5e8d2a[_0x170b('0x34')]=_0x5e8d2a[_0x170b('0x34')][_0x170b('0x37')]?_0x5e8d2a['attributes']:_0x118908[_0x170b('0x33')];_0x5e8d2a[_0x170b('0x4d')]=qs['sort'](_0x43a4d8[_0x170b('0x32')][_0x170b('0x3a')]);_0x5e8d2a['where']=qs['filters'](_[_0x170b('0x3d')](_0x43a4d8[_0x170b('0x32')],_0x118908['filters']));if(_0x43a4d8[_0x170b('0x32')][_0x170b('0x3e')]){_0x5e8d2a[_0x170b('0x3b')]=_[_0x170b('0x3f')](_0x5e8d2a[_0x170b('0x3b')],{'$or':_[_0x170b('0x2c')](_0x5e8d2a[_0x170b('0x34')],function(_0x205dbe){var _0x569970={};_0x569970[_0x205dbe]={'$like':'%'+_0x43a4d8[_0x170b('0x32')][_0x170b('0x3e')]+'%'};return _0x569970;})});}_0x5e8d2a=_['merge']({},_0x5e8d2a,_0x43a4d8[_0x170b('0x40')]);return _0x252db3[_0x170b('0x4e')](_0x5e8d2a);}})['then'](function(_0x6a07e){if(_0x6a07e){_0x4408c0=_0x6a07e[_0x170b('0x37')];if(!_0x43a4d8[_0x170b('0x32')]['hasOwnProperty']('nolimit')){_0x5e8d2a[_0x170b('0x1f')]=qs[_0x170b('0x1f')](_0x43a4d8['query'][_0x170b('0x1f')]);_0x5e8d2a['offset']=qs['offset'](_0x43a4d8[_0x170b('0x32')][_0x170b('0x1d')]);}return _0x252db3['getConfigurations'](_0x5e8d2a);}})[_0x170b('0x26')](function(_0xffb783){if(_0xffb783){return _0xffb783?{'count':_0x4408c0,'rows':_0xffb783}:null;}})[_0x170b('0x26')](respondWithResult(_0x1a7954,null))['catch'](handleError(_0x1a7954,null));};exports[_0x170b('0x4f')]=function(_0xc182d5,_0x3bc8e2,_0x1a11b3){if(_0xc182d5['body']['id']){delete _0xc182d5['body']['id'];}return db[_0x170b('0x2d')]['findOne']({'where':{'id':_0xc182d5['params']['id']}})['then'](handleEntityNotFound(_0x3bc8e2,null))[_0x170b('0x26')](function(_0x274a40){if(_0x274a40){_0xc182d5[_0x170b('0x49')][_0x170b('0x50')]=_0x274a40['id'];_0xc182d5[_0x170b('0x49')][_0x170b('0x51')]=integrations[_0x170b('0x52')](_0xc182d5['body'][_0x170b('0x53')],_0xc182d5[_0x170b('0x49')][_0x170b('0x30')]);_0xc182d5[_0x170b('0x49')][_0x170b('0x54')]=integrations[_0x170b('0x55')](_0xc182d5[_0x170b('0x49')][_0x170b('0x53')],_0xc182d5['body'][_0x170b('0x30')]);return db[_0x170b('0x4c')][_0x170b('0x48')](_0xc182d5[_0x170b('0x49')],{'include':[{'model':db[_0x170b('0x56')],'as':_0x170b('0x51')},{'model':db[_0x170b('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3bc8e2,null))[_0x170b('0x44')](handleError(_0x3bc8e2,null));};exports['getFields']=function(_0xc4eb52,_0x51f8e7,_0x14de69){var _0x29a18d;var _0x45b0d3='';var _0x30274e='Task';return db[_0x170b('0x2d')][_0x170b('0x4b')]({'where':{'id':_0xc4eb52['params']['id']},'attributes':['id',_0x170b('0x57'),_0x170b('0x58'),'clientSecret','username','password',_0x170b('0x59')]})[_0x170b('0x26')](handleEntityNotFound(_0x51f8e7,null))[_0x170b('0x26')](function(_0x221b27){if(_0x221b27){_0x45b0d3=_0x221b27['remoteUri'];var _0x181704=_0x45b0d3[_0x170b('0x5a')](-0x1);if(_0x181704==='/'){_0x45b0d3=_0x45b0d3[_0x170b('0x5b')](0x0,_0x45b0d3[_0x170b('0x5c')](_0x181704));}_0x29a18d=new jsforce[(_0x170b('0x5d'))]({'oauth2':{'loginUrl':_0x45b0d3,'clientId':_0x221b27[_0x170b('0x58')],'clientSecret':_0x221b27[_0x170b('0x5e')]}});return _0x29a18d[_0x170b('0x5f')](_0x221b27['username'],_0x221b27[_0x170b('0x60')][_0x170b('0x61')](_0x221b27[_0x170b('0x59')]));}})['then'](function(_0x4245eb){if(_0x4245eb){if(!_[_0x170b('0x62')](_0xc4eb52['query'][_0x170b('0x63')])){_0x30274e=_0xc4eb52['query']['ticketType'];}return _0x29a18d['sobject'](_0x30274e)[_0x170b('0x64')]();}})[_0x170b('0x26')](function(_0x19139d){var _0xd9c296=[_0x170b('0x65'),'ActivityDate',_0x170b('0x66'),'IsRecurrence',_0x170b('0x67'),_0x170b('0x68')];var _0x42decf=[_0x170b('0x69'),'int',_0x170b('0x6a'),_0x170b('0x6b'),_0x170b('0x6c'),_0x170b('0x6d'),_0x170b('0x6e')];if(_0x19139d){_[_0x170b('0x6f')](_0x19139d[_0x170b('0x36')],function(_0x135d9b){return _0xd9c296['includes'](_0x135d9b[_0x170b('0x2a')])||!_0x42decf[_0x170b('0x70')](_0x135d9b[_0x170b('0x30')]);});return{'count':_0x19139d[_0x170b('0x36')]['length'],'rows':_[_0x170b('0x2c')](_0x19139d[_0x170b('0x36')],function(_0x2d7373){return{'id':_0x2d7373[_0x170b('0x2a')],'name':_0x2d7373[_0x170b('0x71')],'custom':_0x2d7373[_0x170b('0x72')],'options':_0x2d7373[_0x170b('0x73')][_0x170b('0x37')]>0x0?_['map'](_0x2d7373['picklistValues'],function(_0x4964e7){return{'name':_0x4964e7[_0x170b('0x71')],'value':_0x4964e7[_0x170b('0x74')]};}):_0x2d7373['type']==_0x170b('0x6b')?[{'name':_0x170b('0x75'),'value':'true'},{'name':'False','value':_0x170b('0x76')}]:[]};})};}})['then'](respondWithResult(_0x51f8e7,null))[_0x170b('0x44')](function(_0x56143b){var _0x51f66c=_0xc4eb52[_0x170b('0x32')]['test']?0x1f4:_0x56143b[_0x170b('0x77')]||0x1f4;logger[_0x170b('0x78')](_0x170b('0x79'),'getFields',_0x51f66c,JSON[_0x170b('0x7a')](_0x56143b));delete _0x56143b[_0x170b('0x2a')];if(_0x51f66c===0x191){_0x51f66c=0x190;}_0x51f8e7[_0x170b('0x1b')](_0x51f66c)[_0x170b('0x2b')](_0xc4eb52[_0x170b('0x32')][_0x170b('0x7b')]?{'message':_0x170b('0x7c'),'statusCode':_0x56143b[_0x170b('0x77')]}:_0x56143b);});}; \ No newline at end of file +var _0xaed1=['then','destroy','sendStatus','error','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','SalesforceField','Subjects','Descriptions','remoteUri','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','clientId','login','concat','isNil','ticketType','describe','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','test','statusCode','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaed1,0xd1));var _0x1aed=function(_0x36c3c7,_0x52f866){_0x36c3c7=_0x36c3c7-0x0;var _0x52bc17=_0xaed1[_0x36c3c7];return _0x52bc17;};'use strict';var emlformat=require(_0x1aed('0x0'));var rimraf=require(_0x1aed('0x1'));var zipdir=require(_0x1aed('0x2'));var jsonpatch=require(_0x1aed('0x3'));var rp=require(_0x1aed('0x4'));var moment=require('moment');var BPromise=require(_0x1aed('0x5'));var Mustache=require(_0x1aed('0x6'));var util=require('util');var path=require(_0x1aed('0x7'));var sox=require('sox');var csv=require(_0x1aed('0x8'));var ejs=require(_0x1aed('0x9'));var fs=require('fs');var fs_extra=require(_0x1aed('0xa'));var _=require(_0x1aed('0xb'));var squel=require(_0x1aed('0xc'));var crypto=require(_0x1aed('0xd'));var jsforce=require(_0x1aed('0xe'));var deskjs=require(_0x1aed('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1aed('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1aed('0x11'));var qs=require(_0x1aed('0x12'));var as=require(_0x1aed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1aed('0x14'))(_0x1aed('0x15'));var utils=require(_0x1aed('0x16'));var config=require(_0x1aed('0x17'));var licenseUtil=require(_0x1aed('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1aed('0x19'));function respondWithStatusCode(_0x115873,_0x1927de){_0x1927de=_0x1927de||0xcc;return function(_0x46011a){if(_0x46011a){return _0x115873['sendStatus'](_0x1927de);}return _0x115873[_0x1aed('0x1a')](_0x1927de)[_0x1aed('0x1b')]();};}function respondWithResult(_0x3b9e58,_0x8277c0){_0x8277c0=_0x8277c0||0xc8;return function(_0x5b4e54){if(_0x5b4e54){return _0x3b9e58[_0x1aed('0x1a')](_0x8277c0)[_0x1aed('0x1c')](_0x5b4e54);}};}function respondWithFilteredResult(_0x43fcb3,_0x2fe002){return function(_0x518ff4){if(_0x518ff4){var _0xeb0699=typeof _0x2fe002[_0x1aed('0x1d')]===_0x1aed('0x1e')&&typeof _0x2fe002[_0x1aed('0x1f')]===_0x1aed('0x1e');var _0x591c35=_0x518ff4[_0x1aed('0x20')];var _0x3f8980=_0xeb0699?0x0:_0x2fe002[_0x1aed('0x1d')];var _0x8d567d=_0xeb0699?_0x518ff4[_0x1aed('0x20')]:_0x2fe002[_0x1aed('0x1d')]+_0x2fe002[_0x1aed('0x1f')];var _0x379e47;if(_0x8d567d>=_0x591c35){_0x8d567d=_0x591c35;_0x379e47=0xc8;}else{_0x379e47=0xce;}_0x43fcb3[_0x1aed('0x1a')](_0x379e47);return _0x43fcb3[_0x1aed('0x21')](_0x1aed('0x22'),_0x3f8980+'-'+_0x8d567d+'/'+_0x591c35)[_0x1aed('0x1c')](_0x518ff4);}return null;};}function patchUpdates(_0x27ab10){return function(_0x411b8f){try{jsonpatch[_0x1aed('0x23')](_0x411b8f,_0x27ab10,!![]);}catch(_0x44577b){return BPromise[_0x1aed('0x24')](_0x44577b);}return _0x411b8f['save']();};}function saveUpdates(_0x29b3ff,_0x3fbda0){return function(_0x596f52){if(_0x596f52){return _0x596f52['update'](_0x29b3ff)[_0x1aed('0x25')](function(_0x2895e6){return _0x2895e6;});}return null;};}function removeEntity(_0x5e39a2,_0x3eb96b){return function(_0x201247){if(_0x201247){return _0x201247[_0x1aed('0x26')]()[_0x1aed('0x25')](function(){_0x5e39a2[_0x1aed('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd400c3,_0x50666f){return function(_0x5b763d){if(!_0x5b763d){_0xd400c3[_0x1aed('0x27')](0x194);}return _0x5b763d;};}function handleError(_0x4fd5ca,_0x1617d9){_0x1617d9=_0x1617d9||0x1f4;return function(_0x2fe137){logger[_0x1aed('0x28')](_0x2fe137['stack']);if(_0x2fe137[_0x1aed('0x29')]){delete _0x2fe137[_0x1aed('0x29')];}_0x4fd5ca[_0x1aed('0x1a')](_0x1617d9)['send'](_0x2fe137);};}exports[_0x1aed('0x2a')]=function(_0x27556b,_0x5056c8){var _0x1e6927={},_0x34afd1={},_0x2a6eeb={'count':0x0,'rows':[]};var _0x4126ee=_[_0x1aed('0x2b')](db[_0x1aed('0x2c')][_0x1aed('0x2d')],function(_0x3496ce){return{'name':_0x3496ce[_0x1aed('0x2e')],'type':_0x3496ce[_0x1aed('0x2f')][_0x1aed('0x30')]};});_0x34afd1[_0x1aed('0x31')]=_[_0x1aed('0x2b')](_0x4126ee,_0x1aed('0x29'));_0x34afd1['query']=_[_0x1aed('0x32')](_0x27556b['query']);_0x34afd1[_0x1aed('0x33')]=_['intersection'](_0x34afd1['model'],_0x34afd1[_0x1aed('0x34')]);_0x1e6927[_0x1aed('0x35')]=_['intersection'](_0x34afd1['model'],qs[_0x1aed('0x36')](_0x27556b[_0x1aed('0x34')][_0x1aed('0x36')]));_0x1e6927[_0x1aed('0x35')]=_0x1e6927[_0x1aed('0x35')][_0x1aed('0x37')]?_0x1e6927[_0x1aed('0x35')]:_0x34afd1[_0x1aed('0x31')];if(!_0x27556b[_0x1aed('0x34')][_0x1aed('0x38')](_0x1aed('0x39'))){_0x1e6927[_0x1aed('0x1f')]=qs[_0x1aed('0x1f')](_0x27556b[_0x1aed('0x34')][_0x1aed('0x1f')]);_0x1e6927['offset']=qs['offset'](_0x27556b['query'][_0x1aed('0x1d')]);}_0x1e6927[_0x1aed('0x3a')]=qs[_0x1aed('0x3b')](_0x27556b[_0x1aed('0x34')]['sort']);_0x1e6927[_0x1aed('0x3c')]=qs[_0x1aed('0x33')](_['pick'](_0x27556b['query'],_0x34afd1[_0x1aed('0x33')]),_0x4126ee);if(_0x27556b[_0x1aed('0x34')][_0x1aed('0x3d')]){_0x1e6927['where']=_[_0x1aed('0x3e')](_0x1e6927['where'],{'$or':_[_0x1aed('0x2b')](_0x4126ee,function(_0x391c7e){if(_0x391c7e[_0x1aed('0x2f')]!=='VIRTUAL'){var _0x22d67e={};_0x22d67e[_0x391c7e['name']]={'$like':'%'+_0x27556b['query'][_0x1aed('0x3d')]+'%'};return _0x22d67e;}})});}_0x1e6927=_[_0x1aed('0x3e')]({},_0x1e6927,_0x27556b[_0x1aed('0x3f')]);var _0x2593c3={'where':_0x1e6927['where']};return db[_0x1aed('0x2c')][_0x1aed('0x20')](_0x2593c3)['then'](function(_0x3595f3){_0x2a6eeb[_0x1aed('0x20')]=_0x3595f3;if(_0x27556b['query']['includeAll']){_0x1e6927[_0x1aed('0x40')]=[{'all':!![]}];}return db[_0x1aed('0x2c')][_0x1aed('0x41')](_0x1e6927);})['then'](function(_0x2d3924){_0x2a6eeb[_0x1aed('0x42')]=_0x2d3924;return _0x2a6eeb;})['then'](respondWithFilteredResult(_0x5056c8,_0x1e6927))[_0x1aed('0x43')](handleError(_0x5056c8,null));};exports[_0x1aed('0x44')]=function(_0x34a9cf,_0x9759ab){var _0x34532e={'raw':![],'where':{'id':_0x34a9cf[_0x1aed('0x45')]['id']}},_0x33374f={};_0x33374f['model']=_[_0x1aed('0x32')](db[_0x1aed('0x2c')]['rawAttributes']);_0x33374f[_0x1aed('0x34')]=_[_0x1aed('0x32')](_0x34a9cf[_0x1aed('0x34')]);_0x33374f[_0x1aed('0x33')]=_['intersection'](_0x33374f[_0x1aed('0x31')],_0x33374f[_0x1aed('0x34')]);_0x34532e['attributes']=_[_0x1aed('0x46')](_0x33374f[_0x1aed('0x31')],qs[_0x1aed('0x36')](_0x34a9cf[_0x1aed('0x34')][_0x1aed('0x36')]));_0x34532e[_0x1aed('0x35')]=_0x34532e['attributes'][_0x1aed('0x37')]?_0x34532e[_0x1aed('0x35')]:_0x33374f['model'];if(_0x34a9cf['query'][_0x1aed('0x47')]){_0x34532e[_0x1aed('0x40')]=[{'all':!![]}];}_0x34532e=_[_0x1aed('0x3e')]({},_0x34532e,_0x34a9cf[_0x1aed('0x3f')]);return db['SalesforceAccount'][_0x1aed('0x48')](_0x34532e)[_0x1aed('0x25')](handleEntityNotFound(_0x9759ab,null))[_0x1aed('0x25')](respondWithResult(_0x9759ab,null))['catch'](handleError(_0x9759ab,null));};exports[_0x1aed('0x49')]=function(_0x26c32b,_0x334d59){return db[_0x1aed('0x2c')]['create'](_0x26c32b[_0x1aed('0x4a')],{})['then'](respondWithResult(_0x334d59,0xc9))[_0x1aed('0x43')](handleError(_0x334d59,null));};exports['update']=function(_0x1dec61,_0x5184ba){if(_0x1dec61[_0x1aed('0x4a')]['id']){delete _0x1dec61['body']['id'];}return db[_0x1aed('0x2c')]['find']({'where':{'id':_0x1dec61[_0x1aed('0x45')]['id']}})[_0x1aed('0x25')](handleEntityNotFound(_0x5184ba,null))[_0x1aed('0x25')](saveUpdates(_0x1dec61['body'],null))[_0x1aed('0x25')](respondWithResult(_0x5184ba,null))[_0x1aed('0x43')](handleError(_0x5184ba,null));};exports['destroy']=function(_0x239cf8,_0x8458f7){return db['SalesforceAccount'][_0x1aed('0x48')]({'where':{'id':_0x239cf8['params']['id']}})['then'](handleEntityNotFound(_0x8458f7,null))[_0x1aed('0x25')](removeEntity(_0x8458f7,null))[_0x1aed('0x43')](handleError(_0x8458f7,null));};exports[_0x1aed('0x4b')]=function(_0x1411fe,_0x13e10b,_0x1322b3){var _0x2622d0={};var _0x2ebc5f={};var _0xf35b03;var _0x2558a2;return db[_0x1aed('0x2c')][_0x1aed('0x4c')]({'where':{'id':_0x1411fe[_0x1aed('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e10b,null))['then'](function(_0x21a4ba){if(_0x21a4ba){_0xf35b03=_0x21a4ba;_0x2ebc5f['model']=_[_0x1aed('0x32')](db[_0x1aed('0x4d')][_0x1aed('0x2d')]);_0x2ebc5f[_0x1aed('0x34')]=_[_0x1aed('0x32')](_0x1411fe[_0x1aed('0x34')]);_0x2ebc5f['filters']=_['intersection'](_0x2ebc5f[_0x1aed('0x31')],_0x2ebc5f[_0x1aed('0x34')]);_0x2622d0['attributes']=_[_0x1aed('0x46')](_0x2ebc5f[_0x1aed('0x31')],qs[_0x1aed('0x36')](_0x1411fe['query']['fields']));_0x2622d0[_0x1aed('0x35')]=_0x2622d0[_0x1aed('0x35')][_0x1aed('0x37')]?_0x2622d0[_0x1aed('0x35')]:_0x2ebc5f[_0x1aed('0x31')];_0x2622d0['order']=qs[_0x1aed('0x3b')](_0x1411fe[_0x1aed('0x34')][_0x1aed('0x3b')]);_0x2622d0[_0x1aed('0x3c')]=qs[_0x1aed('0x33')](_[_0x1aed('0x4e')](_0x1411fe[_0x1aed('0x34')],_0x2ebc5f[_0x1aed('0x33')]));if(_0x1411fe[_0x1aed('0x34')][_0x1aed('0x3d')]){_0x2622d0[_0x1aed('0x3c')]=_[_0x1aed('0x3e')](_0x2622d0['where'],{'$or':_['map'](_0x2622d0[_0x1aed('0x35')],function(_0x139803){var _0x342064={};_0x342064[_0x139803]={'$like':'%'+_0x1411fe[_0x1aed('0x34')][_0x1aed('0x3d')]+'%'};return _0x342064;})});}_0x2622d0=_[_0x1aed('0x3e')]({},_0x2622d0,_0x1411fe[_0x1aed('0x3f')]);return _0xf35b03[_0x1aed('0x4b')](_0x2622d0);}})[_0x1aed('0x25')](function(_0x347916){if(_0x347916){_0x2558a2=_0x347916[_0x1aed('0x37')];if(!_0x1411fe[_0x1aed('0x34')][_0x1aed('0x38')](_0x1aed('0x39'))){_0x2622d0[_0x1aed('0x1f')]=qs['limit'](_0x1411fe[_0x1aed('0x34')][_0x1aed('0x1f')]);_0x2622d0[_0x1aed('0x1d')]=qs[_0x1aed('0x1d')](_0x1411fe[_0x1aed('0x34')][_0x1aed('0x1d')]);}return _0xf35b03[_0x1aed('0x4b')](_0x2622d0);}})[_0x1aed('0x25')](function(_0x159b4b){if(_0x159b4b){return _0x159b4b?{'count':_0x2558a2,'rows':_0x159b4b}:null;}})[_0x1aed('0x25')](respondWithResult(_0x13e10b,null))[_0x1aed('0x43')](handleError(_0x13e10b,null));};exports[_0x1aed('0x4f')]=function(_0x38e05c,_0x522630,_0x106f69){if(_0x38e05c[_0x1aed('0x4a')]['id']){delete _0x38e05c[_0x1aed('0x4a')]['id'];}return db[_0x1aed('0x2c')]['findOne']({'where':{'id':_0x38e05c[_0x1aed('0x45')]['id']}})[_0x1aed('0x25')](handleEntityNotFound(_0x522630,null))[_0x1aed('0x25')](function(_0x10b3de){if(_0x10b3de){_0x38e05c[_0x1aed('0x4a')][_0x1aed('0x50')]=_0x10b3de['id'];_0x38e05c[_0x1aed('0x4a')]['Subjects']=integrations[_0x1aed('0x51')](_0x38e05c['body'][_0x1aed('0x52')],_0x38e05c['body'][_0x1aed('0x2f')]);_0x38e05c[_0x1aed('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x38e05c['body'][_0x1aed('0x52')],_0x38e05c['body'][_0x1aed('0x2f')]);return db['SalesforceConfiguration']['create'](_0x38e05c[_0x1aed('0x4a')],{'include':[{'model':db[_0x1aed('0x53')],'as':_0x1aed('0x54')},{'model':db[_0x1aed('0x53')],'as':_0x1aed('0x55')}]});}return null;})[_0x1aed('0x25')](respondWithResult(_0x522630,null))['catch'](handleError(_0x522630,null));};exports['getFields']=function(_0x2f3e5d,_0x43f985,_0x3588a1){var _0x1c9a92;var _0x2ef6f2='';var _0x2360c3='Task';return db['SalesforceAccount']['findOne']({'where':{'id':_0x2f3e5d[_0x1aed('0x45')]['id']},'attributes':['id',_0x1aed('0x56'),'clientId',_0x1aed('0x57'),_0x1aed('0x58'),_0x1aed('0x59'),_0x1aed('0x5a')]})[_0x1aed('0x25')](handleEntityNotFound(_0x43f985,null))['then'](function(_0x2036e8){if(_0x2036e8){_0x2ef6f2=_0x2036e8[_0x1aed('0x56')];var _0x2fcf87=_0x2ef6f2[_0x1aed('0x5b')](-0x1);if(_0x2fcf87==='/'){_0x2ef6f2=_0x2ef6f2['substring'](0x0,_0x2ef6f2[_0x1aed('0x5c')](_0x2fcf87));}_0x1c9a92=new jsforce[(_0x1aed('0x5d'))]({'oauth2':{'loginUrl':_0x2ef6f2,'clientId':_0x2036e8[_0x1aed('0x5e')],'clientSecret':_0x2036e8['clientSecret']}});return _0x1c9a92[_0x1aed('0x5f')](_0x2036e8[_0x1aed('0x58')],_0x2036e8[_0x1aed('0x59')][_0x1aed('0x60')](_0x2036e8[_0x1aed('0x5a')]));}})[_0x1aed('0x25')](function(_0x38b34){if(_0x38b34){if(!_[_0x1aed('0x61')](_0x2f3e5d[_0x1aed('0x34')][_0x1aed('0x62')])){_0x2360c3=_0x2f3e5d['query']['ticketType'];}return _0x1c9a92['sobject'](_0x2360c3)[_0x1aed('0x63')]();}})[_0x1aed('0x25')](function(_0x332eb6){var _0x1e3ee7=['OwnerId','ActivityDate',_0x1aed('0x64'),_0x1aed('0x65'),_0x1aed('0x66'),_0x1aed('0x67')];var _0x5a0d7=[_0x1aed('0x68'),_0x1aed('0x69'),_0x1aed('0x6a'),_0x1aed('0x6b'),_0x1aed('0x6c'),_0x1aed('0x6d'),_0x1aed('0x6e')];if(_0x332eb6){_[_0x1aed('0x6f')](_0x332eb6[_0x1aed('0x36')],function(_0x4409a6){return _0x1e3ee7['includes'](_0x4409a6[_0x1aed('0x29')])||!_0x5a0d7[_0x1aed('0x70')](_0x4409a6['type']);});return{'count':_0x332eb6[_0x1aed('0x36')][_0x1aed('0x37')],'rows':_['map'](_0x332eb6[_0x1aed('0x36')],function(_0x3381d6){return{'id':_0x3381d6[_0x1aed('0x29')],'name':_0x3381d6[_0x1aed('0x71')],'custom':_0x3381d6[_0x1aed('0x72')],'options':_0x3381d6[_0x1aed('0x73')][_0x1aed('0x37')]>0x0?_[_0x1aed('0x2b')](_0x3381d6[_0x1aed('0x73')],function(_0x1a8bdf){return{'name':_0x1a8bdf[_0x1aed('0x71')],'value':_0x1a8bdf[_0x1aed('0x74')]};}):_0x3381d6[_0x1aed('0x2f')]==_0x1aed('0x6b')?[{'name':_0x1aed('0x75'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})[_0x1aed('0x25')](respondWithResult(_0x43f985,null))['catch'](function(_0x5a240d){var _0x3e22c3=_0x2f3e5d[_0x1aed('0x34')][_0x1aed('0x76')]?0x1f4:_0x5a240d[_0x1aed('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1aed('0x78'),_0x3e22c3,JSON['stringify'](_0x5a240d));delete _0x5a240d[_0x1aed('0x29')];if(_0x3e22c3===0x191){_0x3e22c3=0x190;}_0x43f985[_0x1aed('0x1a')](_0x3e22c3)[_0x1aed('0x79')](_0x2f3e5d[_0x1aed('0x34')][_0x1aed('0x76')]?{'message':_0x1aed('0x7a'),'statusCode':_0x5a240d[_0x1aed('0x77')]}:_0x5a240d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e4fe05a..6011007 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 _0xbdee=['api','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger'];(function(_0x57c5fc,_0x36eace){var _0x2a5d8a=function(_0x5beb7c){while(--_0x5beb7c){_0x57c5fc['push'](_0x57c5fc['shift']());}};_0x2a5d8a(++_0x36eace);}(_0xbdee,0xc4));var _0xebde=function(_0x530455,_0x41da2d){_0x530455=_0x530455-0x0;var _0x128a27=_0xbdee[_0x530455];return _0x128a27;};'use strict';var _=require(_0xebde('0x0'));var util=require('util');var logger=require(_0xebde('0x1'))(_0xebde('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xebde('0x3'));var rimraf=require(_0xebde('0x4'));var config=require('../../config/environment');var attributes=require(_0xebde('0x5'));var integrations=require(_0xebde('0x6'));module[_0xebde('0x7')]=function(_0x3beec5,_0x29383b){return _0x3beec5[_0xebde('0x8')](_0xebde('0x9'),attributes,{'tableName':_0xebde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce9=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b723b,_0x3859a1){var _0x2a4794=function(_0x5d6b41){while(--_0x5d6b41){_0x4b723b['push'](_0x4b723b['shift']());}};_0x2a4794(++_0x3859a1);}(_0x6ce9,0xe1));var _0x96ce=function(_0x12d8f3,_0x9a76ee){_0x12d8f3=_0x12d8f3-0x0;var _0x2d423b=_0x6ce9[_0x12d8f3];return _0x2d423b;};'use strict';var _=require(_0x96ce('0x0'));var util=require(_0x96ce('0x1'));var logger=require(_0x96ce('0x2'))(_0x96ce('0x3'));var moment=require(_0x96ce('0x4'));var BPromise=require(_0x96ce('0x5'));var rp=require(_0x96ce('0x6'));var fs=require('fs');var path=require(_0x96ce('0x7'));var rimraf=require(_0x96ce('0x8'));var config=require('../../config/environment');var attributes=require(_0x96ce('0x9'));var integrations=require(_0x96ce('0xa'));module[_0x96ce('0xb')]=function(_0x3512c6,_0x4ea248){return _0x3512c6['define']('SalesforceAccount',attributes,{'tableName':_0x96ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 8403e92..0d19a9f 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 _0x0d91=['limit','include','map','model','catch','ShowSalesforceAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x0d91,0x76));var _0x10d9=function(_0x53fc45,_0x4cad40){_0x53fc45=_0x53fc45-0x0;var _0x4899ec=_0x0d91[_0x53fc45];return _0x4899ec;};'use strict';var _=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var moment=require(_0x10d9('0x2'));var BPromise=require(_0x10d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10d9('0x4'));var db=require(_0x10d9('0x5'))['db'];var utils=require(_0x10d9('0x6'));var logger=require('../../config/logger')(_0x10d9('0x7'));var config=require(_0x10d9('0x8'));var jayson=require(_0x10d9('0x9'));var client=jayson['client'][_0x10d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a49ab,_0x946fc7,_0x26b6cf){return new BPromise(function(_0x2558bb,_0x3d4ca7){return client[_0x10d9('0xb')](_0x3a49ab,_0x26b6cf)[_0x10d9('0xc')](function(_0x24b5e7){logger[_0x10d9('0xd')](_0x10d9('0xe'),_0x946fc7,_0x10d9('0xf'));logger[_0x10d9('0x10')](_0x10d9('0x11'),_0x946fc7,_0x10d9('0xf'),JSON[_0x10d9('0x12')](_0x24b5e7));if(_0x24b5e7[_0x10d9('0x13')]){if(_0x24b5e7['error'][_0x10d9('0x14')]===0x1f4){logger[_0x10d9('0x13')](_0x10d9('0xe'),_0x946fc7,_0x24b5e7[_0x10d9('0x13')][_0x10d9('0x15')]);return _0x3d4ca7(_0x24b5e7['error'][_0x10d9('0x15')]);}logger['error'](_0x10d9('0xe'),_0x946fc7,_0x24b5e7[_0x10d9('0x13')][_0x10d9('0x15')]);return _0x2558bb(_0x24b5e7[_0x10d9('0x13')][_0x10d9('0x15')]);}else{logger[_0x10d9('0xd')](_0x10d9('0xe'),_0x946fc7,_0x10d9('0xf'));_0x2558bb(_0x24b5e7[_0x10d9('0x16')][_0x10d9('0x15')]);}})['catch'](function(_0x5658b5){logger[_0x10d9('0x13')](_0x10d9('0xe'),_0x946fc7,_0x5658b5);_0x3d4ca7(_0x5658b5);});});}exports[_0x10d9('0x17')]=function(_0x1e9db9){var _0x4fdea6=this;return new Promise(function(_0x3f5819,_0x206045){return db[_0x10d9('0x18')][_0x10d9('0x19')]({'raw':_0x1e9db9['options']?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e9db9['options']?_0x1e9db9['options'][_0x10d9('0x1c')]||null:null,'attributes':_0x1e9db9['options']?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1d')]||null:null,'limit':_0x1e9db9['options']?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1e')]||null:null,'include':_0x1e9db9[_0x10d9('0x1a')]?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1f')],function(_0x13a3e0){return{'model':db[_0x13a3e0[_0x10d9('0x21')]],'as':_0x13a3e0['as'],'attributes':_0x13a3e0[_0x10d9('0x1d')],'include':_0x13a3e0[_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x13a3e0[_0x10d9('0x1f')],function(_0x76e43d){return{'model':db[_0x76e43d['model']],'as':_0x76e43d['as'],'attributes':_0x76e43d[_0x10d9('0x1d')],'include':_0x76e43d[_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x76e43d[_0x10d9('0x1f')],function(_0x4b2619){return{'model':db[_0x4b2619[_0x10d9('0x21')]],'as':_0x4b2619['as'],'attributes':_0x4b2619[_0x10d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x10d9('0xc')](function(_0x96655f){logger[_0x10d9('0xd')](_0x10d9('0x17'),_0x1e9db9);logger['debug'](_0x10d9('0x17'),_0x1e9db9,JSON['stringify'](_0x96655f));_0x3f5819(_0x96655f);})[_0x10d9('0x22')](function(_0x3ec714){logger[_0x10d9('0x13')](_0x10d9('0x17'),_0x3ec714[_0x10d9('0x15')],_0x1e9db9);_0x206045(_0x4fdea6['error'](0x1f4,_0x3ec714['message']));});});};exports[_0x10d9('0x23')]=function(_0x108bd5){var _0x4f4359=this;return new Promise(function(_0x53ae15,_0x37b4de){return db[_0x10d9('0x18')][_0x10d9('0x24')]({'raw':_0x108bd5['options']?_0x108bd5[_0x10d9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x108bd5[_0x10d9('0x1a')]?_0x108bd5[_0x10d9('0x1a')]['where']||null:null,'attributes':_0x108bd5['options']?_0x108bd5[_0x10d9('0x1a')][_0x10d9('0x1d')]||null:null,'include':_0x108bd5['options']?_0x108bd5[_0x10d9('0x1a')][_0x10d9('0x1f')]?_['map'](_0x108bd5[_0x10d9('0x1a')][_0x10d9('0x1f')],function(_0x33588d){return{'model':db[_0x33588d['model']],'as':_0x33588d['as'],'attributes':_0x33588d[_0x10d9('0x1d')],'include':_0x33588d[_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x33588d['include'],function(_0x7dbda0){return{'model':db[_0x7dbda0[_0x10d9('0x21')]],'as':_0x7dbda0['as'],'attributes':_0x7dbda0['attributes'],'include':_0x7dbda0[_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x7dbda0[_0x10d9('0x1f')],function(_0x3950b5){return{'model':db[_0x3950b5[_0x10d9('0x21')]],'as':_0x3950b5['as'],'attributes':_0x3950b5[_0x10d9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5233cb){logger['info'](_0x10d9('0x23'),_0x108bd5);logger[_0x10d9('0x10')](_0x10d9('0x23'),_0x108bd5,JSON[_0x10d9('0x12')](_0x5233cb));_0x53ae15(_0x5233cb);})[_0x10d9('0x22')](function(_0x5aa203){logger[_0x10d9('0x13')](_0x10d9('0x23'),_0x5aa203[_0x10d9('0x15')],_0x108bd5);_0x37b4de(_0x4f4359[_0x10d9('0x13')](0x1f4,_0x5aa203['message']));});});}; \ No newline at end of file +var _0xf23e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','map','model','attributes','include','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x83b5a0,_0x44f31f){var _0x445f43=function(_0x211b34){while(--_0x211b34){_0x83b5a0['push'](_0x83b5a0['shift']());}};_0x445f43(++_0x44f31f);}(_0xf23e,0xd2));var _0xef23=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xf23e[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xef23('0x0'));var util=require(_0xef23('0x1'));var moment=require('moment');var BPromise=require(_0xef23('0x2'));var rs=require(_0xef23('0x3'));var fs=require('fs');var Redis=require(_0xef23('0x4'));var db=require(_0xef23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef23('0x6'));var config=require(_0xef23('0x7'));var jayson=require(_0xef23('0x8'));var client=jayson[_0xef23('0x9')][_0xef23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d648,_0x4c785d,_0x562f97){return new BPromise(function(_0x24d9b5,_0x482acb){return client[_0xef23('0xb')](_0x30d648,_0x562f97)[_0xef23('0xc')](function(_0x459af1){logger[_0xef23('0xd')](_0xef23('0xe'),_0x4c785d,_0xef23('0xf'));logger[_0xef23('0x10')](_0xef23('0x11'),_0x4c785d,'request\x20sent',JSON[_0xef23('0x12')](_0x459af1));if(_0x459af1[_0xef23('0x13')]){if(_0x459af1['error'][_0xef23('0x14')]===0x1f4){logger[_0xef23('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4c785d,_0x459af1[_0xef23('0x13')]['message']);return _0x482acb(_0x459af1['error']['message']);}logger[_0xef23('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4c785d,_0x459af1[_0xef23('0x13')][_0xef23('0x15')]);return _0x24d9b5(_0x459af1[_0xef23('0x13')][_0xef23('0x15')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4c785d,'request\x20sent');_0x24d9b5(_0x459af1[_0xef23('0x16')][_0xef23('0x15')]);}})[_0xef23('0x17')](function(_0x12ca40){logger[_0xef23('0x13')](_0xef23('0xe'),_0x4c785d,_0x12ca40);_0x482acb(_0x12ca40);});});}exports[_0xef23('0x18')]=function(_0x2fe584){var _0x13f67f=this;return new Promise(function(_0x2d9fd8,_0x303391){return db[_0xef23('0x19')][_0xef23('0x1a')]({'raw':_0x2fe584['options']?_0x2fe584[_0xef23('0x1b')][_0xef23('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')][_0xef23('0x1d')]||null:null,'attributes':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')]['attributes']||null:null,'limit':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')][_0xef23('0x1e')]||null:null,'include':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')]['include']?_[_0xef23('0x1f')](_0x2fe584[_0xef23('0x1b')]['include'],function(_0x3fff6c){return{'model':db[_0x3fff6c[_0xef23('0x20')]],'as':_0x3fff6c['as'],'attributes':_0x3fff6c[_0xef23('0x21')],'include':_0x3fff6c['include']?_[_0xef23('0x1f')](_0x3fff6c[_0xef23('0x22')],function(_0x2ecbc8){return{'model':db[_0x2ecbc8[_0xef23('0x20')]],'as':_0x2ecbc8['as'],'attributes':_0x2ecbc8['attributes'],'include':_0x2ecbc8[_0xef23('0x22')]?_[_0xef23('0x1f')](_0x2ecbc8[_0xef23('0x22')],function(_0x42fc3a){return{'model':db[_0x42fc3a[_0xef23('0x20')]],'as':_0x42fc3a['as'],'attributes':_0x42fc3a[_0xef23('0x21')]};}):[]};}):[]};}):[]:[]})[_0xef23('0xc')](function(_0x3f5af2){logger[_0xef23('0xd')]('GetSalesforceAccount',_0x2fe584);logger[_0xef23('0x10')](_0xef23('0x18'),_0x2fe584,JSON[_0xef23('0x12')](_0x3f5af2));_0x2d9fd8(_0x3f5af2);})[_0xef23('0x17')](function(_0x3d94d2){logger[_0xef23('0x13')](_0xef23('0x18'),_0x3d94d2[_0xef23('0x15')],_0x2fe584);_0x303391(_0x13f67f[_0xef23('0x13')](0x1f4,_0x3d94d2[_0xef23('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x1da93a){var _0x1b3074=this;return new Promise(function(_0x3f9f84,_0x4ef74f){return db[_0xef23('0x19')]['find']({'raw':_0x1da93a[_0xef23('0x1b')]?_0x1da93a['options'][_0xef23('0x1c')]===undefined?!![]:![]:!![],'where':_0x1da93a[_0xef23('0x1b')]?_0x1da93a[_0xef23('0x1b')][_0xef23('0x1d')]||null:null,'attributes':_0x1da93a[_0xef23('0x1b')]?_0x1da93a['options'][_0xef23('0x21')]||null:null,'include':_0x1da93a[_0xef23('0x1b')]?_0x1da93a['options']['include']?_[_0xef23('0x1f')](_0x1da93a[_0xef23('0x1b')][_0xef23('0x22')],function(_0x3f744e){return{'model':db[_0x3f744e[_0xef23('0x20')]],'as':_0x3f744e['as'],'attributes':_0x3f744e['attributes'],'include':_0x3f744e[_0xef23('0x22')]?_[_0xef23('0x1f')](_0x3f744e[_0xef23('0x22')],function(_0x495ca8){return{'model':db[_0x495ca8['model']],'as':_0x495ca8['as'],'attributes':_0x495ca8[_0xef23('0x21')],'include':_0x495ca8[_0xef23('0x22')]?_[_0xef23('0x1f')](_0x495ca8[_0xef23('0x22')],function(_0x76bb9e){return{'model':db[_0x76bb9e['model']],'as':_0x76bb9e['as'],'attributes':_0x76bb9e[_0xef23('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd7b81a){logger[_0xef23('0xd')](_0xef23('0x23'),_0x1da93a);logger['debug'](_0xef23('0x23'),_0x1da93a,JSON[_0xef23('0x12')](_0xd7b81a));_0x3f9f84(_0xd7b81a);})[_0xef23('0x17')](function(_0x59a9a7){logger['error'](_0xef23('0x23'),_0x59a9a7['message'],_0x1da93a);_0x4ef74f(_0x1b3074['error'](0x1f4,_0x59a9a7[_0xef23('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 80901ff..929bf62 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xdb28,0x106));var _0x8db2=function(_0x297665,_0x481557){_0x297665=_0x297665-0x0;var _0x5cb1f9=_0xdb28[_0x297665];return _0x5cb1f9;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x475ce3,_0x432979){var _0x29580e=function(_0xb34c59){while(--_0xb34c59){_0x475ce3['push'](_0x475ce3['shift']());}};_0x29580e(++_0x432979);}(_0x7a54,0x106));var _0x47a5=function(_0x592f72,_0xcec8d5){_0x592f72=_0x592f72-0x0;var _0x2e7610=_0x7a54[_0x592f72];return _0x2e7610;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d97934d..fb0b720 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 _0x01c6=['Task','Case','contact_lead','contact','lead','account','nothing','sequelize','exports','STRING','ENUM'];(function(_0x484fb4,_0x40d647){var _0x140ad1=function(_0x1fd53b){while(--_0x1fd53b){_0x484fb4['push'](_0x484fb4['shift']());}};_0x140ad1(++_0x40d647);}(_0x01c6,0x1a9));var _0x601c=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x01c6[_0x53758c];return _0x425eff;};'use strict';var Sequelize=require(_0x601c('0x0'));module[_0x601c('0x1')]={'name':{'type':Sequelize[_0x601c('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x601c('0x3')](_0x601c('0x4'),_0x601c('0x5')),'defaultValue':_0x601c('0x4')},'moduleSearch':{'type':Sequelize[_0x601c('0x3')](_0x601c('0x6'),_0x601c('0x7'),_0x601c('0x8'),'account_contact_lead',_0x601c('0x9')),'defaultValue':_0x601c('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x601c('0xa'),'contact','lead',_0x601c('0x9')),'defaultValue':_0x601c('0x8')},'leadId':{'type':Sequelize[_0x601c('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x601c('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x601c('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x367f=['lead','account_contact_lead','account','nothing','STRING','sequelize','exports','Case','Task','ENUM','contact_lead','contact'];(function(_0x8ff472,_0x41c1e7){var _0x3ab9b3=function(_0x5b4d46){while(--_0x5b4d46){_0x8ff472['push'](_0x8ff472['shift']());}};_0x3ab9b3(++_0x41c1e7);}(_0x367f,0x179));var _0xf367=function(_0x42228c,_0x21f77d){_0x42228c=_0x42228c-0x0;var _0x450787=_0x367f[_0x42228c];return _0x450787;};'use strict';var Sequelize=require(_0xf367('0x0'));module[_0xf367('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('Task',_0xf367('0x2')),'defaultValue':_0xf367('0x3')},'moduleSearch':{'type':Sequelize[_0xf367('0x4')](_0xf367('0x5'),_0xf367('0x6'),_0xf367('0x7'),_0xf367('0x8'),_0xf367('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xf367('0x4')](_0xf367('0xa'),'contact',_0xf367('0x7'),_0xf367('0x9')),'defaultValue':_0xf367('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xf367('0xb')]},'additionalSearchContact':{'type':Sequelize[_0xf367('0xb')]},'additionalSearchLead':{'type':Sequelize[_0xf367('0xb')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index a55790e..362cea2 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 _0xfa12=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','then','destroy','error','stack','name','send','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','SalesforceConfiguration','includeAll','include','rows','catch','params','rawAttributes','length','body','update','find','getFields','findOne','SalesforceField','order','getSubjects','options','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x25905f,_0x4e631a){var _0x4042dc=function(_0x2a9176){while(--_0x2a9176){_0x25905f['push'](_0x25905f['shift']());}};_0x4042dc(++_0x4e631a);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x38c04e,_0x5968fa){_0x38c04e=_0x38c04e-0x0;var _0x3776d7=_0xfa12[_0x38c04e];return _0x3776d7;};'use strict';var emlformat=require(_0x2fa1('0x0'));var rimraf=require(_0x2fa1('0x1'));var zipdir=require(_0x2fa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2fa1('0x3'));var BPromise=require(_0x2fa1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2fa1('0x5'));var sox=require(_0x2fa1('0x6'));var csv=require(_0x2fa1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fa1('0x8'));var _=require('lodash');var squel=require(_0x2fa1('0x9'));var crypto=require(_0x2fa1('0xa'));var jsforce=require(_0x2fa1('0xb'));var deskjs=require(_0x2fa1('0xc'));var toCsv=require(_0x2fa1('0x7'));var querystring=require(_0x2fa1('0xd'));var Papa=require('papaparse');var Redis=require(_0x2fa1('0xe'));var authService=require(_0x2fa1('0xf'));var qs=require(_0x2fa1('0x10'));var as=require(_0x2fa1('0x11'));var hardwareService=require(_0x2fa1('0x12'));var logger=require(_0x2fa1('0x13'))(_0x2fa1('0x14'));var utils=require(_0x2fa1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2fa1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4365ce,_0x59f697){_0x59f697=_0x59f697||0xcc;return function(_0x44a525){if(_0x44a525){return _0x4365ce[_0x2fa1('0x17')](_0x59f697);}return _0x4365ce[_0x2fa1('0x18')](_0x59f697)[_0x2fa1('0x19')]();};}function respondWithResult(_0xc99b5e,_0x226fc7){_0x226fc7=_0x226fc7||0xc8;return function(_0x534898){if(_0x534898){return _0xc99b5e[_0x2fa1('0x18')](_0x226fc7)['json'](_0x534898);}};}function respondWithFilteredResult(_0x1d3515,_0x1be9ea){return function(_0x5d7602){if(_0x5d7602){var _0x2800a9=typeof _0x1be9ea[_0x2fa1('0x1a')]===_0x2fa1('0x1b')&&typeof _0x1be9ea[_0x2fa1('0x1c')]===_0x2fa1('0x1b');var _0x4dfed9=_0x5d7602['count'];var _0xf45e3f=_0x2800a9?0x0:_0x1be9ea['offset'];var _0x4209e6=_0x2800a9?_0x5d7602[_0x2fa1('0x1d')]:_0x1be9ea[_0x2fa1('0x1a')]+_0x1be9ea['limit'];var _0x156186;if(_0x4209e6>=_0x4dfed9){_0x4209e6=_0x4dfed9;_0x156186=0xc8;}else{_0x156186=0xce;}_0x1d3515[_0x2fa1('0x18')](_0x156186);return _0x1d3515['set'](_0x2fa1('0x1e'),_0xf45e3f+'-'+_0x4209e6+'/'+_0x4dfed9)[_0x2fa1('0x1f')](_0x5d7602);}return null;};}function patchUpdates(_0x4c9fbf){return function(_0x1a8038){try{jsonpatch['apply'](_0x1a8038,_0x4c9fbf,!![]);}catch(_0x11d253){return BPromise['reject'](_0x11d253);}return _0x1a8038[_0x2fa1('0x20')]();};}function saveUpdates(_0x531f3f,_0x4defdd){return function(_0x3ddf8a){if(_0x3ddf8a){return _0x3ddf8a['update'](_0x531f3f)[_0x2fa1('0x21')](function(_0x1ac35a){return _0x1ac35a;});}return null;};}function removeEntity(_0x35c18c,_0x544848){return function(_0x592379){if(_0x592379){return _0x592379[_0x2fa1('0x22')]()[_0x2fa1('0x21')](function(){_0x35c18c[_0x2fa1('0x18')](0xcc)[_0x2fa1('0x19')]();});}};}function handleEntityNotFound(_0x1fd5f3,_0x5c841e){return function(_0x32b88d){if(!_0x32b88d){_0x1fd5f3[_0x2fa1('0x17')](0x194);}return _0x32b88d;};}function handleError(_0x930cd5,_0x291fb2){_0x291fb2=_0x291fb2||0x1f4;return function(_0x19daba){logger[_0x2fa1('0x23')](_0x19daba[_0x2fa1('0x24')]);if(_0x19daba[_0x2fa1('0x25')]){delete _0x19daba[_0x2fa1('0x25')];}_0x930cd5['status'](_0x291fb2)[_0x2fa1('0x26')](_0x19daba);};}exports['index']=function(_0x2f4623,_0x29875f){var _0x56de59={},_0x2758d0={},_0x2551ef={'count':0x0,'rows':[]};var _0x234b21=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x499b40){return{'name':_0x499b40[_0x2fa1('0x27')],'type':_0x499b40['type'][_0x2fa1('0x28')]};});_0x2758d0[_0x2fa1('0x29')]=_[_0x2fa1('0x2a')](_0x234b21,_0x2fa1('0x25'));_0x2758d0[_0x2fa1('0x2b')]=_[_0x2fa1('0x2c')](_0x2f4623[_0x2fa1('0x2b')]);_0x2758d0[_0x2fa1('0x2d')]=_[_0x2fa1('0x2e')](_0x2758d0[_0x2fa1('0x29')],_0x2758d0[_0x2fa1('0x2b')]);_0x56de59[_0x2fa1('0x2f')]=_[_0x2fa1('0x2e')](_0x2758d0[_0x2fa1('0x29')],qs[_0x2fa1('0x30')](_0x2f4623['query'][_0x2fa1('0x30')]));_0x56de59[_0x2fa1('0x2f')]=_0x56de59[_0x2fa1('0x2f')]['length']?_0x56de59[_0x2fa1('0x2f')]:_0x2758d0[_0x2fa1('0x29')];if(!_0x2f4623['query'][_0x2fa1('0x31')](_0x2fa1('0x32'))){_0x56de59['limit']=qs[_0x2fa1('0x1c')](_0x2f4623[_0x2fa1('0x2b')][_0x2fa1('0x1c')]);_0x56de59['offset']=qs['offset'](_0x2f4623['query'][_0x2fa1('0x1a')]);}_0x56de59['order']=qs[_0x2fa1('0x33')](_0x2f4623[_0x2fa1('0x2b')]['sort']);_0x56de59['where']=qs[_0x2fa1('0x2d')](_[_0x2fa1('0x34')](_0x2f4623['query'],_0x2758d0[_0x2fa1('0x2d')]),_0x234b21);if(_0x2f4623['query'][_0x2fa1('0x35')]){_0x56de59[_0x2fa1('0x36')]=_['merge'](_0x56de59[_0x2fa1('0x36')],{'$or':_[_0x2fa1('0x2a')](_0x234b21,function(_0x4ffb38){if(_0x4ffb38[_0x2fa1('0x37')]!==_0x2fa1('0x38')){var _0x2d8a77={};_0x2d8a77[_0x4ffb38['name']]={'$like':'%'+_0x2f4623[_0x2fa1('0x2b')]['filter']+'%'};return _0x2d8a77;}})});}_0x56de59=_[_0x2fa1('0x39')]({},_0x56de59,_0x2f4623['options']);var _0x4a2878={'where':_0x56de59['where']};return db[_0x2fa1('0x3a')]['count'](_0x4a2878)[_0x2fa1('0x21')](function(_0x395cba){_0x2551ef['count']=_0x395cba;if(_0x2f4623[_0x2fa1('0x2b')][_0x2fa1('0x3b')]){_0x56de59[_0x2fa1('0x3c')]=[{'all':!![]}];}return db[_0x2fa1('0x3a')]['findAll'](_0x56de59);})['then'](function(_0x1cb199){_0x2551ef[_0x2fa1('0x3d')]=_0x1cb199;return _0x2551ef;})['then'](respondWithFilteredResult(_0x29875f,_0x56de59))[_0x2fa1('0x3e')](handleError(_0x29875f,null));};exports['show']=function(_0x365a90,_0x4136fa){var _0x5558b0={'raw':![],'where':{'id':_0x365a90[_0x2fa1('0x3f')]['id']}},_0x583fe4={};_0x583fe4['model']=_[_0x2fa1('0x2c')](db[_0x2fa1('0x3a')][_0x2fa1('0x40')]);_0x583fe4['query']=_['keys'](_0x365a90[_0x2fa1('0x2b')]);_0x583fe4[_0x2fa1('0x2d')]=_[_0x2fa1('0x2e')](_0x583fe4[_0x2fa1('0x29')],_0x583fe4[_0x2fa1('0x2b')]);_0x5558b0['attributes']=_[_0x2fa1('0x2e')](_0x583fe4[_0x2fa1('0x29')],qs[_0x2fa1('0x30')](_0x365a90[_0x2fa1('0x2b')][_0x2fa1('0x30')]));_0x5558b0[_0x2fa1('0x2f')]=_0x5558b0['attributes'][_0x2fa1('0x41')]?_0x5558b0[_0x2fa1('0x2f')]:_0x583fe4[_0x2fa1('0x29')];if(_0x365a90['query'][_0x2fa1('0x3b')]){_0x5558b0[_0x2fa1('0x3c')]=[{'all':!![]}];}_0x5558b0=_['merge']({},_0x5558b0,_0x365a90['options']);return db['SalesforceConfiguration']['find'](_0x5558b0)[_0x2fa1('0x21')](handleEntityNotFound(_0x4136fa,null))['then'](respondWithResult(_0x4136fa,null))['catch'](handleError(_0x4136fa,null));};exports['create']=function(_0x1919d3,_0x361137){return db[_0x2fa1('0x3a')]['create'](_0x1919d3[_0x2fa1('0x42')],{})[_0x2fa1('0x21')](respondWithResult(_0x361137,0xc9))[_0x2fa1('0x3e')](handleError(_0x361137,null));};exports[_0x2fa1('0x43')]=function(_0x37004f,_0xf1ceb7){if(_0x37004f[_0x2fa1('0x42')]['id']){delete _0x37004f[_0x2fa1('0x42')]['id'];}return db[_0x2fa1('0x3a')][_0x2fa1('0x44')]({'where':{'id':_0x37004f[_0x2fa1('0x3f')]['id']}})[_0x2fa1('0x21')](handleEntityNotFound(_0xf1ceb7,null))[_0x2fa1('0x21')](saveUpdates(_0x37004f['body'],null))[_0x2fa1('0x21')](respondWithResult(_0xf1ceb7,null))[_0x2fa1('0x3e')](handleError(_0xf1ceb7,null));};exports['destroy']=function(_0x37d487,_0x32deff){return db[_0x2fa1('0x3a')][_0x2fa1('0x44')]({'where':{'id':_0x37d487['params']['id']}})[_0x2fa1('0x21')](handleEntityNotFound(_0x32deff,null))[_0x2fa1('0x21')](removeEntity(_0x32deff,null))[_0x2fa1('0x3e')](handleError(_0x32deff,null));};exports[_0x2fa1('0x45')]=function(_0x23e9a1,_0x32a854,_0x16ff8a){var _0x5251fe={};var _0x29ca13={};var _0x1d628a;var _0x21931a;return db[_0x2fa1('0x3a')][_0x2fa1('0x46')]({'where':{'id':_0x23e9a1[_0x2fa1('0x3f')]['id']}})[_0x2fa1('0x21')](handleEntityNotFound(_0x32a854,null))[_0x2fa1('0x21')](function(_0x2ddf99){if(_0x2ddf99){_0x1d628a=_0x2ddf99;_0x29ca13[_0x2fa1('0x29')]=_[_0x2fa1('0x2c')](db[_0x2fa1('0x47')]['rawAttributes']);_0x29ca13[_0x2fa1('0x2b')]=_['keys'](_0x23e9a1['query']);_0x29ca13['filters']=_[_0x2fa1('0x2e')](_0x29ca13['model'],_0x29ca13[_0x2fa1('0x2b')]);_0x5251fe['attributes']=_[_0x2fa1('0x2e')](_0x29ca13[_0x2fa1('0x29')],qs[_0x2fa1('0x30')](_0x23e9a1[_0x2fa1('0x2b')][_0x2fa1('0x30')]));_0x5251fe[_0x2fa1('0x2f')]=_0x5251fe[_0x2fa1('0x2f')][_0x2fa1('0x41')]?_0x5251fe[_0x2fa1('0x2f')]:_0x29ca13[_0x2fa1('0x29')];_0x5251fe[_0x2fa1('0x48')]=qs[_0x2fa1('0x33')](_0x23e9a1[_0x2fa1('0x2b')]['sort']);_0x5251fe[_0x2fa1('0x36')]=qs[_0x2fa1('0x2d')](_[_0x2fa1('0x34')](_0x23e9a1[_0x2fa1('0x2b')],_0x29ca13[_0x2fa1('0x2d')]));if(_0x23e9a1[_0x2fa1('0x2b')][_0x2fa1('0x35')]){_0x5251fe[_0x2fa1('0x36')]=_[_0x2fa1('0x39')](_0x5251fe[_0x2fa1('0x36')],{'$or':_[_0x2fa1('0x2a')](_0x5251fe[_0x2fa1('0x2f')],function(_0xc77884){var _0x2b7ad9={};_0x2b7ad9[_0xc77884]={'$like':'%'+_0x23e9a1[_0x2fa1('0x2b')][_0x2fa1('0x35')]+'%'};return _0x2b7ad9;})});}_0x5251fe=_[_0x2fa1('0x39')]({},_0x5251fe,_0x23e9a1['options']);return _0x1d628a[_0x2fa1('0x45')](_0x5251fe);}})[_0x2fa1('0x21')](function(_0x5ac7d7){if(_0x5ac7d7){_0x21931a=_0x5ac7d7[_0x2fa1('0x41')];if(!_0x23e9a1[_0x2fa1('0x2b')]['hasOwnProperty'](_0x2fa1('0x32'))){_0x5251fe[_0x2fa1('0x1c')]=qs[_0x2fa1('0x1c')](_0x23e9a1[_0x2fa1('0x2b')][_0x2fa1('0x1c')]);_0x5251fe['offset']=qs[_0x2fa1('0x1a')](_0x23e9a1[_0x2fa1('0x2b')][_0x2fa1('0x1a')]);}return _0x1d628a[_0x2fa1('0x45')](_0x5251fe);}})[_0x2fa1('0x21')](function(_0x1a3f1f){if(_0x1a3f1f){return _0x1a3f1f?{'count':_0x21931a,'rows':_0x1a3f1f}:null;}})[_0x2fa1('0x21')](respondWithResult(_0x32a854,null))['catch'](handleError(_0x32a854,null));};exports[_0x2fa1('0x49')]=function(_0x894460,_0x5512da,_0x510b03){var _0x190cd4={};var _0x16dfa1={};var _0x5c7b5c;var _0x4ff01;return db[_0x2fa1('0x3a')]['findOne']({'where':{'id':_0x894460['params']['id']}})[_0x2fa1('0x21')](handleEntityNotFound(_0x5512da,null))['then'](function(_0x17a589){if(_0x17a589){_0x5c7b5c=_0x17a589;_0x16dfa1[_0x2fa1('0x29')]=_[_0x2fa1('0x2c')](db[_0x2fa1('0x47')][_0x2fa1('0x40')]);_0x16dfa1[_0x2fa1('0x2b')]=_[_0x2fa1('0x2c')](_0x894460[_0x2fa1('0x2b')]);_0x16dfa1[_0x2fa1('0x2d')]=_['intersection'](_0x16dfa1[_0x2fa1('0x29')],_0x16dfa1[_0x2fa1('0x2b')]);_0x190cd4['attributes']=_[_0x2fa1('0x2e')](_0x16dfa1[_0x2fa1('0x29')],qs[_0x2fa1('0x30')](_0x894460[_0x2fa1('0x2b')][_0x2fa1('0x30')]));_0x190cd4[_0x2fa1('0x2f')]=_0x190cd4[_0x2fa1('0x2f')][_0x2fa1('0x41')]?_0x190cd4['attributes']:_0x16dfa1[_0x2fa1('0x29')];_0x190cd4[_0x2fa1('0x48')]=qs[_0x2fa1('0x33')](_0x894460['query'][_0x2fa1('0x33')]);_0x190cd4['where']=qs[_0x2fa1('0x2d')](_[_0x2fa1('0x34')](_0x894460[_0x2fa1('0x2b')],_0x16dfa1[_0x2fa1('0x2d')]));if(_0x894460[_0x2fa1('0x2b')][_0x2fa1('0x35')]){_0x190cd4[_0x2fa1('0x36')]=_[_0x2fa1('0x39')](_0x190cd4['where'],{'$or':_[_0x2fa1('0x2a')](_0x190cd4[_0x2fa1('0x2f')],function(_0x176514){var _0x38b9be={};_0x38b9be[_0x176514]={'$like':'%'+_0x894460[_0x2fa1('0x2b')]['filter']+'%'};return _0x38b9be;})});}_0x190cd4=_[_0x2fa1('0x39')]({},_0x190cd4,_0x894460[_0x2fa1('0x4a')]);return _0x5c7b5c[_0x2fa1('0x49')](_0x190cd4);}})[_0x2fa1('0x21')](function(_0x60a0a){if(_0x60a0a){_0x4ff01=_0x60a0a[_0x2fa1('0x41')];if(!_0x894460[_0x2fa1('0x2b')]['hasOwnProperty'](_0x2fa1('0x32'))){_0x190cd4['limit']=qs[_0x2fa1('0x1c')](_0x894460[_0x2fa1('0x2b')][_0x2fa1('0x1c')]);_0x190cd4[_0x2fa1('0x1a')]=qs['offset'](_0x894460[_0x2fa1('0x2b')][_0x2fa1('0x1a')]);}return _0x5c7b5c[_0x2fa1('0x49')](_0x190cd4);}})[_0x2fa1('0x21')](function(_0x3ee582){if(_0x3ee582){return _0x3ee582?{'count':_0x4ff01,'rows':_0x3ee582}:null;}})[_0x2fa1('0x21')](respondWithResult(_0x5512da,null))[_0x2fa1('0x3e')](handleError(_0x5512da,null));};exports['getDescriptions']=function(_0xcc5d9a,_0x2fe694,_0x5834ea){var _0x1dc550={};var _0x415315={};var _0xd014e7;var _0xafb85c;return db['SalesforceConfiguration'][_0x2fa1('0x46')]({'where':{'id':_0xcc5d9a[_0x2fa1('0x3f')]['id']}})[_0x2fa1('0x21')](handleEntityNotFound(_0x2fe694,null))['then'](function(_0x48c813){if(_0x48c813){_0xd014e7=_0x48c813;_0x415315[_0x2fa1('0x29')]=_[_0x2fa1('0x2c')](db[_0x2fa1('0x47')][_0x2fa1('0x40')]);_0x415315[_0x2fa1('0x2b')]=_[_0x2fa1('0x2c')](_0xcc5d9a[_0x2fa1('0x2b')]);_0x415315[_0x2fa1('0x2d')]=_['intersection'](_0x415315['model'],_0x415315[_0x2fa1('0x2b')]);_0x1dc550[_0x2fa1('0x2f')]=_[_0x2fa1('0x2e')](_0x415315['model'],qs[_0x2fa1('0x30')](_0xcc5d9a['query']['fields']));_0x1dc550[_0x2fa1('0x2f')]=_0x1dc550['attributes'][_0x2fa1('0x41')]?_0x1dc550[_0x2fa1('0x2f')]:_0x415315[_0x2fa1('0x29')];_0x1dc550[_0x2fa1('0x48')]=qs[_0x2fa1('0x33')](_0xcc5d9a['query'][_0x2fa1('0x33')]);_0x1dc550['where']=qs['filters'](_[_0x2fa1('0x34')](_0xcc5d9a[_0x2fa1('0x2b')],_0x415315[_0x2fa1('0x2d')]));if(_0xcc5d9a['query'][_0x2fa1('0x35')]){_0x1dc550[_0x2fa1('0x36')]=_[_0x2fa1('0x39')](_0x1dc550['where'],{'$or':_[_0x2fa1('0x2a')](_0x1dc550[_0x2fa1('0x2f')],function(_0x52988a){var _0x2f0968={};_0x2f0968[_0x52988a]={'$like':'%'+_0xcc5d9a['query']['filter']+'%'};return _0x2f0968;})});}_0x1dc550=_['merge']({},_0x1dc550,_0xcc5d9a[_0x2fa1('0x4a')]);return _0xd014e7[_0x2fa1('0x4b')](_0x1dc550);}})[_0x2fa1('0x21')](function(_0x49f0a5){if(_0x49f0a5){_0xafb85c=_0x49f0a5['length'];if(!_0xcc5d9a['query'][_0x2fa1('0x31')]('nolimit')){_0x1dc550['limit']=qs[_0x2fa1('0x1c')](_0xcc5d9a[_0x2fa1('0x2b')][_0x2fa1('0x1c')]);_0x1dc550[_0x2fa1('0x1a')]=qs[_0x2fa1('0x1a')](_0xcc5d9a[_0x2fa1('0x2b')]['offset']);}return _0xd014e7[_0x2fa1('0x4b')](_0x1dc550);}})[_0x2fa1('0x21')](function(_0x31053e){if(_0x31053e){return _0x31053e?{'count':_0xafb85c,'rows':_0x31053e}:null;}})[_0x2fa1('0x21')](respondWithResult(_0x2fe694,null))[_0x2fa1('0x3e')](handleError(_0x2fe694,null));}; \ No newline at end of file +var _0x5c71=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','length','create','body','find','getFields','findOne','SalesforceField','rawAttributes','order','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x577d4c,_0x589a5d){var _0x402a3b=function(_0x38d426){while(--_0x38d426){_0x577d4c['push'](_0x577d4c['shift']());}};_0x402a3b(++_0x589a5d);}(_0x5c71,0x1e5));var _0x15c7=function(_0x5307d8,_0x3112a9){_0x5307d8=_0x5307d8-0x0;var _0x547d68=_0x5c71[_0x5307d8];return _0x547d68;};'use strict';var emlformat=require(_0x15c7('0x0'));var rimraf=require(_0x15c7('0x1'));var zipdir=require(_0x15c7('0x2'));var jsonpatch=require(_0x15c7('0x3'));var rp=require(_0x15c7('0x4'));var moment=require(_0x15c7('0x5'));var BPromise=require(_0x15c7('0x6'));var Mustache=require(_0x15c7('0x7'));var util=require(_0x15c7('0x8'));var path=require(_0x15c7('0x9'));var sox=require(_0x15c7('0xa'));var csv=require(_0x15c7('0xb'));var ejs=require(_0x15c7('0xc'));var fs=require('fs');var fs_extra=require(_0x15c7('0xd'));var _=require(_0x15c7('0xe'));var squel=require(_0x15c7('0xf'));var crypto=require('crypto');var jsforce=require(_0x15c7('0x10'));var deskjs=require(_0x15c7('0x11'));var toCsv=require(_0x15c7('0xb'));var querystring=require(_0x15c7('0x12'));var Papa=require('papaparse');var Redis=require(_0x15c7('0x13'));var authService=require(_0x15c7('0x14'));var qs=require(_0x15c7('0x15'));var as=require(_0x15c7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15c7('0x17'))(_0x15c7('0x18'));var utils=require(_0x15c7('0x19'));var config=require(_0x15c7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x15c7('0x1b'))['db'];function respondWithStatusCode(_0xed3a3,_0x5bb4cb){_0x5bb4cb=_0x5bb4cb||0xcc;return function(_0x38e057){if(_0x38e057){return _0xed3a3[_0x15c7('0x1c')](_0x5bb4cb);}return _0xed3a3[_0x15c7('0x1d')](_0x5bb4cb)['end']();};}function respondWithResult(_0x1410ca,_0x438ba7){_0x438ba7=_0x438ba7||0xc8;return function(_0x51d81c){if(_0x51d81c){return _0x1410ca[_0x15c7('0x1d')](_0x438ba7)['json'](_0x51d81c);}};}function respondWithFilteredResult(_0x274f3a,_0x1363b6){return function(_0x51c250){if(_0x51c250){var _0x739632=typeof _0x1363b6[_0x15c7('0x1e')]===_0x15c7('0x1f')&&typeof _0x1363b6[_0x15c7('0x20')]===_0x15c7('0x1f');var _0x507674=_0x51c250[_0x15c7('0x21')];var _0x3eff9d=_0x739632?0x0:_0x1363b6['offset'];var _0xa342b9=_0x739632?_0x51c250['count']:_0x1363b6[_0x15c7('0x1e')]+_0x1363b6[_0x15c7('0x20')];var _0x56b75a;if(_0xa342b9>=_0x507674){_0xa342b9=_0x507674;_0x56b75a=0xc8;}else{_0x56b75a=0xce;}_0x274f3a[_0x15c7('0x1d')](_0x56b75a);return _0x274f3a['set']('Content-Range',_0x3eff9d+'-'+_0xa342b9+'/'+_0x507674)[_0x15c7('0x22')](_0x51c250);}return null;};}function patchUpdates(_0xe1833d){return function(_0x449c28){try{jsonpatch[_0x15c7('0x23')](_0x449c28,_0xe1833d,!![]);}catch(_0x37bf16){return BPromise['reject'](_0x37bf16);}return _0x449c28[_0x15c7('0x24')]();};}function saveUpdates(_0x50eff7,_0x3c9d98){return function(_0x535c8d){if(_0x535c8d){return _0x535c8d[_0x15c7('0x25')](_0x50eff7)[_0x15c7('0x26')](function(_0x1b8615){return _0x1b8615;});}return null;};}function removeEntity(_0x1cb7d5,_0x179d32){return function(_0x4ac413){if(_0x4ac413){return _0x4ac413[_0x15c7('0x27')]()['then'](function(){_0x1cb7d5[_0x15c7('0x1d')](0xcc)[_0x15c7('0x28')]();});}};}function handleEntityNotFound(_0x2be6dc,_0x961846){return function(_0x4ea401){if(!_0x4ea401){_0x2be6dc['sendStatus'](0x194);}return _0x4ea401;};}function handleError(_0x289725,_0x5dd040){_0x5dd040=_0x5dd040||0x1f4;return function(_0x43e30e){logger[_0x15c7('0x29')](_0x43e30e[_0x15c7('0x2a')]);if(_0x43e30e[_0x15c7('0x2b')]){delete _0x43e30e[_0x15c7('0x2b')];}_0x289725[_0x15c7('0x1d')](_0x5dd040)[_0x15c7('0x2c')](_0x43e30e);};}exports[_0x15c7('0x2d')]=function(_0x5b8385,_0x386e5d){var _0xe61b73={},_0x2eebae={},_0x3d0e3d={'count':0x0,'rows':[]};var _0x334763=_[_0x15c7('0x2e')](db[_0x15c7('0x2f')]['rawAttributes'],function(_0x9fc78a){return{'name':_0x9fc78a[_0x15c7('0x30')],'type':_0x9fc78a[_0x15c7('0x31')][_0x15c7('0x32')]};});_0x2eebae[_0x15c7('0x33')]=_[_0x15c7('0x2e')](_0x334763,_0x15c7('0x2b'));_0x2eebae[_0x15c7('0x34')]=_[_0x15c7('0x35')](_0x5b8385[_0x15c7('0x34')]);_0x2eebae[_0x15c7('0x36')]=_['intersection'](_0x2eebae[_0x15c7('0x33')],_0x2eebae[_0x15c7('0x34')]);_0xe61b73['attributes']=_['intersection'](_0x2eebae['model'],qs[_0x15c7('0x37')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x37')]));_0xe61b73[_0x15c7('0x38')]=_0xe61b73[_0x15c7('0x38')]['length']?_0xe61b73[_0x15c7('0x38')]:_0x2eebae[_0x15c7('0x33')];if(!_0x5b8385[_0x15c7('0x34')][_0x15c7('0x39')]('nolimit')){_0xe61b73[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x20')]);_0xe61b73[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x1e')]);}_0xe61b73['order']=qs[_0x15c7('0x3a')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x3a')]);_0xe61b73[_0x15c7('0x3b')]=qs[_0x15c7('0x36')](_[_0x15c7('0x3c')](_0x5b8385[_0x15c7('0x34')],_0x2eebae[_0x15c7('0x36')]),_0x334763);if(_0x5b8385[_0x15c7('0x34')][_0x15c7('0x3d')]){_0xe61b73[_0x15c7('0x3b')]=_[_0x15c7('0x3e')](_0xe61b73[_0x15c7('0x3b')],{'$or':_[_0x15c7('0x2e')](_0x334763,function(_0x42ba47){if(_0x42ba47['type']!==_0x15c7('0x3f')){var _0x441aa1={};_0x441aa1[_0x42ba47[_0x15c7('0x2b')]]={'$like':'%'+_0x5b8385[_0x15c7('0x34')][_0x15c7('0x3d')]+'%'};return _0x441aa1;}})});}_0xe61b73=_[_0x15c7('0x3e')]({},_0xe61b73,_0x5b8385[_0x15c7('0x40')]);var _0x2b59c9={'where':_0xe61b73['where']};return db[_0x15c7('0x2f')][_0x15c7('0x21')](_0x2b59c9)[_0x15c7('0x26')](function(_0x4b4ef0){_0x3d0e3d['count']=_0x4b4ef0;if(_0x5b8385[_0x15c7('0x34')]['includeAll']){_0xe61b73[_0x15c7('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x15c7('0x42')](_0xe61b73);})['then'](function(_0x3a9dfb){_0x3d0e3d[_0x15c7('0x43')]=_0x3a9dfb;return _0x3d0e3d;})[_0x15c7('0x26')](respondWithFilteredResult(_0x386e5d,_0xe61b73))[_0x15c7('0x44')](handleError(_0x386e5d,null));};exports[_0x15c7('0x45')]=function(_0x32cbd1,_0x205a58){var _0x445ec6={'raw':![],'where':{'id':_0x32cbd1[_0x15c7('0x46')]['id']}},_0x6665dc={};_0x6665dc[_0x15c7('0x33')]=_['keys'](db[_0x15c7('0x2f')]['rawAttributes']);_0x6665dc['query']=_['keys'](_0x32cbd1[_0x15c7('0x34')]);_0x6665dc[_0x15c7('0x36')]=_[_0x15c7('0x47')](_0x6665dc[_0x15c7('0x33')],_0x6665dc[_0x15c7('0x34')]);_0x445ec6[_0x15c7('0x38')]=_[_0x15c7('0x47')](_0x6665dc[_0x15c7('0x33')],qs['fields'](_0x32cbd1[_0x15c7('0x34')][_0x15c7('0x37')]));_0x445ec6[_0x15c7('0x38')]=_0x445ec6[_0x15c7('0x38')][_0x15c7('0x48')]?_0x445ec6[_0x15c7('0x38')]:_0x6665dc[_0x15c7('0x33')];if(_0x32cbd1[_0x15c7('0x34')]['includeAll']){_0x445ec6[_0x15c7('0x41')]=[{'all':!![]}];}_0x445ec6=_[_0x15c7('0x3e')]({},_0x445ec6,_0x32cbd1['options']);return db['SalesforceConfiguration']['find'](_0x445ec6)['then'](handleEntityNotFound(_0x205a58,null))[_0x15c7('0x26')](respondWithResult(_0x205a58,null))[_0x15c7('0x44')](handleError(_0x205a58,null));};exports[_0x15c7('0x49')]=function(_0x1d329b,_0x2eff2f){return db[_0x15c7('0x2f')][_0x15c7('0x49')](_0x1d329b[_0x15c7('0x4a')],{})[_0x15c7('0x26')](respondWithResult(_0x2eff2f,0xc9))[_0x15c7('0x44')](handleError(_0x2eff2f,null));};exports['update']=function(_0x5e8e26,_0x432818){if(_0x5e8e26[_0x15c7('0x4a')]['id']){delete _0x5e8e26[_0x15c7('0x4a')]['id'];}return db[_0x15c7('0x2f')]['find']({'where':{'id':_0x5e8e26[_0x15c7('0x46')]['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x432818,null))['then'](saveUpdates(_0x5e8e26[_0x15c7('0x4a')],null))['then'](respondWithResult(_0x432818,null))[_0x15c7('0x44')](handleError(_0x432818,null));};exports[_0x15c7('0x27')]=function(_0x128eec,_0x4d14fa){return db['SalesforceConfiguration'][_0x15c7('0x4b')]({'where':{'id':_0x128eec[_0x15c7('0x46')]['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x4d14fa,null))[_0x15c7('0x26')](removeEntity(_0x4d14fa,null))[_0x15c7('0x44')](handleError(_0x4d14fa,null));};exports[_0x15c7('0x4c')]=function(_0x12e904,_0x1dfb4d,_0xdda39c){var _0x30a9d4={};var _0x1e6bea={};var _0x32752a;var _0x5f0762;return db['SalesforceConfiguration'][_0x15c7('0x4d')]({'where':{'id':_0x12e904['params']['id']}})['then'](handleEntityNotFound(_0x1dfb4d,null))[_0x15c7('0x26')](function(_0x6e8142){if(_0x6e8142){_0x32752a=_0x6e8142;_0x1e6bea[_0x15c7('0x33')]=_[_0x15c7('0x35')](db[_0x15c7('0x4e')][_0x15c7('0x4f')]);_0x1e6bea['query']=_[_0x15c7('0x35')](_0x12e904[_0x15c7('0x34')]);_0x1e6bea[_0x15c7('0x36')]=_[_0x15c7('0x47')](_0x1e6bea[_0x15c7('0x33')],_0x1e6bea[_0x15c7('0x34')]);_0x30a9d4['attributes']=_[_0x15c7('0x47')](_0x1e6bea[_0x15c7('0x33')],qs[_0x15c7('0x37')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x37')]));_0x30a9d4['attributes']=_0x30a9d4['attributes']['length']?_0x30a9d4['attributes']:_0x1e6bea['model'];_0x30a9d4[_0x15c7('0x50')]=qs[_0x15c7('0x3a')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x3a')]);_0x30a9d4[_0x15c7('0x3b')]=qs[_0x15c7('0x36')](_[_0x15c7('0x3c')](_0x12e904[_0x15c7('0x34')],_0x1e6bea[_0x15c7('0x36')]));if(_0x12e904['query']['filter']){_0x30a9d4[_0x15c7('0x3b')]=_[_0x15c7('0x3e')](_0x30a9d4['where'],{'$or':_[_0x15c7('0x2e')](_0x30a9d4['attributes'],function(_0x177f33){var _0x2bec28={};_0x2bec28[_0x177f33]={'$like':'%'+_0x12e904[_0x15c7('0x34')][_0x15c7('0x3d')]+'%'};return _0x2bec28;})});}_0x30a9d4=_['merge']({},_0x30a9d4,_0x12e904[_0x15c7('0x40')]);return _0x32752a[_0x15c7('0x4c')](_0x30a9d4);}})[_0x15c7('0x26')](function(_0x148b03){if(_0x148b03){_0x5f0762=_0x148b03[_0x15c7('0x48')];if(!_0x12e904[_0x15c7('0x34')][_0x15c7('0x39')]('nolimit')){_0x30a9d4[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x20')]);_0x30a9d4[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x1e')]);}return _0x32752a[_0x15c7('0x4c')](_0x30a9d4);}})[_0x15c7('0x26')](function(_0x1a4b87){if(_0x1a4b87){return _0x1a4b87?{'count':_0x5f0762,'rows':_0x1a4b87}:null;}})[_0x15c7('0x26')](respondWithResult(_0x1dfb4d,null))[_0x15c7('0x44')](handleError(_0x1dfb4d,null));};exports[_0x15c7('0x51')]=function(_0x4c42d4,_0x2608c8,_0x6c08d3){var _0x5b7ff1={};var _0x140ae6={};var _0x4810be;var _0x1b634b;return db[_0x15c7('0x2f')][_0x15c7('0x4d')]({'where':{'id':_0x4c42d4['params']['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x2608c8,null))[_0x15c7('0x26')](function(_0x5eee5c){if(_0x5eee5c){_0x4810be=_0x5eee5c;_0x140ae6[_0x15c7('0x33')]=_[_0x15c7('0x35')](db['SalesforceField'][_0x15c7('0x4f')]);_0x140ae6['query']=_[_0x15c7('0x35')](_0x4c42d4[_0x15c7('0x34')]);_0x140ae6['filters']=_[_0x15c7('0x47')](_0x140ae6[_0x15c7('0x33')],_0x140ae6[_0x15c7('0x34')]);_0x5b7ff1[_0x15c7('0x38')]=_['intersection'](_0x140ae6[_0x15c7('0x33')],qs[_0x15c7('0x37')](_0x4c42d4[_0x15c7('0x34')][_0x15c7('0x37')]));_0x5b7ff1[_0x15c7('0x38')]=_0x5b7ff1[_0x15c7('0x38')][_0x15c7('0x48')]?_0x5b7ff1[_0x15c7('0x38')]:_0x140ae6[_0x15c7('0x33')];_0x5b7ff1[_0x15c7('0x50')]=qs[_0x15c7('0x3a')](_0x4c42d4[_0x15c7('0x34')][_0x15c7('0x3a')]);_0x5b7ff1[_0x15c7('0x3b')]=qs['filters'](_[_0x15c7('0x3c')](_0x4c42d4[_0x15c7('0x34')],_0x140ae6[_0x15c7('0x36')]));if(_0x4c42d4[_0x15c7('0x34')][_0x15c7('0x3d')]){_0x5b7ff1[_0x15c7('0x3b')]=_[_0x15c7('0x3e')](_0x5b7ff1[_0x15c7('0x3b')],{'$or':_[_0x15c7('0x2e')](_0x5b7ff1[_0x15c7('0x38')],function(_0x44d011){var _0x4ec1e4={};_0x4ec1e4[_0x44d011]={'$like':'%'+_0x4c42d4[_0x15c7('0x34')]['filter']+'%'};return _0x4ec1e4;})});}_0x5b7ff1=_['merge']({},_0x5b7ff1,_0x4c42d4[_0x15c7('0x40')]);return _0x4810be['getSubjects'](_0x5b7ff1);}})[_0x15c7('0x26')](function(_0x23c83f){if(_0x23c83f){_0x1b634b=_0x23c83f[_0x15c7('0x48')];if(!_0x4c42d4['query']['hasOwnProperty'](_0x15c7('0x52'))){_0x5b7ff1[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x4c42d4['query'][_0x15c7('0x20')]);_0x5b7ff1[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x4c42d4['query'][_0x15c7('0x1e')]);}return _0x4810be[_0x15c7('0x51')](_0x5b7ff1);}})['then'](function(_0x70c19d){if(_0x70c19d){return _0x70c19d?{'count':_0x1b634b,'rows':_0x70c19d}:null;}})[_0x15c7('0x26')](respondWithResult(_0x2608c8,null))[_0x15c7('0x44')](handleError(_0x2608c8,null));};exports['getDescriptions']=function(_0x4d8212,_0x3490ca,_0x1e9bee){var _0x36627a={};var _0x2aad98={};var _0x11799a;var _0x9ec094;return db[_0x15c7('0x2f')]['findOne']({'where':{'id':_0x4d8212[_0x15c7('0x46')]['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x3490ca,null))[_0x15c7('0x26')](function(_0xfc81cd){if(_0xfc81cd){_0x11799a=_0xfc81cd;_0x2aad98['model']=_[_0x15c7('0x35')](db[_0x15c7('0x4e')][_0x15c7('0x4f')]);_0x2aad98[_0x15c7('0x34')]=_[_0x15c7('0x35')](_0x4d8212['query']);_0x2aad98[_0x15c7('0x36')]=_['intersection'](_0x2aad98[_0x15c7('0x33')],_0x2aad98[_0x15c7('0x34')]);_0x36627a[_0x15c7('0x38')]=_[_0x15c7('0x47')](_0x2aad98[_0x15c7('0x33')],qs[_0x15c7('0x37')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x37')]));_0x36627a[_0x15c7('0x38')]=_0x36627a[_0x15c7('0x38')]['length']?_0x36627a[_0x15c7('0x38')]:_0x2aad98[_0x15c7('0x33')];_0x36627a[_0x15c7('0x50')]=qs[_0x15c7('0x3a')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x3a')]);_0x36627a[_0x15c7('0x3b')]=qs[_0x15c7('0x36')](_['pick'](_0x4d8212['query'],_0x2aad98['filters']));if(_0x4d8212[_0x15c7('0x34')][_0x15c7('0x3d')]){_0x36627a['where']=_[_0x15c7('0x3e')](_0x36627a[_0x15c7('0x3b')],{'$or':_['map'](_0x36627a[_0x15c7('0x38')],function(_0x23bfcd){var _0x47a27b={};_0x47a27b[_0x23bfcd]={'$like':'%'+_0x4d8212[_0x15c7('0x34')]['filter']+'%'};return _0x47a27b;})});}_0x36627a=_[_0x15c7('0x3e')]({},_0x36627a,_0x4d8212['options']);return _0x11799a[_0x15c7('0x53')](_0x36627a);}})[_0x15c7('0x26')](function(_0x1d3139){if(_0x1d3139){_0x9ec094=_0x1d3139['length'];if(!_0x4d8212[_0x15c7('0x34')][_0x15c7('0x39')](_0x15c7('0x52'))){_0x36627a[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x20')]);_0x36627a[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x1e')]);}return _0x11799a[_0x15c7('0x53')](_0x36627a);}})[_0x15c7('0x26')](function(_0x28d390){if(_0x28d390){return _0x28d390?{'count':_0x9ec094,'rows':_0x28d390}:null;}})[_0x15c7('0x26')](respondWithResult(_0x3490ca,null))['catch'](handleError(_0x3490ca,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 5b70636..3026e96 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 _0xd5b8=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','lodash','util','api','moment','bluebird'];(function(_0x1f4674,_0x146085){var _0x3e7f42=function(_0x4bd366){while(--_0x4bd366){_0x1f4674['push'](_0x1f4674['shift']());}};_0x3e7f42(++_0x146085);}(_0xd5b8,0x171));var _0x8d5b=function(_0x23213f,_0x4a7364){_0x23213f=_0x23213f-0x0;var _0x37dea9=_0xd5b8[_0x23213f];return _0x37dea9;};'use strict';var _=require(_0x8d5b('0x0'));var util=require(_0x8d5b('0x1'));var logger=require('../../config/logger')(_0x8d5b('0x2'));var moment=require(_0x8d5b('0x3'));var BPromise=require(_0x8d5b('0x4'));var rp=require(_0x8d5b('0x5'));var fs=require('fs');var path=require(_0x8d5b('0x6'));var rimraf=require(_0x8d5b('0x7'));var config=require(_0x8d5b('0x8'));var attributes=require(_0x8d5b('0x9'));module['exports']=function(_0x2d2ffa,_0x20bb00){return _0x2d2ffa[_0x8d5b('0xa')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb369=['util','../../config/logger','moment','request-promise','path','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb369,0x10d));var _0x9b36=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb369[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9b36('0x0'));var util=require(_0x9b36('0x1'));var logger=require(_0x9b36('0x2'))('api');var moment=require(_0x9b36('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b36('0x4'));var fs=require('fs');var path=require(_0x9b36('0x5'));var rimraf=require('rimraf');var config=require(_0x9b36('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x31665d,_0x520226){return _0x31665d[_0x9b36('0x7')](_0x9b36('0x8'),attributes,{'tableName':_0x9b36('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 32a292c..05815f0 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 _0x835a=['../../config/environment','jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xf9e683,_0x3dbbad){var _0x30f6a0=function(_0x3210e7){while(--_0x3210e7){_0xf9e683['push'](_0xf9e683['shift']());}};_0x30f6a0(++_0x3dbbad);}(_0x835a,0x1c8));var _0xa835=function(_0x3c5f7c,_0x5399e5){_0x3c5f7c=_0x3c5f7c-0x0;var _0x469b35=_0x835a[_0x3c5f7c];return _0x469b35;};'use strict';var _=require(_0xa835('0x0'));var util=require('util');var moment=require(_0xa835('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa835('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa835('0x3'));var logger=require(_0xa835('0x4'))(_0xa835('0x5'));var config=require(_0xa835('0x6'));var jayson=require(_0xa835('0x7'));var client=jayson[_0xa835('0x8')][_0xa835('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dcf26,_0x31a03e,_0x34a9d8){return new BPromise(function(_0x14e1ca,_0x1adf36){return client['request'](_0x3dcf26,_0x34a9d8)[_0xa835('0xa')](function(_0xb2e1d7){logger['info'](_0xa835('0xb'),_0x31a03e,_0xa835('0xc'));logger[_0xa835('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x31a03e,_0xa835('0xc'),JSON[_0xa835('0xe')](_0xb2e1d7));if(_0xb2e1d7['error']){if(_0xb2e1d7[_0xa835('0xf')][_0xa835('0x10')]===0x1f4){logger[_0xa835('0xf')](_0xa835('0xb'),_0x31a03e,_0xb2e1d7['error']['message']);return _0x1adf36(_0xb2e1d7['error'][_0xa835('0x11')]);}logger[_0xa835('0xf')](_0xa835('0xb'),_0x31a03e,_0xb2e1d7['error'][_0xa835('0x11')]);return _0x14e1ca(_0xb2e1d7['error']['message']);}else{logger[_0xa835('0x12')](_0xa835('0xb'),_0x31a03e,_0xa835('0xc'));_0x14e1ca(_0xb2e1d7[_0xa835('0x13')][_0xa835('0x11')]);}})[_0xa835('0x14')](function(_0x1dc33d){logger[_0xa835('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x31a03e,_0x1dc33d);_0x1adf36(_0x1dc33d);});});} \ No newline at end of file +var _0xb138=['debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xb138,0xec));var _0x8b13=function(_0xc4531,_0x554edd){_0xc4531=_0xc4531-0x0;var _0x44897d=_0xb138[_0xc4531];return _0x44897d;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var BPromise=require(_0x8b13('0x3'));var rs=require(_0x8b13('0x4'));var fs=require('fs');var Redis=require(_0x8b13('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b13('0x6'));var logger=require(_0x8b13('0x7'))(_0x8b13('0x8'));var config=require(_0x8b13('0x9'));var jayson=require(_0x8b13('0xa'));var client=jayson[_0x8b13('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996a2,_0x2ad730,_0x379778){return new BPromise(function(_0x3a24cb,_0x2002b2){return client[_0x8b13('0xc')](_0x5996a2,_0x379778)[_0x8b13('0xd')](function(_0x450618){logger[_0x8b13('0xe')](_0x8b13('0xf'),_0x2ad730,_0x8b13('0x10'));logger[_0x8b13('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2ad730,'request\x20sent',JSON[_0x8b13('0x12')](_0x450618));if(_0x450618['error']){if(_0x450618[_0x8b13('0x13')][_0x8b13('0x14')]===0x1f4){logger[_0x8b13('0x13')](_0x8b13('0xf'),_0x2ad730,_0x450618[_0x8b13('0x13')]['message']);return _0x2002b2(_0x450618[_0x8b13('0x13')][_0x8b13('0x15')]);}logger[_0x8b13('0x13')](_0x8b13('0xf'),_0x2ad730,_0x450618[_0x8b13('0x13')][_0x8b13('0x15')]);return _0x3a24cb(_0x450618[_0x8b13('0x13')][_0x8b13('0x15')]);}else{logger[_0x8b13('0xe')](_0x8b13('0xf'),_0x2ad730,_0x8b13('0x10'));_0x3a24cb(_0x450618[_0x8b13('0x16')][_0x8b13('0x15')]);}})['catch'](function(_0x1755f6){logger[_0x8b13('0x13')](_0x8b13('0xf'),_0x2ad730,_0x1755f6);_0x2002b2(_0x1755f6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 43bcb73..7ac9675 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 _0xfb19=['../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service'];(function(_0x16b1c8,_0x2f9bf9){var _0x397d87=function(_0x3f14ee){while(--_0x3f14ee){_0x16b1c8['push'](_0x16b1c8['shift']());}};_0x397d87(++_0x2f9bf9);}(_0xfb19,0x1e8));var _0x9fb1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfb19[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9fb1('0x0'));var util=require(_0x9fb1('0x1'));var path=require(_0x9fb1('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fb1('0x3'));var router=express[_0x9fb1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9fb1('0x5'));var interaction=require(_0x9fb1('0x6'));var config=require('../../config/environment');var controller=require(_0x9fb1('0x7'));router[_0x9fb1('0x8')]('/',auth[_0x9fb1('0x9')](),controller[_0x9fb1('0xa')]);router[_0x9fb1('0x8')](_0x9fb1('0xb'),auth[_0x9fb1('0x9')](),controller[_0x9fb1('0xc')]);router[_0x9fb1('0xd')]('/',auth['isAuthenticated'](),controller[_0x9fb1('0xe')]);router[_0x9fb1('0xf')]('/:id',auth[_0x9fb1('0x9')](),controller[_0x9fb1('0x10')]);router[_0x9fb1('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9fb1('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb1ec=['post','create','put','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0xb1ec,0x148));var _0xcb1e=function(_0x57c78b,_0x66c039){_0x57c78b=_0x57c78b-0x0;var _0x5edb6e=_0xb1ec[_0x57c78b];return _0x5edb6e;};'use strict';var multer=require(_0xcb1e('0x0'));var util=require(_0xcb1e('0x1'));var path=require(_0xcb1e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcb1e('0x3')]();var fs_extra=require(_0xcb1e('0x4'));var auth=require(_0xcb1e('0x5'));var interaction=require(_0xcb1e('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xcb1e('0x7')](),controller[_0xcb1e('0x8')]);router[_0xcb1e('0x9')](_0xcb1e('0xa'),auth[_0xcb1e('0x7')](),controller[_0xcb1e('0xb')]);router[_0xcb1e('0xc')]('/',auth['isAuthenticated'](),controller[_0xcb1e('0xd')]);router[_0xcb1e('0xe')](_0xcb1e('0xa'),auth[_0xcb1e('0x7')](),controller['update']);router[_0xcb1e('0xf')]('/:id',auth[_0xcb1e('0x7')](),controller['destroy']);module[_0xcb1e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 9431724..ea63bb3 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 _0x0c8c=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x305e40,_0x12c308){var _0x2dc3aa=function(_0x1c5e56){while(--_0x1c5e56){_0x305e40['push'](_0x305e40['shift']());}};_0x2dc3aa(++_0x12c308);}(_0x0c8c,0xd9));var _0xc0c8=function(_0x5e4464,_0x34668f){_0x5e4464=_0x5e4464-0x0;var _0x2b4178=_0x0c8c[_0x5e4464];return _0x2b4178;};'use strict';var Sequelize=require(_0xc0c8('0x0'));module[_0xc0c8('0x1')]={'type':{'type':Sequelize[_0xc0c8('0x2')](_0xc0c8('0x3'),_0xc0c8('0x4'),'customVariable',_0xc0c8('0x5'),_0xc0c8('0x6')),'defaultValue':_0xc0c8('0x3')},'content':{'type':Sequelize[_0xc0c8('0x7')]},'key':{'type':Sequelize[_0xc0c8('0x7')]},'keyType':{'type':Sequelize[_0xc0c8('0x2')](_0xc0c8('0x3'),'variable',_0xc0c8('0x8'))},'keyContent':{'type':Sequelize[_0xc0c8('0x7')]},'idField':{'type':Sequelize[_0xc0c8('0x7')]},'variableName':{'type':Sequelize[_0xc0c8('0x7')]}}; \ No newline at end of file +var _0xe514=['STRING','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x1bb653,_0x19a60e){var _0x5a110a=function(_0x38043f){while(--_0x38043f){_0x1bb653['push'](_0x1bb653['shift']());}};_0x5a110a(++_0x19a60e);}(_0xe514,0x189));var _0x4e51=function(_0x57cd1a,_0x535e99){_0x57cd1a=_0x57cd1a-0x0;var _0x10e5db=_0xe514[_0x57cd1a];return _0x10e5db;};'use strict';var Sequelize=require('sequelize');module[_0x4e51('0x0')]={'type':{'type':Sequelize[_0x4e51('0x1')](_0x4e51('0x2'),_0x4e51('0x3'),_0x4e51('0x4'),_0x4e51('0x5'),_0x4e51('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4e51('0x7')]},'key':{'type':Sequelize[_0x4e51('0x7')]},'keyType':{'type':Sequelize[_0x4e51('0x1')](_0x4e51('0x2'),'variable',_0x4e51('0x4'))},'keyContent':{'type':Sequelize[_0x4e51('0x7')]},'idField':{'type':Sequelize[_0x4e51('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 2c23964..9309b5f 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 _0xf82b=['rawAttributes','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','error','stack','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','SalesforceField','includeAll','findAll','rows','catch','show','params'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xf82b,0x98));var _0xbf82=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf82b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf82('0x0'));var zipdir=require(_0xbf82('0x1'));var jsonpatch=require(_0xbf82('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf82('0x3'));var util=require(_0xbf82('0x4'));var path=require(_0xbf82('0x5'));var sox=require(_0xbf82('0x6'));var csv=require(_0xbf82('0x7'));var ejs=require(_0xbf82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf82('0x9'));var squel=require(_0xbf82('0xa'));var crypto=require('crypto');var jsforce=require(_0xbf82('0xb'));var deskjs=require(_0xbf82('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbf82('0xd'));var Papa=require(_0xbf82('0xe'));var Redis=require(_0xbf82('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbf82('0x10'));var as=require(_0xbf82('0x11'));var hardwareService=require(_0xbf82('0x12'));var logger=require(_0xbf82('0x13'))(_0xbf82('0x14'));var utils=require(_0xbf82('0x15'));var config=require(_0xbf82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf82('0x17'))['db'];function respondWithStatusCode(_0x691652,_0xa73212){_0xa73212=_0xa73212||0xcc;return function(_0x45e36a){if(_0x45e36a){return _0x691652[_0xbf82('0x18')](_0xa73212);}return _0x691652[_0xbf82('0x19')](_0xa73212)[_0xbf82('0x1a')]();};}function respondWithResult(_0x1ad76b,_0xa4f13d){_0xa4f13d=_0xa4f13d||0xc8;return function(_0x415650){if(_0x415650){return _0x1ad76b['status'](_0xa4f13d)[_0xbf82('0x1b')](_0x415650);}};}function respondWithFilteredResult(_0xbc6b50,_0x50040c){return function(_0x381a85){if(_0x381a85){var _0x3b57ef=typeof _0x50040c[_0xbf82('0x1c')]===_0xbf82('0x1d')&&typeof _0x50040c[_0xbf82('0x1e')]==='undefined';var _0x25cafd=_0x381a85['count'];var _0x370000=_0x3b57ef?0x0:_0x50040c['offset'];var _0x2d471e=_0x3b57ef?_0x381a85[_0xbf82('0x1f')]:_0x50040c['offset']+_0x50040c[_0xbf82('0x1e')];var _0x2bb759;if(_0x2d471e>=_0x25cafd){_0x2d471e=_0x25cafd;_0x2bb759=0xc8;}else{_0x2bb759=0xce;}_0xbc6b50['status'](_0x2bb759);return _0xbc6b50['set']('Content-Range',_0x370000+'-'+_0x2d471e+'/'+_0x25cafd)[_0xbf82('0x1b')](_0x381a85);}return null;};}function patchUpdates(_0x1f71a9){return function(_0x583a52){try{jsonpatch[_0xbf82('0x20')](_0x583a52,_0x1f71a9,!![]);}catch(_0xe36890){return BPromise[_0xbf82('0x21')](_0xe36890);}return _0x583a52[_0xbf82('0x22')]();};}function saveUpdates(_0x3fb331,_0x380379){return function(_0x1766bf){if(_0x1766bf){return _0x1766bf['update'](_0x3fb331)['then'](function(_0x316ca2){return _0x316ca2;});}return null;};}function removeEntity(_0x378776,_0x4d6179){return function(_0xf5b08f){if(_0xf5b08f){return _0xf5b08f['destroy']()[_0xbf82('0x23')](function(){_0x378776[_0xbf82('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6375,_0x15c9f5){return function(_0x4051ce){if(!_0x4051ce){_0x2d6375[_0xbf82('0x18')](0x194);}return _0x4051ce;};}function handleError(_0x349f4d,_0x393867){_0x393867=_0x393867||0x1f4;return function(_0x14539b){logger[_0xbf82('0x24')](_0x14539b[_0xbf82('0x25')]);if(_0x14539b['name']){delete _0x14539b['name'];}_0x349f4d[_0xbf82('0x19')](_0x393867)['send'](_0x14539b);};}exports[_0xbf82('0x26')]=function(_0x48c093,_0x16c09c){var _0x4189a8={},_0x2181ee={},_0x422a67={'count':0x0,'rows':[]};var _0x3ff3fe=_[_0xbf82('0x27')](db['SalesforceField']['rawAttributes'],function(_0x252fa1){return{'name':_0x252fa1[_0xbf82('0x28')],'type':_0x252fa1[_0xbf82('0x29')][_0xbf82('0x2a')]};});_0x2181ee[_0xbf82('0x2b')]=_['map'](_0x3ff3fe,_0xbf82('0x2c'));_0x2181ee[_0xbf82('0x2d')]=_[_0xbf82('0x2e')](_0x48c093[_0xbf82('0x2d')]);_0x2181ee[_0xbf82('0x2f')]=_[_0xbf82('0x30')](_0x2181ee[_0xbf82('0x2b')],_0x2181ee[_0xbf82('0x2d')]);_0x4189a8[_0xbf82('0x31')]=_['intersection'](_0x2181ee['model'],qs[_0xbf82('0x32')](_0x48c093['query'][_0xbf82('0x32')]));_0x4189a8['attributes']=_0x4189a8[_0xbf82('0x31')][_0xbf82('0x33')]?_0x4189a8[_0xbf82('0x31')]:_0x2181ee[_0xbf82('0x2b')];if(!_0x48c093[_0xbf82('0x2d')][_0xbf82('0x34')]('nolimit')){_0x4189a8[_0xbf82('0x1e')]=qs[_0xbf82('0x1e')](_0x48c093[_0xbf82('0x2d')]['limit']);_0x4189a8[_0xbf82('0x1c')]=qs[_0xbf82('0x1c')](_0x48c093[_0xbf82('0x2d')][_0xbf82('0x1c')]);}_0x4189a8[_0xbf82('0x35')]=qs[_0xbf82('0x36')](_0x48c093[_0xbf82('0x2d')][_0xbf82('0x36')]);_0x4189a8[_0xbf82('0x37')]=qs[_0xbf82('0x2f')](_[_0xbf82('0x38')](_0x48c093[_0xbf82('0x2d')],_0x2181ee['filters']),_0x3ff3fe);if(_0x48c093[_0xbf82('0x2d')][_0xbf82('0x39')]){_0x4189a8[_0xbf82('0x37')]=_[_0xbf82('0x3a')](_0x4189a8[_0xbf82('0x37')],{'$or':_['map'](_0x3ff3fe,function(_0x48f5f7){if(_0x48f5f7[_0xbf82('0x29')]!=='VIRTUAL'){var _0x2c6975={};_0x2c6975[_0x48f5f7[_0xbf82('0x2c')]]={'$like':'%'+_0x48c093[_0xbf82('0x2d')][_0xbf82('0x39')]+'%'};return _0x2c6975;}})});}_0x4189a8=_[_0xbf82('0x3a')]({},_0x4189a8,_0x48c093[_0xbf82('0x3b')]);var _0x289f9f={'where':_0x4189a8['where']};return db[_0xbf82('0x3c')][_0xbf82('0x1f')](_0x289f9f)[_0xbf82('0x23')](function(_0x57b228){_0x422a67[_0xbf82('0x1f')]=_0x57b228;if(_0x48c093[_0xbf82('0x2d')][_0xbf82('0x3d')]){_0x4189a8['include']=[{'all':!![]}];}return db[_0xbf82('0x3c')][_0xbf82('0x3e')](_0x4189a8);})[_0xbf82('0x23')](function(_0x235d76){_0x422a67[_0xbf82('0x3f')]=_0x235d76;return _0x422a67;})['then'](respondWithFilteredResult(_0x16c09c,_0x4189a8))[_0xbf82('0x40')](handleError(_0x16c09c,null));};exports[_0xbf82('0x41')]=function(_0x395747,_0xf46220){var _0x5481dd={'raw':!![],'where':{'id':_0x395747[_0xbf82('0x42')]['id']}},_0x317062={};_0x317062[_0xbf82('0x2b')]=_['keys'](db[_0xbf82('0x3c')][_0xbf82('0x43')]);_0x317062[_0xbf82('0x2d')]=_['keys'](_0x395747[_0xbf82('0x2d')]);_0x317062[_0xbf82('0x2f')]=_[_0xbf82('0x30')](_0x317062['model'],_0x317062[_0xbf82('0x2d')]);_0x5481dd['attributes']=_[_0xbf82('0x30')](_0x317062['model'],qs[_0xbf82('0x32')](_0x395747[_0xbf82('0x2d')][_0xbf82('0x32')]));_0x5481dd[_0xbf82('0x31')]=_0x5481dd[_0xbf82('0x31')]['length']?_0x5481dd[_0xbf82('0x31')]:_0x317062[_0xbf82('0x2b')];if(_0x395747[_0xbf82('0x2d')]['includeAll']){_0x5481dd[_0xbf82('0x44')]=[{'all':!![]}];}_0x5481dd=_[_0xbf82('0x3a')]({},_0x5481dd,_0x395747[_0xbf82('0x3b')]);return db[_0xbf82('0x3c')][_0xbf82('0x45')](_0x5481dd)[_0xbf82('0x23')](handleEntityNotFound(_0xf46220,null))[_0xbf82('0x23')](respondWithResult(_0xf46220,null))[_0xbf82('0x40')](handleError(_0xf46220,null));};exports[_0xbf82('0x46')]=function(_0x3d20e7,_0x447b52){return db[_0xbf82('0x3c')][_0xbf82('0x46')](_0x3d20e7[_0xbf82('0x47')],{})[_0xbf82('0x23')](respondWithResult(_0x447b52,0xc9))[_0xbf82('0x40')](handleError(_0x447b52,null));};exports[_0xbf82('0x48')]=function(_0xc2f049,_0xdad4f0){if(_0xc2f049['body']['id']){delete _0xc2f049['body']['id'];}return db['SalesforceField'][_0xbf82('0x45')]({'where':{'id':_0xc2f049[_0xbf82('0x42')]['id']}})[_0xbf82('0x23')](handleEntityNotFound(_0xdad4f0,null))[_0xbf82('0x23')](saveUpdates(_0xc2f049[_0xbf82('0x47')],null))['then'](respondWithResult(_0xdad4f0,null))[_0xbf82('0x40')](handleError(_0xdad4f0,null));};exports['destroy']=function(_0x3c46f5,_0x20c934){return db['SalesforceField'][_0xbf82('0x45')]({'where':{'id':_0x3c46f5['params']['id']}})[_0xbf82('0x23')](handleEntityNotFound(_0x20c934,null))['then'](removeEntity(_0x20c934,null))[_0xbf82('0x40')](handleError(_0x20c934,null));}; \ No newline at end of file +var _0xe2d4=['ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0xe2d4,0x1b9));var _0x4e2d=function(_0x23cb64,_0x1360f8){_0x23cb64=_0x23cb64-0x0;var _0x122d12=_0xe2d4[_0x23cb64];return _0x122d12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e2d('0x0'));var zipdir=require(_0x4e2d('0x1'));var jsonpatch=require(_0x4e2d('0x2'));var rp=require(_0x4e2d('0x3'));var moment=require('moment');var BPromise=require(_0x4e2d('0x4'));var Mustache=require(_0x4e2d('0x5'));var util=require(_0x4e2d('0x6'));var path=require(_0x4e2d('0x7'));var sox=require('sox');var csv=require(_0x4e2d('0x8'));var ejs=require(_0x4e2d('0x9'));var fs=require('fs');var fs_extra=require(_0x4e2d('0xa'));var _=require(_0x4e2d('0xb'));var squel=require(_0x4e2d('0xc'));var crypto=require('crypto');var jsforce=require(_0x4e2d('0xd'));var deskjs=require(_0x4e2d('0xe'));var toCsv=require(_0x4e2d('0x8'));var querystring=require('querystring');var Papa=require(_0x4e2d('0xf'));var Redis=require('ioredis');var authService=require(_0x4e2d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4e2d('0x11'));var hardwareService=require(_0x4e2d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x4e2d('0x13'));var config=require(_0x4e2d('0x14'));var licenseUtil=require(_0x4e2d('0x15'));var db=require(_0x4e2d('0x16'))['db'];function respondWithStatusCode(_0x2775a5,_0x71ed32){_0x71ed32=_0x71ed32||0xcc;return function(_0x5f49b6){if(_0x5f49b6){return _0x2775a5[_0x4e2d('0x17')](_0x71ed32);}return _0x2775a5[_0x4e2d('0x18')](_0x71ed32)['end']();};}function respondWithResult(_0x507afa,_0xd84f83){_0xd84f83=_0xd84f83||0xc8;return function(_0x35e95d){if(_0x35e95d){return _0x507afa[_0x4e2d('0x18')](_0xd84f83)['json'](_0x35e95d);}};}function respondWithFilteredResult(_0x207b38,_0x5e8293){return function(_0x3e1e81){if(_0x3e1e81){var _0x1cbe7c=typeof _0x5e8293['offset']===_0x4e2d('0x19')&&typeof _0x5e8293[_0x4e2d('0x1a')]===_0x4e2d('0x19');var _0x779bbe=_0x3e1e81[_0x4e2d('0x1b')];var _0x27fbf7=_0x1cbe7c?0x0:_0x5e8293[_0x4e2d('0x1c')];var _0x2e0611=_0x1cbe7c?_0x3e1e81['count']:_0x5e8293[_0x4e2d('0x1c')]+_0x5e8293[_0x4e2d('0x1a')];var _0xa8306f;if(_0x2e0611>=_0x779bbe){_0x2e0611=_0x779bbe;_0xa8306f=0xc8;}else{_0xa8306f=0xce;}_0x207b38['status'](_0xa8306f);return _0x207b38[_0x4e2d('0x1d')](_0x4e2d('0x1e'),_0x27fbf7+'-'+_0x2e0611+'/'+_0x779bbe)[_0x4e2d('0x1f')](_0x3e1e81);}return null;};}function patchUpdates(_0x276428){return function(_0x3c0a82){try{jsonpatch[_0x4e2d('0x20')](_0x3c0a82,_0x276428,!![]);}catch(_0xa4ff9a){return BPromise[_0x4e2d('0x21')](_0xa4ff9a);}return _0x3c0a82[_0x4e2d('0x22')]();};}function saveUpdates(_0x44115b,_0x206ca2){return function(_0x5d8caf){if(_0x5d8caf){return _0x5d8caf[_0x4e2d('0x23')](_0x44115b)[_0x4e2d('0x24')](function(_0x2a034c){return _0x2a034c;});}return null;};}function removeEntity(_0xba3ccc,_0x569e52){return function(_0x580508){if(_0x580508){return _0x580508['destroy']()[_0x4e2d('0x24')](function(){_0xba3ccc[_0x4e2d('0x18')](0xcc)[_0x4e2d('0x25')]();});}};}function handleEntityNotFound(_0x56100e,_0x395e67){return function(_0x313635){if(!_0x313635){_0x56100e[_0x4e2d('0x17')](0x194);}return _0x313635;};}function handleError(_0x2f71b7,_0x323df5){_0x323df5=_0x323df5||0x1f4;return function(_0x474975){logger[_0x4e2d('0x26')](_0x474975['stack']);if(_0x474975[_0x4e2d('0x27')]){delete _0x474975[_0x4e2d('0x27')];}_0x2f71b7['status'](_0x323df5)[_0x4e2d('0x28')](_0x474975);};}exports['index']=function(_0x5e814d,_0x2c54e5){var _0x2204e3={},_0x26df95={},_0x328339={'count':0x0,'rows':[]};var _0x29da6e=_[_0x4e2d('0x29')](db[_0x4e2d('0x2a')]['rawAttributes'],function(_0x2ea376){return{'name':_0x2ea376[_0x4e2d('0x2b')],'type':_0x2ea376[_0x4e2d('0x2c')][_0x4e2d('0x2d')]};});_0x26df95[_0x4e2d('0x2e')]=_[_0x4e2d('0x29')](_0x29da6e,_0x4e2d('0x27'));_0x26df95[_0x4e2d('0x2f')]=_[_0x4e2d('0x30')](_0x5e814d[_0x4e2d('0x2f')]);_0x26df95[_0x4e2d('0x31')]=_[_0x4e2d('0x32')](_0x26df95[_0x4e2d('0x2e')],_0x26df95['query']);_0x2204e3[_0x4e2d('0x33')]=_[_0x4e2d('0x32')](_0x26df95[_0x4e2d('0x2e')],qs['fields'](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x34')]));_0x2204e3[_0x4e2d('0x33')]=_0x2204e3[_0x4e2d('0x33')][_0x4e2d('0x35')]?_0x2204e3[_0x4e2d('0x33')]:_0x26df95[_0x4e2d('0x2e')];if(!_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x36')](_0x4e2d('0x37'))){_0x2204e3[_0x4e2d('0x1a')]=qs[_0x4e2d('0x1a')](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x1a')]);_0x2204e3[_0x4e2d('0x1c')]=qs[_0x4e2d('0x1c')](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x1c')]);}_0x2204e3[_0x4e2d('0x38')]=qs['sort'](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x39')]);_0x2204e3['where']=qs[_0x4e2d('0x31')](_[_0x4e2d('0x3a')](_0x5e814d[_0x4e2d('0x2f')],_0x26df95[_0x4e2d('0x31')]),_0x29da6e);if(_0x5e814d[_0x4e2d('0x2f')]['filter']){_0x2204e3[_0x4e2d('0x3b')]=_['merge'](_0x2204e3[_0x4e2d('0x3b')],{'$or':_['map'](_0x29da6e,function(_0xe901b4){if(_0xe901b4[_0x4e2d('0x2c')]!==_0x4e2d('0x3c')){var _0x162365={};_0x162365[_0xe901b4['name']]={'$like':'%'+_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x3d')]+'%'};return _0x162365;}})});}_0x2204e3=_[_0x4e2d('0x3e')]({},_0x2204e3,_0x5e814d[_0x4e2d('0x3f')]);var _0x11003c={'where':_0x2204e3[_0x4e2d('0x3b')]};return db[_0x4e2d('0x2a')]['count'](_0x11003c)[_0x4e2d('0x24')](function(_0x4a1b9e){_0x328339['count']=_0x4a1b9e;if(_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x40')]){_0x2204e3[_0x4e2d('0x41')]=[{'all':!![]}];}return db[_0x4e2d('0x2a')][_0x4e2d('0x42')](_0x2204e3);})[_0x4e2d('0x24')](function(_0x588c9d){_0x328339[_0x4e2d('0x43')]=_0x588c9d;return _0x328339;})[_0x4e2d('0x24')](respondWithFilteredResult(_0x2c54e5,_0x2204e3))[_0x4e2d('0x44')](handleError(_0x2c54e5,null));};exports['show']=function(_0x816dd2,_0x2dd5a0){var _0x5d4c1f={'raw':!![],'where':{'id':_0x816dd2[_0x4e2d('0x45')]['id']}},_0x33ba35={};_0x33ba35['model']=_[_0x4e2d('0x30')](db['SalesforceField'][_0x4e2d('0x46')]);_0x33ba35[_0x4e2d('0x2f')]=_['keys'](_0x816dd2[_0x4e2d('0x2f')]);_0x33ba35[_0x4e2d('0x31')]=_[_0x4e2d('0x32')](_0x33ba35[_0x4e2d('0x2e')],_0x33ba35[_0x4e2d('0x2f')]);_0x5d4c1f[_0x4e2d('0x33')]=_[_0x4e2d('0x32')](_0x33ba35['model'],qs[_0x4e2d('0x34')](_0x816dd2[_0x4e2d('0x2f')][_0x4e2d('0x34')]));_0x5d4c1f[_0x4e2d('0x33')]=_0x5d4c1f[_0x4e2d('0x33')][_0x4e2d('0x35')]?_0x5d4c1f[_0x4e2d('0x33')]:_0x33ba35[_0x4e2d('0x2e')];if(_0x816dd2[_0x4e2d('0x2f')][_0x4e2d('0x40')]){_0x5d4c1f[_0x4e2d('0x41')]=[{'all':!![]}];}_0x5d4c1f=_[_0x4e2d('0x3e')]({},_0x5d4c1f,_0x816dd2['options']);return db[_0x4e2d('0x2a')][_0x4e2d('0x47')](_0x5d4c1f)['then'](handleEntityNotFound(_0x2dd5a0,null))[_0x4e2d('0x24')](respondWithResult(_0x2dd5a0,null))[_0x4e2d('0x44')](handleError(_0x2dd5a0,null));};exports[_0x4e2d('0x48')]=function(_0x4d365c,_0x5b6522){return db['SalesforceField'][_0x4e2d('0x48')](_0x4d365c[_0x4e2d('0x49')],{})[_0x4e2d('0x24')](respondWithResult(_0x5b6522,0xc9))[_0x4e2d('0x44')](handleError(_0x5b6522,null));};exports[_0x4e2d('0x23')]=function(_0x5d54af,_0x27cba3){if(_0x5d54af[_0x4e2d('0x49')]['id']){delete _0x5d54af['body']['id'];}return db[_0x4e2d('0x2a')][_0x4e2d('0x47')]({'where':{'id':_0x5d54af[_0x4e2d('0x45')]['id']}})[_0x4e2d('0x24')](handleEntityNotFound(_0x27cba3,null))[_0x4e2d('0x24')](saveUpdates(_0x5d54af[_0x4e2d('0x49')],null))[_0x4e2d('0x24')](respondWithResult(_0x27cba3,null))[_0x4e2d('0x44')](handleError(_0x27cba3,null));};exports[_0x4e2d('0x4a')]=function(_0x1d5b6f,_0x29fe8c){return db[_0x4e2d('0x2a')]['find']({'where':{'id':_0x1d5b6f[_0x4e2d('0x45')]['id']}})[_0x4e2d('0x24')](handleEntityNotFound(_0x29fe8c,null))[_0x4e2d('0x24')](removeEntity(_0x29fe8c,null))['catch'](handleError(_0x29fe8c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 7009cff..825d23f 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 _0x18b0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','SalesforceField','lodash','util','api'];(function(_0x1bef54,_0x5d3f1c){var _0x27037f=function(_0x9701dd){while(--_0x9701dd){_0x1bef54['push'](_0x1bef54['shift']());}};_0x27037f(++_0x5d3f1c);}(_0x18b0,0x151));var _0x018b=function(_0x5b1460,_0x2a146c){_0x5b1460=_0x5b1460-0x0;var _0xa1b7b2=_0x18b0[_0x5b1460];return _0xa1b7b2;};'use strict';var _=require(_0x018b('0x0'));var util=require(_0x018b('0x1'));var logger=require('../../config/logger')(_0x018b('0x2'));var moment=require(_0x018b('0x3'));var BPromise=require(_0x018b('0x4'));var rp=require(_0x018b('0x5'));var fs=require('fs');var path=require(_0x018b('0x6'));var rimraf=require(_0x018b('0x7'));var config=require(_0x018b('0x8'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x380430,_0x416524){return _0x380430['define'](_0x018b('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf92=['request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment'];(function(_0x2d2ca7,_0x205ac1){var _0x1ad59d=function(_0x168a38){while(--_0x168a38){_0x2d2ca7['push'](_0x2d2ca7['shift']());}};_0x1ad59d(++_0x205ac1);}(_0xaf92,0x177));var _0x2af9=function(_0x580831,_0x2e293d){_0x580831=_0x580831-0x0;var _0x14c21a=_0xaf92[_0x580831];return _0x14c21a;};'use strict';var _=require(_0x2af9('0x0'));var util=require(_0x2af9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2af9('0x2'));var BPromise=require('bluebird');var rp=require(_0x2af9('0x3'));var fs=require('fs');var path=require(_0x2af9('0x4'));var rimraf=require(_0x2af9('0x5'));var config=require(_0x2af9('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x2af9('0x7')]=function(_0x5c3108,_0x188cb7){return _0x5c3108[_0x2af9('0x8')](_0x2af9('0x9'),attributes,{'tableName':_0x2af9('0xa'),'paranoid':![],'indexes':[{'name':_0x2af9('0xb'),'fields':[_0x2af9('0xc'),_0x2af9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index f4dca29..0df7a3e 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 _0xad48=['ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x21abe1,_0x33de53){var _0x59c808=function(_0x502916){while(--_0x502916){_0x21abe1['push'](_0x21abe1['shift']());}};_0x59c808(++_0x33de53);}(_0xad48,0x177));var _0x8ad4=function(_0x2bda10,_0x36b96b){_0x2bda10=_0x2bda10-0x0;var _0x36541f=_0xad48[_0x2bda10];return _0x36541f;};'use strict';var _=require(_0x8ad4('0x0'));var util=require('util');var moment=require(_0x8ad4('0x1'));var BPromise=require('bluebird');var rs=require(_0x8ad4('0x2'));var fs=require('fs');var Redis=require(_0x8ad4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ad4('0x4'));var logger=require('../../config/logger')(_0x8ad4('0x5'));var config=require(_0x8ad4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8ad4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x438ebc,_0xb16768,_0x396ce4){return new BPromise(function(_0x296d26,_0x499716){return client[_0x8ad4('0x8')](_0x438ebc,_0x396ce4)[_0x8ad4('0x9')](function(_0x4d94c3){logger[_0x8ad4('0xa')](_0x8ad4('0xb'),_0xb16768,_0x8ad4('0xc'));logger[_0x8ad4('0xd')](_0x8ad4('0xe'),_0xb16768,'request\x20sent',JSON[_0x8ad4('0xf')](_0x4d94c3));if(_0x4d94c3[_0x8ad4('0x10')]){if(_0x4d94c3[_0x8ad4('0x10')][_0x8ad4('0x11')]===0x1f4){logger[_0x8ad4('0x10')](_0x8ad4('0xb'),_0xb16768,_0x4d94c3[_0x8ad4('0x10')][_0x8ad4('0x12')]);return _0x499716(_0x4d94c3[_0x8ad4('0x10')][_0x8ad4('0x12')]);}logger['error'](_0x8ad4('0xb'),_0xb16768,_0x4d94c3[_0x8ad4('0x10')]['message']);return _0x296d26(_0x4d94c3[_0x8ad4('0x10')]['message']);}else{logger['info'](_0x8ad4('0xb'),_0xb16768,_0x8ad4('0xc'));_0x296d26(_0x4d94c3[_0x8ad4('0x13')][_0x8ad4('0x12')]);}})[_0x8ad4('0x14')](function(_0xdbdefc){logger[_0x8ad4('0x10')](_0x8ad4('0xb'),_0xb16768,_0xdbdefc);_0x499716(_0xdbdefc);});});} \ No newline at end of file +var _0x3093=['../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x3093,0x83));var _0x3309=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x3093[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x3309('0x0'));var util=require('util');var moment=require(_0x3309('0x1'));var BPromise=require(_0x3309('0x2'));var rs=require(_0x3309('0x3'));var fs=require('fs');var Redis=require(_0x3309('0x4'));var db=require(_0x3309('0x5'))['db'];var utils=require(_0x3309('0x6'));var logger=require(_0x3309('0x7'))(_0x3309('0x8'));var config=require('../../config/environment');var jayson=require(_0x3309('0x9'));var client=jayson[_0x3309('0xa')][_0x3309('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d5d34,_0x1ed25c,_0x476c99){return new BPromise(function(_0x4e8099,_0x44a446){return client['request'](_0x5d5d34,_0x476c99)[_0x3309('0xc')](function(_0x57ba01){logger[_0x3309('0xd')](_0x3309('0xe'),_0x1ed25c,'request\x20sent');logger[_0x3309('0xf')](_0x3309('0x10'),_0x1ed25c,'request\x20sent',JSON[_0x3309('0x11')](_0x57ba01));if(_0x57ba01[_0x3309('0x12')]){if(_0x57ba01[_0x3309('0x12')][_0x3309('0x13')]===0x1f4){logger['error'](_0x3309('0xe'),_0x1ed25c,_0x57ba01[_0x3309('0x12')][_0x3309('0x14')]);return _0x44a446(_0x57ba01['error'][_0x3309('0x14')]);}logger[_0x3309('0x12')](_0x3309('0xe'),_0x1ed25c,_0x57ba01[_0x3309('0x12')][_0x3309('0x14')]);return _0x4e8099(_0x57ba01[_0x3309('0x12')][_0x3309('0x14')]);}else{logger[_0x3309('0xd')]('SalesforceField,\x20%s,\x20%s',_0x1ed25c,'request\x20sent');_0x4e8099(_0x57ba01[_0x3309('0x15')][_0x3309('0x14')]);}})[_0x3309('0x16')](function(_0x2e8d66){logger[_0x3309('0x12')](_0x3309('0xe'),_0x1ed25c,_0x2e8d66);_0x44a446(_0x2e8d66);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 98fab2d..f395a33 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 _0x49c9=['/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x29cd52,_0x88b52b){var _0x5218bc=function(_0x455b4f){while(--_0x455b4f){_0x29cd52['push'](_0x29cd52['shift']());}};_0x5218bc(++_0x88b52b);}(_0x49c9,0x164));var _0x949c=function(_0xf4c5d0,_0x2d3223){_0xf4c5d0=_0xf4c5d0-0x0;var _0x2a4390=_0x49c9[_0xf4c5d0];return _0x2a4390;};'use strict';var multer=require(_0x949c('0x0'));var util=require(_0x949c('0x1'));var path=require('path');var timeout=require(_0x949c('0x2'));var express=require(_0x949c('0x3'));var router=express[_0x949c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x949c('0x5'));var config=require('../../config/environment');var controller=require(_0x949c('0x6'));router['get']('/',auth[_0x949c('0x7')](),controller['index']);router[_0x949c('0x8')]('/:id',auth[_0x949c('0x7')](),controller[_0x949c('0x9')]);router['get'](_0x949c('0xa'),auth[_0x949c('0x7')](),controller[_0x949c('0xb')]);router[_0x949c('0x8')](_0x949c('0xc'),auth[_0x949c('0x7')](),controller[_0x949c('0xd')]);router[_0x949c('0xe')]('/',auth['isAuthenticated'](),controller[_0x949c('0xf')]);router[_0x949c('0xe')](_0x949c('0xa'),auth[_0x949c('0x7')](),controller[_0x949c('0x10')]);router[_0x949c('0x11')](_0x949c('0x12'),auth['isAuthenticated'](),controller[_0x949c('0x13')]);router['delete']('/:id',auth[_0x949c('0x7')](),controller[_0x949c('0x14')]);module[_0x949c('0x15')]=router; \ No newline at end of file +var _0x106b=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy'];(function(_0x44a38e,_0x1aa124){var _0x5ec328=function(_0x2cbd53){while(--_0x2cbd53){_0x44a38e['push'](_0x44a38e['shift']());}};_0x5ec328(++_0x1aa124);}(_0x106b,0xa2));var _0xb106=function(_0x53199f,_0x1dac3a){_0x53199f=_0x53199f-0x0;var _0x1f9609=_0x106b[_0x53199f];return _0x1f9609;};'use strict';var multer=require(_0xb106('0x0'));var util=require(_0xb106('0x1'));var path=require(_0xb106('0x2'));var timeout=require(_0xb106('0x3'));var express=require(_0xb106('0x4'));var router=express[_0xb106('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb106('0x6'));var interaction=require(_0xb106('0x7'));var config=require(_0xb106('0x8'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xb106('0x9')](),controller['index']);router[_0xb106('0xa')](_0xb106('0xb'),auth[_0xb106('0x9')](),controller[_0xb106('0xc')]);router[_0xb106('0xa')](_0xb106('0xd'),auth['isAuthenticated'](),controller[_0xb106('0xe')]);router[_0xb106('0xa')](_0xb106('0xf'),auth[_0xb106('0x9')](),controller[_0xb106('0x10')]);router[_0xb106('0x11')]('/',auth[_0xb106('0x9')](),controller['create']);router[_0xb106('0x11')](_0xb106('0xd'),auth[_0xb106('0x9')](),controller[_0xb106('0x12')]);router[_0xb106('0x13')](_0xb106('0xb'),auth[_0xb106('0x9')](),controller['update']);router[_0xb106('0x14')]('/:id',auth[_0xb106('0x9')](),controller[_0xb106('0x15')]);module[_0xb106('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 627717f..65c7f11 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 _0xd66f=['exports','STRING','remoteUri','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd66f,0x11b));var _0xfd66=function(_0xa142ba,_0x18a88e){_0xa142ba=_0xa142ba-0x0;var _0x5c2c30=_0xd66f[_0xa142ba];return _0x5c2c30;};'use strict';var Sequelize=require(_0xfd66('0x0'));module[_0xfd66('0x1')]={'name':{'type':Sequelize[_0xfd66('0x2')]},'description':{'type':Sequelize[_0xfd66('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xfd66('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfd66('0x2')],'unique':_0xfd66('0x3')},'serverUrl':{'type':Sequelize[_0xfd66('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x39a2=['STRING','username','remoteUri','exports'];(function(_0x10bfb9,_0x4adc36){var _0x244678=function(_0x5bcfe0){while(--_0x5bcfe0){_0x10bfb9['push'](_0x10bfb9['shift']());}};_0x244678(++_0x4adc36);}(_0x39a2,0xc3));var _0x239a=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0x39a2[_0x4a9fb7];return _0x40b90e;};'use strict';var Sequelize=require('sequelize');module[_0x239a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x239a('0x1')]},'username':{'type':Sequelize[_0x239a('0x1')],'unique':_0x239a('0x2')},'password':{'type':Sequelize[_0x239a('0x1')]},'email':{'type':Sequelize[_0x239a('0x1')]},'remoteUri':{'type':Sequelize[_0x239a('0x1')],'unique':_0x239a('0x3')},'serverUrl':{'type':Sequelize[_0x239a('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 22e1c6d..740ce60 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 _0xae16=['crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','severity','category','parent','watch_list','upon_reject','approval_history','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','reopen_count','escalation','upon_approval','location','username','password','email','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','forEach','label','assign','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel'];(function(_0x57594a,_0x10e304){var _0xc9887f=function(_0xda4760){while(--_0xda4760){_0x57594a['push'](_0x57594a['shift']());}};_0xc9887f(++_0x10e304);}(_0xae16,0x164));var _0x6ae1=function(_0x552d14,_0x1ce887){_0x552d14=_0x552d14-0x0;var _0x2972ee=_0xae16[_0x552d14];return _0x2972ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ae1('0x0'));var zipdir=require(_0x6ae1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ae1('0x2'));var moment=require('moment');var BPromise=require(_0x6ae1('0x3'));var Mustache=require(_0x6ae1('0x4'));var util=require('util');var path=require(_0x6ae1('0x5'));var sox=require(_0x6ae1('0x6'));var csv=require('to-csv');var ejs=require(_0x6ae1('0x7'));var fs=require('fs');var fs_extra=require(_0x6ae1('0x8'));var _=require('lodash');var squel=require(_0x6ae1('0x9'));var crypto=require(_0x6ae1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6ae1('0xb'));var toCsv=require(_0x6ae1('0xc'));var querystring=require(_0x6ae1('0xd'));var Papa=require(_0x6ae1('0xe'));var Redis=require('ioredis');var authService=require(_0x6ae1('0xf'));var qs=require(_0x6ae1('0x10'));var as=require(_0x6ae1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6ae1('0x12'));var licenseUtil=require(_0x6ae1('0x13'));var db=require(_0x6ae1('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeaec63,_0x383397){_0x383397=_0x383397||0xcc;return function(_0x365b1d){if(_0x365b1d){return _0xeaec63['sendStatus'](_0x383397);}return _0xeaec63['status'](_0x383397)[_0x6ae1('0x15')]();};}function respondWithResult(_0x4eb6d0,_0x37751a){_0x37751a=_0x37751a||0xc8;return function(_0x354145){if(_0x354145){return _0x4eb6d0[_0x6ae1('0x16')](_0x37751a)[_0x6ae1('0x17')](_0x354145);}};}function respondWithFilteredResult(_0xb46cd9,_0x187802){return function(_0x318dc5){if(_0x318dc5){var _0x8feb3c=typeof _0x187802['offset']===_0x6ae1('0x18')&&typeof _0x187802['limit']==='undefined';var _0x416d9a=_0x318dc5[_0x6ae1('0x19')];var _0x3313a4=_0x8feb3c?0x0:_0x187802[_0x6ae1('0x1a')];var _0x4c61b4=_0x8feb3c?_0x318dc5['count']:_0x187802['offset']+_0x187802[_0x6ae1('0x1b')];var _0x4fb930;if(_0x4c61b4>=_0x416d9a){_0x4c61b4=_0x416d9a;_0x4fb930=0xc8;}else{_0x4fb930=0xce;}_0xb46cd9[_0x6ae1('0x16')](_0x4fb930);return _0xb46cd9[_0x6ae1('0x1c')]('Content-Range',_0x3313a4+'-'+_0x4c61b4+'/'+_0x416d9a)[_0x6ae1('0x17')](_0x318dc5);}return null;};}function patchUpdates(_0x2e5de0){return function(_0x59fb32){try{jsonpatch[_0x6ae1('0x1d')](_0x59fb32,_0x2e5de0,!![]);}catch(_0x524980){return BPromise[_0x6ae1('0x1e')](_0x524980);}return _0x59fb32[_0x6ae1('0x1f')]();};}function saveUpdates(_0x528f89,_0x1db5d2){return function(_0x4d7d62){if(_0x4d7d62){return _0x4d7d62[_0x6ae1('0x20')](_0x528f89)[_0x6ae1('0x21')](function(_0xca5000){return _0xca5000;});}return null;};}function removeEntity(_0x16d90a,_0x277af6){return function(_0x4b5128){if(_0x4b5128){return _0x4b5128[_0x6ae1('0x22')]()[_0x6ae1('0x21')](function(){_0x16d90a[_0x6ae1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319bb7,_0x1d19e7){return function(_0xcfafa2){if(!_0xcfafa2){_0x319bb7[_0x6ae1('0x23')](0x194);}return _0xcfafa2;};}function handleError(_0x54542e,_0x577b83){_0x577b83=_0x577b83||0x1f4;return function(_0x459028){logger[_0x6ae1('0x24')](_0x459028[_0x6ae1('0x25')]);if(_0x459028[_0x6ae1('0x26')]){delete _0x459028['name'];}_0x54542e[_0x6ae1('0x16')](_0x577b83)[_0x6ae1('0x27')](_0x459028);};}exports[_0x6ae1('0x28')]=function(_0x3a440e,_0x59465a){var _0x358244={},_0x19aa04={},_0x2e9967={'count':0x0,'rows':[]};var _0x4a0cb9=_[_0x6ae1('0x29')](db[_0x6ae1('0x2a')][_0x6ae1('0x2b')],function(_0x1f2fbc){return{'name':_0x1f2fbc[_0x6ae1('0x2c')],'type':_0x1f2fbc[_0x6ae1('0x2d')][_0x6ae1('0x2e')]};});_0x19aa04[_0x6ae1('0x2f')]=_[_0x6ae1('0x29')](_0x4a0cb9,'name');_0x19aa04[_0x6ae1('0x30')]=_['keys'](_0x3a440e['query']);_0x19aa04['filters']=_[_0x6ae1('0x31')](_0x19aa04[_0x6ae1('0x2f')],_0x19aa04[_0x6ae1('0x30')]);_0x358244['attributes']=_[_0x6ae1('0x31')](_0x19aa04['model'],qs[_0x6ae1('0x32')](_0x3a440e['query'][_0x6ae1('0x32')]));_0x358244[_0x6ae1('0x33')]=_0x358244['attributes'][_0x6ae1('0x34')]?_0x358244[_0x6ae1('0x33')]:_0x19aa04[_0x6ae1('0x2f')];if(!_0x3a440e[_0x6ae1('0x30')][_0x6ae1('0x35')](_0x6ae1('0x36'))){_0x358244[_0x6ae1('0x1b')]=qs[_0x6ae1('0x1b')](_0x3a440e[_0x6ae1('0x30')]['limit']);_0x358244[_0x6ae1('0x1a')]=qs[_0x6ae1('0x1a')](_0x3a440e[_0x6ae1('0x30')][_0x6ae1('0x1a')]);}_0x358244[_0x6ae1('0x37')]=qs['sort'](_0x3a440e[_0x6ae1('0x30')][_0x6ae1('0x38')]);_0x358244[_0x6ae1('0x39')]=qs[_0x6ae1('0x3a')](_[_0x6ae1('0x3b')](_0x3a440e[_0x6ae1('0x30')],_0x19aa04['filters']),_0x4a0cb9);if(_0x3a440e[_0x6ae1('0x30')][_0x6ae1('0x3c')]){_0x358244[_0x6ae1('0x39')]=_[_0x6ae1('0x3d')](_0x358244[_0x6ae1('0x39')],{'$or':_[_0x6ae1('0x29')](_0x4a0cb9,function(_0x278ae6){if(_0x278ae6['type']!==_0x6ae1('0x3e')){var _0x3485f9={};_0x3485f9[_0x278ae6['name']]={'$like':'%'+_0x3a440e[_0x6ae1('0x30')][_0x6ae1('0x3c')]+'%'};return _0x3485f9;}})});}_0x358244=_[_0x6ae1('0x3d')]({},_0x358244,_0x3a440e[_0x6ae1('0x3f')]);var _0x5b5897={'where':_0x358244['where']};return db[_0x6ae1('0x2a')][_0x6ae1('0x19')](_0x5b5897)[_0x6ae1('0x21')](function(_0x3c4b67){_0x2e9967[_0x6ae1('0x19')]=_0x3c4b67;if(_0x3a440e[_0x6ae1('0x30')][_0x6ae1('0x40')]){_0x358244[_0x6ae1('0x41')]=[{'all':!![]}];}return db[_0x6ae1('0x2a')][_0x6ae1('0x42')](_0x358244);})['then'](function(_0x245786){_0x2e9967[_0x6ae1('0x43')]=_0x245786;return _0x2e9967;})[_0x6ae1('0x21')](respondWithFilteredResult(_0x59465a,_0x358244))[_0x6ae1('0x44')](handleError(_0x59465a,null));};exports[_0x6ae1('0x45')]=function(_0x59a936,_0x15c1c0){var _0x4341ed={'raw':![],'where':{'id':_0x59a936[_0x6ae1('0x46')]['id']}},_0x36ee4b={};_0x36ee4b[_0x6ae1('0x2f')]=_[_0x6ae1('0x47')](db['ServicenowAccount'][_0x6ae1('0x2b')]);_0x36ee4b['query']=_[_0x6ae1('0x47')](_0x59a936[_0x6ae1('0x30')]);_0x36ee4b[_0x6ae1('0x3a')]=_[_0x6ae1('0x31')](_0x36ee4b[_0x6ae1('0x2f')],_0x36ee4b['query']);_0x4341ed['attributes']=_[_0x6ae1('0x31')](_0x36ee4b[_0x6ae1('0x2f')],qs[_0x6ae1('0x32')](_0x59a936[_0x6ae1('0x30')][_0x6ae1('0x32')]));_0x4341ed['attributes']=_0x4341ed['attributes'][_0x6ae1('0x34')]?_0x4341ed[_0x6ae1('0x33')]:_0x36ee4b[_0x6ae1('0x2f')];if(_0x59a936[_0x6ae1('0x30')][_0x6ae1('0x40')]){_0x4341ed[_0x6ae1('0x41')]=[{'all':!![]}];}_0x4341ed=_[_0x6ae1('0x3d')]({},_0x4341ed,_0x59a936[_0x6ae1('0x3f')]);return db[_0x6ae1('0x2a')][_0x6ae1('0x48')](_0x4341ed)[_0x6ae1('0x21')](handleEntityNotFound(_0x15c1c0,null))[_0x6ae1('0x21')](respondWithResult(_0x15c1c0,null))[_0x6ae1('0x44')](handleError(_0x15c1c0,null));};exports['create']=function(_0x1fd392,_0x24f619){return db['ServicenowAccount']['create'](_0x1fd392[_0x6ae1('0x49')],{})[_0x6ae1('0x21')](respondWithResult(_0x24f619,0xc9))[_0x6ae1('0x44')](handleError(_0x24f619,null));};exports[_0x6ae1('0x20')]=function(_0x1c5e61,_0x529544){if(_0x1c5e61['body']['id']){delete _0x1c5e61[_0x6ae1('0x49')]['id'];}return db[_0x6ae1('0x2a')][_0x6ae1('0x48')]({'where':{'id':_0x1c5e61['params']['id']}})[_0x6ae1('0x21')](handleEntityNotFound(_0x529544,null))[_0x6ae1('0x21')](saveUpdates(_0x1c5e61[_0x6ae1('0x49')],null))[_0x6ae1('0x21')](respondWithResult(_0x529544,null))['catch'](handleError(_0x529544,null));};exports['destroy']=function(_0x2c48b2,_0xcc635a){return db[_0x6ae1('0x2a')][_0x6ae1('0x48')]({'where':{'id':_0x2c48b2[_0x6ae1('0x46')]['id']}})[_0x6ae1('0x21')](handleEntityNotFound(_0xcc635a,null))[_0x6ae1('0x21')](removeEntity(_0xcc635a,null))['catch'](handleError(_0xcc635a,null));};exports[_0x6ae1('0x4a')]=function(_0x296d8d,_0xed7492,_0x2f8296){var _0x533a79={};var _0x5e78e2={};var _0x9515e7;var _0x50f0be;return db[_0x6ae1('0x2a')][_0x6ae1('0x4b')]({'where':{'id':_0x296d8d[_0x6ae1('0x46')]['id']}})[_0x6ae1('0x21')](handleEntityNotFound(_0xed7492,null))[_0x6ae1('0x21')](function(_0x13c212){if(_0x13c212){_0x9515e7=_0x13c212;_0x5e78e2[_0x6ae1('0x2f')]=_[_0x6ae1('0x47')](db[_0x6ae1('0x4c')][_0x6ae1('0x2b')]);_0x5e78e2[_0x6ae1('0x30')]=_['keys'](_0x296d8d['query']);_0x5e78e2['filters']=_['intersection'](_0x5e78e2[_0x6ae1('0x2f')],_0x5e78e2[_0x6ae1('0x30')]);_0x533a79[_0x6ae1('0x33')]=_[_0x6ae1('0x31')](_0x5e78e2[_0x6ae1('0x2f')],qs[_0x6ae1('0x32')](_0x296d8d[_0x6ae1('0x30')][_0x6ae1('0x32')]));_0x533a79[_0x6ae1('0x33')]=_0x533a79['attributes'][_0x6ae1('0x34')]?_0x533a79[_0x6ae1('0x33')]:_0x5e78e2[_0x6ae1('0x2f')];_0x533a79[_0x6ae1('0x37')]=qs[_0x6ae1('0x38')](_0x296d8d[_0x6ae1('0x30')]['sort']);_0x533a79[_0x6ae1('0x39')]=qs['filters'](_[_0x6ae1('0x3b')](_0x296d8d[_0x6ae1('0x30')],_0x5e78e2[_0x6ae1('0x3a')]));if(_0x296d8d[_0x6ae1('0x30')][_0x6ae1('0x3c')]){_0x533a79[_0x6ae1('0x39')]=_[_0x6ae1('0x3d')](_0x533a79[_0x6ae1('0x39')],{'$or':_[_0x6ae1('0x29')](_0x533a79[_0x6ae1('0x33')],function(_0x4599bd){var _0x13212d={};_0x13212d[_0x4599bd]={'$like':'%'+_0x296d8d[_0x6ae1('0x30')]['filter']+'%'};return _0x13212d;})});}_0x533a79=_[_0x6ae1('0x3d')]({},_0x533a79,_0x296d8d[_0x6ae1('0x3f')]);return _0x9515e7[_0x6ae1('0x4a')](_0x533a79);}})['then'](function(_0x4ff093){if(_0x4ff093){_0x50f0be=_0x4ff093[_0x6ae1('0x34')];if(!_0x296d8d[_0x6ae1('0x30')][_0x6ae1('0x35')](_0x6ae1('0x36'))){_0x533a79['limit']=qs[_0x6ae1('0x1b')](_0x296d8d[_0x6ae1('0x30')][_0x6ae1('0x1b')]);_0x533a79[_0x6ae1('0x1a')]=qs[_0x6ae1('0x1a')](_0x296d8d[_0x6ae1('0x30')][_0x6ae1('0x1a')]);}return _0x9515e7[_0x6ae1('0x4a')](_0x533a79);}})[_0x6ae1('0x21')](function(_0x4b8d22){if(_0x4b8d22){return _0x4b8d22?{'count':_0x50f0be,'rows':_0x4b8d22}:null;}})[_0x6ae1('0x21')](respondWithResult(_0xed7492,null))[_0x6ae1('0x44')](handleError(_0xed7492,null));};exports[_0x6ae1('0x4d')]=function(_0x34e853,_0x8cff2d,_0xda5bc8){if(_0x34e853[_0x6ae1('0x49')]['id']){delete _0x34e853['body']['id'];}return db['ServicenowAccount'][_0x6ae1('0x4b')]({'where':{'id':_0x34e853['params']['id']}})[_0x6ae1('0x21')](handleEntityNotFound(_0x8cff2d,null))[_0x6ae1('0x21')](function(_0x292f70){if(_0x292f70){_0x34e853['body'][_0x6ae1('0x4e')]=_0x292f70['id'];_0x34e853[_0x6ae1('0x49')][_0x6ae1('0x4f')]=integrations[_0x6ae1('0x50')](_0x34e853[_0x6ae1('0x49')]['channel'],_0x34e853[_0x6ae1('0x49')][_0x6ae1('0x2d')]);_0x34e853[_0x6ae1('0x49')][_0x6ae1('0x51')]=integrations[_0x6ae1('0x52')](_0x34e853[_0x6ae1('0x49')][_0x6ae1('0x53')],_0x34e853[_0x6ae1('0x49')][_0x6ae1('0x2d')]);return db['ServicenowConfiguration']['create'](_0x34e853[_0x6ae1('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0x6ae1('0x4f')},{'model':db[_0x6ae1('0x54')],'as':_0x6ae1('0x51')}]});}return null;})[_0x6ae1('0x21')](respondWithResult(_0x8cff2d,null))['catch'](handleError(_0x8cff2d,null));};exports[_0x6ae1('0x55')]=function(_0x37cace,_0xe2719e,_0x547097){var _0x3cf917=[_0x6ae1('0x56'),_0x6ae1('0x57'),_0x6ae1('0x58'),_0x6ae1('0x59'),_0x6ae1('0x5a'),'notify','incident_state',_0x6ae1('0x5b'),_0x6ae1('0x5c')];var _0x374c2a=[_0x6ae1('0x5d'),_0x6ae1('0x56'),'caused_by',_0x6ae1('0x5e'),_0x6ae1('0x5f'),'sys_updated_on','child_incidents',_0x6ae1('0x57'),_0x6ae1('0x60'),'number',_0x6ae1('0x61'),_0x6ae1('0x62'),_0x6ae1('0x63'),'user_input',_0x6ae1('0x64'),'sys_domain',_0x6ae1('0x65'),_0x6ae1('0x66'),_0x6ae1('0x58'),'order','calendar_stc',_0x6ae1('0x67'),'cmdb_ci',_0x6ae1('0x68'),_0x6ae1('0x69'),_0x6ae1('0x6a'),_0x6ae1('0x6b'),_0x6ae1('0x6c'),_0x6ae1('0x6d'),_0x6ae1('0x6e'),'rfc',_0x6ae1('0x6f'),'expected_start',_0x6ae1('0x70'),_0x6ae1('0x71'),'group_list',_0x6ae1('0x72'),_0x6ae1('0x73'),_0x6ae1('0x74'),_0x6ae1('0x75'),_0x6ae1('0x76'),_0x6ae1('0x59'),_0x6ae1('0x77'),'short_description',_0x6ae1('0x5a'),_0x6ae1('0x78'),_0x6ae1('0x79'),'work_start',_0x6ae1('0x7a'),_0x6ae1('0x7b'),_0x6ae1('0x7c'),_0x6ae1('0x7d'),_0x6ae1('0x7e'),_0x6ae1('0x7f'),_0x6ae1('0x80'),'close_notes',_0x6ae1('0x81'),_0x6ae1('0x82'),_0x6ae1('0x83'),_0x6ae1('0x84'),_0x6ae1('0x85'),_0x6ae1('0x86'),'incident_state','urgency',_0x6ae1('0x87'),_0x6ae1('0x88'),_0x6ae1('0x89'),_0x6ae1('0x8a'),_0x6ae1('0x8b'),_0x6ae1('0x5b'),_0x6ae1('0x8c'),_0x6ae1('0x8d'),_0x6ae1('0x8e'),'comments_and_work_notes',_0x6ae1('0x8f'),'sys_mod_count',_0x6ae1('0x90'),'sys_tags',_0x6ae1('0x91'),_0x6ae1('0x92'),'correlation_id',_0x6ae1('0x93'),_0x6ae1('0x5c')];var _0x4d8651='';var _0x38f6a9='';var _0x113fb1=[];var _0x556396='';var _0x45cb47='';var _0x201eb8=[];var _0x1d0fb4='';var _0x303e5e='';var _0x4ef0ca={};var _0x508e50='';return db[_0x6ae1('0x2a')][_0x6ae1('0x4b')]({'where':{'id':_0x37cace[_0x6ae1('0x46')]['id']},'attributes':['id',_0x6ae1('0x94'),_0x6ae1('0x95'),_0x6ae1('0x96'),_0x6ae1('0x97'),'serverUrl']})['then'](handleEntityNotFound(_0xe2719e,null))[_0x6ae1('0x21')](function(_0x2e9d87){if(_0x2e9d87){_0x508e50=_0x2e9d87[_0x6ae1('0x97')];var _0x46d5a2=_0x508e50[_0x6ae1('0x98')](-0x1);if(_0x46d5a2==='/'){_0x508e50=_0x508e50['substring'](0x0,_0x508e50[_0x6ae1('0x99')](_0x46d5a2));}_0x303e5e=util[_0x6ae1('0x9a')](_0x6ae1('0x9b'),_0x508e50);_0x1d0fb4=util[_0x6ae1('0x9a')](_0x6ae1('0x9c'),_0x508e50);_0x4ef0ca={'user':_0x2e9d87[_0x6ae1('0x94')],'pass':_0x2e9d87['password']};var _0x3701bb={'method':_0x6ae1('0x9d'),'uri':_0x303e5e+_0x6ae1('0x9e'),'auth':_0x4ef0ca,'json':!![]};return rp(_0x3701bb);}})['then'](function(_0x5081ce){if(_0x5081ce[_0x6ae1('0x9f')][_0x6ae1('0x34')]>0x0){_0x4d8651=_0x5081ce['result'];}console[_0x6ae1('0xa0')](_0x6ae1('0xa1'),_0x4d8651);_0x201eb8=[];_0x38f6a9=Object['assign']([],_0x4d8651);_[_0x6ae1('0xa2')](_0x38f6a9,function(_0x3a2b46){return!_0x3cf917['includes'](_0x3a2b46[_0x6ae1('0x26')]);});_0x38f6a9[_0x6ae1('0xa3')](function(_0xec84e8){var _0xcf442e=createFieldObject(_0x1d0fb4,_0x4ef0ca,_0xec84e8['internalType'],_0xec84e8[_0x6ae1('0x26')],_0xec84e8[_0x6ae1('0xa4')],![]);_0x201eb8['push'](_0xcf442e);});return Promise['all'](_0x201eb8);})['then'](function(_0x299730){_0x113fb1=_0x299730;_0x556396=Object[_0x6ae1('0xa5')]([],_0x4d8651);console[_0x6ae1('0xa0')]('TCL:\x20_object',_0x4d8651);_[_0x6ae1('0xa2')](_0x556396,function(_0x5bbc62){return _0x374c2a[_0x6ae1('0xa6')](_0x5bbc62[_0x6ae1('0x26')]);});console['log'](_0x6ae1('0xa7'),_0x556396);_0x201eb8=[];_0x556396['forEach'](function(_0x29e690){var _0x1e3497=createFieldObject(_0x1d0fb4,_0x4ef0ca,_0x29e690[_0x6ae1('0xa8')],_0x29e690['name'],_0x29e690[_0x6ae1('0xa4')],!![]);_0x201eb8[_0x6ae1('0xa9')](_0x1e3497);});return Promise[_0x6ae1('0xaa')](_0x201eb8);})['then'](function(_0x272135){_0x45cb47=_0x272135;var _0x38bf8c=_0x113fb1[_0x6ae1('0xab')](_0x45cb47);return{'count':_0x38bf8c[_0x6ae1('0x34')],'rows':_0x38bf8c};})[_0x6ae1('0x21')](respondWithResult(_0xe2719e,null))['catch'](function(_0x345497){console[_0x6ae1('0xa0')](_0x6ae1('0xac')+_0x345497);var _0x2f5fb0=_0x37cace[_0x6ae1('0x30')][_0x6ae1('0xad')]?0x1f4:_0x345497[_0x6ae1('0xae')]||0x1f4;logger[_0x6ae1('0x24')](_0x345497['stack']);delete _0x345497[_0x6ae1('0x26')];if(_0x2f5fb0===0x191){_0x2f5fb0=0x190;}_0xe2719e[_0x6ae1('0x16')](_0x2f5fb0)[_0x6ae1('0x27')](_0x37cace[_0x6ae1('0x30')][_0x6ae1('0xad')]?{'message':_0x6ae1('0xaf'),'statusCode':_0x345497[_0x6ae1('0xae')]}:_0x345497);});};function createFieldObject(_0xefabe,_0x4fdab7,_0x416f70,_0x167b90,_0x45469c,_0x3fdf0f){return new Promise(function(_0x7f572d,_0x32838f){var _0x16a4c0={'id':_0x167b90,'name':_0x45469c,'custom':_0x3fdf0f};if(_0x416f70===_0x6ae1('0xb0')){_0x16a4c0[_0x6ae1('0x3f')]=[{'name':_0x6ae1('0xb1'),'value':_0x6ae1('0xb2')},{'name':_0x6ae1('0xb3'),'value':_0x6ae1('0xb4')}];_0x7f572d(_0x16a4c0);}else{var _0x273e10={'method':_0x6ae1('0x9d'),'uri':_0xefabe+_0x6ae1('0xb5')+_0x167b90,'auth':_0x4fdab7,'json':!![]};return rp(_0x273e10)[_0x6ae1('0x21')](function(_0x29ed2b){var _0x272e73=[];if(_0x29ed2b[_0x6ae1('0x9f')][_0x6ae1('0x34')]>0x0){_0x29ed2b[_0x6ae1('0x9f')][_0x6ae1('0xa3')](function(_0x227899){if(_0x227899[_0x6ae1('0xb6')]===_0x6ae1('0xb4')){var _0x11e440={'name':_0x227899[_0x6ae1('0xa4')],'value':_0x227899['value']};_0x272e73['push'](_0x11e440);}});}_0x16a4c0['options']=_0x272e73;if(_0x16a4c0['options'][_0x6ae1('0x34')]>0x0){_0x7f572d(_0x16a4c0);}else{if(_0x3fdf0f==![]){_0x7f572d();}else{_0x7f572d(_0x16a4c0);}}});}});} \ No newline at end of file +var _0x0210=['assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','error','stack','Wrong\x20credentials','boolean','True','true','False','false','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','name','index','rawAttributes','fieldName','type','key','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','ServicenowAccount','include','findAll','intersection','includeAll','catch','create','body','params','destroy','findOne','ServicenowConfiguration','pick','map','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','Subjects','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','sys_id','reopened_by','urgency','problem_id','reassignment_count','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','upon_approval','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects'];(function(_0x2d9c3e,_0x59d297){var _0x2455e1=function(_0x17b53e){while(--_0x17b53e){_0x2d9c3e['push'](_0x2d9c3e['shift']());}};_0x2455e1(++_0x59d297);}(_0x0210,0xc6));var _0x0021=function(_0x47ac81,_0x2efcbc){_0x47ac81=_0x47ac81-0x0;var _0x4bfc1a=_0x0210[_0x47ac81];return _0x4bfc1a;};'use strict';var emlformat=require(_0x0021('0x0'));var rimraf=require(_0x0021('0x1'));var zipdir=require(_0x0021('0x2'));var jsonpatch=require(_0x0021('0x3'));var rp=require(_0x0021('0x4'));var moment=require(_0x0021('0x5'));var BPromise=require(_0x0021('0x6'));var Mustache=require(_0x0021('0x7'));var util=require(_0x0021('0x8'));var path=require('path');var sox=require(_0x0021('0x9'));var csv=require(_0x0021('0xa'));var ejs=require(_0x0021('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0021('0xc'));var squel=require(_0x0021('0xd'));var crypto=require('crypto');var jsforce=require(_0x0021('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0021('0xf'));var qs=require(_0x0021('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0021('0x11'));var logger=require('../../config/logger')(_0x0021('0x12'));var utils=require(_0x0021('0x13'));var config=require(_0x0021('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0021('0x15'))['db'];var integrations=require(_0x0021('0x16'));function respondWithStatusCode(_0x5f3130,_0x2c7661){_0x2c7661=_0x2c7661||0xcc;return function(_0x47b195){if(_0x47b195){return _0x5f3130[_0x0021('0x17')](_0x2c7661);}return _0x5f3130[_0x0021('0x18')](_0x2c7661)[_0x0021('0x19')]();};}function respondWithResult(_0x56b552,_0x3c0e5f){_0x3c0e5f=_0x3c0e5f||0xc8;return function(_0x41f1d6){if(_0x41f1d6){return _0x56b552[_0x0021('0x18')](_0x3c0e5f)[_0x0021('0x1a')](_0x41f1d6);}};}function respondWithFilteredResult(_0x3e6b4e,_0x430f70){return function(_0x2c2122){if(_0x2c2122){var _0x1299ca=typeof _0x430f70[_0x0021('0x1b')]==='undefined'&&typeof _0x430f70[_0x0021('0x1c')]===_0x0021('0x1d');var _0x244061=_0x2c2122[_0x0021('0x1e')];var _0x10ac78=_0x1299ca?0x0:_0x430f70[_0x0021('0x1b')];var _0x280f14=_0x1299ca?_0x2c2122[_0x0021('0x1e')]:_0x430f70[_0x0021('0x1b')]+_0x430f70['limit'];var _0x3997e3;if(_0x280f14>=_0x244061){_0x280f14=_0x244061;_0x3997e3=0xc8;}else{_0x3997e3=0xce;}_0x3e6b4e[_0x0021('0x18')](_0x3997e3);return _0x3e6b4e[_0x0021('0x1f')](_0x0021('0x20'),_0x10ac78+'-'+_0x280f14+'/'+_0x244061)[_0x0021('0x1a')](_0x2c2122);}return null;};}function patchUpdates(_0x134f45){return function(_0x240e00){try{jsonpatch[_0x0021('0x21')](_0x240e00,_0x134f45,!![]);}catch(_0x6685ca){return BPromise[_0x0021('0x22')](_0x6685ca);}return _0x240e00[_0x0021('0x23')]();};}function saveUpdates(_0x5c3d3c,_0x597dbb){return function(_0x5f26ac){if(_0x5f26ac){return _0x5f26ac[_0x0021('0x24')](_0x5c3d3c)[_0x0021('0x25')](function(_0xf4e5d7){return _0xf4e5d7;});}return null;};}function removeEntity(_0x3bcdf7,_0x1adaa6){return function(_0xb90f97){if(_0xb90f97){return _0xb90f97['destroy']()[_0x0021('0x25')](function(){_0x3bcdf7[_0x0021('0x18')](0xcc)[_0x0021('0x19')]();});}};}function handleEntityNotFound(_0x3aa141,_0xb81256){return function(_0x442c65){if(!_0x442c65){_0x3aa141['sendStatus'](0x194);}return _0x442c65;};}function handleError(_0x2b3e04,_0x11373d){_0x11373d=_0x11373d||0x1f4;return function(_0x38d515){logger['error'](_0x38d515['stack']);if(_0x38d515[_0x0021('0x26')]){delete _0x38d515['name'];}_0x2b3e04[_0x0021('0x18')](_0x11373d)['send'](_0x38d515);};}exports[_0x0021('0x27')]=function(_0x33880a,_0x21e306){var _0x214bdd={},_0x1d5e0c={},_0xd835a2={'count':0x0,'rows':[]};var _0x462476=_['map'](db['ServicenowAccount'][_0x0021('0x28')],function(_0x497b90){return{'name':_0x497b90[_0x0021('0x29')],'type':_0x497b90[_0x0021('0x2a')][_0x0021('0x2b')]};});_0x1d5e0c['model']=_['map'](_0x462476,_0x0021('0x26'));_0x1d5e0c[_0x0021('0x2c')]=_[_0x0021('0x2d')](_0x33880a[_0x0021('0x2c')]);_0x1d5e0c[_0x0021('0x2e')]=_['intersection'](_0x1d5e0c['model'],_0x1d5e0c['query']);_0x214bdd[_0x0021('0x2f')]=_['intersection'](_0x1d5e0c[_0x0021('0x30')],qs[_0x0021('0x31')](_0x33880a[_0x0021('0x2c')][_0x0021('0x31')]));_0x214bdd[_0x0021('0x2f')]=_0x214bdd[_0x0021('0x2f')][_0x0021('0x32')]?_0x214bdd['attributes']:_0x1d5e0c['model'];if(!_0x33880a[_0x0021('0x2c')][_0x0021('0x33')](_0x0021('0x34'))){_0x214bdd[_0x0021('0x1c')]=qs['limit'](_0x33880a[_0x0021('0x2c')][_0x0021('0x1c')]);_0x214bdd[_0x0021('0x1b')]=qs[_0x0021('0x1b')](_0x33880a[_0x0021('0x2c')][_0x0021('0x1b')]);}_0x214bdd[_0x0021('0x35')]=qs[_0x0021('0x36')](_0x33880a[_0x0021('0x2c')][_0x0021('0x36')]);_0x214bdd['where']=qs[_0x0021('0x2e')](_['pick'](_0x33880a[_0x0021('0x2c')],_0x1d5e0c[_0x0021('0x2e')]),_0x462476);if(_0x33880a[_0x0021('0x2c')][_0x0021('0x37')]){_0x214bdd[_0x0021('0x38')]=_[_0x0021('0x39')](_0x214bdd['where'],{'$or':_['map'](_0x462476,function(_0x409a2f){if(_0x409a2f[_0x0021('0x2a')]!=='VIRTUAL'){var _0x1447f9={};_0x1447f9[_0x409a2f[_0x0021('0x26')]]={'$like':'%'+_0x33880a['query'][_0x0021('0x37')]+'%'};return _0x1447f9;}})});}_0x214bdd=_[_0x0021('0x39')]({},_0x214bdd,_0x33880a[_0x0021('0x3a')]);var _0x1dc058={'where':_0x214bdd[_0x0021('0x38')]};return db[_0x0021('0x3b')][_0x0021('0x1e')](_0x1dc058)['then'](function(_0x4d4bf1){_0xd835a2[_0x0021('0x1e')]=_0x4d4bf1;if(_0x33880a['query']['includeAll']){_0x214bdd[_0x0021('0x3c')]=[{'all':!![]}];}return db[_0x0021('0x3b')][_0x0021('0x3d')](_0x214bdd);})[_0x0021('0x25')](function(_0x1f1f3a){_0xd835a2['rows']=_0x1f1f3a;return _0xd835a2;})[_0x0021('0x25')](respondWithFilteredResult(_0x21e306,_0x214bdd))['catch'](handleError(_0x21e306,null));};exports['show']=function(_0x511616,_0x1a7f49){var _0xf9f716={'raw':![],'where':{'id':_0x511616['params']['id']}},_0x3e4a07={};_0x3e4a07[_0x0021('0x30')]=_[_0x0021('0x2d')](db[_0x0021('0x3b')]['rawAttributes']);_0x3e4a07[_0x0021('0x2c')]=_[_0x0021('0x2d')](_0x511616[_0x0021('0x2c')]);_0x3e4a07[_0x0021('0x2e')]=_['intersection'](_0x3e4a07[_0x0021('0x30')],_0x3e4a07[_0x0021('0x2c')]);_0xf9f716[_0x0021('0x2f')]=_[_0x0021('0x3e')](_0x3e4a07[_0x0021('0x30')],qs[_0x0021('0x31')](_0x511616[_0x0021('0x2c')][_0x0021('0x31')]));_0xf9f716[_0x0021('0x2f')]=_0xf9f716[_0x0021('0x2f')]['length']?_0xf9f716[_0x0021('0x2f')]:_0x3e4a07[_0x0021('0x30')];if(_0x511616[_0x0021('0x2c')][_0x0021('0x3f')]){_0xf9f716[_0x0021('0x3c')]=[{'all':!![]}];}_0xf9f716=_[_0x0021('0x39')]({},_0xf9f716,_0x511616['options']);return db[_0x0021('0x3b')]['find'](_0xf9f716)[_0x0021('0x25')](handleEntityNotFound(_0x1a7f49,null))[_0x0021('0x25')](respondWithResult(_0x1a7f49,null))[_0x0021('0x40')](handleError(_0x1a7f49,null));};exports[_0x0021('0x41')]=function(_0x2c9e0c,_0x21c286){return db['ServicenowAccount'][_0x0021('0x41')](_0x2c9e0c[_0x0021('0x42')],{})['then'](respondWithResult(_0x21c286,0xc9))['catch'](handleError(_0x21c286,null));};exports[_0x0021('0x24')]=function(_0xf6dc0a,_0x56450f){if(_0xf6dc0a['body']['id']){delete _0xf6dc0a[_0x0021('0x42')]['id'];}return db[_0x0021('0x3b')]['find']({'where':{'id':_0xf6dc0a[_0x0021('0x43')]['id']}})['then'](handleEntityNotFound(_0x56450f,null))[_0x0021('0x25')](saveUpdates(_0xf6dc0a['body'],null))[_0x0021('0x25')](respondWithResult(_0x56450f,null))[_0x0021('0x40')](handleError(_0x56450f,null));};exports[_0x0021('0x44')]=function(_0xc2b36b,_0x54dc8f){return db[_0x0021('0x3b')]['find']({'where':{'id':_0xc2b36b[_0x0021('0x43')]['id']}})['then'](handleEntityNotFound(_0x54dc8f,null))['then'](removeEntity(_0x54dc8f,null))[_0x0021('0x40')](handleError(_0x54dc8f,null));};exports['getConfigurations']=function(_0x236ca9,_0x55190f,_0x2447e2){var _0x42fa7d={};var _0x3771f3={};var _0x4f597c;var _0x3bb0d1;return db[_0x0021('0x3b')][_0x0021('0x45')]({'where':{'id':_0x236ca9[_0x0021('0x43')]['id']}})[_0x0021('0x25')](handleEntityNotFound(_0x55190f,null))[_0x0021('0x25')](function(_0x556be4){if(_0x556be4){_0x4f597c=_0x556be4;_0x3771f3[_0x0021('0x30')]=_[_0x0021('0x2d')](db[_0x0021('0x46')]['rawAttributes']);_0x3771f3['query']=_[_0x0021('0x2d')](_0x236ca9[_0x0021('0x2c')]);_0x3771f3[_0x0021('0x2e')]=_[_0x0021('0x3e')](_0x3771f3[_0x0021('0x30')],_0x3771f3[_0x0021('0x2c')]);_0x42fa7d[_0x0021('0x2f')]=_[_0x0021('0x3e')](_0x3771f3[_0x0021('0x30')],qs[_0x0021('0x31')](_0x236ca9[_0x0021('0x2c')]['fields']));_0x42fa7d[_0x0021('0x2f')]=_0x42fa7d[_0x0021('0x2f')][_0x0021('0x32')]?_0x42fa7d[_0x0021('0x2f')]:_0x3771f3['model'];_0x42fa7d[_0x0021('0x35')]=qs[_0x0021('0x36')](_0x236ca9['query'][_0x0021('0x36')]);_0x42fa7d['where']=qs[_0x0021('0x2e')](_[_0x0021('0x47')](_0x236ca9[_0x0021('0x2c')],_0x3771f3[_0x0021('0x2e')]));if(_0x236ca9[_0x0021('0x2c')][_0x0021('0x37')]){_0x42fa7d[_0x0021('0x38')]=_[_0x0021('0x39')](_0x42fa7d['where'],{'$or':_[_0x0021('0x48')](_0x42fa7d[_0x0021('0x2f')],function(_0x39aacc){var _0x41e925={};_0x41e925[_0x39aacc]={'$like':'%'+_0x236ca9[_0x0021('0x2c')][_0x0021('0x37')]+'%'};return _0x41e925;})});}_0x42fa7d=_['merge']({},_0x42fa7d,_0x236ca9[_0x0021('0x3a')]);return _0x4f597c[_0x0021('0x49')](_0x42fa7d);}})[_0x0021('0x25')](function(_0x11891a){if(_0x11891a){_0x3bb0d1=_0x11891a['length'];if(!_0x236ca9[_0x0021('0x2c')][_0x0021('0x33')](_0x0021('0x34'))){_0x42fa7d[_0x0021('0x1c')]=qs[_0x0021('0x1c')](_0x236ca9[_0x0021('0x2c')][_0x0021('0x1c')]);_0x42fa7d['offset']=qs[_0x0021('0x1b')](_0x236ca9[_0x0021('0x2c')][_0x0021('0x1b')]);}return _0x4f597c[_0x0021('0x49')](_0x42fa7d);}})['then'](function(_0x2aa777){if(_0x2aa777){return _0x2aa777?{'count':_0x3bb0d1,'rows':_0x2aa777}:null;}})[_0x0021('0x25')](respondWithResult(_0x55190f,null))['catch'](handleError(_0x55190f,null));};exports[_0x0021('0x4a')]=function(_0x937924,_0x1ba011,_0x225113){if(_0x937924[_0x0021('0x42')]['id']){delete _0x937924[_0x0021('0x42')]['id'];}return db[_0x0021('0x3b')][_0x0021('0x45')]({'where':{'id':_0x937924[_0x0021('0x43')]['id']}})[_0x0021('0x25')](handleEntityNotFound(_0x1ba011,null))[_0x0021('0x25')](function(_0x5ca52a){if(_0x5ca52a){_0x937924[_0x0021('0x42')]['AccountId']=_0x5ca52a['id'];_0x937924[_0x0021('0x42')]['Subjects']=integrations[_0x0021('0x4b')](_0x937924['body'][_0x0021('0x4c')],_0x937924[_0x0021('0x42')][_0x0021('0x2a')]);_0x937924[_0x0021('0x42')][_0x0021('0x4d')]=integrations['getDescriptions'](_0x937924[_0x0021('0x42')][_0x0021('0x4c')],_0x937924[_0x0021('0x42')][_0x0021('0x2a')]);return db[_0x0021('0x46')][_0x0021('0x41')](_0x937924[_0x0021('0x42')],{'include':[{'model':db['ServicenowField'],'as':_0x0021('0x4e')},{'model':db[_0x0021('0x4f')],'as':_0x0021('0x4d')}]});}return null;})[_0x0021('0x25')](respondWithResult(_0x1ba011,null))[_0x0021('0x40')](handleError(_0x1ba011,null));};exports[_0x0021('0x50')]=function(_0xd23047,_0x50d34f,_0x4810d6){var _0x1bd68a=[_0x0021('0x51'),_0x0021('0x52'),_0x0021('0x53'),_0x0021('0x54'),_0x0021('0x55'),_0x0021('0x56'),_0x0021('0x57'),'severity',_0x0021('0x58')];var _0x47e2b6=[_0x0021('0x59'),_0x0021('0x51'),_0x0021('0x5a'),'watch_list',_0x0021('0x5b'),_0x0021('0x5c'),_0x0021('0x5d'),'hold_reason','approval_history',_0x0021('0x5e'),_0x0021('0x5f'),_0x0021('0x60'),'opened_by','user_input',_0x0021('0x61'),_0x0021('0x62'),_0x0021('0x63'),'sys_created_by','knowledge',_0x0021('0x35'),_0x0021('0x64'),_0x0021('0x65'),_0x0021('0x66'),_0x0021('0x67'),_0x0021('0x68'),_0x0021('0x69'),_0x0021('0x6a'),_0x0021('0x6b'),_0x0021('0x6c'),_0x0021('0x6d'),'rfc',_0x0021('0x6e'),_0x0021('0x6f'),_0x0021('0x70'),_0x0021('0x71'),_0x0021('0x72'),'work_end',_0x0021('0x73'),_0x0021('0x74'),_0x0021('0x75'),'approval_set',_0x0021('0x54'),'work_notes','short_description',_0x0021('0x55'),_0x0021('0x76'),_0x0021('0x77'),_0x0021('0x78'),_0x0021('0x79'),'business_stc',_0x0021('0x7a'),_0x0021('0x7b'),_0x0021('0x7c'),'notify',_0x0021('0x7d'),'close_notes',_0x0021('0x7e'),_0x0021('0x7f'),'parent_incident',_0x0021('0x80'),'contact_type',_0x0021('0x81'),_0x0021('0x57'),_0x0021('0x82'),_0x0021('0x83'),'company',_0x0021('0x84'),'activity_due','assigned_to',_0x0021('0x85'),_0x0021('0x86'),_0x0021('0x87'),'approval',_0x0021('0x88'),_0x0021('0x89'),_0x0021('0x8a'),'reopen_count',_0x0021('0x8b'),'escalation',_0x0021('0x8c'),'correlation_id',_0x0021('0x8d'),'category'];var _0x1f08b2='';var _0x2e072b='';var _0x234d18=[];var _0x42f9d6='';var _0x48a81d='';var _0x57d342=[];var _0x4145bd='';var _0x500338='';var _0x55d109={};var _0x25c85d='';return db['ServicenowAccount'][_0x0021('0x45')]({'where':{'id':_0xd23047[_0x0021('0x43')]['id']},'attributes':['id',_0x0021('0x8e'),_0x0021('0x8f'),'email',_0x0021('0x90'),_0x0021('0x91')]})[_0x0021('0x25')](handleEntityNotFound(_0x50d34f,null))[_0x0021('0x25')](function(_0x3a3a1e){if(_0x3a3a1e){_0x25c85d=_0x3a3a1e['remoteUri'];var _0x1b779d=_0x25c85d[_0x0021('0x92')](-0x1);if(_0x1b779d==='/'){_0x25c85d=_0x25c85d['substring'](0x0,_0x25c85d[_0x0021('0x93')](_0x1b779d));}_0x500338=util[_0x0021('0x94')](_0x0021('0x95'),_0x25c85d);_0x4145bd=util['format'](_0x0021('0x96'),_0x25c85d);_0x55d109={'user':_0x3a3a1e[_0x0021('0x8e')],'pass':_0x3a3a1e['password']};var _0x4ba21a={'method':_0x0021('0x97'),'uri':_0x500338+_0x0021('0x98'),'auth':_0x55d109,'json':!![]};return rp(_0x4ba21a);}})['then'](function(_0x3812c0){if(_0x3812c0[_0x0021('0x99')]['length']>0x0){_0x1f08b2=_0x3812c0[_0x0021('0x99')];}console[_0x0021('0x9a')](_0x0021('0x9b'),_0x1f08b2);_0x57d342=[];_0x2e072b=Object[_0x0021('0x9c')]([],_0x1f08b2);_[_0x0021('0x9d')](_0x2e072b,function(_0x3afffd){return!_0x1bd68a[_0x0021('0x9e')](_0x3afffd[_0x0021('0x26')]);});_0x2e072b[_0x0021('0x9f')](function(_0x2a3d99){var _0x16c9d2=createFieldObject(_0x4145bd,_0x55d109,_0x2a3d99[_0x0021('0xa0')],_0x2a3d99[_0x0021('0x26')],_0x2a3d99[_0x0021('0xa1')],![]);_0x57d342[_0x0021('0xa2')](_0x16c9d2);});return Promise[_0x0021('0xa3')](_0x57d342);})['then'](function(_0x4e23d9){_0x234d18=_0x4e23d9;_0x42f9d6=Object['assign']([],_0x1f08b2);console[_0x0021('0x9a')]('TCL:\x20_object',_0x1f08b2);_['remove'](_0x42f9d6,function(_0x2b7963){return _0x47e2b6[_0x0021('0x9e')](_0x2b7963['name']);});console[_0x0021('0x9a')](_0x0021('0xa4'),_0x42f9d6);_0x57d342=[];_0x42f9d6[_0x0021('0x9f')](function(_0x44b0f4){var _0x5cfbc7=createFieldObject(_0x4145bd,_0x55d109,_0x44b0f4[_0x0021('0xa0')],_0x44b0f4['name'],_0x44b0f4['label'],!![]);_0x57d342[_0x0021('0xa2')](_0x5cfbc7);});return Promise[_0x0021('0xa3')](_0x57d342);})[_0x0021('0x25')](function(_0x18a301){_0x48a81d=_0x18a301;var _0x1255cb=_0x234d18['concat'](_0x48a81d);return{'count':_0x1255cb['length'],'rows':_0x1255cb};})[_0x0021('0x25')](respondWithResult(_0x50d34f,null))[_0x0021('0x40')](function(_0xbcf6e4){console['log'](_0x0021('0xa5')+_0xbcf6e4);var _0x363cff=_0xd23047[_0x0021('0x2c')][_0x0021('0xa6')]?0x1f4:_0xbcf6e4[_0x0021('0xa7')]||0x1f4;logger[_0x0021('0xa8')](_0xbcf6e4[_0x0021('0xa9')]);delete _0xbcf6e4[_0x0021('0x26')];if(_0x363cff===0x191){_0x363cff=0x190;}_0x50d34f[_0x0021('0x18')](_0x363cff)['send'](_0xd23047[_0x0021('0x2c')][_0x0021('0xa6')]?{'message':_0x0021('0xaa'),'statusCode':_0xbcf6e4[_0x0021('0xa7')]}:_0xbcf6e4);});};function createFieldObject(_0x1c7e39,_0x21ef62,_0x5af87a,_0x19fbf1,_0x45e4c8,_0x515e16){return new Promise(function(_0x492cb3,_0x2c09c6){var _0x2cf864={'id':_0x19fbf1,'name':_0x45e4c8,'custom':_0x515e16};if(_0x5af87a===_0x0021('0xab')){_0x2cf864[_0x0021('0x3a')]=[{'name':_0x0021('0xac'),'value':_0x0021('0xad')},{'name':_0x0021('0xae'),'value':_0x0021('0xaf')}];_0x492cb3(_0x2cf864);}else{var _0x3fda43={'method':_0x0021('0x97'),'uri':_0x1c7e39+'sys_choice?sysparm_query=name=incident^element='+_0x19fbf1,'auth':_0x21ef62,'json':!![]};return rp(_0x3fda43)[_0x0021('0x25')](function(_0x51bf8a){var _0xd55804=[];if(_0x51bf8a[_0x0021('0x99')]['length']>0x0){_0x51bf8a['result'][_0x0021('0x9f')](function(_0x5557a6){if(_0x5557a6[_0x0021('0xb0')]===_0x0021('0xaf')){var _0x430b91={'name':_0x5557a6[_0x0021('0xa1')],'value':_0x5557a6['value']};_0xd55804[_0x0021('0xa2')](_0x430b91);}});}_0x2cf864[_0x0021('0x3a')]=_0xd55804;if(_0x2cf864[_0x0021('0x3a')]['length']>0x0){_0x492cb3(_0x2cf864);}else{if(_0x515e16==![]){_0x492cb3();}else{_0x492cb3(_0x2cf864);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index a39eaed..55a2f95 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 _0x7c09=['rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2ca454,_0x285eb5){var _0xaa0037=function(_0x2eaef1){while(--_0x2eaef1){_0x2ca454['push'](_0x2ca454['shift']());}};_0xaa0037(++_0x285eb5);}(_0x7c09,0x102));var _0x97c0=function(_0x120a5b,_0x27936c){_0x120a5b=_0x120a5b-0x0;var _0x343e11=_0x7c09[_0x120a5b];return _0x343e11;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x590368,_0x46fdd9){return _0x590368[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18a5a5,_0x4469b7){var _0x112c7f=function(_0x33aa64){while(--_0x33aa64){_0x18a5a5['push'](_0x18a5a5['shift']());}};_0x112c7f(++_0x4469b7);}(_0x4975,0x86));var _0x5497=function(_0x4b754,_0x4251ed){_0x4b754=_0x4b754-0x0;var _0x472907=_0x4975[_0x4b754];return _0x472907;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('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 201813f..88f8d7f 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 _0x45dc=['where','limit','include','model','attributes','map','debug','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw'];(function(_0x586793,_0x275bd4){var _0xde76db=function(_0x5db252){while(--_0x5db252){_0x586793['push'](_0x586793['shift']());}};_0xde76db(++_0x275bd4);}(_0x45dc,0x139));var _0xc45d=function(_0x77b41c,_0x688c2e){_0x77b41c=_0x77b41c-0x0;var _0x1457a6=_0x45dc[_0x77b41c];return _0x1457a6;};'use strict';var _=require('lodash');var util=require(_0xc45d('0x0'));var moment=require(_0xc45d('0x1'));var BPromise=require(_0xc45d('0x2'));var rs=require(_0xc45d('0x3'));var fs=require('fs');var Redis=require(_0xc45d('0x4'));var db=require(_0xc45d('0x5'))['db'];var utils=require(_0xc45d('0x6'));var logger=require(_0xc45d('0x7'))(_0xc45d('0x8'));var config=require(_0xc45d('0x9'));var jayson=require(_0xc45d('0xa'));var client=jayson[_0xc45d('0xb')][_0xc45d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c2680,_0x2bb4ac,_0x4e000c){return new BPromise(function(_0x4ff577,_0x32be0d){return client[_0xc45d('0xd')](_0x9c2680,_0x4e000c)[_0xc45d('0xe')](function(_0x1c53d0){logger[_0xc45d('0xf')](_0xc45d('0x10'),_0x2bb4ac,_0xc45d('0x11'));logger['debug'](_0xc45d('0x12'),_0x2bb4ac,_0xc45d('0x11'),JSON[_0xc45d('0x13')](_0x1c53d0));if(_0x1c53d0[_0xc45d('0x14')]){if(_0x1c53d0[_0xc45d('0x14')][_0xc45d('0x15')]===0x1f4){logger[_0xc45d('0x14')](_0xc45d('0x10'),_0x2bb4ac,_0x1c53d0[_0xc45d('0x14')][_0xc45d('0x16')]);return _0x32be0d(_0x1c53d0[_0xc45d('0x14')][_0xc45d('0x16')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2bb4ac,_0x1c53d0[_0xc45d('0x14')]['message']);return _0x4ff577(_0x1c53d0[_0xc45d('0x14')][_0xc45d('0x16')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x2bb4ac,_0xc45d('0x11'));_0x4ff577(_0x1c53d0[_0xc45d('0x17')][_0xc45d('0x16')]);}})[_0xc45d('0x18')](function(_0x3470cf){logger[_0xc45d('0x14')](_0xc45d('0x10'),_0x2bb4ac,_0x3470cf);_0x32be0d(_0x3470cf);});});}exports[_0xc45d('0x19')]=function(_0x39ac8e){var _0x2168cf=this;return new Promise(function(_0x3c7a45,_0x3c9037){return db[_0xc45d('0x1a')]['findAll']({'raw':_0x39ac8e[_0xc45d('0x1b')]?_0x39ac8e[_0xc45d('0x1b')][_0xc45d('0x1c')]===undefined?!![]:![]:!![],'where':_0x39ac8e[_0xc45d('0x1b')]?_0x39ac8e[_0xc45d('0x1b')][_0xc45d('0x1d')]||null:null,'attributes':_0x39ac8e[_0xc45d('0x1b')]?_0x39ac8e[_0xc45d('0x1b')]['attributes']||null:null,'limit':_0x39ac8e[_0xc45d('0x1b')]?_0x39ac8e[_0xc45d('0x1b')][_0xc45d('0x1e')]||null:null,'include':_0x39ac8e[_0xc45d('0x1b')]?_0x39ac8e[_0xc45d('0x1b')]['include']?_['map'](_0x39ac8e[_0xc45d('0x1b')][_0xc45d('0x1f')],function(_0x311082){return{'model':db[_0x311082[_0xc45d('0x20')]],'as':_0x311082['as'],'attributes':_0x311082[_0xc45d('0x21')],'include':_0x311082['include']?_[_0xc45d('0x22')](_0x311082['include'],function(_0x3aaeeb){return{'model':db[_0x3aaeeb[_0xc45d('0x20')]],'as':_0x3aaeeb['as'],'attributes':_0x3aaeeb[_0xc45d('0x21')],'include':_0x3aaeeb['include']?_[_0xc45d('0x22')](_0x3aaeeb[_0xc45d('0x1f')],function(_0x51414c){return{'model':db[_0x51414c['model']],'as':_0x51414c['as'],'attributes':_0x51414c[_0xc45d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc45d('0xe')](function(_0x498605){logger['info'](_0xc45d('0x19'),_0x39ac8e);logger[_0xc45d('0x23')](_0xc45d('0x19'),_0x39ac8e,JSON[_0xc45d('0x13')](_0x498605));_0x3c7a45(_0x498605);})['catch'](function(_0x48e534){logger[_0xc45d('0x14')](_0xc45d('0x19'),_0x48e534['message'],_0x39ac8e);_0x3c9037(_0x2168cf[_0xc45d('0x14')](0x1f4,_0x48e534[_0xc45d('0x16')]));});});};exports[_0xc45d('0x24')]=function(_0xf6d0ac){var _0x1a5f05=this;return new Promise(function(_0x4a7715,_0x2e46fe){return db[_0xc45d('0x1a')][_0xc45d('0x25')]({'raw':_0xf6d0ac['options']?_0xf6d0ac[_0xc45d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xf6d0ac[_0xc45d('0x1b')]?_0xf6d0ac[_0xc45d('0x1b')][_0xc45d('0x1d')]||null:null,'attributes':_0xf6d0ac['options']?_0xf6d0ac['options']['attributes']||null:null,'include':_0xf6d0ac[_0xc45d('0x1b')]?_0xf6d0ac[_0xc45d('0x1b')][_0xc45d('0x1f')]?_[_0xc45d('0x22')](_0xf6d0ac[_0xc45d('0x1b')]['include'],function(_0x535d20){return{'model':db[_0x535d20['model']],'as':_0x535d20['as'],'attributes':_0x535d20[_0xc45d('0x21')],'include':_0x535d20[_0xc45d('0x1f')]?_['map'](_0x535d20[_0xc45d('0x1f')],function(_0x29bae6){return{'model':db[_0x29bae6['model']],'as':_0x29bae6['as'],'attributes':_0x29bae6[_0xc45d('0x21')],'include':_0x29bae6['include']?_[_0xc45d('0x22')](_0x29bae6[_0xc45d('0x1f')],function(_0xb76f89){return{'model':db[_0xb76f89[_0xc45d('0x20')]],'as':_0xb76f89['as'],'attributes':_0xb76f89['attributes']};}):[]};}):[]};}):[]:[]})[_0xc45d('0xe')](function(_0x4af385){logger[_0xc45d('0xf')](_0xc45d('0x24'),_0xf6d0ac);logger[_0xc45d('0x23')](_0xc45d('0x24'),_0xf6d0ac,JSON['stringify'](_0x4af385));_0x4a7715(_0x4af385);})['catch'](function(_0x1898b3){logger['error']('ShowServicenowAccount',_0x1898b3[_0xc45d('0x16')],_0xf6d0ac);_0x2e46fe(_0x1a5f05[_0xc45d('0x14')](0x1f4,_0x1898b3[_0xc45d('0x16')]));});});}; \ No newline at end of file +var _0x2020=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','catch','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2020,0xf7));var _0x0202=function(_0x861832,_0x57631d){_0x861832=_0x861832-0x0;var _0x36e6d2=_0x2020[_0x861832];return _0x36e6d2;};'use strict';var _=require('lodash');var util=require(_0x0202('0x0'));var moment=require(_0x0202('0x1'));var BPromise=require(_0x0202('0x2'));var rs=require(_0x0202('0x3'));var fs=require('fs');var Redis=require(_0x0202('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0202('0x5'));var logger=require(_0x0202('0x6'))(_0x0202('0x7'));var config=require(_0x0202('0x8'));var jayson=require(_0x0202('0x9'));var client=jayson[_0x0202('0xa')][_0x0202('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dca39,_0xf80c04,_0x4872a1){return new BPromise(function(_0x2a7ab9,_0x253918){return client[_0x0202('0xc')](_0x1dca39,_0x4872a1)[_0x0202('0xd')](function(_0x55b911){logger[_0x0202('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0xf80c04,_0x0202('0xf'));logger[_0x0202('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xf80c04,_0x0202('0xf'),JSON[_0x0202('0x11')](_0x55b911));if(_0x55b911[_0x0202('0x12')]){if(_0x55b911[_0x0202('0x12')][_0x0202('0x13')]===0x1f4){logger[_0x0202('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0xf80c04,_0x55b911[_0x0202('0x12')][_0x0202('0x14')]);return _0x253918(_0x55b911['error'][_0x0202('0x14')]);}logger[_0x0202('0x12')](_0x0202('0x15'),_0xf80c04,_0x55b911['error']['message']);return _0x2a7ab9(_0x55b911[_0x0202('0x12')][_0x0202('0x14')]);}else{logger['info'](_0x0202('0x15'),_0xf80c04,_0x0202('0xf'));_0x2a7ab9(_0x55b911['result']['message']);}})['catch'](function(_0xa3b9f6){logger[_0x0202('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0xf80c04,_0xa3b9f6);_0x253918(_0xa3b9f6);});});}exports['GetServicenowAccount']=function(_0xc3ca3e){var _0x3b10da=this;return new Promise(function(_0x101c1e,_0x5c6122){return db[_0x0202('0x16')][_0x0202('0x17')]({'raw':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x19')]===undefined?!![]:![]:!![],'where':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1a')]||null:null,'attributes':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e['options'][_0x0202('0x1b')]||null:null,'limit':_0xc3ca3e['options']?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1c')]||null:null,'include':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1d')]?_[_0x0202('0x1e')](_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1d')],function(_0x1163ad){return{'model':db[_0x1163ad['model']],'as':_0x1163ad['as'],'attributes':_0x1163ad[_0x0202('0x1b')],'include':_0x1163ad[_0x0202('0x1d')]?_[_0x0202('0x1e')](_0x1163ad[_0x0202('0x1d')],function(_0x2ea184){return{'model':db[_0x2ea184['model']],'as':_0x2ea184['as'],'attributes':_0x2ea184[_0x0202('0x1b')],'include':_0x2ea184['include']?_['map'](_0x2ea184['include'],function(_0x3a70e5){return{'model':db[_0x3a70e5[_0x0202('0x1f')]],'as':_0x3a70e5['as'],'attributes':_0x3a70e5[_0x0202('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0202('0xd')](function(_0x5335d7){logger[_0x0202('0xe')](_0x0202('0x20'),_0xc3ca3e);logger[_0x0202('0x10')]('GetServicenowAccount',_0xc3ca3e,JSON[_0x0202('0x11')](_0x5335d7));_0x101c1e(_0x5335d7);})[_0x0202('0x21')](function(_0x390caa){logger['error'](_0x0202('0x20'),_0x390caa[_0x0202('0x14')],_0xc3ca3e);_0x5c6122(_0x3b10da[_0x0202('0x12')](0x1f4,_0x390caa[_0x0202('0x14')]));});});};exports[_0x0202('0x22')]=function(_0x4d2b3b){var _0x22fd20=this;return new Promise(function(_0x17b2e6,_0x534296){return db[_0x0202('0x16')][_0x0202('0x23')]({'raw':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b[_0x0202('0x18')][_0x0202('0x19')]===undefined?!![]:![]:!![],'where':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b[_0x0202('0x18')]['where']||null:null,'attributes':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b[_0x0202('0x18')]['attributes']||null:null,'include':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b['options'][_0x0202('0x1d')]?_['map'](_0x4d2b3b[_0x0202('0x18')][_0x0202('0x1d')],function(_0x2cdb07){return{'model':db[_0x2cdb07[_0x0202('0x1f')]],'as':_0x2cdb07['as'],'attributes':_0x2cdb07[_0x0202('0x1b')],'include':_0x2cdb07[_0x0202('0x1d')]?_[_0x0202('0x1e')](_0x2cdb07[_0x0202('0x1d')],function(_0x21a7dc){return{'model':db[_0x21a7dc[_0x0202('0x1f')]],'as':_0x21a7dc['as'],'attributes':_0x21a7dc[_0x0202('0x1b')],'include':_0x21a7dc[_0x0202('0x1d')]?_[_0x0202('0x1e')](_0x21a7dc[_0x0202('0x1d')],function(_0x32c390){return{'model':db[_0x32c390[_0x0202('0x1f')]],'as':_0x32c390['as'],'attributes':_0x32c390['attributes']};}):[]};}):[]};}):[]:[]})[_0x0202('0xd')](function(_0x4cde9e){logger[_0x0202('0xe')]('ShowServicenowAccount',_0x4d2b3b);logger['debug']('ShowServicenowAccount',_0x4d2b3b,JSON['stringify'](_0x4cde9e));_0x17b2e6(_0x4cde9e);})[_0x0202('0x21')](function(_0x734d71){logger[_0x0202('0x12')](_0x0202('0x22'),_0x734d71[_0x0202('0x14')],_0x4d2b3b);_0x534296(_0x22fd20['error'](0x1f4,_0x734d71[_0x0202('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b4b34d9..6ccce21 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 _0xf99d=['index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x14e72c,_0x4b02b2){var _0x4e5dec=function(_0x1d4c52){while(--_0x1d4c52){_0x14e72c['push'](_0x14e72c['shift']());}};_0x4e5dec(++_0x4b02b2);}(_0xf99d,0xaf));var _0xdf99=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xf99d[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xdf99('0x0'));var util=require(_0xdf99('0x1'));var path=require(_0xdf99('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdf99('0x3')]();var fs_extra=require(_0xdf99('0x4'));var auth=require(_0xdf99('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf99('0x6'));router[_0xdf99('0x7')]('/',auth[_0xdf99('0x8')](),controller[_0xdf99('0x9')]);router['get'](_0xdf99('0xa'),auth[_0xdf99('0x8')](),controller['show']);router['get'](_0xdf99('0xb'),auth[_0xdf99('0x8')](),controller[_0xdf99('0xc')]);router[_0xdf99('0x7')](_0xdf99('0xd'),auth[_0xdf99('0x8')](),controller[_0xdf99('0xe')]);router[_0xdf99('0x7')](_0xdf99('0xf'),auth[_0xdf99('0x8')](),controller[_0xdf99('0x10')]);router[_0xdf99('0x11')]('/',auth[_0xdf99('0x8')](),controller[_0xdf99('0x12')]);router[_0xdf99('0x13')]('/:id',auth[_0xdf99('0x8')](),controller['update']);router[_0xdf99('0x14')]('/:id',auth[_0xdf99('0x8')](),controller[_0xdf99('0x15')]);module[_0xdf99('0x16')]=router; \ No newline at end of file +var _0x5ba7=['get','isAuthenticated','index','/:id','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x5477eb,_0x2b938a){var _0xcf34bc=function(_0x224624){while(--_0x224624){_0x5477eb['push'](_0x5477eb['shift']());}};_0xcf34bc(++_0x2b938a);}(_0x5ba7,0xe9));var _0x75ba=function(_0x473e68,_0x2a0711){_0x473e68=_0x473e68-0x0;var _0x7908e4=_0x5ba7[_0x473e68];return _0x7908e4;};'use strict';var multer=require(_0x75ba('0x0'));var util=require(_0x75ba('0x1'));var path=require(_0x75ba('0x2'));var timeout=require(_0x75ba('0x3'));var express=require(_0x75ba('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75ba('0x5'));var interaction=require(_0x75ba('0x6'));var config=require(_0x75ba('0x7'));var controller=require(_0x75ba('0x8'));router[_0x75ba('0x9')]('/',auth[_0x75ba('0xa')](),controller[_0x75ba('0xb')]);router[_0x75ba('0x9')](_0x75ba('0xc'),auth[_0x75ba('0xa')](),controller['show']);router[_0x75ba('0x9')]('/:id/fields',auth[_0x75ba('0xa')](),controller['getFields']);router[_0x75ba('0x9')]('/:id/subjects',auth[_0x75ba('0xa')](),controller['getSubjects']);router[_0x75ba('0x9')](_0x75ba('0xd'),auth[_0x75ba('0xa')](),controller[_0x75ba('0xe')]);router[_0x75ba('0xf')]('/',auth['isAuthenticated'](),controller[_0x75ba('0x10')]);router[_0x75ba('0x11')](_0x75ba('0xc'),auth[_0x75ba('0xa')](),controller[_0x75ba('0x12')]);router[_0x75ba('0x13')](_0x75ba('0xc'),auth[_0x75ba('0xa')](),controller[_0x75ba('0x14')]);module[_0x75ba('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 30e7c08..4473304 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 _0xbc47=['exports','STRING','sequelize'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0xbc47,0xd1));var _0x7bc4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xbc47[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x7bc4('0x0'));module[_0x7bc4('0x1')]={'name':{'type':Sequelize[_0x7bc4('0x2')]},'description':{'type':Sequelize[_0x7bc4('0x2')]}}; \ No newline at end of file +var _0xc046=['sequelize','exports','STRING'];(function(_0x2ada6a,_0x49cece){var _0x42b8fa=function(_0x503f4f){while(--_0x503f4f){_0x2ada6a['push'](_0x2ada6a['shift']());}};_0x42b8fa(++_0x49cece);}(_0xc046,0x1e9));var _0x6c04=function(_0x150491,_0x40ff70){_0x150491=_0x150491-0x0;var _0x2ecefe=_0xc046[_0x150491];return _0x2ecefe;};'use strict';var Sequelize=require(_0x6c04('0x0'));module[_0x6c04('0x1')]={'name':{'type':Sequelize[_0x6c04('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index c534a34..db7d736 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 _0x495e=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','ServicenowField','nolimit','pick','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x59ee29,_0x5f0e7b){var _0x375a51=function(_0x1e6721){while(--_0x1e6721){_0x59ee29['push'](_0x59ee29['shift']());}};_0x375a51(++_0x5f0e7b);}(_0x495e,0xe3));var _0xe495=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x495e[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0xe495('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe495('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe495('0x2'));var moment=require(_0xe495('0x3'));var BPromise=require(_0xe495('0x4'));var Mustache=require(_0xe495('0x5'));var util=require(_0xe495('0x6'));var path=require(_0xe495('0x7'));var sox=require(_0xe495('0x8'));var csv=require(_0xe495('0x9'));var ejs=require(_0xe495('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe495('0xb'));var squel=require('squel');var crypto=require(_0xe495('0xc'));var jsforce=require(_0xe495('0xd'));var deskjs=require(_0xe495('0xe'));var toCsv=require(_0xe495('0x9'));var querystring=require(_0xe495('0xf'));var Papa=require('papaparse');var Redis=require(_0xe495('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe495('0x11'));var hardwareService=require(_0xe495('0x12'));var logger=require(_0xe495('0x13'))(_0xe495('0x14'));var utils=require(_0xe495('0x15'));var config=require(_0xe495('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe495('0x17'))['db'];function respondWithStatusCode(_0x46fe66,_0x2caca4){_0x2caca4=_0x2caca4||0xcc;return function(_0x3df2d7){if(_0x3df2d7){return _0x46fe66[_0xe495('0x18')](_0x2caca4);}return _0x46fe66[_0xe495('0x19')](_0x2caca4)['end']();};}function respondWithResult(_0x5a0a7b,_0x309d6e){_0x309d6e=_0x309d6e||0xc8;return function(_0x4aaaaf){if(_0x4aaaaf){return _0x5a0a7b[_0xe495('0x19')](_0x309d6e)[_0xe495('0x1a')](_0x4aaaaf);}};}function respondWithFilteredResult(_0x14b64e,_0x4d76ee){return function(_0x2ef120){if(_0x2ef120){var _0x372e7e=typeof _0x4d76ee[_0xe495('0x1b')]===_0xe495('0x1c')&&typeof _0x4d76ee[_0xe495('0x1d')]===_0xe495('0x1c');var _0xe9f709=_0x2ef120[_0xe495('0x1e')];var _0x2ca3e2=_0x372e7e?0x0:_0x4d76ee[_0xe495('0x1b')];var _0x53e4f4=_0x372e7e?_0x2ef120[_0xe495('0x1e')]:_0x4d76ee[_0xe495('0x1b')]+_0x4d76ee['limit'];var _0x312c31;if(_0x53e4f4>=_0xe9f709){_0x53e4f4=_0xe9f709;_0x312c31=0xc8;}else{_0x312c31=0xce;}_0x14b64e[_0xe495('0x19')](_0x312c31);return _0x14b64e[_0xe495('0x1f')](_0xe495('0x20'),_0x2ca3e2+'-'+_0x53e4f4+'/'+_0xe9f709)['json'](_0x2ef120);}return null;};}function patchUpdates(_0x11ef8d){return function(_0x578a8b){try{jsonpatch[_0xe495('0x21')](_0x578a8b,_0x11ef8d,!![]);}catch(_0x5017db){return BPromise[_0xe495('0x22')](_0x5017db);}return _0x578a8b[_0xe495('0x23')]();};}function saveUpdates(_0x2bf3aa,_0x5467da){return function(_0x1238af){if(_0x1238af){return _0x1238af[_0xe495('0x24')](_0x2bf3aa)[_0xe495('0x25')](function(_0x453983){return _0x453983;});}return null;};}function removeEntity(_0x419daa,_0xa51a52){return function(_0x1e2e6f){if(_0x1e2e6f){return _0x1e2e6f[_0xe495('0x26')]()[_0xe495('0x25')](function(){_0x419daa[_0xe495('0x19')](0xcc)[_0xe495('0x27')]();});}};}function handleEntityNotFound(_0x1934e2,_0x13e4f6){return function(_0x3275fa){if(!_0x3275fa){_0x1934e2[_0xe495('0x18')](0x194);}return _0x3275fa;};}function handleError(_0x421383,_0x1ee18d){_0x1ee18d=_0x1ee18d||0x1f4;return function(_0x242a05){logger[_0xe495('0x28')](_0x242a05[_0xe495('0x29')]);if(_0x242a05[_0xe495('0x2a')]){delete _0x242a05['name'];}_0x421383[_0xe495('0x19')](_0x1ee18d)[_0xe495('0x2b')](_0x242a05);};}exports[_0xe495('0x2c')]=function(_0x1e73a0,_0xa3cb5e){var _0x3e507b={},_0x4eb48b={},_0x18bc2c={'count':0x0,'rows':[]};var _0x53b851=_[_0xe495('0x2d')](db[_0xe495('0x2e')][_0xe495('0x2f')],function(_0x214929){return{'name':_0x214929['fieldName'],'type':_0x214929[_0xe495('0x30')][_0xe495('0x31')]};});_0x4eb48b[_0xe495('0x32')]=_[_0xe495('0x2d')](_0x53b851,'name');_0x4eb48b[_0xe495('0x33')]=_[_0xe495('0x34')](_0x1e73a0[_0xe495('0x33')]);_0x4eb48b[_0xe495('0x35')]=_[_0xe495('0x36')](_0x4eb48b[_0xe495('0x32')],_0x4eb48b[_0xe495('0x33')]);_0x3e507b['attributes']=_['intersection'](_0x4eb48b[_0xe495('0x32')],qs[_0xe495('0x37')](_0x1e73a0[_0xe495('0x33')][_0xe495('0x37')]));_0x3e507b['attributes']=_0x3e507b[_0xe495('0x38')]['length']?_0x3e507b[_0xe495('0x38')]:_0x4eb48b[_0xe495('0x32')];if(!_0x1e73a0[_0xe495('0x33')][_0xe495('0x39')]('nolimit')){_0x3e507b[_0xe495('0x1d')]=qs['limit'](_0x1e73a0['query']['limit']);_0x3e507b[_0xe495('0x1b')]=qs[_0xe495('0x1b')](_0x1e73a0[_0xe495('0x33')]['offset']);}_0x3e507b[_0xe495('0x3a')]=qs[_0xe495('0x3b')](_0x1e73a0[_0xe495('0x33')][_0xe495('0x3b')]);_0x3e507b[_0xe495('0x3c')]=qs[_0xe495('0x35')](_['pick'](_0x1e73a0[_0xe495('0x33')],_0x4eb48b[_0xe495('0x35')]),_0x53b851);if(_0x1e73a0[_0xe495('0x33')][_0xe495('0x3d')]){_0x3e507b['where']=_[_0xe495('0x3e')](_0x3e507b[_0xe495('0x3c')],{'$or':_[_0xe495('0x2d')](_0x53b851,function(_0x3c1719){if(_0x3c1719[_0xe495('0x30')]!==_0xe495('0x3f')){var _0xda8fa5={};_0xda8fa5[_0x3c1719[_0xe495('0x2a')]]={'$like':'%'+_0x1e73a0[_0xe495('0x33')][_0xe495('0x3d')]+'%'};return _0xda8fa5;}})});}_0x3e507b=_[_0xe495('0x3e')]({},_0x3e507b,_0x1e73a0[_0xe495('0x40')]);var _0x3cef85={'where':_0x3e507b[_0xe495('0x3c')]};return db[_0xe495('0x2e')][_0xe495('0x1e')](_0x3cef85)[_0xe495('0x25')](function(_0x2bfe6c){_0x18bc2c['count']=_0x2bfe6c;if(_0x1e73a0[_0xe495('0x33')][_0xe495('0x41')]){_0x3e507b[_0xe495('0x42')]=[{'all':!![]}];}return db[_0xe495('0x2e')][_0xe495('0x43')](_0x3e507b);})[_0xe495('0x25')](function(_0xad8ade){_0x18bc2c[_0xe495('0x44')]=_0xad8ade;return _0x18bc2c;})[_0xe495('0x25')](respondWithFilteredResult(_0xa3cb5e,_0x3e507b))[_0xe495('0x45')](handleError(_0xa3cb5e,null));};exports[_0xe495('0x46')]=function(_0x36a73a,_0x331c98){var _0x471b5d={'raw':![],'where':{'id':_0x36a73a[_0xe495('0x47')]['id']}},_0x25fc22={};_0x25fc22[_0xe495('0x32')]=_[_0xe495('0x34')](db[_0xe495('0x2e')]['rawAttributes']);_0x25fc22[_0xe495('0x33')]=_[_0xe495('0x34')](_0x36a73a[_0xe495('0x33')]);_0x25fc22[_0xe495('0x35')]=_[_0xe495('0x36')](_0x25fc22[_0xe495('0x32')],_0x25fc22[_0xe495('0x33')]);_0x471b5d[_0xe495('0x38')]=_['intersection'](_0x25fc22[_0xe495('0x32')],qs['fields'](_0x36a73a[_0xe495('0x33')][_0xe495('0x37')]));_0x471b5d['attributes']=_0x471b5d[_0xe495('0x38')][_0xe495('0x48')]?_0x471b5d['attributes']:_0x25fc22[_0xe495('0x32')];if(_0x36a73a[_0xe495('0x33')][_0xe495('0x41')]){_0x471b5d[_0xe495('0x42')]=[{'all':!![]}];}_0x471b5d=_[_0xe495('0x3e')]({},_0x471b5d,_0x36a73a[_0xe495('0x40')]);return db['ServicenowConfiguration'][_0xe495('0x49')](_0x471b5d)['then'](handleEntityNotFound(_0x331c98,null))['then'](respondWithResult(_0x331c98,null))[_0xe495('0x45')](handleError(_0x331c98,null));};exports['create']=function(_0x142689,_0x4bc0a0){return db['ServicenowConfiguration'][_0xe495('0x4a')](_0x142689[_0xe495('0x4b')],{})['then'](respondWithResult(_0x4bc0a0,0xc9))[_0xe495('0x45')](handleError(_0x4bc0a0,null));};exports[_0xe495('0x24')]=function(_0x57df91,_0xd0289c){if(_0x57df91[_0xe495('0x4b')]['id']){delete _0x57df91['body']['id'];}return db[_0xe495('0x2e')][_0xe495('0x49')]({'where':{'id':_0x57df91['params']['id']}})['then'](handleEntityNotFound(_0xd0289c,null))['then'](saveUpdates(_0x57df91[_0xe495('0x4b')],null))[_0xe495('0x25')](respondWithResult(_0xd0289c,null))['catch'](handleError(_0xd0289c,null));};exports[_0xe495('0x26')]=function(_0x2427e9,_0x2b561e){return db[_0xe495('0x2e')][_0xe495('0x49')]({'where':{'id':_0x2427e9[_0xe495('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b561e,null))[_0xe495('0x25')](removeEntity(_0x2b561e,null))[_0xe495('0x45')](handleError(_0x2b561e,null));};exports[_0xe495('0x4c')]=function(_0x3a199c,_0x427104,_0x56e408){var _0x57797a={};var _0x19fec3={};var _0x51f274;var _0x3e2407;return db[_0xe495('0x2e')][_0xe495('0x4d')]({'where':{'id':_0x3a199c[_0xe495('0x47')]['id']}})['then'](handleEntityNotFound(_0x427104,null))[_0xe495('0x25')](function(_0x20bedf){if(_0x20bedf){_0x51f274=_0x20bedf;_0x19fec3[_0xe495('0x32')]=_[_0xe495('0x34')](db[_0xe495('0x4e')][_0xe495('0x2f')]);_0x19fec3['query']=_[_0xe495('0x34')](_0x3a199c[_0xe495('0x33')]);_0x19fec3[_0xe495('0x35')]=_['intersection'](_0x19fec3[_0xe495('0x32')],_0x19fec3[_0xe495('0x33')]);_0x57797a['attributes']=_[_0xe495('0x36')](_0x19fec3[_0xe495('0x32')],qs[_0xe495('0x37')](_0x3a199c['query'][_0xe495('0x37')]));_0x57797a['attributes']=_0x57797a[_0xe495('0x38')][_0xe495('0x48')]?_0x57797a[_0xe495('0x38')]:_0x19fec3[_0xe495('0x32')];_0x57797a['order']=qs[_0xe495('0x3b')](_0x3a199c[_0xe495('0x33')][_0xe495('0x3b')]);_0x57797a['where']=qs[_0xe495('0x35')](_['pick'](_0x3a199c[_0xe495('0x33')],_0x19fec3['filters']));if(_0x3a199c[_0xe495('0x33')]['filter']){_0x57797a[_0xe495('0x3c')]=_[_0xe495('0x3e')](_0x57797a[_0xe495('0x3c')],{'$or':_[_0xe495('0x2d')](_0x57797a[_0xe495('0x38')],function(_0xf6c740){var _0x19edf8={};_0x19edf8[_0xf6c740]={'$like':'%'+_0x3a199c[_0xe495('0x33')][_0xe495('0x3d')]+'%'};return _0x19edf8;})});}_0x57797a=_['merge']({},_0x57797a,_0x3a199c['options']);return _0x51f274[_0xe495('0x4c')](_0x57797a);}})[_0xe495('0x25')](function(_0x5abc1e){if(_0x5abc1e){_0x3e2407=_0x5abc1e[_0xe495('0x48')];if(!_0x3a199c[_0xe495('0x33')][_0xe495('0x39')](_0xe495('0x4f'))){_0x57797a[_0xe495('0x1d')]=qs[_0xe495('0x1d')](_0x3a199c[_0xe495('0x33')]['limit']);_0x57797a[_0xe495('0x1b')]=qs[_0xe495('0x1b')](_0x3a199c[_0xe495('0x33')][_0xe495('0x1b')]);}return _0x51f274[_0xe495('0x4c')](_0x57797a);}})[_0xe495('0x25')](function(_0x66d613){if(_0x66d613){return _0x66d613?{'count':_0x3e2407,'rows':_0x66d613}:null;}})['then'](respondWithResult(_0x427104,null))[_0xe495('0x45')](handleError(_0x427104,null));};exports['getSubjects']=function(_0x365e08,_0x2e7f7d,_0x13d221){var _0xfbc789={};var _0x1b8418={};var _0x565957;var _0x20953e;return db[_0xe495('0x2e')]['findOne']({'where':{'id':_0x365e08['params']['id']}})[_0xe495('0x25')](handleEntityNotFound(_0x2e7f7d,null))[_0xe495('0x25')](function(_0x2d7c46){if(_0x2d7c46){_0x565957=_0x2d7c46;_0x1b8418[_0xe495('0x32')]=_['keys'](db[_0xe495('0x4e')][_0xe495('0x2f')]);_0x1b8418['query']=_[_0xe495('0x34')](_0x365e08['query']);_0x1b8418[_0xe495('0x35')]=_[_0xe495('0x36')](_0x1b8418[_0xe495('0x32')],_0x1b8418[_0xe495('0x33')]);_0xfbc789[_0xe495('0x38')]=_['intersection'](_0x1b8418[_0xe495('0x32')],qs['fields'](_0x365e08[_0xe495('0x33')]['fields']));_0xfbc789['attributes']=_0xfbc789[_0xe495('0x38')][_0xe495('0x48')]?_0xfbc789[_0xe495('0x38')]:_0x1b8418[_0xe495('0x32')];_0xfbc789[_0xe495('0x3a')]=qs['sort'](_0x365e08[_0xe495('0x33')][_0xe495('0x3b')]);_0xfbc789[_0xe495('0x3c')]=qs[_0xe495('0x35')](_[_0xe495('0x50')](_0x365e08[_0xe495('0x33')],_0x1b8418['filters']));if(_0x365e08['query'][_0xe495('0x3d')]){_0xfbc789[_0xe495('0x3c')]=_[_0xe495('0x3e')](_0xfbc789['where'],{'$or':_[_0xe495('0x2d')](_0xfbc789[_0xe495('0x38')],function(_0x2e2e24){var _0x2debf3={};_0x2debf3[_0x2e2e24]={'$like':'%'+_0x365e08[_0xe495('0x33')][_0xe495('0x3d')]+'%'};return _0x2debf3;})});}_0xfbc789=_[_0xe495('0x3e')]({},_0xfbc789,_0x365e08[_0xe495('0x40')]);return _0x565957[_0xe495('0x51')](_0xfbc789);}})[_0xe495('0x25')](function(_0x78181d){if(_0x78181d){_0x20953e=_0x78181d[_0xe495('0x48')];if(!_0x365e08['query'][_0xe495('0x39')](_0xe495('0x4f'))){_0xfbc789['limit']=qs[_0xe495('0x1d')](_0x365e08[_0xe495('0x33')][_0xe495('0x1d')]);_0xfbc789[_0xe495('0x1b')]=qs[_0xe495('0x1b')](_0x365e08[_0xe495('0x33')][_0xe495('0x1b')]);}return _0x565957[_0xe495('0x51')](_0xfbc789);}})[_0xe495('0x25')](function(_0x369dab){if(_0x369dab){return _0x369dab?{'count':_0x20953e,'rows':_0x369dab}:null;}})[_0xe495('0x25')](respondWithResult(_0x2e7f7d,null))[_0xe495('0x45')](handleError(_0x2e7f7d,null));};exports['getDescriptions']=function(_0x17b03d,_0x15a554,_0x4968ba){var _0x1299ee={};var _0x3a0bcc={};var _0x216acb;var _0x5ea2ca;return db['ServicenowConfiguration'][_0xe495('0x4d')]({'where':{'id':_0x17b03d[_0xe495('0x47')]['id']}})[_0xe495('0x25')](handleEntityNotFound(_0x15a554,null))['then'](function(_0x3f03e9){if(_0x3f03e9){_0x216acb=_0x3f03e9;_0x3a0bcc[_0xe495('0x32')]=_[_0xe495('0x34')](db[_0xe495('0x4e')][_0xe495('0x2f')]);_0x3a0bcc['query']=_['keys'](_0x17b03d[_0xe495('0x33')]);_0x3a0bcc[_0xe495('0x35')]=_[_0xe495('0x36')](_0x3a0bcc[_0xe495('0x32')],_0x3a0bcc[_0xe495('0x33')]);_0x1299ee[_0xe495('0x38')]=_[_0xe495('0x36')](_0x3a0bcc[_0xe495('0x32')],qs[_0xe495('0x37')](_0x17b03d[_0xe495('0x33')][_0xe495('0x37')]));_0x1299ee[_0xe495('0x38')]=_0x1299ee[_0xe495('0x38')][_0xe495('0x48')]?_0x1299ee[_0xe495('0x38')]:_0x3a0bcc[_0xe495('0x32')];_0x1299ee['order']=qs[_0xe495('0x3b')](_0x17b03d[_0xe495('0x33')]['sort']);_0x1299ee['where']=qs[_0xe495('0x35')](_[_0xe495('0x50')](_0x17b03d[_0xe495('0x33')],_0x3a0bcc[_0xe495('0x35')]));if(_0x17b03d[_0xe495('0x33')][_0xe495('0x3d')]){_0x1299ee['where']=_[_0xe495('0x3e')](_0x1299ee['where'],{'$or':_[_0xe495('0x2d')](_0x1299ee['attributes'],function(_0x2f39d0){var _0x1888cc={};_0x1888cc[_0x2f39d0]={'$like':'%'+_0x17b03d['query'][_0xe495('0x3d')]+'%'};return _0x1888cc;})});}_0x1299ee=_[_0xe495('0x3e')]({},_0x1299ee,_0x17b03d[_0xe495('0x40')]);return _0x216acb['getDescriptions'](_0x1299ee);}})[_0xe495('0x25')](function(_0x41c8e0){if(_0x41c8e0){_0x5ea2ca=_0x41c8e0[_0xe495('0x48')];if(!_0x17b03d['query']['hasOwnProperty'](_0xe495('0x4f'))){_0x1299ee[_0xe495('0x1d')]=qs[_0xe495('0x1d')](_0x17b03d['query'][_0xe495('0x1d')]);_0x1299ee['offset']=qs['offset'](_0x17b03d[_0xe495('0x33')][_0xe495('0x1b')]);}return _0x216acb[_0xe495('0x52')](_0x1299ee);}})[_0xe495('0x25')](function(_0x39bf81){if(_0x39bf81){return _0x39bf81?{'count':_0x5ea2ca,'rows':_0x39bf81}:null;}})[_0xe495('0x25')](respondWithResult(_0x15a554,null))[_0xe495('0x45')](handleError(_0x15a554,null));}; \ No newline at end of file +var _0xe09f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','params','ServicenowConfiguration','includeAll','find','create','body','getFields','ServicenowField','filter','hasOwnProperty','findOne','order','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xbedbaa,_0x39d1e5){var _0x3eb1a2=function(_0xe3e1fb){while(--_0xe3e1fb){_0xbedbaa['push'](_0xbedbaa['shift']());}};_0x3eb1a2(++_0x39d1e5);}(_0xe09f,0x129));var _0xfe09=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe09f[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xfe09('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfe09('0x1'));var rp=require(_0xfe09('0x2'));var moment=require(_0xfe09('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe09('0x4'));var util=require('util');var path=require(_0xfe09('0x5'));var sox=require(_0xfe09('0x6'));var csv=require(_0xfe09('0x7'));var ejs=require(_0xfe09('0x8'));var fs=require('fs');var fs_extra=require(_0xfe09('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfe09('0xa'));var jsforce=require(_0xfe09('0xb'));var deskjs=require(_0xfe09('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfe09('0xd'));var Papa=require(_0xfe09('0xe'));var Redis=require('ioredis');var authService=require(_0xfe09('0xf'));var qs=require(_0xfe09('0x10'));var as=require(_0xfe09('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe09('0x12'))(_0xfe09('0x13'));var utils=require('../../config/utils');var config=require(_0xfe09('0x14'));var licenseUtil=require(_0xfe09('0x15'));var db=require(_0xfe09('0x16'))['db'];function respondWithStatusCode(_0x586d7a,_0x319598){_0x319598=_0x319598||0xcc;return function(_0x36df30){if(_0x36df30){return _0x586d7a[_0xfe09('0x17')](_0x319598);}return _0x586d7a[_0xfe09('0x18')](_0x319598)['end']();};}function respondWithResult(_0x3c4b1b,_0x187a03){_0x187a03=_0x187a03||0xc8;return function(_0x5e1792){if(_0x5e1792){return _0x3c4b1b[_0xfe09('0x18')](_0x187a03)[_0xfe09('0x19')](_0x5e1792);}};}function respondWithFilteredResult(_0x483769,_0x469f4f){return function(_0x1c9dc2){if(_0x1c9dc2){var _0x9e3f62=typeof _0x469f4f[_0xfe09('0x1a')]===_0xfe09('0x1b')&&typeof _0x469f4f['limit']===_0xfe09('0x1b');var _0x94ee65=_0x1c9dc2['count'];var _0x443a79=_0x9e3f62?0x0:_0x469f4f[_0xfe09('0x1a')];var _0x2c8047=_0x9e3f62?_0x1c9dc2[_0xfe09('0x1c')]:_0x469f4f[_0xfe09('0x1a')]+_0x469f4f[_0xfe09('0x1d')];var _0x562676;if(_0x2c8047>=_0x94ee65){_0x2c8047=_0x94ee65;_0x562676=0xc8;}else{_0x562676=0xce;}_0x483769[_0xfe09('0x18')](_0x562676);return _0x483769[_0xfe09('0x1e')](_0xfe09('0x1f'),_0x443a79+'-'+_0x2c8047+'/'+_0x94ee65)[_0xfe09('0x19')](_0x1c9dc2);}return null;};}function patchUpdates(_0x289599){return function(_0x1c1746){try{jsonpatch[_0xfe09('0x20')](_0x1c1746,_0x289599,!![]);}catch(_0x3ef1c4){return BPromise['reject'](_0x3ef1c4);}return _0x1c1746[_0xfe09('0x21')]();};}function saveUpdates(_0x3bc115,_0x1246f7){return function(_0x783331){if(_0x783331){return _0x783331[_0xfe09('0x22')](_0x3bc115)[_0xfe09('0x23')](function(_0x516c27){return _0x516c27;});}return null;};}function removeEntity(_0x29d684,_0x2cd205){return function(_0x2de70c){if(_0x2de70c){return _0x2de70c['destroy']()['then'](function(){_0x29d684[_0xfe09('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b14b8,_0x123ecb){return function(_0x175071){if(!_0x175071){_0x3b14b8[_0xfe09('0x17')](0x194);}return _0x175071;};}function handleError(_0x7157e,_0x5e04dd){_0x5e04dd=_0x5e04dd||0x1f4;return function(_0x296056){logger[_0xfe09('0x24')](_0x296056[_0xfe09('0x25')]);if(_0x296056['name']){delete _0x296056[_0xfe09('0x26')];}_0x7157e[_0xfe09('0x18')](_0x5e04dd)[_0xfe09('0x27')](_0x296056);};}exports['index']=function(_0x39dcc3,_0xa46a0e){var _0x669fd={},_0x2f9278={},_0x4528a8={'count':0x0,'rows':[]};var _0x31d86e=_[_0xfe09('0x28')](db['ServicenowConfiguration'][_0xfe09('0x29')],function(_0x4d54fe){return{'name':_0x4d54fe[_0xfe09('0x2a')],'type':_0x4d54fe[_0xfe09('0x2b')][_0xfe09('0x2c')]};});_0x2f9278[_0xfe09('0x2d')]=_['map'](_0x31d86e,'name');_0x2f9278[_0xfe09('0x2e')]=_[_0xfe09('0x2f')](_0x39dcc3[_0xfe09('0x2e')]);_0x2f9278[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x2f9278[_0xfe09('0x2d')],_0x2f9278[_0xfe09('0x2e')]);_0x669fd['attributes']=_['intersection'](_0x2f9278[_0xfe09('0x2d')],qs['fields'](_0x39dcc3[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x669fd[_0xfe09('0x33')]=_0x669fd[_0xfe09('0x33')][_0xfe09('0x34')]?_0x669fd[_0xfe09('0x33')]:_0x2f9278[_0xfe09('0x2d')];if(!_0x39dcc3[_0xfe09('0x2e')]['hasOwnProperty'](_0xfe09('0x35'))){_0x669fd[_0xfe09('0x1d')]=qs['limit'](_0x39dcc3['query']['limit']);_0x669fd[_0xfe09('0x1a')]=qs['offset'](_0x39dcc3[_0xfe09('0x2e')][_0xfe09('0x1a')]);}_0x669fd['order']=qs['sort'](_0x39dcc3['query'][_0xfe09('0x36')]);_0x669fd[_0xfe09('0x37')]=qs['filters'](_[_0xfe09('0x38')](_0x39dcc3['query'],_0x2f9278['filters']),_0x31d86e);if(_0x39dcc3['query']['filter']){_0x669fd['where']=_['merge'](_0x669fd['where'],{'$or':_[_0xfe09('0x28')](_0x31d86e,function(_0x453ed5){if(_0x453ed5[_0xfe09('0x2b')]!==_0xfe09('0x39')){var _0x51cf65={};_0x51cf65[_0x453ed5[_0xfe09('0x26')]]={'$like':'%'+_0x39dcc3[_0xfe09('0x2e')]['filter']+'%'};return _0x51cf65;}})});}_0x669fd=_[_0xfe09('0x3a')]({},_0x669fd,_0x39dcc3[_0xfe09('0x3b')]);var _0x3501a1={'where':_0x669fd[_0xfe09('0x37')]};return db['ServicenowConfiguration'][_0xfe09('0x1c')](_0x3501a1)[_0xfe09('0x23')](function(_0x2ab79e){_0x4528a8[_0xfe09('0x1c')]=_0x2ab79e;if(_0x39dcc3[_0xfe09('0x2e')]['includeAll']){_0x669fd[_0xfe09('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xfe09('0x3d')](_0x669fd);})['then'](function(_0x4d4ff3){_0x4528a8[_0xfe09('0x3e')]=_0x4d4ff3;return _0x4528a8;})[_0xfe09('0x23')](respondWithFilteredResult(_0xa46a0e,_0x669fd))[_0xfe09('0x3f')](handleError(_0xa46a0e,null));};exports['show']=function(_0x1fca86,_0x20bbaa){var _0x5f5bea={'raw':![],'where':{'id':_0x1fca86[_0xfe09('0x40')]['id']}},_0x565b7d={};_0x565b7d['model']=_[_0xfe09('0x2f')](db[_0xfe09('0x41')]['rawAttributes']);_0x565b7d[_0xfe09('0x2e')]=_['keys'](_0x1fca86[_0xfe09('0x2e')]);_0x565b7d[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x565b7d['model'],_0x565b7d[_0xfe09('0x2e')]);_0x5f5bea[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x565b7d['model'],qs[_0xfe09('0x32')](_0x1fca86[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x5f5bea[_0xfe09('0x33')]=_0x5f5bea['attributes']['length']?_0x5f5bea[_0xfe09('0x33')]:_0x565b7d[_0xfe09('0x2d')];if(_0x1fca86[_0xfe09('0x2e')][_0xfe09('0x42')]){_0x5f5bea[_0xfe09('0x3c')]=[{'all':!![]}];}_0x5f5bea=_[_0xfe09('0x3a')]({},_0x5f5bea,_0x1fca86[_0xfe09('0x3b')]);return db['ServicenowConfiguration'][_0xfe09('0x43')](_0x5f5bea)['then'](handleEntityNotFound(_0x20bbaa,null))[_0xfe09('0x23')](respondWithResult(_0x20bbaa,null))[_0xfe09('0x3f')](handleError(_0x20bbaa,null));};exports[_0xfe09('0x44')]=function(_0x48eed0,_0x46ca76){return db['ServicenowConfiguration'][_0xfe09('0x44')](_0x48eed0[_0xfe09('0x45')],{})[_0xfe09('0x23')](respondWithResult(_0x46ca76,0xc9))['catch'](handleError(_0x46ca76,null));};exports[_0xfe09('0x22')]=function(_0x31e390,_0x5099e5){if(_0x31e390[_0xfe09('0x45')]['id']){delete _0x31e390[_0xfe09('0x45')]['id'];}return db[_0xfe09('0x41')][_0xfe09('0x43')]({'where':{'id':_0x31e390[_0xfe09('0x40')]['id']}})[_0xfe09('0x23')](handleEntityNotFound(_0x5099e5,null))['then'](saveUpdates(_0x31e390[_0xfe09('0x45')],null))[_0xfe09('0x23')](respondWithResult(_0x5099e5,null))[_0xfe09('0x3f')](handleError(_0x5099e5,null));};exports['destroy']=function(_0x3f296a,_0x1c8633){return db[_0xfe09('0x41')][_0xfe09('0x43')]({'where':{'id':_0x3f296a['params']['id']}})['then'](handleEntityNotFound(_0x1c8633,null))['then'](removeEntity(_0x1c8633,null))[_0xfe09('0x3f')](handleError(_0x1c8633,null));};exports[_0xfe09('0x46')]=function(_0x1e769d,_0x45ce40,_0x3119b5){var _0x3c9a2f={};var _0x1423ec={};var _0x321b91;var _0x416ab1;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1e769d['params']['id']}})['then'](handleEntityNotFound(_0x45ce40,null))[_0xfe09('0x23')](function(_0x362f2b){if(_0x362f2b){_0x321b91=_0x362f2b;_0x1423ec[_0xfe09('0x2d')]=_[_0xfe09('0x2f')](db[_0xfe09('0x47')][_0xfe09('0x29')]);_0x1423ec['query']=_['keys'](_0x1e769d[_0xfe09('0x2e')]);_0x1423ec[_0xfe09('0x30')]=_['intersection'](_0x1423ec[_0xfe09('0x2d')],_0x1423ec[_0xfe09('0x2e')]);_0x3c9a2f[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x1423ec['model'],qs[_0xfe09('0x32')](_0x1e769d[_0xfe09('0x2e')]['fields']));_0x3c9a2f['attributes']=_0x3c9a2f['attributes'][_0xfe09('0x34')]?_0x3c9a2f['attributes']:_0x1423ec[_0xfe09('0x2d')];_0x3c9a2f['order']=qs[_0xfe09('0x36')](_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x36')]);_0x3c9a2f[_0xfe09('0x37')]=qs[_0xfe09('0x30')](_[_0xfe09('0x38')](_0x1e769d[_0xfe09('0x2e')],_0x1423ec[_0xfe09('0x30')]));if(_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x48')]){_0x3c9a2f[_0xfe09('0x37')]=_[_0xfe09('0x3a')](_0x3c9a2f[_0xfe09('0x37')],{'$or':_[_0xfe09('0x28')](_0x3c9a2f[_0xfe09('0x33')],function(_0x3538b5){var _0x5c971b={};_0x5c971b[_0x3538b5]={'$like':'%'+_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x48')]+'%'};return _0x5c971b;})});}_0x3c9a2f=_[_0xfe09('0x3a')]({},_0x3c9a2f,_0x1e769d['options']);return _0x321b91[_0xfe09('0x46')](_0x3c9a2f);}})[_0xfe09('0x23')](function(_0x49850c){if(_0x49850c){_0x416ab1=_0x49850c['length'];if(!_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x49')]('nolimit')){_0x3c9a2f[_0xfe09('0x1d')]=qs[_0xfe09('0x1d')](_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x1d')]);_0x3c9a2f[_0xfe09('0x1a')]=qs[_0xfe09('0x1a')](_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x1a')]);}return _0x321b91[_0xfe09('0x46')](_0x3c9a2f);}})[_0xfe09('0x23')](function(_0x275b87){if(_0x275b87){return _0x275b87?{'count':_0x416ab1,'rows':_0x275b87}:null;}})[_0xfe09('0x23')](respondWithResult(_0x45ce40,null))[_0xfe09('0x3f')](handleError(_0x45ce40,null));};exports['getSubjects']=function(_0x58eeca,_0xabbc41,_0x558962){var _0x2e1a6e={};var _0x14e54c={};var _0x227a1f;var _0x5c1b85;return db[_0xfe09('0x41')][_0xfe09('0x4a')]({'where':{'id':_0x58eeca[_0xfe09('0x40')]['id']}})[_0xfe09('0x23')](handleEntityNotFound(_0xabbc41,null))[_0xfe09('0x23')](function(_0x59677d){if(_0x59677d){_0x227a1f=_0x59677d;_0x14e54c[_0xfe09('0x2d')]=_[_0xfe09('0x2f')](db[_0xfe09('0x47')][_0xfe09('0x29')]);_0x14e54c['query']=_[_0xfe09('0x2f')](_0x58eeca[_0xfe09('0x2e')]);_0x14e54c[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x14e54c[_0xfe09('0x2d')],_0x14e54c[_0xfe09('0x2e')]);_0x2e1a6e[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x14e54c[_0xfe09('0x2d')],qs['fields'](_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x2e1a6e[_0xfe09('0x33')]=_0x2e1a6e[_0xfe09('0x33')][_0xfe09('0x34')]?_0x2e1a6e['attributes']:_0x14e54c[_0xfe09('0x2d')];_0x2e1a6e[_0xfe09('0x4b')]=qs['sort'](_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x36')]);_0x2e1a6e['where']=qs['filters'](_['pick'](_0x58eeca[_0xfe09('0x2e')],_0x14e54c[_0xfe09('0x30')]));if(_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x48')]){_0x2e1a6e[_0xfe09('0x37')]=_[_0xfe09('0x3a')](_0x2e1a6e['where'],{'$or':_[_0xfe09('0x28')](_0x2e1a6e['attributes'],function(_0x1ce156){var _0x28969b={};_0x28969b[_0x1ce156]={'$like':'%'+_0x58eeca['query']['filter']+'%'};return _0x28969b;})});}_0x2e1a6e=_[_0xfe09('0x3a')]({},_0x2e1a6e,_0x58eeca[_0xfe09('0x3b')]);return _0x227a1f[_0xfe09('0x4c')](_0x2e1a6e);}})[_0xfe09('0x23')](function(_0x175cc0){if(_0x175cc0){_0x5c1b85=_0x175cc0[_0xfe09('0x34')];if(!_0x58eeca[_0xfe09('0x2e')]['hasOwnProperty'](_0xfe09('0x35'))){_0x2e1a6e[_0xfe09('0x1d')]=qs[_0xfe09('0x1d')](_0x58eeca[_0xfe09('0x2e')]['limit']);_0x2e1a6e[_0xfe09('0x1a')]=qs[_0xfe09('0x1a')](_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x1a')]);}return _0x227a1f[_0xfe09('0x4c')](_0x2e1a6e);}})[_0xfe09('0x23')](function(_0x7d4bef){if(_0x7d4bef){return _0x7d4bef?{'count':_0x5c1b85,'rows':_0x7d4bef}:null;}})[_0xfe09('0x23')](respondWithResult(_0xabbc41,null))['catch'](handleError(_0xabbc41,null));};exports[_0xfe09('0x4d')]=function(_0xb631dc,_0x527023,_0xed67f2){var _0x13d53e={};var _0x102dc3={};var _0x1917a5;var _0x3b4256;return db[_0xfe09('0x41')][_0xfe09('0x4a')]({'where':{'id':_0xb631dc['params']['id']}})['then'](handleEntityNotFound(_0x527023,null))[_0xfe09('0x23')](function(_0x1b09a2){if(_0x1b09a2){_0x1917a5=_0x1b09a2;_0x102dc3['model']=_[_0xfe09('0x2f')](db[_0xfe09('0x47')]['rawAttributes']);_0x102dc3[_0xfe09('0x2e')]=_[_0xfe09('0x2f')](_0xb631dc[_0xfe09('0x2e')]);_0x102dc3[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x102dc3[_0xfe09('0x2d')],_0x102dc3['query']);_0x13d53e[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x102dc3[_0xfe09('0x2d')],qs[_0xfe09('0x32')](_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x13d53e[_0xfe09('0x33')]=_0x13d53e['attributes'][_0xfe09('0x34')]?_0x13d53e[_0xfe09('0x33')]:_0x102dc3['model'];_0x13d53e[_0xfe09('0x4b')]=qs[_0xfe09('0x36')](_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x36')]);_0x13d53e[_0xfe09('0x37')]=qs[_0xfe09('0x30')](_[_0xfe09('0x38')](_0xb631dc[_0xfe09('0x2e')],_0x102dc3[_0xfe09('0x30')]));if(_0xb631dc['query'][_0xfe09('0x48')]){_0x13d53e[_0xfe09('0x37')]=_[_0xfe09('0x3a')](_0x13d53e['where'],{'$or':_[_0xfe09('0x28')](_0x13d53e[_0xfe09('0x33')],function(_0x436dab){var _0x1c7db4={};_0x1c7db4[_0x436dab]={'$like':'%'+_0xb631dc['query'][_0xfe09('0x48')]+'%'};return _0x1c7db4;})});}_0x13d53e=_['merge']({},_0x13d53e,_0xb631dc[_0xfe09('0x3b')]);return _0x1917a5[_0xfe09('0x4d')](_0x13d53e);}})[_0xfe09('0x23')](function(_0xa0943c){if(_0xa0943c){_0x3b4256=_0xa0943c[_0xfe09('0x34')];if(!_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x49')](_0xfe09('0x35'))){_0x13d53e[_0xfe09('0x1d')]=qs[_0xfe09('0x1d')](_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x1d')]);_0x13d53e[_0xfe09('0x1a')]=qs[_0xfe09('0x1a')](_0xb631dc['query'][_0xfe09('0x1a')]);}return _0x1917a5[_0xfe09('0x4d')](_0x13d53e);}})[_0xfe09('0x23')](function(_0x3d5c3e){if(_0x3d5c3e){return _0x3d5c3e?{'count':_0x3b4256,'rows':_0x3d5c3e}:null;}})['then'](respondWithResult(_0x527023,null))['catch'](handleError(_0x527023,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 334a4b4..76d387b 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 _0x2d93=['../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x239515,_0x4fa0d3){var _0x54cce4=function(_0x105010){while(--_0x105010){_0x239515['push'](_0x239515['shift']());}};_0x54cce4(++_0x4fa0d3);}(_0x2d93,0xf3));var _0x32d9=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x2d93[_0x234ae1];return _0x227ba0;};'use strict';var _=require(_0x32d9('0x0'));var util=require(_0x32d9('0x1'));var logger=require(_0x32d9('0x2'))(_0x32d9('0x3'));var moment=require(_0x32d9('0x4'));var BPromise=require(_0x32d9('0x5'));var rp=require(_0x32d9('0x6'));var fs=require('fs');var path=require(_0x32d9('0x7'));var rimraf=require(_0x32d9('0x8'));var config=require(_0x32d9('0x9'));var attributes=require(_0x32d9('0xa'));module[_0x32d9('0xb')]=function(_0x9b4979,_0x3529db){return _0x9b4979['define'](_0x32d9('0xc'),attributes,{'tableName':_0x32d9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab40=['rimraf','../../config/environment','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','bluebird','request-promise','path'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0xab40,0xcd));var _0x0ab4=function(_0x30cae1,_0x451b0a){_0x30cae1=_0x30cae1-0x0;var _0x437450=_0xab40[_0x30cae1];return _0x437450;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require(_0x0ab4('0x4'));var rimraf=require(_0x0ab4('0x5'));var config=require(_0x0ab4('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x28b17a,_0x4ba9d2){return _0x28b17a[_0x0ab4('0x7')](_0x0ab4('0x8'),attributes,{'tableName':_0x0ab4('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 3685e59..7f8ffad 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 _0xfef9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','bluebird'];(function(_0x2b58c6,_0x20fa8c){var _0x3bdb8c=function(_0x100ac7){while(--_0x100ac7){_0x2b58c6['push'](_0x2b58c6['shift']());}};_0x3bdb8c(++_0x20fa8c);}(_0xfef9,0xcc));var _0x9fef=function(_0x2316b9,_0x87059b){_0x2316b9=_0x2316b9-0x0;var _0x4405a9=_0xfef9[_0x2316b9];return _0x4405a9;};'use strict';var _=require(_0x9fef('0x0'));var util=require('util');var moment=require(_0x9fef('0x1'));var BPromise=require(_0x9fef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fef('0x3'));var db=require(_0x9fef('0x4'))['db'];var utils=require(_0x9fef('0x5'));var logger=require(_0x9fef('0x6'))(_0x9fef('0x7'));var config=require(_0x9fef('0x8'));var jayson=require(_0x9fef('0x9'));var client=jayson[_0x9fef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e19f0,_0x209d3a,_0x1a6d91){return new BPromise(function(_0x49a1b3,_0x1d67e5){return client[_0x9fef('0xb')](_0x2e19f0,_0x1a6d91)[_0x9fef('0xc')](function(_0x3d926e){logger[_0x9fef('0xd')](_0x9fef('0xe'),_0x209d3a,'request\x20sent');logger[_0x9fef('0xf')](_0x9fef('0x10'),_0x209d3a,'request\x20sent',JSON[_0x9fef('0x11')](_0x3d926e));if(_0x3d926e[_0x9fef('0x12')]){if(_0x3d926e[_0x9fef('0x12')][_0x9fef('0x13')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x209d3a,_0x3d926e[_0x9fef('0x12')]['message']);return _0x1d67e5(_0x3d926e[_0x9fef('0x12')][_0x9fef('0x14')]);}logger['error'](_0x9fef('0xe'),_0x209d3a,_0x3d926e[_0x9fef('0x12')]['message']);return _0x49a1b3(_0x3d926e['error']['message']);}else{logger[_0x9fef('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x209d3a,_0x9fef('0x15'));_0x49a1b3(_0x3d926e['result'][_0x9fef('0x14')]);}})[_0x9fef('0x16')](function(_0x4be302){logger[_0x9fef('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x209d3a,_0x4be302);_0x1d67e5(_0x4be302);});});} \ No newline at end of file +var _0x9797=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x346df1,_0x10fe5d){var _0xba7da6=function(_0x2a75c6){while(--_0x2a75c6){_0x346df1['push'](_0x346df1['shift']());}};_0xba7da6(++_0x10fe5d);}(_0x9797,0x1c9));var _0x7979=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x9797[_0x3ae96c];return _0x1b0c90;};'use strict';var _=require(_0x7979('0x0'));var util=require(_0x7979('0x1'));var moment=require(_0x7979('0x2'));var BPromise=require('bluebird');var rs=require(_0x7979('0x3'));var fs=require('fs');var Redis=require(_0x7979('0x4'));var db=require(_0x7979('0x5'))['db'];var utils=require(_0x7979('0x6'));var logger=require(_0x7979('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7979('0x8'));var client=jayson[_0x7979('0x9')][_0x7979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20c280,_0x48ac8e,_0x8dbe35){return new BPromise(function(_0x391f8a,_0xf8c40){return client[_0x7979('0xb')](_0x20c280,_0x8dbe35)[_0x7979('0xc')](function(_0x530d18){logger['info'](_0x7979('0xd'),_0x48ac8e,_0x7979('0xe'));logger[_0x7979('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x48ac8e,'request\x20sent',JSON[_0x7979('0x10')](_0x530d18));if(_0x530d18[_0x7979('0x11')]){if(_0x530d18[_0x7979('0x11')][_0x7979('0x12')]===0x1f4){logger[_0x7979('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x48ac8e,_0x530d18['error'][_0x7979('0x13')]);return _0xf8c40(_0x530d18['error']['message']);}logger[_0x7979('0x11')](_0x7979('0xd'),_0x48ac8e,_0x530d18[_0x7979('0x11')]['message']);return _0x391f8a(_0x530d18[_0x7979('0x11')][_0x7979('0x13')]);}else{logger[_0x7979('0x14')](_0x7979('0xd'),_0x48ac8e,'request\x20sent');_0x391f8a(_0x530d18[_0x7979('0x15')][_0x7979('0x13')]);}})[_0x7979('0x16')](function(_0x27f44a){logger[_0x7979('0x11')](_0x7979('0xd'),_0x48ac8e,_0x27f44a);_0xf8c40(_0x27f44a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index dbe0d08..40e4f2e 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 _0x24dd=['update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','get','/:id','isAuthenticated','show','create','put'];(function(_0x4e8dba,_0x2793b3){var _0x18f12e=function(_0x4922d7){while(--_0x4922d7){_0x4e8dba['push'](_0x4e8dba['shift']());}};_0x18f12e(++_0x2793b3);}(_0x24dd,0x133));var _0xd24d=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x24dd[_0x543084];return _0x306a57;};'use strict';var multer=require(_0xd24d('0x0'));var util=require(_0xd24d('0x1'));var path=require(_0xd24d('0x2'));var timeout=require('connect-timeout');var express=require(_0xd24d('0x3'));var router=express[_0xd24d('0x4')]();var fs_extra=require(_0xd24d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd24d('0x6'));var config=require(_0xd24d('0x7'));var controller=require(_0xd24d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd24d('0x9')]);router[_0xd24d('0xa')](_0xd24d('0xb'),auth[_0xd24d('0xc')](),controller[_0xd24d('0xd')]);router['post']('/',auth[_0xd24d('0xc')](),controller[_0xd24d('0xe')]);router[_0xd24d('0xf')](_0xd24d('0xb'),auth['isAuthenticated'](),controller[_0xd24d('0x10')]);router['delete'](_0xd24d('0xb'),auth['isAuthenticated'](),controller[_0xd24d('0x11')]);module[_0xd24d('0x12')]=router; \ No newline at end of file +var _0x5555=['../../config/environment','get','index','/:id','isAuthenticated','post','create','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x20cbae,_0x5932c4){var _0x2c8137=function(_0x3bd714){while(--_0x3bd714){_0x20cbae['push'](_0x20cbae['shift']());}};_0x2c8137(++_0x5932c4);}(_0x5555,0x169));var _0x5555=function(_0x4ee3a4,_0x1b06c9){_0x4ee3a4=_0x4ee3a4-0x0;var _0x11e3ec=_0x5555[_0x4ee3a4];return _0x11e3ec;};'use strict';var multer=require(_0x5555('0x0'));var util=require(_0x5555('0x1'));var path=require(_0x5555('0x2'));var timeout=require(_0x5555('0x3'));var express=require(_0x5555('0x4'));var router=express[_0x5555('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5555('0x6'));var config=require(_0x5555('0x7'));var controller=require('./intServicenowField.controller');router[_0x5555('0x8')]('/',auth['isAuthenticated'](),controller[_0x5555('0x9')]);router[_0x5555('0x8')](_0x5555('0xa'),auth[_0x5555('0xb')](),controller['show']);router[_0x5555('0xc')]('/',auth[_0x5555('0xb')](),controller[_0x5555('0xd')]);router['put'](_0x5555('0xa'),auth[_0x5555('0xb')](),controller[_0x5555('0xe')]);router['delete'](_0x5555('0xa'),auth['isAuthenticated'](),controller[_0x5555('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index fb9dc1c..2bee6a0 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 _0xd2ce=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x4d1817,_0x500c7b){var _0x3bcb4f=function(_0x3b6950){while(--_0x3b6950){_0x4d1817['push'](_0x4d1817['shift']());}};_0x3bcb4f(++_0x500c7b);}(_0xd2ce,0x89));var _0xed2c=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xd2ce[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0xed2c('0x0'));module['exports']={'type':{'type':Sequelize[_0xed2c('0x1')]('string',_0xed2c('0x2'),_0xed2c('0x3'),_0xed2c('0x4'),'picklist'),'defaultValue':_0xed2c('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xed2c('0x6')]},'keyType':{'type':Sequelize[_0xed2c('0x1')](_0xed2c('0x5'),_0xed2c('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xed2c('0x6')]},'idField':{'type':Sequelize[_0xed2c('0x6')]},'nameField':{'type':Sequelize[_0xed2c('0x6')]},'customField':{'type':Sequelize[_0xed2c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xed2c('0x6')]}}; \ No newline at end of file +var _0xf2ea=['exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0xf2ea,0x1ce));var _0xaf2e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf2ea[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require('sequelize');module[_0xaf2e('0x0')]={'type':{'type':Sequelize[_0xaf2e('0x1')](_0xaf2e('0x2'),_0xaf2e('0x3'),'customVariable',_0xaf2e('0x4'),'picklist'),'defaultValue':_0xaf2e('0x2')},'content':{'type':Sequelize[_0xaf2e('0x5')]},'key':{'type':Sequelize[_0xaf2e('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xaf2e('0x6'))},'keyContent':{'type':Sequelize[_0xaf2e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaf2e('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf2e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 09bf608..d4f9e2b 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 _0x6243=['attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','rimraf','fast-json-patch','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/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','keys','query','filters','intersection'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x6243,0xef));var _0x3624=function(_0x6e77c8,_0x1193b7){_0x6e77c8=_0x6e77c8-0x0;var _0x19e6d8=_0x6243[_0x6e77c8];return _0x19e6d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3624('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3624('0x1'));var rp=require(_0x3624('0x2'));var moment=require(_0x3624('0x3'));var BPromise=require(_0x3624('0x4'));var Mustache=require(_0x3624('0x5'));var util=require(_0x3624('0x6'));var path=require(_0x3624('0x7'));var sox=require(_0x3624('0x8'));var csv=require(_0x3624('0x9'));var ejs=require(_0x3624('0xa'));var fs=require('fs');var fs_extra=require(_0x3624('0xb'));var _=require(_0x3624('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3624('0xd'));var toCsv=require(_0x3624('0x9'));var querystring=require(_0x3624('0xe'));var Papa=require(_0x3624('0xf'));var Redis=require(_0x3624('0x10'));var authService=require(_0x3624('0x11'));var qs=require(_0x3624('0x12'));var as=require(_0x3624('0x13'));var hardwareService=require(_0x3624('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3624('0x15'));var config=require(_0x3624('0x16'));var licenseUtil=require(_0x3624('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a4d19,_0x22aae1){_0x22aae1=_0x22aae1||0xcc;return function(_0x82076b){if(_0x82076b){return _0x4a4d19[_0x3624('0x18')](_0x22aae1);}return _0x4a4d19[_0x3624('0x19')](_0x22aae1)[_0x3624('0x1a')]();};}function respondWithResult(_0x5f1e69,_0x1b67ba){_0x1b67ba=_0x1b67ba||0xc8;return function(_0xb9804){if(_0xb9804){return _0x5f1e69[_0x3624('0x19')](_0x1b67ba)[_0x3624('0x1b')](_0xb9804);}};}function respondWithFilteredResult(_0x34fa85,_0x237268){return function(_0x20412a){if(_0x20412a){var _0x479e6e=typeof _0x237268[_0x3624('0x1c')]==='undefined'&&typeof _0x237268[_0x3624('0x1d')]===_0x3624('0x1e');var _0x567101=_0x20412a['count'];var _0x41316a=_0x479e6e?0x0:_0x237268[_0x3624('0x1c')];var _0x4fc100=_0x479e6e?_0x20412a[_0x3624('0x1f')]:_0x237268[_0x3624('0x1c')]+_0x237268[_0x3624('0x1d')];var _0x374c6c;if(_0x4fc100>=_0x567101){_0x4fc100=_0x567101;_0x374c6c=0xc8;}else{_0x374c6c=0xce;}_0x34fa85[_0x3624('0x19')](_0x374c6c);return _0x34fa85['set'](_0x3624('0x20'),_0x41316a+'-'+_0x4fc100+'/'+_0x567101)[_0x3624('0x1b')](_0x20412a);}return null;};}function patchUpdates(_0x33704a){return function(_0x22041b){try{jsonpatch[_0x3624('0x21')](_0x22041b,_0x33704a,!![]);}catch(_0x2babf0){return BPromise[_0x3624('0x22')](_0x2babf0);}return _0x22041b[_0x3624('0x23')]();};}function saveUpdates(_0x3d90c1,_0x1e38dc){return function(_0x7608){if(_0x7608){return _0x7608['update'](_0x3d90c1)[_0x3624('0x24')](function(_0x12ac38){return _0x12ac38;});}return null;};}function removeEntity(_0x5627a1,_0x4707cd){return function(_0x581a97){if(_0x581a97){return _0x581a97[_0x3624('0x25')]()[_0x3624('0x24')](function(){_0x5627a1[_0x3624('0x19')](0xcc)[_0x3624('0x1a')]();});}};}function handleEntityNotFound(_0x14fba7,_0x4671a1){return function(_0x12f0bd){if(!_0x12f0bd){_0x14fba7['sendStatus'](0x194);}return _0x12f0bd;};}function handleError(_0xfd346d,_0x34021f){_0x34021f=_0x34021f||0x1f4;return function(_0x4028ac){logger[_0x3624('0x26')](_0x4028ac[_0x3624('0x27')]);if(_0x4028ac['name']){delete _0x4028ac[_0x3624('0x28')];}_0xfd346d[_0x3624('0x19')](_0x34021f)[_0x3624('0x29')](_0x4028ac);};}exports[_0x3624('0x2a')]=function(_0x3af2bd,_0x2a46af){var _0x2f97b4={},_0x47182a={},_0x13a1be={'count':0x0,'rows':[]};var _0x14b98d=_[_0x3624('0x2b')](db[_0x3624('0x2c')][_0x3624('0x2d')],function(_0x432248){return{'name':_0x432248[_0x3624('0x2e')],'type':_0x432248[_0x3624('0x2f')]['key']};});_0x47182a[_0x3624('0x30')]=_['map'](_0x14b98d,_0x3624('0x28'));_0x47182a['query']=_[_0x3624('0x31')](_0x3af2bd[_0x3624('0x32')]);_0x47182a[_0x3624('0x33')]=_[_0x3624('0x34')](_0x47182a['model'],_0x47182a[_0x3624('0x32')]);_0x2f97b4[_0x3624('0x35')]=_['intersection'](_0x47182a[_0x3624('0x30')],qs['fields'](_0x3af2bd['query']['fields']));_0x2f97b4[_0x3624('0x35')]=_0x2f97b4[_0x3624('0x35')][_0x3624('0x36')]?_0x2f97b4['attributes']:_0x47182a[_0x3624('0x30')];if(!_0x3af2bd[_0x3624('0x32')][_0x3624('0x37')]('nolimit')){_0x2f97b4[_0x3624('0x1d')]=qs[_0x3624('0x1d')](_0x3af2bd[_0x3624('0x32')]['limit']);_0x2f97b4[_0x3624('0x1c')]=qs[_0x3624('0x1c')](_0x3af2bd['query'][_0x3624('0x1c')]);}_0x2f97b4[_0x3624('0x38')]=qs['sort'](_0x3af2bd[_0x3624('0x32')][_0x3624('0x39')]);_0x2f97b4[_0x3624('0x3a')]=qs[_0x3624('0x33')](_['pick'](_0x3af2bd[_0x3624('0x32')],_0x47182a['filters']),_0x14b98d);if(_0x3af2bd[_0x3624('0x32')][_0x3624('0x3b')]){_0x2f97b4[_0x3624('0x3a')]=_[_0x3624('0x3c')](_0x2f97b4[_0x3624('0x3a')],{'$or':_[_0x3624('0x2b')](_0x14b98d,function(_0x12df3e){if(_0x12df3e[_0x3624('0x2f')]!==_0x3624('0x3d')){var _0x196aa2={};_0x196aa2[_0x12df3e[_0x3624('0x28')]]={'$like':'%'+_0x3af2bd[_0x3624('0x32')]['filter']+'%'};return _0x196aa2;}})});}_0x2f97b4=_['merge']({},_0x2f97b4,_0x3af2bd[_0x3624('0x3e')]);var _0x22519f={'where':_0x2f97b4[_0x3624('0x3a')]};return db[_0x3624('0x2c')][_0x3624('0x1f')](_0x22519f)[_0x3624('0x24')](function(_0x52cdba){_0x13a1be['count']=_0x52cdba;if(_0x3af2bd['query'][_0x3624('0x3f')]){_0x2f97b4['include']=[{'all':!![]}];}return db[_0x3624('0x2c')][_0x3624('0x40')](_0x2f97b4);})[_0x3624('0x24')](function(_0x439cc6){_0x13a1be[_0x3624('0x41')]=_0x439cc6;return _0x13a1be;})['then'](respondWithFilteredResult(_0x2a46af,_0x2f97b4))[_0x3624('0x42')](handleError(_0x2a46af,null));};exports[_0x3624('0x43')]=function(_0x5206d8,_0x5db4da){var _0x2b2324={'raw':!![],'where':{'id':_0x5206d8[_0x3624('0x44')]['id']}},_0x3316dc={};_0x3316dc['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x3316dc[_0x3624('0x32')]=_['keys'](_0x5206d8[_0x3624('0x32')]);_0x3316dc['filters']=_['intersection'](_0x3316dc[_0x3624('0x30')],_0x3316dc[_0x3624('0x32')]);_0x2b2324[_0x3624('0x35')]=_[_0x3624('0x34')](_0x3316dc[_0x3624('0x30')],qs['fields'](_0x5206d8[_0x3624('0x32')]['fields']));_0x2b2324[_0x3624('0x35')]=_0x2b2324[_0x3624('0x35')]['length']?_0x2b2324[_0x3624('0x35')]:_0x3316dc[_0x3624('0x30')];if(_0x5206d8[_0x3624('0x32')][_0x3624('0x3f')]){_0x2b2324['include']=[{'all':!![]}];}_0x2b2324=_[_0x3624('0x3c')]({},_0x2b2324,_0x5206d8[_0x3624('0x3e')]);return db['ServicenowField'][_0x3624('0x45')](_0x2b2324)[_0x3624('0x24')](handleEntityNotFound(_0x5db4da,null))[_0x3624('0x24')](respondWithResult(_0x5db4da,null))[_0x3624('0x42')](handleError(_0x5db4da,null));};exports['create']=function(_0x276f70,_0x412178){return db[_0x3624('0x2c')][_0x3624('0x46')](_0x276f70[_0x3624('0x47')],{})[_0x3624('0x24')](respondWithResult(_0x412178,0xc9))['catch'](handleError(_0x412178,null));};exports[_0x3624('0x48')]=function(_0x1becd5,_0x256d92){if(_0x1becd5['body']['id']){delete _0x1becd5[_0x3624('0x47')]['id'];}return db[_0x3624('0x2c')]['find']({'where':{'id':_0x1becd5['params']['id']}})[_0x3624('0x24')](handleEntityNotFound(_0x256d92,null))[_0x3624('0x24')](saveUpdates(_0x1becd5[_0x3624('0x47')],null))['then'](respondWithResult(_0x256d92,null))[_0x3624('0x42')](handleError(_0x256d92,null));};exports[_0x3624('0x25')]=function(_0x322ac1,_0x359ed4){return db[_0x3624('0x2c')]['find']({'where':{'id':_0x322ac1[_0x3624('0x44')]['id']}})['then'](handleEntityNotFound(_0x359ed4,null))[_0x3624('0x24')](removeEntity(_0x359ed4,null))[_0x3624('0x42')](handleError(_0x359ed4,null));}; \ No newline at end of file +var _0x1b10=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','length','include','options','find','catch','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x1b10,0x17f));var _0x01b1=function(_0x56383e,_0x291bf4){_0x56383e=_0x56383e-0x0;var _0x551adf=_0x1b10[_0x56383e];return _0x551adf;};'use strict';var emlformat=require(_0x01b1('0x0'));var rimraf=require(_0x01b1('0x1'));var zipdir=require(_0x01b1('0x2'));var jsonpatch=require(_0x01b1('0x3'));var rp=require(_0x01b1('0x4'));var moment=require(_0x01b1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x01b1('0x6'));var util=require(_0x01b1('0x7'));var path=require(_0x01b1('0x8'));var sox=require(_0x01b1('0x9'));var csv=require(_0x01b1('0xa'));var ejs=require(_0x01b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01b1('0xc'));var squel=require(_0x01b1('0xd'));var crypto=require(_0x01b1('0xe'));var jsforce=require(_0x01b1('0xf'));var deskjs=require(_0x01b1('0x10'));var toCsv=require(_0x01b1('0xa'));var querystring=require(_0x01b1('0x11'));var Papa=require(_0x01b1('0x12'));var Redis=require(_0x01b1('0x13'));var authService=require(_0x01b1('0x14'));var qs=require(_0x01b1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01b1('0x16'));var logger=require(_0x01b1('0x17'))('api');var utils=require(_0x01b1('0x18'));var config=require(_0x01b1('0x19'));var licenseUtil=require(_0x01b1('0x1a'));var db=require(_0x01b1('0x1b'))['db'];function respondWithStatusCode(_0x5e5c1f,_0x5d78d3){_0x5d78d3=_0x5d78d3||0xcc;return function(_0x1cfa00){if(_0x1cfa00){return _0x5e5c1f[_0x01b1('0x1c')](_0x5d78d3);}return _0x5e5c1f[_0x01b1('0x1d')](_0x5d78d3)['end']();};}function respondWithResult(_0x1fb97b,_0x52d1ee){_0x52d1ee=_0x52d1ee||0xc8;return function(_0x34b415){if(_0x34b415){return _0x1fb97b['status'](_0x52d1ee)[_0x01b1('0x1e')](_0x34b415);}};}function respondWithFilteredResult(_0xa34438,_0x1065ed){return function(_0x354158){if(_0x354158){var _0x1e920c=typeof _0x1065ed[_0x01b1('0x1f')]===_0x01b1('0x20')&&typeof _0x1065ed[_0x01b1('0x21')]===_0x01b1('0x20');var _0xb52503=_0x354158[_0x01b1('0x22')];var _0x2396ba=_0x1e920c?0x0:_0x1065ed['offset'];var _0x21701b=_0x1e920c?_0x354158[_0x01b1('0x22')]:_0x1065ed[_0x01b1('0x1f')]+_0x1065ed[_0x01b1('0x21')];var _0x16b9fc;if(_0x21701b>=_0xb52503){_0x21701b=_0xb52503;_0x16b9fc=0xc8;}else{_0x16b9fc=0xce;}_0xa34438[_0x01b1('0x1d')](_0x16b9fc);return _0xa34438[_0x01b1('0x23')]('Content-Range',_0x2396ba+'-'+_0x21701b+'/'+_0xb52503)[_0x01b1('0x1e')](_0x354158);}return null;};}function patchUpdates(_0x41767b){return function(_0x3b2c09){try{jsonpatch[_0x01b1('0x24')](_0x3b2c09,_0x41767b,!![]);}catch(_0xc929a3){return BPromise[_0x01b1('0x25')](_0xc929a3);}return _0x3b2c09[_0x01b1('0x26')]();};}function saveUpdates(_0x2831f6,_0x2eec3c){return function(_0x20eae1){if(_0x20eae1){return _0x20eae1['update'](_0x2831f6)['then'](function(_0x30c0ac){return _0x30c0ac;});}return null;};}function removeEntity(_0x279f5c,_0x20192a){return function(_0x59bd6f){if(_0x59bd6f){return _0x59bd6f[_0x01b1('0x27')]()[_0x01b1('0x28')](function(){_0x279f5c['status'](0xcc)[_0x01b1('0x29')]();});}};}function handleEntityNotFound(_0x596436,_0x272f66){return function(_0x5826b0){if(!_0x5826b0){_0x596436[_0x01b1('0x1c')](0x194);}return _0x5826b0;};}function handleError(_0x5e0dab,_0x94c75d){_0x94c75d=_0x94c75d||0x1f4;return function(_0xf067f3){logger[_0x01b1('0x2a')](_0xf067f3[_0x01b1('0x2b')]);if(_0xf067f3[_0x01b1('0x2c')]){delete _0xf067f3['name'];}_0x5e0dab[_0x01b1('0x1d')](_0x94c75d)[_0x01b1('0x2d')](_0xf067f3);};}exports[_0x01b1('0x2e')]=function(_0x23fe1d,_0x499324){var _0x5cc7f5={},_0x419792={},_0x40fd4c={'count':0x0,'rows':[]};var _0x3dc730=_[_0x01b1('0x2f')](db[_0x01b1('0x30')][_0x01b1('0x31')],function(_0x352774){return{'name':_0x352774[_0x01b1('0x32')],'type':_0x352774[_0x01b1('0x33')][_0x01b1('0x34')]};});_0x419792[_0x01b1('0x35')]=_[_0x01b1('0x2f')](_0x3dc730,_0x01b1('0x2c'));_0x419792[_0x01b1('0x36')]=_[_0x01b1('0x37')](_0x23fe1d[_0x01b1('0x36')]);_0x419792[_0x01b1('0x38')]=_[_0x01b1('0x39')](_0x419792['model'],_0x419792[_0x01b1('0x36')]);_0x5cc7f5[_0x01b1('0x3a')]=_[_0x01b1('0x39')](_0x419792['model'],qs[_0x01b1('0x3b')](_0x23fe1d[_0x01b1('0x36')][_0x01b1('0x3b')]));_0x5cc7f5['attributes']=_0x5cc7f5[_0x01b1('0x3a')]['length']?_0x5cc7f5[_0x01b1('0x3a')]:_0x419792[_0x01b1('0x35')];if(!_0x23fe1d[_0x01b1('0x36')]['hasOwnProperty'](_0x01b1('0x3c'))){_0x5cc7f5[_0x01b1('0x21')]=qs['limit'](_0x23fe1d['query'][_0x01b1('0x21')]);_0x5cc7f5[_0x01b1('0x1f')]=qs['offset'](_0x23fe1d['query']['offset']);}_0x5cc7f5[_0x01b1('0x3d')]=qs[_0x01b1('0x3e')](_0x23fe1d[_0x01b1('0x36')]['sort']);_0x5cc7f5[_0x01b1('0x3f')]=qs[_0x01b1('0x38')](_[_0x01b1('0x40')](_0x23fe1d[_0x01b1('0x36')],_0x419792['filters']),_0x3dc730);if(_0x23fe1d['query'][_0x01b1('0x41')]){_0x5cc7f5['where']=_[_0x01b1('0x42')](_0x5cc7f5['where'],{'$or':_[_0x01b1('0x2f')](_0x3dc730,function(_0x236f23){if(_0x236f23['type']!==_0x01b1('0x43')){var _0x443e77={};_0x443e77[_0x236f23[_0x01b1('0x2c')]]={'$like':'%'+_0x23fe1d[_0x01b1('0x36')][_0x01b1('0x41')]+'%'};return _0x443e77;}})});}_0x5cc7f5=_[_0x01b1('0x42')]({},_0x5cc7f5,_0x23fe1d['options']);var _0x4c6690={'where':_0x5cc7f5[_0x01b1('0x3f')]};return db['ServicenowField'][_0x01b1('0x22')](_0x4c6690)[_0x01b1('0x28')](function(_0x386731){_0x40fd4c['count']=_0x386731;if(_0x23fe1d[_0x01b1('0x36')][_0x01b1('0x44')]){_0x5cc7f5['include']=[{'all':!![]}];}return db[_0x01b1('0x30')][_0x01b1('0x45')](_0x5cc7f5);})[_0x01b1('0x28')](function(_0x12990e){_0x40fd4c['rows']=_0x12990e;return _0x40fd4c;})[_0x01b1('0x28')](respondWithFilteredResult(_0x499324,_0x5cc7f5))['catch'](handleError(_0x499324,null));};exports[_0x01b1('0x46')]=function(_0x475ae4,_0x1f6290){var _0x1547ad={'raw':!![],'where':{'id':_0x475ae4[_0x01b1('0x47')]['id']}},_0x74f92c={};_0x74f92c[_0x01b1('0x35')]=_[_0x01b1('0x37')](db[_0x01b1('0x30')][_0x01b1('0x31')]);_0x74f92c['query']=_['keys'](_0x475ae4[_0x01b1('0x36')]);_0x74f92c[_0x01b1('0x38')]=_[_0x01b1('0x39')](_0x74f92c[_0x01b1('0x35')],_0x74f92c['query']);_0x1547ad[_0x01b1('0x3a')]=_[_0x01b1('0x39')](_0x74f92c[_0x01b1('0x35')],qs[_0x01b1('0x3b')](_0x475ae4[_0x01b1('0x36')]['fields']));_0x1547ad[_0x01b1('0x3a')]=_0x1547ad['attributes'][_0x01b1('0x48')]?_0x1547ad[_0x01b1('0x3a')]:_0x74f92c[_0x01b1('0x35')];if(_0x475ae4['query'][_0x01b1('0x44')]){_0x1547ad[_0x01b1('0x49')]=[{'all':!![]}];}_0x1547ad=_[_0x01b1('0x42')]({},_0x1547ad,_0x475ae4[_0x01b1('0x4a')]);return db[_0x01b1('0x30')][_0x01b1('0x4b')](_0x1547ad)[_0x01b1('0x28')](handleEntityNotFound(_0x1f6290,null))['then'](respondWithResult(_0x1f6290,null))[_0x01b1('0x4c')](handleError(_0x1f6290,null));};exports[_0x01b1('0x4d')]=function(_0x25ffb0,_0x43100f){return db[_0x01b1('0x30')][_0x01b1('0x4d')](_0x25ffb0['body'],{})[_0x01b1('0x28')](respondWithResult(_0x43100f,0xc9))[_0x01b1('0x4c')](handleError(_0x43100f,null));};exports[_0x01b1('0x4e')]=function(_0x1af593,_0x1d9911){if(_0x1af593[_0x01b1('0x4f')]['id']){delete _0x1af593[_0x01b1('0x4f')]['id'];}return db[_0x01b1('0x30')][_0x01b1('0x4b')]({'where':{'id':_0x1af593[_0x01b1('0x47')]['id']}})[_0x01b1('0x28')](handleEntityNotFound(_0x1d9911,null))['then'](saveUpdates(_0x1af593[_0x01b1('0x4f')],null))['then'](respondWithResult(_0x1d9911,null))['catch'](handleError(_0x1d9911,null));};exports[_0x01b1('0x27')]=function(_0x1ce56a,_0x5ca701){return db[_0x01b1('0x30')][_0x01b1('0x4b')]({'where':{'id':_0x1ce56a[_0x01b1('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ca701,null))[_0x01b1('0x28')](removeEntity(_0x5ca701,null))[_0x01b1('0x4c')](handleError(_0x5ca701,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 64ae878..82875b1 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 _0xa94f=['rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x105e01,_0x199717){var _0x421f22=function(_0x5b1103){while(--_0x5b1103){_0x105e01['push'](_0x105e01['shift']());}};_0x421f22(++_0x199717);}(_0xa94f,0xad));var _0xfa94=function(_0x5c2230,_0x309572){_0x5c2230=_0x5c2230-0x0;var _0x47f24b=_0xa94f[_0x5c2230];return _0x47f24b;};'use strict';var _=require(_0xfa94('0x0'));var util=require('util');var logger=require(_0xfa94('0x1'))(_0xfa94('0x2'));var moment=require(_0xfa94('0x3'));var BPromise=require(_0xfa94('0x4'));var rp=require(_0xfa94('0x5'));var fs=require('fs');var path=require(_0xfa94('0x6'));var rimraf=require(_0xfa94('0x7'));var config=require(_0xfa94('0x8'));var attributes=require('./intServicenowField.attributes');module[_0xfa94('0x9')]=function(_0x5e8a5a,_0x1535d4){return _0x5e8a5a[_0xfa94('0xa')](_0xfa94('0xb'),attributes,{'tableName':_0xfa94('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xfa94('0xd'),_0xfa94('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b5=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ServicenowField','int_servicenow_fields','idField','FieldId'];(function(_0x568e7c,_0x5ea152){var _0x4682a7=function(_0x868695){while(--_0x868695){_0x568e7c['push'](_0x568e7c['shift']());}};_0x4682a7(++_0x5ea152);}(_0xd5b5,0xe0));var _0x5d5b=function(_0x38832d,_0x247f6a){_0x38832d=_0x38832d-0x0;var _0x325bb1=_0xd5b5[_0x38832d];return _0x325bb1;};'use strict';var _=require(_0x5d5b('0x0'));var util=require(_0x5d5b('0x1'));var logger=require(_0x5d5b('0x2'))('api');var moment=require(_0x5d5b('0x3'));var BPromise=require(_0x5d5b('0x4'));var rp=require(_0x5d5b('0x5'));var fs=require('fs');var path=require(_0x5d5b('0x6'));var rimraf=require(_0x5d5b('0x7'));var config=require(_0x5d5b('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x241306,_0x68f7ff){return _0x241306[_0x5d5b('0x9')](_0x5d5b('0xa'),attributes,{'tableName':_0x5d5b('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5d5b('0xc'),_0x5d5b('0xd')],'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 975b43c..62cc59c 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3bac2b,_0x137306){_0x3bac2b=_0x3bac2b-0x0;var _0xbadf45=_0xbdb7[_0x3bac2b];return _0xbadf45;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0xaa88,0x137));var _0x8aa8=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xaa88[_0x3c6b7d];return _0x1d3ed2;};'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')]('ServicenowField,\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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 67e2ff4..102df49 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(_0x424b83,_0x39a2c8){var _0x219b87=function(_0x4dd36c){while(--_0x4dd36c){_0x424b83['push'](_0x424b83['shift']());}};_0x219b87(++_0x39a2c8);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x15c85f,_0x2346f2){var _0x1aa20a=function(_0x2f26e2){while(--_0x2f26e2){_0x15c85f['push'](_0x15c85f['shift']());}};_0x1aa20a(++_0x2346f2);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index c1ecde5..7de30af 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(_0x4886f5,_0x5a701e){var _0x46abd5=function(_0x26b535){while(--_0x26b535){_0x4886f5['push'](_0x4886f5['shift']());}};_0x46abd5(++_0x5a701e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4f06e2,_0x21dfc3){var _0x5b8e72=function(_0x3dc187){while(--_0x3dc187){_0x4f06e2['push'](_0x4f06e2['shift']());}};_0x5b8e72(++_0x21dfc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 a1b00c6..279b207 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 _0x1542=['Subjects','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','JSON','stringify','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','include','options','create','update','body','params','find','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField'];(function(_0x32b331,_0x493ebc){var _0x3d5c26=function(_0x423e7c){while(--_0x423e7c){_0x32b331['push'](_0x32b331['shift']());}};_0x3d5c26(++_0x493ebc);}(_0x1542,0x116));var _0x2154=function(_0x475132,_0x1b91cd){_0x475132=_0x475132-0x0;var _0x1c239f=_0x1542[_0x475132];return _0x1c239f;};'use strict';var emlformat=require(_0x2154('0x0'));var rimraf=require(_0x2154('0x1'));var zipdir=require(_0x2154('0x2'));var jsonpatch=require(_0x2154('0x3'));var rp=require(_0x2154('0x4'));var moment=require('moment');var BPromise=require(_0x2154('0x5'));var Mustache=require(_0x2154('0x6'));var util=require(_0x2154('0x7'));var path=require('path');var sox=require(_0x2154('0x8'));var csv=require(_0x2154('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2154('0xa'));var _=require(_0x2154('0xb'));var squel=require(_0x2154('0xc'));var crypto=require(_0x2154('0xd'));var jsforce=require(_0x2154('0xe'));var deskjs=require(_0x2154('0xf'));var toCsv=require(_0x2154('0x9'));var querystring=require(_0x2154('0x10'));var Papa=require(_0x2154('0x11'));var Redis=require(_0x2154('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2154('0x13'));var as=require(_0x2154('0x14'));var hardwareService=require(_0x2154('0x15'));var logger=require(_0x2154('0x16'))('api');var utils=require(_0x2154('0x17'));var config=require(_0x2154('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2154('0x19'))['db'];var integrations=require(_0x2154('0x1a'));function respondWithStatusCode(_0x3daa7d,_0x2a79eb){_0x2a79eb=_0x2a79eb||0xcc;return function(_0x9f4e9b){if(_0x9f4e9b){return _0x3daa7d[_0x2154('0x1b')](_0x2a79eb);}return _0x3daa7d[_0x2154('0x1c')](_0x2a79eb)['end']();};}function respondWithResult(_0x5363f6,_0x160517){_0x160517=_0x160517||0xc8;return function(_0x5e1aee){if(_0x5e1aee){return _0x5363f6[_0x2154('0x1c')](_0x160517)['json'](_0x5e1aee);}};}function respondWithFilteredResult(_0x48f188,_0x5b34b9){return function(_0x46c995){if(_0x46c995){var _0x57e662=typeof _0x5b34b9[_0x2154('0x1d')]==='undefined'&&typeof _0x5b34b9[_0x2154('0x1e')]===_0x2154('0x1f');var _0x324a0f=_0x46c995[_0x2154('0x20')];var _0x14d29a=_0x57e662?0x0:_0x5b34b9[_0x2154('0x1d')];var _0x15c197=_0x57e662?_0x46c995[_0x2154('0x20')]:_0x5b34b9[_0x2154('0x1d')]+_0x5b34b9[_0x2154('0x1e')];var _0x50ed9b;if(_0x15c197>=_0x324a0f){_0x15c197=_0x324a0f;_0x50ed9b=0xc8;}else{_0x50ed9b=0xce;}_0x48f188[_0x2154('0x1c')](_0x50ed9b);return _0x48f188[_0x2154('0x21')](_0x2154('0x22'),_0x14d29a+'-'+_0x15c197+'/'+_0x324a0f)['json'](_0x46c995);}return null;};}function patchUpdates(_0x2af3dd){return function(_0x349387){try{jsonpatch[_0x2154('0x23')](_0x349387,_0x2af3dd,!![]);}catch(_0x31db14){return BPromise['reject'](_0x31db14);}return _0x349387[_0x2154('0x24')]();};}function saveUpdates(_0xb10044,_0x3f4387){return function(_0x4efdde){if(_0x4efdde){return _0x4efdde['update'](_0xb10044)[_0x2154('0x25')](function(_0xa40b17){return _0xa40b17;});}return null;};}function removeEntity(_0x166b0d,_0x4ef4f7){return function(_0x54ba3b){if(_0x54ba3b){return _0x54ba3b[_0x2154('0x26')]()[_0x2154('0x25')](function(){_0x166b0d[_0x2154('0x1c')](0xcc)[_0x2154('0x27')]();});}};}function handleEntityNotFound(_0x5c954c,_0x1b3f89){return function(_0x34c860){if(!_0x34c860){_0x5c954c[_0x2154('0x1b')](0x194);}return _0x34c860;};}function handleError(_0x5c5dbb,_0x4afbb4){_0x4afbb4=_0x4afbb4||0x1f4;return function(_0x128d6d){logger[_0x2154('0x28')](_0x128d6d[_0x2154('0x29')]);if(_0x128d6d['name']){delete _0x128d6d[_0x2154('0x2a')];}_0x5c5dbb[_0x2154('0x1c')](_0x4afbb4)[_0x2154('0x2b')](_0x128d6d);};}exports[_0x2154('0x2c')]=function(_0x375a57,_0x5cd152){var _0x23f1bc={},_0x215a2c={},_0x661cff={'count':0x0,'rows':[]};var _0x156f1a=_[_0x2154('0x2d')](db[_0x2154('0x2e')][_0x2154('0x2f')],function(_0x5661d9){return{'name':_0x5661d9[_0x2154('0x30')],'type':_0x5661d9[_0x2154('0x31')]['key']};});_0x215a2c[_0x2154('0x32')]=_['map'](_0x156f1a,'name');_0x215a2c[_0x2154('0x33')]=_[_0x2154('0x34')](_0x375a57[_0x2154('0x33')]);_0x215a2c['filters']=_[_0x2154('0x35')](_0x215a2c[_0x2154('0x32')],_0x215a2c[_0x2154('0x33')]);_0x23f1bc[_0x2154('0x36')]=_[_0x2154('0x35')](_0x215a2c[_0x2154('0x32')],qs[_0x2154('0x37')](_0x375a57[_0x2154('0x33')]['fields']));_0x23f1bc[_0x2154('0x36')]=_0x23f1bc['attributes'][_0x2154('0x38')]?_0x23f1bc[_0x2154('0x36')]:_0x215a2c[_0x2154('0x32')];if(!_0x375a57[_0x2154('0x33')][_0x2154('0x39')]('nolimit')){_0x23f1bc['limit']=qs[_0x2154('0x1e')](_0x375a57[_0x2154('0x33')][_0x2154('0x1e')]);_0x23f1bc[_0x2154('0x1d')]=qs[_0x2154('0x1d')](_0x375a57[_0x2154('0x33')][_0x2154('0x1d')]);}_0x23f1bc[_0x2154('0x3a')]=qs[_0x2154('0x3b')](_0x375a57[_0x2154('0x33')]['sort']);_0x23f1bc[_0x2154('0x3c')]=qs['filters'](_[_0x2154('0x3d')](_0x375a57[_0x2154('0x33')],_0x215a2c[_0x2154('0x3e')]),_0x156f1a);if(_0x375a57[_0x2154('0x33')][_0x2154('0x3f')]){_0x23f1bc[_0x2154('0x3c')]=_['merge'](_0x23f1bc[_0x2154('0x3c')],{'$or':_[_0x2154('0x2d')](_0x156f1a,function(_0x401c93){if(_0x401c93[_0x2154('0x31')]!==_0x2154('0x40')){var _0x12e7c5={};_0x12e7c5[_0x401c93[_0x2154('0x2a')]]={'$like':'%'+_0x375a57[_0x2154('0x33')][_0x2154('0x3f')]+'%'};return _0x12e7c5;}})});}_0x23f1bc=_[_0x2154('0x41')]({},_0x23f1bc,_0x375a57['options']);var _0x5d77b0={'where':_0x23f1bc[_0x2154('0x3c')]};return db[_0x2154('0x2e')]['count'](_0x5d77b0)[_0x2154('0x25')](function(_0x1cd56b){_0x661cff['count']=_0x1cd56b;if(_0x375a57[_0x2154('0x33')][_0x2154('0x42')]){_0x23f1bc['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x2154('0x43')](_0x23f1bc);})[_0x2154('0x25')](function(_0x169344){_0x661cff[_0x2154('0x44')]=_0x169344;return _0x661cff;})[_0x2154('0x25')](respondWithFilteredResult(_0x5cd152,_0x23f1bc))[_0x2154('0x45')](handleError(_0x5cd152,null));};exports[_0x2154('0x46')]=function(_0x2f0bba,_0x337296){var _0x417663={'raw':![],'where':{'id':_0x2f0bba['params']['id']}},_0x3ae9e2={};_0x3ae9e2['model']=_[_0x2154('0x34')](db['SugarcrmAccount'][_0x2154('0x2f')]);_0x3ae9e2[_0x2154('0x33')]=_[_0x2154('0x34')](_0x2f0bba[_0x2154('0x33')]);_0x3ae9e2['filters']=_[_0x2154('0x35')](_0x3ae9e2[_0x2154('0x32')],_0x3ae9e2[_0x2154('0x33')]);_0x417663[_0x2154('0x36')]=_[_0x2154('0x35')](_0x3ae9e2[_0x2154('0x32')],qs['fields'](_0x2f0bba['query']['fields']));_0x417663[_0x2154('0x36')]=_0x417663['attributes']['length']?_0x417663[_0x2154('0x36')]:_0x3ae9e2[_0x2154('0x32')];if(_0x2f0bba[_0x2154('0x33')][_0x2154('0x42')]){_0x417663[_0x2154('0x47')]=[{'all':!![]}];}_0x417663=_[_0x2154('0x41')]({},_0x417663,_0x2f0bba[_0x2154('0x48')]);return db[_0x2154('0x2e')]['find'](_0x417663)[_0x2154('0x25')](handleEntityNotFound(_0x337296,null))[_0x2154('0x25')](respondWithResult(_0x337296,null))[_0x2154('0x45')](handleError(_0x337296,null));};exports['create']=function(_0x5a82b0,_0x14666c){return db[_0x2154('0x2e')][_0x2154('0x49')](_0x5a82b0['body'],{})[_0x2154('0x25')](respondWithResult(_0x14666c,0xc9))[_0x2154('0x45')](handleError(_0x14666c,null));};exports[_0x2154('0x4a')]=function(_0x7027c1,_0x44ec66){if(_0x7027c1[_0x2154('0x4b')]['id']){delete _0x7027c1[_0x2154('0x4b')]['id'];}return db[_0x2154('0x2e')]['find']({'where':{'id':_0x7027c1[_0x2154('0x4c')]['id']}})[_0x2154('0x25')](handleEntityNotFound(_0x44ec66,null))[_0x2154('0x25')](saveUpdates(_0x7027c1[_0x2154('0x4b')],null))['then'](respondWithResult(_0x44ec66,null))[_0x2154('0x45')](handleError(_0x44ec66,null));};exports['destroy']=function(_0x5e4c51,_0xd745bf){return db[_0x2154('0x2e')][_0x2154('0x4d')]({'where':{'id':_0x5e4c51[_0x2154('0x4c')]['id']}})[_0x2154('0x25')](handleEntityNotFound(_0xd745bf,null))[_0x2154('0x25')](removeEntity(_0xd745bf,null))[_0x2154('0x45')](handleError(_0xd745bf,null));};exports[_0x2154('0x4e')]=function(_0x2049c9,_0x3e7e43,_0x54fd3c){var _0x5d85db={};var _0x3c1200={};var _0x56fd16;var _0x336f8b;return db['SugarcrmAccount'][_0x2154('0x4f')]({'where':{'id':_0x2049c9[_0x2154('0x4c')]['id']}})[_0x2154('0x25')](handleEntityNotFound(_0x3e7e43,null))[_0x2154('0x25')](function(_0xfa774b){if(_0xfa774b){_0x56fd16=_0xfa774b;_0x3c1200[_0x2154('0x32')]=_[_0x2154('0x34')](db[_0x2154('0x50')][_0x2154('0x2f')]);_0x3c1200[_0x2154('0x33')]=_[_0x2154('0x34')](_0x2049c9[_0x2154('0x33')]);_0x3c1200[_0x2154('0x3e')]=_[_0x2154('0x35')](_0x3c1200['model'],_0x3c1200['query']);_0x5d85db[_0x2154('0x36')]=_[_0x2154('0x35')](_0x3c1200[_0x2154('0x32')],qs[_0x2154('0x37')](_0x2049c9[_0x2154('0x33')]['fields']));_0x5d85db['attributes']=_0x5d85db[_0x2154('0x36')][_0x2154('0x38')]?_0x5d85db[_0x2154('0x36')]:_0x3c1200[_0x2154('0x32')];_0x5d85db[_0x2154('0x3a')]=qs['sort'](_0x2049c9[_0x2154('0x33')][_0x2154('0x3b')]);_0x5d85db[_0x2154('0x3c')]=qs[_0x2154('0x3e')](_[_0x2154('0x3d')](_0x2049c9['query'],_0x3c1200[_0x2154('0x3e')]));if(_0x2049c9['query'][_0x2154('0x3f')]){_0x5d85db[_0x2154('0x3c')]=_[_0x2154('0x41')](_0x5d85db[_0x2154('0x3c')],{'$or':_[_0x2154('0x2d')](_0x5d85db[_0x2154('0x36')],function(_0x572ee2){var _0x10c6b9={};_0x10c6b9[_0x572ee2]={'$like':'%'+_0x2049c9[_0x2154('0x33')][_0x2154('0x3f')]+'%'};return _0x10c6b9;})});}_0x5d85db=_[_0x2154('0x41')]({},_0x5d85db,_0x2049c9[_0x2154('0x48')]);return _0x56fd16[_0x2154('0x4e')](_0x5d85db);}})[_0x2154('0x25')](function(_0x4cd45e){if(_0x4cd45e){_0x336f8b=_0x4cd45e[_0x2154('0x38')];if(!_0x2049c9[_0x2154('0x33')][_0x2154('0x39')]('nolimit')){_0x5d85db['limit']=qs['limit'](_0x2049c9[_0x2154('0x33')]['limit']);_0x5d85db[_0x2154('0x1d')]=qs['offset'](_0x2049c9['query'][_0x2154('0x1d')]);}return _0x56fd16['getConfigurations'](_0x5d85db);}})[_0x2154('0x25')](function(_0x21bd73){if(_0x21bd73){return _0x21bd73?{'count':_0x336f8b,'rows':_0x21bd73}:null;}})[_0x2154('0x25')](respondWithResult(_0x3e7e43,null))['catch'](handleError(_0x3e7e43,null));};exports[_0x2154('0x51')]=function(_0x58e592,_0x5edf0e,_0x1f37ec){if(_0x58e592[_0x2154('0x4b')]['id']){delete _0x58e592[_0x2154('0x4b')]['id'];}return db[_0x2154('0x2e')][_0x2154('0x4f')]({'where':{'id':_0x58e592['params']['id']}})[_0x2154('0x25')](handleEntityNotFound(_0x5edf0e,null))['then'](function(_0x9407e1){if(_0x9407e1){_0x58e592[_0x2154('0x4b')][_0x2154('0x52')]=_0x9407e1['id'];_0x58e592[_0x2154('0x4b')]['Subjects']=integrations[_0x2154('0x53')](_0x58e592['body'][_0x2154('0x54')],_0x58e592[_0x2154('0x4b')]['type']);_0x58e592[_0x2154('0x4b')][_0x2154('0x55')]=integrations[_0x2154('0x56')](_0x58e592['body']['channel'],_0x58e592[_0x2154('0x4b')][_0x2154('0x31')]);return db['SugarcrmConfiguration'][_0x2154('0x49')](_0x58e592[_0x2154('0x4b')],{'include':[{'model':db[_0x2154('0x57')],'as':_0x2154('0x58')},{'model':db[_0x2154('0x57')],'as':_0x2154('0x55')}]});}return null;})[_0x2154('0x25')](respondWithResult(_0x5edf0e,null))[_0x2154('0x45')](handleError(_0x5edf0e,null));};exports[_0x2154('0x59')]=function(_0xba05b8,_0x59e144,_0x147927){var _0x2f9a07='';var _0x305b09=['id',_0x2154('0x2a'),_0x2154('0x5a'),_0x2154('0x5b'),_0x2154('0x5c'),_0x2154('0x5d'),'duration_hours',_0x2154('0x5e'),_0x2154('0x5f'),_0x2154('0x60'),'parent_name','direction'];return db[_0x2154('0x2e')]['findOne']({'where':{'id':_0xba05b8['params']['id']},'attributes':['id','username',_0x2154('0x61'),_0x2154('0x62')]})[_0x2154('0x25')](handleEntityNotFound(_0x59e144,null))[_0x2154('0x25')](function(_0x2605ec){if(_0x2605ec){_0x2f9a07=_0x2605ec['remoteUri'];var _0x26b0d0=_0x2f9a07[_0x2154('0x63')](-0x1);if(_0x26b0d0==='/'){_0x2f9a07=_0x2f9a07['substring'](0x0,_0x2f9a07[_0x2154('0x64')](_0x26b0d0));}return rp({'method':_0x2154('0x65'),'uri':util[_0x2154('0x66')](_0x2154('0x67'),_0x2f9a07,_0x2154('0x68')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2605ec[_0x2154('0x69')],'password':_0x2605ec[_0x2154('0x61')],'encryption':'PLAIN'},'application':_0x2154('0x6a')})}});}})[_0x2154('0x25')](function(_0x201689){if(_0x201689&&_0x201689['name']!==_0x2154('0x6b')&&_0x201689[_0x2154('0x2a')]!=='Password\x20Expired'){return rp({'method':_0x2154('0x65'),'uri':util[_0x2154('0x66')](_0x2154('0x67'),_0x2f9a07,_0x2154('0x68')),'json':!![],'form':{'method':_0x2154('0x6c'),'input_type':_0x2154('0x6d'),'response_type':'JSON','rest_data':JSON[_0x2154('0x6e')]({'session':_0x201689['id'],'module_name':_0x2154('0x6f')})}})[_0x2154('0x25')](function(_0x33e328){if(_0x33e328){var _0x152691=_[_0x2154('0x70')](_0x33e328[_0x2154('0x71')]);_[_0x2154('0x72')](_0x152691,function(_0x48df7b){return _0x305b09[_0x2154('0x73')](_0x48df7b[_0x2154('0x2a')]);});return{'count':_0x152691[_0x2154('0x38')],'rows':_['map'](_0x152691,function(_0x284287){return{'id':_0x284287[_0x2154('0x2a')],'name':_0x284287[_0x2154('0x74')],'custom':_['endsWith'](_0x284287[_0x2154('0x2a')],'_c')?!![]:![],'options':_0x284287[_0x2154('0x48')]?_[_0x2154('0x2d')](_[_0x2154('0x70')](_0x284287[_0x2154('0x48')]),function(_0x573db3){return{'name':_0x573db3[_0x2154('0x75')],'value':_0x573db3[_0x2154('0x2a')]};}):[]};})};}})[_0x2154('0x25')](respondWithResult(_0x59e144,null))[_0x2154('0x45')](function(_0x4b8bed){var _0x3d3d8b=_0xba05b8[_0x2154('0x33')]['test']?0x1f4:_0x4b8bed[_0x2154('0x76')]||0x1f4;logger[_0x2154('0x28')](_0x2154('0x77'),'getFields',_0x3d3d8b,JSON[_0x2154('0x6e')](_0x4b8bed));delete _0x4b8bed[_0x2154('0x2a')];if(_0x3d3d8b===0x191){_0x3d3d8b=0x190;}_0x59e144['status'](_0x3d3d8b)[_0x2154('0x2b')](_0xba05b8['query'][_0x2154('0x78')]?{'message':_0x2154('0x79'),'statusCode':_0x4b8bed[_0x2154('0x76')]}:_0x4b8bed);});}else{var _0x1ef06b=0x1f4;_0x59e144['status'](_0x1ef06b)[_0x2154('0x2b')]({'message':_0x2154('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x1dbb=['map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','filters','pick','filter','where','VIRTUAL','merge','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','body','update','SugarcrmConfiguration','sort','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','label','endsWith','value','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','error','stack','name'];(function(_0x35a3e2,_0x12afc8){var _0x35fe0f=function(_0x2dd731){while(--_0x2dd731){_0x35a3e2['push'](_0x35a3e2['shift']());}};_0x35fe0f(++_0x12afc8);}(_0x1dbb,0x135));var _0xb1db=function(_0x3b9512,_0x20ab2e){_0x3b9512=_0x3b9512-0x0;var _0x29e098=_0x1dbb[_0x3b9512];return _0x29e098;};'use strict';var emlformat=require(_0xb1db('0x0'));var rimraf=require(_0xb1db('0x1'));var zipdir=require(_0xb1db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb1db('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb1db('0x4'));var util=require(_0xb1db('0x5'));var path=require('path');var sox=require(_0xb1db('0x6'));var csv=require(_0xb1db('0x7'));var ejs=require(_0xb1db('0x8'));var fs=require('fs');var fs_extra=require(_0xb1db('0x9'));var _=require(_0xb1db('0xa'));var squel=require(_0xb1db('0xb'));var crypto=require(_0xb1db('0xc'));var jsforce=require(_0xb1db('0xd'));var deskjs=require(_0xb1db('0xe'));var toCsv=require(_0xb1db('0x7'));var querystring=require('querystring');var Papa=require(_0xb1db('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1db('0x10'));var hardwareService=require(_0xb1db('0x11'));var logger=require('../../config/logger')(_0xb1db('0x12'));var utils=require(_0xb1db('0x13'));var config=require(_0xb1db('0x14'));var licenseUtil=require(_0xb1db('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb1db('0x16'));function respondWithStatusCode(_0x5b94a7,_0x152ff3){_0x152ff3=_0x152ff3||0xcc;return function(_0x48c67b){if(_0x48c67b){return _0x5b94a7[_0xb1db('0x17')](_0x152ff3);}return _0x5b94a7['status'](_0x152ff3)[_0xb1db('0x18')]();};}function respondWithResult(_0x2613e4,_0x141636){_0x141636=_0x141636||0xc8;return function(_0x25db90){if(_0x25db90){return _0x2613e4[_0xb1db('0x19')](_0x141636)['json'](_0x25db90);}};}function respondWithFilteredResult(_0x2679b9,_0xfe7b36){return function(_0x15a996){if(_0x15a996){var _0x298fde=typeof _0xfe7b36[_0xb1db('0x1a')]===_0xb1db('0x1b')&&typeof _0xfe7b36[_0xb1db('0x1c')]===_0xb1db('0x1b');var _0x717a3c=_0x15a996[_0xb1db('0x1d')];var _0x101b46=_0x298fde?0x0:_0xfe7b36[_0xb1db('0x1a')];var _0x5540d9=_0x298fde?_0x15a996[_0xb1db('0x1d')]:_0xfe7b36['offset']+_0xfe7b36[_0xb1db('0x1c')];var _0x58dcc3;if(_0x5540d9>=_0x717a3c){_0x5540d9=_0x717a3c;_0x58dcc3=0xc8;}else{_0x58dcc3=0xce;}_0x2679b9['status'](_0x58dcc3);return _0x2679b9['set'](_0xb1db('0x1e'),_0x101b46+'-'+_0x5540d9+'/'+_0x717a3c)[_0xb1db('0x1f')](_0x15a996);}return null;};}function patchUpdates(_0x52f3fc){return function(_0x273bf7){try{jsonpatch['apply'](_0x273bf7,_0x52f3fc,!![]);}catch(_0x1a18ee){return BPromise[_0xb1db('0x20')](_0x1a18ee);}return _0x273bf7[_0xb1db('0x21')]();};}function saveUpdates(_0x2a6328,_0x84895e){return function(_0xfa5ab6){if(_0xfa5ab6){return _0xfa5ab6['update'](_0x2a6328)[_0xb1db('0x22')](function(_0x2c7fa0){return _0x2c7fa0;});}return null;};}function removeEntity(_0x2943a7,_0x4d9d4a){return function(_0x49b74b){if(_0x49b74b){return _0x49b74b[_0xb1db('0x23')]()[_0xb1db('0x22')](function(){_0x2943a7[_0xb1db('0x19')](0xcc)[_0xb1db('0x18')]();});}};}function handleEntityNotFound(_0x4c558f,_0x36e449){return function(_0x11a80c){if(!_0x11a80c){_0x4c558f['sendStatus'](0x194);}return _0x11a80c;};}function handleError(_0x40f07d,_0x2fc708){_0x2fc708=_0x2fc708||0x1f4;return function(_0x50cc9a){logger[_0xb1db('0x24')](_0x50cc9a[_0xb1db('0x25')]);if(_0x50cc9a[_0xb1db('0x26')]){delete _0x50cc9a[_0xb1db('0x26')];}_0x40f07d[_0xb1db('0x19')](_0x2fc708)['send'](_0x50cc9a);};}exports['index']=function(_0x1c63a7,_0x15b813){var _0x250ce1={},_0x570ab7={},_0xe34d06={'count':0x0,'rows':[]};var _0x1c6a87=_[_0xb1db('0x27')](db['SugarcrmAccount'][_0xb1db('0x28')],function(_0x31d6c7){return{'name':_0x31d6c7[_0xb1db('0x29')],'type':_0x31d6c7[_0xb1db('0x2a')][_0xb1db('0x2b')]};});_0x570ab7[_0xb1db('0x2c')]=_[_0xb1db('0x27')](_0x1c6a87,_0xb1db('0x26'));_0x570ab7[_0xb1db('0x2d')]=_['keys'](_0x1c63a7[_0xb1db('0x2d')]);_0x570ab7['filters']=_[_0xb1db('0x2e')](_0x570ab7[_0xb1db('0x2c')],_0x570ab7[_0xb1db('0x2d')]);_0x250ce1[_0xb1db('0x2f')]=_[_0xb1db('0x2e')](_0x570ab7[_0xb1db('0x2c')],qs[_0xb1db('0x30')](_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x30')]));_0x250ce1[_0xb1db('0x2f')]=_0x250ce1[_0xb1db('0x2f')][_0xb1db('0x31')]?_0x250ce1['attributes']:_0x570ab7[_0xb1db('0x2c')];if(!_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x32')]('nolimit')){_0x250ce1[_0xb1db('0x1c')]=qs[_0xb1db('0x1c')](_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x1c')]);_0x250ce1[_0xb1db('0x1a')]=qs[_0xb1db('0x1a')](_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x1a')]);}_0x250ce1[_0xb1db('0x33')]=qs['sort'](_0x1c63a7[_0xb1db('0x2d')]['sort']);_0x250ce1['where']=qs[_0xb1db('0x34')](_[_0xb1db('0x35')](_0x1c63a7[_0xb1db('0x2d')],_0x570ab7[_0xb1db('0x34')]),_0x1c6a87);if(_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x36')]){_0x250ce1[_0xb1db('0x37')]=_['merge'](_0x250ce1[_0xb1db('0x37')],{'$or':_['map'](_0x1c6a87,function(_0x47c5b0){if(_0x47c5b0['type']!==_0xb1db('0x38')){var _0x4787a7={};_0x4787a7[_0x47c5b0[_0xb1db('0x26')]]={'$like':'%'+_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x36')]+'%'};return _0x4787a7;}})});}_0x250ce1=_[_0xb1db('0x39')]({},_0x250ce1,_0x1c63a7[_0xb1db('0x3a')]);var _0x5f083d={'where':_0x250ce1[_0xb1db('0x37')]};return db[_0xb1db('0x3b')][_0xb1db('0x1d')](_0x5f083d)[_0xb1db('0x22')](function(_0x236a81){_0xe34d06[_0xb1db('0x1d')]=_0x236a81;if(_0x1c63a7['query'][_0xb1db('0x3c')]){_0x250ce1[_0xb1db('0x3d')]=[{'all':!![]}];}return db[_0xb1db('0x3b')][_0xb1db('0x3e')](_0x250ce1);})[_0xb1db('0x22')](function(_0x325ac8){_0xe34d06[_0xb1db('0x3f')]=_0x325ac8;return _0xe34d06;})['then'](respondWithFilteredResult(_0x15b813,_0x250ce1))[_0xb1db('0x40')](handleError(_0x15b813,null));};exports[_0xb1db('0x41')]=function(_0x1c4885,_0x91e305){var _0x56b477={'raw':![],'where':{'id':_0x1c4885[_0xb1db('0x42')]['id']}},_0x2eea82={};_0x2eea82[_0xb1db('0x2c')]=_[_0xb1db('0x43')](db['SugarcrmAccount'][_0xb1db('0x28')]);_0x2eea82['query']=_[_0xb1db('0x43')](_0x1c4885[_0xb1db('0x2d')]);_0x2eea82[_0xb1db('0x34')]=_[_0xb1db('0x2e')](_0x2eea82[_0xb1db('0x2c')],_0x2eea82[_0xb1db('0x2d')]);_0x56b477[_0xb1db('0x2f')]=_[_0xb1db('0x2e')](_0x2eea82[_0xb1db('0x2c')],qs[_0xb1db('0x30')](_0x1c4885[_0xb1db('0x2d')][_0xb1db('0x30')]));_0x56b477['attributes']=_0x56b477[_0xb1db('0x2f')]['length']?_0x56b477[_0xb1db('0x2f')]:_0x2eea82['model'];if(_0x1c4885[_0xb1db('0x2d')][_0xb1db('0x3c')]){_0x56b477[_0xb1db('0x3d')]=[{'all':!![]}];}_0x56b477=_[_0xb1db('0x39')]({},_0x56b477,_0x1c4885[_0xb1db('0x3a')]);return db[_0xb1db('0x3b')][_0xb1db('0x44')](_0x56b477)['then'](handleEntityNotFound(_0x91e305,null))['then'](respondWithResult(_0x91e305,null))['catch'](handleError(_0x91e305,null));};exports['create']=function(_0x5739e8,_0x3e845a){return db[_0xb1db('0x3b')]['create'](_0x5739e8[_0xb1db('0x45')],{})[_0xb1db('0x22')](respondWithResult(_0x3e845a,0xc9))[_0xb1db('0x40')](handleError(_0x3e845a,null));};exports[_0xb1db('0x46')]=function(_0x3a18f0,_0xb99d86){if(_0x3a18f0[_0xb1db('0x45')]['id']){delete _0x3a18f0[_0xb1db('0x45')]['id'];}return db[_0xb1db('0x3b')][_0xb1db('0x44')]({'where':{'id':_0x3a18f0[_0xb1db('0x42')]['id']}})['then'](handleEntityNotFound(_0xb99d86,null))[_0xb1db('0x22')](saveUpdates(_0x3a18f0[_0xb1db('0x45')],null))[_0xb1db('0x22')](respondWithResult(_0xb99d86,null))['catch'](handleError(_0xb99d86,null));};exports['destroy']=function(_0xc4e28c,_0x5f26ce){return db['SugarcrmAccount']['find']({'where':{'id':_0xc4e28c['params']['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x5f26ce,null))[_0xb1db('0x22')](removeEntity(_0x5f26ce,null))[_0xb1db('0x40')](handleError(_0x5f26ce,null));};exports['getConfigurations']=function(_0x1bc41a,_0x457a2c,_0x3c9f1c){var _0x22d931={};var _0x58abac={};var _0x52469a;var _0x7977cf;return db[_0xb1db('0x3b')]['findOne']({'where':{'id':_0x1bc41a[_0xb1db('0x42')]['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x457a2c,null))[_0xb1db('0x22')](function(_0x5c9aae){if(_0x5c9aae){_0x52469a=_0x5c9aae;_0x58abac[_0xb1db('0x2c')]=_['keys'](db[_0xb1db('0x47')][_0xb1db('0x28')]);_0x58abac[_0xb1db('0x2d')]=_['keys'](_0x1bc41a['query']);_0x58abac[_0xb1db('0x34')]=_['intersection'](_0x58abac[_0xb1db('0x2c')],_0x58abac[_0xb1db('0x2d')]);_0x22d931[_0xb1db('0x2f')]=_[_0xb1db('0x2e')](_0x58abac['model'],qs['fields'](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x30')]));_0x22d931[_0xb1db('0x2f')]=_0x22d931['attributes'][_0xb1db('0x31')]?_0x22d931['attributes']:_0x58abac[_0xb1db('0x2c')];_0x22d931['order']=qs[_0xb1db('0x48')](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x48')]);_0x22d931[_0xb1db('0x37')]=qs[_0xb1db('0x34')](_['pick'](_0x1bc41a[_0xb1db('0x2d')],_0x58abac[_0xb1db('0x34')]));if(_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x36')]){_0x22d931[_0xb1db('0x37')]=_[_0xb1db('0x39')](_0x22d931['where'],{'$or':_[_0xb1db('0x27')](_0x22d931['attributes'],function(_0x547ab5){var _0x4b5585={};_0x4b5585[_0x547ab5]={'$like':'%'+_0x1bc41a[_0xb1db('0x2d')]['filter']+'%'};return _0x4b5585;})});}_0x22d931=_[_0xb1db('0x39')]({},_0x22d931,_0x1bc41a[_0xb1db('0x3a')]);return _0x52469a[_0xb1db('0x49')](_0x22d931);}})[_0xb1db('0x22')](function(_0x1495d8){if(_0x1495d8){_0x7977cf=_0x1495d8[_0xb1db('0x31')];if(!_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x32')]('nolimit')){_0x22d931[_0xb1db('0x1c')]=qs[_0xb1db('0x1c')](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x1c')]);_0x22d931[_0xb1db('0x1a')]=qs[_0xb1db('0x1a')](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x1a')]);}return _0x52469a[_0xb1db('0x49')](_0x22d931);}})[_0xb1db('0x22')](function(_0x5c3437){if(_0x5c3437){return _0x5c3437?{'count':_0x7977cf,'rows':_0x5c3437}:null;}})[_0xb1db('0x22')](respondWithResult(_0x457a2c,null))[_0xb1db('0x40')](handleError(_0x457a2c,null));};exports[_0xb1db('0x4a')]=function(_0x4b38a7,_0x4b8742,_0x3e072a){if(_0x4b38a7[_0xb1db('0x45')]['id']){delete _0x4b38a7[_0xb1db('0x45')]['id'];}return db[_0xb1db('0x3b')][_0xb1db('0x4b')]({'where':{'id':_0x4b38a7[_0xb1db('0x42')]['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x4b8742,null))[_0xb1db('0x22')](function(_0x4a4a70){if(_0x4a4a70){_0x4b38a7['body'][_0xb1db('0x4c')]=_0x4a4a70['id'];_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x4d')]=integrations[_0xb1db('0x4e')](_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x4f')],_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x2a')]);_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x50')]=integrations[_0xb1db('0x51')](_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x4f')],_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x2a')]);return db[_0xb1db('0x47')]['create'](_0x4b38a7[_0xb1db('0x45')],{'include':[{'model':db['SugarcrmField'],'as':_0xb1db('0x4d')},{'model':db[_0xb1db('0x52')],'as':'Descriptions'}]});}return null;})[_0xb1db('0x22')](respondWithResult(_0x4b8742,null))['catch'](handleError(_0x4b8742,null));};exports[_0xb1db('0x53')]=function(_0x433187,_0x4dc954,_0x565bb5){var _0x5e7839='';var _0x1b9ae0=['id',_0xb1db('0x26'),'assigned_user_id',_0xb1db('0x54'),_0xb1db('0x55'),_0xb1db('0x56'),_0xb1db('0x57'),_0xb1db('0x58'),_0xb1db('0x59'),_0xb1db('0x5a'),'parent_name','direction'];return db[_0xb1db('0x3b')][_0xb1db('0x4b')]({'where':{'id':_0x433187['params']['id']},'attributes':['id',_0xb1db('0x5b'),_0xb1db('0x5c'),_0xb1db('0x5d')]})[_0xb1db('0x22')](handleEntityNotFound(_0x4dc954,null))[_0xb1db('0x22')](function(_0x598951){if(_0x598951){_0x5e7839=_0x598951[_0xb1db('0x5d')];var _0x199d07=_0x5e7839[_0xb1db('0x5e')](-0x1);if(_0x199d07==='/'){_0x5e7839=_0x5e7839['substring'](0x0,_0x5e7839[_0xb1db('0x5f')](_0x199d07));}return rp({'method':_0xb1db('0x60'),'uri':util[_0xb1db('0x61')](_0xb1db('0x62'),_0x5e7839,_0xb1db('0x63')),'json':!![],'form':{'method':_0xb1db('0x64'),'input_type':_0xb1db('0x65'),'response_type':_0xb1db('0x65'),'rest_data':JSON[_0xb1db('0x66')]({'user_auth':{'user_name':_0x598951[_0xb1db('0x5b')],'password':_0x598951[_0xb1db('0x5c')],'encryption':'PLAIN'},'application':_0xb1db('0x67')})}});}})[_0xb1db('0x22')](function(_0x4f4f90){if(_0x4f4f90&&_0x4f4f90[_0xb1db('0x26')]!==_0xb1db('0x68')&&_0x4f4f90['name']!==_0xb1db('0x69')){return rp({'method':_0xb1db('0x60'),'uri':util['format'](_0xb1db('0x62'),_0x5e7839,_0xb1db('0x63')),'json':!![],'form':{'method':_0xb1db('0x6a'),'input_type':_0xb1db('0x65'),'response_type':_0xb1db('0x65'),'rest_data':JSON[_0xb1db('0x66')]({'session':_0x4f4f90['id'],'module_name':_0xb1db('0x6b')})}})[_0xb1db('0x22')](function(_0x1896d9){if(_0x1896d9){var _0x2b09b9=_[_0xb1db('0x6c')](_0x1896d9['module_fields']);_['remove'](_0x2b09b9,function(_0x30b009){return _0x1b9ae0['includes'](_0x30b009[_0xb1db('0x26')]);});return{'count':_0x2b09b9['length'],'rows':_[_0xb1db('0x27')](_0x2b09b9,function(_0x13bbda){return{'id':_0x13bbda[_0xb1db('0x26')],'name':_0x13bbda[_0xb1db('0x6d')],'custom':_[_0xb1db('0x6e')](_0x13bbda['name'],'_c')?!![]:![],'options':_0x13bbda[_0xb1db('0x3a')]?_[_0xb1db('0x27')](_[_0xb1db('0x6c')](_0x13bbda[_0xb1db('0x3a')]),function(_0x2733ee){return{'name':_0x2733ee[_0xb1db('0x6f')],'value':_0x2733ee['name']};}):[]};})};}})[_0xb1db('0x22')](respondWithResult(_0x4dc954,null))[_0xb1db('0x40')](function(_0x4789fe){var _0x588fb4=_0x433187[_0xb1db('0x2d')][_0xb1db('0x70')]?0x1f4:_0x4789fe[_0xb1db('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb1db('0x53'),_0x588fb4,JSON['stringify'](_0x4789fe));delete _0x4789fe[_0xb1db('0x26')];if(_0x588fb4===0x191){_0x588fb4=0x190;}_0x4dc954[_0xb1db('0x19')](_0x588fb4)[_0xb1db('0x72')](_0x433187['query'][_0xb1db('0x70')]?{'message':_0xb1db('0x73'),'statusCode':_0x4789fe[_0xb1db('0x71')]}:_0x4789fe);});}else{var _0x4c889a=0x1f4;_0x4dc954[_0xb1db('0x19')](_0x4c889a)[_0xb1db('0x72')]({'message':_0xb1db('0x73'),'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 93cda5b..ae49251 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 _0xbba6=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbba6,0x1a4));var _0x6bba=function(_0x2f98a7,_0x12326a){_0x2f98a7=_0x2f98a7-0x0;var _0x17f5e4=_0xbba6[_0x2f98a7];return _0x17f5e4;};'use strict';var _=require(_0x6bba('0x0'));var util=require(_0x6bba('0x1'));var logger=require(_0x6bba('0x2'))('api');var moment=require(_0x6bba('0x3'));var BPromise=require(_0x6bba('0x4'));var rp=require(_0x6bba('0x5'));var fs=require('fs');var path=require(_0x6bba('0x6'));var rimraf=require(_0x6bba('0x7'));var config=require(_0x6bba('0x8'));var attributes=require(_0x6bba('0x9'));var integrations=require(_0x6bba('0xa'));module[_0x6bba('0xb')]=function(_0x5d04a3,_0x3bc00b){return _0x5d04a3['define'](_0x6bba('0xc'),attributes,{'tableName':_0x6bba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef35=['moment','bluebird','../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x11ee99,_0xa743ed){var _0x469072=function(_0xdaef8){while(--_0xdaef8){_0x11ee99['push'](_0x11ee99['shift']());}};_0x469072(++_0xa743ed);}(_0xef35,0xa8));var _0x5ef3=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xef35[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x5ef3('0x0'));var util=require(_0x5ef3('0x1'));var logger=require(_0x5ef3('0x2'))('api');var moment=require(_0x5ef3('0x3'));var BPromise=require(_0x5ef3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ef3('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5ef3('0x6'));module[_0x5ef3('0x7')]=function(_0xffaa70,_0x4b3014){return _0xffaa70[_0x5ef3('0x8')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 1285888..2ea076d 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 _0x4fc5=['catch','options','raw','limit','include','map','model','attributes','GetSugarcrmAccount','debug','ShowSugarcrmAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x561032,_0x15fb29){var _0x2dfa51=function(_0xb06e5){while(--_0xb06e5){_0x561032['push'](_0x561032['shift']());}};_0x2dfa51(++_0x15fb29);}(_0x4fc5,0xdf));var _0x54fc=function(_0x10be58,_0x41cdad){_0x10be58=_0x10be58-0x0;var _0x14deb3=_0x4fc5[_0x10be58];return _0x14deb3;};'use strict';var _=require(_0x54fc('0x0'));var util=require(_0x54fc('0x1'));var moment=require(_0x54fc('0x2'));var BPromise=require(_0x54fc('0x3'));var rs=require(_0x54fc('0x4'));var fs=require('fs');var Redis=require(_0x54fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x54fc('0x6'));var logger=require(_0x54fc('0x7'))(_0x54fc('0x8'));var config=require('../../config/environment');var jayson=require(_0x54fc('0x9'));var client=jayson[_0x54fc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a15ea,_0x41a424,_0x46a4c){return new BPromise(function(_0x884c55,_0x5e1b94){return client[_0x54fc('0xb')](_0x5a15ea,_0x46a4c)[_0x54fc('0xc')](function(_0x418f17){logger[_0x54fc('0xd')](_0x54fc('0xe'),_0x41a424,_0x54fc('0xf'));logger['debug'](_0x54fc('0x10'),_0x41a424,_0x54fc('0xf'),JSON[_0x54fc('0x11')](_0x418f17));if(_0x418f17[_0x54fc('0x12')]){if(_0x418f17['error'][_0x54fc('0x13')]===0x1f4){logger[_0x54fc('0x12')](_0x54fc('0xe'),_0x41a424,_0x418f17['error'][_0x54fc('0x14')]);return _0x5e1b94(_0x418f17['error']['message']);}logger[_0x54fc('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x41a424,_0x418f17[_0x54fc('0x12')][_0x54fc('0x14')]);return _0x884c55(_0x418f17['error'][_0x54fc('0x14')]);}else{logger[_0x54fc('0xd')](_0x54fc('0xe'),_0x41a424,_0x54fc('0xf'));_0x884c55(_0x418f17[_0x54fc('0x15')][_0x54fc('0x14')]);}})[_0x54fc('0x16')](function(_0x101565){logger[_0x54fc('0x12')](_0x54fc('0xe'),_0x41a424,_0x101565);_0x5e1b94(_0x101565);});});}exports['GetSugarcrmAccount']=function(_0x3c7041){var _0x595a40=this;return new Promise(function(_0x19811f,_0x6c5893){return db['SugarcrmAccount']['findAll']({'raw':_0x3c7041[_0x54fc('0x17')]?_0x3c7041[_0x54fc('0x17')][_0x54fc('0x18')]===undefined?!![]:![]:!![],'where':_0x3c7041['options']?_0x3c7041['options']['where']||null:null,'attributes':_0x3c7041[_0x54fc('0x17')]?_0x3c7041[_0x54fc('0x17')]['attributes']||null:null,'limit':_0x3c7041[_0x54fc('0x17')]?_0x3c7041[_0x54fc('0x17')][_0x54fc('0x19')]||null:null,'include':_0x3c7041[_0x54fc('0x17')]?_0x3c7041['options'][_0x54fc('0x1a')]?_[_0x54fc('0x1b')](_0x3c7041['options'][_0x54fc('0x1a')],function(_0x48e01a){return{'model':db[_0x48e01a[_0x54fc('0x1c')]],'as':_0x48e01a['as'],'attributes':_0x48e01a[_0x54fc('0x1d')],'include':_0x48e01a[_0x54fc('0x1a')]?_['map'](_0x48e01a[_0x54fc('0x1a')],function(_0x34bbc5){return{'model':db[_0x34bbc5[_0x54fc('0x1c')]],'as':_0x34bbc5['as'],'attributes':_0x34bbc5['attributes'],'include':_0x34bbc5[_0x54fc('0x1a')]?_[_0x54fc('0x1b')](_0x34bbc5['include'],function(_0x3e8cc6){return{'model':db[_0x3e8cc6[_0x54fc('0x1c')]],'as':_0x3e8cc6['as'],'attributes':_0x3e8cc6[_0x54fc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x54fc('0xc')](function(_0x30f875){logger[_0x54fc('0xd')](_0x54fc('0x1e'),_0x3c7041);logger[_0x54fc('0x1f')](_0x54fc('0x1e'),_0x3c7041,JSON[_0x54fc('0x11')](_0x30f875));_0x19811f(_0x30f875);})['catch'](function(_0xaea544){logger[_0x54fc('0x12')](_0x54fc('0x1e'),_0xaea544['message'],_0x3c7041);_0x6c5893(_0x595a40[_0x54fc('0x12')](0x1f4,_0xaea544[_0x54fc('0x14')]));});});};exports[_0x54fc('0x20')]=function(_0x480ec5){var _0x3f5c72=this;return new Promise(function(_0x56e0fc,_0x1c4d57){return db['SugarcrmAccount'][_0x54fc('0x21')]({'raw':_0x480ec5[_0x54fc('0x17')]?_0x480ec5[_0x54fc('0x17')][_0x54fc('0x18')]===undefined?!![]:![]:!![],'where':_0x480ec5[_0x54fc('0x17')]?_0x480ec5[_0x54fc('0x17')][_0x54fc('0x22')]||null:null,'attributes':_0x480ec5['options']?_0x480ec5[_0x54fc('0x17')][_0x54fc('0x1d')]||null:null,'include':_0x480ec5[_0x54fc('0x17')]?_0x480ec5[_0x54fc('0x17')][_0x54fc('0x1a')]?_['map'](_0x480ec5[_0x54fc('0x17')][_0x54fc('0x1a')],function(_0x1a1eba){return{'model':db[_0x1a1eba['model']],'as':_0x1a1eba['as'],'attributes':_0x1a1eba[_0x54fc('0x1d')],'include':_0x1a1eba[_0x54fc('0x1a')]?_[_0x54fc('0x1b')](_0x1a1eba[_0x54fc('0x1a')],function(_0x5e81b2){return{'model':db[_0x5e81b2[_0x54fc('0x1c')]],'as':_0x5e81b2['as'],'attributes':_0x5e81b2[_0x54fc('0x1d')],'include':_0x5e81b2[_0x54fc('0x1a')]?_[_0x54fc('0x1b')](_0x5e81b2[_0x54fc('0x1a')],function(_0x572d09){return{'model':db[_0x572d09['model']],'as':_0x572d09['as'],'attributes':_0x572d09[_0x54fc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x368472){logger[_0x54fc('0xd')](_0x54fc('0x20'),_0x480ec5);logger['debug'](_0x54fc('0x20'),_0x480ec5,JSON[_0x54fc('0x11')](_0x368472));_0x56e0fc(_0x368472);})[_0x54fc('0x16')](function(_0x49bbee){logger['error'](_0x54fc('0x20'),_0x49bbee['message'],_0x480ec5);_0x1c4d57(_0x3f5c72['error'](0x1f4,_0x49bbee[_0x54fc('0x14')]));});});}; \ No newline at end of file +var _0xce11=['raw','where','attributes','limit','include','map','model','stringify','ShowSugarcrmAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x139089,_0x4339ce){var _0x5a724d=function(_0x4371b4){while(--_0x4371b4){_0x139089['push'](_0x139089['shift']());}};_0x5a724d(++_0x4339ce);}(_0xce11,0x73));var _0x1ce1=function(_0x3d462b,_0x64d0c2){_0x3d462b=_0x3d462b-0x0;var _0x29546a=_0xce11[_0x3d462b];return _0x29546a;};'use strict';var _=require(_0x1ce1('0x0'));var util=require('util');var moment=require(_0x1ce1('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ce1('0x2'));var fs=require('fs');var Redis=require(_0x1ce1('0x3'));var db=require(_0x1ce1('0x4'))['db'];var utils=require(_0x1ce1('0x5'));var logger=require(_0x1ce1('0x6'))(_0x1ce1('0x7'));var config=require(_0x1ce1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ce1('0x9')][_0x1ce1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eb9d1,_0x245c8d,_0x32d48a){return new BPromise(function(_0x5bf803,_0x108ab0){return client[_0x1ce1('0xb')](_0x2eb9d1,_0x32d48a)[_0x1ce1('0xc')](function(_0x3660f6){logger[_0x1ce1('0xd')](_0x1ce1('0xe'),_0x245c8d,_0x1ce1('0xf'));logger[_0x1ce1('0x10')](_0x1ce1('0x11'),_0x245c8d,_0x1ce1('0xf'),JSON['stringify'](_0x3660f6));if(_0x3660f6[_0x1ce1('0x12')]){if(_0x3660f6['error']['code']===0x1f4){logger['error'](_0x1ce1('0xe'),_0x245c8d,_0x3660f6[_0x1ce1('0x12')][_0x1ce1('0x13')]);return _0x108ab0(_0x3660f6[_0x1ce1('0x12')][_0x1ce1('0x13')]);}logger[_0x1ce1('0x12')](_0x1ce1('0xe'),_0x245c8d,_0x3660f6[_0x1ce1('0x12')][_0x1ce1('0x13')]);return _0x5bf803(_0x3660f6[_0x1ce1('0x12')]['message']);}else{logger[_0x1ce1('0xd')](_0x1ce1('0xe'),_0x245c8d,_0x1ce1('0xf'));_0x5bf803(_0x3660f6['result']['message']);}})[_0x1ce1('0x14')](function(_0x20f305){logger[_0x1ce1('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x245c8d,_0x20f305);_0x108ab0(_0x20f305);});});}exports[_0x1ce1('0x15')]=function(_0x5a5897){var _0x112701=this;return new Promise(function(_0x3ac57d,_0x2bffac){return db[_0x1ce1('0x16')][_0x1ce1('0x17')]({'raw':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897[_0x1ce1('0x18')][_0x1ce1('0x19')]===undefined?!![]:![]:!![],'where':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897['options'][_0x1ce1('0x1a')]||null:null,'attributes':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897[_0x1ce1('0x18')][_0x1ce1('0x1b')]||null:null,'limit':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897[_0x1ce1('0x18')][_0x1ce1('0x1c')]||null:null,'include':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897['options'][_0x1ce1('0x1d')]?_[_0x1ce1('0x1e')](_0x5a5897[_0x1ce1('0x18')]['include'],function(_0x45bcbb){return{'model':db[_0x45bcbb[_0x1ce1('0x1f')]],'as':_0x45bcbb['as'],'attributes':_0x45bcbb[_0x1ce1('0x1b')],'include':_0x45bcbb[_0x1ce1('0x1d')]?_['map'](_0x45bcbb[_0x1ce1('0x1d')],function(_0x4c22e8){return{'model':db[_0x4c22e8[_0x1ce1('0x1f')]],'as':_0x4c22e8['as'],'attributes':_0x4c22e8[_0x1ce1('0x1b')],'include':_0x4c22e8['include']?_['map'](_0x4c22e8[_0x1ce1('0x1d')],function(_0x13c18d){return{'model':db[_0x13c18d[_0x1ce1('0x1f')]],'as':_0x13c18d['as'],'attributes':_0x13c18d[_0x1ce1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1ce1('0xc')](function(_0x735916){logger['info'](_0x1ce1('0x15'),_0x5a5897);logger[_0x1ce1('0x10')](_0x1ce1('0x15'),_0x5a5897,JSON[_0x1ce1('0x20')](_0x735916));_0x3ac57d(_0x735916);})[_0x1ce1('0x14')](function(_0x2289dd){logger['error'](_0x1ce1('0x15'),_0x2289dd[_0x1ce1('0x13')],_0x5a5897);_0x2bffac(_0x112701[_0x1ce1('0x12')](0x1f4,_0x2289dd[_0x1ce1('0x13')]));});});};exports[_0x1ce1('0x21')]=function(_0x4f1fa5){var _0xa1a993=this;return new Promise(function(_0x11e9e3,_0x4cdaf6){return db['SugarcrmAccount'][_0x1ce1('0x22')]({'raw':_0x4f1fa5['options']?_0x4f1fa5[_0x1ce1('0x18')][_0x1ce1('0x19')]===undefined?!![]:![]:!![],'where':_0x4f1fa5[_0x1ce1('0x18')]?_0x4f1fa5['options'][_0x1ce1('0x1a')]||null:null,'attributes':_0x4f1fa5[_0x1ce1('0x18')]?_0x4f1fa5[_0x1ce1('0x18')][_0x1ce1('0x1b')]||null:null,'include':_0x4f1fa5['options']?_0x4f1fa5[_0x1ce1('0x18')]['include']?_[_0x1ce1('0x1e')](_0x4f1fa5['options'][_0x1ce1('0x1d')],function(_0x56a52e){return{'model':db[_0x56a52e[_0x1ce1('0x1f')]],'as':_0x56a52e['as'],'attributes':_0x56a52e[_0x1ce1('0x1b')],'include':_0x56a52e[_0x1ce1('0x1d')]?_[_0x1ce1('0x1e')](_0x56a52e[_0x1ce1('0x1d')],function(_0x1ac916){return{'model':db[_0x1ac916[_0x1ce1('0x1f')]],'as':_0x1ac916['as'],'attributes':_0x1ac916[_0x1ce1('0x1b')],'include':_0x1ac916[_0x1ce1('0x1d')]?_[_0x1ce1('0x1e')](_0x1ac916[_0x1ce1('0x1d')],function(_0x497226){return{'model':db[_0x497226[_0x1ce1('0x1f')]],'as':_0x497226['as'],'attributes':_0x497226['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ce1('0xc')](function(_0x5f0ad6){logger['info'](_0x1ce1('0x21'),_0x4f1fa5);logger[_0x1ce1('0x10')](_0x1ce1('0x21'),_0x4f1fa5,JSON['stringify'](_0x5f0ad6));_0x11e9e3(_0x5f0ad6);})['catch'](function(_0xddf5c6){logger['error'](_0x1ce1('0x21'),_0xddf5c6['message'],_0x4f1fa5);_0x4cdaf6(_0xa1a993['error'](0x1f4,_0xddf5c6[_0x1ce1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 024854c..5271caf 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 _0x972b=['index','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x56464a,_0x3551ba){var _0x25a4a9=function(_0x1bf19d){while(--_0x1bf19d){_0x56464a['push'](_0x56464a['shift']());}};_0x25a4a9(++_0x3551ba);}(_0x972b,0xff));var _0xb972=function(_0x2b2974,_0x13b4f8){_0x2b2974=_0x2b2974-0x0;var _0x3e509e=_0x972b[_0x2b2974];return _0x3e509e;};'use strict';var multer=require(_0xb972('0x0'));var util=require(_0xb972('0x1'));var path=require(_0xb972('0x2'));var timeout=require(_0xb972('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb972('0x4'));var auth=require(_0xb972('0x5'));var interaction=require(_0xb972('0x6'));var config=require(_0xb972('0x7'));var controller=require(_0xb972('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb972('0x9')]);router[_0xb972('0xa')](_0xb972('0xb'),auth[_0xb972('0xc')](),controller[_0xb972('0xd')]);router['get']('/:id/fields',auth[_0xb972('0xc')](),controller[_0xb972('0xe')]);router[_0xb972('0xa')](_0xb972('0xf'),auth['isAuthenticated'](),controller[_0xb972('0x10')]);router['get'](_0xb972('0x11'),auth[_0xb972('0xc')](),controller[_0xb972('0x12')]);router[_0xb972('0x13')]('/',auth[_0xb972('0xc')](),controller[_0xb972('0x14')]);router[_0xb972('0x15')](_0xb972('0xb'),auth[_0xb972('0xc')](),controller[_0xb972('0x16')]);router['delete'](_0xb972('0xb'),auth[_0xb972('0xc')](),controller['destroy']);module[_0xb972('0x17')]=router; \ No newline at end of file +var _0x52cd=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','destroy','exports'];(function(_0x40372f,_0x54574a){var _0x5cc1b8=function(_0x3a1c0c){while(--_0x3a1c0c){_0x40372f['push'](_0x40372f['shift']());}};_0x5cc1b8(++_0x54574a);}(_0x52cd,0x1e0));var _0xd52c=function(_0xdad321,_0x43f77b){_0xdad321=_0xdad321-0x0;var _0x559d84=_0x52cd[_0xdad321];return _0x559d84;};'use strict';var multer=require('multer');var util=require(_0xd52c('0x0'));var path=require(_0xd52c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd52c('0x2')]();var fs_extra=require(_0xd52c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd52c('0x4'));var config=require(_0xd52c('0x5'));var controller=require(_0xd52c('0x6'));router[_0xd52c('0x7')]('/',auth['isAuthenticated'](),controller[_0xd52c('0x8')]);router['get'](_0xd52c('0x9'),auth[_0xd52c('0xa')](),controller['show']);router[_0xd52c('0x7')](_0xd52c('0xb'),auth[_0xd52c('0xa')](),controller['getFields']);router[_0xd52c('0x7')](_0xd52c('0xc'),auth[_0xd52c('0xa')](),controller[_0xd52c('0xd')]);router[_0xd52c('0x7')](_0xd52c('0xe'),auth[_0xd52c('0xa')](),controller[_0xd52c('0xf')]);router[_0xd52c('0x10')]('/',auth[_0xd52c('0xa')](),controller[_0xd52c('0x11')]);router['put'](_0xd52c('0x9'),auth[_0xd52c('0xa')](),controller['update']);router['delete'](_0xd52c('0x9'),auth['isAuthenticated'](),controller[_0xd52c('0x12')]);module[_0xd52c('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 097c996..903d9ce 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 _0x508a=['sequelize','STRING'];(function(_0x3f69ba,_0x2a831b){var _0x61254d=function(_0x1d7e83){while(--_0x1d7e83){_0x3f69ba['push'](_0x3f69ba['shift']());}};_0x61254d(++_0x2a831b);}(_0x508a,0x17a));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa508('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa508('0x1')]}}; \ No newline at end of file +var _0x58a0=['sequelize','exports','STRING'];(function(_0xbc5d3f,_0x4fd0b7){var _0x75de9f=function(_0xbe7e0d){while(--_0xbe7e0d){_0xbc5d3f['push'](_0xbc5d3f['shift']());}};_0x75de9f(++_0x4fd0b7);}(_0x58a0,0x18c));var _0x058a=function(_0x1d4c33,_0x30274f){_0x1d4c33=_0x1d4c33-0x0;var _0x3abfa2=_0x58a0[_0x1d4c33];return _0x3abfa2;};'use strict';var Sequelize=require(_0x058a('0x0'));module[_0x058a('0x1')]={'name':{'type':Sequelize[_0x058a('0x2')]},'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 7fdb716..1bcd9d6 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 _0xa74b=['error','stack','name','send','map','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','type','VIRTUAL','merge','options','includeAll','SugarcrmConfiguration','findAll','rows','catch','show','params','rawAttributes','length','include','find','body','update','getFields','findOne','SugarcrmField','filter','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','then','destroy'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xa74b,0x157));var _0xba74=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa74b[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xba74('0x0'));var rimraf=require(_0xba74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba74('0x2'));var rp=require(_0xba74('0x3'));var moment=require(_0xba74('0x4'));var BPromise=require(_0xba74('0x5'));var Mustache=require(_0xba74('0x6'));var util=require('util');var path=require('path');var sox=require(_0xba74('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xba74('0x8'));var crypto=require('crypto');var jsforce=require(_0xba74('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xba74('0xa'));var querystring=require(_0xba74('0xb'));var Papa=require(_0xba74('0xc'));var Redis=require(_0xba74('0xd'));var authService=require(_0xba74('0xe'));var qs=require(_0xba74('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba74('0x10'))(_0xba74('0x11'));var utils=require('../../config/utils');var config=require(_0xba74('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xba74('0x13'))['db'];function respondWithStatusCode(_0x34caab,_0x2bbe8c){_0x2bbe8c=_0x2bbe8c||0xcc;return function(_0x1e9515){if(_0x1e9515){return _0x34caab[_0xba74('0x14')](_0x2bbe8c);}return _0x34caab[_0xba74('0x15')](_0x2bbe8c)[_0xba74('0x16')]();};}function respondWithResult(_0x40770c,_0x237d6b){_0x237d6b=_0x237d6b||0xc8;return function(_0x482251){if(_0x482251){return _0x40770c[_0xba74('0x15')](_0x237d6b)[_0xba74('0x17')](_0x482251);}};}function respondWithFilteredResult(_0x333672,_0x14f062){return function(_0x119b73){if(_0x119b73){var _0x47fb6e=typeof _0x14f062[_0xba74('0x18')]===_0xba74('0x19')&&typeof _0x14f062['limit']===_0xba74('0x19');var _0x4b73ca=_0x119b73['count'];var _0x2862df=_0x47fb6e?0x0:_0x14f062['offset'];var _0x13ad2f=_0x47fb6e?_0x119b73[_0xba74('0x1a')]:_0x14f062[_0xba74('0x18')]+_0x14f062['limit'];var _0x4d1e4b;if(_0x13ad2f>=_0x4b73ca){_0x13ad2f=_0x4b73ca;_0x4d1e4b=0xc8;}else{_0x4d1e4b=0xce;}_0x333672[_0xba74('0x15')](_0x4d1e4b);return _0x333672[_0xba74('0x1b')](_0xba74('0x1c'),_0x2862df+'-'+_0x13ad2f+'/'+_0x4b73ca)['json'](_0x119b73);}return null;};}function patchUpdates(_0x2c19c5){return function(_0x63f0e4){try{jsonpatch['apply'](_0x63f0e4,_0x2c19c5,!![]);}catch(_0x14f342){return BPromise['reject'](_0x14f342);}return _0x63f0e4[_0xba74('0x1d')]();};}function saveUpdates(_0x89c36e,_0x542fb0){return function(_0x43e742){if(_0x43e742){return _0x43e742['update'](_0x89c36e)[_0xba74('0x1e')](function(_0x50b8dc){return _0x50b8dc;});}return null;};}function removeEntity(_0x1ff822,_0x2862e8){return function(_0x499410){if(_0x499410){return _0x499410[_0xba74('0x1f')]()[_0xba74('0x1e')](function(){_0x1ff822['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a0e1c,_0x5c1985){return function(_0x120da9){if(!_0x120da9){_0x4a0e1c[_0xba74('0x14')](0x194);}return _0x120da9;};}function handleError(_0x585654,_0xe2836e){_0xe2836e=_0xe2836e||0x1f4;return function(_0x1dc5ec){logger[_0xba74('0x20')](_0x1dc5ec[_0xba74('0x21')]);if(_0x1dc5ec[_0xba74('0x22')]){delete _0x1dc5ec[_0xba74('0x22')];}_0x585654[_0xba74('0x15')](_0xe2836e)[_0xba74('0x23')](_0x1dc5ec);};}exports['index']=function(_0x34b008,_0xf29e31){var _0x3b7772={},_0x3e2881={},_0x4e738d={'count':0x0,'rows':[]};var _0x599ae4=_[_0xba74('0x24')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x11009c){return{'name':_0x11009c[_0xba74('0x25')],'type':_0x11009c['type']['key']};});_0x3e2881[_0xba74('0x26')]=_[_0xba74('0x24')](_0x599ae4,_0xba74('0x22'));_0x3e2881[_0xba74('0x27')]=_[_0xba74('0x28')](_0x34b008[_0xba74('0x27')]);_0x3e2881['filters']=_[_0xba74('0x29')](_0x3e2881[_0xba74('0x26')],_0x3e2881['query']);_0x3b7772['attributes']=_[_0xba74('0x29')](_0x3e2881[_0xba74('0x26')],qs[_0xba74('0x2a')](_0x34b008[_0xba74('0x27')]['fields']));_0x3b7772[_0xba74('0x2b')]=_0x3b7772[_0xba74('0x2b')]['length']?_0x3b7772['attributes']:_0x3e2881[_0xba74('0x26')];if(!_0x34b008[_0xba74('0x27')][_0xba74('0x2c')](_0xba74('0x2d'))){_0x3b7772[_0xba74('0x2e')]=qs[_0xba74('0x2e')](_0x34b008[_0xba74('0x27')][_0xba74('0x2e')]);_0x3b7772[_0xba74('0x18')]=qs[_0xba74('0x18')](_0x34b008[_0xba74('0x27')][_0xba74('0x18')]);}_0x3b7772[_0xba74('0x2f')]=qs[_0xba74('0x30')](_0x34b008[_0xba74('0x27')][_0xba74('0x30')]);_0x3b7772[_0xba74('0x31')]=qs[_0xba74('0x32')](_[_0xba74('0x33')](_0x34b008[_0xba74('0x27')],_0x3e2881[_0xba74('0x32')]),_0x599ae4);if(_0x34b008[_0xba74('0x27')]['filter']){_0x3b7772[_0xba74('0x31')]=_['merge'](_0x3b7772[_0xba74('0x31')],{'$or':_[_0xba74('0x24')](_0x599ae4,function(_0x4540dc){if(_0x4540dc[_0xba74('0x34')]!==_0xba74('0x35')){var _0x3c66c3={};_0x3c66c3[_0x4540dc[_0xba74('0x22')]]={'$like':'%'+_0x34b008['query']['filter']+'%'};return _0x3c66c3;}})});}_0x3b7772=_[_0xba74('0x36')]({},_0x3b7772,_0x34b008[_0xba74('0x37')]);var _0x38953a={'where':_0x3b7772[_0xba74('0x31')]};return db['SugarcrmConfiguration']['count'](_0x38953a)[_0xba74('0x1e')](function(_0x5b2605){_0x4e738d[_0xba74('0x1a')]=_0x5b2605;if(_0x34b008['query'][_0xba74('0x38')]){_0x3b7772['include']=[{'all':!![]}];}return db[_0xba74('0x39')][_0xba74('0x3a')](_0x3b7772);})[_0xba74('0x1e')](function(_0x1fbd84){_0x4e738d[_0xba74('0x3b')]=_0x1fbd84;return _0x4e738d;})[_0xba74('0x1e')](respondWithFilteredResult(_0xf29e31,_0x3b7772))[_0xba74('0x3c')](handleError(_0xf29e31,null));};exports[_0xba74('0x3d')]=function(_0x197f61,_0x43755f){var _0x354a31={'raw':![],'where':{'id':_0x197f61[_0xba74('0x3e')]['id']}},_0x5c1f72={};_0x5c1f72[_0xba74('0x26')]=_[_0xba74('0x28')](db[_0xba74('0x39')][_0xba74('0x3f')]);_0x5c1f72[_0xba74('0x27')]=_[_0xba74('0x28')](_0x197f61[_0xba74('0x27')]);_0x5c1f72[_0xba74('0x32')]=_[_0xba74('0x29')](_0x5c1f72[_0xba74('0x26')],_0x5c1f72[_0xba74('0x27')]);_0x354a31['attributes']=_[_0xba74('0x29')](_0x5c1f72[_0xba74('0x26')],qs['fields'](_0x197f61['query']['fields']));_0x354a31[_0xba74('0x2b')]=_0x354a31['attributes'][_0xba74('0x40')]?_0x354a31[_0xba74('0x2b')]:_0x5c1f72[_0xba74('0x26')];if(_0x197f61[_0xba74('0x27')][_0xba74('0x38')]){_0x354a31[_0xba74('0x41')]=[{'all':!![]}];}_0x354a31=_[_0xba74('0x36')]({},_0x354a31,_0x197f61[_0xba74('0x37')]);return db['SugarcrmConfiguration'][_0xba74('0x42')](_0x354a31)[_0xba74('0x1e')](handleEntityNotFound(_0x43755f,null))['then'](respondWithResult(_0x43755f,null))[_0xba74('0x3c')](handleError(_0x43755f,null));};exports['create']=function(_0x29bf34,_0x5911a2){return db[_0xba74('0x39')]['create'](_0x29bf34[_0xba74('0x43')],{})[_0xba74('0x1e')](respondWithResult(_0x5911a2,0xc9))['catch'](handleError(_0x5911a2,null));};exports[_0xba74('0x44')]=function(_0xede846,_0x28927e){if(_0xede846[_0xba74('0x43')]['id']){delete _0xede846[_0xba74('0x43')]['id'];}return db['SugarcrmConfiguration'][_0xba74('0x42')]({'where':{'id':_0xede846[_0xba74('0x3e')]['id']}})['then'](handleEntityNotFound(_0x28927e,null))[_0xba74('0x1e')](saveUpdates(_0xede846['body'],null))[_0xba74('0x1e')](respondWithResult(_0x28927e,null))[_0xba74('0x3c')](handleError(_0x28927e,null));};exports[_0xba74('0x1f')]=function(_0xf34363,_0x3ccc76){return db[_0xba74('0x39')]['find']({'where':{'id':_0xf34363[_0xba74('0x3e')]['id']}})[_0xba74('0x1e')](handleEntityNotFound(_0x3ccc76,null))['then'](removeEntity(_0x3ccc76,null))['catch'](handleError(_0x3ccc76,null));};exports[_0xba74('0x45')]=function(_0x390cb5,_0x13e06f,_0x2d3242){var _0x36efc8={};var _0x107ab5={};var _0xcf0296;var _0x4f7749;return db[_0xba74('0x39')][_0xba74('0x46')]({'where':{'id':_0x390cb5[_0xba74('0x3e')]['id']}})[_0xba74('0x1e')](handleEntityNotFound(_0x13e06f,null))[_0xba74('0x1e')](function(_0x24d6fa){if(_0x24d6fa){_0xcf0296=_0x24d6fa;_0x107ab5[_0xba74('0x26')]=_[_0xba74('0x28')](db[_0xba74('0x47')][_0xba74('0x3f')]);_0x107ab5[_0xba74('0x27')]=_[_0xba74('0x28')](_0x390cb5[_0xba74('0x27')]);_0x107ab5[_0xba74('0x32')]=_['intersection'](_0x107ab5['model'],_0x107ab5['query']);_0x36efc8['attributes']=_[_0xba74('0x29')](_0x107ab5['model'],qs['fields'](_0x390cb5[_0xba74('0x27')]['fields']));_0x36efc8[_0xba74('0x2b')]=_0x36efc8[_0xba74('0x2b')]['length']?_0x36efc8[_0xba74('0x2b')]:_0x107ab5[_0xba74('0x26')];_0x36efc8[_0xba74('0x2f')]=qs[_0xba74('0x30')](_0x390cb5['query'][_0xba74('0x30')]);_0x36efc8[_0xba74('0x31')]=qs[_0xba74('0x32')](_[_0xba74('0x33')](_0x390cb5[_0xba74('0x27')],_0x107ab5['filters']));if(_0x390cb5['query'][_0xba74('0x48')]){_0x36efc8['where']=_[_0xba74('0x36')](_0x36efc8[_0xba74('0x31')],{'$or':_[_0xba74('0x24')](_0x36efc8[_0xba74('0x2b')],function(_0x529217){var _0x57adea={};_0x57adea[_0x529217]={'$like':'%'+_0x390cb5[_0xba74('0x27')]['filter']+'%'};return _0x57adea;})});}_0x36efc8=_['merge']({},_0x36efc8,_0x390cb5[_0xba74('0x37')]);return _0xcf0296[_0xba74('0x45')](_0x36efc8);}})[_0xba74('0x1e')](function(_0x9f15a5){if(_0x9f15a5){_0x4f7749=_0x9f15a5[_0xba74('0x40')];if(!_0x390cb5[_0xba74('0x27')][_0xba74('0x2c')](_0xba74('0x2d'))){_0x36efc8[_0xba74('0x2e')]=qs[_0xba74('0x2e')](_0x390cb5[_0xba74('0x27')][_0xba74('0x2e')]);_0x36efc8['offset']=qs[_0xba74('0x18')](_0x390cb5['query']['offset']);}return _0xcf0296[_0xba74('0x45')](_0x36efc8);}})['then'](function(_0x3ef11a){if(_0x3ef11a){return _0x3ef11a?{'count':_0x4f7749,'rows':_0x3ef11a}:null;}})[_0xba74('0x1e')](respondWithResult(_0x13e06f,null))['catch'](handleError(_0x13e06f,null));};exports[_0xba74('0x49')]=function(_0x37876a,_0x22995c,_0x3a0e8f){var _0x459b5d={};var _0x18438d={};var _0x4afab6;var _0x473317;return db[_0xba74('0x39')]['findOne']({'where':{'id':_0x37876a[_0xba74('0x3e')]['id']}})[_0xba74('0x1e')](handleEntityNotFound(_0x22995c,null))[_0xba74('0x1e')](function(_0x5ba4f6){if(_0x5ba4f6){_0x4afab6=_0x5ba4f6;_0x18438d['model']=_[_0xba74('0x28')](db['SugarcrmField'][_0xba74('0x3f')]);_0x18438d[_0xba74('0x27')]=_[_0xba74('0x28')](_0x37876a[_0xba74('0x27')]);_0x18438d[_0xba74('0x32')]=_['intersection'](_0x18438d[_0xba74('0x26')],_0x18438d[_0xba74('0x27')]);_0x459b5d[_0xba74('0x2b')]=_[_0xba74('0x29')](_0x18438d[_0xba74('0x26')],qs[_0xba74('0x2a')](_0x37876a[_0xba74('0x27')]['fields']));_0x459b5d[_0xba74('0x2b')]=_0x459b5d['attributes'][_0xba74('0x40')]?_0x459b5d[_0xba74('0x2b')]:_0x18438d[_0xba74('0x26')];_0x459b5d[_0xba74('0x2f')]=qs[_0xba74('0x30')](_0x37876a[_0xba74('0x27')][_0xba74('0x30')]);_0x459b5d['where']=qs[_0xba74('0x32')](_[_0xba74('0x33')](_0x37876a[_0xba74('0x27')],_0x18438d[_0xba74('0x32')]));if(_0x37876a[_0xba74('0x27')][_0xba74('0x48')]){_0x459b5d[_0xba74('0x31')]=_[_0xba74('0x36')](_0x459b5d[_0xba74('0x31')],{'$or':_[_0xba74('0x24')](_0x459b5d['attributes'],function(_0x22e565){var _0x535de3={};_0x535de3[_0x22e565]={'$like':'%'+_0x37876a[_0xba74('0x27')][_0xba74('0x48')]+'%'};return _0x535de3;})});}_0x459b5d=_[_0xba74('0x36')]({},_0x459b5d,_0x37876a['options']);return _0x4afab6[_0xba74('0x49')](_0x459b5d);}})[_0xba74('0x1e')](function(_0x4cac24){if(_0x4cac24){_0x473317=_0x4cac24[_0xba74('0x40')];if(!_0x37876a[_0xba74('0x27')][_0xba74('0x2c')]('nolimit')){_0x459b5d[_0xba74('0x2e')]=qs['limit'](_0x37876a['query'][_0xba74('0x2e')]);_0x459b5d[_0xba74('0x18')]=qs[_0xba74('0x18')](_0x37876a['query'][_0xba74('0x18')]);}return _0x4afab6[_0xba74('0x49')](_0x459b5d);}})[_0xba74('0x1e')](function(_0x7b105d){if(_0x7b105d){return _0x7b105d?{'count':_0x473317,'rows':_0x7b105d}:null;}})[_0xba74('0x1e')](respondWithResult(_0x22995c,null))[_0xba74('0x3c')](handleError(_0x22995c,null));};exports[_0xba74('0x4a')]=function(_0x49b2a5,_0x12e9fd,_0x2585e6){var _0xf5c37c={};var _0x4d2052={};var _0x151774;var _0x2ef299;return db[_0xba74('0x39')][_0xba74('0x46')]({'where':{'id':_0x49b2a5[_0xba74('0x3e')]['id']}})['then'](handleEntityNotFound(_0x12e9fd,null))[_0xba74('0x1e')](function(_0x1840bc){if(_0x1840bc){_0x151774=_0x1840bc;_0x4d2052[_0xba74('0x26')]=_[_0xba74('0x28')](db['SugarcrmField'][_0xba74('0x3f')]);_0x4d2052['query']=_[_0xba74('0x28')](_0x49b2a5[_0xba74('0x27')]);_0x4d2052[_0xba74('0x32')]=_[_0xba74('0x29')](_0x4d2052['model'],_0x4d2052[_0xba74('0x27')]);_0xf5c37c[_0xba74('0x2b')]=_[_0xba74('0x29')](_0x4d2052['model'],qs['fields'](_0x49b2a5[_0xba74('0x27')][_0xba74('0x2a')]));_0xf5c37c['attributes']=_0xf5c37c['attributes'][_0xba74('0x40')]?_0xf5c37c['attributes']:_0x4d2052[_0xba74('0x26')];_0xf5c37c[_0xba74('0x2f')]=qs['sort'](_0x49b2a5[_0xba74('0x27')]['sort']);_0xf5c37c[_0xba74('0x31')]=qs['filters'](_[_0xba74('0x33')](_0x49b2a5['query'],_0x4d2052['filters']));if(_0x49b2a5[_0xba74('0x27')][_0xba74('0x48')]){_0xf5c37c[_0xba74('0x31')]=_[_0xba74('0x36')](_0xf5c37c[_0xba74('0x31')],{'$or':_['map'](_0xf5c37c[_0xba74('0x2b')],function(_0x1cda37){var _0xda919d={};_0xda919d[_0x1cda37]={'$like':'%'+_0x49b2a5[_0xba74('0x27')]['filter']+'%'};return _0xda919d;})});}_0xf5c37c=_[_0xba74('0x36')]({},_0xf5c37c,_0x49b2a5[_0xba74('0x37')]);return _0x151774['getDescriptions'](_0xf5c37c);}})['then'](function(_0xc5d676){if(_0xc5d676){_0x2ef299=_0xc5d676['length'];if(!_0x49b2a5['query']['hasOwnProperty'](_0xba74('0x2d'))){_0xf5c37c[_0xba74('0x2e')]=qs[_0xba74('0x2e')](_0x49b2a5[_0xba74('0x27')]['limit']);_0xf5c37c[_0xba74('0x18')]=qs[_0xba74('0x18')](_0x49b2a5[_0xba74('0x27')][_0xba74('0x18')]);}return _0x151774[_0xba74('0x4a')](_0xf5c37c);}})[_0xba74('0x1e')](function(_0x12e3e0){if(_0x12e3e0){return _0x12e3e0?{'count':_0x2ef299,'rows':_0x12e3e0}:null;}})['then'](respondWithResult(_0x12e9fd,null))[_0xba74('0x3c')](handleError(_0x12e9fd,null));}; \ No newline at end of file +var _0xcc7a=['pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','getFields','findOne','SugarcrmField','options','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x119ef2,_0x46d595){var _0x90a833=function(_0x8ca83){while(--_0x8ca83){_0x119ef2['push'](_0x119ef2['shift']());}};_0x90a833(++_0x46d595);}(_0xcc7a,0x67));var _0xacc7=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xcc7a[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0xacc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacc7('0x1'));var jsonpatch=require(_0xacc7('0x2'));var rp=require(_0xacc7('0x3'));var moment=require(_0xacc7('0x4'));var BPromise=require(_0xacc7('0x5'));var Mustache=require(_0xacc7('0x6'));var util=require(_0xacc7('0x7'));var path=require(_0xacc7('0x8'));var sox=require(_0xacc7('0x9'));var csv=require(_0xacc7('0xa'));var ejs=require(_0xacc7('0xb'));var fs=require('fs');var fs_extra=require(_0xacc7('0xc'));var _=require(_0xacc7('0xd'));var squel=require(_0xacc7('0xe'));var crypto=require(_0xacc7('0xf'));var jsforce=require(_0xacc7('0x10'));var deskjs=require(_0xacc7('0x11'));var toCsv=require('to-csv');var querystring=require(_0xacc7('0x12'));var Papa=require(_0xacc7('0x13'));var Redis=require(_0xacc7('0x14'));var authService=require(_0xacc7('0x15'));var qs=require(_0xacc7('0x16'));var as=require(_0xacc7('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xacc7('0x18'));var utils=require('../../config/utils');var config=require(_0xacc7('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef527,_0x1b8fb2){_0x1b8fb2=_0x1b8fb2||0xcc;return function(_0x158bc8){if(_0x158bc8){return _0x1ef527[_0xacc7('0x1a')](_0x1b8fb2);}return _0x1ef527[_0xacc7('0x1b')](_0x1b8fb2)[_0xacc7('0x1c')]();};}function respondWithResult(_0x5f4baa,_0x3351ad){_0x3351ad=_0x3351ad||0xc8;return function(_0x55f9a0){if(_0x55f9a0){return _0x5f4baa[_0xacc7('0x1b')](_0x3351ad)['json'](_0x55f9a0);}};}function respondWithFilteredResult(_0x521cf2,_0x3b2461){return function(_0x4c0ebd){if(_0x4c0ebd){var _0x1afbb2=typeof _0x3b2461[_0xacc7('0x1d')]===_0xacc7('0x1e')&&typeof _0x3b2461[_0xacc7('0x1f')]==='undefined';var _0x1e8434=_0x4c0ebd[_0xacc7('0x20')];var _0x371677=_0x1afbb2?0x0:_0x3b2461[_0xacc7('0x1d')];var _0x573428=_0x1afbb2?_0x4c0ebd['count']:_0x3b2461['offset']+_0x3b2461[_0xacc7('0x1f')];var _0x24cb11;if(_0x573428>=_0x1e8434){_0x573428=_0x1e8434;_0x24cb11=0xc8;}else{_0x24cb11=0xce;}_0x521cf2[_0xacc7('0x1b')](_0x24cb11);return _0x521cf2[_0xacc7('0x21')](_0xacc7('0x22'),_0x371677+'-'+_0x573428+'/'+_0x1e8434)[_0xacc7('0x23')](_0x4c0ebd);}return null;};}function patchUpdates(_0x46e7fc){return function(_0x1379ba){try{jsonpatch['apply'](_0x1379ba,_0x46e7fc,!![]);}catch(_0x44bdc4){return BPromise[_0xacc7('0x24')](_0x44bdc4);}return _0x1379ba[_0xacc7('0x25')]();};}function saveUpdates(_0x39f1de,_0x2b3276){return function(_0x9d3867){if(_0x9d3867){return _0x9d3867[_0xacc7('0x26')](_0x39f1de)[_0xacc7('0x27')](function(_0x1b82a0){return _0x1b82a0;});}return null;};}function removeEntity(_0x3723c0,_0x20ee48){return function(_0x51425d){if(_0x51425d){return _0x51425d['destroy']()[_0xacc7('0x27')](function(){_0x3723c0[_0xacc7('0x1b')](0xcc)[_0xacc7('0x1c')]();});}};}function handleEntityNotFound(_0xea0218,_0x54627a){return function(_0x31e47d){if(!_0x31e47d){_0xea0218[_0xacc7('0x1a')](0x194);}return _0x31e47d;};}function handleError(_0x403327,_0x247f2c){_0x247f2c=_0x247f2c||0x1f4;return function(_0x406c21){logger[_0xacc7('0x28')](_0x406c21[_0xacc7('0x29')]);if(_0x406c21[_0xacc7('0x2a')]){delete _0x406c21[_0xacc7('0x2a')];}_0x403327[_0xacc7('0x1b')](_0x247f2c)[_0xacc7('0x2b')](_0x406c21);};}exports[_0xacc7('0x2c')]=function(_0x3e5a22,_0x21fc6b){var _0x1f8fdc={},_0xe2072b={},_0x3d6eeb={'count':0x0,'rows':[]};var _0x2aa9cd=_['map'](db[_0xacc7('0x2d')][_0xacc7('0x2e')],function(_0x1213c5){return{'name':_0x1213c5[_0xacc7('0x2f')],'type':_0x1213c5['type'][_0xacc7('0x30')]};});_0xe2072b['model']=_[_0xacc7('0x31')](_0x2aa9cd,'name');_0xe2072b[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0x3e5a22[_0xacc7('0x32')]);_0xe2072b[_0xacc7('0x34')]=_['intersection'](_0xe2072b[_0xacc7('0x35')],_0xe2072b[_0xacc7('0x32')]);_0x1f8fdc[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0xe2072b[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x38')]));_0x1f8fdc[_0xacc7('0x36')]=_0x1f8fdc[_0xacc7('0x36')][_0xacc7('0x39')]?_0x1f8fdc[_0xacc7('0x36')]:_0xe2072b[_0xacc7('0x35')];if(!_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x3a')](_0xacc7('0x3b'))){_0x1f8fdc[_0xacc7('0x1f')]=qs[_0xacc7('0x1f')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x1f')]);_0x1f8fdc[_0xacc7('0x1d')]=qs[_0xacc7('0x1d')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x1d')]);}_0x1f8fdc[_0xacc7('0x3c')]=qs[_0xacc7('0x3d')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x3d')]);_0x1f8fdc[_0xacc7('0x3e')]=qs['filters'](_[_0xacc7('0x3f')](_0x3e5a22[_0xacc7('0x32')],_0xe2072b[_0xacc7('0x34')]),_0x2aa9cd);if(_0x3e5a22['query'][_0xacc7('0x40')]){_0x1f8fdc[_0xacc7('0x3e')]=_[_0xacc7('0x41')](_0x1f8fdc[_0xacc7('0x3e')],{'$or':_['map'](_0x2aa9cd,function(_0x1b0f4){if(_0x1b0f4[_0xacc7('0x42')]!=='VIRTUAL'){var _0xccd48d={};_0xccd48d[_0x1b0f4[_0xacc7('0x2a')]]={'$like':'%'+_0x3e5a22['query'][_0xacc7('0x40')]+'%'};return _0xccd48d;}})});}_0x1f8fdc=_[_0xacc7('0x41')]({},_0x1f8fdc,_0x3e5a22['options']);var _0x92408b={'where':_0x1f8fdc[_0xacc7('0x3e')]};return db[_0xacc7('0x2d')][_0xacc7('0x20')](_0x92408b)['then'](function(_0x3b6b9f){_0x3d6eeb[_0xacc7('0x20')]=_0x3b6b9f;if(_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x43')]){_0x1f8fdc[_0xacc7('0x44')]=[{'all':!![]}];}return db[_0xacc7('0x2d')][_0xacc7('0x45')](_0x1f8fdc);})[_0xacc7('0x27')](function(_0x503fd5){_0x3d6eeb[_0xacc7('0x46')]=_0x503fd5;return _0x3d6eeb;})[_0xacc7('0x27')](respondWithFilteredResult(_0x21fc6b,_0x1f8fdc))[_0xacc7('0x47')](handleError(_0x21fc6b,null));};exports[_0xacc7('0x48')]=function(_0x3af478,_0x1a3e0f){var _0x4479dd={'raw':![],'where':{'id':_0x3af478[_0xacc7('0x49')]['id']}},_0x130231={};_0x130231[_0xacc7('0x35')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x130231[_0xacc7('0x32')]=_['keys'](_0x3af478['query']);_0x130231[_0xacc7('0x34')]=_[_0xacc7('0x37')](_0x130231['model'],_0x130231[_0xacc7('0x32')]);_0x4479dd[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0x130231[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x3af478[_0xacc7('0x32')][_0xacc7('0x38')]));_0x4479dd[_0xacc7('0x36')]=_0x4479dd['attributes'][_0xacc7('0x39')]?_0x4479dd[_0xacc7('0x36')]:_0x130231[_0xacc7('0x35')];if(_0x3af478[_0xacc7('0x32')][_0xacc7('0x43')]){_0x4479dd[_0xacc7('0x44')]=[{'all':!![]}];}_0x4479dd=_['merge']({},_0x4479dd,_0x3af478['options']);return db[_0xacc7('0x2d')][_0xacc7('0x4a')](_0x4479dd)['then'](handleEntityNotFound(_0x1a3e0f,null))[_0xacc7('0x27')](respondWithResult(_0x1a3e0f,null))[_0xacc7('0x47')](handleError(_0x1a3e0f,null));};exports['create']=function(_0x50d672,_0x34fcac){return db[_0xacc7('0x2d')]['create'](_0x50d672[_0xacc7('0x4b')],{})['then'](respondWithResult(_0x34fcac,0xc9))[_0xacc7('0x47')](handleError(_0x34fcac,null));};exports[_0xacc7('0x26')]=function(_0x899b26,_0x25795a){if(_0x899b26[_0xacc7('0x4b')]['id']){delete _0x899b26[_0xacc7('0x4b')]['id'];}return db[_0xacc7('0x2d')][_0xacc7('0x4a')]({'where':{'id':_0x899b26[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0x25795a,null))[_0xacc7('0x27')](saveUpdates(_0x899b26[_0xacc7('0x4b')],null))['then'](respondWithResult(_0x25795a,null))[_0xacc7('0x47')](handleError(_0x25795a,null));};exports[_0xacc7('0x4c')]=function(_0x443675,_0x5bc079){return db[_0xacc7('0x2d')][_0xacc7('0x4a')]({'where':{'id':_0x443675[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0x5bc079,null))['then'](removeEntity(_0x5bc079,null))[_0xacc7('0x47')](handleError(_0x5bc079,null));};exports[_0xacc7('0x4d')]=function(_0xb2dff9,_0xc3b6f7,_0x29c913){var _0x57ddad={};var _0x3c1be0={};var _0x359799;var _0x556022;return db[_0xacc7('0x2d')][_0xacc7('0x4e')]({'where':{'id':_0xb2dff9[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0xc3b6f7,null))[_0xacc7('0x27')](function(_0x4219e1){if(_0x4219e1){_0x359799=_0x4219e1;_0x3c1be0[_0xacc7('0x35')]=_[_0xacc7('0x33')](db[_0xacc7('0x4f')][_0xacc7('0x2e')]);_0x3c1be0[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0xb2dff9[_0xacc7('0x32')]);_0x3c1be0[_0xacc7('0x34')]=_[_0xacc7('0x37')](_0x3c1be0[_0xacc7('0x35')],_0x3c1be0[_0xacc7('0x32')]);_0x57ddad[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0x3c1be0['model'],qs['fields'](_0xb2dff9[_0xacc7('0x32')][_0xacc7('0x38')]));_0x57ddad[_0xacc7('0x36')]=_0x57ddad[_0xacc7('0x36')][_0xacc7('0x39')]?_0x57ddad[_0xacc7('0x36')]:_0x3c1be0[_0xacc7('0x35')];_0x57ddad[_0xacc7('0x3c')]=qs['sort'](_0xb2dff9['query'][_0xacc7('0x3d')]);_0x57ddad[_0xacc7('0x3e')]=qs[_0xacc7('0x34')](_[_0xacc7('0x3f')](_0xb2dff9[_0xacc7('0x32')],_0x3c1be0['filters']));if(_0xb2dff9['query'][_0xacc7('0x40')]){_0x57ddad[_0xacc7('0x3e')]=_[_0xacc7('0x41')](_0x57ddad['where'],{'$or':_[_0xacc7('0x31')](_0x57ddad['attributes'],function(_0x48ac9d){var _0x289626={};_0x289626[_0x48ac9d]={'$like':'%'+_0xb2dff9['query'][_0xacc7('0x40')]+'%'};return _0x289626;})});}_0x57ddad=_[_0xacc7('0x41')]({},_0x57ddad,_0xb2dff9[_0xacc7('0x50')]);return _0x359799['getFields'](_0x57ddad);}})[_0xacc7('0x27')](function(_0xb83c6f){if(_0xb83c6f){_0x556022=_0xb83c6f[_0xacc7('0x39')];if(!_0xb2dff9['query'][_0xacc7('0x3a')](_0xacc7('0x3b'))){_0x57ddad[_0xacc7('0x1f')]=qs[_0xacc7('0x1f')](_0xb2dff9[_0xacc7('0x32')][_0xacc7('0x1f')]);_0x57ddad[_0xacc7('0x1d')]=qs[_0xacc7('0x1d')](_0xb2dff9[_0xacc7('0x32')][_0xacc7('0x1d')]);}return _0x359799[_0xacc7('0x4d')](_0x57ddad);}})[_0xacc7('0x27')](function(_0x3fe0f5){if(_0x3fe0f5){return _0x3fe0f5?{'count':_0x556022,'rows':_0x3fe0f5}:null;}})['then'](respondWithResult(_0xc3b6f7,null))[_0xacc7('0x47')](handleError(_0xc3b6f7,null));};exports['getSubjects']=function(_0x33bcf8,_0xb68854,_0x689fae){var _0x1952e3={};var _0x58dfb4={};var _0x5edcca;var _0x5694ba;return db[_0xacc7('0x2d')][_0xacc7('0x4e')]({'where':{'id':_0x33bcf8[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0xb68854,null))[_0xacc7('0x27')](function(_0x23ce40){if(_0x23ce40){_0x5edcca=_0x23ce40;_0x58dfb4[_0xacc7('0x35')]=_[_0xacc7('0x33')](db['SugarcrmField'][_0xacc7('0x2e')]);_0x58dfb4[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0x33bcf8['query']);_0x58dfb4[_0xacc7('0x34')]=_[_0xacc7('0x37')](_0x58dfb4[_0xacc7('0x35')],_0x58dfb4[_0xacc7('0x32')]);_0x1952e3['attributes']=_[_0xacc7('0x37')](_0x58dfb4[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x33bcf8['query']['fields']));_0x1952e3[_0xacc7('0x36')]=_0x1952e3[_0xacc7('0x36')]['length']?_0x1952e3['attributes']:_0x58dfb4['model'];_0x1952e3[_0xacc7('0x3c')]=qs[_0xacc7('0x3d')](_0x33bcf8['query'][_0xacc7('0x3d')]);_0x1952e3[_0xacc7('0x3e')]=qs['filters'](_[_0xacc7('0x3f')](_0x33bcf8[_0xacc7('0x32')],_0x58dfb4[_0xacc7('0x34')]));if(_0x33bcf8[_0xacc7('0x32')]['filter']){_0x1952e3[_0xacc7('0x3e')]=_[_0xacc7('0x41')](_0x1952e3['where'],{'$or':_[_0xacc7('0x31')](_0x1952e3['attributes'],function(_0x44af6c){var _0x5a13bb={};_0x5a13bb[_0x44af6c]={'$like':'%'+_0x33bcf8[_0xacc7('0x32')]['filter']+'%'};return _0x5a13bb;})});}_0x1952e3=_[_0xacc7('0x41')]({},_0x1952e3,_0x33bcf8[_0xacc7('0x50')]);return _0x5edcca['getSubjects'](_0x1952e3);}})[_0xacc7('0x27')](function(_0x3faa14){if(_0x3faa14){_0x5694ba=_0x3faa14[_0xacc7('0x39')];if(!_0x33bcf8[_0xacc7('0x32')][_0xacc7('0x3a')]('nolimit')){_0x1952e3['limit']=qs['limit'](_0x33bcf8['query']['limit']);_0x1952e3[_0xacc7('0x1d')]=qs['offset'](_0x33bcf8[_0xacc7('0x32')][_0xacc7('0x1d')]);}return _0x5edcca[_0xacc7('0x51')](_0x1952e3);}})['then'](function(_0x4420a1){if(_0x4420a1){return _0x4420a1?{'count':_0x5694ba,'rows':_0x4420a1}:null;}})['then'](respondWithResult(_0xb68854,null))[_0xacc7('0x47')](handleError(_0xb68854,null));};exports[_0xacc7('0x52')]=function(_0x28d4da,_0x4a74df,_0x444057){var _0x28db30={};var _0x2edd43={};var _0x5ab30e;var _0x581bea;return db['SugarcrmConfiguration'][_0xacc7('0x4e')]({'where':{'id':_0x28d4da[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0x4a74df,null))[_0xacc7('0x27')](function(_0x36f983){if(_0x36f983){_0x5ab30e=_0x36f983;_0x2edd43[_0xacc7('0x35')]=_[_0xacc7('0x33')](db[_0xacc7('0x4f')][_0xacc7('0x2e')]);_0x2edd43[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0x28d4da[_0xacc7('0x32')]);_0x2edd43[_0xacc7('0x34')]=_['intersection'](_0x2edd43[_0xacc7('0x35')],_0x2edd43[_0xacc7('0x32')]);_0x28db30[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0x2edd43[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x28d4da[_0xacc7('0x32')][_0xacc7('0x38')]));_0x28db30[_0xacc7('0x36')]=_0x28db30[_0xacc7('0x36')][_0xacc7('0x39')]?_0x28db30[_0xacc7('0x36')]:_0x2edd43['model'];_0x28db30[_0xacc7('0x3c')]=qs['sort'](_0x28d4da[_0xacc7('0x32')][_0xacc7('0x3d')]);_0x28db30['where']=qs[_0xacc7('0x34')](_[_0xacc7('0x3f')](_0x28d4da[_0xacc7('0x32')],_0x2edd43['filters']));if(_0x28d4da[_0xacc7('0x32')][_0xacc7('0x40')]){_0x28db30[_0xacc7('0x3e')]=_['merge'](_0x28db30[_0xacc7('0x3e')],{'$or':_[_0xacc7('0x31')](_0x28db30['attributes'],function(_0x2f6358){var _0x57dcaf={};_0x57dcaf[_0x2f6358]={'$like':'%'+_0x28d4da[_0xacc7('0x32')][_0xacc7('0x40')]+'%'};return _0x57dcaf;})});}_0x28db30=_['merge']({},_0x28db30,_0x28d4da['options']);return _0x5ab30e[_0xacc7('0x52')](_0x28db30);}})[_0xacc7('0x27')](function(_0x4b4191){if(_0x4b4191){_0x581bea=_0x4b4191[_0xacc7('0x39')];if(!_0x28d4da[_0xacc7('0x32')]['hasOwnProperty'](_0xacc7('0x3b'))){_0x28db30[_0xacc7('0x1f')]=qs['limit'](_0x28d4da[_0xacc7('0x32')]['limit']);_0x28db30[_0xacc7('0x1d')]=qs[_0xacc7('0x1d')](_0x28d4da['query'][_0xacc7('0x1d')]);}return _0x5ab30e[_0xacc7('0x52')](_0x28db30);}})[_0xacc7('0x27')](function(_0x26dc73){if(_0x26dc73){return _0x26dc73?{'count':_0x581bea,'rows':_0x26dc73}:null;}})[_0xacc7('0x27')](respondWithResult(_0x4a74df,null))['catch'](handleError(_0x4a74df,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 64bfd40..e3f6724 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 _0x46ab=['./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x5dfecb,_0xc11124){var _0x3f9cb9=function(_0x4f224f){while(--_0x4f224f){_0x5dfecb['push'](_0x5dfecb['shift']());}};_0x3f9cb9(++_0xc11124);}(_0x46ab,0x111));var _0xb46a=function(_0x51e48f,_0x44e5f0){_0x51e48f=_0x51e48f-0x0;var _0x115066=_0x46ab[_0x51e48f];return _0x115066;};'use strict';var _=require(_0xb46a('0x0'));var util=require('util');var logger=require(_0xb46a('0x1'))(_0xb46a('0x2'));var moment=require(_0xb46a('0x3'));var BPromise=require(_0xb46a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb46a('0x5'));var attributes=require(_0xb46a('0x6'));module['exports']=function(_0x3108b3,_0x8a454){return _0x3108b3['define'](_0xb46a('0x7'),attributes,{'tableName':_0xb46a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb55=['bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util','moment'];(function(_0x3f8764,_0x4170d3){var _0x38b02e=function(_0x529a1a){while(--_0x529a1a){_0x3f8764['push'](_0x3f8764['shift']());}};_0x38b02e(++_0x4170d3);}(_0xbb55,0xc5));var _0x5bb5=function(_0xa81e31,_0x4944e8){_0xa81e31=_0xa81e31-0x0;var _0x10edcf=_0xbb55[_0xa81e31];return _0x10edcf;};'use strict';var _=require(_0x5bb5('0x0'));var util=require(_0x5bb5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5bb5('0x2'));var BPromise=require(_0x5bb5('0x3'));var rp=require(_0x5bb5('0x4'));var fs=require('fs');var path=require(_0x5bb5('0x5'));var rimraf=require('rimraf');var config=require(_0x5bb5('0x6'));var attributes=require(_0x5bb5('0x7'));module['exports']=function(_0x144177,_0x56ab27){return _0x144177[_0x5bb5('0x8')](_0x5bb5('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 16d7448..3b9da45 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 _0x6729=['then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x524dc1,_0x2ed308){var _0x5d4d60=function(_0xf78d22){while(--_0xf78d22){_0x524dc1['push'](_0x524dc1['shift']());}};_0x5d4d60(++_0x2ed308);}(_0x6729,0x9e));var _0x9672=function(_0x4b5aed,_0x3b6d4f){_0x4b5aed=_0x4b5aed-0x0;var _0x17a5ce=_0x6729[_0x4b5aed];return _0x17a5ce;};'use strict';var _=require(_0x9672('0x0'));var util=require(_0x9672('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9672('0x2'));var fs=require('fs');var Redis=require(_0x9672('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9672('0x4'));var config=require(_0x9672('0x5'));var jayson=require(_0x9672('0x6'));var client=jayson[_0x9672('0x7')][_0x9672('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x344093,_0x24c041,_0x2685e9){return new BPromise(function(_0x58857a,_0x32890b){return client[_0x9672('0x9')](_0x344093,_0x2685e9)[_0x9672('0xa')](function(_0x5249bc){logger[_0x9672('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24c041,_0x9672('0xc'));logger[_0x9672('0xd')](_0x9672('0xe'),_0x24c041,_0x9672('0xc'),JSON[_0x9672('0xf')](_0x5249bc));if(_0x5249bc['error']){if(_0x5249bc[_0x9672('0x10')][_0x9672('0x11')]===0x1f4){logger[_0x9672('0x10')](_0x9672('0x12'),_0x24c041,_0x5249bc[_0x9672('0x10')][_0x9672('0x13')]);return _0x32890b(_0x5249bc[_0x9672('0x10')][_0x9672('0x13')]);}logger[_0x9672('0x10')](_0x9672('0x12'),_0x24c041,_0x5249bc[_0x9672('0x10')]['message']);return _0x58857a(_0x5249bc['error'][_0x9672('0x13')]);}else{logger[_0x9672('0xb')](_0x9672('0x12'),_0x24c041,_0x9672('0xc'));_0x58857a(_0x5249bc['result'][_0x9672('0x13')]);}})[_0x9672('0x14')](function(_0x58c589){logger[_0x9672('0x10')](_0x9672('0x12'),_0x24c041,_0x58c589);_0x32890b(_0x58c589);});});} \ No newline at end of file +var _0x9d62=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3579a4,_0x469453){var _0x31367b=function(_0x427f0e){while(--_0x427f0e){_0x3579a4['push'](_0x3579a4['shift']());}};_0x31367b(++_0x469453);}(_0x9d62,0xf2));var _0x29d6=function(_0x48e877,_0x1e3583){_0x48e877=_0x48e877-0x0;var _0x25ac13=_0x9d62[_0x48e877];return _0x25ac13;};'use strict';var _=require(_0x29d6('0x0'));var util=require(_0x29d6('0x1'));var moment=require(_0x29d6('0x2'));var BPromise=require(_0x29d6('0x3'));var rs=require(_0x29d6('0x4'));var fs=require('fs');var Redis=require(_0x29d6('0x5'));var db=require(_0x29d6('0x6'))['db'];var utils=require(_0x29d6('0x7'));var logger=require(_0x29d6('0x8'))('rpc');var config=require(_0x29d6('0x9'));var jayson=require(_0x29d6('0xa'));var client=jayson['client'][_0x29d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219c98,_0x396913,_0x1f5422){return new BPromise(function(_0x5bf845,_0xd0d2df){return client['request'](_0x219c98,_0x1f5422)[_0x29d6('0xc')](function(_0x339820){logger[_0x29d6('0xd')](_0x29d6('0xe'),_0x396913,'request\x20sent');logger[_0x29d6('0xf')](_0x29d6('0x10'),_0x396913,_0x29d6('0x11'),JSON[_0x29d6('0x12')](_0x339820));if(_0x339820[_0x29d6('0x13')]){if(_0x339820[_0x29d6('0x13')][_0x29d6('0x14')]===0x1f4){logger[_0x29d6('0x13')](_0x29d6('0xe'),_0x396913,_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);return _0xd0d2df(_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);}logger[_0x29d6('0x13')](_0x29d6('0xe'),_0x396913,_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);return _0x5bf845(_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);}else{logger[_0x29d6('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x396913,_0x29d6('0x11'));_0x5bf845(_0x339820['result']['message']);}})['catch'](function(_0x1366fd){logger[_0x29d6('0x13')](_0x29d6('0xe'),_0x396913,_0x1366fd);_0xd0d2df(_0x1366fd);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 01865df..1c9c8d1 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 _0x4c13=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x4c13,0x1c6));var _0x34c1=function(_0x1c3286,_0x404ee9){_0x1c3286=_0x1c3286-0x0;var _0x40a371=_0x4c13[_0x1c3286];return _0x40a371;};'use strict';var multer=require(_0x34c1('0x0'));var util=require('util');var path=require(_0x34c1('0x1'));var timeout=require(_0x34c1('0x2'));var express=require(_0x34c1('0x3'));var router=express['Router']();var fs_extra=require(_0x34c1('0x4'));var auth=require(_0x34c1('0x5'));var interaction=require(_0x34c1('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x34c1('0x7')]('/',auth[_0x34c1('0x8')](),controller[_0x34c1('0x9')]);router[_0x34c1('0x7')]('/:id',auth[_0x34c1('0x8')](),controller[_0x34c1('0xa')]);router[_0x34c1('0xb')]('/',auth[_0x34c1('0x8')](),controller[_0x34c1('0xc')]);router[_0x34c1('0xd')](_0x34c1('0xe'),auth[_0x34c1('0x8')](),controller[_0x34c1('0xf')]);router[_0x34c1('0x10')]('/:id',auth[_0x34c1('0x8')](),controller[_0x34c1('0x11')]);module[_0x34c1('0x12')]=router; \ No newline at end of file +var _0x28fa=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','/:id'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x28fa,0x93));var _0xa28f=function(_0x19215c,_0x250cd9){_0x19215c=_0x19215c-0x0;var _0x129a4d=_0x28fa[_0x19215c];return _0x129a4d;};'use strict';var multer=require(_0xa28f('0x0'));var util=require(_0xa28f('0x1'));var path=require(_0xa28f('0x2'));var timeout=require(_0xa28f('0x3'));var express=require(_0xa28f('0x4'));var router=express['Router']();var fs_extra=require(_0xa28f('0x5'));var auth=require(_0xa28f('0x6'));var interaction=require(_0xa28f('0x7'));var config=require(_0xa28f('0x8'));var controller=require(_0xa28f('0x9'));router['get']('/',auth[_0xa28f('0xa')](),controller['index']);router[_0xa28f('0xb')](_0xa28f('0xc'),auth[_0xa28f('0xa')](),controller['show']);router[_0xa28f('0xd')]('/',auth[_0xa28f('0xa')](),controller[_0xa28f('0xe')]);router[_0xa28f('0xf')](_0xa28f('0xc'),auth[_0xa28f('0xa')](),controller[_0xa28f('0x10')]);router[_0xa28f('0x11')](_0xa28f('0xc'),auth[_0xa28f('0xa')](),controller[_0xa28f('0x12')]);module[_0xa28f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8e762be..c889c7e 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 _0x924e=['customVariable','sequelize','exports','ENUM','variable','string','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x924e,0x1b3));var _0xe924=function(_0x13fbe0,_0x3bf24a){_0x13fbe0=_0x13fbe0-0x0;var _0xb96705=_0x924e[_0x13fbe0];return _0xb96705;};'use strict';var Sequelize=require(_0xe924('0x0'));module[_0xe924('0x1')]={'type':{'type':Sequelize[_0xe924('0x2')]('string',_0xe924('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0xe924('0x4')},'content':{'type':Sequelize[_0xe924('0x5')]},'key':{'type':Sequelize[_0xe924('0x5')]},'keyType':{'type':Sequelize[_0xe924('0x2')](_0xe924('0x4'),_0xe924('0x3'),_0xe924('0x6'))},'keyContent':{'type':Sequelize[_0xe924('0x5')]},'idField':{'type':Sequelize[_0xe924('0x5')]},'nameField':{'type':Sequelize[_0xe924('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe924('0x5')]}}; \ No newline at end of file +var _0x9b0f=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x9b0f,0x16e));var _0xf9b0=function(_0x4052f0,_0x3fefee){_0x4052f0=_0x4052f0-0x0;var _0x4469ea=_0x9b0f[_0x4052f0];return _0x4469ea;};'use strict';var Sequelize=require('sequelize');module[_0xf9b0('0x0')]={'type':{'type':Sequelize[_0xf9b0('0x1')](_0xf9b0('0x2'),_0xf9b0('0x3'),_0xf9b0('0x4'),_0xf9b0('0x5'),_0xf9b0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf9b0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf9b0('0x2'),_0xf9b0('0x3'),_0xf9b0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf9b0('0x7')]},'nameField':{'type':Sequelize[_0xf9b0('0x7')]},'customField':{'type':Sequelize[_0xf9b0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf9b0('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index b782371..437a459 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 _0x0079=['filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x314bab,_0x4a35fb){var _0x2c65fb=function(_0x56ec40){while(--_0x56ec40){_0x314bab['push'](_0x314bab['shift']());}};_0x2c65fb(++_0x4a35fb);}(_0x0079,0x1a0));var _0x9007=function(_0x33126f,_0x22aaf2){_0x33126f=_0x33126f-0x0;var _0x1b6025=_0x0079[_0x33126f];return _0x1b6025;};'use strict';var emlformat=require(_0x9007('0x0'));var rimraf=require(_0x9007('0x1'));var zipdir=require(_0x9007('0x2'));var jsonpatch=require(_0x9007('0x3'));var rp=require(_0x9007('0x4'));var moment=require(_0x9007('0x5'));var BPromise=require(_0x9007('0x6'));var Mustache=require(_0x9007('0x7'));var util=require(_0x9007('0x8'));var path=require('path');var sox=require(_0x9007('0x9'));var csv=require(_0x9007('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9007('0xb'));var _=require(_0x9007('0xc'));var squel=require(_0x9007('0xd'));var crypto=require(_0x9007('0xe'));var jsforce=require(_0x9007('0xf'));var deskjs=require(_0x9007('0x10'));var toCsv=require(_0x9007('0xa'));var querystring=require(_0x9007('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9007('0x12'));var as=require(_0x9007('0x13'));var hardwareService=require(_0x9007('0x14'));var logger=require('../../config/logger')(_0x9007('0x15'));var utils=require(_0x9007('0x16'));var config=require(_0x9007('0x17'));var licenseUtil=require(_0x9007('0x18'));var db=require(_0x9007('0x19'))['db'];function respondWithStatusCode(_0x54c3bd,_0xfa6cfd){_0xfa6cfd=_0xfa6cfd||0xcc;return function(_0x4f9aab){if(_0x4f9aab){return _0x54c3bd['sendStatus'](_0xfa6cfd);}return _0x54c3bd[_0x9007('0x1a')](_0xfa6cfd)[_0x9007('0x1b')]();};}function respondWithResult(_0x44bba5,_0x4bb933){_0x4bb933=_0x4bb933||0xc8;return function(_0x1edb4e){if(_0x1edb4e){return _0x44bba5[_0x9007('0x1a')](_0x4bb933)[_0x9007('0x1c')](_0x1edb4e);}};}function respondWithFilteredResult(_0x5e6560,_0x297bf9){return function(_0x47ea37){if(_0x47ea37){var _0x4e8e38=typeof _0x297bf9['offset']===_0x9007('0x1d')&&typeof _0x297bf9['limit']===_0x9007('0x1d');var _0x4fe175=_0x47ea37['count'];var _0x27c47f=_0x4e8e38?0x0:_0x297bf9[_0x9007('0x1e')];var _0x2eb5c3=_0x4e8e38?_0x47ea37[_0x9007('0x1f')]:_0x297bf9['offset']+_0x297bf9[_0x9007('0x20')];var _0x2201ca;if(_0x2eb5c3>=_0x4fe175){_0x2eb5c3=_0x4fe175;_0x2201ca=0xc8;}else{_0x2201ca=0xce;}_0x5e6560[_0x9007('0x1a')](_0x2201ca);return _0x5e6560[_0x9007('0x21')](_0x9007('0x22'),_0x27c47f+'-'+_0x2eb5c3+'/'+_0x4fe175)[_0x9007('0x1c')](_0x47ea37);}return null;};}function patchUpdates(_0x55538d){return function(_0x20076a){try{jsonpatch[_0x9007('0x23')](_0x20076a,_0x55538d,!![]);}catch(_0x2453cf){return BPromise[_0x9007('0x24')](_0x2453cf);}return _0x20076a[_0x9007('0x25')]();};}function saveUpdates(_0x5b2140,_0x248c2c){return function(_0x48e596){if(_0x48e596){return _0x48e596[_0x9007('0x26')](_0x5b2140)[_0x9007('0x27')](function(_0x241ff4){return _0x241ff4;});}return null;};}function removeEntity(_0x3b689d,_0x3b41d1){return function(_0x59a4f5){if(_0x59a4f5){return _0x59a4f5['destroy']()[_0x9007('0x27')](function(){_0x3b689d[_0x9007('0x1a')](0xcc)[_0x9007('0x1b')]();});}};}function handleEntityNotFound(_0x3f7800,_0x2f7ad1){return function(_0x485d89){if(!_0x485d89){_0x3f7800[_0x9007('0x28')](0x194);}return _0x485d89;};}function handleError(_0x4027fb,_0x285db5){_0x285db5=_0x285db5||0x1f4;return function(_0x1414d8){logger[_0x9007('0x29')](_0x1414d8['stack']);if(_0x1414d8[_0x9007('0x2a')]){delete _0x1414d8['name'];}_0x4027fb['status'](_0x285db5)[_0x9007('0x2b')](_0x1414d8);};}exports[_0x9007('0x2c')]=function(_0x44b487,_0x609829){var _0x562dc4={},_0xe0628={},_0x43f7a7={'count':0x0,'rows':[]};var _0x5ad2ad=_['map'](db[_0x9007('0x2d')][_0x9007('0x2e')],function(_0x1fde9f){return{'name':_0x1fde9f[_0x9007('0x2f')],'type':_0x1fde9f[_0x9007('0x30')][_0x9007('0x31')]};});_0xe0628[_0x9007('0x32')]=_[_0x9007('0x33')](_0x5ad2ad,'name');_0xe0628[_0x9007('0x34')]=_[_0x9007('0x35')](_0x44b487['query']);_0xe0628[_0x9007('0x36')]=_[_0x9007('0x37')](_0xe0628[_0x9007('0x32')],_0xe0628['query']);_0x562dc4['attributes']=_[_0x9007('0x37')](_0xe0628[_0x9007('0x32')],qs[_0x9007('0x38')](_0x44b487[_0x9007('0x34')]['fields']));_0x562dc4[_0x9007('0x39')]=_0x562dc4[_0x9007('0x39')]['length']?_0x562dc4['attributes']:_0xe0628[_0x9007('0x32')];if(!_0x44b487[_0x9007('0x34')][_0x9007('0x3a')](_0x9007('0x3b'))){_0x562dc4['limit']=qs[_0x9007('0x20')](_0x44b487[_0x9007('0x34')][_0x9007('0x20')]);_0x562dc4[_0x9007('0x1e')]=qs[_0x9007('0x1e')](_0x44b487['query'][_0x9007('0x1e')]);}_0x562dc4[_0x9007('0x3c')]=qs[_0x9007('0x3d')](_0x44b487[_0x9007('0x34')]['sort']);_0x562dc4[_0x9007('0x3e')]=qs[_0x9007('0x36')](_[_0x9007('0x3f')](_0x44b487[_0x9007('0x34')],_0xe0628['filters']),_0x5ad2ad);if(_0x44b487[_0x9007('0x34')][_0x9007('0x40')]){_0x562dc4[_0x9007('0x3e')]=_['merge'](_0x562dc4['where'],{'$or':_[_0x9007('0x33')](_0x5ad2ad,function(_0x33b677){if(_0x33b677[_0x9007('0x30')]!==_0x9007('0x41')){var _0x1e0e39={};_0x1e0e39[_0x33b677[_0x9007('0x2a')]]={'$like':'%'+_0x44b487[_0x9007('0x34')][_0x9007('0x40')]+'%'};return _0x1e0e39;}})});}_0x562dc4=_[_0x9007('0x42')]({},_0x562dc4,_0x44b487[_0x9007('0x43')]);var _0x57ebfa={'where':_0x562dc4[_0x9007('0x3e')]};return db[_0x9007('0x2d')]['count'](_0x57ebfa)[_0x9007('0x27')](function(_0x485f42){_0x43f7a7['count']=_0x485f42;if(_0x44b487[_0x9007('0x34')][_0x9007('0x44')]){_0x562dc4[_0x9007('0x45')]=[{'all':!![]}];}return db[_0x9007('0x2d')][_0x9007('0x46')](_0x562dc4);})['then'](function(_0x304443){_0x43f7a7[_0x9007('0x47')]=_0x304443;return _0x43f7a7;})['then'](respondWithFilteredResult(_0x609829,_0x562dc4))[_0x9007('0x48')](handleError(_0x609829,null));};exports[_0x9007('0x49')]=function(_0x50bd77,_0xf64a06){var _0x2c1bf0={'raw':!![],'where':{'id':_0x50bd77[_0x9007('0x4a')]['id']}},_0x2cecbf={};_0x2cecbf[_0x9007('0x32')]=_[_0x9007('0x35')](db['SugarcrmField']['rawAttributes']);_0x2cecbf['query']=_['keys'](_0x50bd77['query']);_0x2cecbf[_0x9007('0x36')]=_[_0x9007('0x37')](_0x2cecbf[_0x9007('0x32')],_0x2cecbf['query']);_0x2c1bf0[_0x9007('0x39')]=_[_0x9007('0x37')](_0x2cecbf[_0x9007('0x32')],qs[_0x9007('0x38')](_0x50bd77[_0x9007('0x34')]['fields']));_0x2c1bf0[_0x9007('0x39')]=_0x2c1bf0[_0x9007('0x39')][_0x9007('0x4b')]?_0x2c1bf0['attributes']:_0x2cecbf[_0x9007('0x32')];if(_0x50bd77[_0x9007('0x34')][_0x9007('0x44')]){_0x2c1bf0[_0x9007('0x45')]=[{'all':!![]}];}_0x2c1bf0=_[_0x9007('0x42')]({},_0x2c1bf0,_0x50bd77[_0x9007('0x43')]);return db[_0x9007('0x2d')][_0x9007('0x4c')](_0x2c1bf0)['then'](handleEntityNotFound(_0xf64a06,null))['then'](respondWithResult(_0xf64a06,null))[_0x9007('0x48')](handleError(_0xf64a06,null));};exports[_0x9007('0x4d')]=function(_0x7aaa34,_0x3cc5a2){return db['SugarcrmField']['create'](_0x7aaa34[_0x9007('0x4e')],{})[_0x9007('0x27')](respondWithResult(_0x3cc5a2,0xc9))[_0x9007('0x48')](handleError(_0x3cc5a2,null));};exports[_0x9007('0x26')]=function(_0x251c64,_0x1d279e){if(_0x251c64[_0x9007('0x4e')]['id']){delete _0x251c64[_0x9007('0x4e')]['id'];}return db[_0x9007('0x2d')][_0x9007('0x4c')]({'where':{'id':_0x251c64[_0x9007('0x4a')]['id']}})[_0x9007('0x27')](handleEntityNotFound(_0x1d279e,null))[_0x9007('0x27')](saveUpdates(_0x251c64[_0x9007('0x4e')],null))[_0x9007('0x27')](respondWithResult(_0x1d279e,null))[_0x9007('0x48')](handleError(_0x1d279e,null));};exports[_0x9007('0x4f')]=function(_0x53a04f,_0x21aa8e){return db['SugarcrmField']['find']({'where':{'id':_0x53a04f[_0x9007('0x4a')]['id']}})[_0x9007('0x27')](handleEntityNotFound(_0x21aa8e,null))[_0x9007('0x27')](removeEntity(_0x21aa8e,null))[_0x9007('0x48')](handleError(_0x21aa8e,null));}; \ No newline at end of file +var _0x4d85=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','SugarcrmField','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','find','create','body','params','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0xf9282e,_0x4c5fc5){var _0x4f4e34=function(_0x31418c){while(--_0x31418c){_0xf9282e['push'](_0xf9282e['shift']());}};_0x4f4e34(++_0x4c5fc5);}(_0x4d85,0x1af));var _0x54d8=function(_0x59f1e6,_0xda13c5){_0x59f1e6=_0x59f1e6-0x0;var _0x2aada5=_0x4d85[_0x59f1e6];return _0x2aada5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x54d8('0x0'));var jsonpatch=require(_0x54d8('0x1'));var rp=require('request-promise');var moment=require(_0x54d8('0x2'));var BPromise=require(_0x54d8('0x3'));var Mustache=require(_0x54d8('0x4'));var util=require(_0x54d8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x54d8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54d8('0x7'));var _=require(_0x54d8('0x8'));var squel=require(_0x54d8('0x9'));var crypto=require(_0x54d8('0xa'));var jsforce=require(_0x54d8('0xb'));var deskjs=require(_0x54d8('0xc'));var toCsv=require(_0x54d8('0x6'));var querystring=require('querystring');var Papa=require(_0x54d8('0xd'));var Redis=require(_0x54d8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x54d8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54d8('0x10'));var logger=require(_0x54d8('0x11'))(_0x54d8('0x12'));var utils=require(_0x54d8('0x13'));var config=require(_0x54d8('0x14'));var licenseUtil=require(_0x54d8('0x15'));var db=require(_0x54d8('0x16'))['db'];function respondWithStatusCode(_0x41a3b8,_0x33c6b4){_0x33c6b4=_0x33c6b4||0xcc;return function(_0x2b023c){if(_0x2b023c){return _0x41a3b8[_0x54d8('0x17')](_0x33c6b4);}return _0x41a3b8['status'](_0x33c6b4)[_0x54d8('0x18')]();};}function respondWithResult(_0x69f33d,_0x43c3b2){_0x43c3b2=_0x43c3b2||0xc8;return function(_0x3ef839){if(_0x3ef839){return _0x69f33d[_0x54d8('0x19')](_0x43c3b2)[_0x54d8('0x1a')](_0x3ef839);}};}function respondWithFilteredResult(_0x3c690d,_0x1c5c25){return function(_0x46846a){if(_0x46846a){var _0x59498e=typeof _0x1c5c25[_0x54d8('0x1b')]===_0x54d8('0x1c')&&typeof _0x1c5c25[_0x54d8('0x1d')]===_0x54d8('0x1c');var _0x537412=_0x46846a[_0x54d8('0x1e')];var _0x39633f=_0x59498e?0x0:_0x1c5c25['offset'];var _0x216619=_0x59498e?_0x46846a[_0x54d8('0x1e')]:_0x1c5c25['offset']+_0x1c5c25[_0x54d8('0x1d')];var _0x5231c8;if(_0x216619>=_0x537412){_0x216619=_0x537412;_0x5231c8=0xc8;}else{_0x5231c8=0xce;}_0x3c690d[_0x54d8('0x19')](_0x5231c8);return _0x3c690d[_0x54d8('0x1f')](_0x54d8('0x20'),_0x39633f+'-'+_0x216619+'/'+_0x537412)[_0x54d8('0x1a')](_0x46846a);}return null;};}function patchUpdates(_0x27982d){return function(_0xe48576){try{jsonpatch[_0x54d8('0x21')](_0xe48576,_0x27982d,!![]);}catch(_0x252b06){return BPromise[_0x54d8('0x22')](_0x252b06);}return _0xe48576[_0x54d8('0x23')]();};}function saveUpdates(_0x41f67f,_0xc9351a){return function(_0x24666d){if(_0x24666d){return _0x24666d[_0x54d8('0x24')](_0x41f67f)[_0x54d8('0x25')](function(_0x39c40e){return _0x39c40e;});}return null;};}function removeEntity(_0x25b0b8,_0x59e32b){return function(_0x21dc8b){if(_0x21dc8b){return _0x21dc8b['destroy']()[_0x54d8('0x25')](function(){_0x25b0b8[_0x54d8('0x19')](0xcc)[_0x54d8('0x18')]();});}};}function handleEntityNotFound(_0x147eab,_0x43f68a){return function(_0x57cd64){if(!_0x57cd64){_0x147eab[_0x54d8('0x17')](0x194);}return _0x57cd64;};}function handleError(_0x2471e5,_0x66094c){_0x66094c=_0x66094c||0x1f4;return function(_0x1bd3e7){logger['error'](_0x1bd3e7[_0x54d8('0x26')]);if(_0x1bd3e7[_0x54d8('0x27')]){delete _0x1bd3e7[_0x54d8('0x27')];}_0x2471e5[_0x54d8('0x19')](_0x66094c)[_0x54d8('0x28')](_0x1bd3e7);};}exports[_0x54d8('0x29')]=function(_0x3858e4,_0x114e3a){var _0x53e67e={},_0x53bf98={},_0x49f5b9={'count':0x0,'rows':[]};var _0x4d66dc=_['map'](db[_0x54d8('0x2a')]['rawAttributes'],function(_0x13efdb){return{'name':_0x13efdb[_0x54d8('0x2b')],'type':_0x13efdb[_0x54d8('0x2c')]['key']};});_0x53bf98[_0x54d8('0x2d')]=_['map'](_0x4d66dc,'name');_0x53bf98[_0x54d8('0x2e')]=_['keys'](_0x3858e4[_0x54d8('0x2e')]);_0x53bf98[_0x54d8('0x2f')]=_['intersection'](_0x53bf98['model'],_0x53bf98[_0x54d8('0x2e')]);_0x53e67e[_0x54d8('0x30')]=_['intersection'](_0x53bf98[_0x54d8('0x2d')],qs[_0x54d8('0x31')](_0x3858e4[_0x54d8('0x2e')][_0x54d8('0x31')]));_0x53e67e[_0x54d8('0x30')]=_0x53e67e[_0x54d8('0x30')][_0x54d8('0x32')]?_0x53e67e[_0x54d8('0x30')]:_0x53bf98[_0x54d8('0x2d')];if(!_0x3858e4[_0x54d8('0x2e')][_0x54d8('0x33')](_0x54d8('0x34'))){_0x53e67e[_0x54d8('0x1d')]=qs[_0x54d8('0x1d')](_0x3858e4[_0x54d8('0x2e')][_0x54d8('0x1d')]);_0x53e67e['offset']=qs[_0x54d8('0x1b')](_0x3858e4[_0x54d8('0x2e')]['offset']);}_0x53e67e[_0x54d8('0x35')]=qs[_0x54d8('0x36')](_0x3858e4['query'][_0x54d8('0x36')]);_0x53e67e[_0x54d8('0x37')]=qs[_0x54d8('0x2f')](_[_0x54d8('0x38')](_0x3858e4['query'],_0x53bf98['filters']),_0x4d66dc);if(_0x3858e4['query'][_0x54d8('0x39')]){_0x53e67e[_0x54d8('0x37')]=_[_0x54d8('0x3a')](_0x53e67e[_0x54d8('0x37')],{'$or':_[_0x54d8('0x3b')](_0x4d66dc,function(_0x57fe30){if(_0x57fe30[_0x54d8('0x2c')]!==_0x54d8('0x3c')){var _0x825478={};_0x825478[_0x57fe30['name']]={'$like':'%'+_0x3858e4[_0x54d8('0x2e')]['filter']+'%'};return _0x825478;}})});}_0x53e67e=_[_0x54d8('0x3a')]({},_0x53e67e,_0x3858e4[_0x54d8('0x3d')]);var _0x29827b={'where':_0x53e67e['where']};return db[_0x54d8('0x2a')]['count'](_0x29827b)['then'](function(_0xa29148){_0x49f5b9['count']=_0xa29148;if(_0x3858e4['query'][_0x54d8('0x3e')]){_0x53e67e[_0x54d8('0x3f')]=[{'all':!![]}];}return db[_0x54d8('0x2a')][_0x54d8('0x40')](_0x53e67e);})[_0x54d8('0x25')](function(_0x4ad401){_0x49f5b9[_0x54d8('0x41')]=_0x4ad401;return _0x49f5b9;})[_0x54d8('0x25')](respondWithFilteredResult(_0x114e3a,_0x53e67e))[_0x54d8('0x42')](handleError(_0x114e3a,null));};exports[_0x54d8('0x43')]=function(_0x15fddc,_0x57f8f4){var _0x101160={'raw':!![],'where':{'id':_0x15fddc['params']['id']}},_0x14657b={};_0x14657b[_0x54d8('0x2d')]=_['keys'](db[_0x54d8('0x2a')][_0x54d8('0x44')]);_0x14657b[_0x54d8('0x2e')]=_['keys'](_0x15fddc[_0x54d8('0x2e')]);_0x14657b[_0x54d8('0x2f')]=_[_0x54d8('0x45')](_0x14657b[_0x54d8('0x2d')],_0x14657b['query']);_0x101160[_0x54d8('0x30')]=_['intersection'](_0x14657b[_0x54d8('0x2d')],qs[_0x54d8('0x31')](_0x15fddc[_0x54d8('0x2e')][_0x54d8('0x31')]));_0x101160[_0x54d8('0x30')]=_0x101160[_0x54d8('0x30')]['length']?_0x101160[_0x54d8('0x30')]:_0x14657b['model'];if(_0x15fddc['query'][_0x54d8('0x3e')]){_0x101160[_0x54d8('0x3f')]=[{'all':!![]}];}_0x101160=_[_0x54d8('0x3a')]({},_0x101160,_0x15fddc[_0x54d8('0x3d')]);return db[_0x54d8('0x2a')][_0x54d8('0x46')](_0x101160)['then'](handleEntityNotFound(_0x57f8f4,null))[_0x54d8('0x25')](respondWithResult(_0x57f8f4,null))[_0x54d8('0x42')](handleError(_0x57f8f4,null));};exports[_0x54d8('0x47')]=function(_0x5a0786,_0x442790){return db[_0x54d8('0x2a')][_0x54d8('0x47')](_0x5a0786[_0x54d8('0x48')],{})[_0x54d8('0x25')](respondWithResult(_0x442790,0xc9))[_0x54d8('0x42')](handleError(_0x442790,null));};exports[_0x54d8('0x24')]=function(_0x2b2e81,_0x19fabe){if(_0x2b2e81[_0x54d8('0x48')]['id']){delete _0x2b2e81[_0x54d8('0x48')]['id'];}return db['SugarcrmField'][_0x54d8('0x46')]({'where':{'id':_0x2b2e81[_0x54d8('0x49')]['id']}})[_0x54d8('0x25')](handleEntityNotFound(_0x19fabe,null))[_0x54d8('0x25')](saveUpdates(_0x2b2e81[_0x54d8('0x48')],null))[_0x54d8('0x25')](respondWithResult(_0x19fabe,null))[_0x54d8('0x42')](handleError(_0x19fabe,null));};exports[_0x54d8('0x4a')]=function(_0x49b70e,_0x5d245a){return db[_0x54d8('0x2a')]['find']({'where':{'id':_0x49b70e['params']['id']}})['then'](handleEntityNotFound(_0x5d245a,null))['then'](removeEntity(_0x5d245a,null))[_0x54d8('0x42')](handleError(_0x5d245a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 015e628..0156474 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 _0xc052=['./intSugarcrmField.attributes','define','SugarcrmField','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x582edd,_0xaca93a){var _0x4801e1=function(_0x2eb3df){while(--_0x2eb3df){_0x582edd['push'](_0x582edd['shift']());}};_0x4801e1(++_0xaca93a);}(_0xc052,0x101));var _0x2c05=function(_0x2f9d9b,_0x84357d){_0x2f9d9b=_0x2f9d9b-0x0;var _0x491940=_0xc052[_0x2f9d9b];return _0x491940;};'use strict';var _=require(_0x2c05('0x0'));var util=require(_0x2c05('0x1'));var logger=require(_0x2c05('0x2'))(_0x2c05('0x3'));var moment=require(_0x2c05('0x4'));var BPromise=require(_0x2c05('0x5'));var rp=require(_0x2c05('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c05('0x7'));var config=require(_0x2c05('0x8'));var attributes=require(_0x2c05('0x9'));module['exports']=function(_0x792306,_0x518a49){return _0x792306[_0x2c05('0xa')](_0x2c05('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x2c05('0xc'),'fields':['idField',_0x2c05('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x238c=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x1a5941,_0x8ff9c1){var _0x516dbc=function(_0x28b276){while(--_0x28b276){_0x1a5941['push'](_0x1a5941['shift']());}};_0x516dbc(++_0x8ff9c1);}(_0x238c,0x15d));var _0xc238=function(_0x1e235e,_0x994b77){_0x1e235e=_0x1e235e-0x0;var _0x1e8e94=_0x238c[_0x1e235e];return _0x1e8e94;};'use strict';var _=require(_0xc238('0x0'));var util=require(_0xc238('0x1'));var logger=require(_0xc238('0x2'))(_0xc238('0x3'));var moment=require(_0xc238('0x4'));var BPromise=require('bluebird');var rp=require(_0xc238('0x5'));var fs=require('fs');var path=require(_0xc238('0x6'));var rimraf=require(_0xc238('0x7'));var config=require(_0xc238('0x8'));var attributes=require(_0xc238('0x9'));module[_0xc238('0xa')]=function(_0x3a8ccf,_0xb4f9da){return _0x3a8ccf['define']('SugarcrmField',attributes,{'tableName':_0xc238('0xb'),'paranoid':![],'indexes':[{'name':_0xc238('0xc'),'fields':[_0xc238('0xd'),_0xc238('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 78be698..7c8b660 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 _0x1a9a=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bfd68,_0x5f26c0){var _0x7bd0e0=function(_0x30c944){while(--_0x30c944){_0x2bfd68['push'](_0x2bfd68['shift']());}};_0x7bd0e0(++_0x5f26c0);}(_0x1a9a,0xda));var _0xa1a9=function(_0x1c253b,_0x440bc9){_0x1c253b=_0x1c253b-0x0;var _0x57291a=_0x1a9a[_0x1c253b];return _0x57291a;};'use strict';var _=require(_0xa1a9('0x0'));var util=require(_0xa1a9('0x1'));var moment=require(_0xa1a9('0x2'));var BPromise=require(_0xa1a9('0x3'));var rs=require(_0xa1a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1a9('0x5'))['db'];var utils=require(_0xa1a9('0x6'));var logger=require(_0xa1a9('0x7'))(_0xa1a9('0x8'));var config=require(_0xa1a9('0x9'));var jayson=require(_0xa1a9('0xa'));var client=jayson[_0xa1a9('0xb')][_0xa1a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c1d33,_0x557440,_0x4dd726){return new BPromise(function(_0x728b69,_0x55e72a){return client[_0xa1a9('0xd')](_0x5c1d33,_0x4dd726)[_0xa1a9('0xe')](function(_0x2d14c3){logger[_0xa1a9('0xf')](_0xa1a9('0x10'),_0x557440,_0xa1a9('0x11'));logger[_0xa1a9('0x12')](_0xa1a9('0x13'),_0x557440,_0xa1a9('0x11'),JSON[_0xa1a9('0x14')](_0x2d14c3));if(_0x2d14c3['error']){if(_0x2d14c3['error']['code']===0x1f4){logger[_0xa1a9('0x15')](_0xa1a9('0x10'),_0x557440,_0x2d14c3[_0xa1a9('0x15')]['message']);return _0x55e72a(_0x2d14c3[_0xa1a9('0x15')]['message']);}logger[_0xa1a9('0x15')](_0xa1a9('0x10'),_0x557440,_0x2d14c3['error'][_0xa1a9('0x16')]);return _0x728b69(_0x2d14c3['error'][_0xa1a9('0x16')]);}else{logger[_0xa1a9('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x557440,'request\x20sent');_0x728b69(_0x2d14c3[_0xa1a9('0x17')][_0xa1a9('0x16')]);}})['catch'](function(_0x4e2fdc){logger[_0xa1a9('0x15')](_0xa1a9('0x10'),_0x557440,_0x4e2fdc);_0x55e72a(_0x4e2fdc);});});} \ No newline at end of file +var _0x5eac=['http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eac,0x15f));var _0xc5ea=function(_0x365802,_0x47d9e8){_0x365802=_0x365802-0x0;var _0x6db0bc=_0x5eac[_0x365802];return _0x6db0bc;};'use strict';var _=require('lodash');var util=require(_0xc5ea('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5ea('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc5ea('0x2'))(_0xc5ea('0x3'));var config=require(_0xc5ea('0x4'));var jayson=require(_0xc5ea('0x5'));var client=jayson['client'][_0xc5ea('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1d4cde,_0x53baf1,_0x4372c5){return new BPromise(function(_0x294941,_0x161145){return client[_0xc5ea('0x7')](_0x1d4cde,_0x4372c5)['then'](function(_0x1936d5){logger[_0xc5ea('0x8')](_0xc5ea('0x9'),_0x53baf1,_0xc5ea('0xa'));logger[_0xc5ea('0xb')](_0xc5ea('0xc'),_0x53baf1,'request\x20sent',JSON['stringify'](_0x1936d5));if(_0x1936d5[_0xc5ea('0xd')]){if(_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xe')]===0x1f4){logger[_0xc5ea('0xd')](_0xc5ea('0x9'),_0x53baf1,_0x1936d5['error'][_0xc5ea('0xf')]);return _0x161145(_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xf')]);}logger[_0xc5ea('0xd')](_0xc5ea('0x9'),_0x53baf1,_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xf')]);return _0x294941(_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xf')]);}else{logger[_0xc5ea('0x8')](_0xc5ea('0x9'),_0x53baf1,'request\x20sent');_0x294941(_0x1936d5[_0xc5ea('0x10')][_0xc5ea('0xf')]);}})['catch'](function(_0x2ec766){logger[_0xc5ea('0xd')](_0xc5ea('0x9'),_0x53baf1,_0x2ec766);_0x161145(_0x2ec766);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 7c45b5e..a62b1e2 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 _0xaeef=['../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','index','get','isAuthenticated','show','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3239b3,_0x43feb7){var _0x2d7e7b=function(_0x30dfda){while(--_0x30dfda){_0x3239b3['push'](_0x3239b3['shift']());}};_0x2d7e7b(++_0x43feb7);}(_0xaeef,0x14a));var _0xfaee=function(_0x35f1d7,_0x3e97bc){_0x35f1d7=_0x35f1d7-0x0;var _0x9f1f1c=_0xaeef[_0x35f1d7];return _0x9f1f1c;};'use strict';var multer=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var path=require(_0xfaee('0x2'));var timeout=require('connect-timeout');var express=require(_0xfaee('0x3'));var router=express[_0xfaee('0x4')]();var fs_extra=require(_0xfaee('0x5'));var auth=require(_0xfaee('0x6'));var interaction=require(_0xfaee('0x7'));var config=require('../../config/environment');var controller=require(_0xfaee('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfaee('0x9')]);router[_0xfaee('0xa')]('/:id',auth[_0xfaee('0xb')](),controller[_0xfaee('0xc')]);router[_0xfaee('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfaee('0xd')]);router[_0xfaee('0xa')]('/:id/fields',auth[_0xfaee('0xb')](),controller[_0xfaee('0xe')]);router[_0xfaee('0xf')]('/',auth[_0xfaee('0xb')](),controller[_0xfaee('0x10')]);router['post']('/:id/configurations',auth[_0xfaee('0xb')](),controller[_0xfaee('0x11')]);router[_0xfaee('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xfaee('0x13')]);router[_0xfaee('0x14')](_0xfaee('0x15'),auth[_0xfaee('0xb')](),controller[_0xfaee('0x16')]);module[_0xfaee('0x17')]=router; \ No newline at end of file +var _0x4a5a=['update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','show','/:id/fields','getFields','create','post'];(function(_0x57b692,_0x51f860){var _0x512276=function(_0xc34267){while(--_0xc34267){_0x57b692['push'](_0x57b692['shift']());}};_0x512276(++_0x51f860);}(_0x4a5a,0x6e));var _0xa4a5=function(_0x19dc45,_0x5bb835){_0x19dc45=_0x19dc45-0x0;var _0x221b31=_0x4a5a[_0x19dc45];return _0x221b31;};'use strict';var multer=require(_0xa4a5('0x0'));var util=require('util');var path=require(_0xa4a5('0x1'));var timeout=require(_0xa4a5('0x2'));var express=require(_0xa4a5('0x3'));var router=express['Router']();var fs_extra=require(_0xa4a5('0x4'));var auth=require(_0xa4a5('0x5'));var interaction=require(_0xa4a5('0x6'));var config=require(_0xa4a5('0x7'));var controller=require(_0xa4a5('0x8'));router[_0xa4a5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa4a5('0x9')]('/:id',auth[_0xa4a5('0xa')](),controller[_0xa4a5('0xb')]);router[_0xa4a5('0x9')]('/:id/configurations',auth[_0xa4a5('0xa')](),controller['getConfigurations']);router[_0xa4a5('0x9')](_0xa4a5('0xc'),auth[_0xa4a5('0xa')](),controller[_0xa4a5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa4a5('0xe')]);router[_0xa4a5('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xa4a5('0xa')](),controller[_0xa4a5('0x10')]);router[_0xa4a5('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 83f7ec1..0f95277 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 _0xcc49=['HelpDesk','sequelize','STRING'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xcc49,0x85));var _0x9cc4=function(_0x582210,_0x184c36){_0x582210=_0x582210-0x0;var _0x18cf58=_0xcc49[_0x582210];return _0x18cf58;};'use strict';var Sequelize=require(_0x9cc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x9cc4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9cc4('0x1')]},'username':{'type':Sequelize[_0x9cc4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9cc4('0x1')],'allowNull':![],'defaultValue':_0x9cc4('0x2')},'remoteUri':{'type':Sequelize[_0x9cc4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9cc4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd37c=['STRING','sequelize','exports'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xd37c,0xd9));var _0xcd37=function(_0xb8e5aa,_0x5d1a94){_0xb8e5aa=_0xb8e5aa-0x0;var _0x38fee2=_0xd37c[_0xb8e5aa];return _0x38fee2;};'use strict';var Sequelize=require(_0xcd37('0x0'));module[_0xcd37('0x1')]={'name':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcd37('0x2')]},'username':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xcd37('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 6be4e1e..24eb941 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 _0x0d4b=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','reject','save','then','destroy','error','stack','name','send','index','VtigerAccount','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','update','getConfigurations','VtigerConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','result','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x46c3f7,_0x5b474c){var _0x573934=function(_0x5ce446){while(--_0x5ce446){_0x46c3f7['push'](_0x46c3f7['shift']());}};_0x573934(++_0x5b474c);}(_0x0d4b,0xd6));var _0xb0d4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0d4b[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xb0d4('0x0'));var rimraf=require(_0xb0d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb0d4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb0d4('0x3'));var Mustache=require(_0xb0d4('0x4'));var util=require('util');var path=require(_0xb0d4('0x5'));var sox=require(_0xb0d4('0x6'));var csv=require(_0xb0d4('0x7'));var ejs=require(_0xb0d4('0x8'));var fs=require('fs');var fs_extra=require(_0xb0d4('0x9'));var _=require(_0xb0d4('0xa'));var squel=require(_0xb0d4('0xb'));var crypto=require(_0xb0d4('0xc'));var jsforce=require(_0xb0d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb0d4('0x7'));var querystring=require(_0xb0d4('0xe'));var Papa=require(_0xb0d4('0xf'));var Redis=require(_0xb0d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb0d4('0x11'));var as=require(_0xb0d4('0x12'));var hardwareService=require(_0xb0d4('0x13'));var logger=require('../../config/logger')(_0xb0d4('0x14'));var utils=require(_0xb0d4('0x15'));var config=require(_0xb0d4('0x16'));var licenseUtil=require(_0xb0d4('0x17'));var db=require(_0xb0d4('0x18'))['db'];var integrations=require(_0xb0d4('0x19'));function respondWithStatusCode(_0x48ce71,_0x4ffa79){_0x4ffa79=_0x4ffa79||0xcc;return function(_0x3143f2){if(_0x3143f2){return _0x48ce71[_0xb0d4('0x1a')](_0x4ffa79);}return _0x48ce71['status'](_0x4ffa79)[_0xb0d4('0x1b')]();};}function respondWithResult(_0x181214,_0x22b84c){_0x22b84c=_0x22b84c||0xc8;return function(_0x3e67dd){if(_0x3e67dd){return _0x181214[_0xb0d4('0x1c')](_0x22b84c)[_0xb0d4('0x1d')](_0x3e67dd);}};}function respondWithFilteredResult(_0x3f0a5e,_0x10e7aa){return function(_0x1c9ceb){if(_0x1c9ceb){var _0x540707=typeof _0x10e7aa[_0xb0d4('0x1e')]===_0xb0d4('0x1f')&&typeof _0x10e7aa['limit']===_0xb0d4('0x1f');var _0x1cf078=_0x1c9ceb[_0xb0d4('0x20')];var _0x395836=_0x540707?0x0:_0x10e7aa[_0xb0d4('0x1e')];var _0x3e72ee=_0x540707?_0x1c9ceb[_0xb0d4('0x20')]:_0x10e7aa[_0xb0d4('0x1e')]+_0x10e7aa['limit'];var _0x582ea5;if(_0x3e72ee>=_0x1cf078){_0x3e72ee=_0x1cf078;_0x582ea5=0xc8;}else{_0x582ea5=0xce;}_0x3f0a5e['status'](_0x582ea5);return _0x3f0a5e['set']('Content-Range',_0x395836+'-'+_0x3e72ee+'/'+_0x1cf078)[_0xb0d4('0x1d')](_0x1c9ceb);}return null;};}function patchUpdates(_0x2f2d84){return function(_0x1e9d38){try{jsonpatch['apply'](_0x1e9d38,_0x2f2d84,!![]);}catch(_0x38c971){return BPromise[_0xb0d4('0x21')](_0x38c971);}return _0x1e9d38[_0xb0d4('0x22')]();};}function saveUpdates(_0x4599c4,_0x51f7ba){return function(_0x5c610f){if(_0x5c610f){return _0x5c610f['update'](_0x4599c4)[_0xb0d4('0x23')](function(_0x191797){return _0x191797;});}return null;};}function removeEntity(_0x183a02,_0x2fb055){return function(_0xd36b28){if(_0xd36b28){return _0xd36b28[_0xb0d4('0x24')]()[_0xb0d4('0x23')](function(){_0x183a02[_0xb0d4('0x1c')](0xcc)[_0xb0d4('0x1b')]();});}};}function handleEntityNotFound(_0x463608,_0x3dfba7){return function(_0x2cf0c4){if(!_0x2cf0c4){_0x463608[_0xb0d4('0x1a')](0x194);}return _0x2cf0c4;};}function handleError(_0x15a2b9,_0x2b5cfa){_0x2b5cfa=_0x2b5cfa||0x1f4;return function(_0x46242d){logger[_0xb0d4('0x25')](_0x46242d[_0xb0d4('0x26')]);if(_0x46242d[_0xb0d4('0x27')]){delete _0x46242d[_0xb0d4('0x27')];}_0x15a2b9['status'](_0x2b5cfa)[_0xb0d4('0x28')](_0x46242d);};}exports[_0xb0d4('0x29')]=function(_0x35a810,_0x19bea6){var _0x312598={},_0x3b4d0f={},_0x31576b={'count':0x0,'rows':[]};var _0x4cf14b=_['map'](db[_0xb0d4('0x2a')]['rawAttributes'],function(_0x368ae1){return{'name':_0x368ae1[_0xb0d4('0x2b')],'type':_0x368ae1[_0xb0d4('0x2c')]['key']};});_0x3b4d0f['model']=_[_0xb0d4('0x2d')](_0x4cf14b,_0xb0d4('0x27'));_0x3b4d0f['query']=_[_0xb0d4('0x2e')](_0x35a810[_0xb0d4('0x2f')]);_0x3b4d0f[_0xb0d4('0x30')]=_[_0xb0d4('0x31')](_0x3b4d0f[_0xb0d4('0x32')],_0x3b4d0f[_0xb0d4('0x2f')]);_0x312598[_0xb0d4('0x33')]=_[_0xb0d4('0x31')](_0x3b4d0f[_0xb0d4('0x32')],qs[_0xb0d4('0x34')](_0x35a810[_0xb0d4('0x2f')][_0xb0d4('0x34')]));_0x312598[_0xb0d4('0x33')]=_0x312598[_0xb0d4('0x33')][_0xb0d4('0x35')]?_0x312598[_0xb0d4('0x33')]:_0x3b4d0f[_0xb0d4('0x32')];if(!_0x35a810[_0xb0d4('0x2f')][_0xb0d4('0x36')](_0xb0d4('0x37'))){_0x312598['limit']=qs[_0xb0d4('0x38')](_0x35a810[_0xb0d4('0x2f')][_0xb0d4('0x38')]);_0x312598[_0xb0d4('0x1e')]=qs['offset'](_0x35a810[_0xb0d4('0x2f')][_0xb0d4('0x1e')]);}_0x312598[_0xb0d4('0x39')]=qs[_0xb0d4('0x3a')](_0x35a810[_0xb0d4('0x2f')][_0xb0d4('0x3a')]);_0x312598[_0xb0d4('0x3b')]=qs[_0xb0d4('0x30')](_[_0xb0d4('0x3c')](_0x35a810['query'],_0x3b4d0f[_0xb0d4('0x30')]),_0x4cf14b);if(_0x35a810['query'][_0xb0d4('0x3d')]){_0x312598[_0xb0d4('0x3b')]=_[_0xb0d4('0x3e')](_0x312598[_0xb0d4('0x3b')],{'$or':_[_0xb0d4('0x2d')](_0x4cf14b,function(_0x27e3c0){if(_0x27e3c0[_0xb0d4('0x2c')]!==_0xb0d4('0x3f')){var _0x3d258c={};_0x3d258c[_0x27e3c0[_0xb0d4('0x27')]]={'$like':'%'+_0x35a810['query'][_0xb0d4('0x3d')]+'%'};return _0x3d258c;}})});}_0x312598=_[_0xb0d4('0x3e')]({},_0x312598,_0x35a810['options']);var _0x5f3335={'where':_0x312598[_0xb0d4('0x3b')]};return db['VtigerAccount']['count'](_0x5f3335)[_0xb0d4('0x23')](function(_0x586123){_0x31576b[_0xb0d4('0x20')]=_0x586123;if(_0x35a810[_0xb0d4('0x2f')]['includeAll']){_0x312598['include']=[{'all':!![]}];}return db[_0xb0d4('0x2a')]['findAll'](_0x312598);})[_0xb0d4('0x23')](function(_0x22bbcd){_0x31576b['rows']=_0x22bbcd;return _0x31576b;})['then'](respondWithFilteredResult(_0x19bea6,_0x312598))[_0xb0d4('0x40')](handleError(_0x19bea6,null));};exports[_0xb0d4('0x41')]=function(_0x49b645,_0x423d5d){var _0x4b3062={'raw':![],'where':{'id':_0x49b645[_0xb0d4('0x42')]['id']}},_0xe3bd35={};_0xe3bd35[_0xb0d4('0x32')]=_[_0xb0d4('0x2e')](db[_0xb0d4('0x2a')][_0xb0d4('0x43')]);_0xe3bd35[_0xb0d4('0x2f')]=_[_0xb0d4('0x2e')](_0x49b645[_0xb0d4('0x2f')]);_0xe3bd35['filters']=_[_0xb0d4('0x31')](_0xe3bd35[_0xb0d4('0x32')],_0xe3bd35['query']);_0x4b3062['attributes']=_[_0xb0d4('0x31')](_0xe3bd35[_0xb0d4('0x32')],qs['fields'](_0x49b645[_0xb0d4('0x2f')][_0xb0d4('0x34')]));_0x4b3062[_0xb0d4('0x33')]=_0x4b3062['attributes'][_0xb0d4('0x35')]?_0x4b3062[_0xb0d4('0x33')]:_0xe3bd35[_0xb0d4('0x32')];if(_0x49b645['query'][_0xb0d4('0x44')]){_0x4b3062[_0xb0d4('0x45')]=[{'all':!![]}];}_0x4b3062=_[_0xb0d4('0x3e')]({},_0x4b3062,_0x49b645[_0xb0d4('0x46')]);return db[_0xb0d4('0x2a')][_0xb0d4('0x47')](_0x4b3062)[_0xb0d4('0x23')](handleEntityNotFound(_0x423d5d,null))[_0xb0d4('0x23')](respondWithResult(_0x423d5d,null))[_0xb0d4('0x40')](handleError(_0x423d5d,null));};exports[_0xb0d4('0x48')]=function(_0x2c7013,_0x5d7e9b){return db[_0xb0d4('0x2a')][_0xb0d4('0x48')](_0x2c7013[_0xb0d4('0x49')],{})[_0xb0d4('0x23')](respondWithResult(_0x5d7e9b,0xc9))[_0xb0d4('0x40')](handleError(_0x5d7e9b,null));};exports[_0xb0d4('0x4a')]=function(_0x4d1181,_0x46c3af){if(_0x4d1181[_0xb0d4('0x49')]['id']){delete _0x4d1181[_0xb0d4('0x49')]['id'];}return db[_0xb0d4('0x2a')][_0xb0d4('0x47')]({'where':{'id':_0x4d1181[_0xb0d4('0x42')]['id']}})[_0xb0d4('0x23')](handleEntityNotFound(_0x46c3af,null))['then'](saveUpdates(_0x4d1181[_0xb0d4('0x49')],null))[_0xb0d4('0x23')](respondWithResult(_0x46c3af,null))['catch'](handleError(_0x46c3af,null));};exports['destroy']=function(_0x1673af,_0x479dee){return db[_0xb0d4('0x2a')][_0xb0d4('0x47')]({'where':{'id':_0x1673af[_0xb0d4('0x42')]['id']}})[_0xb0d4('0x23')](handleEntityNotFound(_0x479dee,null))['then'](removeEntity(_0x479dee,null))['catch'](handleError(_0x479dee,null));};exports[_0xb0d4('0x4b')]=function(_0x10d382,_0x3f2f6c,_0x221052){var _0x11cfc4={};var _0x595e45={};var _0x525e1b;var _0x58a4c5;return db['VtigerAccount']['findOne']({'where':{'id':_0x10d382[_0xb0d4('0x42')]['id']}})[_0xb0d4('0x23')](handleEntityNotFound(_0x3f2f6c,null))[_0xb0d4('0x23')](function(_0x3d72f1){if(_0x3d72f1){_0x525e1b=_0x3d72f1;_0x595e45[_0xb0d4('0x32')]=_[_0xb0d4('0x2e')](db[_0xb0d4('0x4c')]['rawAttributes']);_0x595e45['query']=_['keys'](_0x10d382[_0xb0d4('0x2f')]);_0x595e45['filters']=_['intersection'](_0x595e45['model'],_0x595e45[_0xb0d4('0x2f')]);_0x11cfc4[_0xb0d4('0x33')]=_[_0xb0d4('0x31')](_0x595e45[_0xb0d4('0x32')],qs[_0xb0d4('0x34')](_0x10d382[_0xb0d4('0x2f')]['fields']));_0x11cfc4[_0xb0d4('0x33')]=_0x11cfc4[_0xb0d4('0x33')][_0xb0d4('0x35')]?_0x11cfc4['attributes']:_0x595e45[_0xb0d4('0x32')];_0x11cfc4[_0xb0d4('0x39')]=qs[_0xb0d4('0x3a')](_0x10d382[_0xb0d4('0x2f')][_0xb0d4('0x3a')]);_0x11cfc4[_0xb0d4('0x3b')]=qs[_0xb0d4('0x30')](_[_0xb0d4('0x3c')](_0x10d382[_0xb0d4('0x2f')],_0x595e45[_0xb0d4('0x30')]));if(_0x10d382[_0xb0d4('0x2f')][_0xb0d4('0x3d')]){_0x11cfc4['where']=_['merge'](_0x11cfc4[_0xb0d4('0x3b')],{'$or':_[_0xb0d4('0x2d')](_0x11cfc4[_0xb0d4('0x33')],function(_0xa305bf){var _0x24904a={};_0x24904a[_0xa305bf]={'$like':'%'+_0x10d382['query'][_0xb0d4('0x3d')]+'%'};return _0x24904a;})});}_0x11cfc4=_[_0xb0d4('0x3e')]({},_0x11cfc4,_0x10d382[_0xb0d4('0x46')]);return _0x525e1b[_0xb0d4('0x4b')](_0x11cfc4);}})[_0xb0d4('0x23')](function(_0x58db16){if(_0x58db16){_0x58a4c5=_0x58db16[_0xb0d4('0x35')];if(!_0x10d382[_0xb0d4('0x2f')][_0xb0d4('0x36')](_0xb0d4('0x37'))){_0x11cfc4[_0xb0d4('0x38')]=qs[_0xb0d4('0x38')](_0x10d382['query'][_0xb0d4('0x38')]);_0x11cfc4[_0xb0d4('0x1e')]=qs[_0xb0d4('0x1e')](_0x10d382['query'][_0xb0d4('0x1e')]);}return _0x525e1b[_0xb0d4('0x4b')](_0x11cfc4);}})[_0xb0d4('0x23')](function(_0x2fe09a){if(_0x2fe09a){return _0x2fe09a?{'count':_0x58a4c5,'rows':_0x2fe09a}:null;}})[_0xb0d4('0x23')](respondWithResult(_0x3f2f6c,null))[_0xb0d4('0x40')](handleError(_0x3f2f6c,null));};exports[_0xb0d4('0x4d')]=function(_0x40d384,_0x44ccaf,_0x534705){if(_0x40d384[_0xb0d4('0x49')]['id']){delete _0x40d384[_0xb0d4('0x49')]['id'];}return db[_0xb0d4('0x2a')][_0xb0d4('0x4e')]({'where':{'id':_0x40d384[_0xb0d4('0x42')]['id']}})[_0xb0d4('0x23')](handleEntityNotFound(_0x44ccaf,null))['then'](function(_0x78595a){if(_0x78595a){_0x40d384[_0xb0d4('0x49')]['AccountId']=_0x78595a['id'];_0x40d384['body'][_0xb0d4('0x4f')]=integrations[_0xb0d4('0x50')](_0x40d384[_0xb0d4('0x49')][_0xb0d4('0x51')],_0x40d384[_0xb0d4('0x49')][_0xb0d4('0x2c')]);_0x40d384['body'][_0xb0d4('0x52')]=integrations['getDescriptions'](_0x40d384['body'][_0xb0d4('0x51')],_0x40d384[_0xb0d4('0x49')][_0xb0d4('0x2c')]);return db[_0xb0d4('0x4c')]['create'](_0x40d384['body'],{'include':[{'model':db[_0xb0d4('0x53')],'as':_0xb0d4('0x4f')},{'model':db[_0xb0d4('0x53')],'as':'Descriptions'}]});}return null;})[_0xb0d4('0x23')](respondWithResult(_0x44ccaf,null))[_0xb0d4('0x40')](handleError(_0x44ccaf,null));};var md5=require(_0xb0d4('0x54'));exports[_0xb0d4('0x55')]=function(_0x5afd0d,_0xac4886,_0x45a7f1){var _0x16c709=null;var _0x36a1ad=null;var _0x290bd7=null;var _0x3e6854=null;var _0x6a8dea='';return db['VtigerAccount'][_0xb0d4('0x4e')]({'where':{'id':_0x5afd0d[_0xb0d4('0x42')]['id']},'attributes':['id',_0xb0d4('0x27'),_0xb0d4('0x56'),_0xb0d4('0x57'),_0xb0d4('0x58'),'remoteUri',_0xb0d4('0x59'),_0xb0d4('0x5a')]})['then'](handleEntityNotFound(_0xac4886,null))[_0xb0d4('0x23')](function(_0x36a22f){if(_0x36a22f){_0x16c709=_0x36a22f[_0xb0d4('0x56')];_0x36a1ad=_0x36a22f[_0xb0d4('0x5a')];_0x290bd7=_0x36a22f[_0xb0d4('0x58')];_0x6a8dea=_0x36a22f[_0xb0d4('0x5b')];var _0x3cc688=_0x6a8dea[_0xb0d4('0x5c')](-0x1);if(_0x3cc688==='/'){_0x6a8dea=_0x6a8dea['substring'](0x0,_0x6a8dea[_0xb0d4('0x5d')](_0x3cc688));}_0x3e6854=util[_0xb0d4('0x5e')](_0xb0d4('0x5f'),_0x6a8dea);var _0x4e62a6={'method':_0xb0d4('0x60'),'uri':_0x3e6854,'qs':{'operation':_0xb0d4('0x61'),'username':_0x36a22f[_0xb0d4('0x56')]},'json':!![]};return rp(_0x4e62a6);}})[_0xb0d4('0x23')](function(_0x5493c3){if(_0x5493c3['success']){var _0x54a638={'method':_0xb0d4('0x62'),'uri':_0x3e6854,'form':{'operation':_0xb0d4('0x63'),'username':_0x16c709,'accessKey':md5(_0x5493c3['result'][_0xb0d4('0x64')]+_0x36a1ad)},'json':!![]};return rp(_0x54a638);}})[_0xb0d4('0x23')](function(_0x4759d5){if(_0x4759d5[_0xb0d4('0x65')]){var _0x4668a7={'method':_0xb0d4('0x60'),'uri':_0x3e6854,'qs':{'operation':'describe','username':_0x16c709,'sessionName':_0x4759d5[_0xb0d4('0x66')]['sessionName'],'elementType':_0x290bd7},'json':!![]};return rp(_0x4668a7);}})[_0xb0d4('0x23')](function(_0x2acc1b){if(_0x2acc1b[_0xb0d4('0x65')]){var _0x5976de=['autogenerated','reference',_0xb0d4('0x67')];_[_0xb0d4('0x68')](_0x2acc1b[_0xb0d4('0x66')][_0xb0d4('0x34')],function(_0x1741d0){return _0x5976de[_0xb0d4('0x69')](_0x1741d0['type']['name']);});_[_0xb0d4('0x68')](_0x2acc1b[_0xb0d4('0x66')][_0xb0d4('0x34')],function(_0x2cd1f8){return _0x2cd1f8[_0xb0d4('0x6a')]===_0xb0d4('0x6b');});return{'count':_0x2acc1b[_0xb0d4('0x66')]['fields']['length'],'rows':_[_0xb0d4('0x2d')](_0x2acc1b[_0xb0d4('0x66')][_0xb0d4('0x34')],function(_0x2d45cb){return{'id':_0x2d45cb[_0xb0d4('0x27')],'name':_0x2d45cb[_0xb0d4('0x6c')],'custom':_[_0xb0d4('0x6d')](_0x2d45cb[_0xb0d4('0x27')],_0xb0d4('0x6e'))?!![]:![],'options':_0x2d45cb['type'][_0xb0d4('0x27')]===_0xb0d4('0x6f')&&_0x2d45cb[_0xb0d4('0x2c')][_0xb0d4('0x70')][_0xb0d4('0x35')]>0x0?_['map'](_0x2d45cb[_0xb0d4('0x2c')][_0xb0d4('0x70')],function(_0x5a9cbd){return{'name':_0x5a9cbd[_0xb0d4('0x6c')],'value':_0x5a9cbd[_0xb0d4('0x71')]};}):[]};})};}})[_0xb0d4('0x23')](respondWithResult(_0xac4886,null))[_0xb0d4('0x40')](function(_0xf601d1){console['log']('vTiger\x20error:\x20'+_0xf601d1);var _0x56ade1=_0x5afd0d[_0xb0d4('0x2f')]['test']?0x1f4:_0xf601d1[_0xb0d4('0x72')]||0x1f4;logger[_0xb0d4('0x25')](_0xb0d4('0x73'),_0xb0d4('0x55'),_0x56ade1,JSON['stringify'](_0xf601d1));delete _0xf601d1['name'];if(_0x56ade1===0x191){_0x56ade1=0x190;}_0xac4886['status'](_0x56ade1)[_0xb0d4('0x28')](_0x5afd0d[_0xb0d4('0x2f')][_0xb0d4('0x74')]?{'message':_0xb0d4('0x75'),'statusCode':_0xf601d1[_0xb0d4('0x72')]}:_0xf601d1);});}; \ No newline at end of file +var _0x736f=['statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','keys','find','create','body','params','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','remoteUri','accessKey','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklistValues','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x736f,0xed));var _0xf736=function(_0xfae941,_0x31dc68){_0xfae941=_0xfae941-0x0;var _0xd21834=_0x736f[_0xfae941];return _0xd21834;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf736('0x0'));var jsonpatch=require(_0xf736('0x1'));var rp=require(_0xf736('0x2'));var moment=require(_0xf736('0x3'));var BPromise=require(_0xf736('0x4'));var Mustache=require('mustache');var util=require(_0xf736('0x5'));var path=require(_0xf736('0x6'));var sox=require(_0xf736('0x7'));var csv=require('to-csv');var ejs=require(_0xf736('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf736('0x9'));var squel=require('squel');var crypto=require(_0xf736('0xa'));var jsforce=require(_0xf736('0xb'));var deskjs=require(_0xf736('0xc'));var toCsv=require(_0xf736('0xd'));var querystring=require('querystring');var Papa=require(_0xf736('0xe'));var Redis=require(_0xf736('0xf'));var authService=require(_0xf736('0x10'));var qs=require(_0xf736('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf736('0x12'));var logger=require(_0xf736('0x13'))(_0xf736('0x14'));var utils=require(_0xf736('0x15'));var config=require(_0xf736('0x16'));var licenseUtil=require(_0xf736('0x17'));var db=require(_0xf736('0x18'))['db'];var integrations=require(_0xf736('0x19'));function respondWithStatusCode(_0x4e3dd4,_0x435079){_0x435079=_0x435079||0xcc;return function(_0x4ed611){if(_0x4ed611){return _0x4e3dd4['sendStatus'](_0x435079);}return _0x4e3dd4['status'](_0x435079)[_0xf736('0x1a')]();};}function respondWithResult(_0x5324d8,_0x45b252){_0x45b252=_0x45b252||0xc8;return function(_0x2e2dce){if(_0x2e2dce){return _0x5324d8['status'](_0x45b252)[_0xf736('0x1b')](_0x2e2dce);}};}function respondWithFilteredResult(_0x3b422e,_0x646c02){return function(_0x309105){if(_0x309105){var _0x32d215=typeof _0x646c02[_0xf736('0x1c')]===_0xf736('0x1d')&&typeof _0x646c02['limit']===_0xf736('0x1d');var _0x44358d=_0x309105[_0xf736('0x1e')];var _0x16fc91=_0x32d215?0x0:_0x646c02[_0xf736('0x1c')];var _0x409558=_0x32d215?_0x309105['count']:_0x646c02[_0xf736('0x1c')]+_0x646c02[_0xf736('0x1f')];var _0x588db4;if(_0x409558>=_0x44358d){_0x409558=_0x44358d;_0x588db4=0xc8;}else{_0x588db4=0xce;}_0x3b422e[_0xf736('0x20')](_0x588db4);return _0x3b422e[_0xf736('0x21')](_0xf736('0x22'),_0x16fc91+'-'+_0x409558+'/'+_0x44358d)[_0xf736('0x1b')](_0x309105);}return null;};}function patchUpdates(_0x24698a){return function(_0x5dea4e){try{jsonpatch[_0xf736('0x23')](_0x5dea4e,_0x24698a,!![]);}catch(_0x35d82c){return BPromise[_0xf736('0x24')](_0x35d82c);}return _0x5dea4e[_0xf736('0x25')]();};}function saveUpdates(_0x2348d2,_0x30a2d8){return function(_0x405a62){if(_0x405a62){return _0x405a62[_0xf736('0x26')](_0x2348d2)[_0xf736('0x27')](function(_0x4f997f){return _0x4f997f;});}return null;};}function removeEntity(_0xc78285,_0x281672){return function(_0x120e9e){if(_0x120e9e){return _0x120e9e[_0xf736('0x28')]()[_0xf736('0x27')](function(){_0xc78285[_0xf736('0x20')](0xcc)[_0xf736('0x1a')]();});}};}function handleEntityNotFound(_0xbff798,_0x293c40){return function(_0x2d5ffa){if(!_0x2d5ffa){_0xbff798['sendStatus'](0x194);}return _0x2d5ffa;};}function handleError(_0x12883f,_0x513971){_0x513971=_0x513971||0x1f4;return function(_0x211f20){logger[_0xf736('0x29')](_0x211f20[_0xf736('0x2a')]);if(_0x211f20[_0xf736('0x2b')]){delete _0x211f20[_0xf736('0x2b')];}_0x12883f[_0xf736('0x20')](_0x513971)[_0xf736('0x2c')](_0x211f20);};}exports[_0xf736('0x2d')]=function(_0x3decb9,_0x2cb04c){var _0xd576a0={},_0x41de95={},_0x7fe9d1={'count':0x0,'rows':[]};var _0x2c72c9=_[_0xf736('0x2e')](db[_0xf736('0x2f')][_0xf736('0x30')],function(_0x2ff7eb){return{'name':_0x2ff7eb[_0xf736('0x31')],'type':_0x2ff7eb['type'][_0xf736('0x32')]};});_0x41de95[_0xf736('0x33')]=_[_0xf736('0x2e')](_0x2c72c9,'name');_0x41de95[_0xf736('0x34')]=_['keys'](_0x3decb9[_0xf736('0x34')]);_0x41de95['filters']=_[_0xf736('0x35')](_0x41de95[_0xf736('0x33')],_0x41de95[_0xf736('0x34')]);_0xd576a0['attributes']=_[_0xf736('0x35')](_0x41de95[_0xf736('0x33')],qs[_0xf736('0x36')](_0x3decb9[_0xf736('0x34')]['fields']));_0xd576a0[_0xf736('0x37')]=_0xd576a0[_0xf736('0x37')][_0xf736('0x38')]?_0xd576a0[_0xf736('0x37')]:_0x41de95['model'];if(!_0x3decb9[_0xf736('0x34')][_0xf736('0x39')](_0xf736('0x3a'))){_0xd576a0[_0xf736('0x1f')]=qs[_0xf736('0x1f')](_0x3decb9[_0xf736('0x34')]['limit']);_0xd576a0['offset']=qs['offset'](_0x3decb9['query'][_0xf736('0x1c')]);}_0xd576a0[_0xf736('0x3b')]=qs[_0xf736('0x3c')](_0x3decb9[_0xf736('0x34')][_0xf736('0x3c')]);_0xd576a0[_0xf736('0x3d')]=qs['filters'](_[_0xf736('0x3e')](_0x3decb9[_0xf736('0x34')],_0x41de95[_0xf736('0x3f')]),_0x2c72c9);if(_0x3decb9[_0xf736('0x34')]['filter']){_0xd576a0['where']=_['merge'](_0xd576a0[_0xf736('0x3d')],{'$or':_[_0xf736('0x2e')](_0x2c72c9,function(_0x215fe3){if(_0x215fe3[_0xf736('0x40')]!==_0xf736('0x41')){var _0x3f536d={};_0x3f536d[_0x215fe3[_0xf736('0x2b')]]={'$like':'%'+_0x3decb9[_0xf736('0x34')][_0xf736('0x42')]+'%'};return _0x3f536d;}})});}_0xd576a0=_[_0xf736('0x43')]({},_0xd576a0,_0x3decb9[_0xf736('0x44')]);var _0x357b84={'where':_0xd576a0[_0xf736('0x3d')]};return db[_0xf736('0x2f')]['count'](_0x357b84)[_0xf736('0x27')](function(_0x1025cb){_0x7fe9d1[_0xf736('0x1e')]=_0x1025cb;if(_0x3decb9[_0xf736('0x34')]['includeAll']){_0xd576a0[_0xf736('0x45')]=[{'all':!![]}];}return db[_0xf736('0x2f')][_0xf736('0x46')](_0xd576a0);})[_0xf736('0x27')](function(_0x1bf2ba){_0x7fe9d1['rows']=_0x1bf2ba;return _0x7fe9d1;})[_0xf736('0x27')](respondWithFilteredResult(_0x2cb04c,_0xd576a0))[_0xf736('0x47')](handleError(_0x2cb04c,null));};exports[_0xf736('0x48')]=function(_0xa0d33f,_0x537577){var _0x50b357={'raw':![],'where':{'id':_0xa0d33f['params']['id']}},_0x1ca05f={};_0x1ca05f[_0xf736('0x33')]=_[_0xf736('0x49')](db[_0xf736('0x2f')][_0xf736('0x30')]);_0x1ca05f[_0xf736('0x34')]=_[_0xf736('0x49')](_0xa0d33f['query']);_0x1ca05f[_0xf736('0x3f')]=_[_0xf736('0x35')](_0x1ca05f[_0xf736('0x33')],_0x1ca05f[_0xf736('0x34')]);_0x50b357[_0xf736('0x37')]=_[_0xf736('0x35')](_0x1ca05f['model'],qs[_0xf736('0x36')](_0xa0d33f[_0xf736('0x34')]['fields']));_0x50b357[_0xf736('0x37')]=_0x50b357[_0xf736('0x37')][_0xf736('0x38')]?_0x50b357[_0xf736('0x37')]:_0x1ca05f[_0xf736('0x33')];if(_0xa0d33f[_0xf736('0x34')]['includeAll']){_0x50b357[_0xf736('0x45')]=[{'all':!![]}];}_0x50b357=_['merge']({},_0x50b357,_0xa0d33f['options']);return db[_0xf736('0x2f')][_0xf736('0x4a')](_0x50b357)[_0xf736('0x27')](handleEntityNotFound(_0x537577,null))[_0xf736('0x27')](respondWithResult(_0x537577,null))[_0xf736('0x47')](handleError(_0x537577,null));};exports[_0xf736('0x4b')]=function(_0x38e8e4,_0x19cf8f){return db['VtigerAccount'][_0xf736('0x4b')](_0x38e8e4[_0xf736('0x4c')],{})[_0xf736('0x27')](respondWithResult(_0x19cf8f,0xc9))[_0xf736('0x47')](handleError(_0x19cf8f,null));};exports[_0xf736('0x26')]=function(_0x382f52,_0x1ab3b3){if(_0x382f52['body']['id']){delete _0x382f52[_0xf736('0x4c')]['id'];}return db[_0xf736('0x2f')]['find']({'where':{'id':_0x382f52[_0xf736('0x4d')]['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x1ab3b3,null))[_0xf736('0x27')](saveUpdates(_0x382f52[_0xf736('0x4c')],null))[_0xf736('0x27')](respondWithResult(_0x1ab3b3,null))[_0xf736('0x47')](handleError(_0x1ab3b3,null));};exports[_0xf736('0x28')]=function(_0x5627cc,_0x196b55){return db['VtigerAccount'][_0xf736('0x4a')]({'where':{'id':_0x5627cc['params']['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x196b55,null))['then'](removeEntity(_0x196b55,null))[_0xf736('0x47')](handleError(_0x196b55,null));};exports['getConfigurations']=function(_0x3f70ae,_0x568223,_0x41ebc8){var _0x357aa0={};var _0x52a63e={};var _0x42a58f;var _0x46ace5;return db[_0xf736('0x2f')][_0xf736('0x4e')]({'where':{'id':_0x3f70ae[_0xf736('0x4d')]['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x568223,null))['then'](function(_0x4b6bff){if(_0x4b6bff){_0x42a58f=_0x4b6bff;_0x52a63e[_0xf736('0x33')]=_[_0xf736('0x49')](db[_0xf736('0x4f')][_0xf736('0x30')]);_0x52a63e[_0xf736('0x34')]=_[_0xf736('0x49')](_0x3f70ae[_0xf736('0x34')]);_0x52a63e[_0xf736('0x3f')]=_[_0xf736('0x35')](_0x52a63e[_0xf736('0x33')],_0x52a63e['query']);_0x357aa0[_0xf736('0x37')]=_[_0xf736('0x35')](_0x52a63e[_0xf736('0x33')],qs[_0xf736('0x36')](_0x3f70ae[_0xf736('0x34')][_0xf736('0x36')]));_0x357aa0[_0xf736('0x37')]=_0x357aa0[_0xf736('0x37')][_0xf736('0x38')]?_0x357aa0[_0xf736('0x37')]:_0x52a63e[_0xf736('0x33')];_0x357aa0[_0xf736('0x3b')]=qs[_0xf736('0x3c')](_0x3f70ae[_0xf736('0x34')][_0xf736('0x3c')]);_0x357aa0[_0xf736('0x3d')]=qs[_0xf736('0x3f')](_[_0xf736('0x3e')](_0x3f70ae[_0xf736('0x34')],_0x52a63e['filters']));if(_0x3f70ae[_0xf736('0x34')][_0xf736('0x42')]){_0x357aa0[_0xf736('0x3d')]=_[_0xf736('0x43')](_0x357aa0[_0xf736('0x3d')],{'$or':_[_0xf736('0x2e')](_0x357aa0['attributes'],function(_0x31c692){var _0x9b3fad={};_0x9b3fad[_0x31c692]={'$like':'%'+_0x3f70ae[_0xf736('0x34')][_0xf736('0x42')]+'%'};return _0x9b3fad;})});}_0x357aa0=_[_0xf736('0x43')]({},_0x357aa0,_0x3f70ae[_0xf736('0x44')]);return _0x42a58f[_0xf736('0x50')](_0x357aa0);}})[_0xf736('0x27')](function(_0x4c1e1f){if(_0x4c1e1f){_0x46ace5=_0x4c1e1f['length'];if(!_0x3f70ae[_0xf736('0x34')][_0xf736('0x39')](_0xf736('0x3a'))){_0x357aa0['limit']=qs[_0xf736('0x1f')](_0x3f70ae['query'][_0xf736('0x1f')]);_0x357aa0[_0xf736('0x1c')]=qs['offset'](_0x3f70ae[_0xf736('0x34')][_0xf736('0x1c')]);}return _0x42a58f[_0xf736('0x50')](_0x357aa0);}})[_0xf736('0x27')](function(_0x2647bb){if(_0x2647bb){return _0x2647bb?{'count':_0x46ace5,'rows':_0x2647bb}:null;}})[_0xf736('0x27')](respondWithResult(_0x568223,null))[_0xf736('0x47')](handleError(_0x568223,null));};exports[_0xf736('0x51')]=function(_0x52779e,_0x11d0cd,_0x1fb1ce){if(_0x52779e[_0xf736('0x4c')]['id']){delete _0x52779e[_0xf736('0x4c')]['id'];}return db[_0xf736('0x2f')][_0xf736('0x4e')]({'where':{'id':_0x52779e[_0xf736('0x4d')]['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x11d0cd,null))[_0xf736('0x27')](function(_0x27bb2a){if(_0x27bb2a){_0x52779e[_0xf736('0x4c')][_0xf736('0x52')]=_0x27bb2a['id'];_0x52779e['body'][_0xf736('0x53')]=integrations[_0xf736('0x54')](_0x52779e[_0xf736('0x4c')][_0xf736('0x55')],_0x52779e[_0xf736('0x4c')]['type']);_0x52779e[_0xf736('0x4c')][_0xf736('0x56')]=integrations[_0xf736('0x57')](_0x52779e[_0xf736('0x4c')]['channel'],_0x52779e[_0xf736('0x4c')][_0xf736('0x40')]);return db[_0xf736('0x4f')][_0xf736('0x4b')](_0x52779e['body'],{'include':[{'model':db['VtigerField'],'as':_0xf736('0x53')},{'model':db[_0xf736('0x58')],'as':_0xf736('0x56')}]});}return null;})[_0xf736('0x27')](respondWithResult(_0x11d0cd,null))['catch'](handleError(_0x11d0cd,null));};var md5=require('md5');exports[_0xf736('0x59')]=function(_0x74ce67,_0x1d6b93,_0x32b7af){var _0x39d405=null;var _0x2bbec1=null;var _0xe27a20=null;var _0x55d2ca=null;var _0x3d78a1='';return db[_0xf736('0x2f')][_0xf736('0x4e')]({'where':{'id':_0x74ce67['params']['id']},'attributes':['id','name',_0xf736('0x5a'),'description','moduleName',_0xf736('0x5b'),'serverUrl','accessKey']})[_0xf736('0x27')](handleEntityNotFound(_0x1d6b93,null))[_0xf736('0x27')](function(_0x89963d){if(_0x89963d){_0x39d405=_0x89963d[_0xf736('0x5a')];_0x2bbec1=_0x89963d[_0xf736('0x5c')];_0xe27a20=_0x89963d['moduleName'];_0x3d78a1=_0x89963d[_0xf736('0x5b')];var _0x3cdfa9=_0x3d78a1['slice'](-0x1);if(_0x3cdfa9==='/'){_0x3d78a1=_0x3d78a1[_0xf736('0x5d')](0x0,_0x3d78a1[_0xf736('0x5e')](_0x3cdfa9));}_0x55d2ca=util['format']('%s/webservice.php',_0x3d78a1);var _0x467df0={'method':_0xf736('0x5f'),'uri':_0x55d2ca,'qs':{'operation':_0xf736('0x60'),'username':_0x89963d[_0xf736('0x5a')]},'json':!![]};return rp(_0x467df0);}})['then'](function(_0x3b85ae){if(_0x3b85ae[_0xf736('0x61')]){var _0xa36fc4={'method':_0xf736('0x62'),'uri':_0x55d2ca,'form':{'operation':_0xf736('0x63'),'username':_0x39d405,'accessKey':md5(_0x3b85ae[_0xf736('0x64')][_0xf736('0x65')]+_0x2bbec1)},'json':!![]};return rp(_0xa36fc4);}})[_0xf736('0x27')](function(_0x2d5b01){if(_0x2d5b01[_0xf736('0x61')]){var _0x52fee5={'method':_0xf736('0x5f'),'uri':_0x55d2ca,'qs':{'operation':_0xf736('0x66'),'username':_0x39d405,'sessionName':_0x2d5b01['result']['sessionName'],'elementType':_0xe27a20},'json':!![]};return rp(_0x52fee5);}})['then'](function(_0x3ce212){if(_0x3ce212[_0xf736('0x61')]){var _0xaf0ab6=[_0xf736('0x67'),_0xf736('0x68'),'owner'];_[_0xf736('0x69')](_0x3ce212[_0xf736('0x64')][_0xf736('0x36')],function(_0x14d93a){return _0xaf0ab6[_0xf736('0x6a')](_0x14d93a[_0xf736('0x40')][_0xf736('0x2b')]);});_[_0xf736('0x69')](_0x3ce212[_0xf736('0x64')]['fields'],function(_0x16ebc6){return _0x16ebc6[_0xf736('0x6b')]===_0xf736('0x6c');});return{'count':_0x3ce212['result'][_0xf736('0x36')][_0xf736('0x38')],'rows':_[_0xf736('0x2e')](_0x3ce212[_0xf736('0x64')][_0xf736('0x36')],function(_0x472ff1){return{'id':_0x472ff1[_0xf736('0x2b')],'name':_0x472ff1[_0xf736('0x6d')],'custom':_[_0xf736('0x6e')](_0x472ff1[_0xf736('0x2b')],_0xf736('0x6f'))?!![]:![],'options':_0x472ff1[_0xf736('0x40')][_0xf736('0x2b')]==='picklist'&&_0x472ff1[_0xf736('0x40')][_0xf736('0x70')][_0xf736('0x38')]>0x0?_['map'](_0x472ff1[_0xf736('0x40')][_0xf736('0x70')],function(_0x2672ef){return{'name':_0x2672ef[_0xf736('0x6d')],'value':_0x2672ef['value']};}):[]};})};}})[_0xf736('0x27')](respondWithResult(_0x1d6b93,null))[_0xf736('0x47')](function(_0x55b49d){console['log']('vTiger\x20error:\x20'+_0x55b49d);var _0xd19e53=_0x74ce67['query'][_0xf736('0x71')]?0x1f4:_0x55b49d['statusCode']||0x1f4;logger[_0xf736('0x29')](_0xf736('0x72'),_0xf736('0x59'),_0xd19e53,JSON[_0xf736('0x73')](_0x55b49d));delete _0x55b49d[_0xf736('0x2b')];if(_0xd19e53===0x191){_0xd19e53=0x190;}_0x1d6b93[_0xf736('0x20')](_0xd19e53)[_0xf736('0x2c')](_0x74ce67['query'][_0xf736('0x71')]?{'message':_0xf736('0x74'),'statusCode':_0x55b49d[_0xf736('0x75')]}:_0x55b49d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f9ef257..8c4e4e4 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 _0x17d8=['define','VtigerAccount','lodash','../../config/logger','moment','request-promise','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x62a89a,_0x2ebb33){var _0x3ababc=function(_0x3a43a5){while(--_0x3a43a5){_0x62a89a['push'](_0x62a89a['shift']());}};_0x3ababc(++_0x2ebb33);}(_0x17d8,0xac));var _0x817d=function(_0x252cce,_0x27a697){_0x252cce=_0x252cce-0x0;var _0x55692f=_0x17d8[_0x252cce];return _0x55692f;};'use strict';var _=require(_0x817d('0x0'));var util=require('util');var logger=require(_0x817d('0x1'))('api');var moment=require(_0x817d('0x2'));var BPromise=require('bluebird');var rp=require(_0x817d('0x3'));var fs=require('fs');var path=require(_0x817d('0x4'));var rimraf=require('rimraf');var config=require(_0x817d('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x817d('0x6'));module[_0x817d('0x7')]=function(_0x5e2d81,_0x320642){return _0x5e2d81[_0x817d('0x8')](_0x817d('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec63=['util','../../config/logger','api','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x193d9d,_0x40f3cd){var _0x287179=function(_0x682f90){while(--_0x682f90){_0x193d9d['push'](_0x193d9d['shift']());}};_0x287179(++_0x40f3cd);}(_0xec63,0x174));var _0x3ec6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec63[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3ec6('0x0'));var logger=require(_0x3ec6('0x1'))(_0x3ec6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3ec6('0x3'));var fs=require('fs');var path=require(_0x3ec6('0x4'));var rimraf=require(_0x3ec6('0x5'));var config=require('../../config/environment');var attributes=require(_0x3ec6('0x6'));var integrations=require(_0x3ec6('0x7'));module[_0x3ec6('0x8')]=function(_0x17e4bc,_0x2bfd05){return _0x17e4bc[_0x3ec6('0x9')](_0x3ec6('0xa'),attributes,{'tableName':_0x3ec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index d445583..0ff63da 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 _0x757a=['stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x231118,_0x1e60d5){var _0x5a8a2c=function(_0x2ddb43){while(--_0x2ddb43){_0x231118['push'](_0x231118['shift']());}};_0x5a8a2c(++_0x1e60d5);}(_0x757a,0xde));var _0xa757=function(_0x50e993,_0x5e5aba){_0x50e993=_0x50e993-0x0;var _0x89e24a=_0x757a[_0x50e993];return _0x89e24a;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetVtigerAccount',_0x4d9f58);logger['debug']('GetVtigerAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetVtigerAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file +var _0x750a=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','options','raw','attributes','limit','model','include','map','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','where'];(function(_0x1f337f,_0x279740){var _0x30e5d9=function(_0x570792){while(--_0x570792){_0x1f337f['push'](_0x1f337f['shift']());}};_0x30e5d9(++_0x279740);}(_0x750a,0x140));var _0xa750=function(_0x15df8b,_0xbfffaa){_0x15df8b=_0x15df8b-0x0;var _0x34b845=_0x750a[_0x15df8b];return _0x34b845;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['GetVtigerAccount']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['VtigerAccount']['findAll']({'raw':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['where']||null:null,'attributes':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x17')]||null:null,'limit':_0x433dbd['options']?_0x433dbd['options'][_0xa750('0x18')]||null:null,'include':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['include']?_['map'](_0x433dbd['options']['include'],function(_0x15d72f){return{'model':db[_0x15d72f[_0xa750('0x19')]],'as':_0x15d72f['as'],'attributes':_0x15d72f[_0xa750('0x17')],'include':_0x15d72f[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x15d72f[_0xa750('0x1a')],function(_0x3001bc){return{'model':db[_0x3001bc[_0xa750('0x19')]],'as':_0x3001bc['as'],'attributes':_0x3001bc[_0xa750('0x17')],'include':_0x3001bc[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x3001bc[_0xa750('0x1a')],function(_0x31ea63){return{'model':db[_0x31ea63[_0xa750('0x19')]],'as':_0x31ea63['as'],'attributes':_0x31ea63[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3923){logger[_0xa750('0xc')](_0xa750('0x1c'),_0x433dbd);logger['debug'](_0xa750('0x1c'),_0x433dbd,JSON[_0xa750('0xf')](_0x3d3923));_0x4f1faa(_0x3d3923);})[_0xa750('0x14')](function(_0x1223d2){logger['error'](_0xa750('0x1c'),_0x1223d2[_0xa750('0x13')],_0x433dbd);_0x36dcca(_0x1bde87[_0xa750('0x10')](0x1f4,_0x1223d2[_0xa750('0x13')]));});});};exports[_0xa750('0x1d')]=function(_0x59ab33){var _0x46cc11=this;return new Promise(function(_0x4c2c9e,_0x2d0e93){return db[_0xa750('0x1e')]['find']({'raw':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x1f')]||null:null,'attributes':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')]['attributes']||null:null,'include':_0x59ab33[_0xa750('0x15')]?_0x59ab33['options'][_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x59ab33[_0xa750('0x15')][_0xa750('0x1a')],function(_0x556fde){return{'model':db[_0x556fde[_0xa750('0x19')]],'as':_0x556fde['as'],'attributes':_0x556fde[_0xa750('0x17')],'include':_0x556fde['include']?_[_0xa750('0x1b')](_0x556fde[_0xa750('0x1a')],function(_0x280b87){return{'model':db[_0x280b87[_0xa750('0x19')]],'as':_0x280b87['as'],'attributes':_0x280b87['attributes'],'include':_0x280b87[_0xa750('0x1a')]?_['map'](_0x280b87['include'],function(_0x4e59f3){return{'model':db[_0x4e59f3[_0xa750('0x19')]],'as':_0x4e59f3['as'],'attributes':_0x4e59f3[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470089){logger[_0xa750('0xc')](_0xa750('0x1d'),_0x59ab33);logger['debug'](_0xa750('0x1d'),_0x59ab33,JSON[_0xa750('0xf')](_0x470089));_0x4c2c9e(_0x470089);})[_0xa750('0x14')](function(_0x5d402a){logger[_0xa750('0x10')](_0xa750('0x1d'),_0x5d402a[_0xa750('0x13')],_0x59ab33);_0x2d0e93(_0x46cc11['error'](0x1f4,_0x5d402a[_0xa750('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index fca1f41..fa0b7c8 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 _0xfbb5=['../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fe496,_0x1d8673){var _0x422b24=function(_0x27a644){while(--_0x27a644){_0x4fe496['push'](_0x4fe496['shift']());}};_0x422b24(++_0x1d8673);}(_0xfbb5,0xb0));var _0x5fbb=function(_0x29f3c0,_0x4a61ae){_0x29f3c0=_0x29f3c0-0x0;var _0x9aff4b=_0xfbb5[_0x29f3c0];return _0x9aff4b;};'use strict';var multer=require(_0x5fbb('0x0'));var util=require(_0x5fbb('0x1'));var path=require(_0x5fbb('0x2'));var timeout=require(_0x5fbb('0x3'));var express=require(_0x5fbb('0x4'));var router=express[_0x5fbb('0x5')]();var fs_extra=require(_0x5fbb('0x6'));var auth=require(_0x5fbb('0x7'));var interaction=require(_0x5fbb('0x8'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x5fbb('0x9')]('/',auth['isAuthenticated'](),controller[_0x5fbb('0xa')]);router['get'](_0x5fbb('0xb'),auth[_0x5fbb('0xc')](),controller[_0x5fbb('0xd')]);router[_0x5fbb('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x5fbb('0x9')](_0x5fbb('0xe'),auth[_0x5fbb('0xc')](),controller[_0x5fbb('0xf')]);router['get'](_0x5fbb('0x10'),auth[_0x5fbb('0xc')](),controller['getDescriptions']);router[_0x5fbb('0x11')]('/',auth[_0x5fbb('0xc')](),controller['create']);router[_0x5fbb('0x12')](_0x5fbb('0xb'),auth[_0x5fbb('0xc')](),controller[_0x5fbb('0x13')]);router[_0x5fbb('0x14')](_0x5fbb('0xb'),auth[_0x5fbb('0xc')](),controller[_0x5fbb('0x15')]);module[_0x5fbb('0x16')]=router; \ No newline at end of file +var _0x549c=['getSubjects','getDescriptions','put','/:id','update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','getFields','/:id/subjects'];(function(_0x34f9b1,_0x3bcc25){var _0x2e4c47=function(_0x39f379){while(--_0x39f379){_0x34f9b1['push'](_0x34f9b1['shift']());}};_0x2e4c47(++_0x3bcc25);}(_0x549c,0x1bb));var _0xc549=function(_0x3fde68,_0x2d6748){_0x3fde68=_0x3fde68-0x0;var _0x5df613=_0x549c[_0x3fde68];return _0x5df613;};'use strict';var multer=require(_0xc549('0x0'));var util=require(_0xc549('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc549('0x2'));var router=express['Router']();var fs_extra=require(_0xc549('0x3'));var auth=require(_0xc549('0x4'));var interaction=require(_0xc549('0x5'));var config=require('../../config/environment');var controller=require(_0xc549('0x6'));router[_0xc549('0x7')]('/',auth['isAuthenticated'](),controller[_0xc549('0x8')]);router['get']('/:id',auth[_0xc549('0x9')](),controller[_0xc549('0xa')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xc549('0xb')]);router[_0xc549('0x7')](_0xc549('0xc'),auth['isAuthenticated'](),controller[_0xc549('0xd')]);router['get']('/:id/descriptions',auth[_0xc549('0x9')](),controller[_0xc549('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc549('0xf')](_0xc549('0x10'),auth['isAuthenticated'](),controller[_0xc549('0x11')]);router['delete'](_0xc549('0x10'),auth[_0xc549('0x9')](),controller[_0xc549('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index e460efa..8133f3b 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 _0x9233=['exports','STRING'];(function(_0x390e6c,_0x4d7d42){var _0x596b05=function(_0xe6d4aa){while(--_0xe6d4aa){_0x390e6c['push'](_0x390e6c['shift']());}};_0x596b05(++_0x4d7d42);}(_0x9233,0xfe));var _0x3923=function(_0x1780b4,_0x16801c){_0x1780b4=_0x1780b4-0x0;var _0x199010=_0x9233[_0x1780b4];return _0x199010;};'use strict';var Sequelize=require('sequelize');module[_0x3923('0x0')]={'name':{'type':Sequelize[_0x3923('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9b55=['sequelize','exports','STRING'];(function(_0x14154e,_0x8e1b31){var _0x60644f=function(_0x210b65){while(--_0x210b65){_0x14154e['push'](_0x14154e['shift']());}};_0x60644f(++_0x8e1b31);}(_0x9b55,0xe1));var _0x59b5=function(_0x39243a,_0x2921a8){_0x39243a=_0x39243a-0x0;var _0x2ab899=_0x9b55[_0x39243a];return _0x2ab899;};'use strict';var Sequelize=require(_0x59b5('0x0'));module[_0x59b5('0x1')]={'name':{'type':Sequelize[_0x59b5('0x2')]},'description':{'type':Sequelize[_0x59b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index b43c409..96904e4 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 _0x88f4=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x88f4,0x17d));var _0x488f=function(_0x55bb53,_0x5590af){_0x55bb53=_0x55bb53-0x0;var _0x396e95=_0x88f4[_0x55bb53];return _0x396e95;};'use strict';var emlformat=require(_0x488f('0x0'));var rimraf=require(_0x488f('0x1'));var zipdir=require(_0x488f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x488f('0x3'));var moment=require(_0x488f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x488f('0x5'));var util=require('util');var path=require(_0x488f('0x6'));var sox=require('sox');var csv=require(_0x488f('0x7'));var ejs=require(_0x488f('0x8'));var fs=require('fs');var fs_extra=require(_0x488f('0x9'));var _=require(_0x488f('0xa'));var squel=require(_0x488f('0xb'));var crypto=require(_0x488f('0xc'));var jsforce=require(_0x488f('0xd'));var deskjs=require(_0x488f('0xe'));var toCsv=require(_0x488f('0x7'));var querystring=require(_0x488f('0xf'));var Papa=require(_0x488f('0x10'));var Redis=require(_0x488f('0x11'));var authService=require(_0x488f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x488f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x488f('0x14'))('api');var utils=require(_0x488f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x488f('0x16'));var db=require(_0x488f('0x17'))['db'];function respondWithStatusCode(_0x5cdbac,_0x57302c){_0x57302c=_0x57302c||0xcc;return function(_0x2dd8ca){if(_0x2dd8ca){return _0x5cdbac[_0x488f('0x18')](_0x57302c);}return _0x5cdbac[_0x488f('0x19')](_0x57302c)[_0x488f('0x1a')]();};}function respondWithResult(_0x4d45c8,_0x3b0251){_0x3b0251=_0x3b0251||0xc8;return function(_0x26c5ef){if(_0x26c5ef){return _0x4d45c8[_0x488f('0x19')](_0x3b0251)[_0x488f('0x1b')](_0x26c5ef);}};}function respondWithFilteredResult(_0xdb9a78,_0x53927f){return function(_0x4bf947){if(_0x4bf947){var _0x4e1484=typeof _0x53927f['offset']===_0x488f('0x1c')&&typeof _0x53927f[_0x488f('0x1d')]===_0x488f('0x1c');var _0xc96718=_0x4bf947[_0x488f('0x1e')];var _0x4904b8=_0x4e1484?0x0:_0x53927f[_0x488f('0x1f')];var _0x514060=_0x4e1484?_0x4bf947[_0x488f('0x1e')]:_0x53927f[_0x488f('0x1f')]+_0x53927f[_0x488f('0x1d')];var _0x5d167c;if(_0x514060>=_0xc96718){_0x514060=_0xc96718;_0x5d167c=0xc8;}else{_0x5d167c=0xce;}_0xdb9a78[_0x488f('0x19')](_0x5d167c);return _0xdb9a78[_0x488f('0x20')](_0x488f('0x21'),_0x4904b8+'-'+_0x514060+'/'+_0xc96718)[_0x488f('0x1b')](_0x4bf947);}return null;};}function patchUpdates(_0x4ab567){return function(_0x3e55ac){try{jsonpatch[_0x488f('0x22')](_0x3e55ac,_0x4ab567,!![]);}catch(_0x4da27a){return BPromise['reject'](_0x4da27a);}return _0x3e55ac['save']();};}function saveUpdates(_0x365072,_0x409840){return function(_0x5bf81b){if(_0x5bf81b){return _0x5bf81b[_0x488f('0x23')](_0x365072)[_0x488f('0x24')](function(_0x18f1b6){return _0x18f1b6;});}return null;};}function removeEntity(_0x14ff89,_0x21409b){return function(_0x4410f2){if(_0x4410f2){return _0x4410f2[_0x488f('0x25')]()[_0x488f('0x24')](function(){_0x14ff89[_0x488f('0x19')](0xcc)[_0x488f('0x1a')]();});}};}function handleEntityNotFound(_0x39a1a9,_0x30a1a2){return function(_0x10156e){if(!_0x10156e){_0x39a1a9['sendStatus'](0x194);}return _0x10156e;};}function handleError(_0x47c8d9,_0x248a2d){_0x248a2d=_0x248a2d||0x1f4;return function(_0x53cb1d){logger[_0x488f('0x26')](_0x53cb1d[_0x488f('0x27')]);if(_0x53cb1d[_0x488f('0x28')]){delete _0x53cb1d[_0x488f('0x28')];}_0x47c8d9[_0x488f('0x19')](_0x248a2d)[_0x488f('0x29')](_0x53cb1d);};}exports[_0x488f('0x2a')]=function(_0x10dfc2,_0x590f48){var _0x2266d3={},_0x577cc2={},_0x4b1075={'count':0x0,'rows':[]};var _0x45ce61=_[_0x488f('0x2b')](db['VtigerConfiguration']['rawAttributes'],function(_0x339ca3){return{'name':_0x339ca3[_0x488f('0x2c')],'type':_0x339ca3[_0x488f('0x2d')][_0x488f('0x2e')]};});_0x577cc2[_0x488f('0x2f')]=_[_0x488f('0x2b')](_0x45ce61,'name');_0x577cc2[_0x488f('0x30')]=_[_0x488f('0x31')](_0x10dfc2[_0x488f('0x30')]);_0x577cc2[_0x488f('0x32')]=_[_0x488f('0x33')](_0x577cc2[_0x488f('0x2f')],_0x577cc2[_0x488f('0x30')]);_0x2266d3[_0x488f('0x34')]=_['intersection'](_0x577cc2[_0x488f('0x2f')],qs[_0x488f('0x35')](_0x10dfc2[_0x488f('0x30')][_0x488f('0x35')]));_0x2266d3[_0x488f('0x34')]=_0x2266d3['attributes'][_0x488f('0x36')]?_0x2266d3['attributes']:_0x577cc2['model'];if(!_0x10dfc2[_0x488f('0x30')][_0x488f('0x37')](_0x488f('0x38'))){_0x2266d3[_0x488f('0x1d')]=qs[_0x488f('0x1d')](_0x10dfc2[_0x488f('0x30')][_0x488f('0x1d')]);_0x2266d3[_0x488f('0x1f')]=qs[_0x488f('0x1f')](_0x10dfc2[_0x488f('0x30')][_0x488f('0x1f')]);}_0x2266d3[_0x488f('0x39')]=qs[_0x488f('0x3a')](_0x10dfc2[_0x488f('0x30')][_0x488f('0x3a')]);_0x2266d3[_0x488f('0x3b')]=qs['filters'](_[_0x488f('0x3c')](_0x10dfc2[_0x488f('0x30')],_0x577cc2[_0x488f('0x32')]),_0x45ce61);if(_0x10dfc2['query'][_0x488f('0x3d')]){_0x2266d3['where']=_[_0x488f('0x3e')](_0x2266d3[_0x488f('0x3b')],{'$or':_['map'](_0x45ce61,function(_0x527064){if(_0x527064[_0x488f('0x2d')]!==_0x488f('0x3f')){var _0x1a3b0e={};_0x1a3b0e[_0x527064['name']]={'$like':'%'+_0x10dfc2[_0x488f('0x30')][_0x488f('0x3d')]+'%'};return _0x1a3b0e;}})});}_0x2266d3=_[_0x488f('0x3e')]({},_0x2266d3,_0x10dfc2[_0x488f('0x40')]);var _0x35e0b5={'where':_0x2266d3[_0x488f('0x3b')]};return db[_0x488f('0x41')][_0x488f('0x1e')](_0x35e0b5)[_0x488f('0x24')](function(_0x4d4f3d){_0x4b1075[_0x488f('0x1e')]=_0x4d4f3d;if(_0x10dfc2[_0x488f('0x30')][_0x488f('0x42')]){_0x2266d3['include']=[{'all':!![]}];}return db[_0x488f('0x41')][_0x488f('0x43')](_0x2266d3);})[_0x488f('0x24')](function(_0x317974){_0x4b1075[_0x488f('0x44')]=_0x317974;return _0x4b1075;})[_0x488f('0x24')](respondWithFilteredResult(_0x590f48,_0x2266d3))[_0x488f('0x45')](handleError(_0x590f48,null));};exports['show']=function(_0x43abc4,_0x4a2e46){var _0x5d32e1={'raw':![],'where':{'id':_0x43abc4[_0x488f('0x46')]['id']}},_0x4fffe3={};_0x4fffe3[_0x488f('0x2f')]=_['keys'](db[_0x488f('0x41')][_0x488f('0x47')]);_0x4fffe3[_0x488f('0x30')]=_[_0x488f('0x31')](_0x43abc4[_0x488f('0x30')]);_0x4fffe3['filters']=_[_0x488f('0x33')](_0x4fffe3[_0x488f('0x2f')],_0x4fffe3['query']);_0x5d32e1['attributes']=_[_0x488f('0x33')](_0x4fffe3[_0x488f('0x2f')],qs['fields'](_0x43abc4[_0x488f('0x30')][_0x488f('0x35')]));_0x5d32e1[_0x488f('0x34')]=_0x5d32e1[_0x488f('0x34')][_0x488f('0x36')]?_0x5d32e1[_0x488f('0x34')]:_0x4fffe3[_0x488f('0x2f')];if(_0x43abc4[_0x488f('0x30')][_0x488f('0x42')]){_0x5d32e1[_0x488f('0x48')]=[{'all':!![]}];}_0x5d32e1=_[_0x488f('0x3e')]({},_0x5d32e1,_0x43abc4['options']);return db[_0x488f('0x41')][_0x488f('0x49')](_0x5d32e1)['then'](handleEntityNotFound(_0x4a2e46,null))[_0x488f('0x24')](respondWithResult(_0x4a2e46,null))[_0x488f('0x45')](handleError(_0x4a2e46,null));};exports[_0x488f('0x4a')]=function(_0x1aef1a,_0x4c9f6e){return db['VtigerConfiguration'][_0x488f('0x4a')](_0x1aef1a['body'],{})[_0x488f('0x24')](respondWithResult(_0x4c9f6e,0xc9))['catch'](handleError(_0x4c9f6e,null));};exports[_0x488f('0x23')]=function(_0x3c40b0,_0x33dd5b){if(_0x3c40b0['body']['id']){delete _0x3c40b0[_0x488f('0x4b')]['id'];}return db[_0x488f('0x41')][_0x488f('0x49')]({'where':{'id':_0x3c40b0['params']['id']}})[_0x488f('0x24')](handleEntityNotFound(_0x33dd5b,null))[_0x488f('0x24')](saveUpdates(_0x3c40b0['body'],null))['then'](respondWithResult(_0x33dd5b,null))[_0x488f('0x45')](handleError(_0x33dd5b,null));};exports[_0x488f('0x25')]=function(_0x6f52d0,_0x1515e9){return db[_0x488f('0x41')]['find']({'where':{'id':_0x6f52d0[_0x488f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1515e9,null))[_0x488f('0x24')](removeEntity(_0x1515e9,null))[_0x488f('0x45')](handleError(_0x1515e9,null));};exports[_0x488f('0x4c')]=function(_0x4fba60,_0x4bd8eb,_0xff4837){var _0x5af1f3={};var _0x487d0d={};var _0x164f6a;var _0x18e13d;return db[_0x488f('0x41')]['findOne']({'where':{'id':_0x4fba60[_0x488f('0x46')]['id']}})[_0x488f('0x24')](handleEntityNotFound(_0x4bd8eb,null))[_0x488f('0x24')](function(_0x31504c){if(_0x31504c){_0x164f6a=_0x31504c;_0x487d0d[_0x488f('0x2f')]=_['keys'](db[_0x488f('0x4d')]['rawAttributes']);_0x487d0d[_0x488f('0x30')]=_[_0x488f('0x31')](_0x4fba60['query']);_0x487d0d['filters']=_['intersection'](_0x487d0d['model'],_0x487d0d[_0x488f('0x30')]);_0x5af1f3[_0x488f('0x34')]=_[_0x488f('0x33')](_0x487d0d[_0x488f('0x2f')],qs[_0x488f('0x35')](_0x4fba60['query'][_0x488f('0x35')]));_0x5af1f3[_0x488f('0x34')]=_0x5af1f3['attributes'][_0x488f('0x36')]?_0x5af1f3[_0x488f('0x34')]:_0x487d0d[_0x488f('0x2f')];_0x5af1f3[_0x488f('0x39')]=qs['sort'](_0x4fba60[_0x488f('0x30')][_0x488f('0x3a')]);_0x5af1f3['where']=qs['filters'](_[_0x488f('0x3c')](_0x4fba60[_0x488f('0x30')],_0x487d0d[_0x488f('0x32')]));if(_0x4fba60[_0x488f('0x30')][_0x488f('0x3d')]){_0x5af1f3['where']=_[_0x488f('0x3e')](_0x5af1f3[_0x488f('0x3b')],{'$or':_['map'](_0x5af1f3[_0x488f('0x34')],function(_0x2e9a5f){var _0xdb1d15={};_0xdb1d15[_0x2e9a5f]={'$like':'%'+_0x4fba60[_0x488f('0x30')][_0x488f('0x3d')]+'%'};return _0xdb1d15;})});}_0x5af1f3=_['merge']({},_0x5af1f3,_0x4fba60['options']);return _0x164f6a[_0x488f('0x4c')](_0x5af1f3);}})[_0x488f('0x24')](function(_0xcaf622){if(_0xcaf622){_0x18e13d=_0xcaf622[_0x488f('0x36')];if(!_0x4fba60['query']['hasOwnProperty'](_0x488f('0x38'))){_0x5af1f3[_0x488f('0x1d')]=qs[_0x488f('0x1d')](_0x4fba60[_0x488f('0x30')][_0x488f('0x1d')]);_0x5af1f3[_0x488f('0x1f')]=qs['offset'](_0x4fba60[_0x488f('0x30')][_0x488f('0x1f')]);}return _0x164f6a[_0x488f('0x4c')](_0x5af1f3);}})[_0x488f('0x24')](function(_0x3df063){if(_0x3df063){return _0x3df063?{'count':_0x18e13d,'rows':_0x3df063}:null;}})[_0x488f('0x24')](respondWithResult(_0x4bd8eb,null))[_0x488f('0x45')](handleError(_0x4bd8eb,null));};exports[_0x488f('0x4e')]=function(_0x14972d,_0x20f82d,_0x530bfb){var _0x146028={};var _0x40c04a={};var _0x1db665;var _0x33f761;return db['VtigerConfiguration'][_0x488f('0x4f')]({'where':{'id':_0x14972d[_0x488f('0x46')]['id']}})[_0x488f('0x24')](handleEntityNotFound(_0x20f82d,null))[_0x488f('0x24')](function(_0x1abde2){if(_0x1abde2){_0x1db665=_0x1abde2;_0x40c04a[_0x488f('0x2f')]=_[_0x488f('0x31')](db[_0x488f('0x4d')][_0x488f('0x47')]);_0x40c04a[_0x488f('0x30')]=_['keys'](_0x14972d[_0x488f('0x30')]);_0x40c04a[_0x488f('0x32')]=_[_0x488f('0x33')](_0x40c04a['model'],_0x40c04a['query']);_0x146028[_0x488f('0x34')]=_['intersection'](_0x40c04a[_0x488f('0x2f')],qs[_0x488f('0x35')](_0x14972d[_0x488f('0x30')][_0x488f('0x35')]));_0x146028['attributes']=_0x146028[_0x488f('0x34')][_0x488f('0x36')]?_0x146028[_0x488f('0x34')]:_0x40c04a[_0x488f('0x2f')];_0x146028[_0x488f('0x39')]=qs[_0x488f('0x3a')](_0x14972d[_0x488f('0x30')][_0x488f('0x3a')]);_0x146028[_0x488f('0x3b')]=qs[_0x488f('0x32')](_[_0x488f('0x3c')](_0x14972d[_0x488f('0x30')],_0x40c04a[_0x488f('0x32')]));if(_0x14972d[_0x488f('0x30')]['filter']){_0x146028[_0x488f('0x3b')]=_[_0x488f('0x3e')](_0x146028['where'],{'$or':_[_0x488f('0x2b')](_0x146028[_0x488f('0x34')],function(_0x175221){var _0x2405da={};_0x2405da[_0x175221]={'$like':'%'+_0x14972d[_0x488f('0x30')][_0x488f('0x3d')]+'%'};return _0x2405da;})});}_0x146028=_[_0x488f('0x3e')]({},_0x146028,_0x14972d[_0x488f('0x40')]);return _0x1db665['getSubjects'](_0x146028);}})[_0x488f('0x24')](function(_0x55b57c){if(_0x55b57c){_0x33f761=_0x55b57c[_0x488f('0x36')];if(!_0x14972d[_0x488f('0x30')][_0x488f('0x37')](_0x488f('0x38'))){_0x146028['limit']=qs[_0x488f('0x1d')](_0x14972d['query']['limit']);_0x146028[_0x488f('0x1f')]=qs[_0x488f('0x1f')](_0x14972d[_0x488f('0x30')][_0x488f('0x1f')]);}return _0x1db665[_0x488f('0x4e')](_0x146028);}})[_0x488f('0x24')](function(_0x23959b){if(_0x23959b){return _0x23959b?{'count':_0x33f761,'rows':_0x23959b}:null;}})[_0x488f('0x24')](respondWithResult(_0x20f82d,null))[_0x488f('0x45')](handleError(_0x20f82d,null));};exports[_0x488f('0x50')]=function(_0xe9d289,_0x44425b,_0x4a76eb){var _0x1e1bb3={};var _0x5c7916={};var _0x42dff8;var _0x4d5821;return db['VtigerConfiguration']['findOne']({'where':{'id':_0xe9d289['params']['id']}})[_0x488f('0x24')](handleEntityNotFound(_0x44425b,null))[_0x488f('0x24')](function(_0x13eaa4){if(_0x13eaa4){_0x42dff8=_0x13eaa4;_0x5c7916['model']=_['keys'](db[_0x488f('0x4d')][_0x488f('0x47')]);_0x5c7916['query']=_[_0x488f('0x31')](_0xe9d289['query']);_0x5c7916[_0x488f('0x32')]=_[_0x488f('0x33')](_0x5c7916[_0x488f('0x2f')],_0x5c7916[_0x488f('0x30')]);_0x1e1bb3[_0x488f('0x34')]=_['intersection'](_0x5c7916['model'],qs['fields'](_0xe9d289[_0x488f('0x30')][_0x488f('0x35')]));_0x1e1bb3[_0x488f('0x34')]=_0x1e1bb3[_0x488f('0x34')]['length']?_0x1e1bb3[_0x488f('0x34')]:_0x5c7916[_0x488f('0x2f')];_0x1e1bb3[_0x488f('0x39')]=qs[_0x488f('0x3a')](_0xe9d289[_0x488f('0x30')][_0x488f('0x3a')]);_0x1e1bb3[_0x488f('0x3b')]=qs[_0x488f('0x32')](_[_0x488f('0x3c')](_0xe9d289[_0x488f('0x30')],_0x5c7916['filters']));if(_0xe9d289[_0x488f('0x30')][_0x488f('0x3d')]){_0x1e1bb3[_0x488f('0x3b')]=_[_0x488f('0x3e')](_0x1e1bb3['where'],{'$or':_[_0x488f('0x2b')](_0x1e1bb3[_0x488f('0x34')],function(_0x29bdd8){var _0x3873a5={};_0x3873a5[_0x29bdd8]={'$like':'%'+_0xe9d289[_0x488f('0x30')][_0x488f('0x3d')]+'%'};return _0x3873a5;})});}_0x1e1bb3=_['merge']({},_0x1e1bb3,_0xe9d289['options']);return _0x42dff8[_0x488f('0x50')](_0x1e1bb3);}})[_0x488f('0x24')](function(_0x4d70e7){if(_0x4d70e7){_0x4d5821=_0x4d70e7[_0x488f('0x36')];if(!_0xe9d289[_0x488f('0x30')][_0x488f('0x37')](_0x488f('0x38'))){_0x1e1bb3['limit']=qs[_0x488f('0x1d')](_0xe9d289['query'][_0x488f('0x1d')]);_0x1e1bb3['offset']=qs['offset'](_0xe9d289['query'][_0x488f('0x1f')]);}return _0x42dff8['getDescriptions'](_0x1e1bb3);}})[_0x488f('0x24')](function(_0x5db579){if(_0x5db579){return _0x5db579?{'count':_0x4d5821,'rows':_0x5db579}:null;}})['then'](respondWithResult(_0x44425b,null))['catch'](handleError(_0x44425b,null));}; \ No newline at end of file +var _0xb2be=['sort','where','pick','filters','filter','merge','VIRTUAL','count','rows','catch','show','params','length','includeAll','include','options','find','create','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','set','apply','reject','save','update','then','end','error','stack','name','index','VtigerConfiguration','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xb2be,0xb2));var _0xeb2b=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0xb2be[_0x5418ad];return _0x2cae56;};'use strict';var emlformat=require(_0xeb2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb2b('0x1'));var jsonpatch=require(_0xeb2b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb2b('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeb2b('0x4'));var sox=require(_0xeb2b('0x5'));var csv=require(_0xeb2b('0x6'));var ejs=require(_0xeb2b('0x7'));var fs=require('fs');var fs_extra=require(_0xeb2b('0x8'));var _=require(_0xeb2b('0x9'));var squel=require('squel');var crypto=require(_0xeb2b('0xa'));var jsforce=require(_0xeb2b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeb2b('0x6'));var querystring=require(_0xeb2b('0xc'));var Papa=require(_0xeb2b('0xd'));var Redis=require(_0xeb2b('0xe'));var authService=require(_0xeb2b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeb2b('0x10'));var hardwareService=require(_0xeb2b('0x11'));var logger=require(_0xeb2b('0x12'))(_0xeb2b('0x13'));var utils=require(_0xeb2b('0x14'));var config=require(_0xeb2b('0x15'));var licenseUtil=require(_0xeb2b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c7bf6,_0xc22752){_0xc22752=_0xc22752||0xcc;return function(_0x4490fd){if(_0x4490fd){return _0x5c7bf6[_0xeb2b('0x17')](_0xc22752);}return _0x5c7bf6['status'](_0xc22752)['end']();};}function respondWithResult(_0xc943b4,_0x21fbe9){_0x21fbe9=_0x21fbe9||0xc8;return function(_0x4bc4ea){if(_0x4bc4ea){return _0xc943b4[_0xeb2b('0x18')](_0x21fbe9)[_0xeb2b('0x19')](_0x4bc4ea);}};}function respondWithFilteredResult(_0xe4a36d,_0x121641){return function(_0x20b9e9){if(_0x20b9e9){var _0x3e2ea1=typeof _0x121641[_0xeb2b('0x1a')]==='undefined'&&typeof _0x121641[_0xeb2b('0x1b')]===_0xeb2b('0x1c');var _0x4e2a26=_0x20b9e9['count'];var _0x8b7abd=_0x3e2ea1?0x0:_0x121641[_0xeb2b('0x1a')];var _0x19e47f=_0x3e2ea1?_0x20b9e9['count']:_0x121641[_0xeb2b('0x1a')]+_0x121641[_0xeb2b('0x1b')];var _0x2523ea;if(_0x19e47f>=_0x4e2a26){_0x19e47f=_0x4e2a26;_0x2523ea=0xc8;}else{_0x2523ea=0xce;}_0xe4a36d[_0xeb2b('0x18')](_0x2523ea);return _0xe4a36d[_0xeb2b('0x1d')]('Content-Range',_0x8b7abd+'-'+_0x19e47f+'/'+_0x4e2a26)['json'](_0x20b9e9);}return null;};}function patchUpdates(_0x122148){return function(_0x6dbdb4){try{jsonpatch[_0xeb2b('0x1e')](_0x6dbdb4,_0x122148,!![]);}catch(_0x5b8c70){return BPromise[_0xeb2b('0x1f')](_0x5b8c70);}return _0x6dbdb4[_0xeb2b('0x20')]();};}function saveUpdates(_0x4d0851,_0x55aa9c){return function(_0x2309d9){if(_0x2309d9){return _0x2309d9[_0xeb2b('0x21')](_0x4d0851)[_0xeb2b('0x22')](function(_0x2099f3){return _0x2099f3;});}return null;};}function removeEntity(_0x413a77,_0x5c95de){return function(_0x3e76ed){if(_0x3e76ed){return _0x3e76ed['destroy']()[_0xeb2b('0x22')](function(){_0x413a77[_0xeb2b('0x18')](0xcc)[_0xeb2b('0x23')]();});}};}function handleEntityNotFound(_0x44f273,_0x4ade1d){return function(_0x1b203c){if(!_0x1b203c){_0x44f273[_0xeb2b('0x17')](0x194);}return _0x1b203c;};}function handleError(_0x5c60e4,_0x5542d2){_0x5542d2=_0x5542d2||0x1f4;return function(_0x2f898e){logger[_0xeb2b('0x24')](_0x2f898e[_0xeb2b('0x25')]);if(_0x2f898e[_0xeb2b('0x26')]){delete _0x2f898e[_0xeb2b('0x26')];}_0x5c60e4[_0xeb2b('0x18')](_0x5542d2)['send'](_0x2f898e);};}exports[_0xeb2b('0x27')]=function(_0x1401f4,_0xe6fb7f){var _0x1ea5c7={},_0x15f002={},_0x16cd11={'count':0x0,'rows':[]};var _0x233011=_['map'](db[_0xeb2b('0x28')][_0xeb2b('0x29')],function(_0xec442e){return{'name':_0xec442e['fieldName'],'type':_0xec442e[_0xeb2b('0x2a')]['key']};});_0x15f002[_0xeb2b('0x2b')]=_[_0xeb2b('0x2c')](_0x233011,'name');_0x15f002[_0xeb2b('0x2d')]=_[_0xeb2b('0x2e')](_0x1401f4[_0xeb2b('0x2d')]);_0x15f002['filters']=_[_0xeb2b('0x2f')](_0x15f002[_0xeb2b('0x2b')],_0x15f002[_0xeb2b('0x2d')]);_0x1ea5c7[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x15f002[_0xeb2b('0x2b')],qs[_0xeb2b('0x31')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x31')]));_0x1ea5c7[_0xeb2b('0x30')]=_0x1ea5c7[_0xeb2b('0x30')]['length']?_0x1ea5c7['attributes']:_0x15f002[_0xeb2b('0x2b')];if(!_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x32')](_0xeb2b('0x33'))){_0x1ea5c7['limit']=qs[_0xeb2b('0x1b')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x1ea5c7['offset']=qs[_0xeb2b('0x1a')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x1a')]);}_0x1ea5c7[_0xeb2b('0x34')]=qs[_0xeb2b('0x35')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x35')]);_0x1ea5c7[_0xeb2b('0x36')]=qs['filters'](_[_0xeb2b('0x37')](_0x1401f4[_0xeb2b('0x2d')],_0x15f002[_0xeb2b('0x38')]),_0x233011);if(_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x39')]){_0x1ea5c7[_0xeb2b('0x36')]=_[_0xeb2b('0x3a')](_0x1ea5c7['where'],{'$or':_[_0xeb2b('0x2c')](_0x233011,function(_0x2a3466){if(_0x2a3466[_0xeb2b('0x2a')]!==_0xeb2b('0x3b')){var _0x4ac3d2={};_0x4ac3d2[_0x2a3466[_0xeb2b('0x26')]]={'$like':'%'+_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x39')]+'%'};return _0x4ac3d2;}})});}_0x1ea5c7=_[_0xeb2b('0x3a')]({},_0x1ea5c7,_0x1401f4['options']);var _0x1de67c={'where':_0x1ea5c7[_0xeb2b('0x36')]};return db['VtigerConfiguration'][_0xeb2b('0x3c')](_0x1de67c)['then'](function(_0x3012de){_0x16cd11[_0xeb2b('0x3c')]=_0x3012de;if(_0x1401f4[_0xeb2b('0x2d')]['includeAll']){_0x1ea5c7['include']=[{'all':!![]}];}return db[_0xeb2b('0x28')]['findAll'](_0x1ea5c7);})[_0xeb2b('0x22')](function(_0x31f8cb){_0x16cd11[_0xeb2b('0x3d')]=_0x31f8cb;return _0x16cd11;})[_0xeb2b('0x22')](respondWithFilteredResult(_0xe6fb7f,_0x1ea5c7))[_0xeb2b('0x3e')](handleError(_0xe6fb7f,null));};exports[_0xeb2b('0x3f')]=function(_0xee6223,_0x554623){var _0x61257={'raw':![],'where':{'id':_0xee6223[_0xeb2b('0x40')]['id']}},_0x310af8={};_0x310af8[_0xeb2b('0x2b')]=_[_0xeb2b('0x2e')](db['VtigerConfiguration'][_0xeb2b('0x29')]);_0x310af8[_0xeb2b('0x2d')]=_['keys'](_0xee6223['query']);_0x310af8['filters']=_[_0xeb2b('0x2f')](_0x310af8[_0xeb2b('0x2b')],_0x310af8[_0xeb2b('0x2d')]);_0x61257[_0xeb2b('0x30')]=_['intersection'](_0x310af8['model'],qs[_0xeb2b('0x31')](_0xee6223[_0xeb2b('0x2d')][_0xeb2b('0x31')]));_0x61257[_0xeb2b('0x30')]=_0x61257['attributes'][_0xeb2b('0x41')]?_0x61257['attributes']:_0x310af8[_0xeb2b('0x2b')];if(_0xee6223[_0xeb2b('0x2d')][_0xeb2b('0x42')]){_0x61257[_0xeb2b('0x43')]=[{'all':!![]}];}_0x61257=_[_0xeb2b('0x3a')]({},_0x61257,_0xee6223[_0xeb2b('0x44')]);return db[_0xeb2b('0x28')][_0xeb2b('0x45')](_0x61257)['then'](handleEntityNotFound(_0x554623,null))['then'](respondWithResult(_0x554623,null))[_0xeb2b('0x3e')](handleError(_0x554623,null));};exports[_0xeb2b('0x46')]=function(_0x1ce200,_0x5ba9ab){return db[_0xeb2b('0x28')]['create'](_0x1ce200['body'],{})[_0xeb2b('0x22')](respondWithResult(_0x5ba9ab,0xc9))[_0xeb2b('0x3e')](handleError(_0x5ba9ab,null));};exports[_0xeb2b('0x21')]=function(_0x52bbe9,_0x48b0e0){if(_0x52bbe9['body']['id']){delete _0x52bbe9['body']['id'];}return db[_0xeb2b('0x28')][_0xeb2b('0x45')]({'where':{'id':_0x52bbe9['params']['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x48b0e0,null))[_0xeb2b('0x22')](saveUpdates(_0x52bbe9['body'],null))[_0xeb2b('0x22')](respondWithResult(_0x48b0e0,null))[_0xeb2b('0x3e')](handleError(_0x48b0e0,null));};exports[_0xeb2b('0x47')]=function(_0x2473fe,_0x1485f8){return db[_0xeb2b('0x28')][_0xeb2b('0x45')]({'where':{'id':_0x2473fe[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x1485f8,null))[_0xeb2b('0x22')](removeEntity(_0x1485f8,null))['catch'](handleError(_0x1485f8,null));};exports[_0xeb2b('0x48')]=function(_0xee04d1,_0x1bbcdb,_0x88fece){var _0x519808={};var _0x441eee={};var _0x4c4720;var _0x2a102b;return db[_0xeb2b('0x28')][_0xeb2b('0x49')]({'where':{'id':_0xee04d1[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x1bbcdb,null))[_0xeb2b('0x22')](function(_0x27d08c){if(_0x27d08c){_0x4c4720=_0x27d08c;_0x441eee[_0xeb2b('0x2b')]=_['keys'](db['VtigerField'][_0xeb2b('0x29')]);_0x441eee[_0xeb2b('0x2d')]=_[_0xeb2b('0x2e')](_0xee04d1['query']);_0x441eee['filters']=_[_0xeb2b('0x2f')](_0x441eee[_0xeb2b('0x2b')],_0x441eee[_0xeb2b('0x2d')]);_0x519808[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x441eee['model'],qs[_0xeb2b('0x31')](_0xee04d1['query'][_0xeb2b('0x31')]));_0x519808[_0xeb2b('0x30')]=_0x519808[_0xeb2b('0x30')][_0xeb2b('0x41')]?_0x519808[_0xeb2b('0x30')]:_0x441eee[_0xeb2b('0x2b')];_0x519808[_0xeb2b('0x34')]=qs[_0xeb2b('0x35')](_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x35')]);_0x519808[_0xeb2b('0x36')]=qs[_0xeb2b('0x38')](_[_0xeb2b('0x37')](_0xee04d1[_0xeb2b('0x2d')],_0x441eee[_0xeb2b('0x38')]));if(_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x39')]){_0x519808['where']=_['merge'](_0x519808['where'],{'$or':_['map'](_0x519808[_0xeb2b('0x30')],function(_0x31dea4){var _0xde935e={};_0xde935e[_0x31dea4]={'$like':'%'+_0xee04d1['query'][_0xeb2b('0x39')]+'%'};return _0xde935e;})});}_0x519808=_['merge']({},_0x519808,_0xee04d1[_0xeb2b('0x44')]);return _0x4c4720[_0xeb2b('0x48')](_0x519808);}})[_0xeb2b('0x22')](function(_0x1fbc7f){if(_0x1fbc7f){_0x2a102b=_0x1fbc7f[_0xeb2b('0x41')];if(!_0xee04d1['query']['hasOwnProperty'](_0xeb2b('0x33'))){_0x519808[_0xeb2b('0x1b')]=qs['limit'](_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x519808[_0xeb2b('0x1a')]=qs[_0xeb2b('0x1a')](_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x1a')]);}return _0x4c4720[_0xeb2b('0x48')](_0x519808);}})[_0xeb2b('0x22')](function(_0x4e5253){if(_0x4e5253){return _0x4e5253?{'count':_0x2a102b,'rows':_0x4e5253}:null;}})[_0xeb2b('0x22')](respondWithResult(_0x1bbcdb,null))[_0xeb2b('0x3e')](handleError(_0x1bbcdb,null));};exports['getSubjects']=function(_0x30671c,_0x9aa498,_0x2e0197){var _0x32c598={};var _0x5386b2={};var _0x6b42a2;var _0x36807d;return db[_0xeb2b('0x28')][_0xeb2b('0x49')]({'where':{'id':_0x30671c[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x9aa498,null))[_0xeb2b('0x22')](function(_0x3f161d){if(_0x3f161d){_0x6b42a2=_0x3f161d;_0x5386b2[_0xeb2b('0x2b')]=_['keys'](db[_0xeb2b('0x4a')]['rawAttributes']);_0x5386b2['query']=_['keys'](_0x30671c[_0xeb2b('0x2d')]);_0x5386b2[_0xeb2b('0x38')]=_[_0xeb2b('0x2f')](_0x5386b2['model'],_0x5386b2[_0xeb2b('0x2d')]);_0x32c598[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x5386b2[_0xeb2b('0x2b')],qs[_0xeb2b('0x31')](_0x30671c['query'][_0xeb2b('0x31')]));_0x32c598['attributes']=_0x32c598[_0xeb2b('0x30')][_0xeb2b('0x41')]?_0x32c598['attributes']:_0x5386b2[_0xeb2b('0x2b')];_0x32c598[_0xeb2b('0x34')]=qs[_0xeb2b('0x35')](_0x30671c[_0xeb2b('0x2d')]['sort']);_0x32c598['where']=qs[_0xeb2b('0x38')](_[_0xeb2b('0x37')](_0x30671c[_0xeb2b('0x2d')],_0x5386b2[_0xeb2b('0x38')]));if(_0x30671c[_0xeb2b('0x2d')]['filter']){_0x32c598[_0xeb2b('0x36')]=_[_0xeb2b('0x3a')](_0x32c598['where'],{'$or':_[_0xeb2b('0x2c')](_0x32c598[_0xeb2b('0x30')],function(_0x4924f6){var _0x48389b={};_0x48389b[_0x4924f6]={'$like':'%'+_0x30671c[_0xeb2b('0x2d')][_0xeb2b('0x39')]+'%'};return _0x48389b;})});}_0x32c598=_[_0xeb2b('0x3a')]({},_0x32c598,_0x30671c['options']);return _0x6b42a2[_0xeb2b('0x4b')](_0x32c598);}})[_0xeb2b('0x22')](function(_0x3ce276){if(_0x3ce276){_0x36807d=_0x3ce276[_0xeb2b('0x41')];if(!_0x30671c['query']['hasOwnProperty']('nolimit')){_0x32c598[_0xeb2b('0x1b')]=qs['limit'](_0x30671c[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x32c598[_0xeb2b('0x1a')]=qs[_0xeb2b('0x1a')](_0x30671c[_0xeb2b('0x2d')]['offset']);}return _0x6b42a2[_0xeb2b('0x4b')](_0x32c598);}})[_0xeb2b('0x22')](function(_0x21a6a3){if(_0x21a6a3){return _0x21a6a3?{'count':_0x36807d,'rows':_0x21a6a3}:null;}})['then'](respondWithResult(_0x9aa498,null))[_0xeb2b('0x3e')](handleError(_0x9aa498,null));};exports[_0xeb2b('0x4c')]=function(_0x5b30a1,_0x5ec338,_0x32a595){var _0x2e335e={};var _0x20c396={};var _0x266a26;var _0x3a6f5d;return db['VtigerConfiguration'][_0xeb2b('0x49')]({'where':{'id':_0x5b30a1[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x5ec338,null))[_0xeb2b('0x22')](function(_0x10da8c){if(_0x10da8c){_0x266a26=_0x10da8c;_0x20c396[_0xeb2b('0x2b')]=_['keys'](db[_0xeb2b('0x4a')]['rawAttributes']);_0x20c396[_0xeb2b('0x2d')]=_[_0xeb2b('0x2e')](_0x5b30a1['query']);_0x20c396[_0xeb2b('0x38')]=_[_0xeb2b('0x2f')](_0x20c396[_0xeb2b('0x2b')],_0x20c396[_0xeb2b('0x2d')]);_0x2e335e[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x20c396['model'],qs[_0xeb2b('0x31')](_0x5b30a1[_0xeb2b('0x2d')]['fields']));_0x2e335e[_0xeb2b('0x30')]=_0x2e335e[_0xeb2b('0x30')][_0xeb2b('0x41')]?_0x2e335e['attributes']:_0x20c396[_0xeb2b('0x2b')];_0x2e335e['order']=qs['sort'](_0x5b30a1[_0xeb2b('0x2d')][_0xeb2b('0x35')]);_0x2e335e[_0xeb2b('0x36')]=qs[_0xeb2b('0x38')](_['pick'](_0x5b30a1['query'],_0x20c396[_0xeb2b('0x38')]));if(_0x5b30a1['query'][_0xeb2b('0x39')]){_0x2e335e['where']=_[_0xeb2b('0x3a')](_0x2e335e[_0xeb2b('0x36')],{'$or':_['map'](_0x2e335e[_0xeb2b('0x30')],function(_0x468c59){var _0x363044={};_0x363044[_0x468c59]={'$like':'%'+_0x5b30a1[_0xeb2b('0x2d')]['filter']+'%'};return _0x363044;})});}_0x2e335e=_[_0xeb2b('0x3a')]({},_0x2e335e,_0x5b30a1[_0xeb2b('0x44')]);return _0x266a26[_0xeb2b('0x4c')](_0x2e335e);}})[_0xeb2b('0x22')](function(_0x4bb3aa){if(_0x4bb3aa){_0x3a6f5d=_0x4bb3aa[_0xeb2b('0x41')];if(!_0x5b30a1[_0xeb2b('0x2d')]['hasOwnProperty']('nolimit')){_0x2e335e[_0xeb2b('0x1b')]=qs['limit'](_0x5b30a1[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x2e335e[_0xeb2b('0x1a')]=qs[_0xeb2b('0x1a')](_0x5b30a1[_0xeb2b('0x2d')][_0xeb2b('0x1a')]);}return _0x266a26[_0xeb2b('0x4c')](_0x2e335e);}})['then'](function(_0x3a518a){if(_0x3a518a){return _0x3a518a?{'count':_0x3a6f5d,'rows':_0x3a518a}:null;}})[_0xeb2b('0x22')](respondWithResult(_0x5ec338,null))[_0xeb2b('0x3e')](handleError(_0x5ec338,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 5464736..33dd8ae 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 _0x1113=['util','../../config/logger','api','moment','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','lodash'];(function(_0x50524a,_0xa70a2b){var _0x1c0832=function(_0x1ed1e2){while(--_0x1ed1e2){_0x50524a['push'](_0x50524a['shift']());}};_0x1c0832(++_0xa70a2b);}(_0x1113,0x18b));var _0x3111=function(_0xe593fe,_0x587956){_0xe593fe=_0xe593fe-0x0;var _0x49fe42=_0x1113[_0xe593fe];return _0x49fe42;};'use strict';var _=require(_0x3111('0x0'));var util=require(_0x3111('0x1'));var logger=require(_0x3111('0x2'))(_0x3111('0x3'));var moment=require(_0x3111('0x4'));var BPromise=require('bluebird');var rp=require(_0x3111('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3111('0x6'));var attributes=require(_0x3111('0x7'));module[_0x3111('0x8')]=function(_0x336486,_0x4c7fba){return _0x336486['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd01=['api','moment','bluebird','request-promise','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x41467a,_0x5e511f){var _0x5652b9=function(_0x9c1ba3){while(--_0x9c1ba3){_0x41467a['push'](_0x41467a['shift']());}};_0x5652b9(++_0x5e511f);}(_0xdd01,0x15a));var _0x1dd0=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xdd01[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require('lodash');var util=require(_0x1dd0('0x0'));var logger=require(_0x1dd0('0x1'))(_0x1dd0('0x2'));var moment=require(_0x1dd0('0x3'));var BPromise=require(_0x1dd0('0x4'));var rp=require(_0x1dd0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dd0('0x6'));var config=require('../../config/environment');var attributes=require(_0x1dd0('0x7'));module[_0x1dd0('0x8')]=function(_0x4f378c,_0x1e6d14){return _0x4f378c[_0x1dd0('0x9')](_0x1dd0('0xa'),attributes,{'tableName':_0x1dd0('0xb'),'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 3afb89f..6789e8d 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 _0x1201=['then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x515257,_0x32b906){var _0x2f5801=function(_0x30e985){while(--_0x30e985){_0x515257['push'](_0x515257['shift']());}};_0x2f5801(++_0x32b906);}(_0x1201,0x12b));var _0x1120=function(_0x1fc7b5,_0x5d4779){_0x1fc7b5=_0x1fc7b5-0x0;var _0x3ef5db=_0x1201[_0x1fc7b5];return _0x3ef5db;};'use strict';var _=require(_0x1120('0x0'));var util=require(_0x1120('0x1'));var moment=require(_0x1120('0x2'));var BPromise=require(_0x1120('0x3'));var rs=require(_0x1120('0x4'));var fs=require('fs');var Redis=require(_0x1120('0x5'));var db=require(_0x1120('0x6'))['db'];var utils=require(_0x1120('0x7'));var logger=require(_0x1120('0x8'))(_0x1120('0x9'));var config=require('../../config/environment');var jayson=require(_0x1120('0xa'));var client=jayson['client'][_0x1120('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1af3e9,_0x1d6394,_0x47658f){return new BPromise(function(_0x9cad51,_0x394e7e){return client[_0x1120('0xc')](_0x1af3e9,_0x47658f)[_0x1120('0xd')](function(_0x52184a){logger[_0x1120('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d6394,_0x1120('0xf'));logger[_0x1120('0x10')](_0x1120('0x11'),_0x1d6394,_0x1120('0xf'),JSON[_0x1120('0x12')](_0x52184a));if(_0x52184a['error']){if(_0x52184a[_0x1120('0x13')][_0x1120('0x14')]===0x1f4){logger[_0x1120('0x13')](_0x1120('0x15'),_0x1d6394,_0x52184a[_0x1120('0x13')]['message']);return _0x394e7e(_0x52184a[_0x1120('0x13')]['message']);}logger[_0x1120('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d6394,_0x52184a[_0x1120('0x13')][_0x1120('0x16')]);return _0x9cad51(_0x52184a[_0x1120('0x13')][_0x1120('0x16')]);}else{logger['info'](_0x1120('0x15'),_0x1d6394,'request\x20sent');_0x9cad51(_0x52184a[_0x1120('0x17')]['message']);}})['catch'](function(_0x31e9ea){logger[_0x1120('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d6394,_0x31e9ea);_0x394e7e(_0x31e9ea);});});} \ No newline at end of file +var _0xfe06=['stringify','error','code','message','catch','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe06,0x155));var _0x6fe0=function(_0x52fc5f,_0x1d36ed){_0x52fc5f=_0x52fc5f-0x0;var _0x51cce0=_0xfe06[_0x52fc5f];return _0x51cce0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6fe0('0x0'));var rs=require(_0x6fe0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6fe0('0x2'));var logger=require(_0x6fe0('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6fe0('0x4'));var client=jayson[_0x6fe0('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4266fa,_0x34643f,_0x3ab9e9){return new BPromise(function(_0x3395f8,_0x2f0da3){return client[_0x6fe0('0x6')](_0x4266fa,_0x3ab9e9)['then'](function(_0x1bb192){logger[_0x6fe0('0x7')](_0x6fe0('0x8'),_0x34643f,_0x6fe0('0x9'));logger[_0x6fe0('0xa')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x34643f,_0x6fe0('0x9'),JSON[_0x6fe0('0xb')](_0x1bb192));if(_0x1bb192['error']){if(_0x1bb192[_0x6fe0('0xc')][_0x6fe0('0xd')]===0x1f4){logger[_0x6fe0('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x34643f,_0x1bb192[_0x6fe0('0xc')]['message']);return _0x2f0da3(_0x1bb192[_0x6fe0('0xc')][_0x6fe0('0xe')]);}logger['error'](_0x6fe0('0x8'),_0x34643f,_0x1bb192['error'][_0x6fe0('0xe')]);return _0x3395f8(_0x1bb192['error'][_0x6fe0('0xe')]);}else{logger[_0x6fe0('0x7')](_0x6fe0('0x8'),_0x34643f,_0x6fe0('0x9'));_0x3395f8(_0x1bb192['result'][_0x6fe0('0xe')]);}})[_0x6fe0('0xf')](function(_0x1eefdb){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x34643f,_0x1eefdb);_0x2f0da3(_0x1eefdb);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a011ba4..6366089 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 _0xc1da=['../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','create','put','multer','path','connect-timeout'];(function(_0x43bed9,_0x26adca){var _0x27b03d=function(_0x5c47c9){while(--_0x5c47c9){_0x43bed9['push'](_0x43bed9['shift']());}};_0x27b03d(++_0x26adca);}(_0xc1da,0x89));var _0xac1d=function(_0x4f0bb5,_0xa62425){_0x4f0bb5=_0x4f0bb5-0x0;var _0x50ae00=_0xc1da[_0x4f0bb5];return _0x50ae00;};'use strict';var multer=require(_0xac1d('0x0'));var util=require('util');var path=require(_0xac1d('0x1'));var timeout=require(_0xac1d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac1d('0x3'));var config=require(_0xac1d('0x4'));var controller=require(_0xac1d('0x5'));router['get']('/',auth[_0xac1d('0x6')](),controller['index']);router['get'](_0xac1d('0x7'),auth[_0xac1d('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xac1d('0x8')]);router[_0xac1d('0x9')](_0xac1d('0x7'),auth[_0xac1d('0x6')](),controller['update']);router['delete']('/:id',auth[_0xac1d('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1ad2=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x1ad2,0x90));var _0x21ad=function(_0x40bb0f,_0x51fd57){_0x40bb0f=_0x40bb0f-0x0;var _0x2557a6=_0x1ad2[_0x40bb0f];return _0x2557a6;};'use strict';var multer=require(_0x21ad('0x0'));var util=require(_0x21ad('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x21ad('0x2'));var router=express[_0x21ad('0x3')]();var fs_extra=require(_0x21ad('0x4'));var auth=require(_0x21ad('0x5'));var interaction=require(_0x21ad('0x6'));var config=require('../../config/environment');var controller=require(_0x21ad('0x7'));router[_0x21ad('0x8')]('/',auth[_0x21ad('0x9')](),controller[_0x21ad('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x21ad('0xb')]);router[_0x21ad('0xc')]('/',auth[_0x21ad('0x9')](),controller[_0x21ad('0xd')]);router[_0x21ad('0xe')](_0x21ad('0xf'),auth[_0x21ad('0x9')](),controller['update']);router[_0x21ad('0x10')](_0x21ad('0xf'),auth['isAuthenticated'](),controller[_0x21ad('0x11')]);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 6139781..92ac65c 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 _0x79bb=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x47274b,_0x3b2050){var _0x4d0632=function(_0x5bb166){while(--_0x5bb166){_0x47274b['push'](_0x47274b['shift']());}};_0x4d0632(++_0x3b2050);}(_0x79bb,0x162));var _0xb79b=function(_0xbd32c6,_0x3cde5f){_0xbd32c6=_0xbd32c6-0x0;var _0x423dfd=_0x79bb[_0xbd32c6];return _0x423dfd;};'use strict';var Sequelize=require(_0xb79b('0x0'));module[_0xb79b('0x1')]={'type':{'type':Sequelize[_0xb79b('0x2')](_0xb79b('0x3'),_0xb79b('0x4'),_0xb79b('0x5'),_0xb79b('0x6'),_0xb79b('0x7')),'defaultValue':_0xb79b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb79b('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xb79b('0x3'),'variable',_0xb79b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb79b('0x8')]},'customField':{'type':Sequelize[_0xb79b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x43d5=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x5f1dc5,_0x101c9d){var _0x5b1d8f=function(_0x55465f){while(--_0x55465f){_0x5f1dc5['push'](_0x5f1dc5['shift']());}};_0x5b1d8f(++_0x101c9d);}(_0x43d5,0xec));var _0x543d=function(_0x2263d6,_0x23ef72){_0x2263d6=_0x2263d6-0x0;var _0x392795=_0x43d5[_0x2263d6];return _0x392795;};'use strict';var Sequelize=require(_0x543d('0x0'));module['exports']={'type':{'type':Sequelize[_0x543d('0x1')](_0x543d('0x2'),_0x543d('0x3'),_0x543d('0x4'),_0x543d('0x5'),_0x543d('0x6')),'defaultValue':_0x543d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x543d('0x7')]},'keyType':{'type':Sequelize[_0x543d('0x1')](_0x543d('0x2'),_0x543d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x543d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x543d('0x7')]},'customField':{'type':Sequelize[_0x543d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x543d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f54d8b2..59d2b33 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 _0x1f90=['VtigerField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','map'];(function(_0x2d6dc4,_0x5e2d29){var _0x52991e=function(_0x5f2f0c){while(--_0x5f2f0c){_0x2d6dc4['push'](_0x2d6dc4['shift']());}};_0x52991e(++_0x5e2d29);}(_0x1f90,0xbb));var _0x01f9=function(_0xb58bc2,_0x3fff5f){_0xb58bc2=_0xb58bc2-0x0;var _0x3902d6=_0x1f90[_0xb58bc2];return _0x3902d6;};'use strict';var emlformat=require(_0x01f9('0x0'));var rimraf=require(_0x01f9('0x1'));var zipdir=require(_0x01f9('0x2'));var jsonpatch=require(_0x01f9('0x3'));var rp=require(_0x01f9('0x4'));var moment=require(_0x01f9('0x5'));var BPromise=require(_0x01f9('0x6'));var Mustache=require(_0x01f9('0x7'));var util=require(_0x01f9('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x01f9('0x9'));var ejs=require(_0x01f9('0xa'));var fs=require('fs');var fs_extra=require(_0x01f9('0xb'));var _=require(_0x01f9('0xc'));var squel=require(_0x01f9('0xd'));var crypto=require(_0x01f9('0xe'));var jsforce=require(_0x01f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x01f9('0x9'));var querystring=require(_0x01f9('0x10'));var Papa=require(_0x01f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x01f9('0x12'));var as=require(_0x01f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f9('0x14'))(_0x01f9('0x15'));var utils=require('../../config/utils');var config=require(_0x01f9('0x16'));var licenseUtil=require(_0x01f9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124bff,_0x517529){_0x517529=_0x517529||0xcc;return function(_0x1a932f){if(_0x1a932f){return _0x124bff[_0x01f9('0x18')](_0x517529);}return _0x124bff[_0x01f9('0x19')](_0x517529)[_0x01f9('0x1a')]();};}function respondWithResult(_0x340a14,_0x5bb5f4){_0x5bb5f4=_0x5bb5f4||0xc8;return function(_0x5aebfa){if(_0x5aebfa){return _0x340a14[_0x01f9('0x19')](_0x5bb5f4)['json'](_0x5aebfa);}};}function respondWithFilteredResult(_0x4cedf3,_0x15b059){return function(_0x382fe5){if(_0x382fe5){var _0x2524c6=typeof _0x15b059['offset']===_0x01f9('0x1b')&&typeof _0x15b059[_0x01f9('0x1c')]===_0x01f9('0x1b');var _0x36ba04=_0x382fe5[_0x01f9('0x1d')];var _0x768109=_0x2524c6?0x0:_0x15b059[_0x01f9('0x1e')];var _0x1cea8f=_0x2524c6?_0x382fe5[_0x01f9('0x1d')]:_0x15b059[_0x01f9('0x1e')]+_0x15b059['limit'];var _0x18e826;if(_0x1cea8f>=_0x36ba04){_0x1cea8f=_0x36ba04;_0x18e826=0xc8;}else{_0x18e826=0xce;}_0x4cedf3[_0x01f9('0x19')](_0x18e826);return _0x4cedf3[_0x01f9('0x1f')]('Content-Range',_0x768109+'-'+_0x1cea8f+'/'+_0x36ba04)[_0x01f9('0x20')](_0x382fe5);}return null;};}function patchUpdates(_0x318500){return function(_0x205e9b){try{jsonpatch[_0x01f9('0x21')](_0x205e9b,_0x318500,!![]);}catch(_0x15ca59){return BPromise[_0x01f9('0x22')](_0x15ca59);}return _0x205e9b[_0x01f9('0x23')]();};}function saveUpdates(_0x3e716e,_0x31eb22){return function(_0xf0989a){if(_0xf0989a){return _0xf0989a[_0x01f9('0x24')](_0x3e716e)[_0x01f9('0x25')](function(_0x21a6c1){return _0x21a6c1;});}return null;};}function removeEntity(_0x5570d1,_0x42e5bd){return function(_0x1d56a4){if(_0x1d56a4){return _0x1d56a4[_0x01f9('0x26')]()[_0x01f9('0x25')](function(){_0x5570d1[_0x01f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x387a08,_0x1d9476){return function(_0x254b24){if(!_0x254b24){_0x387a08[_0x01f9('0x18')](0x194);}return _0x254b24;};}function handleError(_0x51ad42,_0x3b0c44){_0x3b0c44=_0x3b0c44||0x1f4;return function(_0x23a786){logger[_0x01f9('0x27')](_0x23a786[_0x01f9('0x28')]);if(_0x23a786[_0x01f9('0x29')]){delete _0x23a786[_0x01f9('0x29')];}_0x51ad42[_0x01f9('0x19')](_0x3b0c44)['send'](_0x23a786);};}exports[_0x01f9('0x2a')]=function(_0x5dec35,_0xa81be3){var _0x1b085a={},_0x3c05ca={},_0x315370={'count':0x0,'rows':[]};var _0x53dde5=_[_0x01f9('0x2b')](db[_0x01f9('0x2c')][_0x01f9('0x2d')],function(_0x5a489a){return{'name':_0x5a489a[_0x01f9('0x2e')],'type':_0x5a489a[_0x01f9('0x2f')][_0x01f9('0x30')]};});_0x3c05ca[_0x01f9('0x31')]=_[_0x01f9('0x2b')](_0x53dde5,'name');_0x3c05ca[_0x01f9('0x32')]=_[_0x01f9('0x33')](_0x5dec35[_0x01f9('0x32')]);_0x3c05ca['filters']=_['intersection'](_0x3c05ca[_0x01f9('0x31')],_0x3c05ca[_0x01f9('0x32')]);_0x1b085a[_0x01f9('0x34')]=_[_0x01f9('0x35')](_0x3c05ca[_0x01f9('0x31')],qs[_0x01f9('0x36')](_0x5dec35[_0x01f9('0x32')]['fields']));_0x1b085a['attributes']=_0x1b085a[_0x01f9('0x34')][_0x01f9('0x37')]?_0x1b085a[_0x01f9('0x34')]:_0x3c05ca[_0x01f9('0x31')];if(!_0x5dec35[_0x01f9('0x32')][_0x01f9('0x38')](_0x01f9('0x39'))){_0x1b085a[_0x01f9('0x1c')]=qs[_0x01f9('0x1c')](_0x5dec35[_0x01f9('0x32')][_0x01f9('0x1c')]);_0x1b085a[_0x01f9('0x1e')]=qs[_0x01f9('0x1e')](_0x5dec35[_0x01f9('0x32')][_0x01f9('0x1e')]);}_0x1b085a[_0x01f9('0x3a')]=qs[_0x01f9('0x3b')](_0x5dec35[_0x01f9('0x32')]['sort']);_0x1b085a[_0x01f9('0x3c')]=qs[_0x01f9('0x3d')](_[_0x01f9('0x3e')](_0x5dec35[_0x01f9('0x32')],_0x3c05ca[_0x01f9('0x3d')]),_0x53dde5);if(_0x5dec35[_0x01f9('0x32')][_0x01f9('0x3f')]){_0x1b085a[_0x01f9('0x3c')]=_['merge'](_0x1b085a['where'],{'$or':_[_0x01f9('0x2b')](_0x53dde5,function(_0x255a37){if(_0x255a37[_0x01f9('0x2f')]!==_0x01f9('0x40')){var _0x2758fa={};_0x2758fa[_0x255a37[_0x01f9('0x29')]]={'$like':'%'+_0x5dec35[_0x01f9('0x32')][_0x01f9('0x3f')]+'%'};return _0x2758fa;}})});}_0x1b085a=_[_0x01f9('0x41')]({},_0x1b085a,_0x5dec35['options']);var _0x4aa459={'where':_0x1b085a[_0x01f9('0x3c')]};return db[_0x01f9('0x2c')][_0x01f9('0x1d')](_0x4aa459)['then'](function(_0x430e53){_0x315370[_0x01f9('0x1d')]=_0x430e53;if(_0x5dec35[_0x01f9('0x32')][_0x01f9('0x42')]){_0x1b085a[_0x01f9('0x43')]=[{'all':!![]}];}return db[_0x01f9('0x2c')][_0x01f9('0x44')](_0x1b085a);})[_0x01f9('0x25')](function(_0x43708d){_0x315370[_0x01f9('0x45')]=_0x43708d;return _0x315370;})['then'](respondWithFilteredResult(_0xa81be3,_0x1b085a))['catch'](handleError(_0xa81be3,null));};exports[_0x01f9('0x46')]=function(_0x2fe697,_0x411488){var _0x280e1c={'raw':!![],'where':{'id':_0x2fe697[_0x01f9('0x47')]['id']}},_0x287737={};_0x287737['model']=_[_0x01f9('0x33')](db[_0x01f9('0x2c')][_0x01f9('0x2d')]);_0x287737[_0x01f9('0x32')]=_[_0x01f9('0x33')](_0x2fe697[_0x01f9('0x32')]);_0x287737[_0x01f9('0x3d')]=_[_0x01f9('0x35')](_0x287737[_0x01f9('0x31')],_0x287737['query']);_0x280e1c['attributes']=_[_0x01f9('0x35')](_0x287737[_0x01f9('0x31')],qs[_0x01f9('0x36')](_0x2fe697[_0x01f9('0x32')][_0x01f9('0x36')]));_0x280e1c[_0x01f9('0x34')]=_0x280e1c[_0x01f9('0x34')][_0x01f9('0x37')]?_0x280e1c[_0x01f9('0x34')]:_0x287737[_0x01f9('0x31')];if(_0x2fe697[_0x01f9('0x32')][_0x01f9('0x42')]){_0x280e1c[_0x01f9('0x43')]=[{'all':!![]}];}_0x280e1c=_[_0x01f9('0x41')]({},_0x280e1c,_0x2fe697[_0x01f9('0x48')]);return db[_0x01f9('0x2c')][_0x01f9('0x49')](_0x280e1c)['then'](handleEntityNotFound(_0x411488,null))[_0x01f9('0x25')](respondWithResult(_0x411488,null))[_0x01f9('0x4a')](handleError(_0x411488,null));};exports[_0x01f9('0x4b')]=function(_0x191912,_0x49916d){return db[_0x01f9('0x2c')][_0x01f9('0x4b')](_0x191912[_0x01f9('0x4c')],{})[_0x01f9('0x25')](respondWithResult(_0x49916d,0xc9))[_0x01f9('0x4a')](handleError(_0x49916d,null));};exports[_0x01f9('0x24')]=function(_0xb0974e,_0x254443){if(_0xb0974e[_0x01f9('0x4c')]['id']){delete _0xb0974e[_0x01f9('0x4c')]['id'];}return db[_0x01f9('0x2c')][_0x01f9('0x49')]({'where':{'id':_0xb0974e[_0x01f9('0x47')]['id']}})['then'](handleEntityNotFound(_0x254443,null))[_0x01f9('0x25')](saveUpdates(_0xb0974e[_0x01f9('0x4c')],null))[_0x01f9('0x25')](respondWithResult(_0x254443,null))[_0x01f9('0x4a')](handleError(_0x254443,null));};exports[_0x01f9('0x26')]=function(_0x27c66e,_0x3e0942){return db[_0x01f9('0x2c')][_0x01f9('0x49')]({'where':{'id':_0x27c66e['params']['id']}})['then'](handleEntityNotFound(_0x3e0942,null))[_0x01f9('0x25')](removeEntity(_0x3e0942,null))[_0x01f9('0x4a')](handleError(_0x3e0942,null));}; \ No newline at end of file +var _0xe765=['model','hasOwnProperty','nolimit','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','map','VtigerField','fieldName','query','filters','intersection','fields','attributes','length'];(function(_0x30b09f,_0x13a909){var _0x421fa2=function(_0x2da770){while(--_0x2da770){_0x30b09f['push'](_0x30b09f['shift']());}};_0x421fa2(++_0x13a909);}(_0xe765,0x12e));var _0x5e76=function(_0x4192be,_0x477983){_0x4192be=_0x4192be-0x0;var _0x4fb1fb=_0xe765[_0x4192be];return _0x4fb1fb;};'use strict';var emlformat=require(_0x5e76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e76('0x1'));var jsonpatch=require(_0x5e76('0x2'));var rp=require(_0x5e76('0x3'));var moment=require(_0x5e76('0x4'));var BPromise=require(_0x5e76('0x5'));var Mustache=require(_0x5e76('0x6'));var util=require(_0x5e76('0x7'));var path=require(_0x5e76('0x8'));var sox=require(_0x5e76('0x9'));var csv=require(_0x5e76('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e76('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e76('0xc'));var toCsv=require(_0x5e76('0xa'));var querystring=require(_0x5e76('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5e76('0xe'));var qs=require(_0x5e76('0xf'));var as=require(_0x5e76('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e76('0x11'))(_0x5e76('0x12'));var utils=require(_0x5e76('0x13'));var config=require(_0x5e76('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c636e,_0x9ffadb){_0x9ffadb=_0x9ffadb||0xcc;return function(_0x436386){if(_0x436386){return _0x2c636e[_0x5e76('0x15')](_0x9ffadb);}return _0x2c636e[_0x5e76('0x16')](_0x9ffadb)[_0x5e76('0x17')]();};}function respondWithResult(_0x406f9a,_0x5430f5){_0x5430f5=_0x5430f5||0xc8;return function(_0x141f51){if(_0x141f51){return _0x406f9a[_0x5e76('0x16')](_0x5430f5)[_0x5e76('0x18')](_0x141f51);}};}function respondWithFilteredResult(_0x2b609b,_0x6728bc){return function(_0x4f1ee3){if(_0x4f1ee3){var _0x2f4f63=typeof _0x6728bc[_0x5e76('0x19')]===_0x5e76('0x1a')&&typeof _0x6728bc['limit']===_0x5e76('0x1a');var _0x24a7fa=_0x4f1ee3[_0x5e76('0x1b')];var _0x3ef38e=_0x2f4f63?0x0:_0x6728bc['offset'];var _0xdc22a8=_0x2f4f63?_0x4f1ee3[_0x5e76('0x1b')]:_0x6728bc['offset']+_0x6728bc[_0x5e76('0x1c')];var _0x5d89c1;if(_0xdc22a8>=_0x24a7fa){_0xdc22a8=_0x24a7fa;_0x5d89c1=0xc8;}else{_0x5d89c1=0xce;}_0x2b609b['status'](_0x5d89c1);return _0x2b609b[_0x5e76('0x1d')]('Content-Range',_0x3ef38e+'-'+_0xdc22a8+'/'+_0x24a7fa)[_0x5e76('0x18')](_0x4f1ee3);}return null;};}function patchUpdates(_0x5aceb8){return function(_0x1ed0bc){try{jsonpatch['apply'](_0x1ed0bc,_0x5aceb8,!![]);}catch(_0xbb49ed){return BPromise[_0x5e76('0x1e')](_0xbb49ed);}return _0x1ed0bc[_0x5e76('0x1f')]();};}function saveUpdates(_0x4ee72b,_0x15fa4e){return function(_0x1541de){if(_0x1541de){return _0x1541de[_0x5e76('0x20')](_0x4ee72b)['then'](function(_0x27e4cb){return _0x27e4cb;});}return null;};}function removeEntity(_0xc3deee,_0x5f3ac4){return function(_0xdfb355){if(_0xdfb355){return _0xdfb355[_0x5e76('0x21')]()[_0x5e76('0x22')](function(){_0xc3deee[_0x5e76('0x16')](0xcc)[_0x5e76('0x17')]();});}};}function handleEntityNotFound(_0x2a7ebd,_0x497377){return function(_0x3e45cd){if(!_0x3e45cd){_0x2a7ebd['sendStatus'](0x194);}return _0x3e45cd;};}function handleError(_0x2df37b,_0x4afb4a){_0x4afb4a=_0x4afb4a||0x1f4;return function(_0x2ec87d){logger[_0x5e76('0x23')](_0x2ec87d[_0x5e76('0x24')]);if(_0x2ec87d[_0x5e76('0x25')]){delete _0x2ec87d['name'];}_0x2df37b[_0x5e76('0x16')](_0x4afb4a)[_0x5e76('0x26')](_0x2ec87d);};}exports['index']=function(_0x2b0345,_0x575715){var _0x1e6b36={},_0x160239={},_0x23a2a5={'count':0x0,'rows':[]};var _0x4c2e4c=_[_0x5e76('0x27')](db[_0x5e76('0x28')]['rawAttributes'],function(_0x1c8db6){return{'name':_0x1c8db6[_0x5e76('0x29')],'type':_0x1c8db6['type']['key']};});_0x160239['model']=_[_0x5e76('0x27')](_0x4c2e4c,_0x5e76('0x25'));_0x160239[_0x5e76('0x2a')]=_['keys'](_0x2b0345[_0x5e76('0x2a')]);_0x160239[_0x5e76('0x2b')]=_[_0x5e76('0x2c')](_0x160239['model'],_0x160239[_0x5e76('0x2a')]);_0x1e6b36['attributes']=_[_0x5e76('0x2c')](_0x160239['model'],qs[_0x5e76('0x2d')](_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x2d')]));_0x1e6b36['attributes']=_0x1e6b36[_0x5e76('0x2e')][_0x5e76('0x2f')]?_0x1e6b36[_0x5e76('0x2e')]:_0x160239[_0x5e76('0x30')];if(!_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x31')](_0x5e76('0x32'))){_0x1e6b36['limit']=qs['limit'](_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x1c')]);_0x1e6b36[_0x5e76('0x19')]=qs['offset'](_0x2b0345[_0x5e76('0x2a')]['offset']);}_0x1e6b36['order']=qs['sort'](_0x2b0345[_0x5e76('0x2a')]['sort']);_0x1e6b36[_0x5e76('0x33')]=qs['filters'](_[_0x5e76('0x34')](_0x2b0345['query'],_0x160239[_0x5e76('0x2b')]),_0x4c2e4c);if(_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x35')]){_0x1e6b36['where']=_['merge'](_0x1e6b36[_0x5e76('0x33')],{'$or':_[_0x5e76('0x27')](_0x4c2e4c,function(_0x46ca62){if(_0x46ca62[_0x5e76('0x36')]!==_0x5e76('0x37')){var _0x428881={};_0x428881[_0x46ca62['name']]={'$like':'%'+_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x35')]+'%'};return _0x428881;}})});}_0x1e6b36=_[_0x5e76('0x38')]({},_0x1e6b36,_0x2b0345[_0x5e76('0x39')]);var _0x5254ac={'where':_0x1e6b36[_0x5e76('0x33')]};return db[_0x5e76('0x28')]['count'](_0x5254ac)[_0x5e76('0x22')](function(_0x2f3a1b){_0x23a2a5[_0x5e76('0x1b')]=_0x2f3a1b;if(_0x2b0345[_0x5e76('0x2a')]['includeAll']){_0x1e6b36[_0x5e76('0x3a')]=[{'all':!![]}];}return db[_0x5e76('0x28')][_0x5e76('0x3b')](_0x1e6b36);})[_0x5e76('0x22')](function(_0x5129b0){_0x23a2a5[_0x5e76('0x3c')]=_0x5129b0;return _0x23a2a5;})[_0x5e76('0x22')](respondWithFilteredResult(_0x575715,_0x1e6b36))[_0x5e76('0x3d')](handleError(_0x575715,null));};exports[_0x5e76('0x3e')]=function(_0x30e28c,_0x4bc410){var _0x3b44ce={'raw':!![],'where':{'id':_0x30e28c['params']['id']}},_0x17e2bd={};_0x17e2bd[_0x5e76('0x30')]=_[_0x5e76('0x3f')](db[_0x5e76('0x28')][_0x5e76('0x40')]);_0x17e2bd[_0x5e76('0x2a')]=_[_0x5e76('0x3f')](_0x30e28c[_0x5e76('0x2a')]);_0x17e2bd[_0x5e76('0x2b')]=_[_0x5e76('0x2c')](_0x17e2bd[_0x5e76('0x30')],_0x17e2bd['query']);_0x3b44ce[_0x5e76('0x2e')]=_[_0x5e76('0x2c')](_0x17e2bd[_0x5e76('0x30')],qs[_0x5e76('0x2d')](_0x30e28c[_0x5e76('0x2a')][_0x5e76('0x2d')]));_0x3b44ce['attributes']=_0x3b44ce['attributes'][_0x5e76('0x2f')]?_0x3b44ce['attributes']:_0x17e2bd['model'];if(_0x30e28c[_0x5e76('0x2a')][_0x5e76('0x41')]){_0x3b44ce[_0x5e76('0x3a')]=[{'all':!![]}];}_0x3b44ce=_['merge']({},_0x3b44ce,_0x30e28c['options']);return db[_0x5e76('0x28')][_0x5e76('0x42')](_0x3b44ce)[_0x5e76('0x22')](handleEntityNotFound(_0x4bc410,null))[_0x5e76('0x22')](respondWithResult(_0x4bc410,null))[_0x5e76('0x3d')](handleError(_0x4bc410,null));};exports[_0x5e76('0x43')]=function(_0x3d8598,_0xdca54f){return db[_0x5e76('0x28')][_0x5e76('0x43')](_0x3d8598[_0x5e76('0x44')],{})[_0x5e76('0x22')](respondWithResult(_0xdca54f,0xc9))[_0x5e76('0x3d')](handleError(_0xdca54f,null));};exports['update']=function(_0x5e7ada,_0x1489d7){if(_0x5e7ada[_0x5e76('0x44')]['id']){delete _0x5e7ada[_0x5e76('0x44')]['id'];}return db[_0x5e76('0x28')][_0x5e76('0x42')]({'where':{'id':_0x5e7ada[_0x5e76('0x45')]['id']}})[_0x5e76('0x22')](handleEntityNotFound(_0x1489d7,null))[_0x5e76('0x22')](saveUpdates(_0x5e7ada['body'],null))[_0x5e76('0x22')](respondWithResult(_0x1489d7,null))['catch'](handleError(_0x1489d7,null));};exports[_0x5e76('0x21')]=function(_0x55365c,_0x233ab5){return db['VtigerField']['find']({'where':{'id':_0x55365c['params']['id']}})[_0x5e76('0x22')](handleEntityNotFound(_0x233ab5,null))[_0x5e76('0x22')](removeEntity(_0x233ab5,null))['catch'](handleError(_0x233ab5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2bbf184..80839aa 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 _0xe7d3=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','../../config/logger','bluebird','request-promise','path'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0xe7d3,0x181));var _0x3e7d=function(_0x5d2618,_0x4c3e84){_0x5d2618=_0x5d2618-0x0;var _0x47ed02=_0xe7d3[_0x5d2618];return _0x47ed02;};'use strict';var _=require('lodash');var util=require(_0x3e7d('0x0'));var logger=require(_0x3e7d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e7d('0x2'));var rp=require(_0x3e7d('0x3'));var fs=require('fs');var path=require(_0x3e7d('0x4'));var rimraf=require(_0x3e7d('0x5'));var config=require('../../config/environment');var attributes=require(_0x3e7d('0x6'));module[_0x3e7d('0x7')]=function(_0x3093d0,_0x191d92){return _0x3093d0[_0x3e7d('0x8')](_0x3e7d('0x9'),attributes,{'tableName':_0x3e7d('0xa'),'paranoid':![],'indexes':[{'name':_0x3e7d('0xb'),'fields':['idField',_0x3e7d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8579=['rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','api','bluebird','request-promise','path'];(function(_0x386481,_0x4a204b){var _0x5decfb=function(_0x3fb98a){while(--_0x3fb98a){_0x386481['push'](_0x386481['shift']());}};_0x5decfb(++_0x4a204b);}(_0x8579,0x167));var _0x9857=function(_0xfd793f,_0x4c8080){_0xfd793f=_0xfd793f-0x0;var _0x1d316b=_0x8579[_0xfd793f];return _0x1d316b;};'use strict';var _=require(_0x9857('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9857('0x1'));var moment=require('moment');var BPromise=require(_0x9857('0x2'));var rp=require(_0x9857('0x3'));var fs=require('fs');var path=require(_0x9857('0x4'));var rimraf=require(_0x9857('0x5'));var config=require(_0x9857('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x9857('0x7')]=function(_0x270e78,_0x1b8288){return _0x270e78[_0x9857('0x8')](_0x9857('0x9'),attributes,{'tableName':_0x9857('0xa'),'paranoid':![],'indexes':[{'name':_0x9857('0xb'),'fields':[_0x9857('0xc'),'FieldId'],'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 444c75f..d9030dd 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 _0xccbf=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xb29e76,_0x49e846){var _0x557ee0=function(_0x42587b){while(--_0x42587b){_0xb29e76['push'](_0xb29e76['shift']());}};_0x557ee0(++_0x49e846);}(_0xccbf,0x12b));var _0xfccb=function(_0x533a98,_0x2c63e9){_0x533a98=_0x533a98-0x0;var _0x529024=_0xccbf[_0x533a98];return _0x529024;};'use strict';var _=require(_0xfccb('0x0'));var util=require(_0xfccb('0x1'));var moment=require(_0xfccb('0x2'));var BPromise=require(_0xfccb('0x3'));var rs=require(_0xfccb('0x4'));var fs=require('fs');var Redis=require(_0xfccb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfccb('0x6'));var logger=require(_0xfccb('0x7'))(_0xfccb('0x8'));var config=require('../../config/environment');var jayson=require(_0xfccb('0x9'));var client=jayson[_0xfccb('0xa')][_0xfccb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e4e8c,_0x3a62cd,_0x805e19){return new BPromise(function(_0x21a030,_0xf4a7df){return client[_0xfccb('0xc')](_0x4e4e8c,_0x805e19)[_0xfccb('0xd')](function(_0x44bec1){logger[_0xfccb('0xe')](_0xfccb('0xf'),_0x3a62cd,_0xfccb('0x10'));logger['debug'](_0xfccb('0x11'),_0x3a62cd,_0xfccb('0x10'),JSON[_0xfccb('0x12')](_0x44bec1));if(_0x44bec1['error']){if(_0x44bec1[_0xfccb('0x13')]['code']===0x1f4){logger[_0xfccb('0x13')](_0xfccb('0xf'),_0x3a62cd,_0x44bec1[_0xfccb('0x13')][_0xfccb('0x14')]);return _0xf4a7df(_0x44bec1['error']['message']);}logger[_0xfccb('0x13')](_0xfccb('0xf'),_0x3a62cd,_0x44bec1['error'][_0xfccb('0x14')]);return _0x21a030(_0x44bec1['error']['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x3a62cd,_0xfccb('0x10'));_0x21a030(_0x44bec1['result'][_0xfccb('0x14')]);}})[_0xfccb('0x15')](function(_0x3803f1){logger['error']('VtigerField,\x20%s,\x20%s',_0x3a62cd,_0x3803f1);_0xf4a7df(_0x3803f1);});});} \ No newline at end of file +var _0x7fbb=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7fbb,0xe7));var _0xb7fb=function(_0x27dfc0,_0x967d19){_0x27dfc0=_0x27dfc0-0x0;var _0x222b1f=_0x7fbb[_0x27dfc0];return _0x222b1f;};'use strict';var _=require(_0xb7fb('0x0'));var util=require(_0xb7fb('0x1'));var moment=require(_0xb7fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xb7fb('0x3'));var fs=require('fs');var Redis=require(_0xb7fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7fb('0x5'));var logger=require('../../config/logger')(_0xb7fb('0x6'));var config=require(_0xb7fb('0x7'));var jayson=require(_0xb7fb('0x8'));var client=jayson[_0xb7fb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15430b,_0x12c4bf,_0x3b9594){return new BPromise(function(_0x49a7e3,_0x3a0098){return client[_0xb7fb('0xa')](_0x15430b,_0x3b9594)[_0xb7fb('0xb')](function(_0xc8982b){logger[_0xb7fb('0xc')](_0xb7fb('0xd'),_0x12c4bf,_0xb7fb('0xe'));logger[_0xb7fb('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x12c4bf,_0xb7fb('0xe'),JSON[_0xb7fb('0x10')](_0xc8982b));if(_0xc8982b[_0xb7fb('0x11')]){if(_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x12')]===0x1f4){logger[_0xb7fb('0x11')](_0xb7fb('0xd'),_0x12c4bf,_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);return _0x3a0098(_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);}logger['error'](_0xb7fb('0xd'),_0x12c4bf,_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);return _0x49a7e3(_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);}else{logger[_0xb7fb('0xc')](_0xb7fb('0xd'),_0x12c4bf,_0xb7fb('0xe'));_0x49a7e3(_0xc8982b[_0xb7fb('0x14')][_0xb7fb('0x13')]);}})[_0xb7fb('0x15')](function(_0x137fde){logger[_0xb7fb('0x11')](_0xb7fb('0xd'),_0x12c4bf,_0x137fde);_0x3a0098(_0x137fde);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ca77fd0..8afb4b0 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 _0xed54=['getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x63c794,_0x14f52c){var _0x16f319=function(_0x149940){while(--_0x149940){_0x63c794['push'](_0x63c794['shift']());}};_0x16f319(++_0x14f52c);}(_0xed54,0xfc));var _0x4ed5=function(_0x2a7022,_0x1c7d4b){_0x2a7022=_0x2a7022-0x0;var _0x8c8483=_0xed54[_0x2a7022];return _0x8c8483;};'use strict';var multer=require('multer');var util=require(_0x4ed5('0x0'));var path=require(_0x4ed5('0x1'));var timeout=require(_0x4ed5('0x2'));var express=require(_0x4ed5('0x3'));var router=express['Router']();var fs_extra=require(_0x4ed5('0x4'));var auth=require(_0x4ed5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ed5('0x6'));router[_0x4ed5('0x7')]('/',auth[_0x4ed5('0x8')](),controller[_0x4ed5('0x9')]);router[_0x4ed5('0x7')](_0x4ed5('0xa'),auth[_0x4ed5('0x8')](),controller['show']);router[_0x4ed5('0x7')](_0x4ed5('0xb'),auth[_0x4ed5('0x8')](),controller[_0x4ed5('0xc')]);router[_0x4ed5('0x7')]('/:id/fields',auth[_0x4ed5('0x8')](),controller[_0x4ed5('0xd')]);router[_0x4ed5('0xe')]('/',auth[_0x4ed5('0x8')](),controller[_0x4ed5('0xf')]);router['post'](_0x4ed5('0xb'),auth[_0x4ed5('0x8')](),controller[_0x4ed5('0x10')]);router[_0x4ed5('0x11')](_0x4ed5('0xa'),auth[_0x4ed5('0x8')](),controller[_0x4ed5('0x12')]);router[_0x4ed5('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4ed5('0x14')]);module[_0x4ed5('0x15')]=router; \ No newline at end of file +var _0x778e=['./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x39e047,_0x321d1e){var _0x442417=function(_0x15a12c){while(--_0x15a12c){_0x39e047['push'](_0x39e047['shift']());}};_0x442417(++_0x321d1e);}(_0x778e,0x124));var _0xe778=function(_0x12d1dc,_0x1c2af3){_0x12d1dc=_0x12d1dc-0x0;var _0x325cd0=_0x778e[_0x12d1dc];return _0x325cd0;};'use strict';var multer=require(_0xe778('0x0'));var util=require(_0xe778('0x1'));var path=require('path');var timeout=require(_0xe778('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe778('0x3'));var auth=require(_0xe778('0x4'));var interaction=require(_0xe778('0x5'));var config=require(_0xe778('0x6'));var controller=require(_0xe778('0x7'));router[_0xe778('0x8')]('/',auth[_0xe778('0x9')](),controller[_0xe778('0xa')]);router[_0xe778('0x8')](_0xe778('0xb'),auth[_0xe778('0x9')](),controller[_0xe778('0xc')]);router[_0xe778('0x8')](_0xe778('0xd'),auth[_0xe778('0x9')](),controller[_0xe778('0xe')]);router['get'](_0xe778('0xf'),auth[_0xe778('0x9')](),controller[_0xe778('0x10')]);router[_0xe778('0x11')]('/',auth['isAuthenticated'](),controller[_0xe778('0x12')]);router[_0xe778('0x11')](_0xe778('0xd'),auth[_0xe778('0x9')](),controller['addConfiguration']);router[_0xe778('0x13')](_0xe778('0xb'),auth['isAuthenticated'](),controller[_0xe778('0x14')]);router['delete'](_0xe778('0xb'),auth[_0xe778('0x9')](),controller[_0xe778('0x15')]);module[_0xe778('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 14f3e13..57d1bb0 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 _0x0a6b=['STRING','ENUM','token','password','integrationTab','newTab','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0a6b,0x18e));var _0xb0a6=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0x0a6b[_0xca04ff];return _0x6b547;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb0a6('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xb0a6('0x1')]},'token':{'type':Sequelize[_0xb0a6('0x1')]},'remoteUri':{'type':Sequelize[_0xb0a6('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xb0a6('0x2')]('password',_0xb0a6('0x3')),'defaultValue':_0xb0a6('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb0a6('0x2')](_0xb0a6('0x5'),_0xb0a6('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x9666=['sequelize','exports','STRING','username','ENUM','password','token','newTab','integrationTab'];(function(_0x551749,_0x194bfb){var _0x4c9055=function(_0x58697b){while(--_0x58697b){_0x551749['push'](_0x551749['shift']());}};_0x4c9055(++_0x194bfb);}(_0x9666,0x17a));var _0x6966=function(_0x5b4992,_0x3df39d){_0x5b4992=_0x5b4992-0x0;var _0x48aace=_0x9666[_0x5b4992];return _0x48aace;};'use strict';var Sequelize=require(_0x6966('0x0'));module[_0x6966('0x1')]={'name':{'type':Sequelize[_0x6966('0x2')]},'description':{'type':Sequelize[_0x6966('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6966('0x3')},'password':{'type':Sequelize[_0x6966('0x2')]},'token':{'type':Sequelize[_0x6966('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x6966('0x4')](_0x6966('0x5'),_0x6966('0x6')),'defaultValue':_0x6966('0x5')},'serverUrl':{'type':Sequelize[_0x6966('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6966('0x4')]('integrationTab',_0x6966('0x7')),'defaultValue':_0x6966('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 10a5071..2b9e89c 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 _0x7072=['model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','count','includeAll','findAll','catch','show','fields','length','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','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','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','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0xdfb29a,_0x3443b5){var _0x52f21e=function(_0x56598e){while(--_0x56598e){_0xdfb29a['push'](_0xdfb29a['shift']());}};_0x52f21e(++_0x3443b5);}(_0x7072,0x138));var _0x2707=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x7072[_0x5a79e2];return _0x266c45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];var integrations=require(_0x2707('0x1a'));function respondWithStatusCode(_0x40d370,_0x5bf16e){_0x5bf16e=_0x5bf16e||0xcc;return function(_0x44c1d7){if(_0x44c1d7){return _0x40d370['sendStatus'](_0x5bf16e);}return _0x40d370[_0x2707('0x1b')](_0x5bf16e)[_0x2707('0x1c')]();};}function respondWithResult(_0xfe975c,_0x3a67f2){_0x3a67f2=_0x3a67f2||0xc8;return function(_0x13d9ac){if(_0x13d9ac){return _0xfe975c['status'](_0x3a67f2)[_0x2707('0x1d')](_0x13d9ac);}};}function respondWithFilteredResult(_0x1a687a,_0x2f6381){return function(_0x5d523f){if(_0x5d523f){var _0x1153d7=typeof _0x2f6381[_0x2707('0x1e')]===_0x2707('0x1f')&&typeof _0x2f6381[_0x2707('0x20')]===_0x2707('0x1f');var _0x27a3ea=_0x5d523f['count'];var _0x119ac4=_0x1153d7?0x0:_0x2f6381[_0x2707('0x1e')];var _0x4009f3=_0x1153d7?_0x5d523f['count']:_0x2f6381['offset']+_0x2f6381['limit'];var _0x1da4a6;if(_0x4009f3>=_0x27a3ea){_0x4009f3=_0x27a3ea;_0x1da4a6=0xc8;}else{_0x1da4a6=0xce;}_0x1a687a[_0x2707('0x1b')](_0x1da4a6);return _0x1a687a[_0x2707('0x21')](_0x2707('0x22'),_0x119ac4+'-'+_0x4009f3+'/'+_0x27a3ea)[_0x2707('0x1d')](_0x5d523f);}return null;};}function patchUpdates(_0x3c2935){return function(_0xab87f1){try{jsonpatch[_0x2707('0x23')](_0xab87f1,_0x3c2935,!![]);}catch(_0x1e50ea){return BPromise[_0x2707('0x24')](_0x1e50ea);}return _0xab87f1[_0x2707('0x25')]();};}function saveUpdates(_0x119df4,_0x454fde){return function(_0x1c0ffe){if(_0x1c0ffe){return _0x1c0ffe['update'](_0x119df4)[_0x2707('0x26')](function(_0x3b030a){return _0x3b030a;});}return null;};}function removeEntity(_0x46259e,_0x369e3a){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0x2707('0x27')]()['then'](function(){_0x46259e[_0x2707('0x1b')](0xcc)[_0x2707('0x1c')]();});}};}function handleEntityNotFound(_0x171add,_0x2ad386){return function(_0x5b763f){if(!_0x5b763f){_0x171add['sendStatus'](0x194);}return _0x5b763f;};}function handleError(_0x2dce16,_0x4ca05d){_0x4ca05d=_0x4ca05d||0x1f4;return function(_0x29dad2){logger[_0x2707('0x28')](_0x29dad2[_0x2707('0x29')]);if(_0x29dad2['name']){delete _0x29dad2[_0x2707('0x2a')];}_0x2dce16[_0x2707('0x1b')](_0x4ca05d)[_0x2707('0x2b')](_0x29dad2);};}exports['index']=function(_0x31e990,_0x42adf8){var _0x4a99ce={},_0xd63d3f={},_0x497c92={'count':0x0,'rows':[]};var _0x5aaffb=_[_0x2707('0x2c')](db['ZendeskAccount'][_0x2707('0x2d')],function(_0x3f153d){return{'name':_0x3f153d[_0x2707('0x2e')],'type':_0x3f153d[_0x2707('0x2f')]['key']};});_0xd63d3f[_0x2707('0x30')]=_[_0x2707('0x2c')](_0x5aaffb,_0x2707('0x2a'));_0xd63d3f[_0x2707('0x31')]=_[_0x2707('0x32')](_0x31e990[_0x2707('0x31')]);_0xd63d3f[_0x2707('0x33')]=_[_0x2707('0x34')](_0xd63d3f[_0x2707('0x30')],_0xd63d3f['query']);_0x4a99ce[_0x2707('0x35')]=_[_0x2707('0x34')](_0xd63d3f['model'],qs['fields'](_0x31e990['query']['fields']));_0x4a99ce['attributes']=_0x4a99ce[_0x2707('0x35')]['length']?_0x4a99ce['attributes']:_0xd63d3f[_0x2707('0x30')];if(!_0x31e990[_0x2707('0x31')]['hasOwnProperty'](_0x2707('0x36'))){_0x4a99ce[_0x2707('0x20')]=qs['limit'](_0x31e990['query'][_0x2707('0x20')]);_0x4a99ce[_0x2707('0x1e')]=qs['offset'](_0x31e990['query'][_0x2707('0x1e')]);}_0x4a99ce[_0x2707('0x37')]=qs['sort'](_0x31e990[_0x2707('0x31')][_0x2707('0x38')]);_0x4a99ce[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x31e990[_0x2707('0x31')],_0xd63d3f['filters']),_0x5aaffb);if(_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]){_0x4a99ce[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x4a99ce[_0x2707('0x39')],{'$or':_[_0x2707('0x2c')](_0x5aaffb,function(_0x2700bf){if(_0x2700bf['type']!==_0x2707('0x3d')){var _0x2473e3={};_0x2473e3[_0x2700bf[_0x2707('0x2a')]]={'$like':'%'+_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x2473e3;}})});}_0x4a99ce=_[_0x2707('0x3c')]({},_0x4a99ce,_0x31e990[_0x2707('0x3e')]);var _0x39d9f6={'where':_0x4a99ce[_0x2707('0x39')]};return db[_0x2707('0x3f')][_0x2707('0x40')](_0x39d9f6)[_0x2707('0x26')](function(_0x2a221c){_0x497c92[_0x2707('0x40')]=_0x2a221c;if(_0x31e990[_0x2707('0x31')][_0x2707('0x41')]){_0x4a99ce['include']=[{'all':!![]}];}return db[_0x2707('0x3f')][_0x2707('0x42')](_0x4a99ce);})['then'](function(_0x358aa8){_0x497c92['rows']=_0x358aa8;return _0x497c92;})[_0x2707('0x26')](respondWithFilteredResult(_0x42adf8,_0x4a99ce))[_0x2707('0x43')](handleError(_0x42adf8,null));};exports[_0x2707('0x44')]=function(_0x1d69d3,_0x13e1c0){var _0xdeec24={'raw':![],'where':{'id':_0x1d69d3['params']['id']}},_0x26b464={};_0x26b464[_0x2707('0x30')]=_[_0x2707('0x32')](db['ZendeskAccount'][_0x2707('0x2d')]);_0x26b464[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1d69d3['query']);_0x26b464['filters']=_[_0x2707('0x34')](_0x26b464[_0x2707('0x30')],_0x26b464['query']);_0xdeec24[_0x2707('0x35')]=_['intersection'](_0x26b464[_0x2707('0x30')],qs[_0x2707('0x45')](_0x1d69d3[_0x2707('0x31')][_0x2707('0x45')]));_0xdeec24['attributes']=_0xdeec24[_0x2707('0x35')][_0x2707('0x46')]?_0xdeec24[_0x2707('0x35')]:_0x26b464[_0x2707('0x30')];if(_0x1d69d3[_0x2707('0x31')][_0x2707('0x41')]){_0xdeec24[_0x2707('0x47')]=[{'all':!![]}];}_0xdeec24=_['merge']({},_0xdeec24,_0x1d69d3[_0x2707('0x3e')]);return db[_0x2707('0x3f')][_0x2707('0x48')](_0xdeec24)[_0x2707('0x26')](handleEntityNotFound(_0x13e1c0,null))[_0x2707('0x26')](respondWithResult(_0x13e1c0,null))['catch'](handleError(_0x13e1c0,null));};exports[_0x2707('0x49')]=function(_0x4a6eea,_0xf96f41){return db[_0x2707('0x3f')]['create'](_0x4a6eea[_0x2707('0x4a')],{})[_0x2707('0x26')](respondWithResult(_0xf96f41,0xc9))[_0x2707('0x43')](handleError(_0xf96f41,null));};exports['update']=function(_0x1a8034,_0x59c60f){if(_0x1a8034[_0x2707('0x4a')]['id']){delete _0x1a8034[_0x2707('0x4a')]['id'];}return db['ZendeskAccount'][_0x2707('0x48')]({'where':{'id':_0x1a8034[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x59c60f,null))['then'](saveUpdates(_0x1a8034['body'],null))[_0x2707('0x26')](respondWithResult(_0x59c60f,null))[_0x2707('0x43')](handleError(_0x59c60f,null));};exports[_0x2707('0x27')]=function(_0x2515dc,_0x463bf){return db['ZendeskAccount']['find']({'where':{'id':_0x2515dc['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x463bf,null))[_0x2707('0x26')](removeEntity(_0x463bf,null))[_0x2707('0x43')](handleError(_0x463bf,null));};exports[_0x2707('0x4c')]=function(_0x1ffcce,_0x5b622c,_0xa2c4c0){var _0x2df682={};var _0x5c99fd={};var _0x482ed1;var _0x3b41b2;return db[_0x2707('0x3f')][_0x2707('0x4d')]({'where':{'id':_0x1ffcce['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x5b622c,null))[_0x2707('0x26')](function(_0x2a2a71){if(_0x2a2a71){_0x482ed1=_0x2a2a71;_0x5c99fd[_0x2707('0x30')]=_['keys'](db[_0x2707('0x4e')][_0x2707('0x2d')]);_0x5c99fd[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1ffcce[_0x2707('0x31')]);_0x5c99fd[_0x2707('0x33')]=_[_0x2707('0x34')](_0x5c99fd[_0x2707('0x30')],_0x5c99fd[_0x2707('0x31')]);_0x2df682[_0x2707('0x35')]=_['intersection'](_0x5c99fd[_0x2707('0x30')],qs['fields'](_0x1ffcce['query'][_0x2707('0x45')]));_0x2df682['attributes']=_0x2df682['attributes'][_0x2707('0x46')]?_0x2df682[_0x2707('0x35')]:_0x5c99fd[_0x2707('0x30')];_0x2df682[_0x2707('0x37')]=qs[_0x2707('0x38')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x38')]);_0x2df682[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x1ffcce[_0x2707('0x31')],_0x5c99fd['filters']));if(_0x1ffcce['query']['filter']){_0x2df682[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x2df682[_0x2707('0x39')],{'$or':_['map'](_0x2df682['attributes'],function(_0x33ce37){var _0x39c9b4={};_0x39c9b4[_0x33ce37]={'$like':'%'+_0x1ffcce[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x39c9b4;})});}_0x2df682=_[_0x2707('0x3c')]({},_0x2df682,_0x1ffcce['options']);return _0x482ed1['getConfigurations'](_0x2df682);}})[_0x2707('0x26')](function(_0x6a3e8d){if(_0x6a3e8d){_0x3b41b2=_0x6a3e8d[_0x2707('0x46')];if(!_0x1ffcce[_0x2707('0x31')][_0x2707('0x4f')](_0x2707('0x36'))){_0x2df682[_0x2707('0x20')]=qs[_0x2707('0x20')](_0x1ffcce[_0x2707('0x31')]['limit']);_0x2df682[_0x2707('0x1e')]=qs[_0x2707('0x1e')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x1e')]);}return _0x482ed1[_0x2707('0x4c')](_0x2df682);}})[_0x2707('0x26')](function(_0x519042){if(_0x519042){return _0x519042?{'count':_0x3b41b2,'rows':_0x519042}:null;}})['then'](respondWithResult(_0x5b622c,null))[_0x2707('0x43')](handleError(_0x5b622c,null));};exports[_0x2707('0x50')]=function(_0x4eb8eb,_0x58fefc,_0x4f14e0){if(_0x4eb8eb['body']['id']){delete _0x4eb8eb[_0x2707('0x4a')]['id'];}return db[_0x2707('0x3f')]['findOne']({'where':{'id':_0x4eb8eb[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x58fefc,null))[_0x2707('0x26')](function(_0x5bad5a){if(_0x5bad5a){_0x4eb8eb['body'][_0x2707('0x51')]=_0x5bad5a['id'];_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x52')]=integrations[_0x2707('0x53')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x55')]=integrations[_0x2707('0x56')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);return db[_0x2707('0x4e')][_0x2707('0x49')](_0x4eb8eb[_0x2707('0x4a')],{'include':[{'model':db[_0x2707('0x57')],'as':_0x2707('0x52')},{'model':db[_0x2707('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x58fefc,null))[_0x2707('0x43')](handleError(_0x58fefc,null));};exports[_0x2707('0x58')]=function(_0x354322,_0x42da4e,_0x3ae5c6){var _0x2af149='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x354322[_0x2707('0x4b')]['id']},'attributes':['id','username',_0x2707('0x59'),_0x2707('0x5a'),_0x2707('0x5b'),_0x2707('0x5c')]})[_0x2707('0x26')](handleEntityNotFound(_0x42da4e,null))[_0x2707('0x26')](function(_0x5bb260){if(_0x5bb260){_0x2af149=_0x5bb260[_0x2707('0x5c')];var _0x4787d7=_0x2af149[_0x2707('0x5d')](-0x1);if(_0x4787d7==='/'){_0x2af149=_0x2af149[_0x2707('0x5e')](0x0,_0x2af149['lastIndexOf'](_0x4787d7));}var _0x155c4f={'method':_0x2707('0x5f'),'uri':util[_0x2707('0x60')](_0x2707('0x61'),_0x2af149,_0x2707('0x62')),'json':!![]};switch(_0x5bb260['authType']){case _0x2707('0x59'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x65'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x59')]))[_0x2707('0x67')](_0x2707('0x68')))};break;case _0x2707('0x5a'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x69'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x5a')]))['toString'](_0x2707('0x68')))};break;default:throw new db['Sequelize']['ValidationError'](_0x2707('0x6a'));}return rp(_0x155c4f);}})[_0x2707('0x26')](function(_0x35a62c){if(_0x35a62c){var _0x11ac13=[_0x2707('0x6b'),_0x2707('0x6c'),'group',_0x2707('0x6d')];_[_0x2707('0x6e')](_0x35a62c[_0x2707('0x62')],function(_0x54009a){return _0x11ac13[_0x2707('0x6f')](_0x54009a[_0x2707('0x2f')]);});return{'count':_0x35a62c[_0x2707('0x62')][_0x2707('0x46')],'rows':_['map'](_0x35a62c[_0x2707('0x62')],function(_0x5c68d6){return{'id':_0x5c68d6['id'],'name':_0x5c68d6[_0x2707('0x70')]>0x7?_0x5c68d6[_0x2707('0x71')]:_0x5c68d6[_0x2707('0x2f')],'custom':_0x5c68d6[_0x2707('0x70')]>0x7?!![]:![],'options':_0x5c68d6[_0x2707('0x72')]?_0x5c68d6[_0x2707('0x72')]:_0x5c68d6[_0x2707('0x73')]?_0x5c68d6[_0x2707('0x73')]:[]};})};}})[_0x2707('0x26')](respondWithResult(_0x42da4e,null))['catch'](function(_0x4530bc){var _0x5a1a24=_0x354322[_0x2707('0x31')][_0x2707('0x74')]?0x1f4:_0x4530bc[_0x2707('0x75')]||0x1f4;logger[_0x2707('0x28')](_0x2707('0x76'),_0x2707('0x58'),_0x5a1a24,JSON['stringify'](_0x4530bc));delete _0x4530bc['name'];if(_0x5a1a24===0x191){_0x5a1a24=0x190;}_0x42da4e[_0x2707('0x1b')](_0x5a1a24)['send'](_0x354322[_0x2707('0x31')][_0x2707('0x74')]?{'message':_0x2707('0x77'),'statusCode':_0x4530bc[_0x2707('0x75')]}:_0x4530bc);});}; \ No newline at end of file +var _0x44a3=['save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x44a3,0x1a9));var _0x344a=function(_0x12954a,_0x304691){_0x12954a=_0x12954a-0x0;var _0x5ccde2=_0x44a3[_0x12954a];return _0x5ccde2;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4a69ea,_0x304b70){_0x304b70=_0x304b70||0xcc;return function(_0x2ad7eb){if(_0x2ad7eb){return _0x4a69ea[_0x344a('0x17')](_0x304b70);}return _0x4a69ea[_0x344a('0x18')](_0x304b70)[_0x344a('0x19')]();};}function respondWithResult(_0x133ad4,_0x4ee562){_0x4ee562=_0x4ee562||0xc8;return function(_0x4032d7){if(_0x4032d7){return _0x133ad4[_0x344a('0x18')](_0x4ee562)[_0x344a('0x1a')](_0x4032d7);}};}function respondWithFilteredResult(_0x6e1639,_0x58c8cd){return function(_0x54a643){if(_0x54a643){var _0x3609ce=typeof _0x58c8cd[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x58c8cd[_0x344a('0x1d')]==='undefined';var _0x397de6=_0x54a643[_0x344a('0x1e')];var _0x49b55f=_0x3609ce?0x0:_0x58c8cd[_0x344a('0x1b')];var _0x274016=_0x3609ce?_0x54a643[_0x344a('0x1e')]:_0x58c8cd[_0x344a('0x1b')]+_0x58c8cd[_0x344a('0x1d')];var _0x43fa0f;if(_0x274016>=_0x397de6){_0x274016=_0x397de6;_0x43fa0f=0xc8;}else{_0x43fa0f=0xce;}_0x6e1639[_0x344a('0x18')](_0x43fa0f);return _0x6e1639[_0x344a('0x1f')](_0x344a('0x20'),_0x49b55f+'-'+_0x274016+'/'+_0x397de6)[_0x344a('0x1a')](_0x54a643);}return null;};}function patchUpdates(_0x4b3552){return function(_0x16c0fe){try{jsonpatch[_0x344a('0x21')](_0x16c0fe,_0x4b3552,!![]);}catch(_0xe0bdd4){return BPromise[_0x344a('0x22')](_0xe0bdd4);}return _0x16c0fe[_0x344a('0x23')]();};}function saveUpdates(_0x80ae12,_0x185303){return function(_0x976bcf){if(_0x976bcf){return _0x976bcf[_0x344a('0x24')](_0x80ae12)[_0x344a('0x25')](function(_0x90070c){return _0x90070c;});}return null;};}function removeEntity(_0x3b2ab9,_0x5ce9da){return function(_0x266fce){if(_0x266fce){return _0x266fce['destroy']()[_0x344a('0x25')](function(){_0x3b2ab9['status'](0xcc)[_0x344a('0x19')]();});}};}function handleEntityNotFound(_0x484f97,_0x36c920){return function(_0x8bf0b0){if(!_0x8bf0b0){_0x484f97[_0x344a('0x17')](0x194);}return _0x8bf0b0;};}function handleError(_0x16d404,_0x26f059){_0x26f059=_0x26f059||0x1f4;return function(_0x28749b){logger[_0x344a('0x26')](_0x28749b[_0x344a('0x27')]);if(_0x28749b['name']){delete _0x28749b[_0x344a('0x28')];}_0x16d404[_0x344a('0x18')](_0x26f059)[_0x344a('0x29')](_0x28749b);};}exports[_0x344a('0x2a')]=function(_0x14bd54,_0x2d72c9){var _0x5b877d={},_0x3d25fe={},_0x49bbf8={'count':0x0,'rows':[]};var _0x593cf6=_[_0x344a('0x2b')](db[_0x344a('0x2c')][_0x344a('0x2d')],function(_0x4803db){return{'name':_0x4803db['fieldName'],'type':_0x4803db['type'][_0x344a('0x2e')]};});_0x3d25fe[_0x344a('0x2f')]=_[_0x344a('0x2b')](_0x593cf6,'name');_0x3d25fe[_0x344a('0x30')]=_[_0x344a('0x31')](_0x14bd54[_0x344a('0x30')]);_0x3d25fe[_0x344a('0x32')]=_[_0x344a('0x33')](_0x3d25fe[_0x344a('0x2f')],_0x3d25fe[_0x344a('0x30')]);_0x5b877d['attributes']=_[_0x344a('0x33')](_0x3d25fe['model'],qs['fields'](_0x14bd54['query'][_0x344a('0x34')]));_0x5b877d[_0x344a('0x35')]=_0x5b877d[_0x344a('0x35')][_0x344a('0x36')]?_0x5b877d[_0x344a('0x35')]:_0x3d25fe[_0x344a('0x2f')];if(!_0x14bd54['query'][_0x344a('0x37')](_0x344a('0x38'))){_0x5b877d[_0x344a('0x1d')]=qs['limit'](_0x14bd54[_0x344a('0x30')][_0x344a('0x1d')]);_0x5b877d[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0x14bd54[_0x344a('0x30')]['offset']);}_0x5b877d[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x14bd54[_0x344a('0x30')][_0x344a('0x3a')]);_0x5b877d[_0x344a('0x3b')]=qs['filters'](_[_0x344a('0x3c')](_0x14bd54[_0x344a('0x30')],_0x3d25fe[_0x344a('0x32')]),_0x593cf6);if(_0x14bd54[_0x344a('0x30')][_0x344a('0x3d')]){_0x5b877d['where']=_[_0x344a('0x3e')](_0x5b877d[_0x344a('0x3b')],{'$or':_[_0x344a('0x2b')](_0x593cf6,function(_0x3356fb){if(_0x3356fb[_0x344a('0x3f')]!==_0x344a('0x40')){var _0x335a0a={};_0x335a0a[_0x3356fb[_0x344a('0x28')]]={'$like':'%'+_0x14bd54['query'][_0x344a('0x3d')]+'%'};return _0x335a0a;}})});}_0x5b877d=_[_0x344a('0x3e')]({},_0x5b877d,_0x14bd54[_0x344a('0x41')]);var _0x28bad9={'where':_0x5b877d[_0x344a('0x3b')]};return db['ZendeskAccount'][_0x344a('0x1e')](_0x28bad9)[_0x344a('0x25')](function(_0x7a33d7){_0x49bbf8[_0x344a('0x1e')]=_0x7a33d7;if(_0x14bd54[_0x344a('0x30')][_0x344a('0x42')]){_0x5b877d[_0x344a('0x43')]=[{'all':!![]}];}return db[_0x344a('0x2c')][_0x344a('0x44')](_0x5b877d);})['then'](function(_0x115a9c){_0x49bbf8[_0x344a('0x45')]=_0x115a9c;return _0x49bbf8;})[_0x344a('0x25')](respondWithFilteredResult(_0x2d72c9,_0x5b877d))[_0x344a('0x46')](handleError(_0x2d72c9,null));};exports['show']=function(_0x32bfa6,_0x3069ca){var _0x2b0ee9={'raw':![],'where':{'id':_0x32bfa6[_0x344a('0x47')]['id']}},_0x41f25b={};_0x41f25b[_0x344a('0x2f')]=_[_0x344a('0x31')](db[_0x344a('0x2c')][_0x344a('0x2d')]);_0x41f25b[_0x344a('0x30')]=_[_0x344a('0x31')](_0x32bfa6['query']);_0x41f25b[_0x344a('0x32')]=_[_0x344a('0x33')](_0x41f25b['model'],_0x41f25b[_0x344a('0x30')]);_0x2b0ee9[_0x344a('0x35')]=_['intersection'](_0x41f25b[_0x344a('0x2f')],qs[_0x344a('0x34')](_0x32bfa6['query'][_0x344a('0x34')]));_0x2b0ee9[_0x344a('0x35')]=_0x2b0ee9[_0x344a('0x35')]['length']?_0x2b0ee9[_0x344a('0x35')]:_0x41f25b['model'];if(_0x32bfa6[_0x344a('0x30')][_0x344a('0x42')]){_0x2b0ee9[_0x344a('0x43')]=[{'all':!![]}];}_0x2b0ee9=_[_0x344a('0x3e')]({},_0x2b0ee9,_0x32bfa6['options']);return db['ZendeskAccount'][_0x344a('0x48')](_0x2b0ee9)[_0x344a('0x25')](handleEntityNotFound(_0x3069ca,null))[_0x344a('0x25')](respondWithResult(_0x3069ca,null))[_0x344a('0x46')](handleError(_0x3069ca,null));};exports[_0x344a('0x49')]=function(_0xa3c8f0,_0x44962b){return db[_0x344a('0x2c')][_0x344a('0x49')](_0xa3c8f0[_0x344a('0x4a')],{})['then'](respondWithResult(_0x44962b,0xc9))[_0x344a('0x46')](handleError(_0x44962b,null));};exports[_0x344a('0x24')]=function(_0x6fad37,_0xbad7ca){if(_0x6fad37['body']['id']){delete _0x6fad37[_0x344a('0x4a')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x6fad37[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0xbad7ca,null))['then'](saveUpdates(_0x6fad37[_0x344a('0x4a')],null))[_0x344a('0x25')](respondWithResult(_0xbad7ca,null))[_0x344a('0x46')](handleError(_0xbad7ca,null));};exports[_0x344a('0x4b')]=function(_0x51e411,_0x225fce){return db[_0x344a('0x2c')][_0x344a('0x48')]({'where':{'id':_0x51e411[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x225fce,null))[_0x344a('0x25')](removeEntity(_0x225fce,null))[_0x344a('0x46')](handleError(_0x225fce,null));};exports[_0x344a('0x4c')]=function(_0x292357,_0x1911d0,_0x5e0885){var _0x15928a={};var _0x47ce9c={};var _0x1b7f6c;var _0xb744c6;return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x292357[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x1911d0,null))[_0x344a('0x25')](function(_0x14921e){if(_0x14921e){_0x1b7f6c=_0x14921e;_0x47ce9c[_0x344a('0x2f')]=_[_0x344a('0x31')](db[_0x344a('0x4d')][_0x344a('0x2d')]);_0x47ce9c[_0x344a('0x30')]=_['keys'](_0x292357[_0x344a('0x30')]);_0x47ce9c[_0x344a('0x32')]=_[_0x344a('0x33')](_0x47ce9c[_0x344a('0x2f')],_0x47ce9c[_0x344a('0x30')]);_0x15928a['attributes']=_[_0x344a('0x33')](_0x47ce9c[_0x344a('0x2f')],qs[_0x344a('0x34')](_0x292357[_0x344a('0x30')]['fields']));_0x15928a[_0x344a('0x35')]=_0x15928a[_0x344a('0x35')]['length']?_0x15928a[_0x344a('0x35')]:_0x47ce9c[_0x344a('0x2f')];_0x15928a[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x292357[_0x344a('0x30')][_0x344a('0x3a')]);_0x15928a[_0x344a('0x3b')]=qs['filters'](_['pick'](_0x292357['query'],_0x47ce9c[_0x344a('0x32')]));if(_0x292357[_0x344a('0x30')][_0x344a('0x3d')]){_0x15928a[_0x344a('0x3b')]=_['merge'](_0x15928a[_0x344a('0x3b')],{'$or':_['map'](_0x15928a['attributes'],function(_0x57241e){var _0x56b562={};_0x56b562[_0x57241e]={'$like':'%'+_0x292357[_0x344a('0x30')][_0x344a('0x3d')]+'%'};return _0x56b562;})});}_0x15928a=_[_0x344a('0x3e')]({},_0x15928a,_0x292357[_0x344a('0x41')]);return _0x1b7f6c['getConfigurations'](_0x15928a);}})['then'](function(_0x56e76e){if(_0x56e76e){_0xb744c6=_0x56e76e[_0x344a('0x36')];if(!_0x292357[_0x344a('0x30')][_0x344a('0x37')](_0x344a('0x38'))){_0x15928a[_0x344a('0x1d')]=qs['limit'](_0x292357[_0x344a('0x30')][_0x344a('0x1d')]);_0x15928a[_0x344a('0x1b')]=qs['offset'](_0x292357[_0x344a('0x30')]['offset']);}return _0x1b7f6c['getConfigurations'](_0x15928a);}})[_0x344a('0x25')](function(_0x532bcf){if(_0x532bcf){return _0x532bcf?{'count':_0xb744c6,'rows':_0x532bcf}:null;}})['then'](respondWithResult(_0x1911d0,null))[_0x344a('0x46')](handleError(_0x1911d0,null));};exports[_0x344a('0x4e')]=function(_0x4f2e35,_0x1bf894,_0x5808f2){if(_0x4f2e35[_0x344a('0x4a')]['id']){delete _0x4f2e35[_0x344a('0x4a')]['id'];}return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x4f2e35['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x1bf894,null))[_0x344a('0x25')](function(_0xb4ddd7){if(_0xb4ddd7){_0x4f2e35[_0x344a('0x4a')]['AccountId']=_0xb4ddd7['id'];_0x4f2e35['body'][_0x344a('0x4f')]=integrations[_0x344a('0x50')](_0x4f2e35[_0x344a('0x4a')]['channel'],_0x4f2e35[_0x344a('0x4a')][_0x344a('0x3f')]);_0x4f2e35['body'][_0x344a('0x51')]=integrations['getDescriptions'](_0x4f2e35[_0x344a('0x4a')]['channel'],_0x4f2e35['body']['type']);return db[_0x344a('0x4d')][_0x344a('0x49')](_0x4f2e35[_0x344a('0x4a')],{'include':[{'model':db[_0x344a('0x52')],'as':_0x344a('0x4f')},{'model':db[_0x344a('0x52')],'as':'Descriptions'}]});}return null;})[_0x344a('0x25')](respondWithResult(_0x1bf894,null))[_0x344a('0x46')](handleError(_0x1bf894,null));};exports[_0x344a('0x53')]=function(_0x1c4284,_0x26688e,_0x523774){var _0x23a761='';return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x1c4284[_0x344a('0x47')]['id']},'attributes':['id',_0x344a('0x54'),_0x344a('0x55'),_0x344a('0x56'),'authType',_0x344a('0x57')]})[_0x344a('0x25')](handleEntityNotFound(_0x26688e,null))[_0x344a('0x25')](function(_0x42e1c0){if(_0x42e1c0){_0x23a761=_0x42e1c0[_0x344a('0x57')];var _0x421a09=_0x23a761[_0x344a('0x58')](-0x1);if(_0x421a09==='/'){_0x23a761=_0x23a761[_0x344a('0x59')](0x0,_0x23a761['lastIndexOf'](_0x421a09));}var _0x33113e={'method':_0x344a('0x5a'),'uri':util[_0x344a('0x5b')](_0x344a('0x5c'),_0x23a761,_0x344a('0x5d')),'json':!![]};switch(_0x42e1c0[_0x344a('0x5e')]){case _0x344a('0x55'):_0x33113e[_0x344a('0x5f')]={'Authorization':util['format'](_0x344a('0x60'),new Buffer(util[_0x344a('0x5b')](_0x344a('0x61'),_0x42e1c0[_0x344a('0x54')],_0x42e1c0['password']))[_0x344a('0x62')](_0x344a('0x63')))};break;case _0x344a('0x56'):_0x33113e[_0x344a('0x5f')]={'Authorization':util[_0x344a('0x5b')](_0x344a('0x60'),new Buffer(util[_0x344a('0x5b')](_0x344a('0x64'),_0x42e1c0['username'],_0x42e1c0[_0x344a('0x56')]))[_0x344a('0x62')](_0x344a('0x63')))};break;default:throw new db[(_0x344a('0x65'))]['ValidationError'](_0x344a('0x66'));}return rp(_0x33113e);}})[_0x344a('0x25')](function(_0x1d0025){if(_0x1d0025){var _0x2ff11d=[_0x344a('0x67'),_0x344a('0x68'),'group',_0x344a('0x69')];_[_0x344a('0x6a')](_0x1d0025[_0x344a('0x5d')],function(_0x5584d5){return _0x2ff11d[_0x344a('0x6b')](_0x5584d5[_0x344a('0x3f')]);});return{'count':_0x1d0025[_0x344a('0x5d')][_0x344a('0x36')],'rows':_[_0x344a('0x2b')](_0x1d0025['ticket_fields'],function(_0x15aadb){return{'id':_0x15aadb['id'],'name':_0x15aadb[_0x344a('0x6c')]>0x7?_0x15aadb[_0x344a('0x6d')]:_0x15aadb['type'],'custom':_0x15aadb[_0x344a('0x6c')]>0x7?!![]:![],'options':_0x15aadb['system_field_options']?_0x15aadb['system_field_options']:_0x15aadb[_0x344a('0x6e')]?_0x15aadb[_0x344a('0x6e')]:[]};})};}})[_0x344a('0x25')](respondWithResult(_0x26688e,null))[_0x344a('0x46')](function(_0x375c34){var _0x5e8df4=_0x1c4284[_0x344a('0x30')][_0x344a('0x6f')]?0x1f4:_0x375c34['statusCode']||0x1f4;logger[_0x344a('0x26')](_0x344a('0x70'),'getFields',_0x5e8df4,JSON['stringify'](_0x375c34));delete _0x375c34[_0x344a('0x28')];if(_0x5e8df4===0x191){_0x5e8df4=0x190;}_0x26688e[_0x344a('0x18')](_0x5e8df4)[_0x344a('0x29')](_0x1c4284[_0x344a('0x30')]['test']?{'message':_0x344a('0x71'),'statusCode':_0x375c34[_0x344a('0x72')]}:_0x375c34);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index df43a95..b9537cd 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 _0x31d5=['moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_zendesk_accounts','lodash','util','api'];(function(_0x1f8047,_0x422d46){var _0x4e316d=function(_0xd8b9dd){while(--_0xd8b9dd){_0x1f8047['push'](_0x1f8047['shift']());}};_0x4e316d(++_0x422d46);}(_0x31d5,0xad));var _0x531d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x31d5[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x531d('0x0'));var util=require(_0x531d('0x1'));var logger=require('../../config/logger')(_0x531d('0x2'));var moment=require(_0x531d('0x3'));var BPromise=require(_0x531d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x531d('0x5'));var rimraf=require(_0x531d('0x6'));var config=require(_0x531d('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x531d('0x8'));module[_0x531d('0x9')]=function(_0x1e8a76,_0x1eded2){return _0x1e8a76['define']('ZendeskAccount',attributes,{'tableName':_0x531d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0983=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1447c3,_0x56ee5d){var _0x36a5cd=function(_0x2a7c78){while(--_0x2a7c78){_0x1447c3['push'](_0x1447c3['shift']());}};_0x36a5cd(++_0x56ee5d);}(_0x0983,0xac));var _0x3098=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0983[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x3098('0x0'));var util=require(_0x3098('0x1'));var logger=require(_0x3098('0x2'))(_0x3098('0x3'));var moment=require(_0x3098('0x4'));var BPromise=require('bluebird');var rp=require(_0x3098('0x5'));var fs=require('fs');var path=require(_0x3098('0x6'));var rimraf=require(_0x3098('0x7'));var config=require('../../config/environment');var attributes=require(_0x3098('0x8'));var integrations=require(_0x3098('0x9'));module[_0x3098('0xa')]=function(_0x4535d5,_0x4417a6){return _0x4535d5[_0x3098('0xb')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index bcd64f3..3ad27da 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 _0x9e91=['options','where','limit','include','model','map','attributes','ShowZendeskAccount','ZendeskAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9e91,0x1ca));var _0x19e9=function(_0x13ba47,_0x1febd4){_0x13ba47=_0x13ba47-0x0;var _0x292ce5=_0x9e91[_0x13ba47];return _0x292ce5;};'use strict';var _=require(_0x19e9('0x0'));var util=require(_0x19e9('0x1'));var moment=require(_0x19e9('0x2'));var BPromise=require(_0x19e9('0x3'));var rs=require(_0x19e9('0x4'));var fs=require('fs');var Redis=require(_0x19e9('0x5'));var db=require(_0x19e9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x19e9('0x7'))(_0x19e9('0x8'));var config=require(_0x19e9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19e9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ba5f2,_0x1af28d,_0x3210fb){return new BPromise(function(_0x25dba5,_0x5f12c7){return client['request'](_0x5ba5f2,_0x3210fb)[_0x19e9('0xb')](function(_0xfbb11){logger[_0x19e9('0xc')](_0x19e9('0xd'),_0x1af28d,_0x19e9('0xe'));logger[_0x19e9('0xf')](_0x19e9('0x10'),_0x1af28d,_0x19e9('0xe'),JSON[_0x19e9('0x11')](_0xfbb11));if(_0xfbb11[_0x19e9('0x12')]){if(_0xfbb11[_0x19e9('0x12')]['code']===0x1f4){logger['error'](_0x19e9('0xd'),_0x1af28d,_0xfbb11['error'][_0x19e9('0x13')]);return _0x5f12c7(_0xfbb11[_0x19e9('0x12')][_0x19e9('0x13')]);}logger[_0x19e9('0x12')](_0x19e9('0xd'),_0x1af28d,_0xfbb11[_0x19e9('0x12')][_0x19e9('0x13')]);return _0x25dba5(_0xfbb11[_0x19e9('0x12')][_0x19e9('0x13')]);}else{logger[_0x19e9('0xc')](_0x19e9('0xd'),_0x1af28d,_0x19e9('0xe'));_0x25dba5(_0xfbb11['result'][_0x19e9('0x13')]);}})[_0x19e9('0x14')](function(_0x3575f8){logger[_0x19e9('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x1af28d,_0x3575f8);_0x5f12c7(_0x3575f8);});});}exports[_0x19e9('0x15')]=function(_0x2c241f){var _0x1aecc6=this;return new Promise(function(_0x486a77,_0x1c6417){return db['ZendeskAccount']['findAll']({'raw':_0x2c241f['options']?_0x2c241f[_0x19e9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2c241f[_0x19e9('0x16')]?_0x2c241f[_0x19e9('0x16')][_0x19e9('0x17')]||null:null,'attributes':_0x2c241f['options']?_0x2c241f[_0x19e9('0x16')]['attributes']||null:null,'limit':_0x2c241f[_0x19e9('0x16')]?_0x2c241f[_0x19e9('0x16')][_0x19e9('0x18')]||null:null,'include':_0x2c241f[_0x19e9('0x16')]?_0x2c241f['options'][_0x19e9('0x19')]?_['map'](_0x2c241f['options'][_0x19e9('0x19')],function(_0x27aeca){return{'model':db[_0x27aeca[_0x19e9('0x1a')]],'as':_0x27aeca['as'],'attributes':_0x27aeca['attributes'],'include':_0x27aeca[_0x19e9('0x19')]?_[_0x19e9('0x1b')](_0x27aeca[_0x19e9('0x19')],function(_0x222a10){return{'model':db[_0x222a10['model']],'as':_0x222a10['as'],'attributes':_0x222a10[_0x19e9('0x1c')],'include':_0x222a10[_0x19e9('0x19')]?_[_0x19e9('0x1b')](_0x222a10[_0x19e9('0x19')],function(_0x5ee146){return{'model':db[_0x5ee146[_0x19e9('0x1a')]],'as':_0x5ee146['as'],'attributes':_0x5ee146['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35de23){logger['info']('GetZendeskAccount',_0x2c241f);logger[_0x19e9('0xf')]('GetZendeskAccount',_0x2c241f,JSON[_0x19e9('0x11')](_0x35de23));_0x486a77(_0x35de23);})['catch'](function(_0x258132){logger[_0x19e9('0x12')](_0x19e9('0x15'),_0x258132[_0x19e9('0x13')],_0x2c241f);_0x1c6417(_0x1aecc6['error'](0x1f4,_0x258132[_0x19e9('0x13')]));});});};exports[_0x19e9('0x1d')]=function(_0x42587e){var _0x12b283=this;return new Promise(function(_0x55f0fb,_0x1a8c9f){return db[_0x19e9('0x1e')]['find']({'raw':_0x42587e[_0x19e9('0x16')]?_0x42587e[_0x19e9('0x16')][_0x19e9('0x1f')]===undefined?!![]:![]:!![],'where':_0x42587e[_0x19e9('0x16')]?_0x42587e[_0x19e9('0x16')][_0x19e9('0x17')]||null:null,'attributes':_0x42587e[_0x19e9('0x16')]?_0x42587e['options'][_0x19e9('0x1c')]||null:null,'include':_0x42587e['options']?_0x42587e[_0x19e9('0x16')][_0x19e9('0x19')]?_['map'](_0x42587e[_0x19e9('0x16')][_0x19e9('0x19')],function(_0x5172cc){return{'model':db[_0x5172cc[_0x19e9('0x1a')]],'as':_0x5172cc['as'],'attributes':_0x5172cc[_0x19e9('0x1c')],'include':_0x5172cc[_0x19e9('0x19')]?_['map'](_0x5172cc[_0x19e9('0x19')],function(_0x324cca){return{'model':db[_0x324cca[_0x19e9('0x1a')]],'as':_0x324cca['as'],'attributes':_0x324cca[_0x19e9('0x1c')],'include':_0x324cca[_0x19e9('0x19')]?_[_0x19e9('0x1b')](_0x324cca[_0x19e9('0x19')],function(_0x110d7c){return{'model':db[_0x110d7c['model']],'as':_0x110d7c['as'],'attributes':_0x110d7c[_0x19e9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x19e9('0xb')](function(_0x416794){logger['info'](_0x19e9('0x1d'),_0x42587e);logger['debug'](_0x19e9('0x1d'),_0x42587e,JSON['stringify'](_0x416794));_0x55f0fb(_0x416794);})[_0x19e9('0x14')](function(_0x3c19ee){logger[_0x19e9('0x12')](_0x19e9('0x1d'),_0x3c19ee['message'],_0x42587e);_0x1a8c9f(_0x12b283[_0x19e9('0x12')](0x1f4,_0x3c19ee['message']));});});}; \ No newline at end of file +var _0x473a=['limit','include','model','map','then','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird','ioredis','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','options','raw','where','attributes'];(function(_0x5a2404,_0x6b350d){var _0x346d09=function(_0x132061){while(--_0x132061){_0x5a2404['push'](_0x5a2404['shift']());}};_0x346d09(++_0x6b350d);}(_0x473a,0x173));var _0xa473=function(_0x59094c,_0x2e9005){_0x59094c=_0x59094c-0x0;var _0x40742f=_0x473a[_0x59094c];return _0x40742f;};'use strict';var _=require(_0xa473('0x0'));var util=require(_0xa473('0x1'));var moment=require(_0xa473('0x2'));var BPromise=require(_0xa473('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa473('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa473('0x5'));var client=jayson[_0xa473('0x6')][_0xa473('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x299a2e,_0x312952,_0x2e5de8){return new BPromise(function(_0x34192a,_0x3882ff){return client[_0xa473('0x8')](_0x299a2e,_0x2e5de8)['then'](function(_0x477d37){logger[_0xa473('0x9')](_0xa473('0xa'),_0x312952,_0xa473('0xb'));logger[_0xa473('0xc')](_0xa473('0xd'),_0x312952,_0xa473('0xb'),JSON[_0xa473('0xe')](_0x477d37));if(_0x477d37[_0xa473('0xf')]){if(_0x477d37['error'][_0xa473('0x10')]===0x1f4){logger[_0xa473('0xf')](_0xa473('0xa'),_0x312952,_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);return _0x3882ff(_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);}logger[_0xa473('0xf')](_0xa473('0xa'),_0x312952,_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);return _0x34192a(_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);}else{logger[_0xa473('0x9')](_0xa473('0xa'),_0x312952,'request\x20sent');_0x34192a(_0x477d37[_0xa473('0x12')][_0xa473('0x11')]);}})[_0xa473('0x13')](function(_0x356881){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x312952,_0x356881);_0x3882ff(_0x356881);});});}exports[_0xa473('0x14')]=function(_0x25be68){var _0x1c9f26=this;return new Promise(function(_0x420754,_0x2ab2a3){return db['ZendeskAccount']['findAll']({'raw':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x16')]===undefined?!![]:![]:!![],'where':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x17')]||null:null,'attributes':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x18')]||null:null,'limit':_0x25be68['options']?_0x25be68[_0xa473('0x15')][_0xa473('0x19')]||null:null,'include':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x1a')]?_['map'](_0x25be68['options'][_0xa473('0x1a')],function(_0x39a19b){return{'model':db[_0x39a19b[_0xa473('0x1b')]],'as':_0x39a19b['as'],'attributes':_0x39a19b['attributes'],'include':_0x39a19b[_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x39a19b[_0xa473('0x1a')],function(_0x36cf4a){return{'model':db[_0x36cf4a[_0xa473('0x1b')]],'as':_0x36cf4a['as'],'attributes':_0x36cf4a[_0xa473('0x18')],'include':_0x36cf4a['include']?_[_0xa473('0x1c')](_0x36cf4a[_0xa473('0x1a')],function(_0x39a089){return{'model':db[_0x39a089['model']],'as':_0x39a089['as'],'attributes':_0x39a089[_0xa473('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa473('0x1d')](function(_0x5258c6){logger['info'](_0xa473('0x14'),_0x25be68);logger[_0xa473('0xc')](_0xa473('0x14'),_0x25be68,JSON[_0xa473('0xe')](_0x5258c6));_0x420754(_0x5258c6);})[_0xa473('0x13')](function(_0x1657bf){logger[_0xa473('0xf')](_0xa473('0x14'),_0x1657bf[_0xa473('0x11')],_0x25be68);_0x2ab2a3(_0x1c9f26[_0xa473('0xf')](0x1f4,_0x1657bf[_0xa473('0x11')]));});});};exports[_0xa473('0x1e')]=function(_0x29f470){var _0x5610a2=this;return new Promise(function(_0x55f365,_0x1b894b){return db[_0xa473('0x1f')][_0xa473('0x20')]({'raw':_0x29f470[_0xa473('0x15')]?_0x29f470[_0xa473('0x15')][_0xa473('0x16')]===undefined?!![]:![]:!![],'where':_0x29f470[_0xa473('0x15')]?_0x29f470[_0xa473('0x15')][_0xa473('0x17')]||null:null,'attributes':_0x29f470[_0xa473('0x15')]?_0x29f470['options'][_0xa473('0x18')]||null:null,'include':_0x29f470[_0xa473('0x15')]?_0x29f470['options'][_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x29f470[_0xa473('0x15')][_0xa473('0x1a')],function(_0x3298c6){return{'model':db[_0x3298c6['model']],'as':_0x3298c6['as'],'attributes':_0x3298c6['attributes'],'include':_0x3298c6[_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x3298c6[_0xa473('0x1a')],function(_0x597aca){return{'model':db[_0x597aca['model']],'as':_0x597aca['as'],'attributes':_0x597aca[_0xa473('0x18')],'include':_0x597aca[_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x597aca[_0xa473('0x1a')],function(_0x13207d){return{'model':db[_0x13207d['model']],'as':_0x13207d['as'],'attributes':_0x13207d[_0xa473('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa473('0x1d')](function(_0x586ad0){logger['info'](_0xa473('0x1e'),_0x29f470);logger['debug'](_0xa473('0x1e'),_0x29f470,JSON[_0xa473('0xe')](_0x586ad0));_0x55f365(_0x586ad0);})[_0xa473('0x13')](function(_0x438166){logger[_0xa473('0xf')](_0xa473('0x1e'),_0x438166[_0xa473('0x11')],_0x29f470);_0x1b894b(_0x5610a2['error'](0x1f4,_0x438166[_0xa473('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 8a482f8..2b87108 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 _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x45dc60,_0x5b6ac7){var _0x3765ba=function(_0x2e9586){while(--_0x2e9586){_0x45dc60['push'](_0x45dc60['shift']());}};_0x3765ba(++_0x5b6ac7);}(_0xac4a,0x13f));var _0xaac4=function(_0x38b3da,_0x401707){_0x38b3da=_0x38b3da-0x0;var _0x5cd29c=_0xac4a[_0x38b3da];return _0x5cd29c;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file +var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x150345,_0x3900ce){var _0x542721=function(_0xb8e2a9){while(--_0xb8e2a9){_0x150345['push'](_0x150345['shift']());}};_0x542721(++_0x3900ce);}(_0x750a,0x140));var _0xa750=function(_0x3547f5,_0x594b3c){_0x3547f5=_0x3547f5-0x0;var _0x24107c=_0x750a[_0x3547f5];return _0x24107c;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index cc3279d..96f2ee9 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 _0x6dfd=['sequelize','exports','STRING'];(function(_0x2ece52,_0x538ee5){var _0x585ea8=function(_0x528662){while(--_0x528662){_0x2ece52['push'](_0x2ece52['shift']());}};_0x585ea8(++_0x538ee5);}(_0x6dfd,0xe7));var _0xd6df=function(_0x502dc0,_0x453077){_0x502dc0=_0x502dc0-0x0;var _0xf92904=_0x6dfd[_0x502dc0];return _0xf92904;};'use strict';var Sequelize=require(_0xd6df('0x0'));module[_0xd6df('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6df('0x2')]}}; \ No newline at end of file +var _0xbc23=['STRING','sequelize','exports'];(function(_0x39ae3f,_0x221a90){var _0x1a320a=function(_0x22b3d3){while(--_0x22b3d3){_0x39ae3f['push'](_0x39ae3f['shift']());}};_0x1a320a(++_0x221a90);}(_0xbc23,0xeb));var _0x3bc2=function(_0x5764ce,_0xeebd){_0x5764ce=_0x5764ce-0x0;var _0x396561=_0xbc23[_0x5764ce];return _0x396561;};'use strict';var Sequelize=require(_0x3bc2('0x0'));module[_0x3bc2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3bc2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 42b9cf0..6b781de 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 _0x3208=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','ZendeskField','sort','getFields','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x3208,0x69));var _0x8320=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3208[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x8320('0x0'));var rimraf=require(_0x8320('0x1'));var zipdir=require(_0x8320('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8320('0x3'));var Mustache=require(_0x8320('0x4'));var util=require(_0x8320('0x5'));var path=require('path');var sox=require(_0x8320('0x6'));var csv=require(_0x8320('0x7'));var ejs=require(_0x8320('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8320('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8320('0xa'));var deskjs=require(_0x8320('0xb'));var toCsv=require(_0x8320('0x7'));var querystring=require(_0x8320('0xc'));var Papa=require(_0x8320('0xd'));var Redis=require(_0x8320('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8320('0xf'));var as=require(_0x8320('0x10'));var hardwareService=require(_0x8320('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8320('0x12'));var config=require(_0x8320('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8320('0x14'))['db'];function respondWithStatusCode(_0x55243a,_0x24c49e){_0x24c49e=_0x24c49e||0xcc;return function(_0x287dba){if(_0x287dba){return _0x55243a[_0x8320('0x15')](_0x24c49e);}return _0x55243a[_0x8320('0x16')](_0x24c49e)[_0x8320('0x17')]();};}function respondWithResult(_0x5bd3db,_0x20d706){_0x20d706=_0x20d706||0xc8;return function(_0x1842a1){if(_0x1842a1){return _0x5bd3db[_0x8320('0x16')](_0x20d706)[_0x8320('0x18')](_0x1842a1);}};}function respondWithFilteredResult(_0x22cfc8,_0xe9b2f2){return function(_0x4bd847){if(_0x4bd847){var _0x3e358a=typeof _0xe9b2f2[_0x8320('0x19')]==='undefined'&&typeof _0xe9b2f2['limit']===_0x8320('0x1a');var _0x181fce=_0x4bd847[_0x8320('0x1b')];var _0x25b374=_0x3e358a?0x0:_0xe9b2f2[_0x8320('0x19')];var _0x357837=_0x3e358a?_0x4bd847['count']:_0xe9b2f2[_0x8320('0x19')]+_0xe9b2f2[_0x8320('0x1c')];var _0x58b5d7;if(_0x357837>=_0x181fce){_0x357837=_0x181fce;_0x58b5d7=0xc8;}else{_0x58b5d7=0xce;}_0x22cfc8['status'](_0x58b5d7);return _0x22cfc8[_0x8320('0x1d')](_0x8320('0x1e'),_0x25b374+'-'+_0x357837+'/'+_0x181fce)[_0x8320('0x18')](_0x4bd847);}return null;};}function patchUpdates(_0x5f5b77){return function(_0x4cda61){try{jsonpatch['apply'](_0x4cda61,_0x5f5b77,!![]);}catch(_0x23dbd2){return BPromise[_0x8320('0x1f')](_0x23dbd2);}return _0x4cda61[_0x8320('0x20')]();};}function saveUpdates(_0x4a8662,_0x4857c3){return function(_0x29c037){if(_0x29c037){return _0x29c037[_0x8320('0x21')](_0x4a8662)[_0x8320('0x22')](function(_0x5d0a70){return _0x5d0a70;});}return null;};}function removeEntity(_0x125a1d,_0x10fb42){return function(_0x1b9d1c){if(_0x1b9d1c){return _0x1b9d1c['destroy']()['then'](function(){_0x125a1d[_0x8320('0x16')](0xcc)[_0x8320('0x17')]();});}};}function handleEntityNotFound(_0x2baf08,_0x483e32){return function(_0x3fb174){if(!_0x3fb174){_0x2baf08[_0x8320('0x15')](0x194);}return _0x3fb174;};}function handleError(_0xbc9f77,_0x480084){_0x480084=_0x480084||0x1f4;return function(_0x3757e6){logger[_0x8320('0x23')](_0x3757e6[_0x8320('0x24')]);if(_0x3757e6[_0x8320('0x25')]){delete _0x3757e6[_0x8320('0x25')];}_0xbc9f77[_0x8320('0x16')](_0x480084)['send'](_0x3757e6);};}exports[_0x8320('0x26')]=function(_0x30ebe5,_0x2f18b2){var _0x51c687={},_0x10fff9={},_0x448b5d={'count':0x0,'rows':[]};var _0x6fb03a=_[_0x8320('0x27')](db[_0x8320('0x28')][_0x8320('0x29')],function(_0x2623a9){return{'name':_0x2623a9['fieldName'],'type':_0x2623a9[_0x8320('0x2a')][_0x8320('0x2b')]};});_0x10fff9[_0x8320('0x2c')]=_['map'](_0x6fb03a,_0x8320('0x25'));_0x10fff9[_0x8320('0x2d')]=_['keys'](_0x30ebe5[_0x8320('0x2d')]);_0x10fff9[_0x8320('0x2e')]=_[_0x8320('0x2f')](_0x10fff9[_0x8320('0x2c')],_0x10fff9['query']);_0x51c687['attributes']=_[_0x8320('0x2f')](_0x10fff9[_0x8320('0x2c')],qs[_0x8320('0x30')](_0x30ebe5[_0x8320('0x2d')]['fields']));_0x51c687['attributes']=_0x51c687[_0x8320('0x31')][_0x8320('0x32')]?_0x51c687['attributes']:_0x10fff9[_0x8320('0x2c')];if(!_0x30ebe5[_0x8320('0x2d')][_0x8320('0x33')](_0x8320('0x34'))){_0x51c687['limit']=qs[_0x8320('0x1c')](_0x30ebe5[_0x8320('0x2d')][_0x8320('0x1c')]);_0x51c687[_0x8320('0x19')]=qs[_0x8320('0x19')](_0x30ebe5[_0x8320('0x2d')]['offset']);}_0x51c687['order']=qs['sort'](_0x30ebe5[_0x8320('0x2d')]['sort']);_0x51c687[_0x8320('0x35')]=qs[_0x8320('0x2e')](_[_0x8320('0x36')](_0x30ebe5['query'],_0x10fff9[_0x8320('0x2e')]),_0x6fb03a);if(_0x30ebe5['query'][_0x8320('0x37')]){_0x51c687['where']=_[_0x8320('0x38')](_0x51c687[_0x8320('0x35')],{'$or':_[_0x8320('0x27')](_0x6fb03a,function(_0x512e2d){if(_0x512e2d[_0x8320('0x2a')]!==_0x8320('0x39')){var _0x3b1186={};_0x3b1186[_0x512e2d[_0x8320('0x25')]]={'$like':'%'+_0x30ebe5[_0x8320('0x2d')][_0x8320('0x37')]+'%'};return _0x3b1186;}})});}_0x51c687=_[_0x8320('0x38')]({},_0x51c687,_0x30ebe5[_0x8320('0x3a')]);var _0x21b458={'where':_0x51c687['where']};return db[_0x8320('0x28')][_0x8320('0x1b')](_0x21b458)[_0x8320('0x22')](function(_0x57ed10){_0x448b5d[_0x8320('0x1b')]=_0x57ed10;if(_0x30ebe5[_0x8320('0x2d')][_0x8320('0x3b')]){_0x51c687[_0x8320('0x3c')]=[{'all':!![]}];}return db[_0x8320('0x28')][_0x8320('0x3d')](_0x51c687);})['then'](function(_0x4e9e61){_0x448b5d[_0x8320('0x3e')]=_0x4e9e61;return _0x448b5d;})['then'](respondWithFilteredResult(_0x2f18b2,_0x51c687))[_0x8320('0x3f')](handleError(_0x2f18b2,null));};exports[_0x8320('0x40')]=function(_0x212133,_0x184a0c){var _0x37a21b={'raw':![],'where':{'id':_0x212133[_0x8320('0x41')]['id']}},_0x10c4f0={};_0x10c4f0[_0x8320('0x2c')]=_['keys'](db['ZendeskConfiguration'][_0x8320('0x29')]);_0x10c4f0[_0x8320('0x2d')]=_[_0x8320('0x42')](_0x212133[_0x8320('0x2d')]);_0x10c4f0[_0x8320('0x2e')]=_[_0x8320('0x2f')](_0x10c4f0[_0x8320('0x2c')],_0x10c4f0[_0x8320('0x2d')]);_0x37a21b[_0x8320('0x31')]=_[_0x8320('0x2f')](_0x10c4f0[_0x8320('0x2c')],qs[_0x8320('0x30')](_0x212133[_0x8320('0x2d')][_0x8320('0x30')]));_0x37a21b['attributes']=_0x37a21b[_0x8320('0x31')][_0x8320('0x32')]?_0x37a21b[_0x8320('0x31')]:_0x10c4f0[_0x8320('0x2c')];if(_0x212133[_0x8320('0x2d')]['includeAll']){_0x37a21b['include']=[{'all':!![]}];}_0x37a21b=_[_0x8320('0x38')]({},_0x37a21b,_0x212133[_0x8320('0x3a')]);return db[_0x8320('0x28')][_0x8320('0x43')](_0x37a21b)[_0x8320('0x22')](handleEntityNotFound(_0x184a0c,null))[_0x8320('0x22')](respondWithResult(_0x184a0c,null))[_0x8320('0x3f')](handleError(_0x184a0c,null));};exports[_0x8320('0x44')]=function(_0x46ead4,_0x3dd201){return db['ZendeskConfiguration'][_0x8320('0x44')](_0x46ead4[_0x8320('0x45')],{})['then'](respondWithResult(_0x3dd201,0xc9))[_0x8320('0x3f')](handleError(_0x3dd201,null));};exports[_0x8320('0x21')]=function(_0x4aa608,_0x60743){if(_0x4aa608['body']['id']){delete _0x4aa608[_0x8320('0x45')]['id'];}return db[_0x8320('0x28')][_0x8320('0x43')]({'where':{'id':_0x4aa608['params']['id']}})[_0x8320('0x22')](handleEntityNotFound(_0x60743,null))['then'](saveUpdates(_0x4aa608[_0x8320('0x45')],null))[_0x8320('0x22')](respondWithResult(_0x60743,null))['catch'](handleError(_0x60743,null));};exports['destroy']=function(_0x13b154,_0x107277){return db[_0x8320('0x28')][_0x8320('0x43')]({'where':{'id':_0x13b154['params']['id']}})['then'](handleEntityNotFound(_0x107277,null))[_0x8320('0x22')](removeEntity(_0x107277,null))[_0x8320('0x3f')](handleError(_0x107277,null));};exports['getFields']=function(_0xbb619a,_0x36b84c,_0xc6a026){var _0x49dfa6={};var _0x2d69a7={};var _0x39cd01;var _0xdfece7;return db[_0x8320('0x28')][_0x8320('0x46')]({'where':{'id':_0xbb619a[_0x8320('0x41')]['id']}})['then'](handleEntityNotFound(_0x36b84c,null))['then'](function(_0xa2f41b){if(_0xa2f41b){_0x39cd01=_0xa2f41b;_0x2d69a7[_0x8320('0x2c')]=_[_0x8320('0x42')](db[_0x8320('0x47')][_0x8320('0x29')]);_0x2d69a7[_0x8320('0x2d')]=_['keys'](_0xbb619a[_0x8320('0x2d')]);_0x2d69a7[_0x8320('0x2e')]=_[_0x8320('0x2f')](_0x2d69a7[_0x8320('0x2c')],_0x2d69a7[_0x8320('0x2d')]);_0x49dfa6['attributes']=_[_0x8320('0x2f')](_0x2d69a7[_0x8320('0x2c')],qs[_0x8320('0x30')](_0xbb619a[_0x8320('0x2d')][_0x8320('0x30')]));_0x49dfa6[_0x8320('0x31')]=_0x49dfa6[_0x8320('0x31')][_0x8320('0x32')]?_0x49dfa6[_0x8320('0x31')]:_0x2d69a7[_0x8320('0x2c')];_0x49dfa6['order']=qs[_0x8320('0x48')](_0xbb619a[_0x8320('0x2d')]['sort']);_0x49dfa6[_0x8320('0x35')]=qs[_0x8320('0x2e')](_[_0x8320('0x36')](_0xbb619a[_0x8320('0x2d')],_0x2d69a7[_0x8320('0x2e')]));if(_0xbb619a['query']['filter']){_0x49dfa6['where']=_['merge'](_0x49dfa6[_0x8320('0x35')],{'$or':_[_0x8320('0x27')](_0x49dfa6[_0x8320('0x31')],function(_0x10000c){var _0x330854={};_0x330854[_0x10000c]={'$like':'%'+_0xbb619a[_0x8320('0x2d')][_0x8320('0x37')]+'%'};return _0x330854;})});}_0x49dfa6=_[_0x8320('0x38')]({},_0x49dfa6,_0xbb619a[_0x8320('0x3a')]);return _0x39cd01['getFields'](_0x49dfa6);}})[_0x8320('0x22')](function(_0x39ae56){if(_0x39ae56){_0xdfece7=_0x39ae56[_0x8320('0x32')];if(!_0xbb619a['query'][_0x8320('0x33')](_0x8320('0x34'))){_0x49dfa6[_0x8320('0x1c')]=qs[_0x8320('0x1c')](_0xbb619a[_0x8320('0x2d')][_0x8320('0x1c')]);_0x49dfa6['offset']=qs[_0x8320('0x19')](_0xbb619a['query']['offset']);}return _0x39cd01[_0x8320('0x49')](_0x49dfa6);}})[_0x8320('0x22')](function(_0x412e55){if(_0x412e55){return _0x412e55?{'count':_0xdfece7,'rows':_0x412e55}:null;}})[_0x8320('0x22')](respondWithResult(_0x36b84c,null))[_0x8320('0x3f')](handleError(_0x36b84c,null));};exports[_0x8320('0x4a')]=function(_0x448f5b,_0x75fef5,_0x467ec3){var _0x61409c={};var _0x19dc05={};var _0x2fb8e8;var _0x22fedd;return db[_0x8320('0x28')][_0x8320('0x46')]({'where':{'id':_0x448f5b[_0x8320('0x41')]['id']}})[_0x8320('0x22')](handleEntityNotFound(_0x75fef5,null))[_0x8320('0x22')](function(_0x379c83){if(_0x379c83){_0x2fb8e8=_0x379c83;_0x19dc05[_0x8320('0x2c')]=_['keys'](db['ZendeskField'][_0x8320('0x29')]);_0x19dc05['query']=_[_0x8320('0x42')](_0x448f5b[_0x8320('0x2d')]);_0x19dc05[_0x8320('0x2e')]=_[_0x8320('0x2f')](_0x19dc05['model'],_0x19dc05[_0x8320('0x2d')]);_0x61409c[_0x8320('0x31')]=_[_0x8320('0x2f')](_0x19dc05['model'],qs[_0x8320('0x30')](_0x448f5b[_0x8320('0x2d')]['fields']));_0x61409c['attributes']=_0x61409c[_0x8320('0x31')][_0x8320('0x32')]?_0x61409c[_0x8320('0x31')]:_0x19dc05[_0x8320('0x2c')];_0x61409c[_0x8320('0x4b')]=qs[_0x8320('0x48')](_0x448f5b[_0x8320('0x2d')][_0x8320('0x48')]);_0x61409c[_0x8320('0x35')]=qs[_0x8320('0x2e')](_['pick'](_0x448f5b[_0x8320('0x2d')],_0x19dc05[_0x8320('0x2e')]));if(_0x448f5b[_0x8320('0x2d')][_0x8320('0x37')]){_0x61409c['where']=_['merge'](_0x61409c[_0x8320('0x35')],{'$or':_['map'](_0x61409c[_0x8320('0x31')],function(_0x102450){var _0x43916e={};_0x43916e[_0x102450]={'$like':'%'+_0x448f5b[_0x8320('0x2d')][_0x8320('0x37')]+'%'};return _0x43916e;})});}_0x61409c=_[_0x8320('0x38')]({},_0x61409c,_0x448f5b['options']);return _0x2fb8e8[_0x8320('0x4a')](_0x61409c);}})[_0x8320('0x22')](function(_0x480f70){if(_0x480f70){_0x22fedd=_0x480f70[_0x8320('0x32')];if(!_0x448f5b[_0x8320('0x2d')][_0x8320('0x33')](_0x8320('0x34'))){_0x61409c[_0x8320('0x1c')]=qs[_0x8320('0x1c')](_0x448f5b[_0x8320('0x2d')][_0x8320('0x1c')]);_0x61409c['offset']=qs['offset'](_0x448f5b[_0x8320('0x2d')]['offset']);}return _0x2fb8e8[_0x8320('0x4a')](_0x61409c);}})[_0x8320('0x22')](function(_0x14d406){if(_0x14d406){return _0x14d406?{'count':_0x22fedd,'rows':_0x14d406}:null;}})[_0x8320('0x22')](respondWithResult(_0x75fef5,null))[_0x8320('0x3f')](handleError(_0x75fef5,null));};exports[_0x8320('0x4c')]=function(_0x3489eb,_0x1a8045,_0x955ca9){var _0x413c07={};var _0x2a2b78={};var _0x1928b6;var _0x50c053;return db[_0x8320('0x28')]['findOne']({'where':{'id':_0x3489eb[_0x8320('0x41')]['id']}})[_0x8320('0x22')](handleEntityNotFound(_0x1a8045,null))[_0x8320('0x22')](function(_0x480e69){if(_0x480e69){_0x1928b6=_0x480e69;_0x2a2b78[_0x8320('0x2c')]=_[_0x8320('0x42')](db[_0x8320('0x47')][_0x8320('0x29')]);_0x2a2b78[_0x8320('0x2d')]=_[_0x8320('0x42')](_0x3489eb[_0x8320('0x2d')]);_0x2a2b78[_0x8320('0x2e')]=_[_0x8320('0x2f')](_0x2a2b78['model'],_0x2a2b78[_0x8320('0x2d')]);_0x413c07[_0x8320('0x31')]=_['intersection'](_0x2a2b78[_0x8320('0x2c')],qs[_0x8320('0x30')](_0x3489eb[_0x8320('0x2d')]['fields']));_0x413c07[_0x8320('0x31')]=_0x413c07[_0x8320('0x31')][_0x8320('0x32')]?_0x413c07[_0x8320('0x31')]:_0x2a2b78[_0x8320('0x2c')];_0x413c07['order']=qs[_0x8320('0x48')](_0x3489eb[_0x8320('0x2d')][_0x8320('0x48')]);_0x413c07[_0x8320('0x35')]=qs[_0x8320('0x2e')](_['pick'](_0x3489eb['query'],_0x2a2b78[_0x8320('0x2e')]));if(_0x3489eb[_0x8320('0x2d')][_0x8320('0x37')]){_0x413c07[_0x8320('0x35')]=_['merge'](_0x413c07['where'],{'$or':_[_0x8320('0x27')](_0x413c07[_0x8320('0x31')],function(_0x30f2ba){var _0x39fa51={};_0x39fa51[_0x30f2ba]={'$like':'%'+_0x3489eb[_0x8320('0x2d')]['filter']+'%'};return _0x39fa51;})});}_0x413c07=_[_0x8320('0x38')]({},_0x413c07,_0x3489eb[_0x8320('0x3a')]);return _0x1928b6['getDescriptions'](_0x413c07);}})[_0x8320('0x22')](function(_0x16c145){if(_0x16c145){_0x50c053=_0x16c145[_0x8320('0x32')];if(!_0x3489eb[_0x8320('0x2d')][_0x8320('0x33')](_0x8320('0x34'))){_0x413c07[_0x8320('0x1c')]=qs[_0x8320('0x1c')](_0x3489eb['query']['limit']);_0x413c07['offset']=qs[_0x8320('0x19')](_0x3489eb[_0x8320('0x2d')][_0x8320('0x19')]);}return _0x1928b6['getDescriptions'](_0x413c07);}})[_0x8320('0x22')](function(_0x45534e){if(_0x45534e){return _0x45534e?{'count':_0x50c053,'rows':_0x45534e}:null;}})['then'](respondWithResult(_0x1a8045,null))[_0x8320('0x3f')](handleError(_0x1a8045,null));};exports[_0x8320('0x4d')]=function(_0x195e64,_0x5a7ecd,_0xa3fe33){var _0x58d024={};var _0x577a78={};var _0x54185d;var _0x475d9e;return db[_0x8320('0x28')]['findOne']({'where':{'id':_0x195e64[_0x8320('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a7ecd,null))['then'](function(_0x5aad96){if(_0x5aad96){_0x54185d=_0x5aad96;_0x577a78[_0x8320('0x2c')]=_[_0x8320('0x42')](db[_0x8320('0x4e')][_0x8320('0x29')]);_0x577a78['query']=_[_0x8320('0x42')](_0x195e64[_0x8320('0x2d')]);_0x577a78[_0x8320('0x2e')]=_['intersection'](_0x577a78['model'],_0x577a78[_0x8320('0x2d')]);_0x58d024[_0x8320('0x31')]=_[_0x8320('0x2f')](_0x577a78[_0x8320('0x2c')],qs['fields'](_0x195e64[_0x8320('0x2d')]['fields']));_0x58d024['attributes']=_0x58d024[_0x8320('0x31')]['length']?_0x58d024[_0x8320('0x31')]:_0x577a78['model'];_0x58d024['order']=qs[_0x8320('0x48')](_0x195e64[_0x8320('0x2d')][_0x8320('0x48')]);_0x58d024[_0x8320('0x35')]=qs['filters'](_[_0x8320('0x36')](_0x195e64[_0x8320('0x2d')],_0x577a78[_0x8320('0x2e')]));if(_0x195e64[_0x8320('0x2d')]['filter']){_0x58d024[_0x8320('0x35')]=_['merge'](_0x58d024['where'],{'$or':_[_0x8320('0x27')](_0x58d024[_0x8320('0x31')],function(_0x47fba9){var _0x17b9aa={};_0x17b9aa[_0x47fba9]={'$like':'%'+_0x195e64[_0x8320('0x2d')][_0x8320('0x37')]+'%'};return _0x17b9aa;})});}_0x58d024=_[_0x8320('0x38')]({},_0x58d024,_0x195e64[_0x8320('0x3a')]);return _0x54185d['getTags'](_0x58d024);}})[_0x8320('0x22')](function(_0x5b8284){if(_0x5b8284){_0x475d9e=_0x5b8284[_0x8320('0x32')];if(!_0x195e64[_0x8320('0x2d')][_0x8320('0x33')]('nolimit')){_0x58d024[_0x8320('0x1c')]=qs[_0x8320('0x1c')](_0x195e64[_0x8320('0x2d')][_0x8320('0x1c')]);_0x58d024[_0x8320('0x19')]=qs[_0x8320('0x19')](_0x195e64['query'][_0x8320('0x19')]);}return _0x54185d[_0x8320('0x4d')](_0x58d024);}})[_0x8320('0x22')](function(_0x36d649){if(_0x36d649){return _0x36d649?{'count':_0x475d9e,'rows':_0x36d649}:null;}})[_0x8320('0x22')](respondWithResult(_0x5a7ecd,null))[_0x8320('0x3f')](handleError(_0x5a7ecd,null));};exports[_0x8320('0x4f')]=function(_0x37fd8c,_0x45826d,_0x4124dd){if(_0x37fd8c[_0x8320('0x45')]['id']){delete _0x37fd8c[_0x8320('0x45')]['id'];}return db[_0x8320('0x28')][_0x8320('0x46')]({'where':{'id':_0x37fd8c[_0x8320('0x41')]['id']}})[_0x8320('0x22')](handleEntityNotFound(_0x45826d,null))[_0x8320('0x22')](function(_0x3b155b){if(_0x3b155b){return _0x3b155b[_0x8320('0x4f')](_0x37fd8c[_0x8320('0x45')][_0x8320('0x50')]||[]);}return null;})[_0x8320('0x22')](respondWithResult(_0x45826d,null))[_0x8320('0x3f')](handleError(_0x45826d,null));}; \ No newline at end of file +var _0x3ca5=['keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ZendeskConfiguration','includeAll','include','findAll','catch','params','find','create','body','findOne','ZendeskField','hasOwnProperty','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query'];(function(_0x123ac9,_0x280c3a){var _0x3cc049=function(_0x3ca601){while(--_0x3ca601){_0x123ac9['push'](_0x123ac9['shift']());}};_0x3cc049(++_0x280c3a);}(_0x3ca5,0x127));var _0x53ca=function(_0x1ae06f,_0x5c74dd){_0x1ae06f=_0x1ae06f-0x0;var _0x4adf01=_0x3ca5[_0x1ae06f];return _0x4adf01;};'use strict';var emlformat=require(_0x53ca('0x0'));var rimraf=require(_0x53ca('0x1'));var zipdir=require(_0x53ca('0x2'));var jsonpatch=require(_0x53ca('0x3'));var rp=require('request-promise');var moment=require(_0x53ca('0x4'));var BPromise=require(_0x53ca('0x5'));var Mustache=require(_0x53ca('0x6'));var util=require(_0x53ca('0x7'));var path=require(_0x53ca('0x8'));var sox=require(_0x53ca('0x9'));var csv=require('to-csv');var ejs=require(_0x53ca('0xa'));var fs=require('fs');var fs_extra=require(_0x53ca('0xb'));var _=require(_0x53ca('0xc'));var squel=require(_0x53ca('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53ca('0xe'));var toCsv=require('to-csv');var querystring=require(_0x53ca('0xf'));var Papa=require(_0x53ca('0x10'));var Redis=require('ioredis');var authService=require(_0x53ca('0x11'));var qs=require(_0x53ca('0x12'));var as=require(_0x53ca('0x13'));var hardwareService=require(_0x53ca('0x14'));var logger=require(_0x53ca('0x15'))(_0x53ca('0x16'));var utils=require(_0x53ca('0x17'));var config=require(_0x53ca('0x18'));var licenseUtil=require(_0x53ca('0x19'));var db=require(_0x53ca('0x1a'))['db'];function respondWithStatusCode(_0x68d9fd,_0xf413ca){_0xf413ca=_0xf413ca||0xcc;return function(_0x46dd0b){if(_0x46dd0b){return _0x68d9fd[_0x53ca('0x1b')](_0xf413ca);}return _0x68d9fd['status'](_0xf413ca)[_0x53ca('0x1c')]();};}function respondWithResult(_0x572728,_0x35aaed){_0x35aaed=_0x35aaed||0xc8;return function(_0x1dba72){if(_0x1dba72){return _0x572728[_0x53ca('0x1d')](_0x35aaed)['json'](_0x1dba72);}};}function respondWithFilteredResult(_0x2e1688,_0x469836){return function(_0x4bb63d){if(_0x4bb63d){var _0x2d7377=typeof _0x469836[_0x53ca('0x1e')]===_0x53ca('0x1f')&&typeof _0x469836[_0x53ca('0x20')]===_0x53ca('0x1f');var _0x3ca2a0=_0x4bb63d[_0x53ca('0x21')];var _0x10f3ce=_0x2d7377?0x0:_0x469836[_0x53ca('0x1e')];var _0x35127d=_0x2d7377?_0x4bb63d[_0x53ca('0x21')]:_0x469836['offset']+_0x469836[_0x53ca('0x20')];var _0x4178df;if(_0x35127d>=_0x3ca2a0){_0x35127d=_0x3ca2a0;_0x4178df=0xc8;}else{_0x4178df=0xce;}_0x2e1688['status'](_0x4178df);return _0x2e1688[_0x53ca('0x22')](_0x53ca('0x23'),_0x10f3ce+'-'+_0x35127d+'/'+_0x3ca2a0)[_0x53ca('0x24')](_0x4bb63d);}return null;};}function patchUpdates(_0x269e79){return function(_0x296543){try{jsonpatch[_0x53ca('0x25')](_0x296543,_0x269e79,!![]);}catch(_0x30a979){return BPromise[_0x53ca('0x26')](_0x30a979);}return _0x296543[_0x53ca('0x27')]();};}function saveUpdates(_0x2e9408,_0x4051be){return function(_0x41b657){if(_0x41b657){return _0x41b657[_0x53ca('0x28')](_0x2e9408)[_0x53ca('0x29')](function(_0x5457f3){return _0x5457f3;});}return null;};}function removeEntity(_0x523a29,_0x4a2012){return function(_0x4be650){if(_0x4be650){return _0x4be650[_0x53ca('0x2a')]()[_0x53ca('0x29')](function(){_0x523a29[_0x53ca('0x1d')](0xcc)[_0x53ca('0x1c')]();});}};}function handleEntityNotFound(_0x358fa4,_0x112086){return function(_0x5de0b3){if(!_0x5de0b3){_0x358fa4['sendStatus'](0x194);}return _0x5de0b3;};}function handleError(_0x331a15,_0x4ed261){_0x4ed261=_0x4ed261||0x1f4;return function(_0xaee574){logger[_0x53ca('0x2b')](_0xaee574['stack']);if(_0xaee574['name']){delete _0xaee574[_0x53ca('0x2c')];}_0x331a15[_0x53ca('0x1d')](_0x4ed261)[_0x53ca('0x2d')](_0xaee574);};}exports[_0x53ca('0x2e')]=function(_0x1baffd,_0x442cf4){var _0x13f5c4={},_0x5dca88={},_0x2e1592={'count':0x0,'rows':[]};var _0x39106c=_[_0x53ca('0x2f')](db['ZendeskConfiguration'][_0x53ca('0x30')],function(_0x4f444c){return{'name':_0x4f444c['fieldName'],'type':_0x4f444c[_0x53ca('0x31')][_0x53ca('0x32')]};});_0x5dca88[_0x53ca('0x33')]=_['map'](_0x39106c,_0x53ca('0x2c'));_0x5dca88[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x1baffd[_0x53ca('0x34')]);_0x5dca88['filters']=_[_0x53ca('0x36')](_0x5dca88[_0x53ca('0x33')],_0x5dca88[_0x53ca('0x34')]);_0x13f5c4[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x5dca88[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x1baffd[_0x53ca('0x34')]['fields']));_0x13f5c4[_0x53ca('0x37')]=_0x13f5c4['attributes'][_0x53ca('0x39')]?_0x13f5c4[_0x53ca('0x37')]:_0x5dca88[_0x53ca('0x33')];if(!_0x1baffd[_0x53ca('0x34')]['hasOwnProperty'](_0x53ca('0x3a'))){_0x13f5c4[_0x53ca('0x20')]=qs[_0x53ca('0x20')](_0x1baffd[_0x53ca('0x34')]['limit']);_0x13f5c4[_0x53ca('0x1e')]=qs['offset'](_0x1baffd[_0x53ca('0x34')][_0x53ca('0x1e')]);}_0x13f5c4[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0x1baffd[_0x53ca('0x34')]['sort']);_0x13f5c4[_0x53ca('0x3d')]=qs[_0x53ca('0x3e')](_[_0x53ca('0x3f')](_0x1baffd[_0x53ca('0x34')],_0x5dca88[_0x53ca('0x3e')]),_0x39106c);if(_0x1baffd[_0x53ca('0x34')][_0x53ca('0x40')]){_0x13f5c4['where']=_['merge'](_0x13f5c4[_0x53ca('0x3d')],{'$or':_['map'](_0x39106c,function(_0x4552da){if(_0x4552da['type']!==_0x53ca('0x41')){var _0x5cddd8={};_0x5cddd8[_0x4552da[_0x53ca('0x2c')]]={'$like':'%'+_0x1baffd[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x5cddd8;}})});}_0x13f5c4=_[_0x53ca('0x42')]({},_0x13f5c4,_0x1baffd[_0x53ca('0x43')]);var _0x4010ef={'where':_0x13f5c4['where']};return db[_0x53ca('0x44')]['count'](_0x4010ef)['then'](function(_0x54e5af){_0x2e1592[_0x53ca('0x21')]=_0x54e5af;if(_0x1baffd[_0x53ca('0x34')][_0x53ca('0x45')]){_0x13f5c4[_0x53ca('0x46')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x53ca('0x47')](_0x13f5c4);})[_0x53ca('0x29')](function(_0x4c1e05){_0x2e1592['rows']=_0x4c1e05;return _0x2e1592;})[_0x53ca('0x29')](respondWithFilteredResult(_0x442cf4,_0x13f5c4))[_0x53ca('0x48')](handleError(_0x442cf4,null));};exports['show']=function(_0x24d945,_0x3f2469){var _0x5644a2={'raw':![],'where':{'id':_0x24d945[_0x53ca('0x49')]['id']}},_0x572af9={};_0x572af9[_0x53ca('0x33')]=_[_0x53ca('0x35')](db['ZendeskConfiguration'][_0x53ca('0x30')]);_0x572af9[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x24d945[_0x53ca('0x34')]);_0x572af9[_0x53ca('0x3e')]=_[_0x53ca('0x36')](_0x572af9[_0x53ca('0x33')],_0x572af9['query']);_0x5644a2['attributes']=_['intersection'](_0x572af9[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x24d945[_0x53ca('0x34')][_0x53ca('0x38')]));_0x5644a2[_0x53ca('0x37')]=_0x5644a2[_0x53ca('0x37')][_0x53ca('0x39')]?_0x5644a2['attributes']:_0x572af9[_0x53ca('0x33')];if(_0x24d945[_0x53ca('0x34')]['includeAll']){_0x5644a2['include']=[{'all':!![]}];}_0x5644a2=_[_0x53ca('0x42')]({},_0x5644a2,_0x24d945[_0x53ca('0x43')]);return db['ZendeskConfiguration'][_0x53ca('0x4a')](_0x5644a2)['then'](handleEntityNotFound(_0x3f2469,null))[_0x53ca('0x29')](respondWithResult(_0x3f2469,null))[_0x53ca('0x48')](handleError(_0x3f2469,null));};exports[_0x53ca('0x4b')]=function(_0xb1941e,_0x52c195){return db['ZendeskConfiguration'][_0x53ca('0x4b')](_0xb1941e['body'],{})['then'](respondWithResult(_0x52c195,0xc9))['catch'](handleError(_0x52c195,null));};exports[_0x53ca('0x28')]=function(_0x203741,_0x255099){if(_0x203741[_0x53ca('0x4c')]['id']){delete _0x203741[_0x53ca('0x4c')]['id'];}return db[_0x53ca('0x44')][_0x53ca('0x4a')]({'where':{'id':_0x203741[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x255099,null))['then'](saveUpdates(_0x203741[_0x53ca('0x4c')],null))['then'](respondWithResult(_0x255099,null))[_0x53ca('0x48')](handleError(_0x255099,null));};exports[_0x53ca('0x2a')]=function(_0x17c35a,_0x4151ab){return db[_0x53ca('0x44')][_0x53ca('0x4a')]({'where':{'id':_0x17c35a['params']['id']}})['then'](handleEntityNotFound(_0x4151ab,null))[_0x53ca('0x29')](removeEntity(_0x4151ab,null))['catch'](handleError(_0x4151ab,null));};exports['getFields']=function(_0x11207d,_0x444dc5,_0x5230cb){var _0x53b1a4={};var _0x29026a={};var _0x38a132;var _0x29aa48;return db['ZendeskConfiguration'][_0x53ca('0x4d')]({'where':{'id':_0x11207d[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x444dc5,null))['then'](function(_0x5a4b0b){if(_0x5a4b0b){_0x38a132=_0x5a4b0b;_0x29026a[_0x53ca('0x33')]=_[_0x53ca('0x35')](db[_0x53ca('0x4e')][_0x53ca('0x30')]);_0x29026a[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x11207d[_0x53ca('0x34')]);_0x29026a[_0x53ca('0x3e')]=_['intersection'](_0x29026a[_0x53ca('0x33')],_0x29026a[_0x53ca('0x34')]);_0x53b1a4[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x29026a[_0x53ca('0x33')],qs['fields'](_0x11207d['query'][_0x53ca('0x38')]));_0x53b1a4[_0x53ca('0x37')]=_0x53b1a4['attributes'][_0x53ca('0x39')]?_0x53b1a4[_0x53ca('0x37')]:_0x29026a[_0x53ca('0x33')];_0x53b1a4[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0x11207d['query'][_0x53ca('0x3c')]);_0x53b1a4['where']=qs['filters'](_['pick'](_0x11207d[_0x53ca('0x34')],_0x29026a[_0x53ca('0x3e')]));if(_0x11207d['query'][_0x53ca('0x40')]){_0x53b1a4[_0x53ca('0x3d')]=_[_0x53ca('0x42')](_0x53b1a4[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x53b1a4[_0x53ca('0x37')],function(_0x437c23){var _0x5853c1={};_0x5853c1[_0x437c23]={'$like':'%'+_0x11207d[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x5853c1;})});}_0x53b1a4=_[_0x53ca('0x42')]({},_0x53b1a4,_0x11207d[_0x53ca('0x43')]);return _0x38a132['getFields'](_0x53b1a4);}})['then'](function(_0x162bf6){if(_0x162bf6){_0x29aa48=_0x162bf6[_0x53ca('0x39')];if(!_0x11207d['query'][_0x53ca('0x4f')]('nolimit')){_0x53b1a4[_0x53ca('0x20')]=qs['limit'](_0x11207d['query'][_0x53ca('0x20')]);_0x53b1a4[_0x53ca('0x1e')]=qs[_0x53ca('0x1e')](_0x11207d['query'][_0x53ca('0x1e')]);}return _0x38a132[_0x53ca('0x50')](_0x53b1a4);}})[_0x53ca('0x29')](function(_0x1cf981){if(_0x1cf981){return _0x1cf981?{'count':_0x29aa48,'rows':_0x1cf981}:null;}})[_0x53ca('0x29')](respondWithResult(_0x444dc5,null))['catch'](handleError(_0x444dc5,null));};exports['getSubjects']=function(_0xa763da,_0x360fc1,_0x4043ee){var _0x15a3ce={};var _0x1055f1={};var _0x45457d;var _0x3b9893;return db[_0x53ca('0x44')]['findOne']({'where':{'id':_0xa763da['params']['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x360fc1,null))[_0x53ca('0x29')](function(_0x2adb26){if(_0x2adb26){_0x45457d=_0x2adb26;_0x1055f1['model']=_[_0x53ca('0x35')](db['ZendeskField'][_0x53ca('0x30')]);_0x1055f1[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0xa763da[_0x53ca('0x34')]);_0x1055f1['filters']=_[_0x53ca('0x36')](_0x1055f1[_0x53ca('0x33')],_0x1055f1[_0x53ca('0x34')]);_0x15a3ce[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x1055f1[_0x53ca('0x33')],qs['fields'](_0xa763da[_0x53ca('0x34')][_0x53ca('0x38')]));_0x15a3ce['attributes']=_0x15a3ce['attributes'][_0x53ca('0x39')]?_0x15a3ce['attributes']:_0x1055f1[_0x53ca('0x33')];_0x15a3ce[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0xa763da['query'][_0x53ca('0x3c')]);_0x15a3ce['where']=qs[_0x53ca('0x3e')](_['pick'](_0xa763da[_0x53ca('0x34')],_0x1055f1['filters']));if(_0xa763da[_0x53ca('0x34')][_0x53ca('0x40')]){_0x15a3ce[_0x53ca('0x3d')]=_[_0x53ca('0x42')](_0x15a3ce[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x15a3ce['attributes'],function(_0x31b900){var _0x2e36ea={};_0x2e36ea[_0x31b900]={'$like':'%'+_0xa763da[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x2e36ea;})});}_0x15a3ce=_[_0x53ca('0x42')]({},_0x15a3ce,_0xa763da[_0x53ca('0x43')]);return _0x45457d[_0x53ca('0x51')](_0x15a3ce);}})['then'](function(_0x37083e){if(_0x37083e){_0x3b9893=_0x37083e[_0x53ca('0x39')];if(!_0xa763da['query'][_0x53ca('0x4f')](_0x53ca('0x3a'))){_0x15a3ce[_0x53ca('0x20')]=qs[_0x53ca('0x20')](_0xa763da['query'][_0x53ca('0x20')]);_0x15a3ce[_0x53ca('0x1e')]=qs['offset'](_0xa763da[_0x53ca('0x34')][_0x53ca('0x1e')]);}return _0x45457d[_0x53ca('0x51')](_0x15a3ce);}})[_0x53ca('0x29')](function(_0x18ab62){if(_0x18ab62){return _0x18ab62?{'count':_0x3b9893,'rows':_0x18ab62}:null;}})['then'](respondWithResult(_0x360fc1,null))[_0x53ca('0x48')](handleError(_0x360fc1,null));};exports['getDescriptions']=function(_0x259965,_0x7121fa,_0x4d9304){var _0x2a0a0f={};var _0x7faca8={};var _0x3270cc;var _0x137bde;return db[_0x53ca('0x44')][_0x53ca('0x4d')]({'where':{'id':_0x259965['params']['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x7121fa,null))[_0x53ca('0x29')](function(_0x178fa3){if(_0x178fa3){_0x3270cc=_0x178fa3;_0x7faca8['model']=_[_0x53ca('0x35')](db[_0x53ca('0x4e')][_0x53ca('0x30')]);_0x7faca8['query']=_[_0x53ca('0x35')](_0x259965[_0x53ca('0x34')]);_0x7faca8[_0x53ca('0x3e')]=_[_0x53ca('0x36')](_0x7faca8[_0x53ca('0x33')],_0x7faca8['query']);_0x2a0a0f[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x7faca8[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x259965[_0x53ca('0x34')][_0x53ca('0x38')]));_0x2a0a0f[_0x53ca('0x37')]=_0x2a0a0f['attributes']['length']?_0x2a0a0f[_0x53ca('0x37')]:_0x7faca8[_0x53ca('0x33')];_0x2a0a0f[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0x259965['query']['sort']);_0x2a0a0f['where']=qs[_0x53ca('0x3e')](_[_0x53ca('0x3f')](_0x259965[_0x53ca('0x34')],_0x7faca8[_0x53ca('0x3e')]));if(_0x259965[_0x53ca('0x34')][_0x53ca('0x40')]){_0x2a0a0f[_0x53ca('0x3d')]=_['merge'](_0x2a0a0f[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x2a0a0f[_0x53ca('0x37')],function(_0x4eb6a3){var _0x1def46={};_0x1def46[_0x4eb6a3]={'$like':'%'+_0x259965[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x1def46;})});}_0x2a0a0f=_['merge']({},_0x2a0a0f,_0x259965[_0x53ca('0x43')]);return _0x3270cc[_0x53ca('0x52')](_0x2a0a0f);}})[_0x53ca('0x29')](function(_0x2c5da8){if(_0x2c5da8){_0x137bde=_0x2c5da8[_0x53ca('0x39')];if(!_0x259965['query'][_0x53ca('0x4f')]('nolimit')){_0x2a0a0f['limit']=qs[_0x53ca('0x20')](_0x259965[_0x53ca('0x34')]['limit']);_0x2a0a0f['offset']=qs[_0x53ca('0x1e')](_0x259965['query']['offset']);}return _0x3270cc[_0x53ca('0x52')](_0x2a0a0f);}})[_0x53ca('0x29')](function(_0x562285){if(_0x562285){return _0x562285?{'count':_0x137bde,'rows':_0x562285}:null;}})[_0x53ca('0x29')](respondWithResult(_0x7121fa,null))[_0x53ca('0x48')](handleError(_0x7121fa,null));};exports[_0x53ca('0x53')]=function(_0x29edae,_0xaad553,_0x28945a){var _0x4a1506={};var _0x3ea37e={};var _0x24bfdb;var _0x2a1e3b;return db[_0x53ca('0x44')][_0x53ca('0x4d')]({'where':{'id':_0x29edae[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0xaad553,null))['then'](function(_0x529ae5){if(_0x529ae5){_0x24bfdb=_0x529ae5;_0x3ea37e[_0x53ca('0x33')]=_[_0x53ca('0x35')](db[_0x53ca('0x54')][_0x53ca('0x30')]);_0x3ea37e[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x29edae[_0x53ca('0x34')]);_0x3ea37e[_0x53ca('0x3e')]=_[_0x53ca('0x36')](_0x3ea37e['model'],_0x3ea37e[_0x53ca('0x34')]);_0x4a1506[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x3ea37e[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x29edae[_0x53ca('0x34')][_0x53ca('0x38')]));_0x4a1506['attributes']=_0x4a1506['attributes']['length']?_0x4a1506[_0x53ca('0x37')]:_0x3ea37e[_0x53ca('0x33')];_0x4a1506[_0x53ca('0x3b')]=qs['sort'](_0x29edae['query'][_0x53ca('0x3c')]);_0x4a1506['where']=qs[_0x53ca('0x3e')](_[_0x53ca('0x3f')](_0x29edae[_0x53ca('0x34')],_0x3ea37e['filters']));if(_0x29edae[_0x53ca('0x34')][_0x53ca('0x40')]){_0x4a1506['where']=_[_0x53ca('0x42')](_0x4a1506[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x4a1506[_0x53ca('0x37')],function(_0x16c0da){var _0x1d631f={};_0x1d631f[_0x16c0da]={'$like':'%'+_0x29edae[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x1d631f;})});}_0x4a1506=_[_0x53ca('0x42')]({},_0x4a1506,_0x29edae['options']);return _0x24bfdb[_0x53ca('0x53')](_0x4a1506);}})[_0x53ca('0x29')](function(_0x2c5eee){if(_0x2c5eee){_0x2a1e3b=_0x2c5eee['length'];if(!_0x29edae[_0x53ca('0x34')][_0x53ca('0x4f')](_0x53ca('0x3a'))){_0x4a1506[_0x53ca('0x20')]=qs[_0x53ca('0x20')](_0x29edae[_0x53ca('0x34')][_0x53ca('0x20')]);_0x4a1506[_0x53ca('0x1e')]=qs[_0x53ca('0x1e')](_0x29edae[_0x53ca('0x34')][_0x53ca('0x1e')]);}return _0x24bfdb[_0x53ca('0x53')](_0x4a1506);}})[_0x53ca('0x29')](function(_0x35c706){if(_0x35c706){return _0x35c706?{'count':_0x2a1e3b,'rows':_0x35c706}:null;}})[_0x53ca('0x29')](respondWithResult(_0xaad553,null))[_0x53ca('0x48')](handleError(_0xaad553,null));};exports['setTags']=function(_0x83d968,_0x32d90a,_0x52fae3){if(_0x83d968['body']['id']){delete _0x83d968[_0x53ca('0x4c')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x83d968[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x32d90a,null))[_0x53ca('0x29')](function(_0x5f3d77){if(_0x5f3d77){return _0x5f3d77[_0x53ca('0x55')](_0x83d968[_0x53ca('0x4c')][_0x53ca('0x56')]||[]);}return null;})[_0x53ca('0x29')](respondWithResult(_0x32d90a,null))[_0x53ca('0x48')](handleError(_0x32d90a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 7890ef9..a147215 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(_0x490c8d,_0x15d165){var _0x5df120=function(_0x4f433f){while(--_0x4f433f){_0x490c8d['push'](_0x490c8d['shift']());}};_0x5df120(++_0x15d165);}(_0x32b6,0x1d1));var _0x632b=function(_0x1d9b9b,_0x335d6c){_0x1d9b9b=_0x1d9b9b-0x0;var _0x1ed13c=_0x32b6[_0x1d9b9b];return _0x1ed13c;};'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 _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x30dd30,_0x2cb7c4){var _0x32d524=function(_0x298984){while(--_0x298984){_0x30dd30['push'](_0x30dd30['shift']());}};_0x32d524(++_0x2cb7c4);}(_0xa571,0x107));var _0x1a57=function(_0x559378,_0x3ae562){_0x559378=_0x559378-0x0;var _0x34eab2=_0xa571[_0x559378];return _0x34eab2;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index ba8ca02..ea68181 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 _0x62fa=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird'];(function(_0x422a13,_0x2b98a0){var _0x555eaa=function(_0x416dc9){while(--_0x416dc9){_0x422a13['push'](_0x422a13['shift']());}};_0x555eaa(++_0x2b98a0);}(_0x62fa,0xfa));var _0xa62f=function(_0x1f1f3b,_0x227aa9){_0x1f1f3b=_0x1f1f3b-0x0;var _0x2e63aa=_0x62fa[_0x1f1f3b];return _0x2e63aa;};'use strict';var _=require('lodash');var util=require(_0xa62f('0x0'));var moment=require(_0xa62f('0x1'));var BPromise=require(_0xa62f('0x2'));var rs=require(_0xa62f('0x3'));var fs=require('fs');var Redis=require(_0xa62f('0x4'));var db=require(_0xa62f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa62f('0x6'))('rpc');var config=require(_0xa62f('0x7'));var jayson=require(_0xa62f('0x8'));var client=jayson[_0xa62f('0x9')][_0xa62f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25186b,_0xac34cf,_0x4b75fd){return new BPromise(function(_0x13b8d0,_0x106356){return client[_0xa62f('0xb')](_0x25186b,_0x4b75fd)[_0xa62f('0xc')](function(_0x4088f4){logger[_0xa62f('0xd')](_0xa62f('0xe'),_0xac34cf,_0xa62f('0xf'));logger[_0xa62f('0x10')](_0xa62f('0x11'),_0xac34cf,_0xa62f('0xf'),JSON[_0xa62f('0x12')](_0x4088f4));if(_0x4088f4[_0xa62f('0x13')]){if(_0x4088f4[_0xa62f('0x13')]['code']===0x1f4){logger[_0xa62f('0x13')](_0xa62f('0xe'),_0xac34cf,_0x4088f4[_0xa62f('0x13')][_0xa62f('0x14')]);return _0x106356(_0x4088f4[_0xa62f('0x13')][_0xa62f('0x14')]);}logger[_0xa62f('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xac34cf,_0x4088f4['error']['message']);return _0x13b8d0(_0x4088f4[_0xa62f('0x13')]['message']);}else{logger['info'](_0xa62f('0xe'),_0xac34cf,_0xa62f('0xf'));_0x13b8d0(_0x4088f4[_0xa62f('0x15')][_0xa62f('0x14')]);}})[_0xa62f('0x16')](function(_0x129341){logger[_0xa62f('0x13')](_0xa62f('0xe'),_0xac34cf,_0x129341);_0x106356(_0x129341);});});} \ No newline at end of file +var _0x9f2c=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x38e87f,_0x590e6f){var _0x4084a7=function(_0x1fe1f6){while(--_0x1fe1f6){_0x38e87f['push'](_0x38e87f['shift']());}};_0x4084a7(++_0x590e6f);}(_0x9f2c,0x1e4));var _0xc9f2=function(_0xd0a290,_0x55cb33){_0xd0a290=_0xd0a290-0x0;var _0x377b3d=_0x9f2c[_0xd0a290];return _0x377b3d;};'use strict';var _=require(_0xc9f2('0x0'));var util=require('util');var moment=require(_0xc9f2('0x1'));var BPromise=require(_0xc9f2('0x2'));var rs=require(_0xc9f2('0x3'));var fs=require('fs');var Redis=require(_0xc9f2('0x4'));var db=require(_0xc9f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9f2('0x6'))(_0xc9f2('0x7'));var config=require(_0xc9f2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc9f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28b593,_0x423edf,_0x44c01c){return new BPromise(function(_0x4e25f7,_0x3b2e4a){return client[_0xc9f2('0xa')](_0x28b593,_0x44c01c)[_0xc9f2('0xb')](function(_0x3874e6){logger[_0xc9f2('0xc')](_0xc9f2('0xd'),_0x423edf,'request\x20sent');logger[_0xc9f2('0xe')](_0xc9f2('0xf'),_0x423edf,_0xc9f2('0x10'),JSON[_0xc9f2('0x11')](_0x3874e6));if(_0x3874e6[_0xc9f2('0x12')]){if(_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x13')]===0x1f4){logger[_0xc9f2('0x12')](_0xc9f2('0xd'),_0x423edf,_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);return _0x3b2e4a(_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);}logger['error'](_0xc9f2('0xd'),_0x423edf,_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);return _0x4e25f7(_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);}else{logger[_0xc9f2('0xc')](_0xc9f2('0xd'),_0x423edf,'request\x20sent');_0x4e25f7(_0x3874e6[_0xc9f2('0x15')][_0xc9f2('0x14')]);}})[_0xc9f2('0x16')](function(_0xf6a1c9){logger[_0xc9f2('0x12')](_0xc9f2('0xd'),_0x423edf,_0xf6a1c9);_0x3b2e4a(_0xf6a1c9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 404e1b4..2c9f992 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 _0xee0c=['update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xee0c,0x143));var _0xcee0=function(_0x145f26,_0x5b5422){_0x145f26=_0x145f26-0x0;var _0x435fa5=_0xee0c[_0x145f26];return _0x435fa5;};'use strict';var multer=require(_0xcee0('0x0'));var util=require(_0xcee0('0x1'));var path=require(_0xcee0('0x2'));var timeout=require('connect-timeout');var express=require(_0xcee0('0x3'));var router=express[_0xcee0('0x4')]();var fs_extra=require(_0xcee0('0x5'));var auth=require(_0xcee0('0x6'));var interaction=require(_0xcee0('0x7'));var config=require(_0xcee0('0x8'));var controller=require('./intZendeskField.controller');router[_0xcee0('0x9')]('/',auth[_0xcee0('0xa')](),controller[_0xcee0('0xb')]);router[_0xcee0('0x9')](_0xcee0('0xc'),auth[_0xcee0('0xa')](),controller[_0xcee0('0xd')]);router[_0xcee0('0xe')]('/',auth[_0xcee0('0xa')](),controller[_0xcee0('0xf')]);router[_0xcee0('0x10')](_0xcee0('0xc'),auth[_0xcee0('0xa')](),controller[_0xcee0('0x11')]);router['delete'](_0xcee0('0xc'),auth[_0xcee0('0xa')](),controller[_0xcee0('0x12')]);module[_0xcee0('0x13')]=router; \ No newline at end of file +var _0xba50=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZendeskField.controller','index','get','/:id','isAuthenticated','show'];(function(_0x3eab43,_0x1bd704){var _0x2d373c=function(_0x106dc4){while(--_0x106dc4){_0x3eab43['push'](_0x3eab43['shift']());}};_0x2d373c(++_0x1bd704);}(_0xba50,0x1a3));var _0x0ba5=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0xba50[_0x2803ab];return _0x3d6e8e;};'use strict';var multer=require(_0x0ba5('0x0'));var util=require(_0x0ba5('0x1'));var path=require(_0x0ba5('0x2'));var timeout=require(_0x0ba5('0x3'));var express=require(_0x0ba5('0x4'));var router=express[_0x0ba5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ba5('0x6'));var config=require('../../config/environment');var controller=require(_0x0ba5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0ba5('0x8')]);router[_0x0ba5('0x9')](_0x0ba5('0xa'),auth[_0x0ba5('0xb')](),controller[_0x0ba5('0xc')]);router[_0x0ba5('0xd')]('/',auth[_0x0ba5('0xb')](),controller['create']);router[_0x0ba5('0xe')]('/:id',auth[_0x0ba5('0xb')](),controller[_0x0ba5('0xf')]);router[_0x0ba5('0x10')]('/:id',auth[_0x0ba5('0xb')](),controller[_0x0ba5('0x11')]);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 032ff95..f76b3ca 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 _0xa908=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa908,0x177));var _0x8a90=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0xa908[_0x4045ff];return _0x5797ac;};'use strict';var Sequelize=require('sequelize');module[_0x8a90('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8a90('0x1'),_0x8a90('0x2'),_0x8a90('0x3'),_0x8a90('0x4'),_0x8a90('0x5')),'defaultValue':_0x8a90('0x1')},'content':{'type':Sequelize[_0x8a90('0x6')]},'key':{'type':Sequelize[_0x8a90('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8a90('0x2'),_0x8a90('0x3'))},'keyContent':{'type':Sequelize[_0x8a90('0x6')]},'idField':{'type':Sequelize[_0x8a90('0x6')]},'nameField':{'type':Sequelize[_0x8a90('0x6')]},'customField':{'type':Sequelize[_0x8a90('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a90('0x6')]}}; \ No newline at end of file +var _0xa340=['STRING','ENUM','string','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x1a21db,_0x9489fb){var _0x13ea9b=function(_0xb91444){while(--_0xb91444){_0x1a21db['push'](_0x1a21db['shift']());}};_0x13ea9b(++_0x9489fb);}(_0xa340,0x114));var _0x0a34=function(_0x2afcd3,_0x17db28){_0x2afcd3=_0x2afcd3-0x0;var _0x28d21a=_0xa340[_0x2afcd3];return _0x28d21a;};'use strict';var Sequelize=require(_0x0a34('0x0'));module[_0x0a34('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x0a34('0x2'),_0x0a34('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0a34('0x4')]},'keyType':{'type':Sequelize[_0x0a34('0x5')](_0x0a34('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0a34('0x7')],'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 296dafa..8fdc74d 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 _0xc36d=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','options','includeAll','include','rows','catch','show','params','ZendeskField','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0xedf87c,_0x5d7580){var _0x423d2d=function(_0x433ddc){while(--_0x433ddc){_0xedf87c['push'](_0xedf87c['shift']());}};_0x423d2d(++_0x5d7580);}(_0xc36d,0x7d));var _0xdc36=function(_0x16eb19,_0x58cea4){_0x16eb19=_0x16eb19-0x0;var _0x312a25=_0xc36d[_0x16eb19];return _0x312a25;};'use strict';var emlformat=require(_0xdc36('0x0'));var rimraf=require(_0xdc36('0x1'));var zipdir=require(_0xdc36('0x2'));var jsonpatch=require(_0xdc36('0x3'));var rp=require(_0xdc36('0x4'));var moment=require(_0xdc36('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc36('0x6'));var util=require(_0xdc36('0x7'));var path=require('path');var sox=require(_0xdc36('0x8'));var csv=require(_0xdc36('0x9'));var ejs=require(_0xdc36('0xa'));var fs=require('fs');var fs_extra=require(_0xdc36('0xb'));var _=require(_0xdc36('0xc'));var squel=require('squel');var crypto=require(_0xdc36('0xd'));var jsforce=require(_0xdc36('0xe'));var deskjs=require(_0xdc36('0xf'));var toCsv=require(_0xdc36('0x9'));var querystring=require('querystring');var Papa=require(_0xdc36('0x10'));var Redis=require(_0xdc36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc36('0x12'));var as=require(_0xdc36('0x13'));var hardwareService=require(_0xdc36('0x14'));var logger=require('../../config/logger')(_0xdc36('0x15'));var utils=require(_0xdc36('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdc36('0x17'))['db'];function respondWithStatusCode(_0x276692,_0x519fa5){_0x519fa5=_0x519fa5||0xcc;return function(_0x5d62ee){if(_0x5d62ee){return _0x276692['sendStatus'](_0x519fa5);}return _0x276692[_0xdc36('0x18')](_0x519fa5)[_0xdc36('0x19')]();};}function respondWithResult(_0x243d54,_0xae6ad3){_0xae6ad3=_0xae6ad3||0xc8;return function(_0x30803d){if(_0x30803d){return _0x243d54[_0xdc36('0x18')](_0xae6ad3)[_0xdc36('0x1a')](_0x30803d);}};}function respondWithFilteredResult(_0x809cf0,_0x57ebde){return function(_0x155cce){if(_0x155cce){var _0x526ac8=typeof _0x57ebde['offset']==='undefined'&&typeof _0x57ebde[_0xdc36('0x1b')]===_0xdc36('0x1c');var _0x5a498f=_0x155cce[_0xdc36('0x1d')];var _0x219a73=_0x526ac8?0x0:_0x57ebde[_0xdc36('0x1e')];var _0x225878=_0x526ac8?_0x155cce[_0xdc36('0x1d')]:_0x57ebde[_0xdc36('0x1e')]+_0x57ebde['limit'];var _0x3d4c4c;if(_0x225878>=_0x5a498f){_0x225878=_0x5a498f;_0x3d4c4c=0xc8;}else{_0x3d4c4c=0xce;}_0x809cf0[_0xdc36('0x18')](_0x3d4c4c);return _0x809cf0['set'](_0xdc36('0x1f'),_0x219a73+'-'+_0x225878+'/'+_0x5a498f)[_0xdc36('0x1a')](_0x155cce);}return null;};}function patchUpdates(_0x3f25f0){return function(_0x5f15ef){try{jsonpatch[_0xdc36('0x20')](_0x5f15ef,_0x3f25f0,!![]);}catch(_0x235a39){return BPromise['reject'](_0x235a39);}return _0x5f15ef[_0xdc36('0x21')]();};}function saveUpdates(_0x480277,_0x5a6e35){return function(_0x12f9d8){if(_0x12f9d8){return _0x12f9d8[_0xdc36('0x22')](_0x480277)[_0xdc36('0x23')](function(_0xda916b){return _0xda916b;});}return null;};}function removeEntity(_0x2d83c0,_0x34d261){return function(_0x14b595){if(_0x14b595){return _0x14b595[_0xdc36('0x24')]()['then'](function(){_0x2d83c0[_0xdc36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2338d7,_0x38bd73){return function(_0x15e686){if(!_0x15e686){_0x2338d7['sendStatus'](0x194);}return _0x15e686;};}function handleError(_0xbc4322,_0x6e3906){_0x6e3906=_0x6e3906||0x1f4;return function(_0x337091){logger['error'](_0x337091[_0xdc36('0x25')]);if(_0x337091[_0xdc36('0x26')]){delete _0x337091[_0xdc36('0x26')];}_0xbc4322['status'](_0x6e3906)[_0xdc36('0x27')](_0x337091);};}exports[_0xdc36('0x28')]=function(_0x4b15b4,_0x3fe57f){var _0x12fed2={},_0x4ea2ad={},_0x21151b={'count':0x0,'rows':[]};var _0x5bba0b=_['map'](db['ZendeskField'][_0xdc36('0x29')],function(_0x2f2bb4){return{'name':_0x2f2bb4['fieldName'],'type':_0x2f2bb4[_0xdc36('0x2a')][_0xdc36('0x2b')]};});_0x4ea2ad[_0xdc36('0x2c')]=_['map'](_0x5bba0b,_0xdc36('0x26'));_0x4ea2ad[_0xdc36('0x2d')]=_[_0xdc36('0x2e')](_0x4b15b4[_0xdc36('0x2d')]);_0x4ea2ad[_0xdc36('0x2f')]=_[_0xdc36('0x30')](_0x4ea2ad[_0xdc36('0x2c')],_0x4ea2ad['query']);_0x12fed2[_0xdc36('0x31')]=_[_0xdc36('0x30')](_0x4ea2ad['model'],qs['fields'](_0x4b15b4[_0xdc36('0x2d')][_0xdc36('0x32')]));_0x12fed2[_0xdc36('0x31')]=_0x12fed2['attributes']['length']?_0x12fed2[_0xdc36('0x31')]:_0x4ea2ad[_0xdc36('0x2c')];if(!_0x4b15b4[_0xdc36('0x2d')][_0xdc36('0x33')](_0xdc36('0x34'))){_0x12fed2[_0xdc36('0x1b')]=qs[_0xdc36('0x1b')](_0x4b15b4[_0xdc36('0x2d')][_0xdc36('0x1b')]);_0x12fed2[_0xdc36('0x1e')]=qs[_0xdc36('0x1e')](_0x4b15b4['query'][_0xdc36('0x1e')]);}_0x12fed2[_0xdc36('0x35')]=qs[_0xdc36('0x36')](_0x4b15b4[_0xdc36('0x2d')]['sort']);_0x12fed2[_0xdc36('0x37')]=qs[_0xdc36('0x2f')](_[_0xdc36('0x38')](_0x4b15b4[_0xdc36('0x2d')],_0x4ea2ad['filters']),_0x5bba0b);if(_0x4b15b4[_0xdc36('0x2d')]['filter']){_0x12fed2['where']=_[_0xdc36('0x39')](_0x12fed2[_0xdc36('0x37')],{'$or':_[_0xdc36('0x3a')](_0x5bba0b,function(_0x54c45d){if(_0x54c45d[_0xdc36('0x2a')]!=='VIRTUAL'){var _0x45760b={};_0x45760b[_0x54c45d[_0xdc36('0x26')]]={'$like':'%'+_0x4b15b4[_0xdc36('0x2d')]['filter']+'%'};return _0x45760b;}})});}_0x12fed2=_[_0xdc36('0x39')]({},_0x12fed2,_0x4b15b4[_0xdc36('0x3b')]);var _0xd98d42={'where':_0x12fed2[_0xdc36('0x37')]};return db['ZendeskField'][_0xdc36('0x1d')](_0xd98d42)[_0xdc36('0x23')](function(_0x68816d){_0x21151b['count']=_0x68816d;if(_0x4b15b4['query'][_0xdc36('0x3c')]){_0x12fed2[_0xdc36('0x3d')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x12fed2);})[_0xdc36('0x23')](function(_0x8f4c80){_0x21151b[_0xdc36('0x3e')]=_0x8f4c80;return _0x21151b;})[_0xdc36('0x23')](respondWithFilteredResult(_0x3fe57f,_0x12fed2))[_0xdc36('0x3f')](handleError(_0x3fe57f,null));};exports[_0xdc36('0x40')]=function(_0x932213,_0x2a83ee){var _0x2f4c89={'raw':!![],'where':{'id':_0x932213[_0xdc36('0x41')]['id']}},_0x125f0e={};_0x125f0e[_0xdc36('0x2c')]=_[_0xdc36('0x2e')](db[_0xdc36('0x42')][_0xdc36('0x29')]);_0x125f0e[_0xdc36('0x2d')]=_[_0xdc36('0x2e')](_0x932213[_0xdc36('0x2d')]);_0x125f0e[_0xdc36('0x2f')]=_[_0xdc36('0x30')](_0x125f0e[_0xdc36('0x2c')],_0x125f0e[_0xdc36('0x2d')]);_0x2f4c89[_0xdc36('0x31')]=_[_0xdc36('0x30')](_0x125f0e[_0xdc36('0x2c')],qs[_0xdc36('0x32')](_0x932213['query'][_0xdc36('0x32')]));_0x2f4c89[_0xdc36('0x31')]=_0x2f4c89['attributes']['length']?_0x2f4c89[_0xdc36('0x31')]:_0x125f0e['model'];if(_0x932213[_0xdc36('0x2d')]['includeAll']){_0x2f4c89[_0xdc36('0x3d')]=[{'all':!![]}];}_0x2f4c89=_[_0xdc36('0x39')]({},_0x2f4c89,_0x932213[_0xdc36('0x3b')]);return db[_0xdc36('0x42')][_0xdc36('0x43')](_0x2f4c89)[_0xdc36('0x23')](handleEntityNotFound(_0x2a83ee,null))[_0xdc36('0x23')](respondWithResult(_0x2a83ee,null))[_0xdc36('0x3f')](handleError(_0x2a83ee,null));};exports[_0xdc36('0x44')]=function(_0x38c24b,_0x3c27c7){return db[_0xdc36('0x42')][_0xdc36('0x44')](_0x38c24b[_0xdc36('0x45')],{})[_0xdc36('0x23')](respondWithResult(_0x3c27c7,0xc9))[_0xdc36('0x3f')](handleError(_0x3c27c7,null));};exports[_0xdc36('0x22')]=function(_0x3399cc,_0x562c86){if(_0x3399cc['body']['id']){delete _0x3399cc[_0xdc36('0x45')]['id'];}return db[_0xdc36('0x42')][_0xdc36('0x43')]({'where':{'id':_0x3399cc[_0xdc36('0x41')]['id']}})[_0xdc36('0x23')](handleEntityNotFound(_0x562c86,null))[_0xdc36('0x23')](saveUpdates(_0x3399cc['body'],null))[_0xdc36('0x23')](respondWithResult(_0x562c86,null))[_0xdc36('0x3f')](handleError(_0x562c86,null));};exports[_0xdc36('0x24')]=function(_0x49f456,_0x2c6856){return db[_0xdc36('0x42')][_0xdc36('0x43')]({'where':{'id':_0x49f456[_0xdc36('0x41')]['id']}})[_0xdc36('0x23')](handleEntityNotFound(_0x2c6856,null))[_0xdc36('0x23')](removeEntity(_0x2c6856,null))['catch'](handleError(_0x2c6856,null));}; \ No newline at end of file +var _0xbf2a=['moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','fast-json-patch','request-promise'];(function(_0x2d3d0d,_0x67ac82){var _0xca35b6=function(_0x483979){while(--_0x483979){_0x2d3d0d['push'](_0x2d3d0d['shift']());}};_0xca35b6(++_0x67ac82);}(_0xbf2a,0x165));var _0xabf2=function(_0xc905bf,_0x3fb45d){_0xc905bf=_0xc905bf-0x0;var _0x3ffd14=_0xbf2a[_0xc905bf];return _0x3ffd14;};'use strict';var emlformat=require(_0xabf2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xabf2('0x1'));var rp=require(_0xabf2('0x2'));var moment=require(_0xabf2('0x3'));var BPromise=require(_0xabf2('0x4'));var Mustache=require(_0xabf2('0x5'));var util=require(_0xabf2('0x6'));var path=require('path');var sox=require(_0xabf2('0x7'));var csv=require(_0xabf2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabf2('0x9'));var squel=require('squel');var crypto=require(_0xabf2('0xa'));var jsforce=require(_0xabf2('0xb'));var deskjs=require(_0xabf2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xabf2('0xd'));var Redis=require(_0xabf2('0xe'));var authService=require(_0xabf2('0xf'));var qs=require(_0xabf2('0x10'));var as=require(_0xabf2('0x11'));var hardwareService=require(_0xabf2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xabf2('0x13'));var config=require(_0xabf2('0x14'));var licenseUtil=require(_0xabf2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x63964a,_0x2e54d9){_0x2e54d9=_0x2e54d9||0xcc;return function(_0x8aa3d8){if(_0x8aa3d8){return _0x63964a['sendStatus'](_0x2e54d9);}return _0x63964a[_0xabf2('0x16')](_0x2e54d9)[_0xabf2('0x17')]();};}function respondWithResult(_0xea348e,_0x3b16f4){_0x3b16f4=_0x3b16f4||0xc8;return function(_0x4aa1c2){if(_0x4aa1c2){return _0xea348e[_0xabf2('0x16')](_0x3b16f4)['json'](_0x4aa1c2);}};}function respondWithFilteredResult(_0x425a36,_0x3fbff0){return function(_0x1b9f54){if(_0x1b9f54){var _0x11e650=typeof _0x3fbff0[_0xabf2('0x18')]===_0xabf2('0x19')&&typeof _0x3fbff0[_0xabf2('0x1a')]===_0xabf2('0x19');var _0x209dd3=_0x1b9f54[_0xabf2('0x1b')];var _0x30eeab=_0x11e650?0x0:_0x3fbff0[_0xabf2('0x18')];var _0x4933e8=_0x11e650?_0x1b9f54[_0xabf2('0x1b')]:_0x3fbff0[_0xabf2('0x18')]+_0x3fbff0[_0xabf2('0x1a')];var _0x3a89ab;if(_0x4933e8>=_0x209dd3){_0x4933e8=_0x209dd3;_0x3a89ab=0xc8;}else{_0x3a89ab=0xce;}_0x425a36[_0xabf2('0x16')](_0x3a89ab);return _0x425a36['set'](_0xabf2('0x1c'),_0x30eeab+'-'+_0x4933e8+'/'+_0x209dd3)[_0xabf2('0x1d')](_0x1b9f54);}return null;};}function patchUpdates(_0x533e1a){return function(_0x2eee0f){try{jsonpatch[_0xabf2('0x1e')](_0x2eee0f,_0x533e1a,!![]);}catch(_0xabb431){return BPromise[_0xabf2('0x1f')](_0xabb431);}return _0x2eee0f[_0xabf2('0x20')]();};}function saveUpdates(_0x12984a,_0x4f1012){return function(_0x212ad7){if(_0x212ad7){return _0x212ad7[_0xabf2('0x21')](_0x12984a)[_0xabf2('0x22')](function(_0x391099){return _0x391099;});}return null;};}function removeEntity(_0x2f7ffa,_0x252f3e){return function(_0x54a033){if(_0x54a033){return _0x54a033[_0xabf2('0x23')]()[_0xabf2('0x22')](function(){_0x2f7ffa[_0xabf2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309466,_0x2016e6){return function(_0x16994f){if(!_0x16994f){_0x309466['sendStatus'](0x194);}return _0x16994f;};}function handleError(_0x567c14,_0x25e173){_0x25e173=_0x25e173||0x1f4;return function(_0x4eed34){logger['error'](_0x4eed34[_0xabf2('0x24')]);if(_0x4eed34['name']){delete _0x4eed34[_0xabf2('0x25')];}_0x567c14[_0xabf2('0x16')](_0x25e173)[_0xabf2('0x26')](_0x4eed34);};}exports[_0xabf2('0x27')]=function(_0x345f92,_0x53fa8d){var _0x48ba8f={},_0x7dc999={},_0x2038bb={'count':0x0,'rows':[]};var _0x56bda7=_[_0xabf2('0x28')](db[_0xabf2('0x29')][_0xabf2('0x2a')],function(_0x40d577){return{'name':_0x40d577[_0xabf2('0x2b')],'type':_0x40d577[_0xabf2('0x2c')]['key']};});_0x7dc999['model']=_[_0xabf2('0x28')](_0x56bda7,_0xabf2('0x25'));_0x7dc999['query']=_[_0xabf2('0x2d')](_0x345f92[_0xabf2('0x2e')]);_0x7dc999['filters']=_[_0xabf2('0x2f')](_0x7dc999[_0xabf2('0x30')],_0x7dc999[_0xabf2('0x2e')]);_0x48ba8f[_0xabf2('0x31')]=_['intersection'](_0x7dc999[_0xabf2('0x30')],qs[_0xabf2('0x32')](_0x345f92[_0xabf2('0x2e')][_0xabf2('0x32')]));_0x48ba8f[_0xabf2('0x31')]=_0x48ba8f[_0xabf2('0x31')][_0xabf2('0x33')]?_0x48ba8f[_0xabf2('0x31')]:_0x7dc999[_0xabf2('0x30')];if(!_0x345f92[_0xabf2('0x2e')][_0xabf2('0x34')](_0xabf2('0x35'))){_0x48ba8f[_0xabf2('0x1a')]=qs[_0xabf2('0x1a')](_0x345f92[_0xabf2('0x2e')]['limit']);_0x48ba8f['offset']=qs[_0xabf2('0x18')](_0x345f92[_0xabf2('0x2e')][_0xabf2('0x18')]);}_0x48ba8f[_0xabf2('0x36')]=qs['sort'](_0x345f92[_0xabf2('0x2e')][_0xabf2('0x37')]);_0x48ba8f[_0xabf2('0x38')]=qs[_0xabf2('0x39')](_['pick'](_0x345f92[_0xabf2('0x2e')],_0x7dc999[_0xabf2('0x39')]),_0x56bda7);if(_0x345f92[_0xabf2('0x2e')][_0xabf2('0x3a')]){_0x48ba8f[_0xabf2('0x38')]=_[_0xabf2('0x3b')](_0x48ba8f[_0xabf2('0x38')],{'$or':_['map'](_0x56bda7,function(_0x210585){if(_0x210585[_0xabf2('0x2c')]!==_0xabf2('0x3c')){var _0x467b87={};_0x467b87[_0x210585[_0xabf2('0x25')]]={'$like':'%'+_0x345f92[_0xabf2('0x2e')][_0xabf2('0x3a')]+'%'};return _0x467b87;}})});}_0x48ba8f=_[_0xabf2('0x3b')]({},_0x48ba8f,_0x345f92[_0xabf2('0x3d')]);var _0x92c259={'where':_0x48ba8f[_0xabf2('0x38')]};return db[_0xabf2('0x29')][_0xabf2('0x1b')](_0x92c259)[_0xabf2('0x22')](function(_0x543e68){_0x2038bb[_0xabf2('0x1b')]=_0x543e68;if(_0x345f92['query'][_0xabf2('0x3e')]){_0x48ba8f[_0xabf2('0x3f')]=[{'all':!![]}];}return db['ZendeskField'][_0xabf2('0x40')](_0x48ba8f);})[_0xabf2('0x22')](function(_0x2e483f){_0x2038bb[_0xabf2('0x41')]=_0x2e483f;return _0x2038bb;})['then'](respondWithFilteredResult(_0x53fa8d,_0x48ba8f))['catch'](handleError(_0x53fa8d,null));};exports[_0xabf2('0x42')]=function(_0x32f226,_0x3c84ec){var _0x54b705={'raw':!![],'where':{'id':_0x32f226[_0xabf2('0x43')]['id']}},_0x30f92b={};_0x30f92b[_0xabf2('0x30')]=_['keys'](db[_0xabf2('0x29')][_0xabf2('0x2a')]);_0x30f92b[_0xabf2('0x2e')]=_['keys'](_0x32f226[_0xabf2('0x2e')]);_0x30f92b[_0xabf2('0x39')]=_['intersection'](_0x30f92b[_0xabf2('0x30')],_0x30f92b['query']);_0x54b705[_0xabf2('0x31')]=_[_0xabf2('0x2f')](_0x30f92b['model'],qs['fields'](_0x32f226[_0xabf2('0x2e')][_0xabf2('0x32')]));_0x54b705[_0xabf2('0x31')]=_0x54b705[_0xabf2('0x31')][_0xabf2('0x33')]?_0x54b705[_0xabf2('0x31')]:_0x30f92b[_0xabf2('0x30')];if(_0x32f226[_0xabf2('0x2e')]['includeAll']){_0x54b705['include']=[{'all':!![]}];}_0x54b705=_[_0xabf2('0x3b')]({},_0x54b705,_0x32f226[_0xabf2('0x3d')]);return db[_0xabf2('0x29')][_0xabf2('0x44')](_0x54b705)[_0xabf2('0x22')](handleEntityNotFound(_0x3c84ec,null))[_0xabf2('0x22')](respondWithResult(_0x3c84ec,null))[_0xabf2('0x45')](handleError(_0x3c84ec,null));};exports['create']=function(_0x46c3e5,_0x42978f){return db[_0xabf2('0x29')][_0xabf2('0x46')](_0x46c3e5['body'],{})['then'](respondWithResult(_0x42978f,0xc9))['catch'](handleError(_0x42978f,null));};exports['update']=function(_0x58a446,_0x5f2666){if(_0x58a446[_0xabf2('0x47')]['id']){delete _0x58a446[_0xabf2('0x47')]['id'];}return db['ZendeskField'][_0xabf2('0x44')]({'where':{'id':_0x58a446[_0xabf2('0x43')]['id']}})[_0xabf2('0x22')](handleEntityNotFound(_0x5f2666,null))['then'](saveUpdates(_0x58a446[_0xabf2('0x47')],null))[_0xabf2('0x22')](respondWithResult(_0x5f2666,null))[_0xabf2('0x45')](handleError(_0x5f2666,null));};exports[_0xabf2('0x23')]=function(_0x2f9a58,_0x288990){return db[_0xabf2('0x29')][_0xabf2('0x44')]({'where':{'id':_0x2f9a58[_0xabf2('0x43')]['id']}})[_0xabf2('0x22')](handleEntityNotFound(_0x288990,null))['then'](removeEntity(_0x288990,null))['catch'](handleError(_0x288990,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 36405d1..9002ff7 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 _0xde18=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x2fce59,_0x226b20){var _0x526361=function(_0xe6f4bc){while(--_0xe6f4bc){_0x2fce59['push'](_0x2fce59['shift']());}};_0x526361(++_0x226b20);}(_0xde18,0x110));var _0x8de1=function(_0x56ea97,_0x40a6ab){_0x56ea97=_0x56ea97-0x0;var _0x198ff0=_0xde18[_0x56ea97];return _0x198ff0;};'use strict';var _=require(_0x8de1('0x0'));var util=require('util');var logger=require(_0x8de1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8de1('0x2'));var rp=require(_0x8de1('0x3'));var fs=require('fs');var path=require(_0x8de1('0x4'));var rimraf=require(_0x8de1('0x5'));var config=require(_0x8de1('0x6'));var attributes=require(_0x8de1('0x7'));module['exports']=function(_0x32474f,_0x570d68){return _0x32474f[_0x8de1('0x8')]('ZendeskField',attributes,{'tableName':_0x8de1('0x9'),'paranoid':![],'indexes':[{'name':_0x8de1('0xa'),'fields':[_0x8de1('0xb'),_0x8de1('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x22ac=['request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x22ac,0x11b));var _0xc22a=function(_0x202438,_0x21f696){_0x202438=_0x202438-0x0;var _0x43a7f1=_0x22ac[_0x202438];return _0x43a7f1;};'use strict';var _=require(_0xc22a('0x0'));var util=require('util');var logger=require(_0xc22a('0x1'))('api');var moment=require(_0xc22a('0x2'));var BPromise=require('bluebird');var rp=require(_0xc22a('0x3'));var fs=require('fs');var path=require(_0xc22a('0x4'));var rimraf=require('rimraf');var config=require(_0xc22a('0x5'));var attributes=require(_0xc22a('0x6'));module[_0xc22a('0x7')]=function(_0x599b47,_0x3e24b1){return _0x599b47[_0xc22a('0x8')]('ZendeskField',attributes,{'tableName':_0xc22a('0x9'),'paranoid':![],'indexes':[{'name':_0xc22a('0xa'),'fields':[_0xc22a('0xb'),_0xc22a('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 ef4f44e..e9067ba 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 _0x8991=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x8991,0x135));var _0x1899=function(_0x41af7c,_0x1ffcfa){_0x41af7c=_0x41af7c-0x0;var _0x3ee1a2=_0x8991[_0x41af7c];return _0x3ee1a2;};'use strict';var _=require(_0x1899('0x0'));var util=require(_0x1899('0x1'));var moment=require(_0x1899('0x2'));var BPromise=require(_0x1899('0x3'));var rs=require(_0x1899('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1899('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1899('0x6'));var config=require('../../config/environment');var jayson=require(_0x1899('0x7'));var client=jayson[_0x1899('0x8')][_0x1899('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1697a8,_0x4380cb,_0x2be3d7){return new BPromise(function(_0x3a5738,_0x1264bc){return client[_0x1899('0xa')](_0x1697a8,_0x2be3d7)['then'](function(_0x4d500f){logger[_0x1899('0xb')](_0x1899('0xc'),_0x4380cb,_0x1899('0xd'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4380cb,_0x1899('0xd'),JSON[_0x1899('0xe')](_0x4d500f));if(_0x4d500f[_0x1899('0xf')]){if(_0x4d500f['error'][_0x1899('0x10')]===0x1f4){logger[_0x1899('0xf')]('ZendeskField,\x20%s,\x20%s',_0x4380cb,_0x4d500f['error']['message']);return _0x1264bc(_0x4d500f[_0x1899('0xf')][_0x1899('0x11')]);}logger[_0x1899('0xf')](_0x1899('0xc'),_0x4380cb,_0x4d500f[_0x1899('0xf')][_0x1899('0x11')]);return _0x3a5738(_0x4d500f[_0x1899('0xf')]['message']);}else{logger[_0x1899('0xb')](_0x1899('0xc'),_0x4380cb,'request\x20sent');_0x3a5738(_0x4d500f[_0x1899('0x12')]['message']);}})['catch'](function(_0x19699e){logger[_0x1899('0xf')](_0x1899('0xc'),_0x4380cb,_0x19699e);_0x1264bc(_0x19699e);});});} \ No newline at end of file +var _0xbb20=['ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x3940f7,_0x5e5fef){var _0x572de1=function(_0x3a3848){while(--_0x3a3848){_0x3940f7['push'](_0x3940f7['shift']());}};_0x572de1(++_0x5e5fef);}(_0xbb20,0x8d));var _0x0bb2=function(_0xbf4237,_0x562717){_0xbf4237=_0xbf4237-0x0;var _0x24b797=_0xbb20[_0xbf4237];return _0x24b797;};'use strict';var _=require(_0x0bb2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bb2('0x1'));var db=require(_0x0bb2('0x2'))['db'];var utils=require(_0x0bb2('0x3'));var logger=require(_0x0bb2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bb2('0x5'));var client=jayson[_0x0bb2('0x6')][_0x0bb2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x539cac,_0x3004a4,_0x1465cb){return new BPromise(function(_0x408155,_0x150016){return client[_0x0bb2('0x8')](_0x539cac,_0x1465cb)[_0x0bb2('0x9')](function(_0x3c6250){logger['info'](_0x0bb2('0xa'),_0x3004a4,_0x0bb2('0xb'));logger['debug'](_0x0bb2('0xc'),_0x3004a4,_0x0bb2('0xb'),JSON[_0x0bb2('0xd')](_0x3c6250));if(_0x3c6250[_0x0bb2('0xe')]){if(_0x3c6250['error']['code']===0x1f4){logger[_0x0bb2('0xe')](_0x0bb2('0xa'),_0x3004a4,_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);return _0x150016(_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);}logger[_0x0bb2('0xe')](_0x0bb2('0xa'),_0x3004a4,_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);return _0x408155(_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);}else{logger['info'](_0x0bb2('0xa'),_0x3004a4,'request\x20sent');_0x408155(_0x3c6250[_0x0bb2('0x10')][_0x0bb2('0xf')]);}})['catch'](function(_0x5baace){logger[_0x0bb2('0xe')](_0x0bb2('0xa'),_0x3004a4,_0x5baace);_0x150016(_0x5baace);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index b00e13c..ab7adc8 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 _0xd13a=['show','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index'];(function(_0x11d6d0,_0x52987a){var _0xde6f81=function(_0xd6c62){while(--_0xd6c62){_0x11d6d0['push'](_0x11d6d0['shift']());}};_0xde6f81(++_0x52987a);}(_0xd13a,0x1d8));var _0xad13=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd13a[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xad13('0x0'));var util=require(_0xad13('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad13('0x2'));var router=express[_0xad13('0x3')]();var fs_extra=require(_0xad13('0x4'));var auth=require(_0xad13('0x5'));var interaction=require(_0xad13('0x6'));var config=require(_0xad13('0x7'));var controller=require(_0xad13('0x8'));router[_0xad13('0x9')]('/',auth[_0xad13('0xa')](),controller[_0xad13('0xb')]);router[_0xad13('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xad13('0xc')]);router[_0xad13('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xad13('0x9')](_0xad13('0xd'),auth['isAuthenticated'](),controller[_0xad13('0xe')]);router[_0xad13('0xf')]('/',auth[_0xad13('0xa')](),controller[_0xad13('0x10')]);router[_0xad13('0xf')]('/:id/configurations',auth[_0xad13('0xa')](),controller[_0xad13('0x11')]);router[_0xad13('0x12')](_0xad13('0x13'),auth[_0xad13('0xa')](),controller[_0xad13('0x14')]);router['delete'](_0xad13('0x13'),auth[_0xad13('0xa')](),controller['destroy']);module[_0xad13('0x15')]=router; \ No newline at end of file +var _0xb2f6=['/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x93c5d9,_0x398c9f){var _0x372e18=function(_0x8ccfaf){while(--_0x8ccfaf){_0x93c5d9['push'](_0x93c5d9['shift']());}};_0x372e18(++_0x398c9f);}(_0xb2f6,0x179));var _0x6b2f=function(_0x14397d,_0x4186f5){_0x14397d=_0x14397d-0x0;var _0xaad232=_0xb2f6[_0x14397d];return _0xaad232;};'use strict';var multer=require(_0x6b2f('0x0'));var util=require('util');var path=require(_0x6b2f('0x1'));var timeout=require(_0x6b2f('0x2'));var express=require(_0x6b2f('0x3'));var router=express['Router']();var fs_extra=require(_0x6b2f('0x4'));var auth=require(_0x6b2f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b2f('0x6'));router[_0x6b2f('0x7')]('/',auth[_0x6b2f('0x8')](),controller[_0x6b2f('0x9')]);router['get'](_0x6b2f('0xa'),auth[_0x6b2f('0x8')](),controller[_0x6b2f('0xb')]);router[_0x6b2f('0x7')](_0x6b2f('0xc'),auth[_0x6b2f('0x8')](),controller[_0x6b2f('0xd')]);router['get'](_0x6b2f('0xe'),auth[_0x6b2f('0x8')](),controller[_0x6b2f('0xf')]);router['post']('/',auth[_0x6b2f('0x8')](),controller[_0x6b2f('0x10')]);router[_0x6b2f('0x11')]('/:id/configurations',auth[_0x6b2f('0x8')](),controller[_0x6b2f('0x12')]);router[_0x6b2f('0x13')](_0x6b2f('0xa'),auth['isAuthenticated'](),controller[_0x6b2f('0x14')]);router[_0x6b2f('0x15')]('/:id',auth[_0x6b2f('0x8')](),controller['destroy']);module[_0x6b2f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 4cf7c98..e9965a1 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 _0x4ea3=['STRING','sequelize','exports'];(function(_0x362e87,_0x38d17c){var _0x334244=function(_0x24feb8){while(--_0x24feb8){_0x362e87['push'](_0x362e87['shift']());}};_0x334244(++_0x38d17c);}(_0x4ea3,0x70));var _0x34ea=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4ea3[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x34ea('0x0'));module[_0x34ea('0x1')]={'name':{'type':Sequelize[_0x34ea('0x2')]},'description':{'type':Sequelize[_0x34ea('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x34ea('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x34ea('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x34ea('0x2')]}}; \ No newline at end of file +var _0x41bb=['exports','STRING','sequelize'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x41bb,0xc5));var _0xb41b=function(_0x5f343f,_0x157119){_0x5f343f=_0x5f343f-0x0;var _0x509d92=_0x41bb[_0x5f343f];return _0x509d92;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 674847a..59f69ad 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 _0xa5cf=['filter','VIRTUAL','name','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','serverUrl','zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','send','index','map','ZohoAccount','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa5cf,0xc7));var _0xfa5c=function(_0x2781c9,_0x331c04){_0x2781c9=_0x2781c9-0x0;var _0xb2c661=_0xa5cf[_0x2781c9];return _0xb2c661;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa5c('0x0'));var jsonpatch=require(_0xfa5c('0x1'));var rp=require(_0xfa5c('0x2'));var moment=require(_0xfa5c('0x3'));var BPromise=require(_0xfa5c('0x4'));var Mustache=require(_0xfa5c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfa5c('0x6'));var csv=require(_0xfa5c('0x7'));var ejs=require(_0xfa5c('0x8'));var fs=require('fs');var fs_extra=require(_0xfa5c('0x9'));var _=require(_0xfa5c('0xa'));var squel=require('squel');var crypto=require(_0xfa5c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa5c('0xc'));var toCsv=require(_0xfa5c('0x7'));var querystring=require(_0xfa5c('0xd'));var Papa=require(_0xfa5c('0xe'));var Redis=require(_0xfa5c('0xf'));var authService=require(_0xfa5c('0x10'));var qs=require(_0xfa5c('0x11'));var as=require(_0xfa5c('0x12'));var hardwareService=require(_0xfa5c('0x13'));var logger=require(_0xfa5c('0x14'))('api');var utils=require(_0xfa5c('0x15'));var config=require(_0xfa5c('0x16'));var licenseUtil=require(_0xfa5c('0x17'));var db=require(_0xfa5c('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4812fd,_0x30fba0){_0x30fba0=_0x30fba0||0xcc;return function(_0x2308a6){if(_0x2308a6){return _0x4812fd[_0xfa5c('0x19')](_0x30fba0);}return _0x4812fd[_0xfa5c('0x1a')](_0x30fba0)[_0xfa5c('0x1b')]();};}function respondWithResult(_0x37bd9b,_0x597841){_0x597841=_0x597841||0xc8;return function(_0xf97839){if(_0xf97839){return _0x37bd9b[_0xfa5c('0x1a')](_0x597841)['json'](_0xf97839);}};}function respondWithFilteredResult(_0x47eef2,_0x1759fe){return function(_0xdf0115){if(_0xdf0115){var _0x366c6d=typeof _0x1759fe[_0xfa5c('0x1c')]==='undefined'&&typeof _0x1759fe[_0xfa5c('0x1d')]===_0xfa5c('0x1e');var _0x20cf8e=_0xdf0115[_0xfa5c('0x1f')];var _0x24014a=_0x366c6d?0x0:_0x1759fe[_0xfa5c('0x1c')];var _0x4c0ac1=_0x366c6d?_0xdf0115[_0xfa5c('0x1f')]:_0x1759fe['offset']+_0x1759fe[_0xfa5c('0x1d')];var _0x58eab5;if(_0x4c0ac1>=_0x20cf8e){_0x4c0ac1=_0x20cf8e;_0x58eab5=0xc8;}else{_0x58eab5=0xce;}_0x47eef2[_0xfa5c('0x1a')](_0x58eab5);return _0x47eef2[_0xfa5c('0x20')](_0xfa5c('0x21'),_0x24014a+'-'+_0x4c0ac1+'/'+_0x20cf8e)[_0xfa5c('0x22')](_0xdf0115);}return null;};}function patchUpdates(_0x2ebd78){return function(_0x47ef54){try{jsonpatch[_0xfa5c('0x23')](_0x47ef54,_0x2ebd78,!![]);}catch(_0x2345ad){return BPromise[_0xfa5c('0x24')](_0x2345ad);}return _0x47ef54[_0xfa5c('0x25')]();};}function saveUpdates(_0x12c09b,_0x12fa86){return function(_0x4cb7a4){if(_0x4cb7a4){return _0x4cb7a4[_0xfa5c('0x26')](_0x12c09b)[_0xfa5c('0x27')](function(_0x3b85ec){return _0x3b85ec;});}return null;};}function removeEntity(_0x41cbd0,_0x2d971d){return function(_0x13a92f){if(_0x13a92f){return _0x13a92f[_0xfa5c('0x28')]()[_0xfa5c('0x27')](function(){_0x41cbd0[_0xfa5c('0x1a')](0xcc)[_0xfa5c('0x1b')]();});}};}function handleEntityNotFound(_0x190e0d,_0x4ec4a7){return function(_0x2f7f11){if(!_0x2f7f11){_0x190e0d[_0xfa5c('0x19')](0x194);}return _0x2f7f11;};}function handleError(_0x46fa8c,_0x2a5840){_0x2a5840=_0x2a5840||0x1f4;return function(_0x38d4b3){logger[_0xfa5c('0x29')](_0x38d4b3['stack']);if(_0x38d4b3['name']){delete _0x38d4b3['name'];}_0x46fa8c[_0xfa5c('0x1a')](_0x2a5840)[_0xfa5c('0x2a')](_0x38d4b3);};}exports[_0xfa5c('0x2b')]=function(_0x230209,_0x3bd7e8){var _0x4d1f16={},_0x1bb0b8={},_0x2697e8={'count':0x0,'rows':[]};var _0x425a79=_[_0xfa5c('0x2c')](db[_0xfa5c('0x2d')][_0xfa5c('0x2e')],function(_0x7a2d2f){return{'name':_0x7a2d2f[_0xfa5c('0x2f')],'type':_0x7a2d2f[_0xfa5c('0x30')]['key']};});_0x1bb0b8['model']=_['map'](_0x425a79,'name');_0x1bb0b8['query']=_['keys'](_0x230209[_0xfa5c('0x31')]);_0x1bb0b8[_0xfa5c('0x32')]=_['intersection'](_0x1bb0b8[_0xfa5c('0x33')],_0x1bb0b8[_0xfa5c('0x31')]);_0x4d1f16['attributes']=_[_0xfa5c('0x34')](_0x1bb0b8['model'],qs[_0xfa5c('0x35')](_0x230209[_0xfa5c('0x31')][_0xfa5c('0x35')]));_0x4d1f16['attributes']=_0x4d1f16[_0xfa5c('0x36')][_0xfa5c('0x37')]?_0x4d1f16['attributes']:_0x1bb0b8['model'];if(!_0x230209[_0xfa5c('0x31')]['hasOwnProperty'](_0xfa5c('0x38'))){_0x4d1f16[_0xfa5c('0x1d')]=qs[_0xfa5c('0x1d')](_0x230209[_0xfa5c('0x31')]['limit']);_0x4d1f16[_0xfa5c('0x1c')]=qs[_0xfa5c('0x1c')](_0x230209[_0xfa5c('0x31')][_0xfa5c('0x1c')]);}_0x4d1f16[_0xfa5c('0x39')]=qs[_0xfa5c('0x3a')](_0x230209[_0xfa5c('0x31')][_0xfa5c('0x3a')]);_0x4d1f16[_0xfa5c('0x3b')]=qs[_0xfa5c('0x32')](_[_0xfa5c('0x3c')](_0x230209[_0xfa5c('0x31')],_0x1bb0b8[_0xfa5c('0x32')]),_0x425a79);if(_0x230209[_0xfa5c('0x31')][_0xfa5c('0x3d')]){_0x4d1f16[_0xfa5c('0x3b')]=_['merge'](_0x4d1f16['where'],{'$or':_['map'](_0x425a79,function(_0x5e1161){if(_0x5e1161['type']!==_0xfa5c('0x3e')){var _0x36fa6a={};_0x36fa6a[_0x5e1161[_0xfa5c('0x3f')]]={'$like':'%'+_0x230209['query'][_0xfa5c('0x3d')]+'%'};return _0x36fa6a;}})});}_0x4d1f16=_[_0xfa5c('0x40')]({},_0x4d1f16,_0x230209[_0xfa5c('0x41')]);var _0x2412fb={'where':_0x4d1f16[_0xfa5c('0x3b')]};return db[_0xfa5c('0x2d')][_0xfa5c('0x1f')](_0x2412fb)[_0xfa5c('0x27')](function(_0x44ec2b){_0x2697e8[_0xfa5c('0x1f')]=_0x44ec2b;if(_0x230209[_0xfa5c('0x31')][_0xfa5c('0x42')]){_0x4d1f16[_0xfa5c('0x43')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x4d1f16);})[_0xfa5c('0x27')](function(_0x47692b){_0x2697e8[_0xfa5c('0x44')]=_0x47692b;return _0x2697e8;})[_0xfa5c('0x27')](respondWithFilteredResult(_0x3bd7e8,_0x4d1f16))[_0xfa5c('0x45')](handleError(_0x3bd7e8,null));};exports['show']=function(_0x39835c,_0x4389eb){var _0x3289f5={'raw':![],'where':{'id':_0x39835c[_0xfa5c('0x46')]['id']}},_0x2969a2={};_0x2969a2['model']=_['keys'](db[_0xfa5c('0x2d')][_0xfa5c('0x2e')]);_0x2969a2[_0xfa5c('0x31')]=_[_0xfa5c('0x47')](_0x39835c['query']);_0x2969a2[_0xfa5c('0x32')]=_[_0xfa5c('0x34')](_0x2969a2['model'],_0x2969a2[_0xfa5c('0x31')]);_0x3289f5[_0xfa5c('0x36')]=_[_0xfa5c('0x34')](_0x2969a2[_0xfa5c('0x33')],qs[_0xfa5c('0x35')](_0x39835c[_0xfa5c('0x31')][_0xfa5c('0x35')]));_0x3289f5['attributes']=_0x3289f5['attributes']['length']?_0x3289f5['attributes']:_0x2969a2['model'];if(_0x39835c[_0xfa5c('0x31')][_0xfa5c('0x42')]){_0x3289f5[_0xfa5c('0x43')]=[{'all':!![]}];}_0x3289f5=_['merge']({},_0x3289f5,_0x39835c[_0xfa5c('0x41')]);return db['ZohoAccount'][_0xfa5c('0x48')](_0x3289f5)['then'](handleEntityNotFound(_0x4389eb,null))['then'](respondWithResult(_0x4389eb,null))['catch'](handleError(_0x4389eb,null));};exports[_0xfa5c('0x49')]=function(_0x554c16,_0x38a58e){return db[_0xfa5c('0x2d')][_0xfa5c('0x49')](_0x554c16['body'],{})['then'](respondWithResult(_0x38a58e,0xc9))[_0xfa5c('0x45')](handleError(_0x38a58e,null));};exports['update']=function(_0x2f90bc,_0x14cc54){if(_0x2f90bc[_0xfa5c('0x4a')]['id']){delete _0x2f90bc[_0xfa5c('0x4a')]['id'];}return db[_0xfa5c('0x2d')][_0xfa5c('0x48')]({'where':{'id':_0x2f90bc[_0xfa5c('0x46')]['id']}})[_0xfa5c('0x27')](handleEntityNotFound(_0x14cc54,null))[_0xfa5c('0x27')](saveUpdates(_0x2f90bc[_0xfa5c('0x4a')],null))[_0xfa5c('0x27')](respondWithResult(_0x14cc54,null))[_0xfa5c('0x45')](handleError(_0x14cc54,null));};exports[_0xfa5c('0x28')]=function(_0x310395,_0xb71728){return db[_0xfa5c('0x2d')][_0xfa5c('0x48')]({'where':{'id':_0x310395[_0xfa5c('0x46')]['id']}})[_0xfa5c('0x27')](handleEntityNotFound(_0xb71728,null))[_0xfa5c('0x27')](removeEntity(_0xb71728,null))[_0xfa5c('0x45')](handleError(_0xb71728,null));};exports[_0xfa5c('0x4b')]=function(_0x2c4dc9,_0x1882eb,_0x56d676){var _0x661e1c={};var _0x5b019b={};var _0x52baf6;var _0x3b3636;return db['ZohoAccount'][_0xfa5c('0x4c')]({'where':{'id':_0x2c4dc9[_0xfa5c('0x46')]['id']}})[_0xfa5c('0x27')](handleEntityNotFound(_0x1882eb,null))[_0xfa5c('0x27')](function(_0x335afc){if(_0x335afc){_0x52baf6=_0x335afc;_0x5b019b['model']=_[_0xfa5c('0x47')](db[_0xfa5c('0x4d')]['rawAttributes']);_0x5b019b['query']=_[_0xfa5c('0x47')](_0x2c4dc9['query']);_0x5b019b[_0xfa5c('0x32')]=_[_0xfa5c('0x34')](_0x5b019b[_0xfa5c('0x33')],_0x5b019b[_0xfa5c('0x31')]);_0x661e1c[_0xfa5c('0x36')]=_[_0xfa5c('0x34')](_0x5b019b[_0xfa5c('0x33')],qs['fields'](_0x2c4dc9[_0xfa5c('0x31')][_0xfa5c('0x35')]));_0x661e1c[_0xfa5c('0x36')]=_0x661e1c[_0xfa5c('0x36')][_0xfa5c('0x37')]?_0x661e1c[_0xfa5c('0x36')]:_0x5b019b[_0xfa5c('0x33')];_0x661e1c[_0xfa5c('0x39')]=qs['sort'](_0x2c4dc9[_0xfa5c('0x31')][_0xfa5c('0x3a')]);_0x661e1c[_0xfa5c('0x3b')]=qs['filters'](_['pick'](_0x2c4dc9[_0xfa5c('0x31')],_0x5b019b[_0xfa5c('0x32')]));if(_0x2c4dc9[_0xfa5c('0x31')]['filter']){_0x661e1c[_0xfa5c('0x3b')]=_[_0xfa5c('0x40')](_0x661e1c[_0xfa5c('0x3b')],{'$or':_[_0xfa5c('0x2c')](_0x661e1c[_0xfa5c('0x36')],function(_0x2c2ab0){var _0x477418={};_0x477418[_0x2c2ab0]={'$like':'%'+_0x2c4dc9[_0xfa5c('0x31')][_0xfa5c('0x3d')]+'%'};return _0x477418;})});}_0x661e1c=_[_0xfa5c('0x40')]({},_0x661e1c,_0x2c4dc9[_0xfa5c('0x41')]);return _0x52baf6[_0xfa5c('0x4b')](_0x661e1c);}})[_0xfa5c('0x27')](function(_0x51610d){if(_0x51610d){_0x3b3636=_0x51610d[_0xfa5c('0x37')];if(!_0x2c4dc9['query'][_0xfa5c('0x4e')](_0xfa5c('0x38'))){_0x661e1c[_0xfa5c('0x1d')]=qs[_0xfa5c('0x1d')](_0x2c4dc9[_0xfa5c('0x31')][_0xfa5c('0x1d')]);_0x661e1c[_0xfa5c('0x1c')]=qs['offset'](_0x2c4dc9[_0xfa5c('0x31')][_0xfa5c('0x1c')]);}return _0x52baf6['getConfigurations'](_0x661e1c);}})[_0xfa5c('0x27')](function(_0x4c37db){if(_0x4c37db){return _0x4c37db?{'count':_0x3b3636,'rows':_0x4c37db}:null;}})[_0xfa5c('0x27')](respondWithResult(_0x1882eb,null))[_0xfa5c('0x45')](handleError(_0x1882eb,null));};exports[_0xfa5c('0x4f')]=function(_0x575613,_0x51d50d,_0xa06649){if(_0x575613[_0xfa5c('0x4a')]['id']){delete _0x575613['body']['id'];}return db[_0xfa5c('0x2d')][_0xfa5c('0x4c')]({'where':{'id':_0x575613['params']['id']}})['then'](handleEntityNotFound(_0x51d50d,null))[_0xfa5c('0x27')](function(_0x58c821){if(_0x58c821){_0x575613[_0xfa5c('0x4a')][_0xfa5c('0x50')]=_0x58c821['id'];_0x575613[_0xfa5c('0x4a')][_0xfa5c('0x51')]=integrations[_0xfa5c('0x52')](_0x575613['body'][_0xfa5c('0x53')],_0x575613['body'][_0xfa5c('0x30')]);_0x575613[_0xfa5c('0x4a')][_0xfa5c('0x54')]=integrations[_0xfa5c('0x55')](_0x575613[_0xfa5c('0x4a')]['channel'],_0x575613['body'][_0xfa5c('0x30')]);return db[_0xfa5c('0x4d')]['create'](_0x575613[_0xfa5c('0x4a')],{'include':[{'model':db[_0xfa5c('0x56')],'as':_0xfa5c('0x51')},{'model':db['ZohoField'],'as':_0xfa5c('0x54')}]});}return null;})['then'](respondWithResult(_0x51d50d,null))[_0xfa5c('0x45')](handleError(_0x51d50d,null));};function getAccessToken(_0x53a800){return new Promise(function(_0x4084e5,_0x17e61f){var _0x47eeca;switch(_0x53a800[_0xfa5c('0x57')]){case'US':_0x47eeca=_0xfa5c('0x58');break;case'AU':_0x47eeca=_0xfa5c('0x59');break;case'EU':_0x47eeca=_0xfa5c('0x5a');break;case'IN':_0x47eeca=_0xfa5c('0x5b');break;case'CN':_0x47eeca=_0xfa5c('0x5c');break;default:_0x47eeca=_0xfa5c('0x5a');break;}var _0x371a3f={'method':'POST','uri':_0x47eeca+_0xfa5c('0x5d'),'qs':{'refresh_token':_0x53a800[_0xfa5c('0x5e')],'client_id':_0x53a800['clientId'],'client_secret':_0x53a800[_0xfa5c('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x371a3f)[_0xfa5c('0x27')](function(_0x22f822){if(_0x22f822['access_token']){_0x4084e5(_0x22f822[_0xfa5c('0x60')]);}else{_0x17e61f(_0xfa5c('0x61'));}})[_0xfa5c('0x45')](function(_0x579cd0){_0x17e61f(_0x579cd0);});});}exports['getFields']=function(_0x491190,_0x3089d5,_0x4d8ad4){var _0x49ffb0,_0x11ff16,_0x34b27a,_0x18edc0,_0x566764;return db[_0xfa5c('0x2d')][_0xfa5c('0x4c')]({'where':{'id':_0x491190[_0xfa5c('0x46')]['id']},'attributes':['id',_0xfa5c('0x62'),_0xfa5c('0x57'),_0xfa5c('0x63'),_0xfa5c('0x5f'),_0xfa5c('0x64'),'code',_0xfa5c('0x5e')]})[_0xfa5c('0x27')](handleEntityNotFound(_0x3089d5,null))['then'](function(_0x3f6924){_0x566764=_0x3f6924;_0x49ffb0=_0x566764[_0xfa5c('0x62')];_0x11ff16=_0x49ffb0===_0xfa5c('0x65')?'eu':'com';_0x34b27a=_0x566764[_0xfa5c('0x64')];var _0x3f9046=_0x34b27a[_0xfa5c('0x66')](-0x1);if(_0x3f9046==='/'||_0x3f9046==='\x5c'||_0x3f9046===':'){_0x34b27a=_0x34b27a['substring'](0x0,_0x34b27a[_0xfa5c('0x67')](_0x3f9046));}if(!_0x566764[_0xfa5c('0x5e')]){throw new Error(_0xfa5c('0x68'));}return getAccessToken(_0x566764);})[_0xfa5c('0x27')](function(_0x512c1b){if(_0x512c1b){return rp({'method':_0xfa5c('0x69'),'uri':util['format'](_0xfa5c('0x6a'),_0x11ff16),'qs':{'module':'Calls'},'headers':{'Authorization':_0xfa5c('0x6b')+_0x512c1b},'json':!![]});}})[_0xfa5c('0x27')](function(_0x2851fb){if(_0x2851fb){if(_0x2851fb[_0xfa5c('0x6c')]&&_0x2851fb['response'][_0xfa5c('0x29')]){throw new Error(_0x2851fb[_0xfa5c('0x6c')]['error'][_0xfa5c('0x6d')]);}var _0x1e81b7=[];var _0x3a4eb8=[];var _0x59940e=[_0xfa5c('0x6e'),_0xfa5c('0x6f'),_0xfa5c('0x70'),_0xfa5c('0x71'),_0xfa5c('0x72'),_0xfa5c('0x73'),_0xfa5c('0x74'),_0xfa5c('0x75')];_0x3a4eb8=_[_0xfa5c('0x76')](_0x2851fb[_0xfa5c('0x35')],function(_0x2ee010){return _0x59940e[_0xfa5c('0x77')](_0x2ee010[_0xfa5c('0x78')]);});for(var _0x13eab5=0x0;_0x13eab5<_0x3a4eb8['length'];_0x13eab5++){if(_0x3a4eb8[_0x13eab5][_0xfa5c('0x79')]===![]){_0x1e81b7[_0xfa5c('0x7a')]({'id':_0x3a4eb8[_0x13eab5]['id'],'name':_0x3a4eb8[_0x13eab5][_0xfa5c('0x7b')],'custom':_0x3a4eb8[_0x13eab5]['custom_field'],'options':_0x3a4eb8[_0x13eab5][_0xfa5c('0x7c')]===_0xfa5c('0x7d')&&_0x3a4eb8[_0x13eab5]['pick_list_values'][_0xfa5c('0x37')]>-0x1?_[_0xfa5c('0x2c')](_0x3a4eb8[_0x13eab5][_0xfa5c('0x7e')],function(_0x1bd3a7){return{'name':_0x1bd3a7,'value':_0x1bd3a7};}):[]});}}return{'count':_0x1e81b7[_0xfa5c('0x37')],'rows':_0x1e81b7};}else{return{'count':0x0,'rows':[]};}})[_0xfa5c('0x27')](respondWithResult(_0x3089d5,null))[_0xfa5c('0x45')](function(_0x33b3cd){var _0x93864b=_0x491190['query']['test']?0x1f4:_0x33b3cd[_0xfa5c('0x7f')]||0x1f4;logger['error'](_0xfa5c('0x80'),'getFields',_0x93864b,JSON[_0xfa5c('0x81')](_0x33b3cd));delete _0x33b3cd[_0xfa5c('0x3f')];if(_0x93864b===0x191){_0x93864b=0x190;}_0x3089d5[_0xfa5c('0x1a')](_0x93864b)[_0xfa5c('0x2a')](_0x491190[_0xfa5c('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x33b3cd[_0xfa5c('0x7f')]}:_0x33b3cd);});}; \ No newline at end of file +var _0x2227=['getFields','stringify','send','test','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','find','create','body','ZohoConfiguration','order','getConfigurations','addConfiguration','findOne','params','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','host','serverUrl','code','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','error','message','Description','Call_Result','Call_Start_Time','includes','push','display_label','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x36fafd,_0x5bfa3a){var _0x150b3b=function(_0xf2052d){while(--_0xf2052d){_0x36fafd['push'](_0x36fafd['shift']());}};_0x150b3b(++_0x5bfa3a);}(_0x2227,0x18c));var _0x7222=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x2227[_0x29e3b6];return _0x55d4b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7222('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7222('0x1'));var rp=require(_0x7222('0x2'));var moment=require(_0x7222('0x3'));var BPromise=require(_0x7222('0x4'));var Mustache=require(_0x7222('0x5'));var util=require(_0x7222('0x6'));var path=require(_0x7222('0x7'));var sox=require(_0x7222('0x8'));var csv=require('to-csv');var ejs=require(_0x7222('0x9'));var fs=require('fs');var fs_extra=require(_0x7222('0xa'));var _=require('lodash');var squel=require(_0x7222('0xb'));var crypto=require(_0x7222('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7222('0xd'));var toCsv=require(_0x7222('0xe'));var querystring=require(_0x7222('0xf'));var Papa=require(_0x7222('0x10'));var Redis=require(_0x7222('0x11'));var authService=require(_0x7222('0x12'));var qs=require(_0x7222('0x13'));var as=require(_0x7222('0x14'));var hardwareService=require(_0x7222('0x15'));var logger=require(_0x7222('0x16'))(_0x7222('0x17'));var utils=require(_0x7222('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7222('0x19'));var db=require(_0x7222('0x1a'))['db'];var integrations=require(_0x7222('0x1b'));function respondWithStatusCode(_0x327803,_0x26ebfc){_0x26ebfc=_0x26ebfc||0xcc;return function(_0x207ac6){if(_0x207ac6){return _0x327803[_0x7222('0x1c')](_0x26ebfc);}return _0x327803[_0x7222('0x1d')](_0x26ebfc)[_0x7222('0x1e')]();};}function respondWithResult(_0x1668cc,_0x5ad45f){_0x5ad45f=_0x5ad45f||0xc8;return function(_0x1dfa11){if(_0x1dfa11){return _0x1668cc['status'](_0x5ad45f)['json'](_0x1dfa11);}};}function respondWithFilteredResult(_0x5d13ac,_0x46ea17){return function(_0x10181e){if(_0x10181e){var _0x104207=typeof _0x46ea17[_0x7222('0x1f')]===_0x7222('0x20')&&typeof _0x46ea17[_0x7222('0x21')]===_0x7222('0x20');var _0x3c5fab=_0x10181e[_0x7222('0x22')];var _0x547d00=_0x104207?0x0:_0x46ea17['offset'];var _0x5769b2=_0x104207?_0x10181e[_0x7222('0x22')]:_0x46ea17[_0x7222('0x1f')]+_0x46ea17['limit'];var _0x18fb65;if(_0x5769b2>=_0x3c5fab){_0x5769b2=_0x3c5fab;_0x18fb65=0xc8;}else{_0x18fb65=0xce;}_0x5d13ac['status'](_0x18fb65);return _0x5d13ac[_0x7222('0x23')](_0x7222('0x24'),_0x547d00+'-'+_0x5769b2+'/'+_0x3c5fab)[_0x7222('0x25')](_0x10181e);}return null;};}function patchUpdates(_0x351b95){return function(_0x6ec01c){try{jsonpatch[_0x7222('0x26')](_0x6ec01c,_0x351b95,!![]);}catch(_0x5e5365){return BPromise[_0x7222('0x27')](_0x5e5365);}return _0x6ec01c[_0x7222('0x28')]();};}function saveUpdates(_0xee6d87,_0x1b7d24){return function(_0x31f7f9){if(_0x31f7f9){return _0x31f7f9[_0x7222('0x29')](_0xee6d87)[_0x7222('0x2a')](function(_0x9da5e0){return _0x9da5e0;});}return null;};}function removeEntity(_0x53cac4,_0x138982){return function(_0x31db59){if(_0x31db59){return _0x31db59[_0x7222('0x2b')]()[_0x7222('0x2a')](function(){_0x53cac4[_0x7222('0x1d')](0xcc)[_0x7222('0x1e')]();});}};}function handleEntityNotFound(_0x1c191b,_0x2d0791){return function(_0x28a5d1){if(!_0x28a5d1){_0x1c191b[_0x7222('0x1c')](0x194);}return _0x28a5d1;};}function handleError(_0x2ea2d2,_0x4a9d2f){_0x4a9d2f=_0x4a9d2f||0x1f4;return function(_0x5b4136){logger['error'](_0x5b4136['stack']);if(_0x5b4136[_0x7222('0x2c')]){delete _0x5b4136['name'];}_0x2ea2d2[_0x7222('0x1d')](_0x4a9d2f)['send'](_0x5b4136);};}exports['index']=function(_0xa6666a,_0x1d401c){var _0x3e7a32={},_0x56f80c={},_0x1fd908={'count':0x0,'rows':[]};var _0x18342b=_[_0x7222('0x2d')](db['ZohoAccount'][_0x7222('0x2e')],function(_0x435cc9){return{'name':_0x435cc9[_0x7222('0x2f')],'type':_0x435cc9['type'][_0x7222('0x30')]};});_0x56f80c[_0x7222('0x31')]=_['map'](_0x18342b,'name');_0x56f80c[_0x7222('0x32')]=_[_0x7222('0x33')](_0xa6666a['query']);_0x56f80c['filters']=_['intersection'](_0x56f80c['model'],_0x56f80c[_0x7222('0x32')]);_0x3e7a32[_0x7222('0x34')]=_[_0x7222('0x35')](_0x56f80c[_0x7222('0x31')],qs[_0x7222('0x36')](_0xa6666a[_0x7222('0x32')]['fields']));_0x3e7a32['attributes']=_0x3e7a32['attributes'][_0x7222('0x37')]?_0x3e7a32[_0x7222('0x34')]:_0x56f80c[_0x7222('0x31')];if(!_0xa6666a[_0x7222('0x32')][_0x7222('0x38')](_0x7222('0x39'))){_0x3e7a32[_0x7222('0x21')]=qs[_0x7222('0x21')](_0xa6666a['query']['limit']);_0x3e7a32[_0x7222('0x1f')]=qs['offset'](_0xa6666a[_0x7222('0x32')][_0x7222('0x1f')]);}_0x3e7a32['order']=qs[_0x7222('0x3a')](_0xa6666a['query'][_0x7222('0x3a')]);_0x3e7a32[_0x7222('0x3b')]=qs[_0x7222('0x3c')](_[_0x7222('0x3d')](_0xa6666a[_0x7222('0x32')],_0x56f80c['filters']),_0x18342b);if(_0xa6666a[_0x7222('0x32')][_0x7222('0x3e')]){_0x3e7a32['where']=_[_0x7222('0x3f')](_0x3e7a32['where'],{'$or':_[_0x7222('0x2d')](_0x18342b,function(_0x5d4735){if(_0x5d4735[_0x7222('0x40')]!==_0x7222('0x41')){var _0x5e2916={};_0x5e2916[_0x5d4735[_0x7222('0x2c')]]={'$like':'%'+_0xa6666a[_0x7222('0x32')]['filter']+'%'};return _0x5e2916;}})});}_0x3e7a32=_['merge']({},_0x3e7a32,_0xa6666a[_0x7222('0x42')]);var _0x55bdfe={'where':_0x3e7a32[_0x7222('0x3b')]};return db[_0x7222('0x43')][_0x7222('0x22')](_0x55bdfe)[_0x7222('0x2a')](function(_0x444052){_0x1fd908[_0x7222('0x22')]=_0x444052;if(_0xa6666a[_0x7222('0x32')][_0x7222('0x44')]){_0x3e7a32[_0x7222('0x45')]=[{'all':!![]}];}return db[_0x7222('0x43')][_0x7222('0x46')](_0x3e7a32);})[_0x7222('0x2a')](function(_0x40e9c2){_0x1fd908[_0x7222('0x47')]=_0x40e9c2;return _0x1fd908;})[_0x7222('0x2a')](respondWithFilteredResult(_0x1d401c,_0x3e7a32))[_0x7222('0x48')](handleError(_0x1d401c,null));};exports[_0x7222('0x49')]=function(_0xc16849,_0x11304c){var _0x2fb96d={'raw':![],'where':{'id':_0xc16849['params']['id']}},_0x2a7ea2={};_0x2a7ea2[_0x7222('0x31')]=_[_0x7222('0x33')](db[_0x7222('0x43')][_0x7222('0x2e')]);_0x2a7ea2[_0x7222('0x32')]=_[_0x7222('0x33')](_0xc16849[_0x7222('0x32')]);_0x2a7ea2['filters']=_[_0x7222('0x35')](_0x2a7ea2[_0x7222('0x31')],_0x2a7ea2[_0x7222('0x32')]);_0x2fb96d['attributes']=_[_0x7222('0x35')](_0x2a7ea2[_0x7222('0x31')],qs[_0x7222('0x36')](_0xc16849[_0x7222('0x32')][_0x7222('0x36')]));_0x2fb96d[_0x7222('0x34')]=_0x2fb96d[_0x7222('0x34')][_0x7222('0x37')]?_0x2fb96d[_0x7222('0x34')]:_0x2a7ea2['model'];if(_0xc16849[_0x7222('0x32')][_0x7222('0x44')]){_0x2fb96d[_0x7222('0x45')]=[{'all':!![]}];}_0x2fb96d=_['merge']({},_0x2fb96d,_0xc16849['options']);return db['ZohoAccount'][_0x7222('0x4a')](_0x2fb96d)['then'](handleEntityNotFound(_0x11304c,null))['then'](respondWithResult(_0x11304c,null))['catch'](handleError(_0x11304c,null));};exports['create']=function(_0x2bebb6,_0x440430){return db['ZohoAccount'][_0x7222('0x4b')](_0x2bebb6['body'],{})[_0x7222('0x2a')](respondWithResult(_0x440430,0xc9))['catch'](handleError(_0x440430,null));};exports[_0x7222('0x29')]=function(_0x5821aa,_0x229439){if(_0x5821aa[_0x7222('0x4c')]['id']){delete _0x5821aa['body']['id'];}return db[_0x7222('0x43')][_0x7222('0x4a')]({'where':{'id':_0x5821aa['params']['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x229439,null))['then'](saveUpdates(_0x5821aa[_0x7222('0x4c')],null))[_0x7222('0x2a')](respondWithResult(_0x229439,null))[_0x7222('0x48')](handleError(_0x229439,null));};exports[_0x7222('0x2b')]=function(_0x4777fd,_0x462fcc){return db[_0x7222('0x43')][_0x7222('0x4a')]({'where':{'id':_0x4777fd['params']['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x462fcc,null))[_0x7222('0x2a')](removeEntity(_0x462fcc,null))[_0x7222('0x48')](handleError(_0x462fcc,null));};exports['getConfigurations']=function(_0x670a28,_0x4444ff,_0x13acfa){var _0x1a914e={};var _0x5bf7f0={};var _0x1da13d;var _0x3bb8b0;return db['ZohoAccount']['findOne']({'where':{'id':_0x670a28['params']['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x4444ff,null))['then'](function(_0x2d4524){if(_0x2d4524){_0x1da13d=_0x2d4524;_0x5bf7f0['model']=_[_0x7222('0x33')](db[_0x7222('0x4d')]['rawAttributes']);_0x5bf7f0['query']=_[_0x7222('0x33')](_0x670a28[_0x7222('0x32')]);_0x5bf7f0[_0x7222('0x3c')]=_[_0x7222('0x35')](_0x5bf7f0[_0x7222('0x31')],_0x5bf7f0['query']);_0x1a914e['attributes']=_[_0x7222('0x35')](_0x5bf7f0[_0x7222('0x31')],qs[_0x7222('0x36')](_0x670a28[_0x7222('0x32')][_0x7222('0x36')]));_0x1a914e['attributes']=_0x1a914e[_0x7222('0x34')]['length']?_0x1a914e[_0x7222('0x34')]:_0x5bf7f0['model'];_0x1a914e[_0x7222('0x4e')]=qs[_0x7222('0x3a')](_0x670a28[_0x7222('0x32')]['sort']);_0x1a914e[_0x7222('0x3b')]=qs[_0x7222('0x3c')](_[_0x7222('0x3d')](_0x670a28['query'],_0x5bf7f0[_0x7222('0x3c')]));if(_0x670a28[_0x7222('0x32')][_0x7222('0x3e')]){_0x1a914e[_0x7222('0x3b')]=_[_0x7222('0x3f')](_0x1a914e[_0x7222('0x3b')],{'$or':_[_0x7222('0x2d')](_0x1a914e[_0x7222('0x34')],function(_0x33567c){var _0x3dc138={};_0x3dc138[_0x33567c]={'$like':'%'+_0x670a28[_0x7222('0x32')][_0x7222('0x3e')]+'%'};return _0x3dc138;})});}_0x1a914e=_[_0x7222('0x3f')]({},_0x1a914e,_0x670a28[_0x7222('0x42')]);return _0x1da13d[_0x7222('0x4f')](_0x1a914e);}})['then'](function(_0x47a260){if(_0x47a260){_0x3bb8b0=_0x47a260[_0x7222('0x37')];if(!_0x670a28[_0x7222('0x32')][_0x7222('0x38')]('nolimit')){_0x1a914e[_0x7222('0x21')]=qs[_0x7222('0x21')](_0x670a28[_0x7222('0x32')][_0x7222('0x21')]);_0x1a914e[_0x7222('0x1f')]=qs[_0x7222('0x1f')](_0x670a28[_0x7222('0x32')][_0x7222('0x1f')]);}return _0x1da13d['getConfigurations'](_0x1a914e);}})['then'](function(_0x3f5d02){if(_0x3f5d02){return _0x3f5d02?{'count':_0x3bb8b0,'rows':_0x3f5d02}:null;}})[_0x7222('0x2a')](respondWithResult(_0x4444ff,null))[_0x7222('0x48')](handleError(_0x4444ff,null));};exports[_0x7222('0x50')]=function(_0x206b54,_0x35bd9b,_0x1a9860){if(_0x206b54['body']['id']){delete _0x206b54[_0x7222('0x4c')]['id'];}return db[_0x7222('0x43')][_0x7222('0x51')]({'where':{'id':_0x206b54[_0x7222('0x52')]['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x35bd9b,null))[_0x7222('0x2a')](function(_0x3cf2eb){if(_0x3cf2eb){_0x206b54[_0x7222('0x4c')][_0x7222('0x53')]=_0x3cf2eb['id'];_0x206b54[_0x7222('0x4c')][_0x7222('0x54')]=integrations['getSubjects'](_0x206b54['body']['channel'],_0x206b54[_0x7222('0x4c')][_0x7222('0x40')]);_0x206b54[_0x7222('0x4c')][_0x7222('0x55')]=integrations[_0x7222('0x56')](_0x206b54[_0x7222('0x4c')][_0x7222('0x57')],_0x206b54['body'][_0x7222('0x40')]);return db[_0x7222('0x4d')][_0x7222('0x4b')](_0x206b54[_0x7222('0x4c')],{'include':[{'model':db[_0x7222('0x58')],'as':_0x7222('0x54')},{'model':db[_0x7222('0x58')],'as':_0x7222('0x55')}]});}return null;})[_0x7222('0x2a')](respondWithResult(_0x35bd9b,null))['catch'](handleError(_0x35bd9b,null));};function getAccessToken(_0x28db60){return new Promise(function(_0x135a47,_0x5f8451){var _0x258bab;switch(_0x28db60[_0x7222('0x59')]){case'US':_0x258bab=_0x7222('0x5a');break;case'AU':_0x258bab=_0x7222('0x5b');break;case'EU':_0x258bab=_0x7222('0x5c');break;case'IN':_0x258bab='https://accounts.zoho.in';break;case'CN':_0x258bab=_0x7222('0x5d');break;default:_0x258bab='https://accounts.zoho.eu';break;}var _0xef364e={'method':_0x7222('0x5e'),'uri':_0x258bab+'/oauth/v2/token','qs':{'refresh_token':_0x28db60[_0x7222('0x5f')],'client_id':_0x28db60[_0x7222('0x60')],'client_secret':_0x28db60[_0x7222('0x61')],'grant_type':_0x7222('0x62')},'json':!![]};return rp(_0xef364e)['then'](function(_0x49b14c){if(_0x49b14c[_0x7222('0x63')]){_0x135a47(_0x49b14c[_0x7222('0x63')]);}else{_0x5f8451('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x7222('0x48')](function(_0x187229){_0x5f8451(_0x187229);});});}exports['getFields']=function(_0xd0b9ad,_0x16b19e,_0xad000a){var _0x54023a,_0x247036,_0xb270f9,_0x47afcb,_0x5b01d9;return db[_0x7222('0x43')]['findOne']({'where':{'id':_0xd0b9ad[_0x7222('0x52')]['id']},'attributes':['id',_0x7222('0x64'),_0x7222('0x59'),_0x7222('0x60'),_0x7222('0x61'),_0x7222('0x65'),_0x7222('0x66'),'refreshToken']})['then'](handleEntityNotFound(_0x16b19e,null))[_0x7222('0x2a')](function(_0x1a0b6e){_0x5b01d9=_0x1a0b6e;_0x54023a=_0x5b01d9['host'];_0x247036=_0x54023a==='zoho.eu'?'eu':_0x7222('0x67');_0xb270f9=_0x5b01d9[_0x7222('0x65')];var _0x5531ed=_0xb270f9[_0x7222('0x68')](-0x1);if(_0x5531ed==='/'||_0x5531ed==='\x5c'||_0x5531ed===':'){_0xb270f9=_0xb270f9[_0x7222('0x69')](0x0,_0xb270f9['lastIndexOf'](_0x5531ed));}if(!_0x5b01d9[_0x7222('0x5f')]){throw new Error(_0x7222('0x6a'));}return getAccessToken(_0x5b01d9);})['then'](function(_0x361d53){if(_0x361d53){return rp({'method':'GET','uri':util[_0x7222('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x247036),'qs':{'module':_0x7222('0x6c')},'headers':{'Authorization':_0x7222('0x6d')+_0x361d53},'json':!![]});}})[_0x7222('0x2a')](function(_0x256945){if(_0x256945){if(_0x256945[_0x7222('0x6e')]&&_0x256945[_0x7222('0x6e')]['error']){throw new Error(_0x256945[_0x7222('0x6e')][_0x7222('0x6f')][_0x7222('0x70')]);}var _0x2ef3c5=[];var _0x5d9750=[];var _0xec8883=['Owner','Subject',_0x7222('0x71'),'WhoId','Call_Duration',_0x7222('0x72'),_0x7222('0x73'),'Call_Type'];_0x5d9750=_['remove'](_0x256945[_0x7222('0x36')],function(_0x3babca){return _0xec8883[_0x7222('0x74')](_0x3babca['api_name']);});for(var _0x481485=0x0;_0x481485<_0x5d9750[_0x7222('0x37')];_0x481485++){if(_0x5d9750[_0x481485]['system_mandatory']===![]){_0x2ef3c5[_0x7222('0x75')]({'id':_0x5d9750[_0x481485]['id'],'name':_0x5d9750[_0x481485][_0x7222('0x76')],'custom':_0x5d9750[_0x481485][_0x7222('0x77')],'options':_0x5d9750[_0x481485][_0x7222('0x78')]===_0x7222('0x79')&&_0x5d9750[_0x481485]['pick_list_values'][_0x7222('0x37')]>-0x1?_[_0x7222('0x2d')](_0x5d9750[_0x481485][_0x7222('0x7a')],function(_0x4c02f2){return{'name':_0x4c02f2,'value':_0x4c02f2};}):[]});}}return{'count':_0x2ef3c5['length'],'rows':_0x2ef3c5};}else{return{'count':0x0,'rows':[]};}})[_0x7222('0x2a')](respondWithResult(_0x16b19e,null))[_0x7222('0x48')](function(_0x313202){var _0x7b0f12=_0xd0b9ad[_0x7222('0x32')]['test']?0x1f4:_0x313202['statusCode']||0x1f4;logger[_0x7222('0x6f')](_0x7222('0x7b'),_0x7222('0x7c'),_0x7b0f12,JSON[_0x7222('0x7d')](_0x313202));delete _0x313202['name'];if(_0x7b0f12===0x191){_0x7b0f12=0x190;}_0x16b19e[_0x7222('0x1d')](_0x7b0f12)[_0x7222('0x7e')](_0xd0b9ad[_0x7222('0x32')][_0x7222('0x7f')]?{'message':_0x7222('0x80'),'statusCode':_0x313202[_0x7222('0x81')]}:_0x313202);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index fe82e9b..f95485f 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 _0x1151=['code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','clientId','https://accounts.zoho.com.cn','POST','then','refreshToken','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret'];(function(_0x516faf,_0x511e9d){var _0x1432f3=function(_0x2c2b39){while(--_0x2c2b39){_0x516faf['push'](_0x516faf['shift']());}};_0x1432f3(++_0x511e9d);}(_0x1151,0x6e));var _0x1115=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x1151[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x1115('0x0'));var util=require(_0x1115('0x1'));var logger=require(_0x1115('0x2'))('api');var moment=require(_0x1115('0x3'));var BPromise=require(_0x1115('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1115('0x5'));var rimraf=require(_0x1115('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x1115('0x7'));module[_0x1115('0x8')]=function(_0x1b2133,_0x14bcd7){return _0x1b2133[_0x1115('0x9')](_0x1115('0xa'),attributes,{'tableName':_0x1115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x83ea22,_0x46a8af,_0xebf95b){if(_0x83ea22[_0x1115('0xc')](_0x1115('0xd'))||_0x83ea22[_0x1115('0xc')](_0x1115('0xe'))||_0x83ea22['changed']('clientId')||_0x83ea22[_0x1115('0xc')](_0x1115('0xf'))||_0x83ea22[_0x1115('0xc')](_0x1115('0x10'))||_0x83ea22[_0x1115('0xc')](_0x1115('0x11'))){var _0x2a6c4d,_0x1ad6ae;_0x2a6c4d=_0x83ea22['serverUrl'];var _0x53df5c=_0x2a6c4d[_0x1115('0x12')](-0x1);if(_0x53df5c==='/'||_0x53df5c==='\x5c'||_0x53df5c===':'){_0x2a6c4d=_0x2a6c4d[_0x1115('0x13')](0x0,_0x2a6c4d[_0x1115('0x14')](_0x53df5c));}switch(_0x83ea22[_0x1115('0xd')]){case'US':_0x1ad6ae=_0x1115('0x15');break;case'AU':_0x1ad6ae='https://accounts.zoho.com.au';break;case'IN':_0x1ad6ae=_0x1115('0x16');break;case'CN':_0x1ad6ae='https://accounts.zoho.com.cn';break;default:_0x1ad6ae=_0x1115('0x17');break;}var _0x57285d={'method':'POST','uri':_0x1ad6ae+_0x1115('0x18'),'form':{'grant_type':_0x1115('0x19'),'client_id':_0x83ea22['clientId'],'client_secret':_0x83ea22[_0x1115('0xf')],'redirect_uri':_0x83ea22[_0x1115('0xe')],'code':_0x83ea22[_0x1115('0x10')]},'headers':{'Content-Type':_0x1115('0x1a')}};return rp(_0x57285d)['then'](function(_0x26d641){var _0x381061=JSON[_0x1115('0x1b')](_0x26d641);if(_0x381061['refresh_token']){_0x83ea22['refreshToken']=_0x381061[_0x1115('0x1c')];logger[_0x1115('0x1d')](util[_0x1115('0x1e')](_0x1115('0x1f'),_0x83ea22[_0x1115('0x20')],_0x83ea22['id']));}else{logger[_0x1115('0x21')](util['format'](_0x1115('0x22'),_0x83ea22[_0x1115('0x20')],_0x83ea22['id']),util[_0x1115('0x23')](_0x381061,{'showHidden':![],'depth':null}));}return _0xebf95b(null,_0x46a8af);})[_0x1115('0x24')](function(_0x251a21){logger[_0x1115('0x21')](util[_0x1115('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x83ea22[_0x1115('0x20')],_0x83ea22['id']),util[_0x1115('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xebf95b(_0x251a21);});}else{return _0xebf95b(null,_0x46a8af);}},'beforeUpdate':function(_0x42d0e1,_0x3770ff,_0x5d0911){if(_0x42d0e1['changed'](_0x1115('0xd'))||_0x42d0e1[_0x1115('0xc')](_0x1115('0xe'))||_0x42d0e1[_0x1115('0xc')](_0x1115('0x25'))||_0x42d0e1[_0x1115('0xc')](_0x1115('0xf'))||_0x42d0e1[_0x1115('0xc')](_0x1115('0x10'))||_0x42d0e1[_0x1115('0xc')](_0x1115('0x11'))){var _0x33e4ea,_0x14889;_0x33e4ea=_0x42d0e1[_0x1115('0xe')];var _0x1aca6e=_0x33e4ea['slice'](-0x1);if(_0x1aca6e==='/'||_0x1aca6e==='\x5c'||_0x1aca6e===':'){_0x33e4ea=_0x33e4ea['substring'](0x0,_0x33e4ea[_0x1115('0x14')](_0x1aca6e));}switch(_0x42d0e1[_0x1115('0xd')]){case'US':_0x14889=_0x1115('0x15');break;case'AU':_0x14889='https://accounts.zoho.com.au';break;case'IN':_0x14889=_0x1115('0x16');break;case'CN':_0x14889=_0x1115('0x26');break;default:_0x14889='https://accounts.zoho.eu';break;}var _0x43d799={'method':_0x1115('0x27'),'uri':_0x14889+'/oauth/v2/token','form':{'grant_type':_0x1115('0x19'),'client_id':_0x42d0e1['clientId'],'client_secret':_0x42d0e1[_0x1115('0xf')],'redirect_uri':_0x42d0e1[_0x1115('0xe')],'code':_0x42d0e1[_0x1115('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x43d799)[_0x1115('0x28')](function(_0x19d845){var _0x51a2ea=JSON[_0x1115('0x1b')](_0x19d845);if(_0x51a2ea['refresh_token']){_0x42d0e1[_0x1115('0x29')]=_0x51a2ea['refresh_token'];logger[_0x1115('0x1d')](util[_0x1115('0x1e')](_0x1115('0x1f'),_0x42d0e1[_0x1115('0x20')],_0x42d0e1['id']));}else{logger[_0x1115('0x21')](util[_0x1115('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42d0e1[_0x1115('0x20')],_0x42d0e1['id']),util[_0x1115('0x23')](_0x51a2ea,{'showHidden':![],'depth':null}));}return _0x5d0911(null,_0x3770ff);})[_0x1115('0x24')](function(_0x2e91f4){logger[_0x1115('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42d0e1[_0x1115('0x20')],_0x42d0e1['id']),util[_0x1115('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x5d0911(_0x2e91f4);});}else{return _0x5d0911(null,_0x3770ff);}}}});}; \ No newline at end of file +var _0xcb68=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.com.au','application/x-www-form-urlencoded','then','refreshToken','format','lodash','util'];(function(_0x40895,_0x31a64e){var _0x116ad7=function(_0x4a9537){while(--_0x4a9537){_0x40895['push'](_0x40895['shift']());}};_0x116ad7(++_0x31a64e);}(_0xcb68,0x1c0));var _0x8cb6=function(_0x1f41e7,_0x220791){_0x1f41e7=_0x1f41e7-0x0;var _0xa471ca=_0xcb68[_0x1f41e7];return _0xa471ca;};'use strict';var _=require(_0x8cb6('0x0'));var util=require(_0x8cb6('0x1'));var logger=require(_0x8cb6('0x2'))(_0x8cb6('0x3'));var moment=require(_0x8cb6('0x4'));var BPromise=require('bluebird');var rp=require(_0x8cb6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cb6('0x6'));var config=require(_0x8cb6('0x7'));var attributes=require(_0x8cb6('0x8'));var integrations=require(_0x8cb6('0x9'));module[_0x8cb6('0xa')]=function(_0x2e4a23,_0x41c5ad){return _0x2e4a23[_0x8cb6('0xb')](_0x8cb6('0xc'),attributes,{'tableName':_0x8cb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d2bac,_0x22d351,_0x45ba8f){if(_0x3d2bac[_0x8cb6('0xe')](_0x8cb6('0xf'))||_0x3d2bac['changed'](_0x8cb6('0x10'))||_0x3d2bac[_0x8cb6('0xe')](_0x8cb6('0x11'))||_0x3d2bac[_0x8cb6('0xe')]('clientSecret')||_0x3d2bac[_0x8cb6('0xe')](_0x8cb6('0x12'))||_0x3d2bac['changed'](_0x8cb6('0x13'))){var _0xc82884,_0x1314b6;_0xc82884=_0x3d2bac[_0x8cb6('0x10')];var _0x506dbe=_0xc82884[_0x8cb6('0x14')](-0x1);if(_0x506dbe==='/'||_0x506dbe==='\x5c'||_0x506dbe===':'){_0xc82884=_0xc82884['substring'](0x0,_0xc82884[_0x8cb6('0x15')](_0x506dbe));}switch(_0x3d2bac['zone']){case'US':_0x1314b6=_0x8cb6('0x16');break;case'AU':_0x1314b6='https://accounts.zoho.com.au';break;case'IN':_0x1314b6=_0x8cb6('0x17');break;case'CN':_0x1314b6=_0x8cb6('0x18');break;default:_0x1314b6=_0x8cb6('0x19');break;}var _0x275754={'method':_0x8cb6('0x1a'),'uri':_0x1314b6+_0x8cb6('0x1b'),'form':{'grant_type':_0x8cb6('0x1c'),'client_id':_0x3d2bac[_0x8cb6('0x11')],'client_secret':_0x3d2bac[_0x8cb6('0x1d')],'redirect_uri':_0x3d2bac[_0x8cb6('0x10')],'code':_0x3d2bac[_0x8cb6('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x275754)['then'](function(_0x263bea){var _0x4b4346=JSON[_0x8cb6('0x1e')](_0x263bea);if(_0x4b4346[_0x8cb6('0x1f')]){_0x3d2bac['refreshToken']=_0x4b4346[_0x8cb6('0x1f')];logger[_0x8cb6('0x20')](util['format'](_0x8cb6('0x21'),_0x3d2bac[_0x8cb6('0x22')],_0x3d2bac['id']));}else{logger[_0x8cb6('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3d2bac[_0x8cb6('0x22')],_0x3d2bac['id']),util[_0x8cb6('0x24')](_0x4b4346,{'showHidden':![],'depth':null}));}return _0x45ba8f(null,_0x22d351);})[_0x8cb6('0x25')](function(_0x57e651){logger[_0x8cb6('0x23')](util['format'](_0x8cb6('0x26'),_0x3d2bac[_0x8cb6('0x22')],_0x3d2bac['id']),util[_0x8cb6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x45ba8f(_0x57e651);});}else{return _0x45ba8f(null,_0x22d351);}},'beforeUpdate':function(_0x597525,_0x4257e7,_0xcd1e7b){if(_0x597525['changed'](_0x8cb6('0xf'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x10'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x11'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x1d'))||_0x597525['changed'](_0x8cb6('0x12'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x13'))){var _0x5d69c9,_0x42db93;_0x5d69c9=_0x597525[_0x8cb6('0x10')];var _0x5508f6=_0x5d69c9[_0x8cb6('0x14')](-0x1);if(_0x5508f6==='/'||_0x5508f6==='\x5c'||_0x5508f6===':'){_0x5d69c9=_0x5d69c9[_0x8cb6('0x27')](0x0,_0x5d69c9[_0x8cb6('0x15')](_0x5508f6));}switch(_0x597525['zone']){case'US':_0x42db93=_0x8cb6('0x16');break;case'AU':_0x42db93=_0x8cb6('0x28');break;case'IN':_0x42db93='https://accounts.zoho.in';break;case'CN':_0x42db93='https://accounts.zoho.com.cn';break;default:_0x42db93=_0x8cb6('0x19');break;}var _0xcf76a3={'method':'POST','uri':_0x42db93+_0x8cb6('0x1b'),'form':{'grant_type':_0x8cb6('0x1c'),'client_id':_0x597525[_0x8cb6('0x11')],'client_secret':_0x597525['clientSecret'],'redirect_uri':_0x597525['serverUrl'],'code':_0x597525[_0x8cb6('0x12')]},'headers':{'Content-Type':_0x8cb6('0x29')}};return rp(_0xcf76a3)[_0x8cb6('0x2a')](function(_0x7b679c){var _0x4dcf3f=JSON[_0x8cb6('0x1e')](_0x7b679c);if(_0x4dcf3f[_0x8cb6('0x1f')]){_0x597525[_0x8cb6('0x2b')]=_0x4dcf3f[_0x8cb6('0x1f')];logger[_0x8cb6('0x20')](util[_0x8cb6('0x2c')](_0x8cb6('0x21'),_0x597525['name'],_0x597525['id']));}else{logger[_0x8cb6('0x23')](util[_0x8cb6('0x2c')](_0x8cb6('0x26'),_0x597525['name'],_0x597525['id']),util[_0x8cb6('0x24')](_0x4dcf3f,{'showHidden':![],'depth':null}));}return _0xcd1e7b(null,_0x4257e7);})[_0x8cb6('0x25')](function(_0x30f752){logger['error'](util[_0x8cb6('0x2c')](_0x8cb6('0x26'),_0x597525[_0x8cb6('0x22')],_0x597525['id']),util[_0x8cb6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0xcd1e7b(_0x30f752);});}else{return _0xcd1e7b(null,_0x4257e7);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index ca7be06..09a4722 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 _0xb114=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowZohoAccount','find','where','stringify','lodash'];(function(_0x24e175,_0x45e8c7){var _0x55b0d1=function(_0x441591){while(--_0x441591){_0x24e175['push'](_0x24e175['shift']());}};_0x55b0d1(++_0x45e8c7);}(_0xb114,0x11f));var _0x4b11=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb114[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0x4b11('0x0'));var util=require('util');var moment=require(_0x4b11('0x1'));var BPromise=require(_0x4b11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b11('0x3'));var db=require(_0x4b11('0x4'))['db'];var utils=require(_0x4b11('0x5'));var logger=require(_0x4b11('0x6'))(_0x4b11('0x7'));var config=require(_0x4b11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b11('0x9')][_0x4b11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41fac6,_0x91f371,_0x132ad2){return new BPromise(function(_0x283039,_0x25ff0a){return client['request'](_0x41fac6,_0x132ad2)[_0x4b11('0xb')](function(_0x4cde8d){logger[_0x4b11('0xc')](_0x4b11('0xd'),_0x91f371,_0x4b11('0xe'));logger[_0x4b11('0xf')](_0x4b11('0x10'),_0x91f371,_0x4b11('0xe'),JSON['stringify'](_0x4cde8d));if(_0x4cde8d[_0x4b11('0x11')]){if(_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x12')]===0x1f4){logger[_0x4b11('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x91f371,_0x4cde8d['error'][_0x4b11('0x13')]);return _0x25ff0a(_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x13')]);}logger[_0x4b11('0x11')](_0x4b11('0xd'),_0x91f371,_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x13')]);return _0x283039(_0x4cde8d[_0x4b11('0x11')]['message']);}else{logger['info'](_0x4b11('0xd'),_0x91f371,_0x4b11('0xe'));_0x283039(_0x4cde8d[_0x4b11('0x14')]['message']);}})['catch'](function(_0x4dd039){logger[_0x4b11('0x11')](_0x4b11('0xd'),_0x91f371,_0x4dd039);_0x25ff0a(_0x4dd039);});});}exports[_0x4b11('0x15')]=function(_0xf14a7f){var _0xa67776=this;return new Promise(function(_0x2db145,_0x40579b){return db[_0x4b11('0x16')][_0x4b11('0x17')]({'raw':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f['options'][_0x4b11('0x19')]===undefined?!![]:![]:!![],'where':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f[_0x4b11('0x18')]['where']||null:null,'attributes':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f['options'][_0x4b11('0x1a')]||null:null,'limit':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f[_0x4b11('0x18')][_0x4b11('0x1b')]||null:null,'include':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f[_0x4b11('0x18')][_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0xf14a7f[_0x4b11('0x18')][_0x4b11('0x1c')],function(_0x3e9a73){return{'model':db[_0x3e9a73['model']],'as':_0x3e9a73['as'],'attributes':_0x3e9a73[_0x4b11('0x1a')],'include':_0x3e9a73['include']?_[_0x4b11('0x1d')](_0x3e9a73['include'],function(_0x479e85){return{'model':db[_0x479e85[_0x4b11('0x1e')]],'as':_0x479e85['as'],'attributes':_0x479e85[_0x4b11('0x1a')],'include':_0x479e85[_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x479e85[_0x4b11('0x1c')],function(_0x5b904a){return{'model':db[_0x5b904a[_0x4b11('0x1e')]],'as':_0x5b904a['as'],'attributes':_0x5b904a[_0x4b11('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4b11('0xb')](function(_0x3e099f){logger[_0x4b11('0xc')](_0x4b11('0x15'),_0xf14a7f);logger[_0x4b11('0xf')](_0x4b11('0x15'),_0xf14a7f,JSON['stringify'](_0x3e099f));_0x2db145(_0x3e099f);})[_0x4b11('0x1f')](function(_0x15d27d){logger['error'](_0x4b11('0x15'),_0x15d27d[_0x4b11('0x13')],_0xf14a7f);_0x40579b(_0xa67776[_0x4b11('0x11')](0x1f4,_0x15d27d[_0x4b11('0x13')]));});});};exports[_0x4b11('0x20')]=function(_0x704ada){var _0x440cf5=this;return new Promise(function(_0x582d54,_0x409b01){return db[_0x4b11('0x16')][_0x4b11('0x21')]({'raw':_0x704ada['options']?_0x704ada[_0x4b11('0x18')][_0x4b11('0x19')]===undefined?!![]:![]:!![],'where':_0x704ada[_0x4b11('0x18')]?_0x704ada[_0x4b11('0x18')][_0x4b11('0x22')]||null:null,'attributes':_0x704ada[_0x4b11('0x18')]?_0x704ada['options']['attributes']||null:null,'include':_0x704ada[_0x4b11('0x18')]?_0x704ada[_0x4b11('0x18')][_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x704ada[_0x4b11('0x18')][_0x4b11('0x1c')],function(_0x232e78){return{'model':db[_0x232e78['model']],'as':_0x232e78['as'],'attributes':_0x232e78[_0x4b11('0x1a')],'include':_0x232e78[_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x232e78[_0x4b11('0x1c')],function(_0x18d31c){return{'model':db[_0x18d31c['model']],'as':_0x18d31c['as'],'attributes':_0x18d31c['attributes'],'include':_0x18d31c[_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x18d31c[_0x4b11('0x1c')],function(_0x419d87){return{'model':db[_0x419d87['model']],'as':_0x419d87['as'],'attributes':_0x419d87['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34846a){logger[_0x4b11('0xc')]('ShowZohoAccount',_0x704ada);logger[_0x4b11('0xf')]('ShowZohoAccount',_0x704ada,JSON[_0x4b11('0x23')](_0x34846a));_0x582d54(_0x34846a);})[_0x4b11('0x1f')](function(_0xade5cc){logger[_0x4b11('0x11')](_0x4b11('0x20'),_0xade5cc[_0x4b11('0x13')],_0x704ada);_0x409b01(_0x440cf5[_0x4b11('0x11')](0x1f4,_0xade5cc[_0x4b11('0x13')]));});});}; \ No newline at end of file +var _0x7bd0=['limit','include','model','map','GetZohoAccount','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ZohoAccount','findAll','options','raw','where','attributes'];(function(_0x16952e,_0x2d2c9e){var _0x1664fc=function(_0x83225e){while(--_0x83225e){_0x16952e['push'](_0x16952e['shift']());}};_0x1664fc(++_0x2d2c9e);}(_0x7bd0,0x111));var _0x07bd=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0x7bd0[_0x546aaf];return _0x1cbf6d;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('ZohoAccount,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['GetZohoAccount']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')]({'raw':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1d')]||null:null,'attributes':_0x3f9f0b['options']?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1f')]||null:null,'include':_0x3f9f0b['options']?_0x3f9f0b['options'][_0x07bd('0x20')]?_['map'](_0x3f9f0b[_0x07bd('0x1b')]['include'],function(_0x50bd12){return{'model':db[_0x50bd12[_0x07bd('0x21')]],'as':_0x50bd12['as'],'attributes':_0x50bd12[_0x07bd('0x1e')],'include':_0x50bd12[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x50bd12[_0x07bd('0x20')],function(_0x43cbc8){return{'model':db[_0x43cbc8['model']],'as':_0x43cbc8['as'],'attributes':_0x43cbc8[_0x07bd('0x1e')],'include':_0x43cbc8[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x43cbc8[_0x07bd('0x20')],function(_0x12ce26){return{'model':db[_0x12ce26[_0x07bd('0x21')]],'as':_0x12ce26['as'],'attributes':_0x12ce26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5184dc){logger[_0x07bd('0x17')](_0x07bd('0x23'),_0x3f9f0b);logger[_0x07bd('0x11')]('GetZohoAccount',_0x3f9f0b,JSON[_0x07bd('0x13')](_0x5184dc));_0x4948f4(_0x5184dc);})[_0x07bd('0x18')](function(_0x253dc0){logger[_0x07bd('0x14')](_0x07bd('0x23'),_0x253dc0[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0x253dc0[_0x07bd('0x16')]));});});};exports[_0x07bd('0x24')]=function(_0x4182b9){var _0x321200=this;return new Promise(function(_0x1b6cc,_0x314bda){return db[_0x07bd('0x19')][_0x07bd('0x25')]({'raw':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')]['where']||null:null,'attributes':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'include':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x20')],function(_0x5f29c5){return{'model':db[_0x5f29c5[_0x07bd('0x21')]],'as':_0x5f29c5['as'],'attributes':_0x5f29c5[_0x07bd('0x1e')],'include':_0x5f29c5[_0x07bd('0x20')]?_['map'](_0x5f29c5[_0x07bd('0x20')],function(_0x31c381){return{'model':db[_0x31c381['model']],'as':_0x31c381['as'],'attributes':_0x31c381[_0x07bd('0x1e')],'include':_0x31c381[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x31c381[_0x07bd('0x20')],function(_0x5cde8d){return{'model':db[_0x5cde8d['model']],'as':_0x5cde8d['as'],'attributes':_0x5cde8d[_0x07bd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c2878){logger[_0x07bd('0x17')](_0x07bd('0x24'),_0x4182b9);logger[_0x07bd('0x11')](_0x07bd('0x24'),_0x4182b9,JSON[_0x07bd('0x13')](_0x3c2878));_0x1b6cc(_0x3c2878);})[_0x07bd('0x18')](function(_0x333ac2){logger[_0x07bd('0x14')](_0x07bd('0x24'),_0x333ac2[_0x07bd('0x16')],_0x4182b9);_0x314bda(_0x321200[_0x07bd('0x14')](0x1f4,_0x333ac2[_0x07bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9e66eab..ba7d938 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 _0x5984=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5984,0x1c0));var _0x4598=function(_0x18fc2c,_0xd9cfa8){_0x18fc2c=_0x18fc2c-0x0;var _0x408386=_0x5984[_0x18fc2c];return _0x408386;};'use strict';var multer=require('multer');var util=require(_0x4598('0x0'));var path=require(_0x4598('0x1'));var timeout=require(_0x4598('0x2'));var express=require(_0x4598('0x3'));var router=express[_0x4598('0x4')]();var fs_extra=require(_0x4598('0x5'));var auth=require(_0x4598('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4598('0x7'));var controller=require(_0x4598('0x8'));router[_0x4598('0x9')]('/',auth['isAuthenticated'](),controller[_0x4598('0xa')]);router[_0x4598('0x9')](_0x4598('0xb'),auth[_0x4598('0xc')](),controller[_0x4598('0xd')]);router[_0x4598('0x9')](_0x4598('0xe'),auth[_0x4598('0xc')](),controller['getFields']);router['get'](_0x4598('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4598('0x9')](_0x4598('0x10'),auth[_0x4598('0xc')](),controller[_0x4598('0x11')]);router[_0x4598('0x12')]('/',auth[_0x4598('0xc')](),controller[_0x4598('0x13')]);router[_0x4598('0x14')]('/:id',auth[_0x4598('0xc')](),controller[_0x4598('0x15')]);router[_0x4598('0x16')](_0x4598('0xb'),auth['isAuthenticated'](),controller[_0x4598('0x17')]);module[_0x4598('0x18')]=router; \ No newline at end of file +var _0x0fd5=['getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x0fd5,0xa3));var _0x50fd=function(_0x231ff6,_0x556e5b){_0x231ff6=_0x231ff6-0x0;var _0x4bc59b=_0x0fd5[_0x231ff6];return _0x4bc59b;};'use strict';var multer=require(_0x50fd('0x0'));var util=require(_0x50fd('0x1'));var path=require(_0x50fd('0x2'));var timeout=require(_0x50fd('0x3'));var express=require(_0x50fd('0x4'));var router=express[_0x50fd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x50fd('0x6'));var interaction=require(_0x50fd('0x7'));var config=require(_0x50fd('0x8'));var controller=require(_0x50fd('0x9'));router['get']('/',auth[_0x50fd('0xa')](),controller[_0x50fd('0xb')]);router[_0x50fd('0xc')](_0x50fd('0xd'),auth[_0x50fd('0xa')](),controller[_0x50fd('0xe')]);router[_0x50fd('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0x50fd('0xf')]);router[_0x50fd('0xc')](_0x50fd('0x10'),auth['isAuthenticated'](),controller[_0x50fd('0x11')]);router[_0x50fd('0xc')](_0x50fd('0x12'),auth[_0x50fd('0xa')](),controller[_0x50fd('0x13')]);router['post']('/',auth[_0x50fd('0xa')](),controller[_0x50fd('0x14')]);router[_0x50fd('0x15')](_0x50fd('0xd'),auth[_0x50fd('0xa')](),controller[_0x50fd('0x16')]);router[_0x50fd('0x17')](_0x50fd('0xd'),auth[_0x50fd('0xa')](),controller[_0x50fd('0x18')]);module[_0x50fd('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 985f69b..928c877 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 _0x9d3f=['exports','STRING','contact','nothing','lead','contact_lead','sequelize'];(function(_0x486790,_0x1f6dfc){var _0xa5e6a6=function(_0x100465){while(--_0x100465){_0x486790['push'](_0x486790['shift']());}};_0xa5e6a6(++_0x1f6dfc);}(_0x9d3f,0x1b8));var _0xf9d3=function(_0x310f6a,_0x2d506a){_0x310f6a=_0x310f6a-0x0;var _0x1f9d01=_0x9d3f[_0x310f6a];return _0x1f9d01;};'use strict';var Sequelize=require(_0xf9d3('0x0'));module[_0xf9d3('0x1')]={'name':{'type':Sequelize[_0xf9d3('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xf9d3('0x3'),_0xf9d3('0x4')),'defaultValue':_0xf9d3('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf9d3('0x6'),'contact',_0xf9d3('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe468=['lead','nothing','contact_lead','contact','STRING','sequelize','exports','ENUM'];(function(_0x4d5f48,_0xd287f){var _0x5c8349=function(_0x10fd4d){while(--_0x10fd4d){_0x4d5f48['push'](_0x4d5f48['shift']());}};_0x5c8349(++_0xd287f);}(_0xe468,0x18d));var _0x8e46=function(_0x2a1b4d,_0x461603){_0x2a1b4d=_0x2a1b4d-0x0;var _0x2defa4=_0xe468[_0x2a1b4d];return _0x2defa4;};'use strict';var Sequelize=require(_0x8e46('0x0'));module[_0x8e46('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8e46('0x2')](_0x8e46('0x3'),'contact',_0x8e46('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x8e46('0x2')](_0x8e46('0x5'),_0x8e46('0x6'),_0x8e46('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x8e46('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index dc2281e..96d07b9 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 _0xe7b6=['end','status','limit','undefined','count','offset','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','options','includeAll','include','ZohoConfiguration','findAll','rows','show','params','length','find','create','body','catch','findOne','ZohoField','filter','getFields','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2b96d5,_0x5383ea){var _0x49afba=function(_0x512623){while(--_0x512623){_0x2b96d5['push'](_0x2b96d5['shift']());}};_0x49afba(++_0x5383ea);}(_0xe7b6,0x87));var _0x6e7b=function(_0x5dd0fa,_0x1fe623){_0x5dd0fa=_0x5dd0fa-0x0;var _0x29ddea=_0xe7b6[_0x5dd0fa];return _0x29ddea;};'use strict';var emlformat=require(_0x6e7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e7b('0x1'));var jsonpatch=require(_0x6e7b('0x2'));var rp=require(_0x6e7b('0x3'));var moment=require('moment');var BPromise=require(_0x6e7b('0x4'));var Mustache=require(_0x6e7b('0x5'));var util=require(_0x6e7b('0x6'));var path=require(_0x6e7b('0x7'));var sox=require(_0x6e7b('0x8'));var csv=require(_0x6e7b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e7b('0xa'));var squel=require(_0x6e7b('0xb'));var crypto=require(_0x6e7b('0xc'));var jsforce=require(_0x6e7b('0xd'));var deskjs=require(_0x6e7b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e7b('0xf'));var Redis=require('ioredis');var authService=require(_0x6e7b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6e7b('0x11'));var hardwareService=require(_0x6e7b('0x12'));var logger=require(_0x6e7b('0x13'))(_0x6e7b('0x14'));var utils=require(_0x6e7b('0x15'));var config=require(_0x6e7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e7b('0x17'))['db'];function respondWithStatusCode(_0x4a193c,_0x44eb0d){_0x44eb0d=_0x44eb0d||0xcc;return function(_0x5edb70){if(_0x5edb70){return _0x4a193c[_0x6e7b('0x18')](_0x44eb0d);}return _0x4a193c['status'](_0x44eb0d)[_0x6e7b('0x19')]();};}function respondWithResult(_0x1b0e07,_0x29e46b){_0x29e46b=_0x29e46b||0xc8;return function(_0x2a4f13){if(_0x2a4f13){return _0x1b0e07[_0x6e7b('0x1a')](_0x29e46b)['json'](_0x2a4f13);}};}function respondWithFilteredResult(_0x13f14d,_0x409d4b){return function(_0x161c15){if(_0x161c15){var _0x3108a6=typeof _0x409d4b['offset']==='undefined'&&typeof _0x409d4b[_0x6e7b('0x1b')]===_0x6e7b('0x1c');var _0x730a26=_0x161c15[_0x6e7b('0x1d')];var _0xf5696f=_0x3108a6?0x0:_0x409d4b[_0x6e7b('0x1e')];var _0x2e5265=_0x3108a6?_0x161c15[_0x6e7b('0x1d')]:_0x409d4b[_0x6e7b('0x1e')]+_0x409d4b[_0x6e7b('0x1b')];var _0x5b1a6f;if(_0x2e5265>=_0x730a26){_0x2e5265=_0x730a26;_0x5b1a6f=0xc8;}else{_0x5b1a6f=0xce;}_0x13f14d[_0x6e7b('0x1a')](_0x5b1a6f);return _0x13f14d['set'](_0x6e7b('0x1f'),_0xf5696f+'-'+_0x2e5265+'/'+_0x730a26)[_0x6e7b('0x20')](_0x161c15);}return null;};}function patchUpdates(_0x276405){return function(_0x3163fb){try{jsonpatch[_0x6e7b('0x21')](_0x3163fb,_0x276405,!![]);}catch(_0x4cbc73){return BPromise['reject'](_0x4cbc73);}return _0x3163fb[_0x6e7b('0x22')]();};}function saveUpdates(_0x4508f3,_0x3e69c6){return function(_0x1d2ece){if(_0x1d2ece){return _0x1d2ece[_0x6e7b('0x23')](_0x4508f3)['then'](function(_0x45ccaa){return _0x45ccaa;});}return null;};}function removeEntity(_0x3ae01c,_0x6efac1){return function(_0x1a922b){if(_0x1a922b){return _0x1a922b[_0x6e7b('0x24')]()[_0x6e7b('0x25')](function(){_0x3ae01c[_0x6e7b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ae249,_0x1f8a18){return function(_0x367b3e){if(!_0x367b3e){_0x5ae249[_0x6e7b('0x18')](0x194);}return _0x367b3e;};}function handleError(_0x136d51,_0x342eb9){_0x342eb9=_0x342eb9||0x1f4;return function(_0x537148){logger[_0x6e7b('0x26')](_0x537148[_0x6e7b('0x27')]);if(_0x537148['name']){delete _0x537148[_0x6e7b('0x28')];}_0x136d51[_0x6e7b('0x1a')](_0x342eb9)[_0x6e7b('0x29')](_0x537148);};}exports[_0x6e7b('0x2a')]=function(_0x329024,_0x405d60){var _0x1e3b28={},_0x5285a6={},_0x1ec007={'count':0x0,'rows':[]};var _0x5a4a0b=_[_0x6e7b('0x2b')](db['ZohoConfiguration'][_0x6e7b('0x2c')],function(_0x444bfa){return{'name':_0x444bfa['fieldName'],'type':_0x444bfa[_0x6e7b('0x2d')][_0x6e7b('0x2e')]};});_0x5285a6[_0x6e7b('0x2f')]=_[_0x6e7b('0x2b')](_0x5a4a0b,_0x6e7b('0x28'));_0x5285a6[_0x6e7b('0x30')]=_[_0x6e7b('0x31')](_0x329024[_0x6e7b('0x30')]);_0x5285a6['filters']=_[_0x6e7b('0x32')](_0x5285a6[_0x6e7b('0x2f')],_0x5285a6[_0x6e7b('0x30')]);_0x1e3b28[_0x6e7b('0x33')]=_[_0x6e7b('0x32')](_0x5285a6[_0x6e7b('0x2f')],qs[_0x6e7b('0x34')](_0x329024[_0x6e7b('0x30')][_0x6e7b('0x34')]));_0x1e3b28[_0x6e7b('0x33')]=_0x1e3b28[_0x6e7b('0x33')]['length']?_0x1e3b28['attributes']:_0x5285a6[_0x6e7b('0x2f')];if(!_0x329024[_0x6e7b('0x30')][_0x6e7b('0x35')]('nolimit')){_0x1e3b28[_0x6e7b('0x1b')]=qs[_0x6e7b('0x1b')](_0x329024['query']['limit']);_0x1e3b28[_0x6e7b('0x1e')]=qs['offset'](_0x329024[_0x6e7b('0x30')][_0x6e7b('0x1e')]);}_0x1e3b28[_0x6e7b('0x36')]=qs['sort'](_0x329024[_0x6e7b('0x30')][_0x6e7b('0x37')]);_0x1e3b28[_0x6e7b('0x38')]=qs[_0x6e7b('0x39')](_[_0x6e7b('0x3a')](_0x329024[_0x6e7b('0x30')],_0x5285a6[_0x6e7b('0x39')]),_0x5a4a0b);if(_0x329024[_0x6e7b('0x30')]['filter']){_0x1e3b28['where']=_[_0x6e7b('0x3b')](_0x1e3b28[_0x6e7b('0x38')],{'$or':_[_0x6e7b('0x2b')](_0x5a4a0b,function(_0x151684){if(_0x151684[_0x6e7b('0x2d')]!=='VIRTUAL'){var _0x468aa6={};_0x468aa6[_0x151684[_0x6e7b('0x28')]]={'$like':'%'+_0x329024[_0x6e7b('0x30')]['filter']+'%'};return _0x468aa6;}})});}_0x1e3b28=_[_0x6e7b('0x3b')]({},_0x1e3b28,_0x329024[_0x6e7b('0x3c')]);var _0x5cb38a={'where':_0x1e3b28['where']};return db['ZohoConfiguration'][_0x6e7b('0x1d')](_0x5cb38a)[_0x6e7b('0x25')](function(_0x412855){_0x1ec007[_0x6e7b('0x1d')]=_0x412855;if(_0x329024[_0x6e7b('0x30')][_0x6e7b('0x3d')]){_0x1e3b28[_0x6e7b('0x3e')]=[{'all':!![]}];}return db[_0x6e7b('0x3f')][_0x6e7b('0x40')](_0x1e3b28);})[_0x6e7b('0x25')](function(_0x33b6b2){_0x1ec007[_0x6e7b('0x41')]=_0x33b6b2;return _0x1ec007;})[_0x6e7b('0x25')](respondWithFilteredResult(_0x405d60,_0x1e3b28))['catch'](handleError(_0x405d60,null));};exports[_0x6e7b('0x42')]=function(_0x243a69,_0x251489){var _0x48e73a={'raw':![],'where':{'id':_0x243a69[_0x6e7b('0x43')]['id']}},_0x503bf0={};_0x503bf0['model']=_['keys'](db[_0x6e7b('0x3f')][_0x6e7b('0x2c')]);_0x503bf0['query']=_['keys'](_0x243a69[_0x6e7b('0x30')]);_0x503bf0[_0x6e7b('0x39')]=_['intersection'](_0x503bf0['model'],_0x503bf0[_0x6e7b('0x30')]);_0x48e73a['attributes']=_['intersection'](_0x503bf0[_0x6e7b('0x2f')],qs[_0x6e7b('0x34')](_0x243a69[_0x6e7b('0x30')][_0x6e7b('0x34')]));_0x48e73a[_0x6e7b('0x33')]=_0x48e73a['attributes'][_0x6e7b('0x44')]?_0x48e73a[_0x6e7b('0x33')]:_0x503bf0[_0x6e7b('0x2f')];if(_0x243a69[_0x6e7b('0x30')]['includeAll']){_0x48e73a[_0x6e7b('0x3e')]=[{'all':!![]}];}_0x48e73a=_[_0x6e7b('0x3b')]({},_0x48e73a,_0x243a69[_0x6e7b('0x3c')]);return db[_0x6e7b('0x3f')][_0x6e7b('0x45')](_0x48e73a)['then'](handleEntityNotFound(_0x251489,null))[_0x6e7b('0x25')](respondWithResult(_0x251489,null))['catch'](handleError(_0x251489,null));};exports[_0x6e7b('0x46')]=function(_0x1c0614,_0x320959){return db['ZohoConfiguration'][_0x6e7b('0x46')](_0x1c0614[_0x6e7b('0x47')],{})[_0x6e7b('0x25')](respondWithResult(_0x320959,0xc9))[_0x6e7b('0x48')](handleError(_0x320959,null));};exports[_0x6e7b('0x23')]=function(_0xc161b6,_0x58dd84){if(_0xc161b6['body']['id']){delete _0xc161b6[_0x6e7b('0x47')]['id'];}return db[_0x6e7b('0x3f')][_0x6e7b('0x45')]({'where':{'id':_0xc161b6[_0x6e7b('0x43')]['id']}})[_0x6e7b('0x25')](handleEntityNotFound(_0x58dd84,null))[_0x6e7b('0x25')](saveUpdates(_0xc161b6[_0x6e7b('0x47')],null))[_0x6e7b('0x25')](respondWithResult(_0x58dd84,null))[_0x6e7b('0x48')](handleError(_0x58dd84,null));};exports['destroy']=function(_0x1340c5,_0x3f38bd){return db[_0x6e7b('0x3f')][_0x6e7b('0x45')]({'where':{'id':_0x1340c5['params']['id']}})[_0x6e7b('0x25')](handleEntityNotFound(_0x3f38bd,null))[_0x6e7b('0x25')](removeEntity(_0x3f38bd,null))[_0x6e7b('0x48')](handleError(_0x3f38bd,null));};exports['getFields']=function(_0x384282,_0x3592d4,_0x31d9c1){var _0x29af8b={};var _0x481cf7={};var _0xdf5623;var _0x575188;return db[_0x6e7b('0x3f')][_0x6e7b('0x49')]({'where':{'id':_0x384282[_0x6e7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x3592d4,null))['then'](function(_0x22052d){if(_0x22052d){_0xdf5623=_0x22052d;_0x481cf7[_0x6e7b('0x2f')]=_[_0x6e7b('0x31')](db[_0x6e7b('0x4a')]['rawAttributes']);_0x481cf7[_0x6e7b('0x30')]=_[_0x6e7b('0x31')](_0x384282[_0x6e7b('0x30')]);_0x481cf7['filters']=_[_0x6e7b('0x32')](_0x481cf7[_0x6e7b('0x2f')],_0x481cf7[_0x6e7b('0x30')]);_0x29af8b[_0x6e7b('0x33')]=_[_0x6e7b('0x32')](_0x481cf7['model'],qs['fields'](_0x384282[_0x6e7b('0x30')][_0x6e7b('0x34')]));_0x29af8b['attributes']=_0x29af8b[_0x6e7b('0x33')][_0x6e7b('0x44')]?_0x29af8b['attributes']:_0x481cf7[_0x6e7b('0x2f')];_0x29af8b[_0x6e7b('0x36')]=qs[_0x6e7b('0x37')](_0x384282[_0x6e7b('0x30')]['sort']);_0x29af8b[_0x6e7b('0x38')]=qs[_0x6e7b('0x39')](_['pick'](_0x384282[_0x6e7b('0x30')],_0x481cf7[_0x6e7b('0x39')]));if(_0x384282[_0x6e7b('0x30')][_0x6e7b('0x4b')]){_0x29af8b[_0x6e7b('0x38')]=_[_0x6e7b('0x3b')](_0x29af8b[_0x6e7b('0x38')],{'$or':_[_0x6e7b('0x2b')](_0x29af8b[_0x6e7b('0x33')],function(_0x32ea24){var _0x28cfa3={};_0x28cfa3[_0x32ea24]={'$like':'%'+_0x384282[_0x6e7b('0x30')][_0x6e7b('0x4b')]+'%'};return _0x28cfa3;})});}_0x29af8b=_[_0x6e7b('0x3b')]({},_0x29af8b,_0x384282[_0x6e7b('0x3c')]);return _0xdf5623[_0x6e7b('0x4c')](_0x29af8b);}})[_0x6e7b('0x25')](function(_0x10fd1e){if(_0x10fd1e){_0x575188=_0x10fd1e[_0x6e7b('0x44')];if(!_0x384282['query'][_0x6e7b('0x35')](_0x6e7b('0x4d'))){_0x29af8b[_0x6e7b('0x1b')]=qs[_0x6e7b('0x1b')](_0x384282[_0x6e7b('0x30')][_0x6e7b('0x1b')]);_0x29af8b[_0x6e7b('0x1e')]=qs[_0x6e7b('0x1e')](_0x384282[_0x6e7b('0x30')][_0x6e7b('0x1e')]);}return _0xdf5623[_0x6e7b('0x4c')](_0x29af8b);}})['then'](function(_0x10b413){if(_0x10b413){return _0x10b413?{'count':_0x575188,'rows':_0x10b413}:null;}})[_0x6e7b('0x25')](respondWithResult(_0x3592d4,null))[_0x6e7b('0x48')](handleError(_0x3592d4,null));};exports['getSubjects']=function(_0x248a7c,_0x28172f,_0x424564){var _0x5b895f={};var _0x220ffd={};var _0x44ad5f;var _0x330830;return db[_0x6e7b('0x3f')][_0x6e7b('0x49')]({'where':{'id':_0x248a7c[_0x6e7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x28172f,null))[_0x6e7b('0x25')](function(_0x2ccf75){if(_0x2ccf75){_0x44ad5f=_0x2ccf75;_0x220ffd[_0x6e7b('0x2f')]=_['keys'](db[_0x6e7b('0x4a')]['rawAttributes']);_0x220ffd[_0x6e7b('0x30')]=_[_0x6e7b('0x31')](_0x248a7c[_0x6e7b('0x30')]);_0x220ffd[_0x6e7b('0x39')]=_[_0x6e7b('0x32')](_0x220ffd[_0x6e7b('0x2f')],_0x220ffd[_0x6e7b('0x30')]);_0x5b895f[_0x6e7b('0x33')]=_[_0x6e7b('0x32')](_0x220ffd['model'],qs[_0x6e7b('0x34')](_0x248a7c[_0x6e7b('0x30')][_0x6e7b('0x34')]));_0x5b895f['attributes']=_0x5b895f[_0x6e7b('0x33')][_0x6e7b('0x44')]?_0x5b895f[_0x6e7b('0x33')]:_0x220ffd['model'];_0x5b895f[_0x6e7b('0x36')]=qs[_0x6e7b('0x37')](_0x248a7c['query'][_0x6e7b('0x37')]);_0x5b895f['where']=qs[_0x6e7b('0x39')](_[_0x6e7b('0x3a')](_0x248a7c[_0x6e7b('0x30')],_0x220ffd[_0x6e7b('0x39')]));if(_0x248a7c[_0x6e7b('0x30')][_0x6e7b('0x4b')]){_0x5b895f[_0x6e7b('0x38')]=_['merge'](_0x5b895f['where'],{'$or':_[_0x6e7b('0x2b')](_0x5b895f[_0x6e7b('0x33')],function(_0x395bd8){var _0x38b98c={};_0x38b98c[_0x395bd8]={'$like':'%'+_0x248a7c['query']['filter']+'%'};return _0x38b98c;})});}_0x5b895f=_['merge']({},_0x5b895f,_0x248a7c[_0x6e7b('0x3c')]);return _0x44ad5f[_0x6e7b('0x4e')](_0x5b895f);}})[_0x6e7b('0x25')](function(_0xf0fa75){if(_0xf0fa75){_0x330830=_0xf0fa75['length'];if(!_0x248a7c[_0x6e7b('0x30')][_0x6e7b('0x35')](_0x6e7b('0x4d'))){_0x5b895f[_0x6e7b('0x1b')]=qs[_0x6e7b('0x1b')](_0x248a7c['query'][_0x6e7b('0x1b')]);_0x5b895f['offset']=qs[_0x6e7b('0x1e')](_0x248a7c[_0x6e7b('0x30')][_0x6e7b('0x1e')]);}return _0x44ad5f['getSubjects'](_0x5b895f);}})[_0x6e7b('0x25')](function(_0x3d31e1){if(_0x3d31e1){return _0x3d31e1?{'count':_0x330830,'rows':_0x3d31e1}:null;}})['then'](respondWithResult(_0x28172f,null))[_0x6e7b('0x48')](handleError(_0x28172f,null));};exports[_0x6e7b('0x4f')]=function(_0x4d6802,_0x9f2db0,_0x4c5148){var _0x107286={};var _0x5c17ac={};var _0x2e2a64;var _0xb0b367;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x4d6802[_0x6e7b('0x43')]['id']}})[_0x6e7b('0x25')](handleEntityNotFound(_0x9f2db0,null))[_0x6e7b('0x25')](function(_0x1a2b58){if(_0x1a2b58){_0x2e2a64=_0x1a2b58;_0x5c17ac['model']=_[_0x6e7b('0x31')](db[_0x6e7b('0x4a')]['rawAttributes']);_0x5c17ac[_0x6e7b('0x30')]=_[_0x6e7b('0x31')](_0x4d6802[_0x6e7b('0x30')]);_0x5c17ac[_0x6e7b('0x39')]=_[_0x6e7b('0x32')](_0x5c17ac[_0x6e7b('0x2f')],_0x5c17ac['query']);_0x107286[_0x6e7b('0x33')]=_[_0x6e7b('0x32')](_0x5c17ac[_0x6e7b('0x2f')],qs[_0x6e7b('0x34')](_0x4d6802[_0x6e7b('0x30')][_0x6e7b('0x34')]));_0x107286['attributes']=_0x107286[_0x6e7b('0x33')][_0x6e7b('0x44')]?_0x107286[_0x6e7b('0x33')]:_0x5c17ac[_0x6e7b('0x2f')];_0x107286[_0x6e7b('0x36')]=qs[_0x6e7b('0x37')](_0x4d6802[_0x6e7b('0x30')]['sort']);_0x107286[_0x6e7b('0x38')]=qs[_0x6e7b('0x39')](_[_0x6e7b('0x3a')](_0x4d6802[_0x6e7b('0x30')],_0x5c17ac[_0x6e7b('0x39')]));if(_0x4d6802[_0x6e7b('0x30')][_0x6e7b('0x4b')]){_0x107286[_0x6e7b('0x38')]=_['merge'](_0x107286['where'],{'$or':_[_0x6e7b('0x2b')](_0x107286[_0x6e7b('0x33')],function(_0x33ee28){var _0x3a0f66={};_0x3a0f66[_0x33ee28]={'$like':'%'+_0x4d6802[_0x6e7b('0x30')][_0x6e7b('0x4b')]+'%'};return _0x3a0f66;})});}_0x107286=_[_0x6e7b('0x3b')]({},_0x107286,_0x4d6802[_0x6e7b('0x3c')]);return _0x2e2a64[_0x6e7b('0x4f')](_0x107286);}})[_0x6e7b('0x25')](function(_0x2edc70){if(_0x2edc70){_0xb0b367=_0x2edc70[_0x6e7b('0x44')];if(!_0x4d6802['query'][_0x6e7b('0x35')](_0x6e7b('0x4d'))){_0x107286[_0x6e7b('0x1b')]=qs['limit'](_0x4d6802[_0x6e7b('0x30')][_0x6e7b('0x1b')]);_0x107286['offset']=qs[_0x6e7b('0x1e')](_0x4d6802[_0x6e7b('0x30')][_0x6e7b('0x1e')]);}return _0x2e2a64[_0x6e7b('0x4f')](_0x107286);}})['then'](function(_0x21e1a3){if(_0x21e1a3){return _0x21e1a3?{'count':_0xb0b367,'rows':_0x21e1a3}:null;}})[_0x6e7b('0x25')](respondWithResult(_0x9f2db0,null))[_0x6e7b('0x48')](handleError(_0x9f2db0,null));}; \ No newline at end of file +var _0x34d2=['findAll','catch','show','params','length','find','create','body','update','getFields','ZohoField','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','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/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x276fb5,_0x207823){var _0x582b0e=function(_0x35b68f){while(--_0x35b68f){_0x276fb5['push'](_0x276fb5['shift']());}};_0x582b0e(++_0x207823);}(_0x34d2,0x152));var _0x234d=function(_0x20495b,_0x3ac496){_0x20495b=_0x20495b-0x0;var _0x26df89=_0x34d2[_0x20495b];return _0x26df89;};'use strict';var emlformat=require(_0x234d('0x0'));var rimraf=require(_0x234d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x234d('0x2'));var rp=require(_0x234d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x234d('0x4'));var util=require(_0x234d('0x5'));var path=require('path');var sox=require(_0x234d('0x6'));var csv=require(_0x234d('0x7'));var ejs=require(_0x234d('0x8'));var fs=require('fs');var fs_extra=require(_0x234d('0x9'));var _=require(_0x234d('0xa'));var squel=require(_0x234d('0xb'));var crypto=require(_0x234d('0xc'));var jsforce=require(_0x234d('0xd'));var deskjs=require(_0x234d('0xe'));var toCsv=require(_0x234d('0x7'));var querystring=require(_0x234d('0xf'));var Papa=require('papaparse');var Redis=require(_0x234d('0x10'));var authService=require(_0x234d('0x11'));var qs=require(_0x234d('0x12'));var as=require(_0x234d('0x13'));var hardwareService=require(_0x234d('0x14'));var logger=require('../../config/logger')(_0x234d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x234d('0x16'));var db=require(_0x234d('0x17'))['db'];function respondWithStatusCode(_0x28880c,_0x1786e7){_0x1786e7=_0x1786e7||0xcc;return function(_0x16185b){if(_0x16185b){return _0x28880c['sendStatus'](_0x1786e7);}return _0x28880c[_0x234d('0x18')](_0x1786e7)[_0x234d('0x19')]();};}function respondWithResult(_0x590134,_0x4d8ec6){_0x4d8ec6=_0x4d8ec6||0xc8;return function(_0x130d6a){if(_0x130d6a){return _0x590134[_0x234d('0x18')](_0x4d8ec6)[_0x234d('0x1a')](_0x130d6a);}};}function respondWithFilteredResult(_0x1ce35f,_0x2eb1fe){return function(_0x2906b9){if(_0x2906b9){var _0x4817a5=typeof _0x2eb1fe[_0x234d('0x1b')]===_0x234d('0x1c')&&typeof _0x2eb1fe[_0x234d('0x1d')]===_0x234d('0x1c');var _0x44c324=_0x2906b9[_0x234d('0x1e')];var _0x319332=_0x4817a5?0x0:_0x2eb1fe[_0x234d('0x1b')];var _0x202299=_0x4817a5?_0x2906b9[_0x234d('0x1e')]:_0x2eb1fe[_0x234d('0x1b')]+_0x2eb1fe[_0x234d('0x1d')];var _0x1d9e43;if(_0x202299>=_0x44c324){_0x202299=_0x44c324;_0x1d9e43=0xc8;}else{_0x1d9e43=0xce;}_0x1ce35f['status'](_0x1d9e43);return _0x1ce35f[_0x234d('0x1f')](_0x234d('0x20'),_0x319332+'-'+_0x202299+'/'+_0x44c324)[_0x234d('0x1a')](_0x2906b9);}return null;};}function patchUpdates(_0x4f737b){return function(_0x1f5561){try{jsonpatch[_0x234d('0x21')](_0x1f5561,_0x4f737b,!![]);}catch(_0x149e20){return BPromise['reject'](_0x149e20);}return _0x1f5561[_0x234d('0x22')]();};}function saveUpdates(_0x4001aa,_0xf2efd3){return function(_0x269657){if(_0x269657){return _0x269657['update'](_0x4001aa)[_0x234d('0x23')](function(_0x4b1f36){return _0x4b1f36;});}return null;};}function removeEntity(_0x5890c8,_0xae30f9){return function(_0x479eb3){if(_0x479eb3){return _0x479eb3[_0x234d('0x24')]()[_0x234d('0x23')](function(){_0x5890c8[_0x234d('0x18')](0xcc)[_0x234d('0x19')]();});}};}function handleEntityNotFound(_0x345daf,_0x1877fb){return function(_0x1cb687){if(!_0x1cb687){_0x345daf[_0x234d('0x25')](0x194);}return _0x1cb687;};}function handleError(_0x3b6b52,_0x412e91){_0x412e91=_0x412e91||0x1f4;return function(_0x2b8233){logger[_0x234d('0x26')](_0x2b8233[_0x234d('0x27')]);if(_0x2b8233[_0x234d('0x28')]){delete _0x2b8233[_0x234d('0x28')];}_0x3b6b52[_0x234d('0x18')](_0x412e91)[_0x234d('0x29')](_0x2b8233);};}exports[_0x234d('0x2a')]=function(_0x8596e4,_0x580f03){var _0x3387c3={},_0x3a72dc={},_0x1cabd7={'count':0x0,'rows':[]};var _0x63c811=_[_0x234d('0x2b')](db[_0x234d('0x2c')][_0x234d('0x2d')],function(_0x40b61b){return{'name':_0x40b61b['fieldName'],'type':_0x40b61b[_0x234d('0x2e')][_0x234d('0x2f')]};});_0x3a72dc[_0x234d('0x30')]=_[_0x234d('0x2b')](_0x63c811,'name');_0x3a72dc[_0x234d('0x31')]=_[_0x234d('0x32')](_0x8596e4[_0x234d('0x31')]);_0x3a72dc[_0x234d('0x33')]=_[_0x234d('0x34')](_0x3a72dc[_0x234d('0x30')],_0x3a72dc['query']);_0x3387c3[_0x234d('0x35')]=_['intersection'](_0x3a72dc['model'],qs[_0x234d('0x36')](_0x8596e4[_0x234d('0x31')][_0x234d('0x36')]));_0x3387c3[_0x234d('0x35')]=_0x3387c3[_0x234d('0x35')]['length']?_0x3387c3['attributes']:_0x3a72dc[_0x234d('0x30')];if(!_0x8596e4[_0x234d('0x31')][_0x234d('0x37')](_0x234d('0x38'))){_0x3387c3[_0x234d('0x1d')]=qs[_0x234d('0x1d')](_0x8596e4[_0x234d('0x31')][_0x234d('0x1d')]);_0x3387c3[_0x234d('0x1b')]=qs[_0x234d('0x1b')](_0x8596e4[_0x234d('0x31')][_0x234d('0x1b')]);}_0x3387c3[_0x234d('0x39')]=qs[_0x234d('0x3a')](_0x8596e4[_0x234d('0x31')]['sort']);_0x3387c3[_0x234d('0x3b')]=qs['filters'](_[_0x234d('0x3c')](_0x8596e4[_0x234d('0x31')],_0x3a72dc[_0x234d('0x33')]),_0x63c811);if(_0x8596e4[_0x234d('0x31')][_0x234d('0x3d')]){_0x3387c3[_0x234d('0x3b')]=_[_0x234d('0x3e')](_0x3387c3[_0x234d('0x3b')],{'$or':_['map'](_0x63c811,function(_0x1941e7){if(_0x1941e7['type']!==_0x234d('0x3f')){var _0x332a9a={};_0x332a9a[_0x1941e7['name']]={'$like':'%'+_0x8596e4['query'][_0x234d('0x3d')]+'%'};return _0x332a9a;}})});}_0x3387c3=_[_0x234d('0x3e')]({},_0x3387c3,_0x8596e4[_0x234d('0x40')]);var _0x5c6ebb={'where':_0x3387c3[_0x234d('0x3b')]};return db[_0x234d('0x2c')]['count'](_0x5c6ebb)['then'](function(_0x5914bb){_0x1cabd7[_0x234d('0x1e')]=_0x5914bb;if(_0x8596e4[_0x234d('0x31')][_0x234d('0x41')]){_0x3387c3[_0x234d('0x42')]=[{'all':!![]}];}return db[_0x234d('0x2c')][_0x234d('0x43')](_0x3387c3);})['then'](function(_0x41259a){_0x1cabd7['rows']=_0x41259a;return _0x1cabd7;})[_0x234d('0x23')](respondWithFilteredResult(_0x580f03,_0x3387c3))[_0x234d('0x44')](handleError(_0x580f03,null));};exports[_0x234d('0x45')]=function(_0xa3f24f,_0x3b95eb){var _0x3adee3={'raw':![],'where':{'id':_0xa3f24f[_0x234d('0x46')]['id']}},_0x5a7d8e={};_0x5a7d8e[_0x234d('0x30')]=_[_0x234d('0x32')](db[_0x234d('0x2c')][_0x234d('0x2d')]);_0x5a7d8e[_0x234d('0x31')]=_['keys'](_0xa3f24f[_0x234d('0x31')]);_0x5a7d8e[_0x234d('0x33')]=_[_0x234d('0x34')](_0x5a7d8e['model'],_0x5a7d8e['query']);_0x3adee3[_0x234d('0x35')]=_[_0x234d('0x34')](_0x5a7d8e[_0x234d('0x30')],qs['fields'](_0xa3f24f[_0x234d('0x31')][_0x234d('0x36')]));_0x3adee3[_0x234d('0x35')]=_0x3adee3[_0x234d('0x35')][_0x234d('0x47')]?_0x3adee3[_0x234d('0x35')]:_0x5a7d8e[_0x234d('0x30')];if(_0xa3f24f[_0x234d('0x31')]['includeAll']){_0x3adee3[_0x234d('0x42')]=[{'all':!![]}];}_0x3adee3=_[_0x234d('0x3e')]({},_0x3adee3,_0xa3f24f['options']);return db['ZohoConfiguration'][_0x234d('0x48')](_0x3adee3)[_0x234d('0x23')](handleEntityNotFound(_0x3b95eb,null))[_0x234d('0x23')](respondWithResult(_0x3b95eb,null))[_0x234d('0x44')](handleError(_0x3b95eb,null));};exports['create']=function(_0x1be0c3,_0x1643c5){return db[_0x234d('0x2c')][_0x234d('0x49')](_0x1be0c3[_0x234d('0x4a')],{})[_0x234d('0x23')](respondWithResult(_0x1643c5,0xc9))['catch'](handleError(_0x1643c5,null));};exports[_0x234d('0x4b')]=function(_0x590259,_0xefe78a){if(_0x590259[_0x234d('0x4a')]['id']){delete _0x590259[_0x234d('0x4a')]['id'];}return db[_0x234d('0x2c')]['find']({'where':{'id':_0x590259[_0x234d('0x46')]['id']}})['then'](handleEntityNotFound(_0xefe78a,null))[_0x234d('0x23')](saveUpdates(_0x590259['body'],null))[_0x234d('0x23')](respondWithResult(_0xefe78a,null))[_0x234d('0x44')](handleError(_0xefe78a,null));};exports[_0x234d('0x24')]=function(_0x2b0dd3,_0x54e9c2){return db[_0x234d('0x2c')][_0x234d('0x48')]({'where':{'id':_0x2b0dd3[_0x234d('0x46')]['id']}})[_0x234d('0x23')](handleEntityNotFound(_0x54e9c2,null))[_0x234d('0x23')](removeEntity(_0x54e9c2,null))[_0x234d('0x44')](handleError(_0x54e9c2,null));};exports[_0x234d('0x4c')]=function(_0x245bb7,_0x2b2abd,_0x520273){var _0x52993c={};var _0x1e59b9={};var _0x5f3683;var _0x1c740b;return db[_0x234d('0x2c')]['findOne']({'where':{'id':_0x245bb7[_0x234d('0x46')]['id']}})[_0x234d('0x23')](handleEntityNotFound(_0x2b2abd,null))[_0x234d('0x23')](function(_0x4ce57f){if(_0x4ce57f){_0x5f3683=_0x4ce57f;_0x1e59b9['model']=_['keys'](db[_0x234d('0x4d')][_0x234d('0x2d')]);_0x1e59b9['query']=_['keys'](_0x245bb7[_0x234d('0x31')]);_0x1e59b9[_0x234d('0x33')]=_[_0x234d('0x34')](_0x1e59b9[_0x234d('0x30')],_0x1e59b9[_0x234d('0x31')]);_0x52993c[_0x234d('0x35')]=_[_0x234d('0x34')](_0x1e59b9[_0x234d('0x30')],qs[_0x234d('0x36')](_0x245bb7[_0x234d('0x31')][_0x234d('0x36')]));_0x52993c[_0x234d('0x35')]=_0x52993c[_0x234d('0x35')][_0x234d('0x47')]?_0x52993c['attributes']:_0x1e59b9[_0x234d('0x30')];_0x52993c['order']=qs[_0x234d('0x3a')](_0x245bb7['query'][_0x234d('0x3a')]);_0x52993c[_0x234d('0x3b')]=qs[_0x234d('0x33')](_[_0x234d('0x3c')](_0x245bb7[_0x234d('0x31')],_0x1e59b9[_0x234d('0x33')]));if(_0x245bb7['query']['filter']){_0x52993c['where']=_[_0x234d('0x3e')](_0x52993c[_0x234d('0x3b')],{'$or':_[_0x234d('0x2b')](_0x52993c['attributes'],function(_0x50bfeb){var _0x15bc2b={};_0x15bc2b[_0x50bfeb]={'$like':'%'+_0x245bb7['query'][_0x234d('0x3d')]+'%'};return _0x15bc2b;})});}_0x52993c=_[_0x234d('0x3e')]({},_0x52993c,_0x245bb7[_0x234d('0x40')]);return _0x5f3683['getFields'](_0x52993c);}})[_0x234d('0x23')](function(_0x17214c){if(_0x17214c){_0x1c740b=_0x17214c[_0x234d('0x47')];if(!_0x245bb7[_0x234d('0x31')]['hasOwnProperty'](_0x234d('0x38'))){_0x52993c[_0x234d('0x1d')]=qs['limit'](_0x245bb7[_0x234d('0x31')][_0x234d('0x1d')]);_0x52993c['offset']=qs['offset'](_0x245bb7[_0x234d('0x31')][_0x234d('0x1b')]);}return _0x5f3683[_0x234d('0x4c')](_0x52993c);}})['then'](function(_0x19f7d4){if(_0x19f7d4){return _0x19f7d4?{'count':_0x1c740b,'rows':_0x19f7d4}:null;}})[_0x234d('0x23')](respondWithResult(_0x2b2abd,null))[_0x234d('0x44')](handleError(_0x2b2abd,null));};exports[_0x234d('0x4e')]=function(_0x528eee,_0x21bc59,_0x291dab){var _0x248e9b={};var _0x14eb03={};var _0x328743;var _0x303bff;return db['ZohoConfiguration'][_0x234d('0x4f')]({'where':{'id':_0x528eee[_0x234d('0x46')]['id']}})['then'](handleEntityNotFound(_0x21bc59,null))[_0x234d('0x23')](function(_0x1cac97){if(_0x1cac97){_0x328743=_0x1cac97;_0x14eb03['model']=_[_0x234d('0x32')](db[_0x234d('0x4d')][_0x234d('0x2d')]);_0x14eb03['query']=_[_0x234d('0x32')](_0x528eee['query']);_0x14eb03[_0x234d('0x33')]=_[_0x234d('0x34')](_0x14eb03[_0x234d('0x30')],_0x14eb03[_0x234d('0x31')]);_0x248e9b[_0x234d('0x35')]=_[_0x234d('0x34')](_0x14eb03[_0x234d('0x30')],qs['fields'](_0x528eee[_0x234d('0x31')][_0x234d('0x36')]));_0x248e9b['attributes']=_0x248e9b['attributes']['length']?_0x248e9b['attributes']:_0x14eb03[_0x234d('0x30')];_0x248e9b[_0x234d('0x39')]=qs[_0x234d('0x3a')](_0x528eee[_0x234d('0x31')][_0x234d('0x3a')]);_0x248e9b[_0x234d('0x3b')]=qs[_0x234d('0x33')](_[_0x234d('0x3c')](_0x528eee[_0x234d('0x31')],_0x14eb03[_0x234d('0x33')]));if(_0x528eee[_0x234d('0x31')][_0x234d('0x3d')]){_0x248e9b[_0x234d('0x3b')]=_[_0x234d('0x3e')](_0x248e9b[_0x234d('0x3b')],{'$or':_['map'](_0x248e9b[_0x234d('0x35')],function(_0x484139){var _0x38b85d={};_0x38b85d[_0x484139]={'$like':'%'+_0x528eee[_0x234d('0x31')]['filter']+'%'};return _0x38b85d;})});}_0x248e9b=_['merge']({},_0x248e9b,_0x528eee[_0x234d('0x40')]);return _0x328743[_0x234d('0x4e')](_0x248e9b);}})[_0x234d('0x23')](function(_0x3f91cf){if(_0x3f91cf){_0x303bff=_0x3f91cf[_0x234d('0x47')];if(!_0x528eee[_0x234d('0x31')]['hasOwnProperty'](_0x234d('0x38'))){_0x248e9b[_0x234d('0x1d')]=qs['limit'](_0x528eee[_0x234d('0x31')][_0x234d('0x1d')]);_0x248e9b['offset']=qs[_0x234d('0x1b')](_0x528eee[_0x234d('0x31')]['offset']);}return _0x328743[_0x234d('0x4e')](_0x248e9b);}})[_0x234d('0x23')](function(_0x5e026e){if(_0x5e026e){return _0x5e026e?{'count':_0x303bff,'rows':_0x5e026e}:null;}})[_0x234d('0x23')](respondWithResult(_0x21bc59,null))['catch'](handleError(_0x21bc59,null));};exports[_0x234d('0x50')]=function(_0x588e78,_0x486aeb,_0x1fdbfb){var _0x45449b={};var _0x1cb2bc={};var _0x1ea513;var _0x5dbec4;return db[_0x234d('0x2c')]['findOne']({'where':{'id':_0x588e78[_0x234d('0x46')]['id']}})[_0x234d('0x23')](handleEntityNotFound(_0x486aeb,null))[_0x234d('0x23')](function(_0x1c9d79){if(_0x1c9d79){_0x1ea513=_0x1c9d79;_0x1cb2bc['model']=_['keys'](db[_0x234d('0x4d')][_0x234d('0x2d')]);_0x1cb2bc[_0x234d('0x31')]=_['keys'](_0x588e78[_0x234d('0x31')]);_0x1cb2bc['filters']=_[_0x234d('0x34')](_0x1cb2bc['model'],_0x1cb2bc[_0x234d('0x31')]);_0x45449b[_0x234d('0x35')]=_[_0x234d('0x34')](_0x1cb2bc[_0x234d('0x30')],qs[_0x234d('0x36')](_0x588e78[_0x234d('0x31')][_0x234d('0x36')]));_0x45449b[_0x234d('0x35')]=_0x45449b[_0x234d('0x35')][_0x234d('0x47')]?_0x45449b[_0x234d('0x35')]:_0x1cb2bc[_0x234d('0x30')];_0x45449b['order']=qs[_0x234d('0x3a')](_0x588e78[_0x234d('0x31')][_0x234d('0x3a')]);_0x45449b[_0x234d('0x3b')]=qs[_0x234d('0x33')](_['pick'](_0x588e78['query'],_0x1cb2bc[_0x234d('0x33')]));if(_0x588e78['query'][_0x234d('0x3d')]){_0x45449b[_0x234d('0x3b')]=_['merge'](_0x45449b[_0x234d('0x3b')],{'$or':_[_0x234d('0x2b')](_0x45449b[_0x234d('0x35')],function(_0x48a1f8){var _0x5294e9={};_0x5294e9[_0x48a1f8]={'$like':'%'+_0x588e78[_0x234d('0x31')][_0x234d('0x3d')]+'%'};return _0x5294e9;})});}_0x45449b=_[_0x234d('0x3e')]({},_0x45449b,_0x588e78[_0x234d('0x40')]);return _0x1ea513[_0x234d('0x50')](_0x45449b);}})[_0x234d('0x23')](function(_0x27e58d){if(_0x27e58d){_0x5dbec4=_0x27e58d['length'];if(!_0x588e78['query'][_0x234d('0x37')](_0x234d('0x38'))){_0x45449b['limit']=qs[_0x234d('0x1d')](_0x588e78['query']['limit']);_0x45449b[_0x234d('0x1b')]=qs[_0x234d('0x1b')](_0x588e78['query']['offset']);}return _0x1ea513[_0x234d('0x50')](_0x45449b);}})[_0x234d('0x23')](function(_0x44891e){if(_0x44891e){return _0x44891e?{'count':_0x5dbec4,'rows':_0x44891e}:null;}})['then'](respondWithResult(_0x486aeb,null))[_0x234d('0x44')](handleError(_0x486aeb,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 4dd2ea0..eaf5621 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 _0xdf02=['bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x575527,_0xdd5ebb){var _0x63f7d2=function(_0x5bf03a){while(--_0x5bf03a){_0x575527['push'](_0x575527['shift']());}};_0x63f7d2(++_0xdd5ebb);}(_0xdf02,0x168));var _0x2df0=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xdf02[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x2df0('0x0'));var util=require('util');var logger=require(_0x2df0('0x1'))(_0x2df0('0x2'));var moment=require(_0x2df0('0x3'));var BPromise=require(_0x2df0('0x4'));var rp=require(_0x2df0('0x5'));var fs=require('fs');var path=require(_0x2df0('0x6'));var rimraf=require(_0x2df0('0x7'));var config=require('../../config/environment');var attributes=require(_0x2df0('0x8'));module[_0x2df0('0x9')]=function(_0x1ef7d9,_0x55bf55){return _0x1ef7d9[_0x2df0('0xa')](_0x2df0('0xb'),attributes,{'tableName':_0x2df0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ed4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ZohoConfiguration','lodash'];(function(_0x813b50,_0x7bdeaa){var _0x4f6010=function(_0x23e0ef){while(--_0x23e0ef){_0x813b50['push'](_0x813b50['shift']());}};_0x4f6010(++_0x7bdeaa);}(_0x2ed4,0x83));var _0x42ed=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x2ed4[_0x53b53e];return _0xbb6179;};'use strict';var _=require(_0x42ed('0x0'));var util=require(_0x42ed('0x1'));var logger=require(_0x42ed('0x2'))(_0x42ed('0x3'));var moment=require(_0x42ed('0x4'));var BPromise=require(_0x42ed('0x5'));var rp=require(_0x42ed('0x6'));var fs=require('fs');var path=require(_0x42ed('0x7'));var rimraf=require(_0x42ed('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x42ed('0x9')]=function(_0x546c9e,_0x28e7f3){return _0x546c9e[_0x42ed('0xa')](_0x42ed('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index e7f203d..2864c42 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 _0xa1d5=['catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4c991a,_0x460730){var _0x5e3164=function(_0x286be1){while(--_0x286be1){_0x4c991a['push'](_0x4c991a['shift']());}};_0x5e3164(++_0x460730);}(_0xa1d5,0x18d));var _0x5a1d=function(_0x51fbb8,_0x3f9352){_0x51fbb8=_0x51fbb8-0x0;var _0x332188=_0xa1d5[_0x51fbb8];return _0x332188;};'use strict';var _=require(_0x5a1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5a1d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a1d('0x2'));var db=require(_0x5a1d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a1d('0x4'))(_0x5a1d('0x5'));var config=require(_0x5a1d('0x6'));var jayson=require(_0x5a1d('0x7'));var client=jayson[_0x5a1d('0x8')][_0x5a1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18f632,_0x21ac81,_0x3fa2a1){return new BPromise(function(_0x4b6fa2,_0x529c66){return client[_0x5a1d('0xa')](_0x18f632,_0x3fa2a1)[_0x5a1d('0xb')](function(_0x3b8134){logger[_0x5a1d('0xc')](_0x5a1d('0xd'),_0x21ac81,_0x5a1d('0xe'));logger[_0x5a1d('0xf')](_0x5a1d('0x10'),_0x21ac81,_0x5a1d('0xe'),JSON[_0x5a1d('0x11')](_0x3b8134));if(_0x3b8134['error']){if(_0x3b8134[_0x5a1d('0x12')]['code']===0x1f4){logger[_0x5a1d('0x12')](_0x5a1d('0xd'),_0x21ac81,_0x3b8134['error'][_0x5a1d('0x13')]);return _0x529c66(_0x3b8134[_0x5a1d('0x12')][_0x5a1d('0x13')]);}logger['error'](_0x5a1d('0xd'),_0x21ac81,_0x3b8134[_0x5a1d('0x12')][_0x5a1d('0x13')]);return _0x4b6fa2(_0x3b8134[_0x5a1d('0x12')][_0x5a1d('0x13')]);}else{logger[_0x5a1d('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x21ac81,_0x5a1d('0xe'));_0x4b6fa2(_0x3b8134[_0x5a1d('0x14')][_0x5a1d('0x13')]);}})[_0x5a1d('0x15')](function(_0x9ad44f){logger[_0x5a1d('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x21ac81,_0x9ad44f);_0x529c66(_0x9ad44f);});});} \ No newline at end of file +var _0x8469=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b823b,_0x3c3f3f){var _0x1cbe3d=function(_0x5cc7fe){while(--_0x5cc7fe){_0x2b823b['push'](_0x2b823b['shift']());}};_0x1cbe3d(++_0x3c3f3f);}(_0x8469,0x137));var _0x9846=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x8469[_0x1857d0];return _0x3e3c46;};'use strict';var _=require(_0x9846('0x0'));var util=require(_0x9846('0x1'));var moment=require(_0x9846('0x2'));var BPromise=require(_0x9846('0x3'));var rs=require(_0x9846('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9846('0x5'));var config=require(_0x9846('0x6'));var jayson=require(_0x9846('0x7'));var client=jayson[_0x9846('0x8')][_0x9846('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c1de7,_0x2ed132,_0x20da89){return new BPromise(function(_0x34eecc,_0x21e5ae){return client['request'](_0x1c1de7,_0x20da89)['then'](function(_0x4daaf7){logger['info'](_0x9846('0xa'),_0x2ed132,_0x9846('0xb'));logger[_0x9846('0xc')](_0x9846('0xd'),_0x2ed132,_0x9846('0xb'),JSON['stringify'](_0x4daaf7));if(_0x4daaf7[_0x9846('0xe')]){if(_0x4daaf7[_0x9846('0xe')][_0x9846('0xf')]===0x1f4){logger[_0x9846('0xe')](_0x9846('0xa'),_0x2ed132,_0x4daaf7['error'][_0x9846('0x10')]);return _0x21e5ae(_0x4daaf7['error']['message']);}logger[_0x9846('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ed132,_0x4daaf7['error']['message']);return _0x34eecc(_0x4daaf7[_0x9846('0xe')][_0x9846('0x10')]);}else{logger[_0x9846('0x11')](_0x9846('0xa'),_0x2ed132,_0x9846('0xb'));_0x34eecc(_0x4daaf7['result'][_0x9846('0x10')]);}})['catch'](function(_0x28c1ea){logger[_0x9846('0xe')](_0x9846('0xa'),_0x2ed132,_0x28c1ea);_0x21e5ae(_0x28c1ea);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 03cfff0..a0e949b 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 _0x4549=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','post','put','update','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4549,0x15d));var _0x9454=function(_0x2f38ca,_0x4e1d51){_0x2f38ca=_0x2f38ca-0x0;var _0x5e66df=_0x4549[_0x2f38ca];return _0x5e66df;};'use strict';var multer=require('multer');var util=require(_0x9454('0x0'));var path=require('path');var timeout=require(_0x9454('0x1'));var express=require(_0x9454('0x2'));var router=express[_0x9454('0x3')]();var fs_extra=require(_0x9454('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9454('0x5'));var config=require(_0x9454('0x6'));var controller=require(_0x9454('0x7'));router[_0x9454('0x8')]('/',auth[_0x9454('0x9')](),controller['index']);router[_0x9454('0x8')](_0x9454('0xa'),auth[_0x9454('0x9')](),controller['show']);router[_0x9454('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9454('0xc')](_0x9454('0xa'),auth[_0x9454('0x9')](),controller[_0x9454('0xd')]);router['delete'](_0x9454('0xa'),auth[_0x9454('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xedcc=['post','create','put','update','delete','multer','path','express','fs-extra','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xedcc,0x105));var _0xcedc=function(_0x340ed8,_0x88df6d){_0x340ed8=_0x340ed8-0x0;var _0x252f7d=_0xedcc[_0x340ed8];return _0x252f7d;};'use strict';var multer=require(_0xcedc('0x0'));var util=require('util');var path=require(_0xcedc('0x1'));var timeout=require('connect-timeout');var express=require(_0xcedc('0x2'));var router=express['Router']();var fs_extra=require(_0xcedc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcedc('0x4'));var config=require('../../config/environment');var controller=require(_0xcedc('0x5'));router[_0xcedc('0x6')]('/',auth[_0xcedc('0x7')](),controller[_0xcedc('0x8')]);router[_0xcedc('0x6')](_0xcedc('0x9'),auth[_0xcedc('0x7')](),controller[_0xcedc('0xa')]);router[_0xcedc('0xb')]('/',auth['isAuthenticated'](),controller[_0xcedc('0xc')]);router[_0xcedc('0xd')](_0xcedc('0x9'),auth[_0xcedc('0x7')](),controller[_0xcedc('0xe')]);router[_0xcedc('0xf')]('/:id',auth[_0xcedc('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 05d96d0..3512b91 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 _0xd7b7=['customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x819ce,_0xf25f51){var _0x1edcf0=function(_0x192389){while(--_0x192389){_0x819ce['push'](_0x819ce['shift']());}};_0x1edcf0(++_0xf25f51);}(_0xd7b7,0x16c));var _0x7d7b=function(_0x43b3d3,_0x2a7853){_0x43b3d3=_0x43b3d3-0x0;var _0x47563c=_0xd7b7[_0x43b3d3];return _0x47563c;};'use strict';var Sequelize=require(_0x7d7b('0x0'));module[_0x7d7b('0x1')]={'type':{'type':Sequelize[_0x7d7b('0x2')](_0x7d7b('0x3'),_0x7d7b('0x4'),_0x7d7b('0x5'),'keyValue',_0x7d7b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7d7b('0x7')]},'key':{'type':Sequelize[_0x7d7b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x7d7b('0x3'),_0x7d7b('0x4'),_0x7d7b('0x5'))},'keyContent':{'type':Sequelize[_0x7d7b('0x7')]},'idField':{'type':Sequelize[_0x7d7b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7d7b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8c1e=['variable','customVariable','keyValue','picklist','STRING','exports','ENUM','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c1e,0x165));var _0xe8c1=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x8c1e[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module[_0xe8c1('0x0')]={'type':{'type':Sequelize[_0xe8c1('0x1')](_0xe8c1('0x2'),_0xe8c1('0x3'),_0xe8c1('0x4'),_0xe8c1('0x5'),_0xe8c1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe8c1('0x1')](_0xe8c1('0x2'),_0xe8c1('0x3'),_0xe8c1('0x4'))},'keyContent':{'type':Sequelize[_0xe8c1('0x7')]},'idField':{'type':Sequelize[_0xe8c1('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe8c1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 7ba4eb5..801eb63 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 _0xf41e=['type','VIRTUAL','merge','options','ZohoField','count','includeAll','findAll','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xf41e,0x167));var _0xef41=function(_0x2c4570,_0xf5346){_0x2c4570=_0x2c4570-0x0;var _0x5334d8=_0xf41e[_0x2c4570];return _0x5334d8;};'use strict';var emlformat=require(_0xef41('0x0'));var rimraf=require(_0xef41('0x1'));var zipdir=require(_0xef41('0x2'));var jsonpatch=require(_0xef41('0x3'));var rp=require(_0xef41('0x4'));var moment=require(_0xef41('0x5'));var BPromise=require(_0xef41('0x6'));var Mustache=require(_0xef41('0x7'));var util=require('util');var path=require('path');var sox=require(_0xef41('0x8'));var csv=require(_0xef41('0x9'));var ejs=require(_0xef41('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xef41('0xb'));var deskjs=require(_0xef41('0xc'));var toCsv=require('to-csv');var querystring=require(_0xef41('0xd'));var Papa=require(_0xef41('0xe'));var Redis=require(_0xef41('0xf'));var authService=require(_0xef41('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef41('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xef41('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xef41('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd1bdcb,_0x426fb9){_0x426fb9=_0x426fb9||0xcc;return function(_0x46aadf){if(_0x46aadf){return _0xd1bdcb[_0xef41('0x14')](_0x426fb9);}return _0xd1bdcb[_0xef41('0x15')](_0x426fb9)[_0xef41('0x16')]();};}function respondWithResult(_0x54dbc6,_0x4e65b4){_0x4e65b4=_0x4e65b4||0xc8;return function(_0x7f3093){if(_0x7f3093){return _0x54dbc6[_0xef41('0x15')](_0x4e65b4)['json'](_0x7f3093);}};}function respondWithFilteredResult(_0x2f1fcf,_0x15f700){return function(_0x206eac){if(_0x206eac){var _0x1ccd87=typeof _0x15f700[_0xef41('0x17')]===_0xef41('0x18')&&typeof _0x15f700[_0xef41('0x19')]===_0xef41('0x18');var _0x82286c=_0x206eac['count'];var _0xd18802=_0x1ccd87?0x0:_0x15f700[_0xef41('0x17')];var _0x108961=_0x1ccd87?_0x206eac['count']:_0x15f700[_0xef41('0x17')]+_0x15f700[_0xef41('0x19')];var _0x5686ab;if(_0x108961>=_0x82286c){_0x108961=_0x82286c;_0x5686ab=0xc8;}else{_0x5686ab=0xce;}_0x2f1fcf['status'](_0x5686ab);return _0x2f1fcf[_0xef41('0x1a')]('Content-Range',_0xd18802+'-'+_0x108961+'/'+_0x82286c)[_0xef41('0x1b')](_0x206eac);}return null;};}function patchUpdates(_0x2df964){return function(_0x598765){try{jsonpatch[_0xef41('0x1c')](_0x598765,_0x2df964,!![]);}catch(_0x2acc37){return BPromise[_0xef41('0x1d')](_0x2acc37);}return _0x598765['save']();};}function saveUpdates(_0x525b1a,_0x2f105b){return function(_0x155c93){if(_0x155c93){return _0x155c93[_0xef41('0x1e')](_0x525b1a)[_0xef41('0x1f')](function(_0x406f81){return _0x406f81;});}return null;};}function removeEntity(_0x427949,_0x341650){return function(_0x1bfb93){if(_0x1bfb93){return _0x1bfb93[_0xef41('0x20')]()[_0xef41('0x1f')](function(){_0x427949[_0xef41('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52da94,_0x3b2af7){return function(_0x41edd7){if(!_0x41edd7){_0x52da94[_0xef41('0x14')](0x194);}return _0x41edd7;};}function handleError(_0x1518f0,_0xa657a1){_0xa657a1=_0xa657a1||0x1f4;return function(_0x5027d0){logger[_0xef41('0x21')](_0x5027d0['stack']);if(_0x5027d0[_0xef41('0x22')]){delete _0x5027d0[_0xef41('0x22')];}_0x1518f0['status'](_0xa657a1)[_0xef41('0x23')](_0x5027d0);};}exports[_0xef41('0x24')]=function(_0x5df038,_0x41c819){var _0x324d68={},_0x378f4c={},_0x48c574={'count':0x0,'rows':[]};var _0x4cd755=_[_0xef41('0x25')](db['ZohoField'][_0xef41('0x26')],function(_0x4e5e80){return{'name':_0x4e5e80['fieldName'],'type':_0x4e5e80['type'][_0xef41('0x27')]};});_0x378f4c[_0xef41('0x28')]=_[_0xef41('0x25')](_0x4cd755,_0xef41('0x22'));_0x378f4c['query']=_[_0xef41('0x29')](_0x5df038[_0xef41('0x2a')]);_0x378f4c[_0xef41('0x2b')]=_[_0xef41('0x2c')](_0x378f4c[_0xef41('0x28')],_0x378f4c['query']);_0x324d68['attributes']=_['intersection'](_0x378f4c['model'],qs['fields'](_0x5df038['query'][_0xef41('0x2d')]));_0x324d68['attributes']=_0x324d68[_0xef41('0x2e')][_0xef41('0x2f')]?_0x324d68[_0xef41('0x2e')]:_0x378f4c[_0xef41('0x28')];if(!_0x5df038[_0xef41('0x2a')][_0xef41('0x30')](_0xef41('0x31'))){_0x324d68[_0xef41('0x19')]=qs[_0xef41('0x19')](_0x5df038[_0xef41('0x2a')]['limit']);_0x324d68[_0xef41('0x17')]=qs['offset'](_0x5df038[_0xef41('0x2a')]['offset']);}_0x324d68[_0xef41('0x32')]=qs[_0xef41('0x33')](_0x5df038[_0xef41('0x2a')][_0xef41('0x33')]);_0x324d68[_0xef41('0x34')]=qs['filters'](_[_0xef41('0x35')](_0x5df038['query'],_0x378f4c['filters']),_0x4cd755);if(_0x5df038[_0xef41('0x2a')][_0xef41('0x36')]){_0x324d68[_0xef41('0x34')]=_['merge'](_0x324d68[_0xef41('0x34')],{'$or':_[_0xef41('0x25')](_0x4cd755,function(_0x30a7f1){if(_0x30a7f1[_0xef41('0x37')]!==_0xef41('0x38')){var _0x17a37c={};_0x17a37c[_0x30a7f1[_0xef41('0x22')]]={'$like':'%'+_0x5df038[_0xef41('0x2a')][_0xef41('0x36')]+'%'};return _0x17a37c;}})});}_0x324d68=_[_0xef41('0x39')]({},_0x324d68,_0x5df038[_0xef41('0x3a')]);var _0x3155c8={'where':_0x324d68[_0xef41('0x34')]};return db[_0xef41('0x3b')][_0xef41('0x3c')](_0x3155c8)['then'](function(_0x450bb9){_0x48c574[_0xef41('0x3c')]=_0x450bb9;if(_0x5df038[_0xef41('0x2a')][_0xef41('0x3d')]){_0x324d68['include']=[{'all':!![]}];}return db[_0xef41('0x3b')][_0xef41('0x3e')](_0x324d68);})['then'](function(_0x2e664b){_0x48c574['rows']=_0x2e664b;return _0x48c574;})[_0xef41('0x1f')](respondWithFilteredResult(_0x41c819,_0x324d68))[_0xef41('0x3f')](handleError(_0x41c819,null));};exports['show']=function(_0x4685af,_0x31ada7){var _0x57f412={'raw':!![],'where':{'id':_0x4685af[_0xef41('0x40')]['id']}},_0x108a92={};_0x108a92['model']=_[_0xef41('0x29')](db[_0xef41('0x3b')][_0xef41('0x26')]);_0x108a92['query']=_['keys'](_0x4685af[_0xef41('0x2a')]);_0x108a92[_0xef41('0x2b')]=_[_0xef41('0x2c')](_0x108a92[_0xef41('0x28')],_0x108a92[_0xef41('0x2a')]);_0x57f412['attributes']=_[_0xef41('0x2c')](_0x108a92[_0xef41('0x28')],qs[_0xef41('0x2d')](_0x4685af[_0xef41('0x2a')]['fields']));_0x57f412[_0xef41('0x2e')]=_0x57f412[_0xef41('0x2e')][_0xef41('0x2f')]?_0x57f412[_0xef41('0x2e')]:_0x108a92['model'];if(_0x4685af['query'][_0xef41('0x3d')]){_0x57f412[_0xef41('0x41')]=[{'all':!![]}];}_0x57f412=_['merge']({},_0x57f412,_0x4685af[_0xef41('0x3a')]);return db[_0xef41('0x3b')][_0xef41('0x42')](_0x57f412)[_0xef41('0x1f')](handleEntityNotFound(_0x31ada7,null))[_0xef41('0x1f')](respondWithResult(_0x31ada7,null))['catch'](handleError(_0x31ada7,null));};exports[_0xef41('0x43')]=function(_0x141363,_0x200b0d){return db[_0xef41('0x3b')][_0xef41('0x43')](_0x141363[_0xef41('0x44')],{})[_0xef41('0x1f')](respondWithResult(_0x200b0d,0xc9))['catch'](handleError(_0x200b0d,null));};exports[_0xef41('0x1e')]=function(_0x744ffc,_0x886039){if(_0x744ffc[_0xef41('0x44')]['id']){delete _0x744ffc[_0xef41('0x44')]['id'];}return db['ZohoField'][_0xef41('0x42')]({'where':{'id':_0x744ffc[_0xef41('0x40')]['id']}})['then'](handleEntityNotFound(_0x886039,null))[_0xef41('0x1f')](saveUpdates(_0x744ffc[_0xef41('0x44')],null))[_0xef41('0x1f')](respondWithResult(_0x886039,null))[_0xef41('0x3f')](handleError(_0x886039,null));};exports['destroy']=function(_0x1a1f61,_0x2009e4){return db[_0xef41('0x3b')]['find']({'where':{'id':_0x1a1f61[_0xef41('0x40')]['id']}})[_0xef41('0x1f')](handleEntityNotFound(_0x2009e4,null))[_0xef41('0x1f')](removeEntity(_0x2009e4,null))[_0xef41('0x3f')](handleError(_0x2009e4,null));}; \ No newline at end of file +var _0x7cca=['map','ZohoField','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0x7cca,0x67));var _0xa7cc=function(_0x2f0e95,_0x3e946e){_0x2f0e95=_0x2f0e95-0x0;var _0x230c64=_0x7cca[_0x2f0e95];return _0x230c64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa7cc('0x0'));var jsonpatch=require(_0xa7cc('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa7cc('0x2'));var util=require('util');var path=require('path');var sox=require(_0xa7cc('0x3'));var csv=require(_0xa7cc('0x4'));var ejs=require(_0xa7cc('0x5'));var fs=require('fs');var fs_extra=require(_0xa7cc('0x6'));var _=require(_0xa7cc('0x7'));var squel=require(_0xa7cc('0x8'));var crypto=require(_0xa7cc('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7cc('0x4'));var querystring=require(_0xa7cc('0xa'));var Papa=require(_0xa7cc('0xb'));var Redis=require(_0xa7cc('0xc'));var authService=require(_0xa7cc('0xd'));var qs=require(_0xa7cc('0xe'));var as=require(_0xa7cc('0xf'));var hardwareService=require(_0xa7cc('0x10'));var logger=require(_0xa7cc('0x11'))(_0xa7cc('0x12'));var utils=require('../../config/utils');var config=require(_0xa7cc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7cc('0x14'))['db'];function respondWithStatusCode(_0x5e7d6f,_0x4bb91a){_0x4bb91a=_0x4bb91a||0xcc;return function(_0x27cfa5){if(_0x27cfa5){return _0x5e7d6f['sendStatus'](_0x4bb91a);}return _0x5e7d6f[_0xa7cc('0x15')](_0x4bb91a)['end']();};}function respondWithResult(_0x303d6d,_0xb49321){_0xb49321=_0xb49321||0xc8;return function(_0x258a7c){if(_0x258a7c){return _0x303d6d['status'](_0xb49321)[_0xa7cc('0x16')](_0x258a7c);}};}function respondWithFilteredResult(_0x1f965a,_0x28e3c8){return function(_0x5cc3fb){if(_0x5cc3fb){var _0x40ec57=typeof _0x28e3c8[_0xa7cc('0x17')]===_0xa7cc('0x18')&&typeof _0x28e3c8[_0xa7cc('0x19')]===_0xa7cc('0x18');var _0x22e689=_0x5cc3fb[_0xa7cc('0x1a')];var _0x1d1bd7=_0x40ec57?0x0:_0x28e3c8[_0xa7cc('0x17')];var _0xcc85f4=_0x40ec57?_0x5cc3fb[_0xa7cc('0x1a')]:_0x28e3c8[_0xa7cc('0x17')]+_0x28e3c8[_0xa7cc('0x19')];var _0x2de319;if(_0xcc85f4>=_0x22e689){_0xcc85f4=_0x22e689;_0x2de319=0xc8;}else{_0x2de319=0xce;}_0x1f965a[_0xa7cc('0x15')](_0x2de319);return _0x1f965a[_0xa7cc('0x1b')](_0xa7cc('0x1c'),_0x1d1bd7+'-'+_0xcc85f4+'/'+_0x22e689)['json'](_0x5cc3fb);}return null;};}function patchUpdates(_0x11b302){return function(_0x4d8f2c){try{jsonpatch[_0xa7cc('0x1d')](_0x4d8f2c,_0x11b302,!![]);}catch(_0x501be7){return BPromise[_0xa7cc('0x1e')](_0x501be7);}return _0x4d8f2c[_0xa7cc('0x1f')]();};}function saveUpdates(_0x4c9f30,_0x50dee2){return function(_0x1fb50f){if(_0x1fb50f){return _0x1fb50f[_0xa7cc('0x20')](_0x4c9f30)['then'](function(_0x27e311){return _0x27e311;});}return null;};}function removeEntity(_0x183c4e,_0x15b6df){return function(_0x206df2){if(_0x206df2){return _0x206df2[_0xa7cc('0x21')]()[_0xa7cc('0x22')](function(){_0x183c4e['status'](0xcc)[_0xa7cc('0x23')]();});}};}function handleEntityNotFound(_0x3c409b,_0x211bd4){return function(_0x2ca82b){if(!_0x2ca82b){_0x3c409b['sendStatus'](0x194);}return _0x2ca82b;};}function handleError(_0xb8c7c8,_0x9dad){_0x9dad=_0x9dad||0x1f4;return function(_0x541c4c){logger[_0xa7cc('0x24')](_0x541c4c[_0xa7cc('0x25')]);if(_0x541c4c[_0xa7cc('0x26')]){delete _0x541c4c[_0xa7cc('0x26')];}_0xb8c7c8['status'](_0x9dad)[_0xa7cc('0x27')](_0x541c4c);};}exports[_0xa7cc('0x28')]=function(_0x28e052,_0x134e51){var _0x40e76a={},_0x21f2ab={},_0x2cc61b={'count':0x0,'rows':[]};var _0x3d7eeb=_[_0xa7cc('0x29')](db[_0xa7cc('0x2a')]['rawAttributes'],function(_0x2beee1){return{'name':_0x2beee1[_0xa7cc('0x2b')],'type':_0x2beee1[_0xa7cc('0x2c')]['key']};});_0x21f2ab['model']=_[_0xa7cc('0x29')](_0x3d7eeb,_0xa7cc('0x26'));_0x21f2ab['query']=_[_0xa7cc('0x2d')](_0x28e052['query']);_0x21f2ab[_0xa7cc('0x2e')]=_[_0xa7cc('0x2f')](_0x21f2ab[_0xa7cc('0x30')],_0x21f2ab['query']);_0x40e76a[_0xa7cc('0x31')]=_[_0xa7cc('0x2f')](_0x21f2ab[_0xa7cc('0x30')],qs[_0xa7cc('0x32')](_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x32')]));_0x40e76a[_0xa7cc('0x31')]=_0x40e76a['attributes'][_0xa7cc('0x34')]?_0x40e76a[_0xa7cc('0x31')]:_0x21f2ab[_0xa7cc('0x30')];if(!_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x35')]('nolimit')){_0x40e76a[_0xa7cc('0x19')]=qs['limit'](_0x28e052['query'][_0xa7cc('0x19')]);_0x40e76a[_0xa7cc('0x17')]=qs['offset'](_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x17')]);}_0x40e76a[_0xa7cc('0x36')]=qs['sort'](_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x37')]);_0x40e76a[_0xa7cc('0x38')]=qs['filters'](_[_0xa7cc('0x39')](_0x28e052[_0xa7cc('0x33')],_0x21f2ab[_0xa7cc('0x2e')]),_0x3d7eeb);if(_0x28e052[_0xa7cc('0x33')]['filter']){_0x40e76a['where']=_[_0xa7cc('0x3a')](_0x40e76a[_0xa7cc('0x38')],{'$or':_['map'](_0x3d7eeb,function(_0x336e35){if(_0x336e35[_0xa7cc('0x2c')]!==_0xa7cc('0x3b')){var _0x116fbb={};_0x116fbb[_0x336e35[_0xa7cc('0x26')]]={'$like':'%'+_0x28e052['query']['filter']+'%'};return _0x116fbb;}})});}_0x40e76a=_[_0xa7cc('0x3a')]({},_0x40e76a,_0x28e052[_0xa7cc('0x3c')]);var _0x16119a={'where':_0x40e76a[_0xa7cc('0x38')]};return db['ZohoField']['count'](_0x16119a)['then'](function(_0x1a629f){_0x2cc61b[_0xa7cc('0x1a')]=_0x1a629f;if(_0x28e052['query'][_0xa7cc('0x3d')]){_0x40e76a[_0xa7cc('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0xa7cc('0x3f')](_0x40e76a);})[_0xa7cc('0x22')](function(_0x409b1a){_0x2cc61b[_0xa7cc('0x40')]=_0x409b1a;return _0x2cc61b;})[_0xa7cc('0x22')](respondWithFilteredResult(_0x134e51,_0x40e76a))[_0xa7cc('0x41')](handleError(_0x134e51,null));};exports[_0xa7cc('0x42')]=function(_0xdcb834,_0x329e03){var _0x55c5ac={'raw':!![],'where':{'id':_0xdcb834[_0xa7cc('0x43')]['id']}},_0xb07bf1={};_0xb07bf1[_0xa7cc('0x30')]=_[_0xa7cc('0x2d')](db[_0xa7cc('0x2a')][_0xa7cc('0x44')]);_0xb07bf1[_0xa7cc('0x33')]=_[_0xa7cc('0x2d')](_0xdcb834[_0xa7cc('0x33')]);_0xb07bf1[_0xa7cc('0x2e')]=_[_0xa7cc('0x2f')](_0xb07bf1[_0xa7cc('0x30')],_0xb07bf1[_0xa7cc('0x33')]);_0x55c5ac[_0xa7cc('0x31')]=_[_0xa7cc('0x2f')](_0xb07bf1['model'],qs[_0xa7cc('0x32')](_0xdcb834[_0xa7cc('0x33')][_0xa7cc('0x32')]));_0x55c5ac[_0xa7cc('0x31')]=_0x55c5ac[_0xa7cc('0x31')]['length']?_0x55c5ac[_0xa7cc('0x31')]:_0xb07bf1['model'];if(_0xdcb834[_0xa7cc('0x33')][_0xa7cc('0x3d')]){_0x55c5ac[_0xa7cc('0x3e')]=[{'all':!![]}];}_0x55c5ac=_['merge']({},_0x55c5ac,_0xdcb834[_0xa7cc('0x3c')]);return db[_0xa7cc('0x2a')][_0xa7cc('0x45')](_0x55c5ac)[_0xa7cc('0x22')](handleEntityNotFound(_0x329e03,null))[_0xa7cc('0x22')](respondWithResult(_0x329e03,null))[_0xa7cc('0x41')](handleError(_0x329e03,null));};exports[_0xa7cc('0x46')]=function(_0xf41dcf,_0x3dd183){return db[_0xa7cc('0x2a')][_0xa7cc('0x46')](_0xf41dcf['body'],{})[_0xa7cc('0x22')](respondWithResult(_0x3dd183,0xc9))['catch'](handleError(_0x3dd183,null));};exports['update']=function(_0x328f8d,_0x3aed84){if(_0x328f8d[_0xa7cc('0x47')]['id']){delete _0x328f8d[_0xa7cc('0x47')]['id'];}return db[_0xa7cc('0x2a')][_0xa7cc('0x45')]({'where':{'id':_0x328f8d['params']['id']}})['then'](handleEntityNotFound(_0x3aed84,null))[_0xa7cc('0x22')](saveUpdates(_0x328f8d[_0xa7cc('0x47')],null))[_0xa7cc('0x22')](respondWithResult(_0x3aed84,null))['catch'](handleError(_0x3aed84,null));};exports[_0xa7cc('0x21')]=function(_0xbfa4de,_0x3f4278){return db['ZohoField'][_0xa7cc('0x45')]({'where':{'id':_0xbfa4de[_0xa7cc('0x43')]['id']}})[_0xa7cc('0x22')](handleEntityNotFound(_0x3f4278,null))['then'](removeEntity(_0x3f4278,null))[_0xa7cc('0x41')](handleError(_0x3f4278,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 44783b4..9f5868d 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 _0x5c3c=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4f6758,_0x4a1a7a){var _0x2f549b=function(_0x4f4870){while(--_0x4f4870){_0x4f6758['push'](_0x4f6758['shift']());}};_0x2f549b(++_0x4a1a7a);}(_0x5c3c,0x132));var _0xc5c3=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x5c3c[_0x34bf97];return _0x292719;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['api','moment','bluebird','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x29953d,_0x3dcad5){var _0x261168=function(_0x54e3c9){while(--_0x54e3c9){_0x29953d['push'](_0x29953d['shift']());}};_0x261168(++_0x3dcad5);}(_0x430c,0x1a1));var _0xc430=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x430c[_0x324fe8];return _0x4a1cd9;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x9'),_0xc430('0xa')],'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 64e56ea..106af96 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 _0x04c1=['moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash'];(function(_0xf0611f,_0x3ffb16){var _0x1e3633=function(_0x1f1a90){while(--_0x1f1a90){_0xf0611f['push'](_0xf0611f['shift']());}};_0x1e3633(++_0x3ffb16);}(_0x04c1,0x1b8));var _0x104c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x04c1[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x104c('0x0'));var util=require('util');var moment=require(_0x104c('0x1'));var BPromise=require(_0x104c('0x2'));var rs=require(_0x104c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x104c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x104c('0x5'));var jayson=require(_0x104c('0x6'));var client=jayson[_0x104c('0x7')][_0x104c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x551cff,_0xcc5032,_0x289ad2){return new BPromise(function(_0x174658,_0x1ad14f){return client[_0x104c('0x9')](_0x551cff,_0x289ad2)[_0x104c('0xa')](function(_0x5d0d5c){logger['info'](_0x104c('0xb'),_0xcc5032,_0x104c('0xc'));logger[_0x104c('0xd')](_0x104c('0xe'),_0xcc5032,_0x104c('0xc'),JSON[_0x104c('0xf')](_0x5d0d5c));if(_0x5d0d5c['error']){if(_0x5d0d5c['error'][_0x104c('0x10')]===0x1f4){logger[_0x104c('0x11')]('ZohoField,\x20%s,\x20%s',_0xcc5032,_0x5d0d5c['error'][_0x104c('0x12')]);return _0x1ad14f(_0x5d0d5c[_0x104c('0x11')][_0x104c('0x12')]);}logger[_0x104c('0x11')]('ZohoField,\x20%s,\x20%s',_0xcc5032,_0x5d0d5c['error']['message']);return _0x174658(_0x5d0d5c[_0x104c('0x11')][_0x104c('0x12')]);}else{logger[_0x104c('0x13')]('ZohoField,\x20%s,\x20%s',_0xcc5032,'request\x20sent');_0x174658(_0x5d0d5c['result'][_0x104c('0x12')]);}})[_0x104c('0x14')](function(_0x4ef06b){logger['error'](_0x104c('0xb'),_0xcc5032,_0x4ef06b);_0x1ad14f(_0x4ef06b);});});} \ No newline at end of file +var _0x15f9=['ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe96a68,_0x5bbd3a){var _0x4f5d00=function(_0x3a7291){while(--_0x3a7291){_0xe96a68['push'](_0xe96a68['shift']());}};_0x4f5d00(++_0x5bbd3a);}(_0x15f9,0x164));var _0x915f=function(_0x5aa258,_0x594029){_0x5aa258=_0x5aa258-0x0;var _0x1c27de=_0x15f9[_0x5aa258];return _0x1c27de;};'use strict';var _=require(_0x915f('0x0'));var util=require(_0x915f('0x1'));var moment=require('moment');var BPromise=require(_0x915f('0x2'));var rs=require(_0x915f('0x3'));var fs=require('fs');var Redis=require(_0x915f('0x4'));var db=require(_0x915f('0x5'))['db'];var utils=require(_0x915f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x915f('0x7'));var jayson=require(_0x915f('0x8'));var client=jayson['client'][_0x915f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4695a0,_0x397f8b,_0x7d264b){return new BPromise(function(_0x22f692,_0x39bd7d){return client[_0x915f('0xa')](_0x4695a0,_0x7d264b)[_0x915f('0xb')](function(_0x36c262){logger[_0x915f('0xc')]('ZohoField,\x20%s,\x20%s',_0x397f8b,_0x915f('0xd'));logger[_0x915f('0xe')](_0x915f('0xf'),_0x397f8b,_0x915f('0xd'),JSON[_0x915f('0x10')](_0x36c262));if(_0x36c262[_0x915f('0x11')]){if(_0x36c262[_0x915f('0x11')]['code']===0x1f4){logger[_0x915f('0x11')]('ZohoField,\x20%s,\x20%s',_0x397f8b,_0x36c262[_0x915f('0x11')]['message']);return _0x39bd7d(_0x36c262[_0x915f('0x11')]['message']);}logger['error'](_0x915f('0x12'),_0x397f8b,_0x36c262['error'][_0x915f('0x13')]);return _0x22f692(_0x36c262[_0x915f('0x11')][_0x915f('0x13')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x397f8b,_0x915f('0xd'));_0x22f692(_0x36c262[_0x915f('0x14')]['message']);}})[_0x915f('0x15')](function(_0x29a46a){logger[_0x915f('0x11')](_0x915f('0x12'),_0x397f8b,_0x29a46a);_0x39bd7d(_0x29a46a);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5d6d6ff..41682c6 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5e74f2,_0x358626){var _0x1bdb16=function(_0x14377a){while(--_0x14377a){_0x5e74f2['push'](_0x5e74f2['shift']());}};_0x1bdb16(++_0x358626);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4cd81b,_0x18daef){var _0xeae723=function(_0x4c5e7a){while(--_0x4c5e7a){_0x4cd81b['push'](_0x4cd81b['shift']());}};_0xeae723(++_0x18daef);}(_0x70e0,0x17b));var _0x070e=function(_0x57437d,_0x559ab5){_0x57437d=_0x57437d-0x0;var _0x18b945=_0x70e0[_0x57437d];return _0x18b945;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index b6d5da7..be2fab5 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 _0x5686=['unique_name_and_version','app.js','BOOLEAN','exports','STRING'];(function(_0x5d263d,_0x3d50e2){var _0x5bd6cd=function(_0x43f719){while(--_0x43f719){_0x5d263d['push'](_0x5d263d['shift']());}};_0x5bd6cd(++_0x3d50e2);}(_0x5686,0xbc));var _0x6568=function(_0x2c37b2,_0x107055){_0x2c37b2=_0x2c37b2-0x0;var _0x559312=_0x5686[_0x2c37b2];return _0x559312;};'use strict';var Sequelize=require('sequelize');module[_0x6568('0x0')]={'name':{'type':Sequelize[_0x6568('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x6568('0x1')],'allowNull':![],'unique':_0x6568('0x2')},'main':{'type':Sequelize[_0x6568('0x1')],'defaultValue':_0x6568('0x3')},'filename':{'type':Sequelize[_0x6568('0x1')]},'path':{'type':Sequelize[_0x6568('0x1')]},'type':{'type':Sequelize[_0x6568('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x6568('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x6568('0x1')]},'state':{'type':Sequelize[_0x6568('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x6568('0x1')]},'title':{'type':Sequelize[_0x6568('0x1')]},'remoteUri':{'type':Sequelize[_0x6568('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x2a92=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x342198,_0x2539eb){var _0x2bf07c=function(_0x3dcf78){while(--_0x3dcf78){_0x342198['push'](_0x342198['shift']());}};_0x2bf07c(++_0x2539eb);}(_0x2a92,0x6f));var _0x22a9=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x2a92[_0x48b810];return _0x23c17d;};'use strict';var Sequelize=require(_0x22a9('0x0'));module[_0x22a9('0x1')]={'name':{'type':Sequelize[_0x22a9('0x2')],'allowNull':![],'unique':_0x22a9('0x3')},'version':{'type':Sequelize[_0x22a9('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x22a9('0x2')],'defaultValue':_0x22a9('0x4')},'filename':{'type':Sequelize[_0x22a9('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x22a9('0x2')]},'size':{'type':Sequelize[_0x22a9('0x5')]},'active':{'type':Sequelize[_0x22a9('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x22a9('0x2')]},'state':{'type':Sequelize[_0x22a9('0x2')],'unique':_0x22a9('0x7')},'description':{'type':Sequelize[_0x22a9('0x2')]},'title':{'type':Sequelize[_0x22a9('0x2')]},'remoteUri':{'type':Sequelize[_0x22a9('0x2')]},'link':{'type':Sequelize[_0x22a9('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 39bf4b8..2f24b6c 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 _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x262baa,_0x283058){var _0x4f2257=function(_0x2cd1c6){while(--_0x2cd1c6){_0x262baa['push'](_0x262baa['shift']());}};_0x4f2257(++_0x283058);}(_0x187d,0x93));var _0xd187=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x187d[_0x4bfac3];return _0x15f0f2;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file +var _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x45aa1,_0x35bf74){var _0x36cc77=function(_0x52da2d){while(--_0x52da2d){_0x45aa1['push'](_0x45aa1['shift']());}};_0x36cc77(++_0x35bf74);}(_0x4888,0x198));var _0x8488=function(_0x287e09,_0x185de8){_0x287e09=_0x287e09-0x0;var _0x31ddc0=_0x4888[_0x287e09];return _0x31ddc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 40ef47e..01d8d84 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 _0xaed8=['moment','bluebird','request-promise','path','rimraf','exports','Integration','util','../../config/logger','api'];(function(_0x13b870,_0x58d7e7){var _0x512e01=function(_0x1c3003){while(--_0x1c3003){_0x13b870['push'](_0x13b870['shift']());}};_0x512e01(++_0x58d7e7);}(_0xaed8,0x10b));var _0x8aed=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xaed8[_0x102ff9];return _0x24fa97;};'use strict';var _=require('lodash');var util=require(_0x8aed('0x0'));var logger=require(_0x8aed('0x1'))(_0x8aed('0x2'));var moment=require(_0x8aed('0x3'));var BPromise=require(_0x8aed('0x4'));var rp=require(_0x8aed('0x5'));var fs=require('fs');var path=require(_0x8aed('0x6'));var rimraf=require(_0x8aed('0x7'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x8aed('0x8')]=function(_0x547bce,_0x5d24b5){return _0x547bce['define'](_0x8aed('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86dd=['bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','util','../../config/logger','api'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x86dd,0x11f));var _0xd86d=function(_0x32acb4,_0x164242){_0x32acb4=_0x32acb4-0x0;var _0x54531b=_0x86dd[_0x32acb4];return _0x54531b;};'use strict';var _=require('lodash');var util=require(_0xd86d('0x0'));var logger=require(_0xd86d('0x1'))(_0xd86d('0x2'));var moment=require('moment');var BPromise=require(_0xd86d('0x3'));var rp=require(_0xd86d('0x4'));var fs=require('fs');var path=require(_0xd86d('0x5'));var rimraf=require(_0xd86d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd86d('0x7'));module[_0xd86d('0x8')]=function(_0x1774f6,_0x3168da){return _0x1774f6[_0xd86d('0x9')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index b89a959..44bf65f 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(_0x2f9625,_0x4efdd8){var _0x56e181=function(_0x1e2151){while(--_0x1e2151){_0x2f9625['push'](_0x2f9625['shift']());}};_0x56e181(++_0x4efdd8);}(_0xd943,0x15d));var _0x3d94=function(_0x1265ee,_0x2dd4e2){_0x1265ee=_0x1265ee-0x0;var _0x2955d9=_0xd943[_0x1265ee];return _0x2955d9;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5a7f3c,_0x4121e5){var _0x3b18d4=function(_0xc8317b){while(--_0xc8317b){_0x5a7f3c['push'](_0x5a7f3c['shift']());}};_0x3b18d4(++_0x4121e5);}(_0xdb28,0x106));var _0x8db2=function(_0x12c994,_0x5e1287){_0x12c994=_0x12c994-0x0;var _0x498769=_0xdb28[_0x12c994];return _0x498769;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 1d30788..ed9dd77 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x371eb4,_0x156af2){var _0xfcbab1=function(_0x1a5f03){while(--_0x1a5f03){_0x371eb4['push'](_0x371eb4['shift']());}};_0xfcbab1(++_0x156af2);}(_0x4975,0x86));var _0x5497=function(_0x2c3246,_0x3408bb){_0x2c3246=_0x2c3246-0x0;var _0x5d8f61=_0x4975[_0x2c3246];return _0x5d8f61;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0xd943,0x15d));var _0x3d94=function(_0x27f4d7,_0x527300){_0x27f4d7=_0x27f4d7-0x0;var _0x17c50b=_0xd943[_0x27f4d7];return _0x17c50b;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index ff5933f..46078b5 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 _0xace2=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xace2,0x1a5));var _0x2ace=function(_0x30bd66,_0x36a93d){_0x30bd66=_0x30bd66-0x0;var _0x74c9dd=_0xace2[_0x30bd66];return _0x74c9dd;};'use strict';var Sequelize=require(_0x2ace('0x0'));module[_0x2ace('0x1')]={'integration':{'type':Sequelize[_0x2ace('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x2ace('0x2')]},'ticketId':{'type':Sequelize[_0x2ace('0x2')]},'integrationId':{'type':Sequelize[_0x2ace('0x3')]},'contacts':{'type':Sequelize[_0x2ace('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2ace('0x2')]},'interface':{'type':Sequelize[_0x2ace('0x2')]},'membername':{'type':Sequelize[_0x2ace('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2ace('0x4')]},'agentconnectAt':{'type':Sequelize[_0x2ace('0x4')]},'holdtime':{'type':Sequelize[_0x2ace('0x3')]},'agentcomplete':{'type':Sequelize[_0x2ace('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2ace('0x4')]},'talktime':{'type':Sequelize[_0x2ace('0x3')]},'agentacw':{'type':Sequelize[_0x2ace('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x2ace('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2ace('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2ace('0x4')]},'lastevent':{'type':Sequelize[_0x2ace('0x2')]},'channel':{'type':Sequelize[_0x2ace('0x2')]},'channelstate':{'type':Sequelize[_0x2ace('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2ace('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2ace('0x2')]},'connectedlinename':{'type':Sequelize[_0x2ace('0x2')]},'language':{'type':Sequelize[_0x2ace('0x2')]},'accountcode':{'type':Sequelize[_0x2ace('0x2')]},'context':{'type':Sequelize[_0x2ace('0x2')]},'exten':{'type':Sequelize[_0x2ace('0x2')]},'priority':{'type':Sequelize[_0x2ace('0x2')]},'destchannel':{'type':Sequelize[_0x2ace('0x2')]},'destchannelstate':{'type':Sequelize[_0x2ace('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2ace('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2ace('0x2')]},'destcalleridname':{'type':Sequelize[_0x2ace('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x2ace('0x2')]},'destlanguage':{'type':Sequelize[_0x2ace('0x2')]},'destaccountcode':{'type':Sequelize[_0x2ace('0x2')]},'destcontext':{'type':Sequelize[_0x2ace('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2ace('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x2ace('0x2')]},'inReplyTo':{'type':Sequelize[_0x2ace('0x2')]},'subject':{'type':Sequelize[_0x2ace('0x2')]},'from':{'type':Sequelize[_0x2ace('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x2ace('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x2ace('0x6')]},'status':{'type':Sequelize[_0x2ace('0x7')]('SENT',_0x2ace('0x8'),'RECEIVED',_0x2ace('0x9'))},'url':{'type':Sequelize[_0x2ace('0x2')]},'app':{'type':Sequelize[_0x2ace('0x2')]},'appdata':{'type':Sequelize[_0x2ace('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa6a9=['BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x2d4042,_0x40bec6){var _0x53fae0=function(_0x3d709e){while(--_0x3d709e){_0x2d4042['push'](_0x2d4042['shift']());}};_0x53fae0(++_0x40bec6);}(_0xa6a9,0xe2));var _0x9a6a=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0xa6a9[_0x2f023d];return _0x4ef240;};'use strict';var Sequelize=require(_0x9a6a('0x0'));module[_0x9a6a('0x1')]={'integration':{'type':Sequelize[_0x9a6a('0x2')]},'eventChannel':{'type':Sequelize[_0x9a6a('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x9a6a('0x2')]},'integrationId':{'type':Sequelize[_0x9a6a('0x3')]},'contacts':{'type':Sequelize[_0x9a6a('0x2')]},'uniqueid':{'type':Sequelize[_0x9a6a('0x2')]},'calleridnum':{'type':Sequelize[_0x9a6a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9a6a('0x2')]},'interface':{'type':Sequelize[_0x9a6a('0x2')]},'membername':{'type':Sequelize[_0x9a6a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9a6a('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9a6a('0x3')]},'agentcomplete':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9a6a('0x4')]},'talktime':{'type':Sequelize[_0x9a6a('0x3')]},'agentacw':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9a6a('0x3')]},'reason':{'type':Sequelize[_0x9a6a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9a6a('0x4')]},'agentdump':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9a6a('0x4')]},'lastevent':{'type':Sequelize[_0x9a6a('0x2')]},'channel':{'type':Sequelize[_0x9a6a('0x2')]},'channelstate':{'type':Sequelize[_0x9a6a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9a6a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9a6a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9a6a('0x2')]},'exten':{'type':Sequelize[_0x9a6a('0x2')]},'priority':{'type':Sequelize[_0x9a6a('0x2')]},'destchannel':{'type':Sequelize[_0x9a6a('0x2')]},'destchannelstate':{'type':Sequelize[_0x9a6a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9a6a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9a6a('0x2')]},'destcalleridname':{'type':Sequelize[_0x9a6a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9a6a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9a6a('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9a6a('0x2')]},'destcontext':{'type':Sequelize[_0x9a6a('0x2')]},'destexten':{'type':Sequelize[_0x9a6a('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x9a6a('0x2')]},'messageId':{'type':Sequelize[_0x9a6a('0x2')]},'inReplyTo':{'type':Sequelize[_0x9a6a('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9a6a('0x2')]},'cc':{'type':Sequelize[_0x9a6a('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x9a6a('0x6')]},'text':{'type':Sequelize[_0x9a6a('0x6')]},'status':{'type':Sequelize['ENUM'](_0x9a6a('0x7'),_0x9a6a('0x8'),_0x9a6a('0x9'),_0x9a6a('0xa'))},'url':{'type':Sequelize[_0x9a6a('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 026c294..c98e414 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 _0xa120=['error','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then'];(function(_0x2e85dc,_0xc31714){var _0x3315d3=function(_0x2f8d8a){while(--_0x2f8d8a){_0x2e85dc['push'](_0x2e85dc['shift']());}};_0x3315d3(++_0xc31714);}(_0xa120,0xb4));var _0x0a12=function(_0xb04640,_0x16b26f){_0xb04640=_0xb04640-0x0;var _0x3084b2=_0xa120[_0xb04640];return _0x3084b2;};'use strict';var emlformat=require(_0x0a12('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a12('0x1'));var jsonpatch=require(_0x0a12('0x2'));var rp=require(_0x0a12('0x3'));var moment=require('moment');var BPromise=require(_0x0a12('0x4'));var Mustache=require(_0x0a12('0x5'));var util=require(_0x0a12('0x6'));var path=require(_0x0a12('0x7'));var sox=require(_0x0a12('0x8'));var csv=require(_0x0a12('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a12('0xa'));var _=require(_0x0a12('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a12('0xc'));var deskjs=require(_0x0a12('0xd'));var toCsv=require(_0x0a12('0x9'));var querystring=require(_0x0a12('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a12('0xf'));var authService=require(_0x0a12('0x10'));var qs=require(_0x0a12('0x11'));var as=require(_0x0a12('0x12'));var hardwareService=require(_0x0a12('0x13'));var logger=require('../../config/logger')(_0x0a12('0x14'));var utils=require(_0x0a12('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0a12('0x16'))['db'];function respondWithStatusCode(_0x296278,_0x2c77d6){_0x2c77d6=_0x2c77d6||0xcc;return function(_0x2820c4){if(_0x2820c4){return _0x296278[_0x0a12('0x17')](_0x2c77d6);}return _0x296278['status'](_0x2c77d6)[_0x0a12('0x18')]();};}function respondWithResult(_0x303182,_0x1c2aa8){_0x1c2aa8=_0x1c2aa8||0xc8;return function(_0x54eb89){if(_0x54eb89){return _0x303182['status'](_0x1c2aa8)['json'](_0x54eb89);}};}function respondWithFilteredResult(_0x761831,_0x1b65ba){return function(_0x580145){if(_0x580145){var _0x5a4217=typeof _0x1b65ba['offset']===_0x0a12('0x19')&&typeof _0x1b65ba[_0x0a12('0x1a')]==='undefined';var _0x362b47=_0x580145[_0x0a12('0x1b')];var _0x147ad5=_0x5a4217?0x0:_0x1b65ba[_0x0a12('0x1c')];var _0x38d361=_0x5a4217?_0x580145['count']:_0x1b65ba['offset']+_0x1b65ba[_0x0a12('0x1a')];var _0x2de906;if(_0x38d361>=_0x362b47){_0x38d361=_0x362b47;_0x2de906=0xc8;}else{_0x2de906=0xce;}_0x761831['status'](_0x2de906);return _0x761831[_0x0a12('0x1d')](_0x0a12('0x1e'),_0x147ad5+'-'+_0x38d361+'/'+_0x362b47)[_0x0a12('0x1f')](_0x580145);}return null;};}function patchUpdates(_0x1abf92){return function(_0x172ffa){try{jsonpatch['apply'](_0x172ffa,_0x1abf92,!![]);}catch(_0x2b021b){return BPromise[_0x0a12('0x20')](_0x2b021b);}return _0x172ffa[_0x0a12('0x21')]();};}function saveUpdates(_0x44856c,_0x5316f9){return function(_0x2a6e9a){if(_0x2a6e9a){return _0x2a6e9a[_0x0a12('0x22')](_0x44856c)[_0x0a12('0x23')](function(_0x229de6){return _0x229de6;});}return null;};}function removeEntity(_0x3f92fd,_0x3ac861){return function(_0x45eda2){if(_0x45eda2){return _0x45eda2['destroy']()[_0x0a12('0x23')](function(){_0x3f92fd['status'](0xcc)[_0x0a12('0x18')]();});}};}function handleEntityNotFound(_0x22684d,_0x4966a8){return function(_0x185e8d){if(!_0x185e8d){_0x22684d['sendStatus'](0x194);}return _0x185e8d;};}function handleError(_0x3ee664,_0x291db8){_0x291db8=_0x291db8||0x1f4;return function(_0x5bcd3e){logger[_0x0a12('0x24')](_0x5bcd3e['stack']);if(_0x5bcd3e['name']){delete _0x5bcd3e[_0x0a12('0x25')];}_0x3ee664['status'](_0x291db8)['send'](_0x5bcd3e);};}exports[_0x0a12('0x26')]=function(_0x183ce1,_0x2422d7){var _0x536ea0={},_0x35ff3f={},_0x5ef0d0={'count':0x0,'rows':[]};var _0x220dfa=_[_0x0a12('0x27')](db['IntegrationReport'][_0x0a12('0x28')],function(_0x52fa63){return{'name':_0x52fa63[_0x0a12('0x29')],'type':_0x52fa63[_0x0a12('0x2a')][_0x0a12('0x2b')]};});_0x35ff3f['model']=_['map'](_0x220dfa,_0x0a12('0x25'));_0x35ff3f[_0x0a12('0x2c')]=_['keys'](_0x183ce1[_0x0a12('0x2c')]);_0x35ff3f[_0x0a12('0x2d')]=_[_0x0a12('0x2e')](_0x35ff3f['model'],_0x35ff3f[_0x0a12('0x2c')]);_0x536ea0['attributes']=_[_0x0a12('0x2e')](_0x35ff3f['model'],qs[_0x0a12('0x2f')](_0x183ce1[_0x0a12('0x2c')][_0x0a12('0x2f')]));_0x536ea0[_0x0a12('0x30')]=_0x536ea0[_0x0a12('0x30')][_0x0a12('0x31')]?_0x536ea0['attributes']:_0x35ff3f[_0x0a12('0x32')];if(!_0x183ce1[_0x0a12('0x2c')][_0x0a12('0x33')](_0x0a12('0x34'))){_0x536ea0[_0x0a12('0x1a')]=qs[_0x0a12('0x1a')](_0x183ce1['query']['limit']);_0x536ea0[_0x0a12('0x1c')]=qs[_0x0a12('0x1c')](_0x183ce1[_0x0a12('0x2c')][_0x0a12('0x1c')]);}_0x536ea0['order']=qs['sort'](_0x183ce1['query']['sort']);_0x536ea0[_0x0a12('0x35')]=qs[_0x0a12('0x2d')](_[_0x0a12('0x36')](_0x183ce1[_0x0a12('0x2c')],_0x35ff3f[_0x0a12('0x2d')]),_0x220dfa);if(_0x183ce1[_0x0a12('0x2c')][_0x0a12('0x37')]){_0x536ea0[_0x0a12('0x35')]=_[_0x0a12('0x38')](_0x536ea0[_0x0a12('0x35')],{'$or':_[_0x0a12('0x27')](_0x220dfa,function(_0x4f3d4a){if(_0x4f3d4a[_0x0a12('0x2a')]!==_0x0a12('0x39')){var _0x54fc6b={};_0x54fc6b[_0x4f3d4a['name']]={'$like':'%'+_0x183ce1['query']['filter']+'%'};return _0x54fc6b;}})});}_0x536ea0=_['merge']({},_0x536ea0,_0x183ce1[_0x0a12('0x3a')]);var _0x339faa={'where':_0x536ea0[_0x0a12('0x35')]};return db[_0x0a12('0x3b')][_0x0a12('0x1b')](_0x339faa)[_0x0a12('0x23')](function(_0x330dee){_0x5ef0d0[_0x0a12('0x1b')]=_0x330dee;if(_0x183ce1['query'][_0x0a12('0x3c')]){_0x536ea0['include']=[{'all':!![]}];}return db[_0x0a12('0x3b')][_0x0a12('0x3d')](_0x536ea0);})[_0x0a12('0x23')](function(_0x40603f){_0x5ef0d0[_0x0a12('0x3e')]=_0x40603f;return _0x5ef0d0;})[_0x0a12('0x23')](respondWithFilteredResult(_0x2422d7,_0x536ea0))[_0x0a12('0x3f')](handleError(_0x2422d7,null));};exports[_0x0a12('0x40')]=function(_0x1390d6,_0x497512){var _0x1af0a7={'raw':![],'where':{'id':_0x1390d6[_0x0a12('0x41')]['id']}},_0x58115b={};_0x58115b[_0x0a12('0x32')]=_[_0x0a12('0x42')](db[_0x0a12('0x3b')][_0x0a12('0x28')]);_0x58115b[_0x0a12('0x2c')]=_[_0x0a12('0x42')](_0x1390d6[_0x0a12('0x2c')]);_0x58115b['filters']=_['intersection'](_0x58115b[_0x0a12('0x32')],_0x58115b[_0x0a12('0x2c')]);_0x1af0a7[_0x0a12('0x30')]=_[_0x0a12('0x2e')](_0x58115b[_0x0a12('0x32')],qs['fields'](_0x1390d6[_0x0a12('0x2c')]['fields']));_0x1af0a7[_0x0a12('0x30')]=_0x1af0a7['attributes'][_0x0a12('0x31')]?_0x1af0a7[_0x0a12('0x30')]:_0x58115b[_0x0a12('0x32')];if(_0x1390d6[_0x0a12('0x2c')]['includeAll']){_0x1af0a7[_0x0a12('0x43')]=[{'all':!![]}];}_0x1af0a7=_[_0x0a12('0x38')]({},_0x1af0a7,_0x1390d6['options']);return db[_0x0a12('0x3b')][_0x0a12('0x44')](_0x1af0a7)[_0x0a12('0x23')](handleEntityNotFound(_0x497512,null))[_0x0a12('0x23')](respondWithResult(_0x497512,null))[_0x0a12('0x3f')](handleError(_0x497512,null));};exports[_0x0a12('0x45')]=function(_0x4ab252,_0x3ca5e5){return db['IntegrationReport'][_0x0a12('0x45')](_0x4ab252[_0x0a12('0x46')],{})[_0x0a12('0x23')](respondWithResult(_0x3ca5e5,0xc9))[_0x0a12('0x3f')](handleError(_0x3ca5e5,null));};exports['update']=function(_0x47af13,_0x3b3dbe){if(_0x47af13[_0x0a12('0x46')]['id']){delete _0x47af13[_0x0a12('0x46')]['id'];}return db[_0x0a12('0x3b')][_0x0a12('0x44')]({'where':{'id':_0x47af13[_0x0a12('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b3dbe,null))[_0x0a12('0x23')](saveUpdates(_0x47af13['body'],null))[_0x0a12('0x23')](respondWithResult(_0x3b3dbe,null))['catch'](handleError(_0x3b3dbe,null));};exports[_0x0a12('0x47')]=function(_0x44121d,_0x4e37ae){return db[_0x0a12('0x3b')][_0x0a12('0x44')]({'where':{'id':_0x44121d[_0x0a12('0x41')]['id']}})[_0x0a12('0x23')](handleEntityNotFound(_0x4e37ae,null))['then'](removeEntity(_0x4e37ae,null))[_0x0a12('0x3f')](handleError(_0x4e37ae,null));};exports['describe']=function(_0x4073c0,_0x518802){return db[_0x0a12('0x3b')]['describe']()[_0x0a12('0x23')](respondWithResult(_0x518802,null))[_0x0a12('0x3f')](handleError(_0x518802,null));}; \ No newline at end of file +var _0x61fb=['end','json','offset','undefined','count','limit','set','apply','reject','save','then','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','includeAll','show','params','include','options','catch','create','find','body','destroy','describe','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x53e999,_0xc7195b){var _0x3fa453=function(_0x5a6b86){while(--_0x5a6b86){_0x53e999['push'](_0x53e999['shift']());}};_0x3fa453(++_0xc7195b);}(_0x61fb,0x1b2));var _0xb61f=function(_0x2b95ae,_0xa0a178){_0x2b95ae=_0x2b95ae-0x0;var _0x36ffbd=_0x61fb[_0x2b95ae];return _0x36ffbd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb61f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb61f('0x1'));var rp=require(_0xb61f('0x2'));var moment=require(_0xb61f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb61f('0x4'));var util=require(_0xb61f('0x5'));var path=require(_0xb61f('0x6'));var sox=require(_0xb61f('0x7'));var csv=require(_0xb61f('0x8'));var ejs=require(_0xb61f('0x9'));var fs=require('fs');var fs_extra=require(_0xb61f('0xa'));var _=require(_0xb61f('0xb'));var squel=require(_0xb61f('0xc'));var crypto=require(_0xb61f('0xd'));var jsforce=require(_0xb61f('0xe'));var deskjs=require(_0xb61f('0xf'));var toCsv=require(_0xb61f('0x8'));var querystring=require('querystring');var Papa=require(_0xb61f('0x10'));var Redis=require(_0xb61f('0x11'));var authService=require(_0xb61f('0x12'));var qs=require(_0xb61f('0x13'));var as=require(_0xb61f('0x14'));var hardwareService=require(_0xb61f('0x15'));var logger=require(_0xb61f('0x16'))(_0xb61f('0x17'));var utils=require('../../config/utils');var config=require(_0xb61f('0x18'));var licenseUtil=require(_0xb61f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e597c,_0x3fc7a4){_0x3fc7a4=_0x3fc7a4||0xcc;return function(_0x3241de){if(_0x3241de){return _0x3e597c[_0xb61f('0x1a')](_0x3fc7a4);}return _0x3e597c[_0xb61f('0x1b')](_0x3fc7a4)[_0xb61f('0x1c')]();};}function respondWithResult(_0x12ef5e,_0x470c5e){_0x470c5e=_0x470c5e||0xc8;return function(_0xab0c3b){if(_0xab0c3b){return _0x12ef5e['status'](_0x470c5e)[_0xb61f('0x1d')](_0xab0c3b);}};}function respondWithFilteredResult(_0x5e93da,_0x4f340c){return function(_0x1cffcd){if(_0x1cffcd){var _0x364b55=typeof _0x4f340c[_0xb61f('0x1e')]===_0xb61f('0x1f')&&typeof _0x4f340c['limit']==='undefined';var _0x394360=_0x1cffcd[_0xb61f('0x20')];var _0x466385=_0x364b55?0x0:_0x4f340c['offset'];var _0x272024=_0x364b55?_0x1cffcd[_0xb61f('0x20')]:_0x4f340c[_0xb61f('0x1e')]+_0x4f340c[_0xb61f('0x21')];var _0x2ba024;if(_0x272024>=_0x394360){_0x272024=_0x394360;_0x2ba024=0xc8;}else{_0x2ba024=0xce;}_0x5e93da[_0xb61f('0x1b')](_0x2ba024);return _0x5e93da[_0xb61f('0x22')]('Content-Range',_0x466385+'-'+_0x272024+'/'+_0x394360)[_0xb61f('0x1d')](_0x1cffcd);}return null;};}function patchUpdates(_0x2798c6){return function(_0x3609cf){try{jsonpatch[_0xb61f('0x23')](_0x3609cf,_0x2798c6,!![]);}catch(_0x37f7bf){return BPromise[_0xb61f('0x24')](_0x37f7bf);}return _0x3609cf[_0xb61f('0x25')]();};}function saveUpdates(_0x303147,_0x465646){return function(_0x2c81eb){if(_0x2c81eb){return _0x2c81eb['update'](_0x303147)[_0xb61f('0x26')](function(_0x4b0546){return _0x4b0546;});}return null;};}function removeEntity(_0x4bd283,_0x39bbea){return function(_0x5a1679){if(_0x5a1679){return _0x5a1679['destroy']()[_0xb61f('0x26')](function(){_0x4bd283[_0xb61f('0x1b')](0xcc)[_0xb61f('0x1c')]();});}};}function handleEntityNotFound(_0x3a1be8,_0xc58937){return function(_0x482789){if(!_0x482789){_0x3a1be8[_0xb61f('0x1a')](0x194);}return _0x482789;};}function handleError(_0x28cee6,_0x2b2449){_0x2b2449=_0x2b2449||0x1f4;return function(_0x4e8da8){logger[_0xb61f('0x27')](_0x4e8da8[_0xb61f('0x28')]);if(_0x4e8da8[_0xb61f('0x29')]){delete _0x4e8da8[_0xb61f('0x29')];}_0x28cee6[_0xb61f('0x1b')](_0x2b2449)[_0xb61f('0x2a')](_0x4e8da8);};}exports[_0xb61f('0x2b')]=function(_0x9aa4e1,_0x306345){var _0x22f8c8={},_0x1ad1b9={},_0x553c17={'count':0x0,'rows':[]};var _0x42f697=_['map'](db[_0xb61f('0x2c')][_0xb61f('0x2d')],function(_0x2098e0){return{'name':_0x2098e0[_0xb61f('0x2e')],'type':_0x2098e0[_0xb61f('0x2f')][_0xb61f('0x30')]};});_0x1ad1b9[_0xb61f('0x31')]=_['map'](_0x42f697,_0xb61f('0x29'));_0x1ad1b9['query']=_[_0xb61f('0x32')](_0x9aa4e1[_0xb61f('0x33')]);_0x1ad1b9[_0xb61f('0x34')]=_[_0xb61f('0x35')](_0x1ad1b9[_0xb61f('0x31')],_0x1ad1b9[_0xb61f('0x33')]);_0x22f8c8[_0xb61f('0x36')]=_[_0xb61f('0x35')](_0x1ad1b9[_0xb61f('0x31')],qs[_0xb61f('0x37')](_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x37')]));_0x22f8c8['attributes']=_0x22f8c8[_0xb61f('0x36')][_0xb61f('0x38')]?_0x22f8c8[_0xb61f('0x36')]:_0x1ad1b9['model'];if(!_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x39')](_0xb61f('0x3a'))){_0x22f8c8[_0xb61f('0x21')]=qs[_0xb61f('0x21')](_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x21')]);_0x22f8c8[_0xb61f('0x1e')]=qs[_0xb61f('0x1e')](_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x1e')]);}_0x22f8c8[_0xb61f('0x3b')]=qs[_0xb61f('0x3c')](_0x9aa4e1[_0xb61f('0x33')]['sort']);_0x22f8c8[_0xb61f('0x3d')]=qs[_0xb61f('0x34')](_['pick'](_0x9aa4e1['query'],_0x1ad1b9['filters']),_0x42f697);if(_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x3e')]){_0x22f8c8[_0xb61f('0x3d')]=_['merge'](_0x22f8c8[_0xb61f('0x3d')],{'$or':_[_0xb61f('0x3f')](_0x42f697,function(_0x3cc096){if(_0x3cc096[_0xb61f('0x2f')]!==_0xb61f('0x40')){var _0x108da2={};_0x108da2[_0x3cc096['name']]={'$like':'%'+_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x3e')]+'%'};return _0x108da2;}})});}_0x22f8c8=_[_0xb61f('0x41')]({},_0x22f8c8,_0x9aa4e1['options']);var _0x3fb4c4={'where':_0x22f8c8[_0xb61f('0x3d')]};return db['IntegrationReport'][_0xb61f('0x20')](_0x3fb4c4)[_0xb61f('0x26')](function(_0xf76553){_0x553c17[_0xb61f('0x20')]=_0xf76553;if(_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x42')]){_0x22f8c8['include']=[{'all':!![]}];}return db[_0xb61f('0x2c')]['findAll'](_0x22f8c8);})[_0xb61f('0x26')](function(_0x3a194f){_0x553c17['rows']=_0x3a194f;return _0x553c17;})[_0xb61f('0x26')](respondWithFilteredResult(_0x306345,_0x22f8c8))['catch'](handleError(_0x306345,null));};exports[_0xb61f('0x43')]=function(_0x47a96b,_0x37e814){var _0x5c1796={'raw':![],'where':{'id':_0x47a96b[_0xb61f('0x44')]['id']}},_0x437dbe={};_0x437dbe[_0xb61f('0x31')]=_[_0xb61f('0x32')](db[_0xb61f('0x2c')]['rawAttributes']);_0x437dbe[_0xb61f('0x33')]=_[_0xb61f('0x32')](_0x47a96b['query']);_0x437dbe[_0xb61f('0x34')]=_[_0xb61f('0x35')](_0x437dbe[_0xb61f('0x31')],_0x437dbe['query']);_0x5c1796[_0xb61f('0x36')]=_[_0xb61f('0x35')](_0x437dbe[_0xb61f('0x31')],qs[_0xb61f('0x37')](_0x47a96b['query'][_0xb61f('0x37')]));_0x5c1796[_0xb61f('0x36')]=_0x5c1796['attributes']['length']?_0x5c1796[_0xb61f('0x36')]:_0x437dbe['model'];if(_0x47a96b['query'][_0xb61f('0x42')]){_0x5c1796[_0xb61f('0x45')]=[{'all':!![]}];}_0x5c1796=_[_0xb61f('0x41')]({},_0x5c1796,_0x47a96b[_0xb61f('0x46')]);return db['IntegrationReport']['find'](_0x5c1796)[_0xb61f('0x26')](handleEntityNotFound(_0x37e814,null))[_0xb61f('0x26')](respondWithResult(_0x37e814,null))[_0xb61f('0x47')](handleError(_0x37e814,null));};exports[_0xb61f('0x48')]=function(_0x158e8c,_0x49acee){return db['IntegrationReport'][_0xb61f('0x48')](_0x158e8c['body'],{})[_0xb61f('0x26')](respondWithResult(_0x49acee,0xc9))[_0xb61f('0x47')](handleError(_0x49acee,null));};exports['update']=function(_0x51b93b,_0x18e649){if(_0x51b93b['body']['id']){delete _0x51b93b['body']['id'];}return db['IntegrationReport'][_0xb61f('0x49')]({'where':{'id':_0x51b93b[_0xb61f('0x44')]['id']}})[_0xb61f('0x26')](handleEntityNotFound(_0x18e649,null))[_0xb61f('0x26')](saveUpdates(_0x51b93b[_0xb61f('0x4a')],null))[_0xb61f('0x26')](respondWithResult(_0x18e649,null))[_0xb61f('0x47')](handleError(_0x18e649,null));};exports[_0xb61f('0x4b')]=function(_0x168886,_0xb1e475){return db[_0xb61f('0x2c')][_0xb61f('0x49')]({'where':{'id':_0x168886[_0xb61f('0x44')]['id']}})[_0xb61f('0x26')](handleEntityNotFound(_0xb1e475,null))['then'](removeEntity(_0xb1e475,null))[_0xb61f('0x47')](handleError(_0xb1e475,null));};exports[_0xb61f('0x4c')]=function(_0x3369fb,_0x231403){return db[_0xb61f('0x2c')][_0xb61f('0x4c')]()[_0xb61f('0x26')](respondWithResult(_0x231403,null))[_0xb61f('0x47')](handleError(_0x231403,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e0c701e..ed4f80c 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 _0xd0b4=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x57811f,_0x3ae838){var _0x326f53=function(_0x2eddd2){while(--_0x2eddd2){_0x57811f['push'](_0x57811f['shift']());}};_0x326f53(++_0x3ae838);}(_0xd0b4,0x88));var _0x4d0b=function(_0x3d1d31,_0xa9cda5){_0x3d1d31=_0x3d1d31-0x0;var _0x40ed14=_0xd0b4[_0x3d1d31];return _0x40ed14;};'use strict';var _=require(_0x4d0b('0x0'));var util=require(_0x4d0b('0x1'));var logger=require(_0x4d0b('0x2'))(_0x4d0b('0x3'));var moment=require('moment');var BPromise=require(_0x4d0b('0x4'));var rp=require(_0x4d0b('0x5'));var fs=require('fs');var path=require(_0x4d0b('0x6'));var rimraf=require(_0x4d0b('0x7'));var config=require(_0x4d0b('0x8'));var attributes=require('./integrationReport.attributes');module[_0x4d0b('0x9')]=function(_0x1fe4ea,_0x5be2d2){return _0x1fe4ea[_0x4d0b('0xa')](_0x4d0b('0xb'),attributes,{'tableName':_0x4d0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde70=['lodash','util','api','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','IntegrationReport','report_integration'];(function(_0x41b65f,_0x416f40){var _0x5a3aca=function(_0xb5ff2d){while(--_0xb5ff2d){_0x41b65f['push'](_0x41b65f['shift']());}};_0x5a3aca(++_0x416f40);}(_0xde70,0x1b8));var _0x0de7=function(_0x43f47b,_0x311636){_0x43f47b=_0x43f47b-0x0;var _0x4af9a6=_0xde70[_0x43f47b];return _0x4af9a6;};'use strict';var _=require(_0x0de7('0x0'));var util=require(_0x0de7('0x1'));var logger=require('../../config/logger')(_0x0de7('0x2'));var moment=require('moment');var BPromise=require(_0x0de7('0x3'));var rp=require(_0x0de7('0x4'));var fs=require('fs');var path=require(_0x0de7('0x5'));var rimraf=require(_0x0de7('0x6'));var config=require('../../config/environment');var attributes=require(_0x0de7('0x7'));module[_0x0de7('0x8')]=function(_0x119861,_0x3264f8){return _0x119861['define'](_0x0de7('0x9'),attributes,{'tableName':_0x0de7('0xa'),'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 4652fea..44ca169 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 _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x12b0d0,_0x4681b1){var _0x24e13e=function(_0x47fc87){while(--_0x47fc87){_0x12b0d0['push'](_0x12b0d0['shift']());}};_0x24e13e(++_0x4681b1);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','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','info','result'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x399cb4,_0x30bd73){_0x399cb4=_0x399cb4-0x0;var _0x41c0e3=_0x3f8a[_0x399cb4];return _0x41c0e3;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b8747bb..936a731 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 _0x5e17=['../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','update','destroy','exports','multer','fs-extra'];(function(_0x1c229e,_0x5e541f){var _0x570a7e=function(_0x374123){while(--_0x374123){_0x1c229e['push'](_0x1c229e['shift']());}};_0x570a7e(++_0x5e541f);}(_0x5e17,0x17a));var _0x75e1=function(_0x3f64ad,_0x57fcd2){_0x3f64ad=_0x3f64ad-0x0;var _0x989206=_0x5e17[_0x3f64ad];return _0x989206;};'use strict';var multer=require(_0x75e1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x75e1('0x1'));var auth=require(_0x75e1('0x2'));var interaction=require(_0x75e1('0x3'));var config=require(_0x75e1('0x4'));var controller=require(_0x75e1('0x5'));router[_0x75e1('0x6')]('/',auth[_0x75e1('0x7')](),controller[_0x75e1('0x8')]);router[_0x75e1('0x6')](_0x75e1('0x9'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xa')]);router[_0x75e1('0x6')](_0x75e1('0xb'),auth[_0x75e1('0x7')](),controller['getIntervals']);router[_0x75e1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x75e1('0xc')](_0x75e1('0xb'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xd')]);router[_0x75e1('0xc')](_0x75e1('0xe'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xf')]);router['put'](_0x75e1('0x9'),auth[_0x75e1('0x7')](),controller[_0x75e1('0x10')]);router['delete'](_0x75e1('0x9'),auth[_0x75e1('0x7')](),controller[_0x75e1('0x11')]);module[_0x75e1('0x12')]=router; \ No newline at end of file +var _0x7923=['/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','isAuthenticated','addIntervals','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/:id'];(function(_0x1d6cc5,_0x10597e){var _0x43186a=function(_0x3dcf2f){while(--_0x3dcf2f){_0x1d6cc5['push'](_0x1d6cc5['shift']());}};_0x43186a(++_0x10597e);}(_0x7923,0x8f));var _0x3792=function(_0x40ae5f,_0x4ce8e1){_0x40ae5f=_0x40ae5f-0x0;var _0x5d82c5=_0x7923[_0x40ae5f];return _0x5d82c5;};'use strict';var multer=require(_0x3792('0x0'));var util=require(_0x3792('0x1'));var path=require(_0x3792('0x2'));var timeout=require(_0x3792('0x3'));var express=require(_0x3792('0x4'));var router=express[_0x3792('0x5')]();var fs_extra=require(_0x3792('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3792('0x7'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x3792('0x8')]('/',auth['isAuthenticated'](),controller[_0x3792('0x9')]);router[_0x3792('0x8')](_0x3792('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3792('0x8')](_0x3792('0xb'),auth['isAuthenticated'](),controller[_0x3792('0xc')]);router[_0x3792('0xd')]('/',auth['isAuthenticated'](),controller[_0x3792('0xe')]);router[_0x3792('0xd')](_0x3792('0xb'),auth['isAuthenticated'](),controller['addInterval']);router[_0x3792('0xd')](_0x3792('0xf'),auth[_0x3792('0x10')](),controller[_0x3792('0x11')]);router['put']('/:id',auth[_0x3792('0x10')](),controller[_0x3792('0x12')]);router[_0x3792('0x13')](_0x3792('0xa'),auth[_0x3792('0x10')](),controller[_0x3792('0x14')]);module[_0x3792('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 7e402a9..cb77001 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 _0x178c=['STRING','sequelize'];(function(_0x7ff50b,_0x399dc0){var _0x43e570=function(_0x16b092){while(--_0x16b092){_0x7ff50b['push'](_0x7ff50b['shift']());}};_0x43e570(++_0x399dc0);}(_0x178c,0x143));var _0xc178=function(_0x247549,_0x16cc17){_0x247549=_0x247549-0x0;var _0x4dfb98=_0x178c[_0x247549];return _0x4dfb98;};'use strict';var Sequelize=require(_0xc178('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc178('0x1')]},'interval':{'type':Sequelize[_0xc178('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xfa2e=['sequelize','STRING'];(function(_0x4be64f,_0x35c983){var _0x370f5a=function(_0x306bfa){while(--_0x306bfa){_0x4be64f['push'](_0x4be64f['shift']());}};_0x370f5a(++_0x35c983);}(_0xfa2e,0x12e));var _0xefa2=function(_0x591d31,_0x2b20a1){_0x591d31=_0x591d31-0x0;var _0x12b89f=_0xfa2e[_0x591d31];return _0x12b89f;};'use strict';var Sequelize=require(_0xefa2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefa2('0x1')]},'interval':{'type':Sequelize[_0xefa2('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4774749..09b34cd 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 _0xc916=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','error','addInterval','IntervalId','getIntervals','findOne','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body'];(function(_0x33feca,_0x2bd9ae){var _0x3c558f=function(_0x11bede){while(--_0x11bede){_0x33feca['push'](_0x33feca['shift']());}};_0x3c558f(++_0x2bd9ae);}(_0xc916,0xc2));var _0x6c91=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0xc916[_0x874cf1];return _0x233579;};'use strict';var emlformat=require(_0x6c91('0x0'));var rimraf=require(_0x6c91('0x1'));var zipdir=require(_0x6c91('0x2'));var jsonpatch=require(_0x6c91('0x3'));var rp=require('request-promise');var moment=require(_0x6c91('0x4'));var BPromise=require(_0x6c91('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6c91('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c91('0x7'));var fs=require('fs');var fs_extra=require(_0x6c91('0x8'));var _=require('lodash');var squel=require(_0x6c91('0x9'));var crypto=require(_0x6c91('0xa'));var jsforce=require(_0x6c91('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6c91('0xc'));var querystring=require(_0x6c91('0xd'));var Papa=require(_0x6c91('0xe'));var Redis=require('ioredis');var authService=require(_0x6c91('0xf'));var qs=require(_0x6c91('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c91('0x11'));var logger=require(_0x6c91('0x12'))(_0x6c91('0x13'));var utils=require(_0x6c91('0x14'));var config=require(_0x6c91('0x15'));var licenseUtil=require(_0x6c91('0x16'));var db=require(_0x6c91('0x17'))['db'];var extensions=require(_0x6c91('0x18'));function respondWithStatusCode(_0x524830,_0x3b105e){_0x3b105e=_0x3b105e||0xcc;return function(_0x5ca8bd){if(_0x5ca8bd){return _0x524830[_0x6c91('0x19')](_0x3b105e);}return _0x524830[_0x6c91('0x1a')](_0x3b105e)[_0x6c91('0x1b')]();};}function respondWithResult(_0x3a0b2f,_0x2ae8de){_0x2ae8de=_0x2ae8de||0xc8;return function(_0x536fc6){if(_0x536fc6){return _0x3a0b2f[_0x6c91('0x1a')](_0x2ae8de)[_0x6c91('0x1c')](_0x536fc6);}};}function respondWithFilteredResult(_0x29348a,_0x46de1e){return function(_0x3cd5b5){if(_0x3cd5b5){var _0x1fa274=typeof _0x46de1e[_0x6c91('0x1d')]===_0x6c91('0x1e')&&typeof _0x46de1e[_0x6c91('0x1f')]==='undefined';var _0xf3cff4=_0x3cd5b5[_0x6c91('0x20')];var _0x4e26b1=_0x1fa274?0x0:_0x46de1e[_0x6c91('0x1d')];var _0x3873c1=_0x1fa274?_0x3cd5b5[_0x6c91('0x20')]:_0x46de1e[_0x6c91('0x1d')]+_0x46de1e['limit'];var _0x2e975a;if(_0x3873c1>=_0xf3cff4){_0x3873c1=_0xf3cff4;_0x2e975a=0xc8;}else{_0x2e975a=0xce;}_0x29348a[_0x6c91('0x1a')](_0x2e975a);return _0x29348a[_0x6c91('0x21')](_0x6c91('0x22'),_0x4e26b1+'-'+_0x3873c1+'/'+_0xf3cff4)[_0x6c91('0x1c')](_0x3cd5b5);}return null;};}function patchUpdates(_0x2e5074){return function(_0x271c0f){try{jsonpatch[_0x6c91('0x23')](_0x271c0f,_0x2e5074,!![]);}catch(_0xe45040){return BPromise[_0x6c91('0x24')](_0xe45040);}return _0x271c0f[_0x6c91('0x25')]();};}function saveUpdates(_0x560bc0,_0x2b1493){return function(_0x1c844e){if(_0x1c844e){return _0x1c844e[_0x6c91('0x26')](_0x560bc0)[_0x6c91('0x27')](function(_0x22e314){return _0x22e314;});}return null;};}function removeEntity(_0x412b79,_0x113c33){return function(_0x30f157){if(_0x30f157){return _0x30f157[_0x6c91('0x28')]()['then'](function(){var _0x1ce654=_0x30f157['get']({'plain':!![]});var _0x1f25c4=_0x6c91('0x29');return db[_0x6c91('0x2a')][_0x6c91('0x28')]({'where':{'type':_0x1f25c4,'resourceId':_0x1ce654['id']}})['then'](function(){return _0x30f157;});})[_0x6c91('0x27')](function(){_0x412b79['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3620a6,_0x1ab470){return function(_0x1b6909){if(!_0x1b6909){_0x3620a6['sendStatus'](0x194);}return _0x1b6909;};}function handleError(_0x56a278,_0x58f5f4){_0x58f5f4=_0x58f5f4||0x1f4;return function(_0x1cf041){logger['error'](_0x1cf041[_0x6c91('0x2b')]);if(_0x1cf041[_0x6c91('0x2c')]){delete _0x1cf041[_0x6c91('0x2c')];}_0x56a278[_0x6c91('0x1a')](_0x58f5f4)[_0x6c91('0x2d')](_0x1cf041);};}exports[_0x6c91('0x2e')]=function(_0x629d15,_0x6af6cb){var _0x3512f1={},_0x22a628={},_0x398685={'count':0x0,'rows':[]};var _0x3fcf97=_['map'](db[_0x6c91('0x2f')][_0x6c91('0x30')],function(_0x19593f){return{'name':_0x19593f[_0x6c91('0x31')],'type':_0x19593f[_0x6c91('0x32')][_0x6c91('0x33')]};});_0x22a628['model']=_['map'](_0x3fcf97,_0x6c91('0x2c'));_0x22a628[_0x6c91('0x34')]=_[_0x6c91('0x35')](_0x629d15[_0x6c91('0x34')]);_0x22a628[_0x6c91('0x36')]=_[_0x6c91('0x37')](_0x22a628['model'],_0x22a628[_0x6c91('0x34')]);_0x3512f1[_0x6c91('0x38')]=_['intersection'](_0x22a628[_0x6c91('0x39')],qs[_0x6c91('0x3a')](_0x629d15[_0x6c91('0x34')][_0x6c91('0x3a')]));_0x3512f1[_0x6c91('0x38')]=_0x3512f1[_0x6c91('0x38')][_0x6c91('0x3b')]?_0x3512f1[_0x6c91('0x38')]:_0x22a628['model'];if(!_0x629d15[_0x6c91('0x34')][_0x6c91('0x3c')](_0x6c91('0x3d'))){_0x3512f1[_0x6c91('0x1f')]=qs[_0x6c91('0x1f')](_0x629d15['query'][_0x6c91('0x1f')]);_0x3512f1['offset']=qs[_0x6c91('0x1d')](_0x629d15[_0x6c91('0x34')][_0x6c91('0x1d')]);}_0x3512f1['order']=qs[_0x6c91('0x3e')](_0x629d15[_0x6c91('0x34')][_0x6c91('0x3e')]);_0x3512f1[_0x6c91('0x3f')]=qs[_0x6c91('0x36')](_[_0x6c91('0x40')](_0x629d15[_0x6c91('0x34')],_0x22a628['filters']),_0x3fcf97);if(_0x629d15[_0x6c91('0x34')][_0x6c91('0x41')]){_0x3512f1[_0x6c91('0x3f')]=_[_0x6c91('0x42')](_0x3512f1[_0x6c91('0x3f')],{'$or':_[_0x6c91('0x43')](_0x3fcf97,function(_0x5965a0){if(_0x5965a0[_0x6c91('0x32')]!==_0x6c91('0x44')){var _0x318694={};_0x318694[_0x5965a0[_0x6c91('0x2c')]]={'$like':'%'+_0x629d15[_0x6c91('0x34')]['filter']+'%'};return _0x318694;}})});}_0x3512f1=_['merge']({},_0x3512f1,_0x629d15[_0x6c91('0x45')]);var _0x512aad={'where':_0x3512f1['where']};return db['Interval'][_0x6c91('0x20')](_0x512aad)[_0x6c91('0x27')](function(_0x17d063){_0x398685['count']=_0x17d063;if(_0x629d15[_0x6c91('0x34')][_0x6c91('0x46')]){_0x3512f1['include']=[{'all':!![]}];}return db['Interval'][_0x6c91('0x47')](_0x3512f1);})[_0x6c91('0x27')](function(_0x3b89d4){_0x398685['rows']=_0x3b89d4;return _0x398685;})['then'](respondWithFilteredResult(_0x6af6cb,_0x3512f1))[_0x6c91('0x48')](handleError(_0x6af6cb,null));};exports[_0x6c91('0x49')]=function(_0x17b775,_0x91066a){var _0x50bc48={'raw':!![],'where':{'id':_0x17b775[_0x6c91('0x4a')]['id']}},_0x5d2583={};_0x5d2583[_0x6c91('0x39')]=_[_0x6c91('0x35')](db[_0x6c91('0x2f')]['rawAttributes']);_0x5d2583[_0x6c91('0x34')]=_[_0x6c91('0x35')](_0x17b775[_0x6c91('0x34')]);_0x5d2583['filters']=_[_0x6c91('0x37')](_0x5d2583[_0x6c91('0x39')],_0x5d2583[_0x6c91('0x34')]);_0x50bc48[_0x6c91('0x38')]=_['intersection'](_0x5d2583[_0x6c91('0x39')],qs[_0x6c91('0x3a')](_0x17b775[_0x6c91('0x34')][_0x6c91('0x3a')]));_0x50bc48[_0x6c91('0x38')]=_0x50bc48[_0x6c91('0x38')][_0x6c91('0x3b')]?_0x50bc48[_0x6c91('0x38')]:_0x5d2583['model'];if(_0x17b775[_0x6c91('0x34')][_0x6c91('0x46')]){_0x50bc48[_0x6c91('0x4b')]=[{'all':!![]}];}_0x50bc48=_[_0x6c91('0x42')]({},_0x50bc48,_0x17b775[_0x6c91('0x45')]);return db[_0x6c91('0x2f')][_0x6c91('0x4c')](_0x50bc48)[_0x6c91('0x27')](handleEntityNotFound(_0x91066a,null))[_0x6c91('0x27')](respondWithResult(_0x91066a,null))[_0x6c91('0x48')](handleError(_0x91066a,null));};exports[_0x6c91('0x4d')]=function(_0x3e43a3,_0x33cb37){return db[_0x6c91('0x2f')]['create'](_0x3e43a3[_0x6c91('0x4e')],{})[_0x6c91('0x27')](function(_0x39a595){var _0x3498bf=_0x3e43a3[_0x6c91('0x4f')]['get']({'plain':!![]});if(!_0x3498bf)throw new Error(_0x6c91('0x50'));if(_0x3498bf[_0x6c91('0x51')]===_0x6c91('0x4f')){var _0x3befde=_0x39a595[_0x6c91('0x52')]({'plain':!![]});var _0x5cf8b1=_0x6c91('0x29');return db['UserProfileSection'][_0x6c91('0x4c')]({'where':{'name':_0x5cf8b1,'userProfileId':_0x3498bf['userProfileId']},'raw':!![]})['then'](function(_0x15e6f0){if(_0x15e6f0&&_0x15e6f0['autoAssociation']===0x0){return db[_0x6c91('0x2a')]['create']({'name':_0x3befde['name'],'resourceId':_0x3befde['id'],'type':_0x15e6f0['name'],'sectionId':_0x15e6f0['id']},{})['then'](function(){return _0x39a595;});}else{return _0x39a595;}})[_0x6c91('0x48')](function(_0x11f94d){logger[_0x6c91('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11f94d);throw _0x11f94d;});}return _0x39a595;})[_0x6c91('0x27')](respondWithResult(_0x33cb37,0xc9))['catch'](handleError(_0x33cb37,null));};exports[_0x6c91('0x26')]=function(_0x52cff7,_0x7b18a8){if(_0x52cff7[_0x6c91('0x4e')]['id']){delete _0x52cff7['body']['id'];}return db[_0x6c91('0x2f')][_0x6c91('0x4c')]({'where':{'id':_0x52cff7[_0x6c91('0x4a')]['id']}})[_0x6c91('0x27')](handleEntityNotFound(_0x7b18a8,null))['then'](saveUpdates(_0x52cff7['body'],null))[_0x6c91('0x27')](respondWithResult(_0x7b18a8,null))[_0x6c91('0x48')](handleError(_0x7b18a8,null));};exports[_0x6c91('0x28')]=function(_0x559ff6,_0x1aeb48){return db[_0x6c91('0x2f')]['find']({'where':{'id':_0x559ff6[_0x6c91('0x4a')]['id']}})[_0x6c91('0x27')](handleEntityNotFound(_0x1aeb48,null))[_0x6c91('0x27')](removeEntity(_0x1aeb48,null))['catch'](handleError(_0x1aeb48,null));};exports[_0x6c91('0x54')]=function(_0x121993,_0x1e4325,_0x4914c0){if(_0x121993['body']['id']){delete _0x121993[_0x6c91('0x4e')]['id'];}return db['Interval'][_0x6c91('0x4c')]({'where':{'id':_0x121993[_0x6c91('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1e4325,null))[_0x6c91('0x27')](function(_0x28f45b){if(_0x28f45b){_0x121993['body'][_0x6c91('0x55')]=_0x28f45b['id'];return db[_0x6c91('0x2f')][_0x6c91('0x4d')](_0x121993[_0x6c91('0x4e')]);}})['then'](respondWithResult(_0x1e4325,null))[_0x6c91('0x48')](handleError(_0x1e4325,null));};exports[_0x6c91('0x56')]=function(_0x38b80c,_0x1b0f51,_0x3e4f4b){var _0x49e3d0={};var _0xe9074a={};var _0x1280c4;var _0x2ef9e8;return db[_0x6c91('0x2f')][_0x6c91('0x57')]({'where':{'id':_0x38b80c[_0x6c91('0x4a')]['id']}})[_0x6c91('0x27')](handleEntityNotFound(_0x1b0f51,null))[_0x6c91('0x27')](function(_0x8da850){if(_0x8da850){_0x1280c4=_0x8da850;_0xe9074a['model']=_['keys'](db[_0x6c91('0x2f')][_0x6c91('0x30')]);_0xe9074a[_0x6c91('0x34')]=_[_0x6c91('0x35')](_0x38b80c[_0x6c91('0x34')]);_0xe9074a[_0x6c91('0x36')]=_[_0x6c91('0x37')](_0xe9074a[_0x6c91('0x39')],_0xe9074a[_0x6c91('0x34')]);_0x49e3d0[_0x6c91('0x38')]=_['intersection'](_0xe9074a[_0x6c91('0x39')],qs[_0x6c91('0x3a')](_0x38b80c[_0x6c91('0x34')]['fields']));_0x49e3d0[_0x6c91('0x38')]=_0x49e3d0['attributes'][_0x6c91('0x3b')]?_0x49e3d0[_0x6c91('0x38')]:_0xe9074a[_0x6c91('0x39')];_0x49e3d0['order']=qs['sort'](_0x38b80c[_0x6c91('0x34')][_0x6c91('0x3e')]);_0x49e3d0[_0x6c91('0x3f')]=qs['filters'](_['pick'](_0x38b80c[_0x6c91('0x34')],_0xe9074a[_0x6c91('0x36')]));if(_0x38b80c[_0x6c91('0x34')][_0x6c91('0x41')]){_0x49e3d0['where']=_[_0x6c91('0x42')](_0x49e3d0[_0x6c91('0x3f')],{'$or':_[_0x6c91('0x43')](_0x49e3d0[_0x6c91('0x38')],function(_0x52689e){var _0x11af12={};_0x11af12[_0x52689e]={'$like':'%'+_0x38b80c[_0x6c91('0x34')][_0x6c91('0x41')]+'%'};return _0x11af12;})});}_0x49e3d0=_['merge']({},_0x49e3d0,_0x38b80c[_0x6c91('0x45')]);return _0x1280c4[_0x6c91('0x56')](_0x49e3d0);}})[_0x6c91('0x27')](function(_0xdfa816){if(_0xdfa816){_0x2ef9e8=_0xdfa816[_0x6c91('0x3b')];if(!_0x38b80c[_0x6c91('0x34')]['hasOwnProperty'](_0x6c91('0x3d'))){_0x49e3d0[_0x6c91('0x1f')]=qs[_0x6c91('0x1f')](_0x38b80c['query'][_0x6c91('0x1f')]);_0x49e3d0[_0x6c91('0x1d')]=qs[_0x6c91('0x1d')](_0x38b80c[_0x6c91('0x34')][_0x6c91('0x1d')]);}return _0x1280c4[_0x6c91('0x56')](_0x49e3d0);}})[_0x6c91('0x27')](function(_0x45ef01){if(_0x45ef01){return _0x45ef01?{'count':_0x2ef9e8,'rows':_0x45ef01}:null;}})[_0x6c91('0x27')](respondWithResult(_0x1b0f51,null))[_0x6c91('0x48')](handleError(_0x1b0f51,null));};exports[_0x6c91('0x58')]=function(_0x284743,_0x4b7bef,_0x395e45){return db[_0x6c91('0x2f')][_0x6c91('0x57')]({'where':{'id':_0x284743[_0x6c91('0x4a')]['id']}})[_0x6c91('0x27')](handleEntityNotFound(_0x4b7bef,null))[_0x6c91('0x27')](function(_0x51245b){if(_0x51245b){return db['sequelize'][_0x6c91('0x59')](function(_0x2e4879){return db['Interval'][_0x6c91('0x28')]({'where':{'IntervalId':_0x284743[_0x6c91('0x4a')]['id']},'transaction':_0x2e4879})[_0x6c91('0x27')](function(_0x22061b){var _0x428a2d=_[_0x6c91('0x43')](_0x284743['body'],function(_0x27205d){delete _0x27205d['id'];_0x27205d['IntervalId']=_0x284743[_0x6c91('0x4a')]['id'];return _0x27205d;});return db[_0x6c91('0x2f')][_0x6c91('0x5a')](_0x428a2d,{'transaction':_0x2e4879});});})[_0x6c91('0x27')](function(){return db[_0x6c91('0x2f')]['findAll']({'where':{'IntervalId':_0x284743[_0x6c91('0x4a')]['id']}});});}})['then'](respondWithResult(_0x4b7bef,null))[_0x6c91('0x48')](handleError(_0x4b7bef,null));}; \ No newline at end of file +var _0x4737=['request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','length','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','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xce2d46,_0x3be00c){var _0xa284d1=function(_0x1bcef5){while(--_0x1bcef5){_0xce2d46['push'](_0xce2d46['shift']());}};_0xa284d1(++_0x3be00c);}(_0x4737,0x119));var _0x7473=function(_0x45fd25,_0x235429){_0x45fd25=_0x45fd25-0x0;var _0x81d2a3=_0x4737[_0x45fd25];return _0x81d2a3;};'use strict';var emlformat=require(_0x7473('0x0'));var rimraf=require(_0x7473('0x1'));var zipdir=require(_0x7473('0x2'));var jsonpatch=require(_0x7473('0x3'));var rp=require(_0x7473('0x4'));var moment=require('moment');var BPromise=require(_0x7473('0x5'));var Mustache=require('mustache');var util=require(_0x7473('0x6'));var path=require(_0x7473('0x7'));var sox=require(_0x7473('0x8'));var csv=require(_0x7473('0x9'));var ejs=require(_0x7473('0xa'));var fs=require('fs');var fs_extra=require(_0x7473('0xb'));var _=require(_0x7473('0xc'));var squel=require(_0x7473('0xd'));var crypto=require(_0x7473('0xe'));var jsforce=require(_0x7473('0xf'));var deskjs=require(_0x7473('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7473('0x11'));var Redis=require('ioredis');var authService=require(_0x7473('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7473('0x13'));var logger=require(_0x7473('0x14'))('api');var utils=require(_0x7473('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7473('0x16'))['db'];var extensions=require(_0x7473('0x17'));function respondWithStatusCode(_0x3f6aa5,_0x33350f){_0x33350f=_0x33350f||0xcc;return function(_0x58a6de){if(_0x58a6de){return _0x3f6aa5[_0x7473('0x18')](_0x33350f);}return _0x3f6aa5[_0x7473('0x19')](_0x33350f)[_0x7473('0x1a')]();};}function respondWithResult(_0x149ec2,_0x4209db){_0x4209db=_0x4209db||0xc8;return function(_0x45d786){if(_0x45d786){return _0x149ec2['status'](_0x4209db)[_0x7473('0x1b')](_0x45d786);}};}function respondWithFilteredResult(_0x1e0c60,_0x5aaa45){return function(_0x2f9d28){if(_0x2f9d28){var _0x512c16=typeof _0x5aaa45[_0x7473('0x1c')]===_0x7473('0x1d')&&typeof _0x5aaa45[_0x7473('0x1e')]==='undefined';var _0x37874d=_0x2f9d28[_0x7473('0x1f')];var _0x2d49e8=_0x512c16?0x0:_0x5aaa45['offset'];var _0xc67a4d=_0x512c16?_0x2f9d28[_0x7473('0x1f')]:_0x5aaa45[_0x7473('0x1c')]+_0x5aaa45[_0x7473('0x1e')];var _0x47c112;if(_0xc67a4d>=_0x37874d){_0xc67a4d=_0x37874d;_0x47c112=0xc8;}else{_0x47c112=0xce;}_0x1e0c60[_0x7473('0x19')](_0x47c112);return _0x1e0c60[_0x7473('0x20')](_0x7473('0x21'),_0x2d49e8+'-'+_0xc67a4d+'/'+_0x37874d)[_0x7473('0x1b')](_0x2f9d28);}return null;};}function patchUpdates(_0x47986b){return function(_0x50cf75){try{jsonpatch[_0x7473('0x22')](_0x50cf75,_0x47986b,!![]);}catch(_0xc62af5){return BPromise[_0x7473('0x23')](_0xc62af5);}return _0x50cf75['save']();};}function saveUpdates(_0x149841,_0x2926b5){return function(_0x2e0e1c){if(_0x2e0e1c){return _0x2e0e1c[_0x7473('0x24')](_0x149841)['then'](function(_0x257793){return _0x257793;});}return null;};}function removeEntity(_0x3cb883,_0x7b67d2){return function(_0x198de2){if(_0x198de2){return _0x198de2[_0x7473('0x25')]()[_0x7473('0x26')](function(){var _0xd8c32d=_0x198de2[_0x7473('0x27')]({'plain':!![]});var _0x440109=_0x7473('0x28');return db[_0x7473('0x29')][_0x7473('0x25')]({'where':{'type':_0x440109,'resourceId':_0xd8c32d['id']}})[_0x7473('0x26')](function(){return _0x198de2;});})['then'](function(){_0x3cb883[_0x7473('0x19')](0xcc)[_0x7473('0x1a')]();});}};}function handleEntityNotFound(_0x25fc9c,_0x52199e){return function(_0x3db1df){if(!_0x3db1df){_0x25fc9c[_0x7473('0x18')](0x194);}return _0x3db1df;};}function handleError(_0xe4e405,_0x44a696){_0x44a696=_0x44a696||0x1f4;return function(_0x4223c2){logger[_0x7473('0x2a')](_0x4223c2[_0x7473('0x2b')]);if(_0x4223c2[_0x7473('0x2c')]){delete _0x4223c2[_0x7473('0x2c')];}_0xe4e405[_0x7473('0x19')](_0x44a696)[_0x7473('0x2d')](_0x4223c2);};}exports[_0x7473('0x2e')]=function(_0x490387,_0x3a8832){var _0xde71c4={},_0x5d82dc={},_0x261742={'count':0x0,'rows':[]};var _0x44feb2=_['map'](db[_0x7473('0x2f')][_0x7473('0x30')],function(_0x5458a1){return{'name':_0x5458a1[_0x7473('0x31')],'type':_0x5458a1[_0x7473('0x32')][_0x7473('0x33')]};});_0x5d82dc['model']=_[_0x7473('0x34')](_0x44feb2,_0x7473('0x2c'));_0x5d82dc[_0x7473('0x35')]=_[_0x7473('0x36')](_0x490387[_0x7473('0x35')]);_0x5d82dc['filters']=_[_0x7473('0x37')](_0x5d82dc[_0x7473('0x38')],_0x5d82dc[_0x7473('0x35')]);_0xde71c4['attributes']=_[_0x7473('0x37')](_0x5d82dc[_0x7473('0x38')],qs[_0x7473('0x39')](_0x490387[_0x7473('0x35')][_0x7473('0x39')]));_0xde71c4[_0x7473('0x3a')]=_0xde71c4['attributes']['length']?_0xde71c4[_0x7473('0x3a')]:_0x5d82dc[_0x7473('0x38')];if(!_0x490387[_0x7473('0x35')][_0x7473('0x3b')](_0x7473('0x3c'))){_0xde71c4[_0x7473('0x1e')]=qs[_0x7473('0x1e')](_0x490387[_0x7473('0x35')][_0x7473('0x1e')]);_0xde71c4[_0x7473('0x1c')]=qs[_0x7473('0x1c')](_0x490387['query'][_0x7473('0x1c')]);}_0xde71c4[_0x7473('0x3d')]=qs[_0x7473('0x3e')](_0x490387[_0x7473('0x35')][_0x7473('0x3e')]);_0xde71c4['where']=qs[_0x7473('0x3f')](_[_0x7473('0x40')](_0x490387[_0x7473('0x35')],_0x5d82dc[_0x7473('0x3f')]),_0x44feb2);if(_0x490387['query'][_0x7473('0x41')]){_0xde71c4['where']=_[_0x7473('0x42')](_0xde71c4['where'],{'$or':_['map'](_0x44feb2,function(_0x5984a0){if(_0x5984a0[_0x7473('0x32')]!==_0x7473('0x43')){var _0x4ad032={};_0x4ad032[_0x5984a0[_0x7473('0x2c')]]={'$like':'%'+_0x490387[_0x7473('0x35')]['filter']+'%'};return _0x4ad032;}})});}_0xde71c4=_[_0x7473('0x42')]({},_0xde71c4,_0x490387[_0x7473('0x44')]);var _0x11e1a0={'where':_0xde71c4[_0x7473('0x45')]};return db[_0x7473('0x2f')][_0x7473('0x1f')](_0x11e1a0)[_0x7473('0x26')](function(_0x4fd1cd){_0x261742[_0x7473('0x1f')]=_0x4fd1cd;if(_0x490387[_0x7473('0x35')][_0x7473('0x46')]){_0xde71c4[_0x7473('0x47')]=[{'all':!![]}];}return db[_0x7473('0x2f')][_0x7473('0x48')](_0xde71c4);})[_0x7473('0x26')](function(_0x469bf0){_0x261742[_0x7473('0x49')]=_0x469bf0;return _0x261742;})[_0x7473('0x26')](respondWithFilteredResult(_0x3a8832,_0xde71c4))[_0x7473('0x4a')](handleError(_0x3a8832,null));};exports[_0x7473('0x4b')]=function(_0x4e7122,_0x4ba751){var _0x3ef1b9={'raw':!![],'where':{'id':_0x4e7122[_0x7473('0x4c')]['id']}},_0x259085={};_0x259085['model']=_['keys'](db['Interval'][_0x7473('0x30')]);_0x259085[_0x7473('0x35')]=_[_0x7473('0x36')](_0x4e7122[_0x7473('0x35')]);_0x259085['filters']=_[_0x7473('0x37')](_0x259085['model'],_0x259085[_0x7473('0x35')]);_0x3ef1b9[_0x7473('0x3a')]=_['intersection'](_0x259085[_0x7473('0x38')],qs[_0x7473('0x39')](_0x4e7122['query']['fields']));_0x3ef1b9['attributes']=_0x3ef1b9[_0x7473('0x3a')][_0x7473('0x4d')]?_0x3ef1b9[_0x7473('0x3a')]:_0x259085[_0x7473('0x38')];if(_0x4e7122['query'][_0x7473('0x46')]){_0x3ef1b9[_0x7473('0x47')]=[{'all':!![]}];}_0x3ef1b9=_[_0x7473('0x42')]({},_0x3ef1b9,_0x4e7122[_0x7473('0x44')]);return db[_0x7473('0x2f')][_0x7473('0x4e')](_0x3ef1b9)[_0x7473('0x26')](handleEntityNotFound(_0x4ba751,null))[_0x7473('0x26')](respondWithResult(_0x4ba751,null))[_0x7473('0x4a')](handleError(_0x4ba751,null));};exports['create']=function(_0x37e7be,_0x50616d){return db[_0x7473('0x2f')][_0x7473('0x4f')](_0x37e7be[_0x7473('0x50')],{})[_0x7473('0x26')](function(_0x43f1a0){var _0x1c24e5=_0x37e7be[_0x7473('0x51')]['get']({'plain':!![]});if(!_0x1c24e5)throw new Error(_0x7473('0x52'));if(_0x1c24e5[_0x7473('0x53')]===_0x7473('0x51')){var _0x573bb2=_0x43f1a0[_0x7473('0x27')]({'plain':!![]});var _0x379750=_0x7473('0x28');return db[_0x7473('0x54')][_0x7473('0x4e')]({'where':{'name':_0x379750,'userProfileId':_0x1c24e5[_0x7473('0x55')]},'raw':!![]})[_0x7473('0x26')](function(_0x3942ab){if(_0x3942ab&&_0x3942ab[_0x7473('0x56')]===0x0){return db[_0x7473('0x29')]['create']({'name':_0x573bb2[_0x7473('0x2c')],'resourceId':_0x573bb2['id'],'type':_0x3942ab[_0x7473('0x2c')],'sectionId':_0x3942ab['id']},{})[_0x7473('0x26')](function(){return _0x43f1a0;});}else{return _0x43f1a0;}})['catch'](function(_0x378043){logger['error'](_0x7473('0x57'),_0x378043);throw _0x378043;});}return _0x43f1a0;})[_0x7473('0x26')](respondWithResult(_0x50616d,0xc9))[_0x7473('0x4a')](handleError(_0x50616d,null));};exports['update']=function(_0x2115b7,_0x2236bb){if(_0x2115b7[_0x7473('0x50')]['id']){delete _0x2115b7[_0x7473('0x50')]['id'];}return db['Interval'][_0x7473('0x4e')]({'where':{'id':_0x2115b7['params']['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x2236bb,null))[_0x7473('0x26')](saveUpdates(_0x2115b7[_0x7473('0x50')],null))[_0x7473('0x26')](respondWithResult(_0x2236bb,null))[_0x7473('0x4a')](handleError(_0x2236bb,null));};exports[_0x7473('0x25')]=function(_0x5a93d6,_0x265f00){return db[_0x7473('0x2f')]['find']({'where':{'id':_0x5a93d6[_0x7473('0x4c')]['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x265f00,null))[_0x7473('0x26')](removeEntity(_0x265f00,null))[_0x7473('0x4a')](handleError(_0x265f00,null));};exports['addInterval']=function(_0x4c32e5,_0x416341,_0x2a3953){if(_0x4c32e5[_0x7473('0x50')]['id']){delete _0x4c32e5[_0x7473('0x50')]['id'];}return db[_0x7473('0x2f')][_0x7473('0x4e')]({'where':{'id':_0x4c32e5[_0x7473('0x4c')]['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x416341,null))[_0x7473('0x26')](function(_0x584ba1){if(_0x584ba1){_0x4c32e5['body'][_0x7473('0x58')]=_0x584ba1['id'];return db['Interval']['create'](_0x4c32e5[_0x7473('0x50')]);}})['then'](respondWithResult(_0x416341,null))['catch'](handleError(_0x416341,null));};exports[_0x7473('0x59')]=function(_0x46f218,_0x2ed172,_0x44f2b8){var _0x57ef18={};var _0x5e641c={};var _0xc859a6;var _0x3529f5;return db[_0x7473('0x2f')][_0x7473('0x5a')]({'where':{'id':_0x46f218[_0x7473('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ed172,null))[_0x7473('0x26')](function(_0x2e5809){if(_0x2e5809){_0xc859a6=_0x2e5809;_0x5e641c['model']=_[_0x7473('0x36')](db[_0x7473('0x2f')][_0x7473('0x30')]);_0x5e641c[_0x7473('0x35')]=_[_0x7473('0x36')](_0x46f218[_0x7473('0x35')]);_0x5e641c[_0x7473('0x3f')]=_[_0x7473('0x37')](_0x5e641c[_0x7473('0x38')],_0x5e641c[_0x7473('0x35')]);_0x57ef18[_0x7473('0x3a')]=_[_0x7473('0x37')](_0x5e641c[_0x7473('0x38')],qs[_0x7473('0x39')](_0x46f218[_0x7473('0x35')][_0x7473('0x39')]));_0x57ef18[_0x7473('0x3a')]=_0x57ef18['attributes'][_0x7473('0x4d')]?_0x57ef18[_0x7473('0x3a')]:_0x5e641c['model'];_0x57ef18[_0x7473('0x3d')]=qs[_0x7473('0x3e')](_0x46f218[_0x7473('0x35')][_0x7473('0x3e')]);_0x57ef18[_0x7473('0x45')]=qs[_0x7473('0x3f')](_['pick'](_0x46f218[_0x7473('0x35')],_0x5e641c[_0x7473('0x3f')]));if(_0x46f218[_0x7473('0x35')][_0x7473('0x41')]){_0x57ef18['where']=_[_0x7473('0x42')](_0x57ef18[_0x7473('0x45')],{'$or':_[_0x7473('0x34')](_0x57ef18[_0x7473('0x3a')],function(_0x24b81c){var _0xe08c55={};_0xe08c55[_0x24b81c]={'$like':'%'+_0x46f218[_0x7473('0x35')][_0x7473('0x41')]+'%'};return _0xe08c55;})});}_0x57ef18=_[_0x7473('0x42')]({},_0x57ef18,_0x46f218['options']);return _0xc859a6['getIntervals'](_0x57ef18);}})['then'](function(_0x25015e){if(_0x25015e){_0x3529f5=_0x25015e[_0x7473('0x4d')];if(!_0x46f218['query'][_0x7473('0x3b')]('nolimit')){_0x57ef18['limit']=qs[_0x7473('0x1e')](_0x46f218[_0x7473('0x35')][_0x7473('0x1e')]);_0x57ef18[_0x7473('0x1c')]=qs[_0x7473('0x1c')](_0x46f218[_0x7473('0x35')]['offset']);}return _0xc859a6[_0x7473('0x59')](_0x57ef18);}})['then'](function(_0x18151a){if(_0x18151a){return _0x18151a?{'count':_0x3529f5,'rows':_0x18151a}:null;}})[_0x7473('0x26')](respondWithResult(_0x2ed172,null))[_0x7473('0x4a')](handleError(_0x2ed172,null));};exports[_0x7473('0x5b')]=function(_0x4d75fe,_0x1d9076,_0x39d07d){return db[_0x7473('0x2f')][_0x7473('0x5a')]({'where':{'id':_0x4d75fe['params']['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x1d9076,null))['then'](function(_0xb46093){if(_0xb46093){return db[_0x7473('0x5c')][_0x7473('0x5d')](function(_0x5114b7){return db[_0x7473('0x2f')][_0x7473('0x25')]({'where':{'IntervalId':_0x4d75fe[_0x7473('0x4c')]['id']},'transaction':_0x5114b7})['then'](function(_0x48445a){var _0x26759e=_[_0x7473('0x34')](_0x4d75fe[_0x7473('0x50')],function(_0x57f279){delete _0x57f279['id'];_0x57f279[_0x7473('0x58')]=_0x4d75fe[_0x7473('0x4c')]['id'];return _0x57f279;});return db[_0x7473('0x2f')][_0x7473('0x5e')](_0x26759e,{'transaction':_0x5114b7});});})[_0x7473('0x26')](function(){return db[_0x7473('0x2f')][_0x7473('0x48')]({'where':{'IntervalId':_0x4d75fe[_0x7473('0x4c')]['id']}});});}})['then'](respondWithResult(_0x1d9076,null))[_0x7473('0x4a')](handleError(_0x1d9076,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e331c5c..4e14267 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 _0x4444=['request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','moment','bluebird'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4444,0x17e));var _0x4444=function(_0xaf8f29,_0x5754cf){_0xaf8f29=_0xaf8f29-0x0;var _0x391fed=_0x4444[_0xaf8f29];return _0x391fed;};'use strict';var _=require(_0x4444('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4444('0x1'));var BPromise=require(_0x4444('0x2'));var rp=require(_0x4444('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4444('0x4'));var config=require(_0x4444('0x5'));var attributes=require(_0x4444('0x6'));var extensions=require(_0x4444('0x7'));module[_0x4444('0x8')]=function(_0x51c6d6,_0x337cc7){return _0x51c6d6['define'](_0x4444('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1426fc,_0x5ba64f){extensions['rewrite'](_0x51c6d6,_0x1426fc);},'afterBulkCreate':function(_0x31e179,_0x520f8d,_0x404dae){_0x404dae();extensions[_0x4444('0xa')](_0x51c6d6,_0x31e179[0x0]);},'afterUpdate':function(_0x11c668,_0x5c5e5a){extensions[_0x4444('0xa')](_0x51c6d6,_0x11c668);},'afterDestroy':function(_0x6c22f3,_0x8bd2e9){extensions[_0x4444('0xa')](_0x51c6d6,_0x6c22f3);}}});}; \ No newline at end of file +var _0x6493=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_intervals','rewrite','lodash'];(function(_0x4f74fc,_0x437d62){var _0x60c6b6=function(_0x586807){while(--_0x586807){_0x4f74fc['push'](_0x4f74fc['shift']());}};_0x60c6b6(++_0x437d62);}(_0x6493,0xc2));var _0x3649=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x6493[_0x4ca6a4];return _0x120555;};'use strict';var _=require(_0x3649('0x0'));var util=require(_0x3649('0x1'));var logger=require(_0x3649('0x2'))(_0x3649('0x3'));var moment=require('moment');var BPromise=require(_0x3649('0x4'));var rp=require(_0x3649('0x5'));var fs=require('fs');var path=require(_0x3649('0x6'));var rimraf=require(_0x3649('0x7'));var config=require(_0x3649('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x3649('0x9')]=function(_0x3d3372,_0x4cec87){return _0x3d3372[_0x3649('0xa')]('Interval',attributes,{'tableName':_0x3649('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xe97a6,_0x3232c4){extensions['rewrite'](_0x3d3372,_0xe97a6);},'afterBulkCreate':function(_0x5843cc,_0x4d7807,_0x40a5bc){_0x40a5bc();extensions[_0x3649('0xc')](_0x3d3372,_0x5843cc[0x0]);},'afterUpdate':function(_0x3d463b,_0x108bcf){extensions[_0x3649('0xc')](_0x3d3372,_0x3d463b);},'afterDestroy':function(_0x58b161,_0x5b6b47){extensions['rewrite'](_0x3d3372,_0x58b161);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f43783d..e4e9d4a 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 691b8e5..aa17cb3 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x0b0e,0x187));var _0xe0b0=function(_0x42946c,_0x577d97){_0x42946c=_0x42946c-0x0;var _0x5d7687=_0x0b0e[_0x42946c];return _0x5d7687;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x28ff39,_0x39b6f8){var _0xa20be6=function(_0x44b2cd){while(--_0x44b2cd){_0x28ff39['push'](_0x28ff39['shift']());}};_0xa20be6(++_0x39b6f8);}(_0x2ef3,0xba));var _0x32ef=function(_0x34895d,_0x444ddf){_0x34895d=_0x34895d-0x0;var _0x268030=_0x2ef3[_0x34895d];return _0x268030;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index bb15edf..91aca04 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 _0xd3f4=['support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','request','setEncoding','utf8','data','end','status','json','parse','error','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','https'];(function(_0x5f3012,_0x433e3f){var _0x578b2d=function(_0x436600){while(--_0x436600){_0x5f3012['push'](_0x5f3012['shift']());}};_0x578b2d(++_0x433e3f);}(_0xd3f4,0x1b7));var _0x4d3f=function(_0x486357,_0x496eb2){_0x486357=_0x486357-0x0;var _0x3ab9af=_0xd3f4[_0x486357];return _0x3ab9af;};'use strict';var BPromise=require('bluebird');var https=require(_0x4d3f('0x0'));var logger=require('../../config/logger')('api');var USERNAME=_0x4d3f('0x1');var PASSWORD=_0x4d3f('0x2');function openIssue(_0x5f0611,_0xb5abb4){var _0x2c760e={'fields':{'project':{'key':_0x5f0611[_0x4d3f('0x3')]||_0x4d3f('0x4')},'summary':(_0x5f0611[_0x4d3f('0x5')]||_0x4d3f('0x6'))+_0x4d3f('0x7')+_0x5f0611['ip'],'description':_0x5f0611['description']||JSON[_0x4d3f('0x8')](_0x5f0611),'issuetype':{'name':_0x5f0611[_0x4d3f('0x9')]||_0x4d3f('0xa')}}};_0x2c760e[_0x4d3f('0xb')][_0x4d3f('0xc')]=_0x5f0611[_0x4d3f('0xd')];_0x2c760e[_0x4d3f('0xb')][_0x4d3f('0xe')]=_0x5f0611[_0x4d3f('0xf')];_0x2c760e[_0x4d3f('0xb')][_0x4d3f('0x10')]=_0x5f0611['newToken'];_0x2c760e[_0x4d3f('0xb')][_0x4d3f('0x11')]=_0x5f0611['name'];_0x2c760e[_0x4d3f('0xb')][_0x4d3f('0x12')]=_0x5f0611[_0x4d3f('0x13')];_0x2c760e[_0x4d3f('0xb')]['customfield_10102']=_0x5f0611['ip'];var _0x54df45={'host':_0x4d3f('0x14'),'port':0x1bb,'path':_0x4d3f('0x15'),'method':_0x4d3f('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x4d3f('0x17'),'Authorization':_0x4d3f('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x4782b3=JSON['stringify'](_0x2c760e);var _0x40e0f4=https[_0x4d3f('0x19')](_0x54df45,function(_0x18e91a){_0x18e91a[_0x4d3f('0x1a')](_0x4d3f('0x1b'));var _0x262938='';_0x18e91a['on'](_0x4d3f('0x1c'),function(_0xba16f){_0x262938+=_0xba16f;});_0x18e91a['on'](_0x4d3f('0x1d'),function(){if(_0xb5abb4){return _0xb5abb4[_0x4d3f('0x1e')](_0x18e91a['statusCode'])[_0x4d3f('0x1f')](JSON[_0x4d3f('0x20')](_0x262938));}});});_0x40e0f4['on'](_0x4d3f('0x21'),function(_0x1d732c){if(_0xb5abb4){return _0xb5abb4[_0x4d3f('0x1e')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x4d3f('0x22')}]});}});_0x40e0f4[_0x4d3f('0x23')](_0x4782b3);_0x40e0f4[_0x4d3f('0x1d')]();}exports[_0x4d3f('0x24')]=openIssue;exports[_0x4d3f('0x25')]=function(_0x1a96f1,_0x44a92d){_0x1a96f1[_0x4d3f('0x26')]['ip']=_0x1a96f1[_0x4d3f('0x27')][_0x4d3f('0x28')]||_0x1a96f1[_0x4d3f('0x29')]['remoteAddress']||_0x1a96f1[_0x4d3f('0x2a')][_0x4d3f('0x2b')]||_0x1a96f1[_0x4d3f('0x29')][_0x4d3f('0x2a')][_0x4d3f('0x2b')];return openIssue(_0x1a96f1[_0x4d3f('0x26')],_0x44a92d);}; \ No newline at end of file +var _0x2525=['bluebird','https','../../config/logger','api','3eAmWpBVP0','key','Report','\x20from\x20','description','issuetype','Bug','fields','email','oldToken','customfield_11502','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','setEncoding','utf8','data','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','x-forwarded-for','remoteAddress','connection','socket'];(function(_0x59ed7a,_0x20261e){var _0x37b0d7=function(_0x31a48e){while(--_0x31a48e){_0x59ed7a['push'](_0x59ed7a['shift']());}};_0x37b0d7(++_0x20261e);}(_0x2525,0x108));var _0x5252=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2525[_0xd1d19a];return _0x52a79d;};'use strict';var BPromise=require(_0x5252('0x0'));var https=require(_0x5252('0x1'));var logger=require(_0x5252('0x2'))(_0x5252('0x3'));var USERNAME='support';var PASSWORD=_0x5252('0x4');function openIssue(_0x4f8339,_0x169f94){var _0x258ea5={'fields':{'project':{'key':_0x4f8339[_0x5252('0x5')]||'MOTGUI'},'summary':(_0x4f8339['summary']||_0x5252('0x6'))+_0x5252('0x7')+_0x4f8339['ip'],'description':_0x4f8339[_0x5252('0x8')]||JSON['stringify'](_0x4f8339),'issuetype':{'name':_0x4f8339[_0x5252('0x9')]||_0x5252('0xa')}}};_0x258ea5[_0x5252('0xb')]['customfield_11500']=_0x4f8339[_0x5252('0xc')];_0x258ea5['fields']['customfield_11501']=_0x4f8339[_0x5252('0xd')];_0x258ea5['fields'][_0x5252('0xe')]=_0x4f8339['newToken'];_0x258ea5['fields']['customfield_11503']=_0x4f8339[_0x5252('0xf')];_0x258ea5[_0x5252('0xb')][_0x5252('0x10')]=_0x4f8339[_0x5252('0x11')];_0x258ea5[_0x5252('0xb')][_0x5252('0x12')]=_0x4f8339['ip'];var _0x4c54c6={'host':_0x5252('0x13'),'port':0x1bb,'path':_0x5252('0x14'),'method':_0x5252('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x5252('0x16'),'Authorization':_0x5252('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x5252('0x18')]('base64')}};var _0x5a7c8b=JSON[_0x5252('0x19')](_0x258ea5);var _0x4a0113=https['request'](_0x4c54c6,function(_0x2a63dc){_0x2a63dc[_0x5252('0x1a')](_0x5252('0x1b'));var _0x2bf899='';_0x2a63dc['on'](_0x5252('0x1c'),function(_0x38d250){_0x2bf899+=_0x38d250;});_0x2a63dc['on']('end',function(){if(_0x169f94){return _0x169f94[_0x5252('0x1d')](_0x2a63dc[_0x5252('0x1e')])[_0x5252('0x1f')](JSON['parse'](_0x2bf899));}});});_0x4a0113['on'](_0x5252('0x20'),function(_0x12bfed){if(_0x169f94){return _0x169f94['status'](0x1f4)[_0x5252('0x1f')]({'errors':[{'message':_0x5252('0x21'),'type':_0x5252('0x22')}]});}});_0x4a0113[_0x5252('0x23')](_0x5a7c8b);_0x4a0113[_0x5252('0x24')]();}exports[_0x5252('0x25')]=openIssue;exports[_0x5252('0x26')]=function(_0x33d33b,_0x122ee4){_0x33d33b[_0x5252('0x27')]['ip']=_0x33d33b['headers'][_0x5252('0x28')]||_0x33d33b['connection']['remoteAddress']||_0x33d33b['socket'][_0x5252('0x29')]||_0x33d33b[_0x5252('0x2a')][_0x5252('0x2b')]['remoteAddress'];return openIssue(_0x33d33b[_0x5252('0x27')],_0x122ee4);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index e78db8d..745ebca 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 _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x583ba8,_0x40bb0d){var _0x515683=function(_0x4172e9){while(--_0x4172e9){_0x583ba8['push'](_0x583ba8['shift']());}};_0x515683(++_0x40bb0d);}(_0x1339,0x1ed));var _0x9133=function(_0x54f4b5,_0x1a0134){_0x54f4b5=_0x54f4b5-0x0;var _0x5f4e38=_0x1339[_0x54f4b5];return _0x5f4e38;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router; \ No newline at end of file +var _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x2bd750,_0x39be0a){var _0xf32aab=function(_0x2c7869){while(--_0x2c7869){_0x2bd750['push'](_0x2bd750['shift']());}};_0xf32aab(++_0x39be0a);}(_0x4522,0x1a0));var _0x2452=function(_0x5e5e17,_0x1e80c3){_0x5e5e17=_0x5e5e17-0x0;var _0x22f9af=_0x4522[_0x5e5e17];return _0x22f9af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2452('0xf')]);router['put']('/:id',auth[_0x2452('0x9')](),controller[_0x2452('0x10')]);router[_0x2452('0x11')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x12')]);module[_0x2452('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 e831567..0401185 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(_0x5dcff3,_0x42f8ed){_0x5dcff3=_0x5dcff3-0x0;var _0x542585=_0x7a54[_0x5dcff3];return _0x542585;};'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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7a54,0x106));var _0x47a5=function(_0x4737de,_0x56b593){_0x4737de=_0x4737de-0x0;var _0x2dad55=_0x7a54[_0x4737de];return _0x2dad55;};'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 e1082d8..8d27c35 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 _0x539d=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyAnswerReport','include','findAll','rows','catch','show','includeAll','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x5d1761,_0x5057c2){var _0x5dccb=function(_0x5a446d){while(--_0x5a446d){_0x5d1761['push'](_0x5d1761['shift']());}};_0x5dccb(++_0x5057c2);}(_0x539d,0x17b));var _0xd539=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x539d[_0x41ee16];return _0x1f60de;};'use strict';var emlformat=require(_0xd539('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd539('0x1'));var jsonpatch=require(_0xd539('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd539('0x3'));var Mustache=require(_0xd539('0x4'));var util=require(_0xd539('0x5'));var path=require(_0xd539('0x6'));var sox=require(_0xd539('0x7'));var csv=require('to-csv');var ejs=require(_0xd539('0x8'));var fs=require('fs');var fs_extra=require(_0xd539('0x9'));var _=require(_0xd539('0xa'));var squel=require(_0xd539('0xb'));var crypto=require(_0xd539('0xc'));var jsforce=require(_0xd539('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd539('0xe'));var querystring=require(_0xd539('0xf'));var Papa=require(_0xd539('0x10'));var Redis=require(_0xd539('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd539('0x12'));var hardwareService=require(_0xd539('0x13'));var logger=require(_0xd539('0x14'))(_0xd539('0x15'));var utils=require(_0xd539('0x16'));var config=require(_0xd539('0x17'));var licenseUtil=require(_0xd539('0x18'));var db=require(_0xd539('0x19'))['db'];function respondWithStatusCode(_0x5209f2,_0x17cbc0){_0x17cbc0=_0x17cbc0||0xcc;return function(_0x1a4645){if(_0x1a4645){return _0x5209f2[_0xd539('0x1a')](_0x17cbc0);}return _0x5209f2[_0xd539('0x1b')](_0x17cbc0)[_0xd539('0x1c')]();};}function respondWithResult(_0xac445e,_0x54706f){_0x54706f=_0x54706f||0xc8;return function(_0x278f49){if(_0x278f49){return _0xac445e[_0xd539('0x1b')](_0x54706f)[_0xd539('0x1d')](_0x278f49);}};}function respondWithFilteredResult(_0x3f402e,_0x23bce1){return function(_0x7b2b41){if(_0x7b2b41){var _0x30aea1=typeof _0x23bce1[_0xd539('0x1e')]===_0xd539('0x1f')&&typeof _0x23bce1[_0xd539('0x20')]===_0xd539('0x1f');var _0x54d8ff=_0x7b2b41[_0xd539('0x21')];var _0x41fb1e=_0x30aea1?0x0:_0x23bce1[_0xd539('0x1e')];var _0x99327a=_0x30aea1?_0x7b2b41[_0xd539('0x21')]:_0x23bce1[_0xd539('0x1e')]+_0x23bce1[_0xd539('0x20')];var _0x1714cf;if(_0x99327a>=_0x54d8ff){_0x99327a=_0x54d8ff;_0x1714cf=0xc8;}else{_0x1714cf=0xce;}_0x3f402e['status'](_0x1714cf);return _0x3f402e['set'](_0xd539('0x22'),_0x41fb1e+'-'+_0x99327a+'/'+_0x54d8ff)[_0xd539('0x1d')](_0x7b2b41);}return null;};}function patchUpdates(_0x3edf97){return function(_0xad186e){try{jsonpatch['apply'](_0xad186e,_0x3edf97,!![]);}catch(_0x91917b){return BPromise[_0xd539('0x23')](_0x91917b);}return _0xad186e[_0xd539('0x24')]();};}function saveUpdates(_0x259dde,_0x11c993){return function(_0x13445e){if(_0x13445e){return _0x13445e[_0xd539('0x25')](_0x259dde)[_0xd539('0x26')](function(_0x349610){return _0x349610;});}return null;};}function removeEntity(_0x56c100,_0x28d376){return function(_0x57789d){if(_0x57789d){return _0x57789d[_0xd539('0x27')]()['then'](function(){_0x56c100['status'](0xcc)[_0xd539('0x1c')]();});}};}function handleEntityNotFound(_0xfd3352,_0x1280c2){return function(_0xc1789e){if(!_0xc1789e){_0xfd3352['sendStatus'](0x194);}return _0xc1789e;};}function handleError(_0x39cef1,_0x495161){_0x495161=_0x495161||0x1f4;return function(_0x1343de){logger[_0xd539('0x28')](_0x1343de[_0xd539('0x29')]);if(_0x1343de[_0xd539('0x2a')]){delete _0x1343de['name'];}_0x39cef1['status'](_0x495161)[_0xd539('0x2b')](_0x1343de);};}exports[_0xd539('0x2c')]=function(_0x4f717b,_0x54b57a){var _0x575b63={},_0xe17d1c={},_0x406710={'count':0x0,'rows':[]};var _0x66b2ab=_[_0xd539('0x2d')](db['JscriptyAnswerReport'][_0xd539('0x2e')],function(_0x2662fe){return{'name':_0x2662fe['fieldName'],'type':_0x2662fe[_0xd539('0x2f')][_0xd539('0x30')]};});_0xe17d1c[_0xd539('0x31')]=_[_0xd539('0x2d')](_0x66b2ab,_0xd539('0x2a'));_0xe17d1c['query']=_[_0xd539('0x32')](_0x4f717b['query']);_0xe17d1c[_0xd539('0x33')]=_['intersection'](_0xe17d1c[_0xd539('0x31')],_0xe17d1c['query']);_0x575b63[_0xd539('0x34')]=_[_0xd539('0x35')](_0xe17d1c[_0xd539('0x31')],qs[_0xd539('0x36')](_0x4f717b[_0xd539('0x37')][_0xd539('0x36')]));_0x575b63[_0xd539('0x34')]=_0x575b63[_0xd539('0x34')][_0xd539('0x38')]?_0x575b63[_0xd539('0x34')]:_0xe17d1c[_0xd539('0x31')];if(!_0x4f717b['query'][_0xd539('0x39')]('nolimit')){_0x575b63[_0xd539('0x20')]=qs[_0xd539('0x20')](_0x4f717b['query'][_0xd539('0x20')]);_0x575b63[_0xd539('0x1e')]=qs['offset'](_0x4f717b['query'][_0xd539('0x1e')]);}_0x575b63[_0xd539('0x3a')]=qs[_0xd539('0x3b')](_0x4f717b[_0xd539('0x37')]['sort']);_0x575b63[_0xd539('0x3c')]=qs[_0xd539('0x33')](_[_0xd539('0x3d')](_0x4f717b[_0xd539('0x37')],_0xe17d1c['filters']),_0x66b2ab);if(_0x4f717b[_0xd539('0x37')][_0xd539('0x3e')]){_0x575b63[_0xd539('0x3c')]=_[_0xd539('0x3f')](_0x575b63[_0xd539('0x3c')],{'$or':_[_0xd539('0x2d')](_0x66b2ab,function(_0x4b5059){if(_0x4b5059['type']!==_0xd539('0x40')){var _0x46eb3f={};_0x46eb3f[_0x4b5059[_0xd539('0x2a')]]={'$like':'%'+_0x4f717b[_0xd539('0x37')]['filter']+'%'};return _0x46eb3f;}})});}_0x575b63=_[_0xd539('0x3f')]({},_0x575b63,_0x4f717b[_0xd539('0x41')]);var _0x14175f={'where':_0x575b63['where']};return db[_0xd539('0x42')]['count'](_0x14175f)[_0xd539('0x26')](function(_0x4b44cf){_0x406710[_0xd539('0x21')]=_0x4b44cf;if(_0x4f717b['query']['includeAll']){_0x575b63[_0xd539('0x43')]=[{'all':!![]}];}return db[_0xd539('0x42')][_0xd539('0x44')](_0x575b63);})[_0xd539('0x26')](function(_0x1917c4){_0x406710[_0xd539('0x45')]=_0x1917c4;return _0x406710;})['then'](respondWithFilteredResult(_0x54b57a,_0x575b63))[_0xd539('0x46')](handleError(_0x54b57a,null));};exports[_0xd539('0x47')]=function(_0x24d43,_0x5d1d2c){var _0x3e9320={'raw':!![],'where':{'id':_0x24d43['params']['id']}},_0x53ea3f={};_0x53ea3f[_0xd539('0x31')]=_[_0xd539('0x32')](db[_0xd539('0x42')][_0xd539('0x2e')]);_0x53ea3f['query']=_[_0xd539('0x32')](_0x24d43[_0xd539('0x37')]);_0x53ea3f[_0xd539('0x33')]=_[_0xd539('0x35')](_0x53ea3f['model'],_0x53ea3f[_0xd539('0x37')]);_0x3e9320[_0xd539('0x34')]=_['intersection'](_0x53ea3f[_0xd539('0x31')],qs[_0xd539('0x36')](_0x24d43[_0xd539('0x37')][_0xd539('0x36')]));_0x3e9320['attributes']=_0x3e9320[_0xd539('0x34')][_0xd539('0x38')]?_0x3e9320[_0xd539('0x34')]:_0x53ea3f[_0xd539('0x31')];if(_0x24d43[_0xd539('0x37')][_0xd539('0x48')]){_0x3e9320[_0xd539('0x43')]=[{'all':!![]}];}_0x3e9320=_[_0xd539('0x3f')]({},_0x3e9320,_0x24d43[_0xd539('0x41')]);return db[_0xd539('0x42')]['find'](_0x3e9320)[_0xd539('0x26')](handleEntityNotFound(_0x5d1d2c,null))[_0xd539('0x26')](respondWithResult(_0x5d1d2c,null))[_0xd539('0x46')](handleError(_0x5d1d2c,null));};exports[_0xd539('0x49')]=function(_0x4f72f7,_0x3c5e1a){return db[_0xd539('0x42')][_0xd539('0x49')](_0x4f72f7[_0xd539('0x4a')],{})[_0xd539('0x26')](respondWithResult(_0x3c5e1a,0xc9))[_0xd539('0x46')](handleError(_0x3c5e1a,null));};exports[_0xd539('0x25')]=function(_0x5e1051,_0x2e47ed){if(_0x5e1051[_0xd539('0x4a')]['id']){delete _0x5e1051[_0xd539('0x4a')]['id'];}return db[_0xd539('0x42')][_0xd539('0x4b')]({'where':{'id':_0x5e1051[_0xd539('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e47ed,null))[_0xd539('0x26')](saveUpdates(_0x5e1051[_0xd539('0x4a')],null))['then'](respondWithResult(_0x2e47ed,null))['catch'](handleError(_0x2e47ed,null));};exports[_0xd539('0x27')]=function(_0x735b36,_0x5caf42){return db[_0xd539('0x42')][_0xd539('0x4b')]({'where':{'id':_0x735b36[_0xd539('0x4c')]['id']}})[_0xd539('0x26')](handleEntityNotFound(_0x5caf42,null))['then'](removeEntity(_0x5caf42,null))[_0xd539('0x46')](handleError(_0x5caf42,null));};exports[_0xd539('0x4d')]=function(_0x2965df,_0x2b794c){return db['JscriptyAnswerReport'][_0xd539('0x4d')]()[_0xd539('0x26')](respondWithResult(_0x2b794c,null))[_0xd539('0x46')](handleError(_0x2b794c,null));}; \ No newline at end of file +var _0x37a7=['name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','attributes','fields','find','catch','create','body','destroy','describe','eml-format','rimraf','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error','stack'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x37a7,0x6f));var _0x737a=function(_0x5184d9,_0x5d90b6){_0x5184d9=_0x5184d9-0x0;var _0x1639b6=_0x37a7[_0x5184d9];return _0x1639b6;};'use strict';var emlformat=require(_0x737a('0x0'));var rimraf=require(_0x737a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x737a('0x2'));var BPromise=require(_0x737a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x737a('0x4'));var csv=require(_0x737a('0x5'));var ejs=require(_0x737a('0x6'));var fs=require('fs');var fs_extra=require(_0x737a('0x7'));var _=require(_0x737a('0x8'));var squel=require('squel');var crypto=require(_0x737a('0x9'));var jsforce=require(_0x737a('0xa'));var deskjs=require(_0x737a('0xb'));var toCsv=require(_0x737a('0x5'));var querystring=require('querystring');var Papa=require(_0x737a('0xc'));var Redis=require(_0x737a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x737a('0xe'));var as=require(_0x737a('0xf'));var hardwareService=require(_0x737a('0x10'));var logger=require(_0x737a('0x11'))(_0x737a('0x12'));var utils=require(_0x737a('0x13'));var config=require(_0x737a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x737a('0x15'))['db'];function respondWithStatusCode(_0x22cc58,_0x2c4e57){_0x2c4e57=_0x2c4e57||0xcc;return function(_0x202575){if(_0x202575){return _0x22cc58[_0x737a('0x16')](_0x2c4e57);}return _0x22cc58[_0x737a('0x17')](_0x2c4e57)[_0x737a('0x18')]();};}function respondWithResult(_0x216a1d,_0x59b844){_0x59b844=_0x59b844||0xc8;return function(_0x449a00){if(_0x449a00){return _0x216a1d[_0x737a('0x17')](_0x59b844)['json'](_0x449a00);}};}function respondWithFilteredResult(_0x597c9d,_0xbf359e){return function(_0x37fc59){if(_0x37fc59){var _0x64901f=typeof _0xbf359e[_0x737a('0x19')]===_0x737a('0x1a')&&typeof _0xbf359e[_0x737a('0x1b')]==='undefined';var _0x369f2f=_0x37fc59['count'];var _0x30344f=_0x64901f?0x0:_0xbf359e[_0x737a('0x19')];var _0x58fb1f=_0x64901f?_0x37fc59[_0x737a('0x1c')]:_0xbf359e['offset']+_0xbf359e['limit'];var _0x3bf493;if(_0x58fb1f>=_0x369f2f){_0x58fb1f=_0x369f2f;_0x3bf493=0xc8;}else{_0x3bf493=0xce;}_0x597c9d[_0x737a('0x17')](_0x3bf493);return _0x597c9d['set'](_0x737a('0x1d'),_0x30344f+'-'+_0x58fb1f+'/'+_0x369f2f)[_0x737a('0x1e')](_0x37fc59);}return null;};}function patchUpdates(_0x8d8378){return function(_0x5d8e46){try{jsonpatch[_0x737a('0x1f')](_0x5d8e46,_0x8d8378,!![]);}catch(_0x4ac430){return BPromise[_0x737a('0x20')](_0x4ac430);}return _0x5d8e46['save']();};}function saveUpdates(_0x28a36e,_0x21d412){return function(_0x1e801d){if(_0x1e801d){return _0x1e801d[_0x737a('0x21')](_0x28a36e)[_0x737a('0x22')](function(_0xd334c0){return _0xd334c0;});}return null;};}function removeEntity(_0x1979e9,_0x379439){return function(_0x4deb7c){if(_0x4deb7c){return _0x4deb7c['destroy']()[_0x737a('0x22')](function(){_0x1979e9['status'](0xcc)[_0x737a('0x18')]();});}};}function handleEntityNotFound(_0x55c901,_0x23d112){return function(_0x1d1642){if(!_0x1d1642){_0x55c901[_0x737a('0x16')](0x194);}return _0x1d1642;};}function handleError(_0x417033,_0x43f395){_0x43f395=_0x43f395||0x1f4;return function(_0x49a1d3){logger[_0x737a('0x23')](_0x49a1d3[_0x737a('0x24')]);if(_0x49a1d3[_0x737a('0x25')]){delete _0x49a1d3[_0x737a('0x25')];}_0x417033[_0x737a('0x17')](_0x43f395)[_0x737a('0x26')](_0x49a1d3);};}exports[_0x737a('0x27')]=function(_0x5a3590,_0x1e2e4c){var _0x15a81c={},_0x2e2a20={},_0x34d20e={'count':0x0,'rows':[]};var _0x22c841=_['map'](db[_0x737a('0x28')][_0x737a('0x29')],function(_0x4115c5){return{'name':_0x4115c5[_0x737a('0x2a')],'type':_0x4115c5['type'][_0x737a('0x2b')]};});_0x2e2a20[_0x737a('0x2c')]=_[_0x737a('0x2d')](_0x22c841,_0x737a('0x25'));_0x2e2a20[_0x737a('0x2e')]=_[_0x737a('0x2f')](_0x5a3590[_0x737a('0x2e')]);_0x2e2a20[_0x737a('0x30')]=_[_0x737a('0x31')](_0x2e2a20[_0x737a('0x2c')],_0x2e2a20['query']);_0x15a81c['attributes']=_['intersection'](_0x2e2a20[_0x737a('0x2c')],qs['fields'](_0x5a3590['query']['fields']));_0x15a81c['attributes']=_0x15a81c['attributes'][_0x737a('0x32')]?_0x15a81c['attributes']:_0x2e2a20['model'];if(!_0x5a3590[_0x737a('0x2e')][_0x737a('0x33')](_0x737a('0x34'))){_0x15a81c[_0x737a('0x1b')]=qs[_0x737a('0x1b')](_0x5a3590[_0x737a('0x2e')][_0x737a('0x1b')]);_0x15a81c[_0x737a('0x19')]=qs[_0x737a('0x19')](_0x5a3590[_0x737a('0x2e')][_0x737a('0x19')]);}_0x15a81c[_0x737a('0x35')]=qs[_0x737a('0x36')](_0x5a3590[_0x737a('0x2e')][_0x737a('0x36')]);_0x15a81c[_0x737a('0x37')]=qs['filters'](_[_0x737a('0x38')](_0x5a3590[_0x737a('0x2e')],_0x2e2a20[_0x737a('0x30')]),_0x22c841);if(_0x5a3590[_0x737a('0x2e')][_0x737a('0x39')]){_0x15a81c['where']=_[_0x737a('0x3a')](_0x15a81c[_0x737a('0x37')],{'$or':_[_0x737a('0x2d')](_0x22c841,function(_0x5d2c04){if(_0x5d2c04['type']!==_0x737a('0x3b')){var _0xc62b6b={};_0xc62b6b[_0x5d2c04['name']]={'$like':'%'+_0x5a3590[_0x737a('0x2e')][_0x737a('0x39')]+'%'};return _0xc62b6b;}})});}_0x15a81c=_[_0x737a('0x3a')]({},_0x15a81c,_0x5a3590[_0x737a('0x3c')]);var _0x3b47db={'where':_0x15a81c['where']};return db[_0x737a('0x28')][_0x737a('0x1c')](_0x3b47db)[_0x737a('0x22')](function(_0x3f3f22){_0x34d20e['count']=_0x3f3f22;if(_0x5a3590[_0x737a('0x2e')][_0x737a('0x3d')]){_0x15a81c[_0x737a('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x15a81c);})[_0x737a('0x22')](function(_0x43a939){_0x34d20e[_0x737a('0x3f')]=_0x43a939;return _0x34d20e;})[_0x737a('0x22')](respondWithFilteredResult(_0x1e2e4c,_0x15a81c))['catch'](handleError(_0x1e2e4c,null));};exports[_0x737a('0x40')]=function(_0x45e818,_0x3d2f9e){var _0x451598={'raw':!![],'where':{'id':_0x45e818[_0x737a('0x41')]['id']}},_0xca416f={};_0xca416f['model']=_[_0x737a('0x2f')](db['JscriptyAnswerReport']['rawAttributes']);_0xca416f[_0x737a('0x2e')]=_[_0x737a('0x2f')](_0x45e818[_0x737a('0x2e')]);_0xca416f[_0x737a('0x30')]=_['intersection'](_0xca416f['model'],_0xca416f[_0x737a('0x2e')]);_0x451598[_0x737a('0x42')]=_[_0x737a('0x31')](_0xca416f['model'],qs[_0x737a('0x43')](_0x45e818[_0x737a('0x2e')][_0x737a('0x43')]));_0x451598[_0x737a('0x42')]=_0x451598[_0x737a('0x42')][_0x737a('0x32')]?_0x451598[_0x737a('0x42')]:_0xca416f[_0x737a('0x2c')];if(_0x45e818[_0x737a('0x2e')][_0x737a('0x3d')]){_0x451598[_0x737a('0x3e')]=[{'all':!![]}];}_0x451598=_[_0x737a('0x3a')]({},_0x451598,_0x45e818[_0x737a('0x3c')]);return db[_0x737a('0x28')][_0x737a('0x44')](_0x451598)[_0x737a('0x22')](handleEntityNotFound(_0x3d2f9e,null))[_0x737a('0x22')](respondWithResult(_0x3d2f9e,null))[_0x737a('0x45')](handleError(_0x3d2f9e,null));};exports['create']=function(_0x1f3810,_0x1102cf){return db[_0x737a('0x28')][_0x737a('0x46')](_0x1f3810['body'],{})[_0x737a('0x22')](respondWithResult(_0x1102cf,0xc9))[_0x737a('0x45')](handleError(_0x1102cf,null));};exports[_0x737a('0x21')]=function(_0xd91856,_0x3f9b66){if(_0xd91856[_0x737a('0x47')]['id']){delete _0xd91856[_0x737a('0x47')]['id'];}return db[_0x737a('0x28')]['find']({'where':{'id':_0xd91856[_0x737a('0x41')]['id']}})[_0x737a('0x22')](handleEntityNotFound(_0x3f9b66,null))[_0x737a('0x22')](saveUpdates(_0xd91856[_0x737a('0x47')],null))[_0x737a('0x22')](respondWithResult(_0x3f9b66,null))['catch'](handleError(_0x3f9b66,null));};exports[_0x737a('0x48')]=function(_0x13d85d,_0x2ec643){return db[_0x737a('0x28')][_0x737a('0x44')]({'where':{'id':_0x13d85d[_0x737a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ec643,null))[_0x737a('0x22')](removeEntity(_0x2ec643,null))['catch'](handleError(_0x2ec643,null));};exports[_0x737a('0x49')]=function(_0x3a0a08,_0x1d213c){return db[_0x737a('0x28')][_0x737a('0x49')]()['then'](respondWithResult(_0x1d213c,null))[_0x737a('0x45')](handleError(_0x1d213c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 74bee39..4473d34 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 _0xa099=['moment','bluebird','request-promise','path','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x58f00c,_0x46fe69){var _0x1799a2=function(_0xbab610){while(--_0xbab610){_0x58f00c['push'](_0x58f00c['shift']());}};_0x1799a2(++_0x46fe69);}(_0xa099,0x1b0));var _0x9a09=function(_0x127cf5,_0x13ac2c){_0x127cf5=_0x127cf5-0x0;var _0x3e87a9=_0xa099[_0x127cf5];return _0x3e87a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9a09('0x0'));var BPromise=require(_0x9a09('0x1'));var rp=require(_0x9a09('0x2'));var fs=require('fs');var path=require(_0x9a09('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9a09('0x4'));module[_0x9a09('0x5')]=function(_0x46080b,_0x46ab2f){return _0x46080b['define'](_0x9a09('0x6'),attributes,{'tableName':_0x9a09('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7569=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports'];(function(_0x5d5062,_0x4c7226){var _0x3e2ad1=function(_0x5ce243){while(--_0x5ce243){_0x5d5062['push'](_0x5d5062['shift']());}};_0x3e2ad1(++_0x4c7226);}(_0x7569,0x71));var _0x9756=function(_0x1a2b2f,_0x2e58cb){_0x1a2b2f=_0x1a2b2f-0x0;var _0x48cf5b=_0x7569[_0x1a2b2f];return _0x48cf5b;};'use strict';var _=require(_0x9756('0x0'));var util=require(_0x9756('0x1'));var logger=require(_0x9756('0x2'))('api');var moment=require(_0x9756('0x3'));var BPromise=require('bluebird');var rp=require(_0x9756('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9756('0x5'));var config=require('../../config/environment');var attributes=require(_0x9756('0x6'));module[_0x9756('0x7')]=function(_0x27df9f,_0x48a91d){return _0x27df9f[_0x9756('0x8')](_0x9756('0x9'),attributes,{'tableName':_0x9756('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 026dc32..7912a75 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 _0x5cb7=['stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13bea4,_0x4b8794){var _0x455c01=function(_0x5a3771){while(--_0x5a3771){_0x13bea4['push'](_0x13bea4['shift']());}};_0x455c01(++_0x4b8794);}(_0x5cb7,0xad));var _0x75cb=function(_0x5c819c,_0x40b7df){_0x5c819c=_0x5c819c-0x0;var _0xe81dd4=_0x5cb7[_0x5c819c];return _0xe81dd4;};'use strict';var _=require(_0x75cb('0x0'));var util=require('util');var moment=require(_0x75cb('0x1'));var BPromise=require('bluebird');var rs=require(_0x75cb('0x2'));var fs=require('fs');var Redis=require(_0x75cb('0x3'));var db=require(_0x75cb('0x4'))['db'];var utils=require(_0x75cb('0x5'));var logger=require(_0x75cb('0x6'))(_0x75cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x75cb('0x8'));var client=jayson[_0x75cb('0x9')][_0x75cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93679e,_0x4f2c35,_0x316750){return new BPromise(function(_0x13b6d0,_0x39dd6b){return client['request'](_0x93679e,_0x316750)['then'](function(_0x34a044){logger[_0x75cb('0xb')](_0x75cb('0xc'),_0x4f2c35,'request\x20sent');logger[_0x75cb('0xd')](_0x75cb('0xe'),_0x4f2c35,_0x75cb('0xf'),JSON[_0x75cb('0x10')](_0x34a044));if(_0x34a044[_0x75cb('0x11')]){if(_0x34a044['error'][_0x75cb('0x12')]===0x1f4){logger['error'](_0x75cb('0xc'),_0x4f2c35,_0x34a044[_0x75cb('0x11')]['message']);return _0x39dd6b(_0x34a044['error']['message']);}logger['error'](_0x75cb('0xc'),_0x4f2c35,_0x34a044[_0x75cb('0x11')][_0x75cb('0x13')]);return _0x13b6d0(_0x34a044[_0x75cb('0x11')]['message']);}else{logger[_0x75cb('0xb')](_0x75cb('0xc'),_0x4f2c35,_0x75cb('0xf'));_0x13b6d0(_0x34a044['result'][_0x75cb('0x13')]);}})[_0x75cb('0x14')](function(_0x2084db){logger[_0x75cb('0x11')](_0x75cb('0xc'),_0x4f2c35,_0x2084db);_0x39dd6b(_0x2084db);});});} \ No newline at end of file +var _0x93aa=['error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1be178,_0x3bf9ab){var _0x37e2d0=function(_0x545e92){while(--_0x545e92){_0x1be178['push'](_0x1be178['shift']());}};_0x37e2d0(++_0x3bf9ab);}(_0x93aa,0x1b7));var _0xa93a=function(_0x1be714,_0x38f376){_0x1be714=_0x1be714-0x0;var _0x3f2739=_0x93aa[_0x1be714];return _0x3f2739;};'use strict';var _=require(_0xa93a('0x0'));var util=require(_0xa93a('0x1'));var moment=require(_0xa93a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa93a('0x3'));var fs=require('fs');var Redis=require(_0xa93a('0x4'));var db=require(_0xa93a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa93a('0x6'));var config=require(_0xa93a('0x7'));var jayson=require(_0xa93a('0x8'));var client=jayson[_0xa93a('0x9')][_0xa93a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bee0d,_0x2ba7e2,_0xa5e468){return new BPromise(function(_0x4eda60,_0x554e24){return client[_0xa93a('0xb')](_0x5bee0d,_0xa5e468)[_0xa93a('0xc')](function(_0x4fe1c3){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0xa93a('0xd'));logger[_0xa93a('0xe')](_0xa93a('0xf'),_0x2ba7e2,_0xa93a('0xd'),JSON[_0xa93a('0x10')](_0x4fe1c3));if(_0x4fe1c3[_0xa93a('0x11')]){if(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x12')]===0x1f4){logger[_0xa93a('0x11')](_0xa93a('0x13'),_0x2ba7e2,_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);return _0x554e24(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);}logger[_0xa93a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0x4fe1c3['error'][_0xa93a('0x14')]);return _0x4eda60(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);}else{logger[_0xa93a('0x15')](_0xa93a('0x13'),_0x2ba7e2,_0xa93a('0xd'));_0x4eda60(_0x4fe1c3[_0xa93a('0x16')]['message']);}})[_0xa93a('0x17')](function(_0x44fa67){logger[_0xa93a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0x44fa67);_0x554e24(_0x44fa67);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b9cf9da..8c0aea8 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 _0x6340=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer'];(function(_0x4e7d69,_0x52aba3){var _0x4e54b3=function(_0x4a2f9f){while(--_0x4a2f9f){_0x4e7d69['push'](_0x4e7d69['shift']());}};_0x4e54b3(++_0x52aba3);}(_0x6340,0x1ed));var _0x0634=function(_0x35e31e,_0x2a70a7){_0x35e31e=_0x35e31e-0x0;var _0x281b37=_0x6340[_0x35e31e];return _0x281b37;};'use strict';var multer=require(_0x0634('0x0'));var util=require(_0x0634('0x1'));var path=require(_0x0634('0x2'));var timeout=require(_0x0634('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0634('0x4'));var interaction=require(_0x0634('0x5'));var config=require('../../config/environment');var controller=require(_0x0634('0x6'));router['get']('/',auth[_0x0634('0x7')](),controller[_0x0634('0x8')]);router[_0x0634('0x9')](_0x0634('0xa'),auth[_0x0634('0x7')](),controller[_0x0634('0xb')]);router['get'](_0x0634('0xc'),auth[_0x0634('0x7')](),controller[_0x0634('0xd')]);router[_0x0634('0x9')]('/:id/answers',auth[_0x0634('0x7')](),controller['getAnswers']);router[_0x0634('0x9')](_0x0634('0xe'),auth[_0x0634('0x7')](),timeout(_0x0634('0xf')),controller[_0x0634('0x10')]);router[_0x0634('0x11')]('/',auth['isAuthenticated'](),controller[_0x0634('0x12')]);router[_0x0634('0x11')](_0x0634('0x13'),auth[_0x0634('0x7')](),controller[_0x0634('0x14')]);router[_0x0634('0x15')]('/:id',auth[_0x0634('0x7')](),controller[_0x0634('0x16')]);router[_0x0634('0x17')]('/:id',auth[_0x0634('0x7')](),controller[_0x0634('0x18')]);module[_0x0634('0x19')]=router; \ No newline at end of file +var _0x8dfe=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','/:id/sessions','getAnswers','30s','getSummary','post','clone','put','/:id','update','delete'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8dfe,0x151));var _0xe8df=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8dfe[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xe8df('0x0'));var util=require(_0xe8df('0x1'));var path=require('path');var timeout=require(_0xe8df('0x2'));var express=require(_0xe8df('0x3'));var router=express[_0xe8df('0x4')]();var fs_extra=require(_0xe8df('0x5'));var auth=require(_0xe8df('0x6'));var interaction=require(_0xe8df('0x7'));var config=require(_0xe8df('0x8'));var controller=require(_0xe8df('0x9'));router[_0xe8df('0xa')]('/',auth['isAuthenticated'](),controller[_0xe8df('0xb')]);router[_0xe8df('0xa')]('/:id',auth[_0xe8df('0xc')](),controller['show']);router['get'](_0xe8df('0xd'),auth[_0xe8df('0xc')](),controller['getSessions']);router['get']('/:id/answers',auth[_0xe8df('0xc')](),controller[_0xe8df('0xe')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0xe8df('0xf')),controller[_0xe8df('0x10')]);router[_0xe8df('0x11')]('/',auth[_0xe8df('0xc')](),controller['create']);router[_0xe8df('0x11')]('/:id/clone',auth[_0xe8df('0xc')](),controller[_0xe8df('0x12')]);router[_0xe8df('0x13')](_0xe8df('0x14'),auth[_0xe8df('0xc')](),controller[_0xe8df('0x15')]);router[_0xe8df('0x16')](_0xe8df('0x14'),auth[_0xe8df('0xc')](),controller['destroy']);module[_0xe8df('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index ee98405..38448ed 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 _0xef60=['long','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','STRING'];(function(_0x4b9a8d,_0x2e2c16){var _0x35f6dc=function(_0xf06588){while(--_0xf06588){_0x4b9a8d['push'](_0x4b9a8d['shift']());}};_0x35f6dc(++_0x2e2c16);}(_0xef60,0xfb));var _0x0ef6=function(_0x38682a,_0xb4df5b){_0x38682a=_0x38682a-0x0;var _0x2be5ba=_0xef60[_0x38682a];return _0x2be5ba;};'use strict';var Sequelize=require(_0x0ef6('0x0'));var _=require(_0x0ef6('0x1'));var util=require(_0x0ef6('0x2'));module['exports']={'name':{'type':Sequelize[_0x0ef6('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x0ef6('0x4')),'set':function(_0x4a5713){if(_[_0x0ef6('0x5')](_0x4a5713)){this[_0x0ef6('0x6')](_0x0ef6('0x7'),JSON[_0x0ef6('0x8')](_0x4a5713));}else if(_['isString'](_0x4a5713)){this[_0x0ef6('0x6')](_0x0ef6('0x7'),_0x4a5713);}else{this['setDataValue'](_0x0ef6('0x7'),util[_0x0ef6('0x9')](_0x0ef6('0xa'),this[_0x0ef6('0xb')](_0x0ef6('0xc'))||'',this[_0x0ef6('0xb')](_0x0ef6('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0ef6('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0ef6('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x16fd=['TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','lodash','util','STRING','name'];(function(_0x21d0e6,_0x5a7aa6){var _0x1cc2d1=function(_0x25ded8){while(--_0x25ded8){_0x21d0e6['push'](_0x21d0e6['shift']());}};_0x1cc2d1(++_0x5a7aa6);}(_0x16fd,0x114));var _0xd16f=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x16fd[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd16f('0x0'));var util=require(_0xd16f('0x1'));module['exports']={'name':{'type':Sequelize[_0xd16f('0x2')],'unique':_0xd16f('0x3')},'description':{'type':Sequelize[_0xd16f('0x2')]},'formData':{'type':Sequelize[_0xd16f('0x4')](_0xd16f('0x5')),'set':function(_0x227935){if(_[_0xd16f('0x6')](_0x227935)){this[_0xd16f('0x7')](_0xd16f('0x8'),JSON[_0xd16f('0x9')](_0x227935));}else if(_[_0xd16f('0xa')](_0x227935)){this[_0xd16f('0x7')](_0xd16f('0x8'),_0x227935);}else{this[_0xd16f('0x7')](_0xd16f('0x8'),util[_0xd16f('0xb')](_0xd16f('0xc'),this['getDataValue']('name')||'',this['getDataValue'](_0xd16f('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index bf7a9ce..6412906 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 _0x3a15=['eml-format','zip-dir','request-promise','moment','bluebird','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','getSessions','findOne','pick','JscriptySessionReport','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv'];(function(_0x245414,_0x43ef76){var _0x221637=function(_0x5e8ac7){while(--_0x5e8ac7){_0x245414['push'](_0x245414['shift']());}};_0x221637(++_0x43ef76);}(_0x3a15,0xde));var _0x53a1=function(_0x2f648a,_0x3764c7){_0x2f648a=_0x2f648a-0x0;var _0x1240b9=_0x3a15[_0x2f648a];return _0x1240b9;};'use strict';var emlformat=require(_0x53a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53a1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53a1('0x2'));var moment=require(_0x53a1('0x3'));var BPromise=require(_0x53a1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53a1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53a1('0x6'));var _=require('lodash');var squel=require(_0x53a1('0x7'));var crypto=require(_0x53a1('0x8'));var jsforce=require(_0x53a1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x53a1('0xa'));var querystring=require(_0x53a1('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x53a1('0xc'));var as=require(_0x53a1('0xd'));var hardwareService=require(_0x53a1('0xe'));var logger=require(_0x53a1('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x53a1('0x10'));var db=require(_0x53a1('0x11'))['db'];function respondWithStatusCode(_0x50cd84,_0x1a89e9){_0x1a89e9=_0x1a89e9||0xcc;return function(_0x17d23b){if(_0x17d23b){return _0x50cd84[_0x53a1('0x12')](_0x1a89e9);}return _0x50cd84['status'](_0x1a89e9)[_0x53a1('0x13')]();};}function respondWithResult(_0x456144,_0x3d66f5){_0x3d66f5=_0x3d66f5||0xc8;return function(_0x36e275){if(_0x36e275){return _0x456144[_0x53a1('0x14')](_0x3d66f5)[_0x53a1('0x15')](_0x36e275);}};}function respondWithFilteredResult(_0x762aaa,_0x3313fe){return function(_0x474d58){if(_0x474d58){var _0x552306=typeof _0x3313fe[_0x53a1('0x16')]===_0x53a1('0x17')&&typeof _0x3313fe[_0x53a1('0x18')]===_0x53a1('0x17');var _0x153ce9=_0x474d58[_0x53a1('0x19')];var _0x1cb902=_0x552306?0x0:_0x3313fe['offset'];var _0x3c7bed=_0x552306?_0x474d58['count']:_0x3313fe[_0x53a1('0x16')]+_0x3313fe[_0x53a1('0x18')];var _0x6f21f7;if(_0x3c7bed>=_0x153ce9){_0x3c7bed=_0x153ce9;_0x6f21f7=0xc8;}else{_0x6f21f7=0xce;}_0x762aaa[_0x53a1('0x14')](_0x6f21f7);return _0x762aaa[_0x53a1('0x1a')](_0x53a1('0x1b'),_0x1cb902+'-'+_0x3c7bed+'/'+_0x153ce9)['json'](_0x474d58);}return null;};}function patchUpdates(_0x16916f){return function(_0x167671){try{jsonpatch['apply'](_0x167671,_0x16916f,!![]);}catch(_0xcea683){return BPromise[_0x53a1('0x1c')](_0xcea683);}return _0x167671['save']();};}function saveUpdates(_0x2f0f7e,_0x11253c){return function(_0x5173a3){if(_0x5173a3){return _0x5173a3[_0x53a1('0x1d')](_0x2f0f7e)[_0x53a1('0x1e')](function(_0x5f4135){return _0x5f4135;});}return null;};}function removeEntity(_0x1140a0,_0x1a4dab){return function(_0x471e34){if(_0x471e34){return _0x471e34[_0x53a1('0x1f')]()['then'](function(){var _0x3fd2d6=_0x471e34[_0x53a1('0x20')]({'plain':!![]});var _0x2a71f1=_0x53a1('0x21');return db[_0x53a1('0x22')][_0x53a1('0x1f')]({'where':{'type':_0x2a71f1,'resourceId':_0x3fd2d6['id']}})['then'](function(){return _0x471e34;});})[_0x53a1('0x1e')](function(){_0x1140a0[_0x53a1('0x14')](0xcc)[_0x53a1('0x13')]();});}};}function handleEntityNotFound(_0x94b6bf,_0x348d5f){return function(_0x13f870){if(!_0x13f870){_0x94b6bf[_0x53a1('0x12')](0x194);}return _0x13f870;};}function handleError(_0x477780,_0x322baf){_0x322baf=_0x322baf||0x1f4;return function(_0x162bd1){logger[_0x53a1('0x23')](_0x162bd1[_0x53a1('0x24')]);if(_0x162bd1['name']){delete _0x162bd1[_0x53a1('0x25')];}_0x477780[_0x53a1('0x14')](_0x322baf)[_0x53a1('0x26')](_0x162bd1);};}exports[_0x53a1('0x27')]=function(_0x442165,_0x2da6b5){var _0x2271d7={},_0x4e10ff={},_0x5aba04={'count':0x0,'rows':[]};var _0x1ecc56=_[_0x53a1('0x28')](db[_0x53a1('0x29')][_0x53a1('0x2a')],function(_0x116f82){return{'name':_0x116f82[_0x53a1('0x2b')],'type':_0x116f82['type']['key']};});_0x4e10ff[_0x53a1('0x2c')]=_[_0x53a1('0x28')](_0x1ecc56,_0x53a1('0x25'));_0x4e10ff[_0x53a1('0x2d')]=_[_0x53a1('0x2e')](_0x442165[_0x53a1('0x2d')]);_0x4e10ff[_0x53a1('0x2f')]=_[_0x53a1('0x30')](_0x4e10ff[_0x53a1('0x2c')],_0x4e10ff['query']);_0x2271d7['attributes']=_[_0x53a1('0x30')](_0x4e10ff[_0x53a1('0x2c')],qs[_0x53a1('0x31')](_0x442165['query'][_0x53a1('0x31')]));_0x2271d7[_0x53a1('0x32')]=_0x2271d7[_0x53a1('0x32')][_0x53a1('0x33')]?_0x2271d7[_0x53a1('0x32')]:_0x4e10ff[_0x53a1('0x2c')];if(!_0x442165['query'][_0x53a1('0x34')](_0x53a1('0x35'))){_0x2271d7[_0x53a1('0x18')]=qs[_0x53a1('0x18')](_0x442165['query'][_0x53a1('0x18')]);_0x2271d7['offset']=qs[_0x53a1('0x16')](_0x442165[_0x53a1('0x2d')][_0x53a1('0x16')]);}_0x2271d7[_0x53a1('0x36')]=qs[_0x53a1('0x37')](_0x442165[_0x53a1('0x2d')][_0x53a1('0x37')]);_0x2271d7[_0x53a1('0x38')]=qs[_0x53a1('0x2f')](_['pick'](_0x442165[_0x53a1('0x2d')],_0x4e10ff[_0x53a1('0x2f')]),_0x1ecc56);if(_0x442165[_0x53a1('0x2d')][_0x53a1('0x39')]){_0x2271d7[_0x53a1('0x38')]=_['merge'](_0x2271d7[_0x53a1('0x38')],{'$or':_[_0x53a1('0x28')](_0x1ecc56,function(_0x15014a){if(_0x15014a[_0x53a1('0x3a')]!==_0x53a1('0x3b')){var _0x5a849f={};_0x5a849f[_0x15014a['name']]={'$like':'%'+_0x442165[_0x53a1('0x2d')][_0x53a1('0x39')]+'%'};return _0x5a849f;}})});}_0x2271d7=_[_0x53a1('0x3c')]({},_0x2271d7,_0x442165[_0x53a1('0x3d')]);var _0x59aac4={'where':_0x2271d7['where']};return db['JscriptyProject'][_0x53a1('0x19')](_0x59aac4)[_0x53a1('0x1e')](function(_0x45fb6d){_0x5aba04[_0x53a1('0x19')]=_0x45fb6d;if(_0x442165['query'][_0x53a1('0x3e')]){_0x2271d7['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x53a1('0x3f')](_0x2271d7);})['then'](function(_0x2e8242){_0x5aba04[_0x53a1('0x40')]=_0x2e8242;return _0x5aba04;})['then'](respondWithFilteredResult(_0x2da6b5,_0x2271d7))[_0x53a1('0x41')](handleError(_0x2da6b5,null));};exports['show']=function(_0x2c4208,_0x5ee031){var _0x308f91={'raw':![],'where':{'id':_0x2c4208['params']['id']}},_0x4ad64a={};_0x4ad64a[_0x53a1('0x2c')]=_['keys'](db['JscriptyProject'][_0x53a1('0x2a')]);_0x4ad64a[_0x53a1('0x2d')]=_[_0x53a1('0x2e')](_0x2c4208['query']);_0x4ad64a[_0x53a1('0x2f')]=_[_0x53a1('0x30')](_0x4ad64a[_0x53a1('0x2c')],_0x4ad64a[_0x53a1('0x2d')]);_0x308f91[_0x53a1('0x32')]=_['intersection'](_0x4ad64a[_0x53a1('0x2c')],qs[_0x53a1('0x31')](_0x2c4208['query'][_0x53a1('0x31')]));_0x308f91[_0x53a1('0x32')]=_0x308f91[_0x53a1('0x32')][_0x53a1('0x33')]?_0x308f91[_0x53a1('0x32')]:_0x4ad64a['model'];if(_0x2c4208[_0x53a1('0x2d')][_0x53a1('0x3e')]){_0x308f91['include']=[{'all':!![]}];}_0x308f91=_['merge']({},_0x308f91,_0x2c4208[_0x53a1('0x3d')]);return db[_0x53a1('0x29')][_0x53a1('0x42')](_0x308f91)[_0x53a1('0x1e')](handleEntityNotFound(_0x5ee031,null))[_0x53a1('0x1e')](respondWithResult(_0x5ee031,null))[_0x53a1('0x41')](handleError(_0x5ee031,null));};exports[_0x53a1('0x43')]=function(_0x3c4aa3,_0x7dd2ee){return db[_0x53a1('0x29')]['create'](_0x3c4aa3['body'],{})[_0x53a1('0x1e')](function(_0x5ea173){var _0x1d38dc=_0x3c4aa3[_0x53a1('0x44')][_0x53a1('0x20')]({'plain':!![]});if(!_0x1d38dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d38dc[_0x53a1('0x45')]===_0x53a1('0x44')){var _0x455527=_0x5ea173[_0x53a1('0x20')]({'plain':!![]});var _0xe6d7a8='Projects';return db[_0x53a1('0x46')][_0x53a1('0x42')]({'where':{'name':_0xe6d7a8,'userProfileId':_0x1d38dc[_0x53a1('0x47')]},'raw':!![]})[_0x53a1('0x1e')](function(_0x1229bf){if(_0x1229bf&&_0x1229bf[_0x53a1('0x48')]===0x0){return db[_0x53a1('0x22')][_0x53a1('0x43')]({'name':_0x455527['name'],'resourceId':_0x455527['id'],'type':_0x1229bf['name'],'sectionId':_0x1229bf['id']},{})['then'](function(){return _0x5ea173;});}else{return _0x5ea173;}})[_0x53a1('0x41')](function(_0x3d7a69){logger[_0x53a1('0x23')](_0x53a1('0x49'),_0x3d7a69);throw _0x3d7a69;});}return _0x5ea173;})['then'](respondWithResult(_0x7dd2ee,0xc9))[_0x53a1('0x41')](handleError(_0x7dd2ee,null));};exports['clone']=function(_0xcb15df,_0x265ee2){var _0x19e007={'where':{'id':_0xcb15df['params']['id']}},_0x2abc74={};_0x2abc74['model']=_[_0x53a1('0x2e')](db[_0x53a1('0x29')][_0x53a1('0x2a')]);_0x19e007[_0x53a1('0x32')]=_['intersection'](_0x2abc74[_0x53a1('0x2c')],qs[_0x53a1('0x31')](_0xcb15df['query'][_0x53a1('0x31')]));_0x19e007[_0x53a1('0x32')]=_0x19e007[_0x53a1('0x32')][_0x53a1('0x33')]?_0x19e007[_0x53a1('0x32')]:_0x2abc74['model'];if(_0xcb15df[_0x53a1('0x2d')][_0x53a1('0x3e')]){_0x19e007[_0x53a1('0x4a')]=[{'all':!![]}];}_0x19e007=_[_0x53a1('0x3c')]({},_0x19e007,_0xcb15df[_0x53a1('0x3d')]);return db['JscriptyProject'][_0x53a1('0x42')](_0x19e007)[_0x53a1('0x1e')](handleEntityNotFound(_0x265ee2,null))[_0x53a1('0x1e')](function(_0x1624ee){if(_0x1624ee){var _0x9f9f69=_0x1624ee['get']({'plain':!![]});_0x9f9f69=qs['omit'](_0x9f9f69,['id',_0x53a1('0x4b'),_0x53a1('0x4c')]);_0xcb15df[_0x53a1('0x4d')]=_['omit'](_0xcb15df[_0x53a1('0x4d')],['id',_0x53a1('0x4b'),_0x53a1('0x4c')]);return db['JscriptyProject'][_0x53a1('0x43')](_[_0x53a1('0x3c')](_0x9f9f69,_0xcb15df[_0x53a1('0x4d')]),{'include':_0xcb15df[_0x53a1('0x2d')][_0x53a1('0x3e')]?[{'all':!![]}]:undefined})[_0x53a1('0x1e')](function(_0x424947){var _0xa51eb0=_0xcb15df['user']['get']({'plain':!![]});if(!_0xa51eb0)throw new Error(_0x53a1('0x4e'));if(_0xa51eb0[_0x53a1('0x45')]===_0x53a1('0x44')){var _0x1fa942=_0x424947[_0x53a1('0x20')]({'plain':!![]});var _0x57c9d1=_0x53a1('0x21');return db['UserProfileSection'][_0x53a1('0x42')]({'where':{'name':_0x57c9d1,'userProfileId':_0xa51eb0[_0x53a1('0x47')]},'raw':!![]})[_0x53a1('0x1e')](function(_0x25a6b3){if(_0x25a6b3&&_0x25a6b3[_0x53a1('0x48')]===0x0){return db[_0x53a1('0x22')]['create']({'name':_0x1fa942[_0x53a1('0x25')],'resourceId':_0x1fa942['id'],'type':_0x25a6b3[_0x53a1('0x25')],'sectionId':_0x25a6b3['id']},{})[_0x53a1('0x1e')](function(){return _0x424947;});}else{return _0x424947;}})[_0x53a1('0x41')](function(_0x538a6b){logger[_0x53a1('0x23')](_0x53a1('0x49'),_0x538a6b);throw _0x538a6b;});}return _0x424947;});}})['then'](respondWithResult(_0x265ee2,0xc9))['catch'](handleError(_0x265ee2,null));};exports['update']=function(_0x2a4564,_0x6ebb33){if(_0x2a4564['body']['id']){delete _0x2a4564[_0x53a1('0x4d')]['id'];}return db[_0x53a1('0x29')][_0x53a1('0x42')]({'where':{'id':_0x2a4564[_0x53a1('0x4f')]['id']}})[_0x53a1('0x1e')](handleEntityNotFound(_0x6ebb33,null))['then'](saveUpdates(_0x2a4564[_0x53a1('0x4d')],null))[_0x53a1('0x1e')](respondWithResult(_0x6ebb33,null))[_0x53a1('0x41')](handleError(_0x6ebb33,null));};exports[_0x53a1('0x1f')]=function(_0x5c6bbc,_0x25eb4c){return db['JscriptyProject'][_0x53a1('0x42')]({'where':{'id':_0x5c6bbc[_0x53a1('0x4f')]['id']}})[_0x53a1('0x1e')](handleEntityNotFound(_0x25eb4c,null))[_0x53a1('0x1e')](removeEntity(_0x25eb4c,null))[_0x53a1('0x41')](handleError(_0x25eb4c,null));};exports[_0x53a1('0x50')]=function(_0x2d414c,_0x213039,_0x5735ea){var _0x221bbe={'raw':!![],'where':{}};var _0x43af71={};var _0x3a3de5={'count':0x0,'rows':[]};return db[_0x53a1('0x29')][_0x53a1('0x51')]({'where':{'id':_0x2d414c[_0x53a1('0x4f')]['id']}})[_0x53a1('0x1e')](handleEntityNotFound(_0x213039,null))['then'](function(_0x53810c){if(_0x53810c){_0x43af71[_0x53a1('0x2c')]=_[_0x53a1('0x2e')](db['JscriptySessionReport'][_0x53a1('0x2a')]);_0x43af71[_0x53a1('0x2d')]=_[_0x53a1('0x2e')](_0x2d414c[_0x53a1('0x2d')]);_0x43af71[_0x53a1('0x2f')]=_[_0x53a1('0x30')](_0x43af71[_0x53a1('0x2c')],_0x43af71[_0x53a1('0x2d')]);_0x221bbe[_0x53a1('0x32')]=_[_0x53a1('0x30')](_0x43af71[_0x53a1('0x2c')],qs[_0x53a1('0x31')](_0x2d414c['query'][_0x53a1('0x31')]));_0x221bbe[_0x53a1('0x32')]=_0x221bbe[_0x53a1('0x32')][_0x53a1('0x33')]?_0x221bbe[_0x53a1('0x32')]:_0x43af71['model'];if(!_0x2d414c[_0x53a1('0x2d')][_0x53a1('0x34')](_0x53a1('0x35'))){_0x221bbe[_0x53a1('0x18')]=qs[_0x53a1('0x18')](_0x2d414c[_0x53a1('0x2d')]['limit']);_0x221bbe[_0x53a1('0x16')]=qs[_0x53a1('0x16')](_0x2d414c[_0x53a1('0x2d')]['offset']);}_0x221bbe[_0x53a1('0x36')]=qs[_0x53a1('0x37')](_0x2d414c['query'][_0x53a1('0x37')]);_0x221bbe['where']=qs[_0x53a1('0x2f')](_[_0x53a1('0x52')](_0x2d414c[_0x53a1('0x2d')],_0x43af71[_0x53a1('0x2f')]));_0x221bbe['where']['ProjectId']=_0x53810c['id'];if(_0x2d414c[_0x53a1('0x2d')][_0x53a1('0x39')]){_0x221bbe[_0x53a1('0x38')]=_[_0x53a1('0x3c')](_0x221bbe[_0x53a1('0x38')],{'$or':_[_0x53a1('0x28')](_0x221bbe['attributes'],function(_0x563106){var _0x491366={};_0x491366[_0x563106]={'$like':'%'+_0x2d414c[_0x53a1('0x2d')]['filter']+'%'};return _0x491366;})});}_0x221bbe=_['merge']({},_0x221bbe,_0x2d414c[_0x53a1('0x3d')]);return db[_0x53a1('0x53')][_0x53a1('0x19')]({'where':_0x221bbe[_0x53a1('0x38')]})[_0x53a1('0x1e')](function(_0x335c47){_0x3a3de5[_0x53a1('0x19')]=_0x335c47;if(_0x2d414c[_0x53a1('0x2d')][_0x53a1('0x3e')]){_0x221bbe[_0x53a1('0x4a')]=[{'all':!![]}];}return db[_0x53a1('0x53')]['findAll'](_0x221bbe);})['then'](function(_0x38ddaf){_0x3a3de5['rows']=_0x38ddaf;return _0x3a3de5;});}})[_0x53a1('0x1e')](respondWithFilteredResult(_0x213039,_0x221bbe))['catch'](handleError(_0x213039,null));};exports[_0x53a1('0x54')]=function(_0xf95a2a,_0x697910,_0x3d0272){var _0x3b0614={'raw':!![],'where':{}};var _0x53063a={};var _0x512e5b={'count':0x0,'rows':[]};return db[_0x53a1('0x29')][_0x53a1('0x51')]({'where':{'id':_0xf95a2a['params']['id']}})['then'](handleEntityNotFound(_0x697910,null))[_0x53a1('0x1e')](function(_0x2764b6){if(_0x2764b6){_0x53063a['model']=_[_0x53a1('0x2e')](db[_0x53a1('0x55')][_0x53a1('0x2a')]);_0x53063a['query']=_[_0x53a1('0x2e')](_0xf95a2a['query']);_0x53063a[_0x53a1('0x2f')]=_[_0x53a1('0x30')](_0x53063a[_0x53a1('0x2c')],_0x53063a[_0x53a1('0x2d')]);_0x3b0614['attributes']=_[_0x53a1('0x30')](_0x53063a['model'],qs[_0x53a1('0x31')](_0xf95a2a['query'][_0x53a1('0x31')]));_0x3b0614[_0x53a1('0x32')]=_0x3b0614['attributes'][_0x53a1('0x33')]?_0x3b0614[_0x53a1('0x32')]:_0x53063a[_0x53a1('0x2c')];if(!_0xf95a2a['query'][_0x53a1('0x34')]('nolimit')){_0x3b0614[_0x53a1('0x18')]=qs[_0x53a1('0x18')](_0xf95a2a[_0x53a1('0x2d')][_0x53a1('0x18')]);_0x3b0614[_0x53a1('0x16')]=qs[_0x53a1('0x16')](_0xf95a2a[_0x53a1('0x2d')][_0x53a1('0x16')]);}_0x3b0614[_0x53a1('0x36')]=qs[_0x53a1('0x37')](_0xf95a2a['query'][_0x53a1('0x37')]);_0x3b0614[_0x53a1('0x38')]=qs['filters'](_['pick'](_0xf95a2a[_0x53a1('0x2d')],_0x53063a[_0x53a1('0x2f')]));_0x3b0614[_0x53a1('0x38')][_0x53a1('0x56')]=_0x2764b6['id'];if(_0xf95a2a['query'][_0x53a1('0x39')]){_0x3b0614[_0x53a1('0x38')]=_[_0x53a1('0x3c')](_0x3b0614[_0x53a1('0x38')],{'$or':_[_0x53a1('0x28')](_0x3b0614[_0x53a1('0x32')],function(_0x5d9cc9){var _0x18ffbd={};_0x18ffbd[_0x5d9cc9]={'$like':'%'+_0xf95a2a['query'][_0x53a1('0x39')]+'%'};return _0x18ffbd;})});}_0x3b0614=_['merge']({},_0x3b0614,_0xf95a2a[_0x53a1('0x3d')]);return db['JscriptyAnswerReport']['count']({'where':_0x3b0614[_0x53a1('0x38')]})['then'](function(_0x3e8221){_0x512e5b[_0x53a1('0x19')]=_0x3e8221;if(_0xf95a2a['query'][_0x53a1('0x3e')]){_0x3b0614[_0x53a1('0x4a')]=[{'all':!![]}];}return db[_0x53a1('0x55')][_0x53a1('0x3f')](_0x3b0614);})[_0x53a1('0x1e')](function(_0x27ebdf){_0x512e5b[_0x53a1('0x40')]=_0x27ebdf;return _0x512e5b;});}})[_0x53a1('0x1e')](respondWithFilteredResult(_0x697910,_0x3b0614))[_0x53a1('0x41')](handleError(_0x697910,null));};function char(_0xb1ee34){return _0x53a1('0x57')===typeof _0xb1ee34?String[_0x53a1('0x58')][_0x53a1('0x59')](null,arguments):_0xb1ee34;}function needsEncapsulation(_0x3e063e){return!!_0x3e063e&&(_0x3e063e[_0x53a1('0x5a')]()['indexOf'](char(0xd))>=0x0||_0x3e063e[_0x53a1('0x5a')]()[_0x53a1('0x5b')](char(0xa))>=0x0||_0x3e063e[_0x53a1('0x5a')]()['indexOf'](char(0x2c))>=0x0||_0x3e063e[_0x53a1('0x5a')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5ef084){var _0x285fb7=char(0x22),_0x3baf44='\x5c'+char(0x22),_0x5496f7=_0x5ef084[_0x53a1('0x5a')]()[_0x53a1('0x5c')](new RegExp(_0x285fb7,'g'),_0x3baf44);return _0x285fb7+_0x5496f7+_0x285fb7;}exports[_0x53a1('0x5d')]=function(_0x458f87,_0x4f8613,_0x22e646){var _0x427aab,_0x3e417d;var _0x10d871={'where':{'ProjectId':_0x458f87[_0x53a1('0x4f')]['id']}};if(_0x458f87['query'][_0x53a1('0x5e')]){_0x10d871[_0x53a1('0x38')][_0x53a1('0x5f')]=JSON[_0x53a1('0x60')](_0x458f87[_0x53a1('0x2d')]['startTime']);}return db[_0x53a1('0x53')][_0x53a1('0x3f')](_0x10d871)[_0x53a1('0x1e')](handleEntityNotFound(_0x4f8613,null))['then'](function(_0x4a5380){if(_0x4a5380){_0x427aab=_0x4a5380;return db[_0x53a1('0x61')][_0x53a1('0x3f')]({'where':{'SessionId':{'$in':_[_0x53a1('0x28')](_0x427aab,'id')},'ProjectId':_0x458f87[_0x53a1('0x4f')]['id']},'order':'-createdAt'});}})[_0x53a1('0x1e')](handleEntityNotFound(_0x4f8613,null))[_0x53a1('0x1e')](function(_0x504c3d){if(_0x504c3d){_0x3e417d=_0x504c3d;var _0x39ed0b={};for(var _0x4def7b=0x0,_0x1bf17b=_0x3e417d['length'];_0x4def7b<_0x1bf17b;_0x4def7b++){if(!_0x39ed0b[_0x53a1('0x34')](_0x3e417d[_0x4def7b][_0x53a1('0x62')])){_0x39ed0b[_0x3e417d[_0x4def7b]['questionId']]=needsEncapsulation(_0x3e417d[_0x4def7b][_0x53a1('0x63')])?encapsulate(_0x3e417d[_0x4def7b][_0x53a1('0x63')]):_0x3e417d[_0x4def7b][_0x53a1('0x63')];}}var _0xf6c4ed=[],_0x2a21af={};for(var _0x814bb2=0x0,_0x2281a7=_0x427aab[_0x53a1('0x33')];_0x814bb2<_0x2281a7;_0x814bb2++){_0x2a21af={'ProjectId':_0x458f87[_0x53a1('0x4f')]['id'],'SessionId':_0x427aab[_0x814bb2]['id'],'StartTime':moment(_0x427aab[_0x814bb2]['starttime'])[_0x53a1('0x64')](_0x53a1('0x65'))};for(var _0x8cc052=0x0,_0x2bb91d=_0x3e417d['length'];_0x8cc052<_0x2bb91d;_0x8cc052++){if(_0x3e417d[_0x8cc052][_0x53a1('0x66')]==_0x427aab[_0x814bb2]['id']&&_0x39ed0b[_0x53a1('0x34')](_0x3e417d[_0x8cc052][_0x53a1('0x62')])){_0x2a21af[_0x39ed0b[_0x3e417d[_0x8cc052][_0x53a1('0x62')]]]=_0x3e417d[_0x8cc052][_0x53a1('0x67')];}}for(var _0x9eadc2 in _0x39ed0b){if(!_0x2a21af['hasOwnProperty'](_0x39ed0b[_0x9eadc2])){_0x2a21af[_0x39ed0b[_0x9eadc2]]=null;}}_0xf6c4ed[_0x53a1('0x68')](_0x2a21af);}return _0xf6c4ed;}})[_0x53a1('0x1e')](function(_0x3fa96e){if(!_[_0x53a1('0x69')](_0x3fa96e)){var _0x4cd130=toCsv(_0x3fa96e);var _0x3ebca0=Date[_0x53a1('0x6a')]();fs[_0x53a1('0x6b')](util[_0x53a1('0x64')](_0x53a1('0x6c'),_0x458f87['params']['id'],_0x3ebca0),_0x4cd130);_0x4f8613[_0x53a1('0x6d')]('Content-disposition','attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x458f87[_0x53a1('0x4f')]['id'],_0x3ebca0));_0x4f8613[_0x53a1('0x6d')]('Content-type',_0x53a1('0x6e'));return _0x4f8613['download'](util['format'](_0x53a1('0x6c'),_0x458f87[_0x53a1('0x4f')]['id'],_0x3ebca0));}else{return _0x4f8613[_0x53a1('0x12')](0xcc);}})[_0x53a1('0x41')](handleError(_0x4f8613,null));}; \ No newline at end of file +var _0x3cb4=['starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','count','limit','apply','reject','save','update','then','destroy','Projects','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','create','body','user','role','get','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getSessions','findOne','JscriptySessionReport','nolimit','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3cb4,0x1f1));var _0x43cb=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x3cb4[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43cb('0x0'));var zipdir=require(_0x43cb('0x1'));var jsonpatch=require(_0x43cb('0x2'));var rp=require(_0x43cb('0x3'));var moment=require(_0x43cb('0x4'));var BPromise=require(_0x43cb('0x5'));var Mustache=require(_0x43cb('0x6'));var util=require(_0x43cb('0x7'));var path=require('path');var sox=require(_0x43cb('0x8'));var csv=require(_0x43cb('0x9'));var ejs=require(_0x43cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43cb('0xb'));var squel=require(_0x43cb('0xc'));var crypto=require(_0x43cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x43cb('0xe'));var toCsv=require(_0x43cb('0x9'));var querystring=require(_0x43cb('0xf'));var Papa=require(_0x43cb('0x10'));var Redis=require(_0x43cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x43cb('0x12'));var as=require(_0x43cb('0x13'));var hardwareService=require(_0x43cb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x43cb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54f320,_0x593baa){_0x593baa=_0x593baa||0xcc;return function(_0x362982){if(_0x362982){return _0x54f320[_0x43cb('0x16')](_0x593baa);}return _0x54f320[_0x43cb('0x17')](_0x593baa)[_0x43cb('0x18')]();};}function respondWithResult(_0x422559,_0x3ea3d2){_0x3ea3d2=_0x3ea3d2||0xc8;return function(_0x33ffc4){if(_0x33ffc4){return _0x422559[_0x43cb('0x17')](_0x3ea3d2)[_0x43cb('0x19')](_0x33ffc4);}};}function respondWithFilteredResult(_0x3af51f,_0x2ecb6f){return function(_0x9a8ae0){if(_0x9a8ae0){var _0x252ebb=typeof _0x2ecb6f[_0x43cb('0x1a')]==='undefined'&&typeof _0x2ecb6f['limit']==='undefined';var _0x366af3=_0x9a8ae0[_0x43cb('0x1b')];var _0x4f52ce=_0x252ebb?0x0:_0x2ecb6f[_0x43cb('0x1a')];var _0x131797=_0x252ebb?_0x9a8ae0[_0x43cb('0x1b')]:_0x2ecb6f['offset']+_0x2ecb6f[_0x43cb('0x1c')];var _0x36ef48;if(_0x131797>=_0x366af3){_0x131797=_0x366af3;_0x36ef48=0xc8;}else{_0x36ef48=0xce;}_0x3af51f[_0x43cb('0x17')](_0x36ef48);return _0x3af51f['set']('Content-Range',_0x4f52ce+'-'+_0x131797+'/'+_0x366af3)[_0x43cb('0x19')](_0x9a8ae0);}return null;};}function patchUpdates(_0x122197){return function(_0x2e3f1c){try{jsonpatch[_0x43cb('0x1d')](_0x2e3f1c,_0x122197,!![]);}catch(_0x3cda74){return BPromise[_0x43cb('0x1e')](_0x3cda74);}return _0x2e3f1c[_0x43cb('0x1f')]();};}function saveUpdates(_0x2dc8f6,_0x3257a0){return function(_0x51f1b4){if(_0x51f1b4){return _0x51f1b4[_0x43cb('0x20')](_0x2dc8f6)[_0x43cb('0x21')](function(_0x365549){return _0x365549;});}return null;};}function removeEntity(_0x3c02a0,_0x3b09b5){return function(_0x497cef){if(_0x497cef){return _0x497cef[_0x43cb('0x22')]()[_0x43cb('0x21')](function(){var _0x5ec436=_0x497cef['get']({'plain':!![]});var _0xd4bbc2=_0x43cb('0x23');return db['UserProfileResource'][_0x43cb('0x22')]({'where':{'type':_0xd4bbc2,'resourceId':_0x5ec436['id']}})['then'](function(){return _0x497cef;});})[_0x43cb('0x21')](function(){_0x3c02a0[_0x43cb('0x17')](0xcc)[_0x43cb('0x18')]();});}};}function handleEntityNotFound(_0x42b200,_0xa1002c){return function(_0x57dba8){if(!_0x57dba8){_0x42b200[_0x43cb('0x16')](0x194);}return _0x57dba8;};}function handleError(_0x43009c,_0x5552c2){_0x5552c2=_0x5552c2||0x1f4;return function(_0x166167){logger['error'](_0x166167[_0x43cb('0x24')]);if(_0x166167[_0x43cb('0x25')]){delete _0x166167[_0x43cb('0x25')];}_0x43009c[_0x43cb('0x17')](_0x5552c2)[_0x43cb('0x26')](_0x166167);};}exports['index']=function(_0x1a27fa,_0x562f14){var _0x492484={},_0x57f9dd={},_0x4d09b2={'count':0x0,'rows':[]};var _0x4a8b22=_[_0x43cb('0x27')](db['JscriptyProject']['rawAttributes'],function(_0x4268ca){return{'name':_0x4268ca[_0x43cb('0x28')],'type':_0x4268ca[_0x43cb('0x29')][_0x43cb('0x2a')]};});_0x57f9dd[_0x43cb('0x2b')]=_[_0x43cb('0x27')](_0x4a8b22,_0x43cb('0x25'));_0x57f9dd[_0x43cb('0x2c')]=_[_0x43cb('0x2d')](_0x1a27fa['query']);_0x57f9dd[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x57f9dd[_0x43cb('0x2b')],_0x57f9dd[_0x43cb('0x2c')]);_0x492484[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x57f9dd[_0x43cb('0x2b')],qs[_0x43cb('0x31')](_0x1a27fa[_0x43cb('0x2c')]['fields']));_0x492484[_0x43cb('0x30')]=_0x492484[_0x43cb('0x30')][_0x43cb('0x32')]?_0x492484[_0x43cb('0x30')]:_0x57f9dd['model'];if(!_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x33')]('nolimit')){_0x492484[_0x43cb('0x1c')]=qs[_0x43cb('0x1c')](_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x1c')]);_0x492484[_0x43cb('0x1a')]=qs[_0x43cb('0x1a')](_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x1a')]);}_0x492484['order']=qs['sort'](_0x1a27fa['query'][_0x43cb('0x34')]);_0x492484['where']=qs[_0x43cb('0x2e')](_['pick'](_0x1a27fa[_0x43cb('0x2c')],_0x57f9dd['filters']),_0x4a8b22);if(_0x1a27fa['query'][_0x43cb('0x35')]){_0x492484[_0x43cb('0x36')]=_[_0x43cb('0x37')](_0x492484[_0x43cb('0x36')],{'$or':_[_0x43cb('0x27')](_0x4a8b22,function(_0x3379b0){if(_0x3379b0[_0x43cb('0x29')]!==_0x43cb('0x38')){var _0x2394fa={};_0x2394fa[_0x3379b0[_0x43cb('0x25')]]={'$like':'%'+_0x1a27fa['query'][_0x43cb('0x35')]+'%'};return _0x2394fa;}})});}_0x492484=_[_0x43cb('0x37')]({},_0x492484,_0x1a27fa[_0x43cb('0x39')]);var _0x49c8fb={'where':_0x492484['where']};return db['JscriptyProject']['count'](_0x49c8fb)[_0x43cb('0x21')](function(_0xa14bf4){_0x4d09b2[_0x43cb('0x1b')]=_0xa14bf4;if(_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x3a')]){_0x492484[_0x43cb('0x3b')]=[{'all':!![]}];}return db[_0x43cb('0x3c')][_0x43cb('0x3d')](_0x492484);})[_0x43cb('0x21')](function(_0x317e73){_0x4d09b2[_0x43cb('0x3e')]=_0x317e73;return _0x4d09b2;})[_0x43cb('0x21')](respondWithFilteredResult(_0x562f14,_0x492484))[_0x43cb('0x3f')](handleError(_0x562f14,null));};exports[_0x43cb('0x40')]=function(_0x28e190,_0x1eb402){var _0x464257={'raw':![],'where':{'id':_0x28e190[_0x43cb('0x41')]['id']}},_0x422db2={};_0x422db2[_0x43cb('0x2b')]=_[_0x43cb('0x2d')](db[_0x43cb('0x3c')]['rawAttributes']);_0x422db2[_0x43cb('0x2c')]=_[_0x43cb('0x2d')](_0x28e190[_0x43cb('0x2c')]);_0x422db2[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x422db2[_0x43cb('0x2b')],_0x422db2[_0x43cb('0x2c')]);_0x464257[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x422db2[_0x43cb('0x2b')],qs[_0x43cb('0x31')](_0x28e190[_0x43cb('0x2c')][_0x43cb('0x31')]));_0x464257[_0x43cb('0x30')]=_0x464257[_0x43cb('0x30')][_0x43cb('0x32')]?_0x464257[_0x43cb('0x30')]:_0x422db2[_0x43cb('0x2b')];if(_0x28e190['query'][_0x43cb('0x3a')]){_0x464257['include']=[{'all':!![]}];}_0x464257=_[_0x43cb('0x37')]({},_0x464257,_0x28e190[_0x43cb('0x39')]);return db[_0x43cb('0x3c')]['find'](_0x464257)[_0x43cb('0x21')](handleEntityNotFound(_0x1eb402,null))[_0x43cb('0x21')](respondWithResult(_0x1eb402,null))[_0x43cb('0x3f')](handleError(_0x1eb402,null));};exports[_0x43cb('0x42')]=function(_0x3ccaeb,_0x6aaf47){return db[_0x43cb('0x3c')]['create'](_0x3ccaeb[_0x43cb('0x43')],{})[_0x43cb('0x21')](function(_0x31d13c){var _0x2ef140=_0x3ccaeb[_0x43cb('0x44')]['get']({'plain':!![]});if(!_0x2ef140)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ef140[_0x43cb('0x45')]===_0x43cb('0x44')){var _0x1967cf=_0x31d13c[_0x43cb('0x46')]({'plain':!![]});var _0xedc49b='Projects';return db['UserProfileSection'][_0x43cb('0x47')]({'where':{'name':_0xedc49b,'userProfileId':_0x2ef140[_0x43cb('0x48')]},'raw':!![]})[_0x43cb('0x21')](function(_0x4107bd){if(_0x4107bd&&_0x4107bd[_0x43cb('0x49')]===0x0){return db[_0x43cb('0x4a')][_0x43cb('0x42')]({'name':_0x1967cf['name'],'resourceId':_0x1967cf['id'],'type':_0x4107bd[_0x43cb('0x25')],'sectionId':_0x4107bd['id']},{})[_0x43cb('0x21')](function(){return _0x31d13c;});}else{return _0x31d13c;}})[_0x43cb('0x3f')](function(_0x4a6aa1){logger[_0x43cb('0x4b')](_0x43cb('0x4c'),_0x4a6aa1);throw _0x4a6aa1;});}return _0x31d13c;})['then'](respondWithResult(_0x6aaf47,0xc9))[_0x43cb('0x3f')](handleError(_0x6aaf47,null));};exports[_0x43cb('0x4d')]=function(_0x2bfaa4,_0x3976f8){var _0x1d3bfa={'where':{'id':_0x2bfaa4[_0x43cb('0x41')]['id']}},_0x22333a={};_0x22333a[_0x43cb('0x2b')]=_['keys'](db[_0x43cb('0x3c')][_0x43cb('0x4e')]);_0x1d3bfa[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x22333a['model'],qs['fields'](_0x2bfaa4['query'][_0x43cb('0x31')]));_0x1d3bfa[_0x43cb('0x30')]=_0x1d3bfa['attributes'][_0x43cb('0x32')]?_0x1d3bfa[_0x43cb('0x30')]:_0x22333a[_0x43cb('0x2b')];if(_0x2bfaa4[_0x43cb('0x2c')][_0x43cb('0x3a')]){_0x1d3bfa[_0x43cb('0x3b')]=[{'all':!![]}];}_0x1d3bfa=_[_0x43cb('0x37')]({},_0x1d3bfa,_0x2bfaa4[_0x43cb('0x39')]);return db[_0x43cb('0x3c')][_0x43cb('0x47')](_0x1d3bfa)[_0x43cb('0x21')](handleEntityNotFound(_0x3976f8,null))[_0x43cb('0x21')](function(_0x2b6d91){if(_0x2b6d91){var _0x132cab=_0x2b6d91['get']({'plain':!![]});_0x132cab=qs[_0x43cb('0x4f')](_0x132cab,['id','createdAt',_0x43cb('0x50')]);_0x2bfaa4[_0x43cb('0x43')]=_['omit'](_0x2bfaa4[_0x43cb('0x43')],['id',_0x43cb('0x51'),_0x43cb('0x50')]);return db[_0x43cb('0x3c')][_0x43cb('0x42')](_[_0x43cb('0x37')](_0x132cab,_0x2bfaa4['body']),{'include':_0x2bfaa4[_0x43cb('0x2c')][_0x43cb('0x3a')]?[{'all':!![]}]:undefined})['then'](function(_0x399c9c){var _0x248ee8=_0x2bfaa4['user'][_0x43cb('0x46')]({'plain':!![]});if(!_0x248ee8)throw new Error(_0x43cb('0x52'));if(_0x248ee8[_0x43cb('0x45')]===_0x43cb('0x44')){var _0x4989d0=_0x399c9c['get']({'plain':!![]});var _0x22f39b=_0x43cb('0x23');return db[_0x43cb('0x53')][_0x43cb('0x47')]({'where':{'name':_0x22f39b,'userProfileId':_0x248ee8[_0x43cb('0x48')]},'raw':!![]})[_0x43cb('0x21')](function(_0x5b6bf3){if(_0x5b6bf3&&_0x5b6bf3[_0x43cb('0x49')]===0x0){return db['UserProfileResource'][_0x43cb('0x42')]({'name':_0x4989d0[_0x43cb('0x25')],'resourceId':_0x4989d0['id'],'type':_0x5b6bf3['name'],'sectionId':_0x5b6bf3['id']},{})['then'](function(){return _0x399c9c;});}else{return _0x399c9c;}})['catch'](function(_0x45cda9){logger[_0x43cb('0x4b')](_0x43cb('0x4c'),_0x45cda9);throw _0x45cda9;});}return _0x399c9c;});}})['then'](respondWithResult(_0x3976f8,0xc9))[_0x43cb('0x3f')](handleError(_0x3976f8,null));};exports['update']=function(_0x2e2891,_0x4901c6){if(_0x2e2891[_0x43cb('0x43')]['id']){delete _0x2e2891['body']['id'];}return db[_0x43cb('0x3c')][_0x43cb('0x47')]({'where':{'id':_0x2e2891['params']['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x4901c6,null))[_0x43cb('0x21')](saveUpdates(_0x2e2891[_0x43cb('0x43')],null))[_0x43cb('0x21')](respondWithResult(_0x4901c6,null))[_0x43cb('0x3f')](handleError(_0x4901c6,null));};exports['destroy']=function(_0x32684b,_0x5d4acf){return db['JscriptyProject'][_0x43cb('0x47')]({'where':{'id':_0x32684b['params']['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x5d4acf,null))[_0x43cb('0x21')](removeEntity(_0x5d4acf,null))[_0x43cb('0x3f')](handleError(_0x5d4acf,null));};exports[_0x43cb('0x54')]=function(_0x4db737,_0x34e07a,_0x462a5c){var _0x49cd75={'raw':!![],'where':{}};var _0x3248f3={};var _0x11126d={'count':0x0,'rows':[]};return db[_0x43cb('0x3c')][_0x43cb('0x55')]({'where':{'id':_0x4db737[_0x43cb('0x41')]['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x34e07a,null))[_0x43cb('0x21')](function(_0x1f34aa){if(_0x1f34aa){_0x3248f3[_0x43cb('0x2b')]=_[_0x43cb('0x2d')](db[_0x43cb('0x56')][_0x43cb('0x4e')]);_0x3248f3[_0x43cb('0x2c')]=_[_0x43cb('0x2d')](_0x4db737['query']);_0x3248f3[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x3248f3['model'],_0x3248f3[_0x43cb('0x2c')]);_0x49cd75[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x3248f3['model'],qs[_0x43cb('0x31')](_0x4db737['query'][_0x43cb('0x31')]));_0x49cd75[_0x43cb('0x30')]=_0x49cd75[_0x43cb('0x30')][_0x43cb('0x32')]?_0x49cd75[_0x43cb('0x30')]:_0x3248f3[_0x43cb('0x2b')];if(!_0x4db737[_0x43cb('0x2c')]['hasOwnProperty'](_0x43cb('0x57'))){_0x49cd75[_0x43cb('0x1c')]=qs[_0x43cb('0x1c')](_0x4db737[_0x43cb('0x2c')][_0x43cb('0x1c')]);_0x49cd75[_0x43cb('0x1a')]=qs[_0x43cb('0x1a')](_0x4db737[_0x43cb('0x2c')][_0x43cb('0x1a')]);}_0x49cd75['order']=qs['sort'](_0x4db737[_0x43cb('0x2c')][_0x43cb('0x34')]);_0x49cd75[_0x43cb('0x36')]=qs[_0x43cb('0x2e')](_[_0x43cb('0x58')](_0x4db737['query'],_0x3248f3[_0x43cb('0x2e')]));_0x49cd75[_0x43cb('0x36')][_0x43cb('0x59')]=_0x1f34aa['id'];if(_0x4db737[_0x43cb('0x2c')]['filter']){_0x49cd75[_0x43cb('0x36')]=_['merge'](_0x49cd75[_0x43cb('0x36')],{'$or':_[_0x43cb('0x27')](_0x49cd75[_0x43cb('0x30')],function(_0x139775){var _0x3e3002={};_0x3e3002[_0x139775]={'$like':'%'+_0x4db737[_0x43cb('0x2c')]['filter']+'%'};return _0x3e3002;})});}_0x49cd75=_['merge']({},_0x49cd75,_0x4db737[_0x43cb('0x39')]);return db[_0x43cb('0x56')][_0x43cb('0x1b')]({'where':_0x49cd75['where']})[_0x43cb('0x21')](function(_0xc4e39b){_0x11126d[_0x43cb('0x1b')]=_0xc4e39b;if(_0x4db737[_0x43cb('0x2c')]['includeAll']){_0x49cd75[_0x43cb('0x3b')]=[{'all':!![]}];}return db[_0x43cb('0x56')]['findAll'](_0x49cd75);})[_0x43cb('0x21')](function(_0x1df71d){_0x11126d[_0x43cb('0x3e')]=_0x1df71d;return _0x11126d;});}})[_0x43cb('0x21')](respondWithFilteredResult(_0x34e07a,_0x49cd75))[_0x43cb('0x3f')](handleError(_0x34e07a,null));};exports[_0x43cb('0x5a')]=function(_0x12ba30,_0x5a6c54,_0x103607){var _0x22d2e1={'raw':!![],'where':{}};var _0x5b3acf={};var _0x26156c={'count':0x0,'rows':[]};return db[_0x43cb('0x3c')][_0x43cb('0x55')]({'where':{'id':_0x12ba30[_0x43cb('0x41')]['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x5a6c54,null))['then'](function(_0x1b95b8){if(_0x1b95b8){_0x5b3acf[_0x43cb('0x2b')]=_[_0x43cb('0x2d')](db[_0x43cb('0x5b')]['rawAttributes']);_0x5b3acf['query']=_[_0x43cb('0x2d')](_0x12ba30['query']);_0x5b3acf[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x5b3acf['model'],_0x5b3acf[_0x43cb('0x2c')]);_0x22d2e1[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x5b3acf['model'],qs['fields'](_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x31')]));_0x22d2e1['attributes']=_0x22d2e1[_0x43cb('0x30')][_0x43cb('0x32')]?_0x22d2e1['attributes']:_0x5b3acf[_0x43cb('0x2b')];if(!_0x12ba30['query'][_0x43cb('0x33')]('nolimit')){_0x22d2e1[_0x43cb('0x1c')]=qs['limit'](_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x1c')]);_0x22d2e1['offset']=qs[_0x43cb('0x1a')](_0x12ba30['query'][_0x43cb('0x1a')]);}_0x22d2e1['order']=qs[_0x43cb('0x34')](_0x12ba30[_0x43cb('0x2c')]['sort']);_0x22d2e1[_0x43cb('0x36')]=qs[_0x43cb('0x2e')](_['pick'](_0x12ba30[_0x43cb('0x2c')],_0x5b3acf['filters']));_0x22d2e1['where']['ProjectId']=_0x1b95b8['id'];if(_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x35')]){_0x22d2e1[_0x43cb('0x36')]=_['merge'](_0x22d2e1[_0x43cb('0x36')],{'$or':_['map'](_0x22d2e1[_0x43cb('0x30')],function(_0x55d15c){var _0x755009={};_0x755009[_0x55d15c]={'$like':'%'+_0x12ba30['query']['filter']+'%'};return _0x755009;})});}_0x22d2e1=_[_0x43cb('0x37')]({},_0x22d2e1,_0x12ba30[_0x43cb('0x39')]);return db[_0x43cb('0x5b')]['count']({'where':_0x22d2e1[_0x43cb('0x36')]})[_0x43cb('0x21')](function(_0x3411f5){_0x26156c[_0x43cb('0x1b')]=_0x3411f5;if(_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x3a')]){_0x22d2e1[_0x43cb('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x43cb('0x3d')](_0x22d2e1);})[_0x43cb('0x21')](function(_0x38a1b4){_0x26156c['rows']=_0x38a1b4;return _0x26156c;});}})[_0x43cb('0x21')](respondWithFilteredResult(_0x5a6c54,_0x22d2e1))['catch'](handleError(_0x5a6c54,null));};function char(_0x424e37){return _0x43cb('0x5c')===typeof _0x424e37?String[_0x43cb('0x5d')][_0x43cb('0x1d')](null,arguments):_0x424e37;}function needsEncapsulation(_0x43f03c){return!!_0x43f03c&&(_0x43f03c['toString']()['indexOf'](char(0xd))>=0x0||_0x43f03c[_0x43cb('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x43f03c[_0x43cb('0x5e')]()[_0x43cb('0x5f')](char(0x2c))>=0x0||_0x43f03c[_0x43cb('0x5e')]()[_0x43cb('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x513b85){var _0x1f6f8b=char(0x22),_0x117930='\x5c'+char(0x22),_0x4ef7fb=_0x513b85[_0x43cb('0x5e')]()['replace'](new RegExp(_0x1f6f8b,'g'),_0x117930);return _0x1f6f8b+_0x4ef7fb+_0x1f6f8b;}exports[_0x43cb('0x60')]=function(_0x4071dc,_0x1ee543,_0x47be38){var _0x1ec417,_0x43445b;var _0x199351={'where':{'ProjectId':_0x4071dc[_0x43cb('0x41')]['id']}};if(_0x4071dc[_0x43cb('0x2c')][_0x43cb('0x61')]){_0x199351['where'][_0x43cb('0x62')]=JSON[_0x43cb('0x63')](_0x4071dc['query'][_0x43cb('0x61')]);}return db[_0x43cb('0x56')][_0x43cb('0x3d')](_0x199351)[_0x43cb('0x21')](handleEntityNotFound(_0x1ee543,null))[_0x43cb('0x21')](function(_0x12bbca){if(_0x12bbca){_0x1ec417=_0x12bbca;return db[_0x43cb('0x64')][_0x43cb('0x3d')]({'where':{'SessionId':{'$in':_['map'](_0x1ec417,'id')},'ProjectId':_0x4071dc[_0x43cb('0x41')]['id']},'order':_0x43cb('0x65')});}})[_0x43cb('0x21')](handleEntityNotFound(_0x1ee543,null))['then'](function(_0xcd5c9d){if(_0xcd5c9d){_0x43445b=_0xcd5c9d;var _0xb1a289={};for(var _0x31ed64=0x0,_0x266b52=_0x43445b[_0x43cb('0x32')];_0x31ed64<_0x266b52;_0x31ed64++){if(!_0xb1a289[_0x43cb('0x33')](_0x43445b[_0x31ed64][_0x43cb('0x66')])){_0xb1a289[_0x43445b[_0x31ed64][_0x43cb('0x66')]]=needsEncapsulation(_0x43445b[_0x31ed64][_0x43cb('0x67')])?encapsulate(_0x43445b[_0x31ed64][_0x43cb('0x67')]):_0x43445b[_0x31ed64][_0x43cb('0x67')];}}var _0x49a951=[],_0x59ae65={};for(var _0x4239db=0x0,_0xc7cebc=_0x1ec417[_0x43cb('0x32')];_0x4239db<_0xc7cebc;_0x4239db++){_0x59ae65={'ProjectId':_0x4071dc[_0x43cb('0x41')]['id'],'SessionId':_0x1ec417[_0x4239db]['id'],'StartTime':moment(_0x1ec417[_0x4239db][_0x43cb('0x62')])[_0x43cb('0x68')](_0x43cb('0x69'))};for(var _0x2c783a=0x0,_0x525b60=_0x43445b['length'];_0x2c783a<_0x525b60;_0x2c783a++){if(_0x43445b[_0x2c783a][_0x43cb('0x6a')]==_0x1ec417[_0x4239db]['id']&&_0xb1a289[_0x43cb('0x33')](_0x43445b[_0x2c783a][_0x43cb('0x66')])){_0x59ae65[_0xb1a289[_0x43445b[_0x2c783a]['questionId']]]=_0x43445b[_0x2c783a][_0x43cb('0x6b')];}}for(var _0x37ff49 in _0xb1a289){if(!_0x59ae65[_0x43cb('0x33')](_0xb1a289[_0x37ff49])){_0x59ae65[_0xb1a289[_0x37ff49]]=null;}}_0x49a951[_0x43cb('0x6c')](_0x59ae65);}return _0x49a951;}})[_0x43cb('0x21')](function(_0xd71133){if(!_[_0x43cb('0x6d')](_0xd71133)){var _0x322e06=toCsv(_0xd71133);var _0x136a90=Date[_0x43cb('0x6e')]();fs[_0x43cb('0x6f')](util[_0x43cb('0x68')](_0x43cb('0x70'),_0x4071dc[_0x43cb('0x41')]['id'],_0x136a90),_0x322e06);_0x1ee543['setHeader'](_0x43cb('0x71'),_0x43cb('0x72')+util[_0x43cb('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0x4071dc[_0x43cb('0x41')]['id'],_0x136a90));_0x1ee543[_0x43cb('0x73')](_0x43cb('0x74'),_0x43cb('0x75'));return _0x1ee543[_0x43cb('0x76')](util[_0x43cb('0x68')](_0x43cb('0x70'),_0x4071dc[_0x43cb('0x41')]['id'],_0x136a90));}else{return _0x1ee543[_0x43cb('0x16')](0xcc);}})[_0x43cb('0x3f')](handleError(_0x1ee543,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5bfbf65..e95db23 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 _0x093a=['JscriptyProject','jscripty_projects','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x093a,0x16a));var _0xa093=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0x093a[_0x1b76e6];return _0x333b53;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fd7=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','jscripty_projects'];(function(_0x5a425d,_0x135dec){var _0x41b787=function(_0x53bab6){while(--_0x53bab6){_0x5a425d['push'](_0x5a425d['shift']());}};_0x41b787(++_0x135dec);}(_0x4fd7,0xe6));var _0x74fd=function(_0x36c286,_0x4cf7e9){_0x36c286=_0x36c286-0x0;var _0x3b1408=_0x4fd7[_0x36c286];return _0x3b1408;};'use strict';var _=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var logger=require(_0x74fd('0x2'))(_0x74fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74fd('0x4'));var fs=require('fs');var path=require(_0x74fd('0x5'));var rimraf=require('rimraf');var config=require(_0x74fd('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x74fd('0x7')]=function(_0x480ec2,_0x1959e1){return _0x480ec2[_0x74fd('0x8')]('JscriptyProject',attributes,{'tableName':_0x74fd('0x9'),'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 8559b27..ba18d9b 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x576ac5,_0x79ff1f){var _0x595847=function(_0x59044b){while(--_0x59044b){_0x576ac5['push'](_0x576ac5['shift']());}};_0x595847(++_0x79ff1f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0xcb91[_0x60286b];return _0x5dff69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac4a,0x13f));var _0xaac4=function(_0x48560f,_0xe31371){_0x48560f=_0x48560f-0x0;var _0x23eda3=_0xac4a[_0x48560f];return _0x23eda3;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 3048f58..4b5904d 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 _0x5b50=['get','isAuthenticated','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0x5b50,0x1c3));var _0x05b5=function(_0x5e0473,_0x9b8b72){_0x5e0473=_0x5e0473-0x0;var _0x14cc6d=_0x5b50[_0x5e0473];return _0x14cc6d;};'use strict';var multer=require(_0x05b5('0x0'));var util=require(_0x05b5('0x1'));var path=require(_0x05b5('0x2'));var timeout=require(_0x05b5('0x3'));var express=require('express');var router=express[_0x05b5('0x4')]();var fs_extra=require(_0x05b5('0x5'));var auth=require(_0x05b5('0x6'));var interaction=require(_0x05b5('0x7'));var config=require('../../config/environment');var controller=require(_0x05b5('0x8'));router[_0x05b5('0x9')]('/',auth[_0x05b5('0xa')](),controller['index']);router[_0x05b5('0x9')](_0x05b5('0xb'),auth[_0x05b5('0xa')](),controller[_0x05b5('0xc')]);router[_0x05b5('0x9')](_0x05b5('0xd'),auth['isAuthenticated'](),controller[_0x05b5('0xe')]);router[_0x05b5('0xf')]('/',auth[_0x05b5('0xa')](),controller['create']);router[_0x05b5('0x10')](_0x05b5('0xd'),auth[_0x05b5('0xa')](),controller[_0x05b5('0x11')]);router['delete'](_0x05b5('0xd'),auth['isAuthenticated'](),controller[_0x05b5('0x12')]);module[_0x05b5('0x13')]=router; \ No newline at end of file +var _0x415b=['fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x16ee21,_0x2b9d60){var _0x1ae6fd=function(_0x1526df){while(--_0x1526df){_0x16ee21['push'](_0x16ee21['shift']());}};_0x1ae6fd(++_0x2b9d60);}(_0x415b,0x15c));var _0xb415=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x415b[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xb415('0x0'));var util=require('util');var path=require(_0xb415('0x1'));var timeout=require('connect-timeout');var express=require(_0xb415('0x2'));var router=express[_0xb415('0x3')]();var fs_extra=require(_0xb415('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb415('0x5'));var config=require(_0xb415('0x6'));var controller=require(_0xb415('0x7'));router['get']('/',auth[_0xb415('0x8')](),controller[_0xb415('0x9')]);router[_0xb415('0xa')](_0xb415('0xb'),auth[_0xb415('0x8')](),controller[_0xb415('0xc')]);router['get'](_0xb415('0xd'),auth[_0xb415('0x8')](),controller[_0xb415('0xe')]);router[_0xb415('0xf')]('/',auth['isAuthenticated'](),controller[_0xb415('0x10')]);router[_0xb415('0x11')]('/:id',auth[_0xb415('0x8')](),controller[_0xb415('0x12')]);router[_0xb415('0x13')](_0xb415('0xd'),auth[_0xb415('0x8')](),controller[_0xb415('0x14')]);module[_0xb415('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index a18e43e..1c5316e 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x42cf06,_0x115844){_0x42cf06=_0x42cf06-0x0;var _0xeb6c02=_0x7a54[_0x42cf06];return _0xeb6c02;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xa1f4df,_0x3b8ead){_0xa1f4df=_0xa1f4df-0x0;var _0x1b1533=_0x7a54[_0xa1f4df];return _0x1b1533;};'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 ad01518..47a9f12 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 _0x2293=['destroy','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x135cd8,_0x3569c5){var _0x43494b=function(_0x2c6323){while(--_0x2c6323){_0x135cd8['push'](_0x135cd8['shift']());}};_0x43494b(++_0x3569c5);}(_0x2293,0x114));var _0x3229=function(_0x36a9d0,_0x294190){_0x36a9d0=_0x36a9d0-0x0;var _0x550848=_0x2293[_0x36a9d0];return _0x550848;};'use strict';var emlformat=require(_0x3229('0x0'));var rimraf=require(_0x3229('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3229('0x2'));var moment=require('moment');var BPromise=require(_0x3229('0x3'));var Mustache=require(_0x3229('0x4'));var util=require(_0x3229('0x5'));var path=require(_0x3229('0x6'));var sox=require(_0x3229('0x7'));var csv=require('to-csv');var ejs=require(_0x3229('0x8'));var fs=require('fs');var fs_extra=require(_0x3229('0x9'));var _=require(_0x3229('0xa'));var squel=require(_0x3229('0xb'));var crypto=require(_0x3229('0xc'));var jsforce=require(_0x3229('0xd'));var deskjs=require(_0x3229('0xe'));var toCsv=require(_0x3229('0xf'));var querystring=require(_0x3229('0x10'));var Papa=require(_0x3229('0x11'));var Redis=require('ioredis');var authService=require(_0x3229('0x12'));var qs=require(_0x3229('0x13'));var as=require(_0x3229('0x14'));var hardwareService=require(_0x3229('0x15'));var logger=require(_0x3229('0x16'))(_0x3229('0x17'));var utils=require('../../config/utils');var config=require(_0x3229('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3229('0x19'))['db'];function respondWithStatusCode(_0x527dd2,_0x5f47f9){_0x5f47f9=_0x5f47f9||0xcc;return function(_0xbb73d9){if(_0xbb73d9){return _0x527dd2[_0x3229('0x1a')](_0x5f47f9);}return _0x527dd2['status'](_0x5f47f9)[_0x3229('0x1b')]();};}function respondWithResult(_0x1e24e8,_0x3a1b81){_0x3a1b81=_0x3a1b81||0xc8;return function(_0x14f0bc){if(_0x14f0bc){return _0x1e24e8[_0x3229('0x1c')](_0x3a1b81)['json'](_0x14f0bc);}};}function respondWithFilteredResult(_0x147b6e,_0x599df9){return function(_0x49e42f){if(_0x49e42f){var _0x22b858=typeof _0x599df9['offset']===_0x3229('0x1d')&&typeof _0x599df9[_0x3229('0x1e')]===_0x3229('0x1d');var _0x5c59c0=_0x49e42f['count'];var _0x26141f=_0x22b858?0x0:_0x599df9[_0x3229('0x1f')];var _0x136709=_0x22b858?_0x49e42f['count']:_0x599df9[_0x3229('0x1f')]+_0x599df9['limit'];var _0x366856;if(_0x136709>=_0x5c59c0){_0x136709=_0x5c59c0;_0x366856=0xc8;}else{_0x366856=0xce;}_0x147b6e[_0x3229('0x1c')](_0x366856);return _0x147b6e[_0x3229('0x20')](_0x3229('0x21'),_0x26141f+'-'+_0x136709+'/'+_0x5c59c0)[_0x3229('0x22')](_0x49e42f);}return null;};}function patchUpdates(_0x1ba43a){return function(_0x18711b){try{jsonpatch[_0x3229('0x23')](_0x18711b,_0x1ba43a,!![]);}catch(_0x23a6a3){return BPromise[_0x3229('0x24')](_0x23a6a3);}return _0x18711b[_0x3229('0x25')]();};}function saveUpdates(_0x43278d,_0x28807e){return function(_0x3ea5a4){if(_0x3ea5a4){return _0x3ea5a4[_0x3229('0x26')](_0x43278d)[_0x3229('0x27')](function(_0x1ff33f){return _0x1ff33f;});}return null;};}function removeEntity(_0x14a2a7,_0x466e97){return function(_0x32ad53){if(_0x32ad53){return _0x32ad53[_0x3229('0x28')]()[_0x3229('0x27')](function(){_0x14a2a7[_0x3229('0x1c')](0xcc)[_0x3229('0x1b')]();});}};}function handleEntityNotFound(_0x2fbb91,_0x284583){return function(_0x2d41ff){if(!_0x2d41ff){_0x2fbb91['sendStatus'](0x194);}return _0x2d41ff;};}function handleError(_0x338de1,_0x40ab11){_0x40ab11=_0x40ab11||0x1f4;return function(_0x31592f){logger['error'](_0x31592f[_0x3229('0x29')]);if(_0x31592f[_0x3229('0x2a')]){delete _0x31592f[_0x3229('0x2a')];}_0x338de1[_0x3229('0x1c')](_0x40ab11)[_0x3229('0x2b')](_0x31592f);};}exports[_0x3229('0x2c')]=function(_0x2227bf,_0x48e264){var _0x98614e={},_0x487d9e={},_0x505a70={'count':0x0,'rows':[]};var _0x46fcad=_[_0x3229('0x2d')](db[_0x3229('0x2e')][_0x3229('0x2f')],function(_0x3a69b2){return{'name':_0x3a69b2[_0x3229('0x30')],'type':_0x3a69b2[_0x3229('0x31')][_0x3229('0x32')]};});_0x487d9e[_0x3229('0x33')]=_[_0x3229('0x2d')](_0x46fcad,_0x3229('0x2a'));_0x487d9e[_0x3229('0x34')]=_[_0x3229('0x35')](_0x2227bf[_0x3229('0x34')]);_0x487d9e[_0x3229('0x36')]=_[_0x3229('0x37')](_0x487d9e[_0x3229('0x33')],_0x487d9e['query']);_0x98614e[_0x3229('0x38')]=_[_0x3229('0x37')](_0x487d9e[_0x3229('0x33')],qs[_0x3229('0x39')](_0x2227bf[_0x3229('0x34')][_0x3229('0x39')]));_0x98614e['attributes']=_0x98614e[_0x3229('0x38')][_0x3229('0x3a')]?_0x98614e[_0x3229('0x38')]:_0x487d9e[_0x3229('0x33')];if(!_0x2227bf[_0x3229('0x34')][_0x3229('0x3b')](_0x3229('0x3c'))){_0x98614e[_0x3229('0x1e')]=qs['limit'](_0x2227bf[_0x3229('0x34')][_0x3229('0x1e')]);_0x98614e[_0x3229('0x1f')]=qs[_0x3229('0x1f')](_0x2227bf[_0x3229('0x34')][_0x3229('0x1f')]);}_0x98614e['order']=qs[_0x3229('0x3d')](_0x2227bf[_0x3229('0x34')][_0x3229('0x3d')]);_0x98614e[_0x3229('0x3e')]=qs[_0x3229('0x36')](_[_0x3229('0x3f')](_0x2227bf[_0x3229('0x34')],_0x487d9e[_0x3229('0x36')]),_0x46fcad);if(_0x2227bf[_0x3229('0x34')][_0x3229('0x40')]){_0x98614e[_0x3229('0x3e')]=_['merge'](_0x98614e[_0x3229('0x3e')],{'$or':_[_0x3229('0x2d')](_0x46fcad,function(_0x270e99){if(_0x270e99[_0x3229('0x31')]!=='VIRTUAL'){var _0x23807e={};_0x23807e[_0x270e99[_0x3229('0x2a')]]={'$like':'%'+_0x2227bf[_0x3229('0x34')][_0x3229('0x40')]+'%'};return _0x23807e;}})});}_0x98614e=_[_0x3229('0x41')]({},_0x98614e,_0x2227bf[_0x3229('0x42')]);var _0x52d949={'where':_0x98614e[_0x3229('0x3e')]};return db['JscriptyQuestionReport'][_0x3229('0x43')](_0x52d949)['then'](function(_0x55cae5){_0x505a70['count']=_0x55cae5;if(_0x2227bf[_0x3229('0x34')][_0x3229('0x44')]){_0x98614e[_0x3229('0x45')]=[{'all':!![]}];}return db[_0x3229('0x2e')][_0x3229('0x46')](_0x98614e);})['then'](function(_0x481b63){_0x505a70[_0x3229('0x47')]=_0x481b63;return _0x505a70;})[_0x3229('0x27')](respondWithFilteredResult(_0x48e264,_0x98614e))[_0x3229('0x48')](handleError(_0x48e264,null));};exports[_0x3229('0x49')]=function(_0x36e14c,_0x12cded){var _0x476308={'raw':!![],'where':{'id':_0x36e14c[_0x3229('0x4a')]['id']}},_0x98ac83={};_0x98ac83[_0x3229('0x33')]=_[_0x3229('0x35')](db[_0x3229('0x2e')][_0x3229('0x2f')]);_0x98ac83[_0x3229('0x34')]=_[_0x3229('0x35')](_0x36e14c[_0x3229('0x34')]);_0x98ac83[_0x3229('0x36')]=_[_0x3229('0x37')](_0x98ac83[_0x3229('0x33')],_0x98ac83[_0x3229('0x34')]);_0x476308[_0x3229('0x38')]=_[_0x3229('0x37')](_0x98ac83[_0x3229('0x33')],qs['fields'](_0x36e14c[_0x3229('0x34')]['fields']));_0x476308[_0x3229('0x38')]=_0x476308[_0x3229('0x38')][_0x3229('0x3a')]?_0x476308[_0x3229('0x38')]:_0x98ac83[_0x3229('0x33')];if(_0x36e14c[_0x3229('0x34')][_0x3229('0x44')]){_0x476308[_0x3229('0x45')]=[{'all':!![]}];}_0x476308=_[_0x3229('0x41')]({},_0x476308,_0x36e14c[_0x3229('0x42')]);return db[_0x3229('0x2e')]['find'](_0x476308)[_0x3229('0x27')](handleEntityNotFound(_0x12cded,null))[_0x3229('0x27')](respondWithResult(_0x12cded,null))[_0x3229('0x48')](handleError(_0x12cded,null));};exports['create']=function(_0x5ed458,_0x4c91d1){return db['JscriptyQuestionReport'][_0x3229('0x4b')](_0x5ed458[_0x3229('0x4c')],{})[_0x3229('0x27')](respondWithResult(_0x4c91d1,0xc9))[_0x3229('0x48')](handleError(_0x4c91d1,null));};exports[_0x3229('0x26')]=function(_0x2c4881,_0x4a7ced){if(_0x2c4881[_0x3229('0x4c')]['id']){delete _0x2c4881[_0x3229('0x4c')]['id'];}return db[_0x3229('0x2e')][_0x3229('0x4d')]({'where':{'id':_0x2c4881[_0x3229('0x4a')]['id']}})[_0x3229('0x27')](handleEntityNotFound(_0x4a7ced,null))[_0x3229('0x27')](saveUpdates(_0x2c4881[_0x3229('0x4c')],null))[_0x3229('0x27')](respondWithResult(_0x4a7ced,null))[_0x3229('0x48')](handleError(_0x4a7ced,null));};exports[_0x3229('0x28')]=function(_0x4efe55,_0x2f467a){return db['JscriptyQuestionReport'][_0x3229('0x4d')]({'where':{'id':_0x4efe55[_0x3229('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f467a,null))[_0x3229('0x27')](removeEntity(_0x2f467a,null))[_0x3229('0x48')](handleError(_0x2f467a,null));};exports[_0x3229('0x4e')]=function(_0x3d9e83,_0x4e5a7d){return db[_0x3229('0x2e')][_0x3229('0x4e')]()[_0x3229('0x27')](respondWithResult(_0x4e5a7d,null))[_0x3229('0x48')](handleError(_0x4e5a7d,null));}; \ No newline at end of file +var _0x49eb=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x2909b4,_0x1ad87f){var _0x47e4fa=function(_0x200acf){while(--_0x200acf){_0x2909b4['push'](_0x2909b4['shift']());}};_0x47e4fa(++_0x1ad87f);}(_0x49eb,0x12d));var _0xb49e=function(_0x5cce5a,_0x298d54){_0x5cce5a=_0x5cce5a-0x0;var _0x354e33=_0x49eb[_0x5cce5a];return _0x354e33;};'use strict';var emlformat=require(_0xb49e('0x0'));var rimraf=require(_0xb49e('0x1'));var zipdir=require(_0xb49e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb49e('0x3'));var moment=require(_0xb49e('0x4'));var BPromise=require(_0xb49e('0x5'));var Mustache=require(_0xb49e('0x6'));var util=require(_0xb49e('0x7'));var path=require(_0xb49e('0x8'));var sox=require(_0xb49e('0x9'));var csv=require(_0xb49e('0xa'));var ejs=require(_0xb49e('0xb'));var fs=require('fs');var fs_extra=require(_0xb49e('0xc'));var _=require(_0xb49e('0xd'));var squel=require('squel');var crypto=require(_0xb49e('0xe'));var jsforce=require(_0xb49e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb49e('0x10'));var authService=require(_0xb49e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb49e('0x12'));var hardwareService=require(_0xb49e('0x13'));var logger=require(_0xb49e('0x14'))(_0xb49e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb49e('0x16'));var db=require(_0xb49e('0x17'))['db'];function respondWithStatusCode(_0x30f180,_0x3f5dd5){_0x3f5dd5=_0x3f5dd5||0xcc;return function(_0x5cbeac){if(_0x5cbeac){return _0x30f180[_0xb49e('0x18')](_0x3f5dd5);}return _0x30f180['status'](_0x3f5dd5)[_0xb49e('0x19')]();};}function respondWithResult(_0x3c5718,_0x3783a4){_0x3783a4=_0x3783a4||0xc8;return function(_0x314395){if(_0x314395){return _0x3c5718[_0xb49e('0x1a')](_0x3783a4)[_0xb49e('0x1b')](_0x314395);}};}function respondWithFilteredResult(_0x992ea0,_0x2fb0bd){return function(_0x6c6b32){if(_0x6c6b32){var _0x174fc5=typeof _0x2fb0bd[_0xb49e('0x1c')]==='undefined'&&typeof _0x2fb0bd[_0xb49e('0x1d')]===_0xb49e('0x1e');var _0x52cf75=_0x6c6b32['count'];var _0x412f88=_0x174fc5?0x0:_0x2fb0bd['offset'];var _0x154808=_0x174fc5?_0x6c6b32[_0xb49e('0x1f')]:_0x2fb0bd['offset']+_0x2fb0bd['limit'];var _0x32e03c;if(_0x154808>=_0x52cf75){_0x154808=_0x52cf75;_0x32e03c=0xc8;}else{_0x32e03c=0xce;}_0x992ea0['status'](_0x32e03c);return _0x992ea0[_0xb49e('0x20')](_0xb49e('0x21'),_0x412f88+'-'+_0x154808+'/'+_0x52cf75)[_0xb49e('0x1b')](_0x6c6b32);}return null;};}function patchUpdates(_0x3518cb){return function(_0x2a4cc8){try{jsonpatch[_0xb49e('0x22')](_0x2a4cc8,_0x3518cb,!![]);}catch(_0x1b09b1){return BPromise['reject'](_0x1b09b1);}return _0x2a4cc8[_0xb49e('0x23')]();};}function saveUpdates(_0x480268,_0x4c9611){return function(_0x37c6f3){if(_0x37c6f3){return _0x37c6f3[_0xb49e('0x24')](_0x480268)[_0xb49e('0x25')](function(_0x429d77){return _0x429d77;});}return null;};}function removeEntity(_0x4cee7c,_0x18224d){return function(_0x30b66e){if(_0x30b66e){return _0x30b66e[_0xb49e('0x26')]()[_0xb49e('0x25')](function(){_0x4cee7c['status'](0xcc)[_0xb49e('0x19')]();});}};}function handleEntityNotFound(_0x397601,_0x33f062){return function(_0x1b9edd){if(!_0x1b9edd){_0x397601[_0xb49e('0x18')](0x194);}return _0x1b9edd;};}function handleError(_0x1d294a,_0x38e3e4){_0x38e3e4=_0x38e3e4||0x1f4;return function(_0x2cde41){logger[_0xb49e('0x27')](_0x2cde41[_0xb49e('0x28')]);if(_0x2cde41[_0xb49e('0x29')]){delete _0x2cde41['name'];}_0x1d294a[_0xb49e('0x1a')](_0x38e3e4)[_0xb49e('0x2a')](_0x2cde41);};}exports[_0xb49e('0x2b')]=function(_0x9a7c35,_0x203251){var _0x45ad67={},_0x41349b={},_0x1f44dc={'count':0x0,'rows':[]};var _0x1a3763=_[_0xb49e('0x2c')](db[_0xb49e('0x2d')][_0xb49e('0x2e')],function(_0x5c32e9){return{'name':_0x5c32e9['fieldName'],'type':_0x5c32e9[_0xb49e('0x2f')][_0xb49e('0x30')]};});_0x41349b[_0xb49e('0x31')]=_[_0xb49e('0x2c')](_0x1a3763,'name');_0x41349b[_0xb49e('0x32')]=_[_0xb49e('0x33')](_0x9a7c35[_0xb49e('0x32')]);_0x41349b[_0xb49e('0x34')]=_[_0xb49e('0x35')](_0x41349b['model'],_0x41349b[_0xb49e('0x32')]);_0x45ad67[_0xb49e('0x36')]=_[_0xb49e('0x35')](_0x41349b[_0xb49e('0x31')],qs[_0xb49e('0x37')](_0x9a7c35[_0xb49e('0x32')]['fields']));_0x45ad67[_0xb49e('0x36')]=_0x45ad67[_0xb49e('0x36')][_0xb49e('0x38')]?_0x45ad67['attributes']:_0x41349b[_0xb49e('0x31')];if(!_0x9a7c35[_0xb49e('0x32')][_0xb49e('0x39')](_0xb49e('0x3a'))){_0x45ad67['limit']=qs['limit'](_0x9a7c35[_0xb49e('0x32')][_0xb49e('0x1d')]);_0x45ad67[_0xb49e('0x1c')]=qs[_0xb49e('0x1c')](_0x9a7c35['query'][_0xb49e('0x1c')]);}_0x45ad67[_0xb49e('0x3b')]=qs[_0xb49e('0x3c')](_0x9a7c35[_0xb49e('0x32')]['sort']);_0x45ad67[_0xb49e('0x3d')]=qs[_0xb49e('0x34')](_[_0xb49e('0x3e')](_0x9a7c35[_0xb49e('0x32')],_0x41349b['filters']),_0x1a3763);if(_0x9a7c35['query'][_0xb49e('0x3f')]){_0x45ad67[_0xb49e('0x3d')]=_[_0xb49e('0x40')](_0x45ad67[_0xb49e('0x3d')],{'$or':_[_0xb49e('0x2c')](_0x1a3763,function(_0x4859c6){if(_0x4859c6[_0xb49e('0x2f')]!==_0xb49e('0x41')){var _0x14f809={};_0x14f809[_0x4859c6[_0xb49e('0x29')]]={'$like':'%'+_0x9a7c35['query'][_0xb49e('0x3f')]+'%'};return _0x14f809;}})});}_0x45ad67=_['merge']({},_0x45ad67,_0x9a7c35[_0xb49e('0x42')]);var _0x423662={'where':_0x45ad67[_0xb49e('0x3d')]};return db[_0xb49e('0x2d')][_0xb49e('0x1f')](_0x423662)[_0xb49e('0x25')](function(_0xf4bec6){_0x1f44dc[_0xb49e('0x1f')]=_0xf4bec6;if(_0x9a7c35[_0xb49e('0x32')]['includeAll']){_0x45ad67['include']=[{'all':!![]}];}return db[_0xb49e('0x2d')][_0xb49e('0x43')](_0x45ad67);})['then'](function(_0x1d9645){_0x1f44dc[_0xb49e('0x44')]=_0x1d9645;return _0x1f44dc;})['then'](respondWithFilteredResult(_0x203251,_0x45ad67))[_0xb49e('0x45')](handleError(_0x203251,null));};exports['show']=function(_0xebbdb7,_0x36133f){var _0x1d31e2={'raw':!![],'where':{'id':_0xebbdb7[_0xb49e('0x46')]['id']}},_0xe7275d={};_0xe7275d[_0xb49e('0x31')]=_[_0xb49e('0x33')](db['JscriptyQuestionReport']['rawAttributes']);_0xe7275d[_0xb49e('0x32')]=_[_0xb49e('0x33')](_0xebbdb7['query']);_0xe7275d[_0xb49e('0x34')]=_[_0xb49e('0x35')](_0xe7275d[_0xb49e('0x31')],_0xe7275d[_0xb49e('0x32')]);_0x1d31e2[_0xb49e('0x36')]=_[_0xb49e('0x35')](_0xe7275d[_0xb49e('0x31')],qs['fields'](_0xebbdb7[_0xb49e('0x32')][_0xb49e('0x37')]));_0x1d31e2[_0xb49e('0x36')]=_0x1d31e2['attributes']['length']?_0x1d31e2[_0xb49e('0x36')]:_0xe7275d['model'];if(_0xebbdb7[_0xb49e('0x32')]['includeAll']){_0x1d31e2[_0xb49e('0x47')]=[{'all':!![]}];}_0x1d31e2=_[_0xb49e('0x40')]({},_0x1d31e2,_0xebbdb7[_0xb49e('0x42')]);return db[_0xb49e('0x2d')][_0xb49e('0x48')](_0x1d31e2)['then'](handleEntityNotFound(_0x36133f,null))[_0xb49e('0x25')](respondWithResult(_0x36133f,null))['catch'](handleError(_0x36133f,null));};exports[_0xb49e('0x49')]=function(_0x126f93,_0x444268){return db[_0xb49e('0x2d')][_0xb49e('0x49')](_0x126f93[_0xb49e('0x4a')],{})[_0xb49e('0x25')](respondWithResult(_0x444268,0xc9))[_0xb49e('0x45')](handleError(_0x444268,null));};exports['update']=function(_0x291519,_0x156721){if(_0x291519[_0xb49e('0x4a')]['id']){delete _0x291519['body']['id'];}return db[_0xb49e('0x2d')][_0xb49e('0x48')]({'where':{'id':_0x291519['params']['id']}})['then'](handleEntityNotFound(_0x156721,null))[_0xb49e('0x25')](saveUpdates(_0x291519[_0xb49e('0x4a')],null))[_0xb49e('0x25')](respondWithResult(_0x156721,null))[_0xb49e('0x45')](handleError(_0x156721,null));};exports['destroy']=function(_0x153163,_0xa56c28){return db[_0xb49e('0x2d')][_0xb49e('0x48')]({'where':{'id':_0x153163[_0xb49e('0x46')]['id']}})[_0xb49e('0x25')](handleEntityNotFound(_0xa56c28,null))['then'](removeEntity(_0xa56c28,null))[_0xb49e('0x45')](handleError(_0xa56c28,null));};exports[_0xb49e('0x4b')]=function(_0x400d89,_0x351b00){return db[_0xb49e('0x2d')][_0xb49e('0x4b')]()[_0xb49e('0x25')](respondWithResult(_0x351b00,null))['catch'](handleError(_0x351b00,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 37eb357..2986e6d 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 _0x64b9=['exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','path','rimraf','./jscriptyQuestionReport.attributes'];(function(_0x2ef252,_0x1993fe){var _0x1139ca=function(_0x31f949){while(--_0x31f949){_0x2ef252['push'](_0x2ef252['shift']());}};_0x1139ca(++_0x1993fe);}(_0x64b9,0x159));var _0x964b=function(_0x48bf12,_0x24041b){_0x48bf12=_0x48bf12-0x0;var _0x4844f8=_0x64b9[_0x48bf12];return _0x4844f8;};'use strict';var _=require(_0x964b('0x0'));var util=require(_0x964b('0x1'));var logger=require(_0x964b('0x2'))(_0x964b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x964b('0x4'));var rimraf=require(_0x964b('0x5'));var config=require('../../config/environment');var attributes=require(_0x964b('0x6'));module[_0x964b('0x7')]=function(_0x4910fe,_0xa4a0ee){return _0x4910fe[_0x964b('0x8')](_0x964b('0x9'),attributes,{'tableName':_0x964b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3c3=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd3c3,0x8c));var _0x3d3c=function(_0x510c08,_0x4aa014){_0x510c08=_0x510c08-0x0;var _0x52c95e=_0xd3c3[_0x510c08];return _0x52c95e;};'use strict';var _=require('lodash');var util=require(_0x3d3c('0x0'));var logger=require(_0x3d3c('0x1'))(_0x3d3c('0x2'));var moment=require(_0x3d3c('0x3'));var BPromise=require(_0x3d3c('0x4'));var rp=require(_0x3d3c('0x5'));var fs=require('fs');var path=require(_0x3d3c('0x6'));var rimraf=require('rimraf');var config=require(_0x3d3c('0x7'));var attributes=require(_0x3d3c('0x8'));module[_0x3d3c('0x9')]=function(_0x4511c4,_0x4d2b85){return _0x4511c4[_0x3d3c('0xa')](_0x3d3c('0xb'),attributes,{'tableName':_0x3d3c('0xc'),'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 18a91d2..470cb64 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 _0x6306=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35e8ee,_0x9ac861){var _0x59a1ae=function(_0x434744){while(--_0x434744){_0x35e8ee['push'](_0x35e8ee['shift']());}};_0x59a1ae(++_0x9ac861);}(_0x6306,0xe8));var _0x6630=function(_0x226a12,_0x1969e2){_0x226a12=_0x226a12-0x0;var _0x118479=_0x6306[_0x226a12];return _0x118479;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6630('0x0'));var BPromise=require(_0x6630('0x1'));var rs=require(_0x6630('0x2'));var fs=require('fs');var Redis=require(_0x6630('0x3'));var db=require(_0x6630('0x4'))['db'];var utils=require(_0x6630('0x5'));var logger=require(_0x6630('0x6'))('rpc');var config=require(_0x6630('0x7'));var jayson=require(_0x6630('0x8'));var client=jayson[_0x6630('0x9')][_0x6630('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d29f7,_0xf88b13,_0x479e89){return new BPromise(function(_0x34759d,_0xd68e77){return client[_0x6630('0xb')](_0x4d29f7,_0x479e89)[_0x6630('0xc')](function(_0x2c8e95){logger['info'](_0x6630('0xd'),_0xf88b13,_0x6630('0xe'));logger[_0x6630('0xf')](_0x6630('0x10'),_0xf88b13,_0x6630('0xe'),JSON[_0x6630('0x11')](_0x2c8e95));if(_0x2c8e95[_0x6630('0x12')]){if(_0x2c8e95['error'][_0x6630('0x13')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0xf88b13,_0x2c8e95[_0x6630('0x12')]['message']);return _0xd68e77(_0x2c8e95[_0x6630('0x12')][_0x6630('0x14')]);}logger[_0x6630('0x12')](_0x6630('0xd'),_0xf88b13,_0x2c8e95['error'][_0x6630('0x14')]);return _0x34759d(_0x2c8e95[_0x6630('0x12')][_0x6630('0x14')]);}else{logger['info'](_0x6630('0xd'),_0xf88b13,'request\x20sent');_0x34759d(_0x2c8e95[_0x6630('0x15')][_0x6630('0x14')]);}})[_0x6630('0x16')](function(_0x1a3c0e){logger[_0x6630('0x12')](_0x6630('0xd'),_0xf88b13,_0x1a3c0e);_0xd68e77(_0x1a3c0e);});});} \ No newline at end of file +var _0x942b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3ac09b,_0x5e89cd){var _0x3744a6=function(_0x9f735){while(--_0x9f735){_0x3ac09b['push'](_0x3ac09b['shift']());}};_0x3744a6(++_0x5e89cd);}(_0x942b,0x182));var _0xb942=function(_0x4edb97,_0x35b799){_0x4edb97=_0x4edb97-0x0;var _0x3c4940=_0x942b[_0x4edb97];return _0x3c4940;};'use strict';var _=require(_0xb942('0x0'));var util=require(_0xb942('0x1'));var moment=require(_0xb942('0x2'));var BPromise=require(_0xb942('0x3'));var rs=require(_0xb942('0x4'));var fs=require('fs');var Redis=require(_0xb942('0x5'));var db=require(_0xb942('0x6'))['db'];var utils=require(_0xb942('0x7'));var logger=require(_0xb942('0x8'))(_0xb942('0x9'));var config=require(_0xb942('0xa'));var jayson=require(_0xb942('0xb'));var client=jayson[_0xb942('0xc')][_0xb942('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2613cf,_0x438106,_0xdb6a9d){return new BPromise(function(_0x2ee30c,_0x7d5c0){return client[_0xb942('0xe')](_0x2613cf,_0xdb6a9d)['then'](function(_0x3a80b9){logger['info'](_0xb942('0xf'),_0x438106,_0xb942('0x10'));logger['debug'](_0xb942('0x11'),_0x438106,_0xb942('0x10'),JSON[_0xb942('0x12')](_0x3a80b9));if(_0x3a80b9['error']){if(_0x3a80b9[_0xb942('0x13')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x438106,_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);return _0x7d5c0(_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);}logger[_0xb942('0x13')](_0xb942('0xf'),_0x438106,_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);return _0x2ee30c(_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);}else{logger['info'](_0xb942('0xf'),_0x438106,_0xb942('0x10'));_0x2ee30c(_0x3a80b9[_0xb942('0x15')]['message']);}})[_0xb942('0x16')](function(_0x4dcbd5){logger[_0xb942('0x13')](_0xb942('0xf'),_0x438106,_0x4dcbd5);_0x7d5c0(_0x4dcbd5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e2e3b4f..9e234fe 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 _0x8dca=['Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/questions','getQuestions','post','create','update','delete','destroy','exports','multer','util','express'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8dca,0x173));var _0xa8dc=function(_0x321b5e,_0x39da64){_0x321b5e=_0x321b5e-0x0;var _0x436c26=_0x8dca[_0x321b5e];return _0x436c26;};'use strict';var multer=require(_0xa8dc('0x0'));var util=require(_0xa8dc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa8dc('0x2'));var router=express[_0xa8dc('0x3')]();var fs_extra=require(_0xa8dc('0x4'));var auth=require(_0xa8dc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8dc('0x6'));var controller=require(_0xa8dc('0x7'));router[_0xa8dc('0x8')]('/',auth[_0xa8dc('0x9')](),controller[_0xa8dc('0xa')]);router[_0xa8dc('0x8')](_0xa8dc('0xb'),auth['isAuthenticated'](),controller[_0xa8dc('0xc')]);router[_0xa8dc('0x8')](_0xa8dc('0xd'),auth[_0xa8dc('0x9')](),controller['show']);router[_0xa8dc('0x8')](_0xa8dc('0xe'),auth[_0xa8dc('0x9')](),controller[_0xa8dc('0xf')]);router[_0xa8dc('0x10')]('/',auth[_0xa8dc('0x9')](),controller[_0xa8dc('0x11')]);router['put'](_0xa8dc('0xd'),auth[_0xa8dc('0x9')](),controller[_0xa8dc('0x12')]);router[_0xa8dc('0x13')](_0xa8dc('0xd'),auth[_0xa8dc('0x9')](),controller[_0xa8dc('0x14')]);module[_0xa8dc('0x15')]=router; \ No newline at end of file +var _0x6963=['describe','get','/:id','show','/:id/questions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','/describe'];(function(_0x3f49f0,_0x38fd8c){var _0x37586f=function(_0x5c76c8){while(--_0x5c76c8){_0x3f49f0['push'](_0x3f49f0['shift']());}};_0x37586f(++_0x38fd8c);}(_0x6963,0xf1));var _0x3696=function(_0xeab08f,_0x4000f2){_0xeab08f=_0xeab08f-0x0;var _0x5b563e=_0x6963[_0xeab08f];return _0x5b563e;};'use strict';var multer=require(_0x3696('0x0'));var util=require(_0x3696('0x1'));var path=require(_0x3696('0x2'));var timeout=require(_0x3696('0x3'));var express=require(_0x3696('0x4'));var router=express[_0x3696('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3696('0x6'));var controller=require(_0x3696('0x7'));router['get']('/',auth[_0x3696('0x8')](),controller[_0x3696('0x9')]);router['get'](_0x3696('0xa'),auth[_0x3696('0x8')](),controller[_0x3696('0xb')]);router[_0x3696('0xc')](_0x3696('0xd'),auth[_0x3696('0x8')](),controller[_0x3696('0xe')]);router[_0x3696('0xc')](_0x3696('0xf'),auth[_0x3696('0x8')](),controller['getQuestions']);router['post']('/',auth['isAuthenticated'](),controller[_0x3696('0x10')]);router[_0x3696('0x11')](_0x3696('0xd'),auth['isAuthenticated'](),controller[_0x3696('0x12')]);router['delete'](_0x3696('0xd'),auth[_0x3696('0x8')](),controller[_0x3696('0x13')]);module[_0x3696('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 96baf3f..d7d969e 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 _0x0a39=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE','setDataValue'];(function(_0x3082d7,_0x4848f1){var _0x2cfc57=function(_0x5a4c6d){while(--_0x5a4c6d){_0x3082d7['push'](_0x3082d7['shift']());}};_0x2cfc57(++_0x4848f1);}(_0x0a39,0x176));var _0x90a3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0a39[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x90a3('0x0'));var Sequelize=require('sequelize');module[_0x90a3('0x1')]={'starttime':{'type':Sequelize[_0x90a3('0x2')],'set':function(_0x49f625){this[_0x90a3('0x3')](_0x90a3('0x4'),_0x49f625);this[_0x90a3('0x3')](_0x90a3('0x5'),moment()[_0x90a3('0x6')](_0x90a3('0x7')));}},'endtime':{'type':Sequelize[_0x90a3('0x2')]},'membername':{'type':Sequelize[_0x90a3('0x8')]},'projectname':{'type':Sequelize[_0x90a3('0x8')]},'queue':{'type':Sequelize[_0x90a3('0x8')]},'uniqueid':{'type':Sequelize[_0x90a3('0x8')]},'calleridname':{'type':Sequelize[_0x90a3('0x8')]},'calleridnum':{'type':Sequelize[_0x90a3('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb4f2=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue'];(function(_0x167b08,_0xc4e643){var _0x53c9bb=function(_0x53792d){while(--_0x53792d){_0x167b08['push'](_0x167b08['shift']());}};_0x53c9bb(++_0xc4e643);}(_0xb4f2,0x196));var _0x2b4f=function(_0x3150a8,_0x5513aa){_0x3150a8=_0x3150a8-0x0;var _0x8e6005=_0xb4f2[_0x3150a8];return _0x8e6005;};'use strict';var moment=require(_0x2b4f('0x0'));var Sequelize=require('sequelize');module[_0x2b4f('0x1')]={'starttime':{'type':Sequelize[_0x2b4f('0x2')],'set':function(_0x281880){this[_0x2b4f('0x3')](_0x2b4f('0x4'),_0x281880);this[_0x2b4f('0x3')](_0x2b4f('0x5'),moment()[_0x2b4f('0x6')](_0x2b4f('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2b4f('0x8')]},'projectname':{'type':Sequelize[_0x2b4f('0x8')]},'queue':{'type':Sequelize[_0x2b4f('0x8')]},'uniqueid':{'type':Sequelize[_0x2b4f('0x8')]},'calleridname':{'type':Sequelize[_0x2b4f('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x2b4f('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 0dac998..f9ede76 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 _0x2035=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','zip-dir','mustache','util','path','sox'];(function(_0x994e65,_0x3c7807){var _0x1773d1=function(_0x15d7c2){while(--_0x15d7c2){_0x994e65['push'](_0x994e65['shift']());}};_0x1773d1(++_0x3c7807);}(_0x2035,0x137));var _0x5203=function(_0x59d945,_0x105bce){_0x59d945=_0x59d945-0x0;var _0x1d3cf1=_0x2035[_0x59d945];return _0x1d3cf1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5203('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5203('0x1'));var util=require(_0x5203('0x2'));var path=require(_0x5203('0x3'));var sox=require(_0x5203('0x4'));var csv=require(_0x5203('0x5'));var ejs=require(_0x5203('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5203('0x7'));var squel=require('squel');var crypto=require(_0x5203('0x8'));var jsforce=require(_0x5203('0x9'));var deskjs=require(_0x5203('0xa'));var toCsv=require(_0x5203('0x5'));var querystring=require(_0x5203('0xb'));var Papa=require(_0x5203('0xc'));var Redis=require(_0x5203('0xd'));var authService=require(_0x5203('0xe'));var qs=require(_0x5203('0xf'));var as=require(_0x5203('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5203('0x11'))('api');var utils=require(_0x5203('0x12'));var config=require(_0x5203('0x13'));var licenseUtil=require(_0x5203('0x14'));var db=require(_0x5203('0x15'))['db'];function respondWithStatusCode(_0x31c920,_0x241da2){_0x241da2=_0x241da2||0xcc;return function(_0x55dc8a){if(_0x55dc8a){return _0x31c920[_0x5203('0x16')](_0x241da2);}return _0x31c920[_0x5203('0x17')](_0x241da2)[_0x5203('0x18')]();};}function respondWithResult(_0x1dfca4,_0x27ef73){_0x27ef73=_0x27ef73||0xc8;return function(_0x2d7677){if(_0x2d7677){return _0x1dfca4[_0x5203('0x17')](_0x27ef73)[_0x5203('0x19')](_0x2d7677);}};}function respondWithFilteredResult(_0x3786a0,_0x41a5d8){return function(_0x14c236){if(_0x14c236){var _0x650443=typeof _0x41a5d8[_0x5203('0x1a')]==='undefined'&&typeof _0x41a5d8[_0x5203('0x1b')]===_0x5203('0x1c');var _0x343c91=_0x14c236['count'];var _0x1880bb=_0x650443?0x0:_0x41a5d8[_0x5203('0x1a')];var _0x3610ad=_0x650443?_0x14c236[_0x5203('0x1d')]:_0x41a5d8[_0x5203('0x1a')]+_0x41a5d8[_0x5203('0x1b')];var _0x438b42;if(_0x3610ad>=_0x343c91){_0x3610ad=_0x343c91;_0x438b42=0xc8;}else{_0x438b42=0xce;}_0x3786a0[_0x5203('0x17')](_0x438b42);return _0x3786a0[_0x5203('0x1e')](_0x5203('0x1f'),_0x1880bb+'-'+_0x3610ad+'/'+_0x343c91)[_0x5203('0x19')](_0x14c236);}return null;};}function patchUpdates(_0x1ecb30){return function(_0x3d79ce){try{jsonpatch[_0x5203('0x20')](_0x3d79ce,_0x1ecb30,!![]);}catch(_0x177440){return BPromise[_0x5203('0x21')](_0x177440);}return _0x3d79ce['save']();};}function saveUpdates(_0x3b5a55,_0x20f10b){return function(_0x58566f){if(_0x58566f){return _0x58566f['update'](_0x3b5a55)[_0x5203('0x22')](function(_0x51334e){return _0x51334e;});}return null;};}function removeEntity(_0x3618dc,_0x2b9edc){return function(_0x28cbb1){if(_0x28cbb1){return _0x28cbb1[_0x5203('0x23')]()[_0x5203('0x22')](function(){_0x3618dc[_0x5203('0x17')](0xcc)[_0x5203('0x18')]();});}};}function handleEntityNotFound(_0x32a0e9,_0x21ebe0){return function(_0x1f3bbc){if(!_0x1f3bbc){_0x32a0e9['sendStatus'](0x194);}return _0x1f3bbc;};}function handleError(_0x52bf45,_0x11e5c3){_0x11e5c3=_0x11e5c3||0x1f4;return function(_0x14f6f2){logger[_0x5203('0x24')](_0x14f6f2[_0x5203('0x25')]);if(_0x14f6f2['name']){delete _0x14f6f2[_0x5203('0x26')];}_0x52bf45[_0x5203('0x17')](_0x11e5c3)[_0x5203('0x27')](_0x14f6f2);};}exports[_0x5203('0x28')]=function(_0x2ad9f3,_0x492148){var _0x5d51e0={},_0xf360e9={},_0x341577={'count':0x0,'rows':[]};var _0x5051c0=_[_0x5203('0x29')](db[_0x5203('0x2a')][_0x5203('0x2b')],function(_0x479e03){return{'name':_0x479e03[_0x5203('0x2c')],'type':_0x479e03[_0x5203('0x2d')][_0x5203('0x2e')]};});_0xf360e9[_0x5203('0x2f')]=_['map'](_0x5051c0,_0x5203('0x26'));_0xf360e9['query']=_[_0x5203('0x30')](_0x2ad9f3['query']);_0xf360e9[_0x5203('0x31')]=_[_0x5203('0x32')](_0xf360e9[_0x5203('0x2f')],_0xf360e9[_0x5203('0x33')]);_0x5d51e0['attributes']=_[_0x5203('0x32')](_0xf360e9['model'],qs[_0x5203('0x34')](_0x2ad9f3[_0x5203('0x33')][_0x5203('0x34')]));_0x5d51e0[_0x5203('0x35')]=_0x5d51e0['attributes'][_0x5203('0x36')]?_0x5d51e0[_0x5203('0x35')]:_0xf360e9[_0x5203('0x2f')];if(!_0x2ad9f3[_0x5203('0x33')]['hasOwnProperty']('nolimit')){_0x5d51e0[_0x5203('0x1b')]=qs[_0x5203('0x1b')](_0x2ad9f3['query'][_0x5203('0x1b')]);_0x5d51e0['offset']=qs[_0x5203('0x1a')](_0x2ad9f3[_0x5203('0x33')][_0x5203('0x1a')]);}_0x5d51e0[_0x5203('0x37')]=qs[_0x5203('0x38')](_0x2ad9f3[_0x5203('0x33')]['sort']);_0x5d51e0[_0x5203('0x39')]=qs[_0x5203('0x31')](_[_0x5203('0x3a')](_0x2ad9f3[_0x5203('0x33')],_0xf360e9['filters']),_0x5051c0);if(_0x2ad9f3[_0x5203('0x33')][_0x5203('0x3b')]){_0x5d51e0[_0x5203('0x39')]=_['merge'](_0x5d51e0[_0x5203('0x39')],{'$or':_[_0x5203('0x29')](_0x5051c0,function(_0x3e104b){if(_0x3e104b['type']!==_0x5203('0x3c')){var _0x4d471c={};_0x4d471c[_0x3e104b['name']]={'$like':'%'+_0x2ad9f3[_0x5203('0x33')][_0x5203('0x3b')]+'%'};return _0x4d471c;}})});}_0x5d51e0=_[_0x5203('0x3d')]({},_0x5d51e0,_0x2ad9f3['options']);var _0xe2a82b={'where':_0x5d51e0[_0x5203('0x39')]};return db['JscriptySessionReport'][_0x5203('0x1d')](_0xe2a82b)[_0x5203('0x22')](function(_0x92de55){_0x341577[_0x5203('0x1d')]=_0x92de55;if(_0x2ad9f3[_0x5203('0x33')]['includeAll']){_0x5d51e0[_0x5203('0x3e')]=[{'all':!![]}];}return db[_0x5203('0x2a')][_0x5203('0x3f')](_0x5d51e0);})[_0x5203('0x22')](function(_0x2f684f){_0x341577[_0x5203('0x40')]=_0x2f684f;return _0x341577;})[_0x5203('0x22')](respondWithFilteredResult(_0x492148,_0x5d51e0))['catch'](handleError(_0x492148,null));};exports[_0x5203('0x41')]=function(_0x2d2a1b,_0x5cec57){var _0xdf3620={'raw':!![],'where':{'id':_0x2d2a1b[_0x5203('0x42')]['id']}},_0x22ead0={};_0x22ead0[_0x5203('0x2f')]=_[_0x5203('0x30')](db[_0x5203('0x2a')]['rawAttributes']);_0x22ead0[_0x5203('0x33')]=_['keys'](_0x2d2a1b['query']);_0x22ead0[_0x5203('0x31')]=_['intersection'](_0x22ead0[_0x5203('0x2f')],_0x22ead0['query']);_0xdf3620[_0x5203('0x35')]=_[_0x5203('0x32')](_0x22ead0[_0x5203('0x2f')],qs[_0x5203('0x34')](_0x2d2a1b['query']['fields']));_0xdf3620[_0x5203('0x35')]=_0xdf3620[_0x5203('0x35')][_0x5203('0x36')]?_0xdf3620[_0x5203('0x35')]:_0x22ead0[_0x5203('0x2f')];if(_0x2d2a1b[_0x5203('0x33')][_0x5203('0x43')]){_0xdf3620[_0x5203('0x3e')]=[{'all':!![]}];}_0xdf3620=_[_0x5203('0x3d')]({},_0xdf3620,_0x2d2a1b[_0x5203('0x44')]);return db[_0x5203('0x2a')][_0x5203('0x45')](_0xdf3620)[_0x5203('0x22')](handleEntityNotFound(_0x5cec57,null))['then'](respondWithResult(_0x5cec57,null))[_0x5203('0x46')](handleError(_0x5cec57,null));};exports[_0x5203('0x47')]=function(_0x36fed8,_0x3e4d10){return db['JscriptySessionReport']['create'](_0x36fed8[_0x5203('0x48')],{})[_0x5203('0x22')](respondWithResult(_0x3e4d10,0xc9))[_0x5203('0x46')](handleError(_0x3e4d10,null));};exports['update']=function(_0x9338df,_0x38739c){if(_0x9338df[_0x5203('0x48')]['id']){delete _0x9338df[_0x5203('0x48')]['id'];}return db['JscriptySessionReport'][_0x5203('0x45')]({'where':{'id':_0x9338df['params']['id']}})[_0x5203('0x22')](handleEntityNotFound(_0x38739c,null))[_0x5203('0x22')](saveUpdates(_0x9338df[_0x5203('0x48')],null))[_0x5203('0x22')](respondWithResult(_0x38739c,null))['catch'](handleError(_0x38739c,null));};exports[_0x5203('0x23')]=function(_0x371a90,_0x246742){return db[_0x5203('0x2a')][_0x5203('0x45')]({'where':{'id':_0x371a90['params']['id']}})[_0x5203('0x22')](handleEntityNotFound(_0x246742,null))[_0x5203('0x22')](removeEntity(_0x246742,null))[_0x5203('0x46')](handleError(_0x246742,null));};exports[_0x5203('0x49')]=function(_0x59d395,_0x22d99e){return db[_0x5203('0x2a')][_0x5203('0x49')]()[_0x5203('0x22')](respondWithResult(_0x22d99e,null))['catch'](handleError(_0x22d99e,null));};exports[_0x5203('0x4a')]=function(_0x258f7f,_0x3616f5,_0x5e44e4){var _0xe06f78={'raw':!![],'where':{}};var _0x7776b8={};var _0x471d8f={'count':0x0,'rows':[]};return db[_0x5203('0x2a')][_0x5203('0x4b')]({'where':{'id':_0x258f7f[_0x5203('0x42')]['id']}})[_0x5203('0x22')](handleEntityNotFound(_0x3616f5,null))[_0x5203('0x22')](function(_0x514861){if(_0x514861){_0x7776b8[_0x5203('0x2f')]=_[_0x5203('0x30')](db[_0x5203('0x4c')][_0x5203('0x2b')]);_0x7776b8[_0x5203('0x33')]=_[_0x5203('0x30')](_0x258f7f['query']);_0x7776b8[_0x5203('0x31')]=_['intersection'](_0x7776b8['model'],_0x7776b8['query']);_0xe06f78[_0x5203('0x35')]=_[_0x5203('0x32')](_0x7776b8[_0x5203('0x2f')],qs[_0x5203('0x34')](_0x258f7f[_0x5203('0x33')]['fields']));_0xe06f78['attributes']=_0xe06f78['attributes'][_0x5203('0x36')]?_0xe06f78[_0x5203('0x35')]:_0x7776b8[_0x5203('0x2f')];if(!_0x258f7f[_0x5203('0x33')]['hasOwnProperty'](_0x5203('0x4d'))){_0xe06f78[_0x5203('0x1b')]=qs[_0x5203('0x1b')](_0x258f7f[_0x5203('0x33')]['limit']);_0xe06f78[_0x5203('0x1a')]=qs[_0x5203('0x1a')](_0x258f7f['query'][_0x5203('0x1a')]);}_0xe06f78[_0x5203('0x37')]=qs['sort'](_0x258f7f[_0x5203('0x33')][_0x5203('0x38')]);_0xe06f78[_0x5203('0x39')]=qs['filters'](_[_0x5203('0x3a')](_0x258f7f[_0x5203('0x33')],_0x7776b8['filters']));_0xe06f78[_0x5203('0x39')][_0x5203('0x4e')]=_0x514861['id'];if(_0x258f7f['query'][_0x5203('0x3b')]){_0xe06f78[_0x5203('0x39')]=_['merge'](_0xe06f78[_0x5203('0x39')],{'$or':_['map'](_0xe06f78[_0x5203('0x35')],function(_0x316468){var _0x43ad1c={};_0x43ad1c[_0x316468]={'$like':'%'+_0x258f7f[_0x5203('0x33')][_0x5203('0x3b')]+'%'};return _0x43ad1c;})});}_0xe06f78=_[_0x5203('0x3d')]({},_0xe06f78,_0x258f7f[_0x5203('0x44')]);return db[_0x5203('0x4c')][_0x5203('0x1d')]({'where':_0xe06f78[_0x5203('0x39')]})[_0x5203('0x22')](function(_0x40742d){_0x471d8f[_0x5203('0x1d')]=_0x40742d;if(_0x258f7f[_0x5203('0x33')][_0x5203('0x43')]){_0xe06f78[_0x5203('0x3e')]=[{'all':!![]}];}return db[_0x5203('0x4c')][_0x5203('0x3f')](_0xe06f78);})[_0x5203('0x22')](function(_0x1731cc){_0x471d8f[_0x5203('0x40')]=_0x1731cc;return _0x471d8f;});}})[_0x5203('0x22')](respondWithFilteredResult(_0x3616f5,_0xe06f78))[_0x5203('0x46')](handleError(_0x3616f5,null));}; \ No newline at end of file +var _0xed37=['undefined','limit','count','set','Content-Range','save','update','then','error','stack','send','index','JscriptySessionReport','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0xed37,0x14e));var _0x7ed3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xed37[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x7ed3('0x0'));var rimraf=require(_0x7ed3('0x1'));var zipdir=require(_0x7ed3('0x2'));var jsonpatch=require(_0x7ed3('0x3'));var rp=require(_0x7ed3('0x4'));var moment=require(_0x7ed3('0x5'));var BPromise=require(_0x7ed3('0x6'));var Mustache=require(_0x7ed3('0x7'));var util=require(_0x7ed3('0x8'));var path=require('path');var sox=require(_0x7ed3('0x9'));var csv=require('to-csv');var ejs=require(_0x7ed3('0xa'));var fs=require('fs');var fs_extra=require(_0x7ed3('0xb'));var _=require('lodash');var squel=require(_0x7ed3('0xc'));var crypto=require('crypto');var jsforce=require(_0x7ed3('0xd'));var deskjs=require(_0x7ed3('0xe'));var toCsv=require(_0x7ed3('0xf'));var querystring=require('querystring');var Papa=require(_0x7ed3('0x10'));var Redis=require('ioredis');var authService=require(_0x7ed3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ed3('0x12'));var logger=require('../../config/logger')(_0x7ed3('0x13'));var utils=require('../../config/utils');var config=require(_0x7ed3('0x14'));var licenseUtil=require(_0x7ed3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aeede,_0x47b8fd){_0x47b8fd=_0x47b8fd||0xcc;return function(_0x52db59){if(_0x52db59){return _0x5aeede[_0x7ed3('0x16')](_0x47b8fd);}return _0x5aeede[_0x7ed3('0x17')](_0x47b8fd)['end']();};}function respondWithResult(_0x5aaa39,_0x175131){_0x175131=_0x175131||0xc8;return function(_0x1b3d91){if(_0x1b3d91){return _0x5aaa39[_0x7ed3('0x17')](_0x175131)[_0x7ed3('0x18')](_0x1b3d91);}};}function respondWithFilteredResult(_0x24db36,_0x472751){return function(_0x3835de){if(_0x3835de){var _0x4657ba=typeof _0x472751[_0x7ed3('0x19')]===_0x7ed3('0x1a')&&typeof _0x472751[_0x7ed3('0x1b')]===_0x7ed3('0x1a');var _0x40d8c0=_0x3835de[_0x7ed3('0x1c')];var _0x55ba8d=_0x4657ba?0x0:_0x472751[_0x7ed3('0x19')];var _0x3ce4fb=_0x4657ba?_0x3835de['count']:_0x472751['offset']+_0x472751[_0x7ed3('0x1b')];var _0xed38bf;if(_0x3ce4fb>=_0x40d8c0){_0x3ce4fb=_0x40d8c0;_0xed38bf=0xc8;}else{_0xed38bf=0xce;}_0x24db36[_0x7ed3('0x17')](_0xed38bf);return _0x24db36[_0x7ed3('0x1d')](_0x7ed3('0x1e'),_0x55ba8d+'-'+_0x3ce4fb+'/'+_0x40d8c0)['json'](_0x3835de);}return null;};}function patchUpdates(_0xb5bb95){return function(_0x36fa58){try{jsonpatch['apply'](_0x36fa58,_0xb5bb95,!![]);}catch(_0x2c5716){return BPromise['reject'](_0x2c5716);}return _0x36fa58[_0x7ed3('0x1f')]();};}function saveUpdates(_0x3a6f67,_0x2ebea9){return function(_0x274c72){if(_0x274c72){return _0x274c72[_0x7ed3('0x20')](_0x3a6f67)[_0x7ed3('0x21')](function(_0x568b2c){return _0x568b2c;});}return null;};}function removeEntity(_0xb03175,_0x563a09){return function(_0x65484){if(_0x65484){return _0x65484['destroy']()[_0x7ed3('0x21')](function(){_0xb03175['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3177ce,_0x42f404){return function(_0x1a2e49){if(!_0x1a2e49){_0x3177ce[_0x7ed3('0x16')](0x194);}return _0x1a2e49;};}function handleError(_0x3eac89,_0x1203d9){_0x1203d9=_0x1203d9||0x1f4;return function(_0x24a07f){logger[_0x7ed3('0x22')](_0x24a07f[_0x7ed3('0x23')]);if(_0x24a07f['name']){delete _0x24a07f['name'];}_0x3eac89['status'](_0x1203d9)[_0x7ed3('0x24')](_0x24a07f);};}exports[_0x7ed3('0x25')]=function(_0x137daf,_0x436b33){var _0x3ab297={},_0x165998={},_0x2e5e0f={'count':0x0,'rows':[]};var _0x2365bd=_['map'](db[_0x7ed3('0x26')]['rawAttributes'],function(_0x30960d){return{'name':_0x30960d[_0x7ed3('0x27')],'type':_0x30960d['type']['key']};});_0x165998[_0x7ed3('0x28')]=_[_0x7ed3('0x29')](_0x2365bd,'name');_0x165998[_0x7ed3('0x2a')]=_[_0x7ed3('0x2b')](_0x137daf[_0x7ed3('0x2a')]);_0x165998[_0x7ed3('0x2c')]=_['intersection'](_0x165998[_0x7ed3('0x28')],_0x165998['query']);_0x3ab297['attributes']=_[_0x7ed3('0x2d')](_0x165998[_0x7ed3('0x28')],qs[_0x7ed3('0x2e')](_0x137daf['query'][_0x7ed3('0x2e')]));_0x3ab297[_0x7ed3('0x2f')]=_0x3ab297[_0x7ed3('0x2f')][_0x7ed3('0x30')]?_0x3ab297[_0x7ed3('0x2f')]:_0x165998['model'];if(!_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x31')]('nolimit')){_0x3ab297[_0x7ed3('0x1b')]=qs['limit'](_0x137daf['query'][_0x7ed3('0x1b')]);_0x3ab297[_0x7ed3('0x19')]=qs[_0x7ed3('0x19')](_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x19')]);}_0x3ab297[_0x7ed3('0x32')]=qs['sort'](_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x33')]);_0x3ab297['where']=qs[_0x7ed3('0x2c')](_['pick'](_0x137daf[_0x7ed3('0x2a')],_0x165998[_0x7ed3('0x2c')]),_0x2365bd);if(_0x137daf['query'][_0x7ed3('0x34')]){_0x3ab297[_0x7ed3('0x35')]=_[_0x7ed3('0x36')](_0x3ab297[_0x7ed3('0x35')],{'$or':_[_0x7ed3('0x29')](_0x2365bd,function(_0x3b7820){if(_0x3b7820['type']!=='VIRTUAL'){var _0x5b6e86={};_0x5b6e86[_0x3b7820['name']]={'$like':'%'+_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x34')]+'%'};return _0x5b6e86;}})});}_0x3ab297=_[_0x7ed3('0x36')]({},_0x3ab297,_0x137daf[_0x7ed3('0x37')]);var _0xaa8050={'where':_0x3ab297[_0x7ed3('0x35')]};return db[_0x7ed3('0x26')]['count'](_0xaa8050)['then'](function(_0xe975da){_0x2e5e0f[_0x7ed3('0x1c')]=_0xe975da;if(_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x38')]){_0x3ab297[_0x7ed3('0x39')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x7ed3('0x3a')](_0x3ab297);})['then'](function(_0x2953c9){_0x2e5e0f[_0x7ed3('0x3b')]=_0x2953c9;return _0x2e5e0f;})[_0x7ed3('0x21')](respondWithFilteredResult(_0x436b33,_0x3ab297))['catch'](handleError(_0x436b33,null));};exports[_0x7ed3('0x3c')]=function(_0xf4c814,_0x415019){var _0x57bf49={'raw':!![],'where':{'id':_0xf4c814[_0x7ed3('0x3d')]['id']}},_0x77d5de={};_0x77d5de[_0x7ed3('0x28')]=_['keys'](db[_0x7ed3('0x26')][_0x7ed3('0x3e')]);_0x77d5de[_0x7ed3('0x2a')]=_[_0x7ed3('0x2b')](_0xf4c814[_0x7ed3('0x2a')]);_0x77d5de[_0x7ed3('0x2c')]=_[_0x7ed3('0x2d')](_0x77d5de['model'],_0x77d5de[_0x7ed3('0x2a')]);_0x57bf49[_0x7ed3('0x2f')]=_['intersection'](_0x77d5de[_0x7ed3('0x28')],qs[_0x7ed3('0x2e')](_0xf4c814[_0x7ed3('0x2a')][_0x7ed3('0x2e')]));_0x57bf49['attributes']=_0x57bf49[_0x7ed3('0x2f')][_0x7ed3('0x30')]?_0x57bf49['attributes']:_0x77d5de[_0x7ed3('0x28')];if(_0xf4c814[_0x7ed3('0x2a')][_0x7ed3('0x38')]){_0x57bf49[_0x7ed3('0x39')]=[{'all':!![]}];}_0x57bf49=_[_0x7ed3('0x36')]({},_0x57bf49,_0xf4c814[_0x7ed3('0x37')]);return db['JscriptySessionReport'][_0x7ed3('0x3f')](_0x57bf49)[_0x7ed3('0x21')](handleEntityNotFound(_0x415019,null))['then'](respondWithResult(_0x415019,null))[_0x7ed3('0x40')](handleError(_0x415019,null));};exports['create']=function(_0x4c020f,_0x2f0cda){return db['JscriptySessionReport'][_0x7ed3('0x41')](_0x4c020f['body'],{})['then'](respondWithResult(_0x2f0cda,0xc9))[_0x7ed3('0x40')](handleError(_0x2f0cda,null));};exports[_0x7ed3('0x20')]=function(_0x5dbadc,_0x28e0cf){if(_0x5dbadc['body']['id']){delete _0x5dbadc['body']['id'];}return db[_0x7ed3('0x26')][_0x7ed3('0x3f')]({'where':{'id':_0x5dbadc[_0x7ed3('0x3d')]['id']}})[_0x7ed3('0x21')](handleEntityNotFound(_0x28e0cf,null))[_0x7ed3('0x21')](saveUpdates(_0x5dbadc['body'],null))[_0x7ed3('0x21')](respondWithResult(_0x28e0cf,null))[_0x7ed3('0x40')](handleError(_0x28e0cf,null));};exports['destroy']=function(_0x2fcbbc,_0x2089e0){return db['JscriptySessionReport'][_0x7ed3('0x3f')]({'where':{'id':_0x2fcbbc['params']['id']}})[_0x7ed3('0x21')](handleEntityNotFound(_0x2089e0,null))[_0x7ed3('0x21')](removeEntity(_0x2089e0,null))[_0x7ed3('0x40')](handleError(_0x2089e0,null));};exports[_0x7ed3('0x42')]=function(_0x46b0aa,_0x52d79f){return db['JscriptySessionReport'][_0x7ed3('0x42')]()[_0x7ed3('0x21')](respondWithResult(_0x52d79f,null))['catch'](handleError(_0x52d79f,null));};exports[_0x7ed3('0x43')]=function(_0x5001cc,_0x525e0c,_0x49f517){var _0x5e3157={'raw':!![],'where':{}};var _0x32d65b={};var _0x357874={'count':0x0,'rows':[]};return db[_0x7ed3('0x26')][_0x7ed3('0x44')]({'where':{'id':_0x5001cc['params']['id']}})[_0x7ed3('0x21')](handleEntityNotFound(_0x525e0c,null))[_0x7ed3('0x21')](function(_0x4d1e19){if(_0x4d1e19){_0x32d65b['model']=_['keys'](db[_0x7ed3('0x45')][_0x7ed3('0x3e')]);_0x32d65b[_0x7ed3('0x2a')]=_['keys'](_0x5001cc['query']);_0x32d65b[_0x7ed3('0x2c')]=_[_0x7ed3('0x2d')](_0x32d65b[_0x7ed3('0x28')],_0x32d65b[_0x7ed3('0x2a')]);_0x5e3157[_0x7ed3('0x2f')]=_[_0x7ed3('0x2d')](_0x32d65b[_0x7ed3('0x28')],qs[_0x7ed3('0x2e')](_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x2e')]));_0x5e3157['attributes']=_0x5e3157['attributes'][_0x7ed3('0x30')]?_0x5e3157[_0x7ed3('0x2f')]:_0x32d65b['model'];if(!_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x31')](_0x7ed3('0x46'))){_0x5e3157[_0x7ed3('0x1b')]=qs[_0x7ed3('0x1b')](_0x5001cc['query'][_0x7ed3('0x1b')]);_0x5e3157[_0x7ed3('0x19')]=qs[_0x7ed3('0x19')](_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x19')]);}_0x5e3157[_0x7ed3('0x32')]=qs['sort'](_0x5001cc[_0x7ed3('0x2a')]['sort']);_0x5e3157[_0x7ed3('0x35')]=qs['filters'](_[_0x7ed3('0x47')](_0x5001cc[_0x7ed3('0x2a')],_0x32d65b[_0x7ed3('0x2c')]));_0x5e3157[_0x7ed3('0x35')]['SessionId']=_0x4d1e19['id'];if(_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x34')]){_0x5e3157[_0x7ed3('0x35')]=_[_0x7ed3('0x36')](_0x5e3157['where'],{'$or':_[_0x7ed3('0x29')](_0x5e3157[_0x7ed3('0x2f')],function(_0x166922){var _0x4f8dcc={};_0x4f8dcc[_0x166922]={'$like':'%'+_0x5001cc['query'][_0x7ed3('0x34')]+'%'};return _0x4f8dcc;})});}_0x5e3157=_[_0x7ed3('0x36')]({},_0x5e3157,_0x5001cc['options']);return db[_0x7ed3('0x45')][_0x7ed3('0x1c')]({'where':_0x5e3157[_0x7ed3('0x35')]})[_0x7ed3('0x21')](function(_0x4c6541){_0x357874['count']=_0x4c6541;if(_0x5001cc['query'][_0x7ed3('0x38')]){_0x5e3157['include']=[{'all':!![]}];}return db[_0x7ed3('0x45')][_0x7ed3('0x3a')](_0x5e3157);})[_0x7ed3('0x21')](function(_0x5d5af3){_0x357874['rows']=_0x5d5af3;return _0x357874;});}})['then'](respondWithFilteredResult(_0x525e0c,_0x5e3157))[_0x7ed3('0x40')](handleError(_0x525e0c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 36dfcc3..daf609f 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 _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeda8,0x104));var _0x8eda=function(_0x47a47f,_0x2317fb){_0x47a47f=_0x47a47f-0x0;var _0x5e3076=_0xeda8[_0x47a47f];return _0x5e3076;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('JscriptySessionReport',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1036c1,_0x10bf6c){var _0x241268=function(_0x3c67f5){while(--_0x3c67f5){_0x1036c1['push'](_0x1036c1['shift']());}};_0x241268(++_0x10bf6c);}(_0x6050,0x196));var _0x0605=function(_0x67ee24,_0x4f6b54){_0x67ee24=_0x67ee24-0x0;var _0x2bd8db=_0x6050[_0x67ee24];return _0x2bd8db;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e8d01d3..cc145ea 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 _0x781d=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x11ca1e,_0x59d8c8){var _0x275bdd=function(_0x4d8d69){while(--_0x4d8d69){_0x11ca1e['push'](_0x11ca1e['shift']());}};_0x275bdd(++_0x59d8c8);}(_0x781d,0x14a));var _0xd781=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x781d[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});} \ No newline at end of file +var _0xb145=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message'];(function(_0x4572ec,_0x4942f0){var _0x24eea2=function(_0x5a9e3a){while(--_0x5a9e3a){_0x4572ec['push'](_0x4572ec['shift']());}};_0x24eea2(++_0x4942f0);}(_0xb145,0xa3));var _0x5b14=function(_0x5b0c0b,_0x15e06c){_0x5b0c0b=_0x5b0c0b-0x0;var _0x5c8f71=_0xb145[_0x5b0c0b];return _0x5c8f71;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5cfe70e..a88f37d 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 _0x932a=['index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x932a,0xc6));var _0xa932=function(_0x4a6a0e,_0x138b65){_0x4a6a0e=_0x4a6a0e-0x0;var _0x41091a=_0x932a[_0x4a6a0e];return _0x41091a;};'use strict';var multer=require(_0xa932('0x0'));var util=require(_0xa932('0x1'));var path=require(_0xa932('0x2'));var timeout=require(_0xa932('0x3'));var express=require(_0xa932('0x4'));var router=express[_0xa932('0x5')]();var fs_extra=require(_0xa932('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa932('0x7'));var config=require(_0xa932('0x8'));var controller=require(_0xa932('0x9'));router[_0xa932('0xa')]('/',controller[_0xa932('0xb')]);router[_0xa932('0xc')](_0xa932('0xd'),auth[_0xa932('0xe')](),controller[_0xa932('0xf')]);router[_0xa932('0xa')](_0xa932('0x10'),auth[_0xa932('0xe')](),controller[_0xa932('0x11')]);module[_0xa932('0x12')]=router; \ No newline at end of file +var _0x3e9f=['isAuthenticated','downloadLogFile','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','update','/download_log_file'];(function(_0x3b3fb2,_0x21a7a7){var _0x2c998a=function(_0x9ad1df){while(--_0x9ad1df){_0x3b3fb2['push'](_0x3b3fb2['shift']());}};_0x2c998a(++_0x21a7a7);}(_0x3e9f,0x17f));var _0xf3e9=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x3e9f[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0xf3e9('0x0'));var util=require(_0xf3e9('0x1'));var path=require('path');var timeout=require(_0xf3e9('0x2'));var express=require(_0xf3e9('0x3'));var router=express[_0xf3e9('0x4')]();var fs_extra=require(_0xf3e9('0x5'));var auth=require(_0xf3e9('0x6'));var interaction=require(_0xf3e9('0x7'));var config=require(_0xf3e9('0x8'));var controller=require(_0xf3e9('0x9'));router[_0xf3e9('0xa')]('/',controller[_0xf3e9('0xb')]);router[_0xf3e9('0xc')](_0xf3e9('0xd'),auth['isAuthenticated'](),controller[_0xf3e9('0xe')]);router[_0xf3e9('0xa')](_0xf3e9('0xf'),auth[_0xf3e9('0x10')](),controller[_0xf3e9('0x11')]);module[_0xf3e9('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 a71b798..a3522cc 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 _0x1ef1=['TEXT'];(function(_0x2134b2,_0x5a82aa){var _0x4e4bc8=function(_0x5816b6){while(--_0x5816b6){_0x2134b2['push'](_0x2134b2['shift']());}};_0x4e4bc8(++_0x5a82aa);}(_0x1ef1,0xc6));var _0x11ef=function(_0x3e4e4b,_0x1ebd40){_0x3e4e4b=_0x3e4e4b-0x0;var _0x3dcb90=_0x1ef1[_0x3e4e4b];return _0x3dcb90;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x11ef('0x0')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0f22=['STRING','sequelize','exports','TEXT'];(function(_0x5338d3,_0x35c206){var _0x3f494a=function(_0x3a71b1){while(--_0x3a71b1){_0x5338d3['push'](_0x5338d3['shift']());}};_0x3f494a(++_0x35c206);}(_0x0f22,0x15d));var _0x20f2=function(_0x1f5833,_0x1f639e){_0x1f5833=_0x1f5833-0x0;var _0x40aa81=_0x0f22[_0x1f5833];return _0x40aa81;};'use strict';var Sequelize=require(_0x20f2('0x0'));module[_0x20f2('0x1')]={'license':{'type':Sequelize[_0x20f2('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x20f2('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index a2c7905..e0b0d1f 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 _0x1fea=['join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','stack','name','send','model','License','rawAttributes','query','keys','filters','intersection','fields','attributes','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','downloadLogFile'];(function(_0x430ede,_0x2bdcf2){var _0x41584f=function(_0x4c43f1){while(--_0x4c43f1){_0x430ede['push'](_0x430ede['shift']());}};_0x41584f(++_0x2bdcf2);}(_0x1fea,0x121));var _0xa1fe=function(_0x494c24,_0x1acd10){_0x494c24=_0x494c24-0x0;var _0x45bede=_0x1fea[_0x494c24];return _0x45bede;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1fe('0x0'));var rp=require(_0xa1fe('0x1'));var moment=require('moment');var BPromise=require(_0xa1fe('0x2'));var Mustache=require(_0xa1fe('0x3'));var util=require(_0xa1fe('0x4'));var path=require(_0xa1fe('0x5'));var sox=require(_0xa1fe('0x6'));var csv=require(_0xa1fe('0x7'));var ejs=require(_0xa1fe('0x8'));var fs=require('fs');var fs_extra=require(_0xa1fe('0x9'));var _=require(_0xa1fe('0xa'));var squel=require('squel');var crypto=require(_0xa1fe('0xb'));var jsforce=require(_0xa1fe('0xc'));var deskjs=require(_0xa1fe('0xd'));var toCsv=require(_0xa1fe('0x7'));var querystring=require('querystring');var Papa=require(_0xa1fe('0xe'));var Redis=require(_0xa1fe('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1fe('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1fe('0x11'));var utils=require(_0xa1fe('0x12'));var config=require(_0xa1fe('0x13'));var licenseUtil=require(_0xa1fe('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b3ce7,_0x372228){_0x372228=_0x372228||0xcc;return function(_0x56e9e7){if(_0x56e9e7){return _0x1b3ce7[_0xa1fe('0x15')](_0x372228);}return _0x1b3ce7[_0xa1fe('0x16')](_0x372228)[_0xa1fe('0x17')]();};}function respondWithResult(_0x16f88e,_0x36b857){_0x36b857=_0x36b857||0xc8;return function(_0xd5671c){if(_0xd5671c){return _0x16f88e['status'](_0x36b857)[_0xa1fe('0x18')](_0xd5671c);}};}function respondWithFilteredResult(_0x53b13a,_0x455eb5){return function(_0x54a2eb){if(_0x54a2eb){var _0x346756=typeof _0x455eb5[_0xa1fe('0x19')]===_0xa1fe('0x1a')&&typeof _0x455eb5[_0xa1fe('0x1b')]==='undefined';var _0x412e7d=_0x54a2eb[_0xa1fe('0x1c')];var _0x5aa842=_0x346756?0x0:_0x455eb5[_0xa1fe('0x19')];var _0x164744=_0x346756?_0x54a2eb[_0xa1fe('0x1c')]:_0x455eb5[_0xa1fe('0x19')]+_0x455eb5['limit'];var _0x3fa387;if(_0x164744>=_0x412e7d){_0x164744=_0x412e7d;_0x3fa387=0xc8;}else{_0x3fa387=0xce;}_0x53b13a[_0xa1fe('0x16')](_0x3fa387);return _0x53b13a[_0xa1fe('0x1d')]('Content-Range',_0x5aa842+'-'+_0x164744+'/'+_0x412e7d)[_0xa1fe('0x18')](_0x54a2eb);}return null;};}function patchUpdates(_0x5206a0){return function(_0x4c8887){try{jsonpatch[_0xa1fe('0x1e')](_0x4c8887,_0x5206a0,!![]);}catch(_0x520179){return BPromise[_0xa1fe('0x1f')](_0x520179);}return _0x4c8887['save']();};}function saveUpdates(_0x44c900,_0x76cb0b){return function(_0x11b4b5){if(_0x11b4b5){return _0x11b4b5[_0xa1fe('0x20')](_0x44c900)['then'](function(_0x484eca){return _0x484eca;});}return null;};}function removeEntity(_0x348b55,_0x58f9aa){return function(_0x501bec){if(_0x501bec){return _0x501bec[_0xa1fe('0x21')]()[_0xa1fe('0x22')](function(){_0x348b55[_0xa1fe('0x16')](0xcc)[_0xa1fe('0x17')]();});}};}function handleEntityNotFound(_0x3b932e,_0x4f97f0){return function(_0xb5bf81){if(!_0xb5bf81){_0x3b932e[_0xa1fe('0x15')](0x194);}return _0xb5bf81;};}function handleError(_0x4540c4,_0x7df71b){_0x7df71b=_0x7df71b||0x1f4;return function(_0x14ca96){logger[_0xa1fe('0x23')](_0x14ca96[_0xa1fe('0x24')]);if(_0x14ca96[_0xa1fe('0x25')]){delete _0x14ca96[_0xa1fe('0x25')];}_0x4540c4[_0xa1fe('0x16')](_0x7df71b)[_0xa1fe('0x26')](_0x14ca96);};}var utilLicense=require(_0xa1fe('0x14'));exports['index']=function(_0xfe93a0,_0x2a9dbf){var _0x3e134b={'raw':!![],'where':{'id':0x1}},_0x70172d={};_0x70172d[_0xa1fe('0x27')]=_['keys'](db[_0xa1fe('0x28')][_0xa1fe('0x29')]);_0x70172d[_0xa1fe('0x2a')]=_[_0xa1fe('0x2b')](_0xfe93a0['query']);_0x70172d[_0xa1fe('0x2c')]=_[_0xa1fe('0x2d')](_0x70172d['model'],_0x70172d['query']);_0x3e134b['attributes']=_[_0xa1fe('0x2d')](_0x70172d[_0xa1fe('0x27')],qs[_0xa1fe('0x2e')](_0xfe93a0[_0xa1fe('0x2a')]['fields']));_0x3e134b[_0xa1fe('0x2f')]=_0x3e134b[_0xa1fe('0x2f')][_0xa1fe('0x30')]?_0x3e134b[_0xa1fe('0x2f')]:_0x70172d['model'];_0x3e134b=_[_0xa1fe('0x31')]({},_0x3e134b,_0xfe93a0[_0xa1fe('0x32')]);return utilLicense[_0xa1fe('0x33')](_0x3e134b)[_0xa1fe('0x22')](respondWithResult(_0x2a9dbf,null))[_0xa1fe('0x34')](handleError(_0x2a9dbf,null));};exports[_0xa1fe('0x20')]=function(_0x82fa04,_0x3377fc){if(_0x82fa04[_0xa1fe('0x35')]['id']){delete _0x82fa04[_0xa1fe('0x35')]['id'];}return db[_0xa1fe('0x28')][_0xa1fe('0x36')]({'where':{'id':_0x82fa04[_0xa1fe('0x37')]['id']}})[_0xa1fe('0x22')](handleEntityNotFound(_0x3377fc,null))[_0xa1fe('0x22')](function(_0x19ca4e){var _0x3c612b=_0x19ca4e[_0xa1fe('0x38')]({'plain':!![]});return utilLicense[_0xa1fe('0x39')](_0x3c612b,_0x82fa04[_0xa1fe('0x35')][_0xa1fe('0x3a')]);})[_0xa1fe('0x22')](function(_0x2ce6ec){if(!_0x2ce6ec[_0xa1fe('0x3b')]){return saveUpdates(_0x82fa04[_0xa1fe('0x35')],null);}return _0x2ce6ec;})[_0xa1fe('0x22')](respondWithResult(_0x3377fc,null))[_0xa1fe('0x34')](handleError(_0x3377fc,null));};exports[_0xa1fe('0x3c')]=function(_0x198160,_0x4bb17d){var _0x4f551a='license-info.log';var _0x58bf20=path[_0xa1fe('0x3d')](_0xa1fe('0x3e'),_0xa1fe('0x3f'),_0xa1fe('0x40'),_0x4f551a);_0x4bb17d[_0xa1fe('0x41')](_0xa1fe('0x42'),_0xa1fe('0x43')+_0x4f551a);_0x4bb17d[_0xa1fe('0x1d')]('Content-Type',_0xa1fe('0x44'));_0x4bb17d[_0xa1fe('0x45')](_0x58bf20);}; \ No newline at end of file +var _0x5627=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','../../config/license/util','index','model','keys','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','License','find','params','get','checkLicense','key','demo','license-info.log','join','/var','log','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','rimraf'];(function(_0xba35c0,_0x3a3943){var _0x2847c5=function(_0x5e2309){while(--_0x5e2309){_0xba35c0['push'](_0xba35c0['shift']());}};_0x2847c5(++_0x3a3943);}(_0x5627,0x1cc));var _0x7562=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5627[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x7562('0x0'));var rimraf=require(_0x7562('0x1'));var zipdir=require(_0x7562('0x2'));var jsonpatch=require(_0x7562('0x3'));var rp=require('request-promise');var moment=require(_0x7562('0x4'));var BPromise=require(_0x7562('0x5'));var Mustache=require(_0x7562('0x6'));var util=require(_0x7562('0x7'));var path=require(_0x7562('0x8'));var sox=require('sox');var csv=require(_0x7562('0x9'));var ejs=require(_0x7562('0xa'));var fs=require('fs');var fs_extra=require(_0x7562('0xb'));var _=require(_0x7562('0xc'));var squel=require(_0x7562('0xd'));var crypto=require(_0x7562('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7562('0x9'));var querystring=require(_0x7562('0xf'));var Papa=require(_0x7562('0x10'));var Redis=require(_0x7562('0x11'));var authService=require(_0x7562('0x12'));var qs=require(_0x7562('0x13'));var as=require(_0x7562('0x14'));var hardwareService=require(_0x7562('0x15'));var logger=require(_0x7562('0x16'))(_0x7562('0x17'));var utils=require(_0x7562('0x18'));var config=require(_0x7562('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7562('0x1a'))['db'];function respondWithStatusCode(_0x5c33ff,_0x426fdf){_0x426fdf=_0x426fdf||0xcc;return function(_0x4b535e){if(_0x4b535e){return _0x5c33ff[_0x7562('0x1b')](_0x426fdf);}return _0x5c33ff[_0x7562('0x1c')](_0x426fdf)[_0x7562('0x1d')]();};}function respondWithResult(_0x394b77,_0x59237a){_0x59237a=_0x59237a||0xc8;return function(_0x100ad0){if(_0x100ad0){return _0x394b77[_0x7562('0x1c')](_0x59237a)[_0x7562('0x1e')](_0x100ad0);}};}function respondWithFilteredResult(_0x13f097,_0x3349c5){return function(_0x41cef0){if(_0x41cef0){var _0x960ae1=typeof _0x3349c5[_0x7562('0x1f')]==='undefined'&&typeof _0x3349c5[_0x7562('0x20')]===_0x7562('0x21');var _0x16e214=_0x41cef0[_0x7562('0x22')];var _0x5ae93c=_0x960ae1?0x0:_0x3349c5[_0x7562('0x1f')];var _0x58cdc5=_0x960ae1?_0x41cef0[_0x7562('0x22')]:_0x3349c5[_0x7562('0x1f')]+_0x3349c5['limit'];var _0x2ca48a;if(_0x58cdc5>=_0x16e214){_0x58cdc5=_0x16e214;_0x2ca48a=0xc8;}else{_0x2ca48a=0xce;}_0x13f097[_0x7562('0x1c')](_0x2ca48a);return _0x13f097['set'](_0x7562('0x23'),_0x5ae93c+'-'+_0x58cdc5+'/'+_0x16e214)[_0x7562('0x1e')](_0x41cef0);}return null;};}function patchUpdates(_0x4ea661){return function(_0x1fc601){try{jsonpatch[_0x7562('0x24')](_0x1fc601,_0x4ea661,!![]);}catch(_0x2b93c0){return BPromise[_0x7562('0x25')](_0x2b93c0);}return _0x1fc601[_0x7562('0x26')]();};}function saveUpdates(_0x426812,_0xd6175f){return function(_0x3ef69a){if(_0x3ef69a){return _0x3ef69a[_0x7562('0x27')](_0x426812)['then'](function(_0xa4aec4){return _0xa4aec4;});}return null;};}function removeEntity(_0x5926a1,_0x13254f){return function(_0x45f86b){if(_0x45f86b){return _0x45f86b[_0x7562('0x28')]()[_0x7562('0x29')](function(){_0x5926a1['status'](0xcc)[_0x7562('0x1d')]();});}};}function handleEntityNotFound(_0x45ac3d,_0x3f8185){return function(_0x503312){if(!_0x503312){_0x45ac3d[_0x7562('0x1b')](0x194);}return _0x503312;};}function handleError(_0x115ded,_0x3f8c44){_0x3f8c44=_0x3f8c44||0x1f4;return function(_0x1d4b6b){logger[_0x7562('0x2a')](_0x1d4b6b[_0x7562('0x2b')]);if(_0x1d4b6b[_0x7562('0x2c')]){delete _0x1d4b6b['name'];}_0x115ded[_0x7562('0x1c')](_0x3f8c44)[_0x7562('0x2d')](_0x1d4b6b);};}var utilLicense=require(_0x7562('0x2e'));exports[_0x7562('0x2f')]=function(_0x5f3787,_0x6b833c){var _0x354b1a={'raw':!![],'where':{'id':0x1}},_0x3342d8={};_0x3342d8[_0x7562('0x30')]=_[_0x7562('0x31')](db['License']['rawAttributes']);_0x3342d8[_0x7562('0x32')]=_[_0x7562('0x31')](_0x5f3787['query']);_0x3342d8[_0x7562('0x33')]=_[_0x7562('0x34')](_0x3342d8[_0x7562('0x30')],_0x3342d8[_0x7562('0x32')]);_0x354b1a[_0x7562('0x35')]=_[_0x7562('0x34')](_0x3342d8[_0x7562('0x30')],qs[_0x7562('0x36')](_0x5f3787['query']['fields']));_0x354b1a[_0x7562('0x35')]=_0x354b1a[_0x7562('0x35')][_0x7562('0x37')]?_0x354b1a[_0x7562('0x35')]:_0x3342d8['model'];_0x354b1a=_[_0x7562('0x38')]({},_0x354b1a,_0x5f3787[_0x7562('0x39')]);return utilLicense[_0x7562('0x3a')](_0x354b1a)['then'](respondWithResult(_0x6b833c,null))[_0x7562('0x3b')](handleError(_0x6b833c,null));};exports[_0x7562('0x27')]=function(_0xd7da71,_0x540904){if(_0xd7da71['body']['id']){delete _0xd7da71[_0x7562('0x3c')]['id'];}return db[_0x7562('0x3d')][_0x7562('0x3e')]({'where':{'id':_0xd7da71[_0x7562('0x3f')]['id']}})[_0x7562('0x29')](handleEntityNotFound(_0x540904,null))[_0x7562('0x29')](function(_0x3beab2){var _0x3bfbc8=_0x3beab2[_0x7562('0x40')]({'plain':!![]});return utilLicense[_0x7562('0x41')](_0x3bfbc8,_0xd7da71[_0x7562('0x3c')][_0x7562('0x42')]);})[_0x7562('0x29')](function(_0x5d5ec8){if(!_0x5d5ec8[_0x7562('0x43')]){return saveUpdates(_0xd7da71['body'],null);}return _0x5d5ec8;})[_0x7562('0x29')](respondWithResult(_0x540904,null))[_0x7562('0x3b')](handleError(_0x540904,null));};exports['downloadLogFile']=function(_0x145209,_0x61fd5d){var _0x144e15=_0x7562('0x44');var _0x215552=path[_0x7562('0x45')](_0x7562('0x46'),_0x7562('0x47'),'xcally',_0x144e15);_0x61fd5d['setHeader']('Content-disposition',_0x7562('0x48')+_0x144e15);_0x61fd5d[_0x7562('0x49')](_0x7562('0x4a'),_0x7562('0x4b'));_0x61fd5d[_0x7562('0x4c')](_0x215552);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0536bd2..e80582e 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 _0xac27=['license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','License'];(function(_0x5e55a6,_0x171e2e){var _0x8722b2=function(_0x4927a6){while(--_0x4927a6){_0x5e55a6['push'](_0x5e55a6['shift']());}};_0x8722b2(++_0x171e2e);}(_0xac27,0xcd));var _0x7ac2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xac27[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x7ac2('0x0'));var util=require(_0x7ac2('0x1'));var logger=require(_0x7ac2('0x2'))(_0x7ac2('0x3'));var moment=require(_0x7ac2('0x4'));var BPromise=require(_0x7ac2('0x5'));var rp=require(_0x7ac2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ac2('0x7'));var config=require(_0x7ac2('0x8'));var attributes=require('./license.attributes');module[_0x7ac2('0x9')]=function(_0x2e8ce8,_0x106dec){return _0x2e8ce8['define'](_0x7ac2('0xa'),attributes,{'tableName':_0x7ac2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf253=['rimraf','../../config/environment','./license.attributes','exports','define','License','license','api','moment','bluebird','request-promise','path'];(function(_0x1bb7d1,_0x4afbef){var _0x4d0861=function(_0x363fd5){while(--_0x363fd5){_0x1bb7d1['push'](_0x1bb7d1['shift']());}};_0x4d0861(++_0x4afbef);}(_0xf253,0xdf));var _0x3f25=function(_0x131604,_0x475a68){_0x131604=_0x131604-0x0;var _0x4a2aea=_0xf253[_0x131604];return _0x4a2aea;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3f25('0x0'));var moment=require(_0x3f25('0x1'));var BPromise=require(_0x3f25('0x2'));var rp=require(_0x3f25('0x3'));var fs=require('fs');var path=require(_0x3f25('0x4'));var rimraf=require(_0x3f25('0x5'));var config=require(_0x3f25('0x6'));var attributes=require(_0x3f25('0x7'));module[_0x3f25('0x8')]=function(_0x3e9876,_0x240cd0){return _0x3e9876[_0x3f25('0x9')](_0x3f25('0xa'),attributes,{'tableName':_0x3f25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 50d1f8a..fb361c2 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 _0x86e8=['client','http','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x86e8,0x81));var _0x886e=function(_0x2c612b,_0x54c4bd){_0x2c612b=_0x2c612b-0x0;var _0x5ea8d9=_0x86e8[_0x2c612b];return _0x5ea8d9;};'use strict';var _=require(_0x886e('0x0'));var util=require(_0x886e('0x1'));var moment=require(_0x886e('0x2'));var BPromise=require('bluebird');var rs=require(_0x886e('0x3'));var fs=require('fs');var Redis=require(_0x886e('0x4'));var db=require(_0x886e('0x5'))['db'];var utils=require(_0x886e('0x6'));var logger=require('../../config/logger')(_0x886e('0x7'));var config=require('../../config/environment');var jayson=require(_0x886e('0x8'));var client=jayson[_0x886e('0x9')][_0x886e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8f166,_0x1a3591,_0xc8ed43){return new BPromise(function(_0x599632,_0x295b07){return client[_0x886e('0xb')](_0xe8f166,_0xc8ed43)[_0x886e('0xc')](function(_0x5ad03a){logger['info'](_0x886e('0xd'),_0x1a3591,_0x886e('0xe'));logger['debug'](_0x886e('0xf'),_0x1a3591,_0x886e('0xe'),JSON[_0x886e('0x10')](_0x5ad03a));if(_0x5ad03a[_0x886e('0x11')]){if(_0x5ad03a[_0x886e('0x11')][_0x886e('0x12')]===0x1f4){logger[_0x886e('0x11')](_0x886e('0xd'),_0x1a3591,_0x5ad03a['error'][_0x886e('0x13')]);return _0x295b07(_0x5ad03a[_0x886e('0x11')][_0x886e('0x13')]);}logger[_0x886e('0x11')](_0x886e('0xd'),_0x1a3591,_0x5ad03a[_0x886e('0x11')][_0x886e('0x13')]);return _0x599632(_0x5ad03a[_0x886e('0x11')][_0x886e('0x13')]);}else{logger[_0x886e('0x14')]('License,\x20%s,\x20%s',_0x1a3591,_0x886e('0xe'));_0x599632(_0x5ad03a[_0x886e('0x15')][_0x886e('0x13')]);}})[_0x886e('0x16')](function(_0x58c4a9){logger[_0x886e('0x11')](_0x886e('0xd'),_0x1a3591,_0x58c4a9);_0x295b07(_0x58c4a9);});});} \ No newline at end of file +var _0x33af=['info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1e8c72,_0x4a6d36){var _0x707394=function(_0x3d79a4){while(--_0x3d79a4){_0x1e8c72['push'](_0x1e8c72['shift']());}};_0x707394(++_0x4a6d36);}(_0x33af,0x1bc));var _0xf33a=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x33af[_0x5bb4e8];return _0x2a86f2;};'use strict';var _=require(_0xf33a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf33a('0x3'))['db'];var utils=require(_0xf33a('0x4'));var logger=require(_0xf33a('0x5'))('rpc');var config=require(_0xf33a('0x6'));var jayson=require(_0xf33a('0x7'));var client=jayson[_0xf33a('0x8')][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42e5fd,_0x11a73c,_0x22580c){return new BPromise(function(_0x2775d3,_0x263d4f){return client['request'](_0x42e5fd,_0x22580c)[_0xf33a('0xa')](function(_0x1495f3){logger['info'](_0xf33a('0xb'),_0x11a73c,'request\x20sent');logger[_0xf33a('0xc')](_0xf33a('0xd'),_0x11a73c,'request\x20sent',JSON[_0xf33a('0xe')](_0x1495f3));if(_0x1495f3['error']){if(_0x1495f3[_0xf33a('0xf')][_0xf33a('0x10')]===0x1f4){logger['error'](_0xf33a('0xb'),_0x11a73c,_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);return _0x263d4f(_0x1495f3['error'][_0xf33a('0x11')]);}logger['error'](_0xf33a('0xb'),_0x11a73c,_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);return _0x2775d3(_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);}else{logger[_0xf33a('0x12')]('License,\x20%s,\x20%s',_0x11a73c,_0xf33a('0x13'));_0x2775d3(_0x1495f3[_0xf33a('0x14')][_0xf33a('0x11')]);}})[_0xf33a('0x15')](function(_0x55528c){logger['error']('License,\x20%s,\x20%s',_0x11a73c,_0x55528c);_0x263d4f(_0x55528c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4332abb..73cc44c 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 _0x13a8=['addApplications','/:id/send','put','/:id','update','removeDispositions','delete','removeImap','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/out_servers','addSmtp','addInteraction'];(function(_0x592a64,_0x154c44){var _0x47a926=function(_0x4cba28){while(--_0x4cba28){_0x592a64['push'](_0x592a64['shift']());}};_0x47a926(++_0x154c44);}(_0x13a8,0x65));var _0x813a=function(_0xc9005,_0x24c097){_0xc9005=_0xc9005-0x0;var _0x3f270d=_0x13a8[_0xc9005];return _0x3f270d;};'use strict';var multer=require(_0x813a('0x0'));var util=require(_0x813a('0x1'));var path=require(_0x813a('0x2'));var timeout=require(_0x813a('0x3'));var express=require(_0x813a('0x4'));var router=express['Router']();var fs_extra=require(_0x813a('0x5'));var auth=require(_0x813a('0x6'));var interaction=require(_0x813a('0x7'));var config=require(_0x813a('0x8'));var controller=require(_0x813a('0x9'));router[_0x813a('0xa')]('/',auth[_0x813a('0xb')](),controller[_0x813a('0xc')]);router['get'](_0x813a('0xd'),auth['isAuthenticated'](),controller[_0x813a('0xe')]);router[_0x813a('0xa')]('/:id',auth[_0x813a('0xb')](),controller[_0x813a('0xf')]);router['get'](_0x813a('0x10'),auth[_0x813a('0xb')](),controller[_0x813a('0x11')]);router[_0x813a('0xa')](_0x813a('0x12'),auth[_0x813a('0xb')](),controller['getAnswers']);router['get'](_0x813a('0x13'),auth['isAuthenticated'](),controller[_0x813a('0x14')]);router[_0x813a('0xa')]('/:id/out_servers',auth[_0x813a('0xb')](),controller['getSmtp']);router['get'](_0x813a('0x15'),auth[_0x813a('0xb')](),controller['getInteractions']);router[_0x813a('0xa')](_0x813a('0x16'),auth[_0x813a('0xb')](),controller[_0x813a('0x17')]);router[_0x813a('0xa')](_0x813a('0x18'),auth[_0x813a('0xb')](),controller[_0x813a('0x19')]);router[_0x813a('0xa')](_0x813a('0x1a'),auth['isAuthenticated'](),controller[_0x813a('0x1b')]);router['get'](_0x813a('0x1c'),auth[_0x813a('0xb')](),controller[_0x813a('0x1d')]);router[_0x813a('0x1e')](_0x813a('0x10'),auth['isAuthenticated'](),controller[_0x813a('0x1f')]);router[_0x813a('0x1e')](_0x813a('0x12'),auth[_0x813a('0xb')](),controller[_0x813a('0x20')]);router[_0x813a('0x1e')]('/',auth[_0x813a('0xb')](),controller[_0x813a('0x21')]);router[_0x813a('0x1e')](_0x813a('0x13'),auth[_0x813a('0xb')](),controller['addImap']);router[_0x813a('0x1e')](_0x813a('0x22'),auth['isAuthenticated'](),controller[_0x813a('0x23')]);router[_0x813a('0x1e')](_0x813a('0x15'),auth[_0x813a('0xb')](),controller[_0x813a('0x24')]);router[_0x813a('0x1e')](_0x813a('0x16'),auth['isAuthenticated'](),controller[_0x813a('0x25')]);router[_0x813a('0x1e')](_0x813a('0x26'),auth[_0x813a('0xb')](),controller['send']);router[_0x813a('0x1e')](_0x813a('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router[_0x813a('0x27')](_0x813a('0x28'),auth[_0x813a('0xb')](),controller[_0x813a('0x29')]);router['delete']('/:id/dispositions',auth[_0x813a('0xb')](),controller[_0x813a('0x2a')]);router[_0x813a('0x2b')](_0x813a('0x12'),auth[_0x813a('0xb')](),controller['removeAnswers']);router[_0x813a('0x2b')](_0x813a('0x13'),auth['isAuthenticated'](),controller[_0x813a('0x2c')]);router[_0x813a('0x2b')](_0x813a('0x22'),auth[_0x813a('0xb')](),controller['removeSmtp']);router[_0x813a('0x2b')]('/:id',auth[_0x813a('0xb')](),controller['destroy']);router[_0x813a('0x2b')]('/:id/users',auth[_0x813a('0xb')](),controller[_0x813a('0x2d')]);module['exports']=router; \ No newline at end of file +var _0x9260=['../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','post','addAnswer','create','addImap','addSmtp','/:id/interactions','/:id/applications','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b76ed,_0x351a05){var _0x23ba5a=function(_0x30cfff){while(--_0x30cfff){_0x2b76ed['push'](_0x2b76ed['shift']());}};_0x23ba5a(++_0x351a05);}(_0x9260,0x16a));var _0x0926=function(_0xd26568,_0x2aca04){_0xd26568=_0xd26568-0x0;var _0x2c628b=_0x9260[_0xd26568];return _0x2c628b;};'use strict';var multer=require(_0x0926('0x0'));var util=require('util');var path=require(_0x0926('0x1'));var timeout=require(_0x0926('0x2'));var express=require(_0x0926('0x3'));var router=express[_0x0926('0x4')]();var fs_extra=require(_0x0926('0x5'));var auth=require(_0x0926('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0926('0x7'));var controller=require(_0x0926('0x8'));router[_0x0926('0x9')]('/',auth[_0x0926('0xa')](),controller[_0x0926('0xb')]);router[_0x0926('0x9')](_0x0926('0xc'),auth[_0x0926('0xa')](),controller[_0x0926('0xd')]);router[_0x0926('0x9')](_0x0926('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x0926('0xf'),auth[_0x0926('0xa')](),controller['getDispositions']);router['get'](_0x0926('0x10'),auth[_0x0926('0xa')](),controller[_0x0926('0x11')]);router['get'](_0x0926('0x12'),auth[_0x0926('0xa')](),controller[_0x0926('0x13')]);router[_0x0926('0x9')](_0x0926('0x14'),auth[_0x0926('0xa')](),controller[_0x0926('0x15')]);router[_0x0926('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x0926('0x9')]('/:id/applications',auth[_0x0926('0xa')](),controller[_0x0926('0x16')]);router[_0x0926('0x9')](_0x0926('0x17'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0926('0x9')](_0x0926('0x18'),auth[_0x0926('0xa')](),controller[_0x0926('0x19')]);router[_0x0926('0x9')](_0x0926('0x1a'),auth[_0x0926('0xa')](),controller['getAgents']);router[_0x0926('0x1b')](_0x0926('0xf'),auth[_0x0926('0xa')](),controller['addDisposition']);router[_0x0926('0x1b')](_0x0926('0x10'),auth[_0x0926('0xa')](),controller[_0x0926('0x1c')]);router[_0x0926('0x1b')]('/',auth[_0x0926('0xa')](),controller[_0x0926('0x1d')]);router[_0x0926('0x1b')]('/:id/in_servers',auth[_0x0926('0xa')](),controller[_0x0926('0x1e')]);router['post'](_0x0926('0x14'),auth[_0x0926('0xa')](),controller[_0x0926('0x1f')]);router[_0x0926('0x1b')](_0x0926('0x20'),auth[_0x0926('0xa')](),controller['addInteraction']);router[_0x0926('0x1b')](_0x0926('0x21'),auth[_0x0926('0xa')](),controller[_0x0926('0x22')]);router['post'](_0x0926('0x23'),auth['isAuthenticated'](),controller[_0x0926('0x24')]);router[_0x0926('0x1b')]('/:id/users',auth[_0x0926('0xa')](),controller[_0x0926('0x25')]);router[_0x0926('0x26')]('/:id',auth[_0x0926('0xa')](),controller['update']);router[_0x0926('0x27')](_0x0926('0xf'),auth[_0x0926('0xa')](),controller[_0x0926('0x28')]);router['delete'](_0x0926('0x10'),auth[_0x0926('0xa')](),controller[_0x0926('0x29')]);router['delete'](_0x0926('0x12'),auth['isAuthenticated'](),controller[_0x0926('0x2a')]);router[_0x0926('0x27')](_0x0926('0x14'),auth[_0x0926('0xa')](),controller['removeSmtp']);router[_0x0926('0x27')](_0x0926('0xe'),auth[_0x0926('0xa')](),controller[_0x0926('0x2b')]);router[_0x0926('0x27')](_0x0926('0x1a'),auth[_0x0926('0xa')](),controller[_0x0926('0x2c')]);module[_0x0926('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f406d05..dbb604b 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 _0x45b4=['BOOLEAN','TEXT','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','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','provider','getDataValue','custom','setDataValue','sequelize','exports','STRING'];(function(_0x432044,_0x35d99b){var _0x108d8d=function(_0x21b73a){while(--_0x21b73a){_0x432044['push'](_0x432044['shift']());}};_0x108d8d(++_0x35d99b);}(_0x45b4,0xce));var _0x445b=function(_0x2906e6,_0x5ccd59){_0x2906e6=_0x2906e6-0x0;var _0x12517a=_0x45b4[_0x2906e6];return _0x12517a;};'use strict';var Sequelize=require(_0x445b('0x0'));module[_0x445b('0x1')]={'description':{'type':Sequelize[_0x445b('0x2')]},'name':{'type':Sequelize[_0x445b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x445b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x445b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x445b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x445b('0x4')]},'markAsUnread':{'type':Sequelize[_0x445b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x445b('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x445b('0x5')](0x2)[_0x445b('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x445b('0x4')],'defaultValue':function(){return _0x445b('0x7');}},'notificationSound':{'type':Sequelize[_0x445b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x445b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x445b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x445b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x445b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x445b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x445b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x445b('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x445b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x445b('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2fde98){if(!_0x2fde98)this['setDataValue'](_0x445b('0x9'),null);this['setDataValue'](_0x445b('0xa'),_0x2fde98);}},'provider':{'type':Sequelize[_0x445b('0xb')](_0x445b('0xc'),'hotmail',_0x445b('0xd'),_0x445b('0xe')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x445b('0xf')))return'custom';return this[_0x445b('0x10')](_0x445b('0xf'));},'set':function(_0x398137){if(_0x398137===_0x445b('0x11'))_0x398137=null;return this[_0x445b('0x12')](_0x445b('0xf'),_0x398137);}}}; \ No newline at end of file +var _0xab63=['yahoo','outlook365','getDataValue','custom','provider','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail'];(function(_0x208d89,_0x56bec0){var _0xda6990=function(_0x3bfe3b){while(--_0x3bfe3b){_0x208d89['push'](_0x208d89['shift']());}};_0xda6990(++_0x56bec0);}(_0xab63,0x1f3));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3ab6('0x0'));module['exports']={'description':{'type':Sequelize[_0x3ab6('0x1')]},'name':{'type':Sequelize[_0x3ab6('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x3ab6('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3ab6('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3ab6('0x3')]},'markAsUnread':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3ab6('0x1')],'allowNull':![],'defaultValue':_0x3ab6('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x3ab6('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3ab6('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ab6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3ab6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3ab6('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3ab6('0x8'),'set':function(_0x2794f8){if(!_0x2794f8)this[_0x3ab6('0x9')](_0x3ab6('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x2794f8);}},'provider':{'type':Sequelize[_0x3ab6('0xb')](_0x3ab6('0xc'),_0x3ab6('0xd'),_0x3ab6('0xe'),_0x3ab6('0xf')),'defaultValue':null,'get':function(){if(!this[_0x3ab6('0x10')]('provider'))return _0x3ab6('0x11');return this['getDataValue'](_0x3ab6('0x12'));},'set':function(_0x1897d6){if(_0x1897d6===_0x3ab6('0x11'))_0x1897d6=null;return this[_0x3ab6('0x9')](_0x3ab6('0x12'),_0x1897d6);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 26f8bb2..724edbc 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 _0xcae8=['MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','messageId','subject','attach','Interaction','VerifySmtp','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','util','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','offset','undefined','limit','count','set','json','destroy','get','UserProfileResource','sendStatus','stack','name','send','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','type','key','model','map','keys','filters','intersection','query','fields','attributes','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','length','catch','body','provider','custom','find','params','Mail\x20Account\x20not\x20found','update','describe','MailAccountId','Disposition','getDispositions','hasOwnProperty','nolimit','order','removeDispositions','ids','addAnswer','create','findOne','CannedAnswer','removeAnswers','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','READ_COMMITTED'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xcae8,0x1b4));var _0x8cae=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0xcae8[_0x22377a];return _0x36f105;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8cae('0x0'));var path=require(_0x8cae('0x1'));var _=require(_0x8cae('0x2'));var juice=require('juice');var Redis=require(_0x8cae('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x8cae('0x4'))(_0x8cae('0x5'));var config=require(_0x8cae('0x6'));var db=require(_0x8cae('0x7'))['db'];config[_0x8cae('0x8')]=_[_0x8cae('0x9')](config['redis'],{'host':_0x8cae('0xa'),'port':0x18eb});var socket=require(_0x8cae('0xb'))(new Redis(config[_0x8cae('0x8')]));require('./mailAccount.socket')[_0x8cae('0xc')](socket);var jayson=require(_0x8cae('0xd'));var client=jayson[_0x8cae('0xe')][_0x8cae('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x398a15,_0x82125e,_0x166562,_0x7d6369){return new BPromise(function(_0x3a8727,_0x3ef2bb){var _0x192fe4=_0x7d6369||client;return _0x192fe4[_0x8cae('0x10')](_0x398a15,_0x166562)[_0x8cae('0x11')](function(_0x69b27a){logger[_0x8cae('0x12')](_0x8cae('0x13'),_0x82125e,_0x8cae('0x14'));logger[_0x8cae('0x15')](_0x8cae('0x16'),_0x82125e,_0x8cae('0x14'),JSON[_0x8cae('0x17')](_0x69b27a));if(_0x69b27a['error']){if(_0x69b27a[_0x8cae('0x18')][_0x8cae('0x19')]===0x1f4){logger[_0x8cae('0x18')](_0x8cae('0x13'),_0x82125e,_0x69b27a[_0x8cae('0x18')][_0x8cae('0x1a')]);return _0x3ef2bb(_0x69b27a[_0x8cae('0x18')]['message']);}logger[_0x8cae('0x18')](_0x8cae('0x13'),_0x82125e,_0x69b27a[_0x8cae('0x18')][_0x8cae('0x1a')]);return _0x3a8727(_0x69b27a[_0x8cae('0x18')][_0x8cae('0x1a')]);}else{logger[_0x8cae('0x12')](_0x8cae('0x13'),_0x82125e,_0x8cae('0x14'));_0x3a8727(_0x69b27a[_0x8cae('0x1b')][_0x8cae('0x1a')]);}})['catch'](function(_0x18d357){logger[_0x8cae('0x18')](_0x8cae('0x13'),_0x82125e,_0x18d357);_0x3ef2bb(_0x18d357);});});}function respondWithStatusCode(_0x526b47,_0x1eb82f){_0x1eb82f=_0x1eb82f||0xcc;return function(_0x12eaa1){if(_0x12eaa1){return _0x526b47['sendStatus'](_0x1eb82f);}return _0x526b47['status'](_0x1eb82f)[_0x8cae('0x1c')]();};}function respondWithResult(_0x19ab42,_0x392b36){_0x392b36=_0x392b36||0xc8;return function(_0x290592){if(_0x290592){return _0x19ab42[_0x8cae('0x1d')](_0x392b36)['json'](_0x290592);}};}function respondWithFilteredResult(_0x320fd2,_0x5b3dfc){return function(_0x1589be){if(_0x1589be){var _0x3bdad1=typeof _0x5b3dfc[_0x8cae('0x1e')]===_0x8cae('0x1f')&&typeof _0x5b3dfc[_0x8cae('0x20')]===_0x8cae('0x1f');var _0x26e6c5=_0x1589be[_0x8cae('0x21')];var _0x4d53bb=_0x3bdad1?0x0:_0x5b3dfc[_0x8cae('0x1e')];var _0x231091=_0x3bdad1?_0x1589be[_0x8cae('0x21')]:_0x5b3dfc[_0x8cae('0x1e')]+_0x5b3dfc[_0x8cae('0x20')];var _0x5716fe;if(_0x231091>=_0x26e6c5){_0x231091=_0x26e6c5;_0x5716fe=0xc8;}else{_0x5716fe=0xce;}_0x320fd2[_0x8cae('0x1d')](_0x5716fe);return _0x320fd2[_0x8cae('0x22')]('Content-Range',_0x4d53bb+'-'+_0x231091+'/'+_0x26e6c5)[_0x8cae('0x23')](_0x1589be);}return null;};}function saveUpdates(_0xd5a9b4){return function(_0x5393be){if(_0x5393be){return _0x5393be['update'](_0xd5a9b4)[_0x8cae('0x11')](function(_0x5a7efc){return _0x5a7efc;});}return null;};}function removeEntity(_0x123d93){return function(_0x3205a8){if(_0x3205a8){return _0x3205a8[_0x8cae('0x24')]()[_0x8cae('0x11')](function(){var _0x1a92ec=_0x3205a8[_0x8cae('0x25')]({'plain':!![]});var _0x5792d2='MailAccounts';return db[_0x8cae('0x26')]['destroy']({'where':{'type':_0x5792d2,'resourceId':_0x1a92ec['id']}})['then'](function(){return _0x3205a8;});})['then'](function(){_0x123d93[_0x8cae('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e7070){return function(_0x3f95a1){if(!_0x3f95a1){_0x5e7070[_0x8cae('0x27')](0x194);}return _0x3f95a1;};}function handleError(_0x2d9d10,_0xba6324){_0xba6324=_0xba6324||0x1f4;return function(_0x2ebe67){logger[_0x8cae('0x18')](_0x2ebe67[_0x8cae('0x28')]);if(_0x2ebe67[_0x8cae('0x29')]){delete _0x2ebe67[_0x8cae('0x29')];}_0x2d9d10[_0x8cae('0x1d')](_0xba6324)[_0x8cae('0x2a')](_0x2ebe67);};}function getImapHost(_0x3a704c){switch(_0x3a704c){case _0x8cae('0x2b'):return'imap.gmail.com';case _0x8cae('0x2c'):return'imap.mail.yahoo.com';case _0x8cae('0x2d'):return _0x8cae('0x2e');case _0x8cae('0x2f'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x3a704c);}function getSmtpHost(_0x5cbb2d){switch(_0x5cbb2d){case _0x8cae('0x2b'):return _0x8cae('0x30');case _0x8cae('0x2c'):return _0x8cae('0x31');case'hotmail':return _0x8cae('0x32');case'outlook365':return _0x8cae('0x33');}throw new Error(_0x8cae('0x34'),_0x5cbb2d);}function getAuthenticationOptions(_0x4b76a4,_0x1c2421){var _0x3acbe5={};var _0xd6924f={};if(_0x4b76a4){_0x3acbe5[_0x8cae('0x35')]=_0xd6924f[_0x8cae('0x35')]=_0x1c2421[_0x8cae('0x36')];_0x3acbe5[_0x8cae('0x37')]=_0xd6924f[_0x8cae('0x38')]=_0x1c2421[_0x8cae('0x37')];if(_0x1c2421[_0x8cae('0x39')]){_0x3acbe5[_0x8cae('0x39')]=_0xd6924f[_0x8cae('0x39')]=!![];_0x3acbe5[_0x8cae('0x3a')]=_0xd6924f[_0x8cae('0x3a')]=_0x1c2421[_0x8cae('0x3a')];_0x3acbe5[_0x8cae('0x37')]=_0xd6924f[_0x8cae('0x38')]=null;}else{_0x3acbe5['CloudProviderId']=_0xd6924f['CloudProviderId']=null;}_0x3acbe5['host']=getImapHost(_0x4b76a4);_0x3acbe5[_0x8cae('0x3b')]=0x3e1;_0xd6924f[_0x8cae('0x3c')]=getSmtpHost(_0x4b76a4);_0xd6924f[_0x8cae('0x3b')]=0x24b;_0xd6924f[_0x8cae('0x3d')]=![];_0x3acbe5['service']=_0xd6924f[_0x8cae('0x3e')]=null;}else{if(_0x1c2421[_0x8cae('0x3f')]){_0x3acbe5[_0x8cae('0x35')]=_0xd6924f['user']=_0x1c2421[_0x8cae('0x36')];_0x3acbe5[_0x8cae('0x37')]=_0xd6924f[_0x8cae('0x38')]=_0x1c2421['password'];}else{_0x3acbe5[_0x8cae('0x3f')]=_0xd6924f[_0x8cae('0x3f')]=![];_0x3acbe5[_0x8cae('0x35')]=_0xd6924f['user']=null;_0x3acbe5['password']=_0xd6924f[_0x8cae('0x38')]=null;}_0x3acbe5[_0x8cae('0x3c')]=_0x1c2421['Imap'][_0x8cae('0x3c')];_0x3acbe5[_0x8cae('0x3b')]=_0x1c2421[_0x8cae('0x40')][_0x8cae('0x3b')];_0xd6924f[_0x8cae('0x3c')]=_0x1c2421[_0x8cae('0x41')][_0x8cae('0x3c')];_0xd6924f[_0x8cae('0x3b')]=_0x1c2421[_0x8cae('0x41')][_0x8cae('0x3b')];}return{'Imap':_0x3acbe5,'Smtp':_0xd6924f};}exports[_0x8cae('0x42')]=function(_0x3a7915,_0x2c67d1){var _0x9b1146={'include':[{'model':db[_0x8cae('0x43')],'as':'Imap'},{'model':db[_0x8cae('0x44')],'as':'Smtp'},{'model':db[_0x8cae('0x45')],'as':_0x8cae('0x46')}]},_0x1e7ebf={},_0x43f92a={'count':0x0,'rows':[]};var _0x389bcc=_['map'](db[_0x8cae('0x47')][_0x8cae('0x48')],function(_0x3e0f62){return{'name':_0x3e0f62['fieldName'],'type':_0x3e0f62[_0x8cae('0x49')][_0x8cae('0x4a')]};});_0x1e7ebf[_0x8cae('0x4b')]=_[_0x8cae('0x4c')](_0x389bcc,_0x8cae('0x29'));_0x1e7ebf['query']=_[_0x8cae('0x4d')](_0x3a7915['query']);_0x1e7ebf[_0x8cae('0x4e')]=_['intersection'](_0x1e7ebf[_0x8cae('0x4b')],_0x1e7ebf['query']);_0x9b1146['attributes']=_[_0x8cae('0x4f')](_0x1e7ebf[_0x8cae('0x4b')],qs['fields'](_0x3a7915[_0x8cae('0x50')][_0x8cae('0x51')]));_0x9b1146['attributes']=_0x9b1146[_0x8cae('0x52')]['length']?_0x9b1146[_0x8cae('0x52')]:_0x1e7ebf['model'];if(!_0x3a7915['query']['hasOwnProperty']('nolimit')){_0x9b1146['limit']=qs[_0x8cae('0x20')](_0x3a7915[_0x8cae('0x50')][_0x8cae('0x20')]);_0x9b1146['offset']=qs['offset'](_0x3a7915[_0x8cae('0x50')]['offset']);}_0x9b1146['order']=qs[_0x8cae('0x53')](_0x3a7915[_0x8cae('0x50')][_0x8cae('0x53')]);_0x9b1146['where']=qs[_0x8cae('0x4e')](_[_0x8cae('0x54')](_0x3a7915['query'],_0x1e7ebf[_0x8cae('0x4e')]),_0x389bcc);if(_0x3a7915[_0x8cae('0x50')][_0x8cae('0x55')]){_0x9b1146[_0x8cae('0x56')]=_[_0x8cae('0x57')](_0x9b1146[_0x8cae('0x56')],{'$or':_[_0x8cae('0x4c')](_0x389bcc,function(_0xb5e7d4){if(_0xb5e7d4[_0x8cae('0x49')]!=='VIRTUAL'){var _0xacc58a={};_0xacc58a[_0xb5e7d4['name']]={'$like':'%'+_0x3a7915['query'][_0x8cae('0x55')]+'%'};return _0xacc58a;}})});}_0x9b1146=_[_0x8cae('0x57')]({},_0x9b1146,_0x3a7915[_0x8cae('0x58')]);var _0xa61466={'where':_0x9b1146[_0x8cae('0x56')]};return db[_0x8cae('0x47')][_0x8cae('0x21')](_0xa61466)[_0x8cae('0x11')](function(_0x53132a){_0x43f92a[_0x8cae('0x21')]=_0x53132a;if(_0x3a7915[_0x8cae('0x50')][_0x8cae('0x59')]){_0x9b1146[_0x8cae('0x5a')]=[{'all':!![]}];}return db[_0x8cae('0x47')][_0x8cae('0x5b')](_0x9b1146);})['then'](function(_0x31763f){_0x43f92a[_0x8cae('0x5c')]=_0x31763f;return _0x43f92a;})['then'](respondWithFilteredResult(_0x2c67d1,_0x9b1146))['catch'](handleError(_0x2c67d1,null));};exports['show']=function(_0x5db35e,_0x21d6f7){var _0xacb8d3={'raw':![],'where':{'id':_0x5db35e['params']['id']},'include':[{'model':db[_0x8cae('0x43')],'as':_0x8cae('0x40')},{'model':db[_0x8cae('0x44')],'as':'Smtp'},{'model':db['Pause'],'as':_0x8cae('0x46')}]},_0x4fcb0c={};_0x4fcb0c[_0x8cae('0x4b')]=_[_0x8cae('0x4d')](db[_0x8cae('0x47')][_0x8cae('0x48')]);_0x4fcb0c[_0x8cae('0x50')]=_[_0x8cae('0x4d')](_0x5db35e[_0x8cae('0x50')]);_0x4fcb0c[_0x8cae('0x4e')]=_['intersection'](_0x4fcb0c[_0x8cae('0x4b')],_0x4fcb0c[_0x8cae('0x50')]);_0xacb8d3[_0x8cae('0x52')]=_['intersection'](_0x4fcb0c['model'],qs['fields'](_0x5db35e[_0x8cae('0x50')][_0x8cae('0x51')]));_0xacb8d3[_0x8cae('0x52')]=_0xacb8d3['attributes'][_0x8cae('0x5d')]?_0xacb8d3[_0x8cae('0x52')]:_0x4fcb0c[_0x8cae('0x4b')];if(_0x5db35e[_0x8cae('0x50')][_0x8cae('0x59')]){_0xacb8d3[_0x8cae('0x5a')]=[{'all':!![]}];}_0xacb8d3=_['merge']({},_0xacb8d3,_0x5db35e[_0x8cae('0x58')]);return db[_0x8cae('0x47')]['find'](_0xacb8d3)[_0x8cae('0x11')](handleEntityNotFound(_0x21d6f7,null))[_0x8cae('0x11')](respondWithResult(_0x21d6f7,null))[_0x8cae('0x5e')](handleError(_0x21d6f7,null));};exports['update']=function(_0x2a1362,_0x3cfb72){if(_0x2a1362[_0x8cae('0x5f')]['id']){delete _0x2a1362['body']['id'];}var _0x517e53=_0x2a1362['body'][_0x8cae('0x60')]===_0x8cae('0x61')?null:_0x2a1362[_0x8cae('0x5f')][_0x8cae('0x60')];var _0xcb9ca5=_0x2a1362[_0x8cae('0x5f')]['Imap']||{};var _0x88349b=_0x2a1362[_0x8cae('0x5f')][_0x8cae('0x41')]||{};if(_0x517e53){_0xcb9ca5[_0x8cae('0x3c')]=getImapHost(_0x517e53);_0xcb9ca5[_0x8cae('0x3b')]=0x3e1;_0x88349b['host']=getSmtpHost(_0x517e53);_0x88349b[_0x8cae('0x3b')]=0x24b;_0x88349b[_0x8cae('0x3d')]=![];}if(_0x88349b[_0x8cae('0x39')]){_0x88349b[_0x8cae('0x3d')]=![];}else{_0x88349b[_0x8cae('0x3a')]=null;}if(!_0xcb9ca5[_0x8cae('0x39')])_0xcb9ca5['CloudProviderId']=null;_0x2a1362[_0x8cae('0x5f')][_0x8cae('0x40')]=_0xcb9ca5;_0x2a1362['body'][_0x8cae('0x41')]=_0x88349b;return db['MailAccount'][_0x8cae('0x62')]({'where':{'id':_0x2a1362[_0x8cae('0x63')]['id']},'include':[{'model':db[_0x8cae('0x43')],'as':_0x8cae('0x40')},{'model':db[_0x8cae('0x44')],'as':_0x8cae('0x41')},{'model':db[_0x8cae('0x45')],'as':'mandatoryDispositionPause'}]})[_0x8cae('0x11')](handleEntityNotFound(_0x3cfb72,null))['then'](function(_0x3c5f5b){if(!_0x3c5f5b)throw new Error(_0x8cae('0x64'));if(_0x3c5f5b[_0x8cae('0x3e')])delete _0x2a1362[_0x8cae('0x5f')][_0x8cae('0x40')];return _0x3c5f5b;})['then'](saveUpdates(_0x2a1362[_0x8cae('0x5f')],null))['then'](function(_0x2e7c1c){if(!_0x2a1362[_0x8cae('0x5f')][_0x8cae('0x40')])return _0x2e7c1c;return db[_0x8cae('0x43')][_0x8cae('0x65')](_0x2a1362[_0x8cae('0x5f')][_0x8cae('0x40')],{'where':{'MailAccountId':_0x2e7c1c['id']}})['then'](function(){return _0x2e7c1c;});})['then'](function(_0x2e46e2){if(!_0x2a1362[_0x8cae('0x5f')]['Smtp'])return _0x2e46e2;return db[_0x8cae('0x44')][_0x8cae('0x65')](_0x2a1362['body']['Smtp'],{'where':{'MailAccountId':_0x2e46e2['id']}})[_0x8cae('0x11')](function(){return _0x2e46e2;});})[_0x8cae('0x11')](respondWithResult(_0x3cfb72,null))[_0x8cae('0x5e')](handleError(_0x3cfb72,null));};exports[_0x8cae('0x66')]=function(_0x1b26da,_0x355857){return db[_0x8cae('0x47')][_0x8cae('0x66')]()['then'](respondWithResult(_0x355857,null))[_0x8cae('0x5e')](handleError(_0x355857,null));};exports['addDisposition']=function(_0x37db30,_0x5ce43e){if(_0x37db30[_0x8cae('0x5f')]['id']){delete _0x37db30['body']['id'];}return db['MailAccount'][_0x8cae('0x62')]({'where':{'id':_0x37db30[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x5ce43e,null))[_0x8cae('0x11')](function(_0x536860){if(_0x536860){_0x37db30['body'][_0x8cae('0x67')]=_0x536860['id'];return db[_0x8cae('0x68')]['create'](_0x37db30[_0x8cae('0x5f')]);}})['then'](respondWithResult(_0x5ce43e,null))[_0x8cae('0x5e')](handleError(_0x5ce43e,null));};exports[_0x8cae('0x69')]=function(_0x19cc07,_0x5bdd80){var _0xe4468a={'raw':![],'where':{}};var _0x2b1226={};var _0x4d6a61={'count':0x0,'rows':[]};return db[_0x8cae('0x47')]['findOne']({'where':{'id':_0x19cc07[_0x8cae('0x63')]['id']}})['then'](handleEntityNotFound(_0x5bdd80,null))['then'](function(_0x57313c){if(_0x57313c){_0x2b1226[_0x8cae('0x4b')]=_[_0x8cae('0x4d')](db[_0x8cae('0x68')][_0x8cae('0x48')]);_0x2b1226['query']=_[_0x8cae('0x4d')](_0x19cc07[_0x8cae('0x50')]);_0x2b1226[_0x8cae('0x4e')]=_['intersection'](_0x2b1226[_0x8cae('0x4b')],_0x2b1226[_0x8cae('0x50')]);_0xe4468a[_0x8cae('0x52')]=_[_0x8cae('0x4f')](_0x2b1226['model'],qs[_0x8cae('0x51')](_0x19cc07['query'][_0x8cae('0x51')]));_0xe4468a[_0x8cae('0x52')]=_0xe4468a[_0x8cae('0x52')]['length']?_0xe4468a[_0x8cae('0x52')]:_0x2b1226[_0x8cae('0x4b')];if(!_0x19cc07[_0x8cae('0x50')][_0x8cae('0x6a')](_0x8cae('0x6b'))){_0xe4468a[_0x8cae('0x20')]=qs[_0x8cae('0x20')](_0x19cc07[_0x8cae('0x50')][_0x8cae('0x20')]);_0xe4468a[_0x8cae('0x1e')]=qs[_0x8cae('0x1e')](_0x19cc07[_0x8cae('0x50')]['offset']);}_0xe4468a[_0x8cae('0x6c')]=qs['sort'](_0x19cc07[_0x8cae('0x50')][_0x8cae('0x53')]);_0xe4468a[_0x8cae('0x56')]=qs[_0x8cae('0x4e')](_[_0x8cae('0x54')](_0x19cc07[_0x8cae('0x50')],_0x2b1226[_0x8cae('0x4e')]));_0xe4468a[_0x8cae('0x56')][_0x8cae('0x67')]=_0x57313c['id'];if(_0x19cc07[_0x8cae('0x50')][_0x8cae('0x55')]){_0xe4468a[_0x8cae('0x56')]=_[_0x8cae('0x57')](_0xe4468a[_0x8cae('0x56')],{'$or':_[_0x8cae('0x4c')](_0xe4468a[_0x8cae('0x52')],function(_0x4417aa){var _0x9db138={};_0x9db138[_0x4417aa]={'$like':'%'+_0x19cc07[_0x8cae('0x50')][_0x8cae('0x55')]+'%'};return _0x9db138;})});}_0xe4468a=_[_0x8cae('0x57')]({},_0xe4468a,_0x19cc07[_0x8cae('0x58')]);return db[_0x8cae('0x68')][_0x8cae('0x21')]({'where':_0xe4468a[_0x8cae('0x56')]})['then'](function(_0x43194f){_0x4d6a61[_0x8cae('0x21')]=_0x43194f;if(_0x19cc07[_0x8cae('0x50')]['includeAll']){_0xe4468a[_0x8cae('0x5a')]=[{'all':!![]}];}return db[_0x8cae('0x68')][_0x8cae('0x5b')](_0xe4468a);})['then'](function(_0x47499a){_0x4d6a61[_0x8cae('0x5c')]=_0x47499a;return _0x4d6a61;});}})[_0x8cae('0x11')](respondWithFilteredResult(_0x5bdd80,_0xe4468a))['catch'](handleError(_0x5bdd80,null));};exports[_0x8cae('0x6d')]=function(_0x576501,_0xad47b4){return db['MailAccount'][_0x8cae('0x62')]({'where':{'id':_0x576501[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0xad47b4,null))[_0x8cae('0x11')](function(_0x3a734f){if(_0x3a734f){return _0x3a734f[_0x8cae('0x6d')](_0x576501[_0x8cae('0x50')][_0x8cae('0x6e')]);}})[_0x8cae('0x11')](respondWithStatusCode(_0xad47b4,null))[_0x8cae('0x5e')](handleError(_0xad47b4,null));};exports[_0x8cae('0x6f')]=function(_0x1a5fe8,_0x257076){if(_0x1a5fe8[_0x8cae('0x5f')]['id']){delete _0x1a5fe8[_0x8cae('0x5f')]['id'];}return db[_0x8cae('0x47')][_0x8cae('0x62')]({'where':{'id':_0x1a5fe8[_0x8cae('0x63')]['id']}})['then'](handleEntityNotFound(_0x257076,null))[_0x8cae('0x11')](function(_0x534a34){if(_0x534a34){_0x1a5fe8['body'][_0x8cae('0x67')]=_0x534a34['id'];return db['CannedAnswer'][_0x8cae('0x70')](_0x1a5fe8[_0x8cae('0x5f')]);}})['then'](respondWithResult(_0x257076,null))[_0x8cae('0x5e')](handleError(_0x257076,null));};exports['getAnswers']=function(_0x227d74,_0x5af310){var _0xa6480d={'raw':![],'where':{}};var _0x27c8f2={};var _0x63023a={'count':0x0,'rows':[]};return db[_0x8cae('0x47')][_0x8cae('0x71')]({'where':{'id':_0x227d74[_0x8cae('0x63')]['id']}})['then'](handleEntityNotFound(_0x5af310,null))['then'](function(_0x2f698e){if(_0x2f698e){_0x27c8f2['model']=_[_0x8cae('0x4d')](db['CannedAnswer'][_0x8cae('0x48')]);_0x27c8f2[_0x8cae('0x50')]=_[_0x8cae('0x4d')](_0x227d74['query']);_0x27c8f2[_0x8cae('0x4e')]=_[_0x8cae('0x4f')](_0x27c8f2[_0x8cae('0x4b')],_0x27c8f2[_0x8cae('0x50')]);_0xa6480d[_0x8cae('0x52')]=_['intersection'](_0x27c8f2[_0x8cae('0x4b')],qs['fields'](_0x227d74[_0x8cae('0x50')][_0x8cae('0x51')]));_0xa6480d[_0x8cae('0x52')]=_0xa6480d[_0x8cae('0x52')][_0x8cae('0x5d')]?_0xa6480d[_0x8cae('0x52')]:_0x27c8f2['model'];if(!_0x227d74[_0x8cae('0x50')]['hasOwnProperty'](_0x8cae('0x6b'))){_0xa6480d['limit']=qs[_0x8cae('0x20')](_0x227d74[_0x8cae('0x50')][_0x8cae('0x20')]);_0xa6480d[_0x8cae('0x1e')]=qs['offset'](_0x227d74[_0x8cae('0x50')][_0x8cae('0x1e')]);}_0xa6480d['order']=qs['sort'](_0x227d74['query'][_0x8cae('0x53')]);_0xa6480d[_0x8cae('0x56')]=qs['filters'](_[_0x8cae('0x54')](_0x227d74['query'],_0x27c8f2['filters']));_0xa6480d[_0x8cae('0x56')]['MailAccountId']=_0x2f698e['id'];if(_0x227d74['query'][_0x8cae('0x55')]){_0xa6480d['where']=_[_0x8cae('0x57')](_0xa6480d['where'],{'$or':_[_0x8cae('0x4c')](_0xa6480d[_0x8cae('0x52')],function(_0x2ff172){var _0x533b3d={};_0x533b3d[_0x2ff172]={'$like':'%'+_0x227d74[_0x8cae('0x50')]['filter']+'%'};return _0x533b3d;})});}_0xa6480d=_[_0x8cae('0x57')]({},_0xa6480d,_0x227d74[_0x8cae('0x58')]);return db[_0x8cae('0x72')][_0x8cae('0x21')]({'where':_0xa6480d['where']})['then'](function(_0x43db15){_0x63023a[_0x8cae('0x21')]=_0x43db15;if(_0x227d74['query'][_0x8cae('0x59')]){_0xa6480d['include']=[{'all':!![]}];}return db[_0x8cae('0x72')][_0x8cae('0x5b')](_0xa6480d);})[_0x8cae('0x11')](function(_0x20cd48){_0x63023a[_0x8cae('0x5c')]=_0x20cd48;return _0x63023a;});}})['then'](respondWithFilteredResult(_0x5af310,_0xa6480d))[_0x8cae('0x5e')](handleError(_0x5af310,null));};exports[_0x8cae('0x73')]=function(_0x211469,_0xddc9f7){return db[_0x8cae('0x47')]['find']({'where':{'id':_0x211469[_0x8cae('0x63')]['id']}})['then'](handleEntityNotFound(_0xddc9f7,null))[_0x8cae('0x11')](function(_0xcc3b65){if(_0xcc3b65){return _0xcc3b65['removeAnswers'](_0x211469['query'][_0x8cae('0x6e')]);}})[_0x8cae('0x11')](respondWithStatusCode(_0xddc9f7,null))[_0x8cae('0x5e')](handleError(_0xddc9f7,null));};exports[_0x8cae('0x70')]=function(_0x3aae24,_0x2270c2){var _0x2dc3a5={'name':_0x3aae24[_0x8cae('0x5f')][_0x8cae('0x29')],'key':_0x3aae24[_0x8cae('0x5f')]['key'],'provider':_0x3aae24[_0x8cae('0x5f')]['provider']===_0x8cae('0x61')?null:_0x3aae24['body'][_0x8cae('0x60')],'email':_0x3aae24['body']['email'],'ListId':_0x3aae24[_0x8cae('0x5f')]['ListId'],'active':!_[_0x8cae('0x74')](_0x3aae24['body'][_0x8cae('0x75')])?_0x3aae24['body'][_0x8cae('0x75')]:!![],'description':_0x3aae24['body']['description']||null};var _0x307f8e=getAuthenticationOptions(_0x2dc3a5[_0x8cae('0x60')],_0x3aae24[_0x8cae('0x5f')]);_0x2dc3a5['Imap']=_0x307f8e[_0x8cae('0x40')];_0x2dc3a5[_0x8cae('0x41')]=_0x307f8e[_0x8cae('0x41')];return db[_0x8cae('0x47')][_0x8cae('0x70')](_0x2dc3a5,{'include':[{'model':db['MailServerOut'],'as':_0x8cae('0x41')},{'model':db[_0x8cae('0x43')],'as':_0x8cae('0x40')}]})[_0x8cae('0x11')](function(_0x1ff85f){var _0x2b4ec0=_0x3aae24['user'][_0x8cae('0x25')]({'plain':!![]});if(!_0x2b4ec0)throw new Error(_0x8cae('0x76'));if(_0x2b4ec0[_0x8cae('0x77')]==='user'){var _0x27ada5=_0x1ff85f[_0x8cae('0x25')]({'plain':!![]});return db[_0x8cae('0x78')][_0x8cae('0x62')]({'where':{'name':_0x8cae('0x79'),'userProfileId':_0x2b4ec0[_0x8cae('0x7a')]},'raw':!![]})[_0x8cae('0x11')](function(_0x3c250c){if(_0x3c250c&&_0x3c250c[_0x8cae('0x7b')]===0x0){return db[_0x8cae('0x26')][_0x8cae('0x70')]({'name':_0x27ada5[_0x8cae('0x29')],'resourceId':_0x27ada5['id'],'type':_0x3c250c[_0x8cae('0x29')],'sectionId':_0x3c250c['id']},{})[_0x8cae('0x11')](function(){return _0x1ff85f;});}else{return _0x1ff85f;}})[_0x8cae('0x5e')](function(_0x3ba589){logger[_0x8cae('0x18')](_0x8cae('0x7c'),_0x3ba589);throw _0x3ba589;});}return _0x1ff85f;})['then'](respondWithResult(_0x2270c2,0xc9))[_0x8cae('0x5e')](handleError(_0x2270c2,null));};exports[_0x8cae('0x7d')]=function(_0x51cb5c,_0x59ff49){return db[_0x8cae('0x47')]['findOne']({'where':{'id':_0x51cb5c[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x59ff49,null))[_0x8cae('0x11')](function(_0x49da28){if(_0x49da28){return _0x49da28[_0x8cae('0x7d')]();}return null;})['then'](respondWithResult(_0x59ff49,null))[_0x8cae('0x5e')](handleError(_0x59ff49,null));};exports[_0x8cae('0x7e')]=function(_0x48833,_0x5c680d){if(_0x48833[_0x8cae('0x5f')]['id']){delete _0x48833[_0x8cae('0x5f')]['id'];}return db[_0x8cae('0x47')][_0x8cae('0x62')]({'where':{'id':_0x48833[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x5c680d,null))['then'](function(_0x3b3c5d){if(_0x3b3c5d){_0x48833['body'][_0x8cae('0x67')]=_0x3b3c5d['id'];return db[_0x8cae('0x43')]['create'](_0x48833[_0x8cae('0x5f')]);}})[_0x8cae('0x11')](respondWithResult(_0x5c680d,null))['catch'](handleError(_0x5c680d,null));};exports[_0x8cae('0x7f')]=function(_0x252a5e,_0x88ec3c){return db[_0x8cae('0x47')][_0x8cae('0x71')]({'where':{'id':_0x252a5e[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x88ec3c,null))['then'](function(_0x11bd8c){if(_0x11bd8c){return _0x11bd8c[_0x8cae('0x80')](null);}return null;})['then'](respondWithStatusCode(_0x88ec3c,null))[_0x8cae('0x5e')](handleError(_0x88ec3c,null));};exports[_0x8cae('0x81')]=function(_0x19e728,_0x2aa768){return db[_0x8cae('0x47')]['findOne']({'where':{'id':_0x19e728[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x2aa768,null))[_0x8cae('0x11')](function(_0x2dfe10){if(_0x2dfe10){return _0x2dfe10['getSmtp']();}return null;})['then'](respondWithResult(_0x2aa768,null))['catch'](handleError(_0x2aa768,null));};exports['addSmtp']=function(_0x27f2d0,_0x36e726){if(_0x27f2d0['body']['id']){delete _0x27f2d0['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x27f2d0[_0x8cae('0x63')]['id']}})['then'](handleEntityNotFound(_0x36e726,null))[_0x8cae('0x11')](function(_0x124cf3){if(_0x124cf3){_0x27f2d0[_0x8cae('0x5f')][_0x8cae('0x67')]=_0x124cf3['id'];return db[_0x8cae('0x44')][_0x8cae('0x70')](_0x27f2d0['body']);}})[_0x8cae('0x11')](respondWithResult(_0x36e726,null))[_0x8cae('0x5e')](handleError(_0x36e726,null));};exports[_0x8cae('0x82')]=function(_0x24a75b,_0x4265fd){return db[_0x8cae('0x47')][_0x8cae('0x71')]({'where':{'id':_0x24a75b[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x4265fd,null))['then'](function(_0x5c89c6){if(_0x5c89c6){return _0x5c89c6[_0x8cae('0x83')](null);}return null;})[_0x8cae('0x11')](respondWithStatusCode(_0x4265fd,null))[_0x8cae('0x5e')](handleError(_0x4265fd,null));};exports['addInteraction']=function(_0x2eba77,_0x137b8b){return db[_0x8cae('0x84')][_0x8cae('0x62')]({'where':{'id':_0x2eba77[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x137b8b,null))[_0x8cae('0x11')](function(_0x313557){if(_0x313557){return _0x313557[_0x8cae('0x85')](_0x2eba77['body'][_0x8cae('0x6e')],_[_0x8cae('0x86')](_0x2eba77['body'],[_0x8cae('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x137b8b,null))[_0x8cae('0x5e')](handleError(_0x137b8b,null));};exports[_0x8cae('0x87')]=function(_0x4fd662,_0x41108e){var _0x1416f7={'raw':![],'where':{}};var _0x55cffd={};var _0x3bbb13={'count':0x0,'rows':[]};return db[_0x8cae('0x47')]['findOne']({'where':{'id':_0x4fd662[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x41108e,null))[_0x8cae('0x11')](function(_0x393c0c){if(_0x393c0c){_0x55cffd[_0x8cae('0x4b')]=_['keys'](db[_0x8cae('0x84')][_0x8cae('0x48')]);_0x55cffd[_0x8cae('0x50')]=_[_0x8cae('0x4d')](_0x4fd662[_0x8cae('0x50')]);_0x55cffd[_0x8cae('0x4e')]=_[_0x8cae('0x4f')](_0x55cffd[_0x8cae('0x4b')],_0x55cffd[_0x8cae('0x50')]);_0x1416f7[_0x8cae('0x52')]=_[_0x8cae('0x4f')](_0x55cffd[_0x8cae('0x4b')],qs[_0x8cae('0x51')](_0x4fd662[_0x8cae('0x50')][_0x8cae('0x51')]));_0x1416f7[_0x8cae('0x52')]=_0x1416f7[_0x8cae('0x52')][_0x8cae('0x5d')]?_0x1416f7[_0x8cae('0x52')]:_0x55cffd[_0x8cae('0x4b')];if(!_0x4fd662[_0x8cae('0x50')][_0x8cae('0x6a')](_0x8cae('0x6b'))){_0x1416f7[_0x8cae('0x20')]=qs[_0x8cae('0x20')](_0x4fd662[_0x8cae('0x50')][_0x8cae('0x20')]);_0x1416f7[_0x8cae('0x1e')]=qs[_0x8cae('0x1e')](_0x4fd662[_0x8cae('0x50')][_0x8cae('0x1e')]);}_0x1416f7[_0x8cae('0x6c')]=qs[_0x8cae('0x53')](_0x4fd662[_0x8cae('0x50')][_0x8cae('0x53')]);_0x1416f7[_0x8cae('0x56')]=qs['filters'](_[_0x8cae('0x54')](_0x4fd662['query'],_0x55cffd['filters']));_0x1416f7['where'][_0x8cae('0x67')]=_0x393c0c['id'];if(_0x4fd662['query'][_0x8cae('0x55')]){_0x1416f7[_0x8cae('0x56')]=_['merge'](_0x1416f7[_0x8cae('0x56')],{'$or':_[_0x8cae('0x4c')](_0x1416f7['attributes'],function(_0x46a536){var _0x15774d={};_0x15774d[_0x46a536]={'$like':'%'+_0x4fd662['query'][_0x8cae('0x55')]+'%'};return _0x15774d;})});}_0x1416f7=_[_0x8cae('0x57')]({},_0x1416f7,_0x4fd662['options']);return db[_0x8cae('0x84')]['count']({'where':_0x1416f7['where']})[_0x8cae('0x11')](function(_0x495074){_0x3bbb13[_0x8cae('0x21')]=_0x495074;if(_0x4fd662[_0x8cae('0x50')]['includeAll']){_0x1416f7['include']=[{'model':db[_0x8cae('0x88')],'as':_0x8cae('0x89'),'required':![]},{'model':db[_0x8cae('0x8a')],'as':'Owner','attributes':[_0x8cae('0x29'),_0x8cae('0x8b'),_0x8cae('0x8c')],'required':![]},{'model':db[_0x8cae('0x8d')],'as':_0x8cae('0x8e'),'attributes':['id',_0x8cae('0x29'),_0x8cae('0x8f')],'where':_0x4fd662[_0x8cae('0x50')][_0x8cae('0x90')]?{'id':_0x4fd662[_0x8cae('0x50')][_0x8cae('0x90')]}:undefined,'required':_0x4fd662['query'][_0x8cae('0x90')]?!![]:![]}];}return db[_0x8cae('0x84')][_0x8cae('0x5b')](_0x1416f7);})[_0x8cae('0x11')](function(_0x5c7a83){_0x3bbb13[_0x8cae('0x5c')]=_0x5c7a83;return _0x3bbb13;});}})[_0x8cae('0x11')](respondWithFilteredResult(_0x41108e,_0x1416f7))[_0x8cae('0x5e')](handleError(_0x41108e,null));};exports[_0x8cae('0x91')]=function addApplications(_0xc2baed,_0x1f0438){var _0x302754=_0xc2baed[_0x8cae('0x63')]['id'];var _0x156432=_0xc2baed[_0x8cae('0x5f')];var _0x449c4a=0xc8;var _0x5219cd=null;return db[_0x8cae('0x92')][_0x8cae('0x93')]({'isolationLevel':db[_0x8cae('0x92')]['Transaction']['ISOLATION_LEVELS'][_0x8cae('0x94')]},function(_0x236b98){return db['MailAccount'][_0x8cae('0x71')]({'where':{'id':_0x302754},'transaction':_0x236b98})[_0x8cae('0x11')](function(_0x264548){if(_0x264548){return db[_0x8cae('0x95')][_0x8cae('0x24')]({'where':{'MailAccountId':_0x302754},'transaction':_0x236b98})[_0x8cae('0x11')](function(){var _0x217454=_['map'](_0x156432,function(_0x505b81){_0x505b81['MailAccountId']=_0x302754;return _0x505b81;});return db[_0x8cae('0x95')]['bulkCreate'](_0x217454,{'transaction':_0x236b98});});}else{_0x449c4a=0x194;_0x5219cd=[];}});})['then'](function(){if(_0x449c4a!==0x194){return db[_0x8cae('0x95')][_0x8cae('0x96')]({'where':{'MailAccountId':_0x302754},'order':_0x8cae('0x97')})[_0x8cae('0x11')](function(_0x68f310){_0x5219cd=_0x68f310;});}})[_0x8cae('0x5e')](function(_0x4c3d6f){_0x449c4a=0x1f4;logger[_0x8cae('0x18')](_0x4c3d6f[_0x8cae('0x28')]);if(_0x4c3d6f[_0x8cae('0x29')]){delete _0x4c3d6f['name'];}_0x5219cd=_0x4c3d6f;})[_0x8cae('0x98')](function(){if(_0x5219cd===null){_0x1f0438[_0x8cae('0x27')](_0x449c4a);}else{if(_0x449c4a===0x1f4){_0x1f0438[_0x8cae('0x1d')](_0x449c4a)['send'](_0x5219cd);}else{_0x1f0438['status'](_0x449c4a)[_0x8cae('0x23')](_0x5219cd);}}});};exports[_0x8cae('0x99')]=function(_0xdf4f25,_0x5036c1){var _0x2ac799={};var _0x43d490={};var _0x5960a5;var _0x39b2bf;return db[_0x8cae('0x47')][_0x8cae('0x71')]({'where':{'id':_0xdf4f25[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x5036c1,null))[_0x8cae('0x11')](function(_0x14cfe4){if(_0x14cfe4){_0x5960a5=_0x14cfe4;_0x43d490[_0x8cae('0x4b')]=_[_0x8cae('0x4d')](db[_0x8cae('0x95')]['rawAttributes']);_0x43d490[_0x8cae('0x50')]=_[_0x8cae('0x4d')](_0xdf4f25[_0x8cae('0x50')]);_0x43d490[_0x8cae('0x4e')]=_[_0x8cae('0x4f')](_0x43d490[_0x8cae('0x4b')],_0x43d490['query']);_0x2ac799[_0x8cae('0x52')]=_['intersection'](_0x43d490[_0x8cae('0x4b')],qs[_0x8cae('0x51')](_0xdf4f25[_0x8cae('0x50')][_0x8cae('0x51')]));_0x2ac799[_0x8cae('0x52')]=_0x2ac799['attributes'][_0x8cae('0x5d')]?_0x2ac799['attributes']:_0x43d490[_0x8cae('0x4b')];_0x2ac799[_0x8cae('0x6c')]=qs[_0x8cae('0x53')](_0xdf4f25['query'][_0x8cae('0x53')]);_0x2ac799[_0x8cae('0x56')]=qs['filters'](_[_0x8cae('0x54')](_0xdf4f25['query'],_0x43d490[_0x8cae('0x4e')]));if(_0xdf4f25['query']['filter']){_0x2ac799[_0x8cae('0x56')]=_[_0x8cae('0x57')](_0x2ac799[_0x8cae('0x56')],{'$or':_[_0x8cae('0x4c')](_0x2ac799[_0x8cae('0x52')],function(_0x2a4bd4){var _0x402f81={};_0x402f81[_0x2a4bd4]={'$like':'%'+_0xdf4f25[_0x8cae('0x50')][_0x8cae('0x55')]+'%'};return _0x402f81;})});}_0x2ac799=_[_0x8cae('0x57')]({},_0x2ac799,_0xdf4f25[_0x8cae('0x58')]);return _0x5960a5[_0x8cae('0x99')](_0x2ac799);}})[_0x8cae('0x11')](function(_0x97ef1d){if(_0x97ef1d){_0x39b2bf=_0x97ef1d[_0x8cae('0x5d')];if(!_0xdf4f25['query'][_0x8cae('0x6a')](_0x8cae('0x6b'))){_0x2ac799[_0x8cae('0x20')]=qs[_0x8cae('0x20')](_0xdf4f25[_0x8cae('0x50')][_0x8cae('0x20')]);_0x2ac799[_0x8cae('0x1e')]=qs[_0x8cae('0x1e')](_0xdf4f25[_0x8cae('0x50')][_0x8cae('0x1e')]);}return _0x5960a5[_0x8cae('0x99')](_0x2ac799);}})['then'](function(_0x43307e){if(_0x43307e){return _0x43307e?{'count':_0x39b2bf,'rows':_0x43307e}:null;}})[_0x8cae('0x11')](respondWithResult(_0x5036c1,null))[_0x8cae('0x5e')](handleError(_0x5036c1,null));};exports[_0x8cae('0x9a')]=function(_0x23931f,_0x35310b){var _0x109bae={'raw':!![],'where':{}};var _0x917397={};var _0x9547f3={'count':0x0,'rows':[]};return db[_0x8cae('0x47')]['findOne']({'where':{'id':_0x23931f[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x35310b,null))[_0x8cae('0x11')](function(_0x3b0ffd){if(_0x3b0ffd){_0x917397[_0x8cae('0x4b')]=_[_0x8cae('0x4d')](db[_0x8cae('0x9b')][_0x8cae('0x48')]);_0x917397[_0x8cae('0x50')]=_[_0x8cae('0x4d')](_0x23931f[_0x8cae('0x50')]);_0x917397[_0x8cae('0x4e')]=_[_0x8cae('0x4f')](_0x917397[_0x8cae('0x4b')],_0x917397[_0x8cae('0x50')]);_0x109bae[_0x8cae('0x52')]=_[_0x8cae('0x4f')](_0x917397[_0x8cae('0x4b')],qs[_0x8cae('0x51')](_0x23931f[_0x8cae('0x50')][_0x8cae('0x51')]));_0x109bae['attributes']=_0x109bae[_0x8cae('0x52')][_0x8cae('0x5d')]?_0x109bae[_0x8cae('0x52')]:_0x917397[_0x8cae('0x4b')];if(!_0x23931f[_0x8cae('0x50')][_0x8cae('0x6a')](_0x8cae('0x6b'))){_0x109bae[_0x8cae('0x20')]=qs[_0x8cae('0x20')](_0x23931f['query']['limit']);_0x109bae[_0x8cae('0x1e')]=qs[_0x8cae('0x1e')](_0x23931f[_0x8cae('0x50')]['offset']);}_0x109bae['order']=qs['sort'](_0x23931f[_0x8cae('0x50')][_0x8cae('0x53')]);_0x109bae[_0x8cae('0x56')]=qs['filters'](_[_0x8cae('0x54')](_0x23931f[_0x8cae('0x50')],_0x917397[_0x8cae('0x4e')]));_0x109bae['where'][_0x8cae('0x67')]=_0x3b0ffd['id'];if(_0x23931f[_0x8cae('0x50')]['filter']){_0x109bae[_0x8cae('0x56')]=_[_0x8cae('0x57')](_0x109bae['where'],{'$or':_[_0x8cae('0x4c')](_0x109bae[_0x8cae('0x52')],function(_0x565133){var _0x121bf3={};_0x121bf3[_0x565133]={'$like':'%'+_0x23931f['query'][_0x8cae('0x55')]+'%'};return _0x121bf3;})});}if(_0x23931f['query'][_0x8cae('0x9c')]){var _0x1a5843=_0x23931f['query']['$gte'][_0x8cae('0x9d')](',');var _0x3d8235={};_0x3d8235[_0x1a5843[0x0]]={'$gte':moment(_0x1a5843[0x1])[_0x8cae('0x9e')](_0x8cae('0x9f'))};_0x109bae[_0x8cae('0x56')]=_[_0x8cae('0x57')](_0x109bae['where'],_0x3d8235);}_0x109bae=_[_0x8cae('0x57')]({},_0x109bae,_0x23931f['options']);return db[_0x8cae('0x9b')][_0x8cae('0x21')]({'where':_0x109bae['where']})[_0x8cae('0x11')](function(_0x46cb25){_0x9547f3[_0x8cae('0x21')]=_0x46cb25;if(_0x23931f[_0x8cae('0x50')][_0x8cae('0x59')]){_0x109bae[_0x8cae('0x5a')]=[{'all':!![]}];}return db[_0x8cae('0x9b')][_0x8cae('0x5b')](_0x109bae);})[_0x8cae('0x11')](function(_0x1d7404){if(_0x23931f[_0x8cae('0x50')][_0x8cae('0xa0')]===_0x8cae('0xa1')){for(var _0x4885c1=0x0;_0x4885c1<_0x1d7404[_0x8cae('0x5d')];_0x4885c1++){_0x1d7404[_0x4885c1]['body']=juice(_0x1d7404[_0x4885c1][_0x8cae('0x5f')]);}}_0x9547f3[_0x8cae('0x5c')]=_0x1d7404;return _0x9547f3;});}})[_0x8cae('0x11')](respondWithFilteredResult(_0x35310b,_0x109bae))[_0x8cae('0x5e')](handleError(_0x35310b,null));};exports['send']=function(_0x581082,_0x37ff55){var _0x243996,_0xa5199d={},_0x56f98d;if(_0x581082['body']['to']){_0x56f98d=_0x581082[_0x8cae('0x5f')]['to'][_0x8cae('0x9d')](',')[0x0];}return db['MailAccount'][_0x8cae('0x62')]({'where':{'id':_0x581082['params']['id']},'include':[{'model':db[_0x8cae('0xa2')],'as':_0x8cae('0xa3'),'include':[{'model':db[_0x8cae('0x88')],'as':'Contacts','where':{'email':_0x56f98d},'limit':0x1,'order':[[_0x8cae('0xa4'),_0x8cae('0xa5')]]}]},{'model':db[_0x8cae('0x44')],'as':_0x8cae('0x41'),'raw':!![],'include':[{'model':db[_0x8cae('0xa6')],'as':_0x8cae('0xa6'),'raw':!![]}]}]})[_0x8cae('0x11')](handleEntityNotFound(_0x37ff55,null))[_0x8cae('0x11')](function(_0x277e86){if(!_0x277e86)return;_0x243996=_0x277e86;if(!_0x277e86['Smtp'])throw new Error(_0x8cae('0xa7'));if(_[_0x8cae('0x74')](_0x581082['body'][_0x8cae('0xa8')])){_0x581082['body'][_0x8cae('0xa8')]=util[_0x8cae('0x9e')](_0x8cae('0xa9'),_0x277e86[_0x8cae('0x29')],_0x277e86['email']||_0x277e86[_0x8cae('0x41')]['user']);}if(_0x581082['body']['attachments']&&_0x581082['body'][_0x8cae('0xaa')]['length']){for(var _0x35024d=0x0;_0x35024d<_0x581082[_0x8cae('0x5f')][_0x8cae('0xaa')][_0x8cae('0x5d')];_0x35024d+=0x1){_0x581082['body']['attachments'][_0x35024d]={'filename':_0x581082['body']['attachments'][_0x35024d][_0x8cae('0x29')],'path':path['join'](config[_0x8cae('0xab')],_0x8cae('0xac'),_0x581082[_0x8cae('0x5f')][_0x8cae('0xaa')][_0x35024d][_0x8cae('0xad')])};}}var _0x364512=_0x277e86[_0x8cae('0xae')]();return respondWithRpcPromise(_0x8cae('0xaf'),_0x8cae('0xb0'),{'account':_0x364512,'message':_0x581082[_0x8cae('0x5f')]});})[_0x8cae('0x11')](function(_0x890c5){if(!_0x890c5)return;_0xa5199d=_0x890c5;if(!_0x243996['List'])throw new Error(_0x8cae('0xb1'));if(_0x243996[_0x8cae('0xa3')][_0x8cae('0xb2')]['length'])return _0x243996[_0x8cae('0xa3')]['Contacts'][0x0];return db[_0x8cae('0x88')][_0x8cae('0x70')](_['defaults'](_0x581082[_0x8cae('0x5f')],{'firstName':_0x581082['body']['to'],'email':_0x581082['body']['to'],'phone':_0x581082[_0x8cae('0x5f')]['to'],'ListId':_0x243996[_0x8cae('0xb3')]}));})[_0x8cae('0x11')](function(_0x4f8439){if(!_0x4f8439)return;var _0x478ac3={'UserId':_0x581082[_0x8cae('0x35')]['id'],'ContactId':_0x4f8439['id'],'MailAccountId':_0x243996['id'],'inReplyTo':_0xa5199d[_0x8cae('0xb4')],'to':_0x581082[_0x8cae('0x5f')]['from'],'cc':_0x581082[_0x8cae('0x5f')]['cc'],'subject':_0x581082[_0x8cae('0x5f')][_0x8cae('0xb5')],'attach':_0x581082[_0x8cae('0x5f')][_0x8cae('0xb6')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x8cae('0x9f')),'lastMsgDirection':'out','Messages':[_['merge'](_0x581082['body'],{'messageId':_0xa5199d['messageId'],'sentAt':moment()[_0x8cae('0x9e')](_0x8cae('0x9f')),'read':!![],'MailAccountId':_0x243996['id'],'UserId':_0x581082['user']['id'],'ContactId':_0x4f8439['id']})]};if(_0x581082[_0x8cae('0x5f')][_0x8cae('0xb7')]){_0x478ac3=_[_0x8cae('0x57')](_0x478ac3,_0x581082[_0x8cae('0x5f')]['Interaction']);}return db[_0x8cae('0x84')][_0x8cae('0x70')](_0x478ac3,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x8cae('0x11')](respondWithResult(_0x37ff55,null))[_0x8cae('0x5e')](handleError(_0x37ff55,null));};exports['verifySmtp']=function(_0x29b577,_0x5467b9){return db[_0x8cae('0x47')][_0x8cae('0x62')]({'where':{'id':_0x29b577[_0x8cae('0x63')]['id']},'include':[{'model':db[_0x8cae('0x44')],'as':_0x8cae('0x41'),'raw':!![],'include':[{'model':db[_0x8cae('0xa6')],'as':_0x8cae('0xa6'),'raw':!![]}]}]})[_0x8cae('0x11')](handleEntityNotFound(_0x5467b9,null))[_0x8cae('0x11')](function(_0x1a1d9e){if(!_0x1a1d9e[_0x8cae('0x41')])return;var _0x38ef39=_0x1a1d9e['getSmtpOptions']();return respondWithRpcPromise(_0x8cae('0xb8'),_0x8cae('0xb9'),{'account':_0x38ef39});})[_0x8cae('0x11')](respondWithResult(_0x5467b9,null))['catch'](handleError(_0x5467b9,null));};exports[_0x8cae('0x24')]=function(_0x5e8333,_0x4a432b){return db['MailAccount'][_0x8cae('0x62')]({'where':{'id':_0x5e8333[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x4a432b,null))[_0x8cae('0x11')](function(_0xe8f317){if(_0xe8f317&&_0xe8f317[_0x8cae('0x3e')]){throw new db[(_0x8cae('0xba'))]['ValidationError'](_0x8cae('0xbb'));}return _0xe8f317;})[_0x8cae('0x11')](removeEntity(_0x4a432b,null))[_0x8cae('0x5e')](handleError(_0x4a432b,null));};exports['addAgents']=function(_0x2d8c8d,_0x2afc2a){return db['MailAccount'][_0x8cae('0x62')]({'where':{'id':_0x2d8c8d[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x2afc2a,null))[_0x8cae('0x11')](function(_0x4b0c50){if(_0x4b0c50){return _0x4b0c50[_0x8cae('0xbc')](_0x2d8c8d[_0x8cae('0x5f')][_0x8cae('0x6e')],_[_0x8cae('0x86')](_0x2d8c8d[_0x8cae('0x5f')],[_0x8cae('0x6e'),'id'])||{})['spread'](function(_0x226228){for(var _0xfdfcbe=0x0;_0xfdfcbe<_0x2d8c8d[_0x8cae('0x5f')][_0x8cae('0x6e')][_0x8cae('0x5d')];_0xfdfcbe+=0x1){socket[_0x8cae('0xbd')](_0x8cae('0xbe'),{'UserId':Number(_0x2d8c8d[_0x8cae('0x5f')]['ids'][_0xfdfcbe]),'MailAccountId':Number(_0x2d8c8d['params']['id'])});}return _0x226228;});}})[_0x8cae('0x11')](respondWithResult(_0x2afc2a,null))[_0x8cae('0x5e')](handleError(_0x2afc2a,null));};exports[_0x8cae('0xbf')]=function(_0x497b31,_0x5968ee){return db[_0x8cae('0x47')][_0x8cae('0x62')]({'where':{'id':_0x497b31[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x5968ee,null))[_0x8cae('0x11')](function(_0x570368){if(_0x570368){return _0x570368['removeAgents'](_0x497b31[_0x8cae('0x50')][_0x8cae('0x6e')])[_0x8cae('0x11')](function(){if(_[_0x8cae('0xc0')](_0x497b31[_0x8cae('0x50')]['ids'])){for(var _0x1a96ea=0x0;_0x1a96ea<_0x497b31[_0x8cae('0x50')][_0x8cae('0x6e')][_0x8cae('0x5d')];_0x1a96ea+=0x1){socket['emit'](_0x8cae('0xc1'),{'UserId':Number(_0x497b31[_0x8cae('0x50')][_0x8cae('0x6e')][_0x1a96ea]),'MailAccountId':Number(_0x497b31['params']['id'])});}}else{socket[_0x8cae('0xbd')](_0x8cae('0xc1'),{'UserId':Number(_0x497b31[_0x8cae('0x50')][_0x8cae('0x6e')]),'MailAccountId':Number(_0x497b31[_0x8cae('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x5968ee,null))[_0x8cae('0x5e')](handleError(_0x5968ee,null));};exports['getAgents']=function(_0x3194a7,_0x2f6954){var _0x34f1bc={};var _0x2cad93={};var _0x45b662;var _0x141c3e;return db[_0x8cae('0x47')]['findOne']({'where':{'id':_0x3194a7[_0x8cae('0x63')]['id']}})[_0x8cae('0x11')](handleEntityNotFound(_0x2f6954,null))[_0x8cae('0x11')](function(_0x5c566f){if(_0x5c566f){_0x45b662=_0x5c566f;_0x2cad93[_0x8cae('0x4b')]=_[_0x8cae('0x4d')](db[_0x8cae('0x8a')][_0x8cae('0x48')]);_0x2cad93[_0x8cae('0x50')]=_[_0x8cae('0x4d')](_0x3194a7[_0x8cae('0x50')]);_0x2cad93[_0x8cae('0x4e')]=_[_0x8cae('0x4f')](_0x2cad93['model'],_0x2cad93[_0x8cae('0x50')]);_0x34f1bc[_0x8cae('0x52')]=_[_0x8cae('0x4f')](_0x2cad93['model'],qs['fields'](_0x3194a7[_0x8cae('0x50')][_0x8cae('0x51')]));_0x34f1bc[_0x8cae('0x52')]=_0x34f1bc[_0x8cae('0x52')][_0x8cae('0x5d')]?_0x34f1bc[_0x8cae('0x52')]:_0x2cad93[_0x8cae('0x4b')];_0x34f1bc[_0x8cae('0x6c')]=qs[_0x8cae('0x53')](_0x3194a7[_0x8cae('0x50')][_0x8cae('0x53')]);_0x34f1bc[_0x8cae('0x56')]=qs[_0x8cae('0x4e')](_[_0x8cae('0x54')](_0x3194a7['query'],_0x2cad93['filters']));if(_0x3194a7[_0x8cae('0x50')][_0x8cae('0x55')]){_0x34f1bc['where']=_['merge'](_0x34f1bc[_0x8cae('0x56')],{'$or':_['map'](_0x34f1bc['attributes'],function(_0x524069){var _0x1135c0={};_0x1135c0[_0x524069]={'$like':'%'+_0x3194a7[_0x8cae('0x50')]['filter']+'%'};return _0x1135c0;})});}_0x34f1bc=_[_0x8cae('0x57')]({},_0x34f1bc,_0x3194a7[_0x8cae('0x58')]);return _0x45b662[_0x8cae('0xc2')](_0x34f1bc);}})[_0x8cae('0x11')](function(_0x3b1061){if(_0x3b1061){_0x141c3e=_0x3b1061[_0x8cae('0x5d')];if(!_0x3194a7[_0x8cae('0x50')]['hasOwnProperty'](_0x8cae('0x6b'))){_0x34f1bc[_0x8cae('0x20')]=qs['limit'](_0x3194a7[_0x8cae('0x50')]['limit']);_0x34f1bc[_0x8cae('0x1e')]=qs[_0x8cae('0x1e')](_0x3194a7[_0x8cae('0x50')][_0x8cae('0x1e')]);}return _0x45b662[_0x8cae('0xc2')](_0x34f1bc);}})['then'](function(_0x214e83){if(_0x214e83){return _0x214e83?{'count':_0x141c3e,'rows':_0x214e83}:null;}})['then'](respondWithResult(_0x2f6954,null))[_0x8cae('0x5e')](handleError(_0x2f6954,null));}; \ No newline at end of file +var _0xdfb8=['format','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','http','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','update','destroy','get','stack','name','yahoo','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','body','custom','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','sort','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','basename','getSmtpOptions','SendMail','sendMail','Contacts','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0xdfb8,0x192));var _0x8dfb=function(_0x45dbe3,_0xd2bf96){_0x45dbe3=_0x45dbe3-0x0;var _0x1e71cf=_0xdfb8[_0x45dbe3];return _0x1e71cf;};'use strict';var moment=require(_0x8dfb('0x0'));var BPromise=require(_0x8dfb('0x1'));var util=require(_0x8dfb('0x2'));var path=require(_0x8dfb('0x3'));var _=require(_0x8dfb('0x4'));var juice=require('juice');var Redis=require(_0x8dfb('0x5'));var qs=require(_0x8dfb('0x6'));var logger=require('../../config/logger')(_0x8dfb('0x7'));var config=require('../../config/environment');var db=require(_0x8dfb('0x8'))['db'];config[_0x8dfb('0x9')]=_[_0x8dfb('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8dfb('0xb'))(new Redis(config['redis']));require(_0x8dfb('0xc'))[_0x8dfb('0xd')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8dfb('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x2e14da,_0x834a23,_0x3307f7,_0x544438){return new BPromise(function(_0x3aca8b,_0x1dd552){var _0x25c1df=_0x544438||client;return _0x25c1df[_0x8dfb('0xf')](_0x2e14da,_0x3307f7)[_0x8dfb('0x10')](function(_0x299dc3){logger[_0x8dfb('0x11')]('MailAccount,\x20%s,\x20%s',_0x834a23,_0x8dfb('0x12'));logger['debug'](_0x8dfb('0x13'),_0x834a23,_0x8dfb('0x12'),JSON[_0x8dfb('0x14')](_0x299dc3));if(_0x299dc3[_0x8dfb('0x15')]){if(_0x299dc3['error']['code']===0x1f4){logger[_0x8dfb('0x15')]('MailAccount,\x20%s,\x20%s',_0x834a23,_0x299dc3[_0x8dfb('0x15')][_0x8dfb('0x16')]);return _0x1dd552(_0x299dc3[_0x8dfb('0x15')]['message']);}logger[_0x8dfb('0x15')](_0x8dfb('0x17'),_0x834a23,_0x299dc3[_0x8dfb('0x15')][_0x8dfb('0x16')]);return _0x3aca8b(_0x299dc3['error'][_0x8dfb('0x16')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x834a23,_0x8dfb('0x12'));_0x3aca8b(_0x299dc3[_0x8dfb('0x18')][_0x8dfb('0x16')]);}})[_0x8dfb('0x19')](function(_0x30ec9b){logger[_0x8dfb('0x15')](_0x8dfb('0x17'),_0x834a23,_0x30ec9b);_0x1dd552(_0x30ec9b);});});}function respondWithStatusCode(_0x5eca1b,_0x418e9a){_0x418e9a=_0x418e9a||0xcc;return function(_0x41689e){if(_0x41689e){return _0x5eca1b[_0x8dfb('0x1a')](_0x418e9a);}return _0x5eca1b[_0x8dfb('0x1b')](_0x418e9a)[_0x8dfb('0x1c')]();};}function respondWithResult(_0x102743,_0x2df391){_0x2df391=_0x2df391||0xc8;return function(_0x5b5b10){if(_0x5b5b10){return _0x102743[_0x8dfb('0x1b')](_0x2df391)['json'](_0x5b5b10);}};}function respondWithFilteredResult(_0x19f109,_0x5aecfa){return function(_0x3ffdcc){if(_0x3ffdcc){var _0x585aa8=typeof _0x5aecfa[_0x8dfb('0x1d')]===_0x8dfb('0x1e')&&typeof _0x5aecfa[_0x8dfb('0x1f')]===_0x8dfb('0x1e');var _0x91a2cb=_0x3ffdcc[_0x8dfb('0x20')];var _0x290d91=_0x585aa8?0x0:_0x5aecfa[_0x8dfb('0x1d')];var _0x372f28=_0x585aa8?_0x3ffdcc['count']:_0x5aecfa[_0x8dfb('0x1d')]+_0x5aecfa[_0x8dfb('0x1f')];var _0x5a65b1;if(_0x372f28>=_0x91a2cb){_0x372f28=_0x91a2cb;_0x5a65b1=0xc8;}else{_0x5a65b1=0xce;}_0x19f109[_0x8dfb('0x1b')](_0x5a65b1);return _0x19f109[_0x8dfb('0x21')]('Content-Range',_0x290d91+'-'+_0x372f28+'/'+_0x91a2cb)[_0x8dfb('0x22')](_0x3ffdcc);}return null;};}function saveUpdates(_0x2ec343){return function(_0x4e590d){if(_0x4e590d){return _0x4e590d[_0x8dfb('0x23')](_0x2ec343)[_0x8dfb('0x10')](function(_0x379f0f){return _0x379f0f;});}return null;};}function removeEntity(_0x435322){return function(_0xe3d615){if(_0xe3d615){return _0xe3d615[_0x8dfb('0x24')]()[_0x8dfb('0x10')](function(){var _0x4d30e1=_0xe3d615[_0x8dfb('0x25')]({'plain':!![]});var _0x58a6b2='MailAccounts';return db['UserProfileResource'][_0x8dfb('0x24')]({'where':{'type':_0x58a6b2,'resourceId':_0x4d30e1['id']}})[_0x8dfb('0x10')](function(){return _0xe3d615;});})[_0x8dfb('0x10')](function(){_0x435322['status'](0xcc)[_0x8dfb('0x1c')]();});}};}function handleEntityNotFound(_0x4598ac){return function(_0xf0e0c7){if(!_0xf0e0c7){_0x4598ac[_0x8dfb('0x1a')](0x194);}return _0xf0e0c7;};}function handleError(_0x1a7f7,_0x433ebf){_0x433ebf=_0x433ebf||0x1f4;return function(_0x4bf98a){logger[_0x8dfb('0x15')](_0x4bf98a[_0x8dfb('0x26')]);if(_0x4bf98a[_0x8dfb('0x27')]){delete _0x4bf98a['name'];}_0x1a7f7[_0x8dfb('0x1b')](_0x433ebf)['send'](_0x4bf98a);};}function getImapHost(_0x3ac8cc){switch(_0x3ac8cc){case'gmail':return'imap.gmail.com';case _0x8dfb('0x28'):return'imap.mail.yahoo.com';case _0x8dfb('0x29'):return _0x8dfb('0x2a');case _0x8dfb('0x2b'):return'outlook.office365.com';}throw new Error(_0x8dfb('0x2c'),_0x3ac8cc);}function getSmtpHost(_0x514d41){switch(_0x514d41){case _0x8dfb('0x2d'):return _0x8dfb('0x2e');case _0x8dfb('0x28'):return _0x8dfb('0x2f');case _0x8dfb('0x29'):return _0x8dfb('0x30');case _0x8dfb('0x2b'):return'smtp.office365.com';}throw new Error(_0x8dfb('0x2c'),_0x514d41);}function getAuthenticationOptions(_0x241a36,_0x1c6931){var _0x109d67={};var _0x498bc4={};if(_0x241a36){_0x109d67[_0x8dfb('0x31')]=_0x498bc4[_0x8dfb('0x31')]=_0x1c6931[_0x8dfb('0x32')];_0x109d67[_0x8dfb('0x33')]=_0x498bc4[_0x8dfb('0x34')]=_0x1c6931[_0x8dfb('0x33')];if(_0x1c6931[_0x8dfb('0x35')]){_0x109d67[_0x8dfb('0x35')]=_0x498bc4[_0x8dfb('0x35')]=!![];_0x109d67[_0x8dfb('0x36')]=_0x498bc4[_0x8dfb('0x36')]=_0x1c6931[_0x8dfb('0x36')];_0x109d67[_0x8dfb('0x33')]=_0x498bc4[_0x8dfb('0x34')]=null;}else{_0x109d67[_0x8dfb('0x36')]=_0x498bc4[_0x8dfb('0x36')]=null;}_0x109d67[_0x8dfb('0x37')]=getImapHost(_0x241a36);_0x109d67[_0x8dfb('0x38')]=0x3e1;_0x498bc4[_0x8dfb('0x37')]=getSmtpHost(_0x241a36);_0x498bc4['port']=0x24b;_0x498bc4[_0x8dfb('0x39')]=![];_0x109d67['service']=_0x498bc4[_0x8dfb('0x3a')]=null;}else{if(_0x1c6931[_0x8dfb('0x3b')]){_0x109d67[_0x8dfb('0x31')]=_0x498bc4[_0x8dfb('0x31')]=_0x1c6931[_0x8dfb('0x32')];_0x109d67[_0x8dfb('0x33')]=_0x498bc4[_0x8dfb('0x34')]=_0x1c6931['password'];}else{_0x109d67[_0x8dfb('0x3b')]=_0x498bc4['authentication']=![];_0x109d67[_0x8dfb('0x31')]=_0x498bc4[_0x8dfb('0x31')]=null;_0x109d67['password']=_0x498bc4[_0x8dfb('0x34')]=null;}_0x109d67[_0x8dfb('0x37')]=_0x1c6931[_0x8dfb('0x3c')][_0x8dfb('0x37')];_0x109d67[_0x8dfb('0x38')]=_0x1c6931[_0x8dfb('0x3c')][_0x8dfb('0x38')];_0x498bc4[_0x8dfb('0x37')]=_0x1c6931['Smtp']['host'];_0x498bc4[_0x8dfb('0x38')]=_0x1c6931[_0x8dfb('0x3d')][_0x8dfb('0x38')];}return{'Imap':_0x109d67,'Smtp':_0x498bc4};}exports['index']=function(_0x288eeb,_0x3beea9){var _0x5befd7={'include':[{'model':db[_0x8dfb('0x3e')],'as':_0x8dfb('0x3c')},{'model':db[_0x8dfb('0x3f')],'as':_0x8dfb('0x3d')},{'model':db[_0x8dfb('0x40')],'as':_0x8dfb('0x41')}]},_0x498f97={},_0x2387e0={'count':0x0,'rows':[]};var _0x5128eb=_[_0x8dfb('0x42')](db[_0x8dfb('0x43')][_0x8dfb('0x44')],function(_0x5f43c6){return{'name':_0x5f43c6[_0x8dfb('0x45')],'type':_0x5f43c6[_0x8dfb('0x46')][_0x8dfb('0x47')]};});_0x498f97[_0x8dfb('0x48')]=_[_0x8dfb('0x42')](_0x5128eb,_0x8dfb('0x27'));_0x498f97[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x288eeb[_0x8dfb('0x49')]);_0x498f97[_0x8dfb('0x4b')]=_['intersection'](_0x498f97[_0x8dfb('0x48')],_0x498f97[_0x8dfb('0x49')]);_0x5befd7['attributes']=_[_0x8dfb('0x4c')](_0x498f97[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x5befd7[_0x8dfb('0x4e')]=_0x5befd7[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x5befd7[_0x8dfb('0x4e')]:_0x498f97['model'];if(!_0x288eeb[_0x8dfb('0x49')]['hasOwnProperty'](_0x8dfb('0x50'))){_0x5befd7[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x288eeb[_0x8dfb('0x49')]['limit']);_0x5befd7[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x1d')]);}_0x5befd7[_0x8dfb('0x51')]=qs['sort'](_0x288eeb[_0x8dfb('0x49')]['sort']);_0x5befd7[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x288eeb[_0x8dfb('0x49')],_0x498f97['filters']),_0x5128eb);if(_0x288eeb[_0x8dfb('0x49')]['filter']){_0x5befd7[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0x5befd7['where'],{'$or':_[_0x8dfb('0x42')](_0x5128eb,function(_0x968cc6){if(_0x968cc6[_0x8dfb('0x46')]!==_0x8dfb('0x55')){var _0x4b3c2f={};_0x4b3c2f[_0x968cc6['name']]={'$like':'%'+_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0x4b3c2f;}})});}_0x5befd7=_[_0x8dfb('0x54')]({},_0x5befd7,_0x288eeb['options']);var _0x170958={'where':_0x5befd7[_0x8dfb('0x52')]};return db[_0x8dfb('0x43')][_0x8dfb('0x20')](_0x170958)[_0x8dfb('0x10')](function(_0x49e4c0){_0x2387e0['count']=_0x49e4c0;if(_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x57')]){_0x5befd7[_0x8dfb('0x58')]=[{'all':!![]}];}return db[_0x8dfb('0x43')][_0x8dfb('0x59')](_0x5befd7);})['then'](function(_0x51514d){_0x2387e0[_0x8dfb('0x5a')]=_0x51514d;return _0x2387e0;})[_0x8dfb('0x10')](respondWithFilteredResult(_0x3beea9,_0x5befd7))[_0x8dfb('0x19')](handleError(_0x3beea9,null));};exports[_0x8dfb('0x5b')]=function(_0xdbf6ad,_0x1e4721){var _0x4c3951={'raw':![],'where':{'id':_0xdbf6ad[_0x8dfb('0x5c')]['id']},'include':[{'model':db[_0x8dfb('0x3e')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x8dfb('0x40')],'as':_0x8dfb('0x41')}]},_0xb5f0ff={};_0xb5f0ff[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db[_0x8dfb('0x43')][_0x8dfb('0x44')]);_0xb5f0ff['query']=_[_0x8dfb('0x4a')](_0xdbf6ad[_0x8dfb('0x49')]);_0xb5f0ff[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0xb5f0ff[_0x8dfb('0x48')],_0xb5f0ff[_0x8dfb('0x49')]);_0x4c3951[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0xb5f0ff[_0x8dfb('0x48')],qs['fields'](_0xdbf6ad[_0x8dfb('0x49')]['fields']));_0x4c3951[_0x8dfb('0x4e')]=_0x4c3951[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x4c3951[_0x8dfb('0x4e')]:_0xb5f0ff[_0x8dfb('0x48')];if(_0xdbf6ad['query'][_0x8dfb('0x57')]){_0x4c3951[_0x8dfb('0x58')]=[{'all':!![]}];}_0x4c3951=_[_0x8dfb('0x54')]({},_0x4c3951,_0xdbf6ad[_0x8dfb('0x5d')]);return db[_0x8dfb('0x43')][_0x8dfb('0x5e')](_0x4c3951)[_0x8dfb('0x10')](handleEntityNotFound(_0x1e4721,null))['then'](respondWithResult(_0x1e4721,null))[_0x8dfb('0x19')](handleError(_0x1e4721,null));};exports[_0x8dfb('0x23')]=function(_0x5e1257,_0x415b3d){if(_0x5e1257[_0x8dfb('0x5f')]['id']){delete _0x5e1257[_0x8dfb('0x5f')]['id'];}var _0x44b90a=_0x5e1257[_0x8dfb('0x5f')]['provider']===_0x8dfb('0x60')?null:_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x61')];var _0x117351=_0x5e1257['body'][_0x8dfb('0x3c')]||{};var _0x114099=_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3d')]||{};if(_0x44b90a){_0x117351[_0x8dfb('0x37')]=getImapHost(_0x44b90a);_0x117351['port']=0x3e1;_0x114099[_0x8dfb('0x37')]=getSmtpHost(_0x44b90a);_0x114099[_0x8dfb('0x38')]=0x24b;_0x114099[_0x8dfb('0x39')]=![];}if(_0x114099['modernAuthentication']){_0x114099[_0x8dfb('0x39')]=![];}else{_0x114099[_0x8dfb('0x36')]=null;}if(!_0x117351['modernAuthentication'])_0x117351[_0x8dfb('0x36')]=null;_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3c')]=_0x117351;_0x5e1257['body'][_0x8dfb('0x3d')]=_0x114099;return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x5e1257[_0x8dfb('0x5c')]['id']},'include':[{'model':db[_0x8dfb('0x3e')],'as':_0x8dfb('0x3c')},{'model':db[_0x8dfb('0x3f')],'as':'Smtp'},{'model':db[_0x8dfb('0x40')],'as':_0x8dfb('0x41')}]})[_0x8dfb('0x10')](handleEntityNotFound(_0x415b3d,null))[_0x8dfb('0x10')](function(_0x4f0b48){if(!_0x4f0b48)throw new Error(_0x8dfb('0x62'));if(_0x4f0b48[_0x8dfb('0x3a')])delete _0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3c')];return _0x4f0b48;})['then'](saveUpdates(_0x5e1257[_0x8dfb('0x5f')],null))[_0x8dfb('0x10')](function(_0xfe14f1){if(!_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3c')])return _0xfe14f1;return db['MailServerIn'][_0x8dfb('0x23')](_0x5e1257['body']['Imap'],{'where':{'MailAccountId':_0xfe14f1['id']}})['then'](function(){return _0xfe14f1;});})[_0x8dfb('0x10')](function(_0x4596ed){if(!_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3d')])return _0x4596ed;return db['MailServerOut'][_0x8dfb('0x23')](_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3d')],{'where':{'MailAccountId':_0x4596ed['id']}})[_0x8dfb('0x10')](function(){return _0x4596ed;});})[_0x8dfb('0x10')](respondWithResult(_0x415b3d,null))['catch'](handleError(_0x415b3d,null));};exports[_0x8dfb('0x63')]=function(_0x154451,_0x489ed6){return db[_0x8dfb('0x43')][_0x8dfb('0x63')]()[_0x8dfb('0x10')](respondWithResult(_0x489ed6,null))[_0x8dfb('0x19')](handleError(_0x489ed6,null));};exports[_0x8dfb('0x64')]=function(_0x4edc77,_0xb2d399){if(_0x4edc77[_0x8dfb('0x5f')]['id']){delete _0x4edc77[_0x8dfb('0x5f')]['id'];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x4edc77[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0xb2d399,null))['then'](function(_0x18070b){if(_0x18070b){_0x4edc77[_0x8dfb('0x5f')][_0x8dfb('0x65')]=_0x18070b['id'];return db[_0x8dfb('0x66')][_0x8dfb('0x67')](_0x4edc77['body']);}})[_0x8dfb('0x10')](respondWithResult(_0xb2d399,null))[_0x8dfb('0x19')](handleError(_0xb2d399,null));};exports[_0x8dfb('0x68')]=function(_0x42d975,_0x27dff0){var _0x5c8b48={'raw':![],'where':{}};var _0x29e855={};var _0x1daf66={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x42d975[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x27dff0,null))['then'](function(_0x4535b3){if(_0x4535b3){_0x29e855[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db[_0x8dfb('0x66')][_0x8dfb('0x44')]);_0x29e855[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x42d975[_0x8dfb('0x49')]);_0x29e855[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0x29e855[_0x8dfb('0x48')],_0x29e855['query']);_0x5c8b48[_0x8dfb('0x4e')]=_['intersection'](_0x29e855[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x5c8b48[_0x8dfb('0x4e')]=_0x5c8b48[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x5c8b48[_0x8dfb('0x4e')]:_0x29e855[_0x8dfb('0x48')];if(!_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x5c8b48[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x42d975['query'][_0x8dfb('0x1f')]);_0x5c8b48[_0x8dfb('0x1d')]=qs['offset'](_0x42d975['query'][_0x8dfb('0x1d')]);}_0x5c8b48[_0x8dfb('0x51')]=qs[_0x8dfb('0x6b')](_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x5c8b48['where']=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x42d975['query'],_0x29e855[_0x8dfb('0x4b')]));_0x5c8b48['where'][_0x8dfb('0x65')]=_0x4535b3['id'];if(_0x42d975[_0x8dfb('0x49')]['filter']){_0x5c8b48[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0x5c8b48[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0x5c8b48['attributes'],function(_0x3eae93){var _0x382ec1={};_0x382ec1[_0x3eae93]={'$like':'%'+_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0x382ec1;})});}_0x5c8b48=_[_0x8dfb('0x54')]({},_0x5c8b48,_0x42d975[_0x8dfb('0x5d')]);return db[_0x8dfb('0x66')][_0x8dfb('0x20')]({'where':_0x5c8b48['where']})[_0x8dfb('0x10')](function(_0x3b045d){_0x1daf66[_0x8dfb('0x20')]=_0x3b045d;if(_0x42d975['query'][_0x8dfb('0x57')]){_0x5c8b48['include']=[{'all':!![]}];}return db[_0x8dfb('0x66')]['findAll'](_0x5c8b48);})['then'](function(_0x23e91e){_0x1daf66['rows']=_0x23e91e;return _0x1daf66;});}})[_0x8dfb('0x10')](respondWithFilteredResult(_0x27dff0,_0x5c8b48))[_0x8dfb('0x19')](handleError(_0x27dff0,null));};exports[_0x8dfb('0x6c')]=function(_0x4cb6e2,_0x399b82){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x4cb6e2[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x399b82,null))[_0x8dfb('0x10')](function(_0x2d9cb1){if(_0x2d9cb1){return _0x2d9cb1['removeDispositions'](_0x4cb6e2[_0x8dfb('0x49')][_0x8dfb('0x6d')]);}})[_0x8dfb('0x10')](respondWithStatusCode(_0x399b82,null))[_0x8dfb('0x19')](handleError(_0x399b82,null));};exports['addAnswer']=function(_0x581d8c,_0xa91c1b){if(_0x581d8c[_0x8dfb('0x5f')]['id']){delete _0x581d8c[_0x8dfb('0x5f')]['id'];}return db['MailAccount'][_0x8dfb('0x5e')]({'where':{'id':_0x581d8c[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0xa91c1b,null))[_0x8dfb('0x10')](function(_0x2c1c0b){if(_0x2c1c0b){_0x581d8c['body']['MailAccountId']=_0x2c1c0b['id'];return db[_0x8dfb('0x6e')][_0x8dfb('0x67')](_0x581d8c[_0x8dfb('0x5f')]);}})['then'](respondWithResult(_0xa91c1b,null))[_0x8dfb('0x19')](handleError(_0xa91c1b,null));};exports[_0x8dfb('0x6f')]=function(_0x1cbf1d,_0x3357e0){var _0x2d86f1={'raw':![],'where':{}};var _0x21c7ec={};var _0x162574={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x1cbf1d[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x3357e0,null))['then'](function(_0x54ba9d){if(_0x54ba9d){_0x21c7ec[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db[_0x8dfb('0x6e')][_0x8dfb('0x44')]);_0x21c7ec[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x1cbf1d['query']);_0x21c7ec[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0x21c7ec[_0x8dfb('0x48')],_0x21c7ec[_0x8dfb('0x49')]);_0x2d86f1[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0x21c7ec[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x1cbf1d[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x2d86f1[_0x8dfb('0x4e')]=_0x2d86f1[_0x8dfb('0x4e')]['length']?_0x2d86f1[_0x8dfb('0x4e')]:_0x21c7ec['model'];if(!_0x1cbf1d['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x2d86f1[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x1cbf1d['query']['limit']);_0x2d86f1[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x1cbf1d[_0x8dfb('0x49')]['offset']);}_0x2d86f1[_0x8dfb('0x51')]=qs['sort'](_0x1cbf1d[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x2d86f1[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x1cbf1d['query'],_0x21c7ec[_0x8dfb('0x4b')]));_0x2d86f1[_0x8dfb('0x52')][_0x8dfb('0x65')]=_0x54ba9d['id'];if(_0x1cbf1d['query'][_0x8dfb('0x56')]){_0x2d86f1[_0x8dfb('0x52')]=_['merge'](_0x2d86f1[_0x8dfb('0x52')],{'$or':_['map'](_0x2d86f1[_0x8dfb('0x4e')],function(_0x1747c9){var _0x2b9a20={};_0x2b9a20[_0x1747c9]={'$like':'%'+_0x1cbf1d[_0x8dfb('0x49')]['filter']+'%'};return _0x2b9a20;})});}_0x2d86f1=_[_0x8dfb('0x54')]({},_0x2d86f1,_0x1cbf1d[_0x8dfb('0x5d')]);return db[_0x8dfb('0x6e')][_0x8dfb('0x20')]({'where':_0x2d86f1[_0x8dfb('0x52')]})[_0x8dfb('0x10')](function(_0xbe1d91){_0x162574[_0x8dfb('0x20')]=_0xbe1d91;if(_0x1cbf1d['query'][_0x8dfb('0x57')]){_0x2d86f1[_0x8dfb('0x58')]=[{'all':!![]}];}return db[_0x8dfb('0x6e')]['findAll'](_0x2d86f1);})[_0x8dfb('0x10')](function(_0x48a966){_0x162574[_0x8dfb('0x5a')]=_0x48a966;return _0x162574;});}})[_0x8dfb('0x10')](respondWithFilteredResult(_0x3357e0,_0x2d86f1))[_0x8dfb('0x19')](handleError(_0x3357e0,null));};exports[_0x8dfb('0x70')]=function(_0x36bf8a,_0x2b0d00){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x36bf8a[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x2b0d00,null))[_0x8dfb('0x10')](function(_0x13cf50){if(_0x13cf50){return _0x13cf50[_0x8dfb('0x70')](_0x36bf8a[_0x8dfb('0x49')]['ids']);}})[_0x8dfb('0x10')](respondWithStatusCode(_0x2b0d00,null))[_0x8dfb('0x19')](handleError(_0x2b0d00,null));};exports[_0x8dfb('0x67')]=function(_0x2153e0,_0x5402c6){var _0x30ad07={'name':_0x2153e0['body'][_0x8dfb('0x27')],'key':_0x2153e0[_0x8dfb('0x5f')]['key'],'provider':_0x2153e0['body'][_0x8dfb('0x61')]===_0x8dfb('0x60')?null:_0x2153e0['body']['provider'],'email':_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x71')],'ListId':_0x2153e0['body'][_0x8dfb('0x72')],'active':!_[_0x8dfb('0x73')](_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x74')])?_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x74')]:!![],'description':_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x75')]||null};var _0x4b59cf=getAuthenticationOptions(_0x30ad07[_0x8dfb('0x61')],_0x2153e0[_0x8dfb('0x5f')]);_0x30ad07[_0x8dfb('0x3c')]=_0x4b59cf[_0x8dfb('0x3c')];_0x30ad07[_0x8dfb('0x3d')]=_0x4b59cf[_0x8dfb('0x3d')];return db[_0x8dfb('0x43')]['create'](_0x30ad07,{'include':[{'model':db['MailServerOut'],'as':_0x8dfb('0x3d')},{'model':db[_0x8dfb('0x3e')],'as':_0x8dfb('0x3c')}]})[_0x8dfb('0x10')](function(_0x20437c){var _0x18be6e=_0x2153e0[_0x8dfb('0x31')]['get']({'plain':!![]});if(!_0x18be6e)throw new Error(_0x8dfb('0x76'));if(_0x18be6e[_0x8dfb('0x77')]===_0x8dfb('0x31')){var _0x30c259=_0x20437c['get']({'plain':!![]});return db[_0x8dfb('0x78')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x18be6e['userProfileId']},'raw':!![]})['then'](function(_0x2851bd){if(_0x2851bd&&_0x2851bd[_0x8dfb('0x79')]===0x0){return db[_0x8dfb('0x7a')][_0x8dfb('0x67')]({'name':_0x30c259[_0x8dfb('0x27')],'resourceId':_0x30c259['id'],'type':_0x2851bd[_0x8dfb('0x27')],'sectionId':_0x2851bd['id']},{})[_0x8dfb('0x10')](function(){return _0x20437c;});}else{return _0x20437c;}})[_0x8dfb('0x19')](function(_0x772872){logger[_0x8dfb('0x15')](_0x8dfb('0x7b'),_0x772872);throw _0x772872;});}return _0x20437c;})['then'](respondWithResult(_0x5402c6,0xc9))[_0x8dfb('0x19')](handleError(_0x5402c6,null));};exports[_0x8dfb('0x7c')]=function(_0x2cd51f,_0x390323){return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x2cd51f[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x390323,null))[_0x8dfb('0x10')](function(_0x5f9856){if(_0x5f9856){return _0x5f9856['getImap']();}return null;})[_0x8dfb('0x10')](respondWithResult(_0x390323,null))[_0x8dfb('0x19')](handleError(_0x390323,null));};exports[_0x8dfb('0x7d')]=function(_0x1b9e8d,_0x4bddd7){if(_0x1b9e8d['body']['id']){delete _0x1b9e8d[_0x8dfb('0x5f')]['id'];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x1b9e8d['params']['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x4bddd7,null))[_0x8dfb('0x10')](function(_0x1ba68b){if(_0x1ba68b){_0x1b9e8d[_0x8dfb('0x5f')][_0x8dfb('0x65')]=_0x1ba68b['id'];return db[_0x8dfb('0x3e')][_0x8dfb('0x67')](_0x1b9e8d[_0x8dfb('0x5f')]);}})['then'](respondWithResult(_0x4bddd7,null))[_0x8dfb('0x19')](handleError(_0x4bddd7,null));};exports[_0x8dfb('0x7e')]=function(_0x5b7be0,_0x1015e4){return db[_0x8dfb('0x43')]['findOne']({'where':{'id':_0x5b7be0[_0x8dfb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1015e4,null))[_0x8dfb('0x10')](function(_0x580788){if(_0x580788){return _0x580788['setImap'](null);}return null;})[_0x8dfb('0x10')](respondWithStatusCode(_0x1015e4,null))[_0x8dfb('0x19')](handleError(_0x1015e4,null));};exports[_0x8dfb('0x7f')]=function(_0x2a2c4b,_0x2a2d25){return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x2a2c4b[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x2a2d25,null))[_0x8dfb('0x10')](function(_0x25e96c){if(_0x25e96c){return _0x25e96c[_0x8dfb('0x7f')]();}return null;})[_0x8dfb('0x10')](respondWithResult(_0x2a2d25,null))[_0x8dfb('0x19')](handleError(_0x2a2d25,null));};exports[_0x8dfb('0x80')]=function(_0x406b58,_0x57a69c){if(_0x406b58[_0x8dfb('0x5f')]['id']){delete _0x406b58[_0x8dfb('0x5f')]['id'];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x406b58['params']['id']}})['then'](handleEntityNotFound(_0x57a69c,null))['then'](function(_0x145a16){if(_0x145a16){_0x406b58[_0x8dfb('0x5f')][_0x8dfb('0x65')]=_0x145a16['id'];return db[_0x8dfb('0x3f')]['create'](_0x406b58[_0x8dfb('0x5f')]);}})['then'](respondWithResult(_0x57a69c,null))[_0x8dfb('0x19')](handleError(_0x57a69c,null));};exports[_0x8dfb('0x81')]=function(_0xc5d8c8,_0xd838c6){return db[_0x8dfb('0x43')]['findOne']({'where':{'id':_0xc5d8c8[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0xd838c6,null))[_0x8dfb('0x10')](function(_0x20b8f0){if(_0x20b8f0){return _0x20b8f0[_0x8dfb('0x82')](null);}return null;})['then'](respondWithStatusCode(_0xd838c6,null))[_0x8dfb('0x19')](handleError(_0xd838c6,null));};exports[_0x8dfb('0x83')]=function(_0x29686b,_0x155536){return db[_0x8dfb('0x84')]['find']({'where':{'id':_0x29686b[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x155536,null))['then'](function(_0x5126c8){if(_0x5126c8){return _0x5126c8[_0x8dfb('0x83')](_0x29686b['body']['ids'],_[_0x8dfb('0x85')](_0x29686b[_0x8dfb('0x5f')],[_0x8dfb('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x155536,null))[_0x8dfb('0x19')](handleError(_0x155536,null));};exports[_0x8dfb('0x86')]=function(_0x1f6247,_0x50d0c3){var _0x9234bb={'raw':![],'where':{}};var _0x2822df={};var _0x5b85aa={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')]['findOne']({'where':{'id':_0x1f6247[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x50d0c3,null))['then'](function(_0x380f9f){if(_0x380f9f){_0x2822df[_0x8dfb('0x48')]=_['keys'](db[_0x8dfb('0x84')][_0x8dfb('0x44')]);_0x2822df[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x1f6247['query']);_0x2822df['filters']=_[_0x8dfb('0x4c')](_0x2822df[_0x8dfb('0x48')],_0x2822df['query']);_0x9234bb[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0x2822df[_0x8dfb('0x48')],qs['fields'](_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x9234bb[_0x8dfb('0x4e')]=_0x9234bb[_0x8dfb('0x4e')]['length']?_0x9234bb[_0x8dfb('0x4e')]:_0x2822df[_0x8dfb('0x48')];if(!_0x1f6247['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x9234bb['limit']=qs[_0x8dfb('0x1f')](_0x1f6247[_0x8dfb('0x49')]['limit']);_0x9234bb[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x1d')]);}_0x9234bb['order']=qs['sort'](_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x9234bb[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x1f6247[_0x8dfb('0x49')],_0x2822df[_0x8dfb('0x4b')]));_0x9234bb['where'][_0x8dfb('0x65')]=_0x380f9f['id'];if(_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0x9234bb[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0x9234bb[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0x9234bb[_0x8dfb('0x4e')],function(_0x4d6bce){var _0xdf7fa9={};_0xdf7fa9[_0x4d6bce]={'$like':'%'+_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0xdf7fa9;})});}_0x9234bb=_[_0x8dfb('0x54')]({},_0x9234bb,_0x1f6247[_0x8dfb('0x5d')]);return db['MailInteraction'][_0x8dfb('0x20')]({'where':_0x9234bb[_0x8dfb('0x52')]})[_0x8dfb('0x10')](function(_0x246c1d){_0x5b85aa[_0x8dfb('0x20')]=_0x246c1d;if(_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x57')]){_0x9234bb[_0x8dfb('0x58')]=[{'model':db[_0x8dfb('0x87')],'as':_0x8dfb('0x88'),'required':![]},{'model':db[_0x8dfb('0x89')],'as':_0x8dfb('0x8a'),'attributes':[_0x8dfb('0x27'),_0x8dfb('0x8b'),_0x8dfb('0x8c')],'required':![]},{'model':db[_0x8dfb('0x8d')],'as':_0x8dfb('0x8e'),'attributes':['id','name',_0x8dfb('0x8f')],'where':_0x1f6247['query'][_0x8dfb('0x90')]?{'id':_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x90')]}:undefined,'required':_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x90')]?!![]:![]}];}return db[_0x8dfb('0x84')]['findAll'](_0x9234bb);})[_0x8dfb('0x10')](function(_0x2eeb1d){_0x5b85aa['rows']=_0x2eeb1d;return _0x5b85aa;});}})['then'](respondWithFilteredResult(_0x50d0c3,_0x9234bb))['catch'](handleError(_0x50d0c3,null));};exports[_0x8dfb('0x91')]=function addApplications(_0x177e08,_0x5dfb7c){var _0x59e762=_0x177e08[_0x8dfb('0x5c')]['id'];var _0x2c5e89=_0x177e08[_0x8dfb('0x5f')];var _0x1e7e95=0xc8;var _0x4dac4e=null;return db[_0x8dfb('0x92')]['transaction']({'isolationLevel':db[_0x8dfb('0x92')]['Transaction'][_0x8dfb('0x93')][_0x8dfb('0x94')]},function(_0x52d254){return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x59e762},'transaction':_0x52d254})[_0x8dfb('0x10')](function(_0x41b9d8){if(_0x41b9d8){return db['MailApplication'][_0x8dfb('0x24')]({'where':{'MailAccountId':_0x59e762},'transaction':_0x52d254})[_0x8dfb('0x10')](function(){var _0x48e775=_['map'](_0x2c5e89,function(_0x59f5f6){_0x59f5f6[_0x8dfb('0x65')]=_0x59e762;return _0x59f5f6;});return db[_0x8dfb('0x95')][_0x8dfb('0x96')](_0x48e775,{'transaction':_0x52d254});});}else{_0x1e7e95=0x194;_0x4dac4e=[];}});})[_0x8dfb('0x10')](function(){if(_0x1e7e95!==0x194){return db[_0x8dfb('0x95')][_0x8dfb('0x97')]({'where':{'MailAccountId':_0x59e762},'order':_0x8dfb('0x98')})[_0x8dfb('0x10')](function(_0x5d5b98){_0x4dac4e=_0x5d5b98;});}})[_0x8dfb('0x19')](function(_0x482b90){_0x1e7e95=0x1f4;logger[_0x8dfb('0x15')](_0x482b90[_0x8dfb('0x26')]);if(_0x482b90['name']){delete _0x482b90['name'];}_0x4dac4e=_0x482b90;})[_0x8dfb('0x99')](function(){if(_0x4dac4e===null){_0x5dfb7c['sendStatus'](_0x1e7e95);}else{if(_0x1e7e95===0x1f4){_0x5dfb7c['status'](_0x1e7e95)[_0x8dfb('0x9a')](_0x4dac4e);}else{_0x5dfb7c[_0x8dfb('0x1b')](_0x1e7e95)[_0x8dfb('0x22')](_0x4dac4e);}}});};exports[_0x8dfb('0x9b')]=function(_0x11078d,_0x33ab2e){var _0xb511d6={};var _0x259c79={};var _0x5c95fd;var _0x1b4850;return db['MailAccount'][_0x8dfb('0x69')]({'where':{'id':_0x11078d[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x33ab2e,null))[_0x8dfb('0x10')](function(_0x59b293){if(_0x59b293){_0x5c95fd=_0x59b293;_0x259c79['model']=_[_0x8dfb('0x4a')](db[_0x8dfb('0x95')][_0x8dfb('0x44')]);_0x259c79['query']=_[_0x8dfb('0x4a')](_0x11078d[_0x8dfb('0x49')]);_0x259c79[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0x259c79[_0x8dfb('0x48')],_0x259c79[_0x8dfb('0x49')]);_0xb511d6[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0x259c79[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x11078d[_0x8dfb('0x49')]['fields']));_0xb511d6[_0x8dfb('0x4e')]=_0xb511d6[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0xb511d6['attributes']:_0x259c79[_0x8dfb('0x48')];_0xb511d6[_0x8dfb('0x51')]=qs[_0x8dfb('0x6b')](_0x11078d['query']['sort']);_0xb511d6[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x11078d[_0x8dfb('0x49')],_0x259c79['filters']));if(_0x11078d[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0xb511d6[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0xb511d6[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0xb511d6[_0x8dfb('0x4e')],function(_0x47d2d8){var _0x1af136={};_0x1af136[_0x47d2d8]={'$like':'%'+_0x11078d[_0x8dfb('0x49')]['filter']+'%'};return _0x1af136;})});}_0xb511d6=_[_0x8dfb('0x54')]({},_0xb511d6,_0x11078d['options']);return _0x5c95fd[_0x8dfb('0x9b')](_0xb511d6);}})[_0x8dfb('0x10')](function(_0x424846){if(_0x424846){_0x1b4850=_0x424846[_0x8dfb('0x4f')];if(!_0x11078d[_0x8dfb('0x49')][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0xb511d6[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x11078d['query'][_0x8dfb('0x1f')]);_0xb511d6[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x11078d['query'][_0x8dfb('0x1d')]);}return _0x5c95fd['getApplications'](_0xb511d6);}})[_0x8dfb('0x10')](function(_0x5938e1){if(_0x5938e1){return _0x5938e1?{'count':_0x1b4850,'rows':_0x5938e1}:null;}})['then'](respondWithResult(_0x33ab2e,null))[_0x8dfb('0x19')](handleError(_0x33ab2e,null));};exports[_0x8dfb('0x9c')]=function(_0x41e2b6,_0x3fa041){var _0xee7599={'raw':!![],'where':{}};var _0xc6e186={};var _0x3598f4={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x41e2b6[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x3fa041,null))[_0x8dfb('0x10')](function(_0xb3958f){if(_0xb3958f){_0xc6e186['model']=_[_0x8dfb('0x4a')](db[_0x8dfb('0x9d')]['rawAttributes']);_0xc6e186[_0x8dfb('0x49')]=_['keys'](_0x41e2b6[_0x8dfb('0x49')]);_0xc6e186[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0xc6e186[_0x8dfb('0x48')],_0xc6e186['query']);_0xee7599[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0xc6e186['model'],qs[_0x8dfb('0x4d')](_0x41e2b6['query'][_0x8dfb('0x4d')]));_0xee7599[_0x8dfb('0x4e')]=_0xee7599['attributes']['length']?_0xee7599[_0x8dfb('0x4e')]:_0xc6e186[_0x8dfb('0x48')];if(!_0x41e2b6['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0xee7599[_0x8dfb('0x1f')]=qs['limit'](_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x1f')]);_0xee7599[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x41e2b6['query'][_0x8dfb('0x1d')]);}_0xee7599[_0x8dfb('0x51')]=qs[_0x8dfb('0x6b')](_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0xee7599[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x41e2b6[_0x8dfb('0x49')],_0xc6e186['filters']));_0xee7599[_0x8dfb('0x52')][_0x8dfb('0x65')]=_0xb3958f['id'];if(_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0xee7599['where']=_[_0x8dfb('0x54')](_0xee7599[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0xee7599[_0x8dfb('0x4e')],function(_0x5b61e3){var _0x43a6e3={};_0x43a6e3[_0x5b61e3]={'$like':'%'+_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0x43a6e3;})});}if(_0x41e2b6['query']['$gte']){var _0x48288c=_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x9e')][_0x8dfb('0x9f')](',');var _0x57345f={};_0x57345f[_0x48288c[0x0]]={'$gte':moment(_0x48288c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xee7599[_0x8dfb('0x52')]=_['merge'](_0xee7599[_0x8dfb('0x52')],_0x57345f);}_0xee7599=_[_0x8dfb('0x54')]({},_0xee7599,_0x41e2b6['options']);return db['MailMessage']['count']({'where':_0xee7599[_0x8dfb('0x52')]})[_0x8dfb('0x10')](function(_0x2e48b8){_0x3598f4[_0x8dfb('0x20')]=_0x2e48b8;if(_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x57')]){_0xee7599[_0x8dfb('0x58')]=[{'all':!![]}];}return db[_0x8dfb('0x9d')][_0x8dfb('0x59')](_0xee7599);})[_0x8dfb('0x10')](function(_0x34653c){if(_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0xa0')]===_0x8dfb('0xa1')){for(var _0x3136b7=0x0;_0x3136b7<_0x34653c[_0x8dfb('0x4f')];_0x3136b7++){_0x34653c[_0x3136b7][_0x8dfb('0x5f')]=juice(_0x34653c[_0x3136b7][_0x8dfb('0x5f')]);}}_0x3598f4[_0x8dfb('0x5a')]=_0x34653c;return _0x3598f4;});}})['then'](respondWithFilteredResult(_0x3fa041,_0xee7599))[_0x8dfb('0x19')](handleError(_0x3fa041,null));};exports[_0x8dfb('0x9a')]=function(_0x3ee438,_0x3c3e43){var _0x3f1374,_0x401f77={},_0x3c4a07;if(_0x3ee438[_0x8dfb('0x5f')]['to']){_0x3c4a07=_0x3ee438[_0x8dfb('0x5f')]['to']['split'](',')[0x0];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x3ee438[_0x8dfb('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x8dfb('0xa2'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x3c4a07},'limit':0x1,'order':[[_0x8dfb('0xa3'),_0x8dfb('0xa4')]]}]},{'model':db[_0x8dfb('0x3f')],'as':_0x8dfb('0x3d'),'raw':!![],'include':[{'model':db[_0x8dfb('0xa5')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x3c3e43,null))['then'](function(_0x4842e6){if(!_0x4842e6)return;_0x3f1374=_0x4842e6;if(!_0x4842e6[_0x8dfb('0x3d')])throw new Error(_0x8dfb('0xa6'));if(_[_0x8dfb('0x73')](_0x3ee438['body'][_0x8dfb('0xa7')])){_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xa7')]=util['format'](_0x8dfb('0xa8'),_0x4842e6[_0x8dfb('0x27')],_0x4842e6[_0x8dfb('0x71')]||_0x4842e6[_0x8dfb('0x3d')][_0x8dfb('0x31')]);}if(_0x3ee438['body'][_0x8dfb('0xa9')]&&_0x3ee438['body'][_0x8dfb('0xa9')][_0x8dfb('0x4f')]){for(var _0x1c16e5=0x0;_0x1c16e5<_0x3ee438['body']['attachments']['length'];_0x1c16e5+=0x1){_0x3ee438['body'][_0x8dfb('0xa9')][_0x1c16e5]={'filename':_0x3ee438['body'][_0x8dfb('0xa9')][_0x1c16e5][_0x8dfb('0x27')],'path':path[_0x8dfb('0xaa')](config['root'],'server/files/attachments',_0x3ee438[_0x8dfb('0x5f')]['attachments'][_0x1c16e5][_0x8dfb('0xab')])};}}var _0x78d193=_0x4842e6[_0x8dfb('0xac')]();return respondWithRpcPromise(_0x8dfb('0xad'),_0x8dfb('0xae'),{'account':_0x78d193,'message':_0x3ee438[_0x8dfb('0x5f')]});})['then'](function(_0x503109){if(!_0x503109)return;_0x401f77=_0x503109;if(!_0x3f1374[_0x8dfb('0xa2')])throw new Error('List\x20not\x20found');if(_0x3f1374[_0x8dfb('0xa2')][_0x8dfb('0xaf')][_0x8dfb('0x4f')])return _0x3f1374[_0x8dfb('0xa2')][_0x8dfb('0xaf')][0x0];return db[_0x8dfb('0x87')][_0x8dfb('0x67')](_[_0x8dfb('0xa')](_0x3ee438[_0x8dfb('0x5f')],{'firstName':_0x3ee438[_0x8dfb('0x5f')]['to'],'email':_0x3ee438['body']['to'],'phone':_0x3ee438[_0x8dfb('0x5f')]['to'],'ListId':_0x3f1374[_0x8dfb('0x72')]}));})[_0x8dfb('0x10')](function(_0x21c8f4){if(!_0x21c8f4)return;var _0x1cea03={'UserId':_0x3ee438['user']['id'],'ContactId':_0x21c8f4['id'],'MailAccountId':_0x3f1374['id'],'inReplyTo':_0x401f77[_0x8dfb('0xb0')],'to':_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xa7')],'cc':_0x3ee438['body']['cc'],'subject':_0x3ee438[_0x8dfb('0x5f')]['subject'],'attach':_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xb1')],'firstMsgDirection':_0x8dfb('0xb2'),'lastMsgAt':moment()['format'](_0x8dfb('0xb3')),'lastMsgDirection':_0x8dfb('0xb2'),'Messages':[_['merge'](_0x3ee438[_0x8dfb('0x5f')],{'messageId':_0x401f77['messageId'],'sentAt':moment()[_0x8dfb('0xb4')](_0x8dfb('0xb3')),'read':!![],'MailAccountId':_0x3f1374['id'],'UserId':_0x3ee438[_0x8dfb('0x31')]['id'],'ContactId':_0x21c8f4['id']})]};if(_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xb5')]){_0x1cea03=_['merge'](_0x1cea03,_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xb5')]);}return db[_0x8dfb('0x84')][_0x8dfb('0x67')](_0x1cea03,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x8dfb('0x10')](respondWithResult(_0x3c3e43,null))[_0x8dfb('0x19')](handleError(_0x3c3e43,null));};exports[_0x8dfb('0xb6')]=function(_0x100288,_0xcebc5b){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x100288[_0x8dfb('0x5c')]['id']},'include':[{'model':db[_0x8dfb('0x3f')],'as':_0x8dfb('0x3d'),'raw':!![],'include':[{'model':db[_0x8dfb('0xa5')],'as':_0x8dfb('0xa5'),'raw':!![]}]}]})[_0x8dfb('0x10')](handleEntityNotFound(_0xcebc5b,null))[_0x8dfb('0x10')](function(_0x35c514){if(!_0x35c514[_0x8dfb('0x3d')])return;var _0x95de3d=_0x35c514[_0x8dfb('0xac')]();return respondWithRpcPromise(_0x8dfb('0xb7'),_0x8dfb('0xb6'),{'account':_0x95de3d});})[_0x8dfb('0x10')](respondWithResult(_0xcebc5b,null))['catch'](handleError(_0xcebc5b,null));};exports[_0x8dfb('0x24')]=function(_0x59d2cc,_0x2cd850){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x59d2cc[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x2cd850,null))[_0x8dfb('0x10')](function(_0x141ff4){if(_0x141ff4&&_0x141ff4['service']){throw new db[(_0x8dfb('0xb8'))][(_0x8dfb('0xb9'))](_0x8dfb('0xba'));}return _0x141ff4;})[_0x8dfb('0x10')](removeEntity(_0x2cd850,null))[_0x8dfb('0x19')](handleError(_0x2cd850,null));};exports[_0x8dfb('0xbb')]=function(_0x470d8b,_0x253f3b){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x470d8b['params']['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x253f3b,null))['then'](function(_0x27e06b){if(_0x27e06b){return _0x27e06b[_0x8dfb('0xbb')](_0x470d8b[_0x8dfb('0x5f')][_0x8dfb('0x6d')],_[_0x8dfb('0x85')](_0x470d8b[_0x8dfb('0x5f')],['ids','id'])||{})[_0x8dfb('0xbc')](function(_0x2d6637){for(var _0x17f70f=0x0;_0x17f70f<_0x470d8b[_0x8dfb('0x5f')]['ids'][_0x8dfb('0x4f')];_0x17f70f+=0x1){socket[_0x8dfb('0xbd')](_0x8dfb('0xbe'),{'UserId':Number(_0x470d8b[_0x8dfb('0x5f')][_0x8dfb('0x6d')][_0x17f70f]),'MailAccountId':Number(_0x470d8b[_0x8dfb('0x5c')]['id'])});}return _0x2d6637;});}})[_0x8dfb('0x10')](respondWithResult(_0x253f3b,null))['catch'](handleError(_0x253f3b,null));};exports[_0x8dfb('0xbf')]=function(_0x5566dc,_0x596977){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x5566dc[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x596977,null))[_0x8dfb('0x10')](function(_0x9029ef){if(_0x9029ef){return _0x9029ef[_0x8dfb('0xbf')](_0x5566dc['query']['ids'])[_0x8dfb('0x10')](function(){if(_['isArray'](_0x5566dc[_0x8dfb('0x49')][_0x8dfb('0x6d')])){for(var _0x35e8f9=0x0;_0x35e8f9<_0x5566dc[_0x8dfb('0x49')][_0x8dfb('0x6d')][_0x8dfb('0x4f')];_0x35e8f9+=0x1){socket[_0x8dfb('0xbd')](_0x8dfb('0xc0'),{'UserId':Number(_0x5566dc['query'][_0x8dfb('0x6d')][_0x35e8f9]),'MailAccountId':Number(_0x5566dc[_0x8dfb('0x5c')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x5566dc[_0x8dfb('0x49')][_0x8dfb('0x6d')]),'MailAccountId':Number(_0x5566dc[_0x8dfb('0x5c')]['id'])});}});}})[_0x8dfb('0x10')](respondWithStatusCode(_0x596977,null))[_0x8dfb('0x19')](handleError(_0x596977,null));};exports['getAgents']=function(_0x5ce263,_0x1d7c16){var _0x8a7f03={};var _0x2c64e0={};var _0x3f7b14;var _0x5bbf1b;return db['MailAccount'][_0x8dfb('0x69')]({'where':{'id':_0x5ce263['params']['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x1d7c16,null))[_0x8dfb('0x10')](function(_0x2da4dc){if(_0x2da4dc){_0x3f7b14=_0x2da4dc;_0x2c64e0[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db['User']['rawAttributes']);_0x2c64e0[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x5ce263['query']);_0x2c64e0['filters']=_[_0x8dfb('0x4c')](_0x2c64e0[_0x8dfb('0x48')],_0x2c64e0['query']);_0x8a7f03['attributes']=_['intersection'](_0x2c64e0[_0x8dfb('0x48')],qs['fields'](_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x8a7f03[_0x8dfb('0x4e')]=_0x8a7f03[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x8a7f03[_0x8dfb('0x4e')]:_0x2c64e0[_0x8dfb('0x48')];_0x8a7f03[_0x8dfb('0x51')]=qs['sort'](_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x8a7f03[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x5ce263[_0x8dfb('0x49')],_0x2c64e0[_0x8dfb('0x4b')]));if(_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0x8a7f03['where']=_[_0x8dfb('0x54')](_0x8a7f03[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0x8a7f03['attributes'],function(_0x15c7ea){var _0xa675bd={};_0xa675bd[_0x15c7ea]={'$like':'%'+_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0xa675bd;})});}_0x8a7f03=_[_0x8dfb('0x54')]({},_0x8a7f03,_0x5ce263['options']);return _0x3f7b14['getAgents'](_0x8a7f03);}})[_0x8dfb('0x10')](function(_0x3dce3a){if(_0x3dce3a){_0x5bbf1b=_0x3dce3a[_0x8dfb('0x4f')];if(!_0x5ce263['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x8a7f03[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x5ce263[_0x8dfb('0x49')]['limit']);_0x8a7f03[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x1d')]);}return _0x3f7b14[_0x8dfb('0xc1')](_0x8a7f03);}})[_0x8dfb('0x10')](function(_0x10ccac){if(_0x10ccac){return _0x10ccac?{'count':_0x5bbf1b,'rows':_0x10ccac}:null;}})[_0x8dfb('0x10')](respondWithResult(_0x1d7c16,null))['catch'](handleError(_0x1d7c16,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 3345b2d..b19d7a5 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 _0xca6e=['../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x443e74,_0x556a4f){var _0x27c871=function(_0x473f61){while(--_0x473f61){_0x443e74['push'](_0x443e74['shift']());}};_0x27c871(++_0x556a4f);}(_0xca6e,0x1c1));var _0xeca6=function(_0x4aa1df,_0x5842ce){_0x4aa1df=_0x4aa1df-0x0;var _0x16a4f7=_0xca6e[_0x4aa1df];return _0x16a4f7;};'use strict';var EventEmitter=require(_0xeca6('0x0'));var MailAccount=require(_0xeca6('0x1'))['db'][_0xeca6('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xeca6('0x3')](0x0);var events={'afterCreate':_0xeca6('0x4'),'afterUpdate':'update','afterDestroy':_0xeca6('0x5')};function emitEvent(_0x80d642){return function(_0x497ff9,_0x329118,_0x5bbefc){MailAccountEvents[_0xeca6('0x6')](_0x80d642+':'+_0x497ff9['id'],_0x497ff9);MailAccountEvents[_0xeca6('0x6')](_0x80d642,_0x497ff9);_0x5bbefc(null);};}for(var e in events){if(events[_0xeca6('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xeca6('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x3989=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3989,0x12f));var _0x9398=function(_0x98cd88,_0x348051){_0x98cd88=_0x98cd88-0x0;var _0x33b9e0=_0x3989[_0x98cd88];return _0x33b9e0;};'use strict';var EventEmitter=require(_0x9398('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x9398('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9398('0x2')](0x0);var events={'afterCreate':_0x9398('0x3'),'afterUpdate':_0x9398('0x4'),'afterDestroy':_0x9398('0x5')};function emitEvent(_0x117eaf){return function(_0x4759ec,_0x2f9145,_0x2774cb){MailAccountEvents[_0x9398('0x6')](_0x117eaf+':'+_0x4759ec['id'],_0x4759ec);MailAccountEvents[_0x9398('0x6')](_0x117eaf,_0x4759ec);_0x2774cb(null);};}for(var e in events){if(events[_0x9398('0x7')](e)){var event=events[e];MailAccount['hook'](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 3f5bb1e..155b741 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 _0xff26=['Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','auth','user','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff26,0x77));var _0x6ff2=function(_0x17aa78,_0x1ca1ef){_0x17aa78=_0x17aa78-0x0;var _0x4e0514=_0xff26[_0x17aa78];return _0x4e0514;};'use strict';var attributes=require(_0x6ff2('0x0'));module[_0x6ff2('0x1')]=function(_0x5b054f){return _0x5b054f[_0x6ff2('0x2')](_0x6ff2('0x3'),attributes,{'tableName':_0x6ff2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3403a8=this;var _0x251862={'id':_0x3403a8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3403a8[_0x6ff2('0x5')]!==_0x6ff2('0x6')){_0x251862[_0x6ff2('0x7')]=_0x3403a8[_0x6ff2('0x5')];}else{_0x251862[_0x6ff2('0x8')]=_0x3403a8[_0x6ff2('0x9')]['host'];_0x251862['port']=_0x3403a8['Smtp'][_0x6ff2('0xa')];_0x251862[_0x6ff2('0xb')]=_0x3403a8['Smtp'][_0x6ff2('0xb')];}if(_0x3403a8[_0x6ff2('0x9')][_0x6ff2('0xc')]){if(_0x3403a8['Smtp']['modernAuthentication']){if(!_0x3403a8[_0x6ff2('0x9')][_0x6ff2('0xd')])throw new Error(_0x6ff2('0xe'));_0x251862['auth']={'type':_0x6ff2('0xf'),'user':_0x3403a8['Smtp']['user'],'accessToken':_0x3403a8[_0x6ff2('0x9')][_0x6ff2('0xd')][_0x6ff2('0x10')]};}else{_0x251862[_0x6ff2('0x11')]={'user':_0x3403a8['Smtp'][_0x6ff2('0x12')],'pass':_0x3403a8[_0x6ff2('0x9')]['pass']};}}return _0x251862;}}});}; \ No newline at end of file +var _0x58bf=['mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','modernAuthentication','OAuth2','user','CloudProvider','auth','pass','./mailAccount.attributes','exports','define'];(function(_0x263904,_0x52bb61){var _0x33bef8=function(_0x5850ef){while(--_0x5850ef){_0x263904['push'](_0x263904['shift']());}};_0x33bef8(++_0x52bb61);}(_0x58bf,0xc3));var _0xf58b=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0x58bf[_0x165c96];return _0x5c2420;};'use strict';var attributes=require(_0xf58b('0x0'));module[_0xf58b('0x1')]=function(_0x4ee0a4){return _0x4ee0a4[_0xf58b('0x2')]('MailAccount',attributes,{'tableName':_0xf58b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xe3848b=this;var _0x242471={'id':_0xe3848b['id'],'tls':{'rejectUnauthorized':![]}};if(_0xe3848b[_0xf58b('0x4')]!==_0xf58b('0x5')){_0x242471[_0xf58b('0x6')]=_0xe3848b[_0xf58b('0x4')];}else{_0x242471['host']=_0xe3848b['Smtp'][_0xf58b('0x7')];_0x242471[_0xf58b('0x8')]=_0xe3848b[_0xf58b('0x9')][_0xf58b('0x8')];_0x242471[_0xf58b('0xa')]=_0xe3848b['Smtp']['secure'];}if(_0xe3848b[_0xf58b('0x9')][_0xf58b('0xb')]){if(_0xe3848b[_0xf58b('0x9')][_0xf58b('0xc')]){if(!_0xe3848b[_0xf58b('0x9')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x242471['auth']={'type':_0xf58b('0xd'),'user':_0xe3848b[_0xf58b('0x9')][_0xf58b('0xe')],'accessToken':_0xe3848b['Smtp'][_0xf58b('0xf')]['data5']};}else{_0x242471[_0xf58b('0x10')]={'user':_0xe3848b[_0xf58b('0x9')][_0xf58b('0xe')],'pass':_0xe3848b[_0xf58b('0x9')][_0xf58b('0x11')]};}}return _0x242471;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 7d7f2a7..49bee34 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 _0xba34=['MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','getSmtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailAccount','MailAccount','find','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC'];(function(_0x22eb5d,_0x2e519d){var _0x4a39ad=function(_0x4a1206){while(--_0x4a1206){_0x22eb5d['push'](_0x22eb5d['shift']());}};_0x4a39ad(++_0x2e519d);}(_0xba34,0x119));var _0x4ba3=function(_0x54c213,_0x8895f8){_0x54c213=_0x54c213-0x0;var _0x42cac3=_0xba34[_0x54c213];return _0x42cac3;};'use strict';var _=require(_0x4ba3('0x0'));var moment=require(_0x4ba3('0x1'));var BPromise=require(_0x4ba3('0x2'));var rs=require(_0x4ba3('0x3'));var Redis=require(_0x4ba3('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x4ba3('0x5'));var jayson=require(_0x4ba3('0x6'));var client=jayson[_0x4ba3('0x7')][_0x4ba3('0x8')]({'port':0x232c});config[_0x4ba3('0x9')]=_[_0x4ba3('0xa')](config[_0x4ba3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ba3('0xb'))(new Redis(config[_0x4ba3('0x9')]));require(_0x4ba3('0xc'))[_0x4ba3('0xd')](socket);function respondWithRpcPromise(_0x380d60,_0xcf1ec3,_0x292f58){return new BPromise(function(_0x3f653c,_0x2ed106){return client[_0x4ba3('0xe')](_0x380d60,_0x292f58)[_0x4ba3('0xf')](function(_0x51edab){logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0xcf1ec3,'request\x20sent');logger[_0x4ba3('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'),JSON['stringify'](_0x51edab));if(_0x51edab[_0x4ba3('0x14')]){if(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x15')]===0x1f4){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x2ed106(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x3f653c(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}else{logger[_0x4ba3('0x10')]('MailAccount,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'));_0x3f653c(_0x51edab[_0x4ba3('0x17')][_0x4ba3('0x16')]);}})[_0x4ba3('0x18')](function(_0x556290){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x556290);_0x2ed106(_0x556290);});});}exports[_0x4ba3('0x19')]=function(_0x1e2ce5){var _0x184332=this;return new Promise(function(_0x125944,_0x4b2791){return db['MailAccount'][_0x4ba3('0x1a')]({'raw':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1e')]||null:null,'limit':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1f')]||null:null,'include':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0xe29a49){return{'model':db[_0xe29a49[_0x4ba3('0x22')]],'as':_0xe29a49['as'],'attributes':_0xe29a49[_0x4ba3('0x1e')],'include':_0xe29a49[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xe29a49['include'],function(_0x252f37){return{'model':db[_0x252f37[_0x4ba3('0x22')]],'as':_0x252f37['as'],'attributes':_0x252f37[_0x4ba3('0x1e')],'include':_0x252f37['include']?_[_0x4ba3('0x21')](_0x252f37[_0x4ba3('0x20')],function(_0x44d78c){return{'model':db[_0x44d78c['model']],'as':_0x44d78c['as'],'attributes':_0x44d78c[_0x4ba3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x34ecb4){logger[_0x4ba3('0x10')]('GetMailAccount',_0x1e2ce5);logger['debug'](_0x4ba3('0x19'),_0x1e2ce5,JSON[_0x4ba3('0x23')](_0x34ecb4));_0x125944(_0x34ecb4);})[_0x4ba3('0x18')](function(_0x19f039){logger[_0x4ba3('0x14')](_0x4ba3('0x19'),_0x19f039['message'],_0x1e2ce5);_0x4b2791(_0x184332[_0x4ba3('0x14')](0x1f4,_0x19f039[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x24')]=function(_0xbf95b3){var _0x2a6757=this;return new Promise(function(_0x1a7a2c,_0x457236){return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'raw':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf95b3['options']?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1e')]||null:null,'include':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0x3439cb){return{'model':db[_0x3439cb['model']],'as':_0x3439cb['as'],'attributes':_0x3439cb[_0x4ba3('0x1e')],'include':_0x3439cb[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x3439cb['include'],function(_0x188f8c){return{'model':db[_0x188f8c['model']],'as':_0x188f8c['as'],'attributes':_0x188f8c[_0x4ba3('0x1e')],'include':_0x188f8c[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x188f8c[_0x4ba3('0x20')],function(_0xf892e1){return{'model':db[_0xf892e1[_0x4ba3('0x22')]],'as':_0xf892e1['as'],'attributes':_0xf892e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x3cf56c){if(_0xbf95b3[_0x4ba3('0x1b')]['smtp']===!![])_0x3cf56c[_0x4ba3('0x27')](_0x4ba3('0x28'),_0x3cf56c['getSmtpOptions']());logger[_0x4ba3('0x10')]('ShowMailAccount',_0xbf95b3);logger['debug'](_0x4ba3('0x24'),_0xbf95b3,JSON[_0x4ba3('0x23')](_0x3cf56c));_0x1a7a2c(_0x3cf56c);})[_0x4ba3('0x18')](function(_0x2b14e1){logger[_0x4ba3('0x14')]('ShowMailAccount',_0x2b14e1[_0x4ba3('0x16')],_0xbf95b3);_0x457236(_0x2a6757[_0x4ba3('0x14')](0x1f4,_0x2b14e1[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x29')]=function(_0xab7983){var _0x2acc92=this;return new Promise(function(_0x349af4,_0x2577be){var _0x553475={'body':_0xab7983[_0x4ba3('0x2a')],'channel':_0x4ba3('0x2b')};var _0x3cb07f=_[_0x4ba3('0x2c')](_[_0x4ba3('0x2d')](db[_0x4ba3('0x2e')][_0x4ba3('0x2f')]),[_0x4ba3('0x30'),_0x4ba3('0x31'),_0x4ba3('0x32'),_0x4ba3('0x33')]);var _0x1c58d2=![];if(_0xab7983[_0x4ba3('0x2a')]['id']){delete _0xab7983[_0x4ba3('0x2a')]['id'];}if(_['isNil'](_0xab7983['body']['from'])){return _0x2577be(_0x2acc92['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x4ba3('0x34')](_0xab7983['body'][_0x4ba3('0x2a')])||_0xab7983['body'][_0x4ba3('0x2a')]===''){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x35')));}if(_[_0x4ba3('0x34')](_0xab7983[_0x4ba3('0x2a')]['mapKey'])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cb07f));}if(!_[_0x4ba3('0x36')](_0x3cb07f,_0xab7983['body'][_0x4ba3('0x37')])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x38')+_0x3cb07f));}var _0x261a5e={};_0x261a5e[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')]['from'];return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'where':{'id':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x3a')],'as':_0x4ba3('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x261a5e,'limit':0x1,'order':[[_0x4ba3('0x31'),_0x4ba3('0x3c')]]}]},{'model':db[_0x4ba3('0x3d')],'as':'Applications'},{'model':db[_0x4ba3('0x3e')],'as':_0x4ba3('0x3f'),'include':[{'model':db[_0x4ba3('0x40')],'as':'CloudProvider'}]}]})['then'](function(_0x34dc04){if(_0x34dc04&&_0x34dc04['List']){var _0x439acf=_0x34dc04[_0x4ba3('0x41')]({'plain':!![]});_0x553475[_0x4ba3('0x39')]=_[_0x4ba3('0x42')](_0x439acf,[_0x4ba3('0x43'),_0x4ba3('0x3b')]);_0x553475['account'][_0x4ba3('0x28')]=_0x34dc04[_0x4ba3('0x44')]();_0x553475['applications']=_0x439acf[_0x4ba3('0x43')];_0x553475[_0x4ba3('0x45')]=_0x439acf[_0x4ba3('0x3b')];_0x553475[_0x4ba3('0x46')]=_[_0x4ba3('0x47')](_0x553475['applications'],[_0x4ba3('0x48')],[_0x4ba3('0x49')]);if(_0x553475['account']&&_0x553475[_0x4ba3('0x39')][_0x4ba3('0x4a')]){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4b')]({'id':0x0,'priority':_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4c')]+0x1,'app':_0x4ba3('0x4d'),'appdata':_0x4ba3('0x4a'),'interval':_0x4ba3('0x4e')});}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')]){delete _0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')];}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x3b')]){delete _0x553475['account']['List'];}if(_0x439acf['List'][_0x4ba3('0x4f')][_0x4ba3('0x4c')]){return _0x439acf[_0x4ba3('0x3b')][_0x4ba3('0x4f')][0x0];}var _0x40af1d=_['defaults'](_0xab7983[_0x4ba3('0x2a')],{'firstName':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')],'ListId':_0x439acf[_0x4ba3('0x33')]});_0x40af1d[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')];return db[_0x4ba3('0x2e')][_0x4ba3('0x51')](_0x40af1d);}else{throw new Error(_0x4ba3('0x52'));}})[_0x4ba3('0xf')](function(_0x317b9f){_0x553475[_0x4ba3('0x53')]=_0x317b9f;if(_0x317b9f){if(!_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x54')]){_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x54')]=rs[_0x4ba3('0x55')]()+'\x20'+_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['from'];}var _0x8ea419={'ContactId':_0x317b9f['id'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'inReplyTo':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'to':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'lastMsgAt':moment()[_0x4ba3('0x58')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x4ba3('0x59')][_0x4ba3('0x26')]({'where':{'closed':![],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x5a')],'as':_0x4ba3('0x5b'),'attributes':[_0x4ba3('0x54')],'where':{'messageId':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x5c')]}}]})[_0x4ba3('0xf')](function(_0x1afc5e){if(_0x1afc5e){return[_0x1afc5e,![]];}return db['MailInteraction'][_0x4ba3('0x51')](_0x8ea419)[_0x4ba3('0xf')](function(_0x55c03c){return[_0x55c03c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4ba3('0x5d')](function(_0x296bf6,_0x5c7c2f){if(_0x296bf6){_0x1c58d2=_0x5c7c2f;if(!_0x5c7c2f){return _0x296bf6[_0x4ba3('0x5e')]({'inReplyTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['messageId'],'to':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0x296bf6[_0x4ba3('0x57')]?_0x296bf6[_0x4ba3('0x57')]:_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x57')],'substatus':null,'substatusAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgDirection':'in'});}else{return _0x296bf6;}}})[_0x4ba3('0xf')](function(_0x424477){_0x553475['interaction']=_0x424477['get']({'plain':!![]});_0x553475[_0x4ba3('0x60')]['created']=_0x1c58d2;return db[_0x4ba3('0x5a')][_0x4ba3('0x51')]({'body':_0xab7983[_0x4ba3('0x2a')]['body'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'MailInteractionId':_0x424477['id'],'direction':'in','ContactId':_0x553475[_0x4ba3('0x53')]['id'],'messageId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'from':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'to':_0xab7983['body'][_0x4ba3('0x16')]['to'],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'Attachments':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x61')],'originTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x62')],'originCc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x63')],'bcc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x64')],'ChatWebsiteId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x65')]||null,'originChannel':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x66')]||_0x4ba3('0x67'),'ChatOfflineMessageId':_0xab7983['body']['message'][_0x4ba3('0x68')]||null},{'include':[{'model':db[_0x4ba3('0x69')],'as':_0x4ba3('0x6a')}]});})[_0x4ba3('0xf')](function(_0x37b966){_0x553475[_0x4ba3('0x16')]=_0x37b966;if(_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]){return db['User'][_0x4ba3('0x26')]({'attributes':['id','name'],'where':{'id':_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]}})[_0x4ba3('0xf')](function(_0x3c3638){if(_0x3c3638){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x6c')]({'id':0x0,'priority':0x0,'app':_0x4ba3('0x6d'),'appdata':_0x3c3638[_0x4ba3('0x6e')]+','+(_0x553475['account'][_0x4ba3('0x6f')]||0xa),'interval':_0x4ba3('0x4e')});}return respondWithRpcPromise(_0x4ba3('0x70'),'startRouting',_0x553475);});}return respondWithRpcPromise(_0x4ba3('0x70'),_0x4ba3('0x71'),_0x553475);})[_0x4ba3('0xf')](function(_0x39d428){_0x349af4(_0x39d428);})[_0x4ba3('0x18')](function(_0x2569bc){_0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x2569bc['message']));});});}; \ No newline at end of file +var _0xc6ac=['update','interaction','created','contact','attachments','originTo','bcc','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','list','orderBy','priority','asc','autoclose','length','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0x207b87,_0x3266e5){var _0xbc46ff=function(_0x8a4c5f){while(--_0x8a4c5f){_0x207b87['push'](_0x207b87['shift']());}};_0xbc46ff(++_0x3266e5);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x11d508,_0x8beb18){_0x11d508=_0x11d508-0x0;var _0x4088f5=_0xc6ac[_0x11d508];return _0x4088f5;};'use strict';var _=require(_0xcc6a('0x0'));var moment=require(_0xcc6a('0x1'));var BPromise=require(_0xcc6a('0x2'));var rs=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var db=require(_0xcc6a('0x5'))['db'];var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var jayson=require(_0xcc6a('0x9'));var client=jayson[_0xcc6a('0xa')][_0xcc6a('0xb')]({'port':0x232c});config[_0xcc6a('0xc')]=_[_0xcc6a('0xd')](config['redis'],{'host':_0xcc6a('0xe'),'port':0x18eb});var socket=require(_0xcc6a('0xf'))(new Redis(config[_0xcc6a('0xc')]));require('./mailAccount.socket')[_0xcc6a('0x10')](socket);function respondWithRpcPromise(_0x210f63,_0x7806a0,_0x463ebb){return new BPromise(function(_0x3eb04a,_0x5e91a2){return client[_0xcc6a('0x11')](_0x210f63,_0x463ebb)[_0xcc6a('0x12')](function(_0x109693){logger['info'](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));logger[_0xcc6a('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x7806a0,'request\x20sent',JSON[_0xcc6a('0x16')](_0x109693));if(_0x109693[_0xcc6a('0x17')]){if(_0x109693[_0xcc6a('0x17')]['code']===0x1f4){logger['error'](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);return _0x5e91a2(_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);}logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')]['message']);return _0x3eb04a(_0x109693['error']['message']);}else{logger[_0xcc6a('0x19')](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));_0x3eb04a(_0x109693[_0xcc6a('0x1a')][_0xcc6a('0x18')]);}})[_0xcc6a('0x1b')](function(_0x2d9585){logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x2d9585);_0x5e91a2(_0x2d9585);});});}exports[_0xcc6a('0x1c')]=function(_0x1d20a3){var _0x5b657e=this;return new Promise(function(_0xfec60f,_0x3e1fda){return db[_0xcc6a('0x1d')][_0xcc6a('0x1e')]({'raw':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')]['attributes']||null:null,'limit':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x22')]||null:null,'include':_0x1d20a3['options']?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x5fc697){return{'model':db[_0x5fc697['model']],'as':_0x5fc697['as'],'attributes':_0x5fc697[_0xcc6a('0x25')],'include':_0x5fc697[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x5fc697['include'],function(_0x3afb3a){return{'model':db[_0x3afb3a[_0xcc6a('0x26')]],'as':_0x3afb3a['as'],'attributes':_0x3afb3a['attributes'],'include':_0x3afb3a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x3afb3a[_0xcc6a('0x23')],function(_0x473f88){return{'model':db[_0x473f88['model']],'as':_0x473f88['as'],'attributes':_0x473f88[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x2c6d88){logger['info'](_0xcc6a('0x1c'),_0x1d20a3);logger['debug']('GetMailAccount',_0x1d20a3,JSON[_0xcc6a('0x16')](_0x2c6d88));_0xfec60f(_0x2c6d88);})[_0xcc6a('0x1b')](function(_0x3aa315){logger[_0xcc6a('0x17')](_0xcc6a('0x1c'),_0x3aa315[_0xcc6a('0x18')],_0x1d20a3);_0x3e1fda(_0x5b657e['error'](0x1f4,_0x3aa315[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x27')]=function(_0x147aff){var _0x2faeb5=this;return new Promise(function(_0x211a8c,_0x152ebd){return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'raw':_0x147aff['options']?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')]['attributes']||null:null,'include':_0x147aff[_0xcc6a('0x1f')]?_0x147aff['options']['include']?_['map'](_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x1101ec){return{'model':db[_0x1101ec[_0xcc6a('0x26')]],'as':_0x1101ec['as'],'attributes':_0x1101ec[_0xcc6a('0x25')],'include':_0x1101ec['include']?_['map'](_0x1101ec[_0xcc6a('0x23')],function(_0x11173a){return{'model':db[_0x11173a[_0xcc6a('0x26')]],'as':_0x11173a['as'],'attributes':_0x11173a['attributes'],'include':_0x11173a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x11173a[_0xcc6a('0x23')],function(_0xa326b2){return{'model':db[_0xa326b2[_0xcc6a('0x26')]],'as':_0xa326b2['as'],'attributes':_0xa326b2[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x18a252){if(_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x29')]===!![])_0x18a252[_0xcc6a('0x2a')](_0xcc6a('0x2b'),_0x18a252[_0xcc6a('0x2c')]());logger[_0xcc6a('0x19')](_0xcc6a('0x27'),_0x147aff);logger[_0xcc6a('0x15')](_0xcc6a('0x27'),_0x147aff,JSON[_0xcc6a('0x16')](_0x18a252));_0x211a8c(_0x18a252);})['catch'](function(_0x553e66){logger[_0xcc6a('0x17')](_0xcc6a('0x27'),_0x553e66[_0xcc6a('0x18')],_0x147aff);_0x152ebd(_0x2faeb5[_0xcc6a('0x17')](0x1f4,_0x553e66[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x2d')]=function(_0x3273bc){var _0x1199f1=this;return new Promise(function(_0x49b65c,_0x56bc7d){var _0x470e3b={'body':_0x3273bc['body'],'channel':'mail'};var _0x5cf1ba=_[_0xcc6a('0x2e')](_[_0xcc6a('0x2f')](db[_0xcc6a('0x30')][_0xcc6a('0x31')]),[_0xcc6a('0x32'),'updatedAt',_0xcc6a('0x33'),_0xcc6a('0x34')]);var _0x17e5a0=![];if(_0x3273bc[_0xcc6a('0x35')]['id']){delete _0x3273bc[_0xcc6a('0x35')]['id'];}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x37')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x38')));}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x35')])||_0x3273bc['body'][_0xcc6a('0x35')]===''){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x39')));}if(_['isNil'](_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cf1ba));}if(!_['includes'](_0x5cf1ba,_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x3b')+_0x5cf1ba));}var _0x345e94={};_0x345e94[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')]['from'];return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'where':{'id':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x3d')],'as':_0xcc6a('0x3e'),'include':[{'model':db[_0xcc6a('0x30')],'as':'Contacts','where':_0x345e94,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcc6a('0x3f')],'as':_0xcc6a('0x40')},{'model':db[_0xcc6a('0x41')],'as':_0xcc6a('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xcc6a('0x43')}]}]})['then'](function(_0x3aa7dd){if(_0x3aa7dd&&_0x3aa7dd[_0xcc6a('0x3e')]){var _0xcfc540=_0x3aa7dd[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x3c')]=_[_0xcc6a('0x45')](_0xcfc540,['Applications',_0xcc6a('0x3e')]);_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x2b')]=_0x3aa7dd[_0xcc6a('0x2c')]();_0x470e3b[_0xcc6a('0x46')]=_0xcfc540[_0xcc6a('0x40')];_0x470e3b[_0xcc6a('0x47')]=_0xcfc540[_0xcc6a('0x3e')];_0x470e3b[_0xcc6a('0x46')]=_[_0xcc6a('0x48')](_0x470e3b['applications'],[_0xcc6a('0x49')],[_0xcc6a('0x4a')]);if(_0x470e3b[_0xcc6a('0x3c')]&&_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x4b')]){_0x470e3b[_0xcc6a('0x46')]['push']({'id':0x0,'priority':_0x470e3b['applications'][_0xcc6a('0x4c')]+0x1,'app':'close','appdata':_0xcc6a('0x4b'),'interval':_0xcc6a('0x4d')});}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')];}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')];}if(_0xcfc540[_0xcc6a('0x3e')]['Contacts'][_0xcc6a('0x4c')]){return _0xcfc540['List'][_0xcc6a('0x4e')][0x0];}var _0x1570fe=_[_0xcc6a('0xd')](_0x3273bc['body'],{'firstName':_0x3273bc[_0xcc6a('0x35')]['from'],'ListId':_0xcfc540[_0xcc6a('0x34')]});_0x1570fe[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x37')];return db[_0xcc6a('0x30')][_0xcc6a('0x4f')](_0x1570fe);}else{throw new Error(_0xcc6a('0x50'));}})[_0xcc6a('0x12')](function(_0x11459f){_0x470e3b['contact']=_0x11459f;if(_0x11459f){if(!_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x51')]){_0x3273bc['body'][_0xcc6a('0x18')][_0xcc6a('0x51')]=rs[_0xcc6a('0x52')]()+'\x20'+_0x3273bc['body'][_0xcc6a('0x18')]['from'];}var _0x5e53e4={'ContactId':_0x11459f['id'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x54')],'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'};return db[_0xcc6a('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x58')],'as':_0xcc6a('0x59'),'attributes':[_0xcc6a('0x51')],'where':{'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x5a')]}}]})[_0xcc6a('0x12')](function(_0x2686c8){if(_0x2686c8){return[_0x2686c8,![]];}return db[_0xcc6a('0x57')]['create'](_0x5e53e4)['then'](function(_0x4fe041){return[_0x4fe041,!![]];});});}else{throw new Error(_0xcc6a('0x5b'));}})[_0xcc6a('0x5c')](function(_0x9c444,_0x4a9f34){if(_0x9c444){_0x17e5a0=_0x4a9f34;if(!_0x4a9f34){return _0x9c444[_0xcc6a('0x5d')]({'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc['body']['message'][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x53')],'attach':_0x9c444[_0xcc6a('0x54')]?_0x9c444[_0xcc6a('0x54')]:_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xcc6a('0x56')),'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'});}else{return _0x9c444;}}})[_0xcc6a('0x12')](function(_0x56a3a0){_0x470e3b['interaction']=_0x56a3a0[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x5f')]=_0x17e5a0;return db[_0xcc6a('0x58')]['create']({'body':_0x3273bc['body']['body'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'MailInteractionId':_0x56a3a0['id'],'direction':'in','ContactId':_0x470e3b[_0xcc6a('0x60')]['id'],'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['messageId'],'from':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['from'],'to':_0x3273bc[_0xcc6a('0x35')]['message']['to'],'cc':_0x3273bc[_0xcc6a('0x35')]['message']['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc['body'][_0xcc6a('0x18')]['attach'],'Attachments':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x61')],'originTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x62')],'originCc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originCc'],'bcc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x63')],'ChatWebsiteId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['ChatWebsiteId']||null,'originChannel':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x64')]||null},{'include':[{'model':db[_0xcc6a('0x65')],'as':_0xcc6a('0x66')}]});})[_0xcc6a('0x12')](function(_0x598833){_0x470e3b[_0xcc6a('0x18')]=_0x598833;if(_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x67')]){return db[_0xcc6a('0x68')][_0xcc6a('0x28')]({'attributes':['id',_0xcc6a('0x69')],'where':{'id':_0x470e3b['interaction']['UserId']}})[_0xcc6a('0x12')](function(_0x43cbee){if(_0x43cbee){_0x470e3b[_0xcc6a('0x46')][_0xcc6a('0x6a')]({'id':0x0,'priority':0x0,'app':_0xcc6a('0x6b'),'appdata':_0x43cbee[_0xcc6a('0x69')]+','+(_0x470e3b[_0xcc6a('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcc6a('0x4d')});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);})[_0xcc6a('0x12')](function(_0x5e8e19){_0x49b65c(_0x5e8e19);})[_0xcc6a('0x1b')](function(_0x4688d3){_0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0x4688d3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ce8618b..93309e7 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 _0x1555=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x164450,_0x28cd91){var _0x1dedbf=function(_0x2723ec){while(--_0x2723ec){_0x164450['push'](_0x164450['shift']());}};_0x1dedbf(++_0x28cd91);}(_0x1555,0x12d));var _0x5155=function(_0x1283c6,_0x4a4b9a){_0x1283c6=_0x1283c6-0x0;var _0x4b5ae7=_0x1555[_0x1283c6];return _0x4b5ae7;};'use strict';var MailAccountEvents=require(_0x5155('0x0'));var events=[_0x5155('0x1'),_0x5155('0x2'),'update'];function createListener(_0x28d5d7,_0x28c645){return function(_0x391d90){_0x28c645[_0x5155('0x3')](_0x28d5d7,_0x391d90);};}function removeListener(_0x31d997,_0x57aaf9){return function(){MailAccountEvents[_0x5155('0x4')](_0x31d997,_0x57aaf9);};}exports[_0x5155('0x5')]=function(_0x58eaa6){for(var _0xa1d145=0x0,_0x1fcb2f=events[_0x5155('0x6')];_0xa1d145<_0x1fcb2f;_0xa1d145++){var _0x1720b2=events[_0xa1d145];var _0x9144ba=createListener(_0x5155('0x7')+_0x1720b2,_0x58eaa6);MailAccountEvents['on'](_0x1720b2,_0x9144ba);}}; \ No newline at end of file +var _0xed11=['register','length','mailAccount:','emit','removeListener'];(function(_0xb813c0,_0x33d406){var _0x15bf17=function(_0x13d827){while(--_0x13d827){_0xb813c0['push'](_0xb813c0['shift']());}};_0x15bf17(++_0x33d406);}(_0xed11,0x107));var _0x1ed1=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xed11[_0x1beef3];return _0x5af964;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove','update'];function createListener(_0x504f3d,_0x207153){return function(_0x37d7f0){_0x207153[_0x1ed1('0x0')](_0x504f3d,_0x37d7f0);};}function removeListener(_0x428305,_0x4f2eb3){return function(){MailAccountEvents[_0x1ed1('0x1')](_0x428305,_0x4f2eb3);};}exports[_0x1ed1('0x2')]=function(_0x31007f){for(var _0x5e56af=0x0,_0x2d61f7=events[_0x1ed1('0x3')];_0x5e56af<_0x2d61f7;_0x5e56af++){var _0x45749a=events[_0x5e56af];var _0x2ccb55=createListener(_0x1ed1('0x4')+_0x45749a,_0x31007f);MailAccountEvents['on'](_0x45749a,_0x2ccb55);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3571883..f7599ea 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 _0x6666=['./mailApplication.controller','show','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3219be,_0x22711a){var _0x314446=function(_0x1457fb){while(--_0x1457fb){_0x3219be['push'](_0x3219be['shift']());}};_0x314446(++_0x22711a);}(_0x6666,0x1c9));var _0x6666=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x6666[_0x2a8c21];return _0x5f3061;};'use strict';var multer=require(_0x6666('0x0'));var util=require(_0x6666('0x1'));var path=require(_0x6666('0x2'));var timeout=require('connect-timeout');var express=require(_0x6666('0x3'));var router=express[_0x6666('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6666('0x5'));var interaction=require(_0x6666('0x6'));var config=require('../../config/environment');var controller=require(_0x6666('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x6666('0x8')]);router[_0x6666('0x9')](_0x6666('0xa'),auth['isAuthenticated'](),controller[_0x6666('0xb')]);router[_0x6666('0xc')](_0x6666('0xa'),auth[_0x6666('0xd')](),controller[_0x6666('0xe')]);module[_0x6666('0xf')]=router; \ No newline at end of file +var _0xeba1=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete'];(function(_0x1b11a0,_0x336a59){var _0x5cd0f0=function(_0x432a29){while(--_0x432a29){_0x1b11a0['push'](_0x1b11a0['shift']());}};_0x5cd0f0(++_0x336a59);}(_0xeba1,0x1c1));var _0x1eba=function(_0x24efed,_0xf8689f){_0x24efed=_0x24efed-0x0;var _0x4d99da=_0xeba1[_0x24efed];return _0x4d99da;};'use strict';var multer=require(_0x1eba('0x0'));var util=require(_0x1eba('0x1'));var path=require(_0x1eba('0x2'));var timeout=require(_0x1eba('0x3'));var express=require(_0x1eba('0x4'));var router=express[_0x1eba('0x5')]();var fs_extra=require(_0x1eba('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1eba('0x7'));var config=require('../../config/environment');var controller=require(_0x1eba('0x8'));router['get'](_0x1eba('0x9'),auth[_0x1eba('0xa')](),controller[_0x1eba('0xb')]);router[_0x1eba('0xc')](_0x1eba('0x9'),auth[_0x1eba('0xa')](),controller[_0x1eba('0xd')]);router[_0x1eba('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1eba('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 d4575dd..45646a7 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 _0x3ed8=['sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x3ad1fb,_0x4e4423){var _0x3ffe3f=function(_0x5ecc42){while(--_0x5ecc42){_0x3ad1fb['push'](_0x3ad1fb['shift']());}};_0x3ffe3f(++_0x4e4423);}(_0x3ed8,0x1b8));var _0x83ed=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x3ed8[_0x1bf809];return _0x1caa4e;};'use strict';var Sequelize=require(_0x83ed('0x0'));module[_0x83ed('0x1')]={'priority':{'type':Sequelize[_0x83ed('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x83ed('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x83ed('0x4')]()},'description':{'type':Sequelize[_0x83ed('0x3')]},'interval':{'type':Sequelize[_0x83ed('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc0d3=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc0d3,0x95));var _0x3c0d=function(_0x20db1c,_0x68a5de){_0x20db1c=_0x20db1c-0x0;var _0x2fe584=_0xc0d3[_0x20db1c];return _0x2fe584;};'use strict';var Sequelize=require('sequelize');module[_0x3c0d('0x0')]={'priority':{'type':Sequelize[_0x3c0d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3c0d('0x2')],'allowNull':![],'defaultValue':_0x3c0d('0x3')},'appdata':{'type':Sequelize[_0x3c0d('0x4')]()},'description':{'type':Sequelize[_0x3c0d('0x2')]},'interval':{'type':Sequelize[_0x3c0d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 116eba5..abdd0d4 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xedd9,0xfc));var _0x9edd=function(_0x5f58bb,_0x3f0bad){_0x5f58bb=_0x5f58bb-0x0;var _0xcc672d=_0xedd9[_0x5f58bb];return _0xcc672d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x1519ec,_0x26ab64){var _0x4ebabc=function(_0x2f098d){while(--_0x2f098d){_0x1519ec['push'](_0x1519ec['shift']());}};_0x4ebabc(++_0x26ab64);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index ceeaeb0..859d926 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 _0x53ef=['api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x553d15,_0x1183d7){var _0x3186ef=function(_0x176c7b){while(--_0x176c7b){_0x553d15['push'](_0x553d15['shift']());}};_0x3186ef(++_0x1183d7);}(_0x53ef,0x1bd));var _0xf53e=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x53ef[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xf53e('0x0'));var util=require(_0xf53e('0x1'));var logger=require(_0xf53e('0x2'))(_0xf53e('0x3'));var moment=require(_0xf53e('0x4'));var BPromise=require(_0xf53e('0x5'));var rp=require(_0xf53e('0x6'));var fs=require('fs');var path=require(_0xf53e('0x7'));var rimraf=require(_0xf53e('0x8'));var config=require('../../config/environment');var attributes=require(_0xf53e('0x9'));module[_0xf53e('0xa')]=function(_0x147bdd,_0x2e5f29){return _0x147bdd[_0xf53e('0xb')](_0xf53e('0xc'),attributes,{'tableName':_0xf53e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf53e('0xe'),'collate':_0xf53e('0xf')});}; \ No newline at end of file +var _0x9138=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','mail_applications','utf8mb4'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9138,0x1a0));var _0x8913=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x9138[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0x8913('0x0'));var util=require(_0x8913('0x1'));var logger=require(_0x8913('0x2'))(_0x8913('0x3'));var moment=require(_0x8913('0x4'));var BPromise=require(_0x8913('0x5'));var rp=require(_0x8913('0x6'));var fs=require('fs');var path=require(_0x8913('0x7'));var rimraf=require(_0x8913('0x8'));var config=require('../../config/environment');var attributes=require(_0x8913('0x9'));module[_0x8913('0xa')]=function(_0xe560d5,_0x5dbca9){return _0xe560d5['define']('MailApplication',attributes,{'tableName':_0x8913('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8913('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 1becf13..d815346 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 _0x8ce0=['update','body','options','raw','where','attributes','then','debug','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailApplication','MailApplication'];(function(_0x4ac0a4,_0x6617d4){var _0x1aae46=function(_0x6cef74){while(--_0x6cef74){_0x4ac0a4['push'](_0x4ac0a4['shift']());}};_0x1aae46(++_0x6617d4);}(_0x8ce0,0xf1));var _0x08ce=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8ce0[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require(_0x08ce('0x0'));var moment=require(_0x08ce('0x1'));var BPromise=require('bluebird');var rs=require(_0x08ce('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08ce('0x3'))['db'];var utils=require(_0x08ce('0x4'));var logger=require(_0x08ce('0x5'))(_0x08ce('0x6'));var config=require(_0x08ce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x08ce('0x8')][_0x08ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19ad8f,_0x1ad151,_0x25ffe6){return new BPromise(function(_0x9aac3c,_0x51993c){return client['request'](_0x19ad8f,_0x25ffe6)['then'](function(_0x44dd86){logger[_0x08ce('0xa')](_0x08ce('0xb'),_0x1ad151,_0x08ce('0xc'));logger['debug'](_0x08ce('0xd'),_0x1ad151,_0x08ce('0xc'),JSON[_0x08ce('0xe')](_0x44dd86));if(_0x44dd86[_0x08ce('0xf')]){if(_0x44dd86['error'][_0x08ce('0x10')]===0x1f4){logger[_0x08ce('0xf')](_0x08ce('0xb'),_0x1ad151,_0x44dd86['error'][_0x08ce('0x11')]);return _0x51993c(_0x44dd86[_0x08ce('0xf')][_0x08ce('0x11')]);}logger['error'](_0x08ce('0xb'),_0x1ad151,_0x44dd86[_0x08ce('0xf')][_0x08ce('0x11')]);return _0x9aac3c(_0x44dd86['error']['message']);}else{logger[_0x08ce('0xa')](_0x08ce('0xb'),_0x1ad151,_0x08ce('0xc'));_0x9aac3c(_0x44dd86['result'][_0x08ce('0x11')]);}})['catch'](function(_0x4a51a2){logger['error']('MailApplication,\x20%s,\x20%s',_0x1ad151,_0x4a51a2);_0x51993c(_0x4a51a2);});});}exports[_0x08ce('0x12')]=function(_0x191ffa){var _0x12e4e3=this;return new Promise(function(_0x5e5056,_0x210764){return db[_0x08ce('0x13')][_0x08ce('0x14')](_0x191ffa[_0x08ce('0x15')],{'raw':_0x191ffa[_0x08ce('0x16')]?_0x191ffa[_0x08ce('0x16')][_0x08ce('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x191ffa[_0x08ce('0x16')]?_0x191ffa['options'][_0x08ce('0x18')]||null:null,'attributes':_0x191ffa[_0x08ce('0x16')]?_0x191ffa[_0x08ce('0x16')][_0x08ce('0x19')]||null:null,'limit':_0x191ffa['options']?_0x191ffa['options']['limit']||null:null})[_0x08ce('0x1a')](function(_0x18f9ba){logger[_0x08ce('0xa')](_0x08ce('0x12'),_0x191ffa);logger[_0x08ce('0x1b')]('UpdateMailApplication',_0x191ffa,JSON[_0x08ce('0xe')](_0x18f9ba));_0x5e5056(_0x18f9ba);})[_0x08ce('0x1c')](function(_0x50a2eb){logger[_0x08ce('0xf')](_0x08ce('0x12'),_0x50a2eb['message'],_0x191ffa);_0x210764(_0x12e4e3[_0x08ce('0xf')](0x1f4,_0x50a2eb[_0x08ce('0x11')]));});});}; \ No newline at end of file +var _0x3837=['raw','limit','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','update','body','options'];(function(_0x273277,_0x383dd5){var _0x3d33af=function(_0x13d2b1){while(--_0x13d2b1){_0x273277['push'](_0x273277['shift']());}};_0x3d33af(++_0x383dd5);}(_0x3837,0x162));var _0x7383=function(_0x222b4a,_0x511895){_0x222b4a=_0x222b4a-0x0;var _0x1dfeea=_0x3837[_0x222b4a];return _0x1dfeea;};'use strict';var _=require(_0x7383('0x0'));var util=require(_0x7383('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7383('0x2'));var fs=require('fs');var Redis=require(_0x7383('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7383('0x4'));var logger=require(_0x7383('0x5'))(_0x7383('0x6'));var config=require(_0x7383('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7383('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x347e88,_0x936b03,_0xc3e259){return new BPromise(function(_0x490443,_0x536855){return client[_0x7383('0x9')](_0x347e88,_0xc3e259)['then'](function(_0x118b0b){logger[_0x7383('0xa')](_0x7383('0xb'),_0x936b03,_0x7383('0xc'));logger[_0x7383('0xd')](_0x7383('0xe'),_0x936b03,_0x7383('0xc'),JSON[_0x7383('0xf')](_0x118b0b));if(_0x118b0b['error']){if(_0x118b0b[_0x7383('0x10')][_0x7383('0x11')]===0x1f4){logger[_0x7383('0x10')](_0x7383('0xb'),_0x936b03,_0x118b0b[_0x7383('0x10')][_0x7383('0x12')]);return _0x536855(_0x118b0b['error'][_0x7383('0x12')]);}logger[_0x7383('0x10')](_0x7383('0xb'),_0x936b03,_0x118b0b['error'][_0x7383('0x12')]);return _0x490443(_0x118b0b[_0x7383('0x10')][_0x7383('0x12')]);}else{logger[_0x7383('0xa')](_0x7383('0xb'),_0x936b03,_0x7383('0xc'));_0x490443(_0x118b0b[_0x7383('0x13')][_0x7383('0x12')]);}})['catch'](function(_0x205172){logger[_0x7383('0x10')]('MailApplication,\x20%s,\x20%s',_0x936b03,_0x205172);_0x536855(_0x205172);});});}exports[_0x7383('0x14')]=function(_0x3920cd){var _0x4fd0d9=this;return new Promise(function(_0x2ddc0e,_0x1fd804){return db['MailApplication'][_0x7383('0x15')](_0x3920cd[_0x7383('0x16')],{'raw':_0x3920cd['options']?_0x3920cd[_0x7383('0x17')][_0x7383('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3920cd['options']?_0x3920cd['options']['where']||null:null,'attributes':_0x3920cd['options']?_0x3920cd['options']['attributes']||null:null,'limit':_0x3920cd['options']?_0x3920cd['options'][_0x7383('0x19')]||null:null})['then'](function(_0x3252b3){logger[_0x7383('0xa')]('UpdateMailApplication',_0x3920cd);logger[_0x7383('0xd')](_0x7383('0x14'),_0x3920cd,JSON[_0x7383('0xf')](_0x3252b3));_0x2ddc0e(_0x3252b3);})[_0x7383('0x1a')](function(_0x4979fe){logger[_0x7383('0x10')]('UpdateMailApplication',_0x4979fe[_0x7383('0x12')],_0x3920cd);_0x1fd804(_0x4fd0d9[_0x7383('0x10')](0x1f4,_0x4979fe[_0x7383('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a18be91..c4238e3 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 _0x4d0e=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','/:id','mailinteraction:destroy','delete','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4d0e,0x15a));var _0xe4d0=function(_0xf60c6b,_0x4bc8e9){_0xf60c6b=_0xf60c6b-0x0;var _0x284605=_0x4d0e[_0xf60c6b];return _0x284605;};'use strict';var express=require(_0xe4d0('0x0'));var router=express['Router']();var auth=require(_0xe4d0('0x1'));var interaction=require(_0xe4d0('0x2'));var controller=require(_0xe4d0('0x3'));router[_0xe4d0('0x4')]('/',auth[_0xe4d0('0x5')](),controller[_0xe4d0('0x6')]);router[_0xe4d0('0x4')](_0xe4d0('0x7'),auth[_0xe4d0('0x5')](),controller[_0xe4d0('0x8')]);router[_0xe4d0('0x4')]('/:id',auth[_0xe4d0('0x5')](),controller[_0xe4d0('0x9')]);router['get'](_0xe4d0('0xa'),auth['isAuthenticated'](),controller[_0xe4d0('0xb')]);router[_0xe4d0('0x4')]('/:id/download',auth['isAuthenticated'](),controller[_0xe4d0('0xc')]);router[_0xe4d0('0xd')]('/',auth[_0xe4d0('0x5')](),controller[_0xe4d0('0xe')]);router['post'](_0xe4d0('0xa'),auth[_0xe4d0('0x5')](),controller['addMessage']);router[_0xe4d0('0xd')](_0xe4d0('0xf'),auth[_0xe4d0('0x5')](),interaction[_0xe4d0('0x10')](_0xe4d0('0x11'),_0xe4d0('0x12')),controller[_0xe4d0('0x13')]);router[_0xe4d0('0x14')]('/:id',auth['isAuthenticated'](),interaction[_0xe4d0('0x10')]('mail','mailinteraction:update'),controller[_0xe4d0('0x15')]);router['delete'](_0xe4d0('0x16'),auth[_0xe4d0('0x5')](),interaction[_0xe4d0('0x10')](_0xe4d0('0x11'),_0xe4d0('0x17')),controller['destroy']);router[_0xe4d0('0x18')](_0xe4d0('0xf'),auth[_0xe4d0('0x5')](),controller[_0xe4d0('0x19')]);module[_0xe4d0('0x1a')]=router; \ No newline at end of file +var _0x2071=['mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x2071,0x10e));var _0x1207=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x2071[_0xe2c95e];return _0x42ce6f;};'use strict';var express=require(_0x1207('0x0'));var router=express[_0x1207('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x1207('0x2'));var controller=require(_0x1207('0x3'));router[_0x1207('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1207('0x4')](_0x1207('0x5'),auth[_0x1207('0x6')](),controller['describe']);router[_0x1207('0x4')](_0x1207('0x7'),auth[_0x1207('0x6')](),controller['show']);router[_0x1207('0x4')](_0x1207('0x8'),auth['isAuthenticated'](),controller[_0x1207('0x9')]);router[_0x1207('0x4')](_0x1207('0xa'),auth[_0x1207('0x6')](),controller[_0x1207('0xb')]);router[_0x1207('0xc')]('/',auth['isAuthenticated'](),controller[_0x1207('0xd')]);router[_0x1207('0xc')]('/:id/messages',auth[_0x1207('0x6')](),controller[_0x1207('0xe')]);router[_0x1207('0xc')](_0x1207('0xf'),auth[_0x1207('0x6')](),interaction['tracked'](_0x1207('0x10'),_0x1207('0x11')),controller[_0x1207('0x12')]);router['put'](_0x1207('0x7'),auth[_0x1207('0x6')](),interaction[_0x1207('0x13')]('mail',_0x1207('0x14')),controller[_0x1207('0x15')]);router['delete'](_0x1207('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x1207('0x10'),_0x1207('0x16')),controller[_0x1207('0x17')]);router[_0x1207('0x18')](_0x1207('0xf'),auth['isAuthenticated'](),controller[_0x1207('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a44b88f..f816d0c 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 _0x9ebf=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x9ebf,0x18f));var _0xf9eb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9ebf[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xf9eb('0x0'));var iconv=require(_0xf9eb('0x1'));module[_0xf9eb('0x2')]={'closed':{'type':Sequelize[_0xf9eb('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf9eb('0x4')]},'disposition':{'type':Sequelize[_0xf9eb('0x5')]},'secondDisposition':{'type':Sequelize[_0xf9eb('0x5')]},'thirdDisposition':{'type':Sequelize[_0xf9eb('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xf9eb('0x5')](0x1fe)},'to':{'type':Sequelize[_0xf9eb('0x5')]},'cc':{'type':Sequelize[_0xf9eb('0x6')](_0xf9eb('0x7'))},'subject':{'type':Sequelize[_0xf9eb('0x6')]()},'attach':{'type':Sequelize[_0xf9eb('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf9eb('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xf9eb('0x8')]('in',_0xf9eb('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf9eb('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf9eb('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf9eb('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9494=['STRING','TEXT','DATE','ENUM','out','sequelize','iconv','BOOLEAN'];(function(_0x26cb9a,_0x1148cb){var _0x32e0cc=function(_0x21261c){while(--_0x21261c){_0x26cb9a['push'](_0x26cb9a['shift']());}};_0x32e0cc(++_0x1148cb);}(_0x9494,0x185));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4949('0x0'));var iconv=require(_0x4949('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4949('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4949('0x3')]},'secondDisposition':{'type':Sequelize[_0x4949('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4949('0x3')]},'note':{'type':Sequelize[_0x4949('0x3')]},'inReplyTo':{'type':Sequelize[_0x4949('0x3')](0x1fe)},'to':{'type':Sequelize[_0x4949('0x3')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x4949('0x4')]()},'attach':{'type':Sequelize[_0x4949('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4949('0x5')]},'substatus':{'type':Sequelize[_0x4949('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x4949('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x4949('0x6')]('in',_0x4949('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4949('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x4949('0x6')]('in',_0x4949('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index baa8fd3..d24714d 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 _0xe9b9=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','getOptions','findAll','mail','user','catch','params','model','keys','MailInteraction','query','filters','intersection','attributes','fields','length','include','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','inlineCss','true','rows','addTags','spread','Tag','emit','removeTags','unix','toString','join','root','files','tmp','server','attachments','push','Attachment','Attachments','subject','createdAt','Messages','get','each','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','../../components/parsers/qs','../../config/logger'];(function(_0x5d2af3,_0x5f0ed4){var _0x2bc29e=function(_0x357474){while(--_0x357474){_0x5d2af3['push'](_0x5d2af3['shift']());}};_0x2bc29e(++_0x5f0ed4);}(_0xe9b9,0xd4));var _0x9e9b=function(_0x13d0be,_0x4ec269){_0x13d0be=_0x13d0be-0x0;var _0x23035d=_0xe9b9[_0x13d0be];return _0x23035d;};'use strict';var emlformat=require(_0x9e9b('0x0'));var rimraf=require(_0x9e9b('0x1'));var zipdir=require(_0x9e9b('0x2'));var moment=require(_0x9e9b('0x3'));var BPromise=require(_0x9e9b('0x4'));var util=require(_0x9e9b('0x5'));var path=require(_0x9e9b('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0x9e9b('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x9e9b('0x8'));var logger=require(_0x9e9b('0x9'))('api');var config=require('../../config/environment');var db=require(_0x9e9b('0xa'))['db'];var htmlEntities=require('html-entities');config[_0x9e9b('0xb')]=_[_0x9e9b('0xc')](config['redis'],{'host':_0x9e9b('0xd'),'port':0x18eb});var socket=require(_0x9e9b('0xe'))(new Redis(config[_0x9e9b('0xb')]));require(_0x9e9b('0xf'))['register'](socket);function respondWithStatusCode(_0x54e13f,_0x46fa6e){_0x46fa6e=_0x46fa6e||0xcc;return function(_0x437bc1){if(_0x437bc1){return _0x54e13f['sendStatus'](_0x46fa6e);}return _0x54e13f[_0x9e9b('0x10')](_0x46fa6e)['end']();};}function respondWithResult(_0x357259,_0x5d7faa){_0x5d7faa=_0x5d7faa||0xc8;return function(_0x5a43ba){if(_0x5a43ba){return _0x357259[_0x9e9b('0x10')](_0x5d7faa)[_0x9e9b('0x11')](_0x5a43ba);}};}function respondWithFilteredResult(_0x20df67,_0x79b14c){return function(_0x28f91b){if(_0x28f91b){var _0x3b5b11=typeof _0x79b14c['offset']===_0x9e9b('0x12')&&typeof _0x79b14c['limit']==='undefined';var _0x3b4273=_0x28f91b[_0x9e9b('0x13')];var _0x429b61=_0x3b5b11?0x0:_0x79b14c[_0x9e9b('0x14')];var _0x3a0f10=_0x3b5b11?_0x28f91b[_0x9e9b('0x13')]:_0x79b14c[_0x9e9b('0x14')]+_0x79b14c[_0x9e9b('0x15')];var _0x35b933;if(_0x3a0f10>=_0x3b4273){_0x3a0f10=_0x3b4273;_0x35b933=0xc8;}else{_0x35b933=0xce;}_0x20df67[_0x9e9b('0x10')](_0x35b933);return _0x20df67[_0x9e9b('0x16')](_0x9e9b('0x17'),_0x429b61+'-'+_0x3a0f10+'/'+_0x3b4273)['json'](_0x28f91b);}return null;};}function saveUpdates(_0xaaebc1){return function(_0x5a0f38){if(_0x5a0f38){return _0x5a0f38[_0x9e9b('0x18')](_0xaaebc1)[_0x9e9b('0x19')](function(_0x7d58a){return _0x7d58a;});}return null;};}function removeEntity(_0x11ea58){return function(_0x5b27b9){if(_0x5b27b9){return _0x5b27b9[_0x9e9b('0x1a')]()['then'](function(){_0x11ea58[_0x9e9b('0x10')](0xcc)[_0x9e9b('0x1b')]();});}};}function handleEntityNotFound(_0x3f09ca){return function(_0x2c77cd){if(!_0x2c77cd){_0x3f09ca[_0x9e9b('0x1c')](0x194);}return _0x2c77cd;};}function handleError(_0x39704c,_0x56be5f){_0x56be5f=_0x56be5f||0x1f4;return function(_0xc7b149){logger[_0x9e9b('0x1d')](_0xc7b149[_0x9e9b('0x1e')]);if(_0xc7b149[_0x9e9b('0x1f')]){delete _0xc7b149[_0x9e9b('0x1f')];}_0x39704c['status'](_0x56be5f)[_0x9e9b('0x20')](_0xc7b149);};}exports[_0x9e9b('0x21')]=function(_0x553969,_0x2f3356){var _0x40fabc={};var _0x124633=_['map'](db['MailInteraction'][_0x9e9b('0x22')],function(_0x52e4e9){return{'name':_0x52e4e9[_0x9e9b('0x23')],'type':_0x52e4e9['type'][_0x9e9b('0x24')]};});_0x40fabc=qs[_0x9e9b('0x25')](_0x124633,_0x553969);return interaction[_0x9e9b('0x26')](_0x9e9b('0x27'),_0x553969['query'],_0x553969[_0x9e9b('0x28')],_0x40fabc,_0x124633)[_0x9e9b('0x19')](respondWithFilteredResult(_0x2f3356,_0x40fabc))[_0x9e9b('0x29')](handleError(_0x2f3356,null));};exports['show']=function(_0x4f5efc,_0x4b0556){var _0x115e9e={'raw':![],'where':{'id':_0x4f5efc[_0x9e9b('0x2a')]['id']}},_0x2c4f6f={};_0x2c4f6f[_0x9e9b('0x2b')]=_[_0x9e9b('0x2c')](db[_0x9e9b('0x2d')][_0x9e9b('0x22')]);_0x2c4f6f[_0x9e9b('0x2e')]=_[_0x9e9b('0x2c')](_0x4f5efc['query']);_0x2c4f6f[_0x9e9b('0x2f')]=_[_0x9e9b('0x30')](_0x2c4f6f[_0x9e9b('0x2b')],_0x2c4f6f[_0x9e9b('0x2e')]);_0x115e9e[_0x9e9b('0x31')]=_[_0x9e9b('0x30')](_0x2c4f6f['model'],qs[_0x9e9b('0x32')](_0x4f5efc[_0x9e9b('0x2e')][_0x9e9b('0x32')]));_0x115e9e['attributes']=_0x115e9e[_0x9e9b('0x31')][_0x9e9b('0x33')]?_0x115e9e[_0x9e9b('0x31')]:_0x2c4f6f['model'];if(_0x4f5efc['query']['includeAll']){_0x115e9e[_0x9e9b('0x34')]=[{'all':!![]}];}_0x115e9e=_['merge']({},_0x115e9e,_0x4f5efc['options']);return db['MailInteraction'][_0x9e9b('0x35')](_0x115e9e)[_0x9e9b('0x19')](handleEntityNotFound(_0x4b0556,null))[_0x9e9b('0x19')](respondWithResult(_0x4b0556,null))[_0x9e9b('0x29')](handleError(_0x4b0556,null));};exports[_0x9e9b('0x36')]=function(_0x4bdfa4,_0x727c66){return db[_0x9e9b('0x2d')][_0x9e9b('0x36')](_0x4bdfa4[_0x9e9b('0x37')],{})[_0x9e9b('0x19')](respondWithResult(_0x727c66,0xc9))['catch'](handleError(_0x727c66,null));};exports['update']=function(_0x597e74,_0x2b50cf){if(_0x597e74['body']['id']){delete _0x597e74[_0x9e9b('0x37')]['id'];}return db[_0x9e9b('0x2d')]['find']({'where':{'id':_0x597e74['params']['id']}})[_0x9e9b('0x19')](handleEntityNotFound(_0x2b50cf,null))['then'](saveUpdates(_0x597e74[_0x9e9b('0x37')],null))[_0x9e9b('0x19')](respondWithResult(_0x2b50cf,null))[_0x9e9b('0x29')](handleError(_0x2b50cf,null));};exports[_0x9e9b('0x1a')]=function(_0xfb98eb,_0xa8ffd0){return db[_0x9e9b('0x2d')][_0x9e9b('0x35')]({'where':{'id':_0xfb98eb[_0x9e9b('0x2a')]['id']}})[_0x9e9b('0x19')](handleEntityNotFound(_0xa8ffd0,null))[_0x9e9b('0x19')](removeEntity(_0xa8ffd0,null))[_0x9e9b('0x29')](handleError(_0xa8ffd0,null));};exports[_0x9e9b('0x38')]=function(_0x56539a,_0x8f1b4d){return db[_0x9e9b('0x2d')][_0x9e9b('0x38')]()[_0x9e9b('0x19')](respondWithResult(_0x8f1b4d,null))[_0x9e9b('0x29')](handleError(_0x8f1b4d,null));};exports[_0x9e9b('0x39')]=function(_0x68235e,_0x2d03b5){return db['MailMessage'][_0x9e9b('0x35')]({'where':{'id':_0x68235e[_0x9e9b('0x2a')]['id']}})[_0x9e9b('0x19')](handleEntityNotFound(_0x2d03b5,null))['then'](function(_0x519af6){if(_0x519af6){return _0x519af6['addMessage'](_0x68235e[_0x9e9b('0x37')][_0x9e9b('0x3a')],_[_0x9e9b('0x3b')](_0x68235e[_0x9e9b('0x37')],[_0x9e9b('0x3a'),'id'])||{});}})[_0x9e9b('0x19')](respondWithResult(_0x2d03b5,null))[_0x9e9b('0x29')](handleError(_0x2d03b5,null));};exports[_0x9e9b('0x3c')]=function(_0x2e8fdf,_0x8b4b17){var _0xb13916={'raw':![],'where':{}};var _0x5ace90={};var _0x42d1b7={'count':0x0,'rows':[]};return db['MailInteraction'][_0x9e9b('0x3d')]({'where':{'id':_0x2e8fdf[_0x9e9b('0x2a')]['id']}})[_0x9e9b('0x19')](handleEntityNotFound(_0x8b4b17,null))[_0x9e9b('0x19')](function(_0x4c1f40){if(_0x4c1f40){_0x5ace90[_0x9e9b('0x2b')]=_[_0x9e9b('0x2c')](db[_0x9e9b('0x3e')]['rawAttributes']);_0x5ace90[_0x9e9b('0x2e')]=_[_0x9e9b('0x2c')](_0x2e8fdf[_0x9e9b('0x2e')]);_0x5ace90['filters']=_[_0x9e9b('0x30')](_0x5ace90[_0x9e9b('0x2b')],_0x5ace90[_0x9e9b('0x2e')]);_0xb13916[_0x9e9b('0x31')]=_[_0x9e9b('0x30')](_0x5ace90['model'],qs[_0x9e9b('0x32')](_0x2e8fdf['query'][_0x9e9b('0x32')]));_0xb13916[_0x9e9b('0x31')]=_0xb13916['attributes'][_0x9e9b('0x33')]?_0xb13916[_0x9e9b('0x31')]:_0x5ace90[_0x9e9b('0x2b')];if(!_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x3f')](_0x9e9b('0x40'))){_0xb13916[_0x9e9b('0x15')]=qs[_0x9e9b('0x15')](_0x2e8fdf[_0x9e9b('0x2e')]['limit']);_0xb13916[_0x9e9b('0x14')]=qs[_0x9e9b('0x14')](_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x14')]);}_0xb13916[_0x9e9b('0x41')]=qs[_0x9e9b('0x42')](_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x42')]);_0xb13916['where']=qs['filters'](_['pick'](_0x2e8fdf[_0x9e9b('0x2e')],_0x5ace90[_0x9e9b('0x2f')]));_0xb13916[_0x9e9b('0x43')][_0x9e9b('0x44')]=_0x4c1f40['id'];if(_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x45')]){_0xb13916[_0x9e9b('0x43')]=_[_0x9e9b('0x46')](_0xb13916[_0x9e9b('0x43')],{'$or':_['map'](_0xb13916[_0x9e9b('0x31')],function(_0x52566b){var _0x1fcc2b={};_0x1fcc2b[_0x52566b]={'$like':'%'+_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x45')]+'%'};return _0x1fcc2b;})});}if(_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x47')]){var _0x5894c1=_0x2e8fdf['query']['$gte'][_0x9e9b('0x48')](',');var _0x4063f1={};_0x4063f1[_0x5894c1[0x0]]={'$gte':moment(_0x5894c1[0x1])['format'](_0x9e9b('0x49'))};_0xb13916[_0x9e9b('0x43')]=_[_0x9e9b('0x46')](_0xb13916[_0x9e9b('0x43')],_0x4063f1);}_0xb13916=_[_0x9e9b('0x46')]({},_0xb13916,_0x2e8fdf[_0x9e9b('0x4a')]);return db['MailMessage'][_0x9e9b('0x13')]({'where':_0xb13916[_0x9e9b('0x43')]})[_0x9e9b('0x19')](function(_0x291db3){_0x42d1b7[_0x9e9b('0x13')]=_0x291db3;if(_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x4b')]){_0xb13916[_0x9e9b('0x34')]=[{'all':!![]}];}return db[_0x9e9b('0x3e')][_0x9e9b('0x26')](_0xb13916);})[_0x9e9b('0x19')](function(_0xb29cf6){if(_0x2e8fdf[_0x9e9b('0x2e')][_0x9e9b('0x4c')]===_0x9e9b('0x4d')){for(var _0x578320=0x0;_0x578320<_0xb29cf6[_0x9e9b('0x33')];_0x578320++){_0xb29cf6[_0x578320][_0x9e9b('0x37')]=juice(_0xb29cf6[_0x578320][_0x9e9b('0x37')]);}}_0x42d1b7[_0x9e9b('0x4e')]=_0xb29cf6;return _0x42d1b7;});}})[_0x9e9b('0x19')](respondWithFilteredResult(_0x8b4b17,_0xb13916))['catch'](handleError(_0x8b4b17,null));};exports[_0x9e9b('0x4f')]=function(_0x20aab5,_0xe58f5c){return db[_0x9e9b('0x2d')]['find']({'where':{'id':_0x20aab5[_0x9e9b('0x2a')]['id']}})[_0x9e9b('0x19')](handleEntityNotFound(_0xe58f5c,null))['then'](function(_0x165f81){if(_0x165f81){return _0x165f81['setTags'](_0x20aab5[_0x9e9b('0x37')][_0x9e9b('0x3a')],_[_0x9e9b('0x3b')](_0x20aab5[_0x9e9b('0x37')],[_0x9e9b('0x3a'),'id'])||{})[_0x9e9b('0x50')](function(){return db[_0x9e9b('0x51')][_0x9e9b('0x26')]({'attributes':['id',_0x9e9b('0x1f'),'color'],'where':{'id':_0x20aab5[_0x9e9b('0x37')][_0x9e9b('0x3a')]}});})[_0x9e9b('0x19')](function(_0xe318f){socket[_0x9e9b('0x52')]('mailInteractionTags:save',{'id':Number(_0x20aab5[_0x9e9b('0x2a')]['id']),'tags':_0xe318f||[]});return{'id':Number(_0x20aab5[_0x9e9b('0x2a')]['id']),'tags':_0xe318f||[]};});}})['then'](respondWithResult(_0xe58f5c,null))['catch'](handleError(_0xe58f5c,null));};exports[_0x9e9b('0x53')]=function(_0x25fac8,_0x4cb23c){return db[_0x9e9b('0x2d')][_0x9e9b('0x35')]({'where':{'id':_0x25fac8['params']['id']}})[_0x9e9b('0x19')](handleEntityNotFound(_0x4cb23c,null))[_0x9e9b('0x19')](function(_0x1fa32b){if(_0x1fa32b){return _0x1fa32b[_0x9e9b('0x53')](_0x25fac8[_0x9e9b('0x2e')]['ids']);}})[_0x9e9b('0x19')](respondWithStatusCode(_0x4cb23c,null))['catch'](handleError(_0x4cb23c,null));};exports['download']=function(_0x3f4f92,_0x17ff59){var _0x12bdf6=moment()[_0x9e9b('0x54')]()[_0x9e9b('0x55')]();var _0x34047d=path[_0x9e9b('0x56')](config[_0x9e9b('0x57')],'server',_0x9e9b('0x58'),_0x9e9b('0x59'));var _0x541ff6=path[_0x9e9b('0x56')](config[_0x9e9b('0x57')],_0x9e9b('0x5a'),_0x9e9b('0x58'),_0x9e9b('0x5b'));var _0x40a464=path['join'](_0x34047d,_0x12bdf6);var _0x304f61=util['format']('transcript-%d-%s.zip',_0x3f4f92['params']['id'],_0x12bdf6);var _0x1d7a72=path[_0x9e9b('0x56')](_0x34047d,_0x304f61);var _0x23c591=[];if(_0x3f4f92[_0x9e9b('0x2e')][_0x9e9b('0x5b')]){_0x23c591[_0x9e9b('0x5c')]({'model':db[_0x9e9b('0x5d')],'as':_0x9e9b('0x5e'),'raw':!![]});}var _0x39b05c=[{'model':db[_0x9e9b('0x3e')],'as':'Messages','attributes':['id',_0x9e9b('0x37'),'from','to','cc','bcc',_0x9e9b('0x5f'),_0x9e9b('0x60')],'where':{'secret':![]},'order':qs[_0x9e9b('0x42')]('id'),'include':_0x23c591}];return db[_0x9e9b('0x2d')][_0x9e9b('0x35')]({'where':{'id':_0x3f4f92[_0x9e9b('0x2a')]['id']},'include':_0x39b05c})['then'](handleEntityNotFound(_0x17ff59,null))['then'](function(_0xefa082){if(_0xefa082&&_0xefa082[_0x9e9b('0x61')]){var _0x293779=_0xefa082[_0x9e9b('0x62')]({'plain':!![]});fs['mkdirSync'](_0x40a464);return BPromise[_0x9e9b('0x63')](_0x293779[_0x9e9b('0x61')],function(_0x47a4a9,_0x5100e9){var _0x971366={'from':_0x47a4a9['from'],'to':_0x47a4a9['to'],'subject':_0x47a4a9['subject'],'html':htmlEntities['decode'](_0x47a4a9[_0x9e9b('0x37')]),'headers':{'Date':moment(_0x47a4a9[_0x9e9b('0x60')])[_0x9e9b('0x64')](_0x9e9b('0x65'))},'attachments':[]};if(_0x47a4a9['cc']){_0x971366[_0x9e9b('0x66')]['Cc']=_0x47a4a9['cc'];}if(_0x47a4a9[_0x9e9b('0x67')]){_0x971366[_0x9e9b('0x66')][_0x9e9b('0x68')]=_0x47a4a9[_0x9e9b('0x67')];}return new BPromise(function(_0x452e56,_0x31b203){if(_0x47a4a9[_0x9e9b('0x5e')]){for(var _0x30acbe=0x0;_0x30acbe<_0x47a4a9[_0x9e9b('0x5e')]['length'];_0x30acbe++){var _0x16e815=_0x47a4a9[_0x9e9b('0x5e')][_0x30acbe];var _0x423d78=path[_0x9e9b('0x56')](_0x541ff6,_0x16e815[_0x9e9b('0x69')]);if(fs[_0x9e9b('0x6a')](_0x423d78)){_0x971366[_0x9e9b('0x5b')][_0x9e9b('0x5c')]({'name':_0x16e815[_0x9e9b('0x1f')],'contentType':_0x16e815['type'],'data':fs['readFileSync'](_0x423d78)});}}}emlformat['build'](_0x971366,function(_0x4cdc34,_0x197aa4){if(_0x4cdc34)return _0x31b203(_0x4cdc34);fs[_0x9e9b('0x6b')](path[_0x9e9b('0x56')](_0x40a464,util['format'](_0x9e9b('0x6c'),_0x5100e9)),_0x197aa4);return _0x452e56(_0x197aa4);});});})[_0x9e9b('0x19')](function(){return new BPromise(function(_0x5cc2a2,_0x365a3c){zipdir(_0x40a464,{'saveTo':_0x1d7a72},function(_0x37bacd,_0x2708a1){if(_0x37bacd)return _0x365a3c(_0x37bacd);return _0x5cc2a2(_0x2708a1);});})['then'](function(){return new BPromise(function(_0x540c42,_0x4922d8){rimraf(_0x40a464,function(_0x467e9c){if(_0x467e9c)_0x4922d8(_0x467e9c);return _0x540c42();});});})[_0x9e9b('0x19')](function(){return _0x17ff59[_0x9e9b('0x6d')](_0x1d7a72,_0x304f61,function(_0x32d111){if(!_0x32d111)fs[_0x9e9b('0x6e')](_0x1d7a72);});});});}else{return _0x17ff59[_0x9e9b('0x1c')](0xc8);}})[_0x9e9b('0x29')](handleError(_0x17ff59,null));}; \ No newline at end of file +var _0x5089=['rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','status','stack','name','send','index','MailInteraction','fieldName','type','getOptions','findAll','mail','query','user','then','catch','show','params','model','keys','rawAttributes','filters','attributes','intersection','fields','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','hasOwnProperty','order','where','MailInteractionId','filter','$gte','split','format','inlineCss','true','length','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','join','root','server','tmp','transcript-%d-%s.zip','attachments','push','Messages','bcc','sort','get','mkdirSync','each','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','download','unlinkSync','eml-format'];(function(_0x2bd35b,_0x44f393){var _0x3d4955=function(_0x5d5d67){while(--_0x5d5d67){_0x2bd35b['push'](_0x2bd35b['shift']());}};_0x3d4955(++_0x44f393);}(_0x5089,0x1bb));var _0x9508=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0x5089[_0x399849];return _0xfbb04;};'use strict';var emlformat=require(_0x9508('0x0'));var rimraf=require(_0x9508('0x1'));var zipdir=require('zip-dir');var moment=require(_0x9508('0x2'));var BPromise=require(_0x9508('0x3'));var util=require(_0x9508('0x4'));var path=require(_0x9508('0x5'));var fs=require('fs');var _=require(_0x9508('0x6'));var juice=require('juice');var Redis=require(_0x9508('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x9508('0x8'));var logger=require(_0x9508('0x9'))(_0x9508('0xa'));var config=require('../../config/environment');var db=require(_0x9508('0xb'))['db'];var htmlEntities=require(_0x9508('0xc'));config['redis']=_[_0x9508('0xd')](config[_0x9508('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x9508('0xf'))(new Redis(config['redis']));require(_0x9508('0x10'))[_0x9508('0x11')](socket);function respondWithStatusCode(_0x852feb,_0x21f8c1){_0x21f8c1=_0x21f8c1||0xcc;return function(_0x839509){if(_0x839509){return _0x852feb[_0x9508('0x12')](_0x21f8c1);}return _0x852feb['status'](_0x21f8c1)[_0x9508('0x13')]();};}function respondWithResult(_0x507887,_0x2c4fd9){_0x2c4fd9=_0x2c4fd9||0xc8;return function(_0x396896){if(_0x396896){return _0x507887['status'](_0x2c4fd9)[_0x9508('0x14')](_0x396896);}};}function respondWithFilteredResult(_0x3b7427,_0x10ceef){return function(_0x4701de){if(_0x4701de){var _0x51ef92=typeof _0x10ceef[_0x9508('0x15')]===_0x9508('0x16')&&typeof _0x10ceef['limit']===_0x9508('0x16');var _0x539746=_0x4701de[_0x9508('0x17')];var _0x418889=_0x51ef92?0x0:_0x10ceef[_0x9508('0x15')];var _0x255a03=_0x51ef92?_0x4701de[_0x9508('0x17')]:_0x10ceef[_0x9508('0x15')]+_0x10ceef[_0x9508('0x18')];var _0x20df7d;if(_0x255a03>=_0x539746){_0x255a03=_0x539746;_0x20df7d=0xc8;}else{_0x20df7d=0xce;}_0x3b7427['status'](_0x20df7d);return _0x3b7427[_0x9508('0x19')](_0x9508('0x1a'),_0x418889+'-'+_0x255a03+'/'+_0x539746)[_0x9508('0x14')](_0x4701de);}return null;};}function saveUpdates(_0x1ba7e6){return function(_0x23c30e){if(_0x23c30e){return _0x23c30e[_0x9508('0x1b')](_0x1ba7e6)['then'](function(_0x4cbf6a){return _0x4cbf6a;});}return null;};}function removeEntity(_0x17e43c){return function(_0x47f7a2){if(_0x47f7a2){return _0x47f7a2[_0x9508('0x1c')]()['then'](function(){_0x17e43c[_0x9508('0x1d')](0xcc)[_0x9508('0x13')]();});}};}function handleEntityNotFound(_0x226f29){return function(_0x1dfc6c){if(!_0x1dfc6c){_0x226f29[_0x9508('0x12')](0x194);}return _0x1dfc6c;};}function handleError(_0x2f8106,_0x20eb53){_0x20eb53=_0x20eb53||0x1f4;return function(_0x5f4f0c){logger['error'](_0x5f4f0c[_0x9508('0x1e')]);if(_0x5f4f0c[_0x9508('0x1f')]){delete _0x5f4f0c[_0x9508('0x1f')];}_0x2f8106[_0x9508('0x1d')](_0x20eb53)[_0x9508('0x20')](_0x5f4f0c);};}exports[_0x9508('0x21')]=function(_0x4b68e9,_0x5e9a80){var _0x46d23f={};var _0x55cc4d=_['map'](db[_0x9508('0x22')]['rawAttributes'],function(_0x5db4e1){return{'name':_0x5db4e1[_0x9508('0x23')],'type':_0x5db4e1[_0x9508('0x24')]['key']};});_0x46d23f=qs[_0x9508('0x25')](_0x55cc4d,_0x4b68e9);return interaction[_0x9508('0x26')](_0x9508('0x27'),_0x4b68e9[_0x9508('0x28')],_0x4b68e9[_0x9508('0x29')],_0x46d23f,_0x55cc4d)[_0x9508('0x2a')](respondWithFilteredResult(_0x5e9a80,_0x46d23f))[_0x9508('0x2b')](handleError(_0x5e9a80,null));};exports[_0x9508('0x2c')]=function(_0x414534,_0x24df6){var _0x19a984={'raw':![],'where':{'id':_0x414534[_0x9508('0x2d')]['id']}},_0x55f36c={};_0x55f36c[_0x9508('0x2e')]=_[_0x9508('0x2f')](db['MailInteraction'][_0x9508('0x30')]);_0x55f36c[_0x9508('0x28')]=_['keys'](_0x414534[_0x9508('0x28')]);_0x55f36c[_0x9508('0x31')]=_['intersection'](_0x55f36c[_0x9508('0x2e')],_0x55f36c[_0x9508('0x28')]);_0x19a984[_0x9508('0x32')]=_[_0x9508('0x33')](_0x55f36c['model'],qs['fields'](_0x414534[_0x9508('0x28')][_0x9508('0x34')]));_0x19a984[_0x9508('0x32')]=_0x19a984['attributes']['length']?_0x19a984[_0x9508('0x32')]:_0x55f36c[_0x9508('0x2e')];if(_0x414534[_0x9508('0x28')][_0x9508('0x35')]){_0x19a984[_0x9508('0x36')]=[{'all':!![]}];}_0x19a984=_[_0x9508('0x37')]({},_0x19a984,_0x414534[_0x9508('0x38')]);return db[_0x9508('0x22')][_0x9508('0x39')](_0x19a984)[_0x9508('0x2a')](handleEntityNotFound(_0x24df6,null))['then'](respondWithResult(_0x24df6,null))[_0x9508('0x2b')](handleError(_0x24df6,null));};exports[_0x9508('0x3a')]=function(_0x5d7098,_0x2644ef){return db[_0x9508('0x22')][_0x9508('0x3a')](_0x5d7098[_0x9508('0x3b')],{})[_0x9508('0x2a')](respondWithResult(_0x2644ef,0xc9))[_0x9508('0x2b')](handleError(_0x2644ef,null));};exports[_0x9508('0x1b')]=function(_0x3700f1,_0xfb6676){if(_0x3700f1[_0x9508('0x3b')]['id']){delete _0x3700f1[_0x9508('0x3b')]['id'];}return db['MailInteraction'][_0x9508('0x39')]({'where':{'id':_0x3700f1['params']['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0xfb6676,null))[_0x9508('0x2a')](saveUpdates(_0x3700f1[_0x9508('0x3b')],null))['then'](respondWithResult(_0xfb6676,null))['catch'](handleError(_0xfb6676,null));};exports[_0x9508('0x1c')]=function(_0x1f28f6,_0x1277b1){return db[_0x9508('0x22')]['find']({'where':{'id':_0x1f28f6[_0x9508('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1277b1,null))[_0x9508('0x2a')](removeEntity(_0x1277b1,null))[_0x9508('0x2b')](handleError(_0x1277b1,null));};exports['describe']=function(_0x33e412,_0x37217e){return db['MailInteraction'][_0x9508('0x3c')]()[_0x9508('0x2a')](respondWithResult(_0x37217e,null))[_0x9508('0x2b')](handleError(_0x37217e,null));};exports[_0x9508('0x3d')]=function(_0x4e2561,_0x52701f){return db[_0x9508('0x3e')]['find']({'where':{'id':_0x4e2561[_0x9508('0x2d')]['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0x52701f,null))[_0x9508('0x2a')](function(_0x4215e9){if(_0x4215e9){return _0x4215e9['addMessage'](_0x4e2561['body']['ids'],_[_0x9508('0x3f')](_0x4e2561['body'],[_0x9508('0x40'),'id'])||{});}})['then'](respondWithResult(_0x52701f,null))[_0x9508('0x2b')](handleError(_0x52701f,null));};exports[_0x9508('0x41')]=function(_0x21af4c,_0x464c1a){var _0x5b456a={'raw':![],'where':{}};var _0x152288={};var _0x57b2c={'count':0x0,'rows':[]};return db[_0x9508('0x22')]['findOne']({'where':{'id':_0x21af4c[_0x9508('0x2d')]['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0x464c1a,null))['then'](function(_0x4f865d){if(_0x4f865d){_0x152288['model']=_[_0x9508('0x2f')](db['MailMessage']['rawAttributes']);_0x152288[_0x9508('0x28')]=_[_0x9508('0x2f')](_0x21af4c[_0x9508('0x28')]);_0x152288[_0x9508('0x31')]=_[_0x9508('0x33')](_0x152288[_0x9508('0x2e')],_0x152288['query']);_0x5b456a[_0x9508('0x32')]=_[_0x9508('0x33')](_0x152288[_0x9508('0x2e')],qs['fields'](_0x21af4c[_0x9508('0x28')][_0x9508('0x34')]));_0x5b456a[_0x9508('0x32')]=_0x5b456a[_0x9508('0x32')]['length']?_0x5b456a[_0x9508('0x32')]:_0x152288['model'];if(!_0x21af4c[_0x9508('0x28')][_0x9508('0x42')]('nolimit')){_0x5b456a[_0x9508('0x18')]=qs[_0x9508('0x18')](_0x21af4c['query'][_0x9508('0x18')]);_0x5b456a[_0x9508('0x15')]=qs['offset'](_0x21af4c[_0x9508('0x28')]['offset']);}_0x5b456a[_0x9508('0x43')]=qs['sort'](_0x21af4c[_0x9508('0x28')]['sort']);_0x5b456a['where']=qs['filters'](_['pick'](_0x21af4c[_0x9508('0x28')],_0x152288[_0x9508('0x31')]));_0x5b456a[_0x9508('0x44')][_0x9508('0x45')]=_0x4f865d['id'];if(_0x21af4c[_0x9508('0x28')][_0x9508('0x46')]){_0x5b456a[_0x9508('0x44')]=_[_0x9508('0x37')](_0x5b456a[_0x9508('0x44')],{'$or':_['map'](_0x5b456a[_0x9508('0x32')],function(_0x304232){var _0x3b202f={};_0x3b202f[_0x304232]={'$like':'%'+_0x21af4c[_0x9508('0x28')][_0x9508('0x46')]+'%'};return _0x3b202f;})});}if(_0x21af4c['query']['$gte']){var _0x1873c9=_0x21af4c['query'][_0x9508('0x47')][_0x9508('0x48')](',');var _0x490031={};_0x490031[_0x1873c9[0x0]]={'$gte':moment(_0x1873c9[0x1])[_0x9508('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b456a['where']=_[_0x9508('0x37')](_0x5b456a[_0x9508('0x44')],_0x490031);}_0x5b456a=_['merge']({},_0x5b456a,_0x21af4c[_0x9508('0x38')]);return db[_0x9508('0x3e')][_0x9508('0x17')]({'where':_0x5b456a[_0x9508('0x44')]})[_0x9508('0x2a')](function(_0x40c08d){_0x57b2c[_0x9508('0x17')]=_0x40c08d;if(_0x21af4c[_0x9508('0x28')][_0x9508('0x35')]){_0x5b456a[_0x9508('0x36')]=[{'all':!![]}];}return db[_0x9508('0x3e')][_0x9508('0x26')](_0x5b456a);})[_0x9508('0x2a')](function(_0x2005f0){if(_0x21af4c['query'][_0x9508('0x4a')]===_0x9508('0x4b')){for(var _0x54e1b4=0x0;_0x54e1b4<_0x2005f0[_0x9508('0x4c')];_0x54e1b4++){_0x2005f0[_0x54e1b4]['body']=juice(_0x2005f0[_0x54e1b4]['body']);}}_0x57b2c[_0x9508('0x4d')]=_0x2005f0;return _0x57b2c;});}})[_0x9508('0x2a')](respondWithFilteredResult(_0x464c1a,_0x5b456a))['catch'](handleError(_0x464c1a,null));};exports[_0x9508('0x4e')]=function(_0x198389,_0x553e6b){return db[_0x9508('0x22')][_0x9508('0x39')]({'where':{'id':_0x198389[_0x9508('0x2d')]['id']}})['then'](handleEntityNotFound(_0x553e6b,null))[_0x9508('0x2a')](function(_0x17ffe4){if(_0x17ffe4){return _0x17ffe4[_0x9508('0x4f')](_0x198389[_0x9508('0x3b')][_0x9508('0x40')],_[_0x9508('0x3f')](_0x198389['body'],[_0x9508('0x40'),'id'])||{})[_0x9508('0x50')](function(){return db[_0x9508('0x51')][_0x9508('0x26')]({'attributes':['id','name',_0x9508('0x52')],'where':{'id':_0x198389['body'][_0x9508('0x40')]}});})[_0x9508('0x2a')](function(_0x4a6c43){socket[_0x9508('0x53')](_0x9508('0x54'),{'id':Number(_0x198389['params']['id']),'tags':_0x4a6c43||[]});return{'id':Number(_0x198389[_0x9508('0x2d')]['id']),'tags':_0x4a6c43||[]};});}})[_0x9508('0x2a')](respondWithResult(_0x553e6b,null))[_0x9508('0x2b')](handleError(_0x553e6b,null));};exports[_0x9508('0x55')]=function(_0x5aa42b,_0x1d84e8){return db[_0x9508('0x22')][_0x9508('0x39')]({'where':{'id':_0x5aa42b[_0x9508('0x2d')]['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0x1d84e8,null))[_0x9508('0x2a')](function(_0x67371f){if(_0x67371f){return _0x67371f[_0x9508('0x55')](_0x5aa42b['query'][_0x9508('0x40')]);}})[_0x9508('0x2a')](respondWithStatusCode(_0x1d84e8,null))[_0x9508('0x2b')](handleError(_0x1d84e8,null));};exports['download']=function(_0x2dabf8,_0x5f4cde){var _0x3256e9=moment()['unix']()['toString']();var _0x54f0f3=path[_0x9508('0x56')](config[_0x9508('0x57')],_0x9508('0x58'),'files',_0x9508('0x59'));var _0x2c98c3=path[_0x9508('0x56')](config[_0x9508('0x57')],_0x9508('0x58'),'files','attachments');var _0xd9d83e=path[_0x9508('0x56')](_0x54f0f3,_0x3256e9);var _0x1d3e4d=util[_0x9508('0x49')](_0x9508('0x5a'),_0x2dabf8[_0x9508('0x2d')]['id'],_0x3256e9);var _0xa557a0=path[_0x9508('0x56')](_0x54f0f3,_0x1d3e4d);var _0x3e60d0=[];if(_0x2dabf8[_0x9508('0x28')][_0x9508('0x5b')]){_0x3e60d0[_0x9508('0x5c')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x2618e2=[{'model':db['MailMessage'],'as':_0x9508('0x5d'),'attributes':['id','body','from','to','cc',_0x9508('0x5e'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x9508('0x5f')]('id'),'include':_0x3e60d0}];return db[_0x9508('0x22')][_0x9508('0x39')]({'where':{'id':_0x2dabf8[_0x9508('0x2d')]['id']},'include':_0x2618e2})[_0x9508('0x2a')](handleEntityNotFound(_0x5f4cde,null))[_0x9508('0x2a')](function(_0x222e63){if(_0x222e63&&_0x222e63[_0x9508('0x5d')]){var _0xa3e550=_0x222e63[_0x9508('0x60')]({'plain':!![]});fs[_0x9508('0x61')](_0xd9d83e);return BPromise[_0x9508('0x62')](_0xa3e550[_0x9508('0x5d')],function(_0x445f67,_0x456828){var _0x5710dd={'from':_0x445f67[_0x9508('0x63')],'to':_0x445f67['to'],'subject':_0x445f67['subject'],'html':htmlEntities[_0x9508('0x64')](_0x445f67[_0x9508('0x3b')]),'headers':{'Date':moment(_0x445f67[_0x9508('0x65')])[_0x9508('0x49')](_0x9508('0x66'))},'attachments':[]};if(_0x445f67['cc']){_0x5710dd[_0x9508('0x67')]['Cc']=_0x445f67['cc'];}if(_0x445f67[_0x9508('0x5e')]){_0x5710dd[_0x9508('0x67')][_0x9508('0x68')]=_0x445f67[_0x9508('0x5e')];}return new BPromise(function(_0x2f292b,_0x470f52){if(_0x445f67['Attachments']){for(var _0x2db0af=0x0;_0x2db0af<_0x445f67[_0x9508('0x69')][_0x9508('0x4c')];_0x2db0af++){var _0x4bddc1=_0x445f67['Attachments'][_0x2db0af];var _0x37fb85=path[_0x9508('0x56')](_0x2c98c3,_0x4bddc1[_0x9508('0x6a')]);if(fs[_0x9508('0x6b')](_0x37fb85)){_0x5710dd[_0x9508('0x5b')][_0x9508('0x5c')]({'name':_0x4bddc1[_0x9508('0x1f')],'contentType':_0x4bddc1['type'],'data':fs[_0x9508('0x6c')](_0x37fb85)});}}}emlformat['build'](_0x5710dd,function(_0x5b0b62,_0x4779dd){if(_0x5b0b62)return _0x470f52(_0x5b0b62);fs['writeFileSync'](path[_0x9508('0x56')](_0xd9d83e,util[_0x9508('0x49')]('message%d.eml',_0x456828)),_0x4779dd);return _0x2f292b(_0x4779dd);});});})[_0x9508('0x2a')](function(){return new BPromise(function(_0x5e4a15,_0x2d625a){zipdir(_0xd9d83e,{'saveTo':_0xa557a0},function(_0x5d9dd2,_0x3b0dc3){if(_0x5d9dd2)return _0x2d625a(_0x5d9dd2);return _0x5e4a15(_0x3b0dc3);});})[_0x9508('0x2a')](function(){return new BPromise(function(_0x29471f,_0x21c1b7){rimraf(_0xd9d83e,function(_0x8c3027){if(_0x8c3027)_0x21c1b7(_0x8c3027);return _0x29471f();});});})[_0x9508('0x2a')](function(){return _0x5f4cde[_0x9508('0x6d')](_0xa557a0,_0x1d3e4d,function(_0x3a7c37){if(!_0x3a7c37)fs[_0x9508('0x6e')](_0xa557a0);});});});}else{return _0x5f4cde[_0x9508('0x12')](0xc8);}})['catch'](handleError(_0x5f4cde,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index bce5c95..27a9eb3 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 _0x1d44=['MailMessage','save','remove','getUsers','then','setDataValue','Users','map','emit','catch','hook','exports','events','MailInteraction'];(function(_0x4b62e5,_0xa53820){var _0x27d2c5=function(_0x527fc8){while(--_0x527fc8){_0x4b62e5['push'](_0x4b62e5['shift']());}};_0x27d2c5(++_0xa53820);}(_0x1d44,0x194));var _0x41d4=function(_0x398481,_0x3de964){_0x398481=_0x398481-0x0;var _0x3a4d22=_0x1d44[_0x398481];return _0x3a4d22;};'use strict';var EventEmitter=require(_0x41d4('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x41d4('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x41d4('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x41d4('0x3'),'afterUpdate':'update','afterDestroy':_0x41d4('0x4')};function emitEvent(_0x1a42f9){return function(_0x14e865,_0x546b9c,_0x37ffc6){_0x14e865[_0x41d4('0x5')]({'attributes':['id'],'raw':!![]})[_0x41d4('0x6')](function(_0x2636ef){_0x14e865[_0x41d4('0x7')](_0x41d4('0x8'),_0x2636ef[_0x41d4('0x9')](function(_0x206a70){return{'id':_0x206a70['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x14e865['id'],'direction':'in','read':![]},'raw':!![]});})[_0x41d4('0x6')](function(_0xa29fd7){_0x14e865[_0x41d4('0x7')]('unreadMessages',_0xa29fd7['length']);MailInteractionEvents[_0x41d4('0xa')](_0x1a42f9+':'+_0x14e865['id'],_0x14e865);MailInteractionEvents['emit'](_0x1a42f9,_0x14e865);_0x37ffc6(null);})[_0x41d4('0xb')](_0x37ffc6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x41d4('0xc')](e,emitEvent(event));}}module[_0x41d4('0xd')]=MailInteractionEvents; \ No newline at end of file +var _0xc490=['emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x379021,_0x5f49e0){var _0x5a3431=function(_0x68ca07){while(--_0x68ca07){_0x379021['push'](_0x379021['shift']());}};_0x5a3431(++_0x5f49e0);}(_0xc490,0xf3));var _0x0c49=function(_0x58b4c0,_0xe35dd9){_0x58b4c0=_0x58b4c0-0x0;var _0x14fc22=_0xc490[_0x58b4c0];return _0x14fc22;};'use strict';var EventEmitter=require(_0x0c49('0x0'));var MailInteraction=require(_0x0c49('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x0c49('0x1'))['db'][_0x0c49('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0c49('0x3'),'afterUpdate':_0x0c49('0x4'),'afterDestroy':_0x0c49('0x5')};function emitEvent(_0x16c010){return function(_0x3b8a6c,_0x5e0157,_0x1bb455){_0x3b8a6c[_0x0c49('0x6')]({'attributes':['id'],'raw':!![]})[_0x0c49('0x7')](function(_0x278f8a){_0x3b8a6c[_0x0c49('0x8')]('Users',_0x278f8a[_0x0c49('0x9')](function(_0x48b312){return{'id':_0x48b312['id']};}));return MailMessage[_0x0c49('0xa')]({'where':{'MailInteractionId':_0x3b8a6c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0c49('0x7')](function(_0x1b8826){_0x3b8a6c[_0x0c49('0x8')](_0x0c49('0xb'),_0x1b8826[_0x0c49('0xc')]);MailInteractionEvents[_0x0c49('0xd')](_0x16c010+':'+_0x3b8a6c['id'],_0x3b8a6c);MailInteractionEvents[_0x0c49('0xd')](_0x16c010,_0x3b8a6c);_0x1bb455(null);})['catch'](_0x1bb455(null));};}for(var e in events){if(events[_0x0c49('0xe')](e)){var event=events[e];MailInteraction[_0x0c49('0xf')](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 a9873b6..71e138e 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 _0xac84=['update','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','define','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get'];(function(_0xdfce41,_0x2ce625){var _0x583673=function(_0x3e3953){while(--_0x3e3953){_0xdfce41['push'](_0xdfce41['shift']());}};_0x583673(++_0x2ce625);}(_0xac84,0x161));var _0x4ac8=function(_0x189061,_0x21d774){_0x189061=_0x189061-0x0;var _0x257e15=_0xac84[_0x189061];return _0x257e15;};'use strict';var _=require(_0x4ac8('0x0'));var util=require(_0x4ac8('0x1'));var logger=require(_0x4ac8('0x2'))(_0x4ac8('0x3'));var moment=require(_0x4ac8('0x4'));var BPromise=require(_0x4ac8('0x5'));var rp=require(_0x4ac8('0x6'));var fs=require('fs');var path=require(_0x4ac8('0x7'));var rimraf=require(_0x4ac8('0x8'));var config=require('../../config/environment');var attributes=require(_0x4ac8('0x9'));module['exports']=function(_0xd7307e,_0x2ae683){return _0xd7307e[_0x4ac8('0xa')]('MailInteraction',attributes,{'tableName':_0x4ac8('0xb'),'paranoid':![],'indexes':[{'name':_0x4ac8('0xc'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x569d45,_0x204062,_0x3be010){if(_0x569d45[_0x4ac8('0xd')]){_0x569d45[_0x4ac8('0xe')]=moment()[_0x4ac8('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x569d45[_0x4ac8('0x10')]){_0x569d45['closedAt']=moment()['format'](_0x4ac8('0x11'));}_0x3be010(null,_0x204062);},'beforeUpdate':function(_0x5dc1f6,_0x2ed6d4,_0x462eee){if(_0x5dc1f6[_0x4ac8('0x12')](_0x4ac8('0xd'))){_0x5dc1f6[_0x4ac8('0xe')]=_0x5dc1f6[_0x4ac8('0xd')]?moment()['format'](_0x4ac8('0x11')):null;}if(_0x5dc1f6['changed'](_0x4ac8('0x10'))){_0x5dc1f6[_0x4ac8('0x13')]=moment()['format'](_0x4ac8('0x11'));_0x5dc1f6[_0x4ac8('0xd')]=null;_0x5dc1f6[_0x4ac8('0xe')]=null;}_0x462eee(null,_0x5dc1f6);},'afterUpdate':function(_0x3c07ee,_0x7a1195,_0x40ecef){var _0x3a88b9=_0xd7307e[_0x4ac8('0x14')];var _0x5e965f=_0x3c07ee[_0x4ac8('0x15')]({'plain':!![]});if(_0x5e965f[_0x4ac8('0x10')]){return _0x3a88b9['MailMessage'][_0x4ac8('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x5e965f['id']}})['then'](function(){_0x40ecef();})[_0x4ac8('0x17')](function(_0x44619f){_0x40ecef(_0x44619f);});}else{_0x40ecef();}}},'charset':_0x4ac8('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe5f4=['YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','models','closed','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format'];(function(_0x39b9cd,_0x1ac76a){var _0x441cf4=function(_0x4687b4){while(--_0x4687b4){_0x39b9cd['push'](_0x39b9cd['shift']());}};_0x441cf4(++_0x1ac76a);}(_0xe5f4,0x10e));var _0x4e5f=function(_0x2d0b84,_0x34682d){_0x2d0b84=_0x2d0b84-0x0;var _0x8d0088=_0xe5f4[_0x2d0b84];return _0x8d0088;};'use strict';var _=require(_0x4e5f('0x0'));var util=require(_0x4e5f('0x1'));var logger=require(_0x4e5f('0x2'))(_0x4e5f('0x3'));var moment=require(_0x4e5f('0x4'));var BPromise=require(_0x4e5f('0x5'));var rp=require(_0x4e5f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e5f('0x7'));var config=require(_0x4e5f('0x8'));var attributes=require(_0x4e5f('0x9'));module[_0x4e5f('0xa')]=function(_0x355c05,_0x392eb5){return _0x355c05[_0x4e5f('0xb')]('MailInteraction',attributes,{'tableName':_0x4e5f('0xc'),'paranoid':![],'indexes':[{'name':_0x4e5f('0xd'),'fields':['subject','to'],'type':_0x4e5f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x88afcd,_0x330484,_0x5f0a04){if(_0x88afcd[_0x4e5f('0xf')]){_0x88afcd[_0x4e5f('0x10')]=moment()[_0x4e5f('0x11')](_0x4e5f('0x12'));}if(_0x88afcd['closed']){_0x88afcd[_0x4e5f('0x13')]=moment()[_0x4e5f('0x11')](_0x4e5f('0x12'));}_0x5f0a04(null,_0x330484);},'beforeUpdate':function(_0x5a974e,_0x2ea7a5,_0x314894){if(_0x5a974e[_0x4e5f('0x14')](_0x4e5f('0xf'))){_0x5a974e[_0x4e5f('0x10')]=_0x5a974e['substatus']?moment()[_0x4e5f('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5a974e[_0x4e5f('0x14')]('closed')){_0x5a974e['closedAt']=moment()[_0x4e5f('0x11')](_0x4e5f('0x12'));_0x5a974e[_0x4e5f('0xf')]=null;_0x5a974e['substatusAt']=null;}_0x314894(null,_0x5a974e);},'afterUpdate':function(_0x4820f1,_0x43af5a,_0x32a1e5){var _0x4e2cc6=_0x355c05[_0x4e5f('0x15')];var _0x5c5cc7=_0x4820f1['get']({'plain':!![]});if(_0x5c5cc7[_0x4e5f('0x16')]){return _0x4e2cc6['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x5c5cc7['id']}})[_0x4e5f('0x17')](function(){_0x32a1e5();})['catch'](function(_0x3ec219){_0x32a1e5(_0x3ec219);});}else{_0x32a1e5();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5fee7fa..3955204 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 _0xf404=['UpdateMailInteraction','catch','AddTagsToMailInteraction','find','addTags','omit','ids','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','MailInteraction','update','body','options','where','limit','then'];(function(_0x5fc402,_0xc2613){var _0x59d9f9=function(_0x20f5ef){while(--_0x20f5ef){_0x5fc402['push'](_0x5fc402['shift']());}};_0x59d9f9(++_0xc2613);}(_0xf404,0x120));var _0x4f40=function(_0x3f4d3d,_0x3a33a7){_0x3f4d3d=_0x3f4d3d-0x0;var _0x3a510d=_0xf404[_0x3f4d3d];return _0x3a510d;};'use strict';var _=require(_0x4f40('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f40('0x1'));var rs=require(_0x4f40('0x2'));var fs=require('fs');var Redis=require(_0x4f40('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f40('0x4'));var logger=require('../../config/logger')(_0x4f40('0x5'));var config=require('../../config/environment');var jayson=require(_0x4f40('0x6'));var client=jayson['client'][_0x4f40('0x7')]({'port':0x232a});config[_0x4f40('0x8')]=_[_0x4f40('0x9')](config[_0x4f40('0x8')],{'host':_0x4f40('0xa'),'port':0x18eb});var socket=require(_0x4f40('0xb'))(new Redis(config[_0x4f40('0x8')]));require(_0x4f40('0xc'))[_0x4f40('0xd')](socket);function respondWithRpcPromise(_0x18caa9,_0x2ff16d,_0x28f06a){return new BPromise(function(_0x51a98f,_0x400399){return client[_0x4f40('0xe')](_0x18caa9,_0x28f06a)['then'](function(_0x5b2d9b){logger['info'](_0x4f40('0xf'),_0x2ff16d,_0x4f40('0x10'));logger[_0x4f40('0x11')](_0x4f40('0x12'),_0x2ff16d,_0x4f40('0x10'),JSON[_0x4f40('0x13')](_0x5b2d9b));if(_0x5b2d9b[_0x4f40('0x14')]){if(_0x5b2d9b[_0x4f40('0x14')][_0x4f40('0x15')]===0x1f4){logger[_0x4f40('0x14')](_0x4f40('0xf'),_0x2ff16d,_0x5b2d9b[_0x4f40('0x14')][_0x4f40('0x16')]);return _0x400399(_0x5b2d9b[_0x4f40('0x14')]['message']);}logger[_0x4f40('0x14')](_0x4f40('0xf'),_0x2ff16d,_0x5b2d9b['error'][_0x4f40('0x16')]);return _0x51a98f(_0x5b2d9b[_0x4f40('0x14')]['message']);}else{logger[_0x4f40('0x17')](_0x4f40('0xf'),_0x2ff16d,_0x4f40('0x10'));_0x51a98f(_0x5b2d9b[_0x4f40('0x18')][_0x4f40('0x16')]);}})['catch'](function(_0x762165){logger[_0x4f40('0x14')](_0x4f40('0xf'),_0x2ff16d,_0x762165);_0x400399(_0x762165);});});}exports['UpdateMailInteraction']=function(_0x178ee2){var _0x565f4c=this;return new Promise(function(_0x5391ff,_0x4809c8){return db[_0x4f40('0x19')][_0x4f40('0x1a')](_0x178ee2[_0x4f40('0x1b')],{'raw':_0x178ee2[_0x4f40('0x1c')]?_0x178ee2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178ee2[_0x4f40('0x1c')]?_0x178ee2['options'][_0x4f40('0x1d')]||null:null,'attributes':_0x178ee2[_0x4f40('0x1c')]?_0x178ee2['options']['attributes']||null:null,'limit':_0x178ee2[_0x4f40('0x1c')]?_0x178ee2['options'][_0x4f40('0x1e')]||null:null})[_0x4f40('0x1f')](function(_0x15b092){logger[_0x4f40('0x17')](_0x4f40('0x20'),_0x178ee2);logger[_0x4f40('0x11')]('UpdateMailInteraction',_0x178ee2,JSON[_0x4f40('0x13')](_0x15b092));_0x5391ff(_0x15b092);})[_0x4f40('0x21')](function(_0x1ca942){logger[_0x4f40('0x14')](_0x4f40('0x20'),_0x1ca942[_0x4f40('0x16')],_0x178ee2);_0x4809c8(_0x565f4c['error'](0x1f4,_0x1ca942[_0x4f40('0x16')]));});});};exports[_0x4f40('0x22')]=function(_0x193f02){return new Promise(function(_0x21ebe3,_0x1a06c4){return db['MailInteraction'][_0x4f40('0x23')]({'where':_0x193f02[_0x4f40('0x1c')]?_0x193f02[_0x4f40('0x1c')][_0x4f40('0x1d')]||null:null})['then'](function(_0x1245e5){if(_0x1245e5){return _0x1245e5[_0x4f40('0x24')](_0x193f02[_0x4f40('0x1b')]['ids'],_[_0x4f40('0x25')](_0x193f02[_0x4f40('0x1b')],[_0x4f40('0x26'),'id'])||{});}})['spread'](function(_0xc8b8d0){logger[_0x4f40('0x17')](_0x4f40('0x27'),_0x193f02);logger['debug']('AddTags',_0x193f02,JSON[_0x4f40('0x13')](_0xc8b8d0));_0x21ebe3(_0xc8b8d0);})[_0x4f40('0x21')](function(_0xec1c43){logger[_0x4f40('0x14')](_0x4f40('0x27'),_0xec1c43['message'],_0x193f02);_0x1a06c4(_this[_0x4f40('0x14')](0x1f4,_0xec1c43['message']));});});}; \ No newline at end of file +var _0xaa3f=['MailInteraction,\x20%s,\x20%s','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46cf0d,_0x115e3a){var _0x531d37=function(_0x1b0281){while(--_0x1b0281){_0x46cf0d['push'](_0x46cf0d['shift']());}};_0x531d37(++_0x115e3a);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x307fc9,_0x46c299){_0x307fc9=_0x307fc9-0x0;var _0x2a090d=_0xaa3f[_0x307fc9];return _0x2a090d;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var BPromise=require(_0xfaa3('0x3'));var rs=require(_0xfaa3('0x4'));var fs=require('fs');var Redis=require(_0xfaa3('0x5'));var db=require(_0xfaa3('0x6'))['db'];var utils=require(_0xfaa3('0x7'));var logger=require(_0xfaa3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfaa3('0x9'));var client=jayson['client'][_0xfaa3('0xa')]({'port':0x232a});config[_0xfaa3('0xb')]=_[_0xfaa3('0xc')](config[_0xfaa3('0xb')],{'host':_0xfaa3('0xd'),'port':0x18eb});var socket=require(_0xfaa3('0xe'))(new Redis(config[_0xfaa3('0xb')]));require('./mailInteraction.socket')[_0xfaa3('0xf')](socket);function respondWithRpcPromise(_0x28de66,_0x49380c,_0x5ca0da){return new BPromise(function(_0x44d88e,_0xce3b1f){return client[_0xfaa3('0x10')](_0x28de66,_0x5ca0da)[_0xfaa3('0x11')](function(_0x23e4b6){logger[_0xfaa3('0x12')]('MailInteraction,\x20%s,\x20%s',_0x49380c,_0xfaa3('0x13'));logger['debug'](_0xfaa3('0x14'),_0x49380c,_0xfaa3('0x13'),JSON[_0xfaa3('0x15')](_0x23e4b6));if(_0x23e4b6['error']){if(_0x23e4b6[_0xfaa3('0x16')]['code']===0x1f4){logger[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x49380c,_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);return _0xce3b1f(_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x49380c,_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);return _0x44d88e(_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x49380c,'request\x20sent');_0x44d88e(_0x23e4b6['result']['message']);}})[_0xfaa3('0x19')](function(_0x5cc884){logger[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x49380c,_0x5cc884);_0xce3b1f(_0x5cc884);});});}exports[_0xfaa3('0x1a')]=function(_0x34b276){var _0x1c32dd=this;return new Promise(function(_0x310b0d,_0x1dd053){return db[_0xfaa3('0x1b')][_0xfaa3('0x1c')](_0x34b276[_0xfaa3('0x1d')],{'raw':_0x34b276['options']?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')]['where']||null:null,'attributes':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x20')]||null:null,'limit':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x21')]||null:null})[_0xfaa3('0x11')](function(_0x11841c){logger['info'](_0xfaa3('0x1a'),_0x34b276);logger[_0xfaa3('0x22')](_0xfaa3('0x1a'),_0x34b276,JSON[_0xfaa3('0x15')](_0x11841c));_0x310b0d(_0x11841c);})[_0xfaa3('0x19')](function(_0xf83bbe){logger[_0xfaa3('0x16')](_0xfaa3('0x1a'),_0xf83bbe[_0xfaa3('0x18')],_0x34b276);_0x1dd053(_0x1c32dd[_0xfaa3('0x16')](0x1f4,_0xf83bbe[_0xfaa3('0x18')]));});});};exports[_0xfaa3('0x23')]=function(_0x18bd3e){return new Promise(function(_0x1bc202,_0x2d7c43){return db['MailInteraction'][_0xfaa3('0x24')]({'where':_0x18bd3e[_0xfaa3('0x1e')]?_0x18bd3e[_0xfaa3('0x1e')]['where']||null:null})[_0xfaa3('0x11')](function(_0x50fb9f){if(_0x50fb9f){return _0x50fb9f[_0xfaa3('0x25')](_0x18bd3e['body'][_0xfaa3('0x26')],_[_0xfaa3('0x27')](_0x18bd3e[_0xfaa3('0x1d')],[_0xfaa3('0x26'),'id'])||{});}})[_0xfaa3('0x28')](function(_0x33ae08){logger[_0xfaa3('0x12')](_0xfaa3('0x29'),_0x18bd3e);logger['debug'](_0xfaa3('0x29'),_0x18bd3e,JSON[_0xfaa3('0x15')](_0x33ae08));_0x1bc202(_0x33ae08);})[_0xfaa3('0x19')](function(_0x174f78){logger[_0xfaa3('0x16')](_0xfaa3('0x29'),_0x174f78[_0xfaa3('0x18')],_0x18bd3e);_0x2d7c43(_this[_0xfaa3('0x16')](0x1f4,_0x174f78[_0xfaa3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8cb2d27..d878913 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 _0x0acd=['register','mailInteraction:','./mailInteraction.events','save','emit'];(function(_0x2344ac,_0x1362f6){var _0x59b3ec=function(_0x5407d1){while(--_0x5407d1){_0x2344ac['push'](_0x2344ac['shift']());}};_0x59b3ec(++_0x1362f6);}(_0x0acd,0x106));var _0xd0ac=function(_0x5c119b,_0x319e4e){_0x5c119b=_0x5c119b-0x0;var _0x208264=_0x0acd[_0x5c119b];return _0x208264;};'use strict';var MailInteractionEvents=require(_0xd0ac('0x0'));var events=[_0xd0ac('0x1'),'remove','update'];function createListener(_0xe0b895,_0x174c85){return function(_0x1c5bdc){_0x174c85[_0xd0ac('0x2')](_0xe0b895,_0x1c5bdc);};}function removeListener(_0x5c11d8,_0x51d21f){return function(){MailInteractionEvents['removeListener'](_0x5c11d8,_0x51d21f);};}exports[_0xd0ac('0x3')]=function(_0x4a326c){for(var _0x5d6d1c=0x0,_0x9e8afd=events['length'];_0x5d6d1c<_0x9e8afd;_0x5d6d1c++){var _0x5dc405=events[_0x5d6d1c];var _0x1c8f9=createListener(_0xd0ac('0x4')+_0x5dc405,_0x4a326c);MailInteractionEvents['on'](_0x5dc405,_0x1c8f9);}}; \ No newline at end of file +var _0x2758=['update','register','length','./mailInteraction.events','save','remove'];(function(_0x511159,_0x882b97){var _0x3b01ff=function(_0x41b265){while(--_0x41b265){_0x511159['push'](_0x511159['shift']());}};_0x3b01ff(++_0x882b97);}(_0x2758,0x1bf));var _0x8275=function(_0x3b5587,_0x22a6f4){_0x3b5587=_0x3b5587-0x0;var _0x3fbb62=_0x2758[_0x3b5587];return _0x3fbb62;};'use strict';var MailInteractionEvents=require(_0x8275('0x0'));var events=[_0x8275('0x1'),_0x8275('0x2'),_0x8275('0x3')];function createListener(_0x56f85c,_0x4cace3){return function(_0x3f69e3){_0x4cace3['emit'](_0x56f85c,_0x3f69e3);};}function removeListener(_0x235838,_0x4cecd4){return function(){MailInteractionEvents['removeListener'](_0x235838,_0x4cecd4);};}exports[_0x8275('0x4')]=function(_0x10a061){for(var _0x34d6f4=0x0,_0x2146b3=events[_0x8275('0x5')];_0x34d6f4<_0x2146b3;_0x34d6f4++){var _0x17bf4c=events[_0x34d6f4];var _0x35b457=createListener('mailInteraction:'+_0x17bf4c,_0x10a061);MailInteractionEvents['on'](_0x17bf4c,_0x35b457);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 56c6616..e92ba7a 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 _0xbb58=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','post','tracked','mailmessage:create','create','update','put','/:id/accept','/:id/reject','delete','destroy'];(function(_0x272cd3,_0xdd92e8){var _0x9317a1=function(_0x44c5eb){while(--_0x44c5eb){_0x272cd3['push'](_0x272cd3['shift']());}};_0x9317a1(++_0xdd92e8);}(_0xbb58,0x17b));var _0x8bb5=function(_0x2106b9,_0x8b2d23){_0x2106b9=_0x2106b9-0x0;var _0x1affb3=_0xbb58[_0x2106b9];return _0x1affb3;};'use strict';var multer=require('multer');var util=require(_0x8bb5('0x0'));var path=require(_0x8bb5('0x1'));var timeout=require(_0x8bb5('0x2'));var express=require(_0x8bb5('0x3'));var router=express[_0x8bb5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8bb5('0x5'));var interaction=require(_0x8bb5('0x6'));var config=require(_0x8bb5('0x7'));var controller=require(_0x8bb5('0x8'));router[_0x8bb5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8bb5('0x9')](_0x8bb5('0xa'),auth['isAuthenticated'](),controller[_0x8bb5('0xb')]);router[_0x8bb5('0x9')](_0x8bb5('0xc'),auth[_0x8bb5('0xd')](),controller[_0x8bb5('0xe')]);router['get'](_0x8bb5('0xf'),auth[_0x8bb5('0xd')](),controller['download']);router[_0x8bb5('0x10')]('/',auth[_0x8bb5('0xd')](),interaction[_0x8bb5('0x11')]('mail',_0x8bb5('0x12')),controller[_0x8bb5('0x13')]);router['put'](_0x8bb5('0xc'),auth[_0x8bb5('0xd')](),controller[_0x8bb5('0x14')]);router[_0x8bb5('0x15')](_0x8bb5('0x16'),auth[_0x8bb5('0xd')](),controller['accept']);router['put'](_0x8bb5('0x17'),auth[_0x8bb5('0xd')](),controller['reject']);router[_0x8bb5('0x18')](_0x8bb5('0xc'),auth[_0x8bb5('0xd')](),controller[_0x8bb5('0x19')]);module[_0x8bb5('0x1a')]=router; \ No newline at end of file +var _0xb13f=['../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','mail','create','update','put','/:id/accept','accept','reject','delete','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb13f,0x1de));var _0xfb13=function(_0x3fb5ad,_0x398b8a){_0x3fb5ad=_0x3fb5ad-0x0;var _0x434c20=_0xb13f[_0x3fb5ad];return _0x434c20;};'use strict';var multer=require(_0xfb13('0x0'));var util=require(_0xfb13('0x1'));var path=require('path');var timeout=require(_0xfb13('0x2'));var express=require('express');var router=express[_0xfb13('0x3')]();var fs_extra=require(_0xfb13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfb13('0x5'));var config=require('../../config/environment');var controller=require(_0xfb13('0x6'));router[_0xfb13('0x7')]('/',auth[_0xfb13('0x8')](),controller[_0xfb13('0x9')]);router[_0xfb13('0x7')](_0xfb13('0xa'),auth[_0xfb13('0x8')](),controller[_0xfb13('0xb')]);router[_0xfb13('0x7')](_0xfb13('0xc'),auth[_0xfb13('0x8')](),controller['show']);router[_0xfb13('0x7')]('/:id/download',auth[_0xfb13('0x8')](),controller['download']);router[_0xfb13('0xd')]('/',auth[_0xfb13('0x8')](),interaction['tracked'](_0xfb13('0xe'),'mailmessage:create'),controller[_0xfb13('0xf')]);router['put'](_0xfb13('0xc'),auth['isAuthenticated'](),controller[_0xfb13('0x10')]);router[_0xfb13('0x11')](_0xfb13('0x12'),auth['isAuthenticated'](),controller[_0xfb13('0x13')]);router[_0xfb13('0x11')]('/:id/reject',auth[_0xfb13('0x8')](),controller[_0xfb13('0x14')]);router[_0xfb13('0x15')]('/:id',auth[_0xfb13('0x8')](),controller['destroy']);module[_0xfb13('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 4246ae6..678c4d7 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 _0x54d4=['sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','Chat'];(function(_0x465a23,_0x45eb8c){var _0x5d7ea9=function(_0x195930){while(--_0x195930){_0x465a23['push'](_0x465a23['shift']());}};_0x5d7ea9(++_0x45eb8c);}(_0x54d4,0x113));var _0x454d=function(_0x56d5b9,_0x5345ca){_0x56d5b9=_0x56d5b9-0x0;var _0x4501ee=_0x54d4[_0x56d5b9];return _0x4501ee;};'use strict';var Sequelize=require(_0x454d('0x0'));var _=require(_0x454d('0x1'));module['exports']={'body':{'type':Sequelize[_0x454d('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x454d('0x2')](_0x454d('0x3'))},'read':{'type':Sequelize[_0x454d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x454d('0x5')]('in','out'),'defaultValue':_0x454d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x454d('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x454d('0x2')](_0x454d('0x8'))},'cc':{'type':Sequelize[_0x454d('0x2')]('long')},'bcc':{'type':Sequelize[_0x454d('0x2')]('long')},'subject':{'type':Sequelize[_0x454d('0x2')]},'sentAt':{'type':Sequelize[_0x454d('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x454d('0x2')](_0x454d('0x8'))},'originCc':{'type':Sequelize[_0x454d('0x2')](_0x454d('0x8'))},'originChannel':{'type':Sequelize[_0x454d('0x5')]('Email',_0x454d('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x6dfd=['Email','exports','long','TEXT','BOOLEAN','ENUM','STRING','INTEGER','Chat'];(function(_0x8c0385,_0x465f02){var _0x1301ba=function(_0x435cd3){while(--_0x435cd3){_0x8c0385['push'](_0x8c0385['shift']());}};_0x1301ba(++_0x465f02);}(_0x6dfd,0x88));var _0xd6df=function(_0x436b41,_0x26e3d3){_0x436b41=_0x436b41-0x0;var _0xfaa7d0=_0x6dfd[_0x436b41];return _0xfaa7d0;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xd6df('0x0')]={'body':{'type':Sequelize['TEXT'](_0xd6df('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd6df('0x2')]('medium')},'read':{'type':Sequelize[_0xd6df('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6df('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd6df('0x5')](0x1fe)},'from':{'type':Sequelize[_0xd6df('0x5')]},'to':{'type':Sequelize[_0xd6df('0x2')](_0xd6df('0x1'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0xd6df('0x2')](_0xd6df('0x1'))},'subject':{'type':Sequelize[_0xd6df('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xd6df('0x6')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd6df('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xd6df('0x2')]('long')},'originCc':{'type':Sequelize[_0xd6df('0x2')]('long')},'originChannel':{'type':Sequelize[_0xd6df('0x4')]('Email',_0xd6df('0x7')),'defaultValue':_0xd6df('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 105305d..08cd4e7 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 _0x7c71=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','find','body','describe','create','direction','out','split','findOne','MailAccountId','CmList','updatedAt','DESC','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','List','Contacts','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','channel','motionChannel','fromString','EventManager','reject','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','sequelize','contact','internal','SIP/%s','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','createdAt','subject','headers','Bcc','Attachments','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','model','keys'];(function(_0x2e403d,_0x5674a3){var _0x5e5154=function(_0x185a1f){while(--_0x185a1f){_0x2e403d['push'](_0x2e403d['shift']());}};_0x5e5154(++_0x5674a3);}(_0x7c71,0x68));var _0x17c7=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x7c71[_0x4c0622];return _0x1799d8;};'use strict';var emlformat=require(_0x17c7('0x0'));var moment=require('moment');var BPromise=require(_0x17c7('0x1'));var util=require(_0x17c7('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x17c7('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x17c7('0x4'));var qs=require(_0x17c7('0x5'));var logger=require(_0x17c7('0x6'))(_0x17c7('0x7'));var interaction_log=require(_0x17c7('0x6'))(_0x17c7('0x8'));var config=require(_0x17c7('0x9'));var db=require(_0x17c7('0xa'))['db'];config['redis']=_[_0x17c7('0xb')](config[_0x17c7('0xc')],{'host':_0x17c7('0xd'),'port':0x18eb});var socket=require(_0x17c7('0xe'))(new Redis(config[_0x17c7('0xc')]));var htmlEntities=require('html-entities');require(_0x17c7('0xf'))['register'](socket);var jayson=require(_0x17c7('0x10'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x17c7('0x11')][_0x17c7('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x3d75dd,_0x13893e,_0x437994,_0x345be0){return new BPromise(function(_0x487604,_0x2d5279){var _0x363e93=_0x345be0||client;return _0x363e93[_0x17c7('0x13')](_0x3d75dd,_0x437994)[_0x17c7('0x14')](function(_0x148e15){logger[_0x17c7('0x15')](_0x17c7('0x16'),_0x13893e,_0x17c7('0x17'));logger['debug'](_0x17c7('0x18'),_0x13893e,_0x17c7('0x17'),JSON[_0x17c7('0x19')](_0x148e15));if(_0x148e15[_0x17c7('0x1a')]){if(_0x148e15['error'][_0x17c7('0x1b')]===0x1f4){logger['error'](_0x17c7('0x16'),_0x13893e,_0x148e15[_0x17c7('0x1a')][_0x17c7('0x1c')]);return _0x2d5279(_0x148e15[_0x17c7('0x1a')][_0x17c7('0x1c')]);}logger['error'](_0x17c7('0x16'),_0x13893e,_0x148e15[_0x17c7('0x1a')]['message']);return _0x487604(_0x148e15[_0x17c7('0x1a')][_0x17c7('0x1c')]);}else{logger[_0x17c7('0x15')](_0x17c7('0x16'),_0x13893e,'request\x20sent');_0x487604(_0x148e15[_0x17c7('0x1d')]['message']);}})[_0x17c7('0x1e')](function(_0x2ab3bc){logger['error'](_0x17c7('0x16'),_0x13893e,_0x2ab3bc);_0x2d5279(_0x2ab3bc);});});}function respondWithResult(_0x21214e,_0x7c6a92){_0x7c6a92=_0x7c6a92||0xc8;return function(_0x8379a){if(_0x8379a){return _0x21214e[_0x17c7('0x1f')](_0x7c6a92)[_0x17c7('0x20')](_0x8379a);}};}function respondWithFilteredResult(_0x4e504b,_0x19bcd7){return function(_0x2d48c1){if(_0x2d48c1){var _0x5d21a9=typeof _0x19bcd7[_0x17c7('0x21')]===_0x17c7('0x22')&&typeof _0x19bcd7[_0x17c7('0x23')]===_0x17c7('0x22');var _0x5d56b2=_0x2d48c1[_0x17c7('0x24')];var _0x34497e=_0x5d21a9?0x0:_0x19bcd7[_0x17c7('0x21')];var _0x4adc86=_0x5d21a9?_0x2d48c1[_0x17c7('0x24')]:_0x19bcd7[_0x17c7('0x21')]+_0x19bcd7['limit'];var _0x36cf57;if(_0x4adc86>=_0x5d56b2){_0x4adc86=_0x5d56b2;_0x36cf57=0xc8;}else{_0x36cf57=0xce;}_0x4e504b[_0x17c7('0x1f')](_0x36cf57);return _0x4e504b[_0x17c7('0x25')](_0x17c7('0x26'),_0x34497e+'-'+_0x4adc86+'/'+_0x5d56b2)['json'](_0x2d48c1);}return null;};}function saveUpdates(_0x2a2100){return function(_0x50750c){if(_0x50750c){return _0x50750c[_0x17c7('0x27')](_0x2a2100)[_0x17c7('0x14')](function(_0x4def8){return _0x4def8;});}return null;};}function removeEntity(_0x364902){return function(_0x5be4d2){if(_0x5be4d2){return _0x5be4d2[_0x17c7('0x28')]()[_0x17c7('0x14')](function(){_0x364902[_0x17c7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x327d64){return function(_0x4fe136){if(!_0x4fe136){_0x327d64[_0x17c7('0x29')](0x194);}return _0x4fe136;};}function handleError(_0xccf95d,_0x14d015){_0x14d015=_0x14d015||0x1f4;return function(_0x27fe4b){logger[_0x17c7('0x1a')](_0x27fe4b[_0x17c7('0x2a')]);if(_0x27fe4b[_0x17c7('0x2b')]){delete _0x27fe4b[_0x17c7('0x2b')];}_0xccf95d[_0x17c7('0x1f')](_0x14d015)[_0x17c7('0x2c')](_0x27fe4b);};}exports[_0x17c7('0x2d')]=function(_0x375a50,_0x2daebf){var _0x5d59c0={},_0x47c978={},_0xdcf06a={'count':0x0,'rows':[]};var _0x56baf1=_[_0x17c7('0x2e')](db[_0x17c7('0x2f')][_0x17c7('0x30')],function(_0x35c914){return{'name':_0x35c914[_0x17c7('0x31')],'type':_0x35c914['type']['key']};});_0x47c978[_0x17c7('0x32')]=_[_0x17c7('0x2e')](_0x56baf1,'name');_0x47c978['query']=_[_0x17c7('0x33')](_0x375a50[_0x17c7('0x34')]);_0x47c978['filters']=_[_0x17c7('0x35')](_0x47c978[_0x17c7('0x32')],_0x47c978[_0x17c7('0x34')]);_0x5d59c0[_0x17c7('0x36')]=_[_0x17c7('0x35')](_0x47c978[_0x17c7('0x32')],qs['fields'](_0x375a50['query'][_0x17c7('0x37')]));_0x5d59c0['attributes']=_0x5d59c0['attributes'][_0x17c7('0x38')]?_0x5d59c0[_0x17c7('0x36')]:_0x47c978[_0x17c7('0x32')];if(!_0x375a50['query'][_0x17c7('0x39')](_0x17c7('0x3a'))){_0x5d59c0['limit']=qs['limit'](_0x375a50[_0x17c7('0x34')]['limit']);_0x5d59c0[_0x17c7('0x21')]=qs[_0x17c7('0x21')](_0x375a50[_0x17c7('0x34')][_0x17c7('0x21')]);}_0x5d59c0[_0x17c7('0x3b')]=qs['sort'](_0x375a50[_0x17c7('0x34')][_0x17c7('0x3c')]);_0x5d59c0[_0x17c7('0x3d')]=qs[_0x17c7('0x3e')](_[_0x17c7('0x3f')](_0x375a50[_0x17c7('0x34')],_0x47c978['filters']),_0x56baf1);if(_0x375a50[_0x17c7('0x34')][_0x17c7('0x40')]){_0x5d59c0[_0x17c7('0x3d')]=_[_0x17c7('0x41')](_0x5d59c0[_0x17c7('0x3d')],{'$or':_['map'](_0x56baf1,function(_0x4b5aae){if(_0x4b5aae['type']!==_0x17c7('0x42')){var _0x57ea6f={};_0x57ea6f[_0x4b5aae[_0x17c7('0x2b')]]={'$like':'%'+_0x375a50[_0x17c7('0x34')][_0x17c7('0x40')]+'%'};return _0x57ea6f;}})});}_0x5d59c0=_[_0x17c7('0x41')]({},_0x5d59c0,_0x375a50['options']);var _0x63e115={'where':_0x5d59c0[_0x17c7('0x3d')]};return db[_0x17c7('0x2f')][_0x17c7('0x24')](_0x63e115)[_0x17c7('0x14')](function(_0x1610a6){_0xdcf06a[_0x17c7('0x24')]=_0x1610a6;if(_0x375a50[_0x17c7('0x34')][_0x17c7('0x43')]){_0x5d59c0[_0x17c7('0x44')]=[{'all':!![]}];}return db[_0x17c7('0x2f')][_0x17c7('0x45')](_0x5d59c0);})[_0x17c7('0x14')](function(_0x270a87){_0xdcf06a[_0x17c7('0x46')]=_0x270a87;return _0xdcf06a;})[_0x17c7('0x14')](respondWithFilteredResult(_0x2daebf,_0x5d59c0))['catch'](handleError(_0x2daebf,null));};exports['show']=function(_0x15364b,_0x519a80){var _0x36ac78={'raw':!![],'where':{'id':_0x15364b[_0x17c7('0x47')]['id']}},_0x31b8aa={};_0x31b8aa['model']=_['keys'](db[_0x17c7('0x2f')][_0x17c7('0x30')]);_0x31b8aa['query']=_[_0x17c7('0x33')](_0x15364b[_0x17c7('0x34')]);_0x31b8aa[_0x17c7('0x3e')]=_['intersection'](_0x31b8aa['model'],_0x31b8aa[_0x17c7('0x34')]);_0x36ac78['attributes']=_[_0x17c7('0x35')](_0x31b8aa[_0x17c7('0x32')],qs[_0x17c7('0x37')](_0x15364b[_0x17c7('0x34')][_0x17c7('0x37')]));_0x36ac78[_0x17c7('0x36')]=_0x36ac78['attributes'][_0x17c7('0x38')]?_0x36ac78[_0x17c7('0x36')]:_0x31b8aa[_0x17c7('0x32')];if(_0x15364b[_0x17c7('0x34')][_0x17c7('0x43')]){_0x36ac78['include']=[{'all':!![]}];}_0x36ac78=_[_0x17c7('0x41')]({},_0x36ac78,_0x15364b['options']);return db[_0x17c7('0x2f')][_0x17c7('0x48')](_0x36ac78)[_0x17c7('0x14')](handleEntityNotFound(_0x519a80,null))[_0x17c7('0x14')](respondWithResult(_0x519a80,null))[_0x17c7('0x1e')](handleError(_0x519a80,null));};exports['update']=function(_0x23c197,_0x436eea){if(_0x23c197['body']['id']){delete _0x23c197[_0x17c7('0x49')]['id'];}return db['MailMessage'][_0x17c7('0x48')]({'where':{'id':_0x23c197[_0x17c7('0x47')]['id']}})[_0x17c7('0x14')](handleEntityNotFound(_0x436eea,null))[_0x17c7('0x14')](saveUpdates(_0x23c197['body'],null))['then'](respondWithResult(_0x436eea,null))['catch'](handleError(_0x436eea,null));};exports['destroy']=function(_0x3cfc77,_0x4c9813){return db[_0x17c7('0x2f')][_0x17c7('0x48')]({'where':{'id':_0x3cfc77[_0x17c7('0x47')]['id']}})[_0x17c7('0x14')](handleEntityNotFound(_0x4c9813,null))['then'](removeEntity(_0x4c9813,null))[_0x17c7('0x1e')](handleError(_0x4c9813,null));};exports[_0x17c7('0x4a')]=function(_0x45980f,_0x7d58a8){return db[_0x17c7('0x2f')][_0x17c7('0x4a')]()[_0x17c7('0x14')](respondWithResult(_0x7d58a8,null))[_0x17c7('0x1e')](handleError(_0x7d58a8,null));};exports[_0x17c7('0x4b')]=function(_0x1c6267,_0x4e3171){return db['MailMessage'][_0x17c7('0x4b')](_0x1c6267['body'])[_0x17c7('0x14')](function(_0x160c50){if(_0x160c50){if(_0x160c50[_0x17c7('0x4c')]===_0x17c7('0x4d')&&!_0x160c50['secret']){var _0x3b94d0,_0x397f4f,_0x2e8afc;if(_0x1c6267['body']['to']){_0x397f4f=_0x1c6267[_0x17c7('0x49')]['to'][_0x17c7('0x4e')](',')[0x0];}return db['MailAccount'][_0x17c7('0x4f')]({'where':{'id':_0x160c50[_0x17c7('0x50')]},'include':[{'model':db[_0x17c7('0x51')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x397f4f},'limit':0x1,'order':[[_0x17c7('0x52'),_0x17c7('0x53')]]}]},{'model':db['MailServerOut'],'as':_0x17c7('0x54'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x17c7('0x14')](function(_0x2c56f0){_0x3b94d0=_0x2c56f0;if(!_0x3b94d0||!_0x3b94d0[_0x17c7('0x54')])return;var _0x24d090=_0x3b94d0[_0x17c7('0x55')]();if(_0x1c6267['body']['attachments']&&_0x1c6267[_0x17c7('0x49')][_0x17c7('0x56')][_0x17c7('0x38')]){for(var _0x2e0913=0x0;_0x2e0913<_0x1c6267['body'][_0x17c7('0x56')][_0x17c7('0x38')];_0x2e0913+=0x1){_0x1c6267[_0x17c7('0x49')][_0x17c7('0x56')][_0x2e0913]={'filename':_0x1c6267[_0x17c7('0x49')][_0x17c7('0x56')][_0x2e0913][_0x17c7('0x2b')],'path':path[_0x17c7('0x57')](config['root'],_0x17c7('0x58'),_0x1c6267[_0x17c7('0x49')][_0x17c7('0x56')][_0x2e0913][_0x17c7('0x59')])};}}_0x2e8afc={'account':_0x24d090,'message':_0x1c6267[_0x17c7('0x49')]};return;})[_0x17c7('0x14')](function(){if(_0x3b94d0[_0x17c7('0x5a')]){if(_0x3b94d0[_0x17c7('0x5a')][_0x17c7('0x5b')]['length']){return _0x3b94d0['List'][_0x17c7('0x5b')][0x0];}else{return db[_0x17c7('0x5c')][_0x17c7('0x4b')](_['defaults'](_0x1c6267[_0x17c7('0x49')],{'firstName':_0x1c6267[_0x17c7('0x49')]['to'],'email':_0x1c6267[_0x17c7('0x49')]['to'],'phone':_0x1c6267[_0x17c7('0x49')]['to'],'ListId':_0x3b94d0[_0x17c7('0x5d')]}));}}else{throw new Error(_0x17c7('0x5e'));}})[_0x17c7('0x14')](function(){if(_0x2e8afc){return respondWithRpcPromise(_0x17c7('0x5f'),_0x17c7('0x60'),_0x2e8afc,client9003)[_0x17c7('0x14')](function(_0x2c9e0e){return _0x160c50['update']({'read':!![],'messageId':_0x2c9e0e[_0x17c7('0x61')],'sentAt':moment()[_0x17c7('0x62')](_0x17c7('0x63'))});})[_0x17c7('0x1e')](function(_0x24cc69){logger[_0x17c7('0x1a')]('%s',JSON[_0x17c7('0x19')](_0x24cc69));return _0x160c50;});}return _0x160c50;});}return _0x160c50;}})['then'](respondWithResult(_0x4e3171,0xc9))[_0x17c7('0x1e')](handleError(_0x4e3171,null));};exports[_0x17c7('0x64')]=function(_0x97a905,_0x14fda2){var _0x4fffaa={'agent':{},'channel':'mail'};if(_0x97a905[_0x17c7('0x49')]['id']){delete _0x97a905[_0x17c7('0x49')]['id'];}_0x97a905['body']['read']=!![];_0x97a905[_0x17c7('0x49')][_0x17c7('0x65')]=moment()[_0x17c7('0x62')](_0x17c7('0x63'));_0x97a905[_0x17c7('0x49')][_0x17c7('0x66')]=_0x97a905[_0x17c7('0x49')][_0x17c7('0x66')]||_0x97a905[_0x17c7('0x67')]['id'];_0x4fffaa[_0x17c7('0x68')]['id']=_0x97a905[_0x17c7('0x49')][_0x17c7('0x66')];return db[_0x17c7('0x2f')]['find']({'where':{'id':_0x97a905['params']['id'],'UserId':null}})[_0x17c7('0x14')](handleEntityNotFound(_0x14fda2,null))['then'](saveUpdates(_0x97a905[_0x17c7('0x49')],null))[_0x17c7('0x14')](function(_0x1f01a5){if(_0x1f01a5){_0x4fffaa[_0x17c7('0x1c')]=_0x1f01a5['get']({'plain':!![]});return db[_0x17c7('0x69')][_0x17c7('0x48')]({'where':{'id':_0x1f01a5[_0x17c7('0x6a')]}});}return null;})[_0x17c7('0x14')](handleEntityNotFound(_0x14fda2,null))['then'](function(_0xbd6aca){if(_0xbd6aca){return _0xbd6aca['update']({'UserId':_0x97a905['body'][_0x17c7('0x66')],'read1stAt':_[_0x17c7('0x6b')](_0xbd6aca[_0x17c7('0x6c')])?moment()['format'](_0x17c7('0x63')):undefined});}return null;})[_0x17c7('0x14')](function(_0xef456a){if(_0xef456a){_0x4fffaa[_0x17c7('0x6d')]=_0xef456a['get']({'plain':!![]});interaction_log[_0x17c7('0x15')](_0x17c7('0x6e'),_0x97a905[_0x17c7('0x67')]['id'],_0x97a905['user'][_0x17c7('0x2b')],_0x97a905['user'][_0x17c7('0x6f')],_0x4fffaa[_0x17c7('0x6d')]['id'],_0x97a905[_0x17c7('0x49')]?JSON[_0x17c7('0x19')](_0x97a905[_0x17c7('0x49')]):_0x17c7('0x70'));return respondWithRpcPromise(_0x17c7('0x71'),_0x17c7('0x72'),_0x4fffaa);}return null;})[_0x17c7('0x14')](function(_0xadcb93){var _0xfb2354=_0x17c7('0x73')+_0xadcb93[_0x17c7('0x1c')]['ContactId'];return db['sequelize']['query'](_0xfb2354,{'type':db[_0x17c7('0x74')][_0x17c7('0x75')][_0x17c7('0x76')],'raw':!![]})[_0x17c7('0x14')](function(_0xbb3761){return _0xbb3761;});})[_0x17c7('0x14')](function(_0x3a5abd){if(_0x3a5abd){_0x4fffaa[_0x17c7('0x1c')]['contact']=_0x3a5abd[0x0];if(!_0x97a905[_0x17c7('0x49')][_0x17c7('0x66')])return;return db[_0x17c7('0x77')][_0x17c7('0x48')]({'where':{'id':_0x97a905['body']['UserId'],'role':_0x17c7('0x68')},'attributes':['id','name',_0x17c7('0x78'),_0x17c7('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x43b356){if(!_0x43b356)return null;_0x4fffaa[_0x17c7('0x1c')][_0x17c7('0x68')]=_0x43b356;return _0x4fffaa;})[_0x17c7('0x14')](function(_0x38ffc1){if(_0x38ffc1){if(_0x97a905['body']['manual']){_0x4fffaa[_0x17c7('0x1c')][_0x17c7('0x7a')]=util[_0x17c7('0x62')]('SIP/%s',_0x97a905['user'][_0x17c7('0x2b')]);_0x4fffaa['message'][_0x17c7('0x7b')]=_0x4fffaa[_0x17c7('0x7b')];_0x4fffaa[_0x17c7('0x1c')][_0x17c7('0x7c')]=_0x4fffaa[_0x17c7('0x7b')];_0x4fffaa[_0x17c7('0x1c')]['event']=_0x17c7('0x64');_0x4fffaa['message'][_0x17c7('0x49')]=htmlToText[_0x17c7('0x7d')](_0x4fffaa['message'][_0x17c7('0x49')]);return respondWithRpcPromise(_0x17c7('0x7e'),_0x17c7('0x7e'),{'event':'acceptmessage','message':_0x4fffaa['message']},client9002)[_0x17c7('0x14')](function(){return _0x4fffaa;});}return _0x4fffaa;}return null;})[_0x17c7('0x14')](respondWithResult(_0x14fda2,null))['catch'](handleError(_0x14fda2,null));};exports[_0x17c7('0x7f')]=function(_0x263965,_0x28deeb){var _0xba7b00={'agent':{},'channel':'mail'};if(_0x263965['body']['id']){delete _0x263965[_0x17c7('0x49')]['id'];}_0x263965[_0x17c7('0x49')]['UserId']=_0x263965['body'][_0x17c7('0x66')]||_0x263965[_0x17c7('0x67')]['id'];_0xba7b00[_0x17c7('0x68')]['id']=_0x263965[_0x17c7('0x49')][_0x17c7('0x66')];return db[_0x17c7('0x2f')][_0x17c7('0x48')]({'where':{'id':_0x263965[_0x17c7('0x47')]['id'],'UserId':null}})[_0x17c7('0x14')](handleEntityNotFound(_0x28deeb,null))[_0x17c7('0x14')](function(_0x1533d1){if(_0x1533d1){_0xba7b00[_0x17c7('0x1c')]=_0x1533d1[_0x17c7('0x80')]({'plain':!![]});return db[_0x17c7('0x69')][_0x17c7('0x48')]({'where':{'id':_0x1533d1[_0x17c7('0x6a')]}});}return null;})[_0x17c7('0x14')](handleEntityNotFound(_0x28deeb,null))['then'](function(_0xfbf090){if(_0xfbf090){_0xba7b00[_0x17c7('0x6d')]=_0xfbf090['get']({'plain':!![]});interaction_log['info'](_0x17c7('0x81'),_0x263965['user']['id'],_0x263965[_0x17c7('0x67')][_0x17c7('0x2b')],_0x263965[_0x17c7('0x67')][_0x17c7('0x6f')],_0xba7b00[_0x17c7('0x6d')]['id'],_0x263965[_0x17c7('0x49')]?JSON['stringify'](_0x263965['body']):_0x17c7('0x70'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xba7b00);}return null;})[_0x17c7('0x14')](function(_0x97849d){var _0xf4dcd2=_0x17c7('0x73')+_0x97849d[_0x17c7('0x1c')][_0x17c7('0x82')];return db[_0x17c7('0x83')][_0x17c7('0x34')](_0xf4dcd2,{'type':db[_0x17c7('0x74')][_0x17c7('0x75')][_0x17c7('0x76')],'raw':!![]})[_0x17c7('0x14')](function(_0x4d3546){return _0x4d3546;});})['then'](function(_0x4b0fc6){if(_0x4b0fc6){_0xba7b00[_0x17c7('0x1c')][_0x17c7('0x84')]=_0x4b0fc6[0x0];if(!_0x263965['body'][_0x17c7('0x66')])return;return db[_0x17c7('0x77')][_0x17c7('0x48')]({'where':{'id':_0x263965[_0x17c7('0x49')]['UserId'],'role':_0x17c7('0x68')},'attributes':['id','name',_0x17c7('0x78'),_0x17c7('0x79'),_0x17c7('0x85')],'raw':!![]});}return null;})[_0x17c7('0x14')](function(_0x18d32c){if(!_0x18d32c)return null;_0xba7b00['message']['agent']=_0x18d32c;return _0xba7b00;})[_0x17c7('0x14')](function(_0x4e17d5){if(_0x4e17d5){_0x4e17d5[_0x17c7('0x1c')][_0x17c7('0x7a')]=util[_0x17c7('0x62')](_0x17c7('0x86'),_0x263965[_0x17c7('0x67')][_0x17c7('0x2b')]);_0x4e17d5[_0x17c7('0x1c')][_0x17c7('0x7b')]=_0xba7b00[_0x17c7('0x7b')];_0x4e17d5[_0x17c7('0x1c')]['motionChannel']=_0xba7b00['channel'];_0x4e17d5[_0x17c7('0x1c')]['event']='reject';_0x4e17d5['message'][_0x17c7('0x49')]=htmlToText['fromString'](_0xba7b00[_0x17c7('0x1c')][_0x17c7('0x49')]);respondWithRpcPromise('EventManager',_0x17c7('0x7e'),{'event':_0x17c7('0x87'),'message':_0x4e17d5['message']},client9002);return _0xba7b00;}return null;})['then'](respondWithResult(_0x28deeb,null))[_0x17c7('0x1e')](handleError(_0x28deeb,null));};exports[_0x17c7('0x88')]=function(_0x4956d5,_0x3ca01d){var _0x192d24=moment()[_0x17c7('0x89')]()[_0x17c7('0x8a')]();var _0x5c992f=path[_0x17c7('0x57')](config[_0x17c7('0x8b')],_0x17c7('0x8c'),_0x17c7('0x8d'),_0x17c7('0x8e'));var _0x41c6e5=path[_0x17c7('0x57')](config[_0x17c7('0x8b')],_0x17c7('0x8c'),_0x17c7('0x8d'),_0x17c7('0x56'));var _0x47a49e=util[_0x17c7('0x62')](_0x17c7('0x8f'),_0x192d24);return db[_0x17c7('0x2f')][_0x17c7('0x48')]({'where':{'id':_0x4956d5[_0x17c7('0x47')]['id']},'attributes':['id','body',_0x17c7('0x90'),'to','cc',_0x17c7('0x91'),'subject',_0x17c7('0x92')],'include':_0x4956d5[_0x17c7('0x34')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x17c7('0x14')](handleEntityNotFound(_0x3ca01d,null))[_0x17c7('0x14')](function(_0x268e50){if(_0x268e50){var _0x5e1f77=_0x268e50;var _0xabad25={'from':_0x5e1f77[_0x17c7('0x90')],'to':_0x5e1f77['to'],'subject':_0x5e1f77[_0x17c7('0x93')],'html':htmlEntities['decode'](_0x5e1f77[_0x17c7('0x49')]),'headers':{'Date':moment(_0x5e1f77[_0x17c7('0x92')])[_0x17c7('0x62')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x268e50['cc']){_0xabad25[_0x17c7('0x94')]['Cc']=_0x268e50['cc'];}if(_0x268e50[_0x17c7('0x91')]){_0xabad25[_0x17c7('0x94')][_0x17c7('0x95')]=_0x268e50[_0x17c7('0x91')];}return new BPromise(function(_0xf7c7be,_0xc9628b){if(_0x268e50['Attachments']){for(var _0x28319e=0x0;_0x28319e<_0x268e50[_0x17c7('0x96')][_0x17c7('0x38')];_0x28319e++){var _0x36acd5=_0x268e50[_0x17c7('0x96')][_0x28319e];var _0x3fd347=path[_0x17c7('0x57')](_0x41c6e5,_0x36acd5[_0x17c7('0x59')]);if(fs['existsSync'](_0x3fd347)){_0xabad25[_0x17c7('0x56')][_0x17c7('0x97')]({'name':_0x36acd5['name'],'contentType':_0x36acd5['type'],'data':fs[_0x17c7('0x98')](_0x3fd347)});}}}emlformat[_0x17c7('0x99')](_0xabad25,function(_0xa1d346,_0xbe3088){if(_0xa1d346)return _0xc9628b(_0xa1d346);fs[_0x17c7('0x9a')](path[_0x17c7('0x57')](_0x5c992f,_0x47a49e),_0xbe3088);return _0xf7c7be(_0xbe3088);});});}})[_0x17c7('0x14')](function(_0x3939c7){if(_0x3939c7){return _0x3ca01d[_0x17c7('0x88')](path[_0x17c7('0x57')](_0x5c992f,_0x47a49e),_0x47a49e,function(_0xc9472f){if(!_0xc9472f)fs[_0x17c7('0x9b')](path['join'](_0x5c992f,_0x47a49e));});}})['catch'](handleError(_0x3ca01d,null));}; \ No newline at end of file +var _0x767a=['user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','fullname','interface','SIP/%s','channel','EventManager','acceptmessage','mail','RejectMessage','rejectMessage','QueryTypes','email','motionChannel','event','reject','fromString','rejectmessage','unix','toString','server','files','tmp','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','download','unlinkSync','eml-format','bluebird','util','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','Content-Range','destroy','stack','name','send','index','map','fieldName','type','keys','query','attributes','intersection','model','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','MailMessage','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','update','body','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','attachments','join','root','basename','List','ListId','List\x20not\x20found','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','format','UserId'];(function(_0x154e0d,_0x2d81a7){var _0x206294=function(_0xb5a963){while(--_0xb5a963){_0x154e0d['push'](_0x154e0d['shift']());}};_0x206294(++_0x2d81a7);}(_0x767a,0xce));var _0xa767=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x767a[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0xa767('0x0'));var moment=require('moment');var BPromise=require(_0xa767('0x1'));var util=require(_0xa767('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xa767('0x3'));var htmlToText=require(_0xa767('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xa767('0x5'))(_0xa767('0x6'));var interaction_log=require(_0xa767('0x5'))(_0xa767('0x7'));var config=require(_0xa767('0x8'));var db=require(_0xa767('0x9'))['db'];config[_0xa767('0xa')]=_['defaults'](config[_0xa767('0xa')],{'host':_0xa767('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa767('0xa')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xa767('0xc')](socket);var jayson=require(_0xa767('0xd'));var client=jayson[_0xa767('0xe')]['http']({'port':0x232c});var client9003=jayson['client'][_0xa767('0xf')]({'port':0x232b});var client9002=jayson['client'][_0xa767('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x5c7e0a,_0x270a85,_0x3c7809,_0x486810){return new BPromise(function(_0x57c6cc,_0x32a595){var _0x1401f2=_0x486810||client;return _0x1401f2[_0xa767('0x10')](_0x5c7e0a,_0x3c7809)[_0xa767('0x11')](function(_0x55d784){logger[_0xa767('0x12')](_0xa767('0x13'),_0x270a85,_0xa767('0x14'));logger[_0xa767('0x15')](_0xa767('0x16'),_0x270a85,_0xa767('0x14'),JSON[_0xa767('0x17')](_0x55d784));if(_0x55d784[_0xa767('0x18')]){if(_0x55d784[_0xa767('0x18')][_0xa767('0x19')]===0x1f4){logger[_0xa767('0x18')](_0xa767('0x13'),_0x270a85,_0x55d784[_0xa767('0x18')][_0xa767('0x1a')]);return _0x32a595(_0x55d784[_0xa767('0x18')]['message']);}logger[_0xa767('0x18')]('MailMessage,\x20%s,\x20%s',_0x270a85,_0x55d784[_0xa767('0x18')]['message']);return _0x57c6cc(_0x55d784[_0xa767('0x18')][_0xa767('0x1a')]);}else{logger[_0xa767('0x12')]('MailMessage,\x20%s,\x20%s',_0x270a85,_0xa767('0x14'));_0x57c6cc(_0x55d784['result'][_0xa767('0x1a')]);}})[_0xa767('0x1b')](function(_0x1374ec){logger[_0xa767('0x18')]('MailMessage,\x20%s,\x20%s',_0x270a85,_0x1374ec);_0x32a595(_0x1374ec);});});}function respondWithResult(_0x33a0cf,_0x51d7f1){_0x51d7f1=_0x51d7f1||0xc8;return function(_0x7ffbaa){if(_0x7ffbaa){return _0x33a0cf[_0xa767('0x1c')](_0x51d7f1)[_0xa767('0x1d')](_0x7ffbaa);}};}function respondWithFilteredResult(_0x2a7cfa,_0x5225b7){return function(_0x2e1655){if(_0x2e1655){var _0x17fda8=typeof _0x5225b7[_0xa767('0x1e')]===_0xa767('0x1f')&&typeof _0x5225b7[_0xa767('0x20')]===_0xa767('0x1f');var _0x3bb576=_0x2e1655['count'];var _0x3fe796=_0x17fda8?0x0:_0x5225b7[_0xa767('0x1e')];var _0x514f11=_0x17fda8?_0x2e1655['count']:_0x5225b7[_0xa767('0x1e')]+_0x5225b7[_0xa767('0x20')];var _0x55de0b;if(_0x514f11>=_0x3bb576){_0x514f11=_0x3bb576;_0x55de0b=0xc8;}else{_0x55de0b=0xce;}_0x2a7cfa[_0xa767('0x1c')](_0x55de0b);return _0x2a7cfa['set'](_0xa767('0x21'),_0x3fe796+'-'+_0x514f11+'/'+_0x3bb576)[_0xa767('0x1d')](_0x2e1655);}return null;};}function saveUpdates(_0x402bdd){return function(_0x2d6c3d){if(_0x2d6c3d){return _0x2d6c3d['update'](_0x402bdd)[_0xa767('0x11')](function(_0x178795){return _0x178795;});}return null;};}function removeEntity(_0x58be9e){return function(_0x3cf9c1){if(_0x3cf9c1){return _0x3cf9c1[_0xa767('0x22')]()[_0xa767('0x11')](function(){_0x58be9e[_0xa767('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f397){return function(_0x31051f){if(!_0x31051f){_0x19f397['sendStatus'](0x194);}return _0x31051f;};}function handleError(_0x326f4d,_0x425f82){_0x425f82=_0x425f82||0x1f4;return function(_0x5392a9){logger['error'](_0x5392a9[_0xa767('0x23')]);if(_0x5392a9['name']){delete _0x5392a9[_0xa767('0x24')];}_0x326f4d['status'](_0x425f82)[_0xa767('0x25')](_0x5392a9);};}exports[_0xa767('0x26')]=function(_0x5097fb,_0x1fd71b){var _0x62f7ea={},_0xde040e={},_0x2c67c7={'count':0x0,'rows':[]};var _0x1c3b68=_[_0xa767('0x27')](db['MailMessage']['rawAttributes'],function(_0x4a2beb){return{'name':_0x4a2beb[_0xa767('0x28')],'type':_0x4a2beb[_0xa767('0x29')]['key']};});_0xde040e['model']=_[_0xa767('0x27')](_0x1c3b68,_0xa767('0x24'));_0xde040e['query']=_[_0xa767('0x2a')](_0x5097fb['query']);_0xde040e['filters']=_['intersection'](_0xde040e['model'],_0xde040e[_0xa767('0x2b')]);_0x62f7ea[_0xa767('0x2c')]=_[_0xa767('0x2d')](_0xde040e[_0xa767('0x2e')],qs[_0xa767('0x2f')](_0x5097fb[_0xa767('0x2b')][_0xa767('0x2f')]));_0x62f7ea[_0xa767('0x2c')]=_0x62f7ea[_0xa767('0x2c')][_0xa767('0x30')]?_0x62f7ea[_0xa767('0x2c')]:_0xde040e[_0xa767('0x2e')];if(!_0x5097fb['query']['hasOwnProperty'](_0xa767('0x31'))){_0x62f7ea[_0xa767('0x20')]=qs[_0xa767('0x20')](_0x5097fb[_0xa767('0x2b')][_0xa767('0x20')]);_0x62f7ea['offset']=qs['offset'](_0x5097fb['query'][_0xa767('0x1e')]);}_0x62f7ea[_0xa767('0x32')]=qs[_0xa767('0x33')](_0x5097fb[_0xa767('0x2b')][_0xa767('0x33')]);_0x62f7ea[_0xa767('0x34')]=qs[_0xa767('0x35')](_[_0xa767('0x36')](_0x5097fb[_0xa767('0x2b')],_0xde040e['filters']),_0x1c3b68);if(_0x5097fb[_0xa767('0x2b')]['filter']){_0x62f7ea[_0xa767('0x34')]=_[_0xa767('0x37')](_0x62f7ea[_0xa767('0x34')],{'$or':_[_0xa767('0x27')](_0x1c3b68,function(_0x2b5339){if(_0x2b5339['type']!=='VIRTUAL'){var _0x434fc6={};_0x434fc6[_0x2b5339[_0xa767('0x24')]]={'$like':'%'+_0x5097fb[_0xa767('0x2b')][_0xa767('0x38')]+'%'};return _0x434fc6;}})});}_0x62f7ea=_['merge']({},_0x62f7ea,_0x5097fb[_0xa767('0x39')]);var _0x24f018={'where':_0x62f7ea['where']};return db[_0xa767('0x3a')][_0xa767('0x3b')](_0x24f018)[_0xa767('0x11')](function(_0x2946c3){_0x2c67c7['count']=_0x2946c3;if(_0x5097fb[_0xa767('0x2b')][_0xa767('0x3c')]){_0x62f7ea[_0xa767('0x3d')]=[{'all':!![]}];}return db['MailMessage'][_0xa767('0x3e')](_0x62f7ea);})['then'](function(_0x395bf4){_0x2c67c7[_0xa767('0x3f')]=_0x395bf4;return _0x2c67c7;})['then'](respondWithFilteredResult(_0x1fd71b,_0x62f7ea))[_0xa767('0x1b')](handleError(_0x1fd71b,null));};exports[_0xa767('0x40')]=function(_0x49f0f5,_0x35faca){var _0x4fe05e={'raw':!![],'where':{'id':_0x49f0f5[_0xa767('0x41')]['id']}},_0x19a09d={};_0x19a09d['model']=_[_0xa767('0x2a')](db[_0xa767('0x3a')][_0xa767('0x42')]);_0x19a09d[_0xa767('0x2b')]=_[_0xa767('0x2a')](_0x49f0f5['query']);_0x19a09d[_0xa767('0x35')]=_[_0xa767('0x2d')](_0x19a09d[_0xa767('0x2e')],_0x19a09d[_0xa767('0x2b')]);_0x4fe05e[_0xa767('0x2c')]=_[_0xa767('0x2d')](_0x19a09d[_0xa767('0x2e')],qs[_0xa767('0x2f')](_0x49f0f5[_0xa767('0x2b')][_0xa767('0x2f')]));_0x4fe05e[_0xa767('0x2c')]=_0x4fe05e[_0xa767('0x2c')][_0xa767('0x30')]?_0x4fe05e[_0xa767('0x2c')]:_0x19a09d[_0xa767('0x2e')];if(_0x49f0f5['query']['includeAll']){_0x4fe05e[_0xa767('0x3d')]=[{'all':!![]}];}_0x4fe05e=_[_0xa767('0x37')]({},_0x4fe05e,_0x49f0f5['options']);return db[_0xa767('0x3a')][_0xa767('0x43')](_0x4fe05e)[_0xa767('0x11')](handleEntityNotFound(_0x35faca,null))[_0xa767('0x11')](respondWithResult(_0x35faca,null))['catch'](handleError(_0x35faca,null));};exports[_0xa767('0x44')]=function(_0x13135f,_0x2684b6){if(_0x13135f['body']['id']){delete _0x13135f[_0xa767('0x45')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x13135f[_0xa767('0x41')]['id']}})[_0xa767('0x11')](handleEntityNotFound(_0x2684b6,null))[_0xa767('0x11')](saveUpdates(_0x13135f[_0xa767('0x45')],null))[_0xa767('0x11')](respondWithResult(_0x2684b6,null))[_0xa767('0x1b')](handleError(_0x2684b6,null));};exports[_0xa767('0x22')]=function(_0x349f7b,_0x252e9f){return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x349f7b[_0xa767('0x41')]['id']}})[_0xa767('0x11')](handleEntityNotFound(_0x252e9f,null))[_0xa767('0x11')](removeEntity(_0x252e9f,null))[_0xa767('0x1b')](handleError(_0x252e9f,null));};exports[_0xa767('0x46')]=function(_0x4f4a60,_0x379bdf){return db[_0xa767('0x3a')][_0xa767('0x46')]()['then'](respondWithResult(_0x379bdf,null))[_0xa767('0x1b')](handleError(_0x379bdf,null));};exports[_0xa767('0x47')]=function(_0x527725,_0x16aa3c){return db[_0xa767('0x3a')][_0xa767('0x47')](_0x527725[_0xa767('0x45')])[_0xa767('0x11')](function(_0x1f6c62){if(_0x1f6c62){if(_0x1f6c62[_0xa767('0x48')]===_0xa767('0x49')&&!_0x1f6c62[_0xa767('0x4a')]){var _0x3cf75a,_0x40de57,_0x48d32a;if(_0x527725[_0xa767('0x45')]['to']){_0x40de57=_0x527725[_0xa767('0x45')]['to'][_0xa767('0x4b')](',')[0x0];}return db['MailAccount'][_0xa767('0x4c')]({'where':{'id':_0x1f6c62[_0xa767('0x4d')]},'include':[{'model':db[_0xa767('0x4e')],'as':'List','include':[{'model':db[_0xa767('0x4f')],'as':_0xa767('0x50'),'where':{'email':_0x40de57},'limit':0x1,'order':[[_0xa767('0x51'),_0xa767('0x52')]]}]},{'model':db[_0xa767('0x53')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa767('0x54')],'as':'CloudProvider','raw':!![]}]}]})[_0xa767('0x11')](function(_0x1de1b1){_0x3cf75a=_0x1de1b1;if(!_0x3cf75a||!_0x3cf75a['Smtp'])return;var _0x5b37e7=_0x3cf75a['getSmtpOptions']();if(_0x527725[_0xa767('0x45')][_0xa767('0x55')]&&_0x527725['body']['attachments'][_0xa767('0x30')]){for(var _0x4a7f89=0x0;_0x4a7f89<_0x527725[_0xa767('0x45')]['attachments'][_0xa767('0x30')];_0x4a7f89+=0x1){_0x527725[_0xa767('0x45')][_0xa767('0x55')][_0x4a7f89]={'filename':_0x527725[_0xa767('0x45')][_0xa767('0x55')][_0x4a7f89][_0xa767('0x24')],'path':path[_0xa767('0x56')](config[_0xa767('0x57')],'server/files/attachments',_0x527725['body'][_0xa767('0x55')][_0x4a7f89][_0xa767('0x58')])};}}_0x48d32a={'account':_0x5b37e7,'message':_0x527725[_0xa767('0x45')]};return;})['then'](function(){if(_0x3cf75a[_0xa767('0x59')]){if(_0x3cf75a[_0xa767('0x59')][_0xa767('0x50')][_0xa767('0x30')]){return _0x3cf75a[_0xa767('0x59')][_0xa767('0x50')][0x0];}else{return db['CmContact'][_0xa767('0x47')](_['defaults'](_0x527725[_0xa767('0x45')],{'firstName':_0x527725[_0xa767('0x45')]['to'],'email':_0x527725[_0xa767('0x45')]['to'],'phone':_0x527725[_0xa767('0x45')]['to'],'ListId':_0x3cf75a[_0xa767('0x5a')]}));}}else{throw new Error(_0xa767('0x5b'));}})[_0xa767('0x11')](function(){if(_0x48d32a){return respondWithRpcPromise('SendMail','sendMail',_0x48d32a,client9003)[_0xa767('0x11')](function(_0x424a82){return _0x1f6c62[_0xa767('0x44')]({'read':!![],'messageId':_0x424a82[_0xa767('0x5c')],'sentAt':moment()['format'](_0xa767('0x5d'))});})[_0xa767('0x1b')](function(_0x54176a){logger[_0xa767('0x18')]('%s',JSON[_0xa767('0x17')](_0x54176a));return _0x1f6c62;});}return _0x1f6c62;});}return _0x1f6c62;}})[_0xa767('0x11')](respondWithResult(_0x16aa3c,0xc9))[_0xa767('0x1b')](handleError(_0x16aa3c,null));};exports[_0xa767('0x5e')]=function(_0x47c756,_0x6abb3f){var _0x1d6518={'agent':{},'channel':'mail'};if(_0x47c756[_0xa767('0x45')]['id']){delete _0x47c756[_0xa767('0x45')]['id'];}_0x47c756[_0xa767('0x45')][_0xa767('0x5f')]=!![];_0x47c756[_0xa767('0x45')]['readAt']=moment()[_0xa767('0x60')](_0xa767('0x5d'));_0x47c756['body'][_0xa767('0x61')]=_0x47c756['body'][_0xa767('0x61')]||_0x47c756[_0xa767('0x62')]['id'];_0x1d6518['agent']['id']=_0x47c756['body'][_0xa767('0x61')];return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x47c756['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6abb3f,null))[_0xa767('0x11')](saveUpdates(_0x47c756[_0xa767('0x45')],null))[_0xa767('0x11')](function(_0x255637){if(_0x255637){_0x1d6518[_0xa767('0x1a')]=_0x255637[_0xa767('0x63')]({'plain':!![]});return db[_0xa767('0x64')]['find']({'where':{'id':_0x255637[_0xa767('0x65')]}});}return null;})[_0xa767('0x11')](handleEntityNotFound(_0x6abb3f,null))[_0xa767('0x11')](function(_0x41e221){if(_0x41e221){return _0x41e221[_0xa767('0x44')]({'UserId':_0x47c756[_0xa767('0x45')][_0xa767('0x61')],'read1stAt':_[_0xa767('0x66')](_0x41e221[_0xa767('0x67')])?moment()['format'](_0xa767('0x5d')):undefined});}return null;})[_0xa767('0x11')](function(_0x58c437){if(_0x58c437){_0x1d6518[_0xa767('0x68')]=_0x58c437[_0xa767('0x63')]({'plain':!![]});interaction_log['info'](_0xa767('0x69'),_0x47c756['user']['id'],_0x47c756[_0xa767('0x62')][_0xa767('0x24')],_0x47c756['user'][_0xa767('0x6a')],_0x1d6518[_0xa767('0x68')]['id'],_0x47c756['body']?JSON['stringify'](_0x47c756[_0xa767('0x45')]):_0xa767('0x6b'));return respondWithRpcPromise(_0xa767('0x6c'),'acceptMessage',_0x1d6518);}return null;})['then'](function(_0x56906c){var _0x290412=_0xa767('0x6d')+_0x56906c[_0xa767('0x1a')][_0xa767('0x6e')];return db['sequelize'][_0xa767('0x2b')](_0x290412,{'type':db[_0xa767('0x6f')]['QueryTypes'][_0xa767('0x70')],'raw':!![]})['then'](function(_0x131e03){return _0x131e03;});})[_0xa767('0x11')](function(_0x42a084){if(_0x42a084){_0x1d6518['message'][_0xa767('0x71')]=_0x42a084[0x0];if(!_0x47c756['body'][_0xa767('0x61')])return;return db[_0xa767('0x72')][_0xa767('0x43')]({'where':{'id':_0x47c756[_0xa767('0x45')][_0xa767('0x61')],'role':_0xa767('0x73')},'attributes':['id',_0xa767('0x24'),_0xa767('0x74'),'email','internal'],'raw':!![]});}return null;})[_0xa767('0x11')](function(_0x355242){if(!_0x355242)return null;_0x1d6518['message'][_0xa767('0x73')]=_0x355242;return _0x1d6518;})[_0xa767('0x11')](function(_0x1af81e){if(_0x1af81e){if(_0x47c756['body']['manual']){_0x1d6518[_0xa767('0x1a')][_0xa767('0x75')]=util[_0xa767('0x60')](_0xa767('0x76'),_0x47c756[_0xa767('0x62')]['name']);_0x1d6518['message'][_0xa767('0x77')]=_0x1d6518['channel'];_0x1d6518[_0xa767('0x1a')]['motionChannel']=_0x1d6518[_0xa767('0x77')];_0x1d6518[_0xa767('0x1a')]['event']=_0xa767('0x5e');_0x1d6518[_0xa767('0x1a')][_0xa767('0x45')]=htmlToText['fromString'](_0x1d6518[_0xa767('0x1a')]['body']);return respondWithRpcPromise(_0xa767('0x78'),_0xa767('0x78'),{'event':_0xa767('0x79'),'message':_0x1d6518[_0xa767('0x1a')]},client9002)[_0xa767('0x11')](function(){return _0x1d6518;});}return _0x1d6518;}return null;})[_0xa767('0x11')](respondWithResult(_0x6abb3f,null))['catch'](handleError(_0x6abb3f,null));};exports['reject']=function(_0x1eadd4,_0xbf6144){var _0x46890f={'agent':{},'channel':_0xa767('0x7a')};if(_0x1eadd4[_0xa767('0x45')]['id']){delete _0x1eadd4[_0xa767('0x45')]['id'];}_0x1eadd4[_0xa767('0x45')][_0xa767('0x61')]=_0x1eadd4[_0xa767('0x45')]['UserId']||_0x1eadd4['user']['id'];_0x46890f[_0xa767('0x73')]['id']=_0x1eadd4[_0xa767('0x45')][_0xa767('0x61')];return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x1eadd4[_0xa767('0x41')]['id'],'UserId':null}})[_0xa767('0x11')](handleEntityNotFound(_0xbf6144,null))['then'](function(_0x32ed11){if(_0x32ed11){_0x46890f[_0xa767('0x1a')]=_0x32ed11[_0xa767('0x63')]({'plain':!![]});return db[_0xa767('0x64')][_0xa767('0x43')]({'where':{'id':_0x32ed11[_0xa767('0x65')]}});}return null;})[_0xa767('0x11')](handleEntityNotFound(_0xbf6144,null))['then'](function(_0x324a4f){if(_0x324a4f){_0x46890f[_0xa767('0x68')]=_0x324a4f[_0xa767('0x63')]({'plain':!![]});interaction_log[_0xa767('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1eadd4[_0xa767('0x62')]['id'],_0x1eadd4['user'][_0xa767('0x24')],_0x1eadd4[_0xa767('0x62')][_0xa767('0x6a')],_0x46890f[_0xa767('0x68')]['id'],_0x1eadd4[_0xa767('0x45')]?JSON[_0xa767('0x17')](_0x1eadd4['body']):'null');return respondWithRpcPromise(_0xa767('0x7b'),_0xa767('0x7c'),_0x46890f);}return null;})[_0xa767('0x11')](function(_0x514962){var _0x174300=_0xa767('0x6d')+_0x514962[_0xa767('0x1a')][_0xa767('0x6e')];return db['sequelize'][_0xa767('0x2b')](_0x174300,{'type':db['Sequelize'][_0xa767('0x7d')]['SELECT'],'raw':!![]})[_0xa767('0x11')](function(_0x58cb22){return _0x58cb22;});})[_0xa767('0x11')](function(_0x54a059){if(_0x54a059){_0x46890f[_0xa767('0x1a')][_0xa767('0x71')]=_0x54a059[0x0];if(!_0x1eadd4[_0xa767('0x45')][_0xa767('0x61')])return;return db[_0xa767('0x72')][_0xa767('0x43')]({'where':{'id':_0x1eadd4[_0xa767('0x45')]['UserId'],'role':_0xa767('0x73')},'attributes':['id',_0xa767('0x24'),_0xa767('0x74'),_0xa767('0x7e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x33c291){if(!_0x33c291)return null;_0x46890f[_0xa767('0x1a')]['agent']=_0x33c291;return _0x46890f;})['then'](function(_0x5e4b12){if(_0x5e4b12){_0x5e4b12[_0xa767('0x1a')]['interface']=util[_0xa767('0x60')](_0xa767('0x76'),_0x1eadd4[_0xa767('0x62')][_0xa767('0x24')]);_0x5e4b12[_0xa767('0x1a')]['channel']=_0x46890f[_0xa767('0x77')];_0x5e4b12[_0xa767('0x1a')][_0xa767('0x7f')]=_0x46890f['channel'];_0x5e4b12[_0xa767('0x1a')][_0xa767('0x80')]=_0xa767('0x81');_0x5e4b12[_0xa767('0x1a')][_0xa767('0x45')]=htmlToText[_0xa767('0x82')](_0x46890f[_0xa767('0x1a')][_0xa767('0x45')]);respondWithRpcPromise(_0xa767('0x78'),'EventManager',{'event':_0xa767('0x83'),'message':_0x5e4b12[_0xa767('0x1a')]},client9002);return _0x46890f;}return null;})[_0xa767('0x11')](respondWithResult(_0xbf6144,null))[_0xa767('0x1b')](handleError(_0xbf6144,null));};exports['download']=function(_0x2ae599,_0x54dba0){var _0x4da14c=moment()[_0xa767('0x84')]()[_0xa767('0x85')]();var _0x40d076=path[_0xa767('0x56')](config['root'],_0xa767('0x86'),_0xa767('0x87'),_0xa767('0x88'));var _0x1ae42d=path[_0xa767('0x56')](config[_0xa767('0x57')],_0xa767('0x86'),_0xa767('0x87'),_0xa767('0x55'));var _0x3105d3=util[_0xa767('0x60')]('message-%s.eml',_0x4da14c);return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x2ae599[_0xa767('0x41')]['id']},'attributes':['id',_0xa767('0x45'),_0xa767('0x89'),'to','cc',_0xa767('0x8a'),_0xa767('0x8b'),'createdAt'],'include':_0x2ae599[_0xa767('0x2b')][_0xa767('0x55')]?[{'model':db[_0xa767('0x8c')],'as':_0xa767('0x8d')}]:undefined})['then'](handleEntityNotFound(_0x54dba0,null))[_0xa767('0x11')](function(_0x19d9b5){if(_0x19d9b5){var _0x3cca0e=_0x19d9b5;var _0x241439={'from':_0x3cca0e[_0xa767('0x89')],'to':_0x3cca0e['to'],'subject':_0x3cca0e['subject'],'html':htmlEntities[_0xa767('0x8e')](_0x3cca0e[_0xa767('0x45')]),'headers':{'Date':moment(_0x3cca0e['createdAt'])['format'](_0xa767('0x8f'))},'attachments':[]};if(_0x19d9b5['cc']){_0x241439['headers']['Cc']=_0x19d9b5['cc'];}if(_0x19d9b5[_0xa767('0x8a')]){_0x241439[_0xa767('0x90')][_0xa767('0x91')]=_0x19d9b5[_0xa767('0x8a')];}return new BPromise(function(_0x140ced,_0x5e282f){if(_0x19d9b5[_0xa767('0x8d')]){for(var _0x33394c=0x0;_0x33394c<_0x19d9b5['Attachments'][_0xa767('0x30')];_0x33394c++){var _0x148a8a=_0x19d9b5[_0xa767('0x8d')][_0x33394c];var _0x10b6f4=path['join'](_0x1ae42d,_0x148a8a[_0xa767('0x58')]);if(fs[_0xa767('0x92')](_0x10b6f4)){_0x241439[_0xa767('0x55')][_0xa767('0x93')]({'name':_0x148a8a[_0xa767('0x24')],'contentType':_0x148a8a['type'],'data':fs[_0xa767('0x94')](_0x10b6f4)});}}}emlformat[_0xa767('0x95')](_0x241439,function(_0x40b0eb,_0x55ef98){if(_0x40b0eb)return _0x5e282f(_0x40b0eb);fs['writeFileSync'](path[_0xa767('0x56')](_0x40d076,_0x3105d3),_0x55ef98);return _0x140ced(_0x55ef98);});});}})[_0xa767('0x11')](function(_0x4e647b){if(_0x4e647b){return _0x54dba0[_0xa767('0x96')](path[_0xa767('0x56')](_0x40d076,_0x3105d3),_0x3105d3,function(_0x4898ae){if(!_0x4898ae)fs[_0xa767('0x97')](path[_0xa767('0x56')](_0x40d076,_0x3105d3));});}})[_0xa767('0x1b')](handleError(_0x54dba0,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ce62136..8ba7a6a 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 _0xa06c=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x161150,_0x17cd81){var _0x2cba96=function(_0x3a0724){while(--_0x3a0724){_0x161150['push'](_0x161150['shift']());}};_0x2cba96(++_0x17cd81);}(_0xa06c,0x140));var _0xca06=function(_0x2d4587,_0x215dbd){_0x2d4587=_0x2d4587-0x0;var _0x1b1c6e=_0xa06c[_0x2d4587];return _0x1b1c6e;};'use strict';var EventEmitter=require(_0xca06('0x0'));var MailMessage=require(_0xca06('0x1'))['db'][_0xca06('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xca06('0x3')](0x0);var events={'afterCreate':_0xca06('0x4'),'afterUpdate':'update','afterDestroy':_0xca06('0x5')};function emitEvent(_0x409f5a){return function(_0x2293ec,_0x211de0,_0x367f51){MailMessageEvents[_0xca06('0x6')](_0x409f5a+':'+_0x2293ec['id'],_0x2293ec);MailMessageEvents['emit'](_0x409f5a,_0x2293ec);_0x367f51(null);};}for(var e in events){if(events[_0xca06('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xca06('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x0a2c=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x3486b0,_0x248021){var _0x2c8a3f=function(_0x7b5568){while(--_0x7b5568){_0x3486b0['push'](_0x3486b0['shift']());}};_0x2c8a3f(++_0x248021);}(_0x0a2c,0xd5));var _0xc0a2=function(_0x32c6d2,_0x24416e){_0x32c6d2=_0x32c6d2-0x0;var _0x46b834=_0x0a2c[_0x32c6d2];return _0x46b834;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xc0a2('0x0'))['db'][_0xc0a2('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc0a2('0x2')](0x0);var events={'afterCreate':_0xc0a2('0x3'),'afterUpdate':_0xc0a2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a7637){return function(_0x43edfe,_0x2284d1,_0x4288dd){MailMessageEvents[_0xc0a2('0x5')](_0x5a7637+':'+_0x43edfe['id'],_0x43edfe);MailMessageEvents[_0xc0a2('0x5')](_0x5a7637,_0x43edfe);_0x4288dd(null);};}for(var e in events){if(events[_0xc0a2('0x6')](e)){var event=events[e];MailMessage[_0xc0a2('0x7')](e,emitEvent(event));}}module[_0xc0a2('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5a4d914..d04279d 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 _0xda2f=['UserId','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','out','secret','isNil'];(function(_0x17f5c0,_0x450b3c){var _0x1835dd=function(_0x1e2fbf){while(--_0x1e2fbf){_0x17f5c0['push'](_0x17f5c0['shift']());}};_0x1835dd(++_0x450b3c);}(_0xda2f,0x1e9));var _0xfda2=function(_0x35b753,_0x39b932){_0x35b753=_0x35b753-0x0;var _0x16c86e=_0xda2f[_0x35b753];return _0x16c86e;};'use strict';var _=require('lodash');var util=require(_0xfda2('0x0'));var logger=require(_0xfda2('0x1'))(_0xfda2('0x2'));var moment=require('moment');var BPromise=require(_0xfda2('0x3'));var rp=require(_0xfda2('0x4'));var htmlToText=require(_0xfda2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda2('0x6'));var config=require(_0xfda2('0x7'));var attributes=require(_0xfda2('0x8'));module['exports']=function(_0x2fa8b4,_0xe13056){return _0x2fa8b4['define'](_0xfda2('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfda2('0xa')]},{'name':_0xfda2('0xb'),'fields':[_0xfda2('0xc'),_0xfda2('0xd')],'type':_0xfda2('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x185b0e,_0x45c9e1,_0x3e2c96){if(_0x185b0e[_0xfda2('0xf')]){_0x185b0e[_0xfda2('0xc')]=htmlToText[_0xfda2('0x10')](_0x185b0e[_0xfda2('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3e2c96(null,_0x45c9e1);},'afterCreate':function(_0x6d5f7a,_0x28676a,_0x543ea6){var _0x7131cd=_0x2fa8b4[_0xfda2('0x11')];var _0x5c153b=_0x6d5f7a['get']({'plain':!![]});if(_0x5c153b[_0xfda2('0x12')]['toLowerCase']()==='in'||_0x5c153b[_0xfda2('0x12')][_0xfda2('0x13')]()===_0xfda2('0x14')&&!_0x5c153b[_0xfda2('0x15')]&&!_[_0xfda2('0x16')](_0x5c153b[_0xfda2('0x17')])){_0x7131cd['MailInteraction'][_0xfda2('0x18')]({'where':{'id':_0x5c153b[_0xfda2('0x19')]}})[_0xfda2('0x1a')](function(_0x1913da){if(_0x1913da){_0x1913da['update']({'lastMsgAt':_0x5c153b[_0xfda2('0x1b')],'lastMsgDirection':_0x5c153b['direction'][_0xfda2('0x13')]()});}})[_0xfda2('0x1c')](function(_0x576d75){console[_0xfda2('0x1d')](_0x576d75);});}_0x543ea6();}},'charset':_0xfda2('0x1e'),'collate':_0xfda2('0x1f')});}; \ No newline at end of file +var _0xf457=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','update','createdAt','catch','error'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0xf457,0x1f1));var _0x7f45=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf457[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7f45('0x0'));var util=require(_0x7f45('0x1'));var logger=require(_0x7f45('0x2'))(_0x7f45('0x3'));var moment=require(_0x7f45('0x4'));var BPromise=require(_0x7f45('0x5'));var rp=require(_0x7f45('0x6'));var htmlToText=require(_0x7f45('0x7'));var fs=require('fs');var path=require(_0x7f45('0x8'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f45('0x9'));module['exports']=function(_0x1e52d1,_0x312ae7){return _0x1e52d1[_0x7f45('0xa')](_0x7f45('0xb'),attributes,{'tableName':_0x7f45('0xc'),'paranoid':![],'indexes':[{'name':_0x7f45('0xd'),'fields':[_0x7f45('0xd')]},{'name':_0x7f45('0xe'),'fields':['plainBody',_0x7f45('0xf')],'type':_0x7f45('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x568439,_0x49b18a,_0x2bee6b){if(_0x568439[_0x7f45('0x11')]){_0x568439[_0x7f45('0x12')]=htmlToText['fromString'](_0x568439[_0x7f45('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2bee6b(null,_0x49b18a);},'afterCreate':function(_0x2fb934,_0x2e98ff,_0xec8bc1){var _0x4c10d5=_0x1e52d1['models'];var _0x5c7cd4=_0x2fb934['get']({'plain':!![]});if(_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()==='in'||_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()===_0x7f45('0x15')&&!_0x5c7cd4[_0x7f45('0x16')]&&!_['isNil'](_0x5c7cd4[_0x7f45('0x17')])){_0x4c10d5['MailInteraction'][_0x7f45('0x18')]({'where':{'id':_0x5c7cd4[_0x7f45('0x19')]}})['then'](function(_0x376824){if(_0x376824){_0x376824[_0x7f45('0x1a')]({'lastMsgAt':_0x5c7cd4[_0x7f45('0x1b')],'lastMsgDirection':_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()});}})[_0x7f45('0x1c')](function(_0x197260){console[_0x7f45('0x1d')](_0x197260);});}_0xec8bc1();}},'charset':_0x7f45('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 67a8ea7..e7df8c9 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 _0xb78e=['http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x36ff16,_0x16bd8a){var _0x5f0099=function(_0x493ea5){while(--_0x493ea5){_0x36ff16['push'](_0x36ff16['shift']());}};_0x5f0099(++_0x16bd8a);}(_0xb78e,0x1c9));var _0xeb78=function(_0x4c0181,_0x3ea854){_0x4c0181=_0x4c0181-0x0;var _0x202e37=_0xb78e[_0x4c0181];return _0x202e37;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});config[_0xeb78('0xc')]=_[_0xeb78('0xd')](config[_0xeb78('0xc')],{'host':_0xeb78('0xe'),'port':0x18eb});var socket=require(_0xeb78('0xf'))(new Redis(config['redis']));require(_0xeb78('0x10'))[_0xeb78('0x11')](socket);function respondWithRpcPromise(_0xa1ca82,_0x46fbad,_0x125e97){return new BPromise(function(_0x402680,_0x15137b){return client[_0xeb78('0x12')](_0xa1ca82,_0x125e97)[_0xeb78('0x13')](function(_0x59d8d8){logger[_0xeb78('0x14')](_0xeb78('0x15'),_0x46fbad,_0xeb78('0x16'));logger[_0xeb78('0x17')](_0xeb78('0x18'),_0x46fbad,_0xeb78('0x16'),JSON[_0xeb78('0x19')](_0x59d8d8));if(_0x59d8d8[_0xeb78('0x1a')]){if(_0x59d8d8[_0xeb78('0x1a')][_0xeb78('0x1b')]===0x1f4){logger['error'](_0xeb78('0x15'),_0x46fbad,_0x59d8d8[_0xeb78('0x1a')]['message']);return _0x15137b(_0x59d8d8['error']['message']);}logger[_0xeb78('0x1a')]('MailMessage,\x20%s,\x20%s',_0x46fbad,_0x59d8d8[_0xeb78('0x1a')][_0xeb78('0x1c')]);return _0x402680(_0x59d8d8['error'][_0xeb78('0x1c')]);}else{logger['info'](_0xeb78('0x15'),_0x46fbad,_0xeb78('0x16'));_0x402680(_0x59d8d8['result'][_0xeb78('0x1c')]);}})[_0xeb78('0x1d')](function(_0x1cb338){logger['error'](_0xeb78('0x15'),_0x46fbad,_0x1cb338);_0x15137b(_0x1cb338);});});}exports[_0xeb78('0x1e')]=function(_0x4ab933){var _0x48b106=this;return new Promise(function(_0x455e30,_0x106c5d){return db[_0xeb78('0x1f')][_0xeb78('0x20')](_0x4ab933[_0xeb78('0x21')],{'raw':_0x4ab933[_0xeb78('0x22')]?_0x4ab933[_0xeb78('0x22')][_0xeb78('0x23')]===undefined?!![]:![]:!![]})[_0xeb78('0x13')](function(_0x52b8c1){logger['info']('CreateMailMessage',_0x4ab933);logger['debug'](_0xeb78('0x1e'),_0x4ab933,JSON['stringify'](_0x52b8c1));_0x455e30(_0x52b8c1);})[_0xeb78('0x1d')](function(_0x1fbf2f){logger['error'](_0xeb78('0x1e'),_0x1fbf2f['message'],_0x4ab933);_0x106c5d(_0x48b106[_0xeb78('0x1a')](0x1f4,_0x1fbf2f[_0xeb78('0x1c')]));});});}; \ No newline at end of file +var _0x77e6=['catch','CreateMailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x77e6,0x1a6));var _0x677e=function(_0x163d8f,_0x1a344b){_0x163d8f=_0x163d8f-0x0;var _0x48e996=_0x77e6[_0x163d8f];return _0x48e996;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});config[_0x677e('0xb')]=_['defaults'](config['redis'],{'host':_0x677e('0xc'),'port':0x18eb});var socket=require(_0x677e('0xd'))(new Redis(config[_0x677e('0xb')]));require(_0x677e('0xe'))['register'](socket);function respondWithRpcPromise(_0x206305,_0x5bf52d,_0x3cdbe3){return new BPromise(function(_0x227084,_0x1e4fd9){return client[_0x677e('0xf')](_0x206305,_0x3cdbe3)[_0x677e('0x10')](function(_0x49ca35){logger[_0x677e('0x11')](_0x677e('0x12'),_0x5bf52d,_0x677e('0x13'));logger[_0x677e('0x14')](_0x677e('0x15'),_0x5bf52d,_0x677e('0x13'),JSON[_0x677e('0x16')](_0x49ca35));if(_0x49ca35[_0x677e('0x17')]){if(_0x49ca35['error']['code']===0x1f4){logger['error'](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x1e4fd9(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}logger[_0x677e('0x17')](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x227084(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}else{logger[_0x677e('0x11')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0x677e('0x13'));_0x227084(_0x49ca35[_0x677e('0x19')][_0x677e('0x18')]);}})[_0x677e('0x1a')](function(_0xba1c26){logger[_0x677e('0x17')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0xba1c26);_0x1e4fd9(_0xba1c26);});});}exports[_0x677e('0x1b')]=function(_0x4bfbb6){var _0x18424e=this;return new Promise(function(_0x267aac,_0x26e9c5){return db['MailMessage'][_0x677e('0x1c')](_0x4bfbb6[_0x677e('0x1d')],{'raw':_0x4bfbb6[_0x677e('0x1e')]?_0x4bfbb6[_0x677e('0x1e')][_0x677e('0x1f')]===undefined?!![]:![]:!![]})[_0x677e('0x10')](function(_0x3a7895){logger['info']('CreateMailMessage',_0x4bfbb6);logger['debug'](_0x677e('0x1b'),_0x4bfbb6,JSON[_0x677e('0x16')](_0x3a7895));_0x267aac(_0x3a7895);})[_0x677e('0x1a')](function(_0x540d0e){logger[_0x677e('0x17')](_0x677e('0x1b'),_0x540d0e[_0x677e('0x18')],_0x4bfbb6);_0x26e9c5(_0x18424e[_0x677e('0x17')](0x1f4,_0x540d0e[_0x677e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 3abcf6b..6355bf6 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 _0xdd89=['emit','removeListener','register','length','./mailMessage.events','remove','update'];(function(_0x1067a1,_0x9d96b3){var _0x4ee127=function(_0x42da7f){while(--_0x42da7f){_0x1067a1['push'](_0x1067a1['shift']());}};_0x4ee127(++_0x9d96b3);}(_0xdd89,0xf9));var _0x9dd8=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0xdd89[_0x533132];return _0x1a7447;};'use strict';var MailMessageEvents=require(_0x9dd8('0x0'));var events=['save',_0x9dd8('0x1'),_0x9dd8('0x2')];function createListener(_0x9d17ac,_0x4dfb55){return function(_0x2ea48c){_0x4dfb55[_0x9dd8('0x3')](_0x9d17ac,_0x2ea48c);};}function removeListener(_0x1fbac9,_0x55f321){return function(){MailMessageEvents[_0x9dd8('0x4')](_0x1fbac9,_0x55f321);};}exports[_0x9dd8('0x5')]=function(_0x29c02d){for(var _0x548b02=0x0,_0xb6224f=events[_0x9dd8('0x6')];_0x548b02<_0xb6224f;_0x548b02++){var _0x2d8288=events[_0x548b02];var _0x42a002=createListener('mailMessage:'+_0x2d8288,_0x29c02d);MailMessageEvents['on'](_0x2d8288,_0x42a002);}}; \ No newline at end of file +var _0x77a3=['./mailMessage.events','save','emit','length'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0x77a3,0xfc));var _0x377a=function(_0x5c85e3,_0x48bfe5){_0x5c85e3=_0x5c85e3-0x0;var _0x4ca6e3=_0x77a3[_0x5c85e3];return _0x4ca6e3;};'use strict';var MailMessageEvents=require(_0x377a('0x0'));var events=[_0x377a('0x1'),'remove','update'];function createListener(_0x219493,_0x3de647){return function(_0x1fa9f0){_0x3de647[_0x377a('0x2')](_0x219493,_0x1fa9f0);};}function removeListener(_0x3688c9,_0x32d937){return function(){MailMessageEvents['removeListener'](_0x3688c9,_0x32d937);};}exports['register']=function(_0x2ca6b1){for(var _0x2e935c=0x0,_0x26177f=events[_0x377a('0x3')];_0x2e935c<_0x26177f;_0x2e935c++){var _0x1cc8d8=events[_0x2e935c];var _0x56202b=createListener('mailMessage:'+_0x1cc8d8,_0x2ca6b1);MailMessageEvents['on'](_0x1cc8d8,_0x56202b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 50e3b1c..be13cf1 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 _0x4ac4=['../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x45b93c,_0x3d26cf){var _0x2a76ab=function(_0x489bbd){while(--_0x489bbd){_0x45b93c['push'](_0x45b93c['shift']());}};_0x2a76ab(++_0x3d26cf);}(_0x4ac4,0x1bb));var _0x44ac=function(_0x1b4581,_0x562820){_0x1b4581=_0x1b4581-0x0;var _0x4ae42f=_0x4ac4[_0x1b4581];return _0x4ae42f;};'use strict';var multer=require(_0x44ac('0x0'));var util=require(_0x44ac('0x1'));var path=require(_0x44ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x44ac('0x3'));var router=express[_0x44ac('0x4')]();var fs_extra=require(_0x44ac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44ac('0x6'));var config=require(_0x44ac('0x7'));var controller=require(_0x44ac('0x8'));router[_0x44ac('0x9')]('/',auth[_0x44ac('0xa')](),controller[_0x44ac('0xb')]);router[_0x44ac('0x9')](_0x44ac('0xc'),auth[_0x44ac('0xa')](),controller[_0x44ac('0xd')]);router[_0x44ac('0x9')](_0x44ac('0xe'),auth[_0x44ac('0xa')](),controller[_0x44ac('0xf')]);router[_0x44ac('0x9')](_0x44ac('0x10'),auth['isAuthenticated'](),controller[_0x44ac('0x11')]);router[_0x44ac('0x9')](_0x44ac('0x12'),auth[_0x44ac('0xa')](),controller[_0x44ac('0x13')]);router[_0x44ac('0x9')](_0x44ac('0x14'),auth[_0x44ac('0xa')](),controller[_0x44ac('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth[_0x44ac('0xa')](),controller[_0x44ac('0x16')]);router['post'](_0x44ac('0x14'),auth[_0x44ac('0xa')](),controller[_0x44ac('0x17')]);router[_0x44ac('0x18')](_0x44ac('0xe'),auth[_0x44ac('0xa')](),controller[_0x44ac('0x19')]);router[_0x44ac('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x44ac('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0x44ac('0x1b')]);router[_0x44ac('0x1a')]('/:id/users',auth[_0x44ac('0xa')](),controller[_0x44ac('0x1c')]);module[_0x44ac('0x1d')]=router; \ No newline at end of file +var _0xa086=['removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','delete','destroy'];(function(_0x104258,_0x96ab1e){var _0x5ec041=function(_0x635ac0){while(--_0x635ac0){_0x104258['push'](_0x104258['shift']());}};_0x5ec041(++_0x96ab1e);}(_0xa086,0x1c3));var _0x6a08=function(_0x187826,_0x2bd187){_0x187826=_0x187826-0x0;var _0x2fd5bb=_0xa086[_0x187826];return _0x2fd5bb;};'use strict';var multer=require(_0x6a08('0x0'));var util=require('util');var path=require(_0x6a08('0x1'));var timeout=require(_0x6a08('0x2'));var express=require(_0x6a08('0x3'));var router=express[_0x6a08('0x4')]();var fs_extra=require(_0x6a08('0x5'));var auth=require(_0x6a08('0x6'));var interaction=require(_0x6a08('0x7'));var config=require(_0x6a08('0x8'));var controller=require(_0x6a08('0x9'));router[_0x6a08('0xa')]('/',auth[_0x6a08('0xb')](),controller[_0x6a08('0xc')]);router[_0x6a08('0xa')](_0x6a08('0xd'),auth[_0x6a08('0xb')](),controller[_0x6a08('0xe')]);router[_0x6a08('0xa')]('/:id',auth[_0x6a08('0xb')](),controller[_0x6a08('0xf')]);router[_0x6a08('0xa')](_0x6a08('0x10'),auth[_0x6a08('0xb')](),controller[_0x6a08('0x11')]);router[_0x6a08('0xa')](_0x6a08('0x12'),auth['isAuthenticated'](),controller[_0x6a08('0x13')]);router[_0x6a08('0xa')](_0x6a08('0x14'),auth[_0x6a08('0xb')](),controller['getAgents']);router[_0x6a08('0x15')]('/',auth[_0x6a08('0xb')](),controller[_0x6a08('0x16')]);router[_0x6a08('0x15')](_0x6a08('0x12'),auth['isAuthenticated'](),controller[_0x6a08('0x17')]);router[_0x6a08('0x15')](_0x6a08('0x14'),auth['isAuthenticated'](),controller[_0x6a08('0x18')]);router[_0x6a08('0x19')](_0x6a08('0x1a'),auth[_0x6a08('0xb')](),controller['update']);router[_0x6a08('0x1b')]('/:id',auth[_0x6a08('0xb')](),controller[_0x6a08('0x1c')]);router[_0x6a08('0x1b')]('/:id/teams',auth[_0x6a08('0xb')](),controller[_0x6a08('0x1d')]);router[_0x6a08('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4e9ff58..89eb001 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 _0xcd44=['sequelize','exports','STRING','ENUM','roundrobin'];(function(_0x40a5d6,_0x547484){var _0x2e3e6b=function(_0x4fda72){while(--_0x4fda72){_0x40a5d6['push'](_0x40a5d6['shift']());}};_0x2e3e6b(++_0x547484);}(_0xcd44,0x159));var _0x4cd4=function(_0x156f0d,_0x59add2){_0x156f0d=_0x156f0d-0x0;var _0x71c689=_0xcd44[_0x156f0d];return _0x71c689;};'use strict';var Sequelize=require(_0x4cd4('0x0'));module[_0x4cd4('0x1')]={'name':{'type':Sequelize[_0x4cd4('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4cd4('0x3')]('rrmemory','beepall',_0x4cd4('0x4'))}}; \ No newline at end of file +var _0x9aff=['STRING','ENUM','rrmemory','roundrobin','sequelize'];(function(_0xfe19be,_0x3b5470){var _0xa433ee=function(_0x1ee9b7){while(--_0x1ee9b7){_0xfe19be['push'](_0xfe19be['shift']());}};_0xa433ee(++_0x3b5470);}(_0x9aff,0x1e9));var _0xf9af=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x9aff[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0xf9af('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9af('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf9af('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf9af('0x2')](_0xf9af('0x3'),'beepall',_0xf9af('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 169b87e..2be644e 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 _0x58b7=['params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','removeTeams','isEmpty','removeAgents','emit','addAgents','spread','isArray','userMailQueue:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','UserProfileResource','name','send','index','map','MailQueue','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show'];(function(_0x4ba691,_0x24d437){var _0x5a7d02=function(_0x12c6ab){while(--_0x12c6ab){_0x4ba691['push'](_0x4ba691['shift']());}};_0x5a7d02(++_0x24d437);}(_0x58b7,0x16e));var _0x758b=function(_0x1ffafb,_0x3841c0){_0x1ffafb=_0x1ffafb-0x0;var _0x40d55e=_0x58b7[_0x1ffafb];return _0x40d55e;};'use strict';var emlformat=require(_0x758b('0x0'));var rimraf=require(_0x758b('0x1'));var zipdir=require(_0x758b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x758b('0x3'));var moment=require(_0x758b('0x4'));var BPromise=require(_0x758b('0x5'));var Mustache=require(_0x758b('0x6'));var util=require(_0x758b('0x7'));var path=require(_0x758b('0x8'));var sox=require(_0x758b('0x9'));var csv=require(_0x758b('0xa'));var ejs=require(_0x758b('0xb'));var fs=require('fs');var fs_extra=require(_0x758b('0xc'));var _=require(_0x758b('0xd'));var squel=require(_0x758b('0xe'));var crypto=require(_0x758b('0xf'));var jsforce=require(_0x758b('0x10'));var deskjs=require(_0x758b('0x11'));var toCsv=require(_0x758b('0xa'));var querystring=require(_0x758b('0x12'));var Papa=require(_0x758b('0x13'));var Redis=require(_0x758b('0x14'));var authService=require(_0x758b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x758b('0x16'));var hardwareService=require(_0x758b('0x17'));var logger=require(_0x758b('0x18'))(_0x758b('0x19'));var utils=require(_0x758b('0x1a'));var config=require(_0x758b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x758b('0x1c'))['db'];config[_0x758b('0x1d')]=_[_0x758b('0x1e')](config[_0x758b('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x758b('0x1f'))(new Redis(config[_0x758b('0x1d')]));require(_0x758b('0x20'))[_0x758b('0x21')](socket);function respondWithStatusCode(_0x1cf173,_0x404719){_0x404719=_0x404719||0xcc;return function(_0x505129){if(_0x505129){return _0x1cf173[_0x758b('0x22')](_0x404719);}return _0x1cf173['status'](_0x404719)[_0x758b('0x23')]();};}function respondWithResult(_0x8aed40,_0x51fc10){_0x51fc10=_0x51fc10||0xc8;return function(_0x3833b8){if(_0x3833b8){return _0x8aed40[_0x758b('0x24')](_0x51fc10)[_0x758b('0x25')](_0x3833b8);}};}function respondWithFilteredResult(_0x56976f,_0x273593){return function(_0xe3210e){if(_0xe3210e){var _0x50fc7f=typeof _0x273593[_0x758b('0x26')]===_0x758b('0x27')&&typeof _0x273593[_0x758b('0x28')]===_0x758b('0x27');var _0x73c40c=_0xe3210e[_0x758b('0x29')];var _0x2bfc83=_0x50fc7f?0x0:_0x273593[_0x758b('0x26')];var _0x2e9f49=_0x50fc7f?_0xe3210e[_0x758b('0x29')]:_0x273593[_0x758b('0x26')]+_0x273593[_0x758b('0x28')];var _0x548dc3;if(_0x2e9f49>=_0x73c40c){_0x2e9f49=_0x73c40c;_0x548dc3=0xc8;}else{_0x548dc3=0xce;}_0x56976f[_0x758b('0x24')](_0x548dc3);return _0x56976f[_0x758b('0x2a')](_0x758b('0x2b'),_0x2bfc83+'-'+_0x2e9f49+'/'+_0x73c40c)['json'](_0xe3210e);}return null;};}function patchUpdates(_0x40b636){return function(_0x14258e){try{jsonpatch[_0x758b('0x2c')](_0x14258e,_0x40b636,!![]);}catch(_0x3d0fac){return BPromise['reject'](_0x3d0fac);}return _0x14258e['save']();};}function saveUpdates(_0x425125,_0x3a662b){return function(_0x654ae2){if(_0x654ae2){return _0x654ae2[_0x758b('0x2d')](_0x425125)[_0x758b('0x2e')](function(_0x1fbb6f){return _0x1fbb6f;});}return null;};}function removeEntity(_0x66d1ed,_0x24851b){return function(_0x46172c){if(_0x46172c){return _0x46172c['destroy']()[_0x758b('0x2e')](function(){var _0x5a3a11=_0x46172c[_0x758b('0x2f')]({'plain':!![]});var _0x104e46='MailQueues';return db[_0x758b('0x30')]['destroy']({'where':{'type':_0x104e46,'resourceId':_0x5a3a11['id']}})['then'](function(){return _0x46172c;});})[_0x758b('0x2e')](function(){_0x66d1ed[_0x758b('0x24')](0xcc)[_0x758b('0x23')]();});}};}function handleEntityNotFound(_0x491849,_0x293db5){return function(_0x495042){if(!_0x495042){_0x491849[_0x758b('0x22')](0x194);}return _0x495042;};}function handleError(_0x356e07,_0x5106b7){_0x5106b7=_0x5106b7||0x1f4;return function(_0x2fae1d){logger['error'](_0x2fae1d['stack']);if(_0x2fae1d[_0x758b('0x31')]){delete _0x2fae1d[_0x758b('0x31')];}_0x356e07['status'](_0x5106b7)[_0x758b('0x32')](_0x2fae1d);};}exports[_0x758b('0x33')]=function(_0x59820f,_0x1dacb1){var _0x5b577a={},_0x5b81be={},_0x447776={'count':0x0,'rows':[]};var _0x23facb=_[_0x758b('0x34')](db[_0x758b('0x35')][_0x758b('0x36')],function(_0x3c1fcd){return{'name':_0x3c1fcd[_0x758b('0x37')],'type':_0x3c1fcd[_0x758b('0x38')]['key']};});_0x5b81be['model']=_[_0x758b('0x34')](_0x23facb,_0x758b('0x31'));_0x5b81be[_0x758b('0x39')]=_[_0x758b('0x3a')](_0x59820f[_0x758b('0x39')]);_0x5b81be['filters']=_[_0x758b('0x3b')](_0x5b81be[_0x758b('0x3c')],_0x5b81be[_0x758b('0x39')]);_0x5b577a[_0x758b('0x3d')]=_[_0x758b('0x3b')](_0x5b81be[_0x758b('0x3c')],qs[_0x758b('0x3e')](_0x59820f[_0x758b('0x39')][_0x758b('0x3e')]));_0x5b577a[_0x758b('0x3d')]=_0x5b577a['attributes'][_0x758b('0x3f')]?_0x5b577a[_0x758b('0x3d')]:_0x5b81be[_0x758b('0x3c')];if(!_0x59820f[_0x758b('0x39')][_0x758b('0x40')]('nolimit')){_0x5b577a[_0x758b('0x28')]=qs[_0x758b('0x28')](_0x59820f['query'][_0x758b('0x28')]);_0x5b577a[_0x758b('0x26')]=qs[_0x758b('0x26')](_0x59820f['query']['offset']);}_0x5b577a[_0x758b('0x41')]=qs[_0x758b('0x42')](_0x59820f[_0x758b('0x39')][_0x758b('0x42')]);_0x5b577a[_0x758b('0x43')]=qs[_0x758b('0x44')](_[_0x758b('0x45')](_0x59820f[_0x758b('0x39')],_0x5b81be[_0x758b('0x44')]),_0x23facb);if(_0x59820f[_0x758b('0x39')][_0x758b('0x46')]){_0x5b577a['where']=_[_0x758b('0x47')](_0x5b577a['where'],{'$or':_[_0x758b('0x34')](_0x23facb,function(_0x27b69a){if(_0x27b69a['type']!=='VIRTUAL'){var _0x536efc={};_0x536efc[_0x27b69a[_0x758b('0x31')]]={'$like':'%'+_0x59820f[_0x758b('0x39')][_0x758b('0x46')]+'%'};return _0x536efc;}})});}_0x5b577a=_[_0x758b('0x47')]({},_0x5b577a,_0x59820f[_0x758b('0x48')]);var _0x2967f7={'where':_0x5b577a[_0x758b('0x43')]};return db[_0x758b('0x35')][_0x758b('0x29')](_0x2967f7)['then'](function(_0x4d1954){_0x447776[_0x758b('0x29')]=_0x4d1954;if(_0x59820f['query'][_0x758b('0x49')]){_0x5b577a['include']=[{'all':!![]}];}return db['MailQueue'][_0x758b('0x4a')](_0x5b577a);})[_0x758b('0x2e')](function(_0x22f6c8){_0x447776[_0x758b('0x4b')]=_0x22f6c8;return _0x447776;})[_0x758b('0x2e')](respondWithFilteredResult(_0x1dacb1,_0x5b577a))[_0x758b('0x4c')](handleError(_0x1dacb1,null));};exports[_0x758b('0x4d')]=function(_0x369e46,_0x2769d4){var _0x27d064={'raw':!![],'where':{'id':_0x369e46[_0x758b('0x4e')]['id']}},_0xc92865={};_0xc92865[_0x758b('0x3c')]=_[_0x758b('0x3a')](db['MailQueue'][_0x758b('0x36')]);_0xc92865[_0x758b('0x39')]=_[_0x758b('0x3a')](_0x369e46[_0x758b('0x39')]);_0xc92865[_0x758b('0x44')]=_['intersection'](_0xc92865['model'],_0xc92865[_0x758b('0x39')]);_0x27d064['attributes']=_[_0x758b('0x3b')](_0xc92865[_0x758b('0x3c')],qs[_0x758b('0x3e')](_0x369e46[_0x758b('0x39')][_0x758b('0x3e')]));_0x27d064[_0x758b('0x3d')]=_0x27d064[_0x758b('0x3d')][_0x758b('0x3f')]?_0x27d064[_0x758b('0x3d')]:_0xc92865[_0x758b('0x3c')];if(_0x369e46[_0x758b('0x39')][_0x758b('0x49')]){_0x27d064[_0x758b('0x4f')]=[{'all':!![]}];}_0x27d064=_[_0x758b('0x47')]({},_0x27d064,_0x369e46[_0x758b('0x48')]);return db[_0x758b('0x35')][_0x758b('0x50')](_0x27d064)[_0x758b('0x2e')](handleEntityNotFound(_0x2769d4,null))[_0x758b('0x2e')](respondWithResult(_0x2769d4,null))[_0x758b('0x4c')](handleError(_0x2769d4,null));};exports[_0x758b('0x51')]=function(_0x3999ad,_0x5a2252){return db[_0x758b('0x35')][_0x758b('0x51')](_0x3999ad['body'],{})[_0x758b('0x2e')](function(_0xab90cb){var _0x4e0a4b=_0x3999ad['user'][_0x758b('0x2f')]({'plain':!![]});if(!_0x4e0a4b)throw new Error(_0x758b('0x52'));if(_0x4e0a4b[_0x758b('0x53')]===_0x758b('0x54')){var _0x32ab05=_0xab90cb['get']({'plain':!![]});var _0x367e9c=_0x758b('0x55');return db[_0x758b('0x56')][_0x758b('0x50')]({'where':{'name':_0x367e9c,'userProfileId':_0x4e0a4b['userProfileId']},'raw':!![]})[_0x758b('0x2e')](function(_0x3de93c){if(_0x3de93c&&_0x3de93c[_0x758b('0x57')]===0x0){return db[_0x758b('0x30')]['create']({'name':_0x32ab05[_0x758b('0x31')],'resourceId':_0x32ab05['id'],'type':_0x3de93c[_0x758b('0x31')],'sectionId':_0x3de93c['id']},{})['then'](function(){return _0xab90cb;});}else{return _0xab90cb;}})[_0x758b('0x4c')](function(_0x408eb2){logger[_0x758b('0x58')](_0x758b('0x59'),_0x408eb2);throw _0x408eb2;});}return _0xab90cb;})[_0x758b('0x2e')](respondWithResult(_0x5a2252,0xc9))['catch'](handleError(_0x5a2252,null));};exports[_0x758b('0x2d')]=function(_0x9e3162,_0x253269){if(_0x9e3162[_0x758b('0x5a')]['id']){delete _0x9e3162[_0x758b('0x5a')]['id'];}return db[_0x758b('0x35')][_0x758b('0x50')]({'where':{'id':_0x9e3162[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](handleEntityNotFound(_0x253269,null))[_0x758b('0x2e')](saveUpdates(_0x9e3162[_0x758b('0x5a')],null))['then'](respondWithResult(_0x253269,null))[_0x758b('0x4c')](handleError(_0x253269,null));};exports[_0x758b('0x5b')]=function(_0x5aa4e3,_0x1214b4){return db[_0x758b('0x35')]['find']({'where':{'id':_0x5aa4e3[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](handleEntityNotFound(_0x1214b4,null))[_0x758b('0x2e')](removeEntity(_0x1214b4,null))['catch'](handleError(_0x1214b4,null));};exports[_0x758b('0x5c')]=function(_0x56831c,_0x46ba75){return db[_0x758b('0x35')][_0x758b('0x5c')]()[_0x758b('0x2e')](respondWithResult(_0x46ba75,null))[_0x758b('0x4c')](handleError(_0x46ba75,null));};exports[_0x758b('0x5d')]=function(_0x3da958,_0x2afad6,_0x3742b0){var _0x29d8b6={'raw':!![],'where':{}},_0x43cc96={},_0x5469d9;return db[_0x758b('0x35')][_0x758b('0x5e')]({'where':{'id':_0x3da958[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](handleEntityNotFound(_0x2afad6,null))[_0x758b('0x2e')](function(_0x2432e3){if(_0x2432e3){_0x5469d9=_0x2432e3[_0x758b('0x2f')]({'plain':!![]});_0x43cc96['model']=_['keys'](db[_0x758b('0x5f')][_0x758b('0x36')]);_0x43cc96[_0x758b('0x39')]=_[_0x758b('0x3a')](_0x3da958[_0x758b('0x39')]);_0x43cc96[_0x758b('0x44')]=_[_0x758b('0x3b')](_0x43cc96[_0x758b('0x3c')],_0x43cc96[_0x758b('0x39')]);_0x29d8b6[_0x758b('0x3d')]=_[_0x758b('0x3b')](_0x43cc96[_0x758b('0x3c')],qs[_0x758b('0x3e')](_0x3da958[_0x758b('0x39')]['fields']));_0x29d8b6[_0x758b('0x3d')]=_0x29d8b6['attributes'][_0x758b('0x3f')]?_0x29d8b6['attributes']:_0x43cc96[_0x758b('0x3c')];if(!_0x3da958[_0x758b('0x39')][_0x758b('0x40')]('nolimit')){_0x29d8b6['limit']=qs[_0x758b('0x28')](_0x3da958[_0x758b('0x39')]['limit']);_0x29d8b6[_0x758b('0x26')]=qs[_0x758b('0x26')](_0x3da958[_0x758b('0x39')][_0x758b('0x26')]);}_0x29d8b6[_0x758b('0x41')]=qs[_0x758b('0x42')](_0x3da958[_0x758b('0x39')][_0x758b('0x42')]);_0x29d8b6['where']=qs['filters'](_[_0x758b('0x45')](_0x3da958[_0x758b('0x39')],_0x43cc96[_0x758b('0x44')]));_0x29d8b6[_0x758b('0x43')][_0x758b('0x60')]=_0x2432e3['id'];if(_0x3da958[_0x758b('0x39')][_0x758b('0x46')]){_0x29d8b6[_0x758b('0x43')]=_[_0x758b('0x47')](_0x29d8b6['where'],{'$or':_[_0x758b('0x34')](_0x29d8b6[_0x758b('0x3d')],function(_0x1ef08a){var _0xd2db43={};_0xd2db43[_0x1ef08a]={'$like':'%'+_0x3da958[_0x758b('0x39')][_0x758b('0x46')]+'%'};return _0xd2db43;})});}_0x29d8b6=_['merge']({},_0x29d8b6,_0x3da958[_0x758b('0x48')]);return db[_0x758b('0x5f')]['findAll'](_0x29d8b6);}})[_0x758b('0x2e')](function(_0x4bde9c){if(_0x4bde9c){return db[_0x758b('0x61')]['findAndCountAll']({'where':{'id':_[_0x758b('0x34')](_0x4bde9c,_0x758b('0x62')),'role':_0x758b('0x63')},'attributes':['id',_0x758b('0x31'),_0x758b('0x64'),_0x758b('0x65'),_0x758b('0x66')]});}})['then'](function(_0x3bc89b){if(_0x3bc89b){return{'count':_0x3bc89b[_0x758b('0x29')],'rows':_['map'](_0x3bc89b[_0x758b('0x4b')],function(_0x3b6944){return{'membername':_0x3b6944['name'],'UserId':_0x3b6944['id'],'queue_name':_0x5469d9[_0x758b('0x31')],'MailQueueId':_0x5469d9['id'],'interface':util[_0x758b('0x67')](_0x758b('0x68'),_0x758b('0x69'),_0x3b6944[_0x758b('0x31')]),'penalty':0x0,'paused':_0x3b6944[_0x758b('0x64')],'createdAt':_0x3b6944[_0x758b('0x66')],'updatedAt':_0x3b6944[_0x758b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2afad6,_0x29d8b6))[_0x758b('0x4c')](handleError(_0x2afad6,null));};exports[_0x758b('0x6a')]=function(_0x2d9836,_0x1a708f,_0x72b667){var _0x2dca9f={};var _0x45f080={};var _0xde8c54;var _0x35914c;return db[_0x758b('0x35')]['findOne']({'where':{'id':_0x2d9836[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](handleEntityNotFound(_0x1a708f,null))[_0x758b('0x2e')](function(_0x78df57){if(_0x78df57){_0xde8c54=_0x78df57;_0x45f080[_0x758b('0x3c')]=_[_0x758b('0x3a')](db[_0x758b('0x6b')][_0x758b('0x36')]);_0x45f080['query']=_[_0x758b('0x3a')](_0x2d9836[_0x758b('0x39')]);_0x45f080['filters']=_[_0x758b('0x3b')](_0x45f080[_0x758b('0x3c')],_0x45f080[_0x758b('0x39')]);_0x2dca9f['attributes']=_['intersection'](_0x45f080[_0x758b('0x3c')],qs[_0x758b('0x3e')](_0x2d9836[_0x758b('0x39')][_0x758b('0x3e')]));_0x2dca9f[_0x758b('0x3d')]=_0x2dca9f['attributes'][_0x758b('0x3f')]?_0x2dca9f['attributes']:_0x45f080['model'];_0x2dca9f[_0x758b('0x41')]=qs['sort'](_0x2d9836[_0x758b('0x39')][_0x758b('0x42')]);_0x2dca9f[_0x758b('0x43')]=qs['filters'](_[_0x758b('0x45')](_0x2d9836['query'],_0x45f080['filters']));if(_0x2d9836['query']['filter']){_0x2dca9f[_0x758b('0x43')]=_['merge'](_0x2dca9f['where'],{'$or':_['map'](_0x2dca9f[_0x758b('0x3d')],function(_0x392259){var _0x4b9c1a={};_0x4b9c1a[_0x392259]={'$like':'%'+_0x2d9836[_0x758b('0x39')]['filter']+'%'};return _0x4b9c1a;})});}_0x2dca9f=_[_0x758b('0x47')]({},_0x2dca9f,_0x2d9836['options']);return _0xde8c54[_0x758b('0x6a')](_0x2dca9f);}})[_0x758b('0x2e')](function(_0xdb70e4){if(_0xdb70e4){_0x35914c=_0xdb70e4[_0x758b('0x3f')];if(!_0x2d9836[_0x758b('0x39')][_0x758b('0x40')]('nolimit')){_0x2dca9f[_0x758b('0x28')]=qs[_0x758b('0x28')](_0x2d9836[_0x758b('0x39')]['limit']);_0x2dca9f[_0x758b('0x26')]=qs[_0x758b('0x26')](_0x2d9836[_0x758b('0x39')][_0x758b('0x26')]);}return _0xde8c54[_0x758b('0x6a')](_0x2dca9f);}})[_0x758b('0x2e')](function(_0x97ae6e){if(_0x97ae6e){return _0x97ae6e?{'count':_0x35914c,'rows':_0x97ae6e}:null;}})['then'](respondWithResult(_0x1a708f,null))[_0x758b('0x4c')](handleError(_0x1a708f,null));};exports[_0x758b('0x6c')]=function(_0x31039b,_0x588a4e,_0x48c452){var _0x54cf57=_0x31039b['body'][_0x758b('0x6d')];return db[_0x758b('0x6b')][_0x758b('0x4a')]({'where':{'id':_0x54cf57},'attributes':['id'],'include':[{'model':db[_0x758b('0x61')],'as':_0x758b('0x6e'),'attributes':['id',_0x758b('0x31'),_0x758b('0x6f'),_0x758b('0x70'),_0x758b('0x71')],'raw':!![]}]})[_0x758b('0x2e')](function(_0x4b824b){if(_0x4b824b){var _0x138eda=_[_0x758b('0x72')](_0x4b824b,function(_0x538df8){var _0x1c39dc=_0x538df8[_0x758b('0x2f')]({'plain':!![]});return _0x1c39dc[_0x758b('0x6e')];});return db[_0x758b('0x35')][_0x758b('0x50')]({'where':{'id':_0x31039b[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](function(_0x4f02dd){return db['sequelize'][_0x758b('0x73')](function(_0x53ed73){return _0x4f02dd[_0x758b('0x6c')](_0x54cf57,{'transaction':_0x53ed73})[_0x758b('0x2e')](function(){return BPromise[_0x758b('0x74')](_0x138eda,function(_0x1bdb63){return db[_0x758b('0x5f')]['findOrCreate']({'where':{'UserId':_0x1bdb63['id'],'MailQueueId':_0x31039b[_0x758b('0x4e')]['id']},'transaction':_0x53ed73});});})[_0x758b('0x2e')](function(){_0x138eda[_0x758b('0x75')](function(_0x5b0966){socket['emit'](_0x758b('0x76'),{'UserId':_0x5b0966['id'],'MailQueueId':_0x4f02dd['id']});});});});});}})['then'](respondWithStatusCode(_0x588a4e,null))[_0x758b('0x4c')](handleError(_0x588a4e,null));};exports['removeTeams']=function(_0x446936,_0x2dfd99,_0x5ea83c){return db['Team'][_0x758b('0x4a')]({'where':{'id':_0x446936[_0x758b('0x39')][_0x758b('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x758b('0x61')],'as':_0x758b('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2dfd99,null))[_0x758b('0x2e')](function(_0x3f910f){var _0x5867d8=_['map'](_0x3f910f,'id');var _0xa068e2=[];var _0x311233=[];var _0x2e469d=squel[_0x758b('0x77')]();_0x2e469d[_0x758b('0x78')](_0x758b('0x79'))[_0x758b('0x7a')](_0x758b('0x7b'),'tq')[_0x758b('0x7c')](_0x758b('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x758b('0x43')](_0x758b('0x7e'),_0x446936[_0x758b('0x4e')]['id']);for(var _0x7cbf50=0x0;_0x7cbf50<_0x3f910f['length'];_0x7cbf50+=0x1){let _0x2d839b=_0x3f910f[_0x7cbf50];for(var _0x190562=0x0;_0x190562<_0x2d839b[_0x758b('0x6e')]['length'];_0x190562+=0x1){let _0x3270bd=_0x2d839b[_0x758b('0x6e')][_0x190562];var _0x4854f3=_0x2e469d[_0x758b('0x7f')]();_0x4854f3[_0x758b('0x43')]('ut.UserId\x20=\x20?',_0x3270bd['id']);_0x311233[_0x758b('0x80')](db[_0x758b('0x81')][_0x758b('0x39')](_0x4854f3[_0x758b('0x82')](),{'type':db[_0x758b('0x81')][_0x758b('0x83')][_0x758b('0x84')]})[_0x758b('0x2e')](function(_0x387d05){if(_0x387d05[_0x758b('0x3f')]===0x1){return _0x3270bd['id'];}else{var _0x142549=_[_0x758b('0x85')](_[_0x758b('0x34')](_0x387d05,_0x758b('0x86')),function(_0x22bfc7){return _[_0x758b('0x87')](_0x5867d8,_0x22bfc7);});if(_0x142549){return _0x3270bd['id'];}}}));}}return BPromise['all'](_0x311233)[_0x758b('0x2e')](function(_0x27289b){_0xa068e2=_(_0xa068e2)['union'](_0x27289b)[_0x758b('0x88')]()[_0x758b('0x89')]();return db['MailQueue'][_0x758b('0x50')]({'where':{'id':_0x446936['params']['id']}})[_0x758b('0x2e')](function(_0x162c46){return db[_0x758b('0x81')]['transaction'](function(_0x15a1b9){return _0x162c46[_0x758b('0x8a')](_0x446936['query'][_0x758b('0x6d')],{'transaction':_0x15a1b9})[_0x758b('0x2e')](function(){if(!_[_0x758b('0x8b')](_0xa068e2)){return _0x162c46[_0x758b('0x8c')](_0xa068e2,{'transaction':_0x15a1b9});}})[_0x758b('0x2e')](function(){_0xa068e2[_0x758b('0x75')](function(_0x220511){socket[_0x758b('0x8d')]('userMailQueue:remove',{'UserId':_0x220511,'MailQueueId':_0x162c46['id']});});});});});});})['then'](respondWithStatusCode(_0x2dfd99,null))[_0x758b('0x4c')](handleError(_0x2dfd99,null));};exports[_0x758b('0x8e')]=function(_0x1c40e3,_0x32fa2a,_0x29ed2a){return db['MailQueue'][_0x758b('0x50')]({'where':{'id':_0x1c40e3[_0x758b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32fa2a,null))['then'](function(_0xb2e04d){if(_0xb2e04d){return _0xb2e04d['addAgents'](_0x1c40e3[_0x758b('0x5a')][_0x758b('0x6d')],_['omit'](_0x1c40e3['body'],['ids','id'])||{})[_0x758b('0x8f')](function(_0x116090){for(var _0x2cef68=0x0;_0x2cef68<_0x1c40e3[_0x758b('0x5a')][_0x758b('0x6d')][_0x758b('0x3f')];_0x2cef68+=0x1){socket[_0x758b('0x8d')]('userMailQueue:save',{'UserId':Number(_0x1c40e3[_0x758b('0x5a')][_0x758b('0x6d')][_0x2cef68]),'MailQueueId':Number(_0x1c40e3[_0x758b('0x4e')]['id'])});}return _0x116090;});}})['then'](respondWithResult(_0x32fa2a,null))[_0x758b('0x4c')](handleError(_0x32fa2a,null));};exports[_0x758b('0x8c')]=function(_0xe28b87,_0xf6723b,_0x558179){return db['MailQueue'][_0x758b('0x50')]({'where':{'id':_0xe28b87[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](handleEntityNotFound(_0xf6723b,null))[_0x758b('0x2e')](function(_0x4eecb4){if(_0x4eecb4){return _0x4eecb4[_0x758b('0x8c')](_0xe28b87[_0x758b('0x39')][_0x758b('0x6d')])[_0x758b('0x2e')](function(){if(_[_0x758b('0x90')](_0xe28b87['query'][_0x758b('0x6d')])){for(var _0x5b5e1a=0x0;_0x5b5e1a<_0xe28b87[_0x758b('0x39')]['ids'][_0x758b('0x3f')];_0x5b5e1a+=0x1){socket[_0x758b('0x8d')](_0x758b('0x91'),{'UserId':Number(_0xe28b87['query'][_0x758b('0x6d')][_0x5b5e1a]),'MailQueueId':Number(_0xe28b87[_0x758b('0x4e')]['id'])});}}else{socket[_0x758b('0x8d')](_0x758b('0x91'),{'UserId':Number(_0xe28b87[_0x758b('0x39')]['ids']),'MailQueueId':Number(_0xe28b87['params']['id'])});}});}})['then'](respondWithStatusCode(_0xf6723b,null))['catch'](handleError(_0xf6723b,null));};exports[_0x758b('0x92')]=function(_0x4adde0,_0x56f687,_0x1c58a2){var _0x102c50={};var _0x32737f={};var _0x2347aa;var _0x3c6d04;return db[_0x758b('0x35')][_0x758b('0x5e')]({'where':{'id':_0x4adde0[_0x758b('0x4e')]['id']}})[_0x758b('0x2e')](handleEntityNotFound(_0x56f687,null))[_0x758b('0x2e')](function(_0x171612){if(_0x171612){_0x2347aa=_0x171612;_0x32737f[_0x758b('0x3c')]=_[_0x758b('0x3a')](db[_0x758b('0x61')][_0x758b('0x36')]);_0x32737f['query']=_[_0x758b('0x3a')](_0x4adde0[_0x758b('0x39')]);_0x32737f[_0x758b('0x44')]=_[_0x758b('0x3b')](_0x32737f[_0x758b('0x3c')],_0x32737f[_0x758b('0x39')]);_0x102c50[_0x758b('0x3d')]=_['intersection'](_0x32737f[_0x758b('0x3c')],qs[_0x758b('0x3e')](_0x4adde0[_0x758b('0x39')]['fields']));_0x102c50[_0x758b('0x3d')]=_0x102c50[_0x758b('0x3d')][_0x758b('0x3f')]?_0x102c50[_0x758b('0x3d')]:_0x32737f[_0x758b('0x3c')];_0x102c50['order']=qs['sort'](_0x4adde0[_0x758b('0x39')][_0x758b('0x42')]);_0x102c50[_0x758b('0x43')]=qs['filters'](_[_0x758b('0x45')](_0x4adde0[_0x758b('0x39')],_0x32737f[_0x758b('0x44')]));if(_0x4adde0[_0x758b('0x39')]['filter']){_0x102c50[_0x758b('0x43')]=_['merge'](_0x102c50[_0x758b('0x43')],{'$or':_[_0x758b('0x34')](_0x102c50[_0x758b('0x3d')],function(_0x451b2c){var _0x11ab9e={};_0x11ab9e[_0x451b2c]={'$like':'%'+_0x4adde0['query'][_0x758b('0x46')]+'%'};return _0x11ab9e;})});}_0x102c50=_['merge']({},_0x102c50,_0x4adde0[_0x758b('0x48')]);return _0x2347aa[_0x758b('0x92')](_0x102c50);}})[_0x758b('0x2e')](function(_0x3626a1){if(_0x3626a1){_0x3c6d04=_0x3626a1[_0x758b('0x3f')];if(!_0x4adde0[_0x758b('0x39')][_0x758b('0x40')](_0x758b('0x93'))){_0x102c50['limit']=qs[_0x758b('0x28')](_0x4adde0['query'][_0x758b('0x28')]);_0x102c50[_0x758b('0x26')]=qs[_0x758b('0x26')](_0x4adde0[_0x758b('0x39')][_0x758b('0x26')]);}return _0x2347aa['getAgents'](_0x102c50);}})['then'](function(_0x144c3c){if(_0x144c3c){return _0x144c3c?{'count':_0x3c6d04,'rows':_0x144c3c}:null;}})['then'](respondWithResult(_0x56f687,null))[_0x758b('0x4c')](handleError(_0x56f687,null));}; \ No newline at end of file +var _0x1841=['include','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','UserMailQueue','MailQueueId','filter','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','hasOwnProperty','online','voicePause','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','User','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','get','MailQueues','sendStatus','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','includeAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1841,0xdf));var _0x1184=function(_0x4705f9,_0xd5ef3){_0x4705f9=_0x4705f9-0x0;var _0x295e4b=_0x1841[_0x4705f9];return _0x295e4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1184('0x0'));var zipdir=require(_0x1184('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1184('0x2'));var BPromise=require(_0x1184('0x3'));var Mustache=require(_0x1184('0x4'));var util=require(_0x1184('0x5'));var path=require(_0x1184('0x6'));var sox=require('sox');var csv=require(_0x1184('0x7'));var ejs=require(_0x1184('0x8'));var fs=require('fs');var fs_extra=require(_0x1184('0x9'));var _=require(_0x1184('0xa'));var squel=require(_0x1184('0xb'));var crypto=require(_0x1184('0xc'));var jsforce=require(_0x1184('0xd'));var deskjs=require(_0x1184('0xe'));var toCsv=require(_0x1184('0x7'));var querystring=require(_0x1184('0xf'));var Papa=require(_0x1184('0x10'));var Redis=require(_0x1184('0x11'));var authService=require(_0x1184('0x12'));var qs=require(_0x1184('0x13'));var as=require(_0x1184('0x14'));var hardwareService=require(_0x1184('0x15'));var logger=require(_0x1184('0x16'))(_0x1184('0x17'));var utils=require(_0x1184('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1184('0x19'));var db=require(_0x1184('0x1a'))['db'];config[_0x1184('0x1b')]=_[_0x1184('0x1c')](config[_0x1184('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1184('0x1d'))(new Redis(config[_0x1184('0x1b')]));require(_0x1184('0x1e'))['register'](socket);function respondWithStatusCode(_0x54283b,_0x27637d){_0x27637d=_0x27637d||0xcc;return function(_0x4a9543){if(_0x4a9543){return _0x54283b['sendStatus'](_0x27637d);}return _0x54283b[_0x1184('0x1f')](_0x27637d)[_0x1184('0x20')]();};}function respondWithResult(_0xdfe346,_0x3e1d78){_0x3e1d78=_0x3e1d78||0xc8;return function(_0x56f21c){if(_0x56f21c){return _0xdfe346[_0x1184('0x1f')](_0x3e1d78)[_0x1184('0x21')](_0x56f21c);}};}function respondWithFilteredResult(_0x14e379,_0x2e30f6){return function(_0x2ce3c0){if(_0x2ce3c0){var _0x5bf7e7=typeof _0x2e30f6[_0x1184('0x22')]===_0x1184('0x23')&&typeof _0x2e30f6['limit']===_0x1184('0x23');var _0x4a64d6=_0x2ce3c0[_0x1184('0x24')];var _0x301bfe=_0x5bf7e7?0x0:_0x2e30f6['offset'];var _0x50f80f=_0x5bf7e7?_0x2ce3c0['count']:_0x2e30f6[_0x1184('0x22')]+_0x2e30f6[_0x1184('0x25')];var _0x5af629;if(_0x50f80f>=_0x4a64d6){_0x50f80f=_0x4a64d6;_0x5af629=0xc8;}else{_0x5af629=0xce;}_0x14e379[_0x1184('0x1f')](_0x5af629);return _0x14e379[_0x1184('0x26')](_0x1184('0x27'),_0x301bfe+'-'+_0x50f80f+'/'+_0x4a64d6)['json'](_0x2ce3c0);}return null;};}function patchUpdates(_0x220ef1){return function(_0x28bc84){try{jsonpatch['apply'](_0x28bc84,_0x220ef1,!![]);}catch(_0x50d242){return BPromise['reject'](_0x50d242);}return _0x28bc84[_0x1184('0x28')]();};}function saveUpdates(_0x250d9b,_0x31b0d0){return function(_0x202616){if(_0x202616){return _0x202616['update'](_0x250d9b)[_0x1184('0x29')](function(_0x348bd8){return _0x348bd8;});}return null;};}function removeEntity(_0x1f2a6a,_0x32a97b){return function(_0x31293a){if(_0x31293a){return _0x31293a[_0x1184('0x2a')]()['then'](function(){var _0x333d6a=_0x31293a[_0x1184('0x2b')]({'plain':!![]});var _0x5910c4=_0x1184('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5910c4,'resourceId':_0x333d6a['id']}})[_0x1184('0x29')](function(){return _0x31293a;});})['then'](function(){_0x1f2a6a[_0x1184('0x1f')](0xcc)[_0x1184('0x20')]();});}};}function handleEntityNotFound(_0xcffbf6,_0x11d92f){return function(_0xad0370){if(!_0xad0370){_0xcffbf6[_0x1184('0x2d')](0x194);}return _0xad0370;};}function handleError(_0x52aac3,_0x1ed2f6){_0x1ed2f6=_0x1ed2f6||0x1f4;return function(_0x5b8c72){logger[_0x1184('0x2e')](_0x5b8c72[_0x1184('0x2f')]);if(_0x5b8c72[_0x1184('0x30')]){delete _0x5b8c72['name'];}_0x52aac3[_0x1184('0x1f')](_0x1ed2f6)[_0x1184('0x31')](_0x5b8c72);};}exports['index']=function(_0xef33fa,_0x327329){var _0x436c32={},_0x2f5231={},_0x2ae33b={'count':0x0,'rows':[]};var _0xb49ffa=_['map'](db[_0x1184('0x32')][_0x1184('0x33')],function(_0x2cebad){return{'name':_0x2cebad[_0x1184('0x34')],'type':_0x2cebad[_0x1184('0x35')][_0x1184('0x36')]};});_0x2f5231['model']=_[_0x1184('0x37')](_0xb49ffa,_0x1184('0x30'));_0x2f5231['query']=_[_0x1184('0x38')](_0xef33fa[_0x1184('0x39')]);_0x2f5231[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x2f5231[_0x1184('0x3c')],_0x2f5231[_0x1184('0x39')]);_0x436c32['attributes']=_[_0x1184('0x3b')](_0x2f5231[_0x1184('0x3c')],qs[_0x1184('0x3d')](_0xef33fa[_0x1184('0x39')][_0x1184('0x3d')]));_0x436c32[_0x1184('0x3e')]=_0x436c32[_0x1184('0x3e')][_0x1184('0x3f')]?_0x436c32[_0x1184('0x3e')]:_0x2f5231[_0x1184('0x3c')];if(!_0xef33fa[_0x1184('0x39')]['hasOwnProperty']('nolimit')){_0x436c32[_0x1184('0x25')]=qs['limit'](_0xef33fa[_0x1184('0x39')][_0x1184('0x25')]);_0x436c32['offset']=qs[_0x1184('0x22')](_0xef33fa['query'][_0x1184('0x22')]);}_0x436c32[_0x1184('0x40')]=qs[_0x1184('0x41')](_0xef33fa['query'][_0x1184('0x41')]);_0x436c32[_0x1184('0x42')]=qs['filters'](_[_0x1184('0x43')](_0xef33fa[_0x1184('0x39')],_0x2f5231[_0x1184('0x3a')]),_0xb49ffa);if(_0xef33fa[_0x1184('0x39')]['filter']){_0x436c32[_0x1184('0x42')]=_[_0x1184('0x44')](_0x436c32[_0x1184('0x42')],{'$or':_['map'](_0xb49ffa,function(_0x531fea){if(_0x531fea[_0x1184('0x35')]!==_0x1184('0x45')){var _0x132f99={};_0x132f99[_0x531fea[_0x1184('0x30')]]={'$like':'%'+_0xef33fa[_0x1184('0x39')]['filter']+'%'};return _0x132f99;}})});}_0x436c32=_[_0x1184('0x44')]({},_0x436c32,_0xef33fa['options']);var _0x503692={'where':_0x436c32[_0x1184('0x42')]};return db[_0x1184('0x32')][_0x1184('0x24')](_0x503692)[_0x1184('0x29')](function(_0x252615){_0x2ae33b['count']=_0x252615;if(_0xef33fa[_0x1184('0x39')][_0x1184('0x46')]){_0x436c32[_0x1184('0x47')]=[{'all':!![]}];}return db[_0x1184('0x32')]['findAll'](_0x436c32);})[_0x1184('0x29')](function(_0x420864){_0x2ae33b[_0x1184('0x48')]=_0x420864;return _0x2ae33b;})[_0x1184('0x29')](respondWithFilteredResult(_0x327329,_0x436c32))[_0x1184('0x49')](handleError(_0x327329,null));};exports[_0x1184('0x4a')]=function(_0x18c72a,_0x3a7e9d){var _0x37b553={'raw':!![],'where':{'id':_0x18c72a[_0x1184('0x4b')]['id']}},_0x331270={};_0x331270[_0x1184('0x3c')]=_[_0x1184('0x38')](db[_0x1184('0x32')][_0x1184('0x33')]);_0x331270[_0x1184('0x39')]=_[_0x1184('0x38')](_0x18c72a[_0x1184('0x39')]);_0x331270[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x331270[_0x1184('0x3c')],_0x331270[_0x1184('0x39')]);_0x37b553[_0x1184('0x3e')]=_[_0x1184('0x3b')](_0x331270['model'],qs['fields'](_0x18c72a[_0x1184('0x39')][_0x1184('0x3d')]));_0x37b553[_0x1184('0x3e')]=_0x37b553[_0x1184('0x3e')][_0x1184('0x3f')]?_0x37b553[_0x1184('0x3e')]:_0x331270['model'];if(_0x18c72a[_0x1184('0x39')][_0x1184('0x46')]){_0x37b553[_0x1184('0x47')]=[{'all':!![]}];}_0x37b553=_['merge']({},_0x37b553,_0x18c72a[_0x1184('0x4c')]);return db[_0x1184('0x32')]['find'](_0x37b553)[_0x1184('0x29')](handleEntityNotFound(_0x3a7e9d,null))['then'](respondWithResult(_0x3a7e9d,null))[_0x1184('0x49')](handleError(_0x3a7e9d,null));};exports[_0x1184('0x4d')]=function(_0x3104d2,_0x45e9ab){return db[_0x1184('0x32')][_0x1184('0x4d')](_0x3104d2[_0x1184('0x4e')],{})[_0x1184('0x29')](function(_0x495bc1){var _0x191097=_0x3104d2[_0x1184('0x4f')]['get']({'plain':!![]});if(!_0x191097)throw new Error(_0x1184('0x50'));if(_0x191097[_0x1184('0x51')]===_0x1184('0x4f')){var _0x4c2bab=_0x495bc1[_0x1184('0x2b')]({'plain':!![]});var _0xfcb93e=_0x1184('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0xfcb93e,'userProfileId':_0x191097[_0x1184('0x52')]},'raw':!![]})['then'](function(_0x53caf2){if(_0x53caf2&&_0x53caf2[_0x1184('0x53')]===0x0){return db[_0x1184('0x54')][_0x1184('0x4d')]({'name':_0x4c2bab[_0x1184('0x30')],'resourceId':_0x4c2bab['id'],'type':_0x53caf2[_0x1184('0x30')],'sectionId':_0x53caf2['id']},{})['then'](function(){return _0x495bc1;});}else{return _0x495bc1;}})[_0x1184('0x49')](function(_0x262b85){logger['error'](_0x1184('0x55'),_0x262b85);throw _0x262b85;});}return _0x495bc1;})[_0x1184('0x29')](respondWithResult(_0x45e9ab,0xc9))[_0x1184('0x49')](handleError(_0x45e9ab,null));};exports[_0x1184('0x56')]=function(_0x4a1e0c,_0x3abff0){if(_0x4a1e0c[_0x1184('0x4e')]['id']){delete _0x4a1e0c[_0x1184('0x4e')]['id'];}return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x4a1e0c[_0x1184('0x4b')]['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x3abff0,null))[_0x1184('0x29')](saveUpdates(_0x4a1e0c['body'],null))['then'](respondWithResult(_0x3abff0,null))['catch'](handleError(_0x3abff0,null));};exports[_0x1184('0x2a')]=function(_0x2b8b86,_0xc2c883){return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x2b8b86[_0x1184('0x4b')]['id']}})[_0x1184('0x29')](handleEntityNotFound(_0xc2c883,null))[_0x1184('0x29')](removeEntity(_0xc2c883,null))['catch'](handleError(_0xc2c883,null));};exports['describe']=function(_0x2cf128,_0x3598f4){return db[_0x1184('0x32')][_0x1184('0x58')]()[_0x1184('0x29')](respondWithResult(_0x3598f4,null))[_0x1184('0x49')](handleError(_0x3598f4,null));};exports[_0x1184('0x59')]=function(_0x12cb2b,_0x4eb396,_0x424f7a){var _0x2e9380={'raw':!![],'where':{}},_0x598751={},_0x50003d;return db[_0x1184('0x32')][_0x1184('0x5a')]({'where':{'id':_0x12cb2b[_0x1184('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4eb396,null))['then'](function(_0x12417a){if(_0x12417a){_0x50003d=_0x12417a[_0x1184('0x2b')]({'plain':!![]});_0x598751[_0x1184('0x3c')]=_['keys'](db[_0x1184('0x5b')][_0x1184('0x33')]);_0x598751[_0x1184('0x39')]=_[_0x1184('0x38')](_0x12cb2b[_0x1184('0x39')]);_0x598751[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x598751[_0x1184('0x3c')],_0x598751[_0x1184('0x39')]);_0x2e9380[_0x1184('0x3e')]=_[_0x1184('0x3b')](_0x598751[_0x1184('0x3c')],qs['fields'](_0x12cb2b[_0x1184('0x39')][_0x1184('0x3d')]));_0x2e9380[_0x1184('0x3e')]=_0x2e9380[_0x1184('0x3e')][_0x1184('0x3f')]?_0x2e9380['attributes']:_0x598751['model'];if(!_0x12cb2b[_0x1184('0x39')]['hasOwnProperty']('nolimit')){_0x2e9380['limit']=qs[_0x1184('0x25')](_0x12cb2b[_0x1184('0x39')]['limit']);_0x2e9380[_0x1184('0x22')]=qs[_0x1184('0x22')](_0x12cb2b[_0x1184('0x39')]['offset']);}_0x2e9380[_0x1184('0x40')]=qs[_0x1184('0x41')](_0x12cb2b[_0x1184('0x39')]['sort']);_0x2e9380[_0x1184('0x42')]=qs[_0x1184('0x3a')](_[_0x1184('0x43')](_0x12cb2b[_0x1184('0x39')],_0x598751['filters']));_0x2e9380[_0x1184('0x42')][_0x1184('0x5c')]=_0x12417a['id'];if(_0x12cb2b[_0x1184('0x39')][_0x1184('0x5d')]){_0x2e9380['where']=_[_0x1184('0x44')](_0x2e9380[_0x1184('0x42')],{'$or':_[_0x1184('0x37')](_0x2e9380[_0x1184('0x3e')],function(_0x320f4a){var _0xbb88d8={};_0xbb88d8[_0x320f4a]={'$like':'%'+_0x12cb2b[_0x1184('0x39')][_0x1184('0x5d')]+'%'};return _0xbb88d8;})});}_0x2e9380=_[_0x1184('0x44')]({},_0x2e9380,_0x12cb2b[_0x1184('0x4c')]);return db['UserMailQueue'][_0x1184('0x5e')](_0x2e9380);}})[_0x1184('0x29')](function(_0x2fb5c3){if(_0x2fb5c3){return db['User'][_0x1184('0x5f')]({'where':{'id':_[_0x1184('0x37')](_0x2fb5c3,_0x1184('0x60')),'role':_0x1184('0x61')},'attributes':['id',_0x1184('0x30'),_0x1184('0x62'),_0x1184('0x63'),_0x1184('0x64')]});}})[_0x1184('0x29')](function(_0x83383b){if(_0x83383b){return{'count':_0x83383b[_0x1184('0x24')],'rows':_[_0x1184('0x37')](_0x83383b[_0x1184('0x48')],function(_0x103513){return{'membername':_0x103513[_0x1184('0x30')],'UserId':_0x103513['id'],'queue_name':_0x50003d[_0x1184('0x30')],'MailQueueId':_0x50003d['id'],'interface':util[_0x1184('0x65')](_0x1184('0x66'),_0x1184('0x67'),_0x103513['name']),'penalty':0x0,'paused':_0x103513['mailPause'],'createdAt':_0x103513[_0x1184('0x64')],'updatedAt':_0x103513[_0x1184('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1184('0x29')](respondWithFilteredResult(_0x4eb396,_0x2e9380))[_0x1184('0x49')](handleError(_0x4eb396,null));};exports['getTeams']=function(_0x506de4,_0x5daa39,_0x1d572a){var _0x5bd584={};var _0x202b1c={};var _0x113599;var _0x195812;return db[_0x1184('0x32')][_0x1184('0x5a')]({'where':{'id':_0x506de4['params']['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x5daa39,null))['then'](function(_0x2619f0){if(_0x2619f0){_0x113599=_0x2619f0;_0x202b1c[_0x1184('0x3c')]=_['keys'](db[_0x1184('0x68')]['rawAttributes']);_0x202b1c[_0x1184('0x39')]=_[_0x1184('0x38')](_0x506de4[_0x1184('0x39')]);_0x202b1c[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x202b1c[_0x1184('0x3c')],_0x202b1c['query']);_0x5bd584[_0x1184('0x3e')]=_[_0x1184('0x3b')](_0x202b1c[_0x1184('0x3c')],qs[_0x1184('0x3d')](_0x506de4['query'][_0x1184('0x3d')]));_0x5bd584[_0x1184('0x3e')]=_0x5bd584[_0x1184('0x3e')][_0x1184('0x3f')]?_0x5bd584[_0x1184('0x3e')]:_0x202b1c[_0x1184('0x3c')];_0x5bd584['order']=qs[_0x1184('0x41')](_0x506de4[_0x1184('0x39')][_0x1184('0x41')]);_0x5bd584[_0x1184('0x42')]=qs[_0x1184('0x3a')](_[_0x1184('0x43')](_0x506de4[_0x1184('0x39')],_0x202b1c[_0x1184('0x3a')]));if(_0x506de4['query']['filter']){_0x5bd584[_0x1184('0x42')]=_[_0x1184('0x44')](_0x5bd584[_0x1184('0x42')],{'$or':_[_0x1184('0x37')](_0x5bd584['attributes'],function(_0x5c022c){var _0x5738e4={};_0x5738e4[_0x5c022c]={'$like':'%'+_0x506de4['query'][_0x1184('0x5d')]+'%'};return _0x5738e4;})});}_0x5bd584=_[_0x1184('0x44')]({},_0x5bd584,_0x506de4[_0x1184('0x4c')]);return _0x113599[_0x1184('0x69')](_0x5bd584);}})[_0x1184('0x29')](function(_0x2bbe6c){if(_0x2bbe6c){_0x195812=_0x2bbe6c[_0x1184('0x3f')];if(!_0x506de4['query'][_0x1184('0x6a')]('nolimit')){_0x5bd584['limit']=qs['limit'](_0x506de4[_0x1184('0x39')][_0x1184('0x25')]);_0x5bd584[_0x1184('0x22')]=qs['offset'](_0x506de4[_0x1184('0x39')][_0x1184('0x22')]);}return _0x113599[_0x1184('0x69')](_0x5bd584);}})[_0x1184('0x29')](function(_0x3b4cc){if(_0x3b4cc){return _0x3b4cc?{'count':_0x195812,'rows':_0x3b4cc}:null;}})[_0x1184('0x29')](respondWithResult(_0x5daa39,null))['catch'](handleError(_0x5daa39,null));};exports['addTeams']=function(_0x5eb5c9,_0x138b52,_0x4b4dec){var _0x2172f5=_0x5eb5c9['body']['ids'];return db[_0x1184('0x68')][_0x1184('0x5e')]({'where':{'id':_0x2172f5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1184('0x30'),_0x1184('0x6b'),_0x1184('0x6c'),'interface'],'raw':!![]}]})[_0x1184('0x29')](function(_0x128491){if(_0x128491){var _0x507669=_[_0x1184('0x6d')](_0x128491,function(_0x3e44c4){var _0x96a05=_0x3e44c4[_0x1184('0x2b')]({'plain':!![]});return _0x96a05[_0x1184('0x6e')];});return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x5eb5c9[_0x1184('0x4b')]['id']}})['then'](function(_0x956a0f){return db['sequelize'][_0x1184('0x6f')](function(_0x269ffc){return _0x956a0f['addTeams'](_0x2172f5,{'transaction':_0x269ffc})[_0x1184('0x29')](function(){return BPromise[_0x1184('0x70')](_0x507669,function(_0x1db0a8){return db['UserMailQueue'][_0x1184('0x71')]({'where':{'UserId':_0x1db0a8['id'],'MailQueueId':_0x5eb5c9[_0x1184('0x4b')]['id']},'transaction':_0x269ffc});});})[_0x1184('0x29')](function(){_0x507669[_0x1184('0x72')](function(_0x4720e7){socket[_0x1184('0x73')](_0x1184('0x74'),{'UserId':_0x4720e7['id'],'MailQueueId':_0x956a0f['id']});});});});});}})[_0x1184('0x29')](respondWithStatusCode(_0x138b52,null))[_0x1184('0x49')](handleError(_0x138b52,null));};exports[_0x1184('0x75')]=function(_0x3b36e3,_0xea099d,_0x1d96ff){return db[_0x1184('0x68')][_0x1184('0x5e')]({'where':{'id':_0x3b36e3[_0x1184('0x39')][_0x1184('0x76')]},'attributes':['id'],'include':[{'model':db[_0x1184('0x77')],'as':_0x1184('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x1184('0x29')](handleEntityNotFound(_0xea099d,null))[_0x1184('0x29')](function(_0x228cf5){var _0x27ce60=_['map'](_0x228cf5,'id');var _0x51629e=[];var _0x51cc63=[];var _0x37f788=squel[_0x1184('0x78')]();_0x37f788['field'](_0x1184('0x79'))[_0x1184('0x7a')]('team_has_mail_queues','tq')['join'](_0x1184('0x7b'),'ut',_0x1184('0x7c'))['where'](_0x1184('0x7d'),_0x3b36e3[_0x1184('0x4b')]['id']);for(var _0x105e2e=0x0;_0x105e2e<_0x228cf5['length'];_0x105e2e+=0x1){let _0x56dae5=_0x228cf5[_0x105e2e];for(var _0x3f6aa8=0x0;_0x3f6aa8<_0x56dae5['Agents'][_0x1184('0x3f')];_0x3f6aa8+=0x1){let _0x467972=_0x56dae5[_0x1184('0x6e')][_0x3f6aa8];var _0x1ac485=_0x37f788[_0x1184('0x7e')]();_0x1ac485[_0x1184('0x42')](_0x1184('0x7f'),_0x467972['id']);_0x51cc63[_0x1184('0x80')](db[_0x1184('0x81')][_0x1184('0x39')](_0x1ac485[_0x1184('0x82')](),{'type':db[_0x1184('0x81')][_0x1184('0x83')][_0x1184('0x84')]})[_0x1184('0x29')](function(_0x240c9f){if(_0x240c9f[_0x1184('0x3f')]===0x1){return _0x467972['id'];}else{var _0x239288=_[_0x1184('0x85')](_['map'](_0x240c9f,_0x1184('0x86')),function(_0x99fdb8){return _[_0x1184('0x87')](_0x27ce60,_0x99fdb8);});if(_0x239288){return _0x467972['id'];}}}));}}return BPromise[_0x1184('0x88')](_0x51cc63)['then'](function(_0x4eaf9a){_0x51629e=_(_0x51629e)['union'](_0x4eaf9a)[_0x1184('0x89')]()[_0x1184('0x8a')]();return db['MailQueue']['find']({'where':{'id':_0x3b36e3['params']['id']}})[_0x1184('0x29')](function(_0x248bd3){return db[_0x1184('0x81')][_0x1184('0x6f')](function(_0x330713){return _0x248bd3['removeTeams'](_0x3b36e3[_0x1184('0x39')][_0x1184('0x76')],{'transaction':_0x330713})[_0x1184('0x29')](function(){if(!_['isEmpty'](_0x51629e)){return _0x248bd3[_0x1184('0x8b')](_0x51629e,{'transaction':_0x330713});}})[_0x1184('0x29')](function(){_0x51629e['forEach'](function(_0x555213){socket['emit'](_0x1184('0x8c'),{'UserId':_0x555213,'MailQueueId':_0x248bd3['id']});});});});});});})[_0x1184('0x29')](respondWithStatusCode(_0xea099d,null))[_0x1184('0x49')](handleError(_0xea099d,null));};exports[_0x1184('0x8d')]=function(_0xff6e33,_0x22b35b,_0x176c3b){return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0xff6e33[_0x1184('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22b35b,null))['then'](function(_0x497b5e){if(_0x497b5e){return _0x497b5e[_0x1184('0x8d')](_0xff6e33[_0x1184('0x4e')][_0x1184('0x76')],_[_0x1184('0x8e')](_0xff6e33[_0x1184('0x4e')],[_0x1184('0x76'),'id'])||{})[_0x1184('0x8f')](function(_0x376ce7){for(var _0x23186d=0x0;_0x23186d<_0xff6e33[_0x1184('0x4e')][_0x1184('0x76')][_0x1184('0x3f')];_0x23186d+=0x1){socket[_0x1184('0x73')](_0x1184('0x74'),{'UserId':Number(_0xff6e33['body'][_0x1184('0x76')][_0x23186d]),'MailQueueId':Number(_0xff6e33[_0x1184('0x4b')]['id'])});}return _0x376ce7;});}})[_0x1184('0x29')](respondWithResult(_0x22b35b,null))[_0x1184('0x49')](handleError(_0x22b35b,null));};exports[_0x1184('0x8b')]=function(_0x279bf6,_0x510d26,_0xd95a0f){return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x279bf6[_0x1184('0x4b')]['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x510d26,null))[_0x1184('0x29')](function(_0x518c74){if(_0x518c74){return _0x518c74[_0x1184('0x8b')](_0x279bf6[_0x1184('0x39')]['ids'])[_0x1184('0x29')](function(){if(_[_0x1184('0x90')](_0x279bf6[_0x1184('0x39')][_0x1184('0x76')])){for(var _0x1501ad=0x0;_0x1501ad<_0x279bf6[_0x1184('0x39')][_0x1184('0x76')]['length'];_0x1501ad+=0x1){socket[_0x1184('0x73')](_0x1184('0x8c'),{'UserId':Number(_0x279bf6[_0x1184('0x39')]['ids'][_0x1501ad]),'MailQueueId':Number(_0x279bf6[_0x1184('0x4b')]['id'])});}}else{socket[_0x1184('0x73')](_0x1184('0x8c'),{'UserId':Number(_0x279bf6['query'][_0x1184('0x76')]),'MailQueueId':Number(_0x279bf6['params']['id'])});}});}})[_0x1184('0x29')](respondWithStatusCode(_0x510d26,null))['catch'](handleError(_0x510d26,null));};exports[_0x1184('0x91')]=function(_0x355fa8,_0x13c377,_0x55614e){var _0x5606b1={};var _0x141fd2={};var _0x3fd28a;var _0x51e1a2;return db['MailQueue'][_0x1184('0x5a')]({'where':{'id':_0x355fa8['params']['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x13c377,null))[_0x1184('0x29')](function(_0x1311af){if(_0x1311af){_0x3fd28a=_0x1311af;_0x141fd2['model']=_[_0x1184('0x38')](db[_0x1184('0x77')][_0x1184('0x33')]);_0x141fd2[_0x1184('0x39')]=_[_0x1184('0x38')](_0x355fa8[_0x1184('0x39')]);_0x141fd2['filters']=_['intersection'](_0x141fd2[_0x1184('0x3c')],_0x141fd2['query']);_0x5606b1[_0x1184('0x3e')]=_['intersection'](_0x141fd2[_0x1184('0x3c')],qs['fields'](_0x355fa8[_0x1184('0x39')][_0x1184('0x3d')]));_0x5606b1[_0x1184('0x3e')]=_0x5606b1[_0x1184('0x3e')][_0x1184('0x3f')]?_0x5606b1[_0x1184('0x3e')]:_0x141fd2['model'];_0x5606b1[_0x1184('0x40')]=qs[_0x1184('0x41')](_0x355fa8[_0x1184('0x39')][_0x1184('0x41')]);_0x5606b1[_0x1184('0x42')]=qs[_0x1184('0x3a')](_[_0x1184('0x43')](_0x355fa8[_0x1184('0x39')],_0x141fd2[_0x1184('0x3a')]));if(_0x355fa8[_0x1184('0x39')][_0x1184('0x5d')]){_0x5606b1[_0x1184('0x42')]=_['merge'](_0x5606b1[_0x1184('0x42')],{'$or':_[_0x1184('0x37')](_0x5606b1[_0x1184('0x3e')],function(_0x1ca6cc){var _0x5b6931={};_0x5b6931[_0x1ca6cc]={'$like':'%'+_0x355fa8[_0x1184('0x39')][_0x1184('0x5d')]+'%'};return _0x5b6931;})});}_0x5606b1=_['merge']({},_0x5606b1,_0x355fa8[_0x1184('0x4c')]);return _0x3fd28a['getAgents'](_0x5606b1);}})[_0x1184('0x29')](function(_0x5201d7){if(_0x5201d7){_0x51e1a2=_0x5201d7['length'];if(!_0x355fa8['query'][_0x1184('0x6a')](_0x1184('0x92'))){_0x5606b1[_0x1184('0x25')]=qs['limit'](_0x355fa8[_0x1184('0x39')]['limit']);_0x5606b1[_0x1184('0x22')]=qs[_0x1184('0x22')](_0x355fa8[_0x1184('0x39')]['offset']);}return _0x3fd28a[_0x1184('0x91')](_0x5606b1);}})[_0x1184('0x29')](function(_0x3d529a){if(_0x3d529a){return _0x3d529a?{'count':_0x51e1a2,'rows':_0x3d529a}:null;}})[_0x1184('0x29')](respondWithResult(_0x13c377,null))[_0x1184('0x49')](handleError(_0x13c377,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index afdf382..d3c99ac 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 _0xc175=['hook','exports','events','../../mysqldb','MailQueue','update','remove','emit','hasOwnProperty'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0xc175,0x14f));var _0x5c17=function(_0xf267b0,_0x51f07a){_0xf267b0=_0xf267b0-0x0;var _0x4081b2=_0xc175[_0xf267b0];return _0x4081b2;};'use strict';var EventEmitter=require(_0x5c17('0x0'));var MailQueue=require(_0x5c17('0x1'))['db'][_0x5c17('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c17('0x3'),'afterDestroy':_0x5c17('0x4')};function emitEvent(_0x15e065){return function(_0x18da24,_0x3d0dbd,_0x5c3791){MailQueueEvents[_0x5c17('0x5')](_0x15e065+':'+_0x18da24['id'],_0x18da24);MailQueueEvents[_0x5c17('0x5')](_0x15e065,_0x18da24);_0x5c3791(null);};}for(var e in events){if(events[_0x5c17('0x6')](e)){var event=events[e];MailQueue[_0x5c17('0x7')](e,emitEvent(event));}}module[_0x5c17('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x2b6a=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','MailQueue'];(function(_0x445c5a,_0x3c4bc8){var _0x303437=function(_0x2ad4eb){while(--_0x2ad4eb){_0x445c5a['push'](_0x445c5a['shift']());}};_0x303437(++_0x3c4bc8);}(_0x2b6a,0xcd));var _0xa2b6=function(_0x5a1b23,_0x2445b7){_0x5a1b23=_0x5a1b23-0x0;var _0x5562fd=_0x2b6a[_0x5a1b23];return _0x5562fd;};'use strict';var EventEmitter=require(_0xa2b6('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xa2b6('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa2b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2b6('0x3'),'afterDestroy':_0xa2b6('0x4')};function emitEvent(_0x32194e){return function(_0x575a3d,_0xb1350,_0x40c275){MailQueueEvents['emit'](_0x32194e+':'+_0x575a3d['id'],_0x575a3d);MailQueueEvents[_0xa2b6('0x5')](_0x32194e,_0x575a3d);_0x40c275(null);};}for(var e in events){if(events[_0xa2b6('0x6')](e)){var event=events[e];MailQueue[_0xa2b6('0x7')](e,emitEvent(event));}}module[_0xa2b6('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 60486f7..d57796f 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 _0x0f1d=['mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x0f1d,0x90));var _0xd0f1=function(_0x2934c3,_0x32f837){_0x2934c3=_0x2934c3-0x0;var _0x3b20e7=_0x0f1d[_0x2934c3];return _0x3b20e7;};'use strict';var _=require(_0xd0f1('0x0'));var util=require('util');var logger=require(_0xd0f1('0x1'))(_0xd0f1('0x2'));var moment=require(_0xd0f1('0x3'));var BPromise=require(_0xd0f1('0x4'));var rp=require(_0xd0f1('0x5'));var fs=require('fs');var path=require(_0xd0f1('0x6'));var rimraf=require(_0xd0f1('0x7'));var config=require(_0xd0f1('0x8'));var attributes=require(_0xd0f1('0x9'));module[_0xd0f1('0xa')]=function(_0xba457f,_0x3101d2){return _0xba457f[_0xd0f1('0xb')]('MailQueue',attributes,{'tableName':_0xd0f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfff6=['mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x5140c0,_0x46a73c){var _0x3ee199=function(_0x33ba80){while(--_0x33ba80){_0x5140c0['push'](_0x5140c0['shift']());}};_0x3ee199(++_0x46a73c);}(_0xfff6,0x83));var _0x6fff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfff6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6fff('0x0'));var util=require(_0x6fff('0x1'));var logger=require(_0x6fff('0x2'))(_0x6fff('0x3'));var moment=require(_0x6fff('0x4'));var BPromise=require(_0x6fff('0x5'));var rp=require(_0x6fff('0x6'));var fs=require('fs');var path=require(_0x6fff('0x7'));var rimraf=require('rimraf');var config=require(_0x6fff('0x8'));var attributes=require(_0x6fff('0x9'));module[_0x6fff('0xa')]=function(_0x19a8a5,_0x4358b9){return _0x19a8a5[_0x6fff('0xb')]('MailQueue',attributes,{'tableName':_0x6fff('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 59c7aa4..7579535 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 _0xebed=['stringify','ShowMailQueue','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','then'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xebed,0x1a5));var _0xdebe=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0xebed[_0x1b3564];return _0x504069;};'use strict';var _=require('lodash');var util=require(_0xdebe('0x0'));var moment=require(_0xdebe('0x1'));var BPromise=require(_0xdebe('0x2'));var rs=require(_0xdebe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdebe('0x4'))['db'];var utils=require(_0xdebe('0x5'));var logger=require(_0xdebe('0x6'))(_0xdebe('0x7'));var config=require(_0xdebe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdebe('0x9')]['http']({'port':0x232a});config[_0xdebe('0xa')]=_[_0xdebe('0xb')](config[_0xdebe('0xa')],{'host':_0xdebe('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdebe('0xa')]));require(_0xdebe('0xd'))[_0xdebe('0xe')](socket);function respondWithRpcPromise(_0x140b64,_0x3e3439,_0x4670a7){return new BPromise(function(_0x17e73c,_0x2ce663){return client[_0xdebe('0xf')](_0x140b64,_0x4670a7)['then'](function(_0x4c630e){logger[_0xdebe('0x10')](_0xdebe('0x11'),_0x3e3439,'request\x20sent');logger[_0xdebe('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3e3439,_0xdebe('0x13'),JSON['stringify'](_0x4c630e));if(_0x4c630e['error']){if(_0x4c630e[_0xdebe('0x14')][_0xdebe('0x15')]===0x1f4){logger[_0xdebe('0x14')](_0xdebe('0x11'),_0x3e3439,_0x4c630e[_0xdebe('0x14')][_0xdebe('0x16')]);return _0x2ce663(_0x4c630e[_0xdebe('0x14')][_0xdebe('0x16')]);}logger['error'](_0xdebe('0x11'),_0x3e3439,_0x4c630e['error'][_0xdebe('0x16')]);return _0x17e73c(_0x4c630e['error'][_0xdebe('0x16')]);}else{logger[_0xdebe('0x10')](_0xdebe('0x11'),_0x3e3439,_0xdebe('0x13'));_0x17e73c(_0x4c630e[_0xdebe('0x17')][_0xdebe('0x16')]);}})[_0xdebe('0x18')](function(_0xc319f9){logger['error'](_0xdebe('0x11'),_0x3e3439,_0xc319f9);_0x2ce663(_0xc319f9);});});}exports[_0xdebe('0x19')]=function(_0x218c71){var _0x4a7d14=this;return new Promise(function(_0x405116,_0x16fce2){return db[_0xdebe('0x1a')][_0xdebe('0x1b')]({'raw':_0x218c71[_0xdebe('0x1c')]?_0x218c71[_0xdebe('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x218c71[_0xdebe('0x1c')]?_0x218c71[_0xdebe('0x1c')]['where']||null:null,'attributes':_0x218c71[_0xdebe('0x1c')]?_0x218c71[_0xdebe('0x1c')][_0xdebe('0x1d')]||null:null,'limit':_0x218c71['options']?_0x218c71[_0xdebe('0x1c')][_0xdebe('0x1e')]||null:null,'include':_0x218c71[_0xdebe('0x1c')]?_0x218c71[_0xdebe('0x1c')][_0xdebe('0x1f')]?_[_0xdebe('0x20')](_0x218c71[_0xdebe('0x1c')][_0xdebe('0x1f')],function(_0x4c8a6a){return{'model':db[_0x4c8a6a[_0xdebe('0x21')]],'as':_0x4c8a6a['as'],'attributes':_0x4c8a6a[_0xdebe('0x1d')],'include':_0x4c8a6a['include']?_[_0xdebe('0x20')](_0x4c8a6a['include'],function(_0x227ad9){return{'model':db[_0x227ad9[_0xdebe('0x21')]],'as':_0x227ad9['as'],'attributes':_0x227ad9[_0xdebe('0x1d')],'include':_0x227ad9['include']?_[_0xdebe('0x20')](_0x227ad9[_0xdebe('0x1f')],function(_0x54b496){return{'model':db[_0x54b496['model']],'as':_0x54b496['as'],'attributes':_0x54b496[_0xdebe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdebe('0x22')](function(_0x3d9a91){logger['info'](_0xdebe('0x19'),_0x218c71);logger[_0xdebe('0x12')](_0xdebe('0x19'),_0x218c71,JSON[_0xdebe('0x23')](_0x3d9a91));_0x405116(_0x3d9a91);})[_0xdebe('0x18')](function(_0x423cbd){logger['error'](_0xdebe('0x19'),_0x423cbd['message'],_0x218c71);_0x16fce2(_0x4a7d14[_0xdebe('0x14')](0x1f4,_0x423cbd[_0xdebe('0x16')]));});});};exports[_0xdebe('0x24')]=function(_0x545d76){var _0x4ecc6f=this;return new Promise(function(_0x3f5662,_0x3a7f28){return db['MailQueue']['find']({'raw':_0x545d76['options']?_0x545d76[_0xdebe('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x545d76[_0xdebe('0x1c')]?_0x545d76[_0xdebe('0x1c')][_0xdebe('0x25')]||null:null,'attributes':_0x545d76[_0xdebe('0x1c')]?_0x545d76['options'][_0xdebe('0x1d')]||null:null,'include':_0x545d76[_0xdebe('0x1c')]?_0x545d76[_0xdebe('0x1c')][_0xdebe('0x1f')]?_[_0xdebe('0x20')](_0x545d76[_0xdebe('0x1c')][_0xdebe('0x1f')],function(_0x5a94c0){return{'model':db[_0x5a94c0[_0xdebe('0x21')]],'as':_0x5a94c0['as'],'attributes':_0x5a94c0['attributes'],'include':_0x5a94c0[_0xdebe('0x1f')]?_['map'](_0x5a94c0[_0xdebe('0x1f')],function(_0xcc6e8c){return{'model':db[_0xcc6e8c['model']],'as':_0xcc6e8c['as'],'attributes':_0xcc6e8c['attributes'],'include':_0xcc6e8c[_0xdebe('0x1f')]?_[_0xdebe('0x20')](_0xcc6e8c['include'],function(_0xa49ee8){return{'model':db[_0xa49ee8['model']],'as':_0xa49ee8['as'],'attributes':_0xa49ee8[_0xdebe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdebe('0x22')](function(_0x4133c2){logger[_0xdebe('0x10')](_0xdebe('0x24'),_0x545d76);logger[_0xdebe('0x12')]('ShowMailQueue',_0x545d76,JSON[_0xdebe('0x23')](_0x4133c2));_0x3f5662(_0x4133c2);})[_0xdebe('0x18')](function(_0x2069b0){logger['error']('ShowMailQueue',_0x2069b0[_0xdebe('0x16')],_0x545d76);_0x3a7f28(_0x4ecc6f[_0xdebe('0x14')](0x1f4,_0x2069b0['message']));});});}; \ No newline at end of file +var _0xa0aa=['then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','map','include','model','ShowMailQueue','find','raw','where','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request'];(function(_0x4134f6,_0x37316d){var _0x1b678d=function(_0x63fd4a){while(--_0x63fd4a){_0x4134f6['push'](_0x4134f6['shift']());}};_0x1b678d(++_0x37316d);}(_0xa0aa,0x19b));var _0xaa0a=function(_0x179e43,_0x2837e0){_0x179e43=_0x179e43-0x0;var _0x5b1994=_0xa0aa[_0x179e43];return _0x5b1994;};'use strict';var _=require(_0xaa0a('0x0'));var util=require(_0xaa0a('0x1'));var moment=require('moment');var BPromise=require(_0xaa0a('0x2'));var rs=require(_0xaa0a('0x3'));var fs=require('fs');var Redis=require(_0xaa0a('0x4'));var db=require(_0xaa0a('0x5'))['db'];var utils=require(_0xaa0a('0x6'));var logger=require(_0xaa0a('0x7'))(_0xaa0a('0x8'));var config=require(_0xaa0a('0x9'));var jayson=require(_0xaa0a('0xa'));var client=jayson[_0xaa0a('0xb')][_0xaa0a('0xc')]({'port':0x232a});config[_0xaa0a('0xd')]=_[_0xaa0a('0xe')](config['redis'],{'host':_0xaa0a('0xf'),'port':0x18eb});var socket=require(_0xaa0a('0x10'))(new Redis(config[_0xaa0a('0xd')]));require(_0xaa0a('0x11'))['register'](socket);function respondWithRpcPromise(_0x287239,_0x960aab,_0x168dfa){return new BPromise(function(_0x4f6447,_0xbce866){return client[_0xaa0a('0x12')](_0x287239,_0x168dfa)[_0xaa0a('0x13')](function(_0x291767){logger[_0xaa0a('0x14')](_0xaa0a('0x15'),_0x960aab,'request\x20sent');logger[_0xaa0a('0x16')](_0xaa0a('0x17'),_0x960aab,'request\x20sent',JSON['stringify'](_0x291767));if(_0x291767[_0xaa0a('0x18')]){if(_0x291767['error'][_0xaa0a('0x19')]===0x1f4){logger[_0xaa0a('0x18')](_0xaa0a('0x15'),_0x960aab,_0x291767[_0xaa0a('0x18')][_0xaa0a('0x1a')]);return _0xbce866(_0x291767['error'][_0xaa0a('0x1a')]);}logger[_0xaa0a('0x18')]('MailQueue,\x20%s,\x20%s',_0x960aab,_0x291767['error'][_0xaa0a('0x1a')]);return _0x4f6447(_0x291767[_0xaa0a('0x18')][_0xaa0a('0x1a')]);}else{logger[_0xaa0a('0x14')](_0xaa0a('0x15'),_0x960aab,'request\x20sent');_0x4f6447(_0x291767[_0xaa0a('0x1b')][_0xaa0a('0x1a')]);}})[_0xaa0a('0x1c')](function(_0x52b516){logger['error']('MailQueue,\x20%s,\x20%s',_0x960aab,_0x52b516);_0xbce866(_0x52b516);});});}exports[_0xaa0a('0x1d')]=function(_0x1e8819){var _0x25ab0c=this;return new Promise(function(_0x1237e7,_0x5f4ef1){return db[_0xaa0a('0x1e')][_0xaa0a('0x1f')]({'raw':_0x1e8819['options']?_0x1e8819['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819[_0xaa0a('0x20')]['where']||null:null,'attributes':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819['options'][_0xaa0a('0x21')]||null:null,'limit':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819[_0xaa0a('0x20')][_0xaa0a('0x22')]||null:null,'include':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819[_0xaa0a('0x20')]['include']?_[_0xaa0a('0x23')](_0x1e8819['options'][_0xaa0a('0x24')],function(_0x148103){return{'model':db[_0x148103['model']],'as':_0x148103['as'],'attributes':_0x148103[_0xaa0a('0x21')],'include':_0x148103[_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x148103[_0xaa0a('0x24')],function(_0x512f2d){return{'model':db[_0x512f2d[_0xaa0a('0x25')]],'as':_0x512f2d['as'],'attributes':_0x512f2d[_0xaa0a('0x21')],'include':_0x512f2d[_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x512f2d[_0xaa0a('0x24')],function(_0x1f7f27){return{'model':db[_0x1f7f27[_0xaa0a('0x25')]],'as':_0x1f7f27['as'],'attributes':_0x1f7f27[_0xaa0a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ea031){logger[_0xaa0a('0x14')](_0xaa0a('0x1d'),_0x1e8819);logger[_0xaa0a('0x16')](_0xaa0a('0x1d'),_0x1e8819,JSON['stringify'](_0x3ea031));_0x1237e7(_0x3ea031);})[_0xaa0a('0x1c')](function(_0x4ade8a){logger[_0xaa0a('0x18')]('GetMailQueue',_0x4ade8a[_0xaa0a('0x1a')],_0x1e8819);_0x5f4ef1(_0x25ab0c[_0xaa0a('0x18')](0x1f4,_0x4ade8a[_0xaa0a('0x1a')]));});});};exports[_0xaa0a('0x26')]=function(_0x3ecd44){var _0x3da60f=this;return new Promise(function(_0x438292,_0x239a05){return db['MailQueue'][_0xaa0a('0x27')]({'raw':_0x3ecd44['options']?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x28')]===undefined?!![]:![]:!![],'where':_0x3ecd44[_0xaa0a('0x20')]?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x29')]||null:null,'attributes':_0x3ecd44[_0xaa0a('0x20')]?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x21')]||null:null,'include':_0x3ecd44[_0xaa0a('0x20')]?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x24')],function(_0x11ee8d){return{'model':db[_0x11ee8d['model']],'as':_0x11ee8d['as'],'attributes':_0x11ee8d[_0xaa0a('0x21')],'include':_0x11ee8d[_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x11ee8d[_0xaa0a('0x24')],function(_0x21ec92){return{'model':db[_0x21ec92[_0xaa0a('0x25')]],'as':_0x21ec92['as'],'attributes':_0x21ec92[_0xaa0a('0x21')],'include':_0x21ec92['include']?_[_0xaa0a('0x23')](_0x21ec92[_0xaa0a('0x24')],function(_0xb0dfec){return{'model':db[_0xb0dfec[_0xaa0a('0x25')]],'as':_0xb0dfec['as'],'attributes':_0xb0dfec[_0xaa0a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xaa0a('0x13')](function(_0xc428fd){logger[_0xaa0a('0x14')](_0xaa0a('0x26'),_0x3ecd44);logger[_0xaa0a('0x16')](_0xaa0a('0x26'),_0x3ecd44,JSON[_0xaa0a('0x2a')](_0xc428fd));_0x438292(_0xc428fd);})['catch'](function(_0x51a4e0){logger[_0xaa0a('0x18')](_0xaa0a('0x26'),_0x51a4e0[_0xaa0a('0x1a')],_0x3ecd44);_0x239a05(_0x3da60f['error'](0x1f4,_0x51a4e0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 0c42080..d72cb8c 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 _0x6b74=['mailQueue:','./mailQueue.events','save','update','emit','register','length'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6b74,0xcc));var _0x46b7=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0x6b74[_0x376db5];return _0x304c17;};'use strict';var MailQueueEvents=require(_0x46b7('0x0'));var events=[_0x46b7('0x1'),'remove',_0x46b7('0x2')];function createListener(_0x1fe6df,_0x4d6ded){return function(_0x2c36b6){_0x4d6ded[_0x46b7('0x3')](_0x1fe6df,_0x2c36b6);};}function removeListener(_0x19ab1e,_0x5f5db8){return function(){MailQueueEvents['removeListener'](_0x19ab1e,_0x5f5db8);};}exports[_0x46b7('0x4')]=function(_0x3005ff){for(var _0x4df32f=0x0,_0x158f8e=events[_0x46b7('0x5')];_0x4df32f<_0x158f8e;_0x4df32f++){var _0x5f3c47=events[_0x4df32f];var _0x32fafb=createListener(_0x46b7('0x6')+_0x5f3c47,_0x3005ff);MailQueueEvents['on'](_0x5f3c47,_0x32fafb);}}; \ No newline at end of file +var _0xff8d=['remove','emit','removeListener','register','length','mailQueue:','save'];(function(_0x45d4f4,_0x5d7be9){var _0x41856e=function(_0x171e14){while(--_0x171e14){_0x45d4f4['push'](_0x45d4f4['shift']());}};_0x41856e(++_0x5d7be9);}(_0xff8d,0x7d));var _0xdff8=function(_0x118823,_0xa96d91){_0x118823=_0x118823-0x0;var _0x402664=_0xff8d[_0x118823];return _0x402664;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xdff8('0x0'),_0xdff8('0x1'),'update'];function createListener(_0x5326ad,_0x392931){return function(_0x16ef22){_0x392931[_0xdff8('0x2')](_0x5326ad,_0x16ef22);};}function removeListener(_0x37ad59,_0x56196d){return function(){MailQueueEvents[_0xdff8('0x3')](_0x37ad59,_0x56196d);};}exports[_0xdff8('0x4')]=function(_0xdaf0a3){for(var _0x42a72c=0x0,_0xa983d1=events[_0xdff8('0x5')];_0x42a72c<_0xa983d1;_0x42a72c++){var _0x8b8fee=events[_0x42a72c];var _0x110d9e=createListener(_0xdff8('0x6')+_0x8b8fee,_0xdaf0a3);MailQueueEvents['on'](_0x8b8fee,_0x110d9e);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a06102b..0822486 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 _0xc569=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','/describe','describe','/:id','show','post','isAuthenticated','create','put','update'];(function(_0x1b0597,_0xeffacc){var _0x2b6a2a=function(_0x4da070){while(--_0x4da070){_0x1b0597['push'](_0x1b0597['shift']());}};_0x2b6a2a(++_0xeffacc);}(_0xc569,0x1a6));var _0x9c56=function(_0x112641,_0x4de3fd){_0x112641=_0x112641-0x0;var _0x3ce49d=_0xc569[_0x112641];return _0x3ce49d;};'use strict';var multer=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var path=require(_0x9c56('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c56('0x3'));var router=express[_0x9c56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c56('0x6'));var controller=require(_0x9c56('0x7'));router[_0x9c56('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9c56('0x8')](_0x9c56('0x9'),auth['isAuthenticated'](),controller[_0x9c56('0xa')]);router['get'](_0x9c56('0xb'),auth['isAuthenticated'](),controller[_0x9c56('0xc')]);router[_0x9c56('0xd')]('/',auth[_0x9c56('0xe')](),controller[_0x9c56('0xf')]);router[_0x9c56('0x10')](_0x9c56('0xb'),auth['isAuthenticated'](),controller[_0x9c56('0x11')]);router[_0x9c56('0x12')](_0x9c56('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9c56('0x13')]=router; \ No newline at end of file +var _0x9675=['multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x8e55f3,_0x4ada75){var _0x22a439=function(_0x35f9aa){while(--_0x35f9aa){_0x8e55f3['push'](_0x8e55f3['shift']());}};_0x22a439(++_0x4ada75);}(_0x9675,0x1b5));var _0x5967=function(_0x52316a,_0x2e1bd0){_0x52316a=_0x52316a-0x0;var _0x47dbd2=_0x9675[_0x52316a];return _0x47dbd2;};'use strict';var multer=require(_0x5967('0x0'));var util=require('util');var path=require(_0x5967('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5967('0x2'));var auth=require(_0x5967('0x3'));var interaction=require(_0x5967('0x4'));var config=require('../../config/environment');var controller=require(_0x5967('0x5'));router[_0x5967('0x6')]('/',auth['isAuthenticated'](),controller[_0x5967('0x7')]);router[_0x5967('0x6')](_0x5967('0x8'),auth['isAuthenticated'](),controller[_0x5967('0x9')]);router[_0x5967('0x6')](_0x5967('0xa'),auth[_0x5967('0xb')](),controller[_0x5967('0xc')]);router['post']('/',auth[_0x5967('0xb')](),controller[_0x5967('0xd')]);router[_0x5967('0xe')](_0x5967('0xa'),auth[_0x5967('0xb')](),controller[_0x5967('0xf')]);router[_0x5967('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5967('0x11')]);module[_0x5967('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 15861b4..4eff2ad 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 _0x89c7=['sequelize','exports','DATE','moment'];(function(_0x25220c,_0x2f4c01){var _0x3d96f2=function(_0x2e7be7){while(--_0x2e7be7){_0x25220c['push'](_0x25220c['shift']());}};_0x3d96f2(++_0x2f4c01);}(_0x89c7,0x133));var _0x789c=function(_0x18f90e,_0x25a7f8){_0x18f90e=_0x18f90e-0x0;var _0x11cb87=_0x89c7[_0x18f90e];return _0x11cb87;};'use strict';var moment=require(_0x789c('0x0'));var Sequelize=require(_0x789c('0x1'));module[_0x789c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x789c('0x3')]},'leaveAt':{'type':Sequelize[_0x789c('0x3')]},'acceptAt':{'type':Sequelize[_0x789c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7dcc=['sequelize','STRING','DATE','moment'];(function(_0x54b275,_0x439272){var _0x145f0c=function(_0x544bae){while(--_0x544bae){_0x54b275['push'](_0x54b275['shift']());}};_0x145f0c(++_0x439272);}(_0x7dcc,0xc3));var _0xc7dc=function(_0x54ece6,_0x11a6c6){_0x54ece6=_0x54ece6-0x0;var _0x2cfd35=_0x7dcc[_0x54ece6];return _0x2cfd35;};'use strict';var moment=require(_0xc7dc('0x0'));var Sequelize=require(_0xc7dc('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc7dc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc7dc('0x2')]},'joinAt':{'type':Sequelize[_0xc7dc('0x3')]},'leaveAt':{'type':Sequelize[_0xc7dc('0x3')]},'acceptAt':{'type':Sequelize[_0xc7dc('0x3')]},'exitAt':{'type':Sequelize[_0xc7dc('0x3')]},'reason':{'type':Sequelize[_0xc7dc('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index be729de..617531b 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 _0xffd6=['rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','name','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format'];(function(_0x37f364,_0x56f6ae){var _0x1a97dd=function(_0x4f4161){while(--_0x4f4161){_0x37f364['push'](_0x37f364['shift']());}};_0x1a97dd(++_0x56f6ae);}(_0xffd6,0x97));var _0x6ffd=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xffd6[_0xb1cf84];return _0x4bad2e;};'use strict';var emlformat=require(_0x6ffd('0x0'));var rimraf=require(_0x6ffd('0x1'));var zipdir=require(_0x6ffd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ffd('0x3'));var BPromise=require(_0x6ffd('0x4'));var Mustache=require(_0x6ffd('0x5'));var util=require('util');var path=require(_0x6ffd('0x6'));var sox=require(_0x6ffd('0x7'));var csv=require(_0x6ffd('0x8'));var ejs=require(_0x6ffd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ffd('0xa'));var squel=require(_0x6ffd('0xb'));var crypto=require(_0x6ffd('0xc'));var jsforce=require(_0x6ffd('0xd'));var deskjs=require(_0x6ffd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ffd('0xf'));var Papa=require(_0x6ffd('0x10'));var Redis=require('ioredis');var authService=require(_0x6ffd('0x11'));var qs=require(_0x6ffd('0x12'));var as=require(_0x6ffd('0x13'));var hardwareService=require(_0x6ffd('0x14'));var logger=require(_0x6ffd('0x15'))(_0x6ffd('0x16'));var utils=require(_0x6ffd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6ffd('0x18'));var db=require(_0x6ffd('0x19'))['db'];function respondWithStatusCode(_0x5e8d6d,_0x2d0b63){_0x2d0b63=_0x2d0b63||0xcc;return function(_0x2ec8a5){if(_0x2ec8a5){return _0x5e8d6d[_0x6ffd('0x1a')](_0x2d0b63);}return _0x5e8d6d[_0x6ffd('0x1b')](_0x2d0b63)['end']();};}function respondWithResult(_0x259235,_0x594cb3){_0x594cb3=_0x594cb3||0xc8;return function(_0x468ecc){if(_0x468ecc){return _0x259235['status'](_0x594cb3)[_0x6ffd('0x1c')](_0x468ecc);}};}function respondWithFilteredResult(_0x261ed7,_0x45db49){return function(_0x5d8aff){if(_0x5d8aff){var _0x15fca6=typeof _0x45db49[_0x6ffd('0x1d')]===_0x6ffd('0x1e')&&typeof _0x45db49[_0x6ffd('0x1f')]===_0x6ffd('0x1e');var _0x19a772=_0x5d8aff[_0x6ffd('0x20')];var _0x889a4b=_0x15fca6?0x0:_0x45db49['offset'];var _0x11a609=_0x15fca6?_0x5d8aff['count']:_0x45db49['offset']+_0x45db49[_0x6ffd('0x1f')];var _0x359d09;if(_0x11a609>=_0x19a772){_0x11a609=_0x19a772;_0x359d09=0xc8;}else{_0x359d09=0xce;}_0x261ed7['status'](_0x359d09);return _0x261ed7[_0x6ffd('0x21')](_0x6ffd('0x22'),_0x889a4b+'-'+_0x11a609+'/'+_0x19a772)['json'](_0x5d8aff);}return null;};}function patchUpdates(_0x564a11){return function(_0x465971){try{jsonpatch[_0x6ffd('0x23')](_0x465971,_0x564a11,!![]);}catch(_0x4dcc50){return BPromise[_0x6ffd('0x24')](_0x4dcc50);}return _0x465971[_0x6ffd('0x25')]();};}function saveUpdates(_0x327fee,_0x53128a){return function(_0x3ba429){if(_0x3ba429){return _0x3ba429[_0x6ffd('0x26')](_0x327fee)['then'](function(_0x356c9c){return _0x356c9c;});}return null;};}function removeEntity(_0x438d1a,_0x50c19a){return function(_0x31fb22){if(_0x31fb22){return _0x31fb22[_0x6ffd('0x27')]()[_0x6ffd('0x28')](function(){_0x438d1a['status'](0xcc)[_0x6ffd('0x29')]();});}};}function handleEntityNotFound(_0x3e5726,_0x46b03f){return function(_0x4ae7ac){if(!_0x4ae7ac){_0x3e5726[_0x6ffd('0x1a')](0x194);}return _0x4ae7ac;};}function handleError(_0x5a55e2,_0x41ab4a){_0x41ab4a=_0x41ab4a||0x1f4;return function(_0x43269c){logger['error'](_0x43269c['stack']);if(_0x43269c[_0x6ffd('0x2a')]){delete _0x43269c[_0x6ffd('0x2a')];}_0x5a55e2[_0x6ffd('0x1b')](_0x41ab4a)['send'](_0x43269c);};}exports['index']=function(_0x32c399,_0x48feb4){var _0x470021={},_0x20c007={},_0x51fdb6={'count':0x0,'rows':[]};var _0x6b5aba=_[_0x6ffd('0x2b')](db[_0x6ffd('0x2c')][_0x6ffd('0x2d')],function(_0x235735){return{'name':_0x235735[_0x6ffd('0x2e')],'type':_0x235735[_0x6ffd('0x2f')][_0x6ffd('0x30')]};});_0x20c007[_0x6ffd('0x31')]=_[_0x6ffd('0x2b')](_0x6b5aba,_0x6ffd('0x2a'));_0x20c007[_0x6ffd('0x32')]=_[_0x6ffd('0x33')](_0x32c399['query']);_0x20c007['filters']=_['intersection'](_0x20c007[_0x6ffd('0x31')],_0x20c007[_0x6ffd('0x32')]);_0x470021[_0x6ffd('0x34')]=_[_0x6ffd('0x35')](_0x20c007[_0x6ffd('0x31')],qs[_0x6ffd('0x36')](_0x32c399[_0x6ffd('0x32')][_0x6ffd('0x36')]));_0x470021[_0x6ffd('0x34')]=_0x470021[_0x6ffd('0x34')][_0x6ffd('0x37')]?_0x470021[_0x6ffd('0x34')]:_0x20c007[_0x6ffd('0x31')];if(!_0x32c399['query'][_0x6ffd('0x38')](_0x6ffd('0x39'))){_0x470021[_0x6ffd('0x1f')]=qs[_0x6ffd('0x1f')](_0x32c399['query'][_0x6ffd('0x1f')]);_0x470021['offset']=qs['offset'](_0x32c399[_0x6ffd('0x32')][_0x6ffd('0x1d')]);}_0x470021[_0x6ffd('0x3a')]=qs[_0x6ffd('0x3b')](_0x32c399['query'][_0x6ffd('0x3b')]);_0x470021['where']=qs[_0x6ffd('0x3c')](_[_0x6ffd('0x3d')](_0x32c399[_0x6ffd('0x32')],_0x20c007[_0x6ffd('0x3c')]),_0x6b5aba);if(_0x32c399[_0x6ffd('0x32')]['filter']){_0x470021['where']=_[_0x6ffd('0x3e')](_0x470021['where'],{'$or':_[_0x6ffd('0x2b')](_0x6b5aba,function(_0x98bf46){if(_0x98bf46[_0x6ffd('0x2f')]!==_0x6ffd('0x3f')){var _0x6ee6f0={};_0x6ee6f0[_0x98bf46[_0x6ffd('0x2a')]]={'$like':'%'+_0x32c399['query'][_0x6ffd('0x40')]+'%'};return _0x6ee6f0;}})});}_0x470021=_[_0x6ffd('0x3e')]({},_0x470021,_0x32c399[_0x6ffd('0x41')]);var _0x3ad5ef={'where':_0x470021['where']};return db[_0x6ffd('0x2c')]['count'](_0x3ad5ef)[_0x6ffd('0x28')](function(_0x13b409){_0x51fdb6[_0x6ffd('0x20')]=_0x13b409;if(_0x32c399['query'][_0x6ffd('0x42')]){_0x470021[_0x6ffd('0x43')]=[{'all':!![]}];}return db[_0x6ffd('0x2c')][_0x6ffd('0x44')](_0x470021);})[_0x6ffd('0x28')](function(_0x2894f5){_0x51fdb6[_0x6ffd('0x45')]=_0x2894f5;return _0x51fdb6;})['then'](respondWithFilteredResult(_0x48feb4,_0x470021))['catch'](handleError(_0x48feb4,null));};exports['show']=function(_0x3bcac8,_0x162259){var _0x51ae8d={'raw':!![],'where':{'id':_0x3bcac8[_0x6ffd('0x46')]['id']}},_0x3d5193={};_0x3d5193[_0x6ffd('0x31')]=_[_0x6ffd('0x33')](db['MailQueueReport'][_0x6ffd('0x2d')]);_0x3d5193[_0x6ffd('0x32')]=_[_0x6ffd('0x33')](_0x3bcac8[_0x6ffd('0x32')]);_0x3d5193[_0x6ffd('0x3c')]=_[_0x6ffd('0x35')](_0x3d5193[_0x6ffd('0x31')],_0x3d5193[_0x6ffd('0x32')]);_0x51ae8d[_0x6ffd('0x34')]=_[_0x6ffd('0x35')](_0x3d5193[_0x6ffd('0x31')],qs['fields'](_0x3bcac8['query']['fields']));_0x51ae8d[_0x6ffd('0x34')]=_0x51ae8d[_0x6ffd('0x34')]['length']?_0x51ae8d[_0x6ffd('0x34')]:_0x3d5193[_0x6ffd('0x31')];if(_0x3bcac8[_0x6ffd('0x32')][_0x6ffd('0x42')]){_0x51ae8d[_0x6ffd('0x43')]=[{'all':!![]}];}_0x51ae8d=_['merge']({},_0x51ae8d,_0x3bcac8[_0x6ffd('0x41')]);return db[_0x6ffd('0x2c')][_0x6ffd('0x47')](_0x51ae8d)['then'](handleEntityNotFound(_0x162259,null))[_0x6ffd('0x28')](respondWithResult(_0x162259,null))[_0x6ffd('0x48')](handleError(_0x162259,null));};exports[_0x6ffd('0x49')]=function(_0xc513d4,_0x4184fe){return db[_0x6ffd('0x2c')]['create'](_0xc513d4[_0x6ffd('0x4a')],{})[_0x6ffd('0x28')](respondWithResult(_0x4184fe,0xc9))[_0x6ffd('0x48')](handleError(_0x4184fe,null));};exports[_0x6ffd('0x26')]=function(_0x43399c,_0x3d6221){if(_0x43399c[_0x6ffd('0x4a')]['id']){delete _0x43399c['body']['id'];}return db[_0x6ffd('0x2c')][_0x6ffd('0x47')]({'where':{'id':_0x43399c['params']['id']}})['then'](handleEntityNotFound(_0x3d6221,null))['then'](saveUpdates(_0x43399c[_0x6ffd('0x4a')],null))['then'](respondWithResult(_0x3d6221,null))[_0x6ffd('0x48')](handleError(_0x3d6221,null));};exports[_0x6ffd('0x27')]=function(_0x212578,_0x1fe3a4){return db['MailQueueReport'][_0x6ffd('0x47')]({'where':{'id':_0x212578[_0x6ffd('0x46')]['id']}})[_0x6ffd('0x28')](handleEntityNotFound(_0x1fe3a4,null))['then'](removeEntity(_0x1fe3a4,null))[_0x6ffd('0x48')](handleError(_0x1fe3a4,null));};exports[_0x6ffd('0x4b')]=function(_0x4aa024,_0x528284){return db[_0x6ffd('0x2c')][_0x6ffd('0x4b')]()[_0x6ffd('0x28')](respondWithResult(_0x528284,null))[_0x6ffd('0x48')](handleError(_0x528284,null));}; \ No newline at end of file +var _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailQueueReport','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x588280,_0x3844cd){var _0x9452e9=function(_0x4b7945){while(--_0x4b7945){_0x588280['push'](_0x588280['shift']());}};_0x9452e9(++_0x3844cd);}(_0xef0f,0x168));var _0xfef0=function(_0x57b57e,_0x3d89e8){_0x57b57e=_0x57b57e-0x0;var _0x48c809=_0xef0f[_0x57b57e];return _0x48c809;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['MailQueueReport']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':!![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 48ac44d..06ed9fe 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 _0xfde0=['./mailQueueReport.attributes','define','report_mail_queue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f816b,_0x4a664b){var _0x2e98d1=function(_0x46a612){while(--_0x46a612){_0x2f816b['push'](_0x2f816b['shift']());}};_0x2e98d1(++_0x4a664b);}(_0xfde0,0xc3));var _0x0fde=function(_0x475a64,_0x43901e){_0x475a64=_0x475a64-0x0;var _0xbcbd3a=_0xfde0[_0x475a64];return _0xbcbd3a;};'use strict';var _=require(_0x0fde('0x0'));var util=require(_0x0fde('0x1'));var logger=require(_0x0fde('0x2'))(_0x0fde('0x3'));var moment=require(_0x0fde('0x4'));var BPromise=require(_0x0fde('0x5'));var rp=require(_0x0fde('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fde('0x7'));var config=require(_0x0fde('0x8'));var attributes=require(_0x0fde('0x9'));module['exports']=function(_0x5746d6,_0xfbc5b0){return _0x5746d6[_0x0fde('0xa')]('MailQueueReport',attributes,{'tableName':_0x0fde('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xee9c=['path','rimraf','exports','define','MailQueueReport','uniqueid','util','../../config/logger','api','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xee9c,0x1e6));var _0xcee9=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xee9c[_0x531d15];return _0x271a18;};'use strict';var _=require('lodash');var util=require(_0xcee9('0x0'));var logger=require(_0xcee9('0x1'))(_0xcee9('0x2'));var moment=require(_0xcee9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcee9('0x4'));var rimraf=require(_0xcee9('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xcee9('0x6')]=function(_0x547ea0,_0x2e438b){return _0x547ea0[_0xcee9('0x7')](_0xcee9('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcee9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 9c39024..bba4310 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x54bfbc,_0x10fbde){var _0x1f735b=function(_0x505a3d){while(--_0x505a3d){_0x54bfbc['push'](_0x54bfbc['shift']());}};_0x1f735b(++_0x10fbde);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c920f,_0x54ff2c){var _0x56e0d8=function(_0x34e7d8){while(--_0x34e7d8){_0x2c920f['push'](_0x2c920f['shift']());}};_0x56e0d8(++_0x54ff2c);}(_0x1261,0x144));var _0x1126=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x1261[_0x20b29c];return _0x20d81b;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 6f20922..6c65517 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c16a4,_0xbba97c){var _0xa47eb7=function(_0x3f4893){while(--_0x3f4893){_0x1c16a4['push'](_0x1c16a4['shift']());}};_0xa47eb7(++_0xbba97c);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4a1c92,_0x519cb7){var _0x40c266=function(_0x29da48){while(--_0x29da48){_0x4a1c92['push'](_0x4a1c92['shift']());}};_0x40c266(++_0x519cb7);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 08b5a43..df91e37 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 _0x1fee=['BOOLEAN','INBOX','exports','STRING','INTEGER'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x1fee,0xc0));var _0xe1fe=function(_0x52f938,_0x1e13e7){_0x52f938=_0x52f938-0x0;var _0x386cbb=_0x1fee[_0x52f938];return _0x386cbb;};'use strict';var Sequelize=require('sequelize');module[_0xe1fe('0x0')]={'description':{'type':Sequelize[_0xe1fe('0x1')]},'host':{'type':Sequelize[_0xe1fe('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xe1fe('0x1')]},'password':{'type':Sequelize[_0xe1fe('0x1')]},'port':{'type':Sequelize[_0xe1fe('0x2')]},'tls':{'type':Sequelize[_0xe1fe('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xe1fe('0x1')],'defaultValue':_0xe1fe('0x4')},'connTimeout':{'type':Sequelize[_0xe1fe('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe1fe('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe1fe('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x89e8=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x89e8,0xf4));var _0x889e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x89e8[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x889e('0x0')]={'description':{'type':Sequelize[_0x889e('0x1')]},'host':{'type':Sequelize[_0x889e('0x1')]},'authentication':{'type':Sequelize[_0x889e('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x889e('0x1')]},'port':{'type':Sequelize[_0x889e('0x3')]},'tls':{'type':Sequelize[_0x889e('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x889e('0x1')],'defaultValue':_0x889e('0x4')},'connTimeout':{'type':Sequelize[_0x889e('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x889e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x889e('0x1')]},'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 2b2e283..83cd629 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 _0xd953=['exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','./mailServerIn.attributes'];(function(_0x1d7e34,_0x40b101){var _0x2200fc=function(_0x413a60){while(--_0x413a60){_0x1d7e34['push'](_0x1d7e34['shift']());}};_0x2200fc(++_0x40b101);}(_0xd953,0x1d2));var _0x3d95=function(_0x148169,_0x563a50){_0x148169=_0x148169-0x0;var _0x4518dc=_0xd953[_0x148169];return _0x4518dc;};'use strict';var _=require(_0x3d95('0x0'));var util=require(_0x3d95('0x1'));var logger=require(_0x3d95('0x2'))(_0x3d95('0x3'));var moment=require(_0x3d95('0x4'));var BPromise=require(_0x3d95('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3d95('0x6'));module[_0x3d95('0x7')]=function(_0x4ecb1b,_0x3750a1){return _0x4ecb1b[_0x3d95('0x8')](_0x3d95('0x9'),attributes,{'tableName':_0x3d95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc86=['./mailServerIn.attributes','exports','mail_servers_in','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2b7c5f,_0x2cd24c){var _0x373651=function(_0x31324a){while(--_0x31324a){_0x2b7c5f['push'](_0x2b7c5f['shift']());}};_0x373651(++_0x2cd24c);}(_0xfc86,0x14d));var _0x6fc8=function(_0x4e7ae5,_0x407167){_0x4e7ae5=_0x4e7ae5-0x0;var _0x14d181=_0xfc86[_0x4e7ae5];return _0x14d181;};'use strict';var _=require('lodash');var util=require(_0x6fc8('0x0'));var logger=require(_0x6fc8('0x1'))(_0x6fc8('0x2'));var moment=require(_0x6fc8('0x3'));var BPromise=require(_0x6fc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6fc8('0x5'));var config=require(_0x6fc8('0x6'));var attributes=require(_0x6fc8('0x7'));module[_0x6fc8('0x8')]=function(_0x76d3d8,_0x372ba7){return _0x76d3d8['define']('MailServerIn',attributes,{'tableName':_0x6fc8('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 d7ade21..39a81c5 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 _0x134c=['result','catch','GetMailServerIn','MailServerIn','findAll','raw','options','where','limit','include','map','attributes','model','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x51a0e0,_0x548947){var _0x1df01b=function(_0x349ff1){while(--_0x349ff1){_0x51a0e0['push'](_0x51a0e0['shift']());}};_0x1df01b(++_0x548947);}(_0x134c,0x1ca));var _0xc134=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0x134c[_0x55d911];return _0x3104c2;};'use strict';var _=require(_0xc134('0x0'));var util=require(_0xc134('0x1'));var moment=require(_0xc134('0x2'));var BPromise=require(_0xc134('0x3'));var rs=require(_0xc134('0x4'));var fs=require('fs');var Redis=require(_0xc134('0x5'));var db=require(_0xc134('0x6'))['db'];var utils=require(_0xc134('0x7'));var logger=require(_0xc134('0x8'))(_0xc134('0x9'));var config=require(_0xc134('0xa'));var jayson=require(_0xc134('0xb'));var client=jayson[_0xc134('0xc')][_0xc134('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4133db,_0x5827d7,_0x1a0c6a){return new BPromise(function(_0x18c53f,_0x1a11f4){return client[_0xc134('0xe')](_0x4133db,_0x1a0c6a)['then'](function(_0x4da611){logger['info'](_0xc134('0xf'),_0x5827d7,_0xc134('0x10'));logger[_0xc134('0x11')](_0xc134('0x12'),_0x5827d7,'request\x20sent',JSON[_0xc134('0x13')](_0x4da611));if(_0x4da611[_0xc134('0x14')]){if(_0x4da611[_0xc134('0x14')][_0xc134('0x15')]===0x1f4){logger['error'](_0xc134('0xf'),_0x5827d7,_0x4da611[_0xc134('0x14')]['message']);return _0x1a11f4(_0x4da611[_0xc134('0x14')][_0xc134('0x16')]);}logger['error'](_0xc134('0xf'),_0x5827d7,_0x4da611[_0xc134('0x14')]['message']);return _0x18c53f(_0x4da611['error'][_0xc134('0x16')]);}else{logger['info'](_0xc134('0xf'),_0x5827d7,_0xc134('0x10'));_0x18c53f(_0x4da611[_0xc134('0x17')]['message']);}})[_0xc134('0x18')](function(_0x22fd6d){logger[_0xc134('0x14')](_0xc134('0xf'),_0x5827d7,_0x22fd6d);_0x1a11f4(_0x22fd6d);});});}exports[_0xc134('0x19')]=function(_0x5ce8b9){var _0x2d10c0=this;return new Promise(function(_0x5085ec,_0x9efe12){return db[_0xc134('0x1a')][_0xc134('0x1b')]({'raw':_0x5ce8b9['options']?_0x5ce8b9['options'][_0xc134('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ce8b9[_0xc134('0x1d')]?_0x5ce8b9[_0xc134('0x1d')][_0xc134('0x1e')]||null:null,'attributes':_0x5ce8b9[_0xc134('0x1d')]?_0x5ce8b9[_0xc134('0x1d')]['attributes']||null:null,'limit':_0x5ce8b9[_0xc134('0x1d')]?_0x5ce8b9[_0xc134('0x1d')][_0xc134('0x1f')]||null:null,'include':_0x5ce8b9[_0xc134('0x1d')]?_0x5ce8b9[_0xc134('0x1d')][_0xc134('0x20')]?_[_0xc134('0x21')](_0x5ce8b9[_0xc134('0x1d')][_0xc134('0x20')],function(_0x5962f4){return{'model':db[_0x5962f4['model']],'as':_0x5962f4['as'],'attributes':_0x5962f4[_0xc134('0x22')],'include':_0x5962f4[_0xc134('0x20')]?_['map'](_0x5962f4[_0xc134('0x20')],function(_0x1b7d4d){return{'model':db[_0x1b7d4d['model']],'as':_0x1b7d4d['as'],'attributes':_0x1b7d4d[_0xc134('0x22')],'include':_0x1b7d4d[_0xc134('0x20')]?_[_0xc134('0x21')](_0x1b7d4d['include'],function(_0x527d71){return{'model':db[_0x527d71[_0xc134('0x23')]],'as':_0x527d71['as'],'attributes':_0x527d71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x359abe){logger[_0xc134('0x24')](_0xc134('0x19'),_0x5ce8b9);logger[_0xc134('0x11')]('GetMailServerIn',_0x5ce8b9,JSON[_0xc134('0x13')](_0x359abe));_0x5085ec(_0x359abe);})[_0xc134('0x18')](function(_0x5b0cbf){logger[_0xc134('0x14')](_0xc134('0x19'),_0x5b0cbf[_0xc134('0x16')],_0x5ce8b9);_0x9efe12(_0x2d10c0[_0xc134('0x14')](0x1f4,_0x5b0cbf[_0xc134('0x16')]));});});}; \ No newline at end of file +var _0xe3db=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xe3db,0xc8));var _0xbe3d=function(_0x41efb3,_0xd798df){_0x41efb3=_0x41efb3-0x0;var _0xcb88a0=_0xe3db[_0x41efb3];return _0xcb88a0;};'use strict';var _=require(_0xbe3d('0x0'));var util=require(_0xbe3d('0x1'));var moment=require('moment');var BPromise=require(_0xbe3d('0x2'));var rs=require(_0xbe3d('0x3'));var fs=require('fs');var Redis=require(_0xbe3d('0x4'));var db=require(_0xbe3d('0x5'))['db'];var utils=require(_0xbe3d('0x6'));var logger=require(_0xbe3d('0x7'))(_0xbe3d('0x8'));var config=require(_0xbe3d('0x9'));var jayson=require(_0xbe3d('0xa'));var client=jayson[_0xbe3d('0xb')][_0xbe3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c255b,_0x314709,_0x90d1ab){return new BPromise(function(_0x24136a,_0x37e7c0){return client['request'](_0x4c255b,_0x90d1ab)[_0xbe3d('0xd')](function(_0x2aa8ff){logger['info']('MailServerIn,\x20%s,\x20%s',_0x314709,_0xbe3d('0xe'));logger[_0xbe3d('0xf')](_0xbe3d('0x10'),_0x314709,_0xbe3d('0xe'),JSON[_0xbe3d('0x11')](_0x2aa8ff));if(_0x2aa8ff[_0xbe3d('0x12')]){if(_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x13')]===0x1f4){logger[_0xbe3d('0x12')](_0xbe3d('0x14'),_0x314709,_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);return _0x37e7c0(_0x2aa8ff['error'][_0xbe3d('0x15')]);}logger[_0xbe3d('0x12')](_0xbe3d('0x14'),_0x314709,_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);return _0x24136a(_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);}else{logger[_0xbe3d('0x16')](_0xbe3d('0x14'),_0x314709,_0xbe3d('0xe'));_0x24136a(_0x2aa8ff[_0xbe3d('0x17')][_0xbe3d('0x15')]);}})[_0xbe3d('0x18')](function(_0x3f8630){logger['error'](_0xbe3d('0x14'),_0x314709,_0x3f8630);_0x37e7c0(_0x3f8630);});});}exports[_0xbe3d('0x19')]=function(_0x1a5ab3){var _0xaacdf8=this;return new Promise(function(_0x3cf995,_0x1a35af){return db[_0xbe3d('0x1a')][_0xbe3d('0x1b')]({'raw':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3['options'][_0xbe3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3[_0xbe3d('0x1c')][_0xbe3d('0x1e')]||null:null,'attributes':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3[_0xbe3d('0x1c')][_0xbe3d('0x1f')]||null:null,'limit':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3[_0xbe3d('0x1c')][_0xbe3d('0x20')]||null:null,'include':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3['options'][_0xbe3d('0x21')]?_[_0xbe3d('0x22')](_0x1a5ab3['options'][_0xbe3d('0x21')],function(_0x4b755a){return{'model':db[_0x4b755a[_0xbe3d('0x23')]],'as':_0x4b755a['as'],'attributes':_0x4b755a[_0xbe3d('0x1f')],'include':_0x4b755a['include']?_[_0xbe3d('0x22')](_0x4b755a[_0xbe3d('0x21')],function(_0x39c4d2){return{'model':db[_0x39c4d2[_0xbe3d('0x23')]],'as':_0x39c4d2['as'],'attributes':_0x39c4d2[_0xbe3d('0x1f')],'include':_0x39c4d2[_0xbe3d('0x21')]?_[_0xbe3d('0x22')](_0x39c4d2[_0xbe3d('0x21')],function(_0x446403){return{'model':db[_0x446403['model']],'as':_0x446403['as'],'attributes':_0x446403[_0xbe3d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2738c7){logger['info'](_0xbe3d('0x19'),_0x1a5ab3);logger['debug'](_0xbe3d('0x19'),_0x1a5ab3,JSON[_0xbe3d('0x11')](_0x2738c7));_0x3cf995(_0x2738c7);})[_0xbe3d('0x18')](function(_0xd349f1){logger[_0xbe3d('0x12')](_0xbe3d('0x19'),_0xd349f1[_0xbe3d('0x15')],_0x1a5ab3);_0x1a35af(_0xaacdf8['error'](0x1f4,_0xd349f1[_0xbe3d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 256ae21..874ae63 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7a54,0x106));var _0x47a5=function(_0x36f112,_0x2b45a7){_0x36f112=_0x36f112-0x0;var _0x4f90bc=_0x7a54[_0x36f112];return _0x4f90bc;};'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 4717f0d..10dc6d9 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 _0xbee3=['exports','STRING','BOOLEAN'];(function(_0x5a8dd2,_0x58c946){var _0x3bc36b=function(_0x5e1ad4){while(--_0x5e1ad4){_0x5a8dd2['push'](_0x5a8dd2['shift']());}};_0x3bc36b(++_0x58c946);}(_0xbee3,0xd5));var _0x3bee=function(_0x3922bf,_0xc3d306){_0x3922bf=_0x3922bf-0x0;var _0x56ba39=_0xbee3[_0x3922bf];return _0x56ba39;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x3bee('0x1')]},'pass':{'type':Sequelize[_0x3bee('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x3bee('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x3bee('0x1')]},'authentication':{'type':Sequelize[_0x3bee('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6f7a=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x10bb83,_0xcfd6a9){_0x10bb83=_0x10bb83-0x0;var _0xf6e07b=_0x6f7a[_0x10bb83];return _0xf6e07b;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'description':{'type':Sequelize[_0xa6f7('0x2')]},'host':{'type':Sequelize[_0xa6f7('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xa6f7('0x2')]},'port':{'type':Sequelize[_0xa6f7('0x3')]},'secure':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xa6f7('0x2')]},'authentication':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 5bd00f6..3cdbc7f 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 _0xecee=['reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','params','include','options','create','update','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x5b6f65,_0x35e58d){var _0x2fbec8=function(_0xc7d97b){while(--_0xc7d97b){_0x5b6f65['push'](_0x5b6f65['shift']());}};_0x2fbec8(++_0x35e58d);}(_0xecee,0x73));var _0xeece=function(_0x40239c,_0xf47e66){_0x40239c=_0x40239c-0x0;var _0xf45e1d=_0xecee[_0x40239c];return _0xf45e1d;};'use strict';var emlformat=require(_0xeece('0x0'));var rimraf=require(_0xeece('0x1'));var zipdir=require(_0xeece('0x2'));var jsonpatch=require(_0xeece('0x3'));var rp=require(_0xeece('0x4'));var moment=require(_0xeece('0x5'));var BPromise=require(_0xeece('0x6'));var Mustache=require(_0xeece('0x7'));var util=require('util');var path=require(_0xeece('0x8'));var sox=require(_0xeece('0x9'));var csv=require('to-csv');var ejs=require(_0xeece('0xa'));var fs=require('fs');var fs_extra=require(_0xeece('0xb'));var _=require(_0xeece('0xc'));var squel=require(_0xeece('0xd'));var crypto=require(_0xeece('0xe'));var jsforce=require(_0xeece('0xf'));var deskjs=require(_0xeece('0x10'));var toCsv=require(_0xeece('0x11'));var querystring=require(_0xeece('0x12'));var Papa=require('papaparse');var Redis=require(_0xeece('0x13'));var authService=require(_0xeece('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xeece('0x15'));var hardwareService=require(_0xeece('0x16'));var logger=require('../../config/logger')(_0xeece('0x17'));var utils=require('../../config/utils');var config=require(_0xeece('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xeece('0x19'))['db'];function respondWithStatusCode(_0x1450ea,_0x22718e){_0x22718e=_0x22718e||0xcc;return function(_0x35be77){if(_0x35be77){return _0x1450ea['sendStatus'](_0x22718e);}return _0x1450ea[_0xeece('0x1a')](_0x22718e)[_0xeece('0x1b')]();};}function respondWithResult(_0x3624fb,_0x5111bf){_0x5111bf=_0x5111bf||0xc8;return function(_0x333b5e){if(_0x333b5e){return _0x3624fb[_0xeece('0x1a')](_0x5111bf)[_0xeece('0x1c')](_0x333b5e);}};}function respondWithFilteredResult(_0x2c932e,_0x5aa3cc){return function(_0x346622){if(_0x346622){var _0x376e21=typeof _0x5aa3cc[_0xeece('0x1d')]===_0xeece('0x1e')&&typeof _0x5aa3cc[_0xeece('0x1f')]==='undefined';var _0x1cb3fd=_0x346622[_0xeece('0x20')];var _0x375c53=_0x376e21?0x0:_0x5aa3cc['offset'];var _0x423c79=_0x376e21?_0x346622['count']:_0x5aa3cc[_0xeece('0x1d')]+_0x5aa3cc[_0xeece('0x1f')];var _0x31fd93;if(_0x423c79>=_0x1cb3fd){_0x423c79=_0x1cb3fd;_0x31fd93=0xc8;}else{_0x31fd93=0xce;}_0x2c932e[_0xeece('0x1a')](_0x31fd93);return _0x2c932e[_0xeece('0x21')]('Content-Range',_0x375c53+'-'+_0x423c79+'/'+_0x1cb3fd)['json'](_0x346622);}return null;};}function patchUpdates(_0x58ee37){return function(_0x187950){try{jsonpatch[_0xeece('0x22')](_0x187950,_0x58ee37,!![]);}catch(_0x5da10d){return BPromise[_0xeece('0x23')](_0x5da10d);}return _0x187950[_0xeece('0x24')]();};}function saveUpdates(_0x3a6be9,_0x2e1a73){return function(_0x18d542){if(_0x18d542){return _0x18d542['update'](_0x3a6be9)[_0xeece('0x25')](function(_0x532d7f){return _0x532d7f;});}return null;};}function removeEntity(_0x110817,_0x322c1b){return function(_0x49bfe5){if(_0x49bfe5){return _0x49bfe5[_0xeece('0x26')]()[_0xeece('0x25')](function(){_0x110817[_0xeece('0x1a')](0xcc)[_0xeece('0x1b')]();});}};}function handleEntityNotFound(_0x214398,_0x446e7a){return function(_0xe5066a){if(!_0xe5066a){_0x214398[_0xeece('0x27')](0x194);}return _0xe5066a;};}function handleError(_0x20976f,_0x1f766e){_0x1f766e=_0x1f766e||0x1f4;return function(_0x5b79eb){logger[_0xeece('0x28')](_0x5b79eb[_0xeece('0x29')]);if(_0x5b79eb[_0xeece('0x2a')]){delete _0x5b79eb[_0xeece('0x2a')];}_0x20976f[_0xeece('0x1a')](_0x1f766e)[_0xeece('0x2b')](_0x5b79eb);};}exports[_0xeece('0x2c')]=function(_0x4f72d5,_0x3896a4){var _0x25ed5e={},_0x2ae8b4={},_0x44b5aa={'count':0x0,'rows':[]};var _0x1bc406=_[_0xeece('0x2d')](db[_0xeece('0x2e')][_0xeece('0x2f')],function(_0x4450f1){return{'name':_0x4450f1[_0xeece('0x30')],'type':_0x4450f1[_0xeece('0x31')][_0xeece('0x32')]};});_0x2ae8b4[_0xeece('0x33')]=_[_0xeece('0x2d')](_0x1bc406,'name');_0x2ae8b4[_0xeece('0x34')]=_[_0xeece('0x35')](_0x4f72d5[_0xeece('0x34')]);_0x2ae8b4[_0xeece('0x36')]=_[_0xeece('0x37')](_0x2ae8b4['model'],_0x2ae8b4[_0xeece('0x34')]);_0x25ed5e[_0xeece('0x38')]=_['intersection'](_0x2ae8b4[_0xeece('0x33')],qs['fields'](_0x4f72d5[_0xeece('0x34')][_0xeece('0x39')]));_0x25ed5e[_0xeece('0x38')]=_0x25ed5e[_0xeece('0x38')]['length']?_0x25ed5e[_0xeece('0x38')]:_0x2ae8b4[_0xeece('0x33')];if(!_0x4f72d5['query'][_0xeece('0x3a')]('nolimit')){_0x25ed5e['limit']=qs[_0xeece('0x1f')](_0x4f72d5[_0xeece('0x34')][_0xeece('0x1f')]);_0x25ed5e[_0xeece('0x1d')]=qs['offset'](_0x4f72d5['query']['offset']);}_0x25ed5e['order']=qs[_0xeece('0x3b')](_0x4f72d5[_0xeece('0x34')]['sort']);_0x25ed5e[_0xeece('0x3c')]=qs['filters'](_[_0xeece('0x3d')](_0x4f72d5[_0xeece('0x34')],_0x2ae8b4[_0xeece('0x36')]),_0x1bc406);if(_0x4f72d5['query'][_0xeece('0x3e')]){_0x25ed5e[_0xeece('0x3c')]=_[_0xeece('0x3f')](_0x25ed5e[_0xeece('0x3c')],{'$or':_['map'](_0x1bc406,function(_0xcb22fe){if(_0xcb22fe[_0xeece('0x31')]!==_0xeece('0x40')){var _0x18f306={};_0x18f306[_0xcb22fe[_0xeece('0x2a')]]={'$like':'%'+_0x4f72d5[_0xeece('0x34')]['filter']+'%'};return _0x18f306;}})});}_0x25ed5e=_[_0xeece('0x3f')]({},_0x25ed5e,_0x4f72d5['options']);var _0x245a80={'where':_0x25ed5e['where']};return db[_0xeece('0x2e')][_0xeece('0x20')](_0x245a80)[_0xeece('0x25')](function(_0x2e9ca2){_0x44b5aa[_0xeece('0x20')]=_0x2e9ca2;if(_0x4f72d5[_0xeece('0x34')][_0xeece('0x41')]){_0x25ed5e['include']=[{'all':!![]}];}return db[_0xeece('0x2e')][_0xeece('0x42')](_0x25ed5e);})['then'](function(_0x5f4518){_0x44b5aa['rows']=_0x5f4518;return _0x44b5aa;})[_0xeece('0x25')](respondWithFilteredResult(_0x3896a4,_0x25ed5e))[_0xeece('0x43')](handleError(_0x3896a4,null));};exports['show']=function(_0x2895d1,_0x1a21b1){var _0x420458={'raw':!![],'where':{'id':_0x2895d1[_0xeece('0x44')]['id']}},_0x20859b={};_0x20859b[_0xeece('0x33')]=_['keys'](db[_0xeece('0x2e')][_0xeece('0x2f')]);_0x20859b[_0xeece('0x34')]=_[_0xeece('0x35')](_0x2895d1['query']);_0x20859b[_0xeece('0x36')]=_[_0xeece('0x37')](_0x20859b[_0xeece('0x33')],_0x20859b[_0xeece('0x34')]);_0x420458[_0xeece('0x38')]=_[_0xeece('0x37')](_0x20859b[_0xeece('0x33')],qs['fields'](_0x2895d1['query'][_0xeece('0x39')]));_0x420458['attributes']=_0x420458['attributes']['length']?_0x420458[_0xeece('0x38')]:_0x20859b[_0xeece('0x33')];if(_0x2895d1[_0xeece('0x34')][_0xeece('0x41')]){_0x420458[_0xeece('0x45')]=[{'all':!![]}];}_0x420458=_[_0xeece('0x3f')]({},_0x420458,_0x2895d1[_0xeece('0x46')]);return db[_0xeece('0x2e')]['find'](_0x420458)['then'](handleEntityNotFound(_0x1a21b1,null))[_0xeece('0x25')](respondWithResult(_0x1a21b1,null))[_0xeece('0x43')](handleError(_0x1a21b1,null));};exports[_0xeece('0x47')]=function(_0x43dd3d,_0x1c78f7){return db['MailServerOut'][_0xeece('0x47')](_0x43dd3d['body'],{})[_0xeece('0x25')](respondWithResult(_0x1c78f7,0xc9))['catch'](handleError(_0x1c78f7,null));};exports[_0xeece('0x48')]=function(_0x273033,_0x1b90c6){if(_0x273033['body']['id']){delete _0x273033['body']['id'];}return db[_0xeece('0x2e')][_0xeece('0x49')]({'where':{'id':_0x273033['params']['id']}})['then'](handleEntityNotFound(_0x1b90c6,null))['then'](saveUpdates(_0x273033[_0xeece('0x4a')],null))[_0xeece('0x25')](respondWithResult(_0x1b90c6,null))[_0xeece('0x43')](handleError(_0x1b90c6,null));};exports[_0xeece('0x26')]=function(_0x4d0bbc,_0x2c4cc0){return db['MailServerOut'][_0xeece('0x49')]({'where':{'id':_0x4d0bbc['params']['id']}})[_0xeece('0x25')](handleEntityNotFound(_0x2c4cc0,null))[_0xeece('0x25')](removeEntity(_0x2c4cc0,null))[_0xeece('0x43')](handleError(_0x2c4cc0,null));}; \ No newline at end of file +var _0xebe6=['pick','merge','type','VIRTUAL','filter','options','MailServerOut','findAll','rows','catch','show','params','include','find','create','body','eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters'];(function(_0x3823d9,_0x31618e){var _0x3f3863=function(_0x33c256){while(--_0x33c256){_0x3823d9['push'](_0x3823d9['shift']());}};_0x3f3863(++_0x31618e);}(_0xebe6,0x96));var _0x6ebe=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0xebe6[_0x1ebe2f];return _0xdeb06f;};'use strict';var emlformat=require(_0x6ebe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ebe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ebe('0x2'));var util=require('util');var path=require(_0x6ebe('0x3'));var sox=require('sox');var csv=require(_0x6ebe('0x4'));var ejs=require(_0x6ebe('0x5'));var fs=require('fs');var fs_extra=require(_0x6ebe('0x6'));var _=require(_0x6ebe('0x7'));var squel=require('squel');var crypto=require(_0x6ebe('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ebe('0x4'));var querystring=require('querystring');var Papa=require(_0x6ebe('0x9'));var Redis=require(_0x6ebe('0xa'));var authService=require(_0x6ebe('0xb'));var qs=require(_0x6ebe('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ebe('0xd'))(_0x6ebe('0xe'));var utils=require(_0x6ebe('0xf'));var config=require(_0x6ebe('0x10'));var licenseUtil=require(_0x6ebe('0x11'));var db=require(_0x6ebe('0x12'))['db'];function respondWithStatusCode(_0x50d9ec,_0x499ed7){_0x499ed7=_0x499ed7||0xcc;return function(_0x5dca4f){if(_0x5dca4f){return _0x50d9ec['sendStatus'](_0x499ed7);}return _0x50d9ec[_0x6ebe('0x13')](_0x499ed7)[_0x6ebe('0x14')]();};}function respondWithResult(_0x577ccd,_0x31b00c){_0x31b00c=_0x31b00c||0xc8;return function(_0x4e0611){if(_0x4e0611){return _0x577ccd[_0x6ebe('0x13')](_0x31b00c)[_0x6ebe('0x15')](_0x4e0611);}};}function respondWithFilteredResult(_0x15b7a1,_0x2fd11d){return function(_0x8a6cc3){if(_0x8a6cc3){var _0x4c00ca=typeof _0x2fd11d[_0x6ebe('0x16')]===_0x6ebe('0x17')&&typeof _0x2fd11d[_0x6ebe('0x18')]===_0x6ebe('0x17');var _0x107165=_0x8a6cc3['count'];var _0x23e330=_0x4c00ca?0x0:_0x2fd11d[_0x6ebe('0x16')];var _0x3aa50b=_0x4c00ca?_0x8a6cc3[_0x6ebe('0x19')]:_0x2fd11d[_0x6ebe('0x16')]+_0x2fd11d['limit'];var _0x2a228a;if(_0x3aa50b>=_0x107165){_0x3aa50b=_0x107165;_0x2a228a=0xc8;}else{_0x2a228a=0xce;}_0x15b7a1[_0x6ebe('0x13')](_0x2a228a);return _0x15b7a1[_0x6ebe('0x1a')](_0x6ebe('0x1b'),_0x23e330+'-'+_0x3aa50b+'/'+_0x107165)[_0x6ebe('0x15')](_0x8a6cc3);}return null;};}function patchUpdates(_0xac1dcd){return function(_0x1914fe){try{jsonpatch[_0x6ebe('0x1c')](_0x1914fe,_0xac1dcd,!![]);}catch(_0x43a0f3){return BPromise[_0x6ebe('0x1d')](_0x43a0f3);}return _0x1914fe[_0x6ebe('0x1e')]();};}function saveUpdates(_0x51c3af,_0x2c3964){return function(_0xc74ef0){if(_0xc74ef0){return _0xc74ef0[_0x6ebe('0x1f')](_0x51c3af)[_0x6ebe('0x20')](function(_0x43145e){return _0x43145e;});}return null;};}function removeEntity(_0x5d6e19,_0x4df4ba){return function(_0x4e2734){if(_0x4e2734){return _0x4e2734[_0x6ebe('0x21')]()[_0x6ebe('0x20')](function(){_0x5d6e19[_0x6ebe('0x13')](0xcc)[_0x6ebe('0x14')]();});}};}function handleEntityNotFound(_0x439454,_0x3fc80e){return function(_0x4c5a62){if(!_0x4c5a62){_0x439454['sendStatus'](0x194);}return _0x4c5a62;};}function handleError(_0x196f4f,_0x62b838){_0x62b838=_0x62b838||0x1f4;return function(_0x438cbd){logger['error'](_0x438cbd[_0x6ebe('0x22')]);if(_0x438cbd[_0x6ebe('0x23')]){delete _0x438cbd[_0x6ebe('0x23')];}_0x196f4f[_0x6ebe('0x13')](_0x62b838)[_0x6ebe('0x24')](_0x438cbd);};}exports[_0x6ebe('0x25')]=function(_0x416fbb,_0x2574ad){var _0x48e931={},_0xf53829={},_0x1c38c9={'count':0x0,'rows':[]};var _0x25b1ec=_[_0x6ebe('0x26')](db['MailServerOut']['rawAttributes'],function(_0x589736){return{'name':_0x589736['fieldName'],'type':_0x589736['type'][_0x6ebe('0x27')]};});_0xf53829[_0x6ebe('0x28')]=_['map'](_0x25b1ec,_0x6ebe('0x23'));_0xf53829[_0x6ebe('0x29')]=_[_0x6ebe('0x2a')](_0x416fbb[_0x6ebe('0x29')]);_0xf53829['filters']=_['intersection'](_0xf53829['model'],_0xf53829['query']);_0x48e931[_0x6ebe('0x2b')]=_[_0x6ebe('0x2c')](_0xf53829['model'],qs['fields'](_0x416fbb['query'][_0x6ebe('0x2d')]));_0x48e931[_0x6ebe('0x2b')]=_0x48e931[_0x6ebe('0x2b')][_0x6ebe('0x2e')]?_0x48e931[_0x6ebe('0x2b')]:_0xf53829[_0x6ebe('0x28')];if(!_0x416fbb[_0x6ebe('0x29')]['hasOwnProperty']('nolimit')){_0x48e931[_0x6ebe('0x18')]=qs[_0x6ebe('0x18')](_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x18')]);_0x48e931[_0x6ebe('0x16')]=qs[_0x6ebe('0x16')](_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x16')]);}_0x48e931[_0x6ebe('0x2f')]=qs[_0x6ebe('0x30')](_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x30')]);_0x48e931[_0x6ebe('0x31')]=qs[_0x6ebe('0x32')](_[_0x6ebe('0x33')](_0x416fbb[_0x6ebe('0x29')],_0xf53829[_0x6ebe('0x32')]),_0x25b1ec);if(_0x416fbb[_0x6ebe('0x29')]['filter']){_0x48e931[_0x6ebe('0x31')]=_[_0x6ebe('0x34')](_0x48e931[_0x6ebe('0x31')],{'$or':_[_0x6ebe('0x26')](_0x25b1ec,function(_0x1b1397){if(_0x1b1397[_0x6ebe('0x35')]!==_0x6ebe('0x36')){var _0x4fb82f={};_0x4fb82f[_0x1b1397[_0x6ebe('0x23')]]={'$like':'%'+_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x37')]+'%'};return _0x4fb82f;}})});}_0x48e931=_[_0x6ebe('0x34')]({},_0x48e931,_0x416fbb[_0x6ebe('0x38')]);var _0x24f248={'where':_0x48e931['where']};return db[_0x6ebe('0x39')]['count'](_0x24f248)['then'](function(_0x522b8f){_0x1c38c9['count']=_0x522b8f;if(_0x416fbb[_0x6ebe('0x29')]['includeAll']){_0x48e931['include']=[{'all':!![]}];}return db[_0x6ebe('0x39')][_0x6ebe('0x3a')](_0x48e931);})['then'](function(_0xd9ce0c){_0x1c38c9[_0x6ebe('0x3b')]=_0xd9ce0c;return _0x1c38c9;})[_0x6ebe('0x20')](respondWithFilteredResult(_0x2574ad,_0x48e931))[_0x6ebe('0x3c')](handleError(_0x2574ad,null));};exports[_0x6ebe('0x3d')]=function(_0x241d51,_0x2ad3e2){var _0xb861fb={'raw':!![],'where':{'id':_0x241d51[_0x6ebe('0x3e')]['id']}},_0x53f0a8={};_0x53f0a8['model']=_[_0x6ebe('0x2a')](db['MailServerOut']['rawAttributes']);_0x53f0a8['query']=_['keys'](_0x241d51[_0x6ebe('0x29')]);_0x53f0a8[_0x6ebe('0x32')]=_[_0x6ebe('0x2c')](_0x53f0a8['model'],_0x53f0a8[_0x6ebe('0x29')]);_0xb861fb[_0x6ebe('0x2b')]=_['intersection'](_0x53f0a8[_0x6ebe('0x28')],qs[_0x6ebe('0x2d')](_0x241d51[_0x6ebe('0x29')][_0x6ebe('0x2d')]));_0xb861fb[_0x6ebe('0x2b')]=_0xb861fb[_0x6ebe('0x2b')][_0x6ebe('0x2e')]?_0xb861fb[_0x6ebe('0x2b')]:_0x53f0a8[_0x6ebe('0x28')];if(_0x241d51[_0x6ebe('0x29')]['includeAll']){_0xb861fb[_0x6ebe('0x3f')]=[{'all':!![]}];}_0xb861fb=_[_0x6ebe('0x34')]({},_0xb861fb,_0x241d51[_0x6ebe('0x38')]);return db[_0x6ebe('0x39')][_0x6ebe('0x40')](_0xb861fb)[_0x6ebe('0x20')](handleEntityNotFound(_0x2ad3e2,null))[_0x6ebe('0x20')](respondWithResult(_0x2ad3e2,null))['catch'](handleError(_0x2ad3e2,null));};exports[_0x6ebe('0x41')]=function(_0x42d817,_0x15b926){return db['MailServerOut'][_0x6ebe('0x41')](_0x42d817[_0x6ebe('0x42')],{})[_0x6ebe('0x20')](respondWithResult(_0x15b926,0xc9))[_0x6ebe('0x3c')](handleError(_0x15b926,null));};exports[_0x6ebe('0x1f')]=function(_0x28ccdd,_0x260e28){if(_0x28ccdd['body']['id']){delete _0x28ccdd[_0x6ebe('0x42')]['id'];}return db[_0x6ebe('0x39')][_0x6ebe('0x40')]({'where':{'id':_0x28ccdd['params']['id']}})[_0x6ebe('0x20')](handleEntityNotFound(_0x260e28,null))[_0x6ebe('0x20')](saveUpdates(_0x28ccdd[_0x6ebe('0x42')],null))[_0x6ebe('0x20')](respondWithResult(_0x260e28,null))['catch'](handleError(_0x260e28,null));};exports[_0x6ebe('0x21')]=function(_0x231e43,_0x2270c7){return db[_0x6ebe('0x39')][_0x6ebe('0x40')]({'where':{'id':_0x231e43['params']['id']}})['then'](handleEntityNotFound(_0x2270c7,null))[_0x6ebe('0x20')](removeEntity(_0x2270c7,null))['catch'](handleError(_0x2270c7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 7a034b1..f64e421 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 _0xf266=['rimraf','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x28ce49,_0x17ac63){var _0x1d9a62=function(_0x5adbd3){while(--_0x5adbd3){_0x28ce49['push'](_0x28ce49['shift']());}};_0x1d9a62(++_0x17ac63);}(_0xf266,0xbc));var _0x6f26=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xf266[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x6f26('0x0'));var util=require(_0x6f26('0x1'));var logger=require(_0x6f26('0x2'))(_0x6f26('0x3'));var moment=require(_0x6f26('0x4'));var BPromise=require(_0x6f26('0x5'));var rp=require(_0x6f26('0x6'));var fs=require('fs');var path=require(_0x6f26('0x7'));var rimraf=require(_0x6f26('0x8'));var config=require('../../config/environment');var attributes=require(_0x6f26('0x9'));module[_0x6f26('0xa')]=function(_0x10190e,_0x310504){return _0x10190e[_0x6f26('0xb')](_0x6f26('0xc'),attributes,{'tableName':_0x6f26('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56f0=['moment','bluebird','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','api'];(function(_0x37f16c,_0x156943){var _0x7b87bb=function(_0x3398c6){while(--_0x3398c6){_0x37f16c['push'](_0x37f16c['shift']());}};_0x7b87bb(++_0x156943);}(_0x56f0,0x11d));var _0x056f=function(_0x14bb2f,_0x3c8ed0){_0x14bb2f=_0x14bb2f-0x0;var _0x5e2041=_0x56f0[_0x14bb2f];return _0x5e2041;};'use strict';var _=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var logger=require('../../config/logger')(_0x056f('0x2'));var moment=require(_0x056f('0x3'));var BPromise=require(_0x056f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x056f('0x5'));var rimraf=require(_0x056f('0x6'));var config=require('../../config/environment');var attributes=require(_0x056f('0x7'));module[_0x056f('0x8')]=function(_0x3fb7c7,_0x331d2f){return _0x3fb7c7[_0x056f('0x9')](_0x056f('0xa'),attributes,{'tableName':_0x056f('0xb'),'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 8e3ebcd..7a9060a 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0xe8df77,_0x4a64bb){var _0x3849e5=function(_0x65ee15){while(--_0x65ee15){_0xe8df77['push'](_0xe8df77['shift']());}};_0x3849e5(++_0x4a64bb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x17be82,_0xda95f){_0x17be82=_0x17be82-0x0;var _0x49c342=_0x5f2f[_0x17be82];return _0x49c342;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x31cc3c,_0x5acdbe){_0x31cc3c=_0x31cc3c-0x0;var _0xecdceb=_0x7a54[_0x31cc3c];return _0xecdceb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 034ae8b..a8623c6 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 _0x9210=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','create','put'];(function(_0x5c2fa6,_0xecf9bb){var _0x22c277=function(_0x2aef68){while(--_0x2aef68){_0x5c2fa6['push'](_0x5c2fa6['shift']());}};_0x22c277(++_0xecf9bb);}(_0x9210,0x7b));var _0x0921=function(_0xa7803,_0x2c9fc5){_0xa7803=_0xa7803-0x0;var _0x480572=_0x9210[_0xa7803];return _0x480572;};'use strict';var multer=require(_0x0921('0x0'));var util=require('util');var path=require(_0x0921('0x1'));var timeout=require(_0x0921('0x2'));var express=require(_0x0921('0x3'));var router=express[_0x0921('0x4')]();var fs_extra=require(_0x0921('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0921('0x6'));var config=require(_0x0921('0x7'));var controller=require(_0x0921('0x8'));router[_0x0921('0x9')]('/',auth[_0x0921('0xa')](),controller[_0x0921('0xb')]);router[_0x0921('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0921('0xc')]);router[_0x0921('0x9')](_0x0921('0xd'),auth[_0x0921('0xa')](),controller[_0x0921('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0921('0xf')]);router[_0x0921('0x10')]('/:id',auth[_0x0921('0xa')](),controller['update']);router[_0x0921('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0921('0x12')]);module[_0x0921('0x13')]=router; \ No newline at end of file +var _0xc52d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x2896a1,_0x20fa1f){var _0x5e5304=function(_0x175e4a){while(--_0x175e4a){_0x2896a1['push'](_0x2896a1['shift']());}};_0x5e5304(++_0x20fa1f);}(_0xc52d,0xf2));var _0xdc52=function(_0x3bf4fd,_0x570086){_0x3bf4fd=_0x3bf4fd-0x0;var _0xfb299=_0xc52d[_0x3bf4fd];return _0xfb299;};'use strict';var multer=require(_0xdc52('0x0'));var util=require(_0xdc52('0x1'));var path=require(_0xdc52('0x2'));var timeout=require(_0xdc52('0x3'));var express=require(_0xdc52('0x4'));var router=express[_0xdc52('0x5')]();var fs_extra=require(_0xdc52('0x6'));var auth=require(_0xdc52('0x7'));var interaction=require(_0xdc52('0x8'));var config=require(_0xdc52('0x9'));var controller=require(_0xdc52('0xa'));router[_0xdc52('0xb')]('/',auth[_0xdc52('0xc')](),controller['index']);router['get'](_0xdc52('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xdc52('0xb')](_0xdc52('0xe'),auth[_0xdc52('0xc')](),controller[_0xdc52('0xf')]);router[_0xdc52('0x10')]('/',auth['isAuthenticated'](),controller[_0xdc52('0x11')]);router['put']('/:id',auth[_0xdc52('0xc')](),controller[_0xdc52('0x12')]);router[_0xdc52('0x13')](_0xdc52('0xe'),auth[_0xdc52('0xc')](),controller[_0xdc52('0x14')]);module[_0xdc52('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ffbdf7a..1089fd4 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0af5=['STRING','name','exports'];(function(_0xa121d2,_0x53bf78){var _0x4fd840=function(_0x2a0092){while(--_0x2a0092){_0xa121d2['push'](_0xa121d2['shift']());}};_0x4fd840(++_0x53bf78);}(_0x0af5,0x158));var _0x50af=function(_0x3556b4,_0x4f07fb){_0x3556b4=_0x3556b4-0x0;var _0x3b083f=_0x0af5[_0x3556b4];return _0x3b083f;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'unique':_0x50af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x50af('0x1')]}}; \ No newline at end of file +var _0xe2fe=['sequelize','name'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xee2f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 88c56ce..e6968ec 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 _0x9820=['create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','sendStatus','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','find'];(function(_0x177e9d,_0x5999ea){var _0x219049=function(_0x4ddc7b){while(--_0x4ddc7b){_0x177e9d['push'](_0x177e9d['shift']());}};_0x219049(++_0x5999ea);}(_0x9820,0xf4));var _0x0982=function(_0x215a87,_0xc9556b){_0x215a87=_0x215a87-0x0;var _0x5d16b1=_0x9820[_0x215a87];return _0x5d16b1;};'use strict';var emlformat=require(_0x0982('0x0'));var rimraf=require(_0x0982('0x1'));var zipdir=require(_0x0982('0x2'));var jsonpatch=require(_0x0982('0x3'));var rp=require(_0x0982('0x4'));var moment=require(_0x0982('0x5'));var BPromise=require(_0x0982('0x6'));var Mustache=require(_0x0982('0x7'));var util=require(_0x0982('0x8'));var path=require(_0x0982('0x9'));var sox=require('sox');var csv=require(_0x0982('0xa'));var ejs=require(_0x0982('0xb'));var fs=require('fs');var fs_extra=require(_0x0982('0xc'));var _=require(_0x0982('0xd'));var squel=require(_0x0982('0xe'));var crypto=require(_0x0982('0xf'));var jsforce=require(_0x0982('0x10'));var deskjs=require(_0x0982('0x11'));var toCsv=require(_0x0982('0xa'));var querystring=require(_0x0982('0x12'));var Papa=require(_0x0982('0x13'));var Redis=require(_0x0982('0x14'));var authService=require(_0x0982('0x15'));var qs=require(_0x0982('0x16'));var as=require(_0x0982('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0982('0x18'))(_0x0982('0x19'));var utils=require(_0x0982('0x1a'));var config=require(_0x0982('0x1b'));var licenseUtil=require(_0x0982('0x1c'));var db=require(_0x0982('0x1d'))['db'];function respondWithStatusCode(_0xe1d576,_0x46e695){_0x46e695=_0x46e695||0xcc;return function(_0x13d5b2){if(_0x13d5b2){return _0xe1d576['sendStatus'](_0x46e695);}return _0xe1d576[_0x0982('0x1e')](_0x46e695)[_0x0982('0x1f')]();};}function respondWithResult(_0x68b53,_0x231788){_0x231788=_0x231788||0xc8;return function(_0x4f6500){if(_0x4f6500){return _0x68b53['status'](_0x231788)['json'](_0x4f6500);}};}function respondWithFilteredResult(_0x4a13d0,_0x47ccc0){return function(_0x2fc2f0){if(_0x2fc2f0){var _0x1c0868=typeof _0x47ccc0[_0x0982('0x20')]===_0x0982('0x21')&&typeof _0x47ccc0[_0x0982('0x22')]===_0x0982('0x21');var _0xab45ad=_0x2fc2f0[_0x0982('0x23')];var _0x519611=_0x1c0868?0x0:_0x47ccc0[_0x0982('0x20')];var _0x59131e=_0x1c0868?_0x2fc2f0[_0x0982('0x23')]:_0x47ccc0[_0x0982('0x20')]+_0x47ccc0['limit'];var _0x2903b6;if(_0x59131e>=_0xab45ad){_0x59131e=_0xab45ad;_0x2903b6=0xc8;}else{_0x2903b6=0xce;}_0x4a13d0[_0x0982('0x1e')](_0x2903b6);return _0x4a13d0['set'](_0x0982('0x24'),_0x519611+'-'+_0x59131e+'/'+_0xab45ad)[_0x0982('0x25')](_0x2fc2f0);}return null;};}function patchUpdates(_0x53bde1){return function(_0x561886){try{jsonpatch[_0x0982('0x26')](_0x561886,_0x53bde1,!![]);}catch(_0x321d87){return BPromise['reject'](_0x321d87);}return _0x561886[_0x0982('0x27')]();};}function saveUpdates(_0x83250f,_0x3aac7e){return function(_0x59efd4){if(_0x59efd4){return _0x59efd4['update'](_0x83250f)[_0x0982('0x28')](function(_0x380d90){return _0x380d90;});}return null;};}function removeEntity(_0x385687,_0x269894){return function(_0x3adc2b){if(_0x3adc2b){return _0x3adc2b[_0x0982('0x29')]()[_0x0982('0x28')](function(){_0x385687[_0x0982('0x1e')](0xcc)[_0x0982('0x1f')]();});}};}function handleEntityNotFound(_0x83266c,_0x43fce4){return function(_0x31375b){if(!_0x31375b){_0x83266c[_0x0982('0x2a')](0x194);}return _0x31375b;};}function handleError(_0x11a1bb,_0x5d1ad7){_0x5d1ad7=_0x5d1ad7||0x1f4;return function(_0x405aa7){logger['error'](_0x405aa7[_0x0982('0x2b')]);if(_0x405aa7[_0x0982('0x2c')]){delete _0x405aa7[_0x0982('0x2c')];}_0x11a1bb[_0x0982('0x1e')](_0x5d1ad7)['send'](_0x405aa7);};}exports[_0x0982('0x2d')]=function(_0x23c8e7,_0x233e3d){var _0x5d0d57={},_0x36271d={},_0x31e397={'count':0x0,'rows':[]};var _0x1fe8a2=_[_0x0982('0x2e')](db[_0x0982('0x2f')][_0x0982('0x30')],function(_0x1b34a5){return{'name':_0x1b34a5[_0x0982('0x31')],'type':_0x1b34a5[_0x0982('0x32')][_0x0982('0x33')]};});_0x36271d['model']=_['map'](_0x1fe8a2,_0x0982('0x2c'));_0x36271d[_0x0982('0x34')]=_['keys'](_0x23c8e7[_0x0982('0x34')]);_0x36271d[_0x0982('0x35')]=_[_0x0982('0x36')](_0x36271d[_0x0982('0x37')],_0x36271d[_0x0982('0x34')]);_0x5d0d57[_0x0982('0x38')]=_['intersection'](_0x36271d[_0x0982('0x37')],qs[_0x0982('0x39')](_0x23c8e7['query'][_0x0982('0x39')]));_0x5d0d57[_0x0982('0x38')]=_0x5d0d57['attributes'][_0x0982('0x3a')]?_0x5d0d57[_0x0982('0x38')]:_0x36271d['model'];if(!_0x23c8e7['query'][_0x0982('0x3b')](_0x0982('0x3c'))){_0x5d0d57[_0x0982('0x22')]=qs[_0x0982('0x22')](_0x23c8e7[_0x0982('0x34')]['limit']);_0x5d0d57[_0x0982('0x20')]=qs['offset'](_0x23c8e7[_0x0982('0x34')][_0x0982('0x20')]);}_0x5d0d57[_0x0982('0x3d')]=qs[_0x0982('0x3e')](_0x23c8e7[_0x0982('0x34')][_0x0982('0x3e')]);_0x5d0d57[_0x0982('0x3f')]=qs[_0x0982('0x35')](_[_0x0982('0x40')](_0x23c8e7[_0x0982('0x34')],_0x36271d['filters']),_0x1fe8a2);if(_0x23c8e7['query'][_0x0982('0x41')]){_0x5d0d57[_0x0982('0x3f')]=_[_0x0982('0x42')](_0x5d0d57[_0x0982('0x3f')],{'$or':_[_0x0982('0x2e')](_0x1fe8a2,function(_0x1ca267){if(_0x1ca267[_0x0982('0x32')]!=='VIRTUAL'){var _0x56228d={};_0x56228d[_0x1ca267[_0x0982('0x2c')]]={'$like':'%'+_0x23c8e7['query']['filter']+'%'};return _0x56228d;}})});}_0x5d0d57=_[_0x0982('0x42')]({},_0x5d0d57,_0x23c8e7[_0x0982('0x43')]);var _0x213374={'where':_0x5d0d57[_0x0982('0x3f')]};return db['MailSubstatus']['count'](_0x213374)[_0x0982('0x28')](function(_0x1bef05){_0x31e397['count']=_0x1bef05;if(_0x23c8e7[_0x0982('0x34')]['includeAll']){_0x5d0d57[_0x0982('0x44')]=[{'all':!![]}];}return db['MailSubstatus'][_0x0982('0x45')](_0x5d0d57);})[_0x0982('0x28')](function(_0x4e27b3){_0x31e397['rows']=_0x4e27b3;return _0x31e397;})[_0x0982('0x28')](respondWithFilteredResult(_0x233e3d,_0x5d0d57))[_0x0982('0x46')](handleError(_0x233e3d,null));};exports[_0x0982('0x47')]=function(_0x39f556,_0x513b2f){var _0x2dbb36={'raw':!![],'where':{'id':_0x39f556[_0x0982('0x48')]['id']}},_0x287c8c={};_0x287c8c[_0x0982('0x37')]=_[_0x0982('0x49')](db[_0x0982('0x2f')][_0x0982('0x30')]);_0x287c8c[_0x0982('0x34')]=_['keys'](_0x39f556[_0x0982('0x34')]);_0x287c8c[_0x0982('0x35')]=_[_0x0982('0x36')](_0x287c8c['model'],_0x287c8c[_0x0982('0x34')]);_0x2dbb36[_0x0982('0x38')]=_[_0x0982('0x36')](_0x287c8c['model'],qs[_0x0982('0x39')](_0x39f556['query'][_0x0982('0x39')]));_0x2dbb36['attributes']=_0x2dbb36['attributes'][_0x0982('0x3a')]?_0x2dbb36[_0x0982('0x38')]:_0x287c8c[_0x0982('0x37')];if(_0x39f556[_0x0982('0x34')][_0x0982('0x4a')]){_0x2dbb36['include']=[{'all':!![]}];}_0x2dbb36=_['merge']({},_0x2dbb36,_0x39f556[_0x0982('0x43')]);return db['MailSubstatus'][_0x0982('0x4b')](_0x2dbb36)[_0x0982('0x28')](handleEntityNotFound(_0x513b2f,null))[_0x0982('0x28')](respondWithResult(_0x513b2f,null))[_0x0982('0x46')](handleError(_0x513b2f,null));};exports['create']=function(_0x5e3d11,_0x2af027){return db[_0x0982('0x2f')][_0x0982('0x4c')](_0x5e3d11[_0x0982('0x4d')],{})[_0x0982('0x28')](respondWithResult(_0x2af027,0xc9))[_0x0982('0x46')](handleError(_0x2af027,null));};exports[_0x0982('0x4e')]=function(_0x59b59b,_0x124f52){if(_0x59b59b['body']['id']){delete _0x59b59b[_0x0982('0x4d')]['id'];}return db[_0x0982('0x2f')][_0x0982('0x4b')]({'where':{'id':_0x59b59b['params']['id']}})[_0x0982('0x28')](handleEntityNotFound(_0x124f52,null))[_0x0982('0x28')](saveUpdates(_0x59b59b['body'],null))['then'](respondWithResult(_0x124f52,null))[_0x0982('0x46')](handleError(_0x124f52,null));};exports[_0x0982('0x29')]=function(_0x3b5dd1,_0x24983e){return db['MailSubstatus'][_0x0982('0x4b')]({'where':{'id':_0x3b5dd1[_0x0982('0x48')]['id']}})['then'](handleEntityNotFound(_0x24983e,null))[_0x0982('0x28')](removeEntity(_0x24983e,null))[_0x0982('0x46')](handleError(_0x24983e,null));};exports[_0x0982('0x4f')]=function(_0x51cc52,_0x1ddf26){return db['MailSubstatus'][_0x0982('0x4f')]()[_0x0982('0x28')](respondWithResult(_0x1ddf26,null))[_0x0982('0x46')](handleError(_0x1ddf26,null));}; \ No newline at end of file +var _0xddb6=['name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','findAll','find','catch','create','body','update','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','reject','destroy','error'];(function(_0x24c15a,_0x261c48){var _0x2a3137=function(_0x25096a){while(--_0x25096a){_0x24c15a['push'](_0x24c15a['shift']());}};_0x2a3137(++_0x261c48);}(_0xddb6,0x171));var _0x6ddb=function(_0x32636b,_0x453e9e){_0x32636b=_0x32636b-0x0;var _0x483f98=_0xddb6[_0x32636b];return _0x483f98;};'use strict';var emlformat=require(_0x6ddb('0x0'));var rimraf=require(_0x6ddb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ddb('0x2'));var moment=require(_0x6ddb('0x3'));var BPromise=require(_0x6ddb('0x4'));var Mustache=require('mustache');var util=require(_0x6ddb('0x5'));var path=require(_0x6ddb('0x6'));var sox=require(_0x6ddb('0x7'));var csv=require('to-csv');var ejs=require(_0x6ddb('0x8'));var fs=require('fs');var fs_extra=require(_0x6ddb('0x9'));var _=require(_0x6ddb('0xa'));var squel=require(_0x6ddb('0xb'));var crypto=require('crypto');var jsforce=require(_0x6ddb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6ddb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6ddb('0xe'));var as=require(_0x6ddb('0xf'));var hardwareService=require(_0x6ddb('0x10'));var logger=require(_0x6ddb('0x11'))(_0x6ddb('0x12'));var utils=require('../../config/utils');var config=require(_0x6ddb('0x13'));var licenseUtil=require(_0x6ddb('0x14'));var db=require(_0x6ddb('0x15'))['db'];function respondWithStatusCode(_0x30e2d1,_0x37126f){_0x37126f=_0x37126f||0xcc;return function(_0xa39a14){if(_0xa39a14){return _0x30e2d1[_0x6ddb('0x16')](_0x37126f);}return _0x30e2d1['status'](_0x37126f)[_0x6ddb('0x17')]();};}function respondWithResult(_0xe5cfdb,_0x4f9b77){_0x4f9b77=_0x4f9b77||0xc8;return function(_0x613b82){if(_0x613b82){return _0xe5cfdb[_0x6ddb('0x18')](_0x4f9b77)[_0x6ddb('0x19')](_0x613b82);}};}function respondWithFilteredResult(_0x43083d,_0x20f030){return function(_0x3fb00b){if(_0x3fb00b){var _0x4382ff=typeof _0x20f030[_0x6ddb('0x1a')]==='undefined'&&typeof _0x20f030[_0x6ddb('0x1b')]==='undefined';var _0x10f4bc=_0x3fb00b[_0x6ddb('0x1c')];var _0x165dd5=_0x4382ff?0x0:_0x20f030[_0x6ddb('0x1a')];var _0x3d8a91=_0x4382ff?_0x3fb00b[_0x6ddb('0x1c')]:_0x20f030['offset']+_0x20f030[_0x6ddb('0x1b')];var _0xdb2c99;if(_0x3d8a91>=_0x10f4bc){_0x3d8a91=_0x10f4bc;_0xdb2c99=0xc8;}else{_0xdb2c99=0xce;}_0x43083d[_0x6ddb('0x18')](_0xdb2c99);return _0x43083d[_0x6ddb('0x1d')]('Content-Range',_0x165dd5+'-'+_0x3d8a91+'/'+_0x10f4bc)[_0x6ddb('0x19')](_0x3fb00b);}return null;};}function patchUpdates(_0x138447){return function(_0x48261d){try{jsonpatch['apply'](_0x48261d,_0x138447,!![]);}catch(_0x2571a0){return BPromise[_0x6ddb('0x1e')](_0x2571a0);}return _0x48261d['save']();};}function saveUpdates(_0x25ff44,_0x49bc21){return function(_0x27db13){if(_0x27db13){return _0x27db13['update'](_0x25ff44)['then'](function(_0x17fe9e){return _0x17fe9e;});}return null;};}function removeEntity(_0x286696,_0x5c8f81){return function(_0x513ca6){if(_0x513ca6){return _0x513ca6[_0x6ddb('0x1f')]()['then'](function(){_0x286696[_0x6ddb('0x18')](0xcc)[_0x6ddb('0x17')]();});}};}function handleEntityNotFound(_0x1e2e7f,_0x149b40){return function(_0x1efbef){if(!_0x1efbef){_0x1e2e7f[_0x6ddb('0x16')](0x194);}return _0x1efbef;};}function handleError(_0x11b94e,_0x46588c){_0x46588c=_0x46588c||0x1f4;return function(_0x346efc){logger[_0x6ddb('0x20')](_0x346efc['stack']);if(_0x346efc['name']){delete _0x346efc[_0x6ddb('0x21')];}_0x11b94e['status'](_0x46588c)[_0x6ddb('0x22')](_0x346efc);};}exports['index']=function(_0x2ac586,_0x5809df){var _0x22e5f1={},_0x16d382={},_0x1de7ca={'count':0x0,'rows':[]};var _0x365fb7=_[_0x6ddb('0x23')](db[_0x6ddb('0x24')][_0x6ddb('0x25')],function(_0xfd5129){return{'name':_0xfd5129[_0x6ddb('0x26')],'type':_0xfd5129[_0x6ddb('0x27')][_0x6ddb('0x28')]};});_0x16d382[_0x6ddb('0x29')]=_[_0x6ddb('0x23')](_0x365fb7,'name');_0x16d382[_0x6ddb('0x2a')]=_[_0x6ddb('0x2b')](_0x2ac586[_0x6ddb('0x2a')]);_0x16d382['filters']=_[_0x6ddb('0x2c')](_0x16d382[_0x6ddb('0x29')],_0x16d382[_0x6ddb('0x2a')]);_0x22e5f1[_0x6ddb('0x2d')]=_['intersection'](_0x16d382[_0x6ddb('0x29')],qs[_0x6ddb('0x2e')](_0x2ac586['query'][_0x6ddb('0x2e')]));_0x22e5f1['attributes']=_0x22e5f1['attributes'][_0x6ddb('0x2f')]?_0x22e5f1['attributes']:_0x16d382[_0x6ddb('0x29')];if(!_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x30')](_0x6ddb('0x31'))){_0x22e5f1[_0x6ddb('0x1b')]=qs['limit'](_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x1b')]);_0x22e5f1[_0x6ddb('0x1a')]=qs[_0x6ddb('0x1a')](_0x2ac586['query'][_0x6ddb('0x1a')]);}_0x22e5f1[_0x6ddb('0x32')]=qs[_0x6ddb('0x33')](_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x33')]);_0x22e5f1[_0x6ddb('0x34')]=qs['filters'](_['pick'](_0x2ac586[_0x6ddb('0x2a')],_0x16d382['filters']),_0x365fb7);if(_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x35')]){_0x22e5f1[_0x6ddb('0x34')]=_[_0x6ddb('0x36')](_0x22e5f1[_0x6ddb('0x34')],{'$or':_[_0x6ddb('0x23')](_0x365fb7,function(_0x1e7f20){if(_0x1e7f20[_0x6ddb('0x27')]!=='VIRTUAL'){var _0xfb10a={};_0xfb10a[_0x1e7f20[_0x6ddb('0x21')]]={'$like':'%'+_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x35')]+'%'};return _0xfb10a;}})});}_0x22e5f1=_[_0x6ddb('0x36')]({},_0x22e5f1,_0x2ac586[_0x6ddb('0x37')]);var _0x5eec18={'where':_0x22e5f1[_0x6ddb('0x34')]};return db['MailSubstatus']['count'](_0x5eec18)[_0x6ddb('0x38')](function(_0x47a75c){_0x1de7ca[_0x6ddb('0x1c')]=_0x47a75c;if(_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x39')]){_0x22e5f1[_0x6ddb('0x3a')]=[{'all':!![]}];}return db[_0x6ddb('0x24')][_0x6ddb('0x3b')](_0x22e5f1);})['then'](function(_0x306fc6){_0x1de7ca['rows']=_0x306fc6;return _0x1de7ca;})[_0x6ddb('0x38')](respondWithFilteredResult(_0x5809df,_0x22e5f1))['catch'](handleError(_0x5809df,null));};exports['show']=function(_0x59257c,_0x3fa672){var _0x2b19c9={'raw':!![],'where':{'id':_0x59257c['params']['id']}},_0x101a89={};_0x101a89[_0x6ddb('0x29')]=_['keys'](db[_0x6ddb('0x24')]['rawAttributes']);_0x101a89[_0x6ddb('0x2a')]=_[_0x6ddb('0x2b')](_0x59257c['query']);_0x101a89['filters']=_['intersection'](_0x101a89[_0x6ddb('0x29')],_0x101a89[_0x6ddb('0x2a')]);_0x2b19c9[_0x6ddb('0x2d')]=_[_0x6ddb('0x2c')](_0x101a89[_0x6ddb('0x29')],qs['fields'](_0x59257c[_0x6ddb('0x2a')][_0x6ddb('0x2e')]));_0x2b19c9[_0x6ddb('0x2d')]=_0x2b19c9[_0x6ddb('0x2d')]['length']?_0x2b19c9['attributes']:_0x101a89[_0x6ddb('0x29')];if(_0x59257c[_0x6ddb('0x2a')][_0x6ddb('0x39')]){_0x2b19c9[_0x6ddb('0x3a')]=[{'all':!![]}];}_0x2b19c9=_[_0x6ddb('0x36')]({},_0x2b19c9,_0x59257c[_0x6ddb('0x37')]);return db[_0x6ddb('0x24')][_0x6ddb('0x3c')](_0x2b19c9)[_0x6ddb('0x38')](handleEntityNotFound(_0x3fa672,null))['then'](respondWithResult(_0x3fa672,null))[_0x6ddb('0x3d')](handleError(_0x3fa672,null));};exports[_0x6ddb('0x3e')]=function(_0x4442bb,_0x685bb0){return db[_0x6ddb('0x24')]['create'](_0x4442bb[_0x6ddb('0x3f')],{})['then'](respondWithResult(_0x685bb0,0xc9))[_0x6ddb('0x3d')](handleError(_0x685bb0,null));};exports[_0x6ddb('0x40')]=function(_0x1aa642,_0x111fd6){if(_0x1aa642['body']['id']){delete _0x1aa642[_0x6ddb('0x3f')]['id'];}return db[_0x6ddb('0x24')][_0x6ddb('0x3c')]({'where':{'id':_0x1aa642['params']['id']}})[_0x6ddb('0x38')](handleEntityNotFound(_0x111fd6,null))[_0x6ddb('0x38')](saveUpdates(_0x1aa642[_0x6ddb('0x3f')],null))[_0x6ddb('0x38')](respondWithResult(_0x111fd6,null))['catch'](handleError(_0x111fd6,null));};exports[_0x6ddb('0x1f')]=function(_0x557337,_0x5472bc){return db[_0x6ddb('0x24')]['find']({'where':{'id':_0x557337[_0x6ddb('0x41')]['id']}})[_0x6ddb('0x38')](handleEntityNotFound(_0x5472bc,null))['then'](removeEntity(_0x5472bc,null))['catch'](handleError(_0x5472bc,null));};exports[_0x6ddb('0x42')]=function(_0x36d591,_0x50f7d3){return db[_0x6ddb('0x24')][_0x6ddb('0x42')]()[_0x6ddb('0x38')](respondWithResult(_0x50f7d3,null))[_0x6ddb('0x3d')](handleError(_0x50f7d3,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b310e5c..c0654c9 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 _0xa780=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4a619d,_0x187915){var _0x3b7e33=function(_0x543a5d){while(--_0x543a5d){_0x4a619d['push'](_0x4a619d['shift']());}};_0x3b7e33(++_0x187915);}(_0xa780,0x103));var _0x0a78=function(_0x30a8b8,_0x1643a4){_0x30a8b8=_0x30a8b8-0x0;var _0x2f5a12=_0xa780[_0x30a8b8];return _0x2f5a12;};'use strict';var EventEmitter=require(_0x0a78('0x0'));var MailSubstatus=require(_0x0a78('0x1'))['db'][_0x0a78('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0a78('0x3')](0x0);var events={'afterUpdate':_0x0a78('0x4')};function emitEvent(_0x500c69){return function(_0x16a9e5,_0x3d4bdf,_0x2d77a8){MailSubstatusEvents[_0x0a78('0x5')](_0x500c69+':'+_0x16a9e5['id'],_0x16a9e5);MailSubstatusEvents['emit'](_0x500c69,_0x16a9e5);_0x2d77a8(null);};}for(var e in events){if(events[_0x0a78('0x6')](e)){var event=events[e];MailSubstatus[_0x0a78('0x7')](e,emitEvent(event));}}module[_0x0a78('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x92da=['update','emit','hasOwnProperty','hook','MailSubstatus','setMaxListeners'];(function(_0x23aa86,_0x5bb797){var _0x42b51b=function(_0x258b8){while(--_0x258b8){_0x23aa86['push'](_0x23aa86['shift']());}};_0x42b51b(++_0x5bb797);}(_0x92da,0x1a2));var _0xa92d=function(_0x5497a7,_0x4ac7ec){_0x5497a7=_0x5497a7-0x0;var _0x32fbfc=_0x92da[_0x5497a7];return _0x32fbfc;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0xa92d('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa92d('0x1')](0x0);var events={'afterUpdate':_0xa92d('0x2')};function emitEvent(_0x215780){return function(_0x216e2c,_0x5bc967,_0x5eae0c){MailSubstatusEvents[_0xa92d('0x3')](_0x215780+':'+_0x216e2c['id'],_0x216e2c);MailSubstatusEvents[_0xa92d('0x3')](_0x215780,_0x216e2c);_0x5eae0c(null);};}for(var e in events){if(events[_0xa92d('0x4')](e)){var event=events[e];MailSubstatus[_0xa92d('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ce85310..3cbc935 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 _0xf2d8=['Condition','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses'];(function(_0x4b64d0,_0x56f303){var _0x259889=function(_0x56a611){while(--_0x56a611){_0x4b64d0['push'](_0x4b64d0['shift']());}};_0x259889(++_0x56f303);}(_0xf2d8,0x103));var _0x8f2d=function(_0x43b4b5,_0x3efc1b){_0x43b4b5=_0x43b4b5-0x0;var _0x2df432=_0xf2d8[_0x43b4b5];return _0x2df432;};'use strict';var attributes=require(_0x8f2d('0x0'));module[_0x8f2d('0x1')]=function(_0x4cca39){var _0x2b526e=_0x4cca39['models'];return _0x4cca39[_0x8f2d('0x2')](_0x8f2d('0x3'),attributes,{'tableName':_0x8f2d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3a483c,_0x1aeb09,_0x45b068){return _0x2b526e[_0x8f2d('0x5')]['update']({'value':_0x3a483c[_0x8f2d('0x6')]},{'where':{'field':_0x8f2d('0x7'),'value':_0x3a483c[_0x8f2d('0x8')][_0x8f2d('0x6')]}})[_0x8f2d('0x9')](function(){_0x45b068();})[_0x8f2d('0xa')](function(_0x22229a){_0x45b068(_0x22229a);});}}});}; \ No newline at end of file +var _0x8ba6=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','models','define'];(function(_0xa99e3f,_0x1333a5){var _0x3ad28e=function(_0x125dc7){while(--_0x125dc7){_0xa99e3f['push'](_0xa99e3f['shift']());}};_0x3ad28e(++_0x1333a5);}(_0x8ba6,0x11b));var _0x68ba=function(_0x1e6102,_0x17e088){_0x1e6102=_0x1e6102-0x0;var _0x130795=_0x8ba6[_0x1e6102];return _0x130795;};'use strict';var attributes=require(_0x68ba('0x0'));module['exports']=function(_0x2a5412){var _0x5e38b8=_0x2a5412[_0x68ba('0x1')];return _0x2a5412[_0x68ba('0x2')](_0x68ba('0x3'),attributes,{'tableName':_0x68ba('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x59c60c,_0x4a5138,_0x77a639){return _0x5e38b8[_0x68ba('0x5')][_0x68ba('0x6')]({'value':_0x59c60c[_0x68ba('0x7')]},{'where':{'field':_0x68ba('0x8'),'value':_0x59c60c[_0x68ba('0x9')][_0x68ba('0x7')]}})[_0x68ba('0xa')](function(){_0x77a639();})['catch'](function(_0x33891a){_0x77a639(_0x33891a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6960284..86e2469 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 _0xbfef=['moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x1db745,_0x1fac9c){var _0x3cb66b=function(_0x222a57){while(--_0x222a57){_0x1db745['push'](_0x1db745['shift']());}};_0x3cb66b(++_0x1fac9c);}(_0xbfef,0x18e));var _0xfbfe=function(_0x6c937b,_0x43a4be){_0x6c937b=_0x6c937b-0x0;var _0x5ac49e=_0xbfef[_0x6c937b];return _0x5ac49e;};'use strict';var _=require(_0xfbfe('0x0'));var util=require(_0xfbfe('0x1'));var moment=require(_0xfbfe('0x2'));var BPromise=require(_0xfbfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfbfe('0x5'))(_0xfbfe('0x6'));var config=require('../../config/environment');var jayson=require(_0xfbfe('0x7'));var client=jayson[_0xfbfe('0x8')][_0xfbfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2caaef,_0x5a8489,_0x3a17a6){return new BPromise(function(_0x3c48a4,_0x575137){return client[_0xfbfe('0xa')](_0x2caaef,_0x3a17a6)['then'](function(_0x205eb1){logger[_0xfbfe('0xb')](_0xfbfe('0xc'),_0x5a8489,_0xfbfe('0xd'));logger[_0xfbfe('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5a8489,_0xfbfe('0xd'),JSON[_0xfbfe('0xf')](_0x205eb1));if(_0x205eb1[_0xfbfe('0x10')]){if(_0x205eb1[_0xfbfe('0x10')]['code']===0x1f4){logger[_0xfbfe('0x10')](_0xfbfe('0xc'),_0x5a8489,_0x205eb1['error'][_0xfbfe('0x11')]);return _0x575137(_0x205eb1['error']['message']);}logger[_0xfbfe('0x10')](_0xfbfe('0xc'),_0x5a8489,_0x205eb1[_0xfbfe('0x10')]['message']);return _0x3c48a4(_0x205eb1['error'][_0xfbfe('0x11')]);}else{logger[_0xfbfe('0xb')](_0xfbfe('0xc'),_0x5a8489,'request\x20sent');_0x3c48a4(_0x205eb1[_0xfbfe('0x12')][_0xfbfe('0x11')]);}})[_0xfbfe('0x13')](function(_0x26cba4){logger[_0xfbfe('0x10')](_0xfbfe('0xc'),_0x5a8489,_0x26cba4);_0x575137(_0x26cba4);});});} \ No newline at end of file +var _0xcc70=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring'];(function(_0x1a469d,_0x432568){var _0x238a10=function(_0x3f299f){while(--_0x3f299f){_0x1a469d['push'](_0x1a469d['shift']());}};_0x238a10(++_0x432568);}(_0xcc70,0xf4));var _0x0cc7=function(_0x2ab3c5,_0x35a3ef){_0x2ab3c5=_0x2ab3c5-0x0;var _0x2733aa=_0xcc70[_0x2ab3c5];return _0x2733aa;};'use strict';var _=require(_0x0cc7('0x0'));var util=require(_0x0cc7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0cc7('0x2'));var fs=require('fs');var Redis=require(_0x0cc7('0x3'));var db=require(_0x0cc7('0x4'))['db'];var utils=require(_0x0cc7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0cc7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0cc7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x546fac,_0x5e7dbc,_0x3084d3){return new BPromise(function(_0x3e3cd0,_0x192c4e){return client[_0x0cc7('0x8')](_0x546fac,_0x3084d3)[_0x0cc7('0x9')](function(_0x5cb755){logger[_0x0cc7('0xa')](_0x0cc7('0xb'),_0x5e7dbc,_0x0cc7('0xc'));logger[_0x0cc7('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5e7dbc,_0x0cc7('0xc'),JSON[_0x0cc7('0xe')](_0x5cb755));if(_0x5cb755['error']){if(_0x5cb755[_0x0cc7('0xf')]['code']===0x1f4){logger['error'](_0x0cc7('0xb'),_0x5e7dbc,_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);return _0x192c4e(_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);}logger['error'](_0x0cc7('0xb'),_0x5e7dbc,_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);return _0x3e3cd0(_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);}else{logger[_0x0cc7('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x5e7dbc,'request\x20sent');_0x3e3cd0(_0x5cb755[_0x0cc7('0x11')][_0x0cc7('0x10')]);}})[_0x0cc7('0x12')](function(_0x28df3){logger['error'](_0x0cc7('0xb'),_0x5e7dbc,_0x28df3);_0x192c4e(_0x28df3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 75d5cc9..3d6608f 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 _0x5d16=['update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','describe','/:id','isAuthenticated','show','post','put'];(function(_0x195dc4,_0x23a16c){var _0x56cbe1=function(_0x33cbd6){while(--_0x33cbd6){_0x195dc4['push'](_0x195dc4['shift']());}};_0x56cbe1(++_0x23a16c);}(_0x5d16,0xa4));var _0x65d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d16[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x65d1('0x0'));var util=require(_0x65d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65d1('0x2'));var router=express[_0x65d1('0x3')]();var fs_extra=require(_0x65d1('0x4'));var auth=require(_0x65d1('0x5'));var interaction=require(_0x65d1('0x6'));var config=require(_0x65d1('0x7'));var controller=require(_0x65d1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x65d1('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x65d1('0xa')]);router['get'](_0x65d1('0xb'),auth[_0x65d1('0xc')](),controller[_0x65d1('0xd')]);router[_0x65d1('0xe')]('/',auth[_0x65d1('0xc')](),controller['create']);router[_0x65d1('0xf')](_0x65d1('0xb'),auth[_0x65d1('0xc')](),controller[_0x65d1('0x10')]);router[_0x65d1('0x11')]('/:id',auth[_0x65d1('0xc')](),controller[_0x65d1('0x12')]);module[_0x65d1('0x13')]=router; \ No newline at end of file +var _0xfea6=['update','delete','/:id','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','show','post','put'];(function(_0x471b98,_0x215d50){var _0x9492c0=function(_0x4212ca){while(--_0x4212ca){_0x471b98['push'](_0x471b98['shift']());}};_0x9492c0(++_0x215d50);}(_0xfea6,0x16d));var _0x6fea=function(_0x436567,_0x438fc5){_0x436567=_0x436567-0x0;var _0x5e9ed8=_0xfea6[_0x436567];return _0x5e9ed8;};'use strict';var multer=require(_0x6fea('0x0'));var util=require('util');var path=require(_0x6fea('0x1'));var timeout=require(_0x6fea('0x2'));var express=require('express');var router=express[_0x6fea('0x3')]();var fs_extra=require(_0x6fea('0x4'));var auth=require(_0x6fea('0x5'));var interaction=require(_0x6fea('0x6'));var config=require(_0x6fea('0x7'));var controller=require(_0x6fea('0x8'));router['get']('/',auth[_0x6fea('0x9')](),controller[_0x6fea('0xa')]);router[_0x6fea('0xb')]('/describe',auth[_0x6fea('0x9')](),controller['describe']);router[_0x6fea('0xb')]('/:id',auth[_0x6fea('0x9')](),controller[_0x6fea('0xc')]);router[_0x6fea('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6fea('0xe')]('/:id',auth[_0x6fea('0x9')](),controller[_0x6fea('0xf')]);router[_0x6fea('0x10')](_0x6fea('0x11'),auth[_0x6fea('0x9')](),controller[_0x6fea('0x12')]);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 86c7a4a..3ab2bd4 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x48bc96,_0x55b9a7){_0x48bc96=_0x48bc96-0x0;var _0x98a30=_0x9bde[_0x48bc96];return _0x98a30;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x121b35,_0x2c5a59){var _0xf5a124=function(_0x4d8216){while(--_0x4d8216){_0x121b35['push'](_0x121b35['shift']());}};_0xf5a124(++_0x2c5a59);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d37bc,_0x36ec1b){_0x5d37bc=_0x5d37bc-0x0;var _0x56d32f=_0xedd9[_0x5d37bc];return _0x56d32f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 28c9677..8486024 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 _0xf423=['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/license/util','status','end','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','MailTransferReport','include','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xf423,0xde));var _0x3f42=function(_0x3ca52c,_0x8420f){_0x3ca52c=_0x3ca52c-0x0;var _0x2fb640=_0xf423[_0x3ca52c];return _0x2fb640;};'use strict';var emlformat=require(_0x3f42('0x0'));var rimraf=require(_0x3f42('0x1'));var zipdir=require(_0x3f42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f42('0x3'));var moment=require('moment');var BPromise=require(_0x3f42('0x4'));var Mustache=require(_0x3f42('0x5'));var util=require(_0x3f42('0x6'));var path=require(_0x3f42('0x7'));var sox=require(_0x3f42('0x8'));var csv=require('to-csv');var ejs=require(_0x3f42('0x9'));var fs=require('fs');var fs_extra=require(_0x3f42('0xa'));var _=require(_0x3f42('0xb'));var squel=require(_0x3f42('0xc'));var crypto=require(_0x3f42('0xd'));var jsforce=require(_0x3f42('0xe'));var deskjs=require(_0x3f42('0xf'));var toCsv=require(_0x3f42('0x10'));var querystring=require(_0x3f42('0x11'));var Papa=require(_0x3f42('0x12'));var Redis=require(_0x3f42('0x13'));var authService=require(_0x3f42('0x14'));var qs=require(_0x3f42('0x15'));var as=require(_0x3f42('0x16'));var hardwareService=require(_0x3f42('0x17'));var logger=require(_0x3f42('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f42('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cecf2,_0x12a1df){_0x12a1df=_0x12a1df||0xcc;return function(_0x2b1bf2){if(_0x2b1bf2){return _0x3cecf2['sendStatus'](_0x12a1df);}return _0x3cecf2[_0x3f42('0x1a')](_0x12a1df)[_0x3f42('0x1b')]();};}function respondWithResult(_0x551f88,_0x54851a){_0x54851a=_0x54851a||0xc8;return function(_0x244c5f){if(_0x244c5f){return _0x551f88[_0x3f42('0x1a')](_0x54851a)['json'](_0x244c5f);}};}function respondWithFilteredResult(_0x4f6866,_0x2aed23){return function(_0xdcb9c1){if(_0xdcb9c1){var _0x2a4360=typeof _0x2aed23[_0x3f42('0x1c')]===_0x3f42('0x1d')&&typeof _0x2aed23[_0x3f42('0x1e')]==='undefined';var _0xbc1d84=_0xdcb9c1['count'];var _0x564140=_0x2a4360?0x0:_0x2aed23[_0x3f42('0x1c')];var _0x16ef8b=_0x2a4360?_0xdcb9c1[_0x3f42('0x1f')]:_0x2aed23[_0x3f42('0x1c')]+_0x2aed23['limit'];var _0x248f5a;if(_0x16ef8b>=_0xbc1d84){_0x16ef8b=_0xbc1d84;_0x248f5a=0xc8;}else{_0x248f5a=0xce;}_0x4f6866[_0x3f42('0x1a')](_0x248f5a);return _0x4f6866[_0x3f42('0x20')]('Content-Range',_0x564140+'-'+_0x16ef8b+'/'+_0xbc1d84)['json'](_0xdcb9c1);}return null;};}function patchUpdates(_0x28fd1c){return function(_0x2ae210){try{jsonpatch['apply'](_0x2ae210,_0x28fd1c,!![]);}catch(_0x5a98c2){return BPromise[_0x3f42('0x21')](_0x5a98c2);}return _0x2ae210[_0x3f42('0x22')]();};}function saveUpdates(_0x2d360c,_0x5e7b4e){return function(_0x245f10){if(_0x245f10){return _0x245f10[_0x3f42('0x23')](_0x2d360c)['then'](function(_0x283359){return _0x283359;});}return null;};}function removeEntity(_0x3d318c,_0x55faf5){return function(_0x59ffad){if(_0x59ffad){return _0x59ffad[_0x3f42('0x24')]()[_0x3f42('0x25')](function(){_0x3d318c[_0x3f42('0x1a')](0xcc)[_0x3f42('0x1b')]();});}};}function handleEntityNotFound(_0x3b36b8,_0x334d35){return function(_0x43d6dc){if(!_0x43d6dc){_0x3b36b8[_0x3f42('0x26')](0x194);}return _0x43d6dc;};}function handleError(_0x624baf,_0x26dafd){_0x26dafd=_0x26dafd||0x1f4;return function(_0x2258bc){logger['error'](_0x2258bc[_0x3f42('0x27')]);if(_0x2258bc[_0x3f42('0x28')]){delete _0x2258bc[_0x3f42('0x28')];}_0x624baf[_0x3f42('0x1a')](_0x26dafd)[_0x3f42('0x29')](_0x2258bc);};}exports[_0x3f42('0x2a')]=function(_0x3cf9f6,_0x3c68eb){var _0xe0e433={},_0x20e039={},_0x4a0514={'count':0x0,'rows':[]};var _0x34482a=_[_0x3f42('0x2b')](db['MailTransferReport'][_0x3f42('0x2c')],function(_0x202f82){return{'name':_0x202f82[_0x3f42('0x2d')],'type':_0x202f82[_0x3f42('0x2e')][_0x3f42('0x2f')]};});_0x20e039['model']=_[_0x3f42('0x2b')](_0x34482a,_0x3f42('0x28'));_0x20e039['query']=_[_0x3f42('0x30')](_0x3cf9f6[_0x3f42('0x31')]);_0x20e039[_0x3f42('0x32')]=_['intersection'](_0x20e039[_0x3f42('0x33')],_0x20e039[_0x3f42('0x31')]);_0xe0e433[_0x3f42('0x34')]=_[_0x3f42('0x35')](_0x20e039[_0x3f42('0x33')],qs[_0x3f42('0x36')](_0x3cf9f6[_0x3f42('0x31')][_0x3f42('0x36')]));_0xe0e433[_0x3f42('0x34')]=_0xe0e433['attributes'][_0x3f42('0x37')]?_0xe0e433['attributes']:_0x20e039[_0x3f42('0x33')];if(!_0x3cf9f6['query'][_0x3f42('0x38')]('nolimit')){_0xe0e433[_0x3f42('0x1e')]=qs[_0x3f42('0x1e')](_0x3cf9f6[_0x3f42('0x31')][_0x3f42('0x1e')]);_0xe0e433[_0x3f42('0x1c')]=qs[_0x3f42('0x1c')](_0x3cf9f6[_0x3f42('0x31')]['offset']);}_0xe0e433[_0x3f42('0x39')]=qs[_0x3f42('0x3a')](_0x3cf9f6[_0x3f42('0x31')][_0x3f42('0x3a')]);_0xe0e433[_0x3f42('0x3b')]=qs[_0x3f42('0x32')](_[_0x3f42('0x3c')](_0x3cf9f6[_0x3f42('0x31')],_0x20e039[_0x3f42('0x32')]),_0x34482a);if(_0x3cf9f6['query'][_0x3f42('0x3d')]){_0xe0e433[_0x3f42('0x3b')]=_[_0x3f42('0x3e')](_0xe0e433[_0x3f42('0x3b')],{'$or':_[_0x3f42('0x2b')](_0x34482a,function(_0x5c8156){if(_0x5c8156[_0x3f42('0x2e')]!=='VIRTUAL'){var _0x332c71={};_0x332c71[_0x5c8156[_0x3f42('0x28')]]={'$like':'%'+_0x3cf9f6[_0x3f42('0x31')][_0x3f42('0x3d')]+'%'};return _0x332c71;}})});}_0xe0e433=_[_0x3f42('0x3e')]({},_0xe0e433,_0x3cf9f6[_0x3f42('0x3f')]);var _0x1bac20={'where':_0xe0e433[_0x3f42('0x3b')]};return db['MailTransferReport'][_0x3f42('0x1f')](_0x1bac20)[_0x3f42('0x25')](function(_0x5a5f76){_0x4a0514['count']=_0x5a5f76;if(_0x3cf9f6[_0x3f42('0x31')][_0x3f42('0x40')]){_0xe0e433['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x3f42('0x41')](_0xe0e433);})[_0x3f42('0x25')](function(_0xe5f9c4){_0x4a0514[_0x3f42('0x42')]=_0xe5f9c4;return _0x4a0514;})[_0x3f42('0x25')](respondWithFilteredResult(_0x3c68eb,_0xe0e433))[_0x3f42('0x43')](handleError(_0x3c68eb,null));};exports[_0x3f42('0x44')]=function(_0x8bea70,_0x3a6b21){var _0x10cfc8={'raw':!![],'where':{'id':_0x8bea70[_0x3f42('0x45')]['id']}},_0x4ac1d5={};_0x4ac1d5[_0x3f42('0x33')]=_['keys'](db[_0x3f42('0x46')][_0x3f42('0x2c')]);_0x4ac1d5[_0x3f42('0x31')]=_[_0x3f42('0x30')](_0x8bea70['query']);_0x4ac1d5['filters']=_[_0x3f42('0x35')](_0x4ac1d5[_0x3f42('0x33')],_0x4ac1d5[_0x3f42('0x31')]);_0x10cfc8[_0x3f42('0x34')]=_['intersection'](_0x4ac1d5[_0x3f42('0x33')],qs[_0x3f42('0x36')](_0x8bea70[_0x3f42('0x31')][_0x3f42('0x36')]));_0x10cfc8[_0x3f42('0x34')]=_0x10cfc8[_0x3f42('0x34')][_0x3f42('0x37')]?_0x10cfc8[_0x3f42('0x34')]:_0x4ac1d5[_0x3f42('0x33')];if(_0x8bea70[_0x3f42('0x31')]['includeAll']){_0x10cfc8[_0x3f42('0x47')]=[{'all':!![]}];}_0x10cfc8=_[_0x3f42('0x3e')]({},_0x10cfc8,_0x8bea70[_0x3f42('0x3f')]);return db[_0x3f42('0x46')]['find'](_0x10cfc8)[_0x3f42('0x25')](handleEntityNotFound(_0x3a6b21,null))[_0x3f42('0x25')](respondWithResult(_0x3a6b21,null))[_0x3f42('0x43')](handleError(_0x3a6b21,null));};exports['create']=function(_0x1b583b,_0x16bc6c){return db['MailTransferReport'][_0x3f42('0x48')](_0x1b583b[_0x3f42('0x49')],{})[_0x3f42('0x25')](respondWithResult(_0x16bc6c,0xc9))[_0x3f42('0x43')](handleError(_0x16bc6c,null));};exports['update']=function(_0x234be1,_0xf48dc7){if(_0x234be1[_0x3f42('0x49')]['id']){delete _0x234be1['body']['id'];}return db[_0x3f42('0x46')]['find']({'where':{'id':_0x234be1[_0x3f42('0x45')]['id']}})[_0x3f42('0x25')](handleEntityNotFound(_0xf48dc7,null))['then'](saveUpdates(_0x234be1[_0x3f42('0x49')],null))[_0x3f42('0x25')](respondWithResult(_0xf48dc7,null))['catch'](handleError(_0xf48dc7,null));};exports[_0x3f42('0x24')]=function(_0x58440b,_0x459fd4){return db[_0x3f42('0x46')][_0x3f42('0x4a')]({'where':{'id':_0x58440b[_0x3f42('0x45')]['id']}})['then'](handleEntityNotFound(_0x459fd4,null))[_0x3f42('0x25')](removeEntity(_0x459fd4,null))['catch'](handleError(_0x459fd4,null));};exports['describe']=function(_0x1bc6f0,_0x3f1245){return db[_0x3f42('0x46')][_0x3f42('0x4b')]()[_0x3f42('0x25')](respondWithResult(_0x3f1245,null))[_0x3f42('0x43')](handleError(_0x3f1245,null));}; \ No newline at end of file +var _0x82f3=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','options','then','includeAll','include','MailTransferReport','findAll','rows','catch','show','merge','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1b4052,_0x38e4e1){var _0x2518bb=function(_0x222c3b){while(--_0x222c3b){_0x1b4052['push'](_0x1b4052['shift']());}};_0x2518bb(++_0x38e4e1);}(_0x82f3,0x8c));var _0x382f=function(_0x3860c4,_0xcc2eba){_0x3860c4=_0x3860c4-0x0;var _0x494033=_0x82f3[_0x3860c4];return _0x494033;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x382f('0x0'));var zipdir=require(_0x382f('0x1'));var jsonpatch=require(_0x382f('0x2'));var rp=require(_0x382f('0x3'));var moment=require(_0x382f('0x4'));var BPromise=require(_0x382f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x382f('0x6'));var sox=require('sox');var csv=require(_0x382f('0x7'));var ejs=require(_0x382f('0x8'));var fs=require('fs');var fs_extra=require(_0x382f('0x9'));var _=require(_0x382f('0xa'));var squel=require(_0x382f('0xb'));var crypto=require('crypto');var jsforce=require(_0x382f('0xc'));var deskjs=require(_0x382f('0xd'));var toCsv=require(_0x382f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x382f('0xe'));var authService=require(_0x382f('0xf'));var qs=require(_0x382f('0x10'));var as=require(_0x382f('0x11'));var hardwareService=require(_0x382f('0x12'));var logger=require(_0x382f('0x13'))(_0x382f('0x14'));var utils=require('../../config/utils');var config=require(_0x382f('0x15'));var licenseUtil=require(_0x382f('0x16'));var db=require(_0x382f('0x17'))['db'];function respondWithStatusCode(_0xf9583b,_0x36854b){_0x36854b=_0x36854b||0xcc;return function(_0xedc78){if(_0xedc78){return _0xf9583b[_0x382f('0x18')](_0x36854b);}return _0xf9583b[_0x382f('0x19')](_0x36854b)[_0x382f('0x1a')]();};}function respondWithResult(_0x29a32a,_0x408caa){_0x408caa=_0x408caa||0xc8;return function(_0x2ff58){if(_0x2ff58){return _0x29a32a[_0x382f('0x19')](_0x408caa)[_0x382f('0x1b')](_0x2ff58);}};}function respondWithFilteredResult(_0x1b98e7,_0x34f770){return function(_0x355169){if(_0x355169){var _0x4cdbee=typeof _0x34f770[_0x382f('0x1c')]==='undefined'&&typeof _0x34f770[_0x382f('0x1d')]===_0x382f('0x1e');var _0x43a562=_0x355169[_0x382f('0x1f')];var _0x41670c=_0x4cdbee?0x0:_0x34f770[_0x382f('0x1c')];var _0x3315a7=_0x4cdbee?_0x355169[_0x382f('0x1f')]:_0x34f770[_0x382f('0x1c')]+_0x34f770['limit'];var _0x418a83;if(_0x3315a7>=_0x43a562){_0x3315a7=_0x43a562;_0x418a83=0xc8;}else{_0x418a83=0xce;}_0x1b98e7[_0x382f('0x19')](_0x418a83);return _0x1b98e7[_0x382f('0x20')](_0x382f('0x21'),_0x41670c+'-'+_0x3315a7+'/'+_0x43a562)[_0x382f('0x1b')](_0x355169);}return null;};}function patchUpdates(_0x3cb1fe){return function(_0x4f6bd5){try{jsonpatch[_0x382f('0x22')](_0x4f6bd5,_0x3cb1fe,!![]);}catch(_0x358064){return BPromise['reject'](_0x358064);}return _0x4f6bd5[_0x382f('0x23')]();};}function saveUpdates(_0x24eaf9,_0x3c9d86){return function(_0x103d47){if(_0x103d47){return _0x103d47[_0x382f('0x24')](_0x24eaf9)['then'](function(_0x2e0f1e){return _0x2e0f1e;});}return null;};}function removeEntity(_0x3fa696,_0x3c8fc9){return function(_0x36bc61){if(_0x36bc61){return _0x36bc61[_0x382f('0x25')]()['then'](function(){_0x3fa696[_0x382f('0x19')](0xcc)[_0x382f('0x1a')]();});}};}function handleEntityNotFound(_0x210faf,_0x375ddd){return function(_0x8d07){if(!_0x8d07){_0x210faf['sendStatus'](0x194);}return _0x8d07;};}function handleError(_0xa96527,_0x1add65){_0x1add65=_0x1add65||0x1f4;return function(_0x1e2a79){logger[_0x382f('0x26')](_0x1e2a79[_0x382f('0x27')]);if(_0x1e2a79['name']){delete _0x1e2a79[_0x382f('0x28')];}_0xa96527[_0x382f('0x19')](_0x1add65)[_0x382f('0x29')](_0x1e2a79);};}exports[_0x382f('0x2a')]=function(_0x319213,_0xf1dcff){var _0x4c0899={},_0x3d5cc4={},_0x3f7a6f={'count':0x0,'rows':[]};var _0x3a550d=_[_0x382f('0x2b')](db['MailTransferReport']['rawAttributes'],function(_0x33996c){return{'name':_0x33996c[_0x382f('0x2c')],'type':_0x33996c[_0x382f('0x2d')]['key']};});_0x3d5cc4[_0x382f('0x2e')]=_[_0x382f('0x2b')](_0x3a550d,_0x382f('0x28'));_0x3d5cc4[_0x382f('0x2f')]=_[_0x382f('0x30')](_0x319213[_0x382f('0x2f')]);_0x3d5cc4['filters']=_['intersection'](_0x3d5cc4[_0x382f('0x2e')],_0x3d5cc4['query']);_0x4c0899['attributes']=_[_0x382f('0x31')](_0x3d5cc4[_0x382f('0x2e')],qs[_0x382f('0x32')](_0x319213[_0x382f('0x2f')][_0x382f('0x32')]));_0x4c0899['attributes']=_0x4c0899[_0x382f('0x33')][_0x382f('0x34')]?_0x4c0899[_0x382f('0x33')]:_0x3d5cc4[_0x382f('0x2e')];if(!_0x319213[_0x382f('0x2f')]['hasOwnProperty'](_0x382f('0x35'))){_0x4c0899[_0x382f('0x1d')]=qs[_0x382f('0x1d')](_0x319213[_0x382f('0x2f')][_0x382f('0x1d')]);_0x4c0899[_0x382f('0x1c')]=qs[_0x382f('0x1c')](_0x319213[_0x382f('0x2f')][_0x382f('0x1c')]);}_0x4c0899[_0x382f('0x36')]=qs[_0x382f('0x37')](_0x319213[_0x382f('0x2f')][_0x382f('0x37')]);_0x4c0899['where']=qs[_0x382f('0x38')](_[_0x382f('0x39')](_0x319213[_0x382f('0x2f')],_0x3d5cc4[_0x382f('0x38')]),_0x3a550d);if(_0x319213[_0x382f('0x2f')]['filter']){_0x4c0899['where']=_['merge'](_0x4c0899[_0x382f('0x3a')],{'$or':_[_0x382f('0x2b')](_0x3a550d,function(_0x26925c){if(_0x26925c[_0x382f('0x2d')]!==_0x382f('0x3b')){var _0x5d5912={};_0x5d5912[_0x26925c[_0x382f('0x28')]]={'$like':'%'+_0x319213['query'][_0x382f('0x3c')]+'%'};return _0x5d5912;}})});}_0x4c0899=_['merge']({},_0x4c0899,_0x319213[_0x382f('0x3d')]);var _0x4ea256={'where':_0x4c0899[_0x382f('0x3a')]};return db['MailTransferReport'][_0x382f('0x1f')](_0x4ea256)[_0x382f('0x3e')](function(_0x487fe7){_0x3f7a6f[_0x382f('0x1f')]=_0x487fe7;if(_0x319213[_0x382f('0x2f')][_0x382f('0x3f')]){_0x4c0899[_0x382f('0x40')]=[{'all':!![]}];}return db[_0x382f('0x41')][_0x382f('0x42')](_0x4c0899);})['then'](function(_0xcbc9f6){_0x3f7a6f[_0x382f('0x43')]=_0xcbc9f6;return _0x3f7a6f;})['then'](respondWithFilteredResult(_0xf1dcff,_0x4c0899))[_0x382f('0x44')](handleError(_0xf1dcff,null));};exports[_0x382f('0x45')]=function(_0x556205,_0x5a47ef){var _0x2ca2c1={'raw':!![],'where':{'id':_0x556205['params']['id']}},_0x1b1b1d={};_0x1b1b1d['model']=_[_0x382f('0x30')](db['MailTransferReport']['rawAttributes']);_0x1b1b1d[_0x382f('0x2f')]=_[_0x382f('0x30')](_0x556205[_0x382f('0x2f')]);_0x1b1b1d['filters']=_['intersection'](_0x1b1b1d[_0x382f('0x2e')],_0x1b1b1d[_0x382f('0x2f')]);_0x2ca2c1[_0x382f('0x33')]=_[_0x382f('0x31')](_0x1b1b1d['model'],qs[_0x382f('0x32')](_0x556205[_0x382f('0x2f')]['fields']));_0x2ca2c1[_0x382f('0x33')]=_0x2ca2c1[_0x382f('0x33')]['length']?_0x2ca2c1[_0x382f('0x33')]:_0x1b1b1d['model'];if(_0x556205[_0x382f('0x2f')]['includeAll']){_0x2ca2c1[_0x382f('0x40')]=[{'all':!![]}];}_0x2ca2c1=_[_0x382f('0x46')]({},_0x2ca2c1,_0x556205[_0x382f('0x3d')]);return db['MailTransferReport'][_0x382f('0x47')](_0x2ca2c1)[_0x382f('0x3e')](handleEntityNotFound(_0x5a47ef,null))['then'](respondWithResult(_0x5a47ef,null))[_0x382f('0x44')](handleError(_0x5a47ef,null));};exports[_0x382f('0x48')]=function(_0x19c01b,_0x13bc38){return db[_0x382f('0x41')][_0x382f('0x48')](_0x19c01b[_0x382f('0x49')],{})[_0x382f('0x3e')](respondWithResult(_0x13bc38,0xc9))[_0x382f('0x44')](handleError(_0x13bc38,null));};exports['update']=function(_0x1275b7,_0x185916){if(_0x1275b7[_0x382f('0x49')]['id']){delete _0x1275b7[_0x382f('0x49')]['id'];}return db['MailTransferReport'][_0x382f('0x47')]({'where':{'id':_0x1275b7['params']['id']}})[_0x382f('0x3e')](handleEntityNotFound(_0x185916,null))[_0x382f('0x3e')](saveUpdates(_0x1275b7['body'],null))[_0x382f('0x3e')](respondWithResult(_0x185916,null))[_0x382f('0x44')](handleError(_0x185916,null));};exports[_0x382f('0x25')]=function(_0x554760,_0x53d793){return db[_0x382f('0x41')][_0x382f('0x47')]({'where':{'id':_0x554760[_0x382f('0x4a')]['id']}})[_0x382f('0x3e')](handleEntityNotFound(_0x53d793,null))[_0x382f('0x3e')](removeEntity(_0x53d793,null))[_0x382f('0x44')](handleError(_0x53d793,null));};exports[_0x382f('0x4b')]=function(_0x22cb7e,_0x731178){return db['MailTransferReport'][_0x382f('0x4b')]()[_0x382f('0x3e')](respondWithResult(_0x731178,null))[_0x382f('0x44')](handleError(_0x731178,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 9789026..0f58856 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 _0xed1f=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xed1f,0x6a));var _0xfed1=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xed1f[_0x307d86];return _0x361745;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[{'name':_0xfed1('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d01=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer'];(function(_0xb26065,_0x36df08){var _0x974dce=function(_0x1b5ace){while(--_0x1b5ace){_0xb26065['push'](_0xb26065['shift']());}};_0x974dce(++_0x36df08);}(_0x5d01,0xe5));var _0x15d0=function(_0x33c9d8,_0x123ea0){_0x33c9d8=_0x33c9d8-0x0;var _0x111e52=_0x5d01[_0x33c9d8];return _0x111e52;};'use strict';var _=require(_0x15d0('0x0'));var util=require('util');var logger=require(_0x15d0('0x1'))(_0x15d0('0x2'));var moment=require('moment');var BPromise=require(_0x15d0('0x3'));var rp=require(_0x15d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15d0('0x5'));var attributes=require(_0x15d0('0x6'));module[_0x15d0('0x7')]=function(_0x1b0e27,_0x2af55d){return _0x1b0e27[_0x15d0('0x8')](_0x15d0('0x9'),attributes,{'tableName':_0x15d0('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x15d0('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 c557ad0..166eacd 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 _0xbde2=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbde2,0x111));var _0x2bde=function(_0x12785f,_0x1eac07){_0x12785f=_0x12785f-0x0;var _0x170c47=_0xbde2[_0x12785f];return _0x170c47;};'use strict';var _=require(_0x2bde('0x0'));var util=require(_0x2bde('0x1'));var moment=require(_0x2bde('0x2'));var BPromise=require(_0x2bde('0x3'));var rs=require(_0x2bde('0x4'));var fs=require('fs');var Redis=require(_0x2bde('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bde('0x6'));var logger=require(_0x2bde('0x7'))(_0x2bde('0x8'));var config=require(_0x2bde('0x9'));var jayson=require(_0x2bde('0xa'));var client=jayson[_0x2bde('0xb')][_0x2bde('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3967d7,_0x511257,_0x44def4){return new BPromise(function(_0xd149bc,_0xa55629){return client[_0x2bde('0xd')](_0x3967d7,_0x44def4)[_0x2bde('0xe')](function(_0x4f25ac){logger[_0x2bde('0xf')](_0x2bde('0x10'),_0x511257,'request\x20sent');logger['debug'](_0x2bde('0x11'),_0x511257,_0x2bde('0x12'),JSON[_0x2bde('0x13')](_0x4f25ac));if(_0x4f25ac[_0x2bde('0x14')]){if(_0x4f25ac[_0x2bde('0x14')][_0x2bde('0x15')]===0x1f4){logger[_0x2bde('0x14')](_0x2bde('0x10'),_0x511257,_0x4f25ac[_0x2bde('0x14')]['message']);return _0xa55629(_0x4f25ac[_0x2bde('0x14')][_0x2bde('0x16')]);}logger[_0x2bde('0x14')](_0x2bde('0x10'),_0x511257,_0x4f25ac[_0x2bde('0x14')]['message']);return _0xd149bc(_0x4f25ac[_0x2bde('0x14')]['message']);}else{logger['info'](_0x2bde('0x10'),_0x511257,'request\x20sent');_0xd149bc(_0x4f25ac[_0x2bde('0x17')]['message']);}})[_0x2bde('0x18')](function(_0x87eff3){logger[_0x2bde('0x14')](_0x2bde('0x10'),_0x511257,_0x87eff3);_0xa55629(_0x87eff3);});});} \ No newline at end of file +var _0x1b78=['stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5b6762,_0xebb101){var _0x34c15b=function(_0xb84ba7){while(--_0xb84ba7){_0x5b6762['push'](_0x5b6762['shift']());}};_0x34c15b(++_0xebb101);}(_0x1b78,0x164));var _0x81b7=function(_0x7e9670,_0x2cee61){_0x7e9670=_0x7e9670-0x0;var _0x1196d5=_0x1b78[_0x7e9670];return _0x1196d5;};'use strict';var _=require(_0x81b7('0x0'));var util=require(_0x81b7('0x1'));var moment=require(_0x81b7('0x2'));var BPromise=require(_0x81b7('0x3'));var rs=require(_0x81b7('0x4'));var fs=require('fs');var Redis=require(_0x81b7('0x5'));var db=require(_0x81b7('0x6'))['db'];var utils=require(_0x81b7('0x7'));var logger=require(_0x81b7('0x8'))(_0x81b7('0x9'));var config=require(_0x81b7('0xa'));var jayson=require(_0x81b7('0xb'));var client=jayson[_0x81b7('0xc')][_0x81b7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d24eb,_0x301350,_0x16ff35){return new BPromise(function(_0x10eb93,_0x4b95b0){return client[_0x81b7('0xe')](_0x4d24eb,_0x16ff35)[_0x81b7('0xf')](function(_0x26657d){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x301350,'request\x20sent');logger[_0x81b7('0x10')](_0x81b7('0x11'),_0x301350,_0x81b7('0x12'),JSON[_0x81b7('0x13')](_0x26657d));if(_0x26657d[_0x81b7('0x14')]){if(_0x26657d[_0x81b7('0x14')][_0x81b7('0x15')]===0x1f4){logger['error'](_0x81b7('0x16'),_0x301350,_0x26657d[_0x81b7('0x14')][_0x81b7('0x17')]);return _0x4b95b0(_0x26657d[_0x81b7('0x14')][_0x81b7('0x17')]);}logger[_0x81b7('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x301350,_0x26657d[_0x81b7('0x14')][_0x81b7('0x17')]);return _0x10eb93(_0x26657d['error'][_0x81b7('0x17')]);}else{logger['info'](_0x81b7('0x16'),_0x301350,'request\x20sent');_0x10eb93(_0x26657d[_0x81b7('0x18')][_0x81b7('0x17')]);}})['catch'](function(_0x10c76b){logger[_0x81b7('0x14')](_0x81b7('0x16'),_0x301350,_0x10c76b);_0x4b95b0(_0x10c76b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5dd4073..624775e 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 _0xf49f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xf49f,0x114));var _0xff49=function(_0x2d0642,_0x534ea3){_0x2d0642=_0x2d0642-0x0;var _0x4d5f93=_0xf49f[_0x2d0642];return _0x4d5f93;};'use strict';var multer=require(_0xff49('0x0'));var util=require(_0xff49('0x1'));var path=require(_0xff49('0x2'));var timeout=require(_0xff49('0x3'));var express=require(_0xff49('0x4'));var router=express[_0xff49('0x5')]();var fs_extra=require(_0xff49('0x6'));var auth=require(_0xff49('0x7'));var interaction=require(_0xff49('0x8'));var config=require(_0xff49('0x9'));var controller=require(_0xff49('0xa'));router[_0xff49('0xb')]('/',auth[_0xff49('0xc')](),controller[_0xff49('0xd')]);router[_0xff49('0xb')](_0xff49('0xe'),auth[_0xff49('0xc')](),controller[_0xff49('0xf')]);router[_0xff49('0xb')](_0xff49('0x10'),auth[_0xff49('0xc')](),controller[_0xff49('0x11')]);router[_0xff49('0x12')]('/',auth[_0xff49('0xc')](),controller[_0xff49('0x13')]);router[_0xff49('0x14')](_0xff49('0x10'),auth[_0xff49('0xc')](),controller['update']);router[_0xff49('0x15')](_0xff49('0x10'),auth[_0xff49('0xc')](),controller['destroy']);module[_0xff49('0x16')]=router; \ No newline at end of file +var _0x1662=['describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated'];(function(_0x5c16bf,_0x5d4465){var _0x22b6e3=function(_0x59bc68){while(--_0x59bc68){_0x5c16bf['push'](_0x5c16bf['shift']());}};_0x22b6e3(++_0x5d4465);}(_0x1662,0x1ec));var _0x2166=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1662[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x2166('0x0'));var path=require(_0x2166('0x1'));var timeout=require(_0x2166('0x2'));var express=require(_0x2166('0x3'));var router=express['Router']();var fs_extra=require(_0x2166('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2166('0x5'));var config=require(_0x2166('0x6'));var controller=require(_0x2166('0x7'));router[_0x2166('0x8')]('/',auth['isAuthenticated'](),controller[_0x2166('0x9')]);router[_0x2166('0x8')](_0x2166('0xa'),auth[_0x2166('0xb')](),controller[_0x2166('0xc')]);router[_0x2166('0x8')](_0x2166('0xd'),auth[_0x2166('0xb')](),controller['show']);router[_0x2166('0xe')]('/',auth['isAuthenticated'](),controller[_0x2166('0xf')]);router[_0x2166('0x10')](_0x2166('0xd'),auth['isAuthenticated'](),controller[_0x2166('0x11')]);router[_0x2166('0x12')](_0x2166('0xd'),auth[_0x2166('0xb')](),controller[_0x2166('0x13')]);module[_0x2166('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 9b18cfd..6847200 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 _0x8381=['talk:[start]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','exitAt','setDataValue','duration'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x8381,0x153));var _0x1838=function(_0xe9db76,_0x2937fb){_0xe9db76=_0xe9db76-0x0;var _0x4579ab=_0x8381[_0xe9db76];return _0x4579ab;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1838('0x0'));module['exports']={'channel':{'type':Sequelize[_0x1838('0x1')]},'membername':{'type':Sequelize[_0x1838('0x1')]},'interface':{'type':Sequelize[_0x1838('0x1')]},'type':{'type':Sequelize[_0x1838('0x1')],'defaultValue':_0x1838('0x2'),'comment':_0x1838('0x3')},'duration':{'type':Sequelize[_0x1838('0x4')]},'enterAt':{'type':Sequelize[_0x1838('0x5')]},'exitAt':{'type':Sequelize[_0x1838('0x5')],'set':function(_0x5a9c5e){var _0x3f02cc=moment(_0x5a9c5e);var _0x436298=moment(this[_0x1838('0x6')](_0x1838('0x7')));var _0x3c4470=_0x3f02cc['diff'](_0x436298,'seconds');this['setDataValue'](_0x1838('0x8'),_0x5a9c5e);this[_0x1838('0x9')](_0x1838('0xa'),_0x3c4470>=0x0?_0x3c4470:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x1838('0x1')],'comment':_0x1838('0xb')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x1838('0xc')},'data5':{'type':Sequelize[_0x1838('0x1')],'comment':_0x1838('0xd')},'role':{'type':Sequelize[_0x1838('0x1')]},'internal':{'type':Sequelize[_0x1838('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ca7=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING'];(function(_0x5add57,_0x50f735){var _0x1ed737=function(_0x45f175){while(--_0x45f175){_0x5add57['push'](_0x5add57['shift']());}};_0x1ed737(++_0x50f735);}(_0x8ca7,0xb1));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x78ca('0x0'));var moment=require('moment');module[_0x78ca('0x1')]={'channel':{'type':Sequelize[_0x78ca('0x2')]},'membername':{'type':Sequelize[_0x78ca('0x2')]},'interface':{'type':Sequelize[_0x78ca('0x2')]},'type':{'type':Sequelize[_0x78ca('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x78ca('0x3')},'duration':{'type':Sequelize[_0x78ca('0x4')]},'enterAt':{'type':Sequelize[_0x78ca('0x5')]},'exitAt':{'type':Sequelize[_0x78ca('0x5')],'set':function(_0xa84b17){var _0x3a73e2=moment(_0xa84b17);var _0x5abcd4=moment(this[_0x78ca('0x6')]('enterAt'));var _0x4a2b1c=_0x3a73e2[_0x78ca('0x7')](_0x5abcd4,_0x78ca('0x8'));this['setDataValue'](_0x78ca('0x9'),_0xa84b17);this[_0x78ca('0xa')](_0x78ca('0xb'),_0x4a2b1c>=0x0?_0x4a2b1c:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x78ca('0xc')},'data2':{'type':Sequelize[_0x78ca('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x78ca('0xd')},'data4':{'type':Sequelize[_0x78ca('0x2')],'comment':_0x78ca('0xe')},'data5':{'type':Sequelize[_0x78ca('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x78ca('0x4')]},'uniqueid':{'type':Sequelize[_0x78ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index fea7b3b..3fad86d 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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xedd9,0xfc));var _0x9edd=function(_0x64cc48,_0x4879a1){_0x64cc48=_0x64cc48-0x0;var _0x2a85b5=_0xedd9[_0x64cc48];return _0x2a85b5;};'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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','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','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0x55ca[_0x1221e8];return _0x3f3041;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index f642fd0..c7cf096 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 _0x5aac=['request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface','lodash','util','api'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x5aac,0x72));var _0xc5aa=function(_0x9a9524,_0x4dc3ba){_0x9a9524=_0x9a9524-0x0;var _0xb6cdec=_0x5aac[_0x9a9524];return _0xb6cdec;};'use strict';var _=require(_0xc5aa('0x0'));var util=require(_0xc5aa('0x1'));var logger=require('../../config/logger')(_0xc5aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc5aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5aa('0x4'));var config=require(_0xc5aa('0x5'));var attributes=require(_0xc5aa('0x6'));module[_0xc5aa('0x7')]=function(_0x163e2c,_0x174b8d){return _0x163e2c[_0xc5aa('0x8')]('MemberReport',attributes,{'tableName':_0xc5aa('0x9'),'paranoid':![],'indexes':[{'name':_0xc5aa('0xa'),'fields':[_0xc5aa('0xb'),_0xc5aa('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e5c=['exports','MemberReport','membername_interface','membername','interface','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e5c,0x17f));var _0xc9e5=function(_0x518dca,_0x3762c4){_0x518dca=_0x518dca-0x0;var _0x239950=_0x9e5c[_0x518dca];return _0x239950;};'use strict';var _=require(_0xc9e5('0x0'));var util=require('util');var logger=require(_0xc9e5('0x1'))(_0xc9e5('0x2'));var moment=require(_0xc9e5('0x3'));var BPromise=require(_0xc9e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9e5('0x5'));var rimraf=require(_0xc9e5('0x6'));var config=require(_0xc9e5('0x7'));var attributes=require(_0xc9e5('0x8'));module[_0xc9e5('0x9')]=function(_0x570775,_0x46694e){return _0x570775['define'](_0xc9e5('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xc9e5('0xb'),'fields':[_0xc9e5('0xc'),_0xc9e5('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 4e2921b..285599e 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 _0x2dc3=['map','include','model','create','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit'];(function(_0x6d8171,_0xfeb1da){var _0x5091fd=function(_0x4d8de5){while(--_0x4d8de5){_0x6d8171['push'](_0x6d8171['shift']());}};_0x5091fd(++_0xfeb1da);}(_0x2dc3,0x127));var _0x32dc=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2dc3[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x32dc('0x0'));var moment=require(_0x32dc('0x1'));var BPromise=require(_0x32dc('0x2'));var rs=require(_0x32dc('0x3'));var fs=require('fs');var Redis=require(_0x32dc('0x4'));var db=require(_0x32dc('0x5'))['db'];var utils=require(_0x32dc('0x6'));var logger=require(_0x32dc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32dc('0x8'));var client=jayson['client'][_0x32dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52336b,_0x8f2cea,_0x491a56){return new BPromise(function(_0x49c416,_0x3ae9e1){return client['request'](_0x52336b,_0x491a56)[_0x32dc('0xa')](function(_0x335ab1){logger[_0x32dc('0xb')]('MemberReport,\x20%s,\x20%s',_0x8f2cea,'request\x20sent');logger[_0x32dc('0xc')](_0x32dc('0xd'),_0x8f2cea,_0x32dc('0xe'),JSON[_0x32dc('0xf')](_0x335ab1));if(_0x335ab1[_0x32dc('0x10')]){if(_0x335ab1[_0x32dc('0x10')][_0x32dc('0x11')]===0x1f4){logger['error'](_0x32dc('0x12'),_0x8f2cea,_0x335ab1['error'][_0x32dc('0x13')]);return _0x3ae9e1(_0x335ab1[_0x32dc('0x10')][_0x32dc('0x13')]);}logger['error'](_0x32dc('0x12'),_0x8f2cea,_0x335ab1[_0x32dc('0x10')]['message']);return _0x49c416(_0x335ab1[_0x32dc('0x10')]['message']);}else{logger[_0x32dc('0xb')]('MemberReport,\x20%s,\x20%s',_0x8f2cea,'request\x20sent');_0x49c416(_0x335ab1['result'][_0x32dc('0x13')]);}})[_0x32dc('0x14')](function(_0x391c13){logger['error'](_0x32dc('0x12'),_0x8f2cea,_0x391c13);_0x3ae9e1(_0x391c13);});});}exports[_0x32dc('0x15')]=function(_0x38064a){var _0x47ccb4=this;return new Promise(function(_0x36e287,_0x36389b){return db[_0x32dc('0x16')][_0x32dc('0x17')]({'raw':_0x38064a['options']?_0x38064a[_0x32dc('0x18')][_0x32dc('0x19')]===undefined?!![]:![]:!![],'where':_0x38064a[_0x32dc('0x18')]?_0x38064a[_0x32dc('0x18')][_0x32dc('0x1a')]||null:null,'attributes':_0x38064a[_0x32dc('0x18')]?_0x38064a[_0x32dc('0x18')][_0x32dc('0x1b')]||null:null,'limit':_0x38064a['options']?_0x38064a[_0x32dc('0x18')][_0x32dc('0x1c')]||null:null,'include':_0x38064a[_0x32dc('0x18')]?_0x38064a[_0x32dc('0x18')]['include']?_[_0x32dc('0x1d')](_0x38064a[_0x32dc('0x18')][_0x32dc('0x1e')],function(_0x39182b){return{'model':db[_0x39182b['model']],'as':_0x39182b['as'],'attributes':_0x39182b[_0x32dc('0x1b')],'include':_0x39182b[_0x32dc('0x1e')]?_[_0x32dc('0x1d')](_0x39182b['include'],function(_0x51af54){return{'model':db[_0x51af54[_0x32dc('0x1f')]],'as':_0x51af54['as'],'attributes':_0x51af54['attributes'],'include':_0x51af54[_0x32dc('0x1e')]?_['map'](_0x51af54['include'],function(_0x50ccf4){return{'model':db[_0x50ccf4[_0x32dc('0x1f')]],'as':_0x50ccf4['as'],'attributes':_0x50ccf4['attributes']};}):[]};}):[]};}):[]:[]})[_0x32dc('0xa')](function(_0x26e348){logger['info'](_0x32dc('0x15'),_0x38064a);logger[_0x32dc('0xc')](_0x32dc('0x15'),_0x38064a,JSON[_0x32dc('0xf')](_0x26e348));_0x36e287(_0x26e348);})[_0x32dc('0x14')](function(_0x41d845){logger[_0x32dc('0x10')]('GetMemberReport',_0x41d845[_0x32dc('0x13')],_0x38064a);_0x36389b(_0x47ccb4[_0x32dc('0x10')](0x1f4,_0x41d845['message']));});});};exports['CreateMemberReport']=function(_0x2e240f){var _0x51e50c=this;return new Promise(function(_0x46a526,_0x5b9c3a){return db[_0x32dc('0x16')][_0x32dc('0x20')](_0x2e240f['body'],{'raw':_0x2e240f[_0x32dc('0x18')]?_0x2e240f[_0x32dc('0x18')][_0x32dc('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1b2a18){logger[_0x32dc('0xb')](_0x32dc('0x21'),_0x2e240f);logger[_0x32dc('0xc')](_0x32dc('0x21'),_0x2e240f,JSON[_0x32dc('0xf')](_0x1b2a18));_0x46a526(_0x1b2a18);})[_0x32dc('0x14')](function(_0x399f88){logger[_0x32dc('0x10')](_0x32dc('0x21'),_0x399f88['message'],_0x2e240f);_0x5b9c3a(_0x51e50c[_0x32dc('0x10')](0x1f4,_0x399f88[_0x32dc('0x13')]));});});};exports[_0x32dc('0x22')]=function(_0x267fc1){var _0x29266f=this;return new Promise(function(_0x56a34c,_0x26ca1c){return db['MemberReport'][_0x32dc('0x23')](_0x267fc1['body'],{'raw':_0x267fc1[_0x32dc('0x18')]?_0x267fc1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267fc1[_0x32dc('0x18')]?_0x267fc1[_0x32dc('0x18')][_0x32dc('0x1a')]||null:null,'attributes':_0x267fc1[_0x32dc('0x18')]?_0x267fc1['options'][_0x32dc('0x1b')]||null:null,'limit':_0x267fc1[_0x32dc('0x18')]?_0x267fc1[_0x32dc('0x18')][_0x32dc('0x1c')]||null:null})['then'](function(_0x4410cd){logger[_0x32dc('0xb')](_0x32dc('0x22'),_0x267fc1);logger[_0x32dc('0xc')](_0x32dc('0x22'),_0x267fc1,JSON['stringify'](_0x4410cd));_0x56a34c(_0x4410cd);})['catch'](function(_0x5c1ccb){logger['error']('UpdateMemberReport',_0x5c1ccb[_0x32dc('0x13')],_0x267fc1);_0x26ca1c(_0x29266f[_0x32dc('0x10')](0x1f4,_0x5c1ccb['message']));});});}; \ No newline at end of file +var _0xf78f=['CreateMemberReport','create','body','UpdateMemberReport','update','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','client','request','then','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','attributes','limit','map','include','model','info'];(function(_0x5750c1,_0x21018b){var _0x266a39=function(_0x1eac4d){while(--_0x1eac4d){_0x5750c1['push'](_0x5750c1['shift']());}};_0x266a39(++_0x21018b);}(_0xf78f,0x72));var _0xff78=function(_0x5ad513,_0x56f6a0){_0x5ad513=_0x5ad513-0x0;var _0xf4e9e9=_0xf78f[_0x5ad513];return _0xf4e9e9;};'use strict';var _=require('lodash');var util=require(_0xff78('0x0'));var moment=require(_0xff78('0x1'));var BPromise=require(_0xff78('0x2'));var rs=require(_0xff78('0x3'));var fs=require('fs');var Redis=require(_0xff78('0x4'));var db=require(_0xff78('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff78('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14edec,_0x2badae,_0x437ed4){return new BPromise(function(_0x32df40,_0x542ba4){return client[_0xff78('0x7')](_0x14edec,_0x437ed4)[_0xff78('0x8')](function(_0x15fd5b){logger['info']('MemberReport,\x20%s,\x20%s',_0x2badae,_0xff78('0x9'));logger[_0xff78('0xa')](_0xff78('0xb'),_0x2badae,_0xff78('0x9'),JSON[_0xff78('0xc')](_0x15fd5b));if(_0x15fd5b[_0xff78('0xd')]){if(_0x15fd5b[_0xff78('0xd')][_0xff78('0xe')]===0x1f4){logger['error'](_0xff78('0xf'),_0x2badae,_0x15fd5b[_0xff78('0xd')]['message']);return _0x542ba4(_0x15fd5b[_0xff78('0xd')]['message']);}logger[_0xff78('0xd')]('MemberReport,\x20%s,\x20%s',_0x2badae,_0x15fd5b[_0xff78('0xd')][_0xff78('0x10')]);return _0x32df40(_0x15fd5b[_0xff78('0xd')][_0xff78('0x10')]);}else{logger['info'](_0xff78('0xf'),_0x2badae,_0xff78('0x9'));_0x32df40(_0x15fd5b[_0xff78('0x11')][_0xff78('0x10')]);}})[_0xff78('0x12')](function(_0x1f6aef){logger[_0xff78('0xd')]('MemberReport,\x20%s,\x20%s',_0x2badae,_0x1f6aef);_0x542ba4(_0x1f6aef);});});}exports[_0xff78('0x13')]=function(_0x183cd1){var _0x2eda17=this;return new Promise(function(_0x201af4,_0x38aa08){return db[_0xff78('0x14')][_0xff78('0x15')]({'raw':_0x183cd1[_0xff78('0x16')]?_0x183cd1['options'][_0xff78('0x17')]===undefined?!![]:![]:!![],'where':_0x183cd1[_0xff78('0x16')]?_0x183cd1[_0xff78('0x16')]['where']||null:null,'attributes':_0x183cd1[_0xff78('0x16')]?_0x183cd1['options'][_0xff78('0x18')]||null:null,'limit':_0x183cd1[_0xff78('0x16')]?_0x183cd1[_0xff78('0x16')][_0xff78('0x19')]||null:null,'include':_0x183cd1[_0xff78('0x16')]?_0x183cd1['options']['include']?_[_0xff78('0x1a')](_0x183cd1[_0xff78('0x16')][_0xff78('0x1b')],function(_0x600dbe){return{'model':db[_0x600dbe[_0xff78('0x1c')]],'as':_0x600dbe['as'],'attributes':_0x600dbe[_0xff78('0x18')],'include':_0x600dbe[_0xff78('0x1b')]?_[_0xff78('0x1a')](_0x600dbe['include'],function(_0x184563){return{'model':db[_0x184563[_0xff78('0x1c')]],'as':_0x184563['as'],'attributes':_0x184563[_0xff78('0x18')],'include':_0x184563[_0xff78('0x1b')]?_['map'](_0x184563[_0xff78('0x1b')],function(_0xb77e22){return{'model':db[_0xb77e22[_0xff78('0x1c')]],'as':_0xb77e22['as'],'attributes':_0xb77e22[_0xff78('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff78('0x8')](function(_0x59c24d){logger[_0xff78('0x1d')](_0xff78('0x13'),_0x183cd1);logger[_0xff78('0xa')](_0xff78('0x13'),_0x183cd1,JSON[_0xff78('0xc')](_0x59c24d));_0x201af4(_0x59c24d);})[_0xff78('0x12')](function(_0x3500cc){logger[_0xff78('0xd')](_0xff78('0x13'),_0x3500cc[_0xff78('0x10')],_0x183cd1);_0x38aa08(_0x2eda17[_0xff78('0xd')](0x1f4,_0x3500cc['message']));});});};exports[_0xff78('0x1e')]=function(_0x22aa0a){var _0x2afa72=this;return new Promise(function(_0x238cb5,_0x598095){return db[_0xff78('0x14')][_0xff78('0x1f')](_0x22aa0a[_0xff78('0x20')],{'raw':_0x22aa0a[_0xff78('0x16')]?_0x22aa0a[_0xff78('0x16')][_0xff78('0x17')]===undefined?!![]:![]:!![]})[_0xff78('0x8')](function(_0x1425bb){logger['info'](_0xff78('0x1e'),_0x22aa0a);logger[_0xff78('0xa')](_0xff78('0x1e'),_0x22aa0a,JSON[_0xff78('0xc')](_0x1425bb));_0x238cb5(_0x1425bb);})[_0xff78('0x12')](function(_0x1e472b){logger[_0xff78('0xd')]('CreateMemberReport',_0x1e472b[_0xff78('0x10')],_0x22aa0a);_0x598095(_0x2afa72['error'](0x1f4,_0x1e472b[_0xff78('0x10')]));});});};exports[_0xff78('0x21')]=function(_0x194af6){var _0x150dd3=this;return new Promise(function(_0x4fd4b7,_0x266a56){return db[_0xff78('0x14')][_0xff78('0x22')](_0x194af6[_0xff78('0x20')],{'raw':_0x194af6[_0xff78('0x16')]?_0x194af6[_0xff78('0x16')][_0xff78('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194af6[_0xff78('0x16')]?_0x194af6[_0xff78('0x16')][_0xff78('0x23')]||null:null,'attributes':_0x194af6[_0xff78('0x16')]?_0x194af6['options'][_0xff78('0x18')]||null:null,'limit':_0x194af6[_0xff78('0x16')]?_0x194af6[_0xff78('0x16')][_0xff78('0x19')]||null:null})[_0xff78('0x8')](function(_0x315385){logger[_0xff78('0x1d')](_0xff78('0x21'),_0x194af6);logger[_0xff78('0xa')]('UpdateMemberReport',_0x194af6,JSON['stringify'](_0x315385));_0x4fd4b7(_0x315385);})[_0xff78('0x12')](function(_0xb04b47){logger['error']('UpdateMemberReport',_0xb04b47['message'],_0x194af6);_0x266a56(_0x150dd3[_0xff78('0xd')](0x1f4,_0xb04b47['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 8ea5970..e517d79 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 _0xef18=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','util'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xef18,0xfb));var _0x8ef1=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xef18[_0x6e1239];return _0x418150;};'use strict';var multer=require('multer');var util=require(_0x8ef1('0x0'));var path=require(_0x8ef1('0x1'));var timeout=require(_0x8ef1('0x2'));var express=require(_0x8ef1('0x3'));var router=express[_0x8ef1('0x4')]();var fs_extra=require(_0x8ef1('0x5'));var auth=require(_0x8ef1('0x6'));var interaction=require(_0x8ef1('0x7'));var config=require(_0x8ef1('0x8'));var controller=require('./migration.controller');router[_0x8ef1('0x9')]('/',controller[_0x8ef1('0xa')]);module[_0x8ef1('0xb')]=router; \ No newline at end of file +var _0x56f0=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index'];(function(_0x58aa20,_0x22e608){var _0x22b883=function(_0x703293){while(--_0x703293){_0x58aa20['push'](_0x58aa20['shift']());}};_0x22b883(++_0x22e608);}(_0x56f0,0x145));var _0x056f=function(_0x38576d,_0x527dc7){_0x38576d=_0x38576d-0x0;var _0x32534a=_0x56f0[_0x38576d];return _0x32534a;};'use strict';var multer=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var path=require('path');var timeout=require(_0x056f('0x2'));var express=require(_0x056f('0x3'));var router=express[_0x056f('0x4')]();var fs_extra=require(_0x056f('0x5'));var auth=require(_0x056f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x056f('0x7'));var controller=require(_0x056f('0x8'));router[_0x056f('0x9')]('/',controller[_0x056f('0xa')]);module[_0x056f('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 8b00d80..b560364 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 _0xf27f=['exports','sequelize'];(function(_0x4af8d4,_0x5583ca){var _0x5947fb=function(_0x3c533f){while(--_0x3c533f){_0x4af8d4['push'](_0x4af8d4['shift']());}};_0x5947fb(++_0x5583ca);}(_0xf27f,0x11b));var _0xff27=function(_0x4131ca,_0x2db73e){_0x4131ca=_0x4131ca-0x0;var _0x2c31ef=_0xf27f[_0x4131ca];return _0x2c31ef;};'use strict';var Sequelize=require(_0xff27('0x0'));module[_0xff27('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0x046b=['sequelize','exports','version'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x046b,0xbd));var _0xb046=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x046b[_0x1af05b];return _0x5be7cc;};'use strict';var Sequelize=require(_0xb046('0x0'));module[_0xb046('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xb046('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index a005256..4fa907f 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 _0xabb3=['fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Migration','then','includeAll','include','rows','eml-format','zip-dir'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xabb3,0xc7));var _0x3abb=function(_0xdb759b,_0x145a8a){_0xdb759b=_0xdb759b-0x0;var _0x32caff=_0xabb3[_0xdb759b];return _0x32caff;};'use strict';var emlformat=require(_0x3abb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3abb('0x1'));var jsonpatch=require(_0x3abb('0x2'));var rp=require(_0x3abb('0x3'));var moment=require(_0x3abb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3abb('0x5'));var util=require(_0x3abb('0x6'));var path=require(_0x3abb('0x7'));var sox=require(_0x3abb('0x8'));var csv=require('to-csv');var ejs=require(_0x3abb('0x9'));var fs=require('fs');var fs_extra=require(_0x3abb('0xa'));var _=require(_0x3abb('0xb'));var squel=require('squel');var crypto=require(_0x3abb('0xc'));var jsforce=require(_0x3abb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3abb('0xe'));var querystring=require(_0x3abb('0xf'));var Papa=require(_0x3abb('0x10'));var Redis=require(_0x3abb('0x11'));var authService=require(_0x3abb('0x12'));var qs=require(_0x3abb('0x13'));var as=require(_0x3abb('0x14'));var hardwareService=require(_0x3abb('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x3abb('0x16'));var config=require(_0x3abb('0x17'));var licenseUtil=require(_0x3abb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52d021,_0x4af162){_0x4af162=_0x4af162||0xcc;return function(_0x284b91){if(_0x284b91){return _0x52d021[_0x3abb('0x19')](_0x4af162);}return _0x52d021[_0x3abb('0x1a')](_0x4af162)[_0x3abb('0x1b')]();};}function respondWithResult(_0x1fda87,_0xb66459){_0xb66459=_0xb66459||0xc8;return function(_0x100253){if(_0x100253){return _0x1fda87[_0x3abb('0x1a')](_0xb66459)[_0x3abb('0x1c')](_0x100253);}};}function respondWithFilteredResult(_0x40dcbd,_0x39dec7){return function(_0x11109f){if(_0x11109f){var _0x531a2e=typeof _0x39dec7[_0x3abb('0x1d')]===_0x3abb('0x1e')&&typeof _0x39dec7[_0x3abb('0x1f')]==='undefined';var _0x3bcf26=_0x11109f['count'];var _0x4f011a=_0x531a2e?0x0:_0x39dec7[_0x3abb('0x1d')];var _0x526244=_0x531a2e?_0x11109f[_0x3abb('0x20')]:_0x39dec7[_0x3abb('0x1d')]+_0x39dec7[_0x3abb('0x1f')];var _0x568b6e;if(_0x526244>=_0x3bcf26){_0x526244=_0x3bcf26;_0x568b6e=0xc8;}else{_0x568b6e=0xce;}_0x40dcbd[_0x3abb('0x1a')](_0x568b6e);return _0x40dcbd[_0x3abb('0x21')](_0x3abb('0x22'),_0x4f011a+'-'+_0x526244+'/'+_0x3bcf26)[_0x3abb('0x1c')](_0x11109f);}return null;};}function patchUpdates(_0xca59fc){return function(_0xf031b3){try{jsonpatch[_0x3abb('0x23')](_0xf031b3,_0xca59fc,!![]);}catch(_0x32b75f){return BPromise['reject'](_0x32b75f);}return _0xf031b3['save']();};}function saveUpdates(_0x2e0455,_0x49d559){return function(_0x41cb75){if(_0x41cb75){return _0x41cb75[_0x3abb('0x24')](_0x2e0455)['then'](function(_0x1814e5){return _0x1814e5;});}return null;};}function removeEntity(_0x416320,_0x1bdb98){return function(_0x59d1b3){if(_0x59d1b3){return _0x59d1b3[_0x3abb('0x25')]()['then'](function(){_0x416320[_0x3abb('0x1a')](0xcc)[_0x3abb('0x1b')]();});}};}function handleEntityNotFound(_0x23a618,_0x35ea98){return function(_0x50b086){if(!_0x50b086){_0x23a618['sendStatus'](0x194);}return _0x50b086;};}function handleError(_0xe02897,_0x4519ef){_0x4519ef=_0x4519ef||0x1f4;return function(_0xf85f69){logger['error'](_0xf85f69[_0x3abb('0x26')]);if(_0xf85f69[_0x3abb('0x27')]){delete _0xf85f69[_0x3abb('0x27')];}_0xe02897['status'](_0x4519ef)[_0x3abb('0x28')](_0xf85f69);};}exports['index']=function(_0x4fe222,_0x26a2b3){var _0x5ca2a9={},_0x2d6c23={},_0x16f9da={'count':0x0,'rows':[]};var _0x607201=_[_0x3abb('0x29')](db['Migration'][_0x3abb('0x2a')],function(_0x35c55e){return{'name':_0x35c55e[_0x3abb('0x2b')],'type':_0x35c55e[_0x3abb('0x2c')][_0x3abb('0x2d')]};});_0x2d6c23['model']=_['map'](_0x607201,_0x3abb('0x27'));_0x2d6c23[_0x3abb('0x2e')]=_['keys'](_0x4fe222[_0x3abb('0x2e')]);_0x2d6c23[_0x3abb('0x2f')]=_[_0x3abb('0x30')](_0x2d6c23[_0x3abb('0x31')],_0x2d6c23[_0x3abb('0x2e')]);_0x5ca2a9[_0x3abb('0x32')]=_[_0x3abb('0x30')](_0x2d6c23['model'],qs[_0x3abb('0x33')](_0x4fe222[_0x3abb('0x2e')]['fields']));_0x5ca2a9[_0x3abb('0x32')]=_0x5ca2a9[_0x3abb('0x32')][_0x3abb('0x34')]?_0x5ca2a9[_0x3abb('0x32')]:_0x2d6c23[_0x3abb('0x31')];if(!_0x4fe222['query'][_0x3abb('0x35')](_0x3abb('0x36'))){_0x5ca2a9[_0x3abb('0x1f')]=qs[_0x3abb('0x1f')](_0x4fe222['query'][_0x3abb('0x1f')]);_0x5ca2a9[_0x3abb('0x1d')]=qs[_0x3abb('0x1d')](_0x4fe222['query'][_0x3abb('0x1d')]);}_0x5ca2a9[_0x3abb('0x37')]=qs['sort'](_0x4fe222['query'][_0x3abb('0x38')]);_0x5ca2a9[_0x3abb('0x39')]=qs['filters'](_[_0x3abb('0x3a')](_0x4fe222['query'],_0x2d6c23[_0x3abb('0x2f')]),_0x607201);if(_0x4fe222[_0x3abb('0x2e')][_0x3abb('0x3b')]){_0x5ca2a9[_0x3abb('0x39')]=_['merge'](_0x5ca2a9[_0x3abb('0x39')],{'$or':_[_0x3abb('0x29')](_0x607201,function(_0x5ebfbe){if(_0x5ebfbe[_0x3abb('0x2c')]!=='VIRTUAL'){var _0x471f30={};_0x471f30[_0x5ebfbe['name']]={'$like':'%'+_0x4fe222['query'][_0x3abb('0x3b')]+'%'};return _0x471f30;}})});}_0x5ca2a9=_[_0x3abb('0x3c')]({},_0x5ca2a9,_0x4fe222[_0x3abb('0x3d')]);var _0x229ff5={'where':_0x5ca2a9[_0x3abb('0x39')]};return db[_0x3abb('0x3e')]['count'](_0x229ff5)[_0x3abb('0x3f')](function(_0x5de489){_0x16f9da[_0x3abb('0x20')]=_0x5de489;if(_0x4fe222[_0x3abb('0x2e')][_0x3abb('0x40')]){_0x5ca2a9[_0x3abb('0x41')]=[{'all':!![]}];}return db[_0x3abb('0x3e')]['findAll'](_0x5ca2a9);})[_0x3abb('0x3f')](function(_0x3aa57f){_0x16f9da[_0x3abb('0x42')]=_0x3aa57f;return _0x16f9da;})[_0x3abb('0x3f')](respondWithFilteredResult(_0x26a2b3,_0x5ca2a9))['catch'](handleError(_0x26a2b3,null));}; \ No newline at end of file +var _0xd91d=['include','findAll','eml-format','zip-dir','fast-json-patch','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','Migration','includeAll'];(function(_0x1fa350,_0x2fe140){var _0xf11e76=function(_0x228141){while(--_0x228141){_0x1fa350['push'](_0x1fa350['shift']());}};_0xf11e76(++_0x2fe140);}(_0xd91d,0x188));var _0xdd91=function(_0x1357f5,_0x5b5562){_0x1357f5=_0x1357f5-0x0;var _0x32cf74=_0xd91d[_0x1357f5];return _0x32cf74;};'use strict';var emlformat=require(_0xdd91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd91('0x1'));var jsonpatch=require(_0xdd91('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd91('0x3'));var util=require(_0xdd91('0x4'));var path=require('path');var sox=require(_0xdd91('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd91('0x6'));var _=require(_0xdd91('0x7'));var squel=require(_0xdd91('0x8'));var crypto=require(_0xdd91('0x9'));var jsforce=require(_0xdd91('0xa'));var deskjs=require(_0xdd91('0xb'));var toCsv=require(_0xdd91('0xc'));var querystring=require(_0xdd91('0xd'));var Papa=require(_0xdd91('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd91('0xf'));var as=require(_0xdd91('0x10'));var hardwareService=require(_0xdd91('0x11'));var logger=require(_0xdd91('0x12'))(_0xdd91('0x13'));var utils=require(_0xdd91('0x14'));var config=require(_0xdd91('0x15'));var licenseUtil=require(_0xdd91('0x16'));var db=require(_0xdd91('0x17'))['db'];function respondWithStatusCode(_0x494ffb,_0x170b3b){_0x170b3b=_0x170b3b||0xcc;return function(_0x2d0db8){if(_0x2d0db8){return _0x494ffb['sendStatus'](_0x170b3b);}return _0x494ffb[_0xdd91('0x18')](_0x170b3b)[_0xdd91('0x19')]();};}function respondWithResult(_0x604290,_0x318962){_0x318962=_0x318962||0xc8;return function(_0xe49a02){if(_0xe49a02){return _0x604290[_0xdd91('0x18')](_0x318962)['json'](_0xe49a02);}};}function respondWithFilteredResult(_0x2dacfb,_0x32062f){return function(_0x40fe4c){if(_0x40fe4c){var _0x28bb96=typeof _0x32062f['offset']===_0xdd91('0x1a')&&typeof _0x32062f[_0xdd91('0x1b')]===_0xdd91('0x1a');var _0x13abcb=_0x40fe4c[_0xdd91('0x1c')];var _0x35dc2e=_0x28bb96?0x0:_0x32062f[_0xdd91('0x1d')];var _0x65acea=_0x28bb96?_0x40fe4c[_0xdd91('0x1c')]:_0x32062f[_0xdd91('0x1d')]+_0x32062f[_0xdd91('0x1b')];var _0x25e5b1;if(_0x65acea>=_0x13abcb){_0x65acea=_0x13abcb;_0x25e5b1=0xc8;}else{_0x25e5b1=0xce;}_0x2dacfb[_0xdd91('0x18')](_0x25e5b1);return _0x2dacfb[_0xdd91('0x1e')](_0xdd91('0x1f'),_0x35dc2e+'-'+_0x65acea+'/'+_0x13abcb)['json'](_0x40fe4c);}return null;};}function patchUpdates(_0x240e25){return function(_0x843f73){try{jsonpatch[_0xdd91('0x20')](_0x843f73,_0x240e25,!![]);}catch(_0x1e15dd){return BPromise[_0xdd91('0x21')](_0x1e15dd);}return _0x843f73['save']();};}function saveUpdates(_0x428ae5,_0x409ded){return function(_0x1981a3){if(_0x1981a3){return _0x1981a3[_0xdd91('0x22')](_0x428ae5)[_0xdd91('0x23')](function(_0x480a16){return _0x480a16;});}return null;};}function removeEntity(_0x17d35d,_0x4ed311){return function(_0x3eecb1){if(_0x3eecb1){return _0x3eecb1[_0xdd91('0x24')]()['then'](function(){_0x17d35d[_0xdd91('0x18')](0xcc)[_0xdd91('0x19')]();});}};}function handleEntityNotFound(_0x4800e1,_0xe14558){return function(_0x4b53f3){if(!_0x4b53f3){_0x4800e1[_0xdd91('0x25')](0x194);}return _0x4b53f3;};}function handleError(_0x456102,_0x2cf9ca){_0x2cf9ca=_0x2cf9ca||0x1f4;return function(_0x622209){logger[_0xdd91('0x26')](_0x622209[_0xdd91('0x27')]);if(_0x622209[_0xdd91('0x28')]){delete _0x622209[_0xdd91('0x28')];}_0x456102[_0xdd91('0x18')](_0x2cf9ca)[_0xdd91('0x29')](_0x622209);};}exports['index']=function(_0x5b5bad,_0x7901c){var _0x1d878d={},_0x47ad92={},_0x1eddc2={'count':0x0,'rows':[]};var _0x1d1935=_[_0xdd91('0x2a')](db['Migration'][_0xdd91('0x2b')],function(_0x5c901){return{'name':_0x5c901['fieldName'],'type':_0x5c901[_0xdd91('0x2c')][_0xdd91('0x2d')]};});_0x47ad92[_0xdd91('0x2e')]=_[_0xdd91('0x2a')](_0x1d1935,_0xdd91('0x28'));_0x47ad92[_0xdd91('0x2f')]=_['keys'](_0x5b5bad['query']);_0x47ad92[_0xdd91('0x30')]=_[_0xdd91('0x31')](_0x47ad92['model'],_0x47ad92[_0xdd91('0x2f')]);_0x1d878d['attributes']=_['intersection'](_0x47ad92[_0xdd91('0x2e')],qs['fields'](_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x32')]));_0x1d878d[_0xdd91('0x33')]=_0x1d878d[_0xdd91('0x33')][_0xdd91('0x34')]?_0x1d878d[_0xdd91('0x33')]:_0x47ad92[_0xdd91('0x2e')];if(!_0x5b5bad[_0xdd91('0x2f')]['hasOwnProperty'](_0xdd91('0x35'))){_0x1d878d[_0xdd91('0x1b')]=qs[_0xdd91('0x1b')](_0x5b5bad['query']['limit']);_0x1d878d[_0xdd91('0x1d')]=qs[_0xdd91('0x1d')](_0x5b5bad['query']['offset']);}_0x1d878d[_0xdd91('0x36')]=qs[_0xdd91('0x37')](_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x37')]);_0x1d878d['where']=qs[_0xdd91('0x30')](_[_0xdd91('0x38')](_0x5b5bad['query'],_0x47ad92['filters']),_0x1d1935);if(_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x39')]){_0x1d878d['where']=_[_0xdd91('0x3a')](_0x1d878d['where'],{'$or':_[_0xdd91('0x2a')](_0x1d1935,function(_0x8d9a17){if(_0x8d9a17[_0xdd91('0x2c')]!==_0xdd91('0x3b')){var _0x56f777={};_0x56f777[_0x8d9a17['name']]={'$like':'%'+_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x39')]+'%'};return _0x56f777;}})});}_0x1d878d=_['merge']({},_0x1d878d,_0x5b5bad['options']);var _0xc23b66={'where':_0x1d878d[_0xdd91('0x3c')]};return db[_0xdd91('0x3d')]['count'](_0xc23b66)[_0xdd91('0x23')](function(_0x2dc00c){_0x1eddc2[_0xdd91('0x1c')]=_0x2dc00c;if(_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x3e')]){_0x1d878d[_0xdd91('0x3f')]=[{'all':!![]}];}return db[_0xdd91('0x3d')][_0xdd91('0x40')](_0x1d878d);})[_0xdd91('0x23')](function(_0xf2eafd){_0x1eddc2['rows']=_0xf2eafd;return _0x1eddc2;})[_0xdd91('0x23')](respondWithFilteredResult(_0x7901c,_0x1d878d))['catch'](handleError(_0x7901c,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 03c22ae..a9d7176 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 _0x9f64=['lodash','util','moment','bluebird','request-promise','path','rimraf','exports','define','Migration','migrations'];(function(_0x30dbfe,_0x19dd69){var _0x32eec3=function(_0x7031c2){while(--_0x7031c2){_0x30dbfe['push'](_0x30dbfe['shift']());}};_0x32eec3(++_0x19dd69);}(_0x9f64,0x9a));var _0x49f6=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x9f64[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x49f6('0x0'));var util=require(_0x49f6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x49f6('0x2'));var BPromise=require(_0x49f6('0x3'));var rp=require(_0x49f6('0x4'));var fs=require('fs');var path=require(_0x49f6('0x5'));var rimraf=require(_0x49f6('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x49f6('0x7')]=function(_0x4c9a03,_0x773dd3){return _0x4c9a03[_0x49f6('0x8')](_0x49f6('0x9'),attributes,{'tableName':_0x49f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x292f=['../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x25621d,_0x10fa36){var _0x48f34b=function(_0x409530){while(--_0x409530){_0x25621d['push'](_0x25621d['shift']());}};_0x48f34b(++_0x10fa36);}(_0x292f,0x7d));var _0xf292=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x292f[_0x764874];return _0x29f9d5;};'use strict';var _=require(_0xf292('0x0'));var util=require(_0xf292('0x1'));var logger=require(_0xf292('0x2'))(_0xf292('0x3'));var moment=require(_0xf292('0x4'));var BPromise=require(_0xf292('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf292('0x6'));var config=require(_0xf292('0x7'));var attributes=require(_0xf292('0x8'));module[_0xf292('0x9')]=function(_0x3c69b6,_0x4e287c){return _0x3c69b6[_0xf292('0xa')]('Migration',attributes,{'tableName':_0xf292('0xb'),'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 024dcb7..7cb63db 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 _0x86fd=['debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x86fd,0xa7));var _0xd86f=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0x86fd[_0x35a140];return _0x30ab82;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var moment=require(_0xd86f('0x2'));var BPromise=require(_0xd86f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd86f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd86f('0x5'));var logger=require(_0xd86f('0x6'))('rpc');var config=require(_0xd86f('0x7'));var jayson=require(_0xd86f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2843b2,_0x500cb8,_0x3f1920){return new BPromise(function(_0x4cd46e,_0x2b4117){return client[_0xd86f('0x9')](_0x2843b2,_0x3f1920)[_0xd86f('0xa')](function(_0x1205ae){logger['info'](_0xd86f('0xb'),_0x500cb8,_0xd86f('0xc'));logger[_0xd86f('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x500cb8,'request\x20sent',JSON['stringify'](_0x1205ae));if(_0x1205ae['error']){if(_0x1205ae[_0xd86f('0xe')][_0xd86f('0xf')]===0x1f4){logger[_0xd86f('0xe')](_0xd86f('0xb'),_0x500cb8,_0x1205ae['error']['message']);return _0x2b4117(_0x1205ae[_0xd86f('0xe')][_0xd86f('0x10')]);}logger[_0xd86f('0xe')](_0xd86f('0xb'),_0x500cb8,_0x1205ae[_0xd86f('0xe')]['message']);return _0x4cd46e(_0x1205ae['error']['message']);}else{logger[_0xd86f('0x11')](_0xd86f('0xb'),_0x500cb8,_0xd86f('0xc'));_0x4cd46e(_0x1205ae[_0xd86f('0x12')][_0xd86f('0x10')]);}})[_0xd86f('0x13')](function(_0x5cd7c9){logger[_0xd86f('0xe')]('Migration,\x20%s,\x20%s',_0x500cb8,_0x5cd7c9);_0x2b4117(_0x5cd7c9);});});} \ No newline at end of file +var _0x18a5=['../../config/logger','rpc','../../config/environment','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x18a5,0x164));var _0x518a=function(_0x2f4a23,_0x2e05b0){_0x2f4a23=_0x2f4a23-0x0;var _0x515019=_0x18a5[_0x2f4a23];return _0x515019;};'use strict';var _=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x518a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x518a('0x3'))['db'];var utils=require(_0x518a('0x4'));var logger=require(_0x518a('0x5'))(_0x518a('0x6'));var config=require(_0x518a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea311,_0x1d4199,_0x19a2df){return new BPromise(function(_0x2a5fa6,_0x8bd966){return client[_0x518a('0x8')](_0x2ea311,_0x19a2df)[_0x518a('0x9')](function(_0xb996c3){logger[_0x518a('0xa')](_0x518a('0xb'),_0x1d4199,_0x518a('0xc'));logger[_0x518a('0xd')](_0x518a('0xe'),_0x1d4199,_0x518a('0xc'),JSON[_0x518a('0xf')](_0xb996c3));if(_0xb996c3['error']){if(_0xb996c3[_0x518a('0x10')]['code']===0x1f4){logger[_0x518a('0x10')]('Migration,\x20%s,\x20%s',_0x1d4199,_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);return _0x8bd966(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}logger[_0x518a('0x10')](_0x518a('0xb'),_0x1d4199,_0xb996c3[_0x518a('0x10')]['message']);return _0x2a5fa6(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}else{logger[_0x518a('0xa')]('Migration,\x20%s,\x20%s',_0x1d4199,_0x518a('0xc'));_0x2a5fa6(_0xb996c3[_0x518a('0x12')]['message']);}})['catch'](function(_0x177882){logger['error'](_0x518a('0xb'),_0x1d4199,_0x177882);_0x8bd966(_0x177882);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 6cec7d9..802241c 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 _0xa701=['update','delete','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0xb5abb7,_0x9b082a){var _0xf2f2a2=function(_0x1510cd){while(--_0x1510cd){_0xb5abb7['push'](_0xb5abb7['shift']());}};_0xf2f2a2(++_0x9b082a);}(_0xa701,0xd4));var _0x1a70=function(_0x1a9d5d,_0x508c47){_0x1a9d5d=_0x1a9d5d-0x0;var _0x37e2b8=_0xa701[_0x1a9d5d];return _0x37e2b8;};'use strict';var multer=require('multer');var util=require(_0x1a70('0x0'));var path=require(_0x1a70('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a70('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1a70('0x3'));var config=require(_0x1a70('0x4'));var controller=require(_0x1a70('0x5'));router[_0x1a70('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a70('0x6')](_0x1a70('0x7'),auth[_0x1a70('0x8')](),controller[_0x1a70('0x9')]);router[_0x1a70('0xa')]('/',auth[_0x1a70('0x8')](),controller[_0x1a70('0xb')]);router['put'](_0x1a70('0x7'),auth[_0x1a70('0x8')](),controller[_0x1a70('0xc')]);router[_0x1a70('0xd')]('/:id',auth[_0x1a70('0x8')](),controller[_0x1a70('0xe')]);module[_0x1a70('0xf')]=router; \ No newline at end of file +var _0xf19c=['show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated'];(function(_0x176784,_0x372480){var _0xf1f47=function(_0x18cfdc){while(--_0x18cfdc){_0x176784['push'](_0x176784['shift']());}};_0xf1f47(++_0x372480);}(_0xf19c,0x10b));var _0xcf19=function(_0x4314c1,_0x54c70d){_0x4314c1=_0x4314c1-0x0;var _0x3ffae0=_0xf19c[_0x4314c1];return _0x3ffae0;};'use strict';var multer=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var path=require(_0xcf19('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf19('0x3'));var router=express[_0xcf19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf19('0x5'));var interaction=require(_0xcf19('0x6'));var config=require(_0xcf19('0x7'));var controller=require(_0xcf19('0x8'));router[_0xcf19('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xa')]);router[_0xcf19('0x9')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0xd')]);router[_0xcf19('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xf')]);router[_0xcf19('0x10')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x11')]);router[_0xcf19('0x12')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x13')]);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 c8099e0..f88e2f5 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 _0xf620=['exports','ENUM','localnet','stun','turn','STRING'];(function(_0x230d0a,_0x27723e){var _0xb52635=function(_0x5cb2ac){while(--_0x5cb2ac){_0x230d0a['push'](_0x230d0a['shift']());}};_0xb52635(++_0x27723e);}(_0xf620,0xf6));var _0x0f62=function(_0x250f35,_0xd7f33a){_0x250f35=_0x250f35-0x0;var _0x51cba1=_0xf620[_0x250f35];return _0x51cba1;};'use strict';var Sequelize=require('sequelize');module[_0x0f62('0x0')]={'type':{'type':Sequelize[_0x0f62('0x1')](_0x0f62('0x2'),'externip',_0x0f62('0x3'),_0x0f62('0x4'))},'value':{'type':Sequelize[_0x0f62('0x5')]},'username':{'type':Sequelize[_0x0f62('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdef6=['localnet','externip','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x270239,_0x183766){var _0x19c470=function(_0x2ad596){while(--_0x2ad596){_0x270239['push'](_0x270239['shift']());}};_0x19c470(++_0x183766);}(_0xdef6,0x1ad));var _0x6def=function(_0x10296f,_0x4db559){_0x10296f=_0x10296f-0x0;var _0x404832=_0xdef6[_0x10296f];return _0x404832;};'use strict';var Sequelize=require(_0x6def('0x0'));module[_0x6def('0x1')]={'type':{'type':Sequelize[_0x6def('0x2')](_0x6def('0x3'),_0x6def('0x4'),_0x6def('0x5'),_0x6def('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6def('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 87653dc..e580fc4 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 _0xec41=['order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','find','create','body','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','render','writeFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','/etc/asterisk/turn_xcally.conf','chan_sip.so','util','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','status','undefined','limit','count','offset','set','Content-Range','json','destroy','end','stack','name','send','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xec41,0xd0));var _0x1ec4=function(_0x28698e,_0x48b11d){_0x28698e=_0x28698e-0x0;var _0x1e77cc=_0xec41[_0x28698e];return _0x1e77cc;};'use strict';var util=require(_0x1ec4('0x0'));var path=require('path');var ejs=require(_0x1ec4('0x1'));var fs=require('fs');var _=require(_0x1ec4('0x2'));var qs=require(_0x1ec4('0x3'));var logger=require(_0x1ec4('0x4'))(_0x1ec4('0x5'));var config=require(_0x1ec4('0x6'));var db=require(_0x1ec4('0x7'))['db'];var jayson=require(_0x1ec4('0x8'));var client=jayson[_0x1ec4('0x9')][_0x1ec4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x440fb2,_0x91b093,_0x1050d2,_0x419b83){return new Promise(function(_0x599b28,_0x4afb4c){var _0x37f7ff=_0x419b83||client;return _0x37f7ff[_0x1ec4('0xb')](_0x440fb2,_0x1050d2)[_0x1ec4('0xc')](function(_0x30398d){logger[_0x1ec4('0xd')](_0x1ec4('0xe'),_0x91b093,_0x1ec4('0xf'));logger[_0x1ec4('0x10')](_0x1ec4('0x11'),_0x91b093,_0x1ec4('0xf'),JSON[_0x1ec4('0x12')](_0x30398d));if(_0x30398d[_0x1ec4('0x13')]){if(_0x30398d['error']['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x91b093,_0x30398d[_0x1ec4('0x13')]['message']);return _0x4afb4c(_0x30398d['error']['message']);}logger[_0x1ec4('0x13')]('Network,\x20%s,\x20%s',_0x91b093,_0x30398d['error'][_0x1ec4('0x14')]);return _0x599b28(_0x30398d[_0x1ec4('0x13')]['message']);}else{logger['info']('Network,\x20%s,\x20%s',_0x91b093,_0x1ec4('0xf'));_0x599b28(_0x30398d['result']['message']);}})['catch'](function(_0x38a9e0){logger['error'](_0x1ec4('0xe'),_0x91b093,_0x38a9e0);_0x4afb4c(_0x38a9e0);});});}function respondWithResult(_0xd40a6e,_0xdcab74){_0xdcab74=_0xdcab74||0xc8;return function(_0x4ca9c5){if(_0x4ca9c5){return _0xd40a6e[_0x1ec4('0x15')](_0xdcab74)['json'](_0x4ca9c5);}};}function respondWithFilteredResult(_0x478603,_0x235c4d){return function(_0x1ad229){if(_0x1ad229){var _0x2d2bcb=typeof _0x235c4d['offset']===_0x1ec4('0x16')&&typeof _0x235c4d[_0x1ec4('0x17')]==='undefined';var _0x2dd1b9=_0x1ad229[_0x1ec4('0x18')];var _0x57c0d5=_0x2d2bcb?0x0:_0x235c4d[_0x1ec4('0x19')];var _0xaf8125=_0x2d2bcb?_0x1ad229[_0x1ec4('0x18')]:_0x235c4d[_0x1ec4('0x19')]+_0x235c4d['limit'];var _0x5e022b;if(_0xaf8125>=_0x2dd1b9){_0xaf8125=_0x2dd1b9;_0x5e022b=0xc8;}else{_0x5e022b=0xce;}_0x478603['status'](_0x5e022b);return _0x478603[_0x1ec4('0x1a')](_0x1ec4('0x1b'),_0x57c0d5+'-'+_0xaf8125+'/'+_0x2dd1b9)[_0x1ec4('0x1c')](_0x1ad229);}return null;};}function saveUpdates(_0x2c4440){return function(_0x457f39){if(_0x457f39){return _0x457f39['update'](_0x2c4440)[_0x1ec4('0xc')](function(_0x1cdf55){return _0x1cdf55;});}return null;};}function removeEntity(_0x253a6e){return function(_0x2416fc){if(_0x2416fc){return _0x2416fc[_0x1ec4('0x1d')]()[_0x1ec4('0xc')](function(){_0x253a6e[_0x1ec4('0x15')](0xcc)[_0x1ec4('0x1e')]();});}};}function handleEntityNotFound(_0x2d2614){return function(_0x59e531){if(!_0x59e531){_0x2d2614['sendStatus'](0x194);}return _0x59e531;};}function handleError(_0x29fcd3,_0x1d53b6){_0x1d53b6=_0x1d53b6||0x1f4;return function(_0x2d2187){logger['error'](_0x2d2187[_0x1ec4('0x1f')]);if(_0x2d2187[_0x1ec4('0x20')]){delete _0x2d2187[_0x1ec4('0x20')];}_0x29fcd3[_0x1ec4('0x15')](_0x1d53b6)[_0x1ec4('0x21')](_0x2d2187);};}exports[_0x1ec4('0x22')]=function(_0x2323f3,_0x1e2bde){var _0x21a4a1={},_0x5085a7={},_0x57a960={'count':0x0,'rows':[]};var _0x31343c=_[_0x1ec4('0x23')](db[_0x1ec4('0x24')][_0x1ec4('0x25')],function(_0x341d24){return{'name':_0x341d24['fieldName'],'type':_0x341d24[_0x1ec4('0x26')][_0x1ec4('0x27')]};});_0x5085a7[_0x1ec4('0x28')]=_['map'](_0x31343c,'name');_0x5085a7[_0x1ec4('0x29')]=_[_0x1ec4('0x2a')](_0x2323f3[_0x1ec4('0x29')]);_0x5085a7[_0x1ec4('0x2b')]=_[_0x1ec4('0x2c')](_0x5085a7[_0x1ec4('0x28')],_0x5085a7[_0x1ec4('0x29')]);_0x21a4a1[_0x1ec4('0x2d')]=_['intersection'](_0x5085a7[_0x1ec4('0x28')],qs[_0x1ec4('0x2e')](_0x2323f3[_0x1ec4('0x29')][_0x1ec4('0x2e')]));_0x21a4a1['attributes']=_0x21a4a1[_0x1ec4('0x2d')][_0x1ec4('0x2f')]?_0x21a4a1[_0x1ec4('0x2d')]:_0x5085a7[_0x1ec4('0x28')];if(!_0x2323f3[_0x1ec4('0x29')][_0x1ec4('0x30')](_0x1ec4('0x31'))){_0x21a4a1[_0x1ec4('0x17')]=qs[_0x1ec4('0x17')](_0x2323f3[_0x1ec4('0x29')][_0x1ec4('0x17')]);_0x21a4a1[_0x1ec4('0x19')]=qs['offset'](_0x2323f3[_0x1ec4('0x29')]['offset']);}_0x21a4a1[_0x1ec4('0x32')]=qs[_0x1ec4('0x33')](_0x2323f3[_0x1ec4('0x29')][_0x1ec4('0x33')]);_0x21a4a1[_0x1ec4('0x34')]=qs[_0x1ec4('0x2b')](_['pick'](_0x2323f3[_0x1ec4('0x29')],_0x5085a7['filters']),_0x31343c);if(_0x2323f3[_0x1ec4('0x29')][_0x1ec4('0x35')]){_0x21a4a1[_0x1ec4('0x34')]=_['merge'](_0x21a4a1[_0x1ec4('0x34')],{'$or':_[_0x1ec4('0x23')](_0x31343c,function(_0x45d8a6){if(_0x45d8a6[_0x1ec4('0x26')]!==_0x1ec4('0x36')){var _0x4986f9={};_0x4986f9[_0x45d8a6[_0x1ec4('0x20')]]={'$like':'%'+_0x2323f3['query'][_0x1ec4('0x35')]+'%'};return _0x4986f9;}})});}_0x21a4a1=_[_0x1ec4('0x37')]({},_0x21a4a1,_0x2323f3[_0x1ec4('0x38')]);var _0x14cfc7={'where':_0x21a4a1['where']};return db[_0x1ec4('0x24')][_0x1ec4('0x18')](_0x14cfc7)[_0x1ec4('0xc')](function(_0x20ac5b){_0x57a960[_0x1ec4('0x18')]=_0x20ac5b;if(_0x2323f3[_0x1ec4('0x29')][_0x1ec4('0x39')]){_0x21a4a1['include']=[{'all':!![]}];}return db[_0x1ec4('0x24')][_0x1ec4('0x3a')](_0x21a4a1);})[_0x1ec4('0xc')](function(_0x5f404f){_0x57a960['rows']=_0x5f404f;return _0x57a960;})[_0x1ec4('0xc')](respondWithFilteredResult(_0x1e2bde,_0x21a4a1))[_0x1ec4('0x3b')](handleError(_0x1e2bde,null));};exports[_0x1ec4('0x3c')]=function(_0x58f140,_0x169d83){var _0x485db2={'raw':!![],'where':{'id':_0x58f140[_0x1ec4('0x3d')]['id']}},_0x5eeebc={};_0x5eeebc[_0x1ec4('0x28')]=_['keys'](db[_0x1ec4('0x24')][_0x1ec4('0x25')]);_0x5eeebc['query']=_[_0x1ec4('0x2a')](_0x58f140[_0x1ec4('0x29')]);_0x5eeebc['filters']=_[_0x1ec4('0x2c')](_0x5eeebc[_0x1ec4('0x28')],_0x5eeebc[_0x1ec4('0x29')]);_0x485db2[_0x1ec4('0x2d')]=_[_0x1ec4('0x2c')](_0x5eeebc['model'],qs[_0x1ec4('0x2e')](_0x58f140[_0x1ec4('0x29')][_0x1ec4('0x2e')]));_0x485db2[_0x1ec4('0x2d')]=_0x485db2[_0x1ec4('0x2d')]['length']?_0x485db2['attributes']:_0x5eeebc[_0x1ec4('0x28')];if(_0x58f140[_0x1ec4('0x29')]['includeAll']){_0x485db2['include']=[{'all':!![]}];}_0x485db2=_['merge']({},_0x485db2,_0x58f140[_0x1ec4('0x38')]);return db[_0x1ec4('0x24')][_0x1ec4('0x3e')](_0x485db2)[_0x1ec4('0xc')](handleEntityNotFound(_0x169d83,null))[_0x1ec4('0xc')](respondWithResult(_0x169d83,null))[_0x1ec4('0x3b')](handleError(_0x169d83,null));};exports[_0x1ec4('0x3f')]=function(_0x33aa3e,_0x4eebda){var _0x3c7a50;return db[_0x1ec4('0x24')]['create'](_0x33aa3e['body'],{'raw':!![]})['then'](function(_0x165f87){_0x3c7a50=_0x165f87;return db[_0x1ec4('0x24')][_0x1ec4('0x3a')]({'where':{'type':_0x33aa3e[_0x1ec4('0x40')][_0x1ec4('0x26')]},'raw':!![]});})[_0x1ec4('0xc')](function(_0x2b11f2){if(_0x3c7a50[_0x1ec4('0x26')][_0x1ec4('0x41')]()==_0x1ec4('0x42')){var _0x5c0157=fs[_0x1ec4('0x43')](path['join'](config['root'],_0x1ec4('0x44')),_0x1ec4('0x45'));var _0x41dbfe=ejs['render'](_0x5c0157,{'networks':_0x2b11f2||[]});fs['writeFileSync'](_0x1ec4('0x46'),_0x41dbfe);return respondWithRpcPromise(_0x1ec4('0x47'),'create',{'module':_0x1ec4('0x48')});}else if(_0x3c7a50[_0x1ec4('0x26')][_0x1ec4('0x41')]()==_0x1ec4('0x49')){var _0x280e60=fs[_0x1ec4('0x43')](path[_0x1ec4('0x4a')](config[_0x1ec4('0x4b')],_0x1ec4('0x4c')),_0x1ec4('0x45'));var _0x31974d=ejs[_0x1ec4('0x4d')](_0x280e60,{'networks':_0x2b11f2||[]});fs[_0x1ec4('0x4e')]('/etc/asterisk/turn_xcally.conf',_0x31974d);return respondWithRpcPromise(_0x1ec4('0x47'),_0x1ec4('0x3f'),{'module':_0x1ec4('0x48')});}else{var _0x23caf4=fs[_0x1ec4('0x43')](path[_0x1ec4('0x4a')](config[_0x1ec4('0x4b')],_0x1ec4('0x4f')),'utf8');var _0x39b09a=ejs[_0x1ec4('0x4d')](_0x23caf4,{'networks':_0x2b11f2||[]});fs[_0x1ec4('0x4e')](util[_0x1ec4('0x50')](_0x1ec4('0x51'),_0x33aa3e['body'][_0x1ec4('0x26')][_0x1ec4('0x52')]()),_0x39b09a);return respondWithRpcPromise(_0x1ec4('0x47'),'create',{'module':'chan_sip.so'});}})[_0x1ec4('0xc')](function(){return _0x3c7a50;})['then'](respondWithResult(_0x4eebda,0xc9))[_0x1ec4('0x3b')](handleError(_0x4eebda,null));};exports['update']=function(_0x40c178,_0x25a72c){var _0x9d855b;return db[_0x1ec4('0x24')][_0x1ec4('0x3e')]({'where':{'id':_0x40c178[_0x1ec4('0x3d')]['id']}})[_0x1ec4('0xc')](handleEntityNotFound(_0x25a72c,null))[_0x1ec4('0xc')](saveUpdates(_0x40c178['body'],null))[_0x1ec4('0xc')](function(_0x52ce79){if(_0x52ce79){_0x9d855b=_0x52ce79;return db[_0x1ec4('0x24')][_0x1ec4('0x3a')]({'where':{'type':_0x9d855b[_0x1ec4('0x26')]},'raw':!![]});}return null;})[_0x1ec4('0xc')](function(_0x389324){if(_0x9d855b[_0x1ec4('0x26')]['toUpperCase']()==_0x1ec4('0x42')){var _0x1024ac=fs[_0x1ec4('0x43')](path['join'](config[_0x1ec4('0x4b')],_0x1ec4('0x44')),_0x1ec4('0x45'));var _0xfec99b=ejs[_0x1ec4('0x4d')](_0x1024ac,{'networks':_0x389324||[]});fs['writeFileSync'](_0x1ec4('0x46'),_0xfec99b);return respondWithRpcPromise('Reload',_0x1ec4('0x53'),{'module':_0x1ec4('0x48')});}else if(_0x9d855b[_0x1ec4('0x26')][_0x1ec4('0x41')]()==_0x1ec4('0x49')){var _0x30556c=fs[_0x1ec4('0x43')](path[_0x1ec4('0x4a')](config[_0x1ec4('0x4b')],_0x1ec4('0x4c')),'utf8');var _0x388f7b=ejs[_0x1ec4('0x4d')](_0x30556c,{'networks':_0x389324||[]});fs[_0x1ec4('0x4e')](_0x1ec4('0x54'),_0x388f7b);return respondWithRpcPromise('Reload','update',{'module':_0x1ec4('0x48')});}else{var _0x575609=fs[_0x1ec4('0x43')](path[_0x1ec4('0x4a')](config[_0x1ec4('0x4b')],'server/files/templates/network.ejs'),_0x1ec4('0x45'));var _0x164d25=ejs[_0x1ec4('0x4d')](_0x575609,{'networks':_0x389324||[]});fs[_0x1ec4('0x4e')](util[_0x1ec4('0x50')](_0x1ec4('0x51'),_0x40c178[_0x1ec4('0x40')][_0x1ec4('0x26')][_0x1ec4('0x52')]()),_0x164d25);return respondWithRpcPromise(_0x1ec4('0x47'),'update',{'module':_0x1ec4('0x55')});}})['then'](function(_0x37bafa){if(_0x37bafa){return _0x9d855b;}return null;})[_0x1ec4('0xc')](respondWithResult(_0x25a72c,null))[_0x1ec4('0x3b')](handleError(_0x25a72c,null));};exports[_0x1ec4('0x1d')]=function(_0x29ae34,_0x3b0df3){var _0x2012ad;return db[_0x1ec4('0x24')][_0x1ec4('0x3e')]({'where':{'id':_0x29ae34['params']['id']}})['then'](function(_0xf5081a){_0x2012ad=_0xf5081a;return _0xf5081a;})[_0x1ec4('0xc')](handleEntityNotFound(_0x3b0df3,null))[_0x1ec4('0xc')](removeEntity(_0x3b0df3,null))[_0x1ec4('0xc')](function(){if(_0x2012ad){return db[_0x1ec4('0x24')][_0x1ec4('0x3a')]({'where':{'type':_0x2012ad[_0x1ec4('0x26')]},'raw':!![]});}})[_0x1ec4('0xc')](function(_0x249c45){if(_0x2012ad['type'][_0x1ec4('0x41')]()=='STUN'){var _0x2ddf26=fs[_0x1ec4('0x43')](path[_0x1ec4('0x4a')](config[_0x1ec4('0x4b')],_0x1ec4('0x44')),_0x1ec4('0x45'));var _0x48abcd=ejs[_0x1ec4('0x4d')](_0x2ddf26,{'networks':_0x249c45||[]});fs[_0x1ec4('0x4e')](_0x1ec4('0x46'),_0x48abcd);return respondWithRpcPromise(_0x1ec4('0x47'),_0x1ec4('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x2012ad['type'][_0x1ec4('0x41')]()==_0x1ec4('0x49')){var _0x4c1419=fs['readFileSync'](path['join'](config[_0x1ec4('0x4b')],_0x1ec4('0x4c')),_0x1ec4('0x45'));var _0x222201=ejs[_0x1ec4('0x4d')](_0x4c1419,{'networks':_0x249c45||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x222201);return respondWithRpcPromise(_0x1ec4('0x47'),_0x1ec4('0x1d'),{'module':_0x1ec4('0x48')});}else{var _0x133673=fs[_0x1ec4('0x43')](path[_0x1ec4('0x4a')](config[_0x1ec4('0x4b')],_0x1ec4('0x4f')),_0x1ec4('0x45'));var _0x10081a=ejs['render'](_0x133673,{'networks':_0x249c45||[]});fs[_0x1ec4('0x4e')](util['format'](_0x1ec4('0x51'),_0x2012ad[_0x1ec4('0x26')]['toLowerCase']()),_0x10081a);return respondWithRpcPromise(_0x1ec4('0x47'),_0x1ec4('0x1d'),{'module':'chan_sip.so'});}})[_0x1ec4('0x3b')](handleError(_0x3b0df3,null));}; \ No newline at end of file +var _0x154a=['find','create','body','toUpperCase','STUN','readFileSync','join','root','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/stun_multiple.ejs','format','toLowerCase','params','chan_sip.so','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','json','undefined','count','offset','limit','status','set','Content-Range','update','destroy','end','stack','name','send','index','map','Network','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x39e5d2,_0x5c44f8){var _0x2f0519=function(_0x5e5877){while(--_0x5e5877){_0x39e5d2['push'](_0x39e5d2['shift']());}};_0x2f0519(++_0x5c44f8);}(_0x154a,0x123));var _0xa154=function(_0x48a03c,_0x3282f8){_0x48a03c=_0x48a03c-0x0;var _0x5e9ac7=_0x154a[_0x48a03c];return _0x5e9ac7;};'use strict';var util=require(_0xa154('0x0'));var path=require(_0xa154('0x1'));var ejs=require(_0xa154('0x2'));var fs=require('fs');var _=require(_0xa154('0x3'));var qs=require(_0xa154('0x4'));var logger=require(_0xa154('0x5'))(_0xa154('0x6'));var config=require(_0xa154('0x7'));var db=require(_0xa154('0x8'))['db'];var jayson=require(_0xa154('0x9'));var client=jayson[_0xa154('0xa')][_0xa154('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490436,_0x24dab0,_0x2f0906,_0x389e7b){return new Promise(function(_0x5ec600,_0x2d8471){var _0x54678a=_0x389e7b||client;return _0x54678a[_0xa154('0xc')](_0x490436,_0x2f0906)[_0xa154('0xd')](function(_0x7bddfb){logger[_0xa154('0xe')](_0xa154('0xf'),_0x24dab0,_0xa154('0x10'));logger[_0xa154('0x11')](_0xa154('0x12'),_0x24dab0,_0xa154('0x10'),JSON['stringify'](_0x7bddfb));if(_0x7bddfb[_0xa154('0x13')]){if(_0x7bddfb[_0xa154('0x13')][_0xa154('0x14')]===0x1f4){logger[_0xa154('0x13')]('Network,\x20%s,\x20%s',_0x24dab0,_0x7bddfb[_0xa154('0x13')]['message']);return _0x2d8471(_0x7bddfb[_0xa154('0x13')][_0xa154('0x15')]);}logger[_0xa154('0x13')](_0xa154('0xf'),_0x24dab0,_0x7bddfb[_0xa154('0x13')][_0xa154('0x15')]);return _0x5ec600(_0x7bddfb[_0xa154('0x13')]['message']);}else{logger[_0xa154('0xe')](_0xa154('0xf'),_0x24dab0,_0xa154('0x10'));_0x5ec600(_0x7bddfb[_0xa154('0x16')]['message']);}})['catch'](function(_0x495a9b){logger[_0xa154('0x13')](_0xa154('0xf'),_0x24dab0,_0x495a9b);_0x2d8471(_0x495a9b);});});}function respondWithResult(_0xb9f102,_0x51c46d){_0x51c46d=_0x51c46d||0xc8;return function(_0x1448b0){if(_0x1448b0){return _0xb9f102['status'](_0x51c46d)[_0xa154('0x17')](_0x1448b0);}};}function respondWithFilteredResult(_0x286ab3,_0x23a1bf){return function(_0x48a4df){if(_0x48a4df){var _0x4e6a6d=typeof _0x23a1bf['offset']===_0xa154('0x18')&&typeof _0x23a1bf['limit']===_0xa154('0x18');var _0x55c8c1=_0x48a4df[_0xa154('0x19')];var _0x3c1ce5=_0x4e6a6d?0x0:_0x23a1bf[_0xa154('0x1a')];var _0x45422e=_0x4e6a6d?_0x48a4df[_0xa154('0x19')]:_0x23a1bf[_0xa154('0x1a')]+_0x23a1bf[_0xa154('0x1b')];var _0xf92caa;if(_0x45422e>=_0x55c8c1){_0x45422e=_0x55c8c1;_0xf92caa=0xc8;}else{_0xf92caa=0xce;}_0x286ab3[_0xa154('0x1c')](_0xf92caa);return _0x286ab3[_0xa154('0x1d')](_0xa154('0x1e'),_0x3c1ce5+'-'+_0x45422e+'/'+_0x55c8c1)[_0xa154('0x17')](_0x48a4df);}return null;};}function saveUpdates(_0x5c6561){return function(_0x409b87){if(_0x409b87){return _0x409b87[_0xa154('0x1f')](_0x5c6561)['then'](function(_0x9c4208){return _0x9c4208;});}return null;};}function removeEntity(_0x2a0e81){return function(_0x299223){if(_0x299223){return _0x299223[_0xa154('0x20')]()[_0xa154('0xd')](function(){_0x2a0e81[_0xa154('0x1c')](0xcc)[_0xa154('0x21')]();});}};}function handleEntityNotFound(_0x231712){return function(_0xb95e42){if(!_0xb95e42){_0x231712['sendStatus'](0x194);}return _0xb95e42;};}function handleError(_0x148d94,_0x390113){_0x390113=_0x390113||0x1f4;return function(_0x41a7ec){logger[_0xa154('0x13')](_0x41a7ec[_0xa154('0x22')]);if(_0x41a7ec[_0xa154('0x23')]){delete _0x41a7ec[_0xa154('0x23')];}_0x148d94['status'](_0x390113)[_0xa154('0x24')](_0x41a7ec);};}exports[_0xa154('0x25')]=function(_0xfb108b,_0x40e2a2){var _0x5b7e51={},_0x484b4f={},_0x2356f6={'count':0x0,'rows':[]};var _0x205dc2=_[_0xa154('0x26')](db[_0xa154('0x27')][_0xa154('0x28')],function(_0x35ff23){return{'name':_0x35ff23['fieldName'],'type':_0x35ff23['type'][_0xa154('0x29')]};});_0x484b4f[_0xa154('0x2a')]=_[_0xa154('0x26')](_0x205dc2,_0xa154('0x23'));_0x484b4f['query']=_[_0xa154('0x2b')](_0xfb108b[_0xa154('0x2c')]);_0x484b4f[_0xa154('0x2d')]=_[_0xa154('0x2e')](_0x484b4f[_0xa154('0x2a')],_0x484b4f[_0xa154('0x2c')]);_0x5b7e51[_0xa154('0x2f')]=_['intersection'](_0x484b4f[_0xa154('0x2a')],qs['fields'](_0xfb108b[_0xa154('0x2c')][_0xa154('0x30')]));_0x5b7e51[_0xa154('0x2f')]=_0x5b7e51[_0xa154('0x2f')][_0xa154('0x31')]?_0x5b7e51['attributes']:_0x484b4f['model'];if(!_0xfb108b[_0xa154('0x2c')][_0xa154('0x32')]('nolimit')){_0x5b7e51[_0xa154('0x1b')]=qs['limit'](_0xfb108b[_0xa154('0x2c')][_0xa154('0x1b')]);_0x5b7e51['offset']=qs[_0xa154('0x1a')](_0xfb108b['query']['offset']);}_0x5b7e51[_0xa154('0x33')]=qs[_0xa154('0x34')](_0xfb108b[_0xa154('0x2c')][_0xa154('0x34')]);_0x5b7e51[_0xa154('0x35')]=qs[_0xa154('0x2d')](_[_0xa154('0x36')](_0xfb108b['query'],_0x484b4f[_0xa154('0x2d')]),_0x205dc2);if(_0xfb108b[_0xa154('0x2c')]['filter']){_0x5b7e51[_0xa154('0x35')]=_['merge'](_0x5b7e51[_0xa154('0x35')],{'$or':_['map'](_0x205dc2,function(_0x569f81){if(_0x569f81[_0xa154('0x37')]!==_0xa154('0x38')){var _0x176708={};_0x176708[_0x569f81['name']]={'$like':'%'+_0xfb108b[_0xa154('0x2c')][_0xa154('0x39')]+'%'};return _0x176708;}})});}_0x5b7e51=_[_0xa154('0x3a')]({},_0x5b7e51,_0xfb108b[_0xa154('0x3b')]);var _0x37d895={'where':_0x5b7e51[_0xa154('0x35')]};return db[_0xa154('0x27')][_0xa154('0x19')](_0x37d895)[_0xa154('0xd')](function(_0x23bc26){_0x2356f6['count']=_0x23bc26;if(_0xfb108b['query'][_0xa154('0x3c')]){_0x5b7e51[_0xa154('0x3d')]=[{'all':!![]}];}return db[_0xa154('0x27')][_0xa154('0x3e')](_0x5b7e51);})[_0xa154('0xd')](function(_0x16e2f1){_0x2356f6[_0xa154('0x3f')]=_0x16e2f1;return _0x2356f6;})['then'](respondWithFilteredResult(_0x40e2a2,_0x5b7e51))[_0xa154('0x40')](handleError(_0x40e2a2,null));};exports['show']=function(_0x4ad40d,_0xfb5084){var _0x66f637={'raw':!![],'where':{'id':_0x4ad40d['params']['id']}},_0x49c5e6={};_0x49c5e6[_0xa154('0x2a')]=_[_0xa154('0x2b')](db[_0xa154('0x27')][_0xa154('0x28')]);_0x49c5e6[_0xa154('0x2c')]=_[_0xa154('0x2b')](_0x4ad40d[_0xa154('0x2c')]);_0x49c5e6['filters']=_['intersection'](_0x49c5e6[_0xa154('0x2a')],_0x49c5e6['query']);_0x66f637['attributes']=_[_0xa154('0x2e')](_0x49c5e6['model'],qs[_0xa154('0x30')](_0x4ad40d[_0xa154('0x2c')]['fields']));_0x66f637['attributes']=_0x66f637[_0xa154('0x2f')]['length']?_0x66f637['attributes']:_0x49c5e6['model'];if(_0x4ad40d[_0xa154('0x2c')][_0xa154('0x3c')]){_0x66f637[_0xa154('0x3d')]=[{'all':!![]}];}_0x66f637=_[_0xa154('0x3a')]({},_0x66f637,_0x4ad40d['options']);return db[_0xa154('0x27')][_0xa154('0x41')](_0x66f637)[_0xa154('0xd')](handleEntityNotFound(_0xfb5084,null))[_0xa154('0xd')](respondWithResult(_0xfb5084,null))['catch'](handleError(_0xfb5084,null));};exports[_0xa154('0x42')]=function(_0x1674e5,_0x830421){var _0x3a2b5c;return db[_0xa154('0x27')][_0xa154('0x42')](_0x1674e5[_0xa154('0x43')],{'raw':!![]})[_0xa154('0xd')](function(_0x1584d1){_0x3a2b5c=_0x1584d1;return db[_0xa154('0x27')][_0xa154('0x3e')]({'where':{'type':_0x1674e5[_0xa154('0x43')]['type']},'raw':!![]});})[_0xa154('0xd')](function(_0x329d1b){if(_0x3a2b5c[_0xa154('0x37')][_0xa154('0x44')]()==_0xa154('0x45')){var _0x27495c=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5076d2=ejs[_0xa154('0x49')](_0x27495c,{'networks':_0x329d1b||[]});fs[_0xa154('0x4a')](_0xa154('0x4b'),_0x5076d2);return respondWithRpcPromise('Reload',_0xa154('0x42'),{'module':_0xa154('0x4c')});}else if(_0x3a2b5c[_0xa154('0x37')]['toUpperCase']()==_0xa154('0x4d')){var _0x46e4a8=fs['readFileSync'](path[_0xa154('0x47')](config['root'],_0xa154('0x4e')),_0xa154('0x4f'));var _0x354e9b=ejs[_0xa154('0x49')](_0x46e4a8,{'networks':_0x329d1b||[]});fs[_0xa154('0x4a')](_0xa154('0x50'),_0x354e9b);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x42'),{'module':_0xa154('0x4c')});}else{var _0x2bf42b=fs['readFileSync'](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x52')),_0xa154('0x4f'));var _0x5422fc=ejs[_0xa154('0x49')](_0x2bf42b,{'networks':_0x329d1b||[]});fs['writeFileSync'](util['format'](_0xa154('0x53'),_0x1674e5[_0xa154('0x43')][_0xa154('0x37')]['toLowerCase']()),_0x5422fc);return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});}})[_0xa154('0xd')](function(){return _0x3a2b5c;})[_0xa154('0xd')](respondWithResult(_0x830421,0xc9))[_0xa154('0x40')](handleError(_0x830421,null));};exports['update']=function(_0x2db504,_0x12b81d){var _0x15b606;return db[_0xa154('0x27')]['find']({'where':{'id':_0x2db504['params']['id']}})[_0xa154('0xd')](handleEntityNotFound(_0x12b81d,null))['then'](saveUpdates(_0x2db504[_0xa154('0x43')],null))[_0xa154('0xd')](function(_0xdca907){if(_0xdca907){_0x15b606=_0xdca907;return db['Network'][_0xa154('0x3e')]({'where':{'type':_0x15b606[_0xa154('0x37')]},'raw':!![]});}return null;})[_0xa154('0xd')](function(_0x2fc9be){if(_0x15b606[_0xa154('0x37')][_0xa154('0x44')]()==_0xa154('0x45')){var _0x5e0a5e=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x54')),'utf8');var _0x56703e=ejs[_0xa154('0x49')](_0x5e0a5e,{'networks':_0x2fc9be||[]});fs[_0xa154('0x4a')](_0xa154('0x4b'),_0x56703e);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x1f'),{'module':_0xa154('0x4c')});}else if(_0x15b606[_0xa154('0x37')]['toUpperCase']()=='TURN'){var _0x3355b5=fs['readFileSync'](path[_0xa154('0x47')](config[_0xa154('0x48')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x49715d=ejs['render'](_0x3355b5,{'networks':_0x2fc9be||[]});fs['writeFileSync'](_0xa154('0x50'),_0x49715d);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x1f'),{'module':_0xa154('0x4c')});}else{var _0x26d33=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],'server/files/templates/network.ejs'),'utf8');var _0x3b7e4f=ejs[_0xa154('0x49')](_0x26d33,{'networks':_0x2fc9be||[]});fs[_0xa154('0x4a')](util[_0xa154('0x55')](_0xa154('0x53'),_0x2db504[_0xa154('0x43')][_0xa154('0x37')][_0xa154('0x56')]()),_0x3b7e4f);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x1f'),{'module':'chan_sip.so'});}})['then'](function(_0x1f0f22){if(_0x1f0f22){return _0x15b606;}return null;})[_0xa154('0xd')](respondWithResult(_0x12b81d,null))[_0xa154('0x40')](handleError(_0x12b81d,null));};exports['destroy']=function(_0x507331,_0x4a395d){var _0x24c554;return db[_0xa154('0x27')][_0xa154('0x41')]({'where':{'id':_0x507331[_0xa154('0x57')]['id']}})[_0xa154('0xd')](function(_0x36bb57){_0x24c554=_0x36bb57;return _0x36bb57;})[_0xa154('0xd')](handleEntityNotFound(_0x4a395d,null))[_0xa154('0xd')](removeEntity(_0x4a395d,null))['then'](function(){if(_0x24c554){return db[_0xa154('0x27')]['findAll']({'where':{'type':_0x24c554[_0xa154('0x37')]},'raw':!![]});}})[_0xa154('0xd')](function(_0x8f8537){if(_0x24c554[_0xa154('0x37')][_0xa154('0x44')]()==_0xa154('0x45')){var _0x292b55=fs['readFileSync'](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x54')),_0xa154('0x4f'));var _0x361ca1=ejs[_0xa154('0x49')](_0x292b55,{'networks':_0x8f8537||[]});fs[_0xa154('0x4a')](_0xa154('0x4b'),_0x361ca1);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x20'),{'module':_0xa154('0x4c')});}else if(_0x24c554['type']['toUpperCase']()==_0xa154('0x4d')){var _0x31c495=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x4e')),_0xa154('0x4f'));var _0x3f45fb=ejs[_0xa154('0x49')](_0x31c495,{'networks':_0x8f8537||[]});fs['writeFileSync'](_0xa154('0x50'),_0x3f45fb);return respondWithRpcPromise('Reload','destroy',{'module':_0xa154('0x4c')});}else{var _0x3ad458=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x52')),_0xa154('0x4f'));var _0x1c4df6=ejs[_0xa154('0x49')](_0x3ad458,{'networks':_0x8f8537||[]});fs['writeFileSync'](util[_0xa154('0x55')](_0xa154('0x53'),_0x24c554[_0xa154('0x37')]['toLowerCase']()),_0x1c4df6);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x20'),{'module':_0xa154('0x58')});}})[_0xa154('0x40')](handleError(_0x4a395d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 51a59db..1f25d34 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 _0x4522=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','../../config/logger','api','moment','request-promise'];(function(_0x163a54,_0x18e122){var _0x124e7c=function(_0x572e23){while(--_0x572e23){_0x163a54['push'](_0x163a54['shift']());}};_0x124e7c(++_0x18e122);}(_0x4522,0x1a0));var _0x2452=function(_0x466971,_0x4a7ab5){_0x466971=_0x466971-0x0;var _0x2800ae=_0x4522[_0x466971];return _0x2800ae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe644=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1b2779,_0x181d22){var _0x162929=function(_0x2d0083){while(--_0x2d0083){_0x1b2779['push'](_0x1b2779['shift']());}};_0x162929(++_0x181d22);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 1e561f1..bca745f 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f3fb1,_0x310bb5){var _0x5cd484=function(_0x519178){while(--_0x519178){_0x4f3fb1['push'](_0x4f3fb1['shift']());}};_0x5cd484(++_0x310bb5);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x48dd1f,_0x266ca2){_0x48dd1f=_0x48dd1f-0x0;var _0x262407=_0x7a54[_0x48dd1f];return _0x262407;};'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 c3ed62b..f6b26c5 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 _0xfe53=['show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4dbd82,_0x5eebc0){var _0x5b24ca=function(_0x509935){while(--_0x509935){_0x4dbd82['push'](_0x4dbd82['shift']());}};_0x5b24ca(++_0x5eebc0);}(_0xfe53,0x118));var _0x3fe5=function(_0x46d4af,_0x1f255e){_0x46d4af=_0x46d4af-0x0;var _0x3d7870=_0xfe53[_0x46d4af];return _0x3d7870;};'use strict';var multer=require(_0x3fe5('0x0'));var util=require('util');var path=require(_0x3fe5('0x1'));var timeout=require(_0x3fe5('0x2'));var express=require(_0x3fe5('0x3'));var router=express['Router']();var fs_extra=require(_0x3fe5('0x4'));var auth=require(_0x3fe5('0x5'));var interaction=require(_0x3fe5('0x6'));var config=require(_0x3fe5('0x7'));var controller=require(_0x3fe5('0x8'));router[_0x3fe5('0x9')]('/',auth[_0x3fe5('0xa')](),controller[_0x3fe5('0xb')]);router[_0x3fe5('0x9')](_0x3fe5('0xc'),auth['isAuthenticated'](),controller[_0x3fe5('0xd')]);router[_0x3fe5('0x9')]('/:id',auth[_0x3fe5('0xa')](),controller[_0x3fe5('0xe')]);router[_0x3fe5('0x9')](_0x3fe5('0xf'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x10')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3fe5('0x11')]);router[_0x3fe5('0x9')](_0x3fe5('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0x3fe5('0x9')](_0x3fe5('0x13'),auth['isAuthenticated'](),controller[_0x3fe5('0x14')]);router['get'](_0x3fe5('0x15'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x16')]);router['post']('/',auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x17')]);router[_0x3fe5('0x18')](_0x3fe5('0xf'),auth[_0x3fe5('0xa')](),controller['addDisposition']);router[_0x3fe5('0x18')](_0x3fe5('0x19'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x1a')]);router[_0x3fe5('0x18')](_0x3fe5('0x1b'),controller[_0x3fe5('0x1c')]);router[_0x3fe5('0x18')](_0x3fe5('0x12'),auth['isAuthenticated'](),controller[_0x3fe5('0x1d')]);router[_0x3fe5('0x18')](_0x3fe5('0x15'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x1e')]);router[_0x3fe5('0x18')](_0x3fe5('0x1f'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x20')]);router[_0x3fe5('0x21')](_0x3fe5('0x22'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x23')]);router[_0x3fe5('0x24')](_0x3fe5('0x22'),auth['isAuthenticated'](),controller[_0x3fe5('0x25')]);router['delete'](_0x3fe5('0xf'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x26')]);router[_0x3fe5('0x24')](_0x3fe5('0x19'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x27')]);router[_0x3fe5('0x24')](_0x3fe5('0x15'),auth[_0x3fe5('0xa')](),controller[_0x3fe5('0x28')]);module[_0x3fe5('0x29')]=router; \ No newline at end of file +var _0x295d=['send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send'];(function(_0x302791,_0x577e39){var _0x52b59a=function(_0x1349ba){while(--_0x1349ba){_0x302791['push'](_0x302791['shift']());}};_0x52b59a(++_0x577e39);}(_0x295d,0xb5));var _0xd295=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x295d[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xd295('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd295('0x1'));var express=require(_0xd295('0x2'));var router=express[_0xd295('0x3')]();var fs_extra=require(_0xd295('0x4'));var auth=require(_0xd295('0x5'));var interaction=require(_0xd295('0x6'));var config=require(_0xd295('0x7'));var controller=require('./openchannelAccount.controller');router[_0xd295('0x8')]('/',auth['isAuthenticated'](),controller[_0xd295('0x9')]);router[_0xd295('0x8')](_0xd295('0xa'),auth[_0xd295('0xb')](),controller[_0xd295('0xc')]);router[_0xd295('0x8')](_0xd295('0xd'),auth['isAuthenticated'](),controller[_0xd295('0xe')]);router[_0xd295('0x8')](_0xd295('0xf'),auth[_0xd295('0xb')](),controller[_0xd295('0x10')]);router['get']('/:id/canned_answers',auth[_0xd295('0xb')](),controller[_0xd295('0x11')]);router[_0xd295('0x8')](_0xd295('0x12'),auth[_0xd295('0xb')](),controller[_0xd295('0x13')]);router['get'](_0xd295('0x14'),auth[_0xd295('0xb')](),controller[_0xd295('0x15')]);router[_0xd295('0x8')](_0xd295('0x16'),auth['isAuthenticated'](),controller[_0xd295('0x17')]);router[_0xd295('0x18')]('/',auth[_0xd295('0xb')](),controller[_0xd295('0x19')]);router['post'](_0xd295('0xf'),auth[_0xd295('0xb')](),controller[_0xd295('0x1a')]);router[_0xd295('0x18')](_0xd295('0x1b'),auth[_0xd295('0xb')](),controller[_0xd295('0x1c')]);router[_0xd295('0x18')](_0xd295('0x1d'),controller[_0xd295('0x1e')]);router[_0xd295('0x18')](_0xd295('0x12'),auth['isAuthenticated'](),controller[_0xd295('0x1f')]);router[_0xd295('0x18')](_0xd295('0x16'),auth['isAuthenticated'](),controller[_0xd295('0x20')]);router['post'](_0xd295('0x21'),auth[_0xd295('0xb')](),controller[_0xd295('0x22')]);router[_0xd295('0x23')]('/:id',auth[_0xd295('0xb')](),controller[_0xd295('0x24')]);router[_0xd295('0x25')](_0xd295('0xd'),auth[_0xd295('0xb')](),controller[_0xd295('0x26')]);router['delete'](_0xd295('0xf'),auth[_0xd295('0xb')](),controller[_0xd295('0x27')]);router[_0xd295('0x25')](_0xd295('0x1b'),auth[_0xd295('0xb')](),controller[_0xd295('0x28')]);router[_0xd295('0x25')](_0xd295('0x16'),auth[_0xd295('0xb')](),controller[_0xd295('0x29')]);module[_0xd295('0x2a')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index dbd3de6..7a94273 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 _0xe701=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x5313fa,_0x7242c5){var _0x5bac88=function(_0x260150){while(--_0x260150){_0x5313fa['push'](_0x5313fa['shift']());}};_0x5bac88(++_0x7242c5);}(_0xe701,0xe7));var _0x1e70=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe701[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x1e70('0x0'));var rs=require('randomstring');module[_0x1e70('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x1e70('0x2')]},'token':{'type':Sequelize[_0x1e70('0x2')],'defaultValue':function(){return rs[_0x1e70('0x3')]();}},'replyUri':{'type':Sequelize[_0x1e70('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1e70('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1e70('0x4')],'defaultValue':function(){return _0x1e70('0x5');}},'notificationSound':{'type':Sequelize[_0x1e70('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1e70('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1e70('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1e70('0x2')]},'queueTransfer':{'type':Sequelize[_0x1e70('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e70('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1e70('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1e70('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x1e70('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1e70('0x9'),'set':function(_0x16a91a){if(!_0x16a91a)this[_0x1e70('0xa')](_0x1e70('0xb'),null);this[_0x1e70('0xa')](_0x1e70('0xc'),_0x16a91a);}}}; \ No newline at end of file +var _0xf9ad=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','randomstring','exports','name','STRING','BOOLEAN'];(function(_0x1427b8,_0x2a9484){var _0x3b0efd=function(_0x1e68db){while(--_0x1e68db){_0x1427b8['push'](_0x1427b8['shift']());}};_0x3b0efd(++_0x2a9484);}(_0xf9ad,0x150));var _0xdf9a=function(_0x4b9f7c,_0x371fd6){_0x4b9f7c=_0x4b9f7c-0x0;var _0x5e32f9=_0xf9ad[_0x4b9f7c];return _0x5e32f9;};'use strict';var Sequelize=require(_0xdf9a('0x0'));var rs=require(_0xdf9a('0x1'));module[_0xdf9a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xdf9a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdf9a('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xdf9a('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xdf9a('0x4')],'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[_0xdf9a('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xdf9a('0x4')]},'queueTransfer':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdf9a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf9a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdf9a('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xdf9a('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xec48ec){if(!_0xec48ec)this[_0xdf9a('0x8')]('mandatoryDispositionPauseId',null);this[_0xdf9a('0x8')]('mandatoryDisposition',_0xec48ec);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d4f0707..e867693 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 _0x89b2=['Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','send','updatedAt','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','OpenchannelAccount','includeAll','include','rows','show','params','length','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','CannedAnswer','nolimit','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','firstName','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','User','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','OpenchannelApplication','finally','getApplications','getInteractions','Contact','fullname','internal'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x89b2,0xc6));var _0x289b=function(_0x486f0b,_0x19a9b7){_0x486f0b=_0x486f0b-0x0;var _0x12ccaf=_0x89b2[_0x486f0b];return _0x12ccaf;};'use strict';var emlformat=require(_0x289b('0x0'));var rimraf=require(_0x289b('0x1'));var zipdir=require(_0x289b('0x2'));var jsonpatch=require(_0x289b('0x3'));var rp=require(_0x289b('0x4'));var moment=require(_0x289b('0x5'));var BPromise=require(_0x289b('0x6'));var Mustache=require(_0x289b('0x7'));var util=require(_0x289b('0x8'));var path=require(_0x289b('0x9'));var sox=require(_0x289b('0xa'));var csv=require(_0x289b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x289b('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x289b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x289b('0xe'));var Papa=require(_0x289b('0xf'));var Redis=require(_0x289b('0x10'));var authService=require(_0x289b('0x11'));var qs=require(_0x289b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x289b('0x13'));var logger=require('../../config/logger')(_0x289b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x289b('0x15'));var db=require(_0x289b('0x16'))['db'];config['redis']=_[_0x289b('0x17')](config['redis'],{'host':_0x289b('0x18'),'port':0x18eb});var socket=require(_0x289b('0x19'))(new Redis(config[_0x289b('0x1a')]));require(_0x289b('0x1b'))[_0x289b('0x1c')](socket);var jayson=require(_0x289b('0x1d'));var client=jayson[_0x289b('0x1e')][_0x289b('0x1f')]({'port':0x232c});var client9002=jayson[_0x289b('0x1e')][_0x289b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1a6807,_0x345a5f,_0x405a2c,_0x3a7c07){return new BPromise(function(_0x5e3dcd,_0x117ef9){var _0x1d36dd=_0x3a7c07||client;return _0x1d36dd[_0x289b('0x20')](_0x1a6807,_0x405a2c)[_0x289b('0x21')](function(_0x39ba6f){logger['info'](_0x289b('0x22'),_0x345a5f,_0x289b('0x23'));logger['debug'](_0x289b('0x24'),_0x345a5f,_0x289b('0x23'),JSON[_0x289b('0x25')](_0x39ba6f));if(_0x39ba6f[_0x289b('0x26')]){if(_0x39ba6f[_0x289b('0x26')][_0x289b('0x27')]===0x1f4){logger[_0x289b('0x26')](_0x289b('0x22'),_0x345a5f,_0x39ba6f[_0x289b('0x26')][_0x289b('0x28')]);return _0x117ef9(_0x39ba6f[_0x289b('0x26')][_0x289b('0x28')]);}logger[_0x289b('0x26')](_0x289b('0x22'),_0x345a5f,_0x39ba6f['error'][_0x289b('0x28')]);return _0x5e3dcd(_0x39ba6f['error']['message']);}else{logger[_0x289b('0x29')](_0x289b('0x22'),_0x345a5f,_0x289b('0x23'));_0x5e3dcd(_0x39ba6f['result'][_0x289b('0x28')]);}})[_0x289b('0x2a')](function(_0x51c0c0){logger[_0x289b('0x26')](_0x289b('0x22'),_0x345a5f,_0x51c0c0);_0x117ef9(_0x51c0c0);});});}function respondWithStatusCode(_0x58b6fa,_0x5d8a23){_0x5d8a23=_0x5d8a23||0xcc;return function(_0x24a37f){if(_0x24a37f){return _0x58b6fa[_0x289b('0x2b')](_0x5d8a23);}return _0x58b6fa[_0x289b('0x2c')](_0x5d8a23)[_0x289b('0x2d')]();};}function respondWithResult(_0x3fa519,_0x3e63b5){_0x3e63b5=_0x3e63b5||0xc8;return function(_0x2fdaeb){if(_0x2fdaeb){return _0x3fa519[_0x289b('0x2c')](_0x3e63b5)[_0x289b('0x2e')](_0x2fdaeb);}};}function respondWithFilteredResult(_0x5958da,_0x7b8fd0){return function(_0x4ceaec){if(_0x4ceaec){var _0x598002=typeof _0x7b8fd0['offset']===_0x289b('0x2f')&&typeof _0x7b8fd0[_0x289b('0x30')]===_0x289b('0x2f');var _0x10fc50=_0x4ceaec[_0x289b('0x31')];var _0x271aa8=_0x598002?0x0:_0x7b8fd0[_0x289b('0x32')];var _0xca1604=_0x598002?_0x4ceaec[_0x289b('0x31')]:_0x7b8fd0[_0x289b('0x32')]+_0x7b8fd0['limit'];var _0x94c5a5;if(_0xca1604>=_0x10fc50){_0xca1604=_0x10fc50;_0x94c5a5=0xc8;}else{_0x94c5a5=0xce;}_0x5958da[_0x289b('0x2c')](_0x94c5a5);return _0x5958da[_0x289b('0x33')]('Content-Range',_0x271aa8+'-'+_0xca1604+'/'+_0x10fc50)[_0x289b('0x2e')](_0x4ceaec);}return null;};}function patchUpdates(_0xcfa83e){return function(_0x42f535){try{jsonpatch[_0x289b('0x34')](_0x42f535,_0xcfa83e,!![]);}catch(_0x4e7d64){return BPromise[_0x289b('0x35')](_0x4e7d64);}return _0x42f535[_0x289b('0x36')]();};}function saveUpdates(_0x24f8b6,_0x199609){return function(_0x1444f2){if(_0x1444f2){return _0x1444f2[_0x289b('0x37')](_0x24f8b6)[_0x289b('0x21')](function(_0x173ec3){return _0x173ec3;});}return null;};}function removeEntity(_0x3c031e,_0x55289d){return function(_0x1dcd42){if(_0x1dcd42){return _0x1dcd42[_0x289b('0x38')]()['then'](function(){var _0x5d4c9d=_0x1dcd42[_0x289b('0x39')]({'plain':!![]});var _0x18dd30='OpenchannelAccounts';return db[_0x289b('0x3a')][_0x289b('0x38')]({'where':{'type':_0x18dd30,'resourceId':_0x5d4c9d['id']}})[_0x289b('0x21')](function(){return _0x1dcd42;});})['then'](function(){_0x3c031e['status'](0xcc)[_0x289b('0x2d')]();});}};}function handleEntityNotFound(_0xcf9121,_0x27c9bf){return function(_0x428d11){if(!_0x428d11){_0xcf9121[_0x289b('0x2b')](0x194);}return _0x428d11;};}function handleError(_0x47ea18,_0x17596f){_0x17596f=_0x17596f||0x1f4;return function(_0x3a76e5){logger[_0x289b('0x26')](_0x3a76e5[_0x289b('0x3b')]);if(_0x3a76e5[_0x289b('0x3c')]){delete _0x3a76e5[_0x289b('0x3c')];}_0x47ea18[_0x289b('0x2c')](_0x17596f)['send'](_0x3a76e5);};}exports['index']=function(_0x55d195,_0x37a4d1){var _0x25ffab={'include':[{'model':db[_0x289b('0x3d')],'as':_0x289b('0x3e')}]},_0x15090a={},_0x39b472={'count':0x0,'rows':[]};var _0x20c064=_['map'](db['OpenchannelAccount'][_0x289b('0x3f')],function(_0x353de1){return{'name':_0x353de1[_0x289b('0x40')],'type':_0x353de1[_0x289b('0x41')][_0x289b('0x42')]};});_0x15090a[_0x289b('0x43')]=_['map'](_0x20c064,_0x289b('0x3c'));_0x15090a[_0x289b('0x44')]=_[_0x289b('0x45')](_0x55d195[_0x289b('0x44')]);_0x15090a['filters']=_[_0x289b('0x46')](_0x15090a['model'],_0x15090a[_0x289b('0x44')]);_0x25ffab[_0x289b('0x47')]=_['intersection'](_0x15090a[_0x289b('0x43')],qs[_0x289b('0x48')](_0x55d195['query'][_0x289b('0x48')]));_0x25ffab[_0x289b('0x47')]=_0x25ffab[_0x289b('0x47')]['length']?_0x25ffab[_0x289b('0x47')]:_0x15090a[_0x289b('0x43')];if(!_0x55d195[_0x289b('0x44')][_0x289b('0x49')]('nolimit')){_0x25ffab[_0x289b('0x30')]=qs[_0x289b('0x30')](_0x55d195['query'][_0x289b('0x30')]);_0x25ffab['offset']=qs[_0x289b('0x32')](_0x55d195[_0x289b('0x44')]['offset']);}_0x25ffab[_0x289b('0x4a')]=qs['sort'](_0x55d195[_0x289b('0x44')][_0x289b('0x4b')]);_0x25ffab[_0x289b('0x4c')]=qs['filters'](_[_0x289b('0x4d')](_0x55d195[_0x289b('0x44')],_0x15090a[_0x289b('0x4e')]),_0x20c064);if(_0x55d195[_0x289b('0x44')][_0x289b('0x4f')]){_0x25ffab[_0x289b('0x4c')]=_[_0x289b('0x50')](_0x25ffab[_0x289b('0x4c')],{'$or':_[_0x289b('0x51')](_0x20c064,function(_0x3fab7){if(_0x3fab7[_0x289b('0x41')]!==_0x289b('0x52')){var _0x141abe={};_0x141abe[_0x3fab7[_0x289b('0x3c')]]={'$like':'%'+_0x55d195['query'][_0x289b('0x4f')]+'%'};return _0x141abe;}})});}_0x25ffab=_[_0x289b('0x50')]({},_0x25ffab,_0x55d195['options']);var _0x1f5086={'where':_0x25ffab[_0x289b('0x4c')]};return db[_0x289b('0x53')][_0x289b('0x31')](_0x1f5086)['then'](function(_0x4d9759){_0x39b472[_0x289b('0x31')]=_0x4d9759;if(_0x55d195[_0x289b('0x44')][_0x289b('0x54')]){_0x25ffab[_0x289b('0x55')]=[{'all':!![]}];}return db[_0x289b('0x53')]['findAll'](_0x25ffab);})['then'](function(_0x14e4f4){_0x39b472[_0x289b('0x56')]=_0x14e4f4;return _0x39b472;})[_0x289b('0x21')](respondWithFilteredResult(_0x37a4d1,_0x25ffab))[_0x289b('0x2a')](handleError(_0x37a4d1,null));};exports[_0x289b('0x57')]=function(_0x30fe9d,_0x241ac7){var _0x3ab297={'raw':![],'where':{'id':_0x30fe9d[_0x289b('0x58')]['id']},'include':[{'model':db[_0x289b('0x3d')],'as':_0x289b('0x3e')}]},_0x47736a={};_0x47736a[_0x289b('0x43')]=_[_0x289b('0x45')](db[_0x289b('0x53')]['rawAttributes']);_0x47736a[_0x289b('0x44')]=_[_0x289b('0x45')](_0x30fe9d[_0x289b('0x44')]);_0x47736a[_0x289b('0x4e')]=_[_0x289b('0x46')](_0x47736a[_0x289b('0x43')],_0x47736a['query']);_0x3ab297[_0x289b('0x47')]=_['intersection'](_0x47736a['model'],qs['fields'](_0x30fe9d[_0x289b('0x44')]['fields']));_0x3ab297['attributes']=_0x3ab297[_0x289b('0x47')][_0x289b('0x59')]?_0x3ab297['attributes']:_0x47736a[_0x289b('0x43')];if(_0x30fe9d['query'][_0x289b('0x54')]){_0x3ab297[_0x289b('0x55')]=[{'all':!![]}];}_0x3ab297=_[_0x289b('0x50')]({},_0x3ab297,_0x30fe9d[_0x289b('0x5a')]);return db[_0x289b('0x53')][_0x289b('0x5b')](_0x3ab297)[_0x289b('0x21')](handleEntityNotFound(_0x241ac7,null))[_0x289b('0x21')](respondWithResult(_0x241ac7,null))[_0x289b('0x2a')](handleError(_0x241ac7,null));};exports['create']=function(_0x1db13c,_0x3a3a3b){return db[_0x289b('0x53')][_0x289b('0x5c')](_0x1db13c['body'],{})[_0x289b('0x21')](function(_0x3448e0){var _0x38a278=_0x1db13c[_0x289b('0x5d')][_0x289b('0x39')]({'plain':!![]});if(!_0x38a278)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38a278[_0x289b('0x5e')]===_0x289b('0x5d')){var _0x322c7d=_0x3448e0[_0x289b('0x39')]({'plain':!![]});var _0x5a1a8e='OpenchannelAccounts';return db[_0x289b('0x5f')]['find']({'where':{'name':_0x5a1a8e,'userProfileId':_0x38a278[_0x289b('0x60')]},'raw':!![]})[_0x289b('0x21')](function(_0x45498e){if(_0x45498e&&_0x45498e[_0x289b('0x61')]===0x0){return db['UserProfileResource'][_0x289b('0x5c')]({'name':_0x322c7d[_0x289b('0x3c')],'resourceId':_0x322c7d['id'],'type':_0x45498e[_0x289b('0x3c')],'sectionId':_0x45498e['id']},{})[_0x289b('0x21')](function(){return _0x3448e0;});}else{return _0x3448e0;}})[_0x289b('0x2a')](function(_0x34abe4){logger[_0x289b('0x26')](_0x289b('0x62'),_0x34abe4);throw _0x34abe4;});}return _0x3448e0;})[_0x289b('0x21')](respondWithResult(_0x3a3a3b,0xc9))['catch'](handleError(_0x3a3a3b,null));};exports[_0x289b('0x37')]=function(_0x48bf52,_0x1edc52){if(_0x48bf52[_0x289b('0x63')]['id']){delete _0x48bf52[_0x289b('0x63')]['id'];}return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x48bf52[_0x289b('0x58')]['id']},'include':[{'model':db[_0x289b('0x3d')],'as':_0x289b('0x3e')}]})[_0x289b('0x21')](handleEntityNotFound(_0x1edc52,null))[_0x289b('0x21')](saveUpdates(_0x48bf52['body'],null))[_0x289b('0x21')](respondWithResult(_0x1edc52,null))[_0x289b('0x2a')](handleError(_0x1edc52,null));};exports['destroy']=function(_0x28e003,_0x146df6){return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x28e003['params']['id']}})['then'](handleEntityNotFound(_0x146df6,null))[_0x289b('0x21')](removeEntity(_0x146df6,null))[_0x289b('0x2a')](handleError(_0x146df6,null));};exports[_0x289b('0x64')]=function(_0xd3cf71,_0x3ca4b0){return db['OpenchannelAccount'][_0x289b('0x64')]()[_0x289b('0x21')](respondWithResult(_0x3ca4b0,null))[_0x289b('0x2a')](handleError(_0x3ca4b0,null));};exports[_0x289b('0x65')]=function(_0x2b1f10,_0x579a70,_0x51110a){if(_0x2b1f10['body']['id']){delete _0x2b1f10[_0x289b('0x63')]['id'];}return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x2b1f10[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x579a70,null))['then'](function(_0x412a4e){if(_0x412a4e){_0x2b1f10[_0x289b('0x63')][_0x289b('0x66')]=_0x412a4e['id'];return db[_0x289b('0x67')][_0x289b('0x5c')](_0x2b1f10['body']);}})['then'](respondWithResult(_0x579a70,null))[_0x289b('0x2a')](handleError(_0x579a70,null));};exports[_0x289b('0x68')]=function(_0xddb5de,_0x314eca,_0x332ebb){var _0x50dcdb={'raw':![],'where':{}};var _0x5234f6={};var _0x2551f8={'count':0x0,'rows':[]};return db[_0x289b('0x53')][_0x289b('0x69')]({'where':{'id':_0xddb5de[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x314eca,null))[_0x289b('0x21')](function(_0x560056){if(_0x560056){_0x5234f6[_0x289b('0x43')]=_[_0x289b('0x45')](db[_0x289b('0x67')]['rawAttributes']);_0x5234f6[_0x289b('0x44')]=_['keys'](_0xddb5de[_0x289b('0x44')]);_0x5234f6[_0x289b('0x4e')]=_[_0x289b('0x46')](_0x5234f6[_0x289b('0x43')],_0x5234f6[_0x289b('0x44')]);_0x50dcdb[_0x289b('0x47')]=_['intersection'](_0x5234f6[_0x289b('0x43')],qs[_0x289b('0x48')](_0xddb5de[_0x289b('0x44')]['fields']));_0x50dcdb[_0x289b('0x47')]=_0x50dcdb[_0x289b('0x47')][_0x289b('0x59')]?_0x50dcdb['attributes']:_0x5234f6[_0x289b('0x43')];if(!_0xddb5de[_0x289b('0x44')][_0x289b('0x49')]('nolimit')){_0x50dcdb[_0x289b('0x30')]=qs[_0x289b('0x30')](_0xddb5de[_0x289b('0x44')][_0x289b('0x30')]);_0x50dcdb[_0x289b('0x32')]=qs['offset'](_0xddb5de[_0x289b('0x44')][_0x289b('0x32')]);}_0x50dcdb[_0x289b('0x4a')]=qs[_0x289b('0x4b')](_0xddb5de[_0x289b('0x44')][_0x289b('0x4b')]);_0x50dcdb['where']=qs[_0x289b('0x4e')](_[_0x289b('0x4d')](_0xddb5de['query'],_0x5234f6[_0x289b('0x4e')]));_0x50dcdb[_0x289b('0x4c')][_0x289b('0x66')]=_0x560056['id'];if(_0xddb5de[_0x289b('0x44')]['filter']){_0x50dcdb[_0x289b('0x4c')]=_[_0x289b('0x50')](_0x50dcdb['where'],{'$or':_[_0x289b('0x51')](_0x50dcdb[_0x289b('0x47')],function(_0x52a8bf){var _0x48d129={};_0x48d129[_0x52a8bf]={'$like':'%'+_0xddb5de['query'][_0x289b('0x4f')]+'%'};return _0x48d129;})});}_0x50dcdb=_[_0x289b('0x50')]({},_0x50dcdb,_0xddb5de[_0x289b('0x5a')]);return db[_0x289b('0x67')]['count']({'where':_0x50dcdb[_0x289b('0x4c')]})[_0x289b('0x21')](function(_0x277647){_0x2551f8[_0x289b('0x31')]=_0x277647;if(_0xddb5de[_0x289b('0x44')][_0x289b('0x54')]){_0x50dcdb['include']=[{'all':!![]}];}return db[_0x289b('0x67')][_0x289b('0x6a')](_0x50dcdb);})[_0x289b('0x21')](function(_0x1fa0ec){_0x2551f8[_0x289b('0x56')]=_0x1fa0ec;return _0x2551f8;});}})[_0x289b('0x21')](respondWithFilteredResult(_0x314eca,_0x50dcdb))['catch'](handleError(_0x314eca,null));};exports['removeDispositions']=function(_0x5afc98,_0x466de8,_0x4e5aa9){return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x5afc98['params']['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x466de8,null))['then'](function(_0x1e5066){if(_0x1e5066){return _0x1e5066[_0x289b('0x6b')](_0x5afc98[_0x289b('0x44')][_0x289b('0x6c')]);}})['then'](respondWithStatusCode(_0x466de8,null))[_0x289b('0x2a')](handleError(_0x466de8,null));};exports['addAnswer']=function(_0x27602a,_0x3ad774,_0x484d70){if(_0x27602a['body']['id']){delete _0x27602a[_0x289b('0x63')]['id'];}return db[_0x289b('0x53')]['find']({'where':{'id':_0x27602a[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x3ad774,null))['then'](function(_0x559c91){if(_0x559c91){_0x27602a[_0x289b('0x63')][_0x289b('0x66')]=_0x559c91['id'];return db[_0x289b('0x6d')][_0x289b('0x5c')](_0x27602a[_0x289b('0x63')]);}})[_0x289b('0x21')](respondWithResult(_0x3ad774,null))[_0x289b('0x2a')](handleError(_0x3ad774,null));};exports['getAnswers']=function(_0x17f15c,_0x1ae101,_0x110bad){var _0x279c90={'raw':![],'where':{}};var _0x42128b={};var _0x4ee7d0={'count':0x0,'rows':[]};return db[_0x289b('0x53')][_0x289b('0x69')]({'where':{'id':_0x17f15c['params']['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x1ae101,null))[_0x289b('0x21')](function(_0x524e8c){if(_0x524e8c){_0x42128b['model']=_[_0x289b('0x45')](db[_0x289b('0x6d')][_0x289b('0x3f')]);_0x42128b['query']=_[_0x289b('0x45')](_0x17f15c[_0x289b('0x44')]);_0x42128b['filters']=_[_0x289b('0x46')](_0x42128b[_0x289b('0x43')],_0x42128b[_0x289b('0x44')]);_0x279c90[_0x289b('0x47')]=_[_0x289b('0x46')](_0x42128b[_0x289b('0x43')],qs['fields'](_0x17f15c['query'][_0x289b('0x48')]));_0x279c90[_0x289b('0x47')]=_0x279c90[_0x289b('0x47')][_0x289b('0x59')]?_0x279c90[_0x289b('0x47')]:_0x42128b['model'];if(!_0x17f15c[_0x289b('0x44')]['hasOwnProperty'](_0x289b('0x6e'))){_0x279c90['limit']=qs[_0x289b('0x30')](_0x17f15c[_0x289b('0x44')][_0x289b('0x30')]);_0x279c90['offset']=qs['offset'](_0x17f15c[_0x289b('0x44')][_0x289b('0x32')]);}_0x279c90[_0x289b('0x4a')]=qs['sort'](_0x17f15c[_0x289b('0x44')][_0x289b('0x4b')]);_0x279c90[_0x289b('0x4c')]=qs[_0x289b('0x4e')](_['pick'](_0x17f15c['query'],_0x42128b['filters']));_0x279c90[_0x289b('0x4c')][_0x289b('0x66')]=_0x524e8c['id'];if(_0x17f15c[_0x289b('0x44')][_0x289b('0x4f')]){_0x279c90['where']=_['merge'](_0x279c90[_0x289b('0x4c')],{'$or':_['map'](_0x279c90[_0x289b('0x47')],function(_0x43514b){var _0x53ff05={};_0x53ff05[_0x43514b]={'$like':'%'+_0x17f15c['query'][_0x289b('0x4f')]+'%'};return _0x53ff05;})});}_0x279c90=_[_0x289b('0x50')]({},_0x279c90,_0x17f15c[_0x289b('0x5a')]);return db[_0x289b('0x6d')][_0x289b('0x31')]({'where':_0x279c90[_0x289b('0x4c')]})['then'](function(_0x18e58d){_0x4ee7d0['count']=_0x18e58d;if(_0x17f15c['query']['includeAll']){_0x279c90['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x289b('0x6a')](_0x279c90);})[_0x289b('0x21')](function(_0xc82e72){_0x4ee7d0[_0x289b('0x56')]=_0xc82e72;return _0x4ee7d0;});}})[_0x289b('0x21')](respondWithFilteredResult(_0x1ae101,_0x279c90))[_0x289b('0x2a')](handleError(_0x1ae101,null));};exports['removeAnswers']=function(_0x1bae6f,_0x4ef426,_0x32c505){return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x1bae6f[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x4ef426,null))[_0x289b('0x21')](function(_0x44f777){if(_0x44f777){return _0x44f777[_0x289b('0x6f')](_0x1bae6f[_0x289b('0x44')][_0x289b('0x6c')]);}})[_0x289b('0x21')](respondWithStatusCode(_0x4ef426,null))['catch'](handleError(_0x4ef426,null));};exports[_0x289b('0x70')]=function(_0x3d764e,_0x139c4c,_0x3d1eb2){var _0x1b96e5={'body':_0x3d764e['body'],'channel':_0x289b('0x71')};var _0x2a2596=[];var _0x2592a2=[];var _0xa01544={};var _0x5b690f=![];return db[_0x289b('0x72')][_0x289b('0x64')]()['then'](function(_0xe93d96){if(!_0xe93d96){throw new db[(_0x289b('0x73'))][(_0x289b('0x74'))]('no\x20available\x20attributes');}_0x2a2596=_[_0x289b('0x75')](_[_0x289b('0x45')](_0xe93d96),[_0x289b('0x76'),'updatedAt']);_0x2592a2=_[_0x289b('0x75')](_[_0x289b('0x45')](_0xe93d96),['createdAt','updatedAt',_0x289b('0x77'),_0x289b('0x78')]);if(_0x3d764e[_0x289b('0x63')]['id']){delete _0x3d764e[_0x289b('0x63')]['id'];}if(_[_0x289b('0x79')](_0x3d764e['body'][_0x289b('0x7a')])){throw new db['Sequelize'][(_0x289b('0x74'))]('from\x20is\x20mandatory');}if(_[_0x289b('0x79')](_0x3d764e[_0x289b('0x63')][_0x289b('0x63')])||_0x3d764e['body'][_0x289b('0x63')]===''){throw new db[(_0x289b('0x73'))]['ValidationError'](_0x289b('0x7b'));}if(_[_0x289b('0x79')](_0x3d764e[_0x289b('0x63')][_0x289b('0x7c')])){throw new db[(_0x289b('0x73'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2592a2);}if(!_[_0x289b('0x7d')](_0x2592a2,_0x3d764e[_0x289b('0x63')]['mapKey'])){throw new db[(_0x289b('0x73'))][(_0x289b('0x74'))](_0x289b('0x7e')+_0x2592a2);}_0xa01544[_0x3d764e[_0x289b('0x63')][_0x289b('0x7c')]]=_0x3d764e['body']['from'];})[_0x289b('0x21')](function(){return db[_0x289b('0x53')]['find']({'where':{'id':_0x3d764e[_0x289b('0x58')]['id']},'include':[{'model':db[_0x289b('0x7f')],'as':_0x289b('0x80'),'include':[{'model':db[_0x289b('0x72')],'as':_0x289b('0x81'),'where':_0xa01544,'limit':0x1,'order':[['updatedAt',_0x289b('0x82')]]}]},{'model':db['OpenchannelApplication'],'as':_0x289b('0x83')}]});})[_0x289b('0x21')](handleEntityNotFound(_0x139c4c,null))[_0x289b('0x21')](function(_0x234ff8){if(_0x234ff8&&_0x234ff8['List']){_0x1b96e5[_0x289b('0x84')]=_0x234ff8;_0x1b96e5[_0x289b('0x85')]=_0x234ff8[_0x289b('0x83')];_0x1b96e5[_0x289b('0x86')]=_0x234ff8[_0x289b('0x80')];_0x1b96e5['applications']=_[_0x289b('0x87')](_0x1b96e5['applications'],[_0x289b('0x88')],[_0x289b('0x89')]);if(_0x1b96e5[_0x289b('0x84')][_0x289b('0x83')]){delete _0x1b96e5[_0x289b('0x84')][_0x289b('0x83')];}if(_0x1b96e5[_0x289b('0x84')][_0x289b('0x80')]&&_0x1b96e5[_0x289b('0x84')][_0x289b('0x80')][_0x289b('0x81')]['length']){return _0x1b96e5[_0x289b('0x84')][_0x289b('0x80')]['Contacts'][0x0];}var _0x159e0c=_[_0x289b('0x17')](_0x3d764e['body'],{'firstName':_0x3d764e['body'][_0x289b('0x7a')],'ListId':_0x234ff8[_0x289b('0x78')]});_0x159e0c[_0x3d764e[_0x289b('0x63')][_0x289b('0x7c')]]=_0x3d764e[_0x289b('0x63')][_0x289b('0x7a')];return db[_0x289b('0x72')][_0x289b('0x5c')](_0x159e0c,{'fields':_0x2a2596,'raw':!![]});}})[_0x289b('0x21')](handleEntityNotFound(_0x139c4c,null))[_0x289b('0x21')](function(_0x107930){_0x1b96e5['contact']=_0x107930;if(_0x107930){var _0x237d43={'ContactId':_0x107930['id'],'OpenchannelAccountId':_0x3d764e[_0x289b('0x58')]['id'],'from':(_0x107930['firstName']||'')+'\x20'+(_0x107930[_0x289b('0x8a')]||'')};var _0x158b71={'OpenchannelAccountId':_0x3d764e[_0x289b('0x58')]['id'],'closed':![]};if(_0x3d764e['body'][_0x289b('0x8b')]){_0x158b71[_0x289b('0x8b')]=_0x3d764e[_0x289b('0x63')]['threadId'];return db[_0x289b('0x8c')][_0x289b('0x5b')]({'where':_0x158b71})[_0x289b('0x21')](function(_0x2017d8){if(_0x2017d8){return[_0x2017d8,![]];}_0x237d43[_0x289b('0x8b')]=_0x3d764e['body'][_0x289b('0x8b')];_0x237d43[_0x289b('0x8d')]=_0x3d764e[_0x289b('0x63')][_0x289b('0x8d')];return db[_0x289b('0x8c')][_0x289b('0x5c')](_0x237d43)['then'](function(_0x15e242){return[_0x15e242,!![]];});});}else{_0x158b71[_0x289b('0x8b')]=null;}_0x158b71[_0x289b('0x8e')]=_0x107930['id'];return db[_0x289b('0x8c')][_0x289b('0x5b')]({'where':_0x158b71})[_0x289b('0x21')](function(_0x38d25b){if(_0x38d25b){return[_0x38d25b,![]];}return db['OpenchannelInteraction']['create'](_0x237d43)[_0x289b('0x21')](function(_0x2872ff){return[_0x2872ff,!![]];});});}})['spread'](function(_0x4cb784,_0x33c7b2){if(_0x4cb784){_0x5b690f=_0x33c7b2;if(!_0x33c7b2){var _0x31ca63={'from':(_0x1b96e5[_0x289b('0x8f')][_0x289b('0x90')]||'')+'\x20'+(_0x1b96e5[_0x289b('0x8f')][_0x289b('0x8a')]||'')};if(_0x3d764e[_0x289b('0x63')][_0x289b('0x8b')]&&_0x3d764e[_0x289b('0x63')][_0x289b('0x91')]&&_0x3d764e[_0x289b('0x63')][_0x289b('0x8b')]!=_0x3d764e['body']['messageId']){_0x31ca63['threadId']=_0x3d764e[_0x289b('0x63')][_0x289b('0x91')];}return _0x4cb784['update'](_0x31ca63);}else{return _0x4cb784;}}})[_0x289b('0x21')](function(_0x2c2913){_0x1b96e5[_0x289b('0x92')]=_0x2c2913[_0x289b('0x39')]({'plain':!![]});_0x1b96e5[_0x289b('0x92')]['created']=_0x5b690f;if(_0x1b96e5[_0x289b('0x92')][_0x289b('0x93')]){if(_0x1b96e5[_0x289b('0x84')]['autoclose']){_0x1b96e5['applications'][_0x289b('0x94')]({'id':0x0,'priority':_0x1b96e5['applications']['length']+0x1,'app':_0x289b('0x95'),'appdata':'unmanaged','interval':_0x289b('0x96')});}}return db[_0x289b('0x97')]['create']({'body':_0x3d764e['body']['body'],'OpenchannelAccountId':_0x3d764e[_0x289b('0x58')]['id'],'OpenchannelInteractionId':_0x2c2913['id'],'direction':'in','ContactId':_0x1b96e5[_0x289b('0x8f')]['id'],'AttachmentId':_0x3d764e[_0x289b('0x63')]['AttachmentId']});})[_0x289b('0x21')](function(_0x1a788c){_0x1b96e5[_0x289b('0x28')]=_0x1a788c;if(_0x1b96e5['interaction']['UserId']){return db[_0x289b('0x98')][_0x289b('0x5b')]({'attributes':['id','name'],'where':{'id':_0x1b96e5['interaction']['UserId']}})[_0x289b('0x21')](function(_0x23a807){if(_0x23a807){_0x1b96e5[_0x289b('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x23a807[_0x289b('0x3c')]+','+(_0x1b96e5[_0x289b('0x84')]['waitForTheAssignedAgent']||0xa),'interval':_0x289b('0x96')});_0x1b96e5[_0x289b('0x99')]=![];}return respondWithRpcPromise(_0x289b('0x9a'),'startRouting',_0x1b96e5);});}return respondWithRpcPromise(_0x289b('0x9a'),_0x289b('0x9b'),_0x1b96e5);})[_0x289b('0x21')](function(_0x2e6aaf){respondWithRpcPromise(_0x289b('0x9c'),_0x289b('0x9c'),{'event':'notify','message':_0x2e6aaf},client9002);return _0x2e6aaf;})[_0x289b('0x21')](respondWithResult(_0x139c4c,null))[_0x289b('0x2a')](handleError(_0x139c4c,null));};exports[_0x289b('0x9d')]=function(_0x2078c5,_0x2e446f){var _0xe5fd98=_0x2078c5[_0x289b('0x58')]['id'];var _0x43ccc0=_0x2078c5[_0x289b('0x63')];var _0x2f8537=0xc8;var _0x38eccd=null;return db['sequelize'][_0x289b('0x9e')]({'isolationLevel':db[_0x289b('0x9f')][_0x289b('0xa0')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4fe7aa){return db[_0x289b('0x53')][_0x289b('0x69')]({'where':{'id':_0xe5fd98},'transaction':_0x4fe7aa})[_0x289b('0x21')](function(_0x103972){if(_0x103972){return db[_0x289b('0xa1')][_0x289b('0x38')]({'where':{'OpenchannelAccountId':_0xe5fd98},'transaction':_0x4fe7aa})['then'](function(){var _0x4133a6=_[_0x289b('0x51')](_0x43ccc0,function(_0x580750){_0x580750[_0x289b('0x66')]=_0xe5fd98;return _0x580750;});return db['OpenchannelApplication']['bulkCreate'](_0x4133a6,{'transaction':_0x4fe7aa});});}else{_0x2f8537=0x194;_0x38eccd=[];}});})[_0x289b('0x21')](function(){if(_0x2f8537!==0x194){return db[_0x289b('0xa1')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0xe5fd98},'order':'priority'})[_0x289b('0x21')](function(_0x2b4ae2){_0x38eccd=_0x2b4ae2;});}})[_0x289b('0x2a')](function(_0x3fdf3d){_0x2f8537=0x1f4;logger['error'](_0x3fdf3d[_0x289b('0x3b')]);if(_0x3fdf3d[_0x289b('0x3c')]){delete _0x3fdf3d[_0x289b('0x3c')];}_0x38eccd=_0x3fdf3d;})[_0x289b('0xa2')](function(){if(_0x38eccd===null){_0x2e446f[_0x289b('0x2b')](_0x2f8537);}else{if(_0x2f8537===0x1f4){_0x2e446f[_0x289b('0x2c')](_0x2f8537)['send'](_0x38eccd);}else{_0x2e446f[_0x289b('0x2c')](_0x2f8537)[_0x289b('0x2e')](_0x38eccd);}}});};exports[_0x289b('0xa3')]=function(_0x14d5b6,_0x309a18,_0x45ad81){var _0x414377={};var _0xfbadfa={};var _0x358f3b;var _0x4f74d8;return db[_0x289b('0x53')][_0x289b('0x69')]({'where':{'id':_0x14d5b6[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x309a18,null))[_0x289b('0x21')](function(_0x4d16ba){if(_0x4d16ba){_0x358f3b=_0x4d16ba;_0xfbadfa[_0x289b('0x43')]=_[_0x289b('0x45')](db[_0x289b('0xa1')]['rawAttributes']);_0xfbadfa[_0x289b('0x44')]=_[_0x289b('0x45')](_0x14d5b6[_0x289b('0x44')]);_0xfbadfa[_0x289b('0x4e')]=_[_0x289b('0x46')](_0xfbadfa[_0x289b('0x43')],_0xfbadfa['query']);_0x414377[_0x289b('0x47')]=_[_0x289b('0x46')](_0xfbadfa[_0x289b('0x43')],qs[_0x289b('0x48')](_0x14d5b6[_0x289b('0x44')][_0x289b('0x48')]));_0x414377['attributes']=_0x414377[_0x289b('0x47')][_0x289b('0x59')]?_0x414377[_0x289b('0x47')]:_0xfbadfa[_0x289b('0x43')];_0x414377[_0x289b('0x4a')]=qs[_0x289b('0x4b')](_0x14d5b6['query'][_0x289b('0x4b')]);_0x414377[_0x289b('0x4c')]=qs['filters'](_[_0x289b('0x4d')](_0x14d5b6['query'],_0xfbadfa[_0x289b('0x4e')]));if(_0x14d5b6[_0x289b('0x44')][_0x289b('0x4f')]){_0x414377['where']=_[_0x289b('0x50')](_0x414377['where'],{'$or':_['map'](_0x414377[_0x289b('0x47')],function(_0x40c601){var _0x6d62e1={};_0x6d62e1[_0x40c601]={'$like':'%'+_0x14d5b6[_0x289b('0x44')][_0x289b('0x4f')]+'%'};return _0x6d62e1;})});}_0x414377=_[_0x289b('0x50')]({},_0x414377,_0x14d5b6[_0x289b('0x5a')]);return _0x358f3b['getApplications'](_0x414377);}})[_0x289b('0x21')](function(_0x28e9dd){if(_0x28e9dd){_0x4f74d8=_0x28e9dd[_0x289b('0x59')];if(!_0x14d5b6[_0x289b('0x44')][_0x289b('0x49')](_0x289b('0x6e'))){_0x414377['limit']=qs[_0x289b('0x30')](_0x14d5b6[_0x289b('0x44')][_0x289b('0x30')]);_0x414377['offset']=qs[_0x289b('0x32')](_0x14d5b6[_0x289b('0x44')][_0x289b('0x32')]);}return _0x358f3b['getApplications'](_0x414377);}})[_0x289b('0x21')](function(_0x4215d1){if(_0x4215d1){return _0x4215d1?{'count':_0x4f74d8,'rows':_0x4215d1}:null;}})['then'](respondWithResult(_0x309a18,null))['catch'](handleError(_0x309a18,null));};exports[_0x289b('0xa4')]=function(_0x3f6f40,_0x51a9b7,_0x2a1dea){var _0x179211={'raw':![],'where':{}};var _0x418d26={};var _0x558d8e={'count':0x0,'rows':[]};return db[_0x289b('0x53')][_0x289b('0x69')]({'where':{'id':_0x3f6f40[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x51a9b7,null))['then'](function(_0x20b339){if(_0x20b339){_0x418d26[_0x289b('0x43')]=_[_0x289b('0x45')](db[_0x289b('0x8c')][_0x289b('0x3f')]);_0x418d26[_0x289b('0x44')]=_[_0x289b('0x45')](_0x3f6f40[_0x289b('0x44')]);_0x418d26[_0x289b('0x4e')]=_['intersection'](_0x418d26[_0x289b('0x43')],_0x418d26[_0x289b('0x44')]);_0x179211['attributes']=_['intersection'](_0x418d26[_0x289b('0x43')],qs['fields'](_0x3f6f40[_0x289b('0x44')][_0x289b('0x48')]));_0x179211[_0x289b('0x47')]=_0x179211[_0x289b('0x47')][_0x289b('0x59')]?_0x179211[_0x289b('0x47')]:_0x418d26[_0x289b('0x43')];if(!_0x3f6f40['query']['hasOwnProperty'](_0x289b('0x6e'))){_0x179211[_0x289b('0x30')]=qs['limit'](_0x3f6f40[_0x289b('0x44')]['limit']);_0x179211[_0x289b('0x32')]=qs['offset'](_0x3f6f40['query'][_0x289b('0x32')]);}_0x179211[_0x289b('0x4a')]=qs[_0x289b('0x4b')](_0x3f6f40['query'][_0x289b('0x4b')]);_0x179211[_0x289b('0x4c')]=qs[_0x289b('0x4e')](_[_0x289b('0x4d')](_0x3f6f40['query'],_0x418d26[_0x289b('0x4e')]));_0x179211[_0x289b('0x4c')][_0x289b('0x66')]=_0x20b339['id'];if(_0x3f6f40[_0x289b('0x44')]['filter']){_0x179211['where']=_[_0x289b('0x50')](_0x179211[_0x289b('0x4c')],{'$or':_[_0x289b('0x51')](_0x179211['attributes'],function(_0x4292fd){var _0x4b0a0b={};_0x4b0a0b[_0x4292fd]={'$like':'%'+_0x3f6f40[_0x289b('0x44')][_0x289b('0x4f')]+'%'};return _0x4b0a0b;})});}_0x179211=_[_0x289b('0x50')]({},_0x179211,_0x3f6f40['options']);return db[_0x289b('0x8c')]['count']({'where':_0x179211[_0x289b('0x4c')]})['then'](function(_0x208d87){_0x558d8e[_0x289b('0x31')]=_0x208d87;if(_0x3f6f40[_0x289b('0x44')][_0x289b('0x54')]){_0x179211[_0x289b('0x55')]=[{'model':db[_0x289b('0x72')],'as':_0x289b('0xa5'),'required':![]},{'model':db[_0x289b('0x98')],'as':'Owner','attributes':[_0x289b('0x3c'),_0x289b('0xa6'),_0x289b('0xa7')],'required':![]},{'model':db[_0x289b('0xa8')],'as':_0x289b('0xa9'),'attributes':['id',_0x289b('0x3c'),_0x289b('0xaa')],'where':_0x3f6f40[_0x289b('0x44')][_0x289b('0xab')]?{'id':_0x3f6f40[_0x289b('0x44')][_0x289b('0xab')]}:undefined,'required':_0x3f6f40['query'][_0x289b('0xab')]?!![]:![]}];}return db[_0x289b('0x8c')][_0x289b('0x6a')](_0x179211);})['then'](function(_0x23ac83){_0x558d8e['rows']=_0x23ac83;return _0x558d8e;});}})['then'](respondWithFilteredResult(_0x51a9b7,_0x179211))[_0x289b('0x2a')](handleError(_0x51a9b7,null));};exports[_0x289b('0xac')]=function(_0x46929f,_0x37683d,_0x2f5677){return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x46929f[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x37683d,null))[_0x289b('0x21')](function(_0x598a87){if(_0x598a87){return _0x598a87[_0x289b('0xac')](_0x46929f[_0x289b('0x63')][_0x289b('0x6c')],_['omit'](_0x46929f['body'],[_0x289b('0x6c'),'id'])||{})['spread'](function(_0x46789f){for(var _0x2f75f8=0x0;_0x2f75f8<_0x46929f['body'][_0x289b('0x6c')][_0x289b('0x59')];_0x2f75f8+=0x1){socket[_0x289b('0xad')](_0x289b('0xae'),{'UserId':Number(_0x46929f['body']['ids'][_0x2f75f8]),'OpenchannelAccountId':Number(_0x46929f[_0x289b('0x58')]['id'])});}return _0x46789f;});}})[_0x289b('0x21')](respondWithResult(_0x37683d,null))[_0x289b('0x2a')](handleError(_0x37683d,null));};exports[_0x289b('0xaf')]=function(_0x75c67e,_0x1e1a0c,_0x318c1f){return db['OpenchannelAccount'][_0x289b('0x5b')]({'where':{'id':_0x75c67e[_0x289b('0x58')]['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x1e1a0c,null))[_0x289b('0x21')](function(_0x18beee){if(_0x18beee){return _0x18beee[_0x289b('0xaf')](_0x75c67e[_0x289b('0x44')][_0x289b('0x6c')])['then'](function(){if(_['isArray'](_0x75c67e[_0x289b('0x44')][_0x289b('0x6c')])){for(var _0x5e2552=0x0;_0x5e2552<_0x75c67e[_0x289b('0x44')]['ids']['length'];_0x5e2552+=0x1){socket[_0x289b('0xad')]('userOpenchannelAccount:remove',{'UserId':Number(_0x75c67e[_0x289b('0x44')][_0x289b('0x6c')][_0x5e2552]),'OpenchannelAccountId':Number(_0x75c67e[_0x289b('0x58')]['id'])});}}else{socket[_0x289b('0xad')](_0x289b('0xb0'),{'UserId':Number(_0x75c67e[_0x289b('0x44')][_0x289b('0x6c')]),'OpenchannelAccountId':Number(_0x75c67e[_0x289b('0x58')]['id'])});}});}})[_0x289b('0x21')](respondWithStatusCode(_0x1e1a0c,null))[_0x289b('0x2a')](handleError(_0x1e1a0c,null));};exports[_0x289b('0xb1')]=function(_0x3033f1,_0x5d8aeb,_0x49a0dd){var _0x4b9271={};var _0x276e97={};var _0x2d91ed;var _0x3895fe;return db['OpenchannelAccount'][_0x289b('0x69')]({'where':{'id':_0x3033f1['params']['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x5d8aeb,null))[_0x289b('0x21')](function(_0xdcaa40){if(_0xdcaa40){_0x2d91ed=_0xdcaa40;_0x276e97[_0x289b('0x43')]=_[_0x289b('0x45')](db[_0x289b('0x98')]['rawAttributes']);_0x276e97[_0x289b('0x44')]=_[_0x289b('0x45')](_0x3033f1['query']);_0x276e97[_0x289b('0x4e')]=_['intersection'](_0x276e97[_0x289b('0x43')],_0x276e97[_0x289b('0x44')]);_0x4b9271['attributes']=_[_0x289b('0x46')](_0x276e97[_0x289b('0x43')],qs[_0x289b('0x48')](_0x3033f1[_0x289b('0x44')][_0x289b('0x48')]));_0x4b9271[_0x289b('0x47')]=_0x4b9271[_0x289b('0x47')][_0x289b('0x59')]?_0x4b9271[_0x289b('0x47')]:_0x276e97[_0x289b('0x43')];_0x4b9271[_0x289b('0x4a')]=qs['sort'](_0x3033f1['query'][_0x289b('0x4b')]);_0x4b9271[_0x289b('0x4c')]=qs[_0x289b('0x4e')](_['pick'](_0x3033f1['query'],_0x276e97['filters']));if(_0x3033f1[_0x289b('0x44')][_0x289b('0x4f')]){_0x4b9271['where']=_[_0x289b('0x50')](_0x4b9271[_0x289b('0x4c')],{'$or':_['map'](_0x4b9271[_0x289b('0x47')],function(_0x378c94){var _0x40f8a9={};_0x40f8a9[_0x378c94]={'$like':'%'+_0x3033f1['query'][_0x289b('0x4f')]+'%'};return _0x40f8a9;})});}_0x4b9271=_[_0x289b('0x50')]({},_0x4b9271,_0x3033f1['options']);return _0x2d91ed[_0x289b('0xb1')](_0x4b9271);}})[_0x289b('0x21')](function(_0x196c44){if(_0x196c44){_0x3895fe=_0x196c44[_0x289b('0x59')];if(!_0x3033f1['query']['hasOwnProperty'](_0x289b('0x6e'))){_0x4b9271[_0x289b('0x30')]=qs[_0x289b('0x30')](_0x3033f1[_0x289b('0x44')][_0x289b('0x30')]);_0x4b9271[_0x289b('0x32')]=qs[_0x289b('0x32')](_0x3033f1[_0x289b('0x44')][_0x289b('0x32')]);}return _0x2d91ed[_0x289b('0xb1')](_0x4b9271);}})[_0x289b('0x21')](function(_0x55d7bc){if(_0x55d7bc){return _0x55d7bc?{'count':_0x3895fe,'rows':_0x55d7bc}:null;}})['then'](respondWithResult(_0x5d8aeb,null))[_0x289b('0x2a')](handleError(_0x5d8aeb,null));};exports[_0x289b('0xb2')]=function(_0x5ae118,_0x5e9267,_0x37269a){var _0x3db392,_0x450043,_0x3225d9;if(_[_0x289b('0x79')](_0x5ae118[_0x289b('0x63')][_0x289b('0x63')])||_0x5ae118[_0x289b('0x63')][_0x289b('0x63')]===''){throw new db[(_0x289b('0x73'))][(_0x289b('0x74'))](_0x289b('0x7b'));}if(_[_0x289b('0x79')](_0x5ae118['body']['to'])){}_0x3db392=_0x5ae118['body']['to'];return db[_0x289b('0x53')]['findOne']({'where':{'id':_0x5ae118['params']['id']}})[_0x289b('0x21')](handleEntityNotFound(_0x5e9267,null))['then'](function(_0x5b73be){if(_0x5b73be){return db[_0x289b('0x53')][_0x289b('0x5b')]({'where':{'id':_0x5b73be['id']},'include':[{'model':db[_0x289b('0x7f')],'as':_0x289b('0x80'),'include':[{'model':db['CmContact'],'as':_0x289b('0x81'),'where':{[_0x5b73be[_0x289b('0x7c')]]:_0x3db392},'limit':0x1,'order':[[_0x289b('0xb3'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5e9267,null))[_0x289b('0x21')](function(_0x43981a){if(_0x43981a&&_0x43981a[_0x289b('0x80')]){_0x450043=_0x43981a[_0x289b('0x39')]({'plain':!![]});if(_0x450043[_0x289b('0x80')]&&_0x450043[_0x289b('0x80')][_0x289b('0x81')]['length']){return _0x450043[_0x289b('0x80')][_0x289b('0x81')][0x0];}return db[_0x289b('0x72')][_0x289b('0x5c')](_[_0x289b('0x17')](_0x5ae118[_0x289b('0x63')],{'firstName':_0x3db392,[_0x43981a[_0x289b('0x7c')]]:_0x3db392,'phone':_0x3db392,'ListId':_0x450043[_0x289b('0x78')]}));}})[_0x289b('0x21')](handleEntityNotFound(_0x5e9267,null))[_0x289b('0x21')](function(_0x391b34){if(_0x391b34){_0x3225d9=_0x391b34;return db['OpenchannelInteraction'][_0x289b('0x5b')]({'where':{'ContactId':_0x3225d9['id'],'closed':![],'OpenchannelAccountId':_0x450043['id']}})[_0x289b('0x21')](function(_0x2062aa){if(_0x2062aa){return[_0x2062aa,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x5ae118[_0x289b('0x5d')]['id'],'ContactId':_0x3225d9['id'],'OpenchannelAccountId':_0x450043['id'],'lastMsgDirection':_0x289b('0xb4'),'firstMsgDirection':_0x289b('0xb4'),'Messages':[_['merge'](_0x5ae118['body'],{'read':![],'body':_0x5ae118['body']['body'],'OpenchannelAccountId':_0x450043['id'],'UserId':_0x5ae118[_0x289b('0x5d')]['id'],'ContactId':_0x3225d9['id']})]},{'include':[{'model':db[_0x289b('0x97')],'as':'Messages'}]})[_0x289b('0x21')](function(_0x5a93d4){return[_0x5a93d4,!![]];});});}})['spread'](function(_0x3bb6dd,_0x303876){if(_0x303876){return _0x3bb6dd;}return db[_0x289b('0x97')][_0x289b('0x5c')](_['merge'](_0x5ae118['body'],{'read':![],'body':_0x5ae118[_0x289b('0x63')][_0x289b('0x63')],'OpenchannelAccountId':_0x450043['id'],'OpenchannelInteractionId':_0x3bb6dd['id'],'UserId':_0x5ae118[_0x289b('0x5d')]['id'],'ContactId':_0x3225d9['id']}))[_0x289b('0x21')](function(_0x190816){_0x3bb6dd[_0x289b('0xb5')][_0x289b('0xb6')]=[];_0x3bb6dd[_0x289b('0xb5')]['Messages']['push'](_0x190816[_0x289b('0xb5')]);return _0x3bb6dd;});});}})[_0x289b('0x21')](respondWithResult(_0x5e9267,null))['catch'](handleError(_0x5e9267,null));}; \ No newline at end of file +var _0x1738=['orderBy','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','sendStatus','stack','send','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','count','include','findAll','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','order','pick','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','account','applications','list'];(function(_0x4ce803,_0x35cd6b){var _0x384b19=function(_0x25d1ae){while(--_0x25d1ae){_0x4ce803['push'](_0x4ce803['shift']());}};_0x384b19(++_0x35cd6b);}(_0x1738,0x1bc));var _0x8173=function(_0x2553aa,_0x420113){_0x2553aa=_0x2553aa-0x0;var _0x315462=_0x1738[_0x2553aa];return _0x315462;};'use strict';var emlformat=require(_0x8173('0x0'));var rimraf=require(_0x8173('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8173('0x2'));var moment=require(_0x8173('0x3'));var BPromise=require(_0x8173('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8173('0x5'));var sox=require(_0x8173('0x6'));var csv=require(_0x8173('0x7'));var ejs=require(_0x8173('0x8'));var fs=require('fs');var fs_extra=require(_0x8173('0x9'));var _=require(_0x8173('0xa'));var squel=require(_0x8173('0xb'));var crypto=require(_0x8173('0xc'));var jsforce=require(_0x8173('0xd'));var deskjs=require(_0x8173('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8173('0xf'));var Redis=require(_0x8173('0x10'));var authService=require(_0x8173('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8173('0x12'));var logger=require(_0x8173('0x13'))(_0x8173('0x14'));var utils=require(_0x8173('0x15'));var config=require(_0x8173('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8173('0x17'))['db'];config['redis']=_[_0x8173('0x18')](config[_0x8173('0x19')],{'host':_0x8173('0x1a'),'port':0x18eb});var socket=require(_0x8173('0x1b'))(new Redis(config[_0x8173('0x19')]));require('./openchannelAccount.socket')[_0x8173('0x1c')](socket);var jayson=require(_0x8173('0x1d'));var client=jayson[_0x8173('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8173('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x40bf0e,_0x2e7ca5,_0x58fcf1,_0x2932b2){return new BPromise(function(_0x114b42,_0x4d1fa2){var _0x70e7fc=_0x2932b2||client;return _0x70e7fc[_0x8173('0x20')](_0x40bf0e,_0x58fcf1)[_0x8173('0x21')](function(_0x312eae){logger[_0x8173('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e7ca5,_0x8173('0x23'));logger[_0x8173('0x24')](_0x8173('0x25'),_0x2e7ca5,_0x8173('0x23'),JSON[_0x8173('0x26')](_0x312eae));if(_0x312eae[_0x8173('0x27')]){if(_0x312eae[_0x8173('0x27')][_0x8173('0x28')]===0x1f4){logger[_0x8173('0x27')](_0x8173('0x29'),_0x2e7ca5,_0x312eae['error'][_0x8173('0x2a')]);return _0x4d1fa2(_0x312eae[_0x8173('0x27')]['message']);}logger[_0x8173('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e7ca5,_0x312eae[_0x8173('0x27')]['message']);return _0x114b42(_0x312eae[_0x8173('0x27')]['message']);}else{logger[_0x8173('0x22')](_0x8173('0x29'),_0x2e7ca5,'request\x20sent');_0x114b42(_0x312eae[_0x8173('0x2b')]['message']);}})[_0x8173('0x2c')](function(_0x189acd){logger[_0x8173('0x27')](_0x8173('0x29'),_0x2e7ca5,_0x189acd);_0x4d1fa2(_0x189acd);});});}function respondWithStatusCode(_0x273820,_0x39cb27){_0x39cb27=_0x39cb27||0xcc;return function(_0x27b92a){if(_0x27b92a){return _0x273820['sendStatus'](_0x39cb27);}return _0x273820[_0x8173('0x2d')](_0x39cb27)[_0x8173('0x2e')]();};}function respondWithResult(_0x4fbe19,_0x52c249){_0x52c249=_0x52c249||0xc8;return function(_0x2eea21){if(_0x2eea21){return _0x4fbe19[_0x8173('0x2d')](_0x52c249)[_0x8173('0x2f')](_0x2eea21);}};}function respondWithFilteredResult(_0x5ee6e0,_0x50a935){return function(_0x223a9c){if(_0x223a9c){var _0x469a51=typeof _0x50a935[_0x8173('0x30')]===_0x8173('0x31')&&typeof _0x50a935['limit']===_0x8173('0x31');var _0x547b3a=_0x223a9c['count'];var _0xb2f261=_0x469a51?0x0:_0x50a935[_0x8173('0x30')];var _0x4c8b01=_0x469a51?_0x223a9c['count']:_0x50a935[_0x8173('0x30')]+_0x50a935[_0x8173('0x32')];var _0x36c282;if(_0x4c8b01>=_0x547b3a){_0x4c8b01=_0x547b3a;_0x36c282=0xc8;}else{_0x36c282=0xce;}_0x5ee6e0['status'](_0x36c282);return _0x5ee6e0[_0x8173('0x33')](_0x8173('0x34'),_0xb2f261+'-'+_0x4c8b01+'/'+_0x547b3a)[_0x8173('0x2f')](_0x223a9c);}return null;};}function patchUpdates(_0x464998){return function(_0x262222){try{jsonpatch['apply'](_0x262222,_0x464998,!![]);}catch(_0x448e32){return BPromise[_0x8173('0x35')](_0x448e32);}return _0x262222[_0x8173('0x36')]();};}function saveUpdates(_0x5c27ba,_0x2d7823){return function(_0x2aa38f){if(_0x2aa38f){return _0x2aa38f[_0x8173('0x37')](_0x5c27ba)[_0x8173('0x21')](function(_0x16a4a2){return _0x16a4a2;});}return null;};}function removeEntity(_0x41ae06,_0x2dea9a){return function(_0x29a6b6){if(_0x29a6b6){return _0x29a6b6[_0x8173('0x38')]()['then'](function(){var _0x46bde2=_0x29a6b6[_0x8173('0x39')]({'plain':!![]});var _0x1ba0bb=_0x8173('0x3a');return db['UserProfileResource'][_0x8173('0x38')]({'where':{'type':_0x1ba0bb,'resourceId':_0x46bde2['id']}})[_0x8173('0x21')](function(){return _0x29a6b6;});})[_0x8173('0x21')](function(){_0x41ae06[_0x8173('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40395d,_0x257619){return function(_0x45888a){if(!_0x45888a){_0x40395d[_0x8173('0x3b')](0x194);}return _0x45888a;};}function handleError(_0x5c5bf4,_0x4416e8){_0x4416e8=_0x4416e8||0x1f4;return function(_0x2ab1e4){logger[_0x8173('0x27')](_0x2ab1e4[_0x8173('0x3c')]);if(_0x2ab1e4['name']){delete _0x2ab1e4['name'];}_0x5c5bf4['status'](_0x4416e8)[_0x8173('0x3d')](_0x2ab1e4);};}exports['index']=function(_0x36dcb8,_0x4c36ae){var _0x5c2eef={'include':[{'model':db[_0x8173('0x3e')],'as':_0x8173('0x3f')}]},_0x2247fd={},_0xc6875b={'count':0x0,'rows':[]};var _0x374c51=_[_0x8173('0x40')](db['OpenchannelAccount'][_0x8173('0x41')],function(_0x34651a){return{'name':_0x34651a['fieldName'],'type':_0x34651a[_0x8173('0x42')][_0x8173('0x43')]};});_0x2247fd['model']=_[_0x8173('0x40')](_0x374c51,'name');_0x2247fd['query']=_['keys'](_0x36dcb8[_0x8173('0x44')]);_0x2247fd[_0x8173('0x45')]=_[_0x8173('0x46')](_0x2247fd['model'],_0x2247fd[_0x8173('0x44')]);_0x5c2eef[_0x8173('0x47')]=_[_0x8173('0x46')](_0x2247fd[_0x8173('0x48')],qs[_0x8173('0x49')](_0x36dcb8[_0x8173('0x44')][_0x8173('0x49')]));_0x5c2eef['attributes']=_0x5c2eef[_0x8173('0x47')][_0x8173('0x4a')]?_0x5c2eef[_0x8173('0x47')]:_0x2247fd[_0x8173('0x48')];if(!_0x36dcb8[_0x8173('0x44')][_0x8173('0x4b')](_0x8173('0x4c'))){_0x5c2eef['limit']=qs[_0x8173('0x32')](_0x36dcb8[_0x8173('0x44')][_0x8173('0x32')]);_0x5c2eef[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x36dcb8[_0x8173('0x44')]['offset']);}_0x5c2eef['order']=qs[_0x8173('0x4d')](_0x36dcb8[_0x8173('0x44')]['sort']);_0x5c2eef[_0x8173('0x4e')]=qs['filters'](_['pick'](_0x36dcb8[_0x8173('0x44')],_0x2247fd[_0x8173('0x45')]),_0x374c51);if(_0x36dcb8[_0x8173('0x44')][_0x8173('0x4f')]){_0x5c2eef[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x5c2eef[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x374c51,function(_0x2194de){if(_0x2194de[_0x8173('0x42')]!==_0x8173('0x51')){var _0x22d907={};_0x22d907[_0x2194de['name']]={'$like':'%'+_0x36dcb8['query'][_0x8173('0x4f')]+'%'};return _0x22d907;}})});}_0x5c2eef=_[_0x8173('0x50')]({},_0x5c2eef,_0x36dcb8[_0x8173('0x52')]);var _0x426d6={'where':_0x5c2eef[_0x8173('0x4e')]};return db[_0x8173('0x53')][_0x8173('0x54')](_0x426d6)[_0x8173('0x21')](function(_0x2f04bb){_0xc6875b[_0x8173('0x54')]=_0x2f04bb;if(_0x36dcb8[_0x8173('0x44')]['includeAll']){_0x5c2eef[_0x8173('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x8173('0x56')](_0x5c2eef);})[_0x8173('0x21')](function(_0x565e06){_0xc6875b['rows']=_0x565e06;return _0xc6875b;})[_0x8173('0x21')](respondWithFilteredResult(_0x4c36ae,_0x5c2eef))[_0x8173('0x2c')](handleError(_0x4c36ae,null));};exports['show']=function(_0xeb218e,_0x5ab9e1){var _0x5d06c3={'raw':![],'where':{'id':_0xeb218e[_0x8173('0x57')]['id']},'include':[{'model':db[_0x8173('0x3e')],'as':_0x8173('0x3f')}]},_0x4c8ee0={};_0x4c8ee0[_0x8173('0x48')]=_['keys'](db[_0x8173('0x53')][_0x8173('0x41')]);_0x4c8ee0[_0x8173('0x44')]=_[_0x8173('0x58')](_0xeb218e[_0x8173('0x44')]);_0x4c8ee0[_0x8173('0x45')]=_['intersection'](_0x4c8ee0[_0x8173('0x48')],_0x4c8ee0[_0x8173('0x44')]);_0x5d06c3[_0x8173('0x47')]=_[_0x8173('0x46')](_0x4c8ee0[_0x8173('0x48')],qs['fields'](_0xeb218e[_0x8173('0x44')][_0x8173('0x49')]));_0x5d06c3[_0x8173('0x47')]=_0x5d06c3[_0x8173('0x47')]['length']?_0x5d06c3[_0x8173('0x47')]:_0x4c8ee0[_0x8173('0x48')];if(_0xeb218e['query'][_0x8173('0x59')]){_0x5d06c3[_0x8173('0x55')]=[{'all':!![]}];}_0x5d06c3=_[_0x8173('0x50')]({},_0x5d06c3,_0xeb218e[_0x8173('0x52')]);return db[_0x8173('0x53')][_0x8173('0x5a')](_0x5d06c3)[_0x8173('0x21')](handleEntityNotFound(_0x5ab9e1,null))[_0x8173('0x21')](respondWithResult(_0x5ab9e1,null))[_0x8173('0x2c')](handleError(_0x5ab9e1,null));};exports['create']=function(_0x1dab4a,_0x3e4d5e){return db[_0x8173('0x53')][_0x8173('0x5b')](_0x1dab4a[_0x8173('0x5c')],{})[_0x8173('0x21')](function(_0x551bf0){var _0x2feeff=_0x1dab4a['user']['get']({'plain':!![]});if(!_0x2feeff)throw new Error(_0x8173('0x5d'));if(_0x2feeff['role']===_0x8173('0x5e')){var _0x580f5c=_0x551bf0[_0x8173('0x39')]({'plain':!![]});var _0x7f471c='OpenchannelAccounts';return db[_0x8173('0x5f')][_0x8173('0x5a')]({'where':{'name':_0x7f471c,'userProfileId':_0x2feeff[_0x8173('0x60')]},'raw':!![]})[_0x8173('0x21')](function(_0x5f280b){if(_0x5f280b&&_0x5f280b['autoAssociation']===0x0){return db[_0x8173('0x61')][_0x8173('0x5b')]({'name':_0x580f5c[_0x8173('0x62')],'resourceId':_0x580f5c['id'],'type':_0x5f280b[_0x8173('0x62')],'sectionId':_0x5f280b['id']},{})[_0x8173('0x21')](function(){return _0x551bf0;});}else{return _0x551bf0;}})['catch'](function(_0x52b3df){logger[_0x8173('0x27')](_0x8173('0x63'),_0x52b3df);throw _0x52b3df;});}return _0x551bf0;})[_0x8173('0x21')](respondWithResult(_0x3e4d5e,0xc9))[_0x8173('0x2c')](handleError(_0x3e4d5e,null));};exports['update']=function(_0x5148e4,_0x3890c7){if(_0x5148e4['body']['id']){delete _0x5148e4[_0x8173('0x5c')]['id'];}return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x5148e4[_0x8173('0x57')]['id']},'include':[{'model':db[_0x8173('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x8173('0x21')](handleEntityNotFound(_0x3890c7,null))[_0x8173('0x21')](saveUpdates(_0x5148e4[_0x8173('0x5c')],null))[_0x8173('0x21')](respondWithResult(_0x3890c7,null))[_0x8173('0x2c')](handleError(_0x3890c7,null));};exports['destroy']=function(_0x1775f8,_0x4cf730){return db[_0x8173('0x53')]['find']({'where':{'id':_0x1775f8[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x4cf730,null))[_0x8173('0x21')](removeEntity(_0x4cf730,null))['catch'](handleError(_0x4cf730,null));};exports[_0x8173('0x64')]=function(_0x353c0c,_0x41233c){return db['OpenchannelAccount'][_0x8173('0x64')]()['then'](respondWithResult(_0x41233c,null))[_0x8173('0x2c')](handleError(_0x41233c,null));};exports['addDisposition']=function(_0x182ccc,_0x3d79ef,_0x13373a){if(_0x182ccc[_0x8173('0x5c')]['id']){delete _0x182ccc[_0x8173('0x5c')]['id'];}return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x182ccc['params']['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x3d79ef,null))[_0x8173('0x21')](function(_0x3293e4){if(_0x3293e4){_0x182ccc[_0x8173('0x5c')]['OpenchannelAccountId']=_0x3293e4['id'];return db[_0x8173('0x65')][_0x8173('0x5b')](_0x182ccc[_0x8173('0x5c')]);}})[_0x8173('0x21')](respondWithResult(_0x3d79ef,null))[_0x8173('0x2c')](handleError(_0x3d79ef,null));};exports[_0x8173('0x66')]=function(_0x4290c2,_0x2fb923,_0x56d3d8){var _0x56b779={'raw':![],'where':{}};var _0x5568e1={};var _0x363c04={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8173('0x67')]({'where':{'id':_0x4290c2[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x2fb923,null))[_0x8173('0x21')](function(_0x3b0fe3){if(_0x3b0fe3){_0x5568e1[_0x8173('0x48')]=_[_0x8173('0x58')](db[_0x8173('0x65')]['rawAttributes']);_0x5568e1[_0x8173('0x44')]=_[_0x8173('0x58')](_0x4290c2[_0x8173('0x44')]);_0x5568e1[_0x8173('0x45')]=_[_0x8173('0x46')](_0x5568e1[_0x8173('0x48')],_0x5568e1['query']);_0x56b779[_0x8173('0x47')]=_[_0x8173('0x46')](_0x5568e1['model'],qs['fields'](_0x4290c2[_0x8173('0x44')][_0x8173('0x49')]));_0x56b779[_0x8173('0x47')]=_0x56b779[_0x8173('0x47')][_0x8173('0x4a')]?_0x56b779[_0x8173('0x47')]:_0x5568e1[_0x8173('0x48')];if(!_0x4290c2[_0x8173('0x44')][_0x8173('0x4b')](_0x8173('0x4c'))){_0x56b779[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x4290c2[_0x8173('0x44')]['limit']);_0x56b779[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x4290c2[_0x8173('0x44')][_0x8173('0x30')]);}_0x56b779[_0x8173('0x68')]=qs[_0x8173('0x4d')](_0x4290c2['query'][_0x8173('0x4d')]);_0x56b779['where']=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x4290c2[_0x8173('0x44')],_0x5568e1[_0x8173('0x45')]));_0x56b779[_0x8173('0x4e')][_0x8173('0x6a')]=_0x3b0fe3['id'];if(_0x4290c2['query']['filter']){_0x56b779[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x56b779[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x56b779[_0x8173('0x47')],function(_0x14494e){var _0x260c00={};_0x260c00[_0x14494e]={'$like':'%'+_0x4290c2[_0x8173('0x44')][_0x8173('0x4f')]+'%'};return _0x260c00;})});}_0x56b779=_[_0x8173('0x50')]({},_0x56b779,_0x4290c2[_0x8173('0x52')]);return db['Disposition'][_0x8173('0x54')]({'where':_0x56b779['where']})[_0x8173('0x21')](function(_0x4eb89a){_0x363c04[_0x8173('0x54')]=_0x4eb89a;if(_0x4290c2[_0x8173('0x44')][_0x8173('0x59')]){_0x56b779[_0x8173('0x55')]=[{'all':!![]}];}return db[_0x8173('0x65')][_0x8173('0x56')](_0x56b779);})['then'](function(_0x15a48f){_0x363c04['rows']=_0x15a48f;return _0x363c04;});}})[_0x8173('0x21')](respondWithFilteredResult(_0x2fb923,_0x56b779))[_0x8173('0x2c')](handleError(_0x2fb923,null));};exports['removeDispositions']=function(_0x5322d3,_0x45b5d1,_0x498dc6){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x5322d3['params']['id']}})['then'](handleEntityNotFound(_0x45b5d1,null))[_0x8173('0x21')](function(_0x2a2603){if(_0x2a2603){return _0x2a2603[_0x8173('0x6b')](_0x5322d3['query'][_0x8173('0x6c')]);}})['then'](respondWithStatusCode(_0x45b5d1,null))['catch'](handleError(_0x45b5d1,null));};exports[_0x8173('0x6d')]=function(_0x31cab8,_0x22727d,_0x1bbea4){if(_0x31cab8[_0x8173('0x5c')]['id']){delete _0x31cab8['body']['id'];}return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x31cab8['params']['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x22727d,null))[_0x8173('0x21')](function(_0x39ed10){if(_0x39ed10){_0x31cab8[_0x8173('0x5c')][_0x8173('0x6a')]=_0x39ed10['id'];return db[_0x8173('0x6e')][_0x8173('0x5b')](_0x31cab8['body']);}})[_0x8173('0x21')](respondWithResult(_0x22727d,null))['catch'](handleError(_0x22727d,null));};exports[_0x8173('0x6f')]=function(_0x3c78f1,_0x45c8e6,_0x25de7e){var _0x40aeea={'raw':![],'where':{}};var _0x367f80={};var _0x3d3ce5={'count':0x0,'rows':[]};return db[_0x8173('0x53')][_0x8173('0x67')]({'where':{'id':_0x3c78f1[_0x8173('0x57')]['id']}})['then'](handleEntityNotFound(_0x45c8e6,null))['then'](function(_0x24f500){if(_0x24f500){_0x367f80[_0x8173('0x48')]=_[_0x8173('0x58')](db['CannedAnswer'][_0x8173('0x41')]);_0x367f80[_0x8173('0x44')]=_[_0x8173('0x58')](_0x3c78f1[_0x8173('0x44')]);_0x367f80[_0x8173('0x45')]=_[_0x8173('0x46')](_0x367f80['model'],_0x367f80[_0x8173('0x44')]);_0x40aeea[_0x8173('0x47')]=_[_0x8173('0x46')](_0x367f80[_0x8173('0x48')],qs['fields'](_0x3c78f1[_0x8173('0x44')][_0x8173('0x49')]));_0x40aeea[_0x8173('0x47')]=_0x40aeea['attributes'][_0x8173('0x4a')]?_0x40aeea[_0x8173('0x47')]:_0x367f80[_0x8173('0x48')];if(!_0x3c78f1['query']['hasOwnProperty'](_0x8173('0x4c'))){_0x40aeea[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x3c78f1['query'][_0x8173('0x32')]);_0x40aeea[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x3c78f1[_0x8173('0x44')][_0x8173('0x30')]);}_0x40aeea[_0x8173('0x68')]=qs[_0x8173('0x4d')](_0x3c78f1[_0x8173('0x44')][_0x8173('0x4d')]);_0x40aeea[_0x8173('0x4e')]=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x3c78f1[_0x8173('0x44')],_0x367f80[_0x8173('0x45')]));_0x40aeea['where']['OpenchannelAccountId']=_0x24f500['id'];if(_0x3c78f1[_0x8173('0x44')][_0x8173('0x4f')]){_0x40aeea['where']=_[_0x8173('0x50')](_0x40aeea[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x40aeea[_0x8173('0x47')],function(_0x4100c8){var _0x533596={};_0x533596[_0x4100c8]={'$like':'%'+_0x3c78f1[_0x8173('0x44')][_0x8173('0x4f')]+'%'};return _0x533596;})});}_0x40aeea=_['merge']({},_0x40aeea,_0x3c78f1[_0x8173('0x52')]);return db['CannedAnswer'][_0x8173('0x54')]({'where':_0x40aeea[_0x8173('0x4e')]})['then'](function(_0x189484){_0x3d3ce5[_0x8173('0x54')]=_0x189484;if(_0x3c78f1[_0x8173('0x44')][_0x8173('0x59')]){_0x40aeea[_0x8173('0x55')]=[{'all':!![]}];}return db[_0x8173('0x6e')]['findAll'](_0x40aeea);})[_0x8173('0x21')](function(_0x2da352){_0x3d3ce5[_0x8173('0x70')]=_0x2da352;return _0x3d3ce5;});}})['then'](respondWithFilteredResult(_0x45c8e6,_0x40aeea))[_0x8173('0x2c')](handleError(_0x45c8e6,null));};exports[_0x8173('0x71')]=function(_0x17a47d,_0x518a1e,_0x51a996){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x17a47d['params']['id']}})['then'](handleEntityNotFound(_0x518a1e,null))[_0x8173('0x21')](function(_0x34735c){if(_0x34735c){return _0x34735c[_0x8173('0x71')](_0x17a47d[_0x8173('0x44')][_0x8173('0x6c')]);}})[_0x8173('0x21')](respondWithStatusCode(_0x518a1e,null))[_0x8173('0x2c')](handleError(_0x518a1e,null));};exports[_0x8173('0x72')]=function(_0x3f63b1,_0x13b259,_0x2793a5){var _0x54801f={'body':_0x3f63b1[_0x8173('0x5c')],'channel':_0x8173('0x73')};var _0x32f6ae=[];var _0x4d304c=[];var _0x547d22={};var _0x22979f=![];return db[_0x8173('0x74')][_0x8173('0x64')]()[_0x8173('0x21')](function(_0x33b49e){if(!_0x33b49e){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))](_0x8173('0x77'));}_0x32f6ae=_[_0x8173('0x78')](_[_0x8173('0x58')](_0x33b49e),[_0x8173('0x79'),_0x8173('0x7a')]);_0x4d304c=_['difference'](_[_0x8173('0x58')](_0x33b49e),[_0x8173('0x79'),_0x8173('0x7a'),_0x8173('0x7b'),_0x8173('0x7c')]);if(_0x3f63b1[_0x8173('0x5c')]['id']){delete _0x3f63b1[_0x8173('0x5c')]['id'];}if(_['isNil'](_0x3f63b1['body'][_0x8173('0x7d')])){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3f63b1[_0x8173('0x5c')][_0x8173('0x5c')])||_0x3f63b1[_0x8173('0x5c')][_0x8173('0x5c')]===''){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8173('0x7e')](_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7f')])){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))](_0x8173('0x80')+_0x4d304c);}if(!_[_0x8173('0x81')](_0x4d304c,_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7f')])){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d304c);}_0x547d22[_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7f')]]=_0x3f63b1[_0x8173('0x5c')]['from'];})[_0x8173('0x21')](function(){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x3f63b1[_0x8173('0x57')]['id']},'include':[{'model':db[_0x8173('0x82')],'as':_0x8173('0x83'),'include':[{'model':db['CmContact'],'as':_0x8173('0x84'),'where':_0x547d22,'limit':0x1,'order':[[_0x8173('0x7a'),_0x8173('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0x8173('0x86')}]});})[_0x8173('0x21')](handleEntityNotFound(_0x13b259,null))['then'](function(_0x406298){if(_0x406298&&_0x406298[_0x8173('0x83')]){_0x54801f[_0x8173('0x87')]=_0x406298;_0x54801f[_0x8173('0x88')]=_0x406298[_0x8173('0x86')];_0x54801f[_0x8173('0x89')]=_0x406298['List'];_0x54801f[_0x8173('0x88')]=_[_0x8173('0x8a')](_0x54801f[_0x8173('0x88')],['priority'],[_0x8173('0x8b')]);if(_0x54801f[_0x8173('0x87')][_0x8173('0x86')]){delete _0x54801f[_0x8173('0x87')][_0x8173('0x86')];}if(_0x54801f[_0x8173('0x87')][_0x8173('0x83')]&&_0x54801f[_0x8173('0x87')][_0x8173('0x83')]['Contacts'][_0x8173('0x4a')]){return _0x54801f[_0x8173('0x87')][_0x8173('0x83')][_0x8173('0x84')][0x0];}var _0x33151a=_[_0x8173('0x18')](_0x3f63b1[_0x8173('0x5c')],{'firstName':_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7d')],'ListId':_0x406298[_0x8173('0x7c')]});_0x33151a[_0x3f63b1[_0x8173('0x5c')]['mapKey']]=_0x3f63b1[_0x8173('0x5c')]['from'];return db['CmContact'][_0x8173('0x5b')](_0x33151a,{'fields':_0x32f6ae,'raw':!![]});}})[_0x8173('0x21')](handleEntityNotFound(_0x13b259,null))[_0x8173('0x21')](function(_0xec2ba4){_0x54801f[_0x8173('0x8c')]=_0xec2ba4;if(_0xec2ba4){var _0x34bba0={'ContactId':_0xec2ba4['id'],'OpenchannelAccountId':_0x3f63b1[_0x8173('0x57')]['id'],'from':(_0xec2ba4[_0x8173('0x8d')]||'')+'\x20'+(_0xec2ba4[_0x8173('0x8e')]||'')};var _0x538ffd={'OpenchannelAccountId':_0x3f63b1[_0x8173('0x57')]['id'],'closed':![]};if(_0x3f63b1[_0x8173('0x5c')][_0x8173('0x8f')]){_0x538ffd['threadId']=_0x3f63b1['body'][_0x8173('0x8f')];return db[_0x8173('0x90')]['find']({'where':_0x538ffd})[_0x8173('0x21')](function(_0x1992be){if(_0x1992be){return[_0x1992be,![]];}_0x34bba0[_0x8173('0x8f')]=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x8f')];_0x34bba0[_0x8173('0x91')]=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x91')];return db[_0x8173('0x90')][_0x8173('0x5b')](_0x34bba0)[_0x8173('0x21')](function(_0x2268ac){return[_0x2268ac,!![]];});});}else{_0x538ffd[_0x8173('0x8f')]=null;}_0x538ffd[_0x8173('0x92')]=_0xec2ba4['id'];return db[_0x8173('0x90')][_0x8173('0x5a')]({'where':_0x538ffd})[_0x8173('0x21')](function(_0xa7cece){if(_0xa7cece){return[_0xa7cece,![]];}return db['OpenchannelInteraction'][_0x8173('0x5b')](_0x34bba0)[_0x8173('0x21')](function(_0x5c480e){return[_0x5c480e,!![]];});});}})[_0x8173('0x93')](function(_0x10a060,_0x4cf1ca){if(_0x10a060){_0x22979f=_0x4cf1ca;if(!_0x4cf1ca){var _0x2e7dd4={'from':(_0x54801f[_0x8173('0x8c')][_0x8173('0x8d')]||'')+'\x20'+(_0x54801f[_0x8173('0x8c')][_0x8173('0x8e')]||'')};if(_0x3f63b1['body'][_0x8173('0x8f')]&&_0x3f63b1['body'][_0x8173('0x94')]&&_0x3f63b1[_0x8173('0x5c')][_0x8173('0x8f')]!=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x94')]){_0x2e7dd4[_0x8173('0x8f')]=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x94')];}return _0x10a060[_0x8173('0x37')](_0x2e7dd4);}else{return _0x10a060;}}})[_0x8173('0x21')](function(_0x12fdbd){_0x54801f['interaction']=_0x12fdbd[_0x8173('0x39')]({'plain':!![]});_0x54801f[_0x8173('0x95')]['created']=_0x22979f;if(_0x54801f['interaction'][_0x8173('0x96')]){if(_0x54801f[_0x8173('0x87')][_0x8173('0x97')]){_0x54801f[_0x8173('0x88')][_0x8173('0x98')]({'id':0x0,'priority':_0x54801f['applications'][_0x8173('0x4a')]+0x1,'app':_0x8173('0x99'),'appdata':_0x8173('0x9a'),'interval':_0x8173('0x9b')});}}return db[_0x8173('0x9c')][_0x8173('0x5b')]({'body':_0x3f63b1[_0x8173('0x5c')][_0x8173('0x5c')],'OpenchannelAccountId':_0x3f63b1[_0x8173('0x57')]['id'],'OpenchannelInteractionId':_0x12fdbd['id'],'direction':'in','ContactId':_0x54801f[_0x8173('0x8c')]['id'],'AttachmentId':_0x3f63b1[_0x8173('0x5c')][_0x8173('0x9d')]});})[_0x8173('0x21')](function(_0x42ddb6){_0x54801f['message']=_0x42ddb6;if(_0x54801f['interaction'][_0x8173('0x9e')]){return db[_0x8173('0x9f')]['find']({'attributes':['id','name'],'where':{'id':_0x54801f[_0x8173('0x95')]['UserId']}})[_0x8173('0x21')](function(_0x5abf83){if(_0x5abf83){_0x54801f[_0x8173('0x88')][_0x8173('0xa0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5abf83[_0x8173('0x62')]+','+(_0x54801f[_0x8173('0x87')][_0x8173('0xa1')]||0xa),'interval':_0x8173('0x9b')});_0x54801f['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x8173('0xa2'),_0x54801f);});}return respondWithRpcPromise(_0x8173('0xa3'),_0x8173('0xa2'),_0x54801f);})[_0x8173('0x21')](function(_0x493115){respondWithRpcPromise('EventManager',_0x8173('0xa4'),{'event':_0x8173('0x72'),'message':_0x493115},client9002);return _0x493115;})[_0x8173('0x21')](respondWithResult(_0x13b259,null))['catch'](handleError(_0x13b259,null));};exports[_0x8173('0xa5')]=function(_0x3639eb,_0x2bed39){var _0x405185=_0x3639eb[_0x8173('0x57')]['id'];var _0x16d7b1=_0x3639eb[_0x8173('0x5c')];var _0x51dba6=0xc8;var _0x500991=null;return db[_0x8173('0xa6')][_0x8173('0xa7')]({'isolationLevel':db[_0x8173('0xa6')][_0x8173('0xa8')][_0x8173('0xa9')][_0x8173('0xaa')]},function(_0x249b62){return db[_0x8173('0x53')][_0x8173('0x67')]({'where':{'id':_0x405185},'transaction':_0x249b62})[_0x8173('0x21')](function(_0x514630){if(_0x514630){return db[_0x8173('0xab')][_0x8173('0x38')]({'where':{'OpenchannelAccountId':_0x405185},'transaction':_0x249b62})[_0x8173('0x21')](function(){var _0x48b21a=_[_0x8173('0x40')](_0x16d7b1,function(_0xf12a99){_0xf12a99[_0x8173('0x6a')]=_0x405185;return _0xf12a99;});return db[_0x8173('0xab')][_0x8173('0xac')](_0x48b21a,{'transaction':_0x249b62});});}else{_0x51dba6=0x194;_0x500991=[];}});})['then'](function(){if(_0x51dba6!==0x194){return db[_0x8173('0xab')][_0x8173('0xad')]({'where':{'OpenchannelAccountId':_0x405185},'order':_0x8173('0xae')})[_0x8173('0x21')](function(_0x24b4b2){_0x500991=_0x24b4b2;});}})[_0x8173('0x2c')](function(_0x35557c){_0x51dba6=0x1f4;logger[_0x8173('0x27')](_0x35557c[_0x8173('0x3c')]);if(_0x35557c[_0x8173('0x62')]){delete _0x35557c[_0x8173('0x62')];}_0x500991=_0x35557c;})['finally'](function(){if(_0x500991===null){_0x2bed39['sendStatus'](_0x51dba6);}else{if(_0x51dba6===0x1f4){_0x2bed39[_0x8173('0x2d')](_0x51dba6)[_0x8173('0x3d')](_0x500991);}else{_0x2bed39['status'](_0x51dba6)[_0x8173('0x2f')](_0x500991);}}});};exports[_0x8173('0xaf')]=function(_0x7f3719,_0xeca401,_0x3d8478){var _0x15494f={};var _0xab3c80={};var _0x1113fa;var _0x48ebea;return db[_0x8173('0x53')]['findOne']({'where':{'id':_0x7f3719['params']['id']}})[_0x8173('0x21')](handleEntityNotFound(_0xeca401,null))[_0x8173('0x21')](function(_0x647a56){if(_0x647a56){_0x1113fa=_0x647a56;_0xab3c80[_0x8173('0x48')]=_[_0x8173('0x58')](db[_0x8173('0xab')]['rawAttributes']);_0xab3c80['query']=_[_0x8173('0x58')](_0x7f3719['query']);_0xab3c80[_0x8173('0x45')]=_[_0x8173('0x46')](_0xab3c80[_0x8173('0x48')],_0xab3c80['query']);_0x15494f[_0x8173('0x47')]=_[_0x8173('0x46')](_0xab3c80[_0x8173('0x48')],qs['fields'](_0x7f3719[_0x8173('0x44')][_0x8173('0x49')]));_0x15494f[_0x8173('0x47')]=_0x15494f[_0x8173('0x47')][_0x8173('0x4a')]?_0x15494f[_0x8173('0x47')]:_0xab3c80['model'];_0x15494f['order']=qs[_0x8173('0x4d')](_0x7f3719[_0x8173('0x44')][_0x8173('0x4d')]);_0x15494f[_0x8173('0x4e')]=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x7f3719[_0x8173('0x44')],_0xab3c80[_0x8173('0x45')]));if(_0x7f3719[_0x8173('0x44')][_0x8173('0x4f')]){_0x15494f[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x15494f[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x15494f[_0x8173('0x47')],function(_0xe4dd43){var _0x189451={};_0x189451[_0xe4dd43]={'$like':'%'+_0x7f3719[_0x8173('0x44')]['filter']+'%'};return _0x189451;})});}_0x15494f=_[_0x8173('0x50')]({},_0x15494f,_0x7f3719[_0x8173('0x52')]);return _0x1113fa[_0x8173('0xaf')](_0x15494f);}})[_0x8173('0x21')](function(_0x245762){if(_0x245762){_0x48ebea=_0x245762['length'];if(!_0x7f3719['query'][_0x8173('0x4b')]('nolimit')){_0x15494f[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x7f3719['query']['limit']);_0x15494f[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x7f3719[_0x8173('0x44')][_0x8173('0x30')]);}return _0x1113fa[_0x8173('0xaf')](_0x15494f);}})['then'](function(_0x56d856){if(_0x56d856){return _0x56d856?{'count':_0x48ebea,'rows':_0x56d856}:null;}})[_0x8173('0x21')](respondWithResult(_0xeca401,null))['catch'](handleError(_0xeca401,null));};exports[_0x8173('0xb0')]=function(_0x5ecfc0,_0x2956ec,_0x4a628f){var _0x2eb7cd={'raw':![],'where':{}};var _0x10d14e={};var _0x137295={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8173('0x67')]({'where':{'id':_0x5ecfc0[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x2956ec,null))[_0x8173('0x21')](function(_0x1e3d1c){if(_0x1e3d1c){_0x10d14e[_0x8173('0x48')]=_[_0x8173('0x58')](db['OpenchannelInteraction'][_0x8173('0x41')]);_0x10d14e['query']=_[_0x8173('0x58')](_0x5ecfc0[_0x8173('0x44')]);_0x10d14e['filters']=_['intersection'](_0x10d14e['model'],_0x10d14e[_0x8173('0x44')]);_0x2eb7cd[_0x8173('0x47')]=_['intersection'](_0x10d14e[_0x8173('0x48')],qs[_0x8173('0x49')](_0x5ecfc0[_0x8173('0x44')]['fields']));_0x2eb7cd[_0x8173('0x47')]=_0x2eb7cd['attributes'][_0x8173('0x4a')]?_0x2eb7cd['attributes']:_0x10d14e['model'];if(!_0x5ecfc0[_0x8173('0x44')][_0x8173('0x4b')](_0x8173('0x4c'))){_0x2eb7cd[_0x8173('0x32')]=qs['limit'](_0x5ecfc0[_0x8173('0x44')]['limit']);_0x2eb7cd[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x5ecfc0[_0x8173('0x44')][_0x8173('0x30')]);}_0x2eb7cd[_0x8173('0x68')]=qs['sort'](_0x5ecfc0[_0x8173('0x44')][_0x8173('0x4d')]);_0x2eb7cd['where']=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x5ecfc0['query'],_0x10d14e[_0x8173('0x45')]));_0x2eb7cd[_0x8173('0x4e')]['OpenchannelAccountId']=_0x1e3d1c['id'];if(_0x5ecfc0[_0x8173('0x44')][_0x8173('0x4f')]){_0x2eb7cd[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x2eb7cd[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x2eb7cd['attributes'],function(_0x155030){var _0x48dcc8={};_0x48dcc8[_0x155030]={'$like':'%'+_0x5ecfc0['query'][_0x8173('0x4f')]+'%'};return _0x48dcc8;})});}_0x2eb7cd=_['merge']({},_0x2eb7cd,_0x5ecfc0[_0x8173('0x52')]);return db[_0x8173('0x90')]['count']({'where':_0x2eb7cd['where']})[_0x8173('0x21')](function(_0x3fb802){_0x137295[_0x8173('0x54')]=_0x3fb802;if(_0x5ecfc0[_0x8173('0x44')][_0x8173('0x59')]){_0x2eb7cd[_0x8173('0x55')]=[{'model':db[_0x8173('0x74')],'as':_0x8173('0xb1'),'required':![]},{'model':db[_0x8173('0x9f')],'as':_0x8173('0xb2'),'attributes':['name',_0x8173('0xb3'),_0x8173('0xb4')],'required':![]},{'model':db[_0x8173('0xb5')],'as':'Tags','attributes':['id','name','color'],'where':_0x5ecfc0['query'][_0x8173('0xb6')]?{'id':_0x5ecfc0[_0x8173('0x44')][_0x8173('0xb6')]}:undefined,'required':_0x5ecfc0[_0x8173('0x44')][_0x8173('0xb6')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x2eb7cd);})['then'](function(_0x4b7cf4){_0x137295['rows']=_0x4b7cf4;return _0x137295;});}})[_0x8173('0x21')](respondWithFilteredResult(_0x2956ec,_0x2eb7cd))[_0x8173('0x2c')](handleError(_0x2956ec,null));};exports[_0x8173('0xb7')]=function(_0x2abef3,_0x208ac4,_0x2f327e){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x2abef3[_0x8173('0x57')]['id']}})['then'](handleEntityNotFound(_0x208ac4,null))['then'](function(_0x2d54a0){if(_0x2d54a0){return _0x2d54a0[_0x8173('0xb7')](_0x2abef3[_0x8173('0x5c')][_0x8173('0x6c')],_['omit'](_0x2abef3[_0x8173('0x5c')],['ids','id'])||{})[_0x8173('0x93')](function(_0x4b832c){for(var _0x3e4970=0x0;_0x3e4970<_0x2abef3[_0x8173('0x5c')][_0x8173('0x6c')][_0x8173('0x4a')];_0x3e4970+=0x1){socket[_0x8173('0xb8')](_0x8173('0xb9'),{'UserId':Number(_0x2abef3[_0x8173('0x5c')][_0x8173('0x6c')][_0x3e4970]),'OpenchannelAccountId':Number(_0x2abef3[_0x8173('0x57')]['id'])});}return _0x4b832c;});}})[_0x8173('0x21')](respondWithResult(_0x208ac4,null))[_0x8173('0x2c')](handleError(_0x208ac4,null));};exports[_0x8173('0xba')]=function(_0x3464b0,_0x1b877c,_0xf956e1){return db['OpenchannelAccount'][_0x8173('0x5a')]({'where':{'id':_0x3464b0[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x1b877c,null))[_0x8173('0x21')](function(_0x1c63cc){if(_0x1c63cc){return _0x1c63cc[_0x8173('0xba')](_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')])['then'](function(){if(_[_0x8173('0xbb')](_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')])){for(var _0x42e5e7=0x0;_0x42e5e7<_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')]['length'];_0x42e5e7+=0x1){socket[_0x8173('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')][_0x42e5e7]),'OpenchannelAccountId':Number(_0x3464b0['params']['id'])});}}else{socket[_0x8173('0xb8')](_0x8173('0xbc'),{'UserId':Number(_0x3464b0[_0x8173('0x44')]['ids']),'OpenchannelAccountId':Number(_0x3464b0[_0x8173('0x57')]['id'])});}});}})[_0x8173('0x21')](respondWithStatusCode(_0x1b877c,null))[_0x8173('0x2c')](handleError(_0x1b877c,null));};exports[_0x8173('0xbd')]=function(_0x2cfcd6,_0x3fbcd1,_0x473238){var _0x35573f={};var _0x40809b={};var _0x4272d6;var _0x35d85c;return db[_0x8173('0x53')][_0x8173('0x67')]({'where':{'id':_0x2cfcd6[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x3fbcd1,null))[_0x8173('0x21')](function(_0x48e336){if(_0x48e336){_0x4272d6=_0x48e336;_0x40809b[_0x8173('0x48')]=_[_0x8173('0x58')](db[_0x8173('0x9f')][_0x8173('0x41')]);_0x40809b['query']=_['keys'](_0x2cfcd6[_0x8173('0x44')]);_0x40809b[_0x8173('0x45')]=_['intersection'](_0x40809b[_0x8173('0x48')],_0x40809b['query']);_0x35573f[_0x8173('0x47')]=_[_0x8173('0x46')](_0x40809b[_0x8173('0x48')],qs['fields'](_0x2cfcd6['query']['fields']));_0x35573f[_0x8173('0x47')]=_0x35573f[_0x8173('0x47')][_0x8173('0x4a')]?_0x35573f['attributes']:_0x40809b[_0x8173('0x48')];_0x35573f[_0x8173('0x68')]=qs[_0x8173('0x4d')](_0x2cfcd6[_0x8173('0x44')][_0x8173('0x4d')]);_0x35573f[_0x8173('0x4e')]=qs['filters'](_[_0x8173('0x69')](_0x2cfcd6[_0x8173('0x44')],_0x40809b[_0x8173('0x45')]));if(_0x2cfcd6['query'][_0x8173('0x4f')]){_0x35573f[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x35573f['where'],{'$or':_['map'](_0x35573f['attributes'],function(_0x55d25b){var _0x55cfbf={};_0x55cfbf[_0x55d25b]={'$like':'%'+_0x2cfcd6['query'][_0x8173('0x4f')]+'%'};return _0x55cfbf;})});}_0x35573f=_['merge']({},_0x35573f,_0x2cfcd6[_0x8173('0x52')]);return _0x4272d6[_0x8173('0xbd')](_0x35573f);}})[_0x8173('0x21')](function(_0xd833ff){if(_0xd833ff){_0x35d85c=_0xd833ff[_0x8173('0x4a')];if(!_0x2cfcd6[_0x8173('0x44')][_0x8173('0x4b')]('nolimit')){_0x35573f[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x2cfcd6[_0x8173('0x44')]['limit']);_0x35573f[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x2cfcd6[_0x8173('0x44')][_0x8173('0x30')]);}return _0x4272d6[_0x8173('0xbd')](_0x35573f);}})[_0x8173('0x21')](function(_0x6884f){if(_0x6884f){return _0x6884f?{'count':_0x35d85c,'rows':_0x6884f}:null;}})[_0x8173('0x21')](respondWithResult(_0x3fbcd1,null))['catch'](handleError(_0x3fbcd1,null));};exports[_0x8173('0x3d')]=function(_0x20f4d0,_0x4ba412,_0x5a7651){var _0x4a84cc,_0x2eb627,_0x5d695d;if(_[_0x8173('0x7e')](_0x20f4d0[_0x8173('0x5c')]['body'])||_0x20f4d0['body'][_0x8173('0x5c')]===''){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))](_0x8173('0xbe'));}if(_[_0x8173('0x7e')](_0x20f4d0[_0x8173('0x5c')]['to'])){}_0x4a84cc=_0x20f4d0['body']['to'];return db['OpenchannelAccount'][_0x8173('0x67')]({'where':{'id':_0x20f4d0['params']['id']}})['then'](handleEntityNotFound(_0x4ba412,null))['then'](function(_0x27b520){if(_0x27b520){return db[_0x8173('0x53')]['find']({'where':{'id':_0x27b520['id']},'include':[{'model':db['CmList'],'as':_0x8173('0x83'),'include':[{'model':db[_0x8173('0x74')],'as':_0x8173('0x84'),'where':{[_0x27b520[_0x8173('0x7f')]]:_0x4a84cc},'limit':0x1,'order':[[_0x8173('0x7a'),_0x8173('0x85')]]}]}]})[_0x8173('0x21')](handleEntityNotFound(_0x4ba412,null))[_0x8173('0x21')](function(_0x231119){if(_0x231119&&_0x231119['List']){_0x2eb627=_0x231119[_0x8173('0x39')]({'plain':!![]});if(_0x2eb627[_0x8173('0x83')]&&_0x2eb627[_0x8173('0x83')][_0x8173('0x84')][_0x8173('0x4a')]){return _0x2eb627[_0x8173('0x83')]['Contacts'][0x0];}return db[_0x8173('0x74')][_0x8173('0x5b')](_['defaults'](_0x20f4d0[_0x8173('0x5c')],{'firstName':_0x4a84cc,[_0x231119[_0x8173('0x7f')]]:_0x4a84cc,'phone':_0x4a84cc,'ListId':_0x2eb627[_0x8173('0x7c')]}));}})[_0x8173('0x21')](handleEntityNotFound(_0x4ba412,null))[_0x8173('0x21')](function(_0x5c63f2){if(_0x5c63f2){_0x5d695d=_0x5c63f2;return db['OpenchannelInteraction'][_0x8173('0x5a')]({'where':{'ContactId':_0x5d695d['id'],'closed':![],'OpenchannelAccountId':_0x2eb627['id']}})['then'](function(_0x8cb3f0){if(_0x8cb3f0){return[_0x8cb3f0,![]];}return db[_0x8173('0x90')]['create']({'UserId':_0x20f4d0[_0x8173('0x5e')]['id'],'ContactId':_0x5d695d['id'],'OpenchannelAccountId':_0x2eb627['id'],'lastMsgDirection':_0x8173('0xbf'),'firstMsgDirection':_0x8173('0xbf'),'Messages':[_[_0x8173('0x50')](_0x20f4d0[_0x8173('0x5c')],{'read':![],'body':_0x20f4d0[_0x8173('0x5c')][_0x8173('0x5c')],'OpenchannelAccountId':_0x2eb627['id'],'UserId':_0x20f4d0[_0x8173('0x5e')]['id'],'ContactId':_0x5d695d['id']})]},{'include':[{'model':db[_0x8173('0x9c')],'as':'Messages'}]})[_0x8173('0x21')](function(_0xc91783){return[_0xc91783,!![]];});});}})[_0x8173('0x93')](function(_0x83eedd,_0x404109){if(_0x404109){return _0x83eedd;}return db[_0x8173('0x9c')]['create'](_[_0x8173('0x50')](_0x20f4d0[_0x8173('0x5c')],{'read':![],'body':_0x20f4d0[_0x8173('0x5c')]['body'],'OpenchannelAccountId':_0x2eb627['id'],'OpenchannelInteractionId':_0x83eedd['id'],'UserId':_0x20f4d0[_0x8173('0x5e')]['id'],'ContactId':_0x5d695d['id']}))[_0x8173('0x21')](function(_0x7b12e7){_0x83eedd['dataValues'][_0x8173('0xc0')]=[];_0x83eedd[_0x8173('0xc1')][_0x8173('0xc0')]['push'](_0x7b12e7['dataValues']);return _0x83eedd;});});}})['then'](respondWithResult(_0x4ba412,null))[_0x8173('0x2c')](handleError(_0x4ba412,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ff5e4c6..51a43db 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 _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x178886,_0x5e8668){var _0x329b2a=function(_0x1bad9c){while(--_0x1bad9c){_0x178886['push'](_0x178886['shift']());}};_0x329b2a(++_0x5e8668);}(_0x9348,0x10d));var _0x8934=function(_0x4f980d,_0x134d1c){_0x4f980d=_0x4f980d-0x0;var _0x4191bb=_0x9348[_0x4f980d];return _0x4191bb;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x2dae=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x84aaad,_0x5274a4){var _0x41af6b=function(_0x164921){while(--_0x164921){_0x84aaad['push'](_0x84aaad['shift']());}};_0x41af6b(++_0x5274a4);}(_0x2dae,0xc3));var _0xe2da=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x2dae[_0x494d1f];return _0x457b6e;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe2da('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe2da('0x2')](0x0);var events={'afterCreate':_0xe2da('0x3'),'afterUpdate':_0xe2da('0x4'),'afterDestroy':_0xe2da('0x5')};function emitEvent(_0x481d97){return function(_0x25b9f2,_0x439b5d,_0x77e45e){OpenchannelAccountEvents[_0xe2da('0x6')](_0x481d97+':'+_0x25b9f2['id'],_0x25b9f2);OpenchannelAccountEvents['emit'](_0x481d97,_0x25b9f2);_0x77e45e(null);};}for(var e in events){if(events[_0xe2da('0x7')](e)){var event=events[e];OpenchannelAccount[_0xe2da('0x8')](e,emitEvent(event));}}module[_0xe2da('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index bf21b1f..b065650 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(_0x5996f4,_0xcef28){var _0x3cb209=function(_0x2fac7a){while(--_0x2fac7a){_0x5996f4['push'](_0x5996f4['shift']());}};_0x3cb209(++_0xcef28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x4c5368,_0x28d31e){var _0x3e2035=function(_0x5304f1){while(--_0x5304f1){_0x4c5368['push'](_0x4c5368['shift']());}};_0x3e2035(++_0x28d31e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 1a849f9..26c7c49 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 _0x5c00=['code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c5a4c,_0xb209d4){var _0xc71f0f=function(_0x4d0f87){while(--_0x4d0f87){_0x1c5a4c['push'](_0x1c5a4c['shift']());}};_0xc71f0f(++_0xb209d4);}(_0x5c00,0x17e));var _0x05c0=function(_0x222df7,_0x3e073f){_0x222df7=_0x222df7-0x0;var _0x2cceae=_0x5c00[_0x222df7];return _0x2cceae;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});config[_0x05c0('0xb')]=_['defaults'](config[_0x05c0('0xb')],{'host':_0x05c0('0xc'),'port':0x18eb});var socket=require(_0x05c0('0xd'))(new Redis(config['redis']));require(_0x05c0('0xe'))[_0x05c0('0xf')](socket);function respondWithRpcPromise(_0x996d6b,_0x321c09,_0x273b2d){return new BPromise(function(_0x1edbb,_0x5226c5){return client['request'](_0x996d6b,_0x273b2d)[_0x05c0('0x10')](function(_0x516a66){logger[_0x05c0('0x11')](_0x05c0('0x12'),_0x321c09,_0x05c0('0x13'));logger['debug'](_0x05c0('0x14'),_0x321c09,'request\x20sent',JSON[_0x05c0('0x15')](_0x516a66));if(_0x516a66[_0x05c0('0x16')]){if(_0x516a66[_0x05c0('0x16')][_0x05c0('0x17')]===0x1f4){logger[_0x05c0('0x16')](_0x05c0('0x12'),_0x321c09,_0x516a66[_0x05c0('0x16')][_0x05c0('0x18')]);return _0x5226c5(_0x516a66['error'][_0x05c0('0x18')]);}logger[_0x05c0('0x16')](_0x05c0('0x12'),_0x321c09,_0x516a66[_0x05c0('0x16')][_0x05c0('0x18')]);return _0x1edbb(_0x516a66[_0x05c0('0x16')][_0x05c0('0x18')]);}else{logger[_0x05c0('0x11')](_0x05c0('0x12'),_0x321c09,'request\x20sent');_0x1edbb(_0x516a66[_0x05c0('0x19')][_0x05c0('0x18')]);}})[_0x05c0('0x1a')](function(_0x54fef0){logger[_0x05c0('0x16')](_0x05c0('0x12'),_0x321c09,_0x54fef0);_0x5226c5(_0x54fef0);});});} \ No newline at end of file +var _0xeb74=['request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./openchannelAccount.socket','register'];(function(_0x7fee8c,_0x1a180a){var _0x4f0510=function(_0x39c4eb){while(--_0x39c4eb){_0x7fee8c['push'](_0x7fee8c['shift']());}};_0x4f0510(++_0x1a180a);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4f191a,_0xad9b6){_0x4f191a=_0x4f191a-0x0;var _0x4ebc58=_0xeb74[_0x4f191a];return _0x4ebc58;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});config[_0x4eb7('0xc')]=_['defaults'](config[_0x4eb7('0xc')],{'host':_0x4eb7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4eb7('0xe'))[_0x4eb7('0xf')](socket);function respondWithRpcPromise(_0x4b3add,_0xa72e98,_0x4ff98e){return new BPromise(function(_0x3326cd,_0x462392){return client[_0x4eb7('0x10')](_0x4b3add,_0x4ff98e)['then'](function(_0x2b32be){logger[_0x4eb7('0x11')](_0x4eb7('0x12'),_0xa72e98,_0x4eb7('0x13'));logger[_0x4eb7('0x14')](_0x4eb7('0x15'),_0xa72e98,_0x4eb7('0x13'),JSON['stringify'](_0x2b32be));if(_0x2b32be['error']){if(_0x2b32be['error'][_0x4eb7('0x16')]===0x1f4){logger['error'](_0x4eb7('0x12'),_0xa72e98,_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);return _0x462392(_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);}logger[_0x4eb7('0x17')](_0x4eb7('0x12'),_0xa72e98,_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);return _0x3326cd(_0x2b32be[_0x4eb7('0x17')]['message']);}else{logger[_0x4eb7('0x11')](_0x4eb7('0x12'),_0xa72e98,_0x4eb7('0x13'));_0x3326cd(_0x2b32be[_0x4eb7('0x19')][_0x4eb7('0x18')]);}})[_0x4eb7('0x1a')](function(_0x2d0ea7){logger[_0x4eb7('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0xa72e98,_0x2d0ea7);_0x462392(_0x2d0ea7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index da6c056..ece50aa 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 _0xc39c=['length','openchannelAccount:','save','remove','update','emit','removeListener','register'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc39c,0xd2));var _0xcc39=function(_0x25cf1f,_0x90fa5f){_0x25cf1f=_0x25cf1f-0x0;var _0x41b356=_0xc39c[_0x25cf1f];return _0x41b356;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xcc39('0x0'),_0xcc39('0x1'),_0xcc39('0x2')];function createListener(_0x5d885b,_0x6c204c){return function(_0x29b2e2){_0x6c204c[_0xcc39('0x3')](_0x5d885b,_0x29b2e2);};}function removeListener(_0x5bc333,_0x29c6c2){return function(){OpenchannelAccountEvents[_0xcc39('0x4')](_0x5bc333,_0x29c6c2);};}exports[_0xcc39('0x5')]=function(_0x3118f8){for(var _0x592ad7=0x0,_0x32cf84=events[_0xcc39('0x6')];_0x592ad7<_0x32cf84;_0x592ad7++){var _0x12361a=events[_0x592ad7];var _0x46bb71=createListener(_0xcc39('0x7')+_0x12361a,_0x3118f8);OpenchannelAccountEvents['on'](_0x12361a,_0x46bb71);}}; \ No newline at end of file +var _0x2504=['remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x76faa4,_0x4a8b9c){var _0x5cab58=function(_0x159033){while(--_0x159033){_0x76faa4['push'](_0x76faa4['shift']());}};_0x5cab58(++_0x4a8b9c);}(_0x2504,0xee));var _0x4250=function(_0x579728,_0x770600){_0x579728=_0x579728-0x0;var _0x3e03fd=_0x2504[_0x579728];return _0x3e03fd;};'use strict';var OpenchannelAccountEvents=require(_0x4250('0x0'));var events=[_0x4250('0x1'),_0x4250('0x2'),_0x4250('0x3')];function createListener(_0x307ca9,_0x67c47b){return function(_0x41d71d){_0x67c47b[_0x4250('0x4')](_0x307ca9,_0x41d71d);};}function removeListener(_0x17d2d8,_0xc31f3a){return function(){OpenchannelAccountEvents[_0x4250('0x5')](_0x17d2d8,_0xc31f3a);};}exports[_0x4250('0x6')]=function(_0x493da9){for(var _0x473cb8=0x0,_0x4e177e=events['length'];_0x473cb8<_0x4e177e;_0x473cb8++){var _0x370998=events[_0x473cb8];var _0x477312=createListener(_0x4250('0x7')+_0x370998,_0x493da9);OpenchannelAccountEvents['on'](_0x370998,_0x477312);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 274bb5b..2a4a4cb 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 _0x1efb=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','put','/:id','update','delete','exports','util','path','connect-timeout','express'];(function(_0x973f12,_0x516cf5){var _0x161dcd=function(_0x37a27c){while(--_0x37a27c){_0x973f12['push'](_0x973f12['shift']());}};_0x161dcd(++_0x516cf5);}(_0x1efb,0x1b6));var _0xb1ef=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x1efb[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require(_0xb1ef('0x0'));var path=require(_0xb1ef('0x1'));var timeout=require(_0xb1ef('0x2'));var express=require(_0xb1ef('0x3'));var router=express[_0xb1ef('0x4')]();var fs_extra=require(_0xb1ef('0x5'));var auth=require(_0xb1ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb1ef('0x7'));var controller=require('./openchannelApplication.controller');router[_0xb1ef('0x8')]('/',auth[_0xb1ef('0x9')](),controller[_0xb1ef('0xa')]);router[_0xb1ef('0x8')]('/:id',auth[_0xb1ef('0x9')](),controller['show']);router[_0xb1ef('0xb')]('/',auth[_0xb1ef('0x9')](),controller['create']);router[_0xb1ef('0xc')](_0xb1ef('0xd'),auth['isAuthenticated'](),controller[_0xb1ef('0xe')]);router[_0xb1ef('0xf')](_0xb1ef('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb1ef('0x10')]=router; \ No newline at end of file +var _0x6ad8=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','put','/:id','delete','util','path','connect-timeout'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x6ad8,0xdd));var _0x86ad=function(_0x55214a,_0x63f115){_0x55214a=_0x55214a-0x0;var _0x341ebe=_0x6ad8[_0x55214a];return _0x341ebe;};'use strict';var multer=require('multer');var util=require(_0x86ad('0x0'));var path=require(_0x86ad('0x1'));var timeout=require(_0x86ad('0x2'));var express=require(_0x86ad('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86ad('0x4'));var interaction=require(_0x86ad('0x5'));var config=require(_0x86ad('0x6'));var controller=require(_0x86ad('0x7'));router[_0x86ad('0x8')]('/',auth[_0x86ad('0x9')](),controller['index']);router[_0x86ad('0x8')]('/:id',auth[_0x86ad('0x9')](),controller[_0x86ad('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x86ad('0xb')](_0x86ad('0xc'),auth[_0x86ad('0x9')](),controller['update']);router[_0x86ad('0xd')](_0x86ad('0xc'),auth[_0x86ad('0x9')](),controller['destroy']);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 2cb4d80..6a2463d 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 _0x159a=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x159a,0x180));var _0xa159=function(_0x4b4889,_0x41cc03){_0x4b4889=_0x4b4889-0x0;var _0x38aac9=_0x159a[_0x4b4889];return _0x38aac9;};'use strict';var Sequelize=require('sequelize');module[_0xa159('0x0')]={'priority':{'type':Sequelize[_0xa159('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa159('0x2')],'allowNull':![],'defaultValue':_0xa159('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa159('0x2')]},'interval':{'type':Sequelize[_0xa159('0x2')],'defaultValue':_0xa159('0x4')}}; \ No newline at end of file +var _0x283b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x128335,_0x5ed274){var _0x3ea5cd=function(_0x26b521){while(--_0x26b521){_0x128335['push'](_0x128335['shift']());}};_0x3ea5cd(++_0x5ed274);}(_0x283b,0xb8));var _0xb283=function(_0x54f634,_0x4a8120){_0x54f634=_0x54f634-0x0;var _0x551cd8=_0x283b[_0x54f634];return _0x551cd8;};'use strict';var Sequelize=require(_0xb283('0x0'));module[_0xb283('0x1')]={'priority':{'type':Sequelize[_0xb283('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb283('0x3')],'allowNull':![],'defaultValue':_0xb283('0x4')},'appdata':{'type':Sequelize[_0xb283('0x5')]()},'description':{'type':Sequelize[_0xb283('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb283('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b36d680..3035958 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 _0xf98e=['limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','undefined','count','offset'];(function(_0x14af68,_0x501751){var _0xea00b=function(_0x3fa8ca){while(--_0x3fa8ca){_0x14af68['push'](_0x14af68['shift']());}};_0xea00b(++_0x501751);}(_0xf98e,0x1a3));var _0xef98=function(_0x14f830,_0x4c8edc){_0x14f830=_0x14f830-0x0;var _0xb9879b=_0xf98e[_0x14f830];return _0xb9879b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xef98('0x0'));var jsonpatch=require(_0xef98('0x1'));var rp=require(_0xef98('0x2'));var moment=require(_0xef98('0x3'));var BPromise=require(_0xef98('0x4'));var Mustache=require(_0xef98('0x5'));var util=require(_0xef98('0x6'));var path=require(_0xef98('0x7'));var sox=require(_0xef98('0x8'));var csv=require(_0xef98('0x9'));var ejs=require(_0xef98('0xa'));var fs=require('fs');var fs_extra=require(_0xef98('0xb'));var _=require(_0xef98('0xc'));var squel=require(_0xef98('0xd'));var crypto=require(_0xef98('0xe'));var jsforce=require(_0xef98('0xf'));var deskjs=require(_0xef98('0x10'));var toCsv=require('to-csv');var querystring=require(_0xef98('0x11'));var Papa=require(_0xef98('0x12'));var Redis=require('ioredis');var authService=require(_0xef98('0x13'));var qs=require(_0xef98('0x14'));var as=require(_0xef98('0x15'));var hardwareService=require(_0xef98('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xef98('0x17'));var config=require(_0xef98('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dca11,_0x1e5ea0){_0x1e5ea0=_0x1e5ea0||0xcc;return function(_0x33c68a){if(_0x33c68a){return _0x4dca11[_0xef98('0x19')](_0x1e5ea0);}return _0x4dca11[_0xef98('0x1a')](_0x1e5ea0)['end']();};}function respondWithResult(_0x48825f,_0x45df9c){_0x45df9c=_0x45df9c||0xc8;return function(_0x522368){if(_0x522368){return _0x48825f[_0xef98('0x1a')](_0x45df9c)[_0xef98('0x1b')](_0x522368);}};}function respondWithFilteredResult(_0x31f64d,_0x164d1d){return function(_0x1e3632){if(_0x1e3632){var _0x21ef7a=typeof _0x164d1d['offset']===_0xef98('0x1c')&&typeof _0x164d1d['limit']==='undefined';var _0x4b4cd6=_0x1e3632[_0xef98('0x1d')];var _0x2f6956=_0x21ef7a?0x0:_0x164d1d[_0xef98('0x1e')];var _0x5728f8=_0x21ef7a?_0x1e3632['count']:_0x164d1d['offset']+_0x164d1d[_0xef98('0x1f')];var _0x228117;if(_0x5728f8>=_0x4b4cd6){_0x5728f8=_0x4b4cd6;_0x228117=0xc8;}else{_0x228117=0xce;}_0x31f64d[_0xef98('0x1a')](_0x228117);return _0x31f64d['set'](_0xef98('0x20'),_0x2f6956+'-'+_0x5728f8+'/'+_0x4b4cd6)['json'](_0x1e3632);}return null;};}function patchUpdates(_0x308555){return function(_0x219356){try{jsonpatch[_0xef98('0x21')](_0x219356,_0x308555,!![]);}catch(_0xd5b2a8){return BPromise[_0xef98('0x22')](_0xd5b2a8);}return _0x219356[_0xef98('0x23')]();};}function saveUpdates(_0x1ae0e5,_0x2fa5f6){return function(_0x115294){if(_0x115294){return _0x115294[_0xef98('0x24')](_0x1ae0e5)[_0xef98('0x25')](function(_0x1f90c5){return _0x1f90c5;});}return null;};}function removeEntity(_0x53ce07,_0x251c87){return function(_0x44c2e3){if(_0x44c2e3){return _0x44c2e3[_0xef98('0x26')]()[_0xef98('0x25')](function(){_0x53ce07[_0xef98('0x1a')](0xcc)[_0xef98('0x27')]();});}};}function handleEntityNotFound(_0x579070,_0x45a6ee){return function(_0x154408){if(!_0x154408){_0x579070['sendStatus'](0x194);}return _0x154408;};}function handleError(_0xcd6db0,_0x5215bc){_0x5215bc=_0x5215bc||0x1f4;return function(_0x49f39d){logger[_0xef98('0x28')](_0x49f39d['stack']);if(_0x49f39d[_0xef98('0x29')]){delete _0x49f39d[_0xef98('0x29')];}_0xcd6db0[_0xef98('0x1a')](_0x5215bc)['send'](_0x49f39d);};}exports[_0xef98('0x2a')]=function(_0x508f66,_0x107f46){var _0x1cf2e4={},_0x337d63={},_0x1b2dfc={'count':0x0,'rows':[]};var _0x182898=_[_0xef98('0x2b')](db['OpenchannelApplication'][_0xef98('0x2c')],function(_0x17f49e){return{'name':_0x17f49e[_0xef98('0x2d')],'type':_0x17f49e[_0xef98('0x2e')][_0xef98('0x2f')]};});_0x337d63[_0xef98('0x30')]=_[_0xef98('0x2b')](_0x182898,_0xef98('0x29'));_0x337d63[_0xef98('0x31')]=_[_0xef98('0x32')](_0x508f66[_0xef98('0x31')]);_0x337d63[_0xef98('0x33')]=_[_0xef98('0x34')](_0x337d63['model'],_0x337d63['query']);_0x1cf2e4[_0xef98('0x35')]=_[_0xef98('0x34')](_0x337d63[_0xef98('0x30')],qs[_0xef98('0x36')](_0x508f66['query'][_0xef98('0x36')]));_0x1cf2e4[_0xef98('0x35')]=_0x1cf2e4[_0xef98('0x35')][_0xef98('0x37')]?_0x1cf2e4[_0xef98('0x35')]:_0x337d63[_0xef98('0x30')];if(!_0x508f66[_0xef98('0x31')][_0xef98('0x38')](_0xef98('0x39'))){_0x1cf2e4[_0xef98('0x1f')]=qs[_0xef98('0x1f')](_0x508f66[_0xef98('0x31')][_0xef98('0x1f')]);_0x1cf2e4[_0xef98('0x1e')]=qs[_0xef98('0x1e')](_0x508f66[_0xef98('0x31')]['offset']);}_0x1cf2e4[_0xef98('0x3a')]=qs[_0xef98('0x3b')](_0x508f66[_0xef98('0x31')][_0xef98('0x3b')]);_0x1cf2e4[_0xef98('0x3c')]=qs['filters'](_[_0xef98('0x3d')](_0x508f66['query'],_0x337d63[_0xef98('0x33')]),_0x182898);if(_0x508f66['query']['filter']){_0x1cf2e4['where']=_[_0xef98('0x3e')](_0x1cf2e4[_0xef98('0x3c')],{'$or':_[_0xef98('0x2b')](_0x182898,function(_0x17ac33){if(_0x17ac33[_0xef98('0x2e')]!==_0xef98('0x3f')){var _0x1e4a42={};_0x1e4a42[_0x17ac33['name']]={'$like':'%'+_0x508f66['query']['filter']+'%'};return _0x1e4a42;}})});}_0x1cf2e4=_['merge']({},_0x1cf2e4,_0x508f66[_0xef98('0x40')]);var _0x1e9074={'where':_0x1cf2e4[_0xef98('0x3c')]};return db[_0xef98('0x41')][_0xef98('0x1d')](_0x1e9074)[_0xef98('0x25')](function(_0x342cb2){_0x1b2dfc[_0xef98('0x1d')]=_0x342cb2;if(_0x508f66[_0xef98('0x31')][_0xef98('0x42')]){_0x1cf2e4[_0xef98('0x43')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x1cf2e4);})[_0xef98('0x25')](function(_0x29df24){_0x1b2dfc[_0xef98('0x44')]=_0x29df24;return _0x1b2dfc;})['then'](respondWithFilteredResult(_0x107f46,_0x1cf2e4))[_0xef98('0x45')](handleError(_0x107f46,null));};exports[_0xef98('0x46')]=function(_0x65b060,_0x1d6ca2){var _0x11f28a={'raw':!![],'where':{'id':_0x65b060[_0xef98('0x47')]['id']}},_0x520d4d={};_0x520d4d[_0xef98('0x30')]=_['keys'](db[_0xef98('0x41')][_0xef98('0x2c')]);_0x520d4d[_0xef98('0x31')]=_['keys'](_0x65b060[_0xef98('0x31')]);_0x520d4d['filters']=_[_0xef98('0x34')](_0x520d4d[_0xef98('0x30')],_0x520d4d[_0xef98('0x31')]);_0x11f28a[_0xef98('0x35')]=_[_0xef98('0x34')](_0x520d4d[_0xef98('0x30')],qs[_0xef98('0x36')](_0x65b060[_0xef98('0x31')][_0xef98('0x36')]));_0x11f28a[_0xef98('0x35')]=_0x11f28a['attributes']['length']?_0x11f28a[_0xef98('0x35')]:_0x520d4d[_0xef98('0x30')];if(_0x65b060[_0xef98('0x31')][_0xef98('0x42')]){_0x11f28a[_0xef98('0x43')]=[{'all':!![]}];}_0x11f28a=_[_0xef98('0x3e')]({},_0x11f28a,_0x65b060[_0xef98('0x40')]);return db[_0xef98('0x41')][_0xef98('0x48')](_0x11f28a)['then'](handleEntityNotFound(_0x1d6ca2,null))[_0xef98('0x25')](respondWithResult(_0x1d6ca2,null))[_0xef98('0x45')](handleError(_0x1d6ca2,null));};exports[_0xef98('0x49')]=function(_0x203959,_0x4501a1){return db[_0xef98('0x41')][_0xef98('0x49')](_0x203959[_0xef98('0x4a')],{})['then'](respondWithResult(_0x4501a1,0xc9))[_0xef98('0x45')](handleError(_0x4501a1,null));};exports[_0xef98('0x24')]=function(_0x5ec142,_0x1db800){if(_0x5ec142[_0xef98('0x4a')]['id']){delete _0x5ec142[_0xef98('0x4a')]['id'];}return db['OpenchannelApplication'][_0xef98('0x48')]({'where':{'id':_0x5ec142[_0xef98('0x47')]['id']}})[_0xef98('0x25')](handleEntityNotFound(_0x1db800,null))[_0xef98('0x25')](saveUpdates(_0x5ec142[_0xef98('0x4a')],null))[_0xef98('0x25')](respondWithResult(_0x1db800,null))[_0xef98('0x45')](handleError(_0x1db800,null));};exports[_0xef98('0x26')]=function(_0x5b0752,_0x20333c){return db['OpenchannelApplication'][_0xef98('0x48')]({'where':{'id':_0x5b0752[_0xef98('0x47')]['id']}})['then'](handleEntityNotFound(_0x20333c,null))[_0xef98('0x25')](removeEntity(_0x20333c,null))[_0xef98('0x45')](handleError(_0x20333c,null));}; \ No newline at end of file +var _0x121a=['attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelApplication','rows','catch','show','rawAttributes','filters','length','includeAll','find','create','body','update','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','then','destroy','stack','name','send','map','type','model','query','keys','intersection'];(function(_0x5e31f3,_0x26086d){var _0xe8f38b=function(_0x35d1c2){while(--_0x35d1c2){_0x5e31f3['push'](_0x5e31f3['shift']());}};_0xe8f38b(++_0x26086d);}(_0x121a,0x166));var _0xa121=function(_0xcfe2f6,_0x27effa){_0xcfe2f6=_0xcfe2f6-0x0;var _0x47bc9f=_0x121a[_0xcfe2f6];return _0x47bc9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa121('0x0'));var zipdir=require(_0xa121('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa121('0x2'));var moment=require(_0xa121('0x3'));var BPromise=require(_0xa121('0x4'));var Mustache=require(_0xa121('0x5'));var util=require(_0xa121('0x6'));var path=require(_0xa121('0x7'));var sox=require('sox');var csv=require(_0xa121('0x8'));var ejs=require(_0xa121('0x9'));var fs=require('fs');var fs_extra=require(_0xa121('0xa'));var _=require(_0xa121('0xb'));var squel=require(_0xa121('0xc'));var crypto=require(_0xa121('0xd'));var jsforce=require(_0xa121('0xe'));var deskjs=require(_0xa121('0xf'));var toCsv=require(_0xa121('0x8'));var querystring=require('querystring');var Papa=require(_0xa121('0x10'));var Redis=require(_0xa121('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa121('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa121('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa121('0x14'));var config=require(_0xa121('0x15'));var licenseUtil=require(_0xa121('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2751a0,_0x1e5e40){_0x1e5e40=_0x1e5e40||0xcc;return function(_0x46ff52){if(_0x46ff52){return _0x2751a0[_0xa121('0x17')](_0x1e5e40);}return _0x2751a0['status'](_0x1e5e40)[_0xa121('0x18')]();};}function respondWithResult(_0x361135,_0x3b5bd3){_0x3b5bd3=_0x3b5bd3||0xc8;return function(_0x5cb183){if(_0x5cb183){return _0x361135[_0xa121('0x19')](_0x3b5bd3)[_0xa121('0x1a')](_0x5cb183);}};}function respondWithFilteredResult(_0x12389a,_0x3cf001){return function(_0x4e50f9){if(_0x4e50f9){var _0xd9d0ea=typeof _0x3cf001['offset']===_0xa121('0x1b')&&typeof _0x3cf001[_0xa121('0x1c')]==='undefined';var _0xcc22cc=_0x4e50f9[_0xa121('0x1d')];var _0x123930=_0xd9d0ea?0x0:_0x3cf001[_0xa121('0x1e')];var _0x2dd78c=_0xd9d0ea?_0x4e50f9[_0xa121('0x1d')]:_0x3cf001[_0xa121('0x1e')]+_0x3cf001[_0xa121('0x1c')];var _0xe6329d;if(_0x2dd78c>=_0xcc22cc){_0x2dd78c=_0xcc22cc;_0xe6329d=0xc8;}else{_0xe6329d=0xce;}_0x12389a['status'](_0xe6329d);return _0x12389a[_0xa121('0x1f')]('Content-Range',_0x123930+'-'+_0x2dd78c+'/'+_0xcc22cc)[_0xa121('0x1a')](_0x4e50f9);}return null;};}function patchUpdates(_0xad6ee9){return function(_0x957e62){try{jsonpatch['apply'](_0x957e62,_0xad6ee9,!![]);}catch(_0x2d8291){return BPromise[_0xa121('0x20')](_0x2d8291);}return _0x957e62['save']();};}function saveUpdates(_0x17d1a3,_0x499121){return function(_0x36d596){if(_0x36d596){return _0x36d596['update'](_0x17d1a3)[_0xa121('0x21')](function(_0x2e2cb0){return _0x2e2cb0;});}return null;};}function removeEntity(_0x2866ad,_0x5222f6){return function(_0x28fb74){if(_0x28fb74){return _0x28fb74[_0xa121('0x22')]()[_0xa121('0x21')](function(){_0x2866ad[_0xa121('0x19')](0xcc)[_0xa121('0x18')]();});}};}function handleEntityNotFound(_0x241bc8,_0x5d9293){return function(_0x2fceba){if(!_0x2fceba){_0x241bc8[_0xa121('0x17')](0x194);}return _0x2fceba;};}function handleError(_0x265131,_0x3378fe){_0x3378fe=_0x3378fe||0x1f4;return function(_0x10d394){logger['error'](_0x10d394[_0xa121('0x23')]);if(_0x10d394[_0xa121('0x24')]){delete _0x10d394[_0xa121('0x24')];}_0x265131[_0xa121('0x19')](_0x3378fe)[_0xa121('0x25')](_0x10d394);};}exports['index']=function(_0x2a5e14,_0x3f5fe3){var _0x17a4a7={},_0x5ab38e={},_0x5e8db2={'count':0x0,'rows':[]};var _0x563a41=_[_0xa121('0x26')](db['OpenchannelApplication']['rawAttributes'],function(_0x5b96e6){return{'name':_0x5b96e6['fieldName'],'type':_0x5b96e6[_0xa121('0x27')]['key']};});_0x5ab38e[_0xa121('0x28')]=_[_0xa121('0x26')](_0x563a41,_0xa121('0x24'));_0x5ab38e[_0xa121('0x29')]=_[_0xa121('0x2a')](_0x2a5e14[_0xa121('0x29')]);_0x5ab38e['filters']=_[_0xa121('0x2b')](_0x5ab38e[_0xa121('0x28')],_0x5ab38e['query']);_0x17a4a7[_0xa121('0x2c')]=_[_0xa121('0x2b')](_0x5ab38e[_0xa121('0x28')],qs[_0xa121('0x2d')](_0x2a5e14['query'][_0xa121('0x2d')]));_0x17a4a7[_0xa121('0x2c')]=_0x17a4a7['attributes']['length']?_0x17a4a7[_0xa121('0x2c')]:_0x5ab38e[_0xa121('0x28')];if(!_0x2a5e14[_0xa121('0x29')]['hasOwnProperty'](_0xa121('0x2e'))){_0x17a4a7[_0xa121('0x1c')]=qs[_0xa121('0x1c')](_0x2a5e14[_0xa121('0x29')][_0xa121('0x1c')]);_0x17a4a7[_0xa121('0x1e')]=qs['offset'](_0x2a5e14[_0xa121('0x29')][_0xa121('0x1e')]);}_0x17a4a7['order']=qs[_0xa121('0x2f')](_0x2a5e14[_0xa121('0x29')]['sort']);_0x17a4a7[_0xa121('0x30')]=qs['filters'](_[_0xa121('0x31')](_0x2a5e14['query'],_0x5ab38e['filters']),_0x563a41);if(_0x2a5e14['query'][_0xa121('0x32')]){_0x17a4a7[_0xa121('0x30')]=_['merge'](_0x17a4a7[_0xa121('0x30')],{'$or':_[_0xa121('0x26')](_0x563a41,function(_0x58769c){if(_0x58769c[_0xa121('0x27')]!==_0xa121('0x33')){var _0x289ce9={};_0x289ce9[_0x58769c[_0xa121('0x24')]]={'$like':'%'+_0x2a5e14[_0xa121('0x29')][_0xa121('0x32')]+'%'};return _0x289ce9;}})});}_0x17a4a7=_[_0xa121('0x34')]({},_0x17a4a7,_0x2a5e14[_0xa121('0x35')]);var _0x4d91df={'where':_0x17a4a7[_0xa121('0x30')]};return db[_0xa121('0x36')]['count'](_0x4d91df)['then'](function(_0x338e57){_0x5e8db2[_0xa121('0x1d')]=_0x338e57;if(_0x2a5e14[_0xa121('0x29')]['includeAll']){_0x17a4a7['include']=[{'all':!![]}];}return db[_0xa121('0x36')]['findAll'](_0x17a4a7);})[_0xa121('0x21')](function(_0x297be7){_0x5e8db2[_0xa121('0x37')]=_0x297be7;return _0x5e8db2;})['then'](respondWithFilteredResult(_0x3f5fe3,_0x17a4a7))[_0xa121('0x38')](handleError(_0x3f5fe3,null));};exports[_0xa121('0x39')]=function(_0x200bb7,_0x302d62){var _0x59de34={'raw':!![],'where':{'id':_0x200bb7['params']['id']}},_0x23bb3f={};_0x23bb3f['model']=_[_0xa121('0x2a')](db['OpenchannelApplication'][_0xa121('0x3a')]);_0x23bb3f[_0xa121('0x29')]=_[_0xa121('0x2a')](_0x200bb7[_0xa121('0x29')]);_0x23bb3f[_0xa121('0x3b')]=_[_0xa121('0x2b')](_0x23bb3f[_0xa121('0x28')],_0x23bb3f[_0xa121('0x29')]);_0x59de34[_0xa121('0x2c')]=_[_0xa121('0x2b')](_0x23bb3f[_0xa121('0x28')],qs[_0xa121('0x2d')](_0x200bb7[_0xa121('0x29')][_0xa121('0x2d')]));_0x59de34[_0xa121('0x2c')]=_0x59de34['attributes'][_0xa121('0x3c')]?_0x59de34[_0xa121('0x2c')]:_0x23bb3f[_0xa121('0x28')];if(_0x200bb7['query'][_0xa121('0x3d')]){_0x59de34['include']=[{'all':!![]}];}_0x59de34=_[_0xa121('0x34')]({},_0x59de34,_0x200bb7[_0xa121('0x35')]);return db['OpenchannelApplication'][_0xa121('0x3e')](_0x59de34)[_0xa121('0x21')](handleEntityNotFound(_0x302d62,null))[_0xa121('0x21')](respondWithResult(_0x302d62,null))[_0xa121('0x38')](handleError(_0x302d62,null));};exports[_0xa121('0x3f')]=function(_0x23e93b,_0x2f5f8c){return db['OpenchannelApplication'][_0xa121('0x3f')](_0x23e93b[_0xa121('0x40')],{})[_0xa121('0x21')](respondWithResult(_0x2f5f8c,0xc9))['catch'](handleError(_0x2f5f8c,null));};exports[_0xa121('0x41')]=function(_0x35cadf,_0x4152fe){if(_0x35cadf[_0xa121('0x40')]['id']){delete _0x35cadf[_0xa121('0x40')]['id'];}return db['OpenchannelApplication'][_0xa121('0x3e')]({'where':{'id':_0x35cadf[_0xa121('0x42')]['id']}})[_0xa121('0x21')](handleEntityNotFound(_0x4152fe,null))['then'](saveUpdates(_0x35cadf[_0xa121('0x40')],null))['then'](respondWithResult(_0x4152fe,null))['catch'](handleError(_0x4152fe,null));};exports[_0xa121('0x22')]=function(_0x3b4517,_0x4f4dab){return db[_0xa121('0x36')]['find']({'where':{'id':_0x3b4517['params']['id']}})[_0xa121('0x21')](handleEntityNotFound(_0x4f4dab,null))['then'](removeEntity(_0x4f4dab,null))['catch'](handleError(_0x4f4dab,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c095e13..50d3246 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 _0x3174=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','util','../../config/logger'];(function(_0x1335af,_0x56c375){var _0x862fe6=function(_0x2e1a28){while(--_0x2e1a28){_0x1335af['push'](_0x1335af['shift']());}};_0x862fe6(++_0x56c375);}(_0x3174,0x7c));var _0x4317=function(_0x1f8fe9,_0x35f00e){_0x1f8fe9=_0x1f8fe9-0x0;var _0x2e0fa9=_0x3174[_0x1f8fe9];return _0x2e0fa9;};'use strict';var _=require('lodash');var util=require(_0x4317('0x0'));var logger=require(_0x4317('0x1'))(_0x4317('0x2'));var moment=require(_0x4317('0x3'));var BPromise=require('bluebird');var rp=require(_0x4317('0x4'));var fs=require('fs');var path=require(_0x4317('0x5'));var rimraf=require(_0x4317('0x6'));var config=require(_0x4317('0x7'));var attributes=require(_0x4317('0x8'));module[_0x4317('0x9')]=function(_0x15558e,_0x3fc67){return _0x15558e[_0x4317('0xa')](_0x4317('0xb'),attributes,{'tableName':_0x4317('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4317('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6d6b=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelApplication.attributes'];(function(_0x1c1ffd,_0x3365f4){var _0x693f67=function(_0x99ff99){while(--_0x99ff99){_0x1c1ffd['push'](_0x1c1ffd['shift']());}};_0x693f67(++_0x3365f4);}(_0x6d6b,0xf0));var _0xb6d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d6b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb6d6('0x0'));var util=require('util');var logger=require(_0xb6d6('0x1'))(_0xb6d6('0x2'));var moment=require(_0xb6d6('0x3'));var BPromise=require(_0xb6d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6d6('0x5'));var rimraf=require(_0xb6d6('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6d6('0x7'));module['exports']=function(_0x15b059,_0x2cf857){return _0x15b059['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5e5a0c1..b68b706 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 _0x3827=['code','message','OpenchannelApplication,\x20%s,\x20%s','catch','UpdateOpenchannelApplication','update','body','raw','options','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4e83f5,_0x503410){var _0x51e2c5=function(_0x488225){while(--_0x488225){_0x4e83f5['push'](_0x4e83f5['shift']());}};_0x51e2c5(++_0x503410);}(_0x3827,0x1db));var _0x7382=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x3827[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x7382('0x0'));var util=require(_0x7382('0x1'));var moment=require(_0x7382('0x2'));var BPromise=require(_0x7382('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7382('0x4'));var db=require(_0x7382('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7382('0x6'))(_0x7382('0x7'));var config=require(_0x7382('0x8'));var jayson=require(_0x7382('0x9'));var client=jayson['client'][_0x7382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22648d,_0x47060c,_0x5d03a4){return new BPromise(function(_0x4efe01,_0x204d9c){return client['request'](_0x22648d,_0x5d03a4)[_0x7382('0xb')](function(_0x100ce1){logger[_0x7382('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x47060c,'request\x20sent');logger[_0x7382('0xd')](_0x7382('0xe'),_0x47060c,_0x7382('0xf'),JSON[_0x7382('0x10')](_0x100ce1));if(_0x100ce1[_0x7382('0x11')]){if(_0x100ce1['error'][_0x7382('0x12')]===0x1f4){logger[_0x7382('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x47060c,_0x100ce1['error'][_0x7382('0x13')]);return _0x204d9c(_0x100ce1[_0x7382('0x11')]['message']);}logger[_0x7382('0x11')](_0x7382('0x14'),_0x47060c,_0x100ce1[_0x7382('0x11')][_0x7382('0x13')]);return _0x4efe01(_0x100ce1[_0x7382('0x11')][_0x7382('0x13')]);}else{logger['info'](_0x7382('0x14'),_0x47060c,_0x7382('0xf'));_0x4efe01(_0x100ce1['result'][_0x7382('0x13')]);}})[_0x7382('0x15')](function(_0x40720d){logger[_0x7382('0x11')](_0x7382('0x14'),_0x47060c,_0x40720d);_0x204d9c(_0x40720d);});});}exports[_0x7382('0x16')]=function(_0xec2ff5){var _0x392f58=this;return new Promise(function(_0x36bc75,_0x51106a){return db['OpenchannelApplication'][_0x7382('0x17')](_0xec2ff5[_0x7382('0x18')],{'raw':_0xec2ff5['options']?_0xec2ff5['options'][_0x7382('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xec2ff5[_0x7382('0x1a')]?_0xec2ff5[_0x7382('0x1a')]['where']||null:null,'attributes':_0xec2ff5[_0x7382('0x1a')]?_0xec2ff5['options'][_0x7382('0x1b')]||null:null,'limit':_0xec2ff5[_0x7382('0x1a')]?_0xec2ff5[_0x7382('0x1a')][_0x7382('0x1c')]||null:null})[_0x7382('0xb')](function(_0x51bd22){logger[_0x7382('0xc')](_0x7382('0x16'),_0xec2ff5);logger[_0x7382('0xd')]('UpdateOpenchannelApplication',_0xec2ff5,JSON[_0x7382('0x10')](_0x51bd22));_0x36bc75(_0x51bd22);})[_0x7382('0x15')](function(_0x2228a0){logger[_0x7382('0x11')](_0x7382('0x16'),_0x2228a0['message'],_0xec2ff5);_0x51106a(_0x392f58[_0x7382('0x11')](0x1f4,_0x2228a0['message']));});});}; \ No newline at end of file +var _0xa7b7=['body','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0xd261dc,_0x14e18b){var _0x19fdc0=function(_0x380350){while(--_0x380350){_0xd261dc['push'](_0xd261dc['shift']());}};_0x19fdc0(++_0x14e18b);}(_0xa7b7,0x186));var _0x7a7b=function(_0xd32970,_0x43a555){_0xd32970=_0xd32970-0x0;var _0x3c1ccf=_0xa7b7[_0xd32970];return _0x3c1ccf;};'use strict';var _=require('lodash');var util=require(_0x7a7b('0x0'));var moment=require(_0x7a7b('0x1'));var BPromise=require(_0x7a7b('0x2'));var rs=require(_0x7a7b('0x3'));var fs=require('fs');var Redis=require(_0x7a7b('0x4'));var db=require(_0x7a7b('0x5'))['db'];var utils=require(_0x7a7b('0x6'));var logger=require(_0x7a7b('0x7'))(_0x7a7b('0x8'));var config=require(_0x7a7b('0x9'));var jayson=require(_0x7a7b('0xa'));var client=jayson[_0x7a7b('0xb')][_0x7a7b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41af7f,_0x207fd1,_0x117aa1){return new BPromise(function(_0x1f1d66,_0x15139d){return client['request'](_0x41af7f,_0x117aa1)[_0x7a7b('0xd')](function(_0x512389){logger[_0x7a7b('0xe')](_0x7a7b('0xf'),_0x207fd1,_0x7a7b('0x10'));logger[_0x7a7b('0x11')](_0x7a7b('0x12'),_0x207fd1,_0x7a7b('0x10'),JSON[_0x7a7b('0x13')](_0x512389));if(_0x512389[_0x7a7b('0x14')]){if(_0x512389[_0x7a7b('0x14')]['code']===0x1f4){logger[_0x7a7b('0x14')](_0x7a7b('0xf'),_0x207fd1,_0x512389[_0x7a7b('0x14')][_0x7a7b('0x15')]);return _0x15139d(_0x512389[_0x7a7b('0x14')][_0x7a7b('0x15')]);}logger['error'](_0x7a7b('0xf'),_0x207fd1,_0x512389['error']['message']);return _0x1f1d66(_0x512389['error']['message']);}else{logger['info'](_0x7a7b('0xf'),_0x207fd1,'request\x20sent');_0x1f1d66(_0x512389[_0x7a7b('0x16')][_0x7a7b('0x15')]);}})[_0x7a7b('0x17')](function(_0x389219){logger['error'](_0x7a7b('0xf'),_0x207fd1,_0x389219);_0x15139d(_0x389219);});});}exports[_0x7a7b('0x18')]=function(_0x2482fd){var _0x1fa6cf=this;return new Promise(function(_0x526dbd,_0x4a8e42){return db[_0x7a7b('0x19')]['update'](_0x2482fd[_0x7a7b('0x1a')],{'raw':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd[_0x7a7b('0x1b')][_0x7a7b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd['options'][_0x7a7b('0x1d')]||null:null,'attributes':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd[_0x7a7b('0x1b')][_0x7a7b('0x1e')]||null:null,'limit':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd['options'][_0x7a7b('0x1f')]||null:null})['then'](function(_0x4279a6){logger[_0x7a7b('0xe')]('UpdateOpenchannelApplication',_0x2482fd);logger[_0x7a7b('0x11')]('UpdateOpenchannelApplication',_0x2482fd,JSON[_0x7a7b('0x13')](_0x4279a6));_0x526dbd(_0x4279a6);})[_0x7a7b('0x17')](function(_0x4f90a1){logger[_0x7a7b('0x14')]('UpdateOpenchannelApplication',_0x4f90a1[_0x7a7b('0x15')],_0x2482fd);_0x4a8e42(_0x1fa6cf[_0x7a7b('0x14')](0x1f4,_0x4f90a1[_0x7a7b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0febb11..5c4820f 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 _0x48f4=['post','create','addMessage','tracked','addTags','openchannel','delete','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','path','connect-timeout','express','Router','fs-extra','./openchannelInteraction.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x48f4,0xb3));var _0x448f=function(_0x20cf0c,_0x14259b){_0x20cf0c=_0x20cf0c-0x0;var _0x4a5336=_0x48f4[_0x20cf0c];return _0x4a5336;};'use strict';var multer=require(_0x448f('0x0'));var util=require('util');var path=require(_0x448f('0x1'));var timeout=require(_0x448f('0x2'));var express=require(_0x448f('0x3'));var router=express[_0x448f('0x4')]();var fs_extra=require(_0x448f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x448f('0x6'));router[_0x448f('0x7')]('/',auth['isAuthenticated'](),controller[_0x448f('0x8')]);router[_0x448f('0x7')](_0x448f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x448f('0x7')](_0x448f('0xa'),auth[_0x448f('0xb')](),controller[_0x448f('0xc')]);router[_0x448f('0x7')](_0x448f('0xd'),auth[_0x448f('0xb')](),controller[_0x448f('0xe')]);router[_0x448f('0x7')](_0x448f('0xf'),auth['isAuthenticated'](),controller[_0x448f('0x10')]);router[_0x448f('0x11')]('/',auth[_0x448f('0xb')](),controller[_0x448f('0x12')]);router[_0x448f('0x11')](_0x448f('0xd'),auth[_0x448f('0xb')](),controller[_0x448f('0x13')]);router[_0x448f('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x448f('0x14')]('openchannel','openchannelinteraction:addtags'),controller[_0x448f('0x15')]);router['put'](_0x448f('0xa'),auth[_0x448f('0xb')](),interaction['tracked'](_0x448f('0x16'),'openchannelinteraction:update'),controller['update']);router[_0x448f('0x17')](_0x448f('0xa'),auth['isAuthenticated'](),interaction[_0x448f('0x14')]('openchannel',_0x448f('0x18')),controller[_0x448f('0x19')]);router[_0x448f('0x17')](_0x448f('0x1a'),auth['isAuthenticated'](),controller['removeTags']);module[_0x448f('0x1b')]=router; \ No newline at end of file +var _0x6bdc=['tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage'];(function(_0x40a9da,_0x4b0f34){var _0x3de8f3=function(_0x5726d9){while(--_0x5726d9){_0x40a9da['push'](_0x40a9da['shift']());}};_0x3de8f3(++_0x4b0f34);}(_0x6bdc,0x87));var _0xc6bd=function(_0x59704c,_0x2e88bc){_0x59704c=_0x59704c-0x0;var _0x291962=_0x6bdc[_0x59704c];return _0x291962;};'use strict';var multer=require('multer');var util=require(_0xc6bd('0x0'));var path=require(_0xc6bd('0x1'));var timeout=require(_0xc6bd('0x2'));var express=require(_0xc6bd('0x3'));var router=express[_0xc6bd('0x4')]();var fs_extra=require(_0xc6bd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc6bd('0x6'));var controller=require(_0xc6bd('0x7'));router[_0xc6bd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6bd('0x8')](_0xc6bd('0x9'),auth['isAuthenticated'](),controller[_0xc6bd('0xa')]);router[_0xc6bd('0x8')](_0xc6bd('0xb'),auth[_0xc6bd('0xc')](),controller[_0xc6bd('0xd')]);router[_0xc6bd('0x8')](_0xc6bd('0xe'),auth[_0xc6bd('0xc')](),controller['getMessages']);router[_0xc6bd('0x8')](_0xc6bd('0xf'),auth['isAuthenticated'](),controller[_0xc6bd('0x10')]);router[_0xc6bd('0x11')]('/',auth[_0xc6bd('0xc')](),controller[_0xc6bd('0x12')]);router[_0xc6bd('0x11')]('/:id/messages',auth[_0xc6bd('0xc')](),controller[_0xc6bd('0x13')]);router[_0xc6bd('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xc6bd('0x14')](_0xc6bd('0x15'),_0xc6bd('0x16')),controller[_0xc6bd('0x17')]);router['put'](_0xc6bd('0xb'),auth['isAuthenticated'](),interaction[_0xc6bd('0x14')](_0xc6bd('0x15'),_0xc6bd('0x18')),controller[_0xc6bd('0x19')]);router[_0xc6bd('0x1a')](_0xc6bd('0xb'),auth[_0xc6bd('0xc')](),interaction[_0xc6bd('0x14')](_0xc6bd('0x15'),_0xc6bd('0x1b')),controller[_0xc6bd('0x1c')]);router['delete'](_0xc6bd('0x1d'),auth[_0xc6bd('0xc')](),controller[_0xc6bd('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6184da0..da1b6d6 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 _0xa9e5=['sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x55b5a6,_0x281692){var _0x32ced7=function(_0x256b96){while(--_0x256b96){_0x55b5a6['push'](_0x55b5a6['shift']());}};_0x32ced7(++_0x281692);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x36b009,_0x2acf01){_0x36b009=_0x36b009-0x0;var _0x4e04fb=_0xa9e5[_0x36b009];return _0x4e04fb;};'use strict';var Sequelize=require(_0x5a9e('0x0'));module[_0x5a9e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5a9e('0x2')]},'disposition':{'type':Sequelize[_0x5a9e('0x3')]},'secondDisposition':{'type':Sequelize[_0x5a9e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5a9e('0x3')]},'note':{'type':Sequelize[_0x5a9e('0x3')]},'read1stAt':{'type':Sequelize[_0x5a9e('0x2')]},'threadId':{'type':Sequelize[_0x5a9e('0x3')]},'externalUrl':{'type':Sequelize[_0x5a9e('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5a9e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x5a9e('0x4')]('in',_0x5a9e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x5a9e('0x4')]('in',_0x5a9e('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5a9e('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xda65=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x427c7d,_0x40100b){var _0x3082fe=function(_0x11c7be){while(--_0x11c7be){_0x427c7d['push'](_0x427c7d['shift']());}};_0x3082fe(++_0x40100b);}(_0xda65,0x1d0));var _0x5da6=function(_0x51f052,_0x222f05){_0x51f052=_0x51f052-0x0;var _0x51067e=_0xda65[_0x51f052];return _0x51067e;};'use strict';var Sequelize=require(_0x5da6('0x0'));module[_0x5da6('0x1')]={'closed':{'type':Sequelize[_0x5da6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5da6('0x3')]},'secondDisposition':{'type':Sequelize[_0x5da6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5da6('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x5da6('0x3')]},'externalUrl':{'type':Sequelize[_0x5da6('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5da6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5da6('0x5')]('in',_0x5da6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5da6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index f80ac07..c5e5835 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 _0x92ed=['params','keys','filters','model','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','body','destroy','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','omit','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','Openchannel','closed','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','System','firstName','value','renderFile','downloadInteraction.ejs','transcript-','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','localhost','redis','register','sendStatus','status','offset','limit','undefined','count','Content-Range','update','then','end','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','key','getOptions','openchannel','query','type','from'];(function(_0x5b5d0a,_0x1ad092){var _0x9777f6=function(_0x4d938e){while(--_0x4d938e){_0x5b5d0a['push'](_0x5b5d0a['shift']());}};_0x9777f6(++_0x1ad092);}(_0x92ed,0xd5));var _0xd92e=function(_0x52d481,_0x5cef5c){_0x52d481=_0x52d481-0x0;var _0x3c4aa7=_0x92ed[_0x52d481];return _0x3c4aa7;};'use strict';var rimraf=require(_0xd92e('0x0'));var zipdir=require(_0xd92e('0x1'));var moment=require('moment');var util=require(_0xd92e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd92e('0x3'));var Redis=require(_0xd92e('0x4'));var interaction=require(_0xd92e('0x5'));var qs=require(_0xd92e('0x6'));var pdf=require(_0xd92e('0x7'));var logger=require(_0xd92e('0x8'))(_0xd92e('0x9'));var config=require('../../config/environment');var db=require(_0xd92e('0xa'))['db'];config['redis']=_[_0xd92e('0xb')](config['redis'],{'host':_0xd92e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd92e('0xd')]));require('./openchannelInteraction.socket')[_0xd92e('0xe')](socket);function respondWithStatusCode(_0x48acb0,_0x3b0e3a){_0x3b0e3a=_0x3b0e3a||0xcc;return function(_0x465956){if(_0x465956){return _0x48acb0[_0xd92e('0xf')](_0x3b0e3a);}return _0x48acb0[_0xd92e('0x10')](_0x3b0e3a)['end']();};}function respondWithResult(_0x638d3c,_0x2662ec){_0x2662ec=_0x2662ec||0xc8;return function(_0x424203){if(_0x424203){return _0x638d3c[_0xd92e('0x10')](_0x2662ec)['json'](_0x424203);}};}function respondWithFilteredResult(_0x2c2254,_0x2b4706){return function(_0x376281){if(_0x376281){var _0x257ba0=typeof _0x2b4706[_0xd92e('0x11')]==='undefined'&&typeof _0x2b4706[_0xd92e('0x12')]===_0xd92e('0x13');var _0x1972d8=_0x376281[_0xd92e('0x14')];var _0x430770=_0x257ba0?0x0:_0x2b4706[_0xd92e('0x11')];var _0x5a6469=_0x257ba0?_0x376281[_0xd92e('0x14')]:_0x2b4706[_0xd92e('0x11')]+_0x2b4706[_0xd92e('0x12')];var _0x28a11d;if(_0x5a6469>=_0x1972d8){_0x5a6469=_0x1972d8;_0x28a11d=0xc8;}else{_0x28a11d=0xce;}_0x2c2254[_0xd92e('0x10')](_0x28a11d);return _0x2c2254['set'](_0xd92e('0x15'),_0x430770+'-'+_0x5a6469+'/'+_0x1972d8)['json'](_0x376281);}return null;};}function saveUpdates(_0x503c8f){return function(_0x5e8cfc){if(_0x5e8cfc){return _0x5e8cfc[_0xd92e('0x16')](_0x503c8f)['then'](function(_0x430f9f){return _0x430f9f;});}return null;};}function removeEntity(_0x7fac90){return function(_0x1ac62b){if(_0x1ac62b){return _0x1ac62b['destroy']()[_0xd92e('0x17')](function(){_0x7fac90['status'](0xcc)[_0xd92e('0x18')]();});}};}function handleEntityNotFound(_0x3670be){return function(_0x29c14b){if(!_0x29c14b){_0x3670be[_0xd92e('0xf')](0x194);}return _0x29c14b;};}function handleError(_0x19ffc3,_0x3ad458){_0x3ad458=_0x3ad458||0x1f4;return function(_0x4cfa82){logger[_0xd92e('0x19')](_0x4cfa82[_0xd92e('0x1a')]);if(_0x4cfa82[_0xd92e('0x1b')]){delete _0x4cfa82[_0xd92e('0x1b')];}_0x19ffc3[_0xd92e('0x10')](_0x3ad458)[_0xd92e('0x1c')](_0x4cfa82);};}exports['index']=function(_0x3869e3,_0xb2bbe7){var _0x310c13={};var _0x2304a6=_[_0xd92e('0x1d')](db[_0xd92e('0x1e')][_0xd92e('0x1f')],function(_0x438df4){return{'name':_0x438df4[_0xd92e('0x20')],'type':_0x438df4['type'][_0xd92e('0x21')]};});_0x310c13=qs[_0xd92e('0x22')](_0x2304a6,_0x3869e3);return interaction['findAll'](_0xd92e('0x23'),_0x3869e3[_0xd92e('0x24')],_0x3869e3['user'],_0x310c13,_0x2304a6)['then'](respondWithFilteredResult(_0xb2bbe7,_0x310c13))['catch'](handleError(_0xb2bbe7,null));};exports['show']=function(_0x1073ca,_0x97800c){var _0x462d5c={};if(_0x1073ca[_0xd92e('0x24')][_0xd92e('0x25')]&&_0x1073ca[_0xd92e('0x24')][_0xd92e('0x25')]==='from'){_0x462d5c[_0xd92e('0x26')]=_0x1073ca[_0xd92e('0x27')]['id'];}else{_0x462d5c['id']=_0x1073ca[_0xd92e('0x27')]['id'];}var _0x2c208d={'raw':![],'where':_0x462d5c},_0x110cab={};_0x110cab['model']=_[_0xd92e('0x28')](db[_0xd92e('0x1e')]['rawAttributes']);_0x110cab[_0xd92e('0x24')]=_[_0xd92e('0x28')](_0x1073ca[_0xd92e('0x24')]);_0x110cab[_0xd92e('0x29')]=_['intersection'](_0x110cab[_0xd92e('0x2a')],_0x110cab[_0xd92e('0x24')]);_0x2c208d[_0xd92e('0x2b')]=_[_0xd92e('0x2c')](_0x110cab[_0xd92e('0x2a')],qs[_0xd92e('0x2d')](_0x1073ca[_0xd92e('0x24')][_0xd92e('0x2d')]));_0x2c208d[_0xd92e('0x2b')]=_0x2c208d['attributes'][_0xd92e('0x2e')]?_0x2c208d['attributes']:_0x110cab[_0xd92e('0x2a')];if(_0x1073ca['query'][_0xd92e('0x2f')]){_0x2c208d['include']=[{'all':!![]}];}_0x2c208d=_[_0xd92e('0x30')]({},_0x2c208d,_0x1073ca[_0xd92e('0x31')]);return db[_0xd92e('0x1e')][_0xd92e('0x32')](_0x2c208d)['then'](handleEntityNotFound(_0x97800c,null))[_0xd92e('0x17')](respondWithResult(_0x97800c,null))[_0xd92e('0x33')](handleError(_0x97800c,null));};exports[_0xd92e('0x34')]=function(_0x5b059c,_0x11bba4){return db['OpenchannelInteraction'][_0xd92e('0x34')](_0x5b059c[_0xd92e('0x35')],{})['then'](respondWithResult(_0x11bba4,0xc9))[_0xd92e('0x33')](handleError(_0x11bba4,null));};exports[_0xd92e('0x16')]=function(_0x96099,_0x9c48c){if(_0x96099['body']['id']){delete _0x96099[_0xd92e('0x35')]['id'];}return db[_0xd92e('0x1e')][_0xd92e('0x32')]({'where':{'id':_0x96099[_0xd92e('0x27')]['id']}})[_0xd92e('0x17')](handleEntityNotFound(_0x9c48c,null))['then'](saveUpdates(_0x96099[_0xd92e('0x35')],null))[_0xd92e('0x17')](respondWithResult(_0x9c48c,null))['catch'](handleError(_0x9c48c,null));};exports[_0xd92e('0x36')]=function(_0x371545,_0x3ccfd0){return db['OpenchannelInteraction']['find']({'where':{'id':_0x371545[_0xd92e('0x27')]['id']}})['then'](handleEntityNotFound(_0x3ccfd0,null))[_0xd92e('0x17')](removeEntity(_0x3ccfd0,null))[_0xd92e('0x33')](handleError(_0x3ccfd0,null));};exports[_0xd92e('0x37')]=function(_0xa044ec,_0x1a7b36){return db[_0xd92e('0x1e')]['describe']()[_0xd92e('0x17')](respondWithResult(_0x1a7b36,null))[_0xd92e('0x33')](handleError(_0x1a7b36,null));};exports[_0xd92e('0x38')]=function(_0x4f30d5,_0x12ccab){return db['OpenchannelMessage']['find']({'where':{'id':_0x4f30d5[_0xd92e('0x27')]['id']}})[_0xd92e('0x17')](handleEntityNotFound(_0x12ccab,null))[_0xd92e('0x17')](function(_0x5c0626){if(_0x5c0626){return _0x5c0626[_0xd92e('0x38')](_0x4f30d5[_0xd92e('0x35')][_0xd92e('0x39')],_['omit'](_0x4f30d5['body'],['ids','id'])||{});}})[_0xd92e('0x17')](respondWithResult(_0x12ccab,null))['catch'](handleError(_0x12ccab,null));};exports[_0xd92e('0x3a')]=function(_0x584244,_0x2e223f){var _0xa0bc3a={'raw':![],'where':{}};var _0x107196={};var _0x3e3ec0={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xd92e('0x3b')]({'where':{'id':_0x584244[_0xd92e('0x27')]['id']}})['then'](handleEntityNotFound(_0x2e223f,null))[_0xd92e('0x17')](function(_0x52b9cd){if(_0x52b9cd){_0x107196[_0xd92e('0x2a')]=_['keys'](db[_0xd92e('0x3c')][_0xd92e('0x1f')]);_0x107196[_0xd92e('0x24')]=_[_0xd92e('0x28')](_0x584244['query']);_0x107196[_0xd92e('0x29')]=_[_0xd92e('0x2c')](_0x107196[_0xd92e('0x2a')],_0x107196[_0xd92e('0x24')]);_0xa0bc3a[_0xd92e('0x2b')]=_[_0xd92e('0x2c')](_0x107196[_0xd92e('0x2a')],qs[_0xd92e('0x2d')](_0x584244['query'][_0xd92e('0x2d')]));_0xa0bc3a[_0xd92e('0x2b')]=_0xa0bc3a[_0xd92e('0x2b')][_0xd92e('0x2e')]?_0xa0bc3a[_0xd92e('0x2b')]:_0x107196[_0xd92e('0x2a')];if(!_0x584244[_0xd92e('0x24')][_0xd92e('0x3d')]('nolimit')){_0xa0bc3a[_0xd92e('0x12')]=qs[_0xd92e('0x12')](_0x584244[_0xd92e('0x24')]['limit']);_0xa0bc3a['offset']=qs['offset'](_0x584244['query']['offset']);}_0xa0bc3a[_0xd92e('0x3e')]=qs[_0xd92e('0x3f')](_0x584244['query'][_0xd92e('0x3f')]);_0xa0bc3a[_0xd92e('0x40')]=qs['filters'](_[_0xd92e('0x41')](_0x584244[_0xd92e('0x24')],_0x107196[_0xd92e('0x29')]));_0xa0bc3a[_0xd92e('0x40')]['OpenchannelInteractionId']=_0x52b9cd['id'];if(_0x584244['query']['filter']){_0xa0bc3a[_0xd92e('0x40')]=_[_0xd92e('0x30')](_0xa0bc3a[_0xd92e('0x40')],{'$or':_[_0xd92e('0x1d')](_0xa0bc3a[_0xd92e('0x2b')],function(_0xb9e20){var _0x2440c8={};_0x2440c8[_0xb9e20]={'$like':'%'+_0x584244[_0xd92e('0x24')][_0xd92e('0x42')]+'%'};return _0x2440c8;})});}if(_0x584244[_0xd92e('0x24')][_0xd92e('0x43')]){var _0x1c1e6d=_0x584244[_0xd92e('0x24')][_0xd92e('0x43')][_0xd92e('0x44')](',');var _0x843b38={};_0x843b38[_0x1c1e6d[0x0]]={'$gte':moment(_0x1c1e6d[0x1])[_0xd92e('0x45')](_0xd92e('0x46'))};_0xa0bc3a[_0xd92e('0x40')]=_[_0xd92e('0x30')](_0xa0bc3a[_0xd92e('0x40')],_0x843b38);}_0xa0bc3a=_['merge']({},_0xa0bc3a,_0x584244[_0xd92e('0x31')]);return db[_0xd92e('0x3c')][_0xd92e('0x14')]({'where':_0xa0bc3a[_0xd92e('0x40')]})[_0xd92e('0x17')](function(_0x538e6c){_0x3e3ec0[_0xd92e('0x14')]=_0x538e6c;if(_0x584244[_0xd92e('0x24')][_0xd92e('0x2f')]){_0xa0bc3a[_0xd92e('0x47')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xd92e('0x48')](_0xa0bc3a);})[_0xd92e('0x17')](function(_0x3dd77e){_0x3e3ec0[_0xd92e('0x49')]=_0x3dd77e;return _0x3e3ec0;});}})[_0xd92e('0x17')](respondWithFilteredResult(_0x2e223f,_0xa0bc3a))[_0xd92e('0x33')](handleError(_0x2e223f,null));};exports[_0xd92e('0x4a')]=function(_0x222510,_0x5e2094){return db[_0xd92e('0x1e')]['find']({'where':{'id':_0x222510['params']['id']}})[_0xd92e('0x17')](handleEntityNotFound(_0x5e2094,null))['then'](function(_0x14dc9e){if(_0x14dc9e){return _0x14dc9e['setTags'](_0x222510[_0xd92e('0x35')][_0xd92e('0x39')],_[_0xd92e('0x4b')](_0x222510['body'],[_0xd92e('0x39'),'id'])||{})['spread'](function(){return db[_0xd92e('0x4c')][_0xd92e('0x48')]({'attributes':['id','name',_0xd92e('0x4d')],'where':{'id':_0x222510[_0xd92e('0x35')][_0xd92e('0x39')]}});})[_0xd92e('0x17')](function(_0x5340f0){socket[_0xd92e('0x4e')](_0xd92e('0x4f'),{'id':Number(_0x222510[_0xd92e('0x27')]['id']),'tags':_0x5340f0||[]});return{'id':Number(_0x222510[_0xd92e('0x27')]['id']),'tags':_0x5340f0||[]};});}})[_0xd92e('0x17')](respondWithResult(_0x5e2094,null))[_0xd92e('0x33')](handleError(_0x5e2094,null));};exports[_0xd92e('0x50')]=function(_0x4ad788,_0x373f47){return db[_0xd92e('0x1e')][_0xd92e('0x32')]({'where':{'id':_0x4ad788['params']['id']}})[_0xd92e('0x17')](handleEntityNotFound(_0x373f47,null))['then'](function(_0x468ced){if(_0x468ced){return _0x468ced[_0xd92e('0x50')](_0x4ad788['query'][_0xd92e('0x39')]);}})[_0xd92e('0x17')](respondWithStatusCode(_0x373f47,null))[_0xd92e('0x33')](handleError(_0x373f47,null));};exports[_0xd92e('0x51')]=function(_0x2b1b83,_0x1a6e01){var _0x575c7c=moment()[_0xd92e('0x52')]()[_0xd92e('0x53')]();var _0x18a856=path[_0xd92e('0x54')](config[_0xd92e('0x55')],_0xd92e('0x56'),_0xd92e('0x57'),_0xd92e('0x58'));var _0x368ce6=path['join'](config['root'],_0xd92e('0x56'),_0xd92e('0x57'),_0xd92e('0x59'));var _0x53c517=path['join'](_0x18a856,_0x575c7c);var _0x50dfa8=util[_0xd92e('0x45')](_0xd92e('0x5a'),_0x2b1b83[_0xd92e('0x27')]['id'],_0x575c7c);var _0x583c0b=path[_0xd92e('0x54')](_0x18a856,_0x50dfa8);var _0x532be6=[];_0x532be6['push']({'model':db[_0xd92e('0x5b')],'as':_0xd92e('0x5b'),'attributes':['id',_0xd92e('0x5c')],'raw':!![]});_0x532be6[_0xd92e('0x5d')]({'model':db[_0xd92e('0x5e')],'as':_0xd92e('0x5f'),'attributes':['id','firstName',_0xd92e('0x60')],'raw':!![]});if(_0x2b1b83[_0xd92e('0x24')]['attachments']){_0x532be6[_0xd92e('0x5d')]({'model':db[_0xd92e('0x61')],'as':_0xd92e('0x61'),'raw':!![]});}var _0x5b98d0=[{'model':db[_0xd92e('0x3c')],'as':_0xd92e('0x62'),'attributes':['id',_0xd92e('0x35'),_0xd92e('0x63'),_0xd92e('0x64'),_0xd92e('0x65'),_0xd92e('0x66')],'include':_0x532be6}];_0x5b98d0[_0xd92e('0x5d')]({'model':db[_0xd92e('0x67')],'as':_0xd92e('0x68'),'attributes':['id','name']});_0x5b98d0[_0xd92e('0x5d')]({'model':db[_0xd92e('0x5b')],'as':_0xd92e('0x69'),'attributes':['id',_0xd92e('0x5c')]});return db['OpenchannelInteraction'][_0xd92e('0x32')]({'where':{'id':_0x2b1b83[_0xd92e('0x27')]['id']},'include':_0x5b98d0})['then'](handleEntityNotFound(_0x1a6e01,null))[_0xd92e('0x17')](function(_0x31b8cc){if(_0x31b8cc){var _0x228ccb=_0x31b8cc[_0xd92e('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x53c517);var _0x10c702={'channel':_0xd92e('0x6b'),'account':_0x228ccb[_0xd92e('0x68')]['name'],'agent':_0x228ccb[_0xd92e('0x69')]?_0x228ccb['Owner']['fullname']:'N.A.','createdAt':moment(_0x228ccb['createdAt'])['format'](_0xd92e('0x46'))[_0xd92e('0x53')](),'closedAt':_0x228ccb[_0xd92e('0x6c')]?moment(_0x228ccb[_0xd92e('0x6d')])[_0xd92e('0x45')](_0xd92e('0x46'))[_0xd92e('0x53')]():'','disposition':_0x228ccb[_0xd92e('0x6e')],'visibility':_0x228ccb[_0xd92e('0x6f')]?_0xd92e('0x70'):'Private','messages':_(_0x228ccb[_0xd92e('0x62')])[_0xd92e('0x42')]({'secret':![]})[_0xd92e('0x1d')](function(_0x236439){if(_0x236439[_0xd92e('0x61')]){var _0xf2a0f1=path[_0xd92e('0x54')](_0x368ce6,_0x236439[_0xd92e('0x61')][_0xd92e('0x71')]);if(fs[_0xd92e('0x72')](_0xf2a0f1)){fs[_0xd92e('0x73')](_0xf2a0f1)[_0xd92e('0x74')](fs[_0xd92e('0x75')](path[_0xd92e('0x54')](_0x53c517,_0x236439[_0xd92e('0x61')]['basename'])));}}return{'date':moment(_0x236439['createdAt'])[_0xd92e('0x45')](_0xd92e('0x46'))['toString'](),'sender':_0x236439['direction']==='out'?_0x236439[_0xd92e('0x5b')]?_0x236439[_0xd92e('0x5b')][_0xd92e('0x5c')]:_0xd92e('0x76'):_0x236439[_0xd92e('0x5f')][_0xd92e('0x77')]+(_0x236439['Contact'][_0xd92e('0x60')]?'\x20'+_0x236439[_0xd92e('0x5f')][_0xd92e('0x60')]:''),'body':_0x236439['Attachment']?_0x236439[_0xd92e('0x61')][_0xd92e('0x71')]:_0x236439['body'],'direction':_0x236439[_0xd92e('0x64')]==='out'?'A':'C','secret':_0x236439['secret'],'read':_0x236439[_0xd92e('0x66')],'attachment':_0x236439[_0xd92e('0x61')]};})[_0xd92e('0x78')]()};return ejs[_0xd92e('0x79')](path[_0xd92e('0x54')](config['root'],_0xd92e('0x56'),'views',_0xd92e('0x7a')),{'interaction':_0x10c702})[_0xd92e('0x17')](function(_0x46af5f){var _0x38e1bd=path[_0xd92e('0x54')](_0x53c517,_0xd92e('0x7b')+_0x228ccb['id']+'-'+_0x575c7c+'.pdf');var _0x353d32={'path':_0x38e1bd,'channel':_0xd92e('0x6b'),'interactionId':_0x228ccb['id']};return pdf['createPdfFromHTML'](_0x46af5f,_0x353d32);})[_0xd92e('0x17')](function(){return new Promise(function(_0x1480a0,_0x59ec27){zipdir(_0x53c517,{'saveTo':_0x583c0b},function(_0x177a96,_0x42e13b){if(_0x177a96)return _0x59ec27(_0x177a96);return _0x1480a0(_0x42e13b);});})[_0xd92e('0x17')](function(){return new Promise(function(_0x3f89e7,_0x1000ef){rimraf(_0x53c517,function(_0x140c83){if(_0x140c83)_0x1000ef(_0x140c83);return _0x3f89e7();});});})['then'](function(){return _0x1a6e01[_0xd92e('0x51')](_0x583c0b,_0x50dfa8,function(_0x5f4fa5){if(_0x5f4fa5){logger[_0xd92e('0x19')](_0xd92e('0x7c'),_0x5f4fa5);}else{fs[_0xd92e('0x7d')](_0x583c0b);}});});});}else{return _0x1a6e01[_0xd92e('0xf')](0xc8);}})[_0xd92e('0x33')](handleError(_0x1a6e01,null));}; \ No newline at end of file +var _0x131d=['create','body','describe','addMessage','OpenchannelMessage','ids','omit','findOne','nolimit','order','sort','where','OpenchannelInteractionId','merge','map','filter','$gte','split','format','findAll','rows','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Attachment','Messages','read','OpenchannelAccount','Owner','fullname','get','Openchannel','Account','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','basename','existsSync','pipe','createWriteStream','direction','out','lastName','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','set','json','update','then','destroy','status','error','stack','name','send','OpenchannelInteraction','rawAttributes','fieldName','getOptions','catch','query','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x131d,0x1bb));var _0xd131=function(_0x30a931,_0x440026){_0x30a931=_0x30a931-0x0;var _0x5b7ab1=_0x131d[_0x30a931];return _0x5b7ab1;};'use strict';var rimraf=require(_0xd131('0x0'));var zipdir=require(_0xd131('0x1'));var moment=require(_0xd131('0x2'));var util=require('util');var path=require(_0xd131('0x3'));var ejs=require(_0xd131('0x4'));var fs=require('fs');var _=require(_0xd131('0x5'));var Redis=require('ioredis');var interaction=require(_0xd131('0x6'));var qs=require(_0xd131('0x7'));var pdf=require(_0xd131('0x8'));var logger=require(_0xd131('0x9'))('api');var config=require(_0xd131('0xa'));var db=require(_0xd131('0xb'))['db'];config[_0xd131('0xc')]=_[_0xd131('0xd')](config['redis'],{'host':_0xd131('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd131('0xc')]));require(_0xd131('0xf'))[_0xd131('0x10')](socket);function respondWithStatusCode(_0x3a65b2,_0x4df969){_0x4df969=_0x4df969||0xcc;return function(_0x450c71){if(_0x450c71){return _0x3a65b2[_0xd131('0x11')](_0x4df969);}return _0x3a65b2['status'](_0x4df969)[_0xd131('0x12')]();};}function respondWithResult(_0x5ebf0d,_0x5e6c99){_0x5e6c99=_0x5e6c99||0xc8;return function(_0x22c16d){if(_0x22c16d){return _0x5ebf0d['status'](_0x5e6c99)['json'](_0x22c16d);}};}function respondWithFilteredResult(_0x598205,_0x13dbf0){return function(_0x3bf713){if(_0x3bf713){var _0x332f4a=typeof _0x13dbf0[_0xd131('0x13')]===_0xd131('0x14')&&typeof _0x13dbf0[_0xd131('0x15')]===_0xd131('0x14');var _0xd88b2a=_0x3bf713[_0xd131('0x16')];var _0x38bb78=_0x332f4a?0x0:_0x13dbf0[_0xd131('0x13')];var _0x5a6b9f=_0x332f4a?_0x3bf713['count']:_0x13dbf0[_0xd131('0x13')]+_0x13dbf0['limit'];var _0x35151c;if(_0x5a6b9f>=_0xd88b2a){_0x5a6b9f=_0xd88b2a;_0x35151c=0xc8;}else{_0x35151c=0xce;}_0x598205['status'](_0x35151c);return _0x598205[_0xd131('0x17')]('Content-Range',_0x38bb78+'-'+_0x5a6b9f+'/'+_0xd88b2a)[_0xd131('0x18')](_0x3bf713);}return null;};}function saveUpdates(_0x123d8d){return function(_0x5b14d5){if(_0x5b14d5){return _0x5b14d5[_0xd131('0x19')](_0x123d8d)[_0xd131('0x1a')](function(_0x5b3df0){return _0x5b3df0;});}return null;};}function removeEntity(_0x492c63){return function(_0x3994a5){if(_0x3994a5){return _0x3994a5[_0xd131('0x1b')]()[_0xd131('0x1a')](function(){_0x492c63[_0xd131('0x1c')](0xcc)[_0xd131('0x12')]();});}};}function handleEntityNotFound(_0x3b6663){return function(_0x198818){if(!_0x198818){_0x3b6663['sendStatus'](0x194);}return _0x198818;};}function handleError(_0x1ca180,_0x275ec5){_0x275ec5=_0x275ec5||0x1f4;return function(_0x3914dc){logger[_0xd131('0x1d')](_0x3914dc[_0xd131('0x1e')]);if(_0x3914dc[_0xd131('0x1f')]){delete _0x3914dc[_0xd131('0x1f')];}_0x1ca180[_0xd131('0x1c')](_0x275ec5)[_0xd131('0x20')](_0x3914dc);};}exports['index']=function(_0x2a3bef,_0x51b9ed){var _0x390124={};var _0x414e85=_['map'](db[_0xd131('0x21')][_0xd131('0x22')],function(_0x1eb6df){return{'name':_0x1eb6df[_0xd131('0x23')],'type':_0x1eb6df['type']['key']};});_0x390124=qs[_0xd131('0x24')](_0x414e85,_0x2a3bef);return interaction['findAll']('openchannel',_0x2a3bef['query'],_0x2a3bef['user'],_0x390124,_0x414e85)[_0xd131('0x1a')](respondWithFilteredResult(_0x51b9ed,_0x390124))[_0xd131('0x25')](handleError(_0x51b9ed,null));};exports['show']=function(_0x46a3e3,_0x60e287){var _0x2a986e={};if(_0x46a3e3[_0xd131('0x26')][_0xd131('0x27')]&&_0x46a3e3[_0xd131('0x26')][_0xd131('0x27')]===_0xd131('0x28')){_0x2a986e['from']=_0x46a3e3[_0xd131('0x29')]['id'];}else{_0x2a986e['id']=_0x46a3e3['params']['id'];}var _0x4c16b3={'raw':![],'where':_0x2a986e},_0x454025={};_0x454025[_0xd131('0x2a')]=_[_0xd131('0x2b')](db[_0xd131('0x21')][_0xd131('0x22')]);_0x454025[_0xd131('0x26')]=_[_0xd131('0x2b')](_0x46a3e3['query']);_0x454025[_0xd131('0x2c')]=_[_0xd131('0x2d')](_0x454025[_0xd131('0x2a')],_0x454025[_0xd131('0x26')]);_0x4c16b3[_0xd131('0x2e')]=_['intersection'](_0x454025['model'],qs[_0xd131('0x2f')](_0x46a3e3[_0xd131('0x26')]['fields']));_0x4c16b3[_0xd131('0x2e')]=_0x4c16b3[_0xd131('0x2e')][_0xd131('0x30')]?_0x4c16b3[_0xd131('0x2e')]:_0x454025['model'];if(_0x46a3e3[_0xd131('0x26')][_0xd131('0x31')]){_0x4c16b3[_0xd131('0x32')]=[{'all':!![]}];}_0x4c16b3=_['merge']({},_0x4c16b3,_0x46a3e3[_0xd131('0x33')]);return db[_0xd131('0x21')][_0xd131('0x34')](_0x4c16b3)['then'](handleEntityNotFound(_0x60e287,null))[_0xd131('0x1a')](respondWithResult(_0x60e287,null))['catch'](handleError(_0x60e287,null));};exports[_0xd131('0x35')]=function(_0x3032b7,_0x4aed13){return db[_0xd131('0x21')][_0xd131('0x35')](_0x3032b7[_0xd131('0x36')],{})[_0xd131('0x1a')](respondWithResult(_0x4aed13,0xc9))[_0xd131('0x25')](handleError(_0x4aed13,null));};exports[_0xd131('0x19')]=function(_0x48839c,_0x15accc){if(_0x48839c['body']['id']){delete _0x48839c[_0xd131('0x36')]['id'];}return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x48839c[_0xd131('0x29')]['id']}})['then'](handleEntityNotFound(_0x15accc,null))['then'](saveUpdates(_0x48839c[_0xd131('0x36')],null))['then'](respondWithResult(_0x15accc,null))[_0xd131('0x25')](handleError(_0x15accc,null));};exports[_0xd131('0x1b')]=function(_0x2d495e,_0x1f1905){return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x2d495e[_0xd131('0x29')]['id']}})[_0xd131('0x1a')](handleEntityNotFound(_0x1f1905,null))[_0xd131('0x1a')](removeEntity(_0x1f1905,null))[_0xd131('0x25')](handleError(_0x1f1905,null));};exports[_0xd131('0x37')]=function(_0x371de1,_0x2d2c94){return db['OpenchannelInteraction'][_0xd131('0x37')]()[_0xd131('0x1a')](respondWithResult(_0x2d2c94,null))[_0xd131('0x25')](handleError(_0x2d2c94,null));};exports[_0xd131('0x38')]=function(_0x2e1e59,_0x43f6bb){return db[_0xd131('0x39')]['find']({'where':{'id':_0x2e1e59[_0xd131('0x29')]['id']}})['then'](handleEntityNotFound(_0x43f6bb,null))[_0xd131('0x1a')](function(_0x394c4a){if(_0x394c4a){return _0x394c4a[_0xd131('0x38')](_0x2e1e59[_0xd131('0x36')][_0xd131('0x3a')],_[_0xd131('0x3b')](_0x2e1e59[_0xd131('0x36')],[_0xd131('0x3a'),'id'])||{});}})[_0xd131('0x1a')](respondWithResult(_0x43f6bb,null))['catch'](handleError(_0x43f6bb,null));};exports['getMessages']=function(_0x138716,_0x42f0ad){var _0x7eaa94={'raw':![],'where':{}};var _0x435c2c={};var _0x516ca7={'count':0x0,'rows':[]};return db[_0xd131('0x21')][_0xd131('0x3c')]({'where':{'id':_0x138716[_0xd131('0x29')]['id']}})['then'](handleEntityNotFound(_0x42f0ad,null))[_0xd131('0x1a')](function(_0x5c07bf){if(_0x5c07bf){_0x435c2c[_0xd131('0x2a')]=_['keys'](db[_0xd131('0x39')][_0xd131('0x22')]);_0x435c2c[_0xd131('0x26')]=_[_0xd131('0x2b')](_0x138716[_0xd131('0x26')]);_0x435c2c[_0xd131('0x2c')]=_[_0xd131('0x2d')](_0x435c2c[_0xd131('0x2a')],_0x435c2c[_0xd131('0x26')]);_0x7eaa94[_0xd131('0x2e')]=_[_0xd131('0x2d')](_0x435c2c[_0xd131('0x2a')],qs['fields'](_0x138716[_0xd131('0x26')][_0xd131('0x2f')]));_0x7eaa94['attributes']=_0x7eaa94[_0xd131('0x2e')]['length']?_0x7eaa94[_0xd131('0x2e')]:_0x435c2c[_0xd131('0x2a')];if(!_0x138716[_0xd131('0x26')]['hasOwnProperty'](_0xd131('0x3d'))){_0x7eaa94['limit']=qs[_0xd131('0x15')](_0x138716['query'][_0xd131('0x15')]);_0x7eaa94['offset']=qs['offset'](_0x138716[_0xd131('0x26')]['offset']);}_0x7eaa94[_0xd131('0x3e')]=qs[_0xd131('0x3f')](_0x138716[_0xd131('0x26')]['sort']);_0x7eaa94[_0xd131('0x40')]=qs[_0xd131('0x2c')](_['pick'](_0x138716[_0xd131('0x26')],_0x435c2c[_0xd131('0x2c')]));_0x7eaa94[_0xd131('0x40')][_0xd131('0x41')]=_0x5c07bf['id'];if(_0x138716['query']['filter']){_0x7eaa94[_0xd131('0x40')]=_[_0xd131('0x42')](_0x7eaa94[_0xd131('0x40')],{'$or':_[_0xd131('0x43')](_0x7eaa94[_0xd131('0x2e')],function(_0x374ef8){var _0xa06027={};_0xa06027[_0x374ef8]={'$like':'%'+_0x138716['query'][_0xd131('0x44')]+'%'};return _0xa06027;})});}if(_0x138716['query'][_0xd131('0x45')]){var _0x3cffa3=_0x138716[_0xd131('0x26')][_0xd131('0x45')][_0xd131('0x46')](',');var _0x233413={};_0x233413[_0x3cffa3[0x0]]={'$gte':moment(_0x3cffa3[0x1])[_0xd131('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7eaa94[_0xd131('0x40')]=_['merge'](_0x7eaa94[_0xd131('0x40')],_0x233413);}_0x7eaa94=_[_0xd131('0x42')]({},_0x7eaa94,_0x138716[_0xd131('0x33')]);return db['OpenchannelMessage'][_0xd131('0x16')]({'where':_0x7eaa94[_0xd131('0x40')]})[_0xd131('0x1a')](function(_0xfad45d){_0x516ca7[_0xd131('0x16')]=_0xfad45d;if(_0x138716[_0xd131('0x26')][_0xd131('0x31')]){_0x7eaa94[_0xd131('0x32')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xd131('0x48')](_0x7eaa94);})[_0xd131('0x1a')](function(_0x36393d){_0x516ca7[_0xd131('0x49')]=_0x36393d;return _0x516ca7;});}})[_0xd131('0x1a')](respondWithFilteredResult(_0x42f0ad,_0x7eaa94))[_0xd131('0x25')](handleError(_0x42f0ad,null));};exports[_0xd131('0x4a')]=function(_0x5a82a4,_0x3b2199){return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x5a82a4[_0xd131('0x29')]['id']}})[_0xd131('0x1a')](handleEntityNotFound(_0x3b2199,null))[_0xd131('0x1a')](function(_0x1f1b39){if(_0x1f1b39){return _0x1f1b39['setTags'](_0x5a82a4[_0xd131('0x36')]['ids'],_[_0xd131('0x3b')](_0x5a82a4['body'],[_0xd131('0x3a'),'id'])||{})[_0xd131('0x4b')](function(){return db['Tag'][_0xd131('0x48')]({'attributes':['id','name','color'],'where':{'id':_0x5a82a4[_0xd131('0x36')][_0xd131('0x3a')]}});})[_0xd131('0x1a')](function(_0x59e5b2){socket[_0xd131('0x4c')](_0xd131('0x4d'),{'id':Number(_0x5a82a4[_0xd131('0x29')]['id']),'tags':_0x59e5b2||[]});return{'id':Number(_0x5a82a4[_0xd131('0x29')]['id']),'tags':_0x59e5b2||[]};});}})['then'](respondWithResult(_0x3b2199,null))[_0xd131('0x25')](handleError(_0x3b2199,null));};exports[_0xd131('0x4e')]=function(_0x209e33,_0x5f46c2){return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x209e33[_0xd131('0x29')]['id']}})[_0xd131('0x1a')](handleEntityNotFound(_0x5f46c2,null))[_0xd131('0x1a')](function(_0x4d5fe8){if(_0x4d5fe8){return _0x4d5fe8[_0xd131('0x4e')](_0x209e33['query'][_0xd131('0x3a')]);}})['then'](respondWithStatusCode(_0x5f46c2,null))['catch'](handleError(_0x5f46c2,null));};exports[_0xd131('0x4f')]=function(_0x437d43,_0x5d6774){var _0x213aa2=moment()[_0xd131('0x50')]()[_0xd131('0x51')]();var _0x194809=path[_0xd131('0x52')](config[_0xd131('0x53')],_0xd131('0x54'),_0xd131('0x55'),_0xd131('0x56'));var _0xdc7009=path[_0xd131('0x52')](config[_0xd131('0x53')],_0xd131('0x54'),_0xd131('0x55'),_0xd131('0x57'));var _0x31e6d1=path[_0xd131('0x52')](_0x194809,_0x213aa2);var _0x14353c=util['format'](_0xd131('0x58'),_0x437d43[_0xd131('0x29')]['id'],_0x213aa2);var _0x4354c9=path['join'](_0x194809,_0x14353c);var _0x27cbcc=[];_0x27cbcc[_0xd131('0x59')]({'model':db[_0xd131('0x5a')],'as':_0xd131('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x27cbcc[_0xd131('0x59')]({'model':db[_0xd131('0x5b')],'as':_0xd131('0x5c'),'attributes':['id',_0xd131('0x5d'),'lastName'],'raw':!![]});if(_0x437d43[_0xd131('0x26')][_0xd131('0x57')]){_0x27cbcc['push']({'model':db[_0xd131('0x5e')],'as':'Attachment','raw':!![]});}var _0xb09ed7=[{'model':db[_0xd131('0x39')],'as':_0xd131('0x5f'),'attributes':['id',_0xd131('0x36'),'createdAt','direction','secret',_0xd131('0x60')],'include':_0x27cbcc}];_0xb09ed7[_0xd131('0x59')]({'model':db[_0xd131('0x61')],'as':'Account','attributes':['id',_0xd131('0x1f')]});_0xb09ed7['push']({'model':db[_0xd131('0x5a')],'as':_0xd131('0x62'),'attributes':['id',_0xd131('0x63')]});return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x437d43['params']['id']},'include':_0xb09ed7})[_0xd131('0x1a')](handleEntityNotFound(_0x5d6774,null))[_0xd131('0x1a')](function(_0x255125){if(_0x255125){var _0x1a656e=_0x255125[_0xd131('0x64')]({'plain':!![]});fs['mkdirSync'](_0x31e6d1);var _0x800225={'channel':_0xd131('0x65'),'account':_0x1a656e[_0xd131('0x66')][_0xd131('0x1f')],'agent':_0x1a656e[_0xd131('0x62')]?_0x1a656e[_0xd131('0x62')][_0xd131('0x63')]:_0xd131('0x67'),'createdAt':moment(_0x1a656e[_0xd131('0x68')])[_0xd131('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd131('0x51')](),'closedAt':_0x1a656e['closed']?moment(_0x1a656e['closedAt'])[_0xd131('0x47')](_0xd131('0x69'))['toString']():'','disposition':_0x1a656e[_0xd131('0x6a')],'visibility':_0x1a656e[_0xd131('0x6b')]?_0xd131('0x6c'):'Private','messages':_(_0x1a656e[_0xd131('0x5f')])[_0xd131('0x44')]({'secret':![]})[_0xd131('0x43')](function(_0x11eab3){if(_0x11eab3['Attachment']){var _0x5d7287=path[_0xd131('0x52')](_0xdc7009,_0x11eab3[_0xd131('0x5e')][_0xd131('0x6d')]);if(fs[_0xd131('0x6e')](_0x5d7287)){fs['createReadStream'](_0x5d7287)[_0xd131('0x6f')](fs[_0xd131('0x70')](path[_0xd131('0x52')](_0x31e6d1,_0x11eab3[_0xd131('0x5e')][_0xd131('0x6d')])));}}return{'date':moment(_0x11eab3['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd131('0x51')](),'sender':_0x11eab3[_0xd131('0x71')]===_0xd131('0x72')?_0x11eab3['User']?_0x11eab3[_0xd131('0x5a')][_0xd131('0x63')]:'System':_0x11eab3[_0xd131('0x5c')][_0xd131('0x5d')]+(_0x11eab3[_0xd131('0x5c')]['lastName']?'\x20'+_0x11eab3['Contact'][_0xd131('0x73')]:''),'body':_0x11eab3['Attachment']?_0x11eab3[_0xd131('0x5e')][_0xd131('0x6d')]:_0x11eab3[_0xd131('0x36')],'direction':_0x11eab3[_0xd131('0x71')]==='out'?'A':'C','secret':_0x11eab3[_0xd131('0x74')],'read':_0x11eab3[_0xd131('0x60')],'attachment':_0x11eab3[_0xd131('0x5e')]};})[_0xd131('0x75')]()};return ejs[_0xd131('0x76')](path[_0xd131('0x52')](config[_0xd131('0x53')],_0xd131('0x54'),_0xd131('0x77'),_0xd131('0x78')),{'interaction':_0x800225})['then'](function(_0x8cd253){var _0x583434=path[_0xd131('0x52')](_0x31e6d1,_0xd131('0x79')+_0x1a656e['id']+'-'+_0x213aa2+'.pdf');var _0x553eb2={'path':_0x583434,'channel':'Openchannel','interactionId':_0x1a656e['id']};return pdf['createPdfFromHTML'](_0x8cd253,_0x553eb2);})[_0xd131('0x1a')](function(){return new Promise(function(_0x27aad0,_0x1958b8){zipdir(_0x31e6d1,{'saveTo':_0x4354c9},function(_0x4409f3,_0x18b4f5){if(_0x4409f3)return _0x1958b8(_0x4409f3);return _0x27aad0(_0x18b4f5);});})[_0xd131('0x1a')](function(){return new Promise(function(_0x2ff22d,_0x38ac91){rimraf(_0x31e6d1,function(_0x378d46){if(_0x378d46)_0x38ac91(_0x378d46);return _0x2ff22d();});});})[_0xd131('0x1a')](function(){return _0x5d6774[_0xd131('0x4f')](_0x4354c9,_0x14353c,function(_0x1a3caf){if(_0x1a3caf){logger[_0xd131('0x1d')](_0xd131('0x7a'),_0x1a3caf);}else{fs[_0xd131('0x7b')](_0x4354c9);}});});});}else{return _0x5d6774['sendStatus'](0xc8);}})[_0xd131('0x25')](handleError(_0x5d6774,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 401d9d4..8a9c091 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 _0x0c11=['update','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save'];(function(_0x45d4ae,_0x4d96dc){var _0x3fabfb=function(_0x3ee794){while(--_0x3ee794){_0x45d4ae['push'](_0x45d4ae['shift']());}};_0x3fabfb(++_0x4d96dc);}(_0x0c11,0x98));var _0x10c1=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0x0c11[_0x2211ed];return _0x4d78cc;};'use strict';var EventEmitter=require(_0x10c1('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x10c1('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x10c1('0x2')](0x0);var events={'afterCreate':_0x10c1('0x3'),'afterUpdate':_0x10c1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x285b5e){return function(_0x496948,_0x27ba1a,_0x17c14b){_0x496948['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2bd5c5){_0x496948[_0x10c1('0x5')](_0x10c1('0x6'),_0x2bd5c5['map'](function(_0x3036c7){return{'id':_0x3036c7['id']};}));return OpenchannelMessage[_0x10c1('0x7')]({'where':{'OpenchannelInteractionId':_0x496948['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x26e6d0){_0x496948['setDataValue'](_0x10c1('0x8'),_0x26e6d0['length']);OpenchannelInteractionEvents[_0x10c1('0x9')](_0x285b5e+':'+_0x496948['id'],_0x496948);OpenchannelInteractionEvents[_0x10c1('0x9')](_0x285b5e,_0x496948);_0x17c14b(null);})[_0x10c1('0xa')](_0x17c14b(null));};}for(var e in events){if(events[_0x10c1('0xb')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x10c1('0xc')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4d19=['setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hook','../../mysqldb','remove','getUsers'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0x4d19,0x1b9));var _0x94d1=function(_0x49a068,_0x53aade){_0x49a068=_0x49a068-0x0;var _0x4cbc65=_0x4d19[_0x49a068];return _0x4cbc65;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x94d1('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x94d1('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x94d1('0x1')};function emitEvent(_0x5180ef){return function(_0x1ea2eb,_0x557b2a,_0x2dccb6){_0x1ea2eb[_0x94d1('0x2')]({'attributes':['id'],'raw':!![]})['then'](function(_0x467e24){_0x1ea2eb[_0x94d1('0x3')](_0x94d1('0x4'),_0x467e24[_0x94d1('0x5')](function(_0x3c1bde){return{'id':_0x3c1bde['id']};}));return OpenchannelMessage[_0x94d1('0x6')]({'where':{'OpenchannelInteractionId':_0x1ea2eb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94d1('0x7')](function(_0x1a4d2b){_0x1ea2eb[_0x94d1('0x3')](_0x94d1('0x8'),_0x1a4d2b[_0x94d1('0x9')]);OpenchannelInteractionEvents['emit'](_0x5180ef+':'+_0x1ea2eb['id'],_0x1ea2eb);OpenchannelInteractionEvents[_0x94d1('0xa')](_0x5180ef,_0x1ea2eb);_0x2dccb6(null);})['catch'](_0x2dccb6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x94d1('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 ef67b95..57eb3e4 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 _0xbc44=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc44,0x1dd));var _0x4bc4=function(_0x2277bf,_0x2609d3){_0x2277bf=_0x2277bf-0x0;var _0x2d5568=_0xbc44[_0x2277bf];return _0x2d5568;};'use strict';var _=require('lodash');var util=require(_0x4bc4('0x0'));var logger=require(_0x4bc4('0x1'))(_0x4bc4('0x2'));var moment=require(_0x4bc4('0x3'));var BPromise=require(_0x4bc4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bc4('0x5'));var rimraf=require('rimraf');var config=require(_0x4bc4('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x4bc4('0x7')]=function(_0x1ff30b,_0x466ccc){return _0x1ff30b['define'](_0x4bc4('0x8'),attributes,{'tableName':_0x4bc4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bc4('0xa'),'collate':_0x4bc4('0xb'),'hooks':{'beforeUpdate':function(_0x314689,_0x5a8ea1,_0x2d4f85){if(_0x314689[_0x4bc4('0xc')](_0x4bc4('0xd'))){_0x314689[_0x4bc4('0xe')]=moment()[_0x4bc4('0xf')](_0x4bc4('0x10'));}_0x2d4f85(null,_0x314689);}}});}; \ No newline at end of file +var _0xc9bb=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x1bc44d,_0x46379f){var _0x39969a=function(_0x459d6c){while(--_0x459d6c){_0x1bc44d['push'](_0x1bc44d['shift']());}};_0x39969a(++_0x46379f);}(_0xc9bb,0x8e));var _0xbc9b=function(_0x35aaf9,_0x3efa26){_0x35aaf9=_0x35aaf9-0x0;var _0x32e3ca=_0xc9bb[_0x35aaf9];return _0x32e3ca;};'use strict';var _=require(_0xbc9b('0x0'));var util=require(_0xbc9b('0x1'));var logger=require('../../config/logger')(_0xbc9b('0x2'));var moment=require(_0xbc9b('0x3'));var BPromise=require(_0xbc9b('0x4'));var rp=require(_0xbc9b('0x5'));var fs=require('fs');var path=require(_0xbc9b('0x6'));var rimraf=require(_0xbc9b('0x7'));var config=require(_0xbc9b('0x8'));var attributes=require(_0xbc9b('0x9'));module[_0xbc9b('0xa')]=function(_0x327961,_0x518be7){return _0x327961[_0xbc9b('0xb')](_0xbc9b('0xc'),attributes,{'tableName':_0xbc9b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc9b('0xe'),'collate':_0xbc9b('0xf'),'hooks':{'beforeUpdate':function(_0x5403c3,_0x503dc1,_0x513c6e){if(_0x5403c3[_0xbc9b('0x10')]('closed')){_0x5403c3['closedAt']=moment()[_0xbc9b('0x11')](_0xbc9b('0x12'));}_0x513c6e(null,_0x5403c3);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index c1f7587..c9f337e 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 _0x00d8=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x94095,_0x4fcedb){var _0x5dcd09=function(_0x30715f){while(--_0x30715f){_0x94095['push'](_0x94095['shift']());}};_0x5dcd09(++_0x4fcedb);}(_0x00d8,0xc0));var _0x800d=function(_0x532dc6,_0x416c5f){_0x532dc6=_0x532dc6-0x0;var _0x1e9c35=_0x00d8[_0x532dc6];return _0x1e9c35;};'use strict';var _=require(_0x800d('0x0'));var util=require('util');var moment=require(_0x800d('0x1'));var BPromise=require(_0x800d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x800d('0x3'))['db'];var utils=require(_0x800d('0x4'));var logger=require(_0x800d('0x5'))(_0x800d('0x6'));var config=require(_0x800d('0x7'));var jayson=require(_0x800d('0x8'));var client=jayson['client'][_0x800d('0x9')]({'port':0x232a});config['redis']=_[_0x800d('0xa')](config[_0x800d('0xb')],{'host':_0x800d('0xc'),'port':0x18eb});var socket=require(_0x800d('0xd'))(new Redis(config[_0x800d('0xb')]));require(_0x800d('0xe'))[_0x800d('0xf')](socket);function respondWithRpcPromise(_0x21f917,_0x1b3277,_0x2faef0){return new BPromise(function(_0x530b69,_0xb8eb14){return client[_0x800d('0x10')](_0x21f917,_0x2faef0)['then'](function(_0x4af404){logger[_0x800d('0x11')](_0x800d('0x12'),_0x1b3277,_0x800d('0x13'));logger[_0x800d('0x14')](_0x800d('0x15'),_0x1b3277,_0x800d('0x13'),JSON[_0x800d('0x16')](_0x4af404));if(_0x4af404[_0x800d('0x17')]){if(_0x4af404[_0x800d('0x17')][_0x800d('0x18')]===0x1f4){logger['error'](_0x800d('0x12'),_0x1b3277,_0x4af404[_0x800d('0x17')][_0x800d('0x19')]);return _0xb8eb14(_0x4af404[_0x800d('0x17')]['message']);}logger['error'](_0x800d('0x12'),_0x1b3277,_0x4af404['error'][_0x800d('0x19')]);return _0x530b69(_0x4af404[_0x800d('0x17')][_0x800d('0x19')]);}else{logger[_0x800d('0x11')](_0x800d('0x12'),_0x1b3277,_0x800d('0x13'));_0x530b69(_0x4af404[_0x800d('0x1a')][_0x800d('0x19')]);}})[_0x800d('0x1b')](function(_0x498419){logger[_0x800d('0x17')](_0x800d('0x12'),_0x1b3277,_0x498419);_0xb8eb14(_0x498419);});});}exports[_0x800d('0x1c')]=function(_0x1828c3){var _0x3e7d84=this;return new Promise(function(_0x174951,_0x3bad6f){return db[_0x800d('0x1d')][_0x800d('0x1e')](_0x1828c3[_0x800d('0x1f')],{'raw':_0x1828c3[_0x800d('0x20')]?_0x1828c3[_0x800d('0x20')][_0x800d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1828c3['options']?_0x1828c3[_0x800d('0x20')][_0x800d('0x22')]||null:null,'attributes':_0x1828c3[_0x800d('0x20')]?_0x1828c3[_0x800d('0x20')][_0x800d('0x23')]||null:null,'limit':_0x1828c3['options']?_0x1828c3['options'][_0x800d('0x24')]||null:null})[_0x800d('0x25')](function(_0x523c8c){logger[_0x800d('0x11')](_0x800d('0x1c'),_0x1828c3);logger['debug'](_0x800d('0x1c'),_0x1828c3,JSON[_0x800d('0x16')](_0x523c8c));_0x174951(_0x523c8c);})[_0x800d('0x1b')](function(_0x38bc9d){logger['error'](_0x800d('0x1c'),_0x38bc9d[_0x800d('0x19')],_0x1828c3);_0x3bad6f(_0x3e7d84['error'](0x1f4,_0x38bc9d[_0x800d('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2203f4){return new Promise(function(_0xa3cffb,_0x25c793){return db[_0x800d('0x1d')][_0x800d('0x26')]({'where':_0x2203f4[_0x800d('0x20')]?_0x2203f4['options']['where']||null:null})[_0x800d('0x25')](function(_0x106f7d){if(_0x106f7d){return _0x106f7d[_0x800d('0x27')](_0x2203f4[_0x800d('0x1f')][_0x800d('0x28')],_[_0x800d('0x29')](_0x2203f4[_0x800d('0x1f')],['ids','id'])||{});}})[_0x800d('0x2a')](function(_0x44920b){logger[_0x800d('0x11')](_0x800d('0x2b'),_0x2203f4);logger['debug'](_0x800d('0x2b'),_0x2203f4,JSON[_0x800d('0x16')](_0x44920b));_0xa3cffb(_0x44920b);})[_0x800d('0x1b')](function(_0x1109f5){logger[_0x800d('0x17')](_0x800d('0x2b'),_0x1109f5[_0x800d('0x19')],_0x2203f4);_0x25c793(_this['error'](0x1f4,_0x1109f5[_0x800d('0x19')]));});});}; \ No newline at end of file +var _0x18b9=['OpenchannelInteraction','update','options','raw','where','attributes','then','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction'];(function(_0x1f8381,_0x4a02f7){var _0x599ab6=function(_0x350087){while(--_0x350087){_0x1f8381['push'](_0x1f8381['shift']());}};_0x599ab6(++_0x4a02f7);}(_0x18b9,0x8d));var _0x918b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x18b9[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x918b('0x0'));var util=require(_0x918b('0x1'));var moment=require('moment');var BPromise=require(_0x918b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x918b('0x3'));var db=require(_0x918b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x918b('0x5'))(_0x918b('0x6'));var config=require(_0x918b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x918b('0x8')][_0x918b('0x9')]({'port':0x232a});config[_0x918b('0xa')]=_[_0x918b('0xb')](config[_0x918b('0xa')],{'host':_0x918b('0xc'),'port':0x18eb});var socket=require(_0x918b('0xd'))(new Redis(config[_0x918b('0xa')]));require('./openchannelInteraction.socket')[_0x918b('0xe')](socket);function respondWithRpcPromise(_0xacf277,_0x15697d,_0x94336f){return new BPromise(function(_0x511b17,_0x170176){return client[_0x918b('0xf')](_0xacf277,_0x94336f)['then'](function(_0x402840){logger[_0x918b('0x10')](_0x918b('0x11'),_0x15697d,_0x918b('0x12'));logger[_0x918b('0x13')](_0x918b('0x14'),_0x15697d,_0x918b('0x12'),JSON[_0x918b('0x15')](_0x402840));if(_0x402840[_0x918b('0x16')]){if(_0x402840[_0x918b('0x16')][_0x918b('0x17')]===0x1f4){logger['error'](_0x918b('0x11'),_0x15697d,_0x402840['error']['message']);return _0x170176(_0x402840[_0x918b('0x16')][_0x918b('0x18')]);}logger[_0x918b('0x16')](_0x918b('0x11'),_0x15697d,_0x402840[_0x918b('0x16')][_0x918b('0x18')]);return _0x511b17(_0x402840[_0x918b('0x16')][_0x918b('0x18')]);}else{logger[_0x918b('0x10')](_0x918b('0x11'),_0x15697d,_0x918b('0x12'));_0x511b17(_0x402840[_0x918b('0x19')][_0x918b('0x18')]);}})['catch'](function(_0xeafe94){logger[_0x918b('0x16')](_0x918b('0x11'),_0x15697d,_0xeafe94);_0x170176(_0xeafe94);});});}exports[_0x918b('0x1a')]=function(_0x167751){var _0x25468f=this;return new Promise(function(_0x330d00,_0x195cc5){return db[_0x918b('0x1b')][_0x918b('0x1c')](_0x167751['body'],{'raw':_0x167751[_0x918b('0x1d')]?_0x167751[_0x918b('0x1d')][_0x918b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167751[_0x918b('0x1d')]?_0x167751['options'][_0x918b('0x1f')]||null:null,'attributes':_0x167751[_0x918b('0x1d')]?_0x167751[_0x918b('0x1d')][_0x918b('0x20')]||null:null,'limit':_0x167751[_0x918b('0x1d')]?_0x167751[_0x918b('0x1d')]['limit']||null:null})[_0x918b('0x21')](function(_0x44f50a){logger[_0x918b('0x10')]('UpdateOpenchannelInteraction',_0x167751);logger[_0x918b('0x13')](_0x918b('0x1a'),_0x167751,JSON[_0x918b('0x15')](_0x44f50a));_0x330d00(_0x44f50a);})['catch'](function(_0x15da0e){logger['error'](_0x918b('0x1a'),_0x15da0e[_0x918b('0x18')],_0x167751);_0x195cc5(_0x25468f['error'](0x1f4,_0x15da0e[_0x918b('0x18')]));});});};exports[_0x918b('0x22')]=function(_0x5f2166){return new Promise(function(_0x586606,_0x429f5b){return db['OpenchannelInteraction'][_0x918b('0x23')]({'where':_0x5f2166[_0x918b('0x1d')]?_0x5f2166[_0x918b('0x1d')]['where']||null:null})[_0x918b('0x21')](function(_0x461c52){if(_0x461c52){return _0x461c52[_0x918b('0x24')](_0x5f2166[_0x918b('0x25')][_0x918b('0x26')],_[_0x918b('0x27')](_0x5f2166['body'],[_0x918b('0x26'),'id'])||{});}})[_0x918b('0x28')](function(_0x513ea7){logger[_0x918b('0x10')](_0x918b('0x29'),_0x5f2166);logger['debug'](_0x918b('0x29'),_0x5f2166,JSON[_0x918b('0x15')](_0x513ea7));_0x586606(_0x513ea7);})['catch'](function(_0x1f7ad0){logger['error']('AddTags',_0x1f7ad0[_0x918b('0x18')],_0x5f2166);_0x429f5b(_this[_0x918b('0x16')](0x1f4,_0x1f7ad0[_0x918b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 60e7964..3aad25d 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 _0xacb6=['./openchannelInteraction.events','save','update','emit','removeListener','length','openchannelInteraction:'];(function(_0x40d722,_0x5ab18c){var _0x232ffa=function(_0x2a8ade){while(--_0x2a8ade){_0x40d722['push'](_0x40d722['shift']());}};_0x232ffa(++_0x5ab18c);}(_0xacb6,0xc4));var _0x6acb=function(_0x1e8b71,_0x4f8c09){_0x1e8b71=_0x1e8b71-0x0;var _0x44c567=_0xacb6[_0x1e8b71];return _0x44c567;};'use strict';var OpenchannelInteractionEvents=require(_0x6acb('0x0'));var events=[_0x6acb('0x1'),'remove',_0x6acb('0x2')];function createListener(_0x1169db,_0x23e118){return function(_0x1ac666){_0x23e118[_0x6acb('0x3')](_0x1169db,_0x1ac666);};}function removeListener(_0x5d301f,_0x2c7dfb){return function(){OpenchannelInteractionEvents[_0x6acb('0x4')](_0x5d301f,_0x2c7dfb);};}exports['register']=function(_0x4f0279){for(var _0x5f1c17=0x0,_0x5cf138=events[_0x6acb('0x5')];_0x5f1c17<_0x5cf138;_0x5f1c17++){var _0x44de4c=events[_0x5f1c17];var _0x56ded2=createListener(_0x6acb('0x6')+_0x44de4c,_0x4f0279);OpenchannelInteractionEvents['on'](_0x44de4c,_0x56ded2);}}; \ No newline at end of file +var _0x48d9=['removeListener','register','openchannelInteraction:','save','remove','update','emit'];(function(_0x21b40f,_0x2ebb33){var _0x94b34a=function(_0x5baab4){while(--_0x5baab4){_0x21b40f['push'](_0x21b40f['shift']());}};_0x94b34a(++_0x2ebb33);}(_0x48d9,0x8f));var _0x948d=function(_0x87413c,_0x34c62b){_0x87413c=_0x87413c-0x0;var _0x4018e2=_0x48d9[_0x87413c];return _0x4018e2;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x948d('0x0'),_0x948d('0x1'),_0x948d('0x2')];function createListener(_0x5dfed0,_0x8df431){return function(_0x293842){_0x8df431[_0x948d('0x3')](_0x5dfed0,_0x293842);};}function removeListener(_0x904c60,_0x5d7a9e){return function(){OpenchannelInteractionEvents[_0x948d('0x4')](_0x904c60,_0x5d7a9e);};}exports[_0x948d('0x5')]=function(_0x5a5f67){for(var _0x7bd82c=0x0,_0x40be29=events['length'];_0x7bd82c<_0x40be29;_0x7bd82c++){var _0x8e66df=events[_0x7bd82c];var _0x531016=createListener(_0x948d('0x6')+_0x8e66df,_0x5a5f67);OpenchannelInteractionEvents['on'](_0x8e66df,_0x531016);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index b2a562d..78648cf 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x5dbc26,_0x59fe73){var _0x2397ce=function(_0x18a4bd){while(--_0x18a4bd){_0x5dbc26['push'](_0x5dbc26['shift']());}};_0x2397ce(++_0x59fe73);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x384182,_0x4b9b3d){var _0x5461c8=function(_0x24d021){while(--_0x24d021){_0x384182['push'](_0x384182['shift']());}};_0x5461c8(++_0x4b9b3d);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a202d2f..454a6a5 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 _0x4e81=['out','DATE','STRING','sequelize','exports','TEXT','ENUM'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x4e81[_0x1559a5];return _0x17a783;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'body':{'type':Sequelize[_0x14e8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x14e8('0x3')]('in',_0x14e8('0x4')),'defaultValue':_0x14e8('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x14e8('0x5')]},'providerName':{'type':Sequelize[_0x14e8('0x6')]},'providerResponse':{'type':Sequelize[_0x14e8('0x2')]}}; \ No newline at end of file +var _0x4b6c=['TEXT','sequelize','exports','medium','BOOLEAN','out','DATE'];(function(_0x1448bf,_0x2baca5){var _0x370f8c=function(_0x4c7345){while(--_0x4c7345){_0x1448bf['push'](_0x1448bf['shift']());}};_0x370f8c(++_0x2baca5);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc4b6('0x0'));module[_0xc4b6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc4b6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc4b6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc4b6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc4b6('0x4')),'defaultValue':_0xc4b6('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc4b6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc4b6('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e54815d..83e3f74 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 _0xbf54=['acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','email','interface','SIP/%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','include','findAll','show','params','includeAll','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','internal','manual','channel','motionChannel','event','EventManager'];(function(_0x242d3e,_0x172ffe){var _0xd63dea=function(_0x1ac2a8){while(--_0x1ac2a8){_0x242d3e['push'](_0x242d3e['shift']());}};_0xd63dea(++_0x172ffe);}(_0xbf54,0x18f));var _0x4bf5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbf54[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x4bf5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bf5('0x1'));var jsonpatch=require(_0x4bf5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4bf5('0x3'));var Mustache=require(_0x4bf5('0x4'));var util=require(_0x4bf5('0x5'));var path=require(_0x4bf5('0x6'));var sox=require('sox');var csv=require(_0x4bf5('0x7'));var ejs=require(_0x4bf5('0x8'));var fs=require('fs');var fs_extra=require(_0x4bf5('0x9'));var _=require(_0x4bf5('0xa'));var squel=require(_0x4bf5('0xb'));var crypto=require(_0x4bf5('0xc'));var jsforce=require(_0x4bf5('0xd'));var deskjs=require(_0x4bf5('0xe'));var toCsv=require(_0x4bf5('0x7'));var querystring=require('querystring');var Papa=require(_0x4bf5('0xf'));var Redis=require('ioredis');var authService=require(_0x4bf5('0x10'));var qs=require(_0x4bf5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4bf5('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4bf5('0x13'));var db=require(_0x4bf5('0x14'))['db'];config['redis']=_[_0x4bf5('0x15')](config[_0x4bf5('0x16')],{'host':_0x4bf5('0x17'),'port':0x18eb});var socket=require(_0x4bf5('0x18'))(new Redis(config[_0x4bf5('0x16')]));require('./openchannelMessage.socket')[_0x4bf5('0x19')](socket);var jayson=require(_0x4bf5('0x1a'));var client=jayson[_0x4bf5('0x1b')][_0x4bf5('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x4bf5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5759c3,_0x25daaa,_0x4db28b,_0x1de5d0){return new BPromise(function(_0x1d451b,_0x4eabe3){var _0x55ba76=_0x1de5d0||client;return _0x55ba76['request'](_0x5759c3,_0x4db28b)[_0x4bf5('0x1d')](function(_0x36c32e){logger[_0x4bf5('0x1e')](_0x4bf5('0x1f'),_0x25daaa,'request\x20sent');logger[_0x4bf5('0x20')](_0x4bf5('0x21'),_0x25daaa,'request\x20sent',JSON[_0x4bf5('0x22')](_0x36c32e));if(_0x36c32e[_0x4bf5('0x23')]){if(_0x36c32e['error'][_0x4bf5('0x24')]===0x1f4){logger[_0x4bf5('0x23')](_0x4bf5('0x1f'),_0x25daaa,_0x36c32e[_0x4bf5('0x23')]['message']);return _0x4eabe3(_0x36c32e[_0x4bf5('0x23')]['message']);}logger['error'](_0x4bf5('0x1f'),_0x25daaa,_0x36c32e[_0x4bf5('0x23')][_0x4bf5('0x25')]);return _0x1d451b(_0x36c32e[_0x4bf5('0x23')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x25daaa,_0x4bf5('0x26'));_0x1d451b(_0x36c32e[_0x4bf5('0x27')]['message']);}})[_0x4bf5('0x28')](function(_0x4ac8e7){logger[_0x4bf5('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x25daaa,_0x4ac8e7);_0x4eabe3(_0x4ac8e7);});});}function respondWithStatusCode(_0x559baa,_0x3e0455){_0x3e0455=_0x3e0455||0xcc;return function(_0x198b6){if(_0x198b6){return _0x559baa[_0x4bf5('0x29')](_0x3e0455);}return _0x559baa[_0x4bf5('0x2a')](_0x3e0455)[_0x4bf5('0x2b')]();};}function respondWithResult(_0x1e7c66,_0x24d756){_0x24d756=_0x24d756||0xc8;return function(_0x14b4ca){if(_0x14b4ca){return _0x1e7c66[_0x4bf5('0x2a')](_0x24d756)[_0x4bf5('0x2c')](_0x14b4ca);}};}function respondWithFilteredResult(_0x356efe,_0x5acb7a){return function(_0x49b7ec){if(_0x49b7ec){var _0x2acb3a=typeof _0x5acb7a[_0x4bf5('0x2d')]===_0x4bf5('0x2e')&&typeof _0x5acb7a[_0x4bf5('0x2f')]===_0x4bf5('0x2e');var _0x34563d=_0x49b7ec[_0x4bf5('0x30')];var _0x2da774=_0x2acb3a?0x0:_0x5acb7a[_0x4bf5('0x2d')];var _0x3c1fa9=_0x2acb3a?_0x49b7ec['count']:_0x5acb7a[_0x4bf5('0x2d')]+_0x5acb7a[_0x4bf5('0x2f')];var _0x452fab;if(_0x3c1fa9>=_0x34563d){_0x3c1fa9=_0x34563d;_0x452fab=0xc8;}else{_0x452fab=0xce;}_0x356efe[_0x4bf5('0x2a')](_0x452fab);return _0x356efe[_0x4bf5('0x31')](_0x4bf5('0x32'),_0x2da774+'-'+_0x3c1fa9+'/'+_0x34563d)['json'](_0x49b7ec);}return null;};}function patchUpdates(_0x50a61d){return function(_0x86b744){try{jsonpatch['apply'](_0x86b744,_0x50a61d,!![]);}catch(_0x171a5d){return BPromise[_0x4bf5('0x33')](_0x171a5d);}return _0x86b744[_0x4bf5('0x34')]();};}function saveUpdates(_0x923636,_0x2631eb){return function(_0x401889){if(_0x401889){return _0x401889[_0x4bf5('0x35')](_0x923636)[_0x4bf5('0x1d')](function(_0x47244c){return _0x47244c;});}return null;};}function removeEntity(_0x4f8392,_0x2d8fe1){return function(_0x19516f){if(_0x19516f){return _0x19516f[_0x4bf5('0x36')]()['then'](function(){_0x4f8392[_0x4bf5('0x2a')](0xcc)[_0x4bf5('0x2b')]();});}};}function handleEntityNotFound(_0x190aca,_0x129f61){return function(_0x457543){if(!_0x457543){_0x190aca['sendStatus'](0x194);}return _0x457543;};}function handleError(_0x2bf1c8,_0x35076b){_0x35076b=_0x35076b||0x1f4;return function(_0x193141){logger[_0x4bf5('0x23')](_0x193141[_0x4bf5('0x37')]);if(_0x193141[_0x4bf5('0x38')]){delete _0x193141[_0x4bf5('0x38')];}_0x2bf1c8['status'](_0x35076b)[_0x4bf5('0x39')](_0x193141);};}exports[_0x4bf5('0x3a')]=function(_0xa19388,_0x4b1e0d){var _0x42d202={},_0x516157={},_0x32ff15={'count':0x0,'rows':[]};var _0x2f2f3b=_[_0x4bf5('0x3b')](db[_0x4bf5('0x3c')][_0x4bf5('0x3d')],function(_0x51a1a0){return{'name':_0x51a1a0[_0x4bf5('0x3e')],'type':_0x51a1a0[_0x4bf5('0x3f')][_0x4bf5('0x40')]};});_0x516157[_0x4bf5('0x41')]=_[_0x4bf5('0x3b')](_0x2f2f3b,'name');_0x516157[_0x4bf5('0x42')]=_[_0x4bf5('0x43')](_0xa19388[_0x4bf5('0x42')]);_0x516157[_0x4bf5('0x44')]=_[_0x4bf5('0x45')](_0x516157[_0x4bf5('0x41')],_0x516157[_0x4bf5('0x42')]);_0x42d202[_0x4bf5('0x46')]=_[_0x4bf5('0x45')](_0x516157[_0x4bf5('0x41')],qs[_0x4bf5('0x47')](_0xa19388[_0x4bf5('0x42')][_0x4bf5('0x47')]));_0x42d202[_0x4bf5('0x46')]=_0x42d202[_0x4bf5('0x46')][_0x4bf5('0x48')]?_0x42d202[_0x4bf5('0x46')]:_0x516157['model'];if(!_0xa19388[_0x4bf5('0x42')]['hasOwnProperty'](_0x4bf5('0x49'))){_0x42d202['limit']=qs[_0x4bf5('0x2f')](_0xa19388[_0x4bf5('0x42')][_0x4bf5('0x2f')]);_0x42d202[_0x4bf5('0x2d')]=qs[_0x4bf5('0x2d')](_0xa19388[_0x4bf5('0x42')][_0x4bf5('0x2d')]);}_0x42d202[_0x4bf5('0x4a')]=qs[_0x4bf5('0x4b')](_0xa19388['query'][_0x4bf5('0x4b')]);_0x42d202[_0x4bf5('0x4c')]=qs[_0x4bf5('0x44')](_['pick'](_0xa19388[_0x4bf5('0x42')],_0x516157[_0x4bf5('0x44')]),_0x2f2f3b);if(_0xa19388[_0x4bf5('0x42')][_0x4bf5('0x4d')]){_0x42d202[_0x4bf5('0x4c')]=_['merge'](_0x42d202['where'],{'$or':_[_0x4bf5('0x3b')](_0x2f2f3b,function(_0x433fc9){if(_0x433fc9[_0x4bf5('0x3f')]!=='VIRTUAL'){var _0x249392={};_0x249392[_0x433fc9[_0x4bf5('0x38')]]={'$like':'%'+_0xa19388['query'][_0x4bf5('0x4d')]+'%'};return _0x249392;}})});}_0x42d202=_[_0x4bf5('0x4e')]({},_0x42d202,_0xa19388[_0x4bf5('0x4f')]);var _0x4fc824={'where':_0x42d202[_0x4bf5('0x4c')]};return db['OpenchannelMessage'][_0x4bf5('0x30')](_0x4fc824)[_0x4bf5('0x1d')](function(_0x51eaae){_0x32ff15['count']=_0x51eaae;if(_0xa19388[_0x4bf5('0x42')]['includeAll']){_0x42d202[_0x4bf5('0x50')]=[{'all':!![]}];}return db[_0x4bf5('0x3c')][_0x4bf5('0x51')](_0x42d202);})['then'](function(_0x1cadf4){_0x32ff15['rows']=_0x1cadf4;return _0x32ff15;})[_0x4bf5('0x1d')](respondWithFilteredResult(_0x4b1e0d,_0x42d202))[_0x4bf5('0x28')](handleError(_0x4b1e0d,null));};exports[_0x4bf5('0x52')]=function(_0x3caced,_0x52a11d){var _0x322138={'raw':!![],'where':{'id':_0x3caced[_0x4bf5('0x53')]['id']}},_0x364ead={};_0x364ead[_0x4bf5('0x41')]=_[_0x4bf5('0x43')](db[_0x4bf5('0x3c')]['rawAttributes']);_0x364ead['query']=_[_0x4bf5('0x43')](_0x3caced[_0x4bf5('0x42')]);_0x364ead[_0x4bf5('0x44')]=_[_0x4bf5('0x45')](_0x364ead['model'],_0x364ead[_0x4bf5('0x42')]);_0x322138[_0x4bf5('0x46')]=_[_0x4bf5('0x45')](_0x364ead[_0x4bf5('0x41')],qs['fields'](_0x3caced[_0x4bf5('0x42')][_0x4bf5('0x47')]));_0x322138[_0x4bf5('0x46')]=_0x322138[_0x4bf5('0x46')][_0x4bf5('0x48')]?_0x322138[_0x4bf5('0x46')]:_0x364ead[_0x4bf5('0x41')];if(_0x3caced[_0x4bf5('0x42')][_0x4bf5('0x54')]){_0x322138[_0x4bf5('0x50')]=[{'all':!![]}];}_0x322138=_[_0x4bf5('0x4e')]({},_0x322138,_0x3caced[_0x4bf5('0x4f')]);return db[_0x4bf5('0x3c')]['find'](_0x322138)[_0x4bf5('0x1d')](handleEntityNotFound(_0x52a11d,null))['then'](respondWithResult(_0x52a11d,null))[_0x4bf5('0x28')](handleError(_0x52a11d,null));};exports[_0x4bf5('0x55')]=function(_0x7e1857,_0x5c07d4){return db['OpenchannelMessage'][_0x4bf5('0x55')](_0x7e1857['body'],{})[_0x4bf5('0x1d')](respondWithResult(_0x5c07d4,0xc9))[_0x4bf5('0x28')](handleError(_0x5c07d4,null));};exports[_0x4bf5('0x35')]=function(_0xce4d8f,_0x343007){if(_0xce4d8f[_0x4bf5('0x56')]['id']){delete _0xce4d8f[_0x4bf5('0x56')]['id'];}return db[_0x4bf5('0x3c')][_0x4bf5('0x57')]({'where':{'id':_0xce4d8f['params']['id']}})[_0x4bf5('0x1d')](handleEntityNotFound(_0x343007,null))['then'](saveUpdates(_0xce4d8f[_0x4bf5('0x56')],null))[_0x4bf5('0x1d')](respondWithResult(_0x343007,null))[_0x4bf5('0x28')](handleError(_0x343007,null));};exports[_0x4bf5('0x36')]=function(_0x3e2d16,_0x3a9a5f){return db[_0x4bf5('0x3c')][_0x4bf5('0x57')]({'where':{'id':_0x3e2d16[_0x4bf5('0x53')]['id']}})['then'](handleEntityNotFound(_0x3a9a5f,null))[_0x4bf5('0x1d')](removeEntity(_0x3a9a5f,null))[_0x4bf5('0x28')](handleError(_0x3a9a5f,null));};exports['describe']=function(_0xdef8eb,_0x59da67){return db[_0x4bf5('0x3c')][_0x4bf5('0x58')]()[_0x4bf5('0x1d')](respondWithResult(_0x59da67,null))[_0x4bf5('0x28')](handleError(_0x59da67,null));};var interaction_log=require(_0x4bf5('0x59'))(_0x4bf5('0x5a'));exports[_0x4bf5('0x5b')]=function(_0x4dc88f,_0x17b3d0,_0x49b164){var _0x4bb398={'agent':{},'channel':_0x4bf5('0x5c')};if(_0x4dc88f[_0x4bf5('0x56')]['id']){delete _0x4dc88f[_0x4bf5('0x56')]['id'];}_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x5d')]=!![];_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x5e')]=moment()[_0x4bf5('0x5f')](_0x4bf5('0x60'));_0x4dc88f[_0x4bf5('0x56')]['UserId']=_0x4dc88f[_0x4bf5('0x56')]['UserId']||_0x4dc88f[_0x4bf5('0x61')]['id'];_0x4bb398[_0x4bf5('0x62')]['id']=_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x63')];return db['OpenchannelMessage'][_0x4bf5('0x57')]({'where':{'id':_0x4dc88f[_0x4bf5('0x53')]['id'],'UserId':null}})[_0x4bf5('0x1d')](handleEntityNotFound(_0x17b3d0,null))[_0x4bf5('0x1d')](saveUpdates(_0x4dc88f['body'],null))[_0x4bf5('0x1d')](function(_0x42c77f){if(_0x42c77f){_0x4bb398[_0x4bf5('0x25')]=_0x42c77f[_0x4bf5('0x64')]({'plain':!![]});return db[_0x4bf5('0x65')][_0x4bf5('0x57')]({'where':{'id':_0x42c77f[_0x4bf5('0x66')]}});}return null;})[_0x4bf5('0x1d')](handleEntityNotFound(_0x17b3d0,null))[_0x4bf5('0x1d')](function(_0x46e89c){if(_0x46e89c){return _0x46e89c[_0x4bf5('0x35')]({'UserId':_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x63')],'read1stAt':_[_0x4bf5('0x67')](_0x46e89c[_0x4bf5('0x68')])?moment()[_0x4bf5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4bf5('0x1d')](function(_0x4a64e4){if(_0x4a64e4){_0x4bb398['interaction']=_0x4a64e4[_0x4bf5('0x64')]({'plain':!![]});interaction_log[_0x4bf5('0x1e')](_0x4bf5('0x69'),_0x4dc88f[_0x4bf5('0x61')]['id'],_0x4dc88f[_0x4bf5('0x61')][_0x4bf5('0x38')],_0x4dc88f['user'][_0x4bf5('0x6a')],_0x4bb398[_0x4bf5('0x6b')]['id'],_0x4dc88f[_0x4bf5('0x56')]?JSON['stringify'](_0x4dc88f[_0x4bf5('0x56')]):_0x4bf5('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4bb398);}return null;})[_0x4bf5('0x1d')](function(_0x5ae6b1){var _0x7fe585='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5ae6b1[_0x4bf5('0x25')][_0x4bf5('0x6d')];return db['sequelize']['query'](_0x7fe585,{'type':db[_0x4bf5('0x6e')][_0x4bf5('0x6f')][_0x4bf5('0x70')],'raw':!![]})[_0x4bf5('0x1d')](function(_0x3a981b){return _0x3a981b;});})['then'](function(_0x23386b){if(_0x23386b){_0x4bb398[_0x4bf5('0x25')]['contact']=_0x23386b[0x0];if(!_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x63')])return;return db[_0x4bf5('0x71')][_0x4bf5('0x57')]({'where':{'id':_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x63')],'role':_0x4bf5('0x62')},'attributes':['id',_0x4bf5('0x38'),_0x4bf5('0x72'),'email',_0x4bf5('0x73')],'raw':!![]});}return null;})['then'](function(_0x3b999a){if(!_0x3b999a)return null;_0x4bb398['message']['agent']=_0x3b999a;return _0x4bb398;})[_0x4bf5('0x1d')](function(_0x599349){if(_0x599349){if(_0x4dc88f[_0x4bf5('0x56')][_0x4bf5('0x74')]){_0x4bb398['message']['interface']=util[_0x4bf5('0x5f')]('SIP/%s',_0x4dc88f['user'][_0x4bf5('0x38')]);_0x4bb398[_0x4bf5('0x25')]['channel']=_0x4bb398[_0x4bf5('0x75')];_0x4bb398['message'][_0x4bf5('0x76')]=_0x4bb398[_0x4bf5('0x75')];_0x4bb398[_0x4bf5('0x25')][_0x4bf5('0x77')]=_0x4bf5('0x5b');return respondWithRpcPromise('EventManager',_0x4bf5('0x78'),{'event':_0x4bf5('0x79'),'message':_0x4bb398[_0x4bf5('0x25')]},client9002)[_0x4bf5('0x1d')](function(){return _0x4bb398;});}return _0x4bb398;}return null;})[_0x4bf5('0x1d')](respondWithResult(_0x17b3d0,null))['catch'](handleError(_0x17b3d0,null));};var interaction_log=require(_0x4bf5('0x59'))(_0x4bf5('0x5a'));exports['reject']=function(_0x7e1e51,_0x3adcd3,_0x390ed5){var _0x231961={'agent':{},'channel':_0x4bf5('0x5c')};if(_0x7e1e51[_0x4bf5('0x56')]['id']){delete _0x7e1e51[_0x4bf5('0x56')]['id'];}_0x7e1e51[_0x4bf5('0x56')]['UserId']=_0x7e1e51[_0x4bf5('0x56')][_0x4bf5('0x63')]||_0x7e1e51['user']['id'];_0x231961[_0x4bf5('0x62')]['id']=_0x7e1e51[_0x4bf5('0x56')][_0x4bf5('0x63')];return db['OpenchannelMessage'][_0x4bf5('0x57')]({'where':{'id':_0x7e1e51[_0x4bf5('0x53')]['id'],'UserId':null}})[_0x4bf5('0x1d')](handleEntityNotFound(_0x3adcd3,null))[_0x4bf5('0x1d')](function(_0x2f37e5){if(_0x2f37e5){_0x231961[_0x4bf5('0x25')]=_0x2f37e5[_0x4bf5('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x4bf5('0x57')]({'where':{'id':_0x2f37e5[_0x4bf5('0x66')]}});}return null;})[_0x4bf5('0x1d')](handleEntityNotFound(_0x3adcd3,null))['then'](function(_0x3ab2b9){if(_0x3ab2b9){_0x231961[_0x4bf5('0x6b')]=_0x3ab2b9[_0x4bf5('0x64')]({'plain':!![]});interaction_log['info'](_0x4bf5('0x7a'),_0x7e1e51['user']['id'],_0x7e1e51['user']['name'],_0x7e1e51['user'][_0x4bf5('0x6a')],_0x231961[_0x4bf5('0x6b')]['id'],_0x7e1e51[_0x4bf5('0x56')]?JSON[_0x4bf5('0x22')](_0x7e1e51[_0x4bf5('0x56')]):_0x4bf5('0x6c'));return respondWithRpcPromise(_0x4bf5('0x7b'),_0x4bf5('0x7c'),_0x231961);}return null;})[_0x4bf5('0x1d')](function(_0x2d9f9c){var _0x46959f=_0x4bf5('0x7d')+_0x2d9f9c[_0x4bf5('0x25')][_0x4bf5('0x6d')];return db[_0x4bf5('0x7e')]['query'](_0x46959f,{'type':db[_0x4bf5('0x6e')][_0x4bf5('0x6f')][_0x4bf5('0x70')],'raw':!![]})[_0x4bf5('0x1d')](function(_0x3e5002){return _0x3e5002;});})[_0x4bf5('0x1d')](function(_0x445344){if(_0x445344){_0x231961['message']['contact']=_0x445344[0x0];if(!_0x7e1e51[_0x4bf5('0x56')]['UserId'])return;return db[_0x4bf5('0x71')]['find']({'where':{'id':_0x7e1e51[_0x4bf5('0x56')][_0x4bf5('0x63')],'role':_0x4bf5('0x62')},'attributes':['id',_0x4bf5('0x38'),_0x4bf5('0x72'),_0x4bf5('0x7f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2c624d){if(!_0x2c624d)return null;_0x231961[_0x4bf5('0x25')][_0x4bf5('0x62')]=_0x2c624d;return _0x231961;})[_0x4bf5('0x1d')](function(_0x8b9d31){if(_0x8b9d31){_0x8b9d31[_0x4bf5('0x25')][_0x4bf5('0x80')]=util[_0x4bf5('0x5f')](_0x4bf5('0x81'),_0x7e1e51[_0x4bf5('0x61')][_0x4bf5('0x38')]);_0x8b9d31[_0x4bf5('0x25')][_0x4bf5('0x75')]=_0x231961[_0x4bf5('0x75')];_0x8b9d31['message'][_0x4bf5('0x76')]=_0x231961['channel'];_0x8b9d31['message']['event']=_0x4bf5('0x33');respondWithRpcPromise(_0x4bf5('0x78'),_0x4bf5('0x78'),{'event':'rejectmessage','message':_0x8b9d31['message']},client9002);return _0x231961;}return null;})[_0x4bf5('0x1d')](respondWithResult(_0x3adcd3,null))[_0x4bf5('0x28')](handleError(_0x3adcd3,null));}; \ No newline at end of file +var _0xe1ae=['[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','OpenchannelMessage','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','create','body','describe','openchannel-interactions','openchannel','read','readAt','format','UserId','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction'];(function(_0x25eaf8,_0x958c7a){var _0x5f2f29=function(_0x115d7d){while(--_0x115d7d){_0x25eaf8['push'](_0x25eaf8['shift']());}};_0x5f2f29(++_0x958c7a);}(_0xe1ae,0x137));var _0xee1a=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0xe1ae[_0x9db5d3];return _0x477a81;};'use strict';var emlformat=require(_0xee1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee1a('0x1'));var jsonpatch=require(_0xee1a('0x2'));var rp=require(_0xee1a('0x3'));var moment=require(_0xee1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee1a('0x5'));var util=require(_0xee1a('0x6'));var path=require(_0xee1a('0x7'));var sox=require('sox');var csv=require(_0xee1a('0x8'));var ejs=require(_0xee1a('0x9'));var fs=require('fs');var fs_extra=require(_0xee1a('0xa'));var _=require(_0xee1a('0xb'));var squel=require(_0xee1a('0xc'));var crypto=require(_0xee1a('0xd'));var jsforce=require(_0xee1a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee1a('0xf'));var Papa=require(_0xee1a('0x10'));var Redis=require(_0xee1a('0x11'));var authService=require(_0xee1a('0x12'));var qs=require(_0xee1a('0x13'));var as=require(_0xee1a('0x14'));var hardwareService=require(_0xee1a('0x15'));var logger=require(_0xee1a('0x16'))(_0xee1a('0x17'));var utils=require(_0xee1a('0x18'));var config=require(_0xee1a('0x19'));var licenseUtil=require(_0xee1a('0x1a'));var db=require(_0xee1a('0x1b'))['db'];config[_0xee1a('0x1c')]=_[_0xee1a('0x1d')](config[_0xee1a('0x1c')],{'host':_0xee1a('0x1e'),'port':0x18eb});var socket=require(_0xee1a('0x1f'))(new Redis(config['redis']));require(_0xee1a('0x20'))[_0xee1a('0x21')](socket);var jayson=require(_0xee1a('0x22'));var client=jayson[_0xee1a('0x23')][_0xee1a('0x24')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f0c3f,_0x121fbc,_0x256246,_0x2b7f22){return new BPromise(function(_0x586e7a,_0x58457b){var _0x504f41=_0x2b7f22||client;return _0x504f41[_0xee1a('0x25')](_0x4f0c3f,_0x256246)[_0xee1a('0x26')](function(_0x504d8b){logger[_0xee1a('0x27')](_0xee1a('0x28'),_0x121fbc,_0xee1a('0x29'));logger[_0xee1a('0x2a')](_0xee1a('0x2b'),_0x121fbc,_0xee1a('0x29'),JSON[_0xee1a('0x2c')](_0x504d8b));if(_0x504d8b['error']){if(_0x504d8b['error'][_0xee1a('0x2d')]===0x1f4){logger[_0xee1a('0x2e')](_0xee1a('0x28'),_0x121fbc,_0x504d8b[_0xee1a('0x2e')][_0xee1a('0x2f')]);return _0x58457b(_0x504d8b[_0xee1a('0x2e')][_0xee1a('0x2f')]);}logger[_0xee1a('0x2e')]('OpenchannelMessage,\x20%s,\x20%s',_0x121fbc,_0x504d8b[_0xee1a('0x2e')]['message']);return _0x586e7a(_0x504d8b['error'][_0xee1a('0x2f')]);}else{logger[_0xee1a('0x27')](_0xee1a('0x28'),_0x121fbc,_0xee1a('0x29'));_0x586e7a(_0x504d8b[_0xee1a('0x30')]['message']);}})[_0xee1a('0x31')](function(_0x300a31){logger[_0xee1a('0x2e')](_0xee1a('0x28'),_0x121fbc,_0x300a31);_0x58457b(_0x300a31);});});}function respondWithStatusCode(_0xad1b2f,_0x403201){_0x403201=_0x403201||0xcc;return function(_0x317942){if(_0x317942){return _0xad1b2f['sendStatus'](_0x403201);}return _0xad1b2f[_0xee1a('0x32')](_0x403201)['end']();};}function respondWithResult(_0x606c27,_0x45a4ea){_0x45a4ea=_0x45a4ea||0xc8;return function(_0x4bb7a5){if(_0x4bb7a5){return _0x606c27[_0xee1a('0x32')](_0x45a4ea)[_0xee1a('0x33')](_0x4bb7a5);}};}function respondWithFilteredResult(_0x11f8e5,_0x2fbc36){return function(_0x464cb5){if(_0x464cb5){var _0x2de60e=typeof _0x2fbc36['offset']===_0xee1a('0x34')&&typeof _0x2fbc36['limit']===_0xee1a('0x34');var _0x310ee5=_0x464cb5['count'];var _0xaca959=_0x2de60e?0x0:_0x2fbc36[_0xee1a('0x35')];var _0x246477=_0x2de60e?_0x464cb5[_0xee1a('0x36')]:_0x2fbc36[_0xee1a('0x35')]+_0x2fbc36[_0xee1a('0x37')];var _0x22fc4a;if(_0x246477>=_0x310ee5){_0x246477=_0x310ee5;_0x22fc4a=0xc8;}else{_0x22fc4a=0xce;}_0x11f8e5[_0xee1a('0x32')](_0x22fc4a);return _0x11f8e5[_0xee1a('0x38')](_0xee1a('0x39'),_0xaca959+'-'+_0x246477+'/'+_0x310ee5)[_0xee1a('0x33')](_0x464cb5);}return null;};}function patchUpdates(_0x3169fc){return function(_0xbdde4f){try{jsonpatch['apply'](_0xbdde4f,_0x3169fc,!![]);}catch(_0x3f096b){return BPromise[_0xee1a('0x3a')](_0x3f096b);}return _0xbdde4f[_0xee1a('0x3b')]();};}function saveUpdates(_0x120684,_0x3309ad){return function(_0xaf227f){if(_0xaf227f){return _0xaf227f[_0xee1a('0x3c')](_0x120684)[_0xee1a('0x26')](function(_0x40afec){return _0x40afec;});}return null;};}function removeEntity(_0x27e483,_0x17f480){return function(_0x2d9a64){if(_0x2d9a64){return _0x2d9a64[_0xee1a('0x3d')]()[_0xee1a('0x26')](function(){_0x27e483[_0xee1a('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e3ed,_0xa5a8d7){return function(_0x32ceba){if(!_0x32ceba){_0x26e3ed[_0xee1a('0x3e')](0x194);}return _0x32ceba;};}function handleError(_0x48f2de,_0x1f49c1){_0x1f49c1=_0x1f49c1||0x1f4;return function(_0x31432d){logger[_0xee1a('0x2e')](_0x31432d[_0xee1a('0x3f')]);if(_0x31432d[_0xee1a('0x40')]){delete _0x31432d[_0xee1a('0x40')];}_0x48f2de[_0xee1a('0x32')](_0x1f49c1)[_0xee1a('0x41')](_0x31432d);};}exports['index']=function(_0x46a0f1,_0x393b1c){var _0x391dc1={},_0x198cb7={},_0x10249e={'count':0x0,'rows':[]};var _0x4a876c=_['map'](db[_0xee1a('0x42')][_0xee1a('0x43')],function(_0x487415){return{'name':_0x487415[_0xee1a('0x44')],'type':_0x487415['type'][_0xee1a('0x45')]};});_0x198cb7['model']=_[_0xee1a('0x46')](_0x4a876c,'name');_0x198cb7['query']=_[_0xee1a('0x47')](_0x46a0f1[_0xee1a('0x48')]);_0x198cb7[_0xee1a('0x49')]=_[_0xee1a('0x4a')](_0x198cb7[_0xee1a('0x4b')],_0x198cb7['query']);_0x391dc1['attributes']=_[_0xee1a('0x4a')](_0x198cb7[_0xee1a('0x4b')],qs[_0xee1a('0x4c')](_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x4c')]));_0x391dc1[_0xee1a('0x4d')]=_0x391dc1[_0xee1a('0x4d')]['length']?_0x391dc1['attributes']:_0x198cb7[_0xee1a('0x4b')];if(!_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x4e')](_0xee1a('0x4f'))){_0x391dc1[_0xee1a('0x37')]=qs[_0xee1a('0x37')](_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x37')]);_0x391dc1[_0xee1a('0x35')]=qs['offset'](_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x35')]);}_0x391dc1[_0xee1a('0x50')]=qs[_0xee1a('0x51')](_0x46a0f1['query']['sort']);_0x391dc1[_0xee1a('0x52')]=qs['filters'](_['pick'](_0x46a0f1[_0xee1a('0x48')],_0x198cb7[_0xee1a('0x49')]),_0x4a876c);if(_0x46a0f1['query']['filter']){_0x391dc1[_0xee1a('0x52')]=_[_0xee1a('0x53')](_0x391dc1['where'],{'$or':_['map'](_0x4a876c,function(_0x58801e){if(_0x58801e[_0xee1a('0x54')]!==_0xee1a('0x55')){var _0x20fa9d={};_0x20fa9d[_0x58801e[_0xee1a('0x40')]]={'$like':'%'+_0x46a0f1[_0xee1a('0x48')]['filter']+'%'};return _0x20fa9d;}})});}_0x391dc1=_[_0xee1a('0x53')]({},_0x391dc1,_0x46a0f1['options']);var _0x8020a7={'where':_0x391dc1[_0xee1a('0x52')]};return db[_0xee1a('0x42')]['count'](_0x8020a7)['then'](function(_0x3ddc4b){_0x10249e[_0xee1a('0x36')]=_0x3ddc4b;if(_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x56')]){_0x391dc1['include']=[{'all':!![]}];}return db[_0xee1a('0x42')][_0xee1a('0x57')](_0x391dc1);})[_0xee1a('0x26')](function(_0x25a381){_0x10249e[_0xee1a('0x58')]=_0x25a381;return _0x10249e;})['then'](respondWithFilteredResult(_0x393b1c,_0x391dc1))[_0xee1a('0x31')](handleError(_0x393b1c,null));};exports[_0xee1a('0x59')]=function(_0x2b0d4b,_0x5a0325){var _0x468374={'raw':!![],'where':{'id':_0x2b0d4b[_0xee1a('0x5a')]['id']}},_0x3cf1f6={};_0x3cf1f6[_0xee1a('0x4b')]=_[_0xee1a('0x47')](db[_0xee1a('0x42')][_0xee1a('0x43')]);_0x3cf1f6[_0xee1a('0x48')]=_[_0xee1a('0x47')](_0x2b0d4b[_0xee1a('0x48')]);_0x3cf1f6[_0xee1a('0x49')]=_[_0xee1a('0x4a')](_0x3cf1f6[_0xee1a('0x4b')],_0x3cf1f6['query']);_0x468374[_0xee1a('0x4d')]=_[_0xee1a('0x4a')](_0x3cf1f6['model'],qs[_0xee1a('0x4c')](_0x2b0d4b[_0xee1a('0x48')][_0xee1a('0x4c')]));_0x468374[_0xee1a('0x4d')]=_0x468374['attributes']['length']?_0x468374[_0xee1a('0x4d')]:_0x3cf1f6[_0xee1a('0x4b')];if(_0x2b0d4b[_0xee1a('0x48')][_0xee1a('0x56')]){_0x468374[_0xee1a('0x5b')]=[{'all':!![]}];}_0x468374=_[_0xee1a('0x53')]({},_0x468374,_0x2b0d4b[_0xee1a('0x5c')]);return db[_0xee1a('0x42')][_0xee1a('0x5d')](_0x468374)['then'](handleEntityNotFound(_0x5a0325,null))[_0xee1a('0x26')](respondWithResult(_0x5a0325,null))['catch'](handleError(_0x5a0325,null));};exports[_0xee1a('0x5e')]=function(_0x14c5f6,_0x432f5b){return db['OpenchannelMessage']['create'](_0x14c5f6['body'],{})[_0xee1a('0x26')](respondWithResult(_0x432f5b,0xc9))[_0xee1a('0x31')](handleError(_0x432f5b,null));};exports[_0xee1a('0x3c')]=function(_0xaceb05,_0x4da456){if(_0xaceb05['body']['id']){delete _0xaceb05[_0xee1a('0x5f')]['id'];}return db['OpenchannelMessage'][_0xee1a('0x5d')]({'where':{'id':_0xaceb05[_0xee1a('0x5a')]['id']}})[_0xee1a('0x26')](handleEntityNotFound(_0x4da456,null))['then'](saveUpdates(_0xaceb05[_0xee1a('0x5f')],null))['then'](respondWithResult(_0x4da456,null))[_0xee1a('0x31')](handleError(_0x4da456,null));};exports[_0xee1a('0x3d')]=function(_0x13b0a0,_0x36aa1e){return db[_0xee1a('0x42')][_0xee1a('0x5d')]({'where':{'id':_0x13b0a0[_0xee1a('0x5a')]['id']}})[_0xee1a('0x26')](handleEntityNotFound(_0x36aa1e,null))[_0xee1a('0x26')](removeEntity(_0x36aa1e,null))['catch'](handleError(_0x36aa1e,null));};exports[_0xee1a('0x60')]=function(_0x105726,_0x529407){return db['OpenchannelMessage'][_0xee1a('0x60')]()['then'](respondWithResult(_0x529407,null))['catch'](handleError(_0x529407,null));};var interaction_log=require(_0xee1a('0x16'))(_0xee1a('0x61'));exports['accept']=function(_0x7e92c2,_0x52a9ec,_0x5f4449){var _0x436fba={'agent':{},'channel':_0xee1a('0x62')};if(_0x7e92c2['body']['id']){delete _0x7e92c2[_0xee1a('0x5f')]['id'];}_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x63')]=!![];_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x64')]=moment()[_0xee1a('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')]=_0x7e92c2['body']['UserId']||_0x7e92c2['user']['id'];_0x436fba['agent']['id']=_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')];return db[_0xee1a('0x42')][_0xee1a('0x5d')]({'where':{'id':_0x7e92c2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52a9ec,null))[_0xee1a('0x26')](saveUpdates(_0x7e92c2[_0xee1a('0x5f')],null))[_0xee1a('0x26')](function(_0xaf110b){if(_0xaf110b){_0x436fba[_0xee1a('0x2f')]=_0xaf110b[_0xee1a('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0xee1a('0x5d')]({'where':{'id':_0xaf110b[_0xee1a('0x68')]}});}return null;})[_0xee1a('0x26')](handleEntityNotFound(_0x52a9ec,null))[_0xee1a('0x26')](function(_0x451285){if(_0x451285){return _0x451285[_0xee1a('0x3c')]({'UserId':_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')],'read1stAt':_[_0xee1a('0x69')](_0x451285[_0xee1a('0x6a')])?moment()[_0xee1a('0x65')](_0xee1a('0x6b')):undefined});}return null;})[_0xee1a('0x26')](function(_0x2875c1){if(_0x2875c1){_0x436fba[_0xee1a('0x6c')]=_0x2875c1['get']({'plain':!![]});interaction_log[_0xee1a('0x27')](_0xee1a('0x6d'),_0x7e92c2['user']['id'],_0x7e92c2[_0xee1a('0x6e')][_0xee1a('0x40')],_0x7e92c2[_0xee1a('0x6e')][_0xee1a('0x6f')],_0x436fba[_0xee1a('0x6c')]['id'],_0x7e92c2[_0xee1a('0x5f')]?JSON[_0xee1a('0x2c')](_0x7e92c2[_0xee1a('0x5f')]):_0xee1a('0x70'));return respondWithRpcPromise('AcceptMessage',_0xee1a('0x71'),_0x436fba);}return null;})[_0xee1a('0x26')](function(_0x238e65){var _0x1a6ba9=_0xee1a('0x72')+_0x238e65[_0xee1a('0x2f')][_0xee1a('0x73')];return db[_0xee1a('0x74')][_0xee1a('0x48')](_0x1a6ba9,{'type':db[_0xee1a('0x75')][_0xee1a('0x76')][_0xee1a('0x77')],'raw':!![]})[_0xee1a('0x26')](function(_0x42976b){return _0x42976b;});})[_0xee1a('0x26')](function(_0x48deed){if(_0x48deed){_0x436fba['message'][_0xee1a('0x78')]=_0x48deed[0x0];if(!_0x7e92c2['body'][_0xee1a('0x66')])return;return db[_0xee1a('0x79')][_0xee1a('0x5d')]({'where':{'id':_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')],'role':'agent'},'attributes':['id',_0xee1a('0x40'),_0xee1a('0x7a'),_0xee1a('0x7b'),_0xee1a('0x7c')],'raw':!![]});}return null;})['then'](function(_0x4a15a2){if(!_0x4a15a2)return null;_0x436fba[_0xee1a('0x2f')][_0xee1a('0x7d')]=_0x4a15a2;return _0x436fba;})[_0xee1a('0x26')](function(_0x35af59){if(_0x35af59){if(_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x7e')]){_0x436fba[_0xee1a('0x2f')][_0xee1a('0x7f')]=util[_0xee1a('0x65')](_0xee1a('0x80'),_0x7e92c2[_0xee1a('0x6e')][_0xee1a('0x40')]);_0x436fba[_0xee1a('0x2f')][_0xee1a('0x81')]=_0x436fba[_0xee1a('0x81')];_0x436fba['message'][_0xee1a('0x82')]=_0x436fba[_0xee1a('0x81')];_0x436fba[_0xee1a('0x2f')][_0xee1a('0x83')]=_0xee1a('0x84');return respondWithRpcPromise(_0xee1a('0x85'),_0xee1a('0x85'),{'event':_0xee1a('0x86'),'message':_0x436fba[_0xee1a('0x2f')]},client9002)[_0xee1a('0x26')](function(){return _0x436fba;});}return _0x436fba;}return null;})[_0xee1a('0x26')](respondWithResult(_0x52a9ec,null))[_0xee1a('0x31')](handleError(_0x52a9ec,null));};var interaction_log=require(_0xee1a('0x16'))(_0xee1a('0x61'));exports['reject']=function(_0x460a1f,_0x42cdee,_0x250432){var _0x43b500={'agent':{},'channel':_0xee1a('0x62')};if(_0x460a1f[_0xee1a('0x5f')]['id']){delete _0x460a1f[_0xee1a('0x5f')]['id'];}_0x460a1f[_0xee1a('0x5f')][_0xee1a('0x66')]=_0x460a1f['body']['UserId']||_0x460a1f['user']['id'];_0x43b500[_0xee1a('0x7d')]['id']=_0x460a1f[_0xee1a('0x5f')]['UserId'];return db[_0xee1a('0x42')][_0xee1a('0x5d')]({'where':{'id':_0x460a1f['params']['id'],'UserId':null}})[_0xee1a('0x26')](handleEntityNotFound(_0x42cdee,null))['then'](function(_0x8d74ca){if(_0x8d74ca){_0x43b500[_0xee1a('0x2f')]=_0x8d74ca['get']({'plain':!![]});return db[_0xee1a('0x87')][_0xee1a('0x5d')]({'where':{'id':_0x8d74ca['OpenchannelInteractionId']}});}return null;})[_0xee1a('0x26')](handleEntityNotFound(_0x42cdee,null))[_0xee1a('0x26')](function(_0x48e5ed){if(_0x48e5ed){_0x43b500[_0xee1a('0x6c')]=_0x48e5ed['get']({'plain':!![]});interaction_log[_0xee1a('0x27')](_0xee1a('0x88'),_0x460a1f['user']['id'],_0x460a1f['user'][_0xee1a('0x40')],_0x460a1f[_0xee1a('0x6e')]['role'],_0x43b500['interaction']['id'],_0x460a1f['body']?JSON['stringify'](_0x460a1f[_0xee1a('0x5f')]):_0xee1a('0x70'));return respondWithRpcPromise(_0xee1a('0x89'),_0xee1a('0x8a'),_0x43b500);}return null;})['then'](function(_0x23a4fd){var _0x1617a6=_0xee1a('0x72')+_0x23a4fd[_0xee1a('0x2f')][_0xee1a('0x73')];return db['sequelize'][_0xee1a('0x48')](_0x1617a6,{'type':db['Sequelize'][_0xee1a('0x76')][_0xee1a('0x77')],'raw':!![]})[_0xee1a('0x26')](function(_0x2a8fcc){return _0x2a8fcc;});})[_0xee1a('0x26')](function(_0x3a0455){if(_0x3a0455){_0x43b500[_0xee1a('0x2f')][_0xee1a('0x78')]=_0x3a0455[0x0];if(!_0x460a1f['body']['UserId'])return;return db[_0xee1a('0x79')]['find']({'where':{'id':_0x460a1f[_0xee1a('0x5f')][_0xee1a('0x66')],'role':_0xee1a('0x7d')},'attributes':['id',_0xee1a('0x40'),_0xee1a('0x7a'),_0xee1a('0x7b'),'internal'],'raw':!![]});}return null;})[_0xee1a('0x26')](function(_0x11b2f0){if(!_0x11b2f0)return null;_0x43b500[_0xee1a('0x2f')][_0xee1a('0x7d')]=_0x11b2f0;return _0x43b500;})[_0xee1a('0x26')](function(_0x15b641){if(_0x15b641){_0x15b641[_0xee1a('0x2f')][_0xee1a('0x7f')]=util['format'](_0xee1a('0x80'),_0x460a1f[_0xee1a('0x6e')][_0xee1a('0x40')]);_0x15b641['message']['channel']=_0x43b500[_0xee1a('0x81')];_0x15b641[_0xee1a('0x2f')][_0xee1a('0x82')]=_0x43b500[_0xee1a('0x81')];_0x15b641[_0xee1a('0x2f')][_0xee1a('0x83')]=_0xee1a('0x3a');respondWithRpcPromise('EventManager','EventManager',{'event':_0xee1a('0x8b'),'message':_0x15b641[_0xee1a('0x2f')]},client9002);return _0x43b500;}return null;})[_0xee1a('0x26')](respondWithResult(_0x42cdee,null))['catch'](handleError(_0x42cdee,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 73175ab..3b0167e 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 _0xa4b8=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x422871,_0x476c6c){var _0x4d2342=function(_0x3caa5d){while(--_0x3caa5d){_0x422871['push'](_0x422871['shift']());}};_0x4d2342(++_0x476c6c);}(_0xa4b8,0xa6));var _0x8a4b=function(_0x3a58ec,_0x4205bb){_0x3a58ec=_0x3a58ec-0x0;var _0x2e0660=_0xa4b8[_0x3a58ec];return _0x2e0660;};'use strict';var EventEmitter=require(_0x8a4b('0x0'));var OpenchannelMessage=require(_0x8a4b('0x1'))['db'][_0x8a4b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8a4b('0x3')](0x0);var events={'afterCreate':_0x8a4b('0x4'),'afterUpdate':_0x8a4b('0x5'),'afterDestroy':_0x8a4b('0x6')};function emitEvent(_0x44c927){return function(_0x5c436b,_0x4ace67,_0x43ae7b){OpenchannelMessageEvents['emit'](_0x44c927+':'+_0x5c436b['id'],_0x5c436b);OpenchannelMessageEvents[_0x8a4b('0x7')](_0x44c927,_0x5c436b);_0x43ae7b(null);};}for(var e in events){if(events[_0x8a4b('0x8')](e)){var event=events[e];OpenchannelMessage[_0x8a4b('0x9')](e,emitEvent(event));}}module[_0x8a4b('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xeef2=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x14e833,_0x1ffc79){var _0x31195d=function(_0xbcfb12){while(--_0xbcfb12){_0x14e833['push'](_0x14e833['shift']());}};_0x31195d(++_0x1ffc79);}(_0xeef2,0xb1));var _0x2eef=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeef2[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x2eef('0x0'));var OpenchannelMessage=require(_0x2eef('0x1'))['db'][_0x2eef('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2eef('0x3')](0x0);var events={'afterCreate':_0x2eef('0x4'),'afterUpdate':_0x2eef('0x5'),'afterDestroy':_0x2eef('0x6')};function emitEvent(_0x4bfc0c){return function(_0x357ae4,_0x4de6ff,_0x1e7d6f){OpenchannelMessageEvents['emit'](_0x4bfc0c+':'+_0x357ae4['id'],_0x357ae4);OpenchannelMessageEvents[_0x2eef('0x7')](_0x4bfc0c,_0x357ae4);_0x1e7d6f(null);};}for(var e in events){if(events[_0x2eef('0x8')](e)){var event=events[e];OpenchannelMessage[_0x2eef('0x9')](e,emitEvent(event));}}module[_0x2eef('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index d6894f4..6451f42 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 _0x45e0=['lodash','util','../../config/logger','bluebird','../../config/environment','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','error','CmContact','then','find','OpenchannelAccountId','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Interaction','omit','Contact','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4ca0a1,_0x6158d8){var _0x1c26c3=function(_0x3029e5){while(--_0x3029e5){_0x4ca0a1['push'](_0x4ca0a1['shift']());}};_0x1c26c3(++_0x6158d8);}(_0x45e0,0x11a));var _0x045e=function(_0x41e925,_0x1c616e){_0x41e925=_0x41e925-0x0;var _0x455b4b=_0x45e0[_0x41e925];return _0x455b4b;};'use strict';var _=require(_0x045e('0x0'));var util=require(_0x045e('0x1'));var logger=require(_0x045e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x045e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x045e('0x4'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x2dbbb1,_0x573be7){return _0x2dbbb1[_0x045e('0x5')](_0x045e('0x6'),attributes,{'tableName':_0x045e('0x7'),'paranoid':![],'indexes':[{'name':_0x045e('0x8'),'fields':[_0x045e('0x9')],'type':_0x045e('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x337dd3,_0x60f218,_0x48cf37){var _0xca6889=_0x2dbbb1[_0x045e('0xb')];var _0x54e2c8=_0x337dd3[_0x045e('0xc')]({'plain':!![]});if(_0x54e2c8[_0x045e('0xd')]['toLowerCase']()==='in'||_0x54e2c8[_0x045e('0xd')][_0x045e('0xe')]()===_0x045e('0xf')&&!_0x54e2c8[_0x045e('0x10')]&&!_[_0x045e('0x11')](_0x54e2c8[_0x045e('0x12')])){_0xca6889[_0x045e('0x13')][_0x045e('0x14')]({'where':{'id':_0x54e2c8[_0x045e('0x15')]}})['then'](function(_0x1ff0f0){if(_0x1ff0f0){_0x1ff0f0['update']({'lastMsgAt':_0x54e2c8[_0x045e('0x16')],'lastMsgDirection':_0x54e2c8[_0x045e('0xd')][_0x045e('0xe')]()});}})[_0x045e('0x17')](function(_0x493a36){console[_0x045e('0x18')](_0x493a36);});}if(_0x54e2c8[_0x045e('0xd')]===_0x045e('0xf')&&!_0x54e2c8['secret']){var _0x2eddb5;_0xca6889[_0x045e('0x19')]['describe']()[_0x045e('0x1a')](function(_0x19133c){return _0xca6889['OpenchannelAccount'][_0x045e('0x1b')]({'where':{'id':_0x54e2c8[_0x045e('0x1c')]},'include':[{'model':_0xca6889[_0x045e('0x13')],'as':_0x045e('0x1d'),'where':{'id':_0x54e2c8[_0x045e('0x15')]},'limit':0x1,'include':[{'model':_0xca6889['CmContact'],'as':'Contact','attributes':_[_0x045e('0x1e')](_0x19133c)}]}]});})['then'](function(_0x767685){_0x2eddb5=_0x767685[_0x045e('0xc')]({'plain':!![]});if(_0x2eddb5&&_0x2eddb5[_0x045e('0x1f')]){logger[_0x045e('0x20')](_0x045e('0x21'),_0x045e('0x22'),util[_0x045e('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x54e2c8['id'],_0x2eddb5['replyUri']));if(_0x2eddb5[_0x045e('0x1d')]&&_0x2eddb5[_0x045e('0x1d')]['length']){_0x54e2c8[_0x045e('0x24')]=_[_0x045e('0x25')](_0x2eddb5[_0x045e('0x1d')][0x0],_0x045e('0x26'));_0x54e2c8[_0x045e('0x26')]=_0x2eddb5[_0x045e('0x1d')][0x0][_0x045e('0x26')];}var _0x60f218={'method':_0x045e('0x27'),'uri':encodeURI(_0x2eddb5[_0x045e('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x60f218[_0x045e('0x28')]){case _0x045e('0x29'):_0x60f218['qs']=_0x54e2c8;break;case _0x045e('0x27'):_0x60f218[_0x045e('0x9')]=_0x54e2c8;break;}return rp(_0x60f218)['then'](function(_0x4b88bd){logger[_0x045e('0x20')](_0x045e('0x21'),'afterCreate',util[_0x045e('0x23')](_0x045e('0x2a'),_0x54e2c8['id'],_0x2eddb5[_0x045e('0x1f')]));if(_0x4b88bd[_0x045e('0x9')]['threadId']&&_0x4b88bd['body'][_0x045e('0x2b')]!=_0x54e2c8[_0x045e('0x24')][_0x045e('0x2b')]){return _0xca6889[_0x045e('0x13')][_0x045e('0x2c')]({'threadId':_0x4b88bd[_0x045e('0x9')]['threadId']},{'where':{'id':_0x54e2c8[_0x045e('0x24')]['id']}});}else{return;}})['then'](function(){return _0x337dd3[_0x045e('0x2c')]({'read':!![]});})[_0x045e('0x17')](function(_0x585a46){logger[_0x045e('0x18')](_0x045e('0x21'),'afterCreate',util['inspect'](_0x585a46,{'showHidden':![],'depth':null}));_0x48cf37();});}else{_0x48cf37();}})['finally'](function(){_0x48cf37();});}else{_0x48cf37();}}},'charset':_0x045e('0x2d'),'collate':_0x045e('0x2e')});}; \ No newline at end of file +var _0x4b63=['POST','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelInteraction','Interactions','keys','then','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','method','GET'];(function(_0x2ea4d4,_0x15af14){var _0x1ef235=function(_0x260c1a){while(--_0x260c1a){_0x2ea4d4['push'](_0x2ea4d4['shift']());}};_0x1ef235(++_0x15af14);}(_0x4b63,0x199));var _0x34b6=function(_0x377cce,_0x3b4f48){_0x377cce=_0x377cce-0x0;var _0x256bc9=_0x4b63[_0x377cce];return _0x256bc9;};'use strict';var _=require(_0x34b6('0x0'));var util=require(_0x34b6('0x1'));var logger=require('../../config/logger')(_0x34b6('0x2'));var moment=require(_0x34b6('0x3'));var BPromise=require(_0x34b6('0x4'));var rp=require(_0x34b6('0x5'));var fs=require('fs');var path=require(_0x34b6('0x6'));var rimraf=require('rimraf');var config=require(_0x34b6('0x7'));var attributes=require(_0x34b6('0x8'));module['exports']=function(_0x8f6f0f,_0x1f7c6f){return _0x8f6f0f['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x34b6('0x9'),'fields':[_0x34b6('0xa')],'type':_0x34b6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e7dea,_0x5d9094,_0x243a15){var _0x20bf26=_0x8f6f0f[_0x34b6('0xc')];var _0x2709cc=_0x4e7dea[_0x34b6('0xd')]({'plain':!![]});if(_0x2709cc[_0x34b6('0xe')]['toLowerCase']()==='in'||_0x2709cc['direction']['toLowerCase']()===_0x34b6('0xf')&&!_0x2709cc[_0x34b6('0x10')]&&!_[_0x34b6('0x11')](_0x2709cc[_0x34b6('0x12')])){_0x20bf26['OpenchannelInteraction']['findOne']({'where':{'id':_0x2709cc[_0x34b6('0x13')]}})['then'](function(_0x24dd8c){if(_0x24dd8c){_0x24dd8c[_0x34b6('0x14')]({'lastMsgAt':_0x2709cc[_0x34b6('0x15')],'lastMsgDirection':_0x2709cc[_0x34b6('0xe')]['toLowerCase']()});}})[_0x34b6('0x16')](function(_0x242baf){console['error'](_0x242baf);});}if(_0x2709cc['direction']===_0x34b6('0xf')&&!_0x2709cc[_0x34b6('0x10')]){var _0x1cc619;_0x20bf26[_0x34b6('0x17')][_0x34b6('0x18')]()['then'](function(_0x5f1f5d){return _0x20bf26[_0x34b6('0x19')][_0x34b6('0x1a')]({'where':{'id':_0x2709cc['OpenchannelAccountId']},'include':[{'model':_0x20bf26[_0x34b6('0x1b')],'as':_0x34b6('0x1c'),'where':{'id':_0x2709cc['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x20bf26[_0x34b6('0x17')],'as':'Contact','attributes':_[_0x34b6('0x1d')](_0x5f1f5d)}]}]});})[_0x34b6('0x1e')](function(_0x3c0f7e){_0x1cc619=_0x3c0f7e[_0x34b6('0xd')]({'plain':!![]});if(_0x1cc619&&_0x1cc619[_0x34b6('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x34b6('0x20'),util[_0x34b6('0x21')](_0x34b6('0x22'),_0x2709cc['id'],_0x1cc619[_0x34b6('0x1f')]));if(_0x1cc619['Interactions']&&_0x1cc619['Interactions'][_0x34b6('0x23')]){_0x2709cc[_0x34b6('0x24')]=_[_0x34b6('0x25')](_0x1cc619[_0x34b6('0x1c')][0x0],_0x34b6('0x26'));_0x2709cc['Contact']=_0x1cc619[_0x34b6('0x1c')][0x0][_0x34b6('0x26')];}var _0x5d9094={'method':'POST','uri':encodeURI(_0x1cc619[_0x34b6('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5d9094[_0x34b6('0x27')]){case _0x34b6('0x28'):_0x5d9094['qs']=_0x2709cc;break;case _0x34b6('0x29'):_0x5d9094[_0x34b6('0xa')]=_0x2709cc;break;}return rp(_0x5d9094)[_0x34b6('0x1e')](function(_0x196b83){logger[_0x34b6('0x2a')](_0x34b6('0x2b'),_0x34b6('0x20'),util[_0x34b6('0x21')](_0x34b6('0x2c'),_0x2709cc['id'],_0x1cc619[_0x34b6('0x1f')]));if(_0x196b83[_0x34b6('0xa')][_0x34b6('0x2d')]&&_0x196b83['body'][_0x34b6('0x2d')]!=_0x2709cc[_0x34b6('0x24')][_0x34b6('0x2d')]){return _0x20bf26['OpenchannelInteraction'][_0x34b6('0x14')]({'threadId':_0x196b83[_0x34b6('0xa')][_0x34b6('0x2d')]},{'where':{'id':_0x2709cc[_0x34b6('0x24')]['id']}});}else{return;}})[_0x34b6('0x1e')](function(){return _0x4e7dea[_0x34b6('0x14')]({'read':!![]});})[_0x34b6('0x16')](function(_0x46ae2b){logger[_0x34b6('0x2e')]('OpenchannelMessage,\x20%s,\x20%s',_0x34b6('0x20'),util[_0x34b6('0x2f')](_0x46ae2b,{'showHidden':![],'depth':null}));_0x243a15();});}else{_0x243a15();}})['finally'](function(){_0x243a15();});}else{_0x243a15();}}},'charset':_0x34b6('0x30'),'collate':_0x34b6('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index f9c5cf0..6c7697b 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x24193d,_0x308c8e){var _0x17f567=function(_0x4dd05c){while(--_0x4dd05c){_0x24193d['push'](_0x24193d['shift']());}};_0x17f567(++_0x308c8e);}(_0x7a54,0x106));var _0x47a5=function(_0x424f27,_0x1cccda){_0x424f27=_0x424f27-0x0;var _0x45496b=_0x7a54[_0x424f27];return _0x45496b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1d7afc,_0xaab7ed){var _0x136b80=function(_0x331c8c){while(--_0x331c8c){_0x1d7afc['push'](_0x1d7afc['shift']());}};_0x136b80(++_0xaab7ed);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27714d,_0x457b53){_0x27714d=_0x27714d-0x0;var _0x18e2fb=_0x0b0e[_0x27714d];return _0x18e2fb;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a5f5d1a..e44fcb2 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 _0xd217=['remove','emit','removeListener','register','length','openchannelMessage:','save'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xd217,0x141));var _0x7d21=function(_0x1a2d8d,_0x326bd3){_0x1a2d8d=_0x1a2d8d-0x0;var _0x2d7e38=_0xd217[_0x1a2d8d];return _0x2d7e38;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x7d21('0x0'),_0x7d21('0x1'),'update'];function createListener(_0x23e727,_0x25a71a){return function(_0x1b31a3){_0x25a71a[_0x7d21('0x2')](_0x23e727,_0x1b31a3);};}function removeListener(_0x17825a,_0x42d0c3){return function(){OpenchannelMessageEvents[_0x7d21('0x3')](_0x17825a,_0x42d0c3);};}exports[_0x7d21('0x4')]=function(_0x57cb65){for(var _0x4da4fd=0x0,_0x7e122f=events[_0x7d21('0x5')];_0x4da4fd<_0x7e122f;_0x4da4fd++){var _0x199f6d=events[_0x4da4fd];var _0x4406e9=createListener(_0x7d21('0x6')+_0x199f6d,_0x57cb65);OpenchannelMessageEvents['on'](_0x199f6d,_0x4406e9);}}; \ No newline at end of file +var _0xf722=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf722,0x18f));var _0x2f72=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf722[_0x5b644e];return _0x49c6bf;};'use strict';var OpenchannelMessageEvents=require(_0x2f72('0x0'));var events=[_0x2f72('0x1'),_0x2f72('0x2'),_0x2f72('0x3')];function createListener(_0x5e6b94,_0x23d53e){return function(_0x297070){_0x23d53e[_0x2f72('0x4')](_0x5e6b94,_0x297070);};}function removeListener(_0x418aed,_0x47d759){return function(){OpenchannelMessageEvents[_0x2f72('0x5')](_0x418aed,_0x47d759);};}exports[_0x2f72('0x6')]=function(_0x334168){for(var _0x537e3d=0x0,_0x4d4cf4=events[_0x2f72('0x7')];_0x537e3d<_0x4d4cf4;_0x537e3d++){var _0x3cb15e=events[_0x537e3d];var _0x1f3afb=createListener(_0x2f72('0x8')+_0x3cb15e,_0x334168);OpenchannelMessageEvents['on'](_0x3cb15e,_0x1f3afb);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 25aa058..397c07b 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 _0xefbb=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','/:id','show'];(function(_0x1f5f56,_0x1429df){var _0x3cc9c2=function(_0x3d0f2c){while(--_0x3d0f2c){_0x1f5f56['push'](_0x1f5f56['shift']());}};_0x3cc9c2(++_0x1429df);}(_0xefbb,0xd5));var _0xbefb=function(_0x250939,_0x1b9bb1){_0x250939=_0x250939-0x0;var _0x3ca941=_0xefbb[_0x250939];return _0x3ca941;};'use strict';var multer=require(_0xbefb('0x0'));var util=require('util');var path=require(_0xbefb('0x1'));var timeout=require('connect-timeout');var express=require(_0xbefb('0x2'));var router=express['Router']();var fs_extra=require(_0xbefb('0x3'));var auth=require(_0xbefb('0x4'));var interaction=require(_0xbefb('0x5'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbefb('0x6')]);router[_0xbefb('0x7')]('/describe',auth[_0xbefb('0x8')](),controller[_0xbefb('0x9')]);router[_0xbefb('0x7')](_0xbefb('0xa'),auth[_0xbefb('0x8')](),controller[_0xbefb('0xb')]);router[_0xbefb('0x7')](_0xbefb('0xc'),auth[_0xbefb('0x8')](),controller[_0xbefb('0xd')]);router[_0xbefb('0x7')](_0xbefb('0xe'),auth[_0xbefb('0x8')](),controller[_0xbefb('0xf')]);router[_0xbefb('0x7')](_0xbefb('0x10'),auth[_0xbefb('0x8')](),controller[_0xbefb('0x11')]);router[_0xbefb('0x12')]('/',auth[_0xbefb('0x8')](),controller[_0xbefb('0x13')]);router['post']('/:id/teams',auth[_0xbefb('0x8')](),controller['addTeams']);router[_0xbefb('0x12')](_0xbefb('0x10'),auth[_0xbefb('0x8')](),controller[_0xbefb('0x14')]);router[_0xbefb('0x15')](_0xbefb('0xa'),auth[_0xbefb('0x8')](),controller[_0xbefb('0x16')]);router[_0xbefb('0x17')]('/:id',auth[_0xbefb('0x8')](),controller['destroy']);router['delete'](_0xbefb('0xe'),auth[_0xbefb('0x8')](),controller['removeTeams']);router[_0xbefb('0x17')]('/:id/users',auth[_0xbefb('0x8')](),controller['removeAgents']);module[_0xbefb('0x18')]=router; \ No newline at end of file +var _0x8477=['/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','get','describe','/:id','show'];(function(_0x594e7a,_0x5455af){var _0x14369d=function(_0x3f4e84){while(--_0x3f4e84){_0x594e7a['push'](_0x594e7a['shift']());}};_0x14369d(++_0x5455af);}(_0x8477,0x112));var _0x7847=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x8477[_0x1347f8];return _0x218368;};'use strict';var multer=require(_0x7847('0x0'));var util=require(_0x7847('0x1'));var path=require('path');var timeout=require(_0x7847('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7847('0x3'));var auth=require(_0x7847('0x4'));var interaction=require(_0x7847('0x5'));var config=require('../../config/environment');var controller=require(_0x7847('0x6'));router['get']('/',auth[_0x7847('0x7')](),controller['index']);router[_0x7847('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7847('0x9')]);router[_0x7847('0x8')](_0x7847('0xa'),auth[_0x7847('0x7')](),controller[_0x7847('0xb')]);router[_0x7847('0x8')](_0x7847('0xc'),auth[_0x7847('0x7')](),controller[_0x7847('0xd')]);router[_0x7847('0x8')](_0x7847('0xe'),auth[_0x7847('0x7')](),controller['getTeams']);router[_0x7847('0x8')](_0x7847('0xf'),auth[_0x7847('0x7')](),controller[_0x7847('0x10')]);router[_0x7847('0x11')]('/',auth[_0x7847('0x7')](),controller['create']);router[_0x7847('0x11')](_0x7847('0xe'),auth[_0x7847('0x7')](),controller[_0x7847('0x12')]);router[_0x7847('0x11')]('/:id/users',auth[_0x7847('0x7')](),controller[_0x7847('0x13')]);router[_0x7847('0x14')]('/:id',auth[_0x7847('0x7')](),controller[_0x7847('0x15')]);router[_0x7847('0x16')](_0x7847('0xa'),auth[_0x7847('0x7')](),controller[_0x7847('0x17')]);router[_0x7847('0x16')]('/:id/teams',auth[_0x7847('0x7')](),controller[_0x7847('0x18')]);router['delete'](_0x7847('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7847('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 0224158..3461570 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 _0xd22e=['beepall','sequelize','exports','name','INTEGER','rrmemory'];(function(_0x5459f2,_0x23a7c4){var _0xe906c6=function(_0x1f94ae){while(--_0x1f94ae){_0x5459f2['push'](_0x5459f2['shift']());}};_0xe906c6(++_0x23a7c4);}(_0xd22e,0x1d5));var _0xed22=function(_0x3cd54d,_0x3755a4){_0x3cd54d=_0x3cd54d-0x0;var _0x469017=_0xd22e[_0x3cd54d];return _0x469017;};'use strict';var Sequelize=require(_0xed22('0x0'));module[_0xed22('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xed22('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xed22('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xed22('0x4'),_0xed22('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x5640=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0xe94a2c,_0x4e7fce){var _0x167d75=function(_0x2a4211){while(--_0x2a4211){_0xe94a2c['push'](_0xe94a2c['shift']());}};_0x167d75(++_0x4e7fce);}(_0x5640,0x67));var _0x0564=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5640[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x0564('0x0'));module[_0x0564('0x1')]={'name':{'type':Sequelize[_0x0564('0x2')],'unique':_0x0564('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0564('0x2')]},'timeout':{'type':Sequelize[_0x0564('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0564('0x5')](_0x0564('0x6'),_0x0564('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 2cc763d..dd47855 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 _0x9531=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','map','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OpenchannelQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','updatedAt','format','%s/%s','getTeams','nolimit','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','findAll','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents'];(function(_0x62a56f,_0x4cedeb){var _0x156be0=function(_0x1bd40f){while(--_0x1bd40f){_0x62a56f['push'](_0x62a56f['shift']());}};_0x156be0(++_0x4cedeb);}(_0x9531,0x8c));var _0x1953=function(_0x28f757,_0x3dbe9e){_0x28f757=_0x28f757-0x0;var _0x294d90=_0x9531[_0x28f757];return _0x294d90;};'use strict';var emlformat=require(_0x1953('0x0'));var rimraf=require(_0x1953('0x1'));var zipdir=require(_0x1953('0x2'));var jsonpatch=require(_0x1953('0x3'));var rp=require(_0x1953('0x4'));var moment=require(_0x1953('0x5'));var BPromise=require(_0x1953('0x6'));var Mustache=require(_0x1953('0x7'));var util=require(_0x1953('0x8'));var path=require(_0x1953('0x9'));var sox=require(_0x1953('0xa'));var csv=require(_0x1953('0xb'));var ejs=require(_0x1953('0xc'));var fs=require('fs');var fs_extra=require(_0x1953('0xd'));var _=require(_0x1953('0xe'));var squel=require('squel');var crypto=require(_0x1953('0xf'));var jsforce=require(_0x1953('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1953('0xb'));var querystring=require(_0x1953('0x11'));var Papa=require(_0x1953('0x12'));var Redis=require(_0x1953('0x13'));var authService=require(_0x1953('0x14'));var qs=require(_0x1953('0x15'));var as=require(_0x1953('0x16'));var hardwareService=require(_0x1953('0x17'));var logger=require(_0x1953('0x18'))(_0x1953('0x19'));var utils=require(_0x1953('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1953('0x1b'))['db'];config[_0x1953('0x1c')]=_[_0x1953('0x1d')](config['redis'],{'host':_0x1953('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1953('0x1c')]));require(_0x1953('0x1f'))['register'](socket);function respondWithStatusCode(_0x1bc47e,_0x2335d2){_0x2335d2=_0x2335d2||0xcc;return function(_0x54f692){if(_0x54f692){return _0x1bc47e[_0x1953('0x20')](_0x2335d2);}return _0x1bc47e[_0x1953('0x21')](_0x2335d2)['end']();};}function respondWithResult(_0x37366d,_0x2f6e1b){_0x2f6e1b=_0x2f6e1b||0xc8;return function(_0x4ce9ba){if(_0x4ce9ba){return _0x37366d[_0x1953('0x21')](_0x2f6e1b)['json'](_0x4ce9ba);}};}function respondWithFilteredResult(_0xa5b4c4,_0x545f94){return function(_0x1b5fd0){if(_0x1b5fd0){var _0x2c4519=typeof _0x545f94[_0x1953('0x22')]===_0x1953('0x23')&&typeof _0x545f94[_0x1953('0x24')]===_0x1953('0x23');var _0x454f7a=_0x1b5fd0[_0x1953('0x25')];var _0x543660=_0x2c4519?0x0:_0x545f94[_0x1953('0x22')];var _0x3b9835=_0x2c4519?_0x1b5fd0[_0x1953('0x25')]:_0x545f94[_0x1953('0x22')]+_0x545f94[_0x1953('0x24')];var _0x57b46a;if(_0x3b9835>=_0x454f7a){_0x3b9835=_0x454f7a;_0x57b46a=0xc8;}else{_0x57b46a=0xce;}_0xa5b4c4[_0x1953('0x21')](_0x57b46a);return _0xa5b4c4[_0x1953('0x26')](_0x1953('0x27'),_0x543660+'-'+_0x3b9835+'/'+_0x454f7a)['json'](_0x1b5fd0);}return null;};}function patchUpdates(_0x55b55d){return function(_0x47734f){try{jsonpatch['apply'](_0x47734f,_0x55b55d,!![]);}catch(_0x39e358){return BPromise[_0x1953('0x28')](_0x39e358);}return _0x47734f[_0x1953('0x29')]();};}function saveUpdates(_0x3868c6,_0x2e5874){return function(_0x56ed6d){if(_0x56ed6d){return _0x56ed6d[_0x1953('0x2a')](_0x3868c6)[_0x1953('0x2b')](function(_0x25d430){return _0x25d430;});}return null;};}function removeEntity(_0x5c99a1,_0x111060){return function(_0x5ded62){if(_0x5ded62){return _0x5ded62[_0x1953('0x2c')]()[_0x1953('0x2b')](function(){var _0x3a6209=_0x5ded62[_0x1953('0x2d')]({'plain':!![]});var _0x127e0e='OpenchannelQueues';return db[_0x1953('0x2e')][_0x1953('0x2c')]({'where':{'type':_0x127e0e,'resourceId':_0x3a6209['id']}})[_0x1953('0x2b')](function(){return _0x5ded62;});})[_0x1953('0x2b')](function(){_0x5c99a1[_0x1953('0x21')](0xcc)[_0x1953('0x2f')]();});}};}function handleEntityNotFound(_0x489f52,_0x27f7bd){return function(_0x2b8ca4){if(!_0x2b8ca4){_0x489f52[_0x1953('0x20')](0x194);}return _0x2b8ca4;};}function handleError(_0x5f1d73,_0xde4bba){_0xde4bba=_0xde4bba||0x1f4;return function(_0x4aab5a){logger[_0x1953('0x30')](_0x4aab5a[_0x1953('0x31')]);if(_0x4aab5a[_0x1953('0x32')]){delete _0x4aab5a[_0x1953('0x32')];}_0x5f1d73[_0x1953('0x21')](_0xde4bba)[_0x1953('0x33')](_0x4aab5a);};}exports[_0x1953('0x34')]=function(_0x2d6d6e,_0x37a8a7){var _0x418b0a={},_0x5b024e={},_0x120919={'count':0x0,'rows':[]};var _0x24c2ad=_['map'](db[_0x1953('0x35')][_0x1953('0x36')],function(_0x3e4c63){return{'name':_0x3e4c63[_0x1953('0x37')],'type':_0x3e4c63[_0x1953('0x38')]['key']};});_0x5b024e['model']=_[_0x1953('0x39')](_0x24c2ad,_0x1953('0x32'));_0x5b024e['query']=_[_0x1953('0x3a')](_0x2d6d6e[_0x1953('0x3b')]);_0x5b024e[_0x1953('0x3c')]=_[_0x1953('0x3d')](_0x5b024e['model'],_0x5b024e[_0x1953('0x3b')]);_0x418b0a[_0x1953('0x3e')]=_['intersection'](_0x5b024e[_0x1953('0x3f')],qs[_0x1953('0x40')](_0x2d6d6e['query'][_0x1953('0x40')]));_0x418b0a[_0x1953('0x3e')]=_0x418b0a[_0x1953('0x3e')][_0x1953('0x41')]?_0x418b0a[_0x1953('0x3e')]:_0x5b024e[_0x1953('0x3f')];if(!_0x2d6d6e[_0x1953('0x3b')][_0x1953('0x42')]('nolimit')){_0x418b0a[_0x1953('0x24')]=qs[_0x1953('0x24')](_0x2d6d6e['query'][_0x1953('0x24')]);_0x418b0a['offset']=qs[_0x1953('0x22')](_0x2d6d6e[_0x1953('0x3b')]['offset']);}_0x418b0a[_0x1953('0x43')]=qs['sort'](_0x2d6d6e[_0x1953('0x3b')][_0x1953('0x44')]);_0x418b0a[_0x1953('0x45')]=qs[_0x1953('0x3c')](_[_0x1953('0x46')](_0x2d6d6e[_0x1953('0x3b')],_0x5b024e['filters']),_0x24c2ad);if(_0x2d6d6e[_0x1953('0x3b')][_0x1953('0x47')]){_0x418b0a['where']=_[_0x1953('0x48')](_0x418b0a[_0x1953('0x45')],{'$or':_[_0x1953('0x39')](_0x24c2ad,function(_0x26a883){if(_0x26a883[_0x1953('0x38')]!==_0x1953('0x49')){var _0x35e0cb={};_0x35e0cb[_0x26a883[_0x1953('0x32')]]={'$like':'%'+_0x2d6d6e[_0x1953('0x3b')][_0x1953('0x47')]+'%'};return _0x35e0cb;}})});}_0x418b0a=_[_0x1953('0x48')]({},_0x418b0a,_0x2d6d6e[_0x1953('0x4a')]);var _0x4b8ab3={'where':_0x418b0a[_0x1953('0x45')]};return db[_0x1953('0x35')][_0x1953('0x25')](_0x4b8ab3)[_0x1953('0x2b')](function(_0x1d180c){_0x120919[_0x1953('0x25')]=_0x1d180c;if(_0x2d6d6e[_0x1953('0x3b')][_0x1953('0x4b')]){_0x418b0a[_0x1953('0x4c')]=[{'all':!![]}];}return db[_0x1953('0x35')]['findAll'](_0x418b0a);})[_0x1953('0x2b')](function(_0x4b5a2f){_0x120919[_0x1953('0x4d')]=_0x4b5a2f;return _0x120919;})['then'](respondWithFilteredResult(_0x37a8a7,_0x418b0a))[_0x1953('0x4e')](handleError(_0x37a8a7,null));};exports[_0x1953('0x4f')]=function(_0x3df075,_0x567ec8){var _0x332592={'raw':!![],'where':{'id':_0x3df075[_0x1953('0x50')]['id']}},_0x8c1224={};_0x8c1224[_0x1953('0x3f')]=_[_0x1953('0x3a')](db[_0x1953('0x35')][_0x1953('0x36')]);_0x8c1224[_0x1953('0x3b')]=_[_0x1953('0x3a')](_0x3df075[_0x1953('0x3b')]);_0x8c1224['filters']=_[_0x1953('0x3d')](_0x8c1224['model'],_0x8c1224[_0x1953('0x3b')]);_0x332592[_0x1953('0x3e')]=_[_0x1953('0x3d')](_0x8c1224[_0x1953('0x3f')],qs[_0x1953('0x40')](_0x3df075['query'][_0x1953('0x40')]));_0x332592[_0x1953('0x3e')]=_0x332592['attributes'][_0x1953('0x41')]?_0x332592[_0x1953('0x3e')]:_0x8c1224[_0x1953('0x3f')];if(_0x3df075['query'][_0x1953('0x4b')]){_0x332592[_0x1953('0x4c')]=[{'all':!![]}];}_0x332592=_[_0x1953('0x48')]({},_0x332592,_0x3df075['options']);return db['OpenchannelQueue'][_0x1953('0x51')](_0x332592)[_0x1953('0x2b')](handleEntityNotFound(_0x567ec8,null))[_0x1953('0x2b')](respondWithResult(_0x567ec8,null))[_0x1953('0x4e')](handleError(_0x567ec8,null));};exports[_0x1953('0x52')]=function(_0x3fb7b4,_0x54e49f){return db[_0x1953('0x35')][_0x1953('0x52')](_0x3fb7b4[_0x1953('0x53')],{})['then'](function(_0x45e6cf){var _0x5087d2=_0x3fb7b4['user']['get']({'plain':!![]});if(!_0x5087d2)throw new Error(_0x1953('0x54'));if(_0x5087d2['role']===_0x1953('0x55')){var _0x580d4e=_0x45e6cf[_0x1953('0x2d')]({'plain':!![]});var _0x3645ad=_0x1953('0x56');return db[_0x1953('0x57')][_0x1953('0x51')]({'where':{'name':_0x3645ad,'userProfileId':_0x5087d2[_0x1953('0x58')]},'raw':!![]})[_0x1953('0x2b')](function(_0x21b5a5){if(_0x21b5a5&&_0x21b5a5['autoAssociation']===0x0){return db[_0x1953('0x2e')][_0x1953('0x52')]({'name':_0x580d4e[_0x1953('0x32')],'resourceId':_0x580d4e['id'],'type':_0x21b5a5['name'],'sectionId':_0x21b5a5['id']},{})['then'](function(){return _0x45e6cf;});}else{return _0x45e6cf;}})['catch'](function(_0x275732){logger[_0x1953('0x30')](_0x1953('0x59'),_0x275732);throw _0x275732;});}return _0x45e6cf;})[_0x1953('0x2b')](respondWithResult(_0x54e49f,0xc9))[_0x1953('0x4e')](handleError(_0x54e49f,null));};exports['update']=function(_0x508afa,_0x85b5e8){if(_0x508afa[_0x1953('0x53')]['id']){delete _0x508afa[_0x1953('0x53')]['id'];}return db['OpenchannelQueue'][_0x1953('0x51')]({'where':{'id':_0x508afa[_0x1953('0x50')]['id']}})[_0x1953('0x2b')](handleEntityNotFound(_0x85b5e8,null))['then'](saveUpdates(_0x508afa[_0x1953('0x53')],null))[_0x1953('0x2b')](respondWithResult(_0x85b5e8,null))['catch'](handleError(_0x85b5e8,null));};exports[_0x1953('0x2c')]=function(_0x130091,_0x202548){return db[_0x1953('0x35')][_0x1953('0x51')]({'where':{'id':_0x130091[_0x1953('0x50')]['id']}})['then'](handleEntityNotFound(_0x202548,null))['then'](removeEntity(_0x202548,null))['catch'](handleError(_0x202548,null));};exports[_0x1953('0x5a')]=function(_0x169a88,_0x158a5d){return db[_0x1953('0x35')][_0x1953('0x5a')]()[_0x1953('0x2b')](respondWithResult(_0x158a5d,null))[_0x1953('0x4e')](handleError(_0x158a5d,null));};exports['getMembers']=function(_0x3a5db7,_0x461e6f,_0x555ba6){var _0x1e19d2={'raw':!![],'where':{}},_0x3423bc={},_0x39e7b3;return db[_0x1953('0x35')][_0x1953('0x5b')]({'where':{'id':_0x3a5db7['params']['id']}})[_0x1953('0x2b')](handleEntityNotFound(_0x461e6f,null))['then'](function(_0x14a3ef){if(_0x14a3ef){_0x39e7b3=_0x14a3ef['get']({'plain':!![]});_0x3423bc[_0x1953('0x3f')]=_[_0x1953('0x3a')](db[_0x1953('0x5c')][_0x1953('0x36')]);_0x3423bc[_0x1953('0x3b')]=_['keys'](_0x3a5db7[_0x1953('0x3b')]);_0x3423bc[_0x1953('0x3c')]=_[_0x1953('0x3d')](_0x3423bc[_0x1953('0x3f')],_0x3423bc['query']);_0x1e19d2[_0x1953('0x3e')]=_[_0x1953('0x3d')](_0x3423bc[_0x1953('0x3f')],qs['fields'](_0x3a5db7[_0x1953('0x3b')][_0x1953('0x40')]));_0x1e19d2[_0x1953('0x3e')]=_0x1e19d2['attributes'][_0x1953('0x41')]?_0x1e19d2[_0x1953('0x3e')]:_0x3423bc[_0x1953('0x3f')];if(!_0x3a5db7[_0x1953('0x3b')][_0x1953('0x42')]('nolimit')){_0x1e19d2[_0x1953('0x24')]=qs[_0x1953('0x24')](_0x3a5db7[_0x1953('0x3b')][_0x1953('0x24')]);_0x1e19d2['offset']=qs[_0x1953('0x22')](_0x3a5db7[_0x1953('0x3b')][_0x1953('0x22')]);}_0x1e19d2[_0x1953('0x43')]=qs[_0x1953('0x44')](_0x3a5db7[_0x1953('0x3b')][_0x1953('0x44')]);_0x1e19d2['where']=qs[_0x1953('0x3c')](_[_0x1953('0x46')](_0x3a5db7[_0x1953('0x3b')],_0x3423bc[_0x1953('0x3c')]));_0x1e19d2[_0x1953('0x45')][_0x1953('0x5d')]=_0x14a3ef['id'];if(_0x3a5db7['query'][_0x1953('0x47')]){_0x1e19d2[_0x1953('0x45')]=_[_0x1953('0x48')](_0x1e19d2[_0x1953('0x45')],{'$or':_['map'](_0x1e19d2['attributes'],function(_0x424daf){var _0x4f2fd1={};_0x4f2fd1[_0x424daf]={'$like':'%'+_0x3a5db7[_0x1953('0x3b')][_0x1953('0x47')]+'%'};return _0x4f2fd1;})});}_0x1e19d2=_[_0x1953('0x48')]({},_0x1e19d2,_0x3a5db7[_0x1953('0x4a')]);return db['UserOpenchannelQueue']['findAll'](_0x1e19d2);}})[_0x1953('0x2b')](function(_0xe7b357){if(_0xe7b357){return db[_0x1953('0x5e')][_0x1953('0x5f')]({'where':{'id':_[_0x1953('0x39')](_0xe7b357,'UserId'),'role':_0x1953('0x60')},'attributes':['id',_0x1953('0x32'),'openchannelPause',_0x1953('0x61'),'createdAt']});}})['then'](function(_0x5d0c7e){if(_0x5d0c7e){return{'count':_0x5d0c7e[_0x1953('0x25')],'rows':_['map'](_0x5d0c7e[_0x1953('0x4d')],function(_0x281d4c){return{'membername':_0x281d4c[_0x1953('0x32')],'UserId':_0x281d4c['id'],'queue_name':_0x39e7b3[_0x1953('0x32')],'OpenchannelQueueId':_0x39e7b3['id'],'interface':util[_0x1953('0x62')](_0x1953('0x63'),'SIP',_0x281d4c['name']),'penalty':0x0,'paused':_0x281d4c['openchannelPause'],'createdAt':_0x281d4c['createdAt'],'updatedAt':_0x281d4c[_0x1953('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1953('0x2b')](respondWithFilteredResult(_0x461e6f,_0x1e19d2))[_0x1953('0x4e')](handleError(_0x461e6f,null));};exports[_0x1953('0x64')]=function(_0xcbc8eb,_0x2288c8,_0x1465a1){var _0x12eeda={};var _0x3eaefe={};var _0x54a155;var _0xb2fa4a;return db[_0x1953('0x35')][_0x1953('0x5b')]({'where':{'id':_0xcbc8eb['params']['id']}})['then'](handleEntityNotFound(_0x2288c8,null))[_0x1953('0x2b')](function(_0x804e2){if(_0x804e2){_0x54a155=_0x804e2;_0x3eaefe['model']=_['keys'](db['Team']['rawAttributes']);_0x3eaefe['query']=_[_0x1953('0x3a')](_0xcbc8eb[_0x1953('0x3b')]);_0x3eaefe['filters']=_[_0x1953('0x3d')](_0x3eaefe[_0x1953('0x3f')],_0x3eaefe[_0x1953('0x3b')]);_0x12eeda[_0x1953('0x3e')]=_[_0x1953('0x3d')](_0x3eaefe[_0x1953('0x3f')],qs[_0x1953('0x40')](_0xcbc8eb[_0x1953('0x3b')][_0x1953('0x40')]));_0x12eeda['attributes']=_0x12eeda[_0x1953('0x3e')]['length']?_0x12eeda[_0x1953('0x3e')]:_0x3eaefe['model'];_0x12eeda[_0x1953('0x43')]=qs[_0x1953('0x44')](_0xcbc8eb['query'][_0x1953('0x44')]);_0x12eeda[_0x1953('0x45')]=qs[_0x1953('0x3c')](_[_0x1953('0x46')](_0xcbc8eb['query'],_0x3eaefe['filters']));if(_0xcbc8eb[_0x1953('0x3b')][_0x1953('0x47')]){_0x12eeda[_0x1953('0x45')]=_[_0x1953('0x48')](_0x12eeda[_0x1953('0x45')],{'$or':_['map'](_0x12eeda[_0x1953('0x3e')],function(_0x44193b){var _0x5d5c0a={};_0x5d5c0a[_0x44193b]={'$like':'%'+_0xcbc8eb[_0x1953('0x3b')][_0x1953('0x47')]+'%'};return _0x5d5c0a;})});}_0x12eeda=_[_0x1953('0x48')]({},_0x12eeda,_0xcbc8eb[_0x1953('0x4a')]);return _0x54a155[_0x1953('0x64')](_0x12eeda);}})[_0x1953('0x2b')](function(_0x4f04d0){if(_0x4f04d0){_0xb2fa4a=_0x4f04d0[_0x1953('0x41')];if(!_0xcbc8eb['query'][_0x1953('0x42')](_0x1953('0x65'))){_0x12eeda[_0x1953('0x24')]=qs[_0x1953('0x24')](_0xcbc8eb[_0x1953('0x3b')]['limit']);_0x12eeda[_0x1953('0x22')]=qs[_0x1953('0x22')](_0xcbc8eb[_0x1953('0x3b')][_0x1953('0x22')]);}return _0x54a155['getTeams'](_0x12eeda);}})[_0x1953('0x2b')](function(_0x1132e3){if(_0x1132e3){return _0x1132e3?{'count':_0xb2fa4a,'rows':_0x1132e3}:null;}})[_0x1953('0x2b')](respondWithResult(_0x2288c8,null))[_0x1953('0x4e')](handleError(_0x2288c8,null));};exports['addTeams']=function(_0x6a688,_0x477255,_0xdb3a13){var _0x4cf6bc=_0x6a688[_0x1953('0x53')]['ids'];return db[_0x1953('0x66')]['findAll']({'where':{'id':_0x4cf6bc},'attributes':['id'],'include':[{'model':db[_0x1953('0x5e')],'as':_0x1953('0x67'),'attributes':['id',_0x1953('0x32'),_0x1953('0x68'),_0x1953('0x69'),_0x1953('0x6a')],'raw':!![]}]})[_0x1953('0x2b')](function(_0x5447bd){if(_0x5447bd){var _0x7c08dd=_[_0x1953('0x6b')](_0x5447bd,function(_0x40c6c7){var _0x3ca0b8=_0x40c6c7[_0x1953('0x2d')]({'plain':!![]});return _0x3ca0b8[_0x1953('0x67')];});return db[_0x1953('0x35')][_0x1953('0x51')]({'where':{'id':_0x6a688[_0x1953('0x50')]['id']}})['then'](function(_0x152b23){return db[_0x1953('0x6c')][_0x1953('0x6d')](function(_0x5af649){return _0x152b23['addTeams'](_0x4cf6bc,{'transaction':_0x5af649})[_0x1953('0x2b')](function(){return BPromise['each'](_0x7c08dd,function(_0x18c57c){return db[_0x1953('0x5c')]['findOrCreate']({'where':{'UserId':_0x18c57c['id'],'OpenchannelQueueId':_0x6a688[_0x1953('0x50')]['id']},'transaction':_0x5af649});});})[_0x1953('0x2b')](function(){_0x7c08dd[_0x1953('0x6e')](function(_0x1036f2){socket[_0x1953('0x6f')](_0x1953('0x70'),{'UserId':_0x1036f2['id'],'OpenchannelQueueId':_0x152b23['id']});});});});});}})['then'](respondWithStatusCode(_0x477255,null))['catch'](handleError(_0x477255,null));};exports[_0x1953('0x71')]=function(_0x2e76a0,_0x23a2d4,_0x4c6426){return db[_0x1953('0x66')][_0x1953('0x72')]({'where':{'id':_0x2e76a0[_0x1953('0x3b')][_0x1953('0x73')]},'attributes':['id'],'include':[{'model':db[_0x1953('0x5e')],'as':_0x1953('0x67'),'attributes':['id'],'raw':!![]}]})[_0x1953('0x2b')](handleEntityNotFound(_0x23a2d4,null))[_0x1953('0x2b')](function(_0x240c30){var _0x103cb6=_[_0x1953('0x39')](_0x240c30,'id');var _0x27932a=[];var _0x52a0f3=[];var _0x585fdc=squel[_0x1953('0x74')]();_0x585fdc[_0x1953('0x75')](_0x1953('0x76'))[_0x1953('0x77')](_0x1953('0x78'),'tq')['join'](_0x1953('0x79'),'ut',_0x1953('0x7a'))['where']('OpenchannelQueueId\x20=\x20?',_0x2e76a0[_0x1953('0x50')]['id']);for(var _0x3e6665=0x0;_0x3e6665<_0x240c30[_0x1953('0x41')];_0x3e6665+=0x1){let _0x3434d5=_0x240c30[_0x3e6665];for(var _0x10134a=0x0;_0x10134a<_0x3434d5[_0x1953('0x67')][_0x1953('0x41')];_0x10134a+=0x1){let _0x3942a7=_0x3434d5[_0x1953('0x67')][_0x10134a];var _0x101be9=_0x585fdc[_0x1953('0x7b')]();_0x101be9['where'](_0x1953('0x7c'),_0x3942a7['id']);_0x52a0f3['push'](db['sequelize'][_0x1953('0x3b')](_0x101be9[_0x1953('0x7d')](),{'type':db[_0x1953('0x6c')][_0x1953('0x7e')][_0x1953('0x7f')]})[_0x1953('0x2b')](function(_0x2e29a5){if(_0x2e29a5[_0x1953('0x41')]===0x1){return _0x3942a7['id'];}else{var _0x2d13ea=_[_0x1953('0x80')](_[_0x1953('0x39')](_0x2e29a5,_0x1953('0x81')),function(_0x4d7277){return _[_0x1953('0x82')](_0x103cb6,_0x4d7277);});if(_0x2d13ea){return _0x3942a7['id'];}}}));}}return BPromise[_0x1953('0x83')](_0x52a0f3)[_0x1953('0x2b')](function(_0x4e6716){_0x27932a=_(_0x27932a)[_0x1953('0x84')](_0x4e6716)['compact']()[_0x1953('0x85')]();return db[_0x1953('0x35')][_0x1953('0x51')]({'where':{'id':_0x2e76a0[_0x1953('0x50')]['id']}})[_0x1953('0x2b')](function(_0x20b9f2){return db[_0x1953('0x6c')]['transaction'](function(_0x2636cd){return _0x20b9f2[_0x1953('0x71')](_0x2e76a0[_0x1953('0x3b')]['ids'],{'transaction':_0x2636cd})[_0x1953('0x2b')](function(){if(!_[_0x1953('0x86')](_0x27932a)){return _0x20b9f2[_0x1953('0x87')](_0x27932a,{'transaction':_0x2636cd});}})[_0x1953('0x2b')](function(){_0x27932a[_0x1953('0x6e')](function(_0x20d75a){socket[_0x1953('0x6f')](_0x1953('0x88'),{'UserId':_0x20d75a,'OpenchannelQueueId':_0x20b9f2['id']});});});});});});})[_0x1953('0x2b')](respondWithStatusCode(_0x23a2d4,null))[_0x1953('0x4e')](handleError(_0x23a2d4,null));};exports[_0x1953('0x89')]=function(_0x336a24,_0x29b0df,_0x43c4b3){return db[_0x1953('0x35')][_0x1953('0x51')]({'where':{'id':_0x336a24[_0x1953('0x50')]['id']}})[_0x1953('0x2b')](handleEntityNotFound(_0x29b0df,null))['then'](function(_0x34b69a){if(_0x34b69a){return _0x34b69a[_0x1953('0x89')](_0x336a24[_0x1953('0x53')]['ids'],_['omit'](_0x336a24[_0x1953('0x53')],['ids','id'])||{})['spread'](function(_0x485c77){for(var _0x323e18=0x0;_0x323e18<_0x336a24[_0x1953('0x53')][_0x1953('0x73')][_0x1953('0x41')];_0x323e18+=0x1){socket[_0x1953('0x6f')](_0x1953('0x70'),{'UserId':Number(_0x336a24[_0x1953('0x53')][_0x1953('0x73')][_0x323e18]),'OpenchannelQueueId':Number(_0x336a24[_0x1953('0x50')]['id'])});}return _0x485c77;});}})['then'](respondWithResult(_0x29b0df,null))[_0x1953('0x4e')](handleError(_0x29b0df,null));};exports[_0x1953('0x87')]=function(_0x357b4f,_0x1dbc9b,_0x1b299a){return db[_0x1953('0x35')][_0x1953('0x51')]({'where':{'id':_0x357b4f[_0x1953('0x50')]['id']}})[_0x1953('0x2b')](handleEntityNotFound(_0x1dbc9b,null))[_0x1953('0x2b')](function(_0x3fba33){if(_0x3fba33){return _0x3fba33[_0x1953('0x87')](_0x357b4f[_0x1953('0x3b')][_0x1953('0x73')])['then'](function(){if(_[_0x1953('0x8a')](_0x357b4f[_0x1953('0x3b')][_0x1953('0x73')])){for(var _0x1395de=0x0;_0x1395de<_0x357b4f[_0x1953('0x3b')][_0x1953('0x73')][_0x1953('0x41')];_0x1395de+=0x1){socket[_0x1953('0x6f')](_0x1953('0x88'),{'UserId':Number(_0x357b4f['query'][_0x1953('0x73')][_0x1395de]),'OpenchannelQueueId':Number(_0x357b4f[_0x1953('0x50')]['id'])});}}else{socket['emit'](_0x1953('0x88'),{'UserId':Number(_0x357b4f['query'][_0x1953('0x73')]),'OpenchannelQueueId':Number(_0x357b4f[_0x1953('0x50')]['id'])});}});}})[_0x1953('0x2b')](respondWithStatusCode(_0x1dbc9b,null))['catch'](handleError(_0x1dbc9b,null));};exports[_0x1953('0x8b')]=function(_0x1fd771,_0x56796c,_0x2252fe){var _0xc6c224={};var _0x5c9477={};var _0x403814;var _0x282b34;return db[_0x1953('0x35')][_0x1953('0x5b')]({'where':{'id':_0x1fd771[_0x1953('0x50')]['id']}})['then'](handleEntityNotFound(_0x56796c,null))['then'](function(_0x42e20e){if(_0x42e20e){_0x403814=_0x42e20e;_0x5c9477[_0x1953('0x3f')]=_[_0x1953('0x3a')](db[_0x1953('0x5e')][_0x1953('0x36')]);_0x5c9477[_0x1953('0x3b')]=_[_0x1953('0x3a')](_0x1fd771[_0x1953('0x3b')]);_0x5c9477[_0x1953('0x3c')]=_[_0x1953('0x3d')](_0x5c9477['model'],_0x5c9477[_0x1953('0x3b')]);_0xc6c224[_0x1953('0x3e')]=_[_0x1953('0x3d')](_0x5c9477['model'],qs[_0x1953('0x40')](_0x1fd771[_0x1953('0x3b')]['fields']));_0xc6c224[_0x1953('0x3e')]=_0xc6c224[_0x1953('0x3e')]['length']?_0xc6c224[_0x1953('0x3e')]:_0x5c9477[_0x1953('0x3f')];_0xc6c224['order']=qs['sort'](_0x1fd771['query']['sort']);_0xc6c224[_0x1953('0x45')]=qs[_0x1953('0x3c')](_[_0x1953('0x46')](_0x1fd771['query'],_0x5c9477[_0x1953('0x3c')]));if(_0x1fd771[_0x1953('0x3b')][_0x1953('0x47')]){_0xc6c224['where']=_[_0x1953('0x48')](_0xc6c224['where'],{'$or':_[_0x1953('0x39')](_0xc6c224[_0x1953('0x3e')],function(_0x2a3575){var _0x32fe5b={};_0x32fe5b[_0x2a3575]={'$like':'%'+_0x1fd771[_0x1953('0x3b')][_0x1953('0x47')]+'%'};return _0x32fe5b;})});}_0xc6c224=_[_0x1953('0x48')]({},_0xc6c224,_0x1fd771['options']);return _0x403814['getAgents'](_0xc6c224);}})[_0x1953('0x2b')](function(_0x3170a7){if(_0x3170a7){_0x282b34=_0x3170a7[_0x1953('0x41')];if(!_0x1fd771[_0x1953('0x3b')][_0x1953('0x42')]('nolimit')){_0xc6c224[_0x1953('0x24')]=qs[_0x1953('0x24')](_0x1fd771[_0x1953('0x3b')][_0x1953('0x24')]);_0xc6c224[_0x1953('0x22')]=qs[_0x1953('0x22')](_0x1fd771['query']['offset']);}return _0x403814[_0x1953('0x8b')](_0xc6c224);}})[_0x1953('0x2b')](function(_0x161568){if(_0x161568){return _0x161568?{'count':_0x282b34,'rows':_0x161568}:null;}})[_0x1953('0x2b')](respondWithResult(_0x56796c,null))[_0x1953('0x4e')](handleError(_0x56796c,null));}; \ No newline at end of file +var _0x074d=['union','compact','removeTeams','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','findAndCountAll','map','agent','updatedAt','createdAt','format','SIP','openchannelPause','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all'];(function(_0x13f353,_0x101eda){var _0x139d67=function(_0x20eef1){while(--_0x20eef1){_0x13f353['push'](_0x13f353['shift']());}};_0x139d67(++_0x101eda);}(_0x074d,0x98));var _0xd074=function(_0x58698c,_0x3f9b82){_0x58698c=_0x58698c-0x0;var _0x23bc2f=_0x074d[_0x58698c];return _0x23bc2f;};'use strict';var emlformat=require(_0xd074('0x0'));var rimraf=require(_0xd074('0x1'));var zipdir=require(_0xd074('0x2'));var jsonpatch=require(_0xd074('0x3'));var rp=require(_0xd074('0x4'));var moment=require(_0xd074('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd074('0x6'));var path=require(_0xd074('0x7'));var sox=require(_0xd074('0x8'));var csv=require(_0xd074('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd074('0xa'));var crypto=require(_0xd074('0xb'));var jsforce=require(_0xd074('0xc'));var deskjs=require(_0xd074('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd074('0xe'));var Papa=require(_0xd074('0xf'));var Redis=require(_0xd074('0x10'));var authService=require(_0xd074('0x11'));var qs=require(_0xd074('0x12'));var as=require(_0xd074('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd074('0x14'))(_0xd074('0x15'));var utils=require(_0xd074('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd074('0x17'));var db=require(_0xd074('0x18'))['db'];config['redis']=_[_0xd074('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd074('0x1a'))(new Redis(config[_0xd074('0x1b')]));require(_0xd074('0x1c'))[_0xd074('0x1d')](socket);function respondWithStatusCode(_0x55fb63,_0x2ef095){_0x2ef095=_0x2ef095||0xcc;return function(_0x3cac19){if(_0x3cac19){return _0x55fb63[_0xd074('0x1e')](_0x2ef095);}return _0x55fb63[_0xd074('0x1f')](_0x2ef095)[_0xd074('0x20')]();};}function respondWithResult(_0xb0d3d1,_0x1c22ac){_0x1c22ac=_0x1c22ac||0xc8;return function(_0x3de38f){if(_0x3de38f){return _0xb0d3d1['status'](_0x1c22ac)[_0xd074('0x21')](_0x3de38f);}};}function respondWithFilteredResult(_0x415a27,_0x3bd762){return function(_0x11b8f4){if(_0x11b8f4){var _0xe90d6f=typeof _0x3bd762[_0xd074('0x22')]===_0xd074('0x23')&&typeof _0x3bd762[_0xd074('0x24')]===_0xd074('0x23');var _0xf418da=_0x11b8f4[_0xd074('0x25')];var _0x1d0fa8=_0xe90d6f?0x0:_0x3bd762[_0xd074('0x22')];var _0xf19209=_0xe90d6f?_0x11b8f4[_0xd074('0x25')]:_0x3bd762[_0xd074('0x22')]+_0x3bd762[_0xd074('0x24')];var _0x42a2ae;if(_0xf19209>=_0xf418da){_0xf19209=_0xf418da;_0x42a2ae=0xc8;}else{_0x42a2ae=0xce;}_0x415a27['status'](_0x42a2ae);return _0x415a27['set']('Content-Range',_0x1d0fa8+'-'+_0xf19209+'/'+_0xf418da)[_0xd074('0x21')](_0x11b8f4);}return null;};}function patchUpdates(_0x1278db){return function(_0x35f374){try{jsonpatch[_0xd074('0x26')](_0x35f374,_0x1278db,!![]);}catch(_0x42cd1d){return BPromise[_0xd074('0x27')](_0x42cd1d);}return _0x35f374[_0xd074('0x28')]();};}function saveUpdates(_0x2e9240,_0x11f423){return function(_0x2d456c){if(_0x2d456c){return _0x2d456c['update'](_0x2e9240)[_0xd074('0x29')](function(_0x484b18){return _0x484b18;});}return null;};}function removeEntity(_0x461552,_0x1d97f6){return function(_0x2200aa){if(_0x2200aa){return _0x2200aa[_0xd074('0x2a')]()[_0xd074('0x29')](function(){var _0x45f72f=_0x2200aa[_0xd074('0x2b')]({'plain':!![]});var _0x1f8f75=_0xd074('0x2c');return db[_0xd074('0x2d')][_0xd074('0x2a')]({'where':{'type':_0x1f8f75,'resourceId':_0x45f72f['id']}})[_0xd074('0x29')](function(){return _0x2200aa;});})[_0xd074('0x29')](function(){_0x461552[_0xd074('0x1f')](0xcc)[_0xd074('0x20')]();});}};}function handleEntityNotFound(_0x3cfc45,_0x53f671){return function(_0x2e39ab){if(!_0x2e39ab){_0x3cfc45['sendStatus'](0x194);}return _0x2e39ab;};}function handleError(_0x400b0d,_0x2c7f39){_0x2c7f39=_0x2c7f39||0x1f4;return function(_0xef45c){logger[_0xd074('0x2e')](_0xef45c['stack']);if(_0xef45c[_0xd074('0x2f')]){delete _0xef45c['name'];}_0x400b0d['status'](_0x2c7f39)['send'](_0xef45c);};}exports['index']=function(_0x17e02f,_0x6a55e2){var _0x351449={},_0xa9b140={},_0x1e25b9={'count':0x0,'rows':[]};var _0x597e5d=_['map'](db[_0xd074('0x30')][_0xd074('0x31')],function(_0x396c19){return{'name':_0x396c19[_0xd074('0x32')],'type':_0x396c19[_0xd074('0x33')][_0xd074('0x34')]};});_0xa9b140[_0xd074('0x35')]=_['map'](_0x597e5d,_0xd074('0x2f'));_0xa9b140[_0xd074('0x36')]=_['keys'](_0x17e02f[_0xd074('0x36')]);_0xa9b140[_0xd074('0x37')]=_[_0xd074('0x38')](_0xa9b140[_0xd074('0x35')],_0xa9b140[_0xd074('0x36')]);_0x351449[_0xd074('0x39')]=_['intersection'](_0xa9b140['model'],qs[_0xd074('0x3a')](_0x17e02f[_0xd074('0x36')][_0xd074('0x3a')]));_0x351449[_0xd074('0x39')]=_0x351449[_0xd074('0x39')][_0xd074('0x3b')]?_0x351449[_0xd074('0x39')]:_0xa9b140[_0xd074('0x35')];if(!_0x17e02f[_0xd074('0x36')][_0xd074('0x3c')]('nolimit')){_0x351449[_0xd074('0x24')]=qs[_0xd074('0x24')](_0x17e02f[_0xd074('0x36')][_0xd074('0x24')]);_0x351449[_0xd074('0x22')]=qs[_0xd074('0x22')](_0x17e02f[_0xd074('0x36')][_0xd074('0x22')]);}_0x351449['order']=qs[_0xd074('0x3d')](_0x17e02f[_0xd074('0x36')][_0xd074('0x3d')]);_0x351449[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0x17e02f['query'],_0xa9b140[_0xd074('0x37')]),_0x597e5d);if(_0x17e02f[_0xd074('0x36')][_0xd074('0x40')]){_0x351449[_0xd074('0x3e')]=_['merge'](_0x351449[_0xd074('0x3e')],{'$or':_['map'](_0x597e5d,function(_0x4d7be3){if(_0x4d7be3[_0xd074('0x33')]!==_0xd074('0x41')){var _0x485dad={};_0x485dad[_0x4d7be3['name']]={'$like':'%'+_0x17e02f[_0xd074('0x36')]['filter']+'%'};return _0x485dad;}})});}_0x351449=_[_0xd074('0x42')]({},_0x351449,_0x17e02f[_0xd074('0x43')]);var _0xb81f12={'where':_0x351449[_0xd074('0x3e')]};return db[_0xd074('0x30')][_0xd074('0x25')](_0xb81f12)['then'](function(_0x595eb8){_0x1e25b9[_0xd074('0x25')]=_0x595eb8;if(_0x17e02f[_0xd074('0x36')][_0xd074('0x44')]){_0x351449[_0xd074('0x45')]=[{'all':!![]}];}return db[_0xd074('0x30')][_0xd074('0x46')](_0x351449);})[_0xd074('0x29')](function(_0x4bcf3b){_0x1e25b9[_0xd074('0x47')]=_0x4bcf3b;return _0x1e25b9;})[_0xd074('0x29')](respondWithFilteredResult(_0x6a55e2,_0x351449))[_0xd074('0x48')](handleError(_0x6a55e2,null));};exports['show']=function(_0x50cf5c,_0x599d85){var _0x146a72={'raw':!![],'where':{'id':_0x50cf5c[_0xd074('0x49')]['id']}},_0x500617={};_0x500617[_0xd074('0x35')]=_[_0xd074('0x4a')](db[_0xd074('0x30')][_0xd074('0x31')]);_0x500617['query']=_[_0xd074('0x4a')](_0x50cf5c[_0xd074('0x36')]);_0x500617[_0xd074('0x37')]=_[_0xd074('0x38')](_0x500617[_0xd074('0x35')],_0x500617[_0xd074('0x36')]);_0x146a72[_0xd074('0x39')]=_[_0xd074('0x38')](_0x500617[_0xd074('0x35')],qs['fields'](_0x50cf5c[_0xd074('0x36')][_0xd074('0x3a')]));_0x146a72[_0xd074('0x39')]=_0x146a72[_0xd074('0x39')]['length']?_0x146a72[_0xd074('0x39')]:_0x500617[_0xd074('0x35')];if(_0x50cf5c[_0xd074('0x36')][_0xd074('0x44')]){_0x146a72[_0xd074('0x45')]=[{'all':!![]}];}_0x146a72=_[_0xd074('0x42')]({},_0x146a72,_0x50cf5c['options']);return db['OpenchannelQueue']['find'](_0x146a72)[_0xd074('0x29')](handleEntityNotFound(_0x599d85,null))['then'](respondWithResult(_0x599d85,null))['catch'](handleError(_0x599d85,null));};exports[_0xd074('0x4b')]=function(_0x4e5e32,_0x3389ec){return db['OpenchannelQueue']['create'](_0x4e5e32['body'],{})[_0xd074('0x29')](function(_0x10d690){var _0x331756=_0x4e5e32['user'][_0xd074('0x2b')]({'plain':!![]});if(!_0x331756)throw new Error(_0xd074('0x4c'));if(_0x331756[_0xd074('0x4d')]===_0xd074('0x4e')){var _0x11c291=_0x10d690[_0xd074('0x2b')]({'plain':!![]});var _0x2292e2=_0xd074('0x2c');return db[_0xd074('0x4f')]['find']({'where':{'name':_0x2292e2,'userProfileId':_0x331756[_0xd074('0x50')]},'raw':!![]})[_0xd074('0x29')](function(_0xfba178){if(_0xfba178&&_0xfba178['autoAssociation']===0x0){return db['UserProfileResource'][_0xd074('0x4b')]({'name':_0x11c291[_0xd074('0x2f')],'resourceId':_0x11c291['id'],'type':_0xfba178['name'],'sectionId':_0xfba178['id']},{})[_0xd074('0x29')](function(){return _0x10d690;});}else{return _0x10d690;}})[_0xd074('0x48')](function(_0x447c23){logger['error'](_0xd074('0x51'),_0x447c23);throw _0x447c23;});}return _0x10d690;})[_0xd074('0x29')](respondWithResult(_0x3389ec,0xc9))[_0xd074('0x48')](handleError(_0x3389ec,null));};exports[_0xd074('0x52')]=function(_0x2da027,_0x1cdac7){if(_0x2da027[_0xd074('0x53')]['id']){delete _0x2da027[_0xd074('0x53')]['id'];}return db['OpenchannelQueue'][_0xd074('0x54')]({'where':{'id':_0x2da027[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x1cdac7,null))[_0xd074('0x29')](saveUpdates(_0x2da027['body'],null))[_0xd074('0x29')](respondWithResult(_0x1cdac7,null))['catch'](handleError(_0x1cdac7,null));};exports[_0xd074('0x2a')]=function(_0x20fcc7,_0x459d2f){return db[_0xd074('0x30')][_0xd074('0x54')]({'where':{'id':_0x20fcc7['params']['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x459d2f,null))['then'](removeEntity(_0x459d2f,null))[_0xd074('0x48')](handleError(_0x459d2f,null));};exports[_0xd074('0x55')]=function(_0xdae92b,_0x613fcf){return db[_0xd074('0x30')][_0xd074('0x55')]()[_0xd074('0x29')](respondWithResult(_0x613fcf,null))[_0xd074('0x48')](handleError(_0x613fcf,null));};exports[_0xd074('0x56')]=function(_0xa33fe2,_0x5baa47,_0x48442d){var _0x4c46cf={'raw':!![],'where':{}},_0x217b43={},_0x592c73;return db[_0xd074('0x30')][_0xd074('0x57')]({'where':{'id':_0xa33fe2[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x5baa47,null))[_0xd074('0x29')](function(_0x1e7b8c){if(_0x1e7b8c){_0x592c73=_0x1e7b8c[_0xd074('0x2b')]({'plain':!![]});_0x217b43[_0xd074('0x35')]=_[_0xd074('0x4a')](db[_0xd074('0x58')]['rawAttributes']);_0x217b43[_0xd074('0x36')]=_[_0xd074('0x4a')](_0xa33fe2[_0xd074('0x36')]);_0x217b43[_0xd074('0x37')]=_[_0xd074('0x38')](_0x217b43['model'],_0x217b43[_0xd074('0x36')]);_0x4c46cf[_0xd074('0x39')]=_[_0xd074('0x38')](_0x217b43[_0xd074('0x35')],qs['fields'](_0xa33fe2['query'][_0xd074('0x3a')]));_0x4c46cf[_0xd074('0x39')]=_0x4c46cf['attributes']['length']?_0x4c46cf[_0xd074('0x39')]:_0x217b43['model'];if(!_0xa33fe2['query'][_0xd074('0x3c')](_0xd074('0x59'))){_0x4c46cf['limit']=qs[_0xd074('0x24')](_0xa33fe2[_0xd074('0x36')]['limit']);_0x4c46cf[_0xd074('0x22')]=qs[_0xd074('0x22')](_0xa33fe2['query']['offset']);}_0x4c46cf[_0xd074('0x5a')]=qs['sort'](_0xa33fe2[_0xd074('0x36')][_0xd074('0x3d')]);_0x4c46cf[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0xa33fe2['query'],_0x217b43[_0xd074('0x37')]));_0x4c46cf[_0xd074('0x3e')][_0xd074('0x5b')]=_0x1e7b8c['id'];if(_0xa33fe2[_0xd074('0x36')][_0xd074('0x40')]){_0x4c46cf[_0xd074('0x3e')]=_['merge'](_0x4c46cf[_0xd074('0x3e')],{'$or':_['map'](_0x4c46cf[_0xd074('0x39')],function(_0x3a9781){var _0x5b3e22={};_0x5b3e22[_0x3a9781]={'$like':'%'+_0xa33fe2[_0xd074('0x36')][_0xd074('0x40')]+'%'};return _0x5b3e22;})});}_0x4c46cf=_[_0xd074('0x42')]({},_0x4c46cf,_0xa33fe2['options']);return db[_0xd074('0x58')][_0xd074('0x46')](_0x4c46cf);}})[_0xd074('0x29')](function(_0x191057){if(_0x191057){return db['User'][_0xd074('0x5c')]({'where':{'id':_[_0xd074('0x5d')](_0x191057,'UserId'),'role':_0xd074('0x5e')},'attributes':['id','name','openchannelPause',_0xd074('0x5f'),_0xd074('0x60')]});}})['then'](function(_0x386ea5){if(_0x386ea5){return{'count':_0x386ea5[_0xd074('0x25')],'rows':_[_0xd074('0x5d')](_0x386ea5[_0xd074('0x47')],function(_0x4c1cf0){return{'membername':_0x4c1cf0[_0xd074('0x2f')],'UserId':_0x4c1cf0['id'],'queue_name':_0x592c73['name'],'OpenchannelQueueId':_0x592c73['id'],'interface':util[_0xd074('0x61')]('%s/%s',_0xd074('0x62'),_0x4c1cf0[_0xd074('0x2f')]),'penalty':0x0,'paused':_0x4c1cf0[_0xd074('0x63')],'createdAt':_0x4c1cf0[_0xd074('0x60')],'updatedAt':_0x4c1cf0[_0xd074('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5baa47,_0x4c46cf))['catch'](handleError(_0x5baa47,null));};exports[_0xd074('0x64')]=function(_0x341201,_0x26c57f,_0x3ec3c9){var _0x18b8cf={};var _0x2e7b5d={};var _0x593945;var _0x80b9f9;return db[_0xd074('0x30')]['findOne']({'where':{'id':_0x341201[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x26c57f,null))[_0xd074('0x29')](function(_0x3e87e1){if(_0x3e87e1){_0x593945=_0x3e87e1;_0x2e7b5d[_0xd074('0x35')]=_['keys'](db[_0xd074('0x65')]['rawAttributes']);_0x2e7b5d[_0xd074('0x36')]=_[_0xd074('0x4a')](_0x341201['query']);_0x2e7b5d[_0xd074('0x37')]=_[_0xd074('0x38')](_0x2e7b5d[_0xd074('0x35')],_0x2e7b5d[_0xd074('0x36')]);_0x18b8cf[_0xd074('0x39')]=_['intersection'](_0x2e7b5d[_0xd074('0x35')],qs[_0xd074('0x3a')](_0x341201['query']['fields']));_0x18b8cf[_0xd074('0x39')]=_0x18b8cf[_0xd074('0x39')]['length']?_0x18b8cf[_0xd074('0x39')]:_0x2e7b5d[_0xd074('0x35')];_0x18b8cf[_0xd074('0x5a')]=qs[_0xd074('0x3d')](_0x341201[_0xd074('0x36')]['sort']);_0x18b8cf[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0x341201[_0xd074('0x36')],_0x2e7b5d[_0xd074('0x37')]));if(_0x341201[_0xd074('0x36')][_0xd074('0x40')]){_0x18b8cf[_0xd074('0x3e')]=_[_0xd074('0x42')](_0x18b8cf[_0xd074('0x3e')],{'$or':_[_0xd074('0x5d')](_0x18b8cf['attributes'],function(_0x214b07){var _0x2de455={};_0x2de455[_0x214b07]={'$like':'%'+_0x341201[_0xd074('0x36')][_0xd074('0x40')]+'%'};return _0x2de455;})});}_0x18b8cf=_[_0xd074('0x42')]({},_0x18b8cf,_0x341201['options']);return _0x593945[_0xd074('0x64')](_0x18b8cf);}})[_0xd074('0x29')](function(_0x1f3c41){if(_0x1f3c41){_0x80b9f9=_0x1f3c41[_0xd074('0x3b')];if(!_0x341201[_0xd074('0x36')][_0xd074('0x3c')](_0xd074('0x59'))){_0x18b8cf[_0xd074('0x24')]=qs[_0xd074('0x24')](_0x341201[_0xd074('0x36')]['limit']);_0x18b8cf[_0xd074('0x22')]=qs[_0xd074('0x22')](_0x341201[_0xd074('0x36')][_0xd074('0x22')]);}return _0x593945[_0xd074('0x64')](_0x18b8cf);}})[_0xd074('0x29')](function(_0x4bf58a){if(_0x4bf58a){return _0x4bf58a?{'count':_0x80b9f9,'rows':_0x4bf58a}:null;}})[_0xd074('0x29')](respondWithResult(_0x26c57f,null))[_0xd074('0x48')](handleError(_0x26c57f,null));};exports[_0xd074('0x66')]=function(_0x4f1796,_0x3c9ab6,_0x1e93cb){var _0x487b84=_0x4f1796['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x487b84},'attributes':['id'],'include':[{'model':db[_0xd074('0x67')],'as':_0xd074('0x68'),'attributes':['id',_0xd074('0x2f'),_0xd074('0x69'),_0xd074('0x6a'),_0xd074('0x6b')],'raw':!![]}]})[_0xd074('0x29')](function(_0x38e7b5){if(_0x38e7b5){var _0x29a00b=_[_0xd074('0x6c')](_0x38e7b5,function(_0x56a5a8){var _0x2dbfdc=_0x56a5a8[_0xd074('0x2b')]({'plain':!![]});return _0x2dbfdc['Agents'];});return db[_0xd074('0x30')]['find']({'where':{'id':_0x4f1796['params']['id']}})[_0xd074('0x29')](function(_0x2f8342){return db[_0xd074('0x6d')]['transaction'](function(_0x393f7e){return _0x2f8342['addTeams'](_0x487b84,{'transaction':_0x393f7e})[_0xd074('0x29')](function(){return BPromise[_0xd074('0x6e')](_0x29a00b,function(_0x13ec49){return db[_0xd074('0x58')][_0xd074('0x6f')]({'where':{'UserId':_0x13ec49['id'],'OpenchannelQueueId':_0x4f1796[_0xd074('0x49')]['id']},'transaction':_0x393f7e});});})[_0xd074('0x29')](function(){_0x29a00b['forEach'](function(_0x32c5c9){socket[_0xd074('0x70')](_0xd074('0x71'),{'UserId':_0x32c5c9['id'],'OpenchannelQueueId':_0x2f8342['id']});});});});});}})[_0xd074('0x29')](respondWithStatusCode(_0x3c9ab6,null))[_0xd074('0x48')](handleError(_0x3c9ab6,null));};exports['removeTeams']=function(_0x4fb3c1,_0xa11261,_0x4ba747){return db[_0xd074('0x65')][_0xd074('0x46')]({'where':{'id':_0x4fb3c1[_0xd074('0x36')][_0xd074('0x72')]},'attributes':['id'],'include':[{'model':db[_0xd074('0x67')],'as':_0xd074('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa11261,null))['then'](function(_0x4377c1){var _0x6276d4=_[_0xd074('0x5d')](_0x4377c1,'id');var _0x4d3bf6=[];var _0x1f86ee=[];var _0x4863be=squel[_0xd074('0x73')]();_0x4863be[_0xd074('0x74')](_0xd074('0x75'))[_0xd074('0x76')](_0xd074('0x77'),'tq')['join'](_0xd074('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd074('0x79'),_0x4fb3c1[_0xd074('0x49')]['id']);for(var _0x59e06b=0x0;_0x59e06b<_0x4377c1['length'];_0x59e06b+=0x1){let _0x3dfee4=_0x4377c1[_0x59e06b];for(var _0x5a39fa=0x0;_0x5a39fa<_0x3dfee4[_0xd074('0x68')][_0xd074('0x3b')];_0x5a39fa+=0x1){let _0x488a52=_0x3dfee4[_0xd074('0x68')][_0x5a39fa];var _0x42fd55=_0x4863be['clone']();_0x42fd55[_0xd074('0x3e')]('ut.UserId\x20=\x20?',_0x488a52['id']);_0x1f86ee[_0xd074('0x7a')](db[_0xd074('0x6d')][_0xd074('0x36')](_0x42fd55['toString'](),{'type':db[_0xd074('0x6d')][_0xd074('0x7b')][_0xd074('0x7c')]})[_0xd074('0x29')](function(_0x25b2cc){if(_0x25b2cc[_0xd074('0x3b')]===0x1){return _0x488a52['id'];}else{var _0x2afce6=_[_0xd074('0x7d')](_['map'](_0x25b2cc,'TeamId'),function(_0x390234){return _[_0xd074('0x7e')](_0x6276d4,_0x390234);});if(_0x2afce6){return _0x488a52['id'];}}}));}}return BPromise[_0xd074('0x7f')](_0x1f86ee)['then'](function(_0x21939d){_0x4d3bf6=_(_0x4d3bf6)[_0xd074('0x80')](_0x21939d)[_0xd074('0x81')]()['value']();return db[_0xd074('0x30')][_0xd074('0x54')]({'where':{'id':_0x4fb3c1[_0xd074('0x49')]['id']}})['then'](function(_0x24078b){return db[_0xd074('0x6d')]['transaction'](function(_0x21c8e2){return _0x24078b[_0xd074('0x82')](_0x4fb3c1['query']['ids'],{'transaction':_0x21c8e2})[_0xd074('0x29')](function(){if(!_[_0xd074('0x83')](_0x4d3bf6)){return _0x24078b[_0xd074('0x84')](_0x4d3bf6,{'transaction':_0x21c8e2});}})['then'](function(){_0x4d3bf6[_0xd074('0x85')](function(_0x3eebe1){socket[_0xd074('0x70')](_0xd074('0x86'),{'UserId':_0x3eebe1,'OpenchannelQueueId':_0x24078b['id']});});});});});});})[_0xd074('0x29')](respondWithStatusCode(_0xa11261,null))['catch'](handleError(_0xa11261,null));};exports[_0xd074('0x87')]=function(_0x167bb6,_0x3d4f84,_0x473d1c){return db[_0xd074('0x30')][_0xd074('0x54')]({'where':{'id':_0x167bb6['params']['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x3d4f84,null))[_0xd074('0x29')](function(_0x585360){if(_0x585360){return _0x585360[_0xd074('0x87')](_0x167bb6['body']['ids'],_[_0xd074('0x88')](_0x167bb6[_0xd074('0x53')],[_0xd074('0x72'),'id'])||{})[_0xd074('0x89')](function(_0x4752d7){for(var _0x544559=0x0;_0x544559<_0x167bb6[_0xd074('0x53')][_0xd074('0x72')]['length'];_0x544559+=0x1){socket[_0xd074('0x70')](_0xd074('0x71'),{'UserId':Number(_0x167bb6['body']['ids'][_0x544559]),'OpenchannelQueueId':Number(_0x167bb6['params']['id'])});}return _0x4752d7;});}})['then'](respondWithResult(_0x3d4f84,null))[_0xd074('0x48')](handleError(_0x3d4f84,null));};exports[_0xd074('0x84')]=function(_0x3e4eb3,_0x3d3a37,_0x3feb16){return db[_0xd074('0x30')]['find']({'where':{'id':_0x3e4eb3[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x3d3a37,null))[_0xd074('0x29')](function(_0x2a543a){if(_0x2a543a){return _0x2a543a['removeAgents'](_0x3e4eb3['query'][_0xd074('0x72')])[_0xd074('0x29')](function(){if(_[_0xd074('0x8a')](_0x3e4eb3[_0xd074('0x36')][_0xd074('0x72')])){for(var _0x3bb9ff=0x0;_0x3bb9ff<_0x3e4eb3['query']['ids']['length'];_0x3bb9ff+=0x1){socket[_0xd074('0x70')](_0xd074('0x86'),{'UserId':Number(_0x3e4eb3['query'][_0xd074('0x72')][_0x3bb9ff]),'OpenchannelQueueId':Number(_0x3e4eb3[_0xd074('0x49')]['id'])});}}else{socket[_0xd074('0x70')](_0xd074('0x86'),{'UserId':Number(_0x3e4eb3[_0xd074('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3e4eb3[_0xd074('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d3a37,null))[_0xd074('0x48')](handleError(_0x3d3a37,null));};exports[_0xd074('0x8b')]=function(_0x4204f8,_0x2668a0,_0x575bf1){var _0x2b0dda={};var _0x251033={};var _0x44f245;var _0xcfc7b4;return db[_0xd074('0x30')]['findOne']({'where':{'id':_0x4204f8[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x2668a0,null))[_0xd074('0x29')](function(_0x72446c){if(_0x72446c){_0x44f245=_0x72446c;_0x251033[_0xd074('0x35')]=_[_0xd074('0x4a')](db[_0xd074('0x67')][_0xd074('0x31')]);_0x251033[_0xd074('0x36')]=_[_0xd074('0x4a')](_0x4204f8[_0xd074('0x36')]);_0x251033[_0xd074('0x37')]=_['intersection'](_0x251033[_0xd074('0x35')],_0x251033[_0xd074('0x36')]);_0x2b0dda['attributes']=_[_0xd074('0x38')](_0x251033['model'],qs[_0xd074('0x3a')](_0x4204f8['query'][_0xd074('0x3a')]));_0x2b0dda['attributes']=_0x2b0dda['attributes'][_0xd074('0x3b')]?_0x2b0dda[_0xd074('0x39')]:_0x251033[_0xd074('0x35')];_0x2b0dda[_0xd074('0x5a')]=qs[_0xd074('0x3d')](_0x4204f8['query'][_0xd074('0x3d')]);_0x2b0dda[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0x4204f8[_0xd074('0x36')],_0x251033['filters']));if(_0x4204f8[_0xd074('0x36')][_0xd074('0x40')]){_0x2b0dda[_0xd074('0x3e')]=_[_0xd074('0x42')](_0x2b0dda[_0xd074('0x3e')],{'$or':_['map'](_0x2b0dda[_0xd074('0x39')],function(_0x4f98c8){var _0x30228b={};_0x30228b[_0x4f98c8]={'$like':'%'+_0x4204f8[_0xd074('0x36')][_0xd074('0x40')]+'%'};return _0x30228b;})});}_0x2b0dda=_[_0xd074('0x42')]({},_0x2b0dda,_0x4204f8[_0xd074('0x43')]);return _0x44f245[_0xd074('0x8b')](_0x2b0dda);}})['then'](function(_0xd58dce){if(_0xd58dce){_0xcfc7b4=_0xd58dce[_0xd074('0x3b')];if(!_0x4204f8[_0xd074('0x36')][_0xd074('0x3c')](_0xd074('0x59'))){_0x2b0dda['limit']=qs[_0xd074('0x24')](_0x4204f8[_0xd074('0x36')][_0xd074('0x24')]);_0x2b0dda[_0xd074('0x22')]=qs[_0xd074('0x22')](_0x4204f8['query'][_0xd074('0x22')]);}return _0x44f245['getAgents'](_0x2b0dda);}})[_0xd074('0x29')](function(_0x16b74e){if(_0x16b74e){return _0x16b74e?{'count':_0xcfc7b4,'rows':_0x16b74e}:null;}})[_0xd074('0x29')](respondWithResult(_0x2668a0,null))[_0xd074('0x48')](handleError(_0x2668a0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 60b5db4..6c76545 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 _0xedbe=['remove','emit','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xedbe,0xdb));var _0xeedb=function(_0x5cc185,_0x2709ba){_0x5cc185=_0x5cc185-0x0;var _0x281dac=_0xedbe[_0x5cc185];return _0x281dac;};'use strict';var EventEmitter=require(_0xeedb('0x0'));var OpenchannelQueue=require(_0xeedb('0x1'))['db'][_0xeedb('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xeedb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeedb('0x4'),'afterDestroy':_0xeedb('0x5')};function emitEvent(_0xe29b7e){return function(_0x4afc7f,_0x30a799,_0x572547){OpenchannelQueueEvents[_0xeedb('0x6')](_0xe29b7e+':'+_0x4afc7f['id'],_0x4afc7f);OpenchannelQueueEvents[_0xeedb('0x6')](_0xe29b7e,_0x4afc7f);_0x572547(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xeedb('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x4286=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x206338,_0x2d800b){var _0x2b87f2=function(_0x436c1c){while(--_0x436c1c){_0x206338['push'](_0x206338['shift']());}};_0x2b87f2(++_0x2d800b);}(_0x4286,0xbd));var _0x6428=function(_0x1b72e6,_0x590db8){_0x1b72e6=_0x1b72e6-0x0;var _0x743d1a=_0x4286[_0x1b72e6];return _0x743d1a;};'use strict';var EventEmitter=require(_0x6428('0x0'));var OpenchannelQueue=require(_0x6428('0x1'))['db'][_0x6428('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6428('0x3')](0x0);var events={'afterCreate':_0x6428('0x4'),'afterUpdate':_0x6428('0x5'),'afterDestroy':_0x6428('0x6')};function emitEvent(_0x551b7f){return function(_0x20d1f6,_0x33c197,_0x3cab7d){OpenchannelQueueEvents[_0x6428('0x7')](_0x551b7f+':'+_0x20d1f6['id'],_0x20d1f6);OpenchannelQueueEvents[_0x6428('0x7')](_0x551b7f,_0x20d1f6);_0x3cab7d(null);};}for(var e in events){if(events[_0x6428('0x8')](e)){var event=events[e];OpenchannelQueue[_0x6428('0x9')](e,emitEvent(event));}}module[_0x6428('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f5a3ae2..b1be40a 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 _0xcf7d=['path','rimraf','../../config/environment','define','openchannel_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x359572,_0x48c26d){var _0x4b240d=function(_0x402240){while(--_0x402240){_0x359572['push'](_0x359572['shift']());}};_0x4b240d(++_0x48c26d);}(_0xcf7d,0x163));var _0xdcf7=function(_0xf8c409,_0x502fc0){_0xf8c409=_0xf8c409-0x0;var _0x5e4fc0=_0xcf7d[_0xf8c409];return _0x5e4fc0;};'use strict';var _=require(_0xdcf7('0x0'));var util=require('util');var logger=require(_0xdcf7('0x1'))(_0xdcf7('0x2'));var moment=require('moment');var BPromise=require(_0xdcf7('0x3'));var rp=require(_0xdcf7('0x4'));var fs=require('fs');var path=require(_0xdcf7('0x5'));var rimraf=require(_0xdcf7('0x6'));var config=require(_0xdcf7('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x1a8b19,_0x455901){return _0x1a8b19[_0xdcf7('0x8')]('OpenchannelQueue',attributes,{'tableName':_0xdcf7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x922c=['api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x366948,_0x3fdce2){var _0x494179=function(_0x3bda79){while(--_0x3bda79){_0x366948['push'](_0x366948['shift']());}};_0x494179(++_0x3fdce2);}(_0x922c,0xc3));var _0xc922=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x922c[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0xc922('0x0'));var util=require(_0xc922('0x1'));var logger=require(_0xc922('0x2'))(_0xc922('0x3'));var moment=require(_0xc922('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc922('0x5'));var rimraf=require(_0xc922('0x6'));var config=require(_0xc922('0x7'));var attributes=require(_0xc922('0x8'));module[_0xc922('0x9')]=function(_0x290705,_0xed0bb6){return _0x290705[_0xc922('0xa')]('OpenchannelQueue',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 242c5c9..8a11b52 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 _0x1e8f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x445b5b,_0x52c3fa){var _0x1c7e93=function(_0x9b2a19){while(--_0x9b2a19){_0x445b5b['push'](_0x445b5b['shift']());}};_0x1c7e93(++_0x52c3fa);}(_0x1e8f,0x121));var _0xf1e8=function(_0x57faf9,_0x108405){_0x57faf9=_0x57faf9-0x0;var _0x49890f=_0x1e8f[_0x57faf9];return _0x49890f;};'use strict';var _=require(_0xf1e8('0x0'));var util=require('util');var moment=require(_0xf1e8('0x1'));var BPromise=require(_0xf1e8('0x2'));var rs=require(_0xf1e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1e8('0x4'))['db'];var utils=require(_0xf1e8('0x5'));var logger=require(_0xf1e8('0x6'))(_0xf1e8('0x7'));var config=require(_0xf1e8('0x8'));var jayson=require(_0xf1e8('0x9'));var client=jayson[_0xf1e8('0xa')]['http']({'port':0x232a});config[_0xf1e8('0xb')]=_[_0xf1e8('0xc')](config[_0xf1e8('0xb')],{'host':_0xf1e8('0xd'),'port':0x18eb});var socket=require(_0xf1e8('0xe'))(new Redis(config[_0xf1e8('0xb')]));require(_0xf1e8('0xf'))[_0xf1e8('0x10')](socket);function respondWithRpcPromise(_0x4a1ad9,_0x31e742,_0x49d408){return new BPromise(function(_0x5d3377,_0x22031b){return client[_0xf1e8('0x11')](_0x4a1ad9,_0x49d408)[_0xf1e8('0x12')](function(_0x261440){logger[_0xf1e8('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x31e742,'request\x20sent');logger['debug'](_0xf1e8('0x14'),_0x31e742,'request\x20sent',JSON[_0xf1e8('0x15')](_0x261440));if(_0x261440[_0xf1e8('0x16')]){if(_0x261440[_0xf1e8('0x16')][_0xf1e8('0x17')]===0x1f4){logger['error'](_0xf1e8('0x18'),_0x31e742,_0x261440[_0xf1e8('0x16')][_0xf1e8('0x19')]);return _0x22031b(_0x261440['error'][_0xf1e8('0x19')]);}logger[_0xf1e8('0x16')](_0xf1e8('0x18'),_0x31e742,_0x261440[_0xf1e8('0x16')]['message']);return _0x5d3377(_0x261440[_0xf1e8('0x16')]['message']);}else{logger[_0xf1e8('0x13')](_0xf1e8('0x18'),_0x31e742,_0xf1e8('0x1a'));_0x5d3377(_0x261440[_0xf1e8('0x1b')]['message']);}})[_0xf1e8('0x1c')](function(_0xe34710){logger[_0xf1e8('0x16')](_0xf1e8('0x18'),_0x31e742,_0xe34710);_0x22031b(_0xe34710);});});}exports[_0xf1e8('0x1d')]=function(_0x5ce5a2){var _0x5f130e=this;return new Promise(function(_0x2c1406,_0x5758c1){return db[_0xf1e8('0x1e')][_0xf1e8('0x1f')]({'raw':_0x5ce5a2[_0xf1e8('0x20')]?_0x5ce5a2[_0xf1e8('0x20')][_0xf1e8('0x21')]===undefined?!![]:![]:!![],'where':_0x5ce5a2['options']?_0x5ce5a2[_0xf1e8('0x20')][_0xf1e8('0x22')]||null:null,'attributes':_0x5ce5a2[_0xf1e8('0x20')]?_0x5ce5a2[_0xf1e8('0x20')][_0xf1e8('0x23')]||null:null,'limit':_0x5ce5a2[_0xf1e8('0x20')]?_0x5ce5a2[_0xf1e8('0x20')]['limit']||null:null,'include':_0x5ce5a2[_0xf1e8('0x20')]?_0x5ce5a2[_0xf1e8('0x20')][_0xf1e8('0x24')]?_[_0xf1e8('0x25')](_0x5ce5a2['options'][_0xf1e8('0x24')],function(_0x44f0b1){return{'model':db[_0x44f0b1[_0xf1e8('0x26')]],'as':_0x44f0b1['as'],'attributes':_0x44f0b1['attributes'],'include':_0x44f0b1[_0xf1e8('0x24')]?_[_0xf1e8('0x25')](_0x44f0b1['include'],function(_0x5152b3){return{'model':db[_0x5152b3[_0xf1e8('0x26')]],'as':_0x5152b3['as'],'attributes':_0x5152b3['attributes'],'include':_0x5152b3[_0xf1e8('0x24')]?_[_0xf1e8('0x25')](_0x5152b3[_0xf1e8('0x24')],function(_0x5baea1){return{'model':db[_0x5baea1['model']],'as':_0x5baea1['as'],'attributes':_0x5baea1[_0xf1e8('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf1e8('0x12')](function(_0x3f1e5f){logger['info']('GetOpenchannelQueue',_0x5ce5a2);logger[_0xf1e8('0x27')](_0xf1e8('0x1d'),_0x5ce5a2,JSON[_0xf1e8('0x15')](_0x3f1e5f));_0x2c1406(_0x3f1e5f);})[_0xf1e8('0x1c')](function(_0x5e6e78){logger['error'](_0xf1e8('0x1d'),_0x5e6e78[_0xf1e8('0x19')],_0x5ce5a2);_0x5758c1(_0x5f130e[_0xf1e8('0x16')](0x1f4,_0x5e6e78['message']));});});};exports[_0xf1e8('0x28')]=function(_0x35116d){var _0x58907d=this;return new Promise(function(_0x1ad343,_0x4c96b7){return db['OpenchannelQueue'][_0xf1e8('0x29')]({'raw':_0x35116d[_0xf1e8('0x20')]?_0x35116d[_0xf1e8('0x20')][_0xf1e8('0x21')]===undefined?!![]:![]:!![],'where':_0x35116d['options']?_0x35116d[_0xf1e8('0x20')][_0xf1e8('0x22')]||null:null,'attributes':_0x35116d['options']?_0x35116d[_0xf1e8('0x20')]['attributes']||null:null,'include':_0x35116d[_0xf1e8('0x20')]?_0x35116d[_0xf1e8('0x20')][_0xf1e8('0x24')]?_['map'](_0x35116d[_0xf1e8('0x20')][_0xf1e8('0x24')],function(_0x168ea3){return{'model':db[_0x168ea3[_0xf1e8('0x26')]],'as':_0x168ea3['as'],'attributes':_0x168ea3['attributes'],'include':_0x168ea3[_0xf1e8('0x24')]?_[_0xf1e8('0x25')](_0x168ea3[_0xf1e8('0x24')],function(_0x1940cf){return{'model':db[_0x1940cf[_0xf1e8('0x26')]],'as':_0x1940cf['as'],'attributes':_0x1940cf[_0xf1e8('0x23')],'include':_0x1940cf[_0xf1e8('0x24')]?_[_0xf1e8('0x25')](_0x1940cf[_0xf1e8('0x24')],function(_0x5780c8){return{'model':db[_0x5780c8['model']],'as':_0x5780c8['as'],'attributes':_0x5780c8[_0xf1e8('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf1e8('0x12')](function(_0x571912){logger['info']('ShowOpenchannelQueue',_0x35116d);logger[_0xf1e8('0x27')](_0xf1e8('0x28'),_0x35116d,JSON[_0xf1e8('0x15')](_0x571912));_0x1ad343(_0x571912);})[_0xf1e8('0x1c')](function(_0x356f62){logger[_0xf1e8('0x16')](_0xf1e8('0x28'),_0x356f62['message'],_0x35116d);_0x4c96b7(_0x58907d[_0xf1e8('0x16')](0x1f4,_0x356f62[_0xf1e8('0x19')]));});});}; \ No newline at end of file +var _0x0f34=['GetOpenchannelQueue','options','raw','limit','include','map','attributes','model','then','ShowOpenchannelQueue','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x415ec7,_0xf0ed17){var _0x2dcadd=function(_0x51ee26){while(--_0x51ee26){_0x415ec7['push'](_0x415ec7['shift']());}};_0x2dcadd(++_0xf0ed17);}(_0x0f34,0x134));var _0x40f3=function(_0x55d893,_0x325ebe){_0x55d893=_0x55d893-0x0;var _0x52d152=_0x0f34[_0x55d893];return _0x52d152;};'use strict';var _=require(_0x40f3('0x0'));var util=require(_0x40f3('0x1'));var moment=require('moment');var BPromise=require(_0x40f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x40f3('0x4'));var logger=require(_0x40f3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x40f3('0x6'));var client=jayson[_0x40f3('0x7')][_0x40f3('0x8')]({'port':0x232a});config[_0x40f3('0x9')]=_[_0x40f3('0xa')](config[_0x40f3('0x9')],{'host':_0x40f3('0xb'),'port':0x18eb});var socket=require(_0x40f3('0xc'))(new Redis(config[_0x40f3('0x9')]));require(_0x40f3('0xd'))[_0x40f3('0xe')](socket);function respondWithRpcPromise(_0x36b67c,_0x5c6848,_0x1c7830){return new BPromise(function(_0x1f7f28,_0x241fad){return client[_0x40f3('0xf')](_0x36b67c,_0x1c7830)['then'](function(_0x301302){logger[_0x40f3('0x10')](_0x40f3('0x11'),_0x5c6848,_0x40f3('0x12'));logger[_0x40f3('0x13')](_0x40f3('0x14'),_0x5c6848,_0x40f3('0x12'),JSON['stringify'](_0x301302));if(_0x301302[_0x40f3('0x15')]){if(_0x301302[_0x40f3('0x15')][_0x40f3('0x16')]===0x1f4){logger['error'](_0x40f3('0x11'),_0x5c6848,_0x301302[_0x40f3('0x15')]['message']);return _0x241fad(_0x301302[_0x40f3('0x15')][_0x40f3('0x17')]);}logger[_0x40f3('0x15')](_0x40f3('0x11'),_0x5c6848,_0x301302['error'][_0x40f3('0x17')]);return _0x1f7f28(_0x301302['error']['message']);}else{logger[_0x40f3('0x10')](_0x40f3('0x11'),_0x5c6848,_0x40f3('0x12'));_0x1f7f28(_0x301302['result'][_0x40f3('0x17')]);}})[_0x40f3('0x18')](function(_0x32af70){logger[_0x40f3('0x15')](_0x40f3('0x11'),_0x5c6848,_0x32af70);_0x241fad(_0x32af70);});});}exports[_0x40f3('0x19')]=function(_0x139d3c){var _0x201558=this;return new Promise(function(_0x67634d,_0x282506){return db['OpenchannelQueue']['findAll']({'raw':_0x139d3c['options']?_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1b')]===undefined?!![]:![]:!![],'where':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')]['where']||null:null,'attributes':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')]['attributes']||null:null,'limit':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1c')]||null:null,'include':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1d')]?_[_0x40f3('0x1e')](_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1d')],function(_0x30687c){return{'model':db[_0x30687c['model']],'as':_0x30687c['as'],'attributes':_0x30687c[_0x40f3('0x1f')],'include':_0x30687c[_0x40f3('0x1d')]?_['map'](_0x30687c[_0x40f3('0x1d')],function(_0x219e8c){return{'model':db[_0x219e8c[_0x40f3('0x20')]],'as':_0x219e8c['as'],'attributes':_0x219e8c[_0x40f3('0x1f')],'include':_0x219e8c['include']?_[_0x40f3('0x1e')](_0x219e8c['include'],function(_0x4c5169){return{'model':db[_0x4c5169[_0x40f3('0x20')]],'as':_0x4c5169['as'],'attributes':_0x4c5169[_0x40f3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x40f3('0x21')](function(_0x42964c){logger[_0x40f3('0x10')]('GetOpenchannelQueue',_0x139d3c);logger['debug'](_0x40f3('0x19'),_0x139d3c,JSON['stringify'](_0x42964c));_0x67634d(_0x42964c);})[_0x40f3('0x18')](function(_0x1e2eb0){logger[_0x40f3('0x15')](_0x40f3('0x19'),_0x1e2eb0[_0x40f3('0x17')],_0x139d3c);_0x282506(_0x201558['error'](0x1f4,_0x1e2eb0[_0x40f3('0x17')]));});});};exports[_0x40f3('0x22')]=function(_0x3ce5d4){var _0x396ea5=this;return new Promise(function(_0x501452,_0x4c1947){return db['OpenchannelQueue'][_0x40f3('0x23')]({'raw':_0x3ce5d4[_0x40f3('0x1a')]?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ce5d4[_0x40f3('0x1a')]?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x24')]||null:null,'attributes':_0x3ce5d4['options']?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1f')]||null:null,'include':_0x3ce5d4[_0x40f3('0x1a')]?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1d')]?_['map'](_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1d')],function(_0x444c28){return{'model':db[_0x444c28['model']],'as':_0x444c28['as'],'attributes':_0x444c28[_0x40f3('0x1f')],'include':_0x444c28[_0x40f3('0x1d')]?_[_0x40f3('0x1e')](_0x444c28[_0x40f3('0x1d')],function(_0x4b288c){return{'model':db[_0x4b288c[_0x40f3('0x20')]],'as':_0x4b288c['as'],'attributes':_0x4b288c[_0x40f3('0x1f')],'include':_0x4b288c['include']?_[_0x40f3('0x1e')](_0x4b288c[_0x40f3('0x1d')],function(_0x263c75){return{'model':db[_0x263c75[_0x40f3('0x20')]],'as':_0x263c75['as'],'attributes':_0x263c75['attributes']};}):[]};}):[]};}):[]:[]})[_0x40f3('0x21')](function(_0x27c099){logger[_0x40f3('0x10')](_0x40f3('0x22'),_0x3ce5d4);logger[_0x40f3('0x13')](_0x40f3('0x22'),_0x3ce5d4,JSON['stringify'](_0x27c099));_0x501452(_0x27c099);})[_0x40f3('0x18')](function(_0x1e7b5f){logger[_0x40f3('0x15')](_0x40f3('0x22'),_0x1e7b5f[_0x40f3('0x17')],_0x3ce5d4);_0x4c1947(_0x396ea5[_0x40f3('0x15')](0x1f4,_0x1e7b5f[_0x40f3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 635739e..e967bbd 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 _0x2402=['removeListener','length','openchannelQueue:','./openchannelQueue.events','update','emit'];(function(_0x4dda8e,_0xe91ab7){var _0x1563c7=function(_0x552266){while(--_0x552266){_0x4dda8e['push'](_0x4dda8e['shift']());}};_0x1563c7(++_0xe91ab7);}(_0x2402,0xbd));var _0x2240=function(_0x77422a,_0x4999e8){_0x77422a=_0x77422a-0x0;var _0x47852a=_0x2402[_0x77422a];return _0x47852a;};'use strict';var OpenchannelQueueEvents=require(_0x2240('0x0'));var events=['save','remove',_0x2240('0x1')];function createListener(_0x4b2cd5,_0x443db8){return function(_0x538fb8){_0x443db8[_0x2240('0x2')](_0x4b2cd5,_0x538fb8);};}function removeListener(_0x3c9951,_0x45d8c9){return function(){OpenchannelQueueEvents[_0x2240('0x3')](_0x3c9951,_0x45d8c9);};}exports['register']=function(_0x5dfa08){for(var _0x36024b=0x0,_0x26f247=events[_0x2240('0x4')];_0x36024b<_0x26f247;_0x36024b++){var _0x358aa5=events[_0x36024b];var _0x5bb659=createListener(_0x2240('0x5')+_0x358aa5,_0x5dfa08);OpenchannelQueueEvents['on'](_0x358aa5,_0x5bb659);}}; \ No newline at end of file +var _0x461b=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x381021,_0x498ce6){var _0x15bd35=function(_0x1845e0){while(--_0x1845e0){_0x381021['push'](_0x381021['shift']());}};_0x15bd35(++_0x498ce6);}(_0x461b,0xbf));var _0xb461=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x461b[_0x13e741];return _0x3f8bb3;};'use strict';var OpenchannelQueueEvents=require(_0xb461('0x0'));var events=[_0xb461('0x1'),_0xb461('0x2'),_0xb461('0x3')];function createListener(_0x4705c5,_0x55b3dd){return function(_0x22e0c5){_0x55b3dd[_0xb461('0x4')](_0x4705c5,_0x22e0c5);};}function removeListener(_0x3447d1,_0x317858){return function(){OpenchannelQueueEvents[_0xb461('0x5')](_0x3447d1,_0x317858);};}exports[_0xb461('0x6')]=function(_0x38b7ae){for(var _0x260fe5=0x0,_0x11bdba=events[_0xb461('0x7')];_0x260fe5<_0x11bdba;_0x260fe5++){var _0x291481=events[_0x260fe5];var _0x4eba3e=createListener(_0xb461('0x8')+_0x291481,_0x38b7ae);OpenchannelQueueEvents['on'](_0x291481,_0x4eba3e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ad6fe80..49e6e31 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 _0x5915=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x36f058,_0x38e53c){var _0x26c53d=function(_0x441281){while(--_0x441281){_0x36f058['push'](_0x36f058['shift']());}};_0x26c53d(++_0x38e53c);}(_0x5915,0x1e6));var _0x5591=function(_0x3ceb32,_0x2d8c95){_0x3ceb32=_0x3ceb32-0x0;var _0x3fbf0c=_0x5915[_0x3ceb32];return _0x3fbf0c;};'use strict';var multer=require(_0x5591('0x0'));var util=require('util');var path=require(_0x5591('0x1'));var timeout=require(_0x5591('0x2'));var express=require(_0x5591('0x3'));var router=express[_0x5591('0x4')]();var fs_extra=require(_0x5591('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5591('0x6'));var config=require(_0x5591('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x5591('0x8')]('/',auth['isAuthenticated'](),controller[_0x5591('0x9')]);router['get'](_0x5591('0xa'),auth[_0x5591('0xb')](),controller[_0x5591('0xc')]);router[_0x5591('0x8')](_0x5591('0xd'),auth[_0x5591('0xb')](),controller[_0x5591('0xe')]);router[_0x5591('0xf')]('/',auth[_0x5591('0xb')](),controller[_0x5591('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5591('0x11')]);router[_0x5591('0x12')](_0x5591('0xd'),auth['isAuthenticated'](),controller[_0x5591('0x13')]);module[_0x5591('0x14')]=router; \ No newline at end of file +var _0xcd49=['../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/:id','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x448fe6,_0x4a3e61){var _0x591b51=function(_0x5e1c79){while(--_0x5e1c79){_0x448fe6['push'](_0x448fe6['shift']());}};_0x591b51(++_0x4a3e61);}(_0xcd49,0x65));var _0x9cd4=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0xcd49[_0x1c0f3d];return _0x4d71a8;};'use strict';var multer=require(_0x9cd4('0x0'));var util=require(_0x9cd4('0x1'));var path=require('path');var timeout=require(_0x9cd4('0x2'));var express=require(_0x9cd4('0x3'));var router=express['Router']();var fs_extra=require(_0x9cd4('0x4'));var auth=require(_0x9cd4('0x5'));var interaction=require(_0x9cd4('0x6'));var config=require(_0x9cd4('0x7'));var controller=require(_0x9cd4('0x8'));router['get']('/',auth[_0x9cd4('0x9')](),controller[_0x9cd4('0xa')]);router[_0x9cd4('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9cd4('0xb')](_0x9cd4('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9cd4('0x9')](),controller['create']);router[_0x9cd4('0xd')](_0x9cd4('0xc'),auth['isAuthenticated'](),controller[_0x9cd4('0xe')]);router[_0x9cd4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9cd4('0x10')]);module[_0x9cd4('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2624302..770b18a 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 _0x4a98=['DATE','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4a98,0x1a5));var _0x84a9=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x4a98[_0x237f8b];return _0x423f94;};'use strict';var moment=require('moment');var Sequelize=require(_0x84a9('0x0'));module[_0x84a9('0x1')]={'uniqueid':{'type':Sequelize[_0x84a9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x84a9('0x2')]},'joinAt':{'type':Sequelize[_0x84a9('0x3')]},'leaveAt':{'type':Sequelize[_0x84a9('0x3')]},'acceptAt':{'type':Sequelize[_0x84a9('0x3')]},'exitAt':{'type':Sequelize[_0x84a9('0x3')]},'reason':{'type':Sequelize[_0x84a9('0x2')]}}; \ No newline at end of file +var _0x73a7=['sequelize','exports','STRING','DATE'];(function(_0x16e871,_0x231ced){var _0x4b315a=function(_0x5d139c){while(--_0x5d139c){_0x16e871['push'](_0x16e871['shift']());}};_0x4b315a(++_0x231ced);}(_0x73a7,0x80));var _0x773a=function(_0x59c6e7,_0x43454c){_0x59c6e7=_0x59c6e7-0x0;var _0x36b853=_0x73a7[_0x59c6e7];return _0x36b853;};'use strict';var moment=require('moment');var Sequelize=require(_0x773a('0x0'));module[_0x773a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x773a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x773a('0x3')]},'acceptAt':{'type':Sequelize[_0x773a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x773a('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3091a1b..c0ae848 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 _0x95a6=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','OpenchannelQueueReport','include','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir'];(function(_0x458959,_0x4cdf7a){var _0xde7ff6=function(_0x4dbf8f){while(--_0x4dbf8f){_0x458959['push'](_0x458959['shift']());}};_0xde7ff6(++_0x4cdf7a);}(_0x95a6,0x129));var _0x695a=function(_0x251e4d,_0x39bc60){_0x251e4d=_0x251e4d-0x0;var _0x1b6c88=_0x95a6[_0x251e4d];return _0x1b6c88;};'use strict';var emlformat=require(_0x695a('0x0'));var rimraf=require(_0x695a('0x1'));var zipdir=require(_0x695a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x695a('0x3'));var moment=require(_0x695a('0x4'));var BPromise=require(_0x695a('0x5'));var Mustache=require(_0x695a('0x6'));var util=require(_0x695a('0x7'));var path=require(_0x695a('0x8'));var sox=require(_0x695a('0x9'));var csv=require(_0x695a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x695a('0xb'));var _=require(_0x695a('0xc'));var squel=require(_0x695a('0xd'));var crypto=require(_0x695a('0xe'));var jsforce=require(_0x695a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x695a('0xa'));var querystring=require(_0x695a('0x10'));var Papa=require(_0x695a('0x11'));var Redis=require(_0x695a('0x12'));var authService=require(_0x695a('0x13'));var qs=require(_0x695a('0x14'));var as=require(_0x695a('0x15'));var hardwareService=require(_0x695a('0x16'));var logger=require(_0x695a('0x17'))('api');var utils=require(_0x695a('0x18'));var config=require(_0x695a('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e20e,_0x2472bf){_0x2472bf=_0x2472bf||0xcc;return function(_0x2eac12){if(_0x2eac12){return _0x23e20e[_0x695a('0x1a')](_0x2472bf);}return _0x23e20e[_0x695a('0x1b')](_0x2472bf)['end']();};}function respondWithResult(_0xf3c1dc,_0x57b337){_0x57b337=_0x57b337||0xc8;return function(_0x496f83){if(_0x496f83){return _0xf3c1dc[_0x695a('0x1b')](_0x57b337)[_0x695a('0x1c')](_0x496f83);}};}function respondWithFilteredResult(_0x504fee,_0x109ee6){return function(_0x25ca64){if(_0x25ca64){var _0x3a0613=typeof _0x109ee6[_0x695a('0x1d')]===_0x695a('0x1e')&&typeof _0x109ee6['limit']===_0x695a('0x1e');var _0x519001=_0x25ca64[_0x695a('0x1f')];var _0x48eb78=_0x3a0613?0x0:_0x109ee6[_0x695a('0x1d')];var _0x53720a=_0x3a0613?_0x25ca64[_0x695a('0x1f')]:_0x109ee6[_0x695a('0x1d')]+_0x109ee6[_0x695a('0x20')];var _0xa29bfe;if(_0x53720a>=_0x519001){_0x53720a=_0x519001;_0xa29bfe=0xc8;}else{_0xa29bfe=0xce;}_0x504fee[_0x695a('0x1b')](_0xa29bfe);return _0x504fee[_0x695a('0x21')](_0x695a('0x22'),_0x48eb78+'-'+_0x53720a+'/'+_0x519001)[_0x695a('0x1c')](_0x25ca64);}return null;};}function patchUpdates(_0x152a9d){return function(_0x30ca4f){try{jsonpatch[_0x695a('0x23')](_0x30ca4f,_0x152a9d,!![]);}catch(_0x4526b8){return BPromise[_0x695a('0x24')](_0x4526b8);}return _0x30ca4f[_0x695a('0x25')]();};}function saveUpdates(_0x12ecf1,_0x5e868f){return function(_0x39c741){if(_0x39c741){return _0x39c741[_0x695a('0x26')](_0x12ecf1)[_0x695a('0x27')](function(_0x51350b){return _0x51350b;});}return null;};}function removeEntity(_0x5f408a,_0x42fc6b){return function(_0x575990){if(_0x575990){return _0x575990[_0x695a('0x28')]()[_0x695a('0x27')](function(){_0x5f408a['status'](0xcc)[_0x695a('0x29')]();});}};}function handleEntityNotFound(_0x24ef63,_0x1c9de2){return function(_0x2c5dc4){if(!_0x2c5dc4){_0x24ef63['sendStatus'](0x194);}return _0x2c5dc4;};}function handleError(_0x229e9e,_0x467375){_0x467375=_0x467375||0x1f4;return function(_0x51687e){logger[_0x695a('0x2a')](_0x51687e[_0x695a('0x2b')]);if(_0x51687e['name']){delete _0x51687e[_0x695a('0x2c')];}_0x229e9e[_0x695a('0x1b')](_0x467375)['send'](_0x51687e);};}exports[_0x695a('0x2d')]=function(_0x20baf4,_0x30ac74){var _0x50dd65={},_0x153ab6={},_0x3d53b0={'count':0x0,'rows':[]};var _0x2374a8=_[_0x695a('0x2e')](db['OpenchannelQueueReport'][_0x695a('0x2f')],function(_0x471693){return{'name':_0x471693[_0x695a('0x30')],'type':_0x471693['type'][_0x695a('0x31')]};});_0x153ab6[_0x695a('0x32')]=_['map'](_0x2374a8,_0x695a('0x2c'));_0x153ab6[_0x695a('0x33')]=_['keys'](_0x20baf4[_0x695a('0x33')]);_0x153ab6['filters']=_[_0x695a('0x34')](_0x153ab6['model'],_0x153ab6['query']);_0x50dd65[_0x695a('0x35')]=_[_0x695a('0x34')](_0x153ab6[_0x695a('0x32')],qs[_0x695a('0x36')](_0x20baf4['query']['fields']));_0x50dd65[_0x695a('0x35')]=_0x50dd65[_0x695a('0x35')][_0x695a('0x37')]?_0x50dd65[_0x695a('0x35')]:_0x153ab6['model'];if(!_0x20baf4['query']['hasOwnProperty']('nolimit')){_0x50dd65['limit']=qs[_0x695a('0x20')](_0x20baf4[_0x695a('0x33')][_0x695a('0x20')]);_0x50dd65[_0x695a('0x1d')]=qs['offset'](_0x20baf4['query'][_0x695a('0x1d')]);}_0x50dd65[_0x695a('0x38')]=qs[_0x695a('0x39')](_0x20baf4['query'][_0x695a('0x39')]);_0x50dd65[_0x695a('0x3a')]=qs[_0x695a('0x3b')](_['pick'](_0x20baf4[_0x695a('0x33')],_0x153ab6[_0x695a('0x3b')]),_0x2374a8);if(_0x20baf4[_0x695a('0x33')][_0x695a('0x3c')]){_0x50dd65[_0x695a('0x3a')]=_[_0x695a('0x3d')](_0x50dd65[_0x695a('0x3a')],{'$or':_[_0x695a('0x2e')](_0x2374a8,function(_0x3dac17){if(_0x3dac17['type']!==_0x695a('0x3e')){var _0x4a78d5={};_0x4a78d5[_0x3dac17[_0x695a('0x2c')]]={'$like':'%'+_0x20baf4['query']['filter']+'%'};return _0x4a78d5;}})});}_0x50dd65=_[_0x695a('0x3d')]({},_0x50dd65,_0x20baf4['options']);var _0x5a914e={'where':_0x50dd65[_0x695a('0x3a')]};return db[_0x695a('0x3f')][_0x695a('0x1f')](_0x5a914e)[_0x695a('0x27')](function(_0x48e87c){_0x3d53b0[_0x695a('0x1f')]=_0x48e87c;if(_0x20baf4[_0x695a('0x33')]['includeAll']){_0x50dd65[_0x695a('0x40')]=[{'all':!![]}];}return db[_0x695a('0x3f')]['findAll'](_0x50dd65);})[_0x695a('0x27')](function(_0x7f4d32){_0x3d53b0[_0x695a('0x41')]=_0x7f4d32;return _0x3d53b0;})[_0x695a('0x27')](respondWithFilteredResult(_0x30ac74,_0x50dd65))[_0x695a('0x42')](handleError(_0x30ac74,null));};exports[_0x695a('0x43')]=function(_0x21fa42,_0x45c1d0){var _0x22e601={'raw':!![],'where':{'id':_0x21fa42['params']['id']}},_0x1bf7bf={};_0x1bf7bf['model']=_['keys'](db[_0x695a('0x3f')][_0x695a('0x2f')]);_0x1bf7bf['query']=_[_0x695a('0x44')](_0x21fa42[_0x695a('0x33')]);_0x1bf7bf['filters']=_['intersection'](_0x1bf7bf['model'],_0x1bf7bf['query']);_0x22e601[_0x695a('0x35')]=_[_0x695a('0x34')](_0x1bf7bf[_0x695a('0x32')],qs[_0x695a('0x36')](_0x21fa42['query'][_0x695a('0x36')]));_0x22e601[_0x695a('0x35')]=_0x22e601[_0x695a('0x35')][_0x695a('0x37')]?_0x22e601[_0x695a('0x35')]:_0x1bf7bf['model'];if(_0x21fa42[_0x695a('0x33')][_0x695a('0x45')]){_0x22e601[_0x695a('0x40')]=[{'all':!![]}];}_0x22e601=_[_0x695a('0x3d')]({},_0x22e601,_0x21fa42['options']);return db['OpenchannelQueueReport'][_0x695a('0x46')](_0x22e601)[_0x695a('0x27')](handleEntityNotFound(_0x45c1d0,null))[_0x695a('0x27')](respondWithResult(_0x45c1d0,null))[_0x695a('0x42')](handleError(_0x45c1d0,null));};exports[_0x695a('0x47')]=function(_0x2cc06f,_0x10a4c6){return db[_0x695a('0x3f')]['create'](_0x2cc06f['body'],{})['then'](respondWithResult(_0x10a4c6,0xc9))[_0x695a('0x42')](handleError(_0x10a4c6,null));};exports[_0x695a('0x26')]=function(_0x939f8c,_0x1696e8){if(_0x939f8c[_0x695a('0x48')]['id']){delete _0x939f8c[_0x695a('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x695a('0x46')]({'where':{'id':_0x939f8c[_0x695a('0x49')]['id']}})[_0x695a('0x27')](handleEntityNotFound(_0x1696e8,null))[_0x695a('0x27')](saveUpdates(_0x939f8c[_0x695a('0x48')],null))[_0x695a('0x27')](respondWithResult(_0x1696e8,null))[_0x695a('0x42')](handleError(_0x1696e8,null));};exports[_0x695a('0x28')]=function(_0x99361d,_0x2231f8){return db[_0x695a('0x3f')]['find']({'where':{'id':_0x99361d[_0x695a('0x49')]['id']}})['then'](handleEntityNotFound(_0x2231f8,null))[_0x695a('0x27')](removeEntity(_0x2231f8,null))[_0x695a('0x42')](handleError(_0x2231f8,null));};exports[_0x695a('0x4a')]=function(_0x7d0d6b,_0x164456){return db[_0x695a('0x3f')][_0x695a('0x4a')]()[_0x695a('0x27')](respondWithResult(_0x164456,null))[_0x695a('0x42')](handleError(_0x164456,null));}; \ No newline at end of file +var _0xf057=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x32cc68,_0x5d2b21){var _0x472ab1=function(_0x14ff66){while(--_0x14ff66){_0x32cc68['push'](_0x32cc68['shift']());}};_0x472ab1(++_0x5d2b21);}(_0xf057,0xde));var _0x7f05=function(_0x51588c,_0x1b4a22){_0x51588c=_0x51588c-0x0;var _0x5ba11c=_0xf057[_0x51588c];return _0x5ba11c;};'use strict';var emlformat=require(_0x7f05('0x0'));var rimraf=require(_0x7f05('0x1'));var zipdir=require(_0x7f05('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f05('0x3'));var moment=require(_0x7f05('0x4'));var BPromise=require(_0x7f05('0x5'));var Mustache=require(_0x7f05('0x6'));var util=require(_0x7f05('0x7'));var path=require(_0x7f05('0x8'));var sox=require(_0x7f05('0x9'));var csv=require(_0x7f05('0xa'));var ejs=require(_0x7f05('0xb'));var fs=require('fs');var fs_extra=require(_0x7f05('0xc'));var _=require(_0x7f05('0xd'));var squel=require(_0x7f05('0xe'));var crypto=require(_0x7f05('0xf'));var jsforce=require(_0x7f05('0x10'));var deskjs=require(_0x7f05('0x11'));var toCsv=require(_0x7f05('0xa'));var querystring=require(_0x7f05('0x12'));var Papa=require('papaparse');var Redis=require(_0x7f05('0x13'));var authService=require(_0x7f05('0x14'));var qs=require(_0x7f05('0x15'));var as=require(_0x7f05('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f05('0x17'));var utils=require(_0x7f05('0x18'));var config=require(_0x7f05('0x19'));var licenseUtil=require(_0x7f05('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x438fbf,_0x6ca2b2){_0x6ca2b2=_0x6ca2b2||0xcc;return function(_0x281318){if(_0x281318){return _0x438fbf[_0x7f05('0x1b')](_0x6ca2b2);}return _0x438fbf[_0x7f05('0x1c')](_0x6ca2b2)[_0x7f05('0x1d')]();};}function respondWithResult(_0x4be1da,_0x2c8de1){_0x2c8de1=_0x2c8de1||0xc8;return function(_0x3c47fa){if(_0x3c47fa){return _0x4be1da[_0x7f05('0x1c')](_0x2c8de1)[_0x7f05('0x1e')](_0x3c47fa);}};}function respondWithFilteredResult(_0x32e308,_0x522b9f){return function(_0x3c6c80){if(_0x3c6c80){var _0x3378e4=typeof _0x522b9f['offset']===_0x7f05('0x1f')&&typeof _0x522b9f[_0x7f05('0x20')]==='undefined';var _0x5e88f7=_0x3c6c80[_0x7f05('0x21')];var _0x3de79b=_0x3378e4?0x0:_0x522b9f[_0x7f05('0x22')];var _0x42e0ab=_0x3378e4?_0x3c6c80[_0x7f05('0x21')]:_0x522b9f[_0x7f05('0x22')]+_0x522b9f[_0x7f05('0x20')];var _0x130c3e;if(_0x42e0ab>=_0x5e88f7){_0x42e0ab=_0x5e88f7;_0x130c3e=0xc8;}else{_0x130c3e=0xce;}_0x32e308['status'](_0x130c3e);return _0x32e308[_0x7f05('0x23')](_0x7f05('0x24'),_0x3de79b+'-'+_0x42e0ab+'/'+_0x5e88f7)[_0x7f05('0x1e')](_0x3c6c80);}return null;};}function patchUpdates(_0x4b47a2){return function(_0x8d3733){try{jsonpatch['apply'](_0x8d3733,_0x4b47a2,!![]);}catch(_0x30985b){return BPromise[_0x7f05('0x25')](_0x30985b);}return _0x8d3733[_0x7f05('0x26')]();};}function saveUpdates(_0x4fefda,_0x294c8d){return function(_0x5f10f5){if(_0x5f10f5){return _0x5f10f5[_0x7f05('0x27')](_0x4fefda)['then'](function(_0x3f83e0){return _0x3f83e0;});}return null;};}function removeEntity(_0x55436b,_0x32dbe6){return function(_0x11c4f3){if(_0x11c4f3){return _0x11c4f3['destroy']()[_0x7f05('0x28')](function(){_0x55436b[_0x7f05('0x1c')](0xcc)[_0x7f05('0x1d')]();});}};}function handleEntityNotFound(_0x2780db,_0x3c0be5){return function(_0xda132e){if(!_0xda132e){_0x2780db['sendStatus'](0x194);}return _0xda132e;};}function handleError(_0x22bb83,_0x3cca29){_0x3cca29=_0x3cca29||0x1f4;return function(_0x44574a){logger[_0x7f05('0x29')](_0x44574a[_0x7f05('0x2a')]);if(_0x44574a[_0x7f05('0x2b')]){delete _0x44574a['name'];}_0x22bb83['status'](_0x3cca29)[_0x7f05('0x2c')](_0x44574a);};}exports[_0x7f05('0x2d')]=function(_0x11f721,_0x135d96){var _0xee4787={},_0x22714d={},_0x23e99b={'count':0x0,'rows':[]};var _0x3c160a=_[_0x7f05('0x2e')](db[_0x7f05('0x2f')][_0x7f05('0x30')],function(_0x2a52d7){return{'name':_0x2a52d7[_0x7f05('0x31')],'type':_0x2a52d7[_0x7f05('0x32')][_0x7f05('0x33')]};});_0x22714d[_0x7f05('0x34')]=_[_0x7f05('0x2e')](_0x3c160a,'name');_0x22714d['query']=_[_0x7f05('0x35')](_0x11f721['query']);_0x22714d[_0x7f05('0x36')]=_[_0x7f05('0x37')](_0x22714d[_0x7f05('0x34')],_0x22714d[_0x7f05('0x38')]);_0xee4787[_0x7f05('0x39')]=_[_0x7f05('0x37')](_0x22714d['model'],qs[_0x7f05('0x3a')](_0x11f721['query']['fields']));_0xee4787['attributes']=_0xee4787[_0x7f05('0x39')]['length']?_0xee4787[_0x7f05('0x39')]:_0x22714d[_0x7f05('0x34')];if(!_0x11f721[_0x7f05('0x38')][_0x7f05('0x3b')]('nolimit')){_0xee4787[_0x7f05('0x20')]=qs['limit'](_0x11f721['query']['limit']);_0xee4787[_0x7f05('0x22')]=qs[_0x7f05('0x22')](_0x11f721['query']['offset']);}_0xee4787[_0x7f05('0x3c')]=qs[_0x7f05('0x3d')](_0x11f721['query'][_0x7f05('0x3d')]);_0xee4787[_0x7f05('0x3e')]=qs[_0x7f05('0x36')](_[_0x7f05('0x3f')](_0x11f721['query'],_0x22714d[_0x7f05('0x36')]),_0x3c160a);if(_0x11f721['query']['filter']){_0xee4787[_0x7f05('0x3e')]=_['merge'](_0xee4787[_0x7f05('0x3e')],{'$or':_[_0x7f05('0x2e')](_0x3c160a,function(_0xb5fa98){if(_0xb5fa98[_0x7f05('0x32')]!==_0x7f05('0x40')){var _0x53dab7={};_0x53dab7[_0xb5fa98[_0x7f05('0x2b')]]={'$like':'%'+_0x11f721[_0x7f05('0x38')][_0x7f05('0x41')]+'%'};return _0x53dab7;}})});}_0xee4787=_[_0x7f05('0x42')]({},_0xee4787,_0x11f721[_0x7f05('0x43')]);var _0x206c6f={'where':_0xee4787[_0x7f05('0x3e')]};return db[_0x7f05('0x2f')]['count'](_0x206c6f)['then'](function(_0xfd4b01){_0x23e99b[_0x7f05('0x21')]=_0xfd4b01;if(_0x11f721[_0x7f05('0x38')][_0x7f05('0x44')]){_0xee4787[_0x7f05('0x45')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x7f05('0x46')](_0xee4787);})[_0x7f05('0x28')](function(_0x38678c){_0x23e99b[_0x7f05('0x47')]=_0x38678c;return _0x23e99b;})[_0x7f05('0x28')](respondWithFilteredResult(_0x135d96,_0xee4787))[_0x7f05('0x48')](handleError(_0x135d96,null));};exports[_0x7f05('0x49')]=function(_0x5821d3,_0x5d9c79){var _0x36afa5={'raw':!![],'where':{'id':_0x5821d3[_0x7f05('0x4a')]['id']}},_0x27bc23={};_0x27bc23[_0x7f05('0x34')]=_[_0x7f05('0x35')](db[_0x7f05('0x2f')][_0x7f05('0x30')]);_0x27bc23[_0x7f05('0x38')]=_[_0x7f05('0x35')](_0x5821d3[_0x7f05('0x38')]);_0x27bc23['filters']=_[_0x7f05('0x37')](_0x27bc23[_0x7f05('0x34')],_0x27bc23[_0x7f05('0x38')]);_0x36afa5[_0x7f05('0x39')]=_[_0x7f05('0x37')](_0x27bc23['model'],qs[_0x7f05('0x3a')](_0x5821d3[_0x7f05('0x38')][_0x7f05('0x3a')]));_0x36afa5[_0x7f05('0x39')]=_0x36afa5[_0x7f05('0x39')]['length']?_0x36afa5[_0x7f05('0x39')]:_0x27bc23[_0x7f05('0x34')];if(_0x5821d3[_0x7f05('0x38')][_0x7f05('0x44')]){_0x36afa5['include']=[{'all':!![]}];}_0x36afa5=_['merge']({},_0x36afa5,_0x5821d3[_0x7f05('0x43')]);return db[_0x7f05('0x2f')][_0x7f05('0x4b')](_0x36afa5)[_0x7f05('0x28')](handleEntityNotFound(_0x5d9c79,null))[_0x7f05('0x28')](respondWithResult(_0x5d9c79,null))['catch'](handleError(_0x5d9c79,null));};exports['create']=function(_0x385a9c,_0x1a4654){return db['OpenchannelQueueReport'][_0x7f05('0x4c')](_0x385a9c[_0x7f05('0x4d')],{})[_0x7f05('0x28')](respondWithResult(_0x1a4654,0xc9))[_0x7f05('0x48')](handleError(_0x1a4654,null));};exports[_0x7f05('0x27')]=function(_0x4afa33,_0x311962){if(_0x4afa33[_0x7f05('0x4d')]['id']){delete _0x4afa33['body']['id'];}return db['OpenchannelQueueReport'][_0x7f05('0x4b')]({'where':{'id':_0x4afa33[_0x7f05('0x4a')]['id']}})[_0x7f05('0x28')](handleEntityNotFound(_0x311962,null))['then'](saveUpdates(_0x4afa33[_0x7f05('0x4d')],null))[_0x7f05('0x28')](respondWithResult(_0x311962,null))[_0x7f05('0x48')](handleError(_0x311962,null));};exports[_0x7f05('0x4e')]=function(_0x296222,_0x37eeda){return db[_0x7f05('0x2f')][_0x7f05('0x4b')]({'where':{'id':_0x296222['params']['id']}})[_0x7f05('0x28')](handleEntityNotFound(_0x37eeda,null))[_0x7f05('0x28')](removeEntity(_0x37eeda,null))['catch'](handleError(_0x37eeda,null));};exports[_0x7f05('0x4f')]=function(_0x24fc58,_0x538b55){return db['OpenchannelQueueReport']['describe']()[_0x7f05('0x28')](respondWithResult(_0x538b55,null))[_0x7f05('0x48')](handleError(_0x538b55,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6d18d88..6612195 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x30b01e,_0x1184cb){var _0x196f32=function(_0x2939ba){while(--_0x2939ba){_0x30b01e['push'](_0x30b01e['shift']());}};_0x196f32(++_0x1184cb);}(_0xe14b,0x93));var _0xbe14=function(_0x1d7efb,_0x11d3fd){_0x1d7efb=_0x1d7efb-0x0;var _0x435535=_0xe14b[_0x1d7efb];return _0x435535;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x42f4db,_0x2bbcc4){var _0x1b38ee=function(_0x3cba9c){while(--_0x3cba9c){_0x42f4db['push'](_0x42f4db['shift']());}};_0x1b38ee(++_0x2bbcc4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x5fc3[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 527a4cf..bb884ca 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 _0x056b=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','debug','update','body','where','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x35492f,_0x4fa275){var _0x50c524=function(_0x8d508c){while(--_0x8d508c){_0x35492f['push'](_0x35492f['shift']());}};_0x50c524(++_0x4fa275);}(_0x056b,0xb6));var _0xb056=function(_0x380eaa,_0x3380b5){_0x380eaa=_0x380eaa-0x0;var _0x576903=_0x056b[_0x380eaa];return _0x576903;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateOpenchannelQueueReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateOpenchannelQueueReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1016da){var _0x18a3f2=this;return new Promise(function(_0x341544,_0x1bd6ac){return db['OpenchannelQueueReport'][_0xb056('0x1d')](_0x1016da[_0xb056('0x1e')],{'raw':_0x1016da['options']?_0x1016da[_0xb056('0x19')][_0xb056('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x1f')]||null:null,'attributes':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x20')]||null:null,'limit':_0x1016da['options']?_0x1016da[_0xb056('0x19')]['limit']||null:null})[_0xb056('0x1b')](function(_0x9c6f4a){logger[_0xb056('0xc')]('UpdateOpenchannelQueueReport',_0x1016da);logger[_0xb056('0x1c')](_0xb056('0x21'),_0x1016da,JSON['stringify'](_0x9c6f4a));_0x341544(_0x9c6f4a);})[_0xb056('0x15')](function(_0x43aa63){logger[_0xb056('0x11')](_0xb056('0x21'),_0x43aa63[_0xb056('0x13')],_0x1016da);_0x1bd6ac(_0x18a3f2['error'](0x1f4,_0x43aa63[_0xb056('0x13')]));});});}; \ No newline at end of file +var _0xd290=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug'];(function(_0x5ab98c,_0x34e59c){var _0x5c3bed=function(_0x407fcc){while(--_0x407fcc){_0x5ab98c['push'](_0x5ab98c['shift']());}};_0x5c3bed(++_0x34e59c);}(_0xd290,0x165));var _0x0d29=function(_0x57cbf6,_0x414bc7){_0x57cbf6=_0x57cbf6-0x0;var _0xf168dc=_0xd290[_0x57cbf6];return _0xf168dc;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var moment=require('moment');var BPromise=require(_0x0d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d29('0x3'))['db'];var utils=require(_0x0d29('0x4'));var logger=require(_0x0d29('0x5'))(_0x0d29('0x6'));var config=require(_0x0d29('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0d29('0x8')][_0x0d29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151d32,_0x376d19,_0x276aeb){return new BPromise(function(_0x4edfcd,_0x3ee63c){return client[_0x0d29('0xa')](_0x151d32,_0x276aeb)[_0x0d29('0xb')](function(_0x4b876e){logger[_0x0d29('0xc')](_0x0d29('0xd'),_0x376d19,'request\x20sent');logger[_0x0d29('0xe')](_0x0d29('0xf'),_0x376d19,'request\x20sent',JSON[_0x0d29('0x10')](_0x4b876e));if(_0x4b876e['error']){if(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x12')]===0x1f4){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x3ee63c(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x13')]);}logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x4edfcd(_0x4b876e['error']['message']);}else{logger[_0x0d29('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x376d19,_0x0d29('0x14'));_0x4edfcd(_0x4b876e['result'][_0x0d29('0x13')]);}})[_0x0d29('0x15')](function(_0x2a04d6){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x2a04d6);_0x3ee63c(_0x2a04d6);});});}exports[_0x0d29('0x16')]=function(_0x488fa2){var _0x319a36=this;return new Promise(function(_0x2600b3,_0xca30af){return db[_0x0d29('0x17')][_0x0d29('0x18')](_0x488fa2[_0x0d29('0x19')],{'raw':_0x488fa2[_0x0d29('0x1a')]?_0x488fa2['options'][_0x0d29('0x1b')]===undefined?!![]:![]:!![]})[_0x0d29('0xb')](function(_0x215cd7){logger[_0x0d29('0xc')](_0x0d29('0x16'),_0x488fa2);logger[_0x0d29('0xe')](_0x0d29('0x16'),_0x488fa2,JSON[_0x0d29('0x10')](_0x215cd7));_0x2600b3(_0x215cd7);})[_0x0d29('0x15')](function(_0xed8228){logger[_0x0d29('0x11')](_0x0d29('0x16'),_0xed8228[_0x0d29('0x13')],_0x488fa2);_0xca30af(_0x319a36['error'](0x1f4,_0xed8228[_0x0d29('0x13')]));});});};exports[_0x0d29('0x1c')]=function(_0x2f0fe2){var _0xd3afa0=this;return new Promise(function(_0x4adc85,_0x249205){return db[_0x0d29('0x17')][_0x0d29('0x1d')](_0x2f0fe2[_0x0d29('0x19')],{'raw':_0x2f0fe2[_0x0d29('0x1a')]?_0x2f0fe2[_0x0d29('0x1a')][_0x0d29('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f0fe2['options']?_0x2f0fe2['options'][_0x0d29('0x1e')]||null:null,'attributes':_0x2f0fe2['options']?_0x2f0fe2[_0x0d29('0x1a')]['attributes']||null:null,'limit':_0x2f0fe2['options']?_0x2f0fe2[_0x0d29('0x1a')]['limit']||null:null})[_0x0d29('0xb')](function(_0x5c197f){logger[_0x0d29('0xc')](_0x0d29('0x1c'),_0x2f0fe2);logger['debug'](_0x0d29('0x1c'),_0x2f0fe2,JSON[_0x0d29('0x10')](_0x5c197f));_0x4adc85(_0x5c197f);})[_0x0d29('0x15')](function(_0x58caa6){logger[_0x0d29('0x11')](_0x0d29('0x1c'),_0x58caa6[_0x0d29('0x13')],_0x2f0fe2);_0x249205(_0xd3afa0[_0x0d29('0x11')](0x1f4,_0x58caa6[_0x0d29('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 502d440..0cd6b6f 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 _0x1b14=['fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xeead8a,_0x3d2400){var _0x24742c=function(_0x1e357a){while(--_0x1e357a){_0xeead8a['push'](_0xeead8a['shift']());}};_0x24742c(++_0x3d2400);}(_0x1b14,0x13a));var _0x41b1=function(_0x299c41,_0x55d04a){_0x299c41=_0x299c41-0x0;var _0x16278f=_0x1b14[_0x299c41];return _0x16278f;};'use strict';var multer=require(_0x41b1('0x0'));var util=require(_0x41b1('0x1'));var path=require(_0x41b1('0x2'));var timeout=require(_0x41b1('0x3'));var express=require(_0x41b1('0x4'));var router=express[_0x41b1('0x5')]();var fs_extra=require(_0x41b1('0x6'));var auth=require(_0x41b1('0x7'));var interaction=require(_0x41b1('0x8'));var config=require('../../config/environment');var controller=require(_0x41b1('0x9'));router[_0x41b1('0xa')]('/',auth[_0x41b1('0xb')](),controller[_0x41b1('0xc')]);router[_0x41b1('0xa')](_0x41b1('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x41b1('0xa')](_0x41b1('0xe'),auth[_0x41b1('0xb')](),controller[_0x41b1('0xf')]);router[_0x41b1('0x10')]('/',auth['isAuthenticated'](),controller[_0x41b1('0x11')]);router['put'](_0x41b1('0xe'),auth[_0x41b1('0xb')](),controller[_0x41b1('0x12')]);router['delete']('/:id',auth[_0x41b1('0xb')](),controller['destroy']);module[_0x41b1('0x13')]=router; \ No newline at end of file +var _0x1b9b=['update','delete','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x1bf749,_0x120201){var _0x5f0db9=function(_0x6cdc2b){while(--_0x6cdc2b){_0x1bf749['push'](_0x1bf749['shift']());}};_0x5f0db9(++_0x120201);}(_0x1b9b,0xd2));var _0xb1b9=function(_0x4c9c2b,_0x286b4c){_0x4c9c2b=_0x4c9c2b-0x0;var _0x246768=_0x1b9b[_0x4c9c2b];return _0x246768;};'use strict';var multer=require(_0xb1b9('0x0'));var util=require(_0xb1b9('0x1'));var path=require('path');var timeout=require(_0xb1b9('0x2'));var express=require(_0xb1b9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb1b9('0x4'));var interaction=require(_0xb1b9('0x5'));var config=require('../../config/environment');var controller=require(_0xb1b9('0x6'));router[_0xb1b9('0x7')]('/',auth[_0xb1b9('0x8')](),controller['index']);router['get'](_0xb1b9('0x9'),auth[_0xb1b9('0x8')](),controller[_0xb1b9('0xa')]);router[_0xb1b9('0x7')](_0xb1b9('0xb'),auth['isAuthenticated'](),controller[_0xb1b9('0xc')]);router[_0xb1b9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xb1b9('0x8')](),controller[_0xb1b9('0xe')]);router[_0xb1b9('0xf')](_0xb1b9('0xb'),auth[_0xb1b9('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 2baa87f..6aa7537 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1e5822,_0x5e6982){var _0x28e980=function(_0x22042f){while(--_0x22042f){_0x1e5822['push'](_0x1e5822['shift']());}};_0x28e980(++_0x5e6982);}(_0xaa88,0x137));var _0x8aa8=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xaa88[_0x50aa2e];return _0x5e07f0;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4dd1a0,_0x2786d7){var _0x1941e0=function(_0x4bbf79){while(--_0x4bbf79){_0x4dd1a0['push'](_0x4dd1a0['shift']());}};_0x1941e0(++_0x2786d7);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index f566d23..5f2ee84 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 _0xbcfe=['create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','sendStatus','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','find'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xbcfe,0x128));var _0xebcf=function(_0x2107ec,_0x8f84c5){_0x2107ec=_0x2107ec-0x0;var _0x590d22=_0xbcfe[_0x2107ec];return _0x590d22;};'use strict';var emlformat=require(_0xebcf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebcf('0x1'));var jsonpatch=require(_0xebcf('0x2'));var rp=require(_0xebcf('0x3'));var moment=require(_0xebcf('0x4'));var BPromise=require(_0xebcf('0x5'));var Mustache=require(_0xebcf('0x6'));var util=require('util');var path=require(_0xebcf('0x7'));var sox=require('sox');var csv=require(_0xebcf('0x8'));var ejs=require(_0xebcf('0x9'));var fs=require('fs');var fs_extra=require(_0xebcf('0xa'));var _=require(_0xebcf('0xb'));var squel=require('squel');var crypto=require(_0xebcf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xebcf('0xd'));var toCsv=require(_0xebcf('0x8'));var querystring=require(_0xebcf('0xe'));var Papa=require(_0xebcf('0xf'));var Redis=require(_0xebcf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xebcf('0x11'));var as=require(_0xebcf('0x12'));var hardwareService=require(_0xebcf('0x13'));var logger=require(_0xebcf('0x14'))(_0xebcf('0x15'));var utils=require('../../config/utils');var config=require(_0xebcf('0x16'));var licenseUtil=require(_0xebcf('0x17'));var db=require(_0xebcf('0x18'))['db'];function respondWithStatusCode(_0x48a2a7,_0x268773){_0x268773=_0x268773||0xcc;return function(_0x13cff6){if(_0x13cff6){return _0x48a2a7['sendStatus'](_0x268773);}return _0x48a2a7[_0xebcf('0x19')](_0x268773)[_0xebcf('0x1a')]();};}function respondWithResult(_0x4415cc,_0x3b6b85){_0x3b6b85=_0x3b6b85||0xc8;return function(_0x4d482d){if(_0x4d482d){return _0x4415cc['status'](_0x3b6b85)[_0xebcf('0x1b')](_0x4d482d);}};}function respondWithFilteredResult(_0x48a91b,_0x458f50){return function(_0x3b034a){if(_0x3b034a){var _0x5de4dc=typeof _0x458f50['offset']===_0xebcf('0x1c')&&typeof _0x458f50[_0xebcf('0x1d')]===_0xebcf('0x1c');var _0x553a06=_0x3b034a[_0xebcf('0x1e')];var _0x40cb59=_0x5de4dc?0x0:_0x458f50[_0xebcf('0x1f')];var _0xf4fbde=_0x5de4dc?_0x3b034a[_0xebcf('0x1e')]:_0x458f50[_0xebcf('0x1f')]+_0x458f50[_0xebcf('0x1d')];var _0x5ce075;if(_0xf4fbde>=_0x553a06){_0xf4fbde=_0x553a06;_0x5ce075=0xc8;}else{_0x5ce075=0xce;}_0x48a91b['status'](_0x5ce075);return _0x48a91b[_0xebcf('0x20')]('Content-Range',_0x40cb59+'-'+_0xf4fbde+'/'+_0x553a06)[_0xebcf('0x1b')](_0x3b034a);}return null;};}function patchUpdates(_0x1ac39f){return function(_0x30e253){try{jsonpatch[_0xebcf('0x21')](_0x30e253,_0x1ac39f,!![]);}catch(_0x15b2f9){return BPromise[_0xebcf('0x22')](_0x15b2f9);}return _0x30e253[_0xebcf('0x23')]();};}function saveUpdates(_0x5454a3,_0x501729){return function(_0x55d84b){if(_0x55d84b){return _0x55d84b[_0xebcf('0x24')](_0x5454a3)[_0xebcf('0x25')](function(_0x402893){return _0x402893;});}return null;};}function removeEntity(_0x447dec,_0x116f56){return function(_0x331d49){if(_0x331d49){return _0x331d49['destroy']()['then'](function(){_0x447dec[_0xebcf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e3dcf,_0x5e6729){return function(_0x22478b){if(!_0x22478b){_0x3e3dcf[_0xebcf('0x26')](0x194);}return _0x22478b;};}function handleError(_0x59522a,_0x3bd465){_0x3bd465=_0x3bd465||0x1f4;return function(_0x585e03){logger['error'](_0x585e03[_0xebcf('0x27')]);if(_0x585e03['name']){delete _0x585e03[_0xebcf('0x28')];}_0x59522a['status'](_0x3bd465)[_0xebcf('0x29')](_0x585e03);};}exports['index']=function(_0x291950,_0x3fa52a){var _0x42f7e9={},_0xa7f76={},_0x1df3e0={'count':0x0,'rows':[]};var _0x2490f2=_[_0xebcf('0x2a')](db[_0xebcf('0x2b')][_0xebcf('0x2c')],function(_0x50ebf7){return{'name':_0x50ebf7[_0xebcf('0x2d')],'type':_0x50ebf7['type'][_0xebcf('0x2e')]};});_0xa7f76[_0xebcf('0x2f')]=_['map'](_0x2490f2,_0xebcf('0x28'));_0xa7f76[_0xebcf('0x30')]=_[_0xebcf('0x31')](_0x291950[_0xebcf('0x30')]);_0xa7f76[_0xebcf('0x32')]=_[_0xebcf('0x33')](_0xa7f76['model'],_0xa7f76[_0xebcf('0x30')]);_0x42f7e9[_0xebcf('0x34')]=_[_0xebcf('0x33')](_0xa7f76[_0xebcf('0x2f')],qs[_0xebcf('0x35')](_0x291950['query']['fields']));_0x42f7e9[_0xebcf('0x34')]=_0x42f7e9['attributes'][_0xebcf('0x36')]?_0x42f7e9['attributes']:_0xa7f76[_0xebcf('0x2f')];if(!_0x291950[_0xebcf('0x30')]['hasOwnProperty'](_0xebcf('0x37'))){_0x42f7e9[_0xebcf('0x1d')]=qs['limit'](_0x291950['query']['limit']);_0x42f7e9[_0xebcf('0x1f')]=qs[_0xebcf('0x1f')](_0x291950['query'][_0xebcf('0x1f')]);}_0x42f7e9[_0xebcf('0x38')]=qs[_0xebcf('0x39')](_0x291950[_0xebcf('0x30')][_0xebcf('0x39')]);_0x42f7e9[_0xebcf('0x3a')]=qs[_0xebcf('0x32')](_[_0xebcf('0x3b')](_0x291950['query'],_0xa7f76[_0xebcf('0x32')]),_0x2490f2);if(_0x291950[_0xebcf('0x30')][_0xebcf('0x3c')]){_0x42f7e9[_0xebcf('0x3a')]=_[_0xebcf('0x3d')](_0x42f7e9['where'],{'$or':_[_0xebcf('0x2a')](_0x2490f2,function(_0x29a1af){if(_0x29a1af['type']!==_0xebcf('0x3e')){var _0x140df4={};_0x140df4[_0x29a1af['name']]={'$like':'%'+_0x291950[_0xebcf('0x30')]['filter']+'%'};return _0x140df4;}})});}_0x42f7e9=_[_0xebcf('0x3d')]({},_0x42f7e9,_0x291950[_0xebcf('0x3f')]);var _0x3ac320={'where':_0x42f7e9['where']};return db[_0xebcf('0x2b')][_0xebcf('0x1e')](_0x3ac320)[_0xebcf('0x25')](function(_0x54a19b){_0x1df3e0['count']=_0x54a19b;if(_0x291950['query']['includeAll']){_0x42f7e9['include']=[{'all':!![]}];}return db[_0xebcf('0x2b')][_0xebcf('0x40')](_0x42f7e9);})['then'](function(_0x9325f6){_0x1df3e0[_0xebcf('0x41')]=_0x9325f6;return _0x1df3e0;})[_0xebcf('0x25')](respondWithFilteredResult(_0x3fa52a,_0x42f7e9))[_0xebcf('0x42')](handleError(_0x3fa52a,null));};exports['show']=function(_0xfd9552,_0xdf1286){var _0x35a7f8={'raw':!![],'where':{'id':_0xfd9552[_0xebcf('0x43')]['id']}},_0x4b3f22={};_0x4b3f22['model']=_['keys'](db[_0xebcf('0x2b')]['rawAttributes']);_0x4b3f22[_0xebcf('0x30')]=_[_0xebcf('0x31')](_0xfd9552['query']);_0x4b3f22['filters']=_[_0xebcf('0x33')](_0x4b3f22['model'],_0x4b3f22['query']);_0x35a7f8[_0xebcf('0x34')]=_[_0xebcf('0x33')](_0x4b3f22[_0xebcf('0x2f')],qs['fields'](_0xfd9552[_0xebcf('0x30')]['fields']));_0x35a7f8[_0xebcf('0x34')]=_0x35a7f8['attributes']['length']?_0x35a7f8[_0xebcf('0x34')]:_0x4b3f22[_0xebcf('0x2f')];if(_0xfd9552[_0xebcf('0x30')]['includeAll']){_0x35a7f8['include']=[{'all':!![]}];}_0x35a7f8=_['merge']({},_0x35a7f8,_0xfd9552[_0xebcf('0x3f')]);return db[_0xebcf('0x2b')][_0xebcf('0x44')](_0x35a7f8)['then'](handleEntityNotFound(_0xdf1286,null))['then'](respondWithResult(_0xdf1286,null))[_0xebcf('0x42')](handleError(_0xdf1286,null));};exports['create']=function(_0x377fb3,_0x541cd){return db[_0xebcf('0x2b')][_0xebcf('0x45')](_0x377fb3[_0xebcf('0x46')],{})[_0xebcf('0x25')](respondWithResult(_0x541cd,0xc9))['catch'](handleError(_0x541cd,null));};exports['update']=function(_0x26f014,_0x1ca4be){if(_0x26f014[_0xebcf('0x46')]['id']){delete _0x26f014[_0xebcf('0x46')]['id'];}return db['OpenchannelTransferReport'][_0xebcf('0x44')]({'where':{'id':_0x26f014[_0xebcf('0x43')]['id']}})[_0xebcf('0x25')](handleEntityNotFound(_0x1ca4be,null))[_0xebcf('0x25')](saveUpdates(_0x26f014['body'],null))['then'](respondWithResult(_0x1ca4be,null))[_0xebcf('0x42')](handleError(_0x1ca4be,null));};exports[_0xebcf('0x47')]=function(_0x1870bc,_0x2814f7){return db[_0xebcf('0x2b')]['find']({'where':{'id':_0x1870bc[_0xebcf('0x43')]['id']}})[_0xebcf('0x25')](handleEntityNotFound(_0x2814f7,null))[_0xebcf('0x25')](removeEntity(_0x2814f7,null))[_0xebcf('0x42')](handleError(_0x2814f7,null));};exports[_0xebcf('0x48')]=function(_0x4398f8,_0x27bdfd){return db[_0xebcf('0x2b')]['describe']()[_0xebcf('0x25')](respondWithResult(_0x27bdfd,null))[_0xebcf('0x42')](handleError(_0x27bdfd,null));}; \ No newline at end of file +var _0xd687=['undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','nolimit','limit','sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','include','rows','show','params','length','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset'];(function(_0x93d359,_0x133e38){var _0x3a9524=function(_0x546aa0){while(--_0x546aa0){_0x93d359['push'](_0x93d359['shift']());}};_0x3a9524(++_0x133e38);}(_0xd687,0x1e5));var _0x7d68=function(_0x1dc8ce,_0x46f0a2){_0x1dc8ce=_0x1dc8ce-0x0;var _0xc1fadd=_0xd687[_0x1dc8ce];return _0xc1fadd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d68('0x0'));var zipdir=require(_0x7d68('0x1'));var jsonpatch=require(_0x7d68('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d68('0x3'));var Mustache=require(_0x7d68('0x4'));var util=require(_0x7d68('0x5'));var path=require(_0x7d68('0x6'));var sox=require(_0x7d68('0x7'));var csv=require(_0x7d68('0x8'));var ejs=require(_0x7d68('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d68('0xa'));var squel=require(_0x7d68('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d68('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7d68('0x8'));var querystring=require(_0x7d68('0xd'));var Papa=require(_0x7d68('0xe'));var Redis=require(_0x7d68('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7d68('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d68('0x11'));var logger=require(_0x7d68('0x12'))(_0x7d68('0x13'));var utils=require(_0x7d68('0x14'));var config=require(_0x7d68('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26e579,_0x4ad189){_0x4ad189=_0x4ad189||0xcc;return function(_0x326714){if(_0x326714){return _0x26e579[_0x7d68('0x16')](_0x4ad189);}return _0x26e579[_0x7d68('0x17')](_0x4ad189)['end']();};}function respondWithResult(_0x5800b5,_0x12fe79){_0x12fe79=_0x12fe79||0xc8;return function(_0x1b785c){if(_0x1b785c){return _0x5800b5[_0x7d68('0x17')](_0x12fe79)[_0x7d68('0x18')](_0x1b785c);}};}function respondWithFilteredResult(_0x5bdfd5,_0x69e5e0){return function(_0x2e31b1){if(_0x2e31b1){var _0x3a7d7e=typeof _0x69e5e0[_0x7d68('0x19')]===_0x7d68('0x1a')&&typeof _0x69e5e0['limit']===_0x7d68('0x1a');var _0x3f988b=_0x2e31b1[_0x7d68('0x1b')];var _0x3caae6=_0x3a7d7e?0x0:_0x69e5e0['offset'];var _0x291966=_0x3a7d7e?_0x2e31b1[_0x7d68('0x1b')]:_0x69e5e0[_0x7d68('0x19')]+_0x69e5e0['limit'];var _0x25cd9d;if(_0x291966>=_0x3f988b){_0x291966=_0x3f988b;_0x25cd9d=0xc8;}else{_0x25cd9d=0xce;}_0x5bdfd5['status'](_0x25cd9d);return _0x5bdfd5[_0x7d68('0x1c')](_0x7d68('0x1d'),_0x3caae6+'-'+_0x291966+'/'+_0x3f988b)[_0x7d68('0x18')](_0x2e31b1);}return null;};}function patchUpdates(_0x3851b8){return function(_0x3b9b2c){try{jsonpatch[_0x7d68('0x1e')](_0x3b9b2c,_0x3851b8,!![]);}catch(_0x2d2c7c){return BPromise['reject'](_0x2d2c7c);}return _0x3b9b2c[_0x7d68('0x1f')]();};}function saveUpdates(_0x1b7479,_0x2bb8a4){return function(_0x3d1efc){if(_0x3d1efc){return _0x3d1efc[_0x7d68('0x20')](_0x1b7479)[_0x7d68('0x21')](function(_0x3e0d94){return _0x3e0d94;});}return null;};}function removeEntity(_0x3f4830,_0x4371bc){return function(_0x5f1bfe){if(_0x5f1bfe){return _0x5f1bfe[_0x7d68('0x22')]()[_0x7d68('0x21')](function(){_0x3f4830[_0x7d68('0x17')](0xcc)[_0x7d68('0x23')]();});}};}function handleEntityNotFound(_0x42f5de,_0x2aee51){return function(_0x4abbdc){if(!_0x4abbdc){_0x42f5de['sendStatus'](0x194);}return _0x4abbdc;};}function handleError(_0x3536df,_0x34615a){_0x34615a=_0x34615a||0x1f4;return function(_0x581290){logger[_0x7d68('0x24')](_0x581290[_0x7d68('0x25')]);if(_0x581290[_0x7d68('0x26')]){delete _0x581290['name'];}_0x3536df['status'](_0x34615a)[_0x7d68('0x27')](_0x581290);};}exports[_0x7d68('0x28')]=function(_0x23633b,_0x3bc2a3){var _0x107535={},_0x4e26a7={},_0x38a8fe={'count':0x0,'rows':[]};var _0x2e03e7=_[_0x7d68('0x29')](db[_0x7d68('0x2a')][_0x7d68('0x2b')],function(_0x5d4f59){return{'name':_0x5d4f59['fieldName'],'type':_0x5d4f59[_0x7d68('0x2c')][_0x7d68('0x2d')]};});_0x4e26a7[_0x7d68('0x2e')]=_[_0x7d68('0x29')](_0x2e03e7,_0x7d68('0x26'));_0x4e26a7['query']=_[_0x7d68('0x2f')](_0x23633b[_0x7d68('0x30')]);_0x4e26a7['filters']=_[_0x7d68('0x31')](_0x4e26a7[_0x7d68('0x2e')],_0x4e26a7[_0x7d68('0x30')]);_0x107535[_0x7d68('0x32')]=_[_0x7d68('0x31')](_0x4e26a7[_0x7d68('0x2e')],qs[_0x7d68('0x33')](_0x23633b[_0x7d68('0x30')][_0x7d68('0x33')]));_0x107535['attributes']=_0x107535[_0x7d68('0x32')]['length']?_0x107535[_0x7d68('0x32')]:_0x4e26a7[_0x7d68('0x2e')];if(!_0x23633b[_0x7d68('0x30')]['hasOwnProperty'](_0x7d68('0x34'))){_0x107535['limit']=qs[_0x7d68('0x35')](_0x23633b[_0x7d68('0x30')][_0x7d68('0x35')]);_0x107535[_0x7d68('0x19')]=qs[_0x7d68('0x19')](_0x23633b[_0x7d68('0x30')][_0x7d68('0x19')]);}_0x107535['order']=qs[_0x7d68('0x36')](_0x23633b[_0x7d68('0x30')]['sort']);_0x107535['where']=qs[_0x7d68('0x37')](_[_0x7d68('0x38')](_0x23633b[_0x7d68('0x30')],_0x4e26a7[_0x7d68('0x37')]),_0x2e03e7);if(_0x23633b[_0x7d68('0x30')][_0x7d68('0x39')]){_0x107535['where']=_[_0x7d68('0x3a')](_0x107535['where'],{'$or':_[_0x7d68('0x29')](_0x2e03e7,function(_0x551283){if(_0x551283[_0x7d68('0x2c')]!==_0x7d68('0x3b')){var _0x399d34={};_0x399d34[_0x551283[_0x7d68('0x26')]]={'$like':'%'+_0x23633b['query']['filter']+'%'};return _0x399d34;}})});}_0x107535=_['merge']({},_0x107535,_0x23633b['options']);var _0x4f3c01={'where':_0x107535[_0x7d68('0x3c')]};return db[_0x7d68('0x2a')]['count'](_0x4f3c01)[_0x7d68('0x21')](function(_0x1d124b){_0x38a8fe[_0x7d68('0x1b')]=_0x1d124b;if(_0x23633b['query'][_0x7d68('0x3d')]){_0x107535[_0x7d68('0x3e')]=[{'all':!![]}];}return db[_0x7d68('0x2a')]['findAll'](_0x107535);})[_0x7d68('0x21')](function(_0x54f40d){_0x38a8fe[_0x7d68('0x3f')]=_0x54f40d;return _0x38a8fe;})[_0x7d68('0x21')](respondWithFilteredResult(_0x3bc2a3,_0x107535))['catch'](handleError(_0x3bc2a3,null));};exports[_0x7d68('0x40')]=function(_0x412f8a,_0x46aa35){var _0x50b920={'raw':!![],'where':{'id':_0x412f8a[_0x7d68('0x41')]['id']}},_0x3e9b89={};_0x3e9b89['model']=_[_0x7d68('0x2f')](db['OpenchannelTransferReport']['rawAttributes']);_0x3e9b89['query']=_[_0x7d68('0x2f')](_0x412f8a[_0x7d68('0x30')]);_0x3e9b89[_0x7d68('0x37')]=_[_0x7d68('0x31')](_0x3e9b89[_0x7d68('0x2e')],_0x3e9b89[_0x7d68('0x30')]);_0x50b920[_0x7d68('0x32')]=_[_0x7d68('0x31')](_0x3e9b89[_0x7d68('0x2e')],qs[_0x7d68('0x33')](_0x412f8a[_0x7d68('0x30')][_0x7d68('0x33')]));_0x50b920[_0x7d68('0x32')]=_0x50b920[_0x7d68('0x32')][_0x7d68('0x42')]?_0x50b920[_0x7d68('0x32')]:_0x3e9b89[_0x7d68('0x2e')];if(_0x412f8a['query'][_0x7d68('0x3d')]){_0x50b920['include']=[{'all':!![]}];}_0x50b920=_[_0x7d68('0x3a')]({},_0x50b920,_0x412f8a[_0x7d68('0x43')]);return db[_0x7d68('0x2a')][_0x7d68('0x44')](_0x50b920)[_0x7d68('0x21')](handleEntityNotFound(_0x46aa35,null))['then'](respondWithResult(_0x46aa35,null))[_0x7d68('0x45')](handleError(_0x46aa35,null));};exports[_0x7d68('0x46')]=function(_0x4175b8,_0x242d8b){return db[_0x7d68('0x2a')][_0x7d68('0x46')](_0x4175b8[_0x7d68('0x47')],{})[_0x7d68('0x21')](respondWithResult(_0x242d8b,0xc9))[_0x7d68('0x45')](handleError(_0x242d8b,null));};exports[_0x7d68('0x20')]=function(_0x3bbd6e,_0x4530c2){if(_0x3bbd6e[_0x7d68('0x47')]['id']){delete _0x3bbd6e[_0x7d68('0x47')]['id'];}return db[_0x7d68('0x2a')][_0x7d68('0x44')]({'where':{'id':_0x3bbd6e[_0x7d68('0x41')]['id']}})[_0x7d68('0x21')](handleEntityNotFound(_0x4530c2,null))[_0x7d68('0x21')](saveUpdates(_0x3bbd6e['body'],null))[_0x7d68('0x21')](respondWithResult(_0x4530c2,null))['catch'](handleError(_0x4530c2,null));};exports[_0x7d68('0x22')]=function(_0xf6a86b,_0x12700b){return db[_0x7d68('0x2a')][_0x7d68('0x44')]({'where':{'id':_0xf6a86b[_0x7d68('0x41')]['id']}})[_0x7d68('0x21')](handleEntityNotFound(_0x12700b,null))['then'](removeEntity(_0x12700b,null))[_0x7d68('0x45')](handleError(_0x12700b,null));};exports['describe']=function(_0x277c70,_0x5e942e){return db[_0x7d68('0x2a')][_0x7d68('0x48')]()[_0x7d68('0x21')](respondWithResult(_0x5e942e,null))[_0x7d68('0x45')](handleError(_0x5e942e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 83687c1..580c07a 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 _0x5d7d=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x5d7d,0x99));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d7('0x0'));var util=require(_0xd5d7('0x1'));var logger=require(_0xd5d7('0x2'))(_0xd5d7('0x3'));var moment=require('moment');var BPromise=require(_0xd5d7('0x4'));var rp=require(_0xd5d7('0x5'));var fs=require('fs');var path=require(_0xd5d7('0x6'));var rimraf=require(_0xd5d7('0x7'));var config=require(_0xd5d7('0x8'));var attributes=require(_0xd5d7('0x9'));module[_0xd5d7('0xa')]=function(_0x269190,_0x1a9dcc){return _0x269190['define'](_0xd5d7('0xb'),attributes,{'tableName':_0xd5d7('0xc'),'paranoid':![],'indexes':[{'name':_0xd5d7('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c35=['exports','define','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x8c35,0x153));var _0x58c3=function(_0x3059bd,_0x1edc9b){_0x3059bd=_0x3059bd-0x0;var _0xa294b=_0x8c35[_0x3059bd];return _0xa294b;};'use strict';var _=require(_0x58c3('0x0'));var util=require(_0x58c3('0x1'));var logger=require(_0x58c3('0x2'))(_0x58c3('0x3'));var moment=require('moment');var BPromise=require(_0x58c3('0x4'));var rp=require(_0x58c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58c3('0x6'));var config=require(_0x58c3('0x7'));var attributes=require(_0x58c3('0x8'));module[_0x58c3('0x9')]=function(_0x1de548,_0x54de75){return _0x1de548[_0x58c3('0xa')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x58c3('0xb'),'fields':[_0x58c3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index c5bc4af..cf98288 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 _0x0ec6=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2e899f,_0x38db30){var _0x389a48=function(_0x11cdbc){while(--_0x11cdbc){_0x2e899f['push'](_0x2e899f['shift']());}};_0x389a48(++_0x38db30);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x572ae6,_0x1159b5){_0x572ae6=_0x572ae6-0x0;var _0xab9b10=_0x0ec6[_0x572ae6];return _0xab9b10;};'use strict';var _=require(_0x60ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60ec('0x1'));var rs=require(_0x60ec('0x2'));var fs=require('fs');var Redis=require(_0x60ec('0x3'));var db=require(_0x60ec('0x4'))['db'];var utils=require(_0x60ec('0x5'));var logger=require(_0x60ec('0x6'))(_0x60ec('0x7'));var config=require('../../config/environment');var jayson=require(_0x60ec('0x8'));var client=jayson[_0x60ec('0x9')][_0x60ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x74adc4,_0x5d4cba,_0xcb974c){return new BPromise(function(_0x488ab8,_0x2c4a14){return client[_0x60ec('0xb')](_0x74adc4,_0xcb974c)[_0x60ec('0xc')](function(_0x1363c2){logger[_0x60ec('0xd')](_0x60ec('0xe'),_0x5d4cba,'request\x20sent');logger['debug'](_0x60ec('0xf'),_0x5d4cba,_0x60ec('0x10'),JSON[_0x60ec('0x11')](_0x1363c2));if(_0x1363c2[_0x60ec('0x12')]){if(_0x1363c2[_0x60ec('0x12')]['code']===0x1f4){logger['error'](_0x60ec('0xe'),_0x5d4cba,_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);return _0x2c4a14(_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);}logger['error'](_0x60ec('0xe'),_0x5d4cba,_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);return _0x488ab8(_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);}else{logger[_0x60ec('0xd')](_0x60ec('0xe'),_0x5d4cba,_0x60ec('0x10'));_0x488ab8(_0x1363c2[_0x60ec('0x14')]['message']);}})[_0x60ec('0x15')](function(_0x2778dd){logger[_0x60ec('0x12')](_0x60ec('0xe'),_0x5d4cba,_0x2778dd);_0x2c4a14(_0x2778dd);});});} \ No newline at end of file +var _0x294b=['jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x468fa5,_0x2062bb){var _0x1d9d6c=function(_0x4814d6){while(--_0x4814d6){_0x468fa5['push'](_0x468fa5['shift']());}};_0x1d9d6c(++_0x2062bb);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var moment=require(_0xb294('0x1'));var BPromise=require(_0xb294('0x2'));var rs=require(_0xb294('0x3'));var fs=require('fs');var Redis=require(_0xb294('0x4'));var db=require(_0xb294('0x5'))['db'];var utils=require(_0xb294('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb294('0x7'));var jayson=require(_0xb294('0x8'));var client=jayson[_0xb294('0x9')][_0xb294('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc7910,_0x509dbd,_0x39dfbf){return new BPromise(function(_0x5110aa,_0x5226a4){return client['request'](_0xcc7910,_0x39dfbf)[_0xb294('0xb')](function(_0x33f8e5){logger[_0xb294('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,'request\x20sent');logger['debug'](_0xb294('0xd'),_0x509dbd,_0xb294('0xe'),JSON[_0xb294('0xf')](_0x33f8e5));if(_0x33f8e5[_0xb294('0x10')]){if(_0x33f8e5[_0xb294('0x10')][_0xb294('0x11')]===0x1f4){logger[_0xb294('0x10')](_0xb294('0x12'),_0x509dbd,_0x33f8e5[_0xb294('0x10')][_0xb294('0x13')]);return _0x5226a4(_0x33f8e5['error']['message']);}logger[_0xb294('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,_0x33f8e5['error'][_0xb294('0x13')]);return _0x5110aa(_0x33f8e5[_0xb294('0x10')][_0xb294('0x13')]);}else{logger[_0xb294('0xc')](_0xb294('0x12'),_0x509dbd,_0xb294('0xe'));_0x5110aa(_0x33f8e5[_0xb294('0x14')][_0xb294('0x13')]);}})[_0xb294('0x15')](function(_0x289839){logger[_0xb294('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,_0x289839);_0x5226a4(_0x289839);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 60f2389..45901ee 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 _0xd1f6=['index','/:id','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated'];(function(_0x44a187,_0xb49f60){var _0x52436a=function(_0x11cc51){while(--_0x11cc51){_0x44a187['push'](_0x44a187['shift']());}};_0x52436a(++_0xb49f60);}(_0xd1f6,0x15d));var _0x6d1f=function(_0x577f1c,_0x4ebba5){_0x577f1c=_0x577f1c-0x0;var _0x363945=_0xd1f6[_0x577f1c];return _0x363945;};'use strict';var multer=require(_0x6d1f('0x0'));var util=require('util');var path=require(_0x6d1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d1f('0x2'));var router=express[_0x6d1f('0x3')]();var fs_extra=require(_0x6d1f('0x4'));var auth=require(_0x6d1f('0x5'));var interaction=require(_0x6d1f('0x6'));var config=require(_0x6d1f('0x7'));var controller=require(_0x6d1f('0x8'));router[_0x6d1f('0x9')]('/',auth[_0x6d1f('0xa')](),controller[_0x6d1f('0xb')]);router[_0x6d1f('0x9')](_0x6d1f('0xc'),auth[_0x6d1f('0xa')](),controller['show']);router[_0x6d1f('0xd')]('/',auth[_0x6d1f('0xa')](),controller[_0x6d1f('0xe')]);router[_0x6d1f('0xf')](_0x6d1f('0xc'),auth['isAuthenticated'](),controller[_0x6d1f('0x10')]);router[_0x6d1f('0x11')](_0x6d1f('0xc'),auth['isAuthenticated'](),controller[_0x6d1f('0x12')]);module[_0x6d1f('0x13')]=router; \ No newline at end of file +var _0xac33=['/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0xbc4f9f,_0x111984){var _0x3bec7d=function(_0x2f5ed7){while(--_0x2f5ed7){_0xbc4f9f['push'](_0xbc4f9f['shift']());}};_0x3bec7d(++_0x111984);}(_0xac33,0xea));var _0x3ac3=function(_0x317725,_0x1bd734){_0x317725=_0x317725-0x0;var _0x1e08cb=_0xac33[_0x317725];return _0x1e08cb;};'use strict';var multer=require(_0x3ac3('0x0'));var util=require(_0x3ac3('0x1'));var path=require(_0x3ac3('0x2'));var timeout=require(_0x3ac3('0x3'));var express=require(_0x3ac3('0x4'));var router=express['Router']();var fs_extra=require(_0x3ac3('0x5'));var auth=require(_0x3ac3('0x6'));var interaction=require(_0x3ac3('0x7'));var config=require(_0x3ac3('0x8'));var controller=require(_0x3ac3('0x9'));router[_0x3ac3('0xa')]('/',auth[_0x3ac3('0xb')](),controller[_0x3ac3('0xc')]);router[_0x3ac3('0xa')](_0x3ac3('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3ac3('0xb')](),controller[_0x3ac3('0xe')]);router[_0x3ac3('0xf')](_0x3ac3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3ac3('0x10')](_0x3ac3('0xd'),auth[_0x3ac3('0xb')](),controller[_0x3ac3('0x11')]);module[_0x3ac3('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 04a51fe..8e0a13a 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 _0xf8c6=['exports','STRING','name','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf8c6,0x167));var _0x6f8c=function(_0x4f14e3,_0x4443a7){_0x4f14e3=_0x4f14e3-0x0;var _0x1cf000=_0xf8c6[_0x4f14e3];return _0x1cf000;};'use strict';var Sequelize=require(_0x6f8c('0x0'));module[_0x6f8c('0x1')]={'name':{'type':Sequelize[_0x6f8c('0x2')],'unique':_0x6f8c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6f8c('0x2')]}}; \ No newline at end of file +var _0x821c=['name','STRING','sequelize'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x821c,0x12b));var _0xc821=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0x821c[_0x1ca93c];return _0x185169;};'use strict';var Sequelize=require(_0xc821('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc821('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc821('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f76693a..0ff2064 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 _0x30d1=['then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','map','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x5ed46a,_0x1ed3bd){var _0x2eebd3=function(_0x4d3073){while(--_0x4d3073){_0x5ed46a['push'](_0x5ed46a['shift']());}};_0x2eebd3(++_0x1ed3bd);}(_0x30d1,0xc0));var _0x130d=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x30d1[_0x6ca7f4];return _0x494fa6;};'use strict';var emlformat=require(_0x130d('0x0'));var rimraf=require(_0x130d('0x1'));var zipdir=require(_0x130d('0x2'));var jsonpatch=require(_0x130d('0x3'));var rp=require(_0x130d('0x4'));var moment=require('moment');var BPromise=require(_0x130d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x130d('0x6'));var csv=require(_0x130d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x130d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x130d('0x9'));var jsforce=require(_0x130d('0xa'));var deskjs=require(_0x130d('0xb'));var toCsv=require(_0x130d('0x7'));var querystring=require('querystring');var Papa=require(_0x130d('0xc'));var Redis=require('ioredis');var authService=require(_0x130d('0xd'));var qs=require(_0x130d('0xe'));var as=require(_0x130d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x130d('0x10'));var utils=require('../../config/utils');var config=require(_0x130d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x130d('0x12'))['db'];function respondWithStatusCode(_0x1c75be,_0x3b6538){_0x3b6538=_0x3b6538||0xcc;return function(_0x227a6d){if(_0x227a6d){return _0x1c75be[_0x130d('0x13')](_0x3b6538);}return _0x1c75be[_0x130d('0x14')](_0x3b6538)[_0x130d('0x15')]();};}function respondWithResult(_0x553389,_0x3a6c42){_0x3a6c42=_0x3a6c42||0xc8;return function(_0x93ef84){if(_0x93ef84){return _0x553389['status'](_0x3a6c42)['json'](_0x93ef84);}};}function respondWithFilteredResult(_0x1ebc7b,_0x322c3d){return function(_0x4ac050){if(_0x4ac050){var _0x23894a=typeof _0x322c3d[_0x130d('0x16')]===_0x130d('0x17')&&typeof _0x322c3d[_0x130d('0x18')]===_0x130d('0x17');var _0x12f051=_0x4ac050[_0x130d('0x19')];var _0xe5bcb9=_0x23894a?0x0:_0x322c3d[_0x130d('0x16')];var _0x20ccb7=_0x23894a?_0x4ac050[_0x130d('0x19')]:_0x322c3d['offset']+_0x322c3d[_0x130d('0x18')];var _0x5622e0;if(_0x20ccb7>=_0x12f051){_0x20ccb7=_0x12f051;_0x5622e0=0xc8;}else{_0x5622e0=0xce;}_0x1ebc7b[_0x130d('0x14')](_0x5622e0);return _0x1ebc7b['set'](_0x130d('0x1a'),_0xe5bcb9+'-'+_0x20ccb7+'/'+_0x12f051)['json'](_0x4ac050);}return null;};}function patchUpdates(_0x2d3eaa){return function(_0x192acb){try{jsonpatch[_0x130d('0x1b')](_0x192acb,_0x2d3eaa,!![]);}catch(_0xd1a560){return BPromise[_0x130d('0x1c')](_0xd1a560);}return _0x192acb[_0x130d('0x1d')]();};}function saveUpdates(_0x13c746,_0x1a2ed3){return function(_0x2dd12c){if(_0x2dd12c){return _0x2dd12c['update'](_0x13c746)['then'](function(_0x477a85){return _0x477a85;});}return null;};}function removeEntity(_0x51401e,_0x494271){return function(_0x2b6f39){if(_0x2b6f39){return _0x2b6f39['destroy']()[_0x130d('0x1e')](function(){var _0x5b94af=_0x2b6f39[_0x130d('0x1f')]({'plain':!![]});var _0x2ddef9=_0x130d('0x20');return db[_0x130d('0x21')][_0x130d('0x22')]({'where':{'type':_0x2ddef9,'resourceId':_0x5b94af['id']}})['then'](function(){return _0x2b6f39;});})[_0x130d('0x1e')](function(){_0x51401e[_0x130d('0x14')](0xcc)[_0x130d('0x15')]();});}};}function handleEntityNotFound(_0x16c94a,_0xe2bffb){return function(_0x4d1116){if(!_0x4d1116){_0x16c94a[_0x130d('0x13')](0x194);}return _0x4d1116;};}function handleError(_0x38178a,_0x2ab3f2){_0x2ab3f2=_0x2ab3f2||0x1f4;return function(_0x22b51a){logger[_0x130d('0x23')](_0x22b51a[_0x130d('0x24')]);if(_0x22b51a[_0x130d('0x25')]){delete _0x22b51a[_0x130d('0x25')];}_0x38178a[_0x130d('0x14')](_0x2ab3f2)[_0x130d('0x26')](_0x22b51a);};}exports[_0x130d('0x27')]=function(_0x577679,_0x50a714){var _0x3059e5={},_0x2b5cb0={},_0x1d78d4={'count':0x0,'rows':[]};var _0x5e0063=_[_0x130d('0x28')](db['Pause']['rawAttributes'],function(_0x20adf6){return{'name':_0x20adf6['fieldName'],'type':_0x20adf6['type'][_0x130d('0x29')]};});_0x2b5cb0['model']=_[_0x130d('0x28')](_0x5e0063,_0x130d('0x25'));_0x2b5cb0[_0x130d('0x2a')]=_['keys'](_0x577679['query']);_0x2b5cb0[_0x130d('0x2b')]=_[_0x130d('0x2c')](_0x2b5cb0[_0x130d('0x2d')],_0x2b5cb0[_0x130d('0x2a')]);_0x3059e5[_0x130d('0x2e')]=_[_0x130d('0x2c')](_0x2b5cb0[_0x130d('0x2d')],qs[_0x130d('0x2f')](_0x577679[_0x130d('0x2a')]['fields']));_0x3059e5[_0x130d('0x2e')]=_0x3059e5[_0x130d('0x2e')][_0x130d('0x30')]?_0x3059e5['attributes']:_0x2b5cb0[_0x130d('0x2d')];if(!_0x577679['query'][_0x130d('0x31')](_0x130d('0x32'))){_0x3059e5['limit']=qs[_0x130d('0x18')](_0x577679[_0x130d('0x2a')][_0x130d('0x18')]);_0x3059e5[_0x130d('0x16')]=qs[_0x130d('0x16')](_0x577679[_0x130d('0x2a')][_0x130d('0x16')]);}_0x3059e5['order']=qs[_0x130d('0x33')](_0x577679[_0x130d('0x2a')][_0x130d('0x33')]);_0x3059e5[_0x130d('0x34')]=qs[_0x130d('0x2b')](_['pick'](_0x577679['query'],_0x2b5cb0[_0x130d('0x2b')]),_0x5e0063);if(_0x577679[_0x130d('0x2a')][_0x130d('0x35')]){_0x3059e5[_0x130d('0x34')]=_[_0x130d('0x36')](_0x3059e5[_0x130d('0x34')],{'$or':_[_0x130d('0x28')](_0x5e0063,function(_0x1ec819){if(_0x1ec819['type']!==_0x130d('0x37')){var _0x3822d8={};_0x3822d8[_0x1ec819[_0x130d('0x25')]]={'$like':'%'+_0x577679[_0x130d('0x2a')][_0x130d('0x35')]+'%'};return _0x3822d8;}})});}_0x3059e5=_[_0x130d('0x36')]({},_0x3059e5,_0x577679[_0x130d('0x38')]);var _0x3110a0={'where':_0x3059e5[_0x130d('0x34')]};return db[_0x130d('0x39')][_0x130d('0x19')](_0x3110a0)[_0x130d('0x1e')](function(_0x7efbbc){_0x1d78d4[_0x130d('0x19')]=_0x7efbbc;if(_0x577679[_0x130d('0x2a')][_0x130d('0x3a')]){_0x3059e5['include']=[{'all':!![]}];}return db[_0x130d('0x39')][_0x130d('0x3b')](_0x3059e5);})['then'](function(_0x5a197f){_0x1d78d4[_0x130d('0x3c')]=_0x5a197f;return _0x1d78d4;})['then'](respondWithFilteredResult(_0x50a714,_0x3059e5))[_0x130d('0x3d')](handleError(_0x50a714,null));};exports[_0x130d('0x3e')]=function(_0x510ea9,_0x162839){var _0x1f776b={'raw':!![],'where':{'id':_0x510ea9[_0x130d('0x3f')]['id']}},_0x270831={};_0x270831[_0x130d('0x2d')]=_['keys'](db[_0x130d('0x39')][_0x130d('0x40')]);_0x270831[_0x130d('0x2a')]=_[_0x130d('0x41')](_0x510ea9['query']);_0x270831[_0x130d('0x2b')]=_[_0x130d('0x2c')](_0x270831['model'],_0x270831[_0x130d('0x2a')]);_0x1f776b[_0x130d('0x2e')]=_[_0x130d('0x2c')](_0x270831[_0x130d('0x2d')],qs[_0x130d('0x2f')](_0x510ea9[_0x130d('0x2a')][_0x130d('0x2f')]));_0x1f776b[_0x130d('0x2e')]=_0x1f776b['attributes'][_0x130d('0x30')]?_0x1f776b[_0x130d('0x2e')]:_0x270831[_0x130d('0x2d')];if(_0x510ea9[_0x130d('0x2a')][_0x130d('0x3a')]){_0x1f776b['include']=[{'all':!![]}];}_0x1f776b=_['merge']({},_0x1f776b,_0x510ea9[_0x130d('0x38')]);return db[_0x130d('0x39')][_0x130d('0x42')](_0x1f776b)[_0x130d('0x1e')](handleEntityNotFound(_0x162839,null))[_0x130d('0x1e')](respondWithResult(_0x162839,null))[_0x130d('0x3d')](handleError(_0x162839,null));};exports[_0x130d('0x43')]=function(_0x10e7a9,_0x4deb9a){return db[_0x130d('0x39')][_0x130d('0x43')](_0x10e7a9['body'],{})['then'](function(_0x17aad8){var _0x1f1825=_0x10e7a9[_0x130d('0x44')][_0x130d('0x1f')]({'plain':!![]});if(!_0x1f1825)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f1825[_0x130d('0x45')]===_0x130d('0x44')){var _0x351649=_0x17aad8[_0x130d('0x1f')]({'plain':!![]});var _0x5da161='Pauses';return db['UserProfileSection'][_0x130d('0x42')]({'where':{'name':_0x5da161,'userProfileId':_0x1f1825['userProfileId']},'raw':!![]})['then'](function(_0x452a8e){if(_0x452a8e&&_0x452a8e[_0x130d('0x46')]===0x0){return db[_0x130d('0x21')]['create']({'name':_0x351649[_0x130d('0x25')],'resourceId':_0x351649['id'],'type':_0x452a8e['name'],'sectionId':_0x452a8e['id']},{})[_0x130d('0x1e')](function(){return _0x17aad8;});}else{return _0x17aad8;}})['catch'](function(_0x462179){logger[_0x130d('0x23')](_0x130d('0x47'),_0x462179);throw _0x462179;});}return _0x17aad8;})[_0x130d('0x1e')](respondWithResult(_0x4deb9a,0xc9))['catch'](handleError(_0x4deb9a,null));};exports[_0x130d('0x48')]=function(_0x52d0d2,_0x41a183){if(_0x52d0d2[_0x130d('0x49')]['id']){delete _0x52d0d2[_0x130d('0x49')]['id'];}return db['Pause']['find']({'where':{'id':_0x52d0d2['params']['id']}})[_0x130d('0x1e')](handleEntityNotFound(_0x41a183,null))[_0x130d('0x1e')](saveUpdates(_0x52d0d2[_0x130d('0x49')],null))[_0x130d('0x1e')](respondWithResult(_0x41a183,null))[_0x130d('0x3d')](handleError(_0x41a183,null));};exports['destroy']=function(_0x31d978,_0x39f5a9){return db[_0x130d('0x39')][_0x130d('0x42')]({'where':{'id':_0x31d978['params']['id']}})['then'](handleEntityNotFound(_0x39f5a9,null))[_0x130d('0x1e')](removeEntity(_0x39f5a9,null))[_0x130d('0x3d')](handleError(_0x39f5a9,null));}; \ No newline at end of file +var _0x581e=['filter','merge','VIRTUAL','Pause','includeAll','findAll','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','userProfileId','autoAssociation','params','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','order','sort','where','pick','filters'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0x581e,0x18f));var _0xe581=function(_0x33e348,_0x42c2f0){_0x33e348=_0x33e348-0x0;var _0x208b39=_0x581e[_0x33e348];return _0x208b39;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe581('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe581('0x1'));var Mustache=require(_0xe581('0x2'));var util=require(_0xe581('0x3'));var path=require(_0xe581('0x4'));var sox=require(_0xe581('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe581('0x6'));var _=require(_0xe581('0x7'));var squel=require(_0xe581('0x8'));var crypto=require(_0xe581('0x9'));var jsforce=require(_0xe581('0xa'));var deskjs=require(_0xe581('0xb'));var toCsv=require(_0xe581('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe581('0xd'));var qs=require(_0xe581('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe581('0xf'));var logger=require(_0xe581('0x10'))(_0xe581('0x11'));var utils=require('../../config/utils');var config=require(_0xe581('0x12'));var licenseUtil=require(_0xe581('0x13'));var db=require(_0xe581('0x14'))['db'];function respondWithStatusCode(_0x2b2887,_0x38963d){_0x38963d=_0x38963d||0xcc;return function(_0x3a2d72){if(_0x3a2d72){return _0x2b2887['sendStatus'](_0x38963d);}return _0x2b2887[_0xe581('0x15')](_0x38963d)[_0xe581('0x16')]();};}function respondWithResult(_0x1f63cb,_0x42bdff){_0x42bdff=_0x42bdff||0xc8;return function(_0x5c4798){if(_0x5c4798){return _0x1f63cb[_0xe581('0x15')](_0x42bdff)[_0xe581('0x17')](_0x5c4798);}};}function respondWithFilteredResult(_0x2803d7,_0x33765b){return function(_0x165f97){if(_0x165f97){var _0x3560c2=typeof _0x33765b[_0xe581('0x18')]===_0xe581('0x19')&&typeof _0x33765b[_0xe581('0x1a')]==='undefined';var _0xc4a087=_0x165f97[_0xe581('0x1b')];var _0x3c8265=_0x3560c2?0x0:_0x33765b['offset'];var _0x195119=_0x3560c2?_0x165f97[_0xe581('0x1b')]:_0x33765b[_0xe581('0x18')]+_0x33765b['limit'];var _0x4d6cb2;if(_0x195119>=_0xc4a087){_0x195119=_0xc4a087;_0x4d6cb2=0xc8;}else{_0x4d6cb2=0xce;}_0x2803d7[_0xe581('0x15')](_0x4d6cb2);return _0x2803d7[_0xe581('0x1c')]('Content-Range',_0x3c8265+'-'+_0x195119+'/'+_0xc4a087)['json'](_0x165f97);}return null;};}function patchUpdates(_0x583276){return function(_0x5ecc9d){try{jsonpatch['apply'](_0x5ecc9d,_0x583276,!![]);}catch(_0x1b73fc){return BPromise[_0xe581('0x1d')](_0x1b73fc);}return _0x5ecc9d[_0xe581('0x1e')]();};}function saveUpdates(_0x154648,_0x3ff1c8){return function(_0x3ef812){if(_0x3ef812){return _0x3ef812[_0xe581('0x1f')](_0x154648)[_0xe581('0x20')](function(_0x4541bf){return _0x4541bf;});}return null;};}function removeEntity(_0x5455f5,_0x44ed9b){return function(_0x4ef870){if(_0x4ef870){return _0x4ef870[_0xe581('0x21')]()['then'](function(){var _0x224c03=_0x4ef870[_0xe581('0x22')]({'plain':!![]});var _0x5eebfa='Pauses';return db[_0xe581('0x23')][_0xe581('0x21')]({'where':{'type':_0x5eebfa,'resourceId':_0x224c03['id']}})[_0xe581('0x20')](function(){return _0x4ef870;});})[_0xe581('0x20')](function(){_0x5455f5[_0xe581('0x15')](0xcc)[_0xe581('0x16')]();});}};}function handleEntityNotFound(_0x5a0ec1,_0x42f516){return function(_0x402b7f){if(!_0x402b7f){_0x5a0ec1[_0xe581('0x24')](0x194);}return _0x402b7f;};}function handleError(_0x4276ca,_0x1977c2){_0x1977c2=_0x1977c2||0x1f4;return function(_0x10d852){logger[_0xe581('0x25')](_0x10d852[_0xe581('0x26')]);if(_0x10d852[_0xe581('0x27')]){delete _0x10d852[_0xe581('0x27')];}_0x4276ca[_0xe581('0x15')](_0x1977c2)['send'](_0x10d852);};}exports[_0xe581('0x28')]=function(_0x1f613f,_0x342230){var _0x3ef912={},_0x3d05bb={},_0x347586={'count':0x0,'rows':[]};var _0x2dcce9=_[_0xe581('0x29')](db['Pause'][_0xe581('0x2a')],function(_0x417ac4){return{'name':_0x417ac4[_0xe581('0x2b')],'type':_0x417ac4[_0xe581('0x2c')]['key']};});_0x3d05bb[_0xe581('0x2d')]=_['map'](_0x2dcce9,_0xe581('0x27'));_0x3d05bb[_0xe581('0x2e')]=_[_0xe581('0x2f')](_0x1f613f[_0xe581('0x2e')]);_0x3d05bb['filters']=_[_0xe581('0x30')](_0x3d05bb['model'],_0x3d05bb[_0xe581('0x2e')]);_0x3ef912['attributes']=_[_0xe581('0x30')](_0x3d05bb['model'],qs['fields'](_0x1f613f[_0xe581('0x2e')][_0xe581('0x31')]));_0x3ef912[_0xe581('0x32')]=_0x3ef912['attributes'][_0xe581('0x33')]?_0x3ef912[_0xe581('0x32')]:_0x3d05bb['model'];if(!_0x1f613f[_0xe581('0x2e')]['hasOwnProperty']('nolimit')){_0x3ef912[_0xe581('0x1a')]=qs[_0xe581('0x1a')](_0x1f613f[_0xe581('0x2e')][_0xe581('0x1a')]);_0x3ef912[_0xe581('0x18')]=qs['offset'](_0x1f613f['query'][_0xe581('0x18')]);}_0x3ef912[_0xe581('0x34')]=qs[_0xe581('0x35')](_0x1f613f[_0xe581('0x2e')][_0xe581('0x35')]);_0x3ef912[_0xe581('0x36')]=qs['filters'](_[_0xe581('0x37')](_0x1f613f[_0xe581('0x2e')],_0x3d05bb[_0xe581('0x38')]),_0x2dcce9);if(_0x1f613f[_0xe581('0x2e')][_0xe581('0x39')]){_0x3ef912[_0xe581('0x36')]=_[_0xe581('0x3a')](_0x3ef912[_0xe581('0x36')],{'$or':_['map'](_0x2dcce9,function(_0x32651f){if(_0x32651f[_0xe581('0x2c')]!==_0xe581('0x3b')){var _0x2bfa34={};_0x2bfa34[_0x32651f[_0xe581('0x27')]]={'$like':'%'+_0x1f613f[_0xe581('0x2e')][_0xe581('0x39')]+'%'};return _0x2bfa34;}})});}_0x3ef912=_[_0xe581('0x3a')]({},_0x3ef912,_0x1f613f['options']);var _0xcc4e2e={'where':_0x3ef912['where']};return db[_0xe581('0x3c')]['count'](_0xcc4e2e)['then'](function(_0x5eb33a){_0x347586['count']=_0x5eb33a;if(_0x1f613f['query'][_0xe581('0x3d')]){_0x3ef912['include']=[{'all':!![]}];}return db[_0xe581('0x3c')][_0xe581('0x3e')](_0x3ef912);})['then'](function(_0x5369ae){_0x347586['rows']=_0x5369ae;return _0x347586;})[_0xe581('0x20')](respondWithFilteredResult(_0x342230,_0x3ef912))['catch'](handleError(_0x342230,null));};exports[_0xe581('0x3f')]=function(_0x448d2a,_0x594e65){var _0x220e2d={'raw':!![],'where':{'id':_0x448d2a['params']['id']}},_0x593262={};_0x593262[_0xe581('0x2d')]=_['keys'](db['Pause'][_0xe581('0x2a')]);_0x593262[_0xe581('0x2e')]=_[_0xe581('0x2f')](_0x448d2a['query']);_0x593262['filters']=_[_0xe581('0x30')](_0x593262['model'],_0x593262['query']);_0x220e2d[_0xe581('0x32')]=_[_0xe581('0x30')](_0x593262['model'],qs['fields'](_0x448d2a[_0xe581('0x2e')][_0xe581('0x31')]));_0x220e2d[_0xe581('0x32')]=_0x220e2d[_0xe581('0x32')][_0xe581('0x33')]?_0x220e2d[_0xe581('0x32')]:_0x593262[_0xe581('0x2d')];if(_0x448d2a[_0xe581('0x2e')]['includeAll']){_0x220e2d['include']=[{'all':!![]}];}_0x220e2d=_[_0xe581('0x3a')]({},_0x220e2d,_0x448d2a[_0xe581('0x40')]);return db[_0xe581('0x3c')][_0xe581('0x41')](_0x220e2d)[_0xe581('0x20')](handleEntityNotFound(_0x594e65,null))['then'](respondWithResult(_0x594e65,null))[_0xe581('0x42')](handleError(_0x594e65,null));};exports[_0xe581('0x43')]=function(_0x495480,_0x28d73f){return db[_0xe581('0x3c')][_0xe581('0x43')](_0x495480[_0xe581('0x44')],{})[_0xe581('0x20')](function(_0x5eaa1d){var _0x51fcc0=_0x495480[_0xe581('0x45')][_0xe581('0x22')]({'plain':!![]});if(!_0x51fcc0)throw new Error(_0xe581('0x46'));if(_0x51fcc0[_0xe581('0x47')]===_0xe581('0x45')){var _0x47beef=_0x5eaa1d['get']({'plain':!![]});var _0x2022f7=_0xe581('0x48');return db['UserProfileSection'][_0xe581('0x41')]({'where':{'name':_0x2022f7,'userProfileId':_0x51fcc0[_0xe581('0x49')]},'raw':!![]})['then'](function(_0x463013){if(_0x463013&&_0x463013[_0xe581('0x4a')]===0x0){return db['UserProfileResource'][_0xe581('0x43')]({'name':_0x47beef['name'],'resourceId':_0x47beef['id'],'type':_0x463013[_0xe581('0x27')],'sectionId':_0x463013['id']},{})['then'](function(){return _0x5eaa1d;});}else{return _0x5eaa1d;}})['catch'](function(_0x4090a1){logger[_0xe581('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4090a1);throw _0x4090a1;});}return _0x5eaa1d;})[_0xe581('0x20')](respondWithResult(_0x28d73f,0xc9))[_0xe581('0x42')](handleError(_0x28d73f,null));};exports[_0xe581('0x1f')]=function(_0x1a95ad,_0xb05d76){if(_0x1a95ad[_0xe581('0x44')]['id']){delete _0x1a95ad[_0xe581('0x44')]['id'];}return db[_0xe581('0x3c')]['find']({'where':{'id':_0x1a95ad['params']['id']}})[_0xe581('0x20')](handleEntityNotFound(_0xb05d76,null))[_0xe581('0x20')](saveUpdates(_0x1a95ad[_0xe581('0x44')],null))['then'](respondWithResult(_0xb05d76,null))[_0xe581('0x42')](handleError(_0xb05d76,null));};exports['destroy']=function(_0x3f2528,_0x570186){return db[_0xe581('0x3c')]['find']({'where':{'id':_0x3f2528[_0xe581('0x4b')]['id']}})[_0xe581('0x20')](handleEntityNotFound(_0x570186,null))[_0xe581('0x20')](removeEntity(_0x570186,null))['catch'](handleError(_0x570186,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0c0bb90..9b7d028 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 _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x277e3a,_0x38f341){var _0xc02a0a=function(_0xe9d816){while(--_0xe9d816){_0x277e3a['push'](_0x277e3a['shift']());}};_0xc02a0a(++_0x38f341);}(_0x5fc3,0xa8));var _0x35fc=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x5fc3[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x44e80b,_0x351b98){_0x44e80b=_0x44e80b-0x0;var _0x864b01=_0x6aa7[_0x44e80b];return _0x864b01;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 888c0d0..88305fb 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x495620,_0x6a6806){var _0x3507ab=function(_0x4867dd){while(--_0x4867dd){_0x495620['push'](_0x495620['shift']());}};_0x3507ab(++_0x6a6806);}(_0xb10b,0x12a));var _0xbb10=function(_0xaf2427,_0x504859){_0xaf2427=_0xaf2427-0x0;var _0x67addb=_0xb10b[_0xaf2427];return _0x67addb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x1dd99e,_0x5010a9){var _0x293463=function(_0x593ae2){while(--_0x593ae2){_0x1dd99e['push'](_0x1dd99e['shift']());}};_0x293463(++_0x5010a9);}(_0x7a54,0x106));var _0x47a5=function(_0x552611,_0x1b05a0){_0x552611=_0x552611-0x0;var _0x101711=_0x7a54[_0x552611];return _0x101711;};'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 36e0aa8..b23a46a 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 _0x0faf=['extname','now','post','single','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','basename'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x0faf,0x132));var _0xf0fa=function(_0x2bb82d,_0x42c7f8){_0x2bb82d=_0x2bb82d-0x0;var _0x5e0b92=_0x0faf[_0x2bb82d];return _0x5e0b92;};'use strict';var multer=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var timeout=require(_0xf0fa('0x2'));var express=require(_0xf0fa('0x3'));var router=express[_0xf0fa('0x4')]();var fs_extra=require(_0xf0fa('0x5'));var auth=require(_0xf0fa('0x6'));var interaction=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var controller=require(_0xf0fa('0x9'));router['get']('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0xb')]);router[_0xf0fa('0xc')](_0xf0fa('0xd'),controller[_0xf0fa('0xe')]);router['get'](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller['show']);router['get'](_0xf0fa('0x10'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x11')]);var upload=multer({'storage':multer[_0xf0fa('0x12')]({'destination':function(_0x2bd807,_0x1151ea,_0x379ff6){_0x379ff6(null,path[_0xf0fa('0x13')](config['root'],_0xf0fa('0x14')));},'filename':function(_0x5b38fa,_0x2f46ff,_0x521034){_0x2f46ff[_0xf0fa('0x15')]=_0x2f46ff[_0xf0fa('0x15')][_0xf0fa('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x521034(null,util['format']('%s-%s%s',path[_0xf0fa('0x17')](_0x2f46ff['originalname'],path[_0xf0fa('0x18')](_0x2f46ff[_0xf0fa('0x15')])),Date[_0xf0fa('0x19')](),path[_0xf0fa('0x18')](_0x2f46ff[_0xf0fa('0x15')])));}})});router[_0xf0fa('0x1a')]('/',upload[_0xf0fa('0x1b')](_0xf0fa('0x1c')),controller['upload']);router[_0xf0fa('0x1a')](_0xf0fa('0xd'),controller[_0xf0fa('0x1d')]);router[_0xf0fa('0x1e')](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller['update']);router['delete'](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x1f')]);module[_0xf0fa('0x20')]=router; \ No newline at end of file +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(_0x32618c,_0x1abe61){var _0x48fbbb=function(_0x4c29a2){while(--_0x4c29a2){_0x32618c['push'](_0x32618c['shift']());}};_0x48fbbb(++_0x1abe61);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'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 diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 6096f36..ddb2a57 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 _0x7145=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x18515d,_0x5c442b){var _0x175db2=function(_0x1abf22){while(--_0x1abf22){_0x18515d['push'](_0x18515d['shift']());}};_0x175db2(++_0x5c442b);}(_0x7145,0x1c2));var _0x5714=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7145[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5714('0x0'));module['exports']={'name':{'type':Sequelize[_0x5714('0x1')]},'type':{'type':Sequelize[_0x5714('0x2')](_0x5714('0x3'),'script')},'description':{'type':Sequelize[_0x5714('0x4')]},'version':{'type':Sequelize[_0x5714('0x4')]},'path':{'type':Sequelize[_0x5714('0x1')],'comment':_0x5714('0x5')},'active':{'type':Sequelize[_0x5714('0x6')],'defaultValue':0x0,'comment':_0x5714('0x7')},'sidebar':{'type':Sequelize[_0x5714('0x2')](_0x5714('0x8'),_0x5714('0x9'),_0x5714('0xa'),_0x5714('0xb')),'defaultValue':_0x5714('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x5714('0x1')]},'adminUrl':{'type':Sequelize[_0x5714('0x1')]},'agentUrl':{'type':Sequelize[_0x5714('0x1')]},'scriptName':{'type':Sequelize[_0x5714('0x1')]},'scriptPath':{'type':Sequelize[_0x5714('0x1')]}}; \ No newline at end of file +var _0x02bb=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x02bb,0x197));var _0xb02b=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x02bb[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xb02b('0x0'));module[_0xb02b('0x1')]={'name':{'type':Sequelize[_0xb02b('0x2')]},'type':{'type':Sequelize[_0xb02b('0x3')]('html',_0xb02b('0x4'))},'description':{'type':Sequelize[_0xb02b('0x5')]},'version':{'type':Sequelize[_0xb02b('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xb02b('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb02b('0x7')},'sidebar':{'type':Sequelize[_0xb02b('0x3')](_0xb02b('0x8'),_0xb02b('0x9'),_0xb02b('0xa'),_0xb02b('0xb')),'defaultValue':'always','comment':_0xb02b('0xc')},'icon':{'type':Sequelize[_0xb02b('0x2')]},'adminUrl':{'type':Sequelize[_0xb02b('0x2')]},'agentUrl':{'type':Sequelize[_0xb02b('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a936712..88c0372 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 _0x7495=['basename','createWriteStream','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','dirname','node_modules/**/*','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','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','readFileSync','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','icon-apps','version','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','then','destroy','get','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','download','join','root','server/files/plugins','format','%s.zip'];(function(_0x3ed203,_0x4e3a3c){var _0x558502=function(_0x454c3b){while(--_0x454c3b){_0x3ed203['push'](_0x3ed203['shift']());}};_0x558502(++_0x4e3a3c);}(_0x7495,0x1ac));var _0x5749=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x7495[_0x4afac5];return _0x2404b3;};'use strict';var emlformat=require(_0x5749('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5749('0x1'));var jsonpatch=require(_0x5749('0x2'));var rp=require(_0x5749('0x3'));var moment=require('moment');var BPromise=require(_0x5749('0x4'));var Mustache=require(_0x5749('0x5'));var util=require(_0x5749('0x6'));var path=require(_0x5749('0x7'));var sox=require(_0x5749('0x8'));var csv=require('to-csv');var ejs=require(_0x5749('0x9'));var fs=require('fs');var fs_extra=require(_0x5749('0xa'));var _=require(_0x5749('0xb'));var squel=require(_0x5749('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5749('0xd'));var toCsv=require(_0x5749('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x5749('0xf'));var rimraf=require(_0x5749('0x10'));var archiver=require('archiver');var Redis=require(_0x5749('0x11'));var authService=require(_0x5749('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5749('0x13'));var hardwareService=require(_0x5749('0x14'));var logger=require(_0x5749('0x15'))(_0x5749('0x16'));var utils=require(_0x5749('0x17'));var config=require(_0x5749('0x18'));var licenseUtil=require(_0x5749('0x19'));var db=require(_0x5749('0x1a'))['db'];config[_0x5749('0x1b')]=_['defaults'](config['redis'],{'host':_0x5749('0x1c'),'port':0x18eb});var socket=require(_0x5749('0x1d'))(new Redis(config['redis']));require(_0x5749('0x1e'))['register'](socket);function respondWithStatusCode(_0x14af56,_0x5638d7){_0x5638d7=_0x5638d7||0xcc;return function(_0x4518dc){if(_0x4518dc){return _0x14af56[_0x5749('0x1f')](_0x5638d7);}return _0x14af56[_0x5749('0x20')](_0x5638d7)['end']();};}function respondWithResult(_0xaf18d8,_0x5b4a99){_0x5b4a99=_0x5b4a99||0xc8;return function(_0x1a7a1a){if(_0x1a7a1a){return _0xaf18d8[_0x5749('0x20')](_0x5b4a99)[_0x5749('0x21')](_0x1a7a1a);}};}function respondWithFilteredResult(_0x58ee38,_0x25dee8){return function(_0x50b0d9){if(_0x50b0d9){var _0x399b93=typeof _0x25dee8[_0x5749('0x22')]==='undefined'&&typeof _0x25dee8[_0x5749('0x23')]===_0x5749('0x24');var _0x1bffd0=_0x50b0d9[_0x5749('0x25')];var _0x55e4f4=_0x399b93?0x0:_0x25dee8[_0x5749('0x22')];var _0x368ca1=_0x399b93?_0x50b0d9[_0x5749('0x25')]:_0x25dee8[_0x5749('0x22')]+_0x25dee8[_0x5749('0x23')];var _0x1ccb09;if(_0x368ca1>=_0x1bffd0){_0x368ca1=_0x1bffd0;_0x1ccb09=0xc8;}else{_0x1ccb09=0xce;}_0x58ee38[_0x5749('0x20')](_0x1ccb09);return _0x58ee38[_0x5749('0x26')](_0x5749('0x27'),_0x55e4f4+'-'+_0x368ca1+'/'+_0x1bffd0)[_0x5749('0x21')](_0x50b0d9);}return null;};}function patchUpdates(_0x99d9e1){return function(_0xca79ee){try{jsonpatch[_0x5749('0x28')](_0xca79ee,_0x99d9e1,!![]);}catch(_0x540e3b){return BPromise['reject'](_0x540e3b);}return _0xca79ee['save']();};}function saveUpdates(_0x587d51,_0x4e3c87){return function(_0x5ab504){if(_0x5ab504){return _0x5ab504['update'](_0x587d51)[_0x5749('0x29')](function(_0x27a7cf){return _0x27a7cf;});}return null;};}function removeEntity(_0x554ba8,_0x495ff7){return function(_0x5dc49d){if(_0x5dc49d){return _0x5dc49d[_0x5749('0x2a')]()[_0x5749('0x29')](function(){var _0x165a3a=_0x5dc49d[_0x5749('0x2b')]({'plain':!![]});var _0x35df7b=_0x5749('0x2c');return db[_0x5749('0x2d')][_0x5749('0x2a')]({'where':{'type':_0x35df7b,'resourceId':_0x165a3a['id']}})[_0x5749('0x29')](function(){return _0x5dc49d;});})['then'](function(){_0x554ba8[_0x5749('0x20')](0xcc)[_0x5749('0x2e')]();});}};}function handleEntityNotFound(_0x46e086,_0x9801b6){return function(_0x35f2ce){if(!_0x35f2ce){_0x46e086[_0x5749('0x1f')](0x194);}return _0x35f2ce;};}function handleError(_0x23e6ca,_0x283988){_0x283988=_0x283988||0x1f4;return function(_0x4af3f5){logger[_0x5749('0x2f')](_0x4af3f5[_0x5749('0x30')]);if(_0x4af3f5[_0x5749('0x31')]){delete _0x4af3f5['name'];}_0x23e6ca['status'](_0x283988)[_0x5749('0x32')](_0x4af3f5);};}exports[_0x5749('0x33')]=function(_0x520c83,_0x519aef){var _0x467a0f={},_0x4b12b6={},_0x80d95b={'count':0x0,'rows':[]};var _0x4cadef=_[_0x5749('0x34')](db[_0x5749('0x35')]['rawAttributes'],function(_0x81f918){return{'name':_0x81f918[_0x5749('0x36')],'type':_0x81f918['type'][_0x5749('0x37')]};});_0x4b12b6[_0x5749('0x38')]=_[_0x5749('0x34')](_0x4cadef,_0x5749('0x31'));_0x4b12b6[_0x5749('0x39')]=_[_0x5749('0x3a')](_0x520c83[_0x5749('0x39')]);_0x4b12b6[_0x5749('0x3b')]=_[_0x5749('0x3c')](_0x4b12b6[_0x5749('0x38')],_0x4b12b6[_0x5749('0x39')]);_0x467a0f['attributes']=_[_0x5749('0x3c')](_0x4b12b6['model'],qs[_0x5749('0x3d')](_0x520c83[_0x5749('0x39')][_0x5749('0x3d')]));_0x467a0f[_0x5749('0x3e')]=_0x467a0f[_0x5749('0x3e')][_0x5749('0x3f')]?_0x467a0f['attributes']:_0x4b12b6[_0x5749('0x38')];if(!_0x520c83[_0x5749('0x39')][_0x5749('0x40')](_0x5749('0x41'))){_0x467a0f[_0x5749('0x23')]=qs[_0x5749('0x23')](_0x520c83[_0x5749('0x39')][_0x5749('0x23')]);_0x467a0f[_0x5749('0x22')]=qs['offset'](_0x520c83[_0x5749('0x39')][_0x5749('0x22')]);}_0x467a0f['order']=qs[_0x5749('0x42')](_0x520c83[_0x5749('0x39')][_0x5749('0x42')]);_0x467a0f[_0x5749('0x43')]=qs['filters'](_[_0x5749('0x44')](_0x520c83['query'],_0x4b12b6[_0x5749('0x3b')]),_0x4cadef);if(_0x520c83[_0x5749('0x39')][_0x5749('0x45')]){_0x467a0f['where']=_[_0x5749('0x46')](_0x467a0f['where'],{'$or':_[_0x5749('0x34')](_0x4cadef,function(_0x3bb021){if(_0x3bb021[_0x5749('0x47')]!==_0x5749('0x48')){var _0x171bbe={};_0x171bbe[_0x3bb021[_0x5749('0x31')]]={'$like':'%'+_0x520c83['query']['filter']+'%'};return _0x171bbe;}})});}_0x467a0f=_[_0x5749('0x46')]({},_0x467a0f,_0x520c83[_0x5749('0x49')]);var _0x27fdee={'where':_0x467a0f[_0x5749('0x43')]};return db['Plugin']['count'](_0x27fdee)[_0x5749('0x29')](function(_0x4bfec5){_0x80d95b['count']=_0x4bfec5;if(_0x520c83['query'][_0x5749('0x4a')]){_0x467a0f[_0x5749('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0x5749('0x4c')](_0x467a0f);})[_0x5749('0x29')](function(_0x3da0fc){_0x80d95b['rows']=_0x3da0fc;return _0x80d95b;})[_0x5749('0x29')](respondWithFilteredResult(_0x519aef,_0x467a0f))[_0x5749('0x4d')](handleError(_0x519aef,null));};exports[_0x5749('0x4e')]=function(_0x8f914e,_0x493bff){var _0x3d5e2f={'raw':!![],'where':{'id':_0x8f914e[_0x5749('0x4f')]['id']}},_0x4dac18={};_0x4dac18[_0x5749('0x38')]=_[_0x5749('0x3a')](db[_0x5749('0x35')][_0x5749('0x50')]);_0x4dac18[_0x5749('0x39')]=_[_0x5749('0x3a')](_0x8f914e[_0x5749('0x39')]);_0x4dac18[_0x5749('0x3b')]=_[_0x5749('0x3c')](_0x4dac18['model'],_0x4dac18[_0x5749('0x39')]);_0x3d5e2f['attributes']=_[_0x5749('0x3c')](_0x4dac18[_0x5749('0x38')],qs[_0x5749('0x3d')](_0x8f914e[_0x5749('0x39')]['fields']));_0x3d5e2f[_0x5749('0x3e')]=_0x3d5e2f[_0x5749('0x3e')][_0x5749('0x3f')]?_0x3d5e2f[_0x5749('0x3e')]:_0x4dac18['model'];if(_0x8f914e[_0x5749('0x39')][_0x5749('0x4a')]){_0x3d5e2f[_0x5749('0x4b')]=[{'all':!![]}];}_0x3d5e2f=_['merge']({},_0x3d5e2f,_0x8f914e[_0x5749('0x49')]);return db['Plugin'][_0x5749('0x51')](_0x3d5e2f)[_0x5749('0x29')](handleEntityNotFound(_0x493bff,null))[_0x5749('0x29')](respondWithResult(_0x493bff,null))[_0x5749('0x4d')](handleError(_0x493bff,null));};exports[_0x5749('0x52')]=function(_0x2a93ad,_0x516052,_0x2e065a){return db[_0x5749('0x35')][_0x5749('0x51')]({'where':{'id':_0x2a93ad[_0x5749('0x4f')]['id']},'attributes':[_0x5749('0x31'),_0x5749('0x7')],'raw':!![]})[_0x5749('0x29')](handleEntityNotFound(_0x516052,null))['then'](function(_0xe53038){if(_0xe53038){var _0x384043=path[_0x5749('0x53')](config[_0x5749('0x54')],_0x5749('0x55'),util[_0x5749('0x56')](_0x5749('0x57'),path[_0x5749('0x58')](_0xe53038[_0x5749('0x7')])));var _0x4a9a8c=fs[_0x5749('0x59')](_0x384043);var _0xb014aa=archiver('zip',{'zlib':{'level':0x9}});_0xb014aa['on'](_0x5749('0x5a'),function(_0x30df5f){if(_0x30df5f['code']===_0x5749('0x5b')){logger[_0x5749('0x2f')](_0x30df5f);}else{throw new db['Sequelize'][(_0x5749('0x5c'))](_0x5749('0x5d'));}});_0xb014aa['on'](_0x5749('0x2f'),function(_0x1b649d){throw new db[(_0x5749('0x5e'))][(_0x5749('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xb014aa[_0x5749('0x5f')](_0x4a9a8c);_0xb014aa[_0x5749('0x60')]('**/*',{'cwd':path[_0x5749('0x53')](config[_0x5749('0x54')],'server/files/plugins',path[_0x5749('0x61')](_0xe53038[_0x5749('0x7')])),'ignore':[path[_0x5749('0x53')](path[_0x5749('0x58')](_0xe53038[_0x5749('0x7')]),_0x5749('0x62')),path[_0x5749('0x53')](path[_0x5749('0x58')](_0xe53038['path']),_0x5749('0x63'))],'nodir':!![]})[_0x5749('0x64')]();_0x4a9a8c['on']('close',function(){if(!fs['existsSync'](_0x384043)){throw new db[(_0x5749('0x5e'))][(_0x5749('0x5c'))](_0x5749('0x65'));}return _0x516052[_0x5749('0x52')](_0x384043,util[_0x5749('0x56')](_0x5749('0x57'),path[_0x5749('0x58')](_0xe53038[_0x5749('0x7')])),function(_0x3c4a37){if(_0x3c4a37){throw new db[(_0x5749('0x5e'))]['Error'](_0x5749('0x66'));}fs[_0x5749('0x67')](_0x384043);logger[_0x5749('0x68')](_0x5749('0x69'));logger[_0x5749('0x68')](_0x5749('0x6a'));});});}return null;})['catch'](handleError(_0x516052,null));};exports[_0x5749('0x6b')]=function(_0x2887c6,_0x3787a6,_0x26a945){var _0x57273f=path[_0x5749('0x58')](_0x2887c6[_0x5749('0x6c')][_0x5749('0x6d')],path[_0x5749('0x6e')](_0x2887c6[_0x5749('0x6c')]['filename']));var _0x19ef0e=path['join'](config[_0x5749('0x54')],_0x5749('0x55'),_0x2887c6['file'][_0x5749('0x6d')]);var _0x133ff1=path[_0x5749('0x53')](config[_0x5749('0x54')],_0x5749('0x55'),_0x57273f);logger[_0x5749('0x68')](_0x5749('0x6f'),_0x19ef0e);logger[_0x5749('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x133ff1);try{fs[_0x5749('0x70')](_0x19ef0e,parseInt('0777',0x8));extract(_0x19ef0e,{'dir':_0x133ff1},function(_0x3992f0){if(_0x3992f0){logger[_0x5749('0x2f')](_0x3992f0);handleError(_0x3992f0,!![]);};var _0x3915ec=fs[_0x5749('0x71')](_0x133ff1);if(_0x3915ec['length']>0x1){removeReferences(_0x19ef0e,_0x133ff1);logger[_0x5749('0x2f')]('Invalid\x20plugin\x20structure');return _0x26a945(new Error(_0x5749('0x72')));}var _0x7a7cd7=fs[_0x5749('0x73')](path['join'](_0x133ff1,_0x3915ec[0x0]));if(_0x7a7cd7[_0x5749('0x74')]()){removeReferences(_0x19ef0e,_0x133ff1);logger[_0x5749('0x2f')](_0x5749('0x72'));return _0x26a945(new Error('Invalid\x20plugin\x20structure'));}if(_0x7a7cd7[_0x5749('0x75')]()){var _0x5cb087=fs['readdirSync'](path[_0x5749('0x53')](_0x133ff1,_0x3915ec[0x0]));if(_0x5cb087[_0x5749('0x3f')]===0x0){removeReferences(_0x19ef0e,_0x133ff1);logger[_0x5749('0x2f')](_0x5749('0x72'));return _0x26a945(new Error(_0x5749('0x72')));}var _0x397395=_0x5cb087['some'](function(_0x422492){return _0x422492===_0x5749('0x76');});if(!_0x397395){return _0x26a945(new Error('Plugin\x20manifest\x20missing'));}var _0x254614=fs[_0x5749('0x77')](path[_0x5749('0x53')](_0x133ff1,_0x3915ec[0x0],_0x5749('0x76')));var _0x19973d=JSON['parse'](_0x254614);if(_0x5749('0x24')==typeof _0x19973d['name']){return _0x26a945(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x19973d[_0x5749('0x47')]){return _0x26a945(new Error(_0x5749('0x78')));}if(_0x5749('0x24')==typeof _0x19973d['version']){return _0x26a945(new Error(_0x5749('0x79')));}if('undefined'==typeof _0x19973d[_0x5749('0x7a')]){return _0x26a945(new Error(_0x5749('0x7b')));}if(_0x19973d['type']===_0x5749('0x7c')){if('undefined'==typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x7d')]){return _0x26a945(new Error(_0x5749('0x7e')));}if(_0x5749('0x24')==typeof _0x19973d['parameters']['views']['admin']&&_0x5749('0x24')==typeof _0x19973d['parameters'][_0x5749('0x7d')][_0x5749('0x7f')]){return _0x26a945(new Error(_0x5749('0x80')));}}else if(_0x19973d[_0x5749('0x47')]===_0x5749('0x81')){if(_0x5749('0x24')==typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x82')]){return _0x26a945(new Error(_0x5749('0x83')));}if(_0x5749('0x24')==typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x84')]){return _0x26a945(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x26a945(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0xde4654=_0x19973d[_0x5749('0x31')];var _0x208989=_0x19973d[_0x5749('0x85')];var _0x80b9c9=_0x19973d[_0x5749('0x47')];var _0x21f996=_0x19973d[_0x5749('0x86')]?_0x19973d[_0x5749('0x86')]:_0x5749('0x87');var _0x2c1791=_0x19973d[_0x5749('0x88')]?_0x19973d[_0x5749('0x88')]:_0x5749('0x89');var _0x2b9370='';var _0x5bd9c1='';var _0x5cab49='';var _0xcd82e1='';var _0x36b2f8=_0x19973d[_0x5749('0x8a')];if(_0x80b9c9==='html'){if(_0x5749('0x24')!=typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x7d')]['admin']){var _0x2db853=_0x19973d['parameters'][_0x5749('0x7d')][_0x5749('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x5749('0x8c')](_0x2db853)){_0x2b9370=path[_0x5749('0x53')](_0x5749('0x8d'),_0x57273f,_0x3915ec[0x0],_0x2db853);}else{_0x2b9370=_0x2db853;}}else{logger['info'](_0x5749('0x8e'));}if(_0x5749('0x24')!=typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x7d')][_0x5749('0x7f')]){var _0x1c7b4a=_0x19973d[_0x5749('0x7a')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5749('0x8c')](_0x1c7b4a)){_0x5bd9c1=path[_0x5749('0x53')](_0x5749('0x8d'),_0x57273f,_0x3915ec[0x0],_0x1c7b4a);}else{_0x5bd9c1=_0x1c7b4a;}}else{logger['info'](_0x5749('0x8f'));}}else if(_0x80b9c9===_0x5749('0x81')){_0x5cab49=_0x19973d[_0x5749('0x7a')][_0x5749('0x82')];_0xcd82e1=_0x19973d[_0x5749('0x7a')][_0x5749('0x84')];if('undefined'!=typeof _0x19973d[_0x5749('0x7a')]['views']){if(_0x5749('0x24')!=typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x7d')][_0x5749('0x8b')]){var _0x2db853=_0x19973d[_0x5749('0x7a')][_0x5749('0x7d')][_0x5749('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x5749('0x8c')](_0x2db853)){_0x2b9370=path['join'](_0x5749('0x8d'),_0x57273f,_0x3915ec[0x0],_0x2db853);}else{_0x2b9370=_0x2db853;}}if(_0x5749('0x24')!=typeof _0x19973d[_0x5749('0x7a')][_0x5749('0x7d')]['agent']){var _0x1c7b4a=_0x19973d[_0x5749('0x7a')][_0x5749('0x7d')][_0x5749('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x5749('0x8c')](_0x1c7b4a)){_0x5bd9c1=path[_0x5749('0x53')]('plugins',_0x57273f,_0x3915ec[0x0],_0x1c7b4a);}else{_0x5bd9c1=_0x1c7b4a;}}}}var _0x5261ed={'name':_0xde4654,'description':_0x208989,'path':path[_0x5749('0x53')](_0x57273f,_0x3915ec[0x0]),'type':_0x80b9c9,'sidebar':_0x21f996,'icon':_0x2c1791,'adminUrl':_0x2b9370,'agentUrl':_0x5bd9c1,'scriptName':_0x5cab49,'scriptPath':_0xcd82e1,'version':_0x36b2f8};removeReferences(_0x19ef0e,null);return db[_0x5749('0x35')][_0x5749('0x90')](_0x5261ed)[_0x5749('0x29')](function(_0x3f7e16){var _0x1cc92d={'role':_0x2887c6[_0x5749('0x91')][_0x5749('0x92')],'userProfileId':_0x2887c6['body'][_0x5749('0x93')]};if(!_0x1cc92d)throw new Error(_0x5749('0x94'));if(_0x1cc92d[_0x5749('0x92')]===_0x5749('0x95')){var _0x576101=_0x3f7e16[_0x5749('0x2b')]({'plain':!![]});return db[_0x5749('0x96')][_0x5749('0x51')]({'where':{'name':_0x5749('0x2c'),'userProfileId':_0x1cc92d[_0x5749('0x93')]},'raw':!![]})[_0x5749('0x29')](function(_0x87432c){if(_0x87432c&&_0x87432c[_0x5749('0x97')]===0x0){return db[_0x5749('0x2d')][_0x5749('0x90')]({'name':_0x576101[_0x5749('0x31')],'resourceId':_0x576101['id'],'type':_0x87432c[_0x5749('0x31')],'sectionId':_0x87432c['id']},{})[_0x5749('0x29')](function(){return _0x3f7e16;});}else{return _0x3f7e16;}})[_0x5749('0x4d')](function(_0x29cbc3){logger[_0x5749('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29cbc3);throw _0x29cbc3;});}return _0x3f7e16;})['then'](respondWithResult(_0x3787a6,null))[_0x5749('0x4d')](handleError(_0x3787a6,null));}});}catch(_0x49c488){_0x3787a6[_0x5749('0x20')](0x1f4)['send'](_0x49c488);}};function removeReferences(_0x47b7a1,_0x460e07){try{if(_0x47b7a1){fs['unlinkSync'](_0x47b7a1);logger[_0x5749('0x68')](_0x5749('0x98'));}if(_0x460e07){rimraf(_0x460e07,function(){});logger['info'](_0x5749('0x99'));}}catch(_0x1538ba){logger[_0x5749('0x2f')](_0x1538ba);}}exports[_0x5749('0x9a')]=function(_0x599d5c,_0x4ccd45,_0x32d863){return db[_0x5749('0x35')][_0x5749('0x51')]({'where':{'id':_0x599d5c[_0x5749('0x4f')]['id']}})[_0x5749('0x29')](handleEntityNotFound(_0x4ccd45,null))[_0x5749('0x29')](saveUpdates(_0x599d5c[_0x5749('0x91')],null))[_0x5749('0x29')](respondWithResult(_0x4ccd45,null))[_0x5749('0x4d')](handleError(_0x4ccd45,null));};exports[_0x5749('0x9b')]=function(_0x2e005a,_0x16c9f8,_0xb9e521){return db['Plugin'][_0x5749('0x51')]({'where':{'id':_0x2e005a[_0x5749('0x4f')]['id']}})[_0x5749('0x29')](function(_0x4fcdbb){if(_0x4fcdbb){return _0x4fcdbb[_0x5749('0x2a')]();}})[_0x5749('0x29')](function(_0x13e43a){rimraf(path[_0x5749('0x53')](config[_0x5749('0x54')],_0x5749('0x55'),path['dirname'](_0x13e43a[_0x5749('0x7')])),function(){});return _0x13e43a;})['then'](handleEntityNotFound(_0x16c9f8,null))[_0x5749('0x29')](respondWithStatusCode(_0x16c9f8,null))[_0x5749('0x4d')](handleError(_0x16c9f8,null));};exports[_0x5749('0x9c')]=function(_0x527499,_0x213404,_0x52fe46){return BPromise[_0x5749('0x9d')]()['then'](function(){if(!_0x527499[_0x5749('0x39')]['path']){throw new Error(_0x5749('0x9e'));}if(!_0x527499[_0x5749('0x39')]['port']){throw new Error(_0x5749('0x9f'));}var _0x53b8ae=_0x527499['query'][_0x5749('0xa0')]?_0x527499[_0x5749('0x39')][_0x5749('0xa0')]+':'+_0x527499['query'][_0x5749('0xa1')]:_0x5749('0xa2')+_0x527499[_0x5749('0x39')][_0x5749('0xa1')];var _0x1eed2f=_0x527499['query'][_0x5749('0x21')]?_0x527499[_0x5749('0x39')][_0x5749('0x21')]:!![];var _0x8c5468=_0x527499[_0x5749('0x39')][_0x5749('0xa3')]?_0x527499[_0x5749('0x39')]['encoding']:null;var _0x2e402c={'method':_0x527499[_0x5749('0xa4')],'uri':util[_0x5749('0x56')](_0x5749('0xa5'),_0x53b8ae,_0x527499[_0x5749('0x39')][_0x5749('0x7')]),'json':_0x1eed2f,'resolveWithFullResponse':!![],'encoding':_0x8c5468,'qs':_0x527499[_0x5749('0x39')]};if(_0x527499['headers']){_0x2e402c[_0x5749('0xa6')]=_0x527499['headers'];if(_0x2e402c[_0x5749('0xa6')][_0x5749('0xa7')]){delete _0x2e402c[_0x5749('0xa6')]['content-length'];}}if(_0x2e402c['headers'][_0x5749('0xa8')]){delete _0x2e402c[_0x5749('0xa6')][_0x5749('0xa8')];}return rp(_0x2e402c);})['then'](function(_0x7e7cf3){if(_0x7e7cf3){_0x213404['set'](_0x7e7cf3[_0x5749('0xa6')]);logger[_0x5749('0x68')](_0x7e7cf3[_0x5749('0x91')]);if(_[_0x5749('0xa9')](_0x527499[_0x5749('0x39')][_0x5749('0x7')],_0x5749('0x52'))&&_0x7e7cf3[_0x5749('0xaa')]==0x1f4){return _0x213404[_0x5749('0x1f')](_0x7e7cf3['statusCode']);}else{return _0x213404[_0x5749('0x20')](_0x7e7cf3[_0x5749('0xaa')])[_0x5749('0x32')](_0x7e7cf3['body']);}}else{return _0x213404[_0x5749('0x1f')](0xc8);}})['catch'](handleError(_0x213404,null));};exports[_0x5749('0xab')]=function(_0x3013cd,_0x4162d9,_0x458337){return BPromise[_0x5749('0x9d')]()[_0x5749('0x29')](function(){if(!_0x3013cd[_0x5749('0x39')][_0x5749('0x7')]){throw new Error(_0x5749('0x9e'));}if(!_0x3013cd[_0x5749('0x39')][_0x5749('0xa1')]){throw new Error(_0x5749('0x9f'));}var _0x3948b0=_0x3013cd[_0x5749('0x39')][_0x5749('0xa0')]?_0x3013cd['query'][_0x5749('0xa0')]+':'+_0x3013cd[_0x5749('0x39')][_0x5749('0xa1')]:_0x5749('0xa2')+_0x3013cd[_0x5749('0x39')][_0x5749('0xa1')];var _0x64e085=_0x3013cd[_0x5749('0x39')][_0x5749('0x21')]?_0x3013cd[_0x5749('0x39')]['json']:!![];var _0x40f9ba=_0x3013cd[_0x5749('0x39')][_0x5749('0xa3')]?_0x3013cd[_0x5749('0x39')][_0x5749('0xa3')]:null;var _0x11168c={'method':_0x3013cd['method'],'uri':util[_0x5749('0x56')]('%s%s',_0x3948b0,_0x3013cd[_0x5749('0x39')][_0x5749('0x7')]),'json':_0x64e085,'resolveWithFullResponse':!![],'encoding':_0x40f9ba,'body':_0x3013cd[_0x5749('0x91')]};if(_0x3013cd[_0x5749('0xa6')]){_0x11168c['headers']=_0x3013cd['headers'];if(_0x11168c[_0x5749('0xa6')][_0x5749('0xa7')]){delete _0x11168c['headers'][_0x5749('0xa7')];}}if(_0x11168c[_0x5749('0xa6')][_0x5749('0xa8')]){delete _0x11168c[_0x5749('0xa6')][_0x5749('0xa8')];}return rp(_0x11168c);})[_0x5749('0x29')](function(_0x459078){if(_0x459078){_0x4162d9[_0x5749('0x26')](_0x459078[_0x5749('0xa6')]);logger[_0x5749('0x68')](_0x459078['body']);return _0x4162d9['status'](_0x459078['statusCode'])[_0x5749('0x32')](_0x459078[_0x5749('0x91')]);}else{return _0x4162d9[_0x5749('0x1f')](0xc8);}})[_0x5749('0x4d')](handleError(_0x4162d9,null));}; \ No newline at end of file +var _0xc7c8=['%s%s','eml-format','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','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','download','params','join','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','server/files/plugins','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','Plugin\x20manifest\x20missing','manifest.json','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon-apps','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Plugins','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Extracted\x20folder\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','method'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xc7c8,0x16d));var _0x8c7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc7c8[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x8c7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c7c('0x1'));var jsonpatch=require(_0x8c7c('0x2'));var rp=require(_0x8c7c('0x3'));var moment=require(_0x8c7c('0x4'));var BPromise=require(_0x8c7c('0x5'));var Mustache=require(_0x8c7c('0x6'));var util=require(_0x8c7c('0x7'));var path=require(_0x8c7c('0x8'));var sox=require(_0x8c7c('0x9'));var csv=require(_0x8c7c('0xa'));var ejs=require(_0x8c7c('0xb'));var fs=require('fs');var fs_extra=require(_0x8c7c('0xc'));var _=require(_0x8c7c('0xd'));var squel=require(_0x8c7c('0xe'));var crypto=require(_0x8c7c('0xf'));var jsforce=require(_0x8c7c('0x10'));var deskjs=require(_0x8c7c('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8c7c('0x12'));var Papa=require('papaparse');var extract=require(_0x8c7c('0x13'));var rimraf=require(_0x8c7c('0x14'));var archiver=require(_0x8c7c('0x15'));var Redis=require(_0x8c7c('0x16'));var authService=require(_0x8c7c('0x17'));var qs=require(_0x8c7c('0x18'));var as=require(_0x8c7c('0x19'));var hardwareService=require(_0x8c7c('0x1a'));var logger=require(_0x8c7c('0x1b'))(_0x8c7c('0x1c'));var utils=require(_0x8c7c('0x1d'));var config=require(_0x8c7c('0x1e'));var licenseUtil=require(_0x8c7c('0x1f'));var db=require(_0x8c7c('0x20'))['db'];config[_0x8c7c('0x21')]=_[_0x8c7c('0x22')](config['redis'],{'host':_0x8c7c('0x23'),'port':0x18eb});var socket=require(_0x8c7c('0x24'))(new Redis(config[_0x8c7c('0x21')]));require(_0x8c7c('0x25'))['register'](socket);function respondWithStatusCode(_0x4e0569,_0x50d92e){_0x50d92e=_0x50d92e||0xcc;return function(_0x4e43c2){if(_0x4e43c2){return _0x4e0569[_0x8c7c('0x26')](_0x50d92e);}return _0x4e0569[_0x8c7c('0x27')](_0x50d92e)[_0x8c7c('0x28')]();};}function respondWithResult(_0x190c1a,_0x2609f0){_0x2609f0=_0x2609f0||0xc8;return function(_0x3445d1){if(_0x3445d1){return _0x190c1a[_0x8c7c('0x27')](_0x2609f0)[_0x8c7c('0x29')](_0x3445d1);}};}function respondWithFilteredResult(_0x516201,_0x53eb88){return function(_0x210f22){if(_0x210f22){var _0x14b627=typeof _0x53eb88['offset']===_0x8c7c('0x2a')&&typeof _0x53eb88[_0x8c7c('0x2b')]==='undefined';var _0x2ee3b9=_0x210f22[_0x8c7c('0x2c')];var _0x489512=_0x14b627?0x0:_0x53eb88['offset'];var _0x237490=_0x14b627?_0x210f22[_0x8c7c('0x2c')]:_0x53eb88['offset']+_0x53eb88[_0x8c7c('0x2b')];var _0x169988;if(_0x237490>=_0x2ee3b9){_0x237490=_0x2ee3b9;_0x169988=0xc8;}else{_0x169988=0xce;}_0x516201[_0x8c7c('0x27')](_0x169988);return _0x516201[_0x8c7c('0x2d')](_0x8c7c('0x2e'),_0x489512+'-'+_0x237490+'/'+_0x2ee3b9)[_0x8c7c('0x29')](_0x210f22);}return null;};}function patchUpdates(_0x3fe475){return function(_0x3cad68){try{jsonpatch[_0x8c7c('0x2f')](_0x3cad68,_0x3fe475,!![]);}catch(_0x477527){return BPromise[_0x8c7c('0x30')](_0x477527);}return _0x3cad68[_0x8c7c('0x31')]();};}function saveUpdates(_0xe8b1e0,_0x4fd7a0){return function(_0x3d6917){if(_0x3d6917){return _0x3d6917[_0x8c7c('0x32')](_0xe8b1e0)[_0x8c7c('0x33')](function(_0x8827e9){return _0x8827e9;});}return null;};}function removeEntity(_0x40caab,_0xa418ab){return function(_0x2cb022){if(_0x2cb022){return _0x2cb022[_0x8c7c('0x34')]()[_0x8c7c('0x33')](function(){var _0x1949ea=_0x2cb022[_0x8c7c('0x35')]({'plain':!![]});var _0x1eaba0='Plugins';return db['UserProfileResource'][_0x8c7c('0x34')]({'where':{'type':_0x1eaba0,'resourceId':_0x1949ea['id']}})['then'](function(){return _0x2cb022;});})[_0x8c7c('0x33')](function(){_0x40caab[_0x8c7c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed438,_0x22c877){return function(_0x505ee9){if(!_0x505ee9){_0x2ed438['sendStatus'](0x194);}return _0x505ee9;};}function handleError(_0x537997,_0x23dfca){_0x23dfca=_0x23dfca||0x1f4;return function(_0x28be47){logger[_0x8c7c('0x36')](_0x28be47['stack']);if(_0x28be47[_0x8c7c('0x37')]){delete _0x28be47[_0x8c7c('0x37')];}_0x537997['status'](_0x23dfca)['send'](_0x28be47);};}exports[_0x8c7c('0x38')]=function(_0x305533,_0x25e7a1){var _0x348723={},_0x550d78={},_0x1d8610={'count':0x0,'rows':[]};var _0x2e5352=_[_0x8c7c('0x39')](db[_0x8c7c('0x3a')][_0x8c7c('0x3b')],function(_0x2ecbb4){return{'name':_0x2ecbb4[_0x8c7c('0x3c')],'type':_0x2ecbb4[_0x8c7c('0x3d')][_0x8c7c('0x3e')]};});_0x550d78[_0x8c7c('0x3f')]=_['map'](_0x2e5352,_0x8c7c('0x37'));_0x550d78['query']=_[_0x8c7c('0x40')](_0x305533['query']);_0x550d78[_0x8c7c('0x41')]=_[_0x8c7c('0x42')](_0x550d78[_0x8c7c('0x3f')],_0x550d78[_0x8c7c('0x43')]);_0x348723['attributes']=_[_0x8c7c('0x42')](_0x550d78[_0x8c7c('0x3f')],qs[_0x8c7c('0x44')](_0x305533['query']['fields']));_0x348723[_0x8c7c('0x45')]=_0x348723['attributes'][_0x8c7c('0x46')]?_0x348723[_0x8c7c('0x45')]:_0x550d78[_0x8c7c('0x3f')];if(!_0x305533[_0x8c7c('0x43')][_0x8c7c('0x47')](_0x8c7c('0x48'))){_0x348723[_0x8c7c('0x2b')]=qs['limit'](_0x305533[_0x8c7c('0x43')]['limit']);_0x348723[_0x8c7c('0x49')]=qs['offset'](_0x305533[_0x8c7c('0x43')][_0x8c7c('0x49')]);}_0x348723['order']=qs[_0x8c7c('0x4a')](_0x305533[_0x8c7c('0x43')][_0x8c7c('0x4a')]);_0x348723[_0x8c7c('0x4b')]=qs[_0x8c7c('0x41')](_[_0x8c7c('0x4c')](_0x305533[_0x8c7c('0x43')],_0x550d78[_0x8c7c('0x41')]),_0x2e5352);if(_0x305533[_0x8c7c('0x43')][_0x8c7c('0x4d')]){_0x348723[_0x8c7c('0x4b')]=_[_0x8c7c('0x4e')](_0x348723[_0x8c7c('0x4b')],{'$or':_[_0x8c7c('0x39')](_0x2e5352,function(_0x48a960){if(_0x48a960[_0x8c7c('0x3d')]!==_0x8c7c('0x4f')){var _0x42e1c3={};_0x42e1c3[_0x48a960[_0x8c7c('0x37')]]={'$like':'%'+_0x305533['query'][_0x8c7c('0x4d')]+'%'};return _0x42e1c3;}})});}_0x348723=_[_0x8c7c('0x4e')]({},_0x348723,_0x305533[_0x8c7c('0x50')]);var _0x456dd7={'where':_0x348723[_0x8c7c('0x4b')]};return db['Plugin'][_0x8c7c('0x2c')](_0x456dd7)['then'](function(_0xd9a6ec){_0x1d8610['count']=_0xd9a6ec;if(_0x305533[_0x8c7c('0x43')][_0x8c7c('0x51')]){_0x348723['include']=[{'all':!![]}];}return db[_0x8c7c('0x3a')][_0x8c7c('0x52')](_0x348723);})[_0x8c7c('0x33')](function(_0x4fc775){_0x1d8610[_0x8c7c('0x53')]=_0x4fc775;return _0x1d8610;})[_0x8c7c('0x33')](respondWithFilteredResult(_0x25e7a1,_0x348723))['catch'](handleError(_0x25e7a1,null));};exports[_0x8c7c('0x54')]=function(_0x2bbaee,_0x223fb8){var _0x1e45f6={'raw':!![],'where':{'id':_0x2bbaee['params']['id']}},_0x15a3dd={};_0x15a3dd[_0x8c7c('0x3f')]=_['keys'](db[_0x8c7c('0x3a')][_0x8c7c('0x3b')]);_0x15a3dd['query']=_[_0x8c7c('0x40')](_0x2bbaee[_0x8c7c('0x43')]);_0x15a3dd['filters']=_['intersection'](_0x15a3dd[_0x8c7c('0x3f')],_0x15a3dd[_0x8c7c('0x43')]);_0x1e45f6[_0x8c7c('0x45')]=_[_0x8c7c('0x42')](_0x15a3dd[_0x8c7c('0x3f')],qs[_0x8c7c('0x44')](_0x2bbaee[_0x8c7c('0x43')]['fields']));_0x1e45f6['attributes']=_0x1e45f6[_0x8c7c('0x45')][_0x8c7c('0x46')]?_0x1e45f6[_0x8c7c('0x45')]:_0x15a3dd[_0x8c7c('0x3f')];if(_0x2bbaee[_0x8c7c('0x43')]['includeAll']){_0x1e45f6[_0x8c7c('0x55')]=[{'all':!![]}];}_0x1e45f6=_[_0x8c7c('0x4e')]({},_0x1e45f6,_0x2bbaee[_0x8c7c('0x50')]);return db['Plugin'][_0x8c7c('0x56')](_0x1e45f6)['then'](handleEntityNotFound(_0x223fb8,null))[_0x8c7c('0x33')](respondWithResult(_0x223fb8,null))['catch'](handleError(_0x223fb8,null));};exports[_0x8c7c('0x57')]=function(_0x40b9d8,_0x2644b3,_0x32160e){return db['Plugin'][_0x8c7c('0x56')]({'where':{'id':_0x40b9d8[_0x8c7c('0x58')]['id']},'attributes':[_0x8c7c('0x37'),_0x8c7c('0x8')],'raw':!![]})[_0x8c7c('0x33')](handleEntityNotFound(_0x2644b3,null))['then'](function(_0x486fb4){if(_0x486fb4){var _0x479f08=path[_0x8c7c('0x59')](config['root'],'server/files/plugins',util['format'](_0x8c7c('0x5a'),path[_0x8c7c('0x5b')](_0x486fb4[_0x8c7c('0x8')])));var _0x35c031=fs[_0x8c7c('0x5c')](_0x479f08);var _0x5cbc4f=archiver(_0x8c7c('0x5d'),{'zlib':{'level':0x9}});_0x5cbc4f['on'](_0x8c7c('0x5e'),function(_0x13c4c2){if(_0x13c4c2[_0x8c7c('0x5f')]===_0x8c7c('0x60')){logger[_0x8c7c('0x36')](_0x13c4c2);}else{throw new db[(_0x8c7c('0x61'))][(_0x8c7c('0x62'))](_0x8c7c('0x63'));}});_0x5cbc4f['on'](_0x8c7c('0x36'),function(_0x4df8c6){throw new db['Sequelize'][(_0x8c7c('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5cbc4f['pipe'](_0x35c031);_0x5cbc4f['glob'](_0x8c7c('0x64'),{'cwd':path[_0x8c7c('0x59')](config['root'],_0x8c7c('0x65'),path['dirname'](_0x486fb4[_0x8c7c('0x8')])),'ignore':[path[_0x8c7c('0x59')](path[_0x8c7c('0x5b')](_0x486fb4[_0x8c7c('0x8')]),_0x8c7c('0x66')),path[_0x8c7c('0x59')](path['basename'](_0x486fb4[_0x8c7c('0x8')]),_0x8c7c('0x67'))],'nodir':!![]})[_0x8c7c('0x68')]();_0x35c031['on'](_0x8c7c('0x69'),function(){if(!fs[_0x8c7c('0x6a')](_0x479f08)){throw new db[(_0x8c7c('0x61'))][(_0x8c7c('0x62'))](_0x8c7c('0x6b'));}return _0x2644b3['download'](_0x479f08,util[_0x8c7c('0x6c')](_0x8c7c('0x5a'),path[_0x8c7c('0x5b')](_0x486fb4['path'])),function(_0x165575){if(_0x165575){throw new db[(_0x8c7c('0x61'))][(_0x8c7c('0x62'))](_0x8c7c('0x6d'));}fs[_0x8c7c('0x6e')](_0x479f08);logger[_0x8c7c('0x6f')](_0x8c7c('0x70'));logger[_0x8c7c('0x6f')](_0x8c7c('0x71'));});});}return null;})['catch'](handleError(_0x2644b3,null));};exports[_0x8c7c('0x72')]=function(_0x513cec,_0x57204c,_0x51a82a){var _0x27af42=path[_0x8c7c('0x5b')](_0x513cec[_0x8c7c('0x73')][_0x8c7c('0x74')],path[_0x8c7c('0x75')](_0x513cec[_0x8c7c('0x73')][_0x8c7c('0x74')]));var _0x17eac5=path[_0x8c7c('0x59')](config[_0x8c7c('0x76')],'server/files/plugins',_0x513cec['file']['filename']);var _0x50feeb=path[_0x8c7c('0x59')](config[_0x8c7c('0x76')],_0x8c7c('0x65'),_0x27af42);logger[_0x8c7c('0x6f')](_0x8c7c('0x77'),_0x17eac5);logger['info'](_0x8c7c('0x78'),_0x50feeb);try{fs[_0x8c7c('0x79')](_0x17eac5,parseInt('0777',0x8));extract(_0x17eac5,{'dir':_0x50feeb},function(_0x21cc2a){if(_0x21cc2a){logger[_0x8c7c('0x36')](_0x21cc2a);handleError(_0x21cc2a,!![]);};var _0x455ff5=fs[_0x8c7c('0x7a')](_0x50feeb);if(_0x455ff5['length']>0x1){removeReferences(_0x17eac5,_0x50feeb);logger['error'](_0x8c7c('0x7b'));return _0x51a82a(new Error(_0x8c7c('0x7b')));}var _0x1d1376=fs[_0x8c7c('0x7c')](path[_0x8c7c('0x59')](_0x50feeb,_0x455ff5[0x0]));if(_0x1d1376[_0x8c7c('0x7d')]()){removeReferences(_0x17eac5,_0x50feeb);logger[_0x8c7c('0x36')](_0x8c7c('0x7b'));return _0x51a82a(new Error(_0x8c7c('0x7b')));}if(_0x1d1376[_0x8c7c('0x7e')]()){var _0x156262=fs[_0x8c7c('0x7a')](path['join'](_0x50feeb,_0x455ff5[0x0]));if(_0x156262[_0x8c7c('0x46')]===0x0){removeReferences(_0x17eac5,_0x50feeb);logger['error']('Invalid\x20plugin\x20structure');return _0x51a82a(new Error('Invalid\x20plugin\x20structure'));}var _0x14e1b9=_0x156262['some'](function(_0xb50a3c){return _0xb50a3c==='manifest.json';});if(!_0x14e1b9){return _0x51a82a(new Error(_0x8c7c('0x7f')));}var _0x17e894=fs['readFileSync'](path[_0x8c7c('0x59')](_0x50feeb,_0x455ff5[0x0],_0x8c7c('0x80')));var _0x69f819=JSON['parse'](_0x17e894);if(_0x8c7c('0x2a')==typeof _0x69f819['name']){return _0x51a82a(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x69f819['type']){return _0x51a82a(new Error(_0x8c7c('0x81')));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x82')]){return _0x51a82a(new Error(_0x8c7c('0x83')));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x84')]){return _0x51a82a(new Error(_0x8c7c('0x85')));}if(_0x69f819['type']===_0x8c7c('0x86')){if('undefined'==typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]){return _0x51a82a(new Error(_0x8c7c('0x88')));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]['admin']&&_0x8c7c('0x2a')==typeof _0x69f819['parameters'][_0x8c7c('0x87')][_0x8c7c('0x89')]){return _0x51a82a(new Error(_0x8c7c('0x8a')));}}else if(_0x69f819[_0x8c7c('0x3d')]===_0x8c7c('0x8b')){if(_0x8c7c('0x2a')==typeof _0x69f819['parameters'][_0x8c7c('0x8c')]){return _0x51a82a(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x8d')]){return _0x51a82a(new Error(_0x8c7c('0x8e')));}}else{return _0x51a82a(new Error(_0x8c7c('0x8f')));}var _0x124a94=_0x69f819[_0x8c7c('0x37')];var _0x3f2dd9=_0x69f819[_0x8c7c('0x90')];var _0x34c09d=_0x69f819[_0x8c7c('0x3d')];var _0xa7eb80=_0x69f819['sidebar']?_0x69f819[_0x8c7c('0x91')]:'always';var _0x329353=_0x69f819['icon']?_0x69f819['icon']:_0x8c7c('0x92');var _0x11878c='';var _0x4e2a0b='';var _0x36483b='';var _0x512dd3='';var _0x536272=_0x69f819[_0x8c7c('0x82')];if(_0x34c09d===_0x8c7c('0x86')){if(_0x8c7c('0x2a')!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x93')]){var _0x3d3f4d=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x93')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3d3f4d)){_0x11878c=path[_0x8c7c('0x59')](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x3d3f4d);}else{_0x11878c=_0x3d3f4d;}}else{logger[_0x8c7c('0x6f')](_0x8c7c('0x95'));}if('undefined'!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]['agent']){var _0x36fd86=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x8c7c('0x96')](_0x36fd86)){_0x4e2a0b=path[_0x8c7c('0x59')](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x36fd86);}else{_0x4e2a0b=_0x36fd86;}}else{logger['info'](_0x8c7c('0x97'));}}else if(_0x34c09d==='script'){_0x36483b=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x8c')];_0x512dd3=_0x69f819['parameters'][_0x8c7c('0x8d')];if('undefined'!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]){if(_0x8c7c('0x2a')!=typeof _0x69f819['parameters'][_0x8c7c('0x87')]['admin']){var _0x3d3f4d=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x8c7c('0x96')](_0x3d3f4d)){_0x11878c=path['join'](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x3d3f4d);}else{_0x11878c=_0x3d3f4d;}}if('undefined'!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x89')]){var _0x36fd86=_0x69f819['parameters'][_0x8c7c('0x87')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x8c7c('0x96')](_0x36fd86)){_0x4e2a0b=path[_0x8c7c('0x59')](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x36fd86);}else{_0x4e2a0b=_0x36fd86;}}}}var _0xead1c4={'name':_0x124a94,'description':_0x3f2dd9,'path':path[_0x8c7c('0x59')](_0x27af42,_0x455ff5[0x0]),'type':_0x34c09d,'sidebar':_0xa7eb80,'icon':_0x329353,'adminUrl':_0x11878c,'agentUrl':_0x4e2a0b,'scriptName':_0x36483b,'scriptPath':_0x512dd3,'version':_0x536272};removeReferences(_0x17eac5,null);return db[_0x8c7c('0x3a')][_0x8c7c('0x98')](_0xead1c4)['then'](function(_0x572889){var _0xbe11d2={'role':_0x513cec[_0x8c7c('0x99')]['role'],'userProfileId':_0x513cec[_0x8c7c('0x99')][_0x8c7c('0x9a')]};if(!_0xbe11d2)throw new Error(_0x8c7c('0x9b'));if(_0xbe11d2[_0x8c7c('0x9c')]===_0x8c7c('0x9d')){var _0x4db5fa=_0x572889[_0x8c7c('0x35')]({'plain':!![]});return db['UserProfileSection'][_0x8c7c('0x56')]({'where':{'name':_0x8c7c('0x9e'),'userProfileId':_0xbe11d2[_0x8c7c('0x9a')]},'raw':!![]})[_0x8c7c('0x33')](function(_0x3c7f83){if(_0x3c7f83&&_0x3c7f83[_0x8c7c('0x9f')]===0x0){return db['UserProfileResource'][_0x8c7c('0x98')]({'name':_0x4db5fa[_0x8c7c('0x37')],'resourceId':_0x4db5fa['id'],'type':_0x3c7f83[_0x8c7c('0x37')],'sectionId':_0x3c7f83['id']},{})[_0x8c7c('0x33')](function(){return _0x572889;});}else{return _0x572889;}})[_0x8c7c('0xa0')](function(_0x5ea0f5){logger[_0x8c7c('0x36')](_0x8c7c('0xa1'),_0x5ea0f5);throw _0x5ea0f5;});}return _0x572889;})[_0x8c7c('0x33')](respondWithResult(_0x57204c,null))[_0x8c7c('0xa0')](handleError(_0x57204c,null));}});}catch(_0x362c0e){_0x57204c[_0x8c7c('0x27')](0x1f4)[_0x8c7c('0xa2')](_0x362c0e);}};function removeReferences(_0xdee235,_0x3b6a3c){try{if(_0xdee235){fs['unlinkSync'](_0xdee235);logger['info']('Zip\x20archive\x20removed');}if(_0x3b6a3c){rimraf(_0x3b6a3c,function(){});logger[_0x8c7c('0x6f')](_0x8c7c('0xa3'));}}catch(_0x244809){logger['error'](_0x244809);}}exports[_0x8c7c('0x32')]=function(_0x1e5f5a,_0x5b72db,_0x459f64){return db[_0x8c7c('0x3a')][_0x8c7c('0x56')]({'where':{'id':_0x1e5f5a['params']['id']}})[_0x8c7c('0x33')](handleEntityNotFound(_0x5b72db,null))['then'](saveUpdates(_0x1e5f5a[_0x8c7c('0x99')],null))[_0x8c7c('0x33')](respondWithResult(_0x5b72db,null))[_0x8c7c('0xa0')](handleError(_0x5b72db,null));};exports[_0x8c7c('0xa4')]=function(_0x55605f,_0x25f0de,_0x3a21e2){return db[_0x8c7c('0x3a')]['find']({'where':{'id':_0x55605f['params']['id']}})[_0x8c7c('0x33')](function(_0x55e9b4){if(_0x55e9b4){return _0x55e9b4[_0x8c7c('0x34')]();}})[_0x8c7c('0x33')](function(_0x521085){rimraf(path[_0x8c7c('0x59')](config[_0x8c7c('0x76')],'server/files/plugins',path[_0x8c7c('0xa5')](_0x521085[_0x8c7c('0x8')])),function(){});return _0x521085;})['then'](handleEntityNotFound(_0x25f0de,null))['then'](respondWithStatusCode(_0x25f0de,null))['catch'](handleError(_0x25f0de,null));};exports[_0x8c7c('0xa6')]=function(_0x477354,_0x290bfe,_0x3936dd){return BPromise['resolve']()['then'](function(){if(!_0x477354[_0x8c7c('0x43')]['path']){throw new Error(_0x8c7c('0xa7'));}if(!_0x477354[_0x8c7c('0x43')][_0x8c7c('0xa8')]){throw new Error(_0x8c7c('0xa9'));}var _0x3948a8=_0x477354['query']['hostname']?_0x477354['query'][_0x8c7c('0xaa')]+':'+_0x477354['query'][_0x8c7c('0xa8')]:_0x8c7c('0xab')+_0x477354[_0x8c7c('0x43')][_0x8c7c('0xa8')];var _0x1ff009=_0x477354[_0x8c7c('0x43')][_0x8c7c('0x29')]?_0x477354[_0x8c7c('0x43')]['json']:!![];var _0x2720e5=_0x477354[_0x8c7c('0x43')]['encoding']?_0x477354[_0x8c7c('0x43')][_0x8c7c('0xac')]:null;var _0x1657fe={'method':_0x477354['method'],'uri':util['format']('%s%s',_0x3948a8,_0x477354[_0x8c7c('0x43')]['path']),'json':_0x1ff009,'resolveWithFullResponse':!![],'encoding':_0x2720e5,'qs':_0x477354[_0x8c7c('0x43')]};if(_0x477354[_0x8c7c('0xad')]){_0x1657fe[_0x8c7c('0xad')]=_0x477354['headers'];if(_0x1657fe[_0x8c7c('0xad')][_0x8c7c('0xae')]){delete _0x1657fe[_0x8c7c('0xad')][_0x8c7c('0xae')];}}if(_0x1657fe[_0x8c7c('0xad')]['content-type']){delete _0x1657fe[_0x8c7c('0xad')][_0x8c7c('0xaf')];}return rp(_0x1657fe);})['then'](function(_0x422a94){if(_0x422a94){_0x290bfe[_0x8c7c('0x2d')](_0x422a94[_0x8c7c('0xad')]);logger[_0x8c7c('0x6f')](_0x422a94[_0x8c7c('0x99')]);if(_[_0x8c7c('0xb0')](_0x477354['query'][_0x8c7c('0x8')],_0x8c7c('0x57'))&&_0x422a94[_0x8c7c('0xb1')]==0x1f4){return _0x290bfe[_0x8c7c('0x26')](_0x422a94['statusCode']);}else{return _0x290bfe[_0x8c7c('0x27')](_0x422a94[_0x8c7c('0xb1')])[_0x8c7c('0xa2')](_0x422a94[_0x8c7c('0x99')]);}}else{return _0x290bfe['sendStatus'](0xc8);}})[_0x8c7c('0xa0')](handleError(_0x290bfe,null));};exports[_0x8c7c('0xb2')]=function(_0xa76d08,_0x3d8266,_0x4d3357){return BPromise[_0x8c7c('0xb3')]()[_0x8c7c('0x33')](function(){if(!_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0x8')]){throw new Error(_0x8c7c('0xa7'));}if(!_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xa8')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2f9744=_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xaa')]?_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xaa')]+':'+_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xa8')]:_0x8c7c('0xab')+_0xa76d08[_0x8c7c('0x43')]['port'];var _0x417d17=_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0x29')]?_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0x29')]:!![];var _0xb4b943=_0xa76d08['query'][_0x8c7c('0xac')]?_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xac')]:null;var _0x2adf32={'method':_0xa76d08[_0x8c7c('0xb4')],'uri':util[_0x8c7c('0x6c')](_0x8c7c('0xb5'),_0x2f9744,_0xa76d08[_0x8c7c('0x43')]['path']),'json':_0x417d17,'resolveWithFullResponse':!![],'encoding':_0xb4b943,'body':_0xa76d08[_0x8c7c('0x99')]};if(_0xa76d08[_0x8c7c('0xad')]){_0x2adf32[_0x8c7c('0xad')]=_0xa76d08[_0x8c7c('0xad')];if(_0x2adf32[_0x8c7c('0xad')][_0x8c7c('0xae')]){delete _0x2adf32[_0x8c7c('0xad')][_0x8c7c('0xae')];}}if(_0x2adf32[_0x8c7c('0xad')]['content-type']){delete _0x2adf32[_0x8c7c('0xad')][_0x8c7c('0xaf')];}return rp(_0x2adf32);})[_0x8c7c('0x33')](function(_0x5d181a){if(_0x5d181a){_0x3d8266[_0x8c7c('0x2d')](_0x5d181a[_0x8c7c('0xad')]);logger[_0x8c7c('0x6f')](_0x5d181a[_0x8c7c('0x99')]);return _0x3d8266[_0x8c7c('0x27')](_0x5d181a[_0x8c7c('0xb1')])[_0x8c7c('0xa2')](_0x5d181a[_0x8c7c('0x99')]);}else{return _0x3d8266['sendStatus'](0xc8);}})['catch'](handleError(_0x3d8266,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0a19b2c..07419b8 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 _0x2e65=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x274057,_0x8e11c8){var _0x29fc37=function(_0x4b633c){while(--_0x4b633c){_0x274057['push'](_0x274057['shift']());}};_0x29fc37(++_0x8e11c8);}(_0x2e65,0x193));var _0x52e6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x2e65[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require(_0x52e6('0x0'));var Plugin=require(_0x52e6('0x1'))['db'][_0x52e6('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x52e6('0x3')](0x0);var events={'afterCreate':_0x52e6('0x4'),'afterUpdate':_0x52e6('0x5'),'afterDestroy':_0x52e6('0x6')};function emitEvent(_0x74e40d){return function(_0x47912f,_0x383919,_0x12ee44){PluginEvents[_0x52e6('0x7')](_0x74e40d+':'+_0x47912f['id'],_0x47912f);PluginEvents[_0x52e6('0x7')](_0x74e40d,_0x47912f);_0x12ee44(null);};}for(var e in events){if(events[_0x52e6('0x8')](e)){var event=events[e];Plugin[_0x52e6('0x9')](e,emitEvent(event));}}module[_0x52e6('0xa')]=PluginEvents; \ No newline at end of file +var _0xc9ab=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x170a79,_0xab81ec){var _0x487c3f=function(_0x3322b9){while(--_0x3322b9){_0x170a79['push'](_0x170a79['shift']());}};_0x487c3f(++_0xab81ec);}(_0xc9ab,0x125));var _0xbc9a=function(_0x293c66,_0x193d9b){_0x293c66=_0x293c66-0x0;var _0x4d2c4c=_0xc9ab[_0x293c66];return _0x4d2c4c;};'use strict';var EventEmitter=require(_0xbc9a('0x0'));var Plugin=require(_0xbc9a('0x1'))['db'][_0xbc9a('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbc9a('0x3')};function emitEvent(_0x20e8eb){return function(_0x23d40c,_0x33e557,_0x16f84d){PluginEvents[_0xbc9a('0x4')](_0x20e8eb+':'+_0x23d40c['id'],_0x23d40c);PluginEvents[_0xbc9a('0x4')](_0x20e8eb,_0x23d40c);_0x16f84d(null);};}for(var e in events){if(events[_0xbc9a('0x5')](e)){var event=events[e];Plugin[_0xbc9a('0x6')](e,emitEvent(event));}}module[_0xbc9a('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 23adad8..c2e2aa3 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 _0x1704=['api','bluebird','request-promise','path','rimraf','exports','define','plugins','lodash','../../config/logger'];(function(_0x52b7a5,_0x1fc015){var _0xad68e7=function(_0x25a282){while(--_0x25a282){_0x52b7a5['push'](_0x52b7a5['shift']());}};_0xad68e7(++_0x1fc015);}(_0x1704,0x9e));var _0x4170=function(_0x108069,_0x3178ea){_0x108069=_0x108069-0x0;var _0x3013ae=_0x1704[_0x108069];return _0x3013ae;};'use strict';var _=require(_0x4170('0x0'));var util=require('util');var logger=require(_0x4170('0x1'))(_0x4170('0x2'));var moment=require('moment');var BPromise=require(_0x4170('0x3'));var rp=require(_0x4170('0x4'));var fs=require('fs');var path=require(_0x4170('0x5'));var rimraf=require(_0x4170('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x4170('0x7')]=function(_0x356015,_0x3687c7){return _0x356015[_0x4170('0x8')]('Plugin',attributes,{'tableName':_0x4170('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bf2=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5bf2,0x129));var _0x25bf=function(_0xe0efa5,_0x28d42c){_0xe0efa5=_0xe0efa5-0x0;var _0x3ce13a=_0x5bf2[_0xe0efa5];return _0x3ce13a;};'use strict';var _=require(_0x25bf('0x0'));var util=require(_0x25bf('0x1'));var logger=require(_0x25bf('0x2'))(_0x25bf('0x3'));var moment=require(_0x25bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x25bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25bf('0x6'));var config=require(_0x25bf('0x7'));var attributes=require(_0x25bf('0x8'));module[_0x25bf('0x9')]=function(_0x1c73da,_0x1ac4e2){return _0x1c73da[_0x25bf('0xa')](_0x25bf('0xb'),attributes,{'tableName':_0x25bf('0xc'),'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 b43350b..d449861 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 _0xac0e=['request\x20sent','debug','error','code','message','result','Plugin','create','body','options','raw','CreatePlugin','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s'];(function(_0x2b92ec,_0x18e0e3){var _0x12be46=function(_0x18118b){while(--_0x18118b){_0x2b92ec['push'](_0x2b92ec['shift']());}};_0x12be46(++_0x18e0e3);}(_0xac0e,0x13f));var _0xeac0=function(_0x342922,_0x316192){_0x342922=_0x342922-0x0;var _0x366a13=_0xac0e[_0x342922];return _0x366a13;};'use strict';var _=require(_0xeac0('0x0'));var util=require(_0xeac0('0x1'));var moment=require(_0xeac0('0x2'));var BPromise=require(_0xeac0('0x3'));var rs=require(_0xeac0('0x4'));var fs=require('fs');var Redis=require(_0xeac0('0x5'));var db=require(_0xeac0('0x6'))['db'];var utils=require(_0xeac0('0x7'));var logger=require(_0xeac0('0x8'))(_0xeac0('0x9'));var config=require(_0xeac0('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xeac0('0xb')][_0xeac0('0xc')]({'port':0x232a});config[_0xeac0('0xd')]=_[_0xeac0('0xe')](config[_0xeac0('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xeac0('0xf'))(new Redis(config[_0xeac0('0xd')]));require(_0xeac0('0x10'))[_0xeac0('0x11')](socket);function respondWithRpcPromise(_0x571711,_0xc6f281,_0x32688d){return new BPromise(function(_0x31a8c4,_0x34edee){return client['request'](_0x571711,_0x32688d)[_0xeac0('0x12')](function(_0x8d5b89){logger[_0xeac0('0x13')](_0xeac0('0x14'),_0xc6f281,_0xeac0('0x15'));logger[_0xeac0('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0xc6f281,_0xeac0('0x15'),JSON['stringify'](_0x8d5b89));if(_0x8d5b89[_0xeac0('0x17')]){if(_0x8d5b89[_0xeac0('0x17')][_0xeac0('0x18')]===0x1f4){logger[_0xeac0('0x17')](_0xeac0('0x14'),_0xc6f281,_0x8d5b89[_0xeac0('0x17')]['message']);return _0x34edee(_0x8d5b89[_0xeac0('0x17')][_0xeac0('0x19')]);}logger[_0xeac0('0x17')]('Plugin,\x20%s,\x20%s',_0xc6f281,_0x8d5b89['error']['message']);return _0x31a8c4(_0x8d5b89['error'][_0xeac0('0x19')]);}else{logger['info'](_0xeac0('0x14'),_0xc6f281,_0xeac0('0x15'));_0x31a8c4(_0x8d5b89[_0xeac0('0x1a')][_0xeac0('0x19')]);}})['catch'](function(_0x4d9d5b){logger[_0xeac0('0x17')](_0xeac0('0x14'),_0xc6f281,_0x4d9d5b);_0x34edee(_0x4d9d5b);});});}exports['CreatePlugin']=function(_0x10e768){var _0x4c4326=this;return new Promise(function(_0xb4dcfe,_0x247e41){return db[_0xeac0('0x1b')][_0xeac0('0x1c')](_0x10e768[_0xeac0('0x1d')],{'raw':_0x10e768[_0xeac0('0x1e')]?_0x10e768[_0xeac0('0x1e')][_0xeac0('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x270522){logger[_0xeac0('0x13')](_0xeac0('0x20'),_0x10e768);logger[_0xeac0('0x16')](_0xeac0('0x20'),_0x10e768,JSON[_0xeac0('0x21')](_0x270522));_0xb4dcfe(_0x270522);})['catch'](function(_0x39f485){logger[_0xeac0('0x17')](_0xeac0('0x20'),_0x39f485['message'],_0x10e768);_0x247e41(_0x4c4326[_0xeac0('0x17')](0x1f4,_0x39f485[_0xeac0('0x19')]));});});}; \ No newline at end of file +var _0x2b87=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1630e1,_0x324505){var _0x2018a2=function(_0x158ada){while(--_0x158ada){_0x1630e1['push'](_0x1630e1['shift']());}};_0x2018a2(++_0x324505);}(_0x2b87,0x178));var _0x72b8=function(_0x25de08,_0x99cdb6){_0x25de08=_0x25de08-0x0;var _0x56eb5e=_0x2b87[_0x25de08];return _0x56eb5e;};'use strict';var _=require(_0x72b8('0x0'));var util=require(_0x72b8('0x1'));var moment=require(_0x72b8('0x2'));var BPromise=require(_0x72b8('0x3'));var rs=require(_0x72b8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b8('0x5'))['db'];var utils=require(_0x72b8('0x6'));var logger=require('../../config/logger')(_0x72b8('0x7'));var config=require(_0x72b8('0x8'));var jayson=require(_0x72b8('0x9'));var client=jayson[_0x72b8('0xa')][_0x72b8('0xb')]({'port':0x232a});config[_0x72b8('0xc')]=_[_0x72b8('0xd')](config[_0x72b8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x72b8('0xe'))(new Redis(config['redis']));require(_0x72b8('0xf'))[_0x72b8('0x10')](socket);function respondWithRpcPromise(_0x68ed19,_0xef8505,_0x5a0e88){return new BPromise(function(_0x3a9fac,_0xa66987){return client[_0x72b8('0x11')](_0x68ed19,_0x5a0e88)[_0x72b8('0x12')](function(_0x342107){logger[_0x72b8('0x13')](_0x72b8('0x14'),_0xef8505,_0x72b8('0x15'));logger[_0x72b8('0x16')](_0x72b8('0x17'),_0xef8505,_0x72b8('0x15'),JSON[_0x72b8('0x18')](_0x342107));if(_0x342107[_0x72b8('0x19')]){if(_0x342107['error'][_0x72b8('0x1a')]===0x1f4){logger[_0x72b8('0x19')](_0x72b8('0x14'),_0xef8505,_0x342107[_0x72b8('0x19')][_0x72b8('0x1b')]);return _0xa66987(_0x342107['error']['message']);}logger[_0x72b8('0x19')](_0x72b8('0x14'),_0xef8505,_0x342107[_0x72b8('0x19')]['message']);return _0x3a9fac(_0x342107[_0x72b8('0x19')][_0x72b8('0x1b')]);}else{logger['info'](_0x72b8('0x14'),_0xef8505,_0x72b8('0x15'));_0x3a9fac(_0x342107[_0x72b8('0x1c')][_0x72b8('0x1b')]);}})[_0x72b8('0x1d')](function(_0x122ed5){logger['error']('Plugin,\x20%s,\x20%s',_0xef8505,_0x122ed5);_0xa66987(_0x122ed5);});});}exports[_0x72b8('0x1e')]=function(_0x3a0980){var _0x567bad=this;return new Promise(function(_0x232c18,_0xd48d05){return db[_0x72b8('0x1f')][_0x72b8('0x20')](_0x3a0980['body'],{'raw':_0x3a0980['options']?_0x3a0980[_0x72b8('0x21')][_0x72b8('0x22')]===undefined?!![]:![]:!![]})[_0x72b8('0x12')](function(_0x2c8ffd){logger[_0x72b8('0x13')](_0x72b8('0x1e'),_0x3a0980);logger[_0x72b8('0x16')](_0x72b8('0x1e'),_0x3a0980,JSON[_0x72b8('0x18')](_0x2c8ffd));_0x232c18(_0x2c8ffd);})[_0x72b8('0x1d')](function(_0x17425c){logger[_0x72b8('0x19')](_0x72b8('0x1e'),_0x17425c[_0x72b8('0x1b')],_0x3a0980);_0xd48d05(_0x567bad[_0x72b8('0x19')](0x1f4,_0x17425c[_0x72b8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index cdc51c9..e6c9333 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 _0x4816=['removeListener','register','plugin:','remove','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4816,0x11d));var _0x6481=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0x4816[_0xcf581b];return _0x4f454d;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x6481('0x0'),_0x6481('0x1')];function createListener(_0x273f50,_0x3c3cad){return function(_0x1cab4b){_0x3c3cad[_0x6481('0x2')](_0x273f50,_0x1cab4b);};}function removeListener(_0x6ecaa,_0x176124){return function(){PluginEvents[_0x6481('0x3')](_0x6ecaa,_0x176124);};}exports[_0x6481('0x4')]=function(_0x375dda){for(var _0x2f8a1c=0x0,_0x3e6a1e=events['length'];_0x2f8a1c<_0x3e6a1e;_0x2f8a1c++){var _0xdb149e=events[_0x2f8a1c];var _0x53a619=createListener(_0x6481('0x5')+_0xdb149e,_0x375dda);PluginEvents['on'](_0xdb149e,_0x53a619);}}; \ No newline at end of file +var _0x1d52=['./plugin.events','remove','update','register','length','plugin:'];(function(_0x2de54e,_0x5afd91){var _0x3d5384=function(_0x2cc26d){while(--_0x2cc26d){_0x2de54e['push'](_0x2de54e['shift']());}};_0x3d5384(++_0x5afd91);}(_0x1d52,0x180));var _0x21d5=function(_0x285c55,_0x252e0c){_0x285c55=_0x285c55-0x0;var _0x5554b2=_0x1d52[_0x285c55];return _0x5554b2;};'use strict';var PluginEvents=require(_0x21d5('0x0'));var events=['save',_0x21d5('0x1'),_0x21d5('0x2')];function createListener(_0x319912,_0x1641ea){return function(_0x1dfb1a){_0x1641ea['emit'](_0x319912,_0x1dfb1a);};}function removeListener(_0x57dbed,_0x1a83b7){return function(){PluginEvents['removeListener'](_0x57dbed,_0x1a83b7);};}exports[_0x21d5('0x3')]=function(_0x234759){for(var _0x5e05d3=0x0,_0x4af863=events[_0x21d5('0x4')];_0x5e05d3<_0x4af863;_0x5e05d3++){var _0x309fcc=events[_0x5e05d3];var _0x543a50=createListener(_0x21d5('0x5')+_0x309fcc,_0x234759);PluginEvents['on'](_0x309fcc,_0x543a50);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ad2ad7d..c59af56 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(_0x2f8afc,_0x39e6f8){var _0x2868f0=function(_0x14bdba){while(--_0x14bdba){_0x2f8afc['push'](_0x2f8afc['shift']());}};_0x2868f0(++_0x39e6f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x2a9337,_0x21ff2e){var _0x70d78c=function(_0x3458eb){while(--_0x3458eb){_0x2a9337['push'](_0x2a9337['shift']());}};_0x70d78c(++_0x21ff2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 25f13ae..52176e0 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 _0xc874=['Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','list','then','reject','express','motion2','length','show','params','catch','create','body','script','join','../../files/plugins','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x686f51,_0x1457bb){var _0x18193a=function(_0x5850e7){while(--_0x5850e7){_0x686f51['push'](_0x686f51['shift']());}};_0x18193a(++_0x1457bb);}(_0xc874,0x154));var _0x4c87=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0xc874[_0x1385dc];return _0x2f6469;};'use strict';var _=require(_0x4c87('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x4c87('0x1'))(_0x4c87('0x2'));var path=require('path');var exec=require('child_process')[_0x4c87('0x3')];var BPromise=require(_0x4c87('0x4'));function handleEntityNotFound(_0x1c3dbc,_0x575a7c){return function(_0x3fbf14){if(!_0x3fbf14){_0x1c3dbc[_0x4c87('0x5')](0x194);;}return _0x3fbf14;};}function respondWithResult(_0x5d63ae,_0x46e0f5){_0x46e0f5=_0x46e0f5||0xc8;return function(_0x3dafe0){if(_0x3dafe0){return _0x5d63ae[_0x4c87('0x6')](_0x46e0f5)[_0x4c87('0x7')](_0x3dafe0);}return null;};}function handleError(_0x116649,_0x5b7720){_0x5b7720=_0x5b7720||0x1f4;return function(_0x1e0897){logger['error'](_0x1e0897[_0x4c87('0x8')]);if(_0x1e0897[_0x4c87('0x9')]){delete _0x1e0897[_0x4c87('0x9')];}_0x116649[_0x4c87('0x6')](_0x5b7720)[_0x4c87('0xa')](_0x1e0897);};}function execChildProcess(){return new BPromise(function(_0x548e1a,_0x1fcc99){exec(_0x4c87('0xb'),function(_0x527917,_0x20240a,_0x19bcbf){logger[_0x4c87('0xc')](_0x20240a);logger[_0x4c87('0xc')](_0x19bcbf);if(_0x527917){logger[_0x4c87('0xd')](_0x527917);return _0x1fcc99(_0x527917);}return _0x548e1a(_0x20240a);});});}exports['index']=function(_0x50c90c,_0x4826cb){return pm2[_0x4c87('0xe')]()[_0x4c87('0xf')](function(_0x2c66bc){if(_0x2c66bc){var _0x3f1cc5=_[_0x4c87('0x10')](_0x2c66bc,function(_0x453274){return _0x453274[_0x4c87('0x9')]===_0x4c87('0x11')||_0x453274['name']===_0x4c87('0x12');});return{'rows':_0x3f1cc5,'count':_0x3f1cc5[_0x4c87('0x13')]};}return null;})['then'](respondWithResult(_0x4826cb,null))['catch'](handleError(_0x4826cb,null));};exports[_0x4c87('0x14')]=function(_0x8cebb9,_0x2b55fa){return pm2['describe'](_0x8cebb9[_0x4c87('0x15')]['id'])['then'](respondWithResult(_0x2b55fa,null))[_0x4c87('0xf')](handleEntityNotFound(_0x2b55fa,null))[_0x4c87('0x16')](handleError(_0x2b55fa,null));};exports[_0x4c87('0x17')]=function(_0x22f775,_0x4f6514){if(_0x22f775[_0x4c87('0x18')][_0x4c87('0x9')]&&_0x22f775[_0x4c87('0x18')][_0x4c87('0x19')]){var _0xa4baa7=path[_0x4c87('0x1a')](__dirname,_0x4c87('0x1b'),_0x22f775[_0x4c87('0x18')]['script']);var _0x353ac9=process[_0x4c87('0x1c')]();process['chdir'](path[_0x4c87('0x1d')](_0xa4baa7));return execChildProcess()[_0x4c87('0xf')](function(_0x5a9496){process[_0x4c87('0x1e')](_0x353ac9);return pm2[_0x4c87('0x1f')]({'name':_0x22f775[_0x4c87('0x18')][_0x4c87('0x9')],'script':_0xa4baa7});})['then'](function(_0x4735f2){pm2[_0x4c87('0x20')]();return _0x4735f2[0x0];})[_0x4c87('0xf')](respondWithResult(_0x4f6514,0xc9))[_0x4c87('0x16')](handleError(_0x4f6514,null));}else{return _0x4f6514[_0x4c87('0x6')](0x1f4)[_0x4c87('0xa')]({'message':_0x4c87('0x21')});}};exports[_0x4c87('0x22')]=function(_0x4ca5fb,_0x4ecad3){if(_0x4ca5fb['body']['id']){delete _0x4ca5fb[_0x4c87('0x18')]['id'];}var _0x381af7={'online':_0x4c87('0x23'),'stopped':_0x4c87('0x24')};if(_0x381af7[_0x4c87('0x25')](_0x4ca5fb[_0x4c87('0x18')]['status'])){return pm2[_0x381af7[_0x4ca5fb[_0x4c87('0x18')][_0x4c87('0x6')]]](_0x4ca5fb[_0x4c87('0x15')]['id'])[_0x4c87('0xf')](respondWithResult(_0x4ecad3,0xc8))[_0x4c87('0x16')](handleError(_0x4ecad3,null));}else{return _0x4ecad3[_0x4c87('0x6')](0x1f4)[_0x4c87('0xa')]({'message':_0x4c87('0x26')});}};exports[_0x4c87('0x27')]=function(_0x2de21a,_0x41468f){if(_0x2de21a[_0x4c87('0x18')]['id']){delete _0x2de21a[_0x4c87('0x18')]['id'];}if(_0x2de21a[_0x4c87('0x15')]['id']){return pm2[_0x4c87('0x28')](_0x2de21a[_0x4c87('0x15')]['id'])['then'](function(_0xd4a2af){pm2['dump']();return _0xd4a2af[0x0];})[_0x4c87('0xf')](respondWithResult(_0x41468f,null))['catch'](handleError(_0x41468f,null));}else{return _0x41468f[_0x4c87('0x6')](0x1f4)[_0x4c87('0xa')]({'message':_0x4c87('0x29')});}}; \ No newline at end of file +var _0xe5b5=['../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','show','describe','catch','body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2'];(function(_0xb37099,_0x2bc4eb){var _0x373280=function(_0x4252aa){while(--_0x4252aa){_0xb37099['push'](_0xb37099['shift']());}};_0x373280(++_0x2bc4eb);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x20ebb5,_0x237d88){_0x20ebb5=_0x20ebb5-0x0;var _0x487182=_0xe5b5[_0x20ebb5];return _0x487182;};'use strict';var _=require(_0x5e5b('0x0'));var pm2=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var path=require(_0x5e5b('0x4'));var exec=require(_0x5e5b('0x5'))[_0x5e5b('0x6')];var BPromise=require(_0x5e5b('0x7'));function handleEntityNotFound(_0xf20c6a,_0x20a50c){return function(_0xdc6616){if(!_0xdc6616){_0xf20c6a[_0x5e5b('0x8')](0x194);;}return _0xdc6616;};}function respondWithResult(_0xf1fbe2,_0x11e0e0){_0x11e0e0=_0x11e0e0||0xc8;return function(_0x545eb3){if(_0x545eb3){return _0xf1fbe2[_0x5e5b('0x9')](_0x11e0e0)[_0x5e5b('0xa')](_0x545eb3);}return null;};}function handleError(_0xcbd478,_0x258414){_0x258414=_0x258414||0x1f4;return function(_0xb9d72b){logger[_0x5e5b('0xb')](_0xb9d72b[_0x5e5b('0xc')]);if(_0xb9d72b[_0x5e5b('0xd')]){delete _0xb9d72b['name'];}_0xcbd478[_0x5e5b('0x9')](_0x258414)['send'](_0xb9d72b);};}function execChildProcess(){return new BPromise(function(_0x108c34,_0x58185){exec(_0x5e5b('0xe'),function(_0x3f64b6,_0x55c974,_0x4a1424){logger['info'](_0x55c974);logger[_0x5e5b('0xf')](_0x4a1424);if(_0x3f64b6){logger[_0x5e5b('0xb')](_0x3f64b6);return _0x58185(_0x3f64b6);}return _0x108c34(_0x55c974);});});}exports[_0x5e5b('0x10')]=function(_0x1694ff,_0x13a01e){return pm2[_0x5e5b('0x11')]()[_0x5e5b('0x12')](function(_0x49edd0){if(_0x49edd0){var _0x2b37fa=_[_0x5e5b('0x13')](_0x49edd0,function(_0x4ff37b){return _0x4ff37b[_0x5e5b('0xd')]==='express'||_0x4ff37b['name']===_0x5e5b('0x14');});return{'rows':_0x2b37fa,'count':_0x2b37fa[_0x5e5b('0x15')]};}return null;})[_0x5e5b('0x12')](respondWithResult(_0x13a01e,null))['catch'](handleError(_0x13a01e,null));};exports[_0x5e5b('0x16')]=function(_0x4d490c,_0x1796af){return pm2[_0x5e5b('0x17')](_0x4d490c['params']['id'])[_0x5e5b('0x12')](respondWithResult(_0x1796af,null))[_0x5e5b('0x12')](handleEntityNotFound(_0x1796af,null))[_0x5e5b('0x18')](handleError(_0x1796af,null));};exports['create']=function(_0x2bf0b7,_0x3f1103){if(_0x2bf0b7['body'][_0x5e5b('0xd')]&&_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]){var _0x2d8252=path[_0x5e5b('0x1b')](__dirname,_0x5e5b('0x1c'),_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]);var _0x4a78e3=process['cwd']();process[_0x5e5b('0x1d')](path[_0x5e5b('0x1e')](_0x2d8252));return execChildProcess()[_0x5e5b('0x12')](function(_0xe1c268){process[_0x5e5b('0x1d')](_0x4a78e3);return pm2[_0x5e5b('0x1f')]({'name':_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0xd')],'script':_0x2d8252});})[_0x5e5b('0x12')](function(_0x26bc02){pm2[_0x5e5b('0x20')]();return _0x26bc02[0x0];})['then'](respondWithResult(_0x3f1103,0xc9))[_0x5e5b('0x18')](handleError(_0x3f1103,null));}else{return _0x3f1103[_0x5e5b('0x9')](0x1f4)[_0x5e5b('0x21')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5e5b('0x22')]=function(_0xdb2863,_0x5ee866){if(_0xdb2863[_0x5e5b('0x19')]['id']){delete _0xdb2863[_0x5e5b('0x19')]['id'];}var _0x39ce16={'online':_0x5e5b('0x23'),'stopped':_0x5e5b('0x24')};if(_0x39ce16[_0x5e5b('0x25')](_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')])){return pm2[_0x39ce16[_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')]]](_0xdb2863[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](respondWithResult(_0x5ee866,0xc8))['catch'](handleError(_0x5ee866,null));}else{return _0x5ee866['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x27')});}};exports[_0x5e5b('0x28')]=function(_0x3dcdab,_0x12f1ee){if(_0x3dcdab['body']['id']){delete _0x3dcdab[_0x5e5b('0x19')]['id'];}if(_0x3dcdab['params']['id']){return pm2[_0x5e5b('0x29')](_0x3dcdab[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](function(_0xc2bc09){pm2['dump']();return _0xc2bc09[0x0];})[_0x5e5b('0x12')](respondWithResult(_0x12f1ee,null))[_0x5e5b('0x18')](handleError(_0x12f1ee,null));}else{return _0x12f1ee['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x2a')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c6596f1..2f08053 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 _0x38b8=['../../components/auth/service','get','/agents','isAuthenticated','getQueues','exports','express'];(function(_0x57560d,_0x215718){var _0x50b44a=function(_0x47d56b){while(--_0x47d56b){_0x57560d['push'](_0x57560d['shift']());}};_0x50b44a(++_0x215718);}(_0x38b8,0x16b));var _0x838b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x38b8[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x838b('0x0'));var router=express['Router']();var auth=require(_0x838b('0x1'));var controller=require('./realtime.controller');router[_0x838b('0x2')](_0x838b('0x3'),auth[_0x838b('0x4')](),controller['getAgents']);router[_0x838b('0x2')]('/queues',auth[_0x838b('0x4')](),controller[_0x838b('0x5')]);module[_0x838b('0x6')]=router; \ No newline at end of file +var _0x2f14=['Router','../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x43e05b,_0x32cb03){var _0x5172f5=function(_0x1e85ac){while(--_0x1e85ac){_0x43e05b['push'](_0x43e05b['shift']());}};_0x5172f5(++_0x32cb03);}(_0x2f14,0x1b8));var _0x42f1=function(_0x2c1d16,_0x2f0dd5){_0x2c1d16=_0x2c1d16-0x0;var _0x29cf36=_0x2f14[_0x2c1d16];return _0x29cf36;};'use strict';var express=require(_0x42f1('0x0'));var router=express[_0x42f1('0x1')]();var auth=require(_0x42f1('0x2'));var controller=require('./realtime.controller');router[_0x42f1('0x3')](_0x42f1('0x4'),auth[_0x42f1('0x5')](),controller[_0x42f1('0x6')]);router[_0x42f1('0x3')](_0x42f1('0x7'),auth['isAuthenticated'](),controller['getQueues']);module[_0x42f1('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d1a8265..06986db 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 _0x4cd8=['filter','queue','length','some','internal','toString','getMembers','UserId','voiceStatus','online','findAll','QueueId','getChannels','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','User','type','key','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','Pause','forEach','where','user','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','getQueues','Queue','rawAttributes','fieldName','QueueCampaigns','Queues','all','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','status','Content-Range','json','error','stack','name','send','voice','request','startCase','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','loggedIn','busy','find','merge','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cd8,0x1c2));var _0x84cd=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0x4cd8[_0x1eb82d];return _0x2c9502;};'use strict';var util=require('util');var _=require(_0x84cd('0x0'));var jayson=require(_0x84cd('0x1'));var rta=require(_0x84cd('0x2'));var qs=require(_0x84cd('0x3'));var utils=require('../../config/utils');var logger=require(_0x84cd('0x4'))(_0x84cd('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x84cd('0x6')][_0x84cd('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0x84cd('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x1c1502,_0xb8d2fc){return function(_0x2488bd){if(_0x2488bd){var _0x18d6d2=typeof _0xb8d2fc[_0x84cd('0x8')]===_0x84cd('0x9')&&typeof _0xb8d2fc[_0x84cd('0xa')]==='undefined';var _0x520ac1=_0x2488bd[_0x84cd('0xb')];var _0x3f294f=_0x18d6d2?0x0:_0xb8d2fc[_0x84cd('0x8')];var _0x1c26bf=_0x18d6d2?_0x2488bd['count']:_0xb8d2fc[_0x84cd('0x8')]+_0xb8d2fc[_0x84cd('0xa')];var _0x36dd38;if(_0x1c26bf>=_0x520ac1){_0x1c26bf=_0x520ac1;_0x36dd38=0xc8;}else{_0x36dd38=0xce;}_0x1c1502[_0x84cd('0xc')](_0x36dd38);return _0x1c1502['set'](_0x84cd('0xd'),_0x3f294f+'-'+_0x1c26bf+'/'+_0x520ac1)[_0x84cd('0xe')](_0x2488bd);}return null;};}function handleError(_0x26bb3c,_0x5108bb){_0x5108bb=_0x5108bb||0x1f4;return function(_0x4e76c7){logger[_0x84cd('0xf')](_0x4e76c7[_0x84cd('0x10')]);if(_0x4e76c7[_0x84cd('0x11')]){delete _0x4e76c7['name'];}_0x26bb3c['status'](_0x5108bb)[_0x84cd('0x12')](_0x4e76c7);};}function getRealtimeQueues(_0x4b5458,_0x189fdf){return new Promise(function(_0x3a7c80,_0x358690){var _0x5e2efb=_0x189fdf===_0x84cd('0x13')?amiClient:routingClient;return _0x5e2efb[_0x84cd('0x14')](_[_0x84cd('0x15')](_0x189fdf)+'Queues',_0x4b5458)[_0x84cd('0x16')](function(_0x1e2707){if(_0x1e2707['error'])throw new Error(util[_0x84cd('0x17')](_0x84cd('0x18'),_0x189fdf));return _0x3a7c80(_0x1e2707[_0x84cd('0x19')]);})['catch'](function(_0x22c709){_0x358690(_0x22c709);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0xc7d6fb,_0x14dd25){return amiClient['request'](_0x84cd('0x1a'),{})[_0x84cd('0x16')](function(_0x188cff){if(_0x188cff[_0x84cd('0xf')])throw new Error(_0x84cd('0x1b'));return _0xc7d6fb(_0x188cff['result']);})[_0x84cd('0x1c')](function(_0x258bc9){_0x14dd25(_0x258bc9);});});}function initializeQueues(_0x2b1c95,_0x562e8f,_0x5835c8,_0x50610d){var _0x2b59c4=['loggedIn',_0x84cd('0x1d'),_0x84cd('0x1e'),_0x84cd('0x1f'),_0x84cd('0x20')];if(_0x5835c8===_0x84cd('0x13')&&_0x50610d===_0x84cd('0x21')){_0x2b59c4[_0x84cd('0x22')](_0x84cd('0x23'),_0x84cd('0x24'),_0x84cd('0x25'),_0x84cd('0x26'),_0x84cd('0x27'),_0x84cd('0x28'),_0x84cd('0x29'),_0x84cd('0x2a'),_0x84cd('0x2b'),_0x84cd('0x2c'),_0x84cd('0x2d'),_0x84cd('0x2e'),_0x84cd('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x84cd('0x30'),_0x84cd('0x31'),'predictiveIntervalTotalCalls',_0x84cd('0x32'),_0x84cd('0x33'),_0x84cd('0x34'),'predictiveIntervalAvgHoldtime',_0x84cd('0x35'));}return _0x2b1c95[_0x84cd('0x36')](function(_0x3109ab){var _0x3028d8=_0x3109ab['get']({'plain':!![]});_0x3028d8[_0x84cd('0x37')]=[];_0x3028d8[_0x84cd('0x20')]=0x0;_0x3028d8[_0x84cd('0x38')]=0x0;_0x3028d8[_0x84cd('0x39')]=0x0;_0x3028d8[_0x84cd('0x1d')]=0x0;_0x3028d8['waiting']=0x0;if(_0x5835c8===_0x84cd('0x13')){_0x3028d8[_0x84cd('0x1f')]=0x0;_0x3028d8[_0x84cd('0x3a')]=0x0;if(_0x50610d===_0x84cd('0x21')){_0x3028d8[_0x84cd('0x23')]=0x0;_0x3028d8['originated']=0x0;}}var _0x242d21=_[_0x84cd('0x3b')](_0x562e8f,['id',_0x3028d8['id']]);if(_0x242d21)_[_0x84cd('0x3c')](_0x3028d8,_[_0x84cd('0x3d')](_0x242d21,_0x2b59c4));return _0x3028d8;});}function updateAgentVoiceStatus(_0x314e72,_0x5b00ee,_0x1b0044){var _0x36a8b4=_[_0x84cd('0x3e')](_0x1b0044,[_0x84cd('0x3f'),_0x5b00ee['name']]);if(_0x36a8b4[_0x84cd('0x40')]===0x0)return _0x314e72[_0x84cd('0x3a')]=!![];if(_[_0x84cd('0x41')](_0x36a8b4,['connectedlinenum',_0x314e72[_0x84cd('0x42')][_0x84cd('0x43')]()]))return _0x314e72[_0x84cd('0x1f')]=!![];if(!_0x314e72[_0x84cd('0x1f')])return _0x314e72[_0x84cd('0x3a')]=!![];}function getVoiceQueueAgents(_0x384616,_0x41916d,_0x4a8a5a,_0x46064c){var _0xaf42f=_[_0x84cd('0x3b')](_0x41916d,['id',_0x384616['id']]);if(!_0xaf42f)return _0x384616;return _0xaf42f[_0x84cd('0x44')]({'raw':!![]})[_0x84cd('0x16')](function(_0x52887b){for(var _0x29cc37=0x0;_0x29cc37<_0x52887b[_0x84cd('0x40')];_0x29cc37++){var _0x73fde=_['find'](_0x4a8a5a,['id',_0x52887b[_0x29cc37][_0x84cd('0x45')]]);if(!_0x73fde){_0x73fde={'id':_0x52887b[_0x29cc37]['UserId'],'name':_0x52887b[_0x29cc37][_0x84cd('0x45')],'accountcode':'','online':![]};}var _0x5dcf2c={'id':_0x73fde['id'],'name':_0x73fde[_0x84cd('0x11')],'internal':_0x73fde['accountcode'],'online':Boolean(_0x73fde['online']),'paused':Boolean(_0x52887b[_0x29cc37][_0x84cd('0x20')])};if(_0x73fde[_0x84cd('0x46')]===_0x84cd('0x1f'))updateAgentVoiceStatus(_0x5dcf2c,_0x384616,_0x46064c);if(_0x5dcf2c[_0x84cd('0x47')])_0x384616[_0x84cd('0x38')]++;if(_0x5dcf2c[_0x84cd('0x3a')])_0x384616[_0x84cd('0x3a')]++;if(_0x5dcf2c['paused']&&!_0x5dcf2c[_0x84cd('0x3a')]&&!_0x5dcf2c[_0x84cd('0x1f')])_0x384616[_0x84cd('0x20')]++;_0x384616[_0x84cd('0x37')][_0x84cd('0x22')](_0x5dcf2c);}return _0x384616;});}function getQueueAgents(_0x4cf2f1,_0x215bc7,_0x4ab5cc){var _0x511a3d='User'+_[_0x84cd('0x15')](_0x4ab5cc)+'Queue';var _0x5859f2=_0x4ab5cc+'Pause';return db[_0x511a3d][_0x84cd('0x48')]({'where':{[_[_0x84cd('0x15')](_0x4ab5cc)+_0x84cd('0x49')]:_0x4cf2f1['id']},'raw':!![]})[_0x84cd('0x16')](function(_0x2cfc5e){for(var _0x1b43bb=0x0;_0x1b43bb<_0x2cfc5e[_0x84cd('0x40')];_0x1b43bb++){var _0x244a15=_[_0x84cd('0x3b')](_0x215bc7,['id',_0x2cfc5e[_0x1b43bb][_0x84cd('0x45')]]);if(!_0x244a15){_0x244a15={'id':_0x2cfc5e[_0x1b43bb]['UserId'],'name':_0x2cfc5e[_0x1b43bb][_0x84cd('0x45')],'online':![],['pauseField']:![]};}var _0x4ef8b2={'id':_0x244a15['id'],'name':_0x244a15[_0x84cd('0x11')],'online':Boolean(_0x244a15[_0x84cd('0x47')]),'paused':Boolean(_0x244a15[_0x5859f2])};if(_0x4ef8b2['online'])_0x4cf2f1[_0x84cd('0x38')]++;_0x4cf2f1['agents'][_0x84cd('0x22')](_0x4ef8b2);}return _0x4cf2f1;});}function validateChannel(_0x15b200){var _0x408bf9=utils[_0x84cd('0x4a')]();if(!_['includes'](_0x408bf9,_0x15b200[_0x84cd('0x4b')]()))throw new Error(_0x84cd('0x4c'));return _0x15b200[_0x84cd('0x4b')]();}exports[_0x84cd('0x4d')]=function(_0x1e2e13,_0x42f8aa){var _0x3fd48e={'count':0x0,'rows':[]};var _0x8e7a2b={};var _0x1955de;var _0x6e924d;var _0x2c1eb7;var _0x64577c;var _0x52c107=utils[_0x84cd('0x4a')]();var _0x3ac7e2=_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x4f')];var _0x322b4f=_0x1e2e13['query'][_0x84cd('0x50')];var _0x49211e=_0x1e2e13['query'][_0x84cd('0x51')];var _0x66c35d=_0x322b4f===_0x84cd('0x52')||_0x322b4f===_0x84cd('0x53')?!![]:![];var _0x96b025=[];var _0x3bdc74;Promise[_0x84cd('0x54')]()[_0x84cd('0x16')](function(){if(_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x55')]){_0x1955de=validateChannel(_0x1e2e13['query']['channel']);}if(!_0x1e2e13['query'][_0x84cd('0x56')]||!_0x1e2e13['query'][_0x84cd('0x56')][_0x84cd('0x57')](_0x84cd('0x58'))){_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x56')]=rta['validateSortParameter'](_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x56')]);return;}var _0x183b54=rta[_0x84cd('0x59')](_0x1e2e13['query']['sort']);_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x56')]=_0x183b54[_0x84cd('0x5a')][_0x84cd('0x5b')](',');_0x6e924d=_0x183b54[_0x84cd('0x5c')];})[_0x84cd('0x16')](function(){if(!_0x3ac7e2){return[];}return rta[_0x84cd('0x5d')](_0x3ac7e2,_0x1955de);})['then'](function(_0x4c0a9c){_0x96b025=_0x4c0a9c;return rta[_0x84cd('0x5e')]();})['then'](function(_0x19f88c){_0x64577c=_0x19f88c[_0x84cd('0x5f')];if((!_0x322b4f||_0x66c35d)&&!_0x6e924d){return _0x96b025;}if(_0x6e924d&&!_0x322b4f){return rta['getSortedAgentsIdsByStatus'](_0x64577c,_0x96b025,_0x6e924d);}else{return rta[_0x84cd('0x60')](_0x64577c,_0x96b025,_0x322b4f);}})[_0x84cd('0x16')](function(_0x11260d){_0x96b025=_0x11260d;var _0x3843dd=![];if(_0x96b025[_0x84cd('0x40')]===0x0){if(_0x3ac7e2||_0x322b4f){_0x3843dd=!![];}if(_0x66c35d){_0x3843dd=![];}}if(_0x3843dd){return _0x3fd48e;}var _0x70e83=_[_0x84cd('0x36')](db[_0x84cd('0x61')]['rawAttributes'],function(_0x3f34a5){return{'name':_0x3f34a5['fieldName'],'type':_0x3f34a5[_0x84cd('0x62')][_0x84cd('0x63')]};});_0x1e2e13[_0x84cd('0x4e')][_0x84cd('0x64')]=_0x84cd('0x65');_0x1e2e13[_0x84cd('0x4e')]['online']=!![];_0x8e7a2b=qs[_0x84cd('0x66')](_0x70e83,_0x1e2e13);_0x8e7a2b[_0x84cd('0x67')]=!![];var _0x3f738d=[];if(_0x96b025[_0x84cd('0x40')]>0x0){_0x3f738d[_0x84cd('0x22')]({'id':{'$in':_0x96b025}});if(_0x6e924d&&!_0x322b4f){_0x3bdc74=[db[_0x84cd('0x68')][_0x84cd('0x69')](_0x84cd('0x6a')+_0x96b025+')')];_0x8e7a2b[_0x84cd('0x5c')]=_0x3bdc74;}}if(_0x66c35d){_0x52c107['forEach'](function(_0x254832){var _0x8bcad6=!![];if(_0x322b4f===_0x84cd('0x53')&&_0x1955de!==_0x254832){_0x8bcad6=![];}_0x3f738d[_0x84cd('0x22')]({[_0x254832+_0x84cd('0x6b')]:_0x8bcad6});});if(_0x49211e){_0x3f738d['push']({'pauseType':_0x49211e});}}else if(_0x322b4f){_0x52c107[_0x84cd('0x6c')](function(_0x14e51d){_0x3f738d['push']({[_0x14e51d+_0x84cd('0x6b')]:![]});});}_0x8e7a2b[_0x84cd('0x6d')]=_['merge'](_0x8e7a2b['where'],{'$and':_0x3f738d});if(_0x1e2e13[_0x84cd('0x6e')]['role']===_0x84cd('0x6e')){var _0x83ad41={'params':{'id':_0x1e2e13[_0x84cd('0x6e')][_0x84cd('0x6f')]},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x96b025,'customSorting':_0x3bdc74}};if(_0x66c35d){_0x83ad41[_0x84cd('0x4e')][_0x84cd('0x70')]=_0x3f738d;}_0x83ad41['query']=Object[_0x84cd('0x71')](_0x83ad41[_0x84cd('0x4e')],_0x1e2e13[_0x84cd('0x4e')]);delete _0x83ad41[_0x84cd('0x4e')]['id'];return db[_0x84cd('0x72')][_0x84cd('0x73')](_0x83ad41);}return db[_0x84cd('0x61')][_0x84cd('0x74')](_0x8e7a2b);})['then'](function(_0x35b6e7){_0x3fd48e[_0x84cd('0xb')]=_0x35b6e7[_0x84cd('0xb')];_0x2c1eb7=_0x35b6e7[_0x84cd('0x5f')];return _0x2c1eb7[_0x84cd('0x36')](function(_0x49d85a){var _0x58fbaa=_['find'](_0x64577c,['id',_0x49d85a['id']]);if(_0x58fbaa){var _0x5d38e2=rta[_0x84cd('0x75')](_0x58fbaa);_[_0x84cd('0x3c')](_0x49d85a,_0x5d38e2);}_0x49d85a[_0x84cd('0x58')]=rta[_0x84cd('0x76')](_0x49d85a);if(_0x49d85a[_0x84cd('0x58')][_0x84cd('0x57')]('pause')){_0x52c107[_0x84cd('0x6c')](function(_0x3d0117){if(_0x49d85a[_0x3d0117+_0x84cd('0x6b')]){_0x49d85a[_0x3d0117+_0x84cd('0x77')]='pause';}});}return _0x49d85a;});})[_0x84cd('0x16')](function(_0x595843){if(!_0x6e924d||_0x3bdc74){return _0x595843;}return rta[_0x84cd('0x78')](_0x595843,_0x6e924d);})[_0x84cd('0x16')](function(_0x3ab152){_0x3fd48e[_0x84cd('0x5f')]=_0x3ab152;return _0x3fd48e;})[_0x84cd('0x16')](respondWithFilteredResult(_0x42f8aa,_0x8e7a2b))[_0x84cd('0x1c')](handleError(_0x42f8aa,null));};exports[_0x84cd('0x79')]=function(_0x54b33a,_0x7e15bf){var _0x156f35={'count':0x0,'rows':[]},_0x393660={},_0x55bd4b,_0x27600f,_0xb3035d,_0x493c69,_0x52aa2a;Promise[_0x84cd('0x54')]()['then'](function(){if(_0x54b33a[_0x84cd('0x4e')]['channel'])_0x55bd4b=validateChannel(_0x54b33a['query']['channel']);var _0x168c5b=_[_0x84cd('0x15')](_0x55bd4b)+_0x84cd('0x7a');var _0x224637=_['map'](db[_0x168c5b][_0x84cd('0x7b')],function(_0x1833b0){return{'name':_0x1833b0[_0x84cd('0x7c')],'type':_0x1833b0[_0x84cd('0x62')][_0x84cd('0x63')]};});_0x393660=qs['getOptions'](_0x224637,_0x54b33a);if(_0x54b33a[_0x84cd('0x6e')]['role']===_0x84cd('0x6e')){var _0x1334b0={'params':{'id':_0x54b33a['user'][_0x84cd('0x6f')]},'query':{'section':_0x55bd4b===_0x84cd('0x13')&&_0x54b33a[_0x84cd('0x4e')]['type']===_0x84cd('0x21')?_0x84cd('0x7d'):_[_0x84cd('0x15')](_0x55bd4b)+_0x84cd('0x7e'),'type':_0x54b33a[_0x84cd('0x4e')][_0x84cd('0x62')],'nolimit':!![],'sort':_0x84cd('0x11'),'filter':_0x54b33a[_0x84cd('0x4e')]['filter']}};return db['UserProfile'][_0x84cd('0x73')](_0x1334b0);}return db[_0x168c5b]['findAndCountAll'](_0x393660);})[_0x84cd('0x16')](function(_0x788412){_0x156f35['count']=_0x788412[_0x84cd('0xb')];_0x27600f=_0x788412[_0x84cd('0x5f')];return getRealtimeQueues(_0x54b33a,_0x55bd4b);})[_0x84cd('0x16')](function(_0x40ed63){_0x493c69=_0x40ed63[_0x84cd('0x5f')];return rta[_0x84cd('0x5e')]();})[_0x84cd('0x16')](function(_0xe15fe8){_0xb3035d=_0xe15fe8[_0x84cd('0x5f')];if(_0x55bd4b!=_0x84cd('0x13'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3b9a8e){_0x52aa2a=_0x3b9a8e?_0x3b9a8e[_0x84cd('0x5f')]:[];return initializeQueues(_0x27600f,_0x493c69,_0x55bd4b,_0x54b33a[_0x84cd('0x4e')][_0x84cd('0x62')]);})[_0x84cd('0x16')](function(_0x34429e){var _0x1623df=_0x34429e['map'](function(_0x44315d){if(_0x55bd4b===_0x84cd('0x13'))return getVoiceQueueAgents(_0x44315d,_0x27600f,_0xb3035d,_0x52aa2a);else return getQueueAgents(_0x44315d,_0xb3035d,_0x55bd4b);});return Promise[_0x84cd('0x7f')](_0x1623df);})['then'](function(_0x3b38a1){_0x156f35[_0x84cd('0x5f')]=_0x3b38a1;return _0x156f35;})['then'](respondWithFilteredResult(_0x7e15bf,_0x393660))['catch'](handleError(_0x7e15bf,null));}; \ No newline at end of file +var _0xafab=['key','role','agent','getOptions','raw','sequelize','FIELD(id,','forEach','*pause','Pause','where','user','userProfileId','Agents','UserProfile','getResources','findAndCountAll','filterAgentAttributes','globalStatus','getAgentStatus','Status','sortAgentsByStatus','Queue','rawAttributes','fieldName','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','voice','request','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','then','result','loggedIn','available','waiting','talking','paused','outbound','push','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','pTalking','find','merge','pick','filter','queue','length','some','connectedlinenum','toString','getMembers','UserId','accountcode','online','User','findAll','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pause','resolve','channel','sort','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','type'];(function(_0x1fcc55,_0x6f617e){var _0x3ae024=function(_0xfbdc93){while(--_0xfbdc93){_0x1fcc55['push'](_0x1fcc55['shift']());}};_0x3ae024(++_0x6f617e);}(_0xafab,0x192));var _0xbafa=function(_0x154279,_0xeab21f){_0x154279=_0x154279-0x0;var _0x20bb97=_0xafab[_0x154279];return _0x20bb97;};'use strict';var util=require(_0xbafa('0x0'));var _=require(_0xbafa('0x1'));var jayson=require(_0xbafa('0x2'));var rta=require('../../components/realtime/agents');var qs=require(_0xbafa('0x3'));var utils=require(_0xbafa('0x4'));var logger=require(_0xbafa('0x5'))(_0xbafa('0x6'));var db=require(_0xbafa('0x7'))['db'];var amiClient=jayson[_0xbafa('0x8')][_0xbafa('0x9')]({'port':0x232a});var routingClient=jayson[_0xbafa('0x8')][_0xbafa('0x9')]({'port':0x232c});function respondWithFilteredResult(_0x2e9849,_0x21da8a){return function(_0x318d00){if(_0x318d00){var _0x125f86=typeof _0x21da8a[_0xbafa('0xa')]===_0xbafa('0xb')&&typeof _0x21da8a[_0xbafa('0xc')]===_0xbafa('0xb');var _0x920d0e=_0x318d00[_0xbafa('0xd')];var _0x390b81=_0x125f86?0x0:_0x21da8a[_0xbafa('0xa')];var _0x4fc1f6=_0x125f86?_0x318d00['count']:_0x21da8a['offset']+_0x21da8a[_0xbafa('0xc')];var _0x2caeab;if(_0x4fc1f6>=_0x920d0e){_0x4fc1f6=_0x920d0e;_0x2caeab=0xc8;}else{_0x2caeab=0xce;}_0x2e9849[_0xbafa('0xe')](_0x2caeab);return _0x2e9849[_0xbafa('0xf')](_0xbafa('0x10'),_0x390b81+'-'+_0x4fc1f6+'/'+_0x920d0e)[_0xbafa('0x11')](_0x318d00);}return null;};}function handleError(_0x2c8a5c,_0x3c830b){_0x3c830b=_0x3c830b||0x1f4;return function(_0x2522ac){logger[_0xbafa('0x12')](_0x2522ac[_0xbafa('0x13')]);if(_0x2522ac[_0xbafa('0x14')]){delete _0x2522ac[_0xbafa('0x14')];}_0x2c8a5c['status'](_0x3c830b)['send'](_0x2522ac);};}function getRealtimeQueues(_0x25322d,_0xc8b1ae){return new Promise(function(_0x2ede8e,_0x1cbb8f){var _0x2e584c=_0xc8b1ae===_0xbafa('0x15')?amiClient:routingClient;return _0x2e584c[_0xbafa('0x16')](_[_0xbafa('0x17')](_0xc8b1ae)+_0xbafa('0x18'),_0x25322d)['then'](function(_0x4f47c6){if(_0x4f47c6[_0xbafa('0x12')])throw new Error(util['format'](_0xbafa('0x19'),_0xc8b1ae));return _0x2ede8e(_0x4f47c6['result']);})[_0xbafa('0x1a')](function(_0x564a49){_0x1cbb8f(_0x564a49);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x29f91a,_0x54cc5f){return amiClient[_0xbafa('0x16')](_0xbafa('0x1b'),{})[_0xbafa('0x1c')](function(_0x107cc6){if(_0x107cc6[_0xbafa('0x12')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x29f91a(_0x107cc6[_0xbafa('0x1d')]);})[_0xbafa('0x1a')](function(_0x9c8a1d){_0x54cc5f(_0x9c8a1d);});});}function initializeQueues(_0x1c9d51,_0x4d0197,_0x10b4be,_0x45fe4e){var _0x48de2e=[_0xbafa('0x1e'),_0xbafa('0x1f'),_0xbafa('0x20'),_0xbafa('0x21'),_0xbafa('0x22')];if(_0x10b4be==='voice'&&_0x45fe4e===_0xbafa('0x23')){_0x48de2e[_0xbafa('0x24')]('pTalking',_0xbafa('0x25'),'message',_0xbafa('0x26'),_0xbafa('0x27'),_0xbafa('0x28'),_0xbafa('0x29'),_0xbafa('0x2a'),_0xbafa('0x2b'),_0xbafa('0x2c'),_0xbafa('0x2d'),'erlangBusyFactor',_0xbafa('0x2e'),_0xbafa('0x2f'),_0xbafa('0x30'),_0xbafa('0x31'),_0xbafa('0x32'),_0xbafa('0x33'),_0xbafa('0x34'),_0xbafa('0x35'),'predictiveIntervalAvgHoldtime',_0xbafa('0x36'));}return _0x1c9d51[_0xbafa('0x37')](function(_0x206cf6){var _0x2e7f1e=_0x206cf6[_0xbafa('0x38')]({'plain':!![]});_0x2e7f1e[_0xbafa('0x39')]=[];_0x2e7f1e[_0xbafa('0x22')]=0x0;_0x2e7f1e[_0xbafa('0x3a')]=0x0;_0x2e7f1e[_0xbafa('0x1e')]=0x0;_0x2e7f1e[_0xbafa('0x1f')]=0x0;_0x2e7f1e[_0xbafa('0x20')]=0x0;if(_0x10b4be===_0xbafa('0x15')){_0x2e7f1e[_0xbafa('0x21')]=0x0;_0x2e7f1e[_0xbafa('0x3b')]=0x0;if(_0x45fe4e===_0xbafa('0x23')){_0x2e7f1e[_0xbafa('0x3c')]=0x0;_0x2e7f1e[_0xbafa('0x25')]=0x0;}}var _0x2d1ba4=_[_0xbafa('0x3d')](_0x4d0197,['id',_0x2e7f1e['id']]);if(_0x2d1ba4)_[_0xbafa('0x3e')](_0x2e7f1e,_[_0xbafa('0x3f')](_0x2d1ba4,_0x48de2e));return _0x2e7f1e;});}function updateAgentVoiceStatus(_0x573cfb,_0x3272a9,_0x307763){var _0x44db68=_[_0xbafa('0x40')](_0x307763,[_0xbafa('0x41'),_0x3272a9[_0xbafa('0x14')]]);if(_0x44db68[_0xbafa('0x42')]===0x0)return _0x573cfb[_0xbafa('0x3b')]=!![];if(_[_0xbafa('0x43')](_0x44db68,[_0xbafa('0x44'),_0x573cfb['internal'][_0xbafa('0x45')]()]))return _0x573cfb[_0xbafa('0x21')]=!![];if(!_0x573cfb[_0xbafa('0x21')])return _0x573cfb[_0xbafa('0x3b')]=!![];}function getVoiceQueueAgents(_0x3f04ac,_0x1d9f78,_0x4c4618,_0x4bc466){var _0x5ec11f=_[_0xbafa('0x3d')](_0x1d9f78,['id',_0x3f04ac['id']]);if(!_0x5ec11f)return _0x3f04ac;return _0x5ec11f[_0xbafa('0x46')]({'raw':!![]})['then'](function(_0x54f98c){for(var _0x4419e2=0x0;_0x4419e2<_0x54f98c['length'];_0x4419e2++){var _0x1fd63c=_[_0xbafa('0x3d')](_0x4c4618,['id',_0x54f98c[_0x4419e2][_0xbafa('0x47')]]);if(!_0x1fd63c){_0x1fd63c={'id':_0x54f98c[_0x4419e2][_0xbafa('0x47')],'name':_0x54f98c[_0x4419e2][_0xbafa('0x47')],'accountcode':'','online':![]};}var _0x5e70ff={'id':_0x1fd63c['id'],'name':_0x1fd63c[_0xbafa('0x14')],'internal':_0x1fd63c[_0xbafa('0x48')],'online':Boolean(_0x1fd63c[_0xbafa('0x49')]),'paused':Boolean(_0x54f98c[_0x4419e2][_0xbafa('0x22')])};if(_0x1fd63c['voiceStatus']==='talking')updateAgentVoiceStatus(_0x5e70ff,_0x3f04ac,_0x4bc466);if(_0x5e70ff[_0xbafa('0x49')])_0x3f04ac[_0xbafa('0x3a')]++;if(_0x5e70ff[_0xbafa('0x3b')])_0x3f04ac['busy']++;if(_0x5e70ff[_0xbafa('0x22')]&&!_0x5e70ff[_0xbafa('0x3b')]&&!_0x5e70ff[_0xbafa('0x21')])_0x3f04ac[_0xbafa('0x22')]++;_0x3f04ac['agents'][_0xbafa('0x24')](_0x5e70ff);}return _0x3f04ac;});}function getQueueAgents(_0x4e1b1d,_0x1a422d,_0x45e8ae){var _0x14a892=_0xbafa('0x4a')+_[_0xbafa('0x17')](_0x45e8ae)+'Queue';var _0x1c853d=_0x45e8ae+'Pause';return db[_0x14a892][_0xbafa('0x4b')]({'where':{[_['startCase'](_0x45e8ae)+_0xbafa('0x4c')]:_0x4e1b1d['id']},'raw':!![]})[_0xbafa('0x1c')](function(_0x2d6d6c){for(var _0x426cd8=0x0;_0x426cd8<_0x2d6d6c['length'];_0x426cd8++){var _0x424d23=_[_0xbafa('0x3d')](_0x1a422d,['id',_0x2d6d6c[_0x426cd8][_0xbafa('0x47')]]);if(!_0x424d23){_0x424d23={'id':_0x2d6d6c[_0x426cd8][_0xbafa('0x47')],'name':_0x2d6d6c[_0x426cd8][_0xbafa('0x47')],'online':![],['pauseField']:![]};}var _0x3f6b50={'id':_0x424d23['id'],'name':_0x424d23['name'],'online':Boolean(_0x424d23[_0xbafa('0x49')]),'paused':Boolean(_0x424d23[_0x1c853d])};if(_0x3f6b50[_0xbafa('0x49')])_0x4e1b1d[_0xbafa('0x3a')]++;_0x4e1b1d[_0xbafa('0x39')][_0xbafa('0x24')](_0x3f6b50);}return _0x4e1b1d;});}function validateChannel(_0x19e485){var _0x2fbdf5=utils[_0xbafa('0x4d')]();if(!_[_0xbafa('0x4e')](_0x2fbdf5,_0x19e485[_0xbafa('0x4f')]()))throw new Error(_0xbafa('0x50'));return _0x19e485[_0xbafa('0x4f')]();}exports[_0xbafa('0x51')]=function(_0x17e1d7,_0x241c0d){var _0x3c14d9={'count':0x0,'rows':[]};var _0x188570={};var _0x590c8d;var _0x1356bd;var _0x2d1fdd;var _0x1ea5b1;var _0x39dd91=utils['getChannels']();var _0xf89571=_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x53')];var _0x482c9b=_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x54')];var _0x1c2a3d=_0x17e1d7['query']['pauseTypeFilter'];var _0x4e6ce4=_0x482c9b===_0xbafa('0x55')||_0x482c9b==='*pause'?!![]:![];var _0x426426=[];var _0x9abb6a;Promise[_0xbafa('0x56')]()[_0xbafa('0x1c')](function(){if(_0x17e1d7[_0xbafa('0x52')]['channel']){_0x590c8d=validateChannel(_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x57')]);}if(!_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]||!_0x17e1d7['query'][_0xbafa('0x58')][_0xbafa('0x4e')]('globalStatus')){_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]=rta['validateSortParameter'](_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]);return;}var _0x407f48=rta[_0xbafa('0x59')](_0x17e1d7[_0xbafa('0x52')]['sort']);_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]=_0x407f48['fields'][_0xbafa('0x5a')](',');_0x1356bd=_0x407f48[_0xbafa('0x5b')];})['then'](function(){if(!_0xf89571){return[];}return rta[_0xbafa('0x5c')](_0xf89571,_0x590c8d);})[_0xbafa('0x1c')](function(_0x3289cd){_0x426426=_0x3289cd;return rta[_0xbafa('0x5d')]();})[_0xbafa('0x1c')](function(_0x2766b4){_0x1ea5b1=_0x2766b4[_0xbafa('0x5e')];if((!_0x482c9b||_0x4e6ce4)&&!_0x1356bd){return _0x426426;}if(_0x1356bd&&!_0x482c9b){return rta[_0xbafa('0x5f')](_0x1ea5b1,_0x426426,_0x1356bd);}else{return rta[_0xbafa('0x60')](_0x1ea5b1,_0x426426,_0x482c9b);}})[_0xbafa('0x1c')](function(_0x34f41c){_0x426426=_0x34f41c;var _0x475ea6=![];if(_0x426426[_0xbafa('0x42')]===0x0){if(_0xf89571||_0x482c9b){_0x475ea6=!![];}if(_0x4e6ce4){_0x475ea6=![];}}if(_0x475ea6){return _0x3c14d9;}var _0x17d5b1=_[_0xbafa('0x37')](db[_0xbafa('0x4a')]['rawAttributes'],function(_0x2013e5){return{'name':_0x2013e5['fieldName'],'type':_0x2013e5[_0xbafa('0x61')][_0xbafa('0x62')]};});_0x17e1d7['query'][_0xbafa('0x63')]=_0xbafa('0x64');_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x49')]=!![];_0x188570=qs[_0xbafa('0x65')](_0x17d5b1,_0x17e1d7);_0x188570[_0xbafa('0x66')]=!![];var _0x195c44=[];if(_0x426426[_0xbafa('0x42')]>0x0){_0x195c44[_0xbafa('0x24')]({'id':{'$in':_0x426426}});if(_0x1356bd&&!_0x482c9b){_0x9abb6a=[db[_0xbafa('0x67')]['literal'](_0xbafa('0x68')+_0x426426+')')];_0x188570[_0xbafa('0x5b')]=_0x9abb6a;}}if(_0x4e6ce4){_0x39dd91[_0xbafa('0x69')](function(_0x3be47e){var _0xc3d414=!![];if(_0x482c9b===_0xbafa('0x6a')&&_0x590c8d!==_0x3be47e){_0xc3d414=![];}_0x195c44[_0xbafa('0x24')]({[_0x3be47e+_0xbafa('0x6b')]:_0xc3d414});});if(_0x1c2a3d){_0x195c44[_0xbafa('0x24')]({'pauseType':_0x1c2a3d});}}else if(_0x482c9b){_0x39dd91[_0xbafa('0x69')](function(_0x3489d5){_0x195c44[_0xbafa('0x24')]({[_0x3489d5+_0xbafa('0x6b')]:![]});});}_0x188570[_0xbafa('0x6c')]=_[_0xbafa('0x3e')](_0x188570['where'],{'$and':_0x195c44});if(_0x17e1d7[_0xbafa('0x6d')][_0xbafa('0x63')]===_0xbafa('0x6d')){var _0x2279b2={'params':{'id':_0x17e1d7[_0xbafa('0x6d')][_0xbafa('0x6e')]},'query':{'section':_0xbafa('0x6f'),'role':_0xbafa('0x64'),'online':!![],'raw':!![],'ids':_0x426426,'customSorting':_0x9abb6a}};if(_0x4e6ce4){_0x2279b2[_0xbafa('0x52')]['extraQueryConditions']=_0x195c44;}_0x2279b2[_0xbafa('0x52')]=Object['assign'](_0x2279b2[_0xbafa('0x52')],_0x17e1d7[_0xbafa('0x52')]);delete _0x2279b2['query']['id'];return db[_0xbafa('0x70')][_0xbafa('0x71')](_0x2279b2);}return db['User'][_0xbafa('0x72')](_0x188570);})[_0xbafa('0x1c')](function(_0x5d1a96){_0x3c14d9[_0xbafa('0xd')]=_0x5d1a96[_0xbafa('0xd')];_0x2d1fdd=_0x5d1a96[_0xbafa('0x5e')];return _0x2d1fdd[_0xbafa('0x37')](function(_0x5abbf5){var _0xbcb5bf=_[_0xbafa('0x3d')](_0x1ea5b1,['id',_0x5abbf5['id']]);if(_0xbcb5bf){var _0x3afd06=rta[_0xbafa('0x73')](_0xbcb5bf);_[_0xbafa('0x3e')](_0x5abbf5,_0x3afd06);}_0x5abbf5[_0xbafa('0x74')]=rta[_0xbafa('0x75')](_0x5abbf5);if(_0x5abbf5['globalStatus']['includes'](_0xbafa('0x55'))){_0x39dd91[_0xbafa('0x69')](function(_0x1c668d){if(_0x5abbf5[_0x1c668d+_0xbafa('0x6b')]){_0x5abbf5[_0x1c668d+_0xbafa('0x76')]='pause';}});}return _0x5abbf5;});})[_0xbafa('0x1c')](function(_0x432cb5){if(!_0x1356bd||_0x9abb6a){return _0x432cb5;}return rta[_0xbafa('0x77')](_0x432cb5,_0x1356bd);})['then'](function(_0x4c23c5){_0x3c14d9['rows']=_0x4c23c5;return _0x3c14d9;})[_0xbafa('0x1c')](respondWithFilteredResult(_0x241c0d,_0x188570))[_0xbafa('0x1a')](handleError(_0x241c0d,null));};exports['getQueues']=function(_0x5ce30f,_0x3cf443){var _0x18f241={'count':0x0,'rows':[]},_0x29ee4e={},_0x58e735,_0x30532f,_0xd0fc64,_0x2a74fb,_0x3952f7;Promise['resolve']()['then'](function(){if(_0x5ce30f['query'][_0xbafa('0x57')])_0x58e735=validateChannel(_0x5ce30f['query'][_0xbafa('0x57')]);var _0xfe71b0=_[_0xbafa('0x17')](_0x58e735)+_0xbafa('0x78');var _0x50d8ce=_[_0xbafa('0x37')](db[_0xfe71b0][_0xbafa('0x79')],function(_0x3f44ed){return{'name':_0x3f44ed[_0xbafa('0x7a')],'type':_0x3f44ed[_0xbafa('0x61')][_0xbafa('0x62')]};});_0x29ee4e=qs[_0xbafa('0x65')](_0x50d8ce,_0x5ce30f);if(_0x5ce30f[_0xbafa('0x6d')][_0xbafa('0x63')]===_0xbafa('0x6d')){var _0x2701d1={'params':{'id':_0x5ce30f[_0xbafa('0x6d')][_0xbafa('0x6e')]},'query':{'section':_0x58e735===_0xbafa('0x15')&&_0x5ce30f[_0xbafa('0x52')]['type']===_0xbafa('0x23')?_0xbafa('0x7b'):_[_0xbafa('0x17')](_0x58e735)+'Queues','type':_0x5ce30f['query']['type'],'nolimit':!![],'sort':_0xbafa('0x14'),'filter':_0x5ce30f['query'][_0xbafa('0x40')]}};return db[_0xbafa('0x70')][_0xbafa('0x71')](_0x2701d1);}return db[_0xfe71b0][_0xbafa('0x72')](_0x29ee4e);})[_0xbafa('0x1c')](function(_0x2a0a47){_0x18f241['count']=_0x2a0a47['count'];_0x30532f=_0x2a0a47[_0xbafa('0x5e')];return getRealtimeQueues(_0x5ce30f,_0x58e735);})[_0xbafa('0x1c')](function(_0x245a57){_0x2a74fb=_0x245a57['rows'];return rta['getRealtimeAgents']();})['then'](function(_0x2f7f90){_0xd0fc64=_0x2f7f90[_0xbafa('0x5e')];if(_0x58e735!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xbafa('0x1c')](function(_0x8972b1){_0x3952f7=_0x8972b1?_0x8972b1[_0xbafa('0x5e')]:[];return initializeQueues(_0x30532f,_0x2a74fb,_0x58e735,_0x5ce30f[_0xbafa('0x52')][_0xbafa('0x61')]);})['then'](function(_0x5a8bb2){var _0x282d9f=_0x5a8bb2[_0xbafa('0x37')](function(_0x4580c8){if(_0x58e735==='voice')return getVoiceQueueAgents(_0x4580c8,_0x30532f,_0xd0fc64,_0x3952f7);else return getQueueAgents(_0x4580c8,_0xd0fc64,_0x58e735);});return Promise[_0xbafa('0x7c')](_0x282d9f);})['then'](function(_0x287f47){_0x18f241[_0xbafa('0x5e')]=_0x287f47;return _0x18f241;})['then'](respondWithFilteredResult(_0x3cf443,_0x29ee4e))['catch'](handleError(_0x3cf443,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6aad26e..8c2b34b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1c2d7b,_0x91c1c1){var _0x57273b=function(_0x19ccd7){while(--_0x19ccd7){_0x1c2d7b['push'](_0x1c2d7b['shift']());}};_0x57273b(++_0x91c1c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa4e80b,_0x4d910f){var _0x384d3a=function(_0x47d243){while(--_0x47d243){_0xa4e80b['push'](_0xa4e80b['shift']());}};_0x384d3a(++_0x4d910f);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 671f9ab..63e6543 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 _0x13f5=['exports','INTEGER','STRING','sequelize'];(function(_0x37d602,_0x2f37fd){var _0x1a0558=function(_0x4ac9f5){while(--_0x4ac9f5){_0x37d602['push'](_0x37d602['shift']());}};_0x1a0558(++_0x2f37fd);}(_0x13f5,0xc3));var _0x513f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x13f5[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'state':{'type':Sequelize[_0x513f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x513f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x513f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x513f('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x513f('0x3')]},'campaigntype':{'type':Sequelize[_0x513f('0x3')]},'membername':{'type':Sequelize[_0x513f('0x3')]}}; \ No newline at end of file +var _0x687b=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x5a5a98,_0x74f555){var _0x7d43ef=function(_0x36116a){while(--_0x36116a){_0x5a5a98['push'](_0x5a5a98['shift']());}};_0x7d43ef(++_0x74f555);}(_0x687b,0x14a));var _0xb687=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x687b[_0x525798];return _0x57da9a;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'state':{'type':Sequelize[_0xb687('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb687('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb687('0x4')]},'responsetime':{'type':Sequelize[_0xb687('0x4')]},'ringtime':{'type':Sequelize[_0xb687('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb687('0x3')]},'campaigntype':{'type':Sequelize[_0xb687('0x3')]},'membername':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 40ba87d..943ddda 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 _0x38ff=['lodash','util','../../config/logger','bluebird','request-promise','path','./reportAgentPreview.attributes','exports','define','report_agent_preview'];(function(_0x3235c0,_0x1fe807){var _0xe4a895=function(_0x5f1af6){while(--_0x5f1af6){_0x3235c0['push'](_0x3235c0['shift']());}};_0xe4a895(++_0x1fe807);}(_0x38ff,0x64));var _0xf38f=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x38ff[_0x7729b1];return _0x349504;};'use strict';var _=require(_0xf38f('0x0'));var util=require(_0xf38f('0x1'));var logger=require(_0xf38f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf38f('0x3'));var rp=require(_0xf38f('0x4'));var fs=require('fs');var path=require(_0xf38f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf38f('0x6'));module[_0xf38f('0x7')]=function(_0x4228cc,_0x5264cd){return _0x4228cc[_0xf38f('0x8')]('ReportAgentPreview',attributes,{'tableName':_0xf38f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x089e=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1e821a,_0x2ecd6c){var _0x5c97dd=function(_0x453e77){while(--_0x453e77){_0x1e821a['push'](_0x1e821a['shift']());}};_0x5c97dd(++_0x2ecd6c);}(_0x089e,0x10b));var _0xe089=function(_0x38ba9c,_0x1ec0d8){_0x38ba9c=_0x38ba9c-0x0;var _0x132c94=_0x089e[_0x38ba9c];return _0x132c94;};'use strict';var _=require(_0xe089('0x0'));var util=require(_0xe089('0x1'));var logger=require(_0xe089('0x2'))(_0xe089('0x3'));var moment=require(_0xe089('0x4'));var BPromise=require(_0xe089('0x5'));var rp=require(_0xe089('0x6'));var fs=require('fs');var path=require(_0xe089('0x7'));var rimraf=require('rimraf');var config=require(_0xe089('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xe089('0x9')]=function(_0x51c231,_0x504ce8){return _0x51c231['define'](_0xe089('0xa'),attributes,{'tableName':_0xe089('0xb'),'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 7f98406..ba17d06 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 _0x56d7=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview'];(function(_0x59571c,_0x1cc576){var _0x38a48c=function(_0x3fe93f){while(--_0x3fe93f){_0x59571c['push'](_0x59571c['shift']());}};_0x38a48c(++_0x1cc576);}(_0x56d7,0xb6));var _0x756d=function(_0x28c752,_0x238454){_0x28c752=_0x28c752-0x0;var _0x30cd6c=_0x56d7[_0x28c752];return _0x30cd6c;};'use strict';var _=require(_0x756d('0x0'));var util=require(_0x756d('0x1'));var moment=require(_0x756d('0x2'));var BPromise=require(_0x756d('0x3'));var rs=require(_0x756d('0x4'));var fs=require('fs');var Redis=require(_0x756d('0x5'));var db=require(_0x756d('0x6'))['db'];var utils=require(_0x756d('0x7'));var logger=require(_0x756d('0x8'))(_0x756d('0x9'));var config=require(_0x756d('0xa'));var jayson=require(_0x756d('0xb'));var client=jayson[_0x756d('0xc')][_0x756d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x30b4ed,_0x5ab4cb,_0x2181b7){return new BPromise(function(_0x2fcce2,_0x272f04){return client['request'](_0x30b4ed,_0x2181b7)[_0x756d('0xe')](function(_0x261e68){logger[_0x756d('0xf')](_0x756d('0x10'),_0x5ab4cb,_0x756d('0x11'));logger[_0x756d('0x12')](_0x756d('0x13'),_0x5ab4cb,_0x756d('0x11'),JSON[_0x756d('0x14')](_0x261e68));if(_0x261e68['error']){if(_0x261e68[_0x756d('0x15')][_0x756d('0x16')]===0x1f4){logger['error'](_0x756d('0x10'),_0x5ab4cb,_0x261e68[_0x756d('0x15')][_0x756d('0x17')]);return _0x272f04(_0x261e68[_0x756d('0x15')][_0x756d('0x17')]);}logger[_0x756d('0x15')](_0x756d('0x10'),_0x5ab4cb,_0x261e68[_0x756d('0x15')][_0x756d('0x17')]);return _0x2fcce2(_0x261e68[_0x756d('0x15')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x5ab4cb,_0x756d('0x11'));_0x2fcce2(_0x261e68[_0x756d('0x18')]['message']);}})[_0x756d('0x19')](function(_0x1771e2){logger['error'](_0x756d('0x10'),_0x5ab4cb,_0x1771e2);_0x272f04(_0x1771e2);});});}exports[_0x756d('0x1a')]=function(_0x4d7b39){var _0x5ed7f8=this;return new Promise(function(_0x320601,_0x3a0cd1){return db[_0x756d('0x1b')]['create'](_0x4d7b39['body'],{'raw':_0x4d7b39['options']?_0x4d7b39[_0x756d('0x1c')][_0x756d('0x1d')]===undefined?!![]:![]:!![]})[_0x756d('0xe')](function(_0x3540af){logger[_0x756d('0xf')](_0x756d('0x1a'),_0x4d7b39);logger['debug'](_0x756d('0x1a'),_0x4d7b39,JSON[_0x756d('0x14')](_0x3540af));_0x320601(_0x3540af);})[_0x756d('0x19')](function(_0x5f116a){logger[_0x756d('0x15')](_0x756d('0x1a'),_0x5f116a[_0x756d('0x17')],_0x4d7b39);_0x3a0cd1(_0x5ed7f8[_0x756d('0x15')](0x1f4,_0x5f116a[_0x756d('0x17')]));});});}; \ No newline at end of file +var _0x484d=['raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x484d,0x145));var _0xd484=function(_0x2034ea,_0x59ef99){_0x2034ea=_0x2034ea-0x0;var _0xcc93b9=_0x484d[_0x2034ea];return _0xcc93b9;};'use strict';var _=require(_0xd484('0x0'));var util=require(_0xd484('0x1'));var moment=require(_0xd484('0x2'));var BPromise=require('bluebird');var rs=require(_0xd484('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd484('0x4'))['db'];var utils=require(_0xd484('0x5'));var logger=require(_0xd484('0x6'))(_0xd484('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd484('0x8')][_0xd484('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7667,_0x4776b4,_0x1faba5){return new BPromise(function(_0x106db6,_0x28b43c){return client[_0xd484('0xa')](_0x4d7667,_0x1faba5)[_0xd484('0xb')](function(_0x1b6d9e){logger[_0xd484('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x4776b4,_0xd484('0xd'));logger[_0xd484('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4776b4,'request\x20sent',JSON[_0xd484('0xf')](_0x1b6d9e));if(_0x1b6d9e[_0xd484('0x10')]){if(_0x1b6d9e['error'][_0xd484('0x11')]===0x1f4){logger[_0xd484('0x10')](_0xd484('0x12'),_0x4776b4,_0x1b6d9e[_0xd484('0x10')][_0xd484('0x13')]);return _0x28b43c(_0x1b6d9e[_0xd484('0x10')]['message']);}logger[_0xd484('0x10')](_0xd484('0x12'),_0x4776b4,_0x1b6d9e[_0xd484('0x10')][_0xd484('0x13')]);return _0x106db6(_0x1b6d9e[_0xd484('0x10')][_0xd484('0x13')]);}else{logger[_0xd484('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x4776b4,_0xd484('0xd'));_0x106db6(_0x1b6d9e[_0xd484('0x14')][_0xd484('0x13')]);}})[_0xd484('0x15')](function(_0x5cb400){logger[_0xd484('0x10')](_0xd484('0x12'),_0x4776b4,_0x5cb400);_0x28b43c(_0x5cb400);});});}exports[_0xd484('0x16')]=function(_0x5bd1fc){var _0x13b7ab=this;return new Promise(function(_0x1d5290,_0xf19180){return db[_0xd484('0x17')][_0xd484('0x18')](_0x5bd1fc['body'],{'raw':_0x5bd1fc[_0xd484('0x19')]?_0x5bd1fc[_0xd484('0x19')][_0xd484('0x1a')]===undefined?!![]:![]:!![]})[_0xd484('0xb')](function(_0x4413af){logger[_0xd484('0xc')](_0xd484('0x16'),_0x5bd1fc);logger[_0xd484('0xe')](_0xd484('0x16'),_0x5bd1fc,JSON[_0xd484('0xf')](_0x4413af));_0x1d5290(_0x4413af);})['catch'](function(_0x225590){logger[_0xd484('0x10')](_0xd484('0x16'),_0x225590[_0xd484('0x13')],_0x5bd1fc);_0xf19180(_0x13b7ab[_0xd484('0x10')](0x1f4,_0x225590[_0xd484('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f8bb5df..8256515 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 _0x8a30=['post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x8a30,0x15c));var _0x08a3=function(_0x53c916,_0x1bfe4f){_0x53c916=_0x53c916-0x0;var _0x2e7c70=_0x8a30[_0x53c916];return _0x2e7c70;};'use strict';var multer=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var path=require(_0x08a3('0x2'));var express=require('express');var router=express[_0x08a3('0x3')]();var auth=require(_0x08a3('0x4'));var controller=require(_0x08a3('0x5'));router[_0x08a3('0x6')](_0x08a3('0x7'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x9')]);router[_0x08a3('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x08a3('0x8')](),controller['voiceChannelMixMonitor']);router[_0x08a3('0x6')](_0x08a3('0xa'),auth[_0x08a3('0x8')](),controller[_0x08a3('0xb')]);router[_0x08a3('0x6')](_0x08a3('0xc'),auth[_0x08a3('0x8')](),controller[_0x08a3('0xd')]);router[_0x08a3('0x6')](_0x08a3('0xe'),auth['isAuthenticated'](),controller[_0x08a3('0xf')]);router[_0x08a3('0x6')](_0x08a3('0x10'),auth['isAuthenticated'](),controller[_0x08a3('0x11')]);router['get'](_0x08a3('0x12'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x13')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller[_0x08a3('0x14')]);router[_0x08a3('0x6')]('/sms/queues',auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x08a3('0x15'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x16')]);router['get'](_0x08a3('0x17'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x18')]);router[_0x08a3('0x6')](_0x08a3('0x19'),auth[_0x08a3('0x8')](),controller['voiceQueuesPreview']);router['get'](_0x08a3('0x1a'),auth['isAuthenticated'](),controller[_0x08a3('0x1b')]);router[_0x08a3('0x6')](_0x08a3('0x1c'),auth[_0x08a3('0x8')](),controller['voiceQueuesChannel']);router[_0x08a3('0x6')](_0x08a3('0x1d'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x1e')]);router[_0x08a3('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x08a3('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x08a3('0x6')](_0x08a3('0x1f'),auth['isAuthenticated'](),controller[_0x08a3('0x20')]);router[_0x08a3('0x21')](_0x08a3('0x1f'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x22')]);router[_0x08a3('0x6')](_0x08a3('0x23'),auth[_0x08a3('0x8')](),controller['outbound']);router[_0x08a3('0x6')](_0x08a3('0x24'),auth[_0x08a3('0x8')](),controller['outboundChannels']);router['get'](_0x08a3('0x25'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x26')]);router[_0x08a3('0x21')](_0x08a3('0x27'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x28')]);router[_0x08a3('0x6')](_0x08a3('0x29'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x2a')]);router['get']('/trunks',auth['isAuthenticated'](),controller['trunks']);router[_0x08a3('0x6')]('/campaigns',auth[_0x08a3('0x8')](),controller[_0x08a3('0x2b')]);router['get']('/fax/accounts',auth[_0x08a3('0x8')](),controller[_0x08a3('0x2c')]);router[_0x08a3('0x6')](_0x08a3('0x2d'),auth['isAuthenticated'](),controller[_0x08a3('0x2e')]);router[_0x08a3('0x6')](_0x08a3('0x2f'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x30')]);router[_0x08a3('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x08a3('0x8')](),controller[_0x08a3('0x31')]);router[_0x08a3('0x6')](_0x08a3('0x32'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x33')]);router[_0x08a3('0x6')](_0x08a3('0x34'),auth['isAuthenticated'](),controller[_0x08a3('0x35')]);router[_0x08a3('0x6')](_0x08a3('0x36'),auth['isAuthenticated'](),controller[_0x08a3('0x37')]);router[_0x08a3('0x6')](_0x08a3('0x38'),auth[_0x08a3('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x08a3('0x39')](_0x08a3('0x3a'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x3b')]('mail'));router[_0x08a3('0x6')](_0x08a3('0x3c'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x3d')]);router['post'](_0x08a3('0x3e'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x3b')]('chat'));router['get'](_0x08a3('0x3f'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x40')]);router[_0x08a3('0x39')]('/fax/queues/:id/notify',auth[_0x08a3('0x8')](),controller[_0x08a3('0x3b')](_0x08a3('0x41')));router[_0x08a3('0x6')](_0x08a3('0x42'),auth[_0x08a3('0x8')](),controller['showFaxQueues']);router[_0x08a3('0x39')](_0x08a3('0x43'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x3b')](_0x08a3('0x44')));router[_0x08a3('0x6')](_0x08a3('0x45'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x46')]);router[_0x08a3('0x39')](_0x08a3('0x47'),auth['isAuthenticated'](),controller[_0x08a3('0x3b')](_0x08a3('0x48')));router[_0x08a3('0x39')](_0x08a3('0x49'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x3b')]('whatsapp'));router[_0x08a3('0x6')](_0x08a3('0x4a'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x4b')]);router[_0x08a3('0x6')](_0x08a3('0x4c'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x4d')]);router[_0x08a3('0x39')](_0x08a3('0x4e'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x4f')]);module[_0x08a3('0x50')]=router; \ No newline at end of file +var _0x7eaf=['put','/agents/:id/capacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','queueNotify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','agentNotify','exports','multer','util','path','Router','./rpc.controller','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents'];(function(_0xf279a1,_0x401669){var _0x5e01b7=function(_0x4681ae){while(--_0x4681ae){_0xf279a1['push'](_0xf279a1['shift']());}};_0x5e01b7(++_0x401669);}(_0x7eaf,0x11b));var _0xf7ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eaf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf7ea('0x0'));var util=require(_0xf7ea('0x1'));var path=require(_0xf7ea('0x2'));var express=require('express');var router=express[_0xf7ea('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0xf7ea('0x4'));router['get']('/voice/channels',auth[_0xf7ea('0x5')](),controller['voiceChannels']);router[_0xf7ea('0x6')](_0xf7ea('0x7'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x8')]);router[_0xf7ea('0x6')](_0xf7ea('0x9'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0xa')]);router[_0xf7ea('0x6')](_0xf7ea('0xb'),auth['isAuthenticated'](),controller[_0xf7ea('0xc')]);router[_0xf7ea('0x6')](_0xf7ea('0xd'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0xe')]);router[_0xf7ea('0x6')](_0xf7ea('0xf'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x10')]);router[_0xf7ea('0x6')](_0xf7ea('0x11'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x12')]);router[_0xf7ea('0x6')]('/openchannel/queues',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x13')]);router[_0xf7ea('0x6')](_0xf7ea('0x14'),auth[_0xf7ea('0x5')](),controller['smsQueues']);router[_0xf7ea('0x6')](_0xf7ea('0x15'),auth[_0xf7ea('0x5')](),controller['whatsappQueues']);router[_0xf7ea('0x6')](_0xf7ea('0x16'),auth[_0xf7ea('0x5')](),controller['faxQueues']);router['get'](_0xf7ea('0x17'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x18')]);router['get'](_0xf7ea('0x19'),auth['isAuthenticated'](),controller[_0xf7ea('0x1a')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xf7ea('0x5')](),controller['voiceQueuesChannel']);router[_0xf7ea('0x6')](_0xf7ea('0x1b'),auth['isAuthenticated'](),controller[_0xf7ea('0x1c')]);router[_0xf7ea('0x6')](_0xf7ea('0x1d'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x1e')]);router[_0xf7ea('0x6')](_0xf7ea('0x1f'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x20')]);router['put'](_0xf7ea('0x1f'),auth[_0xf7ea('0x5')](),controller['updateVoiceQueue']);router[_0xf7ea('0x6')](_0xf7ea('0x21'),auth[_0xf7ea('0x5')](),controller['outbound']);router['get'](_0xf7ea('0x22'),auth['isAuthenticated'](),controller[_0xf7ea('0x23')]);router[_0xf7ea('0x6')](_0xf7ea('0x24'),auth['isAuthenticated'](),controller['agents']);router[_0xf7ea('0x25')](_0xf7ea('0x26'),auth[_0xf7ea('0x5')](),controller['agentCapacity']);router['get']('/telephones',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x27')]);router['get'](_0xf7ea('0x28'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x29')]);router[_0xf7ea('0x6')]('/campaigns',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2a')]);router[_0xf7ea('0x6')](_0xf7ea('0x2b'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2c')]);router[_0xf7ea('0x6')](_0xf7ea('0x2d'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2e')]);router[_0xf7ea('0x6')]('/mail/queues/waitinginteractions',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2f')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0xf7ea('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0xf7ea('0x6')](_0xf7ea('0x30'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x31')]);router[_0xf7ea('0x6')](_0xf7ea('0x32'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x33')]);router[_0xf7ea('0x6')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xf7ea('0x34')]);router[_0xf7ea('0x6')](_0xf7ea('0x35'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x36')]);router[_0xf7ea('0x37')](_0xf7ea('0x38'),auth[_0xf7ea('0x5')](),controller['queueNotify'](_0xf7ea('0x39')));router['get'](_0xf7ea('0x3a'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x3b')]);router[_0xf7ea('0x37')](_0xf7ea('0x3c'),auth[_0xf7ea('0x5')](),controller['queueNotify'](_0xf7ea('0x3d')));router['get'](_0xf7ea('0x3e'),auth['isAuthenticated'](),controller[_0xf7ea('0x3f')]);router['post'](_0xf7ea('0x40'),auth[_0xf7ea('0x5')](),controller['queueNotify'](_0xf7ea('0x41')));router[_0xf7ea('0x6')](_0xf7ea('0x42'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x43')]);router[_0xf7ea('0x37')]('/openchannel/queues/:id/notify',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x44')](_0xf7ea('0x45')));router[_0xf7ea('0x6')](_0xf7ea('0x46'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x47')]);router[_0xf7ea('0x37')](_0xf7ea('0x48'),auth['isAuthenticated'](),controller[_0xf7ea('0x44')]('sms'));router[_0xf7ea('0x37')](_0xf7ea('0x49'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x44')](_0xf7ea('0x4a')));router[_0xf7ea('0x6')](_0xf7ea('0x4b'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x4c')]);router[_0xf7ea('0x6')](_0xf7ea('0x4d'),auth[_0xf7ea('0x5')](),controller['showWhatsappQueues']);router[_0xf7ea('0x37')]('/agents/:id/notify',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x4e')]);module[_0xf7ea('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f06b0eb..825785b 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 _0xf2ca=['voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','findAll','INTERACTION','length','findOrCreate','interface','format','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','Message','TransferReport','create','Start','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf2682d,_0x48f012){_0xf2682d=_0xf2682d-0x0;var _0x53dea0=_0xf2ca[_0xf2682d];return _0x53dea0;};'use strict';var BPromise=require(_0xaf2c('0x0'));var moment=require(_0xaf2c('0x1'));var _=require(_0xaf2c('0x2'));var util=require('util');var db=require(_0xaf2c('0x3'))['db'];var logger=require(_0xaf2c('0x4'))(_0xaf2c('0x5'));var jayson=require(_0xaf2c('0x6'));var amiClient=jayson[_0xaf2c('0x7')][_0xaf2c('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xaf2c('0x8')]({'port':0x232b});var routingClient=jayson[_0xaf2c('0x7')][_0xaf2c('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){var _0x2a011d=_0x37fedd?_0x37fedd:amiClient;return _0x2a011d['request'](_0x1f9531,_0x58351f)[_0xaf2c('0x9')](function(_0x4a0064){if(_0x4a0064[_0xaf2c('0xa')]){if(_0x4a0064[_0xaf2c('0xa')][_0xaf2c('0xb')]===0x1f4){return _0x4a7397(_0x4a0064[_0xaf2c('0xa')]['message']);}return _0x3c0421(_0x4a0064['error'][_0xaf2c('0xc')]);}else{_0x3c0421(_0x4a0064[_0xaf2c('0xd')]);}})[_0xaf2c('0xe')](function(_0xd56a5d){_0x4a7397(_0xd56a5d);});});}function respondWithResult(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xc8;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0xf')](_0x59a59b)[_0xaf2c('0x10')](_0x590126);}return _0x285dac[_0xaf2c('0x11')](0x194);};}function handleError(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0x1f4;return function(_0x152c73){logger[_0xaf2c('0xa')](_0x152c73[_0xaf2c('0x12')]);if(_0x152c73[_0xaf2c('0x13')]){delete _0x152c73[_0xaf2c('0x13')];}_0x18a8a5[_0xaf2c('0xf')](_0x293ca6)[_0xaf2c('0x14')](_0x152c73);};}function findById(_0x26bf7b){return function(_0x3432e4){if(!_[_0xaf2c('0x15')](_0x26bf7b)&&!_['isNil'](_0x3432e4)&&!_[_0xaf2c('0x15')](_0x3432e4['rows'])){return _[_0xaf2c('0x16')](_0x3432e4[_0xaf2c('0x17')],function(_0x1d544a){return _0x1d544a['id']==_0x26bf7b;});}return null;};}exports['voiceChannels']=function(_0x28ae7b,_0x297bcd){return respondWithRpcPromise(_0xaf2c('0x18'),_0x28ae7b[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x297bcd,null))[_0xaf2c('0xe')](handleError(_0x297bcd,null));};exports['voiceChannelMixMonitor']=function(_0x35e712,_0x164bcb){return respondWithRpcPromise(_0xaf2c('0x1a'),_[_0xaf2c('0x1b')](_0x35e712[_0xaf2c('0x19')],_0x35e712['params']))[_0xaf2c('0x9')](respondWithResult(_0x164bcb,null))[_0xaf2c('0xe')](handleError(_0x164bcb,null));};exports[_0xaf2c('0x1c')]=function(_0x4be6ed,_0x59b113){return respondWithRpcPromise(_0xaf2c('0x1d'),_[_0xaf2c('0x1b')](_0x4be6ed[_0xaf2c('0x19')],_0x4be6ed[_0xaf2c('0x1e')]))['then'](respondWithResult(_0x59b113,null))[_0xaf2c('0xe')](handleError(_0x59b113,null));};exports[_0xaf2c('0x1f')]=function(_0x3a0145,_0x3c1ae6){return respondWithRpcPromise(_0xaf2c('0x20'),_0x3a0145[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x3c1ae6,null))['catch'](handleError(_0x3c1ae6,null));};exports[_0xaf2c('0x21')]=function(_0x2051be,_0x36f37c){return respondWithRpcPromise(_0xaf2c('0x20'),_0x2051be['query'])[_0xaf2c('0x9')](findById(_0x2051be['params']['id']))[_0xaf2c('0x9')](respondWithResult(_0x36f37c,null))[_0xaf2c('0xe')](handleError(_0x36f37c,null));};exports[_0xaf2c('0x22')]=function(_0x5d685a,_0x2747bb){return respondWithRpcPromise(_0xaf2c('0x23'),_[_0xaf2c('0x1b')](_0x5d685a['body'],_0x5d685a[_0xaf2c('0x1e')]))[_0xaf2c('0x9')](respondWithResult(_0x2747bb,null))[_0xaf2c('0xe')](handleError(_0x2747bb,null));};exports[_0xaf2c('0x24')]=function(_0x59d858,_0x3da072){return respondWithRpcPromise(_0xaf2c('0x25'),_[_0xaf2c('0x1b')](_0x59d858['query'],_0x59d858['params']))[_0xaf2c('0x9')](respondWithResult(_0x3da072,null))['catch'](handleError(_0x3da072,null));};exports[_0xaf2c('0x26')]=function(_0x5e7247,_0x337cea){return respondWithRpcPromise(_0xaf2c('0x27'),_0x5e7247['query'])[_0xaf2c('0x9')](respondWithResult(_0x337cea,null))[_0xaf2c('0xe')](handleError(_0x337cea,null));};exports['voiceQueuesChannel']=function(_0x13ced2,_0xbec302){return respondWithRpcPromise(_0xaf2c('0x28'),_[_0xaf2c('0x1b')](_0x13ced2[_0xaf2c('0x19')],_0x13ced2[_0xaf2c('0x1e')]))['then'](respondWithResult(_0xbec302,null))[_0xaf2c('0xe')](handleError(_0xbec302,null));};exports['voiceQueuesChannelHangup']=function(_0x321f7c,_0x514bff){return respondWithRpcPromise(_0xaf2c('0x29'),_['merge'](_0x321f7c[_0xaf2c('0x19')],_0x321f7c['params']))[_0xaf2c('0x9')](respondWithResult(_0x514bff,null))['catch'](handleError(_0x514bff,null));};exports[_0xaf2c('0x2a')]=function(_0x356402,_0x1a6929){return respondWithRpcPromise(_0xaf2c('0x2b'),_[_0xaf2c('0x1b')](_0x356402['query'],_0x356402['params']))[_0xaf2c('0x9')](respondWithResult(_0x1a6929,null))[_0xaf2c('0xe')](handleError(_0x1a6929,null));};exports[_0xaf2c('0x2c')]=function(_0xa44813,_0x4eeecf){return respondWithRpcPromise(_0xaf2c('0x2d'),_0xa44813['query'])[_0xaf2c('0x9')](respondWithResult(_0x4eeecf,null))[_0xaf2c('0xe')](handleError(_0x4eeecf,null));};exports['outboundChannels']=function(_0x36081a,_0x24668d){return respondWithRpcPromise(_0xaf2c('0x2e'),_0x36081a[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x24668d,null))[_0xaf2c('0xe')](handleError(_0x24668d,null));};exports[_0xaf2c('0x2f')]=function(_0x310d3b,_0x296ca8){var _0x106eb9;return respondWithRpcPromise(_0xaf2c('0x30'),_0x310d3b[_0xaf2c('0x19')])[_0xaf2c('0x9')](function(_0x4b524d){_0x106eb9=_0x4b524d;return respondWithRpcPromise('Agents',_0x310d3b['query'],routingClient);})[_0xaf2c('0x9')](function(_0x3cb075){return _[_0xaf2c('0x1b')]({},_0x3cb075,_0x106eb9);})[_0xaf2c('0x9')](respondWithResult(_0x296ca8,null))[_0xaf2c('0xe')](handleError(_0x296ca8,null));};exports[_0xaf2c('0x31')]=function(_0x51c441,_0x1d58bd){if(_0x51c441[_0xaf2c('0x32')]&&_0x51c441[_0xaf2c('0x32')]['interaction']&&_0x51c441['user']&&_0x51c441[_0xaf2c('0x33')]['name']){for(var _0x181787 in _0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')]){if(_0x51c441[_0xaf2c('0x32')]['interaction'][_0xaf2c('0x35')](_0x181787)){db['MemberReport'][_0xaf2c('0x36')]({'where':{'channel':_0x181787,'membername':_0x51c441[_0xaf2c('0x33')]['name'],'type':_0xaf2c('0x37'),'exitAt':null,'uniqueid':_0x51c441['body'][_0xaf2c('0x34')][_0x181787]&&_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0xaf2c('0x38')]?{'$notIn':_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787]}:{'$ne':null}}})[_0xaf2c('0x9')](function(_0x16b469){var _0x922b9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x18e62b=0x0,_0x4d0977=_0x16b469['length'];_0x18e62b<_0x4d0977;_0x18e62b+=0x1){_0x16b469[_0x18e62b]['updateAttributes']({'exitAt':_0x922b9});}});for(var _0x11a90a=0x0;_0x11a90a<_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0xaf2c('0x38')];_0x11a90a+=0x1){db['MemberReport'][_0xaf2c('0x39')]({'where':{'channel':_0x181787,'membername':_0x51c441['user'][_0xaf2c('0x13')],'type':'INTERACTION','uniqueid':_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0x11a90a],'exitAt':null},'defaults':{'channel':_0x181787,'membername':_0x51c441[_0xaf2c('0x33')][_0xaf2c('0x13')],'interface':_[_0xaf2c('0x15')](_0x51c441['user'][_0xaf2c('0x3a')])?util[_0xaf2c('0x3b')]('SIP/%s',_0x51c441['user'][_0xaf2c('0x13')]):_0x51c441['user'][_0xaf2c('0x3a')],'type':_0xaf2c('0x37'),'enterAt':moment()[_0xaf2c('0x3b')](_0xaf2c('0x3c')),'role':_0xaf2c('0x3d'),'internal':_0x51c441[_0xaf2c('0x33')][_0xaf2c('0x3e')],'uniqueid':_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0x11a90a]}});}}}}return respondWithRpcPromise(_0xaf2c('0x3f'),{'id':_0x51c441[_0xaf2c('0x1e')]['id'],'capacity':_0x51c441['body'][_0xaf2c('0x40')]},routingClient)[_0xaf2c('0x9')](respondWithResult(_0x1d58bd,null))['catch'](handleError(_0x1d58bd,null));};exports['telephones']=function(_0x56d7ce,_0x7ddca0){return respondWithRpcPromise(_0xaf2c('0x41'),_0x56d7ce['query'])[_0xaf2c('0x9')](respondWithResult(_0x7ddca0,null))[_0xaf2c('0xe')](handleError(_0x7ddca0,null));};exports[_0xaf2c('0x42')]=function(_0x3085e5,_0x265748){return respondWithRpcPromise(_0xaf2c('0x43'),_0x3085e5[_0xaf2c('0x19')])['then'](respondWithResult(_0x265748,null))[_0xaf2c('0xe')](handleError(_0x265748,null));};exports[_0xaf2c('0x44')]=function(_0x5771e5,_0x245797){return respondWithRpcPromise(_0xaf2c('0x45'),_0x5771e5[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x245797,null))[_0xaf2c('0xe')](handleError(_0x245797,null));};exports[_0xaf2c('0x46')]=function(_0x332340,_0x15a335){return respondWithRpcPromise(_0xaf2c('0x47'),_0x332340[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x15a335,null))[_0xaf2c('0xe')](handleError(_0x15a335,null));};exports[_0xaf2c('0x48')]=function(_0x2356a0,_0x297a22){return respondWithRpcPromise(_0xaf2c('0x47'),_0x2356a0[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x2356a0[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0x297a22,null))['catch'](handleError(_0x297a22,null));};exports[_0xaf2c('0x49')]=function(_0x3ac79c,_0xfe5928){return respondWithRpcPromise('MailQueues',_0x3ac79c[_0xaf2c('0x19')],routingClient)['then'](respondWithResult(_0xfe5928,null))[_0xaf2c('0xe')](handleError(_0xfe5928,null));};exports[_0xaf2c('0x4a')]=function(_0xb3ad9,_0x45918b){return respondWithRpcPromise(_0xaf2c('0x4b'),_0xb3ad9[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0xb3ad9[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0x45918b,null))['catch'](handleError(_0x45918b,null));};exports[_0xaf2c('0x4c')]=function(_0x400dcd,_0x262937){return respondWithRpcPromise(_0xaf2c('0x4d'),_0x400dcd[_0xaf2c('0x19')],mailClient)['then'](respondWithResult(_0x262937,null))[_0xaf2c('0xe')](handleError(_0x262937,null));};exports[_0xaf2c('0x4e')]=function(_0x506000,_0x33aa67){return respondWithRpcPromise(_0xaf2c('0x4f'),_0x506000['query'],routingClient)['then'](respondWithResult(_0x33aa67,null))[_0xaf2c('0xe')](handleError(_0x33aa67,null));};exports[_0xaf2c('0x50')]=function(_0xc83d19,_0x39c5d2){return respondWithRpcPromise('OpenchannelQueues',_0xc83d19[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0xc83d19['params']['id']))[_0xaf2c('0x9')](respondWithResult(_0x39c5d2,null))['catch'](handleError(_0x39c5d2,null));};exports[_0xaf2c('0x51')]=function(_0xe6a251,_0x16e9f4){return respondWithRpcPromise(_0xaf2c('0x52'),_0xe6a251[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x16e9f4,null))[_0xaf2c('0xe')](handleError(_0x16e9f4,null));};exports[_0xaf2c('0x53')]=function(_0x1520ec,_0xc27601){return respondWithRpcPromise('SmsQueues',_0x1520ec[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x1520ec[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0xc27601,null))[_0xaf2c('0xe')](handleError(_0xc27601,null));};exports['whatsappQueues']=function(_0xbfb776,_0x28b09f){return respondWithRpcPromise(_0xaf2c('0x54'),_0xbfb776[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x28b09f,null))['catch'](handleError(_0x28b09f,null));};exports['showWhatsappQueues']=function(_0x1166c9,_0x1ead61){return respondWithRpcPromise('WhatsappQueues',_0x1166c9[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x1166c9[_0xaf2c('0x1e')]['id']))['then'](respondWithResult(_0x1ead61,null))[_0xaf2c('0xe')](handleError(_0x1ead61,null));};exports[_0xaf2c('0x55')]=function(_0x18dcde,_0x2aae3a){return respondWithRpcPromise('FaxQueues',_0x18dcde[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x2aae3a,null))[_0xaf2c('0xe')](handleError(_0x2aae3a,null));};exports[_0xaf2c('0x56')]=function(_0x20c120,_0x1ecf97){return respondWithRpcPromise(_0xaf2c('0x57'),_0x20c120[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x20c120[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0x1ecf97,null))['catch'](handleError(_0x1ecf97,null));};exports[_0xaf2c('0x58')]=function(_0x5d965c,_0x1a0795){return respondWithRpcPromise(_0xaf2c('0x59'),_0x5d965c['query'])[_0xaf2c('0x9')](respondWithResult(_0x1a0795,null))['catch'](handleError(_0x1a0795,null));};exports['chatQueuesWaitingInteractions']=function(_0x316333,_0x1d73ef){return respondWithRpcPromise(_0xaf2c('0x5a'),_0x316333['query'],routingClient)['then'](respondWithResult(_0x1d73ef,null))['catch'](handleError(_0x1d73ef,null));};exports[_0xaf2c('0x5b')]=function(_0x3e972c,_0x517f8d){return respondWithRpcPromise(_0xaf2c('0x5c'),_0x3e972c[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x517f8d,null))[_0xaf2c('0xe')](handleError(_0x517f8d,null));};exports[_0xaf2c('0x5d')]=function(_0x44303c,_0x4be47b){return respondWithRpcPromise(_0xaf2c('0x5e'),_0x44303c[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x4be47b,null))['catch'](handleError(_0x4be47b,null));};exports[_0xaf2c('0x5f')]=function(_0x3c53ff,_0x37ee02){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3c53ff[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](function(_0x433f9e){if(_0x3c53ff[_0xaf2c('0x19')]['type']!==undefined){var _0x286a40=_(_0x433f9e[_0xaf2c('0x17')])[_0xaf2c('0x60')]([_0x3c53ff['query']['type'],_0x3c53ff[_0xaf2c('0x1e')]['id']])[_0xaf2c('0x61')]('queue_id')[_0xaf2c('0x62')]()[_0xaf2c('0x63')]();return _0x433f9e['rows'][_0xaf2c('0x60')](function(_0x31cf3e){return _0x286a40[_0xaf2c('0x64')](_0x31cf3e[_0xaf2c('0x65')])>-0x1;});}else{return _0x433f9e[_0xaf2c('0x17')]['filter'](function(_0x5831c9){return _0x5831c9[_0xaf2c('0x65')]===parseInt(_0x3c53ff[_0xaf2c('0x1e')]['id']);});}})[_0xaf2c('0x9')](respondWithResult(_0x37ee02,null))['catch'](handleError(_0x37ee02,null));};exports[_0xaf2c('0x66')]=function(_0x467a36,_0x3d8471){return respondWithRpcPromise(_0xaf2c('0x67'),_0x467a36[_0xaf2c('0x19')],routingClient)['then'](respondWithResult(_0x3d8471,null))[_0xaf2c('0xe')](handleError(_0x3d8471,null));};exports[_0xaf2c('0x68')]=function(_0x154f69,_0x1ef61f){return respondWithRpcPromise(_0xaf2c('0x69'),_0x154f69[_0xaf2c('0x19')],routingClient)['then'](respondWithResult(_0x1ef61f,null))[_0xaf2c('0xe')](handleError(_0x1ef61f,null));};exports[_0xaf2c('0x6a')]=function(_0x483774,_0x5beb89){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x483774[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x5beb89,null))[_0xaf2c('0xe')](handleError(_0x5beb89,null));};exports[_0xaf2c('0x6b')]=function(_0x499bbe){return function(_0x19fbd5,_0x2d7ca5){var _0x2b57d2,_0x430567;var _0x4ddf95=_[_0xaf2c('0x6c')](_0x499bbe);var _0x23aeac=_0x499bbe===_0xaf2c('0x6d')?_0xaf2c('0x6e'):_0xaf2c('0x6f');return db[_0x4ddf95+'Queue'][_0xaf2c('0x70')]({'raw':!![],'where':{'id':_0x19fbd5[_0xaf2c('0x1e')]['id']}})['then'](function(_0x516193){if(_[_0xaf2c('0x15')](_0x516193)){throw new Error(_0x4ddf95+_0xaf2c('0x71'));}_0x2b57d2=_0x516193;return db[_0x4ddf95+'Message'][_0xaf2c('0x70')]({'where':{'id':_0x19fbd5[_0xaf2c('0x32')][_0xaf2c('0x72')]},'include':[{'model':db[_0x4ddf95+_0xaf2c('0x73')],'as':_0xaf2c('0x73')},{'model':db[_0x4ddf95+_0x23aeac],'as':_0xaf2c('0x6f')}]});})[_0xaf2c('0x9')](function(_0x43c174){if(_['isNil'](_0x43c174)){throw new Error(_0x4ddf95+_0xaf2c('0x74'));}_0x430567=_0x43c174;return _0x43c174['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xaf2c('0x9')](function(){var _0x7724cc={'uniqueid':_0x499bbe+'.'+_0x430567['id']+'.'+_0x430567['Interaction']['id'],'FromUserId':_0x19fbd5['user']['id'],'type':_0xaf2c('0x75')};_0x7724cc[_0x4ddf95+_0xaf2c('0x76')]=_0x430567['id'];_0x7724cc[_0x4ddf95+_0xaf2c('0x77')]=_0x430567['Interaction']['id'];_0x7724cc[_0xaf2c('0x78')+_0x4ddf95+_0x23aeac+'Id']=_0x430567[_0xaf2c('0x6f')]['id'];_0x7724cc['To'+_0x4ddf95+_0xaf2c('0x79')]=_0x2b57d2['id'];return db[_0x4ddf95+'TransferReport']['create'](_0x7724cc);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x499bbe,'interaction':_0x430567[_0xaf2c('0x73')],'message':_0x430567,'account':_0x430567[_0xaf2c('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaf2c('0x75'),'appdata':_0x2b57d2[_0xaf2c('0x13')]+','+(_0x430567[_0xaf2c('0x6f')]['queueTransferTimeout']||0x12c),'interval':_0xaf2c('0x7a')}]},routingClient);})[_0xaf2c('0x9')](respondWithResult(_0x2d7ca5,null))['catch'](handleError(_0x2d7ca5,null));};};exports[_0xaf2c('0x7b')]=function(_0x4a3a61,_0x31f1d3){var _0x25d49c,_0x1e403a;if(_[_0xaf2c('0x15')](_0x4a3a61[_0xaf2c('0x32')][_0xaf2c('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x47b971=_0x4a3a61[_0xaf2c('0x32')][_0xaf2c('0x7c')];var _0x1bc548=_[_0xaf2c('0x6c')](_0x47b971);var _0x118e78=_0x47b971===_0xaf2c('0x6d')?'Website':'Account';return db[_0xaf2c('0x7d')]['findOne']({'raw':!![],'where':{'id':_0x4a3a61[_0xaf2c('0x1e')]['id'],'role':'agent'}})[_0xaf2c('0x9')](function(_0x639b4b){if(_['isNil'](_0x639b4b)){throw new Error(_0xaf2c('0x7e'));}_0x25d49c=_0x639b4b;return db[_0x1bc548+_0xaf2c('0x7f')][_0xaf2c('0x70')]({'where':{'id':_0x4a3a61['body'][_0xaf2c('0x72')]},'include':[{'model':db[_0x1bc548+_0xaf2c('0x73')],'as':_0xaf2c('0x73')},{'model':db[_0x1bc548+_0x118e78],'as':_0xaf2c('0x6f')}]});})[_0xaf2c('0x9')](function(_0xb311e1){if(_['isNil'](_0xb311e1)){throw new Error(_0x1bc548+'\x20Message\x20not\x20found');}_0x1e403a=_0xb311e1;return _0xb311e1['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2db412={'uniqueid':_0x47b971+'.'+_0x1e403a['id']+'.'+_0x1e403a['Interaction']['id'],'FromUserId':_0x4a3a61[_0xaf2c('0x33')]['id'],'type':'queue','ToUserId':_0x25d49c['id']};_0x2db412[_0x1bc548+'MessageId']=_0x1e403a['id'];_0x2db412[_0x1bc548+_0xaf2c('0x77')]=_0x1e403a[_0xaf2c('0x73')]['id'];_0x2db412['From'+_0x1bc548+_0x118e78+'Id']=_0x1e403a[_0xaf2c('0x6f')]['id'];return db[_0x1bc548+_0xaf2c('0x80')][_0xaf2c('0x81')](_0x2db412);})[_0xaf2c('0x9')](function(){return respondWithRpcPromise(_0xaf2c('0x82'),{'channel':_0x47b971,'interaction':_0x1e403a[_0xaf2c('0x73')],'message':_0x1e403a,'account':_0x1e403a[_0xaf2c('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaf2c('0x3d'),'appdata':_0x25d49c[_0xaf2c('0x13')]+','+(_0x1e403a[_0xaf2c('0x6f')]['agentTransferTimeout']||0x12c),'interval':_0xaf2c('0x7a')}]},routingClient);})['then'](respondWithResult(_0x31f1d3,null))[_0xaf2c('0xe')](handleError(_0x31f1d3,null));}; \ No newline at end of file +var _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x16acff,_0x56ebcc){var _0x311209=function(_0x4f871f){while(--_0x4f871f){_0x16acff['push'](_0x16acff['shift']());}};_0x311209(++_0x56ebcc);}(_0x2d17,0x17e));var _0x72d1=function(_0x1e2853,_0x2f3288){_0x1e2853=_0x1e2853-0x0;var _0x52f41e=_0x2d17[_0x1e2853];return _0x52f41e;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 70a6e9a..b3f0022 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 _0xa8b3=['index','get','/:id','show','/:id/run','run','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x1408a1,_0x24a294){var _0x486e11=function(_0x14b79c){while(--_0x14b79c){_0x1408a1['push'](_0x1408a1['shift']());}};_0x486e11(++_0x24a294);}(_0xa8b3,0x107));var _0x3a8b=function(_0x102470,_0x199a01){_0x102470=_0x102470-0x0;var _0x558eaa=_0xa8b3[_0x102470];return _0x558eaa;};'use strict';var multer=require(_0x3a8b('0x0'));var util=require(_0x3a8b('0x1'));var path=require(_0x3a8b('0x2'));var timeout=require(_0x3a8b('0x3'));var express=require(_0x3a8b('0x4'));var router=express['Router']();var fs_extra=require(_0x3a8b('0x5'));var auth=require(_0x3a8b('0x6'));var interaction=require(_0x3a8b('0x7'));var config=require(_0x3a8b('0x8'));var controller=require('./schedule.controller');router['get']('/',auth[_0x3a8b('0x9')](),controller[_0x3a8b('0xa')]);router[_0x3a8b('0xb')](_0x3a8b('0xc'),auth['isAuthenticated'](),controller[_0x3a8b('0xd')]);router[_0x3a8b('0xb')](_0x3a8b('0xe'),auth[_0x3a8b('0x9')](),controller[_0x3a8b('0xf')]);router[_0x3a8b('0x10')]('/',auth[_0x3a8b('0x9')](),controller[_0x3a8b('0x11')]);router['put'](_0x3a8b('0xc'),auth[_0x3a8b('0x9')](),controller[_0x3a8b('0x12')]);router['delete'](_0x3a8b('0xc'),auth[_0x3a8b('0x9')](),controller[_0x3a8b('0x13')]);module[_0x3a8b('0x14')]=router; \ No newline at end of file +var _0x9736=['destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','run','post','create','put','update'];(function(_0x17f145,_0x3422bb){var _0x2d5420=function(_0x3eb38b){while(--_0x3eb38b){_0x17f145['push'](_0x17f145['shift']());}};_0x2d5420(++_0x3422bb);}(_0x9736,0xef));var _0x6973=function(_0x33993e,_0xd4ae85){_0x33993e=_0x33993e-0x0;var _0x1c3281=_0x9736[_0x33993e];return _0x1c3281;};'use strict';var multer=require('multer');var util=require(_0x6973('0x0'));var path=require('path');var timeout=require(_0x6973('0x1'));var express=require(_0x6973('0x2'));var router=express[_0x6973('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6973('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6973('0x5'));var controller=require(_0x6973('0x6'));router[_0x6973('0x7')]('/',auth[_0x6973('0x8')](),controller['index']);router[_0x6973('0x7')](_0x6973('0x9'),auth['isAuthenticated'](),controller[_0x6973('0xa')]);router['get']('/:id/run',auth[_0x6973('0x8')](),controller[_0x6973('0xb')]);router[_0x6973('0xc')]('/',auth[_0x6973('0x8')](),controller[_0x6973('0xd')]);router[_0x6973('0xe')](_0x6973('0x9'),auth[_0x6973('0x8')](),controller[_0x6973('0xf')]);router['delete']('/:id',auth[_0x6973('0x8')](),controller[_0x6973('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6e09508..92d69e0 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 _0x7a04=['default','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','csv','pdf','xlsx','custom'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7a04,0xd3));var _0x47a0=function(_0xf4ade3,_0x5de9e2){_0xf4ade3=_0xf4ade3-0x0;var _0x4be8ab=_0x7a04[_0xf4ade3];return _0x4be8ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x47a0('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x47a0('0x0')]},'active':{'type':Sequelize[_0x47a0('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x47a0('0x0')],'allowNull':![],'defaultValue':_0x47a0('0x2')},'startAt':{'type':Sequelize[_0x47a0('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x47a0('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x47a0('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x47a0('0x5'),_0x47a0('0x6'),_0x47a0('0x7'),_0x47a0('0x8'),_0x47a0('0x9'),_0x47a0('0xa'),_0x47a0('0xb')),'allowNull':![],'defaultValue':_0x47a0('0x9')},'output':{'type':Sequelize[_0x47a0('0xc')](_0x47a0('0xd'),_0x47a0('0xe'),_0x47a0('0xf')),'allowNull':![],'defaultValue':_0x47a0('0xd')},'type':{'type':Sequelize[_0x47a0('0xc')](_0x47a0('0x10'),_0x47a0('0x11')),'allowNull':![],'defaultValue':_0x47a0('0x10')},'sendMail':{'type':Sequelize[_0x47a0('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x47a0('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x47a0('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1148=['STRING','BOOLEAN','DATE','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','exports'];(function(_0xfa3fe6,_0x1dc469){var _0x16a55e=function(_0xcd7029){while(--_0xcd7029){_0xfa3fe6['push'](_0xfa3fe6['shift']());}};_0x16a55e(++_0x1dc469);}(_0x1148,0x6b));var _0x8114=function(_0x23cb53,_0x1266ae){_0x23cb53=_0x23cb53-0x0;var _0x40d706=_0x1148[_0x23cb53];return _0x40d706;};'use strict';var Sequelize=require('sequelize');module[_0x8114('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8114('0x1')]},'active':{'type':Sequelize[_0x8114('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8114('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x8114('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8114('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8114('0x4')](_0x8114('0x5'),_0x8114('0x6'),_0x8114('0x7'),_0x8114('0x8'),_0x8114('0x9'),_0x8114('0xa'),_0x8114('0xb')),'allowNull':![],'defaultValue':_0x8114('0x9')},'output':{'type':Sequelize[_0x8114('0x4')](_0x8114('0xc'),_0x8114('0xd'),_0x8114('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x8114('0x4')](_0x8114('0xf'),_0x8114('0x10')),'allowNull':![],'defaultValue':_0x8114('0xf')},'sendMail':{'type':Sequelize[_0x8114('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x8114('0x1')]},'cc':{'type':Sequelize[_0x8114('0x11')]},'bcc':{'type':Sequelize[_0x8114('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d37c9dc..901ed07 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 _0x82bb=['reject','update','then','destroy','get','stack','name','index','Schedule','rawAttributes','fieldName','type','key','map','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','show','params','include','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x82bb,0x12f));var _0xb82b=function(_0xc3a71f,_0x54fe71){_0xc3a71f=_0xc3a71f-0x0;var _0x46a474=_0x82bb[_0xc3a71f];return _0x46a474;};'use strict';var emlformat=require(_0xb82b('0x0'));var rimraf=require(_0xb82b('0x1'));var zipdir=require(_0xb82b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb82b('0x3'));var moment=require('moment');var BPromise=require(_0xb82b('0x4'));var Mustache=require('mustache');var util=require(_0xb82b('0x5'));var path=require('path');var sox=require(_0xb82b('0x6'));var csv=require(_0xb82b('0x7'));var ejs=require(_0xb82b('0x8'));var fs=require('fs');var fs_extra=require(_0xb82b('0x9'));var _=require(_0xb82b('0xa'));var squel=require(_0xb82b('0xb'));var crypto=require(_0xb82b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb82b('0xd'));var toCsv=require(_0xb82b('0x7'));var querystring=require(_0xb82b('0xe'));var Papa=require(_0xb82b('0xf'));var Redis=require(_0xb82b('0x10'));var authService=require(_0xb82b('0x11'));var qs=require(_0xb82b('0x12'));var as=require(_0xb82b('0x13'));var hardwareService=require(_0xb82b('0x14'));var logger=require(_0xb82b('0x15'))(_0xb82b('0x16'));var utils=require(_0xb82b('0x17'));var config=require(_0xb82b('0x18'));var licenseUtil=require(_0xb82b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf4e31f,_0x13431e){_0x13431e=_0x13431e||0xcc;return function(_0xa44730){if(_0xa44730){return _0xf4e31f[_0xb82b('0x1a')](_0x13431e);}return _0xf4e31f[_0xb82b('0x1b')](_0x13431e)[_0xb82b('0x1c')]();};}function respondWithResult(_0x36239a,_0x5aedd1){_0x5aedd1=_0x5aedd1||0xc8;return function(_0x1fb82c){if(_0x1fb82c){return _0x36239a[_0xb82b('0x1b')](_0x5aedd1)[_0xb82b('0x1d')](_0x1fb82c);}};}function respondWithFilteredResult(_0x1a4836,_0xeb996e){return function(_0x2390de){if(_0x2390de){var _0x92c810=typeof _0xeb996e[_0xb82b('0x1e')]===_0xb82b('0x1f')&&typeof _0xeb996e[_0xb82b('0x20')]===_0xb82b('0x1f');var _0x4bae4b=_0x2390de[_0xb82b('0x21')];var _0x214d54=_0x92c810?0x0:_0xeb996e[_0xb82b('0x1e')];var _0x52ab87=_0x92c810?_0x2390de[_0xb82b('0x21')]:_0xeb996e[_0xb82b('0x1e')]+_0xeb996e[_0xb82b('0x20')];var _0x5affca;if(_0x52ab87>=_0x4bae4b){_0x52ab87=_0x4bae4b;_0x5affca=0xc8;}else{_0x5affca=0xce;}_0x1a4836[_0xb82b('0x1b')](_0x5affca);return _0x1a4836[_0xb82b('0x22')](_0xb82b('0x23'),_0x214d54+'-'+_0x52ab87+'/'+_0x4bae4b)[_0xb82b('0x1d')](_0x2390de);}return null;};}function patchUpdates(_0x33ae01){return function(_0x116e50){try{jsonpatch[_0xb82b('0x24')](_0x116e50,_0x33ae01,!![]);}catch(_0x5b6acd){return BPromise[_0xb82b('0x25')](_0x5b6acd);}return _0x116e50['save']();};}function saveUpdates(_0x168dc3,_0x3da6df){return function(_0x1fae8c){if(_0x1fae8c){return _0x1fae8c[_0xb82b('0x26')](_0x168dc3)[_0xb82b('0x27')](function(_0x4b3ef9){return _0x4b3ef9;});}return null;};}function removeEntity(_0x43ceb5,_0x492a53){return function(_0x13f51d){if(_0x13f51d){return _0x13f51d[_0xb82b('0x28')]()[_0xb82b('0x27')](function(){var _0x18d047=_0x13f51d[_0xb82b('0x29')]({'plain':!![]});var _0x3120c8='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x3120c8,'resourceId':_0x18d047['id']}})['then'](function(){return _0x13f51d;});})[_0xb82b('0x27')](function(){_0x43ceb5['status'](0xcc)[_0xb82b('0x1c')]();});}};}function handleEntityNotFound(_0x14f829,_0x425186){return function(_0xcea765){if(!_0xcea765){_0x14f829['sendStatus'](0x194);}return _0xcea765;};}function handleError(_0x441d32,_0x19515b){_0x19515b=_0x19515b||0x1f4;return function(_0x1b3b88){logger['error'](_0x1b3b88[_0xb82b('0x2a')]);if(_0x1b3b88[_0xb82b('0x2b')]){delete _0x1b3b88['name'];}_0x441d32[_0xb82b('0x1b')](_0x19515b)['send'](_0x1b3b88);};}exports[_0xb82b('0x2c')]=function(_0x54e695,_0x8aab0a){var _0xb502d1={},_0x3ad751={},_0x54f1a2={'count':0x0,'rows':[]};var _0x561161=_['map'](db[_0xb82b('0x2d')][_0xb82b('0x2e')],function(_0x2a7bad){return{'name':_0x2a7bad[_0xb82b('0x2f')],'type':_0x2a7bad[_0xb82b('0x30')][_0xb82b('0x31')]};});_0x3ad751['model']=_[_0xb82b('0x32')](_0x561161,_0xb82b('0x2b'));_0x3ad751[_0xb82b('0x33')]=_[_0xb82b('0x34')](_0x54e695[_0xb82b('0x33')]);_0x3ad751['filters']=_['intersection'](_0x3ad751['model'],_0x3ad751[_0xb82b('0x33')]);_0xb502d1[_0xb82b('0x35')]=_[_0xb82b('0x36')](_0x3ad751[_0xb82b('0x37')],qs[_0xb82b('0x38')](_0x54e695[_0xb82b('0x33')][_0xb82b('0x38')]));_0xb502d1[_0xb82b('0x35')]=_0xb502d1[_0xb82b('0x35')][_0xb82b('0x39')]?_0xb502d1[_0xb82b('0x35')]:_0x3ad751['model'];if(!_0x54e695['query'][_0xb82b('0x3a')]('nolimit')){_0xb502d1[_0xb82b('0x20')]=qs[_0xb82b('0x20')](_0x54e695[_0xb82b('0x33')][_0xb82b('0x20')]);_0xb502d1['offset']=qs[_0xb82b('0x1e')](_0x54e695['query'][_0xb82b('0x1e')]);}_0xb502d1['order']=qs[_0xb82b('0x3b')](_0x54e695[_0xb82b('0x33')][_0xb82b('0x3b')]);_0xb502d1['where']=qs[_0xb82b('0x3c')](_['pick'](_0x54e695[_0xb82b('0x33')],_0x3ad751[_0xb82b('0x3c')]),_0x561161);if(_0x54e695[_0xb82b('0x33')][_0xb82b('0x3d')]){_0xb502d1[_0xb82b('0x3e')]=_[_0xb82b('0x3f')](_0xb502d1[_0xb82b('0x3e')],{'$or':_[_0xb82b('0x32')](_0x561161,function(_0x25e398){if(_0x25e398[_0xb82b('0x30')]!==_0xb82b('0x40')){var _0xa57437={};_0xa57437[_0x25e398['name']]={'$like':'%'+_0x54e695[_0xb82b('0x33')][_0xb82b('0x3d')]+'%'};return _0xa57437;}})});}_0xb502d1=_[_0xb82b('0x3f')]({},_0xb502d1,_0x54e695['options']);var _0x3179e6={'where':_0xb502d1[_0xb82b('0x3e')]};return db[_0xb82b('0x2d')][_0xb82b('0x21')](_0x3179e6)['then'](function(_0x18da06){_0x54f1a2['count']=_0x18da06;if(_0x54e695[_0xb82b('0x33')][_0xb82b('0x41')]){_0xb502d1['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0xb502d1);})[_0xb82b('0x27')](function(_0x5a70e8){_0x54f1a2[_0xb82b('0x42')]=_0x5a70e8;return _0x54f1a2;})[_0xb82b('0x27')](respondWithFilteredResult(_0x8aab0a,_0xb502d1))['catch'](handleError(_0x8aab0a,null));};exports[_0xb82b('0x43')]=function(_0x49d185,_0x3e592a){var _0x1ef417={'raw':![],'where':{'id':_0x49d185[_0xb82b('0x44')]['id']}},_0x2333ed={};_0x2333ed[_0xb82b('0x37')]=_['keys'](db['Schedule'][_0xb82b('0x2e')]);_0x2333ed[_0xb82b('0x33')]=_[_0xb82b('0x34')](_0x49d185[_0xb82b('0x33')]);_0x2333ed['filters']=_[_0xb82b('0x36')](_0x2333ed[_0xb82b('0x37')],_0x2333ed[_0xb82b('0x33')]);_0x1ef417[_0xb82b('0x35')]=_[_0xb82b('0x36')](_0x2333ed[_0xb82b('0x37')],qs['fields'](_0x49d185[_0xb82b('0x33')][_0xb82b('0x38')]));_0x1ef417['attributes']=_0x1ef417[_0xb82b('0x35')][_0xb82b('0x39')]?_0x1ef417[_0xb82b('0x35')]:_0x2333ed['model'];if(_0x49d185[_0xb82b('0x33')][_0xb82b('0x41')]){_0x1ef417[_0xb82b('0x45')]=[{'all':!![]}];}_0x1ef417=_['merge']({},_0x1ef417,_0x49d185[_0xb82b('0x46')]);return db[_0xb82b('0x2d')]['find'](_0x1ef417)[_0xb82b('0x27')](handleEntityNotFound(_0x3e592a,null))[_0xb82b('0x27')](respondWithResult(_0x3e592a,null))[_0xb82b('0x47')](handleError(_0x3e592a,null));};exports[_0xb82b('0x48')]=function(_0x597170,_0x292c0c){return db[_0xb82b('0x2d')][_0xb82b('0x48')](_0x597170[_0xb82b('0x49')],{})[_0xb82b('0x27')](function(_0x579e72){var _0x1d43b6=_0x597170['user'][_0xb82b('0x29')]({'plain':!![]});if(!_0x1d43b6)throw new Error(_0xb82b('0x4a'));if(_0x1d43b6[_0xb82b('0x4b')]==='user'){var _0x3b82d9=_0x579e72['get']({'plain':!![]});var _0x272edf=_0xb82b('0x4c');return db[_0xb82b('0x4d')][_0xb82b('0x4e')]({'where':{'name':_0x272edf,'userProfileId':_0x1d43b6['userProfileId']},'raw':!![]})[_0xb82b('0x27')](function(_0x6c5e48){if(_0x6c5e48&&_0x6c5e48[_0xb82b('0x4f')]===0x0){return db[_0xb82b('0x50')]['create']({'name':_0x3b82d9[_0xb82b('0x2b')],'resourceId':_0x3b82d9['id'],'type':_0x6c5e48[_0xb82b('0x2b')],'sectionId':_0x6c5e48['id']},{})[_0xb82b('0x27')](function(){return _0x579e72;});}else{return _0x579e72;}})[_0xb82b('0x47')](function(_0x28dd80){logger[_0xb82b('0x51')](_0xb82b('0x52'),_0x28dd80);throw _0x28dd80;});}return _0x579e72;})['then'](respondWithResult(_0x292c0c,0xc9))[_0xb82b('0x47')](handleError(_0x292c0c,null));};exports[_0xb82b('0x26')]=function(_0x4d1284,_0x1a3321){if(_0x4d1284['body']['id']){delete _0x4d1284[_0xb82b('0x49')]['id'];}return db[_0xb82b('0x2d')]['find']({'where':{'id':_0x4d1284[_0xb82b('0x44')]['id']}})[_0xb82b('0x27')](handleEntityNotFound(_0x1a3321,null))[_0xb82b('0x27')](saveUpdates(_0x4d1284[_0xb82b('0x49')],null))[_0xb82b('0x27')](respondWithResult(_0x1a3321,null))[_0xb82b('0x47')](handleError(_0x1a3321,null));};exports[_0xb82b('0x28')]=function(_0x34fd97,_0xf9ed09){return db[_0xb82b('0x2d')][_0xb82b('0x4e')]({'where':{'id':_0x34fd97[_0xb82b('0x44')]['id']}})[_0xb82b('0x27')](handleEntityNotFound(_0xf9ed09,null))[_0xb82b('0x27')](removeEntity(_0xf9ed09,null))[_0xb82b('0x47')](handleError(_0xf9ed09,null));};exports['run']=function(_0xd62453,_0x5560ee,_0x3bc6c0){var _0x4048f5=require(_0xb82b('0x53'));return db['Schedule'][_0xb82b('0x4e')]({'where':{'id':_0xd62453[_0xb82b('0x44')]['id']},'raw':!![]})[_0xb82b('0x27')](handleEntityNotFound(_0x5560ee,null))[_0xb82b('0x27')](function(){_0x4048f5[_0xb82b('0x54')](_0xd62453[_0xb82b('0x44')]['id']);})[_0xb82b('0x27')](respondWithStatusCode(_0x5560ee,null))['catch'](handleError(_0x5560ee,null));}; \ No newline at end of file +var _0xe397=['bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Schedule','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','request-promise'];(function(_0x68b935,_0x585c62){var _0x3c2b13=function(_0x214d39){while(--_0x214d39){_0x68b935['push'](_0x68b935['shift']());}};_0x3c2b13(++_0x585c62);}(_0xe397,0xf3));var _0x7e39=function(_0x3eabbd,_0x60102f){_0x3eabbd=_0x3eabbd-0x0;var _0x16ccac=_0xe397[_0x3eabbd];return _0x16ccac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e39('0x0'));var zipdir=require(_0x7e39('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e39('0x2'));var moment=require('moment');var BPromise=require(_0x7e39('0x3'));var Mustache=require('mustache');var util=require(_0x7e39('0x4'));var path=require(_0x7e39('0x5'));var sox=require(_0x7e39('0x6'));var csv=require(_0x7e39('0x7'));var ejs=require(_0x7e39('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e39('0x9'));var squel=require(_0x7e39('0xa'));var crypto=require(_0x7e39('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e39('0x7'));var querystring=require(_0x7e39('0xc'));var Papa=require(_0x7e39('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e39('0xe'));var as=require(_0x7e39('0xf'));var hardwareService=require(_0x7e39('0x10'));var logger=require(_0x7e39('0x11'))(_0x7e39('0x12'));var utils=require(_0x7e39('0x13'));var config=require(_0x7e39('0x14'));var licenseUtil=require(_0x7e39('0x15'));var db=require(_0x7e39('0x16'))['db'];function respondWithStatusCode(_0x13cb2e,_0x3d0181){_0x3d0181=_0x3d0181||0xcc;return function(_0x3ae062){if(_0x3ae062){return _0x13cb2e[_0x7e39('0x17')](_0x3d0181);}return _0x13cb2e[_0x7e39('0x18')](_0x3d0181)[_0x7e39('0x19')]();};}function respondWithResult(_0xdfd666,_0x31190){_0x31190=_0x31190||0xc8;return function(_0x296454){if(_0x296454){return _0xdfd666[_0x7e39('0x18')](_0x31190)[_0x7e39('0x1a')](_0x296454);}};}function respondWithFilteredResult(_0x3ba20d,_0x49772a){return function(_0x5017ff){if(_0x5017ff){var _0x1816a1=typeof _0x49772a['offset']==='undefined'&&typeof _0x49772a[_0x7e39('0x1b')]===_0x7e39('0x1c');var _0x4bde3d=_0x5017ff[_0x7e39('0x1d')];var _0x2633a1=_0x1816a1?0x0:_0x49772a[_0x7e39('0x1e')];var _0x135545=_0x1816a1?_0x5017ff[_0x7e39('0x1d')]:_0x49772a['offset']+_0x49772a['limit'];var _0x1cca45;if(_0x135545>=_0x4bde3d){_0x135545=_0x4bde3d;_0x1cca45=0xc8;}else{_0x1cca45=0xce;}_0x3ba20d[_0x7e39('0x18')](_0x1cca45);return _0x3ba20d[_0x7e39('0x1f')](_0x7e39('0x20'),_0x2633a1+'-'+_0x135545+'/'+_0x4bde3d)[_0x7e39('0x1a')](_0x5017ff);}return null;};}function patchUpdates(_0x378d1b){return function(_0xe40331){try{jsonpatch['apply'](_0xe40331,_0x378d1b,!![]);}catch(_0x364619){return BPromise[_0x7e39('0x21')](_0x364619);}return _0xe40331[_0x7e39('0x22')]();};}function saveUpdates(_0xfdb241,_0x283760){return function(_0x23dd93){if(_0x23dd93){return _0x23dd93[_0x7e39('0x23')](_0xfdb241)['then'](function(_0x5d33a2){return _0x5d33a2;});}return null;};}function removeEntity(_0x31491,_0x1d1918){return function(_0xa255cf){if(_0xa255cf){return _0xa255cf['destroy']()[_0x7e39('0x24')](function(){var _0x8180c4=_0xa255cf[_0x7e39('0x25')]({'plain':!![]});var _0x132562='Scheduler';return db['UserProfileResource'][_0x7e39('0x26')]({'where':{'type':_0x132562,'resourceId':_0x8180c4['id']}})['then'](function(){return _0xa255cf;});})['then'](function(){_0x31491[_0x7e39('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d703f,_0x3123a2){return function(_0x38a24a){if(!_0x38a24a){_0x3d703f['sendStatus'](0x194);}return _0x38a24a;};}function handleError(_0x1a32ea,_0x288f74){_0x288f74=_0x288f74||0x1f4;return function(_0x18b505){logger[_0x7e39('0x27')](_0x18b505[_0x7e39('0x28')]);if(_0x18b505['name']){delete _0x18b505[_0x7e39('0x29')];}_0x1a32ea[_0x7e39('0x18')](_0x288f74)[_0x7e39('0x2a')](_0x18b505);};}exports['index']=function(_0xe0793d,_0x2d29f2){var _0x5a98e9={},_0x43c704={},_0x32982f={'count':0x0,'rows':[]};var _0x93b852=_[_0x7e39('0x2b')](db['Schedule']['rawAttributes'],function(_0x4f6f88){return{'name':_0x4f6f88[_0x7e39('0x2c')],'type':_0x4f6f88[_0x7e39('0x2d')][_0x7e39('0x2e')]};});_0x43c704[_0x7e39('0x2f')]=_[_0x7e39('0x2b')](_0x93b852,_0x7e39('0x29'));_0x43c704[_0x7e39('0x30')]=_[_0x7e39('0x31')](_0xe0793d[_0x7e39('0x30')]);_0x43c704[_0x7e39('0x32')]=_[_0x7e39('0x33')](_0x43c704[_0x7e39('0x2f')],_0x43c704[_0x7e39('0x30')]);_0x5a98e9[_0x7e39('0x34')]=_[_0x7e39('0x33')](_0x43c704[_0x7e39('0x2f')],qs[_0x7e39('0x35')](_0xe0793d['query'][_0x7e39('0x35')]));_0x5a98e9[_0x7e39('0x34')]=_0x5a98e9['attributes']['length']?_0x5a98e9[_0x7e39('0x34')]:_0x43c704[_0x7e39('0x2f')];if(!_0xe0793d[_0x7e39('0x30')][_0x7e39('0x36')]('nolimit')){_0x5a98e9[_0x7e39('0x1b')]=qs[_0x7e39('0x1b')](_0xe0793d[_0x7e39('0x30')][_0x7e39('0x1b')]);_0x5a98e9[_0x7e39('0x1e')]=qs[_0x7e39('0x1e')](_0xe0793d[_0x7e39('0x30')][_0x7e39('0x1e')]);}_0x5a98e9[_0x7e39('0x37')]=qs[_0x7e39('0x38')](_0xe0793d['query'][_0x7e39('0x38')]);_0x5a98e9[_0x7e39('0x39')]=qs['filters'](_['pick'](_0xe0793d[_0x7e39('0x30')],_0x43c704[_0x7e39('0x32')]),_0x93b852);if(_0xe0793d[_0x7e39('0x30')][_0x7e39('0x3a')]){_0x5a98e9[_0x7e39('0x39')]=_[_0x7e39('0x3b')](_0x5a98e9[_0x7e39('0x39')],{'$or':_[_0x7e39('0x2b')](_0x93b852,function(_0x4e07c2){if(_0x4e07c2[_0x7e39('0x2d')]!==_0x7e39('0x3c')){var _0x3d6dea={};_0x3d6dea[_0x4e07c2['name']]={'$like':'%'+_0xe0793d['query'][_0x7e39('0x3a')]+'%'};return _0x3d6dea;}})});}_0x5a98e9=_[_0x7e39('0x3b')]({},_0x5a98e9,_0xe0793d[_0x7e39('0x3d')]);var _0x5a3454={'where':_0x5a98e9[_0x7e39('0x39')]};return db['Schedule'][_0x7e39('0x1d')](_0x5a3454)[_0x7e39('0x24')](function(_0x3183c1){_0x32982f['count']=_0x3183c1;if(_0xe0793d[_0x7e39('0x30')][_0x7e39('0x3e')]){_0x5a98e9[_0x7e39('0x3f')]=[{'all':!![]}];}return db[_0x7e39('0x40')][_0x7e39('0x41')](_0x5a98e9);})[_0x7e39('0x24')](function(_0x426023){_0x32982f['rows']=_0x426023;return _0x32982f;})['then'](respondWithFilteredResult(_0x2d29f2,_0x5a98e9))[_0x7e39('0x42')](handleError(_0x2d29f2,null));};exports[_0x7e39('0x43')]=function(_0xc7ec62,_0x2c3343){var _0x36a312={'raw':![],'where':{'id':_0xc7ec62[_0x7e39('0x44')]['id']}},_0x5204e8={};_0x5204e8[_0x7e39('0x2f')]=_['keys'](db[_0x7e39('0x40')]['rawAttributes']);_0x5204e8['query']=_[_0x7e39('0x31')](_0xc7ec62[_0x7e39('0x30')]);_0x5204e8[_0x7e39('0x32')]=_[_0x7e39('0x33')](_0x5204e8[_0x7e39('0x2f')],_0x5204e8[_0x7e39('0x30')]);_0x36a312['attributes']=_[_0x7e39('0x33')](_0x5204e8[_0x7e39('0x2f')],qs[_0x7e39('0x35')](_0xc7ec62[_0x7e39('0x30')]['fields']));_0x36a312[_0x7e39('0x34')]=_0x36a312[_0x7e39('0x34')]['length']?_0x36a312[_0x7e39('0x34')]:_0x5204e8[_0x7e39('0x2f')];if(_0xc7ec62['query']['includeAll']){_0x36a312[_0x7e39('0x3f')]=[{'all':!![]}];}_0x36a312=_['merge']({},_0x36a312,_0xc7ec62[_0x7e39('0x3d')]);return db['Schedule'][_0x7e39('0x45')](_0x36a312)[_0x7e39('0x24')](handleEntityNotFound(_0x2c3343,null))[_0x7e39('0x24')](respondWithResult(_0x2c3343,null))[_0x7e39('0x42')](handleError(_0x2c3343,null));};exports[_0x7e39('0x46')]=function(_0x70d2f8,_0x1c77e9){return db['Schedule'][_0x7e39('0x46')](_0x70d2f8[_0x7e39('0x47')],{})['then'](function(_0x49238b){var _0x56cd16=_0x70d2f8[_0x7e39('0x48')][_0x7e39('0x25')]({'plain':!![]});if(!_0x56cd16)throw new Error(_0x7e39('0x49'));if(_0x56cd16[_0x7e39('0x4a')]===_0x7e39('0x48')){var _0x40adf5=_0x49238b['get']({'plain':!![]});var _0x582939='Scheduler';return db[_0x7e39('0x4b')][_0x7e39('0x45')]({'where':{'name':_0x582939,'userProfileId':_0x56cd16[_0x7e39('0x4c')]},'raw':!![]})[_0x7e39('0x24')](function(_0x3a59df){if(_0x3a59df&&_0x3a59df[_0x7e39('0x4d')]===0x0){return db[_0x7e39('0x4e')]['create']({'name':_0x40adf5[_0x7e39('0x29')],'resourceId':_0x40adf5['id'],'type':_0x3a59df[_0x7e39('0x29')],'sectionId':_0x3a59df['id']},{})['then'](function(){return _0x49238b;});}else{return _0x49238b;}})[_0x7e39('0x42')](function(_0x127172){logger[_0x7e39('0x27')](_0x7e39('0x4f'),_0x127172);throw _0x127172;});}return _0x49238b;})[_0x7e39('0x24')](respondWithResult(_0x1c77e9,0xc9))[_0x7e39('0x42')](handleError(_0x1c77e9,null));};exports[_0x7e39('0x23')]=function(_0x4befbe,_0x5ba008){if(_0x4befbe['body']['id']){delete _0x4befbe[_0x7e39('0x47')]['id'];}return db['Schedule'][_0x7e39('0x45')]({'where':{'id':_0x4befbe['params']['id']}})['then'](handleEntityNotFound(_0x5ba008,null))[_0x7e39('0x24')](saveUpdates(_0x4befbe['body'],null))[_0x7e39('0x24')](respondWithResult(_0x5ba008,null))[_0x7e39('0x42')](handleError(_0x5ba008,null));};exports[_0x7e39('0x26')]=function(_0x2b0641,_0x44ad1b){return db[_0x7e39('0x40')][_0x7e39('0x45')]({'where':{'id':_0x2b0641[_0x7e39('0x44')]['id']}})['then'](handleEntityNotFound(_0x44ad1b,null))[_0x7e39('0x24')](removeEntity(_0x44ad1b,null))[_0x7e39('0x42')](handleError(_0x44ad1b,null));};exports[_0x7e39('0x50')]=function(_0x5973be,_0x2a6d0e,_0x126471){var _0x1604ac=require(_0x7e39('0x51'));return db['Schedule'][_0x7e39('0x45')]({'where':{'id':_0x5973be[_0x7e39('0x44')]['id']},'raw':!![]})[_0x7e39('0x24')](handleEntityNotFound(_0x2a6d0e,null))[_0x7e39('0x24')](function(){_0x1604ac['run'](_0x5973be[_0x7e39('0x44')]['id']);})[_0x7e39('0x24')](respondWithStatusCode(_0x2a6d0e,null))[_0x7e39('0x42')](handleError(_0x2a6d0e,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2375f8f..cb04518 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 _0x8c89=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xd958e0,_0x54deea){var _0x7e2a6=function(_0x429692){while(--_0x429692){_0xd958e0['push'](_0xd958e0['shift']());}};_0x7e2a6(++_0x54deea);}(_0x8c89,0x1ab));var _0x98c8=function(_0x433cfe,_0x47ce1e){_0x433cfe=_0x433cfe-0x0;var _0x1843a8=_0x8c89[_0x433cfe];return _0x1843a8;};'use strict';var _=require(_0x98c8('0x0'));var util=require('util');var logger=require(_0x98c8('0x1'))(_0x98c8('0x2'));var moment=require('moment');var BPromise=require(_0x98c8('0x3'));var rp=require(_0x98c8('0x4'));var fs=require('fs');var path=require(_0x98c8('0x5'));var rimraf=require(_0x98c8('0x6'));var config=require(_0x98c8('0x7'));var attributes=require(_0x98c8('0x8'));module[_0x98c8('0x9')]=function(_0x44dc70,_0x48beb8){return _0x44dc70[_0x98c8('0xa')]('Schedule',attributes,{'tableName':_0x98c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9935=['../../config/environment','exports','define','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x47edc4,_0x550a5d){var _0x159758=function(_0x993c8a){while(--_0x993c8a){_0x47edc4['push'](_0x47edc4['shift']());}};_0x159758(++_0x550a5d);}(_0x9935,0x1cf));var _0x5993=function(_0x5c4620,_0x51e5c0){_0x5c4620=_0x5c4620-0x0;var _0x52722b=_0x9935[_0x5c4620];return _0x52722b;};'use strict';var _=require(_0x5993('0x0'));var util=require(_0x5993('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5993('0x2'));var BPromise=require(_0x5993('0x3'));var rp=require(_0x5993('0x4'));var fs=require('fs');var path=require(_0x5993('0x5'));var rimraf=require(_0x5993('0x6'));var config=require(_0x5993('0x7'));var attributes=require('./schedule.attributes');module[_0x5993('0x8')]=function(_0x5d6c9b,_0x57bd56){return _0x5d6c9b[_0x5993('0x9')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index af00e7f..a3f8fe2 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 _0x444a=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3171a1,_0x236b7c){var _0x40b9c2=function(_0xe51901){while(--_0xe51901){_0x3171a1['push'](_0x3171a1['shift']());}};_0x40b9c2(++_0x236b7c);}(_0x444a,0xf4));var _0xa444=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x444a[_0x5575cd];return _0x4979a0;};'use strict';var _=require('lodash');var util=require(_0xa444('0x0'));var moment=require(_0xa444('0x1'));var BPromise=require(_0xa444('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa444('0x3'));var db=require(_0xa444('0x4'))['db'];var utils=require(_0xa444('0x5'));var logger=require('../../config/logger')(_0xa444('0x6'));var config=require(_0xa444('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa444('0x8')][_0xa444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7c1d1b,_0x182892,_0x264043){return new BPromise(function(_0xb5e30b,_0x4980d2){return client[_0xa444('0xa')](_0x7c1d1b,_0x264043)[_0xa444('0xb')](function(_0x9d42e8){logger[_0xa444('0xc')](_0xa444('0xd'),_0x182892,_0xa444('0xe'));logger[_0xa444('0xf')](_0xa444('0x10'),_0x182892,'request\x20sent',JSON[_0xa444('0x11')](_0x9d42e8));if(_0x9d42e8['error']){if(_0x9d42e8['error']['code']===0x1f4){logger['error'](_0xa444('0xd'),_0x182892,_0x9d42e8[_0xa444('0x12')]['message']);return _0x4980d2(_0x9d42e8[_0xa444('0x12')][_0xa444('0x13')]);}logger[_0xa444('0x12')]('Schedule,\x20%s,\x20%s',_0x182892,_0x9d42e8['error']['message']);return _0xb5e30b(_0x9d42e8[_0xa444('0x12')][_0xa444('0x13')]);}else{logger[_0xa444('0xc')](_0xa444('0xd'),_0x182892,'request\x20sent');_0xb5e30b(_0x9d42e8['result'][_0xa444('0x13')]);}})['catch'](function(_0x1aa8aa){logger['error']('Schedule,\x20%s,\x20%s',_0x182892,_0x1aa8aa);_0x4980d2(_0x1aa8aa);});});} \ No newline at end of file +var _0xfc73=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error'];(function(_0x3893ad,_0x3b3a57){var _0x411ac2=function(_0x2dcea6){while(--_0x2dcea6){_0x3893ad['push'](_0x3893ad['shift']());}};_0x411ac2(++_0x3b3a57);}(_0xfc73,0x145));var _0x3fc7=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xfc73[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0x3fc7('0x0'));var moment=require('moment');var BPromise=require(_0x3fc7('0x1'));var rs=require(_0x3fc7('0x2'));var fs=require('fs');var Redis=require(_0x3fc7('0x3'));var db=require(_0x3fc7('0x4'))['db'];var utils=require(_0x3fc7('0x5'));var logger=require(_0x3fc7('0x6'))(_0x3fc7('0x7'));var config=require('../../config/environment');var jayson=require(_0x3fc7('0x8'));var client=jayson[_0x3fc7('0x9')][_0x3fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94ddb6,_0x55055f,_0x3a8690){return new BPromise(function(_0x912d96,_0x32f636){return client['request'](_0x94ddb6,_0x3a8690)['then'](function(_0x121a7d){logger[_0x3fc7('0xb')](_0x3fc7('0xc'),_0x55055f,_0x3fc7('0xd'));logger[_0x3fc7('0xe')](_0x3fc7('0xf'),_0x55055f,'request\x20sent',JSON['stringify'](_0x121a7d));if(_0x121a7d[_0x3fc7('0x10')]){if(_0x121a7d['error']['code']===0x1f4){logger[_0x3fc7('0x10')](_0x3fc7('0xc'),_0x55055f,_0x121a7d['error'][_0x3fc7('0x11')]);return _0x32f636(_0x121a7d['error'][_0x3fc7('0x11')]);}logger[_0x3fc7('0x10')](_0x3fc7('0xc'),_0x55055f,_0x121a7d[_0x3fc7('0x10')][_0x3fc7('0x11')]);return _0x912d96(_0x121a7d['error'][_0x3fc7('0x11')]);}else{logger[_0x3fc7('0xb')](_0x3fc7('0xc'),_0x55055f,'request\x20sent');_0x912d96(_0x121a7d['result'][_0x3fc7('0x11')]);}})[_0x3fc7('0x12')](function(_0x3e8d2a){logger[_0x3fc7('0x10')]('Schedule,\x20%s,\x20%s',_0x55055f,_0x3e8d2a);_0x32f636(_0x3e8d2a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b371fcd..00ab644 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 _0x6cf4=['download','post','create','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x44c801,_0x5ad314){var _0x3f3468=function(_0x33ea2f){while(--_0x33ea2f){_0x44c801['push'](_0x44c801['shift']());}};_0x3f3468(++_0x5ad314);}(_0x6cf4,0x182));var _0x46cf=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0x6cf4[_0x594ece];return _0x471bc4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x46cf('0x0'));var timeout=require(_0x46cf('0x1'));var express=require('express');var router=express[_0x46cf('0x2')]();var fs_extra=require(_0x46cf('0x3'));var auth=require(_0x46cf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x46cf('0x5'));var controller=require('./screenRecording.controller');router[_0x46cf('0x6')]('/',auth[_0x46cf('0x7')](),controller[_0x46cf('0x8')]);router[_0x46cf('0x6')](_0x46cf('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x46cf('0xa'),auth[_0x46cf('0x7')](),controller[_0x46cf('0xb')]);router[_0x46cf('0x6')](_0x46cf('0xc'),auth['isAuthenticated'](),controller[_0x46cf('0xd')]);router[_0x46cf('0xe')]('/',auth[_0x46cf('0x7')](),controller[_0x46cf('0xf')]);router['put'](_0x46cf('0xa'),auth[_0x46cf('0x7')](),controller[_0x46cf('0x10')]);router[_0x46cf('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x46cf('0x12')]=router; \ No newline at end of file +var _0xaeed=['update','delete','/:id','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x341843,_0x260de0){var _0x15d702=function(_0x2d53d8){while(--_0x2d53d8){_0x341843['push'](_0x341843['shift']());}};_0x15d702(++_0x260de0);}(_0xaeed,0x108));var _0xdaee=function(_0x5f3983,_0x432047){_0x5f3983=_0x5f3983-0x0;var _0x554957=_0xaeed[_0x5f3983];return _0x554957;};'use strict';var multer=require(_0xdaee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdaee('0x1'));var router=express[_0xdaee('0x2')]();var fs_extra=require(_0xdaee('0x3'));var auth=require(_0xdaee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdaee('0x5'));var controller=require(_0xdaee('0x6'));router[_0xdaee('0x7')]('/',auth[_0xdaee('0x8')](),controller[_0xdaee('0x9')]);router[_0xdaee('0x7')](_0xdaee('0xa'),auth['isAuthenticated'](),controller[_0xdaee('0xb')]);router[_0xdaee('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdaee('0xc')]);router['get']('/:id/download',auth[_0xdaee('0x8')](),controller['download']);router[_0xdaee('0xd')]('/',auth['isAuthenticated'](),controller[_0xdaee('0xe')]);router[_0xdaee('0xf')]('/:id',auth[_0xdaee('0x8')](),controller[_0xdaee('0x10')]);router[_0xdaee('0x11')](_0xdaee('0x12'),auth[_0xdaee('0x8')](),controller[_0xdaee('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index d89eebd..b76ef57 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 _0x9f0e=['STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue'];(function(_0x486559,_0x3ddc65){var _0x538efb=function(_0x4920aa){while(--_0x4920aa){_0x486559['push'](_0x486559['shift']());}};_0x538efb(++_0x3ddc65);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1c0c61,_0x1cdfa5){_0x1c0c61=_0x1c0c61-0x0;var _0xcbb730=_0x9f0e[_0x1c0c61];return _0xcbb730;};'use strict';var Sequelize=require(_0xe9f0('0x0'));var moment=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var config=require(_0xe9f0('0x3'));module[_0xe9f0('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xe9f0('0x5'))?path[_0xe9f0('0x6')](this[_0xe9f0('0x7')](_0xe9f0('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xe9f0('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x3a17b3){var _0x167198=_0x3a17b3[_0xe9f0('0x9')](/\\/g,'/');this['setDataValue'](_0xe9f0('0x5'),_0x167198);}},'rating':{'type':Sequelize[_0xe9f0('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe9f0('0xa')],'set':function(_0x3386a8){this[_0xe9f0('0xb')](_0xe9f0('0xc'),moment()[_0xe9f0('0xd')](_0x3386a8,'ms'));this[_0xe9f0('0xb')](_0xe9f0('0xe'),moment());this['setDataValue'](_0xe9f0('0xf'),_0x3386a8);}},'startedAt':{'type':Sequelize[_0xe9f0('0x10')],'get':function(){return moment(this[_0xe9f0('0x7')]('startedAt'))[_0xe9f0('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xe9f0('0x12')]();}},'closedAt':{'type':Sequelize[_0xe9f0('0x10')],'get':function(){return moment(this[_0xe9f0('0x7')](_0xe9f0('0xe')))['format'](_0xe9f0('0x13'))['toString']();}},'createdAt':{'type':Sequelize[_0xe9f0('0x10')],'get':function(){return moment(this[_0xe9f0('0x7')](_0xe9f0('0x14')))['format'](_0xe9f0('0x13'))[_0xe9f0('0x12')]();}},'updatedAt':{'type':Sequelize[_0xe9f0('0x10')],'get':function(){return moment(this['getDataValue'](_0xe9f0('0x15')))[_0xe9f0('0x11')](_0xe9f0('0x13'))[_0xe9f0('0x12')]();}}}; \ No newline at end of file +var _0x543b=['path','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x543b,0x18d));var _0xb543=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x543b[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xb543('0x0'));var moment=require(_0xb543('0x1'));var path=require(_0xb543('0x2'));var config=require('../../config/environment');module[_0xb543('0x3')]={'format':{'type':Sequelize[_0xb543('0x4')],'get':function(){return this[_0xb543('0x5')]('value')?path[_0xb543('0x6')](this[_0xb543('0x5')](_0xb543('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xb543('0x8')]},'channel':{'type':Sequelize[_0xb543('0x8')]},'value':{'type':Sequelize[_0xb543('0x8')],'set':function(_0x208c95){var _0x338142=_0x208c95[_0xb543('0x9')](/\\/g,'/');this[_0xb543('0xa')](_0xb543('0x7'),_0x338142);}},'rating':{'type':Sequelize[_0xb543('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xa94776){this['setDataValue'](_0xb543('0xc'),moment()[_0xb543('0xd')](_0xa94776,'ms'));this[_0xb543('0xa')](_0xb543('0xe'),moment());this[_0xb543('0xa')](_0xb543('0xf'),_0xa94776);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb543('0x5')](_0xb543('0xc')))[_0xb543('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xb543('0x11')]();}},'closedAt':{'type':Sequelize[_0xb543('0x12')],'get':function(){return moment(this[_0xb543('0x5')]('closedAt'))['format'](_0xb543('0x13'))[_0xb543('0x11')]();}},'createdAt':{'type':Sequelize[_0xb543('0x12')],'get':function(){return moment(this[_0xb543('0x5')]('createdAt'))[_0xb543('0x10')](_0xb543('0x13'))[_0xb543('0x11')]();}},'updatedAt':{'type':Sequelize[_0xb543('0x12')],'get':function(){return moment(this['getDataValue'](_0xb543('0x14')))['format'](_0xb543('0x13'))[_0xb543('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 7bb3b6a..5115c47 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x207c=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb'];(function(_0x4e39ad,_0x5bbc98){var _0x517260=function(_0x59253c){while(--_0x59253c){_0x4e39ad['push'](_0x4e39ad['shift']());}};_0x517260(++_0x5bbc98);}(_0x207c,0x1e8));var _0xc207=function(_0x48c1bf,_0x2e76bf){_0x48c1bf=_0x48c1bf-0x0;var _0x3172b7=_0x207c[_0x48c1bf];return _0x3172b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc207('0x0'));var zipdir=require(_0xc207('0x1'));var jsonpatch=require(_0xc207('0x2'));var rp=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require(_0xc207('0x5'));var Mustache=require(_0xc207('0x6'));var util=require('util');var path=require(_0xc207('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc207('0x8'));var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var authService=require(_0xc207('0x10'));var qs=require(_0xc207('0x11'));var as=require(_0xc207('0x12'));var hardwareService=require(_0xc207('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc207('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc207('0x15'))['db'];function respondWithStatusCode(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xcc;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0x16')](_0x59d401);}return _0x2782ce[_0xc207('0x17')](_0x59d401)[_0xc207('0x18')]();};}function respondWithResult(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0xc8;return function(_0xc62672){if(_0xc62672){return _0xe993a0[_0xc207('0x17')](_0x51e967)[_0xc207('0x19')](_0xc62672);}};}function respondWithFilteredResult(_0x4031ad,_0x4ef6c4){return function(_0x564cef){if(_0x564cef){var _0x554e5c=typeof _0x4ef6c4[_0xc207('0x1a')]===_0xc207('0x1b')&&typeof _0x4ef6c4[_0xc207('0x1c')]===_0xc207('0x1b');var _0x4b8f44=_0x564cef[_0xc207('0x1d')];var _0x282595=_0x554e5c?0x0:_0x4ef6c4[_0xc207('0x1a')];var _0x5f288e=_0x554e5c?_0x564cef[_0xc207('0x1d')]:_0x4ef6c4['offset']+_0x4ef6c4[_0xc207('0x1c')];var _0x33ddb1;if(_0x5f288e>=_0x4b8f44){_0x5f288e=_0x4b8f44;_0x33ddb1=0xc8;}else{_0x33ddb1=0xce;}_0x4031ad[_0xc207('0x17')](_0x33ddb1);return _0x4031ad[_0xc207('0x1e')](_0xc207('0x1f'),_0x282595+'-'+_0x5f288e+'/'+_0x4b8f44)[_0xc207('0x19')](_0x564cef);}return null;};}function patchUpdates(_0x35c0b0){return function(_0x464dea){try{jsonpatch[_0xc207('0x20')](_0x464dea,_0x35c0b0,!![]);}catch(_0x2bd2eb){return BPromise[_0xc207('0x21')](_0x2bd2eb);}return _0x464dea[_0xc207('0x22')]();};}function saveUpdates(_0x40de25,_0x4b52a7){return function(_0x163b36){if(_0x163b36){return _0x163b36['update'](_0x40de25)[_0xc207('0x23')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x1eabe8,_0x83253f){return function(_0x3539f4){if(_0x3539f4){return _0x3539f4[_0xc207('0x24')]()[_0xc207('0x23')](function(){_0x1eabe8[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();});}};}function handleEntityNotFound(_0x2385f7,_0x25c91e){return function(_0x27df03){if(!_0x27df03){_0x2385f7[_0xc207('0x16')](0x194);}return _0x27df03;};}function handleError(_0x138970,_0x1445d3){_0x1445d3=_0x1445d3||0x1f4;return function(_0x56a066){logger[_0xc207('0x25')](_0x56a066['stack']);if(_0x56a066['name']){delete _0x56a066[_0xc207('0x26')];}_0x138970[_0xc207('0x17')](_0x1445d3)[_0xc207('0x27')](_0x56a066);};}exports[_0xc207('0x28')]=function(_0x6a653d,_0x478af7){var _0xe5e848={},_0x463ac8={},_0x6223ef={'count':0x0,'rows':[]};var _0x1bec3f=_[_0xc207('0x29')](db[_0xc207('0x2a')][_0xc207('0x2b')],function(_0x27bc72){return{'name':_0x27bc72[_0xc207('0x2c')],'type':_0x27bc72[_0xc207('0x2d')][_0xc207('0x2e')]};});_0x463ac8[_0xc207('0x2f')]=_[_0xc207('0x30')](_['map'](_0x1bec3f,_0xc207('0x26')),[_0xc207('0x31')]);_0x463ac8[_0xc207('0x32')]=_[_0xc207('0x33')](_0x6a653d[_0xc207('0x32')]);_0x463ac8[_0xc207('0x34')]=_['intersection'](_0x463ac8[_0xc207('0x2f')],_0x463ac8[_0xc207('0x32')]);_0xe5e848[_0xc207('0x35')]=_[_0xc207('0x36')](_0x463ac8['model'],qs[_0xc207('0x37')](_0x6a653d[_0xc207('0x32')][_0xc207('0x37')]));_0xe5e848[_0xc207('0x35')]=_0xe5e848[_0xc207('0x35')][_0xc207('0x38')]?_0xe5e848[_0xc207('0x35')]:_0x463ac8[_0xc207('0x2f')];if(!_0x6a653d[_0xc207('0x32')]['hasOwnProperty']('nolimit')){_0xe5e848[_0xc207('0x1c')]=qs[_0xc207('0x1c')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1c')]);_0xe5e848['offset']=qs[_0xc207('0x1a')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1a')]);}_0xe5e848[_0xc207('0x39')]=qs[_0xc207('0x3a')](_0x6a653d['query'][_0xc207('0x3a')]);_0xe5e848[_0xc207('0x3b')]=qs['filters'](_[_0xc207('0x3c')](_0x6a653d['query'],_0x463ac8[_0xc207('0x34')]),_0x1bec3f);if(_0x6a653d[_0xc207('0x32')]['filter']){_0xe5e848[_0xc207('0x3b')]=_[_0xc207('0x3d')](_0xe5e848[_0xc207('0x3b')],{'$or':_['map'](_0x1bec3f,function(_0x5b3041){if(_0x5b3041[_0xc207('0x2d')]!==_0xc207('0x3e')){var _0x41d66c={};_0x41d66c[_0x5b3041[_0xc207('0x26')]]={'$like':'%'+_0x6a653d['query'][_0xc207('0x3f')]+'%'};return _0x41d66c;}})});}_0xe5e848=_['merge']({},_0xe5e848,_0x6a653d['options']);var _0x4c10ed={'where':_0xe5e848['where']};return db[_0xc207('0x2a')][_0xc207('0x1d')](_0x4c10ed)[_0xc207('0x23')](function(_0x487f98){_0x6223ef[_0xc207('0x1d')]=_0x487f98;if(_0x6a653d[_0xc207('0x32')][_0xc207('0x40')]){_0xe5e848[_0xc207('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc207('0x42')](_0xe5e848);})[_0xc207('0x23')](function(_0x123a46){_0x6223ef[_0xc207('0x43')]=_0x123a46;return _0x6223ef;})[_0xc207('0x23')](respondWithFilteredResult(_0x478af7,_0xe5e848))['catch'](handleError(_0x478af7,null));};exports[_0xc207('0x44')]=function(_0x19a67d,_0x3a935a){var _0x471a85={'raw':![],'where':{'id':_0x19a67d[_0xc207('0x45')]['id']}},_0x153490={};_0x153490[_0xc207('0x2f')]=_[_0xc207('0x33')](db[_0xc207('0x2a')]['rawAttributes']);_0x153490[_0xc207('0x32')]=_[_0xc207('0x33')](_0x19a67d['query']);_0x153490[_0xc207('0x34')]=_[_0xc207('0x36')](_0x153490[_0xc207('0x2f')],_0x153490[_0xc207('0x32')]);_0x471a85[_0xc207('0x35')]=_['intersection'](_0x153490[_0xc207('0x2f')],qs[_0xc207('0x37')](_0x19a67d[_0xc207('0x32')]['fields']));_0x471a85[_0xc207('0x35')]=_0x471a85[_0xc207('0x35')][_0xc207('0x38')]?_0x471a85[_0xc207('0x35')]:_0x153490['model'];if(_0x19a67d['query'][_0xc207('0x40')]){_0x471a85[_0xc207('0x41')]=[{'all':!![]}];}_0x471a85=_[_0xc207('0x3d')]({},_0x471a85,_0x19a67d[_0xc207('0x46')]);return db[_0xc207('0x2a')][_0xc207('0x47')](_0x471a85)[_0xc207('0x23')](handleEntityNotFound(_0x3a935a,null))[_0xc207('0x23')](respondWithResult(_0x3a935a,null))[_0xc207('0x48')](handleError(_0x3a935a,null));};exports[_0xc207('0x49')]=function(_0x2afcd1,_0x2fda4f){return db['ScreenRecording']['create'](_0x2afcd1[_0xc207('0x4a')],{})[_0xc207('0x23')](respondWithResult(_0x2fda4f,0xc9))[_0xc207('0x48')](handleError(_0x2fda4f,null));};exports['update']=function(_0x2b89e0,_0x3f712d){if(_0x2b89e0[_0xc207('0x4a')]['id']){delete _0x2b89e0[_0xc207('0x4a')]['id'];}delete _0x2b89e0['body'][_0xc207('0x4b')];delete _0x2b89e0['body'][_0xc207('0x4c')];delete _0x2b89e0['body']['closedAt'];delete _0x2b89e0[_0xc207('0x4a')][_0xc207('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x2b89e0['params']['id']}})[_0xc207('0x23')](handleEntityNotFound(_0x3f712d,null))[_0xc207('0x23')](saveUpdates(_0x2b89e0[_0xc207('0x4a')],null))[_0xc207('0x23')](respondWithResult(_0x3f712d,null))[_0xc207('0x48')](handleError(_0x3f712d,null));};exports[_0xc207('0x4e')]=function(_0x3dc457,_0x1dfdee){return db['ScreenRecording'][_0xc207('0x4e')]()[_0xc207('0x23')](respondWithResult(_0x1dfdee,null))['catch'](handleError(_0x1dfdee,null));};exports['download']=function(_0x362001,_0x47c630,_0x49a78b){var _0x2634d6=require(_0xc207('0x4f'));var _0x356c8c=![];var _0x3b2448={};if(_0x362001[_0xc207('0x32')][_0xc207('0x2d')]&&_0x362001[_0xc207('0x32')][_0xc207('0x2d')]===_0xc207('0x50')){_0x3b2448[_0xc207('0x50')]=_0x362001[_0xc207('0x45')]['id'];}else{_0x3b2448['id']=_0x362001['params']['id'];}return db['ScreenRecording'][_0xc207('0x47')]({'where':_0x3b2448,'attributes':['id',_0xc207('0x4d')],'raw':!![]})[_0xc207('0x23')](handleEntityNotFound(_0x47c630,null))[_0xc207('0x23')](function(_0xaff7a0){if(_0xaff7a0){var _0x21c12b=path[_0xc207('0x51')](config[_0xc207('0x52')],_0xc207('0x53'),_0xaff7a0['value']);var _0x1cc4e3=util[_0xc207('0x31')](_0xc207('0x54'),_0x21c12b);if(fs[_0xc207('0x55')](_0x1cc4e3)){_0x356c8c=!![];return _0x2634d6['decryptFile'](_0x1cc4e3,_0x21c12b,config[_0xc207('0x56')][_0xc207('0x57')])[_0xc207('0x23')](function(){return _0xaff7a0;});}return _0xaff7a0;}})[_0xc207('0x23')](function(_0x464263){if(_0x464263){var _0x45ad58=path[_0xc207('0x51')](config['root'],_0xc207('0x53'),_0x464263[_0xc207('0x4d')]);if(!fs[_0xc207('0x55')](_0x45ad58)){throw new db[(_0xc207('0x58'))]['ValidationError'](_0xc207('0x59'));}if(_0x464263['filename']){return _0x47c630['download'](_0x45ad58,_0x464263[_0xc207('0x5a')]+path[_0xc207('0x5b')](_0x45ad58),function(){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}else{return _0x47c630[_0xc207('0x5d')](_0x45ad58,function(_0x441d5f){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}}})[_0xc207('0x48')](function(_0x33c372){if(_0x33c372[_0xc207('0x5e')]===_0xc207('0x59')){_0x47c630[_0xc207('0x17')](0x194)[_0xc207('0x27')](_0xc207('0x5f'));}else{return handleError(_0x47c630,null);}});};exports[_0xc207('0x24')]=function(_0x282ae5,_0x501bca){return db[_0xc207('0x2a')]['find']({'where':{'id':_0x282ae5[_0xc207('0x45')]['id']}})[_0xc207('0x23')](function(_0x2ade23){if(_['isNil'](_0x2ade23)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2ade23;})[_0xc207('0x23')](function(_0x3ac0dd){var _0x2f18a2=path['join'](config[_0xc207('0x52')],_0xc207('0x53'),_0x3ac0dd[_0xc207('0x4d')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2f18a2);if(!_[_0xc207('0x60')](_0x3ac0dd['value'])&&fs[_0xc207('0x55')](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}_0x2f18a2=_0x2f18a2+_0xc207('0x65');if(!_[_0xc207('0x60')](_0x3ac0dd[_0xc207('0x4d')])&&fs['existsSync'](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}return _0x3ac0dd;})[_0xc207('0x23')](function(_0x14050a){if(!_0x14050a)throw new InternalError();return _0x14050a[_0xc207('0x24')]();})[_0xc207('0x23')](function(){_0x501bca[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();})[_0xc207('0x48')](handleError(_0x501bca,null));}; \ No newline at end of file +var _0xdc97=['join','root','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','ScreenRecording','includeAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid'];(function(_0x304412,_0x5c775c){var _0x3a52fa=function(_0xae402c){while(--_0xae402c){_0x304412['push'](_0x304412['shift']());}};_0x3a52fa(++_0x5c775c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x45644e,_0x47c18d){_0x45644e=_0x45644e-0x0;var _0x3ecd7f=_0xdc97[_0x45644e];return _0x3ecd7f;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['ScreenRecording']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['differenceBy'](_[_0x7dc9('0x27')](_0x14083d,_0x7dc9('0x24')),[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x450124[_0x7dc9('0x29')]);_0x1fcf0e['filters']=_['intersection'](_0x1fcf0e['model'],_0x1fcf0e[_0x7dc9('0x29')]);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e[_0x7dc9('0x2c')],qs[_0x7dc9('0x2d')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x229f8e[_0x7dc9('0x2e')]=_0x229f8e[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x229f8e['attributes']:_0x1fcf0e[_0x7dc9('0x2c')];if(!_0x450124['query'][_0x7dc9('0x30')](_0x7dc9('0x31'))){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124['query'][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query']['offset']);}_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x33')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x33')]);_0x229f8e['where']=qs[_0x7dc9('0x34')](_[_0x7dc9('0x35')](_0x450124[_0x7dc9('0x29')],_0x1fcf0e[_0x7dc9('0x34')]),_0x14083d);if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]){_0x229f8e[_0x7dc9('0x37')]=_[_0x7dc9('0x38')](_0x229f8e[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x452aed){if(_0x452aed[_0x7dc9('0x39')]!=='VIRTUAL'){var _0x34b5c9={};_0x34b5c9[_0x452aed[_0x7dc9('0x24')]]={'$like':'%'+_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]+'%'};return _0x34b5c9;}})});}_0x229f8e=_['merge']({},_0x229f8e,_0x450124[_0x7dc9('0x3a')]);var _0x89db0e={'where':_0x229f8e[_0x7dc9('0x37')]};return db[_0x7dc9('0x3b')][_0x7dc9('0x1b')](_0x89db0e)[_0x7dc9('0x21')](function(_0x5a1201){_0x3c4379['count']=_0x5a1201;if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x3c')]){_0x229f8e['include']=[{'all':!![]}];}return db[_0x7dc9('0x3b')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x2a91fe){_0x3c4379[_0x7dc9('0x3d')]=_0x2a91fe;return _0x3c4379;})['then'](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3e')](handleError(_0x236d42,null));};exports[_0x7dc9('0x3f')]=function(_0x1929b6,_0x95513c){var _0x28ffc0={'raw':![],'where':{'id':_0x1929b6[_0x7dc9('0x40')]['id']}},_0x23499a={};_0x23499a['model']=_[_0x7dc9('0x2a')](db['ScreenRecording']['rawAttributes']);_0x23499a[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x1929b6[_0x7dc9('0x29')]);_0x23499a[_0x7dc9('0x34')]=_[_0x7dc9('0x2b')](_0x23499a[_0x7dc9('0x2c')],_0x23499a[_0x7dc9('0x29')]);_0x28ffc0[_0x7dc9('0x2e')]=_[_0x7dc9('0x2b')](_0x23499a['model'],qs[_0x7dc9('0x2d')](_0x1929b6[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x28ffc0[_0x7dc9('0x2e')]=_0x28ffc0[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x28ffc0['attributes']:_0x23499a[_0x7dc9('0x2c')];if(_0x1929b6[_0x7dc9('0x29')]['includeAll']){_0x28ffc0[_0x7dc9('0x41')]=[{'all':!![]}];}_0x28ffc0=_[_0x7dc9('0x38')]({},_0x28ffc0,_0x1929b6[_0x7dc9('0x3a')]);return db['ScreenRecording'][_0x7dc9('0x42')](_0x28ffc0)['then'](handleEntityNotFound(_0x95513c,null))['then'](respondWithResult(_0x95513c,null))[_0x7dc9('0x3e')](handleError(_0x95513c,null));};exports[_0x7dc9('0x43')]=function(_0x36d591,_0x5e0dc5){return db['ScreenRecording'][_0x7dc9('0x43')](_0x36d591['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5e0dc5,0xc9))[_0x7dc9('0x3e')](handleError(_0x5e0dc5,null));};exports['update']=function(_0x24ccce,_0x1d6c0a){if(_0x24ccce[_0x7dc9('0x44')]['id']){delete _0x24ccce[_0x7dc9('0x44')]['id'];}delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x45')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x46')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x47')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x48')];return db[_0x7dc9('0x3b')]['find']({'where':{'id':_0x24ccce[_0x7dc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d6c0a,null))['then'](saveUpdates(_0x24ccce[_0x7dc9('0x44')],null))[_0x7dc9('0x21')](respondWithResult(_0x1d6c0a,null))[_0x7dc9('0x3e')](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x49')]=function(_0x346d27,_0x510e2a){return db[_0x7dc9('0x3b')][_0x7dc9('0x49')]()[_0x7dc9('0x21')](respondWithResult(_0x510e2a,null))['catch'](handleError(_0x510e2a,null));};exports[_0x7dc9('0x4a')]=function(_0x3fc164,_0x2cf133,_0x32bc31){var _0xf41b8c=require(_0x7dc9('0x4b'));var _0x593132=![];var _0x366b8b={};if(_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]&&_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]===_0x7dc9('0x4c')){_0x366b8b[_0x7dc9('0x4c')]=_0x3fc164[_0x7dc9('0x40')]['id'];}else{_0x366b8b['id']=_0x3fc164[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':_0x366b8b,'attributes':['id',_0x7dc9('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x2cf133,null))[_0x7dc9('0x21')](function(_0x39be46){if(_0x39be46){var _0x38df9a=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x39be46[_0x7dc9('0x48')]);var _0xd8d327=util[_0x7dc9('0x28')](_0x7dc9('0x4f'),_0x38df9a);if(fs[_0x7dc9('0x50')](_0xd8d327)){_0x593132=!![];return _0xf41b8c[_0x7dc9('0x51')](_0xd8d327,_0x38df9a,config['secrets']['recording'])['then'](function(){return _0x39be46;});}return _0x39be46;}})[_0x7dc9('0x21')](function(_0x3daf33){if(_0x3daf33){var _0x32a64f=path[_0x7dc9('0x4d')](config['root'],'server/files/screen_recordings',_0x3daf33[_0x7dc9('0x48')]);if(!fs[_0x7dc9('0x50')](_0x32a64f)){throw new db[(_0x7dc9('0x52'))][(_0x7dc9('0x53'))](_0x7dc9('0x54'));}if(_0x3daf33[_0x7dc9('0x55')]){return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,_0x3daf33['filename']+path[_0x7dc9('0x56')](_0x32a64f),function(){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}else{return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,function(_0x1dad95){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}}})['catch'](function(_0x175858){if(_0x175858[_0x7dc9('0x58')]===_0x7dc9('0x54')){_0x2cf133[_0x7dc9('0x16')](0x194)[_0x7dc9('0x25')](_0x7dc9('0x59'));}else{return handleError(_0x2cf133,null);}});};exports[_0x7dc9('0x5a')]=function(_0x2a02ed,_0x3463e4){return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':{'id':_0x2a02ed[_0x7dc9('0x40')]['id']}})[_0x7dc9('0x21')](function(_0x5eee27){if(_[_0x7dc9('0x5b')](_0x5eee27)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5eee27;})[_0x7dc9('0x21')](function(_0x15cf19){var _0x48ea37=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x15cf19[_0x7dc9('0x48')]);logger[_0x7dc9('0x5c')](_0x7dc9('0x5d'),_0x48ea37);if(!_['isNil'](_0x15cf19['value'])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger[_0x7dc9('0x5c')](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}_0x48ea37=_0x48ea37+_0x7dc9('0x61');if(!_[_0x7dc9('0x5b')](_0x15cf19[_0x7dc9('0x48')])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger['info'](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}return _0x15cf19;})['then'](function(_0x4f80bd){if(!_0x4f80bd)throw new InternalError();return _0x4f80bd[_0x7dc9('0x5a')]();})[_0x7dc9('0x21')](function(){_0x3463e4[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();})['catch'](handleError(_0x3463e4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ef660da..3fda180 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 _0xbb4b=['request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','api','bluebird'];(function(_0x5105e8,_0x44a2e0){var _0x53bbf5=function(_0x29dfb8){while(--_0x29dfb8){_0x5105e8['push'](_0x5105e8['shift']());}};_0x53bbf5(++_0x44a2e0);}(_0xbb4b,0xc4));var _0xbbb4=function(_0x2972ec,_0x1a22f7){_0x2972ec=_0x2972ec-0x0;var _0x353efd=_0xbb4b[_0x2972ec];return _0x353efd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbbb4('0x0'));var moment=require('moment');var BPromise=require(_0xbbb4('0x1'));var rp=require(_0xbbb4('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbb4('0x3'));var config=require(_0xbbb4('0x4'));var attributes=require(_0xbbb4('0x5'));module[_0xbbb4('0x6')]=function(_0x1675a4,_0x157584){return _0x1675a4['define']('ScreenRecording',attributes,{'tableName':_0xbbb4('0x7'),'paranoid':![],'indexes':[{'name':_0xbbb4('0x8'),'fields':[_0xbbb4('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bc4=['./screenRecording.attributes','exports','ScreenRecording','interactionid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bb9d9,_0xe64235){var _0x4ca040=function(_0x592c59){while(--_0x592c59){_0x3bb9d9['push'](_0x3bb9d9['shift']());}};_0x4ca040(++_0xe64235);}(_0x6bc4,0xa9));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x46bc('0x0'));var moment=require(_0x46bc('0x1'));var BPromise=require(_0x46bc('0x2'));var rp=require(_0x46bc('0x3'));var fs=require('fs');var path=require(_0x46bc('0x4'));var rimraf=require(_0x46bc('0x5'));var config=require(_0x46bc('0x6'));var attributes=require(_0x46bc('0x7'));module[_0x46bc('0x8')]=function(_0xec0413,_0x383834){return _0xec0413['define'](_0x46bc('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x46bc('0xa'),'fields':[_0x46bc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 85e8513..cff07f5 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 _0xf068=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x261305,_0x2efc00){var _0x5808b1=function(_0x5d070b){while(--_0x5d070b){_0x261305['push'](_0x261305['shift']());}};_0x5808b1(++_0x2efc00);}(_0xf068,0xd6));var _0x8f06=function(_0x256973,_0x38d186){_0x256973=_0x256973-0x0;var _0x5bdf0a=_0xf068[_0x256973];return _0x5bdf0a;};'use strict';var _=require(_0x8f06('0x0'));var util=require('util');var moment=require(_0x8f06('0x1'));var BPromise=require(_0x8f06('0x2'));var rs=require(_0x8f06('0x3'));var fs=require('fs');var Redis=require(_0x8f06('0x4'));var db=require(_0x8f06('0x5'))['db'];var utils=require(_0x8f06('0x6'));var logger=require(_0x8f06('0x7'))(_0x8f06('0x8'));var config=require('../../config/environment');var jayson=require(_0x8f06('0x9'));var client=jayson['client'][_0x8f06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24561d,_0x8369b4,_0x477c34){return new BPromise(function(_0xffef68,_0x18201c){return client[_0x8f06('0xb')](_0x24561d,_0x477c34)[_0x8f06('0xc')](function(_0x491d8d){logger[_0x8f06('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x8369b4,_0x8f06('0xe'));logger['debug'](_0x8f06('0xf'),_0x8369b4,_0x8f06('0xe'),JSON[_0x8f06('0x10')](_0x491d8d));if(_0x491d8d['error']){if(_0x491d8d[_0x8f06('0x11')]['code']===0x1f4){logger[_0x8f06('0x11')](_0x8f06('0x12'),_0x8369b4,_0x491d8d[_0x8f06('0x11')][_0x8f06('0x13')]);return _0x18201c(_0x491d8d['error'][_0x8f06('0x13')]);}logger[_0x8f06('0x11')](_0x8f06('0x12'),_0x8369b4,_0x491d8d['error']['message']);return _0xffef68(_0x491d8d[_0x8f06('0x11')][_0x8f06('0x13')]);}else{logger['info'](_0x8f06('0x12'),_0x8369b4,_0x8f06('0xe'));_0xffef68(_0x491d8d['result'][_0x8f06('0x13')]);}})['catch'](function(_0x252512){logger[_0x8f06('0x11')](_0x8f06('0x12'),_0x8369b4,_0x252512);_0x18201c(_0x252512);});});} \ No newline at end of file +var _0xc592=['rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0xc592,0x1ea));var _0x2c59=function(_0x2cde23,_0x3d2800){_0x2cde23=_0x2cde23-0x0;var _0x2753fc=_0xc592[_0x2cde23];return _0x2753fc;};'use strict';var _=require('lodash');var util=require(_0x2c59('0x0'));var moment=require(_0x2c59('0x1'));var BPromise=require(_0x2c59('0x2'));var rs=require(_0x2c59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c59('0x4'));var config=require(_0x2c59('0x5'));var jayson=require(_0x2c59('0x6'));var client=jayson[_0x2c59('0x7')][_0x2c59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34de8a,_0x53be06,_0x5f021c){return new BPromise(function(_0x167208,_0x2185b2){return client['request'](_0x34de8a,_0x5f021c)[_0x2c59('0x9')](function(_0x1fc182){logger[_0x2c59('0xa')](_0x2c59('0xb'),_0x53be06,_0x2c59('0xc'));logger[_0x2c59('0xd')](_0x2c59('0xe'),_0x53be06,_0x2c59('0xc'),JSON[_0x2c59('0xf')](_0x1fc182));if(_0x1fc182[_0x2c59('0x10')]){if(_0x1fc182['error'][_0x2c59('0x11')]===0x1f4){logger[_0x2c59('0x10')](_0x2c59('0xb'),_0x53be06,_0x1fc182[_0x2c59('0x10')][_0x2c59('0x12')]);return _0x2185b2(_0x1fc182[_0x2c59('0x10')]['message']);}logger['error'](_0x2c59('0xb'),_0x53be06,_0x1fc182['error'][_0x2c59('0x12')]);return _0x167208(_0x1fc182['error']['message']);}else{logger[_0x2c59('0xa')](_0x2c59('0xb'),_0x53be06,_0x2c59('0xc'));_0x167208(_0x1fc182['result'][_0x2c59('0x12')]);}})['catch'](function(_0x6bf8e2){logger[_0x2c59('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x53be06,_0x6bf8e2);_0x2185b2(_0x6bf8e2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index ee1d5e7..c495caf 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 _0xd22c=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','originalname','post','/:id/logo','single','file','addLogo','logologin','extname','addLogoLogin','preferred','favicon','addFavicon','exports','util','path','connect-timeout','express'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd22c,0xf2));var _0xcd22=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0xd22c[_0x568ec8];return _0x52b2be;};'use strict';var multer=require('multer');var util=require(_0xcd22('0x0'));var path=require(_0xcd22('0x1'));var timeout=require(_0xcd22('0x2'));var express=require(_0xcd22('0x3'));var router=express['Router']();var fs_extra=require(_0xcd22('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd22('0x5'));var config=require(_0xcd22('0x6'));var controller=require('./setting.controller');router[_0xcd22('0x7')]('/',auth[_0xcd22('0x8')](),controller[_0xcd22('0x9')]);router[_0xcd22('0x7')](_0xcd22('0xa'),controller[_0xcd22('0xb')]);router[_0xcd22('0x7')](_0xcd22('0xc'),controller[_0xcd22('0xd')]);router[_0xcd22('0x7')]('/:id/logo',controller[_0xcd22('0xe')]);router['get'](_0xcd22('0xf'),controller[_0xcd22('0x10')]);router[_0xcd22('0x7')](_0xcd22('0x11'),controller[_0xcd22('0x12')]);router['get'](_0xcd22('0x13'),controller['getPreferred']);router[_0xcd22('0x7')](_0xcd22('0x14'),controller[_0xcd22('0x15')]);var upload=multer({'storage':multer[_0xcd22('0x16')]({'destination':function(_0x3c33be,_0x321038,_0x80b83d){_0x80b83d(null,path[_0xcd22('0x17')](config[_0xcd22('0x18')],_0xcd22('0x19')));},'filename':function(_0x396d44,_0x42675d,_0x14a789){_0x14a789(null,util[_0xcd22('0x1a')](_0xcd22('0x1b'),'logo',path['extname'](_0x42675d[_0xcd22('0x1c')])));}})});router[_0xcd22('0x1d')](_0xcd22('0x1e'),upload[_0xcd22('0x1f')](_0xcd22('0x20')),controller[_0xcd22('0x21')]);var upload=multer({'storage':multer[_0xcd22('0x16')]({'destination':function(_0x6a9fee,_0x297633,_0x1478ed){_0x1478ed(null,path['join'](config[_0xcd22('0x18')],_0xcd22('0x19')));},'filename':function(_0x12a815,_0xa1fd43,_0xfa7a46){_0xfa7a46(null,util['format'](_0xcd22('0x1b'),_0xcd22('0x22'),path[_0xcd22('0x23')](_0xa1fd43[_0xcd22('0x1c')])));}})});router[_0xcd22('0x1d')]('/:id/logo_login',upload['single'](_0xcd22('0x20')),controller[_0xcd22('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x122de2,_0x35d946,_0x50289a){_0x50289a(null,path[_0xcd22('0x17')](config[_0xcd22('0x18')],_0xcd22('0x19')));},'filename':function(_0x497d3f,_0x441d4c,_0x7e331b){_0x7e331b(null,util[_0xcd22('0x1a')](_0xcd22('0x1b'),_0xcd22('0x25'),path[_0xcd22('0x23')](_0x441d4c['originalname'])));}})});router[_0xcd22('0x1d')](_0xcd22('0x13'),upload[_0xcd22('0x1f')](_0xcd22('0x20')),controller['addPreferred']);var upload=multer({'storage':multer[_0xcd22('0x16')]({'destination':function(_0x4de677,_0x47324b,_0x53f72b){_0x53f72b(null,path['join'](config[_0xcd22('0x18')],_0xcd22('0x19')));},'filename':function(_0x48f2cc,_0x39460f,_0x4d6be3){_0x4d6be3(null,util[_0xcd22('0x1a')]('%s%s',_0xcd22('0x26'),path[_0xcd22('0x23')](_0x39460f[_0xcd22('0x1c')])));}})});router[_0xcd22('0x1d')]('/:id/favicon',upload[_0xcd22('0x1f')](_0xcd22('0x20')),controller[_0xcd22('0x27')]);router['put'](_0xcd22('0xc'),auth[_0xcd22('0x8')](),controller['update']);module[_0xcd22('0x28')]=router; \ No newline at end of file +var _0xc272=['../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','addLogo','logologin','/:id/logo_login','file','preferred','server/files/images/logos/','addFavicon','put','exports','multer','path','connect-timeout','fs-extra'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc272,0x1a9));var _0x2c27=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xc272[_0x5ce3c8];return _0xa76867;};'use strict';var multer=require(_0x2c27('0x0'));var util=require('util');var path=require(_0x2c27('0x1'));var timeout=require(_0x2c27('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c27('0x3'));var auth=require(_0x2c27('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2c27('0x5'));var controller=require(_0x2c27('0x6'));router[_0x2c27('0x7')]('/',auth[_0x2c27('0x8')](),controller['index']);router[_0x2c27('0x7')]('/now',controller[_0x2c27('0x9')]);router[_0x2c27('0x7')](_0x2c27('0xa'),controller[_0x2c27('0xb')]);router[_0x2c27('0x7')](_0x2c27('0xc'),controller['getLogo']);router[_0x2c27('0x7')]('/:id/logo_login',controller[_0x2c27('0xd')]);router['get'](_0x2c27('0xe'),controller[_0x2c27('0xf')]);router[_0x2c27('0x7')](_0x2c27('0x10'),controller[_0x2c27('0x11')]);router[_0x2c27('0x7')](_0x2c27('0x12'),controller[_0x2c27('0x13')]);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x2a638a,_0xc9cf13,_0x673fa3){_0x673fa3(null,path[_0x2c27('0x15')](config[_0x2c27('0x16')],'server/files/images/logos/'));},'filename':function(_0x255102,_0x14c053,_0x4e9d78){_0x4e9d78(null,util[_0x2c27('0x17')](_0x2c27('0x18'),_0x2c27('0x19'),path[_0x2c27('0x1a')](_0x14c053[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')](_0x2c27('0xc'),upload[_0x2c27('0x1d')]('file'),controller[_0x2c27('0x1e')]);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x33cca3,_0x44bd85,_0x2a4f9f){_0x2a4f9f(null,path['join'](config[_0x2c27('0x16')],'server/files/images/logos/'));},'filename':function(_0x4c7541,_0x49935c,_0x57239c){_0x57239c(null,util[_0x2c27('0x17')](_0x2c27('0x18'),_0x2c27('0x1f'),path[_0x2c27('0x1a')](_0x49935c[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')](_0x2c27('0x20'),upload['single'](_0x2c27('0x21')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x4e7d99,_0x3cb3a7,_0x525fdf){_0x525fdf(null,path[_0x2c27('0x15')](config[_0x2c27('0x16')],'server/files/images/logos/'));},'filename':function(_0x30741e,_0x1e7b6e,_0x5167e){_0x5167e(null,util[_0x2c27('0x17')](_0x2c27('0x18'),_0x2c27('0x22'),path[_0x2c27('0x1a')](_0x1e7b6e[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')]('/:id/preferred',upload['single'](_0x2c27('0x21')),controller['addPreferred']);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x14bbd7,_0x3ce50f,_0x507090){_0x507090(null,path[_0x2c27('0x15')](config[_0x2c27('0x16')],_0x2c27('0x23')));},'filename':function(_0x2808da,_0x38c41f,_0x5e2255){_0x5e2255(null,util[_0x2c27('0x17')]('%s%s','favicon',path[_0x2c27('0x1a')](_0x38c41f[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')]('/:id/favicon',upload[_0x2c27('0x1d')](_0x2c27('0x21')),controller[_0x2c27('0x24')]);router[_0x2c27('0x25')](_0x2c27('0xa'),auth[_0x2c27('0x8')](),controller['update']);module[_0x2c27('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 5228761..c5703ca 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(_0x3d47c6,_0x4d09a2){var _0x24ff61=function(_0x335710){while(--_0x335710){_0x3d47c6['push'](_0x3d47c6['shift']());}};_0x24ff61(++_0x4d09a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x28beca,_0x2d129d){var _0x107508=function(_0x4d800d){while(--_0x4d800d){_0x28beca['push'](_0x28beca['shift']());}};_0x107508(++_0x2d129d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 ffdf096..122f4e1 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 _0x8758=['request\x20sent','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','send','map','Setting','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','update','body','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','favicon','default_loginLogo.svg','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','info','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message'];(function(_0x522e32,_0x440e6d){var _0x216842=function(_0x467028){while(--_0x467028){_0x522e32['push'](_0x522e32['shift']());}};_0x216842(++_0x440e6d);}(_0x8758,0x1b8));var _0x8875=function(_0x3e3b7e,_0xe059d0){_0x3e3b7e=_0x3e3b7e-0x0;var _0x5bc606=_0x8758[_0x3e3b7e];return _0x5bc606;};'use strict';var emlformat=require(_0x8875('0x0'));var rimraf=require(_0x8875('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8875('0x2'));var rp=require(_0x8875('0x3'));var moment=require(_0x8875('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8875('0x5'));var util=require(_0x8875('0x6'));var path=require(_0x8875('0x7'));var sox=require(_0x8875('0x8'));var csv=require(_0x8875('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8875('0xa'));var squel=require('squel');var crypto=require(_0x8875('0xb'));var jsforce=require(_0x8875('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8875('0x9'));var querystring=require(_0x8875('0xd'));var Papa=require('papaparse');var Redis=require(_0x8875('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8875('0xf'));var as=require(_0x8875('0x10'));var hardwareService=require(_0x8875('0x11'));var logger=require(_0x8875('0x12'))('api');var utils=require(_0x8875('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8875('0x14'))['db'];var jayson=require(_0x8875('0x15'));var client=jayson[_0x8875('0x16')][_0x8875('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x2c9173,_0x5daf11,_0x1d6c56,_0x4b4c61){return new BPromise(function(_0x120f7c,_0x573236){var _0x45d8dc=_0x4b4c61||client;return _0x45d8dc[_0x8875('0x18')](_0x2c9173,_0x1d6c56)['then'](function(_0x1e1987){logger[_0x8875('0x19')]('Setting,\x20%s,\x20%s',_0x5daf11,'request\x20sent');logger[_0x8875('0x1a')](_0x8875('0x1b'),_0x5daf11,'request\x20sent',JSON['stringify'](_0x1e1987));if(_0x1e1987[_0x8875('0x1c')]){if(_0x1e1987['error'][_0x8875('0x1d')]===0x1f4){logger['error'](_0x8875('0x1e'),_0x5daf11,_0x1e1987[_0x8875('0x1c')][_0x8875('0x1f')]);return _0x573236(_0x1e1987[_0x8875('0x1c')][_0x8875('0x1f')]);}logger[_0x8875('0x1c')](_0x8875('0x1e'),_0x5daf11,_0x1e1987[_0x8875('0x1c')][_0x8875('0x1f')]);return _0x120f7c(_0x1e1987[_0x8875('0x1c')]['message']);}else{logger[_0x8875('0x19')](_0x8875('0x1e'),_0x5daf11,_0x8875('0x20'));_0x120f7c(_0x1e1987[_0x8875('0x21')]['message']);}})[_0x8875('0x22')](function(_0x27f186){logger['error'](_0x8875('0x1e'),_0x5daf11,_0x27f186);_0x573236(_0x27f186);});});}function respondWithStatusCode(_0x203318,_0x40d6d9){_0x40d6d9=_0x40d6d9||0xcc;return function(_0x3b4bb0){if(_0x3b4bb0){return _0x203318[_0x8875('0x23')](_0x40d6d9);}return _0x203318[_0x8875('0x24')](_0x40d6d9)['end']();};}function respondWithResult(_0x2c8fff,_0x11e49c){_0x11e49c=_0x11e49c||0xc8;return function(_0x2c0cbc){if(_0x2c0cbc){return _0x2c8fff[_0x8875('0x24')](_0x11e49c)[_0x8875('0x25')](_0x2c0cbc);}};}function respondWithFilteredResult(_0x215adf,_0x58b8a3){return function(_0x13ab7a){if(_0x13ab7a){var _0x2186e2=typeof _0x58b8a3['offset']===_0x8875('0x26')&&typeof _0x58b8a3[_0x8875('0x27')]==='undefined';var _0x22c3e0=_0x13ab7a[_0x8875('0x28')];var _0x54e851=_0x2186e2?0x0:_0x58b8a3[_0x8875('0x29')];var _0x56019c=_0x2186e2?_0x13ab7a['count']:_0x58b8a3[_0x8875('0x29')]+_0x58b8a3[_0x8875('0x27')];var _0x30d471;if(_0x56019c>=_0x22c3e0){_0x56019c=_0x22c3e0;_0x30d471=0xc8;}else{_0x30d471=0xce;}_0x215adf['status'](_0x30d471);return _0x215adf[_0x8875('0x2a')](_0x8875('0x2b'),_0x54e851+'-'+_0x56019c+'/'+_0x22c3e0)[_0x8875('0x25')](_0x13ab7a);}return null;};}function patchUpdates(_0x25fc4c){return function(_0x44a052){try{jsonpatch[_0x8875('0x2c')](_0x44a052,_0x25fc4c,!![]);}catch(_0x8ded96){return BPromise['reject'](_0x8ded96);}return _0x44a052[_0x8875('0x2d')]();};}function saveUpdates(_0x542ab4,_0x270a30){return function(_0x42204d){if(_0x42204d){return _0x42204d['update'](_0x542ab4)[_0x8875('0x2e')](function(_0x3e8152){return _0x3e8152;});}return null;};}function removeEntity(_0x365a2a,_0xcad8c3){return function(_0x2b3e30){if(_0x2b3e30){return _0x2b3e30[_0x8875('0x2f')]()[_0x8875('0x2e')](function(){_0x365a2a[_0x8875('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c78c4,_0x5b9128){return function(_0x55852f){if(!_0x55852f){_0x5c78c4['sendStatus'](0x194);}return _0x55852f;};}function handleError(_0x52f51f,_0x39256e){_0x39256e=_0x39256e||0x1f4;return function(_0x175aa9){logger[_0x8875('0x1c')](_0x175aa9[_0x8875('0x30')]);if(_0x175aa9[_0x8875('0x31')]){delete _0x175aa9[_0x8875('0x31')];}_0x52f51f[_0x8875('0x24')](_0x39256e)[_0x8875('0x32')](_0x175aa9);};}exports['index']=function(_0x259e09,_0x45e095){var _0x4b6922={},_0x38585a={},_0x20083e={'count':0x0,'rows':[]};var _0x428e5b=_[_0x8875('0x33')](db[_0x8875('0x34')][_0x8875('0x35')],function(_0x537464){return{'name':_0x537464['fieldName'],'type':_0x537464['type'][_0x8875('0x36')]};});_0x38585a[_0x8875('0x37')]=_[_0x8875('0x33')](_0x428e5b,_0x8875('0x31'));_0x38585a[_0x8875('0x38')]=_[_0x8875('0x39')](_0x259e09['query']);_0x38585a[_0x8875('0x3a')]=_[_0x8875('0x3b')](_0x38585a['model'],_0x38585a[_0x8875('0x38')]);_0x4b6922[_0x8875('0x3c')]=_[_0x8875('0x3b')](_0x38585a[_0x8875('0x37')],qs['fields'](_0x259e09['query'][_0x8875('0x3d')]));_0x4b6922[_0x8875('0x3c')]=_0x4b6922[_0x8875('0x3c')]['length']?_0x4b6922[_0x8875('0x3c')]:_0x38585a[_0x8875('0x37')];if(!_0x259e09[_0x8875('0x38')][_0x8875('0x3e')](_0x8875('0x3f'))){_0x4b6922['limit']=qs[_0x8875('0x27')](_0x259e09[_0x8875('0x38')][_0x8875('0x27')]);_0x4b6922['offset']=qs['offset'](_0x259e09[_0x8875('0x38')]['offset']);}_0x4b6922['order']=qs['sort'](_0x259e09[_0x8875('0x38')][_0x8875('0x40')]);_0x4b6922[_0x8875('0x41')]=qs[_0x8875('0x3a')](_[_0x8875('0x42')](_0x259e09['query'],_0x38585a[_0x8875('0x3a')]),_0x428e5b);if(_0x259e09['query']['filter']){_0x4b6922[_0x8875('0x41')]=_[_0x8875('0x43')](_0x4b6922[_0x8875('0x41')],{'$or':_['map'](_0x428e5b,function(_0x1ae88e){if(_0x1ae88e[_0x8875('0x44')]!==_0x8875('0x45')){var _0x4bdac5={};_0x4bdac5[_0x1ae88e[_0x8875('0x31')]]={'$like':'%'+_0x259e09[_0x8875('0x38')]['filter']+'%'};return _0x4bdac5;}})});}_0x4b6922=_[_0x8875('0x43')]({},_0x4b6922,_0x259e09[_0x8875('0x46')]);var _0x2cbe70={'where':_0x4b6922[_0x8875('0x41')]};return db[_0x8875('0x34')]['count'](_0x2cbe70)[_0x8875('0x2e')](function(_0x9e8e54){_0x20083e[_0x8875('0x28')]=_0x9e8e54;if(_0x259e09[_0x8875('0x38')]['includeAll']){_0x4b6922[_0x8875('0x47')]=[{'all':!![]}];}return db['Setting'][_0x8875('0x48')](_0x4b6922);})['then'](function(_0x6a11c5){_0x20083e[_0x8875('0x49')]=_0x6a11c5;return _0x20083e;})[_0x8875('0x2e')](respondWithFilteredResult(_0x45e095,_0x4b6922))[_0x8875('0x22')](handleError(_0x45e095,null));};exports[_0x8875('0x4a')]=function(_0x67edf,_0x3754f8){var _0x2f6567={'raw':![],'where':{'id':_0x67edf[_0x8875('0x4b')]['id']}},_0x2c5aed={};_0x2c5aed[_0x8875('0x37')]=_['keys'](db[_0x8875('0x34')]['rawAttributes']);_0x2c5aed[_0x8875('0x38')]=_['keys'](_0x67edf[_0x8875('0x38')]);_0x2c5aed['filters']=_[_0x8875('0x3b')](_0x2c5aed[_0x8875('0x37')],_0x2c5aed['query']);_0x2f6567[_0x8875('0x3c')]=_[_0x8875('0x3b')](_0x2c5aed[_0x8875('0x37')],qs[_0x8875('0x3d')](_0x67edf[_0x8875('0x38')][_0x8875('0x3d')]));_0x2f6567['attributes']=_0x2f6567[_0x8875('0x3c')][_0x8875('0x4c')]?_0x2f6567['attributes']:_0x2c5aed[_0x8875('0x37')];if(_0x67edf[_0x8875('0x38')][_0x8875('0x4d')]){_0x2f6567['include']=[{'all':!![]}];}_0x2f6567=_[_0x8875('0x43')]({},_0x2f6567,_0x67edf['options']);return db[_0x8875('0x34')][_0x8875('0x4e')](_0x2f6567)[_0x8875('0x2e')](handleEntityNotFound(_0x3754f8,null))[_0x8875('0x2e')](respondWithResult(_0x3754f8,null))[_0x8875('0x22')](handleError(_0x3754f8,null));};exports[_0x8875('0x4f')]=function(_0x1177c8,_0x38f8aa){if(_0x1177c8[_0x8875('0x50')]['id']){delete _0x1177c8[_0x8875('0x50')]['id'];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x1177c8[_0x8875('0x4b')]['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0x38f8aa,null))[_0x8875('0x2e')](saveUpdates(_0x1177c8['body'],null))[_0x8875('0x2e')](respondWithResult(_0x38f8aa,null))[_0x8875('0x22')](handleError(_0x38f8aa,null));};exports['addLogo']=function(_0x38b47e,_0x31122d,_0x51ccff){if(_0x38b47e[_0x8875('0x51')]&&_0x38b47e['file']['filename']){_0x38b47e[_0x8875('0x50')][_0x8875('0x52')]=_0x38b47e[_0x8875('0x51')][_0x8875('0x53')];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x38b47e[_0x8875('0x4b')]['id']}})['then'](handleEntityNotFound(_0x31122d,null))[_0x8875('0x2e')](saveUpdates(_0x38b47e[_0x8875('0x50')],null))[_0x8875('0x2e')](respondWithResult(_0x31122d,null))['catch'](handleError(_0x31122d,null));};exports[_0x8875('0x54')]=function(_0x2c2724,_0x420c73,_0x3faa7c){if(_0x2c2724[_0x8875('0x51')]&&_0x2c2724[_0x8875('0x51')][_0x8875('0x53')]){_0x2c2724[_0x8875('0x50')][_0x8875('0x55')]=_0x2c2724[_0x8875('0x51')][_0x8875('0x53')];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x2c2724['params']['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0x420c73,null))[_0x8875('0x2e')](saveUpdates(_0x2c2724[_0x8875('0x50')],null))['then'](respondWithResult(_0x420c73,null))[_0x8875('0x22')](handleError(_0x420c73,null));};var utilLicense=require(_0x8875('0x56'));exports['getLogo']=function(_0xd4e7f1,_0x3c6035,_0x25794f){var _0x4b32d0=_0x8875('0x57');var _0x1d59fb={'custom':![]};return utilLicense[_0x8875('0x58')]()[_0x8875('0x2e')](function(_0x1d26e4){if(_0x1d26e4){_0x1d59fb=_0x1d26e4;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0xd4e7f1[_0x8875('0x4b')]['id']},'attributes':['logo',_0x8875('0x55'),_0x8875('0x59'),'favicon',_0x8875('0x5a'),_0x8875('0x5b'),'defaultPreferred',_0x8875('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c6035,null))[_0x8875('0x2e')](function(_0x1ed91b){if(_0x1ed91b){var _0x15aef2=_0x1ed91b[_0x8875('0x52')]&&fs[_0x8875('0x5d')](path[_0x8875('0x5e')](config['root'],_0x4b32d0,_['toLower'](_0x1ed91b['logo'])))?path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x4b32d0,_[_0x8875('0x60')](_0x1ed91b[_0x8875('0x52')])):path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x4b32d0,_[_0x8875('0x60')](_0x8875('0x61')));var _0x331253=_0x8875('0x62')+_['upperFirst'](_0x8875('0x52'));if(_0x1ed91b[_0x331253]||!_0x1d59fb[_0x8875('0x63')]){_0x15aef2=path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x4b32d0,_[_0x8875('0x60')](_0x8875('0x61')));}if(!fs['existsSync'](_0x15aef2)){throw new db[(_0x8875('0x64'))][(_0x8875('0x65'))](_[_0x8875('0x66')]('logo')+_0x8875('0x67'));}return _0x3c6035[_0x8875('0x68')](_0x15aef2);}})['catch'](handleError(_0x3c6035,null));};var utilLicense=require(_0x8875('0x56'));exports[_0x8875('0x69')]=function(_0x3c31aa,_0x5cd3e2,_0x2c0104){var _0x221e43='server/files/images/logos';var _0x2226a2={'custom':![]};return utilLicense['getLicense']()[_0x8875('0x2e')](function(_0x4613a8){if(_0x4613a8){_0x2226a2=_0x4613a8;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x3c31aa[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x52'),_0x8875('0x55'),_0x8875('0x59'),_0x8875('0x6a'),'defaultLogo',_0x8875('0x5b'),'defaultPreferred',_0x8875('0x5c')],'raw':!![]});})[_0x8875('0x2e')](handleEntityNotFound(_0x5cd3e2,null))[_0x8875('0x2e')](function(_0x49ca67){if(_0x49ca67){var _0xc5a54a=_0x49ca67['loginLogo']&&fs[_0x8875('0x5d')](path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x49ca67[_0x8875('0x55')])))?path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x49ca67[_0x8875('0x55')])):path['join'](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x8875('0x6b')));var _0x499965=_0x8875('0x62')+_[_0x8875('0x66')]('loginLogo');if(_0x49ca67[_0x499965]||!_0x2226a2[_0x8875('0x63')]){_0xc5a54a=path['join'](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x8875('0x6b')));}if(!fs['existsSync'](_0xc5a54a)){throw new db[(_0x8875('0x64'))][(_0x8875('0x65'))](_['upperFirst']('loginLogo')+_0x8875('0x67'));}return _0x5cd3e2[_0x8875('0x68')](_0xc5a54a);}})[_0x8875('0x22')](handleError(_0x5cd3e2,null));};exports['gdpr']=function(_0x537922,_0x24e16c){return db['Setting'][_0x8875('0x4e')]({'where':{'id':_0x537922[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x6c')]})['then'](respondWithResult(_0x24e16c,null))[_0x8875('0x22')](handleError(_0x24e16c,null));};exports[_0x8875('0x6d')]=function(_0x1ccf01,_0x2dff1c,_0x4f4e1b){if(_0x1ccf01[_0x8875('0x51')]&&_0x1ccf01[_0x8875('0x51')][_0x8875('0x53')]){_0x1ccf01['body'][_0x8875('0x59')]=_0x1ccf01[_0x8875('0x51')]['filename'];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x1ccf01[_0x8875('0x4b')]['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0x2dff1c,null))[_0x8875('0x2e')](saveUpdates(_0x1ccf01[_0x8875('0x50')],null))['then'](respondWithResult(_0x2dff1c,null))[_0x8875('0x22')](handleError(_0x2dff1c,null));};var utilLicense=require(_0x8875('0x56'));exports[_0x8875('0x6e')]=function(_0x24111a,_0x506f88,_0x36598f){var _0x176d8f=_0x8875('0x57');var _0x39e75c={'custom':![]};return utilLicense['getLicense']()[_0x8875('0x2e')](function(_0x3cf248){if(_0x3cf248){_0x39e75c=_0x3cf248;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x24111a[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x52'),_0x8875('0x55'),_0x8875('0x59'),'favicon',_0x8875('0x5a'),_0x8875('0x5b'),_0x8875('0x6f'),_0x8875('0x5c')],'raw':!![]});})[_0x8875('0x2e')](handleEntityNotFound(_0x506f88,null))['then'](function(_0x12e763){if(_0x12e763){var _0xeb0383=_0x12e763['preferred']&&fs['existsSync'](path[_0x8875('0x5e')](config['root'],_0x176d8f,_[_0x8875('0x60')](_0x12e763[_0x8875('0x59')])))?path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x176d8f,_['toLower'](_0x12e763[_0x8875('0x59')])):path[_0x8875('0x5e')](config['root'],_0x176d8f,_[_0x8875('0x60')](_0x8875('0x70')));var _0x3e4115=_0x8875('0x62')+_[_0x8875('0x66')](_0x8875('0x59'));if(_0x12e763[_0x3e4115]||!_0x39e75c[_0x8875('0x63')]||!_0x39e75c[_0x8875('0x59')]){_0xeb0383=path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x176d8f,_[_0x8875('0x60')](_0x8875('0x70')));}if(!fs[_0x8875('0x5d')](_0xeb0383)){throw new db[(_0x8875('0x64'))][(_0x8875('0x65'))](_[_0x8875('0x66')](_0x8875('0x59'))+_0x8875('0x67'));}return _0x506f88[_0x8875('0x68')](_0xeb0383);}})[_0x8875('0x22')](handleError(_0x506f88,null));};exports[_0x8875('0x71')]=function(_0x2761ae,_0xf2373a,_0x50ccf9){if(_0x2761ae['file']&&_0x2761ae[_0x8875('0x51')][_0x8875('0x53')]){_0x2761ae['body']['favicon']=_0x2761ae[_0x8875('0x51')][_0x8875('0x53')];}return db['Setting']['find']({'where':{'id':_0x2761ae['params']['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0xf2373a,null))['then'](saveUpdates(_0x2761ae[_0x8875('0x50')],null))['then'](respondWithResult(_0xf2373a,null))[_0x8875('0x22')](handleError(_0xf2373a,null));};var utilLicense=require(_0x8875('0x56'));exports[_0x8875('0x72')]=function(_0x2da84c,_0x337c98,_0x21bf97){var _0x3408c1='server/files/images/logos';var _0x320463={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x88e30b){if(_0x88e30b){_0x320463=_0x88e30b;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x2da84c[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x52'),_0x8875('0x55'),_0x8875('0x59'),_0x8875('0x6a'),_0x8875('0x5a'),_0x8875('0x5b'),_0x8875('0x6f'),_0x8875('0x5c')],'raw':!![]});})[_0x8875('0x2e')](handleEntityNotFound(_0x337c98,null))[_0x8875('0x2e')](function(_0x2c35e9){if(_0x2c35e9){var _0x2f49f3=_0x2c35e9[_0x8875('0x6a')]&&fs[_0x8875('0x5d')](path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x3408c1,_[_0x8875('0x60')](_0x2c35e9[_0x8875('0x6a')])))?path[_0x8875('0x5e')](config['root'],_0x3408c1,_[_0x8875('0x60')](_0x2c35e9['favicon'])):path[_0x8875('0x5e')](config['root'],_0x3408c1,_[_0x8875('0x60')]('default_favicon.ico'));var _0x28ba07=_0x8875('0x62')+_[_0x8875('0x66')](_0x8875('0x6a'));if(_0x2c35e9[_0x28ba07]||!_0x320463['custom']){_0x2f49f3=path['join'](config[_0x8875('0x5f')],_0x3408c1,_[_0x8875('0x60')](_0x8875('0x73')));}if(!fs['existsSync'](_0x2f49f3)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x8875('0x6a'))+'\x20not\x20found');}return _0x337c98[_0x8875('0x68')](_0x2f49f3);}})[_0x8875('0x22')](handleError(_0x337c98,null));};exports['getDate']=function(_0x2aceaa,_0x16a6e0){var _0x358e57={'offset':moment()['utcOffset']()};_0x358e57[_0x8875('0x74')]=moment()['utcOffset'](_0x358e57[_0x8875('0x29')])['format'](_0x8875('0x75'));return _0x16a6e0['status'](0xc8)[_0x8875('0x32')](_0x358e57);}; \ No newline at end of file +var _0xb3e9=['\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','name','send','index','map','Setting','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','addLogo','file','body','filename','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','download','getLicense','defaultPreferred','default_loginLogo.svg'];(function(_0x5504fc,_0x2e161c){var _0xbad34c=function(_0x1f62de){while(--_0x1f62de){_0x5504fc['push'](_0x5504fc['shift']());}};_0xbad34c(++_0x2e161c);}(_0xb3e9,0x1eb));var _0x9b3e=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xb3e9[_0x22b68a];return _0x1ac67a;};'use strict';var emlformat=require(_0x9b3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b3e('0x1'));var jsonpatch=require(_0x9b3e('0x2'));var rp=require(_0x9b3e('0x3'));var moment=require(_0x9b3e('0x4'));var BPromise=require(_0x9b3e('0x5'));var Mustache=require(_0x9b3e('0x6'));var util=require(_0x9b3e('0x7'));var path=require('path');var sox=require(_0x9b3e('0x8'));var csv=require('to-csv');var ejs=require(_0x9b3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b3e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b3e('0xb'));var querystring=require(_0x9b3e('0xc'));var Papa=require(_0x9b3e('0xd'));var Redis=require(_0x9b3e('0xe'));var authService=require(_0x9b3e('0xf'));var qs=require(_0x9b3e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9b3e('0x11'));var utils=require(_0x9b3e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9b3e('0x13'));var db=require(_0x9b3e('0x14'))['db'];var jayson=require(_0x9b3e('0x15'));var client=jayson[_0x9b3e('0x16')][_0x9b3e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x54ccf6,_0x5824c0,_0x30c2b8,_0x38d9fd){return new BPromise(function(_0xe2be16,_0x6637e0){var _0x82ec8d=_0x38d9fd||client;return _0x82ec8d[_0x9b3e('0x18')](_0x54ccf6,_0x30c2b8)[_0x9b3e('0x19')](function(_0x15a7cf){logger[_0x9b3e('0x1a')](_0x9b3e('0x1b'),_0x5824c0,_0x9b3e('0x1c'));logger[_0x9b3e('0x1d')](_0x9b3e('0x1e'),_0x5824c0,_0x9b3e('0x1c'),JSON[_0x9b3e('0x1f')](_0x15a7cf));if(_0x15a7cf[_0x9b3e('0x20')]){if(_0x15a7cf['error'][_0x9b3e('0x21')]===0x1f4){logger[_0x9b3e('0x20')](_0x9b3e('0x1b'),_0x5824c0,_0x15a7cf['error'][_0x9b3e('0x22')]);return _0x6637e0(_0x15a7cf[_0x9b3e('0x20')][_0x9b3e('0x22')]);}logger['error'](_0x9b3e('0x1b'),_0x5824c0,_0x15a7cf['error'][_0x9b3e('0x22')]);return _0xe2be16(_0x15a7cf[_0x9b3e('0x20')][_0x9b3e('0x22')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x5824c0,_0x9b3e('0x1c'));_0xe2be16(_0x15a7cf[_0x9b3e('0x23')][_0x9b3e('0x22')]);}})[_0x9b3e('0x24')](function(_0x591ae8){logger[_0x9b3e('0x20')](_0x9b3e('0x1b'),_0x5824c0,_0x591ae8);_0x6637e0(_0x591ae8);});});}function respondWithStatusCode(_0x101293,_0x4b9029){_0x4b9029=_0x4b9029||0xcc;return function(_0x984e96){if(_0x984e96){return _0x101293[_0x9b3e('0x25')](_0x4b9029);}return _0x101293[_0x9b3e('0x26')](_0x4b9029)[_0x9b3e('0x27')]();};}function respondWithResult(_0x3fd7ee,_0x501541){_0x501541=_0x501541||0xc8;return function(_0x162875){if(_0x162875){return _0x3fd7ee['status'](_0x501541)[_0x9b3e('0x28')](_0x162875);}};}function respondWithFilteredResult(_0x19d9c4,_0x2bdb0a){return function(_0x4cd6f0){if(_0x4cd6f0){var _0x19d8fe=typeof _0x2bdb0a[_0x9b3e('0x29')]===_0x9b3e('0x2a')&&typeof _0x2bdb0a[_0x9b3e('0x2b')]==='undefined';var _0x36078c=_0x4cd6f0[_0x9b3e('0x2c')];var _0x109e04=_0x19d8fe?0x0:_0x2bdb0a['offset'];var _0x1bbdf0=_0x19d8fe?_0x4cd6f0['count']:_0x2bdb0a[_0x9b3e('0x29')]+_0x2bdb0a[_0x9b3e('0x2b')];var _0x52ae43;if(_0x1bbdf0>=_0x36078c){_0x1bbdf0=_0x36078c;_0x52ae43=0xc8;}else{_0x52ae43=0xce;}_0x19d9c4[_0x9b3e('0x26')](_0x52ae43);return _0x19d9c4[_0x9b3e('0x2d')](_0x9b3e('0x2e'),_0x109e04+'-'+_0x1bbdf0+'/'+_0x36078c)[_0x9b3e('0x28')](_0x4cd6f0);}return null;};}function patchUpdates(_0x32abfa){return function(_0x581599){try{jsonpatch['apply'](_0x581599,_0x32abfa,!![]);}catch(_0x52d35d){return BPromise[_0x9b3e('0x2f')](_0x52d35d);}return _0x581599[_0x9b3e('0x30')]();};}function saveUpdates(_0x3d8aea,_0x4e858c){return function(_0x371e86){if(_0x371e86){return _0x371e86[_0x9b3e('0x31')](_0x3d8aea)['then'](function(_0x4cfaf3){return _0x4cfaf3;});}return null;};}function removeEntity(_0x20dcb6,_0x50478c){return function(_0x4448be){if(_0x4448be){return _0x4448be['destroy']()[_0x9b3e('0x19')](function(){_0x20dcb6[_0x9b3e('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44cec6,_0x5ea501){return function(_0x5b7243){if(!_0x5b7243){_0x44cec6[_0x9b3e('0x25')](0x194);}return _0x5b7243;};}function handleError(_0x4538cf,_0x274bcb){_0x274bcb=_0x274bcb||0x1f4;return function(_0x37a2bd){logger[_0x9b3e('0x20')](_0x37a2bd['stack']);if(_0x37a2bd[_0x9b3e('0x32')]){delete _0x37a2bd[_0x9b3e('0x32')];}_0x4538cf['status'](_0x274bcb)[_0x9b3e('0x33')](_0x37a2bd);};}exports[_0x9b3e('0x34')]=function(_0x62ef33,_0x229cff){var _0x5a8adb={},_0x260ed7={},_0xcaba6a={'count':0x0,'rows':[]};var _0x228752=_[_0x9b3e('0x35')](db[_0x9b3e('0x36')][_0x9b3e('0x37')],function(_0x15bda6){return{'name':_0x15bda6['fieldName'],'type':_0x15bda6[_0x9b3e('0x38')][_0x9b3e('0x39')]};});_0x260ed7['model']=_[_0x9b3e('0x35')](_0x228752,_0x9b3e('0x32'));_0x260ed7['query']=_[_0x9b3e('0x3a')](_0x62ef33[_0x9b3e('0x3b')]);_0x260ed7[_0x9b3e('0x3c')]=_['intersection'](_0x260ed7[_0x9b3e('0x3d')],_0x260ed7[_0x9b3e('0x3b')]);_0x5a8adb[_0x9b3e('0x3e')]=_[_0x9b3e('0x3f')](_0x260ed7[_0x9b3e('0x3d')],qs[_0x9b3e('0x40')](_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x40')]));_0x5a8adb[_0x9b3e('0x3e')]=_0x5a8adb[_0x9b3e('0x3e')][_0x9b3e('0x41')]?_0x5a8adb[_0x9b3e('0x3e')]:_0x260ed7['model'];if(!_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x42')](_0x9b3e('0x43'))){_0x5a8adb[_0x9b3e('0x2b')]=qs[_0x9b3e('0x2b')](_0x62ef33[_0x9b3e('0x3b')]['limit']);_0x5a8adb[_0x9b3e('0x29')]=qs[_0x9b3e('0x29')](_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x29')]);}_0x5a8adb[_0x9b3e('0x44')]=qs[_0x9b3e('0x45')](_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x45')]);_0x5a8adb[_0x9b3e('0x46')]=qs[_0x9b3e('0x3c')](_['pick'](_0x62ef33[_0x9b3e('0x3b')],_0x260ed7['filters']),_0x228752);if(_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x47')]){_0x5a8adb[_0x9b3e('0x46')]=_[_0x9b3e('0x48')](_0x5a8adb[_0x9b3e('0x46')],{'$or':_[_0x9b3e('0x35')](_0x228752,function(_0x30df9d){if(_0x30df9d[_0x9b3e('0x38')]!==_0x9b3e('0x49')){var _0x2eb9c2={};_0x2eb9c2[_0x30df9d[_0x9b3e('0x32')]]={'$like':'%'+_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x47')]+'%'};return _0x2eb9c2;}})});}_0x5a8adb=_['merge']({},_0x5a8adb,_0x62ef33[_0x9b3e('0x4a')]);var _0x736de1={'where':_0x5a8adb['where']};return db[_0x9b3e('0x36')][_0x9b3e('0x2c')](_0x736de1)[_0x9b3e('0x19')](function(_0x4132f3){_0xcaba6a[_0x9b3e('0x2c')]=_0x4132f3;if(_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x4b')]){_0x5a8adb[_0x9b3e('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x9b3e('0x4d')](_0x5a8adb);})[_0x9b3e('0x19')](function(_0x5523e9){_0xcaba6a[_0x9b3e('0x4e')]=_0x5523e9;return _0xcaba6a;})['then'](respondWithFilteredResult(_0x229cff,_0x5a8adb))[_0x9b3e('0x24')](handleError(_0x229cff,null));};exports[_0x9b3e('0x4f')]=function(_0x3dd607,_0x28b23c){var _0x422375={'raw':![],'where':{'id':_0x3dd607['params']['id']}},_0x24fd22={};_0x24fd22[_0x9b3e('0x3d')]=_[_0x9b3e('0x3a')](db[_0x9b3e('0x36')][_0x9b3e('0x37')]);_0x24fd22[_0x9b3e('0x3b')]=_['keys'](_0x3dd607[_0x9b3e('0x3b')]);_0x24fd22[_0x9b3e('0x3c')]=_[_0x9b3e('0x3f')](_0x24fd22[_0x9b3e('0x3d')],_0x24fd22[_0x9b3e('0x3b')]);_0x422375['attributes']=_[_0x9b3e('0x3f')](_0x24fd22['model'],qs['fields'](_0x3dd607[_0x9b3e('0x3b')]['fields']));_0x422375[_0x9b3e('0x3e')]=_0x422375[_0x9b3e('0x3e')]['length']?_0x422375[_0x9b3e('0x3e')]:_0x24fd22[_0x9b3e('0x3d')];if(_0x3dd607[_0x9b3e('0x3b')][_0x9b3e('0x4b')]){_0x422375[_0x9b3e('0x4c')]=[{'all':!![]}];}_0x422375=_[_0x9b3e('0x48')]({},_0x422375,_0x3dd607[_0x9b3e('0x4a')]);return db[_0x9b3e('0x36')]['find'](_0x422375)[_0x9b3e('0x19')](handleEntityNotFound(_0x28b23c,null))['then'](respondWithResult(_0x28b23c,null))[_0x9b3e('0x24')](handleError(_0x28b23c,null));};exports[_0x9b3e('0x31')]=function(_0x33f3c6,_0x13e292){if(_0x33f3c6['body']['id']){delete _0x33f3c6['body']['id'];}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x33f3c6['params']['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x13e292,null))['then'](saveUpdates(_0x33f3c6['body'],null))[_0x9b3e('0x19')](respondWithResult(_0x13e292,null))[_0x9b3e('0x24')](handleError(_0x13e292,null));};exports[_0x9b3e('0x51')]=function(_0x359c4e,_0x2dfac5,_0x308682){if(_0x359c4e[_0x9b3e('0x52')]&&_0x359c4e[_0x9b3e('0x52')]['filename']){_0x359c4e[_0x9b3e('0x53')]['logo']=_0x359c4e['file'][_0x9b3e('0x54')];}return db['Setting'][_0x9b3e('0x50')]({'where':{'id':_0x359c4e[_0x9b3e('0x55')]['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x2dfac5,null))['then'](saveUpdates(_0x359c4e[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x2dfac5,null))[_0x9b3e('0x24')](handleError(_0x2dfac5,null));};exports[_0x9b3e('0x56')]=function(_0x4dc42d,_0x2fcd78,_0x1cfa74){if(_0x4dc42d['file']&&_0x4dc42d[_0x9b3e('0x52')][_0x9b3e('0x54')]){_0x4dc42d[_0x9b3e('0x53')][_0x9b3e('0x57')]=_0x4dc42d[_0x9b3e('0x52')][_0x9b3e('0x54')];}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x4dc42d[_0x9b3e('0x55')]['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x2fcd78,null))[_0x9b3e('0x19')](saveUpdates(_0x4dc42d[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x2fcd78,null))[_0x9b3e('0x24')](handleError(_0x2fcd78,null));};var utilLicense=require('../../config/license/util');exports[_0x9b3e('0x58')]=function(_0x37a36c,_0x43a589,_0x115589){var _0x1d7cf3=_0x9b3e('0x59');var _0x184a5c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2f6bd0){if(_0x2f6bd0){_0x184a5c=_0x2f6bd0;}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x37a36c['params']['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),_0x9b3e('0x5d'),_0x9b3e('0x5e'),'defaultPreferred',_0x9b3e('0x5f')],'raw':!![]});})[_0x9b3e('0x19')](handleEntityNotFound(_0x43a589,null))[_0x9b3e('0x19')](function(_0x4fd1a5){if(_0x4fd1a5){var _0x48b279=_0x4fd1a5[_0x9b3e('0x5a')]&&fs[_0x9b3e('0x60')](path['join'](config[_0x9b3e('0x61')],_0x1d7cf3,_[_0x9b3e('0x62')](_0x4fd1a5['logo'])))?path['join'](config[_0x9b3e('0x61')],_0x1d7cf3,_[_0x9b3e('0x62')](_0x4fd1a5[_0x9b3e('0x5a')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x1d7cf3,_['toLower'](_0x9b3e('0x64')));var _0x16e3db='default'+_[_0x9b3e('0x65')](_0x9b3e('0x5a'));if(_0x4fd1a5[_0x16e3db]||!_0x184a5c[_0x9b3e('0x66')]){_0x48b279=path['join'](config[_0x9b3e('0x61')],_0x1d7cf3,_[_0x9b3e('0x62')]('default_logo.svg'));}if(!fs[_0x9b3e('0x60')](_0x48b279)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_[_0x9b3e('0x65')](_0x9b3e('0x5a'))+'\x20not\x20found');}return _0x43a589[_0x9b3e('0x69')](_0x48b279);}})['catch'](handleError(_0x43a589,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x9baa38,_0xc9d09e,_0x37eace){var _0x589ced=_0x9b3e('0x59');var _0x667b34={'custom':![]};return utilLicense[_0x9b3e('0x6a')]()[_0x9b3e('0x19')](function(_0x31f20e){if(_0x31f20e){_0x667b34=_0x31f20e;}return db['Setting']['find']({'where':{'id':_0x9baa38[_0x9b3e('0x55')]['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),_0x9b3e('0x5d'),_0x9b3e('0x5e'),_0x9b3e('0x6b'),_0x9b3e('0x5f')],'raw':!![]});})[_0x9b3e('0x19')](handleEntityNotFound(_0xc9d09e,null))['then'](function(_0x37e54c){if(_0x37e54c){var _0xecbba3=_0x37e54c[_0x9b3e('0x57')]&&fs[_0x9b3e('0x60')](path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x589ced,_['toLower'](_0x37e54c[_0x9b3e('0x57')])))?path[_0x9b3e('0x63')](config['root'],_0x589ced,_['toLower'](_0x37e54c[_0x9b3e('0x57')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x589ced,_[_0x9b3e('0x62')](_0x9b3e('0x6c')));var _0x18e81a='default'+_[_0x9b3e('0x65')]('loginLogo');if(_0x37e54c[_0x18e81a]||!_0x667b34['custom']){_0xecbba3=path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x589ced,_[_0x9b3e('0x62')](_0x9b3e('0x6c')));}if(!fs['existsSync'](_0xecbba3)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_[_0x9b3e('0x65')]('loginLogo')+_0x9b3e('0x6d'));}return _0xc9d09e[_0x9b3e('0x69')](_0xecbba3);}})[_0x9b3e('0x24')](handleError(_0xc9d09e,null));};exports[_0x9b3e('0x6e')]=function(_0xa5a299,_0x1fb3d1){return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0xa5a299[_0x9b3e('0x55')]['id']},'attributes':[_0x9b3e('0x6f')]})['then'](respondWithResult(_0x1fb3d1,null))[_0x9b3e('0x24')](handleError(_0x1fb3d1,null));};exports[_0x9b3e('0x70')]=function(_0x49900c,_0x330cdc,_0x54d4d8){if(_0x49900c[_0x9b3e('0x52')]&&_0x49900c[_0x9b3e('0x52')][_0x9b3e('0x54')]){_0x49900c[_0x9b3e('0x53')][_0x9b3e('0x5b')]=_0x49900c[_0x9b3e('0x52')][_0x9b3e('0x54')];}return db['Setting'][_0x9b3e('0x50')]({'where':{'id':_0x49900c['params']['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x330cdc,null))[_0x9b3e('0x19')](saveUpdates(_0x49900c[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x330cdc,null))['catch'](handleError(_0x330cdc,null));};var utilLicense=require('../../config/license/util');exports[_0x9b3e('0x71')]=function(_0xb80182,_0x340ce6,_0x4afda4){var _0x330f7e='server/files/images/logos';var _0x551098={'custom':![]};return utilLicense[_0x9b3e('0x6a')]()[_0x9b3e('0x19')](function(_0x1b3b78){if(_0x1b3b78){_0x551098=_0x1b3b78;}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0xb80182['params']['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),_0x9b3e('0x5d'),_0x9b3e('0x5e'),'defaultPreferred',_0x9b3e('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x340ce6,null))[_0x9b3e('0x19')](function(_0xb55250){if(_0xb55250){var _0x3429a8=_0xb55250['preferred']&&fs['existsSync'](path['join'](config['root'],_0x330f7e,_[_0x9b3e('0x62')](_0xb55250[_0x9b3e('0x5b')])))?path[_0x9b3e('0x63')](config['root'],_0x330f7e,_[_0x9b3e('0x62')](_0xb55250[_0x9b3e('0x5b')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x330f7e,_['toLower']('default_preferred.png'));var _0x28fdfa=_0x9b3e('0x72')+_[_0x9b3e('0x65')](_0x9b3e('0x5b'));if(_0xb55250[_0x28fdfa]||!_0x551098[_0x9b3e('0x66')]||!_0x551098['preferred']){_0x3429a8=path['join'](config[_0x9b3e('0x61')],_0x330f7e,_['toLower']('default_preferred.png'));}if(!fs[_0x9b3e('0x60')](_0x3429a8)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_['upperFirst'](_0x9b3e('0x5b'))+_0x9b3e('0x6d'));}return _0x340ce6[_0x9b3e('0x69')](_0x3429a8);}})[_0x9b3e('0x24')](handleError(_0x340ce6,null));};exports[_0x9b3e('0x73')]=function(_0x1b2a8f,_0x25b634,_0x3e86be){if(_0x1b2a8f[_0x9b3e('0x52')]&&_0x1b2a8f[_0x9b3e('0x52')]['filename']){_0x1b2a8f[_0x9b3e('0x53')][_0x9b3e('0x5c')]=_0x1b2a8f[_0x9b3e('0x52')][_0x9b3e('0x54')];}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x1b2a8f['params']['id']}})['then'](handleEntityNotFound(_0x25b634,null))['then'](saveUpdates(_0x1b2a8f[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x25b634,null))[_0x9b3e('0x24')](handleError(_0x25b634,null));};var utilLicense=require('../../config/license/util');exports[_0x9b3e('0x74')]=function(_0x351e69,_0x2cdd9d,_0x44d410){var _0x7c3729=_0x9b3e('0x59');var _0x71c490={'custom':![]};return utilLicense[_0x9b3e('0x6a')]()[_0x9b3e('0x19')](function(_0x2a2792){if(_0x2a2792){_0x71c490=_0x2a2792;}return db['Setting']['find']({'where':{'id':_0x351e69[_0x9b3e('0x55')]['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),'defaultLogo','defaultLoginLogo',_0x9b3e('0x6b'),_0x9b3e('0x5f')],'raw':!![]});})[_0x9b3e('0x19')](handleEntityNotFound(_0x2cdd9d,null))['then'](function(_0x447244){if(_0x447244){var _0x438a46=_0x447244['favicon']&&fs[_0x9b3e('0x60')](path[_0x9b3e('0x63')](config['root'],_0x7c3729,_[_0x9b3e('0x62')](_0x447244[_0x9b3e('0x5c')])))?path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x7c3729,_['toLower'](_0x447244[_0x9b3e('0x5c')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x7c3729,_[_0x9b3e('0x62')](_0x9b3e('0x75')));var _0x32a108=_0x9b3e('0x72')+_[_0x9b3e('0x65')](_0x9b3e('0x5c'));if(_0x447244[_0x32a108]||!_0x71c490[_0x9b3e('0x66')]){_0x438a46=path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x7c3729,_[_0x9b3e('0x62')](_0x9b3e('0x75')));}if(!fs[_0x9b3e('0x60')](_0x438a46)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_['upperFirst']('favicon')+_0x9b3e('0x6d'));}return _0x2cdd9d[_0x9b3e('0x69')](_0x438a46);}})['catch'](handleError(_0x2cdd9d,null));};exports[_0x9b3e('0x76')]=function(_0x5cd651,_0x244324){var _0x574571={'offset':moment()[_0x9b3e('0x77')]()};_0x574571['now']=moment()[_0x9b3e('0x77')](_0x574571[_0x9b3e('0x29')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x244324[_0x9b3e('0x26')](0xc8)[_0x9b3e('0x33')](_0x574571);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e73b169..e93389c 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x2f634a,_0x3ac1ad){var _0x1b09a2=function(_0x41595e){while(--_0x41595e){_0x2f634a['push'](_0x2f634a['shift']());}};_0x1b09a2(++_0x3ac1ad);}(_0xedd9,0xfc));var _0x9edd=function(_0x12b4fe,_0x2a28cf){_0x12b4fe=_0x12b4fe-0x0;var _0x228076=_0xedd9[_0x12b4fe];return _0x228076;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','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 46bb8f9..55702a7 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 _0xd55d=['map','model','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','options','raw','attributes','include'];(function(_0x5a9a8c,_0x4de9b2){var _0x3fd3be=function(_0x41aab8){while(--_0x41aab8){_0x5a9a8c['push'](_0x5a9a8c['shift']());}};_0x3fd3be(++_0x4de9b2);}(_0xd55d,0x162));var _0xdd55=function(_0x1da777,_0x5e46f8){_0x1da777=_0x1da777-0x0;var _0x1c7c6f=_0xd55d[_0x1da777];return _0x1c7c6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd55('0x0'));var BPromise=require('bluebird');var rs=require(_0xdd55('0x1'));var fs=require('fs');var Redis=require(_0xdd55('0x2'));var db=require(_0xdd55('0x3'))['db'];var utils=require(_0xdd55('0x4'));var logger=require(_0xdd55('0x5'))(_0xdd55('0x6'));var config=require(_0xdd55('0x7'));var jayson=require(_0xdd55('0x8'));var client=jayson[_0xdd55('0x9')][_0xdd55('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5614e3,_0x1485e3,_0x1c39e3){return new BPromise(function(_0x1e6503,_0x1605ad){return client[_0xdd55('0xb')](_0x5614e3,_0x1c39e3)[_0xdd55('0xc')](function(_0x29ec77){logger[_0xdd55('0xd')](_0xdd55('0xe'),_0x1485e3,'request\x20sent');logger[_0xdd55('0xf')](_0xdd55('0x10'),_0x1485e3,_0xdd55('0x11'),JSON[_0xdd55('0x12')](_0x29ec77));if(_0x29ec77[_0xdd55('0x13')]){if(_0x29ec77[_0xdd55('0x13')][_0xdd55('0x14')]===0x1f4){logger[_0xdd55('0x13')](_0xdd55('0xe'),_0x1485e3,_0x29ec77['error'][_0xdd55('0x15')]);return _0x1605ad(_0x29ec77[_0xdd55('0x13')]['message']);}logger[_0xdd55('0x13')](_0xdd55('0xe'),_0x1485e3,_0x29ec77[_0xdd55('0x13')][_0xdd55('0x15')]);return _0x1e6503(_0x29ec77[_0xdd55('0x13')][_0xdd55('0x15')]);}else{logger['info'](_0xdd55('0xe'),_0x1485e3,'request\x20sent');_0x1e6503(_0x29ec77[_0xdd55('0x16')][_0xdd55('0x15')]);}})[_0xdd55('0x17')](function(_0x4f77ad){logger['error'](_0xdd55('0xe'),_0x1485e3,_0x4f77ad);_0x1605ad(_0x4f77ad);});});}exports[_0xdd55('0x18')]=function(_0x538235){var _0x582280=this;return new Promise(function(_0xbdfe53,_0x5ab5be){return db[_0xdd55('0x19')]['find']({'raw':_0x538235[_0xdd55('0x1a')]?_0x538235[_0xdd55('0x1a')][_0xdd55('0x1b')]===undefined?!![]:![]:!![],'where':_0x538235[_0xdd55('0x1a')]?_0x538235['options']['where']||null:null,'attributes':_0x538235['options']?_0x538235[_0xdd55('0x1a')][_0xdd55('0x1c')]||null:null,'include':_0x538235[_0xdd55('0x1a')]?_0x538235[_0xdd55('0x1a')][_0xdd55('0x1d')]?_[_0xdd55('0x1e')](_0x538235['options'][_0xdd55('0x1d')],function(_0x5d1765){return{'model':db[_0x5d1765['model']],'as':_0x5d1765['as'],'attributes':_0x5d1765[_0xdd55('0x1c')],'include':_0x5d1765['include']?_[_0xdd55('0x1e')](_0x5d1765['include'],function(_0x3a8640){return{'model':db[_0x3a8640[_0xdd55('0x1f')]],'as':_0x3a8640['as'],'attributes':_0x3a8640[_0xdd55('0x1c')],'include':_0x3a8640[_0xdd55('0x1d')]?_['map'](_0x3a8640[_0xdd55('0x1d')],function(_0x2b1a46){return{'model':db[_0x2b1a46['model']],'as':_0x2b1a46['as'],'attributes':_0x2b1a46[_0xdd55('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdd55('0xc')](function(_0x50e38c){logger['info'](_0xdd55('0x18'),_0x538235);logger[_0xdd55('0xf')](_0xdd55('0x18'),_0x538235,JSON[_0xdd55('0x12')](_0x50e38c));_0xbdfe53(_0x50e38c);})[_0xdd55('0x17')](function(_0x3bcd25){logger['error'](_0xdd55('0x18'),_0x3bcd25[_0xdd55('0x15')],_0x538235);_0x5ab5be(_0x582280[_0xdd55('0x13')](0x1f4,_0x3bcd25[_0xdd55('0x15')]));});});}; \ No newline at end of file +var _0x0788=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x2d1599,_0x1fc8f){var _0x536be3=function(_0x188686){while(--_0x188686){_0x2d1599['push'](_0x2d1599['shift']());}};_0x536be3(++_0x1fc8f);}(_0x0788,0x133));var _0x8078=function(_0x5596e8,_0x2d6883){_0x5596e8=_0x5596e8-0x0;var _0x2f2533=_0x0788[_0x5596e8];return _0x2f2533;};'use strict';var _=require(_0x8078('0x0'));var util=require(_0x8078('0x1'));var moment=require(_0x8078('0x2'));var BPromise=require(_0x8078('0x3'));var rs=require(_0x8078('0x4'));var fs=require('fs');var Redis=require(_0x8078('0x5'));var db=require(_0x8078('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8078('0x7'))(_0x8078('0x8'));var config=require(_0x8078('0x9'));var jayson=require(_0x8078('0xa'));var client=jayson['client'][_0x8078('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219fde,_0x2732f3,_0x56a66b){return new BPromise(function(_0x34aa16,_0x14d452){return client['request'](_0x219fde,_0x56a66b)[_0x8078('0xc')](function(_0x4546a3){logger[_0x8078('0xd')](_0x8078('0xe'),_0x2732f3,_0x8078('0xf'));logger[_0x8078('0x10')](_0x8078('0x11'),_0x2732f3,'request\x20sent',JSON[_0x8078('0x12')](_0x4546a3));if(_0x4546a3[_0x8078('0x13')]){if(_0x4546a3[_0x8078('0x13')]['code']===0x1f4){logger[_0x8078('0x13')](_0x8078('0xe'),_0x2732f3,_0x4546a3['error']['message']);return _0x14d452(_0x4546a3['error'][_0x8078('0x14')]);}logger['error']('Setting,\x20%s,\x20%s',_0x2732f3,_0x4546a3[_0x8078('0x13')][_0x8078('0x14')]);return _0x34aa16(_0x4546a3[_0x8078('0x13')][_0x8078('0x14')]);}else{logger[_0x8078('0xd')](_0x8078('0xe'),_0x2732f3,_0x8078('0xf'));_0x34aa16(_0x4546a3[_0x8078('0x15')][_0x8078('0x14')]);}})[_0x8078('0x16')](function(_0x34be57){logger[_0x8078('0x13')]('Setting,\x20%s,\x20%s',_0x2732f3,_0x34be57);_0x14d452(_0x34be57);});});}exports[_0x8078('0x17')]=function(_0x4c64e4){var _0x4fe90f=this;return new Promise(function(_0x27c391,_0x5da782){return db[_0x8078('0x18')][_0x8078('0x19')]({'raw':_0x4c64e4[_0x8078('0x1a')]?_0x4c64e4[_0x8078('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4c64e4[_0x8078('0x1a')]?_0x4c64e4[_0x8078('0x1a')][_0x8078('0x1b')]||null:null,'attributes':_0x4c64e4[_0x8078('0x1a')]?_0x4c64e4['options'][_0x8078('0x1c')]||null:null,'include':_0x4c64e4['options']?_0x4c64e4[_0x8078('0x1a')][_0x8078('0x1d')]?_[_0x8078('0x1e')](_0x4c64e4[_0x8078('0x1a')][_0x8078('0x1d')],function(_0x4f4587){return{'model':db[_0x4f4587[_0x8078('0x1f')]],'as':_0x4f4587['as'],'attributes':_0x4f4587[_0x8078('0x1c')],'include':_0x4f4587[_0x8078('0x1d')]?_[_0x8078('0x1e')](_0x4f4587[_0x8078('0x1d')],function(_0x4a8391){return{'model':db[_0x4a8391[_0x8078('0x1f')]],'as':_0x4a8391['as'],'attributes':_0x4a8391['attributes'],'include':_0x4a8391[_0x8078('0x1d')]?_[_0x8078('0x1e')](_0x4a8391[_0x8078('0x1d')],function(_0x506b57){return{'model':db[_0x506b57['model']],'as':_0x506b57['as'],'attributes':_0x506b57[_0x8078('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb1dd2f){logger[_0x8078('0xd')]('ShowSetting',_0x4c64e4);logger[_0x8078('0x10')]('ShowSetting',_0x4c64e4,JSON['stringify'](_0xb1dd2f));_0x27c391(_0xb1dd2f);})[_0x8078('0x16')](function(_0x4875f5){logger['error']('ShowSetting',_0x4875f5[_0x8078('0x14')],_0x4c64e4);_0x5da782(_0x4fe90f[_0x8078('0x13')](0x1f4,_0x4875f5[_0x8078('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ea8a222..97d8356 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 _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x3064e7,_0x34edba){var _0x26038e=function(_0x35336c){while(--_0x35336c){_0x3064e7['push'](_0x3064e7['shift']());}};_0x26038e(++_0x34edba);}(_0x814b,0x1a2));var _0xb814=function(_0x1d291d,_0x17314a){_0x1d291d=_0x1d291d-0x0;var _0x44cc4e=_0x814b[_0x1d291d];return _0x44cc4e;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x2e84ee,_0x283c59){var _0x5c82d0=function(_0x9cf8ca){while(--_0x9cf8ca){_0x2e84ee['push'](_0x2e84ee['shift']());}};_0x5c82d0(++_0x283c59);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 5e7ffdf..ab186ab 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 _0x4ccb=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN'];(function(_0x465aec,_0x2fe0fd){var _0x4982cc=function(_0x4687a9){while(--_0x4687a9){_0x465aec['push'](_0x465aec['shift']());}};_0x4982cc(++_0x2fe0fd);}(_0x4ccb,0x1ab));var _0xb4cc=function(_0x591171,_0x1add7e){_0x591171=_0x591171-0x0;var _0x51f511=_0x4ccb[_0x591171];return _0x51f511;};'use strict';var Sequelize=require(_0xb4cc('0x0'));var rs=require('randomstring');module[_0xb4cc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb4cc('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xb4cc('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb4cc('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb4cc('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb4cc('0x5')](_0xb4cc('0x6'),_0xb4cc('0x7'),'connectel',_0xb4cc('0x8'),_0xb4cc('0x9'),_0xb4cc('0xa'),'bandwidth','csc',_0xb4cc('0xb'),_0xb4cc('0xc'))},'accountSid':{'type':Sequelize[_0xb4cc('0x3')]},'authId':{'type':Sequelize[_0xb4cc('0x3')]},'authToken':{'type':Sequelize[_0xb4cc('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xb4cc('0x3')]},'password':{'type':Sequelize[_0xb4cc('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xb4cc('0x3')]},'senderString':{'type':Sequelize[_0xb4cc('0x3')]},'deliveryReport':{'type':Sequelize[_0xb4cc('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xb4cc('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb4cc('0xe')],'defaultValue':function(){return _0xb4cc('0xf');}},'notificationSound':{'type':Sequelize[_0xb4cc('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb4cc('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb4cc('0xd')],'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},'baseUrl':{'type':Sequelize[_0xb4cc('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb4cc('0x10')],'comment':_0xb4cc('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xb4cc('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xdd16ca){if(!_0xdd16ca)this[_0xb4cc('0x12')](_0xb4cc('0x13'),null);this['setDataValue'](_0xb4cc('0x14'),_0xdd16ca);}}}; \ No newline at end of file +var _0xb9ff=['ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','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','randomstring','name','STRING','generate'];(function(_0x4dcac4,_0x10e48a){var _0x2a238d=function(_0x25c6fc){while(--_0x25c6fc){_0x4dcac4['push'](_0x4dcac4['shift']());}};_0x2a238d(++_0x10e48a);}(_0xb9ff,0x1b4));var _0xfb9f=function(_0xfb7636,_0x4d0595){_0xfb7636=_0xfb7636-0x0;var _0x33218d=_0xb9ff[_0xfb7636];return _0x33218d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfb9f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfb9f('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xfb9f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xfb9f('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfb9f('0x3')]();}},'phone':{'type':Sequelize[_0xfb9f('0x2')]},'type':{'type':Sequelize[_0xfb9f('0x4')](_0xfb9f('0x5'),_0xfb9f('0x6'),_0xfb9f('0x7'),_0xfb9f('0x8'),'plivo',_0xfb9f('0x9'),_0xfb9f('0xa'),_0xfb9f('0xb'),_0xfb9f('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0xfb9f('0x2')]},'authId':{'type':Sequelize[_0xfb9f('0x2')]},'authToken':{'type':Sequelize[_0xfb9f('0x2')]},'smsMethod':{'type':Sequelize[_0xfb9f('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfb9f('0x2')]},'password':{'type':Sequelize[_0xfb9f('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xfb9f('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xfb9f('0x2')]},'deliveryReport':{'type':Sequelize[_0xfb9f('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xfb9f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xfb9f('0xe')],'defaultValue':function(){return _0xfb9f('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb9f('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb9f('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb9f('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb9f('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfb9f('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb9f('0x10')],'comment':_0xfb9f('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfb9f('0x12'),'set':function(_0x1d4c8a){if(!_0x1d4c8a)this[_0xfb9f('0x13')](_0xfb9f('0x14'),null);this[_0xfb9f('0x13')](_0xfb9f('0x15'),_0x1d4c8a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 3732541..3e8d666 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 _0xc187=['request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','SmsAccounts','UserProfileResource','destroy','sendStatus','stack','name','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','getAnswers','Applications','orderBy','priority','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','DESC','omit','Contacts','contact','interaction','autoclose','push','close','unmanaged','created','SmsMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','send','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','hasOwnProperty','SmsInteraction','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','bandwidth','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','emit','userSmsAccount:save','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc187,0xb8));var _0x7c18=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc187[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c18('0x0'));var zipdir=require(_0x7c18('0x1'));var jsonpatch=require(_0x7c18('0x2'));var rp=require('request-promise');var moment=require(_0x7c18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c18('0x4'));var util=require(_0x7c18('0x5'));var path=require('path');var sox=require(_0x7c18('0x6'));var csv=require('to-csv');var ejs=require(_0x7c18('0x7'));var fs=require('fs');var fs_extra=require(_0x7c18('0x8'));var _=require(_0x7c18('0x9'));var squel=require(_0x7c18('0xa'));var crypto=require('crypto');var jsforce=require(_0x7c18('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c18('0xc'));var Papa=require(_0x7c18('0xd'));var Redis=require(_0x7c18('0xe'));var authService=require(_0x7c18('0xf'));var qs=require(_0x7c18('0x10'));var as=require(_0x7c18('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c18('0x12'))('api');var utils=require(_0x7c18('0x13'));var config=require(_0x7c18('0x14'));var licenseUtil=require(_0x7c18('0x15'));var db=require(_0x7c18('0x16'))['db'];config[_0x7c18('0x17')]=_[_0x7c18('0x18')](config[_0x7c18('0x17')],{'host':_0x7c18('0x19'),'port':0x18eb});var socket=require(_0x7c18('0x1a'))(new Redis(config[_0x7c18('0x17')]));require(_0x7c18('0x1b'))[_0x7c18('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7c18('0x1d')][_0x7c18('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4ae8d7,_0x5b9382,_0x7d93bc,_0x1c7c8c){return new BPromise(function(_0x574f7f,_0x1f5b9a){var _0x3ffce3=_0x1c7c8c||client;return _0x3ffce3[_0x7c18('0x1f')](_0x4ae8d7,_0x7d93bc)[_0x7c18('0x20')](function(_0x334761){logger[_0x7c18('0x21')](_0x7c18('0x22'),_0x5b9382,'request\x20sent');logger[_0x7c18('0x23')](_0x7c18('0x24'),_0x5b9382,_0x7c18('0x25'),JSON[_0x7c18('0x26')](_0x334761));if(_0x334761['error']){if(_0x334761[_0x7c18('0x27')][_0x7c18('0x28')]===0x1f4){logger['error'](_0x7c18('0x22'),_0x5b9382,_0x334761[_0x7c18('0x27')][_0x7c18('0x29')]);return _0x1f5b9a(_0x334761[_0x7c18('0x27')][_0x7c18('0x29')]);}logger[_0x7c18('0x27')](_0x7c18('0x22'),_0x5b9382,_0x334761['error'][_0x7c18('0x29')]);return _0x574f7f(_0x334761['error'][_0x7c18('0x29')]);}else{logger[_0x7c18('0x21')]('SmsAccount,\x20%s,\x20%s',_0x5b9382,_0x7c18('0x25'));_0x574f7f(_0x334761[_0x7c18('0x2a')]['message']);}})[_0x7c18('0x2b')](function(_0x11ca4e){logger[_0x7c18('0x27')](_0x7c18('0x22'),_0x5b9382,_0x11ca4e);_0x1f5b9a(_0x11ca4e);});});}function respondWithStatusCode(_0x39cf8d,_0x43d411){_0x43d411=_0x43d411||0xcc;return function(_0x4a9a22){if(_0x4a9a22){return _0x39cf8d['sendStatus'](_0x43d411);}return _0x39cf8d[_0x7c18('0x2c')](_0x43d411)[_0x7c18('0x2d')]();};}function respondWithResult(_0x12ddb3,_0x32d165){_0x32d165=_0x32d165||0xc8;return function(_0xe64f5d){if(_0xe64f5d){return _0x12ddb3[_0x7c18('0x2c')](_0x32d165)[_0x7c18('0x2e')](_0xe64f5d);}};}function respondWithFilteredResult(_0xf13e7b,_0x3bc3f8){return function(_0x217422){if(_0x217422){var _0x13c66f=typeof _0x3bc3f8['offset']===_0x7c18('0x2f')&&typeof _0x3bc3f8['limit']===_0x7c18('0x2f');var _0x58034a=_0x217422[_0x7c18('0x30')];var _0x8f538d=_0x13c66f?0x0:_0x3bc3f8[_0x7c18('0x31')];var _0x33e3d2=_0x13c66f?_0x217422[_0x7c18('0x30')]:_0x3bc3f8[_0x7c18('0x31')]+_0x3bc3f8[_0x7c18('0x32')];var _0x2664c1;if(_0x33e3d2>=_0x58034a){_0x33e3d2=_0x58034a;_0x2664c1=0xc8;}else{_0x2664c1=0xce;}_0xf13e7b[_0x7c18('0x2c')](_0x2664c1);return _0xf13e7b['set'](_0x7c18('0x33'),_0x8f538d+'-'+_0x33e3d2+'/'+_0x58034a)[_0x7c18('0x2e')](_0x217422);}return null;};}function patchUpdates(_0x3b0bd3){return function(_0xfc4c08){try{jsonpatch[_0x7c18('0x34')](_0xfc4c08,_0x3b0bd3,!![]);}catch(_0x4f3953){return BPromise[_0x7c18('0x35')](_0x4f3953);}return _0xfc4c08['save']();};}function saveUpdates(_0x4f0218,_0x4f1021){return function(_0x42d27b){if(_0x42d27b){return _0x42d27b[_0x7c18('0x36')](_0x4f0218)['then'](function(_0x5bec76){return _0x5bec76;});}return null;};}function removeEntity(_0x33ab42,_0x5b9af9){return function(_0x26312a){if(_0x26312a){return _0x26312a['destroy']()['then'](function(){var _0x1680dd=_0x26312a['get']({'plain':!![]});var _0x510f53=_0x7c18('0x37');return db[_0x7c18('0x38')][_0x7c18('0x39')]({'where':{'type':_0x510f53,'resourceId':_0x1680dd['id']}})['then'](function(){return _0x26312a;});})[_0x7c18('0x20')](function(){_0x33ab42['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x425263,_0xd047ea){return function(_0x31ff85){if(!_0x31ff85){_0x425263[_0x7c18('0x3a')](0x194);}return _0x31ff85;};}function handleError(_0x6918e5,_0x57f687){_0x57f687=_0x57f687||0x1f4;return function(_0x370f9f){logger[_0x7c18('0x27')](_0x370f9f[_0x7c18('0x3b')]);if(_0x370f9f[_0x7c18('0x3c')]){delete _0x370f9f[_0x7c18('0x3c')];}_0x6918e5[_0x7c18('0x2c')](_0x57f687)['send'](_0x370f9f);};}exports['index']=function(_0x5b4d08,_0x5bf0ed){var _0x561d48={'include':[{'model':db[_0x7c18('0x3d')],'as':_0x7c18('0x3e')}]},_0x5eb731={},_0x1e75e0={'count':0x0,'rows':[]};var _0x389292=_['map'](db[_0x7c18('0x3f')][_0x7c18('0x40')],function(_0x55f30c){return{'name':_0x55f30c[_0x7c18('0x41')],'type':_0x55f30c[_0x7c18('0x42')][_0x7c18('0x43')]};});_0x5eb731[_0x7c18('0x44')]=_[_0x7c18('0x45')](_0x389292,_0x7c18('0x3c'));_0x5eb731[_0x7c18('0x46')]=_[_0x7c18('0x47')](_0x5b4d08[_0x7c18('0x46')]);_0x5eb731[_0x7c18('0x48')]=_[_0x7c18('0x49')](_0x5eb731[_0x7c18('0x44')],_0x5eb731[_0x7c18('0x46')]);_0x561d48['attributes']=_[_0x7c18('0x49')](_0x5eb731['model'],qs[_0x7c18('0x4a')](_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x4a')]));_0x561d48[_0x7c18('0x4b')]=_0x561d48['attributes'][_0x7c18('0x4c')]?_0x561d48[_0x7c18('0x4b')]:_0x5eb731[_0x7c18('0x44')];if(!_0x5b4d08[_0x7c18('0x46')]['hasOwnProperty'](_0x7c18('0x4d'))){_0x561d48[_0x7c18('0x32')]=qs[_0x7c18('0x32')](_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x32')]);_0x561d48[_0x7c18('0x31')]=qs[_0x7c18('0x31')](_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x31')]);}_0x561d48[_0x7c18('0x4e')]=qs[_0x7c18('0x4f')](_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x4f')]);_0x561d48[_0x7c18('0x50')]=qs[_0x7c18('0x48')](_[_0x7c18('0x51')](_0x5b4d08[_0x7c18('0x46')],_0x5eb731[_0x7c18('0x48')]),_0x389292);if(_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x52')]){_0x561d48[_0x7c18('0x50')]=_[_0x7c18('0x53')](_0x561d48[_0x7c18('0x50')],{'$or':_[_0x7c18('0x45')](_0x389292,function(_0x3b33ba){if(_0x3b33ba['type']!==_0x7c18('0x54')){var _0x48d4cc={};_0x48d4cc[_0x3b33ba['name']]={'$like':'%'+_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x52')]+'%'};return _0x48d4cc;}})});}_0x561d48=_[_0x7c18('0x53')]({},_0x561d48,_0x5b4d08['options']);var _0x1bcf7c={'where':_0x561d48[_0x7c18('0x50')]};return db[_0x7c18('0x3f')]['count'](_0x1bcf7c)[_0x7c18('0x20')](function(_0x754f37){_0x1e75e0['count']=_0x754f37;if(_0x5b4d08[_0x7c18('0x46')][_0x7c18('0x55')]){_0x561d48['include']=[{'all':!![]}];}return db[_0x7c18('0x3f')][_0x7c18('0x56')](_0x561d48);})['then'](function(_0x257996){_0x1e75e0['rows']=_0x257996;return _0x1e75e0;})['then'](respondWithFilteredResult(_0x5bf0ed,_0x561d48))[_0x7c18('0x2b')](handleError(_0x5bf0ed,null));};exports['show']=function(_0x1ffb01,_0x49303f){var _0x1de27c={'raw':![],'where':{'id':_0x1ffb01[_0x7c18('0x57')]['id']},'include':[{'model':db[_0x7c18('0x3d')],'as':'mandatoryDispositionPause'}]},_0x762729={};_0x762729[_0x7c18('0x44')]=_[_0x7c18('0x47')](db[_0x7c18('0x3f')][_0x7c18('0x40')]);_0x762729[_0x7c18('0x46')]=_[_0x7c18('0x47')](_0x1ffb01[_0x7c18('0x46')]);_0x762729[_0x7c18('0x48')]=_[_0x7c18('0x49')](_0x762729[_0x7c18('0x44')],_0x762729['query']);_0x1de27c['attributes']=_[_0x7c18('0x49')](_0x762729['model'],qs[_0x7c18('0x4a')](_0x1ffb01[_0x7c18('0x46')][_0x7c18('0x4a')]));_0x1de27c[_0x7c18('0x4b')]=_0x1de27c[_0x7c18('0x4b')][_0x7c18('0x4c')]?_0x1de27c[_0x7c18('0x4b')]:_0x762729['model'];if(_0x1ffb01[_0x7c18('0x46')][_0x7c18('0x55')]){_0x1de27c[_0x7c18('0x58')]=[{'all':!![]}];}_0x1de27c=_[_0x7c18('0x53')]({},_0x1de27c,_0x1ffb01[_0x7c18('0x59')]);return db['SmsAccount'][_0x7c18('0x5a')](_0x1de27c)['then'](handleEntityNotFound(_0x49303f,null))[_0x7c18('0x20')](respondWithResult(_0x49303f,null))['catch'](handleError(_0x49303f,null));};exports[_0x7c18('0x5b')]=function(_0xe7d611,_0x5e9fb2){return db[_0x7c18('0x3f')]['create'](_0xe7d611[_0x7c18('0x5c')],{})[_0x7c18('0x20')](function(_0x55f4a1){var _0x465851=_0xe7d611[_0x7c18('0x5d')]['get']({'plain':!![]});if(!_0x465851)throw new Error(_0x7c18('0x5e'));if(_0x465851[_0x7c18('0x5f')]==='user'){var _0x3090cb=_0x55f4a1[_0x7c18('0x60')]({'plain':!![]});var _0x486c57=_0x7c18('0x37');return db[_0x7c18('0x61')]['find']({'where':{'name':_0x486c57,'userProfileId':_0x465851[_0x7c18('0x62')]},'raw':!![]})[_0x7c18('0x20')](function(_0x51e803){if(_0x51e803&&_0x51e803[_0x7c18('0x63')]===0x0){return db['UserProfileResource'][_0x7c18('0x5b')]({'name':_0x3090cb[_0x7c18('0x3c')],'resourceId':_0x3090cb['id'],'type':_0x51e803[_0x7c18('0x3c')],'sectionId':_0x51e803['id']},{})[_0x7c18('0x20')](function(){return _0x55f4a1;});}else{return _0x55f4a1;}})['catch'](function(_0x2d2775){logger[_0x7c18('0x27')](_0x7c18('0x64'),_0x2d2775);throw _0x2d2775;});}return _0x55f4a1;})[_0x7c18('0x20')](respondWithResult(_0x5e9fb2,0xc9))[_0x7c18('0x2b')](handleError(_0x5e9fb2,null));};exports['update']=function(_0x14333a,_0x3e07a0){if(_0x14333a['body']['id']){delete _0x14333a[_0x7c18('0x5c')]['id'];}return db[_0x7c18('0x3f')][_0x7c18('0x5a')]({'where':{'id':_0x14333a[_0x7c18('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x7c18('0x20')](handleEntityNotFound(_0x3e07a0,null))[_0x7c18('0x20')](saveUpdates(_0x14333a[_0x7c18('0x5c')],null))[_0x7c18('0x20')](respondWithResult(_0x3e07a0,null))[_0x7c18('0x2b')](handleError(_0x3e07a0,null));};exports[_0x7c18('0x39')]=function(_0x2475f8,_0x1412d2){return db['SmsAccount'][_0x7c18('0x5a')]({'where':{'id':_0x2475f8['params']['id']}})['then'](handleEntityNotFound(_0x1412d2,null))[_0x7c18('0x20')](removeEntity(_0x1412d2,null))[_0x7c18('0x2b')](handleError(_0x1412d2,null));};exports[_0x7c18('0x65')]=function(_0x5c9278,_0x5ad530){return db[_0x7c18('0x3f')]['describe']()['then'](respondWithResult(_0x5ad530,null))[_0x7c18('0x2b')](handleError(_0x5ad530,null));};exports[_0x7c18('0x66')]=function(_0x45bcd2,_0x45a3b0,_0x13b812){if(_0x45bcd2[_0x7c18('0x5c')]['id']){delete _0x45bcd2[_0x7c18('0x5c')]['id'];}return db['SmsAccount'][_0x7c18('0x5a')]({'where':{'id':_0x45bcd2[_0x7c18('0x57')]['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x45a3b0,null))[_0x7c18('0x20')](function(_0x590fcc){if(_0x590fcc){_0x45bcd2[_0x7c18('0x5c')][_0x7c18('0x67')]=_0x590fcc['id'];return db[_0x7c18('0x68')][_0x7c18('0x5b')](_0x45bcd2[_0x7c18('0x5c')]);}})[_0x7c18('0x20')](respondWithResult(_0x45a3b0,null))[_0x7c18('0x2b')](handleError(_0x45a3b0,null));};exports[_0x7c18('0x69')]=function(_0x524d3f,_0x3df78d,_0xee1f1f){var _0x59e2ed={'raw':![],'where':{}};var _0x1b00c6={};var _0x1036a5={'count':0x0,'rows':[]};return db[_0x7c18('0x3f')][_0x7c18('0x6a')]({'where':{'id':_0x524d3f[_0x7c18('0x57')]['id']}})['then'](handleEntityNotFound(_0x3df78d,null))[_0x7c18('0x20')](function(_0x1ef77f){if(_0x1ef77f){_0x1b00c6[_0x7c18('0x44')]=_[_0x7c18('0x47')](db[_0x7c18('0x68')][_0x7c18('0x40')]);_0x1b00c6[_0x7c18('0x46')]=_[_0x7c18('0x47')](_0x524d3f['query']);_0x1b00c6['filters']=_[_0x7c18('0x49')](_0x1b00c6[_0x7c18('0x44')],_0x1b00c6[_0x7c18('0x46')]);_0x59e2ed[_0x7c18('0x4b')]=_['intersection'](_0x1b00c6[_0x7c18('0x44')],qs['fields'](_0x524d3f['query'][_0x7c18('0x4a')]));_0x59e2ed[_0x7c18('0x4b')]=_0x59e2ed['attributes'][_0x7c18('0x4c')]?_0x59e2ed[_0x7c18('0x4b')]:_0x1b00c6[_0x7c18('0x44')];if(!_0x524d3f['query']['hasOwnProperty'](_0x7c18('0x4d'))){_0x59e2ed[_0x7c18('0x32')]=qs['limit'](_0x524d3f['query'][_0x7c18('0x32')]);_0x59e2ed[_0x7c18('0x31')]=qs[_0x7c18('0x31')](_0x524d3f[_0x7c18('0x46')][_0x7c18('0x31')]);}_0x59e2ed[_0x7c18('0x4e')]=qs[_0x7c18('0x4f')](_0x524d3f[_0x7c18('0x46')][_0x7c18('0x4f')]);_0x59e2ed[_0x7c18('0x50')]=qs[_0x7c18('0x48')](_[_0x7c18('0x51')](_0x524d3f[_0x7c18('0x46')],_0x1b00c6[_0x7c18('0x48')]));_0x59e2ed[_0x7c18('0x50')]['SmsAccountId']=_0x1ef77f['id'];if(_0x524d3f[_0x7c18('0x46')]['filter']){_0x59e2ed[_0x7c18('0x50')]=_['merge'](_0x59e2ed[_0x7c18('0x50')],{'$or':_['map'](_0x59e2ed[_0x7c18('0x4b')],function(_0x128d84){var _0x3702d3={};_0x3702d3[_0x128d84]={'$like':'%'+_0x524d3f['query'][_0x7c18('0x52')]+'%'};return _0x3702d3;})});}_0x59e2ed=_[_0x7c18('0x53')]({},_0x59e2ed,_0x524d3f[_0x7c18('0x59')]);return db['Disposition'][_0x7c18('0x30')]({'where':_0x59e2ed[_0x7c18('0x50')]})['then'](function(_0x4c30a2){_0x1036a5[_0x7c18('0x30')]=_0x4c30a2;if(_0x524d3f[_0x7c18('0x46')][_0x7c18('0x55')]){_0x59e2ed['include']=[{'all':!![]}];}return db[_0x7c18('0x68')][_0x7c18('0x56')](_0x59e2ed);})['then'](function(_0xb722e5){_0x1036a5[_0x7c18('0x6b')]=_0xb722e5;return _0x1036a5;});}})[_0x7c18('0x20')](respondWithFilteredResult(_0x3df78d,_0x59e2ed))['catch'](handleError(_0x3df78d,null));};exports[_0x7c18('0x6c')]=function(_0x2197fa,_0xbd8e11,_0xc1cf51){return db[_0x7c18('0x3f')][_0x7c18('0x5a')]({'where':{'id':_0x2197fa[_0x7c18('0x57')]['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0xbd8e11,null))[_0x7c18('0x20')](function(_0x492357){if(_0x492357){return _0x492357[_0x7c18('0x6c')](_0x2197fa[_0x7c18('0x46')][_0x7c18('0x6d')]);}})[_0x7c18('0x20')](respondWithStatusCode(_0xbd8e11,null))[_0x7c18('0x2b')](handleError(_0xbd8e11,null));};exports['addAnswer']=function(_0x3bd0a7,_0x72403f,_0x2eb4ee){if(_0x3bd0a7[_0x7c18('0x5c')]['id']){delete _0x3bd0a7[_0x7c18('0x5c')]['id'];}return db['SmsAccount'][_0x7c18('0x5a')]({'where':{'id':_0x3bd0a7[_0x7c18('0x57')]['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x72403f,null))[_0x7c18('0x20')](function(_0x3eba40){if(_0x3eba40){_0x3bd0a7[_0x7c18('0x5c')][_0x7c18('0x67')]=_0x3eba40['id'];return db[_0x7c18('0x6e')][_0x7c18('0x5b')](_0x3bd0a7['body']);}})[_0x7c18('0x20')](respondWithResult(_0x72403f,null))[_0x7c18('0x2b')](handleError(_0x72403f,null));};exports[_0x7c18('0x6f')]=function(_0x167e30,_0xb30dfc,_0x298abc){var _0x49af51={'raw':![],'where':{}};var _0x259cb6={};var _0x1c67a0={'count':0x0,'rows':[]};return db[_0x7c18('0x3f')][_0x7c18('0x6a')]({'where':{'id':_0x167e30['params']['id']}})['then'](handleEntityNotFound(_0xb30dfc,null))[_0x7c18('0x20')](function(_0x28bf21){if(_0x28bf21){_0x259cb6[_0x7c18('0x44')]=_[_0x7c18('0x47')](db['CannedAnswer'][_0x7c18('0x40')]);_0x259cb6[_0x7c18('0x46')]=_[_0x7c18('0x47')](_0x167e30['query']);_0x259cb6[_0x7c18('0x48')]=_[_0x7c18('0x49')](_0x259cb6[_0x7c18('0x44')],_0x259cb6[_0x7c18('0x46')]);_0x49af51['attributes']=_[_0x7c18('0x49')](_0x259cb6[_0x7c18('0x44')],qs['fields'](_0x167e30[_0x7c18('0x46')]['fields']));_0x49af51[_0x7c18('0x4b')]=_0x49af51['attributes'][_0x7c18('0x4c')]?_0x49af51[_0x7c18('0x4b')]:_0x259cb6['model'];if(!_0x167e30[_0x7c18('0x46')]['hasOwnProperty'](_0x7c18('0x4d'))){_0x49af51['limit']=qs[_0x7c18('0x32')](_0x167e30[_0x7c18('0x46')][_0x7c18('0x32')]);_0x49af51['offset']=qs['offset'](_0x167e30[_0x7c18('0x46')]['offset']);}_0x49af51[_0x7c18('0x4e')]=qs[_0x7c18('0x4f')](_0x167e30[_0x7c18('0x46')][_0x7c18('0x4f')]);_0x49af51['where']=qs[_0x7c18('0x48')](_['pick'](_0x167e30[_0x7c18('0x46')],_0x259cb6[_0x7c18('0x48')]));_0x49af51[_0x7c18('0x50')][_0x7c18('0x67')]=_0x28bf21['id'];if(_0x167e30[_0x7c18('0x46')][_0x7c18('0x52')]){_0x49af51['where']=_[_0x7c18('0x53')](_0x49af51[_0x7c18('0x50')],{'$or':_[_0x7c18('0x45')](_0x49af51[_0x7c18('0x4b')],function(_0x11bf85){var _0x256fc8={};_0x256fc8[_0x11bf85]={'$like':'%'+_0x167e30['query'][_0x7c18('0x52')]+'%'};return _0x256fc8;})});}_0x49af51=_[_0x7c18('0x53')]({},_0x49af51,_0x167e30[_0x7c18('0x59')]);return db['CannedAnswer']['count']({'where':_0x49af51[_0x7c18('0x50')]})['then'](function(_0x17bfeb){_0x1c67a0['count']=_0x17bfeb;if(_0x167e30['query']['includeAll']){_0x49af51['include']=[{'all':!![]}];}return db[_0x7c18('0x6e')][_0x7c18('0x56')](_0x49af51);})[_0x7c18('0x20')](function(_0x53fbe4){_0x1c67a0[_0x7c18('0x6b')]=_0x53fbe4;return _0x1c67a0;});}})['then'](respondWithFilteredResult(_0xb30dfc,_0x49af51))[_0x7c18('0x2b')](handleError(_0xb30dfc,null));};exports['removeAnswers']=function(_0x28a267,_0x55b0bd,_0x2fc1e4){return db[_0x7c18('0x3f')][_0x7c18('0x5a')]({'where':{'id':_0x28a267[_0x7c18('0x57')]['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x55b0bd,null))[_0x7c18('0x20')](function(_0x4df3c5){if(_0x4df3c5){return _0x4df3c5['removeAnswers'](_0x28a267[_0x7c18('0x46')][_0x7c18('0x6d')]);}})['then'](respondWithStatusCode(_0x55b0bd,null))[_0x7c18('0x2b')](handleError(_0x55b0bd,null));};exports['notify']=function(_0x3a23b1,_0x3ba2dd,_0x36d11c){var _0x2e1998={'channel':'sms'};var _0x2b673f=[];var _0x286f16=[];var _0x2417da={};return db['SmsAccount'][_0x7c18('0x5a')]({'where':{'id':_0x3a23b1[_0x7c18('0x57')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x7c18('0x70')}]})[_0x7c18('0x20')](handleEntityNotFound(_0x3ba2dd,null))['then'](function(_0x4f0d2d){_0x2e1998['account']=_0x4f0d2d;_0x2e1998['applications']=_[_0x7c18('0x71')](_0x4f0d2d[_0x7c18('0x70')],[_0x7c18('0x72')],['asc']);if(_0x2e1998[_0x7c18('0x73')][_0x7c18('0x70')]){delete _0x2e1998[_0x7c18('0x73')][_0x7c18('0x70')];}return db[_0x7c18('0x74')][_0x7c18('0x65')]();})['then'](function(_0x16d8e6){if(!_0x16d8e6){throw new db[(_0x7c18('0x75'))][(_0x7c18('0x76'))](_0x7c18('0x77'));}_0x2b673f=_['difference'](_[_0x7c18('0x47')](_0x16d8e6),['createdAt',_0x7c18('0x78')]);_0x286f16=_['difference'](_[_0x7c18('0x47')](_0x16d8e6),[_0x7c18('0x79'),_0x7c18('0x78'),_0x7c18('0x7a'),_0x7c18('0x7b')]);_0x2e1998[_0x7c18('0x5c')]={'mapKey':_0x7c18('0x7c')};if(_0x2e1998[_0x7c18('0x73')][_0x7c18('0x42')]){switch(_0x2e1998['account'][_0x7c18('0x42')]){case _0x7c18('0x7d'):_0x2e1998['body'][_0x7c18('0x7e')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x7f')];_0x2e1998['body'][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x80')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x81')]=_0x3a23b1['body']['MessageSid'];break;case _0x7c18('0x82'):_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')]='+'+_0x3a23b1['body'][_0x7c18('0x83')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x84')];break;case _0x7c18('0x85'):_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x7e')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')]['message'];break;case _0x7c18('0x86'):_0x2e1998['body'][_0x7c18('0x7e')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x7e')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x5c')];_0x2e1998['body'][_0x7c18('0x81')]=_0x3a23b1['body'][_0x7c18('0x87')];break;case _0x7c18('0x88'):_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x7f')];_0x2e1998['body'][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')]['Text'];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x81')]=_0x3a23b1['body'][_0x7c18('0x89')];break;case _0x7c18('0x8a'):_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')]='+'+_0x3a23b1[_0x7c18('0x5c')]['results'][0x0][_0x7c18('0x7e')];_0x2e1998[_0x7c18('0x5c')]['body']=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x8b')][0x0][_0x7c18('0x84')];_0x2e1998[_0x7c18('0x5c')]['messageId']=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x8b')][0x0][_0x7c18('0x81')];break;case _0x7c18('0x8c'):_0x2e1998['body'][_0x7c18('0x7e')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x8d')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x8e')]['message'];break;case'clickatell':_0x2e1998[_0x7c18('0x5c')]['from']=_0x3a23b1['body']['fromNumber'];_0x2e1998[_0x7c18('0x5c')]['body']=_0x3a23b1[_0x7c18('0x5c')]['text'];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x81')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x8f')];break;case'bandwidth':_0x2e1998['body'][_0x7c18('0x81')]=_0x3a23b1['body'][0x0][_0x7c18('0x29')]['id'];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')]=_0x3a23b1['body'][0x0][_0x7c18('0x29')][_0x7c18('0x7e')];_0x2e1998[_0x7c18('0x5c')]['body']=_0x3a23b1[_0x7c18('0x5c')][0x0]['message'][_0x7c18('0x84')];break;case _0x7c18('0x90'):_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x7e')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x29')];_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x81')]=_0x3a23b1[_0x7c18('0x5c')][_0x7c18('0x91')];break;}}if(_0x2e1998[_0x7c18('0x5c')]['id']){delete _0x2e1998[_0x7c18('0x5c')]['id'];}if(_[_0x7c18('0x92')](_0x2e1998['body'][_0x7c18('0x7e')])){throw new db[(_0x7c18('0x75'))][(_0x7c18('0x76'))](_0x7c18('0x93'));}if(_[_0x7c18('0x92')](_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')])||_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')]===''){throw new db[(_0x7c18('0x75'))][(_0x7c18('0x76'))](_0x7c18('0x94'));}if(_['isNil'](_0x2e1998[_0x7c18('0x5c')]['mapKey'])){throw new db[(_0x7c18('0x75'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x286f16);}if(!_['includes'](_0x286f16,_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x95')])){throw new db[(_0x7c18('0x75'))][(_0x7c18('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x286f16);}_0x2417da[_0x2e1998['body']['mapKey']]=_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')];return db[_0x7c18('0x96')][_0x7c18('0x5a')]({'where':{'id':_0x2e1998[_0x7c18('0x73')][_0x7c18('0x7b')]},'include':[{'model':db[_0x7c18('0x74')],'as':'Contacts','where':_0x2417da,'limit':0x1,'order':[[_0x7c18('0x78'),_0x7c18('0x97')]]}]});})['then'](handleEntityNotFound(_0x3ba2dd,null))[_0x7c18('0x20')](function(_0x21a758){if(_0x21a758){_0x2e1998['list']=_[_0x7c18('0x98')](_0x21a758,[_0x7c18('0x99')]);if(_0x21a758[_0x7c18('0x99')][_0x7c18('0x4c')]){return _0x21a758[_0x7c18('0x99')][0x0];}var _0x171d46=_[_0x7c18('0x18')](_0x2e1998[_0x7c18('0x5c')],{'firstName':_0x2e1998[_0x7c18('0x5c')]['from'],'ListId':_0x21a758['id']});_0x171d46[_0x2e1998[_0x7c18('0x5c')]['mapKey']]=_0x2e1998[_0x7c18('0x5c')]['from'];return db[_0x7c18('0x74')][_0x7c18('0x5b')](_0x171d46,{'fields':_0x2b673f,'raw':!![]});}})['then'](handleEntityNotFound(_0x3ba2dd,null))[_0x7c18('0x20')](function(_0x56d259){if(_0x56d259){_0x2e1998[_0x7c18('0x9a')]=_0x56d259;var _0x27d5c1={'ContactId':_0x56d259['id'],'phone':_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')],'SmsAccountId':_0x3a23b1[_0x7c18('0x57')]['id']};var _0x593165={'ContactId':_0x56d259['id'],'SmsAccountId':_0x3a23b1[_0x7c18('0x57')]['id'],'closed':![]};return db['SmsInteraction'][_0x7c18('0x5a')]({'where':_0x593165})[_0x7c18('0x20')](function(_0x48c763){if(_0x48c763){return[_0x48c763,![]];}return db['SmsInteraction'][_0x7c18('0x5b')](_0x27d5c1)[_0x7c18('0x20')](function(_0x4fcad7){return[_0x4fcad7,!![]];});});}})['spread'](function(_0x3fb410,_0x4d51f0){_0x2e1998[_0x7c18('0x9b')]=_0x3fb410[_0x7c18('0x60')]({'plain':!![]});_0x2e1998[_0x7c18('0x9b')]['created']=![];if(_0x4d51f0){if(_0x2e1998[_0x7c18('0x73')][_0x7c18('0x9c')]){_0x2e1998['applications'][_0x7c18('0x9d')]({'id':0x0,'priority':_0x2e1998['applications']['length']+0x1,'app':_0x7c18('0x9e'),'appdata':_0x7c18('0x9f'),'interval':'*,*,*,*'});}_0x2e1998[_0x7c18('0x9b')][_0x7c18('0xa0')]=!![];}return db[_0x7c18('0xa1')][_0x7c18('0x5b')]({'phone':_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x7e')],'messageId':_0x2e1998[_0x7c18('0x5c')]['messageId'],'body':_0x2e1998[_0x7c18('0x5c')][_0x7c18('0x5c')],'SmsAccountId':_0x3a23b1['params']['id'],'SmsInteractionId':_0x3fb410['id'],'direction':'in','ContactId':_0x3fb410['ContactId'],'AttachmentId':_0x2e1998['body']['AttachmentId']});})[_0x7c18('0x20')](function(_0x2e0aac){_0x2e1998[_0x7c18('0x29')]=_0x2e0aac;if(_0x2e1998[_0x7c18('0x9b')][_0x7c18('0xa2')]){return db[_0x7c18('0xa3')][_0x7c18('0x5a')]({'attributes':['id','name'],'where':{'id':_0x2e1998['interaction'][_0x7c18('0xa2')]}})[_0x7c18('0x20')](function(_0x33b059){if(_0x33b059){_0x2e1998['applications'][_0x7c18('0xa4')]({'id':0x0,'priority':0x0,'app':_0x7c18('0xa5'),'appdata':_0x33b059[_0x7c18('0x3c')]+','+(_0x2e1998[_0x7c18('0x73')][_0x7c18('0xa6')]||0xa),'interval':_0x7c18('0xa7')});}return respondWithRpcPromise('Start',_0x7c18('0xa8'),_0x2e1998);});}return respondWithRpcPromise('Start',_0x7c18('0xa8'),_0x2e1998);})['then'](function(_0x442a96){if(_0x442a96){var _0x12f0c3=0xc8;var _0xd4120e='receiveMessage';logger[_0x7c18('0x21')](_0x7c18('0x24'),_0xd4120e,_0x12f0c3,_0x7c18('0xa9'));logger[_0x7c18('0x23')](_0x7c18('0xaa'),_0xd4120e,_0x12f0c3,'entity\x20found',JSON[_0x7c18('0x26')](_0x442a96));if(_0x2e1998[_0x7c18('0x73')][_0x7c18('0x42')]===_0x7c18('0x7d')){return _0x3ba2dd[_0x7c18('0x2c')](_0x12f0c3)[_0x7c18('0xab')](_0x7c18('0xac'),_0x7c18('0xad'))[_0x7c18('0xae')]('\x0a');}else{return _0x3ba2dd['status'](_0x12f0c3)[_0x7c18('0x2e')](_0x442a96);}}})['catch'](handleError(_0x3ba2dd,null));};exports[_0x7c18('0xaf')]=function(_0x30b0af,_0x1db888){var _0xe6bff1=_0x30b0af['params']['id'];var _0x29d187=_0x30b0af[_0x7c18('0x5c')];var _0xce10a4=0xc8;var _0x45bc56=null;return db[_0x7c18('0xb0')][_0x7c18('0xb1')]({'isolationLevel':db[_0x7c18('0xb0')][_0x7c18('0xb2')][_0x7c18('0xb3')][_0x7c18('0xb4')]},function(_0x9c041a){return db[_0x7c18('0x3f')][_0x7c18('0x6a')]({'where':{'id':_0xe6bff1},'transaction':_0x9c041a})[_0x7c18('0x20')](function(_0xb5e290){if(_0xb5e290){return db[_0x7c18('0xb5')][_0x7c18('0x39')]({'where':{'SmsAccountId':_0xe6bff1},'transaction':_0x9c041a})[_0x7c18('0x20')](function(){var _0x46ae10=_[_0x7c18('0x45')](_0x29d187,function(_0x47b38a){_0x47b38a[_0x7c18('0x67')]=_0xe6bff1;return _0x47b38a;});return db[_0x7c18('0xb5')][_0x7c18('0xb6')](_0x46ae10,{'transaction':_0x9c041a});});}else{_0xce10a4=0x194;_0x45bc56=[];}});})[_0x7c18('0x20')](function(){if(_0xce10a4!==0x194){return db[_0x7c18('0xb5')][_0x7c18('0xb7')]({'where':{'SmsAccountId':_0xe6bff1},'order':_0x7c18('0x72')})[_0x7c18('0x20')](function(_0x4dd304){_0x45bc56=_0x4dd304;});}})[_0x7c18('0x2b')](function(_0x1b3a8a){_0xce10a4=0x1f4;logger[_0x7c18('0x27')](_0x1b3a8a['stack']);if(_0x1b3a8a[_0x7c18('0x3c')]){delete _0x1b3a8a[_0x7c18('0x3c')];}_0x45bc56=_0x1b3a8a;})[_0x7c18('0xb8')](function(){if(_0x45bc56===null){_0x1db888[_0x7c18('0x3a')](_0xce10a4);}else{if(_0xce10a4===0x1f4){_0x1db888[_0x7c18('0x2c')](_0xce10a4)[_0x7c18('0xae')](_0x45bc56);}else{_0x1db888[_0x7c18('0x2c')](_0xce10a4)['json'](_0x45bc56);}}});};exports[_0x7c18('0xb9')]=function(_0x29d806,_0x5bd608,_0x41a068){var _0x52a649={};var _0x1e605f={};var _0x73397;var _0x51279c;return db[_0x7c18('0x3f')]['findOne']({'where':{'id':_0x29d806[_0x7c18('0x57')]['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x5bd608,null))[_0x7c18('0x20')](function(_0x56b44c){if(_0x56b44c){_0x73397=_0x56b44c;_0x1e605f['model']=_[_0x7c18('0x47')](db[_0x7c18('0xb5')]['rawAttributes']);_0x1e605f[_0x7c18('0x46')]=_[_0x7c18('0x47')](_0x29d806[_0x7c18('0x46')]);_0x1e605f[_0x7c18('0x48')]=_['intersection'](_0x1e605f[_0x7c18('0x44')],_0x1e605f[_0x7c18('0x46')]);_0x52a649['attributes']=_['intersection'](_0x1e605f[_0x7c18('0x44')],qs[_0x7c18('0x4a')](_0x29d806[_0x7c18('0x46')]['fields']));_0x52a649[_0x7c18('0x4b')]=_0x52a649['attributes'][_0x7c18('0x4c')]?_0x52a649[_0x7c18('0x4b')]:_0x1e605f['model'];_0x52a649[_0x7c18('0x4e')]=qs['sort'](_0x29d806['query'][_0x7c18('0x4f')]);_0x52a649[_0x7c18('0x50')]=qs[_0x7c18('0x48')](_['pick'](_0x29d806['query'],_0x1e605f[_0x7c18('0x48')]));if(_0x29d806[_0x7c18('0x46')][_0x7c18('0x52')]){_0x52a649['where']=_['merge'](_0x52a649[_0x7c18('0x50')],{'$or':_[_0x7c18('0x45')](_0x52a649['attributes'],function(_0x5b0287){var _0x587acb={};_0x587acb[_0x5b0287]={'$like':'%'+_0x29d806[_0x7c18('0x46')][_0x7c18('0x52')]+'%'};return _0x587acb;})});}_0x52a649=_['merge']({},_0x52a649,_0x29d806[_0x7c18('0x59')]);return _0x73397[_0x7c18('0xb9')](_0x52a649);}})[_0x7c18('0x20')](function(_0x5f3bac){if(_0x5f3bac){_0x51279c=_0x5f3bac[_0x7c18('0x4c')];if(!_0x29d806[_0x7c18('0x46')][_0x7c18('0xba')](_0x7c18('0x4d'))){_0x52a649['limit']=qs['limit'](_0x29d806['query'][_0x7c18('0x32')]);_0x52a649[_0x7c18('0x31')]=qs[_0x7c18('0x31')](_0x29d806[_0x7c18('0x46')][_0x7c18('0x31')]);}return _0x73397['getApplications'](_0x52a649);}})[_0x7c18('0x20')](function(_0x409d4e){if(_0x409d4e){return _0x409d4e?{'count':_0x51279c,'rows':_0x409d4e}:null;}})[_0x7c18('0x20')](respondWithResult(_0x5bd608,null))[_0x7c18('0x2b')](handleError(_0x5bd608,null));};exports['getInteractions']=function(_0x44e45d,_0x12d652,_0x60ddd2){var _0xf27d02={'raw':![],'where':{}};var _0x413574={};var _0x1d0ce2={'count':0x0,'rows':[]};return db[_0x7c18('0x3f')][_0x7c18('0x6a')]({'where':{'id':_0x44e45d[_0x7c18('0x57')]['id']}})['then'](handleEntityNotFound(_0x12d652,null))['then'](function(_0x1d8e3a){if(_0x1d8e3a){_0x413574['model']=_['keys'](db[_0x7c18('0xbb')][_0x7c18('0x40')]);_0x413574[_0x7c18('0x46')]=_[_0x7c18('0x47')](_0x44e45d[_0x7c18('0x46')]);_0x413574['filters']=_[_0x7c18('0x49')](_0x413574['model'],_0x413574[_0x7c18('0x46')]);_0xf27d02['attributes']=_[_0x7c18('0x49')](_0x413574[_0x7c18('0x44')],qs['fields'](_0x44e45d[_0x7c18('0x46')]['fields']));_0xf27d02['attributes']=_0xf27d02[_0x7c18('0x4b')]['length']?_0xf27d02[_0x7c18('0x4b')]:_0x413574[_0x7c18('0x44')];if(!_0x44e45d[_0x7c18('0x46')][_0x7c18('0xba')](_0x7c18('0x4d'))){_0xf27d02['limit']=qs[_0x7c18('0x32')](_0x44e45d['query'][_0x7c18('0x32')]);_0xf27d02[_0x7c18('0x31')]=qs[_0x7c18('0x31')](_0x44e45d['query'][_0x7c18('0x31')]);}_0xf27d02[_0x7c18('0x4e')]=qs['sort'](_0x44e45d[_0x7c18('0x46')][_0x7c18('0x4f')]);_0xf27d02[_0x7c18('0x50')]=qs['filters'](_[_0x7c18('0x51')](_0x44e45d[_0x7c18('0x46')],_0x413574[_0x7c18('0x48')]));_0xf27d02[_0x7c18('0x50')][_0x7c18('0x67')]=_0x1d8e3a['id'];if(_0x44e45d[_0x7c18('0x46')][_0x7c18('0x52')]){_0xf27d02[_0x7c18('0x50')]=_[_0x7c18('0x53')](_0xf27d02[_0x7c18('0x50')],{'$or':_[_0x7c18('0x45')](_0xf27d02[_0x7c18('0x4b')],function(_0x137cdd){var _0x390f77={};_0x390f77[_0x137cdd]={'$like':'%'+_0x44e45d[_0x7c18('0x46')][_0x7c18('0x52')]+'%'};return _0x390f77;})});}_0xf27d02=_['merge']({},_0xf27d02,_0x44e45d[_0x7c18('0x59')]);return db[_0x7c18('0xbb')][_0x7c18('0x30')]({'where':_0xf27d02[_0x7c18('0x50')]})['then'](function(_0x6bf5af){_0x1d0ce2['count']=_0x6bf5af;if(_0x44e45d['query'][_0x7c18('0x55')]){_0xf27d02['include']=[{'model':db[_0x7c18('0x74')],'as':_0x7c18('0xbc'),'required':![]},{'model':db[_0x7c18('0xa3')],'as':_0x7c18('0xbd'),'attributes':['name','fullname',_0x7c18('0xbe')],'required':![]},{'model':db[_0x7c18('0xbf')],'as':_0x7c18('0xc0'),'attributes':['id',_0x7c18('0x3c'),_0x7c18('0xc1')],'where':_0x44e45d['query']['tag']?{'id':_0x44e45d[_0x7c18('0x46')][_0x7c18('0xc2')]}:undefined,'required':_0x44e45d['query'][_0x7c18('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x7c18('0x56')](_0xf27d02);})['then'](function(_0x2ed688){_0x1d0ce2[_0x7c18('0x6b')]=_0x2ed688;return _0x1d0ce2;});}})[_0x7c18('0x20')](respondWithFilteredResult(_0x12d652,_0xf27d02))[_0x7c18('0x2b')](handleError(_0x12d652,null));};exports['send']=function(_0x4da01a,_0x367445,_0x1dc3c5){var _0xaa69fc,_0x1d826b,_0x4e8b3c;if(_['isNil'](_0x4da01a['body']['body'])||_0x4da01a[_0x7c18('0x5c')][_0x7c18('0x5c')]===''){throw new db[(_0x7c18('0x75'))]['ValidationError'](_0x7c18('0x94'));}if(_['isNil'](_0x4da01a[_0x7c18('0x5c')]['to'])){throw new db[(_0x7c18('0x75'))][(_0x7c18('0x76'))](_0x7c18('0xc3'));}_0xaa69fc=_0x4da01a['body']['to'];return db[_0x7c18('0x3f')][_0x7c18('0x5a')]({'where':{'id':_0x4da01a['params']['id']},'include':[{'model':db[_0x7c18('0x96')],'as':_0x7c18('0xc4'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0xaa69fc},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x7c18('0x20')](handleEntityNotFound(_0x367445,null))[_0x7c18('0x20')](function(_0x299727){if(_0x299727&&_0x299727[_0x7c18('0xc4')]){_0x1d826b=_0x299727[_0x7c18('0x60')]({'plain':!![]});if(_0x1d826b['List']&&_0x1d826b[_0x7c18('0xc4')]['Contacts']['length']){return _0x1d826b[_0x7c18('0xc4')][_0x7c18('0x99')][0x0];}return db['CmContact'][_0x7c18('0x5b')](_['defaults'](_0x4da01a[_0x7c18('0x5c')],{'firstName':_0xaa69fc,'mobile':_0xaa69fc,'phone':_0xaa69fc,'ListId':_0x1d826b[_0x7c18('0x7b')]}));}})['then'](handleEntityNotFound(_0x367445,null))[_0x7c18('0x20')](function(_0x434096){if(_0x434096){_0x4e8b3c=_0x434096;return db['SmsInteraction'][_0x7c18('0x5a')]({'where':{'ContactId':_0x4e8b3c['id'],'closed':![],'SmsAccountId':_0x1d826b['id']}})[_0x7c18('0x20')](function(_0x42c1c2){if(_0x42c1c2){return[_0x42c1c2,![]];}return db[_0x7c18('0xbb')][_0x7c18('0x5b')]({'UserId':_0x4da01a[_0x7c18('0x5d')]['id'],'ContactId':_0x4e8b3c['id'],'SmsAccountId':_0x1d826b['id'],'phone':_0xaa69fc,'firstMsgDirection':'out','Messages':[_['merge'](_0x4da01a[_0x7c18('0x5c')],{'read':![],'body':_0x4da01a[_0x7c18('0x5c')][_0x7c18('0x5c')],'phone':_0xaa69fc,'SmsAccountId':_0x1d826b['id'],'UserId':_0x4da01a[_0x7c18('0x5d')]['id'],'ContactId':_0x4e8b3c['id']})]},{'include':[{'model':db[_0x7c18('0xa1')],'as':_0x7c18('0xc5')}]})[_0x7c18('0x20')](function(_0x1bcb1f){return[_0x1bcb1f,!![]];});});}})['spread'](function(_0x567d13,_0x11447e){if(_0x11447e){return _0x567d13;}return db['SmsMessage']['create'](_['merge'](_0x4da01a[_0x7c18('0x5c')],{'read':![],'body':_0x4da01a[_0x7c18('0x5c')][_0x7c18('0x5c')],'phone':_0xaa69fc,'SmsAccountId':_0x1d826b['id'],'SmsInteractionId':_0x567d13['id'],'UserId':_0x4da01a['user']['id'],'ContactId':_0x4e8b3c['id']}))[_0x7c18('0x20')](function(_0x279eae){_0x567d13[_0x7c18('0xc6')]['Messages']=[];_0x567d13['dataValues'][_0x7c18('0xc5')][_0x7c18('0x9d')](_0x279eae[_0x7c18('0xc6')]);return _0x567d13;});})[_0x7c18('0x20')](respondWithResult(_0x367445,null))[_0x7c18('0x2b')](handleError(_0x367445,null));};exports[_0x7c18('0x2c')]=function(_0x587a28,_0x2c0b7d,_0x19f7a0){if(_0x587a28['body']['id']){delete _0x587a28[_0x7c18('0x5c')]['id'];}var _0x4db0c2,_0x4f2e7b,_0x447dca;return db['SmsAccount'][_0x7c18('0x5a')]({'where':{'id':_0x587a28[_0x7c18('0x57')]['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x2c0b7d,null))[_0x7c18('0x20')](function(_0x4cde19){if(_0x4cde19){_0x447dca=_0x4cde19;logger[_0x7c18('0x23')](_0x7c18('0x24'),_0x7c18('0x2c'),_0x7c18('0xc7'),_0x4cde19[_0x7c18('0x42')],util[_0x7c18('0xc8')](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));switch(_0x4cde19['type']){case'skebby':if(_0x587a28[_0x7c18('0x5c')][_0x7c18('0xc9')]&&_0x587a28['body'][_0x7c18('0x2c')]){_0x4f2e7b=_0x587a28[_0x7c18('0x5c')]['status'];return db['SmsMessage'][_0x7c18('0x5a')]({'where':{'messageId':_0x587a28[_0x7c18('0x5c')][_0x7c18('0xc9')]}});}break;case'connectel':if(_0x587a28[_0x7c18('0x5c')][_0x7c18('0xca')]&&_0x587a28[_0x7c18('0x5c')][_0x7c18('0xcb')]){_0x4f2e7b=_0x587a28[_0x7c18('0x5c')]['statusInt'];return db[_0x7c18('0xa1')][_0x7c18('0x5a')]({'where':{'messageId':_0x587a28[_0x7c18('0x5c')][_0x7c18('0xca')]}});}break;case _0x7c18('0x86'):if(_0x587a28[_0x7c18('0x5c')]['message_id']&&_0x587a28[_0x7c18('0x5c')][_0x7c18('0xcc')]){_0x4f2e7b=_0x587a28[_0x7c18('0x5c')]['status_code'];return db['SmsMessage'][_0x7c18('0x5a')]({'where':{'messageId':_0x587a28['body'][_0x7c18('0x87')]}});}break;case _0x7c18('0x8a'):var _0x6a452e=_0x587a28[_0x7c18('0x5c')]['results'][0x0];if(_0x6a452e['messageId']&&_0x6a452e[_0x7c18('0x2c')][_0x7c18('0xcd')]===_0x7c18('0xce')){_0x4f2e7b=_0x6a452e[_0x7c18('0x2c')][_0x7c18('0xcd')];return db[_0x7c18('0xa1')][_0x7c18('0x5a')]({'where':{'messageId':_0x6a452e[_0x7c18('0x81')]}});}break;case _0x7c18('0xcf'):if(_0x587a28['body']['messageId']&&_0x587a28['body'][_0x7c18('0x2c')]){_0x4f2e7b=_0x587a28[_0x7c18('0x5c')][_0x7c18('0x2c')];return db['SmsMessage'][_0x7c18('0x5a')]({'where':{'messageId':_0x587a28['body'][_0x7c18('0x81')]}});}break;case _0x7c18('0xd0'):if(_0x587a28[_0x7c18('0x5c')][0x0][_0x7c18('0x29')]['id']){_0x4f2e7b=_0x587a28[_0x7c18('0x5c')][0x0][_0x7c18('0x42')];return db[_0x7c18('0xa1')][_0x7c18('0x5a')]({'where':{'messageId':_0x587a28['body'][0x0][_0x7c18('0x29')]['id']}});}break;case _0x7c18('0x90'):if(_0x587a28[_0x7c18('0x5c')]['redif']&&_0x587a28[_0x7c18('0x5c')][_0x7c18('0x2c')]){_0x4f2e7b=_0x587a28['body'][_0x7c18('0x2c')];return db[_0x7c18('0xa1')][_0x7c18('0x5a')]({'where':{'messageId':_0x587a28[_0x7c18('0x5c')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2c0b7d,null))['then'](function(_0x416b66){if(_0x416b66){_0x4db0c2=_0x416b66;switch(_0x447dca[_0x7c18('0x42')]){case'skebby':if(_0x4f2e7b===_0x7c18('0xce')){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),_0x7c18('0x2c'),_0x7c18('0x82'),util['inspect'](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x7c18('0x85'):if(_0x4f2e7b==='1'){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),_0x7c18('0x2c'),_0x7c18('0x82'),util['inspect'](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x587a28[_0x7c18('0x5c')][_0x7c18('0xd1')]&&_0x4f2e7b>=0xc8&&_0x4f2e7b<=0xce){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),_0x7c18('0x2c'),'clicksend',util[_0x7c18('0xc8')](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x7c18('0x8a'):var _0x5d74d5=_0x587a28[_0x7c18('0x5c')][_0x7c18('0x8b')][0x0];if(_0x5d74d5[_0x7c18('0x2c')]['groupName']===_0x7c18('0xce')){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),'status',_0x7c18('0x8a'),util[_0x7c18('0xc8')](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x7c18('0xcf'):if(_0x4f2e7b=='DELIVERED_TO_GATEWAY'||_0x4f2e7b==_0x7c18('0xd2')){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),'status','clickatell',util['inspect'](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x4f2e7b=='message-delivered'){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),_0x7c18('0x2c'),_0x7c18('0xd0'),util['inspect'](_0x587a28[_0x7c18('0x5c')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4f2e7b===_0x7c18('0xd3')||_0x4f2e7b===_0x7c18('0xd4')){return _0x4db0c2[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')](_0x7c18('0x24'),_0x7c18('0x2c'),_0x7c18('0x90'),util[_0x7c18('0xc8')](_0x587a28['body'],{'showHidden':![],'depth':null}));}break;}return _0x4db0c2;}})[_0x7c18('0x20')](respondWithResult(_0x2c0b7d,null))[_0x7c18('0x2b')](handleError(_0x2c0b7d,null));};exports[_0x7c18('0xd5')]=function(_0x10c911,_0x1de22d,_0x3379ce){var _0x46475f,_0x2a511e,_0x2e7728;return db[_0x7c18('0x3f')]['find']({'where':{'id':_0x10c911['params']['id']}})['then'](handleEntityNotFound(_0x1de22d,null))[_0x7c18('0x20')](function(_0x2f877a){if(_0x2f877a){_0x2e7728=_0x2f877a;logger[_0x7c18('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7c18('0xc7'),_0x2f877a[_0x7c18('0x42')],util[_0x7c18('0xc8')](_0x10c911['query'],{'showHidden':![],'depth':null}));switch(_0x2f877a[_0x7c18('0x42')]){case _0x7c18('0x8c'):if(_0x10c911[_0x7c18('0x46')][_0x7c18('0xd6')]&&_0x10c911['query'][_0x7c18('0xd7')]){_0x2a511e=_0x10c911[_0x7c18('0x46')][_0x7c18('0xd7')];return db[_0x7c18('0xa1')][_0x7c18('0x5a')]({'where':{'messageId':_0x10c911['query']['message-id']}});}break;}}})[_0x7c18('0x20')](handleEntityNotFound(_0x1de22d,null))[_0x7c18('0x20')](function(_0x1558b7){if(_0x1558b7){_0x46475f=_0x1558b7;switch(_0x2e7728[_0x7c18('0x42')]){case _0x7c18('0x8c'):if(_0x2a511e==='2'||_0x2a511e==='6'){return _0x46475f[_0x7c18('0x36')]({'read':!![]});}else{logger[_0x7c18('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7c18('0x2c'),'csc',util[_0x7c18('0xc8')](_0x10c911[_0x7c18('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x46475f;}})[_0x7c18('0x20')](respondWithResult(_0x1de22d,null))[_0x7c18('0x2b')](handleError(_0x1de22d,null));};exports['addAgents']=function(_0x2bbdec,_0x460845,_0x303fe0){return db[_0x7c18('0x3f')][_0x7c18('0x5a')]({'where':{'id':_0x2bbdec['params']['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x460845,null))[_0x7c18('0x20')](function(_0x5b2967){if(_0x5b2967){return _0x5b2967['addAgents'](_0x2bbdec[_0x7c18('0x5c')]['ids'],_['omit'](_0x2bbdec[_0x7c18('0x5c')],[_0x7c18('0x6d'),'id'])||{})['spread'](function(_0x29b804){for(var _0x349fed=0x0;_0x349fed<_0x2bbdec['body'][_0x7c18('0x6d')][_0x7c18('0x4c')];_0x349fed+=0x1){socket[_0x7c18('0xd8')](_0x7c18('0xd9'),{'UserId':Number(_0x2bbdec[_0x7c18('0x5c')]['ids'][_0x349fed]),'SmsAccountId':Number(_0x2bbdec[_0x7c18('0x57')]['id'])});}return _0x29b804;});}})[_0x7c18('0x20')](respondWithResult(_0x460845,null))['catch'](handleError(_0x460845,null));};exports['removeAgents']=function(_0x3f8324,_0x2fc528,_0x5f3f5f){return db['SmsAccount']['find']({'where':{'id':_0x3f8324[_0x7c18('0x57')]['id']}})['then'](handleEntityNotFound(_0x2fc528,null))[_0x7c18('0x20')](function(_0x3151c6){if(_0x3151c6){return _0x3151c6['removeAgents'](_0x3f8324[_0x7c18('0x46')][_0x7c18('0x6d')])[_0x7c18('0x20')](function(){if(_[_0x7c18('0xda')](_0x3f8324[_0x7c18('0x46')][_0x7c18('0x6d')])){for(var _0x38ac71=0x0;_0x38ac71<_0x3f8324[_0x7c18('0x46')][_0x7c18('0x6d')]['length'];_0x38ac71+=0x1){socket[_0x7c18('0xd8')](_0x7c18('0xdb'),{'UserId':Number(_0x3f8324[_0x7c18('0x46')][_0x7c18('0x6d')][_0x38ac71]),'SmsAccountId':Number(_0x3f8324[_0x7c18('0x57')]['id'])});}}else{socket[_0x7c18('0xd8')](_0x7c18('0xdb'),{'UserId':Number(_0x3f8324[_0x7c18('0x46')][_0x7c18('0x6d')]),'SmsAccountId':Number(_0x3f8324[_0x7c18('0x57')]['id'])});}});}})[_0x7c18('0x20')](respondWithStatusCode(_0x2fc528,null))['catch'](handleError(_0x2fc528,null));};exports[_0x7c18('0xdc')]=function(_0x14a645,_0x509e36,_0x38b943){var _0xbbeeb8={};var _0x2ad05f={};var _0x54ad7a;var _0x1c484d;return db[_0x7c18('0x3f')][_0x7c18('0x6a')]({'where':{'id':_0x14a645['params']['id']}})[_0x7c18('0x20')](handleEntityNotFound(_0x509e36,null))[_0x7c18('0x20')](function(_0x14ce8d){if(_0x14ce8d){_0x54ad7a=_0x14ce8d;_0x2ad05f[_0x7c18('0x44')]=_['keys'](db['User']['rawAttributes']);_0x2ad05f['query']=_['keys'](_0x14a645['query']);_0x2ad05f[_0x7c18('0x48')]=_['intersection'](_0x2ad05f[_0x7c18('0x44')],_0x2ad05f['query']);_0xbbeeb8[_0x7c18('0x4b')]=_[_0x7c18('0x49')](_0x2ad05f[_0x7c18('0x44')],qs['fields'](_0x14a645[_0x7c18('0x46')][_0x7c18('0x4a')]));_0xbbeeb8['attributes']=_0xbbeeb8[_0x7c18('0x4b')][_0x7c18('0x4c')]?_0xbbeeb8[_0x7c18('0x4b')]:_0x2ad05f[_0x7c18('0x44')];_0xbbeeb8['order']=qs['sort'](_0x14a645[_0x7c18('0x46')]['sort']);_0xbbeeb8[_0x7c18('0x50')]=qs['filters'](_[_0x7c18('0x51')](_0x14a645[_0x7c18('0x46')],_0x2ad05f[_0x7c18('0x48')]));if(_0x14a645[_0x7c18('0x46')][_0x7c18('0x52')]){_0xbbeeb8[_0x7c18('0x50')]=_[_0x7c18('0x53')](_0xbbeeb8[_0x7c18('0x50')],{'$or':_[_0x7c18('0x45')](_0xbbeeb8[_0x7c18('0x4b')],function(_0x5d61f8){var _0xbc237a={};_0xbc237a[_0x5d61f8]={'$like':'%'+_0x14a645[_0x7c18('0x46')][_0x7c18('0x52')]+'%'};return _0xbc237a;})});}_0xbbeeb8=_[_0x7c18('0x53')]({},_0xbbeeb8,_0x14a645[_0x7c18('0x59')]);return _0x54ad7a['getAgents'](_0xbbeeb8);}})[_0x7c18('0x20')](function(_0x40922a){if(_0x40922a){_0x1c484d=_0x40922a[_0x7c18('0x4c')];if(!_0x14a645[_0x7c18('0x46')]['hasOwnProperty'](_0x7c18('0x4d'))){_0xbbeeb8['limit']=qs[_0x7c18('0x32')](_0x14a645[_0x7c18('0x46')][_0x7c18('0x32')]);_0xbbeeb8[_0x7c18('0x31')]=qs[_0x7c18('0x31')](_0x14a645[_0x7c18('0x46')][_0x7c18('0x31')]);}return _0x54ad7a[_0x7c18('0xdc')](_0xbbeeb8);}})[_0x7c18('0x20')](function(_0x9d54d2){if(_0x9d54d2){return _0x9d54d2?{'count':_0x1c484d,'rows':_0x9d54d2}:null;}})[_0x7c18('0x20')](respondWithResult(_0x509e36,null))[_0x7c18('0x2b')](handleError(_0x509e36,null));}; \ No newline at end of file +var _0x34d9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','rawAttributes','removeAnswers','notify','sms','account','applications','orderBy','Applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','clicksend','message_id','plivo','Text','infobip','results','csc','segmentedMessage','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','List','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','key','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','SmsAccount','includeAll','include','findAll','rows','show','params','model','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34d9,0x8c));var _0x934d=function(_0x2c1e09,_0x3cc278){_0x2c1e09=_0x2c1e09-0x0;var _0x132611=_0x34d9[_0x2c1e09];return _0x132611;};'use strict';var emlformat=require(_0x934d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x934d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x934d('0x2'));var BPromise=require(_0x934d('0x3'));var Mustache=require('mustache');var util=require(_0x934d('0x4'));var path=require(_0x934d('0x5'));var sox=require(_0x934d('0x6'));var csv=require(_0x934d('0x7'));var ejs=require(_0x934d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x934d('0x9'));var squel=require(_0x934d('0xa'));var crypto=require('crypto');var jsforce=require(_0x934d('0xb'));var deskjs=require(_0x934d('0xc'));var toCsv=require(_0x934d('0x7'));var querystring=require('querystring');var Papa=require(_0x934d('0xd'));var Redis=require(_0x934d('0xe'));var authService=require(_0x934d('0xf'));var qs=require(_0x934d('0x10'));var as=require(_0x934d('0x11'));var hardwareService=require(_0x934d('0x12'));var logger=require(_0x934d('0x13'))(_0x934d('0x14'));var utils=require(_0x934d('0x15'));var config=require(_0x934d('0x16'));var licenseUtil=require(_0x934d('0x17'));var db=require(_0x934d('0x18'))['db'];config[_0x934d('0x19')]=_[_0x934d('0x1a')](config[_0x934d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x934d('0x1b'))(new Redis(config[_0x934d('0x19')]));require(_0x934d('0x1c'))['register'](socket);var jayson=require(_0x934d('0x1d'));var client=jayson[_0x934d('0x1e')][_0x934d('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x42af7e,_0x19798b,_0x59ebbd,_0x1b1587){return new BPromise(function(_0x3bcf02,_0x8222c4){var _0x17240a=_0x1b1587||client;return _0x17240a[_0x934d('0x20')](_0x42af7e,_0x59ebbd)[_0x934d('0x21')](function(_0x42e96e){logger[_0x934d('0x22')]('SmsAccount,\x20%s,\x20%s',_0x19798b,'request\x20sent');logger[_0x934d('0x23')](_0x934d('0x24'),_0x19798b,_0x934d('0x25'),JSON['stringify'](_0x42e96e));if(_0x42e96e[_0x934d('0x26')]){if(_0x42e96e[_0x934d('0x26')]['code']===0x1f4){logger['error'](_0x934d('0x27'),_0x19798b,_0x42e96e['error'][_0x934d('0x28')]);return _0x8222c4(_0x42e96e[_0x934d('0x26')][_0x934d('0x28')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x19798b,_0x42e96e['error'][_0x934d('0x28')]);return _0x3bcf02(_0x42e96e['error'][_0x934d('0x28')]);}else{logger[_0x934d('0x22')]('SmsAccount,\x20%s,\x20%s',_0x19798b,'request\x20sent');_0x3bcf02(_0x42e96e[_0x934d('0x29')][_0x934d('0x28')]);}})[_0x934d('0x2a')](function(_0x4ef2e3){logger[_0x934d('0x26')](_0x934d('0x27'),_0x19798b,_0x4ef2e3);_0x8222c4(_0x4ef2e3);});});}function respondWithStatusCode(_0x2ea891,_0x57bd67){_0x57bd67=_0x57bd67||0xcc;return function(_0x390d25){if(_0x390d25){return _0x2ea891[_0x934d('0x2b')](_0x57bd67);}return _0x2ea891[_0x934d('0x2c')](_0x57bd67)[_0x934d('0x2d')]();};}function respondWithResult(_0x3b10c8,_0x34bf5c){_0x34bf5c=_0x34bf5c||0xc8;return function(_0x19e5a8){if(_0x19e5a8){return _0x3b10c8[_0x934d('0x2c')](_0x34bf5c)['json'](_0x19e5a8);}};}function respondWithFilteredResult(_0x20bcd6,_0x52927c){return function(_0x337b75){if(_0x337b75){var _0x40076a=typeof _0x52927c[_0x934d('0x2e')]===_0x934d('0x2f')&&typeof _0x52927c['limit']===_0x934d('0x2f');var _0x46b60d=_0x337b75[_0x934d('0x30')];var _0x4b9c1f=_0x40076a?0x0:_0x52927c[_0x934d('0x2e')];var _0x20bd43=_0x40076a?_0x337b75['count']:_0x52927c[_0x934d('0x2e')]+_0x52927c[_0x934d('0x31')];var _0x238478;if(_0x20bd43>=_0x46b60d){_0x20bd43=_0x46b60d;_0x238478=0xc8;}else{_0x238478=0xce;}_0x20bcd6[_0x934d('0x2c')](_0x238478);return _0x20bcd6[_0x934d('0x32')]('Content-Range',_0x4b9c1f+'-'+_0x20bd43+'/'+_0x46b60d)[_0x934d('0x33')](_0x337b75);}return null;};}function patchUpdates(_0x2cfe12){return function(_0x27f629){try{jsonpatch[_0x934d('0x34')](_0x27f629,_0x2cfe12,!![]);}catch(_0x2d0200){return BPromise[_0x934d('0x35')](_0x2d0200);}return _0x27f629['save']();};}function saveUpdates(_0x79f5a7,_0x209faf){return function(_0xc59dda){if(_0xc59dda){return _0xc59dda['update'](_0x79f5a7)[_0x934d('0x21')](function(_0x428861){return _0x428861;});}return null;};}function removeEntity(_0x44bb85,_0x529a03){return function(_0x3e3833){if(_0x3e3833){return _0x3e3833[_0x934d('0x36')]()['then'](function(){var _0x532cec=_0x3e3833[_0x934d('0x37')]({'plain':!![]});var _0x48baee=_0x934d('0x38');return db[_0x934d('0x39')][_0x934d('0x36')]({'where':{'type':_0x48baee,'resourceId':_0x532cec['id']}})['then'](function(){return _0x3e3833;});})[_0x934d('0x21')](function(){_0x44bb85[_0x934d('0x2c')](0xcc)[_0x934d('0x2d')]();});}};}function handleEntityNotFound(_0x844a99,_0x19ae8e){return function(_0x56cd0b){if(!_0x56cd0b){_0x844a99[_0x934d('0x2b')](0x194);}return _0x56cd0b;};}function handleError(_0x3ebdaa,_0xe3f4e1){_0xe3f4e1=_0xe3f4e1||0x1f4;return function(_0x586ee3){logger['error'](_0x586ee3[_0x934d('0x3a')]);if(_0x586ee3[_0x934d('0x3b')]){delete _0x586ee3['name'];}_0x3ebdaa[_0x934d('0x2c')](_0xe3f4e1)[_0x934d('0x3c')](_0x586ee3);};}exports[_0x934d('0x3d')]=function(_0x20e13c,_0x1365f9){var _0x25430f={'include':[{'model':db[_0x934d('0x3e')],'as':_0x934d('0x3f')}]},_0x4fe732={},_0x2c8714={'count':0x0,'rows':[]};var _0x1d2e9d=_[_0x934d('0x40')](db['SmsAccount']['rawAttributes'],function(_0x117455){return{'name':_0x117455['fieldName'],'type':_0x117455[_0x934d('0x41')][_0x934d('0x42')]};});_0x4fe732['model']=_[_0x934d('0x40')](_0x1d2e9d,_0x934d('0x3b'));_0x4fe732['query']=_[_0x934d('0x43')](_0x20e13c[_0x934d('0x44')]);_0x4fe732[_0x934d('0x45')]=_['intersection'](_0x4fe732['model'],_0x4fe732[_0x934d('0x44')]);_0x25430f[_0x934d('0x46')]=_[_0x934d('0x47')](_0x4fe732['model'],qs[_0x934d('0x48')](_0x20e13c[_0x934d('0x44')]['fields']));_0x25430f[_0x934d('0x46')]=_0x25430f[_0x934d('0x46')][_0x934d('0x49')]?_0x25430f['attributes']:_0x4fe732['model'];if(!_0x20e13c[_0x934d('0x44')][_0x934d('0x4a')]('nolimit')){_0x25430f['limit']=qs['limit'](_0x20e13c[_0x934d('0x44')]['limit']);_0x25430f[_0x934d('0x2e')]=qs[_0x934d('0x2e')](_0x20e13c[_0x934d('0x44')][_0x934d('0x2e')]);}_0x25430f[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x20e13c['query']['sort']);_0x25430f['where']=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x20e13c[_0x934d('0x44')],_0x4fe732[_0x934d('0x45')]),_0x1d2e9d);if(_0x20e13c['query']['filter']){_0x25430f[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x25430f['where'],{'$or':_[_0x934d('0x40')](_0x1d2e9d,function(_0x423f3a){if(_0x423f3a[_0x934d('0x41')]!==_0x934d('0x50')){var _0x168d18={};_0x168d18[_0x423f3a['name']]={'$like':'%'+_0x20e13c[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x168d18;}})});}_0x25430f=_[_0x934d('0x4f')]({},_0x25430f,_0x20e13c[_0x934d('0x52')]);var _0x142712={'where':_0x25430f[_0x934d('0x4e')]};return db[_0x934d('0x53')][_0x934d('0x30')](_0x142712)[_0x934d('0x21')](function(_0x4c5bd3){_0x2c8714[_0x934d('0x30')]=_0x4c5bd3;if(_0x20e13c['query'][_0x934d('0x54')]){_0x25430f[_0x934d('0x55')]=[{'all':!![]}];}return db[_0x934d('0x53')][_0x934d('0x56')](_0x25430f);})['then'](function(_0x34dc36){_0x2c8714[_0x934d('0x57')]=_0x34dc36;return _0x2c8714;})[_0x934d('0x21')](respondWithFilteredResult(_0x1365f9,_0x25430f))[_0x934d('0x2a')](handleError(_0x1365f9,null));};exports[_0x934d('0x58')]=function(_0x43d09d,_0x4c8b2e){var _0x260401={'raw':![],'where':{'id':_0x43d09d[_0x934d('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x934d('0x3f')}]},_0x47f553={};_0x47f553['model']=_[_0x934d('0x43')](db[_0x934d('0x53')]['rawAttributes']);_0x47f553[_0x934d('0x44')]=_[_0x934d('0x43')](_0x43d09d[_0x934d('0x44')]);_0x47f553['filters']=_[_0x934d('0x47')](_0x47f553[_0x934d('0x5a')],_0x47f553[_0x934d('0x44')]);_0x260401[_0x934d('0x46')]=_[_0x934d('0x47')](_0x47f553[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x43d09d[_0x934d('0x44')][_0x934d('0x48')]));_0x260401[_0x934d('0x46')]=_0x260401['attributes'][_0x934d('0x49')]?_0x260401['attributes']:_0x47f553[_0x934d('0x5a')];if(_0x43d09d[_0x934d('0x44')][_0x934d('0x54')]){_0x260401[_0x934d('0x55')]=[{'all':!![]}];}_0x260401=_[_0x934d('0x4f')]({},_0x260401,_0x43d09d['options']);return db[_0x934d('0x53')][_0x934d('0x5b')](_0x260401)['then'](handleEntityNotFound(_0x4c8b2e,null))[_0x934d('0x21')](respondWithResult(_0x4c8b2e,null))[_0x934d('0x2a')](handleError(_0x4c8b2e,null));};exports[_0x934d('0x5c')]=function(_0x923d2,_0x1d1709){return db['SmsAccount']['create'](_0x923d2['body'],{})[_0x934d('0x21')](function(_0x1bc0e9){var _0x11b26a=_0x923d2['user']['get']({'plain':!![]});if(!_0x11b26a)throw new Error(_0x934d('0x5d'));if(_0x11b26a[_0x934d('0x5e')]===_0x934d('0x5f')){var _0x14946e=_0x1bc0e9['get']({'plain':!![]});var _0x3caeeb=_0x934d('0x38');return db[_0x934d('0x60')][_0x934d('0x5b')]({'where':{'name':_0x3caeeb,'userProfileId':_0x11b26a[_0x934d('0x61')]},'raw':!![]})['then'](function(_0x240e5e){if(_0x240e5e&&_0x240e5e[_0x934d('0x62')]===0x0){return db[_0x934d('0x39')][_0x934d('0x5c')]({'name':_0x14946e[_0x934d('0x3b')],'resourceId':_0x14946e['id'],'type':_0x240e5e[_0x934d('0x3b')],'sectionId':_0x240e5e['id']},{})[_0x934d('0x21')](function(){return _0x1bc0e9;});}else{return _0x1bc0e9;}})[_0x934d('0x2a')](function(_0x87cd3f){logger[_0x934d('0x26')](_0x934d('0x63'),_0x87cd3f);throw _0x87cd3f;});}return _0x1bc0e9;})[_0x934d('0x21')](respondWithResult(_0x1d1709,0xc9))['catch'](handleError(_0x1d1709,null));};exports[_0x934d('0x64')]=function(_0x340e22,_0x6fc3e){if(_0x340e22[_0x934d('0x65')]['id']){delete _0x340e22['body']['id'];}return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x340e22[_0x934d('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x6fc3e,null))[_0x934d('0x21')](saveUpdates(_0x340e22[_0x934d('0x65')],null))['then'](respondWithResult(_0x6fc3e,null))[_0x934d('0x2a')](handleError(_0x6fc3e,null));};exports[_0x934d('0x36')]=function(_0x5a4a07,_0x28d2c6){return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x5a4a07[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x28d2c6,null))[_0x934d('0x21')](removeEntity(_0x28d2c6,null))[_0x934d('0x2a')](handleError(_0x28d2c6,null));};exports[_0x934d('0x66')]=function(_0xf9d7a4,_0x5234b0){return db[_0x934d('0x53')]['describe']()['then'](respondWithResult(_0x5234b0,null))[_0x934d('0x2a')](handleError(_0x5234b0,null));};exports[_0x934d('0x67')]=function(_0x55a157,_0x5994d9,_0x51ef17){if(_0x55a157[_0x934d('0x65')]['id']){delete _0x55a157[_0x934d('0x65')]['id'];}return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x55a157[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x5994d9,null))['then'](function(_0x463786){if(_0x463786){_0x55a157[_0x934d('0x65')][_0x934d('0x68')]=_0x463786['id'];return db['Disposition'][_0x934d('0x5c')](_0x55a157[_0x934d('0x65')]);}})[_0x934d('0x21')](respondWithResult(_0x5994d9,null))[_0x934d('0x2a')](handleError(_0x5994d9,null));};exports[_0x934d('0x69')]=function(_0x4734ff,_0x3717c2,_0x19a20a){var _0x4016fc={'raw':![],'where':{}};var _0x13e1f7={};var _0x365be2={'count':0x0,'rows':[]};return db[_0x934d('0x53')][_0x934d('0x6a')]({'where':{'id':_0x4734ff[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x3717c2,null))[_0x934d('0x21')](function(_0x34c8e3){if(_0x34c8e3){_0x13e1f7[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0x6b')]['rawAttributes']);_0x13e1f7[_0x934d('0x44')]=_['keys'](_0x4734ff[_0x934d('0x44')]);_0x13e1f7[_0x934d('0x45')]=_[_0x934d('0x47')](_0x13e1f7[_0x934d('0x5a')],_0x13e1f7[_0x934d('0x44')]);_0x4016fc[_0x934d('0x46')]=_[_0x934d('0x47')](_0x13e1f7[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x4734ff[_0x934d('0x44')]['fields']));_0x4016fc[_0x934d('0x46')]=_0x4016fc[_0x934d('0x46')][_0x934d('0x49')]?_0x4016fc[_0x934d('0x46')]:_0x13e1f7[_0x934d('0x5a')];if(!_0x4734ff['query'][_0x934d('0x4a')](_0x934d('0x6c'))){_0x4016fc['limit']=qs[_0x934d('0x31')](_0x4734ff[_0x934d('0x44')][_0x934d('0x31')]);_0x4016fc['offset']=qs[_0x934d('0x2e')](_0x4734ff[_0x934d('0x44')]['offset']);}_0x4016fc[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x4734ff['query'][_0x934d('0x4c')]);_0x4016fc[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x4734ff[_0x934d('0x44')],_0x13e1f7[_0x934d('0x45')]));_0x4016fc[_0x934d('0x4e')]['SmsAccountId']=_0x34c8e3['id'];if(_0x4734ff[_0x934d('0x44')]['filter']){_0x4016fc[_0x934d('0x4e')]=_['merge'](_0x4016fc[_0x934d('0x4e')],{'$or':_[_0x934d('0x40')](_0x4016fc['attributes'],function(_0x34898d){var _0x5b6b23={};_0x5b6b23[_0x34898d]={'$like':'%'+_0x4734ff['query'][_0x934d('0x51')]+'%'};return _0x5b6b23;})});}_0x4016fc=_[_0x934d('0x4f')]({},_0x4016fc,_0x4734ff[_0x934d('0x52')]);return db[_0x934d('0x6b')][_0x934d('0x30')]({'where':_0x4016fc[_0x934d('0x4e')]})[_0x934d('0x21')](function(_0x4e7e8b){_0x365be2['count']=_0x4e7e8b;if(_0x4734ff[_0x934d('0x44')]['includeAll']){_0x4016fc[_0x934d('0x55')]=[{'all':!![]}];}return db[_0x934d('0x6b')][_0x934d('0x56')](_0x4016fc);})['then'](function(_0x412a28){_0x365be2[_0x934d('0x57')]=_0x412a28;return _0x365be2;});}})[_0x934d('0x21')](respondWithFilteredResult(_0x3717c2,_0x4016fc))[_0x934d('0x2a')](handleError(_0x3717c2,null));};exports[_0x934d('0x6d')]=function(_0x3cf7a2,_0x185f3f,_0x3bd29a){return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x3cf7a2[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0x185f3f,null))['then'](function(_0x320e6c){if(_0x320e6c){return _0x320e6c['removeDispositions'](_0x3cf7a2[_0x934d('0x44')][_0x934d('0x6e')]);}})[_0x934d('0x21')](respondWithStatusCode(_0x185f3f,null))[_0x934d('0x2a')](handleError(_0x185f3f,null));};exports[_0x934d('0x6f')]=function(_0x59a6e3,_0xd57f41,_0x3aedbd){if(_0x59a6e3[_0x934d('0x65')]['id']){delete _0x59a6e3[_0x934d('0x65')]['id'];}return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x59a6e3[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0xd57f41,null))[_0x934d('0x21')](function(_0x4e3f67){if(_0x4e3f67){_0x59a6e3[_0x934d('0x65')][_0x934d('0x68')]=_0x4e3f67['id'];return db['CannedAnswer'][_0x934d('0x5c')](_0x59a6e3[_0x934d('0x65')]);}})[_0x934d('0x21')](respondWithResult(_0xd57f41,null))[_0x934d('0x2a')](handleError(_0xd57f41,null));};exports[_0x934d('0x70')]=function(_0x4f8fce,_0x5ed22b,_0x7df3e1){var _0x45dc17={'raw':![],'where':{}};var _0xe8dd20={};var _0x137d19={'count':0x0,'rows':[]};return db[_0x934d('0x53')]['findOne']({'where':{'id':_0x4f8fce[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x5ed22b,null))[_0x934d('0x21')](function(_0xd5aa42){if(_0xd5aa42){_0xe8dd20[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0x71')][_0x934d('0x72')]);_0xe8dd20['query']=_['keys'](_0x4f8fce[_0x934d('0x44')]);_0xe8dd20[_0x934d('0x45')]=_['intersection'](_0xe8dd20['model'],_0xe8dd20[_0x934d('0x44')]);_0x45dc17[_0x934d('0x46')]=_[_0x934d('0x47')](_0xe8dd20[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x4f8fce[_0x934d('0x44')]['fields']));_0x45dc17[_0x934d('0x46')]=_0x45dc17[_0x934d('0x46')][_0x934d('0x49')]?_0x45dc17[_0x934d('0x46')]:_0xe8dd20[_0x934d('0x5a')];if(!_0x4f8fce[_0x934d('0x44')]['hasOwnProperty'](_0x934d('0x6c'))){_0x45dc17[_0x934d('0x31')]=qs[_0x934d('0x31')](_0x4f8fce[_0x934d('0x44')]['limit']);_0x45dc17[_0x934d('0x2e')]=qs['offset'](_0x4f8fce[_0x934d('0x44')][_0x934d('0x2e')]);}_0x45dc17[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x4f8fce[_0x934d('0x44')]['sort']);_0x45dc17[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x4f8fce[_0x934d('0x44')],_0xe8dd20['filters']));_0x45dc17[_0x934d('0x4e')][_0x934d('0x68')]=_0xd5aa42['id'];if(_0x4f8fce[_0x934d('0x44')][_0x934d('0x51')]){_0x45dc17[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x45dc17['where'],{'$or':_[_0x934d('0x40')](_0x45dc17[_0x934d('0x46')],function(_0x53dc0f){var _0x18eb22={};_0x18eb22[_0x53dc0f]={'$like':'%'+_0x4f8fce['query'][_0x934d('0x51')]+'%'};return _0x18eb22;})});}_0x45dc17=_['merge']({},_0x45dc17,_0x4f8fce[_0x934d('0x52')]);return db[_0x934d('0x71')][_0x934d('0x30')]({'where':_0x45dc17['where']})[_0x934d('0x21')](function(_0x5e674c){_0x137d19[_0x934d('0x30')]=_0x5e674c;if(_0x4f8fce[_0x934d('0x44')][_0x934d('0x54')]){_0x45dc17[_0x934d('0x55')]=[{'all':!![]}];}return db[_0x934d('0x71')][_0x934d('0x56')](_0x45dc17);})[_0x934d('0x21')](function(_0x33ddb1){_0x137d19['rows']=_0x33ddb1;return _0x137d19;});}})[_0x934d('0x21')](respondWithFilteredResult(_0x5ed22b,_0x45dc17))[_0x934d('0x2a')](handleError(_0x5ed22b,null));};exports[_0x934d('0x73')]=function(_0x52f5dd,_0x3791a1,_0x5b8d14){return db[_0x934d('0x53')]['find']({'where':{'id':_0x52f5dd[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x3791a1,null))['then'](function(_0xd0fa7b){if(_0xd0fa7b){return _0xd0fa7b[_0x934d('0x73')](_0x52f5dd[_0x934d('0x44')][_0x934d('0x6e')]);}})[_0x934d('0x21')](respondWithStatusCode(_0x3791a1,null))[_0x934d('0x2a')](handleError(_0x3791a1,null));};exports[_0x934d('0x74')]=function(_0x4a2a65,_0x1c0ee5,_0x36d551){var _0x514ac4={'channel':_0x934d('0x75')};var _0x3563dd=[];var _0x4e0a8f=[];var _0x1179ee={};return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x4a2a65[_0x934d('0x59')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1c0ee5,null))[_0x934d('0x21')](function(_0x5abb06){_0x514ac4[_0x934d('0x76')]=_0x5abb06;_0x514ac4[_0x934d('0x77')]=_[_0x934d('0x78')](_0x5abb06[_0x934d('0x79')],[_0x934d('0x7a')],[_0x934d('0x7b')]);if(_0x514ac4[_0x934d('0x76')]['Applications']){delete _0x514ac4['account'][_0x934d('0x79')];}return db[_0x934d('0x7c')][_0x934d('0x66')]();})[_0x934d('0x21')](function(_0xf09edc){if(!_0xf09edc){throw new db['Sequelize'][(_0x934d('0x7d'))](_0x934d('0x7e'));}_0x3563dd=_[_0x934d('0x7f')](_[_0x934d('0x43')](_0xf09edc),[_0x934d('0x80'),_0x934d('0x81')]);_0x4e0a8f=_[_0x934d('0x7f')](_[_0x934d('0x43')](_0xf09edc),[_0x934d('0x80'),'updatedAt',_0x934d('0x82'),_0x934d('0x83')]);_0x514ac4[_0x934d('0x65')]={'mapKey':_0x934d('0x84')};if(_0x514ac4[_0x934d('0x76')][_0x934d('0x41')]){switch(_0x514ac4[_0x934d('0x76')][_0x934d('0x41')]){case _0x934d('0x85'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65['body'][_0x934d('0x87')];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x88')];_0x514ac4['body'][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8a')];break;case _0x934d('0x8b'):_0x514ac4['body']['from']='+'+_0x4a2a65[_0x934d('0x65')]['sender'];_0x514ac4['body'][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8c')];break;case'connectel':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x86')];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x28')];break;case _0x934d('0x8d'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x86')];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')]['body'];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8e')];break;case _0x934d('0x8f'):_0x514ac4['body'][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')]['From'];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x90')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')]['MessageUUID'];break;case _0x934d('0x91'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]='+'+_0x4a2a65[_0x934d('0x65')][_0x934d('0x92')][0x0]['from'];_0x514ac4['body'][_0x934d('0x65')]=_0x4a2a65['body']['results'][0x0][_0x934d('0x8c')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x92')][0x0][_0x934d('0x89')];break;case _0x934d('0x93'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')]['originatingAddress'];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x94')][_0x934d('0x28')];break;case'clickatell':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65['body']['fromNumber'];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8c')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')]['replyMessageId'];break;case _0x934d('0x95'):_0x514ac4['body'][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][0x0][_0x934d('0x28')]['id'];_0x514ac4['body'][_0x934d('0x86')]=_0x4a2a65['body'][0x0][_0x934d('0x28')][_0x934d('0x86')];_0x514ac4['body'][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][0x0][_0x934d('0x28')][_0x934d('0x8c')];break;case _0x934d('0x96'):_0x514ac4['body'][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x86')];_0x514ac4['body']['body']=_0x4a2a65['body'][_0x934d('0x28')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x97')];break;}}if(_0x514ac4[_0x934d('0x65')]['id']){delete _0x514ac4[_0x934d('0x65')]['id'];}if(_[_0x934d('0x98')](_0x514ac4[_0x934d('0x65')][_0x934d('0x86')])){throw new db[(_0x934d('0x99'))][(_0x934d('0x7d'))](_0x934d('0x9a'));}if(_[_0x934d('0x98')](_0x514ac4[_0x934d('0x65')][_0x934d('0x65')])||_0x514ac4['body'][_0x934d('0x65')]===''){throw new db[(_0x934d('0x99'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x514ac4[_0x934d('0x65')]['mapKey'])){throw new db[(_0x934d('0x99'))][(_0x934d('0x7d'))](_0x934d('0x9b')+_0x4e0a8f);}if(!_[_0x934d('0x9c')](_0x4e0a8f,_0x514ac4[_0x934d('0x65')][_0x934d('0x9d')])){throw new db['Sequelize']['ValidationError'](_0x934d('0x9e')+_0x4e0a8f);}_0x1179ee[_0x514ac4[_0x934d('0x65')][_0x934d('0x9d')]]=_0x514ac4[_0x934d('0x65')]['from'];return db[_0x934d('0x9f')][_0x934d('0x5b')]({'where':{'id':_0x514ac4[_0x934d('0x76')][_0x934d('0x83')]},'include':[{'model':db[_0x934d('0x7c')],'as':_0x934d('0xa0'),'where':_0x1179ee,'limit':0x1,'order':[[_0x934d('0x81'),_0x934d('0xa1')]]}]});})[_0x934d('0x21')](handleEntityNotFound(_0x1c0ee5,null))[_0x934d('0x21')](function(_0x2f4b49){if(_0x2f4b49){_0x514ac4[_0x934d('0xa2')]=_[_0x934d('0xa3')](_0x2f4b49,[_0x934d('0xa0')]);if(_0x2f4b49[_0x934d('0xa0')][_0x934d('0x49')]){return _0x2f4b49[_0x934d('0xa0')][0x0];}var _0x3741ea=_[_0x934d('0x1a')](_0x514ac4['body'],{'firstName':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')],'ListId':_0x2f4b49['id']});_0x3741ea[_0x514ac4[_0x934d('0x65')]['mapKey']]=_0x514ac4[_0x934d('0x65')][_0x934d('0x86')];return db[_0x934d('0x7c')][_0x934d('0x5c')](_0x3741ea,{'fields':_0x3563dd,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c0ee5,null))['then'](function(_0x13c60b){if(_0x13c60b){_0x514ac4[_0x934d('0xa4')]=_0x13c60b;var _0x5da587={'ContactId':_0x13c60b['id'],'phone':_0x514ac4['body'][_0x934d('0x86')],'SmsAccountId':_0x4a2a65['params']['id']};var _0x446b38={'ContactId':_0x13c60b['id'],'SmsAccountId':_0x4a2a65[_0x934d('0x59')]['id'],'closed':![]};return db[_0x934d('0xa5')][_0x934d('0x5b')]({'where':_0x446b38})['then'](function(_0x2f5648){if(_0x2f5648){return[_0x2f5648,![]];}return db[_0x934d('0xa5')]['create'](_0x5da587)[_0x934d('0x21')](function(_0x58a725){return[_0x58a725,!![]];});});}})[_0x934d('0xa6')](function(_0x37ee4e,_0x2b73e9){_0x514ac4[_0x934d('0xa7')]=_0x37ee4e[_0x934d('0x37')]({'plain':!![]});_0x514ac4[_0x934d('0xa7')]['created']=![];if(_0x2b73e9){if(_0x514ac4['account']['autoclose']){_0x514ac4[_0x934d('0x77')][_0x934d('0xa8')]({'id':0x0,'priority':_0x514ac4[_0x934d('0x77')][_0x934d('0x49')]+0x1,'app':_0x934d('0xa9'),'appdata':_0x934d('0xaa'),'interval':_0x934d('0xab')});}_0x514ac4[_0x934d('0xa7')][_0x934d('0xac')]=!![];}return db['SmsMessage'][_0x934d('0x5c')]({'phone':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')],'messageId':_0x514ac4[_0x934d('0x65')][_0x934d('0x89')],'body':_0x514ac4[_0x934d('0x65')][_0x934d('0x65')],'SmsAccountId':_0x4a2a65['params']['id'],'SmsInteractionId':_0x37ee4e['id'],'direction':'in','ContactId':_0x37ee4e[_0x934d('0xad')],'AttachmentId':_0x514ac4['body'][_0x934d('0xae')]});})['then'](function(_0x1a9918){_0x514ac4['message']=_0x1a9918;if(_0x514ac4[_0x934d('0xa7')][_0x934d('0xaf')]){return db[_0x934d('0xb0')]['find']({'attributes':['id',_0x934d('0x3b')],'where':{'id':_0x514ac4[_0x934d('0xa7')][_0x934d('0xaf')]}})['then'](function(_0x5efe93){if(_0x5efe93){_0x514ac4[_0x934d('0x77')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5efe93['name']+','+(_0x514ac4[_0x934d('0x76')][_0x934d('0xb1')]||0xa),'interval':_0x934d('0xab')});}return respondWithRpcPromise(_0x934d('0xb2'),_0x934d('0xb3'),_0x514ac4);});}return respondWithRpcPromise(_0x934d('0xb2'),_0x934d('0xb3'),_0x514ac4);})[_0x934d('0x21')](function(_0x501101){if(_0x501101){var _0x3bdef0=0xc8;var _0x38ca01=_0x934d('0xb4');logger[_0x934d('0x22')](_0x934d('0x24'),_0x38ca01,_0x3bdef0,_0x934d('0xb5'));logger[_0x934d('0x23')](_0x934d('0xb6'),_0x38ca01,_0x3bdef0,_0x934d('0xb5'),JSON['stringify'](_0x501101));if(_0x514ac4[_0x934d('0x76')][_0x934d('0x41')]===_0x934d('0x85')){return _0x1c0ee5['status'](_0x3bdef0)[_0x934d('0x32')]('Content-Type',_0x934d('0xb7'))['send'](_0x934d('0xb8'));}else{return _0x1c0ee5[_0x934d('0x2c')](_0x3bdef0)[_0x934d('0x33')](_0x501101);}}})[_0x934d('0x2a')](handleError(_0x1c0ee5,null));};exports[_0x934d('0xb9')]=function(_0x2efb08,_0x3908e3){var _0x12f160=_0x2efb08[_0x934d('0x59')]['id'];var _0x5a142f=_0x2efb08['body'];var _0x9960d4=0xc8;var _0x461289=null;return db[_0x934d('0xba')][_0x934d('0xbb')]({'isolationLevel':db['sequelize'][_0x934d('0xbc')][_0x934d('0xbd')]['READ_COMMITTED']},function(_0x4d51fc){return db[_0x934d('0x53')][_0x934d('0x6a')]({'where':{'id':_0x12f160},'transaction':_0x4d51fc})[_0x934d('0x21')](function(_0x13b144){if(_0x13b144){return db[_0x934d('0xbe')]['destroy']({'where':{'SmsAccountId':_0x12f160},'transaction':_0x4d51fc})['then'](function(){var _0x4664a7=_[_0x934d('0x40')](_0x5a142f,function(_0x321f00){_0x321f00[_0x934d('0x68')]=_0x12f160;return _0x321f00;});return db[_0x934d('0xbe')][_0x934d('0xbf')](_0x4664a7,{'transaction':_0x4d51fc});});}else{_0x9960d4=0x194;_0x461289=[];}});})[_0x934d('0x21')](function(){if(_0x9960d4!==0x194){return db[_0x934d('0xbe')][_0x934d('0xc0')]({'where':{'SmsAccountId':_0x12f160},'order':'priority'})[_0x934d('0x21')](function(_0x1f438d){_0x461289=_0x1f438d;});}})[_0x934d('0x2a')](function(_0x47db9d){_0x9960d4=0x1f4;logger['error'](_0x47db9d['stack']);if(_0x47db9d[_0x934d('0x3b')]){delete _0x47db9d[_0x934d('0x3b')];}_0x461289=_0x47db9d;})[_0x934d('0xc1')](function(){if(_0x461289===null){_0x3908e3[_0x934d('0x2b')](_0x9960d4);}else{if(_0x9960d4===0x1f4){_0x3908e3[_0x934d('0x2c')](_0x9960d4)['send'](_0x461289);}else{_0x3908e3[_0x934d('0x2c')](_0x9960d4)['json'](_0x461289);}}});};exports[_0x934d('0xc2')]=function(_0x2c05b5,_0x74d31d,_0x1d0bc4){var _0x417baa={};var _0x1b1dca={};var _0x477464;var _0x4fa1d9;return db['SmsAccount'][_0x934d('0x6a')]({'where':{'id':_0x2c05b5[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0x74d31d,null))[_0x934d('0x21')](function(_0x340348){if(_0x340348){_0x477464=_0x340348;_0x1b1dca['model']=_[_0x934d('0x43')](db[_0x934d('0xbe')][_0x934d('0x72')]);_0x1b1dca[_0x934d('0x44')]=_[_0x934d('0x43')](_0x2c05b5[_0x934d('0x44')]);_0x1b1dca[_0x934d('0x45')]=_['intersection'](_0x1b1dca[_0x934d('0x5a')],_0x1b1dca[_0x934d('0x44')]);_0x417baa['attributes']=_[_0x934d('0x47')](_0x1b1dca[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x2c05b5['query'][_0x934d('0x48')]));_0x417baa[_0x934d('0x46')]=_0x417baa['attributes'][_0x934d('0x49')]?_0x417baa[_0x934d('0x46')]:_0x1b1dca[_0x934d('0x5a')];_0x417baa[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x2c05b5[_0x934d('0x44')][_0x934d('0x4c')]);_0x417baa[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x2c05b5['query'],_0x1b1dca[_0x934d('0x45')]));if(_0x2c05b5[_0x934d('0x44')]['filter']){_0x417baa[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x417baa[_0x934d('0x4e')],{'$or':_[_0x934d('0x40')](_0x417baa[_0x934d('0x46')],function(_0x19b16b){var _0x5bb357={};_0x5bb357[_0x19b16b]={'$like':'%'+_0x2c05b5[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x5bb357;})});}_0x417baa=_['merge']({},_0x417baa,_0x2c05b5[_0x934d('0x52')]);return _0x477464[_0x934d('0xc2')](_0x417baa);}})['then'](function(_0x5f4e93){if(_0x5f4e93){_0x4fa1d9=_0x5f4e93['length'];if(!_0x2c05b5[_0x934d('0x44')][_0x934d('0x4a')](_0x934d('0x6c'))){_0x417baa['limit']=qs[_0x934d('0x31')](_0x2c05b5[_0x934d('0x44')][_0x934d('0x31')]);_0x417baa[_0x934d('0x2e')]=qs[_0x934d('0x2e')](_0x2c05b5['query'][_0x934d('0x2e')]);}return _0x477464[_0x934d('0xc2')](_0x417baa);}})[_0x934d('0x21')](function(_0x5eb9f6){if(_0x5eb9f6){return _0x5eb9f6?{'count':_0x4fa1d9,'rows':_0x5eb9f6}:null;}})[_0x934d('0x21')](respondWithResult(_0x74d31d,null))['catch'](handleError(_0x74d31d,null));};exports[_0x934d('0xc3')]=function(_0x336cf9,_0x453b10,_0x1e5d54){var _0x2c185f={'raw':![],'where':{}};var _0x5bb4b4={};var _0x49428={'count':0x0,'rows':[]};return db['SmsAccount'][_0x934d('0x6a')]({'where':{'id':_0x336cf9[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x453b10,null))['then'](function(_0x4c70ca){if(_0x4c70ca){_0x5bb4b4[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0xa5')]['rawAttributes']);_0x5bb4b4['query']=_['keys'](_0x336cf9[_0x934d('0x44')]);_0x5bb4b4[_0x934d('0x45')]=_[_0x934d('0x47')](_0x5bb4b4['model'],_0x5bb4b4['query']);_0x2c185f[_0x934d('0x46')]=_[_0x934d('0x47')](_0x5bb4b4[_0x934d('0x5a')],qs['fields'](_0x336cf9['query'][_0x934d('0x48')]));_0x2c185f[_0x934d('0x46')]=_0x2c185f[_0x934d('0x46')]['length']?_0x2c185f[_0x934d('0x46')]:_0x5bb4b4['model'];if(!_0x336cf9['query'][_0x934d('0x4a')](_0x934d('0x6c'))){_0x2c185f[_0x934d('0x31')]=qs['limit'](_0x336cf9[_0x934d('0x44')]['limit']);_0x2c185f['offset']=qs[_0x934d('0x2e')](_0x336cf9[_0x934d('0x44')][_0x934d('0x2e')]);}_0x2c185f[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x336cf9[_0x934d('0x44')][_0x934d('0x4c')]);_0x2c185f[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x336cf9[_0x934d('0x44')],_0x5bb4b4[_0x934d('0x45')]));_0x2c185f[_0x934d('0x4e')]['SmsAccountId']=_0x4c70ca['id'];if(_0x336cf9[_0x934d('0x44')][_0x934d('0x51')]){_0x2c185f[_0x934d('0x4e')]=_['merge'](_0x2c185f[_0x934d('0x4e')],{'$or':_[_0x934d('0x40')](_0x2c185f[_0x934d('0x46')],function(_0x9329fb){var _0x127bdf={};_0x127bdf[_0x9329fb]={'$like':'%'+_0x336cf9[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x127bdf;})});}_0x2c185f=_[_0x934d('0x4f')]({},_0x2c185f,_0x336cf9[_0x934d('0x52')]);return db[_0x934d('0xa5')][_0x934d('0x30')]({'where':_0x2c185f['where']})[_0x934d('0x21')](function(_0x29354b){_0x49428['count']=_0x29354b;if(_0x336cf9[_0x934d('0x44')][_0x934d('0x54')]){_0x2c185f['include']=[{'model':db['CmContact'],'as':_0x934d('0xc4'),'required':![]},{'model':db[_0x934d('0xb0')],'as':_0x934d('0xc5'),'attributes':[_0x934d('0x3b'),_0x934d('0xc6'),_0x934d('0xc7')],'required':![]},{'model':db[_0x934d('0xc8')],'as':'Tags','attributes':['id',_0x934d('0x3b'),_0x934d('0xc9')],'where':_0x336cf9[_0x934d('0x44')][_0x934d('0xca')]?{'id':_0x336cf9[_0x934d('0x44')][_0x934d('0xca')]}:undefined,'required':_0x336cf9[_0x934d('0x44')][_0x934d('0xca')]?!![]:![]}];}return db[_0x934d('0xa5')][_0x934d('0x56')](_0x2c185f);})[_0x934d('0x21')](function(_0x49f300){_0x49428['rows']=_0x49f300;return _0x49428;});}})[_0x934d('0x21')](respondWithFilteredResult(_0x453b10,_0x2c185f))[_0x934d('0x2a')](handleError(_0x453b10,null));};exports['send']=function(_0x745eba,_0x266137,_0x236337){var _0x438524,_0x344fcb,_0x3c5013;if(_[_0x934d('0x98')](_0x745eba[_0x934d('0x65')]['body'])||_0x745eba[_0x934d('0x65')][_0x934d('0x65')]===''){throw new db[(_0x934d('0x99'))][(_0x934d('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x934d('0x98')](_0x745eba[_0x934d('0x65')]['to'])){throw new db['Sequelize'][(_0x934d('0x7d'))]('to\x20is\x20mandatory');}_0x438524=_0x745eba['body']['to'];return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x745eba[_0x934d('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x934d('0x7c')],'as':'Contacts','where':{'mobile':_0x438524},'limit':0x1,'order':[[_0x934d('0x81'),_0x934d('0xa1')]]}]}]})[_0x934d('0x21')](handleEntityNotFound(_0x266137,null))[_0x934d('0x21')](function(_0x5ddc41){if(_0x5ddc41&&_0x5ddc41[_0x934d('0xcb')]){_0x344fcb=_0x5ddc41['get']({'plain':!![]});if(_0x344fcb[_0x934d('0xcb')]&&_0x344fcb[_0x934d('0xcb')][_0x934d('0xa0')][_0x934d('0x49')]){return _0x344fcb[_0x934d('0xcb')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x934d('0x1a')](_0x745eba['body'],{'firstName':_0x438524,'mobile':_0x438524,'phone':_0x438524,'ListId':_0x344fcb[_0x934d('0x83')]}));}})[_0x934d('0x21')](handleEntityNotFound(_0x266137,null))[_0x934d('0x21')](function(_0xf48b0a){if(_0xf48b0a){_0x3c5013=_0xf48b0a;return db['SmsInteraction']['find']({'where':{'ContactId':_0x3c5013['id'],'closed':![],'SmsAccountId':_0x344fcb['id']}})[_0x934d('0x21')](function(_0x4ae4f9){if(_0x4ae4f9){return[_0x4ae4f9,![]];}return db[_0x934d('0xa5')][_0x934d('0x5c')]({'UserId':_0x745eba[_0x934d('0x5f')]['id'],'ContactId':_0x3c5013['id'],'SmsAccountId':_0x344fcb['id'],'phone':_0x438524,'firstMsgDirection':_0x934d('0xcc'),'Messages':[_[_0x934d('0x4f')](_0x745eba[_0x934d('0x65')],{'read':![],'body':_0x745eba[_0x934d('0x65')][_0x934d('0x65')],'phone':_0x438524,'SmsAccountId':_0x344fcb['id'],'UserId':_0x745eba[_0x934d('0x5f')]['id'],'ContactId':_0x3c5013['id']})]},{'include':[{'model':db[_0x934d('0xcd')],'as':'Messages'}]})[_0x934d('0x21')](function(_0x27a217){return[_0x27a217,!![]];});});}})[_0x934d('0xa6')](function(_0x1ab45b,_0x178aab){if(_0x178aab){return _0x1ab45b;}return db[_0x934d('0xcd')][_0x934d('0x5c')](_[_0x934d('0x4f')](_0x745eba[_0x934d('0x65')],{'read':![],'body':_0x745eba[_0x934d('0x65')][_0x934d('0x65')],'phone':_0x438524,'SmsAccountId':_0x344fcb['id'],'SmsInteractionId':_0x1ab45b['id'],'UserId':_0x745eba[_0x934d('0x5f')]['id'],'ContactId':_0x3c5013['id']}))[_0x934d('0x21')](function(_0x502c9a){_0x1ab45b[_0x934d('0xce')][_0x934d('0xcf')]=[];_0x1ab45b['dataValues'][_0x934d('0xcf')][_0x934d('0xa8')](_0x502c9a['dataValues']);return _0x1ab45b;});})[_0x934d('0x21')](respondWithResult(_0x266137,null))[_0x934d('0x2a')](handleError(_0x266137,null));};exports[_0x934d('0x2c')]=function(_0x36b4df,_0x1df140,_0x159889){if(_0x36b4df[_0x934d('0x65')]['id']){delete _0x36b4df[_0x934d('0x65')]['id'];}var _0x21ed84,_0x4acefe,_0x5c3ecc;return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x36b4df[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x1df140,null))[_0x934d('0x21')](function(_0x2e81b6){if(_0x2e81b6){_0x5c3ecc=_0x2e81b6;logger[_0x934d('0x23')](_0x934d('0x24'),'status',_0x934d('0xd0'),_0x2e81b6['type'],util[_0x934d('0xd1')](_0x36b4df['body'],{'showHidden':![],'depth':null}));switch(_0x2e81b6[_0x934d('0x41')]){case _0x934d('0x8b'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0xd2')]&&_0x36b4df[_0x934d('0x65')][_0x934d('0x2c')]){_0x4acefe=_0x36b4df[_0x934d('0x65')][_0x934d('0x2c')];return db['SmsMessage']['find']({'where':{'messageId':_0x36b4df[_0x934d('0x65')][_0x934d('0xd2')]}});}break;case _0x934d('0xd3'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0xd4')]&&_0x36b4df[_0x934d('0x65')][_0x934d('0xd5')]){_0x4acefe=_0x36b4df[_0x934d('0x65')][_0x934d('0xd5')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')]['requestid']}});}break;case _0x934d('0x8d'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0x8e')]&&_0x36b4df['body'][_0x934d('0xd6')]){_0x4acefe=_0x36b4df[_0x934d('0x65')][_0x934d('0xd6')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')][_0x934d('0x8e')]}});}break;case'infobip':var _0x532aad=_0x36b4df[_0x934d('0x65')][_0x934d('0x92')][0x0];if(_0x532aad[_0x934d('0x89')]&&_0x532aad[_0x934d('0x2c')][_0x934d('0xd7')]===_0x934d('0xd8')){_0x4acefe=_0x532aad['status'][_0x934d('0xd7')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x532aad[_0x934d('0x89')]}});}break;case _0x934d('0xd9'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0x89')]&&_0x36b4df[_0x934d('0x65')]['status']){_0x4acefe=_0x36b4df['body'][_0x934d('0x2c')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')][_0x934d('0x89')]}});}break;case _0x934d('0x95'):if(_0x36b4df[_0x934d('0x65')][0x0][_0x934d('0x28')]['id']){_0x4acefe=_0x36b4df[_0x934d('0x65')][0x0][_0x934d('0x41')];return db[_0x934d('0xcd')][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')][0x0][_0x934d('0x28')]['id']}});}break;case _0x934d('0x96'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0xda')]&&_0x36b4df[_0x934d('0x65')]['status']){_0x4acefe=_0x36b4df[_0x934d('0x65')]['status'];return db[_0x934d('0xcd')][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df['body'][_0x934d('0xda')]}});}break;}}})[_0x934d('0x21')](handleEntityNotFound(_0x1df140,null))['then'](function(_0x226649){if(_0x226649){_0x21ed84=_0x226649;switch(_0x5c3ecc[_0x934d('0x41')]){case'skebby':if(_0x4acefe===_0x934d('0xd8')){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x8b'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0xd3'):if(_0x4acefe==='1'){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x8b'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0x8d'):if(!_0x36b4df[_0x934d('0x65')]['error_code']&&_0x4acefe>=0xc8&&_0x4acefe<=0xce){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x934d('0x2c'),'clicksend',util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4521aa=_0x36b4df[_0x934d('0x65')][_0x934d('0x92')][0x0];if(_0x4521aa[_0x934d('0x2c')][_0x934d('0xd7')]===_0x934d('0xd8')){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x91'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0xd9'):if(_0x4acefe==_0x934d('0xdb')||_0x4acefe==_0x934d('0xdc')){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0xd9'),util['inspect'](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0x95'):if(_0x4acefe=='message-delivered'){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x95'),util['inspect'](_0x36b4df['body'],{'showHidden':![],'depth':null}));}break;case _0x934d('0x96'):if(_0x4acefe===_0x934d('0xdd')||_0x4acefe===_0x934d('0xde')){return _0x21ed84['update']({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x96'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x21ed84;}})[_0x934d('0x21')](respondWithResult(_0x1df140,null))[_0x934d('0x2a')](handleError(_0x1df140,null));};exports[_0x934d('0xdf')]=function(_0x36677f,_0x46b760,_0x15a4ce){var _0x56325d,_0x35920c,_0x3a41c5;return db[_0x934d('0x53')]['find']({'where':{'id':_0x36677f[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0x46b760,null))['then'](function(_0x49a8d5){if(_0x49a8d5){_0x3a41c5=_0x49a8d5;logger[_0x934d('0x23')](_0x934d('0x24'),'status',_0x934d('0xd0'),_0x49a8d5[_0x934d('0x41')],util[_0x934d('0xd1')](_0x36677f['query'],{'showHidden':![],'depth':null}));switch(_0x49a8d5[_0x934d('0x41')]){case _0x934d('0x93'):if(_0x36677f['query'][_0x934d('0xe0')]&&_0x36677f[_0x934d('0x44')][_0x934d('0xe1')]){_0x35920c=_0x36677f[_0x934d('0x44')]['state'];return db[_0x934d('0xcd')]['find']({'where':{'messageId':_0x36677f[_0x934d('0x44')][_0x934d('0xe0')]}});}break;}}})[_0x934d('0x21')](handleEntityNotFound(_0x46b760,null))[_0x934d('0x21')](function(_0x36c4dc){if(_0x36c4dc){_0x56325d=_0x36c4dc;switch(_0x3a41c5[_0x934d('0x41')]){case _0x934d('0x93'):if(_0x35920c==='2'||_0x35920c==='6'){return _0x56325d[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')](_0x934d('0x24'),'status',_0x934d('0x93'),util['inspect'](_0x36677f[_0x934d('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x56325d;}})[_0x934d('0x21')](respondWithResult(_0x46b760,null))[_0x934d('0x2a')](handleError(_0x46b760,null));};exports[_0x934d('0xe2')]=function(_0x5f4c96,_0xfbdf08,_0x7ee685){return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x5f4c96['params']['id']}})[_0x934d('0x21')](handleEntityNotFound(_0xfbdf08,null))[_0x934d('0x21')](function(_0x48c3cb){if(_0x48c3cb){return _0x48c3cb[_0x934d('0xe2')](_0x5f4c96['body']['ids'],_[_0x934d('0xa3')](_0x5f4c96[_0x934d('0x65')],[_0x934d('0x6e'),'id'])||{})[_0x934d('0xa6')](function(_0x47bf01){for(var _0x5dbfd=0x0;_0x5dbfd<_0x5f4c96['body'][_0x934d('0x6e')]['length'];_0x5dbfd+=0x1){socket[_0x934d('0xe3')](_0x934d('0xe4'),{'UserId':Number(_0x5f4c96[_0x934d('0x65')][_0x934d('0x6e')][_0x5dbfd]),'SmsAccountId':Number(_0x5f4c96[_0x934d('0x59')]['id'])});}return _0x47bf01;});}})['then'](respondWithResult(_0xfbdf08,null))[_0x934d('0x2a')](handleError(_0xfbdf08,null));};exports[_0x934d('0xe5')]=function(_0x436b53,_0x510ded,_0x15da5a){return db['SmsAccount']['find']({'where':{'id':_0x436b53[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x510ded,null))['then'](function(_0x567393){if(_0x567393){return _0x567393['removeAgents'](_0x436b53['query'][_0x934d('0x6e')])['then'](function(){if(_[_0x934d('0xe6')](_0x436b53['query']['ids'])){for(var _0x133b29=0x0;_0x133b29<_0x436b53[_0x934d('0x44')][_0x934d('0x6e')][_0x934d('0x49')];_0x133b29+=0x1){socket[_0x934d('0xe3')](_0x934d('0xe7'),{'UserId':Number(_0x436b53[_0x934d('0x44')]['ids'][_0x133b29]),'SmsAccountId':Number(_0x436b53[_0x934d('0x59')]['id'])});}}else{socket[_0x934d('0xe3')](_0x934d('0xe7'),{'UserId':Number(_0x436b53[_0x934d('0x44')][_0x934d('0x6e')]),'SmsAccountId':Number(_0x436b53['params']['id'])});}});}})['then'](respondWithStatusCode(_0x510ded,null))[_0x934d('0x2a')](handleError(_0x510ded,null));};exports[_0x934d('0xe8')]=function(_0x1e1e8f,_0x386b97,_0x8d8335){var _0x3cf5ad={};var _0x588746={};var _0x2ae05a;var _0x322aad;return db[_0x934d('0x53')][_0x934d('0x6a')]({'where':{'id':_0x1e1e8f[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x386b97,null))['then'](function(_0x4674bb){if(_0x4674bb){_0x2ae05a=_0x4674bb;_0x588746[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0xb0')][_0x934d('0x72')]);_0x588746[_0x934d('0x44')]=_[_0x934d('0x43')](_0x1e1e8f[_0x934d('0x44')]);_0x588746[_0x934d('0x45')]=_[_0x934d('0x47')](_0x588746['model'],_0x588746[_0x934d('0x44')]);_0x3cf5ad[_0x934d('0x46')]=_['intersection'](_0x588746[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x1e1e8f[_0x934d('0x44')][_0x934d('0x48')]));_0x3cf5ad['attributes']=_0x3cf5ad[_0x934d('0x46')][_0x934d('0x49')]?_0x3cf5ad[_0x934d('0x46')]:_0x588746[_0x934d('0x5a')];_0x3cf5ad['order']=qs['sort'](_0x1e1e8f[_0x934d('0x44')][_0x934d('0x4c')]);_0x3cf5ad[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x1e1e8f[_0x934d('0x44')],_0x588746[_0x934d('0x45')]));if(_0x1e1e8f[_0x934d('0x44')][_0x934d('0x51')]){_0x3cf5ad[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x3cf5ad[_0x934d('0x4e')],{'$or':_['map'](_0x3cf5ad[_0x934d('0x46')],function(_0x3911c7){var _0x128b52={};_0x128b52[_0x3911c7]={'$like':'%'+_0x1e1e8f[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x128b52;})});}_0x3cf5ad=_[_0x934d('0x4f')]({},_0x3cf5ad,_0x1e1e8f[_0x934d('0x52')]);return _0x2ae05a['getAgents'](_0x3cf5ad);}})['then'](function(_0x144f34){if(_0x144f34){_0x322aad=_0x144f34['length'];if(!_0x1e1e8f['query']['hasOwnProperty'](_0x934d('0x6c'))){_0x3cf5ad[_0x934d('0x31')]=qs[_0x934d('0x31')](_0x1e1e8f[_0x934d('0x44')]['limit']);_0x3cf5ad[_0x934d('0x2e')]=qs['offset'](_0x1e1e8f[_0x934d('0x44')]['offset']);}return _0x2ae05a[_0x934d('0xe8')](_0x3cf5ad);}})[_0x934d('0x21')](function(_0x494348){if(_0x494348){return _0x494348?{'count':_0x322aad,'rows':_0x494348}:null;}})[_0x934d('0x21')](respondWithResult(_0x386b97,null))[_0x934d('0x2a')](handleError(_0x386b97,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index bdd1767..e797ed3 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 _0x37a9=['emit','hasOwnProperty','hook','events','SmsAccount','setMaxListeners','update'];(function(_0x208561,_0x22cb16){var _0x328039=function(_0x2e7a0f){while(--_0x2e7a0f){_0x208561['push'](_0x208561['shift']());}};_0x328039(++_0x22cb16);}(_0x37a9,0x192));var _0x937a=function(_0x7b5bd2,_0x48f2b5){_0x7b5bd2=_0x7b5bd2-0x0;var _0x594a62=_0x37a9[_0x7b5bd2];return _0x594a62;};'use strict';var EventEmitter=require(_0x937a('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x937a('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x937a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x937a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44bbf7){return function(_0x492456,_0x2aa6f2,_0x33d8dd){SmsAccountEvents[_0x937a('0x4')](_0x44bbf7+':'+_0x492456['id'],_0x492456);SmsAccountEvents['emit'](_0x44bbf7,_0x492456);_0x33d8dd(null);};}for(var e in events){if(events[_0x937a('0x5')](e)){var event=events[e];SmsAccount[_0x937a('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xa541=['remove','exports','../../mysqldb','SmsAccount','save','update'];(function(_0x4c7741,_0x34e467){var _0x43b02a=function(_0x292c88){while(--_0x292c88){_0x4c7741['push'](_0x4c7741['shift']());}};_0x43b02a(++_0x34e467);}(_0xa541,0x10a));var _0x1a54=function(_0x2f7f77,_0x1881e2){_0x2f7f77=_0x2f7f77-0x0;var _0x32cd81=_0xa541[_0x2f7f77];return _0x32cd81;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x1a54('0x0'))['db'][_0x1a54('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1a54('0x2'),'afterUpdate':_0x1a54('0x3'),'afterDestroy':_0x1a54('0x4')};function emitEvent(_0x29b59f){return function(_0x3c9aeb,_0x5ca6fb,_0x16e179){SmsAccountEvents['emit'](_0x29b59f+':'+_0x3c9aeb['id'],_0x3c9aeb);SmsAccountEvents['emit'](_0x29b59f,_0x3c9aeb);_0x16e179(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x1a54('0x5')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d9994fd..2bc6638 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 _0x2c2f=['../../config/environment','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0x2c2f,0xdc));var _0xf2c2=function(_0x17dee4,_0x569c71){_0x17dee4=_0x17dee4-0x0;var _0xfa0f08=_0x2c2f[_0x17dee4];return _0xfa0f08;};'use strict';var _=require(_0xf2c2('0x0'));var util=require(_0xf2c2('0x1'));var logger=require(_0xf2c2('0x2'))(_0xf2c2('0x3'));var moment=require(_0xf2c2('0x4'));var BPromise=require('bluebird');var rp=require(_0xf2c2('0x5'));var fs=require('fs');var path=require(_0xf2c2('0x6'));var rimraf=require(_0xf2c2('0x7'));var config=require(_0xf2c2('0x8'));var attributes=require('./smsAccount.attributes');module[_0xf2c2('0x9')]=function(_0x3adbbc,_0x4de742){return _0x3adbbc['define'](_0xf2c2('0xa'),attributes,{'tableName':_0xf2c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9cb=['api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0xb9cb,0x191));var _0xbb9c=function(_0x35c300,_0x284351){_0x35c300=_0x35c300-0x0;var _0x59e44b=_0xb9cb[_0x35c300];return _0x59e44b;};'use strict';var _=require(_0xbb9c('0x0'));var util=require(_0xbb9c('0x1'));var logger=require('../../config/logger')(_0xbb9c('0x2'));var moment=require(_0xbb9c('0x3'));var BPromise=require(_0xbb9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb9c('0x5'));var rimraf=require(_0xbb9c('0x6'));var config=require(_0xbb9c('0x7'));var attributes=require(_0xbb9c('0x8'));module[_0xbb9c('0x9')]=function(_0x11498b,_0x10242b){return _0x11498b[_0xbb9c('0xa')](_0xbb9c('0xb'),attributes,{'tableName':_0xbb9c('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 a49ce05..1e4106c 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 _0x0b9e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','model','map','lodash'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x0b9e,0xa3));var _0xe0b9=function(_0x1a42b6,_0x44ca6e){_0x1a42b6=_0x1a42b6-0x0;var _0x2054b3=_0x0b9e[_0x1a42b6];return _0x2054b3;};'use strict';var _=require(_0xe0b9('0x0'));var util=require(_0xe0b9('0x1'));var moment=require(_0xe0b9('0x2'));var BPromise=require(_0xe0b9('0x3'));var rs=require(_0xe0b9('0x4'));var fs=require('fs');var Redis=require(_0xe0b9('0x5'));var db=require(_0xe0b9('0x6'))['db'];var utils=require(_0xe0b9('0x7'));var logger=require(_0xe0b9('0x8'))(_0xe0b9('0x9'));var config=require(_0xe0b9('0xa'));var jayson=require(_0xe0b9('0xb'));var client=jayson[_0xe0b9('0xc')]['http']({'port':0x232a});config[_0xe0b9('0xd')]=_[_0xe0b9('0xe')](config[_0xe0b9('0xd')],{'host':_0xe0b9('0xf'),'port':0x18eb});var socket=require(_0xe0b9('0x10'))(new Redis(config[_0xe0b9('0xd')]));require(_0xe0b9('0x11'))[_0xe0b9('0x12')](socket);function respondWithRpcPromise(_0x5ce2e3,_0x454b8e,_0x4f990e){return new BPromise(function(_0x462805,_0xea2857){return client[_0xe0b9('0x13')](_0x5ce2e3,_0x4f990e)[_0xe0b9('0x14')](function(_0x307b57){logger['info'](_0xe0b9('0x15'),_0x454b8e,_0xe0b9('0x16'));logger[_0xe0b9('0x17')](_0xe0b9('0x18'),_0x454b8e,_0xe0b9('0x16'),JSON[_0xe0b9('0x19')](_0x307b57));if(_0x307b57[_0xe0b9('0x1a')]){if(_0x307b57[_0xe0b9('0x1a')][_0xe0b9('0x1b')]===0x1f4){logger[_0xe0b9('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x454b8e,_0x307b57[_0xe0b9('0x1a')][_0xe0b9('0x1c')]);return _0xea2857(_0x307b57[_0xe0b9('0x1a')][_0xe0b9('0x1c')]);}logger[_0xe0b9('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x454b8e,_0x307b57['error'][_0xe0b9('0x1c')]);return _0x462805(_0x307b57[_0xe0b9('0x1a')]['message']);}else{logger[_0xe0b9('0x1d')](_0xe0b9('0x15'),_0x454b8e,_0xe0b9('0x16'));_0x462805(_0x307b57[_0xe0b9('0x1e')][_0xe0b9('0x1c')]);}})[_0xe0b9('0x1f')](function(_0x43b7c2){logger['error'](_0xe0b9('0x15'),_0x454b8e,_0x43b7c2);_0xea2857(_0x43b7c2);});});}exports[_0xe0b9('0x20')]=function(_0x1efeb8){var _0x166c6b=this;return new Promise(function(_0x317015,_0x5dbc43){return db[_0xe0b9('0x21')][_0xe0b9('0x22')]({'raw':_0x1efeb8[_0xe0b9('0x23')]?_0x1efeb8[_0xe0b9('0x23')]['raw']===undefined?!![]:![]:!![],'where':_0x1efeb8[_0xe0b9('0x23')]?_0x1efeb8[_0xe0b9('0x23')][_0xe0b9('0x24')]||null:null,'attributes':_0x1efeb8[_0xe0b9('0x23')]?_0x1efeb8[_0xe0b9('0x23')][_0xe0b9('0x25')]||null:null,'include':_0x1efeb8[_0xe0b9('0x23')]?_0x1efeb8['options'][_0xe0b9('0x26')]?_['map'](_0x1efeb8[_0xe0b9('0x23')]['include'],function(_0x4b6903){return{'model':db[_0x4b6903[_0xe0b9('0x27')]],'as':_0x4b6903['as'],'attributes':_0x4b6903[_0xe0b9('0x25')],'include':_0x4b6903[_0xe0b9('0x26')]?_[_0xe0b9('0x28')](_0x4b6903['include'],function(_0x2464df){return{'model':db[_0x2464df[_0xe0b9('0x27')]],'as':_0x2464df['as'],'attributes':_0x2464df[_0xe0b9('0x25')],'include':_0x2464df[_0xe0b9('0x26')]?_[_0xe0b9('0x28')](_0x2464df[_0xe0b9('0x26')],function(_0x5ac77e){return{'model':db[_0x5ac77e[_0xe0b9('0x27')]],'as':_0x5ac77e['as'],'attributes':_0x5ac77e[_0xe0b9('0x25')]};}):[]};}):[]};}):[]:[]})[_0xe0b9('0x14')](function(_0x590d72){logger[_0xe0b9('0x1d')]('ShowSmsAccount',_0x1efeb8);logger[_0xe0b9('0x17')](_0xe0b9('0x20'),_0x1efeb8,JSON[_0xe0b9('0x19')](_0x590d72));_0x317015(_0x590d72);})[_0xe0b9('0x1f')](function(_0x38d77e){logger[_0xe0b9('0x1a')](_0xe0b9('0x20'),_0x38d77e[_0xe0b9('0x1c')],_0x1efeb8);_0x5dbc43(_0x166c6b['error'](0x1f4,_0x38d77e[_0xe0b9('0x1c')]));});});}; \ No newline at end of file +var _0x9120=['request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSmsAccount','find','options','raw','where','attributes','map','include','model','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsAccount.socket','register'];(function(_0x4eab11,_0x420bfb){var _0x417a63=function(_0x35f378){while(--_0x35f378){_0x4eab11['push'](_0x4eab11['shift']());}};_0x417a63(++_0x420bfb);}(_0x9120,0xe0));var _0x0912=function(_0x5a37a1,_0x57a269){_0x5a37a1=_0x5a37a1-0x0;var _0x2581a7=_0x9120[_0x5a37a1];return _0x2581a7;};'use strict';var _=require(_0x0912('0x0'));var util=require('util');var moment=require(_0x0912('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0912('0x2'));var db=require(_0x0912('0x3'))['db'];var utils=require(_0x0912('0x4'));var logger=require(_0x0912('0x5'))('rpc');var config=require(_0x0912('0x6'));var jayson=require(_0x0912('0x7'));var client=jayson[_0x0912('0x8')]['http']({'port':0x232a});config[_0x0912('0x9')]=_[_0x0912('0xa')](config['redis'],{'host':_0x0912('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0912('0x9')]));require(_0x0912('0xc'))[_0x0912('0xd')](socket);function respondWithRpcPromise(_0x4cfdb0,_0x2de88a,_0x2de010){return new BPromise(function(_0x3caaa8,_0x3da41b){return client[_0x0912('0xe')](_0x4cfdb0,_0x2de010)[_0x0912('0xf')](function(_0x435761){logger[_0x0912('0x10')](_0x0912('0x11'),_0x2de88a,'request\x20sent');logger[_0x0912('0x12')](_0x0912('0x13'),_0x2de88a,_0x0912('0x14'),JSON['stringify'](_0x435761));if(_0x435761[_0x0912('0x15')]){if(_0x435761[_0x0912('0x15')]['code']===0x1f4){logger['error'](_0x0912('0x11'),_0x2de88a,_0x435761[_0x0912('0x15')][_0x0912('0x16')]);return _0x3da41b(_0x435761['error'][_0x0912('0x16')]);}logger[_0x0912('0x15')](_0x0912('0x11'),_0x2de88a,_0x435761[_0x0912('0x15')][_0x0912('0x16')]);return _0x3caaa8(_0x435761['error'][_0x0912('0x16')]);}else{logger['info'](_0x0912('0x11'),_0x2de88a,_0x0912('0x14'));_0x3caaa8(_0x435761[_0x0912('0x17')]['message']);}})[_0x0912('0x18')](function(_0x1297f2){logger['error'](_0x0912('0x11'),_0x2de88a,_0x1297f2);_0x3da41b(_0x1297f2);});});}exports[_0x0912('0x19')]=function(_0x40d964){var _0x4592c1=this;return new Promise(function(_0x221f87,_0x478724){return db['SmsAccount'][_0x0912('0x1a')]({'raw':_0x40d964[_0x0912('0x1b')]?_0x40d964[_0x0912('0x1b')][_0x0912('0x1c')]===undefined?!![]:![]:!![],'where':_0x40d964['options']?_0x40d964[_0x0912('0x1b')][_0x0912('0x1d')]||null:null,'attributes':_0x40d964[_0x0912('0x1b')]?_0x40d964[_0x0912('0x1b')][_0x0912('0x1e')]||null:null,'include':_0x40d964[_0x0912('0x1b')]?_0x40d964[_0x0912('0x1b')]['include']?_[_0x0912('0x1f')](_0x40d964['options'][_0x0912('0x20')],function(_0x28fdb4){return{'model':db[_0x28fdb4['model']],'as':_0x28fdb4['as'],'attributes':_0x28fdb4['attributes'],'include':_0x28fdb4[_0x0912('0x20')]?_[_0x0912('0x1f')](_0x28fdb4[_0x0912('0x20')],function(_0x88406b){return{'model':db[_0x88406b[_0x0912('0x21')]],'as':_0x88406b['as'],'attributes':_0x88406b[_0x0912('0x1e')],'include':_0x88406b[_0x0912('0x20')]?_['map'](_0x88406b[_0x0912('0x20')],function(_0x407583){return{'model':db[_0x407583[_0x0912('0x21')]],'as':_0x407583['as'],'attributes':_0x407583[_0x0912('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0912('0xf')](function(_0x3db297){logger[_0x0912('0x10')](_0x0912('0x19'),_0x40d964);logger['debug']('ShowSmsAccount',_0x40d964,JSON['stringify'](_0x3db297));_0x221f87(_0x3db297);})[_0x0912('0x18')](function(_0x7f137b){logger[_0x0912('0x15')](_0x0912('0x19'),_0x7f137b[_0x0912('0x16')],_0x40d964);_0x478724(_0x4592c1[_0x0912('0x15')](0x1f4,_0x7f137b[_0x0912('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 638c155..a254518 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 8de8573..341c4c6 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x477885,_0x101b64){var _0x1621be=function(_0x17d945){while(--_0x17d945){_0x477885['push'](_0x477885['shift']());}};_0x1621be(++_0x101b64);}(_0xedd9,0xfc));var _0x9edd=function(_0x187699,_0x2bff8f){_0x187699=_0x187699-0x0;var _0x45f107=_0xedd9[_0x187699];return _0x45f107;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xc4c628,_0x552c85){var _0x168519=function(_0x45e66b){while(--_0x45e66b){_0xc4c628['push'](_0xc4c628['shift']());}};_0x168519(++_0x552c85);}(_0x55ca,0x126));var _0xa55c=function(_0x1fb6ff,_0x474709){_0x1fb6ff=_0x1fb6ff-0x0;var _0x339f61=_0x55ca[_0x1fb6ff];return _0x339f61;};'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['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 300d5f1..e1c6071 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 _0xdbaf=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x12fcbd,_0x884804){var _0x28ec2a=function(_0xa5ff99){while(--_0xa5ff99){_0x12fcbd['push'](_0x12fcbd['shift']());}};_0x28ec2a(++_0x884804);}(_0xdbaf,0x105));var _0xfdba=function(_0x1e44bb,_0x7727fc){_0x1e44bb=_0x1e44bb-0x0;var _0x5471fb=_0xdbaf[_0x1e44bb];return _0x5471fb;};'use strict';var Sequelize=require(_0xfdba('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfdba('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfdba('0x2')],'allowNull':![],'defaultValue':_0xfdba('0x3')},'appdata':{'type':Sequelize[_0xfdba('0x4')]()},'description':{'type':Sequelize[_0xfdba('0x2')]},'interval':{'type':Sequelize[_0xfdba('0x2')],'defaultValue':_0xfdba('0x5')}}; \ No newline at end of file +var _0xb02b=['STRING','TEXT','*,*,*,*'];(function(_0x6c75da,_0x1b96d6){var _0x5f5d21=function(_0x5ef793){while(--_0x5ef793){_0x6c75da['push'](_0x6c75da['shift']());}};_0x5f5d21(++_0x1b96d6);}(_0xb02b,0x6f));var _0xbb02=function(_0x26c31c,_0x58d241){_0x26c31c=_0x26c31c-0x0;var _0x44d20d=_0xb02b[_0x26c31c];return _0x44d20d;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbb02('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbb02('0x1')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbb02('0x2')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 08a9fa6..fecab9b 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 _0x6e96=['send','SmsApplication','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','error','stack','name'];(function(_0x3a886b,_0x24db41){var _0x4c54f6=function(_0xe20f1a){while(--_0xe20f1a){_0x3a886b['push'](_0x3a886b['shift']());}};_0x4c54f6(++_0x24db41);}(_0x6e96,0x18f));var _0x66e9=function(_0x3e8332,_0x2faae2){_0x3e8332=_0x3e8332-0x0;var _0x1ec952=_0x6e96[_0x3e8332];return _0x1ec952;};'use strict';var emlformat=require(_0x66e9('0x0'));var rimraf=require(_0x66e9('0x1'));var zipdir=require(_0x66e9('0x2'));var jsonpatch=require(_0x66e9('0x3'));var rp=require(_0x66e9('0x4'));var moment=require(_0x66e9('0x5'));var BPromise=require(_0x66e9('0x6'));var Mustache=require('mustache');var util=require(_0x66e9('0x7'));var path=require(_0x66e9('0x8'));var sox=require(_0x66e9('0x9'));var csv=require(_0x66e9('0xa'));var ejs=require(_0x66e9('0xb'));var fs=require('fs');var fs_extra=require(_0x66e9('0xc'));var _=require(_0x66e9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x66e9('0xa'));var querystring=require(_0x66e9('0xe'));var Papa=require(_0x66e9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x66e9('0x10'));var as=require(_0x66e9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x66e9('0x12'));var utils=require(_0x66e9('0x13'));var config=require(_0x66e9('0x14'));var licenseUtil=require(_0x66e9('0x15'));var db=require(_0x66e9('0x16'))['db'];function respondWithStatusCode(_0x14821b,_0x282ded){_0x282ded=_0x282ded||0xcc;return function(_0xd1ef8b){if(_0xd1ef8b){return _0x14821b[_0x66e9('0x17')](_0x282ded);}return _0x14821b[_0x66e9('0x18')](_0x282ded)[_0x66e9('0x19')]();};}function respondWithResult(_0x3f109f,_0x3fc333){_0x3fc333=_0x3fc333||0xc8;return function(_0x5d701c){if(_0x5d701c){return _0x3f109f[_0x66e9('0x18')](_0x3fc333)['json'](_0x5d701c);}};}function respondWithFilteredResult(_0x53a5fc,_0x3a005b){return function(_0x105fea){if(_0x105fea){var _0xcf016a=typeof _0x3a005b[_0x66e9('0x1a')]===_0x66e9('0x1b')&&typeof _0x3a005b[_0x66e9('0x1c')]===_0x66e9('0x1b');var _0x12ae8a=_0x105fea['count'];var _0x2167d9=_0xcf016a?0x0:_0x3a005b['offset'];var _0x1f7f9b=_0xcf016a?_0x105fea[_0x66e9('0x1d')]:_0x3a005b['offset']+_0x3a005b[_0x66e9('0x1c')];var _0x1380eb;if(_0x1f7f9b>=_0x12ae8a){_0x1f7f9b=_0x12ae8a;_0x1380eb=0xc8;}else{_0x1380eb=0xce;}_0x53a5fc[_0x66e9('0x18')](_0x1380eb);return _0x53a5fc[_0x66e9('0x1e')]('Content-Range',_0x2167d9+'-'+_0x1f7f9b+'/'+_0x12ae8a)[_0x66e9('0x1f')](_0x105fea);}return null;};}function patchUpdates(_0x48e11c){return function(_0x1965c5){try{jsonpatch[_0x66e9('0x20')](_0x1965c5,_0x48e11c,!![]);}catch(_0xe400cc){return BPromise[_0x66e9('0x21')](_0xe400cc);}return _0x1965c5[_0x66e9('0x22')]();};}function saveUpdates(_0x3ddedd,_0x17e5a2){return function(_0x563adf){if(_0x563adf){return _0x563adf['update'](_0x3ddedd)[_0x66e9('0x23')](function(_0x347575){return _0x347575;});}return null;};}function removeEntity(_0x101e42,_0x4031ec){return function(_0x532d8b){if(_0x532d8b){return _0x532d8b['destroy']()[_0x66e9('0x23')](function(){_0x101e42[_0x66e9('0x18')](0xcc)[_0x66e9('0x19')]();});}};}function handleEntityNotFound(_0x114040,_0x39ec8a){return function(_0x43978f){if(!_0x43978f){_0x114040[_0x66e9('0x17')](0x194);}return _0x43978f;};}function handleError(_0x4e3c54,_0xf395d){_0xf395d=_0xf395d||0x1f4;return function(_0x55a055){logger[_0x66e9('0x24')](_0x55a055[_0x66e9('0x25')]);if(_0x55a055[_0x66e9('0x26')]){delete _0x55a055['name'];}_0x4e3c54[_0x66e9('0x18')](_0xf395d)[_0x66e9('0x27')](_0x55a055);};}exports['index']=function(_0x4339db,_0x165fba){var _0x4ae7e8={},_0x171704={},_0x5a4ab3={'count':0x0,'rows':[]};var _0x23343f=_['map'](db[_0x66e9('0x28')][_0x66e9('0x29')],function(_0x14dc78){return{'name':_0x14dc78[_0x66e9('0x2a')],'type':_0x14dc78['type']['key']};});_0x171704[_0x66e9('0x2b')]=_['map'](_0x23343f,_0x66e9('0x26'));_0x171704[_0x66e9('0x2c')]=_['keys'](_0x4339db[_0x66e9('0x2c')]);_0x171704['filters']=_[_0x66e9('0x2d')](_0x171704[_0x66e9('0x2b')],_0x171704[_0x66e9('0x2c')]);_0x4ae7e8['attributes']=_['intersection'](_0x171704[_0x66e9('0x2b')],qs[_0x66e9('0x2e')](_0x4339db[_0x66e9('0x2c')]['fields']));_0x4ae7e8[_0x66e9('0x2f')]=_0x4ae7e8[_0x66e9('0x2f')][_0x66e9('0x30')]?_0x4ae7e8[_0x66e9('0x2f')]:_0x171704[_0x66e9('0x2b')];if(!_0x4339db[_0x66e9('0x2c')]['hasOwnProperty'](_0x66e9('0x31'))){_0x4ae7e8[_0x66e9('0x1c')]=qs[_0x66e9('0x1c')](_0x4339db['query'][_0x66e9('0x1c')]);_0x4ae7e8['offset']=qs[_0x66e9('0x1a')](_0x4339db[_0x66e9('0x2c')][_0x66e9('0x1a')]);}_0x4ae7e8[_0x66e9('0x32')]=qs[_0x66e9('0x33')](_0x4339db[_0x66e9('0x2c')][_0x66e9('0x33')]);_0x4ae7e8[_0x66e9('0x34')]=qs[_0x66e9('0x35')](_[_0x66e9('0x36')](_0x4339db[_0x66e9('0x2c')],_0x171704[_0x66e9('0x35')]),_0x23343f);if(_0x4339db[_0x66e9('0x2c')][_0x66e9('0x37')]){_0x4ae7e8[_0x66e9('0x34')]=_[_0x66e9('0x38')](_0x4ae7e8[_0x66e9('0x34')],{'$or':_[_0x66e9('0x39')](_0x23343f,function(_0x205912){if(_0x205912[_0x66e9('0x3a')]!==_0x66e9('0x3b')){var _0x1d99db={};_0x1d99db[_0x205912[_0x66e9('0x26')]]={'$like':'%'+_0x4339db[_0x66e9('0x2c')][_0x66e9('0x37')]+'%'};return _0x1d99db;}})});}_0x4ae7e8=_[_0x66e9('0x38')]({},_0x4ae7e8,_0x4339db[_0x66e9('0x3c')]);var _0x368c69={'where':_0x4ae7e8[_0x66e9('0x34')]};return db[_0x66e9('0x28')]['count'](_0x368c69)[_0x66e9('0x23')](function(_0x32b3bb){_0x5a4ab3[_0x66e9('0x1d')]=_0x32b3bb;if(_0x4339db[_0x66e9('0x2c')][_0x66e9('0x3d')]){_0x4ae7e8['include']=[{'all':!![]}];}return db[_0x66e9('0x28')]['findAll'](_0x4ae7e8);})['then'](function(_0x580c34){_0x5a4ab3[_0x66e9('0x3e')]=_0x580c34;return _0x5a4ab3;})[_0x66e9('0x23')](respondWithFilteredResult(_0x165fba,_0x4ae7e8))[_0x66e9('0x3f')](handleError(_0x165fba,null));};exports[_0x66e9('0x40')]=function(_0x37c605,_0xf7cfae){var _0x591b92={'raw':!![],'where':{'id':_0x37c605[_0x66e9('0x41')]['id']}},_0x275aab={};_0x275aab[_0x66e9('0x2b')]=_[_0x66e9('0x42')](db[_0x66e9('0x28')]['rawAttributes']);_0x275aab[_0x66e9('0x2c')]=_[_0x66e9('0x42')](_0x37c605['query']);_0x275aab['filters']=_[_0x66e9('0x2d')](_0x275aab[_0x66e9('0x2b')],_0x275aab['query']);_0x591b92[_0x66e9('0x2f')]=_[_0x66e9('0x2d')](_0x275aab[_0x66e9('0x2b')],qs['fields'](_0x37c605[_0x66e9('0x2c')][_0x66e9('0x2e')]));_0x591b92['attributes']=_0x591b92[_0x66e9('0x2f')][_0x66e9('0x30')]?_0x591b92[_0x66e9('0x2f')]:_0x275aab['model'];if(_0x37c605[_0x66e9('0x2c')][_0x66e9('0x3d')]){_0x591b92[_0x66e9('0x43')]=[{'all':!![]}];}_0x591b92=_[_0x66e9('0x38')]({},_0x591b92,_0x37c605['options']);return db[_0x66e9('0x28')][_0x66e9('0x44')](_0x591b92)['then'](handleEntityNotFound(_0xf7cfae,null))[_0x66e9('0x23')](respondWithResult(_0xf7cfae,null))[_0x66e9('0x3f')](handleError(_0xf7cfae,null));};exports[_0x66e9('0x45')]=function(_0x682244,_0x3de1f6){return db[_0x66e9('0x28')][_0x66e9('0x45')](_0x682244[_0x66e9('0x46')],{})[_0x66e9('0x23')](respondWithResult(_0x3de1f6,0xc9))['catch'](handleError(_0x3de1f6,null));};exports[_0x66e9('0x47')]=function(_0x450038,_0x3c46c7){if(_0x450038[_0x66e9('0x46')]['id']){delete _0x450038['body']['id'];}return db[_0x66e9('0x28')][_0x66e9('0x44')]({'where':{'id':_0x450038[_0x66e9('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c46c7,null))[_0x66e9('0x23')](saveUpdates(_0x450038['body'],null))[_0x66e9('0x23')](respondWithResult(_0x3c46c7,null))['catch'](handleError(_0x3c46c7,null));};exports[_0x66e9('0x48')]=function(_0x57ae64,_0xca74d0){return db[_0x66e9('0x28')]['find']({'where':{'id':_0x57ae64['params']['id']}})['then'](handleEntityNotFound(_0xca74d0,null))[_0x66e9('0x23')](removeEntity(_0xca74d0,null))['catch'](handleError(_0xca74d0,null));}; \ No newline at end of file +var _0xc103=['count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsApplication','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0xc103,0xc5));var _0x3c10=function(_0x47db69,_0x132873){_0x47db69=_0x47db69-0x0;var _0x38115a=_0xc103[_0x47db69];return _0x38115a;};'use strict';var emlformat=require(_0x3c10('0x0'));var rimraf=require(_0x3c10('0x1'));var zipdir=require(_0x3c10('0x2'));var jsonpatch=require(_0x3c10('0x3'));var rp=require(_0x3c10('0x4'));var moment=require(_0x3c10('0x5'));var BPromise=require(_0x3c10('0x6'));var Mustache=require(_0x3c10('0x7'));var util=require('util');var path=require(_0x3c10('0x8'));var sox=require(_0x3c10('0x9'));var csv=require(_0x3c10('0xa'));var ejs=require(_0x3c10('0xb'));var fs=require('fs');var fs_extra=require(_0x3c10('0xc'));var _=require(_0x3c10('0xd'));var squel=require(_0x3c10('0xe'));var crypto=require('crypto');var jsforce=require(_0x3c10('0xf'));var deskjs=require(_0x3c10('0x10'));var toCsv=require(_0x3c10('0xa'));var querystring=require(_0x3c10('0x11'));var Papa=require('papaparse');var Redis=require(_0x3c10('0x12'));var authService=require(_0x3c10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c10('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3c10('0x15'));var licenseUtil=require(_0x3c10('0x16'));var db=require(_0x3c10('0x17'))['db'];function respondWithStatusCode(_0x1d6136,_0x5894df){_0x5894df=_0x5894df||0xcc;return function(_0x37cf0f){if(_0x37cf0f){return _0x1d6136[_0x3c10('0x18')](_0x5894df);}return _0x1d6136[_0x3c10('0x19')](_0x5894df)[_0x3c10('0x1a')]();};}function respondWithResult(_0x46e7ac,_0x1a5d07){_0x1a5d07=_0x1a5d07||0xc8;return function(_0xb7c215){if(_0xb7c215){return _0x46e7ac[_0x3c10('0x19')](_0x1a5d07)[_0x3c10('0x1b')](_0xb7c215);}};}function respondWithFilteredResult(_0x202fe4,_0x4dd237){return function(_0x4f4617){if(_0x4f4617){var _0x4ea34e=typeof _0x4dd237[_0x3c10('0x1c')]===_0x3c10('0x1d')&&typeof _0x4dd237[_0x3c10('0x1e')]===_0x3c10('0x1d');var _0x83702d=_0x4f4617[_0x3c10('0x1f')];var _0x253fa3=_0x4ea34e?0x0:_0x4dd237[_0x3c10('0x1c')];var _0x15d1c1=_0x4ea34e?_0x4f4617[_0x3c10('0x1f')]:_0x4dd237[_0x3c10('0x1c')]+_0x4dd237[_0x3c10('0x1e')];var _0x745d4;if(_0x15d1c1>=_0x83702d){_0x15d1c1=_0x83702d;_0x745d4=0xc8;}else{_0x745d4=0xce;}_0x202fe4['status'](_0x745d4);return _0x202fe4[_0x3c10('0x20')](_0x3c10('0x21'),_0x253fa3+'-'+_0x15d1c1+'/'+_0x83702d)[_0x3c10('0x1b')](_0x4f4617);}return null;};}function patchUpdates(_0x1864f0){return function(_0x3f3d02){try{jsonpatch['apply'](_0x3f3d02,_0x1864f0,!![]);}catch(_0x20d8c8){return BPromise[_0x3c10('0x22')](_0x20d8c8);}return _0x3f3d02['save']();};}function saveUpdates(_0x1353da,_0x29adc2){return function(_0x50f816){if(_0x50f816){return _0x50f816[_0x3c10('0x23')](_0x1353da)[_0x3c10('0x24')](function(_0xc882b8){return _0xc882b8;});}return null;};}function removeEntity(_0x1fb63b,_0x7a8521){return function(_0x3b0838){if(_0x3b0838){return _0x3b0838[_0x3c10('0x25')]()[_0x3c10('0x24')](function(){_0x1fb63b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x576f25,_0x1b0557){return function(_0x2aa1bf){if(!_0x2aa1bf){_0x576f25[_0x3c10('0x18')](0x194);}return _0x2aa1bf;};}function handleError(_0x34de6e,_0x4a8b60){_0x4a8b60=_0x4a8b60||0x1f4;return function(_0x14b76){logger[_0x3c10('0x26')](_0x14b76[_0x3c10('0x27')]);if(_0x14b76[_0x3c10('0x28')]){delete _0x14b76[_0x3c10('0x28')];}_0x34de6e[_0x3c10('0x19')](_0x4a8b60)[_0x3c10('0x29')](_0x14b76);};}exports[_0x3c10('0x2a')]=function(_0x568dac,_0x474ab1){var _0x3269c3={},_0x5df0e4={},_0x2718c7={'count':0x0,'rows':[]};var _0x44e20b=_[_0x3c10('0x2b')](db['SmsApplication'][_0x3c10('0x2c')],function(_0x50d152){return{'name':_0x50d152[_0x3c10('0x2d')],'type':_0x50d152[_0x3c10('0x2e')][_0x3c10('0x2f')]};});_0x5df0e4['model']=_[_0x3c10('0x2b')](_0x44e20b,_0x3c10('0x28'));_0x5df0e4[_0x3c10('0x30')]=_[_0x3c10('0x31')](_0x568dac[_0x3c10('0x30')]);_0x5df0e4[_0x3c10('0x32')]=_[_0x3c10('0x33')](_0x5df0e4['model'],_0x5df0e4[_0x3c10('0x30')]);_0x3269c3[_0x3c10('0x34')]=_[_0x3c10('0x33')](_0x5df0e4['model'],qs[_0x3c10('0x35')](_0x568dac[_0x3c10('0x30')][_0x3c10('0x35')]));_0x3269c3[_0x3c10('0x34')]=_0x3269c3[_0x3c10('0x34')][_0x3c10('0x36')]?_0x3269c3['attributes']:_0x5df0e4[_0x3c10('0x37')];if(!_0x568dac[_0x3c10('0x30')][_0x3c10('0x38')](_0x3c10('0x39'))){_0x3269c3[_0x3c10('0x1e')]=qs[_0x3c10('0x1e')](_0x568dac[_0x3c10('0x30')][_0x3c10('0x1e')]);_0x3269c3[_0x3c10('0x1c')]=qs[_0x3c10('0x1c')](_0x568dac['query'][_0x3c10('0x1c')]);}_0x3269c3[_0x3c10('0x3a')]=qs['sort'](_0x568dac[_0x3c10('0x30')][_0x3c10('0x3b')]);_0x3269c3[_0x3c10('0x3c')]=qs[_0x3c10('0x32')](_[_0x3c10('0x3d')](_0x568dac[_0x3c10('0x30')],_0x5df0e4[_0x3c10('0x32')]),_0x44e20b);if(_0x568dac['query'][_0x3c10('0x3e')]){_0x3269c3[_0x3c10('0x3c')]=_['merge'](_0x3269c3[_0x3c10('0x3c')],{'$or':_[_0x3c10('0x2b')](_0x44e20b,function(_0x57050a){if(_0x57050a[_0x3c10('0x2e')]!==_0x3c10('0x3f')){var _0x34a81e={};_0x34a81e[_0x57050a[_0x3c10('0x28')]]={'$like':'%'+_0x568dac[_0x3c10('0x30')][_0x3c10('0x3e')]+'%'};return _0x34a81e;}})});}_0x3269c3=_[_0x3c10('0x40')]({},_0x3269c3,_0x568dac[_0x3c10('0x41')]);var _0x3eeaef={'where':_0x3269c3['where']};return db[_0x3c10('0x42')][_0x3c10('0x1f')](_0x3eeaef)['then'](function(_0x26dfcd){_0x2718c7[_0x3c10('0x1f')]=_0x26dfcd;if(_0x568dac[_0x3c10('0x30')][_0x3c10('0x43')]){_0x3269c3[_0x3c10('0x44')]=[{'all':!![]}];}return db['SmsApplication'][_0x3c10('0x45')](_0x3269c3);})[_0x3c10('0x24')](function(_0xf7c9f4){_0x2718c7[_0x3c10('0x46')]=_0xf7c9f4;return _0x2718c7;})[_0x3c10('0x24')](respondWithFilteredResult(_0x474ab1,_0x3269c3))[_0x3c10('0x47')](handleError(_0x474ab1,null));};exports['show']=function(_0x14b45c,_0x4acbba){var _0xbb0fa0={'raw':!![],'where':{'id':_0x14b45c[_0x3c10('0x48')]['id']}},_0x1047a7={};_0x1047a7[_0x3c10('0x37')]=_[_0x3c10('0x31')](db[_0x3c10('0x42')][_0x3c10('0x2c')]);_0x1047a7[_0x3c10('0x30')]=_[_0x3c10('0x31')](_0x14b45c['query']);_0x1047a7[_0x3c10('0x32')]=_[_0x3c10('0x33')](_0x1047a7[_0x3c10('0x37')],_0x1047a7['query']);_0xbb0fa0[_0x3c10('0x34')]=_[_0x3c10('0x33')](_0x1047a7['model'],qs[_0x3c10('0x35')](_0x14b45c[_0x3c10('0x30')][_0x3c10('0x35')]));_0xbb0fa0[_0x3c10('0x34')]=_0xbb0fa0[_0x3c10('0x34')][_0x3c10('0x36')]?_0xbb0fa0[_0x3c10('0x34')]:_0x1047a7[_0x3c10('0x37')];if(_0x14b45c['query'][_0x3c10('0x43')]){_0xbb0fa0[_0x3c10('0x44')]=[{'all':!![]}];}_0xbb0fa0=_['merge']({},_0xbb0fa0,_0x14b45c['options']);return db[_0x3c10('0x42')][_0x3c10('0x49')](_0xbb0fa0)[_0x3c10('0x24')](handleEntityNotFound(_0x4acbba,null))[_0x3c10('0x24')](respondWithResult(_0x4acbba,null))[_0x3c10('0x47')](handleError(_0x4acbba,null));};exports[_0x3c10('0x4a')]=function(_0x2dfdb9,_0x54d536){return db[_0x3c10('0x42')][_0x3c10('0x4a')](_0x2dfdb9[_0x3c10('0x4b')],{})['then'](respondWithResult(_0x54d536,0xc9))[_0x3c10('0x47')](handleError(_0x54d536,null));};exports['update']=function(_0x55893f,_0x10313d){if(_0x55893f[_0x3c10('0x4b')]['id']){delete _0x55893f[_0x3c10('0x4b')]['id'];}return db['SmsApplication'][_0x3c10('0x49')]({'where':{'id':_0x55893f[_0x3c10('0x48')]['id']}})[_0x3c10('0x24')](handleEntityNotFound(_0x10313d,null))[_0x3c10('0x24')](saveUpdates(_0x55893f[_0x3c10('0x4b')],null))[_0x3c10('0x24')](respondWithResult(_0x10313d,null))['catch'](handleError(_0x10313d,null));};exports[_0x3c10('0x25')]=function(_0x42d065,_0x1fcc87){return db[_0x3c10('0x42')]['find']({'where':{'id':_0x42d065['params']['id']}})['then'](handleEntityNotFound(_0x1fcc87,null))[_0x3c10('0x24')](removeEntity(_0x1fcc87,null))[_0x3c10('0x47')](handleError(_0x1fcc87,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index eb554fa..fdefadd 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 _0xd7c7=['exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsApplication.attributes'];(function(_0x2646dc,_0x1449dd){var _0x1a4f6c=function(_0x5a5c20){while(--_0x5a5c20){_0x2646dc['push'](_0x2646dc['shift']());}};_0x1a4f6c(++_0x1449dd);}(_0xd7c7,0xe8));var _0x7d7c=function(_0x4c4487,_0x1c847c){_0x4c4487=_0x4c4487-0x0;var _0x17a013=_0xd7c7[_0x4c4487];return _0x17a013;};'use strict';var _=require('lodash');var util=require(_0x7d7c('0x0'));var logger=require(_0x7d7c('0x1'))(_0x7d7c('0x2'));var moment=require(_0x7d7c('0x3'));var BPromise=require(_0x7d7c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d7c('0x5'));var rimraf=require('rimraf');var config=require(_0x7d7c('0x6'));var attributes=require(_0x7d7c('0x7'));module[_0x7d7c('0x8')]=function(_0x44ca05,_0x58d3cc){return _0x44ca05['define'](_0x7d7c('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d7c('0xa'),'collate':_0x7d7c('0xb')});}; \ No newline at end of file +var _0xd4de=['request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x28bb81,_0x5e15fe){var _0x2c8102=function(_0x1c18c0){while(--_0x1c18c0){_0x28bb81['push'](_0x28bb81['shift']());}};_0x2c8102(++_0x5e15fe);}(_0xd4de,0x173));var _0xed4d=function(_0x51bde5,_0xeed681){_0x51bde5=_0x51bde5-0x0;var _0x5bee3c=_0xd4de[_0x51bde5];return _0x5bee3c;};'use strict';var _=require(_0xed4d('0x0'));var util=require(_0xed4d('0x1'));var logger=require(_0xed4d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xed4d('0x3'));var fs=require('fs');var path=require(_0xed4d('0x4'));var rimraf=require('rimraf');var config=require(_0xed4d('0x5'));var attributes=require(_0xed4d('0x6'));module[_0xed4d('0x7')]=function(_0x1f42e6,_0x27594c){return _0x1f42e6['define'](_0xed4d('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed4d('0x9'),'collate':_0xed4d('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 892c3cd..2086fa3 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 _0xb4f4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x5bb941,_0x5d056d){var _0x2556eb=function(_0x20e0c9){while(--_0x20e0c9){_0x5bb941['push'](_0x5bb941['shift']());}};_0x2556eb(++_0x5d056d);}(_0xb4f4,0xda));var _0x4b4f=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xb4f4[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});} \ No newline at end of file +var _0x4d5a=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x71c2a1,_0x2dab27){var _0x1e142c=function(_0x40fe1a){while(--_0x40fe1a){_0x71c2a1['push'](_0x71c2a1['shift']());}};_0x1e142c(++_0x2dab27);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4d5a[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0xa4d5('0x0'));var moment=require(_0xa4d5('0x1'));var BPromise=require(_0xa4d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4d5('0x3'));var db=require(_0xa4d5('0x4'))['db'];var utils=require(_0xa4d5('0x5'));var logger=require(_0xa4d5('0x6'))('rpc');var config=require(_0xa4d5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856aa,_0x166db3,_0x318315){return new BPromise(function(_0x408db0,_0x3bed6b){return client[_0xa4d5('0x9')](_0x1856aa,_0x318315)['then'](function(_0x5586de){logger[_0xa4d5('0xa')](_0xa4d5('0xb'),_0x166db3,_0xa4d5('0xc'));logger[_0xa4d5('0xd')](_0xa4d5('0xe'),_0x166db3,_0xa4d5('0xc'),JSON[_0xa4d5('0xf')](_0x5586de));if(_0x5586de[_0xa4d5('0x10')]){if(_0x5586de['error']['code']===0x1f4){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x3bed6b(_0x5586de['error']['message']);}logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x408db0(_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x166db3,_0xa4d5('0xc'));_0x408db0(_0x5586de[_0xa4d5('0x12')]['message']);}})[_0xa4d5('0x13')](function(_0x31eed7){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x31eed7);_0x3bed6b(_0x31eed7);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 96dd167..5835b46 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 _0x1775=['/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1775,0x1db));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xa')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5177('0x11')]);router[_0x5177('0xa')](_0x5177('0x12'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);router['post']('/',auth[_0x5177('0xb')](),controller[_0x5177('0x14')]);router[_0x5177('0x15')](_0x5177('0x16'),auth[_0x5177('0xb')](),controller[_0x5177('0x17')]);router[_0x5177('0x15')](_0x5177('0x18'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1b')),controller[_0x5177('0x1c')]);router[_0x5177('0x1d')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1e')),controller['update']);router[_0x5177('0x1f')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')]('sms',_0x5177('0x20')),controller[_0x5177('0x21')]);router[_0x5177('0x1f')]('/:id/tags',auth[_0x5177('0xb')](),controller['removeTags']);module[_0x5177('0x22')]=router; \ No newline at end of file +var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0xfceab,_0x160001){var _0x25807d=function(_0xfeaffd){while(--_0xfeaffd){_0xfceab['push'](_0xfceab['shift']());}};_0x25807d(++_0x160001);}(_0x955f,0x1eb));var _0xf955=function(_0x32b0e8,_0x556d6e){_0x32b0e8=_0x32b0e8-0x0;var _0x22dd0c=_0x955f[_0x32b0e8];return _0x22dd0c;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 37a4b2a..110d31c 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 _0x723e=['exports','BOOLEAN','DATE','STRING','out','ENUM','moment'];(function(_0x4bfd95,_0x1c3b3b){var _0x1484cd=function(_0x2c622b){while(--_0x2c622b){_0x4bfd95['push'](_0x4bfd95['shift']());}};_0x1484cd(++_0x1c3b3b);}(_0x723e,0x179));var _0xe723=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x723e[_0x47c6b9];return _0x34f34d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe723('0x0'));module[_0xe723('0x1')]={'closed':{'type':Sequelize[_0xe723('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe723('0x3')]},'disposition':{'type':Sequelize[_0xe723('0x4')]},'secondDisposition':{'type':Sequelize[_0xe723('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe723('0x4')]},'note':{'type':Sequelize[_0xe723('0x4')]},'phone':{'type':Sequelize[_0xe723('0x4')]},'read1stAt':{'type':Sequelize[_0xe723('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe723('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe723('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe723('0x6')]('in',_0xe723('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe723('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x33ac=['moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x5db4b0,_0x27af13){var _0x9eaa85=function(_0x99c049){while(--_0x99c049){_0x5db4b0['push'](_0x5db4b0['shift']());}};_0x9eaa85(++_0x27af13);}(_0x33ac,0x1f2));var _0xc33a=function(_0x458c18,_0x18ce26){_0x458c18=_0x458c18-0x0;var _0x14fa65=_0x33ac[_0x458c18];return _0x14fa65;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc33a('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc33a('0x1')]},'disposition':{'type':Sequelize[_0xc33a('0x2')]},'secondDisposition':{'type':Sequelize[_0xc33a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc33a('0x2')]},'note':{'type':Sequelize[_0xc33a('0x2')]},'phone':{'type':Sequelize[_0xc33a('0x2')]},'read1stAt':{'type':Sequelize[_0xc33a('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xc33a('0x3')]('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc33a('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 1bd0e4f..5a0f2ac 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 _0x21bc=['emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','format','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Messages','createdAt','direction','Owner','fullname','mkdirSync','Sms','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','System','lastName','out','secret','read','value','renderFile','views','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','error','name','index','map','SmsInteraction','rawAttributes','fieldName','type','key','findAll','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','SmsInteractionId','filter','$gte','split','rows','addTags','spread','color'];(function(_0x3af990,_0x1b5e7f){var _0x4d6065=function(_0x52c923){while(--_0x52c923){_0x3af990['push'](_0x3af990['shift']());}};_0x4d6065(++_0x1b5e7f);}(_0x21bc,0x11d));var _0xc21b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21bc[_0x4565bf];return _0x5610ba;};'use strict';var rimraf=require(_0xc21b('0x0'));var zipdir=require(_0xc21b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xc21b('0x2'));var path=require(_0xc21b('0x3'));var ejs=require(_0xc21b('0x4'));var fs=require('fs');var _=require(_0xc21b('0x5'));var Redis=require(_0xc21b('0x6'));var interaction=require(_0xc21b('0x7'));var qs=require(_0xc21b('0x8'));var pdf=require(_0xc21b('0x9'));var logger=require(_0xc21b('0xa'))(_0xc21b('0xb'));var config=require(_0xc21b('0xc'));var db=require('../../mysqldb')['db'];config[_0xc21b('0xd')]=_[_0xc21b('0xe')](config[_0xc21b('0xd')],{'host':_0xc21b('0xf'),'port':0x18eb});var socket=require(_0xc21b('0x10'))(new Redis(config[_0xc21b('0xd')]));require(_0xc21b('0x11'))[_0xc21b('0x12')](socket);function respondWithStatusCode(_0x53c540,_0x5f2455){_0x5f2455=_0x5f2455||0xcc;return function(_0x2e8e95){if(_0x2e8e95){return _0x53c540[_0xc21b('0x13')](_0x5f2455);}return _0x53c540[_0xc21b('0x14')](_0x5f2455)[_0xc21b('0x15')]();};}function respondWithResult(_0x2c6e40,_0x4a6eca){_0x4a6eca=_0x4a6eca||0xc8;return function(_0xb8d3bf){if(_0xb8d3bf){return _0x2c6e40['status'](_0x4a6eca)[_0xc21b('0x16')](_0xb8d3bf);}};}function respondWithFilteredResult(_0x1e9ed5,_0x36a9f0){return function(_0x766b95){if(_0x766b95){var _0x59798d=typeof _0x36a9f0[_0xc21b('0x17')]==='undefined'&&typeof _0x36a9f0[_0xc21b('0x18')]===_0xc21b('0x19');var _0x59663a=_0x766b95['count'];var _0x5ad87c=_0x59798d?0x0:_0x36a9f0['offset'];var _0x377d54=_0x59798d?_0x766b95[_0xc21b('0x1a')]:_0x36a9f0['offset']+_0x36a9f0['limit'];var _0x1c1bd4;if(_0x377d54>=_0x59663a){_0x377d54=_0x59663a;_0x1c1bd4=0xc8;}else{_0x1c1bd4=0xce;}_0x1e9ed5['status'](_0x1c1bd4);return _0x1e9ed5['set'](_0xc21b('0x1b'),_0x5ad87c+'-'+_0x377d54+'/'+_0x59663a)[_0xc21b('0x16')](_0x766b95);}return null;};}function saveUpdates(_0x583bc3){return function(_0x4e4eb8){if(_0x4e4eb8){return _0x4e4eb8['update'](_0x583bc3)[_0xc21b('0x1c')](function(_0x1e52d4){return _0x1e52d4;});}return null;};}function removeEntity(_0x4a7068){return function(_0xfbc7a4){if(_0xfbc7a4){return _0xfbc7a4[_0xc21b('0x1d')]()['then'](function(){_0x4a7068[_0xc21b('0x14')](0xcc)[_0xc21b('0x15')]();});}};}function handleEntityNotFound(_0x3f8d73){return function(_0x444411){if(!_0x444411){_0x3f8d73['sendStatus'](0x194);}return _0x444411;};}function handleError(_0x43d4eb,_0xb2a09b){_0xb2a09b=_0xb2a09b||0x1f4;return function(_0x3d3f33){logger[_0xc21b('0x1e')](_0x3d3f33['stack']);if(_0x3d3f33[_0xc21b('0x1f')]){delete _0x3d3f33['name'];}_0x43d4eb[_0xc21b('0x14')](_0xb2a09b)['send'](_0x3d3f33);};}exports[_0xc21b('0x20')]=function(_0x9a6995,_0x16a414){var _0x46f8be={};var _0x5adc48=_[_0xc21b('0x21')](db[_0xc21b('0x22')][_0xc21b('0x23')],function(_0x5772cc){return{'name':_0x5772cc[_0xc21b('0x24')],'type':_0x5772cc[_0xc21b('0x25')][_0xc21b('0x26')]};});_0x46f8be=qs['getOptions'](_0x5adc48,_0x9a6995);return interaction[_0xc21b('0x27')]('sms',_0x9a6995[_0xc21b('0x28')],_0x9a6995[_0xc21b('0x29')],_0x46f8be,_0x5adc48)[_0xc21b('0x1c')](respondWithFilteredResult(_0x16a414,_0x46f8be))[_0xc21b('0x2a')](handleError(_0x16a414,null));};exports['show']=function(_0x17a297,_0x130719){var _0x19fa86={'raw':![],'where':{'id':_0x17a297[_0xc21b('0x2b')]['id']}},_0x155041={};_0x155041[_0xc21b('0x2c')]=_[_0xc21b('0x2d')](db[_0xc21b('0x22')][_0xc21b('0x23')]);_0x155041[_0xc21b('0x28')]=_[_0xc21b('0x2d')](_0x17a297[_0xc21b('0x28')]);_0x155041[_0xc21b('0x2e')]=_[_0xc21b('0x2f')](_0x155041[_0xc21b('0x2c')],_0x155041[_0xc21b('0x28')]);_0x19fa86[_0xc21b('0x30')]=_[_0xc21b('0x2f')](_0x155041[_0xc21b('0x2c')],qs['fields'](_0x17a297[_0xc21b('0x28')][_0xc21b('0x31')]));_0x19fa86['attributes']=_0x19fa86[_0xc21b('0x30')][_0xc21b('0x32')]?_0x19fa86[_0xc21b('0x30')]:_0x155041[_0xc21b('0x2c')];if(_0x17a297['query'][_0xc21b('0x33')]){_0x19fa86[_0xc21b('0x34')]=[{'all':!![]}];}_0x19fa86=_[_0xc21b('0x35')]({},_0x19fa86,_0x17a297[_0xc21b('0x36')]);return db[_0xc21b('0x22')][_0xc21b('0x37')](_0x19fa86)[_0xc21b('0x1c')](handleEntityNotFound(_0x130719,null))['then'](respondWithResult(_0x130719,null))[_0xc21b('0x2a')](handleError(_0x130719,null));};exports[_0xc21b('0x38')]=function(_0x448cf6,_0x501ee4){return db[_0xc21b('0x22')][_0xc21b('0x38')](_0x448cf6[_0xc21b('0x39')],{})['then'](respondWithResult(_0x501ee4,0xc9))[_0xc21b('0x2a')](handleError(_0x501ee4,null));};exports[_0xc21b('0x3a')]=function(_0x535c2b,_0x459b5c){if(_0x535c2b['body']['id']){delete _0x535c2b[_0xc21b('0x39')]['id'];}return db[_0xc21b('0x22')][_0xc21b('0x37')]({'where':{'id':_0x535c2b[_0xc21b('0x2b')]['id']}})[_0xc21b('0x1c')](handleEntityNotFound(_0x459b5c,null))[_0xc21b('0x1c')](saveUpdates(_0x535c2b[_0xc21b('0x39')],null))['then'](respondWithResult(_0x459b5c,null))[_0xc21b('0x2a')](handleError(_0x459b5c,null));};exports[_0xc21b('0x1d')]=function(_0x8a22ec,_0x712445){return db['SmsInteraction'][_0xc21b('0x37')]({'where':{'id':_0x8a22ec[_0xc21b('0x2b')]['id']}})[_0xc21b('0x1c')](handleEntityNotFound(_0x712445,null))[_0xc21b('0x1c')](removeEntity(_0x712445,null))[_0xc21b('0x2a')](handleError(_0x712445,null));};exports[_0xc21b('0x3b')]=function(_0x1e340d,_0x592480){return db[_0xc21b('0x22')]['describe']()[_0xc21b('0x1c')](respondWithResult(_0x592480,null))[_0xc21b('0x2a')](handleError(_0x592480,null));};exports[_0xc21b('0x3c')]=function(_0xc1d6c2,_0xc0c1c3){return db[_0xc21b('0x3d')][_0xc21b('0x37')]({'where':{'id':_0xc1d6c2['params']['id']}})[_0xc21b('0x1c')](handleEntityNotFound(_0xc0c1c3,null))[_0xc21b('0x1c')](function(_0x4ec1c2){if(_0x4ec1c2){return _0x4ec1c2['addMessage'](_0xc1d6c2['body'][_0xc21b('0x3e')],_[_0xc21b('0x3f')](_0xc1d6c2[_0xc21b('0x39')],[_0xc21b('0x3e'),'id'])||{});}})[_0xc21b('0x1c')](respondWithResult(_0xc0c1c3,null))[_0xc21b('0x2a')](handleError(_0xc0c1c3,null));};exports[_0xc21b('0x40')]=function(_0xe62db9,_0x3ab6e9){var _0x1d29c5={'raw':![],'where':{}};var _0x5977ce={};var _0xf800fa={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xc21b('0x41')]({'where':{'id':_0xe62db9[_0xc21b('0x2b')]['id']}})[_0xc21b('0x1c')](handleEntityNotFound(_0x3ab6e9,null))['then'](function(_0x4fa6c5){if(_0x4fa6c5){_0x5977ce['model']=_[_0xc21b('0x2d')](db[_0xc21b('0x3d')]['rawAttributes']);_0x5977ce['query']=_['keys'](_0xe62db9[_0xc21b('0x28')]);_0x5977ce[_0xc21b('0x2e')]=_[_0xc21b('0x2f')](_0x5977ce[_0xc21b('0x2c')],_0x5977ce['query']);_0x1d29c5[_0xc21b('0x30')]=_[_0xc21b('0x2f')](_0x5977ce[_0xc21b('0x2c')],qs['fields'](_0xe62db9[_0xc21b('0x28')][_0xc21b('0x31')]));_0x1d29c5[_0xc21b('0x30')]=_0x1d29c5['attributes'][_0xc21b('0x32')]?_0x1d29c5[_0xc21b('0x30')]:_0x5977ce[_0xc21b('0x2c')];if(!_0xe62db9['query'][_0xc21b('0x42')](_0xc21b('0x43'))){_0x1d29c5['limit']=qs[_0xc21b('0x18')](_0xe62db9[_0xc21b('0x28')][_0xc21b('0x18')]);_0x1d29c5[_0xc21b('0x17')]=qs[_0xc21b('0x17')](_0xe62db9[_0xc21b('0x28')][_0xc21b('0x17')]);}_0x1d29c5['order']=qs[_0xc21b('0x44')](_0xe62db9[_0xc21b('0x28')][_0xc21b('0x44')]);_0x1d29c5[_0xc21b('0x45')]=qs[_0xc21b('0x2e')](_['pick'](_0xe62db9[_0xc21b('0x28')],_0x5977ce[_0xc21b('0x2e')]));_0x1d29c5[_0xc21b('0x45')][_0xc21b('0x46')]=_0x4fa6c5['id'];if(_0xe62db9[_0xc21b('0x28')][_0xc21b('0x47')]){_0x1d29c5['where']=_[_0xc21b('0x35')](_0x1d29c5[_0xc21b('0x45')],{'$or':_[_0xc21b('0x21')](_0x1d29c5[_0xc21b('0x30')],function(_0x18e75d){var _0x144790={};_0x144790[_0x18e75d]={'$like':'%'+_0xe62db9[_0xc21b('0x28')][_0xc21b('0x47')]+'%'};return _0x144790;})});}if(_0xe62db9['query'][_0xc21b('0x48')]){var _0x35454a=_0xe62db9[_0xc21b('0x28')]['$gte'][_0xc21b('0x49')](',');var _0xaafad7={};_0xaafad7[_0x35454a[0x0]]={'$gte':moment(_0x35454a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1d29c5[_0xc21b('0x45')]=_[_0xc21b('0x35')](_0x1d29c5[_0xc21b('0x45')],_0xaafad7);}_0x1d29c5=_[_0xc21b('0x35')]({},_0x1d29c5,_0xe62db9[_0xc21b('0x36')]);return db['SmsMessage']['count']({'where':_0x1d29c5[_0xc21b('0x45')]})['then'](function(_0x871fa2){_0xf800fa[_0xc21b('0x1a')]=_0x871fa2;if(_0xe62db9[_0xc21b('0x28')][_0xc21b('0x33')]){_0x1d29c5['include']=[{'all':!![]}];}return db[_0xc21b('0x3d')]['findAll'](_0x1d29c5);})[_0xc21b('0x1c')](function(_0xf5d5d4){_0xf800fa[_0xc21b('0x4a')]=_0xf5d5d4;return _0xf800fa;});}})['then'](respondWithFilteredResult(_0x3ab6e9,_0x1d29c5))[_0xc21b('0x2a')](handleError(_0x3ab6e9,null));};exports[_0xc21b('0x4b')]=function(_0x33b6bd,_0x420834){return db['SmsInteraction'][_0xc21b('0x37')]({'where':{'id':_0x33b6bd[_0xc21b('0x2b')]['id']}})[_0xc21b('0x1c')](handleEntityNotFound(_0x420834,null))[_0xc21b('0x1c')](function(_0x3c2970){if(_0x3c2970){return _0x3c2970['setTags'](_0x33b6bd['body'][_0xc21b('0x3e')],_[_0xc21b('0x3f')](_0x33b6bd[_0xc21b('0x39')],[_0xc21b('0x3e'),'id'])||{})[_0xc21b('0x4c')](function(){return db['Tag'][_0xc21b('0x27')]({'attributes':['id',_0xc21b('0x1f'),_0xc21b('0x4d')],'where':{'id':_0x33b6bd['body'][_0xc21b('0x3e')]}});})[_0xc21b('0x1c')](function(_0x278058){socket[_0xc21b('0x4e')](_0xc21b('0x4f'),{'id':Number(_0x33b6bd['params']['id']),'tags':_0x278058||[]});return{'id':Number(_0x33b6bd[_0xc21b('0x2b')]['id']),'tags':_0x278058||[]};});}})[_0xc21b('0x1c')](respondWithResult(_0x420834,null))[_0xc21b('0x2a')](handleError(_0x420834,null));};exports[_0xc21b('0x50')]=function(_0x1c37d6,_0xf87624){return db[_0xc21b('0x22')][_0xc21b('0x37')]({'where':{'id':_0x1c37d6[_0xc21b('0x2b')]['id']}})['then'](handleEntityNotFound(_0xf87624,null))[_0xc21b('0x1c')](function(_0x3d4d54){if(_0x3d4d54){return _0x3d4d54['removeTags'](_0x1c37d6['query']['ids']);}})[_0xc21b('0x1c')](respondWithStatusCode(_0xf87624,null))[_0xc21b('0x2a')](handleError(_0xf87624,null));};exports[_0xc21b('0x51')]=function(_0x12430b,_0x903c43){var _0x17fe50=moment()[_0xc21b('0x52')]()[_0xc21b('0x53')]();var _0x4b3d7c=path[_0xc21b('0x54')](config[_0xc21b('0x55')],_0xc21b('0x56'),_0xc21b('0x57'),'tmp');var _0x56bea3=path[_0xc21b('0x54')](_0x4b3d7c,_0x17fe50);var _0x296033=util[_0xc21b('0x58')](_0xc21b('0x59'),_0x12430b['params']['id'],_0x17fe50);var _0x10a88d=path[_0xc21b('0x54')](_0x4b3d7c,_0x296033);var _0x492ceb=[];_0x492ceb[_0xc21b('0x5a')]({'model':db[_0xc21b('0x5b')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x492ceb['push']({'model':db[_0xc21b('0x5c')],'as':_0xc21b('0x5d'),'attributes':['id',_0xc21b('0x5e'),'lastName'],'raw':!![]});var _0x5ba58a=[{'model':db[_0xc21b('0x3d')],'as':_0xc21b('0x5f'),'attributes':['id',_0xc21b('0x39'),_0xc21b('0x60'),_0xc21b('0x61'),'secret','read'],'include':_0x492ceb}];_0x5ba58a[_0xc21b('0x5a')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xc21b('0x1f')]});_0x5ba58a[_0xc21b('0x5a')]({'model':db[_0xc21b('0x5b')],'as':_0xc21b('0x62'),'attributes':['id',_0xc21b('0x63')]});return db[_0xc21b('0x22')]['find']({'where':{'id':_0x12430b['params']['id']},'include':_0x5ba58a})[_0xc21b('0x1c')](handleEntityNotFound(_0x903c43,null))[_0xc21b('0x1c')](function(_0x401e06){if(_0x401e06){var _0x7325c2=_0x401e06['get']({'plain':!![]});fs[_0xc21b('0x64')](_0x56bea3);var _0x3883a1={'channel':_0xc21b('0x65'),'account':_0x7325c2[_0xc21b('0x66')]['name'],'agent':_0x7325c2[_0xc21b('0x62')]?_0x7325c2['Owner'][_0xc21b('0x63')]:_0xc21b('0x67'),'createdAt':moment(_0x7325c2[_0xc21b('0x60')])[_0xc21b('0x58')](_0xc21b('0x68'))[_0xc21b('0x53')](),'closedAt':_0x7325c2[_0xc21b('0x69')]?moment(_0x7325c2[_0xc21b('0x6a')])[_0xc21b('0x58')](_0xc21b('0x68'))['toString']():'','disposition':_0x7325c2[_0xc21b('0x6b')],'messages':_(_0x7325c2['Messages'])[_0xc21b('0x47')]({'secret':![]})[_0xc21b('0x21')](function(_0x318041){return{'date':moment(_0x318041[_0xc21b('0x60')])[_0xc21b('0x58')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc21b('0x53')](),'sender':_0x318041['direction']==='out'?_0x318041[_0xc21b('0x5b')]?_0x318041[_0xc21b('0x5b')][_0xc21b('0x63')]:_0xc21b('0x6c'):_0x318041[_0xc21b('0x5d')][_0xc21b('0x5e')]+(_0x318041['Contact'][_0xc21b('0x6d')]?'\x20'+_0x318041[_0xc21b('0x5d')][_0xc21b('0x6d')]:''),'body':_0x318041['body'],'direction':_0x318041[_0xc21b('0x61')]===_0xc21b('0x6e')?'A':'C','secret':_0x318041[_0xc21b('0x6f')],'read':_0x318041[_0xc21b('0x70')]};})[_0xc21b('0x71')]()};return ejs[_0xc21b('0x72')](path[_0xc21b('0x54')](config[_0xc21b('0x55')],'server',_0xc21b('0x73'),'downloadInteraction.ejs'),{'interaction':_0x3883a1})[_0xc21b('0x1c')](function(_0x200c98){var _0x1961a3=path[_0xc21b('0x54')](_0x56bea3,_0xc21b('0x74')+_0x7325c2['id']+'-'+_0x17fe50+'.pdf');var _0x251389={'path':_0x1961a3,'channel':_0xc21b('0x65'),'interactionId':_0x7325c2['id']};return pdf[_0xc21b('0x75')](_0x200c98,_0x251389);})[_0xc21b('0x1c')](function(){return new BPromise(function(_0x459c08,_0x754c07){zipdir(_0x56bea3,{'saveTo':_0x10a88d},function(_0x5398fa,_0x3aa901){if(_0x5398fa)return _0x754c07(_0x5398fa);return _0x459c08(_0x3aa901);});})['then'](function(){return new BPromise(function(_0x5291e5,_0x101829){rimraf(_0x56bea3,function(_0x16bd6a){if(_0x16bd6a)_0x101829(_0x16bd6a);return _0x5291e5();});});})['then'](function(){return _0x903c43[_0xc21b('0x51')](_0x10a88d,_0x296033,function(_0x86e574){if(_0x86e574){console[_0xc21b('0x76')](_0xc21b('0x77'),_0x86e574);}else{fs[_0xc21b('0x78')](_0x10a88d);}});});});}else{return _0x903c43[_0xc21b('0x13')](0xc8);}})[_0xc21b('0x2a')](handleError(_0x903c43,null));}; \ No newline at end of file +var _0x061b=['ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','offset','undefined','limit','count','json','update','then','error','name','send','index','map','SmsInteraction','fieldName','type','getOptions','findAll','query','user','show','model','keys','filters','intersection','fields','attributes','length','include','merge','options','find','body','params','catch','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','omit','spread','color','emit','smsInteractionTags:save','removeTags','download','toString','join','server','transcript-%d-%s.zip','push','User','CmContact','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Owner','fullname','get','mkdirSync','Sms','N.A.','closed','disposition','direction','out','System','firstName','value','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash'];(function(_0x3bee0c,_0x1d412f){var _0x531ce2=function(_0x4c6e19){while(--_0x4c6e19){_0x3bee0c['push'](_0x3bee0c['shift']());}};_0x531ce2(++_0x1d412f);}(_0x061b,0x6f));var _0xb061=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x061b[_0x51020b];return _0x371e47;};'use strict';var rimraf=require(_0xb061('0x0'));var zipdir=require(_0xb061('0x1'));var moment=require(_0xb061('0x2'));var BPromise=require('bluebird');var util=require(_0xb061('0x3'));var path=require(_0xb061('0x4'));var ejs=require(_0xb061('0x5'));var fs=require('fs');var _=require(_0xb061('0x6'));var Redis=require(_0xb061('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xb061('0x8'));var pdf=require(_0xb061('0x9'));var logger=require(_0xb061('0xa'))(_0xb061('0xb'));var config=require('../../config/environment');var db=require(_0xb061('0xc'))['db'];config[_0xb061('0xd')]=_[_0xb061('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb061('0xf'))(new Redis(config[_0xb061('0xd')]));require(_0xb061('0x10'))['register'](socket);function respondWithStatusCode(_0x428528,_0x273ad5){_0x273ad5=_0x273ad5||0xcc;return function(_0x4622da){if(_0x4622da){return _0x428528[_0xb061('0x11')](_0x273ad5);}return _0x428528[_0xb061('0x12')](_0x273ad5)['end']();};}function respondWithResult(_0x5c7285,_0x1ddad7){_0x1ddad7=_0x1ddad7||0xc8;return function(_0x2b49dd){if(_0x2b49dd){return _0x5c7285[_0xb061('0x12')](_0x1ddad7)['json'](_0x2b49dd);}};}function respondWithFilteredResult(_0x108657,_0x3d452f){return function(_0x3ca9b5){if(_0x3ca9b5){var _0x33fdf1=typeof _0x3d452f[_0xb061('0x13')]===_0xb061('0x14')&&typeof _0x3d452f[_0xb061('0x15')]==='undefined';var _0x333de6=_0x3ca9b5[_0xb061('0x16')];var _0x35b5ad=_0x33fdf1?0x0:_0x3d452f[_0xb061('0x13')];var _0x464842=_0x33fdf1?_0x3ca9b5[_0xb061('0x16')]:_0x3d452f[_0xb061('0x13')]+_0x3d452f[_0xb061('0x15')];var _0xa5a89e;if(_0x464842>=_0x333de6){_0x464842=_0x333de6;_0xa5a89e=0xc8;}else{_0xa5a89e=0xce;}_0x108657[_0xb061('0x12')](_0xa5a89e);return _0x108657['set']('Content-Range',_0x35b5ad+'-'+_0x464842+'/'+_0x333de6)[_0xb061('0x17')](_0x3ca9b5);}return null;};}function saveUpdates(_0x255d38){return function(_0x20e518){if(_0x20e518){return _0x20e518[_0xb061('0x18')](_0x255d38)[_0xb061('0x19')](function(_0x190157){return _0x190157;});}return null;};}function removeEntity(_0x4df96e){return function(_0x266c99){if(_0x266c99){return _0x266c99['destroy']()['then'](function(){_0x4df96e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3401){return function(_0x37cc19){if(!_0x37cc19){_0x2f3401[_0xb061('0x11')](0x194);}return _0x37cc19;};}function handleError(_0x11ee00,_0x161257){_0x161257=_0x161257||0x1f4;return function(_0x1cf4ae){logger[_0xb061('0x1a')](_0x1cf4ae['stack']);if(_0x1cf4ae[_0xb061('0x1b')]){delete _0x1cf4ae['name'];}_0x11ee00[_0xb061('0x12')](_0x161257)[_0xb061('0x1c')](_0x1cf4ae);};}exports[_0xb061('0x1d')]=function(_0x422cc7,_0x2da824){var _0x390371={};var _0x25bae2=_[_0xb061('0x1e')](db[_0xb061('0x1f')]['rawAttributes'],function(_0x37da52){return{'name':_0x37da52[_0xb061('0x20')],'type':_0x37da52[_0xb061('0x21')]['key']};});_0x390371=qs[_0xb061('0x22')](_0x25bae2,_0x422cc7);return interaction[_0xb061('0x23')]('sms',_0x422cc7[_0xb061('0x24')],_0x422cc7[_0xb061('0x25')],_0x390371,_0x25bae2)[_0xb061('0x19')](respondWithFilteredResult(_0x2da824,_0x390371))['catch'](handleError(_0x2da824,null));};exports[_0xb061('0x26')]=function(_0x1b393e,_0x5d1937){var _0x1fec75={'raw':![],'where':{'id':_0x1b393e['params']['id']}},_0x5f2dbb={};_0x5f2dbb[_0xb061('0x27')]=_[_0xb061('0x28')](db['SmsInteraction']['rawAttributes']);_0x5f2dbb[_0xb061('0x24')]=_[_0xb061('0x28')](_0x1b393e[_0xb061('0x24')]);_0x5f2dbb[_0xb061('0x29')]=_[_0xb061('0x2a')](_0x5f2dbb[_0xb061('0x27')],_0x5f2dbb[_0xb061('0x24')]);_0x1fec75['attributes']=_[_0xb061('0x2a')](_0x5f2dbb[_0xb061('0x27')],qs[_0xb061('0x2b')](_0x1b393e[_0xb061('0x24')][_0xb061('0x2b')]));_0x1fec75[_0xb061('0x2c')]=_0x1fec75['attributes'][_0xb061('0x2d')]?_0x1fec75[_0xb061('0x2c')]:_0x5f2dbb[_0xb061('0x27')];if(_0x1b393e['query']['includeAll']){_0x1fec75[_0xb061('0x2e')]=[{'all':!![]}];}_0x1fec75=_[_0xb061('0x2f')]({},_0x1fec75,_0x1b393e[_0xb061('0x30')]);return db[_0xb061('0x1f')][_0xb061('0x31')](_0x1fec75)[_0xb061('0x19')](handleEntityNotFound(_0x5d1937,null))[_0xb061('0x19')](respondWithResult(_0x5d1937,null))['catch'](handleError(_0x5d1937,null));};exports['create']=function(_0x7cac4f,_0x4ae7a0){return db[_0xb061('0x1f')]['create'](_0x7cac4f[_0xb061('0x32')],{})[_0xb061('0x19')](respondWithResult(_0x4ae7a0,0xc9))['catch'](handleError(_0x4ae7a0,null));};exports['update']=function(_0x501c61,_0x1db69f){if(_0x501c61[_0xb061('0x32')]['id']){delete _0x501c61[_0xb061('0x32')]['id'];}return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0x501c61[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x1db69f,null))['then'](saveUpdates(_0x501c61[_0xb061('0x32')],null))[_0xb061('0x19')](respondWithResult(_0x1db69f,null))[_0xb061('0x34')](handleError(_0x1db69f,null));};exports[_0xb061('0x35')]=function(_0x1034ad,_0x5e4aa8){return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0x1034ad[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x5e4aa8,null))[_0xb061('0x19')](removeEntity(_0x5e4aa8,null))[_0xb061('0x34')](handleError(_0x5e4aa8,null));};exports[_0xb061('0x36')]=function(_0x2a240a,_0x483d5a){return db[_0xb061('0x1f')][_0xb061('0x36')]()[_0xb061('0x19')](respondWithResult(_0x483d5a,null))[_0xb061('0x34')](handleError(_0x483d5a,null));};exports[_0xb061('0x37')]=function(_0x1705e3,_0x269350){return db[_0xb061('0x38')]['find']({'where':{'id':_0x1705e3[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x269350,null))['then'](function(_0xe46d98){if(_0xe46d98){return _0xe46d98['addMessage'](_0x1705e3['body'][_0xb061('0x39')],_['omit'](_0x1705e3['body'],[_0xb061('0x39'),'id'])||{});}})[_0xb061('0x19')](respondWithResult(_0x269350,null))['catch'](handleError(_0x269350,null));};exports[_0xb061('0x3a')]=function(_0xc89300,_0x551ff8){var _0x3989a6={'raw':![],'where':{}};var _0x538097={};var _0x100726={'count':0x0,'rows':[]};return db[_0xb061('0x1f')][_0xb061('0x3b')]({'where':{'id':_0xc89300[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x551ff8,null))['then'](function(_0x43887a){if(_0x43887a){_0x538097[_0xb061('0x27')]=_[_0xb061('0x28')](db['SmsMessage'][_0xb061('0x3c')]);_0x538097[_0xb061('0x24')]=_[_0xb061('0x28')](_0xc89300[_0xb061('0x24')]);_0x538097['filters']=_[_0xb061('0x2a')](_0x538097[_0xb061('0x27')],_0x538097[_0xb061('0x24')]);_0x3989a6[_0xb061('0x2c')]=_['intersection'](_0x538097[_0xb061('0x27')],qs[_0xb061('0x2b')](_0xc89300[_0xb061('0x24')]['fields']));_0x3989a6[_0xb061('0x2c')]=_0x3989a6[_0xb061('0x2c')][_0xb061('0x2d')]?_0x3989a6[_0xb061('0x2c')]:_0x538097[_0xb061('0x27')];if(!_0xc89300[_0xb061('0x24')][_0xb061('0x3d')](_0xb061('0x3e'))){_0x3989a6[_0xb061('0x15')]=qs[_0xb061('0x15')](_0xc89300[_0xb061('0x24')][_0xb061('0x15')]);_0x3989a6['offset']=qs[_0xb061('0x13')](_0xc89300[_0xb061('0x24')][_0xb061('0x13')]);}_0x3989a6[_0xb061('0x3f')]=qs[_0xb061('0x40')](_0xc89300[_0xb061('0x24')][_0xb061('0x40')]);_0x3989a6[_0xb061('0x41')]=qs[_0xb061('0x29')](_['pick'](_0xc89300[_0xb061('0x24')],_0x538097[_0xb061('0x29')]));_0x3989a6[_0xb061('0x41')][_0xb061('0x42')]=_0x43887a['id'];if(_0xc89300['query'][_0xb061('0x43')]){_0x3989a6[_0xb061('0x41')]=_[_0xb061('0x2f')](_0x3989a6['where'],{'$or':_[_0xb061('0x1e')](_0x3989a6[_0xb061('0x2c')],function(_0x3aff5e){var _0x105d16={};_0x105d16[_0x3aff5e]={'$like':'%'+_0xc89300[_0xb061('0x24')][_0xb061('0x43')]+'%'};return _0x105d16;})});}if(_0xc89300[_0xb061('0x24')][_0xb061('0x44')]){var _0x1bf08e=_0xc89300[_0xb061('0x24')][_0xb061('0x44')][_0xb061('0x45')](',');var _0x516f3b={};_0x516f3b[_0x1bf08e[0x0]]={'$gte':moment(_0x1bf08e[0x1])[_0xb061('0x46')](_0xb061('0x47'))};_0x3989a6['where']=_['merge'](_0x3989a6[_0xb061('0x41')],_0x516f3b);}_0x3989a6=_[_0xb061('0x2f')]({},_0x3989a6,_0xc89300[_0xb061('0x30')]);return db[_0xb061('0x38')]['count']({'where':_0x3989a6[_0xb061('0x41')]})[_0xb061('0x19')](function(_0x1b3804){_0x100726['count']=_0x1b3804;if(_0xc89300[_0xb061('0x24')][_0xb061('0x48')]){_0x3989a6[_0xb061('0x2e')]=[{'all':!![]}];}return db['SmsMessage'][_0xb061('0x23')](_0x3989a6);})[_0xb061('0x19')](function(_0x568cb5){_0x100726[_0xb061('0x49')]=_0x568cb5;return _0x100726;});}})[_0xb061('0x19')](respondWithFilteredResult(_0x551ff8,_0x3989a6))[_0xb061('0x34')](handleError(_0x551ff8,null));};exports[_0xb061('0x4a')]=function(_0xea8bd5,_0x1143c5){return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0xea8bd5[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x1143c5,null))[_0xb061('0x19')](function(_0x431a5a){if(_0x431a5a){return _0x431a5a['setTags'](_0xea8bd5[_0xb061('0x32')]['ids'],_[_0xb061('0x4b')](_0xea8bd5[_0xb061('0x32')],[_0xb061('0x39'),'id'])||{})[_0xb061('0x4c')](function(){return db['Tag'][_0xb061('0x23')]({'attributes':['id',_0xb061('0x1b'),_0xb061('0x4d')],'where':{'id':_0xea8bd5[_0xb061('0x32')][_0xb061('0x39')]}});})[_0xb061('0x19')](function(_0x22f3fc){socket[_0xb061('0x4e')](_0xb061('0x4f'),{'id':Number(_0xea8bd5[_0xb061('0x33')]['id']),'tags':_0x22f3fc||[]});return{'id':Number(_0xea8bd5[_0xb061('0x33')]['id']),'tags':_0x22f3fc||[]};});}})['then'](respondWithResult(_0x1143c5,null))[_0xb061('0x34')](handleError(_0x1143c5,null));};exports[_0xb061('0x50')]=function(_0x26b959,_0x54e63f){return db[_0xb061('0x1f')]['find']({'where':{'id':_0x26b959[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x54e63f,null))['then'](function(_0x559922){if(_0x559922){return _0x559922[_0xb061('0x50')](_0x26b959[_0xb061('0x24')]['ids']);}})['then'](respondWithStatusCode(_0x54e63f,null))['catch'](handleError(_0x54e63f,null));};exports[_0xb061('0x51')]=function(_0x276e5c,_0xe918a1){var _0x31be08=moment()['unix']()[_0xb061('0x52')]();var _0x43db33=path[_0xb061('0x53')](config['root'],_0xb061('0x54'),'files','tmp');var _0x1f53f9=path[_0xb061('0x53')](_0x43db33,_0x31be08);var _0x247739=util[_0xb061('0x46')](_0xb061('0x55'),_0x276e5c[_0xb061('0x33')]['id'],_0x31be08);var _0x20d5d4=path['join'](_0x43db33,_0x247739);var _0x39e7bf=[];_0x39e7bf[_0xb061('0x56')]({'model':db['User'],'as':_0xb061('0x57'),'attributes':['id','fullname'],'raw':!![]});_0x39e7bf[_0xb061('0x56')]({'model':db[_0xb061('0x58')],'as':_0xb061('0x59'),'attributes':['id','firstName',_0xb061('0x5a')],'raw':!![]});var _0x4363a8=[{'model':db[_0xb061('0x38')],'as':_0xb061('0x5b'),'attributes':['id',_0xb061('0x32'),_0xb061('0x5c'),'direction',_0xb061('0x5d'),_0xb061('0x5e')],'include':_0x39e7bf}];_0x4363a8[_0xb061('0x56')]({'model':db[_0xb061('0x5f')],'as':'Account','attributes':['id',_0xb061('0x1b')]});_0x4363a8[_0xb061('0x56')]({'model':db[_0xb061('0x57')],'as':_0xb061('0x60'),'attributes':['id',_0xb061('0x61')]});return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0x276e5c[_0xb061('0x33')]['id']},'include':_0x4363a8})['then'](handleEntityNotFound(_0xe918a1,null))[_0xb061('0x19')](function(_0x2f0041){if(_0x2f0041){var _0x2b1be4=_0x2f0041[_0xb061('0x62')]({'plain':!![]});fs[_0xb061('0x63')](_0x1f53f9);var _0x387212={'channel':_0xb061('0x64'),'account':_0x2b1be4['Account'][_0xb061('0x1b')],'agent':_0x2b1be4[_0xb061('0x60')]?_0x2b1be4[_0xb061('0x60')]['fullname']:_0xb061('0x65'),'createdAt':moment(_0x2b1be4['createdAt'])[_0xb061('0x46')](_0xb061('0x47'))[_0xb061('0x52')](),'closedAt':_0x2b1be4[_0xb061('0x66')]?moment(_0x2b1be4['closedAt'])[_0xb061('0x46')](_0xb061('0x47'))[_0xb061('0x52')]():'','disposition':_0x2b1be4[_0xb061('0x67')],'messages':_(_0x2b1be4[_0xb061('0x5b')])[_0xb061('0x43')]({'secret':![]})[_0xb061('0x1e')](function(_0x47ec7f){return{'date':moment(_0x47ec7f[_0xb061('0x5c')])[_0xb061('0x46')](_0xb061('0x47'))[_0xb061('0x52')](),'sender':_0x47ec7f[_0xb061('0x68')]===_0xb061('0x69')?_0x47ec7f[_0xb061('0x57')]?_0x47ec7f[_0xb061('0x57')][_0xb061('0x61')]:_0xb061('0x6a'):_0x47ec7f['Contact'][_0xb061('0x6b')]+(_0x47ec7f['Contact'][_0xb061('0x5a')]?'\x20'+_0x47ec7f[_0xb061('0x59')]['lastName']:''),'body':_0x47ec7f['body'],'direction':_0x47ec7f[_0xb061('0x68')]===_0xb061('0x69')?'A':'C','secret':_0x47ec7f[_0xb061('0x5d')],'read':_0x47ec7f[_0xb061('0x5e')]};})[_0xb061('0x6c')]()};return ejs['renderFile'](path[_0xb061('0x53')](config[_0xb061('0x6d')],_0xb061('0x54'),_0xb061('0x6e'),_0xb061('0x6f')),{'interaction':_0x387212})[_0xb061('0x19')](function(_0x5b9162){var _0x3aae43=path[_0xb061('0x53')](_0x1f53f9,_0xb061('0x70')+_0x2b1be4['id']+'-'+_0x31be08+_0xb061('0x71'));var _0x428f46={'path':_0x3aae43,'channel':_0xb061('0x64'),'interactionId':_0x2b1be4['id']};return pdf[_0xb061('0x72')](_0x5b9162,_0x428f46);})[_0xb061('0x19')](function(){return new BPromise(function(_0x4612fe,_0x5c9e63){zipdir(_0x1f53f9,{'saveTo':_0x20d5d4},function(_0x2b3ddd,_0x5d4341){if(_0x2b3ddd)return _0x5c9e63(_0x2b3ddd);return _0x4612fe(_0x5d4341);});})[_0xb061('0x19')](function(){return new BPromise(function(_0x597dc5,_0x2c3df5){rimraf(_0x1f53f9,function(_0x5bc387){if(_0x5bc387)_0x2c3df5(_0x5bc387);return _0x597dc5();});});})[_0xb061('0x19')](function(){return _0xe918a1[_0xb061('0x51')](_0x20d5d4,_0x247739,function(_0x4f8601){if(_0x4f8601){console[_0xb061('0x73')](_0xb061('0x74'),_0x4f8601);}else{fs[_0xb061('0x75')](_0x20d5d4);}});});});}else{return _0xe918a1['sendStatus'](0xc8);}})[_0xb061('0x34')](handleError(_0xe918a1,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d602b6e..a20c5d8 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 _0xea28=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xea28,0x13a));var _0x8ea2=function(_0x43faa4,_0x3b56dd){_0x43faa4=_0x43faa4-0x0;var _0x34b138=_0xea28[_0x43faa4];return _0x34b138;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var SmsInteraction=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var SmsMessage=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8ea2('0x4')](0x0);var events={'afterCreate':_0x8ea2('0x5'),'afterUpdate':_0x8ea2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x9b45ab){return function(_0x23aaf1,_0x1ccf12,_0x513a0d){_0x23aaf1[_0x8ea2('0x7')]({'attributes':['id'],'raw':!![]})[_0x8ea2('0x8')](function(_0xb7f278){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xa'),_0xb7f278[_0x8ea2('0xb')](function(_0x19bd6c){return{'id':_0x19bd6c['id']};}));return SmsMessage[_0x8ea2('0xc')]({'where':{'SmsInteractionId':_0x23aaf1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8ea2('0x8')](function(_0x3000f9){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xd'),_0x3000f9['length']);SmsInteractionEvents['emit'](_0x9b45ab+':'+_0x23aaf1['id'],_0x23aaf1);SmsInteractionEvents[_0x8ea2('0xe')](_0x9b45ab,_0x23aaf1);_0x513a0d(null);})[_0x8ea2('0xf')](_0x513a0d(null));};}for(var e in events){if(events[_0x8ea2('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x8ea2('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x7916=['Users','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers'];(function(_0x5dfb29,_0x2a82de){var _0x331677=function(_0x5d7ac4){while(--_0x5d7ac4){_0x5dfb29['push'](_0x5dfb29['shift']());}};_0x331677(++_0x2a82de);}(_0x7916,0x128));var _0x6791=function(_0x153738,_0xe704c1){_0x153738=_0x153738-0x0;var _0x3028d9=_0x7916[_0x153738];return _0x3028d9;};'use strict';var EventEmitter=require(_0x6791('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x6791('0x1')];var SmsMessage=require(_0x6791('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6791('0x3')](0x0);var events={'afterCreate':_0x6791('0x4'),'afterUpdate':_0x6791('0x5'),'afterDestroy':_0x6791('0x6')};function emitEvent(_0x5e6303){return function(_0xe98396,_0x5a5726,_0x3ca328){_0xe98396[_0x6791('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8b85ff){_0xe98396['setDataValue'](_0x6791('0x8'),_0x8b85ff['map'](function(_0x4ef65f){return{'id':_0x4ef65f['id']};}));return SmsMessage[_0x6791('0x9')]({'where':{'SmsInteractionId':_0xe98396['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6791('0xa')](function(_0x579950){_0xe98396[_0x6791('0xb')](_0x6791('0xc'),_0x579950[_0x6791('0xd')]);SmsInteractionEvents['emit'](_0x5e6303+':'+_0xe98396['id'],_0xe98396);SmsInteractionEvents[_0x6791('0xe')](_0x5e6303,_0xe98396);_0x3ca328(null);})[_0x6791('0xf')](_0x3ca328(null));};}for(var e in events){if(events[_0x6791('0x10')](e)){var event=events[e];SmsInteraction[_0x6791('0x11')](e,emitEvent(event));}}module[_0x6791('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 180f4e8..4207cf6 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 _0x9e92=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','sms_interactions','format'];(function(_0x1ef355,_0x244bd7){var _0x2f69c9=function(_0x4af11b){while(--_0x4af11b){_0x1ef355['push'](_0x1ef355['shift']());}};_0x2f69c9(++_0x244bd7);}(_0x9e92,0x1ef));var _0x29e9=function(_0x1111c8,_0x4ec610){_0x1111c8=_0x1111c8-0x0;var _0x4db1e6=_0x9e92[_0x1111c8];return _0x4db1e6;};'use strict';var _=require(_0x29e9('0x0'));var util=require(_0x29e9('0x1'));var logger=require('../../config/logger')(_0x29e9('0x2'));var moment=require(_0x29e9('0x3'));var BPromise=require('bluebird');var rp=require(_0x29e9('0x4'));var fs=require('fs');var path=require(_0x29e9('0x5'));var rimraf=require(_0x29e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x29e9('0x7'));module[_0x29e9('0x8')]=function(_0x25c48a,_0x215a90){return _0x25c48a[_0x29e9('0x9')]('SmsInteraction',attributes,{'tableName':_0x29e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c795c,_0xb367eb,_0x15d291){if(_0x2c795c['changed']('closed')){_0x2c795c['closedAt']=moment()[_0x29e9('0xb')](_0x29e9('0xc'));}_0x15d291(null,_0x2c795c);}}});}; \ No newline at end of file +var _0xdc0e=['exports','define','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xdc0e,0xf7));var _0xedc0=function(_0x34fe22,_0x4b0faa){_0x34fe22=_0x34fe22-0x0;var _0x126030=_0xdc0e[_0x34fe22];return _0x126030;};'use strict';var _=require(_0xedc0('0x0'));var util=require(_0xedc0('0x1'));var logger=require(_0xedc0('0x2'))('api');var moment=require(_0xedc0('0x3'));var BPromise=require(_0xedc0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedc0('0x5'));var rimraf=require(_0xedc0('0x6'));var config=require(_0xedc0('0x7'));var attributes=require(_0xedc0('0x8'));module[_0xedc0('0x9')]=function(_0x45a61a,_0x5f868f){return _0x45a61a[_0xedc0('0xa')](_0xedc0('0xb'),attributes,{'tableName':_0xedc0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46cef2,_0x50dbf6,_0x47ba00){if(_0x46cef2[_0xedc0('0xd')]('closed')){_0x46cef2['closedAt']=moment()[_0xedc0('0xe')](_0xedc0('0xf'));}_0x47ba00(null,_0x46cef2);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9528a8f..729c6dc 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 _0xaf73=['socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','attributes','limit','then','find','where','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x3c7ba3,_0x3294c5){var _0x55ab57=function(_0x5bf419){while(--_0x5bf419){_0x3c7ba3['push'](_0x3c7ba3['shift']());}};_0x55ab57(++_0x3294c5);}(_0xaf73,0x1b6));var _0x3af7=function(_0x1ce3f8,_0xce9053){_0x1ce3f8=_0x1ce3f8-0x0;var _0x27d7bc=_0xaf73[_0x1ce3f8];return _0x27d7bc;};'use strict';var _=require(_0x3af7('0x0'));var util=require('util');var moment=require(_0x3af7('0x1'));var BPromise=require('bluebird');var rs=require(_0x3af7('0x2'));var fs=require('fs');var Redis=require(_0x3af7('0x3'));var db=require(_0x3af7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3af7('0x5'))(_0x3af7('0x6'));var config=require(_0x3af7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3af7('0x8')][_0x3af7('0x9')]({'port':0x232a});config['redis']=_[_0x3af7('0xa')](config[_0x3af7('0xb')],{'host':_0x3af7('0xc'),'port':0x18eb});var socket=require(_0x3af7('0xd'))(new Redis(config[_0x3af7('0xb')]));require(_0x3af7('0xe'))[_0x3af7('0xf')](socket);function respondWithRpcPromise(_0x3cd9eb,_0xcbd802,_0x498b1c){return new BPromise(function(_0x3ddf90,_0x119d3f){return client[_0x3af7('0x10')](_0x3cd9eb,_0x498b1c)['then'](function(_0x577c4a){logger[_0x3af7('0x11')](_0x3af7('0x12'),_0xcbd802,_0x3af7('0x13'));logger[_0x3af7('0x14')](_0x3af7('0x15'),_0xcbd802,_0x3af7('0x13'),JSON[_0x3af7('0x16')](_0x577c4a));if(_0x577c4a[_0x3af7('0x17')]){if(_0x577c4a['error'][_0x3af7('0x18')]===0x1f4){logger[_0x3af7('0x17')]('SmsInteraction,\x20%s,\x20%s',_0xcbd802,_0x577c4a[_0x3af7('0x17')]['message']);return _0x119d3f(_0x577c4a[_0x3af7('0x17')]['message']);}logger[_0x3af7('0x17')](_0x3af7('0x12'),_0xcbd802,_0x577c4a['error'][_0x3af7('0x19')]);return _0x3ddf90(_0x577c4a[_0x3af7('0x17')]['message']);}else{logger[_0x3af7('0x11')](_0x3af7('0x12'),_0xcbd802,'request\x20sent');_0x3ddf90(_0x577c4a[_0x3af7('0x1a')]['message']);}})[_0x3af7('0x1b')](function(_0x49bcbc){logger[_0x3af7('0x17')]('SmsInteraction,\x20%s,\x20%s',_0xcbd802,_0x49bcbc);_0x119d3f(_0x49bcbc);});});}exports[_0x3af7('0x1c')]=function(_0x569218){var _0x1580a0=this;return new Promise(function(_0x4d4dbc,_0x55abc9){return db[_0x3af7('0x1d')][_0x3af7('0x1e')](_0x569218[_0x3af7('0x1f')],{'raw':_0x569218[_0x3af7('0x20')]?_0x569218['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x569218['options']?_0x569218[_0x3af7('0x20')]['where']||null:null,'attributes':_0x569218['options']?_0x569218[_0x3af7('0x20')][_0x3af7('0x21')]||null:null,'limit':_0x569218[_0x3af7('0x20')]?_0x569218[_0x3af7('0x20')][_0x3af7('0x22')]||null:null})[_0x3af7('0x23')](function(_0xe4cc85){logger[_0x3af7('0x11')]('UpdateSmsInteraction',_0x569218);logger['debug']('UpdateSmsInteraction',_0x569218,JSON[_0x3af7('0x16')](_0xe4cc85));_0x4d4dbc(_0xe4cc85);})[_0x3af7('0x1b')](function(_0x5496c5){logger[_0x3af7('0x17')]('UpdateSmsInteraction',_0x5496c5[_0x3af7('0x19')],_0x569218);_0x55abc9(_0x1580a0[_0x3af7('0x17')](0x1f4,_0x5496c5[_0x3af7('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0xe7b768){return new Promise(function(_0x402d6a,_0x3ce141){return db[_0x3af7('0x1d')][_0x3af7('0x24')]({'where':_0xe7b768[_0x3af7('0x20')]?_0xe7b768[_0x3af7('0x20')][_0x3af7('0x25')]||null:null})[_0x3af7('0x23')](function(_0xa52116){if(_0xa52116){return _0xa52116['addTags'](_0xe7b768[_0x3af7('0x1f')][_0x3af7('0x26')],_['omit'](_0xe7b768[_0x3af7('0x1f')],[_0x3af7('0x26'),'id'])||{});}})[_0x3af7('0x27')](function(_0xc7e7d2){logger[_0x3af7('0x11')](_0x3af7('0x28'),_0xe7b768);logger[_0x3af7('0x14')]('AddTags',_0xe7b768,JSON[_0x3af7('0x16')](_0xc7e7d2));_0x402d6a(_0xc7e7d2);})[_0x3af7('0x1b')](function(_0xc7f16b){logger[_0x3af7('0x17')](_0x3af7('0x28'),_0xc7f16b[_0x3af7('0x19')],_0xe7b768);_0x3ce141(_this[_0x3af7('0x17')](0x1f4,_0xc7f16b[_0x3af7('0x19')]));});});}; \ No newline at end of file +var _0x6332=['message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','AddTagsToSmsInteraction','find','where','addTags','ids','omit','spread','AddTags','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6332,0x1b3));var _0x2633=function(_0x493982,_0x35dacb){_0x493982=_0x493982-0x0;var _0x567a6d=_0x6332[_0x493982];return _0x567a6d;};'use strict';var _=require(_0x2633('0x0'));var util=require('util');var moment=require(_0x2633('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2633('0x2'));var db=require(_0x2633('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2633('0x4'))('rpc');var config=require(_0x2633('0x5'));var jayson=require(_0x2633('0x6'));var client=jayson[_0x2633('0x7')]['http']({'port':0x232a});config[_0x2633('0x8')]=_[_0x2633('0x9')](config[_0x2633('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2633('0xa'))['register'](socket);function respondWithRpcPromise(_0x263254,_0xe9e62d,_0x582b17){return new BPromise(function(_0x58c0d5,_0x1efc0f){return client[_0x2633('0xb')](_0x263254,_0x582b17)[_0x2633('0xc')](function(_0x40ff1e){logger[_0x2633('0xd')](_0x2633('0xe'),_0xe9e62d,_0x2633('0xf'));logger[_0x2633('0x10')](_0x2633('0x11'),_0xe9e62d,'request\x20sent',JSON[_0x2633('0x12')](_0x40ff1e));if(_0x40ff1e[_0x2633('0x13')]){if(_0x40ff1e[_0x2633('0x13')][_0x2633('0x14')]===0x1f4){logger['error'](_0x2633('0xe'),_0xe9e62d,_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);return _0x1efc0f(_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);}logger['error'](_0x2633('0xe'),_0xe9e62d,_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);return _0x58c0d5(_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);}else{logger['info'](_0x2633('0xe'),_0xe9e62d,'request\x20sent');_0x58c0d5(_0x40ff1e[_0x2633('0x16')][_0x2633('0x15')]);}})['catch'](function(_0x90d895){logger[_0x2633('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xe9e62d,_0x90d895);_0x1efc0f(_0x90d895);});});}exports[_0x2633('0x17')]=function(_0xb632d3){var _0x1100a7=this;return new Promise(function(_0xd7552d,_0x191ea1){return db[_0x2633('0x18')]['update'](_0xb632d3[_0x2633('0x19')],{'raw':_0xb632d3[_0x2633('0x1a')]?_0xb632d3[_0x2633('0x1a')][_0x2633('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb632d3[_0x2633('0x1a')]?_0xb632d3['options']['where']||null:null,'attributes':_0xb632d3['options']?_0xb632d3[_0x2633('0x1a')][_0x2633('0x1c')]||null:null,'limit':_0xb632d3[_0x2633('0x1a')]?_0xb632d3['options']['limit']||null:null})[_0x2633('0xc')](function(_0x276f7a){logger['info']('UpdateSmsInteraction',_0xb632d3);logger['debug'](_0x2633('0x17'),_0xb632d3,JSON['stringify'](_0x276f7a));_0xd7552d(_0x276f7a);})['catch'](function(_0x86d1dd){logger['error']('UpdateSmsInteraction',_0x86d1dd[_0x2633('0x15')],_0xb632d3);_0x191ea1(_0x1100a7[_0x2633('0x13')](0x1f4,_0x86d1dd[_0x2633('0x15')]));});});};exports[_0x2633('0x1d')]=function(_0x27b8de){return new Promise(function(_0x44ec56,_0x18151f){return db[_0x2633('0x18')][_0x2633('0x1e')]({'where':_0x27b8de[_0x2633('0x1a')]?_0x27b8de[_0x2633('0x1a')][_0x2633('0x1f')]||null:null})['then'](function(_0x24aa36){if(_0x24aa36){return _0x24aa36[_0x2633('0x20')](_0x27b8de[_0x2633('0x19')][_0x2633('0x21')],_[_0x2633('0x22')](_0x27b8de['body'],['ids','id'])||{});}})[_0x2633('0x23')](function(_0x3bcb0c){logger['info']('AddTags',_0x27b8de);logger[_0x2633('0x10')](_0x2633('0x24'),_0x27b8de,JSON[_0x2633('0x12')](_0x3bcb0c));_0x44ec56(_0x3bcb0c);})[_0x2633('0x25')](function(_0x4504c5){logger[_0x2633('0x13')](_0x2633('0x24'),_0x4504c5['message'],_0x27b8de);_0x18151f(_this['error'](0x1f4,_0x4504c5[_0x2633('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 71572d1..ebe1b98 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 _0x1dfd=['remove','update','emit','removeListener','length','smsInteraction:'];(function(_0x37a0ce,_0x28dc04){var _0x569f4e=function(_0x1671c0){while(--_0x1671c0){_0x37a0ce['push'](_0x37a0ce['shift']());}};_0x569f4e(++_0x28dc04);}(_0x1dfd,0x72));var _0xd1df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1dfd[_0x3ab51d];return _0x29a04e;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xd1df('0x0'),_0xd1df('0x1')];function createListener(_0x4c8b76,_0x1da62b){return function(_0x744aba){_0x1da62b[_0xd1df('0x2')](_0x4c8b76,_0x744aba);};}function removeListener(_0x4a2b21,_0x1d560c){return function(){SmsInteractionEvents[_0xd1df('0x3')](_0x4a2b21,_0x1d560c);};}exports['register']=function(_0x403ff5){for(var _0x12122e=0x0,_0x26f158=events[_0xd1df('0x4')];_0x12122e<_0x26f158;_0x12122e++){var _0x4e5c6f=events[_0x12122e];var _0x13c388=createListener(_0xd1df('0x5')+_0x4e5c6f,_0x403ff5);SmsInteractionEvents['on'](_0x4e5c6f,_0x13c388);}}; \ No newline at end of file +var _0x0646=['smsInteraction:','update','emit','removeListener','length'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x0646,0x119));var _0x6064=function(_0x2a0566,_0x136e55){_0x2a0566=_0x2a0566-0x0;var _0x45ec17=_0x0646[_0x2a0566];return _0x45ec17;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save','remove',_0x6064('0x0')];function createListener(_0x253926,_0x3643ec){return function(_0x46c0b5){_0x3643ec[_0x6064('0x1')](_0x253926,_0x46c0b5);};}function removeListener(_0x48ac56,_0x92fa7d){return function(){SmsInteractionEvents[_0x6064('0x2')](_0x48ac56,_0x92fa7d);};}exports['register']=function(_0x48e987){for(var _0x221ac5=0x0,_0x3e5724=events[_0x6064('0x3')];_0x221ac5<_0x3e5724;_0x221ac5++){var _0x4e3cb7=events[_0x221ac5];var _0x452cf1=createListener(_0x6064('0x4')+_0x4e3cb7,_0x48e987);SmsInteractionEvents['on'](_0x4e3cb7,_0x452cf1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8759102..5f9fdac 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 _0x1917=['create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms'];(function(_0x20870d,_0x75612f){var _0x485ffc=function(_0x5dfbfe){while(--_0x5dfbfe){_0x20870d['push'](_0x20870d['shift']());}};_0x485ffc(++_0x75612f);}(_0x1917,0x9b));var _0x7191=function(_0x46177c,_0x8c0692){_0x46177c=_0x46177c-0x0;var _0x2730ce=_0x1917[_0x46177c];return _0x2730ce;};'use strict';var multer=require(_0x7191('0x0'));var util=require('util');var path=require(_0x7191('0x1'));var timeout=require(_0x7191('0x2'));var express=require(_0x7191('0x3'));var router=express[_0x7191('0x4')]();var fs_extra=require(_0x7191('0x5'));var auth=require(_0x7191('0x6'));var interaction=require(_0x7191('0x7'));var config=require(_0x7191('0x8'));var controller=require(_0x7191('0x9'));router[_0x7191('0xa')]('/',auth[_0x7191('0xb')](),controller[_0x7191('0xc')]);router[_0x7191('0xa')](_0x7191('0xd'),auth[_0x7191('0xb')](),controller[_0x7191('0xe')]);router[_0x7191('0xa')](_0x7191('0xf'),auth[_0x7191('0xb')](),controller[_0x7191('0x10')]);router['post']('/',auth[_0x7191('0xb')](),interaction[_0x7191('0x11')](_0x7191('0x12'),'smsmessage:create'),controller[_0x7191('0x13')]);router['post'](_0x7191('0x14'),controller[_0x7191('0x15')]);router['put'](_0x7191('0xf'),auth[_0x7191('0xb')](),controller[_0x7191('0x16')]);router[_0x7191('0x17')](_0x7191('0x18'),auth[_0x7191('0xb')](),controller[_0x7191('0x19')]);router[_0x7191('0x17')](_0x7191('0x1a'),auth[_0x7191('0xb')](),controller['reject']);router['delete'](_0x7191('0xf'),auth[_0x7191('0xb')](),controller[_0x7191('0x1b')]);module[_0x7191('0x1c')]=router; \ No newline at end of file +var _0x8d41=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','sms','smsmessage:create','status','put','update','accept','/:id/reject','delete'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8d41,0x12c));var _0x18d4=function(_0x45a91c,_0x56541f){_0x45a91c=_0x45a91c-0x0;var _0x587932=_0x8d41[_0x45a91c];return _0x587932;};'use strict';var multer=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var path=require(_0x18d4('0x2'));var timeout=require(_0x18d4('0x3'));var express=require(_0x18d4('0x4'));var router=express[_0x18d4('0x5')]();var fs_extra=require(_0x18d4('0x6'));var auth=require(_0x18d4('0x7'));var interaction=require(_0x18d4('0x8'));var config=require(_0x18d4('0x9'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x18d4('0xa')](),controller[_0x18d4('0xb')]);router[_0x18d4('0xc')](_0x18d4('0xd'),auth[_0x18d4('0xa')](),controller[_0x18d4('0xe')]);router[_0x18d4('0xc')](_0x18d4('0xf'),auth['isAuthenticated'](),controller[_0x18d4('0x10')]);router['post']('/',auth[_0x18d4('0xa')](),interaction['tracked'](_0x18d4('0x11'),_0x18d4('0x12')),controller['create']);router['post']('/:id/status',controller[_0x18d4('0x13')]);router[_0x18d4('0x14')](_0x18d4('0xf'),auth[_0x18d4('0xa')](),controller[_0x18d4('0x15')]);router[_0x18d4('0x14')]('/:id/accept',auth[_0x18d4('0xa')](),controller[_0x18d4('0x16')]);router['put'](_0x18d4('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x18d4('0x18')](_0x18d4('0xf'),auth[_0x18d4('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d89933f..905c728 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 _0xe984=['exports','medium','BOOLEAN','out','STRING','TEXT'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe984,0x1aa));var _0x4e98=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0xe984[_0x323d87];return _0x5e8f74;};'use strict';var Sequelize=require('sequelize');module[_0x4e98('0x0')]={'body':{'type':Sequelize['TEXT'](_0x4e98('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4e98('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4e98('0x3')),'defaultValue':_0x4e98('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4e98('0x4')](0xbe)},'phone':{'type':Sequelize[_0x4e98('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x4e98('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4e98('0x4')]},'providerResponse':{'type':Sequelize[_0x4e98('0x5')]}}; \ No newline at end of file +var _0x3531=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x3c2342,_0x14262a){var _0x4ea52c=function(_0x126bb0){while(--_0x126bb0){_0x3c2342['push'](_0x3c2342['shift']());}};_0x4ea52c(++_0x14262a);}(_0x3531,0x177));var _0x1353=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x3531[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x1353('0x0'));module[_0x1353('0x1')]={'body':{'type':Sequelize[_0x1353('0x2')](_0x1353('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1353('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1353('0x5')]('in',_0x1353('0x6')),'defaultValue':_0x1353('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1353('0x7')](0xbe)},'phone':{'type':Sequelize[_0x1353('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1353('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1353('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8c4b666..92b1e11 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 _0xc401=['nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','catch','params','keys','length','merge','find','create','body','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','role','interaction','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','interface','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','groupName','DELIVERED','infobip','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','http','client','request','then','info','request\x20sent','error','code','message','SmsMessage,\x20%s,\x20%s','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x3280a1,_0x5f264c){var _0x4988d7=function(_0x46da2c){while(--_0x46da2c){_0x3280a1['push'](_0x3280a1['shift']());}};_0x4988d7(++_0x5f264c);}(_0xc401,0x15d));var _0x1c40=function(_0x2ba51d,_0x7ad4e8){_0x2ba51d=_0x2ba51d-0x0;var _0x6e6c11=_0xc401[_0x2ba51d];return _0x6e6c11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c40('0x0'));var zipdir=require(_0x1c40('0x1'));var jsonpatch=require(_0x1c40('0x2'));var rp=require(_0x1c40('0x3'));var moment=require(_0x1c40('0x4'));var BPromise=require(_0x1c40('0x5'));var Mustache=require(_0x1c40('0x6'));var util=require(_0x1c40('0x7'));var path=require(_0x1c40('0x8'));var sox=require('sox');var csv=require(_0x1c40('0x9'));var ejs=require(_0x1c40('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1c40('0xb'));var crypto=require(_0x1c40('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1c40('0xd'));var toCsv=require(_0x1c40('0x9'));var querystring=require('querystring');var Papa=require(_0x1c40('0xe'));var Redis=require(_0x1c40('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1c40('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c40('0x11'));var logger=require(_0x1c40('0x12'))(_0x1c40('0x13'));var utils=require(_0x1c40('0x14'));var config=require(_0x1c40('0x15'));var licenseUtil=require(_0x1c40('0x16'));var db=require(_0x1c40('0x17'))['db'];config[_0x1c40('0x18')]=_['defaults'](config[_0x1c40('0x18')],{'host':_0x1c40('0x19'),'port':0x18eb});var socket=require(_0x1c40('0x1a'))(new Redis(config[_0x1c40('0x18')]));require('./smsMessage.socket')[_0x1c40('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1c40('0x1c')]({'port':0x232c});var client9002=jayson[_0x1c40('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5209,_0x41ad77,_0x43820b,_0x46cc5c){return new BPromise(function(_0x1468cd,_0x57f018){var _0x30eb14=_0x46cc5c||client;return _0x30eb14[_0x1c40('0x1e')](_0x3b5209,_0x43820b)[_0x1c40('0x1f')](function(_0x1cf4d7){logger[_0x1c40('0x20')]('SmsMessage,\x20%s,\x20%s',_0x41ad77,_0x1c40('0x21'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41ad77,_0x1c40('0x21'),JSON['stringify'](_0x1cf4d7));if(_0x1cf4d7[_0x1c40('0x22')]){if(_0x1cf4d7[_0x1c40('0x22')][_0x1c40('0x23')]===0x1f4){logger[_0x1c40('0x22')]('SmsMessage,\x20%s,\x20%s',_0x41ad77,_0x1cf4d7[_0x1c40('0x22')][_0x1c40('0x24')]);return _0x57f018(_0x1cf4d7[_0x1c40('0x22')][_0x1c40('0x24')]);}logger[_0x1c40('0x22')](_0x1c40('0x25'),_0x41ad77,_0x1cf4d7[_0x1c40('0x22')][_0x1c40('0x24')]);return _0x1468cd(_0x1cf4d7[_0x1c40('0x22')][_0x1c40('0x24')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x41ad77,_0x1c40('0x21'));_0x1468cd(_0x1cf4d7[_0x1c40('0x26')]['message']);}})['catch'](function(_0x14f709){logger[_0x1c40('0x22')](_0x1c40('0x25'),_0x41ad77,_0x14f709);_0x57f018(_0x14f709);});});}function respondWithStatusCode(_0x16d9e4,_0xb5f108){_0xb5f108=_0xb5f108||0xcc;return function(_0x9764a1){if(_0x9764a1){return _0x16d9e4[_0x1c40('0x27')](_0xb5f108);}return _0x16d9e4[_0x1c40('0x28')](_0xb5f108)[_0x1c40('0x29')]();};}function respondWithResult(_0x5fda66,_0x50d781){_0x50d781=_0x50d781||0xc8;return function(_0x24a6c6){if(_0x24a6c6){return _0x5fda66[_0x1c40('0x28')](_0x50d781)[_0x1c40('0x2a')](_0x24a6c6);}};}function respondWithFilteredResult(_0x18dffc,_0x10c04d){return function(_0x3a11dc){if(_0x3a11dc){var _0x40facf=typeof _0x10c04d[_0x1c40('0x2b')]==='undefined'&&typeof _0x10c04d[_0x1c40('0x2c')]===_0x1c40('0x2d');var _0x15d57f=_0x3a11dc[_0x1c40('0x2e')];var _0x4234c3=_0x40facf?0x0:_0x10c04d[_0x1c40('0x2b')];var _0x512a80=_0x40facf?_0x3a11dc['count']:_0x10c04d[_0x1c40('0x2b')]+_0x10c04d['limit'];var _0x3fb75b;if(_0x512a80>=_0x15d57f){_0x512a80=_0x15d57f;_0x3fb75b=0xc8;}else{_0x3fb75b=0xce;}_0x18dffc[_0x1c40('0x28')](_0x3fb75b);return _0x18dffc['set'](_0x1c40('0x2f'),_0x4234c3+'-'+_0x512a80+'/'+_0x15d57f)[_0x1c40('0x2a')](_0x3a11dc);}return null;};}function patchUpdates(_0x1d35e3){return function(_0x2ed1e8){try{jsonpatch[_0x1c40('0x30')](_0x2ed1e8,_0x1d35e3,!![]);}catch(_0xedd9aa){return BPromise[_0x1c40('0x31')](_0xedd9aa);}return _0x2ed1e8[_0x1c40('0x32')]();};}function saveUpdates(_0x147a0a,_0x55b9f9){return function(_0x29eb3d){if(_0x29eb3d){return _0x29eb3d[_0x1c40('0x33')](_0x147a0a)['then'](function(_0x1fa727){return _0x1fa727;});}return null;};}function removeEntity(_0x19e1a8,_0x55f6de){return function(_0x5782d9){if(_0x5782d9){return _0x5782d9[_0x1c40('0x34')]()[_0x1c40('0x1f')](function(){_0x19e1a8[_0x1c40('0x28')](0xcc)[_0x1c40('0x29')]();});}};}function handleEntityNotFound(_0x5b367a,_0x20dd2d){return function(_0xf00388){if(!_0xf00388){_0x5b367a[_0x1c40('0x27')](0x194);}return _0xf00388;};}function handleError(_0x14412f,_0x21e4da){_0x21e4da=_0x21e4da||0x1f4;return function(_0x59f85b){logger[_0x1c40('0x22')](_0x59f85b[_0x1c40('0x35')]);if(_0x59f85b[_0x1c40('0x36')]){delete _0x59f85b[_0x1c40('0x36')];}_0x14412f[_0x1c40('0x28')](_0x21e4da)['send'](_0x59f85b);};}exports[_0x1c40('0x37')]=function(_0x1ea9f3,_0x3eba93){var _0x1a054e={},_0x1c1628={},_0x800291={'count':0x0,'rows':[]};var _0x404c0e=_[_0x1c40('0x38')](db[_0x1c40('0x39')][_0x1c40('0x3a')],function(_0x1ccbf8){return{'name':_0x1ccbf8[_0x1c40('0x3b')],'type':_0x1ccbf8[_0x1c40('0x3c')][_0x1c40('0x3d')]};});_0x1c1628[_0x1c40('0x3e')]=_[_0x1c40('0x38')](_0x404c0e,_0x1c40('0x36'));_0x1c1628[_0x1c40('0x3f')]=_['keys'](_0x1ea9f3[_0x1c40('0x3f')]);_0x1c1628[_0x1c40('0x40')]=_[_0x1c40('0x41')](_0x1c1628['model'],_0x1c1628['query']);_0x1a054e[_0x1c40('0x42')]=_[_0x1c40('0x41')](_0x1c1628['model'],qs['fields'](_0x1ea9f3[_0x1c40('0x3f')][_0x1c40('0x43')]));_0x1a054e[_0x1c40('0x42')]=_0x1a054e[_0x1c40('0x42')]['length']?_0x1a054e['attributes']:_0x1c1628[_0x1c40('0x3e')];if(!_0x1ea9f3[_0x1c40('0x3f')]['hasOwnProperty'](_0x1c40('0x44'))){_0x1a054e['limit']=qs[_0x1c40('0x2c')](_0x1ea9f3[_0x1c40('0x3f')][_0x1c40('0x2c')]);_0x1a054e[_0x1c40('0x2b')]=qs[_0x1c40('0x2b')](_0x1ea9f3['query'][_0x1c40('0x2b')]);}_0x1a054e[_0x1c40('0x45')]=qs[_0x1c40('0x46')](_0x1ea9f3['query']['sort']);_0x1a054e[_0x1c40('0x47')]=qs[_0x1c40('0x40')](_[_0x1c40('0x48')](_0x1ea9f3[_0x1c40('0x3f')],_0x1c1628[_0x1c40('0x40')]),_0x404c0e);if(_0x1ea9f3[_0x1c40('0x3f')][_0x1c40('0x49')]){_0x1a054e[_0x1c40('0x47')]=_['merge'](_0x1a054e[_0x1c40('0x47')],{'$or':_[_0x1c40('0x38')](_0x404c0e,function(_0xf4518b){if(_0xf4518b['type']!==_0x1c40('0x4a')){var _0x5068a5={};_0x5068a5[_0xf4518b[_0x1c40('0x36')]]={'$like':'%'+_0x1ea9f3[_0x1c40('0x3f')][_0x1c40('0x49')]+'%'};return _0x5068a5;}})});}_0x1a054e=_['merge']({},_0x1a054e,_0x1ea9f3[_0x1c40('0x4b')]);var _0x1db74e={'where':_0x1a054e[_0x1c40('0x47')]};return db[_0x1c40('0x39')][_0x1c40('0x2e')](_0x1db74e)[_0x1c40('0x1f')](function(_0xfea5a1){_0x800291[_0x1c40('0x2e')]=_0xfea5a1;if(_0x1ea9f3[_0x1c40('0x3f')][_0x1c40('0x4c')]){_0x1a054e[_0x1c40('0x4d')]=[{'all':!![]}];}return db[_0x1c40('0x39')]['findAll'](_0x1a054e);})['then'](function(_0x505ddd){_0x800291['rows']=_0x505ddd;return _0x800291;})[_0x1c40('0x1f')](respondWithFilteredResult(_0x3eba93,_0x1a054e))[_0x1c40('0x4e')](handleError(_0x3eba93,null));};exports['show']=function(_0x1ac3de,_0x26e3d7){var _0x37e17c={'raw':!![],'where':{'id':_0x1ac3de[_0x1c40('0x4f')]['id']}},_0x298e23={};_0x298e23['model']=_[_0x1c40('0x50')](db[_0x1c40('0x39')][_0x1c40('0x3a')]);_0x298e23[_0x1c40('0x3f')]=_['keys'](_0x1ac3de[_0x1c40('0x3f')]);_0x298e23['filters']=_[_0x1c40('0x41')](_0x298e23[_0x1c40('0x3e')],_0x298e23[_0x1c40('0x3f')]);_0x37e17c[_0x1c40('0x42')]=_[_0x1c40('0x41')](_0x298e23[_0x1c40('0x3e')],qs[_0x1c40('0x43')](_0x1ac3de['query'][_0x1c40('0x43')]));_0x37e17c[_0x1c40('0x42')]=_0x37e17c['attributes'][_0x1c40('0x51')]?_0x37e17c[_0x1c40('0x42')]:_0x298e23[_0x1c40('0x3e')];if(_0x1ac3de['query']['includeAll']){_0x37e17c[_0x1c40('0x4d')]=[{'all':!![]}];}_0x37e17c=_[_0x1c40('0x52')]({},_0x37e17c,_0x1ac3de['options']);return db['SmsMessage'][_0x1c40('0x53')](_0x37e17c)[_0x1c40('0x1f')](handleEntityNotFound(_0x26e3d7,null))[_0x1c40('0x1f')](respondWithResult(_0x26e3d7,null))[_0x1c40('0x4e')](handleError(_0x26e3d7,null));};exports[_0x1c40('0x54')]=function(_0x54e423,_0x36b7b5){return db[_0x1c40('0x39')][_0x1c40('0x54')](_0x54e423[_0x1c40('0x55')],{})[_0x1c40('0x1f')](respondWithResult(_0x36b7b5,0xc9))[_0x1c40('0x4e')](handleError(_0x36b7b5,null));};exports[_0x1c40('0x33')]=function(_0x41f234,_0x411a57){if(_0x41f234['body']['id']){delete _0x41f234[_0x1c40('0x55')]['id'];}return db[_0x1c40('0x39')][_0x1c40('0x53')]({'where':{'id':_0x41f234[_0x1c40('0x4f')]['id']}})[_0x1c40('0x1f')](handleEntityNotFound(_0x411a57,null))[_0x1c40('0x1f')](saveUpdates(_0x41f234[_0x1c40('0x55')],null))[_0x1c40('0x1f')](respondWithResult(_0x411a57,null))[_0x1c40('0x4e')](handleError(_0x411a57,null));};exports['destroy']=function(_0x4c4192,_0x15dc4c){return db[_0x1c40('0x39')]['find']({'where':{'id':_0x4c4192[_0x1c40('0x4f')]['id']}})[_0x1c40('0x1f')](handleEntityNotFound(_0x15dc4c,null))['then'](removeEntity(_0x15dc4c,null))[_0x1c40('0x4e')](handleError(_0x15dc4c,null));};exports[_0x1c40('0x56')]=function(_0x943593,_0x4f8187){return db[_0x1c40('0x39')][_0x1c40('0x56')]()['then'](respondWithResult(_0x4f8187,null))['catch'](handleError(_0x4f8187,null));};var interaction_log=require(_0x1c40('0x12'))(_0x1c40('0x57'));exports[_0x1c40('0x58')]=function(_0xeb44f5,_0x3e4e7b,_0x56c38a){var _0x11e775={'agent':{},'channel':'sms'};if(_0xeb44f5[_0x1c40('0x55')]['id']){delete _0xeb44f5[_0x1c40('0x55')]['id'];}_0xeb44f5[_0x1c40('0x55')]['read']=!![];_0xeb44f5[_0x1c40('0x55')]['readAt']=moment()[_0x1c40('0x59')](_0x1c40('0x5a'));_0xeb44f5['body']['UserId']=_0xeb44f5[_0x1c40('0x55')][_0x1c40('0x5b')]||_0xeb44f5[_0x1c40('0x5c')]['id'];_0x11e775[_0x1c40('0x5d')]['id']=_0xeb44f5[_0x1c40('0x55')]['UserId'];return db[_0x1c40('0x39')][_0x1c40('0x53')]({'where':{'id':_0xeb44f5[_0x1c40('0x4f')]['id'],'UserId':null}})[_0x1c40('0x1f')](handleEntityNotFound(_0x3e4e7b,null))[_0x1c40('0x1f')](saveUpdates(_0xeb44f5['body'],null))[_0x1c40('0x1f')](function(_0x2ec72b){if(_0x2ec72b){_0x11e775[_0x1c40('0x24')]=_0x2ec72b[_0x1c40('0x5e')]({'plain':!![]});return db[_0x1c40('0x5f')][_0x1c40('0x53')]({'where':{'id':_0x2ec72b[_0x1c40('0x60')]}});}return null;})[_0x1c40('0x1f')](handleEntityNotFound(_0x3e4e7b,null))[_0x1c40('0x1f')](function(_0x24cfca){if(_0x24cfca){return _0x24cfca[_0x1c40('0x33')]({'UserId':_0xeb44f5['body'][_0x1c40('0x5b')],'read1stAt':_['isNil'](_0x24cfca[_0x1c40('0x61')])?moment()[_0x1c40('0x59')](_0x1c40('0x5a')):undefined});}return null;})[_0x1c40('0x1f')](function(_0x5d8988){if(_0x5d8988){_0x11e775['interaction']=_0x5d8988['get']({'plain':!![]});interaction_log[_0x1c40('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xeb44f5[_0x1c40('0x5c')]['id'],_0xeb44f5[_0x1c40('0x5c')][_0x1c40('0x36')],_0xeb44f5[_0x1c40('0x5c')][_0x1c40('0x62')],_0x11e775[_0x1c40('0x63')]['id'],_0xeb44f5[_0x1c40('0x55')]?JSON[_0x1c40('0x64')](_0xeb44f5['body']):_0x1c40('0x65'));return respondWithRpcPromise('AcceptMessage',_0x1c40('0x66'),_0x11e775);}return null;})[_0x1c40('0x1f')](function(_0x4bc1bd){var _0x2b1a66=_0x1c40('0x67')+_0x4bc1bd['message'][_0x1c40('0x68')];return db[_0x1c40('0x69')][_0x1c40('0x3f')](_0x2b1a66,{'type':db[_0x1c40('0x6a')][_0x1c40('0x6b')][_0x1c40('0x6c')],'raw':!![]})[_0x1c40('0x1f')](function(_0x42348f){return _0x42348f;});})[_0x1c40('0x1f')](function(_0x525da5){if(_0x525da5){_0x11e775[_0x1c40('0x24')][_0x1c40('0x6d')]=_0x525da5[0x0];if(!_0xeb44f5[_0x1c40('0x55')][_0x1c40('0x5b')])return;return db['User'][_0x1c40('0x53')]({'where':{'id':_0xeb44f5[_0x1c40('0x55')][_0x1c40('0x5b')],'role':'agent'},'attributes':['id',_0x1c40('0x36'),'fullname',_0x1c40('0x6e'),_0x1c40('0x6f')],'raw':!![]});}return null;})[_0x1c40('0x1f')](function(_0x514bcd){if(!_0x514bcd)return null;_0x11e775[_0x1c40('0x24')][_0x1c40('0x5d')]=_0x514bcd;return _0x11e775;})[_0x1c40('0x1f')](function(_0x47fde4){if(_0x47fde4){if(_0xeb44f5['body']['manual']){_0x11e775[_0x1c40('0x24')]['interface']=util[_0x1c40('0x59')](_0x1c40('0x70'),_0xeb44f5[_0x1c40('0x5c')]['name']);_0x11e775[_0x1c40('0x24')][_0x1c40('0x71')]=_0x11e775[_0x1c40('0x71')];_0x11e775[_0x1c40('0x24')][_0x1c40('0x72')]=_0x11e775[_0x1c40('0x71')];_0x11e775[_0x1c40('0x24')][_0x1c40('0x73')]='accept';return respondWithRpcPromise('EventManager',_0x1c40('0x74'),{'event':_0x1c40('0x75'),'message':_0x11e775[_0x1c40('0x24')]},client9002)[_0x1c40('0x1f')](function(){return _0x11e775;});}return _0x11e775;}return null;})['then'](respondWithResult(_0x3e4e7b,null))[_0x1c40('0x4e')](handleError(_0x3e4e7b,null));};var interaction_log=require(_0x1c40('0x12'))('sms-interactions');exports['reject']=function(_0x15c38b,_0x39963f,_0x260e16){var _0x41405b={'agent':{},'channel':_0x1c40('0x76')};if(_0x15c38b[_0x1c40('0x55')]['id']){delete _0x15c38b['body']['id'];}_0x15c38b['body'][_0x1c40('0x5b')]=_0x15c38b[_0x1c40('0x55')][_0x1c40('0x5b')]||_0x15c38b[_0x1c40('0x5c')]['id'];_0x41405b['agent']['id']=_0x15c38b['body'][_0x1c40('0x5b')];return db[_0x1c40('0x39')][_0x1c40('0x53')]({'where':{'id':_0x15c38b[_0x1c40('0x4f')]['id'],'UserId':null}})[_0x1c40('0x1f')](handleEntityNotFound(_0x39963f,null))[_0x1c40('0x1f')](function(_0xc18f3d){if(_0xc18f3d){_0x41405b[_0x1c40('0x24')]=_0xc18f3d[_0x1c40('0x5e')]({'plain':!![]});return db[_0x1c40('0x5f')][_0x1c40('0x53')]({'where':{'id':_0xc18f3d[_0x1c40('0x60')]}});}return null;})[_0x1c40('0x1f')](handleEntityNotFound(_0x39963f,null))[_0x1c40('0x1f')](function(_0x3c5ebb){if(_0x3c5ebb){_0x41405b['interaction']=_0x3c5ebb['get']({'plain':!![]});interaction_log['info'](_0x1c40('0x77'),_0x15c38b[_0x1c40('0x5c')]['id'],_0x15c38b[_0x1c40('0x5c')][_0x1c40('0x36')],_0x15c38b[_0x1c40('0x5c')][_0x1c40('0x62')],_0x41405b[_0x1c40('0x63')]['id'],_0x15c38b['body']?JSON[_0x1c40('0x64')](_0x15c38b[_0x1c40('0x55')]):_0x1c40('0x65'));return respondWithRpcPromise('RejectMessage',_0x1c40('0x78'),_0x41405b);}return null;})[_0x1c40('0x1f')](function(_0x5ae803){var _0x219959=_0x1c40('0x67')+_0x5ae803[_0x1c40('0x24')][_0x1c40('0x68')];return db[_0x1c40('0x69')][_0x1c40('0x3f')](_0x219959,{'type':db[_0x1c40('0x6a')][_0x1c40('0x6b')][_0x1c40('0x6c')],'raw':!![]})[_0x1c40('0x1f')](function(_0x56c5eb){return _0x56c5eb;});})[_0x1c40('0x1f')](function(_0x32cafc){if(_0x32cafc){_0x41405b[_0x1c40('0x24')][_0x1c40('0x6d')]=_0x32cafc[0x0];if(!_0x15c38b[_0x1c40('0x55')][_0x1c40('0x5b')])return;return db[_0x1c40('0x79')][_0x1c40('0x53')]({'where':{'id':_0x15c38b[_0x1c40('0x55')]['UserId'],'role':_0x1c40('0x5d')},'attributes':['id',_0x1c40('0x36'),'fullname','email',_0x1c40('0x6f')],'raw':!![]});}return null;})[_0x1c40('0x1f')](function(_0x4bf56c){if(!_0x4bf56c)return null;_0x41405b['message']['agent']=_0x4bf56c;return _0x41405b;})[_0x1c40('0x1f')](function(_0x1fde7c){if(_0x1fde7c){_0x1fde7c[_0x1c40('0x24')][_0x1c40('0x7a')]=util['format']('SIP/%s',_0x15c38b[_0x1c40('0x5c')][_0x1c40('0x36')]);_0x1fde7c[_0x1c40('0x24')]['channel']=_0x41405b[_0x1c40('0x71')];_0x1fde7c['message']['motionChannel']=_0x41405b[_0x1c40('0x71')];_0x1fde7c[_0x1c40('0x24')]['event']='reject';respondWithRpcPromise(_0x1c40('0x74'),_0x1c40('0x74'),{'event':'rejectmessage','message':_0x1fde7c[_0x1c40('0x24')]},client9002);return _0x41405b;}return null;})[_0x1c40('0x1f')](respondWithResult(_0x39963f,null))['catch'](handleError(_0x39963f,null));};exports[_0x1c40('0x28')]=function(_0x5c6de1,_0x396c9a,_0x486aab){if(_0x5c6de1[_0x1c40('0x55')]['id']){delete _0x5c6de1[_0x1c40('0x55')]['id'];}var _0x5cf155;return db[_0x1c40('0x39')][_0x1c40('0x53')]({'where':{'id':_0x5c6de1[_0x1c40('0x4f')]['id']}})[_0x1c40('0x1f')](handleEntityNotFound(_0x396c9a,null))[_0x1c40('0x1f')](function(_0x70ec96){if(_0x70ec96){_0x5cf155=_0x70ec96;return db[_0x1c40('0x7b')][_0x1c40('0x53')]({'where':{'id':_0x70ec96[_0x1c40('0x7c')]}});}})[_0x1c40('0x1f')](handleEntityNotFound(_0x396c9a,null))[_0x1c40('0x1f')](function(_0x1b9a1a){if(_0x1b9a1a){logger['debug'](_0x1c40('0x7d'),_0x1c40('0x28'),'received\x20delivery\x20report\x20from',_0x1b9a1a[_0x1c40('0x3c')],util[_0x1c40('0x7e')](_0x5c6de1['body'],{'showHidden':![],'depth':null}));switch(_0x1b9a1a[_0x1c40('0x3c')]){case'twilio':if(_0x5c6de1['body'][_0x1c40('0x7f')]&&_0x5c6de1[_0x1c40('0x55')][_0x1c40('0x7f')]===_0x5cf155[_0x1c40('0x80')]){return _0x5cf155[_0x1c40('0x33')]({'read':!![]});}else{logger['error'](_0x1c40('0x81'),_0x1c40('0x28'),'twilio',util[_0x1c40('0x7e')](_0x5c6de1[_0x1c40('0x55')],{'showHidden':![],'depth':null}));}break;case _0x1c40('0x82'):if(_0x5c6de1[_0x1c40('0x55')][_0x1c40('0x83')]&&_0x5c6de1[_0x1c40('0x55')][_0x1c40('0x83')]===_0x5cf155[_0x1c40('0x80')]&&_[_0x1c40('0x84')]([_0x1c40('0x85'),_0x1c40('0x86')],_0x5c6de1[_0x1c40('0x55')][_0x1c40('0x87')])>=0x0){return _0x5cf155[_0x1c40('0x33')]({'read':!![]});}else{logger[_0x1c40('0x22')](_0x1c40('0x81'),_0x1c40('0x28'),'plivio',util['inspect'](_0x5c6de1['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4054c0=_0x5c6de1['body']['results'][0x0];if(_0x4054c0[_0x1c40('0x28')][_0x1c40('0x88')]===_0x1c40('0x89')){return _0x5cf155[_0x1c40('0x33')]({'read':!![]});}else{logger[_0x1c40('0x22')](_0x1c40('0x81'),_0x1c40('0x28'),_0x1c40('0x8a'),util[_0x1c40('0x7e')](_0x5c6de1[_0x1c40('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x5cf155;}})['then'](respondWithResult(_0x396c9a,null))[_0x1c40('0x4e')](handleError(_0x396c9a,null));}; \ No newline at end of file +var _0x1f3c=['include','findAll','rows','show','params','fields','create','body','find','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','User','SIP/%s','SmsAccount','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./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','catch','sendStatus','end','json','offset','limit','count','status','Content-Range','apply','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x1f3c[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require(_0xc1f3('0x0'));var rimraf=require(_0xc1f3('0x1'));var zipdir=require(_0xc1f3('0x2'));var jsonpatch=require(_0xc1f3('0x3'));var rp=require(_0xc1f3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc1f3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1f3('0x6'));var _=require(_0xc1f3('0x7'));var squel=require('squel');var crypto=require(_0xc1f3('0x8'));var jsforce=require(_0xc1f3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc1f3('0x5'));var querystring=require(_0xc1f3('0xa'));var Papa=require(_0xc1f3('0xb'));var Redis=require(_0xc1f3('0xc'));var authService=require(_0xc1f3('0xd'));var qs=require(_0xc1f3('0xe'));var as=require(_0xc1f3('0xf'));var hardwareService=require(_0xc1f3('0x10'));var logger=require(_0xc1f3('0x11'))(_0xc1f3('0x12'));var utils=require(_0xc1f3('0x13'));var config=require(_0xc1f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1f3('0x15'))['db'];config['redis']=_[_0xc1f3('0x16')](config['redis'],{'host':_0xc1f3('0x17'),'port':0x18eb});var socket=require(_0xc1f3('0x18'))(new Redis(config[_0xc1f3('0x19')]));require(_0xc1f3('0x1a'))[_0xc1f3('0x1b')](socket);var jayson=require(_0xc1f3('0x1c'));var client=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232c});var client9002=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3aee70,_0xd96b1a,_0x1d028c,_0x224405){return new BPromise(function(_0x1d0bbf,_0x18718f){var _0x292200=_0x224405||client;return _0x292200[_0xc1f3('0x1f')](_0x3aee70,_0x1d028c)[_0xc1f3('0x20')](function(_0x384e34){logger[_0xc1f3('0x21')](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xd96b1a,_0xc1f3('0x23'),JSON[_0xc1f3('0x26')](_0x384e34));if(_0x384e34[_0xc1f3('0x27')]){if(_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x28')]===0x1f4){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x18718f(_0x384e34[_0xc1f3('0x27')]['message']);}logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x1d0bbf(_0x384e34['error']['message']);}else{logger['info'](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));_0x1d0bbf(_0x384e34['result']['message']);}})[_0xc1f3('0x2a')](function(_0x32cc58){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x32cc58);_0x18718f(_0x32cc58);});});}function respondWithStatusCode(_0x247273,_0xca9551){_0xca9551=_0xca9551||0xcc;return function(_0x4d8b22){if(_0x4d8b22){return _0x247273[_0xc1f3('0x2b')](_0xca9551);}return _0x247273['status'](_0xca9551)[_0xc1f3('0x2c')]();};}function respondWithResult(_0x5a308f,_0x3d6ffa){_0x3d6ffa=_0x3d6ffa||0xc8;return function(_0xe82fda){if(_0xe82fda){return _0x5a308f['status'](_0x3d6ffa)[_0xc1f3('0x2d')](_0xe82fda);}};}function respondWithFilteredResult(_0xa634b2,_0x48d8d9){return function(_0x5134e2){if(_0x5134e2){var _0xba1594=typeof _0x48d8d9[_0xc1f3('0x2e')]==='undefined'&&typeof _0x48d8d9[_0xc1f3('0x2f')]==='undefined';var _0x5c496b=_0x5134e2[_0xc1f3('0x30')];var _0x1f93eb=_0xba1594?0x0:_0x48d8d9['offset'];var _0x29e377=_0xba1594?_0x5134e2[_0xc1f3('0x30')]:_0x48d8d9[_0xc1f3('0x2e')]+_0x48d8d9[_0xc1f3('0x2f')];var _0x4511dc;if(_0x29e377>=_0x5c496b){_0x29e377=_0x5c496b;_0x4511dc=0xc8;}else{_0x4511dc=0xce;}_0xa634b2[_0xc1f3('0x31')](_0x4511dc);return _0xa634b2['set'](_0xc1f3('0x32'),_0x1f93eb+'-'+_0x29e377+'/'+_0x5c496b)[_0xc1f3('0x2d')](_0x5134e2);}return null;};}function patchUpdates(_0x3a682e){return function(_0x376188){try{jsonpatch[_0xc1f3('0x33')](_0x376188,_0x3a682e,!![]);}catch(_0x3d3651){return BPromise['reject'](_0x3d3651);}return _0x376188[_0xc1f3('0x34')]();};}function saveUpdates(_0x5ad983,_0x59cc66){return function(_0x39385f){if(_0x39385f){return _0x39385f[_0xc1f3('0x35')](_0x5ad983)[_0xc1f3('0x20')](function(_0x12f945){return _0x12f945;});}return null;};}function removeEntity(_0x5e058f,_0x76c393){return function(_0xbfc61b){if(_0xbfc61b){return _0xbfc61b[_0xc1f3('0x36')]()['then'](function(){_0x5e058f[_0xc1f3('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56eb94,_0x24c9ab){return function(_0x285b7e){if(!_0x285b7e){_0x56eb94[_0xc1f3('0x2b')](0x194);}return _0x285b7e;};}function handleError(_0x14f688,_0x5b8762){_0x5b8762=_0x5b8762||0x1f4;return function(_0x36494e){logger[_0xc1f3('0x27')](_0x36494e['stack']);if(_0x36494e['name']){delete _0x36494e[_0xc1f3('0x37')];}_0x14f688[_0xc1f3('0x31')](_0x5b8762)[_0xc1f3('0x38')](_0x36494e);};}exports[_0xc1f3('0x39')]=function(_0x17640c,_0x365654){var _0x255bc9={},_0x23c53b={},_0x4d71cc={'count':0x0,'rows':[]};var _0x30b90b=_[_0xc1f3('0x3a')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')],function(_0x28c2ab){return{'name':_0x28c2ab['fieldName'],'type':_0x28c2ab['type'][_0xc1f3('0x3d')]};});_0x23c53b[_0xc1f3('0x3e')]=_[_0xc1f3('0x3a')](_0x30b90b,_0xc1f3('0x37'));_0x23c53b[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x17640c[_0xc1f3('0x3f')]);_0x23c53b['filters']=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],_0x23c53b['query']);_0x255bc9[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],qs['fields'](_0x17640c[_0xc1f3('0x3f')]['fields']));_0x255bc9[_0xc1f3('0x42')]=_0x255bc9[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x255bc9[_0xc1f3('0x42')]:_0x23c53b[_0xc1f3('0x3e')];if(!_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x44')](_0xc1f3('0x45'))){_0x255bc9[_0xc1f3('0x2f')]=qs['limit'](_0x17640c['query'][_0xc1f3('0x2f')]);_0x255bc9[_0xc1f3('0x2e')]=qs[_0xc1f3('0x2e')](_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x2e')]);}_0x255bc9[_0xc1f3('0x46')]=qs[_0xc1f3('0x47')](_0x17640c['query'][_0xc1f3('0x47')]);_0x255bc9[_0xc1f3('0x48')]=qs[_0xc1f3('0x49')](_[_0xc1f3('0x4a')](_0x17640c['query'],_0x23c53b[_0xc1f3('0x49')]),_0x30b90b);if(_0x17640c[_0xc1f3('0x3f')]['filter']){_0x255bc9[_0xc1f3('0x48')]=_[_0xc1f3('0x4b')](_0x255bc9[_0xc1f3('0x48')],{'$or':_[_0xc1f3('0x3a')](_0x30b90b,function(_0x3a1b67){if(_0x3a1b67['type']!=='VIRTUAL'){var _0x1aa9c4={};_0x1aa9c4[_0x3a1b67['name']]={'$like':'%'+_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x4c')]+'%'};return _0x1aa9c4;}})});}_0x255bc9=_[_0xc1f3('0x4b')]({},_0x255bc9,_0x17640c[_0xc1f3('0x4d')]);var _0x5adf0d={'where':_0x255bc9[_0xc1f3('0x48')]};return db[_0xc1f3('0x3b')][_0xc1f3('0x30')](_0x5adf0d)[_0xc1f3('0x20')](function(_0x21bb48){_0x4d71cc[_0xc1f3('0x30')]=_0x21bb48;if(_0x17640c['query'][_0xc1f3('0x4e')]){_0x255bc9[_0xc1f3('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0xc1f3('0x50')](_0x255bc9);})['then'](function(_0x556c2a){_0x4d71cc[_0xc1f3('0x51')]=_0x556c2a;return _0x4d71cc;})[_0xc1f3('0x20')](respondWithFilteredResult(_0x365654,_0x255bc9))[_0xc1f3('0x2a')](handleError(_0x365654,null));};exports[_0xc1f3('0x52')]=function(_0x226ac6,_0x4f3d36){var _0x3f3e56={'raw':!![],'where':{'id':_0x226ac6[_0xc1f3('0x53')]['id']}},_0xddadbc={};_0xddadbc[_0xc1f3('0x3e')]=_[_0xc1f3('0x40')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')]);_0xddadbc[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x226ac6[_0xc1f3('0x3f')]);_0xddadbc['filters']=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],_0xddadbc['query']);_0x3f3e56[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],qs[_0xc1f3('0x54')](_0x226ac6[_0xc1f3('0x3f')]['fields']));_0x3f3e56[_0xc1f3('0x42')]=_0x3f3e56[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x3f3e56[_0xc1f3('0x42')]:_0xddadbc['model'];if(_0x226ac6[_0xc1f3('0x3f')][_0xc1f3('0x4e')]){_0x3f3e56[_0xc1f3('0x4f')]=[{'all':!![]}];}_0x3f3e56=_[_0xc1f3('0x4b')]({},_0x3f3e56,_0x226ac6['options']);return db[_0xc1f3('0x3b')]['find'](_0x3f3e56)[_0xc1f3('0x20')](handleEntityNotFound(_0x4f3d36,null))[_0xc1f3('0x20')](respondWithResult(_0x4f3d36,null))[_0xc1f3('0x2a')](handleError(_0x4f3d36,null));};exports[_0xc1f3('0x55')]=function(_0x30a98a,_0x56b13e){return db[_0xc1f3('0x3b')][_0xc1f3('0x55')](_0x30a98a[_0xc1f3('0x56')],{})[_0xc1f3('0x20')](respondWithResult(_0x56b13e,0xc9))['catch'](handleError(_0x56b13e,null));};exports['update']=function(_0x5a892e,_0x351d91){if(_0x5a892e[_0xc1f3('0x56')]['id']){delete _0x5a892e[_0xc1f3('0x56')]['id'];}return db[_0xc1f3('0x3b')]['find']({'where':{'id':_0x5a892e[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x351d91,null))[_0xc1f3('0x20')](saveUpdates(_0x5a892e[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](respondWithResult(_0x351d91,null))[_0xc1f3('0x2a')](handleError(_0x351d91,null));};exports[_0xc1f3('0x36')]=function(_0x1c1f98,_0x26a404){return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x1c1f98[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x26a404,null))[_0xc1f3('0x20')](removeEntity(_0x26a404,null))['catch'](handleError(_0x26a404,null));};exports[_0xc1f3('0x58')]=function(_0x5a180a,_0x51c871){return db['SmsMessage']['describe']()[_0xc1f3('0x20')](respondWithResult(_0x51c871,null))[_0xc1f3('0x2a')](handleError(_0x51c871,null));};var interaction_log=require(_0xc1f3('0x11'))(_0xc1f3('0x59'));exports[_0xc1f3('0x5a')]=function(_0x3d014c,_0x59e3b2,_0x3ed229){var _0x1fb566={'agent':{},'channel':'sms'};if(_0x3d014c['body']['id']){delete _0x3d014c[_0xc1f3('0x56')]['id'];}_0x3d014c[_0xc1f3('0x56')]['read']=!![];_0x3d014c['body']['readAt']=moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c'));_0x3d014c['body']['UserId']=_0x3d014c[_0xc1f3('0x56')]['UserId']||_0x3d014c['user']['id'];_0x1fb566[_0xc1f3('0x5d')]['id']=_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x3d014c[_0xc1f3('0x53')]['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))[_0xc1f3('0x20')](saveUpdates(_0x3d014c[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](function(_0x4858d1){if(_0x4858d1){_0x1fb566[_0xc1f3('0x29')]=_0x4858d1['get']({'plain':!![]});return db['SmsInteraction'][_0xc1f3('0x57')]({'where':{'id':_0x4858d1[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))['then'](function(_0x8d1afc){if(_0x8d1afc){return _0x8d1afc['update']({'UserId':_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')],'read1stAt':_[_0xc1f3('0x60')](_0x8d1afc['read1stAt'])?moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c')):undefined});}return null;})['then'](function(_0x1dcd45){if(_0x1dcd45){_0x1fb566[_0xc1f3('0x61')]=_0x1dcd45[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x63'),_0x3d014c[_0xc1f3('0x64')]['id'],_0x3d014c['user']['name'],_0x3d014c[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x1fb566[_0xc1f3('0x61')]['id'],_0x3d014c[_0xc1f3('0x56')]?JSON[_0xc1f3('0x26')](_0x3d014c[_0xc1f3('0x56')]):'null');return respondWithRpcPromise(_0xc1f3('0x66'),_0xc1f3('0x67'),_0x1fb566);}return null;})[_0xc1f3('0x20')](function(_0x1ea368){var _0x5a017e=_0xc1f3('0x68')+_0x1ea368['message'][_0xc1f3('0x69')];return db['sequelize']['query'](_0x5a017e,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x3741e9){return _0x3741e9;});})[_0xc1f3('0x20')](function(_0x28988e){if(_0x28988e){_0x1fb566[_0xc1f3('0x29')]['contact']=_0x28988e[0x0];if(!_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db['User'][_0xc1f3('0x57')]({'where':{'id':_0x3d014c['body'][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),_0xc1f3('0x6d'),_0xc1f3('0x6e'),_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x2a3c59){if(!_0x2a3c59)return null;_0x1fb566[_0xc1f3('0x29')]['agent']=_0x2a3c59;return _0x1fb566;})[_0xc1f3('0x20')](function(_0x2341d9){if(_0x2341d9){if(_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x70')]){_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x71')]=util['format']('SIP/%s',_0x3d014c['user'][_0xc1f3('0x37')]);_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566['message'][_0xc1f3('0x73')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x74')]=_0xc1f3('0x5a');return respondWithRpcPromise(_0xc1f3('0x75'),'EventManager',{'event':_0xc1f3('0x76'),'message':_0x1fb566[_0xc1f3('0x29')]},client9002)[_0xc1f3('0x20')](function(){return _0x1fb566;});}return _0x1fb566;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x59e3b2,null))[_0xc1f3('0x2a')](handleError(_0x59e3b2,null));};var interaction_log=require('../../config/logger')(_0xc1f3('0x59'));exports[_0xc1f3('0x77')]=function(_0x27c584,_0x4f7801,_0x5143e1){var _0x18fa9e={'agent':{},'channel':'sms'};if(_0x27c584[_0xc1f3('0x56')]['id']){delete _0x27c584[_0xc1f3('0x56')]['id'];}_0x27c584[_0xc1f3('0x56')]['UserId']=_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')]||_0x27c584[_0xc1f3('0x64')]['id'];_0x18fa9e[_0xc1f3('0x5d')]['id']=_0x27c584['body'][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x27c584['params']['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0x2ab773){if(_0x2ab773){_0x18fa9e[_0xc1f3('0x29')]=_0x2ab773[_0xc1f3('0x62')]({'plain':!![]});return db[_0xc1f3('0x78')][_0xc1f3('0x57')]({'where':{'id':_0x2ab773[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0xabb11b){if(_0xabb11b){_0x18fa9e[_0xc1f3('0x61')]=_0xabb11b[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x79'),_0x27c584[_0xc1f3('0x64')]['id'],_0x27c584[_0xc1f3('0x64')]['name'],_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x18fa9e[_0xc1f3('0x61')]['id'],_0x27c584[_0xc1f3('0x56')]?JSON['stringify'](_0x27c584[_0xc1f3('0x56')]):_0xc1f3('0x7a'));return respondWithRpcPromise(_0xc1f3('0x7b'),_0xc1f3('0x7c'),_0x18fa9e);}return null;})[_0xc1f3('0x20')](function(_0x12bcad){var _0x12d5f2=_0xc1f3('0x68')+_0x12bcad[_0xc1f3('0x29')][_0xc1f3('0x69')];return db[_0xc1f3('0x7d')][_0xc1f3('0x3f')](_0x12d5f2,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x4de1ad){return _0x4de1ad;});})[_0xc1f3('0x20')](function(_0x47df10){if(_0x47df10){_0x18fa9e['message'][_0xc1f3('0x7e')]=_0x47df10[0x0];if(!_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db[_0xc1f3('0x7f')][_0xc1f3('0x57')]({'where':{'id':_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),'fullname','email',_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x575168){if(!_0x575168)return null;_0x18fa9e[_0xc1f3('0x29')][_0xc1f3('0x5d')]=_0x575168;return _0x18fa9e;})[_0xc1f3('0x20')](function(_0x2ae53f){if(_0x2ae53f){_0x2ae53f[_0xc1f3('0x29')]['interface']=util[_0xc1f3('0x5b')](_0xc1f3('0x80'),_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x37')]);_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x73')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f['message'][_0xc1f3('0x74')]='reject';respondWithRpcPromise(_0xc1f3('0x75'),_0xc1f3('0x75'),{'event':'rejectmessage','message':_0x2ae53f[_0xc1f3('0x29')]},client9002);return _0x18fa9e;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x4f7801,null))['catch'](handleError(_0x4f7801,null));};exports['status']=function(_0x4776a7,_0xb21983,_0x1b2d6a){if(_0x4776a7[_0xc1f3('0x56')]['id']){delete _0x4776a7['body']['id'];}var _0x30f853;return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x4776a7[_0xc1f3('0x53')]['id']}})['then'](handleEntityNotFound(_0xb21983,null))['then'](function(_0xb52f9f){if(_0xb52f9f){_0x30f853=_0xb52f9f;return db[_0xc1f3('0x81')]['find']({'where':{'id':_0xb52f9f['SmsAccountId']}});}})[_0xc1f3('0x20')](handleEntityNotFound(_0xb21983,null))[_0xc1f3('0x20')](function(_0x2c8e93){if(_0x2c8e93){logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xc1f3('0x31'),_0xc1f3('0x82'),_0x2c8e93[_0xc1f3('0x83')],util['inspect'](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));switch(_0x2c8e93[_0xc1f3('0x83')]){case _0xc1f3('0x84'):if(_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x85')]&&_0x4776a7[_0xc1f3('0x56')]['MessageSid']===_0x30f853[_0xc1f3('0x86')]){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),'status','twilio',util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x89'):if(_0x4776a7[_0xc1f3('0x56')]['MessageUUID']&&_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x8a')]===_0x30f853[_0xc1f3('0x86')]&&_[_0xc1f3('0x8b')]([_0xc1f3('0x8c'),_0xc1f3('0x8d')],_0x4776a7['body'][_0xc1f3('0x8e')])>=0x0){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x8f'),util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x90'):var _0x3c835c=_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x91')][0x0];if(_0x3c835c[_0xc1f3('0x31')]['groupName']===_0xc1f3('0x92')){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x90'),util['inspect'](_0x4776a7['body'],{'showHidden':![],'depth':null}));}break;}return _0x30f853;}})['then'](respondWithResult(_0xb21983,null))[_0xc1f3('0x2a')](handleError(_0xb21983,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 44a29e1..7c0b087 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 _0x3515=['emit','hasOwnProperty','SmsMessage','save','update','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3515,0xda));var _0x5351=function(_0x4f2aef,_0x4dd402){_0x4f2aef=_0x4f2aef-0x0;var _0x281246=_0x3515[_0x4f2aef];return _0x281246;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x5351('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5351('0x1'),'afterUpdate':_0x5351('0x2'),'afterDestroy':_0x5351('0x3')};function emitEvent(_0x3679fa){return function(_0x5185ae,_0x33680f,_0x2937b5){SmsMessageEvents[_0x5351('0x4')](_0x3679fa+':'+_0x5185ae['id'],_0x5185ae);SmsMessageEvents['emit'](_0x3679fa,_0x5185ae);_0x2937b5(null);};}for(var e in events){if(events[_0x5351('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xdc8a=['events','../../mysqldb','SmsMessage','save','remove','emit','hasOwnProperty'];(function(_0x58c053,_0x51c43f){var _0xe1079=function(_0x172345){while(--_0x172345){_0x58c053['push'](_0x58c053['shift']());}};_0xe1079(++_0x51c43f);}(_0xdc8a,0xf5));var _0xadc8=function(_0x1c75ea,_0x3a0dfc){_0x1c75ea=_0x1c75ea-0x0;var _0x48fa0d=_0xdc8a[_0x1c75ea];return _0x48fa0d;};'use strict';var EventEmitter=require(_0xadc8('0x0'));var SmsMessage=require(_0xadc8('0x1'))['db'][_0xadc8('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xadc8('0x3'),'afterUpdate':'update','afterDestroy':_0xadc8('0x4')};function emitEvent(_0x43e415){return function(_0x4e666d,_0x5a4f70,_0x4b93ca){SmsMessageEvents[_0xadc8('0x5')](_0x43e415+':'+_0x4e666d['id'],_0x4e666d);SmsMessageEvents[_0xadc8('0x5')](_0x43e415,_0x4e666d);_0x4b93ca(null);};}for(var e in events){if(events[_0xadc8('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 8fcbd7c..7102b25 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 _0x8e0d=['clickSend','plivo','authId','%s:%s','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','read','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','application/json','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','then','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','body','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','update','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x8e0d,0x117));var _0xd8e0=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x8e0d[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0xd8e0('0x0'));var util=require(_0xd8e0('0x1'));var logger=require(_0xd8e0('0x2'))(_0xd8e0('0x3'));var moment=require(_0xd8e0('0x4'));var BPromise=require('bluebird');var rp=require(_0xd8e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8e0('0x6'));var config=require(_0xd8e0('0x7'));var attributes=require(_0xd8e0('0x8'));module[_0xd8e0('0x9')]=function(_0xb377fb,_0x477452){return _0xb377fb['define'](_0xd8e0('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd8e0('0xb'),'fields':['messageId']},{'name':_0xd8e0('0xc'),'fields':['body'],'type':_0xd8e0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x523ff7,_0x54ead5,_0x225092){var _0x3c3f18=_0xb377fb[_0xd8e0('0xe')];var _0xa5f71b=_0x523ff7[_0xd8e0('0xf')]({'plain':!![]});if(_0xa5f71b[_0xd8e0('0x10')][_0xd8e0('0x11')]()==='in'||_0xa5f71b['direction'][_0xd8e0('0x11')]()===_0xd8e0('0x12')&&!_0xa5f71b[_0xd8e0('0x13')]&&!_['isNil'](_0xa5f71b['UserId'])&&!_[_0xd8e0('0x14')](_0xa5f71b[_0xd8e0('0x15')])){_0x3c3f18['SmsInteraction']['findOne']({'where':{'id':_0xa5f71b[_0xd8e0('0x15')]}})[_0xd8e0('0x16')](function(_0x1cca87){if(_0x1cca87){_0x1cca87['update']({'lastMsgAt':_0xa5f71b['createdAt'],'lastMsgDirection':_0xa5f71b[_0xd8e0('0x10')]['toLowerCase']()});}})[_0xd8e0('0x17')](function(_0x16f2d7){console['error'](_0x16f2d7);});}if(_0xa5f71b[_0xd8e0('0x10')]===_0xd8e0('0x12')&&!_0xa5f71b[_0xd8e0('0x13')]){var _0x4c5a84;_0x3c3f18[_0xd8e0('0x18')][_0xd8e0('0x19')]({'where':{'id':_0xa5f71b[_0xd8e0('0x1a')]},'raw':!![]})[_0xd8e0('0x16')](function(_0x3be526){_0x4c5a84=_0x3be526;if(_0x4c5a84&&_0x4c5a84[_0xd8e0('0x1b')]){switch(_0x4c5a84['type']){case _0xd8e0('0x1c'):var _0x3f41fb=require(_0xd8e0('0x1c'));if(_0x4c5a84[_0xd8e0('0x1d')]&&_0x4c5a84[_0xd8e0('0x1e')]&&_0x4c5a84['phone']){var _0x58c21b=new _0x3f41fb(_0x4c5a84[_0xd8e0('0x1d')],_0x4c5a84[_0xd8e0('0x1e')]);_0x58c21b[_0xd8e0('0x1f')][_0xd8e0('0x20')]({'body':_0xa5f71b['body'],'to':_0xa5f71b['phone'],'from':_0x4c5a84[_0xd8e0('0x21')],'statusCallback':_0x4c5a84[_0xd8e0('0x22')]+_0xd8e0('0x23')+_0xa5f71b['id']+'/status?token='+_0x4c5a84[_0xd8e0('0x24')]})[_0xd8e0('0x16')](function(_0x4216fd){if(_0x4216fd[_0xd8e0('0x25')]){return _0x523ff7['update']({'messageId':_0x4216fd[_0xd8e0('0x25')]});}})[_0xd8e0('0x17')](function(_0x29b398){logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x1c'),util[_0xd8e0('0x29')](_0x29b398,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),'twilio',_0xd8e0('0x2a'));}break;case _0xd8e0('0x2b'):var _0x5840ef='https://api.skebby.it/API/v1.0/REST/';if(_0x4c5a84[_0xd8e0('0x2c')]&&_0x4c5a84[_0xd8e0('0x2d')]){var _0x3ca87a={'recipient':[_0xa5f71b[_0xd8e0('0x21')]],'message':_0xa5f71b[_0xd8e0('0x2e')],'message_type':_0x4c5a84[_0xd8e0('0x2f')]};if(_0x4c5a84[_0xd8e0('0x2f')]&&_0x4c5a84[_0xd8e0('0x2f')]!=='SI'){_0x3ca87a[_0xd8e0('0x30')]=_0x4c5a84[_0xd8e0('0x21')];}var _0x5ad25e={'url':_0x5840ef+_0xd8e0('0x31')+_0x4c5a84[_0xd8e0('0x2c')]+_0xd8e0('0x32')+_0x4c5a84[_0xd8e0('0x2d')],'method':'GET'};rp(_0x5ad25e)[_0xd8e0('0x16')](function(_0x5e4073){var _0x2d00a1=_0x5e4073[_0xd8e0('0x33')](';');var _0x2e091e={'user_key':_0x2d00a1[0x0],'session_key':_0x2d00a1[0x1]};_0x5ad25e={'url':_0x5840ef+_0xd8e0('0x34'),'method':_0xd8e0('0x35'),'headers':{'user_key':_0x2e091e[_0xd8e0('0x36')],'Session_key':_0x2e091e['session_key']},'json':!![],'body':_0x3ca87a};return rp(_0x5ad25e);})[_0xd8e0('0x16')](function(_0x116d10){if(_0x116d10[_0xd8e0('0x37')]>=0x1){var _0x3904c0={'messageId':_0x116d10[_0xd8e0('0x38')]};if(_0x4c5a84[_0xd8e0('0x2f')]!=='GP'||!_0x4c5a84[_0xd8e0('0x39')]){_0x3904c0['read']=!![];}return _0x523ff7['update'](_0x3904c0);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd8e0('0x2b'),util[_0xd8e0('0x29')](_0x116d10,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1993db){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x2b'),util['inspect'](_0x1993db,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x2b'),_0xd8e0('0x3a'));}break;case _0xd8e0('0x3b'):if(_0x4c5a84[_0xd8e0('0x1e')]){var _0x42797e={'recipient':_0xa5f71b[_0xd8e0('0x21')],'message':_0xa5f71b[_0xd8e0('0x2e')],'sender':_0x4c5a84[_0xd8e0('0x3c')]||_0x4c5a84[_0xd8e0('0x21')],'authorization':_0x4c5a84[_0xd8e0('0x1e')]};var _0x54ead5={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x3d'),'body':_0x42797e,'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x3ece17){var _0x544e05={'messageId':_0x3ece17['requestid']};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x544e05['read']=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x544e05);})['catch'](function(_0x2b97f8){logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x3b'),util[_0xd8e0('0x29')](_0x2b97f8,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x3b'),_0xd8e0('0x3f'));}break;case _0xd8e0('0x40'):if(_0x4c5a84[_0xd8e0('0x2c')]&&_0x4c5a84[_0xd8e0('0x2d')]){var _0x42797e={'messages':[{'source':_0xd8e0('0x41'),'to':_0xa5f71b[_0xd8e0('0x21')],'body':_0xa5f71b[_0xd8e0('0x2e')],'from':_0x4c5a84[_0xd8e0('0x3c')]||_0x4c5a84[_0xd8e0('0x21')]}]};var _0x5ba9a4=util['format']('%s:%s',_0x4c5a84[_0xd8e0('0x2c')],_0x4c5a84[_0xd8e0('0x2d')]);var _0x54ead5={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x42'),'body':_0x42797e,'headers':{'Authorization':util[_0xd8e0('0x43')](_0xd8e0('0x44'),new Buffer(_0x5ba9a4)[_0xd8e0('0x45')]('base64'))},'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x2e53d4){if(_0x2e53d4[_0xd8e0('0x46')]>=0xc8&&_0x2e53d4[_0xd8e0('0x46')]<=0xce){if(_0x2e53d4[_0xd8e0('0x47')]&&_0x2e53d4[_0xd8e0('0x47')][_0xd8e0('0x48')]>0x0){var _0x3778e3=_[_0xd8e0('0x49')](_0x2e53d4['data'][_0xd8e0('0x1f')]);var _0x3752a8={'messageId':_0x3778e3[_0xd8e0('0x4a')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x3752a8['read']=!![];}return _0x523ff7['update'](_0x3752a8);}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),'afterCreate','clickSend',util[_0xd8e0('0x29')](_0x2e53d4,{'showHidden':![],'depth':null}));}}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4b'),util[_0xd8e0('0x29')](_0x2e53d4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1b579){logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4b'),util[_0xd8e0('0x29')](_0x1b579,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4b'),_0xd8e0('0x3a'));}break;case _0xd8e0('0x4c'):if(_0x4c5a84[_0xd8e0('0x4d')]&&_0x4c5a84['authToken']){var _0x42797e={'dst':_0xa5f71b[_0xd8e0('0x21')],'text':_0xa5f71b[_0xd8e0('0x2e')],'src':_0x4c5a84[_0xd8e0('0x3c')]||_0x4c5a84[_0xd8e0('0x21')],'url':_0x4c5a84[_0xd8e0('0x22')]+_0xd8e0('0x23')+_0xa5f71b['id']+'/status?token='+_0x4c5a84[_0xd8e0('0x24')]};var _0x5ba9a4=util[_0xd8e0('0x43')](_0xd8e0('0x4e'),_0x4c5a84[_0xd8e0('0x4d')],_0x4c5a84[_0xd8e0('0x1e')]);var _0x54ead5={'method':_0xd8e0('0x35'),'uri':util[_0xd8e0('0x43')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4c5a84[_0xd8e0('0x4d')]),'body':_0x42797e,'headers':{'Authorization':util[_0xd8e0('0x43')](_0xd8e0('0x44'),new Buffer(_0x5ba9a4)[_0xd8e0('0x45')](_0xd8e0('0x4f')))},'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x749a21){var _0x506bba={'messageId':_0x749a21['message_uuid'][0x0]};return _0x523ff7[_0xd8e0('0x3e')](_0x506bba);})[_0xd8e0('0x17')](function(_0x56127b){logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4c'),util[_0xd8e0('0x29')](_0x56127b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),'afterCreate',_0xd8e0('0x4c'),_0xd8e0('0x50'));}break;case _0xd8e0('0x51'):if(_0x4c5a84['username']&&_0x4c5a84[_0xd8e0('0x2d')]){if(_0x4c5a84[_0xd8e0('0x52')]){var _0x3eb8f3={'method':_0xd8e0('0x35'),'uri':_0x4c5a84[_0xd8e0('0x52')]+_0xd8e0('0x53'),'body':{'username':_0x4c5a84[_0xd8e0('0x2c')],'password':_0x4c5a84[_0xd8e0('0x2d')]},'json':!![]};return rp(_0x3eb8f3)[_0xd8e0('0x16')](function(_0x5b2bcb){var _0x7cc5ac={'method':_0xd8e0('0x35'),'uri':_0x4c5a84[_0xd8e0('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x4c5a84[_0xd8e0('0x21')],'destinations':[{'to':_0xa5f71b[_0xd8e0('0x21')]}],'text':_0xa5f71b['body'],'notifyUrl':_0x4c5a84[_0xd8e0('0x22')]+_0xd8e0('0x23')+_0xa5f71b['id']+'/status?token='+_0x4c5a84[_0xd8e0('0x24')],'notifyContentType':'application/json','callbackData':_0x4c5a84[_0xd8e0('0x21')]+';'+_0xa5f71b['body']}]},'headers':{'Authorization':_0xd8e0('0x54')+_0x5b2bcb[_0xd8e0('0x24')]},'json':!![]};return rp(_0x7cc5ac)['then'](function(_0x20e6a7){if(_0x20e6a7[_0xd8e0('0x1f')]){var _0x156df5={'messageId':_0x20e6a7[_0xd8e0('0x1f')][0x0][_0xd8e0('0xb')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x156df5[_0xd8e0('0x55')]=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x156df5);}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),'infobip',util[_0xd8e0('0x29')](_0x20e6a7,{'showHidden':![],'depth':null}));}});})[_0xd8e0('0x17')](function(_0x53d493){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),'infobip',util[_0xd8e0('0x29')](_0x53d493,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x51'),_0xd8e0('0x3a'));}break;case _0xd8e0('0x56'):var _0x330a36=require(_0xd8e0('0x57'));if(_0x4c5a84[_0xd8e0('0x58')]){var _0x29b3f0={};_0x29b3f0[_0xd8e0('0x59')]=_0x4c5a84['username'];_0x29b3f0[_0xd8e0('0x21')]=_0xa5f71b[_0xd8e0('0x21')];_0x29b3f0['sender']=_0x4c5a84['phone'];_0x29b3f0[_0xd8e0('0x5a')]=_0xa5f71b[_0xd8e0('0x2e')];_0x29b3f0[_0xd8e0('0x5b')]=+new Date();var _0x2fb9f5='';var _0x53c7b3='';var _0xf209c9=Object[_0xd8e0('0x5c')](_0x29b3f0);_0xf209c9[_0xd8e0('0x5d')]();for(var _0x490023=0x0;_0x490023<_0xf209c9[_0xd8e0('0x5e')];_0x490023++){if(_0x2fb9f5!=''){_0x2fb9f5+='&';}_0x2fb9f5+=_0xf209c9[_0x490023]+'='+encodeURIComponent(_0x29b3f0[_0xf209c9[_0x490023]]);_0x53c7b3+=_0x29b3f0[_0xf209c9[_0x490023]];}_0x53c7b3+=_0x4c5a84[_0xd8e0('0x58')];_0x53c7b3=_0x330a36[_0xd8e0('0x5f')](_0xd8e0('0x60'))['update'](_0x53c7b3)[_0xd8e0('0x61')]('hex');if(_0x2fb9f5!==''){_0x2fb9f5+='&';}_0x2fb9f5+=_0xd8e0('0x62')+_0x53c7b3;var _0x5ad25e={'method':'GET','uri':_0x4c5a84['baseUrl']+'/external/get/send.php?'+_0x2fb9f5,'json':!![]};return rp(_0x5ad25e)[_0xd8e0('0x16')](function(_0x12c723){var _0x2e4b95=Object[_0xd8e0('0x5c')](_0x12c723);if(_0x12c723[_0x2e4b95[0x0]][_0xd8e0('0x26')]&&parseInt(_0x12c723[_0x2e4b95[0x0]][_0xd8e0('0x26')])===0x0){var _0x2a8985={'messageId':_0x12c723[_0x2e4b95[0x0]][_0xd8e0('0x63')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x2a8985[_0xd8e0('0x55')]=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x2a8985);}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),'csc',util[_0xd8e0('0x29')](_0x12c723[_0xd8e0('0x26')],{'showHidden':![],'depth':null}));}})[_0xd8e0('0x17')](function(_0x1a8cd7){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x56'),util[_0xd8e0('0x29')](_0x1a8cd7,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x56'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x4c5a84['apiKey']){var _0x2a78e6={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x64'),'headers':{'Authorization':_0x4c5a84[_0xd8e0('0x58')]},'body':{'content':_0xa5f71b['body'],'to':[_0xa5f71b[_0xd8e0('0x21')]],'from':_0x4c5a84[_0xd8e0('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xd8e0('0x65')},'json':!![]};rp(_0x2a78e6)['then'](function(_0x5552de){if(!_0x5552de[_0xd8e0('0x26')]){var _0x163ad8={'messageId':_0x5552de[_0xd8e0('0x1f')][0x0][_0xd8e0('0x66')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x163ad8[_0xd8e0('0x55')]=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x163ad8);}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x67'),util[_0xd8e0('0x29')](_0x5552de[_0xd8e0('0x26')],{'showHidden':![],'depth':null}));}})[_0xd8e0('0x17')](function(_0x43f023){return logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x67'),util[_0xd8e0('0x29')](_0x43f023,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),'afterCreate',_0xd8e0('0x67'),_0xd8e0('0x68'));}break;case _0xd8e0('0x69'):if(_0x4c5a84[_0xd8e0('0x2c')]&&_0x4c5a84['password']){var _0x5ba9a4=util[_0xd8e0('0x43')]('%s:%s',_0x4c5a84[_0xd8e0('0x2c')],_0x4c5a84[_0xd8e0('0x2d')]);var _0x54ead5={'method':_0xd8e0('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4c5a84[_0xd8e0('0x6a')]+_0xd8e0('0x6b'),'body':{'to':[_0xa5f71b[_0xd8e0('0x21')]],'text':_0xa5f71b[_0xd8e0('0x2e')],'from':_0x4c5a84[_0xd8e0('0x21')],'applicationId':_0x4c5a84['applicationId']},'headers':{'Authorization':util[_0xd8e0('0x43')](_0xd8e0('0x44'),new Buffer(_0x5ba9a4)[_0xd8e0('0x45')](_0xd8e0('0x4f')))},'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x157a60){if(_0x157a60['id']){var _0x5be6de={'messageId':_0x157a60['id']};return _0x523ff7[_0xd8e0('0x3e')](_0x5be6de);}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),'bandwidth',util[_0xd8e0('0x29')](_0x157a60,{'showHidden':![],'depth':null}));}})[_0xd8e0('0x17')](function(_0x5afc20){logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x69'),util[_0xd8e0('0x29')](_0x5afc20,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x69'),_0xd8e0('0x3a'));}break;case'intelepeer':if(_0x4c5a84['apiKey']){var _0x51e67f={};var _0x5ad25e={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x6c'),'headers':{'Authorization':_0xd8e0('0x6d')+_0x4c5a84[_0xd8e0('0x58')],'Content-Type':'application/json'},'body':{'from':_0x4c5a84[_0xd8e0('0x21')],'to':_0xa5f71b[_0xd8e0('0x21')],'text':_0xa5f71b[_0xd8e0('0x2e')]},'json':!![]};return rp(_0x5ad25e)['then'](function(_0x103607){if(_0x103607['code']==0xca){_0x51e67f[_0xd8e0('0x6e')]=_0x103607;var _0x3e107a={'method':_0xd8e0('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xd8e0('0x6d')+_0x4c5a84[_0xd8e0('0x58')],'Content-Type':_0xd8e0('0x6f')},'body':{'refid':_0x51e67f[_0xd8e0('0x6e')][_0xd8e0('0x70')]},'json':!![]};return rp(_0x3e107a)[_0xd8e0('0x16')](function(_0x3d9ad7){_0x51e67f[_0xd8e0('0x71')]=_0x3d9ad7;var _0x5adcbc={'messageId':_0x51e67f[_0xd8e0('0x6e')]['refid'],'read':!![]};return _0x523ff7[_0xd8e0('0x3e')](_0x5adcbc);});}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),'afterCreate',_0xd8e0('0x72'),util[_0xd8e0('0x29')](_0x103607,{'showHidden':![],'depth':null}));}})['catch'](function(_0x23a2e9){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x72'),util[_0xd8e0('0x29')](_0x23a2e9,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x72'),_0xd8e0('0x73'));}break;}}})[_0xd8e0('0x74')](function(){_0x225092();});}else{_0x225092();}}},'charset':'utf8mb4','collate':_0xd8e0('0x75')});}; \ No newline at end of file +var _0xe8b5=['signature=','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','accountSid','phone','authToken','messages','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','clickSend','plivo','authId','remote','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','length','digest','hex'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xe8b5,0x17a));var _0x5e8b=function(_0x1ccc19,_0x2a5e47){_0x1ccc19=_0x1ccc19-0x0;var _0x393065=_0xe8b5[_0x1ccc19];return _0x393065;};'use strict';var _=require(_0x5e8b('0x0'));var util=require(_0x5e8b('0x1'));var logger=require(_0x5e8b('0x2'))(_0x5e8b('0x3'));var moment=require(_0x5e8b('0x4'));var BPromise=require(_0x5e8b('0x5'));var rp=require(_0x5e8b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8b('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e8b('0x8'));module[_0x5e8b('0x9')]=function(_0x69c48a,_0x494934){return _0x69c48a[_0x5e8b('0xa')]('SmsMessage',attributes,{'tableName':_0x5e8b('0xb'),'paranoid':![],'indexes':[{'name':_0x5e8b('0xc'),'fields':[_0x5e8b('0xc')]},{'name':_0x5e8b('0xd'),'fields':[_0x5e8b('0xe')],'type':_0x5e8b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f98b4,_0x364f21,_0x4d1d5c){var _0x38c2cc=_0x69c48a[_0x5e8b('0x10')];var _0x17ce18=_0x1f98b4[_0x5e8b('0x11')]({'plain':!![]});if(_0x17ce18['direction'][_0x5e8b('0x12')]()==='in'||_0x17ce18[_0x5e8b('0x13')][_0x5e8b('0x12')]()===_0x5e8b('0x14')&&!_0x17ce18[_0x5e8b('0x15')]&&!_[_0x5e8b('0x16')](_0x17ce18[_0x5e8b('0x17')])&&!_[_0x5e8b('0x16')](_0x17ce18[_0x5e8b('0x18')])){_0x38c2cc[_0x5e8b('0x19')][_0x5e8b('0x1a')]({'where':{'id':_0x17ce18[_0x5e8b('0x18')]}})[_0x5e8b('0x1b')](function(_0x365888){if(_0x365888){_0x365888[_0x5e8b('0x1c')]({'lastMsgAt':_0x17ce18[_0x5e8b('0x1d')],'lastMsgDirection':_0x17ce18[_0x5e8b('0x13')][_0x5e8b('0x12')]()});}})[_0x5e8b('0x1e')](function(_0x44ce14){console[_0x5e8b('0x1f')](_0x44ce14);});}if(_0x17ce18[_0x5e8b('0x13')]===_0x5e8b('0x14')&&!_0x17ce18[_0x5e8b('0x15')]){var _0x53f425;_0x38c2cc[_0x5e8b('0x20')][_0x5e8b('0x21')]({'where':{'id':_0x17ce18[_0x5e8b('0x22')]},'raw':!![]})[_0x5e8b('0x1b')](function(_0x4b0c54){_0x53f425=_0x4b0c54;if(_0x53f425&&_0x53f425[_0x5e8b('0x23')]){switch(_0x53f425[_0x5e8b('0x23')]){case'twilio':var _0x5da5cf=require('twilio');if(_0x53f425[_0x5e8b('0x24')]&&_0x53f425['authToken']&&_0x53f425[_0x5e8b('0x25')]){var _0x313d3f=new _0x5da5cf(_0x53f425[_0x5e8b('0x24')],_0x53f425[_0x5e8b('0x26')]);_0x313d3f[_0x5e8b('0x27')]['create']({'body':_0x17ce18[_0x5e8b('0xe')],'to':_0x17ce18[_0x5e8b('0x25')],'from':_0x53f425[_0x5e8b('0x25')],'statusCallback':_0x53f425['remote']+_0x5e8b('0x28')+_0x17ce18['id']+_0x5e8b('0x29')+_0x53f425[_0x5e8b('0x2a')]})[_0x5e8b('0x1b')](function(_0x2e2d87){if(_0x2e2d87[_0x5e8b('0x2b')]){return _0x1f98b4[_0x5e8b('0x1c')]({'messageId':_0x2e2d87[_0x5e8b('0x2b')]});}})[_0x5e8b('0x1e')](function(_0x170a50){logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x2e'),util[_0x5e8b('0x2f')](_0x170a50,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x2e'),_0x5e8b('0x30'));}break;case'skebby':var _0xab6ca0=_0x5e8b('0x31');if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425['password']){var _0x3e4352={'recipient':[_0x17ce18[_0x5e8b('0x25')]],'message':_0x17ce18[_0x5e8b('0xe')],'message_type':_0x53f425['smsMethod']};if(_0x53f425['smsMethod']&&_0x53f425[_0x5e8b('0x33')]!=='SI'){_0x3e4352[_0x5e8b('0x34')]=_0x53f425[_0x5e8b('0x25')];}var _0x357586={'url':_0xab6ca0+_0x5e8b('0x35')+_0x53f425[_0x5e8b('0x32')]+'&password='+_0x53f425[_0x5e8b('0x36')],'method':'GET'};rp(_0x357586)[_0x5e8b('0x1b')](function(_0x544f5a){var _0x3c2069=_0x544f5a[_0x5e8b('0x37')](';');var _0x446145={'user_key':_0x3c2069[0x0],'session_key':_0x3c2069[0x1]};_0x357586={'url':_0xab6ca0+_0x5e8b('0x38'),'method':_0x5e8b('0x39'),'headers':{'user_key':_0x446145[_0x5e8b('0x3a')],'Session_key':_0x446145[_0x5e8b('0x3b')]},'json':!![],'body':_0x3e4352};return rp(_0x357586);})[_0x5e8b('0x1b')](function(_0x471ad1){if(_0x471ad1[_0x5e8b('0x3c')]>=0x1){var _0x39d934={'messageId':_0x471ad1[_0x5e8b('0x3d')]};if(_0x53f425[_0x5e8b('0x33')]!=='GP'||!_0x53f425[_0x5e8b('0x3e')]){_0x39d934['read']=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x39d934);}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x3f'),util['inspect'](_0x471ad1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x60273a){return logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x3f'),util[_0x5e8b('0x2f')](_0x60273a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5e8b('0x2c'),'afterCreate','skebby',_0x5e8b('0x40'));}break;case _0x5e8b('0x41'):if(_0x53f425['authToken']){var _0x5427ee={'recipient':_0x17ce18[_0x5e8b('0x25')],'message':_0x17ce18[_0x5e8b('0xe')],'sender':_0x53f425[_0x5e8b('0x42')]||_0x53f425[_0x5e8b('0x25')],'authorization':_0x53f425[_0x5e8b('0x26')]};var _0x364f21={'method':_0x5e8b('0x39'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x5427ee,'json':!![]};rp(_0x364f21)[_0x5e8b('0x1b')](function(_0xe59331){var _0x4ea5a4={'messageId':_0xe59331[_0x5e8b('0x43')]};if(!_0x53f425['deliveryReport']){_0x4ea5a4[_0x5e8b('0x44')]=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x4ea5a4);})[_0x5e8b('0x1e')](function(_0x2e689b){logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'connectel',util[_0x5e8b('0x2f')](_0x2e689b,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x41'),_0x5e8b('0x45'));}break;case _0x5e8b('0x46'):if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425['password']){var _0x5427ee={'messages':[{'source':'xCALLY\x20Motion','to':_0x17ce18[_0x5e8b('0x25')],'body':_0x17ce18[_0x5e8b('0xe')],'from':_0x53f425[_0x5e8b('0x42')]||_0x53f425['phone']}]};var _0x19b5b5=util[_0x5e8b('0x47')](_0x5e8b('0x48'),_0x53f425[_0x5e8b('0x32')],_0x53f425[_0x5e8b('0x36')]);var _0x364f21={'method':'POST','uri':_0x5e8b('0x49'),'body':_0x5427ee,'headers':{'Authorization':util['format'](_0x5e8b('0x4a'),new Buffer(_0x19b5b5)['toString'](_0x5e8b('0x4b')))},'json':!![]};rp(_0x364f21)[_0x5e8b('0x1b')](function(_0x1f2d98){if(_0x1f2d98[_0x5e8b('0x4c')]>=0xc8&&_0x1f2d98['http_code']<=0xce){if(_0x1f2d98[_0x5e8b('0x4d')]&&_0x1f2d98[_0x5e8b('0x4d')][_0x5e8b('0x4e')]>0x0){var _0x4b615f=_['head'](_0x1f2d98['data'][_0x5e8b('0x27')]);var _0x17405f={'messageId':_0x4b615f['message_id']};if(!_0x53f425['deliveryReport']){_0x17405f[_0x5e8b('0x44')]=!![];}return _0x1f98b4['update'](_0x17405f);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x4f'),util[_0x5e8b('0x2f')](_0x1f2d98,{'showHidden':![],'depth':null}));}}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),'afterCreate',_0x5e8b('0x4f'),util[_0x5e8b('0x2f')](_0x1f2d98,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a3b21){logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x4f'),util[_0x5e8b('0x2f')](_0x1a3b21,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x4f'),_0x5e8b('0x40'));}break;case _0x5e8b('0x50'):if(_0x53f425[_0x5e8b('0x51')]&&_0x53f425[_0x5e8b('0x26')]){var _0x5427ee={'dst':_0x17ce18['phone'],'text':_0x17ce18[_0x5e8b('0xe')],'src':_0x53f425[_0x5e8b('0x42')]||_0x53f425[_0x5e8b('0x25')],'url':_0x53f425[_0x5e8b('0x52')]+_0x5e8b('0x28')+_0x17ce18['id']+'/status?token='+_0x53f425[_0x5e8b('0x2a')]};var _0x19b5b5=util[_0x5e8b('0x47')](_0x5e8b('0x48'),_0x53f425[_0x5e8b('0x51')],_0x53f425[_0x5e8b('0x26')]);var _0x364f21={'method':'POST','uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x53f425['authId']),'body':_0x5427ee,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x19b5b5)[_0x5e8b('0x53')]('base64'))},'json':!![]};rp(_0x364f21)[_0x5e8b('0x1b')](function(_0x55195e){var _0x1e24b2={'messageId':_0x55195e[_0x5e8b('0x54')][0x0]};return _0x1f98b4[_0x5e8b('0x1c')](_0x1e24b2);})[_0x5e8b('0x1e')](function(_0x54b305){logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x50'),util[_0x5e8b('0x2f')](_0x54b305,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x50'),_0x5e8b('0x55'));}break;case _0x5e8b('0x56'):if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425[_0x5e8b('0x36')]){if(_0x53f425['baseUrl']){var _0x3b700c={'method':'POST','uri':_0x53f425[_0x5e8b('0x57')]+_0x5e8b('0x58'),'body':{'username':_0x53f425[_0x5e8b('0x32')],'password':_0x53f425['password']},'json':!![]};return rp(_0x3b700c)[_0x5e8b('0x1b')](function(_0x38d65c){var _0x1191da={'method':_0x5e8b('0x39'),'uri':_0x53f425['baseUrl']+_0x5e8b('0x59'),'body':{'messages':[{'from':_0x53f425[_0x5e8b('0x25')],'destinations':[{'to':_0x17ce18['phone']}],'text':_0x17ce18[_0x5e8b('0xe')],'notifyUrl':_0x53f425[_0x5e8b('0x52')]+_0x5e8b('0x28')+_0x17ce18['id']+_0x5e8b('0x29')+_0x53f425[_0x5e8b('0x2a')],'notifyContentType':_0x5e8b('0x5a'),'callbackData':_0x53f425['phone']+';'+_0x17ce18[_0x5e8b('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x38d65c[_0x5e8b('0x2a')]},'json':!![]};return rp(_0x1191da)[_0x5e8b('0x1b')](function(_0x229ccf){if(_0x229ccf[_0x5e8b('0x27')]){var _0x1bfc98={'messageId':_0x229ccf[_0x5e8b('0x27')][0x0][_0x5e8b('0xc')]};if(!_0x53f425['deliveryReport']){_0x1bfc98[_0x5e8b('0x44')]=!![];}return _0x1f98b4['update'](_0x1bfc98);}else{return logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'infobip',util[_0x5e8b('0x2f')](_0x229ccf,{'showHidden':![],'depth':null}));}});})[_0x5e8b('0x1e')](function(_0x420b36){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x56'),util[_0x5e8b('0x2f')](_0x420b36,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x56'),_0x5e8b('0x5b'));}}else{logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x56'),_0x5e8b('0x40'));}break;case _0x5e8b('0x5c'):var _0xe384de=require(_0x5e8b('0x5d'));if(_0x53f425[_0x5e8b('0x5e')]){var _0x2b0bf0={};_0x2b0bf0[_0x5e8b('0x5f')]=_0x53f425[_0x5e8b('0x32')];_0x2b0bf0[_0x5e8b('0x25')]=_0x17ce18[_0x5e8b('0x25')];_0x2b0bf0['sender']=_0x53f425['phone'];_0x2b0bf0['text']=_0x17ce18[_0x5e8b('0xe')];_0x2b0bf0[_0x5e8b('0x60')]=+new Date();var _0x4e5795='';var _0x55f255='';var _0x291d0c=Object[_0x5e8b('0x61')](_0x2b0bf0);_0x291d0c[_0x5e8b('0x62')]();for(var _0x43feca=0x0;_0x43feca<_0x291d0c[_0x5e8b('0x63')];_0x43feca++){if(_0x4e5795!=''){_0x4e5795+='&';}_0x4e5795+=_0x291d0c[_0x43feca]+'='+encodeURIComponent(_0x2b0bf0[_0x291d0c[_0x43feca]]);_0x55f255+=_0x2b0bf0[_0x291d0c[_0x43feca]];}_0x55f255+=_0x53f425[_0x5e8b('0x5e')];_0x55f255=_0xe384de['createHash']('md5')[_0x5e8b('0x1c')](_0x55f255)[_0x5e8b('0x64')](_0x5e8b('0x65'));if(_0x4e5795!==''){_0x4e5795+='&';}_0x4e5795+=_0x5e8b('0x66')+_0x55f255;var _0x357586={'method':_0x5e8b('0x67'),'uri':_0x53f425[_0x5e8b('0x57')]+'/external/get/send.php?'+_0x4e5795,'json':!![]};return rp(_0x357586)[_0x5e8b('0x1b')](function(_0x5c1ba2){var _0x3ce7ea=Object[_0x5e8b('0x61')](_0x5c1ba2);if(_0x5c1ba2[_0x3ce7ea[0x0]]['error']&&parseInt(_0x5c1ba2[_0x3ce7ea[0x0]]['error'])===0x0){var _0x3ee73f={'messageId':_0x5c1ba2[_0x3ce7ea[0x0]][_0x5e8b('0x68')]};if(!_0x53f425[_0x5e8b('0x3e')]){_0x3ee73f[_0x5e8b('0x44')]=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x3ee73f);}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'csc',util[_0x5e8b('0x2f')](_0x5c1ba2[_0x5e8b('0x1f')],{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x40e544){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),'afterCreate','csc',util[_0x5e8b('0x2f')](_0x40e544,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x5c'),_0x5e8b('0x69'));}break;case _0x5e8b('0x6a'):if(_0x53f425[_0x5e8b('0x5e')]){var _0x422c1c={'method':_0x5e8b('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x53f425[_0x5e8b('0x5e')]},'body':{'content':_0x17ce18[_0x5e8b('0xe')],'to':[_0x17ce18['phone']],'from':_0x53f425['phone'],'binary':![],'clientMessageId':_0x5e8b('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x422c1c)[_0x5e8b('0x1b')](function(_0x2028a3){if(!_0x2028a3[_0x5e8b('0x1f')]){var _0x4f3d0f={'messageId':_0x2028a3[_0x5e8b('0x27')][0x0]['apiMessageId']};if(!_0x53f425[_0x5e8b('0x3e')]){_0x4f3d0f['read']=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x4f3d0f);}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),'afterCreate',_0x5e8b('0x6a'),util['inspect'](_0x2028a3['error'],{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x106cb7){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x6a'),util['inspect'](_0x106cb7,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x6a'),_0x5e8b('0x69'));}break;case _0x5e8b('0x6c'):if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425[_0x5e8b('0x36')]){var _0x19b5b5=util[_0x5e8b('0x47')](_0x5e8b('0x48'),_0x53f425[_0x5e8b('0x32')],_0x53f425[_0x5e8b('0x36')]);var _0x364f21={'method':_0x5e8b('0x39'),'uri':_0x5e8b('0x6d')+_0x53f425['accountId']+'/messages','body':{'to':[_0x17ce18[_0x5e8b('0x25')]],'text':_0x17ce18[_0x5e8b('0xe')],'from':_0x53f425['phone'],'applicationId':_0x53f425[_0x5e8b('0x6e')]},'headers':{'Authorization':util[_0x5e8b('0x47')](_0x5e8b('0x4a'),new Buffer(_0x19b5b5)[_0x5e8b('0x53')](_0x5e8b('0x4b')))},'json':!![]};rp(_0x364f21)['then'](function(_0x25ab52){if(_0x25ab52['id']){var _0x21f58e={'messageId':_0x25ab52['id']};return _0x1f98b4['update'](_0x21f58e);}else{logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),'bandwidth',util[_0x5e8b('0x2f')](_0x25ab52,{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x2bcd6f){logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x6c'),util[_0x5e8b('0x2f')](_0x2bcd6f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'bandwidth',_0x5e8b('0x40'));}break;case'intelepeer':if(_0x53f425[_0x5e8b('0x5e')]){var _0x49cb2a={};var _0x357586={'method':_0x5e8b('0x39'),'uri':_0x5e8b('0x6f'),'headers':{'Authorization':_0x5e8b('0x70')+_0x53f425[_0x5e8b('0x5e')],'Content-Type':_0x5e8b('0x5a')},'body':{'from':_0x53f425[_0x5e8b('0x25')],'to':_0x17ce18[_0x5e8b('0x25')],'text':_0x17ce18['body']},'json':!![]};return rp(_0x357586)[_0x5e8b('0x1b')](function(_0x5a4aaf){if(_0x5a4aaf[_0x5e8b('0x71')]==0xca){_0x49cb2a[_0x5e8b('0x72')]=_0x5a4aaf;var _0x34c536={'method':_0x5e8b('0x39'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x5e8b('0x70')+_0x53f425[_0x5e8b('0x5e')],'Content-Type':_0x5e8b('0x5a')},'body':{'refid':_0x49cb2a[_0x5e8b('0x72')][_0x5e8b('0x73')]},'json':!![]};return rp(_0x34c536)[_0x5e8b('0x1b')](function(_0x5d5bb1){_0x49cb2a[_0x5e8b('0x74')]=_0x5d5bb1;var _0x2005dc={'messageId':_0x49cb2a['message']['refid'],'read':!![]};return _0x1f98b4[_0x5e8b('0x1c')](_0x2005dc);});}else{return logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x75'),util[_0x5e8b('0x2f')](_0x5a4aaf,{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x380daa){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x75'),util[_0x5e8b('0x2f')](_0x380daa,{'showHidden':![],'depth':null}));});}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x75'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x4d1d5c();});}else{_0x4d1d5c();}}},'charset':_0x5e8b('0x76'),'collate':_0x5e8b('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f718a76..904f81a 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 _0xcbca=['message','SmsMessage,\x20%s,\x20%s','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x1cd6a7,_0x3de156){var _0x1033e4=function(_0x3798e2){while(--_0x3798e2){_0x1cd6a7['push'](_0x1cd6a7['shift']());}};_0x1033e4(++_0x3de156);}(_0xcbca,0x96));var _0xacbc=function(_0x256ffb,_0x103b45){_0x256ffb=_0x256ffb-0x0;var _0x2ab707=_0xcbca[_0x256ffb];return _0x2ab707;};'use strict';var _=require(_0xacbc('0x0'));var util=require(_0xacbc('0x1'));var moment=require(_0xacbc('0x2'));var BPromise=require(_0xacbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xacbc('0x5'));var logger=require(_0xacbc('0x6'))(_0xacbc('0x7'));var config=require(_0xacbc('0x8'));var jayson=require(_0xacbc('0x9'));var client=jayson[_0xacbc('0xa')][_0xacbc('0xb')]({'port':0x232a});config[_0xacbc('0xc')]=_[_0xacbc('0xd')](config[_0xacbc('0xc')],{'host':_0xacbc('0xe'),'port':0x18eb});var socket=require(_0xacbc('0xf'))(new Redis(config[_0xacbc('0xc')]));require(_0xacbc('0x10'))[_0xacbc('0x11')](socket);function respondWithRpcPromise(_0x2cc127,_0x60e5fc,_0x181793){return new BPromise(function(_0x2b5343,_0x35c218){return client[_0xacbc('0x12')](_0x2cc127,_0x181793)[_0xacbc('0x13')](function(_0x24ff1f){logger['info']('SmsMessage,\x20%s,\x20%s',_0x60e5fc,'request\x20sent');logger[_0xacbc('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x60e5fc,_0xacbc('0x15'),JSON[_0xacbc('0x16')](_0x24ff1f));if(_0x24ff1f['error']){if(_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x18')]===0x1f4){logger[_0xacbc('0x17')]('SmsMessage,\x20%s,\x20%s',_0x60e5fc,_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);return _0x35c218(_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);}logger[_0xacbc('0x17')](_0xacbc('0x1a'),_0x60e5fc,_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);return _0x2b5343(_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);}else{logger[_0xacbc('0x1b')](_0xacbc('0x1a'),_0x60e5fc,_0xacbc('0x15'));_0x2b5343(_0x24ff1f['result'][_0xacbc('0x19')]);}})[_0xacbc('0x1c')](function(_0x2d1c79){logger[_0xacbc('0x17')](_0xacbc('0x1a'),_0x60e5fc,_0x2d1c79);_0x35c218(_0x2d1c79);});});}exports[_0xacbc('0x1d')]=function(_0x29decc){var _0x43f0d0=this;return new Promise(function(_0xfc0ab7,_0x151f35){return db[_0xacbc('0x1e')][_0xacbc('0x1f')](_0x29decc[_0xacbc('0x20')],{'raw':_0x29decc[_0xacbc('0x21')]?_0x29decc['options'][_0xacbc('0x22')]===undefined?!![]:![]:!![]})[_0xacbc('0x13')](function(_0x20d2a9){logger[_0xacbc('0x1b')](_0xacbc('0x1d'),_0x29decc);logger[_0xacbc('0x14')]('CreateSmsMessage',_0x29decc,JSON[_0xacbc('0x16')](_0x20d2a9));_0xfc0ab7(_0x20d2a9);})[_0xacbc('0x1c')](function(_0x17e23a){logger[_0xacbc('0x17')]('CreateSmsMessage',_0x17e23a[_0xacbc('0x19')],_0x29decc);_0x151f35(_0x43f0d0[_0xacbc('0x17')](0x1f4,_0x17e23a['message']));});});}; \ No newline at end of file +var _0x1ff6=['message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsMessage,\x20%s,\x20%s'];(function(_0x5dfcd4,_0x3ceb22){var _0x353a4c=function(_0x476fa7){while(--_0x476fa7){_0x5dfcd4['push'](_0x5dfcd4['shift']());}};_0x353a4c(++_0x3ceb22);}(_0x1ff6,0x122));var _0x61ff=function(_0x930fab,_0x514b26){_0x930fab=_0x930fab-0x0;var _0x39751e=_0x1ff6[_0x930fab];return _0x39751e;};'use strict';var _=require('lodash');var util=require(_0x61ff('0x0'));var moment=require(_0x61ff('0x1'));var BPromise=require(_0x61ff('0x2'));var rs=require(_0x61ff('0x3'));var fs=require('fs');var Redis=require(_0x61ff('0x4'));var db=require(_0x61ff('0x5'))['db'];var utils=require(_0x61ff('0x6'));var logger=require('../../config/logger')(_0x61ff('0x7'));var config=require(_0x61ff('0x8'));var jayson=require(_0x61ff('0x9'));var client=jayson[_0x61ff('0xa')]['http']({'port':0x232a});config[_0x61ff('0xb')]=_[_0x61ff('0xc')](config[_0x61ff('0xb')],{'host':_0x61ff('0xd'),'port':0x18eb});var socket=require(_0x61ff('0xe'))(new Redis(config[_0x61ff('0xb')]));require(_0x61ff('0xf'))[_0x61ff('0x10')](socket);function respondWithRpcPromise(_0x380fd4,_0x14a68a,_0x394266){return new BPromise(function(_0x5b7d9a,_0x2edea3){return client[_0x61ff('0x11')](_0x380fd4,_0x394266)[_0x61ff('0x12')](function(_0x3a7064){logger[_0x61ff('0x13')]('SmsMessage,\x20%s,\x20%s',_0x14a68a,'request\x20sent');logger[_0x61ff('0x14')](_0x61ff('0x15'),_0x14a68a,_0x61ff('0x16'),JSON['stringify'](_0x3a7064));if(_0x3a7064[_0x61ff('0x17')]){if(_0x3a7064[_0x61ff('0x17')]['code']===0x1f4){logger[_0x61ff('0x17')](_0x61ff('0x18'),_0x14a68a,_0x3a7064[_0x61ff('0x17')][_0x61ff('0x19')]);return _0x2edea3(_0x3a7064[_0x61ff('0x17')]['message']);}logger[_0x61ff('0x17')](_0x61ff('0x18'),_0x14a68a,_0x3a7064['error'][_0x61ff('0x19')]);return _0x5b7d9a(_0x3a7064[_0x61ff('0x17')]['message']);}else{logger[_0x61ff('0x13')](_0x61ff('0x18'),_0x14a68a,_0x61ff('0x16'));_0x5b7d9a(_0x3a7064[_0x61ff('0x1a')][_0x61ff('0x19')]);}})[_0x61ff('0x1b')](function(_0x32ae64){logger[_0x61ff('0x17')](_0x61ff('0x18'),_0x14a68a,_0x32ae64);_0x2edea3(_0x32ae64);});});}exports[_0x61ff('0x1c')]=function(_0x426ed6){var _0x1e86e3=this;return new Promise(function(_0x4d8022,_0x483484){return db[_0x61ff('0x1d')][_0x61ff('0x1e')](_0x426ed6[_0x61ff('0x1f')],{'raw':_0x426ed6[_0x61ff('0x20')]?_0x426ed6[_0x61ff('0x20')][_0x61ff('0x21')]===undefined?!![]:![]:!![]})[_0x61ff('0x12')](function(_0x2dda60){logger[_0x61ff('0x13')](_0x61ff('0x1c'),_0x426ed6);logger[_0x61ff('0x14')](_0x61ff('0x1c'),_0x426ed6,JSON[_0x61ff('0x22')](_0x2dda60));_0x4d8022(_0x2dda60);})['catch'](function(_0x2f0551){logger['error']('CreateSmsMessage',_0x2f0551[_0x61ff('0x19')],_0x426ed6);_0x483484(_0x1e86e3['error'](0x1f4,_0x2f0551[_0x61ff('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 68678a5..de217f2 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 _0x9d7b=['register','length','./smsMessage.events','save','remove','emit','removeListener'];(function(_0x172609,_0x3b5e9b){var _0x46ee33=function(_0x131eed){while(--_0x131eed){_0x172609['push'](_0x172609['shift']());}};_0x46ee33(++_0x3b5e9b);}(_0x9d7b,0x159));var _0xb9d7=function(_0x17079f,_0xd6be85){_0x17079f=_0x17079f-0x0;var _0xb710bf=_0x9d7b[_0x17079f];return _0xb710bf;};'use strict';var SmsMessageEvents=require(_0xb9d7('0x0'));var events=[_0xb9d7('0x1'),_0xb9d7('0x2'),'update'];function createListener(_0x3f96f0,_0x381da4){return function(_0x5f2e9e){_0x381da4[_0xb9d7('0x3')](_0x3f96f0,_0x5f2e9e);};}function removeListener(_0x24b485,_0x1206d6){return function(){SmsMessageEvents[_0xb9d7('0x4')](_0x24b485,_0x1206d6);};}exports[_0xb9d7('0x5')]=function(_0x249cfd){for(var _0x57d9a6=0x0,_0x21b48e=events[_0xb9d7('0x6')];_0x57d9a6<_0x21b48e;_0x57d9a6++){var _0x433645=events[_0x57d9a6];var _0x5b80a9=createListener('smsMessage:'+_0x433645,_0x249cfd);SmsMessageEvents['on'](_0x433645,_0x5b80a9);}}; \ No newline at end of file +var _0xe851=['smsMessage:','./smsMessage.events','remove','update','emit','register','length'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xe851,0x1c8));var _0x1e85=function(_0x3adbfe,_0x46854c){_0x3adbfe=_0x3adbfe-0x0;var _0x155bc5=_0xe851[_0x3adbfe];return _0x155bc5;};'use strict';var SmsMessageEvents=require(_0x1e85('0x0'));var events=['save',_0x1e85('0x1'),_0x1e85('0x2')];function createListener(_0x5e0dd4,_0x2cf7a8){return function(_0xc0181a){_0x2cf7a8[_0x1e85('0x3')](_0x5e0dd4,_0xc0181a);};}function removeListener(_0x2bbc0f,_0x28ce65){return function(){SmsMessageEvents['removeListener'](_0x2bbc0f,_0x28ce65);};}exports[_0x1e85('0x4')]=function(_0x54dcea){for(var _0x4c6d35=0x0,_0x11ddfa=events[_0x1e85('0x5')];_0x4c6d35<_0x11ddfa;_0x4c6d35++){var _0x3bc202=events[_0x4c6d35];var _0x3030cb=createListener(_0x1e85('0x6')+_0x3bc202,_0x54dcea);SmsMessageEvents['on'](_0x3bc202,_0x3030cb);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 35fb401..42d2a01 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 _0x9a7d=['removeAgents','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','put','update','destroy','delete','removeTeams'];(function(_0x419fc2,_0xc15579){var _0x165850=function(_0x3ac246){while(--_0x3ac246){_0x419fc2['push'](_0x419fc2['shift']());}};_0x165850(++_0xc15579);}(_0x9a7d,0xfd));var _0xd9a7=function(_0x21c3ac,_0x2a46bb){_0x21c3ac=_0x21c3ac-0x0;var _0x3c45ad=_0x9a7d[_0x21c3ac];return _0x3c45ad;};'use strict';var multer=require(_0xd9a7('0x0'));var util=require(_0xd9a7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd9a7('0x2')]();var fs_extra=require(_0xd9a7('0x3'));var auth=require(_0xd9a7('0x4'));var interaction=require(_0xd9a7('0x5'));var config=require(_0xd9a7('0x6'));var controller=require('./smsQueue.controller');router[_0xd9a7('0x7')]('/',auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x9')]);router[_0xd9a7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd9a7('0xa')]);router[_0xd9a7('0x7')](_0xd9a7('0xb'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0xc')]);router[_0xd9a7('0x7')](_0xd9a7('0xd'),auth[_0xd9a7('0x8')](),controller['getMembers']);router['get'](_0xd9a7('0xe'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0xf')]);router['get'](_0xd9a7('0x10'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x11')]);router['post']('/',auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x12')]);router['post']('/:id/teams',auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x13')]);router[_0xd9a7('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xd9a7('0x15')]);router[_0xd9a7('0x16')](_0xd9a7('0xb'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x17')]);router['delete'](_0xd9a7('0xb'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x18')]);router[_0xd9a7('0x19')](_0xd9a7('0xe'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x1a')]);router[_0xd9a7('0x19')](_0xd9a7('0x10'),auth[_0xd9a7('0x8')](),controller[_0xd9a7('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x1dc9=['/:id/teams','addTeams','put','update','delete','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create'];(function(_0x52b22f,_0x12c645){var _0x3eea4e=function(_0x1ce222){while(--_0x1ce222){_0x52b22f['push'](_0x52b22f['shift']());}};_0x3eea4e(++_0x12c645);}(_0x1dc9,0x1e7));var _0x91dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dc9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x91dc('0x0'));var path=require(_0x91dc('0x1'));var timeout=require(_0x91dc('0x2'));var express=require(_0x91dc('0x3'));var router=express[_0x91dc('0x4')]();var fs_extra=require(_0x91dc('0x5'));var auth=require(_0x91dc('0x6'));var interaction=require(_0x91dc('0x7'));var config=require(_0x91dc('0x8'));var controller=require(_0x91dc('0x9'));router['get']('/',auth[_0x91dc('0xa')](),controller[_0x91dc('0xb')]);router[_0x91dc('0xc')](_0x91dc('0xd'),auth[_0x91dc('0xa')](),controller[_0x91dc('0xe')]);router[_0x91dc('0xc')](_0x91dc('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x91dc('0xc')](_0x91dc('0x10'),auth[_0x91dc('0xa')](),controller[_0x91dc('0x11')]);router[_0x91dc('0xc')]('/:id/teams',auth[_0x91dc('0xa')](),controller[_0x91dc('0x12')]);router[_0x91dc('0xc')](_0x91dc('0x13'),auth['isAuthenticated'](),controller[_0x91dc('0x14')]);router[_0x91dc('0x15')]('/',auth[_0x91dc('0xa')](),controller[_0x91dc('0x16')]);router[_0x91dc('0x15')](_0x91dc('0x17'),auth[_0x91dc('0xa')](),controller[_0x91dc('0x18')]);router[_0x91dc('0x15')](_0x91dc('0x13'),auth[_0x91dc('0xa')](),controller['addAgents']);router[_0x91dc('0x19')](_0x91dc('0xf'),auth['isAuthenticated'](),controller[_0x91dc('0x1a')]);router[_0x91dc('0x1b')](_0x91dc('0xf'),auth[_0x91dc('0xa')](),controller['destroy']);router[_0x91dc('0x1b')](_0x91dc('0x17'),auth[_0x91dc('0xa')](),controller[_0x91dc('0x1c')]);router['delete']('/:id/users',auth[_0x91dc('0xa')](),controller[_0x91dc('0x1d')]);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 27c873e..6d4ff94 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 _0xf430=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x2a4aef,_0x4ab35d){var _0xdab266=function(_0x5363a6){while(--_0x5363a6){_0x2a4aef['push'](_0x2a4aef['shift']());}};_0xdab266(++_0x4ab35d);}(_0xf430,0x1a2));var _0x0f43=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0xf430[_0x578275];return _0xf78041;};'use strict';var Sequelize=require(_0x0f43('0x0'));module[_0x0f43('0x1')]={'name':{'type':Sequelize[_0x0f43('0x2')],'unique':_0x0f43('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0f43('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f43('0x4')](_0x0f43('0x5'),_0x0f43('0x6'),_0x0f43('0x7'))}}; \ No newline at end of file +var _0x3c88=['sequelize','exports','STRING','INTEGER','ENUM','beepall','roundrobin'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x3c88,0x70));var _0x83c8=function(_0x5cdd21,_0x513469){_0x5cdd21=_0x5cdd21-0x0;var _0x1fce47=_0x3c88[_0x5cdd21];return _0x1fce47;};'use strict';var Sequelize=require(_0x83c8('0x0'));module[_0x83c8('0x1')]={'name':{'type':Sequelize[_0x83c8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x83c8('0x2')]},'timeout':{'type':Sequelize[_0x83c8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x83c8('0x4')]('rrmemory',_0x83c8('0x5'),_0x83c8('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3722585..a7745fe 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 _0x661e=['query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','name','options','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','getMembers','findOne','UserSmsQueue','nolimit','sort','SmsQueueId','findAll','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','field','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','send','index','map','SmsQueue','rawAttributes','type','key','model','keys'];(function(_0x391eae,_0x34fe5f){var _0x5691e5=function(_0x2abe95){while(--_0x2abe95){_0x391eae['push'](_0x391eae['shift']());}};_0x5691e5(++_0x34fe5f);}(_0x661e,0x169));var _0xe661=function(_0x25eb47,_0x1c1fae){_0x25eb47=_0x25eb47-0x0;var _0x856891=_0x661e[_0x25eb47];return _0x856891;};'use strict';var emlformat=require(_0xe661('0x0'));var rimraf=require(_0xe661('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe661('0x2'));var rp=require(_0xe661('0x3'));var moment=require(_0xe661('0x4'));var BPromise=require(_0xe661('0x5'));var Mustache=require(_0xe661('0x6'));var util=require(_0xe661('0x7'));var path=require(_0xe661('0x8'));var sox=require(_0xe661('0x9'));var csv=require(_0xe661('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe661('0xb'));var _=require(_0xe661('0xc'));var squel=require(_0xe661('0xd'));var crypto=require(_0xe661('0xe'));var jsforce=require(_0xe661('0xf'));var deskjs=require(_0xe661('0x10'));var toCsv=require(_0xe661('0xa'));var querystring=require(_0xe661('0x11'));var Papa=require(_0xe661('0x12'));var Redis=require(_0xe661('0x13'));var authService=require(_0xe661('0x14'));var qs=require(_0xe661('0x15'));var as=require(_0xe661('0x16'));var hardwareService=require(_0xe661('0x17'));var logger=require('../../config/logger')(_0xe661('0x18'));var utils=require('../../config/utils');var config=require(_0xe661('0x19'));var licenseUtil=require(_0xe661('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe661('0x1b')]=_[_0xe661('0x1c')](config[_0xe661('0x1b')],{'host':_0xe661('0x1d'),'port':0x18eb});var socket=require(_0xe661('0x1e'))(new Redis(config[_0xe661('0x1b')]));require('./smsQueue.socket')[_0xe661('0x1f')](socket);function respondWithStatusCode(_0x5d3040,_0x19d699){_0x19d699=_0x19d699||0xcc;return function(_0x4beb80){if(_0x4beb80){return _0x5d3040['sendStatus'](_0x19d699);}return _0x5d3040['status'](_0x19d699)[_0xe661('0x20')]();};}function respondWithResult(_0xbfcca5,_0x12cb39){_0x12cb39=_0x12cb39||0xc8;return function(_0x9f565a){if(_0x9f565a){return _0xbfcca5[_0xe661('0x21')](_0x12cb39)[_0xe661('0x22')](_0x9f565a);}};}function respondWithFilteredResult(_0x39cfb2,_0x42fe2d){return function(_0x2e3739){if(_0x2e3739){var _0x2355b8=typeof _0x42fe2d[_0xe661('0x23')]==='undefined'&&typeof _0x42fe2d[_0xe661('0x24')]===_0xe661('0x25');var _0x1e36c0=_0x2e3739[_0xe661('0x26')];var _0x49a246=_0x2355b8?0x0:_0x42fe2d[_0xe661('0x23')];var _0xdbafa1=_0x2355b8?_0x2e3739['count']:_0x42fe2d['offset']+_0x42fe2d[_0xe661('0x24')];var _0x24f9b9;if(_0xdbafa1>=_0x1e36c0){_0xdbafa1=_0x1e36c0;_0x24f9b9=0xc8;}else{_0x24f9b9=0xce;}_0x39cfb2[_0xe661('0x21')](_0x24f9b9);return _0x39cfb2[_0xe661('0x27')](_0xe661('0x28'),_0x49a246+'-'+_0xdbafa1+'/'+_0x1e36c0)[_0xe661('0x22')](_0x2e3739);}return null;};}function patchUpdates(_0x137e04){return function(_0x91f6a7){try{jsonpatch['apply'](_0x91f6a7,_0x137e04,!![]);}catch(_0xdbbc28){return BPromise[_0xe661('0x29')](_0xdbbc28);}return _0x91f6a7[_0xe661('0x2a')]();};}function saveUpdates(_0x3aed64,_0x3eb5c1){return function(_0x4829f3){if(_0x4829f3){return _0x4829f3[_0xe661('0x2b')](_0x3aed64)[_0xe661('0x2c')](function(_0xb5dfba){return _0xb5dfba;});}return null;};}function removeEntity(_0x4844cc,_0x5edbf8){return function(_0x4845c5){if(_0x4845c5){return _0x4845c5[_0xe661('0x2d')]()['then'](function(){var _0x470fb5=_0x4845c5[_0xe661('0x2e')]({'plain':!![]});var _0x1abd05=_0xe661('0x2f');return db[_0xe661('0x30')][_0xe661('0x2d')]({'where':{'type':_0x1abd05,'resourceId':_0x470fb5['id']}})['then'](function(){return _0x4845c5;});})[_0xe661('0x2c')](function(){_0x4844cc['status'](0xcc)[_0xe661('0x20')]();});}};}function handleEntityNotFound(_0x4d31a6,_0xf6b52){return function(_0x2b56c7){if(!_0x2b56c7){_0x4d31a6['sendStatus'](0x194);}return _0x2b56c7;};}function handleError(_0x150d5f,_0x43beac){_0x43beac=_0x43beac||0x1f4;return function(_0x5eb903){logger[_0xe661('0x31')](_0x5eb903['stack']);if(_0x5eb903['name']){delete _0x5eb903['name'];}_0x150d5f[_0xe661('0x21')](_0x43beac)[_0xe661('0x32')](_0x5eb903);};}exports[_0xe661('0x33')]=function(_0x6dff97,_0x5b316c){var _0xf2b601={},_0x659d49={},_0x226c69={'count':0x0,'rows':[]};var _0x1f506d=_[_0xe661('0x34')](db[_0xe661('0x35')][_0xe661('0x36')],function(_0x14c26a){return{'name':_0x14c26a['fieldName'],'type':_0x14c26a[_0xe661('0x37')][_0xe661('0x38')]};});_0x659d49[_0xe661('0x39')]=_[_0xe661('0x34')](_0x1f506d,'name');_0x659d49['query']=_[_0xe661('0x3a')](_0x6dff97[_0xe661('0x3b')]);_0x659d49[_0xe661('0x3c')]=_[_0xe661('0x3d')](_0x659d49['model'],_0x659d49[_0xe661('0x3b')]);_0xf2b601[_0xe661('0x3e')]=_[_0xe661('0x3d')](_0x659d49[_0xe661('0x39')],qs[_0xe661('0x3f')](_0x6dff97['query'][_0xe661('0x3f')]));_0xf2b601[_0xe661('0x3e')]=_0xf2b601['attributes'][_0xe661('0x40')]?_0xf2b601['attributes']:_0x659d49['model'];if(!_0x6dff97[_0xe661('0x3b')][_0xe661('0x41')]('nolimit')){_0xf2b601['limit']=qs[_0xe661('0x24')](_0x6dff97['query'][_0xe661('0x24')]);_0xf2b601[_0xe661('0x23')]=qs['offset'](_0x6dff97[_0xe661('0x3b')][_0xe661('0x23')]);}_0xf2b601[_0xe661('0x42')]=qs['sort'](_0x6dff97[_0xe661('0x3b')]['sort']);_0xf2b601[_0xe661('0x43')]=qs['filters'](_[_0xe661('0x44')](_0x6dff97[_0xe661('0x3b')],_0x659d49[_0xe661('0x3c')]),_0x1f506d);if(_0x6dff97[_0xe661('0x3b')][_0xe661('0x45')]){_0xf2b601['where']=_[_0xe661('0x46')](_0xf2b601['where'],{'$or':_[_0xe661('0x34')](_0x1f506d,function(_0x581396){if(_0x581396[_0xe661('0x37')]!==_0xe661('0x47')){var _0x28fcee={};_0x28fcee[_0x581396[_0xe661('0x48')]]={'$like':'%'+_0x6dff97['query'][_0xe661('0x45')]+'%'};return _0x28fcee;}})});}_0xf2b601=_[_0xe661('0x46')]({},_0xf2b601,_0x6dff97[_0xe661('0x49')]);var _0x2cc273={'where':_0xf2b601[_0xe661('0x43')]};return db[_0xe661('0x35')][_0xe661('0x26')](_0x2cc273)[_0xe661('0x2c')](function(_0x284741){_0x226c69[_0xe661('0x26')]=_0x284741;if(_0x6dff97[_0xe661('0x3b')]['includeAll']){_0xf2b601['include']=[{'all':!![]}];}return db[_0xe661('0x35')]['findAll'](_0xf2b601);})[_0xe661('0x2c')](function(_0x122903){_0x226c69[_0xe661('0x4a')]=_0x122903;return _0x226c69;})[_0xe661('0x2c')](respondWithFilteredResult(_0x5b316c,_0xf2b601))['catch'](handleError(_0x5b316c,null));};exports[_0xe661('0x4b')]=function(_0x3f6f82,_0x3df756){var _0x4c8ab8={'raw':!![],'where':{'id':_0x3f6f82[_0xe661('0x4c')]['id']}},_0x1666a2={};_0x1666a2[_0xe661('0x39')]=_[_0xe661('0x3a')](db[_0xe661('0x35')]['rawAttributes']);_0x1666a2[_0xe661('0x3b')]=_[_0xe661('0x3a')](_0x3f6f82[_0xe661('0x3b')]);_0x1666a2[_0xe661('0x3c')]=_[_0xe661('0x3d')](_0x1666a2[_0xe661('0x39')],_0x1666a2[_0xe661('0x3b')]);_0x4c8ab8[_0xe661('0x3e')]=_[_0xe661('0x3d')](_0x1666a2[_0xe661('0x39')],qs[_0xe661('0x3f')](_0x3f6f82[_0xe661('0x3b')][_0xe661('0x3f')]));_0x4c8ab8['attributes']=_0x4c8ab8['attributes']['length']?_0x4c8ab8[_0xe661('0x3e')]:_0x1666a2[_0xe661('0x39')];if(_0x3f6f82[_0xe661('0x3b')]['includeAll']){_0x4c8ab8[_0xe661('0x4d')]=[{'all':!![]}];}_0x4c8ab8=_[_0xe661('0x46')]({},_0x4c8ab8,_0x3f6f82[_0xe661('0x49')]);return db[_0xe661('0x35')][_0xe661('0x4e')](_0x4c8ab8)['then'](handleEntityNotFound(_0x3df756,null))[_0xe661('0x2c')](respondWithResult(_0x3df756,null))[_0xe661('0x4f')](handleError(_0x3df756,null));};exports[_0xe661('0x50')]=function(_0x3bdd35,_0x1c5976){return db['SmsQueue']['create'](_0x3bdd35[_0xe661('0x51')],{})[_0xe661('0x2c')](function(_0x53cecd){var _0x94347b=_0x3bdd35[_0xe661('0x52')][_0xe661('0x2e')]({'plain':!![]});if(!_0x94347b)throw new Error(_0xe661('0x53'));if(_0x94347b[_0xe661('0x54')]===_0xe661('0x52')){var _0x1c5ed2=_0x53cecd[_0xe661('0x2e')]({'plain':!![]});var _0x116577=_0xe661('0x2f');return db['UserProfileSection'][_0xe661('0x4e')]({'where':{'name':_0x116577,'userProfileId':_0x94347b[_0xe661('0x55')]},'raw':!![]})[_0xe661('0x2c')](function(_0x5f10cb){if(_0x5f10cb&&_0x5f10cb[_0xe661('0x56')]===0x0){return db['UserProfileResource'][_0xe661('0x50')]({'name':_0x1c5ed2[_0xe661('0x48')],'resourceId':_0x1c5ed2['id'],'type':_0x5f10cb[_0xe661('0x48')],'sectionId':_0x5f10cb['id']},{})[_0xe661('0x2c')](function(){return _0x53cecd;});}else{return _0x53cecd;}})[_0xe661('0x4f')](function(_0x567491){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x567491);throw _0x567491;});}return _0x53cecd;})[_0xe661('0x2c')](respondWithResult(_0x1c5976,0xc9))[_0xe661('0x4f')](handleError(_0x1c5976,null));};exports[_0xe661('0x2b')]=function(_0x3fa88f,_0x2c7ef8){if(_0x3fa88f[_0xe661('0x51')]['id']){delete _0x3fa88f[_0xe661('0x51')]['id'];}return db[_0xe661('0x35')][_0xe661('0x4e')]({'where':{'id':_0x3fa88f[_0xe661('0x4c')]['id']}})[_0xe661('0x2c')](handleEntityNotFound(_0x2c7ef8,null))[_0xe661('0x2c')](saveUpdates(_0x3fa88f[_0xe661('0x51')],null))[_0xe661('0x2c')](respondWithResult(_0x2c7ef8,null))[_0xe661('0x4f')](handleError(_0x2c7ef8,null));};exports[_0xe661('0x2d')]=function(_0xd4156e,_0x58ecda){return db[_0xe661('0x35')][_0xe661('0x4e')]({'where':{'id':_0xd4156e[_0xe661('0x4c')]['id']}})[_0xe661('0x2c')](handleEntityNotFound(_0x58ecda,null))[_0xe661('0x2c')](removeEntity(_0x58ecda,null))[_0xe661('0x4f')](handleError(_0x58ecda,null));};exports[_0xe661('0x57')]=function(_0x378c7b,_0x563f98){return db[_0xe661('0x35')][_0xe661('0x57')]()['then'](respondWithResult(_0x563f98,null))[_0xe661('0x4f')](handleError(_0x563f98,null));};exports[_0xe661('0x58')]=function(_0x115862,_0x4c9ebe,_0x54b78a){var _0x197223={'raw':!![],'where':{}},_0xeabd1b={},_0x12d0c2;return db[_0xe661('0x35')][_0xe661('0x59')]({'where':{'id':_0x115862[_0xe661('0x4c')]['id']}})[_0xe661('0x2c')](handleEntityNotFound(_0x4c9ebe,null))['then'](function(_0xa1faea){if(_0xa1faea){_0x12d0c2=_0xa1faea[_0xe661('0x2e')]({'plain':!![]});_0xeabd1b[_0xe661('0x39')]=_[_0xe661('0x3a')](db[_0xe661('0x5a')][_0xe661('0x36')]);_0xeabd1b[_0xe661('0x3b')]=_[_0xe661('0x3a')](_0x115862[_0xe661('0x3b')]);_0xeabd1b[_0xe661('0x3c')]=_[_0xe661('0x3d')](_0xeabd1b[_0xe661('0x39')],_0xeabd1b[_0xe661('0x3b')]);_0x197223['attributes']=_[_0xe661('0x3d')](_0xeabd1b[_0xe661('0x39')],qs[_0xe661('0x3f')](_0x115862[_0xe661('0x3b')]['fields']));_0x197223[_0xe661('0x3e')]=_0x197223['attributes'][_0xe661('0x40')]?_0x197223[_0xe661('0x3e')]:_0xeabd1b['model'];if(!_0x115862['query']['hasOwnProperty'](_0xe661('0x5b'))){_0x197223[_0xe661('0x24')]=qs[_0xe661('0x24')](_0x115862[_0xe661('0x3b')]['limit']);_0x197223[_0xe661('0x23')]=qs[_0xe661('0x23')](_0x115862[_0xe661('0x3b')][_0xe661('0x23')]);}_0x197223[_0xe661('0x42')]=qs[_0xe661('0x5c')](_0x115862['query'][_0xe661('0x5c')]);_0x197223[_0xe661('0x43')]=qs['filters'](_['pick'](_0x115862[_0xe661('0x3b')],_0xeabd1b[_0xe661('0x3c')]));_0x197223['where'][_0xe661('0x5d')]=_0xa1faea['id'];if(_0x115862[_0xe661('0x3b')][_0xe661('0x45')]){_0x197223[_0xe661('0x43')]=_[_0xe661('0x46')](_0x197223[_0xe661('0x43')],{'$or':_['map'](_0x197223[_0xe661('0x3e')],function(_0x5a7f32){var _0x6ef4aa={};_0x6ef4aa[_0x5a7f32]={'$like':'%'+_0x115862[_0xe661('0x3b')][_0xe661('0x45')]+'%'};return _0x6ef4aa;})});}_0x197223=_[_0xe661('0x46')]({},_0x197223,_0x115862[_0xe661('0x49')]);return db[_0xe661('0x5a')][_0xe661('0x5e')](_0x197223);}})['then'](function(_0xc83805){if(_0xc83805){return db[_0xe661('0x5f')][_0xe661('0x60')]({'where':{'id':_[_0xe661('0x34')](_0xc83805,'UserId'),'role':_0xe661('0x61')},'attributes':['id',_0xe661('0x48'),_0xe661('0x62'),_0xe661('0x63'),_0xe661('0x64')]});}})[_0xe661('0x2c')](function(_0x16a5f8){if(_0x16a5f8){return{'count':_0x16a5f8['count'],'rows':_[_0xe661('0x34')](_0x16a5f8[_0xe661('0x4a')],function(_0x566283){return{'membername':_0x566283[_0xe661('0x48')],'UserId':_0x566283['id'],'queue_name':_0x12d0c2['name'],'SmsQueueId':_0x12d0c2['id'],'interface':util['format'](_0xe661('0x65'),'SIP',_0x566283[_0xe661('0x48')]),'penalty':0x0,'paused':_0x566283[_0xe661('0x62')],'createdAt':_0x566283['createdAt'],'updatedAt':_0x566283[_0xe661('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe661('0x2c')](respondWithFilteredResult(_0x4c9ebe,_0x197223))['catch'](handleError(_0x4c9ebe,null));};exports[_0xe661('0x66')]=function(_0x25a0f7,_0x550777,_0x1bc2f5){var _0x1277a3={};var _0x1ba9d4={};var _0xbbc9c7;var _0x6c627c;return db['SmsQueue'][_0xe661('0x59')]({'where':{'id':_0x25a0f7[_0xe661('0x4c')]['id']}})['then'](handleEntityNotFound(_0x550777,null))[_0xe661('0x2c')](function(_0x18c963){if(_0x18c963){_0xbbc9c7=_0x18c963;_0x1ba9d4['model']=_[_0xe661('0x3a')](db[_0xe661('0x67')]['rawAttributes']);_0x1ba9d4[_0xe661('0x3b')]=_[_0xe661('0x3a')](_0x25a0f7[_0xe661('0x3b')]);_0x1ba9d4['filters']=_['intersection'](_0x1ba9d4['model'],_0x1ba9d4[_0xe661('0x3b')]);_0x1277a3[_0xe661('0x3e')]=_[_0xe661('0x3d')](_0x1ba9d4[_0xe661('0x39')],qs[_0xe661('0x3f')](_0x25a0f7[_0xe661('0x3b')][_0xe661('0x3f')]));_0x1277a3[_0xe661('0x3e')]=_0x1277a3['attributes'][_0xe661('0x40')]?_0x1277a3[_0xe661('0x3e')]:_0x1ba9d4['model'];_0x1277a3[_0xe661('0x42')]=qs['sort'](_0x25a0f7[_0xe661('0x3b')][_0xe661('0x5c')]);_0x1277a3[_0xe661('0x43')]=qs[_0xe661('0x3c')](_['pick'](_0x25a0f7[_0xe661('0x3b')],_0x1ba9d4[_0xe661('0x3c')]));if(_0x25a0f7[_0xe661('0x3b')]['filter']){_0x1277a3['where']=_[_0xe661('0x46')](_0x1277a3[_0xe661('0x43')],{'$or':_[_0xe661('0x34')](_0x1277a3[_0xe661('0x3e')],function(_0x3c4368){var _0xbc8316={};_0xbc8316[_0x3c4368]={'$like':'%'+_0x25a0f7[_0xe661('0x3b')][_0xe661('0x45')]+'%'};return _0xbc8316;})});}_0x1277a3=_[_0xe661('0x46')]({},_0x1277a3,_0x25a0f7['options']);return _0xbbc9c7[_0xe661('0x66')](_0x1277a3);}})[_0xe661('0x2c')](function(_0x36f926){if(_0x36f926){_0x6c627c=_0x36f926[_0xe661('0x40')];if(!_0x25a0f7[_0xe661('0x3b')][_0xe661('0x41')](_0xe661('0x5b'))){_0x1277a3[_0xe661('0x24')]=qs[_0xe661('0x24')](_0x25a0f7[_0xe661('0x3b')][_0xe661('0x24')]);_0x1277a3['offset']=qs[_0xe661('0x23')](_0x25a0f7[_0xe661('0x3b')]['offset']);}return _0xbbc9c7[_0xe661('0x66')](_0x1277a3);}})[_0xe661('0x2c')](function(_0x2949aa){if(_0x2949aa){return _0x2949aa?{'count':_0x6c627c,'rows':_0x2949aa}:null;}})[_0xe661('0x2c')](respondWithResult(_0x550777,null))[_0xe661('0x4f')](handleError(_0x550777,null));};exports['addTeams']=function(_0x419d06,_0x572c74,_0x2db685){var _0x3923ae=_0x419d06[_0xe661('0x51')][_0xe661('0x68')];return db['Team'][_0xe661('0x5e')]({'where':{'id':_0x3923ae},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe661('0x69'),'attributes':['id',_0xe661('0x48'),_0xe661('0x6a'),_0xe661('0x6b'),_0xe661('0x6c')],'raw':!![]}]})[_0xe661('0x2c')](function(_0x8a16c0){if(_0x8a16c0){var _0x48a76d=_[_0xe661('0x6d')](_0x8a16c0,function(_0x12268d){var _0x461123=_0x12268d[_0xe661('0x2e')]({'plain':!![]});return _0x461123[_0xe661('0x69')];});return db[_0xe661('0x35')][_0xe661('0x4e')]({'where':{'id':_0x419d06['params']['id']}})[_0xe661('0x2c')](function(_0x493c2f){return db[_0xe661('0x6e')]['transaction'](function(_0x4b8187){return _0x493c2f[_0xe661('0x6f')](_0x3923ae,{'transaction':_0x4b8187})[_0xe661('0x2c')](function(){return BPromise['each'](_0x48a76d,function(_0x4caa76){return db[_0xe661('0x5a')]['findOrCreate']({'where':{'UserId':_0x4caa76['id'],'SmsQueueId':_0x419d06[_0xe661('0x4c')]['id']},'transaction':_0x4b8187});});})['then'](function(){_0x48a76d[_0xe661('0x70')](function(_0x591bb9){socket[_0xe661('0x71')](_0xe661('0x72'),{'UserId':_0x591bb9['id'],'SmsQueueId':_0x493c2f['id']});});});});});}})[_0xe661('0x2c')](respondWithStatusCode(_0x572c74,null))[_0xe661('0x4f')](handleError(_0x572c74,null));};exports[_0xe661('0x73')]=function(_0x4d3a97,_0x4c0444,_0x210412){return db[_0xe661('0x67')][_0xe661('0x5e')]({'where':{'id':_0x4d3a97[_0xe661('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe661('0x5f')],'as':_0xe661('0x69'),'attributes':['id'],'raw':!![]}]})[_0xe661('0x2c')](handleEntityNotFound(_0x4c0444,null))['then'](function(_0x34dfad){var _0x291dcf=_[_0xe661('0x34')](_0x34dfad,'id');var _0x1210ea=[];var _0x433536=[];var _0x417f57=squel[_0xe661('0x74')]();_0x417f57[_0xe661('0x75')]('tq.TeamId')['from'](_0xe661('0x76'),'tq')['join'](_0xe661('0x77'),'ut',_0xe661('0x78'))[_0xe661('0x43')](_0xe661('0x79'),_0x4d3a97[_0xe661('0x4c')]['id']);for(var _0x4dca67=0x0;_0x4dca67<_0x34dfad[_0xe661('0x40')];_0x4dca67+=0x1){let _0x2a1b47=_0x34dfad[_0x4dca67];for(var _0x3d5a10=0x0;_0x3d5a10<_0x2a1b47[_0xe661('0x69')][_0xe661('0x40')];_0x3d5a10+=0x1){let _0x4a16d5=_0x2a1b47[_0xe661('0x69')][_0x3d5a10];var _0x4b09e5=_0x417f57[_0xe661('0x7a')]();_0x4b09e5[_0xe661('0x43')](_0xe661('0x7b'),_0x4a16d5['id']);_0x433536[_0xe661('0x7c')](db[_0xe661('0x6e')]['query'](_0x4b09e5[_0xe661('0x7d')](),{'type':db[_0xe661('0x6e')]['QueryTypes'][_0xe661('0x7e')]})['then'](function(_0x13adeb){if(_0x13adeb[_0xe661('0x40')]===0x1){return _0x4a16d5['id'];}else{var _0x54a18b=_[_0xe661('0x7f')](_[_0xe661('0x34')](_0x13adeb,_0xe661('0x80')),function(_0x744fcf){return _['includes'](_0x291dcf,_0x744fcf);});if(_0x54a18b){return _0x4a16d5['id'];}}}));}}return BPromise['all'](_0x433536)['then'](function(_0x5c7f27){_0x1210ea=_(_0x1210ea)[_0xe661('0x81')](_0x5c7f27)[_0xe661('0x82')]()[_0xe661('0x83')]();return db[_0xe661('0x35')][_0xe661('0x4e')]({'where':{'id':_0x4d3a97['params']['id']}})[_0xe661('0x2c')](function(_0x98816f){return db[_0xe661('0x6e')]['transaction'](function(_0x52c6ec){return _0x98816f[_0xe661('0x73')](_0x4d3a97[_0xe661('0x3b')][_0xe661('0x68')],{'transaction':_0x52c6ec})[_0xe661('0x2c')](function(){if(!_[_0xe661('0x84')](_0x1210ea)){return _0x98816f['removeAgents'](_0x1210ea,{'transaction':_0x52c6ec});}})['then'](function(){_0x1210ea['forEach'](function(_0x1eabf7){socket[_0xe661('0x71')](_0xe661('0x85'),{'UserId':_0x1eabf7,'SmsQueueId':_0x98816f['id']});});});});});});})[_0xe661('0x2c')](respondWithStatusCode(_0x4c0444,null))[_0xe661('0x4f')](handleError(_0x4c0444,null));};exports[_0xe661('0x86')]=function(_0x46fcce,_0x39aa4e,_0x571faf){return db[_0xe661('0x35')]['find']({'where':{'id':_0x46fcce['params']['id']}})['then'](handleEntityNotFound(_0x39aa4e,null))[_0xe661('0x2c')](function(_0x154352){if(_0x154352){return _0x154352['addAgents'](_0x46fcce[_0xe661('0x51')]['ids'],_[_0xe661('0x87')](_0x46fcce['body'],[_0xe661('0x68'),'id'])||{})[_0xe661('0x88')](function(_0x2f3da3){for(var _0x4f9485=0x0;_0x4f9485<_0x46fcce['body'][_0xe661('0x68')][_0xe661('0x40')];_0x4f9485+=0x1){socket['emit'](_0xe661('0x72'),{'UserId':Number(_0x46fcce[_0xe661('0x51')]['ids'][_0x4f9485]),'SmsQueueId':Number(_0x46fcce[_0xe661('0x4c')]['id'])});}return _0x2f3da3;});}})[_0xe661('0x2c')](respondWithResult(_0x39aa4e,null))[_0xe661('0x4f')](handleError(_0x39aa4e,null));};exports[_0xe661('0x89')]=function(_0x5280ef,_0xca72bc,_0x4eef55){return db[_0xe661('0x35')][_0xe661('0x4e')]({'where':{'id':_0x5280ef['params']['id']}})[_0xe661('0x2c')](handleEntityNotFound(_0xca72bc,null))['then'](function(_0x327d66){if(_0x327d66){return _0x327d66[_0xe661('0x89')](_0x5280ef[_0xe661('0x3b')]['ids'])[_0xe661('0x2c')](function(){if(_[_0xe661('0x8a')](_0x5280ef['query']['ids'])){for(var _0x55e9f0=0x0;_0x55e9f0<_0x5280ef[_0xe661('0x3b')][_0xe661('0x68')][_0xe661('0x40')];_0x55e9f0+=0x1){socket[_0xe661('0x71')](_0xe661('0x85'),{'UserId':Number(_0x5280ef[_0xe661('0x3b')][_0xe661('0x68')][_0x55e9f0]),'SmsQueueId':Number(_0x5280ef[_0xe661('0x4c')]['id'])});}}else{socket[_0xe661('0x71')](_0xe661('0x85'),{'UserId':Number(_0x5280ef['query'][_0xe661('0x68')]),'SmsQueueId':Number(_0x5280ef[_0xe661('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0xca72bc,null))[_0xe661('0x4f')](handleError(_0xca72bc,null));};exports[_0xe661('0x8b')]=function(_0x1ead10,_0x5a0850,_0x75ed5f){var _0xf11849={};var _0x551e20={};var _0x525531;var _0x26a86e;return db[_0xe661('0x35')][_0xe661('0x59')]({'where':{'id':_0x1ead10[_0xe661('0x4c')]['id']}})[_0xe661('0x2c')](handleEntityNotFound(_0x5a0850,null))['then'](function(_0x36b408){if(_0x36b408){_0x525531=_0x36b408;_0x551e20[_0xe661('0x39')]=_[_0xe661('0x3a')](db['User'][_0xe661('0x36')]);_0x551e20[_0xe661('0x3b')]=_[_0xe661('0x3a')](_0x1ead10[_0xe661('0x3b')]);_0x551e20[_0xe661('0x3c')]=_[_0xe661('0x3d')](_0x551e20[_0xe661('0x39')],_0x551e20[_0xe661('0x3b')]);_0xf11849[_0xe661('0x3e')]=_['intersection'](_0x551e20[_0xe661('0x39')],qs['fields'](_0x1ead10[_0xe661('0x3b')][_0xe661('0x3f')]));_0xf11849['attributes']=_0xf11849['attributes']['length']?_0xf11849[_0xe661('0x3e')]:_0x551e20['model'];_0xf11849[_0xe661('0x42')]=qs[_0xe661('0x5c')](_0x1ead10[_0xe661('0x3b')][_0xe661('0x5c')]);_0xf11849['where']=qs[_0xe661('0x3c')](_[_0xe661('0x44')](_0x1ead10[_0xe661('0x3b')],_0x551e20[_0xe661('0x3c')]));if(_0x1ead10[_0xe661('0x3b')][_0xe661('0x45')]){_0xf11849[_0xe661('0x43')]=_[_0xe661('0x46')](_0xf11849[_0xe661('0x43')],{'$or':_[_0xe661('0x34')](_0xf11849[_0xe661('0x3e')],function(_0x163f5d){var _0x2ef842={};_0x2ef842[_0x163f5d]={'$like':'%'+_0x1ead10[_0xe661('0x3b')][_0xe661('0x45')]+'%'};return _0x2ef842;})});}_0xf11849=_[_0xe661('0x46')]({},_0xf11849,_0x1ead10[_0xe661('0x49')]);return _0x525531[_0xe661('0x8b')](_0xf11849);}})[_0xe661('0x2c')](function(_0x18b4dc){if(_0x18b4dc){_0x26a86e=_0x18b4dc[_0xe661('0x40')];if(!_0x1ead10[_0xe661('0x3b')][_0xe661('0x41')](_0xe661('0x5b'))){_0xf11849['limit']=qs[_0xe661('0x24')](_0x1ead10['query'][_0xe661('0x24')]);_0xf11849[_0xe661('0x23')]=qs[_0xe661('0x23')](_0x1ead10[_0xe661('0x3b')][_0xe661('0x23')]);}return _0x525531['getAgents'](_0xf11849);}})[_0xe661('0x2c')](function(_0x4d5c5d){if(_0x4d5c5d){return _0x4d5c5d?{'count':_0x26a86e,'rows':_0x4d5c5d}:null;}})[_0xe661('0x2c')](respondWithResult(_0x5a0850,null))[_0xe661('0x4f')](handleError(_0x5a0850,null));}; \ No newline at end of file +var _0xc0a7=['UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','pick','where','filter','merge','options','includeAll','include','SmsQueue','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','sort','SmsQueueId','User','findAndCountAll','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','hasOwnProperty','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','SmsQueues'];(function(_0x252620,_0x3d76b9){var _0x538f61=function(_0x4cbc6f){while(--_0x4cbc6f){_0x252620['push'](_0x252620['shift']());}};_0x538f61(++_0x3d76b9);}(_0xc0a7,0xee));var _0x7c0a=function(_0x530b18,_0x319614){_0x530b18=_0x530b18-0x0;var _0x2f305e=_0xc0a7[_0x530b18];return _0x2f305e;};'use strict';var emlformat=require(_0x7c0a('0x0'));var rimraf=require(_0x7c0a('0x1'));var zipdir=require(_0x7c0a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c0a('0x3'));var moment=require(_0x7c0a('0x4'));var BPromise=require(_0x7c0a('0x5'));var Mustache=require(_0x7c0a('0x6'));var util=require('util');var path=require(_0x7c0a('0x7'));var sox=require(_0x7c0a('0x8'));var csv=require(_0x7c0a('0x9'));var ejs=require(_0x7c0a('0xa'));var fs=require('fs');var fs_extra=require(_0x7c0a('0xb'));var _=require(_0x7c0a('0xc'));var squel=require(_0x7c0a('0xd'));var crypto=require(_0x7c0a('0xe'));var jsforce=require(_0x7c0a('0xf'));var deskjs=require(_0x7c0a('0x10'));var toCsv=require(_0x7c0a('0x9'));var querystring=require(_0x7c0a('0x11'));var Papa=require(_0x7c0a('0x12'));var Redis=require('ioredis');var authService=require(_0x7c0a('0x13'));var qs=require(_0x7c0a('0x14'));var as=require(_0x7c0a('0x15'));var hardwareService=require(_0x7c0a('0x16'));var logger=require(_0x7c0a('0x17'))(_0x7c0a('0x18'));var utils=require(_0x7c0a('0x19'));var config=require(_0x7c0a('0x1a'));var licenseUtil=require(_0x7c0a('0x1b'));var db=require(_0x7c0a('0x1c'))['db'];config[_0x7c0a('0x1d')]=_[_0x7c0a('0x1e')](config[_0x7c0a('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c0a('0x1d')]));require('./smsQueue.socket')[_0x7c0a('0x1f')](socket);function respondWithStatusCode(_0x255911,_0x80b70e){_0x80b70e=_0x80b70e||0xcc;return function(_0x119594){if(_0x119594){return _0x255911[_0x7c0a('0x20')](_0x80b70e);}return _0x255911['status'](_0x80b70e)[_0x7c0a('0x21')]();};}function respondWithResult(_0x7828fb,_0xcb7e63){_0xcb7e63=_0xcb7e63||0xc8;return function(_0x32032c){if(_0x32032c){return _0x7828fb[_0x7c0a('0x22')](_0xcb7e63)[_0x7c0a('0x23')](_0x32032c);}};}function respondWithFilteredResult(_0x52aa9e,_0x534962){return function(_0x1ecb2a){if(_0x1ecb2a){var _0x46cafb=typeof _0x534962[_0x7c0a('0x24')]===_0x7c0a('0x25')&&typeof _0x534962[_0x7c0a('0x26')]==='undefined';var _0x1d6427=_0x1ecb2a[_0x7c0a('0x27')];var _0x546ac8=_0x46cafb?0x0:_0x534962[_0x7c0a('0x24')];var _0x53da9f=_0x46cafb?_0x1ecb2a['count']:_0x534962[_0x7c0a('0x24')]+_0x534962['limit'];var _0x3ecf07;if(_0x53da9f>=_0x1d6427){_0x53da9f=_0x1d6427;_0x3ecf07=0xc8;}else{_0x3ecf07=0xce;}_0x52aa9e['status'](_0x3ecf07);return _0x52aa9e[_0x7c0a('0x28')](_0x7c0a('0x29'),_0x546ac8+'-'+_0x53da9f+'/'+_0x1d6427)[_0x7c0a('0x23')](_0x1ecb2a);}return null;};}function patchUpdates(_0xa9c1b6){return function(_0x5632f3){try{jsonpatch[_0x7c0a('0x2a')](_0x5632f3,_0xa9c1b6,!![]);}catch(_0x51e810){return BPromise['reject'](_0x51e810);}return _0x5632f3['save']();};}function saveUpdates(_0x588544,_0x1eaea9){return function(_0x127ac4){if(_0x127ac4){return _0x127ac4[_0x7c0a('0x2b')](_0x588544)[_0x7c0a('0x2c')](function(_0x3ddbe0){return _0x3ddbe0;});}return null;};}function removeEntity(_0x15bc46,_0x4bfa38){return function(_0x1fd876){if(_0x1fd876){return _0x1fd876[_0x7c0a('0x2d')]()[_0x7c0a('0x2c')](function(){var _0x247fed=_0x1fd876[_0x7c0a('0x2e')]({'plain':!![]});var _0x961dcd=_0x7c0a('0x2f');return db[_0x7c0a('0x30')][_0x7c0a('0x2d')]({'where':{'type':_0x961dcd,'resourceId':_0x247fed['id']}})[_0x7c0a('0x2c')](function(){return _0x1fd876;});})[_0x7c0a('0x2c')](function(){_0x15bc46['status'](0xcc)[_0x7c0a('0x21')]();});}};}function handleEntityNotFound(_0x351af1,_0x304fde){return function(_0x55aacf){if(!_0x55aacf){_0x351af1['sendStatus'](0x194);}return _0x55aacf;};}function handleError(_0x4d2360,_0x5e04cb){_0x5e04cb=_0x5e04cb||0x1f4;return function(_0x4d5f98){logger[_0x7c0a('0x31')](_0x4d5f98[_0x7c0a('0x32')]);if(_0x4d5f98[_0x7c0a('0x33')]){delete _0x4d5f98[_0x7c0a('0x33')];}_0x4d2360[_0x7c0a('0x22')](_0x5e04cb)[_0x7c0a('0x34')](_0x4d5f98);};}exports['index']=function(_0x332dcb,_0x22de87){var _0x484145={},_0x4d03d8={},_0x1d1ce7={'count':0x0,'rows':[]};var _0x20d144=_[_0x7c0a('0x35')](db['SmsQueue'][_0x7c0a('0x36')],function(_0x506a7a){return{'name':_0x506a7a[_0x7c0a('0x37')],'type':_0x506a7a[_0x7c0a('0x38')][_0x7c0a('0x39')]};});_0x4d03d8[_0x7c0a('0x3a')]=_[_0x7c0a('0x35')](_0x20d144,_0x7c0a('0x33'));_0x4d03d8['query']=_[_0x7c0a('0x3b')](_0x332dcb[_0x7c0a('0x3c')]);_0x4d03d8[_0x7c0a('0x3d')]=_[_0x7c0a('0x3e')](_0x4d03d8['model'],_0x4d03d8[_0x7c0a('0x3c')]);_0x484145['attributes']=_[_0x7c0a('0x3e')](_0x4d03d8['model'],qs['fields'](_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x484145[_0x7c0a('0x40')]=_0x484145[_0x7c0a('0x40')]['length']?_0x484145['attributes']:_0x4d03d8[_0x7c0a('0x3a')];if(!_0x332dcb['query']['hasOwnProperty'](_0x7c0a('0x41'))){_0x484145[_0x7c0a('0x26')]=qs[_0x7c0a('0x26')](_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x26')]);_0x484145[_0x7c0a('0x24')]=qs[_0x7c0a('0x24')](_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x24')]);}_0x484145[_0x7c0a('0x42')]=qs['sort'](_0x332dcb[_0x7c0a('0x3c')]['sort']);_0x484145['where']=qs[_0x7c0a('0x3d')](_[_0x7c0a('0x43')](_0x332dcb[_0x7c0a('0x3c')],_0x4d03d8[_0x7c0a('0x3d')]),_0x20d144);if(_0x332dcb[_0x7c0a('0x3c')]['filter']){_0x484145[_0x7c0a('0x44')]=_['merge'](_0x484145[_0x7c0a('0x44')],{'$or':_[_0x7c0a('0x35')](_0x20d144,function(_0xeedde5){if(_0xeedde5[_0x7c0a('0x38')]!=='VIRTUAL'){var _0x24d6fc={};_0x24d6fc[_0xeedde5[_0x7c0a('0x33')]]={'$like':'%'+_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x24d6fc;}})});}_0x484145=_[_0x7c0a('0x46')]({},_0x484145,_0x332dcb[_0x7c0a('0x47')]);var _0x765253={'where':_0x484145[_0x7c0a('0x44')]};return db['SmsQueue'][_0x7c0a('0x27')](_0x765253)[_0x7c0a('0x2c')](function(_0x233896){_0x1d1ce7[_0x7c0a('0x27')]=_0x233896;if(_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x48')]){_0x484145[_0x7c0a('0x49')]=[{'all':!![]}];}return db[_0x7c0a('0x4a')][_0x7c0a('0x4b')](_0x484145);})[_0x7c0a('0x2c')](function(_0x34fb49){_0x1d1ce7[_0x7c0a('0x4c')]=_0x34fb49;return _0x1d1ce7;})[_0x7c0a('0x2c')](respondWithFilteredResult(_0x22de87,_0x484145))[_0x7c0a('0x4d')](handleError(_0x22de87,null));};exports[_0x7c0a('0x4e')]=function(_0x384db7,_0x544b4d){var _0x32eb63={'raw':!![],'where':{'id':_0x384db7[_0x7c0a('0x4f')]['id']}},_0x14f66c={};_0x14f66c[_0x7c0a('0x3a')]=_[_0x7c0a('0x3b')](db['SmsQueue'][_0x7c0a('0x36')]);_0x14f66c[_0x7c0a('0x3c')]=_['keys'](_0x384db7[_0x7c0a('0x3c')]);_0x14f66c['filters']=_['intersection'](_0x14f66c[_0x7c0a('0x3a')],_0x14f66c['query']);_0x32eb63[_0x7c0a('0x40')]=_['intersection'](_0x14f66c[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0x384db7[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x32eb63[_0x7c0a('0x40')]=_0x32eb63['attributes'][_0x7c0a('0x50')]?_0x32eb63['attributes']:_0x14f66c['model'];if(_0x384db7[_0x7c0a('0x3c')]['includeAll']){_0x32eb63['include']=[{'all':!![]}];}_0x32eb63=_[_0x7c0a('0x46')]({},_0x32eb63,_0x384db7[_0x7c0a('0x47')]);return db[_0x7c0a('0x4a')][_0x7c0a('0x51')](_0x32eb63)[_0x7c0a('0x2c')](handleEntityNotFound(_0x544b4d,null))['then'](respondWithResult(_0x544b4d,null))[_0x7c0a('0x4d')](handleError(_0x544b4d,null));};exports[_0x7c0a('0x52')]=function(_0x4d2d4e,_0x55f68c){return db[_0x7c0a('0x4a')]['create'](_0x4d2d4e[_0x7c0a('0x53')],{})['then'](function(_0x2b64e9){var _0x599d80=_0x4d2d4e[_0x7c0a('0x54')][_0x7c0a('0x2e')]({'plain':!![]});if(!_0x599d80)throw new Error(_0x7c0a('0x55'));if(_0x599d80[_0x7c0a('0x56')]===_0x7c0a('0x54')){var _0x4231f2=_0x2b64e9[_0x7c0a('0x2e')]({'plain':!![]});var _0x3dfc08=_0x7c0a('0x2f');return db[_0x7c0a('0x57')][_0x7c0a('0x51')]({'where':{'name':_0x3dfc08,'userProfileId':_0x599d80['userProfileId']},'raw':!![]})['then'](function(_0x39f358){if(_0x39f358&&_0x39f358['autoAssociation']===0x0){return db['UserProfileResource'][_0x7c0a('0x52')]({'name':_0x4231f2[_0x7c0a('0x33')],'resourceId':_0x4231f2['id'],'type':_0x39f358[_0x7c0a('0x33')],'sectionId':_0x39f358['id']},{})['then'](function(){return _0x2b64e9;});}else{return _0x2b64e9;}})[_0x7c0a('0x4d')](function(_0x63570b){logger[_0x7c0a('0x31')](_0x7c0a('0x58'),_0x63570b);throw _0x63570b;});}return _0x2b64e9;})[_0x7c0a('0x2c')](respondWithResult(_0x55f68c,0xc9))[_0x7c0a('0x4d')](handleError(_0x55f68c,null));};exports['update']=function(_0x539d42,_0x2071a5){if(_0x539d42[_0x7c0a('0x53')]['id']){delete _0x539d42['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x539d42[_0x7c0a('0x4f')]['id']}})[_0x7c0a('0x2c')](handleEntityNotFound(_0x2071a5,null))['then'](saveUpdates(_0x539d42[_0x7c0a('0x53')],null))[_0x7c0a('0x2c')](respondWithResult(_0x2071a5,null))['catch'](handleError(_0x2071a5,null));};exports[_0x7c0a('0x2d')]=function(_0x12b5af,_0x43e23b){return db['SmsQueue'][_0x7c0a('0x51')]({'where':{'id':_0x12b5af[_0x7c0a('0x4f')]['id']}})[_0x7c0a('0x2c')](handleEntityNotFound(_0x43e23b,null))['then'](removeEntity(_0x43e23b,null))[_0x7c0a('0x4d')](handleError(_0x43e23b,null));};exports['describe']=function(_0x3b92ae,_0xa82894){return db[_0x7c0a('0x4a')][_0x7c0a('0x59')]()[_0x7c0a('0x2c')](respondWithResult(_0xa82894,null))[_0x7c0a('0x4d')](handleError(_0xa82894,null));};exports[_0x7c0a('0x5a')]=function(_0xabbe3d,_0x23912f,_0x512778){var _0x182b53={'raw':!![],'where':{}},_0x296f62={},_0x26e720;return db['SmsQueue'][_0x7c0a('0x5b')]({'where':{'id':_0xabbe3d['params']['id']}})['then'](handleEntityNotFound(_0x23912f,null))['then'](function(_0x2f66f7){if(_0x2f66f7){_0x26e720=_0x2f66f7['get']({'plain':!![]});_0x296f62[_0x7c0a('0x3a')]=_['keys'](db[_0x7c0a('0x5c')][_0x7c0a('0x36')]);_0x296f62[_0x7c0a('0x3c')]=_[_0x7c0a('0x3b')](_0xabbe3d[_0x7c0a('0x3c')]);_0x296f62[_0x7c0a('0x3d')]=_['intersection'](_0x296f62[_0x7c0a('0x3a')],_0x296f62[_0x7c0a('0x3c')]);_0x182b53['attributes']=_[_0x7c0a('0x3e')](_0x296f62[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0xabbe3d[_0x7c0a('0x3c')]['fields']));_0x182b53['attributes']=_0x182b53[_0x7c0a('0x40')][_0x7c0a('0x50')]?_0x182b53[_0x7c0a('0x40')]:_0x296f62[_0x7c0a('0x3a')];if(!_0xabbe3d[_0x7c0a('0x3c')]['hasOwnProperty'](_0x7c0a('0x41'))){_0x182b53[_0x7c0a('0x26')]=qs['limit'](_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x26')]);_0x182b53[_0x7c0a('0x24')]=qs[_0x7c0a('0x24')](_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x24')]);}_0x182b53['order']=qs[_0x7c0a('0x5d')](_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x5d')]);_0x182b53[_0x7c0a('0x44')]=qs['filters'](_[_0x7c0a('0x43')](_0xabbe3d[_0x7c0a('0x3c')],_0x296f62[_0x7c0a('0x3d')]));_0x182b53[_0x7c0a('0x44')][_0x7c0a('0x5e')]=_0x2f66f7['id'];if(_0xabbe3d['query'][_0x7c0a('0x45')]){_0x182b53['where']=_[_0x7c0a('0x46')](_0x182b53[_0x7c0a('0x44')],{'$or':_[_0x7c0a('0x35')](_0x182b53[_0x7c0a('0x40')],function(_0x1a4bd6){var _0x2c8a46={};_0x2c8a46[_0x1a4bd6]={'$like':'%'+_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x2c8a46;})});}_0x182b53=_[_0x7c0a('0x46')]({},_0x182b53,_0xabbe3d['options']);return db[_0x7c0a('0x5c')][_0x7c0a('0x4b')](_0x182b53);}})[_0x7c0a('0x2c')](function(_0x33170b){if(_0x33170b){return db[_0x7c0a('0x5f')][_0x7c0a('0x60')]({'where':{'id':_[_0x7c0a('0x35')](_0x33170b,'UserId'),'role':'agent'},'attributes':['id',_0x7c0a('0x33'),_0x7c0a('0x61'),_0x7c0a('0x62'),'createdAt']});}})[_0x7c0a('0x2c')](function(_0x3765ac){if(_0x3765ac){return{'count':_0x3765ac[_0x7c0a('0x27')],'rows':_[_0x7c0a('0x35')](_0x3765ac[_0x7c0a('0x4c')],function(_0x135d18){return{'membername':_0x135d18[_0x7c0a('0x33')],'UserId':_0x135d18['id'],'queue_name':_0x26e720[_0x7c0a('0x33')],'SmsQueueId':_0x26e720['id'],'interface':util[_0x7c0a('0x63')](_0x7c0a('0x64'),_0x7c0a('0x65'),_0x135d18[_0x7c0a('0x33')]),'penalty':0x0,'paused':_0x135d18[_0x7c0a('0x61')],'createdAt':_0x135d18[_0x7c0a('0x66')],'updatedAt':_0x135d18[_0x7c0a('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c0a('0x2c')](respondWithFilteredResult(_0x23912f,_0x182b53))['catch'](handleError(_0x23912f,null));};exports[_0x7c0a('0x67')]=function(_0x4ca183,_0x68b58,_0x51677f){var _0x501d2f={};var _0x594739={};var _0x3ef210;var _0x44a6fa;return db[_0x7c0a('0x4a')][_0x7c0a('0x5b')]({'where':{'id':_0x4ca183[_0x7c0a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x68b58,null))[_0x7c0a('0x2c')](function(_0x125bcd){if(_0x125bcd){_0x3ef210=_0x125bcd;_0x594739[_0x7c0a('0x3a')]=_[_0x7c0a('0x3b')](db[_0x7c0a('0x68')][_0x7c0a('0x36')]);_0x594739[_0x7c0a('0x3c')]=_[_0x7c0a('0x3b')](_0x4ca183[_0x7c0a('0x3c')]);_0x594739[_0x7c0a('0x3d')]=_['intersection'](_0x594739['model'],_0x594739['query']);_0x501d2f[_0x7c0a('0x40')]=_[_0x7c0a('0x3e')](_0x594739[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x501d2f['attributes']=_0x501d2f[_0x7c0a('0x40')][_0x7c0a('0x50')]?_0x501d2f[_0x7c0a('0x40')]:_0x594739[_0x7c0a('0x3a')];_0x501d2f[_0x7c0a('0x42')]=qs['sort'](_0x4ca183['query']['sort']);_0x501d2f['where']=qs[_0x7c0a('0x3d')](_[_0x7c0a('0x43')](_0x4ca183[_0x7c0a('0x3c')],_0x594739[_0x7c0a('0x3d')]));if(_0x4ca183['query'][_0x7c0a('0x45')]){_0x501d2f['where']=_[_0x7c0a('0x46')](_0x501d2f['where'],{'$or':_['map'](_0x501d2f[_0x7c0a('0x40')],function(_0x4d908e){var _0x33a504={};_0x33a504[_0x4d908e]={'$like':'%'+_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x33a504;})});}_0x501d2f=_['merge']({},_0x501d2f,_0x4ca183[_0x7c0a('0x47')]);return _0x3ef210[_0x7c0a('0x67')](_0x501d2f);}})[_0x7c0a('0x2c')](function(_0x2b14f6){if(_0x2b14f6){_0x44a6fa=_0x2b14f6['length'];if(!_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x69')]('nolimit')){_0x501d2f['limit']=qs['limit'](_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x26')]);_0x501d2f[_0x7c0a('0x24')]=qs[_0x7c0a('0x24')](_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x24')]);}return _0x3ef210[_0x7c0a('0x67')](_0x501d2f);}})[_0x7c0a('0x2c')](function(_0x4e03a9){if(_0x4e03a9){return _0x4e03a9?{'count':_0x44a6fa,'rows':_0x4e03a9}:null;}})[_0x7c0a('0x2c')](respondWithResult(_0x68b58,null))['catch'](handleError(_0x68b58,null));};exports[_0x7c0a('0x6a')]=function(_0x56040,_0x2e83dc,_0x2a41fb){var _0x528930=_0x56040[_0x7c0a('0x53')][_0x7c0a('0x6b')];return db[_0x7c0a('0x68')][_0x7c0a('0x4b')]({'where':{'id':_0x528930},'attributes':['id'],'include':[{'model':db[_0x7c0a('0x5f')],'as':'Agents','attributes':['id',_0x7c0a('0x33'),'online',_0x7c0a('0x6c'),_0x7c0a('0x6d')],'raw':!![]}]})[_0x7c0a('0x2c')](function(_0x232d32){if(_0x232d32){var _0x3b16ce=_[_0x7c0a('0x6e')](_0x232d32,function(_0x3f353c){var _0x5bdc6f=_0x3f353c[_0x7c0a('0x2e')]({'plain':!![]});return _0x5bdc6f[_0x7c0a('0x6f')];});return db[_0x7c0a('0x4a')][_0x7c0a('0x51')]({'where':{'id':_0x56040['params']['id']}})['then'](function(_0x2b0f3e){return db['sequelize'][_0x7c0a('0x70')](function(_0xe5510b){return _0x2b0f3e[_0x7c0a('0x6a')](_0x528930,{'transaction':_0xe5510b})[_0x7c0a('0x2c')](function(){return BPromise[_0x7c0a('0x71')](_0x3b16ce,function(_0x278ef6){return db['UserSmsQueue'][_0x7c0a('0x72')]({'where':{'UserId':_0x278ef6['id'],'SmsQueueId':_0x56040[_0x7c0a('0x4f')]['id']},'transaction':_0xe5510b});});})[_0x7c0a('0x2c')](function(){_0x3b16ce[_0x7c0a('0x73')](function(_0x418403){socket[_0x7c0a('0x74')](_0x7c0a('0x75'),{'UserId':_0x418403['id'],'SmsQueueId':_0x2b0f3e['id']});});});});});}})[_0x7c0a('0x2c')](respondWithStatusCode(_0x2e83dc,null))[_0x7c0a('0x4d')](handleError(_0x2e83dc,null));};exports[_0x7c0a('0x76')]=function(_0x4ad83d,_0x3c6c11,_0x36e6b0){return db['Team'][_0x7c0a('0x4b')]({'where':{'id':_0x4ad83d[_0x7c0a('0x3c')][_0x7c0a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x7c0a('0x5f')],'as':_0x7c0a('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x7c0a('0x2c')](handleEntityNotFound(_0x3c6c11,null))['then'](function(_0x130dd6){var _0x2e56ad=_[_0x7c0a('0x35')](_0x130dd6,'id');var _0x8ac2b9=[];var _0x34587e=[];var _0x4ba03c=squel[_0x7c0a('0x77')]();_0x4ba03c['field'](_0x7c0a('0x78'))['from'](_0x7c0a('0x79'),'tq')[_0x7c0a('0x7a')](_0x7c0a('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7c0a('0x44')](_0x7c0a('0x7c'),_0x4ad83d[_0x7c0a('0x4f')]['id']);for(var _0x330031=0x0;_0x330031<_0x130dd6[_0x7c0a('0x50')];_0x330031+=0x1){let _0x1207c2=_0x130dd6[_0x330031];for(var _0x1b68f8=0x0;_0x1b68f8<_0x1207c2[_0x7c0a('0x6f')][_0x7c0a('0x50')];_0x1b68f8+=0x1){let _0x565246=_0x1207c2['Agents'][_0x1b68f8];var _0x28e061=_0x4ba03c[_0x7c0a('0x7d')]();_0x28e061['where'](_0x7c0a('0x7e'),_0x565246['id']);_0x34587e[_0x7c0a('0x7f')](db[_0x7c0a('0x80')][_0x7c0a('0x3c')](_0x28e061['toString'](),{'type':db[_0x7c0a('0x80')][_0x7c0a('0x81')][_0x7c0a('0x82')]})['then'](function(_0x3c337b){if(_0x3c337b['length']===0x1){return _0x565246['id'];}else{var _0x5acb84=_['every'](_[_0x7c0a('0x35')](_0x3c337b,_0x7c0a('0x83')),function(_0x3eb4e4){return _['includes'](_0x2e56ad,_0x3eb4e4);});if(_0x5acb84){return _0x565246['id'];}}}));}}return BPromise[_0x7c0a('0x84')](_0x34587e)[_0x7c0a('0x2c')](function(_0x5b5504){_0x8ac2b9=_(_0x8ac2b9)[_0x7c0a('0x85')](_0x5b5504)[_0x7c0a('0x86')]()['value']();return db[_0x7c0a('0x4a')][_0x7c0a('0x51')]({'where':{'id':_0x4ad83d['params']['id']}})['then'](function(_0x5bc4a3){return db['sequelize'][_0x7c0a('0x70')](function(_0x3c295d){return _0x5bc4a3[_0x7c0a('0x76')](_0x4ad83d[_0x7c0a('0x3c')][_0x7c0a('0x6b')],{'transaction':_0x3c295d})[_0x7c0a('0x2c')](function(){if(!_[_0x7c0a('0x87')](_0x8ac2b9)){return _0x5bc4a3[_0x7c0a('0x88')](_0x8ac2b9,{'transaction':_0x3c295d});}})[_0x7c0a('0x2c')](function(){_0x8ac2b9[_0x7c0a('0x73')](function(_0x3c02b9){socket[_0x7c0a('0x74')](_0x7c0a('0x89'),{'UserId':_0x3c02b9,'SmsQueueId':_0x5bc4a3['id']});});});});});});})['then'](respondWithStatusCode(_0x3c6c11,null))[_0x7c0a('0x4d')](handleError(_0x3c6c11,null));};exports[_0x7c0a('0x8a')]=function(_0x111894,_0x3fe5d6,_0x366272){return db['SmsQueue'][_0x7c0a('0x51')]({'where':{'id':_0x111894[_0x7c0a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3fe5d6,null))['then'](function(_0x3c488a){if(_0x3c488a){return _0x3c488a[_0x7c0a('0x8a')](_0x111894[_0x7c0a('0x53')][_0x7c0a('0x6b')],_[_0x7c0a('0x8b')](_0x111894[_0x7c0a('0x53')],[_0x7c0a('0x6b'),'id'])||{})[_0x7c0a('0x8c')](function(_0x29067a){for(var _0x1dd30f=0x0;_0x1dd30f<_0x111894[_0x7c0a('0x53')][_0x7c0a('0x6b')][_0x7c0a('0x50')];_0x1dd30f+=0x1){socket['emit'](_0x7c0a('0x75'),{'UserId':Number(_0x111894[_0x7c0a('0x53')]['ids'][_0x1dd30f]),'SmsQueueId':Number(_0x111894[_0x7c0a('0x4f')]['id'])});}return _0x29067a;});}})[_0x7c0a('0x2c')](respondWithResult(_0x3fe5d6,null))[_0x7c0a('0x4d')](handleError(_0x3fe5d6,null));};exports[_0x7c0a('0x88')]=function(_0x55ceac,_0x1e7f83,_0x531070){return db[_0x7c0a('0x4a')][_0x7c0a('0x51')]({'where':{'id':_0x55ceac[_0x7c0a('0x4f')]['id']}})[_0x7c0a('0x2c')](handleEntityNotFound(_0x1e7f83,null))[_0x7c0a('0x2c')](function(_0x2927d2){if(_0x2927d2){return _0x2927d2[_0x7c0a('0x88')](_0x55ceac[_0x7c0a('0x3c')][_0x7c0a('0x6b')])[_0x7c0a('0x2c')](function(){if(_[_0x7c0a('0x8d')](_0x55ceac[_0x7c0a('0x3c')]['ids'])){for(var _0x217901=0x0;_0x217901<_0x55ceac[_0x7c0a('0x3c')][_0x7c0a('0x6b')][_0x7c0a('0x50')];_0x217901+=0x1){socket[_0x7c0a('0x74')](_0x7c0a('0x89'),{'UserId':Number(_0x55ceac[_0x7c0a('0x3c')][_0x7c0a('0x6b')][_0x217901]),'SmsQueueId':Number(_0x55ceac[_0x7c0a('0x4f')]['id'])});}}else{socket['emit'](_0x7c0a('0x89'),{'UserId':Number(_0x55ceac['query'][_0x7c0a('0x6b')]),'SmsQueueId':Number(_0x55ceac[_0x7c0a('0x4f')]['id'])});}});}})[_0x7c0a('0x2c')](respondWithStatusCode(_0x1e7f83,null))['catch'](handleError(_0x1e7f83,null));};exports[_0x7c0a('0x8e')]=function(_0x36f536,_0x527dd9,_0x3abae9){var _0x126a3d={};var _0x236039={};var _0x343089;var _0x38816f;return db[_0x7c0a('0x4a')][_0x7c0a('0x5b')]({'where':{'id':_0x36f536['params']['id']}})['then'](handleEntityNotFound(_0x527dd9,null))[_0x7c0a('0x2c')](function(_0x55c505){if(_0x55c505){_0x343089=_0x55c505;_0x236039[_0x7c0a('0x3a')]=_[_0x7c0a('0x3b')](db[_0x7c0a('0x5f')][_0x7c0a('0x36')]);_0x236039[_0x7c0a('0x3c')]=_['keys'](_0x36f536[_0x7c0a('0x3c')]);_0x236039[_0x7c0a('0x3d')]=_[_0x7c0a('0x3e')](_0x236039[_0x7c0a('0x3a')],_0x236039[_0x7c0a('0x3c')]);_0x126a3d['attributes']=_[_0x7c0a('0x3e')](_0x236039[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x126a3d['attributes']=_0x126a3d['attributes'][_0x7c0a('0x50')]?_0x126a3d[_0x7c0a('0x40')]:_0x236039['model'];_0x126a3d[_0x7c0a('0x42')]=qs[_0x7c0a('0x5d')](_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x5d')]);_0x126a3d[_0x7c0a('0x44')]=qs['filters'](_[_0x7c0a('0x43')](_0x36f536[_0x7c0a('0x3c')],_0x236039[_0x7c0a('0x3d')]));if(_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x45')]){_0x126a3d[_0x7c0a('0x44')]=_[_0x7c0a('0x46')](_0x126a3d[_0x7c0a('0x44')],{'$or':_[_0x7c0a('0x35')](_0x126a3d[_0x7c0a('0x40')],function(_0x43bf7a){var _0x531eb8={};_0x531eb8[_0x43bf7a]={'$like':'%'+_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x531eb8;})});}_0x126a3d=_[_0x7c0a('0x46')]({},_0x126a3d,_0x36f536['options']);return _0x343089['getAgents'](_0x126a3d);}})[_0x7c0a('0x2c')](function(_0x56e2bb){if(_0x56e2bb){_0x38816f=_0x56e2bb[_0x7c0a('0x50')];if(!_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x69')](_0x7c0a('0x41'))){_0x126a3d[_0x7c0a('0x26')]=qs[_0x7c0a('0x26')](_0x36f536[_0x7c0a('0x3c')]['limit']);_0x126a3d['offset']=qs['offset'](_0x36f536['query'][_0x7c0a('0x24')]);}return _0x343089[_0x7c0a('0x8e')](_0x126a3d);}})[_0x7c0a('0x2c')](function(_0x422bd9){if(_0x422bd9){return _0x422bd9?{'count':_0x38816f,'rows':_0x422bd9}:null;}})[_0x7c0a('0x2c')](respondWithResult(_0x527dd9,null))['catch'](handleError(_0x527dd9,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9b8d98a..57d3c41 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 _0x24e3=['events','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2ddd6a,_0x35f85a){var _0x476962=function(_0x5c4b76){while(--_0x5c4b76){_0x2ddd6a['push'](_0x2ddd6a['shift']());}};_0x476962(++_0x35f85a);}(_0x24e3,0x168));var _0x324e=function(_0x41dbab,_0x1a343f){_0x41dbab=_0x41dbab-0x0;var _0x499930=_0x24e3[_0x41dbab];return _0x499930;};'use strict';var EventEmitter=require(_0x324e('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x324e('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x324e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x324e('0x3'),'afterDestroy':_0x324e('0x4')};function emitEvent(_0x54d939){return function(_0x5f1364,_0x1194b5,_0x1cfa39){SmsQueueEvents[_0x324e('0x5')](_0x54d939+':'+_0x5f1364['id'],_0x5f1364);SmsQueueEvents[_0x324e('0x5')](_0x54d939,_0x5f1364);_0x1cfa39(null);};}for(var e in events){if(events[_0x324e('0x6')](e)){var event=events[e];SmsQueue[_0x324e('0x7')](e,emitEvent(event));}}module[_0x324e('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xaeb1=['hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x23c23c,_0x5ee1ff){var _0xf99e32=function(_0x16c73f){while(--_0x16c73f){_0x23c23c['push'](_0x23c23c['shift']());}};_0xf99e32(++_0x5ee1ff);}(_0xaeb1,0x1e2));var _0x1aeb=function(_0x23a1f6,_0x3d615b){_0x23a1f6=_0x23a1f6-0x0;var _0x3c42a9=_0xaeb1[_0x23a1f6];return _0x3c42a9;};'use strict';var EventEmitter=require(_0x1aeb('0x0'));var SmsQueue=require(_0x1aeb('0x1'))['db'][_0x1aeb('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1aeb('0x3')](0x0);var events={'afterCreate':_0x1aeb('0x4'),'afterUpdate':_0x1aeb('0x5'),'afterDestroy':_0x1aeb('0x6')};function emitEvent(_0x1f0ef5){return function(_0xf7c5d3,_0x1f853d,_0x51ab9d){SmsQueueEvents[_0x1aeb('0x7')](_0x1f0ef5+':'+_0xf7c5d3['id'],_0xf7c5d3);SmsQueueEvents[_0x1aeb('0x7')](_0x1f0ef5,_0xf7c5d3);_0x51ab9d(null);};}for(var e in events){if(events[_0x1aeb('0x8')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x1aeb('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 5495b8d..a3b1458 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 _0x31d6=['rimraf','../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xd527bd,_0x41ebec){var _0x1ed3f3=function(_0x27b942){while(--_0x27b942){_0xd527bd['push'](_0xd527bd['shift']());}};_0x1ed3f3(++_0x41ebec);}(_0x31d6,0xd1));var _0x631d=function(_0x437f46,_0x35db19){_0x437f46=_0x437f46-0x0;var _0x55fb57=_0x31d6[_0x437f46];return _0x55fb57;};'use strict';var _=require(_0x631d('0x0'));var util=require(_0x631d('0x1'));var logger=require('../../config/logger')(_0x631d('0x2'));var moment=require(_0x631d('0x3'));var BPromise=require(_0x631d('0x4'));var rp=require(_0x631d('0x5'));var fs=require('fs');var path=require(_0x631d('0x6'));var rimraf=require(_0x631d('0x7'));var config=require(_0x631d('0x8'));var attributes=require(_0x631d('0x9'));module['exports']=function(_0x4843bd,_0x42df31){return _0x4843bd['define'](_0x631d('0xa'),attributes,{'tableName':_0x631d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x637d=['SmsQueue','lodash','moment','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x5c63dd,_0x47fe21){var _0xd44abd=function(_0x204fc5){while(--_0x204fc5){_0x5c63dd['push'](_0x5c63dd['shift']());}};_0xd44abd(++_0x47fe21);}(_0x637d,0xcc));var _0xd637=function(_0x4e5db4,_0x5305e8){_0x4e5db4=_0x4e5db4-0x0;var _0x4dfc45=_0x637d[_0x4e5db4];return _0x4dfc45;};'use strict';var _=require(_0xd637('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd637('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd637('0x2'));var config=require(_0xd637('0x3'));var attributes=require(_0xd637('0x4'));module[_0xd637('0x5')]=function(_0x3e8845,_0x28c8a2){return _0x3e8845['define'](_0xd637('0x6'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 830163f..7318014 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 _0xc255=['limit','include','map','model','GetSmsQueue','debug','catch','ShowSmsQueue','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','SmsQueue','options','raw','where','attributes'];(function(_0x425cc4,_0x50053e){var _0x56d05a=function(_0x37d75e){while(--_0x37d75e){_0x425cc4['push'](_0x425cc4['shift']());}};_0x56d05a(++_0x50053e);}(_0xc255,0x155));var _0x5c25=function(_0x32d788,_0xbaa65e){_0x32d788=_0x32d788-0x0;var _0x1b671a=_0xc255[_0x32d788];return _0x1b671a;};'use strict';var _=require(_0x5c25('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5c25('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c25('0x2'));var db=require(_0x5c25('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5c25('0x4'));var config=require(_0x5c25('0x5'));var jayson=require(_0x5c25('0x6'));var client=jayson[_0x5c25('0x7')][_0x5c25('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5c25('0x9')],{'host':_0x5c25('0xa'),'port':0x18eb});var socket=require(_0x5c25('0xb'))(new Redis(config[_0x5c25('0x9')]));require(_0x5c25('0xc'))[_0x5c25('0xd')](socket);function respondWithRpcPromise(_0x3094c4,_0x2faedc,_0x5cd6cc){return new BPromise(function(_0x1c7aae,_0x300c23){return client[_0x5c25('0xe')](_0x3094c4,_0x5cd6cc)[_0x5c25('0xf')](function(_0xdc92d5){logger['info'](_0x5c25('0x10'),_0x2faedc,_0x5c25('0x11'));logger['debug'](_0x5c25('0x12'),_0x2faedc,_0x5c25('0x11'),JSON[_0x5c25('0x13')](_0xdc92d5));if(_0xdc92d5[_0x5c25('0x14')]){if(_0xdc92d5[_0x5c25('0x14')]['code']===0x1f4){logger[_0x5c25('0x14')](_0x5c25('0x10'),_0x2faedc,_0xdc92d5['error'][_0x5c25('0x15')]);return _0x300c23(_0xdc92d5['error']['message']);}logger[_0x5c25('0x14')](_0x5c25('0x10'),_0x2faedc,_0xdc92d5[_0x5c25('0x14')]['message']);return _0x1c7aae(_0xdc92d5[_0x5c25('0x14')][_0x5c25('0x15')]);}else{logger[_0x5c25('0x16')]('SmsQueue,\x20%s,\x20%s',_0x2faedc,_0x5c25('0x11'));_0x1c7aae(_0xdc92d5[_0x5c25('0x17')][_0x5c25('0x15')]);}})['catch'](function(_0x3163ff){logger['error'](_0x5c25('0x10'),_0x2faedc,_0x3163ff);_0x300c23(_0x3163ff);});});}exports['GetSmsQueue']=function(_0x304a53){var _0x56d70b=this;return new Promise(function(_0x2decd3,_0x2bcd80){return db[_0x5c25('0x18')]['findAll']({'raw':_0x304a53['options']?_0x304a53[_0x5c25('0x19')][_0x5c25('0x1a')]===undefined?!![]:![]:!![],'where':_0x304a53[_0x5c25('0x19')]?_0x304a53['options'][_0x5c25('0x1b')]||null:null,'attributes':_0x304a53['options']?_0x304a53['options'][_0x5c25('0x1c')]||null:null,'limit':_0x304a53['options']?_0x304a53[_0x5c25('0x19')][_0x5c25('0x1d')]||null:null,'include':_0x304a53[_0x5c25('0x19')]?_0x304a53[_0x5c25('0x19')][_0x5c25('0x1e')]?_[_0x5c25('0x1f')](_0x304a53['options']['include'],function(_0x36107c){return{'model':db[_0x36107c[_0x5c25('0x20')]],'as':_0x36107c['as'],'attributes':_0x36107c[_0x5c25('0x1c')],'include':_0x36107c['include']?_[_0x5c25('0x1f')](_0x36107c[_0x5c25('0x1e')],function(_0xe9fb76){return{'model':db[_0xe9fb76[_0x5c25('0x20')]],'as':_0xe9fb76['as'],'attributes':_0xe9fb76[_0x5c25('0x1c')],'include':_0xe9fb76[_0x5c25('0x1e')]?_[_0x5c25('0x1f')](_0xe9fb76['include'],function(_0x45bf8c){return{'model':db[_0x45bf8c['model']],'as':_0x45bf8c['as'],'attributes':_0x45bf8c[_0x5c25('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x531221){logger[_0x5c25('0x16')](_0x5c25('0x21'),_0x304a53);logger[_0x5c25('0x22')](_0x5c25('0x21'),_0x304a53,JSON[_0x5c25('0x13')](_0x531221));_0x2decd3(_0x531221);})[_0x5c25('0x23')](function(_0x587c28){logger[_0x5c25('0x14')](_0x5c25('0x21'),_0x587c28[_0x5c25('0x15')],_0x304a53);_0x2bcd80(_0x56d70b[_0x5c25('0x14')](0x1f4,_0x587c28[_0x5c25('0x15')]));});});};exports[_0x5c25('0x24')]=function(_0x336fe3){var _0x188e2d=this;return new Promise(function(_0x1639cc,_0x279298){return db[_0x5c25('0x18')]['find']({'raw':_0x336fe3[_0x5c25('0x19')]?_0x336fe3[_0x5c25('0x19')][_0x5c25('0x1a')]===undefined?!![]:![]:!![],'where':_0x336fe3['options']?_0x336fe3['options'][_0x5c25('0x1b')]||null:null,'attributes':_0x336fe3[_0x5c25('0x19')]?_0x336fe3[_0x5c25('0x19')][_0x5c25('0x1c')]||null:null,'include':_0x336fe3[_0x5c25('0x19')]?_0x336fe3['options']['include']?_[_0x5c25('0x1f')](_0x336fe3[_0x5c25('0x19')][_0x5c25('0x1e')],function(_0x1e9e8a){return{'model':db[_0x1e9e8a[_0x5c25('0x20')]],'as':_0x1e9e8a['as'],'attributes':_0x1e9e8a[_0x5c25('0x1c')],'include':_0x1e9e8a[_0x5c25('0x1e')]?_[_0x5c25('0x1f')](_0x1e9e8a[_0x5c25('0x1e')],function(_0x11965b){return{'model':db[_0x11965b[_0x5c25('0x20')]],'as':_0x11965b['as'],'attributes':_0x11965b['attributes'],'include':_0x11965b[_0x5c25('0x1e')]?_['map'](_0x11965b['include'],function(_0x5b254f){return{'model':db[_0x5b254f['model']],'as':_0x5b254f['as'],'attributes':_0x5b254f[_0x5c25('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dcb21){logger[_0x5c25('0x16')](_0x5c25('0x24'),_0x336fe3);logger[_0x5c25('0x22')]('ShowSmsQueue',_0x336fe3,JSON['stringify'](_0x4dcb21));_0x1639cc(_0x4dcb21);})[_0x5c25('0x23')](function(_0x5524bd){logger['error'](_0x5c25('0x24'),_0x5524bd[_0x5c25('0x15')],_0x336fe3);_0x279298(_0x188e2d['error'](0x1f4,_0x5524bd[_0x5c25('0x15')]));});});}; \ No newline at end of file +var _0xe139=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','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','attributes','limit','include','map','model','ShowSmsQueue','find','lodash','util'];(function(_0x4f92ce,_0x23dc6e){var _0x9ae8f=function(_0x3763d5){while(--_0x3763d5){_0x4f92ce['push'](_0x4f92ce['shift']());}};_0x9ae8f(++_0x23dc6e);}(_0xe139,0x198));var _0x9e13=function(_0x2697ce,_0x184174){_0x2697ce=_0x2697ce-0x0;var _0x1c9f08=_0xe139[_0x2697ce];return _0x1c9f08;};'use strict';var _=require(_0x9e13('0x0'));var util=require(_0x9e13('0x1'));var moment=require(_0x9e13('0x2'));var BPromise=require(_0x9e13('0x3'));var rs=require(_0x9e13('0x4'));var fs=require('fs');var Redis=require(_0x9e13('0x5'));var db=require(_0x9e13('0x6'))['db'];var utils=require(_0x9e13('0x7'));var logger=require(_0x9e13('0x8'))(_0x9e13('0x9'));var config=require(_0x9e13('0xa'));var jayson=require(_0x9e13('0xb'));var client=jayson[_0x9e13('0xc')][_0x9e13('0xd')]({'port':0x232a});config[_0x9e13('0xe')]=_['defaults'](config[_0x9e13('0xe')],{'host':_0x9e13('0xf'),'port':0x18eb});var socket=require(_0x9e13('0x10'))(new Redis(config[_0x9e13('0xe')]));require(_0x9e13('0x11'))['register'](socket);function respondWithRpcPromise(_0x24e00f,_0x1350d9,_0x1f7297){return new BPromise(function(_0x144e1d,_0x2fa2cc){return client[_0x9e13('0x12')](_0x24e00f,_0x1f7297)[_0x9e13('0x13')](function(_0x1e8de8){logger[_0x9e13('0x14')](_0x9e13('0x15'),_0x1350d9,_0x9e13('0x16'));logger[_0x9e13('0x17')](_0x9e13('0x18'),_0x1350d9,_0x9e13('0x16'),JSON[_0x9e13('0x19')](_0x1e8de8));if(_0x1e8de8[_0x9e13('0x1a')]){if(_0x1e8de8[_0x9e13('0x1a')]['code']===0x1f4){logger['error'](_0x9e13('0x15'),_0x1350d9,_0x1e8de8[_0x9e13('0x1a')]['message']);return _0x2fa2cc(_0x1e8de8['error'][_0x9e13('0x1b')]);}logger[_0x9e13('0x1a')](_0x9e13('0x15'),_0x1350d9,_0x1e8de8['error']['message']);return _0x144e1d(_0x1e8de8[_0x9e13('0x1a')]['message']);}else{logger[_0x9e13('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1350d9,_0x9e13('0x16'));_0x144e1d(_0x1e8de8[_0x9e13('0x1c')][_0x9e13('0x1b')]);}})[_0x9e13('0x1d')](function(_0x1a5979){logger[_0x9e13('0x1a')](_0x9e13('0x15'),_0x1350d9,_0x1a5979);_0x2fa2cc(_0x1a5979);});});}exports[_0x9e13('0x1e')]=function(_0x105185){var _0x2a8eef=this;return new Promise(function(_0x33aa99,_0x7ce513){return db['SmsQueue'][_0x9e13('0x1f')]({'raw':_0x105185[_0x9e13('0x20')]?_0x105185[_0x9e13('0x20')][_0x9e13('0x21')]===undefined?!![]:![]:!![],'where':_0x105185[_0x9e13('0x20')]?_0x105185['options']['where']||null:null,'attributes':_0x105185[_0x9e13('0x20')]?_0x105185[_0x9e13('0x20')][_0x9e13('0x22')]||null:null,'limit':_0x105185[_0x9e13('0x20')]?_0x105185['options'][_0x9e13('0x23')]||null:null,'include':_0x105185[_0x9e13('0x20')]?_0x105185[_0x9e13('0x20')][_0x9e13('0x24')]?_[_0x9e13('0x25')](_0x105185[_0x9e13('0x20')][_0x9e13('0x24')],function(_0x191a1a){return{'model':db[_0x191a1a[_0x9e13('0x26')]],'as':_0x191a1a['as'],'attributes':_0x191a1a['attributes'],'include':_0x191a1a['include']?_[_0x9e13('0x25')](_0x191a1a[_0x9e13('0x24')],function(_0x429786){return{'model':db[_0x429786['model']],'as':_0x429786['as'],'attributes':_0x429786['attributes'],'include':_0x429786[_0x9e13('0x24')]?_[_0x9e13('0x25')](_0x429786[_0x9e13('0x24')],function(_0x1e9ce8){return{'model':db[_0x1e9ce8[_0x9e13('0x26')]],'as':_0x1e9ce8['as'],'attributes':_0x1e9ce8[_0x9e13('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x506192){logger[_0x9e13('0x14')](_0x9e13('0x1e'),_0x105185);logger[_0x9e13('0x17')](_0x9e13('0x1e'),_0x105185,JSON[_0x9e13('0x19')](_0x506192));_0x33aa99(_0x506192);})[_0x9e13('0x1d')](function(_0x2e129b){logger[_0x9e13('0x1a')](_0x9e13('0x1e'),_0x2e129b['message'],_0x105185);_0x7ce513(_0x2a8eef[_0x9e13('0x1a')](0x1f4,_0x2e129b[_0x9e13('0x1b')]));});});};exports[_0x9e13('0x27')]=function(_0x4cf8db){var _0xfd04f4=this;return new Promise(function(_0x4afa1f,_0x3f64e2){return db['SmsQueue'][_0x9e13('0x28')]({'raw':_0x4cf8db[_0x9e13('0x20')]?_0x4cf8db[_0x9e13('0x20')][_0x9e13('0x21')]===undefined?!![]:![]:!![],'where':_0x4cf8db[_0x9e13('0x20')]?_0x4cf8db[_0x9e13('0x20')]['where']||null:null,'attributes':_0x4cf8db['options']?_0x4cf8db[_0x9e13('0x20')][_0x9e13('0x22')]||null:null,'include':_0x4cf8db['options']?_0x4cf8db['options'][_0x9e13('0x24')]?_[_0x9e13('0x25')](_0x4cf8db[_0x9e13('0x20')]['include'],function(_0x301822){return{'model':db[_0x301822['model']],'as':_0x301822['as'],'attributes':_0x301822[_0x9e13('0x22')],'include':_0x301822[_0x9e13('0x24')]?_['map'](_0x301822[_0x9e13('0x24')],function(_0x20f404){return{'model':db[_0x20f404[_0x9e13('0x26')]],'as':_0x20f404['as'],'attributes':_0x20f404['attributes'],'include':_0x20f404[_0x9e13('0x24')]?_['map'](_0x20f404[_0x9e13('0x24')],function(_0x1dc94e){return{'model':db[_0x1dc94e[_0x9e13('0x26')]],'as':_0x1dc94e['as'],'attributes':_0x1dc94e[_0x9e13('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41c45b){logger[_0x9e13('0x14')](_0x9e13('0x27'),_0x4cf8db);logger[_0x9e13('0x17')](_0x9e13('0x27'),_0x4cf8db,JSON[_0x9e13('0x19')](_0x41c45b));_0x4afa1f(_0x41c45b);})['catch'](function(_0x1b5611){logger[_0x9e13('0x1a')]('ShowSmsQueue',_0x1b5611[_0x9e13('0x1b')],_0x4cf8db);_0x3f64e2(_0xfd04f4[_0x9e13('0x1a')](0x1f4,_0x1b5611[_0x9e13('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5f4401d..b31ab8f 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 _0xc1f4=['register','length','smsQueue:','./smsQueue.events','save','update','emit','removeListener'];(function(_0x3b2308,_0x53754c){var _0x42a190=function(_0x46e07e){while(--_0x46e07e){_0x3b2308['push'](_0x3b2308['shift']());}};_0x42a190(++_0x53754c);}(_0xc1f4,0x133));var _0x4c1f=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc1f4[_0x5c351c];return _0x26f3b3;};'use strict';var SmsQueueEvents=require(_0x4c1f('0x0'));var events=[_0x4c1f('0x1'),'remove',_0x4c1f('0x2')];function createListener(_0x225c92,_0x13ca45){return function(_0x222d7f){_0x13ca45[_0x4c1f('0x3')](_0x225c92,_0x222d7f);};}function removeListener(_0x55c88c,_0x57e22f){return function(){SmsQueueEvents[_0x4c1f('0x4')](_0x55c88c,_0x57e22f);};}exports[_0x4c1f('0x5')]=function(_0x3da1f7){for(var _0xd98d03=0x0,_0x584948=events[_0x4c1f('0x6')];_0xd98d03<_0x584948;_0xd98d03++){var _0x5662a0=events[_0xd98d03];var _0x3fdd87=createListener(_0x4c1f('0x7')+_0x5662a0,_0x3da1f7);SmsQueueEvents['on'](_0x5662a0,_0x3fdd87);}}; \ No newline at end of file +var _0xb71d=['length','save','remove','removeListener'];(function(_0x2f9a98,_0x206f96){var _0x2d7280=function(_0x3be447){while(--_0x3be447){_0x2f9a98['push'](_0x2f9a98['shift']());}};_0x2d7280(++_0x206f96);}(_0xb71d,0xe9));var _0xdb71=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb71d[_0xfae23b];return _0x200640;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xdb71('0x0'),_0xdb71('0x1'),'update'];function createListener(_0x1ba93a,_0x1b96e1){return function(_0x34a67a){_0x1b96e1['emit'](_0x1ba93a,_0x34a67a);};}function removeListener(_0x3be372,_0x2609b8){return function(){SmsQueueEvents[_0xdb71('0x2')](_0x3be372,_0x2609b8);};}exports['register']=function(_0x4007b4){for(var _0x27e43c=0x0,_0x1aa185=events[_0xdb71('0x3')];_0x27e43c<_0x1aa185;_0x27e43c++){var _0x200b75=events[_0x27e43c];var _0x3f47ae=createListener('smsQueue:'+_0x200b75,_0x4007b4);SmsQueueEvents['on'](_0x200b75,_0x3f47ae);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 415c11f..9a89ef7 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 _0xfdfc=['./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3a6365,_0x29eb11){var _0xe98bdd=function(_0x26749e){while(--_0x26749e){_0x3a6365['push'](_0x3a6365['shift']());}};_0xe98bdd(++_0x29eb11);}(_0xfdfc,0x6c));var _0xcfdf=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xfdfc[_0x4a53d];return _0x27410e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcfdf('0x0'));var express=require(_0xcfdf('0x1'));var router=express[_0xcfdf('0x2')]();var fs_extra=require(_0xcfdf('0x3'));var auth=require(_0xcfdf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcfdf('0x5'));var controller=require(_0xcfdf('0x6'));router[_0xcfdf('0x7')]('/',auth['isAuthenticated'](),controller[_0xcfdf('0x8')]);router[_0xcfdf('0x7')](_0xcfdf('0x9'),auth[_0xcfdf('0xa')](),controller[_0xcfdf('0xb')]);router[_0xcfdf('0x7')](_0xcfdf('0xc'),auth[_0xcfdf('0xa')](),controller['show']);router[_0xcfdf('0xd')]('/',auth[_0xcfdf('0xa')](),controller[_0xcfdf('0xe')]);router[_0xcfdf('0xf')](_0xcfdf('0xc'),auth['isAuthenticated'](),controller[_0xcfdf('0x10')]);router[_0xcfdf('0x11')](_0xcfdf('0xc'),auth[_0xcfdf('0xa')](),controller[_0xcfdf('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe953=['fs-extra','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','delete','destroy','exports','Router'];(function(_0x422130,_0x3af22c){var _0x34a79e=function(_0x5ef389){while(--_0x5ef389){_0x422130['push'](_0x422130['shift']());}};_0x34a79e(++_0x3af22c);}(_0xe953,0x1d0));var _0x3e95=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xe953[_0x5eaa0b];return _0x28b295;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3e95('0x0')]();var fs_extra=require(_0x3e95('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x3e95('0x2'));var config=require('../../config/environment');var controller=require(_0x3e95('0x3'));router['get']('/',auth[_0x3e95('0x4')](),controller[_0x3e95('0x5')]);router[_0x3e95('0x6')](_0x3e95('0x7'),auth[_0x3e95('0x4')](),controller['describe']);router[_0x3e95('0x6')](_0x3e95('0x8'),auth[_0x3e95('0x4')](),controller['show']);router[_0x3e95('0x9')]('/',auth[_0x3e95('0x4')](),controller[_0x3e95('0xa')]);router[_0x3e95('0xb')]('/:id',auth[_0x3e95('0x4')](),controller['update']);router[_0x3e95('0xc')](_0x3e95('0x8'),auth[_0x3e95('0x4')](),controller[_0x3e95('0xd')]);module[_0x3e95('0xe')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index da0f781..a0cb055 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 _0xefc0=['sequelize','exports','STRING','DATE','moment'];(function(_0x40ab24,_0x54021f){var _0x1b3dec=function(_0x1f7509){while(--_0x1f7509){_0x40ab24['push'](_0x40ab24['shift']());}};_0x1b3dec(++_0x54021f);}(_0xefc0,0x18a));var _0x0efc=function(_0x10b7ff,_0xb4c045){_0x10b7ff=_0x10b7ff-0x0;var _0x1a3617=_0xefc0[_0x10b7ff];return _0x1a3617;};'use strict';var moment=require(_0x0efc('0x0'));var Sequelize=require(_0x0efc('0x1'));module[_0x0efc('0x2')]={'uniqueid':{'type':Sequelize[_0x0efc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0efc('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0efc('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0efc('0x4')]},'reason':{'type':Sequelize[_0x0efc('0x3')]}}; \ No newline at end of file +var _0x12f1=['DATE','moment','exports','STRING'];(function(_0x3f8d39,_0x57f2a7){var _0x30bf45=function(_0x4aa292){while(--_0x4aa292){_0x3f8d39['push'](_0x3f8d39['shift']());}};_0x30bf45(++_0x57f2a7);}(_0x12f1,0x151));var _0x112f=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x12f1[_0xc8db6b];return _0x12cb81;};'use strict';var moment=require(_0x112f('0x0'));var Sequelize=require('sequelize');module[_0x112f('0x1')]={'uniqueid':{'type':Sequelize[_0x112f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x112f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x112f('0x3')]},'acceptAt':{'type':Sequelize[_0x112f('0x3')]},'exitAt':{'type':Sequelize[_0x112f('0x3')]},'reason':{'type':Sequelize[_0x112f('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 30af272..3cbd298 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 _0xe52d=['SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','json','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x3de289,_0xfb2a18){var _0x43a162=function(_0x7f0553){while(--_0x7f0553){_0x3de289['push'](_0x3de289['shift']());}};_0x43a162(++_0xfb2a18);}(_0xe52d,0x6b));var _0xde52=function(_0x1bb2e8,_0x403dbf){_0x1bb2e8=_0x1bb2e8-0x0;var _0x28c212=_0xe52d[_0x1bb2e8];return _0x28c212;};'use strict';var emlformat=require(_0xde52('0x0'));var rimraf=require(_0xde52('0x1'));var zipdir=require(_0xde52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde52('0x3'));var moment=require(_0xde52('0x4'));var BPromise=require(_0xde52('0x5'));var Mustache=require('mustache');var util=require(_0xde52('0x6'));var path=require(_0xde52('0x7'));var sox=require(_0xde52('0x8'));var csv=require(_0xde52('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde52('0xa'));var _=require(_0xde52('0xb'));var squel=require(_0xde52('0xc'));var crypto=require(_0xde52('0xd'));var jsforce=require(_0xde52('0xe'));var deskjs=require(_0xde52('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xde52('0x10'));var authService=require(_0xde52('0x11'));var qs=require(_0xde52('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde52('0x13'));var logger=require(_0xde52('0x14'))('api');var utils=require(_0xde52('0x15'));var config=require(_0xde52('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xde52('0x17'))['db'];function respondWithStatusCode(_0x278a6c,_0x43be36){_0x43be36=_0x43be36||0xcc;return function(_0xb9b86b){if(_0xb9b86b){return _0x278a6c['sendStatus'](_0x43be36);}return _0x278a6c[_0xde52('0x18')](_0x43be36)[_0xde52('0x19')]();};}function respondWithResult(_0x1421f3,_0x4c9d5d){_0x4c9d5d=_0x4c9d5d||0xc8;return function(_0x319596){if(_0x319596){return _0x1421f3[_0xde52('0x18')](_0x4c9d5d)['json'](_0x319596);}};}function respondWithFilteredResult(_0x48cb42,_0x559d3e){return function(_0x1654f4){if(_0x1654f4){var _0x552ec1=typeof _0x559d3e[_0xde52('0x1a')]==='undefined'&&typeof _0x559d3e[_0xde52('0x1b')]===_0xde52('0x1c');var _0xebfae0=_0x1654f4['count'];var _0x43d476=_0x552ec1?0x0:_0x559d3e[_0xde52('0x1a')];var _0x2b5714=_0x552ec1?_0x1654f4[_0xde52('0x1d')]:_0x559d3e[_0xde52('0x1a')]+_0x559d3e[_0xde52('0x1b')];var _0x360ef9;if(_0x2b5714>=_0xebfae0){_0x2b5714=_0xebfae0;_0x360ef9=0xc8;}else{_0x360ef9=0xce;}_0x48cb42[_0xde52('0x18')](_0x360ef9);return _0x48cb42[_0xde52('0x1e')]('Content-Range',_0x43d476+'-'+_0x2b5714+'/'+_0xebfae0)[_0xde52('0x1f')](_0x1654f4);}return null;};}function patchUpdates(_0x31de7b){return function(_0x12d711){try{jsonpatch['apply'](_0x12d711,_0x31de7b,!![]);}catch(_0x28231d){return BPromise[_0xde52('0x20')](_0x28231d);}return _0x12d711[_0xde52('0x21')]();};}function saveUpdates(_0x358c05,_0x58c403){return function(_0x409526){if(_0x409526){return _0x409526[_0xde52('0x22')](_0x358c05)[_0xde52('0x23')](function(_0x578ee4){return _0x578ee4;});}return null;};}function removeEntity(_0x65bbd9,_0x518076){return function(_0x5a124f){if(_0x5a124f){return _0x5a124f[_0xde52('0x24')]()[_0xde52('0x23')](function(){_0x65bbd9[_0xde52('0x18')](0xcc)[_0xde52('0x19')]();});}};}function handleEntityNotFound(_0x155f46,_0xb97071){return function(_0x5a285f){if(!_0x5a285f){_0x155f46['sendStatus'](0x194);}return _0x5a285f;};}function handleError(_0x56caac,_0x39daa4){_0x39daa4=_0x39daa4||0x1f4;return function(_0x193a89){logger[_0xde52('0x25')](_0x193a89[_0xde52('0x26')]);if(_0x193a89[_0xde52('0x27')]){delete _0x193a89[_0xde52('0x27')];}_0x56caac[_0xde52('0x18')](_0x39daa4)[_0xde52('0x28')](_0x193a89);};}exports[_0xde52('0x29')]=function(_0x14e1e4,_0x2b102b){var _0x35f255={},_0x543e0e={},_0x18fecb={'count':0x0,'rows':[]};var _0x44c592=_[_0xde52('0x2a')](db[_0xde52('0x2b')][_0xde52('0x2c')],function(_0x151536){return{'name':_0x151536['fieldName'],'type':_0x151536[_0xde52('0x2d')][_0xde52('0x2e')]};});_0x543e0e[_0xde52('0x2f')]=_['map'](_0x44c592,_0xde52('0x27'));_0x543e0e[_0xde52('0x30')]=_[_0xde52('0x31')](_0x14e1e4[_0xde52('0x30')]);_0x543e0e[_0xde52('0x32')]=_[_0xde52('0x33')](_0x543e0e[_0xde52('0x2f')],_0x543e0e[_0xde52('0x30')]);_0x35f255[_0xde52('0x34')]=_[_0xde52('0x33')](_0x543e0e[_0xde52('0x2f')],qs[_0xde52('0x35')](_0x14e1e4[_0xde52('0x30')]['fields']));_0x35f255['attributes']=_0x35f255[_0xde52('0x34')][_0xde52('0x36')]?_0x35f255[_0xde52('0x34')]:_0x543e0e[_0xde52('0x2f')];if(!_0x14e1e4[_0xde52('0x30')][_0xde52('0x37')]('nolimit')){_0x35f255[_0xde52('0x1b')]=qs[_0xde52('0x1b')](_0x14e1e4[_0xde52('0x30')][_0xde52('0x1b')]);_0x35f255['offset']=qs[_0xde52('0x1a')](_0x14e1e4[_0xde52('0x30')][_0xde52('0x1a')]);}_0x35f255[_0xde52('0x38')]=qs[_0xde52('0x39')](_0x14e1e4['query']['sort']);_0x35f255[_0xde52('0x3a')]=qs[_0xde52('0x32')](_[_0xde52('0x3b')](_0x14e1e4[_0xde52('0x30')],_0x543e0e[_0xde52('0x32')]),_0x44c592);if(_0x14e1e4[_0xde52('0x30')][_0xde52('0x3c')]){_0x35f255[_0xde52('0x3a')]=_['merge'](_0x35f255[_0xde52('0x3a')],{'$or':_[_0xde52('0x2a')](_0x44c592,function(_0x1ad412){if(_0x1ad412[_0xde52('0x2d')]!==_0xde52('0x3d')){var _0x3498ab={};_0x3498ab[_0x1ad412['name']]={'$like':'%'+_0x14e1e4[_0xde52('0x30')]['filter']+'%'};return _0x3498ab;}})});}_0x35f255=_['merge']({},_0x35f255,_0x14e1e4[_0xde52('0x3e')]);var _0x5c9e8e={'where':_0x35f255[_0xde52('0x3a')]};return db[_0xde52('0x2b')][_0xde52('0x1d')](_0x5c9e8e)[_0xde52('0x23')](function(_0x4d9d1d){_0x18fecb[_0xde52('0x1d')]=_0x4d9d1d;if(_0x14e1e4[_0xde52('0x30')][_0xde52('0x3f')]){_0x35f255[_0xde52('0x40')]=[{'all':!![]}];}return db[_0xde52('0x2b')][_0xde52('0x41')](_0x35f255);})['then'](function(_0x3c475a){_0x18fecb[_0xde52('0x42')]=_0x3c475a;return _0x18fecb;})['then'](respondWithFilteredResult(_0x2b102b,_0x35f255))[_0xde52('0x43')](handleError(_0x2b102b,null));};exports[_0xde52('0x44')]=function(_0x43d164,_0x1fdeea){var _0x195d7e={'raw':!![],'where':{'id':_0x43d164[_0xde52('0x45')]['id']}},_0x320b80={};_0x320b80['model']=_[_0xde52('0x31')](db[_0xde52('0x2b')][_0xde52('0x2c')]);_0x320b80[_0xde52('0x30')]=_[_0xde52('0x31')](_0x43d164[_0xde52('0x30')]);_0x320b80['filters']=_['intersection'](_0x320b80[_0xde52('0x2f')],_0x320b80[_0xde52('0x30')]);_0x195d7e[_0xde52('0x34')]=_['intersection'](_0x320b80['model'],qs['fields'](_0x43d164['query'][_0xde52('0x35')]));_0x195d7e[_0xde52('0x34')]=_0x195d7e[_0xde52('0x34')][_0xde52('0x36')]?_0x195d7e[_0xde52('0x34')]:_0x320b80[_0xde52('0x2f')];if(_0x43d164[_0xde52('0x30')][_0xde52('0x3f')]){_0x195d7e['include']=[{'all':!![]}];}_0x195d7e=_[_0xde52('0x46')]({},_0x195d7e,_0x43d164[_0xde52('0x3e')]);return db['SmsQueueReport']['find'](_0x195d7e)[_0xde52('0x23')](handleEntityNotFound(_0x1fdeea,null))[_0xde52('0x23')](respondWithResult(_0x1fdeea,null))[_0xde52('0x43')](handleError(_0x1fdeea,null));};exports['create']=function(_0x28abb9,_0xfe1370){return db[_0xde52('0x2b')][_0xde52('0x47')](_0x28abb9[_0xde52('0x48')],{})[_0xde52('0x23')](respondWithResult(_0xfe1370,0xc9))[_0xde52('0x43')](handleError(_0xfe1370,null));};exports['update']=function(_0x10947b,_0x3e18e8){if(_0x10947b[_0xde52('0x48')]['id']){delete _0x10947b[_0xde52('0x48')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x10947b[_0xde52('0x45')]['id']}})[_0xde52('0x23')](handleEntityNotFound(_0x3e18e8,null))['then'](saveUpdates(_0x10947b['body'],null))[_0xde52('0x23')](respondWithResult(_0x3e18e8,null))['catch'](handleError(_0x3e18e8,null));};exports['destroy']=function(_0x4b8e5d,_0x5bbc03){return db[_0xde52('0x2b')][_0xde52('0x49')]({'where':{'id':_0x4b8e5d[_0xde52('0x45')]['id']}})[_0xde52('0x23')](handleEntityNotFound(_0x5bbc03,null))[_0xde52('0x23')](removeEntity(_0x5bbc03,null))[_0xde52('0x43')](handleError(_0x5bbc03,null));};exports[_0xde52('0x4a')]=function(_0x31f177,_0x1d022f){return db['SmsQueueReport'][_0xde52('0x4a')]()[_0xde52('0x23')](respondWithResult(_0x1d022f,null))[_0xde52('0x43')](handleError(_0x1d022f,null));}; \ No newline at end of file +var _0x5c9a=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','moment','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key'];(function(_0x2fbadc,_0x57dac7){var _0x44a072=function(_0x2e845a){while(--_0x2e845a){_0x2fbadc['push'](_0x2fbadc['shift']());}};_0x44a072(++_0x57dac7);}(_0x5c9a,0x6a));var _0xa5c9=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0x5c9a[_0x57a670];return _0x41ce21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5c9('0x0'));var zipdir=require(_0xa5c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa5c9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa5c9('0x3'));var util=require('util');var path=require('path');var sox=require(_0xa5c9('0x4'));var csv=require(_0xa5c9('0x5'));var ejs=require(_0xa5c9('0x6'));var fs=require('fs');var fs_extra=require(_0xa5c9('0x7'));var _=require(_0xa5c9('0x8'));var squel=require(_0xa5c9('0x9'));var crypto=require('crypto');var jsforce=require(_0xa5c9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa5c9('0xb'));var Papa=require(_0xa5c9('0xc'));var Redis=require(_0xa5c9('0xd'));var authService=require(_0xa5c9('0xe'));var qs=require(_0xa5c9('0xf'));var as=require(_0xa5c9('0x10'));var hardwareService=require(_0xa5c9('0x11'));var logger=require(_0xa5c9('0x12'))('api');var utils=require(_0xa5c9('0x13'));var config=require(_0xa5c9('0x14'));var licenseUtil=require(_0xa5c9('0x15'));var db=require(_0xa5c9('0x16'))['db'];function respondWithStatusCode(_0x2c2ccc,_0x5f1561){_0x5f1561=_0x5f1561||0xcc;return function(_0x1529d2){if(_0x1529d2){return _0x2c2ccc[_0xa5c9('0x17')](_0x5f1561);}return _0x2c2ccc[_0xa5c9('0x18')](_0x5f1561)[_0xa5c9('0x19')]();};}function respondWithResult(_0x14382d,_0xd38d0a){_0xd38d0a=_0xd38d0a||0xc8;return function(_0x518aae){if(_0x518aae){return _0x14382d['status'](_0xd38d0a)[_0xa5c9('0x1a')](_0x518aae);}};}function respondWithFilteredResult(_0x411866,_0x373c4d){return function(_0x4f3749){if(_0x4f3749){var _0x423138=typeof _0x373c4d[_0xa5c9('0x1b')]===_0xa5c9('0x1c')&&typeof _0x373c4d['limit']==='undefined';var _0x15c01d=_0x4f3749['count'];var _0x267727=_0x423138?0x0:_0x373c4d[_0xa5c9('0x1b')];var _0x41c39d=_0x423138?_0x4f3749[_0xa5c9('0x1d')]:_0x373c4d[_0xa5c9('0x1b')]+_0x373c4d[_0xa5c9('0x1e')];var _0x30d87e;if(_0x41c39d>=_0x15c01d){_0x41c39d=_0x15c01d;_0x30d87e=0xc8;}else{_0x30d87e=0xce;}_0x411866['status'](_0x30d87e);return _0x411866[_0xa5c9('0x1f')](_0xa5c9('0x20'),_0x267727+'-'+_0x41c39d+'/'+_0x15c01d)[_0xa5c9('0x1a')](_0x4f3749);}return null;};}function patchUpdates(_0x13aa04){return function(_0x38ce47){try{jsonpatch[_0xa5c9('0x21')](_0x38ce47,_0x13aa04,!![]);}catch(_0x998b2e){return BPromise[_0xa5c9('0x22')](_0x998b2e);}return _0x38ce47[_0xa5c9('0x23')]();};}function saveUpdates(_0x278325,_0x192467){return function(_0x280410){if(_0x280410){return _0x280410[_0xa5c9('0x24')](_0x278325)[_0xa5c9('0x25')](function(_0x3bdcb3){return _0x3bdcb3;});}return null;};}function removeEntity(_0xea00b7,_0x588c06){return function(_0x4ce603){if(_0x4ce603){return _0x4ce603[_0xa5c9('0x26')]()[_0xa5c9('0x25')](function(){_0xea00b7['status'](0xcc)[_0xa5c9('0x19')]();});}};}function handleEntityNotFound(_0x2dfcea,_0x3ddda6){return function(_0x56f1a1){if(!_0x56f1a1){_0x2dfcea[_0xa5c9('0x17')](0x194);}return _0x56f1a1;};}function handleError(_0x5a7818,_0x1dcea5){_0x1dcea5=_0x1dcea5||0x1f4;return function(_0x487540){logger[_0xa5c9('0x27')](_0x487540[_0xa5c9('0x28')]);if(_0x487540[_0xa5c9('0x29')]){delete _0x487540['name'];}_0x5a7818[_0xa5c9('0x18')](_0x1dcea5)[_0xa5c9('0x2a')](_0x487540);};}exports[_0xa5c9('0x2b')]=function(_0x1c6995,_0x52afd7){var _0x3e9b54={},_0x4331fa={},_0x18bfd9={'count':0x0,'rows':[]};var _0x3f06bb=_[_0xa5c9('0x2c')](db[_0xa5c9('0x2d')][_0xa5c9('0x2e')],function(_0x497fc1){return{'name':_0x497fc1[_0xa5c9('0x2f')],'type':_0x497fc1[_0xa5c9('0x30')][_0xa5c9('0x31')]};});_0x4331fa[_0xa5c9('0x32')]=_[_0xa5c9('0x2c')](_0x3f06bb,_0xa5c9('0x29'));_0x4331fa[_0xa5c9('0x33')]=_[_0xa5c9('0x34')](_0x1c6995['query']);_0x4331fa[_0xa5c9('0x35')]=_[_0xa5c9('0x36')](_0x4331fa['model'],_0x4331fa[_0xa5c9('0x33')]);_0x3e9b54[_0xa5c9('0x37')]=_[_0xa5c9('0x36')](_0x4331fa['model'],qs[_0xa5c9('0x38')](_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x38')]));_0x3e9b54[_0xa5c9('0x37')]=_0x3e9b54[_0xa5c9('0x37')][_0xa5c9('0x39')]?_0x3e9b54['attributes']:_0x4331fa[_0xa5c9('0x32')];if(!_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x3a')](_0xa5c9('0x3b'))){_0x3e9b54['limit']=qs['limit'](_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x1e')]);_0x3e9b54[_0xa5c9('0x1b')]=qs[_0xa5c9('0x1b')](_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x1b')]);}_0x3e9b54[_0xa5c9('0x3c')]=qs[_0xa5c9('0x3d')](_0x1c6995['query']['sort']);_0x3e9b54[_0xa5c9('0x3e')]=qs[_0xa5c9('0x35')](_[_0xa5c9('0x3f')](_0x1c6995['query'],_0x4331fa[_0xa5c9('0x35')]),_0x3f06bb);if(_0x1c6995['query']['filter']){_0x3e9b54[_0xa5c9('0x3e')]=_[_0xa5c9('0x40')](_0x3e9b54['where'],{'$or':_[_0xa5c9('0x2c')](_0x3f06bb,function(_0x5cdc9a){if(_0x5cdc9a[_0xa5c9('0x30')]!==_0xa5c9('0x41')){var _0x206340={};_0x206340[_0x5cdc9a['name']]={'$like':'%'+_0x1c6995[_0xa5c9('0x33')]['filter']+'%'};return _0x206340;}})});}_0x3e9b54=_[_0xa5c9('0x40')]({},_0x3e9b54,_0x1c6995['options']);var _0x5da2f7={'where':_0x3e9b54['where']};return db[_0xa5c9('0x2d')][_0xa5c9('0x1d')](_0x5da2f7)[_0xa5c9('0x25')](function(_0xcacb4){_0x18bfd9[_0xa5c9('0x1d')]=_0xcacb4;if(_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x42')]){_0x3e9b54[_0xa5c9('0x43')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xa5c9('0x44')](_0x3e9b54);})[_0xa5c9('0x25')](function(_0x151d89){_0x18bfd9[_0xa5c9('0x45')]=_0x151d89;return _0x18bfd9;})['then'](respondWithFilteredResult(_0x52afd7,_0x3e9b54))['catch'](handleError(_0x52afd7,null));};exports[_0xa5c9('0x46')]=function(_0x16bb87,_0x2e9983){var _0x4f570b={'raw':!![],'where':{'id':_0x16bb87[_0xa5c9('0x47')]['id']}},_0x72013b={};_0x72013b[_0xa5c9('0x32')]=_[_0xa5c9('0x34')](db['SmsQueueReport'][_0xa5c9('0x2e')]);_0x72013b[_0xa5c9('0x33')]=_[_0xa5c9('0x34')](_0x16bb87['query']);_0x72013b['filters']=_[_0xa5c9('0x36')](_0x72013b[_0xa5c9('0x32')],_0x72013b['query']);_0x4f570b[_0xa5c9('0x37')]=_['intersection'](_0x72013b[_0xa5c9('0x32')],qs[_0xa5c9('0x38')](_0x16bb87[_0xa5c9('0x33')][_0xa5c9('0x38')]));_0x4f570b[_0xa5c9('0x37')]=_0x4f570b[_0xa5c9('0x37')][_0xa5c9('0x39')]?_0x4f570b[_0xa5c9('0x37')]:_0x72013b['model'];if(_0x16bb87['query'][_0xa5c9('0x42')]){_0x4f570b[_0xa5c9('0x43')]=[{'all':!![]}];}_0x4f570b=_['merge']({},_0x4f570b,_0x16bb87[_0xa5c9('0x48')]);return db[_0xa5c9('0x2d')][_0xa5c9('0x49')](_0x4f570b)[_0xa5c9('0x25')](handleEntityNotFound(_0x2e9983,null))[_0xa5c9('0x25')](respondWithResult(_0x2e9983,null))[_0xa5c9('0x4a')](handleError(_0x2e9983,null));};exports[_0xa5c9('0x4b')]=function(_0x5e81e3,_0x3c5fad){return db[_0xa5c9('0x2d')][_0xa5c9('0x4b')](_0x5e81e3[_0xa5c9('0x4c')],{})['then'](respondWithResult(_0x3c5fad,0xc9))[_0xa5c9('0x4a')](handleError(_0x3c5fad,null));};exports[_0xa5c9('0x24')]=function(_0x57bd3d,_0x3e3be9){if(_0x57bd3d['body']['id']){delete _0x57bd3d[_0xa5c9('0x4c')]['id'];}return db[_0xa5c9('0x2d')][_0xa5c9('0x49')]({'where':{'id':_0x57bd3d['params']['id']}})[_0xa5c9('0x25')](handleEntityNotFound(_0x3e3be9,null))[_0xa5c9('0x25')](saveUpdates(_0x57bd3d[_0xa5c9('0x4c')],null))[_0xa5c9('0x25')](respondWithResult(_0x3e3be9,null))[_0xa5c9('0x4a')](handleError(_0x3e3be9,null));};exports[_0xa5c9('0x26')]=function(_0x50fa09,_0x2e96d1){return db[_0xa5c9('0x2d')][_0xa5c9('0x49')]({'where':{'id':_0x50fa09[_0xa5c9('0x47')]['id']}})[_0xa5c9('0x25')](handleEntityNotFound(_0x2e96d1,null))[_0xa5c9('0x25')](removeEntity(_0x2e96d1,null))[_0xa5c9('0x4a')](handleError(_0x2e96d1,null));};exports['describe']=function(_0x4b8188,_0x357650){return db['SmsQueueReport'][_0xa5c9('0x4d')]()[_0xa5c9('0x25')](respondWithResult(_0x357650,null))[_0xa5c9('0x4a')](handleError(_0x357650,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3a33daf..bf50564 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3bd716,_0xe75aaa){var _0x3febcb=function(_0x4869a8){while(--_0x4869a8){_0x3bd716['push'](_0x3bd716['shift']());}};_0x3febcb(++_0xe75aaa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xcb91[_0x4b6830];return _0x239e4a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 7721e78..538e507 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 _0xb2ac=['error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x413c32,_0x1e79a4){var _0x37de17=function(_0xb16366){while(--_0xb16366){_0x413c32['push'](_0x413c32['shift']());}};_0x37de17(++_0x1e79a4);}(_0xb2ac,0x11f));var _0xcb2a=function(_0x393564,_0x3c37be){_0x393564=_0x393564-0x0;var _0x52b6a4=_0xb2ac[_0x393564];return _0x52b6a4;};'use strict';var _=require(_0xcb2a('0x0'));var util=require(_0xcb2a('0x1'));var moment=require('moment');var BPromise=require(_0xcb2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb2a('0x3'));var db=require(_0xcb2a('0x4'))['db'];var utils=require(_0xcb2a('0x5'));var logger=require(_0xcb2a('0x6'))(_0xcb2a('0x7'));var config=require(_0xcb2a('0x8'));var jayson=require(_0xcb2a('0x9'));var client=jayson['client'][_0xcb2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34ad89,_0x2c7fda,_0x203c4a){return new BPromise(function(_0x1f57b0,_0x20170b){return client[_0xcb2a('0xb')](_0x34ad89,_0x203c4a)[_0xcb2a('0xc')](function(_0x492ae7){logger[_0xcb2a('0xd')](_0xcb2a('0xe'),_0x2c7fda,_0xcb2a('0xf'));logger[_0xcb2a('0x10')](_0xcb2a('0x11'),_0x2c7fda,_0xcb2a('0xf'),JSON[_0xcb2a('0x12')](_0x492ae7));if(_0x492ae7['error']){if(_0x492ae7[_0xcb2a('0x13')]['code']===0x1f4){logger[_0xcb2a('0x13')](_0xcb2a('0xe'),_0x2c7fda,_0x492ae7['error'][_0xcb2a('0x14')]);return _0x20170b(_0x492ae7['error'][_0xcb2a('0x14')]);}logger[_0xcb2a('0x13')](_0xcb2a('0xe'),_0x2c7fda,_0x492ae7['error'][_0xcb2a('0x14')]);return _0x1f57b0(_0x492ae7[_0xcb2a('0x13')][_0xcb2a('0x14')]);}else{logger[_0xcb2a('0xd')](_0xcb2a('0xe'),_0x2c7fda,_0xcb2a('0xf'));_0x1f57b0(_0x492ae7[_0xcb2a('0x15')][_0xcb2a('0x14')]);}})[_0xcb2a('0x16')](function(_0x55462e){logger[_0xcb2a('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x2c7fda,_0x55462e);_0x20170b(_0x55462e);});});}exports[_0xcb2a('0x17')]=function(_0x5605bc){var _0x2393dc=this;return new Promise(function(_0x3ec265,_0x21083c){return db[_0xcb2a('0x18')][_0xcb2a('0x19')](_0x5605bc[_0xcb2a('0x1a')],{'raw':_0x5605bc[_0xcb2a('0x1b')]?_0x5605bc['options']['raw']===undefined?!![]:![]:!![]})[_0xcb2a('0xc')](function(_0x1129ca){logger['info'](_0xcb2a('0x17'),_0x5605bc);logger[_0xcb2a('0x10')](_0xcb2a('0x17'),_0x5605bc,JSON[_0xcb2a('0x12')](_0x1129ca));_0x3ec265(_0x1129ca);})[_0xcb2a('0x16')](function(_0x4664f8){logger[_0xcb2a('0x13')]('CreateSmsQueueReport',_0x4664f8[_0xcb2a('0x14')],_0x5605bc);_0x21083c(_0x2393dc[_0xcb2a('0x13')](0x1f4,_0x4664f8[_0xcb2a('0x14')]));});});};exports[_0xcb2a('0x1c')]=function(_0x321c52){var _0x4f222f=this;return new Promise(function(_0x5b73f2,_0x5e1a84){return db[_0xcb2a('0x18')][_0xcb2a('0x1d')](_0x321c52[_0xcb2a('0x1a')],{'raw':_0x321c52[_0xcb2a('0x1b')]?_0x321c52['options'][_0xcb2a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321c52['options']?_0x321c52[_0xcb2a('0x1b')][_0xcb2a('0x1f')]||null:null,'attributes':_0x321c52[_0xcb2a('0x1b')]?_0x321c52[_0xcb2a('0x1b')][_0xcb2a('0x20')]||null:null,'limit':_0x321c52[_0xcb2a('0x1b')]?_0x321c52['options'][_0xcb2a('0x21')]||null:null})[_0xcb2a('0xc')](function(_0x1b135f){logger[_0xcb2a('0xd')](_0xcb2a('0x1c'),_0x321c52);logger[_0xcb2a('0x10')](_0xcb2a('0x1c'),_0x321c52,JSON['stringify'](_0x1b135f));_0x5b73f2(_0x1b135f);})[_0xcb2a('0x16')](function(_0x5f54d0){logger[_0xcb2a('0x13')](_0xcb2a('0x1c'),_0x5f54d0[_0xcb2a('0x14')],_0x321c52);_0x5e1a84(_0x4f222f['error'](0x1f4,_0x5f54d0[_0xcb2a('0x14')]));});});}; \ No newline at end of file +var _0xb013=['error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5a0704,_0x1ada6a){var _0x345be2=function(_0x1a7022){while(--_0x1a7022){_0x5a0704['push'](_0x5a0704['shift']());}};_0x345be2(++_0x1ada6a);}(_0xb013,0x156));var _0x3b01=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xb013[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x3b01('0x0'));var util=require(_0x3b01('0x1'));var moment=require(_0x3b01('0x2'));var BPromise=require(_0x3b01('0x3'));var rs=require(_0x3b01('0x4'));var fs=require('fs');var Redis=require(_0x3b01('0x5'));var db=require(_0x3b01('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b01('0x7'))(_0x3b01('0x8'));var config=require(_0x3b01('0x9'));var jayson=require(_0x3b01('0xa'));var client=jayson[_0x3b01('0xb')][_0x3b01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4caef3,_0x1bf99a,_0x88421f){return new BPromise(function(_0x2d8861,_0x3d1e07){return client[_0x3b01('0xd')](_0x4caef3,_0x88421f)[_0x3b01('0xe')](function(_0x5efc81){logger[_0x3b01('0xf')](_0x3b01('0x10'),_0x1bf99a,_0x3b01('0x11'));logger[_0x3b01('0x12')](_0x3b01('0x13'),_0x1bf99a,_0x3b01('0x11'),JSON[_0x3b01('0x14')](_0x5efc81));if(_0x5efc81[_0x3b01('0x15')]){if(_0x5efc81['error'][_0x3b01('0x16')]===0x1f4){logger['error'](_0x3b01('0x10'),_0x1bf99a,_0x5efc81[_0x3b01('0x15')][_0x3b01('0x17')]);return _0x3d1e07(_0x5efc81[_0x3b01('0x15')][_0x3b01('0x17')]);}logger[_0x3b01('0x15')](_0x3b01('0x10'),_0x1bf99a,_0x5efc81[_0x3b01('0x15')][_0x3b01('0x17')]);return _0x2d8861(_0x5efc81['error']['message']);}else{logger['info'](_0x3b01('0x10'),_0x1bf99a,'request\x20sent');_0x2d8861(_0x5efc81['result'][_0x3b01('0x17')]);}})[_0x3b01('0x18')](function(_0x559ff3){logger['error'](_0x3b01('0x10'),_0x1bf99a,_0x559ff3);_0x3d1e07(_0x559ff3);});});}exports[_0x3b01('0x19')]=function(_0xd96be0){var _0x3ba4c7=this;return new Promise(function(_0x166a7d,_0x269c19){return db[_0x3b01('0x1a')][_0x3b01('0x1b')](_0xd96be0[_0x3b01('0x1c')],{'raw':_0xd96be0[_0x3b01('0x1d')]?_0xd96be0[_0x3b01('0x1d')][_0x3b01('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x45a088){logger['info'](_0x3b01('0x19'),_0xd96be0);logger[_0x3b01('0x12')](_0x3b01('0x19'),_0xd96be0,JSON[_0x3b01('0x14')](_0x45a088));_0x166a7d(_0x45a088);})['catch'](function(_0x2a76d1){logger[_0x3b01('0x15')](_0x3b01('0x19'),_0x2a76d1[_0x3b01('0x17')],_0xd96be0);_0x269c19(_0x3ba4c7[_0x3b01('0x15')](0x1f4,_0x2a76d1[_0x3b01('0x17')]));});});};exports['UpdateSmsQueueReport']=function(_0x56ed66){var _0x2be4f3=this;return new Promise(function(_0x3f9607,_0x26eeb8){return db['SmsQueueReport']['update'](_0x56ed66[_0x3b01('0x1c')],{'raw':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')]['where']||null:null,'attributes':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')]['attributes']||null:null,'limit':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')][_0x3b01('0x1f')]||null:null})[_0x3b01('0xe')](function(_0x2fca5c){logger[_0x3b01('0xf')](_0x3b01('0x20'),_0x56ed66);logger[_0x3b01('0x12')](_0x3b01('0x20'),_0x56ed66,JSON[_0x3b01('0x14')](_0x2fca5c));_0x3f9607(_0x2fca5c);})[_0x3b01('0x18')](function(_0xc6ddfc){logger[_0x3b01('0x15')](_0x3b01('0x20'),_0xc6ddfc[_0x3b01('0x17')],_0x56ed66);_0x26eeb8(_0x2be4f3[_0x3b01('0x15')](0x1f4,_0xc6ddfc[_0x3b01('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a438419..948cec0 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 _0x0689=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1b7ac9,_0x5c7b22){var _0x360652=function(_0xb3769b){while(--_0xb3769b){_0x1b7ac9['push'](_0x1b7ac9['shift']());}};_0x360652(++_0x5c7b22);}(_0x0689,0x161));var _0x9068=function(_0x264341,_0x30f134){_0x264341=_0x264341-0x0;var _0x5c6408=_0x0689[_0x264341];return _0x5c6408;};'use strict';var multer=require('multer');var util=require(_0x9068('0x0'));var path=require('path');var timeout=require(_0x9068('0x1'));var express=require(_0x9068('0x2'));var router=express[_0x9068('0x3')]();var fs_extra=require(_0x9068('0x4'));var auth=require(_0x9068('0x5'));var interaction=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var controller=require(_0x9068('0x8'));router[_0x9068('0x9')]('/',auth[_0x9068('0xa')](),controller['index']);router[_0x9068('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9068('0xb')]);router[_0x9068('0x9')](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0xd')]);router[_0x9068('0xe')]('/',auth[_0x9068('0xa')](),controller[_0x9068('0xf')]);router[_0x9068('0x10')]('/:id',auth[_0x9068('0xa')](),controller[_0x9068('0x11')]);router[_0x9068('0x12')](_0x9068('0xc'),auth['isAuthenticated'](),controller[_0x9068('0x13')]);module[_0x9068('0x14')]=router; \ No newline at end of file +var _0x5075=['get','isAuthenticated','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index'];(function(_0x3fc41c,_0x3b4db4){var _0x1d27fd=function(_0x3efbba){while(--_0x3efbba){_0x3fc41c['push'](_0x3fc41c['shift']());}};_0x1d27fd(++_0x3b4db4);}(_0x5075,0x73));var _0x5507=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x5075[_0x1b745b];return _0x120a9d;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5507('0xa')]);router[_0x5507('0xb')]('/describe',auth[_0x5507('0xc')](),controller[_0x5507('0xd')]);router[_0x5507('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')]('/',auth[_0x5507('0xc')](),controller[_0x5507('0x10')]);router['put'](_0x5507('0x11'),auth[_0x5507('0xc')](),controller['update']);router[_0x5507('0x12')](_0x5507('0x11'),auth['isAuthenticated'](),controller[_0x5507('0x13')]);module[_0x5507('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8b6f1a3..5eaf8f2 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4ad871,_0x4343f3){var _0x20344f=function(_0x4c2777){while(--_0x4c2777){_0x4ad871['push'](_0x4ad871['shift']());}};_0x20344f(++_0x4343f3);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x49369e,_0x3777d8){var _0x22d7c3=function(_0x3855cd){while(--_0x3855cd){_0x49369e['push'](_0x49369e['shift']());}};_0x22d7c3(++_0x3777d8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x00bb[_0x46aff0];return _0x9d78cf;};'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 a9f4088..01bdec0 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 _0xbc4e=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','then','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x1d91fb,_0x19df73){var _0x41023d=function(_0x12f803){while(--_0x12f803){_0x1d91fb['push'](_0x1d91fb['shift']());}};_0x41023d(++_0x19df73);}(_0xbc4e,0x1c4));var _0xebc4=function(_0x1cf601,_0x2f6a7e){_0x1cf601=_0x1cf601-0x0;var _0x2bc79f=_0xbc4e[_0x1cf601];return _0x2bc79f;};'use strict';var emlformat=require(_0xebc4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebc4('0x1'));var jsonpatch=require(_0xebc4('0x2'));var rp=require(_0xebc4('0x3'));var moment=require(_0xebc4('0x4'));var BPromise=require(_0xebc4('0x5'));var Mustache=require(_0xebc4('0x6'));var util=require(_0xebc4('0x7'));var path=require('path');var sox=require(_0xebc4('0x8'));var csv=require(_0xebc4('0x9'));var ejs=require(_0xebc4('0xa'));var fs=require('fs');var fs_extra=require(_0xebc4('0xb'));var _=require(_0xebc4('0xc'));var squel=require(_0xebc4('0xd'));var crypto=require('crypto');var jsforce=require(_0xebc4('0xe'));var deskjs=require(_0xebc4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xebc4('0x10'));var Papa=require(_0xebc4('0x11'));var Redis=require(_0xebc4('0x12'));var authService=require(_0xebc4('0x13'));var qs=require(_0xebc4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebc4('0x15'));var logger=require(_0xebc4('0x16'))(_0xebc4('0x17'));var utils=require(_0xebc4('0x18'));var config=require(_0xebc4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xebc4('0x1a'))['db'];function respondWithStatusCode(_0x2cadd9,_0x1c52ef){_0x1c52ef=_0x1c52ef||0xcc;return function(_0x2d054f){if(_0x2d054f){return _0x2cadd9[_0xebc4('0x1b')](_0x1c52ef);}return _0x2cadd9[_0xebc4('0x1c')](_0x1c52ef)[_0xebc4('0x1d')]();};}function respondWithResult(_0x1fe9d8,_0x17c913){_0x17c913=_0x17c913||0xc8;return function(_0x5924aa){if(_0x5924aa){return _0x1fe9d8[_0xebc4('0x1c')](_0x17c913)[_0xebc4('0x1e')](_0x5924aa);}};}function respondWithFilteredResult(_0x5cf653,_0x451f09){return function(_0x4e5a5e){if(_0x4e5a5e){var _0x565c25=typeof _0x451f09[_0xebc4('0x1f')]===_0xebc4('0x20')&&typeof _0x451f09[_0xebc4('0x21')]==='undefined';var _0x1276ae=_0x4e5a5e[_0xebc4('0x22')];var _0x2d7c08=_0x565c25?0x0:_0x451f09[_0xebc4('0x1f')];var _0x256a83=_0x565c25?_0x4e5a5e[_0xebc4('0x22')]:_0x451f09['offset']+_0x451f09[_0xebc4('0x21')];var _0x427389;if(_0x256a83>=_0x1276ae){_0x256a83=_0x1276ae;_0x427389=0xc8;}else{_0x427389=0xce;}_0x5cf653[_0xebc4('0x1c')](_0x427389);return _0x5cf653[_0xebc4('0x23')](_0xebc4('0x24'),_0x2d7c08+'-'+_0x256a83+'/'+_0x1276ae)['json'](_0x4e5a5e);}return null;};}function patchUpdates(_0x1f4c0f){return function(_0x53d2c8){try{jsonpatch['apply'](_0x53d2c8,_0x1f4c0f,!![]);}catch(_0x1be6f3){return BPromise[_0xebc4('0x25')](_0x1be6f3);}return _0x53d2c8[_0xebc4('0x26')]();};}function saveUpdates(_0x5dde50,_0x3b5cf9){return function(_0x13c416){if(_0x13c416){return _0x13c416[_0xebc4('0x27')](_0x5dde50)['then'](function(_0x3d7e72){return _0x3d7e72;});}return null;};}function removeEntity(_0xec98fa,_0x81d8df){return function(_0x4af986){if(_0x4af986){return _0x4af986[_0xebc4('0x28')]()['then'](function(){_0xec98fa[_0xebc4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f5c26,_0x2f785b){return function(_0x1254fa){if(!_0x1254fa){_0x5f5c26[_0xebc4('0x1b')](0x194);}return _0x1254fa;};}function handleError(_0x28bb6b,_0x4082d0){_0x4082d0=_0x4082d0||0x1f4;return function(_0x38665e){logger[_0xebc4('0x29')](_0x38665e['stack']);if(_0x38665e[_0xebc4('0x2a')]){delete _0x38665e[_0xebc4('0x2a')];}_0x28bb6b['status'](_0x4082d0)[_0xebc4('0x2b')](_0x38665e);};}exports[_0xebc4('0x2c')]=function(_0x1bb639,_0x51a03f){var _0x45f207={},_0x2c1a06={},_0x3e94c9={'count':0x0,'rows':[]};var _0x2cd14b=_[_0xebc4('0x2d')](db[_0xebc4('0x2e')][_0xebc4('0x2f')],function(_0x1fa023){return{'name':_0x1fa023[_0xebc4('0x30')],'type':_0x1fa023[_0xebc4('0x31')]['key']};});_0x2c1a06[_0xebc4('0x32')]=_[_0xebc4('0x2d')](_0x2cd14b,_0xebc4('0x2a'));_0x2c1a06['query']=_[_0xebc4('0x33')](_0x1bb639[_0xebc4('0x34')]);_0x2c1a06[_0xebc4('0x35')]=_[_0xebc4('0x36')](_0x2c1a06[_0xebc4('0x32')],_0x2c1a06['query']);_0x45f207[_0xebc4('0x37')]=_['intersection'](_0x2c1a06['model'],qs['fields'](_0x1bb639['query'][_0xebc4('0x38')]));_0x45f207[_0xebc4('0x37')]=_0x45f207['attributes'][_0xebc4('0x39')]?_0x45f207['attributes']:_0x2c1a06[_0xebc4('0x32')];if(!_0x1bb639['query'][_0xebc4('0x3a')](_0xebc4('0x3b'))){_0x45f207[_0xebc4('0x21')]=qs[_0xebc4('0x21')](_0x1bb639[_0xebc4('0x34')][_0xebc4('0x21')]);_0x45f207['offset']=qs['offset'](_0x1bb639['query'][_0xebc4('0x1f')]);}_0x45f207['order']=qs['sort'](_0x1bb639['query'][_0xebc4('0x3c')]);_0x45f207[_0xebc4('0x3d')]=qs['filters'](_['pick'](_0x1bb639[_0xebc4('0x34')],_0x2c1a06['filters']),_0x2cd14b);if(_0x1bb639[_0xebc4('0x34')][_0xebc4('0x3e')]){_0x45f207[_0xebc4('0x3d')]=_[_0xebc4('0x3f')](_0x45f207[_0xebc4('0x3d')],{'$or':_[_0xebc4('0x2d')](_0x2cd14b,function(_0x22bb0c){if(_0x22bb0c[_0xebc4('0x31')]!==_0xebc4('0x40')){var _0x579b62={};_0x579b62[_0x22bb0c[_0xebc4('0x2a')]]={'$like':'%'+_0x1bb639[_0xebc4('0x34')][_0xebc4('0x3e')]+'%'};return _0x579b62;}})});}_0x45f207=_['merge']({},_0x45f207,_0x1bb639['options']);var _0x11639d={'where':_0x45f207[_0xebc4('0x3d')]};return db[_0xebc4('0x2e')][_0xebc4('0x22')](_0x11639d)[_0xebc4('0x41')](function(_0x24e1ec){_0x3e94c9['count']=_0x24e1ec;if(_0x1bb639[_0xebc4('0x34')][_0xebc4('0x42')]){_0x45f207['include']=[{'all':!![]}];}return db[_0xebc4('0x2e')]['findAll'](_0x45f207);})[_0xebc4('0x41')](function(_0x4d0aa1){_0x3e94c9[_0xebc4('0x43')]=_0x4d0aa1;return _0x3e94c9;})[_0xebc4('0x41')](respondWithFilteredResult(_0x51a03f,_0x45f207))[_0xebc4('0x44')](handleError(_0x51a03f,null));};exports[_0xebc4('0x45')]=function(_0x441f07,_0xaf8297){var _0x487fe0={'raw':!![],'where':{'id':_0x441f07[_0xebc4('0x46')]['id']}},_0x51629e={};_0x51629e[_0xebc4('0x32')]=_[_0xebc4('0x33')](db[_0xebc4('0x2e')][_0xebc4('0x2f')]);_0x51629e[_0xebc4('0x34')]=_[_0xebc4('0x33')](_0x441f07[_0xebc4('0x34')]);_0x51629e[_0xebc4('0x35')]=_[_0xebc4('0x36')](_0x51629e[_0xebc4('0x32')],_0x51629e[_0xebc4('0x34')]);_0x487fe0['attributes']=_[_0xebc4('0x36')](_0x51629e[_0xebc4('0x32')],qs['fields'](_0x441f07['query']['fields']));_0x487fe0[_0xebc4('0x37')]=_0x487fe0[_0xebc4('0x37')][_0xebc4('0x39')]?_0x487fe0[_0xebc4('0x37')]:_0x51629e[_0xebc4('0x32')];if(_0x441f07[_0xebc4('0x34')]['includeAll']){_0x487fe0[_0xebc4('0x47')]=[{'all':!![]}];}_0x487fe0=_[_0xebc4('0x3f')]({},_0x487fe0,_0x441f07[_0xebc4('0x48')]);return db[_0xebc4('0x2e')][_0xebc4('0x49')](_0x487fe0)[_0xebc4('0x41')](handleEntityNotFound(_0xaf8297,null))['then'](respondWithResult(_0xaf8297,null))[_0xebc4('0x44')](handleError(_0xaf8297,null));};exports[_0xebc4('0x4a')]=function(_0x322321,_0x4f24f0){return db['SmsTransferReport'][_0xebc4('0x4a')](_0x322321[_0xebc4('0x4b')],{})[_0xebc4('0x41')](respondWithResult(_0x4f24f0,0xc9))['catch'](handleError(_0x4f24f0,null));};exports[_0xebc4('0x27')]=function(_0x1de62e,_0x20dbf4){if(_0x1de62e[_0xebc4('0x4b')]['id']){delete _0x1de62e[_0xebc4('0x4b')]['id'];}return db[_0xebc4('0x2e')][_0xebc4('0x49')]({'where':{'id':_0x1de62e[_0xebc4('0x46')]['id']}})['then'](handleEntityNotFound(_0x20dbf4,null))[_0xebc4('0x41')](saveUpdates(_0x1de62e[_0xebc4('0x4b')],null))[_0xebc4('0x41')](respondWithResult(_0x20dbf4,null))['catch'](handleError(_0x20dbf4,null));};exports['destroy']=function(_0x320a1f,_0x3ffcfd){return db['SmsTransferReport'][_0xebc4('0x49')]({'where':{'id':_0x320a1f[_0xebc4('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ffcfd,null))[_0xebc4('0x41')](removeEntity(_0x3ffcfd,null))[_0xebc4('0x44')](handleError(_0x3ffcfd,null));};exports[_0xebc4('0x4c')]=function(_0x119f74,_0x1d51b6){return db[_0xebc4('0x2e')][_0xebc4('0x4c')]()[_0xebc4('0x41')](respondWithResult(_0x1d51b6,null))[_0xebc4('0x44')](handleError(_0x1d51b6,null));}; \ No newline at end of file +var _0x079d=['where','pick','filter','merge','VIRTUAL','includeAll','catch','show','keys','rawAttributes','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x079d,0xa6));var _0xd079=function(_0x4a7dec,_0x5f4581){_0x4a7dec=_0x4a7dec-0x0;var _0x188634=_0x079d[_0x4a7dec];return _0x188634;};'use strict';var emlformat=require(_0xd079('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd079('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd079('0x2'));var moment=require(_0xd079('0x3'));var BPromise=require(_0xd079('0x4'));var Mustache=require(_0xd079('0x5'));var util=require('util');var path=require(_0xd079('0x6'));var sox=require(_0xd079('0x7'));var csv=require(_0xd079('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd079('0x9'));var _=require(_0xd079('0xa'));var squel=require('squel');var crypto=require(_0xd079('0xb'));var jsforce=require(_0xd079('0xc'));var deskjs=require(_0xd079('0xd'));var toCsv=require(_0xd079('0x8'));var querystring=require(_0xd079('0xe'));var Papa=require(_0xd079('0xf'));var Redis=require(_0xd079('0x10'));var authService=require(_0xd079('0x11'));var qs=require(_0xd079('0x12'));var as=require(_0xd079('0x13'));var hardwareService=require(_0xd079('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd079('0x15'));var licenseUtil=require(_0xd079('0x16'));var db=require(_0xd079('0x17'))['db'];function respondWithStatusCode(_0x495036,_0x2c5e5f){_0x2c5e5f=_0x2c5e5f||0xcc;return function(_0x30890b){if(_0x30890b){return _0x495036[_0xd079('0x18')](_0x2c5e5f);}return _0x495036['status'](_0x2c5e5f)[_0xd079('0x19')]();};}function respondWithResult(_0x28f95a,_0x547c03){_0x547c03=_0x547c03||0xc8;return function(_0x5b6ea1){if(_0x5b6ea1){return _0x28f95a[_0xd079('0x1a')](_0x547c03)[_0xd079('0x1b')](_0x5b6ea1);}};}function respondWithFilteredResult(_0x57d92e,_0x1f997b){return function(_0x331465){if(_0x331465){var _0x1e5627=typeof _0x1f997b[_0xd079('0x1c')]===_0xd079('0x1d')&&typeof _0x1f997b[_0xd079('0x1e')]===_0xd079('0x1d');var _0x1ce7b5=_0x331465[_0xd079('0x1f')];var _0x44974a=_0x1e5627?0x0:_0x1f997b['offset'];var _0x35d97f=_0x1e5627?_0x331465[_0xd079('0x1f')]:_0x1f997b[_0xd079('0x1c')]+_0x1f997b[_0xd079('0x1e')];var _0x166bcc;if(_0x35d97f>=_0x1ce7b5){_0x35d97f=_0x1ce7b5;_0x166bcc=0xc8;}else{_0x166bcc=0xce;}_0x57d92e[_0xd079('0x1a')](_0x166bcc);return _0x57d92e[_0xd079('0x20')](_0xd079('0x21'),_0x44974a+'-'+_0x35d97f+'/'+_0x1ce7b5)['json'](_0x331465);}return null;};}function patchUpdates(_0x2330b6){return function(_0x39bec5){try{jsonpatch[_0xd079('0x22')](_0x39bec5,_0x2330b6,!![]);}catch(_0x35ee15){return BPromise[_0xd079('0x23')](_0x35ee15);}return _0x39bec5[_0xd079('0x24')]();};}function saveUpdates(_0x43399b,_0x54e96e){return function(_0x56fc59){if(_0x56fc59){return _0x56fc59[_0xd079('0x25')](_0x43399b)[_0xd079('0x26')](function(_0x287c95){return _0x287c95;});}return null;};}function removeEntity(_0x36f984,_0x277fe4){return function(_0x404f60){if(_0x404f60){return _0x404f60[_0xd079('0x27')]()[_0xd079('0x26')](function(){_0x36f984[_0xd079('0x1a')](0xcc)[_0xd079('0x19')]();});}};}function handleEntityNotFound(_0x56d08c,_0x2261ba){return function(_0x580a42){if(!_0x580a42){_0x56d08c[_0xd079('0x18')](0x194);}return _0x580a42;};}function handleError(_0x1cd72c,_0x5945e0){_0x5945e0=_0x5945e0||0x1f4;return function(_0x56ec57){logger[_0xd079('0x28')](_0x56ec57[_0xd079('0x29')]);if(_0x56ec57[_0xd079('0x2a')]){delete _0x56ec57['name'];}_0x1cd72c['status'](_0x5945e0)[_0xd079('0x2b')](_0x56ec57);};}exports[_0xd079('0x2c')]=function(_0x4ebbee,_0x551547){var _0x14ce47={},_0x3c6830={},_0x1dfc6e={'count':0x0,'rows':[]};var _0x4f2a42=_[_0xd079('0x2d')](db[_0xd079('0x2e')]['rawAttributes'],function(_0x358ca5){return{'name':_0x358ca5[_0xd079('0x2f')],'type':_0x358ca5[_0xd079('0x30')]['key']};});_0x3c6830[_0xd079('0x31')]=_[_0xd079('0x2d')](_0x4f2a42,_0xd079('0x2a'));_0x3c6830['query']=_['keys'](_0x4ebbee[_0xd079('0x32')]);_0x3c6830[_0xd079('0x33')]=_['intersection'](_0x3c6830['model'],_0x3c6830[_0xd079('0x32')]);_0x14ce47[_0xd079('0x34')]=_[_0xd079('0x35')](_0x3c6830[_0xd079('0x31')],qs[_0xd079('0x36')](_0x4ebbee[_0xd079('0x32')]['fields']));_0x14ce47[_0xd079('0x34')]=_0x14ce47[_0xd079('0x34')]['length']?_0x14ce47[_0xd079('0x34')]:_0x3c6830['model'];if(!_0x4ebbee['query'][_0xd079('0x37')](_0xd079('0x38'))){_0x14ce47['limit']=qs['limit'](_0x4ebbee[_0xd079('0x32')][_0xd079('0x1e')]);_0x14ce47[_0xd079('0x1c')]=qs['offset'](_0x4ebbee[_0xd079('0x32')][_0xd079('0x1c')]);}_0x14ce47[_0xd079('0x39')]=qs['sort'](_0x4ebbee['query'][_0xd079('0x3a')]);_0x14ce47[_0xd079('0x3b')]=qs[_0xd079('0x33')](_[_0xd079('0x3c')](_0x4ebbee[_0xd079('0x32')],_0x3c6830[_0xd079('0x33')]),_0x4f2a42);if(_0x4ebbee[_0xd079('0x32')][_0xd079('0x3d')]){_0x14ce47[_0xd079('0x3b')]=_[_0xd079('0x3e')](_0x14ce47[_0xd079('0x3b')],{'$or':_[_0xd079('0x2d')](_0x4f2a42,function(_0x2df2a3){if(_0x2df2a3[_0xd079('0x30')]!==_0xd079('0x3f')){var _0x3fd719={};_0x3fd719[_0x2df2a3[_0xd079('0x2a')]]={'$like':'%'+_0x4ebbee[_0xd079('0x32')][_0xd079('0x3d')]+'%'};return _0x3fd719;}})});}_0x14ce47=_['merge']({},_0x14ce47,_0x4ebbee['options']);var _0x4cc443={'where':_0x14ce47[_0xd079('0x3b')]};return db['SmsTransferReport']['count'](_0x4cc443)[_0xd079('0x26')](function(_0x20dd5a){_0x1dfc6e[_0xd079('0x1f')]=_0x20dd5a;if(_0x4ebbee[_0xd079('0x32')][_0xd079('0x40')]){_0x14ce47['include']=[{'all':!![]}];}return db[_0xd079('0x2e')]['findAll'](_0x14ce47);})[_0xd079('0x26')](function(_0x58eaca){_0x1dfc6e['rows']=_0x58eaca;return _0x1dfc6e;})[_0xd079('0x26')](respondWithFilteredResult(_0x551547,_0x14ce47))[_0xd079('0x41')](handleError(_0x551547,null));};exports[_0xd079('0x42')]=function(_0x151ccf,_0x5bf5b0){var _0x4a3565={'raw':!![],'where':{'id':_0x151ccf['params']['id']}},_0x1db308={};_0x1db308[_0xd079('0x31')]=_[_0xd079('0x43')](db[_0xd079('0x2e')][_0xd079('0x44')]);_0x1db308[_0xd079('0x32')]=_[_0xd079('0x43')](_0x151ccf[_0xd079('0x32')]);_0x1db308[_0xd079('0x33')]=_[_0xd079('0x35')](_0x1db308['model'],_0x1db308['query']);_0x4a3565[_0xd079('0x34')]=_[_0xd079('0x35')](_0x1db308[_0xd079('0x31')],qs[_0xd079('0x36')](_0x151ccf[_0xd079('0x32')]['fields']));_0x4a3565[_0xd079('0x34')]=_0x4a3565[_0xd079('0x34')]['length']?_0x4a3565[_0xd079('0x34')]:_0x1db308[_0xd079('0x31')];if(_0x151ccf[_0xd079('0x32')][_0xd079('0x40')]){_0x4a3565[_0xd079('0x45')]=[{'all':!![]}];}_0x4a3565=_['merge']({},_0x4a3565,_0x151ccf['options']);return db['SmsTransferReport'][_0xd079('0x46')](_0x4a3565)[_0xd079('0x26')](handleEntityNotFound(_0x5bf5b0,null))[_0xd079('0x26')](respondWithResult(_0x5bf5b0,null))[_0xd079('0x41')](handleError(_0x5bf5b0,null));};exports[_0xd079('0x47')]=function(_0x2833e4,_0x47a48d){return db['SmsTransferReport']['create'](_0x2833e4[_0xd079('0x48')],{})['then'](respondWithResult(_0x47a48d,0xc9))[_0xd079('0x41')](handleError(_0x47a48d,null));};exports[_0xd079('0x25')]=function(_0x4b40c5,_0x485023){if(_0x4b40c5[_0xd079('0x48')]['id']){delete _0x4b40c5['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x4b40c5[_0xd079('0x49')]['id']}})[_0xd079('0x26')](handleEntityNotFound(_0x485023,null))[_0xd079('0x26')](saveUpdates(_0x4b40c5[_0xd079('0x48')],null))[_0xd079('0x26')](respondWithResult(_0x485023,null))[_0xd079('0x41')](handleError(_0x485023,null));};exports[_0xd079('0x27')]=function(_0x10b1e0,_0x337892){return db[_0xd079('0x2e')]['find']({'where':{'id':_0x10b1e0[_0xd079('0x49')]['id']}})['then'](handleEntityNotFound(_0x337892,null))[_0xd079('0x26')](removeEntity(_0x337892,null))['catch'](handleError(_0x337892,null));};exports[_0xd079('0x4a')]=function(_0x222331,_0x2d322a){return db[_0xd079('0x2e')][_0xd079('0x4a')]()[_0xd079('0x26')](respondWithResult(_0x2d322a,null))[_0xd079('0x41')](handleError(_0x2d322a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 84b994d..ca4eef3 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 _0xed1f=['request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xed1f,0x6a));var _0xfed1=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xed1f[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[{'name':_0xfed1('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fc=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','define','report_sms_transfer','uniqueid'];(function(_0x3ddd35,_0x723b){var _0x457c35=function(_0x2285b5){while(--_0x2285b5){_0x3ddd35['push'](_0x3ddd35['shift']());}};_0x457c35(++_0x723b);}(_0xb1fc,0x78));var _0xcb1f=function(_0x7f7e71,_0x546848){_0x7f7e71=_0x7f7e71-0x0;var _0x381571=_0xb1fc[_0x7f7e71];return _0x381571;};'use strict';var _=require(_0xcb1f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcb1f('0x1'));var BPromise=require(_0xcb1f('0x2'));var rp=require(_0xcb1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb1f('0x4'));var config=require(_0xcb1f('0x5'));var attributes=require(_0xcb1f('0x6'));module['exports']=function(_0x58f32c,_0x2d450b){return _0x58f32c[_0xcb1f('0x7')]('SmsTransferReport',attributes,{'tableName':_0xcb1f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcb1f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index ceae2a5..5865b90 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 _0xdbd0=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x22c08b,_0x5ef5f0){var _0x439d18=function(_0x1c757f){while(--_0x1c757f){_0x22c08b['push'](_0x22c08b['shift']());}};_0x439d18(++_0x5ef5f0);}(_0xdbd0,0x88));var _0x0dbd=function(_0x2c7a35,_0x27d546){_0x2c7a35=_0x2c7a35-0x0;var _0x1a6ba1=_0xdbd0[_0x2c7a35];return _0x1a6ba1;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var moment=require(_0x0dbd('0x2'));var BPromise=require(_0x0dbd('0x3'));var rs=require(_0x0dbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dbd('0x5'))['db'];var utils=require(_0x0dbd('0x6'));var logger=require(_0x0dbd('0x7'))('rpc');var config=require(_0x0dbd('0x8'));var jayson=require(_0x0dbd('0x9'));var client=jayson[_0x0dbd('0xa')][_0x0dbd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b653b,_0x47e742,_0xcb72c2){return new BPromise(function(_0x3b3f21,_0x1a957e){return client[_0x0dbd('0xc')](_0x4b653b,_0xcb72c2)[_0x0dbd('0xd')](function(_0x453836){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x47e742,_0x0dbd('0xe'));logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0x47e742,_0x0dbd('0xe'),JSON[_0x0dbd('0x11')](_0x453836));if(_0x453836[_0x0dbd('0x12')]){if(_0x453836[_0x0dbd('0x12')][_0x0dbd('0x13')]===0x1f4){logger['error'](_0x0dbd('0x14'),_0x47e742,_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);return _0x1a957e(_0x453836['error'][_0x0dbd('0x15')]);}logger[_0x0dbd('0x12')](_0x0dbd('0x14'),_0x47e742,_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);return _0x3b3f21(_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);}else{logger[_0x0dbd('0x16')](_0x0dbd('0x14'),_0x47e742,'request\x20sent');_0x3b3f21(_0x453836['result'][_0x0dbd('0x15')]);}})[_0x0dbd('0x17')](function(_0x5b2a34){logger[_0x0dbd('0x12')](_0x0dbd('0x14'),_0x47e742,_0x5b2a34);_0x1a957e(_0x5b2a34);});});} \ No newline at end of file +var _0x4b19=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b2f90,_0x2dff29){var _0x21864c=function(_0x4467cb){while(--_0x4467cb){_0x3b2f90['push'](_0x3b2f90['shift']());}};_0x21864c(++_0x2dff29);}(_0x4b19,0x195));var _0x94b1=function(_0x1c0e80,_0x31928e){_0x1c0e80=_0x1c0e80-0x0;var _0x39ce51=_0x4b19[_0x1c0e80];return _0x39ce51;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var moment=require(_0x94b1('0x1'));var BPromise=require(_0x94b1('0x2'));var rs=require(_0x94b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b1('0x4'))['db'];var utils=require(_0x94b1('0x5'));var logger=require(_0x94b1('0x6'))('rpc');var config=require(_0x94b1('0x7'));var jayson=require(_0x94b1('0x8'));var client=jayson['client'][_0x94b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110a52,_0x4ea1f9,_0x40c69c){return new BPromise(function(_0x201a02,_0xad0a85){return client['request'](_0x110a52,_0x40c69c)[_0x94b1('0xa')](function(_0x4f948b){logger['info'](_0x94b1('0xb'),_0x4ea1f9,_0x94b1('0xc'));logger[_0x94b1('0xd')](_0x94b1('0xe'),_0x4ea1f9,_0x94b1('0xc'),JSON[_0x94b1('0xf')](_0x4f948b));if(_0x4f948b['error']){if(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x11')]===0x1f4){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x4f948b['error']['message']);return _0xad0a85(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4ea1f9,_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);return _0x201a02(_0x4f948b['error'][_0x94b1('0x12')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4ea1f9,_0x94b1('0xc'));_0x201a02(_0x4f948b[_0x94b1('0x13')][_0x94b1('0x12')]);}})[_0x94b1('0x14')](function(_0x494138){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x494138);_0xad0a85(_0x494138);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index a0ec28f..f038ec7 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 _0x981c=['/:id','/:id/download','download','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','single','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index'];(function(_0x41fa6f,_0x2e3f69){var _0xa8f0c6=function(_0x3f5a82){while(--_0x3f5a82){_0x41fa6f['push'](_0x41fa6f['shift']());}};_0xa8f0c6(++_0x2e3f69);}(_0x981c,0x11f));var _0xc981=function(_0x57f5ca,_0x2643d0){_0x57f5ca=_0x57f5ca-0x0;var _0x4952dd=_0x981c[_0x57f5ca];return _0x4952dd;};'use strict';var multer=require(_0xc981('0x0'));var util=require(_0xc981('0x1'));var path=require(_0xc981('0x2'));var timeout=require(_0xc981('0x3'));var express=require(_0xc981('0x4'));var router=express[_0xc981('0x5')]();var fs_extra=require(_0xc981('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xc981('0x7')]('/',auth[_0xc981('0x8')](),controller[_0xc981('0x9')]);router[_0xc981('0x7')](_0xc981('0xa'),auth[_0xc981('0x8')](),controller['show']);router[_0xc981('0x7')](_0xc981('0xb'),auth[_0xc981('0x8')](),controller[_0xc981('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42db1c,_0x1b1bb1,_0x585b1b){_0x585b1b(null,path[_0xc981('0xd')](config[_0xc981('0xe')],'server/files/sounds/original/'));},'filename':function(_0x4e45e8,_0x4456a4,_0x233faf){_0x4456a4[_0xc981('0xf')]=_0x4456a4['originalname'][_0xc981('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x233faf(null,util[_0xc981('0x11')](_0xc981('0x12'),path[_0xc981('0x13')](_0x4456a4[_0xc981('0xf')],path[_0xc981('0x14')](_0x4456a4[_0xc981('0xf')])),Date[_0xc981('0x15')](),path['extname'](_0x4456a4[_0xc981('0xf')])));}})});router['post']('/',upload[_0xc981('0x16')]('file'),controller[_0xc981('0x17')]);router['put'](_0xc981('0xa'),auth['isAuthenticated'](),controller[_0xc981('0x18')]);router[_0xc981('0x19')]('/:id',auth[_0xc981('0x8')](),controller[_0xc981('0x19')]);module[_0xc981('0x1a')]=router; \ No newline at end of file +var _0x118f=['join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','file','create','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage'];(function(_0x27c99a,_0x46adc6){var _0x1653d3=function(_0x5d7afb){while(--_0x5d7afb){_0x27c99a['push'](_0x27c99a['shift']());}};_0x1653d3(++_0x46adc6);}(_0x118f,0xc2));var _0xf118=function(_0x2c6147,_0x30daee){_0x2c6147=_0x2c6147-0x0;var _0x4bdee8=_0x118f[_0x2c6147];return _0x4bdee8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf118('0x0'));var timeout=require(_0xf118('0x1'));var express=require(_0xf118('0x2'));var router=express[_0xf118('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf118('0x4'));var interaction=require(_0xf118('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xf118('0x6')]('/',auth['isAuthenticated'](),controller[_0xf118('0x7')]);router[_0xf118('0x6')](_0xf118('0x8'),auth[_0xf118('0x9')](),controller[_0xf118('0xa')]);router[_0xf118('0x6')](_0xf118('0xb'),auth[_0xf118('0x9')](),controller[_0xf118('0xc')]);var upload=multer({'storage':multer[_0xf118('0xd')]({'destination':function(_0x3905d0,_0x557693,_0x417801){_0x417801(null,path[_0xf118('0xe')](config['root'],_0xf118('0xf')));},'filename':function(_0x3479dd,_0x4053d0,_0x4f7804){_0x4053d0[_0xf118('0x10')]=_0x4053d0[_0xf118('0x10')][_0xf118('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f7804(null,util[_0xf118('0x12')](_0xf118('0x13'),path[_0xf118('0x14')](_0x4053d0[_0xf118('0x10')],path[_0xf118('0x15')](_0x4053d0['originalname'])),Date['now'](),path[_0xf118('0x15')](_0x4053d0['originalname'])));}})});router[_0xf118('0x16')]('/',upload['single'](_0xf118('0x17')),controller[_0xf118('0x18')]);router['put']('/:id',auth[_0xf118('0x9')](),controller['update']);router[_0xf118('0x19')](_0xf118('0x8'),auth[_0xf118('0x9')](),controller[_0xf118('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c44bd1f..74f60fe 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 _0x645f=['BIGINT','INTEGER','exports','name','STRING'];(function(_0x348a56,_0x4699ca){var _0x6d783=function(_0x3d1141){while(--_0x3d1141){_0x348a56['push'](_0x348a56['shift']());}};_0x6d783(++_0x4699ca);}(_0x645f,0xcf));var _0xf645=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x645f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xf645('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf645('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf645('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf645('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xf645('0x3')]},'original_channelCount':{'type':Sequelize[_0xf645('0x4')]},'original_bitRate':{'type':Sequelize[_0xf645('0x3')]},'original_sampleRate':{'type':Sequelize[_0xf645('0x4')]},'converted_format':{'type':Sequelize[_0xf645('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xf645('0x3')]},'converted_channelCount':{'type':Sequelize[_0xf645('0x4')]},'converted_bitRate':{'type':Sequelize[_0xf645('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xf645('0x4')]}}; \ No newline at end of file +var _0xcc60=['exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0xbc90df,_0x47a814){var _0x4b3cd2=function(_0x40278f){while(--_0x40278f){_0xbc90df['push'](_0xbc90df['shift']());}};_0x4b3cd2(++_0x47a814);}(_0xcc60,0x127));var _0x0cc6=function(_0x2b63db,_0x217456){_0x2b63db=_0x2b63db-0x0;var _0x174778=_0xcc60[_0x2b63db];return _0x174778;};'use strict';var Sequelize=require('sequelize');module[_0x0cc6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x0cc6('0x1')]},'display_name':{'type':Sequelize[_0x0cc6('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x0cc6('0x1')]},'original_format':{'type':Sequelize[_0x0cc6('0x1')]},'original_duration':{'type':Sequelize[_0x0cc6('0x2')]},'original_sampleCount':{'type':Sequelize[_0x0cc6('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x0cc6('0x3')]},'original_sampleRate':{'type':Sequelize[_0x0cc6('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x0cc6('0x3')]},'converted_channelCount':{'type':Sequelize[_0x0cc6('0x4')]},'converted_bitRate':{'type':Sequelize[_0x0cc6('0x3')]},'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 184c6c2..5436226 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 _0x3303=['wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','duration','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','channelCount','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','start','pick','delete','server/files/sounds/original','save_name','original_format','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','stack','name','send','index','map','Sound','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','model','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','length','options','find','download','converted_format','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','file','extname','originalname','basename','filename','substring'];(function(_0x15f869,_0x2e1e44){var _0x28d62d=function(_0x45b5c9){while(--_0x45b5c9){_0x15f869['push'](_0x15f869['shift']());}};_0x28d62d(++_0x2e1e44);}(_0x3303,0x119));var _0x3330=function(_0x359c8a,_0x44c349){_0x359c8a=_0x359c8a-0x0;var _0x291a2c=_0x3303[_0x359c8a];return _0x291a2c;};'use strict';var emlformat=require(_0x3330('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3330('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3330('0x2'));var moment=require('moment');var BPromise=require(_0x3330('0x3'));var Mustache=require(_0x3330('0x4'));var util=require(_0x3330('0x5'));var path=require(_0x3330('0x6'));var sox=require(_0x3330('0x7'));var csv=require('to-csv');var ejs=require(_0x3330('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3330('0x9'));var squel=require('squel');var crypto=require(_0x3330('0xa'));var jsforce=require(_0x3330('0xb'));var deskjs=require(_0x3330('0xc'));var toCsv=require(_0x3330('0xd'));var querystring=require(_0x3330('0xe'));var Papa=require('papaparse');var Redis=require(_0x3330('0xf'));var authService=require(_0x3330('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3330('0x11'));var hardwareService=require(_0x3330('0x12'));var logger=require(_0x3330('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3330('0x14'));var licenseUtil=require(_0x3330('0x15'));var db=require(_0x3330('0x16'))['db'];function respondWithStatusCode(_0x3fc794,_0x291ad9){_0x291ad9=_0x291ad9||0xcc;return function(_0x16441c){if(_0x16441c){return _0x3fc794['sendStatus'](_0x291ad9);}return _0x3fc794['status'](_0x291ad9)[_0x3330('0x17')]();};}function respondWithResult(_0x6631a6,_0x43e146){_0x43e146=_0x43e146||0xc8;return function(_0x5aa2f0){if(_0x5aa2f0){return _0x6631a6[_0x3330('0x18')](_0x43e146)[_0x3330('0x19')](_0x5aa2f0);}};}function respondWithFilteredResult(_0x2e398e,_0x14424d){return function(_0x10316a){if(_0x10316a){var _0x43ef2d=typeof _0x14424d[_0x3330('0x1a')]===_0x3330('0x1b')&&typeof _0x14424d[_0x3330('0x1c')]===_0x3330('0x1b');var _0x2019fc=_0x10316a[_0x3330('0x1d')];var _0x5db72b=_0x43ef2d?0x0:_0x14424d['offset'];var _0x3ec668=_0x43ef2d?_0x10316a['count']:_0x14424d[_0x3330('0x1a')]+_0x14424d[_0x3330('0x1c')];var _0xf00f19;if(_0x3ec668>=_0x2019fc){_0x3ec668=_0x2019fc;_0xf00f19=0xc8;}else{_0xf00f19=0xce;}_0x2e398e['status'](_0xf00f19);return _0x2e398e[_0x3330('0x1e')](_0x3330('0x1f'),_0x5db72b+'-'+_0x3ec668+'/'+_0x2019fc)[_0x3330('0x19')](_0x10316a);}return null;};}function patchUpdates(_0x42d15c){return function(_0x3524eb){try{jsonpatch['apply'](_0x3524eb,_0x42d15c,!![]);}catch(_0x256245){return BPromise[_0x3330('0x20')](_0x256245);}return _0x3524eb[_0x3330('0x21')]();};}function saveUpdates(_0x3ea564,_0x3043f2){return function(_0x1cd133){if(_0x1cd133){return _0x1cd133[_0x3330('0x22')](_0x3ea564)[_0x3330('0x23')](function(_0x5b4c84){return _0x5b4c84;});}return null;};}function removeEntity(_0x1c7c98,_0x306ae4){return function(_0xf06904){if(_0xf06904){return _0xf06904[_0x3330('0x24')]()[_0x3330('0x23')](function(){var _0x1e5346=_0xf06904[_0x3330('0x25')]({'plain':!![]});var _0x30c31f=_0x3330('0x26');return db[_0x3330('0x27')]['destroy']({'where':{'type':_0x30c31f,'resourceId':_0x1e5346['id']}})[_0x3330('0x23')](function(){return _0xf06904;});})['then'](function(){_0x1c7c98['status'](0xcc)[_0x3330('0x17')]();});}};}function handleEntityNotFound(_0x2a27d3,_0x3c0fdb){return function(_0x2ae1ab){if(!_0x2ae1ab){_0x2a27d3[_0x3330('0x28')](0x194);}return _0x2ae1ab;};}function handleError(_0x338dfd,_0xc5393a){_0xc5393a=_0xc5393a||0x1f4;return function(_0x23c278){logger['error'](_0x23c278[_0x3330('0x29')]);if(_0x23c278[_0x3330('0x2a')]){delete _0x23c278[_0x3330('0x2a')];}_0x338dfd['status'](_0xc5393a)[_0x3330('0x2b')](_0x23c278);};}exports[_0x3330('0x2c')]=function(_0x77aaa5,_0x243a07){var _0x2ce845={},_0x58e07a={},_0x3ee1ec={'count':0x0,'rows':[]};var _0x4b2e82=_[_0x3330('0x2d')](db[_0x3330('0x2e')][_0x3330('0x2f')],function(_0x59e49e){return{'name':_0x59e49e['fieldName'],'type':_0x59e49e[_0x3330('0x30')][_0x3330('0x31')]};});_0x58e07a['model']=_['map'](_0x4b2e82,_0x3330('0x2a'));_0x58e07a[_0x3330('0x32')]=_[_0x3330('0x33')](_0x77aaa5[_0x3330('0x32')]);_0x58e07a[_0x3330('0x34')]=_[_0x3330('0x35')](_0x58e07a['model'],_0x58e07a['query']);_0x2ce845[_0x3330('0x36')]=_[_0x3330('0x35')](_0x58e07a['model'],qs[_0x3330('0x37')](_0x77aaa5[_0x3330('0x32')][_0x3330('0x37')]));_0x2ce845['attributes']=_0x2ce845['attributes']['length']?_0x2ce845['attributes']:_0x58e07a[_0x3330('0x38')];if(!_0x77aaa5[_0x3330('0x32')]['hasOwnProperty'](_0x3330('0x39'))){_0x2ce845[_0x3330('0x1c')]=qs[_0x3330('0x1c')](_0x77aaa5[_0x3330('0x32')][_0x3330('0x1c')]);_0x2ce845['offset']=qs[_0x3330('0x1a')](_0x77aaa5[_0x3330('0x32')][_0x3330('0x1a')]);}_0x2ce845[_0x3330('0x3a')]=qs['sort'](_0x77aaa5[_0x3330('0x32')][_0x3330('0x3b')]);_0x2ce845[_0x3330('0x3c')]=qs[_0x3330('0x34')](_['pick'](_0x77aaa5['query'],_0x58e07a[_0x3330('0x34')]),_0x4b2e82);if(_0x77aaa5[_0x3330('0x32')][_0x3330('0x3d')]){_0x2ce845[_0x3330('0x3c')]=_['merge'](_0x2ce845[_0x3330('0x3c')],{'$or':_[_0x3330('0x2d')](_0x4b2e82,function(_0x3c4e5e){if(_0x3c4e5e['type']!==_0x3330('0x3e')){var _0x19cf08={};_0x19cf08[_0x3c4e5e['name']]={'$like':'%'+_0x77aaa5['query'][_0x3330('0x3d')]+'%'};return _0x19cf08;}})});}_0x2ce845=_[_0x3330('0x3f')]({},_0x2ce845,_0x77aaa5['options']);var _0x4a6f6a={'where':_0x2ce845[_0x3330('0x3c')]};return db['Sound'][_0x3330('0x1d')](_0x4a6f6a)['then'](function(_0x71fb5f){_0x3ee1ec[_0x3330('0x1d')]=_0x71fb5f;if(_0x77aaa5[_0x3330('0x32')][_0x3330('0x40')]){_0x2ce845[_0x3330('0x41')]=[{'all':!![]}];}return db[_0x3330('0x2e')][_0x3330('0x42')](_0x2ce845);})[_0x3330('0x23')](function(_0x248b5c){_0x3ee1ec['rows']=_0x248b5c;return _0x3ee1ec;})['then'](respondWithFilteredResult(_0x243a07,_0x2ce845))[_0x3330('0x43')](handleError(_0x243a07,null));};exports[_0x3330('0x44')]=function(_0x3f4457,_0xf80df4){var _0x3e1ce3={'raw':!![],'where':{'id':_0x3f4457[_0x3330('0x45')]['id']}},_0x184105={};_0x184105[_0x3330('0x38')]=_[_0x3330('0x33')](db[_0x3330('0x2e')]['rawAttributes']);_0x184105[_0x3330('0x32')]=_[_0x3330('0x33')](_0x3f4457[_0x3330('0x32')]);_0x184105[_0x3330('0x34')]=_['intersection'](_0x184105[_0x3330('0x38')],_0x184105[_0x3330('0x32')]);_0x3e1ce3[_0x3330('0x36')]=_[_0x3330('0x35')](_0x184105[_0x3330('0x38')],qs[_0x3330('0x37')](_0x3f4457[_0x3330('0x32')][_0x3330('0x37')]));_0x3e1ce3[_0x3330('0x36')]=_0x3e1ce3['attributes'][_0x3330('0x46')]?_0x3e1ce3[_0x3330('0x36')]:_0x184105[_0x3330('0x38')];if(_0x3f4457[_0x3330('0x32')][_0x3330('0x40')]){_0x3e1ce3[_0x3330('0x41')]=[{'all':!![]}];}_0x3e1ce3=_[_0x3330('0x3f')]({},_0x3e1ce3,_0x3f4457[_0x3330('0x47')]);return db[_0x3330('0x2e')][_0x3330('0x48')](_0x3e1ce3)[_0x3330('0x23')](handleEntityNotFound(_0xf80df4,null))['then'](respondWithResult(_0xf80df4,null))[_0x3330('0x43')](handleError(_0xf80df4,null));};exports[_0x3330('0x49')]=function(_0x1f4f29,_0x1b7ff3,_0x73f62e){return db[_0x3330('0x2e')][_0x3330('0x48')]({'where':{'id':_0x1f4f29[_0x3330('0x45')]['id']},'attributes':[_0x3330('0x2a'),'save_name',_0x3330('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x1b7ff3,null))['then'](function(_0x5e9be2){if(_0x5e9be2){if(!fs['existsSync'](path[_0x3330('0x4b')](config[_0x3330('0x4c')],_0x3330('0x4d'),_0x5e9be2['save_name']+'.'+_0x5e9be2[_0x3330('0x4a')]))){throw new db[(_0x3330('0x4e'))]['ValidationError'](_0x3330('0x4f'));}return _0x1b7ff3[_0x3330('0x49')](path['join'](config[_0x3330('0x4c')],_0x3330('0x4d'),util[_0x3330('0x50')](_0x3330('0x51'),_0x5e9be2['save_name'],_0x5e9be2[_0x3330('0x4a')])),util[_0x3330('0x50')]('%s.%s',_0x5e9be2[_0x3330('0x2a')],_0x5e9be2[_0x3330('0x4a')]));}return null;})[_0x3330('0x43')](handleError(_0x1b7ff3,null));};exports['create']=function(_0x2beb24,_0x39665a,_0x1f15bc){var _0x438792={'name':path['basename'](_0x2beb24[_0x3330('0x52')]['originalname'],path[_0x3330('0x53')](_0x2beb24[_0x3330('0x52')][_0x3330('0x54')])),'save_name':path[_0x3330('0x55')](_0x2beb24[_0x3330('0x52')][_0x3330('0x56')],path[_0x3330('0x53')](_0x2beb24[_0x3330('0x52')][_0x3330('0x56')])),'original_format':path[_0x3330('0x53')](_0x2beb24[_0x3330('0x52')]['originalname'])[_0x3330('0x57')](0x1),'converted_format':_0x3330('0x58')};var _0x15831c=path[_0x3330('0x4b')](config[_0x3330('0x4c')],'server/files/sounds/original',_0x2beb24[_0x3330('0x52')][_0x3330('0x56')]);var _0x40220=path[_0x3330('0x4b')](config[_0x3330('0x4c')],_0x3330('0x4d'),util[_0x3330('0x50')](_0x3330('0x51'),path[_0x3330('0x55')](_0x2beb24['file'][_0x3330('0x56')],path[_0x3330('0x53')](_0x2beb24['file'][_0x3330('0x56')])),_0x438792[_0x3330('0x4a')]));logger[_0x3330('0x59')](_0x3330('0x5a'),_0x15831c);logger[_0x3330('0x59')](_0x3330('0x5b'),_0x40220);try{fs[_0x3330('0x5c')](_0x15831c,parseInt(_0x3330('0x5d'),0x8));var _0x3b845a=sox[_0x3330('0x5e')](_0x15831c,_0x40220,{'sampleRate':0x1f40,'format':_0x3330('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3b845a['on'](_0x3330('0x5f'),function(_0x388585){fs[_0x3330('0x60')](_0x15831c);_0x39665a['status'](0x1f4)[_0x3330('0x2b')](_0x388585);});_0x3b845a['on'](_0x3330('0x61'),function(_0x1e9f17){_0x438792['original_duration']=isNaN(_0x1e9f17[_0x3330('0x62')])?null:_0x1e9f17[_0x3330('0x62')]*0x3e8;_0x438792['original_sampleCount']=isNaN(_0x1e9f17[_0x3330('0x63')])?null:_0x1e9f17['sampleCount'];_0x438792[_0x3330('0x64')]=isNaN(_0x1e9f17['channelCount'])?null:_0x1e9f17['channelCount'];_0x438792[_0x3330('0x65')]=isNaN(_0x1e9f17[_0x3330('0x66')])?null:_0x1e9f17[_0x3330('0x66')];_0x438792[_0x3330('0x67')]=isNaN(_0x1e9f17[_0x3330('0x68')])?null:_0x1e9f17['sampleRate'];});_0x3b845a['on'](_0x3330('0x69'),function(_0x393ece){_0x438792[_0x3330('0x6a')]=isNaN(_0x393ece['duration'])?null:_0x393ece[_0x3330('0x62')]*0x3e8;_0x438792['converted_sampleCount']=isNaN(_0x393ece['sampleCount'])?null:_0x393ece['sampleCount'];_0x438792[_0x3330('0x6b')]=isNaN(_0x393ece[_0x3330('0x6c')])?null:_0x393ece[_0x3330('0x6c')];_0x438792['converted_bitRate']=isNaN(_0x393ece[_0x3330('0x66')])?null:_0x393ece[_0x3330('0x66')];_0x438792[_0x3330('0x6d')]=isNaN(_0x393ece['sampleRate'])?null:_0x393ece[_0x3330('0x68')];});_0x3b845a['on'](_0x3330('0x17'),function(){fs['chmodSync'](_0x40220,parseInt(_0x3330('0x5d'),0x8));return db[_0x3330('0x2e')][_0x3330('0x6e')](_0x438792)['then'](function(_0x146a73){var _0x4028a5={'role':_0x2beb24[_0x3330('0x6f')][_0x3330('0x70')],'userProfileId':_0x2beb24[_0x3330('0x6f')][_0x3330('0x71')]};if(!_0x4028a5)throw new Error(_0x3330('0x72'));if(_0x4028a5[_0x3330('0x70')]===_0x3330('0x73')){var _0x2da4f0=_0x146a73[_0x3330('0x25')]({'plain':!![]});return db[_0x3330('0x74')][_0x3330('0x48')]({'where':{'name':_0x3330('0x26'),'userProfileId':_0x4028a5['userProfileId']},'raw':!![]})['then'](function(_0x23d359){if(_0x23d359&&_0x23d359['autoAssociation']===0x0){return db[_0x3330('0x27')][_0x3330('0x6e')]({'name':_0x2da4f0[_0x3330('0x2a')],'resourceId':_0x2da4f0['id'],'type':_0x23d359[_0x3330('0x2a')],'sectionId':_0x23d359['id']},{})[_0x3330('0x23')](function(){return _0x146a73;});}else{return _0x146a73;}})[_0x3330('0x43')](function(_0x55889b){logger[_0x3330('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55889b);throw _0x55889b;});}return _0x146a73;})[_0x3330('0x23')](respondWithResult(_0x39665a,null))[_0x3330('0x43')](handleError(_0x39665a,null));});_0x3b845a[_0x3330('0x75')]();}catch(_0x5498a6){_0x39665a[_0x3330('0x18')](0x1f4)[_0x3330('0x2b')](_0x5498a6);}};exports[_0x3330('0x22')]=function(_0x39a47c,_0x4d7f9f,_0xc8ea62){return db[_0x3330('0x2e')][_0x3330('0x48')]({'where':{'id':_0x39a47c[_0x3330('0x45')]['id']}})[_0x3330('0x23')](handleEntityNotFound(_0x4d7f9f,null))[_0x3330('0x23')](saveUpdates(_[_0x3330('0x76')](_0x39a47c['body'],[_0x3330('0x2a'),'description']),null))[_0x3330('0x23')](respondWithResult(_0x4d7f9f,null))['catch'](handleError(_0x4d7f9f,null));};exports[_0x3330('0x77')]=function(_0x4310f6,_0x405d61,_0x5ebf9b){return db[_0x3330('0x2e')]['find']({'where':{'id':_0x4310f6[_0x3330('0x45')]['id']}})[_0x3330('0x23')](function(_0x4fd233){if(_0x4fd233){return _0x4fd233['destroy']();}})[_0x3330('0x23')](function(_0x1e8fe2){var _0x36d2f9=path[_0x3330('0x4b')](config['root'],_0x3330('0x78'),util[_0x3330('0x50')](_0x3330('0x51'),_0x1e8fe2[_0x3330('0x79')],_0x1e8fe2[_0x3330('0x7a')]));var _0x36f6e0=path[_0x3330('0x4b')](config[_0x3330('0x4c')],_0x3330('0x4d'),util[_0x3330('0x50')](_0x3330('0x51'),_0x1e8fe2[_0x3330('0x79')],_0x1e8fe2['converted_format']));fs[_0x3330('0x60')](_0x36d2f9);fs[_0x3330('0x60')](_0x36f6e0);return _0x1e8fe2;})['then'](function(_0x39237b){if(_0x39237b){return _0x405d61[_0x3330('0x18')](0xcc)['end']();}})[_0x3330('0x23')](handleEntityNotFound(_0x405d61,null))[_0x3330('0x43')](handleError(_0x405d61,null));}; \ No newline at end of file +var _0xfe42=['transcode','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','description','delete','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','get','Sounds','UserProfileResource','error','name','send','index','map','Sound','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','order','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','options','find','converted_format','existsSync','join','server/files/sounds/converted','save_name','Sequelize','ValidationError','root','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777'];(function(_0x26c562,_0xe4be5c){var _0x462368=function(_0x38db51){while(--_0x38db51){_0x26c562['push'](_0x26c562['shift']());}};_0x462368(++_0xe4be5c);}(_0xfe42,0x1e1));var _0x2fe4=function(_0x29af8f,_0x2cd760){_0x29af8f=_0x29af8f-0x0;var _0x1adb1e=_0xfe42[_0x29af8f];return _0x1adb1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2fe4('0x0'));var jsonpatch=require(_0x2fe4('0x1'));var rp=require(_0x2fe4('0x2'));var moment=require(_0x2fe4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2fe4('0x4'));var util=require('util');var path=require(_0x2fe4('0x5'));var sox=require(_0x2fe4('0x6'));var csv=require('to-csv');var ejs=require(_0x2fe4('0x7'));var fs=require('fs');var fs_extra=require(_0x2fe4('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2fe4('0x9'));var Papa=require(_0x2fe4('0xa'));var Redis=require('ioredis');var authService=require(_0x2fe4('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x2fe4('0xc'));var hardwareService=require(_0x2fe4('0xd'));var logger=require(_0x2fe4('0xe'))(_0x2fe4('0xf'));var utils=require('../../config/utils');var config=require(_0x2fe4('0x10'));var licenseUtil=require(_0x2fe4('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dcba1,_0x4ba8fb){_0x4ba8fb=_0x4ba8fb||0xcc;return function(_0x22e072){if(_0x22e072){return _0x4dcba1[_0x2fe4('0x12')](_0x4ba8fb);}return _0x4dcba1[_0x2fe4('0x13')](_0x4ba8fb)[_0x2fe4('0x14')]();};}function respondWithResult(_0x296531,_0x5cb9bd){_0x5cb9bd=_0x5cb9bd||0xc8;return function(_0x287ba8){if(_0x287ba8){return _0x296531[_0x2fe4('0x13')](_0x5cb9bd)[_0x2fe4('0x15')](_0x287ba8);}};}function respondWithFilteredResult(_0x44ce52,_0x1b5868){return function(_0xd596a5){if(_0xd596a5){var _0x589943=typeof _0x1b5868[_0x2fe4('0x16')]===_0x2fe4('0x17')&&typeof _0x1b5868[_0x2fe4('0x18')]==='undefined';var _0x1417d0=_0xd596a5['count'];var _0x116fc3=_0x589943?0x0:_0x1b5868[_0x2fe4('0x16')];var _0x279d35=_0x589943?_0xd596a5[_0x2fe4('0x19')]:_0x1b5868[_0x2fe4('0x16')]+_0x1b5868[_0x2fe4('0x18')];var _0x50c281;if(_0x279d35>=_0x1417d0){_0x279d35=_0x1417d0;_0x50c281=0xc8;}else{_0x50c281=0xce;}_0x44ce52[_0x2fe4('0x13')](_0x50c281);return _0x44ce52['set'](_0x2fe4('0x1a'),_0x116fc3+'-'+_0x279d35+'/'+_0x1417d0)['json'](_0xd596a5);}return null;};}function patchUpdates(_0x47c825){return function(_0x219121){try{jsonpatch['apply'](_0x219121,_0x47c825,!![]);}catch(_0x7ce622){return BPromise[_0x2fe4('0x1b')](_0x7ce622);}return _0x219121['save']();};}function saveUpdates(_0xa8181d,_0x82fc04){return function(_0x20bd51){if(_0x20bd51){return _0x20bd51[_0x2fe4('0x1c')](_0xa8181d)['then'](function(_0x4dce94){return _0x4dce94;});}return null;};}function removeEntity(_0x223f4f,_0x1365b6){return function(_0x424ca6){if(_0x424ca6){return _0x424ca6[_0x2fe4('0x1d')]()[_0x2fe4('0x1e')](function(){var _0x1fff0e=_0x424ca6[_0x2fe4('0x1f')]({'plain':!![]});var _0x151327=_0x2fe4('0x20');return db[_0x2fe4('0x21')][_0x2fe4('0x1d')]({'where':{'type':_0x151327,'resourceId':_0x1fff0e['id']}})[_0x2fe4('0x1e')](function(){return _0x424ca6;});})['then'](function(){_0x223f4f[_0x2fe4('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37c950,_0x3855ed){return function(_0x6fb631){if(!_0x6fb631){_0x37c950[_0x2fe4('0x12')](0x194);}return _0x6fb631;};}function handleError(_0x1e8e0a,_0x28efb9){_0x28efb9=_0x28efb9||0x1f4;return function(_0x20b149){logger[_0x2fe4('0x22')](_0x20b149['stack']);if(_0x20b149[_0x2fe4('0x23')]){delete _0x20b149[_0x2fe4('0x23')];}_0x1e8e0a[_0x2fe4('0x13')](_0x28efb9)[_0x2fe4('0x24')](_0x20b149);};}exports[_0x2fe4('0x25')]=function(_0x5d2587,_0xe8436){var _0x1ffe8b={},_0x411fab={},_0x10d1b3={'count':0x0,'rows':[]};var _0xe2e1d5=_[_0x2fe4('0x26')](db[_0x2fe4('0x27')]['rawAttributes'],function(_0x2fe075){return{'name':_0x2fe075[_0x2fe4('0x28')],'type':_0x2fe075[_0x2fe4('0x29')]['key']};});_0x411fab[_0x2fe4('0x2a')]=_['map'](_0xe2e1d5,_0x2fe4('0x23'));_0x411fab[_0x2fe4('0x2b')]=_['keys'](_0x5d2587[_0x2fe4('0x2b')]);_0x411fab['filters']=_['intersection'](_0x411fab[_0x2fe4('0x2a')],_0x411fab[_0x2fe4('0x2b')]);_0x1ffe8b['attributes']=_[_0x2fe4('0x2c')](_0x411fab[_0x2fe4('0x2a')],qs[_0x2fe4('0x2d')](_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x2d')]));_0x1ffe8b[_0x2fe4('0x2e')]=_0x1ffe8b['attributes']['length']?_0x1ffe8b[_0x2fe4('0x2e')]:_0x411fab[_0x2fe4('0x2a')];if(!_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x2f')]('nolimit')){_0x1ffe8b[_0x2fe4('0x18')]=qs[_0x2fe4('0x18')](_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x18')]);_0x1ffe8b[_0x2fe4('0x16')]=qs[_0x2fe4('0x16')](_0x5d2587['query'][_0x2fe4('0x16')]);}_0x1ffe8b[_0x2fe4('0x30')]=qs['sort'](_0x5d2587[_0x2fe4('0x2b')]['sort']);_0x1ffe8b[_0x2fe4('0x31')]=qs[_0x2fe4('0x32')](_[_0x2fe4('0x33')](_0x5d2587[_0x2fe4('0x2b')],_0x411fab[_0x2fe4('0x32')]),_0xe2e1d5);if(_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x34')]){_0x1ffe8b[_0x2fe4('0x31')]=_[_0x2fe4('0x35')](_0x1ffe8b[_0x2fe4('0x31')],{'$or':_[_0x2fe4('0x26')](_0xe2e1d5,function(_0x2ce188){if(_0x2ce188[_0x2fe4('0x29')]!=='VIRTUAL'){var _0x192635={};_0x192635[_0x2ce188[_0x2fe4('0x23')]]={'$like':'%'+_0x5d2587['query'][_0x2fe4('0x34')]+'%'};return _0x192635;}})});}_0x1ffe8b=_[_0x2fe4('0x35')]({},_0x1ffe8b,_0x5d2587['options']);var _0x372966={'where':_0x1ffe8b['where']};return db[_0x2fe4('0x27')][_0x2fe4('0x19')](_0x372966)[_0x2fe4('0x1e')](function(_0x22b275){_0x10d1b3[_0x2fe4('0x19')]=_0x22b275;if(_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x36')]){_0x1ffe8b['include']=[{'all':!![]}];}return db[_0x2fe4('0x27')][_0x2fe4('0x37')](_0x1ffe8b);})[_0x2fe4('0x1e')](function(_0x42eef1){_0x10d1b3[_0x2fe4('0x38')]=_0x42eef1;return _0x10d1b3;})['then'](respondWithFilteredResult(_0xe8436,_0x1ffe8b))[_0x2fe4('0x39')](handleError(_0xe8436,null));};exports[_0x2fe4('0x3a')]=function(_0x280e78,_0xf24a2b){var _0x3af0ab={'raw':!![],'where':{'id':_0x280e78[_0x2fe4('0x3b')]['id']}},_0x8242ed={};_0x8242ed[_0x2fe4('0x2a')]=_[_0x2fe4('0x3c')](db[_0x2fe4('0x27')][_0x2fe4('0x3d')]);_0x8242ed[_0x2fe4('0x2b')]=_[_0x2fe4('0x3c')](_0x280e78['query']);_0x8242ed[_0x2fe4('0x32')]=_[_0x2fe4('0x2c')](_0x8242ed[_0x2fe4('0x2a')],_0x8242ed['query']);_0x3af0ab[_0x2fe4('0x2e')]=_[_0x2fe4('0x2c')](_0x8242ed['model'],qs[_0x2fe4('0x2d')](_0x280e78['query']['fields']));_0x3af0ab[_0x2fe4('0x2e')]=_0x3af0ab[_0x2fe4('0x2e')][_0x2fe4('0x3e')]?_0x3af0ab[_0x2fe4('0x2e')]:_0x8242ed[_0x2fe4('0x2a')];if(_0x280e78[_0x2fe4('0x2b')]['includeAll']){_0x3af0ab[_0x2fe4('0x3f')]=[{'all':!![]}];}_0x3af0ab=_[_0x2fe4('0x35')]({},_0x3af0ab,_0x280e78[_0x2fe4('0x40')]);return db['Sound'][_0x2fe4('0x41')](_0x3af0ab)[_0x2fe4('0x1e')](handleEntityNotFound(_0xf24a2b,null))['then'](respondWithResult(_0xf24a2b,null))[_0x2fe4('0x39')](handleError(_0xf24a2b,null));};exports['download']=function(_0x1ed8cf,_0x182331,_0x1e983c){return db[_0x2fe4('0x27')][_0x2fe4('0x41')]({'where':{'id':_0x1ed8cf[_0x2fe4('0x3b')]['id']},'attributes':[_0x2fe4('0x23'),'save_name',_0x2fe4('0x42')],'raw':!![]})[_0x2fe4('0x1e')](handleEntityNotFound(_0x182331,null))[_0x2fe4('0x1e')](function(_0x2c265e){if(_0x2c265e){if(!fs[_0x2fe4('0x43')](path[_0x2fe4('0x44')](config['root'],_0x2fe4('0x45'),_0x2c265e[_0x2fe4('0x46')]+'.'+_0x2c265e[_0x2fe4('0x42')]))){throw new db[(_0x2fe4('0x47'))][(_0x2fe4('0x48'))]('Sound\x20not\x20found');}return _0x182331['download'](path['join'](config[_0x2fe4('0x49')],_0x2fe4('0x45'),util[_0x2fe4('0x4a')]('%s.%s',_0x2c265e[_0x2fe4('0x46')],_0x2c265e[_0x2fe4('0x42')])),util['format'](_0x2fe4('0x4b'),_0x2c265e['name'],_0x2c265e[_0x2fe4('0x42')]));}return null;})[_0x2fe4('0x39')](handleError(_0x182331,null));};exports[_0x2fe4('0x4c')]=function(_0x7ffca7,_0xc63777,_0x591092){var _0x5e4c00={'name':path[_0x2fe4('0x4d')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x4f')],path[_0x2fe4('0x50')](_0x7ffca7['file'][_0x2fe4('0x4f')])),'save_name':path[_0x2fe4('0x4d')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')],path['extname'](_0x7ffca7['file'][_0x2fe4('0x51')])),'original_format':path['extname'](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x4f')])['substring'](0x1),'converted_format':_0x2fe4('0x52')};var _0x16f5db=path[_0x2fe4('0x44')](config[_0x2fe4('0x49')],_0x2fe4('0x53'),_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')]);var _0x458714=path['join'](config[_0x2fe4('0x49')],'server/files/sounds/converted',util[_0x2fe4('0x4a')](_0x2fe4('0x4b'),path[_0x2fe4('0x4d')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')],path[_0x2fe4('0x50')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')])),_0x5e4c00[_0x2fe4('0x42')]));logger['info'](_0x2fe4('0x54'),_0x16f5db);logger[_0x2fe4('0x55')](_0x2fe4('0x56'),_0x458714);try{fs[_0x2fe4('0x57')](_0x16f5db,parseInt(_0x2fe4('0x58'),0x8));var _0xfb9c6f=sox[_0x2fe4('0x59')](_0x16f5db,_0x458714,{'sampleRate':0x1f40,'format':_0x2fe4('0x52'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xfb9c6f['on'](_0x2fe4('0x22'),function(_0x1f9425){fs['unlinkSync'](_0x16f5db);_0xc63777[_0x2fe4('0x13')](0x1f4)['send'](_0x1f9425);});_0xfb9c6f['on'](_0x2fe4('0x5a'),function(_0x105442){_0x5e4c00['original_duration']=isNaN(_0x105442['duration'])?null:_0x105442[_0x2fe4('0x5b')]*0x3e8;_0x5e4c00[_0x2fe4('0x5c')]=isNaN(_0x105442['sampleCount'])?null:_0x105442[_0x2fe4('0x5d')];_0x5e4c00[_0x2fe4('0x5e')]=isNaN(_0x105442[_0x2fe4('0x5f')])?null:_0x105442[_0x2fe4('0x5f')];_0x5e4c00[_0x2fe4('0x60')]=isNaN(_0x105442[_0x2fe4('0x61')])?null:_0x105442[_0x2fe4('0x61')];_0x5e4c00[_0x2fe4('0x62')]=isNaN(_0x105442[_0x2fe4('0x63')])?null:_0x105442[_0x2fe4('0x63')];});_0xfb9c6f['on'](_0x2fe4('0x64'),function(_0x25d050){_0x5e4c00[_0x2fe4('0x65')]=isNaN(_0x25d050[_0x2fe4('0x5b')])?null:_0x25d050[_0x2fe4('0x5b')]*0x3e8;_0x5e4c00['converted_sampleCount']=isNaN(_0x25d050[_0x2fe4('0x5d')])?null:_0x25d050[_0x2fe4('0x5d')];_0x5e4c00[_0x2fe4('0x66')]=isNaN(_0x25d050[_0x2fe4('0x5f')])?null:_0x25d050[_0x2fe4('0x5f')];_0x5e4c00[_0x2fe4('0x67')]=isNaN(_0x25d050[_0x2fe4('0x61')])?null:_0x25d050[_0x2fe4('0x61')];_0x5e4c00[_0x2fe4('0x68')]=isNaN(_0x25d050[_0x2fe4('0x63')])?null:_0x25d050['sampleRate'];});_0xfb9c6f['on'](_0x2fe4('0x14'),function(){fs[_0x2fe4('0x57')](_0x458714,parseInt(_0x2fe4('0x58'),0x8));return db[_0x2fe4('0x27')][_0x2fe4('0x4c')](_0x5e4c00)[_0x2fe4('0x1e')](function(_0x18cf55){var _0x237a69={'role':_0x7ffca7['body'][_0x2fe4('0x69')],'userProfileId':_0x7ffca7[_0x2fe4('0x6a')][_0x2fe4('0x6b')]};if(!_0x237a69)throw new Error(_0x2fe4('0x6c'));if(_0x237a69[_0x2fe4('0x69')]===_0x2fe4('0x6d')){var _0x5e3955=_0x18cf55[_0x2fe4('0x1f')]({'plain':!![]});return db['UserProfileSection'][_0x2fe4('0x41')]({'where':{'name':_0x2fe4('0x20'),'userProfileId':_0x237a69[_0x2fe4('0x6b')]},'raw':!![]})[_0x2fe4('0x1e')](function(_0x58f0b9){if(_0x58f0b9&&_0x58f0b9[_0x2fe4('0x6e')]===0x0){return db[_0x2fe4('0x21')][_0x2fe4('0x4c')]({'name':_0x5e3955[_0x2fe4('0x23')],'resourceId':_0x5e3955['id'],'type':_0x58f0b9[_0x2fe4('0x23')],'sectionId':_0x58f0b9['id']},{})[_0x2fe4('0x1e')](function(){return _0x18cf55;});}else{return _0x18cf55;}})[_0x2fe4('0x39')](function(_0x2a81d3){logger[_0x2fe4('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a81d3);throw _0x2a81d3;});}return _0x18cf55;})[_0x2fe4('0x1e')](respondWithResult(_0xc63777,null))['catch'](handleError(_0xc63777,null));});_0xfb9c6f['start']();}catch(_0x13152c){_0xc63777[_0x2fe4('0x13')](0x1f4)[_0x2fe4('0x24')](_0x13152c);}};exports[_0x2fe4('0x1c')]=function(_0x33b640,_0x38b59b,_0x54c784){return db['Sound'][_0x2fe4('0x41')]({'where':{'id':_0x33b640[_0x2fe4('0x3b')]['id']}})[_0x2fe4('0x1e')](handleEntityNotFound(_0x38b59b,null))[_0x2fe4('0x1e')](saveUpdates(_[_0x2fe4('0x33')](_0x33b640['body'],[_0x2fe4('0x23'),_0x2fe4('0x6f')]),null))[_0x2fe4('0x1e')](respondWithResult(_0x38b59b,null))[_0x2fe4('0x39')](handleError(_0x38b59b,null));};exports[_0x2fe4('0x70')]=function(_0x4e23fc,_0xef5359,_0x1f97a9){return db[_0x2fe4('0x27')][_0x2fe4('0x41')]({'where':{'id':_0x4e23fc[_0x2fe4('0x3b')]['id']}})[_0x2fe4('0x1e')](function(_0x46bea8){if(_0x46bea8){return _0x46bea8[_0x2fe4('0x1d')]();}})['then'](function(_0xfdd5c5){var _0x3e1d33=path[_0x2fe4('0x44')](config[_0x2fe4('0x49')],_0x2fe4('0x53'),util[_0x2fe4('0x4a')](_0x2fe4('0x4b'),_0xfdd5c5[_0x2fe4('0x46')],_0xfdd5c5['original_format']));var _0x545125=path[_0x2fe4('0x44')](config['root'],_0x2fe4('0x45'),util[_0x2fe4('0x4a')](_0x2fe4('0x4b'),_0xfdd5c5[_0x2fe4('0x46')],_0xfdd5c5[_0x2fe4('0x42')]));fs[_0x2fe4('0x71')](_0x3e1d33);fs['unlinkSync'](_0x545125);return _0xfdd5c5;})['then'](function(_0x47b425){if(_0x47b425){return _0xef5359['status'](0xcc)[_0x2fe4('0x14')]();}})[_0x2fe4('0x1e')](handleEntityNotFound(_0xef5359,null))['catch'](handleError(_0xef5359,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e35a09b..fe1392f 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 _0x0a3c=['./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x0a3c,0x16c));var _0xc0a3=function(_0x430b24,_0x1f085e){_0x430b24=_0x430b24-0x0;var _0x5cee14=_0x0a3c[_0x430b24];return _0x5cee14;};'use strict';var _=require(_0xc0a3('0x0'));var util=require(_0xc0a3('0x1'));var logger=require(_0xc0a3('0x2'))(_0xc0a3('0x3'));var moment=require('moment');var BPromise=require(_0xc0a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0a3('0x5'));var rimraf=require(_0xc0a3('0x6'));var config=require(_0xc0a3('0x7'));var attributes=require(_0xc0a3('0x8'));module[_0xc0a3('0x9')]=function(_0x317af2,_0x4da448){return _0x317af2[_0xc0a3('0xa')](_0xc0a3('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa33=['../../config/logger','api','moment','rimraf','../../config/environment','Sound','tools_sounds','lodash','util'];(function(_0x4ef4e2,_0x4faf5f){var _0x3a96a4=function(_0x4694b0){while(--_0x4694b0){_0x4ef4e2['push'](_0x4ef4e2['shift']());}};_0x3a96a4(++_0x4faf5f);}(_0xaa33,0x97));var _0x3aa3=function(_0x3b95e8,_0x400cb8){_0x3b95e8=_0x3b95e8-0x0;var _0x3363a9=_0xaa33[_0x3b95e8];return _0x3363a9;};'use strict';var _=require(_0x3aa3('0x0'));var util=require(_0x3aa3('0x1'));var logger=require(_0x3aa3('0x2'))(_0x3aa3('0x3'));var moment=require(_0x3aa3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa3('0x5'));var config=require(_0x3aa3('0x6'));var attributes=require('./sound.attributes');module['exports']=function(_0x2e78e1,_0x39b8d7){return _0x2e78e1['define'](_0x3aa3('0x7'),attributes,{'tableName':_0x3aa3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d5a16d6..b0440c6 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 _0x2973=['catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x725bb6,_0x4c0c88){var _0x5c5f32=function(_0x9d74d5){while(--_0x9d74d5){_0x725bb6['push'](_0x725bb6['shift']());}};_0x5c5f32(++_0x4c0c88);}(_0x2973,0x17e));var _0x3297=function(_0x51046e,_0x46e77d){_0x51046e=_0x51046e-0x0;var _0x694f90=_0x2973[_0x51046e];return _0x694f90;};'use strict';var _=require(_0x3297('0x0'));var util=require(_0x3297('0x1'));var moment=require(_0x3297('0x2'));var BPromise=require(_0x3297('0x3'));var rs=require(_0x3297('0x4'));var fs=require('fs');var Redis=require(_0x3297('0x5'));var db=require(_0x3297('0x6'))['db'];var utils=require(_0x3297('0x7'));var logger=require('../../config/logger')(_0x3297('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3297('0x9')][_0x3297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213757,_0x2c3de7,_0x14c4ea){return new BPromise(function(_0x1d52dc,_0x726152){return client[_0x3297('0xb')](_0x213757,_0x14c4ea)[_0x3297('0xc')](function(_0x3ca94f){logger[_0x3297('0xd')](_0x3297('0xe'),_0x2c3de7,_0x3297('0xf'));logger[_0x3297('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x2c3de7,_0x3297('0xf'),JSON[_0x3297('0x11')](_0x3ca94f));if(_0x3ca94f[_0x3297('0x12')]){if(_0x3ca94f[_0x3297('0x12')]['code']===0x1f4){logger[_0x3297('0x12')]('Sound,\x20%s,\x20%s',_0x2c3de7,_0x3ca94f['error'][_0x3297('0x13')]);return _0x726152(_0x3ca94f['error']['message']);}logger['error'](_0x3297('0xe'),_0x2c3de7,_0x3ca94f[_0x3297('0x12')]['message']);return _0x1d52dc(_0x3ca94f['error']['message']);}else{logger[_0x3297('0xd')](_0x3297('0xe'),_0x2c3de7,_0x3297('0xf'));_0x1d52dc(_0x3ca94f[_0x3297('0x14')]['message']);}})[_0x3297('0x15')](function(_0xd65a91){logger[_0x3297('0x12')](_0x3297('0xe'),_0x2c3de7,_0xd65a91);_0x726152(_0xd65a91);});});}exports[_0x3297('0x16')]=function(_0x233ce4){var _0xbd8a00=this;return new Promise(function(_0x2782a4,_0x3cb4ff){return db[_0x3297('0x17')][_0x3297('0x18')]({'raw':_0x233ce4[_0x3297('0x19')]?_0x233ce4[_0x3297('0x19')][_0x3297('0x1a')]===undefined?!![]:![]:!![],'where':_0x233ce4[_0x3297('0x19')]?_0x233ce4[_0x3297('0x19')]['where']||null:null,'attributes':_0x233ce4['options']?_0x233ce4['options'][_0x3297('0x1b')]||null:null,'include':_0x233ce4[_0x3297('0x19')]?_0x233ce4[_0x3297('0x19')][_0x3297('0x1c')]?_[_0x3297('0x1d')](_0x233ce4[_0x3297('0x19')]['include'],function(_0x2ebc34){return{'model':db[_0x2ebc34['model']],'as':_0x2ebc34['as'],'attributes':_0x2ebc34['attributes'],'include':_0x2ebc34[_0x3297('0x1c')]?_['map'](_0x2ebc34[_0x3297('0x1c')],function(_0x54fb6e){return{'model':db[_0x54fb6e[_0x3297('0x1e')]],'as':_0x54fb6e['as'],'attributes':_0x54fb6e[_0x3297('0x1b')],'include':_0x54fb6e[_0x3297('0x1c')]?_['map'](_0x54fb6e[_0x3297('0x1c')],function(_0x2a1e06){return{'model':db[_0x2a1e06[_0x3297('0x1e')]],'as':_0x2a1e06['as'],'attributes':_0x2a1e06[_0x3297('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3297('0xc')](function(_0x1f0a70){logger[_0x3297('0xd')](_0x3297('0x16'),_0x233ce4);logger[_0x3297('0x10')]('ShowSound',_0x233ce4,JSON['stringify'](_0x1f0a70));_0x2782a4(_0x1f0a70);})['catch'](function(_0x16946e){logger[_0x3297('0x12')](_0x3297('0x16'),_0x16946e[_0x3297('0x13')],_0x233ce4);_0x3cb4ff(_0xbd8a00[_0x3297('0x12')](0x1f4,_0x16946e[_0x3297('0x13')]));});});}; \ No newline at end of file +var _0xc22a=['code','message','result','catch','ShowSound','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x24fb57,_0x46341f){var _0x261fe2=function(_0xd1c00b){while(--_0xd1c00b){_0x24fb57['push'](_0x24fb57['shift']());}};_0x261fe2(++_0x46341f);}(_0xc22a,0x111));var _0xac22=function(_0xfcbe07,_0x5e2119){_0xfcbe07=_0xfcbe07-0x0;var _0x5b2664=_0xc22a[_0xfcbe07];return _0x5b2664;};'use strict';var _=require(_0xac22('0x0'));var util=require(_0xac22('0x1'));var moment=require(_0xac22('0x2'));var BPromise=require(_0xac22('0x3'));var rs=require(_0xac22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xac22('0x5'));var logger=require(_0xac22('0x6'))('rpc');var config=require(_0xac22('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xac22('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x419b59,_0x36e624,_0x8700fe){return new BPromise(function(_0x1b601e,_0x374d6f){return client[_0xac22('0x9')](_0x419b59,_0x8700fe)[_0xac22('0xa')](function(_0x5bd0b5){logger[_0xac22('0xb')](_0xac22('0xc'),_0x36e624,'request\x20sent');logger[_0xac22('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x36e624,_0xac22('0xe'),JSON[_0xac22('0xf')](_0x5bd0b5));if(_0x5bd0b5[_0xac22('0x10')]){if(_0x5bd0b5['error'][_0xac22('0x11')]===0x1f4){logger['error'](_0xac22('0xc'),_0x36e624,_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);return _0x374d6f(_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);}logger[_0xac22('0x10')](_0xac22('0xc'),_0x36e624,_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);return _0x1b601e(_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x36e624,_0xac22('0xe'));_0x1b601e(_0x5bd0b5[_0xac22('0x13')]['message']);}})[_0xac22('0x14')](function(_0xc8aff6){logger['error'](_0xac22('0xc'),_0x36e624,_0xc8aff6);_0x374d6f(_0xc8aff6);});});}exports[_0xac22('0x15')]=function(_0x4f9983){var _0x39c144=this;return new Promise(function(_0x218205,_0x63b1e8){return db['Sound'][_0xac22('0x16')]({'raw':_0x4f9983[_0xac22('0x17')]?_0x4f9983[_0xac22('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4f9983['options']?_0x4f9983[_0xac22('0x17')][_0xac22('0x18')]||null:null,'attributes':_0x4f9983[_0xac22('0x17')]?_0x4f9983[_0xac22('0x17')][_0xac22('0x19')]||null:null,'include':_0x4f9983[_0xac22('0x17')]?_0x4f9983[_0xac22('0x17')][_0xac22('0x1a')]?_[_0xac22('0x1b')](_0x4f9983[_0xac22('0x17')][_0xac22('0x1a')],function(_0xa53b1){return{'model':db[_0xa53b1[_0xac22('0x1c')]],'as':_0xa53b1['as'],'attributes':_0xa53b1[_0xac22('0x19')],'include':_0xa53b1[_0xac22('0x1a')]?_[_0xac22('0x1b')](_0xa53b1['include'],function(_0x3d3ebc){return{'model':db[_0x3d3ebc[_0xac22('0x1c')]],'as':_0x3d3ebc['as'],'attributes':_0x3d3ebc['attributes'],'include':_0x3d3ebc[_0xac22('0x1a')]?_[_0xac22('0x1b')](_0x3d3ebc[_0xac22('0x1a')],function(_0x2d13c9){return{'model':db[_0x2d13c9[_0xac22('0x1c')]],'as':_0x2d13c9['as'],'attributes':_0x2d13c9[_0xac22('0x19')]};}):[]};}):[]};}):[]:[]})[_0xac22('0xa')](function(_0x4251aa){logger[_0xac22('0xb')](_0xac22('0x15'),_0x4f9983);logger[_0xac22('0xd')]('ShowSound',_0x4f9983,JSON['stringify'](_0x4251aa));_0x218205(_0x4251aa);})[_0xac22('0x14')](function(_0x3369a0){logger[_0xac22('0x10')](_0xac22('0x15'),_0x3369a0['message'],_0x4f9983);_0x63b1e8(_0x39c144['error'](0x1f4,_0x3369a0[_0xac22('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 20aa584..fd4c937 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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x4c217f,_0x82a1ae){var _0x4033b2=function(_0x4752cb){while(--_0x4752cb){_0x4c217f['push'](_0x4c217f['shift']());}};_0x4033b2(++_0x82a1ae);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0x8603,0x190));var _0x3860=function(_0x3f9dfc,_0x3aacad){_0x3f9dfc=_0x3f9dfc-0x0;var _0x2c0568=_0x8603[_0x3f9dfc];return _0x2c0568;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 55fd56a..114fca1 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 _0x7cc3=['sequelize','STRING','TEXT','medium','ENUM','out'];(function(_0x54784b,_0x5b6097){var _0x55ed08=function(_0x3a6abd){while(--_0x3a6abd){_0x54784b['push'](_0x54784b['shift']());}};_0x55ed08(++_0x5b6097);}(_0x7cc3,0x1ec));var _0x37cc=function(_0x5e5443,_0xc4f3b7){_0x5e5443=_0x5e5443-0x0;var _0x1d8815=_0x7cc3[_0x5e5443];return _0x1d8815;};'use strict';var Sequelize=require(_0x37cc('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x37cc('0x1')]},'body':{'type':Sequelize[_0x37cc('0x2')](_0x37cc('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x37cc('0x4')]('in','out'),'defaultValue':_0x37cc('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x37cc('0x1')]},'providerResponse':{'type':Sequelize[_0x37cc('0x2')]}}; \ No newline at end of file +var _0x268c=['sequelize','STRING','medium','ENUM','out','TEXT'];(function(_0x526958,_0x447c54){var _0xfc503e=function(_0x48f0cf){while(--_0x48f0cf){_0x526958['push'](_0x526958['shift']());}};_0xfc503e(++_0x447c54);}(_0x268c,0xcc));var _0xc268=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x268c[_0x1a37e3];return _0x4db78a;};'use strict';var Sequelize=require(_0xc268('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc268('0x1')]},'body':{'type':Sequelize['TEXT'](_0xc268('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xc268('0x3')]('in',_0xc268('0x4')),'defaultValue':_0xc268('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc268('0x1')]},'providerResponse':{'type':Sequelize[_0xc268('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 0f3d8b4..ee22ede 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 _0x3423=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','name','send','map','SquareMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','keys','include','find','create','body','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x47a63b,_0x3820b4){var _0x20aad7=function(_0xaf93bc){while(--_0xaf93bc){_0x47a63b['push'](_0x47a63b['shift']());}};_0x20aad7(++_0x3820b4);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3342('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716d80,_0x36e1f4){_0x36e1f4=_0x36e1f4||0xcc;return function(_0x592ba8){if(_0x592ba8){return _0x716d80[_0x3342('0x16')](_0x36e1f4);}return _0x716d80[_0x3342('0x17')](_0x36e1f4)[_0x3342('0x18')]();};}function respondWithResult(_0xe4689e,_0x61fcc0){_0x61fcc0=_0x61fcc0||0xc8;return function(_0x104077){if(_0x104077){return _0xe4689e[_0x3342('0x17')](_0x61fcc0)['json'](_0x104077);}};}function respondWithFilteredResult(_0x3e44f3,_0x19bd71){return function(_0x49afe3){if(_0x49afe3){var _0x40d609=typeof _0x19bd71[_0x3342('0x19')]==='undefined'&&typeof _0x19bd71['limit']===_0x3342('0x1a');var _0x143cf1=_0x49afe3[_0x3342('0x1b')];var _0x2075cb=_0x40d609?0x0:_0x19bd71[_0x3342('0x19')];var _0x156c24=_0x40d609?_0x49afe3[_0x3342('0x1b')]:_0x19bd71[_0x3342('0x19')]+_0x19bd71[_0x3342('0x1c')];var _0x4f4c2a;if(_0x156c24>=_0x143cf1){_0x156c24=_0x143cf1;_0x4f4c2a=0xc8;}else{_0x4f4c2a=0xce;}_0x3e44f3[_0x3342('0x17')](_0x4f4c2a);return _0x3e44f3[_0x3342('0x1d')](_0x3342('0x1e'),_0x2075cb+'-'+_0x156c24+'/'+_0x143cf1)['json'](_0x49afe3);}return null;};}function patchUpdates(_0x3cb86f){return function(_0x463324){try{jsonpatch['apply'](_0x463324,_0x3cb86f,!![]);}catch(_0xe774b7){return BPromise[_0x3342('0x1f')](_0xe774b7);}return _0x463324['save']();};}function saveUpdates(_0x4e1b19,_0x5a0658){return function(_0x3f271c){if(_0x3f271c){return _0x3f271c[_0x3342('0x20')](_0x4e1b19)[_0x3342('0x21')](function(_0x2dbad1){return _0x2dbad1;});}return null;};}function removeEntity(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(_0x26eb87){return _0x26eb87[_0x3342('0x22')]()['then'](function(){_0xd2b87d[_0x3342('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51cf45,_0x986ab0){return function(_0x52ba65){if(!_0x52ba65){_0x51cf45['sendStatus'](0x194);}return _0x52ba65;};}function handleError(_0x247ee4,_0x58f0f5){_0x58f0f5=_0x58f0f5||0x1f4;return function(_0x37df78){logger['error'](_0x37df78['stack']);if(_0x37df78['name']){delete _0x37df78[_0x3342('0x23')];}_0x247ee4[_0x3342('0x17')](_0x58f0f5)[_0x3342('0x24')](_0x37df78);};}exports['index']=function(_0xc275a1,_0x1275e2){var _0x1cc542={},_0x272a52={},_0x4fbfb7={'count':0x0,'rows':[]};var _0x27e25b=_[_0x3342('0x25')](db[_0x3342('0x26')][_0x3342('0x27')],function(_0xf82530){return{'name':_0xf82530[_0x3342('0x28')],'type':_0xf82530[_0x3342('0x29')]['key']};});_0x272a52[_0x3342('0x2a')]=_['map'](_0x27e25b,_0x3342('0x23'));_0x272a52[_0x3342('0x2b')]=_['keys'](_0xc275a1[_0x3342('0x2b')]);_0x272a52[_0x3342('0x2c')]=_[_0x3342('0x2d')](_0x272a52[_0x3342('0x2a')],_0x272a52['query']);_0x1cc542[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x272a52[_0x3342('0x2a')],qs[_0x3342('0x2f')](_0xc275a1[_0x3342('0x2b')][_0x3342('0x2f')]));_0x1cc542[_0x3342('0x2e')]=_0x1cc542[_0x3342('0x2e')][_0x3342('0x30')]?_0x1cc542[_0x3342('0x2e')]:_0x272a52[_0x3342('0x2a')];if(!_0xc275a1[_0x3342('0x2b')]['hasOwnProperty']('nolimit')){_0x1cc542[_0x3342('0x1c')]=qs['limit'](_0xc275a1[_0x3342('0x2b')][_0x3342('0x1c')]);_0x1cc542[_0x3342('0x19')]=qs[_0x3342('0x19')](_0xc275a1[_0x3342('0x2b')][_0x3342('0x19')]);}_0x1cc542[_0x3342('0x31')]=qs['sort'](_0xc275a1[_0x3342('0x2b')][_0x3342('0x32')]);_0x1cc542[_0x3342('0x33')]=qs[_0x3342('0x2c')](_[_0x3342('0x34')](_0xc275a1['query'],_0x272a52[_0x3342('0x2c')]),_0x27e25b);if(_0xc275a1['query'][_0x3342('0x35')]){_0x1cc542[_0x3342('0x33')]=_[_0x3342('0x36')](_0x1cc542[_0x3342('0x33')],{'$or':_['map'](_0x27e25b,function(_0x370cfa){if(_0x370cfa['type']!==_0x3342('0x37')){var _0x128657={};_0x128657[_0x370cfa[_0x3342('0x23')]]={'$like':'%'+_0xc275a1[_0x3342('0x2b')][_0x3342('0x35')]+'%'};return _0x128657;}})});}_0x1cc542=_[_0x3342('0x36')]({},_0x1cc542,_0xc275a1[_0x3342('0x38')]);var _0x52cdc0={'where':_0x1cc542[_0x3342('0x33')]};return db[_0x3342('0x26')]['count'](_0x52cdc0)[_0x3342('0x21')](function(_0x1f336c){_0x4fbfb7['count']=_0x1f336c;if(_0xc275a1[_0x3342('0x2b')][_0x3342('0x39')]){_0x1cc542['include']=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x1cc542);})[_0x3342('0x21')](function(_0x41e727){_0x4fbfb7['rows']=_0x41e727;return _0x4fbfb7;})[_0x3342('0x21')](respondWithFilteredResult(_0x1275e2,_0x1cc542))[_0x3342('0x3a')](handleError(_0x1275e2,null));};exports[_0x3342('0x3b')]=function(_0x17fd01,_0x126ee4){var _0x308363={'raw':!![],'where':{'id':_0x17fd01[_0x3342('0x3c')]['id']}},_0x34de7b={};_0x34de7b['model']=_['keys'](db[_0x3342('0x26')][_0x3342('0x27')]);_0x34de7b[_0x3342('0x2b')]=_[_0x3342('0x3d')](_0x17fd01[_0x3342('0x2b')]);_0x34de7b[_0x3342('0x2c')]=_['intersection'](_0x34de7b[_0x3342('0x2a')],_0x34de7b[_0x3342('0x2b')]);_0x308363[_0x3342('0x2e')]=_[_0x3342('0x2d')](_0x34de7b[_0x3342('0x2a')],qs[_0x3342('0x2f')](_0x17fd01['query'][_0x3342('0x2f')]));_0x308363['attributes']=_0x308363[_0x3342('0x2e')][_0x3342('0x30')]?_0x308363[_0x3342('0x2e')]:_0x34de7b[_0x3342('0x2a')];if(_0x17fd01['query'][_0x3342('0x39')]){_0x308363[_0x3342('0x3e')]=[{'all':!![]}];}_0x308363=_['merge']({},_0x308363,_0x17fd01[_0x3342('0x38')]);return db[_0x3342('0x26')][_0x3342('0x3f')](_0x308363)[_0x3342('0x21')](handleEntityNotFound(_0x126ee4,null))['then'](respondWithResult(_0x126ee4,null))[_0x3342('0x3a')](handleError(_0x126ee4,null));};exports[_0x3342('0x40')]=function(_0x56b465,_0x1fc491){return db['SquareMessage']['create'](_0x56b465[_0x3342('0x41')],{})[_0x3342('0x21')](respondWithResult(_0x1fc491,0xc9))[_0x3342('0x3a')](handleError(_0x1fc491,null));};exports[_0x3342('0x20')]=function(_0x23925e,_0x171387){if(_0x23925e[_0x3342('0x41')]['id']){delete _0x23925e['body']['id'];}return db['SquareMessage'][_0x3342('0x3f')]({'where':{'id':_0x23925e['params']['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x171387,null))['then'](saveUpdates(_0x23925e['body'],null))['then'](respondWithResult(_0x171387,null))[_0x3342('0x3a')](handleError(_0x171387,null));};exports[_0x3342('0x22')]=function(_0x29ccb6,_0x186a2a){return db['SquareMessage'][_0x3342('0x3f')]({'where':{'id':_0x29ccb6[_0x3342('0x3c')]['id']}})['then'](handleEntityNotFound(_0x186a2a,null))[_0x3342('0x21')](removeEntity(_0x186a2a,null))[_0x3342('0x3a')](handleError(_0x186a2a,null));}; \ No newline at end of file +var _0x65c9=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x65c9,0x182));var _0x965c=function(_0x2a8af1,_0x3d79dd){_0x2a8af1=_0x2a8af1-0x0;var _0x4eed9a=_0x65c9[_0x2a8af1];return _0x4eed9a;};'use strict';var emlformat=require(_0x965c('0x0'));var rimraf=require(_0x965c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x965c('0x2'));var rp=require(_0x965c('0x3'));var moment=require(_0x965c('0x4'));var BPromise=require(_0x965c('0x5'));var Mustache=require(_0x965c('0x6'));var util=require(_0x965c('0x7'));var path=require(_0x965c('0x8'));var sox=require(_0x965c('0x9'));var csv=require(_0x965c('0xa'));var ejs=require(_0x965c('0xb'));var fs=require('fs');var fs_extra=require(_0x965c('0xc'));var _=require(_0x965c('0xd'));var squel=require('squel');var crypto=require(_0x965c('0xe'));var jsforce=require(_0x965c('0xf'));var deskjs=require(_0x965c('0x10'));var toCsv=require(_0x965c('0xa'));var querystring=require(_0x965c('0x11'));var Papa=require(_0x965c('0x12'));var Redis=require(_0x965c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x965c('0x14'));var as=require(_0x965c('0x15'));var hardwareService=require(_0x965c('0x16'));var logger=require(_0x965c('0x17'))(_0x965c('0x18'));var utils=require(_0x965c('0x19'));var config=require(_0x965c('0x1a'));var licenseUtil=require(_0x965c('0x1b'));var db=require(_0x965c('0x1c'))['db'];function respondWithStatusCode(_0x3ff4ea,_0x154827){_0x154827=_0x154827||0xcc;return function(_0x1d5cb4){if(_0x1d5cb4){return _0x3ff4ea[_0x965c('0x1d')](_0x154827);}return _0x3ff4ea[_0x965c('0x1e')](_0x154827)['end']();};}function respondWithResult(_0x1e343c,_0x26618f){_0x26618f=_0x26618f||0xc8;return function(_0x2901f7){if(_0x2901f7){return _0x1e343c['status'](_0x26618f)[_0x965c('0x1f')](_0x2901f7);}};}function respondWithFilteredResult(_0x2a9580,_0x20dee0){return function(_0x4f61de){if(_0x4f61de){var _0x1c820a=typeof _0x20dee0['offset']==='undefined'&&typeof _0x20dee0['limit']===_0x965c('0x20');var _0xeaf323=_0x4f61de[_0x965c('0x21')];var _0x14e990=_0x1c820a?0x0:_0x20dee0['offset'];var _0x590c6a=_0x1c820a?_0x4f61de['count']:_0x20dee0[_0x965c('0x22')]+_0x20dee0[_0x965c('0x23')];var _0x2e5608;if(_0x590c6a>=_0xeaf323){_0x590c6a=_0xeaf323;_0x2e5608=0xc8;}else{_0x2e5608=0xce;}_0x2a9580[_0x965c('0x1e')](_0x2e5608);return _0x2a9580[_0x965c('0x24')](_0x965c('0x25'),_0x14e990+'-'+_0x590c6a+'/'+_0xeaf323)[_0x965c('0x1f')](_0x4f61de);}return null;};}function patchUpdates(_0x3f5ec9){return function(_0x11f510){try{jsonpatch[_0x965c('0x26')](_0x11f510,_0x3f5ec9,!![]);}catch(_0xa2c510){return BPromise['reject'](_0xa2c510);}return _0x11f510[_0x965c('0x27')]();};}function saveUpdates(_0x230d38,_0x4e345c){return function(_0x490626){if(_0x490626){return _0x490626[_0x965c('0x28')](_0x230d38)['then'](function(_0x4393aa){return _0x4393aa;});}return null;};}function removeEntity(_0x2ac16c,_0x3dcfa2){return function(_0x4d41e5){if(_0x4d41e5){return _0x4d41e5[_0x965c('0x29')]()[_0x965c('0x2a')](function(){_0x2ac16c[_0x965c('0x1e')](0xcc)[_0x965c('0x2b')]();});}};}function handleEntityNotFound(_0x5ddefa,_0x169619){return function(_0x4db10a){if(!_0x4db10a){_0x5ddefa['sendStatus'](0x194);}return _0x4db10a;};}function handleError(_0x4d19f6,_0xc5d241){_0xc5d241=_0xc5d241||0x1f4;return function(_0x327aa6){logger[_0x965c('0x2c')](_0x327aa6['stack']);if(_0x327aa6['name']){delete _0x327aa6[_0x965c('0x2d')];}_0x4d19f6['status'](_0xc5d241)[_0x965c('0x2e')](_0x327aa6);};}exports['index']=function(_0x4e00d4,_0xa21a2f){var _0x9227f8={},_0x8f9853={},_0x17a7bd={'count':0x0,'rows':[]};var _0x392a54=_[_0x965c('0x2f')](db[_0x965c('0x30')][_0x965c('0x31')],function(_0x570fa6){return{'name':_0x570fa6[_0x965c('0x32')],'type':_0x570fa6[_0x965c('0x33')][_0x965c('0x34')]};});_0x8f9853[_0x965c('0x35')]=_[_0x965c('0x2f')](_0x392a54,_0x965c('0x2d'));_0x8f9853[_0x965c('0x36')]=_[_0x965c('0x37')](_0x4e00d4['query']);_0x8f9853[_0x965c('0x38')]=_['intersection'](_0x8f9853['model'],_0x8f9853[_0x965c('0x36')]);_0x9227f8[_0x965c('0x39')]=_[_0x965c('0x3a')](_0x8f9853['model'],qs[_0x965c('0x3b')](_0x4e00d4[_0x965c('0x36')][_0x965c('0x3b')]));_0x9227f8['attributes']=_0x9227f8[_0x965c('0x39')][_0x965c('0x3c')]?_0x9227f8[_0x965c('0x39')]:_0x8f9853['model'];if(!_0x4e00d4[_0x965c('0x36')][_0x965c('0x3d')](_0x965c('0x3e'))){_0x9227f8[_0x965c('0x23')]=qs[_0x965c('0x23')](_0x4e00d4[_0x965c('0x36')]['limit']);_0x9227f8[_0x965c('0x22')]=qs[_0x965c('0x22')](_0x4e00d4[_0x965c('0x36')][_0x965c('0x22')]);}_0x9227f8[_0x965c('0x3f')]=qs[_0x965c('0x40')](_0x4e00d4[_0x965c('0x36')][_0x965c('0x40')]);_0x9227f8['where']=qs[_0x965c('0x38')](_[_0x965c('0x41')](_0x4e00d4[_0x965c('0x36')],_0x8f9853[_0x965c('0x38')]),_0x392a54);if(_0x4e00d4['query'][_0x965c('0x42')]){_0x9227f8[_0x965c('0x43')]=_[_0x965c('0x44')](_0x9227f8[_0x965c('0x43')],{'$or':_['map'](_0x392a54,function(_0xd48e10){if(_0xd48e10['type']!==_0x965c('0x45')){var _0x232fab={};_0x232fab[_0xd48e10[_0x965c('0x2d')]]={'$like':'%'+_0x4e00d4[_0x965c('0x36')][_0x965c('0x42')]+'%'};return _0x232fab;}})});}_0x9227f8=_['merge']({},_0x9227f8,_0x4e00d4[_0x965c('0x46')]);var _0x278779={'where':_0x9227f8[_0x965c('0x43')]};return db[_0x965c('0x30')][_0x965c('0x21')](_0x278779)[_0x965c('0x2a')](function(_0x2a93a7){_0x17a7bd[_0x965c('0x21')]=_0x2a93a7;if(_0x4e00d4['query'][_0x965c('0x47')]){_0x9227f8[_0x965c('0x48')]=[{'all':!![]}];}return db[_0x965c('0x30')][_0x965c('0x49')](_0x9227f8);})[_0x965c('0x2a')](function(_0x3e6a26){_0x17a7bd[_0x965c('0x4a')]=_0x3e6a26;return _0x17a7bd;})[_0x965c('0x2a')](respondWithFilteredResult(_0xa21a2f,_0x9227f8))[_0x965c('0x4b')](handleError(_0xa21a2f,null));};exports[_0x965c('0x4c')]=function(_0x4f579b,_0x268dd1){var _0x513a94={'raw':!![],'where':{'id':_0x4f579b['params']['id']}},_0x2090e4={};_0x2090e4[_0x965c('0x35')]=_[_0x965c('0x37')](db[_0x965c('0x30')][_0x965c('0x31')]);_0x2090e4[_0x965c('0x36')]=_[_0x965c('0x37')](_0x4f579b['query']);_0x2090e4['filters']=_[_0x965c('0x3a')](_0x2090e4[_0x965c('0x35')],_0x2090e4['query']);_0x513a94[_0x965c('0x39')]=_[_0x965c('0x3a')](_0x2090e4[_0x965c('0x35')],qs['fields'](_0x4f579b[_0x965c('0x36')][_0x965c('0x3b')]));_0x513a94[_0x965c('0x39')]=_0x513a94[_0x965c('0x39')][_0x965c('0x3c')]?_0x513a94[_0x965c('0x39')]:_0x2090e4[_0x965c('0x35')];if(_0x4f579b[_0x965c('0x36')]['includeAll']){_0x513a94['include']=[{'all':!![]}];}_0x513a94=_['merge']({},_0x513a94,_0x4f579b[_0x965c('0x46')]);return db[_0x965c('0x30')][_0x965c('0x4d')](_0x513a94)['then'](handleEntityNotFound(_0x268dd1,null))['then'](respondWithResult(_0x268dd1,null))['catch'](handleError(_0x268dd1,null));};exports['create']=function(_0x32a80e,_0x5eb4e6){return db[_0x965c('0x30')][_0x965c('0x4e')](_0x32a80e[_0x965c('0x4f')],{})[_0x965c('0x2a')](respondWithResult(_0x5eb4e6,0xc9))[_0x965c('0x4b')](handleError(_0x5eb4e6,null));};exports[_0x965c('0x28')]=function(_0x592e8b,_0x331b6f){if(_0x592e8b[_0x965c('0x4f')]['id']){delete _0x592e8b[_0x965c('0x4f')]['id'];}return db['SquareMessage'][_0x965c('0x4d')]({'where':{'id':_0x592e8b[_0x965c('0x50')]['id']}})[_0x965c('0x2a')](handleEntityNotFound(_0x331b6f,null))['then'](saveUpdates(_0x592e8b['body'],null))[_0x965c('0x2a')](respondWithResult(_0x331b6f,null))[_0x965c('0x4b')](handleError(_0x331b6f,null));};exports[_0x965c('0x29')]=function(_0x3e6e09,_0xb4c48){return db[_0x965c('0x30')][_0x965c('0x4d')]({'where':{'id':_0x3e6e09[_0x965c('0x50')]['id']}})[_0x965c('0x2a')](handleEntityNotFound(_0xb4c48,null))[_0x965c('0x2a')](removeEntity(_0xb4c48,null))[_0x965c('0x4b')](handleError(_0xb4c48,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 12245ec..58c208c 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 _0xcd35=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','SquareMessage','square_messages'];(function(_0x157e7f,_0x1138de){var _0x642ae8=function(_0x5db87d){while(--_0x5db87d){_0x157e7f['push'](_0x157e7f['shift']());}};_0x642ae8(++_0x1138de);}(_0xcd35,0x11e));var _0x5cd3=function(_0x35118e,_0x469457){_0x35118e=_0x35118e-0x0;var _0x1a4d6c=_0xcd35[_0x35118e];return _0x1a4d6c;};'use strict';var _=require(_0x5cd3('0x0'));var util=require(_0x5cd3('0x1'));var logger=require(_0x5cd3('0x2'))(_0x5cd3('0x3'));var moment=require(_0x5cd3('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cd3('0x5'));var fs=require('fs');var path=require(_0x5cd3('0x6'));var rimraf=require(_0x5cd3('0x7'));var config=require(_0x5cd3('0x8'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x442698,_0x5d9fef){return _0x442698['define'](_0x5cd3('0x9'),attributes,{'tableName':_0x5cd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76ed=['SquareMessage','lodash','api','request-promise','path','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x8bca3f,_0x158cf8){var _0x448ab5=function(_0x5b5537){while(--_0x5b5537){_0x8bca3f['push'](_0x8bca3f['shift']());}};_0x448ab5(++_0x158cf8);}(_0x76ed,0x1e7));var _0xd76e=function(_0x4c0699,_0x1f326d){_0x4c0699=_0x4c0699-0x0;var _0x472d6f=_0x76ed[_0x4c0699];return _0x472d6f;};'use strict';var _=require(_0xd76e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd76e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd76e('0x2'));var fs=require('fs');var path=require(_0xd76e('0x3'));var rimraf=require('rimraf');var config=require(_0xd76e('0x4'));var attributes=require(_0xd76e('0x5'));module[_0xd76e('0x6')]=function(_0x4f367f,_0x4cc66b){return _0x4f367f[_0xd76e('0x7')](_0xd76e('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index e0666ef..8361cb1 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 _0xd08e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','body','options','raw','CreateSquareMessage','lodash','util','moment','randomstring','ioredis'];(function(_0x1e20fc,_0x5da135){var _0x306a71=function(_0x33c657){while(--_0x33c657){_0x1e20fc['push'](_0x1e20fc['shift']());}};_0x306a71(++_0x5da135);}(_0xd08e,0x113));var _0xed08=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xd08e[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0xed08('0x0'));var util=require(_0xed08('0x1'));var moment=require(_0xed08('0x2'));var BPromise=require('bluebird');var rs=require(_0xed08('0x3'));var fs=require('fs');var Redis=require(_0xed08('0x4'));var db=require(_0xed08('0x5'))['db'];var utils=require(_0xed08('0x6'));var logger=require(_0xed08('0x7'))(_0xed08('0x8'));var config=require(_0xed08('0x9'));var jayson=require(_0xed08('0xa'));var client=jayson['client'][_0xed08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e86eb,_0xea44fc,_0xeda38e){return new BPromise(function(_0x50c939,_0x5614cd){return client[_0xed08('0xc')](_0x1e86eb,_0xeda38e)['then'](function(_0x1f945){logger[_0xed08('0xd')](_0xed08('0xe'),_0xea44fc,_0xed08('0xf'));logger[_0xed08('0x10')](_0xed08('0x11'),_0xea44fc,_0xed08('0xf'),JSON[_0xed08('0x12')](_0x1f945));if(_0x1f945['error']){if(_0x1f945[_0xed08('0x13')]['code']===0x1f4){logger[_0xed08('0x13')](_0xed08('0xe'),_0xea44fc,_0x1f945['error'][_0xed08('0x14')]);return _0x5614cd(_0x1f945[_0xed08('0x13')][_0xed08('0x14')]);}logger[_0xed08('0x13')]('SquareMessage,\x20%s,\x20%s',_0xea44fc,_0x1f945[_0xed08('0x13')][_0xed08('0x14')]);return _0x50c939(_0x1f945['error']['message']);}else{logger[_0xed08('0xd')]('SquareMessage,\x20%s,\x20%s',_0xea44fc,'request\x20sent');_0x50c939(_0x1f945[_0xed08('0x15')][_0xed08('0x14')]);}})[_0xed08('0x16')](function(_0x52685e){logger[_0xed08('0x13')](_0xed08('0xe'),_0xea44fc,_0x52685e);_0x5614cd(_0x52685e);});});}exports['CreateSquareMessage']=function(_0x39541f){var _0x153bfd=this;return new Promise(function(_0x15dec8,_0x3b2f9a){return db[_0xed08('0x17')]['create'](_0x39541f[_0xed08('0x18')],{'raw':_0x39541f['options']?_0x39541f[_0xed08('0x19')][_0xed08('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4cc09c){logger[_0xed08('0xd')](_0xed08('0x1b'),_0x39541f);logger[_0xed08('0x10')](_0xed08('0x1b'),_0x39541f,JSON[_0xed08('0x12')](_0x4cc09c));_0x15dec8(_0x4cc09c);})['catch'](function(_0x2842d7){logger[_0xed08('0x13')](_0xed08('0x1b'),_0x2842d7[_0xed08('0x14')],_0x39541f);_0x3b2f9a(_0x153bfd[_0xed08('0x13')](0x1f4,_0x2842d7[_0xed08('0x14')]));});});}; \ No newline at end of file +var _0x7b82=['result','catch','CreateSquareMessage','SquareMessage','options','then','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','info','SquareMessage,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x1275fe,_0xee2c86){var _0x57db9d=function(_0xb2f944){while(--_0xb2f944){_0x1275fe['push'](_0x1275fe['shift']());}};_0x57db9d(++_0xee2c86);}(_0x7b82,0xa8));var _0x27b8=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x7b82[_0x100e36];return _0x1df0c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27b8('0x0'));var BPromise=require('bluebird');var rs=require(_0x27b8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27b8('0x2'))['db'];var utils=require(_0x27b8('0x3'));var logger=require('../../config/logger')(_0x27b8('0x4'));var config=require('../../config/environment');var jayson=require(_0x27b8('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee26b,_0x5b23c6,_0x5f5b36){return new BPromise(function(_0x3fdfa7,_0x36fabb){return client['request'](_0x3ee26b,_0x5f5b36)['then'](function(_0x4cf2c3){logger[_0x27b8('0x6')](_0x27b8('0x7'),_0x5b23c6,'request\x20sent');logger[_0x27b8('0x8')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5b23c6,'request\x20sent',JSON[_0x27b8('0x9')](_0x4cf2c3));if(_0x4cf2c3[_0x27b8('0xa')]){if(_0x4cf2c3[_0x27b8('0xa')]['code']===0x1f4){logger[_0x27b8('0xa')](_0x27b8('0x7'),_0x5b23c6,_0x4cf2c3[_0x27b8('0xa')]['message']);return _0x36fabb(_0x4cf2c3['error']['message']);}logger['error'](_0x27b8('0x7'),_0x5b23c6,_0x4cf2c3[_0x27b8('0xa')][_0x27b8('0xb')]);return _0x3fdfa7(_0x4cf2c3['error'][_0x27b8('0xb')]);}else{logger[_0x27b8('0x6')](_0x27b8('0x7'),_0x5b23c6,'request\x20sent');_0x3fdfa7(_0x4cf2c3[_0x27b8('0xc')]['message']);}})[_0x27b8('0xd')](function(_0x4907d6){logger[_0x27b8('0xa')](_0x27b8('0x7'),_0x5b23c6,_0x4907d6);_0x36fabb(_0x4907d6);});});}exports[_0x27b8('0xe')]=function(_0x2f8e76){var _0x9cc703=this;return new Promise(function(_0x487fcc,_0x2cb3a3){return db[_0x27b8('0xf')]['create'](_0x2f8e76['body'],{'raw':_0x2f8e76[_0x27b8('0x10')]?_0x2f8e76[_0x27b8('0x10')]['raw']===undefined?!![]:![]:!![]})[_0x27b8('0x11')](function(_0x28b567){logger[_0x27b8('0x6')]('CreateSquareMessage',_0x2f8e76);logger[_0x27b8('0x8')](_0x27b8('0xe'),_0x2f8e76,JSON['stringify'](_0x28b567));_0x487fcc(_0x28b567);})[_0x27b8('0xd')](function(_0x119c21){logger[_0x27b8('0xa')](_0x27b8('0xe'),_0x119c21[_0x27b8('0xb')],_0x2f8e76);_0x2cb3a3(_0x9cc703[_0x27b8('0xa')](0x1f4,_0x119c21[_0x27b8('0xb')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c8fe66f..ad5fd59 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 _0x3ad0=['index','/:id','show','/:id/test','15s','create','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x3ad0,0x81));var _0x03ad=function(_0x29654d,_0xef2652){_0x29654d=_0x29654d-0x0;var _0x2b6798=_0x3ad0[_0x29654d];return _0x2b6798;};'use strict';var multer=require(_0x03ad('0x0'));var util=require(_0x03ad('0x1'));var path=require(_0x03ad('0x2'));var timeout=require(_0x03ad('0x3'));var express=require('express');var router=express[_0x03ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x03ad('0x5'));var interaction=require(_0x03ad('0x6'));var config=require(_0x03ad('0x7'));var controller=require(_0x03ad('0x8'));router[_0x03ad('0x9')]('/',auth[_0x03ad('0xa')](),controller[_0x03ad('0xb')]);router[_0x03ad('0x9')](_0x03ad('0xc'),auth[_0x03ad('0xa')](),controller[_0x03ad('0xd')]);router[_0x03ad('0x9')](_0x03ad('0xe'),auth['isAuthenticated'](),timeout(_0x03ad('0xf')),controller['test']);router['post']('/',auth[_0x03ad('0xa')](),controller[_0x03ad('0x10')]);router['put'](_0x03ad('0xc'),auth['isAuthenticated'](),controller[_0x03ad('0x11')]);router[_0x03ad('0x12')]('/:id',auth[_0x03ad('0xa')](),controller['destroy']);module[_0x03ad('0x13')]=router; \ No newline at end of file +var _0xce73=['/:id','show','15s','test','post','create','put','update','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index'];(function(_0x373a23,_0x21b5de){var _0x16d483=function(_0x34f6fd){while(--_0x34f6fd){_0x373a23['push'](_0x373a23['shift']());}};_0x16d483(++_0x21b5de);}(_0xce73,0x8d));var _0x3ce7=function(_0x56e476,_0x1cfc79){_0x56e476=_0x56e476-0x0;var _0x4a9704=_0xce73[_0x56e476];return _0x4a9704;};'use strict';var multer=require(_0x3ce7('0x0'));var util=require(_0x3ce7('0x1'));var path=require(_0x3ce7('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ce7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ce7('0x4'));var interaction=require(_0x3ce7('0x5'));var config=require(_0x3ce7('0x6'));var controller=require(_0x3ce7('0x7'));router[_0x3ce7('0x8')]('/',auth[_0x3ce7('0x9')](),controller[_0x3ce7('0xa')]);router['get'](_0x3ce7('0xb'),auth[_0x3ce7('0x9')](),controller[_0x3ce7('0xc')]);router['get']('/:id/test',auth[_0x3ce7('0x9')](),timeout(_0x3ce7('0xd')),controller[_0x3ce7('0xe')]);router[_0x3ce7('0xf')]('/',auth[_0x3ce7('0x9')](),controller[_0x3ce7('0x10')]);router[_0x3ce7('0x11')](_0x3ce7('0xb'),auth[_0x3ce7('0x9')](),controller[_0x3ce7('0x12')]);router['delete']('/:id',auth[_0x3ce7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8eafb84..c06967a 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 _0x929b=['STRING','sequelize','exports'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x929b,0x148));var _0xb929=function(_0x582ccd,_0xa9ab43){_0x582ccd=_0x582ccd-0x0;var _0x11545d=_0x929b[_0x582ccd];return _0x11545d;};'use strict';var Sequelize=require(_0xb929('0x0'));module[_0xb929('0x1')]={'name':{'type':Sequelize[_0xb929('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb929('0x2')]}}; \ No newline at end of file +var _0x6ba4=['exports','STRING','sequelize'];(function(_0x2df84d,_0x56d874){var _0x2634ce=function(_0x8e8e31){while(--_0x8e8e31){_0x2df84d['push'](_0x2df84d['shift']());}};_0x2634ce(++_0x56d874);}(_0x6ba4,0x1d9));var _0x46ba=function(_0xfd2aa,_0x5ddbcf){_0xfd2aa=_0xfd2aa-0x0;var _0x289511=_0x6ba4[_0xfd2aa];return _0x289511;};'use strict';var Sequelize=require(_0x46ba('0x0'));module[_0x46ba('0x1')]={'name':{'type':Sequelize[_0x46ba('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index bf443bc..f7cff52 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 _0xfbfd=['params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','eml-format','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch'];(function(_0x37deac,_0xe425d0){var _0x5d944c=function(_0x278e8c){while(--_0x278e8c){_0x37deac['push'](_0x37deac['shift']());}};_0x5d944c(++_0xe425d0);}(_0xfbfd,0xc4));var _0xdfbf=function(_0x50c3ff,_0x5eca99){_0x50c3ff=_0x50c3ff-0x0;var _0x18a9b3=_0xfbfd[_0x50c3ff];return _0x18a9b3;};'use strict';var emlformat=require(_0xdfbf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdfbf('0x1'));var BPromise=require(_0xdfbf('0x2'));var Mustache=require('mustache');var util=require(_0xdfbf('0x3'));var path=require(_0xdfbf('0x4'));var sox=require(_0xdfbf('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfbf('0x6'));var _=require('lodash');var squel=require(_0xdfbf('0x7'));var crypto=require(_0xdfbf('0x8'));var jsforce=require(_0xdfbf('0x9'));var deskjs=require(_0xdfbf('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdfbf('0xb'));var Redis=require(_0xdfbf('0xc'));var authService=require(_0xdfbf('0xd'));var qs=require(_0xdfbf('0xe'));var as=require(_0xdfbf('0xf'));var hardwareService=require(_0xdfbf('0x10'));var logger=require(_0xdfbf('0x11'))(_0xdfbf('0x12'));var utils=require('../../config/utils');var config=require(_0xdfbf('0x13'));var licenseUtil=require(_0xdfbf('0x14'));var db=require(_0xdfbf('0x15'))['db'];function respondWithStatusCode(_0x4d87ba,_0x20f9ab){_0x20f9ab=_0x20f9ab||0xcc;return function(_0x3b6601){if(_0x3b6601){return _0x4d87ba['sendStatus'](_0x20f9ab);}return _0x4d87ba[_0xdfbf('0x16')](_0x20f9ab)[_0xdfbf('0x17')]();};}function respondWithResult(_0x1d2f1c,_0x4e109b){_0x4e109b=_0x4e109b||0xc8;return function(_0x7caf4b){if(_0x7caf4b){return _0x1d2f1c[_0xdfbf('0x16')](_0x4e109b)['json'](_0x7caf4b);}};}function respondWithFilteredResult(_0x37eccb,_0x476b75){return function(_0x4e6cc0){if(_0x4e6cc0){var _0x36bcce=typeof _0x476b75[_0xdfbf('0x18')]==='undefined'&&typeof _0x476b75[_0xdfbf('0x19')]==='undefined';var _0x34cd7e=_0x4e6cc0[_0xdfbf('0x1a')];var _0x4648f5=_0x36bcce?0x0:_0x476b75[_0xdfbf('0x18')];var _0x1799d5=_0x36bcce?_0x4e6cc0[_0xdfbf('0x1a')]:_0x476b75['offset']+_0x476b75[_0xdfbf('0x19')];var _0x237883;if(_0x1799d5>=_0x34cd7e){_0x1799d5=_0x34cd7e;_0x237883=0xc8;}else{_0x237883=0xce;}_0x37eccb[_0xdfbf('0x16')](_0x237883);return _0x37eccb[_0xdfbf('0x1b')](_0xdfbf('0x1c'),_0x4648f5+'-'+_0x1799d5+'/'+_0x34cd7e)[_0xdfbf('0x1d')](_0x4e6cc0);}return null;};}function patchUpdates(_0x4c9a95){return function(_0x5a02f5){try{jsonpatch[_0xdfbf('0x1e')](_0x5a02f5,_0x4c9a95,!![]);}catch(_0x223fc1){return BPromise[_0xdfbf('0x1f')](_0x223fc1);}return _0x5a02f5[_0xdfbf('0x20')]();};}function saveUpdates(_0x129e2b,_0x4c4c17){return function(_0x4dbfc7){if(_0x4dbfc7){return _0x4dbfc7[_0xdfbf('0x21')](_0x129e2b)['then'](function(_0x16895a){return _0x16895a;});}return null;};}function removeEntity(_0x119128,_0x14db8b){return function(_0x3bf9c9){if(_0x3bf9c9){return _0x3bf9c9['destroy']()[_0xdfbf('0x22')](function(){var _0x58ae19=_0x3bf9c9[_0xdfbf('0x23')]({'plain':!![]});var _0x7a9376='ODBC';return db['UserProfileResource'][_0xdfbf('0x24')]({'where':{'type':_0x7a9376,'resourceId':_0x58ae19['id']}})[_0xdfbf('0x22')](function(){return _0x3bf9c9;});})[_0xdfbf('0x22')](function(){_0x119128[_0xdfbf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e91f5,_0x194055){return function(_0xda8557){if(!_0xda8557){_0x1e91f5[_0xdfbf('0x25')](0x194);}return _0xda8557;};}function handleError(_0x3512b5,_0x4b0ad4){_0x4b0ad4=_0x4b0ad4||0x1f4;return function(_0x3eccec){logger[_0xdfbf('0x26')](_0x3eccec[_0xdfbf('0x27')]);if(_0x3eccec[_0xdfbf('0x28')]){delete _0x3eccec[_0xdfbf('0x28')];}_0x3512b5['status'](_0x4b0ad4)[_0xdfbf('0x29')](_0x3eccec);};}exports[_0xdfbf('0x2a')]=function(_0x2ff042,_0x4d07aa){var _0x1779e4={},_0xe5da75={},_0x2400b0={'count':0x0,'rows':[]};var _0x4173be=_[_0xdfbf('0x2b')](db['SquareOdbc'][_0xdfbf('0x2c')],function(_0x1070f6){return{'name':_0x1070f6[_0xdfbf('0x2d')],'type':_0x1070f6[_0xdfbf('0x2e')][_0xdfbf('0x2f')]};});_0xe5da75[_0xdfbf('0x30')]=_[_0xdfbf('0x2b')](_0x4173be,_0xdfbf('0x28'));_0xe5da75[_0xdfbf('0x31')]=_[_0xdfbf('0x32')](_0x2ff042['query']);_0xe5da75[_0xdfbf('0x33')]=_[_0xdfbf('0x34')](_0xe5da75[_0xdfbf('0x30')],_0xe5da75['query']);_0x1779e4[_0xdfbf('0x35')]=_['intersection'](_0xe5da75['model'],qs[_0xdfbf('0x36')](_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x36')]));_0x1779e4[_0xdfbf('0x35')]=_0x1779e4[_0xdfbf('0x35')][_0xdfbf('0x37')]?_0x1779e4[_0xdfbf('0x35')]:_0xe5da75[_0xdfbf('0x30')];if(!_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x38')](_0xdfbf('0x39'))){_0x1779e4[_0xdfbf('0x19')]=qs[_0xdfbf('0x19')](_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x19')]);_0x1779e4[_0xdfbf('0x18')]=qs[_0xdfbf('0x18')](_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x18')]);}_0x1779e4['order']=qs['sort'](_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x3a')]);_0x1779e4['where']=qs[_0xdfbf('0x33')](_[_0xdfbf('0x3b')](_0x2ff042[_0xdfbf('0x31')],_0xe5da75[_0xdfbf('0x33')]),_0x4173be);if(_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x3c')]){_0x1779e4['where']=_[_0xdfbf('0x3d')](_0x1779e4[_0xdfbf('0x3e')],{'$or':_[_0xdfbf('0x2b')](_0x4173be,function(_0x4e83a2){if(_0x4e83a2[_0xdfbf('0x2e')]!==_0xdfbf('0x3f')){var _0x134cf0={};_0x134cf0[_0x4e83a2[_0xdfbf('0x28')]]={'$like':'%'+_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x3c')]+'%'};return _0x134cf0;}})});}_0x1779e4=_[_0xdfbf('0x3d')]({},_0x1779e4,_0x2ff042[_0xdfbf('0x40')]);var _0x4ecb40={'where':_0x1779e4[_0xdfbf('0x3e')]};return db[_0xdfbf('0x41')][_0xdfbf('0x1a')](_0x4ecb40)['then'](function(_0x1b61c3){_0x2400b0[_0xdfbf('0x1a')]=_0x1b61c3;if(_0x2ff042[_0xdfbf('0x31')][_0xdfbf('0x42')]){_0x1779e4[_0xdfbf('0x43')]=[{'all':!![]}];}return db[_0xdfbf('0x41')][_0xdfbf('0x44')](_0x1779e4);})[_0xdfbf('0x22')](function(_0x45c88f){_0x2400b0[_0xdfbf('0x45')]=_0x45c88f;return _0x2400b0;})['then'](respondWithFilteredResult(_0x4d07aa,_0x1779e4))[_0xdfbf('0x46')](handleError(_0x4d07aa,null));};exports['show']=function(_0x5e642f,_0xa20d5a){var _0x3bbfd9={'raw':!![],'where':{'id':_0x5e642f[_0xdfbf('0x47')]['id']}},_0x352562={};_0x352562[_0xdfbf('0x30')]=_['keys'](db['SquareOdbc']['rawAttributes']);_0x352562['query']=_['keys'](_0x5e642f[_0xdfbf('0x31')]);_0x352562[_0xdfbf('0x33')]=_[_0xdfbf('0x34')](_0x352562[_0xdfbf('0x30')],_0x352562['query']);_0x3bbfd9['attributes']=_[_0xdfbf('0x34')](_0x352562[_0xdfbf('0x30')],qs['fields'](_0x5e642f[_0xdfbf('0x31')][_0xdfbf('0x36')]));_0x3bbfd9[_0xdfbf('0x35')]=_0x3bbfd9[_0xdfbf('0x35')][_0xdfbf('0x37')]?_0x3bbfd9[_0xdfbf('0x35')]:_0x352562['model'];if(_0x5e642f[_0xdfbf('0x31')][_0xdfbf('0x42')]){_0x3bbfd9[_0xdfbf('0x43')]=[{'all':!![]}];}_0x3bbfd9=_[_0xdfbf('0x3d')]({},_0x3bbfd9,_0x5e642f[_0xdfbf('0x40')]);return db[_0xdfbf('0x41')][_0xdfbf('0x48')](_0x3bbfd9)['then'](handleEntityNotFound(_0xa20d5a,null))[_0xdfbf('0x22')](respondWithResult(_0xa20d5a,null))['catch'](handleError(_0xa20d5a,null));};exports[_0xdfbf('0x49')]=function(_0x28d4bf,_0x1682b1){return db[_0xdfbf('0x41')]['create'](_0x28d4bf['body'],{})['then'](function(_0x5542bd){var _0x5140fa=_0x28d4bf[_0xdfbf('0x4a')][_0xdfbf('0x23')]({'plain':!![]});if(!_0x5140fa)throw new Error(_0xdfbf('0x4b'));if(_0x5140fa[_0xdfbf('0x4c')]===_0xdfbf('0x4a')){var _0x1a8c27=_0x5542bd[_0xdfbf('0x23')]({'plain':!![]});var _0x47defc=_0xdfbf('0x4d');return db[_0xdfbf('0x4e')][_0xdfbf('0x48')]({'where':{'name':_0x47defc,'userProfileId':_0x5140fa[_0xdfbf('0x4f')]},'raw':!![]})[_0xdfbf('0x22')](function(_0x437d21){if(_0x437d21&&_0x437d21[_0xdfbf('0x50')]===0x0){return db[_0xdfbf('0x51')]['create']({'name':_0x1a8c27['name'],'resourceId':_0x1a8c27['id'],'type':_0x437d21[_0xdfbf('0x28')],'sectionId':_0x437d21['id']},{})[_0xdfbf('0x22')](function(){return _0x5542bd;});}else{return _0x5542bd;}})[_0xdfbf('0x46')](function(_0x211b6c){logger[_0xdfbf('0x26')](_0xdfbf('0x52'),_0x211b6c);throw _0x211b6c;});}return _0x5542bd;})[_0xdfbf('0x22')](respondWithResult(_0x1682b1,0xc9))[_0xdfbf('0x46')](handleError(_0x1682b1,null));};exports[_0xdfbf('0x21')]=function(_0x435f0d,_0x19ea6c){if(_0x435f0d[_0xdfbf('0x53')]['id']){delete _0x435f0d[_0xdfbf('0x53')]['id'];}return db['SquareOdbc'][_0xdfbf('0x48')]({'where':{'id':_0x435f0d[_0xdfbf('0x47')]['id']}})[_0xdfbf('0x22')](handleEntityNotFound(_0x19ea6c,null))['then'](saveUpdates(_0x435f0d[_0xdfbf('0x53')],null))['then'](respondWithResult(_0x19ea6c,null))['catch'](handleError(_0x19ea6c,null));};exports['destroy']=function(_0x1c748d,_0x5382a0){return db[_0xdfbf('0x41')][_0xdfbf('0x48')]({'where':{'id':_0x1c748d[_0xdfbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x5382a0,null))[_0xdfbf('0x22')](removeEntity(_0x5382a0,null))[_0xdfbf('0x46')](handleError(_0x5382a0,null));};exports[_0xdfbf('0x54')]=function(_0x3f3865,_0x1bf881,_0x2bde2d){var _0x54d72b;return db[_0xdfbf('0x41')][_0xdfbf('0x48')]({'where':{'id':_0x3f3865[_0xdfbf('0x47')]['id']},'attributes':['id',_0xdfbf('0x55')]})[_0xdfbf('0x22')](handleEntityNotFound(_0x1bf881,null))[_0xdfbf('0x22')](function(_0x2f36a5){if(_0x2f36a5){var _0x52877b=require(_0xdfbf('0x56'))();_0x52877b[_0xdfbf('0x57')](_0x2f36a5[_0xdfbf('0x55')]);_0x52877b[_0xdfbf('0x58')]();return _0x2f36a5;}})['then'](respondWithResult(_0x1bf881,null))['catch'](handleError(_0x1bf881,null));}; \ No newline at end of file +var _0xb878=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','save','then','destroy','ODBC','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection'];(function(_0x429f8d,_0x304058){var _0x50fc79=function(_0x3a1570){while(--_0x3a1570){_0x429f8d['push'](_0x429f8d['shift']());}};_0x50fc79(++_0x304058);}(_0xb878,0x1cc));var _0x8b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb878[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b87('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b87('0x1'));var rp=require('request-promise');var moment=require(_0x8b87('0x2'));var BPromise=require(_0x8b87('0x3'));var Mustache=require(_0x8b87('0x4'));var util=require('util');var path=require(_0x8b87('0x5'));var sox=require(_0x8b87('0x6'));var csv=require('to-csv');var ejs=require(_0x8b87('0x7'));var fs=require('fs');var fs_extra=require(_0x8b87('0x8'));var _=require(_0x8b87('0x9'));var squel=require('squel');var crypto=require(_0x8b87('0xa'));var jsforce=require(_0x8b87('0xb'));var deskjs=require(_0x8b87('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8b87('0xd'));var Papa=require(_0x8b87('0xe'));var Redis=require(_0x8b87('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8b87('0x10'));var as=require(_0x8b87('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b87('0x12'))(_0x8b87('0x13'));var utils=require(_0x8b87('0x14'));var config=require(_0x8b87('0x15'));var licenseUtil=require(_0x8b87('0x16'));var db=require(_0x8b87('0x17'))['db'];function respondWithStatusCode(_0xa1bd1c,_0x1c54c9){_0x1c54c9=_0x1c54c9||0xcc;return function(_0x2f3557){if(_0x2f3557){return _0xa1bd1c[_0x8b87('0x18')](_0x1c54c9);}return _0xa1bd1c['status'](_0x1c54c9)[_0x8b87('0x19')]();};}function respondWithResult(_0x520576,_0x3ff7b3){_0x3ff7b3=_0x3ff7b3||0xc8;return function(_0x2ed842){if(_0x2ed842){return _0x520576['status'](_0x3ff7b3)[_0x8b87('0x1a')](_0x2ed842);}};}function respondWithFilteredResult(_0xa5b935,_0x1e10a6){return function(_0x1c7118){if(_0x1c7118){var _0x44e1fb=typeof _0x1e10a6[_0x8b87('0x1b')]===_0x8b87('0x1c')&&typeof _0x1e10a6['limit']===_0x8b87('0x1c');var _0x1fbbbf=_0x1c7118[_0x8b87('0x1d')];var _0x3b901b=_0x44e1fb?0x0:_0x1e10a6[_0x8b87('0x1b')];var _0x4ad72d=_0x44e1fb?_0x1c7118['count']:_0x1e10a6[_0x8b87('0x1b')]+_0x1e10a6[_0x8b87('0x1e')];var _0x922fe3;if(_0x4ad72d>=_0x1fbbbf){_0x4ad72d=_0x1fbbbf;_0x922fe3=0xc8;}else{_0x922fe3=0xce;}_0xa5b935[_0x8b87('0x1f')](_0x922fe3);return _0xa5b935[_0x8b87('0x20')](_0x8b87('0x21'),_0x3b901b+'-'+_0x4ad72d+'/'+_0x1fbbbf)['json'](_0x1c7118);}return null;};}function patchUpdates(_0x57de67){return function(_0x4f6b91){try{jsonpatch['apply'](_0x4f6b91,_0x57de67,!![]);}catch(_0x56281c){return BPromise[_0x8b87('0x22')](_0x56281c);}return _0x4f6b91[_0x8b87('0x23')]();};}function saveUpdates(_0x5985cd,_0x11288b){return function(_0x7a15db){if(_0x7a15db){return _0x7a15db['update'](_0x5985cd)[_0x8b87('0x24')](function(_0x22b184){return _0x22b184;});}return null;};}function removeEntity(_0x4c8ba3,_0x5c9a99){return function(_0x3755cd){if(_0x3755cd){return _0x3755cd[_0x8b87('0x25')]()[_0x8b87('0x24')](function(){var _0x1b1c74=_0x3755cd['get']({'plain':!![]});var _0x5d24ad=_0x8b87('0x26');return db['UserProfileResource'][_0x8b87('0x25')]({'where':{'type':_0x5d24ad,'resourceId':_0x1b1c74['id']}})[_0x8b87('0x24')](function(){return _0x3755cd;});})[_0x8b87('0x24')](function(){_0x4c8ba3[_0x8b87('0x1f')](0xcc)[_0x8b87('0x19')]();});}};}function handleEntityNotFound(_0x26ef57,_0x4cf6a7){return function(_0x586bc4){if(!_0x586bc4){_0x26ef57[_0x8b87('0x18')](0x194);}return _0x586bc4;};}function handleError(_0x2dfc70,_0x5409b5){_0x5409b5=_0x5409b5||0x1f4;return function(_0x2ddb37){logger[_0x8b87('0x27')](_0x2ddb37[_0x8b87('0x28')]);if(_0x2ddb37[_0x8b87('0x29')]){delete _0x2ddb37[_0x8b87('0x29')];}_0x2dfc70[_0x8b87('0x1f')](_0x5409b5)[_0x8b87('0x2a')](_0x2ddb37);};}exports[_0x8b87('0x2b')]=function(_0x4d9538,_0x2a60f9){var _0x34efc6={},_0x45677b={},_0x564c4d={'count':0x0,'rows':[]};var _0x3f0cc1=_[_0x8b87('0x2c')](db[_0x8b87('0x2d')][_0x8b87('0x2e')],function(_0x5b404c){return{'name':_0x5b404c[_0x8b87('0x2f')],'type':_0x5b404c['type'][_0x8b87('0x30')]};});_0x45677b[_0x8b87('0x31')]=_[_0x8b87('0x2c')](_0x3f0cc1,_0x8b87('0x29'));_0x45677b[_0x8b87('0x32')]=_[_0x8b87('0x33')](_0x4d9538[_0x8b87('0x32')]);_0x45677b[_0x8b87('0x34')]=_[_0x8b87('0x35')](_0x45677b[_0x8b87('0x31')],_0x45677b[_0x8b87('0x32')]);_0x34efc6[_0x8b87('0x36')]=_['intersection'](_0x45677b['model'],qs['fields'](_0x4d9538[_0x8b87('0x32')][_0x8b87('0x37')]));_0x34efc6[_0x8b87('0x36')]=_0x34efc6['attributes'][_0x8b87('0x38')]?_0x34efc6[_0x8b87('0x36')]:_0x45677b[_0x8b87('0x31')];if(!_0x4d9538[_0x8b87('0x32')][_0x8b87('0x39')](_0x8b87('0x3a'))){_0x34efc6['limit']=qs[_0x8b87('0x1e')](_0x4d9538['query'][_0x8b87('0x1e')]);_0x34efc6[_0x8b87('0x1b')]=qs[_0x8b87('0x1b')](_0x4d9538[_0x8b87('0x32')][_0x8b87('0x1b')]);}_0x34efc6[_0x8b87('0x3b')]=qs[_0x8b87('0x3c')](_0x4d9538[_0x8b87('0x32')][_0x8b87('0x3c')]);_0x34efc6[_0x8b87('0x3d')]=qs['filters'](_[_0x8b87('0x3e')](_0x4d9538[_0x8b87('0x32')],_0x45677b[_0x8b87('0x34')]),_0x3f0cc1);if(_0x4d9538[_0x8b87('0x32')][_0x8b87('0x3f')]){_0x34efc6[_0x8b87('0x3d')]=_[_0x8b87('0x40')](_0x34efc6[_0x8b87('0x3d')],{'$or':_[_0x8b87('0x2c')](_0x3f0cc1,function(_0x5a1f55){if(_0x5a1f55['type']!==_0x8b87('0x41')){var _0x2c318a={};_0x2c318a[_0x5a1f55['name']]={'$like':'%'+_0x4d9538[_0x8b87('0x32')]['filter']+'%'};return _0x2c318a;}})});}_0x34efc6=_[_0x8b87('0x40')]({},_0x34efc6,_0x4d9538[_0x8b87('0x42')]);var _0x2bd816={'where':_0x34efc6['where']};return db[_0x8b87('0x2d')]['count'](_0x2bd816)['then'](function(_0x571e68){_0x564c4d['count']=_0x571e68;if(_0x4d9538[_0x8b87('0x32')]['includeAll']){_0x34efc6[_0x8b87('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x8b87('0x44')](_0x34efc6);})[_0x8b87('0x24')](function(_0x3a6ebc){_0x564c4d[_0x8b87('0x45')]=_0x3a6ebc;return _0x564c4d;})[_0x8b87('0x24')](respondWithFilteredResult(_0x2a60f9,_0x34efc6))[_0x8b87('0x46')](handleError(_0x2a60f9,null));};exports[_0x8b87('0x47')]=function(_0x416358,_0x5653a3){var _0x361827={'raw':!![],'where':{'id':_0x416358[_0x8b87('0x48')]['id']}},_0x1710bf={};_0x1710bf[_0x8b87('0x31')]=_[_0x8b87('0x33')](db['SquareOdbc']['rawAttributes']);_0x1710bf['query']=_['keys'](_0x416358[_0x8b87('0x32')]);_0x1710bf[_0x8b87('0x34')]=_[_0x8b87('0x35')](_0x1710bf[_0x8b87('0x31')],_0x1710bf['query']);_0x361827[_0x8b87('0x36')]=_['intersection'](_0x1710bf['model'],qs[_0x8b87('0x37')](_0x416358[_0x8b87('0x32')]['fields']));_0x361827[_0x8b87('0x36')]=_0x361827['attributes'][_0x8b87('0x38')]?_0x361827[_0x8b87('0x36')]:_0x1710bf[_0x8b87('0x31')];if(_0x416358[_0x8b87('0x32')][_0x8b87('0x49')]){_0x361827[_0x8b87('0x43')]=[{'all':!![]}];}_0x361827=_[_0x8b87('0x40')]({},_0x361827,_0x416358['options']);return db['SquareOdbc'][_0x8b87('0x4a')](_0x361827)['then'](handleEntityNotFound(_0x5653a3,null))[_0x8b87('0x24')](respondWithResult(_0x5653a3,null))[_0x8b87('0x46')](handleError(_0x5653a3,null));};exports['create']=function(_0x553ac6,_0x128069){return db[_0x8b87('0x2d')][_0x8b87('0x4b')](_0x553ac6['body'],{})['then'](function(_0x11c919){var _0x3a004b=_0x553ac6[_0x8b87('0x4c')]['get']({'plain':!![]});if(!_0x3a004b)throw new Error(_0x8b87('0x4d'));if(_0x3a004b['role']===_0x8b87('0x4c')){var _0x25d217=_0x11c919[_0x8b87('0x4e')]({'plain':!![]});var _0x2461dc='ODBC';return db[_0x8b87('0x4f')][_0x8b87('0x4a')]({'where':{'name':_0x2461dc,'userProfileId':_0x3a004b[_0x8b87('0x50')]},'raw':!![]})[_0x8b87('0x24')](function(_0x6e4ad1){if(_0x6e4ad1&&_0x6e4ad1[_0x8b87('0x51')]===0x0){return db['UserProfileResource'][_0x8b87('0x4b')]({'name':_0x25d217[_0x8b87('0x29')],'resourceId':_0x25d217['id'],'type':_0x6e4ad1[_0x8b87('0x29')],'sectionId':_0x6e4ad1['id']},{})[_0x8b87('0x24')](function(){return _0x11c919;});}else{return _0x11c919;}})[_0x8b87('0x46')](function(_0x132b23){logger[_0x8b87('0x27')](_0x8b87('0x52'),_0x132b23);throw _0x132b23;});}return _0x11c919;})['then'](respondWithResult(_0x128069,0xc9))[_0x8b87('0x46')](handleError(_0x128069,null));};exports[_0x8b87('0x53')]=function(_0x4bbee2,_0xa677ef){if(_0x4bbee2[_0x8b87('0x54')]['id']){delete _0x4bbee2[_0x8b87('0x54')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x4bbee2[_0x8b87('0x48')]['id']}})[_0x8b87('0x24')](handleEntityNotFound(_0xa677ef,null))[_0x8b87('0x24')](saveUpdates(_0x4bbee2[_0x8b87('0x54')],null))[_0x8b87('0x24')](respondWithResult(_0xa677ef,null))[_0x8b87('0x46')](handleError(_0xa677ef,null));};exports['destroy']=function(_0x5e0218,_0x2480e4){return db[_0x8b87('0x2d')][_0x8b87('0x4a')]({'where':{'id':_0x5e0218[_0x8b87('0x48')]['id']}})['then'](handleEntityNotFound(_0x2480e4,null))['then'](removeEntity(_0x2480e4,null))[_0x8b87('0x46')](handleError(_0x2480e4,null));};exports[_0x8b87('0x55')]=function(_0x4363c6,_0x466b8e,_0x13a168){var _0x3ebadf;return db[_0x8b87('0x2d')]['find']({'where':{'id':_0x4363c6['params']['id']},'attributes':['id',_0x8b87('0x56')]})[_0x8b87('0x24')](handleEntityNotFound(_0x466b8e,null))['then'](function(_0x22417d){if(_0x22417d){var _0x2fbd1a=require(_0x8b87('0x57'))();_0x2fbd1a[_0x8b87('0x58')](_0x22417d[_0x8b87('0x56')]);_0x2fbd1a[_0x8b87('0x59')]();return _0x22417d;}})[_0x8b87('0x24')](respondWithResult(_0x466b8e,null))[_0x8b87('0x46')](handleError(_0x466b8e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8603d18..f8d1c2f 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 _0xbada=['request-promise','path','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f4ef4,_0x40cd85){var _0x4ef2f1=function(_0x23781a){while(--_0x23781a){_0x2f4ef4['push'](_0x2f4ef4['shift']());}};_0x4ef2f1(++_0x40cd85);}(_0xbada,0x180));var _0xabad=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbada[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xabad('0x0'));var util=require(_0xabad('0x1'));var logger=require(_0xabad('0x2'))(_0xabad('0x3'));var moment=require(_0xabad('0x4'));var BPromise=require(_0xabad('0x5'));var rp=require(_0xabad('0x6'));var fs=require('fs');var path=require(_0xabad('0x7'));var rimraf=require('rimraf');var config=require(_0xabad('0x8'));var attributes=require('./squareOdbc.attributes');module[_0xabad('0x9')]=function(_0x415f91,_0x5289c4){return _0x415f91[_0xabad('0xa')](_0xabad('0xb'),attributes,{'tableName':_0xabad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca85=['rimraf','../../config/environment','exports','define','square_odbc','util','api','moment','bluebird','request-promise','path'];(function(_0x286128,_0xcf8b1d){var _0x3d1ff5=function(_0x455417){while(--_0x455417){_0x286128['push'](_0x286128['shift']());}};_0x3d1ff5(++_0xcf8b1d);}(_0xca85,0x118));var _0x5ca8=function(_0x446e61,_0x27e680){_0x446e61=_0x446e61-0x0;var _0x4160a8=_0xca85[_0x446e61];return _0x4160a8;};'use strict';var _=require('lodash');var util=require(_0x5ca8('0x0'));var logger=require('../../config/logger')(_0x5ca8('0x1'));var moment=require(_0x5ca8('0x2'));var BPromise=require(_0x5ca8('0x3'));var rp=require(_0x5ca8('0x4'));var fs=require('fs');var path=require(_0x5ca8('0x5'));var rimraf=require(_0x5ca8('0x6'));var config=require(_0x5ca8('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x5ca8('0x8')]=function(_0x49d42f,_0x19c2db){return _0x49d42f[_0x5ca8('0x9')]('SquareOdbc',attributes,{'tableName':_0x5ca8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 2d4a5ea..6f4ec67 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 _0x94a5=['map','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSquareOdbc','SquareOdbc','options','where','attributes','include'];(function(_0x37d7a3,_0x1bd730){var _0x2fe256=function(_0x550889){while(--_0x550889){_0x37d7a3['push'](_0x37d7a3['shift']());}};_0x2fe256(++_0x1bd730);}(_0x94a5,0x11a));var _0x594a=function(_0x4a2742,_0x13c26e){_0x4a2742=_0x4a2742-0x0;var _0x1e543a=_0x94a5[_0x4a2742];return _0x1e543a;};'use strict';var _=require(_0x594a('0x0'));var util=require(_0x594a('0x1'));var moment=require(_0x594a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x594a('0x3'));var db=require(_0x594a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x594a('0x5'))(_0x594a('0x6'));var config=require('../../config/environment');var jayson=require(_0x594a('0x7'));var client=jayson[_0x594a('0x8')][_0x594a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a1563,_0x578997,_0x5a7bd9){return new BPromise(function(_0x813ab1,_0x3cfbef){return client[_0x594a('0xa')](_0x3a1563,_0x5a7bd9)[_0x594a('0xb')](function(_0x3199f4){logger[_0x594a('0xc')](_0x594a('0xd'),_0x578997,_0x594a('0xe'));logger['debug'](_0x594a('0xf'),_0x578997,_0x594a('0xe'),JSON[_0x594a('0x10')](_0x3199f4));if(_0x3199f4[_0x594a('0x11')]){if(_0x3199f4[_0x594a('0x11')][_0x594a('0x12')]===0x1f4){logger[_0x594a('0x11')](_0x594a('0xd'),_0x578997,_0x3199f4[_0x594a('0x11')]['message']);return _0x3cfbef(_0x3199f4[_0x594a('0x11')][_0x594a('0x13')]);}logger[_0x594a('0x11')](_0x594a('0xd'),_0x578997,_0x3199f4[_0x594a('0x11')][_0x594a('0x13')]);return _0x813ab1(_0x3199f4[_0x594a('0x11')][_0x594a('0x13')]);}else{logger[_0x594a('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x578997,_0x594a('0xe'));_0x813ab1(_0x3199f4['result'][_0x594a('0x13')]);}})['catch'](function(_0x1d3533){logger[_0x594a('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x578997,_0x1d3533);_0x3cfbef(_0x1d3533);});});}exports[_0x594a('0x14')]=function(_0x10b672){var _0x531dbd=this;return new Promise(function(_0x3d9b00,_0xcf30f3){return db[_0x594a('0x15')]['find']({'raw':_0x10b672[_0x594a('0x16')]?_0x10b672[_0x594a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x10b672[_0x594a('0x16')]?_0x10b672[_0x594a('0x16')][_0x594a('0x17')]||null:null,'attributes':_0x10b672['options']?_0x10b672['options'][_0x594a('0x18')]||null:null,'include':_0x10b672[_0x594a('0x16')]?_0x10b672[_0x594a('0x16')]['include']?_['map'](_0x10b672[_0x594a('0x16')][_0x594a('0x19')],function(_0x101093){return{'model':db[_0x101093['model']],'as':_0x101093['as'],'attributes':_0x101093[_0x594a('0x18')],'include':_0x101093[_0x594a('0x19')]?_[_0x594a('0x1a')](_0x101093[_0x594a('0x19')],function(_0xc3ff10){return{'model':db[_0xc3ff10['model']],'as':_0xc3ff10['as'],'attributes':_0xc3ff10[_0x594a('0x18')],'include':_0xc3ff10[_0x594a('0x19')]?_['map'](_0xc3ff10['include'],function(_0xb98cb5){return{'model':db[_0xb98cb5['model']],'as':_0xb98cb5['as'],'attributes':_0xb98cb5[_0x594a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x594a('0xb')](function(_0x5c3035){logger[_0x594a('0xc')]('ShowSquareOdbc',_0x10b672);logger['debug'](_0x594a('0x14'),_0x10b672,JSON[_0x594a('0x10')](_0x5c3035));_0x3d9b00(_0x5c3035);})[_0x594a('0x1b')](function(_0x210355){logger[_0x594a('0x11')](_0x594a('0x14'),_0x210355[_0x594a('0x13')],_0x10b672);_0xcf30f3(_0x531dbd[_0x594a('0x11')](0x1f4,_0x210355[_0x594a('0x13')]));});});}; \ No newline at end of file +var _0xc65a=['rpc','../../config/environment','client','http','request','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','then','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xc65a,0x191));var _0xac65=function(_0x5d8097,_0x1f9fca){_0x5d8097=_0x5d8097-0x0;var _0x4f3d0b=_0xc65a[_0x5d8097];return _0x4f3d0b;};'use strict';var _=require('lodash');var util=require(_0xac65('0x0'));var moment=require(_0xac65('0x1'));var BPromise=require('bluebird');var rs=require(_0xac65('0x2'));var fs=require('fs');var Redis=require(_0xac65('0x3'));var db=require(_0xac65('0x4'))['db'];var utils=require(_0xac65('0x5'));var logger=require(_0xac65('0x6'))(_0xac65('0x7'));var config=require(_0xac65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac65('0x9')][_0xac65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca524,_0x4c07bb,_0xf38fa3){return new BPromise(function(_0xe8409a,_0x9bf34c){return client[_0xac65('0xb')](_0x1ca524,_0xf38fa3)['then'](function(_0x40f407){logger[_0xac65('0xc')](_0xac65('0xd'),_0x4c07bb,'request\x20sent');logger['debug'](_0xac65('0xe'),_0x4c07bb,_0xac65('0xf'),JSON[_0xac65('0x10')](_0x40f407));if(_0x40f407[_0xac65('0x11')]){if(_0x40f407[_0xac65('0x11')][_0xac65('0x12')]===0x1f4){logger[_0xac65('0x11')](_0xac65('0xd'),_0x4c07bb,_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);return _0x9bf34c(_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);}logger[_0xac65('0x11')](_0xac65('0xd'),_0x4c07bb,_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);return _0xe8409a(_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);}else{logger['info'](_0xac65('0xd'),_0x4c07bb,_0xac65('0xf'));_0xe8409a(_0x40f407[_0xac65('0x14')][_0xac65('0x13')]);}})[_0xac65('0x15')](function(_0x8fdad9){logger[_0xac65('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4c07bb,_0x8fdad9);_0x9bf34c(_0x8fdad9);});});}exports[_0xac65('0x16')]=function(_0x4ada4c){var _0x2f8fb0=this;return new Promise(function(_0x3a05b1,_0x1659a4){return db[_0xac65('0x17')][_0xac65('0x18')]({'raw':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1b')]||null:null,'attributes':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1c')]||null:null,'include':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c['options']['include']?_[_0xac65('0x1d')](_0x4ada4c[_0xac65('0x19')][_0xac65('0x1e')],function(_0x333a6e){return{'model':db[_0x333a6e['model']],'as':_0x333a6e['as'],'attributes':_0x333a6e[_0xac65('0x1c')],'include':_0x333a6e[_0xac65('0x1e')]?_[_0xac65('0x1d')](_0x333a6e['include'],function(_0x314174){return{'model':db[_0x314174[_0xac65('0x1f')]],'as':_0x314174['as'],'attributes':_0x314174['attributes'],'include':_0x314174['include']?_[_0xac65('0x1d')](_0x314174[_0xac65('0x1e')],function(_0x50d12e){return{'model':db[_0x50d12e['model']],'as':_0x50d12e['as'],'attributes':_0x50d12e[_0xac65('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac65('0x20')](function(_0x4b01bf){logger[_0xac65('0xc')]('ShowSquareOdbc',_0x4ada4c);logger[_0xac65('0x21')](_0xac65('0x16'),_0x4ada4c,JSON[_0xac65('0x10')](_0x4b01bf));_0x3a05b1(_0x4b01bf);})[_0xac65('0x15')](function(_0x4ce806){logger[_0xac65('0x11')](_0xac65('0x16'),_0x4ce806[_0xac65('0x13')],_0x4ada4c);_0x1659a4(_0x2f8fb0[_0xac65('0x11')](0x1f4,_0x4ce806[_0xac65('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 69e1f24..5d974b1 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 _0xac19=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','/:id','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','express'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xac19,0x130));var _0x9ac1=function(_0x418c3a,_0xafc508){_0x418c3a=_0x418c3a-0x0;var _0x5ebf73=_0xac19[_0x418c3a];return _0x5ebf73;};'use strict';var multer=require('multer');var util=require(_0x9ac1('0x0'));var path=require(_0x9ac1('0x1'));var timeout=require(_0x9ac1('0x2'));var express=require(_0x9ac1('0x3'));var router=express['Router']();var fs_extra=require(_0x9ac1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9ac1('0x5'));var config=require(_0x9ac1('0x6'));var controller=require('./squareProject.controller');router[_0x9ac1('0x7')]('/',auth[_0x9ac1('0x8')](),controller['index']);router['get']('/:id',auth[_0x9ac1('0x8')](),controller[_0x9ac1('0x9')]);router[_0x9ac1('0x7')](_0x9ac1('0xa'),auth[_0x9ac1('0x8')](),controller[_0x9ac1('0xb')]);router[_0x9ac1('0xc')]('/',auth[_0x9ac1('0x8')](),controller[_0x9ac1('0xd')]);router[_0x9ac1('0xc')](_0x9ac1('0xa'),auth[_0x9ac1('0x8')](),controller[_0x9ac1('0xe')]);router[_0x9ac1('0xf')](_0x9ac1('0x10'),auth[_0x9ac1('0x8')](),controller[_0x9ac1('0x11')]);router[_0x9ac1('0x12')](_0x9ac1('0x10'),auth[_0x9ac1('0x8')](),controller[_0x9ac1('0x13')]);router['delete'](_0x9ac1('0xa'),auth['isAuthenticated'](),controller[_0x9ac1('0x14')]);module[_0x9ac1('0x15')]=router; \ No newline at end of file +var _0x6df9=['/:id','show','get','getUsers','post','put','update','delete','destroy','/:id/users','removeUsers','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./squareProject.controller','isAuthenticated','index'];(function(_0x24641b,_0x560408){var _0x483687=function(_0x21a12b){while(--_0x21a12b){_0x24641b['push'](_0x24641b['shift']());}};_0x483687(++_0x560408);}(_0x6df9,0x84));var _0x96df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6df9[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var path=require('path');var timeout=require(_0x96df('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x96df('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x96df('0x4'));var config=require('../../config/environment');var controller=require(_0x96df('0x5'));router['get']('/',auth[_0x96df('0x6')](),controller[_0x96df('0x7')]);router['get'](_0x96df('0x8'),auth[_0x96df('0x6')](),controller[_0x96df('0x9')]);router[_0x96df('0xa')]('/:id/users',auth[_0x96df('0x6')](),controller[_0x96df('0xb')]);router['post']('/',auth[_0x96df('0x6')](),controller['create']);router[_0x96df('0xc')]('/:id/users',auth['isAuthenticated'](),controller['addUsers']);router[_0x96df('0xd')](_0x96df('0x8'),auth[_0x96df('0x6')](),controller[_0x96df('0xe')]);router[_0x96df('0xf')](_0x96df('0x8'),auth['isAuthenticated'](),controller[_0x96df('0x10')]);router[_0x96df('0xf')](_0x96df('0x11'),auth[_0x96df('0x6')](),controller[_0x96df('0x12')]);module[_0x96df('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 68bdab5..cd40612 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 _0xcd15=['exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x381a28,_0x4eb359){var _0x5e572d=function(_0x46b8bf){while(--_0x46b8bf){_0x381a28['push'](_0x381a28['shift']());}};_0x5e572d(++_0x4eb359);}(_0xcd15,0xf6));var _0x5cd1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcd15[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x5cd1('0x0'));module[_0x5cd1('0x1')]={'name':{'type':Sequelize[_0x5cd1('0x2')],'unique':_0x5cd1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5cd1('0x2')]},'notes':{'type':Sequelize[_0x5cd1('0x4')]},'preproduction':{'type':Sequelize[_0x5cd1('0x5')](_0x5cd1('0x6')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x5cd1('0x7')](_0x5cd1('0x8'))[_0x5cd1('0x9')](_0x5cd1('0xa'));}}},'production':{'type':Sequelize[_0x5cd1('0x5')](_0x5cd1('0x6')),'get':function(){if(this[_0x5cd1('0x7')](_0x5cd1('0xb'))){return this[_0x5cd1('0x7')](_0x5cd1('0xb'))['toString'](_0x5cd1('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x5cd1('0xc')]}}; \ No newline at end of file +var _0x9218=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x1ca98c,_0x32b91e){var _0x35fc49=function(_0x41f58e){while(--_0x41f58e){_0x1ca98c['push'](_0x1ca98c['shift']());}};_0x35fc49(++_0x32b91e);}(_0x9218,0x10b));var _0x8921=function(_0xa720e9,_0xf162db){_0xa720e9=_0xa720e9-0x0;var _0x902310=_0x9218[_0xa720e9];return _0x902310;};'use strict';var Sequelize=require(_0x8921('0x0'));module[_0x8921('0x1')]={'name':{'type':Sequelize[_0x8921('0x2')],'unique':_0x8921('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8921('0x2')]},'notes':{'type':Sequelize[_0x8921('0x4')]},'preproduction':{'type':Sequelize[_0x8921('0x5')](_0x8921('0x6')),'get':function(){if(this[_0x8921('0x7')](_0x8921('0x8'))){return this['getDataValue'](_0x8921('0x8'))[_0x8921('0x9')](_0x8921('0xa'));}}},'production':{'type':Sequelize[_0x8921('0x5')](_0x8921('0x6')),'get':function(){if(this[_0x8921('0x7')](_0x8921('0xb'))){return this[_0x8921('0x7')]('production')[_0x8921('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8921('0xc')]},'publishedAt':{'type':Sequelize[_0x8921('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0c3a6e9..ce30f20 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 _0x1a37=['get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','addUsers','omit','ids','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','order','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','update','then','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','error','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','user'];(function(_0x427613,_0x48fa3a){var _0x8f1b1b=function(_0x58801b){while(--_0x58801b){_0x427613['push'](_0x427613['shift']());}};_0x8f1b1b(++_0x48fa3a);}(_0x1a37,0xb4));var _0x71a3=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x1a37[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x71a3('0x0'));var Redis=require(_0x71a3('0x1'));var qs=require(_0x71a3('0x2'));var logger=require(_0x71a3('0x3'))(_0x71a3('0x4'));var config=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];config[_0x71a3('0x7')]=_[_0x71a3('0x8')](config[_0x71a3('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x71a3('0x9'))(new Redis(config['redis']));require(_0x71a3('0xa'))[_0x71a3('0xb')](socket);function respondWithStatusCode(_0x231ea7,_0x2bb6a2){_0x2bb6a2=_0x2bb6a2||0xcc;return function(_0x4a9ab2){if(_0x4a9ab2){return _0x231ea7['sendStatus'](_0x2bb6a2);}return _0x231ea7['status'](_0x2bb6a2)['end']();};}function respondWithResult(_0x89da86,_0x18320a){_0x18320a=_0x18320a||0xc8;return function(_0x3709bc){if(_0x3709bc){return _0x89da86[_0x71a3('0xc')](_0x18320a)[_0x71a3('0xd')](_0x3709bc);}};}function respondWithFilteredResult(_0x2215f2,_0x1826a0){return function(_0x35c4f8){if(_0x35c4f8){var _0x5c464c=typeof _0x1826a0['offset']==='undefined'&&typeof _0x1826a0[_0x71a3('0xe')]===_0x71a3('0xf');var _0x27e46d=_0x35c4f8[_0x71a3('0x10')];var _0x1bc117=_0x5c464c?0x0:_0x1826a0[_0x71a3('0x11')];var _0x2bbc8c=_0x5c464c?_0x35c4f8[_0x71a3('0x10')]:_0x1826a0[_0x71a3('0x11')]+_0x1826a0[_0x71a3('0xe')];var _0x21a34d;if(_0x2bbc8c>=_0x27e46d){_0x2bbc8c=_0x27e46d;_0x21a34d=0xc8;}else{_0x21a34d=0xce;}_0x2215f2['status'](_0x21a34d);return _0x2215f2[_0x71a3('0x12')](_0x71a3('0x13'),_0x1bc117+'-'+_0x2bbc8c+'/'+_0x27e46d)['json'](_0x35c4f8);}return null;};}function saveUpdates(_0x4aa918){return function(_0x41fe1c){if(_0x41fe1c){return _0x41fe1c[_0x71a3('0x14')](_0x4aa918)[_0x71a3('0x15')](function(_0x201ed8){return _0x201ed8;});}return null;};}function removeEntity(_0x1af1bc){return function(_0x318ff6){if(_0x318ff6){return _0x318ff6['destroy']()[_0x71a3('0x15')](function(){var _0x27bfb4=_0x318ff6['get']({'plain':!![]});var _0x5f4562=_0x71a3('0x16');return db[_0x71a3('0x17')][_0x71a3('0x18')]({'where':{'type':_0x5f4562,'resourceId':_0x27bfb4['id']}})[_0x71a3('0x15')](function(){return _0x318ff6;});})[_0x71a3('0x15')](function(){var _0x596328=new Redis(config[_0x71a3('0x7')]);_0x596328[_0x71a3('0x19')](_0x71a3('0x1a'),JSON[_0x71a3('0x1b')]({'id':_0x318ff6['id'],'deleted':!![]}));})[_0x71a3('0x15')](function(){_0x1af1bc['status'](0xcc)[_0x71a3('0x1c')]();});}};}function handleEntityNotFound(_0x5bbaee){return function(_0x3bf78e){if(!_0x3bf78e){_0x5bbaee[_0x71a3('0x1d')](0x194);}return _0x3bf78e;};}function handleError(_0x2982b9,_0x21899d){_0x21899d=_0x21899d||0x1f4;return function(_0x452bc4){logger[_0x71a3('0x1e')](_0x452bc4['stack']);if(_0x452bc4[_0x71a3('0x1f')]){delete _0x452bc4[_0x71a3('0x1f')];}_0x2982b9[_0x71a3('0xc')](_0x21899d)[_0x71a3('0x20')](_0x452bc4);};}exports[_0x71a3('0x21')]=function(_0x4fd214,_0x107fbd){var _0x2b414d={},_0x4c1a3d={},_0x412746={'count':0x0,'rows':[]};var _0x515519=_[_0x71a3('0x22')](db[_0x71a3('0x23')][_0x71a3('0x24')],function(_0x35b5c7){return{'name':_0x35b5c7[_0x71a3('0x25')],'type':_0x35b5c7[_0x71a3('0x26')][_0x71a3('0x27')]};});_0x4c1a3d[_0x71a3('0x28')]=_[_0x71a3('0x22')](_0x515519,_0x71a3('0x1f'));_0x4c1a3d[_0x71a3('0x29')]=_[_0x71a3('0x2a')](_0x4fd214['query']);_0x4c1a3d[_0x71a3('0x2b')]=_[_0x71a3('0x2c')](_0x4c1a3d[_0x71a3('0x28')],_0x4c1a3d[_0x71a3('0x29')]);_0x2b414d['attributes']=_[_0x71a3('0x2c')](_0x4c1a3d[_0x71a3('0x28')],qs[_0x71a3('0x2d')](_0x4fd214[_0x71a3('0x29')][_0x71a3('0x2d')]));_0x2b414d[_0x71a3('0x2e')]=_0x2b414d[_0x71a3('0x2e')]['length']?_0x2b414d[_0x71a3('0x2e')]:_0x4c1a3d[_0x71a3('0x28')];if(!_0x4fd214[_0x71a3('0x29')][_0x71a3('0x2f')](_0x71a3('0x30'))){_0x2b414d[_0x71a3('0xe')]=qs[_0x71a3('0xe')](_0x4fd214[_0x71a3('0x29')][_0x71a3('0xe')]);_0x2b414d[_0x71a3('0x11')]=qs[_0x71a3('0x11')](_0x4fd214[_0x71a3('0x29')][_0x71a3('0x11')]);}_0x2b414d['order']=qs['sort'](_0x4fd214[_0x71a3('0x29')][_0x71a3('0x31')]);_0x2b414d['where']=qs[_0x71a3('0x2b')](_[_0x71a3('0x32')](_0x4fd214['query'],_0x4c1a3d[_0x71a3('0x2b')]),_0x515519);if(_0x4fd214[_0x71a3('0x29')][_0x71a3('0x33')]){_0x2b414d[_0x71a3('0x34')]=_[_0x71a3('0x35')](_0x2b414d[_0x71a3('0x34')],{'$or':_[_0x71a3('0x22')](_0x515519,function(_0x541840){if(_0x541840[_0x71a3('0x26')]!==_0x71a3('0x36')){var _0x4043e7={};_0x4043e7[_0x541840['name']]={'$like':'%'+_0x4fd214[_0x71a3('0x29')][_0x71a3('0x33')]+'%'};return _0x4043e7;}})});}_0x2b414d=_[_0x71a3('0x35')]({},_0x2b414d,_0x4fd214[_0x71a3('0x37')]);var _0x6cea55={'where':_0x2b414d['where']};return db['SquareProject'][_0x71a3('0x10')](_0x6cea55)[_0x71a3('0x15')](function(_0xbec9ad){_0x412746[_0x71a3('0x10')]=_0xbec9ad;if(_0x4fd214[_0x71a3('0x29')]['includeAll']){_0x2b414d[_0x71a3('0x38')]=[{'all':!![]}];}return db[_0x71a3('0x23')][_0x71a3('0x39')](_0x2b414d);})['then'](function(_0x17c467){_0x412746['rows']=_0x17c467;return _0x412746;})[_0x71a3('0x15')](respondWithFilteredResult(_0x107fbd,_0x2b414d))[_0x71a3('0x3a')](handleError(_0x107fbd,null));};exports[_0x71a3('0x3b')]=function(_0x43c6d1,_0x420e50){var _0x38912c={'raw':![],'where':{'id':_0x43c6d1[_0x71a3('0x3c')]['id']}},_0x468ca4={};_0x468ca4[_0x71a3('0x28')]=_[_0x71a3('0x2a')](db['SquareProject'][_0x71a3('0x24')]);_0x468ca4['query']=_[_0x71a3('0x2a')](_0x43c6d1[_0x71a3('0x29')]);_0x468ca4[_0x71a3('0x2b')]=_[_0x71a3('0x2c')](_0x468ca4['model'],_0x468ca4[_0x71a3('0x29')]);_0x38912c[_0x71a3('0x2e')]=_['intersection'](_0x468ca4[_0x71a3('0x28')],qs[_0x71a3('0x2d')](_0x43c6d1[_0x71a3('0x29')][_0x71a3('0x2d')]));_0x38912c['attributes']=_0x38912c[_0x71a3('0x2e')][_0x71a3('0x3d')]?_0x38912c[_0x71a3('0x2e')]:_0x468ca4[_0x71a3('0x28')];if(_0x43c6d1[_0x71a3('0x29')][_0x71a3('0x3e')]){_0x38912c[_0x71a3('0x38')]=[{'all':!![]}];}_0x38912c=_[_0x71a3('0x35')]({},_0x38912c,_0x43c6d1[_0x71a3('0x37')]);return db[_0x71a3('0x23')][_0x71a3('0x3f')](_0x38912c)[_0x71a3('0x15')](handleEntityNotFound(_0x420e50,null))[_0x71a3('0x15')](respondWithResult(_0x420e50,null))[_0x71a3('0x3a')](handleError(_0x420e50,null));};exports[_0x71a3('0x40')]=function(_0xbe5ea3,_0x53cfc3){return db[_0x71a3('0x23')][_0x71a3('0x40')](_0xbe5ea3['body'],{})[_0x71a3('0x15')](function(_0x99d893){var _0x45d642=_0xbe5ea3[_0x71a3('0x41')][_0x71a3('0x42')]({'plain':!![]});if(!_0x45d642)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45d642['role']===_0x71a3('0x41')){var _0x4305ee=_0x99d893['get']({'plain':!![]});var _0x389090=_0x71a3('0x16');return db[_0x71a3('0x43')][_0x71a3('0x3f')]({'where':{'name':_0x389090,'userProfileId':_0x45d642[_0x71a3('0x44')]},'raw':!![]})[_0x71a3('0x15')](function(_0x501a62){if(_0x501a62&&_0x501a62[_0x71a3('0x45')]===0x0){return db['UserProfileResource'][_0x71a3('0x40')]({'name':_0x4305ee[_0x71a3('0x1f')],'resourceId':_0x4305ee['id'],'type':_0x501a62[_0x71a3('0x1f')],'sectionId':_0x501a62['id']},{})[_0x71a3('0x15')](function(){return _0x99d893;});}else{return _0x99d893;}})[_0x71a3('0x3a')](function(_0x48fcd7){logger[_0x71a3('0x1e')](_0x71a3('0x46'),_0x48fcd7);throw _0x48fcd7;});}return _0x99d893;})[_0x71a3('0x15')](respondWithResult(_0x53cfc3,0xc9))['catch'](handleError(_0x53cfc3,null));};exports[_0x71a3('0x14')]=function(_0x4e6423,_0x278e11){if(_0x4e6423[_0x71a3('0x47')]['id']){delete _0x4e6423['body']['id'];}return db[_0x71a3('0x23')][_0x71a3('0x3f')]({'where':{'id':_0x4e6423[_0x71a3('0x3c')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x278e11,null))[_0x71a3('0x15')](saveUpdates(_0x4e6423[_0x71a3('0x47')],null))[_0x71a3('0x15')](function(_0x479a8a){if(!_0x479a8a)return;var _0x2d4a2e=_0x479a8a['get']({'plain':!![]});return _0x2d4a2e;})[_0x71a3('0x15')](function(_0x480e90){var _0x3076be=new Redis(config[_0x71a3('0x7')]);_0x3076be[_0x71a3('0x19')](_0x71a3('0x1a'),JSON['stringify'](_['pick'](_0x480e90,['id',_0x71a3('0x1f'),_0x71a3('0x48')])));return _0x480e90;})[_0x71a3('0x15')](respondWithResult(_0x278e11,null))[_0x71a3('0x3a')](handleError(_0x278e11,null));};exports['destroy']=function(_0x4edbe3,_0x464a25){return db[_0x71a3('0x23')][_0x71a3('0x3f')]({'where':{'id':_0x4edbe3[_0x71a3('0x3c')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x464a25,null))['then'](removeEntity(_0x464a25,null))[_0x71a3('0x3a')](handleError(_0x464a25,null));};exports[_0x71a3('0x49')]=function(_0x70defc,_0xef4e53){return db[_0x71a3('0x23')][_0x71a3('0x3f')]({'where':{'id':_0x70defc[_0x71a3('0x3c')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0xef4e53,null))['then'](function(_0x384199){if(_0x384199){return _0x384199[_0x71a3('0x49')](_0x70defc[_0x71a3('0x47')]['ids'],_[_0x71a3('0x4a')](_0x70defc[_0x71a3('0x47')],[_0x71a3('0x4b'),'id'])||{});}})[_0x71a3('0x15')](respondWithResult(_0xef4e53,null))[_0x71a3('0x3a')](handleError(_0xef4e53,null));};exports[_0x71a3('0x4c')]=function(_0x453b78,_0x302dab){return db[_0x71a3('0x23')][_0x71a3('0x3f')]({'where':{'id':_0x453b78['params']['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x302dab,null))[_0x71a3('0x15')](function(_0x56177c){if(_0x56177c){return _0x56177c[_0x71a3('0x4c')](_0x453b78['query']['ids'])[_0x71a3('0x15')](function(){if(_[_0x71a3('0x4d')](_0x453b78[_0x71a3('0x29')][_0x71a3('0x4b')])){for(var _0x3910e3=0x0;_0x3910e3<_0x453b78['query'][_0x71a3('0x4b')][_0x71a3('0x3d')];_0x3910e3+=0x1){socket['emit'](_0x71a3('0x4e'),{'UserId':Number(_0x453b78['query'][_0x71a3('0x4b')][_0x3910e3]),'SquareProjectId':Number(_0x453b78[_0x71a3('0x3c')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x453b78[_0x71a3('0x29')][_0x71a3('0x4b')]),'SquareProjectId':Number(_0x453b78['params']['id'])});}});}})[_0x71a3('0x15')](respondWithStatusCode(_0x302dab,null))[_0x71a3('0x3a')](handleError(_0x302dab,null));};exports[_0x71a3('0x4f')]=function(_0x516526,_0x3d6e0f){var _0x18494a={};var _0x287c63={};var _0x314360;var _0x1c1c6d;return db[_0x71a3('0x23')][_0x71a3('0x50')]({'where':{'id':_0x516526[_0x71a3('0x3c')]['id']}})[_0x71a3('0x15')](handleEntityNotFound(_0x3d6e0f,null))['then'](function(_0x4e5ab1){if(_0x4e5ab1){_0x314360=_0x4e5ab1;_0x287c63[_0x71a3('0x28')]=_[_0x71a3('0x2a')](db['User'][_0x71a3('0x24')]);_0x287c63[_0x71a3('0x29')]=_[_0x71a3('0x2a')](_0x516526[_0x71a3('0x29')]);_0x287c63[_0x71a3('0x2b')]=_[_0x71a3('0x2c')](_0x287c63[_0x71a3('0x28')],_0x287c63[_0x71a3('0x29')]);_0x18494a[_0x71a3('0x2e')]=_['intersection'](_0x287c63[_0x71a3('0x28')],qs['fields'](_0x516526[_0x71a3('0x29')]['fields']));_0x18494a['attributes']=_0x18494a[_0x71a3('0x2e')]['length']?_0x18494a[_0x71a3('0x2e')]:_0x287c63[_0x71a3('0x28')];_0x18494a[_0x71a3('0x51')]=qs['sort'](_0x516526[_0x71a3('0x29')][_0x71a3('0x31')]);_0x18494a['where']=qs[_0x71a3('0x2b')](_[_0x71a3('0x32')](_0x516526[_0x71a3('0x29')],_0x287c63[_0x71a3('0x2b')]));if(_0x516526[_0x71a3('0x29')][_0x71a3('0x33')]){_0x18494a[_0x71a3('0x34')]=_[_0x71a3('0x35')](_0x18494a['where'],{'$or':_['map'](_0x18494a[_0x71a3('0x2e')],function(_0x1d03ac){var _0x1b3c9b={};_0x1b3c9b[_0x1d03ac]={'$like':'%'+_0x516526['query'][_0x71a3('0x33')]+'%'};return _0x1b3c9b;})});}_0x18494a=_[_0x71a3('0x35')]({},_0x18494a,_0x516526['options']);return _0x314360[_0x71a3('0x4f')](_0x18494a);}})['then'](function(_0x4294d5){if(_0x4294d5){_0x1c1c6d=_0x4294d5[_0x71a3('0x3d')];if(!_0x516526[_0x71a3('0x29')][_0x71a3('0x2f')]('nolimit')){_0x18494a[_0x71a3('0xe')]=qs[_0x71a3('0xe')](_0x516526['query'][_0x71a3('0xe')]);_0x18494a[_0x71a3('0x11')]=qs[_0x71a3('0x11')](_0x516526[_0x71a3('0x29')][_0x71a3('0x11')]);}return _0x314360[_0x71a3('0x4f')](_0x18494a);}})[_0x71a3('0x15')](function(_0xac06f1){if(_0xac06f1){return _0xac06f1?{'count':_0x1c1c6d,'rows':_0xac06f1}:null;}})[_0x71a3('0x15')](respondWithResult(_0x3d6e0f,null))[_0x71a3('0x3a')](handleError(_0x3d6e0f,null));}; \ No newline at end of file +var _0x7096=['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','production','addUsers','omit','removeUsers','isArray','ids','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','end','status','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','then','publish','agi','stringify','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x4e6702,_0x324dda){var _0x300beb=function(_0x5d5b9c){while(--_0x5d5b9c){_0x4e6702['push'](_0x4e6702['shift']());}};_0x300beb(++_0x324dda);}(_0x7096,0x10c));var _0x6709=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7096[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var Redis=require(_0x6709('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x6709('0x1'))('api');var config=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];config[_0x6709('0x4')]=_[_0x6709('0x5')](config[_0x6709('0x4')],{'host':_0x6709('0x6'),'port':0x18eb});var socket=require(_0x6709('0x7'))(new Redis(config[_0x6709('0x4')]));require(_0x6709('0x8'))[_0x6709('0x9')](socket);function respondWithStatusCode(_0x11ad23,_0x985814){_0x985814=_0x985814||0xcc;return function(_0x30147f){if(_0x30147f){return _0x11ad23['sendStatus'](_0x985814);}return _0x11ad23['status'](_0x985814)[_0x6709('0xa')]();};}function respondWithResult(_0x2d8c0b,_0xbcb47){_0xbcb47=_0xbcb47||0xc8;return function(_0x1aa476){if(_0x1aa476){return _0x2d8c0b[_0x6709('0xb')](_0xbcb47)[_0x6709('0xc')](_0x1aa476);}};}function respondWithFilteredResult(_0x5de1fa,_0x5b9f26){return function(_0x329aa9){if(_0x329aa9){var _0x262261=typeof _0x5b9f26[_0x6709('0xd')]===_0x6709('0xe')&&typeof _0x5b9f26[_0x6709('0xf')]===_0x6709('0xe');var _0x1d56a5=_0x329aa9[_0x6709('0x10')];var _0x5a8ebb=_0x262261?0x0:_0x5b9f26[_0x6709('0xd')];var _0xf59b6e=_0x262261?_0x329aa9[_0x6709('0x10')]:_0x5b9f26[_0x6709('0xd')]+_0x5b9f26['limit'];var _0xc728aa;if(_0xf59b6e>=_0x1d56a5){_0xf59b6e=_0x1d56a5;_0xc728aa=0xc8;}else{_0xc728aa=0xce;}_0x5de1fa['status'](_0xc728aa);return _0x5de1fa[_0x6709('0x11')]('Content-Range',_0x5a8ebb+'-'+_0xf59b6e+'/'+_0x1d56a5)[_0x6709('0xc')](_0x329aa9);}return null;};}function saveUpdates(_0x28866a){return function(_0x95c0c2){if(_0x95c0c2){return _0x95c0c2[_0x6709('0x12')](_0x28866a)['then'](function(_0x52e342){return _0x52e342;});}return null;};}function removeEntity(_0x5c4f94){return function(_0x3fa5b1){if(_0x3fa5b1){return _0x3fa5b1[_0x6709('0x13')]()['then'](function(){var _0x9c1fd8=_0x3fa5b1[_0x6709('0x14')]({'plain':!![]});var _0xf1a70d='SquareProjects';return db[_0x6709('0x15')][_0x6709('0x13')]({'where':{'type':_0xf1a70d,'resourceId':_0x9c1fd8['id']}})[_0x6709('0x16')](function(){return _0x3fa5b1;});})[_0x6709('0x16')](function(){var _0x5485d7=new Redis(config[_0x6709('0x4')]);_0x5485d7[_0x6709('0x17')](_0x6709('0x18'),JSON[_0x6709('0x19')]({'id':_0x3fa5b1['id'],'deleted':!![]}));})[_0x6709('0x16')](function(){_0x5c4f94[_0x6709('0xb')](0xcc)[_0x6709('0xa')]();});}};}function handleEntityNotFound(_0x17763d){return function(_0x386224){if(!_0x386224){_0x17763d[_0x6709('0x1a')](0x194);}return _0x386224;};}function handleError(_0x2f3415,_0xa36371){_0xa36371=_0xa36371||0x1f4;return function(_0x5cf48b){logger[_0x6709('0x1b')](_0x5cf48b[_0x6709('0x1c')]);if(_0x5cf48b[_0x6709('0x1d')]){delete _0x5cf48b['name'];}_0x2f3415[_0x6709('0xb')](_0xa36371)[_0x6709('0x1e')](_0x5cf48b);};}exports[_0x6709('0x1f')]=function(_0x44b465,_0x588e00){var _0x241428={},_0x3076fe={},_0x50f7d6={'count':0x0,'rows':[]};var _0x585073=_[_0x6709('0x20')](db['SquareProject'][_0x6709('0x21')],function(_0x2499a2){return{'name':_0x2499a2['fieldName'],'type':_0x2499a2[_0x6709('0x22')]['key']};});_0x3076fe[_0x6709('0x23')]=_[_0x6709('0x20')](_0x585073,'name');_0x3076fe[_0x6709('0x24')]=_['keys'](_0x44b465[_0x6709('0x24')]);_0x3076fe[_0x6709('0x25')]=_['intersection'](_0x3076fe[_0x6709('0x23')],_0x3076fe['query']);_0x241428[_0x6709('0x26')]=_[_0x6709('0x27')](_0x3076fe['model'],qs['fields'](_0x44b465[_0x6709('0x24')][_0x6709('0x28')]));_0x241428[_0x6709('0x26')]=_0x241428[_0x6709('0x26')][_0x6709('0x29')]?_0x241428[_0x6709('0x26')]:_0x3076fe[_0x6709('0x23')];if(!_0x44b465[_0x6709('0x24')][_0x6709('0x2a')]('nolimit')){_0x241428[_0x6709('0xf')]=qs[_0x6709('0xf')](_0x44b465[_0x6709('0x24')][_0x6709('0xf')]);_0x241428['offset']=qs[_0x6709('0xd')](_0x44b465[_0x6709('0x24')][_0x6709('0xd')]);}_0x241428[_0x6709('0x2b')]=qs['sort'](_0x44b465[_0x6709('0x24')][_0x6709('0x2c')]);_0x241428['where']=qs[_0x6709('0x25')](_[_0x6709('0x2d')](_0x44b465['query'],_0x3076fe[_0x6709('0x25')]),_0x585073);if(_0x44b465[_0x6709('0x24')][_0x6709('0x2e')]){_0x241428[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x241428[_0x6709('0x2f')],{'$or':_[_0x6709('0x20')](_0x585073,function(_0x4bfed4){if(_0x4bfed4[_0x6709('0x22')]!==_0x6709('0x31')){var _0x4fad54={};_0x4fad54[_0x4bfed4[_0x6709('0x1d')]]={'$like':'%'+_0x44b465[_0x6709('0x24')][_0x6709('0x2e')]+'%'};return _0x4fad54;}})});}_0x241428=_[_0x6709('0x30')]({},_0x241428,_0x44b465[_0x6709('0x32')]);var _0x1c12bb={'where':_0x241428['where']};return db[_0x6709('0x33')]['count'](_0x1c12bb)[_0x6709('0x16')](function(_0xbb7a64){_0x50f7d6[_0x6709('0x10')]=_0xbb7a64;if(_0x44b465['query'][_0x6709('0x34')]){_0x241428[_0x6709('0x35')]=[{'all':!![]}];}return db[_0x6709('0x33')][_0x6709('0x36')](_0x241428);})[_0x6709('0x16')](function(_0x1030ee){_0x50f7d6[_0x6709('0x37')]=_0x1030ee;return _0x50f7d6;})['then'](respondWithFilteredResult(_0x588e00,_0x241428))[_0x6709('0x38')](handleError(_0x588e00,null));};exports[_0x6709('0x39')]=function(_0x50fbcd,_0x31d2a6){var _0xe80008={'raw':![],'where':{'id':_0x50fbcd[_0x6709('0x3a')]['id']}},_0x15b18f={};_0x15b18f['model']=_['keys'](db[_0x6709('0x33')][_0x6709('0x21')]);_0x15b18f[_0x6709('0x24')]=_[_0x6709('0x3b')](_0x50fbcd['query']);_0x15b18f['filters']=_['intersection'](_0x15b18f[_0x6709('0x23')],_0x15b18f[_0x6709('0x24')]);_0xe80008['attributes']=_[_0x6709('0x27')](_0x15b18f[_0x6709('0x23')],qs['fields'](_0x50fbcd['query'][_0x6709('0x28')]));_0xe80008[_0x6709('0x26')]=_0xe80008[_0x6709('0x26')][_0x6709('0x29')]?_0xe80008[_0x6709('0x26')]:_0x15b18f['model'];if(_0x50fbcd[_0x6709('0x24')]['includeAll']){_0xe80008[_0x6709('0x35')]=[{'all':!![]}];}_0xe80008=_[_0x6709('0x30')]({},_0xe80008,_0x50fbcd[_0x6709('0x32')]);return db['SquareProject'][_0x6709('0x3c')](_0xe80008)['then'](handleEntityNotFound(_0x31d2a6,null))['then'](respondWithResult(_0x31d2a6,null))[_0x6709('0x38')](handleError(_0x31d2a6,null));};exports[_0x6709('0x3d')]=function(_0x14fcb6,_0x7e38b9){return db[_0x6709('0x33')][_0x6709('0x3d')](_0x14fcb6[_0x6709('0x3e')],{})[_0x6709('0x16')](function(_0x123793){var _0xe999aa=_0x14fcb6[_0x6709('0x3f')][_0x6709('0x14')]({'plain':!![]});if(!_0xe999aa)throw new Error(_0x6709('0x40'));if(_0xe999aa[_0x6709('0x41')]===_0x6709('0x3f')){var _0x4f82a0=_0x123793[_0x6709('0x14')]({'plain':!![]});var _0x4d841a='SquareProjects';return db[_0x6709('0x42')][_0x6709('0x3c')]({'where':{'name':_0x4d841a,'userProfileId':_0xe999aa[_0x6709('0x43')]},'raw':!![]})[_0x6709('0x16')](function(_0x22363b){if(_0x22363b&&_0x22363b[_0x6709('0x44')]===0x0){return db[_0x6709('0x15')][_0x6709('0x3d')]({'name':_0x4f82a0['name'],'resourceId':_0x4f82a0['id'],'type':_0x22363b[_0x6709('0x1d')],'sectionId':_0x22363b['id']},{})[_0x6709('0x16')](function(){return _0x123793;});}else{return _0x123793;}})[_0x6709('0x38')](function(_0x214fbb){logger['error'](_0x6709('0x45'),_0x214fbb);throw _0x214fbb;});}return _0x123793;})['then'](respondWithResult(_0x7e38b9,0xc9))[_0x6709('0x38')](handleError(_0x7e38b9,null));};exports[_0x6709('0x12')]=function(_0x2a563b,_0xb257b5){if(_0x2a563b[_0x6709('0x3e')]['id']){delete _0x2a563b['body']['id'];}return db[_0x6709('0x33')][_0x6709('0x3c')]({'where':{'id':_0x2a563b[_0x6709('0x3a')]['id']}})[_0x6709('0x16')](handleEntityNotFound(_0xb257b5,null))[_0x6709('0x16')](saveUpdates(_0x2a563b['body'],null))['then'](function(_0x447aa5){if(!_0x447aa5)return;var _0x4b5eca=_0x447aa5['get']({'plain':!![]});return _0x4b5eca;})[_0x6709('0x16')](function(_0x437910){var _0x1bf824=new Redis(config[_0x6709('0x4')]);_0x1bf824[_0x6709('0x17')](_0x6709('0x18'),JSON[_0x6709('0x19')](_[_0x6709('0x2d')](_0x437910,['id',_0x6709('0x1d'),_0x6709('0x46')])));return _0x437910;})[_0x6709('0x16')](respondWithResult(_0xb257b5,null))['catch'](handleError(_0xb257b5,null));};exports[_0x6709('0x13')]=function(_0x8c2616,_0x5ea29f){return db['SquareProject'][_0x6709('0x3c')]({'where':{'id':_0x8c2616[_0x6709('0x3a')]['id']}})[_0x6709('0x16')](handleEntityNotFound(_0x5ea29f,null))[_0x6709('0x16')](removeEntity(_0x5ea29f,null))['catch'](handleError(_0x5ea29f,null));};exports[_0x6709('0x47')]=function(_0x492bca,_0x1f838d){return db[_0x6709('0x33')][_0x6709('0x3c')]({'where':{'id':_0x492bca[_0x6709('0x3a')]['id']}})[_0x6709('0x16')](handleEntityNotFound(_0x1f838d,null))['then'](function(_0x49d3c6){if(_0x49d3c6){return _0x49d3c6[_0x6709('0x47')](_0x492bca[_0x6709('0x3e')]['ids'],_[_0x6709('0x48')](_0x492bca[_0x6709('0x3e')],['ids','id'])||{});}})[_0x6709('0x16')](respondWithResult(_0x1f838d,null))[_0x6709('0x38')](handleError(_0x1f838d,null));};exports[_0x6709('0x49')]=function(_0x24c451,_0x4f596e){return db['SquareProject'][_0x6709('0x3c')]({'where':{'id':_0x24c451['params']['id']}})[_0x6709('0x16')](handleEntityNotFound(_0x4f596e,null))[_0x6709('0x16')](function(_0x3c3df7){if(_0x3c3df7){return _0x3c3df7['removeUsers'](_0x24c451[_0x6709('0x24')]['ids'])['then'](function(){if(_[_0x6709('0x4a')](_0x24c451['query'][_0x6709('0x4b')])){for(var _0x5cf7c0=0x0;_0x5cf7c0<_0x24c451[_0x6709('0x24')][_0x6709('0x4b')][_0x6709('0x29')];_0x5cf7c0+=0x1){socket[_0x6709('0x4c')]('userSquareProject:remove',{'UserId':Number(_0x24c451[_0x6709('0x24')][_0x6709('0x4b')][_0x5cf7c0]),'SquareProjectId':Number(_0x24c451[_0x6709('0x3a')]['id'])});}}else{socket[_0x6709('0x4c')](_0x6709('0x4d'),{'UserId':Number(_0x24c451[_0x6709('0x24')][_0x6709('0x4b')]),'SquareProjectId':Number(_0x24c451['params']['id'])});}});}})[_0x6709('0x16')](respondWithStatusCode(_0x4f596e,null))[_0x6709('0x38')](handleError(_0x4f596e,null));};exports[_0x6709('0x4e')]=function(_0x145508,_0x3f4dae){var _0x304268={};var _0xea95f6={};var _0x250bcd;var _0x36b514;return db['SquareProject'][_0x6709('0x4f')]({'where':{'id':_0x145508[_0x6709('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3f4dae,null))[_0x6709('0x16')](function(_0x18b4fa){if(_0x18b4fa){_0x250bcd=_0x18b4fa;_0xea95f6[_0x6709('0x23')]=_[_0x6709('0x3b')](db[_0x6709('0x50')][_0x6709('0x21')]);_0xea95f6[_0x6709('0x24')]=_[_0x6709('0x3b')](_0x145508[_0x6709('0x24')]);_0xea95f6['filters']=_[_0x6709('0x27')](_0xea95f6[_0x6709('0x23')],_0xea95f6[_0x6709('0x24')]);_0x304268[_0x6709('0x26')]=_[_0x6709('0x27')](_0xea95f6[_0x6709('0x23')],qs[_0x6709('0x28')](_0x145508[_0x6709('0x24')][_0x6709('0x28')]));_0x304268[_0x6709('0x26')]=_0x304268[_0x6709('0x26')]['length']?_0x304268[_0x6709('0x26')]:_0xea95f6['model'];_0x304268['order']=qs[_0x6709('0x2c')](_0x145508[_0x6709('0x24')][_0x6709('0x2c')]);_0x304268[_0x6709('0x2f')]=qs[_0x6709('0x25')](_[_0x6709('0x2d')](_0x145508[_0x6709('0x24')],_0xea95f6['filters']));if(_0x145508['query'][_0x6709('0x2e')]){_0x304268['where']=_[_0x6709('0x30')](_0x304268['where'],{'$or':_[_0x6709('0x20')](_0x304268[_0x6709('0x26')],function(_0x59d3d1){var _0x5c4277={};_0x5c4277[_0x59d3d1]={'$like':'%'+_0x145508['query'][_0x6709('0x2e')]+'%'};return _0x5c4277;})});}_0x304268=_[_0x6709('0x30')]({},_0x304268,_0x145508[_0x6709('0x32')]);return _0x250bcd[_0x6709('0x4e')](_0x304268);}})[_0x6709('0x16')](function(_0x193d67){if(_0x193d67){_0x36b514=_0x193d67[_0x6709('0x29')];if(!_0x145508[_0x6709('0x24')][_0x6709('0x2a')](_0x6709('0x51'))){_0x304268[_0x6709('0xf')]=qs[_0x6709('0xf')](_0x145508[_0x6709('0x24')]['limit']);_0x304268[_0x6709('0xd')]=qs[_0x6709('0xd')](_0x145508[_0x6709('0x24')][_0x6709('0xd')]);}return _0x250bcd['getUsers'](_0x304268);}})['then'](function(_0x18fe97){if(_0x18fe97){return _0x18fe97?{'count':_0x36b514,'rows':_0x18fe97}:null;}})['then'](respondWithResult(_0x3f4dae,null))['catch'](handleError(_0x3f4dae,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f9d33ec..1efc7cc 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 _0x7d30=['exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x7d30,0xb5));var _0x07d3=function(_0x378289,_0x163424){_0x378289=_0x378289-0x0;var _0x47c851=_0x7d30[_0x378289];return _0x47c851;};'use strict';var EventEmitter=require(_0x07d3('0x0'));var SquareProject=require(_0x07d3('0x1'))['db'][_0x07d3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x07d3('0x3')](0x0);var events={'afterCreate':_0x07d3('0x4'),'afterUpdate':_0x07d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x7a2520){return function(_0xcc0a34,_0x8b2f46,_0xcd3bab){SquareProjectEvents['emit'](_0x7a2520+':'+_0xcc0a34['id'],_0xcc0a34);SquareProjectEvents['emit'](_0x7a2520,_0xcc0a34);_0xcd3bab(null);};}for(var e in events){if(events[_0x07d3('0x6')](e)){var event=events[e];SquareProject[_0x07d3('0x7')](e,emitEvent(event));}}module[_0x07d3('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x2642=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x83668,_0x3ffdc6){var _0x558d00=function(_0x565a35){while(--_0x565a35){_0x83668['push'](_0x83668['shift']());}};_0x558d00(++_0x3ffdc6);}(_0x2642,0xb5));var _0x2264=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2642[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x2264('0x0'));var SquareProject=require(_0x2264('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2264('0x2')](0x0);var events={'afterCreate':_0x2264('0x3'),'afterUpdate':_0x2264('0x4'),'afterDestroy':'remove'};function emitEvent(_0x372f15){return function(_0x79285b,_0x24d075,_0x2cee03){SquareProjectEvents[_0x2264('0x5')](_0x372f15+':'+_0x79285b['id'],_0x79285b);SquareProjectEvents[_0x2264('0x5')](_0x372f15,_0x79285b);_0x2cee03(null);};}for(var e in events){if(events[_0x2264('0x6')](e)){var event=events[e];SquareProject[_0x2264('0x7')](e,emitEvent(event));}}module[_0x2264('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index dca001a..2a2371c 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 _0xf4e5=['rimraf','../../config/environment','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x41b9df,_0x13ffa3){var _0x31c181=function(_0x5cfe7b){while(--_0x5cfe7b){_0x41b9df['push'](_0x41b9df['shift']());}};_0x31c181(++_0x13ffa3);}(_0xf4e5,0xad));var _0x5f4e=function(_0x445729,_0x5c537a){_0x445729=_0x445729-0x0;var _0x15a3d0=_0xf4e5[_0x445729];return _0x15a3d0;};'use strict';var _=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var logger=require(_0x5f4e('0x2'))(_0x5f4e('0x3'));var moment=require('moment');var BPromise=require(_0x5f4e('0x4'));var rp=require(_0x5f4e('0x5'));var fs=require('fs');var path=require(_0x5f4e('0x6'));var rimraf=require(_0x5f4e('0x7'));var config=require(_0x5f4e('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x5953ce,_0x38772c){return _0x5953ce[_0x5f4e('0x9')](_0x5f4e('0xa'),attributes,{'tableName':_0x5f4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21a432,_0x278036,_0x138a11){if(_0x21a432[_0x5f4e('0xc')](_0x5f4e('0xd'))){_0x21a432[_0x5f4e('0xe')]=moment()[_0x5f4e('0xf')](_0x5f4e('0x10'));}if(_0x21a432[_0x5f4e('0xc')](_0x5f4e('0x11'))){_0x21a432['publishedAt']=moment()[_0x5f4e('0xf')](_0x5f4e('0x10'));}_0x138a11(null,_0x21a432);}}});}; \ No newline at end of file +var _0xc85e=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','production','publishedAt'];(function(_0x23c969,_0x33af7a){var _0x41b45a=function(_0x33c37b){while(--_0x33c37b){_0x23c969['push'](_0x23c969['shift']());}};_0x41b45a(++_0x33af7a);}(_0xc85e,0x1b9));var _0xec85=function(_0x54f072,_0x39e1fd){_0x54f072=_0x54f072-0x0;var _0x42e317=_0xc85e[_0x54f072];return _0x42e317;};'use strict';var _=require(_0xec85('0x0'));var util=require(_0xec85('0x1'));var logger=require(_0xec85('0x2'))(_0xec85('0x3'));var moment=require(_0xec85('0x4'));var BPromise=require(_0xec85('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec85('0x6'));var config=require(_0xec85('0x7'));var attributes=require(_0xec85('0x8'));module[_0xec85('0x9')]=function(_0x239971,_0xc242ea){return _0x239971[_0xec85('0xa')](_0xec85('0xb'),attributes,{'tableName':_0xec85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc4ae5c,_0x3de570,_0x4ec2ae){if(_0xc4ae5c[_0xec85('0xd')](_0xec85('0xe'))){_0xc4ae5c[_0xec85('0xf')]=moment()[_0xec85('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xc4ae5c[_0xec85('0xd')](_0xec85('0x11'))){_0xc4ae5c[_0xec85('0x12')]=moment()[_0xec85('0x10')](_0xec85('0x13'));}_0x4ec2ae(null,_0xc4ae5c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 47d406c..2d6e797 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 _0x7823=['SquareProject','findAll','options','raw','attributes','limit','include','map','model','GetSquareProjects','catch','error','message','ShowSquareProject','find','where','info','stringify','lodash','ioredis','../../mysqldb','rpc','../../config/environment','redis','./squareProject.socket','register'];(function(_0x7863cc,_0x1f5b93){var _0x1ec3ea=function(_0x5e6f13){while(--_0x5e6f13){_0x7863cc['push'](_0x7863cc['shift']());}};_0x1ec3ea(++_0x1f5b93);}(_0x7823,0x164));var _0x3782=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7823[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x3782('0x0'));var Redis=require(_0x3782('0x1'));var db=require(_0x3782('0x2'))['db'];var logger=require('../../config/logger')(_0x3782('0x3'));var config=require(_0x3782('0x4'));config[_0x3782('0x5')]=_['defaults'](config[_0x3782('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3782('0x6'))[_0x3782('0x7')](socket);exports['GetSquareProjects']=function(_0x144786){var _0x40421e=this;return new Promise(function(_0x2f0573,_0x3c7ecb){return db[_0x3782('0x8')][_0x3782('0x9')]({'raw':_0x144786[_0x3782('0xa')]?_0x144786['options'][_0x3782('0xb')]===undefined?!![]:![]:!![],'where':_0x144786['options']?_0x144786[_0x3782('0xa')]['where']||null:null,'attributes':_0x144786[_0x3782('0xa')]?_0x144786[_0x3782('0xa')][_0x3782('0xc')]||null:null,'limit':_0x144786[_0x3782('0xa')]?_0x144786[_0x3782('0xa')][_0x3782('0xd')]||null:null,'include':_0x144786[_0x3782('0xa')]?_0x144786['options'][_0x3782('0xe')]?_[_0x3782('0xf')](_0x144786[_0x3782('0xa')][_0x3782('0xe')],function(_0x35d641){return{'model':db[_0x35d641[_0x3782('0x10')]],'as':_0x35d641['as'],'attributes':_0x35d641[_0x3782('0xc')],'include':_0x35d641[_0x3782('0xe')]?_[_0x3782('0xf')](_0x35d641[_0x3782('0xe')],function(_0x4ea392){return{'model':db[_0x4ea392[_0x3782('0x10')]],'as':_0x4ea392['as'],'attributes':_0x4ea392['attributes'],'include':_0x4ea392[_0x3782('0xe')]?_['map'](_0x4ea392[_0x3782('0xe')],function(_0x1740bc){return{'model':db[_0x1740bc['model']],'as':_0x1740bc['as'],'attributes':_0x1740bc[_0x3782('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x252a31){logger['info']('GetSquareProjects',_0x144786);logger['debug'](_0x3782('0x11'),_0x144786,JSON['stringify'](_0x252a31));_0x2f0573(_0x252a31);})[_0x3782('0x12')](function(_0xca14f4){logger[_0x3782('0x13')](_0x3782('0x11'),_0xca14f4[_0x3782('0x14')],_0x144786);_0x3c7ecb(_0x40421e[_0x3782('0x13')](0x1f4,_0xca14f4[_0x3782('0x14')]));});});};exports[_0x3782('0x15')]=function(_0x3e016b){var _0x478006=this;return new Promise(function(_0x507071,_0x21eb87){return db[_0x3782('0x8')][_0x3782('0x16')]({'raw':_0x3e016b[_0x3782('0xa')]?_0x3e016b[_0x3782('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x3e016b[_0x3782('0xa')]?_0x3e016b['options'][_0x3782('0x17')]||null:null,'attributes':_0x3e016b['options']?_0x3e016b[_0x3782('0xa')][_0x3782('0xc')]||null:null,'include':_0x3e016b['options']?_0x3e016b[_0x3782('0xa')][_0x3782('0xe')]?_[_0x3782('0xf')](_0x3e016b[_0x3782('0xa')]['include'],function(_0xfd8276){return{'model':db[_0xfd8276[_0x3782('0x10')]],'as':_0xfd8276['as'],'attributes':_0xfd8276[_0x3782('0xc')],'include':_0xfd8276[_0x3782('0xe')]?_[_0x3782('0xf')](_0xfd8276[_0x3782('0xe')],function(_0x278c96){return{'model':db[_0x278c96[_0x3782('0x10')]],'as':_0x278c96['as'],'attributes':_0x278c96[_0x3782('0xc')],'include':_0x278c96[_0x3782('0xe')]?_[_0x3782('0xf')](_0x278c96[_0x3782('0xe')],function(_0x1d3ba1){return{'model':db[_0x1d3ba1[_0x3782('0x10')]],'as':_0x1d3ba1['as'],'attributes':_0x1d3ba1[_0x3782('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5495bd){logger[_0x3782('0x18')](_0x3782('0x15'),_0x3e016b);logger['debug'](_0x3782('0x15'),_0x3e016b,JSON[_0x3782('0x19')](_0x5495bd));_0x507071(_0x5495bd);})['catch'](function(_0x201431){logger['error'](_0x3782('0x15'),_0x201431[_0x3782('0x14')],_0x3e016b);_0x21eb87(_0x478006[_0x3782('0x13')](0x1f4,_0x201431[_0x3782('0x14')]));});});}; \ No newline at end of file +var _0x5dcc=['find','then','info','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','where','limit','map','include','model','attributes','debug','stringify','error','message','ShowSquareProject'];(function(_0x261ce4,_0x163def){var _0x5d84ec=function(_0x1bb4c1){while(--_0x1bb4c1){_0x261ce4['push'](_0x261ce4['shift']());}};_0x5d84ec(++_0x163def);}(_0x5dcc,0xab));var _0xc5dc=function(_0x232e81,_0x23e7ef){_0x232e81=_0x232e81-0x0;var _0x1bd267=_0x5dcc[_0x232e81];return _0x1bd267;};'use strict';var _=require(_0xc5dc('0x0'));var Redis=require(_0xc5dc('0x1'));var db=require(_0xc5dc('0x2'))['db'];var logger=require(_0xc5dc('0x3'))('rpc');var config=require(_0xc5dc('0x4'));config['redis']=_[_0xc5dc('0x5')](config[_0xc5dc('0x6')],{'host':_0xc5dc('0x7'),'port':0x18eb});var socket=require(_0xc5dc('0x8'))(new Redis(config[_0xc5dc('0x6')]));require(_0xc5dc('0x9'))['register'](socket);exports[_0xc5dc('0xa')]=function(_0x385f76){var _0x5a8ed7=this;return new Promise(function(_0x6bc8a4,_0x1147a2){return db[_0xc5dc('0xb')][_0xc5dc('0xc')]({'raw':_0x385f76[_0xc5dc('0xd')]?_0x385f76['options']['raw']===undefined?!![]:![]:!![],'where':_0x385f76[_0xc5dc('0xd')]?_0x385f76[_0xc5dc('0xd')][_0xc5dc('0xe')]||null:null,'attributes':_0x385f76[_0xc5dc('0xd')]?_0x385f76[_0xc5dc('0xd')]['attributes']||null:null,'limit':_0x385f76['options']?_0x385f76[_0xc5dc('0xd')][_0xc5dc('0xf')]||null:null,'include':_0x385f76[_0xc5dc('0xd')]?_0x385f76[_0xc5dc('0xd')]['include']?_[_0xc5dc('0x10')](_0x385f76[_0xc5dc('0xd')][_0xc5dc('0x11')],function(_0x449691){return{'model':db[_0x449691[_0xc5dc('0x12')]],'as':_0x449691['as'],'attributes':_0x449691[_0xc5dc('0x13')],'include':_0x449691[_0xc5dc('0x11')]?_[_0xc5dc('0x10')](_0x449691[_0xc5dc('0x11')],function(_0x171267){return{'model':db[_0x171267[_0xc5dc('0x12')]],'as':_0x171267['as'],'attributes':_0x171267[_0xc5dc('0x13')],'include':_0x171267['include']?_[_0xc5dc('0x10')](_0x171267[_0xc5dc('0x11')],function(_0x1b30d3){return{'model':db[_0x1b30d3[_0xc5dc('0x12')]],'as':_0x1b30d3['as'],'attributes':_0x1b30d3[_0xc5dc('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x130264){logger['info']('GetSquareProjects',_0x385f76);logger[_0xc5dc('0x14')](_0xc5dc('0xa'),_0x385f76,JSON[_0xc5dc('0x15')](_0x130264));_0x6bc8a4(_0x130264);})['catch'](function(_0x31ace1){logger[_0xc5dc('0x16')](_0xc5dc('0xa'),_0x31ace1['message'],_0x385f76);_0x1147a2(_0x5a8ed7[_0xc5dc('0x16')](0x1f4,_0x31ace1[_0xc5dc('0x17')]));});});};exports[_0xc5dc('0x18')]=function(_0x15cfa5){var _0x32c2e6=this;return new Promise(function(_0x23b45a,_0x5aaf82){return db[_0xc5dc('0xb')][_0xc5dc('0x19')]({'raw':_0x15cfa5[_0xc5dc('0xd')]?_0x15cfa5[_0xc5dc('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x15cfa5[_0xc5dc('0xd')]?_0x15cfa5[_0xc5dc('0xd')][_0xc5dc('0xe')]||null:null,'attributes':_0x15cfa5[_0xc5dc('0xd')]?_0x15cfa5[_0xc5dc('0xd')][_0xc5dc('0x13')]||null:null,'include':_0x15cfa5['options']?_0x15cfa5['options']['include']?_[_0xc5dc('0x10')](_0x15cfa5['options'][_0xc5dc('0x11')],function(_0x1a677d){return{'model':db[_0x1a677d[_0xc5dc('0x12')]],'as':_0x1a677d['as'],'attributes':_0x1a677d['attributes'],'include':_0x1a677d[_0xc5dc('0x11')]?_[_0xc5dc('0x10')](_0x1a677d[_0xc5dc('0x11')],function(_0x4ca915){return{'model':db[_0x4ca915['model']],'as':_0x4ca915['as'],'attributes':_0x4ca915[_0xc5dc('0x13')],'include':_0x4ca915['include']?_[_0xc5dc('0x10')](_0x4ca915[_0xc5dc('0x11')],function(_0x13d09f){return{'model':db[_0x13d09f[_0xc5dc('0x12')]],'as':_0x13d09f['as'],'attributes':_0x13d09f[_0xc5dc('0x13')]};}):[]};}):[]};}):[]:[]})[_0xc5dc('0x1a')](function(_0x41de3f){logger[_0xc5dc('0x1b')](_0xc5dc('0x18'),_0x15cfa5);logger[_0xc5dc('0x14')](_0xc5dc('0x18'),_0x15cfa5,JSON[_0xc5dc('0x15')](_0x41de3f));_0x23b45a(_0x41de3f);})['catch'](function(_0x3ef5a4){logger[_0xc5dc('0x16')](_0xc5dc('0x18'),_0x3ef5a4[_0xc5dc('0x17')],_0x15cfa5);_0x5aaf82(_0x32c2e6[_0xc5dc('0x16')](0x1f4,_0x3ef5a4[_0xc5dc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 39b9d73..d511693 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 _0x0be8=['emit','removeListener','length','./squareProject.events','update'];(function(_0x3acd04,_0x34fdcd){var _0x1af549=function(_0x79761b){while(--_0x79761b){_0x3acd04['push'](_0x3acd04['shift']());}};_0x1af549(++_0x34fdcd);}(_0x0be8,0x13e));var _0x80be=function(_0x2b1f44,_0x3fd92f){_0x2b1f44=_0x2b1f44-0x0;var _0x370755=_0x0be8[_0x2b1f44];return _0x370755;};'use strict';var SquareProjectEvents=require(_0x80be('0x0'));var events=['save','remove',_0x80be('0x1')];function createListener(_0x46876d,_0x538da1){return function(_0x5242a8){_0x538da1[_0x80be('0x2')](_0x46876d,_0x5242a8);};}function removeListener(_0x2cb9e1,_0xa06e15){return function(){SquareProjectEvents[_0x80be('0x3')](_0x2cb9e1,_0xa06e15);};}exports['register']=function(_0x3cc9fb){for(var _0x32a47f=0x0,_0x211198=events[_0x80be('0x4')];_0x32a47f<_0x211198;_0x32a47f++){var _0xb254f0=events[_0x32a47f];var _0x18cc3=createListener('squareProject:'+_0xb254f0,_0x3cc9fb);SquareProjectEvents['on'](_0xb254f0,_0x18cc3);}}; \ No newline at end of file +var _0x6a8c=['update','emit','removeListener','register','length','squareProject:','./squareProject.events','remove'];(function(_0x437a22,_0x29f9b5){var _0x18c59d=function(_0x408dae){while(--_0x408dae){_0x437a22['push'](_0x437a22['shift']());}};_0x18c59d(++_0x29f9b5);}(_0x6a8c,0x15e));var _0xc6a8=function(_0x3212b5,_0xe27e38){_0x3212b5=_0x3212b5-0x0;var _0x1130fd=_0x6a8c[_0x3212b5];return _0x1130fd;};'use strict';var SquareProjectEvents=require(_0xc6a8('0x0'));var events=['save',_0xc6a8('0x1'),_0xc6a8('0x2')];function createListener(_0x5bffbe,_0x2d9928){return function(_0x289b8a){_0x2d9928[_0xc6a8('0x3')](_0x5bffbe,_0x289b8a);};}function removeListener(_0xacfa65,_0x52ad72){return function(){SquareProjectEvents[_0xc6a8('0x4')](_0xacfa65,_0x52ad72);};}exports[_0xc6a8('0x5')]=function(_0x472ca6){for(var _0xc338fe=0x0,_0x4d0a2c=events[_0xc6a8('0x6')];_0xc338fe<_0x4d0a2c;_0xc338fe++){var _0x4bd321=events[_0xc338fe];var _0xf3e834=createListener(_0xc6a8('0x7')+_0x4bd321,_0x472ca6);SquareProjectEvents['on'](_0x4bd321,_0xf3e834);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index df9be5c..00177ba 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x2f0bb9,_0x4b92b2){var _0x2e1796=function(_0x1daf4f){while(--_0x1daf4f){_0x2f0bb9['push'](_0x2f0bb9['shift']());}};_0x2e1796(++_0x4b92b2);}(_0x1cb9,0x14e));var _0x91cb=function(_0x40d560,_0x4b6a80){_0x40d560=_0x40d560-0x0;var _0x4b9c3f=_0x1cb9[_0x40d560];return _0x4b9c3f;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x58a935,_0x427946){var _0x2d6013=function(_0x835191){while(--_0x835191){_0x58a935['push'](_0x58a935['shift']());}};_0x2d6013(++_0x427946);}(_0x4975,0x86));var _0x5497=function(_0x18f4ce,_0xf9d5fd){_0x18f4ce=_0x18f4ce-0x0;var _0x2b34be=_0x4975[_0x18f4ce];return _0x2b34be;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 6b29dc7..f257c37 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 _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xabce,0x103));var _0xeabc=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xabce[_0x2b7764];return _0x848dcb;};'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 +var _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x2475f6,_0x14894c){var _0x935818=function(_0x19980e){while(--_0x19980e){_0x2475f6['push'](_0x2475f6['shift']());}};_0x935818(++_0x14894c);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xeec6[_0x4eec9b];return _0x2e3849;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4ed1017..105d978 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 _0x3250=['pick','merge','VIRTUAL','filter','options','then','includeAll','findAll','catch','show','params','length','include','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','map','keys','filters','intersection','attributes','fields','nolimit','query','order','sort','where'];(function(_0x4bd629,_0x1114bf){var _0x585c2d=function(_0x15644f){while(--_0x15644f){_0x4bd629['push'](_0x4bd629['shift']());}};_0x585c2d(++_0x1114bf);}(_0x3250,0x82));var _0x0325=function(_0x22c358,_0x5083bf){_0x22c358=_0x22c358-0x0;var _0x1c93f6=_0x3250[_0x22c358];return _0x1c93f6;};'use strict';var emlformat=require(_0x0325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0325('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0325('0x2'));var moment=require(_0x0325('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0325('0x4'));var path=require('path');var sox=require(_0x0325('0x5'));var csv=require(_0x0325('0x6'));var ejs=require(_0x0325('0x7'));var fs=require('fs');var fs_extra=require(_0x0325('0x8'));var _=require(_0x0325('0x9'));var squel=require(_0x0325('0xa'));var crypto=require('crypto');var jsforce=require(_0x0325('0xb'));var deskjs=require(_0x0325('0xc'));var toCsv=require(_0x0325('0x6'));var querystring=require('querystring');var Papa=require(_0x0325('0xd'));var Redis=require(_0x0325('0xe'));var authService=require(_0x0325('0xf'));var qs=require(_0x0325('0x10'));var as=require(_0x0325('0x11'));var hardwareService=require(_0x0325('0x12'));var logger=require(_0x0325('0x13'))(_0x0325('0x14'));var utils=require('../../config/utils');var config=require(_0x0325('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386065,_0x4e0fed){_0x4e0fed=_0x4e0fed||0xcc;return function(_0x264eac){if(_0x264eac){return _0x386065[_0x0325('0x16')](_0x4e0fed);}return _0x386065[_0x0325('0x17')](_0x4e0fed)[_0x0325('0x18')]();};}function respondWithResult(_0x2c8767,_0x1f1369){_0x1f1369=_0x1f1369||0xc8;return function(_0x3b3a19){if(_0x3b3a19){return _0x2c8767[_0x0325('0x17')](_0x1f1369)[_0x0325('0x19')](_0x3b3a19);}};}function respondWithFilteredResult(_0x471795,_0x2aac0c){return function(_0x41a6bf){if(_0x41a6bf){var _0x206778=typeof _0x2aac0c[_0x0325('0x1a')]===_0x0325('0x1b')&&typeof _0x2aac0c[_0x0325('0x1c')]===_0x0325('0x1b');var _0x4ea5f9=_0x41a6bf[_0x0325('0x1d')];var _0x46e626=_0x206778?0x0:_0x2aac0c[_0x0325('0x1a')];var _0x3c5cc8=_0x206778?_0x41a6bf[_0x0325('0x1d')]:_0x2aac0c[_0x0325('0x1a')]+_0x2aac0c['limit'];var _0x1d21d9;if(_0x3c5cc8>=_0x4ea5f9){_0x3c5cc8=_0x4ea5f9;_0x1d21d9=0xc8;}else{_0x1d21d9=0xce;}_0x471795[_0x0325('0x17')](_0x1d21d9);return _0x471795[_0x0325('0x1e')](_0x0325('0x1f'),_0x46e626+'-'+_0x3c5cc8+'/'+_0x4ea5f9)[_0x0325('0x19')](_0x41a6bf);}return null;};}function patchUpdates(_0x41c52c){return function(_0x3a27c4){try{jsonpatch['apply'](_0x3a27c4,_0x41c52c,!![]);}catch(_0x800d6d){return BPromise['reject'](_0x800d6d);}return _0x3a27c4[_0x0325('0x20')]();};}function saveUpdates(_0x5b8b50,_0x48b5f){return function(_0x3e8804){if(_0x3e8804){return _0x3e8804[_0x0325('0x21')](_0x5b8b50)['then'](function(_0x1de6e7){return _0x1de6e7;});}return null;};}function removeEntity(_0x4c557a,_0x498a86){return function(_0x3d031e){if(_0x3d031e){return _0x3d031e[_0x0325('0x22')]()['then'](function(){_0x4c557a[_0x0325('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3680f7,_0x216b81){return function(_0x3bc0fa){if(!_0x3bc0fa){_0x3680f7['sendStatus'](0x194);}return _0x3bc0fa;};}function handleError(_0xe23216,_0x11b360){_0x11b360=_0x11b360||0x1f4;return function(_0x18df79){logger[_0x0325('0x23')](_0x18df79[_0x0325('0x24')]);if(_0x18df79[_0x0325('0x25')]){delete _0x18df79[_0x0325('0x25')];}_0xe23216[_0x0325('0x17')](_0x11b360)[_0x0325('0x26')](_0x18df79);};}exports[_0x0325('0x27')]=function(_0x39b30b,_0x4618ae){var _0x353478={},_0x271c6f={},_0x336c05={'count':0x0,'rows':[]};var _0x238c3d=_['map'](db[_0x0325('0x28')][_0x0325('0x29')],function(_0x700c7b){return{'name':_0x700c7b['fieldName'],'type':_0x700c7b[_0x0325('0x2a')][_0x0325('0x2b')]};});_0x271c6f[_0x0325('0x2c')]=_[_0x0325('0x2d')](_0x238c3d,'name');_0x271c6f['query']=_[_0x0325('0x2e')](_0x39b30b['query']);_0x271c6f[_0x0325('0x2f')]=_[_0x0325('0x30')](_0x271c6f[_0x0325('0x2c')],_0x271c6f['query']);_0x353478[_0x0325('0x31')]=_[_0x0325('0x30')](_0x271c6f[_0x0325('0x2c')],qs[_0x0325('0x32')](_0x39b30b['query']['fields']));_0x353478[_0x0325('0x31')]=_0x353478[_0x0325('0x31')]['length']?_0x353478[_0x0325('0x31')]:_0x271c6f[_0x0325('0x2c')];if(!_0x39b30b['query']['hasOwnProperty'](_0x0325('0x33'))){_0x353478[_0x0325('0x1c')]=qs[_0x0325('0x1c')](_0x39b30b[_0x0325('0x34')][_0x0325('0x1c')]);_0x353478[_0x0325('0x1a')]=qs['offset'](_0x39b30b[_0x0325('0x34')]['offset']);}_0x353478[_0x0325('0x35')]=qs[_0x0325('0x36')](_0x39b30b[_0x0325('0x34')][_0x0325('0x36')]);_0x353478[_0x0325('0x37')]=qs['filters'](_[_0x0325('0x38')](_0x39b30b[_0x0325('0x34')],_0x271c6f[_0x0325('0x2f')]),_0x238c3d);if(_0x39b30b[_0x0325('0x34')]['filter']){_0x353478[_0x0325('0x37')]=_[_0x0325('0x39')](_0x353478['where'],{'$or':_[_0x0325('0x2d')](_0x238c3d,function(_0x460ea0){if(_0x460ea0['type']!==_0x0325('0x3a')){var _0x51c20b={};_0x51c20b[_0x460ea0[_0x0325('0x25')]]={'$like':'%'+_0x39b30b['query'][_0x0325('0x3b')]+'%'};return _0x51c20b;}})});}_0x353478=_['merge']({},_0x353478,_0x39b30b[_0x0325('0x3c')]);var _0x1a6da6={'where':_0x353478['where']};return db[_0x0325('0x28')]['count'](_0x1a6da6)[_0x0325('0x3d')](function(_0x48a8fa){_0x336c05[_0x0325('0x1d')]=_0x48a8fa;if(_0x39b30b[_0x0325('0x34')][_0x0325('0x3e')]){_0x353478['include']=[{'all':!![]}];}return db['SquareRecording'][_0x0325('0x3f')](_0x353478);})[_0x0325('0x3d')](function(_0x949b6f){_0x336c05['rows']=_0x949b6f;return _0x336c05;})[_0x0325('0x3d')](respondWithFilteredResult(_0x4618ae,_0x353478))[_0x0325('0x40')](handleError(_0x4618ae,null));};exports[_0x0325('0x41')]=function(_0x57f957,_0x2ef9b0){var _0x21f372={'raw':!![],'where':{'id':_0x57f957[_0x0325('0x42')]['id']}},_0x6f8210={};_0x6f8210[_0x0325('0x2c')]=_[_0x0325('0x2e')](db[_0x0325('0x28')][_0x0325('0x29')]);_0x6f8210[_0x0325('0x34')]=_[_0x0325('0x2e')](_0x57f957[_0x0325('0x34')]);_0x6f8210[_0x0325('0x2f')]=_[_0x0325('0x30')](_0x6f8210[_0x0325('0x2c')],_0x6f8210[_0x0325('0x34')]);_0x21f372[_0x0325('0x31')]=_[_0x0325('0x30')](_0x6f8210[_0x0325('0x2c')],qs[_0x0325('0x32')](_0x57f957[_0x0325('0x34')][_0x0325('0x32')]));_0x21f372[_0x0325('0x31')]=_0x21f372[_0x0325('0x31')][_0x0325('0x43')]?_0x21f372[_0x0325('0x31')]:_0x6f8210[_0x0325('0x2c')];if(_0x57f957['query'][_0x0325('0x3e')]){_0x21f372[_0x0325('0x44')]=[{'all':!![]}];}_0x21f372=_[_0x0325('0x39')]({},_0x21f372,_0x57f957['options']);return db[_0x0325('0x28')][_0x0325('0x45')](_0x21f372)['then'](handleEntityNotFound(_0x2ef9b0,null))['then'](respondWithResult(_0x2ef9b0,null))['catch'](handleError(_0x2ef9b0,null));};exports[_0x0325('0x46')]=function(_0x19b6f3,_0x519f4e){return db[_0x0325('0x28')][_0x0325('0x46')](_0x19b6f3[_0x0325('0x47')],{})[_0x0325('0x3d')](respondWithResult(_0x519f4e,0xc9))[_0x0325('0x40')](handleError(_0x519f4e,null));};exports[_0x0325('0x21')]=function(_0x4ab587,_0x48dc95){if(_0x4ab587[_0x0325('0x47')]['id']){delete _0x4ab587[_0x0325('0x47')]['id'];}return db['SquareRecording'][_0x0325('0x45')]({'where':{'id':_0x4ab587['params']['id']}})[_0x0325('0x3d')](handleEntityNotFound(_0x48dc95,null))[_0x0325('0x3d')](saveUpdates(_0x4ab587['body'],null))['then'](respondWithResult(_0x48dc95,null))['catch'](handleError(_0x48dc95,null));};exports[_0x0325('0x48')]=function(_0x49bf17,_0x7b77c5,_0x4d1f68){var _0x4ccc57=require(_0x0325('0x49'));var _0x571999=![];var _0x57be0b={};if(_0x49bf17[_0x0325('0x34')]['type']&&_0x49bf17[_0x0325('0x34')][_0x0325('0x2a')]===_0x0325('0x4a')){_0x57be0b[_0x0325('0x4a')]=_0x49bf17[_0x0325('0x42')]['id'];}else{_0x57be0b['id']=_0x49bf17['params']['id'];}return db[_0x0325('0x28')][_0x0325('0x45')]({'where':_0x57be0b,'attributes':['id',_0x0325('0x4b'),'filename'],'raw':!![]})[_0x0325('0x3d')](handleEntityNotFound(_0x7b77c5,null))[_0x0325('0x3d')](function(_0x195d76){if(_0x195d76){var _0x15795a=_0x195d76[_0x0325('0x4b')];var _0x5bf13b=util[_0x0325('0x4c')](_0x0325('0x4d'),_0x15795a);if(fs[_0x0325('0x4e')](_0x5bf13b)){_0x571999=!![];return _0x4ccc57['decryptFile'](_0x5bf13b,_0x15795a,config[_0x0325('0x4f')][_0x0325('0x50')])[_0x0325('0x3d')](function(){return _0x195d76;});}return _0x195d76;}})[_0x0325('0x3d')](function(_0x1e366e){if(_0x1e366e){var _0x810256=_0x1e366e['savePath'];if(!fs[_0x0325('0x4e')](_0x810256)){throw new db[(_0x0325('0x51'))][(_0x0325('0x52'))](_0x0325('0x53'));}if(_0x1e366e[_0x0325('0x54')]){return _0x7b77c5[_0x0325('0x48')](_0x810256,_0x1e366e[_0x0325('0x54')]+path[_0x0325('0x55')](_0x810256),function(){if(_0x571999){fs[_0x0325('0x56')](_0x810256);}});}else{return _0x7b77c5['download'](_0x810256,function(_0x23c9bd){if(_0x571999){fs['unlink'](_0x810256);}});}}})[_0x0325('0x40')](function(_0x270fc3){if(_0x270fc3[_0x0325('0x57')]===_0x0325('0x53')){_0x7b77c5[_0x0325('0x17')](0x194)[_0x0325('0x26')](_0x0325('0x58'));}else{return handleError(_0x7b77c5,null);}});};exports[_0x0325('0x22')]=function(_0x4ea644,_0x4707b7){return db[_0x0325('0x28')][_0x0325('0x45')]({'where':{'id':_0x4ea644[_0x0325('0x42')]['id']}})['then'](function(_0x2094f5){if(_[_0x0325('0x59')](_0x2094f5)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2094f5;})[_0x0325('0x3d')](function(_0x380fe3){var _0x3f33c1=_0x380fe3['savePath'];logger[_0x0325('0x5a')](_0x0325('0x5b'),_0x3f33c1);if(!_['isNil'](_0x380fe3[_0x0325('0x4b')])&&fs[_0x0325('0x4e')](_0x3f33c1)){logger[_0x0325('0x5a')]('File:\x20\x22'+_0x3f33c1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0325('0x5c')](_0x3f33c1);}_0x3f33c1=_0x3f33c1+'.cypher';if(!_[_0x0325('0x59')](_0x380fe3[_0x0325('0x4b')])&&fs[_0x0325('0x4e')](_0x3f33c1)){logger[_0x0325('0x5a')]('File:\x20\x22'+_0x3f33c1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3f33c1);}return _0x380fe3;})[_0x0325('0x3d')](function(_0x271322){if(!_0x271322)throw new InternalError();return _0x271322[_0x0325('0x22')]();})[_0x0325('0x3d')](function(){_0x4707b7[_0x0325('0x17')](0xcc)[_0x0325('0x18')]();})['catch'](handleError(_0x4707b7,null));}; \ No newline at end of file +var _0xe9a9=['savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','fs-extra','lodash','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','download','../../components/encryptor','uniqueid'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe9a9,0x127));var _0x9e9a=function(_0x16d8b2,_0x22a573){_0x16d8b2=_0x16d8b2-0x0;var _0x1fec25=_0xe9a9[_0x16d8b2];return _0x1fec25;};'use strict';var emlformat=require(_0x9e9a('0x0'));var rimraf=require(_0x9e9a('0x1'));var zipdir=require(_0x9e9a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e9a('0x3'));var moment=require(_0x9e9a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e9a('0x5'));var path=require(_0x9e9a('0x6'));var sox=require('sox');var csv=require(_0x9e9a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e9a('0x8'));var _=require(_0x9e9a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e9a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9e9a('0xb'));var Papa=require('papaparse');var Redis=require(_0x9e9a('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9e9a('0xd'));var hardwareService=require(_0x9e9a('0xe'));var logger=require(_0x9e9a('0xf'))(_0x9e9a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9e9a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x588cad,_0x44a3b){_0x44a3b=_0x44a3b||0xcc;return function(_0x2f2609){if(_0x2f2609){return _0x588cad['sendStatus'](_0x44a3b);}return _0x588cad[_0x9e9a('0x12')](_0x44a3b)['end']();};}function respondWithResult(_0x2a25c5,_0xf1c683){_0xf1c683=_0xf1c683||0xc8;return function(_0x5282f7){if(_0x5282f7){return _0x2a25c5[_0x9e9a('0x12')](_0xf1c683)['json'](_0x5282f7);}};}function respondWithFilteredResult(_0x1e6f12,_0x5b28e0){return function(_0x2091c1){if(_0x2091c1){var _0xf5c8bb=typeof _0x5b28e0[_0x9e9a('0x13')]===_0x9e9a('0x14')&&typeof _0x5b28e0[_0x9e9a('0x15')]===_0x9e9a('0x14');var _0xb4c524=_0x2091c1[_0x9e9a('0x16')];var _0x54af81=_0xf5c8bb?0x0:_0x5b28e0[_0x9e9a('0x13')];var _0x4cf102=_0xf5c8bb?_0x2091c1[_0x9e9a('0x16')]:_0x5b28e0[_0x9e9a('0x13')]+_0x5b28e0[_0x9e9a('0x15')];var _0x41570d;if(_0x4cf102>=_0xb4c524){_0x4cf102=_0xb4c524;_0x41570d=0xc8;}else{_0x41570d=0xce;}_0x1e6f12[_0x9e9a('0x12')](_0x41570d);return _0x1e6f12[_0x9e9a('0x17')]('Content-Range',_0x54af81+'-'+_0x4cf102+'/'+_0xb4c524)[_0x9e9a('0x18')](_0x2091c1);}return null;};}function patchUpdates(_0x21fe6b){return function(_0x2b1e6b){try{jsonpatch[_0x9e9a('0x19')](_0x2b1e6b,_0x21fe6b,!![]);}catch(_0x58c551){return BPromise[_0x9e9a('0x1a')](_0x58c551);}return _0x2b1e6b[_0x9e9a('0x1b')]();};}function saveUpdates(_0x5a3d94,_0x1413a3){return function(_0xd5f32a){if(_0xd5f32a){return _0xd5f32a['update'](_0x5a3d94)[_0x9e9a('0x1c')](function(_0x185cc4){return _0x185cc4;});}return null;};}function removeEntity(_0x4ce4fd,_0x5c6ff2){return function(_0x4d2f18){if(_0x4d2f18){return _0x4d2f18[_0x9e9a('0x1d')]()['then'](function(){_0x4ce4fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3552eb,_0x1ec4f2){return function(_0x1f93d3){if(!_0x1f93d3){_0x3552eb['sendStatus'](0x194);}return _0x1f93d3;};}function handleError(_0x1e1806,_0x13a862){_0x13a862=_0x13a862||0x1f4;return function(_0x44d91b){logger[_0x9e9a('0x1e')](_0x44d91b[_0x9e9a('0x1f')]);if(_0x44d91b[_0x9e9a('0x20')]){delete _0x44d91b[_0x9e9a('0x20')];}_0x1e1806[_0x9e9a('0x12')](_0x13a862)['send'](_0x44d91b);};}exports['index']=function(_0x875955,_0x1f78bf){var _0x201077={},_0x1020cf={},_0x295a9e={'count':0x0,'rows':[]};var _0x4dfe9=_[_0x9e9a('0x21')](db['SquareRecording'][_0x9e9a('0x22')],function(_0x2958b6){return{'name':_0x2958b6['fieldName'],'type':_0x2958b6[_0x9e9a('0x23')][_0x9e9a('0x24')]};});_0x1020cf[_0x9e9a('0x25')]=_[_0x9e9a('0x21')](_0x4dfe9,_0x9e9a('0x20'));_0x1020cf[_0x9e9a('0x26')]=_[_0x9e9a('0x27')](_0x875955[_0x9e9a('0x26')]);_0x1020cf['filters']=_[_0x9e9a('0x28')](_0x1020cf[_0x9e9a('0x25')],_0x1020cf[_0x9e9a('0x26')]);_0x201077['attributes']=_[_0x9e9a('0x28')](_0x1020cf[_0x9e9a('0x25')],qs[_0x9e9a('0x29')](_0x875955['query'][_0x9e9a('0x29')]));_0x201077[_0x9e9a('0x2a')]=_0x201077[_0x9e9a('0x2a')]['length']?_0x201077['attributes']:_0x1020cf[_0x9e9a('0x25')];if(!_0x875955[_0x9e9a('0x26')][_0x9e9a('0x2b')](_0x9e9a('0x2c'))){_0x201077['limit']=qs[_0x9e9a('0x15')](_0x875955[_0x9e9a('0x26')][_0x9e9a('0x15')]);_0x201077[_0x9e9a('0x13')]=qs[_0x9e9a('0x13')](_0x875955[_0x9e9a('0x26')][_0x9e9a('0x13')]);}_0x201077[_0x9e9a('0x2d')]=qs['sort'](_0x875955[_0x9e9a('0x26')][_0x9e9a('0x2e')]);_0x201077[_0x9e9a('0x2f')]=qs[_0x9e9a('0x30')](_[_0x9e9a('0x31')](_0x875955['query'],_0x1020cf[_0x9e9a('0x30')]),_0x4dfe9);if(_0x875955[_0x9e9a('0x26')]['filter']){_0x201077[_0x9e9a('0x2f')]=_['merge'](_0x201077[_0x9e9a('0x2f')],{'$or':_['map'](_0x4dfe9,function(_0x31d791){if(_0x31d791[_0x9e9a('0x23')]!==_0x9e9a('0x32')){var _0x2ab909={};_0x2ab909[_0x31d791[_0x9e9a('0x20')]]={'$like':'%'+_0x875955['query'][_0x9e9a('0x33')]+'%'};return _0x2ab909;}})});}_0x201077=_[_0x9e9a('0x34')]({},_0x201077,_0x875955[_0x9e9a('0x35')]);var _0x319dfa={'where':_0x201077[_0x9e9a('0x2f')]};return db[_0x9e9a('0x36')][_0x9e9a('0x16')](_0x319dfa)[_0x9e9a('0x1c')](function(_0x525344){_0x295a9e['count']=_0x525344;if(_0x875955[_0x9e9a('0x26')][_0x9e9a('0x37')]){_0x201077[_0x9e9a('0x38')]=[{'all':!![]}];}return db['SquareRecording'][_0x9e9a('0x39')](_0x201077);})[_0x9e9a('0x1c')](function(_0x1783d9){_0x295a9e[_0x9e9a('0x3a')]=_0x1783d9;return _0x295a9e;})[_0x9e9a('0x1c')](respondWithFilteredResult(_0x1f78bf,_0x201077))[_0x9e9a('0x3b')](handleError(_0x1f78bf,null));};exports[_0x9e9a('0x3c')]=function(_0x60d6a8,_0x104632){var _0x208297={'raw':!![],'where':{'id':_0x60d6a8[_0x9e9a('0x3d')]['id']}},_0x1ead0f={};_0x1ead0f['model']=_['keys'](db['SquareRecording'][_0x9e9a('0x22')]);_0x1ead0f[_0x9e9a('0x26')]=_[_0x9e9a('0x27')](_0x60d6a8[_0x9e9a('0x26')]);_0x1ead0f['filters']=_[_0x9e9a('0x28')](_0x1ead0f[_0x9e9a('0x25')],_0x1ead0f[_0x9e9a('0x26')]);_0x208297['attributes']=_['intersection'](_0x1ead0f[_0x9e9a('0x25')],qs['fields'](_0x60d6a8['query'][_0x9e9a('0x29')]));_0x208297[_0x9e9a('0x2a')]=_0x208297['attributes']['length']?_0x208297[_0x9e9a('0x2a')]:_0x1ead0f[_0x9e9a('0x25')];if(_0x60d6a8[_0x9e9a('0x26')]['includeAll']){_0x208297[_0x9e9a('0x38')]=[{'all':!![]}];}_0x208297=_['merge']({},_0x208297,_0x60d6a8['options']);return db[_0x9e9a('0x36')][_0x9e9a('0x3e')](_0x208297)['then'](handleEntityNotFound(_0x104632,null))['then'](respondWithResult(_0x104632,null))['catch'](handleError(_0x104632,null));};exports['create']=function(_0x40c1c1,_0x3b3600){return db[_0x9e9a('0x36')][_0x9e9a('0x3f')](_0x40c1c1['body'],{})[_0x9e9a('0x1c')](respondWithResult(_0x3b3600,0xc9))[_0x9e9a('0x3b')](handleError(_0x3b3600,null));};exports[_0x9e9a('0x40')]=function(_0x243475,_0x3f9b73){if(_0x243475[_0x9e9a('0x41')]['id']){delete _0x243475[_0x9e9a('0x41')]['id'];}return db[_0x9e9a('0x36')][_0x9e9a('0x3e')]({'where':{'id':_0x243475['params']['id']}})['then'](handleEntityNotFound(_0x3f9b73,null))[_0x9e9a('0x1c')](saveUpdates(_0x243475['body'],null))[_0x9e9a('0x1c')](respondWithResult(_0x3f9b73,null))['catch'](handleError(_0x3f9b73,null));};exports[_0x9e9a('0x42')]=function(_0x49633d,_0x1a6d99,_0x28ac13){var _0x169122=require(_0x9e9a('0x43'));var _0x3a0ed7=![];var _0x30c804={};if(_0x49633d['query'][_0x9e9a('0x23')]&&_0x49633d[_0x9e9a('0x26')][_0x9e9a('0x23')]===_0x9e9a('0x44')){_0x30c804[_0x9e9a('0x44')]=_0x49633d[_0x9e9a('0x3d')]['id'];}else{_0x30c804['id']=_0x49633d[_0x9e9a('0x3d')]['id'];}return db[_0x9e9a('0x36')]['find']({'where':_0x30c804,'attributes':['id',_0x9e9a('0x45'),_0x9e9a('0x46')],'raw':!![]})[_0x9e9a('0x1c')](handleEntityNotFound(_0x1a6d99,null))['then'](function(_0x37c24a){if(_0x37c24a){var _0x14163c=_0x37c24a[_0x9e9a('0x45')];var _0x18f8ff=util['format'](_0x9e9a('0x47'),_0x14163c);if(fs[_0x9e9a('0x48')](_0x18f8ff)){_0x3a0ed7=!![];return _0x169122[_0x9e9a('0x49')](_0x18f8ff,_0x14163c,config[_0x9e9a('0x4a')][_0x9e9a('0x4b')])[_0x9e9a('0x1c')](function(){return _0x37c24a;});}return _0x37c24a;}})['then'](function(_0x38d8cb){if(_0x38d8cb){var _0x48ff53=_0x38d8cb[_0x9e9a('0x45')];if(!fs[_0x9e9a('0x48')](_0x48ff53)){throw new db[(_0x9e9a('0x4c'))][(_0x9e9a('0x4d'))]('SquareRecording\x20not\x20found');}if(_0x38d8cb[_0x9e9a('0x46')]){return _0x1a6d99[_0x9e9a('0x42')](_0x48ff53,_0x38d8cb[_0x9e9a('0x46')]+path[_0x9e9a('0x4e')](_0x48ff53),function(){if(_0x3a0ed7){fs[_0x9e9a('0x4f')](_0x48ff53);}});}else{return _0x1a6d99[_0x9e9a('0x42')](_0x48ff53,function(_0x10e709){if(_0x3a0ed7){fs[_0x9e9a('0x4f')](_0x48ff53);}});}}})[_0x9e9a('0x3b')](function(_0x4b48c1){if(_0x4b48c1[_0x9e9a('0x50')]===_0x9e9a('0x51')){_0x1a6d99[_0x9e9a('0x12')](0x194)[_0x9e9a('0x52')](_0x9e9a('0x53'));}else{return handleError(_0x1a6d99,null);}});};exports[_0x9e9a('0x1d')]=function(_0x483691,_0x2b5304){return db[_0x9e9a('0x36')]['find']({'where':{'id':_0x483691['params']['id']}})[_0x9e9a('0x1c')](function(_0xd507a3){if(_[_0x9e9a('0x54')](_0xd507a3)){throw new ReferenceError(_0x9e9a('0x55'));}return _0xd507a3;})[_0x9e9a('0x1c')](function(_0x43ccb7){var _0x565b8d=_0x43ccb7['savePath'];logger[_0x9e9a('0x56')](_0x9e9a('0x57'),_0x565b8d);if(!_[_0x9e9a('0x54')](_0x43ccb7[_0x9e9a('0x45')])&&fs['existsSync'](_0x565b8d)){logger[_0x9e9a('0x56')](_0x9e9a('0x58')+_0x565b8d+_0x9e9a('0x59'));fs['unlinkSync'](_0x565b8d);}_0x565b8d=_0x565b8d+_0x9e9a('0x5a');if(!_['isNil'](_0x43ccb7[_0x9e9a('0x45')])&&fs[_0x9e9a('0x48')](_0x565b8d)){logger[_0x9e9a('0x56')](_0x9e9a('0x58')+_0x565b8d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x565b8d);}return _0x43ccb7;})['then'](function(_0x279208){if(!_0x279208)throw new InternalError();return _0x279208[_0x9e9a('0x1d')]();})[_0x9e9a('0x1c')](function(){_0x2b5304[_0x9e9a('0x12')](0xcc)['end']();})[_0x9e9a('0x3b')](handleError(_0x2b5304,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1ce2682..19db19f 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 _0xe953=['bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','SquareRecording','lodash','util','../../config/logger','moment'];(function(_0x30120a,_0x16adc6){var _0x5ede87=function(_0x5eb178){while(--_0x5eb178){_0x30120a['push'](_0x30120a['shift']());}};_0x5ede87(++_0x16adc6);}(_0xe953,0xf9));var _0x3e95=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xe953[_0xf84870];return _0x4541a4;};'use strict';var _=require(_0x3e95('0x0'));var util=require(_0x3e95('0x1'));var logger=require(_0x3e95('0x2'))('api');var moment=require(_0x3e95('0x3'));var BPromise=require(_0x3e95('0x4'));var rp=require(_0x3e95('0x5'));var fs=require('fs');var path=require(_0x3e95('0x6'));var rimraf=require(_0x3e95('0x7'));var config=require(_0x3e95('0x8'));var attributes=require(_0x3e95('0x9'));module['exports']=function(_0x4ec1b2,_0x2aaa3e){return _0x4ec1b2['define'](_0x3e95('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb04=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings'];(function(_0x3d4567,_0x607422){var _0x4403ed=function(_0x506c29){while(--_0x506c29){_0x3d4567['push'](_0x3d4567['shift']());}};_0x4403ed(++_0x607422);}(_0xcb04,0x9a));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var logger=require(_0x4cb0('0x2'))(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var BPromise=require(_0x4cb0('0x5'));var rp=require(_0x4cb0('0x6'));var fs=require('fs');var path=require(_0x4cb0('0x7'));var rimraf=require(_0x4cb0('0x8'));var config=require(_0x4cb0('0x9'));var attributes=require('./squareRecording.attributes');module[_0x4cb0('0xa')]=function(_0x2fb566,_0x247e05){return _0x2fb566[_0x4cb0('0xb')](_0x4cb0('0xc'),attributes,{'tableName':_0x4cb0('0xd'),'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 ff63a8b..9eb45a0 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 _0xee66=['SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xee66,0x1b3));var _0x6ee6=function(_0x190417,_0x54dc0d){_0x190417=_0x190417-0x0;var _0x110e9c=_0xee66[_0x190417];return _0x110e9c;};'use strict';var _=require(_0x6ee6('0x0'));var util=require(_0x6ee6('0x1'));var moment=require(_0x6ee6('0x2'));var BPromise=require(_0x6ee6('0x3'));var rs=require(_0x6ee6('0x4'));var fs=require('fs');var Redis=require(_0x6ee6('0x5'));var db=require(_0x6ee6('0x6'))['db'];var utils=require(_0x6ee6('0x7'));var logger=require(_0x6ee6('0x8'))('rpc');var config=require(_0x6ee6('0x9'));var jayson=require(_0x6ee6('0xa'));var client=jayson['client'][_0x6ee6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x379e92,_0x15f04c,_0x5c520d){return new BPromise(function(_0x7741de,_0x25b6a2){return client[_0x6ee6('0xc')](_0x379e92,_0x5c520d)['then'](function(_0x5508d4){logger[_0x6ee6('0xd')]('SquareRecording,\x20%s,\x20%s',_0x15f04c,_0x6ee6('0xe'));logger['debug'](_0x6ee6('0xf'),_0x15f04c,_0x6ee6('0xe'),JSON[_0x6ee6('0x10')](_0x5508d4));if(_0x5508d4[_0x6ee6('0x11')]){if(_0x5508d4['error']['code']===0x1f4){logger[_0x6ee6('0x11')](_0x6ee6('0x12'),_0x15f04c,_0x5508d4['error'][_0x6ee6('0x13')]);return _0x25b6a2(_0x5508d4['error'][_0x6ee6('0x13')]);}logger[_0x6ee6('0x11')](_0x6ee6('0x12'),_0x15f04c,_0x5508d4[_0x6ee6('0x11')][_0x6ee6('0x13')]);return _0x7741de(_0x5508d4[_0x6ee6('0x11')]['message']);}else{logger[_0x6ee6('0xd')](_0x6ee6('0x12'),_0x15f04c,_0x6ee6('0xe'));_0x7741de(_0x5508d4[_0x6ee6('0x14')][_0x6ee6('0x13')]);}})[_0x6ee6('0x15')](function(_0x1d964e){logger[_0x6ee6('0x11')](_0x6ee6('0x12'),_0x15f04c,_0x1d964e);_0x25b6a2(_0x1d964e);});});}exports[_0x6ee6('0x16')]=function(_0x254f50){var _0x405b2c=this;return new Promise(function(_0x80893,_0x517c62){return db[_0x6ee6('0x17')][_0x6ee6('0x18')](_0x254f50[_0x6ee6('0x19')],{'raw':_0x254f50[_0x6ee6('0x1a')]?_0x254f50[_0x6ee6('0x1a')][_0x6ee6('0x1b')]===undefined?!![]:![]:!![]})[_0x6ee6('0x1c')](function(_0x4ae237){logger[_0x6ee6('0xd')](_0x6ee6('0x16'),_0x254f50);logger[_0x6ee6('0x1d')](_0x6ee6('0x16'),_0x254f50,JSON[_0x6ee6('0x10')](_0x4ae237));_0x80893(_0x4ae237);})[_0x6ee6('0x15')](function(_0x3a619b){logger[_0x6ee6('0x11')](_0x6ee6('0x16'),_0x3a619b[_0x6ee6('0x13')],_0x254f50);_0x517c62(_0x405b2c[_0x6ee6('0x11')](0x1f4,_0x3a619b['message']));});});}; \ No newline at end of file +var _0xf50d=['error','code','message','create','body','options','raw','then','CreateSquareRecording','stringify','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x53077e,_0x1b64ad){var _0x37cbd8=function(_0x3ad9c9){while(--_0x3ad9c9){_0x53077e['push'](_0x53077e['shift']());}};_0x37cbd8(++_0x1b64ad);}(_0xf50d,0xfe));var _0xdf50=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf50d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf50('0x0'));var util=require('util');var moment=require(_0xdf50('0x1'));var BPromise=require(_0xdf50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf50('0x3'))['db'];var utils=require(_0xdf50('0x4'));var logger=require(_0xdf50('0x5'))(_0xdf50('0x6'));var config=require(_0xdf50('0x7'));var jayson=require(_0xdf50('0x8'));var client=jayson[_0xdf50('0x9')][_0xdf50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23d8fd,_0x1c221e,_0x2f0683){return new BPromise(function(_0xa3f44a,_0x27d831){return client[_0xdf50('0xb')](_0x23d8fd,_0x2f0683)['then'](function(_0x1ed2d1){logger[_0xdf50('0xc')](_0xdf50('0xd'),_0x1c221e,_0xdf50('0xe'));logger[_0xdf50('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1c221e,'request\x20sent',JSON['stringify'](_0x1ed2d1));if(_0x1ed2d1[_0xdf50('0x10')]){if(_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x11')]===0x1f4){logger[_0xdf50('0x10')]('SquareRecording,\x20%s,\x20%s',_0x1c221e,_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x12')]);return _0x27d831(_0x1ed2d1['error'][_0xdf50('0x12')]);}logger[_0xdf50('0x10')](_0xdf50('0xd'),_0x1c221e,_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x12')]);return _0xa3f44a(_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x12')]);}else{logger[_0xdf50('0xc')](_0xdf50('0xd'),_0x1c221e,_0xdf50('0xe'));_0xa3f44a(_0x1ed2d1['result'][_0xdf50('0x12')]);}})['catch'](function(_0x1cab72){logger['error'](_0xdf50('0xd'),_0x1c221e,_0x1cab72);_0x27d831(_0x1cab72);});});}exports['CreateSquareRecording']=function(_0x3bee93){var _0xc90c2e=this;return new Promise(function(_0x1c734d,_0x1ddd97){return db['SquareRecording'][_0xdf50('0x13')](_0x3bee93[_0xdf50('0x14')],{'raw':_0x3bee93[_0xdf50('0x15')]?_0x3bee93[_0xdf50('0x15')][_0xdf50('0x16')]===undefined?!![]:![]:!![]})[_0xdf50('0x17')](function(_0x51e938){logger[_0xdf50('0xc')](_0xdf50('0x18'),_0x3bee93);logger[_0xdf50('0xf')](_0xdf50('0x18'),_0x3bee93,JSON[_0xdf50('0x19')](_0x51e938));_0x1c734d(_0x51e938);})[_0xdf50('0x1a')](function(_0xedf711){logger[_0xdf50('0x10')]('CreateSquareRecording',_0xedf711['message'],_0x3bee93);_0x1ddd97(_0xc90c2e[_0xdf50('0x10')](0x1f4,_0xedf711[_0xdf50('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b2b1b51..80a3aa9 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x17c821,_0x138aa1){var _0xc62aa=function(_0x3500a7){while(--_0x3500a7){_0x17c821['push'](_0x17c821['shift']());}};_0xc62aa(++_0x138aa1);}(_0xe706,0xa3));var _0x6e70=function(_0x2ba665,_0x30361e){_0x2ba665=_0x2ba665-0x0;var _0xc5e4f5=_0xe706[_0x2ba665];return _0xc5e4f5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 327d42c..1b6b167 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 _0x75b3=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x75b3,0xa6));var _0x375b=function(_0x2ab1b7,_0x303c58){_0x2ab1b7=_0x2ab1b7-0x0;var _0x1c9ae5=_0x75b3[_0x2ab1b7];return _0x1c9ae5;};'use strict';var Sequelize=require(_0x375b('0x0'));module[_0x375b('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x375b('0x2')]},'channel':{'type':Sequelize[_0x375b('0x2')]},'language':{'type':Sequelize[_0x375b('0x2')]},'type':{'type':Sequelize[_0x375b('0x2')]},'uniqueid':{'type':Sequelize[_0x375b('0x2')]},'version':{'type':Sequelize[_0x375b('0x2')]},'callerid':{'type':Sequelize[_0x375b('0x2')]},'calleridname':{'type':Sequelize[_0x375b('0x2')]},'callingpres':{'type':Sequelize[_0x375b('0x2')]},'callingani2':{'type':Sequelize[_0x375b('0x2')]},'callington':{'type':Sequelize[_0x375b('0x2')]},'callingtns':{'type':Sequelize[_0x375b('0x2')]},'dnid':{'type':Sequelize[_0x375b('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x375b('0x2')]},'extension':{'type':Sequelize[_0x375b('0x2')]},'priority':{'type':Sequelize[_0x375b('0x2')]},'enhanced':{'type':Sequelize[_0x375b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x375b('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x375b('0x3')]},'leaveAt':{'type':Sequelize[_0x375b('0x3')]},'bot':{'type':Sequelize[_0x375b('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7956=['sequelize','exports','STRING','DATE'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x7956,0x1cc));var _0x6795=function(_0x280821,_0x37b7cb){_0x280821=_0x280821-0x0;var _0x5be319=_0x7956[_0x280821];return _0x5be319;};'use strict';var Sequelize=require(_0x6795('0x0'));module[_0x6795('0x1')]={'network':{'type':Sequelize[_0x6795('0x2')]},'network_script':{'type':Sequelize[_0x6795('0x2')]},'request':{'type':Sequelize[_0x6795('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6795('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6795('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6795('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x6795('0x2')]},'callington':{'type':Sequelize[_0x6795('0x2')]},'callingtns':{'type':Sequelize[_0x6795('0x2')]},'dnid':{'type':Sequelize[_0x6795('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x6795('0x2')]},'priority':{'type':Sequelize[_0x6795('0x2')]},'enhanced':{'type':Sequelize[_0x6795('0x2')]},'accountcode':{'type':Sequelize[_0x6795('0x2')]},'threadid':{'type':Sequelize[_0x6795('0x2')]},'project_name':{'type':Sequelize[_0x6795('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6795('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 8bea7c1..a850c82 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 _0xb684=['catch','params','rawAttributes','length','includeAll','find','create','update','body','destroy','describe','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','Content-Range','then','sendStatus','error','stack','name','send','map','SquareReport','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0xb684,0x1a3));var _0x4b68=function(_0x5a19db,_0x81342){_0x5a19db=_0x5a19db-0x0;var _0x5fd1c0=_0xb684[_0x5a19db];return _0x5fd1c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b68('0x0'));var zipdir=require(_0x4b68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4b68('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4b68('0x3'));var util=require(_0x4b68('0x4'));var path=require('path');var sox=require(_0x4b68('0x5'));var csv=require('to-csv');var ejs=require(_0x4b68('0x6'));var fs=require('fs');var fs_extra=require(_0x4b68('0x7'));var _=require('lodash');var squel=require(_0x4b68('0x8'));var crypto=require('crypto');var jsforce=require(_0x4b68('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4b68('0xa'));var querystring=require(_0x4b68('0xb'));var Papa=require('papaparse');var Redis=require(_0x4b68('0xc'));var authService=require(_0x4b68('0xd'));var qs=require(_0x4b68('0xe'));var as=require(_0x4b68('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b68('0x10'))('api');var utils=require(_0x4b68('0x11'));var config=require(_0x4b68('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273e38,_0xb6a3f7){_0xb6a3f7=_0xb6a3f7||0xcc;return function(_0x202416){if(_0x202416){return _0x273e38['sendStatus'](_0xb6a3f7);}return _0x273e38[_0x4b68('0x13')](_0xb6a3f7)[_0x4b68('0x14')]();};}function respondWithResult(_0x4f7983,_0x5f550b){_0x5f550b=_0x5f550b||0xc8;return function(_0x4b9033){if(_0x4b9033){return _0x4f7983['status'](_0x5f550b)[_0x4b68('0x15')](_0x4b9033);}};}function respondWithFilteredResult(_0x219fba,_0x3a7337){return function(_0x851aca){if(_0x851aca){var _0x4ee1fb=typeof _0x3a7337[_0x4b68('0x16')]===_0x4b68('0x17')&&typeof _0x3a7337['limit']==='undefined';var _0x24073c=_0x851aca[_0x4b68('0x18')];var _0x7b4db1=_0x4ee1fb?0x0:_0x3a7337[_0x4b68('0x16')];var _0x42a850=_0x4ee1fb?_0x851aca[_0x4b68('0x18')]:_0x3a7337[_0x4b68('0x16')]+_0x3a7337[_0x4b68('0x19')];var _0xabd04f;if(_0x42a850>=_0x24073c){_0x42a850=_0x24073c;_0xabd04f=0xc8;}else{_0xabd04f=0xce;}_0x219fba[_0x4b68('0x13')](_0xabd04f);return _0x219fba[_0x4b68('0x1a')](_0x4b68('0x1b'),_0x7b4db1+'-'+_0x42a850+'/'+_0x24073c)[_0x4b68('0x15')](_0x851aca);}return null;};}function patchUpdates(_0xa93c76){return function(_0x34ff1a){try{jsonpatch['apply'](_0x34ff1a,_0xa93c76,!![]);}catch(_0x4d1776){return BPromise['reject'](_0x4d1776);}return _0x34ff1a['save']();};}function saveUpdates(_0x3ed103,_0x318f59){return function(_0x34d31f){if(_0x34d31f){return _0x34d31f['update'](_0x3ed103)[_0x4b68('0x1c')](function(_0x5d2347){return _0x5d2347;});}return null;};}function removeEntity(_0x15e60a,_0x3671a4){return function(_0x4b8dff){if(_0x4b8dff){return _0x4b8dff['destroy']()[_0x4b68('0x1c')](function(){_0x15e60a[_0x4b68('0x13')](0xcc)[_0x4b68('0x14')]();});}};}function handleEntityNotFound(_0x3ac9ad,_0x47f457){return function(_0x25a45d){if(!_0x25a45d){_0x3ac9ad[_0x4b68('0x1d')](0x194);}return _0x25a45d;};}function handleError(_0x50c57f,_0x9feac5){_0x9feac5=_0x9feac5||0x1f4;return function(_0x400170){logger[_0x4b68('0x1e')](_0x400170[_0x4b68('0x1f')]);if(_0x400170[_0x4b68('0x20')]){delete _0x400170[_0x4b68('0x20')];}_0x50c57f[_0x4b68('0x13')](_0x9feac5)[_0x4b68('0x21')](_0x400170);};}exports['index']=function(_0x742827,_0x4788b7){var _0x951556={},_0x548f28={},_0xbd5c36={'count':0x0,'rows':[]};var _0x5bb10d=_[_0x4b68('0x22')](db[_0x4b68('0x23')]['rawAttributes'],function(_0x2e15c7){return{'name':_0x2e15c7['fieldName'],'type':_0x2e15c7[_0x4b68('0x24')][_0x4b68('0x25')]};});_0x548f28[_0x4b68('0x26')]=_[_0x4b68('0x22')](_0x5bb10d,_0x4b68('0x20'));_0x548f28[_0x4b68('0x27')]=_[_0x4b68('0x28')](_0x742827[_0x4b68('0x27')]);_0x548f28[_0x4b68('0x29')]=_['intersection'](_0x548f28['model'],_0x548f28['query']);_0x951556['attributes']=_[_0x4b68('0x2a')](_0x548f28[_0x4b68('0x26')],qs[_0x4b68('0x2b')](_0x742827[_0x4b68('0x27')][_0x4b68('0x2b')]));_0x951556[_0x4b68('0x2c')]=_0x951556[_0x4b68('0x2c')]['length']?_0x951556['attributes']:_0x548f28[_0x4b68('0x26')];if(!_0x742827['query'][_0x4b68('0x2d')](_0x4b68('0x2e'))){_0x951556['limit']=qs[_0x4b68('0x19')](_0x742827[_0x4b68('0x27')][_0x4b68('0x19')]);_0x951556['offset']=qs[_0x4b68('0x16')](_0x742827[_0x4b68('0x27')]['offset']);}_0x951556['order']=qs[_0x4b68('0x2f')](_0x742827[_0x4b68('0x27')]['sort']);_0x951556['where']=qs[_0x4b68('0x29')](_[_0x4b68('0x30')](_0x742827['query'],_0x548f28[_0x4b68('0x29')]),_0x5bb10d);if(_0x742827[_0x4b68('0x27')][_0x4b68('0x31')]){_0x951556[_0x4b68('0x32')]=_['merge'](_0x951556[_0x4b68('0x32')],{'$or':_['map'](_0x5bb10d,function(_0x2abe6b){if(_0x2abe6b['type']!==_0x4b68('0x33')){var _0x2fd10b={};_0x2fd10b[_0x2abe6b[_0x4b68('0x20')]]={'$like':'%'+_0x742827[_0x4b68('0x27')][_0x4b68('0x31')]+'%'};return _0x2fd10b;}})});}_0x951556=_[_0x4b68('0x34')]({},_0x951556,_0x742827[_0x4b68('0x35')]);var _0x1edea7={'where':_0x951556[_0x4b68('0x32')]};return db[_0x4b68('0x23')][_0x4b68('0x18')](_0x1edea7)['then'](function(_0xdf8538){_0xbd5c36[_0x4b68('0x18')]=_0xdf8538;if(_0x742827['query']['includeAll']){_0x951556[_0x4b68('0x36')]=[{'all':!![]}];}return db[_0x4b68('0x23')][_0x4b68('0x37')](_0x951556);})[_0x4b68('0x1c')](function(_0x5060d7){_0xbd5c36[_0x4b68('0x38')]=_0x5060d7;return _0xbd5c36;})[_0x4b68('0x1c')](respondWithFilteredResult(_0x4788b7,_0x951556))[_0x4b68('0x39')](handleError(_0x4788b7,null));};exports['show']=function(_0x3a8f3e,_0x14e8a6){var _0x7569={'raw':!![],'where':{'id':_0x3a8f3e[_0x4b68('0x3a')]['id']}},_0x567b1f={};_0x567b1f[_0x4b68('0x26')]=_[_0x4b68('0x28')](db[_0x4b68('0x23')][_0x4b68('0x3b')]);_0x567b1f[_0x4b68('0x27')]=_['keys'](_0x3a8f3e[_0x4b68('0x27')]);_0x567b1f[_0x4b68('0x29')]=_[_0x4b68('0x2a')](_0x567b1f['model'],_0x567b1f[_0x4b68('0x27')]);_0x7569['attributes']=_[_0x4b68('0x2a')](_0x567b1f['model'],qs[_0x4b68('0x2b')](_0x3a8f3e[_0x4b68('0x27')][_0x4b68('0x2b')]));_0x7569[_0x4b68('0x2c')]=_0x7569[_0x4b68('0x2c')][_0x4b68('0x3c')]?_0x7569[_0x4b68('0x2c')]:_0x567b1f[_0x4b68('0x26')];if(_0x3a8f3e[_0x4b68('0x27')][_0x4b68('0x3d')]){_0x7569['include']=[{'all':!![]}];}_0x7569=_[_0x4b68('0x34')]({},_0x7569,_0x3a8f3e[_0x4b68('0x35')]);return db['SquareReport'][_0x4b68('0x3e')](_0x7569)[_0x4b68('0x1c')](handleEntityNotFound(_0x14e8a6,null))[_0x4b68('0x1c')](respondWithResult(_0x14e8a6,null))[_0x4b68('0x39')](handleError(_0x14e8a6,null));};exports['create']=function(_0x4943e1,_0x29b648){return db['SquareReport'][_0x4b68('0x3f')](_0x4943e1['body'],{})[_0x4b68('0x1c')](respondWithResult(_0x29b648,0xc9))[_0x4b68('0x39')](handleError(_0x29b648,null));};exports[_0x4b68('0x40')]=function(_0x3782dc,_0x31c387){if(_0x3782dc[_0x4b68('0x41')]['id']){delete _0x3782dc[_0x4b68('0x41')]['id'];}return db[_0x4b68('0x23')][_0x4b68('0x3e')]({'where':{'id':_0x3782dc[_0x4b68('0x3a')]['id']}})[_0x4b68('0x1c')](handleEntityNotFound(_0x31c387,null))[_0x4b68('0x1c')](saveUpdates(_0x3782dc['body'],null))[_0x4b68('0x1c')](respondWithResult(_0x31c387,null))[_0x4b68('0x39')](handleError(_0x31c387,null));};exports[_0x4b68('0x42')]=function(_0x439d8f,_0x29797f){return db[_0x4b68('0x23')][_0x4b68('0x3e')]({'where':{'id':_0x439d8f['params']['id']}})[_0x4b68('0x1c')](handleEntityNotFound(_0x29797f,null))[_0x4b68('0x1c')](removeEntity(_0x29797f,null))[_0x4b68('0x39')](handleError(_0x29797f,null));};exports['describe']=function(_0x62658,_0x55615e){return db[_0x4b68('0x23')][_0x4b68('0x43')]()[_0x4b68('0x1c')](respondWithResult(_0x55615e,null))['catch'](handleError(_0x55615e,null));}; \ No newline at end of file +var _0xe398=['set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','params','intersection','length','includeAll','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status'];(function(_0x4af6a0,_0x522121){var _0x4c2b23=function(_0x2f5955){while(--_0x2f5955){_0x4af6a0['push'](_0x4af6a0['shift']());}};_0x4c2b23(++_0x522121);}(_0xe398,0x7e));var _0x8e39=function(_0x2acd51,_0x115bf9){_0x2acd51=_0x2acd51-0x0;var _0x7a3983=_0xe398[_0x2acd51];return _0x7a3983;};'use strict';var emlformat=require(_0x8e39('0x0'));var rimraf=require(_0x8e39('0x1'));var zipdir=require(_0x8e39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e39('0x3'));var moment=require(_0x8e39('0x4'));var BPromise=require(_0x8e39('0x5'));var Mustache=require(_0x8e39('0x6'));var util=require(_0x8e39('0x7'));var path=require(_0x8e39('0x8'));var sox=require(_0x8e39('0x9'));var csv=require('to-csv');var ejs=require(_0x8e39('0xa'));var fs=require('fs');var fs_extra=require(_0x8e39('0xb'));var _=require(_0x8e39('0xc'));var squel=require(_0x8e39('0xd'));var crypto=require(_0x8e39('0xe'));var jsforce=require(_0x8e39('0xf'));var deskjs=require(_0x8e39('0x10'));var toCsv=require(_0x8e39('0x11'));var querystring=require(_0x8e39('0x12'));var Papa=require(_0x8e39('0x13'));var Redis=require(_0x8e39('0x14'));var authService=require(_0x8e39('0x15'));var qs=require(_0x8e39('0x16'));var as=require(_0x8e39('0x17'));var hardwareService=require(_0x8e39('0x18'));var logger=require(_0x8e39('0x19'))(_0x8e39('0x1a'));var utils=require(_0x8e39('0x1b'));var config=require(_0x8e39('0x1c'));var licenseUtil=require(_0x8e39('0x1d'));var db=require(_0x8e39('0x1e'))['db'];function respondWithStatusCode(_0x33c4f3,_0x2b19df){_0x2b19df=_0x2b19df||0xcc;return function(_0x39e107){if(_0x39e107){return _0x33c4f3[_0x8e39('0x1f')](_0x2b19df);}return _0x33c4f3['status'](_0x2b19df)['end']();};}function respondWithResult(_0x5cf5bc,_0x5796b5){_0x5796b5=_0x5796b5||0xc8;return function(_0x5a7a02){if(_0x5a7a02){return _0x5cf5bc['status'](_0x5796b5)[_0x8e39('0x20')](_0x5a7a02);}};}function respondWithFilteredResult(_0x56d92e,_0x147711){return function(_0x48bc7a){if(_0x48bc7a){var _0x61d295=typeof _0x147711[_0x8e39('0x21')]===_0x8e39('0x22')&&typeof _0x147711[_0x8e39('0x23')]==='undefined';var _0x101afc=_0x48bc7a[_0x8e39('0x24')];var _0x1d43b8=_0x61d295?0x0:_0x147711['offset'];var _0x14c9a6=_0x61d295?_0x48bc7a[_0x8e39('0x24')]:_0x147711['offset']+_0x147711[_0x8e39('0x23')];var _0xb2488b;if(_0x14c9a6>=_0x101afc){_0x14c9a6=_0x101afc;_0xb2488b=0xc8;}else{_0xb2488b=0xce;}_0x56d92e[_0x8e39('0x25')](_0xb2488b);return _0x56d92e[_0x8e39('0x26')](_0x8e39('0x27'),_0x1d43b8+'-'+_0x14c9a6+'/'+_0x101afc)['json'](_0x48bc7a);}return null;};}function patchUpdates(_0x4ff19f){return function(_0x1497fc){try{jsonpatch[_0x8e39('0x28')](_0x1497fc,_0x4ff19f,!![]);}catch(_0x4cca41){return BPromise[_0x8e39('0x29')](_0x4cca41);}return _0x1497fc[_0x8e39('0x2a')]();};}function saveUpdates(_0x19045a,_0x5a60c5){return function(_0x4f9a51){if(_0x4f9a51){return _0x4f9a51['update'](_0x19045a)[_0x8e39('0x2b')](function(_0x399b69){return _0x399b69;});}return null;};}function removeEntity(_0x25cf45,_0x2b078d){return function(_0x135603){if(_0x135603){return _0x135603[_0x8e39('0x2c')]()[_0x8e39('0x2b')](function(){_0x25cf45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c2123,_0x530465){return function(_0x3ddb19){if(!_0x3ddb19){_0x3c2123[_0x8e39('0x1f')](0x194);}return _0x3ddb19;};}function handleError(_0x67b8d9,_0x2d1ff1){_0x2d1ff1=_0x2d1ff1||0x1f4;return function(_0x19971a){logger[_0x8e39('0x2d')](_0x19971a[_0x8e39('0x2e')]);if(_0x19971a[_0x8e39('0x2f')]){delete _0x19971a['name'];}_0x67b8d9[_0x8e39('0x25')](_0x2d1ff1)[_0x8e39('0x30')](_0x19971a);};}exports[_0x8e39('0x31')]=function(_0x9ab884,_0x52edb4){var _0xeb6f22={},_0x3c3d37={},_0x307c02={'count':0x0,'rows':[]};var _0x25b2e4=_[_0x8e39('0x32')](db[_0x8e39('0x33')]['rawAttributes'],function(_0x5cf701){return{'name':_0x5cf701[_0x8e39('0x34')],'type':_0x5cf701[_0x8e39('0x35')][_0x8e39('0x36')]};});_0x3c3d37[_0x8e39('0x37')]=_[_0x8e39('0x32')](_0x25b2e4,_0x8e39('0x2f'));_0x3c3d37[_0x8e39('0x38')]=_[_0x8e39('0x39')](_0x9ab884['query']);_0x3c3d37[_0x8e39('0x3a')]=_['intersection'](_0x3c3d37[_0x8e39('0x37')],_0x3c3d37[_0x8e39('0x38')]);_0xeb6f22[_0x8e39('0x3b')]=_['intersection'](_0x3c3d37[_0x8e39('0x37')],qs[_0x8e39('0x3c')](_0x9ab884[_0x8e39('0x38')]['fields']));_0xeb6f22[_0x8e39('0x3b')]=_0xeb6f22[_0x8e39('0x3b')]['length']?_0xeb6f22[_0x8e39('0x3b')]:_0x3c3d37[_0x8e39('0x37')];if(!_0x9ab884[_0x8e39('0x38')][_0x8e39('0x3d')](_0x8e39('0x3e'))){_0xeb6f22['limit']=qs[_0x8e39('0x23')](_0x9ab884[_0x8e39('0x38')]['limit']);_0xeb6f22[_0x8e39('0x21')]=qs[_0x8e39('0x21')](_0x9ab884['query'][_0x8e39('0x21')]);}_0xeb6f22[_0x8e39('0x3f')]=qs[_0x8e39('0x40')](_0x9ab884[_0x8e39('0x38')][_0x8e39('0x40')]);_0xeb6f22[_0x8e39('0x41')]=qs[_0x8e39('0x3a')](_['pick'](_0x9ab884['query'],_0x3c3d37[_0x8e39('0x3a')]),_0x25b2e4);if(_0x9ab884[_0x8e39('0x38')][_0x8e39('0x42')]){_0xeb6f22['where']=_[_0x8e39('0x43')](_0xeb6f22[_0x8e39('0x41')],{'$or':_[_0x8e39('0x32')](_0x25b2e4,function(_0x5eea4a){if(_0x5eea4a[_0x8e39('0x35')]!=='VIRTUAL'){var _0x31c177={};_0x31c177[_0x5eea4a[_0x8e39('0x2f')]]={'$like':'%'+_0x9ab884['query'][_0x8e39('0x42')]+'%'};return _0x31c177;}})});}_0xeb6f22=_[_0x8e39('0x43')]({},_0xeb6f22,_0x9ab884[_0x8e39('0x44')]);var _0x35df0b={'where':_0xeb6f22[_0x8e39('0x41')]};return db['SquareReport'][_0x8e39('0x24')](_0x35df0b)[_0x8e39('0x2b')](function(_0x4e86e9){_0x307c02['count']=_0x4e86e9;if(_0x9ab884[_0x8e39('0x38')]['includeAll']){_0xeb6f22['include']=[{'all':!![]}];}return db[_0x8e39('0x33')][_0x8e39('0x45')](_0xeb6f22);})[_0x8e39('0x2b')](function(_0x313772){_0x307c02[_0x8e39('0x46')]=_0x313772;return _0x307c02;})[_0x8e39('0x2b')](respondWithFilteredResult(_0x52edb4,_0xeb6f22))[_0x8e39('0x47')](handleError(_0x52edb4,null));};exports['show']=function(_0x1094e3,_0x19031f){var _0x437dce={'raw':!![],'where':{'id':_0x1094e3[_0x8e39('0x48')]['id']}},_0xff691={};_0xff691[_0x8e39('0x37')]=_[_0x8e39('0x39')](db[_0x8e39('0x33')]['rawAttributes']);_0xff691[_0x8e39('0x38')]=_[_0x8e39('0x39')](_0x1094e3[_0x8e39('0x38')]);_0xff691[_0x8e39('0x3a')]=_[_0x8e39('0x49')](_0xff691[_0x8e39('0x37')],_0xff691[_0x8e39('0x38')]);_0x437dce[_0x8e39('0x3b')]=_[_0x8e39('0x49')](_0xff691[_0x8e39('0x37')],qs[_0x8e39('0x3c')](_0x1094e3[_0x8e39('0x38')][_0x8e39('0x3c')]));_0x437dce['attributes']=_0x437dce[_0x8e39('0x3b')][_0x8e39('0x4a')]?_0x437dce['attributes']:_0xff691['model'];if(_0x1094e3[_0x8e39('0x38')][_0x8e39('0x4b')]){_0x437dce[_0x8e39('0x4c')]=[{'all':!![]}];}_0x437dce=_[_0x8e39('0x43')]({},_0x437dce,_0x1094e3[_0x8e39('0x44')]);return db[_0x8e39('0x33')][_0x8e39('0x4d')](_0x437dce)[_0x8e39('0x2b')](handleEntityNotFound(_0x19031f,null))['then'](respondWithResult(_0x19031f,null))[_0x8e39('0x47')](handleError(_0x19031f,null));};exports[_0x8e39('0x4e')]=function(_0x4eeecd,_0x4aa1f0){return db[_0x8e39('0x33')][_0x8e39('0x4e')](_0x4eeecd[_0x8e39('0x4f')],{})['then'](respondWithResult(_0x4aa1f0,0xc9))['catch'](handleError(_0x4aa1f0,null));};exports[_0x8e39('0x50')]=function(_0x2b58b5,_0xeaf5c3){if(_0x2b58b5['body']['id']){delete _0x2b58b5[_0x8e39('0x4f')]['id'];}return db[_0x8e39('0x33')][_0x8e39('0x4d')]({'where':{'id':_0x2b58b5[_0x8e39('0x48')]['id']}})[_0x8e39('0x2b')](handleEntityNotFound(_0xeaf5c3,null))['then'](saveUpdates(_0x2b58b5['body'],null))[_0x8e39('0x2b')](respondWithResult(_0xeaf5c3,null))[_0x8e39('0x47')](handleError(_0xeaf5c3,null));};exports[_0x8e39('0x2c')]=function(_0x5b5f71,_0x278814){return db[_0x8e39('0x33')][_0x8e39('0x4d')]({'where':{'id':_0x5b5f71[_0x8e39('0x48')]['id']}})[_0x8e39('0x2b')](handleEntityNotFound(_0x278814,null))[_0x8e39('0x2b')](removeEntity(_0x278814,null))[_0x8e39('0x47')](handleError(_0x278814,null));};exports[_0x8e39('0x51')]=function(_0x3a37c0,_0x3efdd4){return db[_0x8e39('0x33')][_0x8e39('0x51')]()[_0x8e39('0x2b')](respondWithResult(_0x3efdd4,null))[_0x8e39('0x47')](handleError(_0x3efdd4,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 52b646f..108f86a 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 _0xa3b0=['leaveAt','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x1bb560,_0xeae53f){var _0x41416f=function(_0x4e3965){while(--_0x4e3965){_0x1bb560['push'](_0x1bb560['shift']());}};_0x41416f(++_0xeae53f);}(_0xa3b0,0x1b3));var _0x0a3b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0a3b('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0a3b('0x1'));var rp=require(_0x0a3b('0x2'));var fs=require('fs');var path=require(_0x0a3b('0x3'));var rimraf=require(_0x0a3b('0x4'));var config=require(_0x0a3b('0x5'));var attributes=require(_0x0a3b('0x6'));module[_0x0a3b('0x7')]=function(_0x2f7491,_0x373186){return _0x2f7491['define'](_0x0a3b('0x8'),attributes,{'tableName':_0x0a3b('0x9'),'paranoid':![],'indexes':[{'name':_0x0a3b('0xa'),'fields':[_0x0a3b('0xb'),_0x0a3b('0xc')]},{'name':'leaveAt','fields':[_0x0a3b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9f=['report_square','uid_pname','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x0a9f,0x103));var _0xf0a9=function(_0x179a0c,_0x2ca073){_0x179a0c=_0x179a0c-0x0;var _0x1c8b9a=_0x0a9f[_0x179a0c];return _0x1c8b9a;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var logger=require(_0xf0a9('0x2'))(_0xf0a9('0x3'));var moment=require(_0xf0a9('0x4'));var BPromise=require(_0xf0a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0a9('0x6'));var rimraf=require(_0xf0a9('0x7'));var config=require(_0xf0a9('0x8'));var attributes=require(_0xf0a9('0x9'));module[_0xf0a9('0xa')]=function(_0x5978da,_0x509cab){return _0x5978da[_0xf0a9('0xb')](_0xf0a9('0xc'),attributes,{'tableName':_0xf0a9('0xd'),'paranoid':![],'indexes':[{'name':_0xf0a9('0xe'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0xf0a9('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 052735c..6153849 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 _0x669c=['debug','stringify','error','code','message','info','catch','SquareReport','create','body','options','raw','CreateSquareReport','update','attributes','UpdateSquareReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x669c,0x16c));var _0xc669=function(_0x3693fb,_0x1c69bd){_0x3693fb=_0x3693fb-0x0;var _0x39db55=_0x669c[_0x3693fb];return _0x39db55;};'use strict';var _=require('lodash');var util=require(_0xc669('0x0'));var moment=require(_0xc669('0x1'));var BPromise=require(_0xc669('0x2'));var rs=require(_0xc669('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc669('0x4'))['db'];var utils=require(_0xc669('0x5'));var logger=require('../../config/logger')(_0xc669('0x6'));var config=require('../../config/environment');var jayson=require(_0xc669('0x7'));var client=jayson[_0xc669('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x100d3e,_0x6fdf0a,_0x699cd){return new BPromise(function(_0xee93c0,_0x57aa14){return client[_0xc669('0x9')](_0x100d3e,_0x699cd)[_0xc669('0xa')](function(_0x309568){logger['info'](_0xc669('0xb'),_0x6fdf0a,_0xc669('0xc'));logger[_0xc669('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x6fdf0a,_0xc669('0xc'),JSON[_0xc669('0xe')](_0x309568));if(_0x309568[_0xc669('0xf')]){if(_0x309568['error'][_0xc669('0x10')]===0x1f4){logger['error'](_0xc669('0xb'),_0x6fdf0a,_0x309568[_0xc669('0xf')][_0xc669('0x11')]);return _0x57aa14(_0x309568[_0xc669('0xf')]['message']);}logger['error'](_0xc669('0xb'),_0x6fdf0a,_0x309568['error']['message']);return _0xee93c0(_0x309568[_0xc669('0xf')][_0xc669('0x11')]);}else{logger[_0xc669('0x12')](_0xc669('0xb'),_0x6fdf0a,_0xc669('0xc'));_0xee93c0(_0x309568['result'][_0xc669('0x11')]);}})[_0xc669('0x13')](function(_0x48dc3d){logger[_0xc669('0xf')](_0xc669('0xb'),_0x6fdf0a,_0x48dc3d);_0x57aa14(_0x48dc3d);});});}exports['CreateSquareReport']=function(_0x5522e9){var _0x43f636=this;return new Promise(function(_0x1b4148,_0x49fdcc){return db[_0xc669('0x14')][_0xc669('0x15')](_0x5522e9[_0xc669('0x16')],{'raw':_0x5522e9[_0xc669('0x17')]?_0x5522e9[_0xc669('0x17')][_0xc669('0x18')]===undefined?!![]:![]:!![]})[_0xc669('0xa')](function(_0x3d79bf){logger[_0xc669('0x12')]('CreateSquareReport',_0x5522e9);logger[_0xc669('0xd')]('CreateSquareReport',_0x5522e9,JSON[_0xc669('0xe')](_0x3d79bf));_0x1b4148(_0x3d79bf);})[_0xc669('0x13')](function(_0x5f10f6){logger[_0xc669('0xf')](_0xc669('0x19'),_0x5f10f6[_0xc669('0x11')],_0x5522e9);_0x49fdcc(_0x43f636[_0xc669('0xf')](0x1f4,_0x5f10f6[_0xc669('0x11')]));});});};exports['UpdateSquareReport']=function(_0x13a9c2){var _0x3e329b=this;return new Promise(function(_0x513653,_0x4b9ac9){return db['SquareReport'][_0xc669('0x1a')](_0x13a9c2[_0xc669('0x16')],{'raw':_0x13a9c2['options']?_0x13a9c2[_0xc669('0x17')][_0xc669('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13a9c2[_0xc669('0x17')]?_0x13a9c2['options']['where']||null:null,'attributes':_0x13a9c2[_0xc669('0x17')]?_0x13a9c2[_0xc669('0x17')][_0xc669('0x1b')]||null:null,'limit':_0x13a9c2[_0xc669('0x17')]?_0x13a9c2[_0xc669('0x17')]['limit']||null:null})['then'](function(_0x4bf402){logger[_0xc669('0x12')](_0xc669('0x1c'),_0x13a9c2);logger[_0xc669('0xd')](_0xc669('0x1c'),_0x13a9c2,JSON['stringify'](_0x4bf402));_0x513653(_0x4bf402);})[_0xc669('0x13')](function(_0x18882c){logger[_0xc669('0xf')]('UpdateSquareReport',_0x18882c[_0xc669('0x11')],_0x13a9c2);_0x4b9ac9(_0x3e329b['error'](0x1f4,_0x18882c['message']));});});}; \ No newline at end of file +var _0x964c=['jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','options','debug','UpdateSquareReport','body','raw','attributes','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x9c7c77,_0x49751f){var _0x2fee9b=function(_0x54858d){while(--_0x54858d){_0x9c7c77['push'](_0x9c7c77['shift']());}};_0x2fee9b(++_0x49751f);}(_0x964c,0x108));var _0xc964=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x964c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc964('0x0'));var util=require(_0xc964('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc964('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc964('0x3'))['db'];var utils=require(_0xc964('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc964('0x5'));var jayson=require(_0xc964('0x6'));var client=jayson[_0xc964('0x7')][_0xc964('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x481ba7,_0x4485eb,_0x11f57d){return new BPromise(function(_0x100c22,_0x5aed50){return client[_0xc964('0x9')](_0x481ba7,_0x11f57d)[_0xc964('0xa')](function(_0x38e81b){logger['info'](_0xc964('0xb'),_0x4485eb,_0xc964('0xc'));logger['debug'](_0xc964('0xd'),_0x4485eb,'request\x20sent',JSON[_0xc964('0xe')](_0x38e81b));if(_0x38e81b[_0xc964('0xf')]){if(_0x38e81b[_0xc964('0xf')][_0xc964('0x10')]===0x1f4){logger[_0xc964('0xf')]('SquareReport,\x20%s,\x20%s',_0x4485eb,_0x38e81b[_0xc964('0xf')]['message']);return _0x5aed50(_0x38e81b['error']['message']);}logger[_0xc964('0xf')]('SquareReport,\x20%s,\x20%s',_0x4485eb,_0x38e81b[_0xc964('0xf')][_0xc964('0x11')]);return _0x100c22(_0x38e81b['error']['message']);}else{logger[_0xc964('0x12')](_0xc964('0xb'),_0x4485eb,_0xc964('0xc'));_0x100c22(_0x38e81b[_0xc964('0x13')][_0xc964('0x11')]);}})[_0xc964('0x14')](function(_0x237cae){logger[_0xc964('0xf')](_0xc964('0xb'),_0x4485eb,_0x237cae);_0x5aed50(_0x237cae);});});}exports[_0xc964('0x15')]=function(_0x5da13d){var _0x4ff157=this;return new Promise(function(_0x58fe5c,_0x21cbea){return db[_0xc964('0x16')][_0xc964('0x17')](_0x5da13d['body'],{'raw':_0x5da13d['options']?_0x5da13d[_0xc964('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc964('0xa')](function(_0x5da215){logger[_0xc964('0x12')](_0xc964('0x15'),_0x5da13d);logger[_0xc964('0x19')](_0xc964('0x15'),_0x5da13d,JSON[_0xc964('0xe')](_0x5da215));_0x58fe5c(_0x5da215);})['catch'](function(_0x2b6ac2){logger['error'](_0xc964('0x15'),_0x2b6ac2[_0xc964('0x11')],_0x5da13d);_0x21cbea(_0x4ff157['error'](0x1f4,_0x2b6ac2['message']));});});};exports[_0xc964('0x1a')]=function(_0x422a2c){var _0xa03b4d=this;return new Promise(function(_0xec8af5,_0x44bd38){return db['SquareReport']['update'](_0x422a2c[_0xc964('0x1b')],{'raw':_0x422a2c[_0xc964('0x18')]?_0x422a2c[_0xc964('0x18')][_0xc964('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422a2c[_0xc964('0x18')]?_0x422a2c['options']['where']||null:null,'attributes':_0x422a2c['options']?_0x422a2c[_0xc964('0x18')][_0xc964('0x1d')]||null:null,'limit':_0x422a2c[_0xc964('0x18')]?_0x422a2c[_0xc964('0x18')]['limit']||null:null})[_0xc964('0xa')](function(_0x48e037){logger[_0xc964('0x12')]('UpdateSquareReport',_0x422a2c);logger[_0xc964('0x19')]('UpdateSquareReport',_0x422a2c,JSON[_0xc964('0xe')](_0x48e037));_0xec8af5(_0x48e037);})['catch'](function(_0x123fc7){logger[_0xc964('0xf')]('UpdateSquareReport',_0x123fc7[_0xc964('0x11')],_0x422a2c);_0x44bd38(_0xa03b4d[_0xc964('0xf')](0x1f4,_0x123fc7[_0xc964('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 95e082e..b36e5b8 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 _0xc0c1=['multer','util','path','connect-timeout','Router','fs-extra','./squareReportDetail.controller','isAuthenticated','index','get','describe','/:id','show','create','put','update','exports'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xc0c1,0x1dc));var _0x1c0c=function(_0x3a9738,_0x46eb67){_0x3a9738=_0x3a9738-0x0;var _0x3affbf=_0xc0c1[_0x3a9738];return _0x3affbf;};'use strict';var multer=require(_0x1c0c('0x0'));var util=require(_0x1c0c('0x1'));var path=require(_0x1c0c('0x2'));var timeout=require(_0x1c0c('0x3'));var express=require('express');var router=express[_0x1c0c('0x4')]();var fs_extra=require(_0x1c0c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1c0c('0x6'));router['get']('/',auth[_0x1c0c('0x7')](),controller[_0x1c0c('0x8')]);router[_0x1c0c('0x9')]('/describe',auth[_0x1c0c('0x7')](),controller[_0x1c0c('0xa')]);router['get'](_0x1c0c('0xb'),auth[_0x1c0c('0x7')](),controller[_0x1c0c('0xc')]);router['post']('/',auth[_0x1c0c('0x7')](),controller[_0x1c0c('0xd')]);router[_0x1c0c('0xe')](_0x1c0c('0xb'),auth[_0x1c0c('0x7')](),controller[_0x1c0c('0xf')]);router['delete'](_0x1c0c('0xb'),auth[_0x1c0c('0x7')](),controller['destroy']);module[_0x1c0c('0x10')]=router; \ No newline at end of file +var _0x8cf1=['./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','show','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a328d,_0x4a5df0){var _0x277eb5=function(_0x76d28b){while(--_0x76d28b){_0x4a328d['push'](_0x4a328d['shift']());}};_0x277eb5(++_0x4a5df0);}(_0x8cf1,0x147));var _0x18cf=function(_0x1edca6,_0x37dced){_0x1edca6=_0x1edca6-0x0;var _0x4fb753=_0x8cf1[_0x1edca6];return _0x4fb753;};'use strict';var multer=require(_0x18cf('0x0'));var util=require(_0x18cf('0x1'));var path=require(_0x18cf('0x2'));var timeout=require(_0x18cf('0x3'));var express=require(_0x18cf('0x4'));var router=express[_0x18cf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x18cf('0x6'));var interaction=require(_0x18cf('0x7'));var config=require(_0x18cf('0x8'));var controller=require(_0x18cf('0x9'));router[_0x18cf('0xa')]('/',auth['isAuthenticated'](),controller[_0x18cf('0xb')]);router['get'](_0x18cf('0xc'),auth[_0x18cf('0xd')](),controller[_0x18cf('0xe')]);router[_0x18cf('0xa')]('/:id',auth[_0x18cf('0xd')](),controller[_0x18cf('0xf')]);router['post']('/',auth[_0x18cf('0xd')](),controller['create']);router[_0x18cf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x18cf('0x11')]);router[_0x18cf('0x12')](_0x18cf('0x13'),auth[_0x18cf('0xd')](),controller['destroy']);module[_0x18cf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 5b4f6cd..8072d6f 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 _0xa786=['exports','STRING','TEXT','sequelize'];(function(_0x5f3d7a,_0xbcbce7){var _0x82f384=function(_0x1db36a){while(--_0x1db36a){_0x5f3d7a['push'](_0x5f3d7a['shift']());}};_0x82f384(++_0xbcbce7);}(_0xa786,0x16b));var _0x6a78=function(_0x5dd2fb,_0x3daec0){_0x5dd2fb=_0x5dd2fb-0x0;var _0x5abc04=_0xa786[_0x5dd2fb];return _0x5abc04;};'use strict';var Sequelize=require(_0x6a78('0x0'));module[_0x6a78('0x1')]={'uniqueid':{'type':Sequelize[_0x6a78('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x6a78('0x2')]},'data':{'type':Sequelize[_0x6a78('0x3')]},'project_name':{'type':Sequelize[_0x6a78('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd293=['sequelize','STRING','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd293,0x10e));var _0x3d29=function(_0x19ed84,_0xac6b09){_0x19ed84=_0x19ed84-0x0;var _0x3006f9=_0xd293[_0x19ed84];return _0x3006f9;};'use strict';var Sequelize=require(_0x3d29('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3d29('0x1')]},'data':{'type':Sequelize[_0x3d29('0x2')]},'project_name':{'type':Sequelize[_0x3d29('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 139abcf..9cfc5b0 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 _0x628a=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','attributes','intersection','includeAll','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto'];(function(_0x436e1c,_0x351076){var _0x19e912=function(_0x1313b5){while(--_0x1313b5){_0x436e1c['push'](_0x436e1c['shift']());}};_0x19e912(++_0x351076);}(_0x628a,0x1bb));var _0xa628=function(_0x23d780,_0x458f78){_0x23d780=_0x23d780-0x0;var _0x335a06=_0x628a[_0x23d780];return _0x335a06;};'use strict';var emlformat=require(_0xa628('0x0'));var rimraf=require(_0xa628('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa628('0x2'));var rp=require(_0xa628('0x3'));var moment=require(_0xa628('0x4'));var BPromise=require(_0xa628('0x5'));var Mustache=require(_0xa628('0x6'));var util=require(_0xa628('0x7'));var path=require('path');var sox=require(_0xa628('0x8'));var csv=require(_0xa628('0x9'));var ejs=require(_0xa628('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa628('0xb'));var crypto=require(_0xa628('0xc'));var jsforce=require(_0xa628('0xd'));var deskjs=require(_0xa628('0xe'));var toCsv=require(_0xa628('0x9'));var querystring=require(_0xa628('0xf'));var Papa=require(_0xa628('0x10'));var Redis=require('ioredis');var authService=require(_0xa628('0x11'));var qs=require(_0xa628('0x12'));var as=require(_0xa628('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa628('0x14'))(_0xa628('0x15'));var utils=require(_0xa628('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa628('0x17'))['db'];function respondWithStatusCode(_0xe78f38,_0x20ecf2){_0x20ecf2=_0x20ecf2||0xcc;return function(_0x4ecc6b){if(_0x4ecc6b){return _0xe78f38[_0xa628('0x18')](_0x20ecf2);}return _0xe78f38['status'](_0x20ecf2)[_0xa628('0x19')]();};}function respondWithResult(_0x4b7a86,_0xa55921){_0xa55921=_0xa55921||0xc8;return function(_0xf0260c){if(_0xf0260c){return _0x4b7a86['status'](_0xa55921)[_0xa628('0x1a')](_0xf0260c);}};}function respondWithFilteredResult(_0x34ef6c,_0x34048c){return function(_0x46e541){if(_0x46e541){var _0x97d0f=typeof _0x34048c[_0xa628('0x1b')]===_0xa628('0x1c')&&typeof _0x34048c['limit']===_0xa628('0x1c');var _0x449552=_0x46e541[_0xa628('0x1d')];var _0x49a654=_0x97d0f?0x0:_0x34048c[_0xa628('0x1b')];var _0x6817bb=_0x97d0f?_0x46e541[_0xa628('0x1d')]:_0x34048c[_0xa628('0x1b')]+_0x34048c[_0xa628('0x1e')];var _0x213065;if(_0x6817bb>=_0x449552){_0x6817bb=_0x449552;_0x213065=0xc8;}else{_0x213065=0xce;}_0x34ef6c[_0xa628('0x1f')](_0x213065);return _0x34ef6c['set'](_0xa628('0x20'),_0x49a654+'-'+_0x6817bb+'/'+_0x449552)[_0xa628('0x1a')](_0x46e541);}return null;};}function patchUpdates(_0x540a22){return function(_0x5c4e94){try{jsonpatch[_0xa628('0x21')](_0x5c4e94,_0x540a22,!![]);}catch(_0x91c87d){return BPromise[_0xa628('0x22')](_0x91c87d);}return _0x5c4e94[_0xa628('0x23')]();};}function saveUpdates(_0x25390e,_0x489aba){return function(_0x138172){if(_0x138172){return _0x138172[_0xa628('0x24')](_0x25390e)[_0xa628('0x25')](function(_0xa70b6){return _0xa70b6;});}return null;};}function removeEntity(_0x25f680,_0x5d09b8){return function(_0xda925){if(_0xda925){return _0xda925[_0xa628('0x26')]()[_0xa628('0x25')](function(){_0x25f680[_0xa628('0x1f')](0xcc)[_0xa628('0x19')]();});}};}function handleEntityNotFound(_0x4bd4f6,_0x6f86bd){return function(_0x989e3a){if(!_0x989e3a){_0x4bd4f6[_0xa628('0x18')](0x194);}return _0x989e3a;};}function handleError(_0x380174,_0x41b4c3){_0x41b4c3=_0x41b4c3||0x1f4;return function(_0x5364f6){logger[_0xa628('0x27')](_0x5364f6[_0xa628('0x28')]);if(_0x5364f6[_0xa628('0x29')]){delete _0x5364f6['name'];}_0x380174['status'](_0x41b4c3)[_0xa628('0x2a')](_0x5364f6);};}exports[_0xa628('0x2b')]=function(_0x379951,_0x4e3272){var _0x352e81={},_0x158fef={},_0x1eb962={'count':0x0,'rows':[]};var _0x309ba0=_[_0xa628('0x2c')](db[_0xa628('0x2d')][_0xa628('0x2e')],function(_0x3857c0){return{'name':_0x3857c0[_0xa628('0x2f')],'type':_0x3857c0[_0xa628('0x30')][_0xa628('0x31')]};});_0x158fef[_0xa628('0x32')]=_[_0xa628('0x2c')](_0x309ba0,'name');_0x158fef[_0xa628('0x33')]=_[_0xa628('0x34')](_0x379951['query']);_0x158fef[_0xa628('0x35')]=_['intersection'](_0x158fef[_0xa628('0x32')],_0x158fef['query']);_0x352e81['attributes']=_['intersection'](_0x158fef[_0xa628('0x32')],qs[_0xa628('0x36')](_0x379951[_0xa628('0x33')][_0xa628('0x36')]));_0x352e81['attributes']=_0x352e81['attributes'][_0xa628('0x37')]?_0x352e81['attributes']:_0x158fef['model'];if(!_0x379951['query']['hasOwnProperty'](_0xa628('0x38'))){_0x352e81['limit']=qs['limit'](_0x379951[_0xa628('0x33')][_0xa628('0x1e')]);_0x352e81[_0xa628('0x1b')]=qs[_0xa628('0x1b')](_0x379951[_0xa628('0x33')][_0xa628('0x1b')]);}_0x352e81[_0xa628('0x39')]=qs[_0xa628('0x3a')](_0x379951[_0xa628('0x33')][_0xa628('0x3a')]);_0x352e81['where']=qs[_0xa628('0x35')](_[_0xa628('0x3b')](_0x379951[_0xa628('0x33')],_0x158fef[_0xa628('0x35')]),_0x309ba0);if(_0x379951[_0xa628('0x33')][_0xa628('0x3c')]){_0x352e81[_0xa628('0x3d')]=_[_0xa628('0x3e')](_0x352e81[_0xa628('0x3d')],{'$or':_[_0xa628('0x2c')](_0x309ba0,function(_0x3d7e72){if(_0x3d7e72[_0xa628('0x30')]!==_0xa628('0x3f')){var _0x105bac={};_0x105bac[_0x3d7e72[_0xa628('0x29')]]={'$like':'%'+_0x379951[_0xa628('0x33')][_0xa628('0x3c')]+'%'};return _0x105bac;}})});}_0x352e81=_['merge']({},_0x352e81,_0x379951[_0xa628('0x40')]);var _0x5b05ec={'where':_0x352e81['where']};return db[_0xa628('0x2d')][_0xa628('0x1d')](_0x5b05ec)['then'](function(_0x4def2b){_0x1eb962['count']=_0x4def2b;if(_0x379951[_0xa628('0x33')]['includeAll']){_0x352e81[_0xa628('0x41')]=[{'all':!![]}];}return db[_0xa628('0x2d')][_0xa628('0x42')](_0x352e81);})['then'](function(_0x402624){_0x1eb962[_0xa628('0x43')]=_0x402624;return _0x1eb962;})[_0xa628('0x25')](respondWithFilteredResult(_0x4e3272,_0x352e81))[_0xa628('0x44')](handleError(_0x4e3272,null));};exports[_0xa628('0x45')]=function(_0x5e6cd9,_0x23d2ae){var _0x48ecc8={'raw':!![],'where':{'id':_0x5e6cd9[_0xa628('0x46')]['id']}},_0x379969={};_0x379969['model']=_[_0xa628('0x34')](db[_0xa628('0x2d')][_0xa628('0x2e')]);_0x379969[_0xa628('0x33')]=_[_0xa628('0x34')](_0x5e6cd9[_0xa628('0x33')]);_0x379969[_0xa628('0x35')]=_['intersection'](_0x379969[_0xa628('0x32')],_0x379969[_0xa628('0x33')]);_0x48ecc8[_0xa628('0x47')]=_[_0xa628('0x48')](_0x379969[_0xa628('0x32')],qs[_0xa628('0x36')](_0x5e6cd9['query'][_0xa628('0x36')]));_0x48ecc8[_0xa628('0x47')]=_0x48ecc8[_0xa628('0x47')][_0xa628('0x37')]?_0x48ecc8[_0xa628('0x47')]:_0x379969['model'];if(_0x5e6cd9['query'][_0xa628('0x49')]){_0x48ecc8[_0xa628('0x41')]=[{'all':!![]}];}_0x48ecc8=_['merge']({},_0x48ecc8,_0x5e6cd9[_0xa628('0x40')]);return db['SquareDetailsReport'][_0xa628('0x4a')](_0x48ecc8)[_0xa628('0x25')](handleEntityNotFound(_0x23d2ae,null))[_0xa628('0x25')](respondWithResult(_0x23d2ae,null))['catch'](handleError(_0x23d2ae,null));};exports['create']=function(_0x3aeb81,_0x4ced29){return db[_0xa628('0x2d')]['create'](_0x3aeb81[_0xa628('0x4b')],{})[_0xa628('0x25')](respondWithResult(_0x4ced29,0xc9))[_0xa628('0x44')](handleError(_0x4ced29,null));};exports[_0xa628('0x24')]=function(_0x4753ea,_0x4fdd7f){if(_0x4753ea[_0xa628('0x4b')]['id']){delete _0x4753ea[_0xa628('0x4b')]['id'];}return db[_0xa628('0x2d')][_0xa628('0x4a')]({'where':{'id':_0x4753ea['params']['id']}})['then'](handleEntityNotFound(_0x4fdd7f,null))['then'](saveUpdates(_0x4753ea['body'],null))['then'](respondWithResult(_0x4fdd7f,null))[_0xa628('0x44')](handleError(_0x4fdd7f,null));};exports['destroy']=function(_0x17e538,_0x444782){return db['SquareDetailsReport'][_0xa628('0x4a')]({'where':{'id':_0x17e538[_0xa628('0x46')]['id']}})['then'](handleEntityNotFound(_0x444782,null))[_0xa628('0x25')](removeEntity(_0x444782,null))[_0xa628('0x44')](handleError(_0x444782,null));};exports['describe']=function(_0x19124e,_0x383fa3){return db[_0xa628('0x2d')]['describe']()[_0xa628('0x25')](respondWithResult(_0x383fa3,null))['catch'](handleError(_0x383fa3,null));}; \ No newline at end of file +var _0xe7c3=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','save','update','destroy','then','end','error','name','map','SquareDetailsReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','findAll','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','request-promise'];(function(_0x18cc33,_0x13667c){var _0x24dcb=function(_0x59351b){while(--_0x59351b){_0x18cc33['push'](_0x18cc33['shift']());}};_0x24dcb(++_0x13667c);}(_0xe7c3,0x16f));var _0x3e7c=function(_0x33fcc3,_0x34fef5){_0x33fcc3=_0x33fcc3-0x0;var _0x458f97=_0xe7c3[_0x33fcc3];return _0x458f97;};'use strict';var emlformat=require(_0x3e7c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3e7c('0x1'));var rp=require(_0x3e7c('0x2'));var moment=require(_0x3e7c('0x3'));var BPromise=require(_0x3e7c('0x4'));var Mustache=require(_0x3e7c('0x5'));var util=require('util');var path=require(_0x3e7c('0x6'));var sox=require(_0x3e7c('0x7'));var csv=require(_0x3e7c('0x8'));var ejs=require(_0x3e7c('0x9'));var fs=require('fs');var fs_extra=require(_0x3e7c('0xa'));var _=require(_0x3e7c('0xb'));var squel=require(_0x3e7c('0xc'));var crypto=require(_0x3e7c('0xd'));var jsforce=require(_0x3e7c('0xe'));var deskjs=require(_0x3e7c('0xf'));var toCsv=require(_0x3e7c('0x8'));var querystring=require(_0x3e7c('0x10'));var Papa=require(_0x3e7c('0x11'));var Redis=require(_0x3e7c('0x12'));var authService=require(_0x3e7c('0x13'));var qs=require(_0x3e7c('0x14'));var as=require(_0x3e7c('0x15'));var hardwareService=require(_0x3e7c('0x16'));var logger=require(_0x3e7c('0x17'))(_0x3e7c('0x18'));var utils=require(_0x3e7c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3e7c('0x1a'));var db=require(_0x3e7c('0x1b'))['db'];function respondWithStatusCode(_0x672644,_0x12cfe7){_0x12cfe7=_0x12cfe7||0xcc;return function(_0x569617){if(_0x569617){return _0x672644[_0x3e7c('0x1c')](_0x12cfe7);}return _0x672644['status'](_0x12cfe7)['end']();};}function respondWithResult(_0x47b99c,_0x3cb3de){_0x3cb3de=_0x3cb3de||0xc8;return function(_0x2e12e6){if(_0x2e12e6){return _0x47b99c[_0x3e7c('0x1d')](_0x3cb3de)[_0x3e7c('0x1e')](_0x2e12e6);}};}function respondWithFilteredResult(_0x285f73,_0x3f39ea){return function(_0x2ffa75){if(_0x2ffa75){var _0x19bfa8=typeof _0x3f39ea['offset']===_0x3e7c('0x1f')&&typeof _0x3f39ea[_0x3e7c('0x20')]==='undefined';var _0x2b100e=_0x2ffa75['count'];var _0x510337=_0x19bfa8?0x0:_0x3f39ea[_0x3e7c('0x21')];var _0x8e0bb1=_0x19bfa8?_0x2ffa75[_0x3e7c('0x22')]:_0x3f39ea[_0x3e7c('0x21')]+_0x3f39ea[_0x3e7c('0x20')];var _0x4f2382;if(_0x8e0bb1>=_0x2b100e){_0x8e0bb1=_0x2b100e;_0x4f2382=0xc8;}else{_0x4f2382=0xce;}_0x285f73[_0x3e7c('0x1d')](_0x4f2382);return _0x285f73[_0x3e7c('0x23')](_0x3e7c('0x24'),_0x510337+'-'+_0x8e0bb1+'/'+_0x2b100e)[_0x3e7c('0x1e')](_0x2ffa75);}return null;};}function patchUpdates(_0x1e88f7){return function(_0x3b321a){try{jsonpatch['apply'](_0x3b321a,_0x1e88f7,!![]);}catch(_0x37b05f){return BPromise['reject'](_0x37b05f);}return _0x3b321a[_0x3e7c('0x25')]();};}function saveUpdates(_0x4ba36e,_0x2dc9de){return function(_0x1e4773){if(_0x1e4773){return _0x1e4773[_0x3e7c('0x26')](_0x4ba36e)['then'](function(_0x5a4e46){return _0x5a4e46;});}return null;};}function removeEntity(_0x531b34,_0x4460ea){return function(_0x3c79bc){if(_0x3c79bc){return _0x3c79bc[_0x3e7c('0x27')]()[_0x3e7c('0x28')](function(){_0x531b34[_0x3e7c('0x1d')](0xcc)[_0x3e7c('0x29')]();});}};}function handleEntityNotFound(_0x609b6b,_0x5c4f20){return function(_0x4af49d){if(!_0x4af49d){_0x609b6b[_0x3e7c('0x1c')](0x194);}return _0x4af49d;};}function handleError(_0x23687f,_0x5a146e){_0x5a146e=_0x5a146e||0x1f4;return function(_0x5e0c62){logger[_0x3e7c('0x2a')](_0x5e0c62['stack']);if(_0x5e0c62[_0x3e7c('0x2b')]){delete _0x5e0c62[_0x3e7c('0x2b')];}_0x23687f[_0x3e7c('0x1d')](_0x5a146e)['send'](_0x5e0c62);};}exports['index']=function(_0x125931,_0x18cb8f){var _0x1355b5={},_0x53def7={},_0x2e281a={'count':0x0,'rows':[]};var _0x34e386=_[_0x3e7c('0x2c')](db[_0x3e7c('0x2d')]['rawAttributes'],function(_0xd13150){return{'name':_0xd13150[_0x3e7c('0x2e')],'type':_0xd13150[_0x3e7c('0x2f')]['key']};});_0x53def7[_0x3e7c('0x30')]=_[_0x3e7c('0x2c')](_0x34e386,_0x3e7c('0x2b'));_0x53def7[_0x3e7c('0x31')]=_[_0x3e7c('0x32')](_0x125931[_0x3e7c('0x31')]);_0x53def7[_0x3e7c('0x33')]=_[_0x3e7c('0x34')](_0x53def7[_0x3e7c('0x30')],_0x53def7[_0x3e7c('0x31')]);_0x1355b5['attributes']=_[_0x3e7c('0x34')](_0x53def7['model'],qs['fields'](_0x125931['query'][_0x3e7c('0x35')]));_0x1355b5[_0x3e7c('0x36')]=_0x1355b5[_0x3e7c('0x36')][_0x3e7c('0x37')]?_0x1355b5['attributes']:_0x53def7[_0x3e7c('0x30')];if(!_0x125931['query'][_0x3e7c('0x38')](_0x3e7c('0x39'))){_0x1355b5['limit']=qs['limit'](_0x125931[_0x3e7c('0x31')][_0x3e7c('0x20')]);_0x1355b5[_0x3e7c('0x21')]=qs[_0x3e7c('0x21')](_0x125931[_0x3e7c('0x31')][_0x3e7c('0x21')]);}_0x1355b5[_0x3e7c('0x3a')]=qs[_0x3e7c('0x3b')](_0x125931[_0x3e7c('0x31')]['sort']);_0x1355b5[_0x3e7c('0x3c')]=qs[_0x3e7c('0x33')](_[_0x3e7c('0x3d')](_0x125931[_0x3e7c('0x31')],_0x53def7[_0x3e7c('0x33')]),_0x34e386);if(_0x125931[_0x3e7c('0x31')]['filter']){_0x1355b5[_0x3e7c('0x3c')]=_[_0x3e7c('0x3e')](_0x1355b5[_0x3e7c('0x3c')],{'$or':_[_0x3e7c('0x2c')](_0x34e386,function(_0x98b775){if(_0x98b775[_0x3e7c('0x2f')]!==_0x3e7c('0x3f')){var _0x46e55d={};_0x46e55d[_0x98b775[_0x3e7c('0x2b')]]={'$like':'%'+_0x125931[_0x3e7c('0x31')]['filter']+'%'};return _0x46e55d;}})});}_0x1355b5=_[_0x3e7c('0x3e')]({},_0x1355b5,_0x125931[_0x3e7c('0x40')]);var _0xc70d5={'where':_0x1355b5['where']};return db['SquareDetailsReport'][_0x3e7c('0x22')](_0xc70d5)[_0x3e7c('0x28')](function(_0x9ed82){_0x2e281a[_0x3e7c('0x22')]=_0x9ed82;if(_0x125931[_0x3e7c('0x31')]['includeAll']){_0x1355b5['include']=[{'all':!![]}];}return db[_0x3e7c('0x2d')][_0x3e7c('0x41')](_0x1355b5);})[_0x3e7c('0x28')](function(_0x4088f8){_0x2e281a['rows']=_0x4088f8;return _0x2e281a;})['then'](respondWithFilteredResult(_0x18cb8f,_0x1355b5))[_0x3e7c('0x42')](handleError(_0x18cb8f,null));};exports[_0x3e7c('0x43')]=function(_0x2be22f,_0x12d637){var _0x29da9b={'raw':!![],'where':{'id':_0x2be22f[_0x3e7c('0x44')]['id']}},_0x5d5d7c={};_0x5d5d7c[_0x3e7c('0x30')]=_[_0x3e7c('0x32')](db[_0x3e7c('0x2d')]['rawAttributes']);_0x5d5d7c[_0x3e7c('0x31')]=_[_0x3e7c('0x32')](_0x2be22f[_0x3e7c('0x31')]);_0x5d5d7c[_0x3e7c('0x33')]=_[_0x3e7c('0x34')](_0x5d5d7c[_0x3e7c('0x30')],_0x5d5d7c['query']);_0x29da9b[_0x3e7c('0x36')]=_[_0x3e7c('0x34')](_0x5d5d7c[_0x3e7c('0x30')],qs[_0x3e7c('0x35')](_0x2be22f[_0x3e7c('0x31')]['fields']));_0x29da9b['attributes']=_0x29da9b[_0x3e7c('0x36')][_0x3e7c('0x37')]?_0x29da9b[_0x3e7c('0x36')]:_0x5d5d7c[_0x3e7c('0x30')];if(_0x2be22f[_0x3e7c('0x31')]['includeAll']){_0x29da9b[_0x3e7c('0x45')]=[{'all':!![]}];}_0x29da9b=_[_0x3e7c('0x3e')]({},_0x29da9b,_0x2be22f[_0x3e7c('0x40')]);return db[_0x3e7c('0x2d')][_0x3e7c('0x46')](_0x29da9b)[_0x3e7c('0x28')](handleEntityNotFound(_0x12d637,null))[_0x3e7c('0x28')](respondWithResult(_0x12d637,null))[_0x3e7c('0x42')](handleError(_0x12d637,null));};exports[_0x3e7c('0x47')]=function(_0x32e54e,_0x1aacb1){return db[_0x3e7c('0x2d')]['create'](_0x32e54e['body'],{})[_0x3e7c('0x28')](respondWithResult(_0x1aacb1,0xc9))[_0x3e7c('0x42')](handleError(_0x1aacb1,null));};exports[_0x3e7c('0x26')]=function(_0x3926ba,_0x580994){if(_0x3926ba[_0x3e7c('0x48')]['id']){delete _0x3926ba['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3926ba[_0x3e7c('0x44')]['id']}})[_0x3e7c('0x28')](handleEntityNotFound(_0x580994,null))[_0x3e7c('0x28')](saveUpdates(_0x3926ba[_0x3e7c('0x48')],null))[_0x3e7c('0x28')](respondWithResult(_0x580994,null))[_0x3e7c('0x42')](handleError(_0x580994,null));};exports[_0x3e7c('0x27')]=function(_0x386a6e,_0x117241){return db[_0x3e7c('0x2d')]['find']({'where':{'id':_0x386a6e[_0x3e7c('0x44')]['id']}})[_0x3e7c('0x28')](handleEntityNotFound(_0x117241,null))[_0x3e7c('0x28')](removeEntity(_0x117241,null))[_0x3e7c('0x42')](handleError(_0x117241,null));};exports[_0x3e7c('0x49')]=function(_0x11c1d4,_0x3a2ac9){return db['SquareDetailsReport'][_0x3e7c('0x49')]()['then'](respondWithResult(_0x3a2ac9,null))['catch'](handleError(_0x3a2ac9,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 622d5cf..3c5f5dd 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 _0xa4b3=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','SquareDetailsReport','report_square_details'];(function(_0x26eb3f,_0x32f0f6){var _0x404a98=function(_0x4e3732){while(--_0x4e3732){_0x26eb3f['push'](_0x26eb3f['shift']());}};_0x404a98(++_0x32f0f6);}(_0xa4b3,0x1c3));var _0x3a4b=function(_0x3c5916,_0x89796a){_0x3c5916=_0x3c5916-0x0;var _0x232c4b=_0xa4b3[_0x3c5916];return _0x232c4b;};'use strict';var _=require(_0x3a4b('0x0'));var util=require('util');var logger=require(_0x3a4b('0x1'))(_0x3a4b('0x2'));var moment=require(_0x3a4b('0x3'));var BPromise=require(_0x3a4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a4b('0x5'));var rimraf=require('rimraf');var config=require(_0x3a4b('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x3a4b('0x7')]=function(_0x45320c,_0x1ba669){return _0x45320c[_0x3a4b('0x8')](_0x3a4b('0x9'),attributes,{'tableName':_0x3a4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf54d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0x1d8b80,_0x5817df){var _0x273b69=function(_0x3bfae1){while(--_0x3bfae1){_0x1d8b80['push'](_0x1d8b80['shift']());}};_0x273b69(++_0x5817df);}(_0xf54d,0xd0));var _0xdf54=function(_0x4e8f07,_0x4c6ce4){_0x4e8f07=_0x4e8f07-0x0;var _0x4207de=_0xf54d[_0x4e8f07];return _0x4207de;};'use strict';var _=require('lodash');var util=require(_0xdf54('0x0'));var logger=require(_0xdf54('0x1'))(_0xdf54('0x2'));var moment=require(_0xdf54('0x3'));var BPromise=require(_0xdf54('0x4'));var rp=require(_0xdf54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf54('0x6'));var config=require(_0xdf54('0x7'));var attributes=require(_0xdf54('0x8'));module[_0xdf54('0x9')]=function(_0x55c79e,_0x4e5f4b){return _0x55c79e[_0xdf54('0xa')](_0xdf54('0xb'),attributes,{'tableName':_0xdf54('0xc'),'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 ae80026..97a453d 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 _0x2b65=['info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2e59fe,_0x27d28f){var _0x7815cc=function(_0x54008a){while(--_0x54008a){_0x2e59fe['push'](_0x2e59fe['shift']());}};_0x7815cc(++_0x27d28f);}(_0x2b65,0x131));var _0x52b6=function(_0x4eeece,_0x5d0f4c){_0x4eeece=_0x4eeece-0x0;var _0xc5062e=_0x2b65[_0x4eeece];return _0xc5062e;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d451f,_0x70579,_0x1af78f){return new BPromise(function(_0x432726,_0x27c5b9){return client['request'](_0x2d451f,_0x1af78f)[_0x52b6('0xd')](function(_0x1c2cb5){logger[_0x52b6('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x70579,_0x52b6('0xf'));logger[_0x52b6('0x10')](_0x52b6('0x11'),_0x70579,_0x52b6('0xf'),JSON['stringify'](_0x1c2cb5));if(_0x1c2cb5[_0x52b6('0x12')]){if(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x13')]===0x1f4){logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')]['message']);return _0x27c5b9(_0x1c2cb5[_0x52b6('0x12')]['message']);}logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);return _0x432726(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);}else{logger[_0x52b6('0xe')](_0x52b6('0x14'),_0x70579,_0x52b6('0xf'));_0x432726(_0x1c2cb5[_0x52b6('0x16')][_0x52b6('0x15')]);}})[_0x52b6('0x17')](function(_0x307594){logger[_0x52b6('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x70579,_0x307594);_0x27c5b9(_0x307594);});});}exports[_0x52b6('0x18')]=function(_0x2fa3ed){var _0x9bab0a=this;return new Promise(function(_0x47d203,_0x36d376){return db[_0x52b6('0x19')]['create'](_0x2fa3ed['body'],{'raw':_0x2fa3ed[_0x52b6('0x1a')]?_0x2fa3ed['options'][_0x52b6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2e472f){logger[_0x52b6('0xe')](_0x52b6('0x18'),_0x2fa3ed);logger[_0x52b6('0x10')]('CreateSquareDetailsReport',_0x2fa3ed,JSON[_0x52b6('0x1c')](_0x2e472f));_0x47d203(_0x2e472f);})[_0x52b6('0x17')](function(_0x1246db){logger[_0x52b6('0x12')](_0x52b6('0x18'),_0x1246db[_0x52b6('0x15')],_0x2fa3ed);_0x36d376(_0x9bab0a[_0x52b6('0x12')](0x1f4,_0x1246db[_0x52b6('0x15')]));});});}; \ No newline at end of file +var _0x282b=['../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x282b,0xec));var _0xb282=function(_0x5c4c9b,_0x437cfc){_0x5c4c9b=_0x5c4c9b-0x0;var _0x1c49ad=_0x282b[_0x5c4c9b];return _0x1c49ad;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['SquareDetailsReport'][_0xb282('0x16')](_0xca5f12[_0xb282('0x17')],{'raw':_0xca5f12['options']?_0xca5f12[_0xb282('0x18')][_0xb282('0x19')]===undefined?!![]:![]:!![]})[_0xb282('0xb')](function(_0x438dbe){logger[_0xb282('0xc')]('CreateSquareDetailsReport',_0xca5f12);logger[_0xb282('0x1a')](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x438dbe));_0x3f8a3f(_0x438dbe);})['catch'](function(_0x437d66){logger[_0xb282('0x11')](_0xb282('0x15'),_0x437d66[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070[_0xb282('0x11')](0x1f4,_0x437d66['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index a99521a..700b754 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 _0x1b55=['isAuthenticated','index','get','/process/:pid/kill','killProcess','Router'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x1b55,0x1af));var _0x51b5=function(_0x15c885,_0x1b4937){_0x15c885=_0x15c885-0x0;var _0x35949d=_0x1b55[_0x15c885];return _0x35949d;};'use strict';var express=require('express');var router=express[_0x51b5('0x0')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0x51b5('0x1')](),controller[_0x51b5('0x2')]);router[_0x51b5('0x3')](_0x51b5('0x4'),auth[_0x51b5('0x1')](),controller[_0x51b5('0x5')]);module['exports']=router; \ No newline at end of file +var _0x7533=['Router','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x524728,_0x3d59e0){var _0x268b54=function(_0x5a1648){while(--_0x5a1648){_0x524728['push'](_0x524728['shift']());}};_0x268b54(++_0x3d59e0);}(_0x7533,0x19d));var _0x3753=function(_0x53495c,_0x2add5f){_0x53495c=_0x53495c-0x0;var _0x5351e1=_0x7533[_0x53495c];return _0x5351e1;};'use strict';var express=require(_0x3753('0x0'));var router=express[_0x3753('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x3753('0x2'));router[_0x3753('0x3')]('/',auth[_0x3753('0x4')](),controller[_0x3753('0x5')]);router['get'](_0x3753('0x6'),auth['isAuthenticated'](),controller[_0x3753('0x7')]);module[_0x3753('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index d35ed8f..a6d16dd 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 _0x5b66=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then','status','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','util','bluebird','lodash'];(function(_0x18c3aa,_0x14338c){var _0x3ae182=function(_0x5a59c9){while(--_0x5a59c9){_0x18c3aa['push'](_0x18c3aa['shift']());}};_0x3ae182(++_0x14338c);}(_0x5b66,0x6d));var _0x65b6=function(_0x3d3b05,_0x461830){_0x3d3b05=_0x3d3b05-0x0;var _0x34e63a=_0x5b66[_0x3d3b05];return _0x34e63a;};'use strict';var info=require('systeminformation');var exec=require(_0x65b6('0x0'))[_0x65b6('0x1')];var logger=require(_0x65b6('0x2'))(_0x65b6('0x3'));var util=require(_0x65b6('0x4'));var BPromise=require(_0x65b6('0x5'));var _=require(_0x65b6('0x6'));function handleError(_0x502305,_0x4f07fe,_0x599221){_0x4f07fe=_0x4f07fe||0x1f4;return function(_0x5465f8){logger[_0x65b6('0x7')](_0x65b6('0x8'),_0x599221,_0x4f07fe,util[_0x65b6('0x9')](_0x5465f8,{'showHidden':![],'depth':null}));delete _0x5465f8[_0x65b6('0xa')];_0x502305['status'](_0x4f07fe)[_0x65b6('0xb')](_0x5465f8);};}exports[_0x65b6('0xc')]=function(_0x1cc55c,_0x5e99ea){return info[_0x65b6('0xd')]()[_0x65b6('0xe')](function(_0xe5882e){return _0x5e99ea[_0x65b6('0xf')](0xc8)['json'](_0xe5882e);})[_0x65b6('0x10')](function(_0x36f268){return _0x5e99ea[_0x65b6('0xf')](0x1f4)[_0x65b6('0x11')](_0x36f268);});};exports[_0x65b6('0x12')]=function(_0x5ae145,_0x5751b0){var _0x45bc04=[_0x65b6('0x13')];return new BPromise(function(_0x29dc54,_0x31c8dd){return exec(util[_0x65b6('0x14')](_0x65b6('0x15'),_0x5ae145[_0x65b6('0x16')][_0x65b6('0x17')]),function(_0x5eaf33,_0x7112b0,_0x1b027c){if(_0x5eaf33){return _0x31c8dd(_0x5eaf33);}return _0x29dc54(_0x7112b0);});})['then'](function(_0x1324e6){var _0x4e2726=![];var _0x429421=_0x1324e6[_0x65b6('0x18')](/\n/);for(var _0x3cf384=0x0,_0xfcfd11=_0x45bc04['length'];_0x3cf384<_0xfcfd11,_0x4e2726===![];_0x3cf384+=0x1){if(_0x1324e6[_0x65b6('0x19')](_0x45bc04[_0x3cf384])>=0x0){_0x4e2726=!![];}}if(!_0x4e2726){throw new Error(util[_0x65b6('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5ae145[_0x65b6('0x16')]['pid']));}process[_0x65b6('0x1a')](_0x5ae145['params'][_0x65b6('0x17')],_0x65b6('0x1b'));return _0x5751b0[_0x65b6('0xf')](0xc8)[_0x65b6('0x11')]({'message':util[_0x65b6('0x14')](_0x65b6('0x1c'),_0x5ae145[_0x65b6('0x16')][_0x65b6('0x17')])});})[_0x65b6('0x10')](handleError(_0x5751b0,null,_0x65b6('0x12')));}; \ No newline at end of file +var _0xe862=['then','status','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData'];(function(_0x52a192,_0x3ffac0){var _0x4da4ae=function(_0x533315){while(--_0x533315){_0x52a192['push'](_0x52a192['shift']());}};_0x4da4ae(++_0x3ffac0);}(_0xe862,0x76));var _0x2e86=function(_0x571ee4,_0x561fe5){_0x571ee4=_0x571ee4-0x0;var _0x37c265=_0xe862[_0x571ee4];return _0x37c265;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x2e86('0x0')];var logger=require(_0x2e86('0x1'))(_0x2e86('0x2'));var util=require('util');var BPromise=require(_0x2e86('0x3'));var _=require(_0x2e86('0x4'));function handleError(_0x11fe49,_0x409cdd,_0x14ca23){_0x409cdd=_0x409cdd||0x1f4;return function(_0x4d3854){logger[_0x2e86('0x5')](_0x2e86('0x6'),_0x14ca23,_0x409cdd,util[_0x2e86('0x7')](_0x4d3854,{'showHidden':![],'depth':null}));delete _0x4d3854[_0x2e86('0x8')];_0x11fe49['status'](_0x409cdd)[_0x2e86('0x9')](_0x4d3854);};}exports[_0x2e86('0xa')]=function(_0x43b966,_0x4e9b21){return info[_0x2e86('0xb')]()[_0x2e86('0xc')](function(_0x585763){return _0x4e9b21[_0x2e86('0xd')](0xc8)['json'](_0x585763);})[_0x2e86('0xe')](function(_0x72da58){return _0x4e9b21[_0x2e86('0xd')](0x1f4)['json'](_0x72da58);});};exports['killProcess']=function(_0x14077c,_0x38c5aa){var _0x28d3b7=[_0x2e86('0xf')];return new BPromise(function(_0x9d614d,_0x544892){return exec(util[_0x2e86('0x10')](_0x2e86('0x11'),_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')]),function(_0x2ebf07,_0x2b6306,_0x9045c8){if(_0x2ebf07){return _0x544892(_0x2ebf07);}return _0x9d614d(_0x2b6306);});})['then'](function(_0x590ae6){var _0x26d7db=![];var _0x5cb8f7=_0x590ae6[_0x2e86('0x14')](/\n/);for(var _0x328fe5=0x0,_0x4c37f4=_0x28d3b7[_0x2e86('0x15')];_0x328fe5<_0x4c37f4,_0x26d7db===![];_0x328fe5+=0x1){if(_0x590ae6[_0x2e86('0x16')](_0x28d3b7[_0x328fe5])>=0x0){_0x26d7db=!![];}}if(!_0x26d7db){throw new Error(util[_0x2e86('0x10')](_0x2e86('0x17'),_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')]));}process['kill'](_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')],'SIGINT');return _0x38c5aa[_0x2e86('0xd')](0xc8)['json']({'message':util[_0x2e86('0x10')](_0x2e86('0x18'),_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')])});})[_0x2e86('0xe')](handleError(_0x38c5aa,null,_0x2e86('0x19')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 08fb7c7..10b6aa2 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 _0x043c=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','get','/:id','post','create','put','update'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x043c,0xc8));var _0xc043=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x043c[_0x4a095e];return _0x10ef73;};'use strict';var multer=require(_0xc043('0x0'));var util=require(_0xc043('0x1'));var path=require('path');var timeout=require(_0xc043('0x2'));var express=require(_0xc043('0x3'));var router=express[_0xc043('0x4')]();var fs_extra=require(_0xc043('0x5'));var auth=require(_0xc043('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc043('0x7'));var controller=require(_0xc043('0x8'));router['get']('/',auth[_0xc043('0x9')](),controller['index']);router[_0xc043('0xa')](_0xc043('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc043('0xc')]('/',auth[_0xc043('0x9')](),controller[_0xc043('0xd')]);router[_0xc043('0xe')](_0xc043('0xb'),auth[_0xc043('0x9')](),controller[_0xc043('0xf')]);router[_0xc043('0x10')](_0xc043('0xb'),auth['isAuthenticated'](),controller[_0xc043('0x11')]);module['exports']=router; \ No newline at end of file +var _0x943a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','post','create','put','/:id','delete','destroy'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x943a,0xfd));var _0xa943=function(_0x1b58ec,_0x3dd06f){_0x1b58ec=_0x1b58ec-0x0;var _0xd3e8a5=_0x943a[_0x1b58ec];return _0xd3e8a5;};'use strict';var multer=require(_0xa943('0x0'));var util=require(_0xa943('0x1'));var path=require(_0xa943('0x2'));var timeout=require(_0xa943('0x3'));var express=require(_0xa943('0x4'));var router=express[_0xa943('0x5')]();var fs_extra=require(_0xa943('0x6'));var auth=require(_0xa943('0x7'));var interaction=require(_0xa943('0x8'));var config=require(_0xa943('0x9'));var controller=require(_0xa943('0xa'));router[_0xa943('0xb')]('/',auth[_0xa943('0xc')](),controller[_0xa943('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa943('0xe')]('/',auth[_0xa943('0xc')](),controller[_0xa943('0xf')]);router[_0xa943('0x10')](_0xa943('0x11'),auth[_0xa943('0xc')](),controller['update']);router[_0xa943('0x12')]('/:id',auth[_0xa943('0xc')](),controller[_0xa943('0x13')]);module[_0xa943('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 2e4bc61..636f529 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 _0x0d74=['STRING','#0091EA','sequelize','exports'];(function(_0x2124a2,_0x37d365){var _0x23c250=function(_0x529195){while(--_0x529195){_0x2124a2['push'](_0x2124a2['shift']());}};_0x23c250(++_0x37d365);}(_0x0d74,0x146));var _0x40d7=function(_0x2e3d56,_0x4fb6ed){_0x2e3d56=_0x2e3d56-0x0;var _0x1815c1=_0x0d74[_0x2e3d56];return _0x1815c1;};'use strict';var Sequelize=require(_0x40d7('0x0'));module[_0x40d7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x40d7('0x2')],'defaultValue':_0x40d7('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf089=['exports','STRING','#0091EA'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xf089,0xba));var _0x9f08=function(_0x4031f4,_0x7ac959){_0x4031f4=_0x4031f4-0x0;var _0x10ef6c=_0xf089[_0x4031f4];return _0x10ef6c;};'use strict';var Sequelize=require('sequelize');module[_0x9f08('0x0')]={'name':{'type':Sequelize[_0x9f08('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9f08('0x1')],'defaultValue':_0x9f08('0x2')},'description':{'type':Sequelize[_0x9f08('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 600f29b..c63790b 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 _0x1306=['length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','params','includeAll','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','Tags','UserProfileResource','then','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x200114,_0x13bf51){var _0x11910c=function(_0x55a207){while(--_0x55a207){_0x200114['push'](_0x200114['shift']());}};_0x11910c(++_0x13bf51);}(_0x1306,0x17a));var _0x6130=function(_0x3749c6,_0x1fef26){_0x3749c6=_0x3749c6-0x0;var _0x5891f4=_0x1306[_0x3749c6];return _0x5891f4;};'use strict';var emlformat=require(_0x6130('0x0'));var rimraf=require(_0x6130('0x1'));var zipdir=require(_0x6130('0x2'));var jsonpatch=require(_0x6130('0x3'));var rp=require(_0x6130('0x4'));var moment=require(_0x6130('0x5'));var BPromise=require(_0x6130('0x6'));var Mustache=require(_0x6130('0x7'));var util=require(_0x6130('0x8'));var path=require(_0x6130('0x9'));var sox=require(_0x6130('0xa'));var csv=require(_0x6130('0xb'));var ejs=require(_0x6130('0xc'));var fs=require('fs');var fs_extra=require(_0x6130('0xd'));var _=require(_0x6130('0xe'));var squel=require(_0x6130('0xf'));var crypto=require(_0x6130('0x10'));var jsforce=require(_0x6130('0x11'));var deskjs=require(_0x6130('0x12'));var toCsv=require(_0x6130('0xb'));var querystring=require(_0x6130('0x13'));var Papa=require(_0x6130('0x14'));var Redis=require(_0x6130('0x15'));var authService=require(_0x6130('0x16'));var qs=require(_0x6130('0x17'));var as=require(_0x6130('0x18'));var hardwareService=require(_0x6130('0x19'));var logger=require(_0x6130('0x1a'))(_0x6130('0x1b'));var utils=require('../../config/utils');var config=require(_0x6130('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x6130('0x1d'))['db'];function respondWithStatusCode(_0x2fbf3d,_0x5e0234){_0x5e0234=_0x5e0234||0xcc;return function(_0x1c0339){if(_0x1c0339){return _0x2fbf3d[_0x6130('0x1e')](_0x5e0234);}return _0x2fbf3d[_0x6130('0x1f')](_0x5e0234)[_0x6130('0x20')]();};}function respondWithResult(_0x1d736c,_0x3470e8){_0x3470e8=_0x3470e8||0xc8;return function(_0x4cdac6){if(_0x4cdac6){return _0x1d736c[_0x6130('0x1f')](_0x3470e8)[_0x6130('0x21')](_0x4cdac6);}};}function respondWithFilteredResult(_0x3ef4c1,_0x401a70){return function(_0x4626a2){if(_0x4626a2){var _0x39b444=typeof _0x401a70[_0x6130('0x22')]===_0x6130('0x23')&&typeof _0x401a70[_0x6130('0x24')]==='undefined';var _0x4b9a20=_0x4626a2[_0x6130('0x25')];var _0x49803e=_0x39b444?0x0:_0x401a70[_0x6130('0x22')];var _0xb6575d=_0x39b444?_0x4626a2[_0x6130('0x25')]:_0x401a70[_0x6130('0x22')]+_0x401a70[_0x6130('0x24')];var _0x4b4b35;if(_0xb6575d>=_0x4b9a20){_0xb6575d=_0x4b9a20;_0x4b4b35=0xc8;}else{_0x4b4b35=0xce;}_0x3ef4c1[_0x6130('0x1f')](_0x4b4b35);return _0x3ef4c1['set'](_0x6130('0x26'),_0x49803e+'-'+_0xb6575d+'/'+_0x4b9a20)[_0x6130('0x21')](_0x4626a2);}return null;};}function patchUpdates(_0x18bb78){return function(_0x1839db){try{jsonpatch[_0x6130('0x27')](_0x1839db,_0x18bb78,!![]);}catch(_0x5c8b08){return BPromise['reject'](_0x5c8b08);}return _0x1839db[_0x6130('0x28')]();};}function saveUpdates(_0x534390,_0x30b4f2){return function(_0x289c7b){if(_0x289c7b){return _0x289c7b['update'](_0x534390)['then'](function(_0x54fc67){return _0x54fc67;});}return null;};}function removeEntity(_0x2a8aad,_0x5369e3){return function(_0x371b84){if(_0x371b84){return _0x371b84['destroy']()['then'](function(){var _0x4be8ff=_0x371b84['get']({'plain':!![]});var _0x5069bf=_0x6130('0x29');return db[_0x6130('0x2a')]['destroy']({'where':{'type':_0x5069bf,'resourceId':_0x4be8ff['id']}})[_0x6130('0x2b')](function(){return _0x371b84;});})['then'](function(){_0x2a8aad[_0x6130('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5787a6,_0x9196d1){return function(_0x456231){if(!_0x456231){_0x5787a6[_0x6130('0x1e')](0x194);}return _0x456231;};}function handleError(_0x2997fd,_0x19f9b1){_0x19f9b1=_0x19f9b1||0x1f4;return function(_0x392386){logger[_0x6130('0x2c')](_0x392386[_0x6130('0x2d')]);if(_0x392386[_0x6130('0x2e')]){delete _0x392386['name'];}_0x2997fd['status'](_0x19f9b1)[_0x6130('0x2f')](_0x392386);};}exports[_0x6130('0x30')]=function(_0xa49077,_0x4345ac){var _0x197dd9={},_0x4e068c={},_0x432cbf={'count':0x0,'rows':[]};var _0x4e04bc=_[_0x6130('0x31')](db[_0x6130('0x32')][_0x6130('0x33')],function(_0x4cf1d3){return{'name':_0x4cf1d3[_0x6130('0x34')],'type':_0x4cf1d3[_0x6130('0x35')][_0x6130('0x36')]};});_0x4e068c['model']=_[_0x6130('0x31')](_0x4e04bc,_0x6130('0x2e'));_0x4e068c[_0x6130('0x37')]=_[_0x6130('0x38')](_0xa49077[_0x6130('0x37')]);_0x4e068c[_0x6130('0x39')]=_[_0x6130('0x3a')](_0x4e068c[_0x6130('0x3b')],_0x4e068c[_0x6130('0x37')]);_0x197dd9['attributes']=_[_0x6130('0x3a')](_0x4e068c['model'],qs['fields'](_0xa49077['query'][_0x6130('0x3c')]));_0x197dd9[_0x6130('0x3d')]=_0x197dd9[_0x6130('0x3d')][_0x6130('0x3e')]?_0x197dd9[_0x6130('0x3d')]:_0x4e068c[_0x6130('0x3b')];if(!_0xa49077[_0x6130('0x37')][_0x6130('0x3f')]('nolimit')){_0x197dd9[_0x6130('0x24')]=qs[_0x6130('0x24')](_0xa49077['query'][_0x6130('0x24')]);_0x197dd9[_0x6130('0x22')]=qs[_0x6130('0x22')](_0xa49077['query'][_0x6130('0x22')]);}_0x197dd9[_0x6130('0x40')]=qs['sort'](_0xa49077['query'][_0x6130('0x41')]);_0x197dd9[_0x6130('0x42')]=qs[_0x6130('0x39')](_['pick'](_0xa49077['query'],_0x4e068c[_0x6130('0x39')]),_0x4e04bc);if(_0xa49077[_0x6130('0x37')][_0x6130('0x43')]){_0x197dd9[_0x6130('0x42')]=_[_0x6130('0x44')](_0x197dd9[_0x6130('0x42')],{'$or':_[_0x6130('0x31')](_0x4e04bc,function(_0x5e1f55){if(_0x5e1f55[_0x6130('0x35')]!==_0x6130('0x45')){var _0x101aab={};_0x101aab[_0x5e1f55[_0x6130('0x2e')]]={'$like':'%'+_0xa49077[_0x6130('0x37')][_0x6130('0x43')]+'%'};return _0x101aab;}})});}_0x197dd9=_[_0x6130('0x44')]({},_0x197dd9,_0xa49077['options']);var _0xa9583a={'where':_0x197dd9[_0x6130('0x42')]};return db[_0x6130('0x32')][_0x6130('0x25')](_0xa9583a)[_0x6130('0x2b')](function(_0x142385){_0x432cbf[_0x6130('0x25')]=_0x142385;if(_0xa49077[_0x6130('0x37')]['includeAll']){_0x197dd9[_0x6130('0x46')]=[{'all':!![]}];}return db[_0x6130('0x32')][_0x6130('0x47')](_0x197dd9);})['then'](function(_0x176506){_0x432cbf[_0x6130('0x48')]=_0x176506;return _0x432cbf;})[_0x6130('0x2b')](respondWithFilteredResult(_0x4345ac,_0x197dd9))['catch'](handleError(_0x4345ac,null));};exports['show']=function(_0x3ee3f8,_0x2bc233){var _0x11285b={'raw':!![],'where':{'id':_0x3ee3f8[_0x6130('0x49')]['id']}},_0xd87943={};_0xd87943['model']=_[_0x6130('0x38')](db[_0x6130('0x32')]['rawAttributes']);_0xd87943[_0x6130('0x37')]=_[_0x6130('0x38')](_0x3ee3f8[_0x6130('0x37')]);_0xd87943[_0x6130('0x39')]=_[_0x6130('0x3a')](_0xd87943[_0x6130('0x3b')],_0xd87943[_0x6130('0x37')]);_0x11285b[_0x6130('0x3d')]=_['intersection'](_0xd87943['model'],qs[_0x6130('0x3c')](_0x3ee3f8['query'][_0x6130('0x3c')]));_0x11285b[_0x6130('0x3d')]=_0x11285b[_0x6130('0x3d')][_0x6130('0x3e')]?_0x11285b[_0x6130('0x3d')]:_0xd87943[_0x6130('0x3b')];if(_0x3ee3f8[_0x6130('0x37')][_0x6130('0x4a')]){_0x11285b[_0x6130('0x46')]=[{'all':!![]}];}_0x11285b=_[_0x6130('0x44')]({},_0x11285b,_0x3ee3f8[_0x6130('0x4b')]);return db['Tag'][_0x6130('0x4c')](_0x11285b)[_0x6130('0x2b')](handleEntityNotFound(_0x2bc233,null))[_0x6130('0x2b')](respondWithResult(_0x2bc233,null))[_0x6130('0x4d')](handleError(_0x2bc233,null));};exports[_0x6130('0x4e')]=function(_0x13f591,_0x35939b){return db[_0x6130('0x32')][_0x6130('0x4e')](_0x13f591[_0x6130('0x4f')],{})['then'](function(_0x138ade){var _0x689645=_0x13f591[_0x6130('0x50')][_0x6130('0x51')]({'plain':!![]});if(!_0x689645)throw new Error(_0x6130('0x52'));if(_0x689645[_0x6130('0x53')]===_0x6130('0x50')){var _0x37ee0c=_0x138ade[_0x6130('0x51')]({'plain':!![]});var _0x484e1b=_0x6130('0x29');return db[_0x6130('0x54')][_0x6130('0x4c')]({'where':{'name':_0x484e1b,'userProfileId':_0x689645[_0x6130('0x55')]},'raw':!![]})[_0x6130('0x2b')](function(_0x2b4b3e){if(_0x2b4b3e&&_0x2b4b3e['autoAssociation']===0x0){return db[_0x6130('0x2a')][_0x6130('0x4e')]({'name':_0x37ee0c[_0x6130('0x2e')],'resourceId':_0x37ee0c['id'],'type':_0x2b4b3e['name'],'sectionId':_0x2b4b3e['id']},{})['then'](function(){return _0x138ade;});}else{return _0x138ade;}})['catch'](function(_0x529977){logger[_0x6130('0x2c')](_0x6130('0x56'),_0x529977);throw _0x529977;});}return _0x138ade;})[_0x6130('0x2b')](respondWithResult(_0x35939b,0xc9))['catch'](handleError(_0x35939b,null));};exports['update']=function(_0x49452c,_0x5c8e26){if(_0x49452c[_0x6130('0x4f')]['id']){delete _0x49452c[_0x6130('0x4f')]['id'];}return db[_0x6130('0x32')][_0x6130('0x4c')]({'where':{'id':_0x49452c[_0x6130('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c8e26,null))[_0x6130('0x2b')](saveUpdates(_0x49452c[_0x6130('0x4f')],null))['then'](respondWithResult(_0x5c8e26,null))[_0x6130('0x4d')](handleError(_0x5c8e26,null));};exports[_0x6130('0x57')]=function(_0x36700f,_0x32bf20){return db[_0x6130('0x32')][_0x6130('0x4c')]({'where':{'id':_0x36700f[_0x6130('0x49')]['id']}})[_0x6130('0x2b')](handleEntityNotFound(_0x32bf20,null))['then'](removeEntity(_0x32bf20,null))[_0x6130('0x4d')](handleError(_0x32bf20,null));}; \ No newline at end of file +var _0xb821=['create','body','user','get','role','Tags','find','catch','update','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','include','findAll','show','params','keys','includeAll','options'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb821,0xa7));var _0x1b82=function(_0x3460ff,_0x6fd64c){_0x3460ff=_0x3460ff-0x0;var _0xb9d863=_0xb821[_0x3460ff];return _0xb9d863;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];function respondWithStatusCode(_0x241d11,_0x2391f5){_0x2391f5=_0x2391f5||0xcc;return function(_0x61b6eb){if(_0x61b6eb){return _0x241d11['sendStatus'](_0x2391f5);}return _0x241d11[_0x1b82('0x18')](_0x2391f5)['end']();};}function respondWithResult(_0x54915f,_0x1e553a){_0x1e553a=_0x1e553a||0xc8;return function(_0x4bf75b){if(_0x4bf75b){return _0x54915f[_0x1b82('0x18')](_0x1e553a)[_0x1b82('0x19')](_0x4bf75b);}};}function respondWithFilteredResult(_0x5d4cf1,_0x46c2cf){return function(_0x5dab7d){if(_0x5dab7d){var _0x563261=typeof _0x46c2cf[_0x1b82('0x1a')]==='undefined'&&typeof _0x46c2cf[_0x1b82('0x1b')]===_0x1b82('0x1c');var _0xf42818=_0x5dab7d['count'];var _0x514082=_0x563261?0x0:_0x46c2cf[_0x1b82('0x1a')];var _0x5d66c3=_0x563261?_0x5dab7d[_0x1b82('0x1d')]:_0x46c2cf[_0x1b82('0x1a')]+_0x46c2cf[_0x1b82('0x1b')];var _0x594a63;if(_0x5d66c3>=_0xf42818){_0x5d66c3=_0xf42818;_0x594a63=0xc8;}else{_0x594a63=0xce;}_0x5d4cf1[_0x1b82('0x18')](_0x594a63);return _0x5d4cf1[_0x1b82('0x1e')](_0x1b82('0x1f'),_0x514082+'-'+_0x5d66c3+'/'+_0xf42818)[_0x1b82('0x19')](_0x5dab7d);}return null;};}function patchUpdates(_0x10d45c){return function(_0x47e99b){try{jsonpatch[_0x1b82('0x20')](_0x47e99b,_0x10d45c,!![]);}catch(_0x1892b0){return BPromise[_0x1b82('0x21')](_0x1892b0);}return _0x47e99b[_0x1b82('0x22')]();};}function saveUpdates(_0x26e481,_0x31fd64){return function(_0x2d07f4){if(_0x2d07f4){return _0x2d07f4['update'](_0x26e481)[_0x1b82('0x23')](function(_0x233740){return _0x233740;});}return null;};}function removeEntity(_0x5b8d09,_0x561d78){return function(_0x225b81){if(_0x225b81){return _0x225b81[_0x1b82('0x24')]()['then'](function(){var _0x3a1226=_0x225b81['get']({'plain':!![]});var _0x5cd458='Tags';return db[_0x1b82('0x25')][_0x1b82('0x24')]({'where':{'type':_0x5cd458,'resourceId':_0x3a1226['id']}})[_0x1b82('0x23')](function(){return _0x225b81;});})[_0x1b82('0x23')](function(){_0x5b8d09['status'](0xcc)[_0x1b82('0x26')]();});}};}function handleEntityNotFound(_0x165b45,_0x1b5260){return function(_0x7455e8){if(!_0x7455e8){_0x165b45[_0x1b82('0x27')](0x194);}return _0x7455e8;};}function handleError(_0x1b8b6f,_0x223b6a){_0x223b6a=_0x223b6a||0x1f4;return function(_0x21ea34){logger[_0x1b82('0x28')](_0x21ea34[_0x1b82('0x29')]);if(_0x21ea34[_0x1b82('0x2a')]){delete _0x21ea34[_0x1b82('0x2a')];}_0x1b8b6f[_0x1b82('0x18')](_0x223b6a)['send'](_0x21ea34);};}exports[_0x1b82('0x2b')]=function(_0x2931d0,_0x155a34){var _0x457dbb={},_0x18e4ff={},_0x115ce7={'count':0x0,'rows':[]};var _0xd3c4a=_[_0x1b82('0x2c')](db[_0x1b82('0x2d')][_0x1b82('0x2e')],function(_0x501ab0){return{'name':_0x501ab0[_0x1b82('0x2f')],'type':_0x501ab0[_0x1b82('0x30')][_0x1b82('0x31')]};});_0x18e4ff[_0x1b82('0x32')]=_['map'](_0xd3c4a,_0x1b82('0x2a'));_0x18e4ff[_0x1b82('0x33')]=_['keys'](_0x2931d0[_0x1b82('0x33')]);_0x18e4ff[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x18e4ff['model'],_0x18e4ff['query']);_0x457dbb[_0x1b82('0x36')]=_['intersection'](_0x18e4ff['model'],qs[_0x1b82('0x37')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x37')]));_0x457dbb['attributes']=_0x457dbb[_0x1b82('0x36')][_0x1b82('0x38')]?_0x457dbb[_0x1b82('0x36')]:_0x18e4ff[_0x1b82('0x32')];if(!_0x2931d0['query'][_0x1b82('0x39')](_0x1b82('0x3a'))){_0x457dbb[_0x1b82('0x1b')]=qs['limit'](_0x2931d0['query'][_0x1b82('0x1b')]);_0x457dbb['offset']=qs[_0x1b82('0x1a')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x1a')]);}_0x457dbb[_0x1b82('0x3b')]=qs[_0x1b82('0x3c')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x3c')]);_0x457dbb[_0x1b82('0x3d')]=qs['filters'](_['pick'](_0x2931d0[_0x1b82('0x33')],_0x18e4ff['filters']),_0xd3c4a);if(_0x2931d0[_0x1b82('0x33')]['filter']){_0x457dbb[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x457dbb[_0x1b82('0x3d')],{'$or':_[_0x1b82('0x2c')](_0xd3c4a,function(_0x2af0bd){if(_0x2af0bd[_0x1b82('0x30')]!=='VIRTUAL'){var _0x17d214={};_0x17d214[_0x2af0bd['name']]={'$like':'%'+_0x2931d0[_0x1b82('0x33')]['filter']+'%'};return _0x17d214;}})});}_0x457dbb=_[_0x1b82('0x3e')]({},_0x457dbb,_0x2931d0['options']);var _0x5aeac1={'where':_0x457dbb[_0x1b82('0x3d')]};return db[_0x1b82('0x2d')][_0x1b82('0x1d')](_0x5aeac1)[_0x1b82('0x23')](function(_0x3eb429){_0x115ce7['count']=_0x3eb429;if(_0x2931d0[_0x1b82('0x33')]['includeAll']){_0x457dbb[_0x1b82('0x3f')]=[{'all':!![]}];}return db[_0x1b82('0x2d')][_0x1b82('0x40')](_0x457dbb);})[_0x1b82('0x23')](function(_0x365ab4){_0x115ce7['rows']=_0x365ab4;return _0x115ce7;})[_0x1b82('0x23')](respondWithFilteredResult(_0x155a34,_0x457dbb))['catch'](handleError(_0x155a34,null));};exports[_0x1b82('0x41')]=function(_0x14b3ab,_0x5a50ba){var _0xa88eb2={'raw':!![],'where':{'id':_0x14b3ab[_0x1b82('0x42')]['id']}},_0x225f6b={};_0x225f6b[_0x1b82('0x32')]=_[_0x1b82('0x43')](db[_0x1b82('0x2d')][_0x1b82('0x2e')]);_0x225f6b['query']=_[_0x1b82('0x43')](_0x14b3ab['query']);_0x225f6b[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],_0x225f6b[_0x1b82('0x33')]);_0xa88eb2[_0x1b82('0x36')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],qs[_0x1b82('0x37')](_0x14b3ab[_0x1b82('0x33')][_0x1b82('0x37')]));_0xa88eb2[_0x1b82('0x36')]=_0xa88eb2[_0x1b82('0x36')][_0x1b82('0x38')]?_0xa88eb2[_0x1b82('0x36')]:_0x225f6b['model'];if(_0x14b3ab['query'][_0x1b82('0x44')]){_0xa88eb2['include']=[{'all':!![]}];}_0xa88eb2=_[_0x1b82('0x3e')]({},_0xa88eb2,_0x14b3ab[_0x1b82('0x45')]);return db[_0x1b82('0x2d')]['find'](_0xa88eb2)[_0x1b82('0x23')](handleEntityNotFound(_0x5a50ba,null))['then'](respondWithResult(_0x5a50ba,null))['catch'](handleError(_0x5a50ba,null));};exports[_0x1b82('0x46')]=function(_0x2aadf7,_0x242324){return db['Tag'][_0x1b82('0x46')](_0x2aadf7[_0x1b82('0x47')],{})['then'](function(_0x5ca898){var _0x106282=_0x2aadf7[_0x1b82('0x48')][_0x1b82('0x49')]({'plain':!![]});if(!_0x106282)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x106282[_0x1b82('0x4a')]===_0x1b82('0x48')){var _0x31fb5d=_0x5ca898[_0x1b82('0x49')]({'plain':!![]});var _0xbba448=_0x1b82('0x4b');return db['UserProfileSection'][_0x1b82('0x4c')]({'where':{'name':_0xbba448,'userProfileId':_0x106282['userProfileId']},'raw':!![]})[_0x1b82('0x23')](function(_0x247cb7){if(_0x247cb7&&_0x247cb7['autoAssociation']===0x0){return db[_0x1b82('0x25')]['create']({'name':_0x31fb5d[_0x1b82('0x2a')],'resourceId':_0x31fb5d['id'],'type':_0x247cb7[_0x1b82('0x2a')],'sectionId':_0x247cb7['id']},{})[_0x1b82('0x23')](function(){return _0x5ca898;});}else{return _0x5ca898;}})[_0x1b82('0x4d')](function(_0xd46842){logger[_0x1b82('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd46842);throw _0xd46842;});}return _0x5ca898;})['then'](respondWithResult(_0x242324,0xc9))[_0x1b82('0x4d')](handleError(_0x242324,null));};exports[_0x1b82('0x4e')]=function(_0x1b9e81,_0x26c1ec){if(_0x1b9e81[_0x1b82('0x47')]['id']){delete _0x1b9e81[_0x1b82('0x47')]['id'];}return db[_0x1b82('0x2d')][_0x1b82('0x4c')]({'where':{'id':_0x1b9e81['params']['id']}})['then'](handleEntityNotFound(_0x26c1ec,null))['then'](saveUpdates(_0x1b9e81[_0x1b82('0x47')],null))[_0x1b82('0x23')](respondWithResult(_0x26c1ec,null))[_0x1b82('0x4d')](handleError(_0x26c1ec,null));};exports[_0x1b82('0x24')]=function(_0x1eb4a4,_0x15b0d3){return db[_0x1b82('0x2d')]['find']({'where':{'id':_0x1eb4a4[_0x1b82('0x42')]['id']}})[_0x1b82('0x23')](handleEntityNotFound(_0x15b0d3,null))[_0x1b82('0x23')](removeEntity(_0x15b0d3,null))[_0x1b82('0x4d')](handleError(_0x15b0d3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 287fc03..88dc08d 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 _0xd071=['path','rimraf','../../config/environment','./tag.attributes','define','util','../../config/logger','bluebird','request-promise'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xd071,0x10a));var _0x1d07=function(_0x699cc0,_0x3f6c79){_0x699cc0=_0x699cc0-0x0;var _0x12d120=_0xd071[_0x699cc0];return _0x12d120;};'use strict';var _=require('lodash');var util=require(_0x1d07('0x0'));var logger=require(_0x1d07('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1d07('0x2'));var rp=require(_0x1d07('0x3'));var fs=require('fs');var path=require(_0x1d07('0x4'));var rimraf=require(_0x1d07('0x5'));var config=require(_0x1d07('0x6'));var attributes=require(_0x1d07('0x7'));module['exports']=function(_0x5efd22,_0x76bda0){return _0x5efd22[_0x1d07('0x8')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0625=['define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports'];(function(_0x51b6b6,_0x440d8e){var _0x104a9b=function(_0x5748bd){while(--_0x5748bd){_0x51b6b6['push'](_0x51b6b6['shift']());}};_0x104a9b(++_0x440d8e);}(_0x0625,0xac));var _0x5062=function(_0x19bdc5,_0x2e6eb7){_0x19bdc5=_0x19bdc5-0x0;var _0x2d0a4c=_0x0625[_0x19bdc5];return _0x2d0a4c;};'use strict';var _=require('lodash');var util=require(_0x5062('0x0'));var logger=require(_0x5062('0x1'))(_0x5062('0x2'));var moment=require(_0x5062('0x3'));var BPromise=require(_0x5062('0x4'));var rp=require(_0x5062('0x5'));var fs=require('fs');var path=require(_0x5062('0x6'));var rimraf=require('rimraf');var config=require(_0x5062('0x7'));var attributes=require(_0x5062('0x8'));module[_0x5062('0x9')]=function(_0x1cb494,_0xd2f24){return _0x1cb494[_0x5062('0xa')](_0x5062('0xb'),attributes,{'tableName':_0x5062('0xc'),'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 c46e07b..325c8ea 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 _0x0f9f=['message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x445432,_0x2f89ce){var _0x574531=function(_0x141043){while(--_0x141043){_0x445432['push'](_0x445432['shift']());}};_0x574531(++_0x2f89ce);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x0f9f[_0x595013];return _0x2a29e3;};'use strict';var _=require('lodash');var util=require(_0xf0f9('0x0'));var moment=require(_0xf0f9('0x1'));var BPromise=require(_0xf0f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0f9('0x3'));var db=require(_0xf0f9('0x4'))['db'];var utils=require(_0xf0f9('0x5'));var logger=require(_0xf0f9('0x6'))(_0xf0f9('0x7'));var config=require(_0xf0f9('0x8'));var jayson=require(_0xf0f9('0x9'));var client=jayson[_0xf0f9('0xa')][_0xf0f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45694e,_0x51a0ed,_0x448cf5){return new BPromise(function(_0x294b42,_0x5d1753){return client[_0xf0f9('0xc')](_0x45694e,_0x448cf5)[_0xf0f9('0xd')](function(_0x2d72c9){logger['info'](_0xf0f9('0xe'),_0x51a0ed,_0xf0f9('0xf'));logger[_0xf0f9('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x51a0ed,'request\x20sent',JSON[_0xf0f9('0x11')](_0x2d72c9));if(_0x2d72c9[_0xf0f9('0x12')]){if(_0x2d72c9[_0xf0f9('0x12')][_0xf0f9('0x13')]===0x1f4){logger[_0xf0f9('0x12')](_0xf0f9('0xe'),_0x51a0ed,_0x2d72c9[_0xf0f9('0x12')]['message']);return _0x5d1753(_0x2d72c9[_0xf0f9('0x12')][_0xf0f9('0x14')]);}logger[_0xf0f9('0x12')](_0xf0f9('0xe'),_0x51a0ed,_0x2d72c9[_0xf0f9('0x12')]['message']);return _0x294b42(_0x2d72c9[_0xf0f9('0x12')][_0xf0f9('0x14')]);}else{logger[_0xf0f9('0x15')](_0xf0f9('0xe'),_0x51a0ed,_0xf0f9('0xf'));_0x294b42(_0x2d72c9[_0xf0f9('0x16')][_0xf0f9('0x14')]);}})[_0xf0f9('0x17')](function(_0x677b32){logger[_0xf0f9('0x12')]('Tag,\x20%s,\x20%s',_0x51a0ed,_0x677b32);_0x5d1753(_0x677b32);});});} \ No newline at end of file +var _0x4c6d=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x3f3aeb,_0x11a45b){var _0x2b3499=function(_0x47e1c3){while(--_0x47e1c3){_0x3f3aeb['push'](_0x3f3aeb['shift']());}};_0x2b3499(++_0x11a45b);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xc7694b,_0x24ed38){_0xc7694b=_0xc7694b-0x0;var _0x5ae867=_0x4c6d[_0xc7694b];return _0x5ae867;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e8f6e7e..e136592 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 75c3101..73cf22f 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a78c1d6..5422ba8 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 _0xdef5=['ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Sms','Openchannel','Whatsapp','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','spread','Mail','removeAgents','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','status','end','offset','set','Content-Range','json','reject','save','sendStatus','stack','name','index','map','Team','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','options','count','then','include','rows','catch','show','params','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','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','UserProfileResource','send','getQueues','channel','capitalize','toLowerCase','Queue','length','Queues','isValidChannel','ValidationError','Unknown\x20channel'];(function(_0x4dde94,_0x52b903){var _0x30acf7=function(_0x2d0ead){while(--_0x2d0ead){_0x4dde94['push'](_0x4dde94['shift']());}};_0x30acf7(++_0x52b903);}(_0xdef5,0x152));var _0x5def=function(_0x2e7667,_0x154d3a){_0x2e7667=_0x2e7667-0x0;var _0x9219ab=_0xdef5[_0x2e7667];return _0x9219ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5def('0x0'));var zipdir=require(_0x5def('0x1'));var jsonpatch=require(_0x5def('0x2'));var rp=require(_0x5def('0x3'));var moment=require('moment');var BPromise=require(_0x5def('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5def('0x5'));var csv=require('to-csv');var ejs=require(_0x5def('0x6'));var fs=require('fs');var fs_extra=require(_0x5def('0x7'));var _=require(_0x5def('0x8'));var squel=require(_0x5def('0x9'));var crypto=require(_0x5def('0xa'));var jsforce=require(_0x5def('0xb'));var deskjs=require(_0x5def('0xc'));var toCsv=require(_0x5def('0xd'));var querystring=require(_0x5def('0xe'));var Papa=require(_0x5def('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5def('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5def('0x11'));var logger=require(_0x5def('0x12'))(_0x5def('0x13'));var utils=require(_0x5def('0x14'));var config=require(_0x5def('0x15'));var licenseUtil=require(_0x5def('0x16'));var db=require(_0x5def('0x17'))['db'];config[_0x5def('0x18')]=_[_0x5def('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5def('0x1a'))(new Redis(config[_0x5def('0x18')]));require(_0x5def('0x1b'))['register'](socket);function respondWithStatusCode(_0x6e22f5,_0x235279){_0x235279=_0x235279||0xcc;return function(_0x4eaead){if(_0x4eaead){return _0x6e22f5['sendStatus'](_0x235279);}return _0x6e22f5[_0x5def('0x1c')](_0x235279)[_0x5def('0x1d')]();};}function respondWithResult(_0x2560a1,_0x1d4a72){_0x1d4a72=_0x1d4a72||0xc8;return function(_0xe6032f){if(_0xe6032f){return _0x2560a1[_0x5def('0x1c')](_0x1d4a72)['json'](_0xe6032f);}};}function respondWithFilteredResult(_0x497e0a,_0x634d33){return function(_0x1578ce){if(_0x1578ce){var _0x4ca19f=typeof _0x634d33[_0x5def('0x1e')]==='undefined'&&typeof _0x634d33['limit']==='undefined';var _0x445299=_0x1578ce['count'];var _0x2a1971=_0x4ca19f?0x0:_0x634d33[_0x5def('0x1e')];var _0x2c3bcb=_0x4ca19f?_0x1578ce['count']:_0x634d33[_0x5def('0x1e')]+_0x634d33['limit'];var _0x46c8b6;if(_0x2c3bcb>=_0x445299){_0x2c3bcb=_0x445299;_0x46c8b6=0xc8;}else{_0x46c8b6=0xce;}_0x497e0a[_0x5def('0x1c')](_0x46c8b6);return _0x497e0a[_0x5def('0x1f')](_0x5def('0x20'),_0x2a1971+'-'+_0x2c3bcb+'/'+_0x445299)[_0x5def('0x21')](_0x1578ce);}return null;};}function patchUpdates(_0x3ec3e8){return function(_0x2b49f7){try{jsonpatch['apply'](_0x2b49f7,_0x3ec3e8,!![]);}catch(_0x75e2e6){return BPromise[_0x5def('0x22')](_0x75e2e6);}return _0x2b49f7[_0x5def('0x23')]();};}function saveUpdates(_0x43c754,_0x3e4098){return function(_0x3c3f2d){if(_0x3c3f2d){return _0x3c3f2d['update'](_0x43c754)['then'](function(_0xbbbae1){return _0xbbbae1;});}return null;};}function handleEntityNotFound(_0x5ce2af,_0x1e692f){return function(_0x514704){if(!_0x514704){_0x5ce2af[_0x5def('0x24')](0x194);}return _0x514704;};}function handleError(_0x5f0aa3,_0x49ded3){_0x49ded3=_0x49ded3||0x1f4;return function(_0x5efc54){logger['error'](_0x5efc54[_0x5def('0x25')]);if(_0x5efc54[_0x5def('0x26')]){delete _0x5efc54[_0x5def('0x26')];}_0x5f0aa3[_0x5def('0x1c')](_0x49ded3)['send'](_0x5efc54);};}exports[_0x5def('0x27')]=function(_0x49d631,_0x3bddbc){var _0x10032c={},_0x39b8ee={},_0x593ef1={'count':0x0,'rows':[]};var _0x823ccf=_[_0x5def('0x28')](db[_0x5def('0x29')][_0x5def('0x2a')],function(_0x11ccda){return{'name':_0x11ccda[_0x5def('0x2b')],'type':_0x11ccda['type'][_0x5def('0x2c')]};});_0x39b8ee[_0x5def('0x2d')]=_[_0x5def('0x28')](_0x823ccf,_0x5def('0x26'));_0x39b8ee[_0x5def('0x2e')]=_[_0x5def('0x2f')](_0x49d631[_0x5def('0x2e')]);_0x39b8ee[_0x5def('0x30')]=_['intersection'](_0x39b8ee[_0x5def('0x2d')],_0x39b8ee['query']);_0x10032c[_0x5def('0x31')]=_[_0x5def('0x32')](_0x39b8ee[_0x5def('0x2d')],qs[_0x5def('0x33')](_0x49d631[_0x5def('0x2e')][_0x5def('0x33')]));_0x10032c['attributes']=_0x10032c[_0x5def('0x31')]['length']?_0x10032c['attributes']:_0x39b8ee[_0x5def('0x2d')];if(!_0x49d631[_0x5def('0x2e')][_0x5def('0x34')](_0x5def('0x35'))){_0x10032c[_0x5def('0x36')]=qs[_0x5def('0x36')](_0x49d631[_0x5def('0x2e')][_0x5def('0x36')]);_0x10032c[_0x5def('0x1e')]=qs[_0x5def('0x1e')](_0x49d631[_0x5def('0x2e')]['offset']);}_0x10032c[_0x5def('0x37')]=qs[_0x5def('0x38')](_0x49d631[_0x5def('0x2e')][_0x5def('0x38')]);_0x10032c['where']=qs[_0x5def('0x30')](_[_0x5def('0x39')](_0x49d631[_0x5def('0x2e')],_0x39b8ee['filters']),_0x823ccf);if(_0x49d631['query'][_0x5def('0x3a')]){_0x10032c['where']=_[_0x5def('0x3b')](_0x10032c[_0x5def('0x3c')],{'$or':_[_0x5def('0x28')](_0x823ccf,function(_0x412ed9){if(_0x412ed9[_0x5def('0x3d')]!=='VIRTUAL'){var _0x2e2ae7={};_0x2e2ae7[_0x412ed9[_0x5def('0x26')]]={'$like':'%'+_0x49d631[_0x5def('0x2e')][_0x5def('0x3a')]+'%'};return _0x2e2ae7;}})});}_0x10032c=_[_0x5def('0x3b')]({},_0x10032c,_0x49d631[_0x5def('0x3e')]);var _0x2aab5e={'where':_0x10032c['where']};return db[_0x5def('0x29')][_0x5def('0x3f')](_0x2aab5e)[_0x5def('0x40')](function(_0x1a7f02){_0x593ef1[_0x5def('0x3f')]=_0x1a7f02;if(_0x49d631['query']['includeAll']){_0x10032c[_0x5def('0x41')]=[{'all':!![]}];}return db['Team']['findAll'](_0x10032c);})[_0x5def('0x40')](function(_0x2e4340){_0x593ef1[_0x5def('0x42')]=_0x2e4340;return _0x593ef1;})[_0x5def('0x40')](respondWithFilteredResult(_0x3bddbc,_0x10032c))[_0x5def('0x43')](handleError(_0x3bddbc,null));};exports[_0x5def('0x44')]=function(_0x1d202c,_0x506e4a){var _0x3f4b87={'raw':![],'where':{'id':_0x1d202c[_0x5def('0x45')]['id']}},_0x4b473c={};_0x4b473c['model']=_[_0x5def('0x2f')](db[_0x5def('0x29')]['rawAttributes']);_0x4b473c[_0x5def('0x2e')]=_[_0x5def('0x2f')](_0x1d202c[_0x5def('0x2e')]);_0x4b473c[_0x5def('0x30')]=_[_0x5def('0x32')](_0x4b473c[_0x5def('0x2d')],_0x4b473c['query']);_0x3f4b87[_0x5def('0x31')]=_[_0x5def('0x32')](_0x4b473c[_0x5def('0x2d')],qs[_0x5def('0x33')](_0x1d202c[_0x5def('0x2e')][_0x5def('0x33')]));_0x3f4b87[_0x5def('0x31')]=_0x3f4b87[_0x5def('0x31')]['length']?_0x3f4b87[_0x5def('0x31')]:_0x4b473c[_0x5def('0x2d')];if(_0x1d202c[_0x5def('0x2e')][_0x5def('0x46')]){_0x3f4b87['include']=[{'all':!![]}];}_0x3f4b87=_[_0x5def('0x3b')]({},_0x3f4b87,_0x1d202c['options']);return db['Team'][_0x5def('0x47')](_0x3f4b87)['then'](handleEntityNotFound(_0x506e4a,null))[_0x5def('0x40')](respondWithResult(_0x506e4a,null))[_0x5def('0x43')](handleError(_0x506e4a,null));};exports[_0x5def('0x48')]=function(_0x46f5ac,_0x140737){return db['Team']['create'](_0x46f5ac['body'],{})[_0x5def('0x40')](function(_0x481dba){var _0x28679d=_0x46f5ac[_0x5def('0x49')][_0x5def('0x4a')]({'plain':!![]});if(!_0x28679d)throw new Error(_0x5def('0x4b'));if(_0x28679d[_0x5def('0x4c')]===_0x5def('0x49')){var _0xdc532b=_0x481dba[_0x5def('0x4a')]({'plain':!![]});var _0x529754=_0x5def('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x529754,'userProfileId':_0x28679d[_0x5def('0x4e')]},'raw':!![]})['then'](function(_0x5a71a2){if(_0x5a71a2&&_0x5a71a2[_0x5def('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0xdc532b[_0x5def('0x26')],'resourceId':_0xdc532b['id'],'type':_0x5a71a2[_0x5def('0x26')],'sectionId':_0x5a71a2['id']},{})[_0x5def('0x40')](function(){return _0x481dba;});}else{return _0x481dba;}})[_0x5def('0x43')](function(_0x5e5203){logger[_0x5def('0x50')](_0x5def('0x51'),_0x5e5203);throw _0x5e5203;});}return _0x481dba;})[_0x5def('0x40')](respondWithResult(_0x140737,0xc9))[_0x5def('0x43')](handleError(_0x140737,null));};exports[_0x5def('0x52')]=function(_0x5c2f90,_0x2c8e44){if(_0x5c2f90[_0x5def('0x53')]['id']){delete _0x5c2f90[_0x5def('0x53')]['id'];}return db[_0x5def('0x29')][_0x5def('0x47')]({'where':{'id':_0x5c2f90[_0x5def('0x45')]['id']}})[_0x5def('0x40')](handleEntityNotFound(_0x2c8e44,null))[_0x5def('0x40')](saveUpdates(_0x5c2f90[_0x5def('0x53')],null))[_0x5def('0x40')](respondWithResult(_0x2c8e44,null))['catch'](handleError(_0x2c8e44,null));};exports['destroy']=function(_0x52b311,_0x2e0793){var _0x192f77=_0x52b311[_0x5def('0x45')]['id'];var _0x4989ff=[];return db[_0x5def('0x54')][_0x5def('0x55')](function(_0x152f12){var _0x1e544a=_0x5def('0x56')+_0x192f77;return db[_0x5def('0x54')][_0x5def('0x2e')](_0x1e544a,{'type':db[_0x5def('0x57')][_0x5def('0x58')][_0x5def('0x59')],'raw':!![],'transaction':_0x152f12})[_0x5def('0x40')](function(_0x5c3bbb){_0x4989ff=_[_0x5def('0x28')](_0x5c3bbb,function(_0x8b2a4f){return Number(_0x8b2a4f['UserId']);});})[_0x5def('0x40')](function(){var _0x513bd6='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x192f77;return db[_0x5def('0x54')][_0x5def('0x2e')](_0x513bd6,{'type':db[_0x5def('0x57')][_0x5def('0x58')][_0x5def('0x59')],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x1fc00b){var _0x48d83f=_[_0x5def('0x28')](_0x1fc00b,function(_0xfdfe83){return Number(_0xfdfe83[_0x5def('0x5a')]);});return db[_0x5def('0x5b')][_0x5def('0x5c')]({'where':{'UserId':{'$in':_0x4989ff},'VoiceQueueId':{'$in':_0x48d83f}},'transaction':_0x152f12});})[_0x5def('0x40')](function(){var _0x5d4eed=_0x5def('0x5d')+_0x192f77;return db[_0x5def('0x54')]['query'](_0x5d4eed,{'type':db['Sequelize']['QueryTypes'][_0x5def('0x59')],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x2e15ad){var _0x4d2bec=_[_0x5def('0x28')](_0x2e15ad,function(_0xacc80d){return Number(_0xacc80d['MailQueueId']);});return db[_0x5def('0x5e')][_0x5def('0x5c')]({'where':{'UserId':{'$in':_0x4989ff},'MailQueueId':{'$in':_0x4d2bec}},'transaction':_0x152f12});})[_0x5def('0x40')](function(){var _0x3d0f56=_0x5def('0x5f')+_0x192f77;return db['sequelize'][_0x5def('0x2e')](_0x3d0f56,{'type':db[_0x5def('0x57')][_0x5def('0x58')][_0x5def('0x59')],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x34243f){var _0x458ec6=_[_0x5def('0x28')](_0x34243f,function(_0x126b25){return Number(_0x126b25[_0x5def('0x60')]);});return db['UserSmsQueue'][_0x5def('0x5c')]({'where':{'UserId':{'$in':_0x4989ff},'SmsQueueId':{'$in':_0x458ec6}},'transaction':_0x152f12});})[_0x5def('0x40')](function(){var _0x2a98cb=_0x5def('0x61')+_0x192f77;return db[_0x5def('0x54')][_0x5def('0x2e')](_0x2a98cb,{'type':db[_0x5def('0x57')]['QueryTypes'][_0x5def('0x59')],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x813e48){var _0x3a2077=_['map'](_0x813e48,function(_0x3d56d0){return Number(_0x3d56d0[_0x5def('0x62')]);});return db['UserChatQueue'][_0x5def('0x5c')]({'where':{'UserId':{'$in':_0x4989ff},'ChatQueueId':{'$in':_0x3a2077}},'transaction':_0x152f12});})[_0x5def('0x40')](function(){var _0x25db55=_0x5def('0x63')+_0x192f77;return db[_0x5def('0x54')][_0x5def('0x2e')](_0x25db55,{'type':db['Sequelize']['QueryTypes'][_0x5def('0x59')],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x392bdd){var _0xa4ac8f=_['map'](_0x392bdd,function(_0x15ce64){return Number(_0x15ce64['FaxQueueId']);});return db['UserFaxQueue'][_0x5def('0x5c')]({'where':{'UserId':{'$in':_0x4989ff},'FaxQueueId':{'$in':_0xa4ac8f}},'transaction':_0x152f12});})[_0x5def('0x40')](function(){var _0x3e1d6a=_0x5def('0x64')+_0x192f77;return db['sequelize'][_0x5def('0x2e')](_0x3e1d6a,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x3520c2){var _0x39f2ef=_[_0x5def('0x28')](_0x3520c2,function(_0x1d470b){return Number(_0x1d470b[_0x5def('0x65')]);});return db[_0x5def('0x66')][_0x5def('0x5c')]({'where':{'UserId':{'$in':_0x4989ff},'OpenchannelQueueId':{'$in':_0x39f2ef}},'transaction':_0x152f12});})['then'](function(){var _0x50fc26=_0x5def('0x67')+_0x192f77;return db[_0x5def('0x54')][_0x5def('0x2e')](_0x50fc26,{'type':db[_0x5def('0x57')][_0x5def('0x58')]['SELECT'],'raw':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x5c04fe){var _0x107856=_[_0x5def('0x28')](_0x5c04fe,function(_0xf16afc){return Number(_0xf16afc[_0x5def('0x68')]);});return db[_0x5def('0x69')]['destroy']({'where':{'UserId':{'$in':_0x4989ff},'WhatsappQueueId':{'$in':_0x107856}},'transaction':_0x152f12});})[_0x5def('0x40')](function(){return db[_0x5def('0x6a')][_0x5def('0x47')]({'where':{'TeamId':_0x192f77}});})[_0x5def('0x40')](function(_0x25aef0){if(_0x25aef0===null){return;}return db[_0x5def('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x4989ff},'VoicePrefixId':_0x25aef0[_0x5def('0x6c')]},'transaction':_0x152f12});})[_0x5def('0x40')](function(){return db[_0x5def('0x29')][_0x5def('0x5c')]({'where':{'id':_0x192f77},'cascade':!![],'transaction':_0x152f12});})[_0x5def('0x40')](function(_0x560c25){if(_0x560c25===0x0){_0x2e0793['sendStatus'](0x194);}else{return db[_0x5def('0x6d')][_0x5def('0x5c')]({'where':{'type':_0x5def('0x4d'),'resourceId':_0x192f77},'cascade':!![],'transaction':_0x152f12})[_0x5def('0x40')](function(){_0x2e0793[_0x5def('0x1c')](0xcc)['end']();});}})[_0x5def('0x43')](function(_0x456ed0){_0x2e0793[_0x5def('0x1c')](0x1f4)[_0x5def('0x6e')](_0x456ed0);});});};exports[_0x5def('0x6f')]=function(_0x2a2406,_0x4482fe,_0x290c50){return db[_0x5def('0x29')]['findOne']({'where':{'id':_0x2a2406['params']['id']}})['then'](handleEntityNotFound(_0x4482fe,null))[_0x5def('0x40')](function(_0x347183){if(!_0x2a2406[_0x5def('0x2e')][_0x5def('0x70')]||!utils['isValidChannel'](_0x2a2406['query'][_0x5def('0x70')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x1098cd={};var _0x3ce2ba={};_0x3ce2ba[_0x5def('0x2d')]=_[_0x5def('0x2f')](db[_[_0x5def('0x71')](_0x2a2406[_0x5def('0x2e')][_0x5def('0x70')][_0x5def('0x72')]())+_0x5def('0x73')][_0x5def('0x2a')]);_0x3ce2ba['query']=_[_0x5def('0x2f')](_0x2a2406[_0x5def('0x2e')]);_0x3ce2ba[_0x5def('0x30')]=_[_0x5def('0x32')](_0x3ce2ba[_0x5def('0x2d')],_0x3ce2ba[_0x5def('0x2e')]);_0x1098cd[_0x5def('0x31')]=_[_0x5def('0x32')](_0x3ce2ba[_0x5def('0x2d')],qs[_0x5def('0x33')](_0x2a2406[_0x5def('0x2e')][_0x5def('0x33')]));_0x1098cd[_0x5def('0x31')]=_0x1098cd[_0x5def('0x31')][_0x5def('0x74')]?_0x1098cd[_0x5def('0x31')]:_0x3ce2ba[_0x5def('0x2d')];_0x1098cd[_0x5def('0x36')]=qs[_0x5def('0x36')](_0x2a2406[_0x5def('0x2e')][_0x5def('0x36')]);_0x1098cd['offset']=qs[_0x5def('0x1e')](_0x2a2406[_0x5def('0x2e')][_0x5def('0x1e')]);_0x1098cd[_0x5def('0x37')]=qs[_0x5def('0x38')](_0x2a2406[_0x5def('0x2e')][_0x5def('0x38')]);_0x1098cd['where']=qs[_0x5def('0x30')](_['pick'](_0x2a2406['query'],_0x3ce2ba['filters']));_0x1098cd=_[_0x5def('0x3b')]({},_0x1098cd,_0x2a2406[_0x5def('0x3e')]);return _0x347183[_0x5def('0x4a')+_[_0x5def('0x71')](_0x2a2406[_0x5def('0x2e')][_0x5def('0x70')][_0x5def('0x72')]())+_0x5def('0x75')](_0x1098cd);})[_0x5def('0x40')](respondWithResult(_0x4482fe,null))['catch'](handleError(_0x4482fe,null));};exports['addQueues']=function(_0x2efb24,_0x13a4cd,_0x4a6e2f){return db['Team']['findOne']({'where':{'id':_0x2efb24[_0x5def('0x45')]['id']}})[_0x5def('0x40')](function(_0x26ff81){if(_0x26ff81){if(!_0x2efb24['body'][_0x5def('0x70')]||!utils[_0x5def('0x76')](_0x2efb24['body'][_0x5def('0x70')])){throw new db['Sequelize'][(_0x5def('0x77'))](_0x5def('0x78'));}return _0x26ff81['add'+_[_0x5def('0x71')](_0x2efb24[_0x5def('0x53')][_0x5def('0x70')]['toLowerCase']())+'Queues'](_0x2efb24[_0x5def('0x53')][_0x5def('0x79')]);}return null;})[_0x5def('0x40')](handleEntityNotFound(_0x13a4cd,null))[_0x5def('0x40')](respondWithStatusCode(_0x13a4cd,null))[_0x5def('0x43')](handleError(_0x13a4cd,null));};exports[_0x5def('0x7a')]=function(_0x467990,_0x7de522,_0x2301ac){return db[_0x5def('0x29')][_0x5def('0x7b')]({'where':{'id':_0x467990[_0x5def('0x45')]['id']}})[_0x5def('0x40')](function(_0x45b3f4){if(_0x45b3f4){if(!_0x467990[_0x5def('0x2e')][_0x5def('0x70')]||!utils[_0x5def('0x76')](_0x467990['query']['channel'])){throw new db[(_0x5def('0x57'))][(_0x5def('0x77'))](_0x5def('0x78'));}return _0x45b3f4[_0x5def('0x7c')+_['capitalize'](_0x467990['query'][_0x5def('0x70')][_0x5def('0x72')]())+_0x5def('0x75')](_0x467990[_0x5def('0x2e')][_0x5def('0x79')]);}return null;})[_0x5def('0x40')](handleEntityNotFound(_0x7de522,null))['then'](respondWithStatusCode(_0x7de522,null))[_0x5def('0x43')](handleError(_0x7de522,null));};exports[_0x5def('0x7d')]=function(_0x21b18d,_0x5d7a5f){var _0xa1cce3=_[_0x5def('0x7e')](_0x21b18d['body'][_0x5def('0x79')])?_0x21b18d[_0x5def('0x53')]['ids']:[_0x21b18d[_0x5def('0x53')][_0x5def('0x79')]];var _0x40c844=_0x21b18d['params']['id'];return db['Team'][_0x5def('0x47')]({'where':{'id':_0x40c844}})[_0x5def('0x40')](handleEntityNotFound(_0x5d7a5f,null))[_0x5def('0x40')](function(_0x15fe65){if(_0x15fe65){var _0xe39ad6=[_0x5def('0x7f'),'Chat','Mail',_0x5def('0x80'),'Fax',_0x5def('0x81'),_0x5def('0x82')];return db[_0x5def('0x54')][_0x5def('0x55')](function(_0x9453de){var _0x405692=_[_0x5def('0x28')](_0xe39ad6,function(_0x11b3fb){var _0x5969be={'attributes':['id',_0x5def('0x26')]};if(_0x11b3fb===_0x5def('0x7f')){_0x5969be[_0x5def('0x83')]={'attributes':[_0x5def('0x84')]};}return _0x15fe65[_0x5def('0x4a')+_0x11b3fb+'Queues'](_0x5969be)[_0x5def('0x40')](function(_0xb41bc0){var _0x133d74=_[_0x5def('0x28')](_0xb41bc0,function(_0x464439){var _0x493f1c=_[_0x5def('0x28')](_0xa1cce3,function(_0x5e5e11){var _0xccf618={'where':{'UserId':_0x5e5e11,[_0x11b3fb+_0x5def('0x85')]:_0x464439['id']},'transaction':_0x9453de};if(_0x11b3fb===_0x5def('0x7f')){_0xccf618[_0x5def('0x19')]={'penalty':_0x464439['TeamVoiceQueue']['penalty']};}return db[_0x5def('0x86')+_0x11b3fb+_0x5def('0x73')][_0x5def('0x87')](_0xccf618)['then'](function(){socket[_0x5def('0x88')](_0x5def('0x49')+_0x11b3fb+_0x5def('0x89'),{'UserId':_0x5e5e11,[_0x11b3fb+'QueueId']:_0x464439['id']});if(_0x11b3fb!==_0x5def('0x7f')){return;}return db[_0x5def('0x86')][_0x5def('0x8a')]({'where':{'id':_0xa1cce3,'online':0x1},'attributes':['id',_0x5def('0x26'),_0x5def('0x8b'),_0x5def('0x8c'),_0x5def('0x8d')],'raw':!![]})[_0x5def('0x40')](function(_0x34f291){var _0x4bd24a=_['map'](_0x34f291,function(_0x5945c2){return db[_0x5def('0x8e')][_0x5def('0x8f')]({'membername':_0x5945c2[_0x5def('0x26')],'UserId':_0x5945c2['id'],'queue_name':_0x464439[_0x5def('0x26')],'VoiceQueueId':_0x464439['id'],'interface':_[_0x5def('0x90')](_0x5945c2[_0x5def('0x8d')])?util[_0x5def('0x91')](_0x5def('0x92'),_0x5945c2[_0x5def('0x26')]):_0x5945c2[_0x5def('0x8d')],'paused':_0x5945c2['voicePause']||![],'penalty':_0x464439[_0x5def('0x93')][_0x5def('0x84')]},{'transaction':_0x9453de});});return Promise[_0x5def('0x94')](_0x4bd24a);});});});return Promise[_0x5def('0x94')](_0x493f1c);});return Promise[_0x5def('0x94')](_0x133d74);})[_0x5def('0x40')](function(){return db[_0x5def('0x6a')]['findOne']({'where':{'teamId':_0x40c844}})[_0x5def('0x40')](function(_0x102c90){if(_0x102c90){var _0x34cafa=_[_0x5def('0x28')](_0xa1cce3,function(_0x45df0a){db[_0x5def('0x6b')][_0x5def('0x8f')]({'UserId':_0x45df0a,'VoicePrefixId':_0x102c90[_0x5def('0x6c')]});});return Promise[_0x5def('0x94')](_0x34cafa);}});});});return Promise[_0x5def('0x94')](_0x405692)[_0x5def('0x40')](function(){return _0x15fe65[_0x5def('0x7d')](_0xa1cce3,{'transaction':_0x9453de})[_0x5def('0x95')](function(_0x12dd90){return _0x12dd90;});});});}})['then'](respondWithResult(_0x5d7a5f,null))[_0x5def('0x43')](handleError(_0x5d7a5f,null));};exports['removeAgents']=function(_0x170aa5,_0x9f9251){var _0x50d811=_[_0x5def('0x7e')](_0x170aa5[_0x5def('0x2e')][_0x5def('0x79')])?_0x170aa5[_0x5def('0x2e')][_0x5def('0x79')]:[_0x170aa5[_0x5def('0x2e')][_0x5def('0x79')]];var _0x1b5cc7=_0x170aa5[_0x5def('0x45')]['id'];return db[_0x5def('0x29')][_0x5def('0x47')]({'where':{'id':_0x1b5cc7}})[_0x5def('0x40')](handleEntityNotFound(_0x9f9251,null))[_0x5def('0x40')](function(_0xfcf447){if(_0xfcf447){var _0x50f482=['Voice','Chat',_0x5def('0x96'),_0x5def('0x80'),'Fax',_0x5def('0x81'),_0x5def('0x82')];return db[_0x5def('0x54')]['transaction'](function(_0x4c9148){var _0x26f932=_[_0x5def('0x28')](_0x50f482,function(_0xd53286){var _0x5514f8={'attributes':['id','name']};return _0xfcf447[_0x5def('0x4a')+_0xd53286+_0x5def('0x75')](_0x5514f8)[_0x5def('0x40')](function(_0x136f68){var _0x216bfb=_['map'](_0x136f68,function(_0x2be522){return _0x2be522[_0x5def('0x97')](_0x50d811,{'transaction':_0x4c9148})[_0x5def('0x40')](function(){var _0x2c2c4a=_[_0x5def('0x28')](_0x50d811,function(_0x208565){socket[_0x5def('0x88')](_0x5def('0x49')+_0xd53286+'Queue:remove',{'UserId':Number(_0x208565),[_0xd53286+_0x5def('0x85')]:_0x2be522['id']});if(_0xd53286!==_0x5def('0x7f')){return;}return db[_0x5def('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x2be522['id'],'UserId':_0x208565},'transaction':_0x4c9148});});return Promise[_0x5def('0x94')](_0x2c2c4a);});});return Promise[_0x5def('0x94')](_0x216bfb);});});return Promise[_0x5def('0x94')](_0x26f932)['then'](function(){return _0xfcf447[_0x5def('0x97')](_0x50d811,{'transaction':_0x4c9148});})['then'](function(){return db[_0x5def('0x6a')][_0x5def('0x7b')]({'where':{'teamId':_0x1b5cc7}})['then'](function(_0x403b18){if(_0x403b18){var _0x49aa19=_[_0x5def('0x28')](_0x50d811,function(_0x39d3a0){db['UserVoicePrefix'][_0x5def('0x5c')]({'where':{'UserId':_0x39d3a0,'VoicePrefixId':_0x403b18[_0x5def('0x6c')]}});});return Promise[_0x5def('0x94')](_0x49aa19);}});});});}})['then'](respondWithStatusCode(_0x9f9251,null))[_0x5def('0x43')](handleError(_0x9f9251,null));};exports[_0x5def('0x98')]=function(_0x99c5ed,_0x110da3,_0x4dc101){var _0x34abce={};var _0x31232c={};var _0x3bafce;var _0x1019ee;return db['Team']['findOne']({'where':{'id':_0x99c5ed[_0x5def('0x45')]['id']}})[_0x5def('0x40')](handleEntityNotFound(_0x110da3,null))[_0x5def('0x40')](function(_0x375ba9){if(_0x375ba9){_0x3bafce=_0x375ba9;_0x31232c[_0x5def('0x2d')]=_['keys'](db[_0x5def('0x86')][_0x5def('0x2a')]);_0x31232c[_0x5def('0x2e')]=_[_0x5def('0x2f')](_0x99c5ed[_0x5def('0x2e')]);_0x31232c['filters']=_[_0x5def('0x32')](_0x31232c[_0x5def('0x2d')],_0x31232c['query']);_0x34abce[_0x5def('0x31')]=_[_0x5def('0x32')](_0x31232c[_0x5def('0x2d')],qs['fields'](_0x99c5ed[_0x5def('0x2e')][_0x5def('0x33')]));_0x34abce[_0x5def('0x31')]=_0x34abce[_0x5def('0x31')][_0x5def('0x74')]?_0x34abce[_0x5def('0x31')]:_0x31232c[_0x5def('0x2d')];_0x34abce[_0x5def('0x37')]=qs[_0x5def('0x38')](_0x99c5ed[_0x5def('0x2e')]['sort']);_0x34abce[_0x5def('0x3c')]=qs[_0x5def('0x30')](_[_0x5def('0x39')](_0x99c5ed[_0x5def('0x2e')],_0x31232c[_0x5def('0x30')]));if(_0x99c5ed[_0x5def('0x2e')]['filter']){_0x34abce[_0x5def('0x3c')]=_[_0x5def('0x3b')](_0x34abce['where'],{'$or':_[_0x5def('0x28')](_0x34abce['attributes'],function(_0x7e5518){var _0x45b3f8={};_0x45b3f8[_0x7e5518]={'$like':'%'+_0x99c5ed['query'][_0x5def('0x3a')]+'%'};return _0x45b3f8;})});}_0x34abce=_[_0x5def('0x3b')]({},_0x34abce,_0x99c5ed[_0x5def('0x3e')]);return _0x3bafce[_0x5def('0x98')](_0x34abce);}})[_0x5def('0x40')](function(_0x250e4a){if(_0x250e4a){_0x1019ee=_0x250e4a['length'];if(!_0x99c5ed[_0x5def('0x2e')][_0x5def('0x34')]('nolimit')){_0x34abce[_0x5def('0x36')]=qs['limit'](_0x99c5ed['query']['limit']);_0x34abce[_0x5def('0x1e')]=qs[_0x5def('0x1e')](_0x99c5ed[_0x5def('0x2e')][_0x5def('0x1e')]);}return _0x3bafce[_0x5def('0x98')](_0x34abce);}})[_0x5def('0x40')](function(_0x1bdde5){if(_0x1bdde5){return _0x1bdde5?{'count':_0x1019ee,'rows':_0x1bdde5}:null;}})['then'](respondWithResult(_0x110da3,null))['catch'](handleError(_0x110da3,null));}; \ No newline at end of file +var _0x419d=['length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','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','UserSmsQueue','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','UserVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','add','ids','removeQueues','isValidChannel','remove','capitalize','addAgents','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','online','voicePause','UserVoiceQueueRt','isNil','SIP/%s','interface','all','spread','removeAgents','isArray','Chat','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','intersection','attributes','fields'];(function(_0x5b02db,_0x1f371a){var _0x18ff8c=function(_0x470b9c){while(--_0x470b9c){_0x5b02db['push'](_0x5b02db['shift']());}};_0x18ff8c(++_0x1f371a);}(_0x419d,0x105));var _0xd419=function(_0x12c0b1,_0x1b5fb8){_0x12c0b1=_0x12c0b1-0x0;var _0x10b2ec=_0x419d[_0x12c0b1];return _0x10b2ec;};'use strict';var emlformat=require(_0xd419('0x0'));var rimraf=require(_0xd419('0x1'));var zipdir=require(_0xd419('0x2'));var jsonpatch=require(_0xd419('0x3'));var rp=require(_0xd419('0x4'));var moment=require(_0xd419('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd419('0x6'));var util=require('util');var path=require(_0xd419('0x7'));var sox=require('sox');var csv=require(_0xd419('0x8'));var ejs=require(_0xd419('0x9'));var fs=require('fs');var fs_extra=require(_0xd419('0xa'));var _=require(_0xd419('0xb'));var squel=require('squel');var crypto=require(_0xd419('0xc'));var jsforce=require(_0xd419('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd419('0x8'));var querystring=require('querystring');var Papa=require(_0xd419('0xe'));var Redis=require(_0xd419('0xf'));var authService=require(_0xd419('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd419('0x11'));var hardwareService=require(_0xd419('0x12'));var logger=require(_0xd419('0x13'))(_0xd419('0x14'));var utils=require('../../config/utils');var config=require(_0xd419('0x15'));var licenseUtil=require(_0xd419('0x16'));var db=require(_0xd419('0x17'))['db'];config[_0xd419('0x18')]=_[_0xd419('0x19')](config[_0xd419('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd419('0x1a'))(new Redis(config[_0xd419('0x18')]));require(_0xd419('0x1b'))[_0xd419('0x1c')](socket);function respondWithStatusCode(_0x256267,_0x3853b0){_0x3853b0=_0x3853b0||0xcc;return function(_0x242d25){if(_0x242d25){return _0x256267['sendStatus'](_0x3853b0);}return _0x256267[_0xd419('0x1d')](_0x3853b0)[_0xd419('0x1e')]();};}function respondWithResult(_0x2d1ba5,_0x482c88){_0x482c88=_0x482c88||0xc8;return function(_0x141dbe){if(_0x141dbe){return _0x2d1ba5[_0xd419('0x1d')](_0x482c88)[_0xd419('0x1f')](_0x141dbe);}};}function respondWithFilteredResult(_0x5addfa,_0x4a1343){return function(_0x159a27){if(_0x159a27){var _0x3dd64b=typeof _0x4a1343[_0xd419('0x20')]===_0xd419('0x21')&&typeof _0x4a1343['limit']==='undefined';var _0x3bd7c5=_0x159a27[_0xd419('0x22')];var _0x54992c=_0x3dd64b?0x0:_0x4a1343[_0xd419('0x20')];var _0x5f164e=_0x3dd64b?_0x159a27[_0xd419('0x22')]:_0x4a1343[_0xd419('0x20')]+_0x4a1343['limit'];var _0x4a5bea;if(_0x5f164e>=_0x3bd7c5){_0x5f164e=_0x3bd7c5;_0x4a5bea=0xc8;}else{_0x4a5bea=0xce;}_0x5addfa[_0xd419('0x1d')](_0x4a5bea);return _0x5addfa['set'](_0xd419('0x23'),_0x54992c+'-'+_0x5f164e+'/'+_0x3bd7c5)[_0xd419('0x1f')](_0x159a27);}return null;};}function patchUpdates(_0x148afc){return function(_0x2aaaeb){try{jsonpatch[_0xd419('0x24')](_0x2aaaeb,_0x148afc,!![]);}catch(_0x107421){return BPromise[_0xd419('0x25')](_0x107421);}return _0x2aaaeb[_0xd419('0x26')]();};}function saveUpdates(_0x375a96,_0x293339){return function(_0x1514da){if(_0x1514da){return _0x1514da['update'](_0x375a96)[_0xd419('0x27')](function(_0x24296c){return _0x24296c;});}return null;};}function handleEntityNotFound(_0xa49bf9,_0x5d8c4e){return function(_0xe92346){if(!_0xe92346){_0xa49bf9['sendStatus'](0x194);}return _0xe92346;};}function handleError(_0x2f957f,_0x10c193){_0x10c193=_0x10c193||0x1f4;return function(_0x2f9dbc){logger[_0xd419('0x28')](_0x2f9dbc[_0xd419('0x29')]);if(_0x2f9dbc[_0xd419('0x2a')]){delete _0x2f9dbc[_0xd419('0x2a')];}_0x2f957f['status'](_0x10c193)[_0xd419('0x2b')](_0x2f9dbc);};}exports[_0xd419('0x2c')]=function(_0x369f6e,_0x52d897){var _0x2af26e={},_0x1ae8c7={},_0x873cd5={'count':0x0,'rows':[]};var _0x3e0071=_[_0xd419('0x2d')](db[_0xd419('0x2e')][_0xd419('0x2f')],function(_0x2b3c72){return{'name':_0x2b3c72[_0xd419('0x30')],'type':_0x2b3c72['type'][_0xd419('0x31')]};});_0x1ae8c7[_0xd419('0x32')]=_[_0xd419('0x2d')](_0x3e0071,_0xd419('0x2a'));_0x1ae8c7['query']=_['keys'](_0x369f6e[_0xd419('0x33')]);_0x1ae8c7['filters']=_[_0xd419('0x34')](_0x1ae8c7[_0xd419('0x32')],_0x1ae8c7[_0xd419('0x33')]);_0x2af26e[_0xd419('0x35')]=_[_0xd419('0x34')](_0x1ae8c7['model'],qs[_0xd419('0x36')](_0x369f6e[_0xd419('0x33')][_0xd419('0x36')]));_0x2af26e[_0xd419('0x35')]=_0x2af26e[_0xd419('0x35')][_0xd419('0x37')]?_0x2af26e[_0xd419('0x35')]:_0x1ae8c7[_0xd419('0x32')];if(!_0x369f6e[_0xd419('0x33')][_0xd419('0x38')](_0xd419('0x39'))){_0x2af26e[_0xd419('0x3a')]=qs['limit'](_0x369f6e[_0xd419('0x33')][_0xd419('0x3a')]);_0x2af26e[_0xd419('0x20')]=qs[_0xd419('0x20')](_0x369f6e[_0xd419('0x33')][_0xd419('0x20')]);}_0x2af26e[_0xd419('0x3b')]=qs[_0xd419('0x3c')](_0x369f6e['query'][_0xd419('0x3c')]);_0x2af26e[_0xd419('0x3d')]=qs[_0xd419('0x3e')](_[_0xd419('0x3f')](_0x369f6e[_0xd419('0x33')],_0x1ae8c7[_0xd419('0x3e')]),_0x3e0071);if(_0x369f6e[_0xd419('0x33')]['filter']){_0x2af26e[_0xd419('0x3d')]=_[_0xd419('0x40')](_0x2af26e[_0xd419('0x3d')],{'$or':_[_0xd419('0x2d')](_0x3e0071,function(_0x3fdaa5){if(_0x3fdaa5[_0xd419('0x41')]!==_0xd419('0x42')){var _0x3286ff={};_0x3286ff[_0x3fdaa5[_0xd419('0x2a')]]={'$like':'%'+_0x369f6e['query'][_0xd419('0x43')]+'%'};return _0x3286ff;}})});}_0x2af26e=_[_0xd419('0x40')]({},_0x2af26e,_0x369f6e[_0xd419('0x44')]);var _0x5d9801={'where':_0x2af26e[_0xd419('0x3d')]};return db['Team'][_0xd419('0x22')](_0x5d9801)['then'](function(_0x2d7d41){_0x873cd5['count']=_0x2d7d41;if(_0x369f6e[_0xd419('0x33')][_0xd419('0x45')]){_0x2af26e[_0xd419('0x46')]=[{'all':!![]}];}return db['Team'][_0xd419('0x47')](_0x2af26e);})['then'](function(_0x3e6603){_0x873cd5['rows']=_0x3e6603;return _0x873cd5;})[_0xd419('0x27')](respondWithFilteredResult(_0x52d897,_0x2af26e))[_0xd419('0x48')](handleError(_0x52d897,null));};exports[_0xd419('0x49')]=function(_0x3893c7,_0xfdb7b0){var _0x44fc5e={'raw':![],'where':{'id':_0x3893c7[_0xd419('0x4a')]['id']}},_0x5495bc={};_0x5495bc[_0xd419('0x32')]=_[_0xd419('0x4b')](db[_0xd419('0x2e')][_0xd419('0x2f')]);_0x5495bc[_0xd419('0x33')]=_[_0xd419('0x4b')](_0x3893c7[_0xd419('0x33')]);_0x5495bc['filters']=_[_0xd419('0x34')](_0x5495bc['model'],_0x5495bc[_0xd419('0x33')]);_0x44fc5e[_0xd419('0x35')]=_[_0xd419('0x34')](_0x5495bc[_0xd419('0x32')],qs[_0xd419('0x36')](_0x3893c7['query'][_0xd419('0x36')]));_0x44fc5e[_0xd419('0x35')]=_0x44fc5e[_0xd419('0x35')][_0xd419('0x37')]?_0x44fc5e[_0xd419('0x35')]:_0x5495bc[_0xd419('0x32')];if(_0x3893c7['query'][_0xd419('0x45')]){_0x44fc5e[_0xd419('0x46')]=[{'all':!![]}];}_0x44fc5e=_[_0xd419('0x40')]({},_0x44fc5e,_0x3893c7['options']);return db['Team'][_0xd419('0x4c')](_0x44fc5e)[_0xd419('0x27')](handleEntityNotFound(_0xfdb7b0,null))[_0xd419('0x27')](respondWithResult(_0xfdb7b0,null))[_0xd419('0x48')](handleError(_0xfdb7b0,null));};exports[_0xd419('0x4d')]=function(_0x33a529,_0x6b1ec0){return db[_0xd419('0x2e')][_0xd419('0x4d')](_0x33a529['body'],{})[_0xd419('0x27')](function(_0x5c3b8d){var _0x358128=_0x33a529[_0xd419('0x4e')][_0xd419('0x4f')]({'plain':!![]});if(!_0x358128)throw new Error(_0xd419('0x50'));if(_0x358128[_0xd419('0x51')]===_0xd419('0x4e')){var _0xb3f6a2=_0x5c3b8d[_0xd419('0x4f')]({'plain':!![]});var _0x5b0150=_0xd419('0x52');return db[_0xd419('0x53')][_0xd419('0x4c')]({'where':{'name':_0x5b0150,'userProfileId':_0x358128[_0xd419('0x54')]},'raw':!![]})[_0xd419('0x27')](function(_0x214e55){if(_0x214e55&&_0x214e55[_0xd419('0x55')]===0x0){return db[_0xd419('0x56')][_0xd419('0x4d')]({'name':_0xb3f6a2['name'],'resourceId':_0xb3f6a2['id'],'type':_0x214e55[_0xd419('0x2a')],'sectionId':_0x214e55['id']},{})[_0xd419('0x27')](function(){return _0x5c3b8d;});}else{return _0x5c3b8d;}})[_0xd419('0x48')](function(_0x454361){logger[_0xd419('0x28')](_0xd419('0x57'),_0x454361);throw _0x454361;});}return _0x5c3b8d;})['then'](respondWithResult(_0x6b1ec0,0xc9))[_0xd419('0x48')](handleError(_0x6b1ec0,null));};exports['update']=function(_0x26aada,_0x283b84){if(_0x26aada[_0xd419('0x58')]['id']){delete _0x26aada[_0xd419('0x58')]['id'];}return db[_0xd419('0x2e')]['find']({'where':{'id':_0x26aada[_0xd419('0x4a')]['id']}})['then'](handleEntityNotFound(_0x283b84,null))[_0xd419('0x27')](saveUpdates(_0x26aada['body'],null))[_0xd419('0x27')](respondWithResult(_0x283b84,null))[_0xd419('0x48')](handleError(_0x283b84,null));};exports[_0xd419('0x59')]=function(_0x545b02,_0x1db79d){var _0x453edd=_0x545b02['params']['id'];var _0x1f0b5a=[];return db[_0xd419('0x5a')]['transaction'](function(_0x33ed8b){var _0x27bf61=_0xd419('0x5b')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x27bf61,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b})['then'](function(_0x129ae8){_0x1f0b5a=_[_0xd419('0x2d')](_0x129ae8,function(_0x5e1ffa){return Number(_0x5e1ffa['UserId']);});})[_0xd419('0x27')](function(){var _0x58bc4a=_0xd419('0x5f')+_0x453edd;return db['sequelize'][_0xd419('0x33')](_0x58bc4a,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x46d091){var _0x1400c2=_['map'](_0x46d091,function(_0x1ec6c9){return Number(_0x1ec6c9[_0xd419('0x60')]);});return db[_0xd419('0x61')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'VoiceQueueId':{'$in':_0x1400c2}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x5efedc=_0xd419('0x62')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x5efedc,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x2cc5d5){var _0x1e25f7=_[_0xd419('0x2d')](_0x2cc5d5,function(_0x225df6){return Number(_0x225df6[_0xd419('0x63')]);});return db[_0xd419('0x64')]['destroy']({'where':{'UserId':{'$in':_0x1f0b5a},'MailQueueId':{'$in':_0x1e25f7}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x34033b=_0xd419('0x65')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x34033b,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')]['SELECT'],'raw':!![],'transaction':_0x33ed8b});})['then'](function(_0x12bb7c){var _0x29a260=_[_0xd419('0x2d')](_0x12bb7c,function(_0x21bfa5){return Number(_0x21bfa5['SmsQueueId']);});return db[_0xd419('0x66')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'SmsQueueId':{'$in':_0x29a260}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x2c55ff='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x2c55ff,{'type':db['Sequelize'][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x49fd71){var _0x4d0ca1=_[_0xd419('0x2d')](_0x49fd71,function(_0x3b0f52){return Number(_0x3b0f52['ChatQueueId']);});return db[_0xd419('0x67')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'ChatQueueId':{'$in':_0x4d0ca1}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x4f09da=_0xd419('0x68')+_0x453edd;return db['sequelize']['query'](_0x4f09da,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0xb790db){var _0x7a4619=_[_0xd419('0x2d')](_0xb790db,function(_0x4ee775){return Number(_0x4ee775[_0xd419('0x69')]);});return db[_0xd419('0x6a')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'FaxQueueId':{'$in':_0x7a4619}},'transaction':_0x33ed8b});})['then'](function(){var _0x3a7303=_0xd419('0x6b')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x3a7303,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})['then'](function(_0x4caabc){var _0x558a40=_[_0xd419('0x2d')](_0x4caabc,function(_0x934a7d){return Number(_0x934a7d[_0xd419('0x6c')]);});return db[_0xd419('0x6d')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'OpenchannelQueueId':{'$in':_0x558a40}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x5ef70e=_0xd419('0x6e')+_0x453edd;return db['sequelize'][_0xd419('0x33')](_0x5ef70e,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})['then'](function(_0x4e8320){var _0xa99d3d=_[_0xd419('0x2d')](_0x4e8320,function(_0x2aa67b){return Number(_0x2aa67b[_0xd419('0x6f')]);});return db['UserWhatsappQueue'][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'WhatsappQueueId':{'$in':_0xa99d3d}},'transaction':_0x33ed8b});})['then'](function(){return db[_0xd419('0x70')][_0xd419('0x4c')]({'where':{'TeamId':_0x453edd}});})[_0xd419('0x27')](function(_0x513c96){if(_0x513c96===null){return;}return db[_0xd419('0x71')]['destroy']({'where':{'UserId':{'$in':_0x1f0b5a},'VoicePrefixId':_0x513c96[_0xd419('0x72')]},'transaction':_0x33ed8b});})['then'](function(){return db[_0xd419('0x2e')]['destroy']({'where':{'id':_0x453edd},'cascade':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x1f6cb8){if(_0x1f6cb8===0x0){_0x1db79d[_0xd419('0x73')](0x194);}else{return db[_0xd419('0x56')][_0xd419('0x59')]({'where':{'type':_0xd419('0x52'),'resourceId':_0x453edd},'cascade':!![],'transaction':_0x33ed8b})[_0xd419('0x27')](function(){_0x1db79d[_0xd419('0x1d')](0xcc)['end']();});}})[_0xd419('0x48')](function(_0x39514f){_0x1db79d['status'](0x1f4)[_0xd419('0x2b')](_0x39514f);});});};exports[_0xd419('0x74')]=function(_0x52a9c2,_0x3b3b80,_0x314688){return db['Team'][_0xd419('0x75')]({'where':{'id':_0x52a9c2['params']['id']}})[_0xd419('0x27')](handleEntityNotFound(_0x3b3b80,null))[_0xd419('0x27')](function(_0x1f94c4){if(!_0x52a9c2['query'][_0xd419('0x76')]||!utils['isValidChannel'](_0x52a9c2['query'][_0xd419('0x76')])){throw new db[(_0xd419('0x5c'))][(_0xd419('0x77'))](_0xd419('0x78'));}var _0x39c22b={};var _0x4b095d={};_0x4b095d[_0xd419('0x32')]=_['keys'](db[_['capitalize'](_0x52a9c2['query'][_0xd419('0x76')][_0xd419('0x79')]())+_0xd419('0x7a')][_0xd419('0x2f')]);_0x4b095d[_0xd419('0x33')]=_['keys'](_0x52a9c2[_0xd419('0x33')]);_0x4b095d['filters']=_['intersection'](_0x4b095d[_0xd419('0x32')],_0x4b095d[_0xd419('0x33')]);_0x39c22b[_0xd419('0x35')]=_['intersection'](_0x4b095d[_0xd419('0x32')],qs['fields'](_0x52a9c2['query'][_0xd419('0x36')]));_0x39c22b[_0xd419('0x35')]=_0x39c22b[_0xd419('0x35')][_0xd419('0x37')]?_0x39c22b[_0xd419('0x35')]:_0x4b095d[_0xd419('0x32')];_0x39c22b['limit']=qs[_0xd419('0x3a')](_0x52a9c2[_0xd419('0x33')][_0xd419('0x3a')]);_0x39c22b['offset']=qs[_0xd419('0x20')](_0x52a9c2[_0xd419('0x33')][_0xd419('0x20')]);_0x39c22b[_0xd419('0x3b')]=qs[_0xd419('0x3c')](_0x52a9c2[_0xd419('0x33')][_0xd419('0x3c')]);_0x39c22b[_0xd419('0x3d')]=qs[_0xd419('0x3e')](_[_0xd419('0x3f')](_0x52a9c2['query'],_0x4b095d[_0xd419('0x3e')]));_0x39c22b=_[_0xd419('0x40')]({},_0x39c22b,_0x52a9c2[_0xd419('0x44')]);return _0x1f94c4[_0xd419('0x4f')+_['capitalize'](_0x52a9c2['query'][_0xd419('0x76')][_0xd419('0x79')]())+_0xd419('0x7b')](_0x39c22b);})[_0xd419('0x27')](respondWithResult(_0x3b3b80,null))[_0xd419('0x48')](handleError(_0x3b3b80,null));};exports['addQueues']=function(_0x5b3420,_0x4f7a7b,_0x441852){return db[_0xd419('0x2e')][_0xd419('0x75')]({'where':{'id':_0x5b3420['params']['id']}})[_0xd419('0x27')](function(_0x2733ca){if(_0x2733ca){if(!_0x5b3420[_0xd419('0x58')]['channel']||!utils['isValidChannel'](_0x5b3420[_0xd419('0x58')][_0xd419('0x76')])){throw new db[(_0xd419('0x5c'))][(_0xd419('0x77'))](_0xd419('0x78'));}return _0x2733ca[_0xd419('0x7c')+_['capitalize'](_0x5b3420['body'][_0xd419('0x76')]['toLowerCase']())+_0xd419('0x7b')](_0x5b3420['body'][_0xd419('0x7d')]);}return null;})['then'](handleEntityNotFound(_0x4f7a7b,null))[_0xd419('0x27')](respondWithStatusCode(_0x4f7a7b,null))[_0xd419('0x48')](handleError(_0x4f7a7b,null));};exports[_0xd419('0x7e')]=function(_0x10a4ef,_0x21b82c,_0xac28e1){return db[_0xd419('0x2e')]['findOne']({'where':{'id':_0x10a4ef['params']['id']}})['then'](function(_0x26e7af){if(_0x26e7af){if(!_0x10a4ef[_0xd419('0x33')][_0xd419('0x76')]||!utils[_0xd419('0x7f')](_0x10a4ef[_0xd419('0x33')]['channel'])){throw new db[(_0xd419('0x5c'))]['ValidationError'](_0xd419('0x78'));}return _0x26e7af[_0xd419('0x80')+_[_0xd419('0x81')](_0x10a4ef[_0xd419('0x33')][_0xd419('0x76')][_0xd419('0x79')]())+_0xd419('0x7b')](_0x10a4ef[_0xd419('0x33')][_0xd419('0x7d')]);}return null;})['then'](handleEntityNotFound(_0x21b82c,null))[_0xd419('0x27')](respondWithStatusCode(_0x21b82c,null))[_0xd419('0x48')](handleError(_0x21b82c,null));};exports[_0xd419('0x82')]=function(_0x5094d4,_0x533dfb){var _0x29e2dc=_['isArray'](_0x5094d4[_0xd419('0x58')][_0xd419('0x7d')])?_0x5094d4[_0xd419('0x58')][_0xd419('0x7d')]:[_0x5094d4['body'][_0xd419('0x7d')]];var _0x429dbd=_0x5094d4[_0xd419('0x4a')]['id'];return db[_0xd419('0x2e')][_0xd419('0x4c')]({'where':{'id':_0x429dbd}})[_0xd419('0x27')](handleEntityNotFound(_0x533dfb,null))['then'](function(_0xc0ef62){if(_0xc0ef62){var _0x2090fd=['Voice','Chat',_0xd419('0x83'),_0xd419('0x84'),_0xd419('0x85'),_0xd419('0x86'),_0xd419('0x87')];return db[_0xd419('0x5a')][_0xd419('0x88')](function(_0x5c67e2){var _0x2bf1c7=_['map'](_0x2090fd,function(_0x2fdaaf){var _0x1747ff={'attributes':['id',_0xd419('0x2a')]};if(_0x2fdaaf===_0xd419('0x89')){_0x1747ff[_0xd419('0x8a')]={'attributes':[_0xd419('0x8b')]};}return _0xc0ef62[_0xd419('0x4f')+_0x2fdaaf+_0xd419('0x7b')](_0x1747ff)[_0xd419('0x27')](function(_0x43e616){var _0x13d113=_[_0xd419('0x2d')](_0x43e616,function(_0x10aef0){var _0x5e4696=_[_0xd419('0x2d')](_0x29e2dc,function(_0xbac421){var _0x291ee5={'where':{'UserId':_0xbac421,[_0x2fdaaf+_0xd419('0x8c')]:_0x10aef0['id']},'transaction':_0x5c67e2};if(_0x2fdaaf===_0xd419('0x89')){_0x291ee5[_0xd419('0x19')]={'penalty':_0x10aef0[_0xd419('0x8d')]['penalty']};}return db[_0xd419('0x8e')+_0x2fdaaf+'Queue']['findOrCreate'](_0x291ee5)[_0xd419('0x27')](function(){socket[_0xd419('0x8f')]('user'+_0x2fdaaf+_0xd419('0x90'),{'UserId':_0xbac421,[_0x2fdaaf+_0xd419('0x8c')]:_0x10aef0['id']});if(_0x2fdaaf!=='Voice'){return;}return db[_0xd419('0x8e')][_0xd419('0x47')]({'where':{'id':_0x29e2dc,'online':0x1},'attributes':['id',_0xd419('0x2a'),_0xd419('0x91'),_0xd419('0x92'),'interface'],'raw':!![]})[_0xd419('0x27')](function(_0x106767){var _0x1d182c=_['map'](_0x106767,function(_0x414dd4){return db[_0xd419('0x93')]['upsert']({'membername':_0x414dd4['name'],'UserId':_0x414dd4['id'],'queue_name':_0x10aef0['name'],'VoiceQueueId':_0x10aef0['id'],'interface':_[_0xd419('0x94')](_0x414dd4['interface'])?util['format'](_0xd419('0x95'),_0x414dd4['name']):_0x414dd4[_0xd419('0x96')],'paused':_0x414dd4['voicePause']||![],'penalty':_0x10aef0[_0xd419('0x8d')][_0xd419('0x8b')]},{'transaction':_0x5c67e2});});return Promise[_0xd419('0x97')](_0x1d182c);});});});return Promise[_0xd419('0x97')](_0x5e4696);});return Promise[_0xd419('0x97')](_0x13d113);})[_0xd419('0x27')](function(){return db[_0xd419('0x70')][_0xd419('0x75')]({'where':{'teamId':_0x429dbd}})[_0xd419('0x27')](function(_0x38abba){if(_0x38abba){var _0x4a0bc1=_[_0xd419('0x2d')](_0x29e2dc,function(_0x5468a1){db[_0xd419('0x71')]['upsert']({'UserId':_0x5468a1,'VoicePrefixId':_0x38abba[_0xd419('0x72')]});});return Promise[_0xd419('0x97')](_0x4a0bc1);}});});});return Promise[_0xd419('0x97')](_0x2bf1c7)[_0xd419('0x27')](function(){return _0xc0ef62[_0xd419('0x82')](_0x29e2dc,{'transaction':_0x5c67e2})[_0xd419('0x98')](function(_0xa83a1c){return _0xa83a1c;});});});}})['then'](respondWithResult(_0x533dfb,null))['catch'](handleError(_0x533dfb,null));};exports[_0xd419('0x99')]=function(_0x23054e,_0x23ac92){var _0xf3f16d=_[_0xd419('0x9a')](_0x23054e['query'][_0xd419('0x7d')])?_0x23054e['query']['ids']:[_0x23054e[_0xd419('0x33')]['ids']];var _0x7d8bbd=_0x23054e[_0xd419('0x4a')]['id'];return db['Team']['find']({'where':{'id':_0x7d8bbd}})[_0xd419('0x27')](handleEntityNotFound(_0x23ac92,null))[_0xd419('0x27')](function(_0x427213){if(_0x427213){var _0x13d5b8=[_0xd419('0x89'),_0xd419('0x9b'),_0xd419('0x83'),_0xd419('0x84'),_0xd419('0x85'),_0xd419('0x86'),_0xd419('0x87')];return db[_0xd419('0x5a')]['transaction'](function(_0x510b86){var _0x28c1eb=_[_0xd419('0x2d')](_0x13d5b8,function(_0x4c21e9){var _0xb9888d={'attributes':['id',_0xd419('0x2a')]};return _0x427213[_0xd419('0x4f')+_0x4c21e9+'Queues'](_0xb9888d)[_0xd419('0x27')](function(_0x567597){var _0x27cb59=_[_0xd419('0x2d')](_0x567597,function(_0x25ca15){return _0x25ca15[_0xd419('0x99')](_0xf3f16d,{'transaction':_0x510b86})['then'](function(){var _0x169d2b=_[_0xd419('0x2d')](_0xf3f16d,function(_0x5f0145){socket['emit'](_0xd419('0x4e')+_0x4c21e9+_0xd419('0x9c'),{'UserId':Number(_0x5f0145),[_0x4c21e9+'QueueId']:_0x25ca15['id']});if(_0x4c21e9!==_0xd419('0x89')){return;}return db[_0xd419('0x93')][_0xd419('0x59')]({'where':{'VoiceQueueId':_0x25ca15['id'],'UserId':_0x5f0145},'transaction':_0x510b86});});return Promise[_0xd419('0x97')](_0x169d2b);});});return Promise[_0xd419('0x97')](_0x27cb59);});});return Promise[_0xd419('0x97')](_0x28c1eb)['then'](function(){return _0x427213[_0xd419('0x99')](_0xf3f16d,{'transaction':_0x510b86});})[_0xd419('0x27')](function(){return db['TeamVoicePrefix'][_0xd419('0x75')]({'where':{'teamId':_0x7d8bbd}})[_0xd419('0x27')](function(_0x3c264d){if(_0x3c264d){var _0xabbeab=_[_0xd419('0x2d')](_0xf3f16d,function(_0x4cb58f){db['UserVoicePrefix'][_0xd419('0x59')]({'where':{'UserId':_0x4cb58f,'VoicePrefixId':_0x3c264d[_0xd419('0x72')]}});});return Promise[_0xd419('0x97')](_0xabbeab);}});});});}})['then'](respondWithStatusCode(_0x23ac92,null))[_0xd419('0x48')](handleError(_0x23ac92,null));};exports['getAgents']=function(_0xe312ac,_0x52bc2b,_0x5d27cd){var _0x4d01f0={};var _0x305822={};var _0x74ce36;var _0x231290;return db[_0xd419('0x2e')][_0xd419('0x75')]({'where':{'id':_0xe312ac['params']['id']}})[_0xd419('0x27')](handleEntityNotFound(_0x52bc2b,null))['then'](function(_0x59c089){if(_0x59c089){_0x74ce36=_0x59c089;_0x305822[_0xd419('0x32')]=_['keys'](db['User'][_0xd419('0x2f')]);_0x305822['query']=_['keys'](_0xe312ac[_0xd419('0x33')]);_0x305822[_0xd419('0x3e')]=_[_0xd419('0x34')](_0x305822['model'],_0x305822[_0xd419('0x33')]);_0x4d01f0['attributes']=_[_0xd419('0x34')](_0x305822['model'],qs['fields'](_0xe312ac[_0xd419('0x33')][_0xd419('0x36')]));_0x4d01f0[_0xd419('0x35')]=_0x4d01f0[_0xd419('0x35')][_0xd419('0x37')]?_0x4d01f0[_0xd419('0x35')]:_0x305822[_0xd419('0x32')];_0x4d01f0['order']=qs[_0xd419('0x3c')](_0xe312ac[_0xd419('0x33')]['sort']);_0x4d01f0['where']=qs[_0xd419('0x3e')](_[_0xd419('0x3f')](_0xe312ac[_0xd419('0x33')],_0x305822[_0xd419('0x3e')]));if(_0xe312ac[_0xd419('0x33')][_0xd419('0x43')]){_0x4d01f0[_0xd419('0x3d')]=_[_0xd419('0x40')](_0x4d01f0['where'],{'$or':_[_0xd419('0x2d')](_0x4d01f0[_0xd419('0x35')],function(_0x53f5b9){var _0x44835b={};_0x44835b[_0x53f5b9]={'$like':'%'+_0xe312ac[_0xd419('0x33')][_0xd419('0x43')]+'%'};return _0x44835b;})});}_0x4d01f0=_[_0xd419('0x40')]({},_0x4d01f0,_0xe312ac[_0xd419('0x44')]);return _0x74ce36[_0xd419('0x9d')](_0x4d01f0);}})[_0xd419('0x27')](function(_0x3e3c9a){if(_0x3e3c9a){_0x231290=_0x3e3c9a['length'];if(!_0xe312ac[_0xd419('0x33')]['hasOwnProperty'](_0xd419('0x39'))){_0x4d01f0[_0xd419('0x3a')]=qs[_0xd419('0x3a')](_0xe312ac[_0xd419('0x33')][_0xd419('0x3a')]);_0x4d01f0[_0xd419('0x20')]=qs[_0xd419('0x20')](_0xe312ac['query'][_0xd419('0x20')]);}return _0x74ce36['getAgents'](_0x4d01f0);}})[_0xd419('0x27')](function(_0xa3ee53){if(_0xa3ee53){return _0xa3ee53?{'count':_0x231290,'rows':_0xa3ee53}:null;}})[_0xd419('0x27')](respondWithResult(_0x52bc2b,null))['catch'](handleError(_0x52bc2b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8d9f74c..1321e1f 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 _0x0c07=['hasOwnProperty','hook','../../mysqldb','Team','setMaxListeners','update','remove','emit'];(function(_0x439602,_0x1e38f5){var _0x2bacd1=function(_0x4dc866){while(--_0x4dc866){_0x439602['push'](_0x439602['shift']());}};_0x2bacd1(++_0x1e38f5);}(_0x0c07,0x1ea));var _0x70c0=function(_0x52fb3c,_0x2cf66e){_0x52fb3c=_0x52fb3c-0x0;var _0x5c9223=_0x0c07[_0x52fb3c];return _0x5c9223;};'use strict';var EventEmitter=require('events');var Team=require(_0x70c0('0x0'))['db'][_0x70c0('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x70c0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x70c0('0x3'),'afterDestroy':_0x70c0('0x4')};function emitEvent(_0x4a5787){return function(_0x46a118,_0x464e0b,_0x44d6e1){TeamEvents[_0x70c0('0x5')](_0x4a5787+':'+_0x46a118['id'],_0x46a118);TeamEvents['emit'](_0x4a5787,_0x46a118);_0x44d6e1(null);};}for(var e in events){if(events[_0x70c0('0x6')](e)){var event=events[e];Team[_0x70c0('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x65bc=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x526f1f,_0x37ee7b){var _0x149143=function(_0x26a958){while(--_0x26a958){_0x526f1f['push'](_0x526f1f['shift']());}};_0x149143(++_0x37ee7b);}(_0x65bc,0x17a));var _0xc65b=function(_0x4140fe,_0x370dd5){_0x4140fe=_0x4140fe-0x0;var _0x3e3ecc=_0x65bc[_0x4140fe];return _0x3e3ecc;};'use strict';var EventEmitter=require(_0xc65b('0x0'));var Team=require(_0xc65b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xc65b('0x2')](0x0);var events={'afterCreate':_0xc65b('0x3'),'afterUpdate':_0xc65b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x14aa7f){return function(_0x2a875d,_0x24a05f,_0x36df0e){TeamEvents[_0xc65b('0x5')](_0x14aa7f+':'+_0x2a875d['id'],_0x2a875d);TeamEvents['emit'](_0x14aa7f,_0x2a875d);_0x36df0e(null);};}for(var e in events){if(events[_0xc65b('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc65b('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 879833c..407f371 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 _0x2346=['catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','then','lodash','get','Queues','map','channel'];(function(_0x138fc2,_0x13d8be){var _0x510ef7=function(_0x4dd8f5){while(--_0x4dd8f5){_0x138fc2['push'](_0x138fc2['shift']());}};_0x510ef7(++_0x13d8be);}(_0x2346,0x199));var _0x6234=function(_0x4abd58,_0x523c62){_0x4abd58=_0x4abd58-0x0;var _0x3608a8=_0x2346[_0x4abd58];return _0x3608a8;};'use strict';var _=require(_0x6234('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x185df4,_0x4ac9bf){var _0x24c090=_0x6234('0x1')+_0x4ac9bf+_0x6234('0x2');return _0x185df4[_0x24c090]()['then'](function(_0xb512c0){return _[_0x6234('0x3')](_0xb512c0,function(_0x31f04b){_0x31f04b['setDataValue'](_0x6234('0x4'),_0x4ac9bf);return _0x31f04b;});})[_0x6234('0x5')](function(_0x49a46c){throw _0x49a46c;});}module[_0x6234('0x6')]=function(_0x3b5c6c){return _0x3b5c6c[_0x6234('0x7')](_0x6234('0x8'),attributes,{'tableName':_0x6234('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xcc929f=this;var _0x4af3d9=[_0x6234('0xa'),_0x6234('0xb'),_0x6234('0xc'),_0x6234('0xd'),_0x6234('0xe'),_0x6234('0xf'),_0x6234('0x10')];return Promise['resolve']()[_0x6234('0x11')](function(){var _0x5b0569=_[_0x6234('0x3')](_0x4af3d9,function(_0x4d174e){return getQueuesByChannel(_0xcc929f,_0x4d174e);});return Promise['all'](_0x5b0569);})[_0x6234('0x5')](function(_0x3a40cb){throw _0x3a40cb;});}}});}; \ No newline at end of file +var _0xf185=['Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','catch','lodash','./team.attributes','Queues','then','map','setDataValue','channel','exports','Team','Chat','Fax'];(function(_0x50bb27,_0x5715e0){var _0x237456=function(_0x7574f5){while(--_0x7574f5){_0x50bb27['push'](_0x50bb27['shift']());}};_0x237456(++_0x5715e0);}(_0xf185,0x1bd));var _0x5f18=function(_0x2b0f13,_0x49db0d){_0x2b0f13=_0x2b0f13-0x0;var _0x5e35bb=_0xf185[_0x2b0f13];return _0x5e35bb;};'use strict';var _=require(_0x5f18('0x0'));var attributes=require(_0x5f18('0x1'));function getQueuesByChannel(_0x4763e6,_0x2ce949){var _0xfb9357='get'+_0x2ce949+_0x5f18('0x2');return _0x4763e6[_0xfb9357]()[_0x5f18('0x3')](function(_0x3e5829){return _[_0x5f18('0x4')](_0x3e5829,function(_0x78715){_0x78715[_0x5f18('0x5')](_0x5f18('0x6'),_0x2ce949);return _0x78715;});})['catch'](function(_0x220a32){throw _0x220a32;});}module[_0x5f18('0x7')]=function(_0x5475e7){return _0x5475e7['define'](_0x5f18('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2d4375=this;var _0x4f4c2a=[_0x5f18('0x9'),_0x5f18('0xa'),_0x5f18('0xb'),_0x5f18('0xc'),_0x5f18('0xd'),_0x5f18('0xe'),_0x5f18('0xf')];return Promise[_0x5f18('0x10')]()[_0x5f18('0x3')](function(){var _0x56833f=_[_0x5f18('0x4')](_0x4f4c2a,function(_0x11c1ea){return getQueuesByChannel(_0x2d4375,_0x11c1ea);});return Promise[_0x5f18('0x11')](_0x56833f);})[_0x5f18('0x12')](function(_0x330dfc){throw _0x330dfc;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index c67e683..b2c080b 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 _0x5aff=['./team.socket','register','then','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter'];(function(_0x491b60,_0x4dcc2c){var _0x461a23=function(_0x292283){while(--_0x292283){_0x491b60['push'](_0x491b60['shift']());}};_0x461a23(++_0x4dcc2c);}(_0x5aff,0x15c));var _0xf5af=function(_0x18f439,_0x5e8798){_0x18f439=_0x18f439-0x0;var _0x22ff4f=_0x5aff[_0x18f439];return _0x22ff4f;};'use strict';var _=require('lodash');var util=require(_0xf5af('0x0'));var moment=require('moment');var BPromise=require(_0xf5af('0x1'));var rs=require(_0xf5af('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5af('0x3'))['db'];var utils=require(_0xf5af('0x4'));var logger=require(_0xf5af('0x5'))(_0xf5af('0x6'));var config=require(_0xf5af('0x7'));var jayson=require(_0xf5af('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf5af('0x9')]=_['defaults'](config['redis'],{'host':_0xf5af('0xa'),'port':0x18eb});var socket=require(_0xf5af('0xb'))(new Redis(config[_0xf5af('0x9')]));require(_0xf5af('0xc'))[_0xf5af('0xd')](socket);function respondWithRpcPromise(_0x3823cc,_0x4c41af,_0x48abe6){return new BPromise(function(_0x4b4b4d,_0x28a003){return client['request'](_0x3823cc,_0x48abe6)[_0xf5af('0xe')](function(_0x401878){logger['info']('Team,\x20%s,\x20%s',_0x4c41af,_0xf5af('0xf'));logger['debug'](_0xf5af('0x10'),_0x4c41af,_0xf5af('0xf'),JSON[_0xf5af('0x11')](_0x401878));if(_0x401878['error']){if(_0x401878[_0xf5af('0x12')][_0xf5af('0x13')]===0x1f4){logger[_0xf5af('0x12')](_0xf5af('0x14'),_0x4c41af,_0x401878['error'][_0xf5af('0x15')]);return _0x28a003(_0x401878[_0xf5af('0x12')]['message']);}logger[_0xf5af('0x12')](_0xf5af('0x14'),_0x4c41af,_0x401878[_0xf5af('0x12')]['message']);return _0x4b4b4d(_0x401878[_0xf5af('0x12')][_0xf5af('0x15')]);}else{logger['info'](_0xf5af('0x14'),_0x4c41af,'request\x20sent');_0x4b4b4d(_0x401878[_0xf5af('0x16')][_0xf5af('0x15')]);}})[_0xf5af('0x17')](function(_0x5063f2){logger[_0xf5af('0x12')](_0xf5af('0x14'),_0x4c41af,_0x5063f2);_0x28a003(_0x5063f2);});});} \ No newline at end of file +var _0xbbc6=['then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','Team,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xbbc6,0x90));var _0x6bbc=function(_0x829275,_0x161f1f){_0x829275=_0x829275-0x0;var _0x38f78a=_0xbbc6[_0x829275];return _0x38f78a;};'use strict';var _=require(_0x6bbc('0x0'));var util=require(_0x6bbc('0x1'));var moment=require(_0x6bbc('0x2'));var BPromise=require(_0x6bbc('0x3'));var rs=require(_0x6bbc('0x4'));var fs=require('fs');var Redis=require(_0x6bbc('0x5'));var db=require(_0x6bbc('0x6'))['db'];var utils=require(_0x6bbc('0x7'));var logger=require(_0x6bbc('0x8'))(_0x6bbc('0x9'));var config=require(_0x6bbc('0xa'));var jayson=require(_0x6bbc('0xb'));var client=jayson[_0x6bbc('0xc')]['http']({'port':0x232a});config['redis']=_[_0x6bbc('0xd')](config['redis'],{'host':_0x6bbc('0xe'),'port':0x18eb});var socket=require(_0x6bbc('0xf'))(new Redis(config[_0x6bbc('0x10')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x576091,_0x2862e4,_0x5d0985){return new BPromise(function(_0x193367,_0x4fe50e){return client[_0x6bbc('0x11')](_0x576091,_0x5d0985)[_0x6bbc('0x12')](function(_0x33e36d){logger[_0x6bbc('0x13')]('Team,\x20%s,\x20%s',_0x2862e4,_0x6bbc('0x14'));logger['debug'](_0x6bbc('0x15'),_0x2862e4,'request\x20sent',JSON[_0x6bbc('0x16')](_0x33e36d));if(_0x33e36d[_0x6bbc('0x17')]){if(_0x33e36d[_0x6bbc('0x17')]['code']===0x1f4){logger[_0x6bbc('0x17')]('Team,\x20%s,\x20%s',_0x2862e4,_0x33e36d[_0x6bbc('0x17')]['message']);return _0x4fe50e(_0x33e36d[_0x6bbc('0x17')][_0x6bbc('0x18')]);}logger[_0x6bbc('0x17')](_0x6bbc('0x19'),_0x2862e4,_0x33e36d[_0x6bbc('0x17')][_0x6bbc('0x18')]);return _0x193367(_0x33e36d[_0x6bbc('0x17')][_0x6bbc('0x18')]);}else{logger['info'](_0x6bbc('0x19'),_0x2862e4,'request\x20sent');_0x193367(_0x33e36d[_0x6bbc('0x1a')][_0x6bbc('0x18')]);}})['catch'](function(_0x448af0){logger[_0x6bbc('0x17')](_0x6bbc('0x19'),_0x2862e4,_0x448af0);_0x4fe50e(_0x448af0);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c77b142..853bede 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 _0x2edc=['length','./team.events','remove','update','removeListener','register'];(function(_0x391679,_0x70e037){var _0x24687e=function(_0x2452a2){while(--_0x2452a2){_0x391679['push'](_0x391679['shift']());}};_0x24687e(++_0x70e037);}(_0x2edc,0x1d5));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0xc2ed('0x0'));var events=['save',_0xc2ed('0x1'),_0xc2ed('0x2')];function createListener(_0x3aef3b,_0x55c7b9){return function(_0xbacd13){_0x55c7b9['emit'](_0x3aef3b,_0xbacd13);};}function removeListener(_0x44ca1a,_0x1b643a){return function(){TeamEvents[_0xc2ed('0x3')](_0x44ca1a,_0x1b643a);};}exports[_0xc2ed('0x4')]=function(_0x182b28){for(var _0x6e904f=0x0,_0x17a8b2=events[_0xc2ed('0x5')];_0x6e904f<_0x17a8b2;_0x6e904f++){var _0x19b2a2=events[_0x6e904f];var _0x194752=createListener('team:'+_0x19b2a2,_0x182b28);TeamEvents['on'](_0x19b2a2,_0x194752);}}; \ No newline at end of file +var _0x0444=['update','removeListener','register','team:','./team.events'];(function(_0x40f4d6,_0x43c9bb){var _0x51c3d2=function(_0x55f092){while(--_0x55f092){_0x40f4d6['push'](_0x40f4d6['shift']());}};_0x51c3d2(++_0x43c9bb);}(_0x0444,0xbd));var _0x4044=function(_0x40c4f7,_0x5deb14){_0x40c4f7=_0x40c4f7-0x0;var _0x351d93=_0x0444[_0x40c4f7];return _0x351d93;};'use strict';var TeamEvents=require(_0x4044('0x0'));var events=['save','remove',_0x4044('0x1')];function createListener(_0x3b4f86,_0x314e93){return function(_0x13b35d){_0x314e93['emit'](_0x3b4f86,_0x13b35d);};}function removeListener(_0x416e94,_0x467dc2){return function(){TeamEvents[_0x4044('0x2')](_0x416e94,_0x467dc2);};}exports[_0x4044('0x3')]=function(_0x14b919){for(var _0x4acfb2=0x0,_0x31c11f=events['length'];_0x4acfb2<_0x31c11f;_0x4acfb2++){var _0x3e9f69=events[_0x4acfb2];var _0x15704a=createListener(_0x4044('0x4')+_0x3e9f69,_0x14b919);TeamEvents['on'](_0x3e9f69,_0x15704a);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index cafdc83..62eb3bd 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 _0xd2ea=['sequelize','exports','INTEGER'];(function(_0x5d08a3,_0x225dde){var _0x5988e9=function(_0x36f2ef){while(--_0x36f2ef){_0x5d08a3['push'](_0x5d08a3['shift']());}};_0x5988e9(++_0x225dde);}(_0xd2ea,0x15f));var _0xad2e=function(_0x464fc9,_0x4289a3){_0x464fc9=_0x464fc9-0x0;var _0xb4ddd0=_0xd2ea[_0x464fc9];return _0xb4ddd0;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'TeamId':{'type':Sequelize[_0xad2e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xad2e('0x2')]}}; \ No newline at end of file +var _0x8c99=['INTEGER','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8c99,0x1a8));var _0x98c9=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x8c99[_0x39e164];return _0x13fa6b;};'use strict';var Sequelize=require(_0x98c9('0x0'));module[_0x98c9('0x1')]={'TeamId':{'type':Sequelize[_0x98c9('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x98c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 210e508..f489db1 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 _0xdac7=['util','bluebird','request-promise','path','rimraf','TeamVoicePrefix','lodash'];(function(_0x21a173,_0x1f6b9a){var _0x244d96=function(_0x2aea9f){while(--_0x2aea9f){_0x21a173['push'](_0x21a173['shift']());}};_0x244d96(++_0x1f6b9a);}(_0xdac7,0x180));var _0x7dac=function(_0x20f626,_0x9c5811){_0x20f626=_0x20f626-0x0;var _0x257011=_0xdac7[_0x20f626];return _0x257011;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7dac('0x2'));var rp=require(_0x7dac('0x3'));var fs=require('fs');var path=require(_0x7dac('0x4'));var rimraf=require(_0x7dac('0x5'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x17a05f,_0x2557ee){return _0x17a05f['define'](_0x7dac('0x6'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x138d=['api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x32d2eb,_0x56fe19){var _0x1e3590=function(_0x1c9f47){while(--_0x1c9f47){_0x32d2eb['push'](_0x32d2eb['shift']());}};_0x1e3590(++_0x56fe19);}(_0x138d,0x1ab));var _0xd138=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0x138d[_0x483e3a];return _0x43fca9;};'use strict';var _=require(_0xd138('0x0'));var util=require(_0xd138('0x1'));var logger=require('../../config/logger')(_0xd138('0x2'));var moment=require(_0xd138('0x3'));var BPromise=require(_0xd138('0x4'));var rp=require(_0xd138('0x5'));var fs=require('fs');var path=require(_0xd138('0x6'));var rimraf=require(_0xd138('0x7'));var config=require('../../config/environment');var attributes=require(_0xd138('0x8'));module[_0xd138('0x9')]=function(_0x343962,_0x54f02e){return _0x343962[_0xd138('0xa')](_0xd138('0xb'),attributes,{'tableName':_0xd138('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 919af97..541e854 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(_0x56b82e,_0x2a25d7){var _0x218227=function(_0x216a6a){while(--_0x216a6a){_0x56b82e['push'](_0x56b82e['shift']());}};_0x218227(++_0x2a25d7);}(_0xe706,0xa3));var _0x6e70=function(_0x5abe5a,_0x5747c0){_0x5abe5a=_0x5abe5a-0x0;var _0x5abba2=_0xe706[_0x5abe5a];return _0x5abba2;};'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(_0x301c60,_0xcb7733){var _0x2b5357=function(_0x58bb19){while(--_0x58bb19){_0x301c60['push'](_0x301c60['shift']());}};_0x2b5357(++_0xcb7733);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 2841010..5caec6a 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 _0x38e7=['exports'];(function(_0x2e27ac,_0x24027a){var _0x29f78b=function(_0x4f0bf0){while(--_0x4f0bf0){_0x2e27ac['push'](_0x2e27ac['shift']());}};_0x29f78b(++_0x24027a);}(_0x38e7,0x124));var _0x738e=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x38e7[_0x301c34];return _0x1a8c5a;};'use strict';var Sequelize=require('sequelize');module[_0x738e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6838=['exports'];(function(_0x2e209b,_0x3642fc){var _0x4ee763=function(_0x39b3e9){while(--_0x39b3e9){_0x2e209b['push'](_0x2e209b['shift']());}};_0x4ee763(++_0x3642fc);}(_0x6838,0x67));var _0x8683=function(_0x45d9bb,_0x2c0350){_0x45d9bb=_0x45d9bb-0x0;var _0x1a36e9=_0x6838[_0x45d9bb];return _0x1a36e9;};'use strict';var Sequelize=require('sequelize');module[_0x8683('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index df1a6d2..bdb1c78 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 _0xb28a=['moment','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','util','../../config/logger'];(function(_0x1dd6e2,_0x420d75){var _0x247718=function(_0x428096){while(--_0x428096){_0x1dd6e2['push'](_0x1dd6e2['shift']());}};_0x247718(++_0x420d75);}(_0xb28a,0x166));var _0xab28=function(_0x105e3a,_0x5efd23){_0x105e3a=_0x105e3a-0x0;var _0x4b2a41=_0xb28a[_0x105e3a];return _0x4b2a41;};'use strict';var _=require('lodash');var util=require(_0xab28('0x0'));var logger=require(_0xab28('0x1'))('api');var moment=require(_0xab28('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab28('0x3'));var config=require(_0xab28('0x4'));var attributes=require(_0xab28('0x5'));module[_0xab28('0x6')]=function(_0x133169,_0x128a13){return _0x133169[_0xab28('0x7')](_0xab28('0x8'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x630e=['team_has_voice_queues','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x630e,0x1af));var _0xe630=function(_0x3d0413,_0x108e83){_0x3d0413=_0x3d0413-0x0;var _0x4ceda8=_0x630e[_0x3d0413];return _0x4ceda8;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var logger=require(_0xe630('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe630('0x2'));var rp=require(_0xe630('0x3'));var fs=require('fs');var path=require(_0xe630('0x4'));var rimraf=require('rimraf');var config=require(_0xe630('0x5'));var attributes=require(_0xe630('0x6'));module[_0xe630('0x7')]=function(_0x3d6f93,_0x3936fd){return _0x3d6f93['define'](_0xe630('0x8'),attributes,{'tableName':_0xe630('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index e02f2eb..79302ee 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 _0x629d=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x629d,0x197));var _0xd629=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x629d[_0x7185f7];return _0x182e45;};'use strict';var _=require('lodash');var util=require(_0xd629('0x0'));var moment=require(_0xd629('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd629('0x2'));var db=require(_0xd629('0x3'))['db'];var utils=require(_0xd629('0x4'));var logger=require(_0xd629('0x5'))('rpc');var config=require(_0xd629('0x6'));var jayson=require(_0xd629('0x7'));var client=jayson[_0xd629('0x8')][_0xd629('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x184ee5,_0x4d758d,_0x2561d5){return new BPromise(function(_0x99cb25,_0x34fd12){return client[_0xd629('0xa')](_0x184ee5,_0x2561d5)[_0xd629('0xb')](function(_0x6fb69e){logger[_0xd629('0xc')](_0xd629('0xd'),_0x4d758d,_0xd629('0xe'));logger['debug'](_0xd629('0xf'),_0x4d758d,'request\x20sent',JSON[_0xd629('0x10')](_0x6fb69e));if(_0x6fb69e['error']){if(_0x6fb69e[_0xd629('0x11')]['code']===0x1f4){logger[_0xd629('0x11')](_0xd629('0xd'),_0x4d758d,_0x6fb69e[_0xd629('0x11')][_0xd629('0x12')]);return _0x34fd12(_0x6fb69e[_0xd629('0x11')][_0xd629('0x12')]);}logger['error'](_0xd629('0xd'),_0x4d758d,_0x6fb69e[_0xd629('0x11')]['message']);return _0x99cb25(_0x6fb69e[_0xd629('0x11')][_0xd629('0x12')]);}else{logger[_0xd629('0xc')](_0xd629('0xd'),_0x4d758d,'request\x20sent');_0x99cb25(_0x6fb69e[_0xd629('0x13')][_0xd629('0x12')]);}})['catch'](function(_0xa6cdd8){logger[_0xd629('0x11')](_0xd629('0xd'),_0x4d758d,_0xa6cdd8);_0x34fd12(_0xa6cdd8);});});} \ No newline at end of file +var _0x2f72=['jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3ea96a,_0x5c7ccb){var _0x47e118=function(_0x55cfd3){while(--_0x55cfd3){_0x3ea96a['push'](_0x3ea96a['shift']());}};_0x47e118(++_0x5c7ccb);}(_0x2f72,0x166));var _0x22f7=function(_0x451871,_0x1e9414){_0x451871=_0x451871-0x0;var _0x5254d9=_0x2f72[_0x451871];return _0x5254d9;};'use strict';var _=require(_0x22f7('0x0'));var util=require(_0x22f7('0x1'));var moment=require(_0x22f7('0x2'));var BPromise=require(_0x22f7('0x3'));var rs=require(_0x22f7('0x4'));var fs=require('fs');var Redis=require(_0x22f7('0x5'));var db=require(_0x22f7('0x6'))['db'];var utils=require(_0x22f7('0x7'));var logger=require('../../config/logger')(_0x22f7('0x8'));var config=require(_0x22f7('0x9'));var jayson=require(_0x22f7('0xa'));var client=jayson[_0x22f7('0xb')][_0x22f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11cb61,_0x46195a,_0x1ad8d1){return new BPromise(function(_0x261813,_0x434aa4){return client[_0x22f7('0xd')](_0x11cb61,_0x1ad8d1)[_0x22f7('0xe')](function(_0x8457b5){logger[_0x22f7('0xf')](_0x22f7('0x10'),_0x46195a,_0x22f7('0x11'));logger['debug'](_0x22f7('0x12'),_0x46195a,_0x22f7('0x11'),JSON['stringify'](_0x8457b5));if(_0x8457b5[_0x22f7('0x13')]){if(_0x8457b5[_0x22f7('0x13')]['code']===0x1f4){logger[_0x22f7('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x46195a,_0x8457b5[_0x22f7('0x13')][_0x22f7('0x14')]);return _0x434aa4(_0x8457b5['error'][_0x22f7('0x14')]);}logger[_0x22f7('0x13')](_0x22f7('0x10'),_0x46195a,_0x8457b5[_0x22f7('0x13')][_0x22f7('0x14')]);return _0x261813(_0x8457b5[_0x22f7('0x13')][_0x22f7('0x14')]);}else{logger[_0x22f7('0xf')](_0x22f7('0x10'),_0x46195a,_0x22f7('0x11'));_0x261813(_0x8457b5[_0x22f7('0x15')][_0x22f7('0x14')]);}})[_0x22f7('0x16')](function(_0x3b2861){logger[_0x22f7('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x46195a,_0x3b2861);_0x434aa4(_0x3b2861);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 0e75190..e77b3a8 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 _0x2deb=['delete','/:id','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','update'];(function(_0x416f8f,_0x1f2f98){var _0xd1e0a7=function(_0x4ed0ba){while(--_0x4ed0ba){_0x416f8f['push'](_0x416f8f['shift']());}};_0xd1e0a7(++_0x1f2f98);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var path=require(_0xb2de('0x2'));var timeout=require(_0xb2de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb2de('0x4'));var auth=require(_0xb2de('0x5'));var interaction=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var controller=require('./template.controller');router['get']('/',auth[_0xb2de('0x8')](),controller[_0xb2de('0x9')]);router[_0xb2de('0xa')]('/:id',auth[_0xb2de('0x8')](),controller[_0xb2de('0xb')]);router['post']('/',auth[_0xb2de('0x8')](),controller[_0xb2de('0xc')]);router[_0xb2de('0xd')]('/:id',auth[_0xb2de('0x8')](),controller[_0xb2de('0xe')]);router[_0xb2de('0xf')](_0xb2de('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2de('0x11')]=router; \ No newline at end of file +var _0xa057=['isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','index','get','/:id','show','post'];(function(_0x2d9abc,_0x3ed238){var _0x3ef520=function(_0x48e86a){while(--_0x48e86a){_0x2d9abc['push'](_0x2d9abc['shift']());}};_0x3ef520(++_0x3ed238);}(_0xa057,0x123));var _0x7a05=function(_0x1b1832,_0x54251e){_0x1b1832=_0x1b1832-0x0;var _0x1fb883=_0xa057[_0x1b1832];return _0x1fb883;};'use strict';var multer=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var path=require('path');var timeout=require(_0x7a05('0x2'));var express=require(_0x7a05('0x3'));var router=express[_0x7a05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7a05('0x5'));var interaction=require(_0x7a05('0x6'));var config=require('../../config/environment');var controller=require(_0x7a05('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a05('0x8')]);router[_0x7a05('0x9')](_0x7a05('0xa'),auth['isAuthenticated'](),controller[_0x7a05('0xb')]);router[_0x7a05('0xc')]('/',auth[_0x7a05('0xd')](),controller['create']);router[_0x7a05('0xe')](_0x7a05('0xa'),auth[_0x7a05('0xd')](),controller[_0x7a05('0xf')]);router[_0x7a05('0x10')](_0x7a05('0xa'),auth['isAuthenticated'](),controller[_0x7a05('0x11')]);module[_0x7a05('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 46f0e36..0ab0751 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 _0x50e1=['TEXT','sequelize','exports','STRING'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x50e1,0xed));var _0x150e=function(_0xc2c373,_0x4f3ef7){_0xc2c373=_0xc2c373-0x0;var _0x3dce14=_0x50e1[_0xc2c373];return _0x3dce14;};'use strict';var Sequelize=require(_0x150e('0x0'));module[_0x150e('0x1')]={'name':{'type':Sequelize[_0x150e('0x2')]},'description':{'type':Sequelize[_0x150e('0x2')]},'html':{'type':Sequelize[_0x150e('0x3')]}}; \ No newline at end of file +var _0x7c10=['STRING','TEXT','sequelize'];(function(_0x273ba2,_0x501654){var _0x5b71ac=function(_0x3abb5c){while(--_0x3abb5c){_0x273ba2['push'](_0x273ba2['shift']());}};_0x5b71ac(++_0x501654);}(_0x7c10,0x122));var _0x07c1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7c10[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x07c1('0x0'));module['exports']={'name':{'type':Sequelize[_0x07c1('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x07c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 90aaa83..4a3eab1 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 _0x64b0=['name','send','index','Template','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','destroy','Templates','UserProfileResource','error','stack'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x64b0,0x79));var _0x064b=function(_0x5a52bf,_0x5272ed){_0x5a52bf=_0x5a52bf-0x0;var _0x82abb4=_0x64b0[_0x5a52bf];return _0x82abb4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x064b('0x0'));var zipdir=require(_0x064b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x064b('0x2'));var moment=require(_0x064b('0x3'));var BPromise=require(_0x064b('0x4'));var Mustache=require(_0x064b('0x5'));var util=require(_0x064b('0x6'));var path=require(_0x064b('0x7'));var sox=require(_0x064b('0x8'));var csv=require(_0x064b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x064b('0xa'));var _=require(_0x064b('0xb'));var squel=require(_0x064b('0xc'));var crypto=require(_0x064b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x064b('0xe'));var toCsv=require(_0x064b('0x9'));var querystring=require('querystring');var Papa=require(_0x064b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x064b('0x10'));var as=require(_0x064b('0x11'));var hardwareService=require(_0x064b('0x12'));var logger=require('../../config/logger')(_0x064b('0x13'));var utils=require(_0x064b('0x14'));var config=require(_0x064b('0x15'));var licenseUtil=require(_0x064b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386550,_0x5b8509){_0x5b8509=_0x5b8509||0xcc;return function(_0x86d2a6){if(_0x86d2a6){return _0x386550[_0x064b('0x17')](_0x5b8509);}return _0x386550[_0x064b('0x18')](_0x5b8509)[_0x064b('0x19')]();};}function respondWithResult(_0x4b51eb,_0x3133eb){_0x3133eb=_0x3133eb||0xc8;return function(_0x345a9e){if(_0x345a9e){return _0x4b51eb[_0x064b('0x18')](_0x3133eb)[_0x064b('0x1a')](_0x345a9e);}};}function respondWithFilteredResult(_0x336077,_0x4cf965){return function(_0x8b40d8){if(_0x8b40d8){var _0x6b4e84=typeof _0x4cf965['offset']===_0x064b('0x1b')&&typeof _0x4cf965[_0x064b('0x1c')]===_0x064b('0x1b');var _0x4e3ad0=_0x8b40d8['count'];var _0x12d508=_0x6b4e84?0x0:_0x4cf965[_0x064b('0x1d')];var _0x34d780=_0x6b4e84?_0x8b40d8[_0x064b('0x1e')]:_0x4cf965[_0x064b('0x1d')]+_0x4cf965['limit'];var _0x4673ac;if(_0x34d780>=_0x4e3ad0){_0x34d780=_0x4e3ad0;_0x4673ac=0xc8;}else{_0x4673ac=0xce;}_0x336077[_0x064b('0x18')](_0x4673ac);return _0x336077['set'](_0x064b('0x1f'),_0x12d508+'-'+_0x34d780+'/'+_0x4e3ad0)[_0x064b('0x1a')](_0x8b40d8);}return null;};}function patchUpdates(_0x1a5d0){return function(_0x4d9a87){try{jsonpatch[_0x064b('0x20')](_0x4d9a87,_0x1a5d0,!![]);}catch(_0x24a49f){return BPromise[_0x064b('0x21')](_0x24a49f);}return _0x4d9a87[_0x064b('0x22')]();};}function saveUpdates(_0x330581,_0x4c946f){return function(_0x2b2192){if(_0x2b2192){return _0x2b2192['update'](_0x330581)[_0x064b('0x23')](function(_0x33d63b){return _0x33d63b;});}return null;};}function removeEntity(_0xf6ff78,_0x8e09d7){return function(_0x2281af){if(_0x2281af){return _0x2281af[_0x064b('0x24')]()[_0x064b('0x23')](function(){var _0x3f69f3=_0x2281af['get']({'plain':!![]});var _0x4ab3e9=_0x064b('0x25');return db[_0x064b('0x26')][_0x064b('0x24')]({'where':{'type':_0x4ab3e9,'resourceId':_0x3f69f3['id']}})[_0x064b('0x23')](function(){return _0x2281af;});})['then'](function(){_0xf6ff78[_0x064b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e7bd,_0x3e63e5){return function(_0x3b21c2){if(!_0x3b21c2){_0x47e7bd[_0x064b('0x17')](0x194);}return _0x3b21c2;};}function handleError(_0x309690,_0x1a158e){_0x1a158e=_0x1a158e||0x1f4;return function(_0x579723){logger[_0x064b('0x27')](_0x579723[_0x064b('0x28')]);if(_0x579723[_0x064b('0x29')]){delete _0x579723[_0x064b('0x29')];}_0x309690[_0x064b('0x18')](_0x1a158e)[_0x064b('0x2a')](_0x579723);};}exports[_0x064b('0x2b')]=function(_0x440e4e,_0x418809){var _0xf8cc31={},_0x1f7e2a={},_0x5e7045={'count':0x0,'rows':[]};var _0xedecb5=_['map'](db[_0x064b('0x2c')][_0x064b('0x2d')],function(_0x3ddc3d){return{'name':_0x3ddc3d['fieldName'],'type':_0x3ddc3d[_0x064b('0x2e')][_0x064b('0x2f')]};});_0x1f7e2a[_0x064b('0x30')]=_[_0x064b('0x31')](_0xedecb5,_0x064b('0x29'));_0x1f7e2a[_0x064b('0x32')]=_[_0x064b('0x33')](_0x440e4e[_0x064b('0x32')]);_0x1f7e2a[_0x064b('0x34')]=_[_0x064b('0x35')](_0x1f7e2a['model'],_0x1f7e2a[_0x064b('0x32')]);_0xf8cc31[_0x064b('0x36')]=_[_0x064b('0x35')](_0x1f7e2a['model'],qs['fields'](_0x440e4e[_0x064b('0x32')]['fields']));_0xf8cc31['attributes']=_0xf8cc31[_0x064b('0x36')][_0x064b('0x37')]?_0xf8cc31[_0x064b('0x36')]:_0x1f7e2a[_0x064b('0x30')];if(!_0x440e4e['query'][_0x064b('0x38')](_0x064b('0x39'))){_0xf8cc31['limit']=qs[_0x064b('0x1c')](_0x440e4e[_0x064b('0x32')][_0x064b('0x1c')]);_0xf8cc31['offset']=qs[_0x064b('0x1d')](_0x440e4e[_0x064b('0x32')][_0x064b('0x1d')]);}_0xf8cc31[_0x064b('0x3a')]=qs[_0x064b('0x3b')](_0x440e4e[_0x064b('0x32')]['sort']);_0xf8cc31['where']=qs['filters'](_['pick'](_0x440e4e[_0x064b('0x32')],_0x1f7e2a[_0x064b('0x34')]),_0xedecb5);if(_0x440e4e[_0x064b('0x32')][_0x064b('0x3c')]){_0xf8cc31[_0x064b('0x3d')]=_[_0x064b('0x3e')](_0xf8cc31['where'],{'$or':_[_0x064b('0x31')](_0xedecb5,function(_0x30a17c){if(_0x30a17c[_0x064b('0x2e')]!==_0x064b('0x3f')){var _0x5c634a={};_0x5c634a[_0x30a17c[_0x064b('0x29')]]={'$like':'%'+_0x440e4e[_0x064b('0x32')]['filter']+'%'};return _0x5c634a;}})});}_0xf8cc31=_[_0x064b('0x3e')]({},_0xf8cc31,_0x440e4e[_0x064b('0x40')]);var _0x191f49={'where':_0xf8cc31[_0x064b('0x3d')]};return db[_0x064b('0x2c')][_0x064b('0x1e')](_0x191f49)['then'](function(_0x59868f){_0x5e7045['count']=_0x59868f;if(_0x440e4e[_0x064b('0x32')]['includeAll']){_0xf8cc31[_0x064b('0x41')]=[{'all':!![]}];}return db[_0x064b('0x2c')][_0x064b('0x42')](_0xf8cc31);})[_0x064b('0x23')](function(_0x3c46dd){_0x5e7045[_0x064b('0x43')]=_0x3c46dd;return _0x5e7045;})['then'](respondWithFilteredResult(_0x418809,_0xf8cc31))[_0x064b('0x44')](handleError(_0x418809,null));};exports[_0x064b('0x45')]=function(_0x51b6b9,_0x1026d9){var _0x5cf04={'raw':!![],'where':{'id':_0x51b6b9[_0x064b('0x46')]['id']}},_0x478b96={};_0x478b96[_0x064b('0x30')]=_['keys'](db[_0x064b('0x2c')][_0x064b('0x2d')]);_0x478b96['query']=_[_0x064b('0x33')](_0x51b6b9[_0x064b('0x32')]);_0x478b96[_0x064b('0x34')]=_[_0x064b('0x35')](_0x478b96[_0x064b('0x30')],_0x478b96[_0x064b('0x32')]);_0x5cf04[_0x064b('0x36')]=_['intersection'](_0x478b96[_0x064b('0x30')],qs[_0x064b('0x47')](_0x51b6b9[_0x064b('0x32')][_0x064b('0x47')]));_0x5cf04[_0x064b('0x36')]=_0x5cf04['attributes']['length']?_0x5cf04['attributes']:_0x478b96[_0x064b('0x30')];if(_0x51b6b9['query'][_0x064b('0x48')]){_0x5cf04['include']=[{'all':!![]}];}_0x5cf04=_[_0x064b('0x3e')]({},_0x5cf04,_0x51b6b9[_0x064b('0x40')]);return db['Template']['find'](_0x5cf04)[_0x064b('0x23')](handleEntityNotFound(_0x1026d9,null))[_0x064b('0x23')](respondWithResult(_0x1026d9,null))[_0x064b('0x44')](handleError(_0x1026d9,null));};exports[_0x064b('0x49')]=function(_0x4a462,_0x2b2e03){return db[_0x064b('0x2c')][_0x064b('0x49')](_0x4a462[_0x064b('0x4a')],{})[_0x064b('0x23')](function(_0x25f41f){var _0x28eb94=_0x4a462['user'][_0x064b('0x4b')]({'plain':!![]});if(!_0x28eb94)throw new Error(_0x064b('0x4c'));if(_0x28eb94[_0x064b('0x4d')]===_0x064b('0x4e')){var _0x10def9=_0x25f41f[_0x064b('0x4b')]({'plain':!![]});var _0x3f4e0a=_0x064b('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x3f4e0a,'userProfileId':_0x28eb94['userProfileId']},'raw':!![]})[_0x064b('0x23')](function(_0x55a2a1){if(_0x55a2a1&&_0x55a2a1['autoAssociation']===0x0){return db['UserProfileResource'][_0x064b('0x49')]({'name':_0x10def9[_0x064b('0x29')],'resourceId':_0x10def9['id'],'type':_0x55a2a1[_0x064b('0x29')],'sectionId':_0x55a2a1['id']},{})[_0x064b('0x23')](function(){return _0x25f41f;});}else{return _0x25f41f;}})[_0x064b('0x44')](function(_0x114506){logger['error'](_0x064b('0x4f'),_0x114506);throw _0x114506;});}return _0x25f41f;})[_0x064b('0x23')](respondWithResult(_0x2b2e03,0xc9))[_0x064b('0x44')](handleError(_0x2b2e03,null));};exports['update']=function(_0x1c83bf,_0x5b1beb){if(_0x1c83bf[_0x064b('0x4a')]['id']){delete _0x1c83bf[_0x064b('0x4a')]['id'];}return db[_0x064b('0x2c')]['find']({'where':{'id':_0x1c83bf[_0x064b('0x46')]['id']}})[_0x064b('0x23')](handleEntityNotFound(_0x5b1beb,null))['then'](saveUpdates(_0x1c83bf[_0x064b('0x4a')],null))[_0x064b('0x23')](respondWithResult(_0x5b1beb,null))[_0x064b('0x44')](handleError(_0x5b1beb,null));};exports[_0x064b('0x24')]=function(_0x4baeb6,_0x2efb08){return db[_0x064b('0x2c')][_0x064b('0x50')]({'where':{'id':_0x4baeb6[_0x064b('0x46')]['id']}})[_0x064b('0x23')](handleEntityNotFound(_0x2efb08,null))['then'](removeEntity(_0x2efb08,null))[_0x064b('0x44')](handleError(_0x2efb08,null));}; \ No newline at end of file +var _0xd50f=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','Templates','UserProfileResource','stack','name','send','index','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','sort','filter','where','merge','options','Template','includeAll','include','findAll','catch','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4396ed,_0x4c3568){var _0x5e046f=function(_0x3fe7a7){while(--_0x3fe7a7){_0x4396ed['push'](_0x4396ed['shift']());}};_0x5e046f(++_0x4c3568);}(_0xd50f,0x130));var _0xfd50=function(_0x33c5af,_0x13d18a){_0x33c5af=_0x33c5af-0x0;var _0x49707f=_0xd50f[_0x33c5af];return _0x49707f;};'use strict';var emlformat=require(_0xfd50('0x0'));var rimraf=require(_0xfd50('0x1'));var zipdir=require(_0xfd50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfd50('0x3'));var moment=require(_0xfd50('0x4'));var BPromise=require(_0xfd50('0x5'));var Mustache=require(_0xfd50('0x6'));var util=require(_0xfd50('0x7'));var path=require(_0xfd50('0x8'));var sox=require(_0xfd50('0x9'));var csv=require(_0xfd50('0xa'));var ejs=require(_0xfd50('0xb'));var fs=require('fs');var fs_extra=require(_0xfd50('0xc'));var _=require(_0xfd50('0xd'));var squel=require(_0xfd50('0xe'));var crypto=require(_0xfd50('0xf'));var jsforce=require(_0xfd50('0x10'));var deskjs=require(_0xfd50('0x11'));var toCsv=require(_0xfd50('0xa'));var querystring=require(_0xfd50('0x12'));var Papa=require(_0xfd50('0x13'));var Redis=require(_0xfd50('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xfd50('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd50('0x16'));var logger=require(_0xfd50('0x17'))(_0xfd50('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd50('0x19'));var db=require(_0xfd50('0x1a'))['db'];function respondWithStatusCode(_0x5450aa,_0x55f40f){_0x55f40f=_0x55f40f||0xcc;return function(_0x37374d){if(_0x37374d){return _0x5450aa[_0xfd50('0x1b')](_0x55f40f);}return _0x5450aa[_0xfd50('0x1c')](_0x55f40f)[_0xfd50('0x1d')]();};}function respondWithResult(_0x53f7c3,_0x5a6990){_0x5a6990=_0x5a6990||0xc8;return function(_0x5babbc){if(_0x5babbc){return _0x53f7c3[_0xfd50('0x1c')](_0x5a6990)[_0xfd50('0x1e')](_0x5babbc);}};}function respondWithFilteredResult(_0x27cb23,_0x2d554f){return function(_0x5c333b){if(_0x5c333b){var _0x9bfcf9=typeof _0x2d554f[_0xfd50('0x1f')]===_0xfd50('0x20')&&typeof _0x2d554f[_0xfd50('0x21')]===_0xfd50('0x20');var _0x4aa796=_0x5c333b[_0xfd50('0x22')];var _0x64dbcf=_0x9bfcf9?0x0:_0x2d554f[_0xfd50('0x1f')];var _0x158a87=_0x9bfcf9?_0x5c333b[_0xfd50('0x22')]:_0x2d554f[_0xfd50('0x1f')]+_0x2d554f[_0xfd50('0x21')];var _0x4d6cf4;if(_0x158a87>=_0x4aa796){_0x158a87=_0x4aa796;_0x4d6cf4=0xc8;}else{_0x4d6cf4=0xce;}_0x27cb23[_0xfd50('0x1c')](_0x4d6cf4);return _0x27cb23[_0xfd50('0x23')](_0xfd50('0x24'),_0x64dbcf+'-'+_0x158a87+'/'+_0x4aa796)[_0xfd50('0x1e')](_0x5c333b);}return null;};}function patchUpdates(_0x99caad){return function(_0x19ac43){try{jsonpatch['apply'](_0x19ac43,_0x99caad,!![]);}catch(_0x171868){return BPromise[_0xfd50('0x25')](_0x171868);}return _0x19ac43['save']();};}function saveUpdates(_0x1943e5,_0x305331){return function(_0x5c9cd6){if(_0x5c9cd6){return _0x5c9cd6[_0xfd50('0x26')](_0x1943e5)[_0xfd50('0x27')](function(_0x4d74fa){return _0x4d74fa;});}return null;};}function removeEntity(_0x2694fc,_0x4c1875){return function(_0x3b1a8c){if(_0x3b1a8c){return _0x3b1a8c[_0xfd50('0x28')]()[_0xfd50('0x27')](function(){var _0x367558=_0x3b1a8c['get']({'plain':!![]});var _0x210210=_0xfd50('0x29');return db[_0xfd50('0x2a')][_0xfd50('0x28')]({'where':{'type':_0x210210,'resourceId':_0x367558['id']}})[_0xfd50('0x27')](function(){return _0x3b1a8c;});})['then'](function(){_0x2694fc[_0xfd50('0x1c')](0xcc)[_0xfd50('0x1d')]();});}};}function handleEntityNotFound(_0x3b6035,_0x1ea9c5){return function(_0x48f390){if(!_0x48f390){_0x3b6035['sendStatus'](0x194);}return _0x48f390;};}function handleError(_0x93394e,_0x37bbad){_0x37bbad=_0x37bbad||0x1f4;return function(_0x463e25){logger['error'](_0x463e25[_0xfd50('0x2b')]);if(_0x463e25[_0xfd50('0x2c')]){delete _0x463e25[_0xfd50('0x2c')];}_0x93394e[_0xfd50('0x1c')](_0x37bbad)[_0xfd50('0x2d')](_0x463e25);};}exports[_0xfd50('0x2e')]=function(_0x49cda4,_0x4796da){var _0x30a132={},_0xf6a698={},_0x39284f={'count':0x0,'rows':[]};var _0x111635=_['map'](db['Template'][_0xfd50('0x2f')],function(_0xafa0b5){return{'name':_0xafa0b5['fieldName'],'type':_0xafa0b5[_0xfd50('0x30')]['key']};});_0xf6a698[_0xfd50('0x31')]=_[_0xfd50('0x32')](_0x111635,_0xfd50('0x2c'));_0xf6a698['query']=_[_0xfd50('0x33')](_0x49cda4[_0xfd50('0x34')]);_0xf6a698[_0xfd50('0x35')]=_[_0xfd50('0x36')](_0xf6a698[_0xfd50('0x31')],_0xf6a698[_0xfd50('0x34')]);_0x30a132[_0xfd50('0x37')]=_[_0xfd50('0x36')](_0xf6a698['model'],qs[_0xfd50('0x38')](_0x49cda4[_0xfd50('0x34')]['fields']));_0x30a132[_0xfd50('0x37')]=_0x30a132['attributes']['length']?_0x30a132[_0xfd50('0x37')]:_0xf6a698[_0xfd50('0x31')];if(!_0x49cda4[_0xfd50('0x34')]['hasOwnProperty']('nolimit')){_0x30a132[_0xfd50('0x21')]=qs['limit'](_0x49cda4[_0xfd50('0x34')]['limit']);_0x30a132[_0xfd50('0x1f')]=qs[_0xfd50('0x1f')](_0x49cda4[_0xfd50('0x34')][_0xfd50('0x1f')]);}_0x30a132['order']=qs[_0xfd50('0x39')](_0x49cda4['query'][_0xfd50('0x39')]);_0x30a132['where']=qs['filters'](_['pick'](_0x49cda4[_0xfd50('0x34')],_0xf6a698[_0xfd50('0x35')]),_0x111635);if(_0x49cda4['query'][_0xfd50('0x3a')]){_0x30a132[_0xfd50('0x3b')]=_[_0xfd50('0x3c')](_0x30a132['where'],{'$or':_[_0xfd50('0x32')](_0x111635,function(_0x22067c){if(_0x22067c[_0xfd50('0x30')]!=='VIRTUAL'){var _0x50ffde={};_0x50ffde[_0x22067c[_0xfd50('0x2c')]]={'$like':'%'+_0x49cda4[_0xfd50('0x34')][_0xfd50('0x3a')]+'%'};return _0x50ffde;}})});}_0x30a132=_[_0xfd50('0x3c')]({},_0x30a132,_0x49cda4[_0xfd50('0x3d')]);var _0xf70485={'where':_0x30a132[_0xfd50('0x3b')]};return db[_0xfd50('0x3e')][_0xfd50('0x22')](_0xf70485)[_0xfd50('0x27')](function(_0x1d89cb){_0x39284f[_0xfd50('0x22')]=_0x1d89cb;if(_0x49cda4[_0xfd50('0x34')][_0xfd50('0x3f')]){_0x30a132[_0xfd50('0x40')]=[{'all':!![]}];}return db['Template'][_0xfd50('0x41')](_0x30a132);})[_0xfd50('0x27')](function(_0x3a8b7b){_0x39284f['rows']=_0x3a8b7b;return _0x39284f;})[_0xfd50('0x27')](respondWithFilteredResult(_0x4796da,_0x30a132))[_0xfd50('0x42')](handleError(_0x4796da,null));};exports[_0xfd50('0x43')]=function(_0x1ee0da,_0x445be5){var _0x56c49c={'raw':!![],'where':{'id':_0x1ee0da[_0xfd50('0x44')]['id']}},_0x4e9f10={};_0x4e9f10['model']=_['keys'](db[_0xfd50('0x3e')]['rawAttributes']);_0x4e9f10[_0xfd50('0x34')]=_[_0xfd50('0x33')](_0x1ee0da[_0xfd50('0x34')]);_0x4e9f10[_0xfd50('0x35')]=_[_0xfd50('0x36')](_0x4e9f10['model'],_0x4e9f10[_0xfd50('0x34')]);_0x56c49c[_0xfd50('0x37')]=_[_0xfd50('0x36')](_0x4e9f10[_0xfd50('0x31')],qs[_0xfd50('0x38')](_0x1ee0da[_0xfd50('0x34')]['fields']));_0x56c49c[_0xfd50('0x37')]=_0x56c49c[_0xfd50('0x37')][_0xfd50('0x45')]?_0x56c49c[_0xfd50('0x37')]:_0x4e9f10[_0xfd50('0x31')];if(_0x1ee0da[_0xfd50('0x34')][_0xfd50('0x3f')]){_0x56c49c[_0xfd50('0x40')]=[{'all':!![]}];}_0x56c49c=_[_0xfd50('0x3c')]({},_0x56c49c,_0x1ee0da[_0xfd50('0x3d')]);return db[_0xfd50('0x3e')][_0xfd50('0x46')](_0x56c49c)[_0xfd50('0x27')](handleEntityNotFound(_0x445be5,null))[_0xfd50('0x27')](respondWithResult(_0x445be5,null))[_0xfd50('0x42')](handleError(_0x445be5,null));};exports[_0xfd50('0x47')]=function(_0x158af4,_0x2584c2){return db['Template'][_0xfd50('0x47')](_0x158af4[_0xfd50('0x48')],{})[_0xfd50('0x27')](function(_0x16abe5){var _0x477e2c=_0x158af4['user'][_0xfd50('0x49')]({'plain':!![]});if(!_0x477e2c)throw new Error(_0xfd50('0x4a'));if(_0x477e2c[_0xfd50('0x4b')]==='user'){var _0x3834fc=_0x16abe5[_0xfd50('0x49')]({'plain':!![]});var _0x506523=_0xfd50('0x29');return db[_0xfd50('0x4c')]['find']({'where':{'name':_0x506523,'userProfileId':_0x477e2c[_0xfd50('0x4d')]},'raw':!![]})['then'](function(_0x17ed75){if(_0x17ed75&&_0x17ed75[_0xfd50('0x4e')]===0x0){return db['UserProfileResource'][_0xfd50('0x47')]({'name':_0x3834fc[_0xfd50('0x2c')],'resourceId':_0x3834fc['id'],'type':_0x17ed75[_0xfd50('0x2c')],'sectionId':_0x17ed75['id']},{})[_0xfd50('0x27')](function(){return _0x16abe5;});}else{return _0x16abe5;}})['catch'](function(_0x32bacb){logger[_0xfd50('0x4f')](_0xfd50('0x50'),_0x32bacb);throw _0x32bacb;});}return _0x16abe5;})['then'](respondWithResult(_0x2584c2,0xc9))['catch'](handleError(_0x2584c2,null));};exports[_0xfd50('0x26')]=function(_0x4ba931,_0x1ca6b5){if(_0x4ba931[_0xfd50('0x48')]['id']){delete _0x4ba931[_0xfd50('0x48')]['id'];}return db['Template'][_0xfd50('0x46')]({'where':{'id':_0x4ba931[_0xfd50('0x44')]['id']}})[_0xfd50('0x27')](handleEntityNotFound(_0x1ca6b5,null))[_0xfd50('0x27')](saveUpdates(_0x4ba931[_0xfd50('0x48')],null))['then'](respondWithResult(_0x1ca6b5,null))[_0xfd50('0x42')](handleError(_0x1ca6b5,null));};exports[_0xfd50('0x28')]=function(_0x895cc6,_0x3a7e88){return db['Template'][_0xfd50('0x46')]({'where':{'id':_0x895cc6[_0xfd50('0x44')]['id']}})[_0xfd50('0x27')](handleEntityNotFound(_0x3a7e88,null))[_0xfd50('0x27')](removeEntity(_0x3a7e88,null))['catch'](handleError(_0x3a7e88,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 32d4263..1432f41 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 _0x277f=['../../config/environment','exports','Template','tools_templates','util','../../config/logger','moment','bluebird','path'];(function(_0x4a504a,_0x136369){var _0x58eda4=function(_0x20a77c){while(--_0x20a77c){_0x4a504a['push'](_0x4a504a['shift']());}};_0x58eda4(++_0x136369);}(_0x277f,0x1bd));var _0xf277=function(_0x4557ac,_0x3037a9){_0x4557ac=_0x4557ac-0x0;var _0x2b3654=_0x277f[_0x4557ac];return _0x2b3654;};'use strict';var _=require('lodash');var util=require(_0xf277('0x0'));var logger=require(_0xf277('0x1'))('api');var moment=require(_0xf277('0x2'));var BPromise=require(_0xf277('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf277('0x4'));var rimraf=require('rimraf');var config=require(_0xf277('0x5'));var attributes=require('./template.attributes');module[_0xf277('0x6')]=function(_0x831bf0,_0x46c133){return _0x831bf0['define'](_0xf277('0x7'),attributes,{'tableName':_0xf277('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39a7=['path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','util','../../config/logger','api','moment','request-promise'];(function(_0x199939,_0x3d3cb9){var _0x1522b6=function(_0x28fe8a){while(--_0x28fe8a){_0x199939['push'](_0x199939['shift']());}};_0x1522b6(++_0x3d3cb9);}(_0x39a7,0x1e7));var _0x739a=function(_0x488b85,_0x10ec23){_0x488b85=_0x488b85-0x0;var _0x59d07d=_0x39a7[_0x488b85];return _0x59d07d;};'use strict';var _=require('lodash');var util=require(_0x739a('0x0'));var logger=require(_0x739a('0x1'))(_0x739a('0x2'));var moment=require(_0x739a('0x3'));var BPromise=require('bluebird');var rp=require(_0x739a('0x4'));var fs=require('fs');var path=require(_0x739a('0x5'));var rimraf=require(_0x739a('0x6'));var config=require(_0x739a('0x7'));var attributes=require(_0x739a('0x8'));module[_0x739a('0x9')]=function(_0x1d8e7a,_0x20830f){return _0x1d8e7a[_0x739a('0xa')]('Template',attributes,{'tableName':_0x739a('0xb'),'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 1168103..b940129 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 _0xa339=['limit','include','model','map','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','options','raw','where','attributes'];(function(_0x4e4245,_0x18fda2){var _0x4f0435=function(_0x1272a5){while(--_0x1272a5){_0x4e4245['push'](_0x4e4245['shift']());}};_0x4f0435(++_0x18fda2);}(_0xa339,0xac));var _0x9a33=function(_0x556081,_0x5c6fb4){_0x556081=_0x556081-0x0;var _0x5872bf=_0xa339[_0x556081];return _0x5872bf;};'use strict';var _=require('lodash');var util=require(_0x9a33('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a33('0x1'));var fs=require('fs');var Redis=require(_0x9a33('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a33('0x3'));var logger=require(_0x9a33('0x4'))('rpc');var config=require(_0x9a33('0x5'));var jayson=require(_0x9a33('0x6'));var client=jayson['client'][_0x9a33('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2944f5,_0x4afaf3,_0x466d39){return new BPromise(function(_0x5b0ac4,_0x256b4d){return client['request'](_0x2944f5,_0x466d39)[_0x9a33('0x8')](function(_0x115a0e){logger[_0x9a33('0x9')]('Template,\x20%s,\x20%s',_0x4afaf3,_0x9a33('0xa'));logger[_0x9a33('0xb')]('Template,\x20%s,\x20%s,\x20%s',_0x4afaf3,_0x9a33('0xa'),JSON[_0x9a33('0xc')](_0x115a0e));if(_0x115a0e[_0x9a33('0xd')]){if(_0x115a0e['error'][_0x9a33('0xe')]===0x1f4){logger[_0x9a33('0xd')](_0x9a33('0xf'),_0x4afaf3,_0x115a0e[_0x9a33('0xd')][_0x9a33('0x10')]);return _0x256b4d(_0x115a0e[_0x9a33('0xd')]['message']);}logger[_0x9a33('0xd')](_0x9a33('0xf'),_0x4afaf3,_0x115a0e[_0x9a33('0xd')][_0x9a33('0x10')]);return _0x5b0ac4(_0x115a0e[_0x9a33('0xd')][_0x9a33('0x10')]);}else{logger['info'](_0x9a33('0xf'),_0x4afaf3,_0x9a33('0xa'));_0x5b0ac4(_0x115a0e['result'][_0x9a33('0x10')]);}})[_0x9a33('0x11')](function(_0x28d8cb){logger['error'](_0x9a33('0xf'),_0x4afaf3,_0x28d8cb);_0x256b4d(_0x28d8cb);});});}exports[_0x9a33('0x12')]=function(_0x47532f){var _0x1ff692=this;return new Promise(function(_0x5d1b38,_0x14b1d6){return db[_0x9a33('0x13')]['findAll']({'raw':_0x47532f[_0x9a33('0x14')]?_0x47532f['options'][_0x9a33('0x15')]===undefined?!![]:![]:!![],'where':_0x47532f['options']?_0x47532f[_0x9a33('0x14')][_0x9a33('0x16')]||null:null,'attributes':_0x47532f[_0x9a33('0x14')]?_0x47532f[_0x9a33('0x14')][_0x9a33('0x17')]||null:null,'limit':_0x47532f[_0x9a33('0x14')]?_0x47532f['options'][_0x9a33('0x18')]||null:null,'include':_0x47532f['options']?_0x47532f[_0x9a33('0x14')][_0x9a33('0x19')]?_['map'](_0x47532f[_0x9a33('0x14')][_0x9a33('0x19')],function(_0x5c23ad){return{'model':db[_0x5c23ad[_0x9a33('0x1a')]],'as':_0x5c23ad['as'],'attributes':_0x5c23ad[_0x9a33('0x17')],'include':_0x5c23ad[_0x9a33('0x19')]?_['map'](_0x5c23ad[_0x9a33('0x19')],function(_0x3ac2ee){return{'model':db[_0x3ac2ee[_0x9a33('0x1a')]],'as':_0x3ac2ee['as'],'attributes':_0x3ac2ee[_0x9a33('0x17')],'include':_0x3ac2ee[_0x9a33('0x19')]?_[_0x9a33('0x1b')](_0x3ac2ee[_0x9a33('0x19')],function(_0x2de559){return{'model':db[_0x2de559['model']],'as':_0x2de559['as'],'attributes':_0x2de559[_0x9a33('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1da89f){logger[_0x9a33('0x9')](_0x9a33('0x12'),_0x47532f);logger[_0x9a33('0xb')](_0x9a33('0x12'),_0x47532f,JSON[_0x9a33('0xc')](_0x1da89f));_0x5d1b38(_0x1da89f);})[_0x9a33('0x11')](function(_0x3640c5){logger[_0x9a33('0xd')](_0x9a33('0x12'),_0x3640c5[_0x9a33('0x10')],_0x47532f);_0x14b1d6(_0x1ff692['error'](0x1f4,_0x3640c5['message']));});});}; \ No newline at end of file +var _0xb313=['debug','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x34f9e1,_0xa3c565){var _0xdea2c2=function(_0x1439a6){while(--_0x1439a6){_0x34f9e1['push'](_0x34f9e1['shift']());}};_0xdea2c2(++_0xa3c565);}(_0xb313,0x142));var _0x3b31=function(_0x590863,_0x5a74d5){_0x590863=_0x590863-0x0;var _0x5c26d4=_0xb313[_0x590863];return _0x5c26d4;};'use strict';var _=require(_0x3b31('0x0'));var util=require(_0x3b31('0x1'));var moment=require(_0x3b31('0x2'));var BPromise=require(_0x3b31('0x3'));var rs=require(_0x3b31('0x4'));var fs=require('fs');var Redis=require(_0x3b31('0x5'));var db=require(_0x3b31('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b31('0x7'));var config=require('../../config/environment');var jayson=require(_0x3b31('0x8'));var client=jayson[_0x3b31('0x9')][_0x3b31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11fe0a,_0x20d02b,_0x4a5947){return new BPromise(function(_0x192a8d,_0x2267b3){return client[_0x3b31('0xb')](_0x11fe0a,_0x4a5947)[_0x3b31('0xc')](function(_0x448314){logger['info']('Template,\x20%s,\x20%s',_0x20d02b,_0x3b31('0xd'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x20d02b,_0x3b31('0xd'),JSON[_0x3b31('0xe')](_0x448314));if(_0x448314[_0x3b31('0xf')]){if(_0x448314[_0x3b31('0xf')][_0x3b31('0x10')]===0x1f4){logger[_0x3b31('0xf')](_0x3b31('0x11'),_0x20d02b,_0x448314[_0x3b31('0xf')]['message']);return _0x2267b3(_0x448314[_0x3b31('0xf')]['message']);}logger[_0x3b31('0xf')](_0x3b31('0x11'),_0x20d02b,_0x448314[_0x3b31('0xf')][_0x3b31('0x12')]);return _0x192a8d(_0x448314[_0x3b31('0xf')]['message']);}else{logger[_0x3b31('0x13')](_0x3b31('0x11'),_0x20d02b,'request\x20sent');_0x192a8d(_0x448314[_0x3b31('0x14')][_0x3b31('0x12')]);}})[_0x3b31('0x15')](function(_0x5d3eca){logger['error'](_0x3b31('0x11'),_0x20d02b,_0x5d3eca);_0x2267b3(_0x5d3eca);});});}exports['GetTemplate']=function(_0x4f5569){var _0x480a33=this;return new Promise(function(_0x1b008c,_0x401e14){return db['Template'][_0x3b31('0x16')]({'raw':_0x4f5569[_0x3b31('0x17')]?_0x4f5569[_0x3b31('0x17')][_0x3b31('0x18')]===undefined?!![]:![]:!![],'where':_0x4f5569[_0x3b31('0x17')]?_0x4f5569[_0x3b31('0x17')]['where']||null:null,'attributes':_0x4f5569['options']?_0x4f5569[_0x3b31('0x17')][_0x3b31('0x19')]||null:null,'limit':_0x4f5569['options']?_0x4f5569['options'][_0x3b31('0x1a')]||null:null,'include':_0x4f5569['options']?_0x4f5569['options'][_0x3b31('0x1b')]?_[_0x3b31('0x1c')](_0x4f5569[_0x3b31('0x17')]['include'],function(_0x4fb835){return{'model':db[_0x4fb835[_0x3b31('0x1d')]],'as':_0x4fb835['as'],'attributes':_0x4fb835[_0x3b31('0x19')],'include':_0x4fb835['include']?_[_0x3b31('0x1c')](_0x4fb835[_0x3b31('0x1b')],function(_0x21bfb5){return{'model':db[_0x21bfb5[_0x3b31('0x1d')]],'as':_0x21bfb5['as'],'attributes':_0x21bfb5[_0x3b31('0x19')],'include':_0x21bfb5[_0x3b31('0x1b')]?_[_0x3b31('0x1c')](_0x21bfb5['include'],function(_0x2e1e9b){return{'model':db[_0x2e1e9b[_0x3b31('0x1d')]],'as':_0x2e1e9b['as'],'attributes':_0x2e1e9b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57ad6e){logger[_0x3b31('0x13')]('GetTemplate',_0x4f5569);logger[_0x3b31('0x1e')](_0x3b31('0x1f'),_0x4f5569,JSON[_0x3b31('0xe')](_0x57ad6e));_0x1b008c(_0x57ad6e);})[_0x3b31('0x15')](function(_0x4189db){logger['error'](_0x3b31('0x1f'),_0x4189db['message'],_0x4f5569);_0x401e14(_0x480a33['error'](0x1f4,_0x4189db[_0x3b31('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 56000d7..b0978c1 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 _0x1cf1=['addAnyCondition','/:id/actions','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','post','create','/:id/all_conditions'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x1cf1,0x10e));var _0x11cf=function(_0x4804bf,_0x15c5c9){_0x4804bf=_0x4804bf-0x0;var _0x32258a=_0x1cf1[_0x4804bf];return _0x32258a;};'use strict';var multer=require(_0x11cf('0x0'));var util=require('util');var path=require(_0x11cf('0x1'));var timeout=require(_0x11cf('0x2'));var express=require(_0x11cf('0x3'));var router=express[_0x11cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x11cf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x11cf('0x6'));router[_0x11cf('0x7')]('/',auth[_0x11cf('0x8')](),controller[_0x11cf('0x9')]);router['get'](_0x11cf('0xa'),auth[_0x11cf('0x8')](),controller['show']);router[_0x11cf('0x7')]('/:id/all_conditions',auth[_0x11cf('0x8')](),controller[_0x11cf('0xb')]);router[_0x11cf('0x7')](_0x11cf('0xc'),auth[_0x11cf('0x8')](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0x11cf('0x8')](),controller['getActions']);router[_0x11cf('0xd')]('/',auth[_0x11cf('0x8')](),controller[_0x11cf('0xe')]);router[_0x11cf('0xd')](_0x11cf('0xf'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0x11cf('0xd')](_0x11cf('0xc'),auth[_0x11cf('0x8')](),controller[_0x11cf('0x10')]);router[_0x11cf('0xd')](_0x11cf('0x11'),auth[_0x11cf('0x8')](),controller['addAction']);router['put'](_0x11cf('0xa'),auth[_0x11cf('0x8')](),controller[_0x11cf('0x12')]);router[_0x11cf('0x13')](_0x11cf('0xa'),auth['isAuthenticated'](),controller[_0x11cf('0x14')]);module[_0x11cf('0x15')]=router; \ No newline at end of file +var _0xa316=['addAllCondition','addAnyCondition','addAction','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','/:id/all_conditions'];(function(_0x252805,_0x1d1e8e){var _0x3e74b9=function(_0x16d7a0){while(--_0x16d7a0){_0x252805['push'](_0x252805['shift']());}};_0x3e74b9(++_0x1d1e8e);}(_0xa316,0x1af));var _0x6a31=function(_0x170f0a,_0x15fad9){_0x170f0a=_0x170f0a-0x0;var _0x5f27a2=_0xa316[_0x170f0a];return _0x5f27a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a31('0x0'));var timeout=require(_0x6a31('0x1'));var express=require(_0x6a31('0x2'));var router=express[_0x6a31('0x3')]();var fs_extra=require(_0x6a31('0x4'));var auth=require(_0x6a31('0x5'));var interaction=require(_0x6a31('0x6'));var config=require('../../config/environment');var controller=require(_0x6a31('0x7'));router[_0x6a31('0x8')]('/',auth[_0x6a31('0x9')](),controller[_0x6a31('0xa')]);router[_0x6a31('0x8')](_0x6a31('0xb'),auth[_0x6a31('0x9')](),controller['show']);router[_0x6a31('0x8')]('/:id/all_conditions',auth[_0x6a31('0x9')](),controller[_0x6a31('0xc')]);router[_0x6a31('0x8')](_0x6a31('0xd'),auth[_0x6a31('0x9')](),controller['getAnyConditions']);router[_0x6a31('0x8')](_0x6a31('0xe'),auth[_0x6a31('0x9')](),controller[_0x6a31('0xf')]);router[_0x6a31('0x10')]('/',auth[_0x6a31('0x9')](),controller[_0x6a31('0x11')]);router[_0x6a31('0x10')](_0x6a31('0x12'),auth['isAuthenticated'](),controller[_0x6a31('0x13')]);router[_0x6a31('0x10')]('/:id/any_conditions',auth[_0x6a31('0x9')](),controller[_0x6a31('0x14')]);router[_0x6a31('0x10')](_0x6a31('0xe'),auth['isAuthenticated'](),controller[_0x6a31('0x15')]);router['put'](_0x6a31('0xb'),auth[_0x6a31('0x9')](),controller[_0x6a31('0x16')]);router[_0x6a31('0x17')]('/:id',auth[_0x6a31('0x9')](),controller['destroy']);module[_0x6a31('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cd2db7b..97c3d43 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 _0xae74=['STRING','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xae74,0x88));var _0x4ae7=function(_0x4668ba,_0x397bfa){_0x4668ba=_0x4668ba-0x0;var _0x4fd61b=_0xae74[_0x4668ba];return _0x4fd61b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ae7('0x0')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4ae7('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x69c5=['BOOLEAN','exports','STRING'];(function(_0x1d851f,_0x705272){var _0x586475=function(_0x47b6bd){while(--_0x47b6bd){_0x1d851f['push'](_0x1d851f['shift']());}};_0x586475(++_0x705272);}(_0x69c5,0x70));var _0x569c=function(_0x4fdf57,_0x11d1c5){_0x4fdf57=_0x4fdf57-0x0;var _0x52ea61=_0x69c5[_0x4fdf57];return _0x52ea61;};'use strict';var Sequelize=require('sequelize');module[_0x569c('0x0')]={'name':{'type':Sequelize[_0x569c('0x1')]},'channel':{'type':Sequelize[_0x569c('0x1')]},'description':{'type':Sequelize[_0x569c('0x1')]},'status':{'type':Sequelize[_0x569c('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f13e154..69f627c 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 _0x506f=['getActions','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','nolimit','order','sort','pick','where','merge','map','VIRTUAL','filter','options','Trigger','include','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','addAction','TriggerId','Action'];(function(_0x581b48,_0x4bb9eb){var _0x25dc85=function(_0x41c3f7){while(--_0x41c3f7){_0x581b48['push'](_0x581b48['shift']());}};_0x25dc85(++_0x4bb9eb);}(_0x506f,0x116));var _0xf506=function(_0x4d8f02,_0x4881ca){_0x4d8f02=_0x4d8f02-0x0;var _0xae5602=_0x506f[_0x4d8f02];return _0xae5602;};'use strict';var emlformat=require(_0xf506('0x0'));var rimraf=require(_0xf506('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf506('0x2'));var rp=require(_0xf506('0x3'));var moment=require(_0xf506('0x4'));var BPromise=require(_0xf506('0x5'));var Mustache=require('mustache');var util=require(_0xf506('0x6'));var path=require('path');var sox=require(_0xf506('0x7'));var csv=require(_0xf506('0x8'));var ejs=require(_0xf506('0x9'));var fs=require('fs');var fs_extra=require(_0xf506('0xa'));var _=require(_0xf506('0xb'));var squel=require(_0xf506('0xc'));var crypto=require('crypto');var jsforce=require(_0xf506('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf506('0x8'));var querystring=require(_0xf506('0xe'));var Papa=require(_0xf506('0xf'));var Redis=require('ioredis');var authService=require(_0xf506('0x10'));var qs=require(_0xf506('0x11'));var as=require(_0xf506('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf506('0x13'))('api');var utils=require(_0xf506('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf506('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f603f,_0x24e228){_0x24e228=_0x24e228||0xcc;return function(_0x3c53d1){if(_0x3c53d1){return _0x1f603f[_0xf506('0x16')](_0x24e228);}return _0x1f603f[_0xf506('0x17')](_0x24e228)[_0xf506('0x18')]();};}function respondWithResult(_0x35d293,_0x35613e){_0x35613e=_0x35613e||0xc8;return function(_0x1e9b6c){if(_0x1e9b6c){return _0x35d293['status'](_0x35613e)[_0xf506('0x19')](_0x1e9b6c);}};}function respondWithFilteredResult(_0x382c23,_0x59c3ad){return function(_0x4cbec2){if(_0x4cbec2){var _0x2ce545=typeof _0x59c3ad[_0xf506('0x1a')]===_0xf506('0x1b')&&typeof _0x59c3ad[_0xf506('0x1c')]==='undefined';var _0x33a747=_0x4cbec2['count'];var _0x23da94=_0x2ce545?0x0:_0x59c3ad['offset'];var _0x1b9416=_0x2ce545?_0x4cbec2[_0xf506('0x1d')]:_0x59c3ad[_0xf506('0x1a')]+_0x59c3ad[_0xf506('0x1c')];var _0x1fb295;if(_0x1b9416>=_0x33a747){_0x1b9416=_0x33a747;_0x1fb295=0xc8;}else{_0x1fb295=0xce;}_0x382c23['status'](_0x1fb295);return _0x382c23[_0xf506('0x1e')]('Content-Range',_0x23da94+'-'+_0x1b9416+'/'+_0x33a747)[_0xf506('0x19')](_0x4cbec2);}return null;};}function patchUpdates(_0x246ac5){return function(_0x790b23){try{jsonpatch[_0xf506('0x1f')](_0x790b23,_0x246ac5,!![]);}catch(_0x147a8c){return BPromise['reject'](_0x147a8c);}return _0x790b23['save']();};}function saveUpdates(_0x495c26,_0x5c4bca){return function(_0x29b996){if(_0x29b996){return _0x29b996[_0xf506('0x20')](_0x495c26)[_0xf506('0x21')](function(_0x12960f){return _0x12960f;});}return null;};}function removeEntity(_0x17f7dc,_0x12c339){return function(_0x1c8df3){if(_0x1c8df3){return _0x1c8df3[_0xf506('0x22')]()['then'](function(){var _0x159e33=_0x1c8df3[_0xf506('0x23')]({'plain':!![]});var _0x27f06a=_0xf506('0x24');return db[_0xf506('0x25')][_0xf506('0x22')]({'where':{'type':_0x27f06a,'resourceId':_0x159e33['id']}})[_0xf506('0x21')](function(){return _0x1c8df3;});})[_0xf506('0x21')](function(){_0x17f7dc[_0xf506('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3844f2,_0x3fa428){return function(_0x5d9fab){if(!_0x5d9fab){_0x3844f2[_0xf506('0x16')](0x194);}return _0x5d9fab;};}function handleError(_0x59929b,_0x55f7f7){_0x55f7f7=_0x55f7f7||0x1f4;return function(_0x2d0d35){logger[_0xf506('0x26')](_0x2d0d35[_0xf506('0x27')]);if(_0x2d0d35[_0xf506('0x28')]){delete _0x2d0d35[_0xf506('0x28')];}_0x59929b[_0xf506('0x17')](_0x55f7f7)[_0xf506('0x29')](_0x2d0d35);};}exports[_0xf506('0x2a')]=function(_0x3f2e22,_0x443335){var _0x1fdfb0={},_0xb2a14c={},_0x2a99b6={'count':0x0,'rows':[]};var _0x33ca4c=_['map'](db['Trigger'][_0xf506('0x2b')],function(_0x1ba808){return{'name':_0x1ba808[_0xf506('0x2c')],'type':_0x1ba808[_0xf506('0x2d')][_0xf506('0x2e')]};});_0xb2a14c['model']=_['map'](_0x33ca4c,'name');_0xb2a14c[_0xf506('0x2f')]=_[_0xf506('0x30')](_0x3f2e22[_0xf506('0x2f')]);_0xb2a14c[_0xf506('0x31')]=_['intersection'](_0xb2a14c['model'],_0xb2a14c[_0xf506('0x2f')]);_0x1fdfb0[_0xf506('0x32')]=_[_0xf506('0x33')](_0xb2a14c['model'],qs[_0xf506('0x34')](_0x3f2e22[_0xf506('0x2f')][_0xf506('0x34')]));_0x1fdfb0['attributes']=_0x1fdfb0[_0xf506('0x32')][_0xf506('0x35')]?_0x1fdfb0['attributes']:_0xb2a14c[_0xf506('0x36')];if(!_0x3f2e22[_0xf506('0x2f')]['hasOwnProperty'](_0xf506('0x37'))){_0x1fdfb0[_0xf506('0x1c')]=qs[_0xf506('0x1c')](_0x3f2e22[_0xf506('0x2f')]['limit']);_0x1fdfb0['offset']=qs[_0xf506('0x1a')](_0x3f2e22['query'][_0xf506('0x1a')]);}_0x1fdfb0[_0xf506('0x38')]=qs[_0xf506('0x39')](_0x3f2e22[_0xf506('0x2f')][_0xf506('0x39')]);_0x1fdfb0['where']=qs[_0xf506('0x31')](_[_0xf506('0x3a')](_0x3f2e22[_0xf506('0x2f')],_0xb2a14c[_0xf506('0x31')]),_0x33ca4c);if(_0x3f2e22[_0xf506('0x2f')]['filter']){_0x1fdfb0[_0xf506('0x3b')]=_[_0xf506('0x3c')](_0x1fdfb0[_0xf506('0x3b')],{'$or':_[_0xf506('0x3d')](_0x33ca4c,function(_0x288a48){if(_0x288a48['type']!==_0xf506('0x3e')){var _0x5710c1={};_0x5710c1[_0x288a48[_0xf506('0x28')]]={'$like':'%'+_0x3f2e22['query'][_0xf506('0x3f')]+'%'};return _0x5710c1;}})});}_0x1fdfb0=_[_0xf506('0x3c')]({},_0x1fdfb0,_0x3f2e22[_0xf506('0x40')]);var _0x1f5cfb={'where':_0x1fdfb0[_0xf506('0x3b')]};return db[_0xf506('0x41')]['count'](_0x1f5cfb)['then'](function(_0x52701b){_0x2a99b6[_0xf506('0x1d')]=_0x52701b;if(_0x3f2e22[_0xf506('0x2f')]['includeAll']){_0x1fdfb0[_0xf506('0x42')]=[{'all':!![]}];}return db[_0xf506('0x41')][_0xf506('0x43')](_0x1fdfb0);})['then'](function(_0x538ebe){_0x2a99b6[_0xf506('0x44')]=_0x538ebe;return _0x2a99b6;})[_0xf506('0x21')](respondWithFilteredResult(_0x443335,_0x1fdfb0))[_0xf506('0x45')](handleError(_0x443335,null));};exports[_0xf506('0x46')]=function(_0x2e17f3,_0x54979f){var _0x266950={'raw':![],'where':{'id':_0x2e17f3['params']['id']}},_0x533ae9={};_0x533ae9[_0xf506('0x36')]=_['keys'](db[_0xf506('0x41')][_0xf506('0x2b')]);_0x533ae9[_0xf506('0x2f')]=_[_0xf506('0x30')](_0x2e17f3[_0xf506('0x2f')]);_0x533ae9[_0xf506('0x31')]=_['intersection'](_0x533ae9[_0xf506('0x36')],_0x533ae9[_0xf506('0x2f')]);_0x266950['attributes']=_['intersection'](_0x533ae9[_0xf506('0x36')],qs[_0xf506('0x34')](_0x2e17f3[_0xf506('0x2f')]['fields']));_0x266950[_0xf506('0x32')]=_0x266950[_0xf506('0x32')][_0xf506('0x35')]?_0x266950['attributes']:_0x533ae9[_0xf506('0x36')];if(_0x2e17f3[_0xf506('0x2f')][_0xf506('0x47')]){_0x266950[_0xf506('0x42')]=[{'all':!![]}];}_0x266950=_[_0xf506('0x3c')]({},_0x266950,_0x2e17f3[_0xf506('0x40')]);return db[_0xf506('0x41')]['find'](_0x266950)[_0xf506('0x21')](handleEntityNotFound(_0x54979f,null))[_0xf506('0x21')](respondWithResult(_0x54979f,null))[_0xf506('0x45')](handleError(_0x54979f,null));};exports[_0xf506('0x48')]=function(_0x5c432f,_0x263415){return db[_0xf506('0x41')][_0xf506('0x48')](_0x5c432f[_0xf506('0x49')],{})[_0xf506('0x21')](function(_0x445e67){var _0x952850=_0x5c432f[_0xf506('0x4a')]['get']({'plain':!![]});if(!_0x952850)throw new Error(_0xf506('0x4b'));if(_0x952850[_0xf506('0x4c')]==='user'){var _0x1031db=_0x445e67['get']({'plain':!![]});var _0xf251c1=_0xf506('0x24');return db[_0xf506('0x4d')][_0xf506('0x4e')]({'where':{'name':_0xf251c1,'userProfileId':_0x952850['userProfileId']},'raw':!![]})[_0xf506('0x21')](function(_0x379467){if(_0x379467&&_0x379467[_0xf506('0x4f')]===0x0){return db['UserProfileResource'][_0xf506('0x48')]({'name':_0x1031db[_0xf506('0x28')],'resourceId':_0x1031db['id'],'type':_0x379467[_0xf506('0x28')],'sectionId':_0x379467['id']},{})[_0xf506('0x21')](function(){return _0x445e67;});}else{return _0x445e67;}})['catch'](function(_0x31cf92){logger['error'](_0xf506('0x50'),_0x31cf92);throw _0x31cf92;});}return _0x445e67;})[_0xf506('0x21')](respondWithResult(_0x263415,0xc9))['catch'](handleError(_0x263415,null));};exports[_0xf506('0x20')]=function(_0x549f45,_0x24057c){if(_0x549f45[_0xf506('0x49')]['id']){delete _0x549f45[_0xf506('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x549f45[_0xf506('0x51')]['id']}})[_0xf506('0x21')](handleEntityNotFound(_0x24057c,null))['then'](saveUpdates(_0x549f45[_0xf506('0x49')],null))[_0xf506('0x21')](respondWithResult(_0x24057c,null))[_0xf506('0x45')](handleError(_0x24057c,null));};exports[_0xf506('0x22')]=function(_0x8359c2,_0x551139){return db[_0xf506('0x41')]['find']({'where':{'id':_0x8359c2[_0xf506('0x51')]['id']}})[_0xf506('0x21')](handleEntityNotFound(_0x551139,null))[_0xf506('0x21')](removeEntity(_0x551139,null))[_0xf506('0x45')](handleError(_0x551139,null));};exports['addAllCondition']=function(_0x473f41,_0xec8f2e,_0x4098f6){if(_0x473f41[_0xf506('0x49')]['id']){delete _0x473f41[_0xf506('0x49')]['id'];}return db['Trigger'][_0xf506('0x4e')]({'where':{'id':_0x473f41['params']['id']}})['then'](handleEntityNotFound(_0xec8f2e,null))['then'](function(_0x1e7370){if(_0x1e7370){_0x473f41[_0xf506('0x49')]['TriggerAllId']=_0x1e7370['id'];return db[_0xf506('0x52')][_0xf506('0x48')](_0x473f41[_0xf506('0x49')]);}})[_0xf506('0x21')](respondWithResult(_0xec8f2e,null))[_0xf506('0x45')](handleError(_0xec8f2e,null));};exports[_0xf506('0x53')]=function(_0x74c4a7,_0x4283d7,_0xbcd66d){if(_0x74c4a7[_0xf506('0x49')]['id']){delete _0x74c4a7[_0xf506('0x49')]['id'];}return db['Trigger'][_0xf506('0x4e')]({'where':{'id':_0x74c4a7[_0xf506('0x51')]['id']}})[_0xf506('0x21')](handleEntityNotFound(_0x4283d7,null))[_0xf506('0x21')](function(_0x12711c){if(_0x12711c){_0x74c4a7[_0xf506('0x49')][_0xf506('0x54')]=_0x12711c['id'];return db[_0xf506('0x52')][_0xf506('0x48')](_0x74c4a7[_0xf506('0x49')]);}})[_0xf506('0x21')](respondWithResult(_0x4283d7,null))[_0xf506('0x45')](handleError(_0x4283d7,null));};exports[_0xf506('0x55')]=function(_0x3b075e,_0x4e193c,_0x1be9cd){var _0x965b60={};var _0x45d2df={};var _0x58420b;var _0x3159d1;return db[_0xf506('0x41')][_0xf506('0x56')]({'where':{'id':_0x3b075e[_0xf506('0x51')]['id']}})[_0xf506('0x21')](handleEntityNotFound(_0x4e193c,null))[_0xf506('0x21')](function(_0x4e774a){if(_0x4e774a){_0x58420b=_0x4e774a;_0x45d2df['model']=_['keys'](db[_0xf506('0x52')][_0xf506('0x2b')]);_0x45d2df[_0xf506('0x2f')]=_[_0xf506('0x30')](_0x3b075e['query']);_0x45d2df[_0xf506('0x31')]=_[_0xf506('0x33')](_0x45d2df[_0xf506('0x36')],_0x45d2df[_0xf506('0x2f')]);_0x965b60[_0xf506('0x32')]=_['intersection'](_0x45d2df[_0xf506('0x36')],qs[_0xf506('0x34')](_0x3b075e['query'][_0xf506('0x34')]));_0x965b60['attributes']=_0x965b60[_0xf506('0x32')][_0xf506('0x35')]?_0x965b60[_0xf506('0x32')]:_0x45d2df[_0xf506('0x36')];_0x965b60[_0xf506('0x38')]=qs[_0xf506('0x39')](_0x3b075e[_0xf506('0x2f')][_0xf506('0x39')]);_0x965b60[_0xf506('0x3b')]=qs[_0xf506('0x31')](_[_0xf506('0x3a')](_0x3b075e['query'],_0x45d2df[_0xf506('0x31')]));if(_0x3b075e[_0xf506('0x2f')]['filter']){_0x965b60[_0xf506('0x3b')]=_['merge'](_0x965b60[_0xf506('0x3b')],{'$or':_[_0xf506('0x3d')](_0x965b60['attributes'],function(_0x194f58){var _0x4281e3={};_0x4281e3[_0x194f58]={'$like':'%'+_0x3b075e[_0xf506('0x2f')][_0xf506('0x3f')]+'%'};return _0x4281e3;})});}_0x965b60=_[_0xf506('0x3c')]({},_0x965b60,_0x3b075e['options']);return _0x58420b['getAllConditions'](_0x965b60);}})[_0xf506('0x21')](function(_0x38c80c){if(_0x38c80c){_0x3159d1=_0x38c80c[_0xf506('0x35')];if(!_0x3b075e[_0xf506('0x2f')]['hasOwnProperty'](_0xf506('0x37'))){_0x965b60['limit']=qs[_0xf506('0x1c')](_0x3b075e['query'][_0xf506('0x1c')]);_0x965b60[_0xf506('0x1a')]=qs[_0xf506('0x1a')](_0x3b075e[_0xf506('0x2f')][_0xf506('0x1a')]);}return _0x58420b['getAllConditions'](_0x965b60);}})['then'](function(_0xb27eba){if(_0xb27eba){return _0xb27eba?{'count':_0x3159d1,'rows':_0xb27eba}:null;}})[_0xf506('0x21')](respondWithResult(_0x4e193c,null))['catch'](handleError(_0x4e193c,null));};exports['getAnyConditions']=function(_0x4aedb9,_0x31913c,_0x3c9c48){var _0x440f6c={};var _0x17cea0={};var _0x2b3072;var _0x54b35f;return db['Trigger'][_0xf506('0x56')]({'where':{'id':_0x4aedb9['params']['id']}})['then'](handleEntityNotFound(_0x31913c,null))['then'](function(_0xe0b883){if(_0xe0b883){_0x2b3072=_0xe0b883;_0x17cea0['model']=_[_0xf506('0x30')](db[_0xf506('0x52')]['rawAttributes']);_0x17cea0[_0xf506('0x2f')]=_[_0xf506('0x30')](_0x4aedb9[_0xf506('0x2f')]);_0x17cea0[_0xf506('0x31')]=_[_0xf506('0x33')](_0x17cea0[_0xf506('0x36')],_0x17cea0[_0xf506('0x2f')]);_0x440f6c[_0xf506('0x32')]=_[_0xf506('0x33')](_0x17cea0[_0xf506('0x36')],qs['fields'](_0x4aedb9[_0xf506('0x2f')][_0xf506('0x34')]));_0x440f6c[_0xf506('0x32')]=_0x440f6c['attributes'][_0xf506('0x35')]?_0x440f6c[_0xf506('0x32')]:_0x17cea0[_0xf506('0x36')];_0x440f6c[_0xf506('0x38')]=qs['sort'](_0x4aedb9['query'][_0xf506('0x39')]);_0x440f6c[_0xf506('0x3b')]=qs[_0xf506('0x31')](_[_0xf506('0x3a')](_0x4aedb9['query'],_0x17cea0[_0xf506('0x31')]));if(_0x4aedb9[_0xf506('0x2f')]['filter']){_0x440f6c['where']=_[_0xf506('0x3c')](_0x440f6c[_0xf506('0x3b')],{'$or':_[_0xf506('0x3d')](_0x440f6c[_0xf506('0x32')],function(_0x247a0b){var _0x4188e2={};_0x4188e2[_0x247a0b]={'$like':'%'+_0x4aedb9[_0xf506('0x2f')][_0xf506('0x3f')]+'%'};return _0x4188e2;})});}_0x440f6c=_[_0xf506('0x3c')]({},_0x440f6c,_0x4aedb9[_0xf506('0x40')]);return _0x2b3072['getAnyConditions'](_0x440f6c);}})[_0xf506('0x21')](function(_0x181b50){if(_0x181b50){_0x54b35f=_0x181b50[_0xf506('0x35')];if(!_0x4aedb9['query']['hasOwnProperty'](_0xf506('0x37'))){_0x440f6c[_0xf506('0x1c')]=qs[_0xf506('0x1c')](_0x4aedb9[_0xf506('0x2f')][_0xf506('0x1c')]);_0x440f6c[_0xf506('0x1a')]=qs['offset'](_0x4aedb9[_0xf506('0x2f')][_0xf506('0x1a')]);}return _0x2b3072['getAnyConditions'](_0x440f6c);}})['then'](function(_0x19f9d1){if(_0x19f9d1){return _0x19f9d1?{'count':_0x54b35f,'rows':_0x19f9d1}:null;}})[_0xf506('0x21')](respondWithResult(_0x31913c,null))[_0xf506('0x45')](handleError(_0x31913c,null));};exports[_0xf506('0x57')]=function(_0x182071,_0x55a468,_0x5e7644){if(_0x182071[_0xf506('0x49')]['id']){delete _0x182071['body']['id'];}return db[_0xf506('0x41')][_0xf506('0x4e')]({'where':{'id':_0x182071[_0xf506('0x51')]['id']}})[_0xf506('0x21')](handleEntityNotFound(_0x55a468,null))[_0xf506('0x21')](function(_0x20cad5){if(_0x20cad5){_0x182071[_0xf506('0x49')][_0xf506('0x58')]=_0x20cad5['id'];return db[_0xf506('0x59')][_0xf506('0x48')](_0x182071['body']);}})[_0xf506('0x21')](respondWithResult(_0x55a468,null))['catch'](handleError(_0x55a468,null));};exports[_0xf506('0x5a')]=function(_0x2b4ef9,_0x5ac588,_0x4416f0){var _0xff29d5={};var _0x3038fd={};var _0x1d9969;var _0x29b059;return db[_0xf506('0x41')][_0xf506('0x56')]({'where':{'id':_0x2b4ef9[_0xf506('0x51')]['id']}})[_0xf506('0x21')](handleEntityNotFound(_0x5ac588,null))[_0xf506('0x21')](function(_0x2ce558){if(_0x2ce558){_0x1d9969=_0x2ce558;_0x3038fd['model']=_['keys'](db[_0xf506('0x59')][_0xf506('0x2b')]);_0x3038fd['query']=_[_0xf506('0x30')](_0x2b4ef9[_0xf506('0x2f')]);_0x3038fd[_0xf506('0x31')]=_['intersection'](_0x3038fd[_0xf506('0x36')],_0x3038fd['query']);_0xff29d5[_0xf506('0x32')]=_[_0xf506('0x33')](_0x3038fd[_0xf506('0x36')],qs[_0xf506('0x34')](_0x2b4ef9[_0xf506('0x2f')][_0xf506('0x34')]));_0xff29d5[_0xf506('0x32')]=_0xff29d5[_0xf506('0x32')][_0xf506('0x35')]?_0xff29d5[_0xf506('0x32')]:_0x3038fd['model'];_0xff29d5[_0xf506('0x38')]=qs[_0xf506('0x39')](_0x2b4ef9[_0xf506('0x2f')][_0xf506('0x39')]);_0xff29d5['where']=qs[_0xf506('0x31')](_[_0xf506('0x3a')](_0x2b4ef9[_0xf506('0x2f')],_0x3038fd[_0xf506('0x31')]));if(_0x2b4ef9[_0xf506('0x2f')][_0xf506('0x3f')]){_0xff29d5[_0xf506('0x3b')]=_[_0xf506('0x3c')](_0xff29d5[_0xf506('0x3b')],{'$or':_['map'](_0xff29d5[_0xf506('0x32')],function(_0x115903){var _0x5d64db={};_0x5d64db[_0x115903]={'$like':'%'+_0x2b4ef9[_0xf506('0x2f')][_0xf506('0x3f')]+'%'};return _0x5d64db;})});}_0xff29d5=_[_0xf506('0x3c')]({},_0xff29d5,_0x2b4ef9[_0xf506('0x40')]);return _0x1d9969['getActions'](_0xff29d5);}})[_0xf506('0x21')](function(_0x5b3083){if(_0x5b3083){_0x29b059=_0x5b3083[_0xf506('0x35')];if(!_0x2b4ef9[_0xf506('0x2f')][_0xf506('0x5b')](_0xf506('0x37'))){_0xff29d5[_0xf506('0x1c')]=qs[_0xf506('0x1c')](_0x2b4ef9['query'][_0xf506('0x1c')]);_0xff29d5['offset']=qs['offset'](_0x2b4ef9[_0xf506('0x2f')][_0xf506('0x1a')]);}return _0x1d9969[_0xf506('0x5a')](_0xff29d5);}})[_0xf506('0x21')](function(_0x52ff31){if(_0x52ff31){return _0x52ff31?{'count':_0x29b059,'rows':_0x52ff31}:null;}})[_0xf506('0x21')](respondWithResult(_0x5ac588,null))['catch'](handleError(_0x5ac588,null));}; \ No newline at end of file +var _0x428b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','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','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','filter','getAnyConditions','findOne','addAction','TriggerId','Action','getActions'];(function(_0x40f369,_0x11e309){var _0xd22cea=function(_0x7e2d5b){while(--_0x7e2d5b){_0x40f369['push'](_0x40f369['shift']());}};_0xd22cea(++_0x11e309);}(_0x428b,0x18c));var _0xb428=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x428b[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xb428('0x0'));var rimraf=require(_0xb428('0x1'));var zipdir=require(_0xb428('0x2'));var jsonpatch=require(_0xb428('0x3'));var rp=require(_0xb428('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb428('0x5'));var util=require(_0xb428('0x6'));var path=require(_0xb428('0x7'));var sox=require(_0xb428('0x8'));var csv=require(_0xb428('0x9'));var ejs=require(_0xb428('0xa'));var fs=require('fs');var fs_extra=require(_0xb428('0xb'));var _=require(_0xb428('0xc'));var squel=require(_0xb428('0xd'));var crypto=require(_0xb428('0xe'));var jsforce=require(_0xb428('0xf'));var deskjs=require(_0xb428('0x10'));var toCsv=require(_0xb428('0x9'));var querystring=require('querystring');var Papa=require(_0xb428('0x11'));var Redis=require(_0xb428('0x12'));var authService=require(_0xb428('0x13'));var qs=require(_0xb428('0x14'));var as=require(_0xb428('0x15'));var hardwareService=require(_0xb428('0x16'));var logger=require('../../config/logger')(_0xb428('0x17'));var utils=require(_0xb428('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb428('0x19'))['db'];function respondWithStatusCode(_0x29cd10,_0xea6e1a){_0xea6e1a=_0xea6e1a||0xcc;return function(_0x330f3b){if(_0x330f3b){return _0x29cd10['sendStatus'](_0xea6e1a);}return _0x29cd10[_0xb428('0x1a')](_0xea6e1a)[_0xb428('0x1b')]();};}function respondWithResult(_0x2c4847,_0x54ffc8){_0x54ffc8=_0x54ffc8||0xc8;return function(_0x4b7d58){if(_0x4b7d58){return _0x2c4847['status'](_0x54ffc8)[_0xb428('0x1c')](_0x4b7d58);}};}function respondWithFilteredResult(_0x218178,_0x14be58){return function(_0x1a2055){if(_0x1a2055){var _0x13efb7=typeof _0x14be58[_0xb428('0x1d')]===_0xb428('0x1e')&&typeof _0x14be58[_0xb428('0x1f')]===_0xb428('0x1e');var _0x5e22ef=_0x1a2055['count'];var _0x1090be=_0x13efb7?0x0:_0x14be58['offset'];var _0x11ba06=_0x13efb7?_0x1a2055[_0xb428('0x20')]:_0x14be58[_0xb428('0x1d')]+_0x14be58[_0xb428('0x1f')];var _0x189d1f;if(_0x11ba06>=_0x5e22ef){_0x11ba06=_0x5e22ef;_0x189d1f=0xc8;}else{_0x189d1f=0xce;}_0x218178[_0xb428('0x1a')](_0x189d1f);return _0x218178[_0xb428('0x21')]('Content-Range',_0x1090be+'-'+_0x11ba06+'/'+_0x5e22ef)[_0xb428('0x1c')](_0x1a2055);}return null;};}function patchUpdates(_0x11277e){return function(_0x37d022){try{jsonpatch[_0xb428('0x22')](_0x37d022,_0x11277e,!![]);}catch(_0x4d38d4){return BPromise[_0xb428('0x23')](_0x4d38d4);}return _0x37d022[_0xb428('0x24')]();};}function saveUpdates(_0x497d64,_0x1b23ea){return function(_0x51a188){if(_0x51a188){return _0x51a188[_0xb428('0x25')](_0x497d64)[_0xb428('0x26')](function(_0x2be104){return _0x2be104;});}return null;};}function removeEntity(_0x14bc6c,_0x1c91b2){return function(_0x160f7c){if(_0x160f7c){return _0x160f7c['destroy']()[_0xb428('0x26')](function(){var _0x3aee52=_0x160f7c[_0xb428('0x27')]({'plain':!![]});var _0x47def1=_0xb428('0x28');return db[_0xb428('0x29')][_0xb428('0x2a')]({'where':{'type':_0x47def1,'resourceId':_0x3aee52['id']}})[_0xb428('0x26')](function(){return _0x160f7c;});})[_0xb428('0x26')](function(){_0x14bc6c['status'](0xcc)[_0xb428('0x1b')]();});}};}function handleEntityNotFound(_0x249643,_0x5b0e3e){return function(_0x235861){if(!_0x235861){_0x249643['sendStatus'](0x194);}return _0x235861;};}function handleError(_0x3557a3,_0xeeedc8){_0xeeedc8=_0xeeedc8||0x1f4;return function(_0x5cc46a){logger[_0xb428('0x2b')](_0x5cc46a[_0xb428('0x2c')]);if(_0x5cc46a['name']){delete _0x5cc46a[_0xb428('0x2d')];}_0x3557a3[_0xb428('0x1a')](_0xeeedc8)[_0xb428('0x2e')](_0x5cc46a);};}exports[_0xb428('0x2f')]=function(_0x27f3a3,_0x5d5eae){var _0x4ca886={},_0x3d3c15={},_0x1051ae={'count':0x0,'rows':[]};var _0x5e3d57=_['map'](db[_0xb428('0x30')][_0xb428('0x31')],function(_0x5ee387){return{'name':_0x5ee387[_0xb428('0x32')],'type':_0x5ee387['type'][_0xb428('0x33')]};});_0x3d3c15[_0xb428('0x34')]=_['map'](_0x5e3d57,_0xb428('0x2d'));_0x3d3c15[_0xb428('0x35')]=_[_0xb428('0x36')](_0x27f3a3[_0xb428('0x35')]);_0x3d3c15[_0xb428('0x37')]=_[_0xb428('0x38')](_0x3d3c15['model'],_0x3d3c15[_0xb428('0x35')]);_0x4ca886['attributes']=_[_0xb428('0x38')](_0x3d3c15[_0xb428('0x34')],qs[_0xb428('0x39')](_0x27f3a3['query']['fields']));_0x4ca886['attributes']=_0x4ca886[_0xb428('0x3a')][_0xb428('0x3b')]?_0x4ca886[_0xb428('0x3a')]:_0x3d3c15[_0xb428('0x34')];if(!_0x27f3a3[_0xb428('0x35')][_0xb428('0x3c')](_0xb428('0x3d'))){_0x4ca886['limit']=qs[_0xb428('0x1f')](_0x27f3a3[_0xb428('0x35')][_0xb428('0x1f')]);_0x4ca886['offset']=qs[_0xb428('0x1d')](_0x27f3a3[_0xb428('0x35')][_0xb428('0x1d')]);}_0x4ca886[_0xb428('0x3e')]=qs[_0xb428('0x3f')](_0x27f3a3[_0xb428('0x35')][_0xb428('0x3f')]);_0x4ca886[_0xb428('0x40')]=qs[_0xb428('0x37')](_[_0xb428('0x41')](_0x27f3a3[_0xb428('0x35')],_0x3d3c15[_0xb428('0x37')]),_0x5e3d57);if(_0x27f3a3[_0xb428('0x35')]['filter']){_0x4ca886['where']=_[_0xb428('0x42')](_0x4ca886['where'],{'$or':_[_0xb428('0x43')](_0x5e3d57,function(_0x471643){if(_0x471643[_0xb428('0x44')]!==_0xb428('0x45')){var _0x493051={};_0x493051[_0x471643[_0xb428('0x2d')]]={'$like':'%'+_0x27f3a3[_0xb428('0x35')]['filter']+'%'};return _0x493051;}})});}_0x4ca886=_[_0xb428('0x42')]({},_0x4ca886,_0x27f3a3[_0xb428('0x46')]);var _0x57d438={'where':_0x4ca886[_0xb428('0x40')]};return db['Trigger'][_0xb428('0x20')](_0x57d438)[_0xb428('0x26')](function(_0x22f851){_0x1051ae['count']=_0x22f851;if(_0x27f3a3[_0xb428('0x35')][_0xb428('0x47')]){_0x4ca886[_0xb428('0x48')]=[{'all':!![]}];}return db[_0xb428('0x30')][_0xb428('0x49')](_0x4ca886);})['then'](function(_0x458135){_0x1051ae[_0xb428('0x4a')]=_0x458135;return _0x1051ae;})[_0xb428('0x26')](respondWithFilteredResult(_0x5d5eae,_0x4ca886))[_0xb428('0x4b')](handleError(_0x5d5eae,null));};exports[_0xb428('0x4c')]=function(_0x45aefb,_0x2dc85e){var _0xec8101={'raw':![],'where':{'id':_0x45aefb[_0xb428('0x4d')]['id']}},_0x2cdeb7={};_0x2cdeb7[_0xb428('0x34')]=_[_0xb428('0x36')](db[_0xb428('0x30')][_0xb428('0x31')]);_0x2cdeb7[_0xb428('0x35')]=_[_0xb428('0x36')](_0x45aefb['query']);_0x2cdeb7[_0xb428('0x37')]=_[_0xb428('0x38')](_0x2cdeb7[_0xb428('0x34')],_0x2cdeb7[_0xb428('0x35')]);_0xec8101['attributes']=_['intersection'](_0x2cdeb7[_0xb428('0x34')],qs[_0xb428('0x39')](_0x45aefb[_0xb428('0x35')][_0xb428('0x39')]));_0xec8101[_0xb428('0x3a')]=_0xec8101[_0xb428('0x3a')][_0xb428('0x3b')]?_0xec8101[_0xb428('0x3a')]:_0x2cdeb7[_0xb428('0x34')];if(_0x45aefb[_0xb428('0x35')][_0xb428('0x47')]){_0xec8101['include']=[{'all':!![]}];}_0xec8101=_[_0xb428('0x42')]({},_0xec8101,_0x45aefb[_0xb428('0x46')]);return db['Trigger'][_0xb428('0x4e')](_0xec8101)['then'](handleEntityNotFound(_0x2dc85e,null))[_0xb428('0x26')](respondWithResult(_0x2dc85e,null))['catch'](handleError(_0x2dc85e,null));};exports[_0xb428('0x4f')]=function(_0x273a2b,_0x595cb0){return db[_0xb428('0x30')][_0xb428('0x4f')](_0x273a2b['body'],{})[_0xb428('0x26')](function(_0x18d512){var _0x1440fa=_0x273a2b[_0xb428('0x50')]['get']({'plain':!![]});if(!_0x1440fa)throw new Error(_0xb428('0x51'));if(_0x1440fa[_0xb428('0x52')]===_0xb428('0x50')){var _0xf2eabb=_0x18d512[_0xb428('0x27')]({'plain':!![]});var _0x3cbfea=_0xb428('0x28');return db['UserProfileSection'][_0xb428('0x4e')]({'where':{'name':_0x3cbfea,'userProfileId':_0x1440fa[_0xb428('0x53')]},'raw':!![]})['then'](function(_0x293b0a){if(_0x293b0a&&_0x293b0a[_0xb428('0x54')]===0x0){return db[_0xb428('0x29')][_0xb428('0x4f')]({'name':_0xf2eabb[_0xb428('0x2d')],'resourceId':_0xf2eabb['id'],'type':_0x293b0a['name'],'sectionId':_0x293b0a['id']},{})[_0xb428('0x26')](function(){return _0x18d512;});}else{return _0x18d512;}})[_0xb428('0x4b')](function(_0x21bca2){logger[_0xb428('0x2b')](_0xb428('0x55'),_0x21bca2);throw _0x21bca2;});}return _0x18d512;})[_0xb428('0x26')](respondWithResult(_0x595cb0,0xc9))[_0xb428('0x4b')](handleError(_0x595cb0,null));};exports[_0xb428('0x25')]=function(_0x59a6ed,_0x3b2dd5){if(_0x59a6ed[_0xb428('0x56')]['id']){delete _0x59a6ed['body']['id'];}return db[_0xb428('0x30')][_0xb428('0x4e')]({'where':{'id':_0x59a6ed[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x3b2dd5,null))[_0xb428('0x26')](saveUpdates(_0x59a6ed['body'],null))['then'](respondWithResult(_0x3b2dd5,null))[_0xb428('0x4b')](handleError(_0x3b2dd5,null));};exports['destroy']=function(_0x5653b1,_0x24485f){return db[_0xb428('0x30')]['find']({'where':{'id':_0x5653b1[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x24485f,null))[_0xb428('0x26')](removeEntity(_0x24485f,null))[_0xb428('0x4b')](handleError(_0x24485f,null));};exports[_0xb428('0x57')]=function(_0x4d090b,_0x2fc8cb,_0x547339){if(_0x4d090b[_0xb428('0x56')]['id']){delete _0x4d090b[_0xb428('0x56')]['id'];}return db[_0xb428('0x30')]['find']({'where':{'id':_0x4d090b['params']['id']}})['then'](handleEntityNotFound(_0x2fc8cb,null))[_0xb428('0x26')](function(_0x1224c9){if(_0x1224c9){_0x4d090b[_0xb428('0x56')][_0xb428('0x58')]=_0x1224c9['id'];return db[_0xb428('0x59')]['create'](_0x4d090b[_0xb428('0x56')]);}})[_0xb428('0x26')](respondWithResult(_0x2fc8cb,null))[_0xb428('0x4b')](handleError(_0x2fc8cb,null));};exports[_0xb428('0x5a')]=function(_0x4b1f00,_0x2fc9cc,_0x54c6f6){if(_0x4b1f00[_0xb428('0x56')]['id']){delete _0x4b1f00[_0xb428('0x56')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4b1f00[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x2fc9cc,null))['then'](function(_0x970bcb){if(_0x970bcb){_0x4b1f00[_0xb428('0x56')]['TriggerAnyId']=_0x970bcb['id'];return db[_0xb428('0x59')][_0xb428('0x4f')](_0x4b1f00[_0xb428('0x56')]);}})[_0xb428('0x26')](respondWithResult(_0x2fc9cc,null))[_0xb428('0x4b')](handleError(_0x2fc9cc,null));};exports[_0xb428('0x5b')]=function(_0x2024f7,_0x572bd4,_0x2ffa66){var _0x241b30={};var _0x2a8e30={};var _0x56707e;var _0xac5b6e;return db[_0xb428('0x30')]['findOne']({'where':{'id':_0x2024f7[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x572bd4,null))[_0xb428('0x26')](function(_0x17e01e){if(_0x17e01e){_0x56707e=_0x17e01e;_0x2a8e30[_0xb428('0x34')]=_['keys'](db[_0xb428('0x59')][_0xb428('0x31')]);_0x2a8e30['query']=_[_0xb428('0x36')](_0x2024f7[_0xb428('0x35')]);_0x2a8e30[_0xb428('0x37')]=_['intersection'](_0x2a8e30['model'],_0x2a8e30['query']);_0x241b30[_0xb428('0x3a')]=_[_0xb428('0x38')](_0x2a8e30[_0xb428('0x34')],qs['fields'](_0x2024f7[_0xb428('0x35')][_0xb428('0x39')]));_0x241b30['attributes']=_0x241b30[_0xb428('0x3a')][_0xb428('0x3b')]?_0x241b30[_0xb428('0x3a')]:_0x2a8e30[_0xb428('0x34')];_0x241b30[_0xb428('0x3e')]=qs[_0xb428('0x3f')](_0x2024f7[_0xb428('0x35')]['sort']);_0x241b30['where']=qs[_0xb428('0x37')](_[_0xb428('0x41')](_0x2024f7[_0xb428('0x35')],_0x2a8e30[_0xb428('0x37')]));if(_0x2024f7['query'][_0xb428('0x5c')]){_0x241b30[_0xb428('0x40')]=_[_0xb428('0x42')](_0x241b30[_0xb428('0x40')],{'$or':_[_0xb428('0x43')](_0x241b30[_0xb428('0x3a')],function(_0x54dc08){var _0x2b37bc={};_0x2b37bc[_0x54dc08]={'$like':'%'+_0x2024f7[_0xb428('0x35')][_0xb428('0x5c')]+'%'};return _0x2b37bc;})});}_0x241b30=_[_0xb428('0x42')]({},_0x241b30,_0x2024f7[_0xb428('0x46')]);return _0x56707e[_0xb428('0x5b')](_0x241b30);}})['then'](function(_0x28070f){if(_0x28070f){_0xac5b6e=_0x28070f[_0xb428('0x3b')];if(!_0x2024f7[_0xb428('0x35')][_0xb428('0x3c')](_0xb428('0x3d'))){_0x241b30[_0xb428('0x1f')]=qs[_0xb428('0x1f')](_0x2024f7[_0xb428('0x35')][_0xb428('0x1f')]);_0x241b30[_0xb428('0x1d')]=qs[_0xb428('0x1d')](_0x2024f7['query']['offset']);}return _0x56707e[_0xb428('0x5b')](_0x241b30);}})['then'](function(_0x53d372){if(_0x53d372){return _0x53d372?{'count':_0xac5b6e,'rows':_0x53d372}:null;}})['then'](respondWithResult(_0x572bd4,null))[_0xb428('0x4b')](handleError(_0x572bd4,null));};exports[_0xb428('0x5d')]=function(_0x4b4418,_0xfa19c4,_0xad63fb){var _0x2abd2a={};var _0x277704={};var _0x446428;var _0x2ae6d2;return db[_0xb428('0x30')][_0xb428('0x5e')]({'where':{'id':_0x4b4418[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0xfa19c4,null))[_0xb428('0x26')](function(_0x960dcd){if(_0x960dcd){_0x446428=_0x960dcd;_0x277704[_0xb428('0x34')]=_['keys'](db['Condition'][_0xb428('0x31')]);_0x277704[_0xb428('0x35')]=_['keys'](_0x4b4418[_0xb428('0x35')]);_0x277704[_0xb428('0x37')]=_[_0xb428('0x38')](_0x277704[_0xb428('0x34')],_0x277704[_0xb428('0x35')]);_0x2abd2a[_0xb428('0x3a')]=_[_0xb428('0x38')](_0x277704['model'],qs[_0xb428('0x39')](_0x4b4418[_0xb428('0x35')][_0xb428('0x39')]));_0x2abd2a[_0xb428('0x3a')]=_0x2abd2a['attributes']['length']?_0x2abd2a['attributes']:_0x277704[_0xb428('0x34')];_0x2abd2a[_0xb428('0x3e')]=qs['sort'](_0x4b4418[_0xb428('0x35')]['sort']);_0x2abd2a[_0xb428('0x40')]=qs['filters'](_[_0xb428('0x41')](_0x4b4418[_0xb428('0x35')],_0x277704[_0xb428('0x37')]));if(_0x4b4418[_0xb428('0x35')][_0xb428('0x5c')]){_0x2abd2a[_0xb428('0x40')]=_['merge'](_0x2abd2a[_0xb428('0x40')],{'$or':_[_0xb428('0x43')](_0x2abd2a[_0xb428('0x3a')],function(_0x52013e){var _0x49f8dd={};_0x49f8dd[_0x52013e]={'$like':'%'+_0x4b4418[_0xb428('0x35')]['filter']+'%'};return _0x49f8dd;})});}_0x2abd2a=_[_0xb428('0x42')]({},_0x2abd2a,_0x4b4418[_0xb428('0x46')]);return _0x446428['getAnyConditions'](_0x2abd2a);}})[_0xb428('0x26')](function(_0x4561aa){if(_0x4561aa){_0x2ae6d2=_0x4561aa[_0xb428('0x3b')];if(!_0x4b4418[_0xb428('0x35')][_0xb428('0x3c')](_0xb428('0x3d'))){_0x2abd2a[_0xb428('0x1f')]=qs[_0xb428('0x1f')](_0x4b4418['query'][_0xb428('0x1f')]);_0x2abd2a[_0xb428('0x1d')]=qs[_0xb428('0x1d')](_0x4b4418['query'][_0xb428('0x1d')]);}return _0x446428[_0xb428('0x5d')](_0x2abd2a);}})[_0xb428('0x26')](function(_0x282136){if(_0x282136){return _0x282136?{'count':_0x2ae6d2,'rows':_0x282136}:null;}})[_0xb428('0x26')](respondWithResult(_0xfa19c4,null))['catch'](handleError(_0xfa19c4,null));};exports[_0xb428('0x5f')]=function(_0x1a1c15,_0x414eaa,_0x15b0c5){if(_0x1a1c15['body']['id']){delete _0x1a1c15[_0xb428('0x56')]['id'];}return db[_0xb428('0x30')]['find']({'where':{'id':_0x1a1c15[_0xb428('0x4d')]['id']}})['then'](handleEntityNotFound(_0x414eaa,null))[_0xb428('0x26')](function(_0x4ce070){if(_0x4ce070){_0x1a1c15[_0xb428('0x56')][_0xb428('0x60')]=_0x4ce070['id'];return db[_0xb428('0x61')][_0xb428('0x4f')](_0x1a1c15[_0xb428('0x56')]);}})[_0xb428('0x26')](respondWithResult(_0x414eaa,null))['catch'](handleError(_0x414eaa,null));};exports[_0xb428('0x62')]=function(_0x211052,_0x46caab,_0x2ffe53){var _0x5b693a={};var _0x1f1d8d={};var _0x3a8415;var _0x487ad7;return db['Trigger'][_0xb428('0x5e')]({'where':{'id':_0x211052[_0xb428('0x4d')]['id']}})['then'](handleEntityNotFound(_0x46caab,null))[_0xb428('0x26')](function(_0x312254){if(_0x312254){_0x3a8415=_0x312254;_0x1f1d8d[_0xb428('0x34')]=_['keys'](db['Action'][_0xb428('0x31')]);_0x1f1d8d[_0xb428('0x35')]=_[_0xb428('0x36')](_0x211052[_0xb428('0x35')]);_0x1f1d8d[_0xb428('0x37')]=_[_0xb428('0x38')](_0x1f1d8d[_0xb428('0x34')],_0x1f1d8d[_0xb428('0x35')]);_0x5b693a['attributes']=_['intersection'](_0x1f1d8d[_0xb428('0x34')],qs[_0xb428('0x39')](_0x211052[_0xb428('0x35')][_0xb428('0x39')]));_0x5b693a[_0xb428('0x3a')]=_0x5b693a[_0xb428('0x3a')][_0xb428('0x3b')]?_0x5b693a[_0xb428('0x3a')]:_0x1f1d8d[_0xb428('0x34')];_0x5b693a[_0xb428('0x3e')]=qs[_0xb428('0x3f')](_0x211052[_0xb428('0x35')][_0xb428('0x3f')]);_0x5b693a[_0xb428('0x40')]=qs[_0xb428('0x37')](_[_0xb428('0x41')](_0x211052['query'],_0x1f1d8d['filters']));if(_0x211052['query'][_0xb428('0x5c')]){_0x5b693a[_0xb428('0x40')]=_['merge'](_0x5b693a[_0xb428('0x40')],{'$or':_[_0xb428('0x43')](_0x5b693a[_0xb428('0x3a')],function(_0x21e7e8){var _0x3d3c14={};_0x3d3c14[_0x21e7e8]={'$like':'%'+_0x211052[_0xb428('0x35')][_0xb428('0x5c')]+'%'};return _0x3d3c14;})});}_0x5b693a=_['merge']({},_0x5b693a,_0x211052[_0xb428('0x46')]);return _0x3a8415[_0xb428('0x62')](_0x5b693a);}})['then'](function(_0x35d0ce){if(_0x35d0ce){_0x487ad7=_0x35d0ce['length'];if(!_0x211052['query'][_0xb428('0x3c')](_0xb428('0x3d'))){_0x5b693a['limit']=qs[_0xb428('0x1f')](_0x211052[_0xb428('0x35')][_0xb428('0x1f')]);_0x5b693a[_0xb428('0x1d')]=qs[_0xb428('0x1d')](_0x211052[_0xb428('0x35')]['offset']);}return _0x3a8415[_0xb428('0x62')](_0x5b693a);}})[_0xb428('0x26')](function(_0x1d5021){if(_0x1d5021){return _0x1d5021?{'count':_0x487ad7,'rows':_0x1d5021}:null;}})[_0xb428('0x26')](respondWithResult(_0x46caab,null))[_0xb428('0x4b')](handleError(_0x46caab,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 8274a59..794ae6a 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 _0x5577=['./trigger.attributes','define','Trigger','tools_triggers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x186331,_0x221b31){var _0x25fb2b=function(_0x248cc7){while(--_0x248cc7){_0x186331['push'](_0x186331['shift']());}};_0x25fb2b(++_0x221b31);}(_0x5577,0x1b4));var _0x7557=function(_0x5d8297,_0x186af8){_0x5d8297=_0x5d8297-0x0;var _0x58dbb6=_0x5577[_0x5d8297];return _0x58dbb6;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var logger=require(_0x7557('0x1'))(_0x7557('0x2'));var moment=require('moment');var BPromise=require(_0x7557('0x3'));var rp=require(_0x7557('0x4'));var fs=require('fs');var path=require(_0x7557('0x5'));var rimraf=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var attributes=require(_0x7557('0x8'));module['exports']=function(_0x7bb8c,_0x41a4a5){return _0x7bb8c[_0x7557('0x9')](_0x7557('0xa'),attributes,{'tableName':_0x7557('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1061=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','lodash','moment','bluebird'];(function(_0x22e7fb,_0x33373d){var _0x4a5f8b=function(_0x56bab5){while(--_0x56bab5){_0x22e7fb['push'](_0x22e7fb['shift']());}};_0x4a5f8b(++_0x33373d);}(_0x1061,0x1b5));var _0x1106=function(_0x40a19a,_0x53cbb6){_0x40a19a=_0x40a19a-0x0;var _0x2db7ad=_0x1061[_0x40a19a];return _0x2db7ad;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1106('0x1'));var BPromise=require(_0x1106('0x2'));var rp=require(_0x1106('0x3'));var fs=require('fs');var path=require(_0x1106('0x4'));var rimraf=require(_0x1106('0x5'));var config=require(_0x1106('0x6'));var attributes=require(_0x1106('0x7'));module[_0x1106('0x8')]=function(_0x5120c6,_0x1f098a){return _0x5120c6[_0x1106('0x9')]('Trigger',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 4f5dff1..f7c4ef0 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 _0x1652=['error','code','message','catch','Trigger','findAll','options','raw','where','attributes','limit','model','include','map','GetTrigger','ShowTrigger','find','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e1d92,_0x3ef92e){var _0x5eaeec=function(_0x4d6b22){while(--_0x4d6b22){_0x1e1d92['push'](_0x1e1d92['shift']());}};_0x5eaeec(++_0x3ef92e);}(_0x1652,0x129));var _0x2165=function(_0x53fb63,_0x2497b0){_0x53fb63=_0x53fb63-0x0;var _0x3fd488=_0x1652[_0x53fb63];return _0x3fd488;};'use strict';var _=require(_0x2165('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2165('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2165('0x2'))['db'];var utils=require(_0x2165('0x3'));var logger=require(_0x2165('0x4'))(_0x2165('0x5'));var config=require(_0x2165('0x6'));var jayson=require(_0x2165('0x7'));var client=jayson[_0x2165('0x8')][_0x2165('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b7999,_0x35a13c,_0x1210c3){return new BPromise(function(_0x37d523,_0x291215){return client[_0x2165('0xa')](_0x4b7999,_0x1210c3)[_0x2165('0xb')](function(_0x2f83f7){logger[_0x2165('0xc')](_0x2165('0xd'),_0x35a13c,_0x2165('0xe'));logger[_0x2165('0xf')](_0x2165('0x10'),_0x35a13c,'request\x20sent',JSON[_0x2165('0x11')](_0x2f83f7));if(_0x2f83f7[_0x2165('0x12')]){if(_0x2f83f7['error'][_0x2165('0x13')]===0x1f4){logger[_0x2165('0x12')](_0x2165('0xd'),_0x35a13c,_0x2f83f7[_0x2165('0x12')][_0x2165('0x14')]);return _0x291215(_0x2f83f7[_0x2165('0x12')][_0x2165('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x35a13c,_0x2f83f7['error'][_0x2165('0x14')]);return _0x37d523(_0x2f83f7[_0x2165('0x12')][_0x2165('0x14')]);}else{logger[_0x2165('0xc')](_0x2165('0xd'),_0x35a13c,_0x2165('0xe'));_0x37d523(_0x2f83f7['result']['message']);}})[_0x2165('0x15')](function(_0x32b589){logger[_0x2165('0x12')]('Trigger,\x20%s,\x20%s',_0x35a13c,_0x32b589);_0x291215(_0x32b589);});});}exports['GetTrigger']=function(_0x17c06d){var _0x2c9d6c=this;return new Promise(function(_0x2b6ea3,_0x414daf){return db[_0x2165('0x16')][_0x2165('0x17')]({'raw':_0x17c06d[_0x2165('0x18')]?_0x17c06d[_0x2165('0x18')][_0x2165('0x19')]===undefined?!![]:![]:!![],'where':_0x17c06d[_0x2165('0x18')]?_0x17c06d[_0x2165('0x18')][_0x2165('0x1a')]||null:null,'attributes':_0x17c06d['options']?_0x17c06d['options'][_0x2165('0x1b')]||null:null,'limit':_0x17c06d[_0x2165('0x18')]?_0x17c06d[_0x2165('0x18')][_0x2165('0x1c')]||null:null,'include':_0x17c06d[_0x2165('0x18')]?_0x17c06d[_0x2165('0x18')]['include']?_['map'](_0x17c06d[_0x2165('0x18')]['include'],function(_0x413e01){return{'model':db[_0x413e01[_0x2165('0x1d')]],'as':_0x413e01['as'],'attributes':_0x413e01[_0x2165('0x1b')],'include':_0x413e01[_0x2165('0x1e')]?_[_0x2165('0x1f')](_0x413e01['include'],function(_0xbbf628){return{'model':db[_0xbbf628[_0x2165('0x1d')]],'as':_0xbbf628['as'],'attributes':_0xbbf628['attributes'],'include':_0xbbf628[_0x2165('0x1e')]?_[_0x2165('0x1f')](_0xbbf628[_0x2165('0x1e')],function(_0x3dd916){return{'model':db[_0x3dd916[_0x2165('0x1d')]],'as':_0x3dd916['as'],'attributes':_0x3dd916['attributes']};}):[]};}):[]};}):[]:[]})[_0x2165('0xb')](function(_0x51825e){logger[_0x2165('0xc')](_0x2165('0x20'),_0x17c06d);logger[_0x2165('0xf')](_0x2165('0x20'),_0x17c06d,JSON[_0x2165('0x11')](_0x51825e));_0x2b6ea3(_0x51825e);})[_0x2165('0x15')](function(_0x53d0bc){logger[_0x2165('0x12')](_0x2165('0x20'),_0x53d0bc[_0x2165('0x14')],_0x17c06d);_0x414daf(_0x2c9d6c[_0x2165('0x12')](0x1f4,_0x53d0bc['message']));});});};exports[_0x2165('0x21')]=function(_0x4195ed){var _0x2e2611=this;return new Promise(function(_0x5ecffc,_0xe96c5c){return db[_0x2165('0x16')][_0x2165('0x22')]({'raw':_0x4195ed[_0x2165('0x18')]?_0x4195ed[_0x2165('0x18')][_0x2165('0x19')]===undefined?!![]:![]:!![],'where':_0x4195ed[_0x2165('0x18')]?_0x4195ed[_0x2165('0x18')][_0x2165('0x1a')]||null:null,'attributes':_0x4195ed['options']?_0x4195ed['options']['attributes']||null:null,'include':_0x4195ed['options']?_0x4195ed[_0x2165('0x18')]['include']?_['map'](_0x4195ed[_0x2165('0x18')][_0x2165('0x1e')],function(_0x313186){return{'model':db[_0x313186[_0x2165('0x1d')]],'as':_0x313186['as'],'attributes':_0x313186[_0x2165('0x1b')],'include':_0x313186['include']?_[_0x2165('0x1f')](_0x313186[_0x2165('0x1e')],function(_0x57e460){return{'model':db[_0x57e460[_0x2165('0x1d')]],'as':_0x57e460['as'],'attributes':_0x57e460['attributes'],'include':_0x57e460[_0x2165('0x1e')]?_[_0x2165('0x1f')](_0x57e460[_0x2165('0x1e')],function(_0x57ab8c){return{'model':db[_0x57ab8c['model']],'as':_0x57ab8c['as'],'attributes':_0x57ab8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x2165('0xb')](function(_0x53ee30){logger[_0x2165('0xc')]('ShowTrigger',_0x4195ed);logger[_0x2165('0xf')](_0x2165('0x21'),_0x4195ed,JSON['stringify'](_0x53ee30));_0x5ecffc(_0x53ee30);})[_0x2165('0x15')](function(_0x1e6077){logger[_0x2165('0x12')](_0x2165('0x21'),_0x1e6077[_0x2165('0x14')],_0x4195ed);_0xe96c5c(_0x2e2611['error'](0x1f4,_0x1e6077['message']));});});}; \ No newline at end of file +var _0x9ee3=['GetTrigger','Trigger','findAll','raw','options','where','attributes','limit','include','model','map','ShowTrigger','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x32bef6,_0x5cfe2b){var _0x20cb76=function(_0x4c6eaf){while(--_0x4c6eaf){_0x32bef6['push'](_0x32bef6['shift']());}};_0x20cb76(++_0x5cfe2b);}(_0x9ee3,0x6c));var _0x39ee=function(_0x18362f,_0x137297){_0x18362f=_0x18362f-0x0;var _0xe36dbc=_0x9ee3[_0x18362f];return _0xe36dbc;};'use strict';var _=require(_0x39ee('0x0'));var util=require(_0x39ee('0x1'));var moment=require(_0x39ee('0x2'));var BPromise=require(_0x39ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39ee('0x5'))('rpc');var config=require(_0x39ee('0x6'));var jayson=require(_0x39ee('0x7'));var client=jayson['client'][_0x39ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37ca0c,_0x3b756c,_0x7dcd00){return new BPromise(function(_0x505245,_0x27ac65){return client['request'](_0x37ca0c,_0x7dcd00)[_0x39ee('0x9')](function(_0x18a6fb){logger[_0x39ee('0xa')](_0x39ee('0xb'),_0x3b756c,_0x39ee('0xc'));logger[_0x39ee('0xd')](_0x39ee('0xe'),_0x3b756c,_0x39ee('0xc'),JSON[_0x39ee('0xf')](_0x18a6fb));if(_0x18a6fb[_0x39ee('0x10')]){if(_0x18a6fb[_0x39ee('0x10')]['code']===0x1f4){logger[_0x39ee('0x10')](_0x39ee('0xb'),_0x3b756c,_0x18a6fb[_0x39ee('0x10')][_0x39ee('0x11')]);return _0x27ac65(_0x18a6fb['error'][_0x39ee('0x11')]);}logger[_0x39ee('0x10')]('Trigger,\x20%s,\x20%s',_0x3b756c,_0x18a6fb[_0x39ee('0x10')][_0x39ee('0x11')]);return _0x505245(_0x18a6fb['error'][_0x39ee('0x11')]);}else{logger[_0x39ee('0xa')](_0x39ee('0xb'),_0x3b756c,_0x39ee('0xc'));_0x505245(_0x18a6fb[_0x39ee('0x12')]['message']);}})[_0x39ee('0x13')](function(_0x569704){logger['error'](_0x39ee('0xb'),_0x3b756c,_0x569704);_0x27ac65(_0x569704);});});}exports[_0x39ee('0x14')]=function(_0x8d9e58){var _0x260e62=this;return new Promise(function(_0x4f37cf,_0x1beec6){return db[_0x39ee('0x15')][_0x39ee('0x16')]({'raw':_0x8d9e58['options']?_0x8d9e58['options'][_0x39ee('0x17')]===undefined?!![]:![]:!![],'where':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x19')]||null:null,'attributes':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x1a')]||null:null,'limit':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x1b')]||null:null,'include':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x1c')]?_['map'](_0x8d9e58['options']['include'],function(_0x476c11){return{'model':db[_0x476c11[_0x39ee('0x1d')]],'as':_0x476c11['as'],'attributes':_0x476c11[_0x39ee('0x1a')],'include':_0x476c11[_0x39ee('0x1c')]?_[_0x39ee('0x1e')](_0x476c11[_0x39ee('0x1c')],function(_0x46dc49){return{'model':db[_0x46dc49[_0x39ee('0x1d')]],'as':_0x46dc49['as'],'attributes':_0x46dc49[_0x39ee('0x1a')],'include':_0x46dc49[_0x39ee('0x1c')]?_[_0x39ee('0x1e')](_0x46dc49[_0x39ee('0x1c')],function(_0x4ec922){return{'model':db[_0x4ec922[_0x39ee('0x1d')]],'as':_0x4ec922['as'],'attributes':_0x4ec922[_0x39ee('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1853ac){logger['info'](_0x39ee('0x14'),_0x8d9e58);logger[_0x39ee('0xd')]('GetTrigger',_0x8d9e58,JSON['stringify'](_0x1853ac));_0x4f37cf(_0x1853ac);})[_0x39ee('0x13')](function(_0x38b644){logger[_0x39ee('0x10')](_0x39ee('0x14'),_0x38b644[_0x39ee('0x11')],_0x8d9e58);_0x1beec6(_0x260e62[_0x39ee('0x10')](0x1f4,_0x38b644[_0x39ee('0x11')]));});});};exports[_0x39ee('0x1f')]=function(_0x3f3a69){var _0x3e6866=this;return new Promise(function(_0x1b9f2a,_0x3982c9){return db[_0x39ee('0x15')]['find']({'raw':_0x3f3a69[_0x39ee('0x18')]?_0x3f3a69[_0x39ee('0x18')][_0x39ee('0x17')]===undefined?!![]:![]:!![],'where':_0x3f3a69['options']?_0x3f3a69['options'][_0x39ee('0x19')]||null:null,'attributes':_0x3f3a69[_0x39ee('0x18')]?_0x3f3a69[_0x39ee('0x18')]['attributes']||null:null,'include':_0x3f3a69[_0x39ee('0x18')]?_0x3f3a69['options']['include']?_[_0x39ee('0x1e')](_0x3f3a69[_0x39ee('0x18')][_0x39ee('0x1c')],function(_0x596f16){return{'model':db[_0x596f16[_0x39ee('0x1d')]],'as':_0x596f16['as'],'attributes':_0x596f16[_0x39ee('0x1a')],'include':_0x596f16[_0x39ee('0x1c')]?_[_0x39ee('0x1e')](_0x596f16[_0x39ee('0x1c')],function(_0x5c68ba){return{'model':db[_0x5c68ba[_0x39ee('0x1d')]],'as':_0x5c68ba['as'],'attributes':_0x5c68ba[_0x39ee('0x1a')],'include':_0x5c68ba[_0x39ee('0x1c')]?_['map'](_0x5c68ba[_0x39ee('0x1c')],function(_0x4f3119){return{'model':db[_0x4f3119[_0x39ee('0x1d')]],'as':_0x4f3119['as'],'attributes':_0x4f3119[_0x39ee('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x462edf){logger['info'](_0x39ee('0x1f'),_0x3f3a69);logger[_0x39ee('0xd')](_0x39ee('0x1f'),_0x3f3a69,JSON['stringify'](_0x462edf));_0x1b9f2a(_0x462edf);})['catch'](function(_0x8a2234){logger[_0x39ee('0x10')]('ShowTrigger',_0x8a2234[_0x39ee('0x11')],_0x3f3a69);_0x3982c9(_0x3e6866['error'](0x1f4,_0x8a2234[_0x39ee('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 72a4d25..9897914 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 _0x6ca8=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','show','post','clone','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5bcfb4,_0x146db1){var _0x1afe59=function(_0x332cc0){while(--_0x332cc0){_0x5bcfb4['push'](_0x5bcfb4['shift']());}};_0x1afe59(++_0x146db1);}(_0x6ca8,0x10d));var _0x86ca=function(_0x5acb14,_0x34b045){_0x5acb14=_0x5acb14-0x0;var _0x5cda01=_0x6ca8[_0x5acb14];return _0x5cda01;};'use strict';var multer=require(_0x86ca('0x0'));var util=require(_0x86ca('0x1'));var path=require(_0x86ca('0x2'));var timeout=require(_0x86ca('0x3'));var express=require(_0x86ca('0x4'));var router=express[_0x86ca('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x86ca('0x6'));var interaction=require(_0x86ca('0x7'));var config=require(_0x86ca('0x8'));var controller=require(_0x86ca('0x9'));router[_0x86ca('0xa')]('/',auth[_0x86ca('0xb')](),controller[_0x86ca('0xc')]);router[_0x86ca('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x86ca('0xd')]);router[_0x86ca('0xe')]('/:id/clone',auth[_0x86ca('0xb')](),controller[_0x86ca('0xf')]);router[_0x86ca('0xe')]('/',auth[_0x86ca('0xb')](),controller[_0x86ca('0x10')]);router[_0x86ca('0x11')](_0x86ca('0x12'),auth[_0x86ca('0xb')](),controller[_0x86ca('0x13')]);router[_0x86ca('0x14')](_0x86ca('0x12'),auth[_0x86ca('0xb')](),controller[_0x86ca('0x15')]);module[_0x86ca('0x16')]=router; \ No newline at end of file +var _0xa830=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','post','/:id/clone','clone','create','put','/:id','delete'];(function(_0x46b30d,_0x2dc5d9){var _0x30c873=function(_0x46dd32){while(--_0x46dd32){_0x46b30d['push'](_0x46b30d['shift']());}};_0x30c873(++_0x2dc5d9);}(_0xa830,0x120));var _0x0a83=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0xa830[_0xe09d0];return _0x44ad05;};'use strict';var multer=require(_0x0a83('0x0'));var util=require(_0x0a83('0x1'));var path=require(_0x0a83('0x2'));var timeout=require(_0x0a83('0x3'));var express=require(_0x0a83('0x4'));var router=express[_0x0a83('0x5')]();var fs_extra=require(_0x0a83('0x6'));var auth=require(_0x0a83('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0a83('0x8'));var controller=require(_0x0a83('0x9'));router['get']('/',auth[_0x0a83('0xa')](),controller[_0x0a83('0xb')]);router[_0x0a83('0xc')]('/:id',auth[_0x0a83('0xa')](),controller['show']);router[_0x0a83('0xd')](_0x0a83('0xe'),auth[_0x0a83('0xa')](),controller[_0x0a83('0xf')]);router['post']('/',auth[_0x0a83('0xa')](),controller[_0x0a83('0x10')]);router[_0x0a83('0x11')](_0x0a83('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x0a83('0x13')]('/:id',auth[_0x0a83('0xa')](),controller[_0x0a83('0x14')]);module[_0x0a83('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index cac3e8d..9710a28 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 _0x73eb=['active','passive','actpass','dynamic','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','getDataValue','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73eb,0x19d));var _0xb73e=function(_0x850e09,_0x52e6d7){_0x850e09=_0x850e09-0x0;var _0x5f81d0=_0x73eb[_0x850e09];return _0x5f81d0;};'use strict';var Sequelize=require(_0xb73e('0x0'));module['exports']={'name':{'type':Sequelize[_0xb73e('0x1')],'allowNull':![],'unique':_0xb73e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x4'),_0xb73e('0x5'),'peer'),'allowNull':![],'defaultValue':_0xb73e('0x4')},'context':{'type':Sequelize[_0xb73e('0x1')],'allowNull':![],'defaultValue':_0xb73e('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xb73e('0x7'),_0xb73e('0x8'),_0xb73e('0x9'),_0xb73e('0xa'),_0xb73e('0xb'),'PROHIB_PASSED_SCREEN',_0xb73e('0xc'),_0xb73e('0xd'))},'deny':{'type':Sequelize[_0xb73e('0x1')]},'permit':{'type':Sequelize[_0xb73e('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xb73e('0x1')]},'remotesecret':{'type':Sequelize[_0xb73e('0x1')]},'transport':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':_0xb73e('0xe'),'set':function(_0x3f1bb4){this['setDataValue'](_0xb73e('0xf'),_0x3f1bb4?_0x3f1bb4[_0xb73e('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xb73e('0xf'))?this['getDataValue'](_0xb73e('0xf'))[_0xb73e('0x11')](','):null;},'comment':_0xb73e('0x12')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0xb73e('0x13'),_0xb73e('0x14'),_0xb73e('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no',_0xb73e('0x17'),_0xb73e('0x18'),_0xb73e('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb73e('0x1')]},'directmediadeny':{'type':Sequelize[_0xb73e('0x1')]},'nat':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':_0xb73e('0x1a'),'set':function(_0x25213b){this[_0xb73e('0x1b')](_0xb73e('0x1c'),_0x25213b?_0x25213b[_0xb73e('0x10')](','):null);},'get':function(){return this[_0xb73e('0x1d')](_0xb73e('0x1c'))?this[_0xb73e('0x1d')](_0xb73e('0x1c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xb73e('0x1')]},'pickupgroup':{'type':Sequelize[_0xb73e('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb73e('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':_0xb73e('0x1e')},'allow':{'type':Sequelize[_0xb73e('0x1')],'allowNull':![],'defaultValue':_0xb73e('0x1f'),'set':function(_0x1550a4){this['setDataValue'](_0xb73e('0x20'),_0x1550a4?_0x1550a4['join'](';'):_0xb73e('0x1f'));},'get':function(){return this[_0xb73e('0x1d')](_0xb73e('0x20'))?this[_0xb73e('0x1d')]('allow')['split'](';'):null;},'comment':_0xb73e('0x21')},'autoframing':{'type':Sequelize[_0xb73e('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':_0xb73e('0x22'),'set':function(_0x3418ed){this[_0xb73e('0x1b')]('insecure',_0x3418ed?_0x3418ed[_0xb73e('0x10')](','):null);},'get':function(){return this[_0xb73e('0x1d')](_0xb73e('0x23'))?this[_0xb73e('0x1d')](_0xb73e('0x23'))[_0xb73e('0x11')](','):null;},'comment':_0xb73e('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0xb73e('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no',_0xb73e('0x25'))},'promiscredir':{'type':Sequelize[_0xb73e('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'accountcode':{'type':Sequelize[_0xb73e('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xb73e('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no'),'defaultValue':_0xb73e('0x16')},'busylevel':{'type':Sequelize[_0xb73e('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xb73e('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xb73e('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xb73e('0x1')]},'template':{'type':Sequelize[_0xb73e('0x1')]},'videosupport':{'type':Sequelize[_0xb73e('0x3')]('yes','no',_0xb73e('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb73e('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'mailbox':{'type':Sequelize[_0xb73e('0x1')]},'session_timers':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x29'),_0xb73e('0x2a'),_0xb73e('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xb73e('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xb73e('0x3')]('uac',_0xb73e('0x2c')),'defaultValue':_0xb73e('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xb73e('0x1')]},'regexten':{'type':Sequelize[_0xb73e('0x1')]},'fromdomain':{'type':Sequelize[_0xb73e('0x1')]},'fromuser':{'type':Sequelize[_0xb73e('0x1')]},'port':{'type':Sequelize[_0xb73e('0x26')](0x5)},'qualify':{'type':Sequelize[_0xb73e('0x3')]('yes','no'),'defaultValue':_0xb73e('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xb73e('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xb73e('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb73e('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb73e('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no',_0xb73e('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb73e('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xb73e('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xb73e('0x1')]},'contactdeny':{'type':Sequelize[_0xb73e('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xb73e('0x1')]},'use_q850_reason':{'type':Sequelize[_0xb73e('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xb73e('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb73e('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xb73e('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0xb73e('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb73e('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xb73e('0x1')]},'dtlscipher':{'type':Sequelize[_0xb73e('0x1')]},'dtlscafile':{'type':Sequelize[_0xb73e('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x2e'),_0xb73e('0x2f'),_0xb73e('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb73e('0x1')]},'usereqphone':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb73e('0x1')]},'recordofffeature':{'type':Sequelize[_0xb73e('0x1')]},'call_limit':{'type':Sequelize[_0xb73e('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xb73e('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xb73e('0x1')]},'description':{'type':Sequelize[_0xb73e('0x1')]},'host':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':_0xb73e('0x31')},'canreinvite':{'type':Sequelize[_0xb73e('0x3')](_0xb73e('0x16'),'no',_0xb73e('0x17'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb73e('0x1')]},'otherFields':{'type':Sequelize[_0xb73e('0x1')]},'active':{'type':Sequelize[_0xb73e('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb73e('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1ca0=['getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','originate','uas','pai','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join'];(function(_0x51465b,_0xa5be6){var _0x4fbd88=function(_0x439e1a){while(--_0x439e1a){_0x51465b['push'](_0x51465b['shift']());}};_0x4fbd88(++_0xa5be6);}(_0x1ca0,0x16f));var _0x01ca=function(_0x32ac07,_0xb14a29){_0x32ac07=_0x32ac07-0x0;var _0x347b1f=_0x1ca0[_0x32ac07];return _0x347b1f;};'use strict';var Sequelize=require(_0x01ca('0x0'));module[_0x01ca('0x1')]={'name':{'type':Sequelize[_0x01ca('0x2')],'allowNull':![],'unique':_0x01ca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x5'),_0x01ca('0x6'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x01ca('0x2')],'allowNull':![],'defaultValue':_0x01ca('0x7')},'callingpres':{'type':Sequelize[_0x01ca('0x4')]('ALLOWED_NOT_SCREENED',_0x01ca('0x8'),_0x01ca('0x9'),_0x01ca('0xa'),'PROHIB_NOT_SCREENED',_0x01ca('0xb'),_0x01ca('0xc'),_0x01ca('0xd'))},'deny':{'type':Sequelize[_0x01ca('0x2')]},'permit':{'type':Sequelize[_0x01ca('0x2')]},'secret':{'type':Sequelize[_0x01ca('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x01ca('0x2')]},'transport':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0xe'),'set':function(_0x12b56c){this['setDataValue'](_0x01ca('0xf'),_0x12b56c?_0x12b56c[_0x01ca('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x01ca('0xf'))?this[_0x01ca('0x11')](_0x01ca('0xf'))[_0x01ca('0x12')](','):null;},'comment':_0x01ca('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x01ca('0x14'),'info',_0x01ca('0x15'),_0x01ca('0x16'),'auto'),'defaultValue':_0x01ca('0x14')},'directmedia':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no',_0x01ca('0x18'),_0x01ca('0x19'),_0x01ca('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0x1b'),'set':function(_0x52e13f){this[_0x01ca('0x1c')](_0x01ca('0x1d'),_0x52e13f?_0x52e13f[_0x01ca('0x10')](','):null);},'get':function(){return this[_0x01ca('0x11')](_0x01ca('0x1d'))?this['getDataValue'](_0x01ca('0x1d'))[_0x01ca('0x12')](','):null;},'comment':_0x01ca('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x01ca('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x01ca('0x2')],'allowNull':![],'defaultValue':_0x01ca('0x1f'),'set':function(_0x1672cf){this[_0x01ca('0x1c')](_0x01ca('0x20'),_0x1672cf?_0x1672cf['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x01ca('0x11')](_0x01ca('0x20'))?this[_0x01ca('0x11')]('allow')['split'](';'):null;},'comment':_0x01ca('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x42dc7a){this[_0x01ca('0x1c')](_0x01ca('0x22'),_0x42dc7a?_0x42dc7a[_0x01ca('0x10')](','):null);},'get':function(){return this[_0x01ca('0x11')](_0x01ca('0x22'))?this[_0x01ca('0x11')](_0x01ca('0x22'))['split'](','):null;},'comment':_0x01ca('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no',_0x01ca('0x24'))},'promiscredir':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'accountcode':{'type':Sequelize[_0x01ca('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x01ca('0x4')]('yes','no'),'defaultValue':_0x01ca('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x01ca('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x01ca('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x01ca('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x01ca('0x2')]},'session_timers':{'type':Sequelize[_0x01ca('0x4')]('accept','refuse',_0x01ca('0x27'))},'session_expires':{'type':Sequelize[_0x01ca('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x01ca('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x01ca('0x4')]('uac',_0x01ca('0x28')),'defaultValue':_0x01ca('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x01ca('0x2')]},'regexten':{'type':Sequelize[_0x01ca('0x2')]},'fromdomain':{'type':Sequelize[_0x01ca('0x2')]},'fromuser':{'type':Sequelize[_0x01ca('0x2')]},'port':{'type':Sequelize[_0x01ca('0x25')](0x5)},'qualify':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':_0x01ca('0x17')},'keepalive':{'type':Sequelize[_0x01ca('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x01ca('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x01ca('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x01ca('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x01ca('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no',_0x01ca('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x01ca('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x01ca('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x01ca('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x01ca('0x2')]},'contactdeny':{'type':Sequelize[_0x01ca('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x01ca('0x2')]},'use_q850_reason':{'type':Sequelize[_0x01ca('0x2')]},'maxforwards':{'type':Sequelize[_0x01ca('0x25')](0xb)},'encryption':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'force_avp':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'icesupport':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no','fingerprint',_0x01ca('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x01ca('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x01ca('0x2')]},'dtlscipher':{'type':Sequelize[_0x01ca('0x2')]},'dtlscafile':{'type':Sequelize[_0x01ca('0x2')]},'dtlscapath':{'type':Sequelize[_0x01ca('0x2')]},'dtlssetup':{'type':Sequelize[_0x01ca('0x4')]('active',_0x01ca('0x2b'),_0x01ca('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x01ca('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x01ca('0x2')]},'recordofffeature':{'type':Sequelize[_0x01ca('0x2')]},'call_limit':{'type':Sequelize[_0x01ca('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x01ca('0x2')]},'mohinterpret':{'type':Sequelize[_0x01ca('0x2')]},'mohsuggest':{'type':Sequelize[_0x01ca('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0x2d')},'canreinvite':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no',_0x01ca('0x18'),_0x01ca('0x19'),_0x01ca('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x01ca('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x01ca('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x01ca('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 0d499aa..4660560 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 _0x6f0d=['server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','Trunks','UserProfileResource','end','stack','name','send','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','updatedAt','body','omit','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','join'];(function(_0x5f16c4,_0x611a93){var _0x24b242=function(_0x4ad530){while(--_0x4ad530){_0x5f16c4['push'](_0x5f16c4['shift']());}};_0x24b242(++_0x611a93);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xa3db1f,_0x74b496){_0xa3db1f=_0xa3db1f-0x0;var _0x465850=_0x6f0d[_0xa3db1f];return _0x465850;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];var jayson=require(_0xd6f0('0x19'));var client=jayson[_0xd6f0('0x1a')][_0xd6f0('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x409549,_0x2bf5b8,_0x250999,_0x246dad){return new BPromise(function(_0x4ab979,_0x2b3f32){var _0x354846=_0x246dad||client;return _0x354846['request'](_0x409549,_0x250999)[_0xd6f0('0x1c')](function(_0x593abe){logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,_0xd6f0('0x1f'));logger[_0xd6f0('0x20')](_0xd6f0('0x21'),_0x2bf5b8,_0xd6f0('0x1f'),JSON[_0xd6f0('0x22')](_0x593abe));if(_0x593abe[_0xd6f0('0x23')]){if(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x24')]===0x1f4){logger[_0xd6f0('0x23')](_0xd6f0('0x1e'),_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x2b3f32(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x4ab979(_0x593abe[_0xd6f0('0x23')]['message']);}else{logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,'request\x20sent');_0x4ab979(_0x593abe[_0xd6f0('0x26')]['message']);}})[_0xd6f0('0x27')](function(_0x1c9d90){logger['error'](_0xd6f0('0x1e'),_0x2bf5b8,_0x1c9d90);_0x2b3f32(_0x1c9d90);});});}function respondWithStatusCode(_0x45e99c,_0x5ea2dd){_0x5ea2dd=_0x5ea2dd||0xcc;return function(_0x3dbdc3){if(_0x3dbdc3){return _0x45e99c[_0xd6f0('0x28')](_0x5ea2dd);}return _0x45e99c[_0xd6f0('0x29')](_0x5ea2dd)['end']();};}function respondWithResult(_0x2ca8bb,_0x3dc166){_0x3dc166=_0x3dc166||0xc8;return function(_0x5ecb16){if(_0x5ecb16){return _0x2ca8bb[_0xd6f0('0x29')](_0x3dc166)['json'](_0x5ecb16);}};}function respondWithFilteredResult(_0x2042d5,_0x3fb5c3){return function(_0x1630dc){if(_0x1630dc){var _0x3c1bff=typeof _0x3fb5c3[_0xd6f0('0x2a')]===_0xd6f0('0x2b')&&typeof _0x3fb5c3[_0xd6f0('0x2c')]===_0xd6f0('0x2b');var _0x48975d=_0x1630dc[_0xd6f0('0x2d')];var _0x1982d3=_0x3c1bff?0x0:_0x3fb5c3['offset'];var _0x38a3e9=_0x3c1bff?_0x1630dc[_0xd6f0('0x2d')]:_0x3fb5c3[_0xd6f0('0x2a')]+_0x3fb5c3[_0xd6f0('0x2c')];var _0x1a3967;if(_0x38a3e9>=_0x48975d){_0x38a3e9=_0x48975d;_0x1a3967=0xc8;}else{_0x1a3967=0xce;}_0x2042d5[_0xd6f0('0x29')](_0x1a3967);return _0x2042d5[_0xd6f0('0x2e')](_0xd6f0('0x2f'),_0x1982d3+'-'+_0x38a3e9+'/'+_0x48975d)[_0xd6f0('0x30')](_0x1630dc);}return null;};}function patchUpdates(_0x43f72f){return function(_0x1dff9b){try{jsonpatch[_0xd6f0('0x31')](_0x1dff9b,_0x43f72f,!![]);}catch(_0x348529){return BPromise[_0xd6f0('0x32')](_0x348529);}return _0x1dff9b[_0xd6f0('0x33')]();};}function saveUpdates(_0x2d7c90,_0x31c493){return function(_0x376890){if(_0x376890){return _0x376890[_0xd6f0('0x34')](_0x2d7c90)[_0xd6f0('0x1c')](function(_0x3906ca){return _0x3906ca;});}return null;};}function removeEntity(_0x26ab29,_0x4a8ebe){return function(_0x11124c){if(_0x11124c){return _0x11124c['destroy']()['then'](function(){var _0x43d588=_0x11124c[_0xd6f0('0x35')]({'plain':!![]});var _0x12a6fa=_0xd6f0('0x36');return db[_0xd6f0('0x37')]['destroy']({'where':{'type':_0x12a6fa,'resourceId':_0x43d588['id']}})[_0xd6f0('0x1c')](function(){return _0x11124c;});})['then'](function(){_0x26ab29[_0xd6f0('0x29')](0xcc)[_0xd6f0('0x38')]();});}};}function handleEntityNotFound(_0x42c01a,_0x1eecf0){return function(_0x518751){if(!_0x518751){_0x42c01a['sendStatus'](0x194);}return _0x518751;};}function handleError(_0x47b33d,_0x3b6463){_0x3b6463=_0x3b6463||0x1f4;return function(_0xe2958d){logger['error'](_0xe2958d[_0xd6f0('0x39')]);if(_0xe2958d['name']){delete _0xe2958d[_0xd6f0('0x3a')];}_0x47b33d[_0xd6f0('0x29')](_0x3b6463)[_0xd6f0('0x3b')](_0xe2958d);};}exports[_0xd6f0('0x3c')]=function(_0x451834,_0x3d1280){var _0x6b44fa={},_0x4fd4db={},_0x52203d={'count':0x0,'rows':[]};var _0x162537=_[_0xd6f0('0x3d')](db[_0xd6f0('0x3e')]['rawAttributes'],function(_0x59f905){return{'name':_0x59f905[_0xd6f0('0x3f')],'type':_0x59f905[_0xd6f0('0x40')][_0xd6f0('0x41')]};});_0x4fd4db[_0xd6f0('0x42')]=_[_0xd6f0('0x3d')](_0x162537,_0xd6f0('0x3a'));_0x4fd4db[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x451834['query']);_0x4fd4db[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],_0x4fd4db[_0xd6f0('0x43')]);_0x6b44fa['attributes']=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x6b44fa['attributes']=_0x6b44fa[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x6b44fa[_0xd6f0('0x48')]:_0x4fd4db['model'];if(!_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4a')]('nolimit')){_0x6b44fa['limit']=qs[_0xd6f0('0x2c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x2c')]);_0x6b44fa['offset']=qs[_0xd6f0('0x2a')](_0x451834[_0xd6f0('0x43')]['offset']);}_0x6b44fa[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4c')]);_0x6b44fa['where']=qs[_0xd6f0('0x45')](_[_0xd6f0('0x4d')](_0x451834[_0xd6f0('0x43')],_0x4fd4db[_0xd6f0('0x45')]),_0x162537);if(_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4e')]){_0x6b44fa[_0xd6f0('0x4f')]=_[_0xd6f0('0x50')](_0x6b44fa['where'],{'$or':_[_0xd6f0('0x3d')](_0x162537,function(_0x3d42ca){if(_0x3d42ca['type']!==_0xd6f0('0x51')){var _0x39ca69={};_0x39ca69[_0x3d42ca[_0xd6f0('0x3a')]]={'$like':'%'+_0x451834[_0xd6f0('0x43')]['filter']+'%'};return _0x39ca69;}})});}_0x6b44fa=_[_0xd6f0('0x50')]({},_0x6b44fa,_0x451834[_0xd6f0('0x52')]);var _0x494542={'where':_0x6b44fa['where']};return db[_0xd6f0('0x3e')]['count'](_0x494542)[_0xd6f0('0x1c')](function(_0x61b354){_0x52203d[_0xd6f0('0x2d')]=_0x61b354;if(_0x451834['query'][_0xd6f0('0x53')]){_0x6b44fa[_0xd6f0('0x54')]=[{'all':!![]}];}return db[_0xd6f0('0x3e')][_0xd6f0('0x55')](_0x6b44fa);})[_0xd6f0('0x1c')](function(_0x4c42ce){_0x52203d[_0xd6f0('0x56')]=_0x4c42ce;return _0x52203d;})['then'](respondWithFilteredResult(_0x3d1280,_0x6b44fa))[_0xd6f0('0x27')](handleError(_0x3d1280,null));};exports[_0xd6f0('0x57')]=function(_0x2eb338,_0x1dc320){var _0x554e37={'raw':![],'where':{'id':_0x2eb338[_0xd6f0('0x58')]['id']}},_0x5ceb6b={};_0x5ceb6b[_0xd6f0('0x42')]=_['keys'](db[_0xd6f0('0x3e')]['rawAttributes']);_0x5ceb6b[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x2eb338[_0xd6f0('0x43')]);_0x5ceb6b[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x5ceb6b['model'],_0x5ceb6b[_0xd6f0('0x43')]);_0x554e37[_0xd6f0('0x48')]=_[_0xd6f0('0x46')](_0x5ceb6b[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x554e37[_0xd6f0('0x48')]=_0x554e37['attributes'][_0xd6f0('0x49')]?_0x554e37[_0xd6f0('0x48')]:_0x5ceb6b[_0xd6f0('0x42')];if(_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x53')]){_0x554e37[_0xd6f0('0x54')]=[{'all':!![]}];}_0x554e37=_[_0xd6f0('0x50')]({},_0x554e37,_0x2eb338[_0xd6f0('0x52')]);return db[_0xd6f0('0x3e')]['find'](_0x554e37)[_0xd6f0('0x1c')](handleEntityNotFound(_0x1dc320,null))['then'](respondWithResult(_0x1dc320,null))['catch'](handleError(_0x1dc320,null));};exports[_0xd6f0('0x59')]=function(_0x55fd25,_0x539ef1){var _0x28c3c4={'where':{'id':_0x55fd25[_0xd6f0('0x58')]['id']}},_0x2d39a2={};_0x2d39a2['model']=_[_0xd6f0('0x44')](db[_0xd6f0('0x3e')][_0xd6f0('0x5a')]);_0x28c3c4['attributes']=_[_0xd6f0('0x46')](_0x2d39a2[_0xd6f0('0x42')],qs['fields'](_0x55fd25[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x28c3c4['attributes']=_0x28c3c4[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x28c3c4[_0xd6f0('0x48')]:_0x2d39a2[_0xd6f0('0x42')];if(_0x55fd25[_0xd6f0('0x43')]['includeAll']){_0x28c3c4[_0xd6f0('0x54')]=[{'all':!![]}];}_0x28c3c4=_[_0xd6f0('0x50')]({},_0x28c3c4,_0x55fd25['options']);return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')](_0x28c3c4)[_0xd6f0('0x1c')](handleEntityNotFound(_0x539ef1,null))['then'](function(_0x229f19){if(_0x229f19){var _0x5d75fa=_0x229f19['get']({'plain':!![]});_0x5d75fa=qs['omit'](_0x5d75fa,['id','createdAt',_0xd6f0('0x5c')]);_0x55fd25[_0xd6f0('0x5d')]=_[_0xd6f0('0x5e')](_0x55fd25[_0xd6f0('0x5d')],['id','createdAt',_0xd6f0('0x5c')]);return db['Trunk'][_0xd6f0('0x5f')](_[_0xd6f0('0x50')](_0x5d75fa,_0x55fd25[_0xd6f0('0x5d')]),{'include':_0x55fd25['query'][_0xd6f0('0x53')]?[{'all':!![]}]:undefined})[_0xd6f0('0x1c')](function(_0x269dd7){var _0x705eb=_0x55fd25['user'][_0xd6f0('0x35')]({'plain':!![]});if(!_0x705eb)throw new Error(_0xd6f0('0x60'));if(_0x705eb[_0xd6f0('0x61')]==='user'){var _0x5bc4e7=_0x269dd7[_0xd6f0('0x35')]({'plain':!![]});var _0x1fee47=_0xd6f0('0x36');return db['UserProfileSection'][_0xd6f0('0x5b')]({'where':{'name':_0x1fee47,'userProfileId':_0x705eb[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x282e9b){if(_0x282e9b&&_0x282e9b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5bc4e7['name'],'resourceId':_0x5bc4e7['id'],'type':_0x282e9b[_0xd6f0('0x3a')],'sectionId':_0x282e9b['id']},{})[_0xd6f0('0x1c')](function(){return _0x269dd7;});}else{return _0x269dd7;}})[_0xd6f0('0x27')](function(_0x30cd81){logger[_0xd6f0('0x23')](_0xd6f0('0x63'),_0x30cd81);throw _0x30cd81;});}return _0x269dd7;});}})[_0xd6f0('0x1c')](respondWithResult(_0x539ef1,0xc9))[_0xd6f0('0x27')](handleError(_0x539ef1,null));};exports[_0xd6f0('0x5f')]=function(_0x5ad146,_0x55f96e,_0x1b9728){var _0x5af4f6;return db[_0xd6f0('0x3e')][_0xd6f0('0x5f')](_0x5ad146[_0xd6f0('0x5d')],{'raw':!![]})[_0xd6f0('0x1c')](function(_0x14384f){_0x5af4f6=_0x14384f;return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})['then'](function(_0x3c8a3e){var _0x318a68=fs[_0xd6f0('0x64')](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x66')),'utf8');var _0xad50ac=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x1c6140=ejs[_0xd6f0('0x6a')](_0x318a68,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1c6140);if(_0x5af4f6[_0xd6f0('0x6c')]){var _0x205b6a=ejs[_0xd6f0('0x6a')](_0xad50ac,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0x205b6a);}})[_0xd6f0('0x1c')](function(){return respondWithRpcPromise(_0xd6f0('0x6d'),_0xd6f0('0x5f'),{'module':_0xd6f0('0x6e')});})[_0xd6f0('0x1c')](function(){var _0x12e0e5=_0x5ad146[_0xd6f0('0x6f')][_0xd6f0('0x35')]({'plain':!![]});if(!_0x12e0e5)throw new Error(_0xd6f0('0x60'));if(_0x12e0e5[_0xd6f0('0x61')]==='user'){var _0x440d5c=_0x5af4f6[_0xd6f0('0x35')]({'plain':!![]});return db[_0xd6f0('0x70')]['find']({'where':{'name':_0xd6f0('0x36'),'userProfileId':_0x12e0e5[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x406bc7){if(_0x406bc7&&_0x406bc7[_0xd6f0('0x71')]===0x0){return db[_0xd6f0('0x37')][_0xd6f0('0x5f')]({'name':_0x440d5c[_0xd6f0('0x3a')],'resourceId':_0x440d5c['id'],'type':_0x406bc7[_0xd6f0('0x3a')],'sectionId':_0x406bc7['id']},{})[_0xd6f0('0x1c')](function(){return _0x5af4f6;});}else{return _0x5af4f6;}})[_0xd6f0('0x27')](function(_0x5b3155){logger['error'](_0xd6f0('0x63'),_0x5b3155);throw _0x5b3155;});}return _0x5af4f6;})[_0xd6f0('0x1c')](respondWithResult(_0x55f96e,0xc9))[_0xd6f0('0x27')](handleError(_0x55f96e,null));};exports[_0xd6f0('0x34')]=function(_0x1da442,_0x5a781b,_0x15143a){var _0x2d38e6;return db['Trunk'][_0xd6f0('0x5b')]({'where':{'id':_0x1da442['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0x5a781b,null))[_0xd6f0('0x1c')](saveUpdates(_0x1da442[_0xd6f0('0x5d')],null))[_0xd6f0('0x1c')](function(_0x391c2a){if(_0x391c2a){_0x2d38e6=_0x391c2a;return db['Trunk']['findAll']({'raw':!![]});}})[_0xd6f0('0x1c')](function(_0x17b320){if(_0x17b320){var _0x484124=fs[_0xd6f0('0x64')](path['join'](config['root'],_0xd6f0('0x66')),'utf8');var _0x5dc1c7=fs['readFileSync'](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0xcfed18=ejs[_0xd6f0('0x6a')](_0x484124,{'trunks':_0x17b320||[]});fs[_0xd6f0('0x6b')](_0xd6f0('0x72'),_0xcfed18);var _0x381f88=ejs[_0xd6f0('0x6a')](_0x5dc1c7,{'trunks':_0x17b320||[]});fs['writeFileSync'](_0xd6f0('0x73'),_0x381f88);return respondWithRpcPromise('Reload','update',{'module':_0xd6f0('0x6e')});}return null;})[_0xd6f0('0x1c')](function(_0x397f2c){if(_0x397f2c){return _0x2d38e6;}})['then'](respondWithResult(_0x5a781b,null))[_0xd6f0('0x27')](handleError(_0x5a781b,null));};exports[_0xd6f0('0x74')]=function(_0xc0585c,_0xf7ade1,_0x41e738){var _0x202e37;return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')]({'where':{'id':_0xc0585c['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0xf7ade1,null))[_0xd6f0('0x1c')](removeEntity(_0xf7ade1,null))['then'](function(){return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})[_0xd6f0('0x1c')](function(_0x175ba6){var _0x403698=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config['root'],_0xd6f0('0x66')),_0xd6f0('0x69'));var _0x5c3659=fs['readFileSync'](path['join'](config['root'],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x2fdd59=ejs[_0xd6f0('0x6a')](_0x403698,{'trunks':_0x175ba6});var _0x427b95=ejs[_0xd6f0('0x6a')](_0x5c3659,{'trunks':_0x175ba6});fs['writeFileSync'](_0xd6f0('0x72'),_0x2fdd59);fs[_0xd6f0('0x6b')](_0xd6f0('0x73'),_0x427b95);return respondWithRpcPromise(_0xd6f0('0x6d'),'destroy',{'module':_0xd6f0('0x6e')});})['catch'](handleError(_0xf7ade1,null));}; \ No newline at end of file +var _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','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','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x4fffdf,_0x103fec){var _0x111c50=function(_0x70c156){while(--_0x70c156){_0x4fffdf['push'](_0x4fffdf['shift']());}};_0x111c50(++_0x103fec);}(_0xdace,0xc5));var _0xedac=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0xdace[_0x3d9b04];return _0x557936;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index a36c220..861f063 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 _0x883e=['bluebird','request-promise','path','./trunk.attributes','exports','tools_trunks','lodash','util','../../config/logger','api','moment'];(function(_0x3956b2,_0x375b8e){var _0x3fed3d=function(_0x7f4815){while(--_0x7f4815){_0x3956b2['push'](_0x3956b2['shift']());}};_0x3fed3d(++_0x375b8e);}(_0x883e,0x145));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require(_0xe883('0x1'));var logger=require(_0xe883('0x2'))(_0xe883('0x3'));var moment=require(_0xe883('0x4'));var BPromise=require(_0xe883('0x5'));var rp=require(_0xe883('0x6'));var fs=require('fs');var path=require(_0xe883('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe883('0x8'));module[_0xe883('0x9')]=function(_0x19cc0c,_0x479c4f){return _0x19cc0c['define']('Trunk',attributes,{'tableName':_0xe883('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa44b=['request-promise','rimraf','./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x447f8a,_0x5414ac){var _0x336eec=function(_0x4b08ce){while(--_0x4b08ce){_0x447f8a['push'](_0x447f8a['shift']());}};_0x336eec(++_0x5414ac);}(_0xa44b,0x14a));var _0xba44=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0xa44b[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0xba44('0x0'));var util=require(_0xba44('0x1'));var logger=require(_0xba44('0x2'))(_0xba44('0x3'));var moment=require(_0xba44('0x4'));var BPromise=require(_0xba44('0x5'));var rp=require(_0xba44('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba44('0x7'));var config=require('../../config/environment');var attributes=require(_0xba44('0x8'));module[_0xba44('0x9')]=function(_0x1ba5a2,_0x9842e9){return _0x1ba5a2[_0xba44('0xa')](_0xba44('0xb'),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 8ac2f78..0ba06df 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 _0xafe8=['limit','include','map','model','GetTrunk','catch','ShowTrunk','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Trunk','findAll','options','raw','where','attributes'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xafe8,0x166));var _0x8afe=function(_0x39cad6,_0x1edf41){_0x39cad6=_0x39cad6-0x0;var _0x5a82f2=_0xafe8[_0x39cad6];return _0x5a82f2;};'use strict';var _=require(_0x8afe('0x0'));var util=require(_0x8afe('0x1'));var moment=require(_0x8afe('0x2'));var BPromise=require(_0x8afe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8afe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8afe('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8afe('0x6'));var jayson=require(_0x8afe('0x7'));var client=jayson[_0x8afe('0x8')][_0x8afe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fdb36,_0x4c2db3,_0x1f57dc){return new BPromise(function(_0x379abe,_0x5457bb){return client[_0x8afe('0xa')](_0x4fdb36,_0x1f57dc)[_0x8afe('0xb')](function(_0x3fc62c){logger[_0x8afe('0xc')](_0x8afe('0xd'),_0x4c2db3,_0x8afe('0xe'));logger[_0x8afe('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4c2db3,_0x8afe('0xe'),JSON[_0x8afe('0x10')](_0x3fc62c));if(_0x3fc62c[_0x8afe('0x11')]){if(_0x3fc62c[_0x8afe('0x11')][_0x8afe('0x12')]===0x1f4){logger[_0x8afe('0x11')](_0x8afe('0xd'),_0x4c2db3,_0x3fc62c[_0x8afe('0x11')][_0x8afe('0x13')]);return _0x5457bb(_0x3fc62c[_0x8afe('0x11')]['message']);}logger[_0x8afe('0x11')](_0x8afe('0xd'),_0x4c2db3,_0x3fc62c[_0x8afe('0x11')][_0x8afe('0x13')]);return _0x379abe(_0x3fc62c[_0x8afe('0x11')][_0x8afe('0x13')]);}else{logger['info'](_0x8afe('0xd'),_0x4c2db3,_0x8afe('0xe'));_0x379abe(_0x3fc62c[_0x8afe('0x14')][_0x8afe('0x13')]);}})['catch'](function(_0x5c2cea){logger[_0x8afe('0x11')](_0x8afe('0xd'),_0x4c2db3,_0x5c2cea);_0x5457bb(_0x5c2cea);});});}exports['GetTrunk']=function(_0x76ba11){var _0x1257bb=this;return new Promise(function(_0x20314e,_0x219e63){return db[_0x8afe('0x15')][_0x8afe('0x16')]({'raw':_0x76ba11['options']?_0x76ba11[_0x8afe('0x17')][_0x8afe('0x18')]===undefined?!![]:![]:!![],'where':_0x76ba11[_0x8afe('0x17')]?_0x76ba11[_0x8afe('0x17')][_0x8afe('0x19')]||null:null,'attributes':_0x76ba11[_0x8afe('0x17')]?_0x76ba11[_0x8afe('0x17')][_0x8afe('0x1a')]||null:null,'limit':_0x76ba11['options']?_0x76ba11['options'][_0x8afe('0x1b')]||null:null,'include':_0x76ba11[_0x8afe('0x17')]?_0x76ba11[_0x8afe('0x17')][_0x8afe('0x1c')]?_[_0x8afe('0x1d')](_0x76ba11[_0x8afe('0x17')][_0x8afe('0x1c')],function(_0x320c0f){return{'model':db[_0x320c0f[_0x8afe('0x1e')]],'as':_0x320c0f['as'],'attributes':_0x320c0f['attributes'],'include':_0x320c0f[_0x8afe('0x1c')]?_[_0x8afe('0x1d')](_0x320c0f[_0x8afe('0x1c')],function(_0x1c0bc0){return{'model':db[_0x1c0bc0[_0x8afe('0x1e')]],'as':_0x1c0bc0['as'],'attributes':_0x1c0bc0['attributes'],'include':_0x1c0bc0['include']?_[_0x8afe('0x1d')](_0x1c0bc0['include'],function(_0x2554b0){return{'model':db[_0x2554b0[_0x8afe('0x1e')]],'as':_0x2554b0['as'],'attributes':_0x2554b0[_0x8afe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8afe('0xb')](function(_0x1c34fb){logger[_0x8afe('0xc')](_0x8afe('0x1f'),_0x76ba11);logger['debug'](_0x8afe('0x1f'),_0x76ba11,JSON[_0x8afe('0x10')](_0x1c34fb));_0x20314e(_0x1c34fb);})[_0x8afe('0x20')](function(_0x4e01b0){logger['error'](_0x8afe('0x1f'),_0x4e01b0[_0x8afe('0x13')],_0x76ba11);_0x219e63(_0x1257bb[_0x8afe('0x11')](0x1f4,_0x4e01b0[_0x8afe('0x13')]));});});};exports[_0x8afe('0x21')]=function(_0x2d281c){var _0x435b04=this;return new Promise(function(_0xd2d8b7,_0x461199){return db[_0x8afe('0x15')][_0x8afe('0x22')]({'raw':_0x2d281c['options']?_0x2d281c[_0x8afe('0x17')][_0x8afe('0x18')]===undefined?!![]:![]:!![],'where':_0x2d281c[_0x8afe('0x17')]?_0x2d281c[_0x8afe('0x17')]['where']||null:null,'attributes':_0x2d281c[_0x8afe('0x17')]?_0x2d281c[_0x8afe('0x17')][_0x8afe('0x1a')]||null:null,'include':_0x2d281c[_0x8afe('0x17')]?_0x2d281c['options'][_0x8afe('0x1c')]?_[_0x8afe('0x1d')](_0x2d281c['options']['include'],function(_0x484297){return{'model':db[_0x484297['model']],'as':_0x484297['as'],'attributes':_0x484297[_0x8afe('0x1a')],'include':_0x484297[_0x8afe('0x1c')]?_[_0x8afe('0x1d')](_0x484297['include'],function(_0x3e9c6e){return{'model':db[_0x3e9c6e['model']],'as':_0x3e9c6e['as'],'attributes':_0x3e9c6e['attributes'],'include':_0x3e9c6e['include']?_[_0x8afe('0x1d')](_0x3e9c6e[_0x8afe('0x1c')],function(_0xa06687){return{'model':db[_0xa06687[_0x8afe('0x1e')]],'as':_0xa06687['as'],'attributes':_0xa06687[_0x8afe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8afe('0xb')](function(_0x3e27bf){logger[_0x8afe('0xc')](_0x8afe('0x21'),_0x2d281c);logger[_0x8afe('0xf')](_0x8afe('0x21'),_0x2d281c,JSON[_0x8afe('0x10')](_0x3e27bf));_0xd2d8b7(_0x3e27bf);})['catch'](function(_0x1c657){logger['error'](_0x8afe('0x21'),_0x1c657[_0x8afe('0x13')],_0x2d281c);_0x461199(_0x435b04['error'](0x1f4,_0x1c657[_0x8afe('0x13')]));});});}; \ No newline at end of file +var _0x1dcc=['info','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowTrunk','find','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1de3d3,_0x5cb6e3){var _0x2666b2=function(_0x323819){while(--_0x323819){_0x1de3d3['push'](_0x1de3d3['shift']());}};_0x2666b2(++_0x5cb6e3);}(_0x1dcc,0x1a2));var _0xc1dc=function(_0x39350f,_0x3e508f){_0x39350f=_0x39350f-0x0;var _0x35cbc6=_0x1dcc[_0x39350f];return _0x35cbc6;};'use strict';var _=require('lodash');var util=require(_0xc1dc('0x0'));var moment=require(_0xc1dc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dc('0x2'));var db=require(_0xc1dc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1dc('0x4'));var config=require(_0xc1dc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc1dc('0x6')][_0xc1dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x208d80,_0xbef048,_0x559eb5){return new BPromise(function(_0x321427,_0x3692df){return client['request'](_0x208d80,_0x559eb5)['then'](function(_0x4431b7){logger['info'](_0xc1dc('0x8'),_0xbef048,_0xc1dc('0x9'));logger[_0xc1dc('0xa')](_0xc1dc('0xb'),_0xbef048,_0xc1dc('0x9'),JSON[_0xc1dc('0xc')](_0x4431b7));if(_0x4431b7[_0xc1dc('0xd')]){if(_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xe')]===0x1f4){logger[_0xc1dc('0xd')](_0xc1dc('0x8'),_0xbef048,_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xf')]);return _0x3692df(_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xf')]);}logger[_0xc1dc('0xd')](_0xc1dc('0x8'),_0xbef048,_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xf')]);return _0x321427(_0x4431b7['error'][_0xc1dc('0xf')]);}else{logger[_0xc1dc('0x10')]('Trunk,\x20%s,\x20%s',_0xbef048,_0xc1dc('0x9'));_0x321427(_0x4431b7['result']['message']);}})[_0xc1dc('0x11')](function(_0x3d87b1){logger[_0xc1dc('0xd')](_0xc1dc('0x8'),_0xbef048,_0x3d87b1);_0x3692df(_0x3d87b1);});});}exports[_0xc1dc('0x12')]=function(_0x2f87d9){var _0x9effed=this;return new Promise(function(_0x127974,_0x3a7eb7){return db['Trunk'][_0xc1dc('0x13')]({'raw':_0x2f87d9['options']?_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x15')]===undefined?!![]:![]:!![],'where':_0x2f87d9['options']?_0x2f87d9['options'][_0xc1dc('0x16')]||null:null,'attributes':_0x2f87d9[_0xc1dc('0x14')]?_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x17')]||null:null,'limit':_0x2f87d9[_0xc1dc('0x14')]?_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x18')]||null:null,'include':_0x2f87d9[_0xc1dc('0x14')]?_0x2f87d9['options'][_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x19')],function(_0x44e43c){return{'model':db[_0x44e43c[_0xc1dc('0x1b')]],'as':_0x44e43c['as'],'attributes':_0x44e43c[_0xc1dc('0x17')],'include':_0x44e43c[_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0x44e43c[_0xc1dc('0x19')],function(_0x3ddd96){return{'model':db[_0x3ddd96[_0xc1dc('0x1b')]],'as':_0x3ddd96['as'],'attributes':_0x3ddd96[_0xc1dc('0x17')],'include':_0x3ddd96[_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0x3ddd96['include'],function(_0x2895de){return{'model':db[_0x2895de['model']],'as':_0x2895de['as'],'attributes':_0x2895de[_0xc1dc('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1dc('0x1c')](function(_0x1ce06b){logger[_0xc1dc('0x10')](_0xc1dc('0x12'),_0x2f87d9);logger[_0xc1dc('0xa')](_0xc1dc('0x12'),_0x2f87d9,JSON['stringify'](_0x1ce06b));_0x127974(_0x1ce06b);})[_0xc1dc('0x11')](function(_0x4ecf76){logger[_0xc1dc('0xd')](_0xc1dc('0x12'),_0x4ecf76[_0xc1dc('0xf')],_0x2f87d9);_0x3a7eb7(_0x9effed[_0xc1dc('0xd')](0x1f4,_0x4ecf76['message']));});});};exports[_0xc1dc('0x1d')]=function(_0x5a7f8f){var _0x47afda=this;return new Promise(function(_0x53fd78,_0x4ec49f){return db['Trunk'][_0xc1dc('0x1e')]({'raw':_0x5a7f8f[_0xc1dc('0x14')]?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x15')]===undefined?!![]:![]:!![],'where':_0x5a7f8f['options']?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x16')]||null:null,'attributes':_0x5a7f8f['options']?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x17')]||null:null,'include':_0x5a7f8f[_0xc1dc('0x14')]?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x19')]?_['map'](_0x5a7f8f[_0xc1dc('0x14')]['include'],function(_0xae1a84){return{'model':db[_0xae1a84['model']],'as':_0xae1a84['as'],'attributes':_0xae1a84[_0xc1dc('0x17')],'include':_0xae1a84[_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0xae1a84[_0xc1dc('0x19')],function(_0x20bc01){return{'model':db[_0x20bc01[_0xc1dc('0x1b')]],'as':_0x20bc01['as'],'attributes':_0x20bc01[_0xc1dc('0x17')],'include':_0x20bc01['include']?_[_0xc1dc('0x1a')](_0x20bc01[_0xc1dc('0x19')],function(_0x5dd459){return{'model':db[_0x5dd459[_0xc1dc('0x1b')]],'as':_0x5dd459['as'],'attributes':_0x5dd459[_0xc1dc('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1dc('0x1c')](function(_0x7c1373){logger['info']('ShowTrunk',_0x5a7f8f);logger[_0xc1dc('0xa')](_0xc1dc('0x1d'),_0x5a7f8f,JSON['stringify'](_0x7c1373));_0x53fd78(_0x7c1373);})['catch'](function(_0x39ebd1){logger[_0xc1dc('0xd')](_0xc1dc('0x1d'),_0x39ebd1[_0xc1dc('0xf')],_0x5a7f8f);_0x4ec49f(_0x47afda['error'](0x1f4,_0x39ebd1[_0xc1dc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c749ea6..56e90d8 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 _0x908d=['put','/:id','isAuthenticated','update','exports','express','Router','../../components/auth/service','./user-setting.controller'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x908d,0xd4));var _0xd908=function(_0x2982f6,_0x587d92){_0x2982f6=_0x2982f6-0x0;var _0x5bc87a=_0x908d[_0x2982f6];return _0x5bc87a;};'use strict';var express=require(_0xd908('0x0'));var router=express[_0xd908('0x1')]();var auth=require(_0xd908('0x2'));var controller=require(_0xd908('0x3'));router[_0xd908('0x4')](_0xd908('0x5'),auth[_0xd908('0x6')](),controller[_0xd908('0x7')]);module[_0xd908('0x8')]=router; \ No newline at end of file +var _0x8dc3=['update','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x36f0de,_0x36987e){var _0x2a6726=function(_0x459620){while(--_0x459620){_0x36f0de['push'](_0x36f0de['shift']());}};_0x2a6726(++_0x36987e);}(_0x8dc3,0x69));var _0x38dc=function(_0x310ed4,_0x220e32){_0x310ed4=_0x310ed4-0x0;var _0x432172=_0x8dc3[_0x310ed4];return _0x432172;};'use strict';var express=require(_0x38dc('0x0'));var router=express[_0x38dc('0x1')]();var auth=require(_0x38dc('0x2'));var controller=require(_0x38dc('0x3'));router[_0x38dc('0x4')](_0x38dc('0x5'),auth[_0x38dc('0x6')](),controller[_0x38dc('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 7c14e3b..786aa02 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 _0x4228=['DATE','INTEGER','UserId','sequelize','error','warning','info','exports','ENUM','BOOLEAN'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x4228,0x85));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8422('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x8422('0x1'),_0x8422('0x2'),_0x8422('0x3'),'debug'];module[_0x8422('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x8422('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8422('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8422('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8422('0x8')],'unique':_0x8422('0x9')}}; \ No newline at end of file +var _0x674f=['error','ENUM','BOOLEAN','DATE','INTEGER','sequelize'];(function(_0x42f318,_0x336c90){var _0x4aa72a=function(_0xfce356){while(--_0xfce356){_0x42f318['push'](_0x42f318['shift']());}};_0x4aa72a(++_0x336c90);}(_0x674f,0x113));var _0xf674=function(_0xc5211a,_0x6e2931){_0xc5211a=_0xc5211a-0x0;var _0x2313ed=_0x674f[_0xc5211a];return _0x2313ed;};'use strict';var Sequelize=require(_0xf674('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf674('0x1'),'warning','info','debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xf674('0x2')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf674('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf674('0x3')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf674('0x4')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf674('0x5')],'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 c4da7b2..7008350 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 _0x851c=['./user-setting.socket','register','defaults','redis','status','update','then','sendStatus','error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x851c,0x19d));var _0xc851=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x851c[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc851('0x0'));var Redis=require(_0xc851('0x1'));var logger=require(_0xc851('0x2'))(_0xc851('0x3'));var config=require(_0xc851('0x4'));var db=require(_0xc851('0x5'))['db'];var socket=require(_0xc851('0x6'))(new Redis(config['redis']));require(_0xc851('0x7'))[_0xc851('0x8')](socket);config['redis']=_[_0xc851('0x9')](config[_0xc851('0xa')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3067e5,_0x5c41e2){_0x5c41e2=_0x5c41e2||0xc8;return function(_0x4bc036){if(_0x4bc036){return _0x3067e5[_0xc851('0xb')](_0x5c41e2)['json'](_0x4bc036);}};}function saveUpdates(_0x509ac0){return function(_0x34b779){if(_0x34b779){return _0x34b779[_0xc851('0xc')](_0x509ac0)[_0xc851('0xd')](function(_0x177de0){return _0x177de0;});}return null;};}function handleEntityNotFound(_0x1f1524){return function(_0x1ee38d){if(!_0x1ee38d){_0x1f1524[_0xc851('0xe')](0x194);}return _0x1ee38d;};}function handleError(_0x69ce5a,_0x4cb360){_0x4cb360=_0x4cb360||0x1f4;return function(_0x3a1ce8){logger[_0xc851('0xf')](_0x3a1ce8[_0xc851('0x10')]);if(_0x3a1ce8[_0xc851('0x11')]){delete _0x3a1ce8[_0xc851('0x11')];}_0x69ce5a[_0xc851('0xb')](_0x4cb360)[_0xc851('0x12')](_0x3a1ce8);};}exports[_0xc851('0xc')]=function(_0x314e2c,_0x261b0f){if(_0x314e2c[_0xc851('0x13')][_0xc851('0x14')]!==_0xc851('0x15'))throw new Error(_0xc851('0x16'));if(isNaN(Number(_0x314e2c[_0xc851('0x17')]['id'])))throw new Error(_0xc851('0x18'));return db['UserSetting'][_0xc851('0x19')]({'where':{'id':_0x314e2c['params']['id']}})[_0xc851('0xd')](handleEntityNotFound(_0x261b0f,null))['then'](saveUpdates(_0x314e2c[_0xc851('0x1a')],null))[_0xc851('0xd')](respondWithResult(_0x261b0f,null))[_0xc851('0x1b')](handleError(_0x261b0f,null));}; \ No newline at end of file +var _0x0834=['api','redis','./user-setting.socket','defaults','localhost','status','json','update','then','sendStatus','name','send','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','../../config/logger'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x0834,0x18e));var _0x4083=function(_0x24e428,_0x43bfae){_0x24e428=_0x24e428-0x0;var _0xfe15d2=_0x0834[_0x24e428];return _0xfe15d2;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x4083('0x0'))(_0x4083('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x4083('0x2')]));require(_0x4083('0x3'))['register'](socket);config[_0x4083('0x2')]=_[_0x4083('0x4')](config['redis'],{'host':_0x4083('0x5'),'port':0x18eb});function respondWithResult(_0x5c5a54,_0x31c7ef){_0x31c7ef=_0x31c7ef||0xc8;return function(_0x26ed53){if(_0x26ed53){return _0x5c5a54[_0x4083('0x6')](_0x31c7ef)[_0x4083('0x7')](_0x26ed53);}};}function saveUpdates(_0x129337){return function(_0x26c623){if(_0x26c623){return _0x26c623[_0x4083('0x8')](_0x129337)[_0x4083('0x9')](function(_0x2a5093){return _0x2a5093;});}return null;};}function handleEntityNotFound(_0x2d739c){return function(_0x38a946){if(!_0x38a946){_0x2d739c[_0x4083('0xa')](0x194);}return _0x38a946;};}function handleError(_0x1da687,_0x5d6067){_0x5d6067=_0x5d6067||0x1f4;return function(_0x300a8f){logger['error'](_0x300a8f['stack']);if(_0x300a8f[_0x4083('0xb')]){delete _0x300a8f[_0x4083('0xb')];}_0x1da687['status'](_0x5d6067)[_0x4083('0xc')](_0x300a8f);};}exports[_0x4083('0x8')]=function(_0x236b04,_0x590a81){if(_0x236b04['user'][_0x4083('0xd')]!==_0x4083('0xe'))throw new Error('Unauthorized');if(isNaN(Number(_0x236b04[_0x4083('0xf')]['id'])))throw new Error(_0x4083('0x10'));return db[_0x4083('0x11')][_0x4083('0x12')]({'where':{'id':_0x236b04[_0x4083('0xf')]['id']}})['then'](handleEntityNotFound(_0x590a81,null))[_0x4083('0x9')](saveUpdates(_0x236b04[_0x4083('0x13')],null))[_0x4083('0x9')](respondWithResult(_0x590a81,null))[_0x4083('0x14')](handleError(_0x590a81,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 501b8a5..d64212a 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 _0xcd8e=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting'];(function(_0x17e15b,_0x5ccb3c){var _0x26824a=function(_0x2e3863){while(--_0x2e3863){_0x17e15b['push'](_0x17e15b['shift']());}};_0x26824a(++_0x5ccb3c);}(_0xcd8e,0x135));var _0xecd8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcd8e[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xecd8('0x0'));var UserSetting=require(_0xecd8('0x1'))['db'][_0xecd8('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xecd8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xecd8('0x4')};function emitEvent(_0x50ad43){return function(_0x575be4,_0x2b26c8,_0x15d723){UserSettingEvents[_0xecd8('0x5')](_0x50ad43+':'+_0x575be4['id'],_0x575be4);UserSettingEvents[_0xecd8('0x5')](_0x50ad43,_0x575be4);_0x15d723(null);};}for(var e in events){if(events[_0xecd8('0x6')](e)){var event=events[e];UserSetting[_0xecd8('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x37ee=['UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x22ed4b,_0x20609c){var _0x4e9cf6=function(_0x3a2de1){while(--_0x3a2de1){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4e9cf6(++_0x20609c);}(_0x37ee,0xf8));var _0xe37e=function(_0x4c0884,_0x37159c){_0x4c0884=_0x4c0884-0x0;var _0x3f7990=_0x37ee[_0x4c0884];return _0x3f7990;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xe37e('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe37e('0x1')](0x0);var events={'afterCreate':_0xe37e('0x2'),'afterUpdate':_0xe37e('0x3'),'afterDestroy':_0xe37e('0x4')};function emitEvent(_0x4e129d){return function(_0x519b01,_0x4ecdf6,_0x2f514e){UserSettingEvents[_0xe37e('0x5')](_0x4e129d+':'+_0x519b01['id'],_0x519b01);UserSettingEvents[_0xe37e('0x5')](_0x4e129d,_0x519b01);_0x2f514e(null);};}for(var e in events){if(events[_0xe37e('0x6')](e)){var event=events[e];UserSetting[_0xe37e('0x7')](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 d037820..441dc33 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 _0x9ffd=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','user_settings'];(function(_0xdf22bc,_0x58e815){var _0x35a69e=function(_0x4ef52f){while(--_0x4ef52f){_0xdf22bc['push'](_0xdf22bc['shift']());}};_0x35a69e(++_0x58e815);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3842f0,_0x197db5){_0x3842f0=_0x3842f0-0x0;var _0x4bfe35=_0x9ffd[_0x3842f0];return _0x4bfe35;};'use strict';var attributes=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]=function(_0x47e5c0){return _0x47e5c0['define'](_0xd9ff('0x2'),attributes,{'tableName':_0xd9ff('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26dc20){if(!_0x26dc20[_0xd9ff('0x4')])_0x26dc20['clientSideLoggingEnabledSince']=null;else if(_0x26dc20[_0xd9ff('0x5')]===null)_0x26dc20[_0xd9ff('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x93e6=['clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings','clientSideLoggingEnabled'];(function(_0xc63d49,_0x48e9f9){var _0x4ff3d9=function(_0x405098){while(--_0x405098){_0xc63d49['push'](_0xc63d49['shift']());}};_0x4ff3d9(++_0x48e9f9);}(_0x93e6,0x11e));var _0x693e=function(_0x268396,_0x864c1c){_0x268396=_0x268396-0x0;var _0x2d7b5d=_0x93e6[_0x268396];return _0x2d7b5d;};'use strict';var attributes=require(_0x693e('0x0'));module['exports']=function(_0x5f4d40){return _0x5f4d40[_0x693e('0x1')]('UserSetting',attributes,{'tableName':_0x693e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e7e48){if(!_0x4e7e48[_0x693e('0x3')])_0x4e7e48[_0x693e('0x4')]=null;else if(_0x4e7e48[_0x693e('0x4')]===null)_0x4e7e48['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 3d12093..4d7dc82 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 _0x5b90=['emit','user-setting:update:user-','UserId','register','length','user-setting:','save','remove','update','user-setting:update'];(function(_0x281e78,_0x5f2ee5){var _0x3789c4=function(_0x2c6735){while(--_0x2c6735){_0x281e78['push'](_0x281e78['shift']());}};_0x3789c4(++_0x5f2ee5);}(_0x5b90,0xec));var _0x05b9=function(_0x79e316,_0x38e778){_0x79e316=_0x79e316-0x0;var _0xb8b436=_0x5b90[_0x79e316];return _0xb8b436;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x05b9('0x0'),_0x05b9('0x1'),_0x05b9('0x2')];function createListener(_0x435d61,_0x12bca0){return function(_0x49f6bb){_0x12bca0['emit'](_0x435d61,_0x49f6bb);if(_0x435d61===_0x05b9('0x3')){_0x12bca0[_0x05b9('0x4')](_0x05b9('0x5')+_0x49f6bb[_0x05b9('0x6')],_0x49f6bb);}};}exports[_0x05b9('0x7')]=function(_0x189a2f){for(var _0x5773b2=0x0,_0x25c31d=events[_0x05b9('0x8')];_0x5773b2<_0x25c31d;_0x5773b2++){var _0x121642=events[_0x5773b2];var _0x3d9e27=createListener(_0x05b9('0x9')+_0x121642,_0x189a2f);UserSettingEvents['on'](_0x121642,_0x3d9e27);}}; \ No newline at end of file +var _0xdad1=['save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','./user-setting.events'];(function(_0x2b8e8d,_0x10672e){var _0x433be5=function(_0x1efddc){while(--_0x1efddc){_0x2b8e8d['push'](_0x2b8e8d['shift']());}};_0x433be5(++_0x10672e);}(_0xdad1,0x86));var _0x1dad=function(_0x26b31f,_0x1402a3){_0x26b31f=_0x26b31f-0x0;var _0x1cfd0d=_0xdad1[_0x26b31f];return _0x1cfd0d;};'use strict';var UserSettingEvents=require(_0x1dad('0x0'));var events=[_0x1dad('0x1'),_0x1dad('0x2'),_0x1dad('0x3')];function createListener(_0x2c18ee,_0x543dbc){return function(_0x181a2d){_0x543dbc[_0x1dad('0x4')](_0x2c18ee,_0x181a2d);if(_0x2c18ee===_0x1dad('0x5')){_0x543dbc[_0x1dad('0x4')](_0x1dad('0x6')+_0x181a2d[_0x1dad('0x7')],_0x181a2d);}};}exports[_0x1dad('0x8')]=function(_0x5edd5c){for(var _0x543248=0x0,_0x2260b0=events['length'];_0x543248<_0x2260b0;_0x543248++){var _0x886873=events[_0x543248];var _0x357685=createListener('user-setting:'+_0x886873,_0x5edd5c);UserSettingEvents['on'](_0x886873,_0x357685);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index ca9a711..268618c 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 _0xc21d=['addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','/:id','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','index','get','isAuthenticated','describe','whoami','/presence','getPresence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts'];(function(_0x1b4124,_0x5bb910){var _0x26b206=function(_0x51d9ba){while(--_0x51d9ba){_0x1b4124['push'](_0x1b4124['shift']());}};_0x26b206(++_0x5bb910);}(_0xc21d,0x17d));var _0xdc21=function(_0xd2d138,_0x55d264){_0xd2d138=_0xd2d138-0x0;var _0x371ae0=_0xc21d[_0xd2d138];return _0x371ae0;};'use strict';var multer=require(_0xdc21('0x0'));var util=require(_0xdc21('0x1'));var path=require(_0xdc21('0x2'));var timeout=require(_0xdc21('0x3'));var express=require(_0xdc21('0x4'));var router=express['Router']();var fs_extra=require(_0xdc21('0x5'));var auth=require(_0xdc21('0x6'));var interaction=require(_0xdc21('0x7'));var config=require(_0xdc21('0x8'));var controller=require(_0xdc21('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdc21('0xa')]);router[_0xdc21('0xb')]('/describe',auth[_0xdc21('0xc')](),controller[_0xdc21('0xd')]);router[_0xdc21('0xb')]('/whoami',auth['isAuthenticated'](),controller[_0xdc21('0xe')]);router[_0xdc21('0xb')](_0xdc21('0xf'),auth['isAuthenticated'](),controller[_0xdc21('0x10')]);router['get']('/:id',auth[_0xdc21('0xc')](),controller[_0xdc21('0x11')]);router[_0xdc21('0xb')](_0xdc21('0x12'),controller['getAvatar']);router[_0xdc21('0xb')](_0xdc21('0x13'),auth['isAuthenticated'](),controller[_0xdc21('0x14')]);router[_0xdc21('0xb')](_0xdc21('0x15'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x16')]);router[_0xdc21('0xb')](_0xdc21('0x17'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x18')]);router['get']('/:id/queues_rt',auth[_0xdc21('0xc')](),controller[_0xdc21('0x19')]);router[_0xdc21('0xb')](_0xdc21('0x1a'),auth['isAuthenticated'](),controller[_0xdc21('0x1b')]);router['get'](_0xdc21('0x1c'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x1d')]);router[_0xdc21('0xb')](_0xdc21('0x1e'),auth['isAuthenticated'](),controller[_0xdc21('0x1f')]);router[_0xdc21('0xb')](_0xdc21('0x20'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x21')]);router[_0xdc21('0xb')](_0xdc21('0x22'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x23')]);router[_0xdc21('0xb')](_0xdc21('0x24'),auth['isAuthenticated'](),controller['getMailInteractions']);router['get'](_0xdc21('0x25'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x26')]);router[_0xdc21('0xb')](_0xdc21('0x27'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x28')]);router['get']('/:id/whatsapp/interactions',auth[_0xdc21('0xc')](),controller[_0xdc21('0x29')]);router[_0xdc21('0xb')](_0xdc21('0x2a'),auth[_0xdc21('0xc')](),controller['getTeams']);router[_0xdc21('0xb')](_0xdc21('0x2b'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x2c')]);router[_0xdc21('0xb')]('/:id/agents',auth['isAuthenticated'](),controller[_0xdc21('0x2d')]);router[_0xdc21('0xb')]('/:id/prefixes',auth[_0xdc21('0xc')](),controller[_0xdc21('0x2e')]);router[_0xdc21('0xb')](_0xdc21('0x2f'),auth[_0xdc21('0xc')](),controller['getFaxAccounts']);router[_0xdc21('0xb')](_0xdc21('0x30'),auth['isAuthenticated'](),controller[_0xdc21('0x31')]);router['get']('/:id/openchannel_accounts',auth[_0xdc21('0xc')](),controller[_0xdc21('0x32')]);router[_0xdc21('0xb')](_0xdc21('0x33'),auth[_0xdc21('0xc')](),controller['getSmsAccounts']);router[_0xdc21('0xb')](_0xdc21('0x34'),auth[_0xdc21('0xc')](),controller['getChatWebsites']);router[_0xdc21('0xb')](_0xdc21('0x35'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x36')]);router[_0xdc21('0xb')](_0xdc21('0x37'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x38')]);router['get'](_0xdc21('0x39'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x3a')]);router[_0xdc21('0xb')](_0xdc21('0x3b'),auth[_0xdc21('0xc')](),controller['getApiKey']);router[_0xdc21('0x3c')](_0xdc21('0x15'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x3d')]);router['post']('/',auth[_0xdc21('0xc')](),controller[_0xdc21('0x3e')]);router[_0xdc21('0x3c')](_0xdc21('0x3f'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x40')]);router[_0xdc21('0x3c')](_0xdc21('0x17'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x41')]);var upload=multer({'storage':multer[_0xdc21('0x42')]({'destination':function(_0x5f1b54,_0x2206b6,_0x4565e7){_0x4565e7(null,path[_0xdc21('0x43')](config['root'],_0xdc21('0x44')));},'filename':function(_0x6a65b7,_0xc44c1a,_0x2e3c25){_0x2e3c25(null,util['format']('%s-%s',Date[_0xdc21('0x45')](),_0xc44c1a[_0xdc21('0x46')]));}})});router[_0xdc21('0x3c')]('/:id/avatar',upload[_0xdc21('0x47')](_0xdc21('0x48')),controller[_0xdc21('0x49')]);router['post'](_0xdc21('0x4a'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x4b')]);router[_0xdc21('0x3c')]('/:id/logout',auth[_0xdc21('0xc')](),controller[_0xdc21('0x4c')]);router[_0xdc21('0x3c')](_0xdc21('0x4d'),auth[_0xdc21('0xc')](),controller['pause']);router[_0xdc21('0x3c')](_0xdc21('0x4e'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x4f')]);router[_0xdc21('0x3c')](_0xdc21('0x2a'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x50')]);router[_0xdc21('0x3c')](_0xdc21('0x51'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x52')]);router[_0xdc21('0x3c')](_0xdc21('0x53'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x54')]);router['post'](_0xdc21('0x55'),auth[_0xdc21('0xc')](),controller['addFaxInteractions']);router['post'](_0xdc21('0x56'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x57')]);router[_0xdc21('0x3c')](_0xdc21('0x58'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router['post'](_0xdc21('0x59'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x5a')]);router[_0xdc21('0x3c')]('/:id/fax_accounts',auth[_0xdc21('0xc')](),controller[_0xdc21('0x5b')]);router[_0xdc21('0x3c')](_0xdc21('0x30'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x5c')]);router['post']('/:id/openchannel_accounts',auth[_0xdc21('0xc')](),controller[_0xdc21('0x5d')]);router[_0xdc21('0x3c')](_0xdc21('0x33'),auth['isAuthenticated'](),controller[_0xdc21('0x5e')]);router[_0xdc21('0x3c')]('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xdc21('0x3c')]('/:id/whatsapp_accounts',auth[_0xdc21('0xc')](),controller[_0xdc21('0x5f')]);router[_0xdc21('0x3c')](_0xdc21('0x37'),auth[_0xdc21('0xc')](),controller['addSquareProjects']);router[_0xdc21('0x3c')](_0xdc21('0x3b'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x60')]);router[_0xdc21('0x61')]('/:id',auth[_0xdc21('0xc')](),controller[_0xdc21('0x62')]);router[_0xdc21('0x61')](_0xdc21('0x63'),auth[_0xdc21('0xc')](),controller['changePassword']);router['delete'](_0xdc21('0x17'),auth[_0xdc21('0xc')](),controller['removeQueues']);router[_0xdc21('0x64')]('/:id/teams',auth['isAuthenticated'](),controller[_0xdc21('0x65')]);router[_0xdc21('0x64')](_0xdc21('0x66'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x67')]);router['delete']('/:id/chat_interactions',auth[_0xdc21('0xc')](),controller[_0xdc21('0x68')]);router['delete'](_0xdc21('0x53'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x69')]);router['delete']('/:id/fax_interactions',auth[_0xdc21('0xc')](),controller[_0xdc21('0x6a')]);router[_0xdc21('0x64')]('/:id/sms_interactions',auth[_0xdc21('0xc')](),controller[_0xdc21('0x6b')]);router[_0xdc21('0x64')]('/:id/openchannel_interactions',auth[_0xdc21('0xc')](),controller[_0xdc21('0x6c')]);router[_0xdc21('0x64')](_0xdc21('0x59'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x6d')]);router['delete'](_0xdc21('0x2f'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x6e')]);router[_0xdc21('0x64')](_0xdc21('0x30'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x6f')]);router[_0xdc21('0x64')](_0xdc21('0x70'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete'](_0xdc21('0x33'),auth['isAuthenticated'](),controller[_0xdc21('0x71')]);router[_0xdc21('0x64')]('/:id/chat_websites',auth[_0xdc21('0xc')](),controller[_0xdc21('0x72')]);router['delete']('/:id/whatsapp_accounts',auth[_0xdc21('0xc')](),controller[_0xdc21('0x73')]);router[_0xdc21('0x64')]('/:id/square_projects',auth[_0xdc21('0xc')](),controller[_0xdc21('0x74')]);router[_0xdc21('0x64')](_0xdc21('0x3b'),auth[_0xdc21('0xc')](),controller[_0xdc21('0x75')]);module[_0xdc21('0x76')]=router; \ No newline at end of file +var _0x6af0=['whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','post','addContacts','create','/create_many','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','update','/:id/password','changePassword','delete','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2493c3,_0x419613){var _0x5bd06a=function(_0x4f0f53){while(--_0x4f0f53){_0x2493c3['push'](_0x2493c3['shift']());}};_0x5bd06a(++_0x419613);}(_0x6af0,0x1b6));var _0x06af=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6af0[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0x06af('0x0'));var util=require(_0x06af('0x1'));var path=require(_0x06af('0x2'));var timeout=require(_0x06af('0x3'));var express=require(_0x06af('0x4'));var router=express['Router']();var fs_extra=require(_0x06af('0x5'));var auth=require(_0x06af('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x06af('0x7'));var controller=require(_0x06af('0x8'));router['get']('/',auth[_0x06af('0x9')](),controller[_0x06af('0xa')]);router[_0x06af('0xb')](_0x06af('0xc'),auth[_0x06af('0x9')](),controller[_0x06af('0xd')]);router[_0x06af('0xb')]('/whoami',auth['isAuthenticated'](),controller[_0x06af('0xe')]);router[_0x06af('0xb')](_0x06af('0xf'),auth[_0x06af('0x9')](),controller[_0x06af('0x10')]);router['get'](_0x06af('0x11'),auth[_0x06af('0x9')](),controller[_0x06af('0x12')]);router[_0x06af('0xb')](_0x06af('0x13'),controller[_0x06af('0x14')]);router[_0x06af('0xb')]('/:id/open_tabs',auth[_0x06af('0x9')](),controller['getOpenTabs']);router[_0x06af('0xb')](_0x06af('0x15'),auth[_0x06af('0x9')](),controller['getContacts']);router['get'](_0x06af('0x16'),auth[_0x06af('0x9')](),controller[_0x06af('0x17')]);router[_0x06af('0xb')](_0x06af('0x18'),auth[_0x06af('0x9')](),controller[_0x06af('0x19')]);router[_0x06af('0xb')](_0x06af('0x1a'),auth[_0x06af('0x9')](),controller[_0x06af('0x1b')]);router[_0x06af('0xb')](_0x06af('0x1c'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x06af('0xb')](_0x06af('0x1d'),auth['isAuthenticated'](),controller[_0x06af('0x1e')]);router['get'](_0x06af('0x1f'),auth[_0x06af('0x9')](),controller[_0x06af('0x20')]);router[_0x06af('0xb')](_0x06af('0x21'),auth[_0x06af('0x9')](),controller['getOpenchannelInteractions']);router[_0x06af('0xb')](_0x06af('0x22'),auth[_0x06af('0x9')](),controller[_0x06af('0x23')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0x06af('0x24'),auth[_0x06af('0x9')](),controller[_0x06af('0x25')]);router[_0x06af('0xb')](_0x06af('0x26'),auth['isAuthenticated'](),controller[_0x06af('0x27')]);router[_0x06af('0xb')](_0x06af('0x28'),auth['isAuthenticated'](),controller[_0x06af('0x29')]);router[_0x06af('0xb')]('/:id/lists',auth[_0x06af('0x9')](),controller[_0x06af('0x2a')]);router[_0x06af('0xb')](_0x06af('0x2b'),auth['isAuthenticated'](),controller[_0x06af('0x2c')]);router[_0x06af('0xb')](_0x06af('0x2d'),auth['isAuthenticated'](),controller[_0x06af('0x2e')]);router['get'](_0x06af('0x2f'),auth[_0x06af('0x9')](),controller[_0x06af('0x30')]);router[_0x06af('0xb')](_0x06af('0x31'),auth[_0x06af('0x9')](),controller[_0x06af('0x32')]);router['get'](_0x06af('0x33'),auth['isAuthenticated'](),controller[_0x06af('0x34')]);router[_0x06af('0xb')](_0x06af('0x35'),auth['isAuthenticated'](),controller['getSmsAccounts']);router['get'](_0x06af('0x36'),auth['isAuthenticated'](),controller[_0x06af('0x37')]);router['get']('/:id/whatsapp_accounts',auth[_0x06af('0x9')](),controller[_0x06af('0x38')]);router['get'](_0x06af('0x39'),auth['isAuthenticated'](),controller[_0x06af('0x3a')]);router[_0x06af('0xb')](_0x06af('0x3b'),auth[_0x06af('0x9')](),controller['getScheduledCalls']);router[_0x06af('0xb')](_0x06af('0x3c'),auth[_0x06af('0x9')](),controller['getApiKey']);router[_0x06af('0x3d')](_0x06af('0x15'),auth['isAuthenticated'](),controller[_0x06af('0x3e')]);router['post']('/',auth[_0x06af('0x9')](),controller[_0x06af('0x3f')]);router[_0x06af('0x3d')](_0x06af('0x40'),auth['isAuthenticated'](),controller['bulkCreate']);router['post'](_0x06af('0x16'),auth[_0x06af('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x06af('0x41')]({'destination':function(_0x5ae199,_0x139dd3,_0x1cdf3d){_0x1cdf3d(null,path[_0x06af('0x42')](config[_0x06af('0x43')],_0x06af('0x44')));},'filename':function(_0x58e879,_0x51d2cd,_0x39af21){_0x39af21(null,util[_0x06af('0x45')](_0x06af('0x46'),Date[_0x06af('0x47')](),_0x51d2cd[_0x06af('0x48')]));}})});router['post'](_0x06af('0x13'),upload[_0x06af('0x49')](_0x06af('0x4a')),controller[_0x06af('0x4b')]);router[_0x06af('0x3d')](_0x06af('0x4c'),auth[_0x06af('0x9')](),controller['login']);router[_0x06af('0x3d')](_0x06af('0x4d'),auth['isAuthenticated'](),controller[_0x06af('0x4e')]);router[_0x06af('0x3d')](_0x06af('0x4f'),auth[_0x06af('0x9')](),controller[_0x06af('0x50')]);router[_0x06af('0x3d')](_0x06af('0x51'),auth['isAuthenticated'](),controller[_0x06af('0x52')]);router[_0x06af('0x3d')](_0x06af('0x28'),auth[_0x06af('0x9')](),controller['addTeams']);router['post'](_0x06af('0x53'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x06af('0x3d')](_0x06af('0x54'),auth[_0x06af('0x9')](),controller[_0x06af('0x55')]);router[_0x06af('0x3d')](_0x06af('0x56'),auth[_0x06af('0x9')](),controller[_0x06af('0x57')]);router[_0x06af('0x3d')]('/:id/sms_interactions',auth[_0x06af('0x9')](),controller[_0x06af('0x58')]);router['post'](_0x06af('0x59'),auth[_0x06af('0x9')](),controller[_0x06af('0x5a')]);router[_0x06af('0x3d')](_0x06af('0x5b'),auth['isAuthenticated'](),controller[_0x06af('0x5c')]);router['post'](_0x06af('0x2f'),auth[_0x06af('0x9')](),controller[_0x06af('0x5d')]);router[_0x06af('0x3d')]('/:id/mail_accounts',auth[_0x06af('0x9')](),controller['addMailAccounts']);router[_0x06af('0x3d')](_0x06af('0x33'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x06af('0x3d')](_0x06af('0x35'),auth[_0x06af('0x9')](),controller['addSmsAccounts']);router['post'](_0x06af('0x36'),auth[_0x06af('0x9')](),controller['addChatWebsites']);router[_0x06af('0x3d')](_0x06af('0x5e'),auth[_0x06af('0x9')](),controller[_0x06af('0x5f')]);router[_0x06af('0x3d')](_0x06af('0x39'),auth['isAuthenticated'](),controller['addSquareProjects']);router['post'](_0x06af('0x3c'),auth[_0x06af('0x9')](),controller[_0x06af('0x60')]);router['put']('/:id',auth[_0x06af('0x9')](),controller[_0x06af('0x61')]);router['put'](_0x06af('0x62'),auth['isAuthenticated'](),controller[_0x06af('0x63')]);router[_0x06af('0x64')](_0x06af('0x16'),auth[_0x06af('0x9')](),controller['removeQueues']);router['delete'](_0x06af('0x28'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x06af('0x11'),auth[_0x06af('0x9')](),controller['destroy']);router[_0x06af('0x64')](_0x06af('0x53'),auth[_0x06af('0x9')](),controller[_0x06af('0x65')]);router[_0x06af('0x64')](_0x06af('0x54'),auth[_0x06af('0x9')](),controller[_0x06af('0x66')]);router[_0x06af('0x64')](_0x06af('0x56'),auth['isAuthenticated'](),controller[_0x06af('0x67')]);router[_0x06af('0x64')](_0x06af('0x68'),auth[_0x06af('0x9')](),controller['removeSmsInteractions']);router[_0x06af('0x64')](_0x06af('0x59'),auth[_0x06af('0x9')](),controller[_0x06af('0x69')]);router[_0x06af('0x64')](_0x06af('0x5b'),auth[_0x06af('0x9')](),controller[_0x06af('0x6a')]);router['delete'](_0x06af('0x2f'),auth[_0x06af('0x9')](),controller[_0x06af('0x6b')]);router[_0x06af('0x64')](_0x06af('0x31'),auth['isAuthenticated'](),controller[_0x06af('0x6c')]);router['delete'](_0x06af('0x33'),auth[_0x06af('0x9')](),controller[_0x06af('0x6d')]);router['delete']('/:id/sms_accounts',auth[_0x06af('0x9')](),controller[_0x06af('0x6e')]);router[_0x06af('0x64')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x06af('0x6f')]);router[_0x06af('0x64')](_0x06af('0x5e'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x06af('0x64')]('/:id/square_projects',auth[_0x06af('0x9')](),controller['removeSquareProjects']);router[_0x06af('0x64')]('/:id/api_key',auth[_0x06af('0x9')](),controller[_0x06af('0x70')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 10b2e8c..e21d64d 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 _0x008c=['all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x47f06b,_0x5f1a8d){var _0x82ac29=function(_0x1aec58){while(--_0x1aec58){_0x47f06b['push'](_0x47f06b['shift']());}};_0x82ac29(++_0x5f1a8d);}(_0x008c,0x188));var _0xc008=function(_0x4adead,_0x3e7eef){_0x4adead=_0x4adead-0x0;var _0x34cfca=_0x008c[_0x4adead];return _0x34cfca;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));module[_0xc008('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc008('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47063f){this[_0xc008('0x6')](_0xc008('0x5'),_0x47063f);this[_0xc008('0x6')](_0xc008('0x7'),_0x47063f);},'comment':_0xc008('0x8')},'fullname':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'set':function(_0x9c8cb2){this['setDataValue'](_0xc008('0xa'),_0x9c8cb2);this['setDataValue'](_0xc008('0xb'),util['format']('\x22%s\x22\x20<%s>',_0x9c8cb2,this[_0xc008('0xc')](_0xc008('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eacfa){if(_0x1eacfa){this[_0xc008('0x6')]('email',_0x1eacfa[_0xc008('0xe')]());}}},'role':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x10'),_0xc008('0x11'),_0xc008('0x12'),_0xc008('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25e13f){this[_0xc008('0x6')](_0xc008('0xd'),_0x25e13f);this[_0xc008('0x6')](_0xc008('0x15'),_0x25e13f);this['setDataValue']('callerid',util['format'](_0xc008('0x16'),this[_0xc008('0xc')](_0xc008('0xa')),_0x25e13f));}},'salt':{'type':Sequelize[_0xc008('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc008('0x9')]},'city':{'type':Sequelize[_0xc008('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc008('0x18')]},'chatCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc008('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x19')},'ipaddr':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xc008('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x1a'),_0xc008('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xc008('0x1a')},'context':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x1b')},'callingpres':{'type':Sequelize[_0xc008('0xf')]('ALLOWED_NOT_SCREENED',_0xc008('0x1c'),_0xc008('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc008('0x1e'),_0xc008('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x20'),'set':function(_0x2b862d){this[_0xc008('0x6')](_0xc008('0x21'),_0x2b862d?_0x2b862d['join'](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x21'))?this['getDataValue'](_0xc008('0x21'))[_0xc008('0x22')](','):null;},'comment':_0xc008('0x23')},'dtmfmode':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x24'),_0xc008('0x25'),_0xc008('0x26'),_0xc008('0x27'),_0xc008('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x2a'),_0xc008('0x2b'),_0xc008('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x399b64){this[_0xc008('0x6')]('nat',_0x399b64?_0x399b64[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x2e'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc008('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc008('0x9')]},'pickupgroup':{'type':Sequelize[_0xc008('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xc008('0x9')]},'language':{'type':Sequelize[_0xc008('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc008('0x9')]},'disallow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x30')},'allow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x31'),'set':function(_0x387dfd){this[_0xc008('0x6')](_0xc008('0x32'),_0x387dfd?_0x387dfd[_0xc008('0x2d')](';'):_0xc008('0x31'));},'get':function(){return this['getDataValue'](_0xc008('0x32'))?this[_0xc008('0xc')](_0xc008('0x32'))[_0xc008('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'set':function(_0x36e7ae){this[_0xc008('0x6')]('insecure',_0x36e7ae?_0x36e7ae[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x33'))?this[_0xc008('0xc')](_0xc008('0x33'))['split'](','):null;},'comment':_0xc008('0x34')},'trustrpid':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc008('0x37'),_0xc008('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x39'),_0xc008('0x3a')),'allowNull':!![],'defaultValue':_0xc008('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x3b'),_0xc008('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x3d'),'passive',_0xc008('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc008('0xf')]('yes','no',_0xc008('0x2a'),'update',_0xc008('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc008('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xc008('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc008('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x375e71){this['setDataValue']('showWebBar',_0x375e71);var _0x37ce5e=this[_0xc008('0x41')]({'plain':!![]});switch(_0x375e71){case 0x0:case 0x1:var _0x56e755=_0x37ce5e[_0xc008('0x21')]?_[_0xc008('0x42')](_0x37ce5e[_0xc008('0x21')])?_0x37ce5e[_0xc008('0x21')][_0xc008('0x2d')]():_0x37ce5e[_0xc008('0x21')]:_0xc008('0x20');if(_0x56e755==='wss'){_0x56e755=_0xc008('0x20');}this[_0xc008('0x6')](_0xc008('0x21'),_0x56e755);this[_0xc008('0x6')](_0xc008('0x43'),'no');this[_0xc008('0x6')](_0xc008('0x44'),null);this[_0xc008('0x6')](_0xc008('0x45'),null);this[_0xc008('0x6')](_0xc008('0x46'),null);this[_0xc008('0x6')](_0xc008('0x47'),null);this[_0xc008('0x6')]('dtlsverify',null);this[_0xc008('0x6')](_0xc008('0x48'),null);this[_0xc008('0x6')]('dtlscertfile',null);this[_0xc008('0x6')](_0xc008('0x49'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xc008('0x6')](_0xc008('0x21'),_0xc008('0x4a'));this[_0xc008('0x6')](_0xc008('0x43'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x44'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x45'),'yes');this[_0xc008('0x6')](_0xc008('0x46'),_0xc008('0x29'));this[_0xc008('0x6')]('dtlsenable',_0xc008('0x29'));this['setDataValue'](_0xc008('0x4b'),'no');this[_0xc008('0x6')](_0xc008('0x48'),'actpass');this[_0xc008('0x6')](_0xc008('0x4c'),_0x37ce5e[_0xc008('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0xc008('0x6')]('dtlsprivatekey',_0x37ce5e[_0xc008('0x49')]||_0xc008('0x4d'));this[_0xc008('0x6')](_0xc008('0x4e'),_0xc008('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3c30db){this[_0xc008('0x6')]('permissions',_0x3c30db?_0x3c30db[_0xc008('0x2d')](','):[]);},'get':function(){return this['getDataValue'](_0xc008('0x4f'))?_['map'](this[_0xc008('0xc')]('permissions')[_0xc008('0x22')](','),function(_0x103d75){return parseInt(_0x103d75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc008('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc008('0x50')],'get':function(){return this[_0xc008('0xc')](_0xc008('0x51'))?this[_0xc008('0xc')](_0xc008('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc008('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3b2669){if(typeof _0x3b2669===_0xc008('0x52')){var _0x2edb8e=_0x3b2669==='1'?!![]:_0x3b2669==='0'?![]:_0x3b2669===_0xc008('0x53')?!![]:_0x3b2669===_0xc008('0x54')?![]:![];this[_0xc008('0x6')](_0xc008('0x55'),_0x2edb8e);}else{this['setDataValue']('screenrecording',_0x3b2669);}}},'blocked':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3104cd){this[_0xc008('0x6')]('blocked',_0x3104cd);if(_0x3104cd===!![]){this[_0xc008('0x6')](_0xc008('0x56'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xc008('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc008('0x14')](0x5)[_0xc008('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x15040b,_0x34f641){var _0x2e1af0=function(_0x53ce44){while(--_0x53ce44){_0x15040b['push'](_0x15040b['shift']());}};_0x2e1af0(++_0x34f641);}(_0x34e8,0x12c));var _0x834e=function(_0x539b24,_0x2be1fc){_0x539b24=_0x539b24-0x0;var _0x1a2741=_0x34e8[_0x539b24];return _0x1a2741;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 4267e39..9afeea6 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 _0xa0ac=['whatsapp','catch','show','differenceBy','keys','rawAttributes','filters','intersection','model','fields','merge','options','openTabs','fax','body','params','describe','addContacts','omit','ids','internal','Setting','findById','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','102','103','113','110','104','105','106','107','108','109','100','115','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','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','all','compact','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','VoiceQueue','findAll','voice','format','SIP/%s','UserVoiceQueueRt','removeQueues','remove','Queue:remove','destroy','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WHATSAPP','getContacts','sort','pick','hasOwnProperty','CmList','color','tag','nolimit','Unknown\x20channel','Queue','Unknown\x20role','getVoiceQueuesRt','order','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','UserId','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','connection','remoteAddress','socket','UserVoiceQueue.penalty','upsert','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','concat','forEach','pause','QueuePause','DEFAULT\x20PAUSE','type','mailPause','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','unpause','getTeams','Team','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','VoicePrefixId','getLists','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','firstName','lastName','CmContact','dialActive','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','inbound','getAgents','flatten','col','toString','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','ui.','InteractionId','ui.createdAt','OpenTabs','moment','util','path','lodash','squel','jayson/promise','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','./user.socket','register','redis','defaults','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','emit','userNotification:recalc:','get','role','admin','Users','Agents','agent','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','stack','send','fieldName','key','password','salt','getOptions','where','User','count','query','includeAll','userSetting','include','UserSetting','attributes','rows','true','length','push','chat','sms','dataValues','mail','openchannel'];(function(_0x35c3ae,_0x3b697d){var _0x5c0df2=function(_0x3397c6){while(--_0x3397c6){_0x35c3ae['push'](_0x35c3ae['shift']());}};_0x5c0df2(++_0x3b697d);}(_0xa0ac,0x139));var _0xca0a=function(_0x20ee90,_0x1bf986){_0x20ee90=_0x20ee90-0x0;var _0x576001=_0xa0ac[_0x20ee90];return _0x576001;};'use strict';var moment=require(_0xca0a('0x0'));var util=require(_0xca0a('0x1'));var path=require(_0xca0a('0x2'));var fs=require('fs');var _=require(_0xca0a('0x3'));var squel=require(_0xca0a('0x4'));var jayson=require(_0xca0a('0x5'));var Redis=require(_0xca0a('0x6'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0xca0a('0x7'))(_0xca0a('0x8'));var utils=require(_0xca0a('0x9'));var config=require('../../config/environment');var licenseUtil=require(_0xca0a('0xa'));var APIBadRequestError=require(_0xca0a('0xb'))[_0xca0a('0xc')];var APINotFoundError=require(_0xca0a('0xb'))[_0xca0a('0xd')];var APIHandleError=require(_0xca0a('0xb'))[_0xca0a('0xe')];var db=require(_0xca0a('0xf'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xca0a('0x10'))[_0xca0a('0x11')](socket);config[_0xca0a('0x12')]=_[_0xca0a('0x13')](config[_0xca0a('0x12')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0xca0a('0x14')][_0xca0a('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x28edfc,_0x1522f4,_0x34be2f,_0x219668){return new Promise(function(_0x350b7b,_0x1baaed){var _0x30a23e=_0x219668||amiClient;return _0x30a23e[_0xca0a('0x16')](_0x28edfc,_0x34be2f)[_0xca0a('0x17')](function(_0x45f2fc){logger[_0xca0a('0x18')](_0xca0a('0x19'),_0x1522f4,_0xca0a('0x1a'));logger['debug'](_0xca0a('0x1b'),_0x1522f4,_0xca0a('0x1a'),JSON[_0xca0a('0x1c')](_0x45f2fc));if(_0x45f2fc[_0xca0a('0x1d')]){if(_0x45f2fc[_0xca0a('0x1d')][_0xca0a('0x1e')]===0x1f4){logger[_0xca0a('0x1d')](_0xca0a('0x19'),_0x1522f4,_0x45f2fc[_0xca0a('0x1d')][_0xca0a('0x1f')]);return _0x1baaed(_0x45f2fc[_0xca0a('0x1d')][_0xca0a('0x1f')]);}logger['error'](_0xca0a('0x19'),_0x1522f4,_0x45f2fc['error'][_0xca0a('0x1f')]);return _0x350b7b(_0x45f2fc[_0xca0a('0x1d')][_0xca0a('0x1f')]);}else{logger['info'](_0xca0a('0x19'),_0x1522f4,_0xca0a('0x1a'));_0x350b7b(_0x45f2fc[_0xca0a('0x20')][_0xca0a('0x1f')]);}})['catch'](function(_0x1768ac){logger['error'](_0xca0a('0x19'),_0x1522f4,_0x1768ac);_0x1baaed(_0x1768ac);});});}function respondWithStatusCode(_0x4655ed,_0x5617bf){_0x5617bf=_0x5617bf||0xcc;return function(_0x2a81ab){if(_0x2a81ab){return _0x4655ed[_0xca0a('0x21')](_0x5617bf);}return _0x4655ed[_0xca0a('0x22')](_0x5617bf)[_0xca0a('0x23')]();};}function respondWithResult(_0x298bba,_0x5609bb){_0x5609bb=_0x5609bb||0xc8;return function(_0x2458c3){if(_0x2458c3){return _0x298bba['status'](_0x5609bb)[_0xca0a('0x24')](_0x2458c3);}};}function respondWithFilteredResult(_0x49f6a2,_0x461cab){return function(_0x995cb6){if(_0x995cb6){var _0xe90702=typeof _0x461cab[_0xca0a('0x25')]===_0xca0a('0x26')&&typeof _0x461cab[_0xca0a('0x27')]==='undefined';var _0x44c607=_0x995cb6['count'];var _0x5dcd71=_0xe90702?0x0:_0x461cab[_0xca0a('0x25')];var _0x38d80d=_0xe90702?_0x995cb6['count']:_0x461cab['offset']+_0x461cab[_0xca0a('0x27')];var _0x1a01c2;if(_0x38d80d>=_0x44c607){_0x38d80d=_0x44c607;_0x1a01c2=0xc8;}else{_0x1a01c2=0xce;}_0x49f6a2[_0xca0a('0x22')](_0x1a01c2);return _0x49f6a2[_0xca0a('0x28')](_0xca0a('0x29'),_0x5dcd71+'-'+_0x38d80d+'/'+_0x44c607)[_0xca0a('0x24')](_0x995cb6);}return null;};}function saveUpdates(_0x3c3c27){return function(_0x324653){if(_0x324653){return _0x324653[_0xca0a('0x2a')](_0x3c3c27)['then'](function(_0x26b2a5){socket[_0xca0a('0x2b')](_0xca0a('0x2c')+_0x26b2a5['id'],{});return _0x26b2a5;});}return null;};}function removeEntity(_0x35c25e){return function(_0x2a4a69){if(_0x2a4a69){return _0x2a4a69['destroy']()['then'](function(){var _0x4aae9b=_0x2a4a69[_0xca0a('0x2d')]({'plain':!![]});if(_0x4aae9b[_0xca0a('0x2e')]===_0xca0a('0x2f'))return;var _0x494585=[{'name':_0xca0a('0x30'),'value':'user','ignore':!![]},{'name':_0xca0a('0x31'),'value':_0xca0a('0x32'),'ignore':![]},{'name':'Telephones','value':_0xca0a('0x33'),'ignore':![]}];var _0x56f169=_(_0x494585)[_0xca0a('0x34')](_0xca0a('0x35'))[_0xca0a('0x36')]('value')[_0xca0a('0x37')]();if(_[_0xca0a('0x38')](_0x56f169,_0x4aae9b['role'])){return;}var _0x4d7b02=_[_0xca0a('0x39')](_0x494585,[_0xca0a('0x37'),_0x4aae9b[_0xca0a('0x2e')]])[_0xca0a('0x3a')];return db[_0xca0a('0x3b')]['destroy']({'where':{'type':_0x4d7b02,'resourceId':_0x4aae9b['id']}})['then'](function(){return _0x2a4a69;});})['then'](function(){_0x35c25e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x253d55){return function(_0x46ad6a){if(!_0x46ad6a){_0x253d55[_0xca0a('0x21')](0x194);}return _0x46ad6a;};}function handleError(_0x482cc9,_0x1b46a2){_0x1b46a2=_0x1b46a2||0x1f4;return function(_0x356da4){logger[_0xca0a('0x1d')](_0x356da4[_0xca0a('0x3c')]);if(_0x356da4[_0xca0a('0x3a')]){delete _0x356da4[_0xca0a('0x3a')];}_0x482cc9[_0xca0a('0x22')](_0x1b46a2)[_0xca0a('0x3d')](_0x356da4);};}exports['index']=function(_0x14b8ee,_0x186499){var _0x5611f8={},_0x123e2d={'count':0x0,'rows':[]};var _0x5261ab=_(db['User']['rawAttributes'])[_0xca0a('0x36')](function(_0x19d177){return{'name':_0x19d177[_0xca0a('0x3e')],'type':_0x19d177['type'][_0xca0a('0x3f')]};})['filter'](function(_0x43247b){return!_[_0xca0a('0x38')]([_0xca0a('0x40'),_0xca0a('0x41')],_0x43247b['name']);})['value']();_0x5611f8=qs[_0xca0a('0x42')](_0x5261ab,_0x14b8ee);var _0x2979a4={'where':_0x5611f8[_0xca0a('0x43')]};return db[_0xca0a('0x44')][_0xca0a('0x45')](_0x2979a4)[_0xca0a('0x17')](function(_0x442e64){_0x123e2d[_0xca0a('0x45')]=_0x442e64;if(_0x14b8ee[_0xca0a('0x46')][_0xca0a('0x47')]){_0x5611f8['include']=[{'all':!![]}];}if(_0x14b8ee[_0xca0a('0x46')][_0xca0a('0x48')]==='true'){_0x5611f8[_0xca0a('0x49')]=[{'model':db[_0xca0a('0x4a')],'as':'userSetting'}];}if(!_[_0xca0a('0x38')](_0x5611f8[_0xca0a('0x4b')],'id')){_0x5611f8[_0xca0a('0x4b')]['push']('id');}return db[_0xca0a('0x44')]['findAll'](_0x5611f8);})[_0xca0a('0x17')](function(_0x4737ac){_0x123e2d[_0xca0a('0x4c')]=_0x4737ac;if(_0x14b8ee['query']['openTabs']===_0xca0a('0x4d')){var _0x169fbd=[];for(var _0x28bdec=0x0;_0x28bdec<_0x123e2d[_0xca0a('0x4c')][_0xca0a('0x4e')];_0x28bdec++){_0x169fbd[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x50'),_0x123e2d[_0xca0a('0x4c')][_0x28bdec]['dataValues']));_0x169fbd[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x51'),_0x123e2d[_0xca0a('0x4c')][_0x28bdec][_0xca0a('0x52')]));_0x169fbd[_0xca0a('0x4f')](get_open_tabs('fax',_0x123e2d[_0xca0a('0x4c')][_0x28bdec][_0xca0a('0x52')]));_0x169fbd[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x53'),_0x123e2d[_0xca0a('0x4c')][_0x28bdec]['dataValues']));_0x169fbd[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x54'),_0x123e2d[_0xca0a('0x4c')][_0x28bdec][_0xca0a('0x52')]));_0x169fbd[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x55'),_0x123e2d['rows'][_0x28bdec][_0xca0a('0x52')]));}return Promise['all'](_0x169fbd)[_0xca0a('0x17')](function(){return _0x123e2d;});}else{return _0x123e2d;}})[_0xca0a('0x17')](respondWithFilteredResult(_0x186499,_0x5611f8))[_0xca0a('0x56')](handleError(_0x186499,null));};exports[_0xca0a('0x57')]=function(_0x50bd81,_0xcfceeb){var _0x341118={'raw':![],'where':{'id':_0x50bd81['params']['id']}},_0xa0cc49={};_0xa0cc49['model']=_[_0xca0a('0x58')](_[_0xca0a('0x59')](db[_0xca0a('0x44')][_0xca0a('0x5a')]),[_0xca0a('0x40'),'salt']);_0xa0cc49[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x50bd81[_0xca0a('0x46')]);_0xa0cc49[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0xa0cc49[_0xca0a('0x5d')],_0xa0cc49[_0xca0a('0x46')]);_0x341118[_0xca0a('0x4b')]=_['intersection'](_0xa0cc49['model'],qs[_0xca0a('0x5e')](_0x50bd81[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x341118['attributes']=_0x341118[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x341118['attributes']:_0xa0cc49[_0xca0a('0x5d')];if(_0x50bd81[_0xca0a('0x46')][_0xca0a('0x47')]){_0x341118[_0xca0a('0x49')]=[{'all':!![]}];}if(_0x50bd81[_0xca0a('0x46')][_0xca0a('0x48')]===_0xca0a('0x4d')){_0x341118[_0xca0a('0x49')]=[{'model':db[_0xca0a('0x4a')],'as':'userSetting'}];}_0x341118=_[_0xca0a('0x5f')]({},_0x341118,_0x50bd81[_0xca0a('0x60')]);if(!_[_0xca0a('0x38')](_0x341118[_0xca0a('0x4b')],'id')){_0x341118[_0xca0a('0x4b')][_0xca0a('0x4f')]('id');}return db['User'][_0xca0a('0x39')](_0x341118)['then'](handleEntityNotFound(_0xcfceeb,null))[_0xca0a('0x17')](function(_0x752251){var _0x315ddb=[];values=_0x752251;if(_0x50bd81['query'][_0xca0a('0x61')]==='true'){_0x315ddb['push'](get_open_tabs(_0xca0a('0x50'),_0x752251[_0xca0a('0x52')]));_0x315ddb[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x51'),_0x752251[_0xca0a('0x52')]));_0x315ddb[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x54'),_0x752251[_0xca0a('0x52')]));_0x315ddb[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x55'),_0x752251[_0xca0a('0x52')]));_0x315ddb['push'](get_open_tabs(_0xca0a('0x62'),_0x752251['dataValues']));_0x315ddb['push'](get_open_tabs('mail',_0x752251[_0xca0a('0x52')]));return Promise['all'](_0x315ddb);}else{return values;}})[_0xca0a('0x17')](function(){return values;})['then'](respondWithResult(_0xcfceeb,null))[_0xca0a('0x56')](handleError(_0xcfceeb,null));};exports[_0xca0a('0x2a')]=function(_0x47879e,_0x42e6ae){if(_0x47879e['body']['id']){delete _0x47879e[_0xca0a('0x63')]['id'];}delete _0x47879e[_0xca0a('0x63')][_0xca0a('0x2e')];return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0x47879e[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x42e6ae,null))[_0xca0a('0x17')](saveUpdates(_0x47879e['body'],null))[_0xca0a('0x17')](respondWithResult(_0x42e6ae,null))[_0xca0a('0x56')](handleError(_0x42e6ae,null));};exports[_0xca0a('0x65')]=function(_0x25ffd0,_0x46caba){return db[_0xca0a('0x44')][_0xca0a('0x65')]()[_0xca0a('0x17')](respondWithResult(_0x46caba,null))[_0xca0a('0x56')](handleError(_0x46caba,null));};exports[_0xca0a('0x66')]=function(_0x4a7d12,_0x5317d3){return db['User'][_0xca0a('0x39')]({'where':{'id':_0x4a7d12['params']['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x5317d3,null))[_0xca0a('0x17')](function(_0x150963){if(_0x150963){return _0x150963[_0xca0a('0x66')](_0x4a7d12['body']['ids'],_[_0xca0a('0x67')](_0x4a7d12[_0xca0a('0x63')],[_0xca0a('0x68'),'id'])||{});}})[_0xca0a('0x17')](respondWithResult(_0x5317d3,null))[_0xca0a('0x56')](handleError(_0x5317d3,null));};function validateUser(_0x41d2ef){return new Promise(function(_0x12d516,_0x3376ea){if(_0x41d2ef[_0xca0a('0x69')])return _0x12d516(_0x41d2ef);return db[_0xca0a('0x6a')][_0xca0a('0x6b')](0x1)[_0xca0a('0x17')](function(_0x3dd68c){if(_0x3dd68c['securePassword'])authService[_0xca0a('0x6c')](_0x41d2ef[_0xca0a('0x40')]);db['User'][_0xca0a('0x6d')](_0xca0a('0x69'))[_0xca0a('0x17')](function(_0x2177ae){if(_[_0xca0a('0x6e')](_0x2177ae)){_0x41d2ef[_0xca0a('0x69')]=_0x3dd68c['min_internal']||0x1;return;}if(_['isNil'](_0x3dd68c[_0xca0a('0x6f')])||_0x3dd68c['min_internal']===_0x2177ae){_0x41d2ef[_0xca0a('0x69')]=_0x2177ae+0x1;return;}if(_0x3dd68c['min_internal']>_0x2177ae){_0x41d2ef[_0xca0a('0x69')]=_0x3dd68c[_0xca0a('0x6f')];return;}return db[_0xca0a('0x70')][_0xca0a('0x46')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0xca0a('0x71')][_0xca0a('0x72')]})[_0xca0a('0x17')](function(_0x3abd1f){if(_0x3abd1f&&_0x3abd1f[_0xca0a('0x4e')]){for(var _0x1fbafc=0x0,_0x426831=_0x3abd1f['length'];_0x1fbafc<_0x426831&&_['isNil'](_0x41d2ef['internal']);_0x1fbafc++){if(_0x3dd68c['min_internal']<=_0x3abd1f[_0x1fbafc][_0xca0a('0x73')]){_0x41d2ef[_0xca0a('0x69')]=_0x3abd1f[_0x1fbafc]['from'];}else if(_0x3dd68c['min_internal']>_0x3abd1f[_0x1fbafc][_0xca0a('0x73')]&&_0x3dd68c[_0xca0a('0x6f')]<=_0x3abd1f[_0x1fbafc]['to']){_0x41d2ef['internal']=_0x3dd68c[_0xca0a('0x6f')];}}}if(_['isNil'](_0x41d2ef[_0xca0a('0x69')])){_0x41d2ef[_0xca0a('0x69')]=_0x2177ae+0x1;}return _0x12d516(_0x41d2ef);});});})[_0xca0a('0x56')](function(_0x10dece){_0x3376ea(_0x10dece);});});}function updateUser(_0x1c7261){return new Promise(function(_0x4d3d4a,_0x40577f){try{if(_0x1c7261[_0xca0a('0x74')]){_0x1c7261[_0xca0a('0x75')]=_0x1c7261[_0xca0a('0x69')];_0x1c7261['VoiceMail']={'mailbox':_0x1c7261[_0xca0a('0x69')],'password':_0x1c7261[_0xca0a('0x40')],'fullname':_0x1c7261[_0xca0a('0x76')],'email':_0x1c7261[_0xca0a('0x77')]};}if(_0x1c7261[_0xca0a('0x2e')]===_0xca0a('0x32')){if(!_0x1c7261[_0xca0a('0x78')])_0x1c7261[_0xca0a('0x78')]=[_0xca0a('0x79'),_0xca0a('0x7a'),_0xca0a('0x7b'),_0xca0a('0x7c'),_0xca0a('0x7d'),_0xca0a('0x7e'),_0xca0a('0x7f'),_0xca0a('0x80'),_0xca0a('0x81'),_0xca0a('0x82'),_0xca0a('0x83'),_0xca0a('0x84'),'111','114',_0xca0a('0x85')];}_0x4d3d4a(_0x1c7261);}catch(_0x530f72){_0x40577f(_0x530f72);}});}exports[_0xca0a('0x86')]=function(_0x3e2d4d,_0x1c1e9f){if(_0x3e2d4d[_0xca0a('0x87')][_0xca0a('0x2e')]==='agent')throw new Error(_0xca0a('0x88'));if(_0x3e2d4d['body'][_0xca0a('0x2e')]===_0xca0a('0x87')&&_0x3e2d4d['user'][_0xca0a('0x2e')]!==_0xca0a('0x2f')){throw new Error(_0xca0a('0x89'));}if(_0x3e2d4d[_0xca0a('0x63')][_0xca0a('0x2e')]===_0xca0a('0x2f')&&_0x3e2d4d[_0xca0a('0x87')][_0xca0a('0x2e')]!==_0xca0a('0x2f')){throw new Error(_0xca0a('0x8a'));}return licenseUtil[_0xca0a('0x8b')]([_0x3e2d4d[_0xca0a('0x63')]])[_0xca0a('0x17')](function(){return validateUser(_0x3e2d4d['body']);})['then'](function(_0x530249){return updateUser(_0x530249)['then'](function(_0x5dfc3c){if(_0x5dfc3c[_0xca0a('0x2e')]===_0xca0a('0x2f')){_0x5dfc3c[_0xca0a('0x8c')]=_0x3e2d4d['user'][_0xca0a('0x8c')];delete _0x5dfc3c[_0xca0a('0x8d')];}return _0x5dfc3c;});})[_0xca0a('0x17')](function(_0x3ff8be){return db['User'][_0xca0a('0x86')](_0x3ff8be,{'include':[{'model':db['VoiceMail'],'as':_0xca0a('0x8e')}]});})[_0xca0a('0x17')](function(_0x4c97a0){if(_0x3e2d4d['body'][_0xca0a('0x2e')]==='user')return _0x4c97a0;if(_0x3e2d4d[_0xca0a('0x87')][_0xca0a('0x2e')]!==_0xca0a('0x87'))return _0x4c97a0;return db[_0xca0a('0x8f')]['find']({'where':{'name':_0x4c97a0['role']===_0xca0a('0x32')?'Agents':_0xca0a('0x90'),'userProfileId':_0x3e2d4d['user'][_0xca0a('0x8d')]},'raw':!![]})[_0xca0a('0x17')](function(_0x259c53){if(!_0x259c53||_0x259c53[_0xca0a('0x91')]!=0x0)return _0x4c97a0;return db[_0xca0a('0x3b')][_0xca0a('0x86')]({'name':_0x4c97a0['name'],'resourceId':_0x4c97a0['id'],'type':_0x259c53[_0xca0a('0x3a')],'sectionId':_0x259c53['id']},{})['then'](function(){return _0x4c97a0;});})['catch'](function(_0x44717f){logger[_0xca0a('0x1d')](_0xca0a('0x92'),_0x44717f);throw _0x44717f;});})[_0xca0a('0x17')](respondWithResult(_0x1c1e9f,0xc9))['catch'](handleError(_0x1c1e9f,null));};exports[_0xca0a('0x93')]=function(_0x5a0e44,_0x4f17e1){var _0x4fed15=_0x5a0e44[_0xca0a('0x63')];var _0x3606b0=[];if(_0x5a0e44[_0xca0a('0x87')][_0xca0a('0x2e')]==='agent')throw new Error(_0xca0a('0x88'));if(_[_0xca0a('0x94')](_0x4fed15,[_0xca0a('0x2e'),_0xca0a('0x87')])&&_0x5a0e44[_0xca0a('0x87')][_0xca0a('0x2e')]!==_0xca0a('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x4fed15,[_0xca0a('0x2e'),'admin'])&&_0x5a0e44[_0xca0a('0x87')][_0xca0a('0x2e')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xca0a('0x8b')](_0x4fed15)[_0xca0a('0x17')](function(){return validateUser(_0x4fed15[0x0]);})[_0xca0a('0x17')](function(){for(var _0x435977=0x1;_0x435977<_0x4fed15[_0xca0a('0x4e')];_0x435977++){var _0x5c34f1=_0x4fed15[_0x435977-0x1][_0xca0a('0x69')];if(!_0x4fed15[_0x435977][_0xca0a('0x69')])_0x4fed15[_0x435977][_0xca0a('0x69')]=_0x5c34f1+0x1;_0x3606b0[_0xca0a('0x4f')](validateUser(_0x4fed15[_0x435977]));}return Promise[_0xca0a('0x95')](_0x3606b0);})[_0xca0a('0x17')](function(){_0x3606b0=[];for(var _0x511d76=0x0;_0x511d76<_0x4fed15[_0xca0a('0x4e')];_0x511d76++){_0x3606b0[_0xca0a('0x4f')](updateUser(_0x4fed15[_0x511d76]));}return Promise[_0xca0a('0x95')](_0x3606b0);})[_0xca0a('0x17')](function(){_0x3606b0=_0x4fed15[_0xca0a('0x36')](function(_0x191ffc){return db['User']['create'](_0x191ffc,{'include':[{'model':db[_0xca0a('0x8e')],'as':_0xca0a('0x8e')}]})[_0xca0a('0x17')](function(_0x266824){_0x191ffc['id']=_0x266824['id'];return _0x191ffc;});});return Promise[_0xca0a('0x95')](_0x3606b0);})['then'](function(_0x58928e){if(_0x5a0e44[_0xca0a('0x63')][_0xca0a('0x2e')]===_0xca0a('0x87'))return _0x58928e;if(_0x5a0e44[_0xca0a('0x87')][_0xca0a('0x2e')]!==_0xca0a('0x87'))return _0x58928e;var _0x2e4ba6=_[_0xca0a('0x94')](_0x58928e,function(_0x274ce6){return _0x274ce6[_0xca0a('0x2e')]===_0xca0a('0x32')||_0x274ce6[_0xca0a('0x2e')]===_0xca0a('0x33');});if(!_0x2e4ba6)return _0x58928e;return db[_0xca0a('0x8f')]['findAll']({'where':{'name':{'$or':[_0xca0a('0x31'),'Telephones']},'userProfileId':_0x5a0e44['user']['userProfileId']},'raw':!![]})[_0xca0a('0x17')](function(_0x3de2a5){if(_['isEmpty'](_0x3de2a5)||!_[_0xca0a('0x94')](_0x3de2a5,[_0xca0a('0x91'),0x0]))return _0x58928e;_0x3606b0=[];var _0x3c0fbd=_(_0x3de2a5)[_0xca0a('0x36')](function(_0x51677e){if(_0x51677e[_0xca0a('0x91')]===0x1)return;return _0x51677e[_0xca0a('0x3a')]===_0xca0a('0x31')?'agent':'telephone';})[_0xca0a('0x96')]()['value']();for(var _0x15da2c=0x0;_0x15da2c<_0x58928e[_0xca0a('0x4e')];_0x15da2c++){if(!_[_0xca0a('0x38')](_0x3c0fbd,_0x58928e[_0x15da2c]['role']))return;var _0x375cc3=_0x58928e[_0x15da2c][_0xca0a('0x2e')]===_0xca0a('0x32')?'Agents':_0xca0a('0x90');_0x3606b0[_0xca0a('0x4f')](db[_0xca0a('0x3b')]['create']({'name':_0x58928e[_0x15da2c][_0xca0a('0x3a')],'resourceId':_0x58928e[_0x15da2c]['id'],'type':_0x375cc3,'sectionId':_[_0xca0a('0x39')](_0x3de2a5,[_0xca0a('0x3a'),_0x375cc3])['id']},{}));}return Promise[_0xca0a('0x95')](_0x3606b0);});})[_0xca0a('0x17')](respondWithResult(_0x4f17e1,0xc9))[_0xca0a('0x56')](handleError(_0x4f17e1,null));};exports['changePassword']=function(_0x4ffedb,_0x51415b){if(_0x4ffedb[_0xca0a('0x63')]['id']){delete _0x4ffedb[_0xca0a('0x63')]['id'];}return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0x4ffedb[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](function(_0x45f207){if(!_0x45f207)return null;if(_0x45f207['id']===_0x4ffedb[_0xca0a('0x87')]['id']){if(!_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x97')]||!_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x98')]){throw new db[(_0xca0a('0x99'))][(_0xca0a('0x9a'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x45f207[_0xca0a('0x9b')](_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x97')])){throw new db['Sequelize'][(_0xca0a('0x9a'))](_0xca0a('0x9c'));}if(_0x4ffedb['body'][_0xca0a('0x97')]===_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x98')]){throw new db[(_0xca0a('0x99'))][(_0xca0a('0x9a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x4ffedb[_0xca0a('0x87')]['role']==='admin'){if(!_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x98')]){throw new db['Sequelize']['ValidationError'](_0xca0a('0x9d'));}}else if(_0x4ffedb[_0xca0a('0x87')][_0xca0a('0x2e')]===_0xca0a('0x87')){if(!_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x98')]){throw new db['Sequelize'][(_0xca0a('0x9a'))](_0xca0a('0x9d'));}if(_0x45f207['role']!=='agent'){throw new db[(_0xca0a('0x99'))][(_0xca0a('0x9a'))](_0xca0a('0x88'));}}else{throw new db['Sequelize'][(_0xca0a('0x9a'))](_0xca0a('0x88'));}return _0x45f207;})['then'](handleEntityNotFound(_0x51415b,null))[_0xca0a('0x17')](function(_0x136771){return db['Setting'][_0xca0a('0x9e')]({'attributes':['id',_0xca0a('0x9f'),_0xca0a('0xa0'),_0xca0a('0xa1')]})[_0xca0a('0x17')](function(_0x2c18e5){if(_0x2c18e5[_0xca0a('0x9f')])authService[_0xca0a('0x6c')](_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x98')]);if(!_0x2c18e5[_0xca0a('0xa0')]||!_0x136771[_0xca0a('0xa2')])return _0x136771;authService[_0xca0a('0xa3')](_0x4ffedb['body'][_0xca0a('0x98')],_0x136771[_0xca0a('0xa2')],_0x2c18e5['passwordHistoryLimit']);return _0x136771;})[_0xca0a('0x17')](saveUpdates({'password':_0x4ffedb[_0xca0a('0x63')][_0xca0a('0x98')],'passwordResetAt':_0x4ffedb['user']['id']==_0x4ffedb[_0xca0a('0x64')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4ffedb[_0xca0a('0x63')]['newPassword'],_0x136771[_0xca0a('0xa2')])},null));})[_0xca0a('0x17')](respondWithResult(_0x51415b,null))[_0xca0a('0x56')](handleError(_0x51415b,null));};exports['addQueues']=function(_0x165986,_0x519377){var _0x285134=_0x165986[_0xca0a('0x63')][_0xca0a('0xa4')];return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0x165986[_0xca0a('0x64')]['id']},'attributes':['id',_0xca0a('0x3a'),_0xca0a('0x2e'),_0xca0a('0xa5'),_0xca0a('0xa6'),_0xca0a('0xa7'),_0xca0a('0xa8')]})[_0xca0a('0x17')](handleEntityNotFound(_0x519377,null))[_0xca0a('0x17')](function(_0x2e03d9){if(_0x2e03d9){if(!utils[_0xca0a('0xa9')](_0x285134)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x2e03d9['add'+_[_0xca0a('0xaa')](_0x285134[_0xca0a('0xab')]())+_0xca0a('0xac')](_0x165986[_0xca0a('0x63')][_0xca0a('0x68')],{'penalty':_0x165986[_0xca0a('0x63')][_0xca0a('0xad')]||0x0})[_0xca0a('0xae')](function(_0x1e413a){for(var _0x44e956=0x0;_0x44e956<_0x165986[_0xca0a('0x63')][_0xca0a('0x68')][_0xca0a('0x4e')];_0x44e956+=0x1){var _0x2134b0={'UserId':Number(_0x165986['params']['id'])};_0x2134b0[_[_0xca0a('0xaa')](_0x285134[_0xca0a('0xab')]())+_0xca0a('0xaf')]=Number(_0x165986[_0xca0a('0x63')][_0xca0a('0x68')][_0x44e956]);socket[_0xca0a('0x2b')](_0xca0a('0x87')+_['capitalize'](_0x285134[_0xca0a('0xab')]())+'Queue:save',_0x2134b0);}return _0x1e413a;})[_0xca0a('0x17')](function(){if(_0x285134==='voice'){return db[_0xca0a('0xb0')][_0xca0a('0xb1')]({'where':{'id':_0x165986['body'][_0xca0a('0x68')]||[]},'raw':!![],'attributes':['id',_0xca0a('0x3a')]});}})[_0xca0a('0x17')](function(_0x571e09){var _0x507abe=_0x2e03d9[_0xca0a('0x2d')]({'plain':!![]});var _0x1e2423=[];if(_0x285134===_0xca0a('0xb2')&&_0x507abe[_0xca0a('0x2e')]===_0xca0a('0x32')&&_0x507abe[_0xca0a('0xa5')]){for(let _0x2bd744=0x0;_0x2bd744<_0x571e09[_0xca0a('0x4e')];_0x2bd744+=0x1){_0x1e2423[_0xca0a('0x4f')]({'membername':_0x507abe[_0xca0a('0x3a')],'UserId':_0x507abe['id'],'queue_name':_0x571e09[_0x2bd744]['name'],'VoiceQueueId':_0x571e09[_0x2bd744]['id'],'interface':_[_0xca0a('0x6e')](_0x507abe[_0xca0a('0xa8')])?util[_0xca0a('0xb3')](_0xca0a('0xb4'),_0x507abe[_0xca0a('0x3a')]):_0x507abe[_0xca0a('0xa8')],'paused':_0x507abe[_0xca0a('0xa7')]||![],'penalty':_0x165986[_0xca0a('0x63')]['penalty']||0x0});}return Promise['all'](_0x1e2423[_0xca0a('0x36')](function(_0x6aad43){return db[_0xca0a('0xb5')]['upsert'](_0x6aad43);}));}return _0x2e03d9;});}})[_0xca0a('0x17')](respondWithStatusCode(_0x519377,null))[_0xca0a('0x56')](handleError(_0x519377,null));};exports[_0xca0a('0xb6')]=function(_0x2f355e,_0x141fed){var _0x5e4373,_0x10e552;return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0x2f355e['params']['id']},'attributes':['id',_0xca0a('0x3a'),_0xca0a('0x2e')]})[_0xca0a('0x17')](handleEntityNotFound(_0x141fed,null))[_0xca0a('0x17')](function(_0x4674da){if(_0x4674da){_0x5e4373=_0x4674da;if(!_0x2f355e[_0xca0a('0x46')][_0xca0a('0xa4')]||!utils[_0xca0a('0xa9')](_0x2f355e[_0xca0a('0x46')][_0xca0a('0xa4')])){throw new db[(_0xca0a('0x99'))][(_0xca0a('0x9a'))]('Unknown\x20channel');}return _0x4674da[_0xca0a('0xb7')+_[_0xca0a('0xaa')](_0x2f355e['query'][_0xca0a('0xa4')][_0xca0a('0xab')]())+_0xca0a('0xac')](_0x2f355e[_0xca0a('0x46')][_0xca0a('0x68')]);}})[_0xca0a('0x17')](function(_0x141984){if(_['isArray'](_0x2f355e['query'][_0xca0a('0x68')])){for(var _0x5ecfc6=0x0;_0x5ecfc6<_0x2f355e[_0xca0a('0x46')]['ids'][_0xca0a('0x4e')];_0x5ecfc6+=0x1){_0x10e552={'UserId':Number(_0x2f355e[_0xca0a('0x64')]['id'])};_0x10e552[_[_0xca0a('0xaa')](_0x2f355e['query'][_0xca0a('0xa4')][_0xca0a('0xab')]())+_0xca0a('0xaf')]=Number(_0x2f355e[_0xca0a('0x46')][_0xca0a('0x68')][_0x5ecfc6]);socket[_0xca0a('0x2b')](_0xca0a('0x87')+_[_0xca0a('0xaa')](_0x2f355e[_0xca0a('0x46')][_0xca0a('0xa4')][_0xca0a('0xab')]())+_0xca0a('0xb8'),_0x10e552);}}else{_0x10e552={'UserId':Number(_0x2f355e['params']['id'])};_0x10e552[_['capitalize'](_0x2f355e['query']['channel'][_0xca0a('0xab')]())+'QueueId']=Number(_0x2f355e['query'][_0xca0a('0x68')]);socket['emit'](_0xca0a('0x87')+_[_0xca0a('0xaa')](_0x2f355e[_0xca0a('0x46')][_0xca0a('0xa4')][_0xca0a('0xab')]())+'Queue:remove',_0x10e552);}return _0x141984;})[_0xca0a('0x17')](function(){if(_0x2f355e[_0xca0a('0x46')][_0xca0a('0xa4')]===_0xca0a('0xb2')){return db[_0xca0a('0xb5')][_0xca0a('0xb9')]({'where':{'UserId':_0x2f355e[_0xca0a('0x64')]['id'],'VoiceQueueId':_0x2f355e[_0xca0a('0x46')]['ids']},'individualHooks':!![]})[_0xca0a('0x17')](function(){return _0x5e4373;});}return _0x5e4373;})[_0xca0a('0x17')](respondWithStatusCode(_0x141fed,null))[_0xca0a('0x56')](handleError(_0x141fed,null));};exports[_0xca0a('0xba')]=function(_0x6ecad1,_0x483ce0){_0x6ecad1[_0xca0a('0x63')][_0xca0a('0xbb')]=_0x6ecad1[_0xca0a('0xbc')]['filename'];return db['User'][_0xca0a('0x39')]({'where':{'id':_0x6ecad1[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x483ce0,null))[_0xca0a('0x17')](saveUpdates(_0x6ecad1[_0xca0a('0x63')],null))[_0xca0a('0x17')](respondWithResult(_0x483ce0,null))[_0xca0a('0x56')](handleError(_0x483ce0,null));};exports[_0xca0a('0xbd')]=function(_0x77bcc1,_0x1d23d0){var _0xb88980=path[_0xca0a('0xbe')](config[_0xca0a('0xbf')],_0xca0a('0xc0'));return db['User']['find']({'where':{'id':_0x77bcc1[_0xca0a('0x64')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xca0a('0x17')](handleEntityNotFound(_0x1d23d0,null))[_0xca0a('0x17')](function(_0x2d7e5f){if(_0x2d7e5f){if(_[_0xca0a('0x6e')](_0x2d7e5f[_0xca0a('0xbb')])){return _0x1d23d0['download'](_0xb88980);}else{if(!fs[_0xca0a('0xc1')](path[_0xca0a('0xbe')](config['root'],_0xca0a('0xc2'),_0x2d7e5f[_0xca0a('0xbb')]))){return _0x1d23d0[_0xca0a('0xc3')](_0xb88980);}return _0x1d23d0['download'](path[_0xca0a('0xbe')](config['root'],_0xca0a('0xc2'),_0x2d7e5f[_0xca0a('0xbb')]));}}})[_0xca0a('0x56')](handleError(_0x1d23d0,null));};exports[_0xca0a('0xc4')]=function(_0x5768a4,_0x15ab35){return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0x5768a4[_0xca0a('0x64')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x15ab35,null))[_0xca0a('0x17')](function(_0x4f8bb3){var _0x1014e1=[];values=_0x4f8bb3[_0xca0a('0x52')];_0x1014e1[_0xca0a('0x4f')](get_open_tabs('chat',_0x4f8bb3[_0xca0a('0x52')]));_0x1014e1['push'](get_open_tabs(_0xca0a('0x51'),_0x4f8bb3[_0xca0a('0x52')]));_0x1014e1[_0xca0a('0x4f')](get_open_tabs(_0xca0a('0x54'),_0x4f8bb3['dataValues']));_0x1014e1['push'](get_open_tabs('whatsapp',_0x4f8bb3[_0xca0a('0x52')]));_0x1014e1['push'](get_open_tabs(_0xca0a('0x62'),_0x4f8bb3[_0xca0a('0x52')]));_0x1014e1['push'](get_open_tabs('mail',_0x4f8bb3['dataValues']));return Promise[_0xca0a('0x95')](_0x1014e1);})['then'](function(_0x57440f){if(_0x57440f){var _0x4179bd=_[_0xca0a('0x36')](values[_0xca0a('0xc5')],function(_0x4f17f0){return{'channel':_0xca0a('0xc6'),'id':_0x4f17f0['id'],'createdAt':_0x4f17f0[_0xca0a('0xc7')]};});var _0x3072c9=_[_0xca0a('0x36')](values[_0xca0a('0xc8')],function(_0x34d158){return{'channel':'FAX','id':_0x34d158['id'],'createdAt':_0x34d158[_0xca0a('0xc7')]};});var _0x1c1b73=_[_0xca0a('0x36')](values[_0xca0a('0xc9')],function(_0x3b6d01){return{'channel':_0xca0a('0xca'),'id':_0x3b6d01['id'],'createdAt':_0x3b6d01[_0xca0a('0xc7')]};});var _0x1998e5=_[_0xca0a('0x36')](values['MailOpenTabs'],function(_0x88c5e1){return{'channel':_0xca0a('0xcb'),'id':_0x88c5e1['id'],'createdAt':_0x88c5e1[_0xca0a('0xc7')]};});var _0x39819e=_['map'](values[_0xca0a('0xcc')],function(_0x50da28){return{'channel':_0xca0a('0xcd'),'id':_0x50da28['id'],'createdAt':_0x50da28['createdAt']};});var _0x4aff21=_['map'](values['WhatsappOpenTabs'],function(_0x1f664d){return{'channel':_0xca0a('0xce'),'id':_0x1f664d['id'],'createdAt':_0x1f664d['createdAt']};});var _0x4104a2=_['concat'](_0x4179bd,_0x3072c9,_0x1c1b73,_0x1998e5,_0x39819e,_0x4aff21);var _0x312808={'count':_0x4104a2[_0xca0a('0x4e')],'rows':_0x4104a2};return _0x312808;}else return null;})[_0xca0a('0x17')](respondWithResult(_0x15ab35,null))['catch'](handleError(_0x15ab35,null));};exports[_0xca0a('0xcf')]=function(_0x169a6c,_0x4758ac){var _0x5c03a4={};var _0x2bdf8a={};var _0x3661db;var _0x4f17e;return db['User'][_0xca0a('0x9e')]({'where':{'id':_0x169a6c[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x4758ac,null))[_0xca0a('0x17')](function(_0x1c591a){if(_0x1c591a){_0x3661db=_0x1c591a;_0x2bdf8a[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db['CmContact']['rawAttributes']);_0x2bdf8a['query']=_['keys'](_0x169a6c['query']);_0x2bdf8a[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x2bdf8a[_0xca0a('0x5d')],_0x2bdf8a[_0xca0a('0x46')]);_0x5c03a4['attributes']=_[_0xca0a('0x5c')](_0x2bdf8a[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x169a6c[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x5c03a4[_0xca0a('0x4b')]=_0x5c03a4[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x5c03a4[_0xca0a('0x4b')]:_0x2bdf8a[_0xca0a('0x5d')];_0x5c03a4['order']=qs[_0xca0a('0xd0')](_0x169a6c[_0xca0a('0x46')][_0xca0a('0xd0')]);_0x5c03a4[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_[_0xca0a('0xd1')](_0x169a6c[_0xca0a('0x46')],_0x2bdf8a[_0xca0a('0x5b')]));if(_0x169a6c[_0xca0a('0x46')][_0xca0a('0x34')]){_0x5c03a4[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x5c03a4['where'],{'$or':_[_0xca0a('0x36')](_0x5c03a4[_0xca0a('0x4b')],function(_0x1fb72f){var _0x2442ce={};_0x2442ce[_0x1fb72f]={'$like':'%'+_0x169a6c[_0xca0a('0x46')]['filter']+'%'};return _0x2442ce;})});}_0x5c03a4=_[_0xca0a('0x5f')]({},_0x5c03a4,_0x169a6c[_0xca0a('0x60')]);return _0x3661db[_0xca0a('0xcf')](_0x5c03a4);}})['then'](function(_0x2baf2a){if(_0x2baf2a){_0x4f17e=_0x2baf2a[_0xca0a('0x4e')];if(_0x169a6c[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0x47'))){_0x5c03a4[_0xca0a('0x49')]=[{'model':db[_0xca0a('0xd3')],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xca0a('0xd4')],'where':_0x169a6c[_0xca0a('0x46')][_0xca0a('0xd5')]?{'id':_0x169a6c[_0xca0a('0x46')][_0xca0a('0xd5')]}:undefined,'required':_0x169a6c[_0xca0a('0x46')][_0xca0a('0xd5')]?!![]:![]}];}if(!_0x169a6c[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x5c03a4[_0xca0a('0x27')]=qs['limit'](_0x169a6c[_0xca0a('0x46')][_0xca0a('0x27')]);_0x5c03a4[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x169a6c['query'][_0xca0a('0x25')]);}return _0x3661db[_0xca0a('0xcf')](_0x5c03a4);}})[_0xca0a('0x17')](function(_0x25f6fd){if(_0x25f6fd){return _0x25f6fd?{'count':_0x4f17e,'rows':_0x25f6fd}:null;}})['then'](respondWithResult(_0x4758ac,null))['catch'](handleError(_0x4758ac,null));};exports['getQueues']=function(_0xcde406,_0x2671ce){var _0x2244bf;var _0x22d497={};var _0x5936ae;return db['User'][_0xca0a('0x9e')]({'where':{'id':_0xcde406[_0xca0a('0x64')]['id']},'attributes':['id',_0xca0a('0x3a'),_0xca0a('0x2e')]})[_0xca0a('0x17')](handleEntityNotFound(_0x2671ce,null))['then'](function(_0x9df5fe){if(!utils[_0xca0a('0xa9')](_0xcde406[_0xca0a('0x46')][_0xca0a('0xa4')])){throw new db[(_0xca0a('0x99'))][(_0xca0a('0x9a'))](_0xca0a('0xd7'));}_0x2244bf=_0x9df5fe;var _0x22798c={};_0x22798c['model']=_[_0xca0a('0x59')](db[_[_0xca0a('0xaa')](_0xcde406[_0xca0a('0x46')][_0xca0a('0xa4')])+_0xca0a('0xd8')][_0xca0a('0x5a')]);_0x22798c[_0xca0a('0x46')]=_['keys'](_0xcde406[_0xca0a('0x46')]);_0x22798c[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x22798c[_0xca0a('0x5d')],_0x22798c[_0xca0a('0x46')]);_0x22d497[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x22798c[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0xcde406['query']['fields']));_0x22d497[_0xca0a('0x4b')]=_0x22d497['attributes'][_0xca0a('0x4e')]?_0x22d497[_0xca0a('0x4b')]:_0x22798c[_0xca0a('0x5d')];_0x22d497['order']=qs['sort'](_0xcde406[_0xca0a('0x46')][_0xca0a('0xd0')]);_0x22d497[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_['pick'](_0xcde406['query'],_0x22798c['filters']));if(_0xcde406[_0xca0a('0x46')][_0xca0a('0x34')]){_0x22d497[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x22d497[_0xca0a('0x43')],{'$or':_['map'](_0x22d497[_0xca0a('0x4b')],function(_0x59207f){var _0x3fbf44={};_0x3fbf44[_0x59207f]={'$like':'%'+_0xcde406[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x3fbf44;})});}_0x22d497=_[_0xca0a('0x5f')]({},_0x22d497,_0xcde406[_0xca0a('0x60')]);switch(_0x2244bf['role']){case _0xca0a('0x2f'):return db[_[_0xca0a('0xaa')](_0xcde406[_0xca0a('0x46')][_0xca0a('0xa4')])+_0xca0a('0xd8')][_0xca0a('0xb1')](_0x22d497);case _0xca0a('0x87'):case'agent':return _0x2244bf[_0xca0a('0x2d')+_[_0xca0a('0xaa')](_0xcde406[_0xca0a('0x46')][_0xca0a('0xa4')])+_0xca0a('0xac')](_0x22d497);default:throw new db[(_0xca0a('0x99'))][(_0xca0a('0x9a'))](_0xca0a('0xd9'));}})[_0xca0a('0x17')](function(_0x11b366){_0x5936ae=_0x11b366[_0xca0a('0x4e')];if(!_0xcde406[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x22d497['limit']=qs['limit'](_0xcde406['query']['limit']);_0x22d497['offset']=qs[_0xca0a('0x25')](_0xcde406[_0xca0a('0x46')][_0xca0a('0x25')]);}switch(_0x2244bf[_0xca0a('0x2e')]){case _0xca0a('0x2f'):return db[_['capitalize'](_0xcde406[_0xca0a('0x46')][_0xca0a('0xa4')])+'Queue'][_0xca0a('0xb1')](_0x22d497);case _0xca0a('0x87'):case _0xca0a('0x32'):return _0x2244bf[_0xca0a('0x2d')+_[_0xca0a('0xaa')](_0xcde406['query'][_0xca0a('0xa4')])+_0xca0a('0xac')](_0x22d497);}})['then'](function(_0xaf5dde){return{'count':_0x5936ae,'rows':_0xaf5dde};})[_0xca0a('0x17')](respondWithResult(_0x2671ce,null))[_0xca0a('0x56')](handleError(_0x2671ce,null));};exports[_0xca0a('0xda')]=function(_0xcd0b37,_0x1db14f){var _0x46c2b4={};var _0x394099={};var _0x1a8336;var _0x216925;return db[_0xca0a('0x44')]['findOne']({'where':{'id':_0xcd0b37[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x1db14f,null))[_0xca0a('0x17')](function(_0x4db5f8){if(_0x4db5f8){_0x1a8336=_0x4db5f8;_0x394099[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db[_0xca0a('0xb5')][_0xca0a('0x5a')]);_0x394099[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0xcd0b37[_0xca0a('0x46')]);_0x394099[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x394099[_0xca0a('0x5d')],_0x394099['query']);_0x46c2b4['attributes']=_[_0xca0a('0x5c')](_0x394099[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0xcd0b37['query'][_0xca0a('0x5e')]));_0x46c2b4[_0xca0a('0x4b')]=_0x46c2b4[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x46c2b4[_0xca0a('0x4b')]:_0x394099[_0xca0a('0x5d')];_0x46c2b4[_0xca0a('0xdb')]=qs[_0xca0a('0xd0')](_0xcd0b37[_0xca0a('0x46')]['sort']);_0x46c2b4[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_['pick'](_0xcd0b37[_0xca0a('0x46')],_0x394099['filters']));if(_0xcd0b37[_0xca0a('0x46')]['filter']){_0x46c2b4[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x46c2b4[_0xca0a('0x43')],{'$or':_['map'](_0x46c2b4[_0xca0a('0x4b')],function(_0x1e41cd){var _0x351739={};_0x351739[_0x1e41cd]={'$like':'%'+_0xcd0b37[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x351739;})});}_0x46c2b4=_['merge']({},_0x46c2b4,_0xcd0b37['options']);return _0x1a8336[_0xca0a('0xda')](_0x46c2b4);}})['then'](function(_0x442413){if(_0x442413){_0x216925=_0x442413[_0xca0a('0x4e')];if(!_0xcd0b37[_0xca0a('0x46')][_0xca0a('0xd2')]('nolimit')){_0x46c2b4['limit']=qs[_0xca0a('0x27')](_0xcd0b37[_0xca0a('0x46')][_0xca0a('0x27')]);_0x46c2b4[_0xca0a('0x25')]=qs['offset'](_0xcd0b37[_0xca0a('0x46')][_0xca0a('0x25')]);}return _0x1a8336[_0xca0a('0xda')](_0x46c2b4);}})['then'](function(_0x3504f7){if(_0x3504f7){return _0x3504f7?{'count':_0x216925,'rows':_0x3504f7}:null;}})[_0xca0a('0x17')](respondWithResult(_0x1db14f,null))[_0xca0a('0x56')](handleError(_0x1db14f,null));};exports[_0xca0a('0xdc')]=function(_0x1c3d77,_0x447eb2){var _0x47ebc8={};var _0x1a3418={};var _0x4ed0af;var _0xad9094;return db[_0xca0a('0x44')][_0xca0a('0x9e')]({'where':{'id':_0x1c3d77[_0xca0a('0x64')]['id']}})['then'](handleEntityNotFound(_0x447eb2,null))[_0xca0a('0x17')](function(_0x5341ba){if(_0x5341ba){_0x4ed0af=_0x5341ba;_0x1a3418['model']=_[_0xca0a('0x59')](db[_0xca0a('0xdd')][_0xca0a('0x5a')]);_0x1a3418['query']=_['keys'](_0x1c3d77[_0xca0a('0x46')]);_0x1a3418[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x1a3418[_0xca0a('0x5d')],_0x1a3418[_0xca0a('0x46')]);_0x47ebc8[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x1a3418['model'],qs['fields'](_0x1c3d77[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x47ebc8[_0xca0a('0x4b')]=_0x47ebc8[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x47ebc8['attributes']:_0x1a3418[_0xca0a('0x5d')];_0x47ebc8[_0xca0a('0xdb')]=qs[_0xca0a('0xd0')](_0x1c3d77['query']['sort']);_0x47ebc8['where']=qs[_0xca0a('0x5b')](_[_0xca0a('0xd1')](_0x1c3d77[_0xca0a('0x46')],_0x1a3418[_0xca0a('0x5b')]));if(_0x1c3d77[_0xca0a('0x46')][_0xca0a('0x34')]){_0x47ebc8[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x47ebc8['where'],{'$or':_[_0xca0a('0x36')](_0x47ebc8[_0xca0a('0x4b')],function(_0x31f644){var _0x39f1d9={};_0x39f1d9[_0x31f644]={'$like':'%'+_0x1c3d77[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x39f1d9;})});}_0x47ebc8=_['merge']({},_0x47ebc8,_0x1c3d77[_0xca0a('0x60')]);return _0x4ed0af[_0xca0a('0xdc')](_0x47ebc8);}})[_0xca0a('0x17')](function(_0x1efc08){if(_0x1efc08){_0xad9094=_0x1efc08[_0xca0a('0x4e')];if(!_0x1c3d77[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x47ebc8[_0xca0a('0x27')]=qs[_0xca0a('0x27')](_0x1c3d77[_0xca0a('0x46')][_0xca0a('0x27')]);_0x47ebc8[_0xca0a('0x25')]=qs['offset'](_0x1c3d77[_0xca0a('0x46')][_0xca0a('0x25')]);}return _0x4ed0af[_0xca0a('0xdc')](_0x47ebc8);}})[_0xca0a('0x17')](function(_0x50d83a){if(_0x50d83a){return _0x50d83a?{'count':_0xad9094,'rows':_0x50d83a}:null;}})[_0xca0a('0x17')](respondWithResult(_0x447eb2,null))[_0xca0a('0x56')](handleError(_0x447eb2,null));};exports[_0xca0a('0xde')]=function(_0x447e3d,_0x1b9ed1){var _0x50efc9={'raw':!![],'where':{}};var _0xcb2aae={};var _0x29a27d={'count':0x0,'rows':[]};return db[_0xca0a('0x44')]['findOne']({'where':{'id':_0x447e3d[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x1b9ed1,null))[_0xca0a('0x17')](function(_0x205a1b){if(_0x205a1b){_0xcb2aae['model']=_[_0xca0a('0x59')](db[_0xca0a('0xdf')][_0xca0a('0x5a')]);_0xcb2aae[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x447e3d[_0xca0a('0x46')]);_0xcb2aae['filters']=_[_0xca0a('0x5c')](_0xcb2aae['model'],_0xcb2aae['query']);_0x50efc9[_0xca0a('0x4b')]=_['intersection'](_0xcb2aae[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x447e3d[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x50efc9[_0xca0a('0x4b')]=_0x50efc9[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x50efc9[_0xca0a('0x4b')]:_0xcb2aae[_0xca0a('0x5d')];if(!_0x447e3d[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x50efc9[_0xca0a('0x27')]=qs['limit'](_0x447e3d[_0xca0a('0x46')][_0xca0a('0x27')]);_0x50efc9[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x447e3d['query'][_0xca0a('0x25')]);}_0x50efc9[_0xca0a('0xdb')]=qs['sort'](_0x447e3d[_0xca0a('0x46')]['sort']);_0x50efc9[_0xca0a('0x43')]=qs['filters'](_[_0xca0a('0xd1')](_0x447e3d[_0xca0a('0x46')],_0xcb2aae['filters']));_0x50efc9[_0xca0a('0x43')]['UserId']=_0x205a1b['id'];if(_0x447e3d[_0xca0a('0x46')][_0xca0a('0x34')]){_0x50efc9[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x50efc9['where'],{'$or':_[_0xca0a('0x36')](_0x50efc9[_0xca0a('0x4b')],function(_0x56a648){var _0x5a29c1={};_0x5a29c1[_0x56a648]={'$like':'%'+_0x447e3d[_0xca0a('0x46')]['filter']+'%'};return _0x5a29c1;})});}_0x50efc9=_[_0xca0a('0x5f')]({},_0x50efc9,_0x447e3d[_0xca0a('0x60')]);return db[_0xca0a('0xdf')][_0xca0a('0x45')]({'where':_0x50efc9[_0xca0a('0x43')]})[_0xca0a('0x17')](function(_0x47c34f){_0x29a27d['count']=_0x47c34f;if(_0x447e3d[_0xca0a('0x46')][_0xca0a('0x47')]){_0x50efc9[_0xca0a('0x49')]=[{'all':!![]}];}return db[_0xca0a('0xdf')][_0xca0a('0xb1')](_0x50efc9);})['then'](function(_0x51d5b6){_0x29a27d[_0xca0a('0x4c')]=_0x51d5b6;return _0x29a27d;});}})[_0xca0a('0x17')](respondWithFilteredResult(_0x1b9ed1,_0x50efc9))[_0xca0a('0x56')](handleError(_0x1b9ed1,null));};exports['getScreenRecordings']=function(_0x2b1dae,_0x3bbad8){var _0x5edb9c={'raw':!![],'where':{}};var _0x49a697={};var _0x5c237c={'count':0x0,'rows':[]};return db[_0xca0a('0x44')][_0xca0a('0x9e')]({'where':{'id':_0x2b1dae[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x3bbad8,null))[_0xca0a('0x17')](function(_0x541e47){if(_0x541e47){_0x49a697[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db[_0xca0a('0xe0')]['rawAttributes']);_0x49a697[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x2b1dae[_0xca0a('0x46')]);_0x49a697[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x49a697[_0xca0a('0x5d')],_0x49a697[_0xca0a('0x46')]);_0x5edb9c[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x49a697[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x2b1dae[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x5edb9c[_0xca0a('0x4b')]=_0x5edb9c[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x5edb9c[_0xca0a('0x4b')]:_0x49a697[_0xca0a('0x5d')];if(!_0x2b1dae[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x5edb9c[_0xca0a('0x27')]=qs['limit'](_0x2b1dae[_0xca0a('0x46')][_0xca0a('0x27')]);_0x5edb9c[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x2b1dae[_0xca0a('0x46')][_0xca0a('0x25')]);}_0x5edb9c[_0xca0a('0xdb')]=qs['sort'](_0x2b1dae['query'][_0xca0a('0xd0')]);_0x5edb9c[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_['pick'](_0x2b1dae[_0xca0a('0x46')],_0x49a697[_0xca0a('0x5b')]));_0x5edb9c[_0xca0a('0x43')]['UserId']=_0x541e47['id'];if(_0x2b1dae[_0xca0a('0x46')]['filter']){_0x5edb9c[_0xca0a('0x43')]=_['merge'](_0x5edb9c[_0xca0a('0x43')],{'$or':_[_0xca0a('0x36')](_0x5edb9c[_0xca0a('0x4b')],function(_0x40bb8f){var _0xed271c={};_0xed271c[_0x40bb8f]={'$like':'%'+_0x2b1dae['query']['filter']+'%'};return _0xed271c;})});}_0x5edb9c=_['merge']({},_0x5edb9c,_0x2b1dae[_0xca0a('0x60')]);return db[_0xca0a('0xe0')][_0xca0a('0x45')]({'where':_0x5edb9c[_0xca0a('0x43')]})[_0xca0a('0x17')](function(_0x14987f){_0x5c237c[_0xca0a('0x45')]=_0x14987f;if(_0x2b1dae[_0xca0a('0x46')][_0xca0a('0x47')]){_0x5edb9c[_0xca0a('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0xca0a('0xb1')](_0x5edb9c);})['then'](function(_0xf15146){_0x5c237c[_0xca0a('0x4c')]=_0xf15146;return _0x5c237c;});}})['then'](respondWithFilteredResult(_0x3bbad8,_0x5edb9c))[_0xca0a('0x56')](handleError(_0x3bbad8,null));};exports['getChatInteractions']=function(_0x49299f,_0x106f3c){var _0x1a1705={};var _0x530b31={};var _0x3bba76;var _0x92cd8d;return db[_0xca0a('0x44')][_0xca0a('0x9e')]({'where':{'id':_0x49299f[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x106f3c,null))['then'](function(_0x6113db){if(_0x6113db){_0x3bba76=_0x6113db;_0x530b31[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db[_0xca0a('0xe1')]['rawAttributes']);_0x530b31[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x49299f[_0xca0a('0x46')]);_0x530b31['filters']=_[_0xca0a('0x5c')](_0x530b31[_0xca0a('0x5d')],_0x530b31[_0xca0a('0x46')]);_0x1a1705[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x530b31[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x49299f['query'][_0xca0a('0x5e')]));_0x1a1705[_0xca0a('0x4b')]=_0x1a1705[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x1a1705[_0xca0a('0x4b')]:_0x530b31[_0xca0a('0x5d')];_0x1a1705['order']=qs[_0xca0a('0xd0')](_0x49299f[_0xca0a('0x46')]['sort']);_0x1a1705[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_['pick'](_0x49299f[_0xca0a('0x46')],_0x530b31[_0xca0a('0x5b')]));if(_0x49299f['query'][_0xca0a('0x34')]){_0x1a1705['where']=_['merge'](_0x1a1705[_0xca0a('0x43')],{'$or':_['map'](_0x1a1705[_0xca0a('0x4b')],function(_0x1e1ce0){var _0xba4669={};_0xba4669[_0x1e1ce0]={'$like':'%'+_0x49299f[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0xba4669;})});}_0x1a1705=_[_0xca0a('0x5f')]({},_0x1a1705,_0x49299f['options']);return _0x3bba76[_0xca0a('0xe2')](_0x1a1705);}})['then'](function(_0x30e503){if(_0x30e503){_0x92cd8d=_0x30e503['length'];if(!_0x49299f[_0xca0a('0x46')][_0xca0a('0xd2')]('nolimit')){_0x1a1705['limit']=qs[_0xca0a('0x27')](_0x49299f['query'][_0xca0a('0x27')]);_0x1a1705['offset']=qs['offset'](_0x49299f[_0xca0a('0x46')]['offset']);}return _0x3bba76[_0xca0a('0xe2')](_0x1a1705);}})[_0xca0a('0x17')](function(_0x1fd02c){if(_0x1fd02c){return _0x1fd02c?{'count':_0x92cd8d,'rows':_0x1fd02c}:null;}})[_0xca0a('0x17')](respondWithResult(_0x106f3c,null))['catch'](handleError(_0x106f3c,null));};exports[_0xca0a('0xe3')]=function(_0x10f14e,_0x2cca06){var _0x5b3f33={};var _0x4cf494={};var _0x1bd477;var _0x41b730;return db['User']['findOne']({'where':{'id':_0x10f14e[_0xca0a('0x64')]['id']}})['then'](handleEntityNotFound(_0x2cca06,null))[_0xca0a('0x17')](function(_0x1902a5){if(_0x1902a5){_0x1bd477=_0x1902a5;_0x4cf494[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db[_0xca0a('0xe4')][_0xca0a('0x5a')]);_0x4cf494[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x10f14e['query']);_0x4cf494[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x4cf494[_0xca0a('0x5d')],_0x4cf494['query']);_0x5b3f33['attributes']=_['intersection'](_0x4cf494['model'],qs[_0xca0a('0x5e')](_0x10f14e[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x5b3f33[_0xca0a('0x4b')]=_0x5b3f33[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x5b3f33['attributes']:_0x4cf494[_0xca0a('0x5d')];_0x5b3f33[_0xca0a('0xdb')]=qs['sort'](_0x10f14e[_0xca0a('0x46')]['sort']);_0x5b3f33[_0xca0a('0x43')]=qs['filters'](_[_0xca0a('0xd1')](_0x10f14e['query'],_0x4cf494['filters']));if(_0x10f14e[_0xca0a('0x46')][_0xca0a('0x34')]){_0x5b3f33['where']=_[_0xca0a('0x5f')](_0x5b3f33[_0xca0a('0x43')],{'$or':_[_0xca0a('0x36')](_0x5b3f33[_0xca0a('0x4b')],function(_0x4ad595){var _0x563327={};_0x563327[_0x4ad595]={'$like':'%'+_0x10f14e[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x563327;})});}_0x5b3f33=_[_0xca0a('0x5f')]({},_0x5b3f33,_0x10f14e[_0xca0a('0x60')]);return _0x1bd477[_0xca0a('0xe3')](_0x5b3f33);}})[_0xca0a('0x17')](function(_0x26987a){if(_0x26987a){_0x41b730=_0x26987a[_0xca0a('0x4e')];if(!_0x10f14e['query']['hasOwnProperty'](_0xca0a('0xd6'))){_0x5b3f33[_0xca0a('0x27')]=qs[_0xca0a('0x27')](_0x10f14e[_0xca0a('0x46')]['limit']);_0x5b3f33[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x10f14e[_0xca0a('0x46')][_0xca0a('0x25')]);}return _0x1bd477['getOpenchannelInteractions'](_0x5b3f33);}})['then'](function(_0x4de52c){if(_0x4de52c){return _0x4de52c?{'count':_0x41b730,'rows':_0x4de52c}:null;}})[_0xca0a('0x17')](respondWithResult(_0x2cca06,null))[_0xca0a('0x56')](handleError(_0x2cca06,null));};exports[_0xca0a('0xe5')]=function(_0x58d1be,_0x30adc3){var _0x126889={'raw':!![],'where':{}};var _0x20dea8={};var _0x45a366={'count':0x0,'rows':[]};return db[_0xca0a('0x44')][_0xca0a('0x9e')]({'where':{'id':_0x58d1be[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x30adc3,null))[_0xca0a('0x17')](function(_0x58e5a2){if(_0x58e5a2){_0x20dea8[_0xca0a('0x5d')]=_['keys'](db['MailInteraction'][_0xca0a('0x5a')]);_0x20dea8[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x58d1be[_0xca0a('0x46')]);_0x20dea8[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x20dea8[_0xca0a('0x5d')],_0x20dea8['query']);_0x126889[_0xca0a('0x4b')]=_['intersection'](_0x20dea8[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x58d1be['query'][_0xca0a('0x5e')]));_0x126889[_0xca0a('0x4b')]=_0x126889['attributes'][_0xca0a('0x4e')]?_0x126889[_0xca0a('0x4b')]:_0x20dea8[_0xca0a('0x5d')];if(!_0x58d1be['query'][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x126889[_0xca0a('0x27')]=qs[_0xca0a('0x27')](_0x58d1be[_0xca0a('0x46')][_0xca0a('0x27')]);_0x126889[_0xca0a('0x25')]=qs['offset'](_0x58d1be['query'][_0xca0a('0x25')]);}_0x126889[_0xca0a('0xdb')]=qs[_0xca0a('0xd0')](_0x58d1be['query'][_0xca0a('0xd0')]);_0x126889[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_[_0xca0a('0xd1')](_0x58d1be[_0xca0a('0x46')],_0x20dea8[_0xca0a('0x5b')]));_0x126889[_0xca0a('0x43')][_0xca0a('0xe6')]=_0x58e5a2['id'];if(_0x58d1be[_0xca0a('0x46')][_0xca0a('0x34')]){_0x126889[_0xca0a('0x43')]=_['merge'](_0x126889['where'],{'$or':_[_0xca0a('0x36')](_0x126889['attributes'],function(_0x33864e){var _0x2a7429={};_0x2a7429[_0x33864e]={'$like':'%'+_0x58d1be[_0xca0a('0x46')]['filter']+'%'};return _0x2a7429;})});}_0x126889=_[_0xca0a('0x5f')]({},_0x126889,_0x58d1be[_0xca0a('0x60')]);return db[_0xca0a('0xe7')][_0xca0a('0x45')]({'where':_0x126889[_0xca0a('0x43')]})[_0xca0a('0x17')](function(_0x4eb241){_0x45a366['count']=_0x4eb241;if(_0x58d1be[_0xca0a('0x46')][_0xca0a('0x47')]){_0x126889['include']=[{'all':!![]}];}return db[_0xca0a('0xe7')]['findAll'](_0x126889);})['then'](function(_0x3890a5){_0x45a366[_0xca0a('0x4c')]=_0x3890a5;return _0x45a366;});}})[_0xca0a('0x17')](respondWithFilteredResult(_0x30adc3,_0x126889))[_0xca0a('0x56')](handleError(_0x30adc3,null));};exports[_0xca0a('0xe8')]=function(_0x169fec,_0x1defa2){var _0x2ee515={};var _0x4e869d={};var _0x4901e6;var _0x58ff32;return db[_0xca0a('0x44')]['findOne']({'where':{'id':_0x169fec[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x1defa2,null))[_0xca0a('0x17')](function(_0x1473fb){if(_0x1473fb){_0x4901e6=_0x1473fb;_0x4e869d['model']=_['keys'](db[_0xca0a('0xe9')][_0xca0a('0x5a')]);_0x4e869d[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x169fec[_0xca0a('0x46')]);_0x4e869d[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x4e869d[_0xca0a('0x5d')],_0x4e869d[_0xca0a('0x46')]);_0x2ee515[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x4e869d[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x169fec[_0xca0a('0x46')]['fields']));_0x2ee515[_0xca0a('0x4b')]=_0x2ee515[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x2ee515[_0xca0a('0x4b')]:_0x4e869d[_0xca0a('0x5d')];_0x2ee515[_0xca0a('0xdb')]=qs[_0xca0a('0xd0')](_0x169fec[_0xca0a('0x46')][_0xca0a('0xd0')]);_0x2ee515['where']=qs[_0xca0a('0x5b')](_['pick'](_0x169fec[_0xca0a('0x46')],_0x4e869d[_0xca0a('0x5b')]));if(_0x169fec[_0xca0a('0x46')][_0xca0a('0x34')]){_0x2ee515['where']=_[_0xca0a('0x5f')](_0x2ee515[_0xca0a('0x43')],{'$or':_['map'](_0x2ee515[_0xca0a('0x4b')],function(_0x341b14){var _0x596875={};_0x596875[_0x341b14]={'$like':'%'+_0x169fec[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x596875;})});}_0x2ee515=_[_0xca0a('0x5f')]({},_0x2ee515,_0x169fec[_0xca0a('0x60')]);return _0x4901e6[_0xca0a('0xe8')](_0x2ee515);}})[_0xca0a('0x17')](function(_0x158248){if(_0x158248){_0x58ff32=_0x158248[_0xca0a('0x4e')];if(!_0x169fec['query'][_0xca0a('0xd2')]('nolimit')){_0x2ee515[_0xca0a('0x27')]=qs[_0xca0a('0x27')](_0x169fec[_0xca0a('0x46')]['limit']);_0x2ee515[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x169fec[_0xca0a('0x46')]['offset']);}return _0x4901e6[_0xca0a('0xe8')](_0x2ee515);}})[_0xca0a('0x17')](function(_0x1fb03d){if(_0x1fb03d){return _0x1fb03d?{'count':_0x58ff32,'rows':_0x1fb03d}:null;}})[_0xca0a('0x17')](respondWithResult(_0x1defa2,null))[_0xca0a('0x56')](handleError(_0x1defa2,null));};exports[_0xca0a('0xea')]=function(_0x48307d,_0x1d6028){var _0x48622c={};var _0x2880dc={};var _0x2199cd;var _0x5620f1;return db['User'][_0xca0a('0x9e')]({'where':{'id':_0x48307d[_0xca0a('0x64')]['id']}})['then'](handleEntityNotFound(_0x1d6028,null))[_0xca0a('0x17')](function(_0x53ee27){if(_0x53ee27){_0x2199cd=_0x53ee27;_0x2880dc[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db[_0xca0a('0xeb')][_0xca0a('0x5a')]);_0x2880dc[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x48307d['query']);_0x2880dc[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x2880dc['model'],_0x2880dc[_0xca0a('0x46')]);_0x48622c[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x2880dc[_0xca0a('0x5d')],qs['fields'](_0x48307d[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x48622c[_0xca0a('0x4b')]=_0x48622c[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x48622c[_0xca0a('0x4b')]:_0x2880dc[_0xca0a('0x5d')];_0x48622c[_0xca0a('0xdb')]=qs['sort'](_0x48307d['query'][_0xca0a('0xd0')]);_0x48622c[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_[_0xca0a('0xd1')](_0x48307d[_0xca0a('0x46')],_0x2880dc[_0xca0a('0x5b')]));if(_0x48307d[_0xca0a('0x46')][_0xca0a('0x34')]){_0x48622c['where']=_[_0xca0a('0x5f')](_0x48622c['where'],{'$or':_[_0xca0a('0x36')](_0x48622c[_0xca0a('0x4b')],function(_0x18ab26){var _0x5d0d2d={};_0x5d0d2d[_0x18ab26]={'$like':'%'+_0x48307d[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x5d0d2d;})});}_0x48622c=_[_0xca0a('0x5f')]({},_0x48622c,_0x48307d[_0xca0a('0x60')]);return _0x2199cd[_0xca0a('0xea')](_0x48622c);}})[_0xca0a('0x17')](function(_0x183d69){if(_0x183d69){_0x5620f1=_0x183d69[_0xca0a('0x4e')];if(!_0x48307d[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x48622c['limit']=qs[_0xca0a('0x27')](_0x48307d['query'][_0xca0a('0x27')]);_0x48622c[_0xca0a('0x25')]=qs['offset'](_0x48307d[_0xca0a('0x46')][_0xca0a('0x25')]);}return _0x2199cd['getFaxInteractions'](_0x48622c);}})['then'](function(_0x458166){if(_0x458166){return _0x458166?{'count':_0x5620f1,'rows':_0x458166}:null;}})[_0xca0a('0x17')](respondWithResult(_0x1d6028,null))[_0xca0a('0x56')](handleError(_0x1d6028,null));};exports[_0xca0a('0xec')]=function(_0x16a14d,_0x45b157){var _0x10bbc5={};var _0x2c3e54={};var _0x5745af;var _0x441967;return db['User'][_0xca0a('0x9e')]({'where':{'id':_0x16a14d[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x45b157,null))[_0xca0a('0x17')](function(_0x5c862b){if(_0x5c862b){_0x5745af=_0x5c862b;_0x2c3e54['model']=_[_0xca0a('0x59')](db['WhatsappInteraction'][_0xca0a('0x5a')]);_0x2c3e54[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x16a14d[_0xca0a('0x46')]);_0x2c3e54[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x2c3e54[_0xca0a('0x5d')],_0x2c3e54[_0xca0a('0x46')]);_0x10bbc5[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x2c3e54[_0xca0a('0x5d')],qs['fields'](_0x16a14d[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x10bbc5[_0xca0a('0x4b')]=_0x10bbc5[_0xca0a('0x4b')]['length']?_0x10bbc5[_0xca0a('0x4b')]:_0x2c3e54[_0xca0a('0x5d')];_0x10bbc5[_0xca0a('0xdb')]=qs['sort'](_0x16a14d[_0xca0a('0x46')][_0xca0a('0xd0')]);_0x10bbc5['where']=qs['filters'](_[_0xca0a('0xd1')](_0x16a14d[_0xca0a('0x46')],_0x2c3e54[_0xca0a('0x5b')]));if(_0x16a14d[_0xca0a('0x46')][_0xca0a('0x34')]){_0x10bbc5[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x10bbc5[_0xca0a('0x43')],{'$or':_['map'](_0x10bbc5[_0xca0a('0x4b')],function(_0x4875eb){var _0x157b45={};_0x157b45[_0x4875eb]={'$like':'%'+_0x16a14d['query'][_0xca0a('0x34')]+'%'};return _0x157b45;})});}_0x10bbc5=_[_0xca0a('0x5f')]({},_0x10bbc5,_0x16a14d[_0xca0a('0x60')]);return _0x5745af[_0xca0a('0xec')](_0x10bbc5);}})[_0xca0a('0x17')](function(_0x11b578){if(_0x11b578){_0x441967=_0x11b578[_0xca0a('0x4e')];if(!_0x16a14d[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x10bbc5[_0xca0a('0x27')]=qs[_0xca0a('0x27')](_0x16a14d[_0xca0a('0x46')][_0xca0a('0x27')]);_0x10bbc5[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x16a14d['query'][_0xca0a('0x25')]);}return _0x5745af['getWhatsappInteractions'](_0x10bbc5);}})[_0xca0a('0x17')](function(_0xcc3a2){if(_0xcc3a2){return _0xcc3a2?{'count':_0x441967,'rows':_0xcc3a2}:null;}})['then'](respondWithResult(_0x45b157,null))[_0xca0a('0x56')](handleError(_0x45b157,null));};exports[_0xca0a('0xed')]=function(_0x136275,_0x20806c,_0x28d576){var _0x2a5214;var _0x9990ef;var _0x4e2b64;var _0x47f267=!_['isNil'](_0x136275[_0xca0a('0x64')]['id'])?_0x136275[_0xca0a('0x64')]['id']:!_[_0xca0a('0x6e')](_0x136275[_0xca0a('0x87')]['id'])?_0x136275[_0xca0a('0x87')]['id']:null;return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0x47f267,'role':{'$or':['admin',_0xca0a('0x87'),_0xca0a('0x32')]}},'attributes':['id',_0xca0a('0x3a'),_0xca0a('0xee'),_0xca0a('0xef'),'role','internal',_0xca0a('0xa6')]})[_0xca0a('0x17')](function(_0x2db820){if(_0x2db820){if(_0x2db820['role']===_0xca0a('0x32')){_0x2a5214=_0x2db820;if(_0x136275['body'][_0xca0a('0xa8')]){_0x4e2b64=util[_0xca0a('0xb3')](_0xca0a('0xf0'),_0x2a5214[_0x136275[_0xca0a('0x63')][_0xca0a('0xa8')]]);}else if(_0x136275[_0xca0a('0x63')][_0xca0a('0xf1')]){_0x4e2b64=util['format']('SIP/%s',_0x136275['body']['intrf']);}else{_0x4e2b64=util['format']('SIP/%s',_0x2a5214['name']);}socket['to'](util[_0xca0a('0xb3')](_0xca0a('0xf2'),_0x2a5214['name']))[_0xca0a('0x2b')](_0xca0a('0xf3'),{'user':{'id':_0x2a5214['id'],'name':_0x2a5214['name']},'ip':_0x136275['headers']['x-forwarded-for']||_0x136275[_0xca0a('0xf4')][_0xca0a('0xf5')]||_0x136275[_0xca0a('0xf6')][_0xca0a('0xf5')]||_0x136275[_0xca0a('0xf4')][_0xca0a('0xf6')][_0xca0a('0xf5')]});return db[_0xca0a('0xb5')][_0xca0a('0xb9')]({'where':{'membername':_0x2a5214[_0xca0a('0x3a')]},'individualHooks':!![]});}}else{throw new db[(_0xca0a('0x99'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x2a5214){return _0x2a5214['getVoiceQueues']({'raw':!![]});}})[_0xca0a('0x17')](function(_0x27eddc){if(_0x2a5214){if(_0x27eddc){_0x9990ef=_0x27eddc;if(_0x9990ef['length']){var _0x3a119e=_0x9990ef[_0xca0a('0x36')](function(_0x320d67){var _0x3bbeac={'membername':_0x2a5214[_0xca0a('0x3a')],'UserId':_0x2a5214['id'],'queue_name':_0x320d67[_0xca0a('0x3a')],'VoiceQueueId':_0x320d67['id'],'interface':_0x4e2b64,'paused':_0x2a5214[_0xca0a('0xa6')]||![],'penalty':_0x320d67[_0xca0a('0xf7')]||0x0};return db[_0xca0a('0xb5')][_0xca0a('0xf8')](_0x3bbeac);});return Promise[_0xca0a('0x95')](_0x3a119e);}}}})[_0xca0a('0x17')](function(){if(_0x2a5214){return db[_0xca0a('0xf9')]['findAll']({'where':{'membername':_0x2a5214[_0xca0a('0x3a')],'exitAt':null}});}})[_0xca0a('0x17')](function(_0x55eabc){if(_0x2a5214){var _0x30bbf6=[];_0x55eabc['forEach'](function(_0x2778f2){_0x30bbf6[_0xca0a('0x4f')](_0x2778f2[_0xca0a('0x2a')]({'exitAt':moment()['format'](_0xca0a('0xfa'))}));});return Promise[_0xca0a('0x95')](_0x30bbf6);}})['then'](function(){if(_0x2a5214){var _0x1c30d7=[];var _0x5b5af9=[];var _0x33f9bf=utils[_0xca0a('0xfb')]();var _0x2ce562={'membername':_0x2a5214[_0xca0a('0x3a')],'interface':_0x4e2b64,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2a5214[_0xca0a('0x2e')],'internal':_0x2a5214[_0xca0a('0x69')]};_0x33f9bf['forEach'](function(_0x152196){_0x1c30d7[_0xca0a('0x4f')](_[_0xca0a('0x5f')]({'channel':_0x152196,'type':_0xca0a('0xfc'),'data1':_0x136275[_0xca0a('0x63')]['device'],'data2':_0x4e2b64},_0x2ce562));if(_0x2a5214[_0xca0a('0xa6')]){_0x5b5af9['push'](_['merge']({'channel':_0x152196,'type':_0xca0a('0xfd'),'data1':_0xca0a('0xfe')},_0x2ce562));}});return db[_0xca0a('0xf9')][_0xca0a('0x93')](_0x1c30d7[_0xca0a('0xff')](_0x5b5af9),{'individualHooks':!![]});}})[_0xca0a('0x17')](function(){if(_0x2a5214){return _0x2a5214[_0xca0a('0x2a')]({'online':!![],'lastLoginAt':moment()['format'](_0xca0a('0xfa')),'voicePause':_0x2a5214[_0xca0a('0xa6')]||![],'mailPause':_0x2a5214[_0xca0a('0xa6')]||![],'chatPause':_0x2a5214['loginInPause']||![],'faxPause':_0x2a5214[_0xca0a('0xa6')]||![],'smsPause':_0x2a5214['loginInPause']||![],'openchannelPause':_0x2a5214[_0xca0a('0xa6')]||![],'whatsappPause':_0x2a5214[_0xca0a('0xa6')]||![],'pauseType':_0x2a5214[_0xca0a('0xa6')]?_0xca0a('0xfe'):null,'interface':_0x4e2b64,'lastPauseAt':moment()[_0xca0a('0xb3')](_0xca0a('0xfa'))});}})[_0xca0a('0x17')](function(_0x313e2e){if(_0x136275['isMiddleware']){return _0x28d576();}else{return Promise['resolve'](_0x313e2e)['then'](respondWithResult(_0x20806c,null));}})[_0xca0a('0x56')](handleError(_0x20806c,null));};exports['logout']=function(_0x295fa4,_0x33eab3){var _0xfff0c4;return db['User']['find']({'where':{'id':_0x295fa4[_0xca0a('0x64')]['id'],'role':_0xca0a('0x32')},'attributes':['id','name','role']})[_0xca0a('0x17')](handleEntityNotFound(_0x33eab3,null))[_0xca0a('0x17')](function(_0x35cac3){if(_0x35cac3){_0xfff0c4=_0x35cac3;return db[_0xca0a('0xb5')][_0xca0a('0xb9')]({'where':{'membername':_0xfff0c4[_0xca0a('0x3a')]},'individualHooks':!![]});}})[_0xca0a('0x17')](function(){return db['MemberReport'][_0xca0a('0xb1')]({'where':{'membername':_0xfff0c4[_0xca0a('0x3a')],'exitAt':null}});})['then'](function(_0x194b38){var _0x235e54=[];_0x194b38[_0xca0a('0x100')](function(_0x2ba25a){_0x235e54[_0xca0a('0x4f')](_0x2ba25a[_0xca0a('0x2a')]({'exitAt':moment()['format'](_0xca0a('0xfa'))}));});return Promise[_0xca0a('0x95')](_0x235e54);})[_0xca0a('0x17')](function(){return _0xfff0c4[_0xca0a('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x33eab3,null))['catch'](handleError(_0x33eab3,null));};exports[_0xca0a('0x101')]=function(_0x20ae2d,_0x3b0707){var _0x4e1a50;return db[_0xca0a('0xb5')][_0xca0a('0x2a')]({'paused':0x1},{'where':{'UserId':_0x20ae2d[_0xca0a('0x64')]['id']},'individualHooks':!![]})[_0xca0a('0x17')](function(){return db['User'][_0xca0a('0x39')]({'where':{'id':_0x20ae2d['params']['id'],'role':_0xca0a('0x32')},'attributes':['id',_0xca0a('0x3a'),_0xca0a('0x2e'),_0xca0a('0x69'),_0xca0a('0xa8'),_0xca0a('0xa5')]});})['then'](handleEntityNotFound(_0x3b0707,null))[_0xca0a('0x17')](function(_0x3170b3){if(_0x3170b3){_0x4e1a50=_0x3170b3;return respondWithRpcPromise(_0xca0a('0x102'),'pause',{'id':_0x4e1a50['id'],'name':_0x4e1a50[_0xca0a('0x3a')],'pause':!![]});}})[_0xca0a('0x17')](function(){if(_0x4e1a50){return db[_0xca0a('0xf9')][_0xca0a('0xb1')]({'where':{'membername':_0x4e1a50[_0xca0a('0x3a')],'type':_0xca0a('0xfd'),'exitAt':null}});}})[_0xca0a('0x17')](function(_0x499be7){if(_0x499be7[_0xca0a('0x4e')]){var _0x478789=moment()[_0xca0a('0xb3')](_0xca0a('0xfa'));for(var _0x408aa1=0x0,_0x242c5b=_0x499be7[_0xca0a('0x4e')];_0x408aa1<_0x242c5b;_0x408aa1++){_0x499be7[_0x408aa1]['updateAttributes']({'exitAt':_0x478789});}}})[_0xca0a('0x17')](function(){var _0x16cfd3=[];var _0x25fa7d=utils[_0xca0a('0xfb')]();_0x25fa7d[_0xca0a('0x100')](function(_0x4283b2){_0x16cfd3[_0xca0a('0x4f')]({'channel':_0x4283b2,'membername':_0x4e1a50[_0xca0a('0x3a')],'interface':_[_0xca0a('0x6e')](_0x4e1a50['interface'])?util[_0xca0a('0xb3')](_0xca0a('0xb4'),_0x4e1a50[_0xca0a('0x3a')]):_0x4e1a50['interface'],'type':_0xca0a('0xfd'),'enterAt':moment()[_0xca0a('0xb3')](_0xca0a('0xfa')),'data1':_0x20ae2d[_0xca0a('0x63')]['type']||_0xca0a('0x103'),'role':_0x4e1a50[_0xca0a('0x2e')],'internal':_0x4e1a50['internal']});});return db[_0xca0a('0xf9')][_0xca0a('0x93')](_0x16cfd3,{'individualHooks':!![]});})[_0xca0a('0x17')](function(){return _0x4e1a50[_0xca0a('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x20ae2d[_0xca0a('0x63')][_0xca0a('0x104')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xca0a('0xb3')](_0xca0a('0xfa'))});})[_0xca0a('0x17')](respondWithResult(_0x3b0707,null))[_0xca0a('0x56')](handleError(_0x3b0707,null));};exports['unpause']=function(_0xc92788,_0x205994){if(_0xc92788[_0xca0a('0x63')][_0xca0a('0xa4')]&&!utils['isValidChannel'](_0xc92788[_0xca0a('0x63')]['channel'])){throw new APIBadRequestError(util[_0xca0a('0xb3')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xc92788[_0xca0a('0x63')][_0xca0a('0xa4')]));}return db[_0xca0a('0x44')][_0xca0a('0x39')]({'where':{'id':_0xc92788[_0xca0a('0x64')]['id']},'attributes':['id','name','role','internal',_0xca0a('0xa8'),'online',_0xca0a('0xa7'),_0xca0a('0x105'),_0xca0a('0x106'),_0xca0a('0x107'),_0xca0a('0x108'),'smsPause',_0xca0a('0x109'),_0xca0a('0x10a'),'lastPauseAt']})['then'](function(_0x14c416){if(!_0x14c416){throw new APINotFoundError(util[_0xca0a('0xb3')](_0xca0a('0x10b'),_0xc92788[_0xca0a('0x64')]['id']));}return _0x14c416[_0xca0a('0x10c')](_0xc92788['body']['channel']);})[_0xca0a('0x17')](respondWithResult(_0x205994,null))[_0xca0a('0x56')](APIHandleError(_0x205994));};exports[_0xca0a('0x10d')]=function(_0x3cb2e9,_0x1b3c10){var _0x44d65b={};var _0x5b4405={};var _0x23d727;var _0x33bd63;return db['User'][_0xca0a('0x9e')]({'where':{'id':_0x3cb2e9[_0xca0a('0x64')]['id']}})['then'](handleEntityNotFound(_0x1b3c10,null))[_0xca0a('0x17')](function(_0x4e81cd){if(_0x4e81cd){_0x23d727=_0x4e81cd;_0x5b4405[_0xca0a('0x5d')]=_['keys'](db[_0xca0a('0x10e')][_0xca0a('0x5a')]);_0x5b4405[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x3cb2e9[_0xca0a('0x46')]);_0x5b4405[_0xca0a('0x5b')]=_[_0xca0a('0x5c')](_0x5b4405[_0xca0a('0x5d')],_0x5b4405['query']);_0x44d65b[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0x5b4405['model'],qs[_0xca0a('0x5e')](_0x3cb2e9[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x44d65b[_0xca0a('0x4b')]=_0x44d65b[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x44d65b[_0xca0a('0x4b')]:_0x5b4405['model'];_0x44d65b[_0xca0a('0xdb')]=qs[_0xca0a('0xd0')](_0x3cb2e9[_0xca0a('0x46')]['sort']);_0x44d65b['where']=qs[_0xca0a('0x5b')](_[_0xca0a('0xd1')](_0x3cb2e9['query'],_0x5b4405[_0xca0a('0x5b')]));if(_0x3cb2e9['query']['filter']){_0x44d65b[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x44d65b[_0xca0a('0x43')],{'$or':_[_0xca0a('0x36')](_0x44d65b[_0xca0a('0x4b')],function(_0x25370d){var _0x352909={};_0x352909[_0x25370d]={'$like':'%'+_0x3cb2e9[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0x352909;})});}_0x44d65b=_[_0xca0a('0x5f')]({},_0x44d65b,_0x3cb2e9[_0xca0a('0x60')]);return _0x23d727['getTeams'](_0x44d65b);}})[_0xca0a('0x17')](function(_0xc89ec){if(_0xc89ec){_0x33bd63=_0xc89ec[_0xca0a('0x4e')];if(!_0x3cb2e9[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x44d65b['limit']=qs[_0xca0a('0x27')](_0x3cb2e9[_0xca0a('0x46')][_0xca0a('0x27')]);_0x44d65b['offset']=qs[_0xca0a('0x25')](_0x3cb2e9[_0xca0a('0x46')][_0xca0a('0x25')]);}return _0x23d727['getTeams'](_0x44d65b);}})[_0xca0a('0x17')](function(_0xe121e5){if(_0xe121e5){return _0xe121e5?{'count':_0x33bd63,'rows':_0xe121e5}:null;}})['then'](respondWithResult(_0x1b3c10,null))[_0xca0a('0x56')](handleError(_0x1b3c10,null));};exports[_0xca0a('0x10f')]=function(_0x4c8727,_0x1d1912){var _0x2b51f7=_0x4c8727[_0xca0a('0x64')]['id'];var _0x52d7da=_0x4c8727[_0xca0a('0x63')]?_0x4c8727[_0xca0a('0x63')][_0xca0a('0x68')]:null;var _0x57ae76=[];return Promise[_0xca0a('0x110')]()[_0xca0a('0x17')](function(){if(!_0x52d7da)throw new APIBadRequestError(_0xca0a('0x111'));})[_0xca0a('0x17')](function(){return db[_0xca0a('0x44')][_0xca0a('0x9e')]({'where':{'id':_0x2b51f7}});})[_0xca0a('0x17')](function(_0x3b1e81){if(!_0x3b1e81)throw new APINotFoundError(util[_0xca0a('0xb3')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4c8727[_0xca0a('0x64')]['id']));return db[_0xca0a('0x70')][_0xca0a('0x112')](function(_0x4e2ef0){return _0x3b1e81[_0xca0a('0x10f')](_0x52d7da,{'transaction':_0x4e2ef0})['then'](function(){return db['Team'][_0xca0a('0xb1')]({'where':{'id':{'$in':_0x52d7da}}});})[_0xca0a('0x17')](function(_0x474452){var _0x266c05=_[_0xca0a('0x36')](_0x474452,function(_0x48d156){return _0x48d156[_0xca0a('0x113')]();});return Promise[_0xca0a('0x95')](_0x266c05);})['then'](function(_0x2daa8d){_0x57ae76=_[_0xca0a('0x114')](_0x2daa8d);var _0x31c7cd=_[_0xca0a('0x36')](_0x57ae76,function(_0x29a576){return _0x29a576[_0xca0a('0x115')](_0x3b1e81['id'],{'transaction':_0x4e2ef0});});return Promise[_0xca0a('0x95')](_0x31c7cd);})['then'](function(){if(!_0x3b1e81['online'])return;var _0x533d40=_[_0xca0a('0x34')](_0x57ae76,function(_0x5eb118){return _0x5eb118['getDataValue'](_0xca0a('0xa4'))===_0xca0a('0x116');});var _0x820208=_['map'](_0x533d40,function(_0x4d67a5){return db[_0xca0a('0xb5')][_0xca0a('0xf8')]({'membername':_0x3b1e81[_0xca0a('0x3a')],'UserId':_0x3b1e81['id'],'queue_name':_0x4d67a5[_0xca0a('0x3a')],'VoiceQueueId':_0x4d67a5['id'],'interface':_['isNil'](_0x3b1e81['interface'])?util[_0xca0a('0xb3')](_0xca0a('0xb4'),_0x3b1e81[_0xca0a('0x3a')]):_0x3b1e81[_0xca0a('0xa8')],'paused':_0x3b1e81[_0xca0a('0xa7')]||![],'penalty':_0x3b1e81[_0xca0a('0xad')]},{'transaction':_0x4e2ef0});});return Promise['all'](_0x820208);})[_0xca0a('0x17')](function(){return db[_0xca0a('0x117')][_0xca0a('0xb1')]({'where':{'teamId':{'$in':_0x52d7da}}});})['then'](function(_0x32be58){var _0x205d8f=_[_0xca0a('0x36')](_0x32be58,function(_0x271aa5){return db[_0xca0a('0x118')][_0xca0a('0x86')]({'UserId':_0x3b1e81['id'],'VoicePrefixId':_0x271aa5['VoicePrefixId']},{'transaction':_0x4e2ef0});});return Promise[_0xca0a('0x95')](_0x205d8f);});});})[_0xca0a('0x17')](function(){for(var _0x496c55=0x0;_0x496c55<_0x57ae76['length'];_0x496c55++){var _0x321343=_0x57ae76[_0x496c55][_0xca0a('0x119')](_0xca0a('0xa4'));var _0x47d279=_0x321343+_0xca0a('0xaf');socket['emit'](_0xca0a('0x87')+_0x321343+'Queue:save',{'UserId':_0x2b51f7,['queueField']:_0x57ae76[_0x496c55]['id']});}})[_0xca0a('0x17')](respondWithStatusCode(_0x1d1912,null))['catch'](APIHandleError(_0x1d1912));};exports[_0xca0a('0x11a')]=function(_0x4f3fc2,_0x3b80ec){var _0x53913a=_0x4f3fc2[_0xca0a('0x64')]['id'];var _0x10dfde=null;if(_0x4f3fc2[_0xca0a('0x46')][_0xca0a('0x68')]){_0x10dfde=_['isArray'](_0x4f3fc2[_0xca0a('0x46')]['ids'])?_0x4f3fc2[_0xca0a('0x46')][_0xca0a('0x68')]:[_0x4f3fc2[_0xca0a('0x46')][_0xca0a('0x68')]];}var _0x299b0c=[];return Promise[_0xca0a('0x110')]()['then'](function(){if(!_0x10dfde)throw new APIBadRequestError(_0xca0a('0x11b'));})[_0xca0a('0x17')](function(){return db['User'][_0xca0a('0x9e')]({'where':{'id':_0x53913a}});})['then'](function(_0x388930){if(!_0x388930)throw new APINotFoundError(util[_0xca0a('0xb3')](_0xca0a('0x10b'),_0x4f3fc2[_0xca0a('0x64')]['id']));return db[_0xca0a('0x70')][_0xca0a('0x112')](function(_0x372b31){return _0x388930[_0xca0a('0x11a')](_0x10dfde,{'transaction':_0x372b31})[_0xca0a('0x17')](function(){return db['Team'][_0xca0a('0xb1')]({'where':{'id':{'$in':_0x10dfde}}});})[_0xca0a('0x17')](function(_0x4dbb74){var _0x4e8caa=_[_0xca0a('0x36')](_0x4dbb74,function(_0x38e6ad){return _0x38e6ad['getAssociatedQueues']();});return Promise[_0xca0a('0x95')](_0x4e8caa);})['then'](function(_0x450da0){_0x299b0c=_[_0xca0a('0x114')](_0x450da0);var _0x58df7e=_[_0xca0a('0x36')](_0x299b0c,function(_0x53fc3c){return _0x53fc3c[_0xca0a('0x11c')](_0x388930['id'],{'transaction':_0x372b31});});return Promise[_0xca0a('0x95')](_0x58df7e);})[_0xca0a('0x17')](function(){if(!_0x388930['online'])return;var _0x222aec=_['filter'](_0x299b0c,function(_0x4d36c8){return _0x4d36c8[_0xca0a('0x119')](_0xca0a('0xa4'))===_0xca0a('0x116');});var _0x38f9a0=_[_0xca0a('0x36')](_0x222aec,function(_0x56faae){return db['UserVoiceQueueRt'][_0xca0a('0xb9')]({'where':{'VoiceQueueId':_0x56faae['id'],'UserId':_0x388930['id']},'transaction':_0x372b31});});return Promise[_0xca0a('0x95')](_0x38f9a0);})[_0xca0a('0x17')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x10dfde}}});})[_0xca0a('0x17')](function(_0x270a71){var _0x572066=_[_0xca0a('0x36')](_0x270a71,function(_0x588206){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x388930['id'],'VoicePrefixId':_0x588206[_0xca0a('0x11d')]}},{'transaction':_0x372b31});});return Promise[_0xca0a('0x95')](_0x572066);});});})['then'](function(){for(var _0x23e0e3=0x0;_0x23e0e3<_0x299b0c[_0xca0a('0x4e')];_0x23e0e3++){var _0x5e143e=_0x299b0c[_0x23e0e3][_0xca0a('0x119')](_0xca0a('0xa4'));var _0x16384a=_0x5e143e+_0xca0a('0xaf');socket[_0xca0a('0x2b')]('user'+_0x5e143e+'Queue:remove',{'UserId':_0x53913a,['queueField']:_0x299b0c[_0x23e0e3]['id']});}})[_0xca0a('0x17')](respondWithStatusCode(_0x3b80ec,null))[_0xca0a('0x56')](APIHandleError(_0x3b80ec));};exports[_0xca0a('0x11e')]=function(_0x5565a5,_0x2a11e8){var _0x42aa0c={};var _0x21d1b0={};var _0x1cbaaf;var _0x313814;return db[_0xca0a('0x44')][_0xca0a('0x9e')]({'where':{'id':_0x5565a5[_0xca0a('0x64')]['id']}})[_0xca0a('0x17')](handleEntityNotFound(_0x2a11e8,null))['then'](function(_0x1da34d){if(_0x1da34d){_0x1cbaaf=_0x1da34d;_0x21d1b0[_0xca0a('0x5d')]=_['keys'](db[_0xca0a('0xd3')]['rawAttributes']);_0x21d1b0['query']=_[_0xca0a('0x59')](_0x5565a5[_0xca0a('0x46')]);_0x21d1b0[_0xca0a('0x5b')]=_['intersection'](_0x21d1b0[_0xca0a('0x5d')],_0x21d1b0[_0xca0a('0x46')]);_0x42aa0c['attributes']=_[_0xca0a('0x5c')](_0x21d1b0[_0xca0a('0x5d')],qs[_0xca0a('0x5e')](_0x5565a5[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x42aa0c[_0xca0a('0x4b')]=_0x42aa0c[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x42aa0c['attributes']:_0x21d1b0['model'];_0x42aa0c[_0xca0a('0xdb')]=qs[_0xca0a('0xd0')](_0x5565a5[_0xca0a('0x46')][_0xca0a('0xd0')]);_0x42aa0c[_0xca0a('0x43')]=qs[_0xca0a('0x5b')](_['pick'](_0x5565a5[_0xca0a('0x46')],_0x21d1b0['filters']));if(_0x5565a5[_0xca0a('0x46')][_0xca0a('0x34')]){_0x42aa0c[_0xca0a('0x43')]=_['merge'](_0x42aa0c[_0xca0a('0x43')],{'$or':_['map'](_0x42aa0c[_0xca0a('0x4b')],function(_0x62db85){var _0x1a46d4={};_0x1a46d4[_0x62db85]={'$like':'%'+_0x5565a5[_0xca0a('0x46')]['filter']+'%'};return _0x1a46d4;})});}_0x42aa0c=_[_0xca0a('0x5f')]({},_0x42aa0c,_0x5565a5['options']);return _0x1cbaaf[_0xca0a('0x11e')](_0x42aa0c);}})[_0xca0a('0x17')](function(_0x4e0dcb){if(_0x4e0dcb){_0x313814=_0x4e0dcb[_0xca0a('0x4e')];if(!_0x5565a5[_0xca0a('0x46')][_0xca0a('0xd2')](_0xca0a('0xd6'))){_0x42aa0c[_0xca0a('0x27')]=qs[_0xca0a('0x27')](_0x5565a5[_0xca0a('0x46')][_0xca0a('0x27')]);_0x42aa0c[_0xca0a('0x25')]=qs[_0xca0a('0x25')](_0x5565a5[_0xca0a('0x46')][_0xca0a('0x25')]);}return _0x1cbaaf[_0xca0a('0x11e')](_0x42aa0c);}})[_0xca0a('0x17')](function(_0x3e78a1){if(_0x3e78a1){return _0x3e78a1?{'count':_0x313814,'rows':_0x3e78a1}:null;}})[_0xca0a('0x17')](respondWithResult(_0x2a11e8,null))[_0xca0a('0x56')](handleError(_0x2a11e8,null));};exports['getAgents']=function(_0x18236b,_0x3ae042){var _0x245ba0={};var _0xc390e1={};var _0x137c89;return db[_0xca0a('0x44')]['findOne']({'where':{'id':_0x18236b[_0xca0a('0x64')]['id']}})['then'](handleEntityNotFound(_0x3ae042,null))[_0xca0a('0x17')](function(_0x257fed){if(_0x257fed){_0x137c89=_0x257fed;_0xc390e1[_0xca0a('0x5d')]=_[_0xca0a('0x59')](db[_0xca0a('0x44')][_0xca0a('0x5a')]);_0xc390e1[_0xca0a('0x46')]=_[_0xca0a('0x59')](_0x18236b[_0xca0a('0x46')]);_0xc390e1[_0xca0a('0x5b')]=_['intersection'](_0xc390e1[_0xca0a('0x5d')],_0xc390e1[_0xca0a('0x46')]);_0x245ba0[_0xca0a('0x4b')]=_[_0xca0a('0x5c')](_0xc390e1['model'],qs[_0xca0a('0x5e')](_0x18236b[_0xca0a('0x46')][_0xca0a('0x5e')]));_0x245ba0[_0xca0a('0x4b')]=_0x245ba0[_0xca0a('0x4b')][_0xca0a('0x4e')]?_0x245ba0[_0xca0a('0x4b')]:_0xc390e1[_0xca0a('0x5d')];_0x245ba0['order']=qs[_0xca0a('0xd0')](_0x18236b[_0xca0a('0x46')][_0xca0a('0xd0')]);_0x245ba0[_0xca0a('0x43')]=qs['filters'](_[_0xca0a('0xd1')](_0x18236b[_0xca0a('0x46')],_0xc390e1[_0xca0a('0x5b')]));if(_0x18236b['query'][_0xca0a('0x34')]){_0x245ba0[_0xca0a('0x43')]=_[_0xca0a('0x5f')](_0x245ba0[_0xca0a('0x43')],{'$or':_[_0xca0a('0x36')](_0x245ba0[_0xca0a('0x4b')],function(_0x57cb78){var _0xf76b49={};_0xf76b49[_0x57cb78]={'$like':'%'+_0x18236b[_0xca0a('0x46')][_0xca0a('0x34')]+'%'};return _0xf76b49;})});}_0x245ba0[_0xca0a('0x5d')]=db[_0xca0a('0x44')];_0x245ba0['as']='Agents';_0x245ba0=_[_0xca0a('0x5f')]({},_0x245ba0,_0x18236b['options']);return _0x137c89['getVoiceQueues']({'include':[_0x245ba0]});}})[_0xca0a('0x17')](function(_0x9d7d0){if(_0x9d7d0){var _0x53cb42={},_0x5f614f=[];for(var _0x4519e4=0x0;_0x4519e4<_0x9d7d0['length'];_0x4519e4+=0x1){for(var _0x1f7639=0x0,_0x452613;_0x1f7639<_0x9d7d0[_0x4519e4][_0xca0a('0x31')][_0xca0a('0x4e')];_0x1f7639+=0x1){_0x452613=_0x9d7d0[_0x4519e4][_0xca0a('0x31')][_0x1f7639][_0xca0a('0x2d')]({'plain':!![]});_0x53cb42[_0x452613['id']]=_0x452613;}}_0x53cb42=_['values'](_0x53cb42);for(var _0x173a72=qs[_0xca0a('0x25')](_0x18236b[_0xca0a('0x46')][_0xca0a('0x25')]);_0x173a72<_0x53cb42[_0xca0a('0x4e')]&&_0x5f614f[_0xca0a('0x4e')]=_0x5017c8){_0x256a6e=_0x5017c8;_0x17d294=0xc8;}else{_0x17d294=0xce;}_0x26ca38[_0xa8e6('0x1f')](_0x17d294);return _0x26ca38[_0xa8e6('0x25')](_0xa8e6('0x26'),_0x45425b+'-'+_0x256a6e+'/'+_0x5017c8)[_0xa8e6('0x20')](_0x4a8393);}return null;};}function saveUpdates(_0x4739db){return function(_0x3da9ba){if(_0x3da9ba){return _0x3da9ba[_0xa8e6('0x27')](_0x4739db)[_0xa8e6('0x16')](function(_0x395ecd){socket[_0xa8e6('0x28')](_0xa8e6('0x29')+_0x395ecd['id'],{});return _0x395ecd;});}return null;};}function removeEntity(_0x4e2b0b){return function(_0x43d9f7){if(_0x43d9f7){return _0x43d9f7['destroy']()[_0xa8e6('0x16')](function(){var _0x43642f=_0x43d9f7[_0xa8e6('0x2a')]({'plain':!![]});if(_0x43642f[_0xa8e6('0x2b')]===_0xa8e6('0x2c'))return;var _0x5e022d=[{'name':_0xa8e6('0x2d'),'value':_0xa8e6('0x2e'),'ignore':!![]},{'name':_0xa8e6('0x2f'),'value':_0xa8e6('0x30'),'ignore':![]},{'name':_0xa8e6('0x31'),'value':_0xa8e6('0x32'),'ignore':![]}];var _0x202d32=_(_0x5e022d)[_0xa8e6('0x33')]('ignore')[_0xa8e6('0x34')](_0xa8e6('0x35'))[_0xa8e6('0x35')]();if(_[_0xa8e6('0x36')](_0x202d32,_0x43642f[_0xa8e6('0x2b')])){return;}var _0x47d931=_['find'](_0x5e022d,[_0xa8e6('0x35'),_0x43642f[_0xa8e6('0x2b')]])[_0xa8e6('0x37')];return db[_0xa8e6('0x38')][_0xa8e6('0x39')]({'where':{'type':_0x47d931,'resourceId':_0x43642f['id']}})['then'](function(){return _0x43d9f7;});})[_0xa8e6('0x16')](function(){_0x4e2b0b[_0xa8e6('0x1f')](0xcc)[_0xa8e6('0x3a')]();});}};}function handleEntityNotFound(_0x13e5b3){return function(_0x248b59){if(!_0x248b59){_0x13e5b3[_0xa8e6('0x3b')](0x194);}return _0x248b59;};}function handleError(_0x7e48f5,_0x147ddc){_0x147ddc=_0x147ddc||0x1f4;return function(_0x1047a9){logger['error'](_0x1047a9[_0xa8e6('0x3c')]);if(_0x1047a9[_0xa8e6('0x37')]){delete _0x1047a9[_0xa8e6('0x37')];}_0x7e48f5['status'](_0x147ddc)['send'](_0x1047a9);};}exports[_0xa8e6('0x3d')]=function(_0x116b4c,_0x27af57){var _0x4af675={},_0x207e84={'count':0x0,'rows':[]};var _0x3e1cb4=_(db['User'][_0xa8e6('0x3e')])[_0xa8e6('0x34')](function(_0x1ee73c){return{'name':_0x1ee73c[_0xa8e6('0x3f')],'type':_0x1ee73c[_0xa8e6('0x40')][_0xa8e6('0x41')]};})['filter'](function(_0x129318){return!_[_0xa8e6('0x36')]([_0xa8e6('0x42'),_0xa8e6('0x43')],_0x129318[_0xa8e6('0x37')]);})['value']();_0x4af675=qs[_0xa8e6('0x44')](_0x3e1cb4,_0x116b4c);var _0x50a93f={'where':_0x4af675[_0xa8e6('0x45')]};return db[_0xa8e6('0x46')][_0xa8e6('0x24')](_0x50a93f)[_0xa8e6('0x16')](function(_0x3e100e){_0x207e84['count']=_0x3e100e;if(_0x116b4c[_0xa8e6('0x47')][_0xa8e6('0x48')]){_0x4af675['include']=[{'all':!![]}];}if(_0x116b4c[_0xa8e6('0x47')][_0xa8e6('0x49')]===_0xa8e6('0x4a')){_0x4af675[_0xa8e6('0x4b')]=[{'model':db['UserSetting'],'as':_0xa8e6('0x49')}];}if(!_['includes'](_0x4af675[_0xa8e6('0x4c')],'id')){_0x4af675['attributes'][_0xa8e6('0x4d')]('id');}return db[_0xa8e6('0x46')][_0xa8e6('0x4e')](_0x4af675);})['then'](function(_0x3a6150){_0x207e84['rows']=_0x3a6150;if(_0x116b4c[_0xa8e6('0x47')]['openTabs']===_0xa8e6('0x4a')){var _0x59ba6e=[];for(var _0x1b9dd8=0x0;_0x1b9dd8<_0x207e84[_0xa8e6('0x4f')][_0xa8e6('0x50')];_0x1b9dd8++){_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x51'),_0x207e84[_0xa8e6('0x4f')][_0x1b9dd8][_0xa8e6('0x52')]));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x53'),_0x207e84['rows'][_0x1b9dd8][_0xa8e6('0x52')]));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x54'),_0x207e84[_0xa8e6('0x4f')][_0x1b9dd8]['dataValues']));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x55'),_0x207e84['rows'][_0x1b9dd8][_0xa8e6('0x52')]));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x56'),_0x207e84['rows'][_0x1b9dd8]['dataValues']));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs('whatsapp',_0x207e84[_0xa8e6('0x4f')][_0x1b9dd8][_0xa8e6('0x52')]));}return Promise['all'](_0x59ba6e)['then'](function(){return _0x207e84;});}else{return _0x207e84;}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x27af57,_0x4af675))['catch'](handleError(_0x27af57,null));};exports['show']=function(_0x11a83f,_0x8f812){var _0x1fdca9={'raw':![],'where':{'id':_0x11a83f['params']['id']}},_0x41e338={};_0x41e338['model']=_[_0xa8e6('0x57')](_[_0xa8e6('0x58')](db[_0xa8e6('0x46')][_0xa8e6('0x3e')]),[_0xa8e6('0x42'),_0xa8e6('0x43')]);_0x41e338[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x11a83f[_0xa8e6('0x47')]);_0x41e338[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x41e338[_0xa8e6('0x5b')],_0x41e338[_0xa8e6('0x47')]);_0x1fdca9[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x41e338['model'],qs[_0xa8e6('0x5c')](_0x11a83f['query'][_0xa8e6('0x5c')]));_0x1fdca9['attributes']=_0x1fdca9[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x1fdca9[_0xa8e6('0x4c')]:_0x41e338['model'];if(_0x11a83f['query']['includeAll']){_0x1fdca9['include']=[{'all':!![]}];}if(_0x11a83f['query'][_0xa8e6('0x49')]==='true'){_0x1fdca9[_0xa8e6('0x4b')]=[{'model':db[_0xa8e6('0x5d')],'as':_0xa8e6('0x49')}];}_0x1fdca9=_[_0xa8e6('0x5e')]({},_0x1fdca9,_0x11a83f[_0xa8e6('0x5f')]);if(!_[_0xa8e6('0x36')](_0x1fdca9[_0xa8e6('0x4c')],'id')){_0x1fdca9['attributes']['push']('id');}return db[_0xa8e6('0x46')][_0xa8e6('0x60')](_0x1fdca9)[_0xa8e6('0x16')](handleEntityNotFound(_0x8f812,null))['then'](function(_0x4fc353){var _0x2c7778=[];values=_0x4fc353;if(_0x11a83f[_0xa8e6('0x47')]['openTabs']===_0xa8e6('0x4a')){_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x51'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x53'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x56'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778['push'](get_open_tabs('whatsapp',_0x4fc353['dataValues']));_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x54'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778['push'](get_open_tabs(_0xa8e6('0x55'),_0x4fc353['dataValues']));return Promise[_0xa8e6('0x61')](_0x2c7778);}else{return values;}})[_0xa8e6('0x16')](function(){return values;})[_0xa8e6('0x16')](respondWithResult(_0x8f812,null))['catch'](handleError(_0x8f812,null));};exports[_0xa8e6('0x27')]=function(_0x46e974,_0x5c272b){if(_0x46e974['body']['id']){delete _0x46e974['body']['id'];}delete _0x46e974[_0xa8e6('0x62')][_0xa8e6('0x2b')];return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x46e974[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x5c272b,null))[_0xa8e6('0x16')](saveUpdates(_0x46e974[_0xa8e6('0x62')],null))[_0xa8e6('0x16')](respondWithResult(_0x5c272b,null))['catch'](handleError(_0x5c272b,null));};exports['describe']=function(_0x10a963,_0x1cf8a0){return db['User'][_0xa8e6('0x64')]()[_0xa8e6('0x16')](respondWithResult(_0x1cf8a0,null))['catch'](handleError(_0x1cf8a0,null));};exports[_0xa8e6('0x65')]=function(_0x83a8c8,_0x2f8c4e){return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x83a8c8[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x2f8c4e,null))[_0xa8e6('0x16')](function(_0x522424){if(_0x522424){return _0x522424[_0xa8e6('0x65')](_0x83a8c8[_0xa8e6('0x62')]['ids'],_[_0xa8e6('0x66')](_0x83a8c8['body'],[_0xa8e6('0x67'),'id'])||{});}})[_0xa8e6('0x16')](respondWithResult(_0x2f8c4e,null))[_0xa8e6('0x1e')](handleError(_0x2f8c4e,null));};function validateUser(_0xee4da3){return new Promise(function(_0x15b648,_0x419f02){if(_0xee4da3[_0xa8e6('0x68')])return _0x15b648(_0xee4da3);return db[_0xa8e6('0x69')][_0xa8e6('0x6a')](0x1)['then'](function(_0x11fb16){if(_0x11fb16['securePassword'])authService[_0xa8e6('0x6b')](_0xee4da3[_0xa8e6('0x42')]);db[_0xa8e6('0x46')][_0xa8e6('0x6c')](_0xa8e6('0x68'))[_0xa8e6('0x16')](function(_0x51ef04){if(_[_0xa8e6('0x6d')](_0x51ef04)){_0xee4da3[_0xa8e6('0x68')]=_0x11fb16[_0xa8e6('0x6e')]||0x1;return;}if(_[_0xa8e6('0x6d')](_0x11fb16[_0xa8e6('0x6e')])||_0x11fb16[_0xa8e6('0x6e')]===_0x51ef04){_0xee4da3[_0xa8e6('0x68')]=_0x51ef04+0x1;return;}if(_0x11fb16[_0xa8e6('0x6e')]>_0x51ef04){_0xee4da3[_0xa8e6('0x68')]=_0x11fb16[_0xa8e6('0x6e')];return;}return db[_0xa8e6('0x6f')]['query'](_0xa8e6('0x70'),{'type':db[_0xa8e6('0x6f')][_0xa8e6('0x71')]['SELECT']})['then'](function(_0x55a977){if(_0x55a977&&_0x55a977[_0xa8e6('0x50')]){for(var _0x38cac7=0x0,_0x4b1da7=_0x55a977[_0xa8e6('0x50')];_0x38cac7<_0x4b1da7&&_['isNil'](_0xee4da3['internal']);_0x38cac7++){if(_0x11fb16[_0xa8e6('0x6e')]<=_0x55a977[_0x38cac7][_0xa8e6('0x72')]){_0xee4da3[_0xa8e6('0x68')]=_0x55a977[_0x38cac7][_0xa8e6('0x72')];}else if(_0x11fb16[_0xa8e6('0x6e')]>_0x55a977[_0x38cac7][_0xa8e6('0x72')]&&_0x11fb16[_0xa8e6('0x6e')]<=_0x55a977[_0x38cac7]['to']){_0xee4da3['internal']=_0x11fb16[_0xa8e6('0x6e')];}}}if(_['isNil'](_0xee4da3[_0xa8e6('0x68')])){_0xee4da3[_0xa8e6('0x68')]=_0x51ef04+0x1;}return _0x15b648(_0xee4da3);});});})['catch'](function(_0x1f2176){_0x419f02(_0x1f2176);});});}function updateUser(_0x3abec6){return new Promise(function(_0x3b6141,_0x536cb6){try{if(_0x3abec6[_0xa8e6('0x73')]){_0x3abec6[_0xa8e6('0x74')]=_0x3abec6[_0xa8e6('0x68')];_0x3abec6[_0xa8e6('0x75')]={'mailbox':_0x3abec6['internal'],'password':_0x3abec6[_0xa8e6('0x42')],'fullname':_0x3abec6[_0xa8e6('0x76')],'email':_0x3abec6[_0xa8e6('0x77')]};}if(_0x3abec6[_0xa8e6('0x2b')]===_0xa8e6('0x30')){if(!_0x3abec6[_0xa8e6('0x78')])_0x3abec6[_0xa8e6('0x78')]=[_0xa8e6('0x79'),_0xa8e6('0x7a'),_0xa8e6('0x7b'),_0xa8e6('0x7c'),_0xa8e6('0x7d'),_0xa8e6('0x7e'),_0xa8e6('0x7f'),'106',_0xa8e6('0x80'),_0xa8e6('0x81'),'109',_0xa8e6('0x82'),'111',_0xa8e6('0x83'),_0xa8e6('0x84')];}_0x3b6141(_0x3abec6);}catch(_0x4b0c76){_0x536cb6(_0x4b0c76);}});}exports['create']=function(_0x63e8dd,_0x10c93f){if(_0x63e8dd['user'][_0xa8e6('0x2b')]===_0xa8e6('0x30'))throw new Error(_0xa8e6('0x85'));if(_0x63e8dd[_0xa8e6('0x62')][_0xa8e6('0x2b')]===_0xa8e6('0x2e')&&_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!==_0xa8e6('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x63e8dd[_0xa8e6('0x62')][_0xa8e6('0x2b')]==='admin'&&_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!=='admin'){throw new Error(_0xa8e6('0x86'));}return licenseUtil['checkUserLimits']([_0x63e8dd[_0xa8e6('0x62')]])['then'](function(){return validateUser(_0x63e8dd[_0xa8e6('0x62')]);})['then'](function(_0x29e884){return updateUser(_0x29e884)[_0xa8e6('0x16')](function(_0x28a22c){if(_0x28a22c['role']===_0xa8e6('0x2c')){_0x28a22c[_0xa8e6('0x87')]=_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x87')];delete _0x28a22c[_0xa8e6('0x88')];}return _0x28a22c;});})[_0xa8e6('0x16')](function(_0x2aa7c3){return db['User'][_0xa8e6('0x89')](_0x2aa7c3,{'include':[{'model':db[_0xa8e6('0x75')],'as':_0xa8e6('0x75')}]});})[_0xa8e6('0x16')](function(_0x32ad86){if(_0x63e8dd['body'][_0xa8e6('0x2b')]===_0xa8e6('0x2e'))return _0x32ad86;if(_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!=='user')return _0x32ad86;return db[_0xa8e6('0x8a')][_0xa8e6('0x60')]({'where':{'name':_0x32ad86[_0xa8e6('0x2b')]==='agent'?_0xa8e6('0x2f'):'Telephones','userProfileId':_0x63e8dd['user'][_0xa8e6('0x88')]},'raw':!![]})[_0xa8e6('0x16')](function(_0x1477d0){if(!_0x1477d0||_0x1477d0[_0xa8e6('0x8b')]!=0x0)return _0x32ad86;return db[_0xa8e6('0x38')]['create']({'name':_0x32ad86[_0xa8e6('0x37')],'resourceId':_0x32ad86['id'],'type':_0x1477d0[_0xa8e6('0x37')],'sectionId':_0x1477d0['id']},{})[_0xa8e6('0x16')](function(){return _0x32ad86;});})['catch'](function(_0x2d913e){logger[_0xa8e6('0x1b')](_0xa8e6('0x8c'),_0x2d913e);throw _0x2d913e;});})[_0xa8e6('0x16')](respondWithResult(_0x10c93f,0xc9))[_0xa8e6('0x1e')](handleError(_0x10c93f,null));};exports[_0xa8e6('0x8d')]=function(_0x5909dd,_0x211269){var _0x52c4c8=_0x5909dd[_0xa8e6('0x62')];var _0x27e547=[];if(_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]==='agent')throw new Error(_0xa8e6('0x85'));if(_[_0xa8e6('0x8e')](_0x52c4c8,['role',_0xa8e6('0x2e')])&&_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x52c4c8,['role',_0xa8e6('0x2c')])&&_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!==_0xa8e6('0x2c')){throw new Error(_0xa8e6('0x8f'));}return licenseUtil[_0xa8e6('0x90')](_0x52c4c8)[_0xa8e6('0x16')](function(){return validateUser(_0x52c4c8[0x0]);})[_0xa8e6('0x16')](function(){for(var _0x191068=0x1;_0x191068<_0x52c4c8[_0xa8e6('0x50')];_0x191068++){var _0x381cde=_0x52c4c8[_0x191068-0x1][_0xa8e6('0x68')];if(!_0x52c4c8[_0x191068][_0xa8e6('0x68')])_0x52c4c8[_0x191068][_0xa8e6('0x68')]=_0x381cde+0x1;_0x27e547[_0xa8e6('0x4d')](validateUser(_0x52c4c8[_0x191068]));}return Promise[_0xa8e6('0x61')](_0x27e547);})[_0xa8e6('0x16')](function(){_0x27e547=[];for(var _0x279925=0x0;_0x279925<_0x52c4c8[_0xa8e6('0x50')];_0x279925++){_0x27e547['push'](updateUser(_0x52c4c8[_0x279925]));}return Promise[_0xa8e6('0x61')](_0x27e547);})[_0xa8e6('0x16')](function(){_0x27e547=_0x52c4c8[_0xa8e6('0x34')](function(_0x3e690f){return db[_0xa8e6('0x46')][_0xa8e6('0x89')](_0x3e690f,{'include':[{'model':db[_0xa8e6('0x75')],'as':_0xa8e6('0x75')}]})[_0xa8e6('0x16')](function(_0x4575bb){_0x3e690f['id']=_0x4575bb['id'];return _0x3e690f;});});return Promise[_0xa8e6('0x61')](_0x27e547);})['then'](function(_0x2136a8){if(_0x5909dd[_0xa8e6('0x62')][_0xa8e6('0x2b')]==='user')return _0x2136a8;if(_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!==_0xa8e6('0x2e'))return _0x2136a8;var _0x4cb5e8=_['some'](_0x2136a8,function(_0x302ec9){return _0x302ec9[_0xa8e6('0x2b')]==='agent'||_0x302ec9[_0xa8e6('0x2b')]===_0xa8e6('0x32');});if(!_0x4cb5e8)return _0x2136a8;return db[_0xa8e6('0x8a')][_0xa8e6('0x4e')]({'where':{'name':{'$or':[_0xa8e6('0x2f'),_0xa8e6('0x31')]},'userProfileId':_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x88')]},'raw':!![]})[_0xa8e6('0x16')](function(_0x29e40b){if(_[_0xa8e6('0x91')](_0x29e40b)||!_['some'](_0x29e40b,[_0xa8e6('0x8b'),0x0]))return _0x2136a8;_0x27e547=[];var _0x5b9f27=_(_0x29e40b)[_0xa8e6('0x34')](function(_0x437d3b){if(_0x437d3b[_0xa8e6('0x8b')]===0x1)return;return _0x437d3b[_0xa8e6('0x37')]===_0xa8e6('0x2f')?_0xa8e6('0x30'):_0xa8e6('0x32');})[_0xa8e6('0x92')]()[_0xa8e6('0x35')]();for(var _0x31ac9f=0x0;_0x31ac9f<_0x2136a8[_0xa8e6('0x50')];_0x31ac9f++){if(!_[_0xa8e6('0x36')](_0x5b9f27,_0x2136a8[_0x31ac9f][_0xa8e6('0x2b')]))return;var _0x547e8c=_0x2136a8[_0x31ac9f][_0xa8e6('0x2b')]==='agent'?_0xa8e6('0x2f'):_0xa8e6('0x31');_0x27e547[_0xa8e6('0x4d')](db['UserProfileResource'][_0xa8e6('0x89')]({'name':_0x2136a8[_0x31ac9f][_0xa8e6('0x37')],'resourceId':_0x2136a8[_0x31ac9f]['id'],'type':_0x547e8c,'sectionId':_[_0xa8e6('0x60')](_0x29e40b,[_0xa8e6('0x37'),_0x547e8c])['id']},{}));}return Promise[_0xa8e6('0x61')](_0x27e547);});})['then'](respondWithResult(_0x211269,0xc9))[_0xa8e6('0x1e')](handleError(_0x211269,null));};exports[_0xa8e6('0x93')]=function(_0x400f71,_0x56b6db){if(_0x400f71['body']['id']){delete _0x400f71[_0xa8e6('0x62')]['id'];}return db['User']['find']({'where':{'id':_0x400f71[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](function(_0x1cb170){if(!_0x1cb170)return null;if(_0x1cb170['id']===_0x400f71[_0xa8e6('0x2e')]['id']){if(!_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x94')]||!_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')]){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x1cb170[_0xa8e6('0x98')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x94')])){throw new db['Sequelize']['ValidationError'](_0xa8e6('0x99'));}if(_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x94')]===_0x400f71['body'][_0xa8e6('0x95')]){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0x9a'));}}else if(_0x400f71[_0xa8e6('0x2e')]['role']===_0xa8e6('0x2c')){if(!_0x400f71['body'][_0xa8e6('0x95')]){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0x9b'));}}else if(_0x400f71[_0xa8e6('0x2e')][_0xa8e6('0x2b')]==='user'){if(!_0x400f71[_0xa8e6('0x62')]['newPassword']){throw new db['Sequelize'][(_0xa8e6('0x97'))](_0xa8e6('0x9b'));}if(_0x1cb170[_0xa8e6('0x2b')]!==_0xa8e6('0x30')){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0xa8e6('0x97'))]('Unauthorized');}return _0x1cb170;})['then'](handleEntityNotFound(_0x56b6db,null))[_0xa8e6('0x16')](function(_0x2703f6){return db[_0xa8e6('0x69')][_0xa8e6('0x9c')]({'attributes':['id',_0xa8e6('0x9d'),'enforcePasswordHistory',_0xa8e6('0x9e')]})[_0xa8e6('0x16')](function(_0x191da1){if(_0x191da1['securePassword'])authService[_0xa8e6('0x6b')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')]);if(!_0x191da1['enforcePasswordHistory']||!_0x2703f6[_0xa8e6('0x9f')])return _0x2703f6;authService[_0xa8e6('0xa0')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')],_0x2703f6[_0xa8e6('0x9f')],_0x191da1[_0xa8e6('0x9e')]);return _0x2703f6;})[_0xa8e6('0x16')](saveUpdates({'password':_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')],'passwordResetAt':_0x400f71[_0xa8e6('0x2e')]['id']==_0x400f71[_0xa8e6('0x63')]['id']?moment():null,'previousPasswords':authService[_0xa8e6('0xa1')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')],_0x2703f6[_0xa8e6('0x9f')])},null));})['then'](respondWithResult(_0x56b6db,null))[_0xa8e6('0x1e')](handleError(_0x56b6db,null));};exports['addQueues']=function(_0x349275,_0x4a6b75){var _0x5421fc=_0x349275[_0xa8e6('0x62')][_0xa8e6('0xa2')];return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x349275[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),'role',_0xa8e6('0xa3'),_0xa8e6('0xa4'),_0xa8e6('0xa5'),_0xa8e6('0xa6')]})[_0xa8e6('0x16')](handleEntityNotFound(_0x4a6b75,null))['then'](function(_0x4c75ee){if(_0x4c75ee){if(!utils[_0xa8e6('0xa7')](_0x5421fc)){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0xa8'));}return _0x4c75ee[_0xa8e6('0xa9')+_['capitalize'](_0x5421fc[_0xa8e6('0xaa')]())+_0xa8e6('0xab')](_0x349275['body']['ids'],{'penalty':_0x349275['body']['penalty']||0x0})[_0xa8e6('0xac')](function(_0xf2c765){for(var _0x883f4b=0x0;_0x883f4b<_0x349275[_0xa8e6('0x62')][_0xa8e6('0x67')]['length'];_0x883f4b+=0x1){var _0x51b65d={'UserId':Number(_0x349275[_0xa8e6('0x63')]['id'])};_0x51b65d[_['capitalize'](_0x5421fc['toLowerCase']())+_0xa8e6('0xad')]=Number(_0x349275[_0xa8e6('0x62')][_0xa8e6('0x67')][_0x883f4b]);socket['emit'](_0xa8e6('0x2e')+_['capitalize'](_0x5421fc['toLowerCase']())+_0xa8e6('0xae'),_0x51b65d);}return _0xf2c765;})[_0xa8e6('0x16')](function(){if(_0x5421fc===_0xa8e6('0xaf')){return db[_0xa8e6('0xb0')][_0xa8e6('0x4e')]({'where':{'id':_0x349275[_0xa8e6('0x62')][_0xa8e6('0x67')]||[]},'raw':!![],'attributes':['id',_0xa8e6('0x37')]});}})[_0xa8e6('0x16')](function(_0x3dd19c){var _0x5e9ed3=_0x4c75ee[_0xa8e6('0x2a')]({'plain':!![]});var _0xb7b7de=[];if(_0x5421fc==='voice'&&_0x5e9ed3[_0xa8e6('0x2b')]===_0xa8e6('0x30')&&_0x5e9ed3[_0xa8e6('0xa3')]){for(let _0x17ba54=0x0;_0x17ba54<_0x3dd19c[_0xa8e6('0x50')];_0x17ba54+=0x1){_0xb7b7de[_0xa8e6('0x4d')]({'membername':_0x5e9ed3[_0xa8e6('0x37')],'UserId':_0x5e9ed3['id'],'queue_name':_0x3dd19c[_0x17ba54]['name'],'VoiceQueueId':_0x3dd19c[_0x17ba54]['id'],'interface':_[_0xa8e6('0x6d')](_0x5e9ed3[_0xa8e6('0xa6')])?util[_0xa8e6('0xb1')](_0xa8e6('0xb2'),_0x5e9ed3[_0xa8e6('0x37')]):_0x5e9ed3[_0xa8e6('0xa6')],'paused':_0x5e9ed3[_0xa8e6('0xa5')]||![],'penalty':_0x349275[_0xa8e6('0x62')][_0xa8e6('0xb3')]||0x0});}return Promise['all'](_0xb7b7de[_0xa8e6('0x34')](function(_0x5abda4){return db[_0xa8e6('0xb4')][_0xa8e6('0xb5')](_0x5abda4);}));}return _0x4c75ee;});}})[_0xa8e6('0x16')](respondWithStatusCode(_0x4a6b75,null))[_0xa8e6('0x1e')](handleError(_0x4a6b75,null));};exports[_0xa8e6('0xb6')]=function(_0x5dce1b,_0x4819c7){var _0x2d6dfd,_0x24d6aa;return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x5dce1b[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b')]})['then'](handleEntityNotFound(_0x4819c7,null))['then'](function(_0x5bdca1){if(_0x5bdca1){_0x2d6dfd=_0x5bdca1;if(!_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0xa2')]||!utils[_0xa8e6('0xa7')](_0x5dce1b['query'][_0xa8e6('0xa2')])){throw new db[(_0xa8e6('0x96'))]['ValidationError']('Unknown\x20channel');}return _0x5bdca1[_0xa8e6('0xb7')+_[_0xa8e6('0xb8')](_0x5dce1b[_0xa8e6('0x47')]['channel']['toLowerCase']())+_0xa8e6('0xab')](_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0x67')]);}})[_0xa8e6('0x16')](function(_0x2843fa){if(_[_0xa8e6('0xb9')](_0x5dce1b[_0xa8e6('0x47')]['ids'])){for(var _0x45eeb1=0x0;_0x45eeb1<_0x5dce1b['query'][_0xa8e6('0x67')]['length'];_0x45eeb1+=0x1){_0x24d6aa={'UserId':Number(_0x5dce1b['params']['id'])};_0x24d6aa[_['capitalize'](_0x5dce1b[_0xa8e6('0x47')]['channel'][_0xa8e6('0xaa')]())+_0xa8e6('0xad')]=Number(_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0x67')][_0x45eeb1]);socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_[_0xa8e6('0xb8')](_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0xa2')][_0xa8e6('0xaa')]())+_0xa8e6('0xba'),_0x24d6aa);}}else{_0x24d6aa={'UserId':Number(_0x5dce1b['params']['id'])};_0x24d6aa[_[_0xa8e6('0xb8')](_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0xa2')][_0xa8e6('0xaa')]())+_0xa8e6('0xad')]=Number(_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0x67')]);socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_[_0xa8e6('0xb8')](_0x5dce1b['query']['channel']['toLowerCase']())+_0xa8e6('0xba'),_0x24d6aa);}return _0x2843fa;})[_0xa8e6('0x16')](function(){if(_0x5dce1b[_0xa8e6('0x47')]['channel']===_0xa8e6('0xaf')){return db[_0xa8e6('0xb4')][_0xa8e6('0x39')]({'where':{'UserId':_0x5dce1b[_0xa8e6('0x63')]['id'],'VoiceQueueId':_0x5dce1b[_0xa8e6('0x47')]['ids']},'individualHooks':!![]})['then'](function(){return _0x2d6dfd;});}return _0x2d6dfd;})['then'](respondWithStatusCode(_0x4819c7,null))[_0xa8e6('0x1e')](handleError(_0x4819c7,null));};exports[_0xa8e6('0xbb')]=function(_0x4e9ff4,_0x119f65){_0x4e9ff4[_0xa8e6('0x62')][_0xa8e6('0xbc')]=_0x4e9ff4[_0xa8e6('0xbd')][_0xa8e6('0xbe')];return db[_0xa8e6('0x46')]['find']({'where':{'id':_0x4e9ff4['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x119f65,null))[_0xa8e6('0x16')](saveUpdates(_0x4e9ff4[_0xa8e6('0x62')],null))[_0xa8e6('0x16')](respondWithResult(_0x119f65,null))[_0xa8e6('0x1e')](handleError(_0x119f65,null));};exports[_0xa8e6('0xbf')]=function(_0x1859e9,_0x10fe3d){var _0x40d0e0=path[_0xa8e6('0xc0')](config[_0xa8e6('0xc1')],_0xa8e6('0xc2'));return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x1859e9['params']['id']},'attributes':['id',_0xa8e6('0xbc')],'raw':!![]})[_0xa8e6('0x16')](handleEntityNotFound(_0x10fe3d,null))[_0xa8e6('0x16')](function(_0x1d6852){if(_0x1d6852){if(_[_0xa8e6('0x6d')](_0x1d6852['userpic'])){return _0x10fe3d[_0xa8e6('0xc3')](_0x40d0e0);}else{if(!fs[_0xa8e6('0xc4')](path['join'](config[_0xa8e6('0xc1')],_0xa8e6('0xc5'),_0x1d6852[_0xa8e6('0xbc')]))){return _0x10fe3d['download'](_0x40d0e0);}return _0x10fe3d[_0xa8e6('0xc3')](path[_0xa8e6('0xc0')](config['root'],_0xa8e6('0xc5'),_0x1d6852[_0xa8e6('0xbc')]));}}})[_0xa8e6('0x1e')](handleError(_0x10fe3d,null));};exports['getOpenTabs']=function(_0x309cc6,_0x28792f){return db['User'][_0xa8e6('0x60')]({'where':{'id':_0x309cc6[_0xa8e6('0x63')]['id']},'attributes':['id']})[_0xa8e6('0x16')](handleEntityNotFound(_0x28792f,null))[_0xa8e6('0x16')](function(_0x4545d1){var _0x1f00ea=[];values=_0x4545d1[_0xa8e6('0x52')];_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x51'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x53'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea['push'](get_open_tabs(_0xa8e6('0x56'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0xc6'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x54'),_0x4545d1['dataValues']));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x55'),_0x4545d1['dataValues']));return Promise['all'](_0x1f00ea);})['then'](function(_0x230764){if(_0x230764){var _0x25e530=_[_0xa8e6('0x34')](values[_0xa8e6('0xc7')],function(_0xc316cf){return{'channel':_0xa8e6('0xc8'),'id':_0xc316cf['id'],'createdAt':_0xc316cf[_0xa8e6('0xc9')]};});var _0x1c6935=_[_0xa8e6('0x34')](values[_0xa8e6('0xca')],function(_0x12bd0a){return{'channel':'FAX','id':_0x12bd0a['id'],'createdAt':_0x12bd0a[_0xa8e6('0xc9')]};});var _0x3b56f6=_['map'](values[_0xa8e6('0xcb')],function(_0x17d6e9){return{'channel':_0xa8e6('0xcc'),'id':_0x17d6e9['id'],'createdAt':_0x17d6e9[_0xa8e6('0xc9')]};});var _0x34df2a=_[_0xa8e6('0x34')](values[_0xa8e6('0xcd')],function(_0x38bdaf){return{'channel':_0xa8e6('0xce'),'id':_0x38bdaf['id'],'createdAt':_0x38bdaf[_0xa8e6('0xc9')]};});var _0x1e4f1e=_[_0xa8e6('0x34')](values[_0xa8e6('0xcf')],function(_0x502f7f){return{'channel':'SMS','id':_0x502f7f['id'],'createdAt':_0x502f7f[_0xa8e6('0xc9')]};});var _0x1a4bd5=_[_0xa8e6('0x34')](values['WhatsappOpenTabs'],function(_0x4b2181){return{'channel':_0xa8e6('0xd0'),'id':_0x4b2181['id'],'createdAt':_0x4b2181[_0xa8e6('0xc9')]};});var _0x1ecda0=_[_0xa8e6('0xd1')](_0x25e530,_0x1c6935,_0x3b56f6,_0x34df2a,_0x1e4f1e,_0x1a4bd5);var _0x4b2fb8={'count':_0x1ecda0[_0xa8e6('0x50')],'rows':_0x1ecda0};return _0x4b2fb8;}else return null;})[_0xa8e6('0x16')](respondWithResult(_0x28792f,null))[_0xa8e6('0x1e')](handleError(_0x28792f,null));};exports[_0xa8e6('0xd2')]=function(_0x31ad1f,_0x980008){var _0x4a0e29={};var _0x3c6922={};var _0x3f052a;var _0x87127a;return db['User'][_0xa8e6('0x9c')]({'where':{'id':_0x31ad1f[_0xa8e6('0x63')]['id']}})['then'](handleEntityNotFound(_0x980008,null))[_0xa8e6('0x16')](function(_0x6ff05b){if(_0x6ff05b){_0x3f052a=_0x6ff05b;_0x3c6922[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0xd3')]['rawAttributes']);_0x3c6922['query']=_['keys'](_0x31ad1f[_0xa8e6('0x47')]);_0x3c6922[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x3c6922[_0xa8e6('0x5b')],_0x3c6922[_0xa8e6('0x47')]);_0x4a0e29[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x3c6922[_0xa8e6('0x5b')],qs['fields'](_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x4a0e29[_0xa8e6('0x4c')]=_0x4a0e29[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x4a0e29[_0xa8e6('0x4c')]:_0x3c6922['model'];_0x4a0e29['order']=qs[_0xa8e6('0xd4')](_0x31ad1f[_0xa8e6('0x47')]['sort']);_0x4a0e29[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x31ad1f[_0xa8e6('0x47')],_0x3c6922[_0xa8e6('0x59')]));if(_0x31ad1f['query'][_0xa8e6('0x33')]){_0x4a0e29[_0xa8e6('0x45')]=_['merge'](_0x4a0e29['where'],{'$or':_[_0xa8e6('0x34')](_0x4a0e29[_0xa8e6('0x4c')],function(_0x1b4cbf){var _0x39f614={};_0x39f614[_0x1b4cbf]={'$like':'%'+_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x39f614;})});}_0x4a0e29=_[_0xa8e6('0x5e')]({},_0x4a0e29,_0x31ad1f[_0xa8e6('0x5f')]);return _0x3f052a['getContacts'](_0x4a0e29);}})['then'](function(_0x4fd2d3){if(_0x4fd2d3){_0x87127a=_0x4fd2d3[_0xa8e6('0x50')];if(_0x31ad1f[_0xa8e6('0x47')]['hasOwnProperty'](_0xa8e6('0x48'))){_0x4a0e29[_0xa8e6('0x4b')]=[{'model':db[_0xa8e6('0xd6')],'as':_0xa8e6('0xd7'),'required':![]},{'model':db[_0xa8e6('0xd8')],'as':'Tags','attributes':['id',_0xa8e6('0x37'),_0xa8e6('0xd9')],'where':_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0xda')]?{'id':_0x31ad1f['query'][_0xa8e6('0xda')]}:undefined,'required':_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0xda')]?!![]:![]}];}if(!_0x31ad1f['query']['hasOwnProperty'](_0xa8e6('0xdb'))){_0x4a0e29['limit']=qs[_0xa8e6('0x23')](_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x4a0e29[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x3f052a['getContacts'](_0x4a0e29);}})[_0xa8e6('0x16')](function(_0x1974e8){if(_0x1974e8){return _0x1974e8?{'count':_0x87127a,'rows':_0x1974e8}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x980008,null))[_0xa8e6('0x1e')](handleError(_0x980008,null));};exports[_0xa8e6('0xdc')]=function(_0x2b7625,_0xf576d7){var _0x1f1f11;var _0x4ae581={};var _0x5e948c;return db['User']['findOne']({'where':{'id':_0x2b7625[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b')]})[_0xa8e6('0x16')](handleEntityNotFound(_0xf576d7,null))[_0xa8e6('0x16')](function(_0x15ec93){if(!utils['isValidChannel'](_0x2b7625[_0xa8e6('0x47')]['channel'])){throw new db['Sequelize'][(_0xa8e6('0x97'))](_0xa8e6('0xa8'));}_0x1f1f11=_0x15ec93;var _0x2c1fa9={};_0x2c1fa9[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xdd')][_0xa8e6('0x3e')]);_0x2c1fa9['query']=_['keys'](_0x2b7625['query']);_0x2c1fa9[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x2c1fa9[_0xa8e6('0x5b')],_0x2c1fa9['query']);_0x4ae581['attributes']=_[_0xa8e6('0x5a')](_0x2c1fa9[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x4ae581[_0xa8e6('0x4c')]=_0x4ae581[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x4ae581[_0xa8e6('0x4c')]:_0x2c1fa9[_0xa8e6('0x5b')];_0x4ae581[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x2b7625['query'][_0xa8e6('0xd4')]);_0x4ae581['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x2b7625[_0xa8e6('0x47')],_0x2c1fa9[_0xa8e6('0x59')]));if(_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x4ae581['where']=_[_0xa8e6('0x5e')](_0x4ae581['where'],{'$or':_[_0xa8e6('0x34')](_0x4ae581['attributes'],function(_0x482d0d){var _0x32d47b={};_0x32d47b[_0x482d0d]={'$like':'%'+_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x32d47b;})});}_0x4ae581=_[_0xa8e6('0x5e')]({},_0x4ae581,_0x2b7625[_0xa8e6('0x5f')]);switch(_0x1f1f11[_0xa8e6('0x2b')]){case'admin':return db[_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xdd')][_0xa8e6('0x4e')](_0x4ae581);case _0xa8e6('0x2e'):case _0xa8e6('0x30'):return _0x1f1f11[_0xa8e6('0x2a')+_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xab')](_0x4ae581);default:throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0xdf'));}})[_0xa8e6('0x16')](function(_0x550a69){_0x5e948c=_0x550a69[_0xa8e6('0x50')];if(!_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x4ae581[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x2b7625[_0xa8e6('0x47')]['limit']);_0x4ae581[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x21')]);}switch(_0x1f1f11[_0xa8e6('0x2b')]){case _0xa8e6('0x2c'):return db[_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+'Queue'][_0xa8e6('0x4e')](_0x4ae581);case _0xa8e6('0x2e'):case _0xa8e6('0x30'):return _0x1f1f11[_0xa8e6('0x2a')+_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xab')](_0x4ae581);}})[_0xa8e6('0x16')](function(_0x4f2d34){return{'count':_0x5e948c,'rows':_0x4f2d34};})['then'](respondWithResult(_0xf576d7,null))[_0xa8e6('0x1e')](handleError(_0xf576d7,null));};exports['getVoiceQueuesRt']=function(_0x3521c3,_0x4ffa42){var _0x546b97={};var _0x367c7a={};var _0x46518f;var _0x1f2202;return db[_0xa8e6('0x46')]['findOne']({'where':{'id':_0x3521c3[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x4ffa42,null))[_0xa8e6('0x16')](function(_0x3cb23a){if(_0x3cb23a){_0x46518f=_0x3cb23a;_0x367c7a[_0xa8e6('0x5b')]=_['keys'](db['UserVoiceQueueRt'][_0xa8e6('0x3e')]);_0x367c7a['query']=_[_0xa8e6('0x58')](_0x3521c3[_0xa8e6('0x47')]);_0x367c7a[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x367c7a['model'],_0x367c7a[_0xa8e6('0x47')]);_0x546b97[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x367c7a[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x3521c3['query'][_0xa8e6('0x5c')]));_0x546b97[_0xa8e6('0x4c')]=_0x546b97[_0xa8e6('0x4c')]['length']?_0x546b97['attributes']:_0x367c7a['model'];_0x546b97['order']=qs[_0xa8e6('0xd4')](_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x546b97[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x3521c3[_0xa8e6('0x47')],_0x367c7a['filters']));if(_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x546b97['where']=_[_0xa8e6('0x5e')](_0x546b97[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x546b97[_0xa8e6('0x4c')],function(_0x266a2e){var _0x5becab={};_0x5becab[_0x266a2e]={'$like':'%'+_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x5becab;})});}_0x546b97=_['merge']({},_0x546b97,_0x3521c3[_0xa8e6('0x5f')]);return _0x46518f[_0xa8e6('0xe1')](_0x546b97);}})[_0xa8e6('0x16')](function(_0x349156){if(_0x349156){_0x1f2202=_0x349156[_0xa8e6('0x50')];if(!_0x3521c3['query'][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x546b97[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x3521c3[_0xa8e6('0x47')]['limit']);_0x546b97[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x46518f[_0xa8e6('0xe1')](_0x546b97);}})[_0xa8e6('0x16')](function(_0x118c54){if(_0x118c54){return _0x118c54?{'count':_0x1f2202,'rows':_0x118c54}:null;}})['then'](respondWithResult(_0x4ffa42,null))[_0xa8e6('0x1e')](handleError(_0x4ffa42,null));};exports['getGroups']=function(_0x44bb4a,_0x5a8f59){var _0x1f5745={};var _0x7f43f3={};var _0x179bcc;var _0x512086;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x44bb4a[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x5a8f59,null))['then'](function(_0x467767){if(_0x467767){_0x179bcc=_0x467767;_0x7f43f3[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0xe2')][_0xa8e6('0x3e')]);_0x7f43f3[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x44bb4a['query']);_0x7f43f3['filters']=_[_0xa8e6('0x5a')](_0x7f43f3[_0xa8e6('0x5b')],_0x7f43f3[_0xa8e6('0x47')]);_0x1f5745[_0xa8e6('0x4c')]=_['intersection'](_0x7f43f3[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x1f5745['attributes']=_0x1f5745['attributes'][_0xa8e6('0x50')]?_0x1f5745[_0xa8e6('0x4c')]:_0x7f43f3['model'];_0x1f5745[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x44bb4a['query']['sort']);_0x1f5745[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x44bb4a['query'],_0x7f43f3[_0xa8e6('0x59')]));if(_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x1f5745[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x1f5745[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x1f5745[_0xa8e6('0x4c')],function(_0x958be1){var _0x2c5dd0={};_0x2c5dd0[_0x958be1]={'$like':'%'+_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x2c5dd0;})});}_0x1f5745=_[_0xa8e6('0x5e')]({},_0x1f5745,_0x44bb4a[_0xa8e6('0x5f')]);return _0x179bcc[_0xa8e6('0xe3')](_0x1f5745);}})[_0xa8e6('0x16')](function(_0x2b138c){if(_0x2b138c){_0x512086=_0x2b138c['length'];if(!_0x44bb4a['query'][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x1f5745[_0xa8e6('0x23')]=qs['limit'](_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x1f5745[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x179bcc[_0xa8e6('0xe3')](_0x1f5745);}})[_0xa8e6('0x16')](function(_0x790379){if(_0x790379){return _0x790379?{'count':_0x512086,'rows':_0x790379}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x5a8f59,null))[_0xa8e6('0x1e')](handleError(_0x5a8f59,null));};exports[_0xa8e6('0xe4')]=function(_0x45c04e,_0x4d820f){var _0x19b0e1={'raw':!![],'where':{}};var _0x67142b={};var _0x3218c5={'count':0x0,'rows':[]};return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x45c04e[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x4d820f,null))[_0xa8e6('0x16')](function(_0x49c5bb){if(_0x49c5bb){_0x67142b[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xe5')][_0xa8e6('0x3e')]);_0x67142b[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x45c04e[_0xa8e6('0x47')]);_0x67142b[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x67142b['model'],_0x67142b['query']);_0x19b0e1[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x67142b['model'],qs[_0xa8e6('0x5c')](_0x45c04e['query'][_0xa8e6('0x5c')]));_0x19b0e1['attributes']=_0x19b0e1[_0xa8e6('0x4c')]['length']?_0x19b0e1[_0xa8e6('0x4c')]:_0x67142b[_0xa8e6('0x5b')];if(!_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x19b0e1[_0xa8e6('0x23')]=qs['limit'](_0x45c04e['query']['limit']);_0x19b0e1[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0x21')]);}_0x19b0e1[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x45c04e['query'][_0xa8e6('0xd4')]);_0x19b0e1['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x45c04e[_0xa8e6('0x47')],_0x67142b[_0xa8e6('0x59')]));_0x19b0e1['where']['UserId']=_0x49c5bb['id'];if(_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x19b0e1[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x19b0e1[_0xa8e6('0x45')],{'$or':_['map'](_0x19b0e1[_0xa8e6('0x4c')],function(_0x3e0c5f){var _0x48c28a={};_0x48c28a[_0x3e0c5f]={'$like':'%'+_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x48c28a;})});}_0x19b0e1=_['merge']({},_0x19b0e1,_0x45c04e[_0xa8e6('0x5f')]);return db[_0xa8e6('0xe5')]['count']({'where':_0x19b0e1[_0xa8e6('0x45')]})[_0xa8e6('0x16')](function(_0x30cb17){_0x3218c5[_0xa8e6('0x24')]=_0x30cb17;if(_0x45c04e['query'][_0xa8e6('0x48')]){_0x19b0e1['include']=[{'all':!![]}];}return db[_0xa8e6('0xe5')][_0xa8e6('0x4e')](_0x19b0e1);})[_0xa8e6('0x16')](function(_0x57d090){_0x3218c5['rows']=_0x57d090;return _0x3218c5;});}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x4d820f,_0x19b0e1))[_0xa8e6('0x1e')](handleError(_0x4d820f,null));};exports['getScreenRecordings']=function(_0x223f5c,_0x14965){var _0x460dde={'raw':!![],'where':{}};var _0x28c899={};var _0x3067bb={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x223f5c['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x14965,null))['then'](function(_0x12755f){if(_0x12755f){_0x28c899[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0xe6')][_0xa8e6('0x3e')]);_0x28c899[_0xa8e6('0x47')]=_['keys'](_0x223f5c[_0xa8e6('0x47')]);_0x28c899[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x28c899[_0xa8e6('0x5b')],_0x28c899[_0xa8e6('0x47')]);_0x460dde[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x28c899['model'],qs[_0xa8e6('0x5c')](_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x460dde[_0xa8e6('0x4c')]=_0x460dde[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x460dde[_0xa8e6('0x4c')]:_0x28c899[_0xa8e6('0x5b')];if(!_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x460dde['limit']=qs['limit'](_0x223f5c[_0xa8e6('0x47')]['limit']);_0x460dde[_0xa8e6('0x21')]=qs['offset'](_0x223f5c['query'][_0xa8e6('0x21')]);}_0x460dde[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x460dde[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x223f5c[_0xa8e6('0x47')],_0x28c899['filters']));_0x460dde[_0xa8e6('0x45')]['UserId']=_0x12755f['id'];if(_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x460dde['where']=_['merge'](_0x460dde['where'],{'$or':_[_0xa8e6('0x34')](_0x460dde[_0xa8e6('0x4c')],function(_0x386a3e){var _0x1fb358={};_0x1fb358[_0x386a3e]={'$like':'%'+_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x1fb358;})});}_0x460dde=_[_0xa8e6('0x5e')]({},_0x460dde,_0x223f5c[_0xa8e6('0x5f')]);return db[_0xa8e6('0xe6')][_0xa8e6('0x24')]({'where':_0x460dde[_0xa8e6('0x45')]})[_0xa8e6('0x16')](function(_0x3fb1e3){_0x3067bb['count']=_0x3fb1e3;if(_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x48')]){_0x460dde['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xa8e6('0x4e')](_0x460dde);})['then'](function(_0x93dbab){_0x3067bb['rows']=_0x93dbab;return _0x3067bb;});}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x14965,_0x460dde))[_0xa8e6('0x1e')](handleError(_0x14965,null));};exports[_0xa8e6('0xe7')]=function(_0x896a51,_0x54bd73){var _0x2efd8e={};var _0x16d3ee={};var _0x26d07d;var _0x3a0750;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x896a51[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x54bd73,null))[_0xa8e6('0x16')](function(_0x279954){if(_0x279954){_0x26d07d=_0x279954;_0x16d3ee[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xe8')][_0xa8e6('0x3e')]);_0x16d3ee['query']=_[_0xa8e6('0x58')](_0x896a51[_0xa8e6('0x47')]);_0x16d3ee['filters']=_['intersection'](_0x16d3ee[_0xa8e6('0x5b')],_0x16d3ee[_0xa8e6('0x47')]);_0x2efd8e['attributes']=_['intersection'](_0x16d3ee[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x896a51['query'][_0xa8e6('0x5c')]));_0x2efd8e[_0xa8e6('0x4c')]=_0x2efd8e[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x2efd8e['attributes']:_0x16d3ee['model'];_0x2efd8e[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x896a51[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x2efd8e[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x896a51[_0xa8e6('0x47')],_0x16d3ee['filters']));if(_0x896a51[_0xa8e6('0x47')]['filter']){_0x2efd8e[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x2efd8e['where'],{'$or':_[_0xa8e6('0x34')](_0x2efd8e[_0xa8e6('0x4c')],function(_0x4262a6){var _0xbdef0f={};_0xbdef0f[_0x4262a6]={'$like':'%'+_0x896a51[_0xa8e6('0x47')]['filter']+'%'};return _0xbdef0f;})});}_0x2efd8e=_['merge']({},_0x2efd8e,_0x896a51[_0xa8e6('0x5f')]);return _0x26d07d['getChatInteractions'](_0x2efd8e);}})[_0xa8e6('0x16')](function(_0x55f22f){if(_0x55f22f){_0x3a0750=_0x55f22f['length'];if(!_0x896a51[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x2efd8e[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x896a51['query'][_0xa8e6('0x23')]);_0x2efd8e[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x896a51[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x26d07d['getChatInteractions'](_0x2efd8e);}})['then'](function(_0x5e5035){if(_0x5e5035){return _0x5e5035?{'count':_0x3a0750,'rows':_0x5e5035}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x54bd73,null))[_0xa8e6('0x1e')](handleError(_0x54bd73,null));};exports[_0xa8e6('0xe9')]=function(_0x586fa8,_0x19e3ac){var _0xbe5a47={};var _0x225f93={};var _0x38d235;var _0x9f5d92;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x586fa8[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x19e3ac,null))['then'](function(_0x52ff02){if(_0x52ff02){_0x38d235=_0x52ff02;_0x225f93[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xea')][_0xa8e6('0x3e')]);_0x225f93[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x586fa8[_0xa8e6('0x47')]);_0x225f93['filters']=_['intersection'](_0x225f93[_0xa8e6('0x5b')],_0x225f93[_0xa8e6('0x47')]);_0xbe5a47['attributes']=_[_0xa8e6('0x5a')](_0x225f93[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0xbe5a47['attributes']=_0xbe5a47[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0xbe5a47[_0xa8e6('0x4c')]:_0x225f93[_0xa8e6('0x5b')];_0xbe5a47[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x586fa8[_0xa8e6('0x47')]['sort']);_0xbe5a47[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x586fa8[_0xa8e6('0x47')],_0x225f93[_0xa8e6('0x59')]));if(_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0xbe5a47[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0xbe5a47[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0xbe5a47[_0xa8e6('0x4c')],function(_0x53579b){var _0x4d5552={};_0x4d5552[_0x53579b]={'$like':'%'+_0x586fa8[_0xa8e6('0x47')]['filter']+'%'};return _0x4d5552;})});}_0xbe5a47=_['merge']({},_0xbe5a47,_0x586fa8[_0xa8e6('0x5f')]);return _0x38d235[_0xa8e6('0xe9')](_0xbe5a47);}})[_0xa8e6('0x16')](function(_0x5545f8){if(_0x5545f8){_0x9f5d92=_0x5545f8[_0xa8e6('0x50')];if(!_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0xbe5a47[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x586fa8[_0xa8e6('0x47')]['limit']);_0xbe5a47[_0xa8e6('0x21')]=qs['offset'](_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x38d235[_0xa8e6('0xe9')](_0xbe5a47);}})[_0xa8e6('0x16')](function(_0x54de2f){if(_0x54de2f){return _0x54de2f?{'count':_0x9f5d92,'rows':_0x54de2f}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x19e3ac,null))['catch'](handleError(_0x19e3ac,null));};exports[_0xa8e6('0xeb')]=function(_0x44664b,_0x113396){var _0x56aa21={'raw':!![],'where':{}};var _0x3202ef={};var _0xd84e2b={'count':0x0,'rows':[]};return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x44664b['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x113396,null))[_0xa8e6('0x16')](function(_0x4715e0){if(_0x4715e0){_0x3202ef[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db['MailInteraction'][_0xa8e6('0x3e')]);_0x3202ef[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x44664b['query']);_0x3202ef[_0xa8e6('0x59')]=_['intersection'](_0x3202ef[_0xa8e6('0x5b')],_0x3202ef['query']);_0x56aa21[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x3202ef[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x44664b[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x56aa21[_0xa8e6('0x4c')]=_0x56aa21['attributes']['length']?_0x56aa21[_0xa8e6('0x4c')]:_0x3202ef[_0xa8e6('0x5b')];if(!_0x44664b['query']['hasOwnProperty'](_0xa8e6('0xdb'))){_0x56aa21[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x44664b[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x56aa21[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x44664b['query'][_0xa8e6('0x21')]);}_0x56aa21[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x44664b[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x56aa21[_0xa8e6('0x45')]=qs['filters'](_['pick'](_0x44664b[_0xa8e6('0x47')],_0x3202ef['filters']));_0x56aa21[_0xa8e6('0x45')]['UserId']=_0x4715e0['id'];if(_0x44664b[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x56aa21['where']=_['merge'](_0x56aa21[_0xa8e6('0x45')],{'$or':_['map'](_0x56aa21[_0xa8e6('0x4c')],function(_0x486b02){var _0x1205a6={};_0x1205a6[_0x486b02]={'$like':'%'+_0x44664b[_0xa8e6('0x47')]['filter']+'%'};return _0x1205a6;})});}_0x56aa21=_[_0xa8e6('0x5e')]({},_0x56aa21,_0x44664b[_0xa8e6('0x5f')]);return db['MailInteraction'][_0xa8e6('0x24')]({'where':_0x56aa21[_0xa8e6('0x45')]})[_0xa8e6('0x16')](function(_0x2d07f9){_0xd84e2b[_0xa8e6('0x24')]=_0x2d07f9;if(_0x44664b['query'][_0xa8e6('0x48')]){_0x56aa21[_0xa8e6('0x4b')]=[{'all':!![]}];}return db[_0xa8e6('0xec')][_0xa8e6('0x4e')](_0x56aa21);})['then'](function(_0x4f3580){_0xd84e2b['rows']=_0x4f3580;return _0xd84e2b;});}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x113396,_0x56aa21))['catch'](handleError(_0x113396,null));};exports[_0xa8e6('0xed')]=function(_0x316087,_0x3e706e){var _0x5ae97f={};var _0x522559={};var _0x518d91;var _0x50d63f;return db[_0xa8e6('0x46')]['findOne']({'where':{'id':_0x316087[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x3e706e,null))[_0xa8e6('0x16')](function(_0x11104d){if(_0x11104d){_0x518d91=_0x11104d;_0x522559[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xee')][_0xa8e6('0x3e')]);_0x522559[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x316087[_0xa8e6('0x47')]);_0x522559[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x522559['model'],_0x522559['query']);_0x5ae97f['attributes']=_[_0xa8e6('0x5a')](_0x522559[_0xa8e6('0x5b')],qs['fields'](_0x316087[_0xa8e6('0x47')]['fields']));_0x5ae97f[_0xa8e6('0x4c')]=_0x5ae97f[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x5ae97f['attributes']:_0x522559['model'];_0x5ae97f['order']=qs[_0xa8e6('0xd4')](_0x316087[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x5ae97f[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x316087[_0xa8e6('0x47')],_0x522559[_0xa8e6('0x59')]));if(_0x316087[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x5ae97f['where']=_[_0xa8e6('0x5e')](_0x5ae97f['where'],{'$or':_[_0xa8e6('0x34')](_0x5ae97f[_0xa8e6('0x4c')],function(_0xc98bfe){var _0x2ed9dc={};_0x2ed9dc[_0xc98bfe]={'$like':'%'+_0x316087['query'][_0xa8e6('0x33')]+'%'};return _0x2ed9dc;})});}_0x5ae97f=_[_0xa8e6('0x5e')]({},_0x5ae97f,_0x316087['options']);return _0x518d91['getSmsInteractions'](_0x5ae97f);}})['then'](function(_0x2db1a4){if(_0x2db1a4){_0x50d63f=_0x2db1a4[_0xa8e6('0x50')];if(!_0x316087[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x5ae97f['limit']=qs[_0xa8e6('0x23')](_0x316087[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x5ae97f[_0xa8e6('0x21')]=qs['offset'](_0x316087[_0xa8e6('0x47')]['offset']);}return _0x518d91[_0xa8e6('0xed')](_0x5ae97f);}})[_0xa8e6('0x16')](function(_0x445a41){if(_0x445a41){return _0x445a41?{'count':_0x50d63f,'rows':_0x445a41}:null;}})['then'](respondWithResult(_0x3e706e,null))[_0xa8e6('0x1e')](handleError(_0x3e706e,null));};exports[_0xa8e6('0xef')]=function(_0x4d107f,_0x354c2e){var _0x3bd08a={};var _0x1cafe9={};var _0xe5aed6;var _0x39a374;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x4d107f['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x354c2e,null))[_0xa8e6('0x16')](function(_0x5347d9){if(_0x5347d9){_0xe5aed6=_0x5347d9;_0x1cafe9[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xf0')][_0xa8e6('0x3e')]);_0x1cafe9[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x4d107f['query']);_0x1cafe9['filters']=_[_0xa8e6('0x5a')](_0x1cafe9[_0xa8e6('0x5b')],_0x1cafe9['query']);_0x3bd08a[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x1cafe9[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x4d107f[_0xa8e6('0x47')]['fields']));_0x3bd08a[_0xa8e6('0x4c')]=_0x3bd08a[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x3bd08a[_0xa8e6('0x4c')]:_0x1cafe9['model'];_0x3bd08a[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x4d107f['query'][_0xa8e6('0xd4')]);_0x3bd08a['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x4d107f[_0xa8e6('0x47')],_0x1cafe9[_0xa8e6('0x59')]));if(_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x3bd08a[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x3bd08a[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x3bd08a[_0xa8e6('0x4c')],function(_0x1b502e){var _0x1306b1={};_0x1306b1[_0x1b502e]={'$like':'%'+_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x1306b1;})});}_0x3bd08a=_[_0xa8e6('0x5e')]({},_0x3bd08a,_0x4d107f[_0xa8e6('0x5f')]);return _0xe5aed6[_0xa8e6('0xef')](_0x3bd08a);}})[_0xa8e6('0x16')](function(_0x419c73){if(_0x419c73){_0x39a374=_0x419c73[_0xa8e6('0x50')];if(!_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x3bd08a[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x3bd08a['offset']=qs[_0xa8e6('0x21')](_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0xe5aed6['getFaxInteractions'](_0x3bd08a);}})[_0xa8e6('0x16')](function(_0x5cd008){if(_0x5cd008){return _0x5cd008?{'count':_0x39a374,'rows':_0x5cd008}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x354c2e,null))[_0xa8e6('0x1e')](handleError(_0x354c2e,null));};exports[_0xa8e6('0xf1')]=function(_0xa3409,_0x4bed11){var _0x21a0d9={};var _0x301a47={};var _0x115045;var _0x1c60e9;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0xa3409[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x4bed11,null))[_0xa8e6('0x16')](function(_0x4306a4){if(_0x4306a4){_0x115045=_0x4306a4;_0x301a47[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xf2')]['rawAttributes']);_0x301a47['query']=_['keys'](_0xa3409['query']);_0x301a47[_0xa8e6('0x59')]=_['intersection'](_0x301a47[_0xa8e6('0x5b')],_0x301a47[_0xa8e6('0x47')]);_0x21a0d9[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x301a47[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0xa3409[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x21a0d9[_0xa8e6('0x4c')]=_0x21a0d9[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x21a0d9['attributes']:_0x301a47[_0xa8e6('0x5b')];_0x21a0d9['order']=qs['sort'](_0xa3409['query'][_0xa8e6('0xd4')]);_0x21a0d9[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_['pick'](_0xa3409['query'],_0x301a47[_0xa8e6('0x59')]));if(_0xa3409['query'][_0xa8e6('0x33')]){_0x21a0d9[_0xa8e6('0x45')]=_['merge'](_0x21a0d9[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x21a0d9[_0xa8e6('0x4c')],function(_0x13b623){var _0x5f479d={};_0x5f479d[_0x13b623]={'$like':'%'+_0xa3409[_0xa8e6('0x47')]['filter']+'%'};return _0x5f479d;})});}_0x21a0d9=_['merge']({},_0x21a0d9,_0xa3409[_0xa8e6('0x5f')]);return _0x115045[_0xa8e6('0xf1')](_0x21a0d9);}})[_0xa8e6('0x16')](function(_0x3be0ed){if(_0x3be0ed){_0x1c60e9=_0x3be0ed[_0xa8e6('0x50')];if(!_0xa3409[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x21a0d9['limit']=qs[_0xa8e6('0x23')](_0xa3409['query'][_0xa8e6('0x23')]);_0x21a0d9[_0xa8e6('0x21')]=qs['offset'](_0xa3409[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x115045[_0xa8e6('0xf1')](_0x21a0d9);}})['then'](function(_0x1740b6){if(_0x1740b6){return _0x1740b6?{'count':_0x1c60e9,'rows':_0x1740b6}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x4bed11,null))[_0xa8e6('0x1e')](handleError(_0x4bed11,null));};exports['login']=function(_0x584a11,_0x371c14,_0x1edb10){var _0x45c490;var _0x546a09;var _0x48ba62;var _0x579c0d=!_[_0xa8e6('0x6d')](_0x584a11['params']['id'])?_0x584a11['params']['id']:!_[_0xa8e6('0x6d')](_0x584a11[_0xa8e6('0x2e')]['id'])?_0x584a11[_0xa8e6('0x2e')]['id']:null;return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x579c0d,'role':{'$or':['admin',_0xa8e6('0x2e'),_0xa8e6('0x30')]}},'attributes':['id',_0xa8e6('0x37'),'phone',_0xa8e6('0xf3'),_0xa8e6('0x2b'),_0xa8e6('0x68'),'loginInPause']})[_0xa8e6('0x16')](function(_0x2b2694){if(_0x2b2694){if(_0x2b2694[_0xa8e6('0x2b')]===_0xa8e6('0x30')){_0x45c490=_0x2b2694;if(_0x584a11[_0xa8e6('0x62')]['interface']){_0x48ba62=util[_0xa8e6('0xb1')](_0xa8e6('0xf4'),_0x45c490[_0x584a11['body'][_0xa8e6('0xa6')]]);}else if(_0x584a11[_0xa8e6('0x62')][_0xa8e6('0xf5')]){_0x48ba62=util[_0xa8e6('0xb1')](_0xa8e6('0xb2'),_0x584a11[_0xa8e6('0x62')][_0xa8e6('0xf5')]);}else{_0x48ba62=util[_0xa8e6('0xb1')](_0xa8e6('0xb2'),_0x45c490[_0xa8e6('0x37')]);}socket['to'](util[_0xa8e6('0xb1')]('user:%s',_0x45c490['name']))[_0xa8e6('0x28')](_0xa8e6('0xf6'),{'user':{'id':_0x45c490['id'],'name':_0x45c490[_0xa8e6('0x37')]},'ip':_0x584a11[_0xa8e6('0xf7')][_0xa8e6('0xf8')]||_0x584a11[_0xa8e6('0xf9')][_0xa8e6('0xfa')]||_0x584a11[_0xa8e6('0xfb')][_0xa8e6('0xfa')]||_0x584a11[_0xa8e6('0xf9')][_0xa8e6('0xfb')][_0xa8e6('0xfa')]});return db['UserVoiceQueueRt'][_0xa8e6('0x39')]({'where':{'membername':_0x45c490[_0xa8e6('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xa8e6('0x96'))]['ValidationError'](_0xa8e6('0xfc'));}})[_0xa8e6('0x16')](function(){if(_0x45c490){return _0x45c490['getVoiceQueues']({'raw':!![]});}})[_0xa8e6('0x16')](function(_0x277471){if(_0x45c490){if(_0x277471){_0x546a09=_0x277471;if(_0x546a09['length']){var _0x513834=_0x546a09[_0xa8e6('0x34')](function(_0x12a03a){var _0x40f130={'membername':_0x45c490['name'],'UserId':_0x45c490['id'],'queue_name':_0x12a03a['name'],'VoiceQueueId':_0x12a03a['id'],'interface':_0x48ba62,'paused':_0x45c490[_0xa8e6('0xa4')]||![],'penalty':_0x12a03a[_0xa8e6('0xfd')]||0x0};return db[_0xa8e6('0xb4')][_0xa8e6('0xb5')](_0x40f130);});return Promise['all'](_0x513834);}}}})['then'](function(){if(_0x45c490){return db[_0xa8e6('0xfe')][_0xa8e6('0x4e')]({'where':{'membername':_0x45c490[_0xa8e6('0x37')],'exitAt':null}});}})[_0xa8e6('0x16')](function(_0x498ae5){if(_0x45c490){var _0x2fef0d=[];_0x498ae5[_0xa8e6('0xff')](function(_0x154c48){_0x2fef0d[_0xa8e6('0x4d')](_0x154c48[_0xa8e6('0x27')]({'exitAt':moment()[_0xa8e6('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xa8e6('0x61')](_0x2fef0d);}})[_0xa8e6('0x16')](function(){if(_0x45c490){var _0x306fa4=[];var _0x437165=[];var _0x39631d=utils[_0xa8e6('0x100')]();var _0x45453c={'membername':_0x45c490['name'],'interface':_0x48ba62,'enterAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101')),'role':_0x45c490['role'],'internal':_0x45c490['internal']};_0x39631d['forEach'](function(_0x8eb36e){_0x306fa4['push'](_[_0xa8e6('0x5e')]({'channel':_0x8eb36e,'type':_0xa8e6('0x102'),'data1':_0x584a11[_0xa8e6('0x62')][_0xa8e6('0x103')],'data2':_0x48ba62},_0x45453c));if(_0x45c490[_0xa8e6('0xa4')]){_0x437165[_0xa8e6('0x4d')](_[_0xa8e6('0x5e')]({'channel':_0x8eb36e,'type':_0xa8e6('0x104'),'data1':_0xa8e6('0x105')},_0x45453c));}});return db[_0xa8e6('0xfe')][_0xa8e6('0x8d')](_0x306fa4[_0xa8e6('0xd1')](_0x437165),{'individualHooks':!![]});}})[_0xa8e6('0x16')](function(){if(_0x45c490){return _0x45c490[_0xa8e6('0x27')]({'online':!![],'lastLoginAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101')),'voicePause':_0x45c490[_0xa8e6('0xa4')]||![],'mailPause':_0x45c490[_0xa8e6('0xa4')]||![],'chatPause':_0x45c490[_0xa8e6('0xa4')]||![],'faxPause':_0x45c490[_0xa8e6('0xa4')]||![],'smsPause':_0x45c490[_0xa8e6('0xa4')]||![],'openchannelPause':_0x45c490[_0xa8e6('0xa4')]||![],'whatsappPause':_0x45c490[_0xa8e6('0xa4')]||![],'pauseType':_0x45c490['loginInPause']?_0xa8e6('0x105'):null,'interface':_0x48ba62,'lastPauseAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'))});}})[_0xa8e6('0x16')](function(_0x262239){if(_0x584a11[_0xa8e6('0x106')]){return _0x1edb10();}else{return Promise['resolve'](_0x262239)[_0xa8e6('0x16')](respondWithResult(_0x371c14,null));}})[_0xa8e6('0x1e')](handleError(_0x371c14,null));};exports['logout']=function(_0x4a591f,_0x2025c0){var _0x2d8f83;return db[_0xa8e6('0x46')]['find']({'where':{'id':_0x4a591f[_0xa8e6('0x63')]['id'],'role':_0xa8e6('0x30')},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b')]})[_0xa8e6('0x16')](handleEntityNotFound(_0x2025c0,null))['then'](function(_0xc0f16e){if(_0xc0f16e){_0x2d8f83=_0xc0f16e;return db[_0xa8e6('0xb4')][_0xa8e6('0x39')]({'where':{'membername':_0x2d8f83['name']},'individualHooks':!![]});}})[_0xa8e6('0x16')](function(){return db[_0xa8e6('0xfe')][_0xa8e6('0x4e')]({'where':{'membername':_0x2d8f83[_0xa8e6('0x37')],'exitAt':null}});})[_0xa8e6('0x16')](function(_0xb7b279){var _0xf8c009=[];_0xb7b279[_0xa8e6('0xff')](function(_0x3a69c7){_0xf8c009[_0xa8e6('0x4d')](_0x3a69c7[_0xa8e6('0x27')]({'exitAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'))}));});return Promise[_0xa8e6('0x61')](_0xf8c009);})['then'](function(){return _0x2d8f83[_0xa8e6('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa8e6('0x16')](respondWithResult(_0x2025c0,null))[_0xa8e6('0x1e')](handleError(_0x2025c0,null));};exports[_0xa8e6('0x107')]=function(_0x512e74,_0x24a9a5){var _0x23ec35;return db[_0xa8e6('0xb4')][_0xa8e6('0x27')]({'paused':0x1},{'where':{'UserId':_0x512e74['params']['id']},'individualHooks':!![]})[_0xa8e6('0x16')](function(){return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x512e74['params']['id'],'role':_0xa8e6('0x30')},'attributes':['id','name',_0xa8e6('0x2b'),_0xa8e6('0x68'),_0xa8e6('0xa6'),'online']});})[_0xa8e6('0x16')](handleEntityNotFound(_0x24a9a5,null))[_0xa8e6('0x16')](function(_0x582d8e){if(_0x582d8e){_0x23ec35=_0x582d8e;return respondWithRpcPromise('QueuePause',_0xa8e6('0x107'),{'id':_0x23ec35['id'],'name':_0x23ec35['name'],'pause':!![]});}})['then'](function(){if(_0x23ec35){return db[_0xa8e6('0xfe')][_0xa8e6('0x4e')]({'where':{'membername':_0x23ec35[_0xa8e6('0x37')],'type':_0xa8e6('0x104'),'exitAt':null}});}})[_0xa8e6('0x16')](function(_0x2d80b8){if(_0x2d80b8['length']){var _0x206574=moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'));for(var _0x53c9d9=0x0,_0x4210aa=_0x2d80b8[_0xa8e6('0x50')];_0x53c9d9<_0x4210aa;_0x53c9d9++){_0x2d80b8[_0x53c9d9][_0xa8e6('0x108')]({'exitAt':_0x206574});}}})[_0xa8e6('0x16')](function(){var _0x3dfaad=[];var _0x1eed42=utils[_0xa8e6('0x100')]();_0x1eed42['forEach'](function(_0x16590b){_0x3dfaad[_0xa8e6('0x4d')]({'channel':_0x16590b,'membername':_0x23ec35[_0xa8e6('0x37')],'interface':_[_0xa8e6('0x6d')](_0x23ec35[_0xa8e6('0xa6')])?util[_0xa8e6('0xb1')]('SIP/%s',_0x23ec35['name']):_0x23ec35[_0xa8e6('0xa6')],'type':'PAUSE','enterAt':moment()['format'](_0xa8e6('0x101')),'data1':_0x512e74[_0xa8e6('0x62')][_0xa8e6('0x40')]||_0xa8e6('0x109'),'role':_0x23ec35['role'],'internal':_0x23ec35[_0xa8e6('0x68')]});});return db[_0xa8e6('0xfe')][_0xa8e6('0x8d')](_0x3dfaad,{'individualHooks':!![]});})[_0xa8e6('0x16')](function(){return _0x23ec35[_0xa8e6('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x512e74[_0xa8e6('0x62')][_0xa8e6('0x40')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'))});})[_0xa8e6('0x16')](respondWithResult(_0x24a9a5,null))['catch'](handleError(_0x24a9a5,null));};exports[_0xa8e6('0x10a')]=function(_0x514658,_0x257d7d){if(_0x514658['body'][_0xa8e6('0xa2')]&&!utils[_0xa8e6('0xa7')](_0x514658[_0xa8e6('0x62')]['channel'])){throw new APIBadRequestError(util[_0xa8e6('0xb1')](_0xa8e6('0x10b'),_0x514658[_0xa8e6('0x62')][_0xa8e6('0xa2')]));}return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x514658[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b'),_0xa8e6('0x68'),'interface',_0xa8e6('0xa3'),_0xa8e6('0xa5'),'mailPause',_0xa8e6('0x10c'),_0xa8e6('0x10d'),_0xa8e6('0x10e'),_0xa8e6('0x10f'),_0xa8e6('0x110'),'pauseType',_0xa8e6('0x111')]})[_0xa8e6('0x16')](function(_0x54df7e){if(!_0x54df7e){throw new APINotFoundError(util[_0xa8e6('0xb1')](_0xa8e6('0x112'),_0x514658[_0xa8e6('0x63')]['id']));}return _0x54df7e['unpause'](_0x514658[_0xa8e6('0x62')][_0xa8e6('0xa2')]);})[_0xa8e6('0x16')](respondWithResult(_0x257d7d,null))[_0xa8e6('0x1e')](APIHandleError(_0x257d7d));};exports[_0xa8e6('0x113')]=function(_0x2e3fa7,_0x3418a8){var _0x48cb80={};var _0x309463={};var _0x2e6291;var _0x358a8b;return db[_0xa8e6('0x46')]['findOne']({'where':{'id':_0x2e3fa7[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x3418a8,null))[_0xa8e6('0x16')](function(_0xe5c20b){if(_0xe5c20b){_0x2e6291=_0xe5c20b;_0x309463[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0x114')]['rawAttributes']);_0x309463['query']=_[_0xa8e6('0x58')](_0x2e3fa7[_0xa8e6('0x47')]);_0x309463[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x309463[_0xa8e6('0x5b')],_0x309463[_0xa8e6('0x47')]);_0x48cb80[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x309463['model'],qs[_0xa8e6('0x5c')](_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x48cb80[_0xa8e6('0x4c')]=_0x48cb80[_0xa8e6('0x4c')]['length']?_0x48cb80['attributes']:_0x309463[_0xa8e6('0x5b')];_0x48cb80['order']=qs['sort'](_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x48cb80[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x2e3fa7['query'],_0x309463[_0xa8e6('0x59')]));if(_0x2e3fa7['query'][_0xa8e6('0x33')]){_0x48cb80[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x48cb80['where'],{'$or':_[_0xa8e6('0x34')](_0x48cb80['attributes'],function(_0x5ddbaf){var _0x1a7663={};_0x1a7663[_0x5ddbaf]={'$like':'%'+_0x2e3fa7[_0xa8e6('0x47')]['filter']+'%'};return _0x1a7663;})});}_0x48cb80=_['merge']({},_0x48cb80,_0x2e3fa7[_0xa8e6('0x5f')]);return _0x2e6291['getTeams'](_0x48cb80);}})['then'](function(_0x6d2c19){if(_0x6d2c19){_0x358a8b=_0x6d2c19[_0xa8e6('0x50')];if(!_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x48cb80[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x2e3fa7[_0xa8e6('0x47')]['limit']);_0x48cb80[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x2e6291[_0xa8e6('0x113')](_0x48cb80);}})['then'](function(_0x4ce64c){if(_0x4ce64c){return _0x4ce64c?{'count':_0x358a8b,'rows':_0x4ce64c}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x3418a8,null))[_0xa8e6('0x1e')](handleError(_0x3418a8,null));};exports[_0xa8e6('0x115')]=function(_0x3348d2,_0xdcf4d4){var _0x1ff07f=_0x3348d2[_0xa8e6('0x63')]['id'];var _0x4312d8=_0x3348d2[_0xa8e6('0x62')]?_0x3348d2[_0xa8e6('0x62')]['ids']:null;var _0x1584eb=[];return Promise[_0xa8e6('0x116')]()[_0xa8e6('0x16')](function(){if(!_0x4312d8)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xa8e6('0x16')](function(){return db['User'][_0xa8e6('0x9c')]({'where':{'id':_0x1ff07f}});})['then'](function(_0x545caa){if(!_0x545caa)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x3348d2[_0xa8e6('0x63')]['id']));return db[_0xa8e6('0x6f')][_0xa8e6('0x117')](function(_0x379377){return _0x545caa[_0xa8e6('0x115')](_0x4312d8,{'transaction':_0x379377})['then'](function(){return db[_0xa8e6('0x114')][_0xa8e6('0x4e')]({'where':{'id':{'$in':_0x4312d8}}});})[_0xa8e6('0x16')](function(_0x4d0782){var _0x3f1cb0=_[_0xa8e6('0x34')](_0x4d0782,function(_0x320d75){return _0x320d75[_0xa8e6('0x118')]();});return Promise[_0xa8e6('0x61')](_0x3f1cb0);})[_0xa8e6('0x16')](function(_0x3765b9){_0x1584eb=_[_0xa8e6('0x119')](_0x3765b9);var _0xc28feb=_[_0xa8e6('0x34')](_0x1584eb,function(_0x4b0ed1){return _0x4b0ed1[_0xa8e6('0x11a')](_0x545caa['id'],{'transaction':_0x379377});});return Promise[_0xa8e6('0x61')](_0xc28feb);})[_0xa8e6('0x16')](function(){if(!_0x545caa['online'])return;var _0x24282e=_[_0xa8e6('0x33')](_0x1584eb,function(_0x19cc6e){return _0x19cc6e['getDataValue'](_0xa8e6('0xa2'))===_0xa8e6('0x11b');});var _0x44b08f=_[_0xa8e6('0x34')](_0x24282e,function(_0x5ad792){return db[_0xa8e6('0xb4')][_0xa8e6('0xb5')]({'membername':_0x545caa[_0xa8e6('0x37')],'UserId':_0x545caa['id'],'queue_name':_0x5ad792[_0xa8e6('0x37')],'VoiceQueueId':_0x5ad792['id'],'interface':_[_0xa8e6('0x6d')](_0x545caa[_0xa8e6('0xa6')])?util[_0xa8e6('0xb1')]('SIP/%s',_0x545caa[_0xa8e6('0x37')]):_0x545caa[_0xa8e6('0xa6')],'paused':_0x545caa[_0xa8e6('0xa5')]||![],'penalty':_0x545caa[_0xa8e6('0xb3')]},{'transaction':_0x379377});});return Promise[_0xa8e6('0x61')](_0x44b08f);})['then'](function(){return db[_0xa8e6('0x11c')][_0xa8e6('0x4e')]({'where':{'teamId':{'$in':_0x4312d8}}});})['then'](function(_0x546782){var _0x36daaf=_[_0xa8e6('0x34')](_0x546782,function(_0x217740){return db[_0xa8e6('0x11d')][_0xa8e6('0x89')]({'UserId':_0x545caa['id'],'VoicePrefixId':_0x217740[_0xa8e6('0x11e')]},{'transaction':_0x379377});});return Promise[_0xa8e6('0x61')](_0x36daaf);});});})[_0xa8e6('0x16')](function(){for(var _0x4234f0=0x0;_0x4234f0<_0x1584eb[_0xa8e6('0x50')];_0x4234f0++){var _0x360926=_0x1584eb[_0x4234f0][_0xa8e6('0x11f')]('channel');var _0x169229=_0x360926+_0xa8e6('0xad');socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_0x360926+_0xa8e6('0xae'),{'UserId':_0x1ff07f,['queueField']:_0x1584eb[_0x4234f0]['id']});}})[_0xa8e6('0x16')](respondWithStatusCode(_0xdcf4d4,null))[_0xa8e6('0x1e')](APIHandleError(_0xdcf4d4));};exports[_0xa8e6('0x120')]=function(_0x5cf8ea,_0x584a81){var _0x344190=_0x5cf8ea[_0xa8e6('0x63')]['id'];var _0x4e358a=null;if(_0x5cf8ea['query'][_0xa8e6('0x67')]){_0x4e358a=_[_0xa8e6('0xb9')](_0x5cf8ea[_0xa8e6('0x47')][_0xa8e6('0x67')])?_0x5cf8ea['query'][_0xa8e6('0x67')]:[_0x5cf8ea[_0xa8e6('0x47')][_0xa8e6('0x67')]];}var _0x1046b6=[];return Promise[_0xa8e6('0x116')]()['then'](function(){if(!_0x4e358a)throw new APIBadRequestError(_0xa8e6('0x121'));})[_0xa8e6('0x16')](function(){return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x344190}});})[_0xa8e6('0x16')](function(_0x485df9){if(!_0x485df9)throw new APINotFoundError(util[_0xa8e6('0xb1')](_0xa8e6('0x112'),_0x5cf8ea[_0xa8e6('0x63')]['id']));return db[_0xa8e6('0x6f')][_0xa8e6('0x117')](function(_0x4af6bd){return _0x485df9[_0xa8e6('0x120')](_0x4e358a,{'transaction':_0x4af6bd})['then'](function(){return db[_0xa8e6('0x114')]['findAll']({'where':{'id':{'$in':_0x4e358a}}});})['then'](function(_0x43f51e){var _0x52e962=_[_0xa8e6('0x34')](_0x43f51e,function(_0x47c414){return _0x47c414['getAssociatedQueues']();});return Promise[_0xa8e6('0x61')](_0x52e962);})[_0xa8e6('0x16')](function(_0x3eba73){_0x1046b6=_[_0xa8e6('0x119')](_0x3eba73);var _0x145e9b=_[_0xa8e6('0x34')](_0x1046b6,function(_0x1974c0){return _0x1974c0[_0xa8e6('0x122')](_0x485df9['id'],{'transaction':_0x4af6bd});});return Promise['all'](_0x145e9b);})[_0xa8e6('0x16')](function(){if(!_0x485df9[_0xa8e6('0xa3')])return;var _0x37f2bb=_['filter'](_0x1046b6,function(_0x2466f9){return _0x2466f9[_0xa8e6('0x11f')](_0xa8e6('0xa2'))===_0xa8e6('0x11b');});var _0x4a88ef=_[_0xa8e6('0x34')](_0x37f2bb,function(_0x500890){return db[_0xa8e6('0xb4')]['destroy']({'where':{'VoiceQueueId':_0x500890['id'],'UserId':_0x485df9['id']},'transaction':_0x4af6bd});});return Promise[_0xa8e6('0x61')](_0x4a88ef);})[_0xa8e6('0x16')](function(){return db['TeamVoicePrefix'][_0xa8e6('0x4e')]({'where':{'teamId':{'$in':_0x4e358a}}});})[_0xa8e6('0x16')](function(_0x5541c0){var _0x42f2a9=_[_0xa8e6('0x34')](_0x5541c0,function(_0x3ed446){return db['UserVoicePrefix'][_0xa8e6('0x39')]({'where':{'UserId':_0x485df9['id'],'VoicePrefixId':_0x3ed446[_0xa8e6('0x11e')]}},{'transaction':_0x4af6bd});});return Promise[_0xa8e6('0x61')](_0x42f2a9);});});})[_0xa8e6('0x16')](function(){for(var _0xbb2969=0x0;_0xbb2969<_0x1046b6[_0xa8e6('0x50')];_0xbb2969++){var _0x7a31=_0x1046b6[_0xbb2969][_0xa8e6('0x11f')](_0xa8e6('0xa2'));var _0x3fc647=_0x7a31+_0xa8e6('0xad');socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_0x7a31+'Queue:remove',{'UserId':_0x344190,['queueField']:_0x1046b6[_0xbb2969]['id']});}})['then'](respondWithStatusCode(_0x584a81,null))[_0xa8e6('0x1e')](APIHandleError(_0x584a81));};exports[_0xa8e6('0x123')]=function(_0x6235b2,_0x525ec7){var _0x40bfd2={};var _0x3ea49e={};var _0x3d2b79;var _0x4b7a08;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x6235b2[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x525ec7,null))[_0xa8e6('0x16')](function(_0x28fd5e){if(_0x28fd5e){_0x3d2b79=_0x28fd5e;_0x3ea49e[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db['CmList'][_0xa8e6('0x3e')]);_0x3ea49e[_0xa8e6('0x47')]=_['keys'](_0x6235b2['query']);_0x3ea49e[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x3ea49e[_0xa8e6('0x5b')],_0x3ea49e[_0xa8e6('0x47')]);_0x40bfd2['attributes']=_[_0xa8e6('0x5a')](_0x3ea49e['model'],qs[_0xa8e6('0x5c')](_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x40bfd2[_0xa8e6('0x4c')]=_0x40bfd2[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x40bfd2[_0xa8e6('0x4c')]:_0x3ea49e[_0xa8e6('0x5b')];_0x40bfd2[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x6235b2[_0xa8e6('0x47')]['sort']);_0x40bfd2[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x6235b2['query'],_0x3ea49e[_0xa8e6('0x59')]));if(_0x6235b2['query'][_0xa8e6('0x33')]){_0x40bfd2['where']=_[_0xa8e6('0x5e')](_0x40bfd2[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x40bfd2['attributes'],function(_0x626a88){var _0x28294d={};_0x28294d[_0x626a88]={'$like':'%'+_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x28294d;})});}_0x40bfd2=_[_0xa8e6('0x5e')]({},_0x40bfd2,_0x6235b2['options']);return _0x3d2b79[_0xa8e6('0x123')](_0x40bfd2);}})[_0xa8e6('0x16')](function(_0x32d14e){if(_0x32d14e){_0x4b7a08=_0x32d14e[_0xa8e6('0x50')];if(!_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x40bfd2[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x6235b2[_0xa8e6('0x47')]['limit']);_0x40bfd2['offset']=qs[_0xa8e6('0x21')](_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x3d2b79['getLists'](_0x40bfd2);}})[_0xa8e6('0x16')](function(_0x200afb){if(_0x200afb){return _0x200afb?{'count':_0x4b7a08,'rows':_0x200afb}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x525ec7,null))[_0xa8e6('0x1e')](handleError(_0x525ec7,null));};exports[_0xa8e6('0x124')]=function(_0xf14ec3,_0x1bc6e4){var _0x40a553={};var _0x1446cc={};var _0x4e64e2;return db['User']['findOne']({'where':{'id':_0xf14ec3[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x1bc6e4,null))[_0xa8e6('0x16')](function(_0x209c63){if(_0x209c63){_0x4e64e2=_0x209c63;_0x1446cc[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db['User'][_0xa8e6('0x3e')]);_0x1446cc['query']=_[_0xa8e6('0x58')](_0xf14ec3[_0xa8e6('0x47')]);_0x1446cc[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x1446cc['model'],_0x1446cc[_0xa8e6('0x47')]);_0x40a553[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x1446cc[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0xf14ec3['query'][_0xa8e6('0x5c')]));_0x40a553[_0xa8e6('0x4c')]=_0x40a553['attributes'][_0xa8e6('0x50')]?_0x40a553['attributes']:_0x1446cc[_0xa8e6('0x5b')];_0x40a553[_0xa8e6('0xde')]=qs['sort'](_0xf14ec3[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x40a553['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0xf14ec3[_0xa8e6('0x47')],_0x1446cc[_0xa8e6('0x59')]));if(_0xf14ec3[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x40a553[_0xa8e6('0x45')]=_['merge'](_0x40a553[_0xa8e6('0x45')],{'$or':_['map'](_0x40a553[_0xa8e6('0x4c')],function(_0x3efee0){var _0x1a5c40={};_0x1a5c40[_0x3efee0]={'$like':'%'+_0xf14ec3['query'][_0xa8e6('0x33')]+'%'};return _0x1a5c40;})});}_0x40a553[_0xa8e6('0x5b')]=db['User'];_0x40a553['as']='Agents';_0x40a553=_[_0xa8e6('0x5e')]({},_0x40a553,_0xf14ec3[_0xa8e6('0x5f')]);return _0x4e64e2[_0xa8e6('0x125')]({'include':[_0x40a553]});}})[_0xa8e6('0x16')](function(_0x59b881){if(_0x59b881){var _0x28429a={},_0x32812e=[];for(var _0x2d0138=0x0;_0x2d0138<_0x59b881['length'];_0x2d0138+=0x1){for(var _0x150b64=0x0,_0x23a4c0;_0x150b64<_0x59b881[_0x2d0138][_0xa8e6('0x2f')][_0xa8e6('0x50')];_0x150b64+=0x1){_0x23a4c0=_0x59b881[_0x2d0138][_0xa8e6('0x2f')][_0x150b64][_0xa8e6('0x2a')]({'plain':!![]});_0x28429a[_0x23a4c0['id']]=_0x23a4c0;}}_0x28429a=_[_0xa8e6('0x126')](_0x28429a);for(var _0x420f1b=qs[_0xa8e6('0x21')](_0xf14ec3[_0xa8e6('0x47')][_0xa8e6('0x21')]);_0x420f1b<_0x28429a['length']&&_0x32812e['length']=_0x4d8ef8[_0xdcb6('0x52')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xdcb6('0x17')](function(){if(_0x1b9e9c){return db[_0xdcb6('0x25')][_0xdcb6('0x49')]({'where':{'membername':_0x1b9e9c[_0xdcb6('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x1b9e9c){return _0x1b9e9c[_0xdcb6('0x53')]({'raw':!![]});}})[_0xdcb6('0x17')](function(_0x55e1dc){if(_0x1b9e9c){if(_0x55e1dc){var _0x5287bf=[];_0x13f1a4=_0x55e1dc;if(_0x13f1a4['length']){for(var _0x2718cc=0x0;_0x2718cc<_0x13f1a4[_0xdcb6('0x2b')];_0x2718cc++){_0x5287bf[_0xdcb6('0x4a')](db['UserVoiceQueueRt']['upsert']({'membername':_0x1b9e9c['name'],'UserId':_0x1b9e9c['id'],'queue_name':_0x13f1a4[_0x2718cc][_0xdcb6('0x22')],'VoiceQueueId':_0x13f1a4[_0x2718cc]['id'],'interface':_0x2eeac1,'paused':_0x1b9e9c[_0xdcb6('0x4f')]||![],'penalty':_0x13f1a4[_0x2718cc][_0xdcb6('0x54')]||0x0}));}return BPromise[_0xdcb6('0x4b')](_0x5287bf);}}}})[_0xdcb6('0x17')](function(){if(_0x1b9e9c){return db[_0xdcb6('0x27')][_0xdcb6('0xf')]({'where':{'membername':_0x1b9e9c[_0xdcb6('0x22')],'exitAt':null}});}})[_0xdcb6('0x17')](function(_0x22829a){if(_0x1b9e9c){if(_0x22829a&&_0x22829a[_0xdcb6('0x2b')]){var _0xcccbfc=[];_0x22829a[_0xdcb6('0x2e')](function(_0x3d274a){_0xcccbfc['push'](_0x3d274a[_0xdcb6('0x26')]({'exitAt':moment()[_0xdcb6('0x29')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xdcb6('0x4b')](_0xcccbfc);}}})[_0xdcb6('0x17')](function(){if(_0x1b9e9c){var _0x198145=[];var _0x70a78=[];var _0x52309c=utils[_0xdcb6('0x2d')]();var _0x26ffdf={'membername':_0x1b9e9c[_0xdcb6('0x22')],'interface':_0x2eeac1,'enterAt':moment()['format'](_0xdcb6('0x2a')),'role':_0x1b9e9c[_0xdcb6('0x23')],'internal':_0x1b9e9c[_0xdcb6('0x32')]};_0x52309c[_0xdcb6('0x2e')](function(_0x1b9c16){_0x198145[_0xdcb6('0x4a')](_[_0xdcb6('0x55')]({'channel':_0x1b9c16,'type':'LOGIN','data1':'callysquare','data2':_0x2eeac1},_0x26ffdf));if(_0x1b9e9c['loginInPause']){_0x70a78['push'](_[_0xdcb6('0x55')]({'channel':_0x1b9c16,'type':_0xdcb6('0x28'),'data1':_0xdcb6('0x56')},_0x26ffdf));}});return db[_0xdcb6('0x27')][_0xdcb6('0x57')](_0x198145[_0xdcb6('0x58')](_0x70a78),{'individualHooks':!![]});}})['then'](function(){if(_0x1b9e9c){return _0x1b9e9c[_0xdcb6('0x26')]({'online':!![],'lastLoginAt':moment()[_0xdcb6('0x29')](_0xdcb6('0x2a')),'voicePause':_0x1b9e9c['loginInPause']||![],'mailPause':_0x1b9e9c['loginInPause']||![],'chatPause':_0x1b9e9c[_0xdcb6('0x4f')]||![],'faxPause':_0x1b9e9c[_0xdcb6('0x4f')]||![],'smsPause':_0x1b9e9c[_0xdcb6('0x4f')]||![],'openchannelPause':_0x1b9e9c['loginInPause']||![],'pauseType':_0x1b9e9c[_0xdcb6('0x4f')]?_0xdcb6('0x56'):null,'lastPauseAt':moment()[_0xdcb6('0x29')](_0xdcb6('0x2a')),'interface':_0x2eeac1});}})['then'](function(_0x45c828){_0x245f36(_0x45c828);})[_0xdcb6('0x1f')](function(_0x4b071c){_0x454e4b(_0x3c7a67['error'](0x1f4,_0x4b071c['message']));});});}; \ No newline at end of file +var _0x281d=['unpause','system','LogoutUser','destroy','forEach','push','all','LoginUser','mobile','phone','count','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','getChannels','merge','LOGININPAUSE','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','ShowUser','find','message','PauseUser','name','internal','update','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','UnpauseUser','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','channel','findOne','interface','online','mailPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x281d,0x160));var _0xd281=function(_0x44a4fd,_0x22d3d3){_0x44a4fd=_0x44a4fd-0x0;var _0x21e4c7=_0x281d[_0x44a4fd];return _0x21e4c7;};'use strict';var _=require(_0xd281('0x0'));var util=require('util');var moment=require(_0xd281('0x1'));var BPromise=require(_0xd281('0x2'));var Redis=require('ioredis');var db=require(_0xd281('0x3'))['db'];var utils=require(_0xd281('0x4'));var logger=require('../../config/logger')(_0xd281('0x5'));var config=require(_0xd281('0x6'));config[_0xd281('0x7')]=_[_0xd281('0x8')](config[_0xd281('0x7')],{'host':_0xd281('0x9'),'port':0x18eb});var socket=require(_0xd281('0xa'))(new Redis(config[_0xd281('0x7')]));require('./user.socket')[_0xd281('0xb')](socket);exports[_0xd281('0xc')]=function(_0x519c27){var _0xc5c7f9=this;return new Promise(function(_0x5cc411,_0x428b2a){return db[_0xd281('0xd')][_0xd281('0xe')]({'raw':_0x519c27[_0xd281('0xf')]?_0x519c27[_0xd281('0xf')][_0xd281('0x10')]===undefined?!![]:![]:!![],'where':_0x519c27[_0xd281('0xf')]?_0x519c27[_0xd281('0xf')][_0xd281('0x11')]||null:null,'attributes':_0x519c27[_0xd281('0xf')]?_0x519c27[_0xd281('0xf')][_0xd281('0x12')]||null:null,'limit':_0x519c27[_0xd281('0xf')]?_0x519c27[_0xd281('0xf')][_0xd281('0x13')]||null:null,'include':_0x519c27[_0xd281('0xf')]?_0x519c27['options'][_0xd281('0x14')]?_['map'](_0x519c27[_0xd281('0xf')][_0xd281('0x14')],function(_0x1e147a){return{'model':db[_0x1e147a[_0xd281('0x15')]],'as':_0x1e147a['as'],'attributes':_0x1e147a['attributes'],'include':_0x1e147a['include']?_[_0xd281('0x16')](_0x1e147a[_0xd281('0x14')],function(_0x572cf0){return{'model':db[_0x572cf0[_0xd281('0x15')]],'as':_0x572cf0['as'],'attributes':_0x572cf0[_0xd281('0x12')],'include':_0x572cf0[_0xd281('0x14')]?_['map'](_0x572cf0[_0xd281('0x14')],function(_0x5ec530){return{'model':db[_0x5ec530[_0xd281('0x15')]],'as':_0x5ec530['as'],'attributes':_0x5ec530[_0xd281('0x12')]};}):[]};}):[]};}):[]:[]})[_0xd281('0x17')](function(_0x386c2e){logger[_0xd281('0x18')](_0xd281('0xc'),_0x519c27);logger[_0xd281('0x19')](_0xd281('0xc'),_0x519c27,JSON[_0xd281('0x1a')](_0x386c2e));_0x5cc411(_0x386c2e);})[_0xd281('0x1b')](function(_0x3a7b59){logger['error']('GetUser',_0x3a7b59['message'],_0x519c27);_0x428b2a(_0xc5c7f9[_0xd281('0x1c')](0x1f4,_0x3a7b59['message']));});});};exports[_0xd281('0x1d')]=function(_0x59a3c3){var _0x4ef3f7=this;return new Promise(function(_0x18aa8b,_0x1dc42e){return db[_0xd281('0xd')][_0xd281('0x1e')]({'raw':_0x59a3c3[_0xd281('0xf')]?_0x59a3c3[_0xd281('0xf')][_0xd281('0x10')]===undefined?!![]:![]:!![],'where':_0x59a3c3[_0xd281('0xf')]?_0x59a3c3['options'][_0xd281('0x11')]||null:null,'attributes':_0x59a3c3['options']?_0x59a3c3[_0xd281('0xf')][_0xd281('0x12')]||null:null,'include':_0x59a3c3[_0xd281('0xf')]?_0x59a3c3['options']['include']?_[_0xd281('0x16')](_0x59a3c3[_0xd281('0xf')][_0xd281('0x14')],function(_0x398617){return{'model':db[_0x398617[_0xd281('0x15')]],'as':_0x398617['as'],'attributes':_0x398617['attributes'],'include':_0x398617[_0xd281('0x14')]?_[_0xd281('0x16')](_0x398617['include'],function(_0x5c04c3){return{'model':db[_0x5c04c3[_0xd281('0x15')]],'as':_0x5c04c3['as'],'attributes':_0x5c04c3[_0xd281('0x12')],'include':_0x5c04c3[_0xd281('0x14')]?_[_0xd281('0x16')](_0x5c04c3[_0xd281('0x14')],function(_0x3c10d6){return{'model':db[_0x3c10d6[_0xd281('0x15')]],'as':_0x3c10d6['as'],'attributes':_0x3c10d6[_0xd281('0x12')]};}):[]};}):[]};}):[]:[]})[_0xd281('0x17')](function(_0x147027){logger[_0xd281('0x18')](_0xd281('0x1d'),_0x59a3c3);logger[_0xd281('0x19')](_0xd281('0x1d'),_0x59a3c3,JSON['stringify'](_0x147027));_0x18aa8b(_0x147027);})[_0xd281('0x1b')](function(_0x533113){logger[_0xd281('0x1c')](_0xd281('0x1d'),_0x533113[_0xd281('0x1f')],_0x59a3c3);_0x1dc42e(_0x4ef3f7[_0xd281('0x1c')](0x1f4,_0x533113['message']));});});};exports[_0xd281('0x20')]=function(_0x2e947e){var _0x211a84=this;return new Promise(function(_0x67dc80,_0x22eec1){var _0x4885ee;return db[_0xd281('0xd')][_0xd281('0x1e')]({'where':_0x2e947e['options'][_0xd281('0x11')]||{},'attributes':['id',_0xd281('0x21'),'role',_0xd281('0x22'),'interface']})[_0xd281('0x17')](function(_0x50cc1c){if(_0x50cc1c){_0x4885ee=_0x50cc1c;return db['UserVoiceQueueRt'][_0xd281('0x23')]({'paused':0x1},{'where':{'UserId':_0x4885ee['id']},'individualHooks':!![]});}})[_0xd281('0x17')](function(){if(_0x4885ee){return db[_0xd281('0x24')][_0xd281('0xe')]({'where':{'membername':_0x4885ee[_0xd281('0x21')],'type':'PAUSE','exitAt':null}});}})[_0xd281('0x17')](function(_0x3a113a){if(_0x4885ee){if(_0x3a113a&&_0x3a113a[_0xd281('0x25')]){var _0x4a942b=moment()[_0xd281('0x26')](_0xd281('0x27'));for(var _0x11e281=0x0,_0x5bcfe1=_0x3a113a[_0xd281('0x25')];_0x11e281<_0x5bcfe1;_0x11e281++){_0x3a113a[_0x11e281][_0xd281('0x28')]({'exitAt':_0x4a942b});}}}})['then'](function(){if(_0x4885ee){var _0x495e54=[];var _0x2a1eaf=utils['getChannels']();_0x2a1eaf['forEach'](function(_0x15f1c7){_0x495e54['push']({'channel':_0x15f1c7,'membername':_0x4885ee[_0xd281('0x21')],'interface':_['isNil'](_0x4885ee['interface'])?util[_0xd281('0x26')](_0xd281('0x29'),_0x4885ee[_0xd281('0x21')]):_0x4885ee['interface'],'type':_0xd281('0x2a'),'enterAt':moment()[_0xd281('0x26')](_0xd281('0x27')),'data1':_0x2e947e[_0xd281('0x2b')][_0xd281('0x2c')]||_0xd281('0x2d'),'role':_0x4885ee[_0xd281('0x2e')],'internal':_0x4885ee[_0xd281('0x22')],'uniqueid':_0x2e947e['body'][_0xd281('0x2f')]||null});});return db[_0xd281('0x24')][_0xd281('0x30')](_0x495e54,{'individualHooks':!![]});}})[_0xd281('0x17')](function(){if(_0x4885ee){return _0x4885ee[_0xd281('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2e947e['body']['type']||_0xd281('0x2d'),'lastPauseAt':moment()[_0xd281('0x26')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd281('0x17')](function(_0x34ec6b){_0x67dc80(_0x34ec6b);})[_0xd281('0x1b')](function(_0x529794){_0x22eec1(_0x211a84[_0xd281('0x1c')](0x1f4,_0x529794['message']));});});};exports[_0xd281('0x31')]=function(_0xc167b8){var _0x21dd9a=this;return new Promise(function(_0x551e6f,_0x232e21){if(_0xc167b8[_0xd281('0x2b')]['channel']&&!utils[_0xd281('0x32')](_0xc167b8[_0xd281('0x2b')]['channel'])){throw new Error(util['format'](_0xd281('0x33'),_0xc167b8[_0xd281('0x2b')][_0xd281('0x34')]));}return db[_0xd281('0xd')][_0xd281('0x35')]({'where':_0xc167b8[_0xd281('0xf')]['where']||{},'attributes':['id',_0xd281('0x21'),_0xd281('0x2e'),_0xd281('0x22'),_0xd281('0x36'),_0xd281('0x37'),'voicePause',_0xd281('0x38'),'chatPause','faxPause','openchannelPause',_0xd281('0x39'),_0xd281('0x3a'),_0xd281('0x3b'),_0xd281('0x3c')]})[_0xd281('0x17')](function(_0x2b312e){if(!_0x2b312e){throw new Error(util['format'](_0xd281('0x3d'),_0xc167b8[_0xd281('0x3e')]['id']));}return _0x2b312e[_0xd281('0x3f')](_0xc167b8[_0xd281('0x2b')][_0xd281('0x34')],_0xd281('0x40'));})[_0xd281('0x17')](function(_0x53858f){_0x551e6f(_0x53858f);})[_0xd281('0x1b')](function(_0x4c49a9){_0x232e21(_0x21dd9a[_0xd281('0x1c')](0x1f4,_0x4c49a9['message']));});});};exports[_0xd281('0x41')]=function(_0x1d2063){var _0x41fb6f=this;return new Promise(function(_0x45d464,_0x3a8508){var _0x1b307c;return db['User'][_0xd281('0x35')]({'where':_0x1d2063['options'][_0xd281('0x11')]||{},'attributes':['id',_0xd281('0x21')]})[_0xd281('0x17')](function(_0x1de908){if(_0x1de908){_0x1b307c=_0x1de908;return db['UserVoiceQueueRt'][_0xd281('0x42')]({'where':{'membername':_0x1b307c['name']},'individualHooks':!![]});}})[_0xd281('0x17')](function(){if(_0x1b307c){return db[_0xd281('0x24')][_0xd281('0xe')]({'where':{'membername':_0x1b307c[_0xd281('0x21')],'exitAt':null}});}})['then'](function(_0x21c62a){if(_0x1b307c){if(_0x21c62a&&_0x21c62a[_0xd281('0x25')]){var _0x48af5e=[];_0x21c62a[_0xd281('0x43')](function(_0x132918){_0x48af5e[_0xd281('0x44')](_0x132918['update']({'exitAt':moment()['format'](_0xd281('0x27'))}));});return BPromise[_0xd281('0x45')](_0x48af5e);}}})[_0xd281('0x17')](function(){if(_0x1b307c){return _0x1b307c[_0xd281('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd281('0x17')](function(_0x4300b4){_0x45d464(_0x4300b4);})['catch'](function(_0x41e2cc){_0x3a8508(_0x41fb6f[_0xd281('0x1c')](0x1f4,_0x41e2cc[_0xd281('0x1f')]));});});};exports[_0xd281('0x46')]=function(_0x1152a3){var _0x467f12=this;return new Promise(function(_0x20df6a,_0x3fabc1){var _0x416b4f;var _0x4761cf;var _0x1435fd;var _0x4da403;return db[_0xd281('0xd')][_0xd281('0x35')]({'where':_0x1152a3[_0xd281('0xf')][_0xd281('0x11')]||{},'attributes':['id',_0xd281('0x21'),_0xd281('0x2e'),_0xd281('0x47'),_0xd281('0x48'),'internal','loginInPause',_0xd281('0x36')]})['then'](function(_0x2fb5f0){if(_0x2fb5f0){_0x416b4f=_0x2fb5f0;_0x4da403=_0x1152a3[_0xd281('0x2b')][_0xd281('0x36')]?_0x1152a3[_0xd281('0x2b')][_0xd281('0x36')]:util['format'](_0xd281('0x29'),_0x416b4f[_0xd281('0x21')]);return db[_0xd281('0xd')][_0xd281('0x49')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x416b4f['id']}}});}})[_0xd281('0x17')](function(_0x2876ce){if(_0x2876ce){_0x1435fd=_0x2876ce;return require('../../config/license/util')['getLicense']();}})[_0xd281('0x17')](function(_0x148aa8){if(_0x148aa8&&_0x148aa8[_0xd281('0x4a')]&&_0x1435fd>=_0x148aa8['agents']){throw new Error(_0xd281('0x4b'));}})[_0xd281('0x17')](function(){if(_0x416b4f){return db[_0xd281('0x4c')]['destroy']({'where':{'membername':_0x416b4f[_0xd281('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x416b4f){return _0x416b4f[_0xd281('0x4d')]({'raw':!![]});}})[_0xd281('0x17')](function(_0x363685){if(_0x416b4f){if(_0x363685){var _0x5c634c=[];_0x4761cf=_0x363685;if(_0x4761cf[_0xd281('0x25')]){for(var _0x58e249=0x0;_0x58e249<_0x4761cf[_0xd281('0x25')];_0x58e249++){_0x5c634c['push'](db[_0xd281('0x4c')]['upsert']({'membername':_0x416b4f['name'],'UserId':_0x416b4f['id'],'queue_name':_0x4761cf[_0x58e249][_0xd281('0x21')],'VoiceQueueId':_0x4761cf[_0x58e249]['id'],'interface':_0x4da403,'paused':_0x416b4f[_0xd281('0x4e')]||![],'penalty':_0x4761cf[_0x58e249][_0xd281('0x4f')]||0x0}));}return BPromise['all'](_0x5c634c);}}}})[_0xd281('0x17')](function(){if(_0x416b4f){return db[_0xd281('0x24')][_0xd281('0xe')]({'where':{'membername':_0x416b4f['name'],'exitAt':null}});}})['then'](function(_0x25fd81){if(_0x416b4f){if(_0x25fd81&&_0x25fd81[_0xd281('0x25')]){var _0x592579=[];_0x25fd81[_0xd281('0x43')](function(_0x41adb1){_0x592579[_0xd281('0x44')](_0x41adb1['update']({'exitAt':moment()[_0xd281('0x26')](_0xd281('0x27'))}));});return BPromise[_0xd281('0x45')](_0x592579);}}})[_0xd281('0x17')](function(){if(_0x416b4f){var _0x57d0a9=[];var _0x4810b6=[];var _0x2aa156=utils[_0xd281('0x50')]();var _0x2b527a={'membername':_0x416b4f[_0xd281('0x21')],'interface':_0x4da403,'enterAt':moment()[_0xd281('0x26')](_0xd281('0x27')),'role':_0x416b4f[_0xd281('0x2e')],'internal':_0x416b4f['internal']};_0x2aa156[_0xd281('0x43')](function(_0x324287){_0x57d0a9[_0xd281('0x44')](_[_0xd281('0x51')]({'channel':_0x324287,'type':'LOGIN','data1':'callysquare','data2':_0x4da403},_0x2b527a));if(_0x416b4f[_0xd281('0x4e')]){_0x4810b6[_0xd281('0x44')](_['merge']({'channel':_0x324287,'type':_0xd281('0x2a'),'data1':'LOGININPAUSE'},_0x2b527a));}});return db[_0xd281('0x24')][_0xd281('0x30')](_0x57d0a9['concat'](_0x4810b6),{'individualHooks':!![]});}})[_0xd281('0x17')](function(){if(_0x416b4f){return _0x416b4f[_0xd281('0x23')]({'online':!![],'lastLoginAt':moment()['format'](_0xd281('0x27')),'voicePause':_0x416b4f[_0xd281('0x4e')]||![],'mailPause':_0x416b4f[_0xd281('0x4e')]||![],'chatPause':_0x416b4f[_0xd281('0x4e')]||![],'faxPause':_0x416b4f[_0xd281('0x4e')]||![],'smsPause':_0x416b4f[_0xd281('0x4e')]||![],'openchannelPause':_0x416b4f[_0xd281('0x4e')]||![],'pauseType':_0x416b4f[_0xd281('0x4e')]?_0xd281('0x52'):null,'lastPauseAt':moment()[_0xd281('0x26')](_0xd281('0x27')),'interface':_0x4da403});}})[_0xd281('0x17')](function(_0x3c4de8){_0x20df6a(_0x3c4de8);})[_0xd281('0x1b')](function(_0x173ab2){_0x3fabc1(_0x467f12[_0xd281('0x1c')](0x1f4,_0x173ab2[_0xd281('0x1f')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 23c6348..37be011 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 _0x4785=['length','user:','./user.events','save','remove','update','emit','removeListener','register'];(function(_0x535c88,_0x102b16){var _0x2ad3ea=function(_0x9db17c){while(--_0x9db17c){_0x535c88['push'](_0x535c88['shift']());}};_0x2ad3ea(++_0x102b16);}(_0x4785,0x1c4));var _0x5478=function(_0x217372,_0x1822ce){_0x217372=_0x217372-0x0;var _0x2715a1=_0x4785[_0x217372];return _0x2715a1;};'use strict';var UserEvents=require(_0x5478('0x0'));var events=[_0x5478('0x1'),_0x5478('0x2'),_0x5478('0x3')];function createListener(_0x17f001,_0x4ebf80){return function(_0xbe797b){_0x4ebf80[_0x5478('0x4')](_0x17f001,_0xbe797b);};}function removeListener(_0x9020dc,_0x4ebf02){return function(){UserEvents[_0x5478('0x5')](_0x9020dc,_0x4ebf02);};}exports[_0x5478('0x6')]=function(_0x3410c4){for(var _0x325d98=0x0,_0x14261a=events[_0x5478('0x7')];_0x325d98<_0x14261a;_0x325d98++){var _0x3247ca=events[_0x325d98];var _0x4e9add=createListener(_0x5478('0x8')+_0x3247ca,_0x3410c4);UserEvents['on'](_0x3247ca,_0x4e9add);}}; \ No newline at end of file +var _0xc0b8=['./user.events','save','emit','length','user:'];(function(_0x1a0013,_0x23c6dc){var _0x17474c=function(_0x5f8fd7){while(--_0x5f8fd7){_0x1a0013['push'](_0x1a0013['shift']());}};_0x17474c(++_0x23c6dc);}(_0xc0b8,0x15e));var _0x8c0b=function(_0x113925,_0x3d97d){_0x113925=_0x113925-0x0;var _0x11fa7f=_0xc0b8[_0x113925];return _0x11fa7f;};'use strict';var UserEvents=require(_0x8c0b('0x0'));var events=[_0x8c0b('0x1'),'remove','update'];function createListener(_0x3e811f,_0x375085){return function(_0x2b209c){_0x375085[_0x8c0b('0x2')](_0x3e811f,_0x2b209c);};}function removeListener(_0x4a563d,_0x4f1d46){return function(){UserEvents['removeListener'](_0x4a563d,_0x4f1d46);};}exports['register']=function(_0xc9837d){for(var _0x59a861=0x0,_0x3a857d=events[_0x8c0b('0x3')];_0x59a861<_0x3a857d;_0x59a861++){var _0x26d05c=events[_0x59a861];var _0x457900=createListener(_0x8c0b('0x4')+_0x26d05c,_0xc9837d);UserEvents['on'](_0x26d05c,_0x457900);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d89785f..17a2b85 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(_0x352b49,_0x16a4ee){var _0x2e314a=function(_0x339d73){while(--_0x339d73){_0x352b49['push'](_0x352b49['shift']());}};_0x2e314a(++_0x16a4ee);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x476bff,_0x2df063){var _0x125c1a=function(_0x35a95b){while(--_0x35a95b){_0x476bff['push'](_0x476bff['shift']());}};_0x125c1a(++_0x2df063);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xcb91[_0x53b133];return _0x5647e0;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 2b14c1c..1943594 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 _0x01dc=['INTEGER','sequelize'];(function(_0x3d252f,_0x33f7d1){var _0x1be3f1=function(_0x1efdc1){while(--_0x1efdc1){_0x3d252f['push'](_0x3d252f['shift']());}};_0x1be3f1(++_0x33f7d1);}(_0x01dc,0x1bb));var _0xc01d=function(_0x44d365,_0x3d7877){_0x44d365=_0x44d365-0x0;var _0x103eb1=_0x01dc[_0x44d365];return _0x103eb1;};'use strict';var Sequelize=require(_0xc01d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc01d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x84a7=['exports','INTEGER','sequelize'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x84a7,0xa1));var _0x784a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x84a7[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x784a('0x0'));module[_0x784a('0x1')]={'penalty':{'type':Sequelize[_0x784a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 8b7afb4..9bd4913 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 _0x0912=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./userChatQueue.attributes'];(function(_0x5acd84,_0x378158){var _0x4fbe2e=function(_0x1b35c5){while(--_0x1b35c5){_0x5acd84['push'](_0x5acd84['shift']());}};_0x4fbe2e(++_0x378158);}(_0x0912,0x1cb));var _0x2091=function(_0x316abb,_0x140d2d){_0x316abb=_0x316abb-0x0;var _0x525df7=_0x0912[_0x316abb];return _0x525df7;};'use strict';var _=require(_0x2091('0x0'));var util=require(_0x2091('0x1'));var logger=require(_0x2091('0x2'))(_0x2091('0x3'));var moment=require(_0x2091('0x4'));var BPromise=require(_0x2091('0x5'));var rp=require(_0x2091('0x6'));var fs=require('fs');var path=require(_0x2091('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2091('0x8'));module[_0x2091('0x9')]=function(_0x4cd909,_0x5a0b62){return _0x4cd909[_0x2091('0xa')](_0x2091('0xb'),attributes,{'tableName':_0x2091('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eb5=['rimraf','../../config/environment','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x90f337,_0x6d9d0b){var _0x475b34=function(_0x28bc53){while(--_0x28bc53){_0x90f337['push'](_0x90f337['shift']());}};_0x475b34(++_0x6d9d0b);}(_0x6eb5,0x1a7));var _0x56eb=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x6eb5[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x56eb('0x0'));var util=require(_0x56eb('0x1'));var logger=require(_0x56eb('0x2'))(_0x56eb('0x3'));var moment=require(_0x56eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56eb('0x5'));var rimraf=require(_0x56eb('0x6'));var config=require(_0x56eb('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x56eb('0x8')]=function(_0xb91477,_0x4ff54f){return _0xb91477[_0x56eb('0x9')]('UserChatQueue',attributes,{'tableName':_0x56eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 1c79af7..be6f0de 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 _0xa20e=['request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x317947,_0x2f339d){var _0x56a4d6=function(_0x58b6f7){while(--_0x58b6f7){_0x317947['push'](_0x317947['shift']());}};_0x56a4d6(++_0x2f339d);}(_0xa20e,0xb7));var _0xea20=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0xa20e[_0x326d35];return _0xd3f8f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea20('0x0'));var BPromise=require(_0xea20('0x1'));var rs=require(_0xea20('0x2'));var fs=require('fs');var Redis=require(_0xea20('0x3'));var db=require(_0xea20('0x4'))['db'];var utils=require(_0xea20('0x5'));var logger=require(_0xea20('0x6'))(_0xea20('0x7'));var config=require(_0xea20('0x8'));var jayson=require(_0xea20('0x9'));var client=jayson[_0xea20('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a18f8,_0x5080da,_0x528275){return new BPromise(function(_0x65d82b,_0x5efa21){return client[_0xea20('0xb')](_0x7a18f8,_0x528275)[_0xea20('0xc')](function(_0x10202b){logger[_0xea20('0xd')](_0xea20('0xe'),_0x5080da,_0xea20('0xf'));logger['debug'](_0xea20('0x10'),_0x5080da,_0xea20('0xf'),JSON['stringify'](_0x10202b));if(_0x10202b[_0xea20('0x11')]){if(_0x10202b[_0xea20('0x11')][_0xea20('0x12')]===0x1f4){logger[_0xea20('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x5080da,_0x10202b[_0xea20('0x11')]['message']);return _0x5efa21(_0x10202b[_0xea20('0x11')][_0xea20('0x13')]);}logger['error'](_0xea20('0xe'),_0x5080da,_0x10202b['error'][_0xea20('0x13')]);return _0x65d82b(_0x10202b[_0xea20('0x11')][_0xea20('0x13')]);}else{logger[_0xea20('0xd')](_0xea20('0xe'),_0x5080da,_0xea20('0xf'));_0x65d82b(_0x10202b[_0xea20('0x14')][_0xea20('0x13')]);}})[_0xea20('0x15')](function(_0x3d3b8e){logger[_0xea20('0x11')](_0xea20('0xe'),_0x5080da,_0x3d3b8e);_0x5efa21(_0x3d3b8e);});});} \ No newline at end of file +var _0xacdf=['stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2fffb2,_0x3c476f){var _0x46eb4f=function(_0x283ff2){while(--_0x283ff2){_0x2fffb2['push'](_0x2fffb2['shift']());}};_0x46eb4f(++_0x3c476f);}(_0xacdf,0x15a));var _0xfacd=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xacdf[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require('lodash');var util=require(_0xfacd('0x0'));var moment=require(_0xfacd('0x1'));var BPromise=require('bluebird');var rs=require(_0xfacd('0x2'));var fs=require('fs');var Redis=require(_0xfacd('0x3'));var db=require(_0xfacd('0x4'))['db'];var utils=require(_0xfacd('0x5'));var logger=require(_0xfacd('0x6'))(_0xfacd('0x7'));var config=require(_0xfacd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfacd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5addc0,_0x5d9e7c,_0x3a796c){return new BPromise(function(_0x1677bb,_0xb09719){return client[_0xfacd('0xa')](_0x5addc0,_0x3a796c)[_0xfacd('0xb')](function(_0x3e3ae9){logger['info'](_0xfacd('0xc'),_0x5d9e7c,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5d9e7c,_0xfacd('0xd'),JSON[_0xfacd('0xe')](_0x3e3ae9));if(_0x3e3ae9[_0xfacd('0xf')]){if(_0x3e3ae9['error'][_0xfacd('0x10')]===0x1f4){logger[_0xfacd('0xf')](_0xfacd('0xc'),_0x5d9e7c,_0x3e3ae9['error'][_0xfacd('0x11')]);return _0xb09719(_0x3e3ae9[_0xfacd('0xf')][_0xfacd('0x11')]);}logger['error'](_0xfacd('0xc'),_0x5d9e7c,_0x3e3ae9['error'][_0xfacd('0x11')]);return _0x1677bb(_0x3e3ae9['error'][_0xfacd('0x11')]);}else{logger[_0xfacd('0x12')](_0xfacd('0xc'),_0x5d9e7c,_0xfacd('0xd'));_0x1677bb(_0x3e3ae9[_0xfacd('0x13')][_0xfacd('0x11')]);}})['catch'](function(_0x424a87){logger[_0xfacd('0xf')](_0xfacd('0xc'),_0x5d9e7c,_0x424a87);_0xb09719(_0x424a87);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 855760b..36c7b82 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x578472,_0x1cd4e9){var _0x499ffe=function(_0x19c5bd){while(--_0x19c5bd){_0x578472['push'](_0x578472['shift']());}};_0x499ffe(++_0x1cd4e9);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xfba1ab,_0x275e86){var _0x2f4d70=function(_0x2c3f4d){while(--_0x2c3f4d){_0xfba1ab['push'](_0xfba1ab['shift']());}};_0x2f4d70(++_0x275e86);}(_0xedd9,0xfc));var _0x9edd=function(_0x47e906,_0x4febba){_0x47e906=_0x47e906-0x0;var _0x5704d2=_0xedd9[_0x47e906];return _0x5704d2;};'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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d9b815b..47c1b8c 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 _0x2919=['STRING','sequelize','INTEGER'];(function(_0x5f8000,_0x4a56b1){var _0xc8f261=function(_0x53e032){while(--_0x53e032){_0x5f8000['push'](_0x5f8000['shift']());}};_0xc8f261(++_0x4a56b1);}(_0x2919,0x6a));var _0x9291=function(_0xc79eaa,_0x59154f){_0xc79eaa=_0xc79eaa-0x0;var _0x5c9c3b=_0x2919[_0xc79eaa];return _0x5c9c3b;};'use strict';var Sequelize=require(_0x9291('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9291('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9291('0x2')]}}; \ No newline at end of file +var _0x3e0d=['exports','INTEGER','STRING','sequelize'];(function(_0xbce99,_0x2c7113){var _0x525793=function(_0x486823){while(--_0x486823){_0xbce99['push'](_0xbce99['shift']());}};_0x525793(++_0x2c7113);}(_0x3e0d,0x11b));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd3e0('0x0'));module[_0xd3e0('0x1')]={'penalty':{'type':Sequelize[_0xd3e0('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd3e0('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd3e0('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 0beb22d..90d93d0 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 _0x4515=['bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','api','moment'];(function(_0x33703f,_0x1b7a39){var _0x590d16=function(_0x5ee5ec){while(--_0x5ee5ec){_0x33703f['push'](_0x33703f['shift']());}};_0x590d16(++_0x1b7a39);}(_0x4515,0x189));var _0x5451=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4515[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5451('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5451('0x1'));var moment=require(_0x5451('0x2'));var BPromise=require(_0x5451('0x3'));var rp=require(_0x5451('0x4'));var fs=require('fs');var path=require(_0x5451('0x5'));var rimraf=require('rimraf');var config=require(_0x5451('0x6'));var attributes=require(_0x5451('0x7'));module[_0x5451('0x8')]=function(_0x50e4fc,_0xfe6268){return _0x50e4fc['define'](_0x5451('0x9'),attributes,{'tableName':_0x5451('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf24e=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf24e,0x106));var _0xef24=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xf24e[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xef24('0x0'));var util=require(_0xef24('0x1'));var logger=require(_0xef24('0x2'))(_0xef24('0x3'));var moment=require(_0xef24('0x4'));var BPromise=require(_0xef24('0x5'));var rp=require(_0xef24('0x6'));var fs=require('fs');var path=require(_0xef24('0x7'));var rimraf=require(_0xef24('0x8'));var config=require(_0xef24('0x9'));var attributes=require('./userFaxQueue.attributes');module[_0xef24('0xa')]=function(_0xc636bd,_0x533ce8){return _0xc636bd['define'](_0xef24('0xb'),attributes,{'tableName':_0xef24('0xc'),'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 414ae91..02020ab 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 _0x3643=['code','message','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f9b3c,_0x524129){var _0x33d0db=function(_0xf4ce56){while(--_0xf4ce56){_0x1f9b3c['push'](_0x1f9b3c['shift']());}};_0x33d0db(++_0x524129);}(_0x3643,0x120));var _0x3364=function(_0x501350,_0x34adcb){_0x501350=_0x501350-0x0;var _0x36a63e=_0x3643[_0x501350];return _0x36a63e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3364('0x0'));var rs=require(_0x3364('0x1'));var fs=require('fs');var Redis=require(_0x3364('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3364('0x3'));var logger=require(_0x3364('0x4'))('rpc');var config=require(_0x3364('0x5'));var jayson=require(_0x3364('0x6'));var client=jayson[_0x3364('0x7')][_0x3364('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17d19f,_0x5913d2,_0x59306c){return new BPromise(function(_0x42289e,_0x48a67a){return client['request'](_0x17d19f,_0x59306c)['then'](function(_0x41ab46){logger[_0x3364('0x9')](_0x3364('0xa'),_0x5913d2,_0x3364('0xb'));logger[_0x3364('0xc')](_0x3364('0xd'),_0x5913d2,'request\x20sent',JSON[_0x3364('0xe')](_0x41ab46));if(_0x41ab46[_0x3364('0xf')]){if(_0x41ab46[_0x3364('0xf')][_0x3364('0x10')]===0x1f4){logger[_0x3364('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x5913d2,_0x41ab46[_0x3364('0xf')][_0x3364('0x11')]);return _0x48a67a(_0x41ab46[_0x3364('0xf')]['message']);}logger[_0x3364('0xf')](_0x3364('0xa'),_0x5913d2,_0x41ab46[_0x3364('0xf')][_0x3364('0x11')]);return _0x42289e(_0x41ab46[_0x3364('0xf')][_0x3364('0x11')]);}else{logger[_0x3364('0x9')](_0x3364('0xa'),_0x5913d2,'request\x20sent');_0x42289e(_0x41ab46['result'][_0x3364('0x11')]);}})[_0x3364('0x12')](function(_0xfc376c){logger[_0x3364('0xf')](_0x3364('0xa'),_0x5913d2,_0xfc376c);_0x48a67a(_0xfc376c);});});} \ No newline at end of file +var _0x45cf=['info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c4948,_0x4d635f){var _0x36cb2b=function(_0x551a43){while(--_0x551a43){_0x5c4948['push'](_0x5c4948['shift']());}};_0x36cb2b(++_0x4d635f);}(_0x45cf,0x1d7));var _0xf45c=function(_0x5ed8e2,_0x4d1edf){_0x5ed8e2=_0x5ed8e2-0x0;var _0x5056fd=_0x45cf[_0x5ed8e2];return _0x5056fd;};'use strict';var _=require(_0xf45c('0x0'));var util=require(_0xf45c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf45c('0x2'));var fs=require('fs');var Redis=require(_0xf45c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf45c('0x4'));var logger=require(_0xf45c('0x5'))(_0xf45c('0x6'));var config=require(_0xf45c('0x7'));var jayson=require(_0xf45c('0x8'));var client=jayson[_0xf45c('0x9')][_0xf45c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30c867,_0x1abef4,_0x30383c){return new BPromise(function(_0x41f16c,_0xa96d26){return client[_0xf45c('0xb')](_0x30c867,_0x30383c)['then'](function(_0x5927ab){logger[_0xf45c('0xc')](_0xf45c('0xd'),_0x1abef4,'request\x20sent');logger[_0xf45c('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1abef4,_0xf45c('0xf'),JSON['stringify'](_0x5927ab));if(_0x5927ab[_0xf45c('0x10')]){if(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x11')]===0x1f4){logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x5927ab[_0xf45c('0x10')]['message']);return _0xa96d26(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);}logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);return _0x41f16c(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);}else{logger['info'](_0xf45c('0xd'),_0x1abef4,_0xf45c('0xf'));_0x41f16c(_0x5927ab[_0xf45c('0x13')][_0xf45c('0x12')]);}})[_0xf45c('0x14')](function(_0x2ee021){logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x2ee021);_0xa96d26(_0x2ee021);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index b744afb..fc6808d 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19e1a0,_0x147b9b){var _0x8b8998=function(_0x124ac6){while(--_0x124ac6){_0x19e1a0['push'](_0x19e1a0['shift']());}};_0x8b8998(++_0x147b9b);}(_0xe706,0xa3));var _0x6e70=function(_0x915de9,_0xabf9e5){_0x915de9=_0x915de9-0x0;var _0x274129=_0xe706[_0x915de9];return _0x274129;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c5037,_0x52e4d0){var _0x1e6ead=function(_0x24ed26){while(--_0x24ed26){_0x1c5037['push'](_0x1c5037['shift']());}};_0x1e6ead(++_0x52e4d0);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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 cfdf887..1c2d6d6 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 _0x1458=['INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1458,0x98));var _0x8145=function(_0x440a22,_0x2be6ec){_0x440a22=_0x440a22-0x0;var _0x3b8996=_0x1458[_0x440a22];return _0x3b8996;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8145('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x149f=['sequelize','exports'];(function(_0xeb568a,_0x53b831){var _0x409c9f=function(_0x3e7dcb){while(--_0x3e7dcb){_0xeb568a['push'](_0xeb568a['shift']());}};_0x409c9f(++_0x53b831);}(_0x149f,0x13e));var _0xf149=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x149f[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0xf149('0x0'));module[_0xf149('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 0d275c2..714c46a 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 _0x0867=['./userMailQueue.attributes','exports','define','UserMailQueue','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x0867,0x93));var _0x7086=function(_0x223c82,_0x46a58f){_0x223c82=_0x223c82-0x0;var _0x366b79=_0x0867[_0x223c82];return _0x366b79;};'use strict';var _=require(_0x7086('0x0'));var util=require('util');var logger=require(_0x7086('0x1'))(_0x7086('0x2'));var moment=require(_0x7086('0x3'));var BPromise=require(_0x7086('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7086('0x5'));var config=require(_0x7086('0x6'));var attributes=require(_0x7086('0x7'));module[_0x7086('0x8')]=function(_0x42917c,_0x3302a2){return _0x42917c[_0x7086('0x9')](_0x7086('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c8f=['moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x7c8f,0x69));var _0xf7c8=function(_0x5d1872,_0x268187){_0x5d1872=_0x5d1872-0x0;var _0x3dad1d=_0x7c8f[_0x5d1872];return _0x3dad1d;};'use strict';var _=require(_0xf7c8('0x0'));var util=require('util');var logger=require(_0xf7c8('0x1'))(_0xf7c8('0x2'));var moment=require(_0xf7c8('0x3'));var BPromise=require(_0xf7c8('0x4'));var rp=require(_0xf7c8('0x5'));var fs=require('fs');var path=require(_0xf7c8('0x6'));var rimraf=require('rimraf');var config=require(_0xf7c8('0x7'));var attributes=require(_0xf7c8('0x8'));module['exports']=function(_0x5f090c,_0x232bb6){return _0x5f090c[_0xf7c8('0x9')](_0xf7c8('0xa'),attributes,{'tableName':_0xf7c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 5e2d15f..ced9076 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b732b,_0x432933){var _0x358728=function(_0x47ea71){while(--_0x47ea71){_0x1b732b['push'](_0x1b732b['shift']());}};_0x358728(++_0x432933);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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(_0x4448bc,_0xba2c16){var _0x3d460c=function(_0x24e960){while(--_0x24e960){_0x4448bc['push'](_0x4448bc['shift']());}};_0x3d460c(++_0xba2c16);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 9af3959..dea5c61 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 _0x3aca=['./userNotification.controller','post','isAuthenticated','sendUserNotification','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5cbe8a,_0x41c132){var _0x4b07a1=function(_0x112ff9){while(--_0x112ff9){_0x5cbe8a['push'](_0x5cbe8a['shift']());}};_0x4b07a1(++_0x41c132);}(_0x3aca,0x180));var _0xa3ac=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x3aca[_0x55821d];return _0x58ea8a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa3ac('0x0'));var timeout=require('connect-timeout');var express=require(_0xa3ac('0x1'));var router=express[_0xa3ac('0x2')]();var fs_extra=require(_0xa3ac('0x3'));var auth=require(_0xa3ac('0x4'));var interaction=require(_0xa3ac('0x5'));var config=require('../../config/environment');var controller=require(_0xa3ac('0x6'));router[_0xa3ac('0x7')]('/',auth[_0xa3ac('0x8')](),controller[_0xa3ac('0x9')]);module['exports']=router; \ No newline at end of file +var _0xe0d8=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x584457,_0x5b9996){var _0xd070e7=function(_0x2be228){while(--_0x2be228){_0x584457['push'](_0x584457['shift']());}};_0xd070e7(++_0x5b9996);}(_0xe0d8,0xe2));var _0x8e0d=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0xe0d8[_0x48f7cf];return _0xc201c0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8e0d('0x0'));var timeout=require('connect-timeout');var express=require(_0x8e0d('0x1'));var router=express[_0x8e0d('0x2')]();var fs_extra=require(_0x8e0d('0x3'));var auth=require(_0x8e0d('0x4'));var interaction=require(_0x8e0d('0x5'));var config=require(_0x8e0d('0x6'));var controller=require(_0x8e0d('0x7'));router[_0x8e0d('0x8')]('/',auth[_0x8e0d('0x9')](),controller['sendUserNotification']);module[_0x8e0d('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index fe8b5e1..9116dda 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 _0x55ac=['exports','STRING','TEXT','BOOLEAN','sequelize'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x55ac,0xe5));var _0xc55a=function(_0xffb92d,_0x27f569){_0xffb92d=_0xffb92d-0x0;var _0x2bdef6=_0x55ac[_0xffb92d];return _0x2bdef6;};'use strict';var Sequelize=require(_0xc55a('0x0'));module[_0xc55a('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xc55a('0x2')]},'recipientsId':{'type':Sequelize[_0xc55a('0x3')]},'recipientsDescription':{'type':Sequelize[_0xc55a('0x2')]},'beep':{'type':Sequelize[_0xc55a('0x4')]}}; \ No newline at end of file +var _0xbaa7=['TEXT','BOOLEAN','sequelize'];(function(_0x4a6251,_0x15f95a){var _0x1a87ad=function(_0x2cd9b8){while(--_0x2cd9b8){_0x4a6251['push'](_0x4a6251['shift']());}};_0x1a87ad(++_0x15f95a);}(_0xbaa7,0xaa));var _0x7baa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbaa7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7baa('0x0'));module['exports']={'body':{'type':Sequelize[_0x7baa('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x7baa('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x7baa('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 46b5762..a127ca2 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 _0x2cc0=['Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','create','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','model','User','union','includes','queue','replace','ids','push','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','redis','localhost','./userNotification.socket','register','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x56278e,_0x5083c5){var _0x46d37e=function(_0x274725){while(--_0x274725){_0x56278e['push'](_0x56278e['shift']());}};_0x46d37e(++_0x5083c5);}(_0x2cc0,0x1dc));var _0x02cc=function(_0x13927a,_0x5da860){_0x13927a=_0x13927a-0x0;var _0x29ba40=_0x2cc0[_0x13927a];return _0x29ba40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02cc('0x0'));var zipdir=require(_0x02cc('0x1'));var jsonpatch=require(_0x02cc('0x2'));var rp=require(_0x02cc('0x3'));var moment=require(_0x02cc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02cc('0x5'));var path=require(_0x02cc('0x6'));var sox=require(_0x02cc('0x7'));var csv=require(_0x02cc('0x8'));var ejs=require(_0x02cc('0x9'));var fs=require('fs');var fs_extra=require(_0x02cc('0xa'));var _=require(_0x02cc('0xb'));var squel=require(_0x02cc('0xc'));var crypto=require('crypto');var jsforce=require(_0x02cc('0xd'));var deskjs=require(_0x02cc('0xe'));var toCsv=require(_0x02cc('0x8'));var querystring=require(_0x02cc('0xf'));var Papa=require(_0x02cc('0x10'));var Redis=require(_0x02cc('0x11'));var authService=require(_0x02cc('0x12'));var qs=require(_0x02cc('0x13'));var as=require(_0x02cc('0x14'));var hardwareService=require(_0x02cc('0x15'));var logger=require(_0x02cc('0x16'))(_0x02cc('0x17'));var utils=require(_0x02cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x02cc('0x19'));var db=require(_0x02cc('0x1a'))['db'];config[_0x02cc('0x1b')]=_['defaults'](config[_0x02cc('0x1b')],{'host':_0x02cc('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cc('0x1b')]));require(_0x02cc('0x1d'))[_0x02cc('0x1e')](socket);function respondWithStatusCode(_0xdb582e,_0x530ba1){_0x530ba1=_0x530ba1||0xcc;return function(_0x575da0){if(_0x575da0){return _0xdb582e[_0x02cc('0x1f')](_0x530ba1);}return _0xdb582e[_0x02cc('0x20')](_0x530ba1)[_0x02cc('0x21')]();};}function respondWithResult(_0x4ed351,_0x40be4b){_0x40be4b=_0x40be4b||0xc8;return function(_0xc3197c){if(_0xc3197c){return _0x4ed351[_0x02cc('0x20')](_0x40be4b)['json'](_0xc3197c);}};}function respondWithFilteredResult(_0x3a8fbe,_0x30e8b4){return function(_0x1ec4cc){if(_0x1ec4cc){var _0x58ca79=typeof _0x30e8b4[_0x02cc('0x22')]===_0x02cc('0x23')&&typeof _0x30e8b4[_0x02cc('0x24')]===_0x02cc('0x23');var _0x2e6b73=_0x1ec4cc[_0x02cc('0x25')];var _0x14ee04=_0x58ca79?0x0:_0x30e8b4[_0x02cc('0x22')];var _0xbfb97f=_0x58ca79?_0x1ec4cc[_0x02cc('0x25')]:_0x30e8b4[_0x02cc('0x22')]+_0x30e8b4[_0x02cc('0x24')];var _0x5077d7;if(_0xbfb97f>=_0x2e6b73){_0xbfb97f=_0x2e6b73;_0x5077d7=0xc8;}else{_0x5077d7=0xce;}_0x3a8fbe[_0x02cc('0x20')](_0x5077d7);return _0x3a8fbe[_0x02cc('0x26')](_0x02cc('0x27'),_0x14ee04+'-'+_0xbfb97f+'/'+_0x2e6b73)[_0x02cc('0x28')](_0x1ec4cc);}return null;};}function patchUpdates(_0x551e02){return function(_0x94d681){try{jsonpatch[_0x02cc('0x29')](_0x94d681,_0x551e02,!![]);}catch(_0x1a29c5){return BPromise[_0x02cc('0x2a')](_0x1a29c5);}return _0x94d681[_0x02cc('0x2b')]();};}function saveUpdates(_0x5610c2,_0x1df80b){return function(_0x4094ac){if(_0x4094ac){return _0x4094ac['update'](_0x5610c2)[_0x02cc('0x2c')](function(_0x552293){return _0x552293;});}return null;};}function removeEntity(_0x50f182,_0x56d745){return function(_0x30d0cf){if(_0x30d0cf){return _0x30d0cf[_0x02cc('0x2d')]()[_0x02cc('0x2c')](function(){_0x50f182['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a3ca2,_0x212d94){return function(_0x3f9216){if(!_0x3f9216){_0x3a3ca2[_0x02cc('0x1f')](0x194);}return _0x3f9216;};}function handleError(_0x2b0376,_0x51386f){_0x51386f=_0x51386f||0x1f4;return function(_0x53c152){logger[_0x02cc('0x2e')](_0x53c152[_0x02cc('0x2f')]);if(_0x53c152[_0x02cc('0x30')]){delete _0x53c152[_0x02cc('0x30')];}_0x2b0376[_0x02cc('0x20')](_0x51386f)[_0x02cc('0x31')](_0x53c152);};}exports[_0x02cc('0x32')]=function(_0x3d70c6,_0x328d3f,_0x40986e){if(!_0x3d70c6[_0x02cc('0x33')][_0x02cc('0x34')](_0x02cc('0x35'))&&!_0x3d70c6[_0x02cc('0x33')]['hasOwnProperty'](_0x02cc('0x36'))){throw new db[(_0x02cc('0x37'))][(_0x02cc('0x38'))](_0x02cc('0x39'));}else{if(_0x3d70c6['body']['hasOwnProperty'](_0x02cc('0x36'))&&!_0x3d70c6[_0x02cc('0x33')][_0x02cc('0x34')](_0x02cc('0x3a'))){throw new db['Sequelize'][(_0x02cc('0x38'))](_0x02cc('0x3b'));}if(!_0x3d70c6[_0x02cc('0x33')][_0x02cc('0x34')](_0x02cc('0x3c'))){throw new db['Sequelize'][(_0x02cc('0x38'))](_0x02cc('0x3d'));}else{try{var _0x204943=JSON['parse'](_0x3d70c6['body']['recipients']);}catch(_0x9e48d5){logger[_0x02cc('0x2e')](_0x9e48d5);throw new db[(_0x02cc('0x37'))][(_0x02cc('0x38'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x533aab=[_0x02cc('0x3e'),_0x02cc('0x3f'),_0x02cc('0x40'),_0x02cc('0x41'),'smsqueue',_0x02cc('0x42'),_0x02cc('0x43'),_0x02cc('0x44'),_0x02cc('0x45')];if(_[_0x02cc('0x46')](_0x204943,function(_0x163b18){return!_['includes'](_0x533aab,_0x163b18['model'][_0x02cc('0x47')]());})){throw new db[(_0x02cc('0x37'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4740b7={};_0x4740b7[_0x02cc('0x48')]=_0x3d70c6['body']['hasOwnProperty'](_0x02cc('0x48'))?_0x3d70c6['body'][_0x02cc('0x48')]:_0x3d70c6[_0x02cc('0x45')][_0x02cc('0x49')];_0x4740b7[_0x02cc('0x4a')]=_[_0x02cc('0x4b')](_0x3d70c6['body'][_0x02cc('0x4a')])?null:_0x3d70c6['body']['recipientsDescription'];_0x4740b7[_0x02cc('0x4c')]=_0x3d70c6['body']['beep']||![];_0x4740b7[_0x02cc('0x4d')]=_0x3d70c6[_0x02cc('0x45')]['id'];return getContent(_0x3d70c6['body'])['then'](function(_0x4d3b78){_0x4740b7[_0x02cc('0x33')]=_0x4d3b78;return getRecipients(_0x204943);})['then'](function(_0xf35507){_0x4740b7[_0x02cc('0x4e')]=_[_0x02cc('0x4f')](_0xf35507)[_0x02cc('0x50')](',');return db[_0x02cc('0x51')]['transaction'](function(_0x40532b){return db['UserNotification'][_0x02cc('0x52')](_0x4740b7,{'raw':!![],'transaction':_0x40532b})[_0x02cc('0x2c')](function(_0x9b009f){var _0x36a596={'sender':_0x4740b7['senderName'],'description':_0x4740b7[_0x02cc('0x4a')],'content':_0x4740b7['body'],'beep':_0x4740b7[_0x02cc('0x4c')]};_0xf35507['forEach'](function(_0x18c4cd){_0x36a596[_0x02cc('0x53')]=_0x18c4cd;socket[_0x02cc('0x54')](_0x02cc('0x55'),_0x36a596);});return _0x9b009f;});});})[_0x02cc('0x2c')](respondWithResult(_0x328d3f,0xc9))[_0x02cc('0x56')](handleError(_0x328d3f,null));};function getContent(_0x57c80a){return new BPromise(function(_0x2a2da5,_0x668696){if(_0x57c80a[_0x02cc('0x35')]){_0x2a2da5(_0x57c80a[_0x02cc('0x35')]);return;}return db[_0x02cc('0x57')][_0x02cc('0x58')]({'attributes':[_0x02cc('0x59')],'where':{'id':_0x57c80a[_0x02cc('0x36')]},'raw':!![]})[_0x02cc('0x2c')](function(_0x8a82f1){if(!_0x8a82f1)throw new db[(_0x02cc('0x37'))][(_0x02cc('0x38'))](_0x02cc('0x5a'));var _0x3c677d=Mustache[_0x02cc('0x5b')](_0x8a82f1[_0x02cc('0x59')],_0x57c80a[_0x02cc('0x3a')]);_0x2a2da5(_0x3c677d);})['catch'](function(_0x332f7c){_0x668696(_0x332f7c);});});}function getRecipients(_0x1ada1e){return new BPromise(function(_0x2d08f4,_0x668ea2){var _0x4eb9ff=[];var _0x219018=[];_0x1ada1e[_0x02cc('0x5c')](function(_0x45674e){var _0x59dc86=_[_0x02cc('0x5d')](_0x45674e[_0x02cc('0x5e')]['toLowerCase']());if(_0x59dc86===_0x02cc('0x5f')){_0x4eb9ff=_[_0x02cc('0x60')](_0x4eb9ff,_0x45674e['ids']);}else{if(_[_0x02cc('0x61')](_0x59dc86,_0x02cc('0x62')))_0x59dc86=_0x59dc86[_0x02cc('0x63')](_0x02cc('0x62'),'Queue');_0x45674e[_0x02cc('0x64')][_0x02cc('0x5c')](function(_0x9ce6ef){_0x219018[_0x02cc('0x65')](getAgents(_0x59dc86,_0x9ce6ef));});}});return BPromise['all'](_0x219018)[_0x02cc('0x2c')](function(_0x2426ba){_0x4eb9ff=_[_0x02cc('0x60')](_0x4eb9ff,_['flatten'](_0x2426ba));_0x2d08f4(_0x4eb9ff);})[_0x02cc('0x56')](function(_0x4f9d61){_0x668ea2(_0x4f9d61);});});}function getAgents(_0x957029,_0x4b05c2){return new BPromise(function(_0x538c05,_0x4ebe44){return db[_0x957029][_0x02cc('0x58')]({'where':{'id':_0x4b05c2}})[_0x02cc('0x2c')](function(_0x4e8b86){return _0x4e8b86['getAgents']({'attributes':['id'],'raw':!![]})[_0x02cc('0x2c')](function(_0x38f3f6){var _0x4f8915=_[_0x02cc('0x66')](_0x38f3f6,'id');_0x538c05(_0x4f8915);});})[_0x02cc('0x56')](function(_0x3a3512){_0x4ebe44(_0x3a3512);});});} \ No newline at end of file +var _0xf9c2=['beep','recipientsId','sortBy','join','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','replace','Queue','push','getAgents','map','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription'];(function(_0x2f6ac1,_0x6ec9d0){var _0x36a38d=function(_0x6377d1){while(--_0x6377d1){_0x2f6ac1['push'](_0x2f6ac1['shift']());}};_0x36a38d(++_0x6ec9d0);}(_0xf9c2,0x14b));var _0x2f9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf9c2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f9c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f9c('0x1'));var rp=require('request-promise');var moment=require(_0x2f9c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2f9c('0x3'));var util=require(_0x2f9c('0x4'));var path=require(_0x2f9c('0x5'));var sox=require(_0x2f9c('0x6'));var csv=require('to-csv');var ejs=require(_0x2f9c('0x7'));var fs=require('fs');var fs_extra=require(_0x2f9c('0x8'));var _=require(_0x2f9c('0x9'));var squel=require(_0x2f9c('0xa'));var crypto=require(_0x2f9c('0xb'));var jsforce=require(_0x2f9c('0xc'));var deskjs=require(_0x2f9c('0xd'));var toCsv=require(_0x2f9c('0xe'));var querystring=require('querystring');var Papa=require(_0x2f9c('0xf'));var Redis=require(_0x2f9c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2f9c('0x11'));var as=require(_0x2f9c('0x12'));var hardwareService=require(_0x2f9c('0x13'));var logger=require(_0x2f9c('0x14'))(_0x2f9c('0x15'));var utils=require(_0x2f9c('0x16'));var config=require(_0x2f9c('0x17'));var licenseUtil=require(_0x2f9c('0x18'));var db=require(_0x2f9c('0x19'))['db'];config[_0x2f9c('0x1a')]=_[_0x2f9c('0x1b')](config['redis'],{'host':_0x2f9c('0x1c'),'port':0x18eb});var socket=require(_0x2f9c('0x1d'))(new Redis(config[_0x2f9c('0x1a')]));require(_0x2f9c('0x1e'))['register'](socket);function respondWithStatusCode(_0x111370,_0x4c1768){_0x4c1768=_0x4c1768||0xcc;return function(_0x466f89){if(_0x466f89){return _0x111370['sendStatus'](_0x4c1768);}return _0x111370[_0x2f9c('0x1f')](_0x4c1768)[_0x2f9c('0x20')]();};}function respondWithResult(_0x407650,_0x1aff05){_0x1aff05=_0x1aff05||0xc8;return function(_0xfe0806){if(_0xfe0806){return _0x407650['status'](_0x1aff05)[_0x2f9c('0x21')](_0xfe0806);}};}function respondWithFilteredResult(_0x5638ac,_0x49e9dc){return function(_0x5820cc){if(_0x5820cc){var _0x7a8d03=typeof _0x49e9dc[_0x2f9c('0x22')]===_0x2f9c('0x23')&&typeof _0x49e9dc[_0x2f9c('0x24')]===_0x2f9c('0x23');var _0xecab50=_0x5820cc[_0x2f9c('0x25')];var _0x100031=_0x7a8d03?0x0:_0x49e9dc['offset'];var _0x254ae8=_0x7a8d03?_0x5820cc['count']:_0x49e9dc['offset']+_0x49e9dc[_0x2f9c('0x24')];var _0x4332a1;if(_0x254ae8>=_0xecab50){_0x254ae8=_0xecab50;_0x4332a1=0xc8;}else{_0x4332a1=0xce;}_0x5638ac[_0x2f9c('0x1f')](_0x4332a1);return _0x5638ac[_0x2f9c('0x26')](_0x2f9c('0x27'),_0x100031+'-'+_0x254ae8+'/'+_0xecab50)[_0x2f9c('0x21')](_0x5820cc);}return null;};}function patchUpdates(_0x3f1011){return function(_0x37535b){try{jsonpatch[_0x2f9c('0x28')](_0x37535b,_0x3f1011,!![]);}catch(_0x47b6a9){return BPromise[_0x2f9c('0x29')](_0x47b6a9);}return _0x37535b[_0x2f9c('0x2a')]();};}function saveUpdates(_0x189a24,_0xff0324){return function(_0x26657e){if(_0x26657e){return _0x26657e[_0x2f9c('0x2b')](_0x189a24)['then'](function(_0x534de6){return _0x534de6;});}return null;};}function removeEntity(_0x464548,_0x579164){return function(_0x1c58f7){if(_0x1c58f7){return _0x1c58f7['destroy']()[_0x2f9c('0x2c')](function(){_0x464548[_0x2f9c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b96e4,_0x5f2841){return function(_0x1fcd50){if(!_0x1fcd50){_0x2b96e4[_0x2f9c('0x2d')](0x194);}return _0x1fcd50;};}function handleError(_0x6fab4e,_0x40ff91){_0x40ff91=_0x40ff91||0x1f4;return function(_0x372fff){logger[_0x2f9c('0x2e')](_0x372fff[_0x2f9c('0x2f')]);if(_0x372fff[_0x2f9c('0x30')]){delete _0x372fff[_0x2f9c('0x30')];}_0x6fab4e[_0x2f9c('0x1f')](_0x40ff91)[_0x2f9c('0x31')](_0x372fff);};}exports[_0x2f9c('0x32')]=function(_0x3fa1ce,_0x306cac,_0x327fc0){if(!_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x35'))&&!_0x3fa1ce['body'][_0x2f9c('0x34')](_0x2f9c('0x36'))){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3fa1ce[_0x2f9c('0x33')]['hasOwnProperty']('TemplateId')&&!_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x39'))){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x3a'));}if(!_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x3b'))){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x3c'));}else{try{var _0x29bc0d=JSON[_0x2f9c('0x3d')](_0x3fa1ce[_0x2f9c('0x33')]['recipients']);}catch(_0x20ccd2){logger[_0x2f9c('0x2e')](_0x20ccd2);throw new db[(_0x2f9c('0x37'))]['ValidationError'](_0x2f9c('0x3e'));}var _0x47e935=[_0x2f9c('0x3f'),_0x2f9c('0x40'),_0x2f9c('0x41'),_0x2f9c('0x42'),'smsqueue','voicequeue',_0x2f9c('0x43'),_0x2f9c('0x44'),_0x2f9c('0x45')];if(_[_0x2f9c('0x46')](_0x29bc0d,function(_0x573e0f){return!_[_0x2f9c('0x47')](_0x47e935,_0x573e0f[_0x2f9c('0x48')]['toLowerCase']());})){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x49'));}}}var _0x17f196={};_0x17f196['senderName']=_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x4a'))?_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4a')]:_0x3fa1ce[_0x2f9c('0x45')]['fullname'];_0x17f196['recipientsDescription']=_[_0x2f9c('0x4b')](_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4c')])?null:_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4c')];_0x17f196[_0x2f9c('0x4d')]=_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4d')]||![];_0x17f196['SenderId']=_0x3fa1ce[_0x2f9c('0x45')]['id'];return getContent(_0x3fa1ce['body'])[_0x2f9c('0x2c')](function(_0x2dd3cb){_0x17f196[_0x2f9c('0x33')]=_0x2dd3cb;return getRecipients(_0x29bc0d);})[_0x2f9c('0x2c')](function(_0x2d2afa){_0x17f196[_0x2f9c('0x4e')]=_[_0x2f9c('0x4f')](_0x2d2afa)[_0x2f9c('0x50')](',');return db['sequelize'][_0x2f9c('0x51')](function(_0x5ea91e){return db[_0x2f9c('0x52')]['create'](_0x17f196,{'raw':!![],'transaction':_0x5ea91e})['then'](function(_0x38029a){var _0x599a2e={'sender':_0x17f196['senderName'],'description':_0x17f196['recipientsDescription'],'content':_0x17f196[_0x2f9c('0x33')],'beep':_0x17f196[_0x2f9c('0x4d')]};_0x2d2afa[_0x2f9c('0x53')](function(_0xfd2f5f){_0x599a2e[_0x2f9c('0x54')]=_0xfd2f5f;socket[_0x2f9c('0x55')](_0x2f9c('0x56'),_0x599a2e);});return _0x38029a;});});})['then'](respondWithResult(_0x306cac,0xc9))[_0x2f9c('0x57')](handleError(_0x306cac,null));};function getContent(_0x48b248){return new BPromise(function(_0x2a09e7,_0x5e4cae){if(_0x48b248[_0x2f9c('0x35')]){_0x2a09e7(_0x48b248['text']);return;}return db[_0x2f9c('0x58')][_0x2f9c('0x59')]({'attributes':['html'],'where':{'id':_0x48b248['TemplateId']},'raw':!![]})['then'](function(_0x332c51){if(!_0x332c51)throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x5a'));var _0x52e5bf=Mustache[_0x2f9c('0x5b')](_0x332c51[_0x2f9c('0x5c')],_0x48b248[_0x2f9c('0x39')]);_0x2a09e7(_0x52e5bf);})[_0x2f9c('0x57')](function(_0x54a39e){_0x5e4cae(_0x54a39e);});});}function getRecipients(_0x1a013b){return new BPromise(function(_0x11e3ce,_0x3b024e){var _0x4bcf07=[];var _0x587944=[];_0x1a013b[_0x2f9c('0x53')](function(_0x247f97){var _0x52c68e=_[_0x2f9c('0x5d')](_0x247f97[_0x2f9c('0x48')]['toLowerCase']());if(_0x52c68e===_0x2f9c('0x5e')){_0x4bcf07=_[_0x2f9c('0x5f')](_0x4bcf07,_0x247f97[_0x2f9c('0x60')]);}else{if(_[_0x2f9c('0x47')](_0x52c68e,'queue'))_0x52c68e=_0x52c68e[_0x2f9c('0x61')]('queue',_0x2f9c('0x62'));_0x247f97[_0x2f9c('0x60')][_0x2f9c('0x53')](function(_0x150ff8){_0x587944[_0x2f9c('0x63')](getAgents(_0x52c68e,_0x150ff8));});}});return BPromise['all'](_0x587944)[_0x2f9c('0x2c')](function(_0x1fd3be){_0x4bcf07=_[_0x2f9c('0x5f')](_0x4bcf07,_['flatten'](_0x1fd3be));_0x11e3ce(_0x4bcf07);})[_0x2f9c('0x57')](function(_0x285d08){_0x3b024e(_0x285d08);});});}function getAgents(_0x4e1a3c,_0x5a8c4f){return new BPromise(function(_0x260b60,_0x541f38){return db[_0x4e1a3c][_0x2f9c('0x59')]({'where':{'id':_0x5a8c4f}})['then'](function(_0x24ada4){return _0x24ada4[_0x2f9c('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9239db){var _0xa6b5ee=_[_0x2f9c('0x65')](_0x9239db,'id');_0x260b60(_0xa6b5ee);});})[_0x2f9c('0x57')](function(_0x442cba){_0x541f38(_0x442cba);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index bf14d19..6f55e94 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 _0x4275=['UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x36b600,_0x54dccd){var _0x169b0d=function(_0x4847bd){while(--_0x4847bd){_0x36b600['push'](_0x36b600['shift']());}};_0x169b0d(++_0x54dccd);}(_0x4275,0x1a0));var _0x5427=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4275[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x5427('0x0'));var UserNotification=require(_0x5427('0x1'))['db'][_0x5427('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5427('0x3')](0x0);var events={'afterCreate':_0x5427('0x4'),'afterUpdate':_0x5427('0x5'),'afterDestroy':_0x5427('0x6')};function emitEvent(_0x167ecd){return function(_0x4ce456,_0x58e85f,_0x584a76){UserNotificationEvents[_0x5427('0x7')](_0x167ecd+':'+_0x4ce456['id'],_0x4ce456);UserNotificationEvents[_0x5427('0x7')](_0x167ecd,_0x4ce456);_0x584a76(null);};}for(var e in events){if(events[_0x5427('0x8')](e)){var event=events[e];UserNotification[_0x5427('0x9')](e,emitEvent(event));}}module[_0x5427('0xa')]=UserNotificationEvents; \ No newline at end of file +var _0x8366=['remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners','save','update'];(function(_0x1b1460,_0x465655){var _0x5eff81=function(_0x24c8bd){while(--_0x24c8bd){_0x1b1460['push'](_0x1b1460['shift']());}};_0x5eff81(++_0x465655);}(_0x8366,0xc3));var _0x6836=function(_0x3d6bdc,_0x3d9cc5){_0x3d6bdc=_0x3d6bdc-0x0;var _0xa62019=_0x8366[_0x3d6bdc];return _0xa62019;};'use strict';var EventEmitter=require(_0x6836('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x6836('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6836('0x2')](0x0);var events={'afterCreate':_0x6836('0x3'),'afterUpdate':_0x6836('0x4'),'afterDestroy':_0x6836('0x5')};function emitEvent(_0x5b36c4){return function(_0x1c30cd,_0x2d9d54,_0x39d279){UserNotificationEvents[_0x6836('0x6')](_0x5b36c4+':'+_0x1c30cd['id'],_0x1c30cd);UserNotificationEvents['emit'](_0x5b36c4,_0x1c30cd);_0x39d279(null);};}for(var e in events){if(events[_0x6836('0x7')](e)){var event=events[e];UserNotification[_0x6836('0x8')](e,emitEvent(event));}}module[_0x6836('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 aec278e..cd0f444 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 _0xac7a=['moment','bluebird','request-promise','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3e9186,_0x57d328){var _0x594e48=function(_0x4a3a37){while(--_0x4a3a37){_0x3e9186['push'](_0x3e9186['shift']());}};_0x594e48(++_0x57d328);}(_0xac7a,0x128));var _0xaac7=function(_0x5aae08,_0x5dd375){_0x5aae08=_0x5aae08-0x0;var _0x369b33=_0xac7a[_0x5aae08];return _0x369b33;};'use strict';var _=require(_0xaac7('0x0'));var util=require(_0xaac7('0x1'));var logger=require(_0xaac7('0x2'))(_0xaac7('0x3'));var moment=require(_0xaac7('0x4'));var BPromise=require(_0xaac7('0x5'));var rp=require(_0xaac7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaac7('0x7'));var config=require('../../config/environment');var attributes=require(_0xaac7('0x8'));module[_0xaac7('0x9')]=function(_0x4264b2,_0x3be7be){return _0x4264b2[_0xaac7('0xa')](_0xaac7('0xb'),attributes,{'tableName':_0xaac7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaac7('0xd'),'collate':_0xaac7('0xe')});}; \ No newline at end of file +var _0xa0c4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x1136dc,_0x334a4f){var _0x4850e8=function(_0x28efd5){while(--_0x28efd5){_0x1136dc['push'](_0x1136dc['shift']());}};_0x4850e8(++_0x334a4f);}(_0xa0c4,0x1e1));var _0x4a0c=function(_0x51d393,_0x1a39be){_0x51d393=_0x51d393-0x0;var _0x63bd54=_0xa0c4[_0x51d393];return _0x63bd54;};'use strict';var _=require(_0x4a0c('0x0'));var util=require('util');var logger=require(_0x4a0c('0x1'))(_0x4a0c('0x2'));var moment=require(_0x4a0c('0x3'));var BPromise=require(_0x4a0c('0x4'));var rp=require(_0x4a0c('0x5'));var fs=require('fs');var path=require(_0x4a0c('0x6'));var rimraf=require(_0x4a0c('0x7'));var config=require(_0x4a0c('0x8'));var attributes=require(_0x4a0c('0x9'));module['exports']=function(_0x13920d,_0x561dfe){return _0x13920d['define']('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4a0c('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d753b52..cf74e63 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 _0xec08=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0xec08,0x195));var _0x8ec0=function(_0x237a0a,_0x26c050){_0x237a0a=_0x237a0a-0x0;var _0x219bb5=_0xec08[_0x237a0a];return _0x219bb5;};'use strict';var _=require(_0x8ec0('0x0'));var util=require(_0x8ec0('0x1'));var moment=require(_0x8ec0('0x2'));var BPromise=require(_0x8ec0('0x3'));var rs=require(_0x8ec0('0x4'));var fs=require('fs');var Redis=require(_0x8ec0('0x5'));var db=require(_0x8ec0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ec0('0x7'))(_0x8ec0('0x8'));var config=require(_0x8ec0('0x9'));var jayson=require(_0x8ec0('0xa'));var client=jayson[_0x8ec0('0xb')]['http']({'port':0x232a});config[_0x8ec0('0xc')]=_[_0x8ec0('0xd')](config[_0x8ec0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ec0('0xe'))(new Redis(config['redis']));require(_0x8ec0('0xf'))[_0x8ec0('0x10')](socket);function respondWithRpcPromise(_0x587f0e,_0x4da940,_0x1157b9){return new BPromise(function(_0x32a42a,_0x214186){return client[_0x8ec0('0x11')](_0x587f0e,_0x1157b9)[_0x8ec0('0x12')](function(_0x53b463){logger[_0x8ec0('0x13')](_0x8ec0('0x14'),_0x4da940,'request\x20sent');logger[_0x8ec0('0x15')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x4da940,_0x8ec0('0x16'),JSON[_0x8ec0('0x17')](_0x53b463));if(_0x53b463['error']){if(_0x53b463[_0x8ec0('0x18')][_0x8ec0('0x19')]===0x1f4){logger[_0x8ec0('0x18')]('UserNotification,\x20%s,\x20%s',_0x4da940,_0x53b463[_0x8ec0('0x18')]['message']);return _0x214186(_0x53b463[_0x8ec0('0x18')][_0x8ec0('0x1a')]);}logger[_0x8ec0('0x18')](_0x8ec0('0x14'),_0x4da940,_0x53b463['error'][_0x8ec0('0x1a')]);return _0x32a42a(_0x53b463[_0x8ec0('0x18')][_0x8ec0('0x1a')]);}else{logger[_0x8ec0('0x13')](_0x8ec0('0x14'),_0x4da940,_0x8ec0('0x16'));_0x32a42a(_0x53b463[_0x8ec0('0x1b')][_0x8ec0('0x1a')]);}})[_0x8ec0('0x1c')](function(_0x241463){logger['error'](_0x8ec0('0x14'),_0x4da940,_0x241463);_0x214186(_0x241463);});});} \ No newline at end of file +var _0x2fe3=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x2fe3,0x1b6));var _0x32fe=function(_0x49e15e,_0x312977){_0x49e15e=_0x49e15e-0x0;var _0x37fd35=_0x2fe3[_0x49e15e];return _0x37fd35;};'use strict';var _=require(_0x32fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x32fe('0x1'));var rs=require(_0x32fe('0x2'));var fs=require('fs');var Redis=require(_0x32fe('0x3'));var db=require(_0x32fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x32fe('0x5'))(_0x32fe('0x6'));var config=require(_0x32fe('0x7'));var jayson=require(_0x32fe('0x8'));var client=jayson[_0x32fe('0x9')][_0x32fe('0xa')]({'port':0x232a});config[_0x32fe('0xb')]=_['defaults'](config[_0x32fe('0xb')],{'host':_0x32fe('0xc'),'port':0x18eb});var socket=require(_0x32fe('0xd'))(new Redis(config[_0x32fe('0xb')]));require(_0x32fe('0xe'))['register'](socket);function respondWithRpcPromise(_0xa59ac5,_0x25def9,_0x1979c9){return new BPromise(function(_0x124cb6,_0x7a555d){return client[_0x32fe('0xf')](_0xa59ac5,_0x1979c9)[_0x32fe('0x10')](function(_0x25504b){logger[_0x32fe('0x11')](_0x32fe('0x12'),_0x25def9,_0x32fe('0x13'));logger[_0x32fe('0x14')](_0x32fe('0x15'),_0x25def9,_0x32fe('0x13'),JSON['stringify'](_0x25504b));if(_0x25504b[_0x32fe('0x16')]){if(_0x25504b[_0x32fe('0x16')]['code']===0x1f4){logger[_0x32fe('0x16')]('UserNotification,\x20%s,\x20%s',_0x25def9,_0x25504b['error'][_0x32fe('0x17')]);return _0x7a555d(_0x25504b[_0x32fe('0x16')]['message']);}logger[_0x32fe('0x16')](_0x32fe('0x12'),_0x25def9,_0x25504b[_0x32fe('0x16')][_0x32fe('0x17')]);return _0x124cb6(_0x25504b[_0x32fe('0x16')][_0x32fe('0x17')]);}else{logger[_0x32fe('0x11')]('UserNotification,\x20%s,\x20%s',_0x25def9,_0x32fe('0x13'));_0x124cb6(_0x25504b[_0x32fe('0x18')][_0x32fe('0x17')]);}})[_0x32fe('0x19')](function(_0x4783c3){logger[_0x32fe('0x16')](_0x32fe('0x12'),_0x25def9,_0x4783c3);_0x7a555d(_0x4783c3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index d5ba42c..d36006d 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 _0xbadb=['register','./userNotification.events','save','remove','emit'];(function(_0x455a03,_0x1996a0){var _0x50cdf1=function(_0x3b2b99){while(--_0x3b2b99){_0x455a03['push'](_0x455a03['shift']());}};_0x50cdf1(++_0x1996a0);}(_0xbadb,0x1f0));var _0xbbad=function(_0x5e6233,_0x4feccf){_0x5e6233=_0x5e6233-0x0;var _0x34a29f=_0xbadb[_0x5e6233];return _0x34a29f;};'use strict';var UserNotificationEvents=require(_0xbbad('0x0'));var events=[_0xbbad('0x1'),_0xbbad('0x2'),'update'];function createListener(_0x1b3a2f,_0x3853cb){return function(_0xcaa8bc){_0x3853cb[_0xbbad('0x3')](_0x1b3a2f,_0xcaa8bc);};}function removeListener(_0x363282,_0x137a81){return function(){UserNotificationEvents['removeListener'](_0x363282,_0x137a81);};}exports[_0xbbad('0x4')]=function(_0x32d7e0){for(var _0x42ce8a=0x0,_0x17e4bc=events['length'];_0x42ce8a<_0x17e4bc;_0x42ce8a++){var _0x67b694=events[_0x42ce8a];var _0x5921b9=createListener('userNotification:'+_0x67b694,_0x32d7e0);UserNotificationEvents['on'](_0x67b694,_0x5921b9);}}; \ No newline at end of file +var _0xc2a9=['./userNotification.events','remove','update','emit','removeListener','length'];(function(_0x1a4323,_0x17abee){var _0x5554c5=function(_0x2f0337){while(--_0x2f0337){_0x1a4323['push'](_0x1a4323['shift']());}};_0x5554c5(++_0x17abee);}(_0xc2a9,0x7e));var _0x9c2a=function(_0x393028,_0x528f18){_0x393028=_0x393028-0x0;var _0x331509=_0xc2a9[_0x393028];return _0x331509;};'use strict';var UserNotificationEvents=require(_0x9c2a('0x0'));var events=['save',_0x9c2a('0x1'),_0x9c2a('0x2')];function createListener(_0x4ae90e,_0x48953e){return function(_0x2883ca){_0x48953e[_0x9c2a('0x3')](_0x4ae90e,_0x2883ca);};}function removeListener(_0x3fa23e,_0x4efcb5){return function(){UserNotificationEvents[_0x9c2a('0x4')](_0x3fa23e,_0x4efcb5);};}exports['register']=function(_0x12ae7e){for(var _0x2ac16b=0x0,_0x3fe453=events[_0x9c2a('0x5')];_0x2ac16b<_0x3fe453;_0x2ac16b++){var _0x35f103=events[_0x2ac16b];var _0x114f5f=createListener('userNotification:'+_0x35f103,_0x12ae7e);UserNotificationEvents['on'](_0x35f103,_0x114f5f);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index aa43554..eb3aebc 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x580ad2,_0x103632){var _0x4f33d7=function(_0x2b24b0){while(--_0x2b24b0){_0x580ad2['push'](_0x580ad2['shift']());}};_0x4f33d7(++_0x103632);}(_0xe706,0xa3));var _0x6e70=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe706[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x31a1ca,_0x519d23){var _0x1985a6=function(_0x315098){while(--_0x315098){_0x31a1ca['push'](_0x31a1ca['shift']());}};_0x1985a6(++_0x519d23);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6def7fd..090c56e 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 _0x6708=['exports','INTEGER','sequelize'];(function(_0x13682e,_0x431f67){var _0x244503=function(_0x174308){while(--_0x174308){_0x13682e['push'](_0x13682e['shift']());}};_0x244503(++_0x431f67);}(_0x6708,0xc5));var _0x8670=function(_0x1a62c0,_0x56b952){_0x1a62c0=_0x1a62c0-0x0;var _0x4d1015=_0x6708[_0x1a62c0];return _0x4d1015;};'use strict';var Sequelize=require(_0x8670('0x0'));module[_0x8670('0x1')]={'penalty':{'type':Sequelize[_0x8670('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x84f7=['sequelize','INTEGER'];(function(_0x1e8f35,_0x3db390){var _0x446c13=function(_0xa1e11e){while(--_0xa1e11e){_0x1e8f35['push'](_0x1e8f35['shift']());}};_0x446c13(++_0x3db390);}(_0x84f7,0x1e0));var _0x784f=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x84f7[_0x424501];return _0xb719af;};'use strict';var Sequelize=require(_0x784f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x784f('0x1')],'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 10ea6d7..70dce6d 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 _0xde94=['./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x298a48,_0x45af38){var _0x2c6b20=function(_0x45dbea){while(--_0x45dbea){_0x298a48['push'](_0x298a48['shift']());}};_0x2c6b20(++_0x45af38);}(_0xde94,0x18f));var _0x4de9=function(_0x46c7c1,_0x2e47c0){_0x46c7c1=_0x46c7c1-0x0;var _0x2386f1=_0xde94[_0x46c7c1];return _0x2386f1;};'use strict';var _=require('lodash');var util=require(_0x4de9('0x0'));var logger=require(_0x4de9('0x1'))(_0x4de9('0x2'));var moment=require(_0x4de9('0x3'));var BPromise=require(_0x4de9('0x4'));var rp=require(_0x4de9('0x5'));var fs=require('fs');var path=require(_0x4de9('0x6'));var rimraf=require(_0x4de9('0x7'));var config=require(_0x4de9('0x8'));var attributes=require(_0x4de9('0x9'));module['exports']=function(_0x1eaee1,_0x1cb4ce){return _0x1eaee1['define'](_0x4de9('0xa'),attributes,{'tableName':_0x4de9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c49=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util'];(function(_0x48c0d4,_0x2facad){var _0x47f463=function(_0x5bfd2a){while(--_0x5bfd2a){_0x48c0d4['push'](_0x48c0d4['shift']());}};_0x47f463(++_0x2facad);}(_0x4c49,0x8d));var _0x94c4=function(_0x5c877f,_0x5ab2cd){_0x5c877f=_0x5c877f-0x0;var _0x1dd4bb=_0x4c49[_0x5c877f];return _0x1dd4bb;};'use strict';var _=require(_0x94c4('0x0'));var util=require(_0x94c4('0x1'));var logger=require(_0x94c4('0x2'))(_0x94c4('0x3'));var moment=require(_0x94c4('0x4'));var BPromise=require(_0x94c4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94c4('0x6'));var rimraf=require(_0x94c4('0x7'));var config=require(_0x94c4('0x8'));var attributes=require(_0x94c4('0x9'));module[_0x94c4('0xa')]=function(_0x4b25d0,_0x102108){return _0x4b25d0[_0x94c4('0xb')]('UserOpenchannelQueue',attributes,{'tableName':_0x94c4('0xc'),'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 3a24250..3d9e33d 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 _0xb286=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xb286,0x1c6));var _0x6b28=function(_0x37ddf2,_0x2604ce){_0x37ddf2=_0x37ddf2-0x0;var _0x39abd5=_0xb286[_0x37ddf2];return _0x39abd5;};'use strict';var _=require('lodash');var util=require(_0x6b28('0x0'));var moment=require(_0x6b28('0x1'));var BPromise=require(_0x6b28('0x2'));var rs=require(_0x6b28('0x3'));var fs=require('fs');var Redis=require(_0x6b28('0x4'));var db=require(_0x6b28('0x5'))['db'];var utils=require(_0x6b28('0x6'));var logger=require(_0x6b28('0x7'))(_0x6b28('0x8'));var config=require(_0x6b28('0x9'));var jayson=require(_0x6b28('0xa'));var client=jayson[_0x6b28('0xb')][_0x6b28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a62d3,_0xde2d49,_0x1a5ce0){return new BPromise(function(_0x54f981,_0x44510e){return client[_0x6b28('0xd')](_0x1a62d3,_0x1a5ce0)['then'](function(_0x48ac14){logger[_0x6b28('0xe')](_0x6b28('0xf'),_0xde2d49,_0x6b28('0x10'));logger[_0x6b28('0x11')](_0x6b28('0x12'),_0xde2d49,_0x6b28('0x10'),JSON[_0x6b28('0x13')](_0x48ac14));if(_0x48ac14['error']){if(_0x48ac14[_0x6b28('0x14')][_0x6b28('0x15')]===0x1f4){logger[_0x6b28('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xde2d49,_0x48ac14[_0x6b28('0x14')]['message']);return _0x44510e(_0x48ac14[_0x6b28('0x14')]['message']);}logger[_0x6b28('0x14')](_0x6b28('0xf'),_0xde2d49,_0x48ac14[_0x6b28('0x14')][_0x6b28('0x16')]);return _0x54f981(_0x48ac14[_0x6b28('0x14')][_0x6b28('0x16')]);}else{logger[_0x6b28('0xe')](_0x6b28('0xf'),_0xde2d49,_0x6b28('0x10'));_0x54f981(_0x48ac14[_0x6b28('0x17')][_0x6b28('0x16')]);}})[_0x6b28('0x18')](function(_0x4fff45){logger[_0x6b28('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xde2d49,_0x4fff45);_0x44510e(_0x4fff45);});});} \ No newline at end of file +var _0xf9c7=['result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x519ebf,_0x362a83){var _0x4f72e6=function(_0x557eb7){while(--_0x557eb7){_0x519ebf['push'](_0x519ebf['shift']());}};_0x4f72e6(++_0x362a83);}(_0xf9c7,0xf9));var _0x7f9c=function(_0x517358,_0x347981){_0x517358=_0x517358-0x0;var _0x35cb8c=_0xf9c7[_0x517358];return _0x35cb8c;};'use strict';var _=require(_0x7f9c('0x0'));var util=require(_0x7f9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f9c('0x2'));var fs=require('fs');var Redis=require(_0x7f9c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f9c('0x4'));var logger=require(_0x7f9c('0x5'))(_0x7f9c('0x6'));var config=require(_0x7f9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7f9c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3190aa,_0x370cbe,_0xdc0fef){return new BPromise(function(_0xad8687,_0x4affd1){return client[_0x7f9c('0x9')](_0x3190aa,_0xdc0fef)[_0x7f9c('0xa')](function(_0x54db77){logger[_0x7f9c('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x370cbe,_0x7f9c('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x370cbe,_0x7f9c('0xc'),JSON[_0x7f9c('0xd')](_0x54db77));if(_0x54db77[_0x7f9c('0xe')]){if(_0x54db77['error']['code']===0x1f4){logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x370cbe,_0x54db77['error']['message']);return _0x4affd1(_0x54db77['error']['message']);}logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x370cbe,_0x54db77['error'][_0x7f9c('0x10')]);return _0xad8687(_0x54db77[_0x7f9c('0xe')][_0x7f9c('0x10')]);}else{logger['info'](_0x7f9c('0xf'),_0x370cbe,'request\x20sent');_0xad8687(_0x54db77[_0x7f9c('0x11')][_0x7f9c('0x10')]);}})[_0x7f9c('0x12')](function(_0x58a6ec){logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x370cbe,_0x58a6ec);_0x4affd1(_0x58a6ec);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index af640c1..32dde4f 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 _0x2d3b=['../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','describe','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','/:id','update','delete','removeSections','removeResources','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2103e1,_0x4c706e){var _0x56af92=function(_0x411056){while(--_0x411056){_0x2103e1['push'](_0x2103e1['shift']());}};_0x56af92(++_0x4c706e);}(_0x2d3b,0x9c));var _0xb2d3=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2d3b[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0xb2d3('0x0'));var util=require('util');var path=require(_0xb2d3('0x1'));var timeout=require(_0xb2d3('0x2'));var express=require(_0xb2d3('0x3'));var router=express[_0xb2d3('0x4')]();var fs_extra=require(_0xb2d3('0x5'));var auth=require(_0xb2d3('0x6'));var interaction=require(_0xb2d3('0x7'));var config=require('../../config/environment');var controller=require(_0xb2d3('0x8'));router[_0xb2d3('0x9')]('/',auth[_0xb2d3('0xa')](),controller['index']);router[_0xb2d3('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb2d3('0xb')]);router[_0xb2d3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb2d3('0xc')]);router[_0xb2d3('0x9')](_0xb2d3('0xd'),auth[_0xb2d3('0xa')](),controller['getSections']);router['get'](_0xb2d3('0xe'),auth[_0xb2d3('0xa')](),controller[_0xb2d3('0xf')]);router[_0xb2d3('0x10')]('/',auth['isAuthenticated'](),controller[_0xb2d3('0x11')]);router['post'](_0xb2d3('0x12'),auth['isAuthenticated'](),controller[_0xb2d3('0x13')]);router['post']('/:id/sections',auth[_0xb2d3('0xa')](),controller['addSections']);router[_0xb2d3('0x10')]('/:id/resources',auth[_0xb2d3('0xa')](),controller[_0xb2d3('0x14')]);router['put'](_0xb2d3('0x15'),auth[_0xb2d3('0xa')](),controller[_0xb2d3('0x16')]);router['delete'](_0xb2d3('0x15'),auth['isAuthenticated'](),controller['destroy']);router[_0xb2d3('0x17')](_0xb2d3('0xd'),auth[_0xb2d3('0xa')](),controller[_0xb2d3('0x18')]);router[_0xb2d3('0x17')](_0xb2d3('0xe'),auth[_0xb2d3('0xa')](),controller[_0xb2d3('0x19')]);module[_0xb2d3('0x1a')]=router; \ No newline at end of file +var _0xdb04=['delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addSections','addResources','put','/:id'];(function(_0x494a8e,_0x5a9d82){var _0x2c65dd=function(_0x34e1c9){while(--_0x34e1c9){_0x494a8e['push'](_0x494a8e['shift']());}};_0x2c65dd(++_0x5a9d82);}(_0xdb04,0xed));var _0x4db0=function(_0x1f806e,_0xf653c1){_0x1f806e=_0x1f806e-0x0;var _0x2d6870=_0xdb04[_0x1f806e];return _0x2d6870;};'use strict';var multer=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var path=require(_0x4db0('0x2'));var timeout=require(_0x4db0('0x3'));var express=require(_0x4db0('0x4'));var router=express[_0x4db0('0x5')]();var fs_extra=require(_0x4db0('0x6'));var auth=require(_0x4db0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4db0('0x8'));router[_0x4db0('0x9')]('/',auth[_0x4db0('0xa')](),controller[_0x4db0('0xb')]);router[_0x4db0('0x9')](_0x4db0('0xc'),auth[_0x4db0('0xa')](),controller[_0x4db0('0xd')]);router['get']('/:id',auth[_0x4db0('0xa')](),controller['show']);router[_0x4db0('0x9')]('/:id/sections',auth[_0x4db0('0xa')](),controller['getSections']);router[_0x4db0('0x9')](_0x4db0('0xe'),auth['isAuthenticated'](),controller[_0x4db0('0xf')]);router['post']('/',auth[_0x4db0('0xa')](),controller['create']);router[_0x4db0('0x10')](_0x4db0('0x11'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x12')]);router[_0x4db0('0x10')](_0x4db0('0x13'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x14')]);router[_0x4db0('0x10')]('/:id/resources',auth['isAuthenticated'](),controller[_0x4db0('0x15')]);router[_0x4db0('0x16')](_0x4db0('0x17'),auth[_0x4db0('0xa')](),controller['update']);router[_0x4db0('0x18')](_0x4db0('0x17'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x19')]);router['delete'](_0x4db0('0x13'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x1a')]);router['delete'](_0x4db0('0xe'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x1b')]);module[_0x4db0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index bbf310e..f0f74ba 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 _0x8767=['crudPermissions','join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x497849,_0x27e740){var _0x3abd96=function(_0x4b5848){while(--_0x4b5848){_0x497849['push'](_0x497849['shift']());}};_0x3abd96(++_0x27e740);}(_0x8767,0x12e));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7876('0x0')]={'name':{'type':Sequelize[_0x7876('0x1')],'allowNull':![],'unique':_0x7876('0x2')},'crudPermissions':{'type':Sequelize[_0x7876('0x1')],'set':function(_0x4641e6){this[_0x7876('0x3')](_0x7876('0x4'),_0x4641e6?_0x4641e6[_0x7876('0x5')](''):[]);},'get':function(){return this[_0x7876('0x6')]('crudPermissions')?this[_0x7876('0x6')](_0x7876('0x4'))[_0x7876('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7876('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7876('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7876('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7876('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7876('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7876('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7876('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7876('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x63e1=['name','setDataValue','crudPermissions','join','getDataValue','STRING','BOOLEAN','exports'];(function(_0x5eadb1,_0x3661ad){var _0x46425d=function(_0x563aac){while(--_0x563aac){_0x5eadb1['push'](_0x5eadb1['shift']());}};_0x46425d(++_0x3661ad);}(_0x63e1,0xb7));var _0x163e=function(_0x3028a6,_0x9a5ddc){_0x3028a6=_0x3028a6-0x0;var _0x1a7099=_0x63e1[_0x3028a6];return _0x1a7099;};'use strict';var Sequelize=require('sequelize');module[_0x163e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x163e('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x55fa4c){this[_0x163e('0x2')](_0x163e('0x3'),_0x55fa4c?_0x55fa4c[_0x163e('0x4')](''):[]);},'get':function(){return this[_0x163e('0x5')](_0x163e('0x3'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x163e('0x6')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x163e('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3b56847..e3db5e3 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 _0x7cd6=['intersection','attributes','length','nolimit','order','sort','pick','merge','where','map','filter','includeAll','include','findAll','then','rows','catch','params','fields','options','find','create','clone','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','autoAssociation','UserProfileResource','sectionId','userProfileId','UserProfileSection','Resources','describe','addSections','sequelize','each','push','ids','getSections','includes','isEmpty','subsections','enabled','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','destroy','error','stack','send','index','UserProfile','rawAttributes','fieldName','type','key','model','name','query','keys','filters'];(function(_0x3b6ced,_0x4ac2ef){var _0x4842a2=function(_0x44e76c){while(--_0x44e76c){_0x3b6ced['push'](_0x3b6ced['shift']());}};_0x4842a2(++_0x4ac2ef);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x11900e,_0x27232e){_0x11900e=_0x11900e-0x0;var _0x2ce8f4=_0x7cd6[_0x11900e];return _0x2ce8f4;};'use strict';var emlformat=require(_0x67cd('0x0'));var rimraf=require(_0x67cd('0x1'));var zipdir=require(_0x67cd('0x2'));var jsonpatch=require(_0x67cd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67cd('0x4'));var Mustache=require(_0x67cd('0x5'));var util=require(_0x67cd('0x6'));var path=require('path');var sox=require(_0x67cd('0x7'));var csv=require('to-csv');var ejs=require(_0x67cd('0x8'));var fs=require('fs');var fs_extra=require(_0x67cd('0x9'));var _=require(_0x67cd('0xa'));var squel=require(_0x67cd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67cd('0xc'));var querystring=require(_0x67cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x67cd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67cd('0xf'));var logger=require(_0x67cd('0x10'))(_0x67cd('0x11'));var utils=require(_0x67cd('0x12'));var config=require(_0x67cd('0x13'));var licenseUtil=require(_0x67cd('0x14'));var db=require('../../mysqldb')['db'];config[_0x67cd('0x15')]=_[_0x67cd('0x16')](config[_0x67cd('0x15')],{'host':_0x67cd('0x17'),'port':0x18eb});var socket=require(_0x67cd('0x18'))(new Redis(config[_0x67cd('0x15')]));require(_0x67cd('0x19'))[_0x67cd('0x1a')](socket);function respondWithStatusCode(_0x15da7d,_0x278285){_0x278285=_0x278285||0xcc;return function(_0x1a9aa3){if(_0x1a9aa3){return _0x15da7d[_0x67cd('0x1b')](_0x278285);}return _0x15da7d['status'](_0x278285)[_0x67cd('0x1c')]();};}function respondWithResult(_0x465590,_0x180720){_0x180720=_0x180720||0xc8;return function(_0x111333){if(_0x111333){return _0x465590[_0x67cd('0x1d')](_0x180720)['json'](_0x111333);}};}function respondWithFilteredResult(_0xb147d8,_0x5874ce){return function(_0x30cb35){if(_0x30cb35){var _0x4ea5d0=typeof _0x5874ce['offset']==='undefined'&&typeof _0x5874ce[_0x67cd('0x1e')]===_0x67cd('0x1f');var _0x4370e0=_0x30cb35[_0x67cd('0x20')];var _0x2b1d18=_0x4ea5d0?0x0:_0x5874ce[_0x67cd('0x21')];var _0x3c777d=_0x4ea5d0?_0x30cb35[_0x67cd('0x20')]:_0x5874ce[_0x67cd('0x21')]+_0x5874ce[_0x67cd('0x1e')];var _0x591019;if(_0x3c777d>=_0x4370e0){_0x3c777d=_0x4370e0;_0x591019=0xc8;}else{_0x591019=0xce;}_0xb147d8[_0x67cd('0x1d')](_0x591019);return _0xb147d8[_0x67cd('0x22')](_0x67cd('0x23'),_0x2b1d18+'-'+_0x3c777d+'/'+_0x4370e0)[_0x67cd('0x24')](_0x30cb35);}return null;};}function patchUpdates(_0x512760){return function(_0x48b1ec){try{jsonpatch[_0x67cd('0x25')](_0x48b1ec,_0x512760,!![]);}catch(_0x35ba2f){return BPromise[_0x67cd('0x26')](_0x35ba2f);}return _0x48b1ec['save']();};}function saveUpdates(_0x2230c1,_0x38ddf2){return function(_0x4ecad0){if(_0x4ecad0){return _0x4ecad0[_0x67cd('0x27')](_0x2230c1)['then'](function(_0x6b9e7){return _0x6b9e7;});}return null;};}function removeEntity(_0x3958bc,_0xbd0ca7){return function(_0x3a1caf){if(_0x3a1caf){return _0x3a1caf[_0x67cd('0x28')]()['then'](function(){_0x3958bc[_0x67cd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104b8e,_0x46002e){return function(_0x363b24){if(!_0x363b24){_0x104b8e[_0x67cd('0x1b')](0x194);}return _0x363b24;};}function handleError(_0x55caae,_0x4c1d39){_0x4c1d39=_0x4c1d39||0x1f4;return function(_0x1f252d){logger[_0x67cd('0x29')](_0x1f252d[_0x67cd('0x2a')]);if(_0x1f252d['name']){delete _0x1f252d['name'];}_0x55caae[_0x67cd('0x1d')](_0x4c1d39)[_0x67cd('0x2b')](_0x1f252d);};}exports[_0x67cd('0x2c')]=function(_0x3868af,_0x49e1e2){var _0x1578ce={},_0x2fbcca={},_0x331aba={'count':0x0,'rows':[]};var _0x554566=_['map'](db[_0x67cd('0x2d')][_0x67cd('0x2e')],function(_0x528bb2){return{'name':_0x528bb2[_0x67cd('0x2f')],'type':_0x528bb2[_0x67cd('0x30')][_0x67cd('0x31')]};});_0x2fbcca[_0x67cd('0x32')]=_['map'](_0x554566,_0x67cd('0x33'));_0x2fbcca[_0x67cd('0x34')]=_[_0x67cd('0x35')](_0x3868af[_0x67cd('0x34')]);_0x2fbcca[_0x67cd('0x36')]=_[_0x67cd('0x37')](_0x2fbcca[_0x67cd('0x32')],_0x2fbcca[_0x67cd('0x34')]);_0x1578ce[_0x67cd('0x38')]=_[_0x67cd('0x37')](_0x2fbcca['model'],qs['fields'](_0x3868af[_0x67cd('0x34')]['fields']));_0x1578ce[_0x67cd('0x38')]=_0x1578ce[_0x67cd('0x38')][_0x67cd('0x39')]?_0x1578ce['attributes']:_0x2fbcca[_0x67cd('0x32')];if(!_0x3868af[_0x67cd('0x34')]['hasOwnProperty'](_0x67cd('0x3a'))){_0x1578ce['limit']=qs[_0x67cd('0x1e')](_0x3868af[_0x67cd('0x34')]['limit']);_0x1578ce[_0x67cd('0x21')]=qs[_0x67cd('0x21')](_0x3868af[_0x67cd('0x34')][_0x67cd('0x21')]);}_0x1578ce[_0x67cd('0x3b')]=qs[_0x67cd('0x3c')](_0x3868af[_0x67cd('0x34')][_0x67cd('0x3c')]);_0x1578ce['where']=qs[_0x67cd('0x36')](_[_0x67cd('0x3d')](_0x3868af[_0x67cd('0x34')],_0x2fbcca[_0x67cd('0x36')]),_0x554566);if(_0x3868af[_0x67cd('0x34')]['filter']){_0x1578ce['where']=_[_0x67cd('0x3e')](_0x1578ce[_0x67cd('0x3f')],{'$or':_[_0x67cd('0x40')](_0x554566,function(_0x2bb9d1){if(_0x2bb9d1['type']!=='VIRTUAL'){var _0x8f018e={};_0x8f018e[_0x2bb9d1[_0x67cd('0x33')]]={'$like':'%'+_0x3868af[_0x67cd('0x34')][_0x67cd('0x41')]+'%'};return _0x8f018e;}})});}_0x1578ce=_[_0x67cd('0x3e')]({},_0x1578ce,_0x3868af['options']);var _0x363c49={'where':_0x1578ce[_0x67cd('0x3f')]};return db[_0x67cd('0x2d')][_0x67cd('0x20')](_0x363c49)['then'](function(_0x2bccd4){_0x331aba[_0x67cd('0x20')]=_0x2bccd4;if(_0x3868af[_0x67cd('0x34')][_0x67cd('0x42')]){_0x1578ce[_0x67cd('0x43')]=[{'all':!![]}];}return db[_0x67cd('0x2d')][_0x67cd('0x44')](_0x1578ce);})[_0x67cd('0x45')](function(_0x9ab74f){_0x331aba[_0x67cd('0x46')]=_0x9ab74f;return _0x331aba;})['then'](respondWithFilteredResult(_0x49e1e2,_0x1578ce))[_0x67cd('0x47')](handleError(_0x49e1e2,null));};exports['show']=function(_0x418859,_0x595ed3){var _0xbcaa74={'raw':![],'where':{'id':_0x418859[_0x67cd('0x48')]['id']}},_0x956307={};_0x956307[_0x67cd('0x32')]=_[_0x67cd('0x35')](db[_0x67cd('0x2d')][_0x67cd('0x2e')]);_0x956307[_0x67cd('0x34')]=_[_0x67cd('0x35')](_0x418859[_0x67cd('0x34')]);_0x956307[_0x67cd('0x36')]=_[_0x67cd('0x37')](_0x956307[_0x67cd('0x32')],_0x956307[_0x67cd('0x34')]);_0xbcaa74[_0x67cd('0x38')]=_['intersection'](_0x956307[_0x67cd('0x32')],qs[_0x67cd('0x49')](_0x418859[_0x67cd('0x34')]['fields']));_0xbcaa74[_0x67cd('0x38')]=_0xbcaa74['attributes'][_0x67cd('0x39')]?_0xbcaa74[_0x67cd('0x38')]:_0x956307['model'];if(_0x418859[_0x67cd('0x34')][_0x67cd('0x42')]){_0xbcaa74[_0x67cd('0x43')]=[{'all':!![]}];}_0xbcaa74=_[_0x67cd('0x3e')]({},_0xbcaa74,_0x418859[_0x67cd('0x4a')]);return db[_0x67cd('0x2d')][_0x67cd('0x4b')](_0xbcaa74)[_0x67cd('0x45')](handleEntityNotFound(_0x595ed3,null))[_0x67cd('0x45')](respondWithResult(_0x595ed3,null))[_0x67cd('0x47')](handleError(_0x595ed3,null));};exports['create']=function(_0x227278,_0x591450){return db[_0x67cd('0x2d')][_0x67cd('0x4c')](_0x227278['body'],{})['then'](respondWithResult(_0x591450,0xc9))['catch'](handleError(_0x591450,null));};exports[_0x67cd('0x4d')]=function(_0x5cb39b,_0x564846){var _0x32044f={'where':{'id':_0x5cb39b['params']['id']}},_0x470c38={};_0x470c38['model']=_[_0x67cd('0x35')](db[_0x67cd('0x2d')]['rawAttributes']);_0x32044f[_0x67cd('0x38')]=_[_0x67cd('0x37')](_0x470c38[_0x67cd('0x32')],qs[_0x67cd('0x49')](_0x5cb39b['query'][_0x67cd('0x49')]));_0x32044f['attributes']=_0x32044f['attributes']['length']?_0x32044f[_0x67cd('0x38')]:_0x470c38[_0x67cd('0x32')];if(_0x5cb39b['query']['includeAll']){_0x32044f[_0x67cd('0x43')]=[{'all':!![]}];}_0x32044f=_[_0x67cd('0x3e')]({},_0x32044f,_0x5cb39b[_0x67cd('0x4a')]);return db[_0x67cd('0x2d')][_0x67cd('0x4b')](_0x32044f)[_0x67cd('0x45')](handleEntityNotFound(_0x564846,null))['then'](function(_0x19bc5d){if(_0x19bc5d){var _0x4a07bb=_0x19bc5d[_0x67cd('0x4e')]({'plain':!![]});_0x4a07bb=qs[_0x67cd('0x4f')](_0x4a07bb,['id',_0x67cd('0x50'),_0x67cd('0x51'),_0x67cd('0x52')]);_0x5cb39b[_0x67cd('0x53')]=_[_0x67cd('0x4f')](_0x5cb39b[_0x67cd('0x53')],['id',_0x67cd('0x50'),'updatedAt']);return db['sequelize'][_0x67cd('0x54')](function(_0x252c41){return db[_0x67cd('0x2d')][_0x67cd('0x4c')](_[_0x67cd('0x3e')](_0x4a07bb,_0x5cb39b['body']),{'include':_0x5cb39b[_0x67cd('0x34')][_0x67cd('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x252c41})[_0x67cd('0x45')](function(_0x57f381){var _0x272b17=_0x57f381['get']({'plain':!![]});return db['UserProfileSection'][_0x67cd('0x44')]({'where':{'userProfileId':_0x5cb39b[_0x67cd('0x48')]['id']},'raw':!![]})[_0x67cd('0x45')](function(_0x1d757e){if(_0x1d757e){return BPromise['each'](_0x1d757e,function(_0x195f25){return new BPromise(function(_0xf1c080,_0x22fa5e){if(_0x195f25[_0x67cd('0x55')]===null||_0x195f25[_0x67cd('0x55')]===0x1)_0xf1c080(null);return db[_0x67cd('0x56')][_0x67cd('0x44')]({'where':{'sectionId':_0x195f25['id']},'raw':!![]})['then'](function(_0x10ee74){var _0x4c7998=_[_0x67cd('0x40')](_0x10ee74,function(_0x45be6b){return qs['omit'](_0x45be6b,['id',_0x67cd('0x50'),_0x67cd('0x51'),_0x67cd('0x57')]);});_0xf1c080(_0x4c7998);})['catch'](function(_0x3c4cda){_0x22fa5e(_0x3c4cda);});})[_0x67cd('0x45')](function(_0x1cae60){var _0x2e8f75=qs['omit'](_0x195f25,['id',_0x67cd('0x50'),'updatedAt']);_0x2e8f75[_0x67cd('0x58')]=_0x272b17['id'];if(_0x1cae60)_0x2e8f75['Resources']=_0x1cae60;return _0x2e8f75;})[_0x67cd('0x45')](function(_0x336615){return db[_0x67cd('0x59')]['create'](_0x336615,{'include':[{'model':db[_0x67cd('0x56')],'as':_0x67cd('0x5a')}],'raw':!![],'transaction':_0x252c41});});})[_0x67cd('0x45')](function(){return _0x272b17;});}});});});}})['then'](respondWithResult(_0x564846,0xc9))[_0x67cd('0x47')](handleError(_0x564846,null));};exports[_0x67cd('0x27')]=function(_0x517a6b,_0x30b6b1){if(_0x517a6b['body']['id']){delete _0x517a6b[_0x67cd('0x53')]['id'];}return db[_0x67cd('0x2d')][_0x67cd('0x4b')]({'where':{'id':_0x517a6b[_0x67cd('0x48')]['id']}})['then'](handleEntityNotFound(_0x30b6b1,null))[_0x67cd('0x45')](saveUpdates(_0x517a6b[_0x67cd('0x53')],null))[_0x67cd('0x45')](respondWithResult(_0x30b6b1,null))['catch'](handleError(_0x30b6b1,null));};exports['destroy']=function(_0x1c6346,_0x43d3f7){return db[_0x67cd('0x2d')]['find']({'where':{'id':_0x1c6346[_0x67cd('0x48')]['id']}})['then'](handleEntityNotFound(_0x43d3f7,null))[_0x67cd('0x45')](removeEntity(_0x43d3f7,null))[_0x67cd('0x47')](handleError(_0x43d3f7,null));};exports[_0x67cd('0x5b')]=function(_0x56e6f8,_0x4ccde2){return db[_0x67cd('0x2d')]['describe']()[_0x67cd('0x45')](respondWithResult(_0x4ccde2,null))['catch'](handleError(_0x4ccde2,null));};exports[_0x67cd('0x5c')]=function(_0x238ea9,_0x168124){var _0x16a22e=_0x238ea9['body'];return db[_0x67cd('0x2d')][_0x67cd('0x4b')]({'where':{'id':_0x238ea9[_0x67cd('0x48')]['id']}})[_0x67cd('0x45')](handleEntityNotFound(_0x168124,null))[_0x67cd('0x45')](function(_0x282f3c){if(_0x282f3c){return db[_0x67cd('0x5d')][_0x67cd('0x54')](function(_0x118bf0){return db[_0x67cd('0x59')][_0x67cd('0x28')]({'where':{'userProfileId':_0x238ea9[_0x67cd('0x48')]['id'],'sectionId':_['map'](_0x16a22e,function(_0x203ce9){return _0x203ce9[_0x67cd('0x57')];})},'transaction':_0x118bf0})[_0x67cd('0x45')](function(){var _0x37b475=_[_0x67cd('0x40')](_0x16a22e,function(_0x36a02e){_0x36a02e[_0x67cd('0x58')]=_0x238ea9[_0x67cd('0x48')]['id'];return _0x36a02e;});var _0x28bf26=[];return BPromise[_0x67cd('0x5e')](_0x37b475,function(_0x51f7f1){return db[_0x67cd('0x59')][_0x67cd('0x4c')](_0x51f7f1,{'include':[{'model':db[_0x67cd('0x56')],'as':_0x67cd('0x5a')}],'raw':!![],'transaction':_0x118bf0})['then'](function(_0x3e8af8){_0x28bf26[_0x67cd('0x5f')](_0x3e8af8[_0x67cd('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x28bf26;});});});}})[_0x67cd('0x45')](function(_0x14edfc){return _0x14edfc;})[_0x67cd('0x45')](respondWithResult(_0x168124,null))[_0x67cd('0x47')](handleError(_0x168124,null));};exports['removeSections']=function(_0x1f9603,_0x25da39){var _0x404232;return db[_0x67cd('0x2d')][_0x67cd('0x4b')]({'where':{'id':_0x1f9603[_0x67cd('0x48')]['id']},'attributes':['id',_0x67cd('0x33')]})[_0x67cd('0x45')](handleEntityNotFound(_0x25da39,null))[_0x67cd('0x45')](function(_0x4b0367){if(_0x4b0367){_0x404232=_0x4b0367;return db[_0x67cd('0x59')][_0x67cd('0x28')]({'where':{'userProfileId':_0x1f9603[_0x67cd('0x48')]['id'],'sectionId':_0x1f9603[_0x67cd('0x34')][_0x67cd('0x60')]}});}})[_0x67cd('0x45')](function(){return _0x404232;})[_0x67cd('0x45')](respondWithStatusCode(_0x25da39,null))[_0x67cd('0x47')](handleError(_0x25da39,null));};exports[_0x67cd('0x61')]=function(_0xfd6dda,_0x25e9c3){var _0x8d313d=[];var _0x11e473=[];return db[_0x67cd('0x59')][_0x67cd('0x44')]({'where':{'userProfileId':_0xfd6dda[_0x67cd('0x48')]['id']},'raw':!![]})[_0x67cd('0x45')](function(_0xd05f1){_0x8d313d=_['filter'](_0xd05f1,function(_0x292b8c){return _0x292b8c['enabled']===0x1||_[_0x67cd('0x62')]([0x3eb,0x709],_0x292b8c['sectionId']);});if(!_[_0x67cd('0x63')](_0x8d313d)){return _[_0x67cd('0x40')](_0x8d313d,function(_0x4e7b96){return _0x4e7b96[_0x67cd('0x57')];});}else{return;}})[_0x67cd('0x45')](function(_0x287c8e){if(_0x287c8e)_0x11e473=_0x287c8e;if(_['includes'](_0x11e473,0x64)){var _0x54dc9b=_[_0x67cd('0x4b')](_0x8d313d,{'sectionId':0x64});return hasDefaultDashboard(_0x54dc9b)[_0x67cd('0x45')](function(_0x8e542d){return _[_0x67cd('0x40')](_0x8d313d,function(_0x33aa3d){if(_0x33aa3d[_0x67cd('0x57')]===0x64){_0x33aa3d[_0x67cd('0x64')]=_0x8e542d;}return _0x33aa3d;});});}else{return;}})[_0x67cd('0x45')](function(_0x58afd1){if(_0x58afd1)_0x8d313d=_0x58afd1;if(_[_0x67cd('0x62')](_0x11e473,0x3eb)){var _0x454749=_[_0x67cd('0x4b')](_0x8d313d,{'sectionId':0x3eb});return getCustomDashboards(_0x454749)['then'](function(_0x384654){return _[_0x67cd('0x40')](_0x8d313d,function(_0x4d1d96){if(_0x454749[_0x67cd('0x65')]){if(_0x4d1d96[_0x67cd('0x57')]===0x3eb){_0x4d1d96['subsections']=_0x384654;}}else{if(_0x4d1d96['sectionId']===0x64){_0x4d1d96[_0x67cd('0x64')]=_0x384654;}}return _0x4d1d96;});});}else{return;}})['then'](function(_0xc52047){if(_0xc52047)_0x8d313d=_0xc52047;if(_[_0x67cd('0x62')](_0x11e473,0x709)){var _0x526a7d=_[_0x67cd('0x4b')](_0x8d313d,{'sectionId':0x709});return getPlugins(_0x526a7d)[_0x67cd('0x45')](function(_0x17b6b0){if(_0x526a7d[_0x67cd('0x65')]){return _[_0x67cd('0x40')](_0x8d313d,function(_0x384469){if(_0x384469[_0x67cd('0x57')]===0x709){_0x384469[_0x67cd('0x64')]=_0x17b6b0;}return _0x384469;});}else{var _0x50b1b4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x17b6b0};var _0x2e25b2=_['map'](_0x8d313d);_0x2e25b2['push'](_0x50b1b4);return _0x2e25b2;}});}else{return;}})[_0x67cd('0x45')](function(_0x421452){if(_0x421452)_0x8d313d=_0x421452;return _[_0x67cd('0x41')](_0x8d313d,[_0x67cd('0x65'),0x1]);})['then'](respondWithResult(_0x25e9c3,null))[_0x67cd('0x47')](handleError(_0x25e9c3,null));};function hasDefaultDashboard(_0x158d4a){var _0x10eea0=[0x65];return new BPromise(function(_0x5c7dfd,_0x35194c){try{if(_0x158d4a[_0x67cd('0x55')]){_0x5c7dfd(_0x10eea0);}else{return db[_0x67cd('0x56')]['findOne']({'where':{'sectionId':_0x158d4a['id']},'raw':!![]})[_0x67cd('0x45')](function(_0x1f5476){_0x1f5476?_0x5c7dfd(_0x10eea0):_0x5c7dfd();});}}catch(_0x499cc2){_0x35194c(_0x499cc2);}});}function getCustomDashboards(_0x347560){var _0x500594=[];return new BPromise(function(_0x5d230d,_0x40204b){try{if(_0x347560[_0x67cd('0x55')]){return db[_0x67cd('0x66')][_0x67cd('0x44')]({'raw':!![]})[_0x67cd('0x45')](function(_0x4cdd35){_0x4cdd35[_0x67cd('0x67')](function(_0x294776){_0x500594['push'](_0x294776['id']+0x1869f);});_0x5d230d(_0x500594);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x347560['id']},'raw':!![]})['then'](function(_0x4fd417){_0x4fd417[_0x67cd('0x67')](function(_0x134d5a){_0x500594[_0x67cd('0x5f')](_0x134d5a[_0x67cd('0x68')]+0x1869f);});_0x5d230d(_0x500594);});}}catch(_0xee028e){_0x40204b(_0xee028e);}});}function getPlugins(_0x1337a4){var _0x3c53ca=[];return new BPromise(function(_0x18ba85,_0x4b617d){try{if(_0x1337a4[_0x67cd('0x55')]){return db[_0x67cd('0x69')]['findAll']({'raw':!![]})[_0x67cd('0x45')](function(_0x287fcb){_0x287fcb['forEach'](function(_0x63f484){_0x3c53ca[_0x67cd('0x5f')](_0x63f484['id']+0x15b38);});_0x18ba85(_0x3c53ca);});}else{return db['UserProfileResource'][_0x67cd('0x44')]({'where':{'sectionId':_0x1337a4['id']},'raw':!![]})[_0x67cd('0x45')](function(_0x19d061){_0x19d061[_0x67cd('0x67')](function(_0x4ecb85){_0x3c53ca[_0x67cd('0x5f')](_0x4ecb85[_0x67cd('0x68')]+0x15b38);});_0x18ba85(_0x3c53ca);});}}catch(_0x56c50a){_0x4b617d(_0x56c50a);}});}exports['addResources']=function(_0x32c6ba,_0x32be9d){return db[_0x67cd('0x2d')][_0x67cd('0x4b')]({'where':{'id':_0x32c6ba['params']['id']}})[_0x67cd('0x45')](handleEntityNotFound(_0x32be9d,null))[_0x67cd('0x45')](function(_0x10c422){if(_0x10c422){return db[_0x67cd('0x5d')][_0x67cd('0x54')](function(_0x356942){return db[_0x67cd('0x59')]['findAll']({'where':{'userProfileId':_0x32c6ba['params']['id']},'attributes':['id'],'raw':!![]})[_0x67cd('0x45')](function(_0x57647e){if(_0x57647e){return db[_0x67cd('0x59')][_0x67cd('0x28')]({'where':{'userProfileId':_0x32c6ba[_0x67cd('0x48')]['id'],'id':_['map'](_0x57647e,function(_0x1b268b){return _0x1b268b['id'];})},'transaction':_0x356942});}})[_0x67cd('0x45')](function(_0x332aa7){var _0x16b6d1=_[_0x67cd('0x40')](_0x32c6ba[_0x67cd('0x53')],function(_0x50bb67){_0x50bb67[_0x67cd('0x58')]=_0x32c6ba[_0x67cd('0x48')]['id'];return _0x50bb67;});return db[_0x67cd('0x59')][_0x67cd('0x6a')](_0x16b6d1,{'raw':!![],'transaction':_0x356942});})[_0x67cd('0x45')](function(_0x2719ad){var _0x5b283a=_[_0x67cd('0x41')](_[_0x67cd('0x40')](_0x2719ad,function(_0x17cd3a){return _0x17cd3a[_0x67cd('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x5b283a){return db['UserProfileSection'][_0x67cd('0x44')]({'where':{'userProfileId':_0x32c6ba[_0x67cd('0x48')]['id'],'sectionId':_['map'](_0x5b283a,function(_0x5eeb64){return _0x5eeb64[_0x67cd('0x57')];})},'attributes':['id',_0x67cd('0x57')],'raw':!![]})[_0x67cd('0x45')](function(_0x5232d6){var _0x348922=_[_0x67cd('0x40')](_0x32c6ba['body'],function(_0x51f455){_0x51f455[_0x67cd('0x58')]=_0x32c6ba[_0x67cd('0x48')]['id'];return _0x51f455;});return db[_0x67cd('0x56')][_0x67cd('0x6a')](_0x348922,{'raw':!![],'transaction':_0x356942});});}})[_0x67cd('0x47')](handleError(_0x32be9d,null));});}})['then'](function(_0x4fbe6b){var _0x1831c7=_[_0x67cd('0x40')](_0x4fbe6b,function(_0xf48d){return _0xf48d['get']({'plain':!![]});});})[_0x67cd('0x45')](respondWithResult(_0x32be9d,null))[_0x67cd('0x47')](handleError(_0x32be9d,null));};exports[_0x67cd('0x6b')]=function(_0xbb9281,_0x57997b,_0x1baf47){return db[_0x67cd('0x2d')][_0x67cd('0x4b')]({'where':{'id':_0xbb9281['params']['id']}})[_0x67cd('0x45')](handleEntityNotFound(_0x57997b,null))[_0x67cd('0x45')](function(_0x4574a2){if(_0x4574a2){return _0x4574a2[_0x67cd('0x6b')](_0xbb9281[_0x67cd('0x34')][_0x67cd('0x60')]);}})['then'](respondWithStatusCode(_0x57997b,null))[_0x67cd('0x47')](handleError(_0x57997b,null));};exports['getResources']=function(_0x30ee6a,_0x3c0ad6){var _0x523216={};if(!_0x30ee6a[_0x67cd('0x34')]['section'])throw new Error(_0x67cd('0x6c'));if(!_0x30ee6a['query']['hasOwnProperty']('nolimit')){_0x523216[_0x67cd('0x1e')]=qs[_0x67cd('0x1e')](_0x30ee6a[_0x67cd('0x34')][_0x67cd('0x1e')]);_0x523216[_0x67cd('0x21')]=qs['offset'](_0x30ee6a[_0x67cd('0x34')][_0x67cd('0x21')]);}return db[_0x67cd('0x2d')]['find']({'where':{'id':_0x30ee6a[_0x67cd('0x48')]['id']}})['then'](function(_0x1a9c73){if(!_0x1a9c73)throw new Error(_0x67cd('0x6d')+_0x30ee6a['params']['id']);return db[_0x67cd('0x2d')][_0x67cd('0x6e')](_0x30ee6a);})[_0x67cd('0x45')](respondWithFilteredResult(_0x3c0ad6,_0x523216))[_0x67cd('0x47')](handleError(_0x3c0ad6,null));}; \ No newline at end of file +var _0x4253=['ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','undefined','count','offset','Content-Range','json','apply','save','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','catch','show','includeAll','find','create','body','clone','params','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','get','UserProfileSection','each','findAll','userProfileId','Resources','update','describe','UserProfileResource','push','removeSections','ids','getSections','enabled','includes','sectionId','isEmpty','subsections','autoAssociation','findOne','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x46ff33,_0xfc5d31){var _0x41fbc9=function(_0x4ef401){while(--_0x4ef401){_0x46ff33['push'](_0x46ff33['shift']());}};_0x41fbc9(++_0xfc5d31);}(_0x4253,0x14c));var _0x3425=function(_0x3fd6ba,_0x5b7a00){_0x3fd6ba=_0x3fd6ba-0x0;var _0x4f5ace=_0x4253[_0x3fd6ba];return _0x4f5ace;};'use strict';var emlformat=require(_0x3425('0x0'));var rimraf=require(_0x3425('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3425('0x2'));var rp=require('request-promise');var moment=require(_0x3425('0x3'));var BPromise=require(_0x3425('0x4'));var Mustache=require(_0x3425('0x5'));var util=require(_0x3425('0x6'));var path=require(_0x3425('0x7'));var sox=require(_0x3425('0x8'));var csv=require(_0x3425('0x9'));var ejs=require(_0x3425('0xa'));var fs=require('fs');var fs_extra=require(_0x3425('0xb'));var _=require('lodash');var squel=require(_0x3425('0xc'));var crypto=require(_0x3425('0xd'));var jsforce=require(_0x3425('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3425('0x9'));var querystring=require(_0x3425('0xf'));var Papa=require('papaparse');var Redis=require(_0x3425('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3425('0x11'));var logger=require(_0x3425('0x12'))(_0x3425('0x13'));var utils=require('../../config/utils');var config=require(_0x3425('0x14'));var licenseUtil=require(_0x3425('0x15'));var db=require(_0x3425('0x16'))['db'];config['redis']=_[_0x3425('0x17')](config[_0x3425('0x18')],{'host':_0x3425('0x19'),'port':0x18eb});var socket=require(_0x3425('0x1a'))(new Redis(config[_0x3425('0x18')]));require(_0x3425('0x1b'))[_0x3425('0x1c')](socket);function respondWithStatusCode(_0x4ded18,_0x1b5984){_0x1b5984=_0x1b5984||0xcc;return function(_0x47b584){if(_0x47b584){return _0x4ded18[_0x3425('0x1d')](_0x1b5984);}return _0x4ded18[_0x3425('0x1e')](_0x1b5984)['end']();};}function respondWithResult(_0x169458,_0x1ab174){_0x1ab174=_0x1ab174||0xc8;return function(_0x57fe16){if(_0x57fe16){return _0x169458[_0x3425('0x1e')](_0x1ab174)['json'](_0x57fe16);}};}function respondWithFilteredResult(_0xd43449,_0x2ffce2){return function(_0x1565c8){if(_0x1565c8){var _0x2156c4=typeof _0x2ffce2['offset']===_0x3425('0x1f')&&typeof _0x2ffce2['limit']===_0x3425('0x1f');var _0xe4b66e=_0x1565c8[_0x3425('0x20')];var _0x72df8b=_0x2156c4?0x0:_0x2ffce2[_0x3425('0x21')];var _0x3444b6=_0x2156c4?_0x1565c8[_0x3425('0x20')]:_0x2ffce2[_0x3425('0x21')]+_0x2ffce2['limit'];var _0x4a6131;if(_0x3444b6>=_0xe4b66e){_0x3444b6=_0xe4b66e;_0x4a6131=0xc8;}else{_0x4a6131=0xce;}_0xd43449[_0x3425('0x1e')](_0x4a6131);return _0xd43449['set'](_0x3425('0x22'),_0x72df8b+'-'+_0x3444b6+'/'+_0xe4b66e)[_0x3425('0x23')](_0x1565c8);}return null;};}function patchUpdates(_0x11705a){return function(_0x29abdd){try{jsonpatch[_0x3425('0x24')](_0x29abdd,_0x11705a,!![]);}catch(_0x2f9881){return BPromise['reject'](_0x2f9881);}return _0x29abdd[_0x3425('0x25')]();};}function saveUpdates(_0x34617c,_0x476504){return function(_0x1e6ef0){if(_0x1e6ef0){return _0x1e6ef0['update'](_0x34617c)[_0x3425('0x26')](function(_0x31d4d5){return _0x31d4d5;});}return null;};}function removeEntity(_0x2a2162,_0x407a76){return function(_0x6f3dd7){if(_0x6f3dd7){return _0x6f3dd7[_0x3425('0x27')]()[_0x3425('0x26')](function(){_0x2a2162[_0x3425('0x1e')](0xcc)[_0x3425('0x28')]();});}};}function handleEntityNotFound(_0xd63a3f,_0x354cb8){return function(_0x16c50a){if(!_0x16c50a){_0xd63a3f[_0x3425('0x1d')](0x194);}return _0x16c50a;};}function handleError(_0x3643e5,_0x4d862d){_0x4d862d=_0x4d862d||0x1f4;return function(_0x1ae04f){logger[_0x3425('0x29')](_0x1ae04f[_0x3425('0x2a')]);if(_0x1ae04f[_0x3425('0x2b')]){delete _0x1ae04f[_0x3425('0x2b')];}_0x3643e5[_0x3425('0x1e')](_0x4d862d)[_0x3425('0x2c')](_0x1ae04f);};}exports[_0x3425('0x2d')]=function(_0xc2f4f5,_0x15aca6){var _0x24b353={},_0xf4111={},_0x256a64={'count':0x0,'rows':[]};var _0x425753=_[_0x3425('0x2e')](db[_0x3425('0x2f')][_0x3425('0x30')],function(_0x4001ac){return{'name':_0x4001ac['fieldName'],'type':_0x4001ac[_0x3425('0x31')][_0x3425('0x32')]};});_0xf4111[_0x3425('0x33')]=_['map'](_0x425753,_0x3425('0x2b'));_0xf4111[_0x3425('0x34')]=_[_0x3425('0x35')](_0xc2f4f5[_0x3425('0x34')]);_0xf4111[_0x3425('0x36')]=_[_0x3425('0x37')](_0xf4111[_0x3425('0x33')],_0xf4111[_0x3425('0x34')]);_0x24b353[_0x3425('0x38')]=_[_0x3425('0x37')](_0xf4111[_0x3425('0x33')],qs[_0x3425('0x39')](_0xc2f4f5['query'][_0x3425('0x39')]));_0x24b353[_0x3425('0x38')]=_0x24b353[_0x3425('0x38')][_0x3425('0x3a')]?_0x24b353[_0x3425('0x38')]:_0xf4111[_0x3425('0x33')];if(!_0xc2f4f5[_0x3425('0x34')][_0x3425('0x3b')](_0x3425('0x3c'))){_0x24b353[_0x3425('0x3d')]=qs[_0x3425('0x3d')](_0xc2f4f5[_0x3425('0x34')]['limit']);_0x24b353[_0x3425('0x21')]=qs[_0x3425('0x21')](_0xc2f4f5[_0x3425('0x34')][_0x3425('0x21')]);}_0x24b353[_0x3425('0x3e')]=qs[_0x3425('0x3f')](_0xc2f4f5[_0x3425('0x34')][_0x3425('0x3f')]);_0x24b353[_0x3425('0x40')]=qs[_0x3425('0x36')](_[_0x3425('0x41')](_0xc2f4f5['query'],_0xf4111[_0x3425('0x36')]),_0x425753);if(_0xc2f4f5[_0x3425('0x34')]['filter']){_0x24b353[_0x3425('0x40')]=_[_0x3425('0x42')](_0x24b353[_0x3425('0x40')],{'$or':_[_0x3425('0x2e')](_0x425753,function(_0x4c6efd){if(_0x4c6efd[_0x3425('0x31')]!==_0x3425('0x43')){var _0x3b3d46={};_0x3b3d46[_0x4c6efd['name']]={'$like':'%'+_0xc2f4f5['query'][_0x3425('0x44')]+'%'};return _0x3b3d46;}})});}_0x24b353=_[_0x3425('0x42')]({},_0x24b353,_0xc2f4f5[_0x3425('0x45')]);var _0xd83775={'where':_0x24b353['where']};return db[_0x3425('0x2f')][_0x3425('0x20')](_0xd83775)[_0x3425('0x26')](function(_0x175084){_0x256a64[_0x3425('0x20')]=_0x175084;if(_0xc2f4f5[_0x3425('0x34')]['includeAll']){_0x24b353[_0x3425('0x46')]=[{'all':!![]}];}return db[_0x3425('0x2f')]['findAll'](_0x24b353);})['then'](function(_0x1b8633){_0x256a64['rows']=_0x1b8633;return _0x256a64;})[_0x3425('0x26')](respondWithFilteredResult(_0x15aca6,_0x24b353))[_0x3425('0x47')](handleError(_0x15aca6,null));};exports[_0x3425('0x48')]=function(_0x1435b4,_0x40db42){var _0x660947={'raw':![],'where':{'id':_0x1435b4['params']['id']}},_0x217a16={};_0x217a16['model']=_[_0x3425('0x35')](db[_0x3425('0x2f')][_0x3425('0x30')]);_0x217a16[_0x3425('0x34')]=_[_0x3425('0x35')](_0x1435b4[_0x3425('0x34')]);_0x217a16['filters']=_[_0x3425('0x37')](_0x217a16[_0x3425('0x33')],_0x217a16[_0x3425('0x34')]);_0x660947[_0x3425('0x38')]=_[_0x3425('0x37')](_0x217a16[_0x3425('0x33')],qs['fields'](_0x1435b4[_0x3425('0x34')][_0x3425('0x39')]));_0x660947['attributes']=_0x660947[_0x3425('0x38')]['length']?_0x660947['attributes']:_0x217a16[_0x3425('0x33')];if(_0x1435b4[_0x3425('0x34')][_0x3425('0x49')]){_0x660947['include']=[{'all':!![]}];}_0x660947=_[_0x3425('0x42')]({},_0x660947,_0x1435b4['options']);return db[_0x3425('0x2f')][_0x3425('0x4a')](_0x660947)['then'](handleEntityNotFound(_0x40db42,null))[_0x3425('0x26')](respondWithResult(_0x40db42,null))[_0x3425('0x47')](handleError(_0x40db42,null));};exports[_0x3425('0x4b')]=function(_0x17626f,_0x357312){return db[_0x3425('0x2f')][_0x3425('0x4b')](_0x17626f[_0x3425('0x4c')],{})[_0x3425('0x26')](respondWithResult(_0x357312,0xc9))[_0x3425('0x47')](handleError(_0x357312,null));};exports[_0x3425('0x4d')]=function(_0x511379,_0x7bb1d){var _0x25d92b={'where':{'id':_0x511379[_0x3425('0x4e')]['id']}},_0x567164={};_0x567164[_0x3425('0x33')]=_['keys'](db['UserProfile'][_0x3425('0x30')]);_0x25d92b[_0x3425('0x38')]=_[_0x3425('0x37')](_0x567164['model'],qs[_0x3425('0x39')](_0x511379[_0x3425('0x34')][_0x3425('0x39')]));_0x25d92b['attributes']=_0x25d92b['attributes'][_0x3425('0x3a')]?_0x25d92b[_0x3425('0x38')]:_0x567164[_0x3425('0x33')];if(_0x511379[_0x3425('0x34')][_0x3425('0x49')]){_0x25d92b['include']=[{'all':!![]}];}_0x25d92b=_['merge']({},_0x25d92b,_0x511379[_0x3425('0x45')]);return db[_0x3425('0x2f')][_0x3425('0x4a')](_0x25d92b)['then'](handleEntityNotFound(_0x7bb1d,null))[_0x3425('0x26')](function(_0x4907d6){if(_0x4907d6){var _0x6c3b72=_0x4907d6['get']({'plain':!![]});_0x6c3b72=qs['omit'](_0x6c3b72,['id',_0x3425('0x4f'),_0x3425('0x50'),_0x3425('0x51')]);_0x511379[_0x3425('0x4c')]=_[_0x3425('0x52')](_0x511379[_0x3425('0x4c')],['id',_0x3425('0x4f'),_0x3425('0x50')]);return db[_0x3425('0x53')][_0x3425('0x54')](function(_0x1a3f16){return db[_0x3425('0x2f')][_0x3425('0x4b')](_[_0x3425('0x42')](_0x6c3b72,_0x511379['body']),{'include':_0x511379[_0x3425('0x34')][_0x3425('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x1a3f16})['then'](function(_0x3e0abc){var _0x23e2b9=_0x3e0abc[_0x3425('0x55')]({'plain':!![]});return db[_0x3425('0x56')]['findAll']({'where':{'userProfileId':_0x511379[_0x3425('0x4e')]['id']},'raw':!![]})['then'](function(_0x3ccead){if(_0x3ccead){return BPromise[_0x3425('0x57')](_0x3ccead,function(_0x5a2919){return new BPromise(function(_0x136067,_0x1c6724){if(_0x5a2919['autoAssociation']===null||_0x5a2919['autoAssociation']===0x1)_0x136067(null);return db['UserProfileResource'][_0x3425('0x58')]({'where':{'sectionId':_0x5a2919['id']},'raw':!![]})[_0x3425('0x26')](function(_0x588472){var _0x37a8ce=_['map'](_0x588472,function(_0x2d3513){return qs[_0x3425('0x52')](_0x2d3513,['id',_0x3425('0x4f'),_0x3425('0x50'),'sectionId']);});_0x136067(_0x37a8ce);})[_0x3425('0x47')](function(_0x247ea9){_0x1c6724(_0x247ea9);});})[_0x3425('0x26')](function(_0x3eb74c){var _0x11844b=qs[_0x3425('0x52')](_0x5a2919,['id',_0x3425('0x4f'),_0x3425('0x50')]);_0x11844b[_0x3425('0x59')]=_0x23e2b9['id'];if(_0x3eb74c)_0x11844b[_0x3425('0x5a')]=_0x3eb74c;return _0x11844b;})['then'](function(_0x28682d){return db[_0x3425('0x56')][_0x3425('0x4b')](_0x28682d,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1a3f16});});})[_0x3425('0x26')](function(){return _0x23e2b9;});}});});});}})['then'](respondWithResult(_0x7bb1d,0xc9))[_0x3425('0x47')](handleError(_0x7bb1d,null));};exports[_0x3425('0x5b')]=function(_0x4e1f18,_0x3492f0){if(_0x4e1f18[_0x3425('0x4c')]['id']){delete _0x4e1f18[_0x3425('0x4c')]['id'];}return db[_0x3425('0x2f')][_0x3425('0x4a')]({'where':{'id':_0x4e1f18[_0x3425('0x4e')]['id']}})[_0x3425('0x26')](handleEntityNotFound(_0x3492f0,null))[_0x3425('0x26')](saveUpdates(_0x4e1f18[_0x3425('0x4c')],null))[_0x3425('0x26')](respondWithResult(_0x3492f0,null))['catch'](handleError(_0x3492f0,null));};exports[_0x3425('0x27')]=function(_0x279b7a,_0x22bdd4){return db['UserProfile']['find']({'where':{'id':_0x279b7a[_0x3425('0x4e')]['id']}})[_0x3425('0x26')](handleEntityNotFound(_0x22bdd4,null))[_0x3425('0x26')](removeEntity(_0x22bdd4,null))['catch'](handleError(_0x22bdd4,null));};exports[_0x3425('0x5c')]=function(_0x3f93f3,_0x653713){return db[_0x3425('0x2f')][_0x3425('0x5c')]()[_0x3425('0x26')](respondWithResult(_0x653713,null))[_0x3425('0x47')](handleError(_0x653713,null));};exports['addSections']=function(_0x118f00,_0x37622f){var _0x37dda2=_0x118f00[_0x3425('0x4c')];return db[_0x3425('0x2f')]['find']({'where':{'id':_0x118f00[_0x3425('0x4e')]['id']}})['then'](handleEntityNotFound(_0x37622f,null))[_0x3425('0x26')](function(_0x491c5c){if(_0x491c5c){return db[_0x3425('0x53')]['transaction'](function(_0x2b584a){return db[_0x3425('0x56')]['destroy']({'where':{'userProfileId':_0x118f00['params']['id'],'sectionId':_[_0x3425('0x2e')](_0x37dda2,function(_0x388ea6){return _0x388ea6['sectionId'];})},'transaction':_0x2b584a})[_0x3425('0x26')](function(){var _0x5d43a=_[_0x3425('0x2e')](_0x37dda2,function(_0x5cd73c){_0x5cd73c[_0x3425('0x59')]=_0x118f00[_0x3425('0x4e')]['id'];return _0x5cd73c;});var _0x3fb9fe=[];return BPromise[_0x3425('0x57')](_0x5d43a,function(_0x582f49){return db['UserProfileSection']['create'](_0x582f49,{'include':[{'model':db[_0x3425('0x5d')],'as':_0x3425('0x5a')}],'raw':!![],'transaction':_0x2b584a})['then'](function(_0x4946bb){_0x3fb9fe[_0x3425('0x5e')](_0x4946bb[_0x3425('0x55')]({'plain':!![]}));});})[_0x3425('0x26')](function(){return _0x3fb9fe;});});});}})['then'](function(_0x4946d3){return _0x4946d3;})[_0x3425('0x26')](respondWithResult(_0x37622f,null))[_0x3425('0x47')](handleError(_0x37622f,null));};exports[_0x3425('0x5f')]=function(_0x1fd540,_0x4c169e){var _0x3b07de;return db[_0x3425('0x2f')][_0x3425('0x4a')]({'where':{'id':_0x1fd540[_0x3425('0x4e')]['id']},'attributes':['id','name']})[_0x3425('0x26')](handleEntityNotFound(_0x4c169e,null))['then'](function(_0x1248d3){if(_0x1248d3){_0x3b07de=_0x1248d3;return db['UserProfileSection'][_0x3425('0x27')]({'where':{'userProfileId':_0x1fd540[_0x3425('0x4e')]['id'],'sectionId':_0x1fd540[_0x3425('0x34')][_0x3425('0x60')]}});}})[_0x3425('0x26')](function(){return _0x3b07de;})[_0x3425('0x26')](respondWithStatusCode(_0x4c169e,null))[_0x3425('0x47')](handleError(_0x4c169e,null));};exports[_0x3425('0x61')]=function(_0x5b2b50,_0x5b53b8){var _0x2de35f=[];var _0x2a15f5=[];return db[_0x3425('0x56')][_0x3425('0x58')]({'where':{'userProfileId':_0x5b2b50[_0x3425('0x4e')]['id']},'raw':!![]})['then'](function(_0x40bf7a){_0x2de35f=_[_0x3425('0x44')](_0x40bf7a,function(_0x544643){return _0x544643[_0x3425('0x62')]===0x1||_[_0x3425('0x63')]([0x3eb,0x709],_0x544643[_0x3425('0x64')]);});if(!_[_0x3425('0x65')](_0x2de35f)){return _[_0x3425('0x2e')](_0x2de35f,function(_0x13b127){return _0x13b127['sectionId'];});}else{return;}})['then'](function(_0x35f4d8){if(_0x35f4d8)_0x2a15f5=_0x35f4d8;if(_[_0x3425('0x63')](_0x2a15f5,0x64)){var _0x2098cf=_[_0x3425('0x4a')](_0x2de35f,{'sectionId':0x64});return hasDefaultDashboard(_0x2098cf)[_0x3425('0x26')](function(_0x10d93f){return _[_0x3425('0x2e')](_0x2de35f,function(_0x544299){if(_0x544299[_0x3425('0x64')]===0x64){_0x544299[_0x3425('0x66')]=_0x10d93f;}return _0x544299;});});}else{return;}})[_0x3425('0x26')](function(_0x2b8671){if(_0x2b8671)_0x2de35f=_0x2b8671;if(_['includes'](_0x2a15f5,0x3eb)){var _0x5bc7ad=_[_0x3425('0x4a')](_0x2de35f,{'sectionId':0x3eb});return getCustomDashboards(_0x5bc7ad)[_0x3425('0x26')](function(_0x47eb35){return _['map'](_0x2de35f,function(_0x1ed036){if(_0x5bc7ad[_0x3425('0x62')]){if(_0x1ed036[_0x3425('0x64')]===0x3eb){_0x1ed036['subsections']=_0x47eb35;}}else{if(_0x1ed036[_0x3425('0x64')]===0x64){_0x1ed036[_0x3425('0x66')]=_0x47eb35;}}return _0x1ed036;});});}else{return;}})[_0x3425('0x26')](function(_0x50f26e){if(_0x50f26e)_0x2de35f=_0x50f26e;if(_[_0x3425('0x63')](_0x2a15f5,0x709)){var _0x358906=_[_0x3425('0x4a')](_0x2de35f,{'sectionId':0x709});return getPlugins(_0x358906)[_0x3425('0x26')](function(_0x2e5001){if(_0x358906[_0x3425('0x62')]){return _[_0x3425('0x2e')](_0x2de35f,function(_0x33641e){if(_0x33641e['sectionId']===0x709){_0x33641e[_0x3425('0x66')]=_0x2e5001;}return _0x33641e;});}else{var _0x44ee53={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e5001};var _0x13bbea=_[_0x3425('0x2e')](_0x2de35f);_0x13bbea['push'](_0x44ee53);return _0x13bbea;}});}else{return;}})[_0x3425('0x26')](function(_0x48e287){if(_0x48e287)_0x2de35f=_0x48e287;return _['filter'](_0x2de35f,[_0x3425('0x62'),0x1]);})[_0x3425('0x26')](respondWithResult(_0x5b53b8,null))[_0x3425('0x47')](handleError(_0x5b53b8,null));};function hasDefaultDashboard(_0x29922d){var _0x2523db=[0x65];return new BPromise(function(_0xf73d26,_0x55bc9c){try{if(_0x29922d[_0x3425('0x67')]){_0xf73d26(_0x2523db);}else{return db[_0x3425('0x5d')][_0x3425('0x68')]({'where':{'sectionId':_0x29922d['id']},'raw':!![]})[_0x3425('0x26')](function(_0x9043dc){_0x9043dc?_0xf73d26(_0x2523db):_0xf73d26();});}}catch(_0x2f0091){_0x55bc9c(_0x2f0091);}});}function getCustomDashboards(_0x56b9e3){var _0x212e51=[];return new BPromise(function(_0xebd283,_0x111cdd){try{if(_0x56b9e3[_0x3425('0x67')]){return db['Dashboard'][_0x3425('0x58')]({'raw':!![]})['then'](function(_0x29130a){_0x29130a[_0x3425('0x69')](function(_0xa99fe3){_0x212e51[_0x3425('0x5e')](_0xa99fe3['id']+0x1869f);});_0xebd283(_0x212e51);});}else{return db[_0x3425('0x5d')]['findAll']({'where':{'sectionId':_0x56b9e3['id']},'raw':!![]})['then'](function(_0x4268cc){_0x4268cc['forEach'](function(_0x490adf){_0x212e51['push'](_0x490adf['resourceId']+0x1869f);});_0xebd283(_0x212e51);});}}catch(_0x376a08){_0x111cdd(_0x376a08);}});}function getPlugins(_0x5b453f){var _0x493f2c=[];return new BPromise(function(_0x3e2eaf,_0x166da7){try{if(_0x5b453f[_0x3425('0x67')]){return db[_0x3425('0x6a')][_0x3425('0x58')]({'raw':!![]})[_0x3425('0x26')](function(_0x2af420){_0x2af420[_0x3425('0x69')](function(_0x3bf581){_0x493f2c[_0x3425('0x5e')](_0x3bf581['id']+0x15b38);});_0x3e2eaf(_0x493f2c);});}else{return db[_0x3425('0x5d')][_0x3425('0x58')]({'where':{'sectionId':_0x5b453f['id']},'raw':!![]})['then'](function(_0x4c9cb0){_0x4c9cb0[_0x3425('0x69')](function(_0xd4ab0){_0x493f2c[_0x3425('0x5e')](_0xd4ab0[_0x3425('0x6b')]+0x15b38);});_0x3e2eaf(_0x493f2c);});}}catch(_0x13c6d4){_0x166da7(_0x13c6d4);}});}exports['addResources']=function(_0x198ee7,_0x536d8a){return db['UserProfile'][_0x3425('0x4a')]({'where':{'id':_0x198ee7['params']['id']}})[_0x3425('0x26')](handleEntityNotFound(_0x536d8a,null))[_0x3425('0x26')](function(_0x4b8232){if(_0x4b8232){return db['sequelize']['transaction'](function(_0x609d54){return db[_0x3425('0x56')]['findAll']({'where':{'userProfileId':_0x198ee7[_0x3425('0x4e')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x48f3e1){if(_0x48f3e1){return db[_0x3425('0x56')][_0x3425('0x27')]({'where':{'userProfileId':_0x198ee7[_0x3425('0x4e')]['id'],'id':_[_0x3425('0x2e')](_0x48f3e1,function(_0x156e03){return _0x156e03['id'];})},'transaction':_0x609d54});}})[_0x3425('0x26')](function(_0x4f2a8a){var _0x46d743=_['map'](_0x198ee7[_0x3425('0x4c')],function(_0x242625){_0x242625['userProfileId']=_0x198ee7[_0x3425('0x4e')]['id'];return _0x242625;});return db[_0x3425('0x56')][_0x3425('0x6c')](_0x46d743,{'raw':!![],'transaction':_0x609d54});})[_0x3425('0x26')](function(_0x348074){var _0x3701d9=_['filter'](_[_0x3425('0x2e')](_0x348074,function(_0x5095b6){return _0x5095b6['get']({'plain':!![]});}),{'includeAll':![]});if(_0x3701d9){return db[_0x3425('0x56')]['findAll']({'where':{'userProfileId':_0x198ee7[_0x3425('0x4e')]['id'],'sectionId':_[_0x3425('0x2e')](_0x3701d9,function(_0x262e36){return _0x262e36[_0x3425('0x64')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x3425('0x26')](function(_0x36cbc0){var _0x53b9d1=_['map'](_0x198ee7[_0x3425('0x4c')],function(_0x38fe17){_0x38fe17[_0x3425('0x59')]=_0x198ee7[_0x3425('0x4e')]['id'];return _0x38fe17;});return db['UserProfileResource'][_0x3425('0x6c')](_0x53b9d1,{'raw':!![],'transaction':_0x609d54});});}})['catch'](handleError(_0x536d8a,null));});}})[_0x3425('0x26')](function(_0xb35aee){var _0x2c502a=_[_0x3425('0x2e')](_0xb35aee,function(_0x37e605){return _0x37e605['get']({'plain':!![]});});})[_0x3425('0x26')](respondWithResult(_0x536d8a,null))[_0x3425('0x47')](handleError(_0x536d8a,null));};exports[_0x3425('0x6d')]=function(_0x480e50,_0x36508c,_0x339e01){return db[_0x3425('0x2f')][_0x3425('0x4a')]({'where':{'id':_0x480e50['params']['id']}})['then'](handleEntityNotFound(_0x36508c,null))[_0x3425('0x26')](function(_0x14f0ac){if(_0x14f0ac){return _0x14f0ac[_0x3425('0x6d')](_0x480e50['query'][_0x3425('0x60')]);}})[_0x3425('0x26')](respondWithStatusCode(_0x36508c,null))[_0x3425('0x47')](handleError(_0x36508c,null));};exports[_0x3425('0x6e')]=function(_0x137f84,_0x4a7955){var _0x1c8734={};if(!_0x137f84[_0x3425('0x34')][_0x3425('0x6f')])throw new Error(_0x3425('0x70'));if(!_0x137f84[_0x3425('0x34')]['hasOwnProperty'](_0x3425('0x3c'))){_0x1c8734[_0x3425('0x3d')]=qs[_0x3425('0x3d')](_0x137f84[_0x3425('0x34')][_0x3425('0x3d')]);_0x1c8734[_0x3425('0x21')]=qs[_0x3425('0x21')](_0x137f84[_0x3425('0x34')][_0x3425('0x21')]);}return db['UserProfile'][_0x3425('0x4a')]({'where':{'id':_0x137f84['params']['id']}})[_0x3425('0x26')](function(_0x3a4788){if(!_0x3a4788)throw new Error(_0x3425('0x71')+_0x137f84['params']['id']);return db[_0x3425('0x2f')][_0x3425('0x6e')](_0x137f84);})['then'](respondWithFilteredResult(_0x4a7955,_0x1c8734))[_0x3425('0x47')](handleError(_0x4a7955,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 83b7af0..200a2dd 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 _0x2542=['exports','events','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x925fb7,_0x3d1585){var _0x39b4c4=function(_0x231c88){while(--_0x231c88){_0x925fb7['push'](_0x925fb7['shift']());}};_0x39b4c4(++_0x3d1585);}(_0x2542,0x169));var _0x2254=function(_0x10f5cd,_0x59b499){_0x10f5cd=_0x10f5cd-0x0;var _0x86b6b=_0x2542[_0x10f5cd];return _0x86b6b;};'use strict';var EventEmitter=require(_0x2254('0x0'));var UserProfile=require(_0x2254('0x1'))['db'][_0x2254('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2254('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2254('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4059d1){return function(_0x3b3dcb,_0x27f5c9,_0x456612){UserProfileEvents[_0x2254('0x5')](_0x4059d1+':'+_0x3b3dcb['id'],_0x3b3dcb);UserProfileEvents['emit'](_0x4059d1,_0x3b3dcb);_0x456612(null);};}for(var e in events){if(events[_0x2254('0x6')](e)){var event=events[e];UserProfile[_0x2254('0x7')](e,emitEvent(event));}}module[_0x2254('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xcaf2=['hook','exports','events','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x1fdc80,_0x55985a){var _0x500035=function(_0x15f255){while(--_0x15f255){_0x1fdc80['push'](_0x1fdc80['shift']());}};_0x500035(++_0x55985a);}(_0xcaf2,0x8a));var _0x2caf=function(_0xfe4a8d,_0x33d75d){_0xfe4a8d=_0xfe4a8d-0x0;var _0x1bf633=_0xcaf2[_0xfe4a8d];return _0x1bf633;};'use strict';var EventEmitter=require(_0x2caf('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x2caf('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2caf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2caf('0x3'),'afterDestroy':_0x2caf('0x4')};function emitEvent(_0x5b4a90){return function(_0xb4fae,_0x4d046b,_0x335e3c){UserProfileEvents[_0x2caf('0x5')](_0x5b4a90+':'+_0xb4fae['id'],_0xb4fae);UserProfileEvents[_0x2caf('0x5')](_0x5b4a90,_0xb4fae);_0x335e3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x2caf('0x6')](e,emitEvent(event));}}module[_0x2caf('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index bb10f66..4cd9220 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 _0x6a34=['Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','filter','field','value','findAll','associatedResources','map','catch','name','UserProfileResource','then','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','VoiceQueues','queue','inbound','VoiceQueue','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','trunks','variables','Variable','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','query','raw','section','mergeResources','isEmpty','length','push','params','all','ignore','union','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','offset','sort','merge','VIRTUAL','find','foreignKey','forEach','options','includeAll','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','order','count','include'];(function(_0x15e882,_0x3348e0){var _0x3674c3=function(_0x120d2a){while(--_0x120d2a){_0x15e882['push'](_0x15e882['shift']());}};_0x3674c3(++_0x3348e0);}(_0x6a34,0x182));var _0x46a3=function(_0x387a27,_0x4b102a){_0x387a27=_0x387a27-0x0;var _0x1e9733=_0x6a34[_0x387a27];return _0x1e9733;};'use strict';var _=require(_0x46a3('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x46a3('0x1'));var squel=require(_0x46a3('0x2'));module['exports']=function(_0x33d31a){var _0xf4ff64=_0x33d31a['models'];function _0x49b352(_0x3faffd,_0xfa145f){return new Promise(function(_0x2f73e7,_0x579381){if(!_0xfa145f)return _0x2f73e7(null);var _0x2dee37=_0xfa145f[_0x46a3('0x3')]?{[_0xfa145f['filter'][_0x46a3('0x4')]]:_0xfa145f[_0x46a3('0x3')][_0x46a3('0x5')]}:undefined;return _0xf4ff64[_0x3faffd][_0x46a3('0x6')]({'where':_0x2dee37,'raw':!![]})['then'](function(_0x32f7fe){_0xfa145f[_0x46a3('0x7')]=_[_0x46a3('0x8')](_0x32f7fe,'id');_0x2f73e7(_0xfa145f);})[_0x46a3('0x9')](function(_0x6561c5){_0x579381(_0x6561c5);});});}function _0x310746(_0x26fd25,_0x3260ba){return new Promise(function(_0x358adc,_0x40fbb1){var _0x5c8b02=_0x26fd25[_0x46a3('0x3')]?{[_0x26fd25['filter']['field']]:_0x26fd25[_0x46a3('0x3')][_0x46a3('0x5')]}:undefined;return _0xf4ff64[_0x26fd25['model']][_0x46a3('0x6')]({'where':_0x5c8b02,'raw':!![]})['then'](function(_0x3f5c5f){_0x3260ba[_0x46a3('0x7')]=_[_0x46a3('0x8')](_0x3f5c5f,function(_0x1f34a9){return _0x1f34a9[_0x46a3('0xa')];});_0x358adc(_0x3260ba);})[_0x46a3('0x9')](function(_0x3f1bf8){_0x40fbb1(_0x3f1bf8);});});}function _0x512022(_0x16553a,_0x435f18,_0x1ed79c){if(!_0x435f18)return Promise['resolve'](null);return new Promise(function(_0x26c2ce,_0x24b8f4){return _0xf4ff64[_0x46a3('0xb')][_0x46a3('0x6')]({'where':{'sectionId':_0x435f18['id']},'raw':!![]})[_0x46a3('0xc')](function(_0x476ad7){if(_0x16553a[_0x46a3('0x4')]&&_0x16553a[_0x46a3('0x4')]!=='id'){_0x435f18[_0x46a3('0x7')]=_['map'](_0x476ad7,function(_0x36ad11){return _0x36ad11[_0x16553a[_0x46a3('0x4')]];});}else{if(_0x1ed79c===_0x46a3('0xd')){_0x435f18[_0x46a3('0x7')]=_['map'](_0x476ad7,function(_0x386230){return{'id':_0x386230['resourceId'],'type':_0x386230[_0x46a3('0xe')]};});}else{_0x435f18[_0x46a3('0x7')]=_[_0x46a3('0x8')](_0x476ad7,function(_0x26717f){return _0x26717f[_0x46a3('0xf')];});}}_0x26c2ce(_0x435f18);})[_0x46a3('0x9')](function(_0x49a7d0){_0x24b8f4(_0x49a7d0);});});}function _0x534621(_0x38e210,_0x51a30a){var _0x2bdc70={'parentSections':[]};switch(_0x38e210[_0x46a3('0x10')]()){case _0x46a3('0x11'):_0x2bdc70['childModel']='SquareProject';break;case _0x46a3('0x12'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x14');break;case _0x46a3('0x15'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x16');_0x2bdc70[_0x46a3('0x17')]=[{'name':_0x46a3('0x18'),'field':_0x46a3('0xa'),'foreignKey':'projectName'}];break;case _0x46a3('0x19'):_0x2bdc70['childModel']=_0x46a3('0x1a');break;case'contacts':_0x2bdc70['childModel']=_0x46a3('0x1b');_0x2bdc70[_0x46a3('0x17')]=[{'name':_0x46a3('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0x46a3('0x1d'):_0x2bdc70['childModel']=_0x46a3('0x1e');break;case _0x46a3('0x1f'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x20');break;case _0x46a3('0x21'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x22');break;case _0x46a3('0x23'):_0x2bdc70['childModel']=_0x46a3('0x24');break;case _0x46a3('0x25'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x26');break;case _0x46a3('0x27'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x28');break;case _0x46a3('0x29'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x2a');break;case _0x46a3('0x2b'):case _0x46a3('0x2c'):case _0x46a3('0x2d'):_0x2bdc70['childModel']=_0x46a3('0x2e');break;case'contexts':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x2f');break;case _0x46a3('0x30'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x31');break;case _0x46a3('0x32'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x33');_0x2bdc70[_0x46a3('0x17')]=[{'name':_0x46a3('0x34'),'field':'name','foreignKey':_0x46a3('0x35'),'model':_0x46a3('0x36'),'filter':{'field':'role','value':[_0x46a3('0x37')]}},{'name':_0x46a3('0x38'),'field':_0x46a3('0xa'),'foreignKey':_0x46a3('0x35'),'model':_0x46a3('0x36'),'filter':{'field':_0x46a3('0x39'),'value':['telephone']}},{'name':_0x46a3('0x3a'),'field':_0x46a3('0xa'),'foreignKey':_0x46a3('0x3b'),'model':'VoiceQueue','filter':{'field':_0x46a3('0xe'),'value':[_0x46a3('0x3c')]}},{'name':'QueueCampaigns','field':_0x46a3('0xa'),'foreignKey':'queue','model':_0x46a3('0x3d'),'filter':{'field':_0x46a3('0xe'),'value':['outbound']}}];break;case'musiconholds':_0x2bdc70[_0x46a3('0x13')]='VoiceMusicOnHold';break;case _0x46a3('0x3e'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x3f');break;case'voiceprefixes':_0x2bdc70[_0x46a3('0x13')]='VoicePrefix';break;case _0x46a3('0x40'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x41');break;case _0x46a3('0x42'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x43');break;case'mailaccounts':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x44');break;case'mailsubstatuses':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x45');break;case _0x46a3('0x46'):_0x2bdc70[_0x46a3('0x13')]='OpenchannelQueue';break;case _0x46a3('0x47'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x48');break;case'smsqueues':_0x2bdc70[_0x46a3('0x13')]='SmsQueue';break;case'smsaccounts':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x49');break;case'whatsappqueues':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x4a');break;case _0x46a3('0x4b'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x4c');break;case _0x46a3('0x4d'):_0x2bdc70[_0x46a3('0x13')]='Team';break;case'voicequeues':case _0x46a3('0x4e'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x3d');if(_0x51a30a){_0x2bdc70[_0x46a3('0x17')]=[{'name':_0x46a3('0x3a')},{'name':_0x46a3('0x4f')}];}break;case _0x46a3('0x50'):case _0x46a3('0x51'):case _0x46a3('0x52'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x36');if(_0x51a30a){_0x2bdc70[_0x46a3('0x17')]=[{'name':_0x46a3('0x53'),'filter':{'field':'role','value':[_0x46a3('0x54'),_0x46a3('0x55')]},'ignore':!![]},{'name':_0x46a3('0x34')},{'name':_0x46a3('0x38')}];}break;case'zendeskaccounts':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x56');break;case _0x46a3('0x57'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x58');break;case _0x46a3('0x59'):_0x2bdc70[_0x46a3('0x13')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x5a');break;case _0x46a3('0x5b'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x5c');break;case'zohoaccounts':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x5d');break;case'vtigeraccounts':_0x2bdc70[_0x46a3('0x13')]='User';break;case'cannedanswers':_0x2bdc70['childModel']=_0x46a3('0x5e');break;case _0x46a3('0x5f'):_0x2bdc70['childModel']=_0x46a3('0x60');break;case _0x46a3('0x61'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x62');break;case _0x46a3('0x63'):_0x2bdc70['childModel']='Interval';break;case'pauses':_0x2bdc70[_0x46a3('0x13')]='Pause';break;case _0x46a3('0x64'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x65');break;case _0x46a3('0x66'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x67');break;case'tags':_0x2bdc70['childModel']=_0x46a3('0x68');break;case _0x46a3('0x69'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x6a');break;case _0x46a3('0x6b'):_0x2bdc70[_0x46a3('0x13')]='Trigger';break;case _0x46a3('0x6c'):_0x2bdc70[_0x46a3('0x13')]='Trunk';break;case _0x46a3('0x6d'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x6e');break;case _0x46a3('0x6f'):_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0x70');break;case'extractedreports':_0x2bdc70[_0x46a3('0x13')]=_0x46a3('0xd');_0x2bdc70[_0x46a3('0x17')]=[{'name':_0x46a3('0x71'),'field':'id','foreignKey':_0x46a3('0x72')}];break;case _0x46a3('0x73'):_0x2bdc70['childModel']=_0x46a3('0x74');break;}return _0x2bdc70;}function _0x262d1e(_0x4861f0,_0x2195cc){var _0x6c100f=_0x4861f0[_0x46a3('0x75')](0x0)['toUpperCase']()+_0x4861f0['slice'](0x1);var _0x2aa186={'type':_0xf4ff64[_0x46a3('0x76')][_0x46a3('0x77')][_0x46a3('0x78')],'raw':!![]};return new Promise(function(_0x8903f0,_0x5b6c63){var _0x20c3e7=squel[_0x46a3('0x79')]()['field'](_0x46a3('0x7a')+_0x6c100f+'InteractionId','id')[_0x46a3('0x4')](_0x46a3('0x7b'))[_0x46a3('0x7c')](_0x46a3('0x7d')+_0x4861f0+_0x46a3('0x7e'),'ui')[_0x46a3('0x7f')](_0x46a3('0x80'),_0x2195cc['id']);return _0xf4ff64[_0x46a3('0x81')]['query'](_0x20c3e7[_0x46a3('0x82')](),_0x2aa186)[_0x46a3('0xc')](function(_0x5ba927){_0x2195cc[_0x6c100f+_0x46a3('0x83')]=_0x5ba927;_0x8903f0(_0x5ba927);})[_0x46a3('0x9')](function(_0x496685){_0x5b6c63(_0x496685);});});}return _0x33d31a[_0x46a3('0x84')](_0x46a3('0x85'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x471526){var _0x4ee8c7={'raw':_0x471526[_0x46a3('0x86')][_0x46a3('0x87')],'where':{}};var _0x41c1e6={};var _0x52fb57={'count':0x0,'rows':[]};var _0x459513=_0x471526[_0x46a3('0x86')][_0x46a3('0x88')];var _0x53a1d5=_0x471526['query'][_0x46a3('0x89')]||![];var _0x1ff651=_0x534621(_0x459513,_0x53a1d5);if(!_0x1ff651[_0x46a3('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x459513+'\x27');var _0x26727e=[{'name':_0x459513}];if(!_[_0x46a3('0x8a')](_0x1ff651[_0x46a3('0x17')]))_0x26727e=_0x1ff651[_0x46a3('0x17')];var _0xa8c89=[];for(var _0x31f31b=0x0;_0x31f31b<_0x26727e[_0x46a3('0x8b')];_0x31f31b++){_0xa8c89[_0x46a3('0x8c')](_0xf4ff64['UserProfileSection']['find']({'where':{'userProfileId':_0x471526[_0x46a3('0x8d')]['id'],'name':_0x26727e[_0x31f31b][_0x46a3('0xa')]},'raw':!![]}));}return Promise[_0x46a3('0x8e')](_0xa8c89)['then'](function(_0x3aa56d){var _0x44ef3e=_[_0x46a3('0x3')](_0x3aa56d,function(_0x5b47ee){return _0x5b47ee?_0x5b47ee:undefined;});var _0x10c73d=_['filter'](_0x26727e,[_0x46a3('0x8f'),!![]]);var _0x23c524=_['isEmpty'](_0x44ef3e)&&_[_0x46a3('0x8a')](_0x10c73d)?null:_[_0x46a3('0x90')](_0x10c73d,_0x44ef3e);if(!_0x23c524)return null;var _0x527310=[];for(var _0x156984=0x0;_0x156984<_0x23c524['length'];_0x156984++){var _0x322f74=_['find'](_0x26727e,function(_0x39f493){return _0x23c524[_0x156984]?_0x39f493[_0x46a3('0xa')]===_0x23c524[_0x156984][_0x46a3('0xa')]:null;});if(_0x322f74){if(_0x23c524[_0x156984][_0x46a3('0x8f')]){_0x527310[_0x46a3('0x8c')](_0x49b352(_0x1ff651[_0x46a3('0x13')],_0x23c524[_0x156984]));}else{if(!_0x23c524[_0x156984][_0x46a3('0x91')]){_0x527310[_0x46a3('0x8c')](_0x512022(_0x322f74,_0x23c524[_0x156984],_0x1ff651['childModel']));}else{if(_0x322f74[_0x46a3('0x92')]){_0x527310['push'](_0x310746(_0x322f74,_0x23c524[_0x156984]));}}}}}return Promise[_0x46a3('0x8e')](_0x527310);})[_0x46a3('0xc')](function(_0x57d1ba){var _0x2ec63c=_0x57d1ba;var _0x1f8a29=null;if(_0x2ec63c){_0x1f8a29=_0x2ec63c['length']===0x1?_0x2ec63c[0x0]:null;}if(!_0x1f8a29&&!_0x2ec63c)return _0x52fb57;var _0x15904c=_0xf4ff64[_0x1ff651[_0x46a3('0x13')]][_0x46a3('0x93')];_0x41c1e6[_0x46a3('0x92')]=_[_0x46a3('0x94')](_0x15904c);_0x41c1e6[_0x46a3('0x86')]=_[_0x46a3('0x94')](_0x471526[_0x46a3('0x86')]);_0x41c1e6[_0x46a3('0x95')]=_[_0x46a3('0x96')](_0x41c1e6[_0x46a3('0x92')],_0x41c1e6['query']);_0x4ee8c7[_0x46a3('0x97')]=_[_0x46a3('0x96')](_0x41c1e6[_0x46a3('0x92')],qs['fields'](_0x471526['query']['fields']));_0x4ee8c7[_0x46a3('0x97')]=_0x4ee8c7[_0x46a3('0x97')][_0x46a3('0x8b')]?_0x4ee8c7[_0x46a3('0x97')]:_0x41c1e6['model'];if(!_0x471526[_0x46a3('0x86')][_0x46a3('0x98')](_0x46a3('0x99'))){_0x4ee8c7[_0x46a3('0x9a')]=qs[_0x46a3('0x9a')](_0x471526['query']['limit']);_0x4ee8c7['offset']=qs[_0x46a3('0x9b')](_0x471526[_0x46a3('0x86')][_0x46a3('0x9b')]);}_0x4ee8c7['order']=qs[_0x46a3('0x9c')](_0x471526['query'][_0x46a3('0x9c')]);_0x4ee8c7[_0x46a3('0x7f')]=qs[_0x46a3('0x95')](_['pick'](_0x471526[_0x46a3('0x86')],_0x41c1e6[_0x46a3('0x95')]));if(_0x471526['query'][_0x46a3('0x3')]){_0x4ee8c7[_0x46a3('0x7f')]=_[_0x46a3('0x9d')](_0x4ee8c7[_0x46a3('0x7f')],{'$or':_[_0x46a3('0x8')](_0x15904c,function(_0x2e3727){if(_0x2e3727['type']['key']!==_0x46a3('0x9e')){var _0x2715e={};_0x2715e[_0x2e3727[_0x46a3('0x4')]]={'$like':'%'+_0x471526[_0x46a3('0x86')][_0x46a3('0x3')]+'%'};return _0x2715e;}})});}var _0x104d92=[];var _0x3559c9=null;var _0x16db49={};if(_0x1f8a29){_0x3559c9=_[_0x46a3('0x9f')](_0x26727e,[_0x46a3('0xa'),_0x1f8a29[_0x46a3('0xa')]]);if(_0x3559c9[_0x46a3('0x4')]){_0x16db49={};if(_0x1ff651[_0x46a3('0x13')]===_0x46a3('0xd')){_0x16db49[_0x3559c9['foreignKey']]=_[_0x46a3('0x8')](_0x1f8a29[_0x46a3('0x7')],'id');}else{_0x16db49[_0x3559c9['foreignKey']]=_0x1f8a29[_0x46a3('0x7')];}_0x104d92[_0x46a3('0x8c')](_0x16db49);}else{_0x4ee8c7[_0x46a3('0x7f')]['id']=_0x1f8a29[_0x46a3('0x7')];}}else{for(var _0x39c6e2=0x0;_0x39c6e2<_0x2ec63c[_0x46a3('0x8b')];_0x39c6e2++){_0x3559c9=_[_0x46a3('0x9f')](_0x26727e,['name',_0x2ec63c[_0x39c6e2]['name']]);if(_0x3559c9['field']){_0x16db49={};_0x16db49[_0x3559c9[_0x46a3('0xa0')]]=_0x2ec63c[_0x39c6e2][_0x46a3('0x7')];_0x104d92['push'](_0x16db49);}else{if(!_0x4ee8c7[_0x46a3('0x7f')]['id'])_0x4ee8c7[_0x46a3('0x7f')]['id']=[];_0x2ec63c[_0x39c6e2][_0x46a3('0x7')][_0x46a3('0xa1')](function(_0x29c17c){_0x4ee8c7[_0x46a3('0x7f')]['id'][_0x46a3('0x8c')](_0x29c17c);});}}}if(!_[_0x46a3('0x8a')](_0x104d92)){_0x4ee8c7[_0x46a3('0x7f')]=_[_0x46a3('0x9d')](_0x4ee8c7[_0x46a3('0x7f')],{'$and':{'$or':_0x104d92}});}_0x4ee8c7=_['merge']({},_0x4ee8c7,_0x471526[_0x46a3('0xa2')]);if(_0x1f8a29&&!_0x1f8a29[_0x46a3('0x91')]&&_0x1ff651[_0x46a3('0x13')]===_0x46a3('0xd')){if(_0x471526[_0x46a3('0x86')][_0x46a3('0xa3')]){_0x4ee8c7['include']=[{'all':!![]}];}return _0xf4ff64[_0x1ff651[_0x46a3('0x13')]][_0x46a3('0x6')](_0x4ee8c7)[_0x46a3('0xc')](function(_0x49e266){var _0x1c7db6=[];_0x49e266[_0x46a3('0xa1')](function(_0xc460e4){var _0x4cc862;switch(_0xc460e4[_0x46a3('0xa4')]){case _0x46a3('0xa5'):_0x4cc862=_[_0x46a3('0x9f')](_0x1f8a29[_0x46a3('0x7')],function(_0x42034d){return _0x42034d['id']===_0xc460e4[_0x46a3('0x72')]&&_0x42034d[_0x46a3('0xe')]===_0x46a3('0xa6');});break;case _0x46a3('0xa7'):_0x4cc862=_['find'](_0x1f8a29['associatedResources'],function(_0x2db6d5){return _0x2db6d5['id']===_0xc460e4[_0x46a3('0x72')]&&_0x2db6d5[_0x46a3('0xe')]===_0x46a3('0xa8');});break;}if(_0x4cc862)_0x1c7db6[_0x46a3('0x8c')](_0xc460e4);});_0x52fb57['count']=_0x1c7db6[_0x46a3('0x8b')];_0x52fb57[_0x46a3('0xa9')]=_0x1c7db6;return _0x52fb57;});}else{if(!_[_0x46a3('0x8a')](_0x471526[_0x46a3('0x86')][_0x46a3('0xaa')])){_0x4ee8c7[_0x46a3('0x7f')]['id']=_0x4ee8c7[_0x46a3('0x7f')]['id']?_[_0x46a3('0x96')](_0x4ee8c7[_0x46a3('0x7f')]['id'],_0x471526[_0x46a3('0x86')]['ids']):_0x471526[_0x46a3('0x86')][_0x46a3('0xaa')];if(_0x471526[_0x46a3('0x86')][_0x46a3('0xab')]){_0x4ee8c7[_0x46a3('0xac')]=_0x471526[_0x46a3('0x86')][_0x46a3('0xab')];}}if(_0x471526[_0x46a3('0x86')]['extraQueryConditions']){_0x4ee8c7[_0x46a3('0x7f')]=_[_0x46a3('0x9d')](_0x4ee8c7['where'],{'$and':_0x471526[_0x46a3('0x86')]['extraQueryConditions']});}return _0xf4ff64[_0x1ff651[_0x46a3('0x13')]][_0x46a3('0xad')]({'where':_0x4ee8c7['where']})['then'](function(_0x4516e6){_0x52fb57['count']=_0x4516e6;if(_0x471526[_0x46a3('0x86')][_0x46a3('0xa3')]){if(_0x1ff651['childModel']==='CmContact'){_0x4ee8c7[_0x46a3('0xae')]=[{'model':_0xf4ff64['Tag'],'as':_0x46a3('0xaf'),'attributes':['id',_0x46a3('0xa'),_0x46a3('0xb0')],'required':_0x471526[_0x46a3('0x86')][_0x46a3('0xb1')]?!![]:![]},{'model':_0xf4ff64['Tag'],'as':_0x46a3('0xb2'),'attributes':['id',_0x46a3('0xa'),_0x46a3('0xb0')],'through':_0x471526['query']['tag']?{'attributes':[],'where':{'TagId':_0x471526['query'][_0x46a3('0xb1')]||undefined}}:{},'required':_0x471526[_0x46a3('0x86')][_0x46a3('0xb1')]?!![]:![]}];}else{_0x4ee8c7[_0x46a3('0xae')]=[{'all':!![]}];}}return _0xf4ff64[_0x1ff651[_0x46a3('0x13')]][_0x46a3('0x6')](_0x4ee8c7);})[_0x46a3('0xc')](function(_0x43a33f){_0x52fb57[_0x46a3('0xa9')]=_0x43a33f;if(_0x459513===_0x46a3('0x34')&&_0x471526[_0x46a3('0x86')][_0x46a3('0xb3')]===_0x46a3('0xb4')){var _0x228a6c=[];for(var _0x5ad677=0x0;_0x5ad677<_0x52fb57['rows'][_0x46a3('0x8b')];_0x5ad677++){_0x228a6c[_0x46a3('0x8c')](_0x262d1e('chat',_0x52fb57['rows'][_0x5ad677][_0x46a3('0xb5')]));_0x228a6c[_0x46a3('0x8c')](_0x262d1e(_0x46a3('0xb6'),_0x52fb57[_0x46a3('0xa9')][_0x5ad677][_0x46a3('0xb5')]));_0x228a6c['push'](_0x262d1e(_0x46a3('0xb7'),_0x52fb57[_0x46a3('0xa9')][_0x5ad677][_0x46a3('0xb5')]));_0x228a6c['push'](_0x262d1e(_0x46a3('0xb8'),_0x52fb57[_0x46a3('0xa9')][_0x5ad677][_0x46a3('0xb5')]));_0x228a6c[_0x46a3('0x8c')](_0x262d1e(_0x46a3('0xb9'),_0x52fb57[_0x46a3('0xa9')][_0x5ad677][_0x46a3('0xb5')]));_0x228a6c[_0x46a3('0x8c')](_0x262d1e(_0x46a3('0xba'),_0x52fb57[_0x46a3('0xa9')][_0x5ad677][_0x46a3('0xb5')]));}return Promise[_0x46a3('0x8e')](_0x228a6c)[_0x46a3('0xc')](function(){return _0x52fb57;});}return _0x52fb57;});}});}}});}; \ No newline at end of file +var _0x12e2=['VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','Tag','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','rawAttributes','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filters','merge','key','VIRTUAL','foreignKey','options','autoAssociation','includeAll','include','forEach','default','DefaultReports','count','rows','ids','customSorting','extraQueryConditions','Tags','ThroughTags','color','tag','openTabs','true','sms','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','value','findAll','associatedResources','catch','field','model','then','map','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','parentSections','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes'];(function(_0x33a2bf,_0xcc5085){var _0x3612c1=function(_0x35f9dd){while(--_0x35f9dd){_0x33a2bf['push'](_0x33a2bf['shift']());}};_0x3612c1(++_0xcc5085);}(_0x12e2,0x9e));var _0x212e=function(_0x19bebd,_0xbdb9eb){_0x19bebd=_0x19bebd-0x0;var _0x243436=_0x12e2[_0x19bebd];return _0x243436;};'use strict';var _=require(_0x212e('0x0'));var attributes=require(_0x212e('0x1'));var qs=require(_0x212e('0x2'));var squel=require(_0x212e('0x3'));module[_0x212e('0x4')]=function(_0x3664d5){var _0x3af1a8=_0x3664d5['models'];function _0x1ac95a(_0x5588c2,_0x2fb828){return new Promise(function(_0x1af8ca,_0x5934aa){if(!_0x2fb828)return _0x1af8ca(null);var _0x346250=_0x2fb828[_0x212e('0x5')]?{[_0x2fb828[_0x212e('0x5')]['field']]:_0x2fb828[_0x212e('0x5')][_0x212e('0x6')]}:undefined;return _0x3af1a8[_0x5588c2][_0x212e('0x7')]({'where':_0x346250,'raw':!![]})['then'](function(_0x4fdc14){_0x2fb828[_0x212e('0x8')]=_['map'](_0x4fdc14,'id');_0x1af8ca(_0x2fb828);})[_0x212e('0x9')](function(_0x39a0f0){_0x5934aa(_0x39a0f0);});});}function _0x17aea0(_0x535cc7,_0x2e412e){return new Promise(function(_0x574208,_0x876626){var _0x17a659=_0x535cc7[_0x212e('0x5')]?{[_0x535cc7[_0x212e('0x5')][_0x212e('0xa')]]:_0x535cc7[_0x212e('0x5')]['value']}:undefined;return _0x3af1a8[_0x535cc7[_0x212e('0xb')]][_0x212e('0x7')]({'where':_0x17a659,'raw':!![]})[_0x212e('0xc')](function(_0x459324){_0x2e412e['associatedResources']=_[_0x212e('0xd')](_0x459324,function(_0x4e3727){return _0x4e3727['name'];});_0x574208(_0x2e412e);})['catch'](function(_0x7216ff){_0x876626(_0x7216ff);});});}function _0x16dea6(_0x37e093,_0x34d2ef,_0x2cb9dc){if(!_0x34d2ef)return Promise[_0x212e('0xe')](null);return new Promise(function(_0x65889a,_0x248cbc){return _0x3af1a8[_0x212e('0xf')][_0x212e('0x7')]({'where':{'sectionId':_0x34d2ef['id']},'raw':!![]})[_0x212e('0xc')](function(_0x4d2c97){if(_0x37e093[_0x212e('0xa')]&&_0x37e093['field']!=='id'){_0x34d2ef[_0x212e('0x8')]=_['map'](_0x4d2c97,function(_0x5c9aea){return _0x5c9aea[_0x37e093[_0x212e('0xa')]];});}else{if(_0x2cb9dc===_0x212e('0x10')){_0x34d2ef[_0x212e('0x8')]=_['map'](_0x4d2c97,function(_0x4a435b){return{'id':_0x4a435b[_0x212e('0x11')],'type':_0x4a435b[_0x212e('0x12')]};});}else{_0x34d2ef[_0x212e('0x8')]=_['map'](_0x4d2c97,function(_0x810fed){return _0x810fed[_0x212e('0x11')];});}}_0x65889a(_0x34d2ef);})['catch'](function(_0x19ab31){_0x248cbc(_0x19ab31);});});}function _0x39e609(_0x1e7d4d,_0x22802a){var _0x27a09b={'parentSections':[]};switch(_0x1e7d4d['toLowerCase']()){case _0x212e('0x13'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x15');break;case _0x212e('0x16'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x17');break;case'squarerecordings':_0x27a09b['childModel']='SquareRecording';_0x27a09b[_0x212e('0x18')]=[{'name':'SquareProjects','field':_0x212e('0x19'),'foreignKey':_0x212e('0x1a')}];break;case _0x212e('0x1b'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x1c');break;case _0x212e('0x1d'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x1e');_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x212e('0x20'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x21');break;case _0x212e('0x22'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x23');break;case _0x212e('0x24'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x25');break;case'chatqueues':_0x27a09b[_0x212e('0x14')]=_0x212e('0x26');break;case _0x212e('0x27'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x28');break;case _0x212e('0x29'):_0x27a09b[_0x212e('0x14')]='FaxQueue';break;case _0x212e('0x2a'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x2b');break;case _0x212e('0x2c'):case _0x212e('0x2d'):case'outboundroutes':_0x27a09b[_0x212e('0x14')]=_0x212e('0x2e');break;case'contexts':_0x27a09b[_0x212e('0x14')]=_0x212e('0x2f');break;case _0x212e('0x30'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x31');break;case _0x212e('0x32'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x33');_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x34'),'field':_0x212e('0x19'),'foreignKey':_0x212e('0x35'),'model':_0x212e('0x36'),'filter':{'field':_0x212e('0x37'),'value':[_0x212e('0x38')]}},{'name':'Telephones','field':_0x212e('0x19'),'foreignKey':_0x212e('0x35'),'model':_0x212e('0x36'),'filter':{'field':'role','value':[_0x212e('0x39')]}},{'name':_0x212e('0x3a'),'field':'name','foreignKey':'queue','model':_0x212e('0x3b'),'filter':{'field':_0x212e('0x12'),'value':[_0x212e('0x3c')]}},{'name':_0x212e('0x3d'),'field':_0x212e('0x19'),'foreignKey':_0x212e('0x3e'),'model':_0x212e('0x3b'),'filter':{'field':_0x212e('0x12'),'value':[_0x212e('0x3f')]}}];break;case _0x212e('0x40'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x41');break;case _0x212e('0x42'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x43');break;case _0x212e('0x44'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x45');break;case _0x212e('0x46'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x47');break;case _0x212e('0x48'):_0x27a09b[_0x212e('0x14')]='MailQueue';break;case _0x212e('0x49'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x4a');break;case _0x212e('0x4b'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x4c');break;case _0x212e('0x4d'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x4e');break;case'openchannelaccounts':_0x27a09b[_0x212e('0x14')]=_0x212e('0x4f');break;case _0x212e('0x50'):_0x27a09b['childModel']=_0x212e('0x51');break;case _0x212e('0x52'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x53');break;case _0x212e('0x54'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x55');break;case'whatsappaccounts':_0x27a09b[_0x212e('0x14')]=_0x212e('0x56');break;case'teams':_0x27a09b[_0x212e('0x14')]=_0x212e('0x57');break;case _0x212e('0x58'):case _0x212e('0x59'):_0x27a09b['childModel']=_0x212e('0x3b');if(_0x22802a){_0x27a09b['parentSections']=[{'name':_0x212e('0x3a')},{'name':_0x212e('0x3d')}];}break;case _0x212e('0x5a'):case _0x212e('0x5b'):case _0x212e('0x5c'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x36');if(_0x22802a){_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x5d'),'filter':{'field':_0x212e('0x37'),'value':[_0x212e('0x5e'),_0x212e('0x5f')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x212e('0x60'):_0x27a09b['childModel']=_0x212e('0x61');break;case _0x212e('0x62'):_0x27a09b['childModel']=_0x212e('0x63');break;case _0x212e('0x64'):_0x27a09b['childModel']=_0x212e('0x65');break;case _0x212e('0x66'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x67');break;case _0x212e('0x68'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x69');break;case _0x212e('0x6a'):_0x27a09b['childModel']=_0x212e('0x6b');break;case _0x212e('0x6c'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x36');break;case'cannedanswers':_0x27a09b[_0x212e('0x14')]=_0x212e('0x6d');break;case _0x212e('0x6e'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x6f');break;case _0x212e('0x70'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x71');break;case _0x212e('0x72'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x73');break;case'pauses':_0x27a09b[_0x212e('0x14')]=_0x212e('0x74');break;case _0x212e('0x75'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x76');break;case _0x212e('0x77'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x78');break;case'tags':_0x27a09b['childModel']=_0x212e('0x79');break;case'templates':_0x27a09b['childModel']='Template';break;case _0x212e('0x7a'):_0x27a09b[_0x212e('0x14')]='Trigger';break;case _0x212e('0x7b'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x7c');break;case _0x212e('0x7d'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x7e');break;case _0x212e('0x7f'):_0x27a09b['childModel']=_0x212e('0x80');break;case _0x212e('0x81'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x10');_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x82'),'field':'id','foreignKey':_0x212e('0x83')}];break;case _0x212e('0x84'):_0x27a09b['childModel']=_0x212e('0x85');break;}return _0x27a09b;}function _0x367888(_0x141676,_0x5ddae0){var _0x184398=_0x141676[_0x212e('0x86')](0x0)[_0x212e('0x87')]()+_0x141676['slice'](0x1);var _0x24ce45={'type':_0x3af1a8[_0x212e('0x88')][_0x212e('0x89')][_0x212e('0x8a')],'raw':!![]};return new Promise(function(_0x237020,_0x382670){var _0x77601e=squel[_0x212e('0x8b')]()[_0x212e('0xa')](_0x212e('0x8c')+_0x184398+_0x212e('0x8d'),'id')[_0x212e('0xa')]('ui.createdAt')[_0x212e('0x8e')](_0x212e('0x8f')+_0x141676+_0x212e('0x90'),'ui')[_0x212e('0x91')](_0x212e('0x92'),_0x5ddae0['id']);return _0x3af1a8[_0x212e('0x93')][_0x212e('0x94')](_0x77601e[_0x212e('0x95')](),_0x24ce45)[_0x212e('0xc')](function(_0x4fd4f8){_0x5ddae0[_0x184398+_0x212e('0x96')]=_0x4fd4f8;_0x237020(_0x4fd4f8);})[_0x212e('0x9')](function(_0x47e053){_0x382670(_0x47e053);});});}return _0x3664d5[_0x212e('0x97')]('UserProfile',attributes,{'tableName':_0x212e('0x98'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x470df7){var _0x5820a9={'raw':_0x470df7[_0x212e('0x94')][_0x212e('0x99')],'where':{}};var _0x35408e={};var _0x261e76={'count':0x0,'rows':[]};var _0x189896=_0x470df7[_0x212e('0x94')][_0x212e('0x9a')];var _0x138f2b=_0x470df7['query'][_0x212e('0x9b')]||![];var _0xe86f0f=_0x39e609(_0x189896,_0x138f2b);if(!_0xe86f0f['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x189896+'\x27');var _0x512e96=[{'name':_0x189896}];if(!_[_0x212e('0x9c')](_0xe86f0f['parentSections']))_0x512e96=_0xe86f0f[_0x212e('0x18')];var _0x39fabb=[];for(var _0x58014e=0x0;_0x58014e<_0x512e96['length'];_0x58014e++){_0x39fabb[_0x212e('0x9d')](_0x3af1a8[_0x212e('0x9e')][_0x212e('0x9f')]({'where':{'userProfileId':_0x470df7[_0x212e('0xa0')]['id'],'name':_0x512e96[_0x58014e][_0x212e('0x19')]},'raw':!![]}));}return Promise[_0x212e('0xa1')](_0x39fabb)[_0x212e('0xc')](function(_0x4c2635){var _0xb47cd0=_['filter'](_0x4c2635,function(_0x4a9d78){return _0x4a9d78?_0x4a9d78:undefined;});var _0x22c921=_[_0x212e('0x5')](_0x512e96,[_0x212e('0xa2'),!![]]);var _0x479a13=_[_0x212e('0x9c')](_0xb47cd0)&&_['isEmpty'](_0x22c921)?null:_[_0x212e('0xa3')](_0x22c921,_0xb47cd0);if(!_0x479a13)return null;var _0xa8cd08=[];for(var _0x372164=0x0;_0x372164<_0x479a13[_0x212e('0xa4')];_0x372164++){var _0x41d3fb=_[_0x212e('0x9f')](_0x512e96,function(_0x5f15ef){return _0x479a13[_0x372164]?_0x5f15ef[_0x212e('0x19')]===_0x479a13[_0x372164][_0x212e('0x19')]:null;});if(_0x41d3fb){if(_0x479a13[_0x372164]['ignore']){_0xa8cd08[_0x212e('0x9d')](_0x1ac95a(_0xe86f0f['childModel'],_0x479a13[_0x372164]));}else{if(!_0x479a13[_0x372164]['autoAssociation']){_0xa8cd08[_0x212e('0x9d')](_0x16dea6(_0x41d3fb,_0x479a13[_0x372164],_0xe86f0f[_0x212e('0x14')]));}else{if(_0x41d3fb[_0x212e('0xb')]){_0xa8cd08[_0x212e('0x9d')](_0x17aea0(_0x41d3fb,_0x479a13[_0x372164]));}}}}}return Promise['all'](_0xa8cd08);})['then'](function(_0x1c0f26){var _0x580914=_0x1c0f26;var _0x2a55cf=null;if(_0x580914){_0x2a55cf=_0x580914[_0x212e('0xa4')]===0x1?_0x580914[0x0]:null;}if(!_0x2a55cf&&!_0x580914)return _0x261e76;var _0x420b1b=_0x3af1a8[_0xe86f0f['childModel']][_0x212e('0xa5')];_0x35408e['model']=_['keys'](_0x420b1b);_0x35408e[_0x212e('0x94')]=_['keys'](_0x470df7[_0x212e('0x94')]);_0x35408e['filters']=_[_0x212e('0xa6')](_0x35408e['model'],_0x35408e[_0x212e('0x94')]);_0x5820a9[_0x212e('0xa7')]=_['intersection'](_0x35408e[_0x212e('0xb')],qs[_0x212e('0xa8')](_0x470df7[_0x212e('0x94')][_0x212e('0xa8')]));_0x5820a9['attributes']=_0x5820a9[_0x212e('0xa7')][_0x212e('0xa4')]?_0x5820a9['attributes']:_0x35408e[_0x212e('0xb')];if(!_0x470df7[_0x212e('0x94')][_0x212e('0xa9')](_0x212e('0xaa'))){_0x5820a9['limit']=qs['limit'](_0x470df7[_0x212e('0x94')][_0x212e('0xab')]);_0x5820a9[_0x212e('0xac')]=qs[_0x212e('0xac')](_0x470df7[_0x212e('0x94')][_0x212e('0xac')]);}_0x5820a9[_0x212e('0xad')]=qs[_0x212e('0xae')](_0x470df7[_0x212e('0x94')][_0x212e('0xae')]);_0x5820a9[_0x212e('0x91')]=qs['filters'](_[_0x212e('0xaf')](_0x470df7['query'],_0x35408e[_0x212e('0xb0')]));if(_0x470df7[_0x212e('0x94')][_0x212e('0x5')]){_0x5820a9[_0x212e('0x91')]=_[_0x212e('0xb1')](_0x5820a9[_0x212e('0x91')],{'$or':_[_0x212e('0xd')](_0x420b1b,function(_0x281afa){if(_0x281afa[_0x212e('0x12')][_0x212e('0xb2')]!==_0x212e('0xb3')){var _0x503509={};_0x503509[_0x281afa[_0x212e('0xa')]]={'$like':'%'+_0x470df7[_0x212e('0x94')][_0x212e('0x5')]+'%'};return _0x503509;}})});}var _0x4306fe=[];var _0x1a9537=null;var _0x84c32f={};if(_0x2a55cf){_0x1a9537=_[_0x212e('0x9f')](_0x512e96,[_0x212e('0x19'),_0x2a55cf[_0x212e('0x19')]]);if(_0x1a9537['field']){_0x84c32f={};if(_0xe86f0f['childModel']===_0x212e('0x10')){_0x84c32f[_0x1a9537['foreignKey']]=_['map'](_0x2a55cf[_0x212e('0x8')],'id');}else{_0x84c32f[_0x1a9537['foreignKey']]=_0x2a55cf[_0x212e('0x8')];}_0x4306fe[_0x212e('0x9d')](_0x84c32f);}else{_0x5820a9[_0x212e('0x91')]['id']=_0x2a55cf[_0x212e('0x8')];}}else{for(var _0x6e4104=0x0;_0x6e4104<_0x580914[_0x212e('0xa4')];_0x6e4104++){_0x1a9537=_[_0x212e('0x9f')](_0x512e96,[_0x212e('0x19'),_0x580914[_0x6e4104][_0x212e('0x19')]]);if(_0x1a9537[_0x212e('0xa')]){_0x84c32f={};_0x84c32f[_0x1a9537[_0x212e('0xb4')]]=_0x580914[_0x6e4104][_0x212e('0x8')];_0x4306fe['push'](_0x84c32f);}else{if(!_0x5820a9[_0x212e('0x91')]['id'])_0x5820a9['where']['id']=[];_0x580914[_0x6e4104][_0x212e('0x8')]['forEach'](function(_0x5542e2){_0x5820a9[_0x212e('0x91')]['id'][_0x212e('0x9d')](_0x5542e2);});}}}if(!_[_0x212e('0x9c')](_0x4306fe)){_0x5820a9[_0x212e('0x91')]=_[_0x212e('0xb1')](_0x5820a9[_0x212e('0x91')],{'$and':{'$or':_0x4306fe}});}_0x5820a9=_[_0x212e('0xb1')]({},_0x5820a9,_0x470df7[_0x212e('0xb5')]);if(_0x2a55cf&&!_0x2a55cf[_0x212e('0xb6')]&&_0xe86f0f[_0x212e('0x14')]===_0x212e('0x10')){if(_0x470df7[_0x212e('0x94')][_0x212e('0xb7')]){_0x5820a9[_0x212e('0xb8')]=[{'all':!![]}];}return _0x3af1a8[_0xe86f0f[_0x212e('0x14')]][_0x212e('0x7')](_0x5820a9)[_0x212e('0xc')](function(_0x1c94e1){var _0x4cfb5d=[];_0x1c94e1[_0x212e('0xb9')](function(_0x4be27d){var _0x5b00a0;switch(_0x4be27d['reportType']){case _0x212e('0xba'):_0x5b00a0=_[_0x212e('0x9f')](_0x2a55cf[_0x212e('0x8')],function(_0x3b23e3){return _0x3b23e3['id']===_0x4be27d['reportId']&&_0x3b23e3[_0x212e('0x12')]===_0x212e('0xbb');});break;case'custom':_0x5b00a0=_[_0x212e('0x9f')](_0x2a55cf[_0x212e('0x8')],function(_0x3a01b8){return _0x3a01b8['id']===_0x4be27d[_0x212e('0x83')]&&_0x3a01b8[_0x212e('0x12')]==='CustomReports';});break;}if(_0x5b00a0)_0x4cfb5d[_0x212e('0x9d')](_0x4be27d);});_0x261e76[_0x212e('0xbc')]=_0x4cfb5d[_0x212e('0xa4')];_0x261e76[_0x212e('0xbd')]=_0x4cfb5d;return _0x261e76;});}else{if(!_['isEmpty'](_0x470df7[_0x212e('0x94')][_0x212e('0xbe')])){_0x5820a9[_0x212e('0x91')]['id']=_0x5820a9[_0x212e('0x91')]['id']?_[_0x212e('0xa6')](_0x5820a9[_0x212e('0x91')]['id'],_0x470df7[_0x212e('0x94')][_0x212e('0xbe')]):_0x470df7[_0x212e('0x94')][_0x212e('0xbe')];if(_0x470df7['query'][_0x212e('0xbf')]){_0x5820a9[_0x212e('0xad')]=_0x470df7[_0x212e('0x94')]['customSorting'];}}if(_0x470df7['query']['extraQueryConditions']){_0x5820a9['where']=_[_0x212e('0xb1')](_0x5820a9[_0x212e('0x91')],{'$and':_0x470df7[_0x212e('0x94')][_0x212e('0xc0')]});}return _0x3af1a8[_0xe86f0f[_0x212e('0x14')]][_0x212e('0xbc')]({'where':_0x5820a9['where']})[_0x212e('0xc')](function(_0x5a9e00){_0x261e76[_0x212e('0xbc')]=_0x5a9e00;if(_0x470df7[_0x212e('0x94')][_0x212e('0xb7')]){if(_0xe86f0f[_0x212e('0x14')]==='CmContact'){_0x5820a9[_0x212e('0xb8')]=[{'model':_0x3af1a8[_0x212e('0x79')],'as':_0x212e('0xc1'),'attributes':['id',_0x212e('0x19'),'color'],'required':_0x470df7[_0x212e('0x94')]['tag']?!![]:![]},{'model':_0x3af1a8[_0x212e('0x79')],'as':_0x212e('0xc2'),'attributes':['id',_0x212e('0x19'),_0x212e('0xc3')],'through':_0x470df7['query']['tag']?{'attributes':[],'where':{'TagId':_0x470df7[_0x212e('0x94')][_0x212e('0xc4')]||undefined}}:{},'required':_0x470df7['query'][_0x212e('0xc4')]?!![]:![]}];}else{_0x5820a9[_0x212e('0xb8')]=[{'all':!![]}];}}return _0x3af1a8[_0xe86f0f[_0x212e('0x14')]][_0x212e('0x7')](_0x5820a9);})[_0x212e('0xc')](function(_0x17c8fa){_0x261e76[_0x212e('0xbd')]=_0x17c8fa;if(_0x189896===_0x212e('0x34')&&_0x470df7[_0x212e('0x94')][_0x212e('0xc5')]===_0x212e('0xc6')){var _0x1b4024=[];for(var _0xbe73d=0x0;_0xbe73d<_0x261e76[_0x212e('0xbd')][_0x212e('0xa4')];_0xbe73d++){_0x1b4024[_0x212e('0x9d')](_0x367888('chat',_0x261e76[_0x212e('0xbd')][_0xbe73d]['dataValues']));_0x1b4024[_0x212e('0x9d')](_0x367888(_0x212e('0xc7'),_0x261e76[_0x212e('0xbd')][_0xbe73d]['dataValues']));_0x1b4024['push'](_0x367888('fax',_0x261e76[_0x212e('0xbd')][_0xbe73d][_0x212e('0xc8')]));_0x1b4024['push'](_0x367888(_0x212e('0xc9'),_0x261e76[_0x212e('0xbd')][_0xbe73d][_0x212e('0xc8')]));_0x1b4024[_0x212e('0x9d')](_0x367888(_0x212e('0xca'),_0x261e76[_0x212e('0xbd')][_0xbe73d]['dataValues']));_0x1b4024['push'](_0x367888(_0x212e('0xcb'),_0x261e76[_0x212e('0xbd')][_0xbe73d][_0x212e('0xc8')]));}return Promise[_0x212e('0xa1')](_0x1b4024)[_0x212e('0xc')](function(){return _0x261e76;});}return _0x261e76;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6624c48..a73a673 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 _0xbd0a=['http','redis','localhost','socket.io-emitter','./userProfile.socket','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x277cbd,_0x764692){var _0x175827=function(_0x52b727){while(--_0x52b727){_0x277cbd['push'](_0x277cbd['shift']());}};_0x175827(++_0x764692);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x4d329b,_0x311a11){_0x4d329b=_0x4d329b-0x0;var _0x153c0e=_0xbd0a[_0x4d329b];return _0x153c0e;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var moment=require(_0xabd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd0('0x2'))['db'];var utils=require(_0xabd0('0x3'));var logger=require(_0xabd0('0x4'))(_0xabd0('0x5'));var config=require(_0xabd0('0x6'));var jayson=require(_0xabd0('0x7'));var client=jayson[_0xabd0('0x8')][_0xabd0('0x9')]({'port':0x232a});config[_0xabd0('0xa')]=_['defaults'](config[_0xabd0('0xa')],{'host':_0xabd0('0xb'),'port':0x18eb});var socket=require(_0xabd0('0xc'))(new Redis(config['redis']));require(_0xabd0('0xd'))['register'](socket);function respondWithRpcPromise(_0x151048,_0x23d4e4,_0x2c31c9){return new BPromise(function(_0x3dc0ab,_0x50fc2d){return client[_0xabd0('0xe')](_0x151048,_0x2c31c9)['then'](function(_0x1b78e2){logger[_0xabd0('0xf')](_0xabd0('0x10'),_0x23d4e4,_0xabd0('0x11'));logger[_0xabd0('0x12')](_0xabd0('0x13'),_0x23d4e4,'request\x20sent',JSON[_0xabd0('0x14')](_0x1b78e2));if(_0x1b78e2['error']){if(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x16')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x23d4e4,_0x1b78e2['error']['message']);return _0x50fc2d(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);}logger[_0xabd0('0x15')](_0xabd0('0x10'),_0x23d4e4,_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);return _0x3dc0ab(_0x1b78e2[_0xabd0('0x15')][_0xabd0('0x17')]);}else{logger[_0xabd0('0xf')]('UserProfile,\x20%s,\x20%s',_0x23d4e4,_0xabd0('0x11'));_0x3dc0ab(_0x1b78e2['result']['message']);}})[_0xabd0('0x18')](function(_0x391988){logger[_0xabd0('0x15')](_0xabd0('0x10'),_0x23d4e4,_0x391988);_0x50fc2d(_0x391988);});});} \ No newline at end of file +var _0x0619=['client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0x0619,0x90));var _0x9061=function(_0x1642e9,_0x3f5d4f){_0x1642e9=_0x1642e9-0x0;var _0x508c9f=_0x0619[_0x1642e9];return _0x508c9f;};'use strict';var _=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var moment=require(_0x9061('0x2'));var BPromise=require(_0x9061('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9061('0x4'));var db=require(_0x9061('0x5'))['db'];var utils=require(_0x9061('0x6'));var logger=require(_0x9061('0x7'))(_0x9061('0x8'));var config=require(_0x9061('0x9'));var jayson=require(_0x9061('0xa'));var client=jayson[_0x9061('0xb')][_0x9061('0xc')]({'port':0x232a});config[_0x9061('0xd')]=_[_0x9061('0xe')](config['redis'],{'host':_0x9061('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9061('0x10'))[_0x9061('0x11')](socket);function respondWithRpcPromise(_0x4cf332,_0x502660,_0x3bc693){return new BPromise(function(_0x2fc757,_0x13d226){return client[_0x9061('0x12')](_0x4cf332,_0x3bc693)[_0x9061('0x13')](function(_0x25ce5d){logger[_0x9061('0x14')](_0x9061('0x15'),_0x502660,_0x9061('0x16'));logger[_0x9061('0x17')](_0x9061('0x18'),_0x502660,_0x9061('0x16'),JSON[_0x9061('0x19')](_0x25ce5d));if(_0x25ce5d['error']){if(_0x25ce5d['error'][_0x9061('0x1a')]===0x1f4){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d[_0x9061('0x1b')][_0x9061('0x1c')]);return _0x13d226(_0x25ce5d['error']['message']);}logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d['error'][_0x9061('0x1c')]);return _0x2fc757(_0x25ce5d['error'][_0x9061('0x1c')]);}else{logger['info'](_0x9061('0x15'),_0x502660,'request\x20sent');_0x2fc757(_0x25ce5d[_0x9061('0x1d')][_0x9061('0x1c')]);}})[_0x9061('0x1e')](function(_0x11fc9e){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x11fc9e);_0x13d226(_0x11fc9e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1847002..015fdf5 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 _0xacbf=['./userProfile.events','save','remove','emit','removeListener','register','length','userProfile:'];(function(_0x196b4d,_0x1f1cd1){var _0xb7d81a=function(_0x447dea){while(--_0x447dea){_0x196b4d['push'](_0x196b4d['shift']());}};_0xb7d81a(++_0x1f1cd1);}(_0xacbf,0x1c0));var _0xfacb=function(_0x498581,_0x301d86){_0x498581=_0x498581-0x0;var _0x57e1e8=_0xacbf[_0x498581];return _0x57e1e8;};'use strict';var UserProfileEvents=require(_0xfacb('0x0'));var events=[_0xfacb('0x1'),_0xfacb('0x2'),'update'];function createListener(_0x32c996,_0xf6d85a){return function(_0x4bb357){_0xf6d85a[_0xfacb('0x3')](_0x32c996,_0x4bb357);};}function removeListener(_0x198e9b,_0x2cab8b){return function(){UserProfileEvents[_0xfacb('0x4')](_0x198e9b,_0x2cab8b);};}exports[_0xfacb('0x5')]=function(_0x2f7f29){for(var _0x2fb107=0x0,_0x37feee=events[_0xfacb('0x6')];_0x2fb107<_0x37feee;_0x2fb107++){var _0x1e323b=events[_0x2fb107];var _0x53a255=createListener(_0xfacb('0x7')+_0x1e323b,_0x2f7f29);UserProfileEvents['on'](_0x1e323b,_0x53a255);}}; \ No newline at end of file +var _0x1521=['length','userProfile:','./userProfile.events','remove','removeListener'];(function(_0xa2c2e2,_0x535d90){var _0x3d7867=function(_0x48be46){while(--_0x48be46){_0xa2c2e2['push'](_0xa2c2e2['shift']());}};_0x3d7867(++_0x535d90);}(_0x1521,0x133));var _0x1152=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x1521[_0x4314d7];return _0x5c599b;};'use strict';var UserProfileEvents=require(_0x1152('0x0'));var events=['save',_0x1152('0x1'),'update'];function createListener(_0x475ccc,_0x4ffd36){return function(_0x9f3a1c){_0x4ffd36['emit'](_0x475ccc,_0x9f3a1c);};}function removeListener(_0x2abff2,_0x468a77){return function(){UserProfileEvents[_0x1152('0x2')](_0x2abff2,_0x468a77);};}exports['register']=function(_0x5df607){for(var _0x1046e7=0x0,_0x4c3507=events[_0x1152('0x3')];_0x1046e7<_0x4c3507;_0x1046e7++){var _0xe7c4d3=events[_0x1046e7];var _0x3155e3=createListener(_0x1152('0x4')+_0xe7c4d3,_0x5df607);UserProfileEvents['on'](_0xe7c4d3,_0x3155e3);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5c46fbb..c9b12d0 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 _0xdca3=['/describe','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xdca3,0xec));var _0x3dca=function(_0x249c48,_0x47dad5){_0x249c48=_0x249c48-0x0;var _0x4f0212=_0xdca3[_0x249c48];return _0x4f0212;};'use strict';var multer=require(_0x3dca('0x0'));var util=require(_0x3dca('0x1'));var path=require('path');var timeout=require(_0x3dca('0x2'));var express=require(_0x3dca('0x3'));var router=express[_0x3dca('0x4')]();var fs_extra=require(_0x3dca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3dca('0x6'));var config=require(_0x3dca('0x7'));var controller=require('./userProfileResource.controller');router[_0x3dca('0x8')]('/',auth[_0x3dca('0x9')](),controller[_0x3dca('0xa')]);router[_0x3dca('0x8')](_0x3dca('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3dca('0x8')](_0x3dca('0xc'),auth[_0x3dca('0x9')](),controller[_0x3dca('0xd')]);router[_0x3dca('0xe')]('/',auth[_0x3dca('0x9')](),controller[_0x3dca('0xf')]);router[_0x3dca('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3dca('0x11')]);router['delete'](_0x3dca('0xc'),auth[_0x3dca('0x9')](),controller['destroy']);module[_0x3dca('0x12')]=router; \ No newline at end of file +var _0x0f83=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x470d01,_0x131881){var _0x2748fd=function(_0x2d986a){while(--_0x2d986a){_0x470d01['push'](_0x470d01['shift']());}};_0x2748fd(++_0x131881);}(_0x0f83,0x1ab));var _0x30f8=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x0f83[_0x5ad07c];return _0x204bae;};'use strict';var multer=require(_0x30f8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x30f8('0x1'));var express=require(_0x30f8('0x2'));var router=express[_0x30f8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x30f8('0x4'));var config=require(_0x30f8('0x5'));var controller=require(_0x30f8('0x6'));router[_0x30f8('0x7')]('/',auth[_0x30f8('0x8')](),controller[_0x30f8('0x9')]);router[_0x30f8('0x7')](_0x30f8('0xa'),auth[_0x30f8('0x8')](),controller['describe']);router['get'](_0x30f8('0xb'),auth[_0x30f8('0x8')](),controller['show']);router[_0x30f8('0xc')]('/',auth[_0x30f8('0x8')](),controller[_0x30f8('0xd')]);router['put'](_0x30f8('0xb'),auth['isAuthenticated'](),controller[_0x30f8('0xe')]);router[_0x30f8('0xf')](_0x30f8('0xb'),auth['isAuthenticated'](),controller[_0x30f8('0x10')]);module[_0x30f8('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 202f1fb..6fd1102 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 _0x044e=['exports','STRING','sequelize'];(function(_0x4b7193,_0xa7cec8){var _0x20cf87=function(_0x2cd1dd){while(--_0x2cd1dd){_0x4b7193['push'](_0x4b7193['shift']());}};_0x20cf87(++_0xa7cec8);}(_0x044e,0x116));var _0xe044=function(_0xf7fa34,_0x3a3096){_0xf7fa34=_0xf7fa34-0x0;var _0x53bb70=_0x044e[_0xf7fa34];return _0x53bb70;};'use strict';var Sequelize=require(_0xe044('0x0'));module[_0xe044('0x1')]={'name':{'type':Sequelize[_0xe044('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xe044('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5ef9=['STRING','INTEGER'];(function(_0xbd27dc,_0x90f55c){var _0x27f077=function(_0x4c2aaa){while(--_0x4c2aaa){_0xbd27dc['push'](_0xbd27dc['shift']());}};_0x27f077(++_0x90f55c);}(_0x5ef9,0x18e));var _0x95ef=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x5ef9[_0x2cc569];return _0x1bfc2e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x95ef('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x95ef('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x95ef('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index db99242..4bd1b0a 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 _0xfcf0=['nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xfcf0,0x138));var _0x0fcf=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0xfcf0[_0x594ece];return _0x471bc4;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));};exports[_0x0fcf('0x49')]=function(_0x389d71,_0x3a473c){return db[_0x0fcf('0x2b')][_0x0fcf('0x49')]()[_0x0fcf('0x24')](respondWithResult(_0x3a473c,null))[_0x0fcf('0x42')](handleError(_0x3a473c,null));}; \ No newline at end of file +var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x896e,0x1e9));var _0xe896=function(_0x770ba9,_0xbd5d6c){_0x770ba9=_0x770ba9-0x0;var _0x403cc9=_0x896e[_0x770ba9];return _0x403cc9;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index fc63cab..ff30d4d 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 _0x7a3d=['user_profile_has_resources','compositeIndex','resourceId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource'];(function(_0x286034,_0x1973cd){var _0x26cd90=function(_0x5f456d){while(--_0x5f456d){_0x286034['push'](_0x286034['shift']());}};_0x26cd90(++_0x1973cd);}(_0x7a3d,0x8f));var _0xd7a3=function(_0x49bfe7,_0x2cb098){_0x49bfe7=_0x49bfe7-0x0;var _0x42c87f=_0x7a3d[_0x49bfe7];return _0x42c87f;};'use strict';var _=require('lodash');var util=require(_0xd7a3('0x0'));var logger=require(_0xd7a3('0x1'))('api');var moment=require(_0xd7a3('0x2'));var BPromise=require(_0xd7a3('0x3'));var rp=require(_0xd7a3('0x4'));var fs=require('fs');var path=require(_0xd7a3('0x5'));var rimraf=require(_0xd7a3('0x6'));var config=require(_0xd7a3('0x7'));var attributes=require('./userProfileResource.attributes');module[_0xd7a3('0x8')]=function(_0x2ae579,_0x149397){return _0x2ae579[_0xd7a3('0x9')](_0xd7a3('0xa'),attributes,{'tableName':_0xd7a3('0xb'),'paranoid':![],'indexes':[{'name':_0xd7a3('0xc'),'fields':[_0xd7a3('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f22=['resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex'];(function(_0x5aec67,_0xb2e85){var _0x461761=function(_0x1f888f){while(--_0x1f888f){_0x5aec67['push'](_0x5aec67['shift']());}};_0x461761(++_0xb2e85);}(_0x3f22,0xc6));var _0x23f2=function(_0x16e785,_0x4becf2){_0x16e785=_0x16e785-0x0;var _0x409d26=_0x3f22[_0x16e785];return _0x409d26;};'use strict';var _=require(_0x23f2('0x0'));var util=require(_0x23f2('0x1'));var logger=require(_0x23f2('0x2'))(_0x23f2('0x3'));var moment=require('moment');var BPromise=require(_0x23f2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23f2('0x5'));var rimraf=require('rimraf');var config=require(_0x23f2('0x6'));var attributes=require(_0x23f2('0x7'));module[_0x23f2('0x8')]=function(_0x5e0bca,_0x3bb19a){return _0x5e0bca[_0x23f2('0x9')](_0x23f2('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x23f2('0xb'),'fields':[_0x23f2('0xc'),_0x23f2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 310cfab..0a5563c 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 _0xd2fc=['result','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2fc,0xf8));var _0xcd2f=function(_0x183b95,_0x46640c){_0x183b95=_0x183b95-0x0;var _0xf9849b=_0xd2fc[_0x183b95];return _0xf9849b;};'use strict';var _=require('lodash');var util=require(_0xcd2f('0x0'));var moment=require('moment');var BPromise=require(_0xcd2f('0x1'));var rs=require(_0xcd2f('0x2'));var fs=require('fs');var Redis=require(_0xcd2f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd2f('0x4'))('rpc');var config=require(_0xcd2f('0x5'));var jayson=require(_0xcd2f('0x6'));var client=jayson[_0xcd2f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27edd4,_0x6e64b8,_0x5066fd){return new BPromise(function(_0x109039,_0x1fbab2){return client[_0xcd2f('0x8')](_0x27edd4,_0x5066fd)['then'](function(_0x4e31bd){logger['info'](_0xcd2f('0x9'),_0x6e64b8,'request\x20sent');logger[_0xcd2f('0xa')](_0xcd2f('0xb'),_0x6e64b8,_0xcd2f('0xc'),JSON[_0xcd2f('0xd')](_0x4e31bd));if(_0x4e31bd[_0xcd2f('0xe')]){if(_0x4e31bd['error'][_0xcd2f('0xf')]===0x1f4){logger['error'](_0xcd2f('0x9'),_0x6e64b8,_0x4e31bd[_0xcd2f('0xe')]['message']);return _0x1fbab2(_0x4e31bd['error']['message']);}logger[_0xcd2f('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x6e64b8,_0x4e31bd['error'][_0xcd2f('0x10')]);return _0x109039(_0x4e31bd['error'][_0xcd2f('0x10')]);}else{logger[_0xcd2f('0x11')](_0xcd2f('0x9'),_0x6e64b8,_0xcd2f('0xc'));_0x109039(_0x4e31bd[_0xcd2f('0x12')]['message']);}})['catch'](function(_0x24e213){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x6e64b8,_0x24e213);_0x1fbab2(_0x24e213);});});} \ No newline at end of file +var _0xdfb6=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x44784c,_0x4498c1){var _0x4bbfb1=function(_0x5d5ef7){while(--_0x5d5ef7){_0x44784c['push'](_0x44784c['shift']());}};_0x4bbfb1(++_0x4498c1);}(_0xdfb6,0x192));var _0x6dfb=function(_0x2e76ac,_0x3bc669){_0x2e76ac=_0x2e76ac-0x0;var _0x58ab89=_0xdfb6[_0x2e76ac];return _0x58ab89;};'use strict';var _=require(_0x6dfb('0x0'));var util=require(_0x6dfb('0x1'));var moment=require(_0x6dfb('0x2'));var BPromise=require(_0x6dfb('0x3'));var rs=require(_0x6dfb('0x4'));var fs=require('fs');var Redis=require(_0x6dfb('0x5'));var db=require(_0x6dfb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dfb('0x7'))(_0x6dfb('0x8'));var config=require('../../config/environment');var jayson=require(_0x6dfb('0x9'));var client=jayson['client'][_0x6dfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a132,_0x361612,_0xf0c36a){return new BPromise(function(_0x314f34,_0x487c00){return client[_0x6dfb('0xb')](_0x12a132,_0xf0c36a)[_0x6dfb('0xc')](function(_0x929a19){logger[_0x6dfb('0xd')](_0x6dfb('0xe'),_0x361612,_0x6dfb('0xf'));logger[_0x6dfb('0x10')](_0x6dfb('0x11'),_0x361612,'request\x20sent',JSON['stringify'](_0x929a19));if(_0x929a19['error']){if(_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x13')]===0x1f4){logger[_0x6dfb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x361612,_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);return _0x487c00(_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);}logger[_0x6dfb('0x12')](_0x6dfb('0xe'),_0x361612,_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);return _0x314f34(_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);}else{logger[_0x6dfb('0xd')](_0x6dfb('0xe'),_0x361612,'request\x20sent');_0x314f34(_0x929a19[_0x6dfb('0x15')][_0x6dfb('0x14')]);}})[_0x6dfb('0x16')](function(_0x3a5d9c){logger[_0x6dfb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x361612,_0x3a5d9c);_0x487c00(_0x3a5d9c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 06a22e0..9049155 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 _0xd837=['index','/describe','describe','post','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x38cc6b,_0x4aade9){var _0x1e0c8e=function(_0x1b24a6){while(--_0x1b24a6){_0x38cc6b['push'](_0x38cc6b['shift']());}};_0x1e0c8e(++_0x4aade9);}(_0xd837,0x15d));var _0x7d83=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0xd837[_0x4a7e98];return _0x27d10d;};'use strict';var multer=require('multer');var util=require(_0x7d83('0x0'));var path=require(_0x7d83('0x1'));var timeout=require(_0x7d83('0x2'));var express=require(_0x7d83('0x3'));var router=express[_0x7d83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7d83('0x5'));var interaction=require(_0x7d83('0x6'));var config=require(_0x7d83('0x7'));var controller=require(_0x7d83('0x8'));router[_0x7d83('0x9')]('/',auth[_0x7d83('0xa')](),controller[_0x7d83('0xb')]);router[_0x7d83('0x9')](_0x7d83('0xc'),auth[_0x7d83('0xa')](),controller[_0x7d83('0xd')]);router[_0x7d83('0x9')]('/:id',auth[_0x7d83('0xa')](),controller['show']);router[_0x7d83('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7d83('0xf')]);router[_0x7d83('0x10')](_0x7d83('0x11'),auth[_0x7d83('0xa')](),controller[_0x7d83('0x12')]);module[_0x7d83('0x13')]=router; \ No newline at end of file +var _0x6991=['multer','util','path','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','create','put','update','destroy','exports'];(function(_0x565d5f,_0x2bf262){var _0x3a3b58=function(_0x3c783f){while(--_0x3c783f){_0x565d5f['push'](_0x565d5f['shift']());}};_0x3a3b58(++_0x2bf262);}(_0x6991,0x9a));var _0x1699=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x6991[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x1699('0x0'));var util=require(_0x1699('0x1'));var path=require(_0x1699('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1699('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1699('0x4'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x1699('0x5')]('/',auth[_0x1699('0x6')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1699('0x7')]);router[_0x1699('0x5')](_0x1699('0x8'),auth[_0x1699('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1699('0x9')]);router[_0x1699('0xa')](_0x1699('0x8'),auth[_0x1699('0x6')](),controller[_0x1699('0xb')]);router['delete'](_0x1699('0x8'),auth[_0x1699('0x6')](),controller[_0x1699('0xc')]);module[_0x1699('0xd')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 2baadac..4c55558 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 _0x34b7=['BOOLEAN','crudPermissions','join','getDataValue','STRING','INTEGER'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x34b7,0x196));var _0x734b=function(_0x1e97a5,_0x37a2e9){_0x1e97a5=_0x1e97a5-0x0;var _0x42915d=_0x34b7[_0x1e97a5];return _0x42915d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x734b('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x734b('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x734b('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x734b('0x0')],'set':function(_0x5de1ae){this['setDataValue'](_0x734b('0x3'),_0x5de1ae?_0x5de1ae[_0x734b('0x4')](''):[]);},'get':function(){return this[_0x734b('0x5')](_0x734b('0x3'))?this[_0x734b('0x5')](_0x734b('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0xa478=['sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x5a22bf,_0x3ede6a){var _0x1a7051=function(_0xdac79c){while(--_0xdac79c){_0x5a22bf['push'](_0x5a22bf['shift']());}};_0x1a7051(++_0x3ede6a);}(_0xa478,0x136));var _0x8a47=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xa478[_0x545a3a];return _0x5a5493;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'name':{'type':Sequelize[_0x8a47('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x8a47('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8a47('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8a47('0x2')],'set':function(_0x2b3110){this[_0x8a47('0x5')](_0x8a47('0x6'),_0x2b3110?_0x2b3110[_0x8a47('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0x8a47('0x6'))?this[_0x8a47('0x8')](_0x8a47('0x6'))[_0x8a47('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 1cae10a..e0b1ab0 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 _0x4618=['UserProfileSection','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','then','rows','catch','show','params','intersection','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','index','map'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x4618,0x109));var _0x8461=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x4618[_0x2fc012];return _0x2891f9;};'use strict';var emlformat=require(_0x8461('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8461('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8461('0x2'));var moment=require(_0x8461('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8461('0x4'));var path=require(_0x8461('0x5'));var sox=require(_0x8461('0x6'));var csv=require(_0x8461('0x7'));var ejs=require(_0x8461('0x8'));var fs=require('fs');var fs_extra=require(_0x8461('0x9'));var _=require(_0x8461('0xa'));var squel=require(_0x8461('0xb'));var crypto=require(_0x8461('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8461('0xd'));var toCsv=require(_0x8461('0x7'));var querystring=require(_0x8461('0xe'));var Papa=require('papaparse');var Redis=require(_0x8461('0xf'));var authService=require(_0x8461('0x10'));var qs=require(_0x8461('0x11'));var as=require(_0x8461('0x12'));var hardwareService=require(_0x8461('0x13'));var logger=require(_0x8461('0x14'))(_0x8461('0x15'));var utils=require('../../config/utils');var config=require(_0x8461('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8461('0x17'))['db'];function respondWithStatusCode(_0x390a0c,_0x2e3c26){_0x2e3c26=_0x2e3c26||0xcc;return function(_0x244477){if(_0x244477){return _0x390a0c[_0x8461('0x18')](_0x2e3c26);}return _0x390a0c['status'](_0x2e3c26)[_0x8461('0x19')]();};}function respondWithResult(_0x46e243,_0x4c5314){_0x4c5314=_0x4c5314||0xc8;return function(_0x265fed){if(_0x265fed){return _0x46e243[_0x8461('0x1a')](_0x4c5314)[_0x8461('0x1b')](_0x265fed);}};}function respondWithFilteredResult(_0x1baf14,_0x3da535){return function(_0x4ec6c1){if(_0x4ec6c1){var _0x3a2834=typeof _0x3da535[_0x8461('0x1c')]===_0x8461('0x1d')&&typeof _0x3da535[_0x8461('0x1e')]===_0x8461('0x1d');var _0x36abb3=_0x4ec6c1[_0x8461('0x1f')];var _0x11e0aa=_0x3a2834?0x0:_0x3da535['offset'];var _0x11d62d=_0x3a2834?_0x4ec6c1['count']:_0x3da535['offset']+_0x3da535[_0x8461('0x1e')];var _0x5f24ba;if(_0x11d62d>=_0x36abb3){_0x11d62d=_0x36abb3;_0x5f24ba=0xc8;}else{_0x5f24ba=0xce;}_0x1baf14[_0x8461('0x1a')](_0x5f24ba);return _0x1baf14[_0x8461('0x20')](_0x8461('0x21'),_0x11e0aa+'-'+_0x11d62d+'/'+_0x36abb3)[_0x8461('0x1b')](_0x4ec6c1);}return null;};}function patchUpdates(_0xc1c46e){return function(_0x3c08b4){try{jsonpatch['apply'](_0x3c08b4,_0xc1c46e,!![]);}catch(_0x255109){return BPromise[_0x8461('0x22')](_0x255109);}return _0x3c08b4[_0x8461('0x23')]();};}function saveUpdates(_0x20d72b,_0x1aac85){return function(_0x47b95a){if(_0x47b95a){return _0x47b95a[_0x8461('0x24')](_0x20d72b)['then'](function(_0x215e57){return _0x215e57;});}return null;};}function removeEntity(_0x21b70d,_0x277fd0){return function(_0x1a60d6){if(_0x1a60d6){return _0x1a60d6[_0x8461('0x25')]()['then'](function(){_0x21b70d[_0x8461('0x1a')](0xcc)[_0x8461('0x19')]();});}};}function handleEntityNotFound(_0x539aab,_0x3ac870){return function(_0x177e4d){if(!_0x177e4d){_0x539aab[_0x8461('0x18')](0x194);}return _0x177e4d;};}function handleError(_0x3445c0,_0x2332c8){_0x2332c8=_0x2332c8||0x1f4;return function(_0x1b296e){logger[_0x8461('0x26')](_0x1b296e[_0x8461('0x27')]);if(_0x1b296e[_0x8461('0x28')]){delete _0x1b296e[_0x8461('0x28')];}_0x3445c0['status'](_0x2332c8)['send'](_0x1b296e);};}exports[_0x8461('0x29')]=function(_0x2260a1,_0x2a2730){var _0x39425f={},_0x317215={},_0x1d0d33={'count':0x0,'rows':[]};var _0x1a7eb6=_[_0x8461('0x2a')](db[_0x8461('0x2b')][_0x8461('0x2c')],function(_0x54b7a8){return{'name':_0x54b7a8[_0x8461('0x2d')],'type':_0x54b7a8[_0x8461('0x2e')][_0x8461('0x2f')]};});_0x317215[_0x8461('0x30')]=_['map'](_0x1a7eb6,_0x8461('0x28'));_0x317215['query']=_[_0x8461('0x31')](_0x2260a1['query']);_0x317215[_0x8461('0x32')]=_['intersection'](_0x317215[_0x8461('0x30')],_0x317215[_0x8461('0x33')]);_0x39425f[_0x8461('0x34')]=_['intersection'](_0x317215[_0x8461('0x30')],qs[_0x8461('0x35')](_0x2260a1[_0x8461('0x33')][_0x8461('0x35')]));_0x39425f[_0x8461('0x34')]=_0x39425f[_0x8461('0x34')][_0x8461('0x36')]?_0x39425f[_0x8461('0x34')]:_0x317215[_0x8461('0x30')];if(!_0x2260a1[_0x8461('0x33')][_0x8461('0x37')]('nolimit')){_0x39425f[_0x8461('0x1e')]=qs['limit'](_0x2260a1[_0x8461('0x33')][_0x8461('0x1e')]);_0x39425f['offset']=qs[_0x8461('0x1c')](_0x2260a1['query']['offset']);}_0x39425f[_0x8461('0x38')]=qs[_0x8461('0x39')](_0x2260a1[_0x8461('0x33')][_0x8461('0x39')]);_0x39425f[_0x8461('0x3a')]=qs[_0x8461('0x32')](_[_0x8461('0x3b')](_0x2260a1[_0x8461('0x33')],_0x317215['filters']),_0x1a7eb6);if(_0x2260a1[_0x8461('0x33')][_0x8461('0x3c')]){_0x39425f[_0x8461('0x3a')]=_[_0x8461('0x3d')](_0x39425f['where'],{'$or':_[_0x8461('0x2a')](_0x1a7eb6,function(_0x579ba0){if(_0x579ba0[_0x8461('0x2e')]!==_0x8461('0x3e')){var _0x379297={};_0x379297[_0x579ba0['name']]={'$like':'%'+_0x2260a1['query']['filter']+'%'};return _0x379297;}})});}_0x39425f=_[_0x8461('0x3d')]({},_0x39425f,_0x2260a1[_0x8461('0x3f')]);var _0x215782={'where':_0x39425f[_0x8461('0x3a')]};return db['UserProfileSection'][_0x8461('0x1f')](_0x215782)['then'](function(_0x1edf53){_0x1d0d33[_0x8461('0x1f')]=_0x1edf53;if(_0x2260a1['query'][_0x8461('0x40')]){_0x39425f['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x8461('0x41')](_0x39425f);})[_0x8461('0x42')](function(_0x4b44a9){_0x1d0d33[_0x8461('0x43')]=_0x4b44a9;return _0x1d0d33;})[_0x8461('0x42')](respondWithFilteredResult(_0x2a2730,_0x39425f))[_0x8461('0x44')](handleError(_0x2a2730,null));};exports[_0x8461('0x45')]=function(_0x4d05ed,_0x3a87f3){var _0x56794b={'raw':![],'where':{'id':_0x4d05ed[_0x8461('0x46')]['id']}},_0x11638d={};_0x11638d[_0x8461('0x30')]=_[_0x8461('0x31')](db['UserProfileSection'][_0x8461('0x2c')]);_0x11638d[_0x8461('0x33')]=_['keys'](_0x4d05ed['query']);_0x11638d['filters']=_[_0x8461('0x47')](_0x11638d[_0x8461('0x30')],_0x11638d[_0x8461('0x33')]);_0x56794b['attributes']=_[_0x8461('0x47')](_0x11638d[_0x8461('0x30')],qs['fields'](_0x4d05ed[_0x8461('0x33')][_0x8461('0x35')]));_0x56794b[_0x8461('0x34')]=_0x56794b[_0x8461('0x34')][_0x8461('0x36')]?_0x56794b['attributes']:_0x11638d[_0x8461('0x30')];if(_0x4d05ed[_0x8461('0x33')][_0x8461('0x40')]){_0x56794b[_0x8461('0x48')]=[{'all':!![]}];}_0x56794b=_[_0x8461('0x3d')]({},_0x56794b,_0x4d05ed['options']);return db[_0x8461('0x2b')][_0x8461('0x49')](_0x56794b)[_0x8461('0x42')](handleEntityNotFound(_0x3a87f3,null))[_0x8461('0x42')](respondWithResult(_0x3a87f3,null))[_0x8461('0x44')](handleError(_0x3a87f3,null));};exports['create']=function(_0x48883a,_0x5c724b){return db[_0x8461('0x2b')][_0x8461('0x4a')](_0x48883a[_0x8461('0x4b')],{})[_0x8461('0x42')](respondWithResult(_0x5c724b,0xc9))[_0x8461('0x44')](handleError(_0x5c724b,null));};exports[_0x8461('0x24')]=function(_0x5880e7,_0x5254d4){if(_0x5880e7[_0x8461('0x4b')]['id']){delete _0x5880e7[_0x8461('0x4b')]['id'];}return db[_0x8461('0x2b')][_0x8461('0x49')]({'where':{'id':_0x5880e7['params']['id']}})[_0x8461('0x42')](handleEntityNotFound(_0x5254d4,null))[_0x8461('0x42')](saveUpdates(_0x5880e7[_0x8461('0x4b')],null))['then'](respondWithResult(_0x5254d4,null))['catch'](handleError(_0x5254d4,null));};exports['destroy']=function(_0x547eb9,_0x30a59f){return db[_0x8461('0x2b')][_0x8461('0x49')]({'where':{'id':_0x547eb9[_0x8461('0x46')]['id']}})[_0x8461('0x42')](handleEntityNotFound(_0x30a59f,null))[_0x8461('0x42')](removeEntity(_0x30a59f,null))[_0x8461('0x44')](handleError(_0x30a59f,null));};exports[_0x8461('0x4c')]=function(_0x153313,_0x3cba24){return db[_0x8461('0x2b')][_0x8461('0x4c')]()[_0x8461('0x42')](respondWithResult(_0x3cba24,null))['catch'](handleError(_0x3cba24,null));}; \ No newline at end of file +var _0xd355=['fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','stack','name','UserProfileSection','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','include','rows','catch','params','length','includeAll','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x489e7a,_0x3104eb){var _0xc1d33=function(_0x4277ff){while(--_0x4277ff){_0x489e7a['push'](_0x489e7a['shift']());}};_0xc1d33(++_0x3104eb);}(_0xd355,0x193));var _0x5d35=function(_0x34cafa,_0x251fc9){_0x34cafa=_0x34cafa-0x0;var _0x2741d1=_0xd355[_0x34cafa];return _0x2741d1;};'use strict';var emlformat=require(_0x5d35('0x0'));var rimraf=require(_0x5d35('0x1'));var zipdir=require(_0x5d35('0x2'));var jsonpatch=require(_0x5d35('0x3'));var rp=require(_0x5d35('0x4'));var moment=require(_0x5d35('0x5'));var BPromise=require(_0x5d35('0x6'));var Mustache=require(_0x5d35('0x7'));var util=require('util');var path=require(_0x5d35('0x8'));var sox=require(_0x5d35('0x9'));var csv=require(_0x5d35('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d35('0xb'));var _=require(_0x5d35('0xc'));var squel=require(_0x5d35('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d35('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d35('0xa'));var querystring=require(_0x5d35('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5d35('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d35('0x11'));var logger=require(_0x5d35('0x12'))(_0x5d35('0x13'));var utils=require(_0x5d35('0x14'));var config=require(_0x5d35('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d35('0x16'))['db'];function respondWithStatusCode(_0x107c3a,_0x5dbb98){_0x5dbb98=_0x5dbb98||0xcc;return function(_0x53d302){if(_0x53d302){return _0x107c3a[_0x5d35('0x17')](_0x5dbb98);}return _0x107c3a[_0x5d35('0x18')](_0x5dbb98)[_0x5d35('0x19')]();};}function respondWithResult(_0x54f947,_0x1513ce){_0x1513ce=_0x1513ce||0xc8;return function(_0xe7b436){if(_0xe7b436){return _0x54f947[_0x5d35('0x18')](_0x1513ce)['json'](_0xe7b436);}};}function respondWithFilteredResult(_0x193cd0,_0x434338){return function(_0x5391c2){if(_0x5391c2){var _0x15dd25=typeof _0x434338[_0x5d35('0x1a')]==='undefined'&&typeof _0x434338['limit']===_0x5d35('0x1b');var _0x23d77a=_0x5391c2[_0x5d35('0x1c')];var _0x1626d0=_0x15dd25?0x0:_0x434338[_0x5d35('0x1a')];var _0x11997e=_0x15dd25?_0x5391c2[_0x5d35('0x1c')]:_0x434338[_0x5d35('0x1a')]+_0x434338[_0x5d35('0x1d')];var _0x51a250;if(_0x11997e>=_0x23d77a){_0x11997e=_0x23d77a;_0x51a250=0xc8;}else{_0x51a250=0xce;}_0x193cd0['status'](_0x51a250);return _0x193cd0[_0x5d35('0x1e')](_0x5d35('0x1f'),_0x1626d0+'-'+_0x11997e+'/'+_0x23d77a)[_0x5d35('0x20')](_0x5391c2);}return null;};}function patchUpdates(_0x4bd09d){return function(_0x2838e2){try{jsonpatch[_0x5d35('0x21')](_0x2838e2,_0x4bd09d,!![]);}catch(_0x14c15f){return BPromise['reject'](_0x14c15f);}return _0x2838e2[_0x5d35('0x22')]();};}function saveUpdates(_0x2ae140,_0x4cc9b6){return function(_0x2c2e0c){if(_0x2c2e0c){return _0x2c2e0c['update'](_0x2ae140)[_0x5d35('0x23')](function(_0x439760){return _0x439760;});}return null;};}function removeEntity(_0x5ae77d,_0x31ad1c){return function(_0x516615){if(_0x516615){return _0x516615[_0x5d35('0x24')]()[_0x5d35('0x23')](function(){_0x5ae77d[_0x5d35('0x18')](0xcc)[_0x5d35('0x19')]();});}};}function handleEntityNotFound(_0x553276,_0x2c4c49){return function(_0x5a4622){if(!_0x5a4622){_0x553276[_0x5d35('0x17')](0x194);}return _0x5a4622;};}function handleError(_0x55174c,_0x53b2cb){_0x53b2cb=_0x53b2cb||0x1f4;return function(_0x735606){logger['error'](_0x735606[_0x5d35('0x25')]);if(_0x735606[_0x5d35('0x26')]){delete _0x735606[_0x5d35('0x26')];}_0x55174c[_0x5d35('0x18')](_0x53b2cb)['send'](_0x735606);};}exports['index']=function(_0x5d4704,_0x2d9278){var _0x33feec={},_0x2fce4e={},_0x31cddd={'count':0x0,'rows':[]};var _0x5235d4=_['map'](db[_0x5d35('0x27')][_0x5d35('0x28')],function(_0x38f4c1){return{'name':_0x38f4c1['fieldName'],'type':_0x38f4c1['type']['key']};});_0x2fce4e[_0x5d35('0x29')]=_['map'](_0x5235d4,_0x5d35('0x26'));_0x2fce4e[_0x5d35('0x2a')]=_[_0x5d35('0x2b')](_0x5d4704['query']);_0x2fce4e[_0x5d35('0x2c')]=_[_0x5d35('0x2d')](_0x2fce4e[_0x5d35('0x29')],_0x2fce4e[_0x5d35('0x2a')]);_0x33feec[_0x5d35('0x2e')]=_[_0x5d35('0x2d')](_0x2fce4e[_0x5d35('0x29')],qs[_0x5d35('0x2f')](_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x2f')]));_0x33feec[_0x5d35('0x2e')]=_0x33feec[_0x5d35('0x2e')]['length']?_0x33feec[_0x5d35('0x2e')]:_0x2fce4e[_0x5d35('0x29')];if(!_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x30')](_0x5d35('0x31'))){_0x33feec[_0x5d35('0x1d')]=qs[_0x5d35('0x1d')](_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x1d')]);_0x33feec[_0x5d35('0x1a')]=qs['offset'](_0x5d4704[_0x5d35('0x2a')]['offset']);}_0x33feec['order']=qs[_0x5d35('0x32')](_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x32')]);_0x33feec[_0x5d35('0x33')]=qs[_0x5d35('0x2c')](_[_0x5d35('0x34')](_0x5d4704['query'],_0x2fce4e[_0x5d35('0x2c')]),_0x5235d4);if(_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x35')]){_0x33feec['where']=_['merge'](_0x33feec[_0x5d35('0x33')],{'$or':_[_0x5d35('0x36')](_0x5235d4,function(_0x40ed31){if(_0x40ed31['type']!==_0x5d35('0x37')){var _0x2c6fce={};_0x2c6fce[_0x40ed31['name']]={'$like':'%'+_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x35')]+'%'};return _0x2c6fce;}})});}_0x33feec=_[_0x5d35('0x38')]({},_0x33feec,_0x5d4704[_0x5d35('0x39')]);var _0x58dec0={'where':_0x33feec[_0x5d35('0x33')]};return db['UserProfileSection'][_0x5d35('0x1c')](_0x58dec0)['then'](function(_0x2b58a5){_0x31cddd[_0x5d35('0x1c')]=_0x2b58a5;if(_0x5d4704[_0x5d35('0x2a')]['includeAll']){_0x33feec[_0x5d35('0x3a')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x33feec);})[_0x5d35('0x23')](function(_0x4914ff){_0x31cddd[_0x5d35('0x3b')]=_0x4914ff;return _0x31cddd;})[_0x5d35('0x23')](respondWithFilteredResult(_0x2d9278,_0x33feec))[_0x5d35('0x3c')](handleError(_0x2d9278,null));};exports['show']=function(_0x55a2cb,_0x4f531d){var _0x322f41={'raw':![],'where':{'id':_0x55a2cb[_0x5d35('0x3d')]['id']}},_0x555c2a={};_0x555c2a[_0x5d35('0x29')]=_[_0x5d35('0x2b')](db[_0x5d35('0x27')][_0x5d35('0x28')]);_0x555c2a['query']=_[_0x5d35('0x2b')](_0x55a2cb[_0x5d35('0x2a')]);_0x555c2a['filters']=_[_0x5d35('0x2d')](_0x555c2a['model'],_0x555c2a[_0x5d35('0x2a')]);_0x322f41[_0x5d35('0x2e')]=_[_0x5d35('0x2d')](_0x555c2a['model'],qs[_0x5d35('0x2f')](_0x55a2cb[_0x5d35('0x2a')][_0x5d35('0x2f')]));_0x322f41['attributes']=_0x322f41[_0x5d35('0x2e')][_0x5d35('0x3e')]?_0x322f41[_0x5d35('0x2e')]:_0x555c2a['model'];if(_0x55a2cb[_0x5d35('0x2a')][_0x5d35('0x3f')]){_0x322f41[_0x5d35('0x3a')]=[{'all':!![]}];}_0x322f41=_[_0x5d35('0x38')]({},_0x322f41,_0x55a2cb['options']);return db[_0x5d35('0x27')]['find'](_0x322f41)[_0x5d35('0x23')](handleEntityNotFound(_0x4f531d,null))[_0x5d35('0x23')](respondWithResult(_0x4f531d,null))[_0x5d35('0x3c')](handleError(_0x4f531d,null));};exports[_0x5d35('0x40')]=function(_0x52f937,_0x267a95){return db[_0x5d35('0x27')][_0x5d35('0x40')](_0x52f937[_0x5d35('0x41')],{})[_0x5d35('0x23')](respondWithResult(_0x267a95,0xc9))[_0x5d35('0x3c')](handleError(_0x267a95,null));};exports[_0x5d35('0x42')]=function(_0x728a,_0x5b1a78){if(_0x728a['body']['id']){delete _0x728a[_0x5d35('0x41')]['id'];}return db[_0x5d35('0x27')][_0x5d35('0x43')]({'where':{'id':_0x728a[_0x5d35('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b1a78,null))[_0x5d35('0x23')](saveUpdates(_0x728a[_0x5d35('0x41')],null))[_0x5d35('0x23')](respondWithResult(_0x5b1a78,null))[_0x5d35('0x3c')](handleError(_0x5b1a78,null));};exports[_0x5d35('0x24')]=function(_0x1df1fe,_0x157484){return db[_0x5d35('0x27')]['find']({'where':{'id':_0x1df1fe[_0x5d35('0x3d')]['id']}})[_0x5d35('0x23')](handleEntityNotFound(_0x157484,null))[_0x5d35('0x23')](removeEntity(_0x157484,null))[_0x5d35('0x3c')](handleError(_0x157484,null));};exports['describe']=function(_0x4477ed,_0x29171a){return db['UserProfileSection'][_0x5d35('0x44')]()[_0x5d35('0x23')](respondWithResult(_0x29171a,null))[_0x5d35('0x3c')](handleError(_0x29171a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d9d175a..9f925b4 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 _0xfbbc=['compositeIndex','userProfileId','lodash','util','../../config/logger','api','request-promise','rimraf','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0xc62602,_0x7bed84){var _0x6191e7=function(_0x1f7984){while(--_0x1f7984){_0xc62602['push'](_0xc62602['shift']());}};_0x6191e7(++_0x7bed84);}(_0xfbbc,0x86));var _0xcfbb=function(_0x39930f,_0x17fe89){_0x39930f=_0x39930f-0x0;var _0x117ab9=_0xfbbc[_0x39930f];return _0x117ab9;};'use strict';var _=require(_0xcfbb('0x0'));var util=require(_0xcfbb('0x1'));var logger=require(_0xcfbb('0x2'))(_0xcfbb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcfbb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfbb('0x5'));var config=require('../../config/environment');var attributes=require(_0xcfbb('0x6'));module[_0xcfbb('0x7')]=function(_0x496729,_0x2755b3){return _0x496729['define'](_0xcfbb('0x8'),attributes,{'tableName':_0xcfbb('0x9'),'paranoid':![],'indexes':[{'name':_0xcfbb('0xa'),'fields':['sectionId',_0xcfbb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8245=['define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x266033,_0x40acbd){var _0x3d856a=function(_0x20e512){while(--_0x20e512){_0x266033['push'](_0x266033['shift']());}};_0x3d856a(++_0x40acbd);}(_0x8245,0x127));var _0x5824=function(_0x48f5e9,_0x3d1963){_0x48f5e9=_0x48f5e9-0x0;var _0x481616=_0x8245[_0x48f5e9];return _0x481616;};'use strict';var _=require(_0x5824('0x0'));var util=require('util');var logger=require(_0x5824('0x1'))(_0x5824('0x2'));var moment=require(_0x5824('0x3'));var BPromise=require(_0x5824('0x4'));var rp=require(_0x5824('0x5'));var fs=require('fs');var path=require(_0x5824('0x6'));var rimraf=require(_0x5824('0x7'));var config=require(_0x5824('0x8'));var attributes=require(_0x5824('0x9'));module[_0x5824('0xa')]=function(_0x58c2de,_0x2d92e9){return _0x58c2de[_0x5824('0xb')](_0x5824('0xc'),attributes,{'tableName':_0x5824('0xd'),'paranoid':![],'indexes':[{'name':_0x5824('0xe'),'fields':[_0x5824('0xf'),_0x5824('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 7edc6ad..1aa4f42 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 _0x9ff9=['http','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xa2f68b,_0x5c5c5b){var _0x554d04=function(_0x393cc7){while(--_0x393cc7){_0xa2f68b['push'](_0xa2f68b['shift']());}};_0x554d04(++_0x5c5c5b);}(_0x9ff9,0x1c3));var _0x99ff=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x9ff9[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0x99ff('0x0'));var moment=require('moment');var BPromise=require(_0x99ff('0x1'));var rs=require(_0x99ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99ff('0x3'))['db'];var utils=require(_0x99ff('0x4'));var logger=require(_0x99ff('0x5'))(_0x99ff('0x6'));var config=require('../../config/environment');var jayson=require(_0x99ff('0x7'));var client=jayson[_0x99ff('0x8')][_0x99ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e3d41,_0x2d9fe5,_0x5dff10){return new BPromise(function(_0x21b6e8,_0x1be218){return client['request'](_0x1e3d41,_0x5dff10)['then'](function(_0x289c4f){logger['info'](_0x99ff('0xa'),_0x2d9fe5,'request\x20sent');logger[_0x99ff('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2d9fe5,_0x99ff('0xc'),JSON[_0x99ff('0xd')](_0x289c4f));if(_0x289c4f[_0x99ff('0xe')]){if(_0x289c4f['error'][_0x99ff('0xf')]===0x1f4){logger[_0x99ff('0xe')](_0x99ff('0xa'),_0x2d9fe5,_0x289c4f[_0x99ff('0xe')]['message']);return _0x1be218(_0x289c4f[_0x99ff('0xe')][_0x99ff('0x10')]);}logger['error'](_0x99ff('0xa'),_0x2d9fe5,_0x289c4f['error']['message']);return _0x21b6e8(_0x289c4f[_0x99ff('0xe')][_0x99ff('0x10')]);}else{logger[_0x99ff('0x11')](_0x99ff('0xa'),_0x2d9fe5,_0x99ff('0xc'));_0x21b6e8(_0x289c4f[_0x99ff('0x12')][_0x99ff('0x10')]);}})[_0x99ff('0x13')](function(_0x5c0f5a){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2d9fe5,_0x5c0f5a);_0x1be218(_0x5c0f5a);});});} \ No newline at end of file +var _0x5d06=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0x5d06,0x1b2));var _0x65d0=function(_0xdac7dd,_0x59f328){_0xdac7dd=_0xdac7dd-0x0;var _0xe73b94=_0x5d06[_0xdac7dd];return _0xe73b94;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x65d0('0x0'));var BPromise=require(_0x65d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65d0('0x2'))['db'];var utils=require(_0x65d0('0x3'));var logger=require(_0x65d0('0x4'))(_0x65d0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x65d0('0x6')][_0x65d0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x66aa3a,_0x2289b2,_0x31370b){return new BPromise(function(_0x814e4c,_0x5d471a){return client[_0x65d0('0x8')](_0x66aa3a,_0x31370b)[_0x65d0('0x9')](function(_0x21bd91){logger[_0x65d0('0xa')](_0x65d0('0xb'),_0x2289b2,_0x65d0('0xc'));logger[_0x65d0('0xd')](_0x65d0('0xe'),_0x2289b2,_0x65d0('0xc'),JSON[_0x65d0('0xf')](_0x21bd91));if(_0x21bd91[_0x65d0('0x10')]){if(_0x21bd91[_0x65d0('0x10')][_0x65d0('0x11')]===0x1f4){logger['error'](_0x65d0('0xb'),_0x2289b2,_0x21bd91[_0x65d0('0x10')][_0x65d0('0x12')]);return _0x5d471a(_0x21bd91['error']['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2289b2,_0x21bd91[_0x65d0('0x10')][_0x65d0('0x12')]);return _0x814e4c(_0x21bd91[_0x65d0('0x10')][_0x65d0('0x12')]);}else{logger[_0x65d0('0xa')](_0x65d0('0xb'),_0x2289b2,_0x65d0('0xc'));_0x814e4c(_0x21bd91[_0x65d0('0x13')][_0x65d0('0x12')]);}})[_0x65d0('0x14')](function(_0x5e57a5){logger['error'](_0x65d0('0xb'),_0x2289b2,_0x5e57a5);_0x5d471a(_0x5e57a5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index cda8bc5..f1189a8 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(_0x5aa9e6,_0x50e231){var _0x26be92=function(_0x5c797a){while(--_0x5c797a){_0x5aa9e6['push'](_0x5aa9e6['shift']());}};_0x26be92(++_0x50e231);}(_0x70e0,0x17b));var _0x070e=function(_0x184f84,_0x243446){_0x184f84=_0x184f84-0x0;var _0x214e0d=_0x70e0[_0x184f84];return _0x214e0d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19eccf,_0x53f863){var _0x33f4f3=function(_0x2067fa){while(--_0x2067fa){_0x19eccf['push'](_0x19eccf['shift']());}};_0x33f4f3(++_0x53f863);}(_0xe706,0xa3));var _0x6e70=function(_0x12fe24,_0x4061cd){_0x12fe24=_0x12fe24-0x0;var _0x309501=_0xe706[_0x12fe24];return _0x309501;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ab76e14..3d58184 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 _0xbc5d=['exports','INTEGER'];(function(_0x20cd58,_0x35a818){var _0x40f9f0=function(_0x559d1c){while(--_0x559d1c){_0x20cd58['push'](_0x20cd58['shift']());}};_0x40f9f0(++_0x35a818);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x2e9a38,_0x885300){_0x2e9a38=_0x2e9a38-0x0;var _0x54b1d6=_0xbc5d[_0x2e9a38];return _0x54b1d6;};'use strict';var Sequelize=require('sequelize');module[_0xdbc5('0x0')]={'penalty':{'type':Sequelize[_0xdbc5('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x75fb=['exports','INTEGER','sequelize'];(function(_0x52ac84,_0xdae638){var _0x330000=function(_0x36b31f){while(--_0x36b31f){_0x52ac84['push'](_0x52ac84['shift']());}};_0x330000(++_0xdae638);}(_0x75fb,0x140));var _0xb75f=function(_0x3f10df,_0x3305ed){_0x3f10df=_0x3f10df-0x0;var _0x5bf83f=_0x75fb[_0x3f10df];return _0x5bf83f;};'use strict';var Sequelize=require(_0xb75f('0x0'));module[_0xb75f('0x1')]={'penalty':{'type':Sequelize[_0xb75f('0x2')],'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 4c9fe70..4f2a72e 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 _0x2581=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x533606,_0x428dee){var _0x2e1376=function(_0x29f190){while(--_0x29f190){_0x533606['push'](_0x533606['shift']());}};_0x2e1376(++_0x428dee);}(_0x2581,0xcb));var _0x1258=function(_0x5d3b8a,_0x34448b){_0x5d3b8a=_0x5d3b8a-0x0;var _0x50a006=_0x2581[_0x5d3b8a];return _0x50a006;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var logger=require(_0x1258('0x2'))(_0x1258('0x3'));var moment=require(_0x1258('0x4'));var BPromise=require('bluebird');var rp=require(_0x1258('0x5'));var fs=require('fs');var path=require(_0x1258('0x6'));var rimraf=require(_0x1258('0x7'));var config=require(_0x1258('0x8'));var attributes=require(_0x1258('0x9'));module[_0x1258('0xa')]=function(_0x16c926,_0x2aeafc){return _0x16c926['define'](_0x1258('0xb'),attributes,{'tableName':_0x1258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7278=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x58143f,_0x3eeee9){var _0x19e659=function(_0x3bcb36){while(--_0x3bcb36){_0x58143f['push'](_0x58143f['shift']());}};_0x19e659(++_0x3eeee9);}(_0x7278,0x161));var _0x8727=function(_0x248872,_0x2def28){_0x248872=_0x248872-0x0;var _0x318ae7=_0x7278[_0x248872];return _0x318ae7;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 7ae4384..874f445 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 _0x215b=['message','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x9fdd53,_0xd7b5c0){var _0x4ed380=function(_0x365143){while(--_0x365143){_0x9fdd53['push'](_0x9fdd53['shift']());}};_0x4ed380(++_0xd7b5c0);}(_0x215b,0x122));var _0xb215=function(_0x8fb2a3,_0x4b0261){_0x8fb2a3=_0x8fb2a3-0x0;var _0x34ffd7=_0x215b[_0x8fb2a3];return _0x34ffd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb215('0x0'));var rs=require(_0xb215('0x1'));var fs=require('fs');var Redis=require(_0xb215('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb215('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xb215('0x4'));var jayson=require(_0xb215('0x5'));var client=jayson[_0xb215('0x6')][_0xb215('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xeb0556,_0x3837df,_0x361ba0){return new BPromise(function(_0x2afca6,_0x41354a){return client['request'](_0xeb0556,_0x361ba0)[_0xb215('0x8')](function(_0x1276b6){logger[_0xb215('0x9')](_0xb215('0xa'),_0x3837df,_0xb215('0xb'));logger[_0xb215('0xc')](_0xb215('0xd'),_0x3837df,_0xb215('0xb'),JSON['stringify'](_0x1276b6));if(_0x1276b6[_0xb215('0xe')]){if(_0x1276b6[_0xb215('0xe')][_0xb215('0xf')]===0x1f4){logger[_0xb215('0xe')](_0xb215('0xa'),_0x3837df,_0x1276b6[_0xb215('0xe')][_0xb215('0x10')]);return _0x41354a(_0x1276b6['error'][_0xb215('0x10')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x3837df,_0x1276b6[_0xb215('0xe')][_0xb215('0x10')]);return _0x2afca6(_0x1276b6[_0xb215('0xe')][_0xb215('0x10')]);}else{logger[_0xb215('0x9')](_0xb215('0xa'),_0x3837df,_0xb215('0xb'));_0x2afca6(_0x1276b6['result'][_0xb215('0x10')]);}})[_0xb215('0x11')](function(_0x146497){logger[_0xb215('0xe')](_0xb215('0xa'),_0x3837df,_0x146497);_0x41354a(_0x146497);});});} \ No newline at end of file +var _0xdc21=['moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x39285d,_0x4e7c32){var _0x5b809b=function(_0x1c0b21){while(--_0x1c0b21){_0x39285d['push'](_0x39285d['shift']());}};_0x5b809b(++_0x4e7c32);}(_0xdc21,0xd7));var _0x1dc2=function(_0x171a17,_0x3b079d){_0x171a17=_0x171a17-0x0;var _0x1d4d5e=_0xdc21[_0x171a17];return _0x1d4d5e;};'use strict';var _=require('lodash');var util=require(_0x1dc2('0x0'));var moment=require(_0x1dc2('0x1'));var BPromise=require(_0x1dc2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dc2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1dc2('0x5'));var client=jayson['client'][_0x1dc2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x10b8ef,_0x4afbb4,_0x24d2eb){return new BPromise(function(_0x51f59e,_0x573b12){return client[_0x1dc2('0x7')](_0x10b8ef,_0x24d2eb)['then'](function(_0xe37163){logger[_0x1dc2('0x8')](_0x1dc2('0x9'),_0x4afbb4,_0x1dc2('0xa'));logger[_0x1dc2('0xb')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4afbb4,_0x1dc2('0xa'),JSON[_0x1dc2('0xc')](_0xe37163));if(_0xe37163[_0x1dc2('0xd')]){if(_0xe37163[_0x1dc2('0xd')][_0x1dc2('0xe')]===0x1f4){logger['error'](_0x1dc2('0x9'),_0x4afbb4,_0xe37163[_0x1dc2('0xd')]['message']);return _0x573b12(_0xe37163['error']['message']);}logger[_0x1dc2('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4afbb4,_0xe37163[_0x1dc2('0xd')][_0x1dc2('0xf')]);return _0x51f59e(_0xe37163[_0x1dc2('0xd')][_0x1dc2('0xf')]);}else{logger[_0x1dc2('0x8')](_0x1dc2('0x9'),_0x4afbb4,'request\x20sent');_0x51f59e(_0xe37163[_0x1dc2('0x10')][_0x1dc2('0xf')]);}})[_0x1dc2('0x11')](function(_0x1979b8){logger[_0x1dc2('0xd')](_0x1dc2('0x9'),_0x4afbb4,_0x1979b8);_0x573b12(_0x1979b8);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 02479d9..672949c 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32c9=['exports','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x32c9,0x17c));var _0x932c=function(_0x4acc43,_0x5125a0){_0x4acc43=_0x4acc43-0x0;var _0x12ba15=_0x32c9[_0x4acc43];return _0x12ba15;};'use strict';var Sequelize=require(_0x932c('0x0'));module[_0x932c('0x1')]={'UserId':{'type':Sequelize[_0x932c('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa571=['INTEGER','exports'];(function(_0x40aaeb,_0x4df561){var _0x20d5e0=function(_0x4d7d4e){while(--_0x4d7d4e){_0x40aaeb['push'](_0x40aaeb['shift']());}};_0x20d5e0(++_0x4df561);}(_0xa571,0x14b));var _0x1a57=function(_0x3aa0ab,_0x236a1b){_0x3aa0ab=_0x3aa0ab-0x0;var _0x58127d=_0xa571[_0x3aa0ab];return _0x58127d;};'use strict';var Sequelize=require('sequelize');module[_0x1a57('0x0')]={'UserId':{'type':Sequelize[_0x1a57('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x1a57('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 0bad713..64d4ca8 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(_0x17eca9,_0x41d781){var _0x281135=function(_0x22d3fb){while(--_0x22d3fb){_0x17eca9['push'](_0x17eca9['shift']());}};_0x281135(++_0x41d781);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x4fe725,_0x31cd17){var _0x232411=function(_0x14ae2c){while(--_0x14ae2c){_0x4fe725['push'](_0x4fe725['shift']());}};_0x232411(++_0x31cd17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 f994fe9..5fa336d 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1a5968,_0x112eee){var _0x496e4c=function(_0x518bae){while(--_0x518bae){_0x1a5968['push'](_0x1a5968['shift']());}};_0x496e4c(++_0x112eee);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e8aa9,_0x589c35){var _0x41237f=function(_0x45f474){while(--_0x45f474){_0x1e8aa9['push'](_0x1e8aa9['shift']());}};_0x41237f(++_0x589c35);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a5bccb2..35518b9 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 _0xf611=['INTEGER','exports'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0xf611,0x7b));var _0x1f61=function(_0x5a09f3,_0x9ce907){_0x5a09f3=_0x5a09f3-0x0;var _0x3665c2=_0xf611[_0x5a09f3];return _0x3665c2;};'use strict';var Sequelize=require('sequelize');module[_0x1f61('0x0')]={'penalty':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x406e=['sequelize'];(function(_0x320e1c,_0x13f38e){var _0x12a6b6=function(_0x568801){while(--_0x568801){_0x320e1c['push'](_0x320e1c['shift']());}};_0x12a6b6(++_0x13f38e);}(_0x406e,0xab));var _0xe406=function(_0x247792,_0x582fff){_0x247792=_0x247792-0x0;var _0x3cfc3d=_0x406e[_0x247792];return _0x3cfc3d;};'use strict';var Sequelize=require(_0xe406('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 43540ae..ab4c579 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 _0x434f=['exports','define','UserVoiceQueue','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x4fa078,_0x283fb7){var _0x447318=function(_0x325170){while(--_0x325170){_0x4fa078['push'](_0x4fa078['shift']());}};_0x447318(++_0x283fb7);}(_0x434f,0x184));var _0xf434=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x434f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf434('0x0'));var logger=require(_0xf434('0x1'))(_0xf434('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf434('0x3'));var fs=require('fs');var path=require(_0xf434('0x4'));var rimraf=require(_0xf434('0x5'));var config=require(_0xf434('0x6'));var attributes=require(_0xf434('0x7'));module[_0xf434('0x8')]=function(_0x18ef40,_0x584322){return _0x18ef40[_0xf434('0x9')](_0xf434('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf25b=['moment','request-promise','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x440ba5,_0x573515){var _0x218106=function(_0x1b9eb6){while(--_0x1b9eb6){_0x440ba5['push'](_0x440ba5['shift']());}};_0x218106(++_0x573515);}(_0xf25b,0x125));var _0xbf25=function(_0x42139b,_0x4e959e){_0x42139b=_0x42139b-0x0;var _0x3779b3=_0xf25b[_0x42139b];return _0x3779b3;};'use strict';var _=require(_0xbf25('0x0'));var util=require(_0xbf25('0x1'));var logger=require(_0xbf25('0x2'))(_0xbf25('0x3'));var moment=require(_0xbf25('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf25('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf25('0x7'));module['exports']=function(_0x3dd579,_0x46a032){return _0x3dd579[_0xbf25('0x8')](_0xbf25('0x9'),attributes,{'tableName':_0xbf25('0xa'),'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 74e55e0..015cfe4 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 _0x265a=['client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x522663,_0x129f78){var _0x42976b=function(_0x42f3b5){while(--_0x42f3b5){_0x522663['push'](_0x522663['shift']());}};_0x42976b(++_0x129f78);}(_0x265a,0x10b));var _0xa265=function(_0x8c5df9,_0xf48ae5){_0x8c5df9=_0x8c5df9-0x0;var _0x170565=_0x265a[_0x8c5df9];return _0x170565;};'use strict';var _=require(_0xa265('0x0'));var util=require(_0xa265('0x1'));var moment=require('moment');var BPromise=require(_0xa265('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa265('0x3'))['db'];var utils=require(_0xa265('0x4'));var logger=require(_0xa265('0x5'))(_0xa265('0x6'));var config=require(_0xa265('0x7'));var jayson=require(_0xa265('0x8'));var client=jayson[_0xa265('0x9')][_0xa265('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39ad1c,_0x41409c,_0x4ced60){return new BPromise(function(_0xa44b73,_0x4141bd){return client['request'](_0x39ad1c,_0x4ced60)[_0xa265('0xb')](function(_0x5f07e0){logger[_0xa265('0xc')](_0xa265('0xd'),_0x41409c,'request\x20sent');logger[_0xa265('0xe')](_0xa265('0xf'),_0x41409c,_0xa265('0x10'),JSON[_0xa265('0x11')](_0x5f07e0));if(_0x5f07e0[_0xa265('0x12')]){if(_0x5f07e0[_0xa265('0x12')][_0xa265('0x13')]===0x1f4){logger[_0xa265('0x12')](_0xa265('0xd'),_0x41409c,_0x5f07e0[_0xa265('0x12')]['message']);return _0x4141bd(_0x5f07e0[_0xa265('0x12')][_0xa265('0x14')]);}logger[_0xa265('0x12')](_0xa265('0xd'),_0x41409c,_0x5f07e0[_0xa265('0x12')][_0xa265('0x14')]);return _0xa44b73(_0x5f07e0[_0xa265('0x12')][_0xa265('0x14')]);}else{logger[_0xa265('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x41409c,_0xa265('0x10'));_0xa44b73(_0x5f07e0[_0xa265('0x15')][_0xa265('0x14')]);}})[_0xa265('0x16')](function(_0x2dc517){logger[_0xa265('0x12')](_0xa265('0xd'),_0x41409c,_0x2dc517);_0x4141bd(_0x2dc517);});});} \ No newline at end of file +var _0x9f7e=['http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x323d3a,_0x325482){var _0x24847a=function(_0x9b0376){while(--_0x9b0376){_0x323d3a['push'](_0x323d3a['shift']());}};_0x24847a(++_0x325482);}(_0x9f7e,0x1ee));var _0xe9f7=function(_0x52852f,_0x1aef29){_0x52852f=_0x52852f-0x0;var _0x22cda2=_0x9f7e[_0x52852f];return _0x22cda2;};'use strict';var _=require(_0xe9f7('0x0'));var util=require(_0xe9f7('0x1'));var moment=require(_0xe9f7('0x2'));var BPromise=require(_0xe9f7('0x3'));var rs=require(_0xe9f7('0x4'));var fs=require('fs');var Redis=require(_0xe9f7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9f7('0x6'))(_0xe9f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe9f7('0x8'));var client=jayson[_0xe9f7('0x9')][_0xe9f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xed9f03,_0x172775,_0x170bde){return new BPromise(function(_0x47e931,_0x4f64be){return client[_0xe9f7('0xb')](_0xed9f03,_0x170bde)['then'](function(_0x4ea011){logger['info'](_0xe9f7('0xc'),_0x172775,_0xe9f7('0xd'));logger['debug'](_0xe9f7('0xe'),_0x172775,_0xe9f7('0xd'),JSON[_0xe9f7('0xf')](_0x4ea011));if(_0x4ea011[_0xe9f7('0x10')]){if(_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x11')]===0x1f4){logger[_0xe9f7('0x10')](_0xe9f7('0xc'),_0x172775,_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x12')]);return _0x4f64be(_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x12')]);}logger['error'](_0xe9f7('0xc'),_0x172775,_0x4ea011[_0xe9f7('0x10')]['message']);return _0x47e931(_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x12')]);}else{logger[_0xe9f7('0x13')](_0xe9f7('0xc'),_0x172775,'request\x20sent');_0x47e931(_0x4ea011['result'][_0xe9f7('0x12')]);}})[_0xe9f7('0x14')](function(_0x364123){logger['error'](_0xe9f7('0xc'),_0x172775,_0x364123);_0x4f64be(_0x364123);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index fb65fd1..477141b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1a06c4,_0x17d0e0){var _0x1bf57b=function(_0x2c11fa){while(--_0x2c11fa){_0x1a06c4['push'](_0x1a06c4['shift']());}};_0x1bf57b(++_0x17d0e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x199928,_0x4261ba){var _0x1bdbcc=function(_0x24616d){while(--_0x24616d){_0x199928['push'](_0x199928['shift']());}};_0x1bdbcc(++_0x4261ba);}(_0x70e0,0x17b));var _0x070e=function(_0x197d53,_0x201a20){_0x197d53=_0x197d53-0x0;var _0x22620d=_0x70e0[_0x197d53];return _0x22620d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 92fb19a..f9381a1 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 _0xdadf=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0xdadf,0xc8));var _0xfdad=function(_0x22ab87,_0x15da09){_0x22ab87=_0x22ab87-0x0;var _0x2baa47=_0xdadf[_0x22ab87];return _0x2baa47;};'use strict';var Sequelize=require(_0xfdad('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfdad('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfdad('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xfdad('0x2')},'UserId':{'type':Sequelize[_0xfdad('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfdad('0x3')],'allowNull':![],'unique':_0xfdad('0x4'),'comment':_0xfdad('0x2')},'VoiceQueueId':{'type':Sequelize[_0xfdad('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xfdad('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xfdad('0x2')},'penalty':{'type':Sequelize[_0xfdad('0x1')](0xb),'defaultValue':0x0,'comment':_0xfdad('0x2')},'paused':{'type':Sequelize[_0xfdad('0x1')](0xb),'defaultValue':0x0,'comment':_0xfdad('0x2')}}; \ No newline at end of file +var _0x626d=['queue_interface','Required\x20by\x20Asterisk','sequelize','STRING','INTEGER'];(function(_0x533bf7,_0x29485b){var _0x9e4c57=function(_0xe4211f){while(--_0xe4211f){_0x533bf7['push'](_0x533bf7['shift']());}};_0x9e4c57(++_0x29485b);}(_0x626d,0x89));var _0xd626=function(_0x4a400b,_0x330140){_0x4a400b=_0x4a400b-0x0;var _0xe992b6=_0x626d[_0x4a400b];return _0xe992b6;};'use strict';var Sequelize=require(_0xd626('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xd626('0x1')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xd626('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd626('0x1')],'allowNull':![],'unique':_0xd626('0x3'),'comment':_0xd626('0x4')},'VoiceQueueId':{'type':Sequelize[_0xd626('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd626('0x3'),'comment':_0xd626('0x4')},'penalty':{'type':Sequelize[_0xd626('0x2')](0xb),'defaultValue':0x0,'comment':_0xd626('0x4')},'paused':{'type':Sequelize[_0xd626('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 5854efe..def19f7 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 _0xf470=['../../mysqldb','UserVoiceQueueRt','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x5003bc,_0x18e9cc){var _0x57d786=function(_0x1ffd13){while(--_0x1ffd13){_0x5003bc['push'](_0x5003bc['shift']());}};_0x57d786(++_0x18e9cc);}(_0xf470,0x10f));var _0x0f47=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xf470[_0x6cf19c];return _0xce14f3;};'use strict';var EventEmitter=require(_0x0f47('0x0'));var UserVoiceQueueRt=require(_0x0f47('0x1'))['db'][_0x0f47('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0f47('0x3'),'afterUpdate':'update','afterDestroy':_0x0f47('0x4')};function emitEvent(_0xc1a218){return function(_0x30a574,_0x45b203,_0x4dc9c9){UserVoiceQueueRtEvents[_0x0f47('0x5')](_0xc1a218+':'+_0x30a574['id'],_0x30a574);UserVoiceQueueRtEvents[_0x0f47('0x5')](_0xc1a218,_0x30a574);_0x4dc9c9(null);};}for(var e in events){if(events[_0x0f47('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x0f47('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x3625=['events','../../mysqldb','setMaxListeners','remove','hook'];(function(_0x358b6b,_0x120a51){var _0x2237f4=function(_0x17184b){while(--_0x17184b){_0x358b6b['push'](_0x358b6b['shift']());}};_0x2237f4(++_0x120a51);}(_0x3625,0x131));var _0x5362=function(_0x246055,_0x439e28){_0x246055=_0x246055-0x0;var _0x14a40f=_0x3625[_0x246055];return _0x14a40f;};'use strict';var EventEmitter=require(_0x5362('0x0'));var UserVoiceQueueRt=require(_0x5362('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5362('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5362('0x3')};function emitEvent(_0x4dae54){return function(_0x108dc1,_0x4610af,_0x49308d){UserVoiceQueueRtEvents['emit'](_0x4dae54+':'+_0x108dc1['id'],_0x108dc1);UserVoiceQueueRtEvents['emit'](_0x4dae54,_0x108dc1);_0x49308d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5362('0x4')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 84b3f30..62600f2 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 _0xb251=['user_has_voice_queues_rt','util','api','moment','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x262d5d,_0x4d3971){var _0x5efb20=function(_0x24c93f){while(--_0x24c93f){_0x262d5d['push'](_0x262d5d['shift']());}};_0x5efb20(++_0x4d3971);}(_0xb251,0xc7));var _0x1b25=function(_0x82b747,_0x455313){_0x82b747=_0x82b747-0x0;var _0x44580e=_0xb251[_0x82b747];return _0x44580e;};'use strict';var _=require('lodash');var util=require(_0x1b25('0x0'));var logger=require('../../config/logger')(_0x1b25('0x1'));var moment=require(_0x1b25('0x2'));var BPromise=require('bluebird');var rp=require(_0x1b25('0x3'));var fs=require('fs');var path=require(_0x1b25('0x4'));var rimraf=require(_0x1b25('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b25('0x6'));module[_0x1b25('0x7')]=function(_0x2e4b4c,_0x466a29){return _0x2e4b4c[_0x1b25('0x8')](_0x1b25('0x9'),attributes,{'tableName':_0x1b25('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42fe=['moment','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','../../config/logger','api'];(function(_0x1befd8,_0x243e88){var _0x112308=function(_0x328d47){while(--_0x328d47){_0x1befd8['push'](_0x1befd8['shift']());}};_0x112308(++_0x243e88);}(_0x42fe,0xc3));var _0xe42f=function(_0x3c9fcf,_0x4f639f){_0x3c9fcf=_0x3c9fcf-0x0;var _0x26d6a5=_0x42fe[_0x3c9fcf];return _0x26d6a5;};'use strict';var _=require(_0xe42f('0x0'));var util=require('util');var logger=require(_0xe42f('0x1'))(_0xe42f('0x2'));var moment=require(_0xe42f('0x3'));var BPromise=require('bluebird');var rp=require(_0xe42f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe42f('0x5'));var config=require(_0xe42f('0x6'));var attributes=require(_0xe42f('0x7'));module[_0xe42f('0x8')]=function(_0x3b925a,_0x13e9bb){return _0x3b925a[_0xe42f('0x9')](_0xe42f('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 075c21f..c384982 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 _0xe963=['jayson/promise','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','options','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4eaafe,_0x2cb1c6){var _0x2d0d06=function(_0x3eb588){while(--_0x3eb588){_0x4eaafe['push'](_0x4eaafe['shift']());}};_0x2d0d06(++_0x2cb1c6);}(_0xe963,0x77));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e96('0x0'));var util=require(_0x3e96('0x1'));var moment=require(_0x3e96('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e96('0x3'));var fs=require('fs');var Redis=require(_0x3e96('0x4'));var db=require(_0x3e96('0x5'))['db'];var utils=require(_0x3e96('0x6'));var logger=require(_0x3e96('0x7'))('rpc');var config=require(_0x3e96('0x8'));var jayson=require(_0x3e96('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3e96('0xa')]=_['defaults'](config[_0x3e96('0xa')],{'host':_0x3e96('0xb'),'port':0x18eb});var socket=require(_0x3e96('0xc'))(new Redis(config[_0x3e96('0xa')]));require('./userVoiceQueueRt.socket')[_0x3e96('0xd')](socket);function respondWithRpcPromise(_0x55018f,_0x110b3f,_0x592c00){return new BPromise(function(_0x51905a,_0xad1115){return client[_0x3e96('0xe')](_0x55018f,_0x592c00)['then'](function(_0x4fc982){logger[_0x3e96('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x110b3f,_0x3e96('0x10'));logger['debug'](_0x3e96('0x11'),_0x110b3f,_0x3e96('0x10'),JSON[_0x3e96('0x12')](_0x4fc982));if(_0x4fc982['error']){if(_0x4fc982[_0x3e96('0x13')][_0x3e96('0x14')]===0x1f4){logger[_0x3e96('0x13')](_0x3e96('0x15'),_0x110b3f,_0x4fc982[_0x3e96('0x13')][_0x3e96('0x16')]);return _0xad1115(_0x4fc982[_0x3e96('0x13')][_0x3e96('0x16')]);}logger[_0x3e96('0x13')](_0x3e96('0x15'),_0x110b3f,_0x4fc982['error'][_0x3e96('0x16')]);return _0x51905a(_0x4fc982[_0x3e96('0x13')][_0x3e96('0x16')]);}else{logger[_0x3e96('0xf')](_0x3e96('0x15'),_0x110b3f,_0x3e96('0x10'));_0x51905a(_0x4fc982[_0x3e96('0x17')][_0x3e96('0x16')]);}})[_0x3e96('0x18')](function(_0x4054e){logger[_0x3e96('0x13')](_0x3e96('0x15'),_0x110b3f,_0x4054e);_0xad1115(_0x4054e);});});}exports['GetVoiceQueueRtPauses']=function(_0xf649a){var _0x28d59f=this;return new Promise(function(_0x3dcfca,_0x1217d4){return db['UserVoiceQueueRt']['findAll']({'raw':_0xf649a[_0x3e96('0x19')]?_0xf649a[_0x3e96('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf649a[_0x3e96('0x19')]?_0xf649a['options'][_0x3e96('0x1a')]||null:null,'attributes':[[db[_0x3e96('0x1b')]['fn'](_0x3e96('0x1c'),db[_0x3e96('0x1b')]['fn']('IF',db[_0x3e96('0x1b')][_0x3e96('0x1d')]('`paused`\x20=\x201,\x201,\x20null'))),_0x3e96('0x1e')]]})['then'](function(_0x143496){logger['info'](_0x3e96('0x1f'),_0xf649a);logger['debug'](_0x3e96('0x1f'),_0xf649a,JSON[_0x3e96('0x12')](_0x143496));_0x3dcfca(_0x143496);})[_0x3e96('0x18')](function(_0x5104c7){logger[_0x3e96('0x13')]('GetVoiceQueueRtPauses',_0x5104c7[_0x3e96('0x16')],_0xf649a);_0x1217d4(_0x28d59f[_0x3e96('0x13')](0x1f4,_0x5104c7[_0x3e96('0x16')]));});});}; \ No newline at end of file +var _0x3c4e=['jayson/promise','client','defaults','redis','localhost','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x3c4e,0xb5));var _0xe3c4=function(_0x21fe11,_0x52f846){_0x21fe11=_0x21fe11-0x0;var _0x5eb704=_0x3c4e[_0x21fe11];return _0x5eb704;};'use strict';var _=require('lodash');var util=require(_0xe3c4('0x0'));var moment=require(_0xe3c4('0x1'));var BPromise=require(_0xe3c4('0x2'));var rs=require(_0xe3c4('0x3'));var fs=require('fs');var Redis=require(_0xe3c4('0x4'));var db=require(_0xe3c4('0x5'))['db'];var utils=require(_0xe3c4('0x6'));var logger=require('../../config/logger')(_0xe3c4('0x7'));var config=require(_0xe3c4('0x8'));var jayson=require(_0xe3c4('0x9'));var client=jayson[_0xe3c4('0xa')]['http']({'port':0x232a});config['redis']=_[_0xe3c4('0xb')](config[_0xe3c4('0xc')],{'host':_0xe3c4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe3c4('0xe'))[_0xe3c4('0xf')](socket);function respondWithRpcPromise(_0x31fb05,_0x36e458,_0x4df7b1){return new BPromise(function(_0x2c5a90,_0x225334){return client['request'](_0x31fb05,_0x4df7b1)[_0xe3c4('0x10')](function(_0x413cee){logger[_0xe3c4('0x11')](_0xe3c4('0x12'),_0x36e458,'request\x20sent');logger[_0xe3c4('0x13')](_0xe3c4('0x14'),_0x36e458,'request\x20sent',JSON[_0xe3c4('0x15')](_0x413cee));if(_0x413cee['error']){if(_0x413cee[_0xe3c4('0x16')][_0xe3c4('0x17')]===0x1f4){logger[_0xe3c4('0x16')](_0xe3c4('0x12'),_0x36e458,_0x413cee['error'][_0xe3c4('0x18')]);return _0x225334(_0x413cee['error'][_0xe3c4('0x18')]);}logger[_0xe3c4('0x16')](_0xe3c4('0x12'),_0x36e458,_0x413cee[_0xe3c4('0x16')][_0xe3c4('0x18')]);return _0x2c5a90(_0x413cee[_0xe3c4('0x16')][_0xe3c4('0x18')]);}else{logger['info'](_0xe3c4('0x12'),_0x36e458,_0xe3c4('0x19'));_0x2c5a90(_0x413cee[_0xe3c4('0x1a')][_0xe3c4('0x18')]);}})[_0xe3c4('0x1b')](function(_0x257a2c){logger['error'](_0xe3c4('0x12'),_0x36e458,_0x257a2c);_0x225334(_0x257a2c);});});}exports[_0xe3c4('0x1c')]=function(_0x4b9c2e){var _0x583a96=this;return new Promise(function(_0x314cc1,_0x24c9bb){return db[_0xe3c4('0x1d')][_0xe3c4('0x1e')]({'raw':_0x4b9c2e[_0xe3c4('0x1f')]?_0x4b9c2e['options'][_0xe3c4('0x20')]===undefined?!![]:![]:!![],'where':_0x4b9c2e[_0xe3c4('0x1f')]?_0x4b9c2e[_0xe3c4('0x1f')][_0xe3c4('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xe3c4('0x22')]['fn']('IF',db[_0xe3c4('0x22')][_0xe3c4('0x23')](_0xe3c4('0x24')))),_0xe3c4('0x25')]]})[_0xe3c4('0x10')](function(_0x37742f){logger[_0xe3c4('0x11')](_0xe3c4('0x1c'),_0x4b9c2e);logger[_0xe3c4('0x13')](_0xe3c4('0x1c'),_0x4b9c2e,JSON[_0xe3c4('0x15')](_0x37742f));_0x314cc1(_0x37742f);})[_0xe3c4('0x1b')](function(_0x374dee){logger[_0xe3c4('0x16')](_0xe3c4('0x1c'),_0x374dee['message'],_0x4b9c2e);_0x24c9bb(_0x583a96[_0xe3c4('0x16')](0x1f4,_0x374dee[_0xe3c4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8d27de5..e3f0968 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 _0x7958=['./userVoiceQueueRt.events','save','update','emit','removeListener','userVoiceQueueRt:'];(function(_0x3ca6d6,_0x1e644c){var _0xc88cfc=function(_0x4d77be){while(--_0x4d77be){_0x3ca6d6['push'](_0x3ca6d6['shift']());}};_0xc88cfc(++_0x1e644c);}(_0x7958,0x126));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0x8795('0x0'));var events=[_0x8795('0x1'),'remove',_0x8795('0x2')];function createListener(_0x3e286f,_0x132a3d){return function(_0xe7546e){_0x132a3d[_0x8795('0x3')](_0x3e286f,_0xe7546e);};}function removeListener(_0x43aff1,_0x347089){return function(){UserVoiceQueueRtEvents[_0x8795('0x4')](_0x43aff1,_0x347089);};}exports['register']=function(_0xed1860){for(var _0x456403=0x0,_0x427ba5=events['length'];_0x456403<_0x427ba5;_0x456403++){var _0x12c15c=events[_0x456403];var _0x4ea71f=createListener(_0x8795('0x5')+_0x12c15c,_0xed1860);UserVoiceQueueRtEvents['on'](_0x12c15c,_0x4ea71f);}}; \ No newline at end of file +var _0x4819=['length','userVoiceQueueRt:','save','remove','update','emit','removeListener'];(function(_0xdc616b,_0xa83725){var _0x1d97b2=function(_0x307cff){while(--_0x307cff){_0xdc616b['push'](_0xdc616b['shift']());}};_0x1d97b2(++_0xa83725);}(_0x4819,0xcd));var _0x9481=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x4819[_0x3ce2c4];return _0x4047c1;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x9481('0x0'),_0x9481('0x1'),_0x9481('0x2')];function createListener(_0x12a70c,_0x273a32){return function(_0xfb4034){_0x273a32[_0x9481('0x3')](_0x12a70c,_0xfb4034);};}function removeListener(_0x14dc10,_0xc39edf){return function(){UserVoiceQueueRtEvents[_0x9481('0x4')](_0x14dc10,_0xc39edf);};}exports['register']=function(_0x4d9e3a){for(var _0x5def07=0x0,_0x54cc78=events[_0x9481('0x5')];_0x5def07<_0x54cc78;_0x5def07++){var _0x6c6a08=events[_0x5def07];var _0x27c033=createListener(_0x9481('0x6')+_0x6c6a08,_0x4d9e3a);UserVoiceQueueRtEvents['on'](_0x6c6a08,_0x27c033);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 2559794..d7dc6f9 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xacbf2b,_0x114077){var _0x558991=function(_0x499c12){while(--_0x499c12){_0xacbf2b['push'](_0xacbf2b['shift']());}};_0x558991(++_0x114077);}(_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(_0x45bee0,_0x42bf09){var _0x1fcfd5=function(_0x235b6a){while(--_0x235b6a){_0x45bee0['push'](_0x45bee0['shift']());}};_0x1fcfd5(++_0x42bf09);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 4506567..b5b865e 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 _0x70a1=['exports'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x70a1,0xd1));var _0x170a=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x70a1[_0x469a3c];return _0x968f4;};'use strict';var Sequelize=require('sequelize');module[_0x170a('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2942=['sequelize','exports','INTEGER'];(function(_0x2f6cee,_0x35436e){var _0x12428c=function(_0x3100d5){while(--_0x3100d5){_0x2f6cee['push'](_0x2f6cee['shift']());}};_0x12428c(++_0x35436e);}(_0x2942,0x15f));var _0x2294=function(_0x41d406,_0x5294e6){_0x41d406=_0x41d406-0x0;var _0x170a28=_0x2942[_0x41d406];return _0x170a28;};'use strict';var Sequelize=require(_0x2294('0x0'));module[_0x2294('0x1')]={'penalty':{'type':Sequelize[_0x2294('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 5c273c8..fd5fdc4 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 _0x1d6d=['user_has_whatsapp_queues','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x2e9013,_0x1b60be){var _0x5d0ce8=function(_0x40666e){while(--_0x40666e){_0x2e9013['push'](_0x2e9013['shift']());}};_0x5d0ce8(++_0x1b60be);}(_0x1d6d,0x9a));var _0xd1d6=function(_0x1ddc68,_0x2946c9){_0x1ddc68=_0x1ddc68-0x0;var _0x442199=_0x1d6d[_0x1ddc68];return _0x442199;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd1d6('0x0'))(_0xd1d6('0x1'));var moment=require(_0xd1d6('0x2'));var BPromise=require(_0xd1d6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1d6('0x4'));var rimraf=require(_0xd1d6('0x5'));var config=require(_0xd1d6('0x6'));var attributes=require(_0xd1d6('0x7'));module['exports']=function(_0x53ba50,_0x4caab8){return _0x53ba50['define']('UserWhatsappQueue',attributes,{'tableName':_0xd1d6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d83=['exports','define','UserWhatsappQueue','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x478f24,_0x4ec986){var _0x28c420=function(_0x382bb3){while(--_0x382bb3){_0x478f24['push'](_0x478f24['shift']());}};_0x28c420(++_0x4ec986);}(_0x9d83,0xb7));var _0x39d8=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x9d83[_0x3b7a0c];return _0x3bb70f;};'use strict';var _=require(_0x39d8('0x0'));var util=require('util');var logger=require(_0x39d8('0x1'))(_0x39d8('0x2'));var moment=require(_0x39d8('0x3'));var BPromise=require(_0x39d8('0x4'));var rp=require(_0x39d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x39d8('0x6')]=function(_0x243fd3,_0x370a9d){return _0x243fd3[_0x39d8('0x7')](_0x39d8('0x8'),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 71f3082..754696c 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 _0x8148=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x8148,0xba));var _0x8814=function(_0x266c55,_0x55197f){_0x266c55=_0x266c55-0x0;var _0x2557ec=_0x8148[_0x266c55];return _0x2557ec;};'use strict';var _=require(_0x8814('0x0'));var util=require(_0x8814('0x1'));var moment=require(_0x8814('0x2'));var BPromise=require(_0x8814('0x3'));var rs=require(_0x8814('0x4'));var fs=require('fs');var Redis=require(_0x8814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8814('0x6'));var logger=require(_0x8814('0x7'))('rpc');var config=require(_0x8814('0x8'));var jayson=require(_0x8814('0x9'));var client=jayson[_0x8814('0xa')][_0x8814('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14d8af,_0x27d24d,_0xa21710){return new BPromise(function(_0x38a1e7,_0xf90c56){return client[_0x8814('0xc')](_0x14d8af,_0xa21710)[_0x8814('0xd')](function(_0x6d31b3){logger[_0x8814('0xe')](_0x8814('0xf'),_0x27d24d,_0x8814('0x10'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x27d24d,_0x8814('0x10'),JSON[_0x8814('0x11')](_0x6d31b3));if(_0x6d31b3[_0x8814('0x12')]){if(_0x6d31b3['error']['code']===0x1f4){logger['error'](_0x8814('0xf'),_0x27d24d,_0x6d31b3['error'][_0x8814('0x13')]);return _0xf90c56(_0x6d31b3[_0x8814('0x12')]['message']);}logger['error'](_0x8814('0xf'),_0x27d24d,_0x6d31b3[_0x8814('0x12')][_0x8814('0x13')]);return _0x38a1e7(_0x6d31b3['error']['message']);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x27d24d,_0x8814('0x10'));_0x38a1e7(_0x6d31b3[_0x8814('0x14')][_0x8814('0x13')]);}})[_0x8814('0x15')](function(_0x9d1f79){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x27d24d,_0x9d1f79);_0xf90c56(_0x9d1f79);});});} \ No newline at end of file +var _0x83b2=['../../mysqldb','rpc','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x36db65,_0x2b4af1){var _0x5bea6a=function(_0x513889){while(--_0x513889){_0x36db65['push'](_0x36db65['shift']());}};_0x5bea6a(++_0x2b4af1);}(_0x83b2,0x15b));var _0x283b=function(_0x57129e,_0x41adc0){_0x57129e=_0x57129e-0x0;var _0x313a42=_0x83b2[_0x57129e];return _0x313a42;};'use strict';var _=require('lodash');var util=require(_0x283b('0x0'));var moment=require(_0x283b('0x1'));var BPromise=require(_0x283b('0x2'));var rs=require(_0x283b('0x3'));var fs=require('fs');var Redis=require(_0x283b('0x4'));var db=require(_0x283b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x283b('0x6'));var config=require('../../config/environment');var jayson=require(_0x283b('0x7'));var client=jayson[_0x283b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527c8e,_0x2cebfb,_0x1a2a57){return new BPromise(function(_0x3cc705,_0x14c784){return client[_0x283b('0x9')](_0x527c8e,_0x1a2a57)[_0x283b('0xa')](function(_0x1d35e4){logger[_0x283b('0xb')](_0x283b('0xc'),_0x2cebfb,_0x283b('0xd'));logger[_0x283b('0xe')](_0x283b('0xf'),_0x2cebfb,_0x283b('0xd'),JSON[_0x283b('0x10')](_0x1d35e4));if(_0x1d35e4['error']){if(_0x1d35e4['error'][_0x283b('0x11')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2cebfb,_0x1d35e4[_0x283b('0x12')][_0x283b('0x13')]);return _0x14c784(_0x1d35e4['error'][_0x283b('0x13')]);}logger[_0x283b('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2cebfb,_0x1d35e4[_0x283b('0x12')][_0x283b('0x13')]);return _0x3cc705(_0x1d35e4[_0x283b('0x12')]['message']);}else{logger[_0x283b('0xb')](_0x283b('0xc'),_0x2cebfb,_0x283b('0xd'));_0x3cc705(_0x1d35e4[_0x283b('0x14')][_0x283b('0x13')]);}})[_0x283b('0x15')](function(_0x3bfda8){logger[_0x283b('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2cebfb,_0x3bfda8);_0x14c784(_0x3bfda8);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 34d48ff..ef50b1c 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 _0x5af0=['show','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x35cbb6,_0x4588cc){var _0x3830b8=function(_0x4e6d8c){while(--_0x4e6d8c){_0x35cbb6['push'](_0x35cbb6['shift']());}};_0x3830b8(++_0x4588cc);}(_0x5af0,0x1eb));var _0x05af=function(_0x541051,_0x557dc7){_0x541051=_0x541051-0x0;var _0x1eb28d=_0x5af0[_0x541051];return _0x1eb28d;};'use strict';var multer=require(_0x05af('0x0'));var util=require(_0x05af('0x1'));var path=require(_0x05af('0x2'));var timeout=require(_0x05af('0x3'));var express=require(_0x05af('0x4'));var router=express[_0x05af('0x5')]();var fs_extra=require(_0x05af('0x6'));var auth=require(_0x05af('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x05af('0x8'));var controller=require('./variable.controller');router[_0x05af('0x9')]('/',auth[_0x05af('0xa')](),controller[_0x05af('0xb')]);router['get'](_0x05af('0xc'),auth['isAuthenticated'](),controller[_0x05af('0xd')]);router[_0x05af('0xe')]('/',auth[_0x05af('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x05af('0xf')]);router[_0x05af('0x10')](_0x05af('0xc'),auth['isAuthenticated'](),controller[_0x05af('0x11')]);module['exports']=router; \ No newline at end of file +var _0x455d=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x456d15,_0x317a52){var _0x329e41=function(_0x39ea29){while(--_0x39ea29){_0x456d15['push'](_0x456d15['shift']());}};_0x329e41(++_0x317a52);}(_0x455d,0x190));var _0xd455=function(_0x566f48,_0x3d5d87){_0x566f48=_0x566f48-0x0;var _0x2a6b72=_0x455d[_0x566f48];return _0x2a6b72;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd455('0x0'));var timeout=require(_0xd455('0x1'));var express=require(_0xd455('0x2'));var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router[_0xd455('0x8')]('/',auth[_0xd455('0x9')](),controller[_0xd455('0xa')]);router[_0xd455('0x8')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0xb')]);router['post']('/',auth[_0xd455('0x9')](),controller[_0xd455('0xc')]);router[_0xd455('0xd')](_0xd455('0xe'),auth['isAuthenticated'](),controller[_0xd455('0xf')]);router[_0xd455('0x10')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0x11')]);module[_0xd455('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index c90c15e..77dde35 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 _0x1472=['STRING','name','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1472,0xe9));var _0x2147=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x1472[_0x43b584];return _0x48f27b;};'use strict';var Sequelize=require(_0x2147('0x0'));module['exports']={'name':{'type':Sequelize[_0x2147('0x1')],'unique':_0x2147('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf774=['sequelize','STRING','name'];(function(_0x587da8,_0x461e3b){var _0x572bdc=function(_0x455ca2){while(--_0x455ca2){_0x587da8['push'](_0x587da8['shift']());}};_0x572bdc(++_0x461e3b);}(_0xf774,0xae));var _0x4f77=function(_0x410339,_0x1c5d6f){_0x410339=_0x410339-0x0;var _0x1600cf=_0xf774[_0x410339];return _0x1600cf;};'use strict';var Sequelize=require(_0x4f77('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f77('0x1')],'unique':_0x4f77('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4f77('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 12c19fe..ba0055a 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 _0x237c=['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','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','save','update','destroy','then','get','Variables','error','stack','name','send','index','map','Variable','fieldName','type','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','keys','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x88e356,_0x4c7292){var _0x5d9aa7=function(_0x483c6d){while(--_0x483c6d){_0x88e356['push'](_0x88e356['shift']());}};_0x5d9aa7(++_0x4c7292);}(_0x237c,0x1f0));var _0xc237=function(_0xce6c0c,_0xb864e3){_0xce6c0c=_0xce6c0c-0x0;var _0x3ae561=_0x237c[_0xce6c0c];return _0x3ae561;};'use strict';var emlformat=require(_0xc237('0x0'));var rimraf=require(_0xc237('0x1'));var zipdir=require(_0xc237('0x2'));var jsonpatch=require(_0xc237('0x3'));var rp=require(_0xc237('0x4'));var moment=require(_0xc237('0x5'));var BPromise=require(_0xc237('0x6'));var Mustache=require(_0xc237('0x7'));var util=require(_0xc237('0x8'));var path=require(_0xc237('0x9'));var sox=require(_0xc237('0xa'));var csv=require(_0xc237('0xb'));var ejs=require(_0xc237('0xc'));var fs=require('fs');var fs_extra=require(_0xc237('0xd'));var _=require(_0xc237('0xe'));var squel=require(_0xc237('0xf'));var crypto=require(_0xc237('0x10'));var jsforce=require(_0xc237('0x11'));var deskjs=require(_0xc237('0x12'));var toCsv=require('to-csv');var querystring=require(_0xc237('0x13'));var Papa=require('papaparse');var Redis=require(_0xc237('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc237('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc237('0x16'))('api');var utils=require(_0xc237('0x17'));var config=require(_0xc237('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc237('0x19'))['db'];function respondWithStatusCode(_0x2d96b1,_0xf5e8d9){_0xf5e8d9=_0xf5e8d9||0xcc;return function(_0x1c071f){if(_0x1c071f){return _0x2d96b1[_0xc237('0x1a')](_0xf5e8d9);}return _0x2d96b1[_0xc237('0x1b')](_0xf5e8d9)[_0xc237('0x1c')]();};}function respondWithResult(_0x414a4a,_0x552bea){_0x552bea=_0x552bea||0xc8;return function(_0x450157){if(_0x450157){return _0x414a4a[_0xc237('0x1b')](_0x552bea)['json'](_0x450157);}};}function respondWithFilteredResult(_0x17bc98,_0x3bbc53){return function(_0x49087d){if(_0x49087d){var _0x1a102e=typeof _0x3bbc53[_0xc237('0x1d')]===_0xc237('0x1e')&&typeof _0x3bbc53[_0xc237('0x1f')]===_0xc237('0x1e');var _0x498813=_0x49087d['count'];var _0x3755e2=_0x1a102e?0x0:_0x3bbc53[_0xc237('0x1d')];var _0x5d5222=_0x1a102e?_0x49087d['count']:_0x3bbc53['offset']+_0x3bbc53[_0xc237('0x1f')];var _0x5784f7;if(_0x5d5222>=_0x498813){_0x5d5222=_0x498813;_0x5784f7=0xc8;}else{_0x5784f7=0xce;}_0x17bc98['status'](_0x5784f7);return _0x17bc98[_0xc237('0x20')]('Content-Range',_0x3755e2+'-'+_0x5d5222+'/'+_0x498813)[_0xc237('0x21')](_0x49087d);}return null;};}function patchUpdates(_0x4d939e){return function(_0x152db3){try{jsonpatch[_0xc237('0x22')](_0x152db3,_0x4d939e,!![]);}catch(_0x2ef626){return BPromise['reject'](_0x2ef626);}return _0x152db3[_0xc237('0x23')]();};}function saveUpdates(_0x2c499f,_0x439912){return function(_0x9ce9d2){if(_0x9ce9d2){return _0x9ce9d2[_0xc237('0x24')](_0x2c499f)['then'](function(_0x57eca3){return _0x57eca3;});}return null;};}function removeEntity(_0x396ac6,_0x4ce1e9){return function(_0x1e2230){if(_0x1e2230){return _0x1e2230[_0xc237('0x25')]()[_0xc237('0x26')](function(){var _0x3a8e22=_0x1e2230[_0xc237('0x27')]({'plain':!![]});var _0x1f8d26=_0xc237('0x28');return db['UserProfileResource'][_0xc237('0x25')]({'where':{'type':_0x1f8d26,'resourceId':_0x3a8e22['id']}})[_0xc237('0x26')](function(){return _0x1e2230;});})['then'](function(){_0x396ac6[_0xc237('0x1b')](0xcc)[_0xc237('0x1c')]();});}};}function handleEntityNotFound(_0x438de4,_0x39bbf6){return function(_0x13c621){if(!_0x13c621){_0x438de4['sendStatus'](0x194);}return _0x13c621;};}function handleError(_0x436da0,_0x1caf0b){_0x1caf0b=_0x1caf0b||0x1f4;return function(_0x4f1dbc){logger[_0xc237('0x29')](_0x4f1dbc[_0xc237('0x2a')]);if(_0x4f1dbc[_0xc237('0x2b')]){delete _0x4f1dbc[_0xc237('0x2b')];}_0x436da0[_0xc237('0x1b')](_0x1caf0b)[_0xc237('0x2c')](_0x4f1dbc);};}exports[_0xc237('0x2d')]=function(_0x30ca43,_0x2558cc){var _0x502ef9={},_0x24b3c1={},_0x508fff={'count':0x0,'rows':[]};var _0x27d6a3=_[_0xc237('0x2e')](db[_0xc237('0x2f')]['rawAttributes'],function(_0x3a8c28){return{'name':_0x3a8c28[_0xc237('0x30')],'type':_0x3a8c28[_0xc237('0x31')][_0xc237('0x32')]};});_0x24b3c1[_0xc237('0x33')]=_[_0xc237('0x2e')](_0x27d6a3,_0xc237('0x2b'));_0x24b3c1[_0xc237('0x34')]=_['keys'](_0x30ca43[_0xc237('0x34')]);_0x24b3c1['filters']=_[_0xc237('0x35')](_0x24b3c1[_0xc237('0x33')],_0x24b3c1['query']);_0x502ef9['attributes']=_[_0xc237('0x35')](_0x24b3c1[_0xc237('0x33')],qs[_0xc237('0x36')](_0x30ca43[_0xc237('0x34')][_0xc237('0x36')]));_0x502ef9[_0xc237('0x37')]=_0x502ef9[_0xc237('0x37')]['length']?_0x502ef9['attributes']:_0x24b3c1[_0xc237('0x33')];if(!_0x30ca43[_0xc237('0x34')]['hasOwnProperty'](_0xc237('0x38'))){_0x502ef9[_0xc237('0x1f')]=qs['limit'](_0x30ca43['query'][_0xc237('0x1f')]);_0x502ef9[_0xc237('0x1d')]=qs['offset'](_0x30ca43['query']['offset']);}_0x502ef9[_0xc237('0x39')]=qs[_0xc237('0x3a')](_0x30ca43['query'][_0xc237('0x3a')]);_0x502ef9[_0xc237('0x3b')]=qs[_0xc237('0x3c')](_[_0xc237('0x3d')](_0x30ca43[_0xc237('0x34')],_0x24b3c1[_0xc237('0x3c')]),_0x27d6a3);if(_0x30ca43[_0xc237('0x34')][_0xc237('0x3e')]){_0x502ef9[_0xc237('0x3b')]=_['merge'](_0x502ef9[_0xc237('0x3b')],{'$or':_[_0xc237('0x2e')](_0x27d6a3,function(_0x302a90){if(_0x302a90[_0xc237('0x31')]!=='VIRTUAL'){var _0x5162ee={};_0x5162ee[_0x302a90[_0xc237('0x2b')]]={'$like':'%'+_0x30ca43['query']['filter']+'%'};return _0x5162ee;}})});}_0x502ef9=_[_0xc237('0x3f')]({},_0x502ef9,_0x30ca43[_0xc237('0x40')]);var _0x3be5a5={'where':_0x502ef9['where']};return db[_0xc237('0x2f')][_0xc237('0x41')](_0x3be5a5)['then'](function(_0x5916ab){_0x508fff['count']=_0x5916ab;if(_0x30ca43[_0xc237('0x34')][_0xc237('0x42')]){_0x502ef9['include']=[{'all':!![]}];}return db['Variable'][_0xc237('0x43')](_0x502ef9);})['then'](function(_0x1d3df5){_0x508fff[_0xc237('0x44')]=_0x1d3df5;return _0x508fff;})['then'](respondWithFilteredResult(_0x2558cc,_0x502ef9))['catch'](handleError(_0x2558cc,null));};exports[_0xc237('0x45')]=function(_0x2223b5,_0x4756d6){var _0x488ce3={'raw':!![],'where':{'id':_0x2223b5[_0xc237('0x46')]['id']}},_0x49f90f={};_0x49f90f[_0xc237('0x33')]=_[_0xc237('0x47')](db['Variable']['rawAttributes']);_0x49f90f['query']=_[_0xc237('0x47')](_0x2223b5['query']);_0x49f90f['filters']=_[_0xc237('0x35')](_0x49f90f[_0xc237('0x33')],_0x49f90f[_0xc237('0x34')]);_0x488ce3[_0xc237('0x37')]=_[_0xc237('0x35')](_0x49f90f[_0xc237('0x33')],qs[_0xc237('0x36')](_0x2223b5[_0xc237('0x34')][_0xc237('0x36')]));_0x488ce3[_0xc237('0x37')]=_0x488ce3[_0xc237('0x37')][_0xc237('0x48')]?_0x488ce3[_0xc237('0x37')]:_0x49f90f['model'];if(_0x2223b5[_0xc237('0x34')]['includeAll']){_0x488ce3[_0xc237('0x49')]=[{'all':!![]}];}_0x488ce3=_['merge']({},_0x488ce3,_0x2223b5['options']);return db[_0xc237('0x2f')][_0xc237('0x4a')](_0x488ce3)[_0xc237('0x26')](handleEntityNotFound(_0x4756d6,null))[_0xc237('0x26')](respondWithResult(_0x4756d6,null))[_0xc237('0x4b')](handleError(_0x4756d6,null));};exports[_0xc237('0x4c')]=function(_0x320c7b,_0x5118b7){return db[_0xc237('0x2f')][_0xc237('0x4c')](_0x320c7b[_0xc237('0x4d')],{})[_0xc237('0x26')](function(_0x118f04){var _0x134c9b=_0x320c7b[_0xc237('0x4e')][_0xc237('0x27')]({'plain':!![]});if(!_0x134c9b)throw new Error(_0xc237('0x4f'));if(_0x134c9b[_0xc237('0x50')]===_0xc237('0x4e')){var _0x460193=_0x118f04[_0xc237('0x27')]({'plain':!![]});var _0x5f31e3=_0xc237('0x28');return db['UserProfileSection'][_0xc237('0x4a')]({'where':{'name':_0x5f31e3,'userProfileId':_0x134c9b['userProfileId']},'raw':!![]})[_0xc237('0x26')](function(_0x31e8c8){if(_0x31e8c8&&_0x31e8c8[_0xc237('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x460193[_0xc237('0x2b')],'resourceId':_0x460193['id'],'type':_0x31e8c8[_0xc237('0x2b')],'sectionId':_0x31e8c8['id']},{})['then'](function(){return _0x118f04;});}else{return _0x118f04;}})[_0xc237('0x4b')](function(_0x58a4e3){logger[_0xc237('0x29')](_0xc237('0x52'),_0x58a4e3);throw _0x58a4e3;});}return _0x118f04;})[_0xc237('0x26')](respondWithResult(_0x5118b7,0xc9))[_0xc237('0x4b')](handleError(_0x5118b7,null));};exports[_0xc237('0x24')]=function(_0x5d0893,_0x432eb2){if(_0x5d0893['body']['id']){delete _0x5d0893[_0xc237('0x4d')]['id'];}return db[_0xc237('0x2f')][_0xc237('0x4a')]({'where':{'id':_0x5d0893['params']['id']}})[_0xc237('0x26')](handleEntityNotFound(_0x432eb2,null))[_0xc237('0x26')](saveUpdates(_0x5d0893[_0xc237('0x4d')],null))['then'](respondWithResult(_0x432eb2,null))[_0xc237('0x4b')](handleError(_0x432eb2,null));};exports[_0xc237('0x25')]=function(_0x32a421,_0x7c0e1d){return db[_0xc237('0x2f')][_0xc237('0x4a')]({'where':{'id':_0x32a421[_0xc237('0x46')]['id']}})['then'](handleEntityNotFound(_0x7c0e1d,null))[_0xc237('0x26')](removeEntity(_0x7c0e1d,null))['catch'](handleError(_0x7c0e1d,null));}; \ No newline at end of file +var _0xaeef=['catch','show','params','intersection','options','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x28c776,_0x32db20){var _0x25ec69=function(_0x479216){while(--_0x479216){_0x28c776['push'](_0x28c776['shift']());}};_0x25ec69(++_0x32db20);}(_0xaeef,0xae));var _0xfaee=function(_0x51bd6b,_0x409463){_0x51bd6b=_0x51bd6b-0x0;var _0x39cf82=_0xaeef[_0x51bd6b];return _0x39cf82;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfaee('0x0'));var moment=require(_0xfaee('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfaee('0x2'));var path=require(_0xfaee('0x3'));var sox=require(_0xfaee('0x4'));var csv=require('to-csv');var ejs=require(_0xfaee('0x5'));var fs=require('fs');var fs_extra=require(_0xfaee('0x6'));var _=require(_0xfaee('0x7'));var squel=require(_0xfaee('0x8'));var crypto=require(_0xfaee('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfaee('0xa'));var querystring=require(_0xfaee('0xb'));var Papa=require(_0xfaee('0xc'));var Redis=require(_0xfaee('0xd'));var authService=require(_0xfaee('0xe'));var qs=require(_0xfaee('0xf'));var as=require(_0xfaee('0x10'));var hardwareService=require(_0xfaee('0x11'));var logger=require(_0xfaee('0x12'))('api');var utils=require(_0xfaee('0x13'));var config=require(_0xfaee('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaee('0x15'))['db'];function respondWithStatusCode(_0x8a0048,_0x207ce1){_0x207ce1=_0x207ce1||0xcc;return function(_0x262bbc){if(_0x262bbc){return _0x8a0048['sendStatus'](_0x207ce1);}return _0x8a0048[_0xfaee('0x16')](_0x207ce1)[_0xfaee('0x17')]();};}function respondWithResult(_0x4ee364,_0x798c5){_0x798c5=_0x798c5||0xc8;return function(_0x58c9d6){if(_0x58c9d6){return _0x4ee364[_0xfaee('0x16')](_0x798c5)[_0xfaee('0x18')](_0x58c9d6);}};}function respondWithFilteredResult(_0x40eb43,_0x4cf216){return function(_0x2103b4){if(_0x2103b4){var _0x49a9c2=typeof _0x4cf216[_0xfaee('0x19')]===_0xfaee('0x1a')&&typeof _0x4cf216[_0xfaee('0x1b')]===_0xfaee('0x1a');var _0x40aa1b=_0x2103b4['count'];var _0x488661=_0x49a9c2?0x0:_0x4cf216[_0xfaee('0x19')];var _0x3e5445=_0x49a9c2?_0x2103b4[_0xfaee('0x1c')]:_0x4cf216[_0xfaee('0x19')]+_0x4cf216[_0xfaee('0x1b')];var _0x338679;if(_0x3e5445>=_0x40aa1b){_0x3e5445=_0x40aa1b;_0x338679=0xc8;}else{_0x338679=0xce;}_0x40eb43['status'](_0x338679);return _0x40eb43[_0xfaee('0x1d')]('Content-Range',_0x488661+'-'+_0x3e5445+'/'+_0x40aa1b)[_0xfaee('0x18')](_0x2103b4);}return null;};}function patchUpdates(_0x16e9f2){return function(_0x5a80ec){try{jsonpatch[_0xfaee('0x1e')](_0x5a80ec,_0x16e9f2,!![]);}catch(_0x591410){return BPromise[_0xfaee('0x1f')](_0x591410);}return _0x5a80ec[_0xfaee('0x20')]();};}function saveUpdates(_0x645ca2,_0x17900f){return function(_0x33c889){if(_0x33c889){return _0x33c889[_0xfaee('0x21')](_0x645ca2)['then'](function(_0x46a908){return _0x46a908;});}return null;};}function removeEntity(_0x1c8961,_0x448313){return function(_0x7ad79a){if(_0x7ad79a){return _0x7ad79a[_0xfaee('0x22')]()[_0xfaee('0x23')](function(){var _0x33de47=_0x7ad79a[_0xfaee('0x24')]({'plain':!![]});var _0x2ee06c=_0xfaee('0x25');return db[_0xfaee('0x26')][_0xfaee('0x22')]({'where':{'type':_0x2ee06c,'resourceId':_0x33de47['id']}})[_0xfaee('0x23')](function(){return _0x7ad79a;});})[_0xfaee('0x23')](function(){_0x1c8961['status'](0xcc)[_0xfaee('0x17')]();});}};}function handleEntityNotFound(_0x4e4973,_0x127817){return function(_0x5809a0){if(!_0x5809a0){_0x4e4973[_0xfaee('0x27')](0x194);}return _0x5809a0;};}function handleError(_0x2065f0,_0x172654){_0x172654=_0x172654||0x1f4;return function(_0x70ef6a){logger[_0xfaee('0x28')](_0x70ef6a[_0xfaee('0x29')]);if(_0x70ef6a['name']){delete _0x70ef6a[_0xfaee('0x2a')];}_0x2065f0[_0xfaee('0x16')](_0x172654)[_0xfaee('0x2b')](_0x70ef6a);};}exports[_0xfaee('0x2c')]=function(_0x129196,_0x509085){var _0x4a4c61={},_0x4f7e7c={},_0x218fdb={'count':0x0,'rows':[]};var _0x23ea2b=_['map'](db[_0xfaee('0x2d')][_0xfaee('0x2e')],function(_0x28b170){return{'name':_0x28b170[_0xfaee('0x2f')],'type':_0x28b170[_0xfaee('0x30')]['key']};});_0x4f7e7c[_0xfaee('0x31')]=_[_0xfaee('0x32')](_0x23ea2b,_0xfaee('0x2a'));_0x4f7e7c[_0xfaee('0x33')]=_[_0xfaee('0x34')](_0x129196[_0xfaee('0x33')]);_0x4f7e7c['filters']=_['intersection'](_0x4f7e7c[_0xfaee('0x31')],_0x4f7e7c['query']);_0x4a4c61[_0xfaee('0x35')]=_['intersection'](_0x4f7e7c[_0xfaee('0x31')],qs[_0xfaee('0x36')](_0x129196[_0xfaee('0x33')]['fields']));_0x4a4c61['attributes']=_0x4a4c61[_0xfaee('0x35')][_0xfaee('0x37')]?_0x4a4c61[_0xfaee('0x35')]:_0x4f7e7c[_0xfaee('0x31')];if(!_0x129196[_0xfaee('0x33')][_0xfaee('0x38')](_0xfaee('0x39'))){_0x4a4c61[_0xfaee('0x1b')]=qs['limit'](_0x129196['query'][_0xfaee('0x1b')]);_0x4a4c61['offset']=qs[_0xfaee('0x19')](_0x129196[_0xfaee('0x33')]['offset']);}_0x4a4c61[_0xfaee('0x3a')]=qs['sort'](_0x129196[_0xfaee('0x33')][_0xfaee('0x3b')]);_0x4a4c61[_0xfaee('0x3c')]=qs[_0xfaee('0x3d')](_[_0xfaee('0x3e')](_0x129196[_0xfaee('0x33')],_0x4f7e7c[_0xfaee('0x3d')]),_0x23ea2b);if(_0x129196[_0xfaee('0x33')][_0xfaee('0x3f')]){_0x4a4c61[_0xfaee('0x3c')]=_[_0xfaee('0x40')](_0x4a4c61['where'],{'$or':_[_0xfaee('0x32')](_0x23ea2b,function(_0x55b54a){if(_0x55b54a[_0xfaee('0x30')]!==_0xfaee('0x41')){var _0x1653fa={};_0x1653fa[_0x55b54a[_0xfaee('0x2a')]]={'$like':'%'+_0x129196[_0xfaee('0x33')][_0xfaee('0x3f')]+'%'};return _0x1653fa;}})});}_0x4a4c61=_[_0xfaee('0x40')]({},_0x4a4c61,_0x129196['options']);var _0x4829f5={'where':_0x4a4c61[_0xfaee('0x3c')]};return db[_0xfaee('0x2d')][_0xfaee('0x1c')](_0x4829f5)[_0xfaee('0x23')](function(_0x214cb5){_0x218fdb[_0xfaee('0x1c')]=_0x214cb5;if(_0x129196['query'][_0xfaee('0x42')]){_0x4a4c61[_0xfaee('0x43')]=[{'all':!![]}];}return db[_0xfaee('0x2d')][_0xfaee('0x44')](_0x4a4c61);})['then'](function(_0x57335e){_0x218fdb['rows']=_0x57335e;return _0x218fdb;})['then'](respondWithFilteredResult(_0x509085,_0x4a4c61))[_0xfaee('0x45')](handleError(_0x509085,null));};exports[_0xfaee('0x46')]=function(_0x2a1020,_0x4b1fb5){var _0x5c4219={'raw':!![],'where':{'id':_0x2a1020[_0xfaee('0x47')]['id']}},_0x4094f7={};_0x4094f7[_0xfaee('0x31')]=_['keys'](db[_0xfaee('0x2d')][_0xfaee('0x2e')]);_0x4094f7[_0xfaee('0x33')]=_[_0xfaee('0x34')](_0x2a1020['query']);_0x4094f7[_0xfaee('0x3d')]=_[_0xfaee('0x48')](_0x4094f7[_0xfaee('0x31')],_0x4094f7['query']);_0x5c4219['attributes']=_[_0xfaee('0x48')](_0x4094f7[_0xfaee('0x31')],qs[_0xfaee('0x36')](_0x2a1020[_0xfaee('0x33')][_0xfaee('0x36')]));_0x5c4219[_0xfaee('0x35')]=_0x5c4219[_0xfaee('0x35')][_0xfaee('0x37')]?_0x5c4219[_0xfaee('0x35')]:_0x4094f7['model'];if(_0x2a1020['query'][_0xfaee('0x42')]){_0x5c4219['include']=[{'all':!![]}];}_0x5c4219=_[_0xfaee('0x40')]({},_0x5c4219,_0x2a1020[_0xfaee('0x49')]);return db[_0xfaee('0x2d')]['find'](_0x5c4219)[_0xfaee('0x23')](handleEntityNotFound(_0x4b1fb5,null))[_0xfaee('0x23')](respondWithResult(_0x4b1fb5,null))[_0xfaee('0x45')](handleError(_0x4b1fb5,null));};exports[_0xfaee('0x4a')]=function(_0x2758af,_0x486ad5){return db[_0xfaee('0x2d')][_0xfaee('0x4a')](_0x2758af[_0xfaee('0x4b')],{})[_0xfaee('0x23')](function(_0x1a77db){var _0x133555=_0x2758af[_0xfaee('0x4c')][_0xfaee('0x24')]({'plain':!![]});if(!_0x133555)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133555[_0xfaee('0x4d')]==='user'){var _0x10ed38=_0x1a77db[_0xfaee('0x24')]({'plain':!![]});var _0x10bf7d=_0xfaee('0x25');return db['UserProfileSection'][_0xfaee('0x4e')]({'where':{'name':_0x10bf7d,'userProfileId':_0x133555[_0xfaee('0x4f')]},'raw':!![]})[_0xfaee('0x23')](function(_0x127cda){if(_0x127cda&&_0x127cda['autoAssociation']===0x0){return db[_0xfaee('0x26')]['create']({'name':_0x10ed38[_0xfaee('0x2a')],'resourceId':_0x10ed38['id'],'type':_0x127cda[_0xfaee('0x2a')],'sectionId':_0x127cda['id']},{})[_0xfaee('0x23')](function(){return _0x1a77db;});}else{return _0x1a77db;}})[_0xfaee('0x45')](function(_0x19723d){logger[_0xfaee('0x28')](_0xfaee('0x50'),_0x19723d);throw _0x19723d;});}return _0x1a77db;})[_0xfaee('0x23')](respondWithResult(_0x486ad5,0xc9))['catch'](handleError(_0x486ad5,null));};exports[_0xfaee('0x21')]=function(_0x3ac772,_0x54c1ba){if(_0x3ac772['body']['id']){delete _0x3ac772[_0xfaee('0x4b')]['id'];}return db[_0xfaee('0x2d')][_0xfaee('0x4e')]({'where':{'id':_0x3ac772[_0xfaee('0x47')]['id']}})['then'](handleEntityNotFound(_0x54c1ba,null))[_0xfaee('0x23')](saveUpdates(_0x3ac772[_0xfaee('0x4b')],null))[_0xfaee('0x23')](respondWithResult(_0x54c1ba,null))[_0xfaee('0x45')](handleError(_0x54c1ba,null));};exports[_0xfaee('0x22')]=function(_0x2509ab,_0x3f7025){return db[_0xfaee('0x2d')][_0xfaee('0x4e')]({'where':{'id':_0x2509ab['params']['id']}})['then'](handleEntityNotFound(_0x3f7025,null))[_0xfaee('0x23')](removeEntity(_0x3f7025,null))['catch'](handleError(_0x3f7025,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 290d1ee..64896f1 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 _0x7703=['define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./variable.attributes'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x7703,0x158));var _0x3770=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x7703[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x3770('0x0'));var util=require(_0x3770('0x1'));var logger=require(_0x3770('0x2'))(_0x3770('0x3'));var moment=require('moment');var BPromise=require(_0x3770('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3770('0x5'));var rimraf=require('rimraf');var config=require(_0x3770('0x6'));var attributes=require(_0x3770('0x7'));module['exports']=function(_0x4e82a4,_0x4974a9){return _0x4e82a4[_0x3770('0x8')](_0x3770('0x9'),attributes,{'tableName':_0x3770('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bb7=['request-promise','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','../../config/logger','api','moment'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x1bb7,0x18c));var _0x71bb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1bb7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x71bb('0x0'));var util=require('util');var logger=require(_0x71bb('0x1'))(_0x71bb('0x2'));var moment=require(_0x71bb('0x3'));var BPromise=require('bluebird');var rp=require(_0x71bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71bb('0x5'));var config=require(_0x71bb('0x6'));var attributes=require('./variable.attributes');module[_0x71bb('0x7')]=function(_0x369650,_0x39d965){return _0x369650['define'](_0x71bb('0x8'),attributes,{'tableName':_0x71bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index ad69f6d..b91f936 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 _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x2111e3,_0x366862){var _0x36084f=function(_0x19b41a){while(--_0x19b41a){_0x2111e3['push'](_0x2111e3['shift']());}};_0x36084f(++_0x366862);}(_0x814b,0x1a2));var _0xb814=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0x814b[_0x1f4b18];return _0xde3957;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x3671b7,_0x5398bd){var _0x50f41b=function(_0x25dba4){while(--_0x25dba4){_0x3671b7['push'](_0x3671b7['shift']());}};_0x50f41b(++_0x5398bd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x4b84[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index aee2c4d..ecdb381 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 _0x598c=['express','Router','../../components/auth/service','./version.controller','get','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','restart','/migrations','migrations'];(function(_0x4cb408,_0x2054c9){var _0x28fc52=function(_0x5a2d57){while(--_0x5a2d57){_0x4cb408['push'](_0x4cb408['shift']());}};_0x28fc52(++_0x2054c9);}(_0x598c,0xe1));var _0xc598=function(_0x12ce51,_0x159e83){_0x12ce51=_0x12ce51-0x0;var _0x500653=_0x598c[_0x12ce51];return _0x500653;};'use strict';var express=require(_0xc598('0x0'));var router=express[_0xc598('0x1')]();var auth=require(_0xc598('0x2'));var controller=require(_0xc598('0x3'));router[_0xc598('0x4')]('/',controller['index']);router['get']('/fetch',auth[_0xc598('0x5')](),auth[_0xc598('0x6')](),controller[_0xc598('0x7')]);router[_0xc598('0x4')](_0xc598('0x8'),auth[_0xc598('0x5')](),auth[_0xc598('0x6')](),controller[_0xc598('0x9')]);router['get'](_0xc598('0xa'),auth[_0xc598('0x5')](),auth[_0xc598('0x6')](),controller['pull']);router[_0xc598('0x4')](_0xc598('0xb'),auth[_0xc598('0x5')](),controller[_0xc598('0xc')]);router[_0xc598('0x4')](_0xc598('0xd'),controller[_0xc598('0xe')]);module['exports']=router; \ No newline at end of file +var _0x18d5=['index','isAuthenticated','get','canUpdate','pull','/restart','/migrations','exports','express','../../components/auth/service','./version.controller'];(function(_0x31823c,_0x3e6e4a){var _0xc959f9=function(_0x18178c){while(--_0x18178c){_0x31823c['push'](_0x31823c['shift']());}};_0xc959f9(++_0x3e6e4a);}(_0x18d5,0xfa));var _0x518d=function(_0x5ec13b,_0x3a0097){_0x5ec13b=_0x5ec13b-0x0;var _0x5c82a1=_0x18d5[_0x5ec13b];return _0x5c82a1;};'use strict';var express=require(_0x518d('0x0'));var router=express['Router']();var auth=require(_0x518d('0x1'));var controller=require(_0x518d('0x2'));router['get']('/',controller[_0x518d('0x3')]);router['get']('/fetch',auth[_0x518d('0x4')](),auth['canUpdate'](),controller['fetch']);router[_0x518d('0x5')]('/reset',auth[_0x518d('0x4')](),auth[_0x518d('0x6')](),controller['reset']);router[_0x518d('0x5')]('/pull',auth[_0x518d('0x4')](),auth[_0x518d('0x6')](),controller[_0x518d('0x7')]);router[_0x518d('0x5')](_0x518d('0x8'),auth[_0x518d('0x4')](),controller['restart']);router['get'](_0x518d('0x9'),controller['migrations']);module[_0x518d('0xa')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index dce2e5c..cdd47c7 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 _0xbd8e=['migrations','replace','push','length','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','join','server'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbd8e,0xa3));var _0xebd8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbd8e[_0x19e35c];return _0x3e1fe8;};'use strict';var Umzug=require(_0xebd8('0x0'));var path=require(_0xebd8('0x1'));var fs=require('fs');var _=require(_0xebd8('0x2'));var pkginfo=require(_0xebd8('0x3'))(module,_0xebd8('0x4'));var compareVersions=require(_0xebd8('0x5'));var exec=require(_0xebd8('0x6'))['exec'];var db=require(_0xebd8('0x7'))['db'];var config=require(_0xebd8('0x8'));var pm2=require(_0xebd8('0x9'));var logger=require('../../config/logger')(_0xebd8('0xa'));var git=require(_0xebd8('0xb'))(config['root']);exports[_0xebd8('0xc')]=function(_0x488c6d,_0xe0fac0){var _0x5b021f={'current':module[_0xebd8('0xd')]['version'],'phonebar':0x2};if(_0x488c6d[_0xebd8('0xe')]&&_0x488c6d['query']['latest']){return git[_0xebd8('0xf')]()[_0xebd8('0x10')](function(_0x10763d,_0x3e90a0){_0x5b021f[_0xebd8('0x11')]=(_0x10763d?module[_0xebd8('0xd')]['version']:_0x3e90a0['latest'])||_0xebd8('0x12');return _0xe0fac0[_0xebd8('0x13')](0xc8)[_0xebd8('0x14')](_0x5b021f);});}else{return _0xe0fac0[_0xebd8('0x13')](0xc8)[_0xebd8('0x14')](_0x5b021f);}};exports['fetch']=function(_0x148fa3,_0x7c0b7e){return git[_0xebd8('0xf')]([_0xebd8('0x15'),'master'],function(_0x4a1354){if(_0x4a1354){logger[_0xebd8('0x16')](_0x4a1354);return _0x7c0b7e[_0xebd8('0x13')](0x1f4)[_0xebd8('0x14')](_0x4a1354);}logger[_0xebd8('0x17')](_0xebd8('0x18'));return _0x7c0b7e[_0xebd8('0x13')](0xc8)[_0xebd8('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xebd8('0x19')]=function(_0x5b5cb9,_0x4161b3){return git['reset']([_0xebd8('0x1a'),_0xebd8('0x1b')],function(_0x1f6c17){if(_0x1f6c17){logger[_0xebd8('0x16')](_0x1f6c17);return _0x4161b3[_0xebd8('0x13')](0x1f4)['json'](_0x1f6c17);}logger[_0xebd8('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4161b3[_0xebd8('0x13')](0xc8)[_0xebd8('0x14')]({'output':_0xebd8('0x1c')});});};exports[_0xebd8('0x1d')]=function(_0x49b2ea,_0x45b8d8){exec('npm\x20install\x20--production',function(_0x59e93b,_0x531ae6,_0xa8e0af){logger['info'](_0x531ae6);logger[_0xebd8('0x17')](_0xa8e0af);if(_0x59e93b){logger[_0xebd8('0x16')](_0x59e93b);return _0x45b8d8[_0xebd8('0x13')](0x1f4)[_0xebd8('0x14')](_0x59e93b);}return _0x45b8d8['status'](0xc8)['json']({'output':_0x531ae6});});};exports['restart']=function(_0x412b43,_0x507818){return pm2[_0xebd8('0x1e')](_0xebd8('0x1f'))[_0xebd8('0x20')](function(_0x10b220){logger[_0xebd8('0x17')](_0xebd8('0x21'),_0x10b220);return _0x507818['status'](0xc8)[_0xebd8('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xebd8('0x22')](function(_0x18ce39){logger['error'](_0x18ce39);return _0x507818[_0xebd8('0x13')](0x1f4)[_0xebd8('0x14')](_0x18ce39);});};exports['migrations']=function(_0x11bf9c,_0x28169f){var _0x567599=fs['readdirSync'](path[_0xebd8('0x23')](config['root'],_0xebd8('0x24'),_0xebd8('0x25')));var _0x46c1e1=[];for(var _0x383150=0x0;_0x383150<_0x567599['length'];_0x383150++){var _0xb2c5a7=_0x567599[_0x383150][_0xebd8('0x26')]('.js','');if(compareVersions(module['exports'][_0xebd8('0x4')],_0xb2c5a7)===-0x1){_0x46c1e1[_0xebd8('0x27')](_0xb2c5a7);}}if(_0x46c1e1[_0xebd8('0x28')]){var _0x1f1221=_0x46c1e1['sort'](compareVersions);var _0x545a64=new Umzug({'storage':_0xebd8('0x29'),'storageOptions':{'model':db[_0xebd8('0x2a')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0xebd8('0x2b')](),db[_0xebd8('0x29')][_0xebd8('0x2c')],function(){throw new Error(_0xebd8('0x2d'));}],'path':path['join'](config['root'],_0xebd8('0x24'),_0xebd8('0x25')),'pattern':/\.js$/}});_0x545a64['up']({'migrations':_[_0xebd8('0x2e')](_0x1f1221,function(_0xb5beda){return _0xb5beda+'.js';})})['then'](function(){return _0x28169f[_0xebd8('0x13')](0xc8)[_0xebd8('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xebd8('0x4')]+_0xebd8('0x2f')+_[_0xebd8('0x30')](_0x1f1221),'migrations':_[_0xebd8('0x23')](_0x1f1221)});})[_0xebd8('0x22')](function(_0x43cd90){if(_0x43cd90 instanceof db[_0xebd8('0x29')]['UniqueConstraintError']){return _0x28169f[_0xebd8('0x13')](0xc8)[_0xebd8('0x14')]({'output':_0xebd8('0x31')});}else{return _0x28169f[_0xebd8('0x13')](0x1f4)[_0xebd8('0x14')](_0x43cd90);}});}else{return _0x28169f['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x9b8b=['readdirSync','join','root','length','replace','.js','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','exports','version','query','latest','tags','status','json','fetch','master','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully'];(function(_0x1181d7,_0x258715){var _0x420c2b=function(_0x5ae97f){while(--_0x5ae97f){_0x1181d7['push'](_0x1181d7['shift']());}};_0x420c2b(++_0x258715);}(_0x9b8b,0x117));var _0xb9b8=function(_0x4823ae,_0x130dc3){_0x4823ae=_0x4823ae-0x0;var _0x50fe9e=_0x9b8b[_0x4823ae];return _0x50fe9e;};'use strict';var Umzug=require(_0xb9b8('0x0'));var path=require(_0xb9b8('0x1'));var fs=require('fs');var _=require(_0xb9b8('0x2'));var pkginfo=require(_0xb9b8('0x3'))(module,'version');var compareVersions=require(_0xb9b8('0x4'));var exec=require(_0xb9b8('0x5'))[_0xb9b8('0x6')];var db=require(_0xb9b8('0x7'))['db'];var config=require(_0xb9b8('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xb9b8('0x9'))(_0xb9b8('0xa'));var git=require(_0xb9b8('0xb'))(config['root']);exports['index']=function(_0xcdd33e,_0x46bec1){var _0x4f41bf={'current':module[_0xb9b8('0xc')][_0xb9b8('0xd')],'phonebar':0x2};if(_0xcdd33e[_0xb9b8('0xe')]&&_0xcdd33e['query'][_0xb9b8('0xf')]){return git['fetch']()[_0xb9b8('0x10')](function(_0x4ee024,_0x2354c9){_0x4f41bf['latest']=(_0x4ee024?module[_0xb9b8('0xc')][_0xb9b8('0xd')]:_0x2354c9[_0xb9b8('0xf')])||'2.0.0';return _0x46bec1[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')](_0x4f41bf);});}else{return _0x46bec1[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')](_0x4f41bf);}};exports[_0xb9b8('0x13')]=function(_0xfc8b47,_0x122116){return git[_0xb9b8('0x13')](['origin',_0xb9b8('0x14')],function(_0x3dd620){if(_0x3dd620){logger[_0xb9b8('0x15')](_0x3dd620);return _0x122116['status'](0x1f4)[_0xb9b8('0x12')](_0x3dd620);}logger[_0xb9b8('0x16')](_0xb9b8('0x17'));return _0x122116[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xb9b8('0x18')]=function(_0x12c430,_0x3644a5){return git['reset'](['--hard',_0xb9b8('0x19')],function(_0x5250db){if(_0x5250db){logger[_0xb9b8('0x15')](_0x5250db);return _0x3644a5[_0xb9b8('0x11')](0x1f4)[_0xb9b8('0x12')](_0x5250db);}logger['info'](_0xb9b8('0x1a'));return _0x3644a5[_0xb9b8('0x11')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xb9b8('0x1b')]=function(_0x2fe38d,_0x5ece9e){exec('npm\x20install\x20--production',function(_0x47e07b,_0x53bdec,_0x43a32d){logger['info'](_0x53bdec);logger[_0xb9b8('0x16')](_0x43a32d);if(_0x47e07b){logger['error'](_0x47e07b);return _0x5ece9e[_0xb9b8('0x11')](0x1f4)['json'](_0x47e07b);}return _0x5ece9e[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0x53bdec});});};exports[_0xb9b8('0x1c')]=function(_0x93d4c7,_0x3fa408){return pm2[_0xb9b8('0x1c')](_0xb9b8('0x1d'))[_0xb9b8('0x1e')](function(_0x522a58){logger[_0xb9b8('0x16')](_0xb9b8('0x1f'),_0x522a58);return _0x3fa408['status'](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x20')});})['catch'](function(_0x8affb8){logger[_0xb9b8('0x15')](_0x8affb8);return _0x3fa408[_0xb9b8('0x11')](0x1f4)['json'](_0x8affb8);});};exports['migrations']=function(_0x325134,_0x4f213c){var _0x575595=fs[_0xb9b8('0x21')](path[_0xb9b8('0x22')](config[_0xb9b8('0x23')],'server','migrations'));var _0x351779=[];for(var _0x416d6c=0x0;_0x416d6c<_0x575595[_0xb9b8('0x24')];_0x416d6c++){var _0x16f4c5=_0x575595[_0x416d6c][_0xb9b8('0x25')](_0xb9b8('0x26'),'');if(compareVersions(module['exports']['version'],_0x16f4c5)===-0x1){_0x351779['push'](_0x16f4c5);}}if(_0x351779[_0xb9b8('0x24')]){var _0x2f0c80=_0x351779[_0xb9b8('0x27')](compareVersions);var _0x8600df=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xb9b8('0x28')],'modelName':_0xb9b8('0x28'),'columnName':'version'},'migrations':{'params':[db[_0xb9b8('0x29')][_0xb9b8('0x2a')](),db['sequelize'][_0xb9b8('0x2b')],function(){throw new Error(_0xb9b8('0x2c'));}],'path':path['join'](config[_0xb9b8('0x23')],'server',_0xb9b8('0x2d')),'pattern':/\.js$/}});_0x8600df['up']({'migrations':_['map'](_0x2f0c80,function(_0x18bb0f){return _0x18bb0f+_0xb9b8('0x26');})})[_0xb9b8('0x1e')](function(){return _0x4f213c[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x2e')+module[_0xb9b8('0xc')]['version']+_0xb9b8('0x2f')+_[_0xb9b8('0x30')](_0x2f0c80),'migrations':_[_0xb9b8('0x22')](_0x2f0c80)});})[_0xb9b8('0x31')](function(_0x471772){if(_0x471772 instanceof db[_0xb9b8('0x29')][_0xb9b8('0x32')]){return _0x4f213c[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x33')});}else{return _0x4f213c[_0xb9b8('0x11')](0x1f4)[_0xb9b8('0x12')](_0x471772);}});}else{return _0x4f213c[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index c5985bd..840b0f8 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 _0xf3d2=['index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x2c940c,_0x5b4307){var _0x363a22=function(_0x30d884){while(--_0x30d884){_0x2c940c['push'](_0x2c940c['shift']());}};_0x363a22(++_0x5b4307);}(_0xf3d2,0x73));var _0x2f3d=function(_0x44d902,_0x376b4e){_0x44d902=_0x44d902-0x0;var _0x27aa72=_0xf3d2[_0x44d902];return _0x27aa72;};'use strict';var multer=require(_0x2f3d('0x0'));var util=require('util');var path=require(_0x2f3d('0x1'));var timeout=require(_0x2f3d('0x2'));var express=require(_0x2f3d('0x3'));var router=express[_0x2f3d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f3d('0x5'));var interaction=require(_0x2f3d('0x6'));var config=require(_0x2f3d('0x7'));var controller=require(_0x2f3d('0x8'));router[_0x2f3d('0x9')]('/',auth[_0x2f3d('0xa')](),controller[_0x2f3d('0xb')]);router[_0x2f3d('0x9')](_0x2f3d('0xc'),auth[_0x2f3d('0xa')](),controller[_0x2f3d('0xd')]);router[_0x2f3d('0x9')](_0x2f3d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x2f3d('0xf')]('/',auth[_0x2f3d('0xa')](),controller[_0x2f3d('0x10')]);router[_0x2f3d('0x11')]('/:id',auth[_0x2f3d('0xa')](),controller[_0x2f3d('0x12')]);router[_0x2f3d('0x13')](_0x2f3d('0xe'),auth[_0x2f3d('0xa')](),controller['destroy']);module[_0x2f3d('0x14')]=router; \ No newline at end of file +var _0xba01=['update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0x5be61e,_0x2c54bb){var _0x43806e=function(_0x2ac9d4){while(--_0x2ac9d4){_0x5be61e['push'](_0x5be61e['shift']());}};_0x43806e(++_0x2c54bb);}(_0xba01,0x9a));var _0x1ba0=function(_0x4ab11b,_0x516f88){_0x4ab11b=_0x4ab11b-0x0;var _0x580eaf=_0xba01[_0x4ab11b];return _0x580eaf;};'use strict';var multer=require(_0x1ba0('0x0'));var util=require('util');var path=require(_0x1ba0('0x1'));var timeout=require('connect-timeout');var express=require(_0x1ba0('0x2'));var router=express[_0x1ba0('0x3')]();var fs_extra=require(_0x1ba0('0x4'));var auth=require(_0x1ba0('0x5'));var interaction=require(_0x1ba0('0x6'));var config=require('../../config/environment');var controller=require(_0x1ba0('0x7'));router['get']('/',auth[_0x1ba0('0x8')](),controller[_0x1ba0('0x9')]);router[_0x1ba0('0xa')](_0x1ba0('0xb'),auth[_0x1ba0('0x8')](),controller[_0x1ba0('0xc')]);router['get'](_0x1ba0('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1ba0('0xe')]('/',auth[_0x1ba0('0x8')](),controller[_0x1ba0('0xf')]);router[_0x1ba0('0x10')](_0x1ba0('0xd'),auth[_0x1ba0('0x8')](),controller[_0x1ba0('0x11')]);router['delete'](_0x1ba0('0xd'),auth[_0x1ba0('0x8')](),controller['destroy']);module[_0x1ba0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a2c6ae8..c0febff 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 _0x777d=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x106106,_0x378a13){var _0x2ab8b5=function(_0x248ded){while(--_0x248ded){_0x106106['push'](_0x106106['shift']());}};_0x2ab8b5(++_0x378a13);}(_0x777d,0xe9));var _0xd777=function(_0x3168e1,_0xa046e0){_0x3168e1=_0x3168e1-0x0;var _0x13ad69=_0x777d[_0x3168e1];return _0x13ad69;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'type':{'type':Sequelize[_0xd777('0x1')]},'uniqueid':{'type':Sequelize[_0xd777('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd777('0x1')]},'queue':{'type':Sequelize[_0xd777('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd777('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xd777('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xd777('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd777('0x3')]},'agentacw':{'type':Sequelize[_0xd777('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd777('0x3')]},'reason':{'type':Sequelize[_0xd777('0x1')]},'lastevent':{'type':Sequelize[_0xd777('0x1')]},'channel':{'type':Sequelize[_0xd777('0x1')]},'channelstate':{'type':Sequelize[_0xd777('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd777('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd777('0x1')]},'connectedlinename':{'type':Sequelize[_0xd777('0x1')]},'language':{'type':Sequelize[_0xd777('0x1')]},'accountcode':{'type':Sequelize[_0xd777('0x1')]},'context':{'type':Sequelize[_0xd777('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd777('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd777('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd777('0x1')]},'destcalleridname':{'type':Sequelize[_0xd777('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd777('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd777('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd777('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd777('0x1')]},'destpriority':{'type':Sequelize[_0xd777('0x1')]},'destuniqueid':{'type':Sequelize[_0xd777('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd777('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd777('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd777('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd777('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xd777('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x23a3=['STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1e890e,_0x4dd6d2){var _0xfb71d8=function(_0x36dad2){while(--_0x36dad2){_0x1e890e['push'](_0x1e890e['shift']());}};_0xfb71d8(++_0x4dd6d2);}(_0x23a3,0x131));var _0x323a=function(_0x4ca92a,_0x4a2b42){_0x4ca92a=_0x4ca92a-0x0;var _0x12a5a8=_0x23a3[_0x4ca92a];return _0x12a5a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x323a('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x323a('0x0')]},'queue':{'type':Sequelize[_0x323a('0x0')]},'interface':{'type':Sequelize[_0x323a('0x0')]},'membername':{'type':Sequelize[_0x323a('0x0')]},'agentcalledAt':{'type':Sequelize[_0x323a('0x1')]},'agentconnectAt':{'type':Sequelize[_0x323a('0x1')]},'agentcompleteAt':{'type':Sequelize[_0x323a('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0x323a('0x1')]},'agentdumpAt':{'type':Sequelize[_0x323a('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x323a('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x323a('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x323a('0x3')]},'agentacw':{'type':Sequelize[_0x323a('0x2')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x323a('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x323a('0x0')]},'channel':{'type':Sequelize[_0x323a('0x0')]},'channelstate':{'type':Sequelize[_0x323a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x323a('0x0')]},'connectedlinenum':{'type':Sequelize[_0x323a('0x0')]},'connectedlinename':{'type':Sequelize[_0x323a('0x0')]},'language':{'type':Sequelize[_0x323a('0x0')]},'accountcode':{'type':Sequelize[_0x323a('0x0')]},'context':{'type':Sequelize[_0x323a('0x0')]},'exten':{'type':Sequelize[_0x323a('0x0')]},'priority':{'type':Sequelize[_0x323a('0x0')]},'destchannel':{'type':Sequelize[_0x323a('0x0')]},'destchannelstate':{'type':Sequelize[_0x323a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x323a('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x323a('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x323a('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x323a('0x0')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x323a('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x323a('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x323a('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x323a('0x0')],'comment':_0x323a('0x4')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x323a('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 9bba0bd..36e4a3f 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 a1dcd18..74fcaf2 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 _0x165d=['request-promise','rimraf','../../config/environment','define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x42af91,_0x5cebd7){var _0x5bbba5=function(_0xa83e8e){while(--_0xa83e8e){_0x42af91['push'](_0x42af91['shift']());}};_0x5bbba5(++_0x5cebd7);}(_0x165d,0x14a));var _0xd165=function(_0x2a35f8,_0x25d05d){_0x2a35f8=_0x2a35f8-0x0;var _0x41696a=_0x165d[_0x2a35f8];return _0x41696a;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var logger=require(_0xd165('0x2'))(_0xd165('0x3'));var moment=require(_0xd165('0x4'));var BPromise=require(_0xd165('0x5'));var rp=require(_0xd165('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x5435f9,_0x42d256){return _0x5435f9[_0xd165('0x9')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd165('0xa'),_0xd165('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f1c=['VoiceAgentReport','report_agent','lodash','api','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0x443849,_0x153308){var _0x52cb35=function(_0x303798){while(--_0x303798){_0x443849['push'](_0x443849['shift']());}};_0x52cb35(++_0x153308);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x54675a,_0x2f39db){_0x54675a=_0x54675a-0x0;var _0x4cc490=_0x3f1c[_0x54675a];return _0x4cc490;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3f1('0x2'));var fs=require('fs');var path=require(_0xc3f1('0x3'));var rimraf=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var attributes=require(_0xc3f1('0x6'));module['exports']=function(_0x12e78a,_0x4ebd4c){return _0x12e78a[_0xc3f1('0x7')](_0xc3f1('0x8'),attributes,{'tableName':_0xc3f1('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 8400349..5023ff7 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 _0xdaba=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','lodash','util'];(function(_0x5029bf,_0x4ef94a){var _0x14138c=function(_0x4869c6){while(--_0x4869c6){_0x5029bf['push'](_0x5029bf['shift']());}};_0x14138c(++_0x4ef94a);}(_0xdaba,0x1c5));var _0xadab=function(_0xb90941,_0x28d4c1){_0xb90941=_0xb90941-0x0;var _0x55fdd8=_0xdaba[_0xb90941];return _0x55fdd8;};'use strict';var _=require(_0xadab('0x0'));var util=require(_0xadab('0x1'));var moment=require(_0xadab('0x2'));var BPromise=require(_0xadab('0x3'));var rs=require(_0xadab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadab('0x5'))['db'];var utils=require(_0xadab('0x6'));var logger=require(_0xadab('0x7'))(_0xadab('0x8'));var config=require(_0xadab('0x9'));var jayson=require(_0xadab('0xa'));var client=jayson[_0xadab('0xb')][_0xadab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xfe986c,_0x369923,_0x36a5ca){return new BPromise(function(_0x3cef7e,_0x42fb53){return client[_0xadab('0xd')](_0xfe986c,_0x36a5ca)[_0xadab('0xe')](function(_0x398ed2){logger[_0xadab('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x369923,'request\x20sent');logger[_0xadab('0x10')](_0xadab('0x11'),_0x369923,'request\x20sent',JSON[_0xadab('0x12')](_0x398ed2));if(_0x398ed2[_0xadab('0x13')]){if(_0x398ed2[_0xadab('0x13')][_0xadab('0x14')]===0x1f4){logger['error'](_0xadab('0x15'),_0x369923,_0x398ed2[_0xadab('0x13')]['message']);return _0x42fb53(_0x398ed2[_0xadab('0x13')][_0xadab('0x16')]);}logger[_0xadab('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x369923,_0x398ed2[_0xadab('0x13')]['message']);return _0x3cef7e(_0x398ed2[_0xadab('0x13')][_0xadab('0x16')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x369923,'request\x20sent');_0x3cef7e(_0x398ed2[_0xadab('0x17')][_0xadab('0x16')]);}})[_0xadab('0x18')](function(_0x539f1d){logger[_0xadab('0x13')](_0xadab('0x15'),_0x369923,_0x539f1d);_0x42fb53(_0x539f1d);});});}exports[_0xadab('0x19')]=function(_0x1c0b78){var _0x15a94a=this;return new Promise(function(_0x433763,_0x580144){return db['VoiceAgentReport'][_0xadab('0x1a')](_0x1c0b78['body'],{'raw':_0x1c0b78[_0xadab('0x1b')]?_0x1c0b78['options'][_0xadab('0x1c')]===undefined?!![]:![]:!![]})[_0xadab('0xe')](function(_0x19e1ae){logger['info'](_0xadab('0x19'),_0x1c0b78);logger[_0xadab('0x10')](_0xadab('0x19'),_0x1c0b78,JSON['stringify'](_0x19e1ae));_0x433763(_0x19e1ae);})[_0xadab('0x18')](function(_0x225d35){logger[_0xadab('0x13')](_0xadab('0x19'),_0x225d35[_0xadab('0x16')],_0x1c0b78);_0x580144(_0x15a94a[_0xadab('0x13')](0x1f4,_0x225d35['message']));});});};exports[_0xadab('0x1d')]=function(_0x50c77a){var _0xec4538=this;return new Promise(function(_0x5117c7,_0x153848){return db[_0xadab('0x1e')][_0xadab('0x1f')](_0x50c77a['body'],{'raw':_0x50c77a[_0xadab('0x1b')]?_0x50c77a[_0xadab('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50c77a['options']?_0x50c77a[_0xadab('0x1b')][_0xadab('0x20')]||null:null,'attributes':_0x50c77a['options']?_0x50c77a[_0xadab('0x1b')][_0xadab('0x21')]||null:null,'limit':_0x50c77a[_0xadab('0x1b')]?_0x50c77a[_0xadab('0x1b')][_0xadab('0x22')]||null:null})[_0xadab('0xe')](function(_0x4e49bf){logger[_0xadab('0xf')](_0xadab('0x1d'),_0x50c77a);logger['debug'](_0xadab('0x1d'),_0x50c77a,JSON['stringify'](_0x4e49bf));_0x5117c7(_0x4e49bf);})[_0xadab('0x18')](function(_0x1197f2){logger[_0xadab('0x13')](_0xadab('0x1d'),_0x1197f2[_0xadab('0x16')],_0x50c77a);_0x153848(_0xec4538[_0xadab('0x13')](0x1f4,_0x1197f2[_0xadab('0x16')]));});});}; \ No newline at end of file +var _0x2e37=['raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','VoiceAgentReport','options','CreateVoiceAgentReport','debug','catch','UpdateVoiceAgentReport','body'];(function(_0x248764,_0x22e335){var _0x497c52=function(_0xa74f74){while(--_0xa74f74){_0x248764['push'](_0x248764['shift']());}};_0x497c52(++_0x22e335);}(_0x2e37,0x197));var _0x72e3=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x2e37[_0x56fb33];return _0x435ee4;};'use strict';var _=require(_0x72e3('0x0'));var util=require('util');var moment=require(_0x72e3('0x1'));var BPromise=require('bluebird');var rs=require(_0x72e3('0x2'));var fs=require('fs');var Redis=require(_0x72e3('0x3'));var db=require(_0x72e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72e3('0x5'));var config=require(_0x72e3('0x6'));var jayson=require(_0x72e3('0x7'));var client=jayson[_0x72e3('0x8')][_0x72e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42cd0c,_0x4e20b4,_0x41c369){return new BPromise(function(_0x30ef9,_0x14935e){return client[_0x72e3('0xa')](_0x42cd0c,_0x41c369)[_0x72e3('0xb')](function(_0x421097){logger[_0x72e3('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x4e20b4,_0x72e3('0xd'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x4e20b4,'request\x20sent',JSON[_0x72e3('0xe')](_0x421097));if(_0x421097['error']){if(_0x421097[_0x72e3('0xf')][_0x72e3('0x10')]===0x1f4){logger[_0x72e3('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4e20b4,_0x421097[_0x72e3('0xf')]['message']);return _0x14935e(_0x421097[_0x72e3('0xf')][_0x72e3('0x11')]);}logger[_0x72e3('0xf')](_0x72e3('0x12'),_0x4e20b4,_0x421097['error'][_0x72e3('0x11')]);return _0x30ef9(_0x421097[_0x72e3('0xf')][_0x72e3('0x11')]);}else{logger['info'](_0x72e3('0x12'),_0x4e20b4,'request\x20sent');_0x30ef9(_0x421097[_0x72e3('0x13')][_0x72e3('0x11')]);}})['catch'](function(_0x4da9f5){logger[_0x72e3('0xf')](_0x72e3('0x12'),_0x4e20b4,_0x4da9f5);_0x14935e(_0x4da9f5);});});}exports['CreateVoiceAgentReport']=function(_0x1dbd75){var _0x15cff6=this;return new Promise(function(_0x3b86e2,_0x30a409){return db[_0x72e3('0x14')]['create'](_0x1dbd75['body'],{'raw':_0x1dbd75[_0x72e3('0x15')]?_0x1dbd75[_0x72e3('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x72e3('0xb')](function(_0x2551dd){logger[_0x72e3('0xc')](_0x72e3('0x16'),_0x1dbd75);logger[_0x72e3('0x17')](_0x72e3('0x16'),_0x1dbd75,JSON['stringify'](_0x2551dd));_0x3b86e2(_0x2551dd);})[_0x72e3('0x18')](function(_0x13f4d0){logger[_0x72e3('0xf')](_0x72e3('0x16'),_0x13f4d0[_0x72e3('0x11')],_0x1dbd75);_0x30a409(_0x15cff6['error'](0x1f4,_0x13f4d0[_0x72e3('0x11')]));});});};exports[_0x72e3('0x19')]=function(_0xf843be){var _0x378109=this;return new Promise(function(_0x2a77bd,_0xffc83a){return db['VoiceAgentReport']['update'](_0xf843be[_0x72e3('0x1a')],{'raw':_0xf843be[_0x72e3('0x15')]?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf843be['options']?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1c')]||null:null,'attributes':_0xf843be[_0x72e3('0x15')]?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1d')]||null:null,'limit':_0xf843be[_0x72e3('0x15')]?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1e')]||null:null})['then'](function(_0x28ced0){logger[_0x72e3('0xc')]('UpdateVoiceAgentReport',_0xf843be);logger[_0x72e3('0x17')]('UpdateVoiceAgentReport',_0xf843be,JSON[_0x72e3('0xe')](_0x28ced0));_0x2a77bd(_0x28ced0);})['catch'](function(_0x333ff){logger['error'](_0x72e3('0x19'),_0x333ff[_0x72e3('0x11')],_0xf843be);_0xffc83a(_0x378109[_0x72e3('0xf')](0x1f4,_0x333ff[_0x72e3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 502b22b..3be3470 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 _0xd6d6=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x5bafda,_0x5a2237){var _0x3c102a=function(_0x49a95d){while(--_0x49a95d){_0x5bafda['push'](_0x5bafda['shift']());}};_0x3c102a(++_0x5a2237);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5e9925,_0x3f016b){_0x5e9925=_0x5e9925-0x0;var _0x36cbd4=_0xd6d6[_0x5e9925];return _0x36cbd4;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),auth[_0x6d6d('0xd')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xa')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xd')](),controller[_0x6d6d('0x11')]);router[_0x6d6d('0x12')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6d6d('0x15')]);module[_0x6d6d('0x16')]=router; \ No newline at end of file +var _0x4b19=['index','isAuthenticated','describe','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x4b19,0x195));var _0x94b1=function(_0x1e6c5d,_0x7f354c){_0x1e6c5d=_0x1e6c5d-0x0;var _0x1e314b=_0x4b19[_0x1e6c5d];return _0x1e314b;};'use strict';var multer=require(_0x94b1('0x0'));var util=require('util');var path=require(_0x94b1('0x1'));var timeout=require(_0x94b1('0x2'));var express=require(_0x94b1('0x3'));var router=express['Router']();var fs_extra=require(_0x94b1('0x4'));var auth=require(_0x94b1('0x5'));var interaction=require(_0x94b1('0x6'));var config=require('../../config/environment');var controller=require(_0x94b1('0x7'));router[_0x94b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x9')]);router[_0x94b1('0x8')]('/describe',auth[_0x94b1('0xa')](),controller[_0x94b1('0xb')]);router[_0x94b1('0x8')]('/:id',auth[_0x94b1('0xa')](),controller['show']);router['post']('/',auth[_0x94b1('0xa')](),controller[_0x94b1('0xc')]);router[_0x94b1('0xd')](_0x94b1('0xe'),auth[_0x94b1('0xa')](),controller[_0x94b1('0xf')]);router['delete'](_0x94b1('0xe'),auth[_0x94b1('0xa')](),controller[_0x94b1('0x10')]);module[_0x94b1('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 3d0885a..17eec02 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 _0x10ff=['outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound'];(function(_0x5e7296,_0x362b14){var _0x173404=function(_0x5dcf34){while(--_0x5dcf34){_0x5e7296['push'](_0x5e7296['shift']());}};_0x173404(++_0x362b14);}(_0x10ff,0x1b5));var _0xf10f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x10ff[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf10f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf10f('0x1')](_0xf10f('0x2'),'internal',_0xf10f('0x3'),_0xf10f('0x4'),_0xf10f('0x5'),_0xf10f('0x6'))},'tag':{'type':Sequelize[_0xf10f('0x7')]},'accountcode':{'type':Sequelize[_0xf10f('0x7')]},'source':{'type':Sequelize[_0xf10f('0x7')]},'destination':{'type':Sequelize[_0xf10f('0x7')]},'destinationcontext':{'type':Sequelize[_0xf10f('0x7')]},'callerid':{'type':Sequelize[_0xf10f('0x7')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf10f('0x8')]},'starttime':{'type':Sequelize[_0xf10f('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf10f('0x9')]},'endtime':{'type':Sequelize[_0xf10f('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xf10f('0xa')]},'mohtime':{'type':Sequelize[_0xf10f('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf10f('0x7')]},'userfield':{'type':Sequelize[_0xf10f('0x7')]},'userDisposition':{'type':Sequelize[_0xf10f('0x7')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xf10f('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xf10f('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xf10f('0x7')]}}; \ No newline at end of file +var _0xec58=['internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','inbound'];(function(_0x341967,_0x3eea51){var _0x20f414=function(_0x332e11){while(--_0x332e11){_0x341967['push'](_0x341967['shift']());}};_0x20f414(++_0x3eea51);}(_0xec58,0x11c));var _0x8ec5=function(_0x471a85,_0x239e8d){_0x471a85=_0x471a85-0x0;var _0x5f2039=_0xec58[_0x471a85];return _0x5f2039;};'use strict';var Sequelize=require(_0x8ec5('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8ec5('0x1'),_0x8ec5('0x2'),_0x8ec5('0x3'),_0x8ec5('0x4'),_0x8ec5('0x5'),_0x8ec5('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8ec5('0x7')]},'source':{'type':Sequelize[_0x8ec5('0x7')]},'destination':{'type':Sequelize[_0x8ec5('0x7')]},'destinationcontext':{'type':Sequelize[_0x8ec5('0x7')]},'callerid':{'type':Sequelize[_0x8ec5('0x7')]},'channel':{'type':Sequelize[_0x8ec5('0x7')]},'destinationchannel':{'type':Sequelize[_0x8ec5('0x7')]},'lastapplication':{'type':Sequelize[_0x8ec5('0x7')]},'lastdata':{'type':Sequelize[_0x8ec5('0x8')]},'starttime':{'type':Sequelize[_0x8ec5('0x9')]},'systemanswertime':{'type':Sequelize[_0x8ec5('0x9')]},'answertime':{'type':Sequelize[_0x8ec5('0x9')]},'endtime':{'type':Sequelize[_0x8ec5('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8ec5('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8ec5('0x7')]},'userfield':{'type':Sequelize[_0x8ec5('0x7')]},'userDisposition':{'type':Sequelize[_0x8ec5('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x8ec5('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8ec5('0x7')]},'prefix':{'type':Sequelize[_0x8ec5('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x8ec5('0x7')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 3720ab8..57985e1 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0xadb5,0xad));var _0x5adb=function(_0x359981,_0x5e594e){_0x359981=_0x359981-0x0;var _0x283100=_0xadb5[_0x359981];return _0x283100;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b8241,_0x471900){_0x2b8241=_0x2b8241-0x0;var _0x4185fa=_0x2ef3[_0x2b8241];return _0x4185fa;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 695820e..973ed28 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 _0x6ab8=['define','report_call','uniqueid','lodash','util','../../config/logger','request-promise','path','rimraf','./voiceCallReport.attributes','exports'];(function(_0x268fe3,_0x58c69a){var _0xdb049c=function(_0x3d249d){while(--_0x3d249d){_0x268fe3['push'](_0x268fe3['shift']());}};_0xdb049c(++_0x58c69a);}(_0x6ab8,0x66));var _0x86ab=function(_0x1a52fd,_0x5a6548){_0x1a52fd=_0x1a52fd-0x0;var _0x5cea5c=_0x6ab8[_0x1a52fd];return _0x5cea5c;};'use strict';var _=require(_0x86ab('0x0'));var util=require(_0x86ab('0x1'));var logger=require(_0x86ab('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86ab('0x3'));var fs=require('fs');var path=require(_0x86ab('0x4'));var rimraf=require(_0x86ab('0x5'));var config=require('../../config/environment');var attributes=require(_0x86ab('0x6'));module[_0x86ab('0x7')]=function(_0x17eaad,_0x198d60){return _0x17eaad[_0x86ab('0x8')]('VoiceCallReport',attributes,{'tableName':_0x86ab('0x9'),'paranoid':![],'indexes':[{'fields':[_0x86ab('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x807d=['bluebird','request-promise','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','api','moment'];(function(_0x5d76c3,_0x5eda8b){var _0x547a9e=function(_0x40bf93){while(--_0x40bf93){_0x5d76c3['push'](_0x5d76c3['shift']());}};_0x547a9e(++_0x5eda8b);}(_0x807d,0x126));var _0xd807=function(_0x427a73,_0xb4fc9d){_0x427a73=_0x427a73-0x0;var _0x29f4cc=_0x807d[_0x427a73];return _0x29f4cc;};'use strict';var _=require(_0xd807('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd807('0x1'));var moment=require(_0xd807('0x2'));var BPromise=require(_0xd807('0x3'));var rp=require(_0xd807('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd807('0x5'));module[_0xd807('0x6')]=function(_0x43ed56,_0x5d3b0f){return _0x43ed56[_0xd807('0x7')](_0xd807('0x8'),attributes,{'tableName':_0xd807('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd807('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1c82994..8823b2c 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 _0x8fb7=['client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map','model','then','GetVoiceCallReport','CreateVoiceCallReport','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2d548a,_0x51baf8){var _0x213162=function(_0x1113f0){while(--_0x1113f0){_0x2d548a['push'](_0x2d548a['shift']());}};_0x213162(++_0x51baf8);}(_0x8fb7,0x1a4));var _0x78fb=function(_0x29e600,_0xba05ce){_0x29e600=_0x29e600-0x0;var _0x116104=_0x8fb7[_0x29e600];return _0x116104;};'use strict';var _=require(_0x78fb('0x0'));var util=require(_0x78fb('0x1'));var moment=require(_0x78fb('0x2'));var BPromise=require(_0x78fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x78fb('0x5'));var logger=require('../../config/logger')(_0x78fb('0x6'));var config=require(_0x78fb('0x7'));var jayson=require(_0x78fb('0x8'));var client=jayson[_0x78fb('0x9')][_0x78fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a152,_0x48bb24,_0x57ee90){return new BPromise(function(_0x9f8398,_0x1a3826){return client[_0x78fb('0xb')](_0x54a152,_0x57ee90)['then'](function(_0x221cfa){logger[_0x78fb('0xc')](_0x78fb('0xd'),_0x48bb24,_0x78fb('0xe'));logger[_0x78fb('0xf')](_0x78fb('0x10'),_0x48bb24,_0x78fb('0xe'),JSON[_0x78fb('0x11')](_0x221cfa));if(_0x221cfa[_0x78fb('0x12')]){if(_0x221cfa[_0x78fb('0x12')][_0x78fb('0x13')]===0x1f4){logger[_0x78fb('0x12')](_0x78fb('0xd'),_0x48bb24,_0x221cfa[_0x78fb('0x12')]['message']);return _0x1a3826(_0x221cfa['error']['message']);}logger['error'](_0x78fb('0xd'),_0x48bb24,_0x221cfa[_0x78fb('0x12')]['message']);return _0x9f8398(_0x221cfa['error'][_0x78fb('0x14')]);}else{logger[_0x78fb('0xc')](_0x78fb('0xd'),_0x48bb24,_0x78fb('0xe'));_0x9f8398(_0x221cfa[_0x78fb('0x15')][_0x78fb('0x14')]);}})[_0x78fb('0x16')](function(_0xf8616a){logger[_0x78fb('0x12')](_0x78fb('0xd'),_0x48bb24,_0xf8616a);_0x1a3826(_0xf8616a);});});}exports['GetVoiceCallReport']=function(_0x4fdc1c){var _0x4f8db4=this;return new Promise(function(_0x4afffe,_0x3295b4){return db[_0x78fb('0x17')][_0x78fb('0x18')]({'raw':_0x4fdc1c['options']?_0x4fdc1c['options'][_0x78fb('0x19')]===undefined?!![]:![]:!![],'where':_0x4fdc1c[_0x78fb('0x1a')]?_0x4fdc1c[_0x78fb('0x1a')][_0x78fb('0x1b')]||null:null,'attributes':_0x4fdc1c[_0x78fb('0x1a')]?_0x4fdc1c[_0x78fb('0x1a')][_0x78fb('0x1c')]||null:null,'limit':_0x4fdc1c[_0x78fb('0x1a')]?_0x4fdc1c[_0x78fb('0x1a')][_0x78fb('0x1d')]||null:null,'include':_0x4fdc1c['options']?_0x4fdc1c[_0x78fb('0x1a')][_0x78fb('0x1e')]?_[_0x78fb('0x1f')](_0x4fdc1c['options'][_0x78fb('0x1e')],function(_0x4f4ea9){return{'model':db[_0x4f4ea9['model']],'as':_0x4f4ea9['as'],'attributes':_0x4f4ea9['attributes'],'include':_0x4f4ea9[_0x78fb('0x1e')]?_[_0x78fb('0x1f')](_0x4f4ea9[_0x78fb('0x1e')],function(_0xa50f4f){return{'model':db[_0xa50f4f[_0x78fb('0x20')]],'as':_0xa50f4f['as'],'attributes':_0xa50f4f[_0x78fb('0x1c')],'include':_0xa50f4f[_0x78fb('0x1e')]?_[_0x78fb('0x1f')](_0xa50f4f[_0x78fb('0x1e')],function(_0x46ef00){return{'model':db[_0x46ef00['model']],'as':_0x46ef00['as'],'attributes':_0x46ef00[_0x78fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x78fb('0x21')](function(_0x4ea254){logger[_0x78fb('0xc')](_0x78fb('0x22'),_0x4fdc1c);logger[_0x78fb('0xf')]('GetVoiceCallReport',_0x4fdc1c,JSON['stringify'](_0x4ea254));_0x4afffe(_0x4ea254);})['catch'](function(_0x1d5345){logger[_0x78fb('0x12')](_0x78fb('0x22'),_0x1d5345[_0x78fb('0x14')],_0x4fdc1c);_0x3295b4(_0x4f8db4[_0x78fb('0x12')](0x1f4,_0x1d5345[_0x78fb('0x14')]));});});};exports[_0x78fb('0x23')]=function(_0x5c9c9d){var _0x429800=this;return new Promise(function(_0x192969,_0x29c2d8){return db['VoiceCallReport']['create'](_0x5c9c9d[_0x78fb('0x24')],{'raw':_0x5c9c9d[_0x78fb('0x1a')]?_0x5c9c9d['options'][_0x78fb('0x19')]===undefined?!![]:![]:!![]})[_0x78fb('0x21')](function(_0x72c98a){logger[_0x78fb('0xc')](_0x78fb('0x23'),_0x5c9c9d);logger[_0x78fb('0xf')](_0x78fb('0x23'),_0x5c9c9d,JSON['stringify'](_0x72c98a));_0x192969(_0x72c98a);})[_0x78fb('0x16')](function(_0x2ecef5){logger[_0x78fb('0x12')](_0x78fb('0x23'),_0x2ecef5['message'],_0x5c9c9d);_0x29c2d8(_0x429800['error'](0x1f4,_0x2ecef5[_0x78fb('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x559c17){var _0x31648e=this;return new Promise(function(_0x24d2fe,_0x14c251){return db[_0x78fb('0x17')][_0x78fb('0x25')](_0x559c17[_0x78fb('0x24')],{'raw':_0x559c17[_0x78fb('0x1a')]?_0x559c17[_0x78fb('0x1a')][_0x78fb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x559c17[_0x78fb('0x1a')]?_0x559c17[_0x78fb('0x1a')][_0x78fb('0x1b')]||null:null,'attributes':_0x559c17[_0x78fb('0x1a')]?_0x559c17[_0x78fb('0x1a')][_0x78fb('0x1c')]||null:null,'limit':_0x559c17[_0x78fb('0x1a')]?_0x559c17[_0x78fb('0x1a')][_0x78fb('0x1d')]||null:null})['then'](function(_0x89f57c){logger[_0x78fb('0xc')]('UpdateVoiceCallReport',_0x559c17);logger[_0x78fb('0xf')](_0x78fb('0x26'),_0x559c17,JSON[_0x78fb('0x11')](_0x89f57c));_0x24d2fe(_0x89f57c);})[_0x78fb('0x16')](function(_0x55fdd3){logger[_0x78fb('0x12')](_0x78fb('0x26'),_0x55fdd3[_0x78fb('0x14')],_0x559c17);_0x14c251(_0x31648e[_0x78fb('0x12')](0x1f4,_0x55fdd3['message']));});});}; \ No newline at end of file +var _0xb821=['body','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceCallReport,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','map','include','model','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','raw','UpdateVoiceCallReport'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0xb821,0x1f0));var _0x1b82=function(_0x22d340,_0x4ae518){_0x22d340=_0x22d340-0x0;var _0x524785=_0xb821[_0x22d340];return _0x524785;};'use strict';var _=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b82('0x3'));var fs=require('fs');var Redis=require(_0x1b82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b82('0x5'));var logger=require('../../config/logger')(_0x1b82('0x6'));var config=require(_0x1b82('0x7'));var jayson=require(_0x1b82('0x8'));var client=jayson[_0x1b82('0x9')][_0x1b82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4868c4,_0x42971d,_0x453c0a){return new BPromise(function(_0x1d49b4,_0x2ac5e5){return client[_0x1b82('0xb')](_0x4868c4,_0x453c0a)[_0x1b82('0xc')](function(_0x1ba16c){logger[_0x1b82('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x42971d,_0x1b82('0xe'));logger[_0x1b82('0xf')](_0x1b82('0x10'),_0x42971d,_0x1b82('0xe'),JSON[_0x1b82('0x11')](_0x1ba16c));if(_0x1ba16c[_0x1b82('0x12')]){if(_0x1ba16c['error']['code']===0x1f4){logger[_0x1b82('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x42971d,_0x1ba16c[_0x1b82('0x12')][_0x1b82('0x13')]);return _0x2ac5e5(_0x1ba16c[_0x1b82('0x12')][_0x1b82('0x13')]);}logger[_0x1b82('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x42971d,_0x1ba16c[_0x1b82('0x12')]['message']);return _0x1d49b4(_0x1ba16c[_0x1b82('0x12')]['message']);}else{logger[_0x1b82('0xd')](_0x1b82('0x14'),_0x42971d,_0x1b82('0xe'));_0x1d49b4(_0x1ba16c[_0x1b82('0x15')]['message']);}})[_0x1b82('0x16')](function(_0x53b7c1){logger[_0x1b82('0x12')](_0x1b82('0x14'),_0x42971d,_0x53b7c1);_0x2ac5e5(_0x53b7c1);});});}exports['GetVoiceCallReport']=function(_0x444747){var _0x4604e1=this;return new Promise(function(_0xba48d,_0x14d954){return db['VoiceCallReport'][_0x1b82('0x17')]({'raw':_0x444747[_0x1b82('0x18')]?_0x444747[_0x1b82('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x444747[_0x1b82('0x18')]?_0x444747['options'][_0x1b82('0x19')]||null:null,'attributes':_0x444747[_0x1b82('0x18')]?_0x444747['options'][_0x1b82('0x1a')]||null:null,'limit':_0x444747[_0x1b82('0x18')]?_0x444747[_0x1b82('0x18')]['limit']||null:null,'include':_0x444747[_0x1b82('0x18')]?_0x444747['options']['include']?_[_0x1b82('0x1b')](_0x444747[_0x1b82('0x18')][_0x1b82('0x1c')],function(_0x1e781c){return{'model':db[_0x1e781c[_0x1b82('0x1d')]],'as':_0x1e781c['as'],'attributes':_0x1e781c['attributes'],'include':_0x1e781c[_0x1b82('0x1c')]?_['map'](_0x1e781c[_0x1b82('0x1c')],function(_0xcf5cfd){return{'model':db[_0xcf5cfd[_0x1b82('0x1d')]],'as':_0xcf5cfd['as'],'attributes':_0xcf5cfd[_0x1b82('0x1a')],'include':_0xcf5cfd['include']?_['map'](_0xcf5cfd['include'],function(_0x601453){return{'model':db[_0x601453['model']],'as':_0x601453['as'],'attributes':_0x601453['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b82('0xc')](function(_0x514bd4){logger['info'](_0x1b82('0x1e'),_0x444747);logger[_0x1b82('0xf')](_0x1b82('0x1e'),_0x444747,JSON[_0x1b82('0x11')](_0x514bd4));_0xba48d(_0x514bd4);})[_0x1b82('0x16')](function(_0x1be1f2){logger[_0x1b82('0x12')]('GetVoiceCallReport',_0x1be1f2[_0x1b82('0x13')],_0x444747);_0x14d954(_0x4604e1[_0x1b82('0x12')](0x1f4,_0x1be1f2['message']));});});};exports[_0x1b82('0x1f')]=function(_0x38890a){var _0x343fa9=this;return new Promise(function(_0x5976c8,_0x33d1b7){return db[_0x1b82('0x20')][_0x1b82('0x21')](_0x38890a['body'],{'raw':_0x38890a[_0x1b82('0x18')]?_0x38890a['options'][_0x1b82('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x584963){logger['info'](_0x1b82('0x1f'),_0x38890a);logger[_0x1b82('0xf')](_0x1b82('0x1f'),_0x38890a,JSON['stringify'](_0x584963));_0x5976c8(_0x584963);})['catch'](function(_0x26afff){logger[_0x1b82('0x12')](_0x1b82('0x1f'),_0x26afff[_0x1b82('0x13')],_0x38890a);_0x33d1b7(_0x343fa9[_0x1b82('0x12')](0x1f4,_0x26afff[_0x1b82('0x13')]));});});};exports[_0x1b82('0x23')]=function(_0x493399){var _0x4e03c1=this;return new Promise(function(_0x22c30b,_0x1a5280){return db[_0x1b82('0x20')]['update'](_0x493399[_0x1b82('0x24')],{'raw':_0x493399[_0x1b82('0x18')]?_0x493399[_0x1b82('0x18')][_0x1b82('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493399[_0x1b82('0x18')]?_0x493399['options'][_0x1b82('0x19')]||null:null,'attributes':_0x493399[_0x1b82('0x18')]?_0x493399[_0x1b82('0x18')][_0x1b82('0x1a')]||null:null,'limit':_0x493399[_0x1b82('0x18')]?_0x493399['options'][_0x1b82('0x25')]||null:null})[_0x1b82('0xc')](function(_0x5f4220){logger[_0x1b82('0xd')](_0x1b82('0x23'),_0x493399);logger[_0x1b82('0xf')]('UpdateVoiceCallReport',_0x493399,JSON[_0x1b82('0x11')](_0x5f4220));_0x22c30b(_0x5f4220);})['catch'](function(_0x26e318){logger[_0x1b82('0x12')](_0x1b82('0x23'),_0x26e318[_0x1b82('0x13')],_0x493399);_0x1a5280(_0x4e03c1['error'](0x1f4,_0x26e318[_0x1b82('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index f38fbb5..f27d465 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 _0x6226=['post','create','put','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6226,0xe6));var _0x6622=function(_0xf5605c,_0x178148){_0xf5605c=_0xf5605c-0x0;var _0x4a5d10=_0x6226[_0xf5605c];return _0x4a5d10;};'use strict';var multer=require('multer');var util=require(_0x6622('0x0'));var path=require(_0x6622('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6622('0x2'));var auth=require(_0x6622('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6622('0x4'));router[_0x6622('0x5')]('/',auth[_0x6622('0x6')](),controller[_0x6622('0x7')]);router[_0x6622('0x5')](_0x6622('0x8'),auth[_0x6622('0x6')](),controller[_0x6622('0x9')]);router[_0x6622('0xa')]('/',auth[_0x6622('0x6')](),controller[_0x6622('0xb')]);router[_0x6622('0xc')]('/:id',auth[_0x6622('0x6')](),controller['update']);router[_0x6622('0xd')](_0x6622('0x8'),auth[_0x6622('0x6')](),controller[_0x6622('0xe')]);module[_0x6622('0xf')]=router; \ No newline at end of file +var _0x3e3f=['put','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','show','post','create'];(function(_0x46477f,_0xad6785){var _0x59eb9e=function(_0xdc36b0){while(--_0xdc36b0){_0x46477f['push'](_0x46477f['shift']());}};_0x59eb9e(++_0xad6785);}(_0x3e3f,0x1be));var _0xf3e3=function(_0x51246f,_0x206e47){_0x51246f=_0x51246f-0x0;var _0x5c542b=_0x3e3f[_0x51246f];return _0x5c542b;};'use strict';var multer=require('multer');var util=require(_0xf3e3('0x0'));var path=require(_0xf3e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3e3('0x2'));var router=express[_0xf3e3('0x3')]();var fs_extra=require(_0xf3e3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf3e3('0x5'));var config=require('../../config/environment');var controller=require(_0xf3e3('0x6'));router['get']('/',auth[_0xf3e3('0x7')](),controller[_0xf3e3('0x8')]);router[_0xf3e3('0x9')]('/:id',auth[_0xf3e3('0x7')](),controller[_0xf3e3('0xa')]);router[_0xf3e3('0xb')]('/',auth['isAuthenticated'](),controller[_0xf3e3('0xc')]);router[_0xf3e3('0xd')](_0xf3e3('0xe'),auth[_0xf3e3('0x7')](),controller['update']);router['delete'](_0xf3e3('0xe'),auth['isAuthenticated'](),controller[_0xf3e3('0xf')]);module[_0xf3e3('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index d211d3c..26d2038 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 _0xfbd2=['sequelize','exports','STRING','name','setDataValue','getDataValue','options','split','BOOLEAN'];(function(_0x14dde5,_0xb0ded4){var _0x1d2363=function(_0x4b64af){while(--_0x4b64af){_0x14dde5['push'](_0x14dde5['shift']());}};_0x1d2363(++_0xb0ded4);}(_0xfbd2,0xea));var _0x2fbd=function(_0x5c6c32,_0x3cccb7){_0x5c6c32=_0x5c6c32-0x0;var _0x45c443=_0xfbd2[_0x5c6c32];return _0x45c443;};'use strict';var Sequelize=require(_0x2fbd('0x0'));module[_0x2fbd('0x1')]={'name':{'type':Sequelize[_0x2fbd('0x2')]},'prefix':{'type':Sequelize[_0x2fbd('0x2')],'unique':_0x2fbd('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x483913){this[_0x2fbd('0x4')]('options',_0x483913?_0x483913['join'](''):[]);},'get':function(){return this[_0x2fbd('0x5')](_0x2fbd('0x6'))?this[_0x2fbd('0x5')](_0x2fbd('0x6'))[_0x2fbd('0x7')](''):[];}},'auth':{'type':Sequelize[_0x2fbd('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x2fbd('0x2')]},'record':{'type':Sequelize[_0x2fbd('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2fbd('0x2')]},'description':{'type':Sequelize[_0x2fbd('0x2')]}}; \ No newline at end of file +var _0x5c2b=['sequelize','exports','STRING','setDataValue','options','getDataValue','BOOLEAN'];(function(_0x1176bf,_0xcf182a){var _0xb2f595=function(_0x3d3aa5){while(--_0x3d3aa5){_0x1176bf['push'](_0x1176bf['shift']());}};_0xb2f595(++_0xcf182a);}(_0x5c2b,0x1ea));var _0xb5c2=function(_0x5732a7,_0x12b0d7){_0x5732a7=_0x5732a7-0x0;var _0x3d2b0a=_0x5c2b[_0x5732a7];return _0x3d2b0a;};'use strict';var Sequelize=require(_0xb5c2('0x0'));module[_0xb5c2('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb5c2('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xb5c2('0x2')],'set':function(_0x1f8a13){this[_0xb5c2('0x3')](_0xb5c2('0x4'),_0x1f8a13?_0x1f8a13['join'](''):[]);},'get':function(){return this[_0xb5c2('0x5')](_0xb5c2('0x4'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xb5c2('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xb5c2('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb5c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index a9dc72d..283cd5a 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 _0xa101=['order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','index','map','VoiceChanSpy','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0xa101,0x15f));var _0x1a10=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0xa101[_0x522c6d];return _0x26300d;};'use strict';var emlformat=require(_0x1a10('0x0'));var rimraf=require(_0x1a10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a10('0x2'));var rp=require(_0x1a10('0x3'));var moment=require('moment');var BPromise=require(_0x1a10('0x4'));var Mustache=require(_0x1a10('0x5'));var util=require('util');var path=require(_0x1a10('0x6'));var sox=require(_0x1a10('0x7'));var csv=require(_0x1a10('0x8'));var ejs=require(_0x1a10('0x9'));var fs=require('fs');var fs_extra=require(_0x1a10('0xa'));var _=require(_0x1a10('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a10('0xc'));var deskjs=require(_0x1a10('0xd'));var toCsv=require(_0x1a10('0x8'));var querystring=require(_0x1a10('0xe'));var Papa=require(_0x1a10('0xf'));var Redis=require(_0x1a10('0x10'));var authService=require(_0x1a10('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a10('0x12'));var hardwareService=require(_0x1a10('0x13'));var logger=require(_0x1a10('0x14'))('api');var utils=require(_0x1a10('0x15'));var config=require(_0x1a10('0x16'));var licenseUtil=require(_0x1a10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c0490,_0x2f165a){_0x2f165a=_0x2f165a||0xcc;return function(_0x375ae2){if(_0x375ae2){return _0x3c0490[_0x1a10('0x18')](_0x2f165a);}return _0x3c0490[_0x1a10('0x19')](_0x2f165a)['end']();};}function respondWithResult(_0x120a70,_0x51f1a5){_0x51f1a5=_0x51f1a5||0xc8;return function(_0x56d8d0){if(_0x56d8d0){return _0x120a70['status'](_0x51f1a5)[_0x1a10('0x1a')](_0x56d8d0);}};}function respondWithFilteredResult(_0x3d0150,_0x12a93d){return function(_0x46a57a){if(_0x46a57a){var _0x5c1b61=typeof _0x12a93d[_0x1a10('0x1b')]===_0x1a10('0x1c')&&typeof _0x12a93d['limit']===_0x1a10('0x1c');var _0x3dd935=_0x46a57a[_0x1a10('0x1d')];var _0x457e2f=_0x5c1b61?0x0:_0x12a93d['offset'];var _0x169cf2=_0x5c1b61?_0x46a57a[_0x1a10('0x1d')]:_0x12a93d[_0x1a10('0x1b')]+_0x12a93d[_0x1a10('0x1e')];var _0x368a33;if(_0x169cf2>=_0x3dd935){_0x169cf2=_0x3dd935;_0x368a33=0xc8;}else{_0x368a33=0xce;}_0x3d0150[_0x1a10('0x19')](_0x368a33);return _0x3d0150[_0x1a10('0x1f')](_0x1a10('0x20'),_0x457e2f+'-'+_0x169cf2+'/'+_0x3dd935)[_0x1a10('0x1a')](_0x46a57a);}return null;};}function patchUpdates(_0x203561){return function(_0x473ae3){try{jsonpatch[_0x1a10('0x21')](_0x473ae3,_0x203561,!![]);}catch(_0x2041f8){return BPromise[_0x1a10('0x22')](_0x2041f8);}return _0x473ae3[_0x1a10('0x23')]();};}function saveUpdates(_0x595b4b,_0x70ae18){return function(_0x4861bc){if(_0x4861bc){return _0x4861bc[_0x1a10('0x24')](_0x595b4b)['then'](function(_0x437b55){return _0x437b55;});}return null;};}function removeEntity(_0x4c48ea,_0x11148c){return function(_0x74c06a){if(_0x74c06a){return _0x74c06a['destroy']()[_0x1a10('0x25')](function(){var _0x2e618a=_0x74c06a[_0x1a10('0x26')]({'plain':!![]});var _0x43cae0='ChanSpies';return db[_0x1a10('0x27')][_0x1a10('0x28')]({'where':{'type':_0x43cae0,'resourceId':_0x2e618a['id']}})[_0x1a10('0x25')](function(){return _0x74c06a;});})[_0x1a10('0x25')](function(){_0x4c48ea[_0x1a10('0x19')](0xcc)[_0x1a10('0x29')]();});}};}function handleEntityNotFound(_0x2d93d5,_0x29eb9f){return function(_0x4ba1a2){if(!_0x4ba1a2){_0x2d93d5['sendStatus'](0x194);}return _0x4ba1a2;};}function handleError(_0x4c8fe6,_0x9e9cc){_0x9e9cc=_0x9e9cc||0x1f4;return function(_0x35db81){logger[_0x1a10('0x2a')](_0x35db81[_0x1a10('0x2b')]);if(_0x35db81['name']){delete _0x35db81[_0x1a10('0x2c')];}_0x4c8fe6[_0x1a10('0x19')](_0x9e9cc)['send'](_0x35db81);};}exports[_0x1a10('0x2d')]=function(_0x3fd7c9,_0x41716c){var _0x4ae3ea={},_0x422276={},_0x3360cd={'count':0x0,'rows':[]};var _0xc98617=_[_0x1a10('0x2e')](db[_0x1a10('0x2f')]['rawAttributes'],function(_0x30eb67){return{'name':_0x30eb67['fieldName'],'type':_0x30eb67[_0x1a10('0x30')][_0x1a10('0x31')]};});_0x422276['model']=_[_0x1a10('0x2e')](_0xc98617,_0x1a10('0x2c'));_0x422276[_0x1a10('0x32')]=_['keys'](_0x3fd7c9['query']);_0x422276[_0x1a10('0x33')]=_[_0x1a10('0x34')](_0x422276[_0x1a10('0x35')],_0x422276[_0x1a10('0x32')]);_0x4ae3ea[_0x1a10('0x36')]=_[_0x1a10('0x34')](_0x422276[_0x1a10('0x35')],qs[_0x1a10('0x37')](_0x3fd7c9['query'][_0x1a10('0x37')]));_0x4ae3ea[_0x1a10('0x36')]=_0x4ae3ea[_0x1a10('0x36')][_0x1a10('0x38')]?_0x4ae3ea[_0x1a10('0x36')]:_0x422276[_0x1a10('0x35')];if(!_0x3fd7c9['query'][_0x1a10('0x39')](_0x1a10('0x3a'))){_0x4ae3ea[_0x1a10('0x1e')]=qs[_0x1a10('0x1e')](_0x3fd7c9[_0x1a10('0x32')][_0x1a10('0x1e')]);_0x4ae3ea[_0x1a10('0x1b')]=qs[_0x1a10('0x1b')](_0x3fd7c9['query'][_0x1a10('0x1b')]);}_0x4ae3ea[_0x1a10('0x3b')]=qs[_0x1a10('0x3c')](_0x3fd7c9[_0x1a10('0x32')]['sort']);_0x4ae3ea[_0x1a10('0x3d')]=qs['filters'](_[_0x1a10('0x3e')](_0x3fd7c9[_0x1a10('0x32')],_0x422276[_0x1a10('0x33')]),_0xc98617);if(_0x3fd7c9[_0x1a10('0x32')][_0x1a10('0x3f')]){_0x4ae3ea[_0x1a10('0x3d')]=_[_0x1a10('0x40')](_0x4ae3ea[_0x1a10('0x3d')],{'$or':_['map'](_0xc98617,function(_0x33c514){if(_0x33c514[_0x1a10('0x30')]!==_0x1a10('0x41')){var _0x4445e8={};_0x4445e8[_0x33c514['name']]={'$like':'%'+_0x3fd7c9[_0x1a10('0x32')][_0x1a10('0x3f')]+'%'};return _0x4445e8;}})});}_0x4ae3ea=_[_0x1a10('0x40')]({},_0x4ae3ea,_0x3fd7c9['options']);var _0x5754e3={'where':_0x4ae3ea['where']};return db[_0x1a10('0x2f')]['count'](_0x5754e3)['then'](function(_0x23f4b6){_0x3360cd[_0x1a10('0x1d')]=_0x23f4b6;if(_0x3fd7c9[_0x1a10('0x32')][_0x1a10('0x42')]){_0x4ae3ea[_0x1a10('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x1a10('0x44')](_0x4ae3ea);})[_0x1a10('0x25')](function(_0x28ac52){_0x3360cd[_0x1a10('0x45')]=_0x28ac52;return _0x3360cd;})[_0x1a10('0x25')](respondWithFilteredResult(_0x41716c,_0x4ae3ea))[_0x1a10('0x46')](handleError(_0x41716c,null));};exports['show']=function(_0xa8e0b7,_0xdf1426){var _0x792dd6={'raw':![],'where':{'id':_0xa8e0b7[_0x1a10('0x47')]['id']}},_0x5e7f23={};_0x5e7f23[_0x1a10('0x35')]=_[_0x1a10('0x48')](db[_0x1a10('0x2f')]['rawAttributes']);_0x5e7f23[_0x1a10('0x32')]=_[_0x1a10('0x48')](_0xa8e0b7['query']);_0x5e7f23['filters']=_[_0x1a10('0x34')](_0x5e7f23[_0x1a10('0x35')],_0x5e7f23[_0x1a10('0x32')]);_0x792dd6['attributes']=_[_0x1a10('0x34')](_0x5e7f23[_0x1a10('0x35')],qs[_0x1a10('0x37')](_0xa8e0b7[_0x1a10('0x32')][_0x1a10('0x37')]));_0x792dd6[_0x1a10('0x36')]=_0x792dd6[_0x1a10('0x36')][_0x1a10('0x38')]?_0x792dd6[_0x1a10('0x36')]:_0x5e7f23[_0x1a10('0x35')];if(_0xa8e0b7[_0x1a10('0x32')][_0x1a10('0x42')]){_0x792dd6[_0x1a10('0x43')]=[{'all':!![]}];}_0x792dd6=_[_0x1a10('0x40')]({},_0x792dd6,_0xa8e0b7[_0x1a10('0x49')]);return db[_0x1a10('0x2f')][_0x1a10('0x4a')](_0x792dd6)['then'](handleEntityNotFound(_0xdf1426,null))[_0x1a10('0x25')](respondWithResult(_0xdf1426,null))[_0x1a10('0x46')](handleError(_0xdf1426,null));};exports[_0x1a10('0x4b')]=function(_0x52a273,_0x2b1c8f){return db[_0x1a10('0x2f')][_0x1a10('0x4b')](_0x52a273[_0x1a10('0x4c')],{})[_0x1a10('0x25')](function(_0x487e39){var _0xabba8a=_0x52a273[_0x1a10('0x4d')]['get']({'plain':!![]});if(!_0xabba8a)throw new Error(_0x1a10('0x4e'));if(_0xabba8a[_0x1a10('0x4f')]===_0x1a10('0x4d')){var _0x5942b6=_0x487e39[_0x1a10('0x26')]({'plain':!![]});var _0x29db8e=_0x1a10('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x29db8e,'userProfileId':_0xabba8a['userProfileId']},'raw':!![]})[_0x1a10('0x25')](function(_0x269af4){if(_0x269af4&&_0x269af4[_0x1a10('0x51')]===0x0){return db[_0x1a10('0x27')]['create']({'name':_0x5942b6['name'],'resourceId':_0x5942b6['id'],'type':_0x269af4[_0x1a10('0x2c')],'sectionId':_0x269af4['id']},{})['then'](function(){return _0x487e39;});}else{return _0x487e39;}})[_0x1a10('0x46')](function(_0xe4c55d){logger[_0x1a10('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe4c55d);throw _0xe4c55d;});}return _0x487e39;})[_0x1a10('0x25')](respondWithResult(_0x2b1c8f,0xc9))[_0x1a10('0x46')](handleError(_0x2b1c8f,null));};exports[_0x1a10('0x24')]=function(_0x471f25,_0x5ca1a2){if(_0x471f25[_0x1a10('0x4c')]['id']){delete _0x471f25[_0x1a10('0x4c')]['id'];}return db[_0x1a10('0x2f')][_0x1a10('0x4a')]({'where':{'id':_0x471f25[_0x1a10('0x47')]['id']}})[_0x1a10('0x25')](handleEntityNotFound(_0x5ca1a2,null))[_0x1a10('0x25')](saveUpdates(_0x471f25[_0x1a10('0x4c')],null))[_0x1a10('0x25')](respondWithResult(_0x5ca1a2,null))['catch'](handleError(_0x5ca1a2,null));};exports[_0x1a10('0x28')]=function(_0x12713d,_0x2998a1){return db[_0x1a10('0x2f')][_0x1a10('0x4a')]({'where':{'id':_0x12713d[_0x1a10('0x47')]['id']}})['then'](handleEntityNotFound(_0x2998a1,null))[_0x1a10('0x25')](removeEntity(_0x2998a1,null))[_0x1a10('0x46')](handleError(_0x2998a1,null));}; \ No newline at end of file +var _0xed8a=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','findAll','rows','catch','show','params','keys','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key'];(function(_0x2027c3,_0x2b0cce){var _0x4396b8=function(_0x4f9227){while(--_0x4f9227){_0x2027c3['push'](_0x2027c3['shift']());}};_0x4396b8(++_0x2b0cce);}(_0xed8a,0xc5));var _0xaed8=function(_0x42401d,_0x125c43){_0x42401d=_0x42401d-0x0;var _0x104e6f=_0xed8a[_0x42401d];return _0x104e6f;};'use strict';var emlformat=require(_0xaed8('0x0'));var rimraf=require(_0xaed8('0x1'));var zipdir=require(_0xaed8('0x2'));var jsonpatch=require(_0xaed8('0x3'));var rp=require('request-promise');var moment=require(_0xaed8('0x4'));var BPromise=require(_0xaed8('0x5'));var Mustache=require('mustache');var util=require(_0xaed8('0x6'));var path=require(_0xaed8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaed8('0x8'));var fs=require('fs');var fs_extra=require(_0xaed8('0x9'));var _=require(_0xaed8('0xa'));var squel=require(_0xaed8('0xb'));var crypto=require(_0xaed8('0xc'));var jsforce=require(_0xaed8('0xd'));var deskjs=require(_0xaed8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaed8('0xf'));var Papa=require(_0xaed8('0x10'));var Redis=require(_0xaed8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaed8('0x12'));var as=require(_0xaed8('0x13'));var hardwareService=require(_0xaed8('0x14'));var logger=require(_0xaed8('0x15'))(_0xaed8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaed8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eed24,_0x36c833){_0x36c833=_0x36c833||0xcc;return function(_0x129051){if(_0x129051){return _0x3eed24[_0xaed8('0x18')](_0x36c833);}return _0x3eed24['status'](_0x36c833)[_0xaed8('0x19')]();};}function respondWithResult(_0x273de5,_0x3a7aab){_0x3a7aab=_0x3a7aab||0xc8;return function(_0x248cd7){if(_0x248cd7){return _0x273de5[_0xaed8('0x1a')](_0x3a7aab)[_0xaed8('0x1b')](_0x248cd7);}};}function respondWithFilteredResult(_0x54ae7b,_0xefac0c){return function(_0x4a7448){if(_0x4a7448){var _0x4593c1=typeof _0xefac0c[_0xaed8('0x1c')]==='undefined'&&typeof _0xefac0c[_0xaed8('0x1d')]===_0xaed8('0x1e');var _0x1ef875=_0x4a7448[_0xaed8('0x1f')];var _0x427d37=_0x4593c1?0x0:_0xefac0c[_0xaed8('0x1c')];var _0x42eae7=_0x4593c1?_0x4a7448[_0xaed8('0x1f')]:_0xefac0c[_0xaed8('0x1c')]+_0xefac0c[_0xaed8('0x1d')];var _0x2d32ce;if(_0x42eae7>=_0x1ef875){_0x42eae7=_0x1ef875;_0x2d32ce=0xc8;}else{_0x2d32ce=0xce;}_0x54ae7b[_0xaed8('0x1a')](_0x2d32ce);return _0x54ae7b[_0xaed8('0x20')](_0xaed8('0x21'),_0x427d37+'-'+_0x42eae7+'/'+_0x1ef875)[_0xaed8('0x1b')](_0x4a7448);}return null;};}function patchUpdates(_0x48828f){return function(_0x5cd103){try{jsonpatch[_0xaed8('0x22')](_0x5cd103,_0x48828f,!![]);}catch(_0x5bafaf){return BPromise[_0xaed8('0x23')](_0x5bafaf);}return _0x5cd103[_0xaed8('0x24')]();};}function saveUpdates(_0x2ec32e,_0x344949){return function(_0x5a69aa){if(_0x5a69aa){return _0x5a69aa['update'](_0x2ec32e)['then'](function(_0x1a1acb){return _0x1a1acb;});}return null;};}function removeEntity(_0x4437aa,_0x448ef9){return function(_0x38a3f1){if(_0x38a3f1){return _0x38a3f1[_0xaed8('0x25')]()[_0xaed8('0x26')](function(){var _0x290b32=_0x38a3f1[_0xaed8('0x27')]({'plain':!![]});var _0x10c1fa='ChanSpies';return db[_0xaed8('0x28')][_0xaed8('0x25')]({'where':{'type':_0x10c1fa,'resourceId':_0x290b32['id']}})[_0xaed8('0x26')](function(){return _0x38a3f1;});})[_0xaed8('0x26')](function(){_0x4437aa[_0xaed8('0x1a')](0xcc)[_0xaed8('0x19')]();});}};}function handleEntityNotFound(_0x541662,_0x552555){return function(_0x4c442d){if(!_0x4c442d){_0x541662[_0xaed8('0x18')](0x194);}return _0x4c442d;};}function handleError(_0x5d80c7,_0x34c7ff){_0x34c7ff=_0x34c7ff||0x1f4;return function(_0x4b25d9){logger[_0xaed8('0x29')](_0x4b25d9[_0xaed8('0x2a')]);if(_0x4b25d9[_0xaed8('0x2b')]){delete _0x4b25d9[_0xaed8('0x2b')];}_0x5d80c7[_0xaed8('0x1a')](_0x34c7ff)[_0xaed8('0x2c')](_0x4b25d9);};}exports[_0xaed8('0x2d')]=function(_0xa093be,_0x16263d){var _0x4b1db6={},_0x478bce={},_0x24a703={'count':0x0,'rows':[]};var _0x27dd81=_[_0xaed8('0x2e')](db[_0xaed8('0x2f')][_0xaed8('0x30')],function(_0x539150){return{'name':_0x539150[_0xaed8('0x31')],'type':_0x539150[_0xaed8('0x32')][_0xaed8('0x33')]};});_0x478bce[_0xaed8('0x34')]=_[_0xaed8('0x2e')](_0x27dd81,_0xaed8('0x2b'));_0x478bce['query']=_['keys'](_0xa093be[_0xaed8('0x35')]);_0x478bce[_0xaed8('0x36')]=_[_0xaed8('0x37')](_0x478bce['model'],_0x478bce['query']);_0x4b1db6[_0xaed8('0x38')]=_[_0xaed8('0x37')](_0x478bce[_0xaed8('0x34')],qs['fields'](_0xa093be[_0xaed8('0x35')][_0xaed8('0x39')]));_0x4b1db6[_0xaed8('0x38')]=_0x4b1db6['attributes'][_0xaed8('0x3a')]?_0x4b1db6[_0xaed8('0x38')]:_0x478bce[_0xaed8('0x34')];if(!_0xa093be[_0xaed8('0x35')][_0xaed8('0x3b')](_0xaed8('0x3c'))){_0x4b1db6[_0xaed8('0x1d')]=qs[_0xaed8('0x1d')](_0xa093be[_0xaed8('0x35')]['limit']);_0x4b1db6[_0xaed8('0x1c')]=qs[_0xaed8('0x1c')](_0xa093be[_0xaed8('0x35')][_0xaed8('0x1c')]);}_0x4b1db6['order']=qs[_0xaed8('0x3d')](_0xa093be[_0xaed8('0x35')][_0xaed8('0x3d')]);_0x4b1db6[_0xaed8('0x3e')]=qs[_0xaed8('0x36')](_[_0xaed8('0x3f')](_0xa093be[_0xaed8('0x35')],_0x478bce[_0xaed8('0x36')]),_0x27dd81);if(_0xa093be['query'][_0xaed8('0x40')]){_0x4b1db6[_0xaed8('0x3e')]=_['merge'](_0x4b1db6[_0xaed8('0x3e')],{'$or':_['map'](_0x27dd81,function(_0x3e06b6){if(_0x3e06b6[_0xaed8('0x32')]!=='VIRTUAL'){var _0x21bc95={};_0x21bc95[_0x3e06b6[_0xaed8('0x2b')]]={'$like':'%'+_0xa093be['query'][_0xaed8('0x40')]+'%'};return _0x21bc95;}})});}_0x4b1db6=_[_0xaed8('0x41')]({},_0x4b1db6,_0xa093be['options']);var _0x2d458e={'where':_0x4b1db6[_0xaed8('0x3e')]};return db['VoiceChanSpy'][_0xaed8('0x1f')](_0x2d458e)['then'](function(_0x2aa6da){_0x24a703[_0xaed8('0x1f')]=_0x2aa6da;if(_0xa093be[_0xaed8('0x35')]['includeAll']){_0x4b1db6['include']=[{'all':!![]}];}return db[_0xaed8('0x2f')][_0xaed8('0x42')](_0x4b1db6);})['then'](function(_0x22ddd8){_0x24a703[_0xaed8('0x43')]=_0x22ddd8;return _0x24a703;})[_0xaed8('0x26')](respondWithFilteredResult(_0x16263d,_0x4b1db6))[_0xaed8('0x44')](handleError(_0x16263d,null));};exports[_0xaed8('0x45')]=function(_0x41f0c6,_0x3c05d2){var _0x170de5={'raw':![],'where':{'id':_0x41f0c6[_0xaed8('0x46')]['id']}},_0x1f1eaa={};_0x1f1eaa['model']=_[_0xaed8('0x47')](db['VoiceChanSpy'][_0xaed8('0x30')]);_0x1f1eaa[_0xaed8('0x35')]=_['keys'](_0x41f0c6[_0xaed8('0x35')]);_0x1f1eaa[_0xaed8('0x36')]=_[_0xaed8('0x37')](_0x1f1eaa['model'],_0x1f1eaa[_0xaed8('0x35')]);_0x170de5[_0xaed8('0x38')]=_['intersection'](_0x1f1eaa[_0xaed8('0x34')],qs[_0xaed8('0x39')](_0x41f0c6[_0xaed8('0x35')][_0xaed8('0x39')]));_0x170de5[_0xaed8('0x38')]=_0x170de5[_0xaed8('0x38')]['length']?_0x170de5[_0xaed8('0x38')]:_0x1f1eaa[_0xaed8('0x34')];if(_0x41f0c6[_0xaed8('0x35')][_0xaed8('0x48')]){_0x170de5[_0xaed8('0x49')]=[{'all':!![]}];}_0x170de5=_[_0xaed8('0x41')]({},_0x170de5,_0x41f0c6['options']);return db[_0xaed8('0x2f')][_0xaed8('0x4a')](_0x170de5)[_0xaed8('0x26')](handleEntityNotFound(_0x3c05d2,null))[_0xaed8('0x26')](respondWithResult(_0x3c05d2,null))[_0xaed8('0x44')](handleError(_0x3c05d2,null));};exports[_0xaed8('0x4b')]=function(_0x940feb,_0x26c015){return db[_0xaed8('0x2f')][_0xaed8('0x4b')](_0x940feb['body'],{})[_0xaed8('0x26')](function(_0x3168af){var _0x57e9d1=_0x940feb[_0xaed8('0x4c')][_0xaed8('0x27')]({'plain':!![]});if(!_0x57e9d1)throw new Error(_0xaed8('0x4d'));if(_0x57e9d1['role']===_0xaed8('0x4c')){var _0x3b6a26=_0x3168af['get']({'plain':!![]});var _0x213341=_0xaed8('0x4e');return db[_0xaed8('0x4f')][_0xaed8('0x4a')]({'where':{'name':_0x213341,'userProfileId':_0x57e9d1[_0xaed8('0x50')]},'raw':!![]})[_0xaed8('0x26')](function(_0x116b53){if(_0x116b53&&_0x116b53['autoAssociation']===0x0){return db[_0xaed8('0x28')][_0xaed8('0x4b')]({'name':_0x3b6a26[_0xaed8('0x2b')],'resourceId':_0x3b6a26['id'],'type':_0x116b53[_0xaed8('0x2b')],'sectionId':_0x116b53['id']},{})[_0xaed8('0x26')](function(){return _0x3168af;});}else{return _0x3168af;}})[_0xaed8('0x44')](function(_0x2508fa){logger[_0xaed8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2508fa);throw _0x2508fa;});}return _0x3168af;})[_0xaed8('0x26')](respondWithResult(_0x26c015,0xc9))[_0xaed8('0x44')](handleError(_0x26c015,null));};exports[_0xaed8('0x51')]=function(_0x107dbd,_0x7a404){if(_0x107dbd[_0xaed8('0x52')]['id']){delete _0x107dbd[_0xaed8('0x52')]['id'];}return db[_0xaed8('0x2f')]['find']({'where':{'id':_0x107dbd['params']['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x7a404,null))[_0xaed8('0x26')](saveUpdates(_0x107dbd[_0xaed8('0x52')],null))[_0xaed8('0x26')](respondWithResult(_0x7a404,null))[_0xaed8('0x44')](handleError(_0x7a404,null));};exports[_0xaed8('0x25')]=function(_0x3a5afb,_0x311881){return db[_0xaed8('0x2f')][_0xaed8('0x4a')]({'where':{'id':_0x3a5afb[_0xaed8('0x46')]['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x311881,null))[_0xaed8('0x26')](removeEntity(_0x311881,null))[_0xaed8('0x44')](handleError(_0x311881,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 0eef46b..a1010f3 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 _0x8e86=['options','join','StopMixMonitor','length','internal','concat','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','merge','Set','format','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','ChanSpy','SIP/%s,%s','name'];(function(_0x3da241,_0xeba26a){var _0x43e156=function(_0x41ced1){while(--_0x41ced1){_0x3da241['push'](_0x3da241['shift']());}};_0x43e156(++_0xeba26a);}(_0x8e86,0x168));var _0x68e8=function(_0xf0b267,_0x4029ee){_0xf0b267=_0xf0b267-0x0;var _0x468140=_0x8e86[_0xf0b267];return _0x468140;};'use strict';var _=require(_0x68e8('0x0'));var util=require(_0x68e8('0x1'));var BPromise=require(_0x68e8('0x2'));var attributes=require(_0x68e8('0x3'));var getUserApplications=function(_0x20e834,_0x131143,_0x36c27d){var _0x23bf4a=0x1;var _0x567a4a=[];var _0xec81ad={'context':_0x131143[_0x68e8('0x4')]||_0x68e8('0x5'),'exten':util['format'](_0x68e8('0x6'),_0x20e834[_0x68e8('0x7')],_0x36c27d),'type':_0x68e8('0x8'),'isApp':![],'ChanSpyId':_0x20e834['id'],'UserId':_0x131143['id']};_0x567a4a[_0x68e8('0x9')](_[_0x68e8('0xa')]({'app':_0x68e8('0xb'),'appdata':util[_0x68e8('0xc')]('CDR(type)=%s','chanspy'),'priority':_0x23bf4a++},_0xec81ad));if(_0x20e834['record']){_0x567a4a['push'](_[_0x68e8('0xa')]({'app':_0x68e8('0xd'),'appdata':util['format'](_0x68e8('0xe'),_0x20e834[_0x68e8('0xf')]),'priority':_0x23bf4a++},_0xec81ad));}if(_0x20e834[_0x68e8('0x10')]){_0x567a4a[_0x68e8('0x9')](_['merge']({'app':'Authenticate','appdata':_0x20e834['password'],'priority':_0x23bf4a++},_0xec81ad));}_0x567a4a[_0x68e8('0x9')](_[_0x68e8('0xa')]({'app':_0x68e8('0x11'),'appdata':util['format'](_0x68e8('0x12'),_0x131143[_0x68e8('0x13')],_0x20e834['options']?_0x20e834[_0x68e8('0x14')][_0x68e8('0x15')](''):''),'priority':_0x23bf4a++},_0xec81ad));if(_0x20e834['record']){_0x567a4a[_0x68e8('0x9')](_[_0x68e8('0xa')]({'app':_0x68e8('0x16'),'priority':_0x23bf4a++},_0xec81ad));}return _0x567a4a;};var getChanSpyApplications=function(_0x4f19c4,_0x19394d){var _0x49878c=[];for(var _0xa905e2=0x0,_0xf29316=0x1;_0xa905e2<_0x19394d[_0x68e8('0x17')];_0xa905e2++,_0xf29316=0x1){_0x49878c=_0x49878c['concat'](getUserApplications(_0x4f19c4,_0x19394d[_0xa905e2],_0x19394d[_0xa905e2][_0x68e8('0x18')]));if(_0x19394d[_0xa905e2][_0x68e8('0x18')]!=_0x19394d[_0xa905e2][_0x68e8('0x13')]){_0x49878c=_0x49878c[_0x68e8('0x19')](getUserApplications(_0x4f19c4,_0x19394d[_0xa905e2],_0x19394d[_0xa905e2][_0x68e8('0x13')]));}}return _0x49878c;};var getChanSpyPromise=function(_0x322dd9,_0x51b35f){return new BPromise(function(_0xb246c9,_0x9748af){return _0x322dd9[_0x68e8('0x1a')][_0x68e8('0x1b')]({'attributes':['id',_0x68e8('0x13'),_0x68e8('0x18')],'where':{'role':_0x68e8('0x1c'),'chanspy':!![]},'raw':!![]})[_0x68e8('0x1d')](function(_0x4c7637){if(_0x4c7637){return _0xb246c9(getChanSpyApplications(_0x51b35f,_0x4c7637));}return _0xb246c9([]);})[_0x68e8('0x1e')](function(_0x58bf31){_0x9748af(_0x58bf31);});});};module[_0x68e8('0x1f')]=function(_0x286178,_0x225e4d){var _0x13f72a=_0x286178[_0x68e8('0x20')];return _0x286178[_0x68e8('0x21')](_0x68e8('0x22'),attributes,{'tableName':_0x68e8('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e79b2,_0x5448d8,_0x321767){return getChanSpyPromise(_0x13f72a,_0x5e79b2)[_0x68e8('0x1d')](function(_0x83e368){if(_0x83e368&&_0x83e368[_0x68e8('0x17')]){return _0x13f72a[_0x68e8('0x24')]['bulkCreate'](_0x83e368);}})['then'](function(){_0x321767();})[_0x68e8('0x1e')](function(_0xd578bd){_0x321767(_0xd578bd);});},'afterUpdate':function(_0x19f297,_0x307cac,_0x4978a3){return _0x13f72a[_0x68e8('0x24')]['destroy']({'where':{'ChanSpyId':_0x19f297['id']}})[_0x68e8('0x1d')](function(){return getChanSpyPromise(_0x13f72a,_0x19f297);})[_0x68e8('0x1d')](function(_0x5c660a){if(_0x5c660a&&_0x5c660a[_0x68e8('0x17')]){return _0x13f72a[_0x68e8('0x24')][_0x68e8('0x25')](_0x5c660a);}})['then'](function(){_0x4978a3();})[_0x68e8('0x1e')](function(_0x2e2da7){_0x4978a3(_0x2e2da7);});},'afterDestroy':function(_0x213ad3,_0x231bbb,_0x3f8de3){return _0x13f72a[_0x68e8('0x24')]['destroy']({'where':{'ChanSpyId':_0x213ad3['id']}})[_0x68e8('0x1d')](function(){_0x3f8de3();})[_0x68e8('0x1e')](function(_0x4cf37f){_0x3f8de3(_0x4cf37f);});}}});}; \ No newline at end of file +var _0xdeac=['password','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','lodash','util','bluebird','from-sip','format','prefix','system','push','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','merge','Authenticate'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdeac,0x9f));var _0xcdea=function(_0x5079f5,_0x1ffcc6){_0x5079f5=_0x5079f5-0x0;var _0xce895a=_0xdeac[_0x5079f5];return _0xce895a;};'use strict';var _=require(_0xcdea('0x0'));var util=require(_0xcdea('0x1'));var BPromise=require(_0xcdea('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3cb504,_0x57ecbb,_0x29aafe){var _0x4943f8=0x1;var _0x4d855d=[];var _0x176260={'context':_0x57ecbb['context']||_0xcdea('0x3'),'exten':util[_0xcdea('0x4')]('%s%s',_0x3cb504[_0xcdea('0x5')],_0x29aafe),'type':_0xcdea('0x6'),'isApp':![],'ChanSpyId':_0x3cb504['id'],'UserId':_0x57ecbb['id']};_0x4d855d[_0xcdea('0x7')](_['merge']({'app':'Set','appdata':util[_0xcdea('0x4')](_0xcdea('0x8'),_0xcdea('0x9')),'priority':_0x4943f8++},_0x176260));if(_0x3cb504[_0xcdea('0xa')]){_0x4d855d['push'](_['merge']({'app':_0xcdea('0xb'),'appdata':util[_0xcdea('0x4')]('${UNIQUEID}.%s,a',_0x3cb504[_0xcdea('0xc')]),'priority':_0x4943f8++},_0x176260));}if(_0x3cb504[_0xcdea('0xd')]){_0x4d855d[_0xcdea('0x7')](_[_0xcdea('0xe')]({'app':_0xcdea('0xf'),'appdata':_0x3cb504[_0xcdea('0x10')],'priority':_0x4943f8++},_0x176260));}_0x4d855d[_0xcdea('0x7')](_['merge']({'app':_0xcdea('0x11'),'appdata':util[_0xcdea('0x4')]('SIP/%s,%s',_0x57ecbb[_0xcdea('0x12')],_0x3cb504[_0xcdea('0x13')]?_0x3cb504[_0xcdea('0x13')][_0xcdea('0x14')](''):''),'priority':_0x4943f8++},_0x176260));if(_0x3cb504[_0xcdea('0xa')]){_0x4d855d['push'](_[_0xcdea('0xe')]({'app':_0xcdea('0x15'),'priority':_0x4943f8++},_0x176260));}return _0x4d855d;};var getChanSpyApplications=function(_0x1b6896,_0x51f901){var _0x495c5a=[];for(var _0x25dbd5=0x0,_0x446502=0x1;_0x25dbd5<_0x51f901[_0xcdea('0x16')];_0x25dbd5++,_0x446502=0x1){_0x495c5a=_0x495c5a[_0xcdea('0x17')](getUserApplications(_0x1b6896,_0x51f901[_0x25dbd5],_0x51f901[_0x25dbd5][_0xcdea('0x18')]));if(_0x51f901[_0x25dbd5][_0xcdea('0x18')]!=_0x51f901[_0x25dbd5][_0xcdea('0x12')]){_0x495c5a=_0x495c5a['concat'](getUserApplications(_0x1b6896,_0x51f901[_0x25dbd5],_0x51f901[_0x25dbd5][_0xcdea('0x12')]));}}return _0x495c5a;};var getChanSpyPromise=function(_0x5e7ea2,_0x4681bf){return new BPromise(function(_0x5ea791,_0x486f02){return _0x5e7ea2['User'][_0xcdea('0x19')]({'attributes':['id',_0xcdea('0x12'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xcdea('0x1a')](function(_0x1c6dbe){if(_0x1c6dbe){return _0x5ea791(getChanSpyApplications(_0x4681bf,_0x1c6dbe));}return _0x5ea791([]);})[_0xcdea('0x1b')](function(_0x195d64){_0x486f02(_0x195d64);});});};module[_0xcdea('0x1c')]=function(_0x1887b1,_0x3cbcc9){var _0x12f309=_0x1887b1[_0xcdea('0x1d')];return _0x1887b1[_0xcdea('0x1e')](_0xcdea('0x1f'),attributes,{'tableName':_0xcdea('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e6da4,_0x4f174b,_0x4cb31e){return getChanSpyPromise(_0x12f309,_0x5e6da4)[_0xcdea('0x1a')](function(_0x42b7fc){if(_0x42b7fc&&_0x42b7fc[_0xcdea('0x16')]){return _0x12f309[_0xcdea('0x21')][_0xcdea('0x22')](_0x42b7fc);}})[_0xcdea('0x1a')](function(){_0x4cb31e();})[_0xcdea('0x1b')](function(_0x2cc5be){_0x4cb31e(_0x2cc5be);});},'afterUpdate':function(_0x313811,_0x19ba89,_0x2511f1){return _0x12f309[_0xcdea('0x21')]['destroy']({'where':{'ChanSpyId':_0x313811['id']}})[_0xcdea('0x1a')](function(){return getChanSpyPromise(_0x12f309,_0x313811);})[_0xcdea('0x1a')](function(_0x2eb155){if(_0x2eb155&&_0x2eb155[_0xcdea('0x16')]){return _0x12f309[_0xcdea('0x21')][_0xcdea('0x22')](_0x2eb155);}})[_0xcdea('0x1a')](function(){_0x2511f1();})[_0xcdea('0x1b')](function(_0xd943fc){_0x2511f1(_0xd943fc);});},'afterDestroy':function(_0x2dcd6a,_0x17bbe6,_0x14ce81){return _0x12f309[_0xcdea('0x21')]['destroy']({'where':{'ChanSpyId':_0x2dcd6a['id']}})[_0xcdea('0x1a')](function(){_0x14ce81();})[_0xcdea('0x1b')](function(_0x1a54fa){_0x14ce81(_0x1a54fa);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ca6b946..4e69d41 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 _0x80df=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x86057e,_0x4baa46){var _0x2af017=function(_0xa1b30e){while(--_0xa1b30e){_0x86057e['push'](_0x86057e['shift']());}};_0x2af017(++_0x4baa46);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});} \ No newline at end of file +var _0x6e6c=['randomstring','../../config/utils','rpc','jayson/promise','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x5ac5d6,_0x51eb3e){var _0x2c8e34=function(_0x5103c7){while(--_0x5103c7){_0x5ac5d6['push'](_0x5ac5d6['shift']());}};_0x2c8e34(++_0x51eb3e);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 47e079e..a92e1e7 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 _0x8c4b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x8c4b,0xcc));var _0xb8c4=function(_0x261c5a,_0x1c2dfa){_0x261c5a=_0x261c5a-0x0;var _0x4d8c6c=_0x8c4b[_0x261c5a];return _0x4d8c6c;};'use strict';var multer=require(_0xb8c4('0x0'));var util=require(_0xb8c4('0x1'));var path=require(_0xb8c4('0x2'));var timeout=require(_0xb8c4('0x3'));var express=require(_0xb8c4('0x4'));var router=express[_0xb8c4('0x5')]();var fs_extra=require(_0xb8c4('0x6'));var auth=require(_0xb8c4('0x7'));var interaction=require(_0xb8c4('0x8'));var config=require(_0xb8c4('0x9'));var controller=require('./voiceContext.controller');router[_0xb8c4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb8c4('0xa')]('/:id',auth[_0xb8c4('0xb')](),controller[_0xb8c4('0xc')]);router[_0xb8c4('0xd')]('/',auth['isAuthenticated'](),controller[_0xb8c4('0xe')]);router[_0xb8c4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb8c4('0x10')]);router[_0xb8c4('0x11')](_0xb8c4('0x12'),auth[_0xb8c4('0xb')](),controller[_0xb8c4('0x13')]);module[_0xb8c4('0x14')]=router; \ No newline at end of file +var _0xe1a9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x18ea02,_0x45c7fe){var _0x306716=function(_0x336694){while(--_0x336694){_0x18ea02['push'](_0x18ea02['shift']());}};_0x306716(++_0x45c7fe);}(_0xe1a9,0x1ea));var _0x9e1a=function(_0x12baf0,_0x47c818){_0x12baf0=_0x12baf0-0x0;var _0x3a4e71=_0xe1a9[_0x12baf0];return _0x3a4e71;};'use strict';var multer=require(_0x9e1a('0x0'));var util=require(_0x9e1a('0x1'));var path=require('path');var timeout=require(_0x9e1a('0x2'));var express=require(_0x9e1a('0x3'));var router=express[_0x9e1a('0x4')]();var fs_extra=require(_0x9e1a('0x5'));var auth=require(_0x9e1a('0x6'));var interaction=require(_0x9e1a('0x7'));var config=require(_0x9e1a('0x8'));var controller=require(_0x9e1a('0x9'));router[_0x9e1a('0xa')]('/',auth[_0x9e1a('0xb')](),controller[_0x9e1a('0xc')]);router['get'](_0x9e1a('0xd'),auth['isAuthenticated'](),controller[_0x9e1a('0xe')]);router['post']('/',auth[_0x9e1a('0xb')](),controller['create']);router[_0x9e1a('0xf')](_0x9e1a('0xd'),auth[_0x9e1a('0xb')](),controller[_0x9e1a('0x10')]);router['delete'](_0x9e1a('0xd'),auth[_0x9e1a('0xb')](),controller[_0x9e1a('0x11')]);module[_0x9e1a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index a4f7330..80330df 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 _0x1150=['BOOLEAN','exports','STRING'];(function(_0x2f1e39,_0x8a959b){var _0x1d0146=function(_0x4911a3){while(--_0x4911a3){_0x2f1e39['push'](_0x2f1e39['shift']());}};_0x1d0146(++_0x8a959b);}(_0x1150,0x1c9));var _0x0115=function(_0x7f287d,_0xe3b36e){_0x7f287d=_0x7f287d-0x0;var _0x21514f=_0x1150[_0x7f287d];return _0x21514f;};'use strict';var Sequelize=require('sequelize');module[_0x0115('0x0')]={'name':{'type':Sequelize[_0x0115('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x0115('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0115('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa199=['name','STRING','BOOLEAN','sequelize','exports'];(function(_0x3f3b01,_0xfe5797){var _0x228322=function(_0xec48){while(--_0xec48){_0x3f3b01['push'](_0x3f3b01['shift']());}};_0x228322(++_0xfe5797);}(_0xa199,0x175));var _0x9a19=function(_0x1f8f46,_0x3f5ab9){_0x1f8f46=_0x1f8f46-0x0;var _0x41a078=_0xa199[_0x1f8f46];return _0x41a078;};'use strict';var Sequelize=require(_0x9a19('0x0'));module[_0x9a19('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9a19('0x2')},'description':{'type':Sequelize[_0x9a19('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9a19('0x4')],'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 e0b0900..ca4a1cb 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 _0xa229=['http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Contexts','then','stack','name','send','fieldName','type','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceContext','show','params','model','find','create','body','findAll','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','render','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client'];(function(_0x5b73de,_0x23359c){var _0x54394d=function(_0x50a532){while(--_0x50a532){_0x5b73de['push'](_0x5b73de['shift']());}};_0x54394d(++_0x23359c);}(_0xa229,0x187));var _0x9a22=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa229[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9a22('0x0'));var rimraf=require(_0x9a22('0x1'));var zipdir=require(_0x9a22('0x2'));var jsonpatch=require(_0x9a22('0x3'));var rp=require(_0x9a22('0x4'));var moment=require(_0x9a22('0x5'));var BPromise=require(_0x9a22('0x6'));var Mustache=require('mustache');var util=require(_0x9a22('0x7'));var path=require(_0x9a22('0x8'));var sox=require(_0x9a22('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a22('0xa'));var _=require(_0x9a22('0xb'));var squel=require('squel');var crypto=require(_0x9a22('0xc'));var jsforce=require(_0x9a22('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a22('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9a22('0xf'));var authService=require(_0x9a22('0x10'));var qs=require(_0x9a22('0x11'));var as=require(_0x9a22('0x12'));var hardwareService=require(_0x9a22('0x13'));var logger=require(_0x9a22('0x14'))(_0x9a22('0x15'));var utils=require(_0x9a22('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a22('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9a22('0x18')][_0x9a22('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x45f11d,_0x4581bf,_0xe3f260,_0x1fbefb){return new BPromise(function(_0x150010,_0x2d3695){var _0x2968ad=_0x1fbefb||client;return _0x2968ad[_0x9a22('0x1a')](_0x45f11d,_0xe3f260)['then'](function(_0x8a7cdb){logger[_0x9a22('0x1b')](_0x9a22('0x1c'),_0x4581bf,_0x9a22('0x1d'));logger[_0x9a22('0x1e')](_0x9a22('0x1f'),_0x4581bf,_0x9a22('0x1d'),JSON['stringify'](_0x8a7cdb));if(_0x8a7cdb[_0x9a22('0x20')]){if(_0x8a7cdb[_0x9a22('0x20')][_0x9a22('0x21')]===0x1f4){logger[_0x9a22('0x20')](_0x9a22('0x1c'),_0x4581bf,_0x8a7cdb[_0x9a22('0x20')][_0x9a22('0x22')]);return _0x2d3695(_0x8a7cdb['error']['message']);}logger['error'](_0x9a22('0x1c'),_0x4581bf,_0x8a7cdb[_0x9a22('0x20')]['message']);return _0x150010(_0x8a7cdb['error'][_0x9a22('0x22')]);}else{logger[_0x9a22('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x4581bf,_0x9a22('0x1d'));_0x150010(_0x8a7cdb[_0x9a22('0x23')][_0x9a22('0x22')]);}})[_0x9a22('0x24')](function(_0x16e5d2){logger[_0x9a22('0x20')](_0x9a22('0x1c'),_0x4581bf,_0x16e5d2);_0x2d3695(_0x16e5d2);});});}function respondWithStatusCode(_0x4dbffa,_0x47a49c){_0x47a49c=_0x47a49c||0xcc;return function(_0x4dc89a){if(_0x4dc89a){return _0x4dbffa[_0x9a22('0x25')](_0x47a49c);}return _0x4dbffa[_0x9a22('0x26')](_0x47a49c)[_0x9a22('0x27')]();};}function respondWithResult(_0x41d252,_0x6fcec3){_0x6fcec3=_0x6fcec3||0xc8;return function(_0x3d56ac){if(_0x3d56ac){return _0x41d252[_0x9a22('0x26')](_0x6fcec3)[_0x9a22('0x28')](_0x3d56ac);}};}function respondWithFilteredResult(_0x24d490,_0x510de3){return function(_0x4ea17b){if(_0x4ea17b){var _0x358b80=typeof _0x510de3[_0x9a22('0x29')]===_0x9a22('0x2a')&&typeof _0x510de3[_0x9a22('0x2b')]===_0x9a22('0x2a');var _0x350f4c=_0x4ea17b['count'];var _0x3cf003=_0x358b80?0x0:_0x510de3['offset'];var _0x2c741f=_0x358b80?_0x4ea17b[_0x9a22('0x2c')]:_0x510de3[_0x9a22('0x29')]+_0x510de3[_0x9a22('0x2b')];var _0x457e64;if(_0x2c741f>=_0x350f4c){_0x2c741f=_0x350f4c;_0x457e64=0xc8;}else{_0x457e64=0xce;}_0x24d490['status'](_0x457e64);return _0x24d490[_0x9a22('0x2d')](_0x9a22('0x2e'),_0x3cf003+'-'+_0x2c741f+'/'+_0x350f4c)[_0x9a22('0x28')](_0x4ea17b);}return null;};}function patchUpdates(_0x2e29b8){return function(_0x5994bf){try{jsonpatch[_0x9a22('0x2f')](_0x5994bf,_0x2e29b8,!![]);}catch(_0xe4a4a3){return BPromise[_0x9a22('0x30')](_0xe4a4a3);}return _0x5994bf[_0x9a22('0x31')]();};}function saveUpdates(_0x49315c,_0x251ca3){return function(_0x263947){if(_0x263947){return _0x263947['update'](_0x49315c)['then'](function(_0x4d5bb5){return _0x4d5bb5;});}return null;};}function removeEntity(_0x3a9f53,_0x5317c1){return function(_0x5b65df){if(_0x5b65df){return _0x5b65df[_0x9a22('0x32')]()['then'](function(){var _0x2e659d=_0x5b65df['get']({'plain':!![]});var _0x528fce=_0x9a22('0x33');return db['UserProfileResource'][_0x9a22('0x32')]({'where':{'type':_0x528fce,'resourceId':_0x2e659d['id']}})[_0x9a22('0x34')](function(){return _0x5b65df;});})[_0x9a22('0x34')](function(){_0x3a9f53[_0x9a22('0x26')](0xcc)[_0x9a22('0x27')]();});}};}function handleEntityNotFound(_0x4d2ac7,_0x468270){return function(_0x278e9c){if(!_0x278e9c){_0x4d2ac7['sendStatus'](0x194);}return _0x278e9c;};}function handleError(_0x12d215,_0x613538){_0x613538=_0x613538||0x1f4;return function(_0x44934a){logger['error'](_0x44934a[_0x9a22('0x35')]);if(_0x44934a[_0x9a22('0x36')]){delete _0x44934a[_0x9a22('0x36')];}_0x12d215[_0x9a22('0x26')](_0x613538)[_0x9a22('0x37')](_0x44934a);};}exports['index']=function(_0x38ed3c,_0x5f3231){var _0x367a7c={},_0x2c721c={},_0x368ae4={'count':0x0,'rows':[]};var _0x37a440=_['map'](db['VoiceContext']['rawAttributes'],function(_0x1f56dd){return{'name':_0x1f56dd[_0x9a22('0x38')],'type':_0x1f56dd[_0x9a22('0x39')]['key']};});_0x2c721c['model']=_[_0x9a22('0x3a')](_0x37a440,_0x9a22('0x36'));_0x2c721c[_0x9a22('0x3b')]=_[_0x9a22('0x3c')](_0x38ed3c[_0x9a22('0x3b')]);_0x2c721c['filters']=_[_0x9a22('0x3d')](_0x2c721c['model'],_0x2c721c[_0x9a22('0x3b')]);_0x367a7c[_0x9a22('0x3e')]=_[_0x9a22('0x3d')](_0x2c721c['model'],qs[_0x9a22('0x3f')](_0x38ed3c['query']['fields']));_0x367a7c[_0x9a22('0x3e')]=_0x367a7c[_0x9a22('0x3e')][_0x9a22('0x40')]?_0x367a7c[_0x9a22('0x3e')]:_0x2c721c['model'];if(!_0x38ed3c['query'][_0x9a22('0x41')](_0x9a22('0x42'))){_0x367a7c['limit']=qs[_0x9a22('0x2b')](_0x38ed3c[_0x9a22('0x3b')][_0x9a22('0x2b')]);_0x367a7c['offset']=qs['offset'](_0x38ed3c[_0x9a22('0x3b')][_0x9a22('0x29')]);}_0x367a7c[_0x9a22('0x43')]=qs[_0x9a22('0x44')](_0x38ed3c['query'][_0x9a22('0x44')]);_0x367a7c[_0x9a22('0x45')]=qs[_0x9a22('0x46')](_[_0x9a22('0x47')](_0x38ed3c[_0x9a22('0x3b')],_0x2c721c[_0x9a22('0x46')]),_0x37a440);if(_0x38ed3c['query'][_0x9a22('0x48')]){_0x367a7c[_0x9a22('0x45')]=_[_0x9a22('0x49')](_0x367a7c[_0x9a22('0x45')],{'$or':_[_0x9a22('0x3a')](_0x37a440,function(_0xfa473c){if(_0xfa473c['type']!==_0x9a22('0x4a')){var _0x47aca7={};_0x47aca7[_0xfa473c['name']]={'$like':'%'+_0x38ed3c[_0x9a22('0x3b')][_0x9a22('0x48')]+'%'};return _0x47aca7;}})});}_0x367a7c=_['merge']({},_0x367a7c,_0x38ed3c[_0x9a22('0x4b')]);var _0x38755e={'where':_0x367a7c[_0x9a22('0x45')]};return db['VoiceContext'][_0x9a22('0x2c')](_0x38755e)[_0x9a22('0x34')](function(_0xb2f42e){_0x368ae4[_0x9a22('0x2c')]=_0xb2f42e;if(_0x38ed3c[_0x9a22('0x3b')][_0x9a22('0x4c')]){_0x367a7c[_0x9a22('0x4d')]=[{'all':!![]}];}return db[_0x9a22('0x4e')]['findAll'](_0x367a7c);})['then'](function(_0x55413d){_0x368ae4['rows']=_0x55413d;return _0x368ae4;})['then'](respondWithFilteredResult(_0x5f3231,_0x367a7c))['catch'](handleError(_0x5f3231,null));};exports[_0x9a22('0x4f')]=function(_0x5eb9c5,_0x2b649c){var _0x37547c={'raw':![],'where':{'id':_0x5eb9c5[_0x9a22('0x50')]['id']}},_0x509919={};_0x509919[_0x9a22('0x51')]=_[_0x9a22('0x3c')](db[_0x9a22('0x4e')]['rawAttributes']);_0x509919[_0x9a22('0x3b')]=_[_0x9a22('0x3c')](_0x5eb9c5['query']);_0x509919['filters']=_[_0x9a22('0x3d')](_0x509919[_0x9a22('0x51')],_0x509919['query']);_0x37547c[_0x9a22('0x3e')]=_[_0x9a22('0x3d')](_0x509919[_0x9a22('0x51')],qs['fields'](_0x5eb9c5[_0x9a22('0x3b')][_0x9a22('0x3f')]));_0x37547c[_0x9a22('0x3e')]=_0x37547c[_0x9a22('0x3e')][_0x9a22('0x40')]?_0x37547c[_0x9a22('0x3e')]:_0x509919[_0x9a22('0x51')];if(_0x5eb9c5[_0x9a22('0x3b')][_0x9a22('0x4c')]){_0x37547c['include']=[{'all':!![]}];}_0x37547c=_[_0x9a22('0x49')]({},_0x37547c,_0x5eb9c5[_0x9a22('0x4b')]);return db[_0x9a22('0x4e')][_0x9a22('0x52')](_0x37547c)['then'](handleEntityNotFound(_0x2b649c,null))['then'](respondWithResult(_0x2b649c,null))['catch'](handleError(_0x2b649c,null));};exports[_0x9a22('0x53')]=function(_0x1f1172,_0x10da8a,_0x433587){var _0x18b2ef;return db[_0x9a22('0x4e')]['create'](_0x1f1172[_0x9a22('0x54')],{'raw':!![]})[_0x9a22('0x34')](function(_0x45a36e){_0x18b2ef=_0x45a36e;return db[_0x9a22('0x4e')][_0x9a22('0x55')]({'raw':!![]});})[_0x9a22('0x34')](function(_0x270873){var _0x555641=fs[_0x9a22('0x56')](path[_0x9a22('0x57')](config[_0x9a22('0x58')],'server/files/templates/context.ejs'),_0x9a22('0x59'));var _0xcdf3b2=ejs['render'](_0x555641,{'contexts':_0x270873||[]});fs[_0x9a22('0x5a')](_0x9a22('0x5b'),_0xcdf3b2);})['then'](function(){return respondWithRpcPromise(_0x9a22('0x5c'),'create',{'module':_0x9a22('0x5d')});})[_0x9a22('0x34')](function(){var _0xe1d891=_0x1f1172[_0x9a22('0x5e')][_0x9a22('0x5f')]({'plain':!![]});if(!_0xe1d891)throw new Error(_0x9a22('0x60'));if(_0xe1d891[_0x9a22('0x61')]==='user'){var _0x28889b=_0x18b2ef['get']({'plain':!![]});return db[_0x9a22('0x62')][_0x9a22('0x52')]({'where':{'name':'Contexts','userProfileId':_0xe1d891[_0x9a22('0x63')]},'raw':!![]})['then'](function(_0x584b8d){if(_0x584b8d&&_0x584b8d['autoAssociation']===0x0){return db['UserProfileResource'][_0x9a22('0x53')]({'name':_0x28889b[_0x9a22('0x36')],'resourceId':_0x28889b['id'],'type':_0x584b8d[_0x9a22('0x36')],'sectionId':_0x584b8d['id']},{})['then'](function(){return _0x18b2ef;});}else{return _0x18b2ef;}})[_0x9a22('0x24')](function(_0x3f571d){logger[_0x9a22('0x20')](_0x9a22('0x64'),_0x3f571d);throw _0x3f571d;});}return _0x18b2ef;})['then'](respondWithResult(_0x10da8a,0xc9))[_0x9a22('0x24')](handleError(_0x10da8a,null));};exports['update']=function(_0x212234,_0x11929a,_0x281ef7){var _0x3b8d45;return db['VoiceContext'][_0x9a22('0x52')]({'where':{'id':_0x212234[_0x9a22('0x50')]['id']}})[_0x9a22('0x34')](handleEntityNotFound(_0x11929a,null))['then'](saveUpdates(_0x212234[_0x9a22('0x54')],null))['then'](function(_0x3b4589){if(_0x3b4589){_0x3b8d45=_0x3b4589;return db['VoiceContext'][_0x9a22('0x55')]({'raw':!![]});}})[_0x9a22('0x34')](function(_0x74e1e9){var _0xfaea40=fs[_0x9a22('0x56')](path[_0x9a22('0x57')](config['root'],_0x9a22('0x65')),_0x9a22('0x59'));var _0x3afde3=ejs[_0x9a22('0x66')](_0xfaea40,{'contexts':_0x74e1e9||[]});fs['writeFileSync'](_0x9a22('0x5b'),_0x3afde3);})[_0x9a22('0x34')](function(){return respondWithRpcPromise(_0x9a22('0x5c'),_0x9a22('0x67'),{'module':_0x9a22('0x5d')});})['then'](function(){return _0x3b8d45;})[_0x9a22('0x34')](respondWithResult(_0x11929a,null))[_0x9a22('0x24')](handleError(_0x11929a,null));};exports['destroy']=function(_0x5f4e8f,_0x2c493d,_0x327c3e){var _0x4d70c9;return db[_0x9a22('0x4e')][_0x9a22('0x52')]({'where':{'id':_0x5f4e8f['params']['id']}})[_0x9a22('0x34')](handleEntityNotFound(_0x2c493d,null))[_0x9a22('0x34')](removeEntity(_0x2c493d,null))[_0x9a22('0x34')](function(){return db[_0x9a22('0x4e')][_0x9a22('0x55')]({'raw':!![]});})[_0x9a22('0x34')](function(_0x1cdf5a){var _0x17c311=fs[_0x9a22('0x56')](path[_0x9a22('0x57')](config[_0x9a22('0x58')],'server/files/templates/context.ejs'),_0x9a22('0x59'));var _0x476584=ejs[_0x9a22('0x66')](_0x17c311,{'contexts':_0x1cdf5a});fs['writeFileSync'](_0x9a22('0x5b'),_0x476584);return respondWithRpcPromise('Reload','destroy',{'module':_0x9a22('0x5d')});})['catch'](handleError(_0x2c493d,null));}; \ No newline at end of file +var _0x1699=['destroy','then','get','UserProfileResource','end','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','includeAll','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','autoAssociation','update','params','join','render','Reload','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','undefined','limit','offset','count','Content-Range'];(function(_0x4507c1,_0xa8d71a){var _0x3d3b03=function(_0x438bca){while(--_0x438bca){_0x4507c1['push'](_0x4507c1['shift']());}};_0x3d3b03(++_0xa8d71a);}(_0x1699,0xfd));var _0x9169=function(_0x4663cf,_0x4045b2){_0x4663cf=_0x4663cf-0x0;var _0x5e7f76=_0x1699[_0x4663cf];return _0x5e7f76;};'use strict';var emlformat=require(_0x9169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9169('0x1'));var jsonpatch=require(_0x9169('0x2'));var rp=require(_0x9169('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9169('0x4'));var util=require(_0x9169('0x5'));var path=require('path');var sox=require(_0x9169('0x6'));var csv=require(_0x9169('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9169('0x8'));var squel=require(_0x9169('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9169('0xa'));var toCsv=require(_0x9169('0x7'));var querystring=require('querystring');var Papa=require(_0x9169('0xb'));var Redis=require(_0x9169('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9169('0xd'));var as=require(_0x9169('0xe'));var hardwareService=require(_0x9169('0xf'));var logger=require(_0x9169('0x10'))('api');var utils=require(_0x9169('0x11'));var config=require(_0x9169('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9169('0x13'))['db'];var jayson=require(_0x9169('0x14'));var client=jayson[_0x9169('0x15')][_0x9169('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2440dd,_0x4ae0ec,_0x1a583d,_0x4dda35){return new BPromise(function(_0x400fa2,_0x2f07cb){var _0x534a31=_0x4dda35||client;return _0x534a31[_0x9169('0x17')](_0x2440dd,_0x1a583d)['then'](function(_0x2e0ddc){logger[_0x9169('0x18')](_0x9169('0x19'),_0x4ae0ec,'request\x20sent');logger[_0x9169('0x1a')](_0x9169('0x1b'),_0x4ae0ec,_0x9169('0x1c'),JSON[_0x9169('0x1d')](_0x2e0ddc));if(_0x2e0ddc[_0x9169('0x1e')]){if(_0x2e0ddc[_0x9169('0x1e')][_0x9169('0x1f')]===0x1f4){logger[_0x9169('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x4ae0ec,_0x2e0ddc[_0x9169('0x1e')][_0x9169('0x20')]);return _0x2f07cb(_0x2e0ddc[_0x9169('0x1e')][_0x9169('0x20')]);}logger[_0x9169('0x1e')](_0x9169('0x19'),_0x4ae0ec,_0x2e0ddc['error'][_0x9169('0x20')]);return _0x400fa2(_0x2e0ddc[_0x9169('0x1e')]['message']);}else{logger[_0x9169('0x18')](_0x9169('0x19'),_0x4ae0ec,_0x9169('0x1c'));_0x400fa2(_0x2e0ddc[_0x9169('0x21')][_0x9169('0x20')]);}})['catch'](function(_0x580800){logger[_0x9169('0x1e')](_0x9169('0x19'),_0x4ae0ec,_0x580800);_0x2f07cb(_0x580800);});});}function respondWithStatusCode(_0x2c3081,_0xbb69e2){_0xbb69e2=_0xbb69e2||0xcc;return function(_0xcd28d6){if(_0xcd28d6){return _0x2c3081['sendStatus'](_0xbb69e2);}return _0x2c3081[_0x9169('0x22')](_0xbb69e2)['end']();};}function respondWithResult(_0x32ec93,_0x1930a0){_0x1930a0=_0x1930a0||0xc8;return function(_0x501802){if(_0x501802){return _0x32ec93[_0x9169('0x22')](_0x1930a0)[_0x9169('0x23')](_0x501802);}};}function respondWithFilteredResult(_0x5c1bf1,_0x33a533){return function(_0x4bc3a4){if(_0x4bc3a4){var _0x123d64=typeof _0x33a533['offset']===_0x9169('0x24')&&typeof _0x33a533[_0x9169('0x25')]===_0x9169('0x24');var _0x14b287=_0x4bc3a4['count'];var _0x18ae69=_0x123d64?0x0:_0x33a533[_0x9169('0x26')];var _0x575b14=_0x123d64?_0x4bc3a4[_0x9169('0x27')]:_0x33a533[_0x9169('0x26')]+_0x33a533['limit'];var _0x36b59d;if(_0x575b14>=_0x14b287){_0x575b14=_0x14b287;_0x36b59d=0xc8;}else{_0x36b59d=0xce;}_0x5c1bf1[_0x9169('0x22')](_0x36b59d);return _0x5c1bf1['set'](_0x9169('0x28'),_0x18ae69+'-'+_0x575b14+'/'+_0x14b287)[_0x9169('0x23')](_0x4bc3a4);}return null;};}function patchUpdates(_0xa565f5){return function(_0xdf5a48){try{jsonpatch['apply'](_0xdf5a48,_0xa565f5,!![]);}catch(_0xdaebfe){return BPromise['reject'](_0xdaebfe);}return _0xdf5a48['save']();};}function saveUpdates(_0x3592f3,_0x43615a){return function(_0x5ced58){if(_0x5ced58){return _0x5ced58['update'](_0x3592f3)['then'](function(_0x133661){return _0x133661;});}return null;};}function removeEntity(_0x411d5d,_0x3ff148){return function(_0x1644cd){if(_0x1644cd){return _0x1644cd[_0x9169('0x29')]()[_0x9169('0x2a')](function(){var _0x3225ad=_0x1644cd[_0x9169('0x2b')]({'plain':!![]});var _0x3e420e='Contexts';return db[_0x9169('0x2c')][_0x9169('0x29')]({'where':{'type':_0x3e420e,'resourceId':_0x3225ad['id']}})['then'](function(){return _0x1644cd;});})[_0x9169('0x2a')](function(){_0x411d5d[_0x9169('0x22')](0xcc)[_0x9169('0x2d')]();});}};}function handleEntityNotFound(_0x219ff8,_0x47249e){return function(_0x4a7594){if(!_0x4a7594){_0x219ff8[_0x9169('0x2e')](0x194);}return _0x4a7594;};}function handleError(_0x47871a,_0x438331){_0x438331=_0x438331||0x1f4;return function(_0x5c8176){logger[_0x9169('0x1e')](_0x5c8176['stack']);if(_0x5c8176[_0x9169('0x2f')]){delete _0x5c8176['name'];}_0x47871a[_0x9169('0x22')](_0x438331)[_0x9169('0x30')](_0x5c8176);};}exports[_0x9169('0x31')]=function(_0x14e27f,_0x531208){var _0x35dda5={},_0x436b65={},_0x535a99={'count':0x0,'rows':[]};var _0x275b34=_[_0x9169('0x32')](db[_0x9169('0x33')][_0x9169('0x34')],function(_0x1934cc){return{'name':_0x1934cc[_0x9169('0x35')],'type':_0x1934cc['type']['key']};});_0x436b65[_0x9169('0x36')]=_[_0x9169('0x32')](_0x275b34,_0x9169('0x2f'));_0x436b65[_0x9169('0x37')]=_[_0x9169('0x38')](_0x14e27f[_0x9169('0x37')]);_0x436b65[_0x9169('0x39')]=_['intersection'](_0x436b65[_0x9169('0x36')],_0x436b65[_0x9169('0x37')]);_0x35dda5[_0x9169('0x3a')]=_[_0x9169('0x3b')](_0x436b65['model'],qs[_0x9169('0x3c')](_0x14e27f[_0x9169('0x37')][_0x9169('0x3c')]));_0x35dda5[_0x9169('0x3a')]=_0x35dda5[_0x9169('0x3a')]['length']?_0x35dda5[_0x9169('0x3a')]:_0x436b65[_0x9169('0x36')];if(!_0x14e27f[_0x9169('0x37')][_0x9169('0x3d')]('nolimit')){_0x35dda5['limit']=qs[_0x9169('0x25')](_0x14e27f[_0x9169('0x37')][_0x9169('0x25')]);_0x35dda5[_0x9169('0x26')]=qs[_0x9169('0x26')](_0x14e27f['query'][_0x9169('0x26')]);}_0x35dda5[_0x9169('0x3e')]=qs[_0x9169('0x3f')](_0x14e27f[_0x9169('0x37')][_0x9169('0x3f')]);_0x35dda5[_0x9169('0x40')]=qs[_0x9169('0x39')](_[_0x9169('0x41')](_0x14e27f[_0x9169('0x37')],_0x436b65[_0x9169('0x39')]),_0x275b34);if(_0x14e27f[_0x9169('0x37')][_0x9169('0x42')]){_0x35dda5[_0x9169('0x40')]=_[_0x9169('0x43')](_0x35dda5[_0x9169('0x40')],{'$or':_[_0x9169('0x32')](_0x275b34,function(_0x1a8fe1){if(_0x1a8fe1[_0x9169('0x44')]!=='VIRTUAL'){var _0x4a7dde={};_0x4a7dde[_0x1a8fe1[_0x9169('0x2f')]]={'$like':'%'+_0x14e27f['query'][_0x9169('0x42')]+'%'};return _0x4a7dde;}})});}_0x35dda5=_['merge']({},_0x35dda5,_0x14e27f[_0x9169('0x45')]);var _0x34c130={'where':_0x35dda5[_0x9169('0x40')]};return db[_0x9169('0x33')][_0x9169('0x27')](_0x34c130)[_0x9169('0x2a')](function(_0x514524){_0x535a99[_0x9169('0x27')]=_0x514524;if(_0x14e27f[_0x9169('0x37')]['includeAll']){_0x35dda5[_0x9169('0x46')]=[{'all':!![]}];}return db[_0x9169('0x33')][_0x9169('0x47')](_0x35dda5);})[_0x9169('0x2a')](function(_0x692411){_0x535a99[_0x9169('0x48')]=_0x692411;return _0x535a99;})['then'](respondWithFilteredResult(_0x531208,_0x35dda5))[_0x9169('0x49')](handleError(_0x531208,null));};exports[_0x9169('0x4a')]=function(_0x447777,_0xa4ca4e){var _0x1330fa={'raw':![],'where':{'id':_0x447777['params']['id']}},_0x1e7fa9={};_0x1e7fa9['model']=_[_0x9169('0x38')](db[_0x9169('0x33')][_0x9169('0x34')]);_0x1e7fa9['query']=_[_0x9169('0x38')](_0x447777[_0x9169('0x37')]);_0x1e7fa9[_0x9169('0x39')]=_[_0x9169('0x3b')](_0x1e7fa9[_0x9169('0x36')],_0x1e7fa9['query']);_0x1330fa[_0x9169('0x3a')]=_[_0x9169('0x3b')](_0x1e7fa9[_0x9169('0x36')],qs[_0x9169('0x3c')](_0x447777[_0x9169('0x37')][_0x9169('0x3c')]));_0x1330fa[_0x9169('0x3a')]=_0x1330fa[_0x9169('0x3a')]['length']?_0x1330fa[_0x9169('0x3a')]:_0x1e7fa9[_0x9169('0x36')];if(_0x447777[_0x9169('0x37')][_0x9169('0x4b')]){_0x1330fa[_0x9169('0x46')]=[{'all':!![]}];}_0x1330fa=_[_0x9169('0x43')]({},_0x1330fa,_0x447777[_0x9169('0x45')]);return db[_0x9169('0x33')][_0x9169('0x4c')](_0x1330fa)[_0x9169('0x2a')](handleEntityNotFound(_0xa4ca4e,null))['then'](respondWithResult(_0xa4ca4e,null))['catch'](handleError(_0xa4ca4e,null));};exports[_0x9169('0x4d')]=function(_0x33a6c9,_0x2f5187,_0x5464de){var _0x6df7e0;return db[_0x9169('0x33')][_0x9169('0x4d')](_0x33a6c9[_0x9169('0x4e')],{'raw':!![]})[_0x9169('0x2a')](function(_0x2eb533){_0x6df7e0=_0x2eb533;return db['VoiceContext'][_0x9169('0x47')]({'raw':!![]});})[_0x9169('0x2a')](function(_0x3a2efc){var _0x4e07cc=fs[_0x9169('0x4f')](path['join'](config[_0x9169('0x50')],_0x9169('0x51')),_0x9169('0x52'));var _0xf13431=ejs['render'](_0x4e07cc,{'contexts':_0x3a2efc||[]});fs[_0x9169('0x53')](_0x9169('0x54'),_0xf13431);})[_0x9169('0x2a')](function(){return respondWithRpcPromise('Reload',_0x9169('0x4d'),{'module':_0x9169('0x55')});})[_0x9169('0x2a')](function(){var _0x27f226=_0x33a6c9['user'][_0x9169('0x2b')]({'plain':!![]});if(!_0x27f226)throw new Error(_0x9169('0x56'));if(_0x27f226[_0x9169('0x57')]===_0x9169('0x58')){var _0x3315c9=_0x6df7e0[_0x9169('0x2b')]({'plain':!![]});return db[_0x9169('0x59')][_0x9169('0x4c')]({'where':{'name':_0x9169('0x5a'),'userProfileId':_0x27f226[_0x9169('0x5b')]},'raw':!![]})[_0x9169('0x2a')](function(_0x5127e3){if(_0x5127e3&&_0x5127e3[_0x9169('0x5c')]===0x0){return db[_0x9169('0x2c')][_0x9169('0x4d')]({'name':_0x3315c9[_0x9169('0x2f')],'resourceId':_0x3315c9['id'],'type':_0x5127e3[_0x9169('0x2f')],'sectionId':_0x5127e3['id']},{})[_0x9169('0x2a')](function(){return _0x6df7e0;});}else{return _0x6df7e0;}})['catch'](function(_0x2314ee){logger[_0x9169('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2314ee);throw _0x2314ee;});}return _0x6df7e0;})['then'](respondWithResult(_0x2f5187,0xc9))[_0x9169('0x49')](handleError(_0x2f5187,null));};exports[_0x9169('0x5d')]=function(_0x250bc8,_0x38aa47,_0x352b95){var _0x444de1;return db['VoiceContext'][_0x9169('0x4c')]({'where':{'id':_0x250bc8[_0x9169('0x5e')]['id']}})['then'](handleEntityNotFound(_0x38aa47,null))[_0x9169('0x2a')](saveUpdates(_0x250bc8[_0x9169('0x4e')],null))[_0x9169('0x2a')](function(_0x29b22e){if(_0x29b22e){_0x444de1=_0x29b22e;return db[_0x9169('0x33')][_0x9169('0x47')]({'raw':!![]});}})[_0x9169('0x2a')](function(_0x4eb79f){var _0x1e3d6d=fs[_0x9169('0x4f')](path[_0x9169('0x5f')](config[_0x9169('0x50')],_0x9169('0x51')),_0x9169('0x52'));var _0x114619=ejs[_0x9169('0x60')](_0x1e3d6d,{'contexts':_0x4eb79f||[]});fs[_0x9169('0x53')](_0x9169('0x54'),_0x114619);})['then'](function(){return respondWithRpcPromise(_0x9169('0x61'),_0x9169('0x5d'),{'module':_0x9169('0x55')});})[_0x9169('0x2a')](function(){return _0x444de1;})[_0x9169('0x2a')](respondWithResult(_0x38aa47,null))[_0x9169('0x49')](handleError(_0x38aa47,null));};exports[_0x9169('0x29')]=function(_0x51076f,_0x2f09fe,_0x51b424){var _0x246a91;return db[_0x9169('0x33')][_0x9169('0x4c')]({'where':{'id':_0x51076f['params']['id']}})['then'](handleEntityNotFound(_0x2f09fe,null))['then'](removeEntity(_0x2f09fe,null))['then'](function(){return db['VoiceContext'][_0x9169('0x47')]({'raw':!![]});})['then'](function(_0xf25d58){var _0x49e4e1=fs[_0x9169('0x4f')](path[_0x9169('0x5f')](config[_0x9169('0x50')],_0x9169('0x51')),_0x9169('0x52'));var _0x5014ed=ejs['render'](_0x49e4e1,{'contexts':_0xf25d58});fs[_0x9169('0x53')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5014ed);return respondWithRpcPromise(_0x9169('0x61'),_0x9169('0x29'),{'module':_0x9169('0x55')});})['catch'](handleError(_0x2f09fe,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1871af1..7945e8b 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 _0x0f42=['api','bluebird','path','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger'];(function(_0xbf2e46,_0x2f902d){var _0x9940a1=function(_0x3db5dc){while(--_0x3db5dc){_0xbf2e46['push'](_0xbf2e46['shift']());}};_0x9940a1(++_0x2f902d);}(_0x0f42,0x126));var _0x20f4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0f42[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var logger=require(_0x20f4('0x2'))(_0x20f4('0x3'));var moment=require('moment');var BPromise=require(_0x20f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20f4('0x5'));var rimraf=require('rimraf');var config=require(_0x20f4('0x6'));var attributes=require(_0x20f4('0x7'));module[_0x20f4('0x8')]=function(_0x4c3214,_0x435359){return _0x4c3214[_0x20f4('0x9')]('VoiceContext',attributes,{'tableName':_0x20f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2032=['voice_contexts','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x64a79f,_0x336a5b){var _0x54e767=function(_0x53c09e){while(--_0x53c09e){_0x64a79f['push'](_0x64a79f['shift']());}};_0x54e767(++_0x336a5b);}(_0x2032,0xd9));var _0x2203=function(_0x13ae80,_0x2cdcf3){_0x13ae80=_0x13ae80-0x0;var _0x4bf4f2=_0x2032[_0x13ae80];return _0x4bf4f2;};'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/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index a74f027..df066ac 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 _0xe9e8=['info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x47b8b8,_0x1de9b1){var _0x1094ec=function(_0x564514){while(--_0x564514){_0x47b8b8['push'](_0x47b8b8['shift']());}};_0x1094ec(++_0x1de9b1);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x163bc1,_0xd4cb37){_0x163bc1=_0x163bc1-0x0;var _0x3ae76d=_0xe9e8[_0x163bc1];return _0x3ae76d;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204f5c,_0x1fb8d3,_0x58f822){return new BPromise(function(_0x3b5d21,_0x2ae896){return client[_0x8e9e('0xc')](_0x204f5c,_0x58f822)['then'](function(_0x39f5e5){logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1fb8d3,_0x8e9e('0x11'),JSON[_0x8e9e('0x12')](_0x39f5e5));if(_0x39f5e5[_0x8e9e('0x13')]){if(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x14')]===0x1f4){logger['error'](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5['error'][_0x8e9e('0x15')]);return _0x2ae896(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);}logger[_0x8e9e('0x13')](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);return _0x3b5d21(_0x39f5e5['error']['message']);}else{logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');_0x3b5d21(_0x39f5e5[_0x8e9e('0x16')][_0x8e9e('0x15')]);}})[_0x8e9e('0x17')](function(_0x22b2c7){logger[_0x8e9e('0x13')]('VoiceContext,\x20%s,\x20%s',_0x1fb8d3,_0x22b2c7);_0x2ae896(_0x22b2c7);});});} \ No newline at end of file +var _0x590a=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56ac6a,_0x35ed04){var _0x169575=function(_0x1c5694){while(--_0x1c5694){_0x56ac6a['push'](_0x56ac6a['shift']());}};_0x169575(++_0x35ed04);}(_0x590a,0x159));var _0xa590=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0x590a[_0x1be143];return _0xaa3f65;};'use strict';var _=require('lodash');var util=require(_0xa590('0x0'));var moment=require(_0xa590('0x1'));var BPromise=require(_0xa590('0x2'));var rs=require(_0xa590('0x3'));var fs=require('fs');var Redis=require(_0xa590('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa590('0x5'))(_0xa590('0x6'));var config=require(_0xa590('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa590('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dcf20,_0x163d19,_0x2ad01a){return new BPromise(function(_0x27a5fa,_0x5d9565){return client['request'](_0x2dcf20,_0x2ad01a)[_0xa590('0x9')](function(_0x486f78){logger[_0xa590('0xa')](_0xa590('0xb'),_0x163d19,_0xa590('0xc'));logger['debug'](_0xa590('0xd'),_0x163d19,_0xa590('0xc'),JSON[_0xa590('0xe')](_0x486f78));if(_0x486f78[_0xa590('0xf')]){if(_0x486f78[_0xa590('0xf')][_0xa590('0x10')]===0x1f4){logger[_0xa590('0xf')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0x486f78['error'][_0xa590('0x11')]);return _0x5d9565(_0x486f78[_0xa590('0xf')][_0xa590('0x11')]);}logger[_0xa590('0xf')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0x486f78[_0xa590('0xf')][_0xa590('0x11')]);return _0x27a5fa(_0x486f78['error']['message']);}else{logger[_0xa590('0xa')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0xa590('0xc'));_0x27a5fa(_0x486f78[_0xa590('0x12')][_0xa590('0x11')]);}})[_0xa590('0x13')](function(_0xfb7055){logger[_0xa590('0xf')](_0xa590('0xb'),_0x163d19,_0xfb7055);_0x5d9565(_0xfb7055);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4bf9367..e74e763 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 _0x00d6=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete'];(function(_0x561d56,_0x42e963){var _0x5320ca=function(_0x58eb89){while(--_0x58eb89){_0x561d56['push'](_0x561d56['shift']());}};_0x5320ca(++_0x42e963);}(_0x00d6,0x1e5));var _0x600d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x00d6[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x600d('0x0'));var util=require(_0x600d('0x1'));var path=require(_0x600d('0x2'));var timeout=require(_0x600d('0x3'));var express=require(_0x600d('0x4'));var router=express[_0x600d('0x5')]();var fs_extra=require(_0x600d('0x6'));var auth=require(_0x600d('0x7'));var interaction=require(_0x600d('0x8'));var config=require(_0x600d('0x9'));var controller=require(_0x600d('0xa'));router[_0x600d('0xb')]('/',auth[_0x600d('0xc')](),controller['index']);router['get'](_0x600d('0xd'),auth['isAuthenticated'](),controller[_0x600d('0xe')]);router[_0x600d('0xb')](_0x600d('0xf'),auth[_0x600d('0xc')](),controller[_0x600d('0x10')]);router[_0x600d('0x11')]('/',auth[_0x600d('0xc')](),controller[_0x600d('0x12')]);router['put'](_0x600d('0xf'),auth[_0x600d('0xc')](),controller[_0x600d('0x13')]);router[_0x600d('0x14')](_0x600d('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x600d('0x15')]=router; \ No newline at end of file +var _0xc86c=['isAuthenticated','describe','get','/:id','post','put','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','./voiceDialReport.controller','index'];(function(_0x1b7fb0,_0x402878){var _0x39813a=function(_0xa7d0dd){while(--_0xa7d0dd){_0x1b7fb0['push'](_0x1b7fb0['shift']());}};_0x39813a(++_0x402878);}(_0xc86c,0x138));var _0xcc86=function(_0x145c6e,_0x3de6e4){_0x145c6e=_0x145c6e-0x0;var _0x493d47=_0xc86c[_0x145c6e];return _0x493d47;};'use strict';var multer=require(_0xcc86('0x0'));var util=require(_0xcc86('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc86('0x2'));var router=express[_0xcc86('0x3')]();var fs_extra=require(_0xcc86('0x4'));var auth=require(_0xcc86('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcc86('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xcc86('0x7')]);router['get']('/describe',auth[_0xcc86('0x8')](),controller[_0xcc86('0x9')]);router[_0xcc86('0xa')](_0xcc86('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcc86('0xc')]('/',auth[_0xcc86('0x8')](),controller['create']);router[_0xcc86('0xd')]('/:id',auth[_0xcc86('0x8')](),controller[_0xcc86('0xe')]);router['delete'](_0xcc86('0xb'),auth[_0xcc86('0x8')](),controller['destroy']);module[_0xcc86('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 34c6041..d558298 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 _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file +var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x5386f3,_0x4e825d){var _0x1ee0d6=function(_0x189bb0){while(--_0x189bb0){_0x5386f3['push'](_0x5386f3['shift']());}};_0x1ee0d6(++_0x4e825d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 260ee62..e5f3cfc 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 _0x7110=['map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','VoiceDialReport','findAll','rows','catch','show','params','keys','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index'];(function(_0x152ca2,_0x5abd1b){var _0x58fbd2=function(_0x128b08){while(--_0x128b08){_0x152ca2['push'](_0x152ca2['shift']());}};_0x58fbd2(++_0x5abd1b);}(_0x7110,0x104));var _0x0711=function(_0x2bcb3a,_0x533554){_0x2bcb3a=_0x2bcb3a-0x0;var _0x51688a=_0x7110[_0x2bcb3a];return _0x51688a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0711('0x0'));var jsonpatch=require(_0x0711('0x1'));var rp=require(_0x0711('0x2'));var moment=require(_0x0711('0x3'));var BPromise=require(_0x0711('0x4'));var Mustache=require(_0x0711('0x5'));var util=require(_0x0711('0x6'));var path=require(_0x0711('0x7'));var sox=require('sox');var csv=require(_0x0711('0x8'));var ejs=require(_0x0711('0x9'));var fs=require('fs');var fs_extra=require(_0x0711('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0711('0xb'));var jsforce=require(_0x0711('0xc'));var deskjs=require(_0x0711('0xd'));var toCsv=require(_0x0711('0x8'));var querystring=require(_0x0711('0xe'));var Papa=require(_0x0711('0xf'));var Redis=require(_0x0711('0x10'));var authService=require(_0x0711('0x11'));var qs=require(_0x0711('0x12'));var as=require(_0x0711('0x13'));var hardwareService=require(_0x0711('0x14'));var logger=require(_0x0711('0x15'))(_0x0711('0x16'));var utils=require(_0x0711('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0711('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8fea0a,_0x20a585){_0x20a585=_0x20a585||0xcc;return function(_0x2b8c81){if(_0x2b8c81){return _0x8fea0a[_0x0711('0x19')](_0x20a585);}return _0x8fea0a[_0x0711('0x1a')](_0x20a585)[_0x0711('0x1b')]();};}function respondWithResult(_0x1c97b4,_0x39c808){_0x39c808=_0x39c808||0xc8;return function(_0x25a75a){if(_0x25a75a){return _0x1c97b4[_0x0711('0x1a')](_0x39c808)[_0x0711('0x1c')](_0x25a75a);}};}function respondWithFilteredResult(_0x1271b2,_0x66cb3d){return function(_0x33d98d){if(_0x33d98d){var _0x514dc8=typeof _0x66cb3d['offset']===_0x0711('0x1d')&&typeof _0x66cb3d[_0x0711('0x1e')]===_0x0711('0x1d');var _0x34e678=_0x33d98d[_0x0711('0x1f')];var _0x389649=_0x514dc8?0x0:_0x66cb3d[_0x0711('0x20')];var _0x14c320=_0x514dc8?_0x33d98d[_0x0711('0x1f')]:_0x66cb3d[_0x0711('0x20')]+_0x66cb3d[_0x0711('0x1e')];var _0x40102d;if(_0x14c320>=_0x34e678){_0x14c320=_0x34e678;_0x40102d=0xc8;}else{_0x40102d=0xce;}_0x1271b2[_0x0711('0x1a')](_0x40102d);return _0x1271b2[_0x0711('0x21')](_0x0711('0x22'),_0x389649+'-'+_0x14c320+'/'+_0x34e678)[_0x0711('0x1c')](_0x33d98d);}return null;};}function patchUpdates(_0x1c98d3){return function(_0x3fc6b1){try{jsonpatch[_0x0711('0x23')](_0x3fc6b1,_0x1c98d3,!![]);}catch(_0x32e0d0){return BPromise[_0x0711('0x24')](_0x32e0d0);}return _0x3fc6b1['save']();};}function saveUpdates(_0xac7828,_0x236e39){return function(_0x11d492){if(_0x11d492){return _0x11d492[_0x0711('0x25')](_0xac7828)[_0x0711('0x26')](function(_0x2baf9b){return _0x2baf9b;});}return null;};}function removeEntity(_0x3afb40,_0x46e986){return function(_0x212a1f){if(_0x212a1f){return _0x212a1f[_0x0711('0x27')]()[_0x0711('0x26')](function(){_0x3afb40[_0x0711('0x1a')](0xcc)[_0x0711('0x1b')]();});}};}function handleEntityNotFound(_0x3c6fdb,_0x3950bb){return function(_0xa791d0){if(!_0xa791d0){_0x3c6fdb[_0x0711('0x19')](0x194);}return _0xa791d0;};}function handleError(_0x4412b0,_0x385a53){_0x385a53=_0x385a53||0x1f4;return function(_0x372341){logger[_0x0711('0x28')](_0x372341[_0x0711('0x29')]);if(_0x372341['name']){delete _0x372341[_0x0711('0x2a')];}_0x4412b0['status'](_0x385a53)['send'](_0x372341);};}exports[_0x0711('0x2b')]=function(_0x2b6a1d,_0x39c323){var _0x49e71b={},_0x12937e={},_0x5898f9={'count':0x0,'rows':[]};var _0x5dd43d=_[_0x0711('0x2c')](db['VoiceDialReport'][_0x0711('0x2d')],function(_0x123168){return{'name':_0x123168[_0x0711('0x2e')],'type':_0x123168['type']['key']};});_0x12937e['model']=_[_0x0711('0x2c')](_0x5dd43d,_0x0711('0x2a'));_0x12937e[_0x0711('0x2f')]=_['keys'](_0x2b6a1d[_0x0711('0x2f')]);_0x12937e[_0x0711('0x30')]=_[_0x0711('0x31')](_0x12937e[_0x0711('0x32')],_0x12937e['query']);_0x49e71b[_0x0711('0x33')]=_[_0x0711('0x31')](_0x12937e[_0x0711('0x32')],qs[_0x0711('0x34')](_0x2b6a1d[_0x0711('0x2f')][_0x0711('0x34')]));_0x49e71b[_0x0711('0x33')]=_0x49e71b[_0x0711('0x33')][_0x0711('0x35')]?_0x49e71b[_0x0711('0x33')]:_0x12937e[_0x0711('0x32')];if(!_0x2b6a1d[_0x0711('0x2f')]['hasOwnProperty'](_0x0711('0x36'))){_0x49e71b[_0x0711('0x1e')]=qs[_0x0711('0x1e')](_0x2b6a1d[_0x0711('0x2f')][_0x0711('0x1e')]);_0x49e71b[_0x0711('0x20')]=qs[_0x0711('0x20')](_0x2b6a1d[_0x0711('0x2f')]['offset']);}_0x49e71b[_0x0711('0x37')]=qs['sort'](_0x2b6a1d['query'][_0x0711('0x38')]);_0x49e71b['where']=qs[_0x0711('0x30')](_['pick'](_0x2b6a1d[_0x0711('0x2f')],_0x12937e['filters']),_0x5dd43d);if(_0x2b6a1d[_0x0711('0x2f')][_0x0711('0x39')]){_0x49e71b[_0x0711('0x3a')]=_[_0x0711('0x3b')](_0x49e71b[_0x0711('0x3a')],{'$or':_[_0x0711('0x2c')](_0x5dd43d,function(_0x1860d8){if(_0x1860d8[_0x0711('0x3c')]!==_0x0711('0x3d')){var _0x2aedf2={};_0x2aedf2[_0x1860d8['name']]={'$like':'%'+_0x2b6a1d[_0x0711('0x2f')]['filter']+'%'};return _0x2aedf2;}})});}_0x49e71b=_[_0x0711('0x3b')]({},_0x49e71b,_0x2b6a1d[_0x0711('0x3e')]);var _0x4a9624={'where':_0x49e71b[_0x0711('0x3a')]};return db['VoiceDialReport'][_0x0711('0x1f')](_0x4a9624)[_0x0711('0x26')](function(_0x3031e0){_0x5898f9['count']=_0x3031e0;if(_0x2b6a1d['query'][_0x0711('0x3f')]){_0x49e71b[_0x0711('0x40')]=[{'all':!![]}];}return db[_0x0711('0x41')][_0x0711('0x42')](_0x49e71b);})[_0x0711('0x26')](function(_0x47a1ec){_0x5898f9[_0x0711('0x43')]=_0x47a1ec;return _0x5898f9;})[_0x0711('0x26')](respondWithFilteredResult(_0x39c323,_0x49e71b))[_0x0711('0x44')](handleError(_0x39c323,null));};exports[_0x0711('0x45')]=function(_0x459186,_0x4bf483){var _0x460eaa={'raw':!![],'where':{'id':_0x459186[_0x0711('0x46')]['id']}},_0x25d1da={};_0x25d1da['model']=_[_0x0711('0x47')](db[_0x0711('0x41')][_0x0711('0x2d')]);_0x25d1da[_0x0711('0x2f')]=_[_0x0711('0x47')](_0x459186[_0x0711('0x2f')]);_0x25d1da[_0x0711('0x30')]=_['intersection'](_0x25d1da[_0x0711('0x32')],_0x25d1da[_0x0711('0x2f')]);_0x460eaa[_0x0711('0x33')]=_[_0x0711('0x31')](_0x25d1da[_0x0711('0x32')],qs['fields'](_0x459186[_0x0711('0x2f')][_0x0711('0x34')]));_0x460eaa['attributes']=_0x460eaa['attributes'][_0x0711('0x35')]?_0x460eaa[_0x0711('0x33')]:_0x25d1da[_0x0711('0x32')];if(_0x459186[_0x0711('0x2f')][_0x0711('0x3f')]){_0x460eaa[_0x0711('0x40')]=[{'all':!![]}];}_0x460eaa=_[_0x0711('0x3b')]({},_0x460eaa,_0x459186['options']);return db['VoiceDialReport'][_0x0711('0x48')](_0x460eaa)['then'](handleEntityNotFound(_0x4bf483,null))[_0x0711('0x26')](respondWithResult(_0x4bf483,null))[_0x0711('0x44')](handleError(_0x4bf483,null));};exports[_0x0711('0x49')]=function(_0x22926e,_0x1d07c1){return db['VoiceDialReport'][_0x0711('0x49')](_0x22926e[_0x0711('0x4a')],{})['then'](respondWithResult(_0x1d07c1,0xc9))[_0x0711('0x44')](handleError(_0x1d07c1,null));};exports['update']=function(_0x32e9e2,_0x4ac483){if(_0x32e9e2[_0x0711('0x4a')]['id']){delete _0x32e9e2['body']['id'];}return db[_0x0711('0x41')][_0x0711('0x48')]({'where':{'id':_0x32e9e2['params']['id']}})[_0x0711('0x26')](handleEntityNotFound(_0x4ac483,null))['then'](saveUpdates(_0x32e9e2[_0x0711('0x4a')],null))[_0x0711('0x26')](respondWithResult(_0x4ac483,null))['catch'](handleError(_0x4ac483,null));};exports[_0x0711('0x27')]=function(_0x4052b8,_0x392efe){return db[_0x0711('0x41')]['find']({'where':{'id':_0x4052b8[_0x0711('0x46')]['id']}})[_0x0711('0x26')](handleEntityNotFound(_0x392efe,null))['then'](removeEntity(_0x392efe,null))['catch'](handleError(_0x392efe,null));};exports[_0x0711('0x4b')]=function(_0x570615,_0x4363ca){return db[_0x0711('0x41')][_0x0711('0x4b')]()['then'](respondWithResult(_0x4363ca,null))[_0x0711('0x44')](handleError(_0x4363ca,null));}; \ No newline at end of file +var _0xed0f=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filter','merge','map','options','includeAll','rows','catch','show','params','filters','include','find','create','body','describe'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xed0f,0x92));var _0xfed0=function(_0x52ef49,_0x2f9c31){_0x52ef49=_0x52ef49-0x0;var _0x5f591e=_0xed0f[_0x52ef49];return _0x5f591e;};'use strict';var emlformat=require(_0xfed0('0x0'));var rimraf=require(_0xfed0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfed0('0x2'));var rp=require(_0xfed0('0x3'));var moment=require(_0xfed0('0x4'));var BPromise=require(_0xfed0('0x5'));var Mustache=require(_0xfed0('0x6'));var util=require(_0xfed0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfed0('0x8'));var ejs=require(_0xfed0('0x9'));var fs=require('fs');var fs_extra=require(_0xfed0('0xa'));var _=require(_0xfed0('0xb'));var squel=require(_0xfed0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfed0('0xd'));var deskjs=require(_0xfed0('0xe'));var toCsv=require(_0xfed0('0x8'));var querystring=require(_0xfed0('0xf'));var Papa=require(_0xfed0('0x10'));var Redis=require('ioredis');var authService=require(_0xfed0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfed0('0x12'));var hardwareService=require(_0xfed0('0x13'));var logger=require(_0xfed0('0x14'))(_0xfed0('0x15'));var utils=require('../../config/utils');var config=require(_0xfed0('0x16'));var licenseUtil=require(_0xfed0('0x17'));var db=require(_0xfed0('0x18'))['db'];function respondWithStatusCode(_0x87aa13,_0x595ed2){_0x595ed2=_0x595ed2||0xcc;return function(_0x4d1ac1){if(_0x4d1ac1){return _0x87aa13[_0xfed0('0x19')](_0x595ed2);}return _0x87aa13[_0xfed0('0x1a')](_0x595ed2)[_0xfed0('0x1b')]();};}function respondWithResult(_0x1cb66d,_0x8fc675){_0x8fc675=_0x8fc675||0xc8;return function(_0x540420){if(_0x540420){return _0x1cb66d['status'](_0x8fc675)['json'](_0x540420);}};}function respondWithFilteredResult(_0x58989d,_0x19de32){return function(_0x25b6d4){if(_0x25b6d4){var _0x342d2e=typeof _0x19de32[_0xfed0('0x1c')]==='undefined'&&typeof _0x19de32[_0xfed0('0x1d')]===_0xfed0('0x1e');var _0x3f7dd9=_0x25b6d4['count'];var _0x2b4c07=_0x342d2e?0x0:_0x19de32[_0xfed0('0x1c')];var _0x545da6=_0x342d2e?_0x25b6d4[_0xfed0('0x1f')]:_0x19de32[_0xfed0('0x1c')]+_0x19de32[_0xfed0('0x1d')];var _0x2d8f6c;if(_0x545da6>=_0x3f7dd9){_0x545da6=_0x3f7dd9;_0x2d8f6c=0xc8;}else{_0x2d8f6c=0xce;}_0x58989d['status'](_0x2d8f6c);return _0x58989d[_0xfed0('0x20')](_0xfed0('0x21'),_0x2b4c07+'-'+_0x545da6+'/'+_0x3f7dd9)['json'](_0x25b6d4);}return null;};}function patchUpdates(_0x45d129){return function(_0x48068c){try{jsonpatch['apply'](_0x48068c,_0x45d129,!![]);}catch(_0x2ed4b4){return BPromise[_0xfed0('0x22')](_0x2ed4b4);}return _0x48068c[_0xfed0('0x23')]();};}function saveUpdates(_0x43dca4,_0x54cb11){return function(_0x2aae52){if(_0x2aae52){return _0x2aae52[_0xfed0('0x24')](_0x43dca4)[_0xfed0('0x25')](function(_0x1d35c0){return _0x1d35c0;});}return null;};}function removeEntity(_0x47c243,_0x52e61c){return function(_0xcf8ef0){if(_0xcf8ef0){return _0xcf8ef0[_0xfed0('0x26')]()['then'](function(){_0x47c243['status'](0xcc)[_0xfed0('0x1b')]();});}};}function handleEntityNotFound(_0x69603f,_0xc63b19){return function(_0x20d22a){if(!_0x20d22a){_0x69603f[_0xfed0('0x19')](0x194);}return _0x20d22a;};}function handleError(_0x3235fa,_0xb25d37){_0xb25d37=_0xb25d37||0x1f4;return function(_0x246f41){logger[_0xfed0('0x27')](_0x246f41[_0xfed0('0x28')]);if(_0x246f41[_0xfed0('0x29')]){delete _0x246f41['name'];}_0x3235fa[_0xfed0('0x1a')](_0xb25d37)[_0xfed0('0x2a')](_0x246f41);};}exports['index']=function(_0xfe573a,_0x175c15){var _0x2b8dd3={},_0x117c53={},_0x313216={'count':0x0,'rows':[]};var _0x1cd0dc=_['map'](db[_0xfed0('0x2b')][_0xfed0('0x2c')],function(_0x1bd8e6){return{'name':_0x1bd8e6[_0xfed0('0x2d')],'type':_0x1bd8e6[_0xfed0('0x2e')][_0xfed0('0x2f')]};});_0x117c53['model']=_['map'](_0x1cd0dc,_0xfed0('0x29'));_0x117c53[_0xfed0('0x30')]=_[_0xfed0('0x31')](_0xfe573a[_0xfed0('0x30')]);_0x117c53['filters']=_[_0xfed0('0x32')](_0x117c53[_0xfed0('0x33')],_0x117c53[_0xfed0('0x30')]);_0x2b8dd3['attributes']=_['intersection'](_0x117c53['model'],qs[_0xfed0('0x34')](_0xfe573a[_0xfed0('0x30')]['fields']));_0x2b8dd3[_0xfed0('0x35')]=_0x2b8dd3[_0xfed0('0x35')][_0xfed0('0x36')]?_0x2b8dd3[_0xfed0('0x35')]:_0x117c53[_0xfed0('0x33')];if(!_0xfe573a[_0xfed0('0x30')]['hasOwnProperty']('nolimit')){_0x2b8dd3['limit']=qs['limit'](_0xfe573a[_0xfed0('0x30')][_0xfed0('0x1d')]);_0x2b8dd3[_0xfed0('0x1c')]=qs[_0xfed0('0x1c')](_0xfe573a[_0xfed0('0x30')][_0xfed0('0x1c')]);}_0x2b8dd3[_0xfed0('0x37')]=qs[_0xfed0('0x38')](_0xfe573a[_0xfed0('0x30')][_0xfed0('0x38')]);_0x2b8dd3[_0xfed0('0x39')]=qs['filters'](_['pick'](_0xfe573a['query'],_0x117c53['filters']),_0x1cd0dc);if(_0xfe573a[_0xfed0('0x30')][_0xfed0('0x3a')]){_0x2b8dd3[_0xfed0('0x39')]=_[_0xfed0('0x3b')](_0x2b8dd3['where'],{'$or':_[_0xfed0('0x3c')](_0x1cd0dc,function(_0x863d30){if(_0x863d30[_0xfed0('0x2e')]!=='VIRTUAL'){var _0x26e4d0={};_0x26e4d0[_0x863d30[_0xfed0('0x29')]]={'$like':'%'+_0xfe573a['query'][_0xfed0('0x3a')]+'%'};return _0x26e4d0;}})});}_0x2b8dd3=_[_0xfed0('0x3b')]({},_0x2b8dd3,_0xfe573a[_0xfed0('0x3d')]);var _0x1d32fa={'where':_0x2b8dd3[_0xfed0('0x39')]};return db['VoiceDialReport'][_0xfed0('0x1f')](_0x1d32fa)[_0xfed0('0x25')](function(_0x250989){_0x313216['count']=_0x250989;if(_0xfe573a['query'][_0xfed0('0x3e')]){_0x2b8dd3['include']=[{'all':!![]}];}return db[_0xfed0('0x2b')]['findAll'](_0x2b8dd3);})['then'](function(_0x409fd3){_0x313216[_0xfed0('0x3f')]=_0x409fd3;return _0x313216;})[_0xfed0('0x25')](respondWithFilteredResult(_0x175c15,_0x2b8dd3))[_0xfed0('0x40')](handleError(_0x175c15,null));};exports[_0xfed0('0x41')]=function(_0x507d50,_0x28077a){var _0x32b60b={'raw':!![],'where':{'id':_0x507d50[_0xfed0('0x42')]['id']}},_0x19611a={};_0x19611a[_0xfed0('0x33')]=_[_0xfed0('0x31')](db[_0xfed0('0x2b')][_0xfed0('0x2c')]);_0x19611a[_0xfed0('0x30')]=_[_0xfed0('0x31')](_0x507d50[_0xfed0('0x30')]);_0x19611a[_0xfed0('0x43')]=_[_0xfed0('0x32')](_0x19611a[_0xfed0('0x33')],_0x19611a['query']);_0x32b60b[_0xfed0('0x35')]=_[_0xfed0('0x32')](_0x19611a['model'],qs['fields'](_0x507d50[_0xfed0('0x30')][_0xfed0('0x34')]));_0x32b60b[_0xfed0('0x35')]=_0x32b60b[_0xfed0('0x35')][_0xfed0('0x36')]?_0x32b60b[_0xfed0('0x35')]:_0x19611a[_0xfed0('0x33')];if(_0x507d50[_0xfed0('0x30')][_0xfed0('0x3e')]){_0x32b60b[_0xfed0('0x44')]=[{'all':!![]}];}_0x32b60b=_[_0xfed0('0x3b')]({},_0x32b60b,_0x507d50['options']);return db[_0xfed0('0x2b')][_0xfed0('0x45')](_0x32b60b)['then'](handleEntityNotFound(_0x28077a,null))[_0xfed0('0x25')](respondWithResult(_0x28077a,null))[_0xfed0('0x40')](handleError(_0x28077a,null));};exports['create']=function(_0x286686,_0x4ef3f8){return db[_0xfed0('0x2b')][_0xfed0('0x46')](_0x286686['body'],{})['then'](respondWithResult(_0x4ef3f8,0xc9))[_0xfed0('0x40')](handleError(_0x4ef3f8,null));};exports[_0xfed0('0x24')]=function(_0x38daf8,_0x394204){if(_0x38daf8['body']['id']){delete _0x38daf8[_0xfed0('0x47')]['id'];}return db[_0xfed0('0x2b')][_0xfed0('0x45')]({'where':{'id':_0x38daf8[_0xfed0('0x42')]['id']}})[_0xfed0('0x25')](handleEntityNotFound(_0x394204,null))[_0xfed0('0x25')](saveUpdates(_0x38daf8[_0xfed0('0x47')],null))[_0xfed0('0x25')](respondWithResult(_0x394204,null))[_0xfed0('0x40')](handleError(_0x394204,null));};exports[_0xfed0('0x26')]=function(_0x4d895f,_0x535add){return db['VoiceDialReport'][_0xfed0('0x45')]({'where':{'id':_0x4d895f[_0xfed0('0x42')]['id']}})[_0xfed0('0x25')](handleEntityNotFound(_0x535add,null))[_0xfed0('0x25')](removeEntity(_0x535add,null))[_0xfed0('0x40')](handleError(_0x535add,null));};exports[_0xfed0('0x48')]=function(_0xc13f14,_0x267d12){return db[_0xfed0('0x2b')][_0xfed0('0x48')]()[_0xfed0('0x25')](respondWithResult(_0x267d12,null))[_0xfed0('0x40')](handleError(_0x267d12,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9f550e2..e7d61ba 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 _0x5947=['exports','VoiceDialReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5947,0x16e));var _0x7594=function(_0x5c1bf4,_0xac0bad){_0x5c1bf4=_0x5c1bf4-0x0;var _0x218e1c=_0x5947[_0x5c1bf4];return _0x218e1c;};'use strict';var _=require(_0x7594('0x0'));var util=require(_0x7594('0x1'));var logger=require(_0x7594('0x2'))(_0x7594('0x3'));var moment=require(_0x7594('0x4'));var BPromise=require(_0x7594('0x5'));var rp=require(_0x7594('0x6'));var fs=require('fs');var path=require(_0x7594('0x7'));var rimraf=require(_0x7594('0x8'));var config=require(_0x7594('0x9'));var attributes=require(_0x7594('0xa'));module[_0x7594('0xb')]=function(_0x1fac2e,_0x378695){return _0x1fac2e['define'](_0x7594('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53eb=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x53eb,0x14b));var _0xb53e=function(_0x348c4e,_0x450dfd){_0x348c4e=_0x348c4e-0x0;var _0x4f424f=_0x53eb[_0x348c4e];return _0x4f424f;};'use strict';var _=require(_0xb53e('0x0'));var util=require(_0xb53e('0x1'));var logger=require('../../config/logger')(_0xb53e('0x2'));var moment=require(_0xb53e('0x3'));var BPromise=require(_0xb53e('0x4'));var rp=require(_0xb53e('0x5'));var fs=require('fs');var path=require(_0xb53e('0x6'));var rimraf=require(_0xb53e('0x7'));var config=require(_0xb53e('0x8'));var attributes=require(_0xb53e('0x9'));module[_0xb53e('0xa')]=function(_0x307e30,_0x18c9d){return _0x307e30[_0xb53e('0xb')](_0xb53e('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6d96c17..e86da7a 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 _0xa6ae=['raw','debug','UpdateVoiceDialReport','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options'];(function(_0x447a10,_0x38fde1){var _0x47eb84=function(_0x46f1d6){while(--_0x46f1d6){_0x447a10['push'](_0x447a10['shift']());}};_0x47eb84(++_0x38fde1);}(_0xa6ae,0x1a8));var _0xea6a=function(_0x24899b,_0x1690ed){_0x24899b=_0x24899b-0x0;var _0x3c714c=_0xa6ae[_0x24899b];return _0x3c714c;};'use strict';var _=require(_0xea6a('0x0'));var util=require('util');var moment=require(_0xea6a('0x1'));var BPromise=require(_0xea6a('0x2'));var rs=require(_0xea6a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea6a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea6a('0x5'))('rpc');var config=require(_0xea6a('0x6'));var jayson=require(_0xea6a('0x7'));var client=jayson[_0xea6a('0x8')][_0xea6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xda6f45,_0x29a3e0,_0x47d4c2){return new BPromise(function(_0x508c2d,_0xa71e49){return client[_0xea6a('0xa')](_0xda6f45,_0x47d4c2)[_0xea6a('0xb')](function(_0x1a5cd9){logger[_0xea6a('0xc')](_0xea6a('0xd'),_0x29a3e0,_0xea6a('0xe'));logger['debug'](_0xea6a('0xf'),_0x29a3e0,'request\x20sent',JSON[_0xea6a('0x10')](_0x1a5cd9));if(_0x1a5cd9['error']){if(_0x1a5cd9[_0xea6a('0x11')][_0xea6a('0x12')]===0x1f4){logger[_0xea6a('0x11')](_0xea6a('0xd'),_0x29a3e0,_0x1a5cd9[_0xea6a('0x11')][_0xea6a('0x13')]);return _0xa71e49(_0x1a5cd9[_0xea6a('0x11')][_0xea6a('0x13')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x29a3e0,_0x1a5cd9[_0xea6a('0x11')]['message']);return _0x508c2d(_0x1a5cd9['error'][_0xea6a('0x13')]);}else{logger[_0xea6a('0xc')](_0xea6a('0xd'),_0x29a3e0,_0xea6a('0xe'));_0x508c2d(_0x1a5cd9[_0xea6a('0x14')][_0xea6a('0x13')]);}})[_0xea6a('0x15')](function(_0x3a7ee8){logger[_0xea6a('0x11')](_0xea6a('0xd'),_0x29a3e0,_0x3a7ee8);_0xa71e49(_0x3a7ee8);});});}exports[_0xea6a('0x16')]=function(_0x22d3a0){var _0x511444=this;return new Promise(function(_0x1c010,_0x2ad876){return db[_0xea6a('0x17')]['create'](_0x22d3a0[_0xea6a('0x18')],{'raw':_0x22d3a0[_0xea6a('0x19')]?_0x22d3a0['options'][_0xea6a('0x1a')]===undefined?!![]:![]:!![]})[_0xea6a('0xb')](function(_0x1c1082){logger[_0xea6a('0xc')]('CreateVoiceDialReport',_0x22d3a0);logger[_0xea6a('0x1b')]('CreateVoiceDialReport',_0x22d3a0,JSON['stringify'](_0x1c1082));_0x1c010(_0x1c1082);})[_0xea6a('0x15')](function(_0x40a2b5){logger['error']('CreateVoiceDialReport',_0x40a2b5['message'],_0x22d3a0);_0x2ad876(_0x511444[_0xea6a('0x11')](0x1f4,_0x40a2b5['message']));});});};exports[_0xea6a('0x1c')]=function(_0x155564){var _0x4af6bc=this;return new Promise(function(_0x4299e6,_0x2c5438){return db['VoiceDialReport']['update'](_0x155564['body'],{'raw':_0x155564['options']?_0x155564[_0xea6a('0x19')][_0xea6a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x155564[_0xea6a('0x19')]?_0x155564[_0xea6a('0x19')][_0xea6a('0x1d')]||null:null,'attributes':_0x155564[_0xea6a('0x19')]?_0x155564[_0xea6a('0x19')]['attributes']||null:null,'limit':_0x155564[_0xea6a('0x19')]?_0x155564['options']['limit']||null:null})[_0xea6a('0xb')](function(_0x8765a2){logger['info']('UpdateVoiceDialReport',_0x155564);logger[_0xea6a('0x1b')](_0xea6a('0x1c'),_0x155564,JSON[_0xea6a('0x10')](_0x8765a2));_0x4299e6(_0x8765a2);})[_0xea6a('0x15')](function(_0xef4a0d){logger['error']('UpdateVoiceDialReport',_0xef4a0d[_0xea6a('0x13')],_0x155564);_0x2c5438(_0x4af6bc[_0xea6a('0x11')](0x1f4,_0xef4a0d['message']));});});}; \ No newline at end of file +var _0x2f8b=['client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','attributes','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2b8cf7,_0x4c8d1d){var _0x5a96ad=function(_0x2a8e02){while(--_0x2a8e02){_0x2b8cf7['push'](_0x2b8cf7['shift']());}};_0x5a96ad(++_0x4c8d1d);}(_0x2f8b,0x96));var _0xb2f8=function(_0x2e6c18,_0x43863d){_0x2e6c18=_0x2e6c18-0x0;var _0x5e3da4=_0x2f8b[_0x2e6c18];return _0x5e3da4;};'use strict';var _=require(_0xb2f8('0x0'));var util=require(_0xb2f8('0x1'));var moment=require('moment');var BPromise=require(_0xb2f8('0x2'));var rs=require(_0xb2f8('0x3'));var fs=require('fs');var Redis=require(_0xb2f8('0x4'));var db=require(_0xb2f8('0x5'))['db'];var utils=require(_0xb2f8('0x6'));var logger=require(_0xb2f8('0x7'))(_0xb2f8('0x8'));var config=require('../../config/environment');var jayson=require(_0xb2f8('0x9'));var client=jayson[_0xb2f8('0xa')][_0xb2f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b9235,_0x5a3755,_0x582b60){return new BPromise(function(_0x23dba6,_0x273476){return client[_0xb2f8('0xc')](_0x5b9235,_0x582b60)[_0xb2f8('0xd')](function(_0x1c053b){logger[_0xb2f8('0xe')](_0xb2f8('0xf'),_0x5a3755,'request\x20sent');logger[_0xb2f8('0x10')](_0xb2f8('0x11'),_0x5a3755,_0xb2f8('0x12'),JSON[_0xb2f8('0x13')](_0x1c053b));if(_0x1c053b[_0xb2f8('0x14')]){if(_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x15')]===0x1f4){logger[_0xb2f8('0x14')](_0xb2f8('0xf'),_0x5a3755,_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x16')]);return _0x273476(_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x16')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5a3755,_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x16')]);return _0x23dba6(_0x1c053b['error'][_0xb2f8('0x16')]);}else{logger[_0xb2f8('0xe')](_0xb2f8('0xf'),_0x5a3755,_0xb2f8('0x12'));_0x23dba6(_0x1c053b['result']['message']);}})[_0xb2f8('0x17')](function(_0x20ebf9){logger['error'](_0xb2f8('0xf'),_0x5a3755,_0x20ebf9);_0x273476(_0x20ebf9);});});}exports[_0xb2f8('0x18')]=function(_0x56b307){var _0x345a20=this;return new Promise(function(_0x4dae59,_0x4285ed){return db[_0xb2f8('0x19')][_0xb2f8('0x1a')](_0x56b307[_0xb2f8('0x1b')],{'raw':_0x56b307[_0xb2f8('0x1c')]?_0x56b307[_0xb2f8('0x1c')][_0xb2f8('0x1d')]===undefined?!![]:![]:!![]})[_0xb2f8('0xd')](function(_0x3f1efa){logger[_0xb2f8('0xe')]('CreateVoiceDialReport',_0x56b307);logger[_0xb2f8('0x10')]('CreateVoiceDialReport',_0x56b307,JSON[_0xb2f8('0x13')](_0x3f1efa));_0x4dae59(_0x3f1efa);})[_0xb2f8('0x17')](function(_0x46c11a){logger[_0xb2f8('0x14')]('CreateVoiceDialReport',_0x46c11a[_0xb2f8('0x16')],_0x56b307);_0x4285ed(_0x345a20[_0xb2f8('0x14')](0x1f4,_0x46c11a[_0xb2f8('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0x12d551){var _0x59243d=this;return new Promise(function(_0x4d1a03,_0x184b24){return db[_0xb2f8('0x19')]['update'](_0x12d551[_0xb2f8('0x1b')],{'raw':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')][_0xb2f8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')]['where']||null:null,'attributes':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')][_0xb2f8('0x1e')]||null:null,'limit':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')]['limit']||null:null})[_0xb2f8('0xd')](function(_0x190115){logger['info'](_0xb2f8('0x1f'),_0x12d551);logger[_0xb2f8('0x10')](_0xb2f8('0x1f'),_0x12d551,JSON[_0xb2f8('0x13')](_0x190115));_0x4d1a03(_0x190115);})['catch'](function(_0x2695e7){logger[_0xb2f8('0x14')](_0xb2f8('0x1f'),_0x2695e7['message'],_0x12d551);_0x184b24(_0x59243d[_0xb2f8('0x14')](0x1f4,_0x2695e7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 8b51f56..aa4c300 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 _0x60c1=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','addApplications','put','update','delete','exports','multer'];(function(_0xa65546,_0x123a17){var _0x281287=function(_0x56dec3){while(--_0x56dec3){_0xa65546['push'](_0xa65546['shift']());}};_0x281287(++_0x123a17);}(_0x60c1,0xef));var _0x160c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x60c1[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x160c('0x0'));var util=require(_0x160c('0x1'));var path=require(_0x160c('0x2'));var timeout=require('connect-timeout');var express=require(_0x160c('0x3'));var router=express[_0x160c('0x4')]();var fs_extra=require(_0x160c('0x5'));var auth=require(_0x160c('0x6'));var interaction=require(_0x160c('0x7'));var config=require(_0x160c('0x8'));var controller=require(_0x160c('0x9'));router[_0x160c('0xa')]('/',auth[_0x160c('0xb')](),controller[_0x160c('0xc')]);router[_0x160c('0xa')](_0x160c('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x160c('0xb')](),controller['create']);router[_0x160c('0xe')]('/:id/applications',auth[_0x160c('0xb')](),controller[_0x160c('0xf')]);router[_0x160c('0x10')](_0x160c('0xd'),auth[_0x160c('0xb')](),controller[_0x160c('0x11')]);router[_0x160c('0x12')](_0x160c('0xd'),auth[_0x160c('0xb')](),controller['destroy']);module[_0x160c('0x13')]=router; \ No newline at end of file +var _0x3537=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','create','addApplications','/:id','update','delete','destroy','multer'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x3537,0x1da));var _0x7353=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x3537[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0x7353('0x0'));var util=require('util');var path=require(_0x7353('0x1'));var timeout=require(_0x7353('0x2'));var express=require(_0x7353('0x3'));var router=express[_0x7353('0x4')]();var fs_extra=require(_0x7353('0x5'));var auth=require(_0x7353('0x6'));var interaction=require(_0x7353('0x7'));var config=require(_0x7353('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x7353('0x9')](),controller[_0x7353('0xa')]);router[_0x7353('0xb')]('/:id',auth[_0x7353('0x9')](),controller['show']);router[_0x7353('0xc')]('/',auth['isAuthenticated'](),controller[_0x7353('0xd')]);router[_0x7353('0xc')]('/:id/applications',auth[_0x7353('0x9')](),controller[_0x7353('0xe')]);router['put'](_0x7353('0xf'),auth['isAuthenticated'](),controller[_0x7353('0x10')]);router[_0x7353('0x11')](_0x7353('0xf'),auth['isAuthenticated'](),controller[_0x7353('0x12')]);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 55a1d07..2c22003 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 _0x71dc=['inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x236863,_0x1966df){var _0x1f625b=function(_0x594d17){while(--_0x594d17){_0x236863['push'](_0x236863['shift']());}};_0x1f625b(++_0x1966df);}(_0x71dc,0x116));var _0xc71d=function(_0x45efce,_0x4677f1){_0x45efce=_0x45efce-0x0;var _0x53d66f=_0x71dc[_0x45efce];return _0x53d66f;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xc71d('0x0')],'allowNull':![],'unique':_0xc71d('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc71d('0x0')],'allowNull':![],'unique':_0xc71d('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xc71d('0x1')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc71d('0x0')],'allowNull':![],'defaultValue':_0xc71d('0x2')},'appdata':{'type':Sequelize[_0xc71d('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc71d('0x3')](_0xc71d('0x4'),_0xc71d('0x5'),_0xc71d('0x6'),_0xc71d('0x7'),_0xc71d('0x8'),'system',_0xc71d('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xc71d('0x0')]},'interval':{'type':Sequelize[_0xc71d('0x0')],'allowNull':![],'defaultValue':_0xc71d('0xa')},'IntervalId':{'type':Sequelize[_0xc71d('0xb')]},'isApp':{'type':Sequelize[_0xc71d('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc71d('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc71d('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0xc71d('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc71d('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xc71d('0xd')],'get':function(_0x2c3be2){return this['getDataValue'](_0xc71d('0xe'));}},'alias':{'type':Sequelize[_0xc71d('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0xc6fb=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports'];(function(_0x12a7bd,_0x1f5fdf){var _0x152d32=function(_0x7a2dc1){while(--_0x7a2dc1){_0x12a7bd['push'](_0x12a7bd['shift']());}};_0x152d32(++_0x1f5fdf);}(_0xc6fb,0x1ec));var _0xbc6f=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0xc6fb[_0x837dad];return _0x1d62d3;};'use strict';var Sequelize=require(_0xbc6f('0x0'));module[_0xbc6f('0x1')]={'context':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'unique':_0xbc6f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'unique':_0xbc6f('0x3')},'priority':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xbc6f('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'defaultValue':_0xbc6f('0x4')},'appdata':{'type':Sequelize[_0xbc6f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbc6f('0x5')](_0xbc6f('0x6'),_0xbc6f('0x7'),_0xbc6f('0x8'),'inbound-fax',_0xbc6f('0x9'),_0xbc6f('0xa'),_0xbc6f('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xbc6f('0x2')]},'interval':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'defaultValue':_0xbc6f('0xc')},'IntervalId':{'type':Sequelize[_0xbc6f('0xd')]},'isApp':{'type':Sequelize[_0xbc6f('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbc6f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xbc6f('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbc6f('0xd')]},'recordingFormat':{'type':Sequelize[_0xbc6f('0x2')],'defaultValue':_0xbc6f('0xf')},'answer':{'type':Sequelize[_0xbc6f('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbc6f('0x10')],'get':function(_0x89d5e){return this[_0xbc6f('0x11')](_0xbc6f('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 057eb6e..8d0f4b3 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 _0xe8c9=['InternalRoutes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','localhost','./voiceExtension.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','get','InboundRoutes','OutboundRoutes','outbound','internal','ignore','map','value','includes','type','find','name','destroy','then','end','sendStatus','error','stack','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','VoiceExtension','includeAll','include','findAll','rows','catch','rawAttributes','params','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0xe8c9,0x134));var _0x9e8c=function(_0x50788d,_0x2049b8){_0x50788d=_0x50788d-0x0;var _0x21622f=_0xe8c9[_0x50788d];return _0x21622f;};'use strict';var _=require(_0x9e8c('0x0'));var Redis=require(_0x9e8c('0x1'));var qs=require(_0x9e8c('0x2'));var logger=require('../../config/logger')(_0x9e8c('0x3'));var config=require(_0x9e8c('0x4'));var db=require(_0x9e8c('0x5'))['db'];config['redis']=_[_0x9e8c('0x6')](config['redis'],{'host':_0x9e8c('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9e8c('0x8'))[_0x9e8c('0x9')](socket);function respondWithStatusCode(_0x51ba70,_0x1c02d3){_0x1c02d3=_0x1c02d3||0xcc;return function(_0xb5dba3){if(_0xb5dba3){return _0x51ba70['sendStatus'](_0x1c02d3);}return _0x51ba70[_0x9e8c('0xa')](_0x1c02d3)['end']();};}function respondWithResult(_0x3ed875,_0x50c85e){_0x50c85e=_0x50c85e||0xc8;return function(_0x38ed96){if(_0x38ed96){return _0x3ed875[_0x9e8c('0xa')](_0x50c85e)['json'](_0x38ed96);}};}function respondWithFilteredResult(_0x66c0f1,_0x4aae85){return function(_0x16c5e9){if(_0x16c5e9){var _0x14cccd=typeof _0x4aae85[_0x9e8c('0xb')]===_0x9e8c('0xc')&&typeof _0x4aae85[_0x9e8c('0xd')]===_0x9e8c('0xc');var _0x53cc6e=_0x16c5e9['count'];var _0x2f97f4=_0x14cccd?0x0:_0x4aae85[_0x9e8c('0xb')];var _0x23ec63=_0x14cccd?_0x16c5e9[_0x9e8c('0xe')]:_0x4aae85[_0x9e8c('0xb')]+_0x4aae85['limit'];var _0x206558;if(_0x23ec63>=_0x53cc6e){_0x23ec63=_0x53cc6e;_0x206558=0xc8;}else{_0x206558=0xce;}_0x66c0f1['status'](_0x206558);return _0x66c0f1[_0x9e8c('0xf')](_0x9e8c('0x10'),_0x2f97f4+'-'+_0x23ec63+'/'+_0x53cc6e)[_0x9e8c('0x11')](_0x16c5e9);}return null;};}function removeEntity(_0x4c1d5c){return function(_0x39c52c){if(_0x39c52c){return _0x39c52c['destroy']()['then'](function(){var _0x27c218=_0x39c52c[_0x9e8c('0x12')]({'plain':!![]});var _0x4df19a=[{'name':_0x9e8c('0x13'),'value':'inbound','ignore':![]},{'name':_0x9e8c('0x14'),'value':_0x9e8c('0x15'),'ignore':![]},{'name':'InternalRoutes','value':_0x9e8c('0x16'),'ignore':![]}];var _0x3dd64c=_(_0x4df19a)['filter'](_0x9e8c('0x17'))[_0x9e8c('0x18')]('value')[_0x9e8c('0x19')]();if(_[_0x9e8c('0x1a')](_0x3dd64c,_0x27c218[_0x9e8c('0x1b')])){return;}var _0x1c3ff1=_[_0x9e8c('0x1c')](_0x4df19a,['value',_0x27c218[_0x9e8c('0x1b')]])[_0x9e8c('0x1d')];return db['UserProfileResource'][_0x9e8c('0x1e')]({'where':{'type':_0x1c3ff1,'resourceId':_0x27c218['id']}})[_0x9e8c('0x1f')](function(){return _0x39c52c;});})[_0x9e8c('0x1f')](function(){_0x4c1d5c['status'](0xcc)[_0x9e8c('0x20')]();});}};}function handleEntityNotFound(_0x39e0d0){return function(_0x498438){if(!_0x498438){_0x39e0d0[_0x9e8c('0x21')](0x194);}return _0x498438;};}function handleError(_0x4ffaf5,_0x3438d2){_0x3438d2=_0x3438d2||0x1f4;return function(_0x4b3cb5){logger[_0x9e8c('0x22')](_0x4b3cb5[_0x9e8c('0x23')]);if(_0x4b3cb5[_0x9e8c('0x1d')]){delete _0x4b3cb5[_0x9e8c('0x1d')];}_0x4ffaf5[_0x9e8c('0xa')](_0x3438d2)['send'](_0x4b3cb5);};}exports['index']=function(_0x5aa2f3,_0x5f492c){var _0x23738b={},_0x435b64={},_0x336014={'count':0x0,'rows':[]};var _0x20d9b5=_[_0x9e8c('0x18')](db['VoiceExtension']['rawAttributes'],function(_0xf62647){return{'name':_0xf62647[_0x9e8c('0x24')],'type':_0xf62647[_0x9e8c('0x1b')][_0x9e8c('0x25')]};});_0x435b64[_0x9e8c('0x26')]=_[_0x9e8c('0x18')](_0x20d9b5,_0x9e8c('0x1d'));_0x435b64['query']=_[_0x9e8c('0x27')](_0x5aa2f3[_0x9e8c('0x28')]);_0x435b64[_0x9e8c('0x29')]=_[_0x9e8c('0x2a')](_0x435b64[_0x9e8c('0x26')],_0x435b64[_0x9e8c('0x28')]);_0x23738b[_0x9e8c('0x2b')]=_[_0x9e8c('0x2a')](_0x435b64[_0x9e8c('0x26')],qs[_0x9e8c('0x2c')](_0x5aa2f3[_0x9e8c('0x28')]['fields']));_0x23738b[_0x9e8c('0x2b')]=_0x23738b[_0x9e8c('0x2b')]['length']?_0x23738b[_0x9e8c('0x2b')]:_0x435b64[_0x9e8c('0x26')];if(!_0x5aa2f3[_0x9e8c('0x28')][_0x9e8c('0x2d')]('nolimit')){_0x23738b[_0x9e8c('0xd')]=qs[_0x9e8c('0xd')](_0x5aa2f3[_0x9e8c('0x28')][_0x9e8c('0xd')]);_0x23738b[_0x9e8c('0xb')]=qs['offset'](_0x5aa2f3[_0x9e8c('0x28')][_0x9e8c('0xb')]);}_0x23738b[_0x9e8c('0x2e')]=qs[_0x9e8c('0x2f')](_0x5aa2f3[_0x9e8c('0x28')][_0x9e8c('0x2f')]);_0x23738b[_0x9e8c('0x30')]=qs[_0x9e8c('0x29')](_[_0x9e8c('0x31')](_0x5aa2f3[_0x9e8c('0x28')],_0x435b64[_0x9e8c('0x29')]),_0x20d9b5);if(_0x5aa2f3['query'][_0x9e8c('0x32')]){_0x23738b[_0x9e8c('0x30')]=_[_0x9e8c('0x33')](_0x23738b[_0x9e8c('0x30')],{'$or':_[_0x9e8c('0x18')](_0x20d9b5,function(_0x1a184a){if(_0x1a184a['type']!==_0x9e8c('0x34')){var _0x235bef={};_0x235bef[_0x1a184a[_0x9e8c('0x1d')]]={'$like':'%'+_0x5aa2f3[_0x9e8c('0x28')][_0x9e8c('0x32')]+'%'};return _0x235bef;}})});}_0x23738b=_['merge']({},_0x23738b,_0x5aa2f3['options']);var _0x1f861c={'where':_0x23738b[_0x9e8c('0x30')]};return db[_0x9e8c('0x35')]['count'](_0x1f861c)[_0x9e8c('0x1f')](function(_0xed7ad7){_0x336014[_0x9e8c('0xe')]=_0xed7ad7;if(_0x5aa2f3[_0x9e8c('0x28')][_0x9e8c('0x36')]){_0x23738b[_0x9e8c('0x37')]=[{'all':!![]}];}return db[_0x9e8c('0x35')][_0x9e8c('0x38')](_0x23738b);})['then'](function(_0x56d217){_0x336014[_0x9e8c('0x39')]=_0x56d217;return _0x336014;})[_0x9e8c('0x1f')](respondWithFilteredResult(_0x5f492c,_0x23738b))[_0x9e8c('0x3a')](handleError(_0x5f492c,null));};exports['show']=function(_0x2bd076,_0x250381){var _0x5d2a21={'raw':![],'where':{'id':_0x2bd076['params']['id']}},_0x5af7db={};_0x5af7db[_0x9e8c('0x26')]=_[_0x9e8c('0x27')](db[_0x9e8c('0x35')][_0x9e8c('0x3b')]);_0x5af7db['query']=_['keys'](_0x2bd076['query']);_0x5af7db[_0x9e8c('0x29')]=_[_0x9e8c('0x2a')](_0x5af7db[_0x9e8c('0x26')],_0x5af7db[_0x9e8c('0x28')]);_0x5d2a21[_0x9e8c('0x2b')]=_[_0x9e8c('0x2a')](_0x5af7db[_0x9e8c('0x26')],qs[_0x9e8c('0x2c')](_0x2bd076[_0x9e8c('0x28')][_0x9e8c('0x2c')]));_0x5d2a21[_0x9e8c('0x2b')]=_0x5d2a21[_0x9e8c('0x2b')]['length']?_0x5d2a21[_0x9e8c('0x2b')]:_0x5af7db[_0x9e8c('0x26')];if(_0x2bd076[_0x9e8c('0x28')][_0x9e8c('0x36')]){_0x5d2a21['include']=[{'all':!![]}];}_0x5d2a21=_[_0x9e8c('0x33')]({},_0x5d2a21,_0x2bd076['options']);return db[_0x9e8c('0x35')][_0x9e8c('0x1c')](_0x5d2a21)['then'](handleEntityNotFound(_0x250381,null))[_0x9e8c('0x1f')](respondWithResult(_0x250381,null))['catch'](handleError(_0x250381,null));};exports[_0x9e8c('0x1e')]=function(_0x4845c8,_0x468c26){return db['VoiceExtension'][_0x9e8c('0x1c')]({'where':{'id':_0x4845c8[_0x9e8c('0x3c')]['id']}})[_0x9e8c('0x1f')](handleEntityNotFound(_0x468c26,null))[_0x9e8c('0x1f')](removeEntity(_0x468c26,null))[_0x9e8c('0x3a')](handleError(_0x468c26,null));};exports['create']=function(_0x5d12e5,_0x423e5e){if(_0x5d12e5[_0x9e8c('0x3d')]['type']==='outbound'&&!_['startsWith'](_0x5d12e5['body'][_0x9e8c('0x3e')],'_')){_0x5d12e5[_0x9e8c('0x3d')]['exten']='_'[_0x9e8c('0x3f')](_0x5d12e5[_0x9e8c('0x3d')][_0x9e8c('0x3e')]);}return db[_0x9e8c('0x35')][_0x9e8c('0x40')](_0x5d12e5[_0x9e8c('0x3d')],{'raw':![]})[_0x9e8c('0x1f')](function(_0x2f1cef){var _0x90639d=_0x5d12e5[_0x9e8c('0x41')][_0x9e8c('0x12')]({'plain':!![]});if(!_0x90639d)throw new Error(_0x9e8c('0x42'));if(_0x90639d['role']===_0x9e8c('0x41')){var _0x42bcac=_0x2f1cef[_0x9e8c('0x12')]({'plain':!![]});var _0x4992fe=[{'name':_0x9e8c('0x13'),'value':_0x9e8c('0x43')},{'name':_0x9e8c('0x14'),'value':_0x9e8c('0x15')},{'name':_0x9e8c('0x44'),'value':_0x9e8c('0x16')}];var _0x5deeac=_[_0x9e8c('0x1c')](_0x4992fe,[_0x9e8c('0x19'),_0x42bcac[_0x9e8c('0x1b')]])[_0x9e8c('0x1d')];return db['UserProfileSection'][_0x9e8c('0x1c')]({'where':{'name':_0x5deeac,'userProfileId':_0x90639d[_0x9e8c('0x45')]},'raw':!![]})[_0x9e8c('0x1f')](function(_0x283d66){if(_0x283d66&&_0x283d66[_0x9e8c('0x46')]===0x0){return db[_0x9e8c('0x47')][_0x9e8c('0x40')]({'name':_0x42bcac[_0x9e8c('0x1d')],'resourceId':_0x42bcac['id'],'type':_0x283d66['name'],'sectionId':_0x283d66['id']},{})[_0x9e8c('0x1f')](function(){return _0x2f1cef;});}else{return _0x2f1cef;}})['catch'](function(_0x5d739f){logger['error'](_0x9e8c('0x48'),_0x5d739f);throw _0x5d739f;});}return _0x2f1cef;})[_0x9e8c('0x1f')](respondWithResult(_0x423e5e,0xc9))[_0x9e8c('0x3a')](handleError(_0x423e5e,null));};exports['update']=function(_0x18fc64,_0x3f488f){if(_0x18fc64[_0x9e8c('0x3d')]['id']){delete _0x18fc64['body']['id'];}return db[_0x9e8c('0x35')][_0x9e8c('0x1c')]({'where':{'id':_0x18fc64[_0x9e8c('0x3c')]['id']}})[_0x9e8c('0x1f')](handleEntityNotFound(_0x3f488f,null))[_0x9e8c('0x1f')](function(_0x4f3ad1){if(_0x4f3ad1){return db[_0x9e8c('0x35')][_0x9e8c('0x49')](_[_0x9e8c('0x31')](_0x18fc64[_0x9e8c('0x3d')],[_0x9e8c('0x3e'),_0x9e8c('0x4a'),_0x9e8c('0x4b'),_0x9e8c('0x4c'),_0x9e8c('0x4d'),_0x9e8c('0x4e'),'alias']),{'where':{'context':_0x4f3ad1[_0x9e8c('0x4a')],'exten':_0x4f3ad1[_0x9e8c('0x3e')]},'individualHooks':!![]})[_0x9e8c('0x1f')](function(_0xca7eda){return _0xca7eda;});}return null;})[_0x9e8c('0x1f')](respondWithStatusCode(_0x3f488f,null))[_0x9e8c('0x3a')](handleError(_0x3f488f,null));};exports[_0x9e8c('0x4f')]=function(_0x4cbb6b,_0x209016){var _0x13d8d3=_0x4cbb6b[_0x9e8c('0x3c')]['id'];var _0x4e6ea9=_0x4cbb6b['body'];var _0x4faa85=0xc8;var _0x5b409b=null;return db[_0x9e8c('0x50')][_0x9e8c('0x51')]({'isolationLevel':db[_0x9e8c('0x50')][_0x9e8c('0x52')][_0x9e8c('0x53')][_0x9e8c('0x54')]},function(_0x6e34db){return db[_0x9e8c('0x35')][_0x9e8c('0x55')]({'where':{'id':_0x13d8d3},'transaction':_0x6e34db})['then'](function(_0x51dd5d){if(_0x51dd5d){return db[_0x9e8c('0x35')][_0x9e8c('0x1e')]({'where':{'VoiceExtensionId':_0x13d8d3},'transaction':_0x6e34db})[_0x9e8c('0x1f')](function(){var _0x4d3c02=_[_0x9e8c('0x18')](_0x4e6ea9,function(_0xc0dd67){_0xc0dd67[_0x9e8c('0x56')]=_0x13d8d3;_0xc0dd67[_0x9e8c('0x57')]=!![];return _0xc0dd67;});return _0x51dd5d[_0x9e8c('0x58')](_0x4d3c02);})[_0x9e8c('0x1f')](function(_0x2bd247){return db['VoiceExtension'][_0x9e8c('0x59')](_0x2bd247,{'transaction':_0x6e34db});});}else{_0x4faa85=0x194;_0x5b409b=[];}});})[_0x9e8c('0x1f')](function(){if(_0x4faa85!==0x194){return db[_0x9e8c('0x35')][_0x9e8c('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x13d8d3},'order':_0x9e8c('0x5b')})['then'](function(_0x221b44){_0x5b409b=_0x221b44;});}})[_0x9e8c('0x3a')](function(_0x1e8b45){_0x4faa85=0x1f4;logger[_0x9e8c('0x22')](_0x1e8b45[_0x9e8c('0x23')]);if(_0x1e8b45[_0x9e8c('0x1d')]){delete _0x1e8b45[_0x9e8c('0x1d')];}_0x5b409b=_0x1e8b45;})[_0x9e8c('0x5c')](function(){if(_0x5b409b===null){_0x209016[_0x9e8c('0x21')](_0x4faa85);}else{if(_0x4faa85===0x1f4){_0x209016[_0x9e8c('0xa')](_0x4faa85)[_0x9e8c('0x5d')](_0x5b409b);}else{_0x209016[_0x9e8c('0xa')](_0x4faa85)['json'](_0x5b409b);}}});}; \ No newline at end of file +var _0xf6e3=['UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','alias','context','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','index','rawAttributes','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','length','find','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes'];(function(_0x45df91,_0x59947b){var _0x2faad7=function(_0x5cb743){while(--_0x5cb743){_0x45df91['push'](_0x45df91['shift']());}};_0x2faad7(++_0x59947b);}(_0xf6e3,0x138));var _0x3f6e=function(_0x5998d0,_0x2ca24c){_0x5998d0=_0x5998d0-0x0;var _0x541560=_0xf6e3[_0x5998d0];return _0x541560;};'use strict';var _=require(_0x3f6e('0x0'));var Redis=require(_0x3f6e('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x3f6e('0x2'))(_0x3f6e('0x3'));var config=require(_0x3f6e('0x4'));var db=require(_0x3f6e('0x5'))['db'];config['redis']=_['defaults'](config[_0x3f6e('0x6')],{'host':_0x3f6e('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f6e('0x6')]));require(_0x3f6e('0x8'))[_0x3f6e('0x9')](socket);function respondWithStatusCode(_0x2d6a13,_0x322ada){_0x322ada=_0x322ada||0xcc;return function(_0x47406e){if(_0x47406e){return _0x2d6a13[_0x3f6e('0xa')](_0x322ada);}return _0x2d6a13[_0x3f6e('0xb')](_0x322ada)[_0x3f6e('0xc')]();};}function respondWithResult(_0x5664b7,_0x51cb1c){_0x51cb1c=_0x51cb1c||0xc8;return function(_0x4d9652){if(_0x4d9652){return _0x5664b7['status'](_0x51cb1c)[_0x3f6e('0xd')](_0x4d9652);}};}function respondWithFilteredResult(_0x27355d,_0x53552b){return function(_0x1f83f1){if(_0x1f83f1){var _0x59e600=typeof _0x53552b['offset']===_0x3f6e('0xe')&&typeof _0x53552b[_0x3f6e('0xf')]==='undefined';var _0x204c61=_0x1f83f1[_0x3f6e('0x10')];var _0x5870f3=_0x59e600?0x0:_0x53552b[_0x3f6e('0x11')];var _0xfae168=_0x59e600?_0x1f83f1['count']:_0x53552b[_0x3f6e('0x11')]+_0x53552b[_0x3f6e('0xf')];var _0x52360c;if(_0xfae168>=_0x204c61){_0xfae168=_0x204c61;_0x52360c=0xc8;}else{_0x52360c=0xce;}_0x27355d[_0x3f6e('0xb')](_0x52360c);return _0x27355d[_0x3f6e('0x12')](_0x3f6e('0x13'),_0x5870f3+'-'+_0xfae168+'/'+_0x204c61)[_0x3f6e('0xd')](_0x1f83f1);}return null;};}function removeEntity(_0x2757a8){return function(_0x2b4a80){if(_0x2b4a80){return _0x2b4a80[_0x3f6e('0x14')]()[_0x3f6e('0x15')](function(){var _0x1d4125=_0x2b4a80[_0x3f6e('0x16')]({'plain':!![]});var _0x57351d=[{'name':'InboundRoutes','value':_0x3f6e('0x17'),'ignore':![]},{'name':_0x3f6e('0x18'),'value':_0x3f6e('0x19'),'ignore':![]},{'name':_0x3f6e('0x1a'),'value':_0x3f6e('0x1b'),'ignore':![]}];var _0x41ae58=_(_0x57351d)[_0x3f6e('0x1c')](_0x3f6e('0x1d'))[_0x3f6e('0x1e')](_0x3f6e('0x1f'))[_0x3f6e('0x1f')]();if(_[_0x3f6e('0x20')](_0x41ae58,_0x1d4125['type'])){return;}var _0x4550fa=_['find'](_0x57351d,['value',_0x1d4125[_0x3f6e('0x21')]])[_0x3f6e('0x22')];return db[_0x3f6e('0x23')][_0x3f6e('0x14')]({'where':{'type':_0x4550fa,'resourceId':_0x1d4125['id']}})[_0x3f6e('0x15')](function(){return _0x2b4a80;});})[_0x3f6e('0x15')](function(){_0x2757a8[_0x3f6e('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d6c7){return function(_0x43ebbf){if(!_0x43ebbf){_0x57d6c7['sendStatus'](0x194);}return _0x43ebbf;};}function handleError(_0x2ea2b1,_0x3a70c5){_0x3a70c5=_0x3a70c5||0x1f4;return function(_0x4214cd){logger[_0x3f6e('0x24')](_0x4214cd[_0x3f6e('0x25')]);if(_0x4214cd[_0x3f6e('0x22')]){delete _0x4214cd['name'];}_0x2ea2b1['status'](_0x3a70c5)[_0x3f6e('0x26')](_0x4214cd);};}exports[_0x3f6e('0x27')]=function(_0x427865,_0x1e0317){var _0x5086a4={},_0x399e36={},_0x141a61={'count':0x0,'rows':[]};var _0xb86f8=_[_0x3f6e('0x1e')](db['VoiceExtension'][_0x3f6e('0x28')],function(_0x554dcc){return{'name':_0x554dcc['fieldName'],'type':_0x554dcc[_0x3f6e('0x21')][_0x3f6e('0x29')]};});_0x399e36['model']=_[_0x3f6e('0x1e')](_0xb86f8,'name');_0x399e36[_0x3f6e('0x2a')]=_[_0x3f6e('0x2b')](_0x427865[_0x3f6e('0x2a')]);_0x399e36['filters']=_[_0x3f6e('0x2c')](_0x399e36[_0x3f6e('0x2d')],_0x399e36[_0x3f6e('0x2a')]);_0x5086a4[_0x3f6e('0x2e')]=_[_0x3f6e('0x2c')](_0x399e36[_0x3f6e('0x2d')],qs['fields'](_0x427865[_0x3f6e('0x2a')][_0x3f6e('0x2f')]));_0x5086a4[_0x3f6e('0x2e')]=_0x5086a4['attributes']['length']?_0x5086a4['attributes']:_0x399e36[_0x3f6e('0x2d')];if(!_0x427865['query']['hasOwnProperty'](_0x3f6e('0x30'))){_0x5086a4[_0x3f6e('0xf')]=qs[_0x3f6e('0xf')](_0x427865[_0x3f6e('0x2a')][_0x3f6e('0xf')]);_0x5086a4['offset']=qs[_0x3f6e('0x11')](_0x427865[_0x3f6e('0x2a')]['offset']);}_0x5086a4['order']=qs[_0x3f6e('0x31')](_0x427865[_0x3f6e('0x2a')]['sort']);_0x5086a4[_0x3f6e('0x32')]=qs[_0x3f6e('0x33')](_['pick'](_0x427865[_0x3f6e('0x2a')],_0x399e36[_0x3f6e('0x33')]),_0xb86f8);if(_0x427865['query'][_0x3f6e('0x1c')]){_0x5086a4[_0x3f6e('0x32')]=_[_0x3f6e('0x34')](_0x5086a4[_0x3f6e('0x32')],{'$or':_['map'](_0xb86f8,function(_0x18f654){if(_0x18f654[_0x3f6e('0x21')]!=='VIRTUAL'){var _0x1352d0={};_0x1352d0[_0x18f654[_0x3f6e('0x22')]]={'$like':'%'+_0x427865[_0x3f6e('0x2a')][_0x3f6e('0x1c')]+'%'};return _0x1352d0;}})});}_0x5086a4=_['merge']({},_0x5086a4,_0x427865[_0x3f6e('0x35')]);var _0x11e9b3={'where':_0x5086a4[_0x3f6e('0x32')]};return db[_0x3f6e('0x36')][_0x3f6e('0x10')](_0x11e9b3)[_0x3f6e('0x15')](function(_0x4ad074){_0x141a61[_0x3f6e('0x10')]=_0x4ad074;if(_0x427865[_0x3f6e('0x2a')][_0x3f6e('0x37')]){_0x5086a4[_0x3f6e('0x38')]=[{'all':!![]}];}return db[_0x3f6e('0x36')][_0x3f6e('0x39')](_0x5086a4);})[_0x3f6e('0x15')](function(_0x1581b8){_0x141a61[_0x3f6e('0x3a')]=_0x1581b8;return _0x141a61;})[_0x3f6e('0x15')](respondWithFilteredResult(_0x1e0317,_0x5086a4))[_0x3f6e('0x3b')](handleError(_0x1e0317,null));};exports[_0x3f6e('0x3c')]=function(_0x3c3927,_0x212645){var _0x19b37d={'raw':![],'where':{'id':_0x3c3927[_0x3f6e('0x3d')]['id']}},_0x1fbf90={};_0x1fbf90[_0x3f6e('0x2d')]=_['keys'](db[_0x3f6e('0x36')][_0x3f6e('0x28')]);_0x1fbf90[_0x3f6e('0x2a')]=_[_0x3f6e('0x2b')](_0x3c3927[_0x3f6e('0x2a')]);_0x1fbf90['filters']=_[_0x3f6e('0x2c')](_0x1fbf90[_0x3f6e('0x2d')],_0x1fbf90['query']);_0x19b37d[_0x3f6e('0x2e')]=_[_0x3f6e('0x2c')](_0x1fbf90[_0x3f6e('0x2d')],qs[_0x3f6e('0x2f')](_0x3c3927['query'][_0x3f6e('0x2f')]));_0x19b37d[_0x3f6e('0x2e')]=_0x19b37d[_0x3f6e('0x2e')][_0x3f6e('0x3e')]?_0x19b37d[_0x3f6e('0x2e')]:_0x1fbf90[_0x3f6e('0x2d')];if(_0x3c3927[_0x3f6e('0x2a')][_0x3f6e('0x37')]){_0x19b37d[_0x3f6e('0x38')]=[{'all':!![]}];}_0x19b37d=_[_0x3f6e('0x34')]({},_0x19b37d,_0x3c3927['options']);return db['VoiceExtension'][_0x3f6e('0x3f')](_0x19b37d)[_0x3f6e('0x15')](handleEntityNotFound(_0x212645,null))[_0x3f6e('0x15')](respondWithResult(_0x212645,null))['catch'](handleError(_0x212645,null));};exports[_0x3f6e('0x14')]=function(_0x4864bd,_0x197bb9){return db[_0x3f6e('0x36')]['find']({'where':{'id':_0x4864bd[_0x3f6e('0x3d')]['id']}})[_0x3f6e('0x15')](handleEntityNotFound(_0x197bb9,null))[_0x3f6e('0x15')](removeEntity(_0x197bb9,null))[_0x3f6e('0x3b')](handleError(_0x197bb9,null));};exports['create']=function(_0xd27439,_0x76483a){if(_0xd27439[_0x3f6e('0x40')][_0x3f6e('0x21')]===_0x3f6e('0x19')&&!_[_0x3f6e('0x41')](_0xd27439[_0x3f6e('0x40')][_0x3f6e('0x42')],'_')){_0xd27439[_0x3f6e('0x40')][_0x3f6e('0x42')]='_'[_0x3f6e('0x43')](_0xd27439['body'][_0x3f6e('0x42')]);}return db[_0x3f6e('0x36')]['create'](_0xd27439[_0x3f6e('0x40')],{'raw':![]})[_0x3f6e('0x15')](function(_0x2c6f59){var _0x2d4af0=_0xd27439[_0x3f6e('0x44')]['get']({'plain':!![]});if(!_0x2d4af0)throw new Error(_0x3f6e('0x45'));if(_0x2d4af0[_0x3f6e('0x46')]===_0x3f6e('0x44')){var _0x124ca=_0x2c6f59[_0x3f6e('0x16')]({'plain':!![]});var _0x4d3451=[{'name':_0x3f6e('0x47'),'value':_0x3f6e('0x17')},{'name':_0x3f6e('0x18'),'value':_0x3f6e('0x19')},{'name':_0x3f6e('0x1a'),'value':'internal'}];var _0x30dee5=_['find'](_0x4d3451,[_0x3f6e('0x1f'),_0x124ca[_0x3f6e('0x21')]])[_0x3f6e('0x22')];return db[_0x3f6e('0x48')]['find']({'where':{'name':_0x30dee5,'userProfileId':_0x2d4af0[_0x3f6e('0x49')]},'raw':!![]})['then'](function(_0x4a8589){if(_0x4a8589&&_0x4a8589[_0x3f6e('0x4a')]===0x0){return db[_0x3f6e('0x23')][_0x3f6e('0x4b')]({'name':_0x124ca[_0x3f6e('0x22')],'resourceId':_0x124ca['id'],'type':_0x4a8589[_0x3f6e('0x22')],'sectionId':_0x4a8589['id']},{})[_0x3f6e('0x15')](function(){return _0x2c6f59;});}else{return _0x2c6f59;}})[_0x3f6e('0x3b')](function(_0x4bc93b){logger[_0x3f6e('0x24')](_0x3f6e('0x4c'),_0x4bc93b);throw _0x4bc93b;});}return _0x2c6f59;})[_0x3f6e('0x15')](respondWithResult(_0x76483a,0xc9))[_0x3f6e('0x3b')](handleError(_0x76483a,null));};exports['update']=function(_0x30638a,_0x54026a){if(_0x30638a['body']['id']){delete _0x30638a[_0x3f6e('0x40')]['id'];}return db[_0x3f6e('0x36')]['find']({'where':{'id':_0x30638a[_0x3f6e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x54026a,null))[_0x3f6e('0x15')](function(_0x421d6a){if(_0x421d6a){return db[_0x3f6e('0x36')][_0x3f6e('0x4d')](_['pick'](_0x30638a[_0x3f6e('0x40')],[_0x3f6e('0x42'),'context',_0x3f6e('0x4e'),_0x3f6e('0x4f'),_0x3f6e('0x50'),'mandatoryDisposition',_0x3f6e('0x51')]),{'where':{'context':_0x421d6a[_0x3f6e('0x52')],'exten':_0x421d6a['exten']},'individualHooks':!![]})[_0x3f6e('0x15')](function(_0x17edfc){return _0x17edfc;});}return null;})[_0x3f6e('0x15')](respondWithStatusCode(_0x54026a,null))[_0x3f6e('0x3b')](handleError(_0x54026a,null));};exports[_0x3f6e('0x53')]=function(_0xd7e70c,_0x383e3a){var _0x23a900=_0xd7e70c[_0x3f6e('0x3d')]['id'];var _0x506d01=_0xd7e70c[_0x3f6e('0x40')];var _0x23c895=0xc8;var _0xf1c3c4=null;return db['sequelize'][_0x3f6e('0x54')]({'isolationLevel':db[_0x3f6e('0x55')][_0x3f6e('0x56')][_0x3f6e('0x57')][_0x3f6e('0x58')]},function(_0x2662c2){return db[_0x3f6e('0x36')][_0x3f6e('0x59')]({'where':{'id':_0x23a900},'transaction':_0x2662c2})[_0x3f6e('0x15')](function(_0x5855f4){if(_0x5855f4){return db[_0x3f6e('0x36')][_0x3f6e('0x14')]({'where':{'VoiceExtensionId':_0x23a900},'transaction':_0x2662c2})[_0x3f6e('0x15')](function(){var _0x16ab8c=_[_0x3f6e('0x1e')](_0x506d01,function(_0x24ab6f){_0x24ab6f[_0x3f6e('0x5a')]=_0x23a900;_0x24ab6f[_0x3f6e('0x5b')]=!![];return _0x24ab6f;});return _0x5855f4[_0x3f6e('0x5c')](_0x16ab8c);})[_0x3f6e('0x15')](function(_0x49b61d){return db[_0x3f6e('0x36')][_0x3f6e('0x5d')](_0x49b61d,{'transaction':_0x2662c2});});}else{_0x23c895=0x194;_0xf1c3c4=[];}});})[_0x3f6e('0x15')](function(){if(_0x23c895!==0x194){return db[_0x3f6e('0x36')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x23a900},'order':_0x3f6e('0x5e')})['then'](function(_0x3352a9){_0xf1c3c4=_0x3352a9;});}})[_0x3f6e('0x3b')](function(_0x423871){_0x23c895=0x1f4;logger[_0x3f6e('0x24')](_0x423871['stack']);if(_0x423871[_0x3f6e('0x22')]){delete _0x423871[_0x3f6e('0x22')];}_0xf1c3c4=_0x423871;})[_0x3f6e('0x5f')](function(){if(_0xf1c3c4===null){_0x383e3a[_0x3f6e('0xa')](_0x23c895);}else{if(_0x23c895===0x1f4){_0x383e3a[_0x3f6e('0xb')](_0x23c895)[_0x3f6e('0x26')](_0xf1c3c4);}else{_0x383e3a[_0x3f6e('0xb')](_0x23c895)[_0x3f6e('0xd')](_0xf1c3c4);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index db5cbb6..8dfbfca 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 _0xe719=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe719,0x66));var _0x9e71=function(_0x3fd03e,_0x53a7a7){_0x3fd03e=_0x3fd03e-0x0;var _0x4dd6aa=_0xe719[_0x3fd03e];return _0x4dd6aa;};'use strict';var EventEmitter=require(_0x9e71('0x0'));var VoiceExtension=require(_0x9e71('0x1'))['db'][_0x9e71('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9e71('0x3')](0x0);var events={'afterCreate':_0x9e71('0x4'),'afterUpdate':_0x9e71('0x5'),'afterDestroy':_0x9e71('0x6')};function emitEvent(_0x1df513){return function(_0x150d3c,_0x3fcd80,_0x6bf65a){VoiceExtensionEvents[_0x9e71('0x7')](_0x1df513+':'+_0x150d3c['id'],_0x150d3c);VoiceExtensionEvents[_0x9e71('0x7')](_0x1df513,_0x150d3c);_0x6bf65a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x9e71('0x8')](e,emitEvent(event));}}module[_0x9e71('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x245e=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x511f2b,_0x4c7591){var _0x22db60=function(_0x5d3df8){while(--_0x5d3df8){_0x511f2b['push'](_0x511f2b['shift']());}};_0x22db60(++_0x4c7591);}(_0x245e,0x180));var _0xe245=function(_0xecb87c,_0x87ad1b){_0xecb87c=_0xecb87c-0x0;var _0x3f47bc=_0x245e[_0xecb87c];return _0x3f47bc;};'use strict';var EventEmitter=require(_0xe245('0x0'));var VoiceExtension=require(_0xe245('0x1'))['db'][_0xe245('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe245('0x3'),'afterDestroy':_0xe245('0x4')};function emitEvent(_0x2427be){return function(_0x4451bc,_0x4c194c,_0x30df79){VoiceExtensionEvents[_0xe245('0x5')](_0x2427be+':'+_0x4451bc['id'],_0x4451bc);VoiceExtensionEvents[_0xe245('0x5')](_0x2427be,_0x4451bc);_0x30df79(null);};}for(var e in events){if(events[_0xe245('0x6')](e)){var event=events[e];VoiceExtension[_0xe245('0x7')](e,emitEvent(event));}}module[_0xe245('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 60730d0..e9a755b 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 _0x0e6a=[',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','get','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','alias','NoOp','CDR(routeAlias)=','context','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x0e6a,0x100));var _0xa0e6=function(_0xd9caad,_0x5856b7){_0xd9caad=_0xd9caad-0x0;var _0x3127e6=_0x0e6a[_0xd9caad];return _0x3127e6;};'use strict';var _=require('lodash');var attributes=require(_0xa0e6('0x0'));module[_0xa0e6('0x1')]=function(_0x35d9f6){var _0xc880d9=_0x35d9f6[_0xa0e6('0x2')];function _0x40b6c7(_0x4b9ee9){var _0xcd5884=0x2;var _0x19cadf=[{'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0x5')+_0x4b9ee9[_0xa0e6('0x3')],'context':_0x4b9ee9['context'],'exten':_0x4b9ee9['exten'],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']},{'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0x4b9ee9[_0xa0e6('0x6')]?_0xa0e6('0x4'):_0xa0e6('0x7'),'appdata':_0x4b9ee9[_0xa0e6('0x6')]?_0xa0e6('0x8')+_0x4b9ee9['alias']:'No\x20alias\x20set','context':_0x4b9ee9[_0xa0e6('0x9')],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']}];if(_0x4b9ee9['type']===_0xa0e6('0xb')){_0x19cadf['push']({'type':_0xa0e6('0xb'),'app':_0xa0e6('0x4'),'appdata':'CDR(routeid)='+_0x4b9ee9['id'],'context':_0x4b9ee9['context'],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']});}_0x19cadf[_0xa0e6('0xc')]({'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xd'),'context':_0x4b9ee9['context'],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']},{'type':_0x4b9ee9['type'],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xe'),'context':_0x4b9ee9['context'],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']},{'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xf'),'context':_0x4b9ee9[_0xa0e6('0x9')],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']});return _0x19cadf;}function _0x30e924(_0x4e8006){var _0x5b4294=0x2;var _0x535e39=[{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':'CDR(type)=outbound','context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0x4e8006['alias']?'Set':_0xa0e6('0x7'),'appdata':_0x4e8006[_0xa0e6('0x6')]?'CDR(routeAlias)='+_0x4e8006[_0xa0e6('0x6')]:_0xa0e6('0x11'),'context':_0x4e8006['context'],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':'Set','appdata':_0xa0e6('0x12')+(_0x4e8006['cutdigits']?_0xa0e6('0x13')+_0x4e8006[_0xa0e6('0x14')]+'}':_0xa0e6('0x15')),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0x16')+_0x4e8006['id'],'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x18')+(_0x5b4294+0x2)+_0xa0e6('0x19')+(_0x5b4294+0x1)+')','context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0x4e8006[_0xa0e6('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x4e8006[_0xa0e6('0x14')]+'}':_0xa0e6('0x1a'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xd'),'context':_0x4e8006['context'],'exten':_0x4e8006['exten'],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xe'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xf'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':'Set','appdata':'outboundrouteid='+_0x4e8006['id'],'context':_0x4e8006['context'],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']}];if(_0x4e8006[_0xa0e6('0x1b')](_0xa0e6('0x1c'))&&_0x4e8006[_0xa0e6('0x1c')]!=='none'){_0x535e39[_0xa0e6('0xc')]({'type':'outbound','app':_0xa0e6('0x4'),'appdata':_0xa0e6('0x1d'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':'outbound','app':'Set','appdata':_0xa0e6('0x1e')+_0x4e8006[_0xa0e6('0x1c')]||_0xa0e6('0x1f'),'context':_0x4e8006['context'],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']});}return _0x535e39;}function _0x1cb97f(_0x8bd974,_0x298111){var _0x39eed7=[{'name':_0xa0e6('0x20'),'param':0x0},{'name':_0xa0e6('0x21'),'param':0x1},{'name':_0xa0e6('0x22'),'param':0x2},{'name':_0xa0e6('0x23'),'param':0x3}];var _0x1fa63d={};var _0x5def82=_0x298111[_0xa0e6('0x24')](',');var _0x2ca990=[];for(var _0x4421b1=0x0;_0x4421b1<_0x39eed7[_0xa0e6('0x25')];_0x4421b1++){switch(_0x39eed7[_0x4421b1][_0xa0e6('0x26')]){case _0xa0e6('0x20'):_0x1fa63d[_0xa0e6('0x20')]=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]][_0xa0e6('0x24')]('/')[0x1];_0x1fa63d['phone']=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]][_0xa0e6('0x24')]('/')[0x2];_0x1fa63d[_0xa0e6('0x28')]=_0x1fa63d[_0xa0e6('0x29')]?_0x1fa63d[_0xa0e6('0x29')][_0xa0e6('0x24')]('$')[0x0]:undefined;_0x1fa63d[_0xa0e6('0x29')]=_0x8bd974['cutdigits']?(_0x1fa63d[_0xa0e6('0x28')]||'')+_0xa0e6('0x13')+_0x8bd974[_0xa0e6('0x14')]+'}':(_0x1fa63d[_0xa0e6('0x28')]||'')+_0xa0e6('0x15');_0x2ca990[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]]=[_0xa0e6('0x2a'),_0x1fa63d[_0xa0e6('0x20')],_0x1fa63d['phone']][_0xa0e6('0x2b')]('/');break;case _0xa0e6('0x22'):_0x1fa63d[_0xa0e6('0x22')]=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]];if(_0x8bd974['recordingFormat']!=='none'){if(_0x1fa63d[_0xa0e6('0x22')][_0xa0e6('0x2c')](_0xa0e6('0x2d'))<0x0){_0x1fa63d[_0xa0e6('0x22')]+=_0xa0e6('0x2d');}}else{_0x1fa63d[_0xa0e6('0x22')]=_0x1fa63d['options'][_0xa0e6('0x2e')]('U(xcally-mixmonitor-context)','');}_0x2ca990[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]]=_0x1fa63d[_0xa0e6('0x22')];break;default:_0x2ca990[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]]=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]];}}return _0x2ca990[_0xa0e6('0x2b')](',');}function _0x26bda8(_0x102bc9,_0x252f69,_0x251a94){return new Promise(function(_0x2758c8,_0x453563){var _0x27e4bd=[];if(_['isEmpty'](_0x252f69))return _0x2758c8(_0x27e4bd);_0xc880d9[_0xa0e6('0x2f')][_0xa0e6('0x30')]({'attributes':['id',_0xa0e6('0x31'),_0xa0e6('0x32')],'raw':!![]})[_0xa0e6('0x33')](function(_0x573eeb){for(var _0x1cd2ed=0x0,_0x375bf4=0x0;_0x1cd2ed<_0x252f69[_0xa0e6('0x25')];_0x1cd2ed++,_0x375bf4=0x0){var _0x1ce3f9=_0x252f69[_0x1cd2ed];var _0x4225b7=[];var _0xedb69a=[];delete _0x1ce3f9['id'];if(_0x1ce3f9[_0xa0e6('0x31')]!==_0xa0e6('0x34')){_0x1ce3f9[_0xa0e6('0x35')]=[_0x1ce3f9[_0xa0e6('0x31')]];}else{_0x1ce3f9[_0xa0e6('0x35')]=_0x1ce3f9['IntervalId']?_['map'](_[_0xa0e6('0x36')](_0x573eeb,{'IntervalId':_0x1ce3f9[_0xa0e6('0x32')]}),_0xa0e6('0x31')):[];}_0x1ce3f9[_0xa0e6('0x9')]=_0x102bc9['context'];_0x1ce3f9[_0xa0e6('0xa')]=_0x102bc9[_0xa0e6('0xa')];if(_0x1ce3f9[_0xa0e6('0x3')])_0x1ce3f9[_0xa0e6('0x3')]=_0x1ce3f9['type']['toLowerCase']();if(_0x102bc9[_0xa0e6('0x3')]==='outbound'){if(_0x1ce3f9[_0xa0e6('0x1b')](_0xa0e6('0x37'))&&_0x1ce3f9['tag']&&_0x1ce3f9[_0xa0e6('0x37')]!=='--'){_0x4225b7['push']({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':'Set','appdata':_0xa0e6('0x39')+_0x1ce3f9[_0xa0e6('0x37')],'context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x3a')+(_0x1ce3f9[_0xa0e6('0x3b')]?'Set(CALLERID(all)='+_0x1ce3f9['callerID']+')':_0xa0e6('0x3c')),'context':_0x102bc9['context'],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}else{if(_0x1ce3f9[_0xa0e6('0x1b')]('answer')){if([_0xa0e6('0x3d'),_0xa0e6('0x3e')][_0xa0e6('0x3f')](_0x1ce3f9[_0xa0e6('0x40')][_0xa0e6('0x38')]())&&_0x1ce3f9[_0xa0e6('0x41')]!==_0xa0e6('0x42')){if(_0x1ce3f9[_0xa0e6('0x43')]){_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x44'),'context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9['exten'],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':'Set','appdata':_0xa0e6('0x45'),'context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9['intervals'][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}else{_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x46'),'context':_0x102bc9['context'],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9['type'][_0xa0e6('0x38')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9['intervals'][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}}}}for(var _0x70e21f=0x0;_0x70e21f<_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')];_0x70e21f++){var _0x435967=_0x251a94+_0x1ce3f9[_0xa0e6('0x35')]['length'];var _0x400193=_0x70e21f===_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]-0x1?_0x251a94+_0x4225b7['length']+_0xedb69a[_0xa0e6('0x25')]+0x2:_0x251a94+_0x70e21f+0x1;_0x4225b7[_0xa0e6('0x47')](_0x70e21f,0x0,{'type':_0x102bc9[_0xa0e6('0x3')],'app':'GotoIfTime','appdata':_0x1ce3f9[_0xa0e6('0x35')][_0x70e21f]+'?'+_0x102bc9[_0xa0e6('0x9')]+_0xa0e6('0x48')+_0x435967+':'+_0x102bc9[_0xa0e6('0x9')]+_0xa0e6('0x48')+_0x400193,'exten':_0x102bc9[_0xa0e6('0xa')],'context':_0x102bc9[_0xa0e6('0x9')],'priority':_0x251a94+_0x70e21f,'VoiceExtensionId':_0x102bc9['id']});}if(_0x1ce3f9[_0xa0e6('0x41')]===_0xa0e6('0x49'))_0x1ce3f9[_0xa0e6('0x4a')]=_0x1cb97f(_0x102bc9,_0x1ce3f9[_0xa0e6('0x4a')]);_0x1ce3f9[_0xa0e6('0x4b')]=_0x4225b7[_0xa0e6('0x25')]?_[_0xa0e6('0x4c')](_0x4225b7)[_0xa0e6('0x4b')]+0x1:_0x251a94;_0x27e4bd=_[_0xa0e6('0x4d')](_0x27e4bd,_0x4225b7,[_0x1ce3f9],_0xedb69a);_0x251a94=_[_0xa0e6('0x4c')](_0x27e4bd)[_0xa0e6('0x4b')]+0x1;}return _0x2758c8(_0x27e4bd);})[_0xa0e6('0x4e')](function(_0x930552){_0x453563(_0x930552);});});}return _0x35d9f6[_0xa0e6('0x4f')]('VoiceExtension',attributes,{'tableName':_0xa0e6('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xecb5e4){var _0x6f255b=this[_0xa0e6('0x51')]({'plain':!![]});var _0x58d057=_0x6f255b[_0xa0e6('0x3')]==='outbound'?_0x30e924(_0x6f255b):_0x40b6c7(_0x6f255b);return _0x26bda8(_0x6f255b,_0xecb5e4,_[_0xa0e6('0x4c')](_0x58d057)[_0xa0e6('0x4b')]+0x1)['then'](function(_0x32d919){var _0x2207b8=_['concat'](_0x58d057,_0x32d919);_0x2207b8[_0xa0e6('0xc')]({'type':_0x6f255b[_0xa0e6('0x3')],'app':'Hangup','exten':_0x6f255b[_0xa0e6('0xa')],'context':_0x6f255b[_0xa0e6('0x9')],'priority':_[_0xa0e6('0x4c')](_0x2207b8)['priority']+0x1,'VoiceExtensionId':_0x6f255b['id']});return _0x2207b8;});}}});}; \ No newline at end of file +var _0x00e0=['define','VoiceExtension','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','context','exten','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','trunk','timeout','options','url','split','length','name','param','prefix','phone','${EXTEN:','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','intervals','interval','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch'];(function(_0x286ac9,_0x4cd820){var _0x3e8f8e=function(_0x23e30a){while(--_0x23e30a){_0x286ac9['push'](_0x286ac9['shift']());}};_0x3e8f8e(++_0x4cd820);}(_0x00e0,0x1e3));var _0x000e=function(_0x1e3582,_0x248e63){_0x1e3582=_0x1e3582-0x0;var _0x50a57e=_0x00e0[_0x1e3582];return _0x50a57e;};'use strict';var _=require(_0x000e('0x0'));var attributes=require(_0x000e('0x1'));module[_0x000e('0x2')]=function(_0x580352){var _0x43d554=_0x580352['models'];function _0x9e3bd0(_0x54d3ca){var _0x556ee0=0x2;var _0x54a9c2=[{'type':_0x54d3ca['type'],'app':_0x000e('0x3'),'appdata':_0x000e('0x4')+_0x54d3ca['type'],'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']},{'type':_0x54d3ca[_0x000e('0x7')],'app':_0x54d3ca[_0x000e('0x8')]?'Set':_0x000e('0x9'),'appdata':_0x54d3ca['alias']?_0x000e('0xa')+_0x54d3ca[_0x000e('0x8')]:_0x000e('0xb'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']}];if(_0x54d3ca[_0x000e('0x7')]===_0x000e('0xc')){_0x54a9c2['push']({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x54d3ca['id'],'context':_0x54d3ca['context'],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']});}_0x54a9c2[_0x000e('0xd')]({'type':_0x54d3ca[_0x000e('0x7')],'app':_0x000e('0x3'),'appdata':_0x000e('0xe'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']},{'type':_0x54d3ca[_0x000e('0x7')],'app':_0x000e('0x3'),'appdata':_0x000e('0xf'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']},{'type':_0x54d3ca[_0x000e('0x7')],'app':_0x000e('0x3'),'appdata':_0x000e('0x10'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']});return _0x54a9c2;}function _0x15c337(_0x519c08){var _0xc74b0a=0x2;var _0x9fa272=[{'type':_0x000e('0x11'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x519c08['alias']?'Set':'NoOp','appdata':_0x519c08[_0x000e('0x8')]?_0x000e('0xa')+_0x519c08[_0x000e('0x8')]:_0x000e('0xb'),'context':_0x519c08['context'],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':'outbound','app':_0x000e('0x3'),'appdata':_0x000e('0x12')+(_0x519c08[_0x000e('0x13')]?'${EXTEN:'+_0x519c08['cutdigits']+'}':'${EXTEN}'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0x14')+_0x519c08['id'],'context':_0x519c08['context'],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'ExecIf','appdata':_0x000e('0x15')+(_0xc74b0a+0x2)+'):Goto('+(_0xc74b0a+0x1)+')','context':_0x519c08['context'],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'Set','appdata':_0x519c08[_0x000e('0x13')]?_0x000e('0x16')+_0x519c08[_0x000e('0x13')]+'}':_0x000e('0x17'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x519c08['context'],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0xf'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0x10'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0x18')+_0x519c08['id'],'context':_0x519c08['context'],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']}];if(_0x519c08['hasOwnProperty']('recordingFormat')&&_0x519c08['recordingFormat']!==_0x000e('0x19')){_0x9fa272['push']({'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'Set','appdata':_0x000e('0x1a')+_0x519c08[_0x000e('0x1b')]||'wav','context':_0x519c08['context'],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']});}return _0x9fa272;}function _0x3ff69c(_0x15dfb8,_0x59d762){var _0x93d724=[{'name':_0x000e('0x1c'),'param':0x0},{'name':_0x000e('0x1d'),'param':0x1},{'name':_0x000e('0x1e'),'param':0x2},{'name':_0x000e('0x1f'),'param':0x3}];var _0x4e9883={};var _0x5d36be=_0x59d762[_0x000e('0x20')](',');var _0x52ec7b=[];for(var _0x442da5=0x0;_0x442da5<_0x93d724[_0x000e('0x21')];_0x442da5++){switch(_0x93d724[_0x442da5][_0x000e('0x22')]){case _0x000e('0x1c'):_0x4e9883[_0x000e('0x1c')]=_0x5d36be[_0x93d724[_0x442da5][_0x000e('0x23')]][_0x000e('0x20')]('/')[0x1];_0x4e9883['phone']=_0x5d36be[_0x93d724[_0x442da5][_0x000e('0x23')]][_0x000e('0x20')]('/')[0x2];_0x4e9883[_0x000e('0x24')]=_0x4e9883[_0x000e('0x25')]?_0x4e9883[_0x000e('0x25')][_0x000e('0x20')]('$')[0x0]:undefined;_0x4e9883['phone']=_0x15dfb8[_0x000e('0x13')]?(_0x4e9883[_0x000e('0x24')]||'')+_0x000e('0x26')+_0x15dfb8[_0x000e('0x13')]+'}':(_0x4e9883[_0x000e('0x24')]||'')+'${EXTEN}';_0x52ec7b[_0x93d724[_0x442da5][_0x000e('0x23')]]=['SIP',_0x4e9883[_0x000e('0x1c')],_0x4e9883[_0x000e('0x25')]][_0x000e('0x27')]('/');break;case _0x000e('0x1e'):_0x4e9883[_0x000e('0x1e')]=_0x5d36be[_0x93d724[_0x442da5]['param']];if(_0x15dfb8[_0x000e('0x1b')]!==_0x000e('0x19')){if(_0x4e9883[_0x000e('0x1e')][_0x000e('0x28')](_0x000e('0x29'))<0x0){_0x4e9883[_0x000e('0x1e')]+='U(xcally-mixmonitor-context)';}}else{_0x4e9883['options']=_0x4e9883[_0x000e('0x1e')][_0x000e('0x2a')](_0x000e('0x29'),'');}_0x52ec7b[_0x93d724[_0x442da5][_0x000e('0x23')]]=_0x4e9883[_0x000e('0x1e')];break;default:_0x52ec7b[_0x93d724[_0x442da5][_0x000e('0x23')]]=_0x5d36be[_0x93d724[_0x442da5][_0x000e('0x23')]];}}return _0x52ec7b[_0x000e('0x27')](',');}function _0x44b390(_0x55b038,_0x549bfc,_0x2d36ee){return new Promise(function(_0x19f040,_0x523c1d){var _0xfa4ef7=[];if(_['isEmpty'](_0x549bfc))return _0x19f040(_0xfa4ef7);_0x43d554[_0x000e('0x2b')][_0x000e('0x2c')]({'attributes':['id','interval',_0x000e('0x2d')],'raw':!![]})[_0x000e('0x2e')](function(_0x4b2530){for(var _0x15c14b=0x0,_0x1f408a=0x0;_0x15c14b<_0x549bfc[_0x000e('0x21')];_0x15c14b++,_0x1f408a=0x0){var _0x2ccbe2=_0x549bfc[_0x15c14b];var _0x1c31ba=[];var _0x35374a=[];delete _0x2ccbe2['id'];if(_0x2ccbe2['interval']!=='*,*,*,*'){_0x2ccbe2[_0x000e('0x2f')]=[_0x2ccbe2[_0x000e('0x30')]];}else{_0x2ccbe2['intervals']=_0x2ccbe2['IntervalId']?_[_0x000e('0x31')](_[_0x000e('0x32')](_0x4b2530,{'IntervalId':_0x2ccbe2[_0x000e('0x2d')]}),'interval'):[];}_0x2ccbe2[_0x000e('0x5')]=_0x55b038[_0x000e('0x5')];_0x2ccbe2['exten']=_0x55b038['exten'];if(_0x2ccbe2[_0x000e('0x7')])_0x2ccbe2['type']=_0x2ccbe2['type'][_0x000e('0x33')]();if(_0x55b038[_0x000e('0x7')]==='outbound'){if(_0x2ccbe2[_0x000e('0x34')](_0x000e('0x35'))&&_0x2ccbe2[_0x000e('0x35')]&&_0x2ccbe2[_0x000e('0x35')]!=='--'){_0x1c31ba['push']({'type':_0x2ccbe2['type'][_0x000e('0x33')](),'app':_0x000e('0x3'),'appdata':_0x000e('0x36')+_0x2ccbe2[_0x000e('0x35')],'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')][_0x000e('0x33')](),'app':_0x000e('0x37'),'appdata':_0x000e('0x38')+(_0x2ccbe2[_0x000e('0x39')]?_0x000e('0x3a')+_0x2ccbe2[_0x000e('0x39')]+')':_0x000e('0x3b')),'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038['exten'],'priority':_0x2ccbe2[_0x000e('0x2f')]['length']+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}else{if(_0x2ccbe2[_0x000e('0x34')](_0x000e('0x3c'))){if([_0x000e('0x3d'),_0x000e('0x3e')]['includes'](_0x2ccbe2[_0x000e('0x3f')][_0x000e('0x33')]())&&_0x2ccbe2[_0x000e('0x40')]!==_0x000e('0x41')){if(_0x2ccbe2[_0x000e('0x3c')]){_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2['type'][_0x000e('0x33')](),'app':_0x000e('0x37'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038['exten'],'priority':_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')]['toLowerCase'](),'app':'Set','appdata':_0x000e('0x42'),'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2[_0x000e('0x2f')]['length']+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}else{_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')][_0x000e('0x33')](),'app':_0x000e('0x37'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2['intervals'][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')][_0x000e('0x33')](),'app':'Set','appdata':_0x000e('0x43'),'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}}}}for(var _0x4f6bda=0x0;_0x4f6bda<_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')];_0x4f6bda++){var _0x39d584=_0x2d36ee+_0x2ccbe2[_0x000e('0x2f')]['length'];var _0x14e605=_0x4f6bda===_0x2ccbe2['intervals'][_0x000e('0x21')]-0x1?_0x2d36ee+_0x1c31ba[_0x000e('0x21')]+_0x35374a[_0x000e('0x21')]+0x2:_0x2d36ee+_0x4f6bda+0x1;_0x1c31ba[_0x000e('0x44')](_0x4f6bda,0x0,{'type':_0x55b038[_0x000e('0x7')],'app':_0x000e('0x45'),'appdata':_0x2ccbe2[_0x000e('0x2f')][_0x4f6bda]+'?'+_0x55b038[_0x000e('0x5')]+',${EXTEN},'+_0x39d584+':'+_0x55b038['context']+_0x000e('0x46')+_0x14e605,'exten':_0x55b038[_0x000e('0x6')],'context':_0x55b038[_0x000e('0x5')],'priority':_0x2d36ee+_0x4f6bda,'VoiceExtensionId':_0x55b038['id']});}if(_0x2ccbe2[_0x000e('0x40')]===_0x000e('0x47'))_0x2ccbe2[_0x000e('0x48')]=_0x3ff69c(_0x55b038,_0x2ccbe2[_0x000e('0x48')]);_0x2ccbe2[_0x000e('0x49')]=_0x1c31ba[_0x000e('0x21')]?_[_0x000e('0x4a')](_0x1c31ba)[_0x000e('0x49')]+0x1:_0x2d36ee;_0xfa4ef7=_[_0x000e('0x4b')](_0xfa4ef7,_0x1c31ba,[_0x2ccbe2],_0x35374a);_0x2d36ee=_[_0x000e('0x4a')](_0xfa4ef7)['priority']+0x1;}return _0x19f040(_0xfa4ef7);})[_0x000e('0x4c')](function(_0x22329c){_0x523c1d(_0x22329c);});});}return _0x580352[_0x000e('0x4d')](_0x000e('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1c66df){var _0x50ecf9=this['get']({'plain':!![]});var _0x21cf32=_0x50ecf9['type']==='outbound'?_0x15c337(_0x50ecf9):_0x9e3bd0(_0x50ecf9);return _0x44b390(_0x50ecf9,_0x1c66df,_[_0x000e('0x4a')](_0x21cf32)[_0x000e('0x49')]+0x1)[_0x000e('0x2e')](function(_0x5d96d3){var _0x47dd52=_[_0x000e('0x4b')](_0x21cf32,_0x5d96d3);_0x47dd52[_0x000e('0xd')]({'type':_0x50ecf9['type'],'app':_0x000e('0x4f'),'exten':_0x50ecf9[_0x000e('0x6')],'context':_0x50ecf9['context'],'priority':_[_0x000e('0x4a')](_0x47dd52)[_0x000e('0x49')]+0x1,'VoiceExtensionId':_0x50ecf9['id']});return _0x47dd52;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index f83f016..d6ddd82 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 _0x7edb=['info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x7edb,0x158));var _0xb7ed=function(_0x5bda09,_0x49966f){_0x5bda09=_0x5bda09-0x0;var _0x4cbf98=_0x7edb[_0x5bda09];return _0x4cbf98;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var moment=require(_0xb7ed('0x1'));var BPromise=require(_0xb7ed('0x2'));var rs=require(_0xb7ed('0x3'));var fs=require('fs');var Redis=require(_0xb7ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7ed('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb7ed('0x6'));var jayson=require(_0xb7ed('0x7'));var client=jayson[_0xb7ed('0x8')][_0xb7ed('0x9')]({'port':0x232a});config[_0xb7ed('0xa')]=_[_0xb7ed('0xb')](config[_0xb7ed('0xa')],{'host':_0xb7ed('0xc'),'port':0x18eb});var socket=require(_0xb7ed('0xd'))(new Redis(config[_0xb7ed('0xa')]));require('./voiceExtension.socket')[_0xb7ed('0xe')](socket);function respondWithRpcPromise(_0x261e4e,_0x183666,_0x6c792e){return new BPromise(function(_0x2d64fc,_0x4104bb){return client[_0xb7ed('0xf')](_0x261e4e,_0x6c792e)['then'](function(_0x38a3f5){logger[_0xb7ed('0x10')](_0xb7ed('0x11'),_0x183666,_0xb7ed('0x12'));logger[_0xb7ed('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x183666,'request\x20sent',JSON[_0xb7ed('0x14')](_0x38a3f5));if(_0x38a3f5['error']){if(_0x38a3f5[_0xb7ed('0x15')][_0xb7ed('0x16')]===0x1f4){logger[_0xb7ed('0x15')](_0xb7ed('0x11'),_0x183666,_0x38a3f5[_0xb7ed('0x15')][_0xb7ed('0x17')]);return _0x4104bb(_0x38a3f5[_0xb7ed('0x15')][_0xb7ed('0x17')]);}logger[_0xb7ed('0x15')](_0xb7ed('0x11'),_0x183666,_0x38a3f5[_0xb7ed('0x15')][_0xb7ed('0x17')]);return _0x2d64fc(_0x38a3f5['error'][_0xb7ed('0x17')]);}else{logger['info'](_0xb7ed('0x11'),_0x183666,_0xb7ed('0x12'));_0x2d64fc(_0x38a3f5['result']['message']);}})[_0xb7ed('0x18')](function(_0x12ff48){logger[_0xb7ed('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x183666,_0x12ff48);_0x4104bb(_0x12ff48);});});}exports[_0xb7ed('0x19')]=function(_0x17f4fa){var _0xa5c636=this;return new Promise(function(_0x6b7e96,_0x483633){return db[_0xb7ed('0x1a')][_0xb7ed('0x1b')]({'raw':_0x17f4fa[_0xb7ed('0x1c')]?_0x17f4fa[_0xb7ed('0x1c')][_0xb7ed('0x1d')]===undefined?!![]:![]:!![],'where':_0x17f4fa[_0xb7ed('0x1c')]?_0x17f4fa[_0xb7ed('0x1c')][_0xb7ed('0x1e')]||null:null,'attributes':_0x17f4fa['options']?_0x17f4fa[_0xb7ed('0x1c')][_0xb7ed('0x1f')]||null:null,'limit':_0x17f4fa['options']?_0x17f4fa['options']['limit']||null:null,'include':_0x17f4fa[_0xb7ed('0x1c')]?_0x17f4fa['options']['include']?_[_0xb7ed('0x20')](_0x17f4fa['options'][_0xb7ed('0x21')],function(_0x52f6c8){return{'model':db[_0x52f6c8[_0xb7ed('0x22')]],'as':_0x52f6c8['as'],'attributes':_0x52f6c8[_0xb7ed('0x1f')],'include':_0x52f6c8[_0xb7ed('0x21')]?_[_0xb7ed('0x20')](_0x52f6c8[_0xb7ed('0x21')],function(_0x59d209){return{'model':db[_0x59d209['model']],'as':_0x59d209['as'],'attributes':_0x59d209[_0xb7ed('0x1f')],'include':_0x59d209[_0xb7ed('0x21')]?_[_0xb7ed('0x20')](_0x59d209[_0xb7ed('0x21')],function(_0x2f726c){return{'model':db[_0x2f726c['model']],'as':_0x2f726c['as'],'attributes':_0x2f726c[_0xb7ed('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb7ed('0x23')](function(_0x5c8e2e){logger[_0xb7ed('0x10')](_0xb7ed('0x19'),_0x17f4fa);logger[_0xb7ed('0x13')]('GetVoiceExtension',_0x17f4fa,JSON[_0xb7ed('0x14')](_0x5c8e2e));_0x6b7e96(_0x5c8e2e);})[_0xb7ed('0x18')](function(_0x2c4407){logger[_0xb7ed('0x15')]('GetVoiceExtension',_0x2c4407[_0xb7ed('0x17')],_0x17f4fa);_0x483633(_0xa5c636['error'](0x1f4,_0x2c4407[_0xb7ed('0x17')]));});});}; \ No newline at end of file +var _0xafb9=['../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','findAll','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0xafb9,0x68));var _0x9afb=function(_0x2819c5,_0x1b3d18){_0x2819c5=_0x2819c5-0x0;var _0x101dea=_0xafb9[_0x2819c5];return _0x101dea;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9afb('0xb')],{'host':_0x9afb('0xc'),'port':0x18eb});var socket=require(_0x9afb('0xd'))(new Redis(config['redis']));require(_0x9afb('0xe'))[_0x9afb('0xf')](socket);function respondWithRpcPromise(_0x2aaefe,_0x27fa71,_0x1e5325){return new BPromise(function(_0x56f477,_0x5bb974){return client[_0x9afb('0x10')](_0x2aaefe,_0x1e5325)[_0x9afb('0x11')](function(_0x3e6a29){logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,_0x9afb('0x14'));logger[_0x9afb('0x15')](_0x9afb('0x16'),_0x27fa71,_0x9afb('0x14'),JSON[_0x9afb('0x17')](_0x3e6a29));if(_0x3e6a29['error']){if(_0x3e6a29[_0x9afb('0x18')]['code']===0x1f4){logger['error'](_0x9afb('0x13'),_0x27fa71,_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);return _0x5bb974(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}logger[_0x9afb('0x18')](_0x9afb('0x13'),_0x27fa71,_0x3e6a29['error'][_0x9afb('0x19')]);return _0x56f477(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}else{logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,'request\x20sent');_0x56f477(_0x3e6a29[_0x9afb('0x1a')]['message']);}})[_0x9afb('0x1b')](function(_0x12aa19){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x27fa71,_0x12aa19);_0x5bb974(_0x12aa19);});});}exports[_0x9afb('0x1c')]=function(_0x1217d9){var _0x3d8450=this;return new Promise(function(_0x424692,_0x3bd256){return db['VoiceExtension'][_0x9afb('0x1d')]({'raw':_0x1217d9['options']?_0x1217d9['options'][_0x9afb('0x1e')]===undefined?!![]:![]:!![],'where':_0x1217d9[_0x9afb('0x1f')]?_0x1217d9[_0x9afb('0x1f')][_0x9afb('0x20')]||null:null,'attributes':_0x1217d9['options']?_0x1217d9[_0x9afb('0x1f')][_0x9afb('0x21')]||null:null,'limit':_0x1217d9['options']?_0x1217d9['options']['limit']||null:null,'include':_0x1217d9[_0x9afb('0x1f')]?_0x1217d9['options'][_0x9afb('0x22')]?_[_0x9afb('0x23')](_0x1217d9['options'][_0x9afb('0x22')],function(_0x28beba){return{'model':db[_0x28beba[_0x9afb('0x24')]],'as':_0x28beba['as'],'attributes':_0x28beba[_0x9afb('0x21')],'include':_0x28beba['include']?_[_0x9afb('0x23')](_0x28beba['include'],function(_0x29e092){return{'model':db[_0x29e092['model']],'as':_0x29e092['as'],'attributes':_0x29e092['attributes'],'include':_0x29e092[_0x9afb('0x22')]?_[_0x9afb('0x23')](_0x29e092[_0x9afb('0x22')],function(_0x13a33e){return{'model':db[_0x13a33e[_0x9afb('0x24')]],'as':_0x13a33e['as'],'attributes':_0x13a33e[_0x9afb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0x11')](function(_0x5aabd5){logger['info'](_0x9afb('0x1c'),_0x1217d9);logger[_0x9afb('0x15')]('GetVoiceExtension',_0x1217d9,JSON[_0x9afb('0x17')](_0x5aabd5));_0x424692(_0x5aabd5);})[_0x9afb('0x1b')](function(_0x5560bd){logger[_0x9afb('0x18')](_0x9afb('0x1c'),_0x5560bd[_0x9afb('0x19')],_0x1217d9);_0x3bd256(_0x3d8450[_0x9afb('0x18')](0x1f4,_0x5560bd[_0x9afb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ef89333..9819773 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 _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x3b7a5a,_0x4736e1){var _0x3ea432=function(_0x3d02bf){while(--_0x3d02bf){_0x3b7a5a['push'](_0x3b7a5a['shift']());}};_0x3ea432(++_0x4736e1);}(_0xf494,0x1c6));var _0x4f49=function(_0x3627d5,_0x249c42){_0x3627d5=_0x3627d5-0x0;var _0x2443c0=_0xf494[_0x3627d5];return _0x2443c0;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x1e3a48,_0x553825){var _0x27b122=function(_0x582f8a){while(--_0x582f8a){_0x1e3a48['push'](_0x1e3a48['shift']());}};_0x27b122(++_0x553825);}(_0x326f,0xd1));var _0xf326=function(_0xf40797,_0x2f256e){_0xf40797=_0xf40797-0x0;var _0x1a0ce7=_0x326f[_0xf40797];return _0x1a0ce7;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 4ed25cd..e4ff9f2 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','getMessages','post','create','put','delete','exports'];(function(_0x1eaf5e,_0x333d16){var _0x409fa2=function(_0x57f633){while(--_0x57f633){_0x1eaf5e['push'](_0x1eaf5e['shift']());}};_0x409fa2(++_0x333d16);}(_0x326f,0xd1));var _0xf326=function(_0x1b5e7e,_0x4b3536){_0x1b5e7e=_0x1b5e7e-0x0;var _0x35f0b1=_0x326f[_0x1b5e7e];return _0x35f0b1;};'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/messages',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 +var _0xa46e=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/messages','create','put','update'];(function(_0x583e82,_0xbacde1){var _0x2ad34f=function(_0x71024b){while(--_0x71024b){_0x583e82['push'](_0x583e82['shift']());}};_0x2ad34f(++_0xbacde1);}(_0xa46e,0x8a));var _0xea46=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xa46e[_0x412e27];return _0x53da42;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./voiceMail.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xea46('0xc')]);router[_0xea46('0xd')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router[_0xea46('0xf')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d09c513..d650e5e 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 _0xa5b8=['email','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','contest_mailbox'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa5b8,0x15d));var _0x8a5b=function(_0x31ccdf,_0x4b46e9){_0x31ccdf=_0x31ccdf-0x0;var _0x198f85=_0xa5b8[_0x31ccdf];return _0x198f85;};'use strict';var Sequelize=require('sequelize');module[_0x8a5b('0x0')]={'customer_id':{'type':Sequelize[_0x8a5b('0x1')]},'context':{'type':Sequelize[_0x8a5b('0x1')],'defaultValue':'from-voicemail','unique':_0x8a5b('0x2')},'mailbox':{'type':Sequelize[_0x8a5b('0x1')],'defaultValue':'','allowNull':![],'unique':_0x8a5b('0x2')},'password':{'type':Sequelize[_0x8a5b('0x1')]},'fullname':{'type':Sequelize[_0x8a5b('0x1')]},'email':{'type':Sequelize[_0x8a5b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x387cad){this['setDataValue'](_0x8a5b('0x3'),typeof _0x387cad==='string'&&_0x387cad[_0x8a5b('0x4')]()?_0x387cad[_0x8a5b('0x4')]():null);}},'pager':{'type':Sequelize[_0x8a5b('0x1')]},'tz':{'type':Sequelize[_0x8a5b('0x1')],'defaultValue':_0x8a5b('0x5')},'attach':{'type':Sequelize['ENUM'](_0x8a5b('0x6'),'no'),'defaultValue':_0x8a5b('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8a5b('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x8a5b('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x8a5b('0x7')](_0x8a5b('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8a5b('0x7')](_0x8a5b('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8a5b('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8a5b('0x7')](_0x8a5b('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8a5b('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x8a5b('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8a5b('0x7')](_0x8a5b('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8a5b('0x7')](_0x8a5b('0x6'),'no'),'defaultValue':_0x8a5b('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8a5b('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8a5b('0x7')](_0x8a5b('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x8a5b('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x8a5b('0x9')},'emailsubject':{'type':Sequelize[_0x8a5b('0x1')]},'emailbody':{'type':Sequelize[_0x8a5b('0x1')]},'maxsecs':{'type':Sequelize[_0x8a5b('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8a5b('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8a5b('0xb')],'get':function(){return this[_0x8a5b('0xc')](_0x8a5b('0xd'))+_0x8a5b('0xe')+this[_0x8a5b('0xc')](_0x8a5b('0xf'));}}}; \ No newline at end of file +var _0x5727=['sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox'];(function(_0x5b763d,_0x35ce75){var _0x3f504e=function(_0x37e146){while(--_0x37e146){_0x5b763d['push'](_0x5b763d['shift']());}};_0x3f504e(++_0x35ce75);}(_0x5727,0xb4));var _0x7572=function(_0x27c201,_0xd947bf){_0x27c201=_0x27c201-0x0;var _0x3cabde=_0x5727[_0x27c201];return _0x3cabde;};'use strict';var Sequelize=require(_0x7572('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7572('0x1')]},'context':{'type':Sequelize[_0x7572('0x1')],'defaultValue':_0x7572('0x2'),'unique':_0x7572('0x3')},'mailbox':{'type':Sequelize[_0x7572('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7572('0x1')]},'fullname':{'type':Sequelize[_0x7572('0x1')]},'email':{'type':Sequelize[_0x7572('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4d30dd){this[_0x7572('0x4')](_0x7572('0x5'),typeof _0x4d30dd==='string'&&_0x4d30dd[_0x7572('0x6')]()?_0x4d30dd['trim']():null);}},'pager':{'type':Sequelize[_0x7572('0x1')]},'tz':{'type':Sequelize[_0x7572('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':_0x7572('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7572('0x7')]('yes','no'),'defaultValue':_0x7572('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7572('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x7572('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7572('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':_0x7572('0x8'),'allowNull':![]},'stamp':{'type':_0x7572('0x9')},'emailsubject':{'type':Sequelize[_0x7572('0x1')]},'emailbody':{'type':Sequelize[_0x7572('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7572('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7572('0xb')],'get':function(){return this[_0x7572('0xc')]('fullname')+_0x7572('0xd')+this[_0x7572('0xc')](_0x7572('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 386ca81..f489995 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['body','getMessages','findOne','order','sort','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','autoAssociation'];(function(_0x45f106,_0x33b7ca){var _0x2c8626=function(_0x3f13e5){while(--_0x3f13e5){_0x45f106['push'](_0x45f106['shift']());}};_0x2c8626(++_0x33b7ca);}(_0xed3c,0x1a6));var _0xced3=function(_0x5e5ad9,_0x18845f){_0x5e5ad9=_0x5e5ad9-0x0;var _0x396036=_0xed3c[_0x5e5ad9];return _0x396036;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){var _0x50f7c1=_0x101708[_0xced3('0x23')]({'plain':!![]});var _0x23f92b='Voicemails';return db[_0xced3('0x24')]['destroy']({'where':{'type':_0x23f92b,'resourceId':_0x50f7c1['id']}})[_0xced3('0x21')](function(){return _0x101708;});})[_0xced3('0x21')](function(){_0x559fa2[_0xced3('0x17')](0xcc)[_0xced3('0x25')]();});}};}function handleEntityNotFound(_0x2ec2c4,_0x502cf1){return function(_0x5454c0){if(!_0x5454c0){_0x2ec2c4[_0xced3('0x16')](0x194);}return _0x5454c0;};}function handleError(_0x5bb425,_0x2ab8a8){_0x2ab8a8=_0x2ab8a8||0x1f4;return function(_0x1e6923){logger['error'](_0x1e6923[_0xced3('0x26')]);if(_0x1e6923[_0xced3('0x27')]){delete _0x1e6923[_0xced3('0x27')];}_0x5bb425[_0xced3('0x17')](_0x2ab8a8)[_0xced3('0x28')](_0x1e6923);};}exports[_0xced3('0x29')]=function(_0x895a32,_0x41d003){var _0x116cc7={},_0x559b8e={},_0xa78899={'count':0x0,'rows':[]};var _0x1b8baa=_[_0xced3('0x2a')](db[_0xced3('0x2b')][_0xced3('0x2c')],function(_0x21e4a2){return{'name':_0x21e4a2[_0xced3('0x2d')],'type':_0x21e4a2[_0xced3('0x2e')][_0xced3('0x2f')]};});_0x559b8e[_0xced3('0x30')]=_[_0xced3('0x2a')](_0x1b8baa,_0xced3('0x27'));_0x559b8e[_0xced3('0x31')]=_[_0xced3('0x32')](_0x895a32[_0xced3('0x31')]);_0x559b8e[_0xced3('0x33')]=_[_0xced3('0x34')](_0x559b8e[_0xced3('0x30')],_0x559b8e[_0xced3('0x31')]);_0x116cc7[_0xced3('0x35')]=_[_0xced3('0x34')](_0x559b8e['model'],qs[_0xced3('0x36')](_0x895a32['query'][_0xced3('0x36')]));_0x116cc7[_0xced3('0x35')]=_0x116cc7[_0xced3('0x35')][_0xced3('0x37')]?_0x116cc7[_0xced3('0x35')]:_0x559b8e[_0xced3('0x30')];if(!_0x895a32[_0xced3('0x31')][_0xced3('0x38')](_0xced3('0x39'))){_0x116cc7[_0xced3('0x1a')]=qs['limit'](_0x895a32[_0xced3('0x31')][_0xced3('0x1a')]);_0x116cc7['offset']=qs[_0xced3('0x1c')](_0x895a32[_0xced3('0x31')][_0xced3('0x1c')]);}_0x116cc7['order']=qs['sort'](_0x895a32[_0xced3('0x31')]['sort']);_0x116cc7[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x895a32[_0xced3('0x31')],_0x559b8e[_0xced3('0x33')]),_0x1b8baa);if(_0x895a32[_0xced3('0x31')]['filter']){_0x116cc7[_0xced3('0x3a')]=_['merge'](_0x116cc7['where'],{'$or':_[_0xced3('0x2a')](_0x1b8baa,function(_0x31e281){if(_0x31e281[_0xced3('0x2e')]!=='VIRTUAL'){var _0xb2cf20={};_0xb2cf20[_0x31e281[_0xced3('0x27')]]={'$like':'%'+_0x895a32[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0xb2cf20;}})});}_0x116cc7=_[_0xced3('0x3c')]({},_0x116cc7,_0x895a32[_0xced3('0x3d')]);var _0x30e890={'where':_0x116cc7[_0xced3('0x3a')]};return db[_0xced3('0x2b')][_0xced3('0x1b')](_0x30e890)[_0xced3('0x21')](function(_0x38855f){_0xa78899[_0xced3('0x1b')]=_0x38855f;if(_0x895a32[_0xced3('0x31')][_0xced3('0x3e')]){_0x116cc7['include']=[{'all':!![]}];}return db[_0xced3('0x2b')][_0xced3('0x3f')](_0x116cc7);})[_0xced3('0x21')](function(_0x1a6c1f){_0xa78899[_0xced3('0x40')]=_0x1a6c1f;return _0xa78899;})[_0xced3('0x21')](respondWithFilteredResult(_0x41d003,_0x116cc7))[_0xced3('0x41')](handleError(_0x41d003,null));};exports[_0xced3('0x42')]=function(_0x1ab7e0,_0x4cea5c){var _0x6c0238={'raw':!![],'where':{'id':_0x1ab7e0[_0xced3('0x43')]['id']}},_0x47ab23={};_0x47ab23[_0xced3('0x30')]=_[_0xced3('0x32')](db['VoiceMail'][_0xced3('0x2c')]);_0x47ab23[_0xced3('0x31')]=_[_0xced3('0x32')](_0x1ab7e0[_0xced3('0x31')]);_0x47ab23['filters']=_[_0xced3('0x34')](_0x47ab23[_0xced3('0x30')],_0x47ab23[_0xced3('0x31')]);_0x6c0238[_0xced3('0x35')]=_[_0xced3('0x34')](_0x47ab23['model'],qs[_0xced3('0x36')](_0x1ab7e0[_0xced3('0x31')][_0xced3('0x36')]));_0x6c0238[_0xced3('0x35')]=_0x6c0238[_0xced3('0x35')][_0xced3('0x37')]?_0x6c0238[_0xced3('0x35')]:_0x47ab23['model'];if(_0x1ab7e0[_0xced3('0x31')][_0xced3('0x3e')]){_0x6c0238['include']=[{'all':!![]}];}_0x6c0238=_['merge']({},_0x6c0238,_0x1ab7e0[_0xced3('0x3d')]);return db['VoiceMail'][_0xced3('0x44')](_0x6c0238)[_0xced3('0x21')](handleEntityNotFound(_0x4cea5c,null))[_0xced3('0x21')](respondWithResult(_0x4cea5c,null))[_0xced3('0x41')](handleError(_0x4cea5c,null));};exports[_0xced3('0x45')]=function(_0x1b3396,_0x3700ed){return db[_0xced3('0x2b')][_0xced3('0x45')](_0x1b3396['body'],{})[_0xced3('0x21')](function(_0x8df206){var _0x2aa876=_0x1b3396[_0xced3('0x46')][_0xced3('0x23')]({'plain':!![]});if(!_0x2aa876)throw new Error(_0xced3('0x47'));if(_0x2aa876['role']===_0xced3('0x46')){var _0x629ecf=_0x8df206[_0xced3('0x23')]({'plain':!![]});var _0x409da0=_0xced3('0x48');return db[_0xced3('0x49')][_0xced3('0x44')]({'where':{'name':_0x409da0,'userProfileId':_0x2aa876[_0xced3('0x4a')]},'raw':!![]})[_0xced3('0x21')](function(_0x44d779){if(_0x44d779&&_0x44d779[_0xced3('0x4b')]===0x0){return db[_0xced3('0x24')]['create']({'name':_0x629ecf[_0xced3('0x27')],'resourceId':_0x629ecf['id'],'type':_0x44d779['name'],'sectionId':_0x44d779['id']},{})[_0xced3('0x21')](function(){return _0x8df206;});}else{return _0x8df206;}})[_0xced3('0x41')](function(_0xc93e05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc93e05);throw _0xc93e05;});}return _0x8df206;})[_0xced3('0x21')](respondWithResult(_0x3700ed,0xc9))[_0xced3('0x41')](handleError(_0x3700ed,null));};exports['update']=function(_0x3f41cc,_0x4ae67d){if(_0x3f41cc[_0xced3('0x4c')]['id']){delete _0x3f41cc[_0xced3('0x4c')]['id'];}return db['VoiceMail'][_0xced3('0x44')]({'where':{'id':_0x3f41cc[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x4ae67d,null))['then'](saveUpdates(_0x3f41cc[_0xced3('0x4c')],null))['then'](respondWithResult(_0x4ae67d,null))[_0xced3('0x41')](handleError(_0x4ae67d,null));};exports[_0xced3('0x22')]=function(_0x4694b8,_0x168c36){return db[_0xced3('0x2b')][_0xced3('0x44')]({'where':{'id':_0x4694b8[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x168c36,null))[_0xced3('0x21')](removeEntity(_0x168c36,null))[_0xced3('0x41')](handleError(_0x168c36,null));};exports[_0xced3('0x4d')]=function(_0x4b14dd,_0x3859e8,_0x3de35d){return db[_0xced3('0x2b')][_0xced3('0x4e')]({'where':{'id':_0x4b14dd[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3859e8,null))['then'](function(_0x9db425){var _0x171081;var _0x21ea6a={},_0x440a0f={};_0x440a0f[_0xced3('0x30')]=_[_0xced3('0x32')](db['VoiceMailMessage'][_0xced3('0x2c')]);_0x440a0f['query']=_[_0xced3('0x32')](_0x4b14dd['query']);_0x440a0f[_0xced3('0x33')]=_[_0xced3('0x34')](_0x440a0f['model'],_0x440a0f[_0xced3('0x31')]);_0x21ea6a[_0xced3('0x35')]=_[_0xced3('0x34')](_0x440a0f[_0xced3('0x30')],qs[_0xced3('0x36')](_0x4b14dd[_0xced3('0x31')][_0xced3('0x36')]));_0x21ea6a[_0xced3('0x35')]=_0x21ea6a[_0xced3('0x35')][_0xced3('0x37')]?_0x21ea6a[_0xced3('0x35')]:_0x440a0f[_0xced3('0x30')];if(!_0x4b14dd[_0xced3('0x31')]['hasOwnProperty'](_0xced3('0x39'))){_0x21ea6a[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x4b14dd[_0xced3('0x31')]['limit']);_0x21ea6a[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x4b14dd[_0xced3('0x31')][_0xced3('0x1c')]);}_0x21ea6a[_0xced3('0x4f')]=qs[_0xced3('0x50')](_0x4b14dd[_0xced3('0x31')]['sort']);_0x21ea6a[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x4b14dd[_0xced3('0x31')],_0x440a0f[_0xced3('0x33')]));if(_0x4b14dd[_0xced3('0x31')][_0xced3('0x3b')]){_0x21ea6a['where']=_[_0xced3('0x3c')](_0x21ea6a[_0xced3('0x3a')],{'$or':_[_0xced3('0x2a')](_0x21ea6a[_0xced3('0x35')],function(_0x3992d2){var _0x385d45={};_0x385d45[_0x3992d2]={'$like':'%'+_0x4b14dd[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0x385d45;})});}_0x21ea6a[_0xced3('0x3a')]=_[_0xced3('0x3c')](_0x21ea6a['where'],{'mailboxuser':_0x9db425[_0xced3('0x51')]});_0x21ea6a=_[_0xced3('0x3c')]({},_0x21ea6a,_0x4b14dd['options']);return db['VoiceMailMessage'][_0xced3('0x52')](_0x21ea6a)['then'](respondWithFilteredResult(_0x3859e8,_0x21ea6a));})[_0xced3('0x41')](handleError(_0x3859e8,null));}; \ No newline at end of file +var _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x3f3eda,_0x3885f0){var _0xd4278e=function(_0xdebb9e){while(--_0xdebb9e){_0x3f3eda['push'](_0x3f3eda['shift']());}};_0xd4278e(++_0x3885f0);}(_0x236c,0x155));var _0xc236=function(_0x330885,_0x5abb99){_0x330885=_0x330885-0x0;var _0x2d1c21=_0x236c[_0x330885];return _0x2d1c21;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b9f54f1..042bcb8 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 _0x5a8b=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x49c092,_0x4b90d9){var _0xf084f8=function(_0x5d11d6){while(--_0x5d11d6){_0x49c092['push'](_0x49c092['shift']());}};_0xf084f8(++_0x4b90d9);}(_0x5a8b,0x106));var _0xb5a8=function(_0x1e0e87,_0x11b30a){_0x1e0e87=_0x1e0e87-0x0;var _0x29ef84=_0x5a8b[_0x1e0e87];return _0x29ef84;};'use strict';var _=require(_0xb5a8('0x0'));var util=require(_0xb5a8('0x1'));var logger=require(_0xb5a8('0x2'))(_0xb5a8('0x3'));var moment=require('moment');var BPromise=require(_0xb5a8('0x4'));var rp=require(_0xb5a8('0x5'));var fs=require('fs');var path=require(_0xb5a8('0x6'));var rimraf=require(_0xb5a8('0x7'));var config=require(_0xb5a8('0x8'));var attributes=require(_0xb5a8('0x9'));module[_0xb5a8('0xa')]=function(_0x42e32a,_0x1418d5){return _0x42e32a[_0xb5a8('0xb')](_0xb5a8('0xc'),attributes,{'tableName':_0xb5a8('0xd'),'paranoid':![],'indexes':[{'name':_0xb5a8('0xe'),'fields':[_0xb5a8('0xf'),_0xb5a8('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8be=['mailbox_context','mailbox','context','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','define','VoiceMail'];(function(_0x36a9d4,_0x37f651){var _0x2fe5b4=function(_0x5e2be0){while(--_0x5e2be0){_0x36a9d4['push'](_0x36a9d4['shift']());}};_0x2fe5b4(++_0x37f651);}(_0xa8be,0x1b5));var _0xea8b=function(_0x7a354a,_0x5ad3c2){_0x7a354a=_0x7a354a-0x0;var _0x13e6cb=_0xa8be[_0x7a354a];return _0x13e6cb;};'use strict';var _=require(_0xea8b('0x0'));var util=require(_0xea8b('0x1'));var logger=require('../../config/logger')(_0xea8b('0x2'));var moment=require(_0xea8b('0x3'));var BPromise=require(_0xea8b('0x4'));var rp=require(_0xea8b('0x5'));var fs=require('fs');var path=require(_0xea8b('0x6'));var rimraf=require('rimraf');var config=require(_0xea8b('0x7'));var attributes=require(_0xea8b('0x8'));module['exports']=function(_0x448772,_0x57052a){return _0x448772[_0xea8b('0x9')](_0xea8b('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xea8b('0xb'),'fields':[_0xea8b('0xc'),_0xea8b('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 b1fe7ab..ed6fc09 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 _0xab4f=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x51a684,_0x44b4ff){var _0x1d4c4=function(_0x2d8c81){while(--_0x2d8c81){_0x51a684['push'](_0x51a684['shift']());}};_0x1d4c4(++_0x44b4ff);}(_0xab4f,0x1ce));var _0xfab4=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xab4f[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xfab4('0x0'));var util=require(_0xfab4('0x1'));var moment=require('moment');var BPromise=require(_0xfab4('0x2'));var rs=require(_0xfab4('0x3'));var fs=require('fs');var Redis=require(_0xfab4('0x4'));var db=require(_0xfab4('0x5'))['db'];var utils=require(_0xfab4('0x6'));var logger=require('../../config/logger')(_0xfab4('0x7'));var config=require(_0xfab4('0x8'));var jayson=require(_0xfab4('0x9'));var client=jayson[_0xfab4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414b72,_0x5b2350,_0x382a42){return new BPromise(function(_0x817c6d,_0x584038){return client['request'](_0x414b72,_0x382a42)['then'](function(_0x538577){logger[_0xfab4('0xb')](_0xfab4('0xc'),_0x5b2350,_0xfab4('0xd'));logger[_0xfab4('0xe')](_0xfab4('0xf'),_0x5b2350,_0xfab4('0xd'),JSON['stringify'](_0x538577));if(_0x538577['error']){if(_0x538577['error'][_0xfab4('0x10')]===0x1f4){logger[_0xfab4('0x11')](_0xfab4('0xc'),_0x5b2350,_0x538577[_0xfab4('0x11')]['message']);return _0x584038(_0x538577[_0xfab4('0x11')][_0xfab4('0x12')]);}logger['error'](_0xfab4('0xc'),_0x5b2350,_0x538577[_0xfab4('0x11')][_0xfab4('0x12')]);return _0x817c6d(_0x538577['error']['message']);}else{logger['info'](_0xfab4('0xc'),_0x5b2350,_0xfab4('0xd'));_0x817c6d(_0x538577[_0xfab4('0x13')][_0xfab4('0x12')]);}})['catch'](function(_0x11dd32){logger[_0xfab4('0x11')](_0xfab4('0xc'),_0x5b2350,_0x11dd32);_0x584038(_0x11dd32);});});} \ No newline at end of file +var _0x0d06=['client','http','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2ebb38,_0x1ae950){var _0xc4f063=function(_0x2616e0){while(--_0x2616e0){_0x2ebb38['push'](_0x2ebb38['shift']());}};_0xc4f063(++_0x1ae950);}(_0x0d06,0xa8));var _0x60d0=function(_0x49b076,_0x4fb74e){_0x49b076=_0x49b076-0x0;var _0xa3609=_0x0d06[_0x49b076];return _0xa3609;};'use strict';var _=require(_0x60d0('0x0'));var util=require(_0x60d0('0x1'));var moment=require(_0x60d0('0x2'));var BPromise=require(_0x60d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60d0('0x4'))['db'];var utils=require(_0x60d0('0x5'));var logger=require(_0x60d0('0x6'))('rpc');var config=require(_0x60d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x60d0('0x8')][_0x60d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12da81,_0x543eac,_0x1ab0af){return new BPromise(function(_0x1aea2f,_0xc75190){return client['request'](_0x12da81,_0x1ab0af)[_0x60d0('0xa')](function(_0x522a1b){logger['info'](_0x60d0('0xb'),_0x543eac,_0x60d0('0xc'));logger[_0x60d0('0xd')](_0x60d0('0xe'),_0x543eac,'request\x20sent',JSON[_0x60d0('0xf')](_0x522a1b));if(_0x522a1b['error']){if(_0x522a1b['error'][_0x60d0('0x10')]===0x1f4){logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x522a1b['error'][_0x60d0('0x12')]);return _0xc75190(_0x522a1b[_0x60d0('0x11')][_0x60d0('0x12')]);}logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x522a1b[_0x60d0('0x11')][_0x60d0('0x12')]);return _0x1aea2f(_0x522a1b[_0x60d0('0x11')]['message']);}else{logger[_0x60d0('0x13')]('VoiceMail,\x20%s,\x20%s',_0x543eac,_0x60d0('0xc'));_0x1aea2f(_0x522a1b[_0x60d0('0x14')][_0x60d0('0x12')]);}})[_0x60d0('0x15')](function(_0x4fd2e8){logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x4fd2e8);_0xc75190(_0x4fd2e8);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index b236aba..6995548 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 _0x9a14=['show','/:id/download','isAuthenticated','download','post','create','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get'];(function(_0x59d60b,_0x5cd6d3){var _0x304a0e=function(_0x3c06bc){while(--_0x3c06bc){_0x59d60b['push'](_0x59d60b['shift']());}};_0x304a0e(++_0x5cd6d3);}(_0x9a14,0x137));var _0x49a1=function(_0x87bdec,_0x541011){_0x87bdec=_0x87bdec-0x0;var _0x1c8658=_0x9a14[_0x87bdec];return _0x1c8658;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49a1('0x0'));var timeout=require(_0x49a1('0x1'));var express=require(_0x49a1('0x2'));var router=express[_0x49a1('0x3')]();var fs_extra=require(_0x49a1('0x4'));var auth=require(_0x49a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x49a1('0x6'));var controller=require(_0x49a1('0x7'));router[_0x49a1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x49a1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x49a1('0x9')]);router['get'](_0x49a1('0xa'),auth[_0x49a1('0xb')](),controller[_0x49a1('0xc')]);router[_0x49a1('0xd')]('/',auth[_0x49a1('0xb')](),controller[_0x49a1('0xe')]);router['put'](_0x49a1('0xf'),auth[_0x49a1('0xb')](),controller[_0x49a1('0x10')]);router[_0x49a1('0x11')](_0x49a1('0xf'),auth[_0x49a1('0xb')](),controller[_0x49a1('0x12')]);module[_0x49a1('0x13')]=router; \ No newline at end of file +var _0x5dc0=['index','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x5dc0,0x97));var _0x05dc=function(_0x40f09a,_0x3743b6){_0x40f09a=_0x40f09a-0x0;var _0x2eb96c=_0x5dc0[_0x40f09a];return _0x2eb96c;};'use strict';var multer=require(_0x05dc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x05dc('0x1'));var router=express[_0x05dc('0x2')]();var fs_extra=require(_0x05dc('0x3'));var auth=require(_0x05dc('0x4'));var interaction=require(_0x05dc('0x5'));var config=require(_0x05dc('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x05dc('0x7')]('/',auth[_0x05dc('0x8')](),controller[_0x05dc('0x9')]);router[_0x05dc('0x7')](_0x05dc('0xa'),auth[_0x05dc('0x8')](),controller[_0x05dc('0xb')]);router[_0x05dc('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x05dc('0xc')]);router[_0x05dc('0xd')]('/',auth[_0x05dc('0x8')](),controller[_0x05dc('0xe')]);router[_0x05dc('0xf')](_0x05dc('0xa'),auth['isAuthenticated'](),controller[_0x05dc('0x10')]);router[_0x05dc('0x11')](_0x05dc('0xa'),auth[_0x05dc('0x8')](),controller[_0x05dc('0x12')]);module[_0x05dc('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 56b6f97..ac288a0 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 _0x1f46=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','literal'];(function(_0x4fab9b,_0x576e64){var _0x3faeba=function(_0x59ed03){while(--_0x59ed03){_0x4fab9b['push'](_0x4fab9b['shift']());}};_0x3faeba(++_0x576e64);}(_0x1f46,0xb5));var _0x61f4=function(_0x45b3cd,_0xfd8427){_0x45b3cd=_0x45b3cd-0x0;var _0x546df6=_0x1f46[_0x45b3cd];return _0x546df6;};'use strict';var Sequelize=require(_0x61f4('0x0'));module[_0x61f4('0x1')]={'name':{'type':Sequelize[_0x61f4('0x2')],'get':function(_0x34d292){return this[_0x61f4('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x61f4('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x61f4('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x61f4('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x61f4('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x61f4('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x61f4('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x61f4('0x6')](_0x61f4('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x61f4('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x61f4('0x8')](_0x61f4('0x9'))}}; \ No newline at end of file +var _0xa995=['getDataValue','INTEGER','STRING','BLOB','literal','exports','VIRTUAL'];(function(_0x1e0f14,_0xd08932){var _0x13f77e=function(_0x46d187){while(--_0x46d187){_0x1e0f14['push'](_0x1e0f14['shift']());}};_0x13f77e(++_0xd08932);}(_0xa995,0x140));var _0x5a99=function(_0x13353a,_0x9cc572){_0x13353a=_0x13353a-0x0;var _0x100cd4=_0xa995[_0x13353a];return _0x100cd4;};'use strict';var Sequelize=require('sequelize');module[_0x5a99('0x0')]={'name':{'type':Sequelize[_0x5a99('0x1')],'get':function(_0xa6b458){return this[_0x5a99('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5a99('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5a99('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x5a99('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 e8854ab..edb54ed 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 _0x1e5f=['type','VIRTUAL','options','includeAll','include','rows','show','params','find','create','catch','body','destroy','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x46bdd8,_0x442f70){var _0x498891=function(_0x25b9c1){while(--_0x25b9c1){_0x46bdd8['push'](_0x46bdd8['shift']());}};_0x498891(++_0x442f70);}(_0x1e5f,0x11c));var _0xf1e5=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0x1e5f[_0x2a7b8e];return _0x29b5c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1e5('0x0'));var zipdir=require(_0xf1e5('0x1'));var jsonpatch=require(_0xf1e5('0x2'));var rp=require('request-promise');var moment=require(_0xf1e5('0x3'));var BPromise=require(_0xf1e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf1e5('0x5'));var sox=require(_0xf1e5('0x6'));var csv=require('to-csv');var ejs=require(_0xf1e5('0x7'));var fs=require('fs');var fs_extra=require(_0xf1e5('0x8'));var _=require(_0xf1e5('0x9'));var squel=require(_0xf1e5('0xa'));var crypto=require(_0xf1e5('0xb'));var jsforce=require(_0xf1e5('0xc'));var deskjs=require(_0xf1e5('0xd'));var toCsv=require(_0xf1e5('0xe'));var querystring=require(_0xf1e5('0xf'));var Papa=require(_0xf1e5('0x10'));var Redis=require('ioredis');var authService=require(_0xf1e5('0x11'));var qs=require(_0xf1e5('0x12'));var as=require(_0xf1e5('0x13'));var hardwareService=require(_0xf1e5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf1e5('0x15'));var config=require(_0xf1e5('0x16'));var licenseUtil=require(_0xf1e5('0x17'));var db=require(_0xf1e5('0x18'))['db'];function respondWithStatusCode(_0x4cbba1,_0x230b2f){_0x230b2f=_0x230b2f||0xcc;return function(_0x2eecee){if(_0x2eecee){return _0x4cbba1[_0xf1e5('0x19')](_0x230b2f);}return _0x4cbba1[_0xf1e5('0x1a')](_0x230b2f)['end']();};}function respondWithResult(_0x31d579,_0x1a1e3c){_0x1a1e3c=_0x1a1e3c||0xc8;return function(_0x260b74){if(_0x260b74){return _0x31d579[_0xf1e5('0x1a')](_0x1a1e3c)[_0xf1e5('0x1b')](_0x260b74);}};}function respondWithFilteredResult(_0x38febf,_0x3a0fe0){return function(_0xb2fd81){if(_0xb2fd81){var _0x16754a=typeof _0x3a0fe0['offset']===_0xf1e5('0x1c')&&typeof _0x3a0fe0[_0xf1e5('0x1d')]===_0xf1e5('0x1c');var _0x1ab845=_0xb2fd81[_0xf1e5('0x1e')];var _0x57f6c1=_0x16754a?0x0:_0x3a0fe0[_0xf1e5('0x1f')];var _0x2116ea=_0x16754a?_0xb2fd81[_0xf1e5('0x1e')]:_0x3a0fe0[_0xf1e5('0x1f')]+_0x3a0fe0['limit'];var _0x1c224f;if(_0x2116ea>=_0x1ab845){_0x2116ea=_0x1ab845;_0x1c224f=0xc8;}else{_0x1c224f=0xce;}_0x38febf[_0xf1e5('0x1a')](_0x1c224f);return _0x38febf[_0xf1e5('0x20')](_0xf1e5('0x21'),_0x57f6c1+'-'+_0x2116ea+'/'+_0x1ab845)[_0xf1e5('0x1b')](_0xb2fd81);}return null;};}function patchUpdates(_0x300e74){return function(_0x525334){try{jsonpatch['apply'](_0x525334,_0x300e74,!![]);}catch(_0x58eee1){return BPromise[_0xf1e5('0x22')](_0x58eee1);}return _0x525334[_0xf1e5('0x23')]();};}function saveUpdates(_0x360657,_0x381a56){return function(_0x345de9){if(_0x345de9){return _0x345de9[_0xf1e5('0x24')](_0x360657)[_0xf1e5('0x25')](function(_0x3ab8d6){return _0x3ab8d6;});}return null;};}function removeEntity(_0x2f5aff,_0x23b0e4){return function(_0x35d09a){if(_0x35d09a){return _0x35d09a['destroy']()[_0xf1e5('0x25')](function(){_0x2f5aff[_0xf1e5('0x1a')](0xcc)[_0xf1e5('0x26')]();});}};}function handleEntityNotFound(_0x422516,_0x4e97b3){return function(_0x1bf8d0){if(!_0x1bf8d0){_0x422516[_0xf1e5('0x19')](0x194);}return _0x1bf8d0;};}function handleError(_0x2b874c,_0x59ad74){_0x59ad74=_0x59ad74||0x1f4;return function(_0x32ef98){logger[_0xf1e5('0x27')](_0x32ef98[_0xf1e5('0x28')]);if(_0x32ef98['name']){delete _0x32ef98[_0xf1e5('0x29')];}_0x2b874c[_0xf1e5('0x1a')](_0x59ad74)[_0xf1e5('0x2a')](_0x32ef98);};}exports[_0xf1e5('0x2b')]=function(_0x28f209,_0x6ef224){var _0x20e6b1={},_0x217d78={},_0x67271a={'count':0x0,'rows':[]};var _0x116030=_[_0xf1e5('0x2c')](db[_0xf1e5('0x2d')][_0xf1e5('0x2e')],function(_0x507d13){return{'name':_0x507d13['fieldName'],'type':_0x507d13['type'][_0xf1e5('0x2f')]};});_0x217d78[_0xf1e5('0x30')]=_[_0xf1e5('0x31')](_[_0xf1e5('0x2c')](_0x116030,'name'),[_0xf1e5('0x29')]);_0x217d78[_0xf1e5('0x32')]=_[_0xf1e5('0x33')](_0x28f209['query']);_0x217d78[_0xf1e5('0x34')]=_[_0xf1e5('0x35')](_0x217d78['model'],_0x217d78['query']);_0x20e6b1[_0xf1e5('0x36')]=_['intersection'](_0x217d78[_0xf1e5('0x30')],qs[_0xf1e5('0x37')](_0x28f209[_0xf1e5('0x32')][_0xf1e5('0x37')]));_0x20e6b1[_0xf1e5('0x36')]=_0x20e6b1[_0xf1e5('0x36')][_0xf1e5('0x38')]?_0x20e6b1['attributes']:_0x217d78[_0xf1e5('0x30')];if(!_0x28f209['query']['hasOwnProperty'](_0xf1e5('0x39'))){_0x20e6b1['limit']=qs[_0xf1e5('0x1d')](_0x28f209[_0xf1e5('0x32')][_0xf1e5('0x1d')]);_0x20e6b1['offset']=qs[_0xf1e5('0x1f')](_0x28f209[_0xf1e5('0x32')][_0xf1e5('0x1f')]);}_0x20e6b1[_0xf1e5('0x3a')]=qs[_0xf1e5('0x3b')](_0x28f209[_0xf1e5('0x32')][_0xf1e5('0x3b')]);_0x20e6b1[_0xf1e5('0x3c')]=qs[_0xf1e5('0x34')](_[_0xf1e5('0x3d')](_0x28f209[_0xf1e5('0x32')],_0x217d78[_0xf1e5('0x34')]),_0x116030);if(_0x28f209[_0xf1e5('0x32')][_0xf1e5('0x3e')]){_0x20e6b1['where']=_[_0xf1e5('0x3f')](_0x20e6b1[_0xf1e5('0x3c')],{'$or':_['map'](_0x116030,function(_0x4719da){if(_0x4719da[_0xf1e5('0x40')]!==_0xf1e5('0x41')){var _0x5201eb={};_0x5201eb[_0x4719da[_0xf1e5('0x29')]]={'$like':'%'+_0x28f209['query'][_0xf1e5('0x3e')]+'%'};return _0x5201eb;}})});}_0x20e6b1=_[_0xf1e5('0x3f')]({},_0x20e6b1,_0x28f209[_0xf1e5('0x42')]);var _0xfa1c38={'where':_0x20e6b1[_0xf1e5('0x3c')]};return db[_0xf1e5('0x2d')][_0xf1e5('0x1e')](_0xfa1c38)[_0xf1e5('0x25')](function(_0x3cdd33){_0x67271a[_0xf1e5('0x1e')]=_0x3cdd33;if(_0x28f209[_0xf1e5('0x32')][_0xf1e5('0x43')]){_0x20e6b1[_0xf1e5('0x44')]=[{'all':!![]}];}return db[_0xf1e5('0x2d')]['findAll'](_0x20e6b1);})[_0xf1e5('0x25')](function(_0x354b70){_0x67271a[_0xf1e5('0x45')]=_0x354b70;return _0x67271a;})[_0xf1e5('0x25')](respondWithFilteredResult(_0x6ef224,_0x20e6b1))['catch'](handleError(_0x6ef224,null));};exports[_0xf1e5('0x46')]=function(_0x328dd8,_0x415c95){var _0x536c67={'raw':!![],'where':{'id':_0x328dd8[_0xf1e5('0x47')]['id']}},_0x1eff5c={};_0x1eff5c[_0xf1e5('0x30')]=_['keys'](db[_0xf1e5('0x2d')][_0xf1e5('0x2e')]);_0x1eff5c['query']=_[_0xf1e5('0x33')](_0x328dd8['query']);_0x1eff5c[_0xf1e5('0x34')]=_[_0xf1e5('0x35')](_0x1eff5c[_0xf1e5('0x30')],_0x1eff5c[_0xf1e5('0x32')]);_0x536c67[_0xf1e5('0x36')]=_[_0xf1e5('0x35')](_0x1eff5c[_0xf1e5('0x30')],qs[_0xf1e5('0x37')](_0x328dd8[_0xf1e5('0x32')][_0xf1e5('0x37')]));_0x536c67[_0xf1e5('0x36')]=_0x536c67[_0xf1e5('0x36')][_0xf1e5('0x38')]?_0x536c67[_0xf1e5('0x36')]:_0x1eff5c[_0xf1e5('0x30')];if(_0x328dd8[_0xf1e5('0x32')][_0xf1e5('0x43')]){_0x536c67[_0xf1e5('0x44')]=[{'all':!![]}];}_0x536c67=_[_0xf1e5('0x3f')]({},_0x536c67,_0x328dd8[_0xf1e5('0x42')]);return db['VoiceMailMessage'][_0xf1e5('0x48')](_0x536c67)[_0xf1e5('0x25')](handleEntityNotFound(_0x415c95,null))[_0xf1e5('0x25')](respondWithResult(_0x415c95,null))['catch'](handleError(_0x415c95,null));};exports[_0xf1e5('0x49')]=function(_0x169b15,_0x257326){return db[_0xf1e5('0x2d')][_0xf1e5('0x49')](_0x169b15['body'],{})[_0xf1e5('0x25')](respondWithResult(_0x257326,0xc9))[_0xf1e5('0x4a')](handleError(_0x257326,null));};exports[_0xf1e5('0x24')]=function(_0x219a89,_0x5e0481){if(_0x219a89[_0xf1e5('0x4b')]['id']){delete _0x219a89[_0xf1e5('0x4b')]['id'];}return db[_0xf1e5('0x2d')][_0xf1e5('0x48')]({'where':{'id':_0x219a89['params']['id']}})['then'](handleEntityNotFound(_0x5e0481,null))['then'](saveUpdates(_0x219a89['body'],null))['then'](respondWithResult(_0x5e0481,null))[_0xf1e5('0x4a')](handleError(_0x5e0481,null));};exports[_0xf1e5('0x4c')]=function(_0x7beffd,_0x402a82){return db[_0xf1e5('0x2d')]['find']({'where':{'id':_0x7beffd[_0xf1e5('0x47')]['id']}})[_0xf1e5('0x25')](handleEntityNotFound(_0x402a82,null))[_0xf1e5('0x25')](removeEntity(_0x402a82,null))[_0xf1e5('0x4a')](handleError(_0x402a82,null));};exports[_0xf1e5('0x4d')]=function(_0x47eaab,_0x175935,_0x4f36dc){return db[_0xf1e5('0x2d')][_0xf1e5('0x48')]({'where':{'id':_0x47eaab[_0xf1e5('0x47')]['id']},'attributes':['id',_0xf1e5('0x4e'),'msg_id']})[_0xf1e5('0x25')](handleEntityNotFound(_0x175935,null))[_0xf1e5('0x25')](function(_0x1d850f){if(_0x1d850f){if(!_0x1d850f[_0xf1e5('0x4e')]){throw new db[(_0xf1e5('0x4f'))][(_0xf1e5('0x50'))](_0xf1e5('0x51'));}var _0x3e7656={'Content-Type':_0xf1e5('0x52'),'Content-Disposition':_0xf1e5('0x53')};if(_0x1d850f[_0xf1e5('0x54')]){_0x3e7656['Content-Disposition']=_0xf1e5('0x55')+_0x1d850f[_0xf1e5('0x54')]+_0xf1e5('0x56');}_0x175935[_0xf1e5('0x20')](_0x3e7656);return _0x175935[_0xf1e5('0x2a')](new Buffer(_0x1d850f[_0xf1e5('0x4e')]));}})[_0xf1e5('0x4a')](handleError(_0x175935,null));}; \ No newline at end of file +var _0xbffe=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','VoiceMailMessage','rawAttributes','type','model','differenceBy','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbffe,0xe5));var _0xebff=function(_0x371ffd,_0x4571ab){_0x371ffd=_0x371ffd-0x0;var _0x5f1dd3=_0xbffe[_0x371ffd];return _0x5f1dd3;};'use strict';var emlformat=require(_0xebff('0x0'));var rimraf=require(_0xebff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebff('0x2'));var rp=require(_0xebff('0x3'));var moment=require(_0xebff('0x4'));var BPromise=require(_0xebff('0x5'));var Mustache=require(_0xebff('0x6'));var util=require('util');var path=require(_0xebff('0x7'));var sox=require('sox');var csv=require(_0xebff('0x8'));var ejs=require(_0xebff('0x9'));var fs=require('fs');var fs_extra=require(_0xebff('0xa'));var _=require(_0xebff('0xb'));var squel=require(_0xebff('0xc'));var crypto=require('crypto');var jsforce=require(_0xebff('0xd'));var deskjs=require(_0xebff('0xe'));var toCsv=require('to-csv');var querystring=require(_0xebff('0xf'));var Papa=require('papaparse');var Redis=require(_0xebff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xebff('0x11'));var as=require(_0xebff('0x12'));var hardwareService=require(_0xebff('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xebff('0x14'));var config=require(_0xebff('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xebff('0x16'))['db'];function respondWithStatusCode(_0x52a606,_0x225a46){_0x225a46=_0x225a46||0xcc;return function(_0x3490d2){if(_0x3490d2){return _0x52a606[_0xebff('0x17')](_0x225a46);}return _0x52a606['status'](_0x225a46)[_0xebff('0x18')]();};}function respondWithResult(_0x2bc7a7,_0x50d7d3){_0x50d7d3=_0x50d7d3||0xc8;return function(_0x33bf6f){if(_0x33bf6f){return _0x2bc7a7[_0xebff('0x19')](_0x50d7d3)['json'](_0x33bf6f);}};}function respondWithFilteredResult(_0xe31672,_0x4fd78e){return function(_0x4c624b){if(_0x4c624b){var _0x36d575=typeof _0x4fd78e[_0xebff('0x1a')]===_0xebff('0x1b')&&typeof _0x4fd78e[_0xebff('0x1c')]===_0xebff('0x1b');var _0x39c919=_0x4c624b[_0xebff('0x1d')];var _0x5d4871=_0x36d575?0x0:_0x4fd78e[_0xebff('0x1a')];var _0xba8831=_0x36d575?_0x4c624b[_0xebff('0x1d')]:_0x4fd78e['offset']+_0x4fd78e[_0xebff('0x1c')];var _0x558da7;if(_0xba8831>=_0x39c919){_0xba8831=_0x39c919;_0x558da7=0xc8;}else{_0x558da7=0xce;}_0xe31672[_0xebff('0x19')](_0x558da7);return _0xe31672[_0xebff('0x1e')](_0xebff('0x1f'),_0x5d4871+'-'+_0xba8831+'/'+_0x39c919)[_0xebff('0x20')](_0x4c624b);}return null;};}function patchUpdates(_0x51098c){return function(_0x5b4ddd){try{jsonpatch[_0xebff('0x21')](_0x5b4ddd,_0x51098c,!![]);}catch(_0x3524f){return BPromise[_0xebff('0x22')](_0x3524f);}return _0x5b4ddd[_0xebff('0x23')]();};}function saveUpdates(_0xcb9be0,_0x2ee2eb){return function(_0x3a6d1c){if(_0x3a6d1c){return _0x3a6d1c[_0xebff('0x24')](_0xcb9be0)[_0xebff('0x25')](function(_0x2df18a){return _0x2df18a;});}return null;};}function removeEntity(_0x2d08f7,_0x2ae287){return function(_0x56567e){if(_0x56567e){return _0x56567e[_0xebff('0x26')]()['then'](function(){_0x2d08f7[_0xebff('0x19')](0xcc)[_0xebff('0x18')]();});}};}function handleEntityNotFound(_0x4fe095,_0x45ed11){return function(_0x28785a){if(!_0x28785a){_0x4fe095[_0xebff('0x17')](0x194);}return _0x28785a;};}function handleError(_0x21eb8d,_0x1f13ae){_0x1f13ae=_0x1f13ae||0x1f4;return function(_0x588c71){logger['error'](_0x588c71[_0xebff('0x27')]);if(_0x588c71[_0xebff('0x28')]){delete _0x588c71[_0xebff('0x28')];}_0x21eb8d[_0xebff('0x19')](_0x1f13ae)[_0xebff('0x29')](_0x588c71);};}exports['index']=function(_0x4e8c73,_0x11bfeb){var _0x238a23={},_0x31cd6e={},_0x372254={'count':0x0,'rows':[]};var _0x1bfcf0=_[_0xebff('0x2a')](db[_0xebff('0x2b')][_0xebff('0x2c')],function(_0x5d3cfd){return{'name':_0x5d3cfd['fieldName'],'type':_0x5d3cfd[_0xebff('0x2d')]['key']};});_0x31cd6e[_0xebff('0x2e')]=_[_0xebff('0x2f')](_[_0xebff('0x2a')](_0x1bfcf0,_0xebff('0x28')),[_0xebff('0x28')]);_0x31cd6e[_0xebff('0x30')]=_[_0xebff('0x31')](_0x4e8c73['query']);_0x31cd6e[_0xebff('0x32')]=_['intersection'](_0x31cd6e[_0xebff('0x2e')],_0x31cd6e[_0xebff('0x30')]);_0x238a23['attributes']=_['intersection'](_0x31cd6e[_0xebff('0x2e')],qs[_0xebff('0x33')](_0x4e8c73[_0xebff('0x30')]['fields']));_0x238a23[_0xebff('0x34')]=_0x238a23[_0xebff('0x34')][_0xebff('0x35')]?_0x238a23[_0xebff('0x34')]:_0x31cd6e[_0xebff('0x2e')];if(!_0x4e8c73[_0xebff('0x30')][_0xebff('0x36')]('nolimit')){_0x238a23[_0xebff('0x1c')]=qs[_0xebff('0x1c')](_0x4e8c73[_0xebff('0x30')][_0xebff('0x1c')]);_0x238a23[_0xebff('0x1a')]=qs[_0xebff('0x1a')](_0x4e8c73[_0xebff('0x30')][_0xebff('0x1a')]);}_0x238a23['order']=qs[_0xebff('0x37')](_0x4e8c73['query'][_0xebff('0x37')]);_0x238a23[_0xebff('0x38')]=qs[_0xebff('0x32')](_[_0xebff('0x39')](_0x4e8c73[_0xebff('0x30')],_0x31cd6e['filters']),_0x1bfcf0);if(_0x4e8c73['query'][_0xebff('0x3a')]){_0x238a23[_0xebff('0x38')]=_[_0xebff('0x3b')](_0x238a23[_0xebff('0x38')],{'$or':_['map'](_0x1bfcf0,function(_0x2e238b){if(_0x2e238b['type']!==_0xebff('0x3c')){var _0x5e56cc={};_0x5e56cc[_0x2e238b[_0xebff('0x28')]]={'$like':'%'+_0x4e8c73[_0xebff('0x30')][_0xebff('0x3a')]+'%'};return _0x5e56cc;}})});}_0x238a23=_[_0xebff('0x3b')]({},_0x238a23,_0x4e8c73[_0xebff('0x3d')]);var _0x512e63={'where':_0x238a23[_0xebff('0x38')]};return db[_0xebff('0x2b')][_0xebff('0x1d')](_0x512e63)[_0xebff('0x25')](function(_0xe059c4){_0x372254[_0xebff('0x1d')]=_0xe059c4;if(_0x4e8c73[_0xebff('0x30')][_0xebff('0x3e')]){_0x238a23[_0xebff('0x3f')]=[{'all':!![]}];}return db[_0xebff('0x2b')][_0xebff('0x40')](_0x238a23);})[_0xebff('0x25')](function(_0x4cc4e4){_0x372254['rows']=_0x4cc4e4;return _0x372254;})[_0xebff('0x25')](respondWithFilteredResult(_0x11bfeb,_0x238a23))[_0xebff('0x41')](handleError(_0x11bfeb,null));};exports[_0xebff('0x42')]=function(_0x455933,_0xf2e86f){var _0x25b8f2={'raw':!![],'where':{'id':_0x455933[_0xebff('0x43')]['id']}},_0x5bd5c6={};_0x5bd5c6['model']=_['keys'](db[_0xebff('0x2b')][_0xebff('0x2c')]);_0x5bd5c6['query']=_['keys'](_0x455933['query']);_0x5bd5c6[_0xebff('0x32')]=_[_0xebff('0x44')](_0x5bd5c6[_0xebff('0x2e')],_0x5bd5c6[_0xebff('0x30')]);_0x25b8f2[_0xebff('0x34')]=_[_0xebff('0x44')](_0x5bd5c6[_0xebff('0x2e')],qs['fields'](_0x455933[_0xebff('0x30')][_0xebff('0x33')]));_0x25b8f2[_0xebff('0x34')]=_0x25b8f2[_0xebff('0x34')][_0xebff('0x35')]?_0x25b8f2[_0xebff('0x34')]:_0x5bd5c6['model'];if(_0x455933[_0xebff('0x30')][_0xebff('0x3e')]){_0x25b8f2[_0xebff('0x3f')]=[{'all':!![]}];}_0x25b8f2=_[_0xebff('0x3b')]({},_0x25b8f2,_0x455933[_0xebff('0x3d')]);return db['VoiceMailMessage'][_0xebff('0x45')](_0x25b8f2)[_0xebff('0x25')](handleEntityNotFound(_0xf2e86f,null))['then'](respondWithResult(_0xf2e86f,null))[_0xebff('0x41')](handleError(_0xf2e86f,null));};exports['create']=function(_0x3c40ff,_0x7deeff){return db[_0xebff('0x2b')][_0xebff('0x46')](_0x3c40ff['body'],{})['then'](respondWithResult(_0x7deeff,0xc9))[_0xebff('0x41')](handleError(_0x7deeff,null));};exports['update']=function(_0x3a224a,_0x5250d6){if(_0x3a224a['body']['id']){delete _0x3a224a[_0xebff('0x47')]['id'];}return db[_0xebff('0x2b')][_0xebff('0x45')]({'where':{'id':_0x3a224a['params']['id']}})[_0xebff('0x25')](handleEntityNotFound(_0x5250d6,null))['then'](saveUpdates(_0x3a224a[_0xebff('0x47')],null))[_0xebff('0x25')](respondWithResult(_0x5250d6,null))[_0xebff('0x41')](handleError(_0x5250d6,null));};exports[_0xebff('0x26')]=function(_0x3da6a5,_0x17eb82){return db['VoiceMailMessage'][_0xebff('0x45')]({'where':{'id':_0x3da6a5[_0xebff('0x43')]['id']}})[_0xebff('0x25')](handleEntityNotFound(_0x17eb82,null))[_0xebff('0x25')](removeEntity(_0x17eb82,null))[_0xebff('0x41')](handleError(_0x17eb82,null));};exports['download']=function(_0x37e216,_0x294999,_0xe5016f){return db[_0xebff('0x2b')][_0xebff('0x45')]({'where':{'id':_0x37e216['params']['id']},'attributes':['id','recording',_0xebff('0x48')]})[_0xebff('0x25')](handleEntityNotFound(_0x294999,null))[_0xebff('0x25')](function(_0xf9c3e7){if(_0xf9c3e7){if(!_0xf9c3e7[_0xebff('0x49')]){throw new db[(_0xebff('0x4a'))]['ValidationError'](_0xebff('0x4b'));}var _0x4343c1={'Content-Type':'audio/wav','Content-Disposition':_0xebff('0x4c')};if(_0xf9c3e7['msg_id']){_0x4343c1[_0xebff('0x4d')]='attachment;\x20filename=\x22'+_0xf9c3e7[_0xebff('0x48')]+_0xebff('0x4e');}_0x294999[_0xebff('0x1e')](_0x4343c1);return _0x294999[_0xebff('0x29')](new Buffer(_0xf9c3e7[_0xebff('0x49')]));}})[_0xebff('0x41')](handleError(_0x294999,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index de05833..9a3d8d8 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 _0x9970=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x10cd25,_0x46221f){var _0x25b159=function(_0x43699f){while(--_0x43699f){_0x10cd25['push'](_0x10cd25['shift']());}};_0x25b159(++_0x46221f);}(_0x9970,0x8c));var _0x0997=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x9970[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require(_0x0997('0x0'));var logger=require(_0x0997('0x1'))('api');var moment=require(_0x0997('0x2'));var BPromise=require(_0x0997('0x3'));var rp=require(_0x0997('0x4'));var fs=require('fs');var path=require(_0x0997('0x5'));var rimraf=require(_0x0997('0x6'));var config=require(_0x0997('0x7'));var attributes=require(_0x0997('0x8'));module[_0x0997('0x9')]=function(_0x5b1b82,_0x29ee18){return _0x5b1b82[_0x0997('0xa')](_0x0997('0xb'),attributes,{'tableName':_0x0997('0xc'),'paranoid':![],'indexes':[{'name':_0x0997('0xd'),'fields':[_0x0997('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6b2b=['./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','request-promise','../../config/environment'];(function(_0x4d8e1b,_0x5e1d87){var _0x4c0275=function(_0xe8f83a){while(--_0xe8f83a){_0x4d8e1b['push'](_0x4d8e1b['shift']());}};_0x4c0275(++_0x5e1d87);}(_0x6b2b,0xb5));var _0xb6b2=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x6b2b[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xb6b2('0x0'));var util=require(_0xb6b2('0x1'));var logger=require(_0xb6b2('0x2'))('api');var moment=require(_0xb6b2('0x3'));var BPromise=require('bluebird');var rp=require(_0xb6b2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb6b2('0x5'));var attributes=require(_0xb6b2('0x6'));module[_0xb6b2('0x7')]=function(_0x126c2e,_0x9d3116){return _0x126c2e['define'](_0xb6b2('0x8'),attributes,{'tableName':_0xb6b2('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xb6b2('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2b59c58..c93871e 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 _0xb908=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb908,0xb1));var _0x8b90=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0xb908[_0x13992d];return _0x3d15bf;};'use strict';var _=require(_0x8b90('0x0'));var util=require('util');var moment=require(_0x8b90('0x1'));var BPromise=require(_0x8b90('0x2'));var rs=require(_0x8b90('0x3'));var fs=require('fs');var Redis=require(_0x8b90('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b90('0x5'));var logger=require('../../config/logger')(_0x8b90('0x6'));var config=require(_0x8b90('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b90('0x8')][_0x8b90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54bcda,_0x35ed0c,_0x555f61){return new BPromise(function(_0x5e40ab,_0x23da2a){return client[_0x8b90('0xa')](_0x54bcda,_0x555f61)[_0x8b90('0xb')](function(_0x329ff1){logger['info'](_0x8b90('0xc'),_0x35ed0c,_0x8b90('0xd'));logger[_0x8b90('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x35ed0c,_0x8b90('0xd'),JSON[_0x8b90('0xf')](_0x329ff1));if(_0x329ff1[_0x8b90('0x10')]){if(_0x329ff1[_0x8b90('0x10')][_0x8b90('0x11')]===0x1f4){logger[_0x8b90('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x35ed0c,_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);return _0x23da2a(_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);}logger[_0x8b90('0x10')](_0x8b90('0xc'),_0x35ed0c,_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);return _0x5e40ab(_0x329ff1[_0x8b90('0x10')][_0x8b90('0x12')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x35ed0c,'request\x20sent');_0x5e40ab(_0x329ff1[_0x8b90('0x13')][_0x8b90('0x12')]);}})[_0x8b90('0x14')](function(_0x1d2c2c){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x35ed0c,_0x1d2c2c);_0x23da2a(_0x1d2c2c);});});} \ No newline at end of file +var _0xa555=['../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xa555,0x131));var _0x5a55=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0xa555[_0x512c83];return _0x1f7f25;};'use strict';var _=require(_0x5a55('0x0'));var util=require(_0x5a55('0x1'));var moment=require(_0x5a55('0x2'));var BPromise=require(_0x5a55('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a55('0x4'));var db=require(_0x5a55('0x5'))['db'];var utils=require(_0x5a55('0x6'));var logger=require(_0x5a55('0x7'))(_0x5a55('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a55('0x9'));var client=jayson[_0x5a55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d79d,_0x16284b,_0x406726){return new BPromise(function(_0x53c0d0,_0x5a8617){return client[_0x5a55('0xb')](_0x40d79d,_0x406726)[_0x5a55('0xc')](function(_0x49a191){logger[_0x5a55('0xd')](_0x5a55('0xe'),_0x16284b,'request\x20sent');logger[_0x5a55('0xf')](_0x5a55('0x10'),_0x16284b,_0x5a55('0x11'),JSON[_0x5a55('0x12')](_0x49a191));if(_0x49a191[_0x5a55('0x13')]){if(_0x49a191[_0x5a55('0x13')][_0x5a55('0x14')]===0x1f4){logger[_0x5a55('0x13')](_0x5a55('0xe'),_0x16284b,_0x49a191[_0x5a55('0x13')][_0x5a55('0x15')]);return _0x5a8617(_0x49a191['error'][_0x5a55('0x15')]);}logger[_0x5a55('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x16284b,_0x49a191[_0x5a55('0x13')][_0x5a55('0x15')]);return _0x53c0d0(_0x49a191['error'][_0x5a55('0x15')]);}else{logger[_0x5a55('0xd')](_0x5a55('0xe'),_0x16284b,_0x5a55('0x11'));_0x53c0d0(_0x49a191[_0x5a55('0x16')]['message']);}})[_0x5a55('0x17')](function(_0x5b34b8){logger[_0x5a55('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x16284b,_0x5b34b8);_0x5a8617(_0x5b34b8);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b9120b7..c1cc0ed 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 _0x0be9=['get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller'];(function(_0x51818c,_0x53d965){var _0x102e5d=function(_0x5b277c){while(--_0x5b277c){_0x51818c['push'](_0x51818c['shift']());}};_0x102e5d(++_0x53d965);}(_0x0be9,0x1ef));var _0x90be=function(_0x3f564d,_0xd06b0d){_0x3f564d=_0x3f564d-0x0;var _0x105ac1=_0x0be9[_0x3f564d];return _0x105ac1;};'use strict';var multer=require(_0x90be('0x0'));var util=require(_0x90be('0x1'));var path=require(_0x90be('0x2'));var timeout=require(_0x90be('0x3'));var express=require(_0x90be('0x4'));var router=express[_0x90be('0x5')]();var fs_extra=require(_0x90be('0x6'));var auth=require(_0x90be('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90be('0x8'));router[_0x90be('0x9')]('/',auth[_0x90be('0xa')](),controller[_0x90be('0xb')]);router[_0x90be('0x9')](_0x90be('0xc'),auth['isAuthenticated'](),controller[_0x90be('0xd')]);router[_0x90be('0x9')](_0x90be('0xe'),auth[_0x90be('0xa')](),controller[_0x90be('0xf')]);router['post']('/',auth[_0x90be('0xa')](),controller['create']);router[_0x90be('0x10')](_0x90be('0xe'),auth['isAuthenticated'](),controller[_0x90be('0x11')]);router[_0x90be('0x12')](_0x90be('0xc'),auth[_0x90be('0xa')](),controller[_0x90be('0x13')]);router[_0x90be('0x14')](_0x90be('0xc'),auth[_0x90be('0xa')](),controller[_0x90be('0x15')]);router['delete']('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x90be('0x16')]);module[_0x90be('0x17')]=router; \ No newline at end of file +var _0xd370=['delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceMusicOnHold.controller','index','/:id','isAuthenticated','show','get','/:id/sounds','getSounds','post','create','addSound','update','destroy'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xd370,0x101));var _0x0d37=function(_0x16ee48,_0x4e660d){_0x16ee48=_0x16ee48-0x0;var _0x23f7bf=_0xd370[_0x16ee48];return _0x23f7bf;};'use strict';var multer=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var path=require(_0x0d37('0x2'));var timeout=require(_0x0d37('0x3'));var express=require(_0x0d37('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d37('0x5'));var config=require('../../config/environment');var controller=require(_0x0d37('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d37('0x7')]);router['get'](_0x0d37('0x8'),auth[_0x0d37('0x9')](),controller[_0x0d37('0xa')]);router[_0x0d37('0xb')](_0x0d37('0xc'),auth[_0x0d37('0x9')](),controller[_0x0d37('0xd')]);router[_0x0d37('0xe')]('/',auth[_0x0d37('0x9')](),controller[_0x0d37('0xf')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x0d37('0x10')]);router['put'](_0x0d37('0x8'),auth[_0x0d37('0x9')](),controller[_0x0d37('0x11')]);router['delete']('/:id',auth[_0x0d37('0x9')](),controller[_0x0d37('0x12')]);router[_0x0d37('0x13')](_0x0d37('0x14'),auth['isAuthenticated'](),controller[_0x0d37('0x15')]);module[_0x0d37('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3cf6b03..17998c2 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 _0xb562=['STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x3c42a7,_0x30c01f){var _0x1dbfe1=function(_0x19ad44){while(--_0x19ad44){_0x3c42a7['push'](_0x3c42a7['shift']());}};_0x1dbfe1(++_0x30c01f);}(_0xb562,0x1d8));var _0x2b56=function(_0x4e2983,_0x22d3d3){_0x4e2983=_0x4e2983-0x0;var _0x41392c=_0xb562[_0x4e2983];return _0x41392c;};'use strict';var Sequelize=require(_0x2b56('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b56('0x1')],'allowNull':![],'unique':_0x2b56('0x2')},'mode':{'type':Sequelize[_0x2b56('0x3')](_0x2b56('0x4'),_0x2b56('0x5'),_0x2b56('0x6'),_0x2b56('0x7'),'quietmp3',_0x2b56('0x8')),'allowNull':!![],'defaultValue':_0x2b56('0x5')},'directory':{'type':Sequelize[_0x2b56('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2b56('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2b56('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x2b56('0x9')},'defaultEntry':{'type':Sequelize[_0x2b56('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5b08=['BOOLEAN','sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP'];(function(_0x418af3,_0x5c3cd4){var _0x25429a=function(_0x115a26){while(--_0x115a26){_0x418af3['push'](_0x418af3['shift']());}};_0x25429a(++_0x5c3cd4);}(_0x5b08,0xbc));var _0x85b0=function(_0x32d330,_0xe907c8){_0x32d330=_0x32d330-0x0;var _0xe81a43=_0x5b08[_0x32d330];return _0xe81a43;};'use strict';var Sequelize=require(_0x85b0('0x0'));module[_0x85b0('0x1')]={'name':{'type':Sequelize[_0x85b0('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x85b0('0x3')]('custom',_0x85b0('0x4'),_0x85b0('0x5'),_0x85b0('0x6'),'quietmp3',_0x85b0('0x7')),'allowNull':!![],'defaultValue':_0x85b0('0x4')},'directory':{'type':Sequelize[_0x85b0('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x85b0('0x2')],'allowNull':!![],'defaultValue':_0x85b0('0x8')},'format':{'type':Sequelize[_0x85b0('0x2')],'allowNull':!![]},'stamp':{'type':_0x85b0('0x9')},'defaultEntry':{'type':Sequelize[_0x85b0('0xa')],'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 883c3a0..06268a4 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 _0xdebf=['files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','message','removeSound','id2','getSounds','order','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','catch','params','keys','include','body','find','create','sequelize','transaction','mode','directory','join','root','server/files/moh'];(function(_0x19659b,_0x3e75fd){var _0x3df8fe=function(_0x143c4f){while(--_0x143c4f){_0x19659b['push'](_0x19659b['shift']());}};_0x3df8fe(++_0x3e75fd);}(_0xdebf,0x10b));var _0xfdeb=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xdebf[_0x550d12];return _0x12103d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdeb('0x0'));var jsonpatch=require(_0xfdeb('0x1'));var rp=require(_0xfdeb('0x2'));var moment=require(_0xfdeb('0x3'));var BPromise=require(_0xfdeb('0x4'));var Mustache=require(_0xfdeb('0x5'));var util=require(_0xfdeb('0x6'));var path=require(_0xfdeb('0x7'));var sox=require(_0xfdeb('0x8'));var csv=require(_0xfdeb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdeb('0xa'));var squel=require(_0xfdeb('0xb'));var crypto=require(_0xfdeb('0xc'));var jsforce=require(_0xfdeb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfdeb('0x9'));var querystring=require(_0xfdeb('0xe'));var Papa=require(_0xfdeb('0xf'));var Redis=require('ioredis');var authService=require(_0xfdeb('0x10'));var qs=require(_0xfdeb('0x11'));var as=require(_0xfdeb('0x12'));var hardwareService=require(_0xfdeb('0x13'));var logger=require(_0xfdeb('0x14'))(_0xfdeb('0x15'));var utils=require('../../config/utils');var config=require(_0xfdeb('0x16'));var licenseUtil=require(_0xfdeb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fb620,_0xb960f2){_0xb960f2=_0xb960f2||0xcc;return function(_0x596ff8){if(_0x596ff8){return _0x1fb620[_0xfdeb('0x18')](_0xb960f2);}return _0x1fb620[_0xfdeb('0x19')](_0xb960f2)[_0xfdeb('0x1a')]();};}function respondWithResult(_0x426e9f,_0xdd28d2){_0xdd28d2=_0xdd28d2||0xc8;return function(_0x5d2cc4){if(_0x5d2cc4){return _0x426e9f[_0xfdeb('0x19')](_0xdd28d2)[_0xfdeb('0x1b')](_0x5d2cc4);}};}function respondWithFilteredResult(_0x339cf8,_0x171fa2){return function(_0x2e4ca3){if(_0x2e4ca3){var _0x260f45=typeof _0x171fa2[_0xfdeb('0x1c')]===_0xfdeb('0x1d')&&typeof _0x171fa2[_0xfdeb('0x1e')]===_0xfdeb('0x1d');var _0x1c0094=_0x2e4ca3['count'];var _0x18e4e0=_0x260f45?0x0:_0x171fa2[_0xfdeb('0x1c')];var _0x485d27=_0x260f45?_0x2e4ca3['count']:_0x171fa2[_0xfdeb('0x1c')]+_0x171fa2['limit'];var _0x5df8d6;if(_0x485d27>=_0x1c0094){_0x485d27=_0x1c0094;_0x5df8d6=0xc8;}else{_0x5df8d6=0xce;}_0x339cf8[_0xfdeb('0x19')](_0x5df8d6);return _0x339cf8['set'](_0xfdeb('0x1f'),_0x18e4e0+'-'+_0x485d27+'/'+_0x1c0094)[_0xfdeb('0x1b')](_0x2e4ca3);}return null;};}function patchUpdates(_0x43bdb6){return function(_0x3adb15){try{jsonpatch[_0xfdeb('0x20')](_0x3adb15,_0x43bdb6,!![]);}catch(_0x4d5062){return BPromise[_0xfdeb('0x21')](_0x4d5062);}return _0x3adb15[_0xfdeb('0x22')]();};}function saveUpdates(_0x1f75ef,_0x1bf084){return function(_0x5256fd){if(_0x5256fd){return _0x5256fd[_0xfdeb('0x23')](_0x1f75ef)[_0xfdeb('0x24')](function(_0x1ba413){return _0x1ba413;});}return null;};}function removeEntity(_0x211213,_0x5f0c09){return function(_0x138a67){if(_0x138a67){return _0x138a67['destroy']()[_0xfdeb('0x24')](function(){var _0x59db28=_0x138a67[_0xfdeb('0x25')]({'plain':!![]});var _0x2031a4=_0xfdeb('0x26');return db[_0xfdeb('0x27')][_0xfdeb('0x28')]({'where':{'type':_0x2031a4,'resourceId':_0x59db28['id']}})[_0xfdeb('0x24')](function(){return _0x138a67;});})[_0xfdeb('0x24')](function(){_0x211213[_0xfdeb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53375f,_0x3260ab){return function(_0xde38f0){if(!_0xde38f0){_0x53375f[_0xfdeb('0x18')](0x194);}return _0xde38f0;};}function handleError(_0x12e604,_0x26b253){_0x26b253=_0x26b253||0x1f4;return function(_0x43c7e8){logger['error'](_0x43c7e8[_0xfdeb('0x29')]);if(_0x43c7e8[_0xfdeb('0x2a')]){delete _0x43c7e8[_0xfdeb('0x2a')];}_0x12e604[_0xfdeb('0x19')](_0x26b253)[_0xfdeb('0x2b')](_0x43c7e8);};}exports[_0xfdeb('0x2c')]=function(_0x2bc279,_0x42705f){var _0x3978f1={},_0xd3f283={},_0x4f9d45={'count':0x0,'rows':[]};var _0x9b24d9=_[_0xfdeb('0x2d')](db[_0xfdeb('0x2e')][_0xfdeb('0x2f')],function(_0x1106b0){return{'name':_0x1106b0[_0xfdeb('0x30')],'type':_0x1106b0[_0xfdeb('0x31')][_0xfdeb('0x32')]};});_0xd3f283[_0xfdeb('0x33')]=_['map'](_0x9b24d9,_0xfdeb('0x2a'));_0xd3f283[_0xfdeb('0x34')]=_['keys'](_0x2bc279[_0xfdeb('0x34')]);_0xd3f283['filters']=_[_0xfdeb('0x35')](_0xd3f283[_0xfdeb('0x33')],_0xd3f283[_0xfdeb('0x34')]);_0x3978f1['attributes']=_[_0xfdeb('0x35')](_0xd3f283[_0xfdeb('0x33')],qs[_0xfdeb('0x36')](_0x2bc279[_0xfdeb('0x34')]['fields']));_0x3978f1[_0xfdeb('0x37')]=_0x3978f1[_0xfdeb('0x37')][_0xfdeb('0x38')]?_0x3978f1['attributes']:_0xd3f283['model'];if(!_0x2bc279[_0xfdeb('0x34')][_0xfdeb('0x39')](_0xfdeb('0x3a'))){_0x3978f1[_0xfdeb('0x1e')]=qs[_0xfdeb('0x1e')](_0x2bc279[_0xfdeb('0x34')][_0xfdeb('0x1e')]);_0x3978f1[_0xfdeb('0x1c')]=qs[_0xfdeb('0x1c')](_0x2bc279[_0xfdeb('0x34')][_0xfdeb('0x1c')]);}_0x3978f1['order']=qs[_0xfdeb('0x3b')](_0x2bc279[_0xfdeb('0x34')]['sort']);delete _0x2bc279[_0xfdeb('0x34')][_0xfdeb('0x3b')];_0x3978f1['where']=qs[_0xfdeb('0x3c')](_[_0xfdeb('0x3d')](_0x2bc279[_0xfdeb('0x34')],_0xd3f283[_0xfdeb('0x3c')]),_0x9b24d9);if(_0x2bc279[_0xfdeb('0x34')][_0xfdeb('0x3e')]){_0x3978f1['where']=_[_0xfdeb('0x3f')](_0x3978f1[_0xfdeb('0x40')],{'$or':_[_0xfdeb('0x2d')](_0x9b24d9,function(_0x4295f6){if(_0x4295f6['type']!==_0xfdeb('0x41')){var _0x2b3727={};_0x2b3727[_0x4295f6[_0xfdeb('0x2a')]]={'$like':'%'+_0x2bc279[_0xfdeb('0x34')]['filter']+'%'};return _0x2b3727;}})});}_0x3978f1=_[_0xfdeb('0x3f')]({},_0x3978f1,_0x2bc279[_0xfdeb('0x42')]);var _0x18a8f0={'where':_0x3978f1[_0xfdeb('0x40')]};return db[_0xfdeb('0x2e')][_0xfdeb('0x43')](_0x18a8f0)['then'](function(_0x1a0d40){_0x4f9d45[_0xfdeb('0x43')]=_0x1a0d40;if(_0x2bc279[_0xfdeb('0x34')][_0xfdeb('0x44')]){_0x3978f1['include']=[{'all':!![]}];}return db[_0xfdeb('0x2e')][_0xfdeb('0x45')](_0x3978f1);})[_0xfdeb('0x24')](function(_0x5ae061){_0x4f9d45['rows']=_0x5ae061;return _0x4f9d45;})[_0xfdeb('0x24')](respondWithFilteredResult(_0x42705f,_0x3978f1))[_0xfdeb('0x46')](handleError(_0x42705f,null));};exports['show']=function(_0x24102e,_0x168b08){var _0x4ee73c={'raw':![],'where':{'id':_0x24102e[_0xfdeb('0x47')]['id']}},_0x317282={};_0x317282[_0xfdeb('0x33')]=_['keys'](db[_0xfdeb('0x2e')]['rawAttributes']);_0x317282[_0xfdeb('0x34')]=_[_0xfdeb('0x48')](_0x24102e[_0xfdeb('0x34')]);_0x317282['filters']=_[_0xfdeb('0x35')](_0x317282[_0xfdeb('0x33')],_0x317282[_0xfdeb('0x34')]);_0x4ee73c[_0xfdeb('0x37')]=_[_0xfdeb('0x35')](_0x317282[_0xfdeb('0x33')],qs[_0xfdeb('0x36')](_0x24102e[_0xfdeb('0x34')][_0xfdeb('0x36')]));_0x4ee73c[_0xfdeb('0x37')]=_0x4ee73c[_0xfdeb('0x37')][_0xfdeb('0x38')]?_0x4ee73c[_0xfdeb('0x37')]:_0x317282['model'];if(_0x24102e[_0xfdeb('0x34')][_0xfdeb('0x44')]){_0x4ee73c[_0xfdeb('0x49')]=[{'all':!![]}];}_0x4ee73c=_[_0xfdeb('0x3f')]({},_0x4ee73c,_0x24102e[_0xfdeb('0x42')]);return db[_0xfdeb('0x2e')]['find'](_0x4ee73c)['then'](handleEntityNotFound(_0x168b08,null))[_0xfdeb('0x24')](respondWithResult(_0x168b08,null))[_0xfdeb('0x46')](handleError(_0x168b08,null));};exports['update']=function(_0x4f2b3f,_0x11e14a){if(_0x4f2b3f[_0xfdeb('0x4a')]['id']){delete _0x4f2b3f[_0xfdeb('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0xfdeb('0x4b')]({'where':{'id':_0x4f2b3f[_0xfdeb('0x47')]['id']}})[_0xfdeb('0x24')](handleEntityNotFound(_0x11e14a,null))[_0xfdeb('0x24')](saveUpdates(_0x4f2b3f[_0xfdeb('0x4a')],null))[_0xfdeb('0x24')](respondWithResult(_0x11e14a,null))[_0xfdeb('0x46')](handleError(_0x11e14a,null));};exports[_0xfdeb('0x4c')]=function(_0x2e19ca,_0x65a51b,_0x317352){return db[_0xfdeb('0x4d')][_0xfdeb('0x4e')](function(_0xb84643){if(_0x2e19ca[_0xfdeb('0x4a')][_0xfdeb('0x4f')]==='files'){_0x2e19ca[_0xfdeb('0x4a')][_0xfdeb('0x50')]=path[_0xfdeb('0x51')](config[_0xfdeb('0x52')],_0xfdeb('0x53'),_0x2e19ca[_0xfdeb('0x4a')][_0xfdeb('0x2a')]);}return db[_0xfdeb('0x2e')][_0xfdeb('0x4c')](_0x2e19ca[_0xfdeb('0x4a')],{'transaction':_0xb84643})[_0xfdeb('0x24')](function(_0x24d295){if(_0x2e19ca[_0xfdeb('0x4a')][_0xfdeb('0x4f')]===_0xfdeb('0x54')){fs['mkdirSync'](_0x24d295[_0xfdeb('0x50')],parseInt(_0xfdeb('0x55'),0x8));}var _0x338eb6=_0x2e19ca[_0xfdeb('0x56')][_0xfdeb('0x25')]({'plain':!![]});if(!_0x338eb6)throw new Error(_0xfdeb('0x57'));if(_0x338eb6[_0xfdeb('0x58')]===_0xfdeb('0x56')){var _0x51272d=_0x24d295[_0xfdeb('0x25')]({'plain':!![]});return db[_0xfdeb('0x59')][_0xfdeb('0x4b')]({'where':{'name':_0xfdeb('0x26'),'userProfileId':_0x338eb6[_0xfdeb('0x5a')]},'raw':!![]})[_0xfdeb('0x24')](function(_0xd8dc6){if(_0xd8dc6&&_0xd8dc6[_0xfdeb('0x5b')]===0x0){return db['UserProfileResource'][_0xfdeb('0x4c')]({'name':_0x51272d[_0xfdeb('0x2a')],'resourceId':_0x51272d['id'],'type':_0xd8dc6[_0xfdeb('0x2a')],'sectionId':_0xd8dc6['id']},{})[_0xfdeb('0x24')](function(){return _0x24d295;});}else{return _0x24d295;}})[_0xfdeb('0x46')](function(_0x3d86f3){logger[_0xfdeb('0x5c')](_0xfdeb('0x5d'),_0x3d86f3);});}return _0x24d295;});})[_0xfdeb('0x24')](respondWithResult(_0x65a51b,0xc9))['catch'](handleError(_0x65a51b,null));};exports[_0xfdeb('0x28')]=function(_0x4f162b,_0x3918f5,_0x154f09){var _0x126548;return db['VoiceMusicOnHold'][_0xfdeb('0x4b')]({'where':{'id':_0x4f162b[_0xfdeb('0x47')]['id']}})[_0xfdeb('0x24')](function(_0x480485){if(_0x480485){return db[_0xfdeb('0x4d')][_0xfdeb('0x4e')](function(_0xace017){return _0x480485['destroy']({'transaction':_0xace017,'raw':!![]})[_0xfdeb('0x24')](function(_0x19e47c){if(_0x19e47c[_0xfdeb('0x50')]){fs[_0xfdeb('0x5e')](_0x19e47c[_0xfdeb('0x50')])[_0xfdeb('0x5f')](function(_0x5b46c9){fs[_0xfdeb('0x60')](path[_0xfdeb('0x51')](_0x19e47c['directory'],_0x5b46c9));});fs[_0xfdeb('0x61')](_0x19e47c[_0xfdeb('0x50')]);}return _0x19e47c;});})[_0xfdeb('0x46')](function(_0xd030d6){throw new db[(_0xfdeb('0x62'))]['ValidationError'](_0xd030d6['message']);});}})['then'](handleEntityNotFound(_0x3918f5,null))[_0xfdeb('0x24')](removeEntity(_0x3918f5,null))['catch'](handleError(_0x3918f5,null));};exports[_0xfdeb('0x63')]=function(_0x4506e6,_0x7b9fcf,_0x3d5e24){return db['sequelize'][_0xfdeb('0x4e')](function(_0x2d5bcb){var _0x4bcbe6;return db['VoiceMusicOnHold'][_0xfdeb('0x4b')]({'where':{'id':_0x4506e6[_0xfdeb('0x47')]['id']}})[_0xfdeb('0x24')](function(_0x3b7b3e){if(_0x3b7b3e){_0x4bcbe6=_0x3b7b3e;return _0x3b7b3e[_0xfdeb('0x63')](_0x4506e6[_0xfdeb('0x4a')]['id'],{'transaction':_0x2d5bcb});}})[_0xfdeb('0x24')](function(_0x488442){if(_0x488442){return db[_0xfdeb('0x64')][_0xfdeb('0x65')]({'where':{'id':_0x4506e6['body']['id']},'attributes':['id',_0xfdeb('0x2a'),_0xfdeb('0x66'),'converted_format',_0xfdeb('0x67')],'raw':!![]});}})[_0xfdeb('0x24')](function(_0x11d13b){if(_0x11d13b){var _0x37c6dc=path[_0xfdeb('0x51')](config[_0xfdeb('0x52')],_0xfdeb('0x68'),util[_0xfdeb('0x69')](_0xfdeb('0x6a'),path[_0xfdeb('0x6b')](_0x11d13b[_0xfdeb('0x66')],path[_0xfdeb('0x6c')](_0x11d13b['save_name'])),_0x11d13b[_0xfdeb('0x6d')]));var _0x4defbb=path[_0xfdeb('0x51')](config['root'],_0xfdeb('0x53'),_0x4bcbe6['name'],util[_0xfdeb('0x69')]('%s.%s',_0x11d13b[_0xfdeb('0x2a')],_0x11d13b['converted_format']));fs[_0xfdeb('0x6e')](_0x37c6dc,_0x4defbb);return _0x11d13b;}})[_0xfdeb('0x46')](function(_0x5661bb){throw new db[(_0xfdeb('0x62'))][(_0xfdeb('0x6f'))](_0x5661bb[_0xfdeb('0x70')]);});})[_0xfdeb('0x24')](handleEntityNotFound(_0x7b9fcf,null))[_0xfdeb('0x24')](respondWithResult(_0x7b9fcf,0xc9))[_0xfdeb('0x46')](handleError(_0x7b9fcf,null));};exports[_0xfdeb('0x71')]=function(_0x150c63,_0x38e5b0,_0xa1f00e){return db[_0xfdeb('0x4d')][_0xfdeb('0x4e')](function(_0x48a65d){var _0x605ed2;return db[_0xfdeb('0x2e')][_0xfdeb('0x65')]({'where':{'id':_0x150c63[_0xfdeb('0x47')]['id']}})[_0xfdeb('0x24')](handleEntityNotFound(_0x38e5b0,null))[_0xfdeb('0x24')](function(_0x4be660){if(_0x4be660){_0x605ed2=_0x4be660;return _0x4be660[_0xfdeb('0x71')](_0x150c63['params'][_0xfdeb('0x72')]);}})['then'](function(_0x4144ab){if(_0x4144ab){return db['Sound'][_0xfdeb('0x65')]({'where':{'id':_0x150c63[_0xfdeb('0x47')][_0xfdeb('0x72')]},'attributes':['id',_0xfdeb('0x2a'),_0xfdeb('0x66'),_0xfdeb('0x6d'),_0xfdeb('0x67')],'raw':!![]});}})['then'](function(_0x5c7ccc){if(_0x5c7ccc){fs[_0xfdeb('0x60')](path[_0xfdeb('0x51')](_0x605ed2[_0xfdeb('0x50')],util[_0xfdeb('0x69')]('%s.%s',_0x5c7ccc['name'],_0x5c7ccc[_0xfdeb('0x6d')])));return _0x5c7ccc;}})[_0xfdeb('0x46')](function(_0x9027fd){throw new db['Sequelize'][(_0xfdeb('0x6f'))](_0x9027fd[_0xfdeb('0x70')]);});})[_0xfdeb('0x24')](handleEntityNotFound(_0x38e5b0,null))['then'](respondWithStatusCode(_0x38e5b0,0xcc))[_0xfdeb('0x46')](handleError(_0x38e5b0,null));};exports[_0xfdeb('0x73')]=function(_0x571caf,_0x469629,_0xe2449c){var _0x35b41f={};var _0x57ffb6={};var _0x31c37e;var _0x2055ed;return db[_0xfdeb('0x2e')][_0xfdeb('0x65')]({'where':{'id':_0x571caf[_0xfdeb('0x47')]['id']}})[_0xfdeb('0x24')](handleEntityNotFound(_0x469629,null))[_0xfdeb('0x24')](function(_0x65755a){if(_0x65755a){_0x31c37e=_0x65755a;_0x57ffb6[_0xfdeb('0x33')]=_[_0xfdeb('0x48')](db[_0xfdeb('0x64')][_0xfdeb('0x2f')]);_0x57ffb6[_0xfdeb('0x34')]=_[_0xfdeb('0x48')](_0x571caf['query']);_0x57ffb6[_0xfdeb('0x3c')]=_['intersection'](_0x57ffb6[_0xfdeb('0x33')],_0x57ffb6['query']);_0x35b41f['attributes']=_[_0xfdeb('0x35')](_0x57ffb6[_0xfdeb('0x33')],qs[_0xfdeb('0x36')](_0x571caf[_0xfdeb('0x34')][_0xfdeb('0x36')]));_0x35b41f[_0xfdeb('0x37')]=_0x35b41f[_0xfdeb('0x37')]['length']?_0x35b41f[_0xfdeb('0x37')]:_0x57ffb6['model'];_0x35b41f[_0xfdeb('0x74')]=qs[_0xfdeb('0x3b')](_0x571caf['query'][_0xfdeb('0x3b')]);_0x35b41f[_0xfdeb('0x40')]=qs[_0xfdeb('0x3c')](_['pick'](_0x571caf[_0xfdeb('0x34')],_0x57ffb6[_0xfdeb('0x3c')]));if(_0x571caf[_0xfdeb('0x34')][_0xfdeb('0x3e')]){_0x35b41f[_0xfdeb('0x40')]=_['merge'](_0x35b41f[_0xfdeb('0x40')],{'$or':_[_0xfdeb('0x2d')](_0x35b41f[_0xfdeb('0x37')],function(_0x2a0a93){var _0x241d6b={};_0x241d6b[_0x2a0a93]={'$like':'%'+_0x571caf[_0xfdeb('0x34')]['filter']+'%'};return _0x241d6b;})});}_0x35b41f=_[_0xfdeb('0x3f')]({},_0x35b41f,_0x571caf[_0xfdeb('0x42')]);return _0x31c37e['getSounds'](_0x35b41f);}})[_0xfdeb('0x24')](function(_0x58f8ef){if(_0x58f8ef){_0x2055ed=_0x58f8ef['length'];if(!_0x571caf['query'][_0xfdeb('0x39')](_0xfdeb('0x3a'))){_0x35b41f[_0xfdeb('0x1e')]=qs[_0xfdeb('0x1e')](_0x571caf[_0xfdeb('0x34')][_0xfdeb('0x1e')]);_0x35b41f[_0xfdeb('0x1c')]=qs[_0xfdeb('0x1c')](_0x571caf[_0xfdeb('0x34')]['offset']);}return _0x31c37e[_0xfdeb('0x73')](_0x35b41f);}})[_0xfdeb('0x24')](function(_0x535806){if(_0x535806){return _0x535806?{'count':_0x2055ed,'rows':_0x535806}:null;}})[_0xfdeb('0x24')](respondWithResult(_0x469629,null))[_0xfdeb('0x46')](handleError(_0x469629,null));}; \ No newline at end of file +var _0xc1be=['end','json','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','stack','name','send','map','model','query','keys','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','type','options','VoiceMusicOnHold','include','findAll','rows','catch','show','params','intersection','includeAll','find','body','create','mode','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','Sound','getSounds','filter','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1be,0x1e6));var _0xec1b=function(_0x2ed294,_0x5b3046){_0x2ed294=_0x2ed294-0x0;var _0x1b7697=_0xc1be[_0x2ed294];return _0x1b7697;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec1b('0x0'));var zipdir=require(_0xec1b('0x1'));var jsonpatch=require(_0xec1b('0x2'));var rp=require(_0xec1b('0x3'));var moment=require(_0xec1b('0x4'));var BPromise=require(_0xec1b('0x5'));var Mustache=require(_0xec1b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xec1b('0x7'));var csv=require('to-csv');var ejs=require(_0xec1b('0x8'));var fs=require('fs');var fs_extra=require(_0xec1b('0x9'));var _=require(_0xec1b('0xa'));var squel=require('squel');var crypto=require(_0xec1b('0xb'));var jsforce=require(_0xec1b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xec1b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec1b('0xe'));var authService=require(_0xec1b('0xf'));var qs=require(_0xec1b('0x10'));var as=require(_0xec1b('0x11'));var hardwareService=require(_0xec1b('0x12'));var logger=require(_0xec1b('0x13'))(_0xec1b('0x14'));var utils=require('../../config/utils');var config=require(_0xec1b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4975ee,_0x12ff65){_0x12ff65=_0x12ff65||0xcc;return function(_0x195bb2){if(_0x195bb2){return _0x4975ee[_0xec1b('0x16')](_0x12ff65);}return _0x4975ee[_0xec1b('0x17')](_0x12ff65)[_0xec1b('0x18')]();};}function respondWithResult(_0x3fcea3,_0x188563){_0x188563=_0x188563||0xc8;return function(_0x4e2934){if(_0x4e2934){return _0x3fcea3['status'](_0x188563)[_0xec1b('0x19')](_0x4e2934);}};}function respondWithFilteredResult(_0x4daf37,_0x1b6ef0){return function(_0x192ac0){if(_0x192ac0){var _0x512c5a=typeof _0x1b6ef0['offset']===_0xec1b('0x1a')&&typeof _0x1b6ef0[_0xec1b('0x1b')]===_0xec1b('0x1a');var _0x1d3fbd=_0x192ac0[_0xec1b('0x1c')];var _0x174df1=_0x512c5a?0x0:_0x1b6ef0['offset'];var _0x5c9eff=_0x512c5a?_0x192ac0[_0xec1b('0x1c')]:_0x1b6ef0['offset']+_0x1b6ef0[_0xec1b('0x1b')];var _0x1c9e69;if(_0x5c9eff>=_0x1d3fbd){_0x5c9eff=_0x1d3fbd;_0x1c9e69=0xc8;}else{_0x1c9e69=0xce;}_0x4daf37[_0xec1b('0x17')](_0x1c9e69);return _0x4daf37[_0xec1b('0x1d')](_0xec1b('0x1e'),_0x174df1+'-'+_0x5c9eff+'/'+_0x1d3fbd)[_0xec1b('0x19')](_0x192ac0);}return null;};}function patchUpdates(_0x95e5ae){return function(_0x5c0922){try{jsonpatch['apply'](_0x5c0922,_0x95e5ae,!![]);}catch(_0x2dcaa8){return BPromise[_0xec1b('0x1f')](_0x2dcaa8);}return _0x5c0922['save']();};}function saveUpdates(_0x4059a5,_0x14c2ed){return function(_0x39f2a2){if(_0x39f2a2){return _0x39f2a2[_0xec1b('0x20')](_0x4059a5)[_0xec1b('0x21')](function(_0x3e5868){return _0x3e5868;});}return null;};}function removeEntity(_0x2cc564,_0x398403){return function(_0xe83316){if(_0xe83316){return _0xe83316[_0xec1b('0x22')]()[_0xec1b('0x21')](function(){var _0x80ad6c=_0xe83316[_0xec1b('0x23')]({'plain':!![]});var _0x2ca218='MusicOnHolds';return db['UserProfileResource'][_0xec1b('0x22')]({'where':{'type':_0x2ca218,'resourceId':_0x80ad6c['id']}})[_0xec1b('0x21')](function(){return _0xe83316;});})[_0xec1b('0x21')](function(){_0x2cc564['status'](0xcc)[_0xec1b('0x18')]();});}};}function handleEntityNotFound(_0x5c18b8,_0x19045d){return function(_0xce73af){if(!_0xce73af){_0x5c18b8[_0xec1b('0x16')](0x194);}return _0xce73af;};}function handleError(_0x120243,_0x4770cb){_0x4770cb=_0x4770cb||0x1f4;return function(_0x1300db){logger['error'](_0x1300db[_0xec1b('0x24')]);if(_0x1300db[_0xec1b('0x25')]){delete _0x1300db['name'];}_0x120243['status'](_0x4770cb)[_0xec1b('0x26')](_0x1300db);};}exports['index']=function(_0x5de536,_0x4746c9){var _0x4f0d73={},_0x4ca4a9={},_0x416037={'count':0x0,'rows':[]};var _0x5377aa=_[_0xec1b('0x27')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x2cf33e){return{'name':_0x2cf33e['fieldName'],'type':_0x2cf33e['type']['key']};});_0x4ca4a9[_0xec1b('0x28')]=_[_0xec1b('0x27')](_0x5377aa,_0xec1b('0x25'));_0x4ca4a9[_0xec1b('0x29')]=_[_0xec1b('0x2a')](_0x5de536[_0xec1b('0x29')]);_0x4ca4a9['filters']=_['intersection'](_0x4ca4a9['model'],_0x4ca4a9[_0xec1b('0x29')]);_0x4f0d73[_0xec1b('0x2b')]=_['intersection'](_0x4ca4a9[_0xec1b('0x28')],qs[_0xec1b('0x2c')](_0x5de536[_0xec1b('0x29')][_0xec1b('0x2c')]));_0x4f0d73['attributes']=_0x4f0d73[_0xec1b('0x2b')]['length']?_0x4f0d73[_0xec1b('0x2b')]:_0x4ca4a9[_0xec1b('0x28')];if(!_0x5de536[_0xec1b('0x29')][_0xec1b('0x2d')](_0xec1b('0x2e'))){_0x4f0d73['limit']=qs[_0xec1b('0x1b')](_0x5de536['query'][_0xec1b('0x1b')]);_0x4f0d73[_0xec1b('0x2f')]=qs[_0xec1b('0x2f')](_0x5de536[_0xec1b('0x29')][_0xec1b('0x2f')]);}_0x4f0d73[_0xec1b('0x30')]=qs['sort'](_0x5de536[_0xec1b('0x29')][_0xec1b('0x31')]);delete _0x5de536[_0xec1b('0x29')]['sort'];_0x4f0d73[_0xec1b('0x32')]=qs['filters'](_[_0xec1b('0x33')](_0x5de536['query'],_0x4ca4a9[_0xec1b('0x34')]),_0x5377aa);if(_0x5de536[_0xec1b('0x29')]['filter']){_0x4f0d73['where']=_[_0xec1b('0x35')](_0x4f0d73[_0xec1b('0x32')],{'$or':_[_0xec1b('0x27')](_0x5377aa,function(_0x5e09a0){if(_0x5e09a0[_0xec1b('0x36')]!=='VIRTUAL'){var _0xdeaa23={};_0xdeaa23[_0x5e09a0[_0xec1b('0x25')]]={'$like':'%'+_0x5de536[_0xec1b('0x29')]['filter']+'%'};return _0xdeaa23;}})});}_0x4f0d73=_[_0xec1b('0x35')]({},_0x4f0d73,_0x5de536[_0xec1b('0x37')]);var _0x3b1951={'where':_0x4f0d73[_0xec1b('0x32')]};return db[_0xec1b('0x38')]['count'](_0x3b1951)[_0xec1b('0x21')](function(_0x3638d1){_0x416037[_0xec1b('0x1c')]=_0x3638d1;if(_0x5de536[_0xec1b('0x29')]['includeAll']){_0x4f0d73[_0xec1b('0x39')]=[{'all':!![]}];}return db[_0xec1b('0x38')][_0xec1b('0x3a')](_0x4f0d73);})['then'](function(_0x6b8820){_0x416037[_0xec1b('0x3b')]=_0x6b8820;return _0x416037;})[_0xec1b('0x21')](respondWithFilteredResult(_0x4746c9,_0x4f0d73))[_0xec1b('0x3c')](handleError(_0x4746c9,null));};exports[_0xec1b('0x3d')]=function(_0x335e56,_0x5b399f){var _0x45e09c={'raw':![],'where':{'id':_0x335e56[_0xec1b('0x3e')]['id']}},_0x84f2b0={};_0x84f2b0[_0xec1b('0x28')]=_[_0xec1b('0x2a')](db[_0xec1b('0x38')]['rawAttributes']);_0x84f2b0['query']=_[_0xec1b('0x2a')](_0x335e56[_0xec1b('0x29')]);_0x84f2b0[_0xec1b('0x34')]=_[_0xec1b('0x3f')](_0x84f2b0[_0xec1b('0x28')],_0x84f2b0[_0xec1b('0x29')]);_0x45e09c[_0xec1b('0x2b')]=_['intersection'](_0x84f2b0[_0xec1b('0x28')],qs[_0xec1b('0x2c')](_0x335e56[_0xec1b('0x29')][_0xec1b('0x2c')]));_0x45e09c[_0xec1b('0x2b')]=_0x45e09c[_0xec1b('0x2b')]['length']?_0x45e09c['attributes']:_0x84f2b0['model'];if(_0x335e56[_0xec1b('0x29')][_0xec1b('0x40')]){_0x45e09c[_0xec1b('0x39')]=[{'all':!![]}];}_0x45e09c=_[_0xec1b('0x35')]({},_0x45e09c,_0x335e56['options']);return db[_0xec1b('0x38')][_0xec1b('0x41')](_0x45e09c)[_0xec1b('0x21')](handleEntityNotFound(_0x5b399f,null))['then'](respondWithResult(_0x5b399f,null))['catch'](handleError(_0x5b399f,null));};exports[_0xec1b('0x20')]=function(_0x63bf0d,_0xc562d9){if(_0x63bf0d['body']['id']){delete _0x63bf0d[_0xec1b('0x42')]['id'];}return db[_0xec1b('0x38')][_0xec1b('0x41')]({'where':{'id':_0x63bf0d[_0xec1b('0x3e')]['id']}})[_0xec1b('0x21')](handleEntityNotFound(_0xc562d9,null))[_0xec1b('0x21')](saveUpdates(_0x63bf0d[_0xec1b('0x42')],null))[_0xec1b('0x21')](respondWithResult(_0xc562d9,null))[_0xec1b('0x3c')](handleError(_0xc562d9,null));};exports[_0xec1b('0x43')]=function(_0x57f825,_0x2a1104,_0xf0fb45){return db['sequelize']['transaction'](function(_0x4393d6){if(_0x57f825[_0xec1b('0x42')][_0xec1b('0x44')]==='files'){_0x57f825[_0xec1b('0x42')][_0xec1b('0x45')]=path[_0xec1b('0x46')](config[_0xec1b('0x47')],_0xec1b('0x48'),_0x57f825[_0xec1b('0x42')][_0xec1b('0x25')]);}return db[_0xec1b('0x38')]['create'](_0x57f825[_0xec1b('0x42')],{'transaction':_0x4393d6})[_0xec1b('0x21')](function(_0x3018e){if(_0x57f825[_0xec1b('0x42')][_0xec1b('0x44')]==='files'){fs[_0xec1b('0x49')](_0x3018e[_0xec1b('0x45')],parseInt(_0xec1b('0x4a'),0x8));}var _0xe27984=_0x57f825[_0xec1b('0x4b')]['get']({'plain':!![]});if(!_0xe27984)throw new Error(_0xec1b('0x4c'));if(_0xe27984['role']===_0xec1b('0x4b')){var _0x25c39e=_0x3018e[_0xec1b('0x23')]({'plain':!![]});return db[_0xec1b('0x4d')][_0xec1b('0x41')]({'where':{'name':_0xec1b('0x4e'),'userProfileId':_0xe27984[_0xec1b('0x4f')]},'raw':!![]})[_0xec1b('0x21')](function(_0x571414){if(_0x571414&&_0x571414[_0xec1b('0x50')]===0x0){return db['UserProfileResource'][_0xec1b('0x43')]({'name':_0x25c39e[_0xec1b('0x25')],'resourceId':_0x25c39e['id'],'type':_0x571414[_0xec1b('0x25')],'sectionId':_0x571414['id']},{})[_0xec1b('0x21')](function(){return _0x3018e;});}else{return _0x3018e;}})[_0xec1b('0x3c')](function(_0x2de68e){logger['error'](_0xec1b('0x51'),_0x2de68e);});}return _0x3018e;});})[_0xec1b('0x21')](respondWithResult(_0x2a1104,0xc9))[_0xec1b('0x3c')](handleError(_0x2a1104,null));};exports[_0xec1b('0x22')]=function(_0x69a6bc,_0x2c1b2b,_0x1ec736){var _0x1960b8;return db[_0xec1b('0x38')][_0xec1b('0x41')]({'where':{'id':_0x69a6bc[_0xec1b('0x3e')]['id']}})['then'](function(_0xaa84b7){if(_0xaa84b7){return db[_0xec1b('0x52')][_0xec1b('0x53')](function(_0x42eae9){return _0xaa84b7[_0xec1b('0x22')]({'transaction':_0x42eae9,'raw':!![]})[_0xec1b('0x21')](function(_0x4f8630){if(_0x4f8630[_0xec1b('0x45')]){fs[_0xec1b('0x54')](_0x4f8630[_0xec1b('0x45')])['forEach'](function(_0x320a40){fs[_0xec1b('0x55')](path[_0xec1b('0x46')](_0x4f8630[_0xec1b('0x45')],_0x320a40));});fs[_0xec1b('0x56')](_0x4f8630[_0xec1b('0x45')]);}return _0x4f8630;});})[_0xec1b('0x3c')](function(_0x2413f9){throw new db[(_0xec1b('0x57'))][(_0xec1b('0x58'))](_0x2413f9[_0xec1b('0x59')]);});}})[_0xec1b('0x21')](handleEntityNotFound(_0x2c1b2b,null))[_0xec1b('0x21')](removeEntity(_0x2c1b2b,null))[_0xec1b('0x3c')](handleError(_0x2c1b2b,null));};exports[_0xec1b('0x5a')]=function(_0x4efcb0,_0x3a53bb,_0x12dfb8){return db[_0xec1b('0x52')][_0xec1b('0x53')](function(_0x482f0f){var _0x3b8a01;return db['VoiceMusicOnHold'][_0xec1b('0x41')]({'where':{'id':_0x4efcb0[_0xec1b('0x3e')]['id']}})['then'](function(_0x14f159){if(_0x14f159){_0x3b8a01=_0x14f159;return _0x14f159[_0xec1b('0x5a')](_0x4efcb0[_0xec1b('0x42')]['id'],{'transaction':_0x482f0f});}})[_0xec1b('0x21')](function(_0x438767){if(_0x438767){return db['Sound'][_0xec1b('0x5b')]({'where':{'id':_0x4efcb0['body']['id']},'attributes':['id',_0xec1b('0x25'),_0xec1b('0x5c'),_0xec1b('0x5d'),_0xec1b('0x5e')],'raw':!![]});}})['then'](function(_0x5c461d){if(_0x5c461d){var _0x95f297=path[_0xec1b('0x46')](config[_0xec1b('0x47')],_0xec1b('0x5f'),util[_0xec1b('0x60')](_0xec1b('0x61'),path[_0xec1b('0x62')](_0x5c461d[_0xec1b('0x5c')],path['extname'](_0x5c461d['save_name'])),_0x5c461d['converted_format']));var _0x76e235=path[_0xec1b('0x46')](config['root'],'server/files/moh',_0x3b8a01[_0xec1b('0x25')],util['format'](_0xec1b('0x61'),_0x5c461d[_0xec1b('0x25')],_0x5c461d[_0xec1b('0x5d')]));fs['symlinkSync'](_0x95f297,_0x76e235);return _0x5c461d;}})['catch'](function(_0x24f24e){throw new db[(_0xec1b('0x57'))][(_0xec1b('0x58'))](_0x24f24e[_0xec1b('0x59')]);});})[_0xec1b('0x21')](handleEntityNotFound(_0x3a53bb,null))[_0xec1b('0x21')](respondWithResult(_0x3a53bb,0xc9))[_0xec1b('0x3c')](handleError(_0x3a53bb,null));};exports['removeSound']=function(_0x3254b4,_0x3a0b0e,_0x4ee1b9){return db[_0xec1b('0x52')][_0xec1b('0x53')](function(_0x2c0022){var _0x1b98b0;return db['VoiceMusicOnHold'][_0xec1b('0x5b')]({'where':{'id':_0x3254b4['params']['id']}})['then'](handleEntityNotFound(_0x3a0b0e,null))[_0xec1b('0x21')](function(_0x35681c){if(_0x35681c){_0x1b98b0=_0x35681c;return _0x35681c['removeSound'](_0x3254b4['params']['id2']);}})[_0xec1b('0x21')](function(_0x11fbe1){if(_0x11fbe1){return db[_0xec1b('0x63')][_0xec1b('0x5b')]({'where':{'id':_0x3254b4['params']['id2']},'attributes':['id',_0xec1b('0x25'),_0xec1b('0x5c'),_0xec1b('0x5d'),_0xec1b('0x5e')],'raw':!![]});}})[_0xec1b('0x21')](function(_0x295808){if(_0x295808){fs[_0xec1b('0x55')](path[_0xec1b('0x46')](_0x1b98b0['directory'],util['format'](_0xec1b('0x61'),_0x295808[_0xec1b('0x25')],_0x295808[_0xec1b('0x5d')])));return _0x295808;}})[_0xec1b('0x3c')](function(_0x3d6aef){throw new db[(_0xec1b('0x57'))][(_0xec1b('0x58'))](_0x3d6aef[_0xec1b('0x59')]);});})['then'](handleEntityNotFound(_0x3a0b0e,null))['then'](respondWithStatusCode(_0x3a0b0e,0xcc))[_0xec1b('0x3c')](handleError(_0x3a0b0e,null));};exports[_0xec1b('0x64')]=function(_0x5ca45d,_0x4b4457,_0x4aa7b8){var _0x5c4714={};var _0xd055dd={};var _0x20fc5f;var _0x119e6b;return db[_0xec1b('0x38')][_0xec1b('0x5b')]({'where':{'id':_0x5ca45d[_0xec1b('0x3e')]['id']}})[_0xec1b('0x21')](handleEntityNotFound(_0x4b4457,null))['then'](function(_0x496982){if(_0x496982){_0x20fc5f=_0x496982;_0xd055dd[_0xec1b('0x28')]=_[_0xec1b('0x2a')](db['Sound']['rawAttributes']);_0xd055dd[_0xec1b('0x29')]=_[_0xec1b('0x2a')](_0x5ca45d[_0xec1b('0x29')]);_0xd055dd[_0xec1b('0x34')]=_['intersection'](_0xd055dd[_0xec1b('0x28')],_0xd055dd[_0xec1b('0x29')]);_0x5c4714[_0xec1b('0x2b')]=_[_0xec1b('0x3f')](_0xd055dd['model'],qs[_0xec1b('0x2c')](_0x5ca45d['query'][_0xec1b('0x2c')]));_0x5c4714['attributes']=_0x5c4714[_0xec1b('0x2b')]['length']?_0x5c4714[_0xec1b('0x2b')]:_0xd055dd[_0xec1b('0x28')];_0x5c4714['order']=qs[_0xec1b('0x31')](_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x31')]);_0x5c4714[_0xec1b('0x32')]=qs[_0xec1b('0x34')](_['pick'](_0x5ca45d[_0xec1b('0x29')],_0xd055dd[_0xec1b('0x34')]));if(_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x65')]){_0x5c4714[_0xec1b('0x32')]=_[_0xec1b('0x35')](_0x5c4714[_0xec1b('0x32')],{'$or':_[_0xec1b('0x27')](_0x5c4714[_0xec1b('0x2b')],function(_0x2f786b){var _0x3acb1e={};_0x3acb1e[_0x2f786b]={'$like':'%'+_0x5ca45d['query'][_0xec1b('0x65')]+'%'};return _0x3acb1e;})});}_0x5c4714=_[_0xec1b('0x35')]({},_0x5c4714,_0x5ca45d['options']);return _0x20fc5f['getSounds'](_0x5c4714);}})['then'](function(_0x1946d7){if(_0x1946d7){_0x119e6b=_0x1946d7['length'];if(!_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x2d')](_0xec1b('0x2e'))){_0x5c4714['limit']=qs[_0xec1b('0x1b')](_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x1b')]);_0x5c4714[_0xec1b('0x2f')]=qs[_0xec1b('0x2f')](_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x2f')]);}return _0x20fc5f[_0xec1b('0x64')](_0x5c4714);}})[_0xec1b('0x21')](function(_0x27f0cc){if(_0x27f0cc){return _0x27f0cc?{'count':_0x119e6b,'rows':_0x27f0cc}:null;}})[_0xec1b('0x21')](respondWithResult(_0x4b4457,null))[_0xec1b('0x3c')](handleError(_0x4b4457,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index d4dcaa2..3b5b563 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 _0x739b=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util'];(function(_0x55cb9f,_0x64654d){var _0x272a75=function(_0x2d4f90){while(--_0x2d4f90){_0x55cb9f['push'](_0x55cb9f['shift']());}};_0x272a75(++_0x64654d);}(_0x739b,0x15d));var _0xb739=function(_0x5f52cc,_0x333041){_0x5f52cc=_0x5f52cc-0x0;var _0x7e591c=_0x739b[_0x5f52cc];return _0x7e591c;};'use strict';var _=require(_0xb739('0x0'));var util=require(_0xb739('0x1'));var logger=require(_0xb739('0x2'))(_0xb739('0x3'));var moment=require('moment');var BPromise=require(_0xb739('0x4'));var rp=require(_0xb739('0x5'));var fs=require('fs');var path=require(_0xb739('0x6'));var rimraf=require(_0xb739('0x7'));var config=require(_0xb739('0x8'));var attributes=require(_0xb739('0x9'));module[_0xb739('0xa')]=function(_0x3d3c7f,_0x59a0aa){return _0x3d3c7f[_0xb739('0xb')](_0xb739('0xc'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x236f=['../../config/environment','./voiceMusicOnHold.attributes','exports','voice_musiconhold','util','api','moment','bluebird','path'];(function(_0xb2318e,_0x32dc9d){var _0x2f7f40=function(_0x25f5fa){while(--_0x25f5fa){_0xb2318e['push'](_0xb2318e['shift']());}};_0x2f7f40(++_0x32dc9d);}(_0x236f,0xdc));var _0xf236=function(_0x5ae19a,_0x28655b){_0x5ae19a=_0x5ae19a-0x0;var _0x33019a=_0x236f[_0x5ae19a];return _0x33019a;};'use strict';var _=require('lodash');var util=require(_0xf236('0x0'));var logger=require('../../config/logger')(_0xf236('0x1'));var moment=require(_0xf236('0x2'));var BPromise=require(_0xf236('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf236('0x4'));var rimraf=require('rimraf');var config=require(_0xf236('0x5'));var attributes=require(_0xf236('0x6'));module[_0xf236('0x7')]=function(_0x30c8ec,_0x491d01){return _0x30c8ec['define']('VoiceMusicOnHold',attributes,{'tableName':_0xf236('0x8'),'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 c4d0376..ccc013e 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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d7c65,_0x24f6a3){var _0xb1d4db=function(_0x371924){while(--_0x371924){_0x4d7c65['push'](_0x4d7c65['shift']());}};_0xb1d4db(++_0x24f6a3);}(_0xe706,0xa3));var _0x6e70=function(_0x56d04c,_0x3762c4){_0x56d04c=_0x56d04c-0x0;var _0x278a10=_0xe706[_0x56d04c];return _0x278a10;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +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(_0x52f8a4,_0x38ea5f){var _0xad87b=function(_0x1daa43){while(--_0x1daa43){_0x52f8a4['push'](_0x52f8a4['shift']());}};_0xad87b(++_0x38ea5f);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 5d886c6..8bc14e0 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 _0xe5b3=['create','addAgents','/:id/teams','update','delete','removeAgents','removeTeams','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','describe','/:id','/:id/users','getAgents','post'];(function(_0x487cad,_0x46281f){var _0x189b3f=function(_0x40e352){while(--_0x40e352){_0x487cad['push'](_0x487cad['shift']());}};_0x189b3f(++_0x46281f);}(_0xe5b3,0x133));var _0x3e5b=function(_0x486151,_0x34d13b){_0x486151=_0x486151-0x0;var _0x853b27=_0xe5b3[_0x486151];return _0x853b27;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xa')](_0x3e5b('0xf'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0xa')]('/:id/teams',auth[_0x3e5b('0xc')](),controller['getTeams']);router[_0x3e5b('0x11')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x12')]);router[_0x3e5b('0x11')](_0x3e5b('0xf'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);router['post'](_0x3e5b('0x14'),auth['isAuthenticated'](),controller['addTeams']);router['put'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x15')]);router['delete'](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x3e5b('0x16')](_0x3e5b('0xf'),auth['isAuthenticated'](),controller[_0x3e5b('0x17')]);router[_0x3e5b('0x16')]('/:id/teams',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x18')]);module['exports']=router; \ No newline at end of file +var _0xe7ad=['addAgents','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','path','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x286f42,_0x513295){var _0x5e533b=function(_0x43463a){while(--_0x43463a){_0x286f42['push'](_0x286f42['shift']());}};_0x5e533b(++_0x513295);}(_0xe7ad,0x1b1));var _0xde7a=function(_0x50950f,_0x4d95e3){_0x50950f=_0x50950f-0x0;var _0x4be444=_0xe7ad[_0x50950f];return _0x4be444;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde7a('0x0'));var timeout=require('connect-timeout');var express=require(_0xde7a('0x1'));var router=express[_0xde7a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xde7a('0x3'));var config=require(_0xde7a('0x4'));var controller=require(_0xde7a('0x5'));router[_0xde7a('0x6')]('/',auth[_0xde7a('0x7')](),controller[_0xde7a('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xde7a('0x9')]);router[_0xde7a('0x6')](_0xde7a('0xa'),auth[_0xde7a('0x7')](),controller[_0xde7a('0xb')]);router['get'](_0xde7a('0xc'),auth['isAuthenticated'](),controller[_0xde7a('0xd')]);router[_0xde7a('0x6')](_0xde7a('0xe'),auth[_0xde7a('0x7')](),controller[_0xde7a('0xf')]);router[_0xde7a('0x10')]('/',auth[_0xde7a('0x7')](),controller['create']);router['post'](_0xde7a('0xc'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x11')]);router['post'](_0xde7a('0xe'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x12')]);router[_0xde7a('0x13')](_0xde7a('0xa'),auth[_0xde7a('0x7')](),controller['update']);router[_0xde7a('0x14')](_0xde7a('0xa'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x15')]);router['delete'](_0xde7a('0xc'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x16')]);router[_0xde7a('0x14')]('/:id/teams',auth[_0xde7a('0x7')](),controller[_0xde7a('0x17')]);module[_0xde7a('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 8245690..a5be284 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 _0x4422=['sequelize','exports','STRING','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0xb063d2,_0x15a239){var _0x117179=function(_0x451d2a){while(--_0x451d2a){_0xb063d2['push'](_0xb063d2['shift']());}};_0x117179(++_0x15a239);}(_0x4422,0x19d));var _0x2442=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4422[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x2442('0x0'));module[_0x2442('0x1')]={'name':{'type':Sequelize[_0x2442('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x2442('0x3')],'get':function(_0xd8eee8){return _0x2442('0x4')+this[_0x2442('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x2442('0x2')]},'callerIdAll':{'type':Sequelize[_0x2442('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x2442('0x6')]}}; \ No newline at end of file +var _0x86a8=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x86a8,0xc0));var _0x886a=function(_0x919f05,_0x4d5ac4){_0x919f05=_0x919f05-0x0;var _0x24c493=_0x86a8[_0x919f05];return _0x24c493;};'use strict';var Sequelize=require(_0x886a('0x0'));module[_0x886a('0x1')]={'name':{'type':Sequelize[_0x886a('0x2')],'allowNull':![],'unique':_0x886a('0x3')},'prefix':{'type':Sequelize[_0x886a('0x4')],'get':function(_0x220b58){return _0x886a('0x5')+this[_0x886a('0x6')](_0x886a('0x3'))+'-';}},'description':{'type':Sequelize[_0x886a('0x2')]},'callerIdAll':{'type':Sequelize[_0x886a('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x886a('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 82cba62..6ecf707 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 _0xb9be=['addAgents','emit','userVoicePrefix:save','ids','isArray','userVoicePrefix:remove','getAgents','findOne','order','Team','pick','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','name','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','prefix','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-'];(function(_0x1ae0f5,_0x25d756){var _0xa96dc1=function(_0xe9a62){while(--_0xe9a62){_0x1ae0f5['push'](_0x1ae0f5['shift']());}};_0xa96dc1(++_0x25d756);}(_0xb9be,0xc5));var _0xeb9b=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xb9be[_0x485b5a];return _0xd2b34d;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];config[_0xeb9b('0x19')]=_[_0xeb9b('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb9b('0x19')]));require(_0xeb9b('0x1b'))[_0xeb9b('0x1c')](socket);function respondWithStatusCode(_0x4ec46d,_0x5926e1){_0x5926e1=_0x5926e1||0xcc;return function(_0x4f8182){if(_0x4f8182){return _0x4ec46d[_0xeb9b('0x1d')](_0x5926e1);}return _0x4ec46d[_0xeb9b('0x1e')](_0x5926e1)[_0xeb9b('0x1f')]();};}function respondWithResult(_0x3fa308,_0x2c9aa6){_0x2c9aa6=_0x2c9aa6||0xc8;return function(_0x10da6e){if(_0x10da6e){return _0x3fa308[_0xeb9b('0x1e')](_0x2c9aa6)['json'](_0x10da6e);}};}function respondWithFilteredResult(_0x2e8645,_0x36e871){return function(_0x21aca6){if(_0x21aca6){var _0x3a11e3=typeof _0x36e871[_0xeb9b('0x20')]===_0xeb9b('0x21')&&typeof _0x36e871[_0xeb9b('0x22')]===_0xeb9b('0x21');var _0x2c199f=_0x21aca6[_0xeb9b('0x23')];var _0x4f436e=_0x3a11e3?0x0:_0x36e871[_0xeb9b('0x20')];var _0x5a7ffd=_0x3a11e3?_0x21aca6['count']:_0x36e871[_0xeb9b('0x20')]+_0x36e871[_0xeb9b('0x22')];var _0x4ab4b8;if(_0x5a7ffd>=_0x2c199f){_0x5a7ffd=_0x2c199f;_0x4ab4b8=0xc8;}else{_0x4ab4b8=0xce;}_0x2e8645[_0xeb9b('0x1e')](_0x4ab4b8);return _0x2e8645[_0xeb9b('0x24')](_0xeb9b('0x25'),_0x4f436e+'-'+_0x5a7ffd+'/'+_0x2c199f)[_0xeb9b('0x26')](_0x21aca6);}return null;};}function patchUpdates(_0x3c8be7){return function(_0x43dab8){try{jsonpatch[_0xeb9b('0x27')](_0x43dab8,_0x3c8be7,!![]);}catch(_0x15e5b8){return BPromise[_0xeb9b('0x28')](_0x15e5b8);}return _0x43dab8[_0xeb9b('0x29')]();};}function saveUpdates(_0x61c86d,_0x296f95){return function(_0x1a4faf){if(_0x1a4faf){return _0x1a4faf[_0xeb9b('0x2a')](_0x61c86d)[_0xeb9b('0x2b')](function(_0x434461){return _0x434461;});}return null;};}function removeEntity(_0x4c997e,_0xd57390){return function(_0x4ed960){if(_0x4ed960){return _0x4ed960[_0xeb9b('0x2c')]()['then'](function(){var _0x347ec1=_0x4ed960[_0xeb9b('0x2d')]({'plain':!![]});var _0x7e0134=_0xeb9b('0x2e');return db['UserProfileResource'][_0xeb9b('0x2c')]({'where':{'type':_0x7e0134,'resourceId':_0x347ec1['id']}})[_0xeb9b('0x2b')](function(){return _0x4ed960;});})['then'](function(){_0x4c997e[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x1f')]();});}};}function handleEntityNotFound(_0x5ce745,_0x2a4b51){return function(_0x2ea20f){if(!_0x2ea20f){_0x5ce745[_0xeb9b('0x1d')](0x194);}return _0x2ea20f;};}function handleError(_0x48c5f4,_0x309bad){_0x309bad=_0x309bad||0x1f4;return function(_0x5336f2){logger[_0xeb9b('0x2f')](_0x5336f2['stack']);if(_0x5336f2[_0xeb9b('0x30')]){delete _0x5336f2['name'];}_0x48c5f4[_0xeb9b('0x1e')](_0x309bad)['send'](_0x5336f2);};}exports[_0xeb9b('0x31')]=function(_0x4c8e4c,_0x25b8da){var _0x370dbe={},_0x20e577={},_0x2e6034={'count':0x0,'rows':[]};var _0x112129=_[_0xeb9b('0x32')](db[_0xeb9b('0x33')][_0xeb9b('0x34')],function(_0x41e6c4){return{'name':_0x41e6c4[_0xeb9b('0x35')],'type':_0x41e6c4['type'][_0xeb9b('0x36')]};});_0x20e577[_0xeb9b('0x37')]=_[_0xeb9b('0x32')](_0x112129,_0xeb9b('0x30'));_0x20e577[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x4c8e4c[_0xeb9b('0x38')]);_0x20e577['filters']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],_0x20e577[_0xeb9b('0x38')]);_0x370dbe['attributes']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x370dbe[_0xeb9b('0x3c')]=_0x370dbe['attributes'][_0xeb9b('0x3d')]?_0x370dbe[_0xeb9b('0x3c')]:_0x20e577['model'];if(!_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x370dbe[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x370dbe['offset']=qs[_0xeb9b('0x20')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x20')]);}_0x370dbe['order']=qs['sort'](_0x4c8e4c['query'][_0xeb9b('0x40')]);_0x370dbe[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_['pick'](_0x4c8e4c[_0xeb9b('0x38')],_0x20e577[_0xeb9b('0x42')]),_0x112129);if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x370dbe[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x370dbe[_0xeb9b('0x41')],{'$or':_['map'](_0x112129,function(_0x5e597a){if(_0x5e597a[_0xeb9b('0x45')]!==_0xeb9b('0x46')){var _0x4ee3cd={};_0x4ee3cd[_0x5e597a['name']]={'$like':'%'+_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]+'%'};return _0x4ee3cd;}})});}_0x370dbe=_['merge']({},_0x370dbe,_0x4c8e4c[_0xeb9b('0x47')]);var _0x535e73={'where':_0x370dbe[_0xeb9b('0x41')]};return db[_0xeb9b('0x33')][_0xeb9b('0x23')](_0x535e73)[_0xeb9b('0x2b')](function(_0xbee63e){_0x2e6034[_0xeb9b('0x23')]=_0xbee63e;if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x48')]){_0x370dbe[_0xeb9b('0x49')]=[{'all':!![]}];}return db[_0xeb9b('0x33')][_0xeb9b('0x4a')](_0x370dbe);})[_0xeb9b('0x2b')](function(_0x5e270a){_0x2e6034['rows']=_0x5e270a;return _0x2e6034;})[_0xeb9b('0x2b')](respondWithFilteredResult(_0x25b8da,_0x370dbe))['catch'](handleError(_0x25b8da,null));};exports[_0xeb9b('0x4b')]=function(_0x232731,_0x2c00ed){var _0x5eee9b={'raw':![],'where':{'id':_0x232731[_0xeb9b('0x4c')]['id']}},_0x1e2d25={};_0x1e2d25['model']=_[_0xeb9b('0x39')](db[_0xeb9b('0x33')][_0xeb9b('0x34')]);_0x1e2d25[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x232731[_0xeb9b('0x38')]);_0x1e2d25[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x1e2d25['model'],_0x1e2d25['query']);_0x5eee9b[_0xeb9b('0x3c')]=_['intersection'](_0x1e2d25['model'],qs[_0xeb9b('0x3b')](_0x232731[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x5eee9b[_0xeb9b('0x3c')]=_0x5eee9b[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x5eee9b['attributes']:_0x1e2d25['model'];if(_0x232731['query'][_0xeb9b('0x48')]){_0x5eee9b['include']=[{'all':!![]}];}_0x5eee9b=_[_0xeb9b('0x44')]({},_0x5eee9b,_0x232731[_0xeb9b('0x47')]);return db[_0xeb9b('0x33')][_0xeb9b('0x4d')](_0x5eee9b)[_0xeb9b('0x2b')](handleEntityNotFound(_0x2c00ed,null))[_0xeb9b('0x2b')](respondWithResult(_0x2c00ed,null))[_0xeb9b('0x4e')](handleError(_0x2c00ed,null));};exports[_0xeb9b('0x2c')]=function(_0x34755f,_0x28968b){return db['VoicePrefix']['find']({'where':{'id':_0x34755f[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x28968b,null))['then'](removeEntity(_0x28968b,null))[_0xeb9b('0x4e')](handleError(_0x28968b,null));};exports['describe']=function(_0x2ceb23,_0x1f7b31){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x1f7b31,null))[_0xeb9b('0x4e')](handleError(_0x1f7b31,null));};exports[_0xeb9b('0x4f')]=function(_0x263453,_0x4fe9d0){var _0x4ded40;return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3e6e73){return db[_0xeb9b('0x33')][_0xeb9b('0x4f')](_0x263453[_0xeb9b('0x52')],{'transaction':_0x3e6e73})['then'](function(_0x20dbea){_0x4ded40=_0x20dbea[_0xeb9b('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0xeb9b('0x4d')]({'where':{'id':_0x4ded40['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x12f8d6){return createVoicePrefixExtensions(_0x4ded40,_0x12f8d6,_0x3e6e73);});});})['then'](function(){var _0x396aa9=_0x263453['user'][_0xeb9b('0x2d')]({'plain':!![]});if(!_0x396aa9)throw new Error(_0xeb9b('0x53'));if(_0x396aa9[_0xeb9b('0x54')]===_0xeb9b('0x55')){var _0x5c769e=_0x4ded40;return db['UserProfileSection'][_0xeb9b('0x4d')]({'where':{'name':_0xeb9b('0x2e'),'userProfileId':_0x396aa9[_0xeb9b('0x56')]},'raw':!![]})['then'](function(_0x3126d9){if(_0x3126d9&&_0x3126d9[_0xeb9b('0x57')]===0x0){return db[_0xeb9b('0x58')][_0xeb9b('0x4f')]({'name':_0x5c769e[_0xeb9b('0x30')],'resourceId':_0x5c769e['id'],'type':_0x3126d9[_0xeb9b('0x30')],'sectionId':_0x3126d9['id']},{})[_0xeb9b('0x2b')](function(){return _0x4ded40;});}else{return _0x4ded40;}})[_0xeb9b('0x4e')](function(_0x2f8b0f){logger[_0xeb9b('0x2f')](_0xeb9b('0x59'),_0x2f8b0f);throw _0x2f8b0f;});}return _0x4ded40;})['then'](respondWithResult(_0x4fe9d0,null))['catch'](handleError(_0x4fe9d0,null));};function Extension(_0x4b2506,_0x83d48a,_0x4cf8bf,_0x34ff5f){this[_0xeb9b('0x5a')]=_0xeb9b('0x5b');this['exten']=_0x4b2506;this[_0xeb9b('0x5c')]=_0x4cf8bf;this[_0xeb9b('0x45')]=_0xeb9b('0x5d');this[_0xeb9b('0x5e')]=_0xeb9b('0x5f');this[_0xeb9b('0x60')]=_0x83d48a;this[_0xeb9b('0x61')]=_0x34ff5f;}function createVoicePrefixExtensions(_0x295d81,_0x58a3e2,_0x5b55a6){return new BPromise(function(_0x27a445,_0x37f20c){var _0xa0146b=new Extension(formatPrefixName(_0x295d81['prefix']),0x1,_0xeb9b('0x62'),'Voice\x20Prefix');_0xa0146b[_0xeb9b('0x63')]=_0x295d81['id'];return db['VoiceExtension'][_0xeb9b('0x4f')](_0xa0146b,{'transaction':_0x5b55a6})[_0xeb9b('0x2b')](function(_0x3d223f){var _0x1b2a7a=_0x3d223f[_0xeb9b('0x2d')]({'plain':!![]});var _0x4be938=_[_0xeb9b('0x32')](addVoicePrefixExtensions(_0x295d81,_0x58a3e2),function(_0x1c7569){_0x1c7569['VoiceExtensionId']=_0x1b2a7a['id'];_0x1c7569['VoicePrefixId']=_0x295d81['id'];return _0x1c7569;});return db[_0xeb9b('0x64')][_0xeb9b('0x65')](_0x4be938,{'transaction':_0x5b55a6})['then'](function(_0xeb81b9){if(!_0xeb81b9){return _0x37f20c('Extensions\x20creation\x20failed');}else{return _0x27a445(_0xeb81b9);}})[_0xeb9b('0x4e')](function(_0x515a97){return _0x37f20c(_0x515a97);});});;});};function addVoicePrefixExtensions(_0x36376f,_0x382d3a){var _0x417221=[];var _0x1fea34=formatPrefixName(_0x36376f[_0xeb9b('0x66')]);_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x2,'Set',_0xeb9b('0x68')+_0x36376f[_0xeb9b('0x30')]));if(_0x36376f['callerIdAll']){_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x3,_0xeb9b('0x69'),_0xeb9b('0x6a')+_0x36376f[_0xeb9b('0x6b')]));}else{_0x417221['push'](new Extension(_0x1fea34,0x3,_0xeb9b('0x62'),_0xeb9b('0x6c')));}_0x417221['push'](new Extension(_0x1fea34,0x4,_0xeb9b('0x6d'),_0x382d3a[_0xeb9b('0x5a')]+','+_0xeb9b('0x6e')+(0x8+_0x36376f[_0xeb9b('0x30')][_0xeb9b('0x3d')])+'}'+','+0x1));return _0x417221;}function formatPrefixName(_0x48b0ec){var _0x3f9ce0='_';for(var _0x4a48f6=0x0;_0x4a48f6<_0x48b0ec[_0xeb9b('0x3d')];_0x4a48f6++){if(_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)=='-'){_0x3f9ce0+=_0x48b0ec['charAt'](_0x4a48f6);}else{_0x3f9ce0+='['+_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)+']';}}_0x3f9ce0+='.';return _0x3f9ce0;}exports[_0xeb9b('0x2a')]=function(_0x2fb07e,_0x25398e,_0x51de75){var _0xb0080f=_0x2fb07e[_0xeb9b('0x52')];_0xb0080f[_0xeb9b('0x66')]=_0xeb9b('0x70')+_0xb0080f[_0xeb9b('0x30')]+'-';return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3836bd){return db[_0xeb9b('0x33')][_0xeb9b('0x2a')](_0xb0080f,{'where':{'id':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x2c')]({'where':{'VoicePrefixId':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x4d')]({'where':{'id':_0xb0080f['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x3e4ef2){return createVoicePrefixExtensions(_0xb0080f,_0x3e4ef2,_0x3836bd);});});});})[_0xeb9b('0x2b')](function(){return db['VoicePrefix']['findById'](_0xb0080f['id']);})[_0xeb9b('0x2b')](respondWithResult(_0x25398e,null))['catch'](handleError(_0x25398e,null));};exports[_0xeb9b('0x71')]=function(_0x463767,_0x279f71,_0x12a271){return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x463767[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x279f71,null))[_0xeb9b('0x2b')](function(_0x46ce60){if(_0x46ce60){return _0x46ce60[_0xeb9b('0x71')](_0x463767[_0xeb9b('0x52')]['ids'],_['omit'](_0x463767[_0xeb9b('0x52')],['ids','id'])||{})['spread'](function(_0x95e1d0){for(var _0x4bdaf5=0x0;_0x4bdaf5<_0x463767['body']['ids'][_0xeb9b('0x3d')];_0x4bdaf5+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x73'),{'UserId':Number(_0x463767[_0xeb9b('0x52')]['ids'][_0x4bdaf5]),'VoicePrefixId':Number(_0x463767[_0xeb9b('0x4c')]['id'])});}return _0x95e1d0;});}})[_0xeb9b('0x2b')](respondWithResult(_0x279f71,null))[_0xeb9b('0x4e')](handleError(_0x279f71,null));};exports['removeAgents']=function(_0x5c010d,_0x3ea644,_0x4ffa9e){return db[_0xeb9b('0x33')]['find']({'where':{'id':_0x5c010d['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3ea644,null))['then'](function(_0x3aca78){if(_0x3aca78){return _0x3aca78['removeAgents'](_0x5c010d['query'][_0xeb9b('0x74')])[_0xeb9b('0x2b')](function(){if(_[_0xeb9b('0x75')](_0x5c010d[_0xeb9b('0x38')]['ids'])){for(var _0x193ffc=0x0;_0x193ffc<_0x5c010d[_0xeb9b('0x38')][_0xeb9b('0x74')][_0xeb9b('0x3d')];_0x193ffc+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')][_0x193ffc]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}}else{socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3ea644,null))['catch'](handleError(_0x3ea644,null));};exports[_0xeb9b('0x77')]=function(_0x36af5a,_0x41af31,_0x14db1d){var _0x31b0c5={};var _0x24bac5={};var _0x462fa2;var _0x5bf4a4;return db[_0xeb9b('0x33')][_0xeb9b('0x78')]({'where':{'id':_0x36af5a['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x41af31,null))[_0xeb9b('0x2b')](function(_0x16f500){if(_0x16f500){_0x462fa2=_0x16f500;_0x24bac5['model']=_['keys'](db['User'][_0xeb9b('0x34')]);_0x24bac5[_0xeb9b('0x38')]=_['keys'](_0x36af5a[_0xeb9b('0x38')]);_0x24bac5[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x24bac5[_0xeb9b('0x37')],_0x24bac5[_0xeb9b('0x38')]);_0x31b0c5[_0xeb9b('0x3c')]=_['intersection'](_0x24bac5[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x31b0c5[_0xeb9b('0x3c')]=_0x31b0c5[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x31b0c5[_0xeb9b('0x3c')]:_0x24bac5[_0xeb9b('0x37')];_0x31b0c5[_0xeb9b('0x79')]=qs[_0xeb9b('0x40')](_0x36af5a['query'][_0xeb9b('0x40')]);_0x31b0c5[_0xeb9b('0x41')]=qs['filters'](_['pick'](_0x36af5a[_0xeb9b('0x38')],_0x24bac5[_0xeb9b('0x42')]));if(_0x36af5a['query'][_0xeb9b('0x43')]){_0x31b0c5[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x31b0c5[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x31b0c5[_0xeb9b('0x3c')],function(_0x3cb938){var _0x44562a={};_0x44562a[_0x3cb938]={'$like':'%'+_0x36af5a[_0xeb9b('0x38')]['filter']+'%'};return _0x44562a;})});}_0x31b0c5=_[_0xeb9b('0x44')]({},_0x31b0c5,_0x36af5a[_0xeb9b('0x47')]);return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x4d894e){if(_0x4d894e){_0x5bf4a4=_0x4d894e[_0xeb9b('0x3d')];if(!_0x36af5a['query']['hasOwnProperty'](_0xeb9b('0x3f'))){_0x31b0c5[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x31b0c5['offset']=qs[_0xeb9b('0x20')](_0x36af5a['query'][_0xeb9b('0x20')]);}return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x51628d){if(_0x51628d){return _0x51628d?{'count':_0x5bf4a4,'rows':_0x51628d}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x41af31,null))['catch'](handleError(_0x41af31,null));};exports['getTeams']=function(_0x3f9806,_0x3332ba,_0x25e684){var _0x841fc6={};var _0x175afe={};var _0x57a99e;var _0x2ee62d;return db[_0xeb9b('0x33')]['findOne']({'where':{'id':_0x3f9806[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3332ba,null))[_0xeb9b('0x2b')](function(_0x4c303d){if(_0x4c303d){_0x57a99e=_0x4c303d;_0x175afe[_0xeb9b('0x37')]=_[_0xeb9b('0x39')](db[_0xeb9b('0x7a')][_0xeb9b('0x34')]);_0x175afe[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x3f9806['query']);_0x175afe[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],_0x175afe[_0xeb9b('0x38')]);_0x841fc6[_0xeb9b('0x3c')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x841fc6[_0xeb9b('0x3c')]=_0x841fc6['attributes'][_0xeb9b('0x3d')]?_0x841fc6[_0xeb9b('0x3c')]:_0x175afe[_0xeb9b('0x37')];_0x841fc6[_0xeb9b('0x79')]=qs['sort'](_0x3f9806['query'][_0xeb9b('0x40')]);_0x841fc6[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_[_0xeb9b('0x7b')](_0x3f9806[_0xeb9b('0x38')],_0x175afe[_0xeb9b('0x42')]));if(_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x841fc6[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x841fc6[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x841fc6[_0xeb9b('0x3c')],function(_0x5b456a){var _0x13db61={};_0x13db61[_0x5b456a]={'$like':'%'+_0x3f9806[_0xeb9b('0x38')]['filter']+'%'};return _0x13db61;})});}_0x841fc6=_[_0xeb9b('0x44')]({},_0x841fc6,_0x3f9806[_0xeb9b('0x47')]);return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})['then'](function(_0x5c0da1){if(_0x5c0da1){_0x2ee62d=_0x5c0da1[_0xeb9b('0x3d')];if(!_0x3f9806['query'][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x841fc6[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x841fc6[_0xeb9b('0x20')]=qs[_0xeb9b('0x20')](_0x3f9806['query'][_0xeb9b('0x20')]);}return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})[_0xeb9b('0x2b')](function(_0x5e7146){if(_0x5e7146){return _0x5e7146?{'count':_0x2ee62d,'rows':_0x5e7146}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x3332ba,null))['catch'](handleError(_0x3332ba,null));};exports[_0xeb9b('0x7d')]=function(_0x26d380,_0x3d3b2c,_0x50dae3){var _0x461392=_0x26d380[_0xeb9b('0x52')]['ids'];var _0x33adad;return db[_0xeb9b('0x7a')]['findAll']({'where':{'id':_0x461392},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb9b('0x7e'),'attributes':['id',_0xeb9b('0x30'),_0xeb9b('0x7f'),_0xeb9b('0x80'),_0xeb9b('0x81')],'raw':!![]}]})[_0xeb9b('0x2b')](function(_0x1a49a7){if(_0x1a49a7){_0x33adad=_0x1a49a7;var _0x40c30f=_[_0xeb9b('0x82')](_0x1a49a7,function(_0xcda621){var _0xb409e0=_0xcda621[_0xeb9b('0x2d')]({'plain':!![]});return _0xb409e0[_0xeb9b('0x7e')];});return db['VoicePrefix'][_0xeb9b('0x4d')]({'where':{'id':_0x26d380[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x52bd7a){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x33e5c3){return _0x52bd7a[_0xeb9b('0x7d')](_0x461392,{'transaction':_0x33e5c3})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x33adad,function(_0x45b94f){return db[_0xeb9b('0x84')]['upsert']({'TeamId':_0x45b94f['id'],'VoicePrefixId':_0x26d380[_0xeb9b('0x4c')]['id']},{'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x40c30f,function(_0x193304){return db[_0xeb9b('0x85')][_0xeb9b('0x86')]({'where':{'UserId':_0x193304['id'],'VoicePrefixId':_0x26d380['params']['id']},'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){_0x40c30f[_0xeb9b('0x87')](function(_0xe7dcc5){socket['emit']('userVoicePrefix:save',{'UserId':_0xe7dcc5['id'],'VoicePrefixId':_0x52bd7a['id']});});});});});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3d3b2c,null))[_0xeb9b('0x4e')](handleError(_0x3d3b2c,null));};exports[_0xeb9b('0x88')]=function(_0x122550,_0x3e804b,_0x41659f){return db[_0xeb9b('0x7a')][_0xeb9b('0x4a')]({'where':{'id':_0x122550[_0xeb9b('0x38')][_0xeb9b('0x74')]},'attributes':['id'],'include':[{'model':db[_0xeb9b('0x89')],'as':_0xeb9b('0x7e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e804b,null))[_0xeb9b('0x2b')](function(_0x4b273d){var _0x16c4a5=_['map'](_0x4b273d,'id');var _0x4d39a7=[];var _0x384fba=[];var _0x23893b=squel[_0xeb9b('0x8a')]();_0x23893b[_0xeb9b('0x8b')](_0xeb9b('0x8c'))['from'](_0xeb9b('0x8d'),'tq')['join'](_0xeb9b('0x8e'),'ut',_0xeb9b('0x8f'))[_0xeb9b('0x41')](_0xeb9b('0x90'),_0x122550['params']['id']);for(var _0x1a9933=0x0;_0x1a9933<_0x4b273d[_0xeb9b('0x3d')];_0x1a9933+=0x1){let _0x2bc3b5=_0x4b273d[_0x1a9933];for(var _0x3b28ef=0x0;_0x3b28ef<_0x2bc3b5[_0xeb9b('0x7e')][_0xeb9b('0x3d')];_0x3b28ef+=0x1){let _0x427672=_0x2bc3b5['Agents'][_0x3b28ef];var _0x276e1f=_0x23893b[_0xeb9b('0x91')]();_0x276e1f[_0xeb9b('0x41')](_0xeb9b('0x92'),_0x427672['id']);_0x384fba['push'](db[_0xeb9b('0x50')][_0xeb9b('0x38')](_0x276e1f[_0xeb9b('0x93')](),{'type':db[_0xeb9b('0x50')]['QueryTypes'][_0xeb9b('0x94')]})[_0xeb9b('0x2b')](function(_0x519eff){if(_0x519eff['length']===0x1){return _0x427672['id'];}else{var _0x564125=_[_0xeb9b('0x95')](_['map'](_0x519eff,_0xeb9b('0x96')),function(_0x44ba4b){return _['includes'](_0x16c4a5,_0x44ba4b);});if(_0x564125){return _0x427672['id'];}}}));}}return BPromise['all'](_0x384fba)[_0xeb9b('0x2b')](function(_0x245892){_0x4d39a7=_(_0x4d39a7)[_0xeb9b('0x97')](_0x245892)[_0xeb9b('0x98')]()[_0xeb9b('0x99')]();return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x122550[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x4d5919){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x5d3fdf){return _0x4d5919[_0xeb9b('0x88')](_0x122550['query'][_0xeb9b('0x74')],{'transaction':_0x5d3fdf})[_0xeb9b('0x2b')](function(){if(!_[_0xeb9b('0x9a')](_0x4d39a7)){return _0x4d5919['removeAgents'](_0x4d39a7,{'transaction':_0x5d3fdf});}})['then'](function(){_0x4d39a7['forEach'](function(_0x8680da){socket[_0xeb9b('0x72')]('userVoicePrefix:remove',{'UserId':_0x8680da,'VoicePrefixId':_0x4d5919['id']});});});});});});})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3e804b,null))[_0xeb9b('0x4e')](handleError(_0x3e804b,null));}; \ No newline at end of file +var _0xda2d=['UserProfileResource','destroy','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','VoicePrefix','includeAll','findAll','catch','show','params','rawAttributes','include','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','update','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','options','getTeams','findOne','Team','online','voicePause','interface','flatMap','Agents','addTeams','each','UserVoicePrefix','forEach','userVoicePrefix:save','removeTeams','field','tq.TeamId','from','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','TeamId','includes','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','VoicePrefixes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xda2d,0x102));var _0xdda2=function(_0x407450,_0xe2faff){_0x407450=_0x407450-0x0;var _0x23b81d=_0xda2d[_0x407450];return _0x23b81d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdda2('0x19')](config[_0xdda2('0x1a')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x1a')]));require(_0xdda2('0x1d'))[_0xdda2('0x1e')](socket);function respondWithStatusCode(_0x4df902,_0x79c6d4){_0x79c6d4=_0x79c6d4||0xcc;return function(_0x4b0220){if(_0x4b0220){return _0x4df902[_0xdda2('0x1f')](_0x79c6d4);}return _0x4df902[_0xdda2('0x20')](_0x79c6d4)[_0xdda2('0x21')]();};}function respondWithResult(_0x457764,_0x1922b1){_0x1922b1=_0x1922b1||0xc8;return function(_0x5d8a83){if(_0x5d8a83){return _0x457764['status'](_0x1922b1)[_0xdda2('0x22')](_0x5d8a83);}};}function respondWithFilteredResult(_0x518c6d,_0x1a5192){return function(_0x1a3b35){if(_0x1a3b35){var _0x335fb5=typeof _0x1a5192[_0xdda2('0x23')]===_0xdda2('0x24')&&typeof _0x1a5192[_0xdda2('0x25')]===_0xdda2('0x24');var _0x351151=_0x1a3b35[_0xdda2('0x26')];var _0x337b0b=_0x335fb5?0x0:_0x1a5192[_0xdda2('0x23')];var _0x6fdede=_0x335fb5?_0x1a3b35['count']:_0x1a5192[_0xdda2('0x23')]+_0x1a5192['limit'];var _0xc4567c;if(_0x6fdede>=_0x351151){_0x6fdede=_0x351151;_0xc4567c=0xc8;}else{_0xc4567c=0xce;}_0x518c6d[_0xdda2('0x20')](_0xc4567c);return _0x518c6d[_0xdda2('0x27')]('Content-Range',_0x337b0b+'-'+_0x6fdede+'/'+_0x351151)[_0xdda2('0x22')](_0x1a3b35);}return null;};}function patchUpdates(_0x5a9bb8){return function(_0x425489){try{jsonpatch[_0xdda2('0x28')](_0x425489,_0x5a9bb8,!![]);}catch(_0x4ac3eb){return BPromise[_0xdda2('0x29')](_0x4ac3eb);}return _0x425489[_0xdda2('0x2a')]();};}function saveUpdates(_0x2528d7,_0x13b0f3){return function(_0x45ee9d){if(_0x45ee9d){return _0x45ee9d['update'](_0x2528d7)[_0xdda2('0x2b')](function(_0x4be5ea){return _0x4be5ea;});}return null;};}function removeEntity(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(_0x5436d1){return _0x5436d1['destroy']()[_0xdda2('0x2b')](function(){var _0x4567e7=_0x5436d1[_0xdda2('0x2c')]({'plain':!![]});var _0x5e9e74=_0xdda2('0x2d');return db[_0xdda2('0x2e')][_0xdda2('0x2f')]({'where':{'type':_0x5e9e74,'resourceId':_0x4567e7['id']}})[_0xdda2('0x2b')](function(){return _0x5436d1;});})[_0xdda2('0x2b')](function(){_0x2391a5[_0xdda2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c37d,_0x255bbc){return function(_0x53acb5){if(!_0x53acb5){_0x24c37d[_0xdda2('0x1f')](0x194);}return _0x53acb5;};}function handleError(_0x2cfaca,_0x3b18b8){_0x3b18b8=_0x3b18b8||0x1f4;return function(_0x15e511){logger['error'](_0x15e511[_0xdda2('0x30')]);if(_0x15e511[_0xdda2('0x31')]){delete _0x15e511['name'];}_0x2cfaca[_0xdda2('0x20')](_0x3b18b8)['send'](_0x15e511);};}exports[_0xdda2('0x32')]=function(_0x55809a,_0x53ff76){var _0x510b7b={},_0x239c25={},_0x5bfc17={'count':0x0,'rows':[]};var _0x1b13f4=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4637c1){return{'name':_0x4637c1[_0xdda2('0x33')],'type':_0x4637c1[_0xdda2('0x34')][_0xdda2('0x35')]};});_0x239c25[_0xdda2('0x36')]=_[_0xdda2('0x37')](_0x1b13f4,_0xdda2('0x31'));_0x239c25[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x55809a[_0xdda2('0x38')]);_0x239c25['filters']=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],_0x239c25[_0xdda2('0x38')]);_0x510b7b[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x55809a['query']['fields']));_0x510b7b[_0xdda2('0x3b')]=_0x510b7b[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x510b7b['attributes']:_0x239c25['model'];if(!_0x55809a[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x510b7b[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x55809a['query'][_0xdda2('0x25')]);_0x510b7b[_0xdda2('0x23')]=qs['offset'](_0x55809a['query'][_0xdda2('0x23')]);}_0x510b7b[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x55809a[_0xdda2('0x38')][_0xdda2('0x41')]);_0x510b7b['where']=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x55809a[_0xdda2('0x38')],_0x239c25[_0xdda2('0x42')]),_0x1b13f4);if(_0x55809a['query']['filter']){_0x510b7b[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x510b7b[_0xdda2('0x44')],{'$or':_['map'](_0x1b13f4,function(_0x1bb2a7){if(_0x1bb2a7['type']!==_0xdda2('0x46')){var _0x4c68d7={};_0x4c68d7[_0x1bb2a7[_0xdda2('0x31')]]={'$like':'%'+_0x55809a[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4c68d7;}})});}_0x510b7b=_[_0xdda2('0x45')]({},_0x510b7b,_0x55809a['options']);var _0x1c5195={'where':_0x510b7b['where']};return db[_0xdda2('0x48')]['count'](_0x1c5195)[_0xdda2('0x2b')](function(_0x12589b){_0x5bfc17[_0xdda2('0x26')]=_0x12589b;if(_0x55809a[_0xdda2('0x38')][_0xdda2('0x49')]){_0x510b7b['include']=[{'all':!![]}];}return db[_0xdda2('0x48')][_0xdda2('0x4a')](_0x510b7b);})['then'](function(_0x2caced){_0x5bfc17['rows']=_0x2caced;return _0x5bfc17;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x53ff76,_0x510b7b))[_0xdda2('0x4b')](handleError(_0x53ff76,null));};exports[_0xdda2('0x4c')]=function(_0x355b6a,_0x3f1f9b){var _0x6718ea={'raw':![],'where':{'id':_0x355b6a[_0xdda2('0x4d')]['id']}},_0x550351={};_0x550351[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x48')][_0xdda2('0x4e')]);_0x550351[_0xdda2('0x38')]=_['keys'](_0x355b6a['query']);_0x550351['filters']=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],_0x550351['query']);_0x6718ea[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],qs['fields'](_0x355b6a[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x6718ea['attributes']=_0x6718ea['attributes'][_0xdda2('0x3d')]?_0x6718ea['attributes']:_0x550351[_0xdda2('0x36')];if(_0x355b6a['query'][_0xdda2('0x49')]){_0x6718ea[_0xdda2('0x4f')]=[{'all':!![]}];}_0x6718ea=_['merge']({},_0x6718ea,_0x355b6a['options']);return db[_0xdda2('0x48')][_0xdda2('0x50')](_0x6718ea)[_0xdda2('0x2b')](handleEntityNotFound(_0x3f1f9b,null))[_0xdda2('0x2b')](respondWithResult(_0x3f1f9b,null))['catch'](handleError(_0x3f1f9b,null));};exports[_0xdda2('0x2f')]=function(_0x3bba94,_0x3d2cb0){return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x3bba94['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x3d2cb0,null))[_0xdda2('0x2b')](removeEntity(_0x3d2cb0,null))['catch'](handleError(_0x3d2cb0,null));};exports[_0xdda2('0x51')]=function(_0x123c2d,_0x143670){return db[_0xdda2('0x48')][_0xdda2('0x51')]()[_0xdda2('0x2b')](respondWithResult(_0x143670,null))['catch'](handleError(_0x143670,null));};exports[_0xdda2('0x52')]=function(_0x4a9814,_0x361038){var _0x4a70ff;return db[_0xdda2('0x53')]['transaction'](function(_0x3b5bbf){return db[_0xdda2('0x48')][_0xdda2('0x52')](_0x4a9814[_0xdda2('0x54')],{'transaction':_0x3b5bbf})[_0xdda2('0x2b')](function(_0x2b45f3){_0x4a70ff=_0x2b45f3[_0xdda2('0x2c')]({'plain':!![]});return db[_0xdda2('0x55')]['find']({'where':{'id':_0x4a70ff[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x1b24f2){return createVoicePrefixExtensions(_0x4a70ff,_0x1b24f2,_0x3b5bbf);});});})['then'](function(){var _0xf380b0=_0x4a9814[_0xdda2('0x57')]['get']({'plain':!![]});if(!_0xf380b0)throw new Error(_0xdda2('0x58'));if(_0xf380b0['role']===_0xdda2('0x57')){var _0x10fbac=_0x4a70ff;return db[_0xdda2('0x59')][_0xdda2('0x50')]({'where':{'name':_0xdda2('0x2d'),'userProfileId':_0xf380b0['userProfileId']},'raw':!![]})['then'](function(_0x5c2cb2){if(_0x5c2cb2&&_0x5c2cb2[_0xdda2('0x5a')]===0x0){return db[_0xdda2('0x2e')]['create']({'name':_0x10fbac[_0xdda2('0x31')],'resourceId':_0x10fbac['id'],'type':_0x5c2cb2[_0xdda2('0x31')],'sectionId':_0x5c2cb2['id']},{})[_0xdda2('0x2b')](function(){return _0x4a70ff;});}else{return _0x4a70ff;}})['catch'](function(_0x3fd76c){logger[_0xdda2('0x5b')](_0xdda2('0x5c'),_0x3fd76c);throw _0x3fd76c;});}return _0x4a70ff;})['then'](respondWithResult(_0x361038,null))[_0xdda2('0x4b')](handleError(_0x361038,null));};function Extension(_0x4495e5,_0x7eb83f,_0x25c9a9,_0x5d8602){this[_0xdda2('0x5d')]='from-sip';this['exten']=_0x4495e5;this['app']=_0x25c9a9;this[_0xdda2('0x34')]=_0xdda2('0x5e');this[_0xdda2('0x5f')]=_0xdda2('0x60');this[_0xdda2('0x61')]=_0x7eb83f;this[_0xdda2('0x62')]=_0x5d8602;}function createVoicePrefixExtensions(_0x29a739,_0x3ac33a,_0x269ad1){return new BPromise(function(_0x138c2f,_0x26e7de){var _0x5e6dcf=new Extension(formatPrefixName(_0x29a739[_0xdda2('0x63')]),0x1,_0xdda2('0x64'),_0xdda2('0x65'));_0x5e6dcf[_0xdda2('0x66')]=_0x29a739['id'];return db[_0xdda2('0x55')][_0xdda2('0x52')](_0x5e6dcf,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x57fb41){var _0x23518f=_0x57fb41[_0xdda2('0x2c')]({'plain':!![]});var _0x19e650=_[_0xdda2('0x37')](addVoicePrefixExtensions(_0x29a739,_0x3ac33a),function(_0x44f619){_0x44f619['VoiceExtensionId']=_0x23518f['id'];_0x44f619[_0xdda2('0x66')]=_0x29a739['id'];return _0x44f619;});return db[_0xdda2('0x55')][_0xdda2('0x67')](_0x19e650,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x21d0e4){if(!_0x21d0e4){return _0x26e7de('Extensions\x20creation\x20failed');}else{return _0x138c2f(_0x21d0e4);}})[_0xdda2('0x4b')](function(_0x18d251){return _0x26e7de(_0x18d251);});});;});};function addVoicePrefixExtensions(_0x3d49e8,_0x4530b7){var _0x1ac15a=[];var _0x5d34d7=formatPrefixName(_0x3d49e8[_0xdda2('0x63')]);_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x2,_0xdda2('0x69'),'CDR(prefix)='+_0x3d49e8[_0xdda2('0x31')]));if(_0x3d49e8['callerIdAll']){_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x69'),_0xdda2('0x6a')+_0x3d49e8['callerIdAll']));}else{_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x64'),'No\x20callerid\x20available'));}_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x4,'goto',_0x4530b7[_0xdda2('0x5d')]+','+_0xdda2('0x6b')+(0x8+_0x3d49e8[_0xdda2('0x31')][_0xdda2('0x3d')])+'}'+','+0x1));return _0x1ac15a;}function formatPrefixName(_0x10d1de){var _0x4a061a='_';for(var _0x586ca1=0x0;_0x586ca1<_0x10d1de[_0xdda2('0x3d')];_0x586ca1++){if(_0x10d1de[_0xdda2('0x6c')](_0x586ca1)=='-'){_0x4a061a+=_0x10d1de['charAt'](_0x586ca1);}else{_0x4a061a+='['+_0x10d1de['charAt'](_0x586ca1)+']';}}_0x4a061a+='.';return _0x4a061a;}exports[_0xdda2('0x6d')]=function(_0x501336,_0x12a052,_0x1a33ba){var _0x4910a6=_0x501336[_0xdda2('0x54')];_0x4910a6[_0xdda2('0x63')]=_0xdda2('0x6e')+_0x4910a6[_0xdda2('0x31')]+'-';return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x4eebb0){return db[_0xdda2('0x48')][_0xdda2('0x6d')](_0x4910a6,{'where':{'id':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension'][_0xdda2('0x2f')]({'where':{'VoicePrefixId':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x4910a6[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x2f03b9){return createVoicePrefixExtensions(_0x4910a6,_0x2f03b9,_0x4eebb0);});});});})['then'](function(){return db['VoicePrefix'][_0xdda2('0x70')](_0x4910a6['id']);})['then'](respondWithResult(_0x12a052,null))[_0xdda2('0x4b')](handleError(_0x12a052,null));};exports[_0xdda2('0x71')]=function(_0x19d92e,_0x12fd67,_0x597b09){return db[_0xdda2('0x48')]['find']({'where':{'id':_0x19d92e['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x12fd67,null))['then'](function(_0x2de01c){if(_0x2de01c){return _0x2de01c[_0xdda2('0x71')](_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')],_[_0xdda2('0x73')](_0x19d92e[_0xdda2('0x54')],[_0xdda2('0x72'),'id'])||{})[_0xdda2('0x74')](function(_0x37c547){for(var _0x495a28=0x0;_0x495a28<_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x495a28+=0x1){socket[_0xdda2('0x75')]('userVoicePrefix:save',{'UserId':Number(_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0x495a28]),'VoicePrefixId':Number(_0x19d92e[_0xdda2('0x4d')]['id'])});}return _0x37c547;});}})[_0xdda2('0x2b')](respondWithResult(_0x12fd67,null))['catch'](handleError(_0x12fd67,null));};exports['removeAgents']=function(_0xe4110b,_0xdef266,_0x423e1f){return db[_0xdda2('0x48')]['find']({'where':{'id':_0xe4110b[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0xdef266,null))[_0xdda2('0x2b')](function(_0x152ba3){if(_0x152ba3){return _0x152ba3[_0xdda2('0x76')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])[_0xdda2('0x2b')](function(){if(_[_0xdda2('0x77')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])){for(var _0x23a80a=0x0;_0x23a80a<_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x23a80a+=0x1){socket['emit'](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')]['ids'][_0x23a80a]),'VoicePrefixId':Number(_0xe4110b['params']['id'])});}}else{socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')]),'VoicePrefixId':Number(_0xe4110b[_0xdda2('0x4d')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0xdef266,null))['catch'](handleError(_0xdef266,null));};exports[_0xdda2('0x79')]=function(_0x1f3abe,_0x447bd2,_0x2bb4f3){var _0x563be8={};var _0xbf1248={};var _0x5c3d67;var _0x20ebf7;return db[_0xdda2('0x48')]['findOne']({'where':{'id':_0x1f3abe[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x447bd2,null))[_0xdda2('0x2b')](function(_0x1dfe6d){if(_0x1dfe6d){_0x5c3d67=_0x1dfe6d;_0xbf1248[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x7a')][_0xdda2('0x4e')]);_0xbf1248[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x1f3abe[_0xdda2('0x38')]);_0xbf1248['filters']=_[_0xdda2('0x3a')](_0xbf1248[_0xdda2('0x36')],_0xbf1248[_0xdda2('0x38')]);_0x563be8[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xbf1248['model'],qs[_0xdda2('0x3c')](_0x1f3abe[_0xdda2('0x38')]['fields']));_0x563be8[_0xdda2('0x3b')]=_0x563be8[_0xdda2('0x3b')]['length']?_0x563be8['attributes']:_0xbf1248[_0xdda2('0x36')];_0x563be8[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x41')]);_0x563be8[_0xdda2('0x44')]=qs['filters'](_[_0xdda2('0x43')](_0x1f3abe[_0xdda2('0x38')],_0xbf1248['filters']));if(_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]){_0x563be8['where']=_[_0xdda2('0x45')](_0x563be8[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x563be8['attributes'],function(_0xe6f37b){var _0x4a34ee={};_0x4a34ee[_0xe6f37b]={'$like':'%'+_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4a34ee;})});}_0x563be8=_[_0xdda2('0x45')]({},_0x563be8,_0x1f3abe[_0xdda2('0x7b')]);return _0x5c3d67['getAgents'](_0x563be8);}})['then'](function(_0x2b8c0c){if(_0x2b8c0c){_0x20ebf7=_0x2b8c0c[_0xdda2('0x3d')];if(!_0x1f3abe['query'][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x563be8[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x25')]);_0x563be8[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x23')]);}return _0x5c3d67[_0xdda2('0x79')](_0x563be8);}})[_0xdda2('0x2b')](function(_0x528185){if(_0x528185){return _0x528185?{'count':_0x20ebf7,'rows':_0x528185}:null;}})['then'](respondWithResult(_0x447bd2,null))['catch'](handleError(_0x447bd2,null));};exports[_0xdda2('0x7c')]=function(_0x4edf20,_0x2910b0,_0x323af8){var _0x2f18a0={};var _0xe797aa={};var _0x558ab6;var _0x374fc4;return db[_0xdda2('0x48')][_0xdda2('0x7d')]({'where':{'id':_0x4edf20['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x2910b0,null))[_0xdda2('0x2b')](function(_0x2588f5){if(_0x2588f5){_0x558ab6=_0x2588f5;_0xe797aa['model']=_['keys'](db[_0xdda2('0x7e')][_0xdda2('0x4e')]);_0xe797aa[_0xdda2('0x38')]=_['keys'](_0x4edf20[_0xdda2('0x38')]);_0xe797aa[_0xdda2('0x42')]=_[_0xdda2('0x3a')](_0xe797aa[_0xdda2('0x36')],_0xe797aa[_0xdda2('0x38')]);_0x2f18a0[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xe797aa['model'],qs[_0xdda2('0x3c')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x2f18a0[_0xdda2('0x3b')]=_0x2f18a0['attributes'][_0xdda2('0x3d')]?_0x2f18a0[_0xdda2('0x3b')]:_0xe797aa[_0xdda2('0x36')];_0x2f18a0[_0xdda2('0x40')]=qs['sort'](_0x4edf20['query']['sort']);_0x2f18a0[_0xdda2('0x44')]=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x4edf20[_0xdda2('0x38')],_0xe797aa[_0xdda2('0x42')]));if(_0x4edf20[_0xdda2('0x38')]['filter']){_0x2f18a0[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x2f18a0[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x2f18a0[_0xdda2('0x3b')],function(_0x39ee74){var _0xcbf57f={};_0xcbf57f[_0x39ee74]={'$like':'%'+_0x4edf20[_0xdda2('0x38')]['filter']+'%'};return _0xcbf57f;})});}_0x2f18a0=_[_0xdda2('0x45')]({},_0x2f18a0,_0x4edf20['options']);return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x15066f){if(_0x15066f){_0x374fc4=_0x15066f['length'];if(!_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x2f18a0[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x25')]);_0x2f18a0[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x4edf20['query'][_0xdda2('0x23')]);}return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x42db44){if(_0x42db44){return _0x42db44?{'count':_0x374fc4,'rows':_0x42db44}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x2910b0,null))[_0xdda2('0x4b')](handleError(_0x2910b0,null));};exports['addTeams']=function(_0x1702ae,_0x21ade3,_0x251408){var _0x311e34=_0x1702ae[_0xdda2('0x54')][_0xdda2('0x72')];var _0x4124a5;return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x311e34},'attributes':['id'],'include':[{'model':db[_0xdda2('0x7a')],'as':'Agents','attributes':['id',_0xdda2('0x31'),_0xdda2('0x7f'),_0xdda2('0x80'),_0xdda2('0x81')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x4c540d){if(_0x4c540d){_0x4124a5=_0x4c540d;var _0x320cf1=_[_0xdda2('0x82')](_0x4c540d,function(_0xdd343d){var _0x56cd13=_0xdd343d[_0xdda2('0x2c')]({'plain':!![]});return _0x56cd13[_0xdda2('0x83')];});return db[_0xdda2('0x48')]['find']({'where':{'id':_0x1702ae[_0xdda2('0x4d')]['id']}})['then'](function(_0x579fc9){return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x3752bf){return _0x579fc9[_0xdda2('0x84')](_0x311e34,{'transaction':_0x3752bf})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x4124a5,function(_0x14baa0){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x14baa0['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},{'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x320cf1,function(_0x16b910){return db[_0xdda2('0x86')]['findOrCreate']({'where':{'UserId':_0x16b910['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){_0x320cf1[_0xdda2('0x87')](function(_0x233494){socket[_0xdda2('0x75')](_0xdda2('0x88'),{'UserId':_0x233494['id'],'VoicePrefixId':_0x579fc9['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x21ade3,null))[_0xdda2('0x4b')](handleError(_0x21ade3,null));};exports[_0xdda2('0x89')]=function(_0x44e93d,_0x2defb2,_0x53c44d){return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdda2('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2defb2,null))[_0xdda2('0x2b')](function(_0x4f2d5c){var _0x240048=_['map'](_0x4f2d5c,'id');var _0x1da0dd=[];var _0xb93d3b=[];var _0x3d59cb=squel['select']();_0x3d59cb[_0xdda2('0x8a')](_0xdda2('0x8b'))[_0xdda2('0x8c')]('team_has_voice_prefixes','tq')['join'](_0xdda2('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdda2('0x44')](_0xdda2('0x8e'),_0x44e93d[_0xdda2('0x4d')]['id']);for(var _0x182570=0x0;_0x182570<_0x4f2d5c['length'];_0x182570+=0x1){let _0x28a217=_0x4f2d5c[_0x182570];for(var _0x54cd55=0x0;_0x54cd55<_0x28a217['Agents']['length'];_0x54cd55+=0x1){let _0x5235d5=_0x28a217[_0xdda2('0x83')][_0x54cd55];var _0x4a6058=_0x3d59cb[_0xdda2('0x8f')]();_0x4a6058[_0xdda2('0x44')]('ut.UserId\x20=\x20?',_0x5235d5['id']);_0xb93d3b['push'](db[_0xdda2('0x53')][_0xdda2('0x38')](_0x4a6058[_0xdda2('0x90')](),{'type':db[_0xdda2('0x53')]['QueryTypes']['SELECT']})[_0xdda2('0x2b')](function(_0x19c1eb){if(_0x19c1eb[_0xdda2('0x3d')]===0x1){return _0x5235d5['id'];}else{var _0x22e01a=_['every'](_[_0xdda2('0x37')](_0x19c1eb,_0xdda2('0x91')),function(_0x3867b3){return _[_0xdda2('0x92')](_0x240048,_0x3867b3);});if(_0x22e01a){return _0x5235d5['id'];}}}));}}return BPromise[_0xdda2('0x93')](_0xb93d3b)[_0xdda2('0x2b')](function(_0xa798dc){_0x1da0dd=_(_0x1da0dd)[_0xdda2('0x94')](_0xa798dc)[_0xdda2('0x95')]()[_0xdda2('0x96')]();return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x44e93d[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](function(_0x3cb988){return db[_0xdda2('0x53')]['transaction'](function(_0xe54b68){return _0x3cb988[_0xdda2('0x89')](_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')],{'transaction':_0xe54b68})[_0xdda2('0x2b')](function(){if(!_[_0xdda2('0x97')](_0x1da0dd)){return _0x3cb988[_0xdda2('0x76')](_0x1da0dd,{'transaction':_0xe54b68});}})[_0xdda2('0x2b')](function(){_0x1da0dd[_0xdda2('0x87')](function(_0x1c008c){socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':_0x1c008c,'VoicePrefixId':_0x3cb988['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x2defb2,null))[_0xdda2('0x4b')](handleError(_0x2defb2,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9e47958..8664d2f 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 _0x204e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x5e8cd9,_0x25a46f){var _0x49d5a2=function(_0x2f9b02){while(--_0x2f9b02){_0x5e8cd9['push'](_0x5e8cd9['shift']());}};_0x49d5a2(++_0x25a46f);}(_0x204e,0x188));var _0xe204=function(_0x4bcb3c,_0x192122){_0x4bcb3c=_0x4bcb3c-0x0;var _0xfe09bb=_0x204e[_0x4bcb3c];return _0xfe09bb;};'use strict';var EventEmitter=require(_0xe204('0x0'));var VoicePrefix=require(_0xe204('0x1'))['db'][_0xe204('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe204('0x3')](0x0);var events={'afterCreate':_0xe204('0x4'),'afterUpdate':_0xe204('0x5'),'afterDestroy':_0xe204('0x6')};function emitEvent(_0x4a048f){return function(_0x2a200a,_0x389d33,_0x35d40f){VoicePrefixEvents['emit'](_0x4a048f+':'+_0x2a200a['id'],_0x2a200a);VoicePrefixEvents[_0xe204('0x7')](_0x4a048f,_0x2a200a);_0x35d40f(null);};}for(var e in events){if(events[_0xe204('0x8')](e)){var event=events[e];VoicePrefix[_0xe204('0x9')](e,emitEvent(event));}}module[_0xe204('0xa')]=VoicePrefixEvents; \ No newline at end of file +var _0x4b7a=['hasOwnProperty','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x1d7c10,_0x3b5ed7){var _0xb76ec7=function(_0x520c1c){while(--_0x520c1c){_0x1d7c10['push'](_0x1d7c10['shift']());}};_0xb76ec7(++_0x3b5ed7);}(_0x4b7a,0x7f));var _0xa4b7=function(_0x1952ac,_0x5c7345){_0x1952ac=_0x1952ac-0x0;var _0x15abe5=_0x4b7a[_0x1952ac];return _0x15abe5;};'use strict';var EventEmitter=require(_0xa4b7('0x0'));var VoicePrefix=require(_0xa4b7('0x1'))['db'][_0xa4b7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa4b7('0x3')](0x0);var events={'afterCreate':_0xa4b7('0x4'),'afterUpdate':_0xa4b7('0x5'),'afterDestroy':_0xa4b7('0x6')};function emitEvent(_0x3483b2){return function(_0x149e40,_0x4dcd1b,_0x5878bb){VoicePrefixEvents[_0xa4b7('0x7')](_0x3483b2+':'+_0x149e40['id'],_0x149e40);VoicePrefixEvents[_0xa4b7('0x7')](_0x3483b2,_0x149e40);_0x5878bb(null);};}for(var e in events){if(events[_0xa4b7('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e2f3e74..b667414 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 _0x5bd9=['util','../../config/logger','api','moment','request-promise','exports','voice_prefixes','lodash'];(function(_0x27c4c0,_0x1b64aa){var _0x30c921=function(_0x13962c){while(--_0x13962c){_0x27c4c0['push'](_0x27c4c0['shift']());}};_0x30c921(++_0x1b64aa);}(_0x5bd9,0xc7));var _0x95bd=function(_0x36aacd,_0x2d702b){_0x36aacd=_0x36aacd-0x0;var _0x4f52cd=_0x5bd9[_0x36aacd];return _0x4f52cd;};'use strict';var _=require(_0x95bd('0x0'));var util=require(_0x95bd('0x1'));var logger=require(_0x95bd('0x2'))(_0x95bd('0x3'));var moment=require(_0x95bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x95bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x95bd('0x6')]=function(_0x2632f7,_0x1b03b5){return _0x2632f7['define']('VoicePrefix',attributes,{'tableName':_0x95bd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x770d=['VoicePrefix','../../config/logger','api','moment','bluebird','path','./voicePrefix.attributes'];(function(_0x35dff2,_0x9abbd1){var _0x1aef69=function(_0x203512){while(--_0x203512){_0x35dff2['push'](_0x35dff2['shift']());}};_0x1aef69(++_0x9abbd1);}(_0x770d,0x6a));var _0xd770=function(_0x2ea2e9,_0x42b62c){_0x2ea2e9=_0x2ea2e9-0x0;var _0x35dccd=_0x770d[_0x2ea2e9];return _0x35dccd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd770('0x0'))(_0xd770('0x1'));var moment=require(_0xd770('0x2'));var BPromise=require(_0xd770('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd770('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd770('0x5'));module['exports']=function(_0x371592,_0x5373ac){return _0x371592['define'](_0xd770('0x6'),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 410960a..b0d7beb 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 _0xb016=['../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x44f033,_0x50304d){var _0xfb2869=function(_0x25785d){while(--_0x25785d){_0x44f033['push'](_0x44f033['shift']());}};_0xfb2869(++_0x50304d);}(_0xb016,0x159));var _0x6b01=function(_0x86423a,_0x502eea){_0x86423a=_0x86423a-0x0;var _0x3e1db9=_0xb016[_0x86423a];return _0x3e1db9;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6b01('0xa')],{'host':_0x6b01('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6b01('0xc'))[_0x6b01('0xd')](socket);function respondWithRpcPromise(_0x2c4e48,_0x242394,_0xab37c){return new BPromise(function(_0x5bed15,_0x4b4a4d){return client[_0x6b01('0xe')](_0x2c4e48,_0xab37c)[_0x6b01('0xf')](function(_0x2660c7){logger['info'](_0x6b01('0x10'),_0x242394,'request\x20sent');logger['debug'](_0x6b01('0x11'),_0x242394,'request\x20sent',JSON[_0x6b01('0x12')](_0x2660c7));if(_0x2660c7[_0x6b01('0x13')]){if(_0x2660c7['error'][_0x6b01('0x14')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x242394,_0x2660c7['error'][_0x6b01('0x15')]);return _0x4b4a4d(_0x2660c7['error']['message']);}logger[_0x6b01('0x13')](_0x6b01('0x10'),_0x242394,_0x2660c7[_0x6b01('0x13')][_0x6b01('0x15')]);return _0x5bed15(_0x2660c7[_0x6b01('0x13')][_0x6b01('0x15')]);}else{logger[_0x6b01('0x16')](_0x6b01('0x10'),_0x242394,_0x6b01('0x17'));_0x5bed15(_0x2660c7[_0x6b01('0x18')][_0x6b01('0x15')]);}})['catch'](function(_0x2c5f29){logger[_0x6b01('0x13')](_0x6b01('0x10'),_0x242394,_0x2c5f29);_0x4b4a4d(_0x2c5f29);});});} \ No newline at end of file +var _0x9fe7=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xe7633c,_0x2f63f9){var _0x3ecc86=function(_0x4db9a3){while(--_0x4db9a3){_0xe7633c['push'](_0xe7633c['shift']());}};_0x3ecc86(++_0x2f63f9);}(_0x9fe7,0x1df));var _0x79fe=function(_0x5db66a,_0x4dcead){_0x5db66a=_0x5db66a-0x0;var _0x2404ed=_0x9fe7[_0x5db66a];return _0x2404ed;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var moment=require('moment');var BPromise=require(_0x79fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79fe('0x3'));var db=require(_0x79fe('0x4'))['db'];var utils=require(_0x79fe('0x5'));var logger=require('../../config/logger')(_0x79fe('0x6'));var config=require(_0x79fe('0x7'));var jayson=require(_0x79fe('0x8'));var client=jayson['client'][_0x79fe('0x9')]({'port':0x232a});config[_0x79fe('0xa')]=_[_0x79fe('0xb')](config['redis'],{'host':_0x79fe('0xc'),'port':0x18eb});var socket=require(_0x79fe('0xd'))(new Redis(config[_0x79fe('0xa')]));require(_0x79fe('0xe'))[_0x79fe('0xf')](socket);function respondWithRpcPromise(_0x5b914a,_0x34c217,_0x253f7d){return new BPromise(function(_0x4a3ccf,_0x20cde6){return client[_0x79fe('0x10')](_0x5b914a,_0x253f7d)[_0x79fe('0x11')](function(_0x20607a){logger['info'](_0x79fe('0x12'),_0x34c217,_0x79fe('0x13'));logger[_0x79fe('0x14')](_0x79fe('0x15'),_0x34c217,_0x79fe('0x13'),JSON[_0x79fe('0x16')](_0x20607a));if(_0x20607a[_0x79fe('0x17')]){if(_0x20607a[_0x79fe('0x17')]['code']===0x1f4){logger[_0x79fe('0x17')](_0x79fe('0x12'),_0x34c217,_0x20607a[_0x79fe('0x17')][_0x79fe('0x18')]);return _0x20cde6(_0x20607a[_0x79fe('0x17')][_0x79fe('0x18')]);}logger['error'](_0x79fe('0x12'),_0x34c217,_0x20607a[_0x79fe('0x17')][_0x79fe('0x18')]);return _0x4a3ccf(_0x20607a[_0x79fe('0x17')]['message']);}else{logger[_0x79fe('0x19')](_0x79fe('0x12'),_0x34c217,_0x79fe('0x13'));_0x4a3ccf(_0x20607a[_0x79fe('0x1a')]['message']);}})['catch'](function(_0x132964){logger[_0x79fe('0x17')](_0x79fe('0x12'),_0x34c217,_0x132964);_0x20cde6(_0x132964);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 6068f0c..959ce4a 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 _0x8868=['emit','removeListener','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x222b33,_0x484b47){var _0x5bd400=function(_0x5f2469){while(--_0x5f2469){_0x222b33['push'](_0x222b33['shift']());}};_0x5bd400(++_0x484b47);}(_0x8868,0x1ca));var _0x8886=function(_0x4a9858,_0x58b559){_0x4a9858=_0x4a9858-0x0;var _0x34e8d2=_0x8868[_0x4a9858];return _0x34e8d2;};'use strict';var VoicePrefixEvents=require(_0x8886('0x0'));var events=[_0x8886('0x1'),_0x8886('0x2'),_0x8886('0x3')];function createListener(_0x11d0f9,_0x46ec8e){return function(_0x34cd50){_0x46ec8e[_0x8886('0x4')](_0x11d0f9,_0x34cd50);};}function removeListener(_0x230fbb,_0x224e93){return function(){VoicePrefixEvents[_0x8886('0x5')](_0x230fbb,_0x224e93);};}exports['register']=function(_0x544272){for(var _0x2b2f5d=0x0,_0x26b94d=events['length'];_0x2b2f5d<_0x26b94d;_0x2b2f5d++){var _0x1a85e1=events[_0x2b2f5d];var _0x56b9fa=createListener(_0x8886('0x6')+_0x1a85e1,_0x544272);VoicePrefixEvents['on'](_0x1a85e1,_0x56b9fa);}}; \ No newline at end of file +var _0x0434=['update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x15c97c,_0x35308c){var _0x21b522=function(_0x5e6863){while(--_0x5e6863){_0x15c97c['push'](_0x15c97c['shift']());}};_0x21b522(++_0x35308c);}(_0x0434,0x1ad));var _0x4043=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x0434[_0x3b3cc6];return _0x1161e4;};'use strict';var VoicePrefixEvents=require(_0x4043('0x0'));var events=[_0x4043('0x1'),_0x4043('0x2'),_0x4043('0x3')];function createListener(_0x425361,_0x56e8f3){return function(_0x4ca779){_0x56e8f3[_0x4043('0x4')](_0x425361,_0x4ca779);};}function removeListener(_0xfa9ae8,_0x3e475f){return function(){VoicePrefixEvents[_0x4043('0x5')](_0xfa9ae8,_0x3e475f);};}exports[_0x4043('0x6')]=function(_0x1dba57){for(var _0x58fca7=0x0,_0x41d0a9=events[_0x4043('0x7')];_0x58fca7<_0x41d0a9;_0x58fca7++){var _0x5080e5=events[_0x58fca7];var _0x56355c=createListener(_0x4043('0x8')+_0x5080e5,_0x1dba57);VoicePrefixEvents['on'](_0x5080e5,_0x56355c);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bb1bbe9..01b7573 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(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xb10b,0x12a));var _0xbb10=function(_0x28fcdc,_0x17e930){_0x28fcdc=_0x28fcdc-0x0;var _0x80bd4c=_0xb10b[_0x28fcdc];return _0x80bd4c;};'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(_0x2e38e2,_0x3442ef){var _0x3c1afb=function(_0x21f62a){while(--_0x21f62a){_0x2e38e2['push'](_0x2e38e2['shift']());}};_0x3c1afb(++_0x3442ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 032f42a..63ccc63 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 _0x8fc1=['strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x8fc1,0x141));var _0x18fc=function(_0x3186ca,_0x1f0f90){_0x3186ca=_0x3186ca-0x0;var _0x5d2e9a=_0x8fc1[_0x3186ca];return _0x5d2e9a;};'use strict';var Sequelize=require(_0x18fc('0x0'));module[_0x18fc('0x1')]={'name':{'type':Sequelize[_0x18fc('0x2')],'allowNull':![],'unique':_0x18fc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x5'),_0x18fc('0x6')),'allowNull':![],'defaultValue':_0x18fc('0x5')},'musiconhold':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':_0x18fc('0x7')},'announce':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x18fc('0x4')]('rr','ringall',_0x18fc('0x8'),_0x18fc('0x9'),_0x18fc('0xa'),_0x18fc('0xb'),_0x18fc('0xc'),_0x18fc('0xd'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x30dd76){this[_0x18fc('0xe')](_0x18fc('0xf'),_0x30dd76?_0x30dd76:_0x18fc('0xb'));},'get':function(){var _0x3267a7=this[_0x18fc('0x10')](_0x18fc('0x11'));var _0x526651=this[_0x18fc('0x10')](_0x18fc('0x12'));var _0x19cfd2=this[_0x18fc('0x10')](_0x18fc('0xf'));if(_0x3267a7===_0x18fc('0x5')){return _0x19cfd2;}if(_0x526651===_0x18fc('0x13')&&_0x19cfd2===_0x18fc('0xb')||_0x526651===_0x18fc('0x13')&&_0x19cfd2===_0x18fc('0x14')){return _0x19cfd2;}if(_0x526651===_0x18fc('0x15')||_0x526651===_0x18fc('0x16')||_0x526651===_0x18fc('0x17')){return _0x19cfd2;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x18fc('0x18')](0xb)},'timeout':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x18fc('0x4')]('yes','no'),'defaultValue':_0x18fc('0x19')},'autopause':{'type':Sequelize['ENUM'](_0x18fc('0x19'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x18fc('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x18fc('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x18fc('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x18fc('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x18fc('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no'),'defaultValue':_0x18fc('0x19')},'announce_holdtime':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no',_0x18fc('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x18fc('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x18fc('0x2')]},'queue_youarenext':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x18fc('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x18fc('0x2')]},'queue_quantity1':{'type':Sequelize[_0x18fc('0x2')]},'queue_quantity2':{'type':Sequelize[_0x18fc('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x18fc('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x5e2c6b){this[_0x18fc('0xe')](_0x18fc('0x1b'),_0x5e2c6b?_0x5e2c6b[_0x18fc('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0x18fc('0x1b'))?this['getDataValue'](_0x18fc('0x1b'))[_0x18fc('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':_0x18fc('0x19'),'set':function(_0x37359f){this[_0x18fc('0xe')]('joinempty',_0x37359f?_0x37359f[_0x18fc('0x1c')](','):undefined);},'get':function(){return this[_0x18fc('0x10')]('joinempty')?this[_0x18fc('0x10')](_0x18fc('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':'no','set':function(_0x571c0){this[_0x18fc('0xe')](_0x18fc('0x1f'),_0x571c0?_0x571c0[_0x18fc('0x1c')](','):undefined);},'get':function(){return this[_0x18fc('0x10')](_0x18fc('0x1f'))?this[_0x18fc('0x10')](_0x18fc('0x1f'))[_0x18fc('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x18fc('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x18fc('0x2')]},'description':{'type':Sequelize[_0x18fc('0x2')]},'acw':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':0x0,'set':function(_0xa95e89){this[_0x18fc('0xe')](_0x18fc('0x21'),_0xa95e89);if(_0xa95e89){if(this['getDataValue'](_0x18fc('0x22'))<0x2){this[_0x18fc('0xe')](_0x18fc('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x18fc('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x18fc('0x23')},'dialMethod':{'type':Sequelize[_0x18fc('0x4')]('preview',_0x18fc('0x15'),'power',_0x18fc('0x16'),_0x18fc('0x13')),'defaultValue':_0x18fc('0x15'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x18fc('0x18')](0x4)[_0x18fc('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x18fc('0x25')},'dialLimitQueue':{'type':Sequelize[_0x18fc('0x18')](0x4)[_0x18fc('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x18fc('0x26')},'dialPowerLevel':{'type':Sequelize[_0x18fc('0x27')](0x2)[_0x18fc('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x18fc('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x18fc('0x29'),_0x18fc('0x2a')),'defaultValue':'dropRate','comment':_0x18fc('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x18fc('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':_0x18fc('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x18fc('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x2f')},'dialQueueProject':{'type':Sequelize[_0x18fc('0x2')],'comment':_0x18fc('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x18fc('0x18')](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x18fc('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x18fc('0x18')](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x18fc('0x37')},'dialTimezone':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':_0x18fc('0x38')},'dialPrefix':{'type':Sequelize[_0x18fc('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x18fc('0x4')](_0x18fc('0x39'),'never','onlyIfOpen'),'defaultValue':_0x18fc('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x18fc('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x18fc('0x18')](0x9)[_0x18fc('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x18fc('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x18fc('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x18fc('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x18fc('0x18')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x18fc('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x18fc('0x18')](0x9)[_0x18fc('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18fc('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x18fc('0x18')](0x9)[_0x18fc('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x18fc('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x18fc('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x18fc('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x18fc('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x18fc('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18fc('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x18fc('0x18')](0x5)[_0x18fc('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x18fc('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':0x0,'comment':_0x18fc('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x18fc('0x45'),'ASC'),'defaultValue':_0x18fc('0x45')},'dialQueueProject2':{'type':Sequelize[_0x18fc('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x18fc('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18fc('0x46')},'dialCutDigit':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18fc('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x18fc('0x18')](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x18fc('0x18')](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18fc('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x18fc('0x18')](0x5)[_0x18fc('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18fc('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':![],'comment':_0x18fc('0x51'),'set':function(_0xe0041c){if(!_0xe0041c)this[_0x18fc('0xe')](_0x18fc('0x52'),null);this[_0x18fc('0xe')](_0x18fc('0x53'),_0xe0041c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x18fc('0x18')](0x3)[_0x18fc('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x18fc('0x20')],'defaultValue':![]}}; \ No newline at end of file +var _0x8579=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','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','mandatoryDispositionPauseId','sequelize','ENUM','inbound','outbound','STRING','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never'];(function(_0x54591f,_0x2dce50){var _0x2a99a6=function(_0x391c15){while(--_0x391c15){_0x54591f['push'](_0x54591f['shift']());}};_0x2a99a6(++_0x2dce50);}(_0x8579,0x6a));var _0x9857=function(_0x491447,_0x2a43ed){_0x491447=_0x491447-0x0;var _0x18e2f5=_0x8579[_0x491447];return _0x18e2f5;};'use strict';var Sequelize=require(_0x9857('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x2'),_0x9857('0x3')),'allowNull':![],'defaultValue':_0x9857('0x2')},'musiconhold':{'type':Sequelize[_0x9857('0x4')],'defaultValue':_0x9857('0x5')},'announce':{'type':Sequelize[_0x9857('0x4')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x9857('0x6'),_0x9857('0x7'),_0x9857('0x8'),_0x9857('0x9'),_0x9857('0xa'),_0x9857('0xb'),_0x9857('0xc')),'allowNull':![],'defaultValue':_0x9857('0xd'),'set':function(_0x41794f){this[_0x9857('0xe')](_0x9857('0xf'),_0x41794f?_0x41794f:_0x9857('0x9'));},'get':function(){var _0x2645fb=this[_0x9857('0x10')](_0x9857('0x11'));var _0x32460d=this[_0x9857('0x10')]('dialMethod');var _0x3dc7c3=this[_0x9857('0x10')](_0x9857('0xf'));if(_0x2645fb===_0x9857('0x2')){return _0x3dc7c3;}if(_0x32460d==='booked'&&_0x3dc7c3==='rrmemory'||_0x32460d===_0x9857('0x12')&&_0x3dc7c3==='roundrobin'){return _0x3dc7c3;}if(_0x32460d===_0x9857('0x13')||_0x32460d===_0x9857('0x14')||_0x32460d===_0x9857('0x15')){return _0x3dc7c3;}return null;}},'servicelevel':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9857('0x16')](0xb)},'timeout':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x9857('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9857('0x17')},'autopause':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no',_0x9857('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9857('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9857('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9857('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no',_0x9857('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9857('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x9857('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9857('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9857('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9857('0x4')]},'queue_youarenext':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9857('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9857('0x4')]},'queue_quantity1':{'type':Sequelize[_0x9857('0x4')]},'queue_quantity2':{'type':Sequelize[_0x9857('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x9857('0x4')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x9857('0x1a')],'set':function(_0x20b84d){this['setDataValue'](_0x9857('0x1b'),_0x20b84d?_0x20b84d[_0x9857('0x1c')](','):[]);},'get':function(){return this[_0x9857('0x10')](_0x9857('0x1b'))?this[_0x9857('0x10')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x1e33f2){this[_0x9857('0xe')]('joinempty',_0x1e33f2?_0x1e33f2[_0x9857('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x9857('0x1d'))?this[_0x9857('0x10')](_0x9857('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9857('0x4')],'defaultValue':'no','set':function(_0x27c59d){this[_0x9857('0xe')]('leavewhenempty',_0x27c59d?_0x27c59d[_0x9857('0x1c')](','):undefined);},'get':function(){return this[_0x9857('0x10')](_0x9857('0x1e'))?this[_0x9857('0x10')](_0x9857('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9857('0x4')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':0x0,'set':function(_0x1acfe7){this['setDataValue'](_0x9857('0x20'),_0x1acfe7);if(_0x1acfe7){if(this['getDataValue'](_0x9857('0x21'))<0x2){this[_0x9857('0xe')](_0x9857('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x9857('0x13'),_0x9857('0x15'),_0x9857('0x14'),_0x9857('0x12')),'defaultValue':'progressive','comment':_0x9857('0x22')},'dialLimitChannel':{'type':Sequelize[_0x9857('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x9857('0x16')](0x4)[_0x9857('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9857('0x24')},'dialPowerLevel':{'type':Sequelize[_0x9857('0x25')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9857('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x9857('0x1')]('agentBusyFactor','dropRate'),'defaultValue':_0x9857('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9857('0x25')](0x2)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9857('0x28')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9857('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9857('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9857('0x2b'),'comment':_0x9857('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x2d')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x9857('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'comment':_0x9857('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9857('0x34')},'dialTimezone':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9857('0x4')],'defaultValue':_0x9857('0x35')},'dialPrefix':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9857('0x36'),_0x9857('0x37'),_0x9857('0x38')),'defaultValue':_0x9857('0x36')},'dialAMDActive':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':0x0,'comment':_0x9857('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x9857('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9857('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9857('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9857('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9857('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9857('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9857('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9857('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9857('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9857('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x42'),_0x9857('0x43')),'defaultValue':_0x9857('0x42')},'dialQueueProject2':{'type':Sequelize[_0x9857('0x4')],'comment':_0x9857('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9857('0x44')},'dialCutDigit':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9857('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9857('0x16')],'allowNull':!![],'comment':_0x9857('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x948f9){if(!_0x948f9)this[_0x9857('0xe')](_0x9857('0x50'),null);this[_0x9857('0xe')]('mandatoryDisposition',_0x948f9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index f8d9543..dede28b 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 _0x07d7=['stack','send','index','VoiceQueue','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','params','length','find','body','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','userProfileId','getHoppers','CmHopper','hasOwnProperty','VoiceQueueId','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','isNil','interface','format','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','online','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','spread','dialCheckDuplicateType','always','cm_hopper','scheduledAt','ContactId','ListId','phone','CmListId','updatedAt','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','insert','into','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','fromQuery','OrderBy','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error'];(function(_0x33505b,_0x1517b6){var _0x89a416=function(_0x84db75){while(--_0x84db75){_0x33505b['push'](_0x33505b['shift']());}};_0x89a416(++_0x1517b6);}(_0x07d7,0x85));var _0x707d=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x07d7[_0x725b8e];return _0x43ac45;};'use strict';var emlformat=require(_0x707d('0x0'));var rimraf=require(_0x707d('0x1'));var zipdir=require(_0x707d('0x2'));var jsonpatch=require(_0x707d('0x3'));var rp=require(_0x707d('0x4'));var moment=require(_0x707d('0x5'));var BPromise=require(_0x707d('0x6'));var Mustache=require(_0x707d('0x7'));var util=require(_0x707d('0x8'));var path=require(_0x707d('0x9'));var sox=require(_0x707d('0xa'));var csv=require(_0x707d('0xb'));var ejs=require(_0x707d('0xc'));var fs=require('fs');var fs_extra=require(_0x707d('0xd'));var _=require(_0x707d('0xe'));var squel=require(_0x707d('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x707d('0x10'));var toCsv=require(_0x707d('0xb'));var querystring=require(_0x707d('0x11'));var Papa=require(_0x707d('0x12'));var Redis=require(_0x707d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x707d('0x14'));var as=require(_0x707d('0x15'));var hardwareService=require(_0x707d('0x16'));var logger=require('../../config/logger')(_0x707d('0x17'));var utils=require(_0x707d('0x18'));var config=require(_0x707d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x707d('0x1a')](config[_0x707d('0x1b')],{'host':_0x707d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x707d('0x1b')]));require('./voiceQueue.socket')[_0x707d('0x1d')](socket);function respondWithStatusCode(_0x42e27f,_0x509ec8){_0x509ec8=_0x509ec8||0xcc;return function(_0x4d598e){if(_0x4d598e){return _0x42e27f[_0x707d('0x1e')](_0x509ec8);}return _0x42e27f['status'](_0x509ec8)[_0x707d('0x1f')]();};}function respondWithResult(_0x2c63c9,_0xeed67d){_0xeed67d=_0xeed67d||0xc8;return function(_0x1f4f0e){if(_0x1f4f0e){return _0x2c63c9[_0x707d('0x20')](_0xeed67d)[_0x707d('0x21')](_0x1f4f0e);}};}function respondWithFilteredResult(_0x318251,_0x50869d){return function(_0x1d3fe6){if(_0x1d3fe6){var _0x275a7b=typeof _0x50869d[_0x707d('0x22')]==='undefined'&&typeof _0x50869d[_0x707d('0x23')]===_0x707d('0x24');var _0xf5375f=_0x1d3fe6[_0x707d('0x25')];var _0x81f93f=_0x275a7b?0x0:_0x50869d[_0x707d('0x22')];var _0xb7171a=_0x275a7b?_0x1d3fe6[_0x707d('0x25')]:_0x50869d[_0x707d('0x22')]+_0x50869d[_0x707d('0x23')];var _0x2da0c0;if(_0xb7171a>=_0xf5375f){_0xb7171a=_0xf5375f;_0x2da0c0=0xc8;}else{_0x2da0c0=0xce;}_0x318251[_0x707d('0x20')](_0x2da0c0);return _0x318251[_0x707d('0x26')](_0x707d('0x27'),_0x81f93f+'-'+_0xb7171a+'/'+_0xf5375f)[_0x707d('0x21')](_0x1d3fe6);}return null;};}function patchUpdates(_0x30d175){return function(_0x1ce813){try{jsonpatch['apply'](_0x1ce813,_0x30d175,!![]);}catch(_0x24ba23){return BPromise['reject'](_0x24ba23);}return _0x1ce813[_0x707d('0x28')]();};}function saveUpdates(_0x139ad5,_0x8810fe){return function(_0x1a5e03){if(_0x1a5e03){return _0x1a5e03[_0x707d('0x29')](_0x139ad5)['then'](function(_0x115e5c){return _0x115e5c;});}return null;};}function removeEntity(_0x5b2db7,_0x3760bb){return function(_0x26741e){if(_0x26741e){return _0x26741e[_0x707d('0x2a')]()[_0x707d('0x2b')](function(){var _0x40551d=_0x26741e[_0x707d('0x2c')]({'plain':!![]});var _0x38b4fe=[{'name':_0x707d('0x2d'),'value':_0x707d('0x2e'),'ignore':![]},{'name':_0x707d('0x2f'),'value':_0x707d('0x30'),'ignore':![]}];var _0x4274e9=_(_0x38b4fe)[_0x707d('0x31')](_0x707d('0x32'))[_0x707d('0x33')](_0x707d('0x34'))['value']();if(_[_0x707d('0x35')](_0x4274e9,_0x40551d[_0x707d('0x36')])){return;}var _0x1784ce=_['find'](_0x38b4fe,['value',_0x40551d['type']])[_0x707d('0x37')];return db[_0x707d('0x38')][_0x707d('0x2a')]({'where':{'type':_0x1784ce,'resourceId':_0x40551d['id']}})[_0x707d('0x2b')](function(){return _0x26741e;});})[_0x707d('0x2b')](function(){_0x5b2db7[_0x707d('0x20')](0xcc)[_0x707d('0x1f')]();});}};}function handleEntityNotFound(_0x3734be,_0xd310cc){return function(_0x43ec7a){if(!_0x43ec7a){_0x3734be[_0x707d('0x1e')](0x194);}return _0x43ec7a;};}function handleError(_0x455841,_0x54a0f3){_0x54a0f3=_0x54a0f3||0x1f4;return function(_0x39bb5f){logger[_0x707d('0x39')](_0x39bb5f[_0x707d('0x3a')]);if(_0x39bb5f[_0x707d('0x37')]){delete _0x39bb5f[_0x707d('0x37')];}_0x455841['status'](_0x54a0f3)[_0x707d('0x3b')](_0x39bb5f);};}exports[_0x707d('0x3c')]=function(_0x4d2051,_0x325bd9){var _0x260b2={},_0x299460={},_0x425e2e={'count':0x0,'rows':[]};var _0x247aa8=_[_0x707d('0x33')](db[_0x707d('0x3d')][_0x707d('0x3e')],function(_0x19e6a7){return{'name':_0x19e6a7['fieldName'],'type':_0x19e6a7[_0x707d('0x36')][_0x707d('0x3f')]};});_0x299460[_0x707d('0x40')]=_[_0x707d('0x33')](_0x247aa8,_0x707d('0x37'));_0x299460['query']=_[_0x707d('0x41')](_0x4d2051[_0x707d('0x42')]);_0x299460[_0x707d('0x43')]=_['intersection'](_0x299460[_0x707d('0x40')],_0x299460['query']);_0x260b2[_0x707d('0x44')]=_[_0x707d('0x45')](_0x299460[_0x707d('0x40')],qs[_0x707d('0x46')](_0x4d2051['query']['fields']));_0x260b2[_0x707d('0x44')]=_0x260b2[_0x707d('0x44')]['length']?_0x260b2['attributes']:_0x299460[_0x707d('0x40')];if(!_0x4d2051['query']['hasOwnProperty'](_0x707d('0x47'))){_0x260b2[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x4d2051[_0x707d('0x42')][_0x707d('0x23')]);_0x260b2['offset']=qs[_0x707d('0x22')](_0x4d2051[_0x707d('0x42')][_0x707d('0x22')]);}_0x260b2[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x4d2051[_0x707d('0x42')][_0x707d('0x49')]);_0x260b2[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x4d2051[_0x707d('0x42')],_0x299460['filters']),_0x247aa8);if(_0x4d2051[_0x707d('0x42')][_0x707d('0x31')]){_0x260b2['where']=_[_0x707d('0x4c')](_0x260b2[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x247aa8,function(_0x8183a9){if(_0x8183a9[_0x707d('0x36')]!=='VIRTUAL'){var _0x1f90af={};_0x1f90af[_0x8183a9[_0x707d('0x37')]]={'$like':'%'+_0x4d2051[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x1f90af;}})});}_0x260b2=_[_0x707d('0x4c')]({},_0x260b2,_0x4d2051[_0x707d('0x4d')]);var _0x93aacd={'where':_0x260b2[_0x707d('0x4a')]};return db[_0x707d('0x3d')]['count'](_0x93aacd)[_0x707d('0x2b')](function(_0x59b928){_0x425e2e[_0x707d('0x25')]=_0x59b928;if(_0x4d2051[_0x707d('0x42')][_0x707d('0x4e')]){_0x260b2[_0x707d('0x4f')]=[{'all':!![]}];}return db[_0x707d('0x3d')][_0x707d('0x50')](_0x260b2);})[_0x707d('0x2b')](function(_0x8bf45a){_0x425e2e['rows']=_0x8bf45a;return _0x425e2e;})[_0x707d('0x2b')](respondWithFilteredResult(_0x325bd9,_0x260b2))[_0x707d('0x51')](handleError(_0x325bd9,null));};exports[_0x707d('0x52')]=function(_0x3f9c77,_0xe5c80b){var _0x225dde={'raw':![],'where':{'id':_0x3f9c77[_0x707d('0x53')]['id']}},_0x5d6590={};_0x5d6590[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x3d')][_0x707d('0x3e')]);_0x5d6590[_0x707d('0x42')]=_['keys'](_0x3f9c77['query']);_0x5d6590[_0x707d('0x43')]=_[_0x707d('0x45')](_0x5d6590['model'],_0x5d6590[_0x707d('0x42')]);_0x225dde[_0x707d('0x44')]=_[_0x707d('0x45')](_0x5d6590[_0x707d('0x40')],qs['fields'](_0x3f9c77[_0x707d('0x42')][_0x707d('0x46')]));_0x225dde[_0x707d('0x44')]=_0x225dde['attributes'][_0x707d('0x54')]?_0x225dde[_0x707d('0x44')]:_0x5d6590['model'];if(_0x3f9c77[_0x707d('0x42')]['includeAll']){_0x225dde['include']=[{'all':!![]}];}_0x225dde=_['merge']({},_0x225dde,_0x3f9c77[_0x707d('0x4d')]);return db[_0x707d('0x3d')][_0x707d('0x55')](_0x225dde)[_0x707d('0x2b')](handleEntityNotFound(_0xe5c80b,null))[_0x707d('0x2b')](respondWithResult(_0xe5c80b,null))[_0x707d('0x51')](handleError(_0xe5c80b,null));};exports['create']=function(_0x439281,_0x2f4627){return db['VoiceQueue']['create'](_0x439281[_0x707d('0x56')],{})['then'](function(_0x17c0df){var _0x1582e4=_0x439281['user'][_0x707d('0x2c')]({'plain':!![]});if(!_0x1582e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1582e4[_0x707d('0x57')]===_0x707d('0x58')){var _0x1c540c=_0x17c0df[_0x707d('0x2c')]({'plain':!![]});var _0x32fd36=[{'name':'VoiceQueues','value':_0x707d('0x2e')},{'name':_0x707d('0x2f'),'value':_0x707d('0x30')}];var _0x4f7081=_[_0x707d('0x55')](_0x32fd36,['value',_0x1c540c[_0x707d('0x36')]])[_0x707d('0x37')];return db[_0x707d('0x59')]['find']({'where':{'name':_0x4f7081,'userProfileId':_0x1582e4['userProfileId']},'raw':!![]})[_0x707d('0x2b')](function(_0x211c37){if(_0x211c37&&_0x211c37[_0x707d('0x5a')]===0x0){return db[_0x707d('0x38')][_0x707d('0x5b')]({'name':_0x1c540c[_0x707d('0x37')],'resourceId':_0x1c540c['id'],'type':_0x211c37[_0x707d('0x37')],'sectionId':_0x211c37['id']},{})[_0x707d('0x2b')](function(){return _0x17c0df;});}else{return _0x17c0df;}})['catch'](function(_0x475dbc){logger[_0x707d('0x39')](_0x707d('0x5c'),_0x475dbc);throw _0x475dbc;});}return _0x17c0df;})[_0x707d('0x2b')](respondWithResult(_0x2f4627,0xc9))[_0x707d('0x51')](handleError(_0x2f4627,null));};exports[_0x707d('0x5d')]=function(_0x20ed5f,_0x20c101){var _0x1b8b5a={'where':{'id':_0x20ed5f[_0x707d('0x53')]['id']}},_0x90c5c4={};_0x90c5c4[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x3d')][_0x707d('0x3e')]);_0x1b8b5a[_0x707d('0x44')]=_['intersection'](_0x90c5c4[_0x707d('0x40')],qs[_0x707d('0x46')](_0x20ed5f[_0x707d('0x42')][_0x707d('0x46')]));_0x1b8b5a[_0x707d('0x44')]=_0x1b8b5a['attributes'][_0x707d('0x54')]?_0x1b8b5a[_0x707d('0x44')]:_0x90c5c4[_0x707d('0x40')];if(_0x20ed5f[_0x707d('0x42')][_0x707d('0x4e')]){_0x1b8b5a[_0x707d('0x4f')]=[{'all':!![]}];}_0x1b8b5a=_[_0x707d('0x4c')]({},_0x1b8b5a,_0x20ed5f['options']);return db[_0x707d('0x3d')]['find'](_0x1b8b5a)[_0x707d('0x2b')](handleEntityNotFound(_0x20c101,null))[_0x707d('0x2b')](function(_0x4aaaff){if(_0x4aaaff){var _0x2f8869=_0x4aaaff[_0x707d('0x2c')]({'plain':!![]});_0x2f8869=qs[_0x707d('0x5e')](_0x2f8869,['id',_0x707d('0x5f'),'updatedAt']);_0x20ed5f[_0x707d('0x56')]=_[_0x707d('0x5e')](_0x20ed5f[_0x707d('0x56')],['id',_0x707d('0x5f'),'updatedAt']);return db[_0x707d('0x3d')]['create'](_[_0x707d('0x4c')](_0x2f8869,_0x20ed5f['body']),{'include':_0x20ed5f[_0x707d('0x42')][_0x707d('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x278483){var _0x592953=_0x20ed5f[_0x707d('0x58')][_0x707d('0x2c')]({'plain':!![]});if(!_0x592953)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x592953[_0x707d('0x57')]===_0x707d('0x58')){var _0x4ab11d=_0x278483[_0x707d('0x2c')]({'plain':!![]});var _0x4eba16=[{'name':_0x707d('0x2d'),'value':_0x707d('0x2e')},{'name':_0x707d('0x2f'),'value':_0x707d('0x30')}];var _0x30b5cb=_[_0x707d('0x55')](_0x4eba16,[_0x707d('0x34'),_0x4ab11d[_0x707d('0x36')]])[_0x707d('0x37')];return db[_0x707d('0x59')][_0x707d('0x55')]({'where':{'name':_0x30b5cb,'userProfileId':_0x592953[_0x707d('0x60')]},'raw':!![]})[_0x707d('0x2b')](function(_0x5ea54f){if(_0x5ea54f&&_0x5ea54f['autoAssociation']===0x0){return db[_0x707d('0x38')]['create']({'name':_0x4ab11d[_0x707d('0x37')],'resourceId':_0x4ab11d['id'],'type':_0x5ea54f[_0x707d('0x37')],'sectionId':_0x5ea54f['id']},{})[_0x707d('0x2b')](function(){return _0x278483;});}else{return _0x278483;}})[_0x707d('0x51')](function(_0xfbe3c0){logger[_0x707d('0x39')](_0x707d('0x5c'),_0xfbe3c0);throw _0xfbe3c0;});}return _0x278483;});}})['then'](respondWithResult(_0x20c101,0xc9))['catch'](handleError(_0x20c101,null));};exports['update']=function(_0x7d7fac,_0x5179eb){if(_0x7d7fac[_0x707d('0x56')]['id']){delete _0x7d7fac[_0x707d('0x56')]['id'];}return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x7d7fac[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x5179eb,null))[_0x707d('0x2b')](saveUpdates(_0x7d7fac[_0x707d('0x56')],null))[_0x707d('0x2b')](respondWithResult(_0x5179eb,null))[_0x707d('0x51')](handleError(_0x5179eb,null));};exports[_0x707d('0x2a')]=function(_0x2c4f59,_0x1ff192){return db['VoiceQueue']['find']({'where':{'id':_0x2c4f59[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x1ff192,null))[_0x707d('0x2b')](removeEntity(_0x1ff192,null))[_0x707d('0x51')](handleError(_0x1ff192,null));};exports[_0x707d('0x61')]=function(_0x1c2dcf,_0x4a8fbb,_0xf71ac){var _0x5a15aa={'raw':![],'where':{}};var _0x4d2578={};var _0x424a6e={'count':0x0,'rows':[]};return db[_0x707d('0x3d')]['findOne']({'where':{'id':_0x1c2dcf[_0x707d('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a8fbb,null))['then'](function(_0x11d410){if(_0x11d410){_0x4d2578[_0x707d('0x40')]=_['keys'](db[_0x707d('0x62')][_0x707d('0x3e')]);_0x4d2578[_0x707d('0x42')]=_[_0x707d('0x41')](_0x1c2dcf['query']);_0x4d2578[_0x707d('0x43')]=_[_0x707d('0x45')](_0x4d2578[_0x707d('0x40')],_0x4d2578['query']);_0x5a15aa[_0x707d('0x44')]=_['intersection'](_0x4d2578[_0x707d('0x40')],qs[_0x707d('0x46')](_0x1c2dcf['query'][_0x707d('0x46')]));_0x5a15aa[_0x707d('0x44')]=_0x5a15aa['attributes'][_0x707d('0x54')]?_0x5a15aa[_0x707d('0x44')]:_0x4d2578[_0x707d('0x40')];if(!_0x1c2dcf[_0x707d('0x42')][_0x707d('0x63')]('nolimit')){_0x5a15aa['limit']=qs['limit'](_0x1c2dcf['query']['limit']);_0x5a15aa[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x1c2dcf[_0x707d('0x42')][_0x707d('0x22')]);}_0x5a15aa[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x1c2dcf[_0x707d('0x42')][_0x707d('0x49')]);_0x5a15aa['where']=qs[_0x707d('0x43')](_['pick'](_0x1c2dcf[_0x707d('0x42')],_0x4d2578[_0x707d('0x43')]));_0x5a15aa[_0x707d('0x4a')][_0x707d('0x64')]=_0x11d410['id'];if(_0x1c2dcf[_0x707d('0x42')]['filter']){_0x5a15aa[_0x707d('0x4a')]=_['merge'](_0x5a15aa[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x5a15aa[_0x707d('0x44')],function(_0x2ec5c4){var _0x36c591={};_0x36c591[_0x2ec5c4]={'$like':'%'+_0x1c2dcf[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x36c591;})});}_0x5a15aa=_[_0x707d('0x4c')]({},_0x5a15aa,_0x1c2dcf[_0x707d('0x4d')]);return db['CmHopper'][_0x707d('0x25')]({'where':_0x5a15aa[_0x707d('0x4a')]})['then'](function(_0xa301b3){_0x424a6e[_0x707d('0x25')]=_0xa301b3;if(_0x1c2dcf['query'][_0x707d('0x4e')]){_0x5a15aa[_0x707d('0x4f')]=[{'all':!![]}];}return db[_0x707d('0x62')][_0x707d('0x50')](_0x5a15aa);})['then'](function(_0x206003){_0x424a6e[_0x707d('0x65')]=_0x206003;return _0x424a6e;});}})[_0x707d('0x2b')](respondWithFilteredResult(_0x4a8fbb,_0x5a15aa))['catch'](handleError(_0x4a8fbb,null));};exports[_0x707d('0x66')]=function(_0x6363bd,_0x12f8ec,_0x2c4940){var _0x30023b={'raw':!![],'where':{}};var _0x34ba29={};var _0x580c83={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x707d('0x67')]({'where':{'id':_0x6363bd[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x12f8ec,null))[_0x707d('0x2b')](function(_0x160907){if(_0x160907){_0x34ba29[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x68')]['rawAttributes']);_0x34ba29[_0x707d('0x42')]=_[_0x707d('0x41')](_0x6363bd[_0x707d('0x42')]);_0x34ba29[_0x707d('0x43')]=_[_0x707d('0x45')](_0x34ba29[_0x707d('0x40')],_0x34ba29['query']);_0x30023b['attributes']=_[_0x707d('0x45')](_0x34ba29['model'],qs[_0x707d('0x46')](_0x6363bd[_0x707d('0x42')][_0x707d('0x46')]));_0x30023b[_0x707d('0x44')]=_0x30023b[_0x707d('0x44')][_0x707d('0x54')]?_0x30023b['attributes']:_0x34ba29[_0x707d('0x40')];if(!_0x6363bd[_0x707d('0x42')][_0x707d('0x63')](_0x707d('0x47'))){_0x30023b[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x6363bd[_0x707d('0x42')][_0x707d('0x23')]);_0x30023b[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x6363bd[_0x707d('0x42')][_0x707d('0x22')]);}_0x30023b[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x6363bd[_0x707d('0x42')][_0x707d('0x49')]);_0x30023b[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x6363bd[_0x707d('0x42')],_0x34ba29['filters']));_0x30023b[_0x707d('0x4a')][_0x707d('0x64')]=_0x160907['id'];if(_0x6363bd[_0x707d('0x42')][_0x707d('0x31')]){_0x30023b['where']=_[_0x707d('0x4c')](_0x30023b[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x30023b[_0x707d('0x44')],function(_0x5c7049){var _0x3eb4c7={};_0x3eb4c7[_0x5c7049]={'$like':'%'+_0x6363bd['query'][_0x707d('0x31')]+'%'};return _0x3eb4c7;})});}_0x30023b=_[_0x707d('0x4c')]({},_0x30023b,_0x6363bd[_0x707d('0x4d')]);return db[_0x707d('0x68')][_0x707d('0x25')]({'where':_0x30023b['where']})[_0x707d('0x2b')](function(_0x49704f){_0x580c83[_0x707d('0x25')]=_0x49704f;if(_0x6363bd[_0x707d('0x42')][_0x707d('0x4e')]){_0x30023b['include']=[{'all':!![]}];}return db[_0x707d('0x68')][_0x707d('0x50')](_0x30023b);})['then'](function(_0x4ee0d0){_0x580c83[_0x707d('0x65')]=_0x4ee0d0;return _0x580c83;});}})[_0x707d('0x2b')](respondWithFilteredResult(_0x12f8ec,_0x30023b))[_0x707d('0x51')](handleError(_0x12f8ec,null));};exports[_0x707d('0x69')]=function(_0x18c641,_0xce0ddb,_0x54190e){var _0x22d3e4={'raw':!![],'where':{}};var _0x456e77={};var _0xb15220={'count':0x0,'rows':[]};return db[_0x707d('0x3d')]['findOne']({'where':{'id':_0x18c641[_0x707d('0x53')]['id']}})['then'](handleEntityNotFound(_0xce0ddb,null))[_0x707d('0x2b')](function(_0x3c5621){if(_0x3c5621){_0x456e77['model']=_[_0x707d('0x41')](db[_0x707d('0x6a')][_0x707d('0x3e')]);_0x456e77[_0x707d('0x42')]=_[_0x707d('0x41')](_0x18c641['query']);_0x456e77[_0x707d('0x43')]=_[_0x707d('0x45')](_0x456e77['model'],_0x456e77[_0x707d('0x42')]);_0x22d3e4[_0x707d('0x44')]=_[_0x707d('0x45')](_0x456e77[_0x707d('0x40')],qs['fields'](_0x18c641['query'][_0x707d('0x46')]));_0x22d3e4[_0x707d('0x44')]=_0x22d3e4[_0x707d('0x44')]['length']?_0x22d3e4[_0x707d('0x44')]:_0x456e77[_0x707d('0x40')];if(!_0x18c641['query']['hasOwnProperty'](_0x707d('0x47'))){_0x22d3e4[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x18c641[_0x707d('0x42')][_0x707d('0x23')]);_0x22d3e4[_0x707d('0x22')]=qs['offset'](_0x18c641[_0x707d('0x42')][_0x707d('0x22')]);}_0x22d3e4[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x18c641[_0x707d('0x42')][_0x707d('0x49')]);_0x22d3e4['where']=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x18c641['query'],_0x456e77[_0x707d('0x43')]));_0x22d3e4[_0x707d('0x4a')][_0x707d('0x64')]=_0x3c5621['id'];if(_0x18c641['query']['filter']){_0x22d3e4[_0x707d('0x4a')]=_[_0x707d('0x4c')](_0x22d3e4[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x22d3e4[_0x707d('0x44')],function(_0x1e9db1){var _0x3d7a57={};_0x3d7a57[_0x1e9db1]={'$like':'%'+_0x18c641[_0x707d('0x42')]['filter']+'%'};return _0x3d7a57;})});}_0x22d3e4=_[_0x707d('0x4c')]({},_0x22d3e4,_0x18c641[_0x707d('0x4d')]);return db[_0x707d('0x6a')][_0x707d('0x25')]({'where':_0x22d3e4[_0x707d('0x4a')]})['then'](function(_0x46685a){_0xb15220['count']=_0x46685a;if(_0x18c641[_0x707d('0x42')][_0x707d('0x4e')]){_0x22d3e4['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x707d('0x50')](_0x22d3e4);})['then'](function(_0x1c8879){_0xb15220['rows']=_0x1c8879;return _0xb15220;});}})['then'](respondWithFilteredResult(_0xce0ddb,_0x22d3e4))[_0x707d('0x51')](handleError(_0xce0ddb,null));};exports[_0x707d('0x6b')]=function(_0x2e8763,_0x40bed5,_0x1b26c9){var _0x26bbb1={'raw':!![],'where':{}};var _0x8e725={};var _0x311044={'count':0x0,'rows':[]};return db[_0x707d('0x3d')][_0x707d('0x67')]({'where':{'id':_0x2e8763[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x40bed5,null))[_0x707d('0x2b')](function(_0x35dee7){if(_0x35dee7){_0x8e725[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x6c')][_0x707d('0x3e')]);_0x8e725[_0x707d('0x42')]=_[_0x707d('0x41')](_0x2e8763['query']);_0x8e725[_0x707d('0x43')]=_[_0x707d('0x45')](_0x8e725['model'],_0x8e725[_0x707d('0x42')]);_0x26bbb1[_0x707d('0x44')]=_[_0x707d('0x45')](_0x8e725['model'],qs['fields'](_0x2e8763[_0x707d('0x42')][_0x707d('0x46')]));_0x26bbb1[_0x707d('0x44')]=_0x26bbb1[_0x707d('0x44')][_0x707d('0x54')]?_0x26bbb1['attributes']:_0x8e725['model'];if(!_0x2e8763[_0x707d('0x42')][_0x707d('0x63')](_0x707d('0x47'))){_0x26bbb1['limit']=qs[_0x707d('0x23')](_0x2e8763[_0x707d('0x42')][_0x707d('0x23')]);_0x26bbb1[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x2e8763[_0x707d('0x42')][_0x707d('0x22')]);}_0x26bbb1[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x2e8763[_0x707d('0x42')]['sort']);_0x26bbb1[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x2e8763[_0x707d('0x42')],_0x8e725['filters']));_0x26bbb1[_0x707d('0x4a')]['VoiceQueueId']=_0x35dee7['id'];if(_0x2e8763[_0x707d('0x42')][_0x707d('0x31')]){_0x26bbb1['where']=_[_0x707d('0x4c')](_0x26bbb1['where'],{'$or':_[_0x707d('0x33')](_0x26bbb1['attributes'],function(_0x52fe2e){var _0x54ad2c={};_0x54ad2c[_0x52fe2e]={'$like':'%'+_0x2e8763['query'][_0x707d('0x31')]+'%'};return _0x54ad2c;})});}_0x26bbb1=_['merge']({},_0x26bbb1,_0x2e8763[_0x707d('0x4d')]);return db[_0x707d('0x6c')][_0x707d('0x25')]({'where':_0x26bbb1[_0x707d('0x4a')]})[_0x707d('0x2b')](function(_0xbeba07){_0x311044['count']=_0xbeba07;if(_0x2e8763[_0x707d('0x42')][_0x707d('0x4e')]){_0x26bbb1['include']=[{'all':!![]}];}return db[_0x707d('0x6c')][_0x707d('0x50')](_0x26bbb1);})[_0x707d('0x2b')](function(_0xdaabd1){_0x311044[_0x707d('0x65')]=_0xdaabd1;return _0x311044;});}})[_0x707d('0x2b')](respondWithFilteredResult(_0x40bed5,_0x26bbb1))[_0x707d('0x51')](handleError(_0x40bed5,null));};exports[_0x707d('0x6d')]=function(_0x53cf9a,_0x140685,_0x27ebf0){var _0x589ba7={};var _0x4f20da={};var _0x214517;var _0x5121f9;return db[_0x707d('0x3d')][_0x707d('0x67')]({'where':{'id':_0x53cf9a['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x140685,null))[_0x707d('0x2b')](function(_0x3f0cb0){if(_0x3f0cb0){_0x214517=_0x3f0cb0;_0x4f20da[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x6e')][_0x707d('0x3e')]);_0x4f20da[_0x707d('0x42')]=_[_0x707d('0x41')](_0x53cf9a[_0x707d('0x42')]);_0x4f20da[_0x707d('0x43')]=_[_0x707d('0x45')](_0x4f20da['model'],_0x4f20da[_0x707d('0x42')]);_0x589ba7[_0x707d('0x44')]=_[_0x707d('0x45')](_0x4f20da[_0x707d('0x40')],qs[_0x707d('0x46')](_0x53cf9a[_0x707d('0x42')][_0x707d('0x46')]));_0x589ba7[_0x707d('0x44')]=_0x589ba7[_0x707d('0x44')][_0x707d('0x54')]?_0x589ba7['attributes']:_0x4f20da[_0x707d('0x40')];_0x589ba7[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x53cf9a[_0x707d('0x42')][_0x707d('0x49')]);_0x589ba7[_0x707d('0x4a')]=qs[_0x707d('0x43')](_['pick'](_0x53cf9a[_0x707d('0x42')],_0x4f20da[_0x707d('0x43')]));if(_0x53cf9a['query'][_0x707d('0x31')]){_0x589ba7[_0x707d('0x4a')]=_[_0x707d('0x4c')](_0x589ba7['where'],{'$or':_['map'](_0x589ba7[_0x707d('0x44')],function(_0x27251d){var _0x4952cb={};_0x4952cb[_0x27251d]={'$like':'%'+_0x53cf9a[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x4952cb;})});}_0x589ba7=_['merge']({},_0x589ba7,_0x53cf9a[_0x707d('0x4d')]);return _0x214517[_0x707d('0x6d')](_0x589ba7);}})[_0x707d('0x2b')](function(_0x327304){if(_0x327304){_0x5121f9=_0x327304['length'];if(!_0x53cf9a[_0x707d('0x42')][_0x707d('0x63')](_0x707d('0x47'))){_0x589ba7[_0x707d('0x23')]=qs['limit'](_0x53cf9a[_0x707d('0x42')][_0x707d('0x23')]);_0x589ba7[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x53cf9a[_0x707d('0x42')][_0x707d('0x22')]);}return _0x214517[_0x707d('0x6d')](_0x589ba7);}})[_0x707d('0x2b')](function(_0x530c48){if(_0x530c48){return _0x530c48?{'count':_0x5121f9,'rows':_0x530c48}:null;}})[_0x707d('0x2b')](respondWithResult(_0x140685,null))[_0x707d('0x51')](handleError(_0x140685,null));};exports['addTeams']=function(_0x55eab1,_0x474d48,_0x1993a8){var _0x3c76cb=_0x55eab1['body'][_0x707d('0x6f')];var _0x31c711=_[_0x707d('0x33')](_0x3c76cb,'id');return db[_0x707d('0x6e')]['findAll']({'where':{'id':_0x31c711},'attributes':['id'],'include':[{'model':db[_0x707d('0x70')],'as':'Agents','attributes':['id',_0x707d('0x37'),'online','voicePause','interface'],'raw':!![]}]})[_0x707d('0x2b')](function(_0x515704){if(_0x515704){var _0x37a4ab=_['flatMap'](_0x515704,function(_0x51e554){var _0x162e7a=_0x51e554[_0x707d('0x2c')]({'plain':!![]});_0x162e7a[_0x707d('0x71')]['forEach'](function(_0x4bfb92){_0x4bfb92[_0x707d('0x72')]=_[_0x707d('0x55')](_0x3c76cb,{'id':_0x162e7a['id']})[_0x707d('0x72')];});return _0x162e7a[_0x707d('0x71')];});return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x55eab1[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(_0x5cb102){return db[_0x707d('0x73')][_0x707d('0x74')](function(_0x26b528){return _0x5cb102['addTeams'](_0x31c711,{'transaction':_0x26b528})[_0x707d('0x2b')](function(){return BPromise['each'](_0x3c76cb,function(_0x3ffa80){return db[_0x707d('0x75')][_0x707d('0x76')]({'TeamId':_0x3ffa80['id'],'VoiceQueueId':_0x55eab1[_0x707d('0x53')]['id'],'penalty':_0x3ffa80[_0x707d('0x72')]},{'transaction':_0x26b528});});})[_0x707d('0x2b')](function(){return BPromise[_0x707d('0x77')](_0x37a4ab,function(_0x5f4a92){return db[_0x707d('0x78')][_0x707d('0x79')]({'where':{'UserId':_0x5f4a92['id'],'VoiceQueueId':_0x55eab1[_0x707d('0x53')]['id']},'defaults':{'penalty':_0x5f4a92['penalty']},'transaction':_0x26b528});});})[_0x707d('0x2b')](function(){return BPromise[_0x707d('0x77')](_[_0x707d('0x31')](_0x37a4ab,{'online':!![]}),function(_0x5a4489){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5a4489[_0x707d('0x37')],'UserId':_0x5a4489['id'],'queue_name':_0x5cb102[_0x707d('0x37')],'VoiceQueueId':_0x5cb102['id'],'interface':_[_0x707d('0x7a')](_0x5a4489[_0x707d('0x7b')])?util[_0x707d('0x7c')]('SIP/%s',_0x5a4489[_0x707d('0x37')]):_0x5a4489[_0x707d('0x7b')],'paused':_0x5a4489[_0x707d('0x7d')]||![],'penalty':_0x5a4489[_0x707d('0x72')]},{'transaction':_0x26b528});});})['then'](function(){_0x37a4ab['forEach'](function(_0x254f7b){socket[_0x707d('0x7e')](_0x707d('0x7f'),{'UserId':_0x254f7b['id'],'VoiceQueueId':_0x5cb102['id']});});});});});}})[_0x707d('0x2b')](respondWithStatusCode(_0x474d48,null))[_0x707d('0x51')](handleError(_0x474d48,null));};exports[_0x707d('0x80')]=function(_0x31da99,_0x1e847e,_0x19ba1a){return db['Team'][_0x707d('0x50')]({'where':{'id':_0x31da99[_0x707d('0x42')][_0x707d('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x707d('0x71'),'attributes':['id'],'raw':!![]}]})[_0x707d('0x2b')](handleEntityNotFound(_0x1e847e,null))[_0x707d('0x2b')](function(_0x2f6809){var _0x245ad9=_[_0x707d('0x33')](_0x2f6809,'id');var _0x164a2c=[];var _0x59086f=[];var _0xc3733a=squel[_0x707d('0x82')]();_0xc3733a[_0x707d('0x83')](_0x707d('0x84'))[_0x707d('0x85')](_0x707d('0x86'),'tq')[_0x707d('0x87')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x707d('0x4a')](_0x707d('0x88'),_0x31da99[_0x707d('0x53')]['id']);for(var _0x37a62f=0x0;_0x37a62f<_0x2f6809['length'];_0x37a62f+=0x1){let _0x2bdb10=_0x2f6809[_0x37a62f];for(var _0x4190bc=0x0;_0x4190bc<_0x2bdb10[_0x707d('0x71')]['length'];_0x4190bc+=0x1){let _0x5c710d=_0x2bdb10[_0x707d('0x71')][_0x4190bc];var _0x4970aa=_0xc3733a[_0x707d('0x5d')]();_0x4970aa[_0x707d('0x4a')]('ut.UserId\x20=\x20?',_0x5c710d['id']);_0x59086f[_0x707d('0x89')](db[_0x707d('0x73')]['query'](_0x4970aa[_0x707d('0x8a')](),{'type':db[_0x707d('0x73')]['QueryTypes'][_0x707d('0x8b')]})['then'](function(_0x444965){if(_0x444965['length']===0x1){return _0x5c710d['id'];}else{var _0x2a41aa=_['every'](_['map'](_0x444965,_0x707d('0x8c')),function(_0x4f0e96){return _[_0x707d('0x35')](_0x245ad9,_0x4f0e96);});if(_0x2a41aa){return _0x5c710d['id'];}}}));}}return BPromise[_0x707d('0x8d')](_0x59086f)[_0x707d('0x2b')](function(_0x57601e){_0x164a2c=_(_0x164a2c)[_0x707d('0x8e')](_0x57601e)[_0x707d('0x8f')]()[_0x707d('0x34')]();return db['VoiceQueue']['find']({'where':{'id':_0x31da99[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(_0x360c80){return db[_0x707d('0x73')][_0x707d('0x74')](function(_0x4eff7f){return _0x360c80[_0x707d('0x80')](_0x31da99['query']['ids'],{'transaction':_0x4eff7f})['then'](function(){if(!_[_0x707d('0x90')](_0x164a2c)){return _0x360c80[_0x707d('0x91')](_0x164a2c,{'transaction':_0x4eff7f})[_0x707d('0x2b')](function(){return db[_0x707d('0x92')]['destroy']({'where':{'VoiceQueueId':_0x31da99[_0x707d('0x53')]['id'],'UserId':_0x164a2c},'transaction':_0x4eff7f});});}})[_0x707d('0x2b')](function(){_0x164a2c['forEach'](function(_0x3083d4){socket[_0x707d('0x7e')](_0x707d('0x93'),{'UserId':_0x3083d4,'VoiceQueueId':_0x360c80['id']});});});});});});})[_0x707d('0x2b')](respondWithStatusCode(_0x1e847e,null))['catch'](handleError(_0x1e847e,null));};exports[_0x707d('0x94')]=function(_0x2d0faf,_0x54f6dd,_0x1237f5){var _0x1c7e8c,_0x164f8c;return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x2d0faf[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x54f6dd,null))[_0x707d('0x2b')](function(_0x13c988){if(_0x13c988){_0x164f8c=_0x13c988;return _0x13c988['addAgents'](_0x2d0faf[_0x707d('0x56')]['ids'],_[_0x707d('0x5e')](_0x2d0faf['body'],[_0x707d('0x81'),'id'])||{})['spread'](function(_0x4da240){for(var _0x3dd8b8=0x0;_0x3dd8b8<_0x2d0faf[_0x707d('0x56')][_0x707d('0x81')][_0x707d('0x54')];_0x3dd8b8+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x2d0faf[_0x707d('0x56')][_0x707d('0x81')][_0x3dd8b8]),'VoiceQueueId':Number(_0x2d0faf['params']['id'])});}return _0x4da240;});}})[_0x707d('0x2b')](function(_0x2134c6){_0x1c7e8c=_0x2134c6||[];if(_0x164f8c){return db[_0x707d('0x70')]['findAll']({'where':{'id':_0x2d0faf['body'][_0x707d('0x81')]},'attributes':['id',_0x707d('0x37'),_0x707d('0x95'),'voicePause',_0x707d('0x7b')],'raw':!![]});}})['then'](function(_0x174451){if(!_[_0x707d('0x90')](_0x174451)){var _0x378539=[];for(var _0x2fe9c8=0x0;_0x2fe9c8<_0x174451[_0x707d('0x54')];_0x2fe9c8++){if(_0x174451[_0x2fe9c8][_0x707d('0x95')]){_0x378539['push'](db[_0x707d('0x92')][_0x707d('0x76')]({'membername':_0x174451[_0x2fe9c8][_0x707d('0x37')],'UserId':_0x174451[_0x2fe9c8]['id'],'queue_name':_0x164f8c[_0x707d('0x37')],'VoiceQueueId':_0x164f8c['id'],'interface':_[_0x707d('0x7a')](_0x174451[_0x2fe9c8][_0x707d('0x7b')])?util['format'](_0x707d('0x96'),_0x174451[_0x2fe9c8][_0x707d('0x37')]):_0x174451[_0x2fe9c8][_0x707d('0x7b')],'paused':_0x174451[_0x2fe9c8]['voicePause']||![],'penalty':_0x2d0faf['body'][_0x707d('0x72')]||0x0}));}}return BPromise[_0x707d('0x8d')](_0x378539);}})[_0x707d('0x2b')](function(){return _0x1c7e8c;})[_0x707d('0x2b')](respondWithResult(_0x54f6dd,null))[_0x707d('0x51')](handleError(_0x54f6dd,null));};exports['removeAgents']=function(_0x257edb,_0x1b0edb,_0x3903cd){return db[_0x707d('0x3d')]['find']({'where':{'id':_0x257edb[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x1b0edb,null))['then'](function(_0x39de42){if(_0x39de42){return _0x39de42[_0x707d('0x91')](_0x257edb[_0x707d('0x42')][_0x707d('0x81')])[_0x707d('0x2b')](function(){if(_[_0x707d('0x97')](_0x257edb['query'][_0x707d('0x81')])){for(var _0x17c223=0x0;_0x17c223<_0x257edb['query'][_0x707d('0x81')][_0x707d('0x54')];_0x17c223+=0x1){socket[_0x707d('0x7e')](_0x707d('0x93'),{'UserId':Number(_0x257edb[_0x707d('0x42')][_0x707d('0x81')][_0x17c223]),'VoiceQueueId':Number(_0x257edb[_0x707d('0x53')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x257edb[_0x707d('0x42')][_0x707d('0x81')]),'VoiceQueueId':Number(_0x257edb[_0x707d('0x53')]['id'])});}});}})[_0x707d('0x2b')](function(_0x1a6179){return db[_0x707d('0x92')]['destroy']({'where':{'VoiceQueueId':_0x257edb['params']['id'],'UserId':_0x257edb['query'][_0x707d('0x81')]}})[_0x707d('0x2b')](function(){return _0x1a6179;});})['then'](respondWithStatusCode(_0x1b0edb,null))[_0x707d('0x51')](handleError(_0x1b0edb,null));};exports[_0x707d('0x98')]=function(_0x320171,_0x17e33e,_0x132d8d){var _0x4ac27c={};var _0x4ddc3f={};var _0x3ae4a1;var _0xfbf1e0;return db[_0x707d('0x3d')][_0x707d('0x67')]({'where':{'id':_0x320171['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x17e33e,null))[_0x707d('0x2b')](function(_0x3f5076){if(_0x3f5076){_0x3ae4a1=_0x3f5076;_0x4ddc3f[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x70')][_0x707d('0x3e')]);_0x4ddc3f['query']=_[_0x707d('0x41')](_0x320171['query']);_0x4ddc3f[_0x707d('0x43')]=_['intersection'](_0x4ddc3f[_0x707d('0x40')],_0x4ddc3f[_0x707d('0x42')]);_0x4ac27c[_0x707d('0x44')]=_['intersection'](_0x4ddc3f[_0x707d('0x40')],qs[_0x707d('0x46')](_0x320171['query']['fields']));_0x4ac27c[_0x707d('0x44')]=_0x4ac27c['attributes'][_0x707d('0x54')]?_0x4ac27c[_0x707d('0x44')]:_0x4ddc3f[_0x707d('0x40')];_0x4ac27c[_0x707d('0x48')]=qs['sort'](_0x320171[_0x707d('0x42')]['sort']);_0x4ac27c[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x320171['query'],_0x4ddc3f[_0x707d('0x43')]));if(_0x320171[_0x707d('0x42')]['filter']){_0x4ac27c['where']=_[_0x707d('0x4c')](_0x4ac27c[_0x707d('0x4a')],{'$or':_['map'](_0x4ac27c[_0x707d('0x44')],function(_0x4fd358){var _0x499cdf={};_0x499cdf[_0x4fd358]={'$like':'%'+_0x320171[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x499cdf;})});}_0x4ac27c=_[_0x707d('0x4c')]({},_0x4ac27c,_0x320171[_0x707d('0x4d')]);return _0x3ae4a1[_0x707d('0x98')](_0x4ac27c);}})[_0x707d('0x2b')](function(_0x1683ae){if(_0x1683ae){_0xfbf1e0=_0x1683ae['length'];if(!_0x320171['query'][_0x707d('0x63')](_0x707d('0x47'))){_0x4ac27c[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x320171[_0x707d('0x42')][_0x707d('0x23')]);_0x4ac27c[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x320171['query']['offset']);}return _0x3ae4a1[_0x707d('0x98')](_0x4ac27c);}})[_0x707d('0x2b')](function(_0x496849){if(_0x496849){return _0x496849?{'count':_0xfbf1e0,'rows':_0x496849}:null;}})['then'](respondWithResult(_0x17e33e,null))[_0x707d('0x51')](handleError(_0x17e33e,null));};exports[_0x707d('0x99')]=function(_0x2d99ea,_0x1aadbe,_0x47dd95){var _0x565467={};var _0x599fb4={};var _0xe1e062;var _0x14dcef;return db['VoiceQueue'][_0x707d('0x67')]({'where':{'id':_0x2d99ea[_0x707d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1aadbe,null))[_0x707d('0x2b')](function(_0x35e80a){if(_0x35e80a){_0xe1e062=_0x35e80a;_0x599fb4[_0x707d('0x40')]=_[_0x707d('0x41')](db['UserVoiceQueueRt']['rawAttributes']);_0x599fb4['query']=_[_0x707d('0x41')](_0x2d99ea[_0x707d('0x42')]);_0x599fb4[_0x707d('0x43')]=_['intersection'](_0x599fb4[_0x707d('0x40')],_0x599fb4[_0x707d('0x42')]);_0x565467[_0x707d('0x44')]=_[_0x707d('0x45')](_0x599fb4[_0x707d('0x40')],qs[_0x707d('0x46')](_0x2d99ea[_0x707d('0x42')][_0x707d('0x46')]));_0x565467[_0x707d('0x44')]=_0x565467[_0x707d('0x44')]['length']?_0x565467[_0x707d('0x44')]:_0x599fb4['model'];_0x565467[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x2d99ea[_0x707d('0x42')][_0x707d('0x49')]);_0x565467[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x2d99ea[_0x707d('0x42')],_0x599fb4[_0x707d('0x43')]));if(_0x2d99ea['query'][_0x707d('0x31')]){_0x565467[_0x707d('0x4a')]=_[_0x707d('0x4c')](_0x565467['where'],{'$or':_['map'](_0x565467[_0x707d('0x44')],function(_0x17f9b0){var _0x41ac21={};_0x41ac21[_0x17f9b0]={'$like':'%'+_0x2d99ea['query'][_0x707d('0x31')]+'%'};return _0x41ac21;})});}_0x565467=_[_0x707d('0x4c')]({},_0x565467,_0x2d99ea['options']);return _0xe1e062[_0x707d('0x99')](_0x565467);}})['then'](function(_0x6cbcbd){if(_0x6cbcbd){_0x14dcef=_0x6cbcbd[_0x707d('0x54')];if(!_0x2d99ea['query'][_0x707d('0x63')](_0x707d('0x47'))){_0x565467[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x2d99ea[_0x707d('0x42')]['limit']);_0x565467[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x2d99ea[_0x707d('0x42')][_0x707d('0x22')]);}return _0xe1e062[_0x707d('0x99')](_0x565467);}})[_0x707d('0x2b')](function(_0x5489ca){return _0x5489ca?{'count':_0x14dcef,'rows':_0x5489ca}:null;})[_0x707d('0x2b')](respondWithResult(_0x1aadbe,null))[_0x707d('0x51')](handleError(_0x1aadbe,null));};exports[_0x707d('0x9a')]=function(_0x5c51ea,_0x4f93de,_0x5afcc4){var _0xfe67a5={};var _0x541a7e={};var _0x391d59;var _0x3d215e;return db['VoiceQueue']['findOne']({'where':{'id':_0x5c51ea[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x4f93de,null))[_0x707d('0x2b')](function(_0xa581cf){if(_0xa581cf){_0x391d59=_0xa581cf;_0x541a7e[_0x707d('0x40')]=_['keys'](db[_0x707d('0x9b')][_0x707d('0x3e')]);_0x541a7e[_0x707d('0x42')]=_['keys'](_0x5c51ea[_0x707d('0x42')]);_0x541a7e[_0x707d('0x43')]=_[_0x707d('0x45')](_0x541a7e[_0x707d('0x40')],_0x541a7e['query']);_0xfe67a5[_0x707d('0x44')]=_[_0x707d('0x45')](_0x541a7e[_0x707d('0x40')],qs[_0x707d('0x46')](_0x5c51ea[_0x707d('0x42')][_0x707d('0x46')]));_0xfe67a5[_0x707d('0x44')]=_0xfe67a5[_0x707d('0x44')][_0x707d('0x54')]?_0xfe67a5[_0x707d('0x44')]:_0x541a7e[_0x707d('0x40')];_0xfe67a5[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x5c51ea['query'][_0x707d('0x49')]);_0xfe67a5[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x5c51ea['query'],_0x541a7e['filters']));if(_0x5c51ea[_0x707d('0x42')][_0x707d('0x31')]){_0xfe67a5[_0x707d('0x4a')]=_['merge'](_0xfe67a5[_0x707d('0x4a')],{'$or':_['map'](_0xfe67a5[_0x707d('0x44')],function(_0x280cca){var _0x20c197={};_0x20c197[_0x280cca]={'$like':'%'+_0x5c51ea['query']['filter']+'%'};return _0x20c197;})});}_0xfe67a5=_[_0x707d('0x4c')]({},_0xfe67a5,_0x5c51ea[_0x707d('0x4d')]);return _0x391d59[_0x707d('0x9a')](_0xfe67a5);}})['then'](function(_0x11971d){if(_0x11971d){_0x3d215e=_0x11971d[_0x707d('0x54')];if(!_0x5c51ea[_0x707d('0x42')][_0x707d('0x63')]('nolimit')){_0xfe67a5['limit']=qs[_0x707d('0x23')](_0x5c51ea['query']['limit']);_0xfe67a5['offset']=qs[_0x707d('0x22')](_0x5c51ea['query'][_0x707d('0x22')]);}return _0x391d59[_0x707d('0x9a')](_0xfe67a5);}})['then'](function(_0x369100){if(_0x369100){return _0x369100?{'count':_0x3d215e,'rows':_0x369100}:null;}})['then'](respondWithResult(_0x4f93de,null))[_0x707d('0x51')](handleError(_0x4f93de,null));};exports['addLists']=function(_0xcf6002,_0xe9c38e,_0x40381d){var _0x104709=moment()[_0x707d('0x7c')](_0x707d('0x9c'));var _0x5c67f5,_0x4e985c;return db[_0x707d('0x3d')]['find']({'where':{'id':_0xcf6002[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0xe9c38e,null))['then'](function(_0x3abc79){if(_0x3abc79){_0x4e985c=_0x3abc79;return _0x3abc79[_0x707d('0x9d')](_0xcf6002['body']['ids'],_[_0x707d('0x5e')](_0xcf6002['body'],[_0x707d('0x81'),'id'])||{});}return null;})[_0x707d('0x9e')](function(_0x2acc07){var _0x3d7be0;_0x5c67f5=_0x2acc07||[];var _0x5be04c=[];if(_0x2acc07){for(var _0x4fa015=0x0;_0x4fa015<_0x2acc07[_0x707d('0x54')];_0x4fa015+=0x1){var _0x1cf938=_0x2acc07[_0x4fa015][_0x707d('0x2c')]({'plain':!![]});_0x4e985c['dialCheckDuplicateType']=_0xcf6002[_0x707d('0x56')][_0x707d('0x9f')]?_0xcf6002[_0x707d('0x56')]['dialCheckDuplicateType']:_0x4e985c[_0x707d('0x9f')];switch(_0x4e985c[_0x707d('0x9f')]){case _0x707d('0xa0'):_0x3d7be0=squel['insert']()['into'](_0x707d('0xa1'))['fromQuery'](['phone',_0x707d('0xa2'),_0x707d('0xa3'),_0x707d('0xa4'),_0x707d('0x64'),_0x707d('0x5f'),'updatedAt'],squel[_0x707d('0x82')]()['field'](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27','scheduledAt')['field']('id',_0x707d('0xa3'))['field'](_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')](),_0x707d('0xa4'))[_0x707d('0x83')](_0xcf6002[_0x707d('0x53')]['id']['toString'](),'VoiceQueueId')[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0x5f'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')]('cm_contacts')[_0x707d('0x4a')]('deletedAt\x20IS\x20NULL')[_0x707d('0x4a')](_0x707d('0xa8'),_0x1cf938['CmListId']['toString']())[_0x707d('0x4a')](_0x707d('0xa9'))[_0x707d('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x707d('0x82')]()[_0x707d('0x83')]('COALESCE(calleridnum,\x27\x27)')[_0x707d('0x85')](_0x707d('0xaa'))[_0x707d('0x4a')](_0x707d('0x88'),_0xcf6002['params']['id'][_0x707d('0x8a')]()))[_0x707d('0x4a')](_0x707d('0xab'),squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xac'))[_0x707d('0x85')](_0x707d('0xa1'))[_0x707d('0x4a')](_0x707d('0x88'),_0xcf6002[_0x707d('0x53')]['id'][_0x707d('0x8a')]())))[_0x707d('0x8a')]();break;case'onlyIfOpen':_0x3d7be0=squel[_0x707d('0xad')]()[_0x707d('0xae')](_0x707d('0xa1'))['fromQuery']([_0x707d('0xa5'),'scheduledAt',_0x707d('0xa3'),_0x707d('0xa4'),_0x707d('0x64'),_0x707d('0x5f'),'updatedAt'],squel['select']()['field'](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa2'))[_0x707d('0x83')]('id',_0x707d('0xa3'))[_0x707d('0x83')](_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')](),_0x707d('0xa4'))[_0x707d('0x83')](_0xcf6002['params']['id'][_0x707d('0x8a')](),_0x707d('0x64'))['field']('\x27'+_0x104709+'\x27',_0x707d('0x5f'))['field']('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')](_0x707d('0xaf'))[_0x707d('0x4a')](_0x707d('0xb0'))['where'](_0x707d('0xa8'),_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')]())[_0x707d('0x4a')](_0x707d('0xa9'))[_0x707d('0x4a')](_0x707d('0xab'),squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xac'))['from'](_0x707d('0xa1'))[_0x707d('0x4a')](_0x707d('0x88'),_0xcf6002[_0x707d('0x53')]['id']['toString']())))['toString']();break;default:_0x3d7be0=squel['insert']()['into'](_0x707d('0xa1'))['fromQuery']([_0x707d('0xa5'),'scheduledAt',_0x707d('0xa3'),_0x707d('0xa4'),_0x707d('0x64'),_0x707d('0x5f'),_0x707d('0xa7')],squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa2'))[_0x707d('0x83')]('id',_0x707d('0xa3'))[_0x707d('0x83')](_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')](),'ListId')[_0x707d('0x83')](_0xcf6002[_0x707d('0x53')]['id'][_0x707d('0x8a')](),_0x707d('0x64'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27','createdAt')[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')]('cm_contacts')[_0x707d('0x4a')](_0x707d('0xb0'))[_0x707d('0x4a')]('ListId\x20=\x20?',_0x1cf938[_0x707d('0xa6')]['toString']())[_0x707d('0x4a')](_0x707d('0xa9')))[_0x707d('0x8a')]();}_0x5be04c[_0x707d('0x89')](db[_0x707d('0x73')][_0x707d('0x42')](_0x3d7be0));}return BPromise[_0x707d('0x8d')](_0x5be04c);}})[_0x707d('0x2b')](function(){var _0x3db3d3=[];var _0x538f5f=squel['insert']()[_0x707d('0xae')](_0x707d('0xb1'))[_0x707d('0xb2')](['CmHopperId',_0x707d('0xa5'),_0x707d('0xb3'),'createdAt',_0x707d('0xa7')],squel[_0x707d('0x82')]()[_0x707d('0x83')]('h.id')[_0x707d('0x83')](_0x707d('0xb4'))[_0x707d('0x83')](_0x707d('0xb5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0x5f'))['field']('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x707d('0xb6'))[_0x707d('0x4a')](_0x707d('0xb7'),_0x104709)[_0x707d('0x4a')](_0x707d('0xb8'),'PHONE'))[_0x707d('0x8a')]();_0x3db3d3[_0x707d('0x89')](db[_0x707d('0x73')]['query'](_0x538f5f));return BPromise[_0x707d('0x8d')](_0x3db3d3);})[_0x707d('0x2b')](function(){return _0x5c67f5;})[_0x707d('0x2b')](respondWithResult(_0xe9c38e,null))[_0x707d('0x51')](handleError(_0xe9c38e,null));};exports[_0x707d('0xb9')]=function(_0x207a95,_0x40e36b,_0x37bb7f){return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x207a95[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x40e36b,null))[_0x707d('0x2b')](function(_0x13a55a){if(_0x13a55a){return _0x13a55a[_0x707d('0xb9')](_0x207a95[_0x707d('0x42')][_0x707d('0x81')]);}})[_0x707d('0x2b')](function(_0x10b9e4){if(_0x10b9e4){return db[_0x707d('0x62')][_0x707d('0x2a')]({'where':{'ListId':_0x207a95[_0x707d('0x42')][_0x707d('0x81')],'VoiceQueueId':_0x207a95[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(){return _0x10b9e4;});}})[_0x707d('0x2b')](respondWithStatusCode(_0x40e36b,null))['catch'](handleError(_0x40e36b,null));};exports[_0x707d('0xba')]=function(_0x1fdc5e,_0xc479ab,_0xb0ab94){var _0x59fa37={};var _0x590278={};var _0x2c28ab;var _0x497c85;return db[_0x707d('0x3d')]['findOne']({'where':{'id':_0x1fdc5e['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0xc479ab,null))[_0x707d('0x2b')](function(_0x4ef445){if(_0x4ef445){_0x2c28ab=_0x4ef445;_0x590278[_0x707d('0x40')]=_['keys'](db[_0x707d('0x9b')]['rawAttributes']);_0x590278['query']=_[_0x707d('0x41')](_0x1fdc5e['query']);_0x590278[_0x707d('0x43')]=_[_0x707d('0x45')](_0x590278[_0x707d('0x40')],_0x590278[_0x707d('0x42')]);_0x59fa37[_0x707d('0x44')]=_['intersection'](_0x590278[_0x707d('0x40')],qs[_0x707d('0x46')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x46')]));_0x59fa37[_0x707d('0x44')]=_0x59fa37[_0x707d('0x44')][_0x707d('0x54')]?_0x59fa37[_0x707d('0x44')]:_0x590278[_0x707d('0x40')];_0x59fa37['order']=qs[_0x707d('0x49')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x49')]);_0x59fa37['where']=qs[_0x707d('0x43')](_['pick'](_0x1fdc5e[_0x707d('0x42')],_0x590278[_0x707d('0x43')]));if(_0x1fdc5e[_0x707d('0x42')]['filter']){_0x59fa37[_0x707d('0x4a')]=_['merge'](_0x59fa37[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x59fa37[_0x707d('0x44')],function(_0x5647e0){var _0x45b864={};_0x45b864[_0x5647e0]={'$like':'%'+_0x1fdc5e[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x45b864;})});}_0x59fa37=_[_0x707d('0x4c')]({},_0x59fa37,_0x1fdc5e['options']);return _0x2c28ab[_0x707d('0xba')](_0x59fa37);}})['then'](function(_0x43a0a7){if(_0x43a0a7){_0x497c85=_0x43a0a7[_0x707d('0x54')];if(!_0x1fdc5e['query'][_0x707d('0x63')](_0x707d('0x47'))){_0x59fa37[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x23')]);_0x59fa37[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x22')]);}return _0x2c28ab['getBlackLists'](_0x59fa37);}})['then'](function(_0x10e0ab){if(_0x10e0ab){return _0x10e0ab?{'count':_0x497c85,'rows':_0x10e0ab}:null;}})['then'](respondWithResult(_0xc479ab,null))[_0x707d('0x51')](handleError(_0xc479ab,null));};exports[_0x707d('0xbb')]=function(_0xdb193,_0x5b6f23,_0x217ab9){var _0x1e8fad,_0x15edf2;return db[_0x707d('0x3d')][_0x707d('0x55')]({'where':{'id':_0xdb193[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x5b6f23,null))[_0x707d('0x2b')](function(_0x455cf4){if(_0x455cf4){_0x15edf2=_0x455cf4;return _0x455cf4[_0x707d('0xbb')](_0xdb193['body'][_0x707d('0x81')],_['omit'](_0xdb193['body'],[_0x707d('0x81'),'id'])||{});}return null;})[_0x707d('0x9e')](function(_0x316bf2){var _0x43475f;_0x1e8fad=_0x316bf2||[];var _0x380bea=[];if(_0x316bf2){for(var _0xd43cd=0x0;_0xd43cd<_0x316bf2[_0x707d('0x54')];_0xd43cd+=0x1){var _0x327559=_0x316bf2[_0xd43cd]['get']({'plain':!![]});_0x43475f=squel['insert']()['into'](_0x707d('0xbc'))[_0x707d('0xb2')]([_0x707d('0xa5'),_0x707d('0xa3'),_0x707d('0xa4'),'VoiceQueueId','createdAt',_0x707d('0xa7')],squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('id','ContactId')['field'](_0x327559[_0x707d('0xa6')][_0x707d('0x8a')](),'ListId')['field'](_0xdb193['params']['id'][_0x707d('0x8a')](),'VoiceQueueId')[_0x707d('0x83')]('NOW()','createdAt')[_0x707d('0x83')](_0x707d('0xbd'),_0x707d('0xa7'))[_0x707d('0x85')](_0x707d('0xaf'))[_0x707d('0x4a')](_0x707d('0xb0'))['where']('ListId\x20=\x20?',_0x327559[_0x707d('0xa6')]['toString']())[_0x707d('0x4a')](_0x707d('0xa9')))[_0x707d('0x8a')]();_0x380bea[_0x707d('0x89')](db[_0x707d('0x73')][_0x707d('0x42')](_0x43475f));}return BPromise['all'](_0x380bea);}})['then'](function(){return _0x1e8fad;})['then'](respondWithResult(_0x5b6f23,null))[_0x707d('0x51')](handleError(_0x5b6f23,null));};exports[_0x707d('0xbe')]=function(_0x1be10c,_0x264b2f,_0xab81bb){return db[_0x707d('0x3d')][_0x707d('0x55')]({'where':{'id':_0x1be10c['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x264b2f,null))[_0x707d('0x2b')](function(_0x31f37c){if(_0x31f37c){return _0x31f37c[_0x707d('0xbe')](_0x1be10c[_0x707d('0x42')][_0x707d('0x81')]);}})[_0x707d('0x2b')](function(_0x11d313){if(_0x11d313){return db[_0x707d('0x6c')][_0x707d('0x2a')]({'where':{'ListId':_0x1be10c['query'][_0x707d('0x81')],'VoiceQueueId':_0x1be10c[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(){return _0x11d313;});}})[_0x707d('0x2b')](respondWithStatusCode(_0x264b2f,null))[_0x707d('0x51')](handleError(_0x264b2f,null));}; \ No newline at end of file +var _0x326f=['VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','destroy','then','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','VoiceQueue','findAll','rows','catch','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','userProfileId','clone','options','omit','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','UserVoiceQueueRt','isNil','all','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','createdAt','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x375c12,_0x5abc2f){var _0x443cad=function(_0x48d9c7){while(--_0x48d9c7){_0x375c12['push'](_0x375c12['shift']());}};_0x443cad(++_0x5abc2f);}(_0x326f,0xd1));var _0xf326=function(_0x567513,_0x358d59){_0x567513=_0x567513-0x0;var _0x45b034=_0x326f[_0x567513];return _0x45b034;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];config[_0xf326('0x17')]=_[_0xf326('0x18')](config['redis'],{'host':_0xf326('0x19'),'port':0x18eb});var socket=require(_0xf326('0x1a'))(new Redis(config[_0xf326('0x17')]));require(_0xf326('0x1b'))['register'](socket);function respondWithStatusCode(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xcc;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1c')](_0x5204ee);}return _0x45c1b6[_0xf326('0x1d')](_0x5204ee)[_0xf326('0x1e')]();};}function respondWithResult(_0xa63d1a,_0x292f4b){_0x292f4b=_0x292f4b||0xc8;return function(_0x287a2a){if(_0x287a2a){return _0xa63d1a[_0xf326('0x1d')](_0x292f4b)[_0xf326('0x1f')](_0x287a2a);}};}function respondWithFilteredResult(_0x5a682a,_0x3ad7da){return function(_0x453100){if(_0x453100){var _0x18bee3=typeof _0x3ad7da[_0xf326('0x20')]===_0xf326('0x21')&&typeof _0x3ad7da[_0xf326('0x22')]==='undefined';var _0x4a5b6c=_0x453100['count'];var _0x16e605=_0x18bee3?0x0:_0x3ad7da[_0xf326('0x20')];var _0x484cbe=_0x18bee3?_0x453100['count']:_0x3ad7da[_0xf326('0x20')]+_0x3ad7da['limit'];var _0x5b6d3c;if(_0x484cbe>=_0x4a5b6c){_0x484cbe=_0x4a5b6c;_0x5b6d3c=0xc8;}else{_0x5b6d3c=0xce;}_0x5a682a[_0xf326('0x1d')](_0x5b6d3c);return _0x5a682a[_0xf326('0x23')]('Content-Range',_0x16e605+'-'+_0x484cbe+'/'+_0x4a5b6c)['json'](_0x453100);}return null;};}function patchUpdates(_0x19b8ba){return function(_0xb1efcf){try{jsonpatch['apply'](_0xb1efcf,_0x19b8ba,!![]);}catch(_0x337ed5){return BPromise[_0xf326('0x24')](_0x337ed5);}return _0xb1efcf[_0xf326('0x25')]();};}function saveUpdates(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['update'](_0x295752)['then'](function(_0x4f31f6){return _0x4f31f6;});}return null;};}function removeEntity(_0x520d85,_0x1a2c4e){return function(_0x2cd45a){if(_0x2cd45a){return _0x2cd45a[_0xf326('0x26')]()[_0xf326('0x27')](function(){var _0x410237=_0x2cd45a['get']({'plain':!![]});var _0x201d28=[{'name':_0xf326('0x28'),'value':_0xf326('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':_0xf326('0x2a'),'ignore':![]}];var _0x55ad0f=_(_0x201d28)['filter'](_0xf326('0x2b'))[_0xf326('0x2c')](_0xf326('0x2d'))['value']();if(_[_0xf326('0x2e')](_0x55ad0f,_0x410237[_0xf326('0x2f')])){return;}var _0x55790d=_[_0xf326('0x30')](_0x201d28,[_0xf326('0x2d'),_0x410237[_0xf326('0x2f')]])[_0xf326('0x31')];return db[_0xf326('0x32')][_0xf326('0x26')]({'where':{'type':_0x55790d,'resourceId':_0x410237['id']}})[_0xf326('0x27')](function(){return _0x2cd45a;});})[_0xf326('0x27')](function(){_0x520d85[_0xf326('0x1d')](0xcc)[_0xf326('0x1e')]();});}};}function handleEntityNotFound(_0x4b52f2,_0x1035ed){return function(_0x424104){if(!_0x424104){_0x4b52f2[_0xf326('0x1c')](0x194);}return _0x424104;};}function handleError(_0x4792d2,_0x2c0cac){_0x2c0cac=_0x2c0cac||0x1f4;return function(_0x1721fd){logger[_0xf326('0x33')](_0x1721fd['stack']);if(_0x1721fd['name']){delete _0x1721fd[_0xf326('0x31')];}_0x4792d2[_0xf326('0x1d')](_0x2c0cac)[_0xf326('0x34')](_0x1721fd);};}exports[_0xf326('0x35')]=function(_0x30694f,_0x2e8a64){var _0x62585a={},_0x2d5f20={},_0x580374={'count':0x0,'rows':[]};var _0x461e93=_[_0xf326('0x2c')](db['VoiceQueue'][_0xf326('0x36')],function(_0x4e5d7c){return{'name':_0x4e5d7c[_0xf326('0x37')],'type':_0x4e5d7c['type']['key']};});_0x2d5f20[_0xf326('0x38')]=_['map'](_0x461e93,_0xf326('0x31'));_0x2d5f20['query']=_[_0xf326('0x39')](_0x30694f[_0xf326('0x3a')]);_0x2d5f20[_0xf326('0x3b')]=_['intersection'](_0x2d5f20[_0xf326('0x38')],_0x2d5f20[_0xf326('0x3a')]);_0x62585a['attributes']=_[_0xf326('0x3c')](_0x2d5f20[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x30694f[_0xf326('0x3a')]['fields']));_0x62585a[_0xf326('0x3e')]=_0x62585a[_0xf326('0x3e')][_0xf326('0x3f')]?_0x62585a[_0xf326('0x3e')]:_0x2d5f20[_0xf326('0x38')];if(!_0x30694f['query'][_0xf326('0x40')](_0xf326('0x41'))){_0x62585a['limit']=qs['limit'](_0x30694f[_0xf326('0x3a')]['limit']);_0x62585a['offset']=qs[_0xf326('0x20')](_0x30694f['query'][_0xf326('0x20')]);}_0x62585a[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x30694f[_0xf326('0x3a')]['sort']);_0x62585a[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x30694f[_0xf326('0x3a')],_0x2d5f20[_0xf326('0x3b')]),_0x461e93);if(_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]){_0x62585a[_0xf326('0x44')]=_[_0xf326('0x47')](_0x62585a[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x461e93,function(_0x2bab13){if(_0x2bab13['type']!==_0xf326('0x48')){var _0x1637dc={};_0x1637dc[_0x2bab13[_0xf326('0x31')]]={'$like':'%'+_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1637dc;}})});}_0x62585a=_[_0xf326('0x47')]({},_0x62585a,_0x30694f['options']);var _0x28e2d3={'where':_0x62585a[_0xf326('0x44')]};return db['VoiceQueue'][_0xf326('0x49')](_0x28e2d3)[_0xf326('0x27')](function(_0x130c56){_0x580374[_0xf326('0x49')]=_0x130c56;if(_0x30694f[_0xf326('0x3a')]['includeAll']){_0x62585a['include']=[{'all':!![]}];}return db[_0xf326('0x4a')][_0xf326('0x4b')](_0x62585a);})['then'](function(_0x4bd865){_0x580374[_0xf326('0x4c')]=_0x4bd865;return _0x580374;})[_0xf326('0x27')](respondWithFilteredResult(_0x2e8a64,_0x62585a))[_0xf326('0x4d')](handleError(_0x2e8a64,null));};exports['show']=function(_0x301e65,_0xe96e1e){var _0x2180d6={'raw':![],'where':{'id':_0x301e65[_0xf326('0x4e')]['id']}},_0xc43507={};_0xc43507[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xc43507[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x301e65[_0xf326('0x3a')]);_0xc43507[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],_0xc43507['query']);_0x2180d6[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x301e65['query'][_0xf326('0x3d')]));_0x2180d6[_0xf326('0x3e')]=_0x2180d6[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2180d6['attributes']:_0xc43507[_0xf326('0x38')];if(_0x301e65[_0xf326('0x3a')][_0xf326('0x4f')]){_0x2180d6[_0xf326('0x50')]=[{'all':!![]}];}_0x2180d6=_[_0xf326('0x47')]({},_0x2180d6,_0x301e65['options']);return db['VoiceQueue'][_0xf326('0x30')](_0x2180d6)[_0xf326('0x27')](handleEntityNotFound(_0xe96e1e,null))[_0xf326('0x27')](respondWithResult(_0xe96e1e,null))['catch'](handleError(_0xe96e1e,null));};exports[_0xf326('0x51')]=function(_0x4650db,_0x44eab7){return db['VoiceQueue']['create'](_0x4650db[_0xf326('0x52')],{})['then'](function(_0x1cf58f){var _0x554277=_0x4650db[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x554277)throw new Error(_0xf326('0x55'));if(_0x554277[_0xf326('0x56')]===_0xf326('0x53')){var _0x35d3c8=_0x1cf58f[_0xf326('0x54')]({'plain':!![]});var _0x495a16=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':'outbound'}];var _0x208ba4=_[_0xf326('0x30')](_0x495a16,[_0xf326('0x2d'),_0x35d3c8[_0xf326('0x2f')]])[_0xf326('0x31')];return db['UserProfileSection'][_0xf326('0x30')]({'where':{'name':_0x208ba4,'userProfileId':_0x554277[_0xf326('0x58')]},'raw':!![]})[_0xf326('0x27')](function(_0x46a21f){if(_0x46a21f&&_0x46a21f['autoAssociation']===0x0){return db[_0xf326('0x32')][_0xf326('0x51')]({'name':_0x35d3c8[_0xf326('0x31')],'resourceId':_0x35d3c8['id'],'type':_0x46a21f[_0xf326('0x31')],'sectionId':_0x46a21f['id']},{})['then'](function(){return _0x1cf58f;});}else{return _0x1cf58f;}})['catch'](function(_0x18b46e){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18b46e);throw _0x18b46e;});}return _0x1cf58f;})[_0xf326('0x27')](respondWithResult(_0x44eab7,0xc9))[_0xf326('0x4d')](handleError(_0x44eab7,null));};exports[_0xf326('0x59')]=function(_0x1258d1,_0x5765b0){var _0xb1c18c={'where':{'id':_0x1258d1['params']['id']}},_0x5657b7={};_0x5657b7[_0xf326('0x38')]=_['keys'](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xb1c18c[_0xf326('0x3e')]=_['intersection'](_0x5657b7['model'],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x3a')][_0xf326('0x3d')]));_0xb1c18c['attributes']=_0xb1c18c[_0xf326('0x3e')]['length']?_0xb1c18c[_0xf326('0x3e')]:_0x5657b7[_0xf326('0x38')];if(_0x1258d1[_0xf326('0x3a')][_0xf326('0x4f')]){_0xb1c18c[_0xf326('0x50')]=[{'all':!![]}];}_0xb1c18c=_[_0xf326('0x47')]({},_0xb1c18c,_0x1258d1[_0xf326('0x5a')]);return db[_0xf326('0x4a')][_0xf326('0x30')](_0xb1c18c)[_0xf326('0x27')](handleEntityNotFound(_0x5765b0,null))[_0xf326('0x27')](function(_0x1e56fb){if(_0x1e56fb){var _0x40f7cb=_0x1e56fb['get']({'plain':!![]});_0x40f7cb=qs[_0xf326('0x5b')](_0x40f7cb,['id','createdAt',_0xf326('0x5c')]);_0x1258d1[_0xf326('0x52')]=_['omit'](_0x1258d1[_0xf326('0x52')],['id','createdAt',_0xf326('0x5c')]);return db[_0xf326('0x4a')][_0xf326('0x51')](_[_0xf326('0x47')](_0x40f7cb,_0x1258d1[_0xf326('0x52')]),{'include':_0x1258d1['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf326('0x27')](function(_0x32fe3a){var _0x15a538=_0x1258d1[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x15a538)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a538[_0xf326('0x56')]===_0xf326('0x53')){var _0x4aadc9=_0x32fe3a['get']({'plain':!![]});var _0x5b25ca=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':_0xf326('0x2a')}];var _0x240ce5=_[_0xf326('0x30')](_0x5b25ca,[_0xf326('0x2d'),_0x4aadc9['type']])[_0xf326('0x31')];return db[_0xf326('0x5d')][_0xf326('0x30')]({'where':{'name':_0x240ce5,'userProfileId':_0x15a538[_0xf326('0x58')]},'raw':!![]})['then'](function(_0x3717fe){if(_0x3717fe&&_0x3717fe['autoAssociation']===0x0){return db['UserProfileResource'][_0xf326('0x51')]({'name':_0x4aadc9['name'],'resourceId':_0x4aadc9['id'],'type':_0x3717fe[_0xf326('0x31')],'sectionId':_0x3717fe['id']},{})[_0xf326('0x27')](function(){return _0x32fe3a;});}else{return _0x32fe3a;}})[_0xf326('0x4d')](function(_0x2ea5a2){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea5a2);throw _0x2ea5a2;});}return _0x32fe3a;});}})['then'](respondWithResult(_0x5765b0,0xc9))['catch'](handleError(_0x5765b0,null));};exports[_0xf326('0x5e')]=function(_0x307441,_0x229a34){if(_0x307441[_0xf326('0x52')]['id']){delete _0x307441[_0xf326('0x52')]['id'];}return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x307441[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x229a34,null))['then'](saveUpdates(_0x307441['body'],null))[_0xf326('0x27')](respondWithResult(_0x229a34,null))[_0xf326('0x4d')](handleError(_0x229a34,null));};exports['destroy']=function(_0x4bf1bf,_0x2497fd){return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x4bf1bf['params']['id']}})['then'](handleEntityNotFound(_0x2497fd,null))['then'](removeEntity(_0x2497fd,null))[_0xf326('0x4d')](handleError(_0x2497fd,null));};exports[_0xf326('0x5f')]=function(_0xd44071,_0x4838d5,_0x1cf9a8){var _0xdeceb9={'raw':![],'where':{}};var _0x35e34d={};var _0x457f3d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0xd44071[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4838d5,null))[_0xf326('0x27')](function(_0x5290da){if(_0x5290da){_0x35e34d[_0xf326('0x38')]=_['keys'](db[_0xf326('0x61')][_0xf326('0x36')]);_0x35e34d[_0xf326('0x3a')]=_['keys'](_0xd44071[_0xf326('0x3a')]);_0x35e34d[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x35e34d['model'],_0x35e34d[_0xf326('0x3a')]);_0xdeceb9[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x35e34d[_0xf326('0x38')],qs['fields'](_0xd44071[_0xf326('0x3a')]['fields']));_0xdeceb9['attributes']=_0xdeceb9[_0xf326('0x3e')][_0xf326('0x3f')]?_0xdeceb9['attributes']:_0x35e34d['model'];if(!_0xd44071['query'][_0xf326('0x40')]('nolimit')){_0xdeceb9[_0xf326('0x22')]=qs[_0xf326('0x22')](_0xd44071[_0xf326('0x3a')][_0xf326('0x22')]);_0xdeceb9[_0xf326('0x20')]=qs[_0xf326('0x20')](_0xd44071['query'][_0xf326('0x20')]);}_0xdeceb9[_0xf326('0x42')]=qs['sort'](_0xd44071['query'][_0xf326('0x43')]);_0xdeceb9['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0xd44071[_0xf326('0x3a')],_0x35e34d[_0xf326('0x3b')]));_0xdeceb9[_0xf326('0x44')][_0xf326('0x62')]=_0x5290da['id'];if(_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]){_0xdeceb9[_0xf326('0x44')]=_['merge'](_0xdeceb9[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xdeceb9['attributes'],function(_0x3c82cf){var _0x5b0f2d={};_0x5b0f2d[_0x3c82cf]={'$like':'%'+_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5b0f2d;})});}_0xdeceb9=_[_0xf326('0x47')]({},_0xdeceb9,_0xd44071['options']);return db[_0xf326('0x61')][_0xf326('0x49')]({'where':_0xdeceb9[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x30e096){_0x457f3d[_0xf326('0x49')]=_0x30e096;if(_0xd44071[_0xf326('0x3a')][_0xf326('0x4f')]){_0xdeceb9[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x61')][_0xf326('0x4b')](_0xdeceb9);})[_0xf326('0x27')](function(_0x452e28){_0x457f3d[_0xf326('0x4c')]=_0x452e28;return _0x457f3d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4838d5,_0xdeceb9))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x63')]=function(_0x24aaca,_0x4829ae,_0x438daa){var _0x424be4={'raw':!![],'where':{}};var _0x5c1686={};var _0x80fce5={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x24aaca[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4829ae,null))[_0xf326('0x27')](function(_0x1bb7cc){if(_0x1bb7cc){_0x5c1686['model']=_[_0xf326('0x39')](db[_0xf326('0x64')][_0xf326('0x36')]);_0x5c1686[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x24aaca[_0xf326('0x3a')]);_0x5c1686[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5c1686['model'],_0x5c1686[_0xf326('0x3a')]);_0x424be4[_0xf326('0x3e')]=_['intersection'](_0x5c1686[_0xf326('0x38')],qs['fields'](_0x24aaca[_0xf326('0x3a')][_0xf326('0x3d')]));_0x424be4[_0xf326('0x3e')]=_0x424be4[_0xf326('0x3e')][_0xf326('0x3f')]?_0x424be4[_0xf326('0x3e')]:_0x5c1686[_0xf326('0x38')];if(!_0x24aaca[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x424be4[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x22')]);_0x424be4['offset']=qs[_0xf326('0x20')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x20')]);}_0x424be4[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x24aaca['query'][_0xf326('0x43')]);_0x424be4[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x24aaca[_0xf326('0x3a')],_0x5c1686['filters']));_0x424be4['where'][_0xf326('0x62')]=_0x1bb7cc['id'];if(_0x24aaca['query'][_0xf326('0x46')]){_0x424be4[_0xf326('0x44')]=_[_0xf326('0x47')](_0x424be4['where'],{'$or':_['map'](_0x424be4[_0xf326('0x3e')],function(_0x2d92e4){var _0x167ac9={};_0x167ac9[_0x2d92e4]={'$like':'%'+_0x24aaca[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x167ac9;})});}_0x424be4=_['merge']({},_0x424be4,_0x24aaca[_0xf326('0x5a')]);return db[_0xf326('0x64')][_0xf326('0x49')]({'where':_0x424be4['where']})['then'](function(_0x47a35b){_0x80fce5[_0xf326('0x49')]=_0x47a35b;if(_0x24aaca[_0xf326('0x3a')][_0xf326('0x4f')]){_0x424be4[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x64')][_0xf326('0x4b')](_0x424be4);})[_0xf326('0x27')](function(_0x598a93){_0x80fce5['rows']=_0x598a93;return _0x80fce5;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4829ae,_0x424be4))[_0xf326('0x4d')](handleError(_0x4829ae,null));};exports[_0xf326('0x65')]=function(_0x571b8c,_0xd85b34,_0x39bdde){var _0x1746af={'raw':!![],'where':{}};var _0x597005={};var _0x39d16d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x571b8c[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd85b34,null))['then'](function(_0x5a7af3){if(_0x5a7af3){_0x597005[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x66')]['rawAttributes']);_0x597005[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x571b8c[_0xf326('0x3a')]);_0x597005['filters']=_[_0xf326('0x3c')](_0x597005[_0xf326('0x38')],_0x597005[_0xf326('0x3a')]);_0x1746af[_0xf326('0x3e')]=_['intersection'](_0x597005[_0xf326('0x38')],qs['fields'](_0x571b8c[_0xf326('0x3a')][_0xf326('0x3d')]));_0x1746af[_0xf326('0x3e')]=_0x1746af[_0xf326('0x3e')]['length']?_0x1746af[_0xf326('0x3e')]:_0x597005['model'];if(!_0x571b8c[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x1746af[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x571b8c['query']['limit']);_0x1746af[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x571b8c[_0xf326('0x3a')][_0xf326('0x20')]);}_0x1746af['order']=qs[_0xf326('0x43')](_0x571b8c['query'][_0xf326('0x43')]);_0x1746af[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x571b8c[_0xf326('0x3a')],_0x597005[_0xf326('0x3b')]));_0x1746af[_0xf326('0x44')][_0xf326('0x62')]=_0x5a7af3['id'];if(_0x571b8c[_0xf326('0x3a')]['filter']){_0x1746af[_0xf326('0x44')]=_[_0xf326('0x47')](_0x1746af['where'],{'$or':_[_0xf326('0x2c')](_0x1746af[_0xf326('0x3e')],function(_0x306fc9){var _0x6dad26={};_0x6dad26[_0x306fc9]={'$like':'%'+_0x571b8c['query']['filter']+'%'};return _0x6dad26;})});}_0x1746af=_[_0xf326('0x47')]({},_0x1746af,_0x571b8c[_0xf326('0x5a')]);return db['CmHopperFinal'][_0xf326('0x49')]({'where':_0x1746af['where']})['then'](function(_0x4cad0){_0x39d16d[_0xf326('0x49')]=_0x4cad0;if(_0x571b8c[_0xf326('0x3a')][_0xf326('0x4f')]){_0x1746af[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x66')][_0xf326('0x4b')](_0x1746af);})[_0xf326('0x27')](function(_0xc9dead){_0x39d16d['rows']=_0xc9dead;return _0x39d16d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0xd85b34,_0x1746af))[_0xf326('0x4d')](handleError(_0xd85b34,null));};exports[_0xf326('0x67')]=function(_0x1c7f81,_0x59d894,_0x3e6a5d){var _0x20020c={'raw':!![],'where':{}};var _0xc94723={};var _0x750d55={'count':0x0,'rows':[]};return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1c7f81[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59d894,null))[_0xf326('0x27')](function(_0x14d255){if(_0x14d255){_0xc94723[_0xf326('0x38')]=_[_0xf326('0x39')](db['CmHopperBlack'][_0xf326('0x36')]);_0xc94723[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x1c7f81['query']);_0xc94723[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],_0xc94723[_0xf326('0x3a')]);_0x20020c['attributes']=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1c7f81[_0xf326('0x3a')]['fields']));_0x20020c[_0xf326('0x3e')]=_0x20020c[_0xf326('0x3e')][_0xf326('0x3f')]?_0x20020c['attributes']:_0xc94723[_0xf326('0x38')];if(!_0x1c7f81[_0xf326('0x3a')]['hasOwnProperty'](_0xf326('0x41'))){_0x20020c[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x22')]);_0x20020c[_0xf326('0x20')]=qs['offset'](_0x1c7f81['query'][_0xf326('0x20')]);}_0x20020c[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x43')]);_0x20020c[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1c7f81[_0xf326('0x3a')],_0xc94723[_0xf326('0x3b')]));_0x20020c[_0xf326('0x44')][_0xf326('0x62')]=_0x14d255['id'];if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x46')]){_0x20020c[_0xf326('0x44')]=_[_0xf326('0x47')](_0x20020c['where'],{'$or':_[_0xf326('0x2c')](_0x20020c['attributes'],function(_0x590dc0){var _0x32fc6e={};_0x32fc6e[_0x590dc0]={'$like':'%'+_0x1c7f81['query'][_0xf326('0x46')]+'%'};return _0x32fc6e;})});}_0x20020c=_[_0xf326('0x47')]({},_0x20020c,_0x1c7f81[_0xf326('0x5a')]);return db[_0xf326('0x68')][_0xf326('0x49')]({'where':_0x20020c[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x18b3cc){_0x750d55[_0xf326('0x49')]=_0x18b3cc;if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x4f')]){_0x20020c[_0xf326('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf326('0x4b')](_0x20020c);})[_0xf326('0x27')](function(_0x5657){_0x750d55[_0xf326('0x4c')]=_0x5657;return _0x750d55;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x59d894,_0x20020c))[_0xf326('0x4d')](handleError(_0x59d894,null));};exports[_0xf326('0x69')]=function(_0x5429a2,_0x448d10,_0x15f799){var _0x320ab3={};var _0x316877={};var _0x79faa1;var _0x14259b;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x5429a2[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x448d10,null))[_0xf326('0x27')](function(_0x9a0455){if(_0x9a0455){_0x79faa1=_0x9a0455;_0x316877[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x6a')][_0xf326('0x36')]);_0x316877[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x5429a2[_0xf326('0x3a')]);_0x316877[_0xf326('0x3b')]=_['intersection'](_0x316877[_0xf326('0x38')],_0x316877[_0xf326('0x3a')]);_0x320ab3[_0xf326('0x3e')]=_['intersection'](_0x316877['model'],qs[_0xf326('0x3d')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x3d')]));_0x320ab3[_0xf326('0x3e')]=_0x320ab3['attributes'][_0xf326('0x3f')]?_0x320ab3[_0xf326('0x3e')]:_0x316877[_0xf326('0x38')];_0x320ab3['order']=qs['sort'](_0x5429a2['query'][_0xf326('0x43')]);_0x320ab3[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x5429a2[_0xf326('0x3a')],_0x316877['filters']));if(_0x5429a2[_0xf326('0x3a')]['filter']){_0x320ab3[_0xf326('0x44')]=_[_0xf326('0x47')](_0x320ab3[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x320ab3[_0xf326('0x3e')],function(_0x3dcaf9){var _0x1f05a2={};_0x1f05a2[_0x3dcaf9]={'$like':'%'+_0x5429a2[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1f05a2;})});}_0x320ab3=_[_0xf326('0x47')]({},_0x320ab3,_0x5429a2[_0xf326('0x5a')]);return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})[_0xf326('0x27')](function(_0x3dc3c5){if(_0x3dc3c5){_0x14259b=_0x3dc3c5['length'];if(!_0x5429a2[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x320ab3['limit']=qs['limit'](_0x5429a2['query'][_0xf326('0x22')]);_0x320ab3[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})['then'](function(_0x1aeaf9){if(_0x1aeaf9){return _0x1aeaf9?{'count':_0x14259b,'rows':_0x1aeaf9}:null;}})[_0xf326('0x27')](respondWithResult(_0x448d10,null))[_0xf326('0x4d')](handleError(_0x448d10,null));};exports[_0xf326('0x6b')]=function(_0x71e344,_0x5cac48,_0x10f5cb){var _0x44c4bb=_0x71e344[_0xf326('0x52')][_0xf326('0x6c')];var _0x350d76=_['map'](_0x44c4bb,'id');return db['Team'][_0xf326('0x4b')]({'where':{'id':_0x350d76},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf326('0x31'),_0xf326('0x6d'),_0xf326('0x6e'),_0xf326('0x6f')],'raw':!![]}]})[_0xf326('0x27')](function(_0x5aa1ca){if(_0x5aa1ca){var _0x51bfee=_[_0xf326('0x70')](_0x5aa1ca,function(_0x2eaf15){var _0x182080=_0x2eaf15['get']({'plain':!![]});_0x182080[_0xf326('0x71')]['forEach'](function(_0x4df691){_0x4df691['penalty']=_[_0xf326('0x30')](_0x44c4bb,{'id':_0x182080['id']})[_0xf326('0x72')];});return _0x182080[_0xf326('0x71')];});return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x71e344[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](function(_0x3833f9){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0xb4b180){return _0x3833f9['addTeams'](_0x350d76,{'transaction':_0xb4b180})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x44c4bb,function(_0x2a17bf){return db[_0xf326('0x76')][_0xf326('0x77')]({'TeamId':_0x2a17bf['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id'],'penalty':_0x2a17bf[_0xf326('0x72')]},{'transaction':_0xb4b180});});})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x51bfee,function(_0x4d5f64){return db[_0xf326('0x78')][_0xf326('0x79')]({'where':{'UserId':_0x4d5f64['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id']},'defaults':{'penalty':_0x4d5f64['penalty']},'transaction':_0xb4b180});});})['then'](function(){return BPromise[_0xf326('0x75')](_[_0xf326('0x46')](_0x51bfee,{'online':!![]}),function(_0x5efac6){return db['UserVoiceQueueRt'][_0xf326('0x77')]({'membername':_0x5efac6['name'],'UserId':_0x5efac6['id'],'queue_name':_0x3833f9[_0xf326('0x31')],'VoiceQueueId':_0x3833f9['id'],'interface':_['isNil'](_0x5efac6[_0xf326('0x6f')])?util[_0xf326('0x7a')](_0xf326('0x7b'),_0x5efac6[_0xf326('0x31')]):_0x5efac6[_0xf326('0x6f')],'paused':_0x5efac6['voicePause']||![],'penalty':_0x5efac6[_0xf326('0x72')]},{'transaction':_0xb4b180});});})['then'](function(){_0x51bfee[_0xf326('0x7c')](function(_0x3fe546){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':_0x3fe546['id'],'VoiceQueueId':_0x3833f9['id']});});});});});}})[_0xf326('0x27')](respondWithStatusCode(_0x5cac48,null))['catch'](handleError(_0x5cac48,null));};exports['removeTeams']=function(_0x1ad0df,_0x5c913c,_0x53421f){return db['Team']['findAll']({'where':{'id':_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xf326('0x80')],'as':_0xf326('0x71'),'attributes':['id'],'raw':!![]}]})[_0xf326('0x27')](handleEntityNotFound(_0x5c913c,null))[_0xf326('0x27')](function(_0xc5d45e){var _0x4feb3e=_[_0xf326('0x2c')](_0xc5d45e,'id');var _0x3e0bf4=[];var _0x72c3ed=[];var _0x4abe8a=squel[_0xf326('0x81')]();_0x4abe8a[_0xf326('0x82')](_0xf326('0x83'))[_0xf326('0x84')](_0xf326('0x85'),'tq')[_0xf326('0x86')](_0xf326('0x87'),'ut',_0xf326('0x88'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1ad0df[_0xf326('0x4e')]['id']);for(var _0x5e9650=0x0;_0x5e9650<_0xc5d45e[_0xf326('0x3f')];_0x5e9650+=0x1){let _0x500780=_0xc5d45e[_0x5e9650];for(var _0x4b537a=0x0;_0x4b537a<_0x500780[_0xf326('0x71')]['length'];_0x4b537a+=0x1){let _0x3edec1=_0x500780[_0xf326('0x71')][_0x4b537a];var _0x3dfa46=_0x4abe8a[_0xf326('0x59')]();_0x3dfa46['where'](_0xf326('0x89'),_0x3edec1['id']);_0x72c3ed[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x3dfa46['toString'](),{'type':db['sequelize'][_0xf326('0x8b')][_0xf326('0x8c')]})[_0xf326('0x27')](function(_0x160086){if(_0x160086[_0xf326('0x3f')]===0x1){return _0x3edec1['id'];}else{var _0x1acd3b=_[_0xf326('0x8d')](_[_0xf326('0x2c')](_0x160086,_0xf326('0x8e')),function(_0xa5963a){return _[_0xf326('0x2e')](_0x4feb3e,_0xa5963a);});if(_0x1acd3b){return _0x3edec1['id'];}}}));}}return BPromise['all'](_0x72c3ed)[_0xf326('0x27')](function(_0x303b42){_0x3e0bf4=_(_0x3e0bf4)[_0xf326('0x8f')](_0x303b42)['compact']()[_0xf326('0x2d')]();return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x1ad0df[_0xf326('0x4e')]['id']}})['then'](function(_0x1b6d24){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0x2d861a){return _0x1b6d24['removeTeams'](_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')],{'transaction':_0x2d861a})[_0xf326('0x27')](function(){if(!_[_0xf326('0x90')](_0x3e0bf4)){return _0x1b6d24[_0xf326('0x91')](_0x3e0bf4,{'transaction':_0x2d861a})['then'](function(){return db['UserVoiceQueueRt'][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x1ad0df[_0xf326('0x4e')]['id'],'UserId':_0x3e0bf4},'transaction':_0x2d861a});});}})[_0xf326('0x27')](function(){_0x3e0bf4[_0xf326('0x7c')](function(_0x42c8de){socket[_0xf326('0x7d')](_0xf326('0x92'),{'UserId':_0x42c8de,'VoiceQueueId':_0x1b6d24['id']});});});});});});})[_0xf326('0x27')](respondWithStatusCode(_0x5c913c,null))[_0xf326('0x4d')](handleError(_0x5c913c,null));};exports[_0xf326('0x93')]=function(_0x55d67f,_0x550bda,_0x4f14ff){var _0x8fccef,_0x190d3c;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x55d67f[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x550bda,null))[_0xf326('0x27')](function(_0xc94f1e){if(_0xc94f1e){_0x190d3c=_0xc94f1e;return _0xc94f1e[_0xf326('0x93')](_0x55d67f[_0xf326('0x52')]['ids'],_[_0xf326('0x5b')](_0x55d67f['body'],['ids','id'])||{})[_0xf326('0x94')](function(_0x2a9fd1){for(var _0x4086fa=0x0;_0x4086fa<_0x55d67f[_0xf326('0x52')][_0xf326('0x7f')]['length'];_0x4086fa+=0x1){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':Number(_0x55d67f[_0xf326('0x52')]['ids'][_0x4086fa]),'VoiceQueueId':Number(_0x55d67f[_0xf326('0x4e')]['id'])});}return _0x2a9fd1;});}})[_0xf326('0x27')](function(_0x38dbf3){_0x8fccef=_0x38dbf3||[];if(_0x190d3c){return db[_0xf326('0x80')]['findAll']({'where':{'id':_0x55d67f[_0xf326('0x52')]['ids']},'attributes':['id','name',_0xf326('0x6d'),'voicePause','interface'],'raw':!![]});}})[_0xf326('0x27')](function(_0xbd7671){if(!_[_0xf326('0x90')](_0xbd7671)){var _0x1d2611=[];for(var _0x497d2e=0x0;_0x497d2e<_0xbd7671['length'];_0x497d2e++){if(_0xbd7671[_0x497d2e][_0xf326('0x6d')]){_0x1d2611[_0xf326('0x8a')](db[_0xf326('0x95')][_0xf326('0x77')]({'membername':_0xbd7671[_0x497d2e][_0xf326('0x31')],'UserId':_0xbd7671[_0x497d2e]['id'],'queue_name':_0x190d3c[_0xf326('0x31')],'VoiceQueueId':_0x190d3c['id'],'interface':_[_0xf326('0x96')](_0xbd7671[_0x497d2e][_0xf326('0x6f')])?util[_0xf326('0x7a')]('SIP/%s',_0xbd7671[_0x497d2e][_0xf326('0x31')]):_0xbd7671[_0x497d2e][_0xf326('0x6f')],'paused':_0xbd7671[_0x497d2e][_0xf326('0x6e')]||![],'penalty':_0x55d67f['body']['penalty']||0x0}));}}return BPromise[_0xf326('0x97')](_0x1d2611);}})[_0xf326('0x27')](function(){return _0x8fccef;})[_0xf326('0x27')](respondWithResult(_0x550bda,null))[_0xf326('0x4d')](handleError(_0x550bda,null));};exports['removeAgents']=function(_0x4f96aa,_0x5ea5d4,_0x45aae6){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x4f96aa['params']['id']}})['then'](handleEntityNotFound(_0x5ea5d4,null))[_0xf326('0x27')](function(_0x15c66f){if(_0x15c66f){return _0x15c66f[_0xf326('0x91')](_0x4f96aa['query']['ids'])['then'](function(){if(_[_0xf326('0x98')](_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')])){for(var _0x1791dd=0x0;_0x1791dd<_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')][_0xf326('0x3f')];_0x1791dd+=0x1){socket[_0xf326('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x4f96aa['query'][_0xf326('0x7f')][_0x1791dd]),'VoiceQueueId':Number(_0x4f96aa['params']['id'])});}}else{socket['emit'](_0xf326('0x92'),{'UserId':Number(_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]),'VoiceQueueId':Number(_0x4f96aa[_0xf326('0x4e')]['id'])});}});}})[_0xf326('0x27')](function(_0x1307a4){return db[_0xf326('0x95')][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x4f96aa[_0xf326('0x4e')]['id'],'UserId':_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]}})[_0xf326('0x27')](function(){return _0x1307a4;});})['then'](respondWithStatusCode(_0x5ea5d4,null))[_0xf326('0x4d')](handleError(_0x5ea5d4,null));};exports[_0xf326('0x99')]=function(_0x2b6585,_0x3d77af,_0x55e867){var _0x15e405={};var _0x27074a={};var _0x173ea9;var _0x130cbb;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x2b6585[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x3d77af,null))[_0xf326('0x27')](function(_0x28d251){if(_0x28d251){_0x173ea9=_0x28d251;_0x27074a[_0xf326('0x38')]=_['keys'](db['User'][_0xf326('0x36')]);_0x27074a[_0xf326('0x3a')]=_['keys'](_0x2b6585[_0xf326('0x3a')]);_0x27074a[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x27074a[_0xf326('0x38')],_0x27074a['query']);_0x15e405[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x27074a['model'],qs[_0xf326('0x3d')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x3d')]));_0x15e405[_0xf326('0x3e')]=_0x15e405[_0xf326('0x3e')][_0xf326('0x3f')]?_0x15e405[_0xf326('0x3e')]:_0x27074a[_0xf326('0x38')];_0x15e405[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x2b6585[_0xf326('0x3a')]['sort']);_0x15e405[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x2b6585[_0xf326('0x3a')],_0x27074a[_0xf326('0x3b')]));if(_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]){_0x15e405[_0xf326('0x44')]=_['merge'](_0x15e405[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x15e405[_0xf326('0x3e')],function(_0x12cc1d){var _0x5ae8c7={};_0x5ae8c7[_0x12cc1d]={'$like':'%'+_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5ae8c7;})});}_0x15e405=_[_0xf326('0x47')]({},_0x15e405,_0x2b6585['options']);return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x5a0c11){if(_0x5a0c11){_0x130cbb=_0x5a0c11['length'];if(!_0x2b6585[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x15e405[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x22')]);_0x15e405[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x4a0a44){if(_0x4a0a44){return _0x4a0a44?{'count':_0x130cbb,'rows':_0x4a0a44}:null;}})['then'](respondWithResult(_0x3d77af,null))[_0xf326('0x4d')](handleError(_0x3d77af,null));};exports['getMembers']=function(_0x4ab9c0,_0x531d31,_0x878991){var _0xc4aa47={};var _0x4fa6f9={};var _0x17f967;var _0x1639f2;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x4ab9c0[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x531d31,null))['then'](function(_0x38ff4d){if(_0x38ff4d){_0x17f967=_0x38ff4d;_0x4fa6f9[_0xf326('0x38')]=_['keys'](db[_0xf326('0x95')][_0xf326('0x36')]);_0x4fa6f9[_0xf326('0x3a')]=_['keys'](_0x4ab9c0[_0xf326('0x3a')]);_0x4fa6f9[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],_0x4fa6f9[_0xf326('0x3a')]);_0xc4aa47['attributes']=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],qs['fields'](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x3d')]));_0xc4aa47[_0xf326('0x3e')]=_0xc4aa47['attributes']['length']?_0xc4aa47[_0xf326('0x3e')]:_0x4fa6f9[_0xf326('0x38')];_0xc4aa47['order']=qs[_0xf326('0x43')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x43')]);_0xc4aa47[_0xf326('0x44')]=qs['filters'](_['pick'](_0x4ab9c0[_0xf326('0x3a')],_0x4fa6f9[_0xf326('0x3b')]));if(_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]){_0xc4aa47[_0xf326('0x44')]=_[_0xf326('0x47')](_0xc4aa47[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xc4aa47['attributes'],function(_0x511e66){var _0x5d719a={};_0x5d719a[_0x511e66]={'$like':'%'+_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5d719a;})});}_0xc4aa47=_[_0xf326('0x47')]({},_0xc4aa47,_0x4ab9c0['options']);return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})[_0xf326('0x27')](function(_0x30247a){if(_0x30247a){_0x1639f2=_0x30247a[_0xf326('0x3f')];if(!_0x4ab9c0['query']['hasOwnProperty'](_0xf326('0x41'))){_0xc4aa47[_0xf326('0x22')]=qs['limit'](_0x4ab9c0['query'][_0xf326('0x22')]);_0xc4aa47[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})['then'](function(_0xb17fae){return _0xb17fae?{'count':_0x1639f2,'rows':_0xb17fae}:null;})[_0xf326('0x27')](respondWithResult(_0x531d31,null))['catch'](handleError(_0x531d31,null));};exports['getLists']=function(_0x371e52,_0x6a202f,_0x250682){var _0x4069bb={};var _0x1ea2be={};var _0x663019;var _0x2549ab;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x371e52[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x6a202f,null))[_0xf326('0x27')](function(_0x58fdca){if(_0x58fdca){_0x663019=_0x58fdca;_0x1ea2be[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x9b')][_0xf326('0x36')]);_0x1ea2be['query']=_['keys'](_0x371e52[_0xf326('0x3a')]);_0x1ea2be['filters']=_[_0xf326('0x3c')](_0x1ea2be[_0xf326('0x38')],_0x1ea2be[_0xf326('0x3a')]);_0x4069bb['attributes']=_[_0xf326('0x3c')](_0x1ea2be['model'],qs['fields'](_0x371e52['query'][_0xf326('0x3d')]));_0x4069bb['attributes']=_0x4069bb[_0xf326('0x3e')][_0xf326('0x3f')]?_0x4069bb[_0xf326('0x3e')]:_0x1ea2be[_0xf326('0x38')];_0x4069bb[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x371e52[_0xf326('0x3a')]['sort']);_0x4069bb['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x371e52[_0xf326('0x3a')],_0x1ea2be[_0xf326('0x3b')]));if(_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]){_0x4069bb['where']=_[_0xf326('0x47')](_0x4069bb['where'],{'$or':_[_0xf326('0x2c')](_0x4069bb[_0xf326('0x3e')],function(_0x5ba7ef){var _0x2671d5={};_0x2671d5[_0x5ba7ef]={'$like':'%'+_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x2671d5;})});}_0x4069bb=_[_0xf326('0x47')]({},_0x4069bb,_0x371e52[_0xf326('0x5a')]);return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x55d9bd){if(_0x55d9bd){_0x2549ab=_0x55d9bd['length'];if(!_0x371e52[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x4069bb[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x371e52[_0xf326('0x3a')][_0xf326('0x22')]);_0x4069bb[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x371e52[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x4c88c2){if(_0x4c88c2){return _0x4c88c2?{'count':_0x2549ab,'rows':_0x4c88c2}:null;}})['then'](respondWithResult(_0x6a202f,null))['catch'](handleError(_0x6a202f,null));};exports[_0xf326('0x9d')]=function(_0x1af709,_0x3fdfc5,_0xf7df13){var _0x45afd7=moment()['format'](_0xf326('0x9e'));var _0x233857,_0xbc39f5;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x1af709[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0xf326('0x27')](function(_0xfa7c63){if(_0xfa7c63){_0xbc39f5=_0xfa7c63;return _0xfa7c63['addLists'](_0x1af709[_0xf326('0x52')][_0xf326('0x7f')],_['omit'](_0x1af709[_0xf326('0x52')],['ids','id'])||{});}return null;})[_0xf326('0x94')](function(_0x24dd16){var _0x4515c1;_0x233857=_0x24dd16||[];var _0x5100ec=[];if(_0x24dd16){for(var _0x293c16=0x0;_0x293c16<_0x24dd16[_0xf326('0x3f')];_0x293c16+=0x1){var _0x28ba7c=_0x24dd16[_0x293c16][_0xf326('0x54')]({'plain':!![]});_0xbc39f5['dialCheckDuplicateType']=_0x1af709[_0xf326('0x52')][_0xf326('0x9f')]?_0x1af709['body'][_0xf326('0x9f')]:_0xbc39f5['dialCheckDuplicateType'];switch(_0xbc39f5['dialCheckDuplicateType']){case _0xf326('0xa0'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),'phone')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c['CmListId'][_0xf326('0xa8')](),_0xf326('0xa9'))['field'](_0x1af709['params']['id'][_0xf326('0xa8')](),_0xf326('0x62'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','updatedAt')[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')]('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xf326('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf326('0x82')](_0xf326('0xad'))[_0xf326('0x84')](_0xf326('0xae'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709['params']['id'][_0xf326('0xa8')]()))[_0xf326('0x44')](_0xf326('0xb0'),squel[_0xf326('0x81')]()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;case _0xf326('0xb2'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c[_0xf326('0xac')]['toString'](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),_0xf326('0x62'))['field']('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))['where'](_0xf326('0xab'))['where']('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3'))[_0xf326('0x44')](_0xf326('0xb0'),squel['select']()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1af709['params']['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;default:_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb1'))[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')]('phone',_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0xa5'))[_0xf326('0x82')]('id',_0xf326('0xa6'))['field'](_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))['where'](_0xf326('0xb4'),_0x28ba7c[_0xf326('0xac')]['toString']())[_0xf326('0x44')](_0xf326('0xb3')))[_0xf326('0xa8')]();}_0x5100ec[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4515c1));}return BPromise[_0xf326('0x97')](_0x5100ec);}})[_0xf326('0x27')](function(){var _0x122dfe=[];var _0x39a5f8=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb5'))[_0xf326('0xa3')](['CmHopperId',_0xf326('0xa4'),'OrderBy',_0xf326('0xa7'),'updatedAt'],squel[_0xf326('0x81')]()['field'](_0xf326('0xb6'))['field'](_0xf326('0xb7'))['field']('ci.OrderBy+1')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xb8'),'ci')[_0xf326('0x86')](_0xf326('0xb1'),'h',_0xf326('0xb9'))['where']('h.scheduledat=?',_0x45afd7)[_0xf326('0x44')]('ci.ItemClass=?','PHONE'))['toString']();_0x122dfe[_0xf326('0x8a')](db['sequelize']['query'](_0x39a5f8));return BPromise[_0xf326('0x97')](_0x122dfe);})[_0xf326('0x27')](function(){return _0x233857;})['then'](respondWithResult(_0x3fdfc5,null))[_0xf326('0x4d')](handleError(_0x3fdfc5,null));};exports[_0xf326('0xba')]=function(_0x38ee2f,_0x1ea221,_0x4136f9){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ea221,null))[_0xf326('0x27')](function(_0x424360){if(_0x424360){return _0x424360[_0xf326('0xba')](_0x38ee2f[_0xf326('0x3a')][_0xf326('0x7f')]);}})[_0xf326('0x27')](function(_0x35ff4d){if(_0x35ff4d){return db['CmHopper']['destroy']({'where':{'ListId':_0x38ee2f['query'][_0xf326('0x7f')],'VoiceQueueId':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](function(){return _0x35ff4d;});}})['then'](respondWithStatusCode(_0x1ea221,null))['catch'](handleError(_0x1ea221,null));};exports[_0xf326('0xbb')]=function(_0x1d05b3,_0x36d7c2,_0x1afa71){var _0x2a7789={};var _0x5b1d58={};var _0x5785c9;var _0x4ff3b8;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1d05b3['params']['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x36d7c2,null))[_0xf326('0x27')](function(_0x55e8e6){if(_0x55e8e6){_0x5785c9=_0x55e8e6;_0x5b1d58[_0xf326('0x38')]=_['keys'](db[_0xf326('0x9b')]['rawAttributes']);_0x5b1d58[_0xf326('0x3a')]=_['keys'](_0x1d05b3['query']);_0x5b1d58[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5b1d58['model'],_0x5b1d58[_0xf326('0x3a')]);_0x2a7789[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x5b1d58[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x3d')]));_0x2a7789[_0xf326('0x3e')]=_0x2a7789[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2a7789['attributes']:_0x5b1d58[_0xf326('0x38')];_0x2a7789['order']=qs[_0xf326('0x43')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x43')]);_0x2a7789[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1d05b3[_0xf326('0x3a')],_0x5b1d58[_0xf326('0x3b')]));if(_0x1d05b3[_0xf326('0x3a')][_0xf326('0x46')]){_0x2a7789['where']=_['merge'](_0x2a7789['where'],{'$or':_[_0xf326('0x2c')](_0x2a7789['attributes'],function(_0x173bea){var _0x94eaa1={};_0x94eaa1[_0x173bea]={'$like':'%'+_0x1d05b3[_0xf326('0x3a')]['filter']+'%'};return _0x94eaa1;})});}_0x2a7789=_[_0xf326('0x47')]({},_0x2a7789,_0x1d05b3[_0xf326('0x5a')]);return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})['then'](function(_0x5387af){if(_0x5387af){_0x4ff3b8=_0x5387af[_0xf326('0x3f')];if(!_0x1d05b3[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x2a7789['limit']=qs[_0xf326('0x22')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x22')]);_0x2a7789[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})[_0xf326('0x27')](function(_0x595e28){if(_0x595e28){return _0x595e28?{'count':_0x4ff3b8,'rows':_0x595e28}:null;}})['then'](respondWithResult(_0x36d7c2,null))[_0xf326('0x4d')](handleError(_0x36d7c2,null));};exports['addBlackLists']=function(_0x130b92,_0x1e7099,_0x47b04b){var _0x470e90,_0x5d9653;return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x130b92[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x1e7099,null))[_0xf326('0x27')](function(_0x13ba1a){if(_0x13ba1a){_0x5d9653=_0x13ba1a;return _0x13ba1a[_0xf326('0xbc')](_0x130b92['body'][_0xf326('0x7f')],_['omit'](_0x130b92['body'],['ids','id'])||{});}return null;})['spread'](function(_0xb6e17c){var _0x4d19ed;_0x470e90=_0xb6e17c||[];var _0x7c6644=[];if(_0xb6e17c){for(var _0x4eb5d3=0x0;_0x4eb5d3<_0xb6e17c[_0xf326('0x3f')];_0x4eb5d3+=0x1){var _0x4e2160=_0xb6e17c[_0x4eb5d3]['get']({'plain':!![]});_0x4d19ed=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xbd'))[_0xf326('0xa3')](['phone',_0xf326('0xa6'),_0xf326('0xa9'),_0xf326('0x62'),_0xf326('0xa7'),'updatedAt'],squel['select']()['field']('phone',_0xf326('0xa4'))['field']('id','ContactId')[_0xf326('0x82')](_0x4e2160['CmListId']['toString'](),'ListId')[_0xf326('0x82')](_0x130b92['params']['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('NOW()',_0xf326('0xa7'))[_0xf326('0x82')](_0xf326('0xbe'),_0xf326('0x5c'))['from'](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')](_0xf326('0xb4'),_0x4e2160[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3')))['toString']();_0x7c6644['push'](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4d19ed));}return BPromise[_0xf326('0x97')](_0x7c6644);}})[_0xf326('0x27')](function(){return _0x470e90;})[_0xf326('0x27')](respondWithResult(_0x1e7099,null))['catch'](handleError(_0x1e7099,null));};exports[_0xf326('0xbf')]=function(_0x3e715a,_0x5d2dfa,_0x4fa725){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x3e715a[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x5d2dfa,null))[_0xf326('0x27')](function(_0x4c3be5){if(_0x4c3be5){return _0x4c3be5['removeBlackLists'](_0x3e715a[_0xf326('0x3a')][_0xf326('0x7f')]);}})['then'](function(_0x53beb9){if(_0x53beb9){return db[_0xf326('0x68')]['destroy']({'where':{'ListId':_0x3e715a[_0xf326('0x3a')]['ids'],'VoiceQueueId':_0x3e715a[_0xf326('0x4e')]['id']}})['then'](function(){return _0x53beb9;});}})[_0xf326('0x27')](respondWithStatusCode(_0x5d2dfa,null))[_0xf326('0x4d')](handleError(_0x5d2dfa,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index a60961e..0233e9d 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 _0x374f=['remove','emit','hook','exports','events','../../mysqldb','VoiceQueue','save','update'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x374f,0x100));var _0xf374=function(_0x4a1a37,_0x37be60){_0x4a1a37=_0x4a1a37-0x0;var _0x52a3c9=_0x374f[_0x4a1a37];return _0x52a3c9;};'use strict';var EventEmitter=require(_0xf374('0x0'));var VoiceQueue=require(_0xf374('0x1'))['db'][_0xf374('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf374('0x3'),'afterUpdate':_0xf374('0x4'),'afterDestroy':_0xf374('0x5')};function emitEvent(_0x57c936){return function(_0xc26170,_0x38204b,_0x582fad){VoiceQueueEvents[_0xf374('0x6')](_0x57c936+':'+_0xc26170['id'],_0xc26170);VoiceQueueEvents['emit'](_0x57c936,_0xc26170);_0x582fad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf374('0x7')](e,emitEvent(event));}}module[_0xf374('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x7594=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue'];(function(_0x30de0f,_0x1d67fe){var _0x49fdb8=function(_0x5e043a){while(--_0x5e043a){_0x30de0f['push'](_0x30de0f['shift']());}};_0x49fdb8(++_0x1d67fe);}(_0x7594,0x1c0));var _0x4759=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x7594[_0xa9a245];return _0x2d0eaa;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4759('0x0'))['db'][_0x4759('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4759('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4759('0x3'),'afterDestroy':_0x4759('0x4')};function emitEvent(_0x1b6871){return function(_0x37ac4d,_0x58e746,_0x55e9d7){VoiceQueueEvents['emit'](_0x1b6871+':'+_0x37ac4d['id'],_0x37ac4d);VoiceQueueEvents[_0x4759('0x5')](_0x1b6871,_0x37ac4d);_0x55e9d7(null);};}for(var e in events){if(events[_0x4759('0x6')](e)){var event=events[e];VoiceQueue[_0x4759('0x7')](e,emitEvent(event));}}module[_0x4759('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 66bc36f..acce2c4 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x364e2b,_0x30b028){var _0x943fef=function(_0x3454a5){while(--_0x3454a5){_0x364e2b['push'](_0x364e2b['shift']());}};_0x943fef(++_0x30b028);}(_0x3e74,0x175));var _0x43e7=function(_0x385855,_0x458543){_0x385855=_0x385855-0x0;var _0xdf17ae=_0x3e74[_0x385855];return _0xdf17ae;};'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 +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x3e74,0x175));var _0x43e7=function(_0x44de40,_0x10df88){_0x44de40=_0x44de40-0x0;var _0x47010d=_0x3e74[_0x44de40];return _0x47010d;};'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 8c3794d..1b93e1d 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 _0x3e4f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','options','raw','where','attributes','limit','include','map','model','VoiceQueue','find','debug','ShowVoiceQueue','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x3c5aa6,_0x4c4f86){var _0x49e397=function(_0x37004d){while(--_0x37004d){_0x3c5aa6['push'](_0x3c5aa6['shift']());}};_0x49e397(++_0x4c4f86);}(_0x3e4f,0x15a));var _0xf3e4=function(_0x42f274,_0x56e031){_0x42f274=_0x42f274-0x0;var _0xdbd107=_0x3e4f[_0x42f274];return _0xdbd107;};'use strict';var _=require(_0xf3e4('0x0'));var util=require(_0xf3e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf3e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3e4('0x3'))['db'];var utils=require(_0xf3e4('0x4'));var logger=require(_0xf3e4('0x5'))(_0xf3e4('0x6'));var config=require(_0xf3e4('0x7'));var jayson=require(_0xf3e4('0x8'));var client=jayson[_0xf3e4('0x9')]['http']({'port':0x232a});config['redis']=_[_0xf3e4('0xa')](config[_0xf3e4('0xb')],{'host':_0xf3e4('0xc'),'port':0x18eb});var socket=require(_0xf3e4('0xd'))(new Redis(config[_0xf3e4('0xb')]));require(_0xf3e4('0xe'))['register'](socket);function respondWithRpcPromise(_0x2147ef,_0x40ac9e,_0x4e91bb){return new BPromise(function(_0x1bd6fb,_0x30e81e){return client[_0xf3e4('0xf')](_0x2147ef,_0x4e91bb)[_0xf3e4('0x10')](function(_0x83b3a6){logger[_0xf3e4('0x11')](_0xf3e4('0x12'),_0x40ac9e,_0xf3e4('0x13'));logger['debug'](_0xf3e4('0x14'),_0x40ac9e,_0xf3e4('0x13'),JSON[_0xf3e4('0x15')](_0x83b3a6));if(_0x83b3a6[_0xf3e4('0x16')]){if(_0x83b3a6[_0xf3e4('0x16')]['code']===0x1f4){logger[_0xf3e4('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x40ac9e,_0x83b3a6[_0xf3e4('0x16')]['message']);return _0x30e81e(_0x83b3a6[_0xf3e4('0x16')]['message']);}logger[_0xf3e4('0x16')](_0xf3e4('0x12'),_0x40ac9e,_0x83b3a6[_0xf3e4('0x16')]['message']);return _0x1bd6fb(_0x83b3a6[_0xf3e4('0x16')][_0xf3e4('0x17')]);}else{logger[_0xf3e4('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x40ac9e,'request\x20sent');_0x1bd6fb(_0x83b3a6[_0xf3e4('0x18')][_0xf3e4('0x17')]);}})[_0xf3e4('0x19')](function(_0x55d303){logger[_0xf3e4('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x40ac9e,_0x55d303);_0x30e81e(_0x55d303);});});}exports[_0xf3e4('0x1a')]=function(_0x9f8f62){var _0x282e7e=this;return new Promise(function(_0xb4fea0,_0x338c27){return db['VoiceQueue']['findAll']({'raw':_0x9f8f62[_0xf3e4('0x1b')]?_0x9f8f62['options'][_0xf3e4('0x1c')]===undefined?!![]:![]:!![],'where':_0x9f8f62[_0xf3e4('0x1b')]?_0x9f8f62[_0xf3e4('0x1b')][_0xf3e4('0x1d')]||null:null,'attributes':_0x9f8f62[_0xf3e4('0x1b')]?_0x9f8f62[_0xf3e4('0x1b')][_0xf3e4('0x1e')]||null:null,'limit':_0x9f8f62[_0xf3e4('0x1b')]?_0x9f8f62['options'][_0xf3e4('0x1f')]||null:null,'include':_0x9f8f62[_0xf3e4('0x1b')]?_0x9f8f62[_0xf3e4('0x1b')][_0xf3e4('0x20')]?_[_0xf3e4('0x21')](_0x9f8f62[_0xf3e4('0x1b')][_0xf3e4('0x20')],function(_0x1b0b88){return{'model':db[_0x1b0b88[_0xf3e4('0x22')]],'as':_0x1b0b88['as'],'attributes':_0x1b0b88[_0xf3e4('0x1e')],'include':_0x1b0b88[_0xf3e4('0x20')]?_['map'](_0x1b0b88['include'],function(_0x58d68a){return{'model':db[_0x58d68a[_0xf3e4('0x22')]],'as':_0x58d68a['as'],'attributes':_0x58d68a[_0xf3e4('0x1e')],'include':_0x58d68a[_0xf3e4('0x20')]?_[_0xf3e4('0x21')](_0x58d68a['include'],function(_0x1c03e9){return{'model':db[_0x1c03e9[_0xf3e4('0x22')]],'as':_0x1c03e9['as'],'attributes':_0x1c03e9[_0xf3e4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf3e4('0x10')](function(_0x102021){logger[_0xf3e4('0x11')](_0xf3e4('0x1a'),_0x9f8f62);logger['debug'](_0xf3e4('0x1a'),_0x9f8f62,JSON[_0xf3e4('0x15')](_0x102021));_0xb4fea0(_0x102021);})[_0xf3e4('0x19')](function(_0x423b61){logger['error'](_0xf3e4('0x1a'),_0x423b61[_0xf3e4('0x17')],_0x9f8f62);_0x338c27(_0x282e7e['error'](0x1f4,_0x423b61['message']));});});};exports['ShowVoiceQueue']=function(_0x2f6aa6){var _0xbeb52=this;return new Promise(function(_0x4dfcf9,_0x31599c){return db[_0xf3e4('0x23')][_0xf3e4('0x24')]({'raw':_0x2f6aa6['options']?_0x2f6aa6['options'][_0xf3e4('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f6aa6['options']?_0x2f6aa6[_0xf3e4('0x1b')][_0xf3e4('0x1d')]||null:null,'attributes':_0x2f6aa6[_0xf3e4('0x1b')]?_0x2f6aa6[_0xf3e4('0x1b')]['attributes']||null:null,'include':_0x2f6aa6[_0xf3e4('0x1b')]?_0x2f6aa6[_0xf3e4('0x1b')][_0xf3e4('0x20')]?_[_0xf3e4('0x21')](_0x2f6aa6[_0xf3e4('0x1b')][_0xf3e4('0x20')],function(_0x3b84df){return{'model':db[_0x3b84df['model']],'as':_0x3b84df['as'],'attributes':_0x3b84df[_0xf3e4('0x1e')],'include':_0x3b84df['include']?_[_0xf3e4('0x21')](_0x3b84df[_0xf3e4('0x20')],function(_0x46747f){return{'model':db[_0x46747f[_0xf3e4('0x22')]],'as':_0x46747f['as'],'attributes':_0x46747f[_0xf3e4('0x1e')],'include':_0x46747f[_0xf3e4('0x20')]?_[_0xf3e4('0x21')](_0x46747f[_0xf3e4('0x20')],function(_0x11d379){return{'model':db[_0x11d379[_0xf3e4('0x22')]],'as':_0x11d379['as'],'attributes':_0x11d379['attributes']};}):[]};}):[]};}):[]:[]})[_0xf3e4('0x10')](function(_0x130d9f){logger['info']('ShowVoiceQueue',_0x2f6aa6);logger[_0xf3e4('0x25')]('ShowVoiceQueue',_0x2f6aa6,JSON['stringify'](_0x130d9f));_0x4dfcf9(_0x130d9f);})[_0xf3e4('0x19')](function(_0x3dfd38){logger[_0xf3e4('0x16')](_0xf3e4('0x26'),_0x3dfd38[_0xf3e4('0x17')],_0x2f6aa6);_0x31599c(_0xbeb52[_0xf3e4('0x16')](0x1f4,_0x3dfd38[_0xf3e4('0x17')]));});});}; \ No newline at end of file +var _0x13a1=['VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit','include','map','model','info','stringify','ShowVoiceQueue','where','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15c5f4,_0x39ba6d){var _0x34ded6=function(_0x3d8285){while(--_0x3d8285){_0x15c5f4['push'](_0x15c5f4['shift']());}};_0x34ded6(++_0x39ba6d);}(_0x13a1,0x1a9));var _0x113a=function(_0x253fee,_0x4fabdb){_0x253fee=_0x253fee-0x0;var _0x56198b=_0x13a1[_0x253fee];return _0x56198b;};'use strict';var _=require(_0x113a('0x0'));var util=require('util');var moment=require(_0x113a('0x1'));var BPromise=require(_0x113a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x113a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x113a('0x4'))(_0x113a('0x5'));var config=require(_0x113a('0x6'));var jayson=require(_0x113a('0x7'));var client=jayson[_0x113a('0x8')][_0x113a('0x9')]({'port':0x232a});config[_0x113a('0xa')]=_[_0x113a('0xb')](config[_0x113a('0xa')],{'host':_0x113a('0xc'),'port':0x18eb});var socket=require(_0x113a('0xd'))(new Redis(config[_0x113a('0xa')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2fd42e,_0x4ca055,_0x4400c6){return new BPromise(function(_0x33144c,_0x133a4f){return client[_0x113a('0xe')](_0x2fd42e,_0x4400c6)[_0x113a('0xf')](function(_0x43c9b8){logger['info'](_0x113a('0x10'),_0x4ca055,_0x113a('0x11'));logger[_0x113a('0x12')](_0x113a('0x13'),_0x4ca055,_0x113a('0x11'),JSON['stringify'](_0x43c9b8));if(_0x43c9b8[_0x113a('0x14')]){if(_0x43c9b8[_0x113a('0x14')][_0x113a('0x15')]===0x1f4){logger[_0x113a('0x14')](_0x113a('0x10'),_0x4ca055,_0x43c9b8[_0x113a('0x14')]['message']);return _0x133a4f(_0x43c9b8[_0x113a('0x14')][_0x113a('0x16')]);}logger[_0x113a('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x4ca055,_0x43c9b8[_0x113a('0x14')][_0x113a('0x16')]);return _0x33144c(_0x43c9b8[_0x113a('0x14')][_0x113a('0x16')]);}else{logger['info'](_0x113a('0x10'),_0x4ca055,_0x113a('0x11'));_0x33144c(_0x43c9b8['result'][_0x113a('0x16')]);}})[_0x113a('0x17')](function(_0x1cd294){logger[_0x113a('0x14')](_0x113a('0x10'),_0x4ca055,_0x1cd294);_0x133a4f(_0x1cd294);});});}exports[_0x113a('0x18')]=function(_0x2515d0){var _0x207f67=this;return new Promise(function(_0x5def6e,_0x282a8c){return db[_0x113a('0x19')]['findAll']({'raw':_0x2515d0[_0x113a('0x1a')]?_0x2515d0[_0x113a('0x1a')][_0x113a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2515d0[_0x113a('0x1a')]?_0x2515d0['options']['where']||null:null,'attributes':_0x2515d0[_0x113a('0x1a')]?_0x2515d0[_0x113a('0x1a')][_0x113a('0x1c')]||null:null,'limit':_0x2515d0[_0x113a('0x1a')]?_0x2515d0['options'][_0x113a('0x1d')]||null:null,'include':_0x2515d0[_0x113a('0x1a')]?_0x2515d0[_0x113a('0x1a')][_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x2515d0['options'][_0x113a('0x1e')],function(_0x1c99ac){return{'model':db[_0x1c99ac[_0x113a('0x20')]],'as':_0x1c99ac['as'],'attributes':_0x1c99ac[_0x113a('0x1c')],'include':_0x1c99ac[_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x1c99ac[_0x113a('0x1e')],function(_0x2415e1){return{'model':db[_0x2415e1[_0x113a('0x20')]],'as':_0x2415e1['as'],'attributes':_0x2415e1[_0x113a('0x1c')],'include':_0x2415e1[_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x2415e1[_0x113a('0x1e')],function(_0x2ee2a8){return{'model':db[_0x2ee2a8[_0x113a('0x20')]],'as':_0x2ee2a8['as'],'attributes':_0x2ee2a8[_0x113a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x113a('0xf')](function(_0x5abc2d){logger[_0x113a('0x21')]('GetVoiceQueue',_0x2515d0);logger['debug'](_0x113a('0x18'),_0x2515d0,JSON[_0x113a('0x22')](_0x5abc2d));_0x5def6e(_0x5abc2d);})[_0x113a('0x17')](function(_0xfe08e6){logger['error']('GetVoiceQueue',_0xfe08e6['message'],_0x2515d0);_0x282a8c(_0x207f67[_0x113a('0x14')](0x1f4,_0xfe08e6[_0x113a('0x16')]));});});};exports[_0x113a('0x23')]=function(_0x131967){var _0x4fd111=this;return new Promise(function(_0xebeed5,_0xc1b7f2){return db[_0x113a('0x19')]['find']({'raw':_0x131967['options']?_0x131967[_0x113a('0x1a')][_0x113a('0x1b')]===undefined?!![]:![]:!![],'where':_0x131967[_0x113a('0x1a')]?_0x131967[_0x113a('0x1a')][_0x113a('0x24')]||null:null,'attributes':_0x131967[_0x113a('0x1a')]?_0x131967['options'][_0x113a('0x1c')]||null:null,'include':_0x131967[_0x113a('0x1a')]?_0x131967[_0x113a('0x1a')][_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x131967['options']['include'],function(_0x49ac3a){return{'model':db[_0x49ac3a[_0x113a('0x20')]],'as':_0x49ac3a['as'],'attributes':_0x49ac3a[_0x113a('0x1c')],'include':_0x49ac3a[_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x49ac3a[_0x113a('0x1e')],function(_0x562271){return{'model':db[_0x562271[_0x113a('0x20')]],'as':_0x562271['as'],'attributes':_0x562271[_0x113a('0x1c')],'include':_0x562271['include']?_[_0x113a('0x1f')](_0x562271['include'],function(_0x4590bc){return{'model':db[_0x4590bc[_0x113a('0x20')]],'as':_0x4590bc['as'],'attributes':_0x4590bc[_0x113a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x113a('0xf')](function(_0x208dde){logger['info'](_0x113a('0x23'),_0x131967);logger['debug'](_0x113a('0x23'),_0x131967,JSON[_0x113a('0x22')](_0x208dde));_0xebeed5(_0x208dde);})[_0x113a('0x17')](function(_0x383865){logger[_0x113a('0x14')](_0x113a('0x23'),_0x383865[_0x113a('0x16')],_0x131967);_0xc1b7f2(_0x4fd111[_0x113a('0x14')](0x1f4,_0x383865[_0x113a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6d6fcbc..8e6c1a0 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 _0x9254=['save','remove','update','emit','removeListener','length','voiceQueue:','./voiceQueue.events'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9254,0x157));var _0x4925=function(_0x32864e,_0x1d814f){_0x32864e=_0x32864e-0x0;var _0x186fc9=_0x9254[_0x32864e];return _0x186fc9;};'use strict';var VoiceQueueEvents=require(_0x4925('0x0'));var events=[_0x4925('0x1'),_0x4925('0x2'),_0x4925('0x3')];function createListener(_0x49b3e5,_0x583c28){return function(_0x4a9860){_0x583c28[_0x4925('0x4')](_0x49b3e5,_0x4a9860);};}function removeListener(_0x5d89cd,_0x3e1e99){return function(){VoiceQueueEvents[_0x4925('0x5')](_0x5d89cd,_0x3e1e99);};}exports['register']=function(_0x192d9e){for(var _0x183845=0x0,_0x49a5b7=events[_0x4925('0x6')];_0x183845<_0x49a5b7;_0x183845++){var _0x3334b4=events[_0x183845];var _0x4384f3=createListener(_0x4925('0x7')+_0x3334b4,_0x192d9e);VoiceQueueEvents['on'](_0x3334b4,_0x4384f3);}}; \ No newline at end of file +var _0xcbc8=['remove','emit','removeListener','register','voiceQueue:','./voiceQueue.events','save'];(function(_0x3e385c,_0x24e848){var _0x4c6171=function(_0x1825c7){while(--_0x1825c7){_0x3e385c['push'](_0x3e385c['shift']());}};_0x4c6171(++_0x24e848);}(_0xcbc8,0x1da));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x8cbc('0x0'));var events=[_0x8cbc('0x1'),_0x8cbc('0x2'),'update'];function createListener(_0x20a1a5,_0x528e61){return function(_0xf47d61){_0x528e61[_0x8cbc('0x3')](_0x20a1a5,_0xf47d61);};}function removeListener(_0x3c9cb0,_0x81801b){return function(){VoiceQueueEvents[_0x8cbc('0x4')](_0x3c9cb0,_0x81801b);};}exports[_0x8cbc('0x5')]=function(_0x22c4e3){for(var _0x3cba83=0x0,_0x3a69d9=events['length'];_0x3cba83<_0x3a69d9;_0x3cba83++){var _0x5e9b5c=events[_0x3cba83];var _0x390398=createListener(_0x8cbc('0x6')+_0x5e9b5c,_0x22c4e3);VoiceQueueEvents['on'](_0x5e9b5c,_0x390398);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ad1d2a9..8b62c3d 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 _0x8958=['/index','post','create','/:id','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x940f2c,_0x47a25d){var _0x2b1a30=function(_0x417b5a){while(--_0x417b5a){_0x940f2c['push'](_0x940f2c['shift']());}};_0x2b1a30(++_0x47a25d);}(_0x8958,0x1be));var _0x8895=function(_0x4e8dbe,_0x3676a9){_0x4e8dbe=_0x4e8dbe-0x0;var _0x214779=_0x8958[_0x4e8dbe];return _0x214779;};'use strict';var multer=require(_0x8895('0x0'));var util=require(_0x8895('0x1'));var path=require('path');var timeout=require(_0x8895('0x2'));var express=require('express');var router=express[_0x8895('0x3')]();var fs_extra=require(_0x8895('0x4'));var auth=require(_0x8895('0x5'));var interaction=require(_0x8895('0x6'));var config=require(_0x8895('0x7'));var controller=require(_0x8895('0x8'));router[_0x8895('0x9')]('/',auth[_0x8895('0xa')](),controller[_0x8895('0xb')]);router[_0x8895('0x9')](_0x8895('0xc'),auth['isAuthenticated'](),controller[_0x8895('0xd')]);router['get'](_0x8895('0xe'),auth[_0x8895('0xa')](),controller['getVoiceQueuesReport']);router[_0x8895('0x9')]('/:id',auth[_0x8895('0xa')](),controller['show']);router[_0x8895('0xf')]('/',auth[_0x8895('0xa')](),controller[_0x8895('0x10')]);router['put'](_0x8895('0x11'),auth[_0x8895('0xa')](),controller[_0x8895('0x12')]);router[_0x8895('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd17e=['show','post','create','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xd17e,0xa5));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xed17('0x0'));var util=require(_0xed17('0x1'));var path=require(_0xed17('0x2'));var timeout=require('connect-timeout');var express=require(_0xed17('0x3'));var router=express[_0xed17('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed17('0x5'));var interaction=require(_0xed17('0x6'));var config=require('../../config/environment');var controller=require(_0xed17('0x7'));router[_0xed17('0x8')]('/',auth['isAuthenticated'](),controller[_0xed17('0x9')]);router[_0xed17('0x8')](_0xed17('0xa'),auth[_0xed17('0xb')](),controller['describe']);router[_0xed17('0x8')](_0xed17('0xc'),auth[_0xed17('0xb')](),controller[_0xed17('0xd')]);router[_0xed17('0x8')](_0xed17('0xe'),auth[_0xed17('0xb')](),controller[_0xed17('0xf')]);router[_0xed17('0x10')]('/',auth[_0xed17('0xb')](),controller[_0xed17('0x11')]);router[_0xed17('0x12')]('/:id',auth[_0xed17('0xb')](),controller['update']);router['delete']('/:id',auth[_0xed17('0xb')](),controller[_0xed17('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8462a13..0f60bb1 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 _0xaefd=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','moment','exports','STRING','DATE','getDataValue'];(function(_0x29fdf9,_0xe01528){var _0x452239=function(_0x513496){while(--_0x513496){_0x29fdf9['push'](_0x29fdf9['shift']());}};_0x452239(++_0xe01528);}(_0xaefd,0xeb));var _0xdaef=function(_0x5651ef,_0x4fd99a){_0x5651ef=_0x5651ef-0x0;var _0x392fba=_0xaefd[_0x5651ef];return _0x392fba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdaef('0x0'));module[_0xdaef('0x1')]={'type':{'type':Sequelize[_0xdaef('0x2')]},'uniqueid':{'type':Sequelize[_0xdaef('0x2')]},'calleridnum':{'type':Sequelize[_0xdaef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdaef('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xdaef('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x58f3a3){var _0x3c00d8=moment(_0x58f3a3);var _0x5dbca9=moment(this[_0xdaef('0x4')](_0xdaef('0x5')))[_0xdaef('0x6')](_0xdaef('0x7'));var _0x1d52a5=_0x3c00d8[_0xdaef('0x8')](_0x5dbca9,_0xdaef('0x9'));this[_0xdaef('0xa')](_0xdaef('0xb'),_0x58f3a3);this[_0xdaef('0xa')](_0xdaef('0xc'),_0x1d52a5||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xdaef('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xdaef('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xdaef('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xdaef('0x3')]},'queuecallerexit':{'type':Sequelize[_0xdaef('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xdaef('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xdaef('0x2')],'comment':_0xdaef('0xe')},'originalposition':{'type':Sequelize[_0xdaef('0xf')]},'channel':{'type':Sequelize[_0xdaef('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdaef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xdaef('0x2')]},'priority':{'type':Sequelize[_0xdaef('0x2')]},'holdtime':{'type':Sequelize[_0xdaef('0xf')]},'mohtime':{'type':Sequelize[_0xdaef('0xf')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdaef('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdaef('0x2')]},'transfer':{'type':Sequelize[_0xdaef('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xdaef('0x2')]},'transferuniqueid':{'type':Sequelize[_0xdaef('0x2')]},'disposition':{'type':Sequelize[_0xdaef('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdaef('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xdaef('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2131=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x2131,0x123));var _0x1213=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x2131[_0x20cf8a];return _0x54e165;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1213('0x0'));module['exports']={'type':{'type':Sequelize[_0x1213('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1213('0x1')]},'calleridname':{'type':Sequelize[_0x1213('0x1')]},'queue':{'type':Sequelize[_0x1213('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x1213('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x1213('0x2')],'set':function(_0x757b4f){var _0x3e5742=moment(_0x757b4f);var _0x19b85e=moment(this['getDataValue'](_0x1213('0x3')))[_0x1213('0x4')](_0x1213('0x5'));var _0x3a2743=_0x3e5742[_0x1213('0x6')](_0x19b85e,_0x1213('0x7'));this[_0x1213('0x8')](_0x1213('0x9'),_0x757b4f);this['setDataValue']('holdtime',_0x3a2743||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x1213('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1213('0x2')]},'queuecallerexit':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1213('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x1213('0x1')],'comment':_0x1213('0xc')},'originalposition':{'type':Sequelize[_0x1213('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1213('0x1')]},'connectedlinename':{'type':Sequelize[_0x1213('0x1')]},'accountcode':{'type':Sequelize[_0x1213('0x1')]},'context':{'type':Sequelize[_0x1213('0x1')]},'exten':{'type':Sequelize[_0x1213('0x1')]},'priority':{'type':Sequelize[_0x1213('0x1')]},'holdtime':{'type':Sequelize[_0x1213('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1213('0x1')]},'transfer':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1213('0x1')],'comment':_0x1213('0xd')},'transferexten':{'type':Sequelize[_0x1213('0x1')]},'transferuniqueid':{'type':Sequelize[_0x1213('0x1')]},'disposition':{'type':Sequelize[_0x1213('0x1')]},'secondDisposition':{'type':Sequelize[_0x1213('0x1')]},'thirdDisposition':{'type':Sequelize[_0x1213('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x1213('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index a09ce64..bd79d09 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 _0x3908=['body','describe','order','findAll','getVoiceQueuesReport','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','rows','catch','show','params','length','find','create'];(function(_0x5807d4,_0x29306b){var _0x5ddf9b=function(_0x56476c){while(--_0x56476c){_0x5807d4['push'](_0x5807d4['shift']());}};_0x5ddf9b(++_0x29306b);}(_0x3908,0x151));var _0x8390=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0x3908[_0x1e7345];return _0x33017c;};'use strict';var emlformat=require(_0x8390('0x0'));var rimraf=require(_0x8390('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8390('0x2'));var moment=require(_0x8390('0x3'));var BPromise=require(_0x8390('0x4'));var Mustache=require(_0x8390('0x5'));var util=require('util');var path=require(_0x8390('0x6'));var sox=require(_0x8390('0x7'));var csv=require(_0x8390('0x8'));var ejs=require(_0x8390('0x9'));var fs=require('fs');var fs_extra=require(_0x8390('0xa'));var _=require(_0x8390('0xb'));var squel=require('squel');var crypto=require(_0x8390('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8390('0xd'));var Papa=require(_0x8390('0xe'));var Redis=require(_0x8390('0xf'));var authService=require(_0x8390('0x10'));var qs=require(_0x8390('0x11'));var as=require(_0x8390('0x12'));var hardwareService=require(_0x8390('0x13'));var logger=require(_0x8390('0x14'))(_0x8390('0x15'));var utils=require('../../config/utils');var config=require(_0x8390('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8390('0x17'))['db'];config[_0x8390('0x18')]=_[_0x8390('0x19')](config[_0x8390('0x18')],{'host':_0x8390('0x1a'),'port':0x18eb});var socket=require(_0x8390('0x1b'))(new Redis(config[_0x8390('0x18')]));require(_0x8390('0x1c'))['register'](socket);function respondWithStatusCode(_0x3a63b4,_0x47b553){_0x47b553=_0x47b553||0xcc;return function(_0x5d8cf9){if(_0x5d8cf9){return _0x3a63b4['sendStatus'](_0x47b553);}return _0x3a63b4[_0x8390('0x1d')](_0x47b553)[_0x8390('0x1e')]();};}function respondWithResult(_0x53b917,_0x42017d){_0x42017d=_0x42017d||0xc8;return function(_0x1285a8){if(_0x1285a8){return _0x53b917[_0x8390('0x1d')](_0x42017d)['json'](_0x1285a8);}};}function respondWithFilteredResult(_0x118d79,_0x126a7b){return function(_0x5825ea){if(_0x5825ea){var _0x23921b=typeof _0x126a7b[_0x8390('0x1f')]==='undefined'&&typeof _0x126a7b[_0x8390('0x20')]===_0x8390('0x21');var _0x1ab3e2=_0x5825ea[_0x8390('0x22')];var _0x23603f=_0x23921b?0x0:_0x126a7b[_0x8390('0x1f')];var _0x589e20=_0x23921b?_0x5825ea[_0x8390('0x22')]:_0x126a7b[_0x8390('0x1f')]+_0x126a7b['limit'];var _0x55bc66;if(_0x589e20>=_0x1ab3e2){_0x589e20=_0x1ab3e2;_0x55bc66=0xc8;}else{_0x55bc66=0xce;}_0x118d79[_0x8390('0x1d')](_0x55bc66);return _0x118d79[_0x8390('0x23')](_0x8390('0x24'),_0x23603f+'-'+_0x589e20+'/'+_0x1ab3e2)[_0x8390('0x25')](_0x5825ea);}return null;};}function patchUpdates(_0x39b656){return function(_0x5a8464){try{jsonpatch[_0x8390('0x26')](_0x5a8464,_0x39b656,!![]);}catch(_0x583b7d){return BPromise[_0x8390('0x27')](_0x583b7d);}return _0x5a8464[_0x8390('0x28')]();};}function saveUpdates(_0x26ef4e,_0x53edad){return function(_0x499e2b){if(_0x499e2b){return _0x499e2b[_0x8390('0x29')](_0x26ef4e)[_0x8390('0x2a')](function(_0x29cac9){return _0x29cac9;});}return null;};}function removeEntity(_0x17629c,_0x4f25c8){return function(_0x8d4505){if(_0x8d4505){return _0x8d4505[_0x8390('0x2b')]()['then'](function(){_0x17629c[_0x8390('0x1d')](0xcc)[_0x8390('0x1e')]();});}};}function handleEntityNotFound(_0x32f81b,_0x2996aa){return function(_0x358228){if(!_0x358228){_0x32f81b[_0x8390('0x2c')](0x194);}return _0x358228;};}function handleError(_0xa45e7a,_0x51dc4b){_0x51dc4b=_0x51dc4b||0x1f4;return function(_0x4f164c){logger[_0x8390('0x2d')](_0x4f164c['stack']);if(_0x4f164c['name']){delete _0x4f164c[_0x8390('0x2e')];}_0xa45e7a[_0x8390('0x1d')](_0x51dc4b)[_0x8390('0x2f')](_0x4f164c);};}exports['index']=function(_0x4d6b01,_0x524685){var _0x30bfb2={},_0x36e4b2={},_0x29872f={'count':0x0,'rows':[]};var _0x388065=_[_0x8390('0x30')](db['VoiceQueueReport'][_0x8390('0x31')],function(_0x51b11e){return{'name':_0x51b11e[_0x8390('0x32')],'type':_0x51b11e[_0x8390('0x33')][_0x8390('0x34')]};});_0x36e4b2[_0x8390('0x35')]=_['map'](_0x388065,_0x8390('0x2e'));_0x36e4b2[_0x8390('0x36')]=_[_0x8390('0x37')](_0x4d6b01[_0x8390('0x36')]);_0x36e4b2[_0x8390('0x38')]=_[_0x8390('0x39')](_0x36e4b2['model'],_0x36e4b2[_0x8390('0x36')]);_0x30bfb2[_0x8390('0x3a')]=_[_0x8390('0x39')](_0x36e4b2[_0x8390('0x35')],qs[_0x8390('0x3b')](_0x4d6b01[_0x8390('0x36')][_0x8390('0x3b')]));_0x30bfb2[_0x8390('0x3a')]=_0x30bfb2[_0x8390('0x3a')]['length']?_0x30bfb2['attributes']:_0x36e4b2[_0x8390('0x35')];if(!_0x4d6b01[_0x8390('0x36')]['hasOwnProperty'](_0x8390('0x3c'))){_0x30bfb2[_0x8390('0x20')]=qs[_0x8390('0x20')](_0x4d6b01[_0x8390('0x36')]['limit']);_0x30bfb2[_0x8390('0x1f')]=qs[_0x8390('0x1f')](_0x4d6b01[_0x8390('0x36')][_0x8390('0x1f')]);}_0x30bfb2['order']=qs[_0x8390('0x3d')](_0x4d6b01[_0x8390('0x36')][_0x8390('0x3d')]);_0x30bfb2[_0x8390('0x3e')]=qs['filters'](_[_0x8390('0x3f')](_0x4d6b01['query'],_0x36e4b2['filters']),_0x388065);if(_0x4d6b01[_0x8390('0x36')][_0x8390('0x40')]){_0x30bfb2[_0x8390('0x3e')]=_[_0x8390('0x41')](_0x30bfb2[_0x8390('0x3e')],{'$or':_['map'](_0x388065,function(_0x27433d){if(_0x27433d[_0x8390('0x33')]!==_0x8390('0x42')){var _0x31d766={};_0x31d766[_0x27433d[_0x8390('0x2e')]]={'$like':'%'+_0x4d6b01['query'][_0x8390('0x40')]+'%'};return _0x31d766;}})});}_0x30bfb2=_[_0x8390('0x41')]({},_0x30bfb2,_0x4d6b01[_0x8390('0x43')]);var _0x270e48={'where':_0x30bfb2['where']};return db[_0x8390('0x44')][_0x8390('0x22')](_0x270e48)[_0x8390('0x2a')](function(_0x51615e){_0x29872f[_0x8390('0x22')]=_0x51615e;if(_0x4d6b01[_0x8390('0x36')][_0x8390('0x45')]){_0x30bfb2[_0x8390('0x46')]=[{'all':!![]}];}return db[_0x8390('0x44')]['findAll'](_0x30bfb2);})['then'](function(_0x41984a){_0x29872f[_0x8390('0x47')]=_0x41984a;return _0x29872f;})['then'](respondWithFilteredResult(_0x524685,_0x30bfb2))[_0x8390('0x48')](handleError(_0x524685,null));};exports[_0x8390('0x49')]=function(_0x44e3c9,_0x4f37e1){var _0x3a02c2={'raw':![],'where':{'id':_0x44e3c9[_0x8390('0x4a')]['id']}},_0x367f62={};_0x367f62['model']=_[_0x8390('0x37')](db[_0x8390('0x44')][_0x8390('0x31')]);_0x367f62[_0x8390('0x36')]=_[_0x8390('0x37')](_0x44e3c9[_0x8390('0x36')]);_0x367f62[_0x8390('0x38')]=_['intersection'](_0x367f62[_0x8390('0x35')],_0x367f62[_0x8390('0x36')]);_0x3a02c2[_0x8390('0x3a')]=_[_0x8390('0x39')](_0x367f62['model'],qs[_0x8390('0x3b')](_0x44e3c9[_0x8390('0x36')][_0x8390('0x3b')]));_0x3a02c2[_0x8390('0x3a')]=_0x3a02c2[_0x8390('0x3a')][_0x8390('0x4b')]?_0x3a02c2[_0x8390('0x3a')]:_0x367f62[_0x8390('0x35')];if(_0x44e3c9[_0x8390('0x36')][_0x8390('0x45')]){_0x3a02c2[_0x8390('0x46')]=[{'all':!![]}];}_0x3a02c2=_[_0x8390('0x41')]({},_0x3a02c2,_0x44e3c9[_0x8390('0x43')]);return db['VoiceQueueReport'][_0x8390('0x4c')](_0x3a02c2)[_0x8390('0x2a')](handleEntityNotFound(_0x4f37e1,null))[_0x8390('0x2a')](respondWithResult(_0x4f37e1,null))[_0x8390('0x48')](handleError(_0x4f37e1,null));};exports[_0x8390('0x4d')]=function(_0x250fbf,_0x25f32a){return db['VoiceQueueReport'][_0x8390('0x4d')](_0x250fbf[_0x8390('0x4e')],{})['then'](respondWithResult(_0x25f32a,0xc9))[_0x8390('0x48')](handleError(_0x25f32a,null));};exports[_0x8390('0x29')]=function(_0x101743,_0x11ec18){if(_0x101743[_0x8390('0x4e')]['id']){delete _0x101743[_0x8390('0x4e')]['id'];}return db[_0x8390('0x44')][_0x8390('0x4c')]({'where':{'id':_0x101743[_0x8390('0x4a')]['id']}})[_0x8390('0x2a')](handleEntityNotFound(_0x11ec18,null))[_0x8390('0x2a')](saveUpdates(_0x101743[_0x8390('0x4e')],null))[_0x8390('0x2a')](respondWithResult(_0x11ec18,null))[_0x8390('0x48')](handleError(_0x11ec18,null));};exports[_0x8390('0x2b')]=function(_0x438aec,_0x3a44fa){return db[_0x8390('0x44')]['find']({'where':{'id':_0x438aec[_0x8390('0x4a')]['id']}})[_0x8390('0x2a')](handleEntityNotFound(_0x3a44fa,null))['then'](removeEntity(_0x3a44fa,null))[_0x8390('0x48')](handleError(_0x3a44fa,null));};exports[_0x8390('0x4f')]=function(_0x3ee084,_0x40e012){return db[_0x8390('0x44')]['describe']()['then'](respondWithResult(_0x40e012,null))[_0x8390('0x48')](handleError(_0x40e012,null));};exports['getVoiceQueuesReport']=function(_0x24021c,_0x8a4896){var _0x41b531={},_0xf485f4={},_0x44ef6b={'count':0x0,'rows':[]};_0xf485f4[_0x8390('0x35')]=_['keys'](db['VoiceQueueReport'][_0x8390('0x31')]);_0xf485f4[_0x8390('0x36')]=_[_0x8390('0x37')](_0x24021c[_0x8390('0x36')]);_0xf485f4['filters']=_[_0x8390('0x39')](_0xf485f4[_0x8390('0x35')],_0xf485f4[_0x8390('0x36')]);_0x41b531[_0x8390('0x3a')]=_[_0x8390('0x39')](_0xf485f4[_0x8390('0x35')],qs[_0x8390('0x3b')](_0x24021c[_0x8390('0x36')][_0x8390('0x3b')]));_0x41b531[_0x8390('0x3a')]=_0x41b531['attributes'][_0x8390('0x4b')]?_0x41b531['attributes']:_0xf485f4[_0x8390('0x35')];if(!_0x24021c['query']['hasOwnProperty'](_0x8390('0x3c'))){_0x41b531[_0x8390('0x20')]=qs[_0x8390('0x20')](_0x24021c[_0x8390('0x36')][_0x8390('0x20')]);_0x41b531[_0x8390('0x1f')]=qs[_0x8390('0x1f')](_0x24021c[_0x8390('0x36')][_0x8390('0x1f')]);}_0x41b531[_0x8390('0x50')]=qs[_0x8390('0x3d')](_0x24021c[_0x8390('0x36')]['sort']);_0x41b531['where']=qs['filters'](_[_0x8390('0x3f')](_0x24021c[_0x8390('0x36')],_0xf485f4['filters']));if(_0x24021c[_0x8390('0x36')]['filter']){_0x41b531[_0x8390('0x3e')]=_['merge'](_0x41b531[_0x8390('0x3e')],{'$or':_[_0x8390('0x30')](_0x41b531[_0x8390('0x3a')],function(_0x17bf13){var _0xcfb3cb={};_0xcfb3cb[_0x17bf13]={'$like':'%'+_0x24021c['query']['filter']+'%'};return _0xcfb3cb;})});}_0x41b531=_[_0x8390('0x41')]({},_0x41b531,_0x24021c[_0x8390('0x43')]);var _0x9d841a={'where':_0x41b531['where']};return db['VoiceQueueReport'][_0x8390('0x22')](_0x9d841a)[_0x8390('0x2a')](function(_0x4f5bd7){_0x44ef6b[_0x8390('0x22')]=_0x4f5bd7;if(_0x24021c['query']['includeAll']){_0x41b531[_0x8390('0x46')]=[{'all':!![]}];}return db[_0x8390('0x44')][_0x8390('0x51')](_0x41b531);})[_0x8390('0x2a')](function(_0x2251a3){_0x44ef6b[_0x8390('0x47')]=_0x2251a3;return _0x44ef6b;})[_0x8390('0x2a')](respondWithFilteredResult(_0x8a4896,_0x41b531,_0x8390('0x52')))[_0x8390('0x48')](handleError(_0x8a4896,null,_0x8390('0x52')));}; \ No newline at end of file +var _0x94ad=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','count','limit','set','save','then','destroy','end','sendStatus','error','stack','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','length','attributes','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','catch','create','update','body','find','params','describe','hasOwnProperty','order','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x3f9a1b,_0x474051){var _0xb419cd=function(_0x5a8633){while(--_0x5a8633){_0x3f9a1b['push'](_0x3f9a1b['shift']());}};_0xb419cd(++_0x474051);}(_0x94ad,0x1e0));var _0xd94a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x94ad[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0xd94a('0x0'));var rimraf=require(_0xd94a('0x1'));var zipdir=require(_0xd94a('0x2'));var jsonpatch=require(_0xd94a('0x3'));var rp=require(_0xd94a('0x4'));var moment=require(_0xd94a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd94a('0x6'));var util=require(_0xd94a('0x7'));var path=require('path');var sox=require(_0xd94a('0x8'));var csv=require('to-csv');var ejs=require(_0xd94a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd94a('0xa'));var squel=require(_0xd94a('0xb'));var crypto=require(_0xd94a('0xc'));var jsforce=require(_0xd94a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd94a('0xe'));var querystring=require(_0xd94a('0xf'));var Papa=require(_0xd94a('0x10'));var Redis=require(_0xd94a('0x11'));var authService=require(_0xd94a('0x12'));var qs=require(_0xd94a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd94a('0x14'));var logger=require(_0xd94a('0x15'))(_0xd94a('0x16'));var utils=require(_0xd94a('0x17'));var config=require(_0xd94a('0x18'));var licenseUtil=require(_0xd94a('0x19'));var db=require(_0xd94a('0x1a'))['db'];config[_0xd94a('0x1b')]=_['defaults'](config['redis'],{'host':_0xd94a('0x1c'),'port':0x18eb});var socket=require(_0xd94a('0x1d'))(new Redis(config['redis']));require(_0xd94a('0x1e'))[_0xd94a('0x1f')](socket);function respondWithStatusCode(_0x1649c3,_0x967673){_0x967673=_0x967673||0xcc;return function(_0x5b8ae2){if(_0x5b8ae2){return _0x1649c3['sendStatus'](_0x967673);}return _0x1649c3['status'](_0x967673)['end']();};}function respondWithResult(_0x2e7448,_0x1133a0){_0x1133a0=_0x1133a0||0xc8;return function(_0x155f19){if(_0x155f19){return _0x2e7448[_0xd94a('0x20')](_0x1133a0)[_0xd94a('0x21')](_0x155f19);}};}function respondWithFilteredResult(_0x5c7f2d,_0x55c9cf){return function(_0x3c59bb){if(_0x3c59bb){var _0x2312d5=typeof _0x55c9cf[_0xd94a('0x22')]==='undefined'&&typeof _0x55c9cf['limit']===_0xd94a('0x23');var _0x4c1a29=_0x3c59bb[_0xd94a('0x24')];var _0x2d42c4=_0x2312d5?0x0:_0x55c9cf[_0xd94a('0x22')];var _0x486501=_0x2312d5?_0x3c59bb[_0xd94a('0x24')]:_0x55c9cf[_0xd94a('0x22')]+_0x55c9cf[_0xd94a('0x25')];var _0x125589;if(_0x486501>=_0x4c1a29){_0x486501=_0x4c1a29;_0x125589=0xc8;}else{_0x125589=0xce;}_0x5c7f2d[_0xd94a('0x20')](_0x125589);return _0x5c7f2d[_0xd94a('0x26')]('Content-Range',_0x2d42c4+'-'+_0x486501+'/'+_0x4c1a29)[_0xd94a('0x21')](_0x3c59bb);}return null;};}function patchUpdates(_0x25a773){return function(_0x5b647b){try{jsonpatch['apply'](_0x5b647b,_0x25a773,!![]);}catch(_0x2f27c0){return BPromise['reject'](_0x2f27c0);}return _0x5b647b[_0xd94a('0x27')]();};}function saveUpdates(_0x1a3b51,_0x2d5639){return function(_0x1ae79b){if(_0x1ae79b){return _0x1ae79b['update'](_0x1a3b51)[_0xd94a('0x28')](function(_0x5889bf){return _0x5889bf;});}return null;};}function removeEntity(_0x34e36c,_0x2bf5e9){return function(_0x375719){if(_0x375719){return _0x375719[_0xd94a('0x29')]()['then'](function(){_0x34e36c[_0xd94a('0x20')](0xcc)[_0xd94a('0x2a')]();});}};}function handleEntityNotFound(_0x2e5e79,_0x5d26ed){return function(_0x3c78be){if(!_0x3c78be){_0x2e5e79[_0xd94a('0x2b')](0x194);}return _0x3c78be;};}function handleError(_0x3f9a29,_0x3e0489){_0x3e0489=_0x3e0489||0x1f4;return function(_0x39a290){logger[_0xd94a('0x2c')](_0x39a290[_0xd94a('0x2d')]);if(_0x39a290['name']){delete _0x39a290['name'];}_0x3f9a29[_0xd94a('0x20')](_0x3e0489)['send'](_0x39a290);};}exports['index']=function(_0x127d90,_0x371e98){var _0x2bb283={},_0x3df9fc={},_0x3216ba={'count':0x0,'rows':[]};var _0x5ea7ed=_['map'](db['VoiceQueueReport'][_0xd94a('0x2e')],function(_0x269176){return{'name':_0x269176[_0xd94a('0x2f')],'type':_0x269176[_0xd94a('0x30')][_0xd94a('0x31')]};});_0x3df9fc[_0xd94a('0x32')]=_['map'](_0x5ea7ed,_0xd94a('0x33'));_0x3df9fc[_0xd94a('0x34')]=_[_0xd94a('0x35')](_0x127d90[_0xd94a('0x34')]);_0x3df9fc['filters']=_[_0xd94a('0x36')](_0x3df9fc[_0xd94a('0x32')],_0x3df9fc[_0xd94a('0x34')]);_0x2bb283['attributes']=_[_0xd94a('0x36')](_0x3df9fc[_0xd94a('0x32')],qs[_0xd94a('0x37')](_0x127d90[_0xd94a('0x34')][_0xd94a('0x37')]));_0x2bb283['attributes']=_0x2bb283['attributes'][_0xd94a('0x38')]?_0x2bb283[_0xd94a('0x39')]:_0x3df9fc[_0xd94a('0x32')];if(!_0x127d90[_0xd94a('0x34')]['hasOwnProperty'](_0xd94a('0x3a'))){_0x2bb283[_0xd94a('0x25')]=qs[_0xd94a('0x25')](_0x127d90[_0xd94a('0x34')]['limit']);_0x2bb283[_0xd94a('0x22')]=qs['offset'](_0x127d90[_0xd94a('0x34')][_0xd94a('0x22')]);}_0x2bb283['order']=qs['sort'](_0x127d90[_0xd94a('0x34')][_0xd94a('0x3b')]);_0x2bb283['where']=qs[_0xd94a('0x3c')](_[_0xd94a('0x3d')](_0x127d90[_0xd94a('0x34')],_0x3df9fc['filters']),_0x5ea7ed);if(_0x127d90[_0xd94a('0x34')][_0xd94a('0x3e')]){_0x2bb283[_0xd94a('0x3f')]=_[_0xd94a('0x40')](_0x2bb283[_0xd94a('0x3f')],{'$or':_[_0xd94a('0x41')](_0x5ea7ed,function(_0xc11af2){if(_0xc11af2['type']!==_0xd94a('0x42')){var _0x49fdbb={};_0x49fdbb[_0xc11af2[_0xd94a('0x33')]]={'$like':'%'+_0x127d90['query'][_0xd94a('0x3e')]+'%'};return _0x49fdbb;}})});}_0x2bb283=_[_0xd94a('0x40')]({},_0x2bb283,_0x127d90[_0xd94a('0x43')]);var _0x40daf1={'where':_0x2bb283[_0xd94a('0x3f')]};return db['VoiceQueueReport'][_0xd94a('0x24')](_0x40daf1)[_0xd94a('0x28')](function(_0x2d2338){_0x3216ba[_0xd94a('0x24')]=_0x2d2338;if(_0x127d90[_0xd94a('0x34')][_0xd94a('0x44')]){_0x2bb283[_0xd94a('0x45')]=[{'all':!![]}];}return db[_0xd94a('0x46')][_0xd94a('0x47')](_0x2bb283);})['then'](function(_0x1488a0){_0x3216ba[_0xd94a('0x48')]=_0x1488a0;return _0x3216ba;})[_0xd94a('0x28')](respondWithFilteredResult(_0x371e98,_0x2bb283))[_0xd94a('0x49')](handleError(_0x371e98,null));};exports['show']=function(_0x28de9b,_0x1ee058){var _0x57f9e1={'raw':![],'where':{'id':_0x28de9b['params']['id']}},_0x49ad47={};_0x49ad47[_0xd94a('0x32')]=_[_0xd94a('0x35')](db[_0xd94a('0x46')][_0xd94a('0x2e')]);_0x49ad47['query']=_[_0xd94a('0x35')](_0x28de9b[_0xd94a('0x34')]);_0x49ad47['filters']=_[_0xd94a('0x36')](_0x49ad47[_0xd94a('0x32')],_0x49ad47[_0xd94a('0x34')]);_0x57f9e1['attributes']=_['intersection'](_0x49ad47[_0xd94a('0x32')],qs['fields'](_0x28de9b[_0xd94a('0x34')]['fields']));_0x57f9e1['attributes']=_0x57f9e1['attributes'][_0xd94a('0x38')]?_0x57f9e1[_0xd94a('0x39')]:_0x49ad47['model'];if(_0x28de9b['query'][_0xd94a('0x44')]){_0x57f9e1[_0xd94a('0x45')]=[{'all':!![]}];}_0x57f9e1=_[_0xd94a('0x40')]({},_0x57f9e1,_0x28de9b[_0xd94a('0x43')]);return db[_0xd94a('0x46')]['find'](_0x57f9e1)[_0xd94a('0x28')](handleEntityNotFound(_0x1ee058,null))[_0xd94a('0x28')](respondWithResult(_0x1ee058,null))[_0xd94a('0x49')](handleError(_0x1ee058,null));};exports[_0xd94a('0x4a')]=function(_0x2ad0e0,_0x54ceba){return db[_0xd94a('0x46')]['create'](_0x2ad0e0['body'],{})['then'](respondWithResult(_0x54ceba,0xc9))[_0xd94a('0x49')](handleError(_0x54ceba,null));};exports[_0xd94a('0x4b')]=function(_0x2f7769,_0x31962b){if(_0x2f7769[_0xd94a('0x4c')]['id']){delete _0x2f7769[_0xd94a('0x4c')]['id'];}return db['VoiceQueueReport'][_0xd94a('0x4d')]({'where':{'id':_0x2f7769[_0xd94a('0x4e')]['id']}})[_0xd94a('0x28')](handleEntityNotFound(_0x31962b,null))[_0xd94a('0x28')](saveUpdates(_0x2f7769[_0xd94a('0x4c')],null))[_0xd94a('0x28')](respondWithResult(_0x31962b,null))[_0xd94a('0x49')](handleError(_0x31962b,null));};exports[_0xd94a('0x29')]=function(_0xac7846,_0x14216c){return db['VoiceQueueReport'][_0xd94a('0x4d')]({'where':{'id':_0xac7846[_0xd94a('0x4e')]['id']}})[_0xd94a('0x28')](handleEntityNotFound(_0x14216c,null))['then'](removeEntity(_0x14216c,null))[_0xd94a('0x49')](handleError(_0x14216c,null));};exports[_0xd94a('0x4f')]=function(_0x5a7ab8,_0x339c3f){return db[_0xd94a('0x46')]['describe']()['then'](respondWithResult(_0x339c3f,null))[_0xd94a('0x49')](handleError(_0x339c3f,null));};exports['getVoiceQueuesReport']=function(_0x3c3fef,_0x269a9d){var _0x4d2a5a={},_0x32c662={},_0x2fdf7b={'count':0x0,'rows':[]};_0x32c662[_0xd94a('0x32')]=_[_0xd94a('0x35')](db[_0xd94a('0x46')]['rawAttributes']);_0x32c662[_0xd94a('0x34')]=_[_0xd94a('0x35')](_0x3c3fef['query']);_0x32c662[_0xd94a('0x3c')]=_[_0xd94a('0x36')](_0x32c662[_0xd94a('0x32')],_0x32c662[_0xd94a('0x34')]);_0x4d2a5a[_0xd94a('0x39')]=_[_0xd94a('0x36')](_0x32c662[_0xd94a('0x32')],qs[_0xd94a('0x37')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x37')]));_0x4d2a5a['attributes']=_0x4d2a5a[_0xd94a('0x39')][_0xd94a('0x38')]?_0x4d2a5a['attributes']:_0x32c662['model'];if(!_0x3c3fef['query'][_0xd94a('0x50')](_0xd94a('0x3a'))){_0x4d2a5a[_0xd94a('0x25')]=qs[_0xd94a('0x25')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x25')]);_0x4d2a5a[_0xd94a('0x22')]=qs[_0xd94a('0x22')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x22')]);}_0x4d2a5a[_0xd94a('0x51')]=qs[_0xd94a('0x3b')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x3b')]);_0x4d2a5a[_0xd94a('0x3f')]=qs[_0xd94a('0x3c')](_['pick'](_0x3c3fef[_0xd94a('0x34')],_0x32c662['filters']));if(_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x3e')]){_0x4d2a5a[_0xd94a('0x3f')]=_[_0xd94a('0x40')](_0x4d2a5a[_0xd94a('0x3f')],{'$or':_[_0xd94a('0x41')](_0x4d2a5a[_0xd94a('0x39')],function(_0x4a5b4c){var _0x19eed9={};_0x19eed9[_0x4a5b4c]={'$like':'%'+_0x3c3fef[_0xd94a('0x34')]['filter']+'%'};return _0x19eed9;})});}_0x4d2a5a=_[_0xd94a('0x40')]({},_0x4d2a5a,_0x3c3fef[_0xd94a('0x43')]);var _0x4d5619={'where':_0x4d2a5a[_0xd94a('0x3f')]};return db['VoiceQueueReport']['count'](_0x4d5619)[_0xd94a('0x28')](function(_0xe5d874){_0x2fdf7b['count']=_0xe5d874;if(_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x44')]){_0x4d2a5a[_0xd94a('0x45')]=[{'all':!![]}];}return db[_0xd94a('0x46')][_0xd94a('0x47')](_0x4d2a5a);})[_0xd94a('0x28')](function(_0x2412f0){_0x2fdf7b[_0xd94a('0x48')]=_0x2412f0;return _0x2fdf7b;})[_0xd94a('0x28')](respondWithFilteredResult(_0x269a9d,_0x4d2a5a,_0xd94a('0x52')))[_0xd94a('0x49')](handleError(_0x269a9d,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 90311ce..09d4234 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 _0x85a1=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1e070a,_0x8533d4){var _0x4d0c63=function(_0x346e08){while(--_0x346e08){_0x1e070a['push'](_0x1e070a['shift']());}};_0x4d0c63(++_0x8533d4);}(_0x85a1,0xef));var _0x185a=function(_0xd8897b,_0x116f4c){_0xd8897b=_0xd8897b-0x0;var _0x29b445=_0x85a1[_0xd8897b];return _0x29b445;};'use strict';var EventEmitter=require(_0x185a('0x0'));var VoiceQueueReport=require(_0x185a('0x1'))['db'][_0x185a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x185a('0x3')](0x0);var events={'afterCreate':_0x185a('0x4'),'afterUpdate':_0x185a('0x5'),'afterDestroy':_0x185a('0x6')};function emitEvent(_0x37a904){return function(_0x17a5c9,_0x29a165,_0xc3dcea){VoiceQueueReportEvents[_0x185a('0x7')](_0x37a904+':'+_0x17a5c9['id'],_0x17a5c9);VoiceQueueReportEvents[_0x185a('0x7')](_0x37a904,_0x17a5c9);_0xc3dcea(null);};}for(var e in events){if(events[_0x185a('0x8')](e)){var event=events[e];VoiceQueueReport[_0x185a('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x5246=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x33dc1d,_0xb317a4){var _0x17d90d=function(_0x112f18){while(--_0x112f18){_0x33dc1d['push'](_0x33dc1d['shift']());}};_0x17d90d(++_0xb317a4);}(_0x5246,0xd0));var _0x6524=function(_0x3e740c,_0xb77831){_0x3e740c=_0x3e740c-0x0;var _0x3e40b3=_0x5246[_0x3e740c];return _0x3e40b3;};'use strict';var EventEmitter=require(_0x6524('0x0'));var VoiceQueueReport=require(_0x6524('0x1'))['db'][_0x6524('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6524('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6524('0x4')};function emitEvent(_0x8dc005){return function(_0x36f7ee,_0x4dd19a,_0x542e71){VoiceQueueReportEvents[_0x6524('0x5')](_0x8dc005+':'+_0x36f7ee['id'],_0x36f7ee);VoiceQueueReportEvents[_0x6524('0x5')](_0x8dc005,_0x36f7ee);_0x542e71(null);};}for(var e in events){if(events[_0x6524('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x6524('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 692f83e..70d7f38 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 _0xd892=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xd892,0x103));var _0x2d89=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xd892[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x2d89('0x0'));var util=require('util');var logger=require(_0x2d89('0x1'))(_0x2d89('0x2'));var moment=require(_0x2d89('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d89('0x4'));var fs=require('fs');var path=require(_0x2d89('0x5'));var rimraf=require(_0x2d89('0x6'));var config=require(_0x2d89('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x2d89('0x8')]=function(_0x1d1bb4,_0x4c51b9){return _0x1d1bb4['define'](_0x2d89('0x9'),attributes,{'tableName':_0x2d89('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2d89('0xb')]},{'fields':[_0x2d89('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3472=['request-promise','rimraf','./voiceQueueReport.attributes','exports','report_queue','util','../../config/logger','moment','bluebird'];(function(_0x3333bb,_0x1df222){var _0x273d39=function(_0x5c411b){while(--_0x5c411b){_0x3333bb['push'](_0x3333bb['shift']());}};_0x273d39(++_0x1df222);}(_0x3472,0xf8));var _0x2347=function(_0x1c8ba3,_0x4cdef6){_0x1c8ba3=_0x1c8ba3-0x0;var _0x2d16bd=_0x3472[_0x1c8ba3];return _0x2d16bd;};'use strict';var _=require('lodash');var util=require(_0x2347('0x0'));var logger=require(_0x2347('0x1'))('api');var moment=require(_0x2347('0x2'));var BPromise=require(_0x2347('0x3'));var rp=require(_0x2347('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2347('0x5'));var config=require('../../config/environment');var attributes=require(_0x2347('0x6'));module[_0x2347('0x7')]=function(_0x48c8ac,_0x6ded3){return _0x48c8ac['define']('VoiceQueueReport',attributes,{'tableName':_0x2347('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 3ba4002..c639fbd 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 _0x7c70=['info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','model','map','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','update','where','UpdateVoiceQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c70,0x11c));var _0x07c7=function(_0x49b343,_0x89e908){_0x49b343=_0x49b343-0x0;var _0x44621b=_0x7c70[_0x49b343];return _0x44621b;};'use strict';var _=require(_0x07c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x07c7('0x1'));var rs=require(_0x07c7('0x2'));var fs=require('fs');var Redis=require(_0x07c7('0x3'));var db=require(_0x07c7('0x4'))['db'];var utils=require(_0x07c7('0x5'));var logger=require(_0x07c7('0x6'))(_0x07c7('0x7'));var config=require('../../config/environment');var jayson=require(_0x07c7('0x8'));var client=jayson['client'][_0x07c7('0x9')]({'port':0x232a});config['redis']=_[_0x07c7('0xa')](config['redis'],{'host':_0x07c7('0xb'),'port':0x18eb});var socket=require(_0x07c7('0xc'))(new Redis(config[_0x07c7('0xd')]));require(_0x07c7('0xe'))[_0x07c7('0xf')](socket);function respondWithRpcPromise(_0x3aa6cc,_0x4a2829,_0x24d424){return new BPromise(function(_0x2cdd63,_0x1397bf){return client['request'](_0x3aa6cc,_0x24d424)[_0x07c7('0x10')](function(_0x54c58e){logger[_0x07c7('0x11')](_0x07c7('0x12'),_0x4a2829,_0x07c7('0x13'));logger[_0x07c7('0x14')](_0x07c7('0x15'),_0x4a2829,_0x07c7('0x13'),JSON['stringify'](_0x54c58e));if(_0x54c58e[_0x07c7('0x16')]){if(_0x54c58e['error'][_0x07c7('0x17')]===0x1f4){logger[_0x07c7('0x16')](_0x07c7('0x12'),_0x4a2829,_0x54c58e[_0x07c7('0x16')][_0x07c7('0x18')]);return _0x1397bf(_0x54c58e[_0x07c7('0x16')][_0x07c7('0x18')]);}logger[_0x07c7('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x4a2829,_0x54c58e[_0x07c7('0x16')][_0x07c7('0x18')]);return _0x2cdd63(_0x54c58e[_0x07c7('0x16')]['message']);}else{logger[_0x07c7('0x11')](_0x07c7('0x12'),_0x4a2829,_0x07c7('0x13'));_0x2cdd63(_0x54c58e[_0x07c7('0x19')][_0x07c7('0x18')]);}})[_0x07c7('0x1a')](function(_0x263a2f){logger['error'](_0x07c7('0x12'),_0x4a2829,_0x263a2f);_0x1397bf(_0x263a2f);});});}exports['GetVoiceQueueReport']=function(_0x3a57e8){var _0x179f61=this;return new Promise(function(_0x3e2083,_0x337583){return db['VoiceQueueReport'][_0x07c7('0x1b')]({'raw':_0x3a57e8[_0x07c7('0x1c')]?_0x3a57e8[_0x07c7('0x1c')][_0x07c7('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a57e8[_0x07c7('0x1c')]?_0x3a57e8[_0x07c7('0x1c')]['where']||null:null,'attributes':_0x3a57e8[_0x07c7('0x1c')]?_0x3a57e8[_0x07c7('0x1c')][_0x07c7('0x1e')]||null:null,'limit':_0x3a57e8[_0x07c7('0x1c')]?_0x3a57e8['options'][_0x07c7('0x1f')]||null:null,'include':_0x3a57e8[_0x07c7('0x1c')]?_0x3a57e8[_0x07c7('0x1c')]['include']?_['map'](_0x3a57e8[_0x07c7('0x1c')][_0x07c7('0x20')],function(_0x3f8c29){return{'model':db[_0x3f8c29[_0x07c7('0x21')]],'as':_0x3f8c29['as'],'attributes':_0x3f8c29[_0x07c7('0x1e')],'include':_0x3f8c29[_0x07c7('0x20')]?_[_0x07c7('0x22')](_0x3f8c29[_0x07c7('0x20')],function(_0x29ea11){return{'model':db[_0x29ea11[_0x07c7('0x21')]],'as':_0x29ea11['as'],'attributes':_0x29ea11[_0x07c7('0x1e')],'include':_0x29ea11[_0x07c7('0x20')]?_[_0x07c7('0x22')](_0x29ea11[_0x07c7('0x20')],function(_0xfd4db0){return{'model':db[_0xfd4db0[_0x07c7('0x21')]],'as':_0xfd4db0['as'],'attributes':_0xfd4db0[_0x07c7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x07c7('0x10')](function(_0x5eb854){logger[_0x07c7('0x11')](_0x07c7('0x23'),_0x3a57e8);logger[_0x07c7('0x14')]('GetVoiceQueueReport',_0x3a57e8,JSON[_0x07c7('0x24')](_0x5eb854));_0x3e2083(_0x5eb854);})[_0x07c7('0x1a')](function(_0x8efdb1){logger[_0x07c7('0x16')](_0x07c7('0x23'),_0x8efdb1[_0x07c7('0x18')],_0x3a57e8);_0x337583(_0x179f61[_0x07c7('0x16')](0x1f4,_0x8efdb1[_0x07c7('0x18')]));});});};exports[_0x07c7('0x25')]=function(_0xc77921){var _0x385ff4=this;return new Promise(function(_0x264fb9,_0x16d16e){return db[_0x07c7('0x26')][_0x07c7('0x27')](_0xc77921['body'],{'raw':_0xc77921[_0x07c7('0x1c')]?_0xc77921[_0x07c7('0x1c')][_0x07c7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xfd798c){logger[_0x07c7('0x11')](_0x07c7('0x25'),_0xc77921);logger[_0x07c7('0x14')]('CreateVoiceQueueReport',_0xc77921,JSON['stringify'](_0xfd798c));_0x264fb9(_0xfd798c);})[_0x07c7('0x1a')](function(_0x30b28f){logger[_0x07c7('0x16')]('CreateVoiceQueueReport',_0x30b28f[_0x07c7('0x18')],_0xc77921);_0x16d16e(_0x385ff4[_0x07c7('0x16')](0x1f4,_0x30b28f[_0x07c7('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x28264c){var _0x5d3e70=this;return new Promise(function(_0x304d04,_0x4a0bda){return db['VoiceQueueReport'][_0x07c7('0x28')](_0x28264c['body'],{'raw':_0x28264c[_0x07c7('0x1c')]?_0x28264c[_0x07c7('0x1c')][_0x07c7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28264c[_0x07c7('0x1c')]?_0x28264c['options'][_0x07c7('0x29')]||null:null,'attributes':_0x28264c['options']?_0x28264c[_0x07c7('0x1c')][_0x07c7('0x1e')]||null:null,'limit':_0x28264c[_0x07c7('0x1c')]?_0x28264c[_0x07c7('0x1c')][_0x07c7('0x1f')]||null:null})[_0x07c7('0x10')](function(_0x5a2604){logger[_0x07c7('0x11')]('UpdateVoiceQueueReport',_0x28264c);logger[_0x07c7('0x14')]('UpdateVoiceQueueReport',_0x28264c,JSON[_0x07c7('0x24')](_0x5a2604));_0x304d04(_0x5a2604);})[_0x07c7('0x1a')](function(_0x505093){logger[_0x07c7('0x16')](_0x07c7('0x2a'),_0x505093[_0x07c7('0x18')],_0x28264c);_0x4a0bda(_0x5d3e70['error'](0x1f4,_0x505093['message']));});});}; \ No newline at end of file +var _0xca2e=['jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','info','UpdateVoiceQueueReport','update','where','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x490c64,_0x8a5cb4){var _0x32111a=function(_0x1e7b24){while(--_0x1e7b24){_0x490c64['push'](_0x490c64['shift']());}};_0x32111a(++_0x8a5cb4);}(_0xca2e,0x1bc));var _0xeca2=function(_0x551fb4,_0x477b9c){_0x551fb4=_0x551fb4-0x0;var _0x23e596=_0xca2e[_0x551fb4];return _0x23e596;};'use strict';var _=require(_0xeca2('0x0'));var util=require('util');var moment=require(_0xeca2('0x1'));var BPromise=require(_0xeca2('0x2'));var rs=require(_0xeca2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeca2('0x4'))(_0xeca2('0x5'));var config=require(_0xeca2('0x6'));var jayson=require(_0xeca2('0x7'));var client=jayson[_0xeca2('0x8')][_0xeca2('0x9')]({'port':0x232a});config[_0xeca2('0xa')]=_['defaults'](config[_0xeca2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xeca2('0xb'))(new Redis(config[_0xeca2('0xa')]));require(_0xeca2('0xc'))[_0xeca2('0xd')](socket);function respondWithRpcPromise(_0x1a4e4c,_0x1bb86d,_0x257402){return new BPromise(function(_0x3941da,_0x378206){return client['request'](_0x1a4e4c,_0x257402)[_0xeca2('0xe')](function(_0x133a74){logger['info'](_0xeca2('0xf'),_0x1bb86d,_0xeca2('0x10'));logger['debug'](_0xeca2('0x11'),_0x1bb86d,_0xeca2('0x10'),JSON[_0xeca2('0x12')](_0x133a74));if(_0x133a74[_0xeca2('0x13')]){if(_0x133a74['error'][_0xeca2('0x14')]===0x1f4){logger[_0xeca2('0x13')](_0xeca2('0xf'),_0x1bb86d,_0x133a74[_0xeca2('0x13')][_0xeca2('0x15')]);return _0x378206(_0x133a74[_0xeca2('0x13')][_0xeca2('0x15')]);}logger[_0xeca2('0x13')](_0xeca2('0xf'),_0x1bb86d,_0x133a74[_0xeca2('0x13')]['message']);return _0x3941da(_0x133a74[_0xeca2('0x13')][_0xeca2('0x15')]);}else{logger['info'](_0xeca2('0xf'),_0x1bb86d,'request\x20sent');_0x3941da(_0x133a74[_0xeca2('0x16')]['message']);}})[_0xeca2('0x17')](function(_0x4cbdd1){logger[_0xeca2('0x13')](_0xeca2('0xf'),_0x1bb86d,_0x4cbdd1);_0x378206(_0x4cbdd1);});});}exports['GetVoiceQueueReport']=function(_0x55ae0b){var _0x394db8=this;return new Promise(function(_0x48621c,_0x53bb79){return db[_0xeca2('0x18')][_0xeca2('0x19')]({'raw':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b[_0xeca2('0x1a')][_0xeca2('0x1b')]===undefined?!![]:![]:!![],'where':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b[_0xeca2('0x1a')]['where']||null:null,'attributes':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b['options'][_0xeca2('0x1c')]||null:null,'limit':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b['options'][_0xeca2('0x1d')]||null:null,'include':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b[_0xeca2('0x1a')][_0xeca2('0x1e')]?_['map'](_0x55ae0b[_0xeca2('0x1a')][_0xeca2('0x1e')],function(_0x50fe45){return{'model':db[_0x50fe45[_0xeca2('0x1f')]],'as':_0x50fe45['as'],'attributes':_0x50fe45[_0xeca2('0x1c')],'include':_0x50fe45[_0xeca2('0x1e')]?_['map'](_0x50fe45[_0xeca2('0x1e')],function(_0x46bf45){return{'model':db[_0x46bf45[_0xeca2('0x1f')]],'as':_0x46bf45['as'],'attributes':_0x46bf45[_0xeca2('0x1c')],'include':_0x46bf45[_0xeca2('0x1e')]?_[_0xeca2('0x20')](_0x46bf45[_0xeca2('0x1e')],function(_0x29b69b){return{'model':db[_0x29b69b['model']],'as':_0x29b69b['as'],'attributes':_0x29b69b[_0xeca2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeca2('0xe')](function(_0x8d70b8){logger['info']('GetVoiceQueueReport',_0x55ae0b);logger['debug'](_0xeca2('0x21'),_0x55ae0b,JSON['stringify'](_0x8d70b8));_0x48621c(_0x8d70b8);})[_0xeca2('0x17')](function(_0x27e73b){logger['error'](_0xeca2('0x21'),_0x27e73b['message'],_0x55ae0b);_0x53bb79(_0x394db8[_0xeca2('0x13')](0x1f4,_0x27e73b['message']));});});};exports[_0xeca2('0x22')]=function(_0x29bf1c){var _0x2b8f96=this;return new Promise(function(_0x17c748,_0x4f6e08){return db[_0xeca2('0x18')][_0xeca2('0x23')](_0x29bf1c[_0xeca2('0x24')],{'raw':_0x29bf1c[_0xeca2('0x1a')]?_0x29bf1c[_0xeca2('0x1a')][_0xeca2('0x1b')]===undefined?!![]:![]:!![]})[_0xeca2('0xe')](function(_0x3fd600){logger[_0xeca2('0x25')](_0xeca2('0x22'),_0x29bf1c);logger['debug'](_0xeca2('0x22'),_0x29bf1c,JSON[_0xeca2('0x12')](_0x3fd600));_0x17c748(_0x3fd600);})['catch'](function(_0x1bf619){logger[_0xeca2('0x13')](_0xeca2('0x22'),_0x1bf619['message'],_0x29bf1c);_0x4f6e08(_0x2b8f96['error'](0x1f4,_0x1bf619[_0xeca2('0x15')]));});});};exports[_0xeca2('0x26')]=function(_0x1584df){var _0x3927e2=this;return new Promise(function(_0x8fef9e,_0x5c6721){return db[_0xeca2('0x18')][_0xeca2('0x27')](_0x1584df['body'],{'raw':_0x1584df['options']?_0x1584df[_0xeca2('0x1a')][_0xeca2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1584df[_0xeca2('0x1a')]?_0x1584df['options'][_0xeca2('0x28')]||null:null,'attributes':_0x1584df[_0xeca2('0x1a')]?_0x1584df[_0xeca2('0x1a')][_0xeca2('0x1c')]||null:null,'limit':_0x1584df['options']?_0x1584df['options'][_0xeca2('0x1d')]||null:null})['then'](function(_0x3fbdbb){logger[_0xeca2('0x25')]('UpdateVoiceQueueReport',_0x1584df);logger['debug']('UpdateVoiceQueueReport',_0x1584df,JSON['stringify'](_0x3fbdbb));_0x8fef9e(_0x3fbdbb);})[_0xeca2('0x17')](function(_0x9c25b0){logger['error'](_0xeca2('0x26'),_0x9c25b0['message'],_0x1584df);_0x5c6721(_0x3927e2['error'](0x1f4,_0x9c25b0[_0xeca2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e39c871..a93c59b 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 _0x0eab=['save','remove','update','emit','register','length','./voiceQueueReport.events'];(function(_0x29d790,_0x515357){var _0x8dbe34=function(_0x153f8f){while(--_0x153f8f){_0x29d790['push'](_0x29d790['shift']());}};_0x8dbe34(++_0x515357);}(_0x0eab,0x1d4));var _0xb0ea=function(_0x4a935f,_0x4bee96){_0x4a935f=_0x4a935f-0x0;var _0x490e1b=_0x0eab[_0x4a935f];return _0x490e1b;};'use strict';var VoiceQueueReportEvents=require(_0xb0ea('0x0'));var events=[_0xb0ea('0x1'),_0xb0ea('0x2'),_0xb0ea('0x3')];function createListener(_0x419942,_0x32fc0f){return function(_0x2b4b1c){_0x32fc0f[_0xb0ea('0x4')](_0x419942,_0x2b4b1c);};}function removeListener(_0x24a827,_0x663143){return function(){VoiceQueueReportEvents['removeListener'](_0x24a827,_0x663143);};}exports[_0xb0ea('0x5')]=function(_0x721c00){for(var _0x251758=0x0,_0x136b87=events[_0xb0ea('0x6')];_0x251758<_0x136b87;_0x251758++){var _0x5d3174=events[_0x251758];var _0x1d045f=createListener('voiceQueueReport:'+_0x5d3174,_0x721c00);VoiceQueueReportEvents['on'](_0x5d3174,_0x1d045f);}}; \ No newline at end of file +var _0x8917=['emit','removeListener','length','./voiceQueueReport.events','remove','update'];(function(_0x455745,_0x5a9a82){var _0x29b21b=function(_0x477374){while(--_0x477374){_0x455745['push'](_0x455745['shift']());}};_0x29b21b(++_0x5a9a82);}(_0x8917,0x1d7));var _0x7891=function(_0x464707,_0x4f5da4){_0x464707=_0x464707-0x0;var _0x379110=_0x8917[_0x464707];return _0x379110;};'use strict';var VoiceQueueReportEvents=require(_0x7891('0x0'));var events=['save',_0x7891('0x1'),_0x7891('0x2')];function createListener(_0xfc1628,_0x129608){return function(_0xdf5de1){_0x129608[_0x7891('0x3')](_0xfc1628,_0xdf5de1);};}function removeListener(_0x2b5570,_0x24234b){return function(){VoiceQueueReportEvents[_0x7891('0x4')](_0x2b5570,_0x24234b);};}exports['register']=function(_0x46b52a){for(var _0x43a48e=0x0,_0x442944=events[_0x7891('0x5')];_0x43a48e<_0x442944;_0x43a48e++){var _0x4722b7=events[_0x43a48e];var _0x452a6d=createListener('voiceQueueReport:'+_0x4722b7,_0x46b52a);VoiceQueueReportEvents['on'](_0x4722b7,_0x452a6d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 940ed1d..c660753 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 _0xa33b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x282e59,_0x1f8a37){var _0x14588f=function(_0x13b030){while(--_0x13b030){_0x282e59['push'](_0x282e59['shift']());}};_0x14588f(++_0x1f8a37);}(_0xa33b,0x68));var _0xba33=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa33b[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0xba33('0x0'));var util=require(_0xba33('0x1'));var path=require(_0xba33('0x2'));var timeout=require(_0xba33('0x3'));var express=require(_0xba33('0x4'));var router=express[_0xba33('0x5')]();var fs_extra=require(_0xba33('0x6'));var auth=require(_0xba33('0x7'));var interaction=require(_0xba33('0x8'));var config=require('../../config/environment');var controller=require(_0xba33('0x9'));router['get']('/',auth[_0xba33('0xa')](),controller[_0xba33('0xb')]);router[_0xba33('0xc')](_0xba33('0xd'),auth[_0xba33('0xa')](),controller[_0xba33('0xe')]);router[_0xba33('0xf')]('/',auth[_0xba33('0xa')](),controller['create']);router[_0xba33('0x10')](_0xba33('0xd'),auth[_0xba33('0xa')](),controller[_0xba33('0x11')]);router[_0xba33('0x12')](_0xba33('0xd'),auth[_0xba33('0xa')](),controller[_0xba33('0x13')]);module[_0xba33('0x14')]=router; \ No newline at end of file +var _0x1472=['../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x20cf3c,_0x19f86d){var _0x260bc8=function(_0x1ff89d){while(--_0x1ff89d){_0x20cf3c['push'](_0x20cf3c['shift']());}};_0x260bc8(++_0x19f86d);}(_0x1472,0xe9));var _0x2147=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x1472[_0x1168a1];return _0xcc5ad8;};'use strict';var multer=require(_0x2147('0x0'));var util=require('util');var path=require(_0x2147('0x1'));var timeout=require(_0x2147('0x2'));var express=require('express');var router=express[_0x2147('0x3')]();var fs_extra=require(_0x2147('0x4'));var auth=require(_0x2147('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0x2147('0x6')]('/',auth[_0x2147('0x7')](),controller[_0x2147('0x8')]);router['get']('/:id',auth[_0x2147('0x7')](),controller[_0x2147('0x9')]);router[_0x2147('0xa')]('/',auth[_0x2147('0x7')](),controller[_0x2147('0xb')]);router[_0x2147('0xc')](_0x2147('0xd'),auth[_0x2147('0x7')](),controller[_0x2147('0xe')]);router[_0x2147('0xf')](_0x2147('0xd'),auth[_0x2147('0x7')](),controller[_0x2147('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 4d717d2..adbfc0d 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 _0x5e6f=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x5e6f,0x1c5));var _0xf5e6=function(_0xe4d35a,_0x4bd94d){_0xe4d35a=_0xe4d35a-0x0;var _0x249363=_0x5e6f[_0xe4d35a];return _0x249363;};'use strict';var Sequelize=require(_0xf5e6('0x0'));var moment=require(_0xf5e6('0x1'));module[_0xf5e6('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xf5e6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf5e6('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf5e6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf5e6('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf5e6('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf5e6('0x4')],'allowNull':![],'defaultValue':moment()[_0xf5e6('0x5')](_0xf5e6('0x6'))}}; \ No newline at end of file +var _0xfd1b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','exports','STRING'];(function(_0x3ff19b,_0x1903fb){var _0x8286fc=function(_0x5c7fa4){while(--_0x5c7fa4){_0x3ff19b['push'](_0x3ff19b['shift']());}};_0x8286fc(++_0x1903fb);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x5bedf1,_0x5a8319){_0x5bedf1=_0x5bedf1-0x0;var _0x935a6a=_0xfd1b[_0x5bedf1];return _0x935a6a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xbfd1('0x0')]={'time':{'type':Sequelize[_0xbfd1('0x1')]},'callid':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbfd1('0x2')],'allowNull':![],'defaultValue':moment()[_0xbfd1('0x3')](_0xbfd1('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 9251239..cdf7c55 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 _0xc09d=['keys','filters','intersection','attributes','model','fields','query','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','includeAll','include','VoiceQueuesLog','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc09d,0xfe));var _0xdc09=function(_0x544b1f,_0x260880){_0x544b1f=_0x544b1f-0x0;var _0x20c4c6=_0xc09d[_0x544b1f];return _0x20c4c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc09('0x0'));var zipdir=require(_0xdc09('0x1'));var jsonpatch=require(_0xdc09('0x2'));var rp=require(_0xdc09('0x3'));var moment=require(_0xdc09('0x4'));var BPromise=require(_0xdc09('0x5'));var Mustache=require(_0xdc09('0x6'));var util=require(_0xdc09('0x7'));var path=require(_0xdc09('0x8'));var sox=require('sox');var csv=require(_0xdc09('0x9'));var ejs=require(_0xdc09('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc09('0xb'));var squel=require(_0xdc09('0xc'));var crypto=require(_0xdc09('0xd'));var jsforce=require(_0xdc09('0xe'));var deskjs=require(_0xdc09('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdc09('0x10'));var Papa=require(_0xdc09('0x11'));var Redis=require(_0xdc09('0x12'));var authService=require(_0xdc09('0x13'));var qs=require(_0xdc09('0x14'));var as=require(_0xdc09('0x15'));var hardwareService=require(_0xdc09('0x16'));var logger=require(_0xdc09('0x17'))('api');var utils=require(_0xdc09('0x18'));var config=require(_0xdc09('0x19'));var licenseUtil=require(_0xdc09('0x1a'));var db=require(_0xdc09('0x1b'))['db'];function respondWithStatusCode(_0x516d46,_0x372218){_0x372218=_0x372218||0xcc;return function(_0x2bfcd3){if(_0x2bfcd3){return _0x516d46[_0xdc09('0x1c')](_0x372218);}return _0x516d46[_0xdc09('0x1d')](_0x372218)[_0xdc09('0x1e')]();};}function respondWithResult(_0x42d5b8,_0x360a3a){_0x360a3a=_0x360a3a||0xc8;return function(_0xf1601){if(_0xf1601){return _0x42d5b8['status'](_0x360a3a)[_0xdc09('0x1f')](_0xf1601);}};}function respondWithFilteredResult(_0xde7113,_0x457b80){return function(_0xd868c5){if(_0xd868c5){var _0x1d068e=typeof _0x457b80['offset']===_0xdc09('0x20')&&typeof _0x457b80[_0xdc09('0x21')]===_0xdc09('0x20');var _0x3a9141=_0xd868c5['count'];var _0x2656fb=_0x1d068e?0x0:_0x457b80['offset'];var _0xae9f72=_0x1d068e?_0xd868c5[_0xdc09('0x22')]:_0x457b80['offset']+_0x457b80[_0xdc09('0x21')];var _0x4bd473;if(_0xae9f72>=_0x3a9141){_0xae9f72=_0x3a9141;_0x4bd473=0xc8;}else{_0x4bd473=0xce;}_0xde7113[_0xdc09('0x1d')](_0x4bd473);return _0xde7113['set'](_0xdc09('0x23'),_0x2656fb+'-'+_0xae9f72+'/'+_0x3a9141)[_0xdc09('0x1f')](_0xd868c5);}return null;};}function patchUpdates(_0x53f714){return function(_0x1d2e53){try{jsonpatch[_0xdc09('0x24')](_0x1d2e53,_0x53f714,!![]);}catch(_0x31e132){return BPromise[_0xdc09('0x25')](_0x31e132);}return _0x1d2e53[_0xdc09('0x26')]();};}function saveUpdates(_0x3f4301,_0x25f5b2){return function(_0x184d67){if(_0x184d67){return _0x184d67[_0xdc09('0x27')](_0x3f4301)[_0xdc09('0x28')](function(_0x24b171){return _0x24b171;});}return null;};}function removeEntity(_0xe91317,_0x63f875){return function(_0x31f070){if(_0x31f070){return _0x31f070['destroy']()[_0xdc09('0x28')](function(){_0xe91317[_0xdc09('0x1d')](0xcc)[_0xdc09('0x1e')]();});}};}function handleEntityNotFound(_0x2fffaa,_0x3737f9){return function(_0x417075){if(!_0x417075){_0x2fffaa[_0xdc09('0x1c')](0x194);}return _0x417075;};}function handleError(_0x433a88,_0x27c6fb){_0x27c6fb=_0x27c6fb||0x1f4;return function(_0x1b6826){logger[_0xdc09('0x29')](_0x1b6826[_0xdc09('0x2a')]);if(_0x1b6826[_0xdc09('0x2b')]){delete _0x1b6826[_0xdc09('0x2b')];}_0x433a88[_0xdc09('0x1d')](_0x27c6fb)['send'](_0x1b6826);};}exports[_0xdc09('0x2c')]=function(_0x296367,_0x5f49eb){var _0x599dbd={},_0x2e5886={},_0x2e9486={'count':0x0,'rows':[]};var _0xd6be12=_[_0xdc09('0x2d')](db['VoiceQueuesLog'][_0xdc09('0x2e')],function(_0x1c7013){return{'name':_0x1c7013[_0xdc09('0x2f')],'type':_0x1c7013[_0xdc09('0x30')][_0xdc09('0x31')]};});_0x2e5886['model']=_['map'](_0xd6be12,_0xdc09('0x2b'));_0x2e5886['query']=_[_0xdc09('0x32')](_0x296367['query']);_0x2e5886[_0xdc09('0x33')]=_[_0xdc09('0x34')](_0x2e5886['model'],_0x2e5886['query']);_0x599dbd[_0xdc09('0x35')]=_[_0xdc09('0x34')](_0x2e5886[_0xdc09('0x36')],qs[_0xdc09('0x37')](_0x296367[_0xdc09('0x38')][_0xdc09('0x37')]));_0x599dbd['attributes']=_0x599dbd[_0xdc09('0x35')][_0xdc09('0x39')]?_0x599dbd[_0xdc09('0x35')]:_0x2e5886[_0xdc09('0x36')];if(!_0x296367['query'][_0xdc09('0x3a')](_0xdc09('0x3b'))){_0x599dbd['limit']=qs[_0xdc09('0x21')](_0x296367['query'][_0xdc09('0x21')]);_0x599dbd[_0xdc09('0x3c')]=qs[_0xdc09('0x3c')](_0x296367[_0xdc09('0x38')][_0xdc09('0x3c')]);}_0x599dbd[_0xdc09('0x3d')]=qs[_0xdc09('0x3e')](_0x296367[_0xdc09('0x38')][_0xdc09('0x3e')]);_0x599dbd[_0xdc09('0x3f')]=qs[_0xdc09('0x33')](_['pick'](_0x296367[_0xdc09('0x38')],_0x2e5886['filters']),_0xd6be12);if(_0x296367[_0xdc09('0x38')][_0xdc09('0x40')]){_0x599dbd[_0xdc09('0x3f')]=_['merge'](_0x599dbd[_0xdc09('0x3f')],{'$or':_['map'](_0xd6be12,function(_0x176b0b){if(_0x176b0b[_0xdc09('0x30')]!=='VIRTUAL'){var _0x49297b={};_0x49297b[_0x176b0b['name']]={'$like':'%'+_0x296367[_0xdc09('0x38')][_0xdc09('0x40')]+'%'};return _0x49297b;}})});}_0x599dbd=_[_0xdc09('0x41')]({},_0x599dbd,_0x296367['options']);var _0x4f2a0b={'where':_0x599dbd[_0xdc09('0x3f')]};return db['VoiceQueuesLog'][_0xdc09('0x22')](_0x4f2a0b)['then'](function(_0x52788c){_0x2e9486[_0xdc09('0x22')]=_0x52788c;if(_0x296367['query'][_0xdc09('0x42')]){_0x599dbd[_0xdc09('0x43')]=[{'all':!![]}];}return db[_0xdc09('0x44')][_0xdc09('0x45')](_0x599dbd);})[_0xdc09('0x28')](function(_0x4ef7c4){_0x2e9486[_0xdc09('0x46')]=_0x4ef7c4;return _0x2e9486;})[_0xdc09('0x28')](respondWithFilteredResult(_0x5f49eb,_0x599dbd))[_0xdc09('0x47')](handleError(_0x5f49eb,null));};exports['show']=function(_0x223ce1,_0x597d28){var _0x29de69={'raw':!![],'where':{'id':_0x223ce1[_0xdc09('0x48')]['id']}},_0x3b275b={};_0x3b275b['model']=_[_0xdc09('0x32')](db[_0xdc09('0x44')]['rawAttributes']);_0x3b275b[_0xdc09('0x38')]=_[_0xdc09('0x32')](_0x223ce1[_0xdc09('0x38')]);_0x3b275b[_0xdc09('0x33')]=_[_0xdc09('0x34')](_0x3b275b[_0xdc09('0x36')],_0x3b275b[_0xdc09('0x38')]);_0x29de69[_0xdc09('0x35')]=_['intersection'](_0x3b275b[_0xdc09('0x36')],qs[_0xdc09('0x37')](_0x223ce1[_0xdc09('0x38')]['fields']));_0x29de69[_0xdc09('0x35')]=_0x29de69[_0xdc09('0x35')]['length']?_0x29de69[_0xdc09('0x35')]:_0x3b275b['model'];if(_0x223ce1[_0xdc09('0x38')]['includeAll']){_0x29de69[_0xdc09('0x43')]=[{'all':!![]}];}_0x29de69=_['merge']({},_0x29de69,_0x223ce1['options']);return db[_0xdc09('0x44')][_0xdc09('0x49')](_0x29de69)[_0xdc09('0x28')](handleEntityNotFound(_0x597d28,null))['then'](respondWithResult(_0x597d28,null))['catch'](handleError(_0x597d28,null));};exports[_0xdc09('0x4a')]=function(_0x1d0e1f,_0x4d3a7c){return db[_0xdc09('0x44')][_0xdc09('0x4a')](_0x1d0e1f[_0xdc09('0x4b')],{})[_0xdc09('0x28')](respondWithResult(_0x4d3a7c,0xc9))[_0xdc09('0x47')](handleError(_0x4d3a7c,null));};exports[_0xdc09('0x27')]=function(_0x52d907,_0x141301){if(_0x52d907['body']['id']){delete _0x52d907[_0xdc09('0x4b')]['id'];}return db[_0xdc09('0x44')]['find']({'where':{'id':_0x52d907[_0xdc09('0x48')]['id']}})['then'](handleEntityNotFound(_0x141301,null))['then'](saveUpdates(_0x52d907[_0xdc09('0x4b')],null))['then'](respondWithResult(_0x141301,null))['catch'](handleError(_0x141301,null));};exports['destroy']=function(_0x11135d,_0x47996e){return db[_0xdc09('0x44')][_0xdc09('0x49')]({'where':{'id':_0x11135d['params']['id']}})[_0xdc09('0x28')](handleEntityNotFound(_0x47996e,null))[_0xdc09('0x28')](removeEntity(_0x47996e,null))[_0xdc09('0x47')](handleError(_0x47996e,null));}; \ No newline at end of file +var _0xc97e=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueuesLog','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x40fdca,_0x2fe232){var _0x1858da=function(_0x8f15b1){while(--_0x8f15b1){_0x40fdca['push'](_0x40fdca['shift']());}};_0x1858da(++_0x2fe232);}(_0xc97e,0x1bf));var _0xec97=function(_0x475305,_0x665f20){_0x475305=_0x475305-0x0;var _0x105bb3=_0xc97e[_0x475305];return _0x105bb3;};'use strict';var emlformat=require(_0xec97('0x0'));var rimraf=require(_0xec97('0x1'));var zipdir=require(_0xec97('0x2'));var jsonpatch=require(_0xec97('0x3'));var rp=require(_0xec97('0x4'));var moment=require(_0xec97('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec97('0x6'));var path=require(_0xec97('0x7'));var sox=require(_0xec97('0x8'));var csv=require(_0xec97('0x9'));var ejs=require(_0xec97('0xa'));var fs=require('fs');var fs_extra=require(_0xec97('0xb'));var _=require(_0xec97('0xc'));var squel=require(_0xec97('0xd'));var crypto=require(_0xec97('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xec97('0xf'));var toCsv=require('to-csv');var querystring=require(_0xec97('0x10'));var Papa=require(_0xec97('0x11'));var Redis=require(_0xec97('0x12'));var authService=require(_0xec97('0x13'));var qs=require(_0xec97('0x14'));var as=require(_0xec97('0x15'));var hardwareService=require(_0xec97('0x16'));var logger=require(_0xec97('0x17'))(_0xec97('0x18'));var utils=require(_0xec97('0x19'));var config=require(_0xec97('0x1a'));var licenseUtil=require(_0xec97('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x352b73,_0x38a148){_0x38a148=_0x38a148||0xcc;return function(_0x529274){if(_0x529274){return _0x352b73[_0xec97('0x1c')](_0x38a148);}return _0x352b73['status'](_0x38a148)[_0xec97('0x1d')]();};}function respondWithResult(_0x2a54c5,_0x4cc97b){_0x4cc97b=_0x4cc97b||0xc8;return function(_0x210f3c){if(_0x210f3c){return _0x2a54c5[_0xec97('0x1e')](_0x4cc97b)[_0xec97('0x1f')](_0x210f3c);}};}function respondWithFilteredResult(_0x22ac86,_0x5a7eab){return function(_0x12587e){if(_0x12587e){var _0x194e93=typeof _0x5a7eab[_0xec97('0x20')]==='undefined'&&typeof _0x5a7eab[_0xec97('0x21')]===_0xec97('0x22');var _0x6acb55=_0x12587e[_0xec97('0x23')];var _0x415dfc=_0x194e93?0x0:_0x5a7eab[_0xec97('0x20')];var _0x279742=_0x194e93?_0x12587e[_0xec97('0x23')]:_0x5a7eab['offset']+_0x5a7eab['limit'];var _0x325297;if(_0x279742>=_0x6acb55){_0x279742=_0x6acb55;_0x325297=0xc8;}else{_0x325297=0xce;}_0x22ac86[_0xec97('0x1e')](_0x325297);return _0x22ac86['set']('Content-Range',_0x415dfc+'-'+_0x279742+'/'+_0x6acb55)[_0xec97('0x1f')](_0x12587e);}return null;};}function patchUpdates(_0x1a0493){return function(_0x50eb0a){try{jsonpatch[_0xec97('0x24')](_0x50eb0a,_0x1a0493,!![]);}catch(_0x1a7cfe){return BPromise[_0xec97('0x25')](_0x1a7cfe);}return _0x50eb0a[_0xec97('0x26')]();};}function saveUpdates(_0x1d9bc5,_0x5032ae){return function(_0x1f322e){if(_0x1f322e){return _0x1f322e[_0xec97('0x27')](_0x1d9bc5)[_0xec97('0x28')](function(_0x59bdf6){return _0x59bdf6;});}return null;};}function removeEntity(_0x4fcc1d,_0x37959a){return function(_0x4a9e5c){if(_0x4a9e5c){return _0x4a9e5c[_0xec97('0x29')]()['then'](function(){_0x4fcc1d[_0xec97('0x1e')](0xcc)[_0xec97('0x1d')]();});}};}function handleEntityNotFound(_0x2b4d56,_0x12da9f){return function(_0x517245){if(!_0x517245){_0x2b4d56[_0xec97('0x1c')](0x194);}return _0x517245;};}function handleError(_0x175ef3,_0x43d750){_0x43d750=_0x43d750||0x1f4;return function(_0x2fd14e){logger['error'](_0x2fd14e[_0xec97('0x2a')]);if(_0x2fd14e['name']){delete _0x2fd14e[_0xec97('0x2b')];}_0x175ef3[_0xec97('0x1e')](_0x43d750)[_0xec97('0x2c')](_0x2fd14e);};}exports[_0xec97('0x2d')]=function(_0x253ca2,_0x5779d7){var _0x5bf022={},_0x84f698={},_0x531fc1={'count':0x0,'rows':[]};var _0x33f8d0=_[_0xec97('0x2e')](db[_0xec97('0x2f')]['rawAttributes'],function(_0x550a86){return{'name':_0x550a86[_0xec97('0x30')],'type':_0x550a86['type']['key']};});_0x84f698[_0xec97('0x31')]=_['map'](_0x33f8d0,_0xec97('0x2b'));_0x84f698[_0xec97('0x32')]=_[_0xec97('0x33')](_0x253ca2[_0xec97('0x32')]);_0x84f698[_0xec97('0x34')]=_[_0xec97('0x35')](_0x84f698[_0xec97('0x31')],_0x84f698[_0xec97('0x32')]);_0x5bf022[_0xec97('0x36')]=_[_0xec97('0x35')](_0x84f698[_0xec97('0x31')],qs[_0xec97('0x37')](_0x253ca2['query']['fields']));_0x5bf022['attributes']=_0x5bf022[_0xec97('0x36')][_0xec97('0x38')]?_0x5bf022[_0xec97('0x36')]:_0x84f698['model'];if(!_0x253ca2[_0xec97('0x32')][_0xec97('0x39')]('nolimit')){_0x5bf022[_0xec97('0x21')]=qs['limit'](_0x253ca2['query'][_0xec97('0x21')]);_0x5bf022['offset']=qs[_0xec97('0x20')](_0x253ca2[_0xec97('0x32')][_0xec97('0x20')]);}_0x5bf022[_0xec97('0x3a')]=qs[_0xec97('0x3b')](_0x253ca2[_0xec97('0x32')][_0xec97('0x3b')]);_0x5bf022[_0xec97('0x3c')]=qs[_0xec97('0x34')](_[_0xec97('0x3d')](_0x253ca2[_0xec97('0x32')],_0x84f698[_0xec97('0x34')]),_0x33f8d0);if(_0x253ca2['query'][_0xec97('0x3e')]){_0x5bf022[_0xec97('0x3c')]=_[_0xec97('0x3f')](_0x5bf022[_0xec97('0x3c')],{'$or':_[_0xec97('0x2e')](_0x33f8d0,function(_0x319348){if(_0x319348['type']!==_0xec97('0x40')){var _0x5154cd={};_0x5154cd[_0x319348[_0xec97('0x2b')]]={'$like':'%'+_0x253ca2[_0xec97('0x32')][_0xec97('0x3e')]+'%'};return _0x5154cd;}})});}_0x5bf022=_[_0xec97('0x3f')]({},_0x5bf022,_0x253ca2[_0xec97('0x41')]);var _0x5a31f7={'where':_0x5bf022[_0xec97('0x3c')]};return db['VoiceQueuesLog']['count'](_0x5a31f7)['then'](function(_0x105433){_0x531fc1[_0xec97('0x23')]=_0x105433;if(_0x253ca2[_0xec97('0x32')][_0xec97('0x42')]){_0x5bf022[_0xec97('0x43')]=[{'all':!![]}];}return db[_0xec97('0x2f')][_0xec97('0x44')](_0x5bf022);})[_0xec97('0x28')](function(_0x30db01){_0x531fc1[_0xec97('0x45')]=_0x30db01;return _0x531fc1;})[_0xec97('0x28')](respondWithFilteredResult(_0x5779d7,_0x5bf022))[_0xec97('0x46')](handleError(_0x5779d7,null));};exports[_0xec97('0x47')]=function(_0x47a6f8,_0x4561a8){var _0x44ce06={'raw':!![],'where':{'id':_0x47a6f8['params']['id']}},_0x3cae96={};_0x3cae96[_0xec97('0x31')]=_[_0xec97('0x33')](db[_0xec97('0x2f')][_0xec97('0x48')]);_0x3cae96[_0xec97('0x32')]=_[_0xec97('0x33')](_0x47a6f8['query']);_0x3cae96[_0xec97('0x34')]=_[_0xec97('0x35')](_0x3cae96[_0xec97('0x31')],_0x3cae96[_0xec97('0x32')]);_0x44ce06[_0xec97('0x36')]=_[_0xec97('0x35')](_0x3cae96[_0xec97('0x31')],qs[_0xec97('0x37')](_0x47a6f8[_0xec97('0x32')][_0xec97('0x37')]));_0x44ce06['attributes']=_0x44ce06[_0xec97('0x36')][_0xec97('0x38')]?_0x44ce06[_0xec97('0x36')]:_0x3cae96[_0xec97('0x31')];if(_0x47a6f8[_0xec97('0x32')]['includeAll']){_0x44ce06[_0xec97('0x43')]=[{'all':!![]}];}_0x44ce06=_['merge']({},_0x44ce06,_0x47a6f8[_0xec97('0x41')]);return db[_0xec97('0x2f')][_0xec97('0x49')](_0x44ce06)[_0xec97('0x28')](handleEntityNotFound(_0x4561a8,null))[_0xec97('0x28')](respondWithResult(_0x4561a8,null))['catch'](handleError(_0x4561a8,null));};exports[_0xec97('0x4a')]=function(_0x3b82a4,_0x565dba){return db[_0xec97('0x2f')][_0xec97('0x4a')](_0x3b82a4[_0xec97('0x4b')],{})['then'](respondWithResult(_0x565dba,0xc9))['catch'](handleError(_0x565dba,null));};exports[_0xec97('0x27')]=function(_0x131f83,_0x43f0e5){if(_0x131f83[_0xec97('0x4b')]['id']){delete _0x131f83[_0xec97('0x4b')]['id'];}return db[_0xec97('0x2f')][_0xec97('0x49')]({'where':{'id':_0x131f83[_0xec97('0x4c')]['id']}})[_0xec97('0x28')](handleEntityNotFound(_0x43f0e5,null))[_0xec97('0x28')](saveUpdates(_0x131f83[_0xec97('0x4b')],null))[_0xec97('0x28')](respondWithResult(_0x43f0e5,null))[_0xec97('0x46')](handleError(_0x43f0e5,null));};exports[_0xec97('0x29')]=function(_0x190ee1,_0x4c9d91){return db[_0xec97('0x2f')][_0xec97('0x49')]({'where':{'id':_0x190ee1['params']['id']}})[_0xec97('0x28')](handleEntityNotFound(_0x4c9d91,null))[_0xec97('0x28')](removeEntity(_0x4c9d91,null))[_0xec97('0x46')](handleError(_0x4c9d91,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fb0f311..5db4632 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 _0xeeea=['voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0xeeea,0x1a3));var _0xaeee=function(_0x1f2ead,_0x3d8530){_0x1f2ead=_0x1f2ead-0x0;var _0x266eac=_0xeeea[_0x1f2ead];return _0x266eac;};'use strict';var _=require(_0xaeee('0x0'));var util=require(_0xaeee('0x1'));var logger=require(_0xaeee('0x2'))(_0xaeee('0x3'));var moment=require(_0xaeee('0x4'));var BPromise=require(_0xaeee('0x5'));var rp=require(_0xaeee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaeee('0x7'));var config=require(_0xaeee('0x8'));var attributes=require(_0xaeee('0x9'));module[_0xaeee('0xa')]=function(_0xb7f3a6,_0x3baf28){return _0xb7f3a6[_0xaeee('0xb')](_0xaeee('0xc'),attributes,{'tableName':_0xaeee('0xd'),'paranoid':![],'indexes':[{'name':_0xaeee('0xe'),'fields':[_0xaeee('0xf'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xf031=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','event_dtm','event','dtm'];(function(_0x11f682,_0x259ef5){var _0x46a0f9=function(_0x16b67e){while(--_0x16b67e){_0x11f682['push'](_0x11f682['shift']());}};_0x46a0f9(++_0x259ef5);}(_0xf031,0xfc));var _0x1f03=function(_0x55b460,_0x27a7b8){_0x55b460=_0x55b460-0x0;var _0x40f22f=_0xf031[_0x55b460];return _0x40f22f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f03('0x0'))(_0x1f03('0x1'));var moment=require(_0x1f03('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f03('0x3'));var rimraf=require(_0x1f03('0x4'));var config=require(_0x1f03('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x1f03('0x6')]=function(_0x2dc000,_0xfef1){return _0x2dc000[_0x1f03('0x7')](_0x1f03('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x1f03('0x9'),'fields':[_0x1f03('0xa'),_0x1f03('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 83716f9..4ad7dfd 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 _0x51ba=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51d424,_0x5e7e97){var _0x2bcdf5=function(_0x151cd2){while(--_0x151cd2){_0x51d424['push'](_0x51d424['shift']());}};_0x2bcdf5(++_0x5e7e97);}(_0x51ba,0x169));var _0xa51b=function(_0x2162c9,_0x513184){_0x2162c9=_0x2162c9-0x0;var _0x2194ba=_0x51ba[_0x2162c9];return _0x2194ba;};'use strict';var _=require('lodash');var util=require(_0xa51b('0x0'));var moment=require(_0xa51b('0x1'));var BPromise=require(_0xa51b('0x2'));var rs=require(_0xa51b('0x3'));var fs=require('fs');var Redis=require(_0xa51b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa51b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa51b('0x6'));var client=jayson[_0xa51b('0x7')][_0xa51b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb8cc99,_0x53af50,_0x15ab36){return new BPromise(function(_0x5cff86,_0x5c532d){return client[_0xa51b('0x9')](_0xb8cc99,_0x15ab36)[_0xa51b('0xa')](function(_0x4013f3){logger[_0xa51b('0xb')](_0xa51b('0xc'),_0x53af50,'request\x20sent');logger[_0xa51b('0xd')](_0xa51b('0xe'),_0x53af50,'request\x20sent',JSON[_0xa51b('0xf')](_0x4013f3));if(_0x4013f3[_0xa51b('0x10')]){if(_0x4013f3[_0xa51b('0x10')][_0xa51b('0x11')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x53af50,_0x4013f3[_0xa51b('0x10')][_0xa51b('0x12')]);return _0x5c532d(_0x4013f3['error'][_0xa51b('0x12')]);}logger[_0xa51b('0x10')](_0xa51b('0xc'),_0x53af50,_0x4013f3['error'][_0xa51b('0x12')]);return _0x5cff86(_0x4013f3['error'][_0xa51b('0x12')]);}else{logger[_0xa51b('0xb')](_0xa51b('0xc'),_0x53af50,'request\x20sent');_0x5cff86(_0x4013f3[_0xa51b('0x13')][_0xa51b('0x12')]);}})[_0xa51b('0x14')](function(_0x3a1ed7){logger[_0xa51b('0x10')](_0xa51b('0xc'),_0x53af50,_0x3a1ed7);_0x5c532d(_0x3a1ed7);});});} \ No newline at end of file +var _0x4c0e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x4c0e,0x128));var _0xe4c0=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x4c0e[_0x3c6ae2];return _0x4edda;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var moment=require(_0xe4c0('0x2'));var BPromise=require(_0xe4c0('0x3'));var rs=require(_0xe4c0('0x4'));var fs=require('fs');var Redis=require(_0xe4c0('0x5'));var db=require(_0xe4c0('0x6'))['db'];var utils=require(_0xe4c0('0x7'));var logger=require(_0xe4c0('0x8'))('rpc');var config=require(_0xe4c0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe4c0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4488b0,_0x503cd9,_0x5dee9f){return new BPromise(function(_0x46fcfa,_0x3ab99d){return client['request'](_0x4488b0,_0x5dee9f)[_0xe4c0('0xb')](function(_0x15b3d0){logger[_0xe4c0('0xc')](_0xe4c0('0xd'),_0x503cd9,'request\x20sent');logger[_0xe4c0('0xe')](_0xe4c0('0xf'),_0x503cd9,_0xe4c0('0x10'),JSON[_0xe4c0('0x11')](_0x15b3d0));if(_0x15b3d0[_0xe4c0('0x12')]){if(_0x15b3d0[_0xe4c0('0x12')][_0xe4c0('0x13')]===0x1f4){logger[_0xe4c0('0x12')](_0xe4c0('0xd'),_0x503cd9,_0x15b3d0[_0xe4c0('0x12')][_0xe4c0('0x14')]);return _0x3ab99d(_0x15b3d0['error'][_0xe4c0('0x14')]);}logger[_0xe4c0('0x12')](_0xe4c0('0xd'),_0x503cd9,_0x15b3d0[_0xe4c0('0x12')]['message']);return _0x46fcfa(_0x15b3d0[_0xe4c0('0x12')][_0xe4c0('0x14')]);}else{logger[_0xe4c0('0xc')](_0xe4c0('0xd'),_0x503cd9,'request\x20sent');_0x46fcfa(_0x15b3d0[_0xe4c0('0x15')]['message']);}})[_0xe4c0('0x16')](function(_0x3d3bcf){logger[_0xe4c0('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x503cd9,_0x3d3bcf);_0x3ab99d(_0x3d3bcf);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index cd64ed6..4d3af6c 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 _0x52b7=['create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post'];(function(_0x1798a6,_0x5a3643){var _0x9bca9=function(_0x4e8c05){while(--_0x4e8c05){_0x1798a6['push'](_0x1798a6['shift']());}};_0x9bca9(++_0x5a3643);}(_0x52b7,0x164));var _0x752b=function(_0x41e96,_0x4c9b00){_0x41e96=_0x41e96-0x0;var _0x2f16cf=_0x52b7[_0x41e96];return _0x2f16cf;};'use strict';var multer=require(_0x752b('0x0'));var util=require(_0x752b('0x1'));var path=require(_0x752b('0x2'));var timeout=require(_0x752b('0x3'));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(_0x752b('0x4'));var controller=require(_0x752b('0x5'));router[_0x752b('0x6')]('/',auth[_0x752b('0x7')](),controller[_0x752b('0x8')]);router[_0x752b('0x6')](_0x752b('0x9'),auth[_0x752b('0x7')](),controller[_0x752b('0xa')]);router[_0x752b('0x6')]('/:id',auth[_0x752b('0x7')](),controller[_0x752b('0xb')]);router[_0x752b('0x6')](_0x752b('0xc'),auth[_0x752b('0x7')](),controller[_0x752b('0xd')]);router[_0x752b('0x6')](_0x752b('0xe'),controller[_0x752b('0xf')]);router[_0x752b('0x6')](_0x752b('0x10'),auth[_0x752b('0x7')](),controller[_0x752b('0x11')]);router[_0x752b('0x12')]('/',auth[_0x752b('0x7')](),controller[_0x752b('0x13')]);router['post']('/:id/transcribe',auth[_0x752b('0x7')](),controller['runTranscribe']);router[_0x752b('0x14')](_0x752b('0x15'),auth[_0x752b('0x7')](),controller['update']);router[_0x752b('0x16')](_0x752b('0x15'),auth[_0x752b('0x7')](),controller[_0x752b('0x17')]);module[_0x752b('0x18')]=router; \ No newline at end of file +var _0xf2f5=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','runTranscribe'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf2f5,0x13d));var _0x5f2f=function(_0x57759b,_0x7c4540){_0x57759b=_0x57759b-0x0;var _0x2717b6=_0xf2f5[_0x57759b];return _0x2717b6;};'use strict';var multer=require(_0x5f2f('0x0'));var util=require('util');var path=require(_0x5f2f('0x1'));var timeout=require(_0x5f2f('0x2'));var express=require(_0x5f2f('0x3'));var router=express[_0x5f2f('0x4')]();var fs_extra=require(_0x5f2f('0x5'));var auth=require(_0x5f2f('0x6'));var interaction=require(_0x5f2f('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x5f2f('0x8')]('/',auth[_0x5f2f('0x9')](),controller[_0x5f2f('0xa')]);router['get']('/describe',auth[_0x5f2f('0x9')](),controller[_0x5f2f('0xb')]);router['get'](_0x5f2f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5f2f('0x8')](_0x5f2f('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x5f2f('0x8')](_0x5f2f('0xe'),controller[_0x5f2f('0xf')]);router[_0x5f2f('0x8')](_0x5f2f('0x10'),auth[_0x5f2f('0x9')](),controller[_0x5f2f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5f2f('0x10'),auth[_0x5f2f('0x9')](),controller[_0x5f2f('0x12')]);router[_0x5f2f('0x13')](_0x5f2f('0xc'),auth['isAuthenticated'](),controller[_0x5f2f('0x14')]);router[_0x5f2f('0x15')]('/:id',auth[_0x5f2f('0x9')](),controller[_0x5f2f('0x16')]);module[_0x5f2f('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 3bcdb4f..afc9f8f 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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 259fdb0..90ca57f 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 _0x4edb=['readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','language','bucket','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','VoiceRecording','fieldName','type','key','model','differenceBy','map','format','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','rawAttributes','filters','find','create','body','describe','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','sequelize','MD5','token','$and','push','%s.cypher','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','startTranscriptionJob','basename'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4edb,0xc6));var _0xb4ed=function(_0x30e0f5,_0x5e4826){_0x30e0f5=_0x30e0f5-0x0;var _0x3b5800=_0x4edb[_0x30e0f5];return _0x3b5800;};'use strict';var emlformat=require(_0xb4ed('0x0'));var rimraf=require(_0xb4ed('0x1'));var zipdir=require(_0xb4ed('0x2'));var jsonpatch=require(_0xb4ed('0x3'));var rp=require(_0xb4ed('0x4'));var moment=require('moment');var BPromise=require(_0xb4ed('0x5'));var Mustache=require(_0xb4ed('0x6'));var util=require('util');var path=require(_0xb4ed('0x7'));var sox=require(_0xb4ed('0x8'));var csv=require('to-csv');var ejs=require(_0xb4ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb4ed('0xa'));var crypto=require(_0xb4ed('0xb'));var jsforce=require(_0xb4ed('0xc'));var deskjs=require(_0xb4ed('0xd'));var toCsv=require(_0xb4ed('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0xb4ed('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0xb4ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4ed('0x11'));var as=require(_0xb4ed('0x12'));var hardwareService=require(_0xb4ed('0x13'));var logger=require('../../config/logger')(_0xb4ed('0x14'));var utils=require(_0xb4ed('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb4ed('0x16'));var db=require(_0xb4ed('0x17'))['db'];function respondWithStatusCode(_0x480281,_0x1fefcd){_0x1fefcd=_0x1fefcd||0xcc;return function(_0x1b6463){if(_0x1b6463){return _0x480281[_0xb4ed('0x18')](_0x1fefcd);}return _0x480281[_0xb4ed('0x19')](_0x1fefcd)[_0xb4ed('0x1a')]();};}function respondWithResult(_0x1453cc,_0x25f6c0){_0x25f6c0=_0x25f6c0||0xc8;return function(_0x1644c5){if(_0x1644c5){return _0x1453cc[_0xb4ed('0x19')](_0x25f6c0)[_0xb4ed('0x1b')](_0x1644c5);}};}function respondWithFilteredResult(_0x10c55b,_0x2d9e5d){return function(_0x1d4d35){if(_0x1d4d35){var _0x54b550=typeof _0x2d9e5d[_0xb4ed('0x1c')]===_0xb4ed('0x1d')&&typeof _0x2d9e5d['limit']==='undefined';var _0x528479=_0x1d4d35['count'];var _0x593c6c=_0x54b550?0x0:_0x2d9e5d[_0xb4ed('0x1c')];var _0x21b1f5=_0x54b550?_0x1d4d35[_0xb4ed('0x1e')]:_0x2d9e5d[_0xb4ed('0x1c')]+_0x2d9e5d[_0xb4ed('0x1f')];var _0x4c0edc;if(_0x21b1f5>=_0x528479){_0x21b1f5=_0x528479;_0x4c0edc=0xc8;}else{_0x4c0edc=0xce;}_0x10c55b[_0xb4ed('0x19')](_0x4c0edc);return _0x10c55b[_0xb4ed('0x20')](_0xb4ed('0x21'),_0x593c6c+'-'+_0x21b1f5+'/'+_0x528479)[_0xb4ed('0x1b')](_0x1d4d35);}return null;};}function patchUpdates(_0x190487){return function(_0x3cd95c){try{jsonpatch[_0xb4ed('0x22')](_0x3cd95c,_0x190487,!![]);}catch(_0x342e50){return BPromise[_0xb4ed('0x23')](_0x342e50);}return _0x3cd95c[_0xb4ed('0x24')]();};}function saveUpdates(_0x3870f0,_0x1ad387){return function(_0x3dfa1d){if(_0x3dfa1d){return _0x3dfa1d[_0xb4ed('0x25')](_0x3870f0)['then'](function(_0x170655){return _0x170655;});}return null;};}function removeEntity(_0x3815fc,_0x1dc901){return function(_0x454a6a){if(_0x454a6a){return _0x454a6a[_0xb4ed('0x26')]()['then'](function(){_0x3815fc['status'](0xcc)[_0xb4ed('0x1a')]();});}};}function handleEntityNotFound(_0x4a4403,_0x1e5cb7){return function(_0x125dcd){if(!_0x125dcd){_0x4a4403[_0xb4ed('0x18')](0x194);}return _0x125dcd;};}function handleError(_0x39d2a3,_0x21335f){_0x21335f=_0x21335f||0x1f4;return function(_0x56a253){logger[_0xb4ed('0x27')](_0x56a253[_0xb4ed('0x28')]);if(_0x56a253[_0xb4ed('0x29')]){delete _0x56a253[_0xb4ed('0x29')];}_0x39d2a3[_0xb4ed('0x19')](_0x21335f)['send'](_0x56a253);};}exports['index']=function(_0x57119a,_0x278940){var _0x32d27d={},_0x452b67={},_0x59bbac={'count':0x0,'rows':[]};var _0x448d24=_['map'](db[_0xb4ed('0x2a')]['rawAttributes'],function(_0x9f3a12){return{'name':_0x9f3a12[_0xb4ed('0x2b')],'type':_0x9f3a12[_0xb4ed('0x2c')][_0xb4ed('0x2d')]};});_0x452b67[_0xb4ed('0x2e')]=_[_0xb4ed('0x2f')](_[_0xb4ed('0x30')](_0x448d24,_0xb4ed('0x29')),[_0xb4ed('0x31')]);_0x452b67[_0xb4ed('0x32')]=_[_0xb4ed('0x33')](_0x57119a[_0xb4ed('0x32')]);_0x452b67['filters']=_[_0xb4ed('0x34')](_0x452b67['model'],_0x452b67[_0xb4ed('0x32')]);_0x32d27d['attributes']=_[_0xb4ed('0x34')](_0x452b67['model'],qs[_0xb4ed('0x35')](_0x57119a[_0xb4ed('0x32')]['fields']));_0x32d27d[_0xb4ed('0x36')]=_0x32d27d[_0xb4ed('0x36')][_0xb4ed('0x37')]?_0x32d27d['attributes']:_0x452b67[_0xb4ed('0x2e')];if(!_0x57119a['query']['hasOwnProperty'](_0xb4ed('0x38'))){_0x32d27d[_0xb4ed('0x1f')]=qs[_0xb4ed('0x1f')](_0x57119a[_0xb4ed('0x32')]['limit']);_0x32d27d['offset']=qs['offset'](_0x57119a[_0xb4ed('0x32')]['offset']);}_0x32d27d[_0xb4ed('0x39')]=qs['sort'](_0x57119a[_0xb4ed('0x32')][_0xb4ed('0x3a')]);_0x32d27d[_0xb4ed('0x3b')]=qs['filters'](_[_0xb4ed('0x3c')](_0x57119a[_0xb4ed('0x32')],_0x452b67['filters']),_0x448d24);if(_0x57119a['query'][_0xb4ed('0x3d')]){_0x32d27d['where']=_[_0xb4ed('0x3e')](_0x32d27d['where'],{'$or':_[_0xb4ed('0x30')](_0x448d24,function(_0x2ce0b0){if(_0x2ce0b0[_0xb4ed('0x2c')]!==_0xb4ed('0x3f')){var _0x3c8f14={};_0x3c8f14[_0x2ce0b0[_0xb4ed('0x29')]]={'$like':'%'+_0x57119a[_0xb4ed('0x32')][_0xb4ed('0x3d')]+'%'};return _0x3c8f14;}})});}_0x32d27d=_['merge']({},_0x32d27d,_0x57119a[_0xb4ed('0x40')]);var _0x50af68={'where':_0x32d27d[_0xb4ed('0x3b')]};return db[_0xb4ed('0x2a')][_0xb4ed('0x1e')](_0x50af68)['then'](function(_0x1fbbeb){_0x59bbac[_0xb4ed('0x1e')]=_0x1fbbeb;if(_0x57119a['query'][_0xb4ed('0x41')]){_0x32d27d[_0xb4ed('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0xb4ed('0x43')](_0x32d27d);})[_0xb4ed('0x44')](function(_0x39c3ce){_0x59bbac[_0xb4ed('0x45')]=_0x39c3ce;return _0x59bbac;})[_0xb4ed('0x44')](respondWithFilteredResult(_0x278940,_0x32d27d))[_0xb4ed('0x46')](handleError(_0x278940,null));};exports[_0xb4ed('0x47')]=function(_0x5c47a2,_0x49245b){var _0x33164b={'raw':![],'where':{'id':_0x5c47a2[_0xb4ed('0x48')]['id']}},_0x59dbcc={};_0x59dbcc[_0xb4ed('0x2e')]=_[_0xb4ed('0x33')](db[_0xb4ed('0x2a')][_0xb4ed('0x49')]);_0x59dbcc[_0xb4ed('0x32')]=_[_0xb4ed('0x33')](_0x5c47a2[_0xb4ed('0x32')]);_0x59dbcc[_0xb4ed('0x4a')]=_[_0xb4ed('0x34')](_0x59dbcc[_0xb4ed('0x2e')],_0x59dbcc[_0xb4ed('0x32')]);_0x33164b[_0xb4ed('0x36')]=_['intersection'](_0x59dbcc[_0xb4ed('0x2e')],qs['fields'](_0x5c47a2[_0xb4ed('0x32')][_0xb4ed('0x35')]));_0x33164b[_0xb4ed('0x36')]=_0x33164b[_0xb4ed('0x36')]['length']?_0x33164b['attributes']:_0x59dbcc[_0xb4ed('0x2e')];if(_0x5c47a2[_0xb4ed('0x32')][_0xb4ed('0x41')]){_0x33164b['include']=[{'all':!![]}];}_0x33164b=_[_0xb4ed('0x3e')]({},_0x33164b,_0x5c47a2[_0xb4ed('0x40')]);return db['VoiceRecording'][_0xb4ed('0x4b')](_0x33164b)[_0xb4ed('0x44')](handleEntityNotFound(_0x49245b,null))['then'](respondWithResult(_0x49245b,null))[_0xb4ed('0x46')](handleError(_0x49245b,null));};exports[_0xb4ed('0x4c')]=function(_0x394add,_0x5a4264){return db[_0xb4ed('0x2a')]['create'](_0x394add[_0xb4ed('0x4d')],{})[_0xb4ed('0x44')](respondWithResult(_0x5a4264,0xc9))['catch'](handleError(_0x5a4264,null));};exports['update']=function(_0x5490a0,_0x2982cb){if(_0x5490a0['body']['id']){delete _0x5490a0['body']['id'];}return db['VoiceRecording'][_0xb4ed('0x4b')]({'where':{'id':_0x5490a0[_0xb4ed('0x48')]['id']}})[_0xb4ed('0x44')](handleEntityNotFound(_0x2982cb,null))['then'](saveUpdates(_0x5490a0[_0xb4ed('0x4d')],null))['then'](respondWithResult(_0x2982cb,null))[_0xb4ed('0x46')](handleError(_0x2982cb,null));};exports[_0xb4ed('0x4e')]=function(_0x42f50a,_0x2abd00){return db['VoiceRecording'][_0xb4ed('0x4e')]()[_0xb4ed('0x44')](respondWithResult(_0x2abd00,null))[_0xb4ed('0x46')](handleError(_0x2abd00,null));};exports['download']=function(_0x3aebec,_0x40d446,_0xfb1279){var _0x303d9d=require(_0xb4ed('0x4f'));var _0x3a5e68=![];var _0x33a362={};if(_0x3aebec[_0xb4ed('0x32')][_0xb4ed('0x2c')]&&_0x3aebec['query'][_0xb4ed('0x2c')]===_0xb4ed('0x50')){_0x33a362[_0xb4ed('0x50')]=_0x3aebec['params']['id'];}else{_0x33a362['id']=_0x3aebec[_0xb4ed('0x48')]['id'];}return db[_0xb4ed('0x2a')][_0xb4ed('0x4b')]({'where':_0x33a362,'attributes':['id',_0xb4ed('0x51')],'raw':!![]})[_0xb4ed('0x44')](handleEntityNotFound(_0x40d446,null))[_0xb4ed('0x44')](function(_0x3ac67d){if(_0x3ac67d){var _0xb3dac1=_0x3ac67d['value'];var _0x425e4e=util[_0xb4ed('0x31')]('%s.cypher',_0xb3dac1);if(fs[_0xb4ed('0x52')](_0x425e4e)){_0x3a5e68=!![];return _0x303d9d[_0xb4ed('0x53')](_0x425e4e,_0xb3dac1,config[_0xb4ed('0x54')][_0xb4ed('0x55')])[_0xb4ed('0x44')](function(){return _0x3ac67d;});}return _0x3ac67d;}})[_0xb4ed('0x44')](function(_0x600898){if(_0x600898){var _0x13333a=_0x600898[_0xb4ed('0x51')];if(!fs[_0xb4ed('0x52')](_0x13333a)){throw new db['Sequelize'][(_0xb4ed('0x56'))](_0xb4ed('0x57'));}if(_0x600898[_0xb4ed('0x58')]){return _0x40d446[_0xb4ed('0x59')](_0x13333a,_0x600898[_0xb4ed('0x58')]+path[_0xb4ed('0x5a')](_0x13333a),function(){if(_0x3a5e68){fs[_0xb4ed('0x5b')](_0x13333a);}});}else{return _0x40d446[_0xb4ed('0x59')](_0x13333a,function(_0x34b4f9){if(_0x3a5e68){fs['unlink'](_0x13333a);}});}}})[_0xb4ed('0x46')](function(_0x2ceb5b){if(_0x2ceb5b[_0xb4ed('0x5c')]===_0xb4ed('0x57')){_0x40d446[_0xb4ed('0x19')](0x194)['send'](_0xb4ed('0x5d'));}else{return handleError(_0x40d446,null);}});};exports['downloads']=function(_0x6f36b8,_0x1ab709,_0x308b91){var _0x429cde=require(_0xb4ed('0x4f'));var _0x184a0c=![];var _0x15ebd0={'$and':[db[_0xb4ed('0x5e')]['where'](db[_0xb4ed('0x5e')]['fn'](_0xb4ed('0x5f'),db[_0xb4ed('0x5e')]['col'](_0xb4ed('0x50'))),_0x6f36b8[_0xb4ed('0x32')][_0xb4ed('0x60')])]};if(_0x6f36b8[_0xb4ed('0x32')][_0xb4ed('0x2c')]&&_0x6f36b8[_0xb4ed('0x32')][_0xb4ed('0x2c')]===_0xb4ed('0x50')){_0x15ebd0[_0xb4ed('0x61')][_0xb4ed('0x62')]({'uniqueid':_0x6f36b8['params']['id']});}else{_0x15ebd0[_0xb4ed('0x61')][_0xb4ed('0x62')]({'id':_0x6f36b8[_0xb4ed('0x48')]['id']});}return db['VoiceRecording'][_0xb4ed('0x4b')]({'where':_0x15ebd0,'attributes':['id','value'],'raw':!![]})[_0xb4ed('0x44')](handleEntityNotFound(_0x1ab709,null))[_0xb4ed('0x44')](function(_0x2ce7a4){if(_0x2ce7a4){var _0x20e908=util['format'](_0xb4ed('0x63'),_0x2ce7a4[_0xb4ed('0x51')]);if(fs[_0xb4ed('0x52')](_0x20e908)){_0x184a0c=!![];return _0x429cde[_0xb4ed('0x53')](_0x20e908,_0x2ce7a4[_0xb4ed('0x51')],config['secrets'][_0xb4ed('0x55')])[_0xb4ed('0x44')](function(){return _0x2ce7a4;});}return _0x2ce7a4;}})[_0xb4ed('0x44')](function(_0x5f541a){if(_0x5f541a){if(!fs[_0xb4ed('0x52')](_0x5f541a[_0xb4ed('0x51')])){throw new db[(_0xb4ed('0x64'))][(_0xb4ed('0x56'))](_0xb4ed('0x57'));}if(_0x5f541a['filename']){return _0x1ab709['download'](_0x5f541a[_0xb4ed('0x51')],_0x5f541a[_0xb4ed('0x58')]+path[_0xb4ed('0x5a')](_0x5f541a[_0xb4ed('0x51')]),function(){if(_0x184a0c){fs['unlink'](_0x5f541a['value']);}});}else{return _0x1ab709['download'](_0x5f541a['value'],function(_0x1ab773){if(_0x184a0c){fs['unlink'](_0x5f541a[_0xb4ed('0x51')]);}});}}})[_0xb4ed('0x46')](handleError(_0x1ab709,null));};exports['destroy']=function(_0x8577a5,_0x46ec34){return db['VoiceRecording']['find']({'where':{'id':_0x8577a5['params']['id']}})[_0xb4ed('0x44')](function(_0x293a7d){if(_[_0xb4ed('0x65')](_0x293a7d)){throw new ReferenceError(_0xb4ed('0x66'));}return _0x293a7d;})['then'](function(_0x124ee3){var _0x2b1a0a=_0x124ee3[_0xb4ed('0x51')];logger[_0xb4ed('0x67')](_0xb4ed('0x68'),_0x2b1a0a);if(!_['isNil'](_0x124ee3[_0xb4ed('0x51')])&&fs[_0xb4ed('0x52')](_0x2b1a0a)){logger[_0xb4ed('0x67')]('File:\x20\x22'+_0x2b1a0a+_0xb4ed('0x69'));fs['unlinkSync'](_0x2b1a0a);}_0x2b1a0a=_0x2b1a0a+_0xb4ed('0x6a');if(!_[_0xb4ed('0x65')](_0x124ee3[_0xb4ed('0x51')])&&fs[_0xb4ed('0x52')](_0x2b1a0a)){logger[_0xb4ed('0x67')]('File:\x20\x22'+_0x2b1a0a+_0xb4ed('0x69'));fs[_0xb4ed('0x6b')](_0x2b1a0a);}return _0x124ee3;})[_0xb4ed('0x44')](function(_0x98f763){if(!_0x98f763)throw new InternalError();return _0x98f763[_0xb4ed('0x26')]();})[_0xb4ed('0x44')](function(){_0x46ec34[_0xb4ed('0x19')](0xcc)[_0xb4ed('0x1a')]();})[_0xb4ed('0x46')](handleError(_0x46ec34,null));};function getBucketslist(_0x5ee054,_0x318963,_0x3d53dd){return new Promise(function(_0x5db0ed,_0x486f8d){var _0x235263=new AWS['S3']({'accessKeyId':_0x318963,'secretAccessKey':_0x5ee054,'region':_0x3d53dd});_0x235263[_0xb4ed('0x6c')]({},function(_0x21acc5,_0x2cfd99){if(_0x21acc5){return _0x486f8d(_0x21acc5);}else{return _0x5db0ed(_0x2cfd99);}});});}function createBucket(_0x33b35c,_0x141d9f,_0x9bb8fb,_0x13f120){return new Promise(function(_0x308107,_0x3df4ee){var _0x2c24a1=new AWS['S3']({'accessKeyId':_0x141d9f,'secretAccessKey':_0x33b35c,'region':_0x9bb8fb});_0x2c24a1['createBucket']({'Bucket':_0x13f120},function(_0x210636,_0x5646c9){if(_0x210636){return _0x3df4ee(_0x210636);}else{return _0x308107(_0x5646c9);}});});}function uploadFile(_0x35920e,_0x34ebed,_0x2607b8,_0x3493e0,_0x364d33,_0x4c8697){return new Promise(function(_0x32e9c2,_0x2d49a4){var _0x29df3a=new AWS['S3']({'accessKeyId':_0x34ebed,'secretAccessKey':_0x35920e,'region':_0x2607b8});_0x29df3a[_0xb4ed('0x6d')]({'Bucket':_0x3493e0,'Key':_0x364d33,'Body':_0x4c8697},function(_0xc039bc,_0x38aef6){if(_0xc039bc){return _0x2d49a4(_0xc039bc);}else{return _0x32e9c2(_0x38aef6);}});});}function startTranscribe(_0x1f563c,_0xc96295,_0x5f0723,_0x250a76,_0x21ea5f,_0x4bff9a){return new Promise(function(_0x1318be,_0x4c1e06){var _0x8d2dd1=new AWS['TranscribeService']({'accessKeyId':_0xc96295,'secretAccessKey':_0x1f563c,'region':_0x5f0723});_0x8d2dd1[_0xb4ed('0x6e')]({'TranscriptionJobName':_0x250a76,'LanguageCode':_0x21ea5f,'Media':{'MediaFileUri':_0x4bff9a}},function(_0x2557c0,_0xd36fa){if(_0x2557c0){return _0x4c1e06(_0x2557c0);}else{return _0x1318be(_0xd36fa);}});});}function transcribe(_0x3186e2,_0x51bc01,_0x30a831,_0x165284,_0x49c247,_0x56b390,_0x10d0ea){return new Promise(function(_0x546601,_0x55bfb5){var _0x56957a={};logger['info'](util[_0xb4ed('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x3186e2,_0x49c247));return uploadFile(_0x51bc01,_0x30a831,_0x165284,_0x49c247,path[_0xb4ed('0x6f')](_0x56b390),fs[_0xb4ed('0x70')](_0x56b390))['then'](function(_0xc0e7b1){logger[_0xb4ed('0x67')](util[_0xb4ed('0x31')](_0xb4ed('0x71'),_0x3186e2,_0x49c247,_0xc0e7b1['Location']));_0x56957a['bucket']=_0xc0e7b1[_0xb4ed('0x72')];_0x56957a[_0xb4ed('0x73')]=_0xc0e7b1[_0xb4ed('0x74')];logger[_0xb4ed('0x67')](util[_0xb4ed('0x31')](_0xb4ed('0x75'),_0x3186e2));return startTranscribe(_0x51bc01,_0x30a831,_0x165284,uuidv4(),_0x10d0ea,_0xc0e7b1[_0xb4ed('0x74')]);})['then'](function(_0x3382b7){logger[_0xb4ed('0x67')](util[_0xb4ed('0x31')](_0xb4ed('0x76'),_0x3186e2,_0x3382b7[_0xb4ed('0x77')][_0xb4ed('0x78')]));_0x56957a[_0xb4ed('0x79')]=_0x3382b7[_0xb4ed('0x77')]['TranscriptionJobName'];_0x56957a[_0xb4ed('0x7a')]=_0x3382b7[_0xb4ed('0x77')][_0xb4ed('0x7b')];return _0x546601(_0x56957a);})[_0xb4ed('0x46')](function(_0x25e0a3){return _0x55bfb5(_0x25e0a3);});});}exports[_0xb4ed('0x7c')]=function(_0x22da0c,_0xc91f02,_0x191d24){var _0x279610;var _0x355e90;var _0x43b494;var _0x58a71a=require(_0xb4ed('0x4f'));return db['VoiceRecording'][_0xb4ed('0x7d')]({'where':{'id':_0x22da0c['params']['id']}})[_0xb4ed('0x44')](function(_0x8a22b7){if(_0x8a22b7){var _0x40b489=util[_0xb4ed('0x31')](_0xb4ed('0x63'),_0x8a22b7[_0xb4ed('0x51')]);if(fs[_0xb4ed('0x52')](_0x40b489)){cypher=!![];return _0x58a71a[_0xb4ed('0x53')](_0x40b489,_0x8a22b7['value'],config[_0xb4ed('0x54')][_0xb4ed('0x55')])[_0xb4ed('0x44')](function(){return _0x8a22b7;});}return _0x8a22b7;}})['then'](function(_0x515d1e){if(!_0x515d1e){throw new db[(_0xb4ed('0x64'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x355e90=_0x515d1e;return db[_0xb4ed('0x7e')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0xc91f02,null))[_0xb4ed('0x44')](function(_0x5ac3be){if(_0x5ac3be){_0x279610=_0x5ac3be;if(!_0x279610[_0xb4ed('0x7f')]||!_0x279610[_0xb4ed('0x80')]||!_0x279610['transcribeRegion']||!_0x279610[_0xb4ed('0x81')]||!_0x279610[_0xb4ed('0x82')]){throw new db[(_0xb4ed('0x64'))][(_0xb4ed('0x56'))]('Transcribe\x20not\x20configured');}if(_0x22da0c[_0xb4ed('0x4d')][_0xb4ed('0x83')]&&(!_0x279610[_0xb4ed('0x84')]||!_0x279610['sentimentAccountId']||!_0x279610[_0xb4ed('0x85')]||!_0x279610[_0xb4ed('0x81')]||!_0x279610[_0xb4ed('0x82')])){throw new db[(_0xb4ed('0x64'))]['ValidationError'](_0xb4ed('0x86'));}return db[_0xb4ed('0x87')][_0xb4ed('0x7d')]({'where':{'id':_0x279610[_0xb4ed('0x80')]}});}})['then'](function(_0x9fd82e){if(!_0x9fd82e){throw new db[(_0xb4ed('0x64'))][(_0xb4ed('0x56'))](_0xb4ed('0x88'));}if(!_0x9fd82e[_0xb4ed('0x89')]||!_0x9fd82e[_0xb4ed('0x8a')]){throw new db[(_0xb4ed('0x64'))][(_0xb4ed('0x56'))]('Cloud\x20Provider\x20not\x20configured');}_0x43b494=_0x9fd82e;return getBucketslist(_0x43b494[_0xb4ed('0x89')],_0x43b494[_0xb4ed('0x8a')],_0x279610[_0xb4ed('0x8b')]);})['then'](function(_0x88449b){if(_0x88449b&&_0x88449b['Buckets']){var _0x175e4c=_[_0xb4ed('0x4b')](_0x88449b[_0xb4ed('0x8c')],function(_0x4136ac){return _0x4136ac[_0xb4ed('0x8d')]===_0x279610[_0xb4ed('0x82')];});if(!_0x175e4c){logger[_0xb4ed('0x67')](util['format'](_0xb4ed('0x8e'),_0x22da0c[_0xb4ed('0x48')]['id'],_0x279610[_0xb4ed('0x82')]));return createBucket(_0x43b494['data1'],_0x43b494[_0xb4ed('0x8a')],_0x279610[_0xb4ed('0x8b')],_0x279610['bucket']);}logger[_0xb4ed('0x67')](util['format'](_0xb4ed('0x8f'),_0x22da0c[_0xb4ed('0x48')]['id'],_0x279610['bucket']));return;}})[_0xb4ed('0x44')](function(_0x296c53){if(_0x355e90[_0xb4ed('0x7a')]===_0xb4ed('0x90')){return transcribe(_0x22da0c['params']['id'],_0x43b494[_0xb4ed('0x89')],_0x43b494[_0xb4ed('0x8a')],_0x279610[_0xb4ed('0x8b')],_0x279610[_0xb4ed('0x82')],_0x355e90[_0xb4ed('0x51')],_0x279610[_0xb4ed('0x81')]);}else{logger[_0xb4ed('0x67')](util['format'](_0xb4ed('0x91'),_0x22da0c['params']['id']));return{'transcribeStatus':_0xb4ed('0x92')};}})[_0xb4ed('0x44')](function(_0x11c071){if(_0x11c071){_0x11c071[_0xb4ed('0x93')]=_0x22da0c['body']['runSentiment'];return _0x355e90[_0xb4ed('0x94')](_0x11c071);}})[_0xb4ed('0x44')](respondWithResult(_0xc91f02,null))['catch'](handleError(_0xc91f02,null));};function writeFile(_0x25f438,_0x55bae0){return new Promise(function(_0x4a2523,_0x2b34b8){fs[_0xb4ed('0x95')](_0x55bae0,_0x25f438,function(_0x188ecd,_0x525f8c){if(_0x188ecd){return _0x2b34b8(_0x188ecd);}else{return _0x4a2523(_0x525f8c);}});});}exports[_0xb4ed('0x96')]=function(_0x274632,_0x3f6fa5,_0x469b03){return db[_0xb4ed('0x2a')]['findOne']({'where':{'id':_0x274632[_0xb4ed('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f6fa5))[_0xb4ed('0x44')](function(_0x13626b){if(_0x13626b&&_0x13626b['fileText']){var _0x2f26c9=_0x13626b[_0xb4ed('0x97')];var _0xfc23d6=config[_0xb4ed('0x98')]+'/server/files/transcribes/transcribe_'+_0x13626b['id']+_0xb4ed('0x99');if(fs[_0xb4ed('0x52')](_0xfc23d6)){return _0xfc23d6;}return writeFile(_0x2f26c9,_0xfc23d6)[_0xb4ed('0x44')](function(){return _0xfc23d6;});}else{throw new db[(_0xb4ed('0x64'))]['ValidationError'](_0xb4ed('0x9a'));}})[_0xb4ed('0x44')](function(_0x1bbf10){return _0x3f6fa5[_0xb4ed('0x59')](_0x1bbf10);})[_0xb4ed('0x46')](handleError(_0x3f6fa5));}; \ No newline at end of file +var _0x054f=['[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','intersection','include','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','sequelize','MD5','col','token','push','ValidationError','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','File:\x20\x22','listBuckets','createBucket','TranscribeService','format','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Name'];(function(_0x21b293,_0x352a44){var _0xd73e84=function(_0x16916b){while(--_0x16916b){_0x21b293['push'](_0x21b293['shift']());}};_0xd73e84(++_0x352a44);}(_0x054f,0x9d));var _0xf054=function(_0x5d08de,_0x44e601){_0x5d08de=_0x5d08de-0x0;var _0x5a2fae=_0x054f[_0x5d08de];return _0x5a2fae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf054('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf054('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf054('0x2'));var Mustache=require(_0xf054('0x3'));var util=require(_0xf054('0x4'));var path=require(_0xf054('0x5'));var sox=require(_0xf054('0x6'));var csv=require(_0xf054('0x7'));var ejs=require(_0xf054('0x8'));var fs=require('fs');var fs_extra=require(_0xf054('0x9'));var _=require('lodash');var squel=require(_0xf054('0xa'));var crypto=require(_0xf054('0xb'));var jsforce=require(_0xf054('0xc'));var deskjs=require(_0xf054('0xd'));var toCsv=require(_0xf054('0x7'));var querystring=require(_0xf054('0xe'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xf054('0xf'));var Redis=require(_0xf054('0x10'));var authService=require(_0xf054('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf054('0x12'));var hardwareService=require(_0xf054('0x13'));var logger=require(_0xf054('0x14'))('api');var utils=require(_0xf054('0x15'));var config=require(_0xf054('0x16'));var licenseUtil=require(_0xf054('0x17'));var db=require(_0xf054('0x18'))['db'];function respondWithStatusCode(_0x40e14b,_0x2eee94){_0x2eee94=_0x2eee94||0xcc;return function(_0x4c52e9){if(_0x4c52e9){return _0x40e14b[_0xf054('0x19')](_0x2eee94);}return _0x40e14b[_0xf054('0x1a')](_0x2eee94)['end']();};}function respondWithResult(_0x2dbf11,_0x27e4fb){_0x27e4fb=_0x27e4fb||0xc8;return function(_0x47e3f4){if(_0x47e3f4){return _0x2dbf11[_0xf054('0x1a')](_0x27e4fb)[_0xf054('0x1b')](_0x47e3f4);}};}function respondWithFilteredResult(_0x56fd0c,_0x1587de){return function(_0xd8ed90){if(_0xd8ed90){var _0x5f4b39=typeof _0x1587de['offset']===_0xf054('0x1c')&&typeof _0x1587de[_0xf054('0x1d')]===_0xf054('0x1c');var _0x49dd81=_0xd8ed90[_0xf054('0x1e')];var _0x1ea90c=_0x5f4b39?0x0:_0x1587de[_0xf054('0x1f')];var _0x306549=_0x5f4b39?_0xd8ed90['count']:_0x1587de[_0xf054('0x1f')]+_0x1587de[_0xf054('0x1d')];var _0x332d20;if(_0x306549>=_0x49dd81){_0x306549=_0x49dd81;_0x332d20=0xc8;}else{_0x332d20=0xce;}_0x56fd0c['status'](_0x332d20);return _0x56fd0c['set'](_0xf054('0x20'),_0x1ea90c+'-'+_0x306549+'/'+_0x49dd81)[_0xf054('0x1b')](_0xd8ed90);}return null;};}function patchUpdates(_0x47791a){return function(_0x7c083){try{jsonpatch[_0xf054('0x21')](_0x7c083,_0x47791a,!![]);}catch(_0x281a94){return BPromise['reject'](_0x281a94);}return _0x7c083[_0xf054('0x22')]();};}function saveUpdates(_0x2e00cb,_0x1e341b){return function(_0x1bf2d0){if(_0x1bf2d0){return _0x1bf2d0[_0xf054('0x23')](_0x2e00cb)[_0xf054('0x24')](function(_0x4c7349){return _0x4c7349;});}return null;};}function removeEntity(_0x598d4f,_0x5d4623){return function(_0x359d59){if(_0x359d59){return _0x359d59[_0xf054('0x25')]()[_0xf054('0x24')](function(){_0x598d4f[_0xf054('0x1a')](0xcc)[_0xf054('0x26')]();});}};}function handleEntityNotFound(_0x437b78,_0x10e631){return function(_0x15817f){if(!_0x15817f){_0x437b78[_0xf054('0x19')](0x194);}return _0x15817f;};}function handleError(_0x13a309,_0x1877de){_0x1877de=_0x1877de||0x1f4;return function(_0x569db1){logger['error'](_0x569db1[_0xf054('0x27')]);if(_0x569db1[_0xf054('0x28')]){delete _0x569db1['name'];}_0x13a309[_0xf054('0x1a')](_0x1877de)[_0xf054('0x29')](_0x569db1);};}exports[_0xf054('0x2a')]=function(_0x197b7d,_0x7c372c){var _0x2df765={},_0xa50096={},_0x16ca4b={'count':0x0,'rows':[]};var _0x4af5fe=_[_0xf054('0x2b')](db[_0xf054('0x2c')][_0xf054('0x2d')],function(_0x25cff6){return{'name':_0x25cff6[_0xf054('0x2e')],'type':_0x25cff6['type'][_0xf054('0x2f')]};});_0xa50096[_0xf054('0x30')]=_['differenceBy'](_['map'](_0x4af5fe,_0xf054('0x28')),['format']);_0xa50096[_0xf054('0x31')]=_[_0xf054('0x32')](_0x197b7d[_0xf054('0x31')]);_0xa50096[_0xf054('0x33')]=_['intersection'](_0xa50096[_0xf054('0x30')],_0xa50096['query']);_0x2df765[_0xf054('0x34')]=_['intersection'](_0xa50096[_0xf054('0x30')],qs['fields'](_0x197b7d[_0xf054('0x31')][_0xf054('0x35')]));_0x2df765[_0xf054('0x34')]=_0x2df765[_0xf054('0x34')][_0xf054('0x36')]?_0x2df765[_0xf054('0x34')]:_0xa50096[_0xf054('0x30')];if(!_0x197b7d['query']['hasOwnProperty'](_0xf054('0x37'))){_0x2df765[_0xf054('0x1d')]=qs['limit'](_0x197b7d[_0xf054('0x31')][_0xf054('0x1d')]);_0x2df765['offset']=qs[_0xf054('0x1f')](_0x197b7d[_0xf054('0x31')][_0xf054('0x1f')]);}_0x2df765[_0xf054('0x38')]=qs[_0xf054('0x39')](_0x197b7d[_0xf054('0x31')]['sort']);_0x2df765[_0xf054('0x3a')]=qs[_0xf054('0x33')](_[_0xf054('0x3b')](_0x197b7d[_0xf054('0x31')],_0xa50096[_0xf054('0x33')]),_0x4af5fe);if(_0x197b7d[_0xf054('0x31')]['filter']){_0x2df765[_0xf054('0x3a')]=_[_0xf054('0x3c')](_0x2df765['where'],{'$or':_[_0xf054('0x2b')](_0x4af5fe,function(_0x47c1c9){if(_0x47c1c9[_0xf054('0x3d')]!==_0xf054('0x3e')){var _0x5b6e2e={};_0x5b6e2e[_0x47c1c9[_0xf054('0x28')]]={'$like':'%'+_0x197b7d[_0xf054('0x31')][_0xf054('0x3f')]+'%'};return _0x5b6e2e;}})});}_0x2df765=_[_0xf054('0x3c')]({},_0x2df765,_0x197b7d[_0xf054('0x40')]);var _0x5b9e1d={'where':_0x2df765[_0xf054('0x3a')]};return db[_0xf054('0x2c')][_0xf054('0x1e')](_0x5b9e1d)[_0xf054('0x24')](function(_0x2265bf){_0x16ca4b[_0xf054('0x1e')]=_0x2265bf;if(_0x197b7d['query'][_0xf054('0x41')]){_0x2df765['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xf054('0x42')](_0x2df765);})[_0xf054('0x24')](function(_0x2a1ff1){_0x16ca4b[_0xf054('0x43')]=_0x2a1ff1;return _0x16ca4b;})[_0xf054('0x24')](respondWithFilteredResult(_0x7c372c,_0x2df765))[_0xf054('0x44')](handleError(_0x7c372c,null));};exports['show']=function(_0x31c3cb,_0x292ff3){var _0x5989e5={'raw':![],'where':{'id':_0x31c3cb[_0xf054('0x45')]['id']}},_0x3e54e6={};_0x3e54e6['model']=_[_0xf054('0x32')](db[_0xf054('0x2c')][_0xf054('0x2d')]);_0x3e54e6['query']=_[_0xf054('0x32')](_0x31c3cb[_0xf054('0x31')]);_0x3e54e6['filters']=_[_0xf054('0x46')](_0x3e54e6['model'],_0x3e54e6[_0xf054('0x31')]);_0x5989e5['attributes']=_[_0xf054('0x46')](_0x3e54e6[_0xf054('0x30')],qs[_0xf054('0x35')](_0x31c3cb[_0xf054('0x31')][_0xf054('0x35')]));_0x5989e5[_0xf054('0x34')]=_0x5989e5[_0xf054('0x34')][_0xf054('0x36')]?_0x5989e5['attributes']:_0x3e54e6[_0xf054('0x30')];if(_0x31c3cb[_0xf054('0x31')][_0xf054('0x41')]){_0x5989e5[_0xf054('0x47')]=[{'all':!![]}];}_0x5989e5=_[_0xf054('0x3c')]({},_0x5989e5,_0x31c3cb[_0xf054('0x40')]);return db[_0xf054('0x2c')][_0xf054('0x48')](_0x5989e5)['then'](handleEntityNotFound(_0x292ff3,null))['then'](respondWithResult(_0x292ff3,null))[_0xf054('0x44')](handleError(_0x292ff3,null));};exports[_0xf054('0x49')]=function(_0x5a5ea0,_0x3ad366){return db[_0xf054('0x2c')][_0xf054('0x49')](_0x5a5ea0[_0xf054('0x4a')],{})[_0xf054('0x24')](respondWithResult(_0x3ad366,0xc9))[_0xf054('0x44')](handleError(_0x3ad366,null));};exports[_0xf054('0x23')]=function(_0x3aa7c4,_0x13e04e){if(_0x3aa7c4['body']['id']){delete _0x3aa7c4[_0xf054('0x4a')]['id'];}return db['VoiceRecording'][_0xf054('0x48')]({'where':{'id':_0x3aa7c4[_0xf054('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e04e,null))[_0xf054('0x24')](saveUpdates(_0x3aa7c4['body'],null))[_0xf054('0x24')](respondWithResult(_0x13e04e,null))[_0xf054('0x44')](handleError(_0x13e04e,null));};exports[_0xf054('0x4b')]=function(_0x3a509b,_0x3d5eb5){return db[_0xf054('0x2c')]['describe']()[_0xf054('0x24')](respondWithResult(_0x3d5eb5,null))[_0xf054('0x44')](handleError(_0x3d5eb5,null));};exports[_0xf054('0x4c')]=function(_0x178bf5,_0x364469,_0x17fc5d){var _0x3bae3c=require(_0xf054('0x4d'));var _0x3ef352=![];var _0xda1b2a={};if(_0x178bf5[_0xf054('0x31')]['type']&&_0x178bf5[_0xf054('0x31')][_0xf054('0x3d')]===_0xf054('0x4e')){_0xda1b2a[_0xf054('0x4e')]=_0x178bf5[_0xf054('0x45')]['id'];}else{_0xda1b2a['id']=_0x178bf5[_0xf054('0x45')]['id'];}return db['VoiceRecording']['find']({'where':_0xda1b2a,'attributes':['id',_0xf054('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x364469,null))['then'](function(_0x75f135){if(_0x75f135){var _0x546de2=_0x75f135[_0xf054('0x4f')];var _0x3f047a=util['format'](_0xf054('0x50'),_0x546de2);if(fs[_0xf054('0x51')](_0x3f047a)){_0x3ef352=!![];return _0x3bae3c[_0xf054('0x52')](_0x3f047a,_0x546de2,config[_0xf054('0x53')][_0xf054('0x54')])['then'](function(){return _0x75f135;});}return _0x75f135;}})[_0xf054('0x24')](function(_0x4a4116){if(_0x4a4116){var _0x1d68d2=_0x4a4116[_0xf054('0x4f')];if(!fs[_0xf054('0x51')](_0x1d68d2)){throw new db[(_0xf054('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4a4116[_0xf054('0x56')]){return _0x364469[_0xf054('0x4c')](_0x1d68d2,_0x4a4116[_0xf054('0x56')]+path[_0xf054('0x57')](_0x1d68d2),function(){if(_0x3ef352){fs[_0xf054('0x58')](_0x1d68d2);}});}else{return _0x364469[_0xf054('0x4c')](_0x1d68d2,function(_0xf65447){if(_0x3ef352){fs[_0xf054('0x58')](_0x1d68d2);}});}}})['catch'](function(_0x523364){if(_0x523364[_0xf054('0x59')]===_0xf054('0x5a')){_0x364469['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x364469,null);}});};exports['downloads']=function(_0x3b0c88,_0x1419c1,_0x5e6c7e){var _0x4d78c4=require('../../components/encryptor');var _0x45385c=![];var _0x2b31b5={'$and':[db[_0xf054('0x5b')][_0xf054('0x3a')](db[_0xf054('0x5b')]['fn'](_0xf054('0x5c'),db[_0xf054('0x5b')][_0xf054('0x5d')](_0xf054('0x4e'))),_0x3b0c88[_0xf054('0x31')][_0xf054('0x5e')])]};if(_0x3b0c88[_0xf054('0x31')][_0xf054('0x3d')]&&_0x3b0c88[_0xf054('0x31')][_0xf054('0x3d')]===_0xf054('0x4e')){_0x2b31b5['$and'][_0xf054('0x5f')]({'uniqueid':_0x3b0c88[_0xf054('0x45')]['id']});}else{_0x2b31b5['$and'][_0xf054('0x5f')]({'id':_0x3b0c88[_0xf054('0x45')]['id']});}return db[_0xf054('0x2c')][_0xf054('0x48')]({'where':_0x2b31b5,'attributes':['id',_0xf054('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x1419c1,null))[_0xf054('0x24')](function(_0x4c2356){if(_0x4c2356){var _0x1a1efe=util['format'](_0xf054('0x50'),_0x4c2356[_0xf054('0x4f')]);if(fs[_0xf054('0x51')](_0x1a1efe)){_0x45385c=!![];return _0x4d78c4[_0xf054('0x52')](_0x1a1efe,_0x4c2356[_0xf054('0x4f')],config[_0xf054('0x53')][_0xf054('0x54')])[_0xf054('0x24')](function(){return _0x4c2356;});}return _0x4c2356;}})[_0xf054('0x24')](function(_0x4967d1){if(_0x4967d1){if(!fs[_0xf054('0x51')](_0x4967d1['value'])){throw new db[(_0xf054('0x55'))][(_0xf054('0x60'))](_0xf054('0x5a'));}if(_0x4967d1[_0xf054('0x56')]){return _0x1419c1[_0xf054('0x4c')](_0x4967d1['value'],_0x4967d1[_0xf054('0x56')]+path[_0xf054('0x57')](_0x4967d1[_0xf054('0x4f')]),function(){if(_0x45385c){fs[_0xf054('0x58')](_0x4967d1[_0xf054('0x4f')]);}});}else{return _0x1419c1[_0xf054('0x4c')](_0x4967d1[_0xf054('0x4f')],function(_0x13129e){if(_0x45385c){fs['unlink'](_0x4967d1[_0xf054('0x4f')]);}});}}})[_0xf054('0x44')](handleError(_0x1419c1,null));};exports[_0xf054('0x25')]=function(_0x331dde,_0x40c2e2){return db[_0xf054('0x2c')]['find']({'where':{'id':_0x331dde['params']['id']}})[_0xf054('0x24')](function(_0x55a077){if(_['isNil'](_0x55a077)){throw new ReferenceError('Entity\x20not\x20found');}return _0x55a077;})[_0xf054('0x24')](function(_0x3f67eb){var _0x349dde=_0x3f67eb[_0xf054('0x4f')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x349dde);if(!_['isNil'](_0x3f67eb[_0xf054('0x4f')])&&fs[_0xf054('0x51')](_0x349dde)){logger[_0xf054('0x61')]('File:\x20\x22'+_0x349dde+_0xf054('0x62'));fs[_0xf054('0x63')](_0x349dde);}_0x349dde=_0x349dde+'.cypher';if(!_[_0xf054('0x64')](_0x3f67eb['value'])&&fs[_0xf054('0x51')](_0x349dde)){logger['info'](_0xf054('0x65')+_0x349dde+_0xf054('0x62'));fs['unlinkSync'](_0x349dde);}return _0x3f67eb;})[_0xf054('0x24')](function(_0x56456f){if(!_0x56456f)throw new InternalError();return _0x56456f[_0xf054('0x25')]();})[_0xf054('0x24')](function(){_0x40c2e2[_0xf054('0x1a')](0xcc)['end']();})[_0xf054('0x44')](handleError(_0x40c2e2,null));};function getBucketslist(_0x29c1d0,_0x443611,_0x5d7f88){return new Promise(function(_0x27d7ab,_0x1af28e){var _0x32f5b6=new AWS['S3']({'accessKeyId':_0x443611,'secretAccessKey':_0x29c1d0,'region':_0x5d7f88});_0x32f5b6[_0xf054('0x66')]({},function(_0x39cda6,_0xb1f969){if(_0x39cda6){return _0x1af28e(_0x39cda6);}else{return _0x27d7ab(_0xb1f969);}});});}function createBucket(_0x129537,_0x1a5e08,_0x5b8cc6,_0x2133a5){return new Promise(function(_0x5bf143,_0x424836){var _0x52c102=new AWS['S3']({'accessKeyId':_0x1a5e08,'secretAccessKey':_0x129537,'region':_0x5b8cc6});_0x52c102[_0xf054('0x67')]({'Bucket':_0x2133a5},function(_0x28b49e,_0x57b6ad){if(_0x28b49e){return _0x424836(_0x28b49e);}else{return _0x5bf143(_0x57b6ad);}});});}function uploadFile(_0x1c0df8,_0x3e1691,_0x51be99,_0x8318d6,_0x3ca404,_0x1a1457){return new Promise(function(_0x9cc12f,_0x100816){var _0x28d6be=new AWS['S3']({'accessKeyId':_0x3e1691,'secretAccessKey':_0x1c0df8,'region':_0x51be99});_0x28d6be['upload']({'Bucket':_0x8318d6,'Key':_0x3ca404,'Body':_0x1a1457},function(_0x321e46,_0x1c9cc0){if(_0x321e46){return _0x100816(_0x321e46);}else{return _0x9cc12f(_0x1c9cc0);}});});}function startTranscribe(_0x5eed48,_0x1554f8,_0x8b0b83,_0x396432,_0x40de65,_0x3a7fee){return new Promise(function(_0x1fdf87,_0x5db0d8){var _0x2b45f7=new AWS[(_0xf054('0x68'))]({'accessKeyId':_0x1554f8,'secretAccessKey':_0x5eed48,'region':_0x8b0b83});_0x2b45f7['startTranscriptionJob']({'TranscriptionJobName':_0x396432,'LanguageCode':_0x40de65,'Media':{'MediaFileUri':_0x3a7fee}},function(_0x86dfaa,_0x358564){if(_0x86dfaa){return _0x5db0d8(_0x86dfaa);}else{return _0x1fdf87(_0x358564);}});});}function transcribe(_0x32ff8e,_0x50ea15,_0x761057,_0x3bd143,_0x5ef071,_0x45d560,_0x2bff62){return new Promise(function(_0x354204,_0x574606){var _0x3d5b39={};logger[_0xf054('0x61')](util[_0xf054('0x69')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x32ff8e,_0x5ef071));return uploadFile(_0x50ea15,_0x761057,_0x3bd143,_0x5ef071,path[_0xf054('0x6a')](_0x45d560),fs[_0xf054('0x6b')](_0x45d560))[_0xf054('0x24')](function(_0x3d4687){logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x6c'),_0x32ff8e,_0x5ef071,_0x3d4687[_0xf054('0x6d')]));_0x3d5b39[_0xf054('0x6e')]=_0x3d4687[_0xf054('0x6f')];_0x3d5b39['location']=_0x3d4687[_0xf054('0x6d')];logger[_0xf054('0x61')](util[_0xf054('0x69')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x32ff8e));return startTranscribe(_0x50ea15,_0x761057,_0x3bd143,uuidv4(),_0x2bff62,_0x3d4687[_0xf054('0x6d')]);})[_0xf054('0x24')](function(_0x132df0){logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x70'),_0x32ff8e,_0x132df0[_0xf054('0x71')][_0xf054('0x72')]));_0x3d5b39[_0xf054('0x73')]=_0x132df0[_0xf054('0x71')][_0xf054('0x72')];_0x3d5b39['transcribeStatus']=_0x132df0['TranscriptionJob']['TranscriptionJobStatus'];return _0x354204(_0x3d5b39);})[_0xf054('0x44')](function(_0x149924){return _0x574606(_0x149924);});});}exports[_0xf054('0x74')]=function(_0x21bda6,_0x58eb6f,_0x34b96c){var _0x48634c;var _0x25746b;var _0x14b8ed;var _0x3a5637=require(_0xf054('0x4d'));return db[_0xf054('0x2c')][_0xf054('0x75')]({'where':{'id':_0x21bda6[_0xf054('0x45')]['id']}})['then'](function(_0x3fcf90){if(_0x3fcf90){var _0x13c485=util[_0xf054('0x69')](_0xf054('0x50'),_0x3fcf90[_0xf054('0x4f')]);if(fs['existsSync'](_0x13c485)){cypher=!![];return _0x3a5637[_0xf054('0x52')](_0x13c485,_0x3fcf90[_0xf054('0x4f')],config[_0xf054('0x53')][_0xf054('0x54')])[_0xf054('0x24')](function(){return _0x3fcf90;});}return _0x3fcf90;}})[_0xf054('0x24')](function(_0x23b6dd){if(!_0x23b6dd){throw new db['Sequelize'][(_0xf054('0x60'))](_0xf054('0x76'));}_0x25746b=_0x23b6dd;return db['Setting'][_0xf054('0x75')]({'where':{'id':0x1}});})[_0xf054('0x24')](handleEntityNotFound(_0x58eb6f,null))[_0xf054('0x24')](function(_0xa0119c){if(_0xa0119c){_0x48634c=_0xa0119c;if(!_0x48634c[_0xf054('0x77')]||!_0x48634c[_0xf054('0x78')]||!_0x48634c[_0xf054('0x79')]||!_0x48634c['language']||!_0x48634c[_0xf054('0x6e')]){throw new db[(_0xf054('0x55'))]['ValidationError'](_0xf054('0x7a'));}if(_0x21bda6['body']['runSentiment']&&(!_0x48634c[_0xf054('0x7b')]||!_0x48634c[_0xf054('0x7c')]||!_0x48634c[_0xf054('0x7d')]||!_0x48634c[_0xf054('0x7e')]||!_0x48634c['bucket'])){throw new db[(_0xf054('0x55'))][(_0xf054('0x60'))](_0xf054('0x7f'));}return db[_0xf054('0x80')]['findOne']({'where':{'id':_0x48634c['transcribeAccountId']}});}})[_0xf054('0x24')](function(_0xfdef1e){if(!_0xfdef1e){throw new db['Sequelize'][(_0xf054('0x60'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xfdef1e[_0xf054('0x81')]||!_0xfdef1e[_0xf054('0x82')]){throw new db['Sequelize'][(_0xf054('0x60'))](_0xf054('0x83'));}_0x14b8ed=_0xfdef1e;return getBucketslist(_0x14b8ed[_0xf054('0x81')],_0x14b8ed['data2'],_0x48634c['transcribeRegion']);})[_0xf054('0x24')](function(_0x4fa971){if(_0x4fa971&&_0x4fa971['Buckets']){var _0x5251b3=_[_0xf054('0x48')](_0x4fa971['Buckets'],function(_0xd7f1d3){return _0xd7f1d3[_0xf054('0x84')]===_0x48634c[_0xf054('0x6e')];});if(!_0x5251b3){logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x85'),_0x21bda6[_0xf054('0x45')]['id'],_0x48634c['bucket']));return createBucket(_0x14b8ed[_0xf054('0x81')],_0x14b8ed['data2'],_0x48634c['transcribeRegion'],_0x48634c[_0xf054('0x6e')]);}logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x86'),_0x21bda6[_0xf054('0x45')]['id'],_0x48634c[_0xf054('0x6e')]));return;}})[_0xf054('0x24')](function(_0x540e7f){if(_0x25746b[_0xf054('0x87')]==='NEW'){return transcribe(_0x21bda6['params']['id'],_0x14b8ed[_0xf054('0x81')],_0x14b8ed[_0xf054('0x82')],_0x48634c[_0xf054('0x79')],_0x48634c[_0xf054('0x6e')],_0x25746b[_0xf054('0x4f')],_0x48634c['language']);}else{logger[_0xf054('0x61')](util[_0xf054('0x69')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x21bda6[_0xf054('0x45')]['id']));return{'transcribeStatus':_0xf054('0x88')};}})['then'](function(_0x5e619b){if(_0x5e619b){_0x5e619b[_0xf054('0x89')]=_0x21bda6[_0xf054('0x4a')]['runSentiment'];return _0x25746b[_0xf054('0x8a')](_0x5e619b);}})['then'](respondWithResult(_0x58eb6f,null))[_0xf054('0x44')](handleError(_0x58eb6f,null));};function writeFile(_0x23f1d4,_0x58dd3f){return new Promise(function(_0xbf316b,_0x5c499b){fs[_0xf054('0x8b')](_0x58dd3f,_0x23f1d4,function(_0x5758d7,_0x4241a6){if(_0x5758d7){return _0x5c499b(_0x5758d7);}else{return _0xbf316b(_0x4241a6);}});});}exports['downloadTranscribe']=function(_0x5ac6f0,_0x3d2014,_0x2bb5f5){return db[_0xf054('0x2c')][_0xf054('0x75')]({'where':{'id':_0x5ac6f0['params']['id']}})[_0xf054('0x24')](handleEntityNotFound(_0x3d2014))[_0xf054('0x24')](function(_0xc4b86b){if(_0xc4b86b&&_0xc4b86b['fileText']){var _0x2d7a96=_0xc4b86b[_0xf054('0x8c')];var _0x1264e6=config[_0xf054('0x8d')]+_0xf054('0x8e')+_0xc4b86b['id']+_0xf054('0x8f');if(fs[_0xf054('0x51')](_0x1264e6)){return _0x1264e6;}return writeFile(_0x2d7a96,_0x1264e6)['then'](function(){return _0x1264e6;});}else{throw new db['Sequelize'][(_0xf054('0x60'))](_0xf054('0x90'));}})[_0xf054('0x24')](function(_0x5b9d2d){return _0x3d2014[_0xf054('0x4c')](_0x5b9d2d);})['catch'](handleError(_0x3d2014));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3675f38..9c7a553 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 _0x3308=['uniqueid','transcribeStatus','define','VoiceRecording','voice_recordings'];(function(_0x307243,_0xa4f148){var _0x2eeac8=function(_0x1789d7){while(--_0x1789d7){_0x307243['push'](_0x307243['shift']());}};_0x2eeac8(++_0xa4f148);}(_0x3308,0x12e));var _0x8330=function(_0x201245,_0x39ba07){_0x201245=_0x201245-0x0;var _0x26ed35=_0x3308[_0x201245];return _0x26ed35;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x4f0007,_0x42bb8d){return _0x4f0007[_0x8330('0x0')](_0x8330('0x1'),attributes,{'tableName':_0x8330('0x2'),'paranoid':![],'indexes':[{'name':_0x8330('0x3'),'fields':['uniqueid']},{'name':_0x8330('0x4'),'fields':[_0x8330('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9de3=['define','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0xb47186,_0x34f69e){var _0x561e94=function(_0x3332cb){while(--_0x3332cb){_0xb47186['push'](_0xb47186['shift']());}};_0x561e94(++_0x34f69e);}(_0x9de3,0xea));var _0x39de=function(_0x2d0a75,_0xa69252){_0x2d0a75=_0x2d0a75-0x0;var _0x35b065=_0x9de3[_0x2d0a75];return _0x35b065;};'use strict';var attributes=require(_0x39de('0x0'));module['exports']=function(_0x15cb04,_0x43fb06){return _0x15cb04[_0x39de('0x1')]('VoiceRecording',attributes,{'tableName':_0x39de('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x39de('0x3')]},{'name':_0x39de('0x4'),'fields':[_0x39de('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 46f30dd..e90fd62 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 _0xb44a=['client','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0xb44a,0x1c2));var _0xab44=function(_0x52e040,_0x583d2f){_0x52e040=_0x52e040-0x0;var _0x4cd278=_0xb44a[_0x52e040];return _0x4cd278;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['update'](_0x354b09[_0xab44('0x14')],{'raw':_0x354b09[_0xab44('0x15')]?_0x354b09[_0xab44('0x15')][_0xab44('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x354b09[_0xab44('0x15')]?_0x354b09['options'][_0xab44('0x17')]||null:null,'attributes':_0x354b09['options']?_0x354b09[_0xab44('0x15')][_0xab44('0x18')]||null:null,'limit':_0x354b09[_0xab44('0x15')]?_0x354b09[_0xab44('0x15')]['limit']||null:null})[_0xab44('0x9')](function(_0x26fc03){logger[_0xab44('0x10')](_0xab44('0x12'),_0x354b09);logger[_0xab44('0xb')](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x26fc03));_0x310b15(_0x26fc03);})['catch'](function(_0x595761){logger[_0xab44('0xd')]('UpdateVoiceRecording',_0x595761[_0xab44('0xf')],_0x354b09);_0xc4b3dc(_0x44fa43['error'](0x1f4,_0x595761[_0xab44('0xf')]));});});};exports['CreateVoiceRecording']=function(_0x531583){var _0x8e60fa=this;return new Promise(function(_0x25287b,_0x259192){var _0x4620ed=require(_0xab44('0x19'));var _0x4e820c;return db[_0xab44('0x1a')][_0xab44('0x1b')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xab44('0x9')](function(_0xebb7d1){_0x4e820c=_0xebb7d1;return db[_0xab44('0x13')][_0xab44('0x1c')](_0x531583[_0xab44('0x14')]);})[_0xab44('0x9')](function(_0x59f844){if(_0x4e820c[_0xab44('0x1d')]&&fs[_0xab44('0x1e')](_0x59f844[_0xab44('0x1f')])){var _0x47e1be=util['format'](_0xab44('0x20'),_0x59f844['value']);return _0x4620ed['encryptFile'](_0x59f844[_0xab44('0x1f')],_0x47e1be,config[_0xab44('0x21')][_0xab44('0x22')])[_0xab44('0x9')](function(){fs[_0xab44('0x23')](_0x59f844[_0xab44('0x1f')]);logger[_0xab44('0x10')](_0xab44('0x24'));return _0x59f844;});}return _0x59f844;})[_0xab44('0x9')](function(_0x1e8e9d){logger[_0xab44('0x10')](_0xab44('0x25'),_0x531583);logger[_0xab44('0xb')](_0xab44('0x25'),_0x531583,JSON['stringify'](_0x1e8e9d));_0x25287b(_0x1e8e9d);})['catch'](function(_0x27e318){logger[_0xab44('0xd')]('CreateVoiceRecording',_0x27e318[_0xab44('0xf')],_0x531583);_0x259192(_0x8e60fa[_0xab44('0xd')](0x1f4,_0x27e318[_0xab44('0xf')]));});});}; \ No newline at end of file +var _0x5f2f=['UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x520b61,_0x4fdba9){var _0x328ae4=function(_0x18c4d7){while(--_0x18c4d7){_0x520b61['push'](_0x520b61['shift']());}};_0x328ae4(++_0x4fdba9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x581522,_0x28b40d){_0x581522=_0x581522-0x0;var _0x160ae5=_0x5f2f[_0x581522];return _0x160ae5;};'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')]('VoiceRecording,\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?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x21')]=function(_0x13a3be){var _0x281ec8=this;return new Promise(function(_0x294414,_0x4ab014){var _0xaa2602=require(_0xf5f2('0x22'));var _0x375ca8;return db[_0xf5f2('0x23')][_0xf5f2('0x24')]({'attributes':['id',_0xf5f2('0x25')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x53cb96){_0x375ca8=_0x53cb96;return db[_0xf5f2('0x18')][_0xf5f2('0x26')](_0x13a3be[_0xf5f2('0x1a')]);})['then'](function(_0x5a2c7e){if(_0x375ca8[_0xf5f2('0x25')]&&fs[_0xf5f2('0x27')](_0x5a2c7e[_0xf5f2('0x28')])){var _0x153924=util[_0xf5f2('0x29')]('%s.cypher',_0x5a2c7e['value']);return _0xaa2602[_0xf5f2('0x2a')](_0x5a2c7e['value'],_0x153924,config[_0xf5f2('0x2b')]['recording'])[_0xf5f2('0x20')](function(){fs[_0xf5f2('0x2c')](_0x5a2c7e[_0xf5f2('0x28')]);logger[_0xf5f2('0xd')](_0xf5f2('0x2d'));return _0x5a2c7e;});}return _0x5a2c7e;})[_0xf5f2('0x20')](function(_0x2ac089){logger[_0xf5f2('0xd')]('CreateVoiceRecording',_0x13a3be);logger[_0xf5f2('0xf')](_0xf5f2('0x21'),_0x13a3be,JSON[_0xf5f2('0x10')](_0x2ac089));_0x294414(_0x2ac089);})[_0xf5f2('0x16')](function(_0x1408b9){logger[_0xf5f2('0x11')](_0xf5f2('0x21'),_0x1408b9['message'],_0x13a3be);_0x4ab014(_0x281ec8[_0xf5f2('0x11')](0x1f4,_0x1408b9[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 6f9e866..4e53148 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 _0x48fc=['index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x2ac04c,_0x773cd7){var _0x40e941=function(_0x8af020){while(--_0x8af020){_0x2ac04c['push'](_0x2ac04c['shift']());}};_0x40e941(++_0x773cd7);}(_0x48fc,0xf3));var _0xc48f=function(_0x5b2856,_0x5be399){_0x5b2856=_0x5b2856-0x0;var _0x20999e=_0x48fc[_0x5b2856];return _0x20999e;};'use strict';var multer=require(_0xc48f('0x0'));var util=require('util');var path=require(_0xc48f('0x1'));var timeout=require(_0xc48f('0x2'));var express=require('express');var router=express[_0xc48f('0x3')]();var fs_extra=require(_0xc48f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc48f('0x5'));var config=require(_0xc48f('0x6'));var controller=require(_0xc48f('0x7'));router[_0xc48f('0x8')]('/',auth['isAuthenticated'](),controller[_0xc48f('0x9')]);router[_0xc48f('0x8')](_0xc48f('0xa'),auth[_0xc48f('0xb')](),controller[_0xc48f('0xc')]);router[_0xc48f('0x8')](_0xc48f('0xd'),auth[_0xc48f('0xb')](),controller[_0xc48f('0xe')]);router[_0xc48f('0xf')]('/',auth[_0xc48f('0xb')](),controller['create']);router[_0xc48f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc48f('0x11')]);router[_0xc48f('0x12')]('/:id',auth[_0xc48f('0xb')](),controller[_0xc48f('0x13')]);module[_0xc48f('0x14')]=router; \ No newline at end of file +var _0x0c77=['/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','create','put'];(function(_0x4aa7ef,_0x43f4d1){var _0x468214=function(_0x52bb81){while(--_0x52bb81){_0x4aa7ef['push'](_0x4aa7ef['shift']());}};_0x468214(++_0x43f4d1);}(_0x0c77,0xec));var _0x70c7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0c77[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x70c7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70c7('0x1'));var express=require(_0x70c7('0x2'));var router=express[_0x70c7('0x3')]();var fs_extra=require(_0x70c7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x70c7('0x5'));var config=require(_0x70c7('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x70c7('0x7')](),controller[_0x70c7('0x8')]);router[_0x70c7('0x9')](_0x70c7('0xa'),auth['isAuthenticated'](),controller[_0x70c7('0xb')]);router[_0x70c7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x70c7('0xc')]);router[_0x70c7('0xd')]('/',auth[_0x70c7('0x7')](),controller[_0x70c7('0xe')]);router[_0x70c7('0xf')](_0x70c7('0x10'),auth[_0x70c7('0x7')](),controller[_0x70c7('0x11')]);router[_0x70c7('0x12')](_0x70c7('0x10'),auth[_0x70c7('0x7')](),controller[_0x70c7('0x13')]);module[_0x70c7('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 4ba368a..6d5a580 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 _0x7ee0=['ENUM','Yes','sequelize','moment','exports','blind','attended','STRING'];(function(_0x1e6a69,_0x19f4ce){var _0x50f433=function(_0xa023a1){while(--_0xa023a1){_0x1e6a69['push'](_0x1e6a69['shift']());}};_0x50f433(++_0x19f4ce);}(_0x7ee0,0x7a));var _0x07ee=function(_0x4b2722,_0x13096c){_0x4b2722=_0x4b2722-0x0;var _0x4324e2=_0x7ee0[_0x4b2722];return _0x4324e2;};'use strict';var Sequelize=require(_0x07ee('0x0'));var moment=require(_0x07ee('0x1'));module[_0x07ee('0x2')]={'type':{'type':Sequelize['ENUM'](_0x07ee('0x3'),_0x07ee('0x4'))},'result':{'type':Sequelize[_0x07ee('0x5')]},'transfererchannel':{'type':Sequelize[_0x07ee('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x07ee('0x5')]},'transferercalleridname':{'type':Sequelize[_0x07ee('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x07ee('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x07ee('0x5')]},'transferercontext':{'type':Sequelize[_0x07ee('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x07ee('0x5')]},'transfereechannel':{'type':Sequelize[_0x07ee('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x07ee('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x07ee('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x07ee('0x5')]},'transfereecontext':{'type':Sequelize[_0x07ee('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x07ee('0x5')]},'isexternal':{'type':Sequelize[_0x07ee('0x6')](_0x07ee('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x07ee('0x5')]}}; \ No newline at end of file +var _0xe240=['ENUM','Yes','sequelize','moment','exports','blind','attended','STRING'];(function(_0x50459c,_0x694c63){var _0x378186=function(_0x50ca73){while(--_0x50ca73){_0x50459c['push'](_0x50459c['shift']());}};_0x378186(++_0x694c63);}(_0xe240,0x112));var _0x0e24=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xe240[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0x0e24('0x0'));var moment=require(_0x0e24('0x1'));module[_0x0e24('0x2')]={'type':{'type':Sequelize['ENUM'](_0x0e24('0x3'),_0x0e24('0x4'))},'result':{'type':Sequelize[_0x0e24('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x0e24('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0e24('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x0e24('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x0e24('0x5')]},'transfererexten':{'type':Sequelize[_0x0e24('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x0e24('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x0e24('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0e24('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0e24('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x0e24('0x5')]},'transfereecontext':{'type':Sequelize[_0x0e24('0x5')]},'transfereeexten':{'type':Sequelize[_0x0e24('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x0e24('0x5')]},'isexternal':{'type':Sequelize[_0x0e24('0x6')](_0x0e24('0x7'),'No')},'context':{'type':Sequelize[_0x0e24('0x5')]},'extension':{'type':Sequelize[_0x0e24('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 89176c3..edaee9b 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 _0x88d5=['../../config/license/util','../../mysqldb','status','end','json','offset','count','limit','apply','reject','save','update','then','sendStatus','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','pick','filter','merge','VIRTUAL','where','VoiceTransferReport','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','options','create','body','destroy','find','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x88d5,0x19e));var _0x588d=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x88d5[_0x401ccd];return _0x5a57ad;};'use strict';var emlformat=require(_0x588d('0x0'));var rimraf=require(_0x588d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x588d('0x2'));var moment=require(_0x588d('0x3'));var BPromise=require(_0x588d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x588d('0x5'));var sox=require(_0x588d('0x6'));var csv=require(_0x588d('0x7'));var ejs=require(_0x588d('0x8'));var fs=require('fs');var fs_extra=require(_0x588d('0x9'));var _=require('lodash');var squel=require(_0x588d('0xa'));var crypto=require(_0x588d('0xb'));var jsforce=require(_0x588d('0xc'));var deskjs=require(_0x588d('0xd'));var toCsv=require(_0x588d('0x7'));var querystring=require(_0x588d('0xe'));var Papa=require(_0x588d('0xf'));var Redis=require('ioredis');var authService=require(_0x588d('0x10'));var qs=require(_0x588d('0x11'));var as=require(_0x588d('0x12'));var hardwareService=require(_0x588d('0x13'));var logger=require(_0x588d('0x14'))(_0x588d('0x15'));var utils=require(_0x588d('0x16'));var config=require(_0x588d('0x17'));var licenseUtil=require(_0x588d('0x18'));var db=require(_0x588d('0x19'))['db'];function respondWithStatusCode(_0x50714b,_0x58da84){_0x58da84=_0x58da84||0xcc;return function(_0x3bd58b){if(_0x3bd58b){return _0x50714b['sendStatus'](_0x58da84);}return _0x50714b[_0x588d('0x1a')](_0x58da84)[_0x588d('0x1b')]();};}function respondWithResult(_0x15557b,_0x205866){_0x205866=_0x205866||0xc8;return function(_0x99bd37){if(_0x99bd37){return _0x15557b['status'](_0x205866)[_0x588d('0x1c')](_0x99bd37);}};}function respondWithFilteredResult(_0x23a6fc,_0x59dc51){return function(_0x2e15c0){if(_0x2e15c0){var _0x5dfb66=typeof _0x59dc51[_0x588d('0x1d')]==='undefined'&&typeof _0x59dc51['limit']==='undefined';var _0x11a723=_0x2e15c0[_0x588d('0x1e')];var _0x442150=_0x5dfb66?0x0:_0x59dc51[_0x588d('0x1d')];var _0x171957=_0x5dfb66?_0x2e15c0[_0x588d('0x1e')]:_0x59dc51[_0x588d('0x1d')]+_0x59dc51[_0x588d('0x1f')];var _0x39bad4;if(_0x171957>=_0x11a723){_0x171957=_0x11a723;_0x39bad4=0xc8;}else{_0x39bad4=0xce;}_0x23a6fc[_0x588d('0x1a')](_0x39bad4);return _0x23a6fc['set']('Content-Range',_0x442150+'-'+_0x171957+'/'+_0x11a723)['json'](_0x2e15c0);}return null;};}function patchUpdates(_0x3e32d7){return function(_0x3b6626){try{jsonpatch[_0x588d('0x20')](_0x3b6626,_0x3e32d7,!![]);}catch(_0x2b15cd){return BPromise[_0x588d('0x21')](_0x2b15cd);}return _0x3b6626[_0x588d('0x22')]();};}function saveUpdates(_0x1e88b2,_0x554667){return function(_0x17b65a){if(_0x17b65a){return _0x17b65a[_0x588d('0x23')](_0x1e88b2)[_0x588d('0x24')](function(_0x3b0391){return _0x3b0391;});}return null;};}function removeEntity(_0x9b9dee,_0xf555c1){return function(_0x4063be){if(_0x4063be){return _0x4063be['destroy']()[_0x588d('0x24')](function(){_0x9b9dee['status'](0xcc)[_0x588d('0x1b')]();});}};}function handleEntityNotFound(_0x190c39,_0x333575){return function(_0x20f292){if(!_0x20f292){_0x190c39[_0x588d('0x25')](0x194);}return _0x20f292;};}function handleError(_0x192217,_0x2b3ca1){_0x2b3ca1=_0x2b3ca1||0x1f4;return function(_0x3d5f3c){logger['error'](_0x3d5f3c['stack']);if(_0x3d5f3c[_0x588d('0x26')]){delete _0x3d5f3c[_0x588d('0x26')];}_0x192217[_0x588d('0x1a')](_0x2b3ca1)[_0x588d('0x27')](_0x3d5f3c);};}exports[_0x588d('0x28')]=function(_0x106f18,_0x5ac35a){var _0x5317a2={},_0x12a969={},_0x482340={'count':0x0,'rows':[]};var _0x3d79f5=_[_0x588d('0x29')](db['VoiceTransferReport']['rawAttributes'],function(_0xb7881a){return{'name':_0xb7881a[_0x588d('0x2a')],'type':_0xb7881a[_0x588d('0x2b')][_0x588d('0x2c')]};});_0x12a969[_0x588d('0x2d')]=_['map'](_0x3d79f5,_0x588d('0x26'));_0x12a969[_0x588d('0x2e')]=_[_0x588d('0x2f')](_0x106f18[_0x588d('0x2e')]);_0x12a969[_0x588d('0x30')]=_[_0x588d('0x31')](_0x12a969[_0x588d('0x2d')],_0x12a969[_0x588d('0x2e')]);_0x5317a2['attributes']=_[_0x588d('0x31')](_0x12a969['model'],qs['fields'](_0x106f18['query'][_0x588d('0x32')]));_0x5317a2[_0x588d('0x33')]=_0x5317a2[_0x588d('0x33')]['length']?_0x5317a2[_0x588d('0x33')]:_0x12a969['model'];if(!_0x106f18[_0x588d('0x2e')]['hasOwnProperty']('nolimit')){_0x5317a2[_0x588d('0x1f')]=qs[_0x588d('0x1f')](_0x106f18[_0x588d('0x2e')][_0x588d('0x1f')]);_0x5317a2['offset']=qs[_0x588d('0x1d')](_0x106f18['query']['offset']);}_0x5317a2['order']=qs[_0x588d('0x34')](_0x106f18[_0x588d('0x2e')][_0x588d('0x34')]);_0x5317a2['where']=qs[_0x588d('0x30')](_[_0x588d('0x35')](_0x106f18['query'],_0x12a969[_0x588d('0x30')]),_0x3d79f5);if(_0x106f18[_0x588d('0x2e')][_0x588d('0x36')]){_0x5317a2['where']=_[_0x588d('0x37')](_0x5317a2['where'],{'$or':_['map'](_0x3d79f5,function(_0x1fca12){if(_0x1fca12[_0x588d('0x2b')]!==_0x588d('0x38')){var _0x561baa={};_0x561baa[_0x1fca12['name']]={'$like':'%'+_0x106f18[_0x588d('0x2e')][_0x588d('0x36')]+'%'};return _0x561baa;}})});}_0x5317a2=_[_0x588d('0x37')]({},_0x5317a2,_0x106f18['options']);var _0x41b2ac={'where':_0x5317a2[_0x588d('0x39')]};return db[_0x588d('0x3a')]['count'](_0x41b2ac)[_0x588d('0x24')](function(_0x3e73f9){_0x482340[_0x588d('0x1e')]=_0x3e73f9;if(_0x106f18[_0x588d('0x2e')]['includeAll']){_0x5317a2['include']=[{'all':!![]}];}return db[_0x588d('0x3a')][_0x588d('0x3b')](_0x5317a2);})['then'](function(_0x276b51){_0x482340[_0x588d('0x3c')]=_0x276b51;return _0x482340;})[_0x588d('0x24')](respondWithFilteredResult(_0x5ac35a,_0x5317a2))[_0x588d('0x3d')](handleError(_0x5ac35a,null));};exports[_0x588d('0x3e')]=function(_0x40e25e,_0x173389){var _0x37b93e={'raw':!![],'where':{'id':_0x40e25e[_0x588d('0x3f')]['id']}},_0x2b6e45={};_0x2b6e45[_0x588d('0x2d')]=_[_0x588d('0x2f')](db[_0x588d('0x3a')][_0x588d('0x40')]);_0x2b6e45['query']=_[_0x588d('0x2f')](_0x40e25e['query']);_0x2b6e45[_0x588d('0x30')]=_[_0x588d('0x31')](_0x2b6e45['model'],_0x2b6e45[_0x588d('0x2e')]);_0x37b93e[_0x588d('0x33')]=_[_0x588d('0x31')](_0x2b6e45[_0x588d('0x2d')],qs[_0x588d('0x32')](_0x40e25e['query'][_0x588d('0x32')]));_0x37b93e['attributes']=_0x37b93e[_0x588d('0x33')][_0x588d('0x41')]?_0x37b93e['attributes']:_0x2b6e45[_0x588d('0x2d')];if(_0x40e25e['query'][_0x588d('0x42')]){_0x37b93e[_0x588d('0x43')]=[{'all':!![]}];}_0x37b93e=_[_0x588d('0x37')]({},_0x37b93e,_0x40e25e[_0x588d('0x44')]);return db['VoiceTransferReport']['find'](_0x37b93e)[_0x588d('0x24')](handleEntityNotFound(_0x173389,null))[_0x588d('0x24')](respondWithResult(_0x173389,null))[_0x588d('0x3d')](handleError(_0x173389,null));};exports[_0x588d('0x45')]=function(_0x2f98d2,_0x4da13f){return db[_0x588d('0x3a')][_0x588d('0x45')](_0x2f98d2[_0x588d('0x46')],{})[_0x588d('0x24')](respondWithResult(_0x4da13f,0xc9))[_0x588d('0x3d')](handleError(_0x4da13f,null));};exports[_0x588d('0x23')]=function(_0x4bb442,_0x322cdb){if(_0x4bb442['body']['id']){delete _0x4bb442[_0x588d('0x46')]['id'];}return db[_0x588d('0x3a')]['find']({'where':{'id':_0x4bb442[_0x588d('0x3f')]['id']}})[_0x588d('0x24')](handleEntityNotFound(_0x322cdb,null))[_0x588d('0x24')](saveUpdates(_0x4bb442[_0x588d('0x46')],null))[_0x588d('0x24')](respondWithResult(_0x322cdb,null))[_0x588d('0x3d')](handleError(_0x322cdb,null));};exports[_0x588d('0x47')]=function(_0x43d856,_0x3b15bd){return db[_0x588d('0x3a')][_0x588d('0x48')]({'where':{'id':_0x43d856['params']['id']}})[_0x588d('0x24')](handleEntityNotFound(_0x3b15bd,null))[_0x588d('0x24')](removeEntity(_0x3b15bd,null))[_0x588d('0x3d')](handleError(_0x3b15bd,null));};exports['describe']=function(_0x25327b,_0x206729){return db['VoiceTransferReport']['describe']()[_0x588d('0x24')](respondWithResult(_0x206729,null))[_0x588d('0x3d')](handleError(_0x206729,null));}; \ No newline at end of file +var _0x66c9=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x3a5b7e,_0x519dbe){var _0x4f3cac=function(_0x58c694){while(--_0x58c694){_0x3a5b7e['push'](_0x3a5b7e['shift']());}};_0x4f3cac(++_0x519dbe);}(_0x66c9,0x100));var _0x966c=function(_0x9cb365,_0x1403ae){_0x9cb365=_0x9cb365-0x0;var _0x464ce9=_0x66c9[_0x9cb365];return _0x464ce9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x966c('0x0'));var zipdir=require(_0x966c('0x1'));var jsonpatch=require(_0x966c('0x2'));var rp=require('request-promise');var moment=require(_0x966c('0x3'));var BPromise=require(_0x966c('0x4'));var Mustache=require(_0x966c('0x5'));var util=require(_0x966c('0x6'));var path=require(_0x966c('0x7'));var sox=require(_0x966c('0x8'));var csv=require(_0x966c('0x9'));var ejs=require(_0x966c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x966c('0xb'));var squel=require(_0x966c('0xc'));var crypto=require(_0x966c('0xd'));var jsforce=require(_0x966c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x966c('0xf'));var Papa=require('papaparse');var Redis=require(_0x966c('0x10'));var authService=require(_0x966c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x966c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x966c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x966c('0x14'));var licenseUtil=require(_0x966c('0x15'));var db=require(_0x966c('0x16'))['db'];function respondWithStatusCode(_0x59efa3,_0x51f2de){_0x51f2de=_0x51f2de||0xcc;return function(_0x31a028){if(_0x31a028){return _0x59efa3[_0x966c('0x17')](_0x51f2de);}return _0x59efa3[_0x966c('0x18')](_0x51f2de)[_0x966c('0x19')]();};}function respondWithResult(_0x7ecdd4,_0x378357){_0x378357=_0x378357||0xc8;return function(_0x580a4c){if(_0x580a4c){return _0x7ecdd4[_0x966c('0x18')](_0x378357)[_0x966c('0x1a')](_0x580a4c);}};}function respondWithFilteredResult(_0x1cfe8c,_0x359572){return function(_0x4231c3){if(_0x4231c3){var _0x4f3107=typeof _0x359572[_0x966c('0x1b')]==='undefined'&&typeof _0x359572['limit']===_0x966c('0x1c');var _0xaca45b=_0x4231c3[_0x966c('0x1d')];var _0x3cc2ca=_0x4f3107?0x0:_0x359572[_0x966c('0x1b')];var _0x5a49a0=_0x4f3107?_0x4231c3[_0x966c('0x1d')]:_0x359572[_0x966c('0x1b')]+_0x359572[_0x966c('0x1e')];var _0x51918f;if(_0x5a49a0>=_0xaca45b){_0x5a49a0=_0xaca45b;_0x51918f=0xc8;}else{_0x51918f=0xce;}_0x1cfe8c[_0x966c('0x18')](_0x51918f);return _0x1cfe8c[_0x966c('0x1f')](_0x966c('0x20'),_0x3cc2ca+'-'+_0x5a49a0+'/'+_0xaca45b)['json'](_0x4231c3);}return null;};}function patchUpdates(_0x2d5871){return function(_0x3a5250){try{jsonpatch[_0x966c('0x21')](_0x3a5250,_0x2d5871,!![]);}catch(_0x7cdadb){return BPromise[_0x966c('0x22')](_0x7cdadb);}return _0x3a5250[_0x966c('0x23')]();};}function saveUpdates(_0x29bba2,_0x5e8fbd){return function(_0x505831){if(_0x505831){return _0x505831[_0x966c('0x24')](_0x29bba2)[_0x966c('0x25')](function(_0x4587ab){return _0x4587ab;});}return null;};}function removeEntity(_0x3a3ad5,_0x478818){return function(_0x223e5d){if(_0x223e5d){return _0x223e5d[_0x966c('0x26')]()[_0x966c('0x25')](function(){_0x3a3ad5[_0x966c('0x18')](0xcc)[_0x966c('0x19')]();});}};}function handleEntityNotFound(_0x4f68b1,_0x24e0ec){return function(_0x5baf73){if(!_0x5baf73){_0x4f68b1[_0x966c('0x17')](0x194);}return _0x5baf73;};}function handleError(_0x9c97e1,_0x33b605){_0x33b605=_0x33b605||0x1f4;return function(_0xc6f35c){logger[_0x966c('0x27')](_0xc6f35c['stack']);if(_0xc6f35c['name']){delete _0xc6f35c[_0x966c('0x28')];}_0x9c97e1['status'](_0x33b605)[_0x966c('0x29')](_0xc6f35c);};}exports[_0x966c('0x2a')]=function(_0x3f694c,_0x2329c9){var _0x204d4e={},_0x1236e4={},_0x30096f={'count':0x0,'rows':[]};var _0x3e6577=_[_0x966c('0x2b')](db['VoiceTransferReport'][_0x966c('0x2c')],function(_0x2532c6){return{'name':_0x2532c6[_0x966c('0x2d')],'type':_0x2532c6[_0x966c('0x2e')][_0x966c('0x2f')]};});_0x1236e4[_0x966c('0x30')]=_[_0x966c('0x2b')](_0x3e6577,_0x966c('0x28'));_0x1236e4[_0x966c('0x31')]=_[_0x966c('0x32')](_0x3f694c[_0x966c('0x31')]);_0x1236e4['filters']=_[_0x966c('0x33')](_0x1236e4[_0x966c('0x30')],_0x1236e4[_0x966c('0x31')]);_0x204d4e[_0x966c('0x34')]=_['intersection'](_0x1236e4[_0x966c('0x30')],qs[_0x966c('0x35')](_0x3f694c[_0x966c('0x31')][_0x966c('0x35')]));_0x204d4e['attributes']=_0x204d4e['attributes']['length']?_0x204d4e[_0x966c('0x34')]:_0x1236e4['model'];if(!_0x3f694c[_0x966c('0x31')][_0x966c('0x36')](_0x966c('0x37'))){_0x204d4e[_0x966c('0x1e')]=qs[_0x966c('0x1e')](_0x3f694c['query'][_0x966c('0x1e')]);_0x204d4e[_0x966c('0x1b')]=qs[_0x966c('0x1b')](_0x3f694c[_0x966c('0x31')][_0x966c('0x1b')]);}_0x204d4e[_0x966c('0x38')]=qs[_0x966c('0x39')](_0x3f694c[_0x966c('0x31')][_0x966c('0x39')]);_0x204d4e[_0x966c('0x3a')]=qs[_0x966c('0x3b')](_[_0x966c('0x3c')](_0x3f694c[_0x966c('0x31')],_0x1236e4[_0x966c('0x3b')]),_0x3e6577);if(_0x3f694c['query'][_0x966c('0x3d')]){_0x204d4e['where']=_[_0x966c('0x3e')](_0x204d4e[_0x966c('0x3a')],{'$or':_[_0x966c('0x2b')](_0x3e6577,function(_0x92c702){if(_0x92c702[_0x966c('0x2e')]!==_0x966c('0x3f')){var _0x58795b={};_0x58795b[_0x92c702[_0x966c('0x28')]]={'$like':'%'+_0x3f694c[_0x966c('0x31')]['filter']+'%'};return _0x58795b;}})});}_0x204d4e=_[_0x966c('0x3e')]({},_0x204d4e,_0x3f694c[_0x966c('0x40')]);var _0x1d7433={'where':_0x204d4e['where']};return db[_0x966c('0x41')]['count'](_0x1d7433)[_0x966c('0x25')](function(_0x53de43){_0x30096f[_0x966c('0x1d')]=_0x53de43;if(_0x3f694c[_0x966c('0x31')][_0x966c('0x42')]){_0x204d4e[_0x966c('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x966c('0x44')](_0x204d4e);})['then'](function(_0x4b6521){_0x30096f[_0x966c('0x45')]=_0x4b6521;return _0x30096f;})[_0x966c('0x25')](respondWithFilteredResult(_0x2329c9,_0x204d4e))['catch'](handleError(_0x2329c9,null));};exports[_0x966c('0x46')]=function(_0xa4ff5e,_0x171d85){var _0x4a9118={'raw':!![],'where':{'id':_0xa4ff5e[_0x966c('0x47')]['id']}},_0x5ecca4={};_0x5ecca4['model']=_[_0x966c('0x32')](db[_0x966c('0x41')][_0x966c('0x2c')]);_0x5ecca4['query']=_[_0x966c('0x32')](_0xa4ff5e['query']);_0x5ecca4[_0x966c('0x3b')]=_[_0x966c('0x33')](_0x5ecca4['model'],_0x5ecca4[_0x966c('0x31')]);_0x4a9118[_0x966c('0x34')]=_['intersection'](_0x5ecca4[_0x966c('0x30')],qs[_0x966c('0x35')](_0xa4ff5e['query'][_0x966c('0x35')]));_0x4a9118[_0x966c('0x34')]=_0x4a9118[_0x966c('0x34')]['length']?_0x4a9118['attributes']:_0x5ecca4[_0x966c('0x30')];if(_0xa4ff5e['query'][_0x966c('0x42')]){_0x4a9118[_0x966c('0x43')]=[{'all':!![]}];}_0x4a9118=_[_0x966c('0x3e')]({},_0x4a9118,_0xa4ff5e['options']);return db[_0x966c('0x41')][_0x966c('0x48')](_0x4a9118)[_0x966c('0x25')](handleEntityNotFound(_0x171d85,null))['then'](respondWithResult(_0x171d85,null))[_0x966c('0x49')](handleError(_0x171d85,null));};exports[_0x966c('0x4a')]=function(_0xe74abb,_0x5c809a){return db[_0x966c('0x41')][_0x966c('0x4a')](_0xe74abb[_0x966c('0x4b')],{})['then'](respondWithResult(_0x5c809a,0xc9))[_0x966c('0x49')](handleError(_0x5c809a,null));};exports[_0x966c('0x24')]=function(_0x4ff58c,_0x5f23e4){if(_0x4ff58c[_0x966c('0x4b')]['id']){delete _0x4ff58c[_0x966c('0x4b')]['id'];}return db['VoiceTransferReport'][_0x966c('0x48')]({'where':{'id':_0x4ff58c[_0x966c('0x47')]['id']}})[_0x966c('0x25')](handleEntityNotFound(_0x5f23e4,null))[_0x966c('0x25')](saveUpdates(_0x4ff58c[_0x966c('0x4b')],null))['then'](respondWithResult(_0x5f23e4,null))['catch'](handleError(_0x5f23e4,null));};exports[_0x966c('0x26')]=function(_0x32267c,_0x10f282){return db[_0x966c('0x41')][_0x966c('0x48')]({'where':{'id':_0x32267c[_0x966c('0x47')]['id']}})[_0x966c('0x25')](handleEntityNotFound(_0x10f282,null))['then'](removeEntity(_0x10f282,null))[_0x966c('0x49')](handleError(_0x10f282,null));};exports['describe']=function(_0xc0236b,_0x5495fd){return db['VoiceTransferReport']['describe']()[_0x966c('0x25')](respondWithResult(_0x5495fd,null))[_0x966c('0x49')](handleError(_0x5495fd,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 17efc6a..c161ca1 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 _0xadb8=['VoiceTransferReport','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x51de46,_0x3995e0){var _0x1c29fe=function(_0x4dcbfa){while(--_0x4dcbfa){_0x51de46['push'](_0x51de46['shift']());}};_0x1c29fe(++_0x3995e0);}(_0xadb8,0xdd));var _0x8adb=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xadb8[_0x260f28];return _0x3aefcc;};'use strict';var _=require(_0x8adb('0x0'));var util=require(_0x8adb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8adb('0x2'));var rp=require(_0x8adb('0x3'));var fs=require('fs');var path=require(_0x8adb('0x4'));var rimraf=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var attributes=require(_0x8adb('0x7'));module[_0x8adb('0x8')]=function(_0x492fe3,_0x55268b){return _0x492fe3[_0x8adb('0x9')](_0x8adb('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa73e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0xa73e,0xfa));var _0xea73=function(_0x24c36b,_0xa88d2e){_0x24c36b=_0x24c36b-0x0;var _0x4b7827=_0xa73e[_0x24c36b];return _0x4b7827;};'use strict';var _=require('lodash');var util=require(_0xea73('0x0'));var logger=require(_0xea73('0x1'))(_0xea73('0x2'));var moment=require(_0xea73('0x3'));var BPromise=require(_0xea73('0x4'));var rp=require(_0xea73('0x5'));var fs=require('fs');var path=require(_0xea73('0x6'));var rimraf=require(_0xea73('0x7'));var config=require(_0xea73('0x8'));var attributes=require(_0xea73('0x9'));module[_0xea73('0xa')]=function(_0x41047c,_0x3cb199){return _0x41047c[_0xea73('0xb')](_0xea73('0xc'),attributes,{'tableName':_0xea73('0xd'),'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 1e8d7fc..73e89fd 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 _0x12b4=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x12b4,0x69));var _0x412b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x12b4[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x412b('0x0'));var util=require(_0x412b('0x1'));var moment=require(_0x412b('0x2'));var BPromise=require(_0x412b('0x3'));var rs=require(_0x412b('0x4'));var fs=require('fs');var Redis=require(_0x412b('0x5'));var db=require(_0x412b('0x6'))['db'];var utils=require(_0x412b('0x7'));var logger=require(_0x412b('0x8'))(_0x412b('0x9'));var config=require(_0x412b('0xa'));var jayson=require(_0x412b('0xb'));var client=jayson[_0x412b('0xc')][_0x412b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5e4091,_0x4591f6,_0x3efbc8){return new BPromise(function(_0x3577cb,_0x2c9ae5){return client[_0x412b('0xe')](_0x5e4091,_0x3efbc8)['then'](function(_0x386343){logger['info'](_0x412b('0xf'),_0x4591f6,_0x412b('0x10'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4591f6,'request\x20sent',JSON['stringify'](_0x386343));if(_0x386343[_0x412b('0x11')]){if(_0x386343['error'][_0x412b('0x12')]===0x1f4){logger[_0x412b('0x11')](_0x412b('0xf'),_0x4591f6,_0x386343['error']['message']);return _0x2c9ae5(_0x386343[_0x412b('0x11')][_0x412b('0x13')]);}logger[_0x412b('0x11')](_0x412b('0xf'),_0x4591f6,_0x386343['error'][_0x412b('0x13')]);return _0x3577cb(_0x386343['error'][_0x412b('0x13')]);}else{logger[_0x412b('0x14')](_0x412b('0xf'),_0x4591f6,_0x412b('0x10'));_0x3577cb(_0x386343[_0x412b('0x15')][_0x412b('0x13')]);}})[_0x412b('0x16')](function(_0x32d98b){logger[_0x412b('0x11')](_0x412b('0xf'),_0x4591f6,_0x32d98b);_0x2c9ae5(_0x32d98b);});});}exports[_0x412b('0x17')]=function(_0x158f60){var _0x4de332=this;return new Promise(function(_0x5ede55,_0x2bd703){return db[_0x412b('0x18')]['create'](_0x158f60[_0x412b('0x19')],{'raw':_0x158f60[_0x412b('0x1a')]?_0x158f60['options'][_0x412b('0x1b')]===undefined?!![]:![]:!![]})[_0x412b('0x1c')](function(_0x174977){logger[_0x412b('0x14')](_0x412b('0x17'),_0x158f60);logger['debug'](_0x412b('0x17'),_0x158f60,JSON[_0x412b('0x1d')](_0x174977));_0x5ede55(_0x174977);})['catch'](function(_0x4c70a2){logger[_0x412b('0x11')]('CreateVoiceTransferReport',_0x4c70a2[_0x412b('0x13')],_0x158f60);_0x2bd703(_0x4de332[_0x412b('0x11')](0x1f4,_0x4c70a2['message']));});});}; \ No newline at end of file +var _0x0fe3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','lodash','bluebird','randomstring'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0fe3,0x129));var _0x30fe=function(_0x1449ed,_0x5293b0){_0x1449ed=_0x1449ed-0x0;var _0x5ea2aa=_0x0fe3[_0x1449ed];return _0x5ea2aa;};'use strict';var _=require(_0x30fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30fe('0x1'));var rs=require(_0x30fe('0x2'));var fs=require('fs');var Redis=require(_0x30fe('0x3'));var db=require(_0x30fe('0x4'))['db'];var utils=require(_0x30fe('0x5'));var logger=require(_0x30fe('0x6'))(_0x30fe('0x7'));var config=require(_0x30fe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x30fe('0x9')][_0x30fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2be850,_0x86a2ac,_0x16c489){return new BPromise(function(_0x2cdcef,_0x408b2c){return client[_0x30fe('0xb')](_0x2be850,_0x16c489)['then'](function(_0x479722){logger[_0x30fe('0xc')](_0x30fe('0xd'),_0x86a2ac,_0x30fe('0xe'));logger[_0x30fe('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x86a2ac,_0x30fe('0xe'),JSON[_0x30fe('0x10')](_0x479722));if(_0x479722[_0x30fe('0x11')]){if(_0x479722['error']['code']===0x1f4){logger[_0x30fe('0x11')](_0x30fe('0xd'),_0x86a2ac,_0x479722[_0x30fe('0x11')][_0x30fe('0x12')]);return _0x408b2c(_0x479722[_0x30fe('0x11')][_0x30fe('0x12')]);}logger[_0x30fe('0x11')](_0x30fe('0xd'),_0x86a2ac,_0x479722[_0x30fe('0x11')]['message']);return _0x2cdcef(_0x479722['error'][_0x30fe('0x12')]);}else{logger[_0x30fe('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x86a2ac,'request\x20sent');_0x2cdcef(_0x479722[_0x30fe('0x13')]['message']);}})[_0x30fe('0x14')](function(_0x6847b3){logger['error'](_0x30fe('0xd'),_0x86a2ac,_0x6847b3);_0x408b2c(_0x6847b3);});});}exports[_0x30fe('0x15')]=function(_0x57788d){var _0x5870bf=this;return new Promise(function(_0x467f9d,_0x5b6caf){return db[_0x30fe('0x16')]['create'](_0x57788d['body'],{'raw':_0x57788d[_0x30fe('0x17')]?_0x57788d[_0x30fe('0x17')][_0x30fe('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1aafa2){logger[_0x30fe('0xc')](_0x30fe('0x15'),_0x57788d);logger[_0x30fe('0xf')]('CreateVoiceTransferReport',_0x57788d,JSON[_0x30fe('0x10')](_0x1aafa2));_0x467f9d(_0x1aafa2);})[_0x30fe('0x14')](function(_0x70cf2d){logger['error']('CreateVoiceTransferReport',_0x70cf2d[_0x30fe('0x12')],_0x57788d);_0x5b6caf(_0x5870bf[_0x30fe('0x11')](0x1f4,_0x70cf2d[_0x30fe('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index a3e6d1d..003bc4e 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 _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x466f2e,_0x5e2a7f){_0x466f2e=_0x466f2e-0x0;var _0x22dfbb=_0xf3cd[_0x466f2e];return _0x22dfbb;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file +var _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0x505838,_0x34b6fc){var _0x114754=function(_0x50fbdd){while(--_0x50fbdd){_0x505838['push'](_0x505838['shift']());}};_0x114754(++_0x34b6fc);}(_0x54ef,0x112));var _0xf54e=function(_0x5093eb,_0x532331){_0x5093eb=_0x5093eb-0x0;var _0x2d31d4=_0x54ef[_0x5093eb];return _0x2d31d4;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 8c72d14..dcb70a5 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80d9=['validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','code','message','catch','User','then','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','callNumber','body','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','defaults','socket.io-emitter','redis'];(function(_0x5e8460,_0x2003b5){var _0x3d50fd=function(_0x4c499f){while(--_0x4c499f){_0x5e8460['push'](_0x5e8460['shift']());}};_0x3d50fd(++_0x2003b5);}(_0x80d9,0x15c));var _0x980d=function(_0x1961d7,_0x315f92){_0x1961d7=_0x1961d7-0x0;var _0x4f8793=_0x80d9[_0x1961d7];return _0x4f8793;};'use strict';var path=require(_0x980d('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x980d('0x1'))['db'];var config=require(_0x980d('0x2'));var util=require(_0x980d('0x3'));var BPromise=require('bluebird');var jayson=require(_0x980d('0x4'));var amiClient=jayson[_0x980d('0x5')][_0x980d('0x6')]({'port':0x232a});var logger=require(_0x980d('0x7'))(_0x980d('0x8'));var Redis=require('ioredis');config['redis']=_[_0x980d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x980d('0xa'))(new Redis(config[_0x980d('0xb')]));var Schema=require(_0x980d('0xc'));var originateValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]},'callNumber':{'type':_0x980d('0xf'),'required':[!![],_0x980d('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x980d('0xe')]},'sessionId':{'type':_0x980d('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x980d('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x980d('0xf'),'required':[!![],_0x980d('0x11')]},'transferNumber':{'type':_0x980d('0xf'),'required':[!![],_0x980d('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]},'sessionId':{'type':_0x980d('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x980d('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x980d('0xd'),'required':[!![],_0x980d('0xe')]}});function emit(_0x169648,_0x5824bf,_0x27dd6a){logger[_0x980d('0x13')](_0x169648,_0x5824bf,JSON['stringify'](_0x27dd6a));io['to'](_0x169648)[_0x980d('0x14')](_0x5824bf,_0x27dd6a);}function handleError(_0x4e9d73){return function(_0x23f64c){console[_0x980d('0x15')](_0x980d('0x16'),_0x23f64c,_0x23f64c instanceof RangeError);logger[_0x980d('0x17')](_0x23f64c[_0x980d('0x18')]);if(_0x23f64c instanceof RangeError){if(_0x23f64c[_0x980d('0x19')]){delete _0x23f64c[_0x980d('0x19')];}_0x4e9d73[_0x980d('0x1a')](0x194)[_0x980d('0x1b')](_0x23f64c);}else{if(_0x23f64c[_0x980d('0x19')]){delete _0x23f64c[_0x980d('0x19')];}_0x4e9d73['status'](0x1f4)['send'](_0x23f64c);}};}function checkError(){return function(_0x3cb470){if(!_0x3cb470){throw new RangeError('NotFound');}return _0x3cb470;};}function respondWithRpcPromise(_0x4e37c8,_0x124c3f){return new BPromise(function(_0x1d6286,_0x45d698){var _0xbb89e3=amiClient;return _0xbb89e3['request'](_0x4e37c8,_0x124c3f)['then'](function(_0x11cb45){if(_0x11cb45['error']){if(_0x11cb45[_0x980d('0x17')][_0x980d('0x1c')]===0x1f4){return _0x45d698(_0x11cb45['error'][_0x980d('0x1d')]);}return _0x1d6286(_0x11cb45['error']['message']);}else{_0x1d6286(_0x11cb45['result']);}})[_0x980d('0x1e')](function(_0x43f278){_0x45d698(_0x43f278);});});}function getAgent(_0x117053){return db[_0x980d('0x1f')]['findOne']({'where':{'id':_0x117053,'role':'agent'}})[_0x980d('0x20')](checkError());}function getAgentCheckSession(_0x1d5dad,_0x97ca70){return new BPromise(function(_0x1da8ea,_0x3d5f19){var _0x47b11d=respondWithRpcPromise('VoiceChannels');var _0x2830e5=getAgent(_0x1d5dad);Promise[_0x980d('0x21')]([_0x47b11d,_0x2830e5])[_0x980d('0x20')](function(_0xf00845){var _0x2dab0e=_0xf00845[0x0];var _0x25542b=_0xf00845[0x1];var _0x513693=_[_0x980d('0x22')](_0x2dab0e[_0x980d('0x23')],function(_0xaa9cd6){return _0xaa9cd6[_0x980d('0x24')]==_0x25542b['id']&&_0xaa9cd6[_0x980d('0x25')]==_0x97ca70;});if(_0x513693[_0x980d('0x26')]==0x1){_0x1da8ea(_0x25542b);}else{_0x3d5f19(new RangeError(_0x980d('0x27')+_0x97ca70+_0x980d('0x28')));}});});}exports[_0x980d('0x29')]=function(_0x59a847,_0x3671b8){logger[_0x980d('0x13')](_0x980d('0x2a'),_0x59a847['body']);var _0x5d0771=originateValidation[_0x980d('0xc')](_0x59a847['body']);if(_0x5d0771[_0x980d('0x26')]>0x0){return _0x3671b8['status'](0x190)['json'](_0x5d0771);}var _0x5a3160=_0x59a847['body']['userId'];var _0x511d25=_0x59a847['body'][_0x980d('0x2b')];var _0x3569b8=_0x59a847[_0x980d('0x2c')]['callerId'];var _0x498081=_0x59a847[_0x980d('0x2c')][_0x980d('0x2d')];return getAgent(_0x5a3160)[_0x980d('0x20')](function(_0x120bf1){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x120bf1['name']);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x120bf1['name']),_0x980d('0x31'),{'callNumber':_0x511d25,'callerId':_0x3569b8,'callbackUrl':_0x498081});return _0x3671b8['status'](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x33')});})[_0x980d('0x1e')](handleError(_0x3671b8));};exports['hangup']=function(_0x5d8c31,_0x5d5903){logger[_0x980d('0x13')]('hangup\x20fired:',_0x5d8c31['body']);var _0x98b1b=hangupValidation[_0x980d('0xc')](_0x5d8c31[_0x980d('0x2c')]);if(_0x98b1b['length']>0x0){return _0x5d5903[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x98b1b);}var _0x32f2f9=_0x5d8c31[_0x980d('0x2c')][_0x980d('0x34')];var _0x4e2aac=_0x5d8c31['body'][_0x980d('0x25')];return getAgent(_0x32f2f9)['then'](function(_0x5b49e2){logger['info']('entityFound:',_0x5b49e2[_0x980d('0x19')]);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x5b49e2['name']),_0x980d('0x35'),{'sessionId':_0x4e2aac});return _0x5d5903[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x36')});})[_0x980d('0x1e')](handleError(_0x5d5903));};exports[_0x980d('0x37')]=function(_0x1221e7,_0x555417){logger[_0x980d('0x13')](_0x980d('0x38'),_0x1221e7[_0x980d('0x2c')]);var _0x5f1f04=answerValidation[_0x980d('0xc')](_0x1221e7[_0x980d('0x2c')]);if(_0x5f1f04[_0x980d('0x26')]>0x0){return _0x555417[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x5f1f04);}var _0x45831c=_0x1221e7[_0x980d('0x2c')]['userId'];var _0x473c94=_0x1221e7['body'][_0x980d('0x25')];return getAgent(_0x45831c)[_0x980d('0x20')](function(_0x23980c){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x23980c[_0x980d('0x19')]);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x23980c['name']),'webbar:answer',{'sessionId':_0x473c94});return _0x555417[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x39')});})[_0x980d('0x1e')](handleError(_0x555417));};exports[_0x980d('0x3a')]=function(_0x48f239,_0x1de28b){logger[_0x980d('0x13')]('hold\x20fired:',_0x48f239[_0x980d('0x2c')]);var _0x169270=holdValidation[_0x980d('0xc')](_0x48f239[_0x980d('0x2c')]);if(_0x169270[_0x980d('0x26')]>0x0){return _0x1de28b[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x169270);}var _0x135c26=_0x48f239[_0x980d('0x2c')]['userId'];var _0xaf9c1c=_0x48f239[_0x980d('0x2c')][_0x980d('0x25')];return getAgent(_0x135c26)[_0x980d('0x20')](function(_0x2e18c6){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x2e18c6['name']);emit(util[_0x980d('0x2f')]('user:%s',_0x2e18c6[_0x980d('0x19')]),_0x980d('0x3b'),{'sessionId':_0xaf9c1c});return _0x1de28b[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x3c')});})['catch'](handleError(_0x1de28b));};exports[_0x980d('0x3d')]=function(_0x448b3c,_0x242277){logger[_0x980d('0x13')](_0x980d('0x3e'),_0x448b3c[_0x980d('0x2c')]);var _0x411b3a=unholdValidation['validate'](_0x448b3c['body']);if(_0x411b3a['length']>0x0){return _0x242277['status'](0x190)[_0x980d('0x32')](_0x411b3a);}var _0x216458=_0x448b3c[_0x980d('0x2c')][_0x980d('0x34')];var _0x177bb2=_0x448b3c[_0x980d('0x2c')]['sessionId'];return getAgent(_0x216458)[_0x980d('0x20')](function(_0x51c112){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x51c112[_0x980d('0x19')]);emit(util[_0x980d('0x2f')]('user:%s',_0x51c112['name']),_0x980d('0x3f'),{'sessionId':_0x177bb2});return _0x242277[_0x980d('0x1a')](0xc8)[_0x980d('0x32')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x242277));};exports[_0x980d('0x40')]=function(_0x4c61c8,_0x459b0e){logger[_0x980d('0x13')](_0x980d('0x41'),_0x459b0e[_0x980d('0x2c')]);var _0x20459e=callsValidation[_0x980d('0xc')](_0x4c61c8[_0x980d('0x2c')]);if(_0x20459e[_0x980d('0x26')]>0x0){return _0x459b0e['status'](0x190)['json'](_0x20459e);}var _0x899a7e=_0x4c61c8['body'][_0x980d('0x34')];var _0x21cf36=respondWithRpcPromise('VoiceChannels');var _0x2b28e4=getAgent(_0x899a7e);return Promise[_0x980d('0x21')]([_0x21cf36,_0x2b28e4])[_0x980d('0x20')](function(_0x60969d){var _0x5498aa=_0x60969d[0x0];var _0x2ccfff=_0x60969d[0x1];var _0x5e45c6=_['filter'](_0x5498aa[_0x980d('0x23')],function(_0x55a075){return _0x55a075[_0x980d('0x24')]==_0x2ccfff['id'];});return _0x459b0e['status'](0xc8)[_0x980d('0x32')]({'count':_0x5e45c6[_0x980d('0x26')],'rows':_0x5e45c6});})['catch'](handleError(_0x459b0e));};exports[_0x980d('0x42')]=function(_0x132495,_0x36f01e){logger[_0x980d('0x13')](_0x980d('0x43'),_0x132495[_0x980d('0x2c')]);var _0x343deb=conferenceValidation[_0x980d('0xc')](_0x132495[_0x980d('0x2c')]);if(_0x343deb[_0x980d('0x26')]>0x0){return _0x36f01e[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x343deb);}var _0x4cb91f=_0x132495['body']['userId'];return getAgent(_0x4cb91f)[_0x980d('0x20')](function(_0x53a444){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x53a444[_0x980d('0x19')]);emit(util[_0x980d('0x2f')]('user:%s',_0x53a444[_0x980d('0x19')]),_0x980d('0x44'));return _0x36f01e['status'](0xc8)[_0x980d('0x32')]({'error':![],'message':'conference\x20executed!'});})[_0x980d('0x1e')](handleError(_0x36f01e));};exports['transfer']=function(_0x528e35,_0x465e03){logger[_0x980d('0x13')](_0x980d('0x45'),_0x528e35[_0x980d('0x2c')]);var _0x4dbcca=transferValidation[_0x980d('0xc')](_0x528e35['body']);if(_0x4dbcca['length']>0x0){return _0x465e03[_0x980d('0x1a')](0x190)[_0x980d('0x32')](_0x4dbcca);}var _0x3bd029=_0x528e35[_0x980d('0x2c')][_0x980d('0x34')];var _0x287d47=_0x528e35[_0x980d('0x2c')][_0x980d('0x25')];var _0x392ec3=_0x528e35[_0x980d('0x2c')]['transferNumber'];return getAgent(_0x3bd029)[_0x980d('0x20')](function(_0x4e6f36){logger[_0x980d('0x13')](_0x980d('0x2e'),_0x4e6f36['name']);emit(util[_0x980d('0x2f')](_0x980d('0x30'),_0x4e6f36[_0x980d('0x19')]),_0x980d('0x46'),{'sessionId':_0x287d47,'transferNumber':_0x392ec3});return _0x465e03['status'](0xc8)[_0x980d('0x32')]({'error':![],'message':_0x980d('0x47')});})[_0x980d('0x1e')](handleError(_0x465e03));}; \ No newline at end of file +var _0xe14d=['callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','send','NotFound','request','then','message','result','catch','User','findOne','VoiceChannels','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','length','status','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','hangup','hangup\x20fired:','json','webbar:hangup','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string'];(function(_0x26c55e,_0x21b57b){var _0x1f2ae2=function(_0x3cc027){while(--_0x3cc027){_0x26c55e['push'](_0x26c55e['shift']());}};_0x1f2ae2(++_0x21b57b);}(_0xe14d,0x1ee));var _0xde14=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe14d[_0x3b380d];return _0x54502b;};'use strict';var path=require(_0xde14('0x0'));var fs=require('fs');var _=require(_0xde14('0x1'));var db=require(_0xde14('0x2'))['db'];var config=require(_0xde14('0x3'));var util=require('util');var BPromise=require(_0xde14('0x4'));var jayson=require(_0xde14('0x5'));var amiClient=jayson['client'][_0xde14('0x6')]({'port':0x232a});var logger=require(_0xde14('0x7'))(_0xde14('0x8'));var Redis=require(_0xde14('0x9'));config[_0xde14('0xa')]=_[_0xde14('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xde14('0xc'))(new Redis(config[_0xde14('0xa')]));var Schema=require(_0xde14('0xd'));var originateValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'callNumber':{'type':_0xde14('0x10'),'required':[!![],_0xde14('0x11')]},'callerId':{'type':_0xde14('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':[!![],_0xde14('0x12')]},'transferNumber':{'type':_0xde14('0x10'),'required':[!![],_0xde14('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xde14('0xf')]}});function emit(_0x31adb3,_0x257390,_0x31902a){logger[_0xde14('0x14')](_0x31adb3,_0x257390,JSON[_0xde14('0x15')](_0x31902a));io['to'](_0x31adb3)[_0xde14('0x16')](_0x257390,_0x31902a);}function handleError(_0x6f6eea){return function(_0x3cc317){console[_0xde14('0x17')]('handleError:',_0x3cc317,_0x3cc317 instanceof RangeError);logger[_0xde14('0x18')](_0x3cc317[_0xde14('0x19')]);if(_0x3cc317 instanceof RangeError){if(_0x3cc317[_0xde14('0x1a')]){delete _0x3cc317[_0xde14('0x1a')];}_0x6f6eea['status'](0x194)[_0xde14('0x1b')](_0x3cc317);}else{if(_0x3cc317['name']){delete _0x3cc317[_0xde14('0x1a')];}_0x6f6eea['status'](0x1f4)[_0xde14('0x1b')](_0x3cc317);}};}function checkError(){return function(_0x30fcf1){if(!_0x30fcf1){throw new RangeError(_0xde14('0x1c'));}return _0x30fcf1;};}function respondWithRpcPromise(_0x1949ab,_0x39bdc5){return new BPromise(function(_0x11a4d9,_0x40b648){var _0x2dd9e7=amiClient;return _0x2dd9e7[_0xde14('0x1d')](_0x1949ab,_0x39bdc5)[_0xde14('0x1e')](function(_0x475f2f){if(_0x475f2f[_0xde14('0x18')]){if(_0x475f2f[_0xde14('0x18')]['code']===0x1f4){return _0x40b648(_0x475f2f[_0xde14('0x18')][_0xde14('0x1f')]);}return _0x11a4d9(_0x475f2f[_0xde14('0x18')][_0xde14('0x1f')]);}else{_0x11a4d9(_0x475f2f[_0xde14('0x20')]);}})[_0xde14('0x21')](function(_0x310d75){_0x40b648(_0x310d75);});});}function getAgent(_0x23c735){return db[_0xde14('0x22')][_0xde14('0x23')]({'where':{'id':_0x23c735,'role':'agent'}})[_0xde14('0x1e')](checkError());}function getAgentCheckSession(_0x1696ee,_0x3eaee5){return new BPromise(function(_0xf8279a,_0x5d8b4b){var _0x3fc2a4=respondWithRpcPromise(_0xde14('0x24'));var _0x30c4a8=getAgent(_0x1696ee);Promise['all']([_0x3fc2a4,_0x30c4a8])[_0xde14('0x1e')](function(_0x582537){var _0x2760f9=_0x582537[0x0];var _0x361b2c=_0x582537[0x1];var _0x3bb1da=_[_0xde14('0x25')](_0x2760f9[_0xde14('0x26')],function(_0x237d3f){return _0x237d3f[_0xde14('0x27')]==_0x361b2c['id']&&_0x237d3f[_0xde14('0x28')]==_0x3eaee5;});if(_0x3bb1da['length']==0x1){_0xf8279a(_0x361b2c);}else{_0x5d8b4b(new RangeError(_0xde14('0x29')+_0x3eaee5+_0xde14('0x2a')));}});});}exports['originate']=function(_0xf25a9e,_0x4c9b15){logger[_0xde14('0x14')](_0xde14('0x2b'),_0xf25a9e[_0xde14('0x2c')]);var _0x21a916=originateValidation[_0xde14('0xd')](_0xf25a9e['body']);if(_0x21a916[_0xde14('0x2d')]>0x0){return _0x4c9b15[_0xde14('0x2e')](0x190)['json'](_0x21a916);}var _0x280238=_0xf25a9e[_0xde14('0x2c')][_0xde14('0x2f')];var _0x319136=_0xf25a9e[_0xde14('0x2c')][_0xde14('0x30')];var _0xd75bb2=_0xf25a9e[_0xde14('0x2c')][_0xde14('0x31')];var _0x48d587=_0xf25a9e['body'][_0xde14('0x32')];return getAgent(_0x280238)[_0xde14('0x1e')](function(_0x20913d){logger[_0xde14('0x14')](_0xde14('0x33'),_0x20913d[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x20913d[_0xde14('0x1a')]),'webbar:originate',{'callNumber':_0x319136,'callerId':_0xd75bb2,'callbackUrl':_0x48d587});return _0x4c9b15[_0xde14('0x2e')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x4c9b15));};exports[_0xde14('0x36')]=function(_0x258759,_0x398f63){logger[_0xde14('0x14')](_0xde14('0x37'),_0x258759[_0xde14('0x2c')]);var _0x1e89b6=hangupValidation[_0xde14('0xd')](_0x258759['body']);if(_0x1e89b6[_0xde14('0x2d')]>0x0){return _0x398f63[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x1e89b6);}var _0x2b3004=_0x258759[_0xde14('0x2c')][_0xde14('0x2f')];var _0x2ec2f3=_0x258759[_0xde14('0x2c')]['sessionId'];return getAgent(_0x2b3004)[_0xde14('0x1e')](function(_0xb6b2ee){logger[_0xde14('0x14')](_0xde14('0x33'),_0xb6b2ee['name']);emit(util['format'](_0xde14('0x35'),_0xb6b2ee[_0xde14('0x1a')]),_0xde14('0x39'),{'sessionId':_0x2ec2f3});return _0x398f63[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':'hangup\x20executed!'});})[_0xde14('0x21')](handleError(_0x398f63));};exports[_0xde14('0x3a')]=function(_0x1d3cc1,_0x595fd5){logger[_0xde14('0x14')]('answer\x20fired:',_0x1d3cc1[_0xde14('0x2c')]);var _0x51ace9=answerValidation[_0xde14('0xd')](_0x1d3cc1[_0xde14('0x2c')]);if(_0x51ace9[_0xde14('0x2d')]>0x0){return _0x595fd5[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x51ace9);}var _0x22f75a=_0x1d3cc1[_0xde14('0x2c')][_0xde14('0x2f')];var _0x5b18b0=_0x1d3cc1[_0xde14('0x2c')]['sessionId'];return getAgent(_0x22f75a)[_0xde14('0x1e')](function(_0x5ac3f3){logger[_0xde14('0x14')](_0xde14('0x33'),_0x5ac3f3[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x5ac3f3[_0xde14('0x1a')]),_0xde14('0x3b'),{'sessionId':_0x5b18b0});return _0x595fd5[_0xde14('0x2e')](0xc8)['json']({'error':![],'message':_0xde14('0x3c')});})[_0xde14('0x21')](handleError(_0x595fd5));};exports[_0xde14('0x3d')]=function(_0x4b1ef7,_0x5ab2de){logger[_0xde14('0x14')](_0xde14('0x3e'),_0x4b1ef7[_0xde14('0x2c')]);var _0xdbdab8=holdValidation[_0xde14('0xd')](_0x4b1ef7[_0xde14('0x2c')]);if(_0xdbdab8['length']>0x0){return _0x5ab2de[_0xde14('0x2e')](0x190)['json'](_0xdbdab8);}var _0xa408ec=_0x4b1ef7[_0xde14('0x2c')]['userId'];var _0x33e120=_0x4b1ef7[_0xde14('0x2c')][_0xde14('0x28')];return getAgent(_0xa408ec)[_0xde14('0x1e')](function(_0x2d05c7){logger[_0xde14('0x14')](_0xde14('0x33'),_0x2d05c7['name']);emit(util[_0xde14('0x34')]('user:%s',_0x2d05c7[_0xde14('0x1a')]),_0xde14('0x3f'),{'sessionId':_0x33e120});return _0x5ab2de[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':_0xde14('0x40')});})[_0xde14('0x21')](handleError(_0x5ab2de));};exports[_0xde14('0x41')]=function(_0x1f7316,_0x3495d1){logger[_0xde14('0x14')]('unhold\x20fired:',_0x1f7316[_0xde14('0x2c')]);var _0x1688c6=unholdValidation[_0xde14('0xd')](_0x1f7316[_0xde14('0x2c')]);if(_0x1688c6[_0xde14('0x2d')]>0x0){return _0x3495d1['status'](0x190)[_0xde14('0x38')](_0x1688c6);}var _0x4dc2e3=_0x1f7316[_0xde14('0x2c')][_0xde14('0x2f')];var _0x3fce2c=_0x1f7316[_0xde14('0x2c')][_0xde14('0x28')];return getAgent(_0x4dc2e3)['then'](function(_0x5356fe){logger[_0xde14('0x14')]('entityFound:',_0x5356fe[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x5356fe[_0xde14('0x1a')]),_0xde14('0x42'),{'sessionId':_0x3fce2c});return _0x3495d1[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':_0xde14('0x43')});})[_0xde14('0x21')](handleError(_0x3495d1));};exports['calls']=function(_0x205a94,_0x2c972b){logger[_0xde14('0x14')](_0xde14('0x44'),_0x2c972b[_0xde14('0x2c')]);var _0x5965e1=callsValidation[_0xde14('0xd')](_0x205a94['body']);if(_0x5965e1[_0xde14('0x2d')]>0x0){return _0x2c972b[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x5965e1);}var _0x4dbeaf=_0x205a94[_0xde14('0x2c')][_0xde14('0x2f')];var _0x27ab1a=respondWithRpcPromise(_0xde14('0x24'));var _0x525c64=getAgent(_0x4dbeaf);return Promise['all']([_0x27ab1a,_0x525c64])['then'](function(_0x475671){var _0x508f25=_0x475671[0x0];var _0x596cd3=_0x475671[0x1];var _0xc10000=_[_0xde14('0x25')](_0x508f25[_0xde14('0x26')],function(_0x34da32){return _0x34da32[_0xde14('0x27')]==_0x596cd3['id'];});return _0x2c972b[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'count':_0xc10000[_0xde14('0x2d')],'rows':_0xc10000});})[_0xde14('0x21')](handleError(_0x2c972b));};exports['conference']=function(_0x6be331,_0x1cfc98){logger[_0xde14('0x14')]('conference\x20fired:',_0x6be331[_0xde14('0x2c')]);var _0x599adc=conferenceValidation[_0xde14('0xd')](_0x6be331[_0xde14('0x2c')]);if(_0x599adc[_0xde14('0x2d')]>0x0){return _0x1cfc98[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x599adc);}var _0x10e06e=_0x6be331[_0xde14('0x2c')]['userId'];return getAgent(_0x10e06e)[_0xde14('0x1e')](function(_0x25ba7e){logger[_0xde14('0x14')](_0xde14('0x33'),_0x25ba7e[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x25ba7e['name']),'webbar:conference');return _0x1cfc98[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':_0xde14('0x45')});})['catch'](handleError(_0x1cfc98));};exports[_0xde14('0x46')]=function(_0x2bfb4f,_0x3a5b06){logger[_0xde14('0x14')]('transfer\x20fired:',_0x2bfb4f['body']);var _0x2395e1=transferValidation[_0xde14('0xd')](_0x2bfb4f[_0xde14('0x2c')]);if(_0x2395e1[_0xde14('0x2d')]>0x0){return _0x3a5b06[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x2395e1);}var _0x1bfe9b=_0x2bfb4f[_0xde14('0x2c')][_0xde14('0x2f')];var _0x4657d1=_0x2bfb4f[_0xde14('0x2c')][_0xde14('0x28')];var _0x1ff577=_0x2bfb4f[_0xde14('0x2c')][_0xde14('0x47')];return getAgent(_0x1bfe9b)[_0xde14('0x1e')](function(_0x2656c7){logger[_0xde14('0x14')](_0xde14('0x33'),_0x2656c7[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x2656c7[_0xde14('0x1a')]),'webbar:transfer',{'sessionId':_0x4657d1,'transferNumber':_0x1ff577});return _0x3a5b06[_0xde14('0x2e')](0xc8)['json']({'error':![],'message':_0xde14('0x48')});})['catch'](handleError(_0x3a5b06));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 19f5e82..dc4a431 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 _0x4991=['isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','create','addDisposition','post','addAnswer','/:id/users','addAgents','notify','send','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe'];(function(_0x505958,_0x4996ae){var _0x25846f=function(_0x2423bb){while(--_0x2423bb){_0x505958['push'](_0x505958['shift']());}};_0x25846f(++_0x4996ae);}(_0x4991,0xf7));var _0x1499=function(_0x72a19a,_0x4dea31){_0x72a19a=_0x72a19a-0x0;var _0x23db1e=_0x4991[_0x72a19a];return _0x23db1e;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var fs_extra=require(_0x1499('0x4'));var auth=require(_0x1499('0x5'));var interaction=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var controller=require(_0x1499('0x8'));router[_0x1499('0x9')]('/',auth['isAuthenticated'](),controller[_0x1499('0xa')]);router[_0x1499('0x9')](_0x1499('0xb'),auth[_0x1499('0xc')](),controller[_0x1499('0xd')]);router[_0x1499('0x9')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller['show']);router[_0x1499('0x9')](_0x1499('0xf'),auth['isAuthenticated'](),controller[_0x1499('0x10')]);router[_0x1499('0x9')]('/:id/canned_answers',auth[_0x1499('0xc')](),controller[_0x1499('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x1499('0x12')]);router[_0x1499('0x9')](_0x1499('0x13'),auth[_0x1499('0xc')](),controller[_0x1499('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1499('0x15')]);router['post'](_0x1499('0xf'),auth[_0x1499('0xc')](),controller[_0x1499('0x16')]);router[_0x1499('0x17')]('/:id/canned_answers',auth[_0x1499('0xc')](),controller[_0x1499('0x18')]);router['post'](_0x1499('0x19'),auth[_0x1499('0xc')](),controller[_0x1499('0x1a')]);router[_0x1499('0x17')](_0x1499('0x13'),auth[_0x1499('0xc')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x1499('0x1b')]);router[_0x1499('0x17')]('/:id/send',auth[_0x1499('0xc')](),controller[_0x1499('0x1c')]);router[_0x1499('0x1d')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller[_0x1499('0x1e')]);router[_0x1499('0x1f')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller[_0x1499('0x20')]);router[_0x1499('0x1f')](_0x1499('0xf'),auth[_0x1499('0xc')](),controller[_0x1499('0x21')]);router[_0x1499('0x1f')](_0x1499('0x22'),auth[_0x1499('0xc')](),controller['removeAnswers']);router[_0x1499('0x1f')](_0x1499('0x19'),auth[_0x1499('0xc')](),controller[_0x1499('0x23')]);module[_0x1499('0x24')]=router; \ No newline at end of file +var _0x14a0=['update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','put','/:id'];(function(_0x3df7b7,_0x2b6aca){var _0x2c5bf2=function(_0x31e679){while(--_0x31e679){_0x3df7b7['push'](_0x3df7b7['shift']());}};_0x2c5bf2(++_0x2b6aca);}(_0x14a0,0x8e));var _0x014a=function(_0x565faf,_0x5f3718){_0x565faf=_0x565faf-0x0;var _0x42292f=_0x14a0[_0x565faf];return _0x42292f;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['getAnswers']);router[_0x014a('0x8')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0x8')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0x13')]);router[_0x014a('0x12')]('/:id/dispositions',auth[_0x014a('0x9')](),controller[_0x014a('0x14')]);router['post'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['addAnswer']);router[_0x014a('0x12')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x15')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x16')]);router[_0x014a('0x12')](_0x014a('0x17'),controller[_0x014a('0x18')]);router[_0x014a('0x12')](_0x014a('0x19'),auth[_0x014a('0x9')](),controller['send']);router[_0x014a('0x1a')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1c')]);router[_0x014a('0x1d')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1e')]);router[_0x014a('0x1d')]('/:id/dispositions',auth[_0x014a('0x9')](),controller['removeDispositions']);router[_0x014a('0x1d')](_0x014a('0xd'),auth[_0x014a('0x9')](),controller[_0x014a('0x1f')]);router[_0x014a('0x1d')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x20')]);module[_0x014a('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 2844391..8782421 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 _0xd6fa=['exports','STRING','name','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xd6fa,0x133));var _0xad6f=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xd6fa[_0x15cdcb];return _0x37b069;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xad6f('0x0'));module[_0xad6f('0x1')]={'name':{'type':Sequelize[_0xad6f('0x2')],'unique':_0xad6f('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xad6f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xad6f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xad6f('0x2')]},'type':{'type':Sequelize['ENUM'](_0xad6f('0x4'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xad6f('0x2')]},'authToken':{'type':Sequelize[_0xad6f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xad6f('0x5')],'defaultValue':function(){return _0xad6f('0x6');}},'notificationSound':{'type':Sequelize[_0xad6f('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xad6f('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xad6f('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xad6f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xad6f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xad6f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xad6f('0x7')],'defaultValue':![],'comment':_0xad6f('0xa'),'set':function(_0x1ebd14){if(!_0x1ebd14){this[_0xad6f('0xb')](_0xad6f('0xc'),null);}this[_0xad6f('0xb')](_0xad6f('0xd'),_0x1ebd14);}},'description':{'type':Sequelize[_0xad6f('0x2')]}}; \ No newline at end of file +var _0x4ba9=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x32201f,_0x5c1eef){var _0x619b64=function(_0x2bc8e9){while(--_0x2bc8e9){_0x32201f['push'](_0x32201f['shift']());}};_0x619b64(++_0x5c1eef);}(_0x4ba9,0x99));var _0x94ba=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0x4ba9[_0x12aaee];return _0x37c350;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x94ba('0x0'));module[_0x94ba('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x94ba('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x94ba('0x3')],'defaultValue':function(){return rs[_0x94ba('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x94ba('0x5')](_0x94ba('0x6'),_0x94ba('0x7'))},'accountSid':{'type':Sequelize[_0x94ba('0x3')]},'baseUrl':{'type':Sequelize[_0x94ba('0x3')]},'authToken':{'type':Sequelize[_0x94ba('0x3')]},'notificationTemplate':{'type':Sequelize[_0x94ba('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x94ba('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x94ba('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94ba('0xa')],'comment':_0x94ba('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x458e22){if(!_0x458e22){this[_0x94ba('0xc')](_0x94ba('0xd'),null);}this[_0x94ba('0xc')](_0x94ba('0xe'),_0x458e22);}},'description':{'type':Sequelize[_0x94ba('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 6b0d761..310b266 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 _0x2bac=['options','find','create','body','user','get','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','findOne','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','sequelize','transaction','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','asc','CmContact','Sequelize','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','replace','Body','messageId','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','merge','type','where','includeAll','include','findAll','rows','show','params','keys','length'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x2bac,0x1ea));var _0xc2ba=function(_0x575c8d,_0x532094){_0x575c8d=_0x575c8d-0x0;var _0x47751a=_0x2bac[_0x575c8d];return _0x47751a;};'use strict';var emlformat=require(_0xc2ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc2ba('0x1'));var rp=require(_0xc2ba('0x2'));var moment=require(_0xc2ba('0x3'));var BPromise=require(_0xc2ba('0x4'));var Mustache=require(_0xc2ba('0x5'));var util=require(_0xc2ba('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc2ba('0x7'));var fs=require('fs');var fs_extra=require(_0xc2ba('0x8'));var _=require(_0xc2ba('0x9'));var squel=require('squel');var crypto=require(_0xc2ba('0xa'));var jsforce=require(_0xc2ba('0xb'));var deskjs=require(_0xc2ba('0xc'));var toCsv=require(_0xc2ba('0xd'));var querystring=require(_0xc2ba('0xe'));var Papa=require(_0xc2ba('0xf'));var Redis=require('ioredis');var authService=require(_0xc2ba('0x10'));var qs=require(_0xc2ba('0x11'));var as=require(_0xc2ba('0x12'));var hardwareService=require(_0xc2ba('0x13'));var logger=require(_0xc2ba('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc2ba('0x15'));var licenseUtil=require(_0xc2ba('0x16'));var db=require(_0xc2ba('0x17'))['db'];config[_0xc2ba('0x18')]=_['defaults'](config[_0xc2ba('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc2ba('0x18')]));require(_0xc2ba('0x19'))[_0xc2ba('0x1a')](socket);var jayson=require(_0xc2ba('0x1b'));var client=jayson[_0xc2ba('0x1c')][_0xc2ba('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x6b8e60,_0x206431,_0xeb9f52,_0x2e27b9){return new BPromise(function(_0x4758b9,_0x4dc87b){var _0x4ba916=_0x2e27b9||client;return _0x4ba916[_0xc2ba('0x1e')](_0x6b8e60,_0xeb9f52)[_0xc2ba('0x1f')](function(_0x2929bc){logger[_0xc2ba('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x206431,'request\x20sent');logger[_0xc2ba('0x21')](_0xc2ba('0x22'),_0x206431,_0xc2ba('0x23'),JSON[_0xc2ba('0x24')](_0x2929bc));if(_0x2929bc[_0xc2ba('0x25')]){if(_0x2929bc[_0xc2ba('0x25')]['code']===0x1f4){logger['error'](_0xc2ba('0x26'),_0x206431,_0x2929bc['error']['message']);return _0x4dc87b(_0x2929bc[_0xc2ba('0x25')][_0xc2ba('0x27')]);}logger['error'](_0xc2ba('0x26'),_0x206431,_0x2929bc[_0xc2ba('0x25')][_0xc2ba('0x27')]);return _0x4758b9(_0x2929bc['error'][_0xc2ba('0x27')]);}else{logger[_0xc2ba('0x20')](_0xc2ba('0x26'),_0x206431,_0xc2ba('0x23'));_0x4758b9(_0x2929bc[_0xc2ba('0x28')][_0xc2ba('0x27')]);}})[_0xc2ba('0x29')](function(_0x2bd1b3){logger[_0xc2ba('0x25')](_0xc2ba('0x26'),_0x206431,_0x2bd1b3);_0x4dc87b(_0x2bd1b3);});});}function respondWithStatusCode(_0x1b523a,_0x3b64e9){_0x3b64e9=_0x3b64e9||0xcc;return function(_0x4bc646){if(_0x4bc646){return _0x1b523a[_0xc2ba('0x2a')](_0x3b64e9);}return _0x1b523a[_0xc2ba('0x2b')](_0x3b64e9)['end']();};}function respondWithResult(_0x5323c4,_0x19bc1e){_0x19bc1e=_0x19bc1e||0xc8;return function(_0x890f01){if(_0x890f01){return _0x5323c4['status'](_0x19bc1e)[_0xc2ba('0x2c')](_0x890f01);}};}function respondWithFilteredResult(_0x5bb76a,_0x571055){return function(_0x245eb7){if(_0x245eb7){var _0x489200=typeof _0x571055[_0xc2ba('0x2d')]==='undefined'&&typeof _0x571055[_0xc2ba('0x2e')]===_0xc2ba('0x2f');var _0x5df4af=_0x245eb7[_0xc2ba('0x30')];var _0x2c4d53=_0x489200?0x0:_0x571055['offset'];var _0x1d330e=_0x489200?_0x245eb7[_0xc2ba('0x30')]:_0x571055[_0xc2ba('0x2d')]+_0x571055[_0xc2ba('0x2e')];var _0x909713;if(_0x1d330e>=_0x5df4af){_0x1d330e=_0x5df4af;_0x909713=0xc8;}else{_0x909713=0xce;}_0x5bb76a[_0xc2ba('0x2b')](_0x909713);return _0x5bb76a[_0xc2ba('0x31')](_0xc2ba('0x32'),_0x2c4d53+'-'+_0x1d330e+'/'+_0x5df4af)['json'](_0x245eb7);}return null;};}function patchUpdates(_0xfa3c9a){return function(_0x14bc90){try{jsonpatch[_0xc2ba('0x33')](_0x14bc90,_0xfa3c9a,!![]);}catch(_0x41b1bb){return BPromise[_0xc2ba('0x34')](_0x41b1bb);}return _0x14bc90[_0xc2ba('0x35')]();};}function saveUpdates(_0x1bdbda,_0x46d310){return function(_0x5d4508){if(_0x5d4508){return _0x5d4508[_0xc2ba('0x36')](_0x1bdbda)[_0xc2ba('0x1f')](function(_0x3a6c59){return _0x3a6c59;});}return null;};}function removeEntity(_0x1e04f5,_0x4e247a){return function(_0x23770d){if(_0x23770d){return _0x23770d[_0xc2ba('0x37')]()[_0xc2ba('0x1f')](function(){var _0x4abb58=_0x23770d['get']({'plain':!![]});var _0xc6d327=_0xc2ba('0x38');return db['UserProfileResource'][_0xc2ba('0x37')]({'where':{'type':_0xc6d327,'resourceId':_0x4abb58['id']}})[_0xc2ba('0x1f')](function(){return _0x23770d;});})['then'](function(){_0x1e04f5[_0xc2ba('0x2b')](0xcc)[_0xc2ba('0x39')]();});}};}function handleEntityNotFound(_0xe40c3f,_0xae6195){return function(_0x56971f){if(!_0x56971f){_0xe40c3f[_0xc2ba('0x2a')](0x194);}return _0x56971f;};}function handleError(_0x9c5256,_0x2b2d45){_0x2b2d45=_0x2b2d45||0x1f4;return function(_0x5e5020){logger['error'](_0x5e5020[_0xc2ba('0x3a')]);if(_0x5e5020[_0xc2ba('0x3b')]){delete _0x5e5020[_0xc2ba('0x3b')];}_0x9c5256[_0xc2ba('0x2b')](_0x2b2d45)[_0xc2ba('0x3c')](_0x5e5020);};}exports[_0xc2ba('0x3d')]=function(_0x4c6019,_0xb2c4a2){var _0x29173f={'include':[{'model':db[_0xc2ba('0x3e')],'as':_0xc2ba('0x3f')}]},_0x258e6c={},_0x265f7b={'count':0x0,'rows':[]};var _0x3668ad=_[_0xc2ba('0x40')](db[_0xc2ba('0x41')][_0xc2ba('0x42')],function(_0xe5e452){return{'name':_0xe5e452[_0xc2ba('0x43')],'type':_0xe5e452['type']['key']};});_0x258e6c[_0xc2ba('0x44')]=_[_0xc2ba('0x40')](_0x3668ad,'name');_0x258e6c[_0xc2ba('0x45')]=_['keys'](_0x4c6019[_0xc2ba('0x45')]);_0x258e6c[_0xc2ba('0x46')]=_[_0xc2ba('0x47')](_0x258e6c[_0xc2ba('0x44')],_0x258e6c[_0xc2ba('0x45')]);_0x29173f[_0xc2ba('0x48')]=_[_0xc2ba('0x47')](_0x258e6c[_0xc2ba('0x44')],qs['fields'](_0x4c6019[_0xc2ba('0x45')][_0xc2ba('0x49')]));_0x29173f[_0xc2ba('0x48')]=_0x29173f['attributes']['length']?_0x29173f[_0xc2ba('0x48')]:_0x258e6c[_0xc2ba('0x44')];if(!_0x4c6019['query']['hasOwnProperty']('nolimit')){_0x29173f[_0xc2ba('0x2e')]=qs[_0xc2ba('0x2e')](_0x4c6019[_0xc2ba('0x45')]['limit']);_0x29173f[_0xc2ba('0x2d')]=qs['offset'](_0x4c6019[_0xc2ba('0x45')][_0xc2ba('0x2d')]);}_0x29173f[_0xc2ba('0x4a')]=qs[_0xc2ba('0x4b')](_0x4c6019[_0xc2ba('0x45')]['sort']);_0x29173f['where']=qs['filters'](_[_0xc2ba('0x4c')](_0x4c6019['query'],_0x258e6c[_0xc2ba('0x46')]),_0x3668ad);if(_0x4c6019['query'][_0xc2ba('0x4d')]){_0x29173f['where']=_[_0xc2ba('0x4e')](_0x29173f['where'],{'$or':_[_0xc2ba('0x40')](_0x3668ad,function(_0x1f19e2){if(_0x1f19e2[_0xc2ba('0x4f')]!=='VIRTUAL'){var _0x2c71df={};_0x2c71df[_0x1f19e2[_0xc2ba('0x3b')]]={'$like':'%'+_0x4c6019[_0xc2ba('0x45')]['filter']+'%'};return _0x2c71df;}})});}_0x29173f=_[_0xc2ba('0x4e')]({},_0x29173f,_0x4c6019['options']);var _0x365bac={'where':_0x29173f[_0xc2ba('0x50')]};return db[_0xc2ba('0x41')][_0xc2ba('0x30')](_0x365bac)[_0xc2ba('0x1f')](function(_0x17c59){_0x265f7b[_0xc2ba('0x30')]=_0x17c59;if(_0x4c6019[_0xc2ba('0x45')][_0xc2ba('0x51')]){_0x29173f[_0xc2ba('0x52')]=[{'all':!![]}];}return db[_0xc2ba('0x41')][_0xc2ba('0x53')](_0x29173f);})[_0xc2ba('0x1f')](function(_0x496dd2){_0x265f7b[_0xc2ba('0x54')]=_0x496dd2;return _0x265f7b;})[_0xc2ba('0x1f')](respondWithFilteredResult(_0xb2c4a2,_0x29173f))[_0xc2ba('0x29')](handleError(_0xb2c4a2,null));};exports[_0xc2ba('0x55')]=function(_0x181ebb,_0x5d726e){var _0x273b68={'raw':![],'where':{'id':_0x181ebb[_0xc2ba('0x56')]['id']},'include':[{'model':db[_0xc2ba('0x3e')],'as':_0xc2ba('0x3f')}]},_0x5045d0={};_0x5045d0[_0xc2ba('0x44')]=_['keys'](db[_0xc2ba('0x41')][_0xc2ba('0x42')]);_0x5045d0[_0xc2ba('0x45')]=_[_0xc2ba('0x57')](_0x181ebb[_0xc2ba('0x45')]);_0x5045d0[_0xc2ba('0x46')]=_[_0xc2ba('0x47')](_0x5045d0[_0xc2ba('0x44')],_0x5045d0['query']);_0x273b68['attributes']=_[_0xc2ba('0x47')](_0x5045d0[_0xc2ba('0x44')],qs['fields'](_0x181ebb['query'][_0xc2ba('0x49')]));_0x273b68[_0xc2ba('0x48')]=_0x273b68[_0xc2ba('0x48')][_0xc2ba('0x58')]?_0x273b68[_0xc2ba('0x48')]:_0x5045d0[_0xc2ba('0x44')];if(_0x181ebb['query'][_0xc2ba('0x51')]){_0x273b68[_0xc2ba('0x52')]=[{'all':!![]}];}_0x273b68=_[_0xc2ba('0x4e')]({},_0x273b68,_0x181ebb[_0xc2ba('0x59')]);return db[_0xc2ba('0x41')][_0xc2ba('0x5a')](_0x273b68)[_0xc2ba('0x1f')](handleEntityNotFound(_0x5d726e,null))[_0xc2ba('0x1f')](respondWithResult(_0x5d726e,null))[_0xc2ba('0x29')](handleError(_0x5d726e,null));};exports[_0xc2ba('0x5b')]=function(_0xe847f1,_0x5e65f4){return db['WhatsappAccount'][_0xc2ba('0x5b')](_0xe847f1[_0xc2ba('0x5c')],{})[_0xc2ba('0x1f')](function(_0x201793){var _0x538abf=_0xe847f1[_0xc2ba('0x5d')][_0xc2ba('0x5e')]({'plain':!![]});if(!_0x538abf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x538abf[_0xc2ba('0x5f')]==='user'){var _0x5639ee=_0x201793[_0xc2ba('0x5e')]({'plain':!![]});var _0x3524e1=_0xc2ba('0x38');return db[_0xc2ba('0x60')][_0xc2ba('0x5a')]({'where':{'name':_0x3524e1,'userProfileId':_0x538abf[_0xc2ba('0x61')]},'raw':!![]})['then'](function(_0x336ed6){if(_0x336ed6&&_0x336ed6['autoAssociation']===0x0){return db[_0xc2ba('0x62')][_0xc2ba('0x5b')]({'name':_0x5639ee[_0xc2ba('0x3b')],'resourceId':_0x5639ee['id'],'type':_0x336ed6[_0xc2ba('0x3b')],'sectionId':_0x336ed6['id']},{})[_0xc2ba('0x1f')](function(){return _0x201793;});}else{return _0x201793;}})['catch'](function(_0x5367bc){logger[_0xc2ba('0x25')](_0xc2ba('0x63'),_0x5367bc);throw _0x5367bc;});}return _0x201793;})[_0xc2ba('0x1f')](respondWithResult(_0x5e65f4,0xc9))['catch'](handleError(_0x5e65f4,null));};exports[_0xc2ba('0x36')]=function(_0x595023,_0x16d306){if(_0x595023['body']['id']){delete _0x595023['body']['id'];}return db[_0xc2ba('0x41')][_0xc2ba('0x5a')]({'where':{'id':_0x595023[_0xc2ba('0x56')]['id']},'include':[{'model':db[_0xc2ba('0x3e')],'as':_0xc2ba('0x3f')}]})['then'](handleEntityNotFound(_0x16d306,null))[_0xc2ba('0x1f')](saveUpdates(_0x595023[_0xc2ba('0x5c')],null))['then'](respondWithResult(_0x16d306,null))[_0xc2ba('0x29')](handleError(_0x16d306,null));};exports[_0xc2ba('0x37')]=function(_0xbd27f5,_0x1db618){return db['WhatsappAccount']['find']({'where':{'id':_0xbd27f5[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x1db618,null))[_0xc2ba('0x1f')](removeEntity(_0x1db618,null))['catch'](handleError(_0x1db618,null));};exports[_0xc2ba('0x64')]=function(_0x261339,_0x4012cd){return db['WhatsappAccount']['describe']()['then'](respondWithResult(_0x4012cd,null))[_0xc2ba('0x29')](handleError(_0x4012cd,null));};exports['addDisposition']=function(_0x2eb9c6,_0xd8b81,_0x5f1ac5){if(_0x2eb9c6['body']['id']){delete _0x2eb9c6['body']['id'];}return db[_0xc2ba('0x41')][_0xc2ba('0x5a')]({'where':{'id':_0x2eb9c6[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0xd8b81,null))[_0xc2ba('0x1f')](function(_0x648d55){if(_0x648d55){_0x2eb9c6['body'][_0xc2ba('0x65')]=_0x648d55['id'];return db[_0xc2ba('0x66')][_0xc2ba('0x5b')](_0x2eb9c6[_0xc2ba('0x5c')]);}})[_0xc2ba('0x1f')](respondWithResult(_0xd8b81,null))['catch'](handleError(_0xd8b81,null));};exports[_0xc2ba('0x67')]=function(_0x2548cb,_0x3f58e5,_0x1502c7){var _0x133f91={'raw':![],'where':{}};var _0x2ae583={};var _0x4d694e={'count':0x0,'rows':[]};return db[_0xc2ba('0x41')]['findOne']({'where':{'id':_0x2548cb[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x3f58e5,null))[_0xc2ba('0x1f')](function(_0x594e69){if(_0x594e69){_0x2ae583[_0xc2ba('0x44')]=_[_0xc2ba('0x57')](db[_0xc2ba('0x66')][_0xc2ba('0x42')]);_0x2ae583['query']=_[_0xc2ba('0x57')](_0x2548cb[_0xc2ba('0x45')]);_0x2ae583[_0xc2ba('0x46')]=_[_0xc2ba('0x47')](_0x2ae583[_0xc2ba('0x44')],_0x2ae583[_0xc2ba('0x45')]);_0x133f91['attributes']=_['intersection'](_0x2ae583['model'],qs[_0xc2ba('0x49')](_0x2548cb['query'][_0xc2ba('0x49')]));_0x133f91[_0xc2ba('0x48')]=_0x133f91[_0xc2ba('0x48')][_0xc2ba('0x58')]?_0x133f91[_0xc2ba('0x48')]:_0x2ae583[_0xc2ba('0x44')];if(!_0x2548cb[_0xc2ba('0x45')][_0xc2ba('0x68')](_0xc2ba('0x69'))){_0x133f91['limit']=qs[_0xc2ba('0x2e')](_0x2548cb[_0xc2ba('0x45')][_0xc2ba('0x2e')]);_0x133f91[_0xc2ba('0x2d')]=qs[_0xc2ba('0x2d')](_0x2548cb[_0xc2ba('0x45')][_0xc2ba('0x2d')]);}_0x133f91[_0xc2ba('0x4a')]=qs[_0xc2ba('0x4b')](_0x2548cb[_0xc2ba('0x45')][_0xc2ba('0x4b')]);_0x133f91['where']=qs['filters'](_[_0xc2ba('0x4c')](_0x2548cb['query'],_0x2ae583['filters']));_0x133f91['where'][_0xc2ba('0x65')]=_0x594e69['id'];if(_0x2548cb[_0xc2ba('0x45')][_0xc2ba('0x4d')]){_0x133f91[_0xc2ba('0x50')]=_[_0xc2ba('0x4e')](_0x133f91['where'],{'$or':_['map'](_0x133f91[_0xc2ba('0x48')],function(_0xec42bb){var _0x5e01c2={};_0x5e01c2[_0xec42bb]={'$like':'%'+_0x2548cb[_0xc2ba('0x45')][_0xc2ba('0x4d')]+'%'};return _0x5e01c2;})});}_0x133f91=_['merge']({},_0x133f91,_0x2548cb[_0xc2ba('0x59')]);return db[_0xc2ba('0x66')][_0xc2ba('0x30')]({'where':_0x133f91['where']})[_0xc2ba('0x1f')](function(_0x14e6d7){_0x4d694e[_0xc2ba('0x30')]=_0x14e6d7;if(_0x2548cb[_0xc2ba('0x45')]['includeAll']){_0x133f91['include']=[{'all':!![]}];}return db['Disposition'][_0xc2ba('0x53')](_0x133f91);})['then'](function(_0x31371e){_0x4d694e[_0xc2ba('0x54')]=_0x31371e;return _0x4d694e;});}})['then'](respondWithFilteredResult(_0x3f58e5,_0x133f91))['catch'](handleError(_0x3f58e5,null));};exports['removeDispositions']=function(_0x1cfb8f,_0x3b72e1,_0x11b170){return db['WhatsappAccount']['find']({'where':{'id':_0x1cfb8f[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x3b72e1,null))['then'](function(_0x1a60f5){if(_0x1a60f5){return _0x1a60f5[_0xc2ba('0x6a')](_0x1cfb8f[_0xc2ba('0x45')][_0xc2ba('0x6b')]);}})['then'](respondWithStatusCode(_0x3b72e1,null))['catch'](handleError(_0x3b72e1,null));};exports[_0xc2ba('0x6c')]=function(_0xecf0c4,_0x3a641a,_0xb76399){if(_0xecf0c4['body']['id']){delete _0xecf0c4[_0xc2ba('0x5c')]['id'];}return db['WhatsappAccount'][_0xc2ba('0x5a')]({'where':{'id':_0xecf0c4[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x3a641a,null))[_0xc2ba('0x1f')](function(_0x198a36){if(_0x198a36){_0xecf0c4[_0xc2ba('0x5c')]['WhatsappAccountId']=_0x198a36['id'];return db[_0xc2ba('0x6d')][_0xc2ba('0x5b')](_0xecf0c4['body']);}})[_0xc2ba('0x1f')](respondWithResult(_0x3a641a,null))['catch'](handleError(_0x3a641a,null));};exports['getAnswers']=function(_0x156042,_0x2e5bcd,_0x4deff8){var _0x45b1f9={'raw':![],'where':{}};var _0x3caf05={};var _0x29b415={'count':0x0,'rows':[]};return db[_0xc2ba('0x41')][_0xc2ba('0x6e')]({'where':{'id':_0x156042['params']['id']}})['then'](handleEntityNotFound(_0x2e5bcd,null))['then'](function(_0x38c4d3){if(_0x38c4d3){_0x3caf05['model']=_['keys'](db[_0xc2ba('0x6d')]['rawAttributes']);_0x3caf05[_0xc2ba('0x45')]=_[_0xc2ba('0x57')](_0x156042[_0xc2ba('0x45')]);_0x3caf05['filters']=_[_0xc2ba('0x47')](_0x3caf05[_0xc2ba('0x44')],_0x3caf05['query']);_0x45b1f9[_0xc2ba('0x48')]=_[_0xc2ba('0x47')](_0x3caf05[_0xc2ba('0x44')],qs['fields'](_0x156042[_0xc2ba('0x45')][_0xc2ba('0x49')]));_0x45b1f9[_0xc2ba('0x48')]=_0x45b1f9['attributes'][_0xc2ba('0x58')]?_0x45b1f9[_0xc2ba('0x48')]:_0x3caf05[_0xc2ba('0x44')];if(!_0x156042[_0xc2ba('0x45')][_0xc2ba('0x68')](_0xc2ba('0x69'))){_0x45b1f9[_0xc2ba('0x2e')]=qs[_0xc2ba('0x2e')](_0x156042[_0xc2ba('0x45')]['limit']);_0x45b1f9[_0xc2ba('0x2d')]=qs[_0xc2ba('0x2d')](_0x156042['query']['offset']);}_0x45b1f9[_0xc2ba('0x4a')]=qs[_0xc2ba('0x4b')](_0x156042[_0xc2ba('0x45')][_0xc2ba('0x4b')]);_0x45b1f9[_0xc2ba('0x50')]=qs['filters'](_['pick'](_0x156042[_0xc2ba('0x45')],_0x3caf05[_0xc2ba('0x46')]));_0x45b1f9[_0xc2ba('0x50')]['WhatsappAccountId']=_0x38c4d3['id'];if(_0x156042[_0xc2ba('0x45')][_0xc2ba('0x4d')]){_0x45b1f9[_0xc2ba('0x50')]=_[_0xc2ba('0x4e')](_0x45b1f9[_0xc2ba('0x50')],{'$or':_[_0xc2ba('0x40')](_0x45b1f9[_0xc2ba('0x48')],function(_0x341465){var _0x2f4b84={};_0x2f4b84[_0x341465]={'$like':'%'+_0x156042[_0xc2ba('0x45')]['filter']+'%'};return _0x2f4b84;})});}_0x45b1f9=_[_0xc2ba('0x4e')]({},_0x45b1f9,_0x156042[_0xc2ba('0x59')]);return db[_0xc2ba('0x6d')][_0xc2ba('0x30')]({'where':_0x45b1f9[_0xc2ba('0x50')]})[_0xc2ba('0x1f')](function(_0x1ae3d2){_0x29b415[_0xc2ba('0x30')]=_0x1ae3d2;if(_0x156042[_0xc2ba('0x45')][_0xc2ba('0x51')]){_0x45b1f9['include']=[{'all':!![]}];}return db[_0xc2ba('0x6d')][_0xc2ba('0x53')](_0x45b1f9);})[_0xc2ba('0x1f')](function(_0x1e7994){_0x29b415[_0xc2ba('0x54')]=_0x1e7994;return _0x29b415;});}})['then'](respondWithFilteredResult(_0x2e5bcd,_0x45b1f9))[_0xc2ba('0x29')](handleError(_0x2e5bcd,null));};exports['removeAnswers']=function(_0x1fd061,_0x381811,_0x28633b){return db['WhatsappAccount']['find']({'where':{'id':_0x1fd061[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x381811,null))[_0xc2ba('0x1f')](function(_0x1a0217){if(_0x1a0217){return _0x1a0217['removeAnswers'](_0x1fd061[_0xc2ba('0x45')][_0xc2ba('0x6b')]);}})[_0xc2ba('0x1f')](respondWithStatusCode(_0x381811,null))['catch'](handleError(_0x381811,null));};exports[_0xc2ba('0x6f')]=function(_0x1e551c,_0x3200fb,_0x282d80){return db[_0xc2ba('0x41')][_0xc2ba('0x5a')]({'where':{'id':_0x1e551c['params']['id']}})['then'](handleEntityNotFound(_0x3200fb,null))[_0xc2ba('0x1f')](function(_0x4b1ff9){if(_0x4b1ff9){return _0x4b1ff9[_0xc2ba('0x6f')](_0x1e551c[_0xc2ba('0x5c')][_0xc2ba('0x6b')],_[_0xc2ba('0x70')](_0x1e551c[_0xc2ba('0x5c')],[_0xc2ba('0x6b'),'id'])||{})[_0xc2ba('0x71')](function(_0x3d214){for(var _0x2a6d2a=0x0;_0x2a6d2a<_0x1e551c[_0xc2ba('0x5c')][_0xc2ba('0x6b')][_0xc2ba('0x58')];_0x2a6d2a+=0x1){socket['emit'](_0xc2ba('0x72'),{'UserId':Number(_0x1e551c['body'][_0xc2ba('0x6b')][_0x2a6d2a]),'WhatsappAccountId':Number(_0x1e551c[_0xc2ba('0x56')]['id'])});}return _0x3d214;});}})['then'](respondWithResult(_0x3200fb,null))[_0xc2ba('0x29')](handleError(_0x3200fb,null));};exports[_0xc2ba('0x73')]=function(_0x1aebd9,_0x47db8b,_0x501399){return db[_0xc2ba('0x41')][_0xc2ba('0x5a')]({'where':{'id':_0x1aebd9[_0xc2ba('0x56')]['id']}})['then'](handleEntityNotFound(_0x47db8b,null))['then'](function(_0x1af6f1){if(_0x1af6f1){return _0x1af6f1['removeAgents'](_0x1aebd9[_0xc2ba('0x45')][_0xc2ba('0x6b')])['then'](function(){if(_[_0xc2ba('0x74')](_0x1aebd9[_0xc2ba('0x45')]['ids'])){for(var _0x27a1af=0x0;_0x27a1af<_0x1aebd9[_0xc2ba('0x45')][_0xc2ba('0x6b')]['length'];_0x27a1af+=0x1){socket[_0xc2ba('0x75')](_0xc2ba('0x76'),{'UserId':Number(_0x1aebd9[_0xc2ba('0x45')][_0xc2ba('0x6b')][_0x27a1af]),'WhatsappAccountId':Number(_0x1aebd9[_0xc2ba('0x56')]['id'])});}}else{socket[_0xc2ba('0x75')](_0xc2ba('0x76'),{'UserId':Number(_0x1aebd9[_0xc2ba('0x45')][_0xc2ba('0x6b')]),'WhatsappAccountId':Number(_0x1aebd9['params']['id'])});}});}})[_0xc2ba('0x1f')](respondWithStatusCode(_0x47db8b,null))['catch'](handleError(_0x47db8b,null));};exports[_0xc2ba('0x77')]=function(_0x38b031,_0x1a8195,_0x4a4678){var _0x3fcce7={};var _0x4c5b30={};var _0x313f59;var _0x13be4d;return db[_0xc2ba('0x41')][_0xc2ba('0x6e')]({'where':{'id':_0x38b031[_0xc2ba('0x56')]['id']}})['then'](handleEntityNotFound(_0x1a8195,null))[_0xc2ba('0x1f')](function(_0x3d7b1a){if(_0x3d7b1a){_0x313f59=_0x3d7b1a;_0x4c5b30['model']=_[_0xc2ba('0x57')](db['User'][_0xc2ba('0x42')]);_0x4c5b30[_0xc2ba('0x45')]=_[_0xc2ba('0x57')](_0x38b031[_0xc2ba('0x45')]);_0x4c5b30[_0xc2ba('0x46')]=_[_0xc2ba('0x47')](_0x4c5b30[_0xc2ba('0x44')],_0x4c5b30['query']);_0x3fcce7[_0xc2ba('0x48')]=_[_0xc2ba('0x47')](_0x4c5b30['model'],qs[_0xc2ba('0x49')](_0x38b031[_0xc2ba('0x45')]['fields']));_0x3fcce7[_0xc2ba('0x48')]=_0x3fcce7[_0xc2ba('0x48')][_0xc2ba('0x58')]?_0x3fcce7[_0xc2ba('0x48')]:_0x4c5b30[_0xc2ba('0x44')];_0x3fcce7[_0xc2ba('0x4a')]=qs[_0xc2ba('0x4b')](_0x38b031[_0xc2ba('0x45')][_0xc2ba('0x4b')]);_0x3fcce7[_0xc2ba('0x50')]=qs[_0xc2ba('0x46')](_['pick'](_0x38b031[_0xc2ba('0x45')],_0x4c5b30[_0xc2ba('0x46')]));if(_0x38b031[_0xc2ba('0x45')]['filter']){_0x3fcce7[_0xc2ba('0x50')]=_[_0xc2ba('0x4e')](_0x3fcce7['where'],{'$or':_['map'](_0x3fcce7[_0xc2ba('0x48')],function(_0x13b903){var _0x3a3037={};_0x3a3037[_0x13b903]={'$like':'%'+_0x38b031[_0xc2ba('0x45')][_0xc2ba('0x4d')]+'%'};return _0x3a3037;})});}_0x3fcce7=_[_0xc2ba('0x4e')]({},_0x3fcce7,_0x38b031[_0xc2ba('0x59')]);return _0x313f59['getAgents'](_0x3fcce7);}})[_0xc2ba('0x1f')](function(_0x350507){if(_0x350507){_0x13be4d=_0x350507[_0xc2ba('0x58')];if(!_0x38b031[_0xc2ba('0x45')]['hasOwnProperty'](_0xc2ba('0x69'))){_0x3fcce7[_0xc2ba('0x2e')]=qs[_0xc2ba('0x2e')](_0x38b031[_0xc2ba('0x45')][_0xc2ba('0x2e')]);_0x3fcce7[_0xc2ba('0x2d')]=qs['offset'](_0x38b031[_0xc2ba('0x45')]['offset']);}return _0x313f59[_0xc2ba('0x77')](_0x3fcce7);}})['then'](function(_0x3de888){if(_0x3de888){return _0x3de888?{'count':_0x13be4d,'rows':_0x3de888}:null;}})[_0xc2ba('0x1f')](respondWithResult(_0x1a8195,null))[_0xc2ba('0x29')](handleError(_0x1a8195,null));};exports['addApplications']=function(_0x52cf8c,_0x1fe78d){var _0x354024=_0x52cf8c[_0xc2ba('0x56')]['id'];var _0x4da81c=_0x52cf8c[_0xc2ba('0x5c')];var _0xcfed20=0xc8;var _0x490223=null;return db[_0xc2ba('0x78')][_0xc2ba('0x79')]({'isolationLevel':db[_0xc2ba('0x78')][_0xc2ba('0x7a')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x470198){return db[_0xc2ba('0x41')][_0xc2ba('0x6e')]({'where':{'id':_0x354024},'transaction':_0x470198})[_0xc2ba('0x1f')](function(_0x483f2f){if(_0x483f2f){return db[_0xc2ba('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x354024},'transaction':_0x470198})[_0xc2ba('0x1f')](function(){var _0x43c975=_[_0xc2ba('0x40')](_0x4da81c,function(_0x3a681e){_0x3a681e[_0xc2ba('0x65')]=_0x354024;return _0x3a681e;});return db[_0xc2ba('0x7b')][_0xc2ba('0x7c')](_0x43c975,{'transaction':_0x470198});});}else{_0xcfed20=0x194;_0x490223=[];}});})['then'](function(){if(_0xcfed20!==0x194){return db[_0xc2ba('0x7b')][_0xc2ba('0x7d')]({'where':{'WhatsappAccountId':_0x354024},'order':_0xc2ba('0x7e')})['then'](function(_0x29a39e){_0x490223=_0x29a39e;});}})[_0xc2ba('0x29')](function(_0xb1daf2){_0xcfed20=0x1f4;logger[_0xc2ba('0x25')](_0xb1daf2[_0xc2ba('0x3a')]);if(_0xb1daf2[_0xc2ba('0x3b')]){delete _0xb1daf2[_0xc2ba('0x3b')];}_0x490223=_0xb1daf2;})[_0xc2ba('0x7f')](function(){if(_0x490223===null){_0x1fe78d['sendStatus'](_0xcfed20);}else{if(_0xcfed20===0x1f4){_0x1fe78d['status'](_0xcfed20)[_0xc2ba('0x3c')](_0x490223);}else{_0x1fe78d[_0xc2ba('0x2b')](_0xcfed20)[_0xc2ba('0x2c')](_0x490223);}}});};exports[_0xc2ba('0x80')]=function(_0x215c6a,_0x56fb3f,_0x37d7b0){var _0x58f185={};var _0xe89cee={};var _0x177a56;var _0x5b7493;return db['WhatsappAccount'][_0xc2ba('0x6e')]({'where':{'id':_0x215c6a[_0xc2ba('0x56')]['id']}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x56fb3f,null))[_0xc2ba('0x1f')](function(_0x311532){if(_0x311532){_0x177a56=_0x311532;_0xe89cee['model']=_[_0xc2ba('0x57')](db[_0xc2ba('0x7b')][_0xc2ba('0x42')]);_0xe89cee['query']=_[_0xc2ba('0x57')](_0x215c6a[_0xc2ba('0x45')]);_0xe89cee[_0xc2ba('0x46')]=_['intersection'](_0xe89cee[_0xc2ba('0x44')],_0xe89cee['query']);_0x58f185[_0xc2ba('0x48')]=_[_0xc2ba('0x47')](_0xe89cee[_0xc2ba('0x44')],qs[_0xc2ba('0x49')](_0x215c6a[_0xc2ba('0x45')]['fields']));_0x58f185['attributes']=_0x58f185['attributes'][_0xc2ba('0x58')]?_0x58f185[_0xc2ba('0x48')]:_0xe89cee[_0xc2ba('0x44')];_0x58f185[_0xc2ba('0x4a')]=qs['sort'](_0x215c6a[_0xc2ba('0x45')]['sort']);_0x58f185[_0xc2ba('0x50')]=qs[_0xc2ba('0x46')](_[_0xc2ba('0x4c')](_0x215c6a['query'],_0xe89cee[_0xc2ba('0x46')]));if(_0x215c6a[_0xc2ba('0x45')][_0xc2ba('0x4d')]){_0x58f185[_0xc2ba('0x50')]=_[_0xc2ba('0x4e')](_0x58f185[_0xc2ba('0x50')],{'$or':_[_0xc2ba('0x40')](_0x58f185[_0xc2ba('0x48')],function(_0x4ed110){var _0x4c8ed4={};_0x4c8ed4[_0x4ed110]={'$like':'%'+_0x215c6a[_0xc2ba('0x45')][_0xc2ba('0x4d')]+'%'};return _0x4c8ed4;})});}_0x58f185=_[_0xc2ba('0x4e')]({},_0x58f185,_0x215c6a['options']);return _0x177a56[_0xc2ba('0x80')](_0x58f185);}})[_0xc2ba('0x1f')](function(_0x4d980a){if(_0x4d980a){_0x5b7493=_0x4d980a[_0xc2ba('0x58')];if(!_0x215c6a['query'][_0xc2ba('0x68')](_0xc2ba('0x69'))){_0x58f185[_0xc2ba('0x2e')]=qs[_0xc2ba('0x2e')](_0x215c6a[_0xc2ba('0x45')][_0xc2ba('0x2e')]);_0x58f185[_0xc2ba('0x2d')]=qs[_0xc2ba('0x2d')](_0x215c6a[_0xc2ba('0x45')][_0xc2ba('0x2d')]);}return _0x177a56[_0xc2ba('0x80')](_0x58f185);}})[_0xc2ba('0x1f')](function(_0x74953d){if(_0x74953d){return _0x74953d?{'count':_0x5b7493,'rows':_0x74953d}:null;}})[_0xc2ba('0x1f')](respondWithResult(_0x56fb3f,null))[_0xc2ba('0x29')](handleError(_0x56fb3f,null));};exports[_0xc2ba('0x81')]=function(_0x43e23c,_0x4e35a7,_0x4ab6bd){var _0x152858={'channel':_0xc2ba('0x82')};var _0x2efef6=[];var _0x5dec4a=[];var _0x3eccb2={};return db[_0xc2ba('0x41')][_0xc2ba('0x5a')]({'where':{'id':_0x43e23c[_0xc2ba('0x56')]['id']},'include':[{'model':db[_0xc2ba('0x7b')],'as':_0xc2ba('0x83')}]})[_0xc2ba('0x1f')](handleEntityNotFound(_0x4e35a7,null))[_0xc2ba('0x1f')](function(_0x52e388){_0x152858[_0xc2ba('0x84')]=_0x52e388;if(_0x152858[_0xc2ba('0x84')]&&_0x152858[_0xc2ba('0x84')][_0xc2ba('0x4f')]===_0xc2ba('0x85')&&_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x86')]){if(_0x43e23c['body'][_0xc2ba('0x86')]['length']===0x0)return;if(_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x86')][0x0][_0xc2ba('0x87')]!=='read')return;return db[_0xc2ba('0x88')]['update']({'read':!![],'readAt':_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x86')][0x0][_0xc2ba('0x89')]},{'where':{'messageId':_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x86')][0x0][_0xc2ba('0x8a')]},'individualHooks':!![]})[_0xc2ba('0x1f')](function(_0xb72330){return _0x4e35a7['status'](0xc8)[_0xc2ba('0x2c')](_0xb72330);});}_0x152858['applications']=_['orderBy'](_0x52e388[_0xc2ba('0x83')],[_0xc2ba('0x7e')],[_0xc2ba('0x8b')]);if(_0x152858[_0xc2ba('0x84')][_0xc2ba('0x83')]){delete _0x152858[_0xc2ba('0x84')][_0xc2ba('0x83')];}return db[_0xc2ba('0x8c')][_0xc2ba('0x64')]()[_0xc2ba('0x1f')](function(_0x350b37){if(!_0x350b37){throw new db[(_0xc2ba('0x8d'))]['ValidationError']('no\x20available\x20attributes');}_0x2efef6=_[_0xc2ba('0x8e')](_['keys'](_0x350b37),[_0xc2ba('0x8f'),_0xc2ba('0x90')]);_0x5dec4a=_[_0xc2ba('0x8e')](_[_0xc2ba('0x57')](_0x350b37),[_0xc2ba('0x8f'),_0xc2ba('0x90'),'CompanyId',_0xc2ba('0x91')]);_0x152858['body']={'mapKey':_0xc2ba('0x92')};if(_0x152858[_0xc2ba('0x84')]&&_0x152858['account']['type']===_0xc2ba('0x93')){_0x152858['body'][_0xc2ba('0x94')]=_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x95')][_0xc2ba('0x96')]('whatsapp:','');_0x152858['body'][_0xc2ba('0x5c')]=_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x97')];_0x152858['body'][_0xc2ba('0x98')]=_0x43e23c['body']['MessageSid'];}if(_0x152858[_0xc2ba('0x84')]&&_0x152858[_0xc2ba('0x84')]['type']===_0xc2ba('0x85')){_0x152858[_0xc2ba('0x5c')]['from']=_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x99')][0x0][_0xc2ba('0x94')];_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x5c')]=_0x43e23c['body'][_0xc2ba('0x99')][0x0][_0xc2ba('0x27')]['body'];_0x152858[_0xc2ba('0x5c')]['messageId']=_0x43e23c[_0xc2ba('0x5c')][_0xc2ba('0x99')][0x0]['message_id'];}if(_0x152858[_0xc2ba('0x5c')]['id']){delete _0x152858['body']['id'];}if(_[_0xc2ba('0x9a')](_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x94')])){throw new db[(_0xc2ba('0x8d'))][(_0xc2ba('0x9b'))](_0xc2ba('0x9c'));}if(_[_0xc2ba('0x9a')](_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x5c')])||_0x152858[_0xc2ba('0x5c')]['body']===''){throw new db[(_0xc2ba('0x8d'))][(_0xc2ba('0x9b'))](_0xc2ba('0x9d'));}if(_['isNil'](_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x9e')])){throw new db[(_0xc2ba('0x8d'))][(_0xc2ba('0x9b'))](_0xc2ba('0x9f')+_0x5dec4a);}if(!_[_0xc2ba('0xa0')](_0x5dec4a,_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x9e')])){throw new db[(_0xc2ba('0x8d'))][(_0xc2ba('0x9b'))](_0xc2ba('0xa1')+_0x5dec4a);}_0x3eccb2[_0x152858[_0xc2ba('0x5c')]['mapKey']]=_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x94')];return db[_0xc2ba('0xa2')][_0xc2ba('0x5a')]({'where':{'id':_0x152858[_0xc2ba('0x84')][_0xc2ba('0x91')]},'include':[{'model':db[_0xc2ba('0x8c')],'as':_0xc2ba('0xa3'),'where':_0x3eccb2,'limit':0x1,'order':[[_0xc2ba('0x90'),'DESC']]}]});})[_0xc2ba('0x1f')](handleEntityNotFound(_0x4e35a7,null))['then'](function(_0x159e1e){if(_0x159e1e){_0x152858[_0xc2ba('0xa4')]=_[_0xc2ba('0x70')](_0x159e1e,[_0xc2ba('0xa3')]);if(_0x159e1e['Contacts']['length']){return _0x159e1e['Contacts'][0x0];}var _0x52f83e=_['defaults'](_0x152858[_0xc2ba('0x5c')],{'firstName':_0x152858[_0xc2ba('0x5c')]['from'],'ListId':_0x159e1e['id']});_0x52f83e[_0x152858[_0xc2ba('0x5c')]['mapKey']]=_0x152858['body'][_0xc2ba('0x94')];return db[_0xc2ba('0x8c')]['create'](_0x52f83e,{'fields':_0x2efef6,'raw':!![]});}})['then'](handleEntityNotFound(_0x4e35a7,null))['then'](function(_0x20bcaf){if(_0x20bcaf){_0x152858['contact']=_0x20bcaf;var _0x3a5691={'ContactId':_0x20bcaf['id'],'phone':_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x94')],'WhatsappAccountId':_0x43e23c['params']['id']};var _0x3ba2e6={'ContactId':_0x20bcaf['id'],'WhatsappAccountId':_0x43e23c['params']['id'],'closed':![]};return db[_0xc2ba('0xa5')][_0xc2ba('0x5a')]({'where':_0x3ba2e6})[_0xc2ba('0x1f')](function(_0x5f4aa5){if(_0x5f4aa5){return[_0x5f4aa5,![]];}return db[_0xc2ba('0xa5')][_0xc2ba('0x5b')](_0x3a5691)[_0xc2ba('0x1f')](function(_0x8219ec){return[_0x8219ec,!![]];});});}})[_0xc2ba('0x71')](function(_0x1e5960,_0x221a5c){_0x152858[_0xc2ba('0xa6')]=_0x1e5960['get']({'plain':!![]});_0x152858[_0xc2ba('0xa6')][_0xc2ba('0xa7')]=![];if(_0x221a5c){if(_0x152858[_0xc2ba('0x84')][_0xc2ba('0xa8')]){_0x152858[_0xc2ba('0xa9')][_0xc2ba('0xaa')]({'id':0x0,'priority':_0x152858['applications'][_0xc2ba('0x58')]+0x1,'app':_0xc2ba('0xab'),'appdata':_0xc2ba('0xac'),'interval':_0xc2ba('0xad')});}_0x152858[_0xc2ba('0xa6')][_0xc2ba('0xa7')]=!![];}return db[_0xc2ba('0x88')]['create']({'phone':_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x94')],'messageId':_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x98')],'body':_0x152858[_0xc2ba('0x5c')][_0xc2ba('0x5c')],'WhatsappAccountId':_0x43e23c['params']['id'],'WhatsappInteractionId':_0x1e5960['id'],'direction':'in','ContactId':_0x1e5960[_0xc2ba('0xae')],'AttachmentId':_0x152858[_0xc2ba('0x5c')][_0xc2ba('0xaf')]});})[_0xc2ba('0x1f')](function(_0x481474){_0x152858[_0xc2ba('0x27')]=_0x481474;if(_0x152858[_0xc2ba('0xa6')][_0xc2ba('0xb0')]){return db[_0xc2ba('0xb1')][_0xc2ba('0x5a')]({'attributes':['id',_0xc2ba('0x3b')],'where':{'id':_0x152858[_0xc2ba('0xa6')][_0xc2ba('0xb0')]}})['then'](function(_0x190327){if(_0x190327){_0x152858[_0xc2ba('0xa9')][_0xc2ba('0xb2')]({'id':0x0,'priority':0x0,'app':_0xc2ba('0xb3'),'appdata':_0x190327['name']+','+(_0x152858[_0xc2ba('0x84')][_0xc2ba('0xb4')]||0xa),'interval':_0xc2ba('0xad')});}return respondWithRpcPromise(_0xc2ba('0xb5'),_0xc2ba('0xb6'),_0x152858);});}return respondWithRpcPromise(_0xc2ba('0xb5'),_0xc2ba('0xb6'),_0x152858);})[_0xc2ba('0x1f')](function(_0x62bfab){if(_0x62bfab){var _0x1e3415=0xc8;var _0x3e06d=_0xc2ba('0xb7');logger[_0xc2ba('0x20')](_0xc2ba('0x22'),_0x3e06d,_0x1e3415,_0xc2ba('0xb8'));logger[_0xc2ba('0x21')](_0xc2ba('0xb9'),_0x3e06d,_0x1e3415,_0xc2ba('0xb8'),JSON[_0xc2ba('0x24')](_0x62bfab));if(_0x152858['account'][_0xc2ba('0x4f')]==='twilio'){return _0x4e35a7[_0xc2ba('0x2b')](_0x1e3415)[_0xc2ba('0x31')](_0xc2ba('0xba'),'text/xml')[_0xc2ba('0x3c')]('\x0a');}else{return _0x4e35a7[_0xc2ba('0x2b')](_0x1e3415)[_0xc2ba('0x2c')](_0x62bfab);}}});})[_0xc2ba('0x29')](handleError(_0x4e35a7,null));};exports['send']=function(_0x8a3c05,_0x12359e,_0x2e944f){var _0x53b100,_0x4ac58c,_0x10c1b2;if(_[_0xc2ba('0x9a')](_0x8a3c05[_0xc2ba('0x5c')][_0xc2ba('0x5c')])||_0x8a3c05[_0xc2ba('0x5c')]['body']===''){throw new db['Sequelize'][(_0xc2ba('0x9b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x8a3c05[_0xc2ba('0x5c')]['to'])){throw new db[(_0xc2ba('0x8d'))]['ValidationError'](_0xc2ba('0xbb'));}_0x53b100=_0x8a3c05[_0xc2ba('0x5c')]['to'];return db[_0xc2ba('0x41')][_0xc2ba('0x5a')]({'where':{'id':_0x8a3c05['params']['id']},'include':[{'model':db[_0xc2ba('0xa2')],'as':_0xc2ba('0xbc'),'include':[{'model':db[_0xc2ba('0x8c')],'as':_0xc2ba('0xa3'),'where':{'mobile':_0x53b100},'limit':0x1,'order':[['updatedAt',_0xc2ba('0xbd')]]}]}]})[_0xc2ba('0x1f')](handleEntityNotFound(_0x12359e,null))[_0xc2ba('0x1f')](function(_0x3b72dc){if(_0x3b72dc&&_0x3b72dc['List']){_0x4ac58c=_0x3b72dc[_0xc2ba('0x5e')]({'plain':!![]});if(_0x4ac58c[_0xc2ba('0xbc')]&&_0x4ac58c[_0xc2ba('0xbc')][_0xc2ba('0xa3')][_0xc2ba('0x58')]){return _0x4ac58c[_0xc2ba('0xbc')][_0xc2ba('0xa3')][0x0];}return db[_0xc2ba('0x8c')][_0xc2ba('0x5b')](_['defaults'](_0x8a3c05[_0xc2ba('0x5c')],{'firstName':_0x53b100,'mobile':_0x53b100,'phone':_0x53b100,'ListId':_0x4ac58c[_0xc2ba('0x91')]}));}})[_0xc2ba('0x1f')](handleEntityNotFound(_0x12359e,null))[_0xc2ba('0x1f')](function(_0x20570b){if(_0x20570b){_0x10c1b2=_0x20570b;return db[_0xc2ba('0xa5')]['find']({'where':{'ContactId':_0x10c1b2['id'],'closed':![],'WhatsappAccountId':_0x4ac58c['id']}})[_0xc2ba('0x1f')](function(_0x9d3ede){if(_0x9d3ede){return[_0x9d3ede,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x8a3c05[_0xc2ba('0x5d')]['id'],'ContactId':_0x10c1b2['id'],'WhatsappAccountId':_0x4ac58c['id'],'phone':_0x53b100,'firstMsgDirection':_0xc2ba('0xbe'),'Messages':[_[_0xc2ba('0x4e')](_0x8a3c05['body'],{'read':![],'body':_0x8a3c05['body']['body'],'phone':_0x53b100,'WhatsappAccountId':_0x4ac58c['id'],'UserId':_0x8a3c05[_0xc2ba('0x5d')]['id'],'ContactId':_0x10c1b2['id']})]},{'include':[{'model':db[_0xc2ba('0x88')],'as':_0xc2ba('0xbf')}]})[_0xc2ba('0x1f')](function(_0x4e130f){return[_0x4e130f,!![]];});});}})[_0xc2ba('0x71')](function(_0x2cef47,_0x3d0f64){if(_0x3d0f64){return _0x2cef47;}return db[_0xc2ba('0x88')][_0xc2ba('0x5b')](_[_0xc2ba('0x4e')](_0x8a3c05['body'],{'read':![],'body':_0x8a3c05[_0xc2ba('0x5c')][_0xc2ba('0x5c')],'phone':_0x53b100,'WhatsappAccountId':_0x4ac58c['id'],'WhatsappInteractionId':_0x2cef47['id'],'UserId':_0x8a3c05[_0xc2ba('0x5d')]['id'],'ContactId':_0x10c1b2['id']}))[_0xc2ba('0x1f')](function(_0x4b22e3){_0x2cef47[_0xc2ba('0xc0')][_0xc2ba('0xbf')]=[];_0x2cef47['dataValues'][_0xc2ba('0xbf')][_0xc2ba('0xaa')](_0x4b22e3[_0xc2ba('0xc0')]);return _0x2cef47;});})['then'](respondWithResult(_0x12359e,null))[_0xc2ba('0x29')](handleError(_0x12359e,null));}; \ No newline at end of file +var _0x3955=['Messages','spread','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','client','http','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','WhatsappAccount','includeAll','include','findAll','rows','show','params','keys','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','Transaction','WhatsappApplication','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','twilio','from','From','replace','MessageSid','notifications','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','list','Contacts','defaults','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','entity\x20found','text/xml','to\x20is\x20mandatory','List','DESC'];(function(_0x34ee93,_0x104121){var _0x320308=function(_0x21974c){while(--_0x21974c){_0x34ee93['push'](_0x34ee93['shift']());}};_0x320308(++_0x104121);}(_0x3955,0x17b));var _0x5395=function(_0x3db721,_0x5c945d){_0x3db721=_0x3db721-0x0;var _0x587319=_0x3955[_0x3db721];return _0x587319;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5395('0x0'));var zipdir=require(_0x5395('0x1'));var jsonpatch=require(_0x5395('0x2'));var rp=require(_0x5395('0x3'));var moment=require(_0x5395('0x4'));var BPromise=require(_0x5395('0x5'));var Mustache=require(_0x5395('0x6'));var util=require(_0x5395('0x7'));var path=require('path');var sox=require(_0x5395('0x8'));var csv=require(_0x5395('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5395('0xa'));var _=require(_0x5395('0xb'));var squel=require(_0x5395('0xc'));var crypto=require(_0x5395('0xd'));var jsforce=require(_0x5395('0xe'));var deskjs=require(_0x5395('0xf'));var toCsv=require(_0x5395('0x9'));var querystring=require(_0x5395('0x10'));var Papa=require(_0x5395('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5395('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5395('0x13'));var logger=require(_0x5395('0x14'))(_0x5395('0x15'));var utils=require(_0x5395('0x16'));var config=require(_0x5395('0x17'));var licenseUtil=require(_0x5395('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5395('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5395('0x1a'))(new Redis(config[_0x5395('0x19')]));require('./whatsappAccount.socket')[_0x5395('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5395('0x1c')][_0x5395('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x107818,_0x1e7602,_0x1b7f08,_0x173d04){return new BPromise(function(_0x2e7d1e,_0x582df5){var _0x3e079d=_0x173d04||client;return _0x3e079d['request'](_0x107818,_0x1b7f08)[_0x5395('0x1e')](function(_0x4bbbb8){logger['info'](_0x5395('0x1f'),_0x1e7602,'request\x20sent');logger[_0x5395('0x20')](_0x5395('0x21'),_0x1e7602,_0x5395('0x22'),JSON[_0x5395('0x23')](_0x4bbbb8));if(_0x4bbbb8[_0x5395('0x24')]){if(_0x4bbbb8[_0x5395('0x24')]['code']===0x1f4){logger[_0x5395('0x24')](_0x5395('0x1f'),_0x1e7602,_0x4bbbb8[_0x5395('0x24')]['message']);return _0x582df5(_0x4bbbb8[_0x5395('0x24')][_0x5395('0x25')]);}logger['error'](_0x5395('0x1f'),_0x1e7602,_0x4bbbb8[_0x5395('0x24')][_0x5395('0x25')]);return _0x2e7d1e(_0x4bbbb8[_0x5395('0x24')][_0x5395('0x25')]);}else{logger[_0x5395('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x1e7602,_0x5395('0x22'));_0x2e7d1e(_0x4bbbb8[_0x5395('0x27')][_0x5395('0x25')]);}})[_0x5395('0x28')](function(_0x3288e8){logger[_0x5395('0x24')](_0x5395('0x1f'),_0x1e7602,_0x3288e8);_0x582df5(_0x3288e8);});});}function respondWithStatusCode(_0x113aa3,_0x41c3ca){_0x41c3ca=_0x41c3ca||0xcc;return function(_0x59e965){if(_0x59e965){return _0x113aa3[_0x5395('0x29')](_0x41c3ca);}return _0x113aa3[_0x5395('0x2a')](_0x41c3ca)[_0x5395('0x2b')]();};}function respondWithResult(_0x4ae127,_0x15e5ea){_0x15e5ea=_0x15e5ea||0xc8;return function(_0x133157){if(_0x133157){return _0x4ae127[_0x5395('0x2a')](_0x15e5ea)[_0x5395('0x2c')](_0x133157);}};}function respondWithFilteredResult(_0x412b1a,_0xf37df4){return function(_0x44bb72){if(_0x44bb72){var _0x50b3bd=typeof _0xf37df4[_0x5395('0x2d')]==='undefined'&&typeof _0xf37df4[_0x5395('0x2e')]==='undefined';var _0x51ada1=_0x44bb72[_0x5395('0x2f')];var _0x4820a0=_0x50b3bd?0x0:_0xf37df4[_0x5395('0x2d')];var _0x2fbf82=_0x50b3bd?_0x44bb72['count']:_0xf37df4['offset']+_0xf37df4[_0x5395('0x2e')];var _0x2e9a1b;if(_0x2fbf82>=_0x51ada1){_0x2fbf82=_0x51ada1;_0x2e9a1b=0xc8;}else{_0x2e9a1b=0xce;}_0x412b1a[_0x5395('0x2a')](_0x2e9a1b);return _0x412b1a[_0x5395('0x30')](_0x5395('0x31'),_0x4820a0+'-'+_0x2fbf82+'/'+_0x51ada1)[_0x5395('0x2c')](_0x44bb72);}return null;};}function patchUpdates(_0x523ee1){return function(_0x2f460f){try{jsonpatch['apply'](_0x2f460f,_0x523ee1,!![]);}catch(_0x31b54f){return BPromise[_0x5395('0x32')](_0x31b54f);}return _0x2f460f[_0x5395('0x33')]();};}function saveUpdates(_0x573734,_0x29b913){return function(_0x365295){if(_0x365295){return _0x365295[_0x5395('0x34')](_0x573734)[_0x5395('0x1e')](function(_0x40e642){return _0x40e642;});}return null;};}function removeEntity(_0x3a5b53,_0x13d20d){return function(_0x12225c){if(_0x12225c){return _0x12225c[_0x5395('0x35')]()[_0x5395('0x1e')](function(){var _0x5ea281=_0x12225c['get']({'plain':!![]});var _0x5afa56='WhatsappAccounts';return db[_0x5395('0x36')][_0x5395('0x35')]({'where':{'type':_0x5afa56,'resourceId':_0x5ea281['id']}})[_0x5395('0x1e')](function(){return _0x12225c;});})[_0x5395('0x1e')](function(){_0x3a5b53['status'](0xcc)[_0x5395('0x2b')]();});}};}function handleEntityNotFound(_0x2e6c15,_0x337697){return function(_0x158d64){if(!_0x158d64){_0x2e6c15[_0x5395('0x29')](0x194);}return _0x158d64;};}function handleError(_0x52abda,_0x4bb49c){_0x4bb49c=_0x4bb49c||0x1f4;return function(_0x16be5c){logger[_0x5395('0x24')](_0x16be5c[_0x5395('0x37')]);if(_0x16be5c[_0x5395('0x38')]){delete _0x16be5c[_0x5395('0x38')];}_0x52abda[_0x5395('0x2a')](_0x4bb49c)[_0x5395('0x39')](_0x16be5c);};}exports[_0x5395('0x3a')]=function(_0xa5abf2,_0x1d78c9){var _0x5c1d3e={'include':[{'model':db[_0x5395('0x3b')],'as':_0x5395('0x3c')}]},_0x49d239={},_0xc021fc={'count':0x0,'rows':[]};var _0x586065=_['map'](db['WhatsappAccount'][_0x5395('0x3d')],function(_0x5c2130){return{'name':_0x5c2130[_0x5395('0x3e')],'type':_0x5c2130[_0x5395('0x3f')][_0x5395('0x40')]};});_0x49d239[_0x5395('0x41')]=_['map'](_0x586065,_0x5395('0x38'));_0x49d239[_0x5395('0x42')]=_['keys'](_0xa5abf2[_0x5395('0x42')]);_0x49d239[_0x5395('0x43')]=_[_0x5395('0x44')](_0x49d239[_0x5395('0x41')],_0x49d239[_0x5395('0x42')]);_0x5c1d3e[_0x5395('0x45')]=_[_0x5395('0x44')](_0x49d239['model'],qs[_0x5395('0x46')](_0xa5abf2[_0x5395('0x42')][_0x5395('0x46')]));_0x5c1d3e['attributes']=_0x5c1d3e[_0x5395('0x45')][_0x5395('0x47')]?_0x5c1d3e['attributes']:_0x49d239['model'];if(!_0xa5abf2[_0x5395('0x42')][_0x5395('0x48')]('nolimit')){_0x5c1d3e[_0x5395('0x2e')]=qs['limit'](_0xa5abf2[_0x5395('0x42')][_0x5395('0x2e')]);_0x5c1d3e['offset']=qs[_0x5395('0x2d')](_0xa5abf2['query']['offset']);}_0x5c1d3e[_0x5395('0x49')]=qs[_0x5395('0x4a')](_0xa5abf2[_0x5395('0x42')][_0x5395('0x4a')]);_0x5c1d3e[_0x5395('0x4b')]=qs['filters'](_[_0x5395('0x4c')](_0xa5abf2[_0x5395('0x42')],_0x49d239[_0x5395('0x43')]),_0x586065);if(_0xa5abf2['query'][_0x5395('0x4d')]){_0x5c1d3e[_0x5395('0x4b')]=_[_0x5395('0x4e')](_0x5c1d3e[_0x5395('0x4b')],{'$or':_[_0x5395('0x4f')](_0x586065,function(_0xf63dcf){if(_0xf63dcf[_0x5395('0x3f')]!=='VIRTUAL'){var _0x399239={};_0x399239[_0xf63dcf[_0x5395('0x38')]]={'$like':'%'+_0xa5abf2[_0x5395('0x42')][_0x5395('0x4d')]+'%'};return _0x399239;}})});}_0x5c1d3e=_['merge']({},_0x5c1d3e,_0xa5abf2[_0x5395('0x50')]);var _0x320a11={'where':_0x5c1d3e[_0x5395('0x4b')]};return db[_0x5395('0x51')][_0x5395('0x2f')](_0x320a11)[_0x5395('0x1e')](function(_0x30efc2){_0xc021fc[_0x5395('0x2f')]=_0x30efc2;if(_0xa5abf2[_0x5395('0x42')][_0x5395('0x52')]){_0x5c1d3e[_0x5395('0x53')]=[{'all':!![]}];}return db[_0x5395('0x51')][_0x5395('0x54')](_0x5c1d3e);})[_0x5395('0x1e')](function(_0x5f3d45){_0xc021fc[_0x5395('0x55')]=_0x5f3d45;return _0xc021fc;})[_0x5395('0x1e')](respondWithFilteredResult(_0x1d78c9,_0x5c1d3e))[_0x5395('0x28')](handleError(_0x1d78c9,null));};exports[_0x5395('0x56')]=function(_0x1face1,_0x19931c){var _0x5c5b60={'raw':![],'where':{'id':_0x1face1[_0x5395('0x57')]['id']},'include':[{'model':db[_0x5395('0x3b')],'as':_0x5395('0x3c')}]},_0x1fb9b0={};_0x1fb9b0[_0x5395('0x41')]=_[_0x5395('0x58')](db[_0x5395('0x51')][_0x5395('0x3d')]);_0x1fb9b0[_0x5395('0x42')]=_[_0x5395('0x58')](_0x1face1[_0x5395('0x42')]);_0x1fb9b0[_0x5395('0x43')]=_[_0x5395('0x44')](_0x1fb9b0['model'],_0x1fb9b0['query']);_0x5c5b60['attributes']=_[_0x5395('0x44')](_0x1fb9b0[_0x5395('0x41')],qs[_0x5395('0x46')](_0x1face1[_0x5395('0x42')][_0x5395('0x46')]));_0x5c5b60[_0x5395('0x45')]=_0x5c5b60[_0x5395('0x45')][_0x5395('0x47')]?_0x5c5b60[_0x5395('0x45')]:_0x1fb9b0['model'];if(_0x1face1[_0x5395('0x42')][_0x5395('0x52')]){_0x5c5b60[_0x5395('0x53')]=[{'all':!![]}];}_0x5c5b60=_[_0x5395('0x4e')]({},_0x5c5b60,_0x1face1['options']);return db['WhatsappAccount'][_0x5395('0x59')](_0x5c5b60)[_0x5395('0x1e')](handleEntityNotFound(_0x19931c,null))[_0x5395('0x1e')](respondWithResult(_0x19931c,null))['catch'](handleError(_0x19931c,null));};exports['create']=function(_0x37cbc2,_0xbc38f3){return db[_0x5395('0x51')]['create'](_0x37cbc2[_0x5395('0x5a')],{})[_0x5395('0x1e')](function(_0xdf2b4){var _0x99a055=_0x37cbc2[_0x5395('0x5b')][_0x5395('0x5c')]({'plain':!![]});if(!_0x99a055)throw new Error(_0x5395('0x5d'));if(_0x99a055[_0x5395('0x5e')]===_0x5395('0x5b')){var _0x61bf46=_0xdf2b4['get']({'plain':!![]});var _0x5a086b='WhatsappAccounts';return db[_0x5395('0x5f')][_0x5395('0x59')]({'where':{'name':_0x5a086b,'userProfileId':_0x99a055[_0x5395('0x60')]},'raw':!![]})[_0x5395('0x1e')](function(_0x307599){if(_0x307599&&_0x307599[_0x5395('0x61')]===0x0){return db[_0x5395('0x36')][_0x5395('0x62')]({'name':_0x61bf46['name'],'resourceId':_0x61bf46['id'],'type':_0x307599[_0x5395('0x38')],'sectionId':_0x307599['id']},{})[_0x5395('0x1e')](function(){return _0xdf2b4;});}else{return _0xdf2b4;}})[_0x5395('0x28')](function(_0x1fdd44){logger['error'](_0x5395('0x63'),_0x1fdd44);throw _0x1fdd44;});}return _0xdf2b4;})[_0x5395('0x1e')](respondWithResult(_0xbc38f3,0xc9))[_0x5395('0x28')](handleError(_0xbc38f3,null));};exports[_0x5395('0x34')]=function(_0x9e8210,_0xd32673){if(_0x9e8210[_0x5395('0x5a')]['id']){delete _0x9e8210['body']['id'];}return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x9e8210[_0x5395('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5395('0x1e')](handleEntityNotFound(_0xd32673,null))['then'](saveUpdates(_0x9e8210[_0x5395('0x5a')],null))['then'](respondWithResult(_0xd32673,null))[_0x5395('0x28')](handleError(_0xd32673,null));};exports['destroy']=function(_0x30e4a5,_0x36983a){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x30e4a5[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x36983a,null))['then'](removeEntity(_0x36983a,null))['catch'](handleError(_0x36983a,null));};exports[_0x5395('0x64')]=function(_0x1de0c6,_0x51506d){return db['WhatsappAccount']['describe']()[_0x5395('0x1e')](respondWithResult(_0x51506d,null))[_0x5395('0x28')](handleError(_0x51506d,null));};exports[_0x5395('0x65')]=function(_0x3b26aa,_0x210bb8,_0x5e6d73){if(_0x3b26aa[_0x5395('0x5a')]['id']){delete _0x3b26aa[_0x5395('0x5a')]['id'];}return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x3b26aa[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x210bb8,null))[_0x5395('0x1e')](function(_0x29e5d5){if(_0x29e5d5){_0x3b26aa[_0x5395('0x5a')][_0x5395('0x66')]=_0x29e5d5['id'];return db[_0x5395('0x67')]['create'](_0x3b26aa[_0x5395('0x5a')]);}})['then'](respondWithResult(_0x210bb8,null))[_0x5395('0x28')](handleError(_0x210bb8,null));};exports[_0x5395('0x68')]=function(_0x2eac51,_0xc2bc68,_0x41fc16){var _0x381e5c={'raw':![],'where':{}};var _0x3ef5da={};var _0x207e0a={'count':0x0,'rows':[]};return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0x2eac51[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0xc2bc68,null))[_0x5395('0x1e')](function(_0x34aae9){if(_0x34aae9){_0x3ef5da[_0x5395('0x41')]=_['keys'](db[_0x5395('0x67')][_0x5395('0x3d')]);_0x3ef5da['query']=_[_0x5395('0x58')](_0x2eac51[_0x5395('0x42')]);_0x3ef5da[_0x5395('0x43')]=_[_0x5395('0x44')](_0x3ef5da[_0x5395('0x41')],_0x3ef5da[_0x5395('0x42')]);_0x381e5c[_0x5395('0x45')]=_[_0x5395('0x44')](_0x3ef5da['model'],qs['fields'](_0x2eac51[_0x5395('0x42')][_0x5395('0x46')]));_0x381e5c[_0x5395('0x45')]=_0x381e5c[_0x5395('0x45')]['length']?_0x381e5c['attributes']:_0x3ef5da[_0x5395('0x41')];if(!_0x2eac51[_0x5395('0x42')][_0x5395('0x48')](_0x5395('0x6a'))){_0x381e5c[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x2eac51['query'][_0x5395('0x2e')]);_0x381e5c['offset']=qs[_0x5395('0x2d')](_0x2eac51['query']['offset']);}_0x381e5c[_0x5395('0x49')]=qs[_0x5395('0x4a')](_0x2eac51[_0x5395('0x42')][_0x5395('0x4a')]);_0x381e5c[_0x5395('0x4b')]=qs[_0x5395('0x43')](_[_0x5395('0x4c')](_0x2eac51[_0x5395('0x42')],_0x3ef5da[_0x5395('0x43')]));_0x381e5c['where'][_0x5395('0x66')]=_0x34aae9['id'];if(_0x2eac51[_0x5395('0x42')][_0x5395('0x4d')]){_0x381e5c[_0x5395('0x4b')]=_[_0x5395('0x4e')](_0x381e5c[_0x5395('0x4b')],{'$or':_[_0x5395('0x4f')](_0x381e5c[_0x5395('0x45')],function(_0x4745c6){var _0x19d22c={};_0x19d22c[_0x4745c6]={'$like':'%'+_0x2eac51['query'][_0x5395('0x4d')]+'%'};return _0x19d22c;})});}_0x381e5c=_[_0x5395('0x4e')]({},_0x381e5c,_0x2eac51['options']);return db['Disposition']['count']({'where':_0x381e5c[_0x5395('0x4b')]})[_0x5395('0x1e')](function(_0x3b9831){_0x207e0a[_0x5395('0x2f')]=_0x3b9831;if(_0x2eac51[_0x5395('0x42')][_0x5395('0x52')]){_0x381e5c[_0x5395('0x53')]=[{'all':!![]}];}return db[_0x5395('0x67')][_0x5395('0x54')](_0x381e5c);})['then'](function(_0x11351e){_0x207e0a[_0x5395('0x55')]=_0x11351e;return _0x207e0a;});}})[_0x5395('0x1e')](respondWithFilteredResult(_0xc2bc68,_0x381e5c))[_0x5395('0x28')](handleError(_0xc2bc68,null));};exports[_0x5395('0x6b')]=function(_0xdf7455,_0x3f2b29,_0x21620c){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0xdf7455[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x3f2b29,null))[_0x5395('0x1e')](function(_0x3abccd){if(_0x3abccd){return _0x3abccd[_0x5395('0x6b')](_0xdf7455[_0x5395('0x42')][_0x5395('0x6c')]);}})['then'](respondWithStatusCode(_0x3f2b29,null))['catch'](handleError(_0x3f2b29,null));};exports[_0x5395('0x6d')]=function(_0x100ea8,_0x5ae462,_0x48fccf){if(_0x100ea8[_0x5395('0x5a')]['id']){delete _0x100ea8['body']['id'];}return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x100ea8[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x5ae462,null))[_0x5395('0x1e')](function(_0x364649){if(_0x364649){_0x100ea8['body'][_0x5395('0x66')]=_0x364649['id'];return db[_0x5395('0x6e')][_0x5395('0x62')](_0x100ea8[_0x5395('0x5a')]);}})[_0x5395('0x1e')](respondWithResult(_0x5ae462,null))[_0x5395('0x28')](handleError(_0x5ae462,null));};exports['getAnswers']=function(_0x4a2706,_0x383faa,_0x3e5e88){var _0x49b9a9={'raw':![],'where':{}};var _0x46d21a={};var _0x2e0bda={'count':0x0,'rows':[]};return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0x4a2706[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x383faa,null))[_0x5395('0x1e')](function(_0x447618){if(_0x447618){_0x46d21a['model']=_[_0x5395('0x58')](db[_0x5395('0x6e')]['rawAttributes']);_0x46d21a[_0x5395('0x42')]=_['keys'](_0x4a2706[_0x5395('0x42')]);_0x46d21a[_0x5395('0x43')]=_['intersection'](_0x46d21a[_0x5395('0x41')],_0x46d21a['query']);_0x49b9a9[_0x5395('0x45')]=_['intersection'](_0x46d21a[_0x5395('0x41')],qs['fields'](_0x4a2706[_0x5395('0x42')][_0x5395('0x46')]));_0x49b9a9[_0x5395('0x45')]=_0x49b9a9[_0x5395('0x45')][_0x5395('0x47')]?_0x49b9a9['attributes']:_0x46d21a[_0x5395('0x41')];if(!_0x4a2706[_0x5395('0x42')][_0x5395('0x48')](_0x5395('0x6a'))){_0x49b9a9[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x4a2706[_0x5395('0x42')][_0x5395('0x2e')]);_0x49b9a9[_0x5395('0x2d')]=qs[_0x5395('0x2d')](_0x4a2706[_0x5395('0x42')][_0x5395('0x2d')]);}_0x49b9a9[_0x5395('0x49')]=qs['sort'](_0x4a2706['query'][_0x5395('0x4a')]);_0x49b9a9[_0x5395('0x4b')]=qs[_0x5395('0x43')](_[_0x5395('0x4c')](_0x4a2706[_0x5395('0x42')],_0x46d21a[_0x5395('0x43')]));_0x49b9a9['where'][_0x5395('0x66')]=_0x447618['id'];if(_0x4a2706[_0x5395('0x42')]['filter']){_0x49b9a9[_0x5395('0x4b')]=_[_0x5395('0x4e')](_0x49b9a9['where'],{'$or':_[_0x5395('0x4f')](_0x49b9a9[_0x5395('0x45')],function(_0x3feb8f){var _0x1233ea={};_0x1233ea[_0x3feb8f]={'$like':'%'+_0x4a2706['query'][_0x5395('0x4d')]+'%'};return _0x1233ea;})});}_0x49b9a9=_[_0x5395('0x4e')]({},_0x49b9a9,_0x4a2706[_0x5395('0x50')]);return db[_0x5395('0x6e')][_0x5395('0x2f')]({'where':_0x49b9a9[_0x5395('0x4b')]})['then'](function(_0x24659d){_0x2e0bda[_0x5395('0x2f')]=_0x24659d;if(_0x4a2706[_0x5395('0x42')][_0x5395('0x52')]){_0x49b9a9[_0x5395('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5395('0x54')](_0x49b9a9);})[_0x5395('0x1e')](function(_0x4578f5){_0x2e0bda[_0x5395('0x55')]=_0x4578f5;return _0x2e0bda;});}})[_0x5395('0x1e')](respondWithFilteredResult(_0x383faa,_0x49b9a9))[_0x5395('0x28')](handleError(_0x383faa,null));};exports['removeAnswers']=function(_0x47c54b,_0x161eb7,_0x45e639){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x47c54b[_0x5395('0x57')]['id']}})['then'](handleEntityNotFound(_0x161eb7,null))[_0x5395('0x1e')](function(_0x3f7d4d){if(_0x3f7d4d){return _0x3f7d4d[_0x5395('0x6f')](_0x47c54b[_0x5395('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x161eb7,null))[_0x5395('0x28')](handleError(_0x161eb7,null));};exports['addAgents']=function(_0x3340b2,_0x42da35,_0x51bad8){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x3340b2[_0x5395('0x57')]['id']}})['then'](handleEntityNotFound(_0x42da35,null))[_0x5395('0x1e')](function(_0x3d4dfc){if(_0x3d4dfc){return _0x3d4dfc[_0x5395('0x70')](_0x3340b2[_0x5395('0x5a')][_0x5395('0x6c')],_[_0x5395('0x71')](_0x3340b2[_0x5395('0x5a')],['ids','id'])||{})['spread'](function(_0x5cc967){for(var _0x5cdfa2=0x0;_0x5cdfa2<_0x3340b2[_0x5395('0x5a')][_0x5395('0x6c')][_0x5395('0x47')];_0x5cdfa2+=0x1){socket[_0x5395('0x72')](_0x5395('0x73'),{'UserId':Number(_0x3340b2[_0x5395('0x5a')][_0x5395('0x6c')][_0x5cdfa2]),'WhatsappAccountId':Number(_0x3340b2[_0x5395('0x57')]['id'])});}return _0x5cc967;});}})['then'](respondWithResult(_0x42da35,null))[_0x5395('0x28')](handleError(_0x42da35,null));};exports['removeAgents']=function(_0x136e03,_0x41ad63,_0xd26b3e){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x136e03['params']['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x41ad63,null))[_0x5395('0x1e')](function(_0x1aa578){if(_0x1aa578){return _0x1aa578['removeAgents'](_0x136e03['query'][_0x5395('0x6c')])['then'](function(){if(_[_0x5395('0x74')](_0x136e03[_0x5395('0x42')]['ids'])){for(var _0x3e66d3=0x0;_0x3e66d3<_0x136e03[_0x5395('0x42')]['ids']['length'];_0x3e66d3+=0x1){socket['emit'](_0x5395('0x75'),{'UserId':Number(_0x136e03[_0x5395('0x42')][_0x5395('0x6c')][_0x3e66d3]),'WhatsappAccountId':Number(_0x136e03['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x136e03[_0x5395('0x42')][_0x5395('0x6c')]),'WhatsappAccountId':Number(_0x136e03[_0x5395('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x41ad63,null))[_0x5395('0x28')](handleError(_0x41ad63,null));};exports[_0x5395('0x76')]=function(_0x5a827a,_0x50df82,_0x1e8a03){var _0x3b87b1={};var _0x71cf64={};var _0x56c905;var _0x54e066;return db['WhatsappAccount'][_0x5395('0x69')]({'where':{'id':_0x5a827a[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x50df82,null))[_0x5395('0x1e')](function(_0x64ea11){if(_0x64ea11){_0x56c905=_0x64ea11;_0x71cf64[_0x5395('0x41')]=_[_0x5395('0x58')](db[_0x5395('0x77')][_0x5395('0x3d')]);_0x71cf64[_0x5395('0x42')]=_[_0x5395('0x58')](_0x5a827a[_0x5395('0x42')]);_0x71cf64[_0x5395('0x43')]=_['intersection'](_0x71cf64['model'],_0x71cf64[_0x5395('0x42')]);_0x3b87b1['attributes']=_[_0x5395('0x44')](_0x71cf64['model'],qs[_0x5395('0x46')](_0x5a827a[_0x5395('0x42')]['fields']));_0x3b87b1[_0x5395('0x45')]=_0x3b87b1[_0x5395('0x45')][_0x5395('0x47')]?_0x3b87b1[_0x5395('0x45')]:_0x71cf64['model'];_0x3b87b1['order']=qs['sort'](_0x5a827a[_0x5395('0x42')][_0x5395('0x4a')]);_0x3b87b1[_0x5395('0x4b')]=qs[_0x5395('0x43')](_[_0x5395('0x4c')](_0x5a827a[_0x5395('0x42')],_0x71cf64[_0x5395('0x43')]));if(_0x5a827a[_0x5395('0x42')][_0x5395('0x4d')]){_0x3b87b1['where']=_[_0x5395('0x4e')](_0x3b87b1['where'],{'$or':_[_0x5395('0x4f')](_0x3b87b1[_0x5395('0x45')],function(_0x18dafc){var _0x17569e={};_0x17569e[_0x18dafc]={'$like':'%'+_0x5a827a[_0x5395('0x42')]['filter']+'%'};return _0x17569e;})});}_0x3b87b1=_['merge']({},_0x3b87b1,_0x5a827a[_0x5395('0x50')]);return _0x56c905[_0x5395('0x76')](_0x3b87b1);}})['then'](function(_0x2e32d2){if(_0x2e32d2){_0x54e066=_0x2e32d2['length'];if(!_0x5a827a[_0x5395('0x42')]['hasOwnProperty'](_0x5395('0x6a'))){_0x3b87b1[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x5a827a['query'][_0x5395('0x2e')]);_0x3b87b1['offset']=qs[_0x5395('0x2d')](_0x5a827a['query'][_0x5395('0x2d')]);}return _0x56c905[_0x5395('0x76')](_0x3b87b1);}})[_0x5395('0x1e')](function(_0x3c77a9){if(_0x3c77a9){return _0x3c77a9?{'count':_0x54e066,'rows':_0x3c77a9}:null;}})[_0x5395('0x1e')](respondWithResult(_0x50df82,null))[_0x5395('0x28')](handleError(_0x50df82,null));};exports[_0x5395('0x78')]=function(_0x5cb4a8,_0x1f9f61){var _0x551e89=_0x5cb4a8['params']['id'];var _0x3dc5c5=_0x5cb4a8[_0x5395('0x5a')];var _0x1e9fc3=0xc8;var _0x22f0fb=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x5395('0x79')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3e6f53){return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0x551e89},'transaction':_0x3e6f53})[_0x5395('0x1e')](function(_0x1e7330){if(_0x1e7330){return db[_0x5395('0x7a')][_0x5395('0x35')]({'where':{'WhatsappAccountId':_0x551e89},'transaction':_0x3e6f53})[_0x5395('0x1e')](function(){var _0x407505=_[_0x5395('0x4f')](_0x3dc5c5,function(_0x1dd1be){_0x1dd1be[_0x5395('0x66')]=_0x551e89;return _0x1dd1be;});return db['WhatsappApplication']['bulkCreate'](_0x407505,{'transaction':_0x3e6f53});});}else{_0x1e9fc3=0x194;_0x22f0fb=[];}});})[_0x5395('0x1e')](function(){if(_0x1e9fc3!==0x194){return db[_0x5395('0x7a')][_0x5395('0x7b')]({'where':{'WhatsappAccountId':_0x551e89},'order':'priority'})['then'](function(_0x398447){_0x22f0fb=_0x398447;});}})[_0x5395('0x28')](function(_0x1231c2){_0x1e9fc3=0x1f4;logger[_0x5395('0x24')](_0x1231c2[_0x5395('0x37')]);if(_0x1231c2[_0x5395('0x38')]){delete _0x1231c2['name'];}_0x22f0fb=_0x1231c2;})[_0x5395('0x7c')](function(){if(_0x22f0fb===null){_0x1f9f61[_0x5395('0x29')](_0x1e9fc3);}else{if(_0x1e9fc3===0x1f4){_0x1f9f61[_0x5395('0x2a')](_0x1e9fc3)[_0x5395('0x39')](_0x22f0fb);}else{_0x1f9f61[_0x5395('0x2a')](_0x1e9fc3)[_0x5395('0x2c')](_0x22f0fb);}}});};exports[_0x5395('0x7d')]=function(_0xfc362b,_0x12f904,_0x154430){var _0x4c07ec={};var _0x362b42={};var _0x52793d;var _0x1c5f12;return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0xfc362b[_0x5395('0x57')]['id']}})['then'](handleEntityNotFound(_0x12f904,null))['then'](function(_0x2fa7f3){if(_0x2fa7f3){_0x52793d=_0x2fa7f3;_0x362b42[_0x5395('0x41')]=_[_0x5395('0x58')](db[_0x5395('0x7a')][_0x5395('0x3d')]);_0x362b42[_0x5395('0x42')]=_[_0x5395('0x58')](_0xfc362b[_0x5395('0x42')]);_0x362b42['filters']=_[_0x5395('0x44')](_0x362b42[_0x5395('0x41')],_0x362b42[_0x5395('0x42')]);_0x4c07ec[_0x5395('0x45')]=_[_0x5395('0x44')](_0x362b42[_0x5395('0x41')],qs[_0x5395('0x46')](_0xfc362b[_0x5395('0x42')]['fields']));_0x4c07ec[_0x5395('0x45')]=_0x4c07ec[_0x5395('0x45')][_0x5395('0x47')]?_0x4c07ec[_0x5395('0x45')]:_0x362b42[_0x5395('0x41')];_0x4c07ec[_0x5395('0x49')]=qs['sort'](_0xfc362b[_0x5395('0x42')][_0x5395('0x4a')]);_0x4c07ec[_0x5395('0x4b')]=qs['filters'](_[_0x5395('0x4c')](_0xfc362b[_0x5395('0x42')],_0x362b42[_0x5395('0x43')]));if(_0xfc362b[_0x5395('0x42')][_0x5395('0x4d')]){_0x4c07ec['where']=_['merge'](_0x4c07ec[_0x5395('0x4b')],{'$or':_['map'](_0x4c07ec[_0x5395('0x45')],function(_0x28f3c8){var _0x1ad7f1={};_0x1ad7f1[_0x28f3c8]={'$like':'%'+_0xfc362b[_0x5395('0x42')]['filter']+'%'};return _0x1ad7f1;})});}_0x4c07ec=_[_0x5395('0x4e')]({},_0x4c07ec,_0xfc362b[_0x5395('0x50')]);return _0x52793d[_0x5395('0x7d')](_0x4c07ec);}})[_0x5395('0x1e')](function(_0x3948f1){if(_0x3948f1){_0x1c5f12=_0x3948f1['length'];if(!_0xfc362b[_0x5395('0x42')][_0x5395('0x48')](_0x5395('0x6a'))){_0x4c07ec['limit']=qs['limit'](_0xfc362b[_0x5395('0x42')][_0x5395('0x2e')]);_0x4c07ec['offset']=qs[_0x5395('0x2d')](_0xfc362b['query'][_0x5395('0x2d')]);}return _0x52793d[_0x5395('0x7d')](_0x4c07ec);}})[_0x5395('0x1e')](function(_0x414fa7){if(_0x414fa7){return _0x414fa7?{'count':_0x1c5f12,'rows':_0x414fa7}:null;}})[_0x5395('0x1e')](respondWithResult(_0x12f904,null))[_0x5395('0x28')](handleError(_0x12f904,null));};exports[_0x5395('0x7e')]=function(_0x196483,_0x1b1a73,_0x565492){var _0x43ccd9={'channel':_0x5395('0x7f')};var _0x3ae910=[];var _0x48c89f=[];var _0x10824f={};return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x196483[_0x5395('0x57')]['id']},'include':[{'model':db[_0x5395('0x7a')],'as':_0x5395('0x80')}]})[_0x5395('0x1e')](handleEntityNotFound(_0x1b1a73,null))[_0x5395('0x1e')](function(_0x42a6e7){_0x43ccd9['account']=_0x42a6e7;if(_0x43ccd9[_0x5395('0x81')]&&_0x43ccd9[_0x5395('0x81')][_0x5395('0x3f')]===_0x5395('0x82')&&_0x196483[_0x5395('0x5a')][_0x5395('0x83')]){if(_0x196483['body']['statuses'][_0x5395('0x47')]===0x0)return;if(_0x196483[_0x5395('0x5a')][_0x5395('0x83')][0x0]['state']!==_0x5395('0x84'))return;return db[_0x5395('0x85')][_0x5395('0x34')]({'read':!![],'readAt':_0x196483[_0x5395('0x5a')]['statuses'][0x0][_0x5395('0x86')]},{'where':{'messageId':_0x196483[_0x5395('0x5a')][_0x5395('0x83')][0x0][_0x5395('0x87')]},'individualHooks':!![]})[_0x5395('0x1e')](function(_0x3bbbaf){return _0x1b1a73[_0x5395('0x2a')](0xc8)['json'](_0x3bbbaf);});}_0x43ccd9[_0x5395('0x88')]=_[_0x5395('0x89')](_0x42a6e7['Applications'],[_0x5395('0x8a')],[_0x5395('0x8b')]);if(_0x43ccd9[_0x5395('0x81')][_0x5395('0x80')]){delete _0x43ccd9[_0x5395('0x81')][_0x5395('0x80')];}return db[_0x5395('0x8c')]['describe']()[_0x5395('0x1e')](function(_0x428796){if(!_0x428796){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x8f'));}_0x3ae910=_[_0x5395('0x90')](_[_0x5395('0x58')](_0x428796),[_0x5395('0x91'),_0x5395('0x92')]);_0x48c89f=_[_0x5395('0x90')](_[_0x5395('0x58')](_0x428796),[_0x5395('0x91'),_0x5395('0x92'),'CompanyId','ListId']);_0x43ccd9['body']={'mapKey':'mobile'};if(_0x43ccd9[_0x5395('0x81')]&&_0x43ccd9[_0x5395('0x81')][_0x5395('0x3f')]===_0x5395('0x93')){_0x43ccd9[_0x5395('0x5a')][_0x5395('0x94')]=_0x196483[_0x5395('0x5a')][_0x5395('0x95')][_0x5395('0x96')]('whatsapp:','');_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')]=_0x196483[_0x5395('0x5a')]['Body'];_0x43ccd9[_0x5395('0x5a')]['messageId']=_0x196483[_0x5395('0x5a')][_0x5395('0x97')];}if(_0x43ccd9[_0x5395('0x81')]&&_0x43ccd9['account']['type']==='sinch'){_0x43ccd9['body'][_0x5395('0x94')]=_0x196483[_0x5395('0x5a')][_0x5395('0x98')][0x0][_0x5395('0x94')];_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')]=_0x196483[_0x5395('0x5a')][_0x5395('0x98')][0x0][_0x5395('0x25')][_0x5395('0x5a')];_0x43ccd9[_0x5395('0x5a')][_0x5395('0x99')]=_0x196483[_0x5395('0x5a')][_0x5395('0x98')][0x0][_0x5395('0x87')];}if(_0x43ccd9[_0x5395('0x5a')]['id']){delete _0x43ccd9[_0x5395('0x5a')]['id'];}if(_['isNil'](_0x43ccd9[_0x5395('0x5a')][_0x5395('0x94')])){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9a'));}if(_[_0x5395('0x9b')](_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')])||_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')]===''){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9c'));}if(_[_0x5395('0x9b')](_0x43ccd9[_0x5395('0x5a')]['mapKey'])){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9d')+_0x48c89f);}if(!_[_0x5395('0x9e')](_0x48c89f,_0x43ccd9['body']['mapKey'])){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9f')+_0x48c89f);}_0x10824f[_0x43ccd9['body'][_0x5395('0xa0')]]=_0x43ccd9[_0x5395('0x5a')]['from'];return db[_0x5395('0xa1')][_0x5395('0x59')]({'where':{'id':_0x43ccd9[_0x5395('0x81')][_0x5395('0xa2')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x10824f,'limit':0x1,'order':[[_0x5395('0x92'),'DESC']]}]});})[_0x5395('0x1e')](handleEntityNotFound(_0x1b1a73,null))['then'](function(_0x568c6f){if(_0x568c6f){_0x43ccd9[_0x5395('0xa3')]=_[_0x5395('0x71')](_0x568c6f,['Contacts']);if(_0x568c6f[_0x5395('0xa4')][_0x5395('0x47')]){return _0x568c6f[_0x5395('0xa4')][0x0];}var _0x16d926=_[_0x5395('0xa5')](_0x43ccd9[_0x5395('0x5a')],{'firstName':_0x43ccd9['body'][_0x5395('0x94')],'ListId':_0x568c6f['id']});_0x16d926[_0x43ccd9['body'][_0x5395('0xa0')]]=_0x43ccd9[_0x5395('0x5a')][_0x5395('0x94')];return db['CmContact'][_0x5395('0x62')](_0x16d926,{'fields':_0x3ae910,'raw':!![]});}})[_0x5395('0x1e')](handleEntityNotFound(_0x1b1a73,null))[_0x5395('0x1e')](function(_0x50cada){if(_0x50cada){_0x43ccd9[_0x5395('0xa6')]=_0x50cada;var _0xe63483={'ContactId':_0x50cada['id'],'phone':_0x43ccd9['body'][_0x5395('0x94')],'WhatsappAccountId':_0x196483[_0x5395('0x57')]['id']};var _0x593daf={'ContactId':_0x50cada['id'],'WhatsappAccountId':_0x196483['params']['id'],'closed':![]};return db[_0x5395('0xa7')][_0x5395('0x59')]({'where':_0x593daf})[_0x5395('0x1e')](function(_0x4e2191){if(_0x4e2191){return[_0x4e2191,![]];}return db['WhatsappInteraction']['create'](_0xe63483)[_0x5395('0x1e')](function(_0x71cab5){return[_0x71cab5,!![]];});});}})['spread'](function(_0x39e0d9,_0x591f98){_0x43ccd9[_0x5395('0xa8')]=_0x39e0d9[_0x5395('0x5c')]({'plain':!![]});_0x43ccd9[_0x5395('0xa8')][_0x5395('0xa9')]=![];if(_0x591f98){if(_0x43ccd9[_0x5395('0x81')]['autoclose']){_0x43ccd9[_0x5395('0x88')][_0x5395('0xaa')]({'id':0x0,'priority':_0x43ccd9[_0x5395('0x88')][_0x5395('0x47')]+0x1,'app':'close','appdata':_0x5395('0xab'),'interval':_0x5395('0xac')});}_0x43ccd9['interaction'][_0x5395('0xa9')]=!![];}return db[_0x5395('0x85')]['create']({'phone':_0x43ccd9[_0x5395('0x5a')]['from'],'messageId':_0x43ccd9[_0x5395('0x5a')][_0x5395('0x99')],'body':_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')],'WhatsappAccountId':_0x196483['params']['id'],'WhatsappInteractionId':_0x39e0d9['id'],'direction':'in','ContactId':_0x39e0d9[_0x5395('0xad')],'AttachmentId':_0x43ccd9[_0x5395('0x5a')][_0x5395('0xae')]});})['then'](function(_0x10b897){_0x43ccd9[_0x5395('0x25')]=_0x10b897;if(_0x43ccd9[_0x5395('0xa8')][_0x5395('0xaf')]){return db[_0x5395('0x77')]['find']({'attributes':['id','name'],'where':{'id':_0x43ccd9[_0x5395('0xa8')][_0x5395('0xaf')]}})[_0x5395('0x1e')](function(_0x3fc49e){if(_0x3fc49e){_0x43ccd9[_0x5395('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5395('0xb0'),'appdata':_0x3fc49e[_0x5395('0x38')]+','+(_0x43ccd9['account'][_0x5395('0xb1')]||0xa),'interval':_0x5395('0xac')});}return respondWithRpcPromise('Start',_0x5395('0xb2'),_0x43ccd9);});}return respondWithRpcPromise(_0x5395('0xb3'),_0x5395('0xb2'),_0x43ccd9);})[_0x5395('0x1e')](function(_0x5ee450){if(_0x5ee450){var _0x1fbcca=0xc8;var _0x2f4f91='receiveMessage';logger[_0x5395('0x26')](_0x5395('0x21'),_0x2f4f91,_0x1fbcca,_0x5395('0xb4'));logger[_0x5395('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2f4f91,_0x1fbcca,_0x5395('0xb4'),JSON[_0x5395('0x23')](_0x5ee450));if(_0x43ccd9[_0x5395('0x81')][_0x5395('0x3f')]==='twilio'){return _0x1b1a73[_0x5395('0x2a')](_0x1fbcca)['set']('Content-Type',_0x5395('0xb5'))['send']('\x0a');}else{return _0x1b1a73[_0x5395('0x2a')](_0x1fbcca)['json'](_0x5ee450);}}});})[_0x5395('0x28')](handleError(_0x1b1a73,null));};exports['send']=function(_0x5659da,_0x1a1d9b,_0x278f8f){var _0x29f2fa,_0x156a88,_0x21baa6;if(_['isNil'](_0x5659da[_0x5395('0x5a')][_0x5395('0x5a')])||_0x5659da[_0x5395('0x5a')]['body']===''){throw new db['Sequelize'][(_0x5395('0x8e'))](_0x5395('0x9c'));}if(_[_0x5395('0x9b')](_0x5659da[_0x5395('0x5a')]['to'])){throw new db[(_0x5395('0x8d'))]['ValidationError'](_0x5395('0xb6'));}_0x29f2fa=_0x5659da[_0x5395('0x5a')]['to'];return db['WhatsappAccount'][_0x5395('0x59')]({'where':{'id':_0x5659da[_0x5395('0x57')]['id']},'include':[{'model':db[_0x5395('0xa1')],'as':_0x5395('0xb7'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x29f2fa},'limit':0x1,'order':[[_0x5395('0x92'),_0x5395('0xb8')]]}]}]})[_0x5395('0x1e')](handleEntityNotFound(_0x1a1d9b,null))['then'](function(_0x23ff9e){if(_0x23ff9e&&_0x23ff9e[_0x5395('0xb7')]){_0x156a88=_0x23ff9e[_0x5395('0x5c')]({'plain':!![]});if(_0x156a88[_0x5395('0xb7')]&&_0x156a88[_0x5395('0xb7')][_0x5395('0xa4')]['length']){return _0x156a88[_0x5395('0xb7')][_0x5395('0xa4')][0x0];}return db[_0x5395('0x8c')][_0x5395('0x62')](_[_0x5395('0xa5')](_0x5659da[_0x5395('0x5a')],{'firstName':_0x29f2fa,'mobile':_0x29f2fa,'phone':_0x29f2fa,'ListId':_0x156a88[_0x5395('0xa2')]}));}})[_0x5395('0x1e')](handleEntityNotFound(_0x1a1d9b,null))[_0x5395('0x1e')](function(_0x5167ec){if(_0x5167ec){_0x21baa6=_0x5167ec;return db[_0x5395('0xa7')][_0x5395('0x59')]({'where':{'ContactId':_0x21baa6['id'],'closed':![],'WhatsappAccountId':_0x156a88['id']}})[_0x5395('0x1e')](function(_0x7c9866){if(_0x7c9866){return[_0x7c9866,![]];}return db[_0x5395('0xa7')][_0x5395('0x62')]({'UserId':_0x5659da[_0x5395('0x5b')]['id'],'ContactId':_0x21baa6['id'],'WhatsappAccountId':_0x156a88['id'],'phone':_0x29f2fa,'firstMsgDirection':'out','Messages':[_['merge'](_0x5659da[_0x5395('0x5a')],{'read':![],'body':_0x5659da[_0x5395('0x5a')][_0x5395('0x5a')],'phone':_0x29f2fa,'WhatsappAccountId':_0x156a88['id'],'UserId':_0x5659da['user']['id'],'ContactId':_0x21baa6['id']})]},{'include':[{'model':db[_0x5395('0x85')],'as':_0x5395('0xb9')}]})[_0x5395('0x1e')](function(_0x15d775){return[_0x15d775,!![]];});});}})[_0x5395('0xba')](function(_0x7f398,_0x2aac3f){if(_0x2aac3f){return _0x7f398;}return db[_0x5395('0x85')][_0x5395('0x62')](_['merge'](_0x5659da[_0x5395('0x5a')],{'read':![],'body':_0x5659da[_0x5395('0x5a')]['body'],'phone':_0x29f2fa,'WhatsappAccountId':_0x156a88['id'],'WhatsappInteractionId':_0x7f398['id'],'UserId':_0x5659da[_0x5395('0x5b')]['id'],'ContactId':_0x21baa6['id']}))[_0x5395('0x1e')](function(_0x240a8b){_0x7f398[_0x5395('0xbb')]['Messages']=[];_0x7f398[_0x5395('0xbb')][_0x5395('0xb9')][_0x5395('0xaa')](_0x240a8b[_0x5395('0xbb')]);return _0x7f398;});})[_0x5395('0x1e')](respondWithResult(_0x1a1d9b,null))[_0x5395('0x28')](handleError(_0x1a1d9b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index d6ab6b5..9312b0d 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 _0xaf25=['remove','emit','hasOwnProperty','hook','exports','WhatsappAccount','setMaxListeners','save','update'];(function(_0x5bc343,_0x4c7403){var _0x4c313d=function(_0x1534e7){while(--_0x1534e7){_0x5bc343['push'](_0x5bc343['shift']());}};_0x4c313d(++_0x4c7403);}(_0xaf25,0x95));var _0x5af2=function(_0x309b0b,_0x53467b){_0x309b0b=_0x309b0b-0x0;var _0x4ffd2c=_0xaf25[_0x309b0b];return _0x4ffd2c;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x5af2('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5af2('0x1')](0x0);var events={'afterCreate':_0x5af2('0x2'),'afterUpdate':_0x5af2('0x3'),'afterDestroy':_0x5af2('0x4')};function emitEvent(_0x43f14d){return function(_0x516526,_0x552d47,_0x127cf8){WhatsappAccountEvents[_0x5af2('0x5')](_0x43f14d+':'+_0x516526['id'],_0x516526);WhatsappAccountEvents['emit'](_0x43f14d,_0x516526);_0x127cf8(null);};}for(var e in events){if(events[_0x5af2('0x6')](e)){var event=events[e];WhatsappAccount[_0x5af2('0x7')](e,emitEvent(event));}}module[_0x5af2('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x5f28=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x2562ce,_0x46066d){var _0x5f399a=function(_0x40f782){while(--_0x40f782){_0x2562ce['push'](_0x2562ce['shift']());}};_0x5f399a(++_0x46066d);}(_0x5f28,0xaa));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x85f2('0x0'));var WhatsappAccount=require(_0x85f2('0x1'))['db'][_0x85f2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x85f2('0x3')](0x0);var events={'afterCreate':_0x85f2('0x4'),'afterUpdate':_0x85f2('0x5'),'afterDestroy':_0x85f2('0x6')};function emitEvent(_0x5a4daa){return function(_0x3bbbce,_0x2ccf42,_0x14174e){WhatsappAccountEvents[_0x85f2('0x7')](_0x5a4daa+':'+_0x3bbbce['id'],_0x3bbbce);WhatsappAccountEvents[_0x85f2('0x7')](_0x5a4daa,_0x3bbbce);_0x14174e(null);};}for(var e in events){if(events[_0x85f2('0x8')](e)){var event=events[e];WhatsappAccount[_0x85f2('0x9')](e,emitEvent(event));}}module[_0x85f2('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 6016bf3..e260f7c 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 _0x43f5=['exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','./whatsappAccount.attributes'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x43f5,0x1cb));var _0x543f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x43f5[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x543f('0x0'));var util=require(_0x543f('0x1'));var logger=require(_0x543f('0x2'))(_0x543f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x543f('0x4'));module[_0x543f('0x5')]=function(_0x4b8884,_0x4a7ee0){return _0x4b8884['define'](_0x543f('0x6'),attributes,{'tableName':_0x543f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b39=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x1c5ba5,_0x53ce01){var _0x4fafd8=function(_0x4567bc){while(--_0x4567bc){_0x1c5ba5['push'](_0x1c5ba5['shift']());}};_0x4fafd8(++_0x53ce01);}(_0x1b39,0xbd));var _0x91b3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b39[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x91b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x91b3('0x1'));var moment=require(_0x91b3('0x2'));var BPromise=require(_0x91b3('0x3'));var rp=require(_0x91b3('0x4'));var fs=require('fs');var path=require(_0x91b3('0x5'));var rimraf=require(_0x91b3('0x6'));var config=require(_0x91b3('0x7'));var attributes=require(_0x91b3('0x8'));module[_0x91b3('0x9')]=function(_0x53561d,_0xee7543){return _0x53561d[_0x91b3('0xa')](_0x91b3('0xb'),attributes,{'tableName':_0x91b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 87a0e95..7ccd660 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 _0x1af9=['where','include','model','attributes','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw'];(function(_0x4928ad,_0x4e7024){var _0x3cfc54=function(_0x1ccc8d){while(--_0x1ccc8d){_0x4928ad['push'](_0x4928ad['shift']());}};_0x3cfc54(++_0x4e7024);}(_0x1af9,0x15b));var _0x91af=function(_0x2dce01,_0x105443){_0x2dce01=_0x2dce01-0x0;var _0x1091df=_0x1af9[_0x2dce01];return _0x1091df;};'use strict';var _=require(_0x91af('0x0'));var util=require(_0x91af('0x1'));var moment=require(_0x91af('0x2'));var BPromise=require(_0x91af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91af('0x4'))['db'];var utils=require(_0x91af('0x5'));var logger=require(_0x91af('0x6'))(_0x91af('0x7'));var config=require(_0x91af('0x8'));var jayson=require(_0x91af('0x9'));var client=jayson['client'][_0x91af('0xa')]({'port':0x232a});config[_0x91af('0xb')]=_['defaults'](config['redis'],{'host':_0x91af('0xc'),'port':0x18eb});var socket=require(_0x91af('0xd'))(new Redis(config[_0x91af('0xb')]));require(_0x91af('0xe'))[_0x91af('0xf')](socket);function respondWithRpcPromise(_0x541830,_0x597fd8,_0x2d8bff){return new BPromise(function(_0x5e90c4,_0x59663a){return client[_0x91af('0x10')](_0x541830,_0x2d8bff)[_0x91af('0x11')](function(_0x730b9d){logger[_0x91af('0x12')](_0x91af('0x13'),_0x597fd8,_0x91af('0x14'));logger[_0x91af('0x15')](_0x91af('0x16'),_0x597fd8,_0x91af('0x14'),JSON[_0x91af('0x17')](_0x730b9d));if(_0x730b9d[_0x91af('0x18')]){if(_0x730b9d[_0x91af('0x18')]['code']===0x1f4){logger[_0x91af('0x18')](_0x91af('0x13'),_0x597fd8,_0x730b9d[_0x91af('0x18')][_0x91af('0x19')]);return _0x59663a(_0x730b9d[_0x91af('0x18')]['message']);}logger[_0x91af('0x18')](_0x91af('0x13'),_0x597fd8,_0x730b9d[_0x91af('0x18')][_0x91af('0x19')]);return _0x5e90c4(_0x730b9d[_0x91af('0x18')][_0x91af('0x19')]);}else{logger[_0x91af('0x12')](_0x91af('0x13'),_0x597fd8,_0x91af('0x14'));_0x5e90c4(_0x730b9d[_0x91af('0x1a')][_0x91af('0x19')]);}})[_0x91af('0x1b')](function(_0x8793a8){logger[_0x91af('0x18')](_0x91af('0x13'),_0x597fd8,_0x8793a8);_0x59663a(_0x8793a8);});});}exports[_0x91af('0x1c')]=function(_0x58c0b4){var _0x32e325=this;return new Promise(function(_0x3b1a07,_0x10b5c5){return db[_0x91af('0x1d')][_0x91af('0x1e')]({'raw':_0x58c0b4[_0x91af('0x1f')]?_0x58c0b4[_0x91af('0x1f')][_0x91af('0x20')]===undefined?!![]:![]:!![],'where':_0x58c0b4['options']?_0x58c0b4[_0x91af('0x1f')][_0x91af('0x21')]||null:null,'attributes':_0x58c0b4[_0x91af('0x1f')]?_0x58c0b4[_0x91af('0x1f')]['attributes']||null:null,'include':_0x58c0b4[_0x91af('0x1f')]?_0x58c0b4[_0x91af('0x1f')][_0x91af('0x22')]?_['map'](_0x58c0b4['options'][_0x91af('0x22')],function(_0x2f5a15){return{'model':db[_0x2f5a15[_0x91af('0x23')]],'as':_0x2f5a15['as'],'attributes':_0x2f5a15[_0x91af('0x24')],'include':_0x2f5a15[_0x91af('0x22')]?_[_0x91af('0x25')](_0x2f5a15[_0x91af('0x22')],function(_0x14688f){return{'model':db[_0x14688f[_0x91af('0x23')]],'as':_0x14688f['as'],'attributes':_0x14688f['attributes'],'include':_0x14688f[_0x91af('0x22')]?_['map'](_0x14688f[_0x91af('0x22')],function(_0x457c98){return{'model':db[_0x457c98[_0x91af('0x23')]],'as':_0x457c98['as'],'attributes':_0x457c98[_0x91af('0x24')]};}):[]};}):[]};}):[]:[]})[_0x91af('0x11')](function(_0x46bfdf){logger[_0x91af('0x12')](_0x91af('0x1c'),_0x58c0b4);logger[_0x91af('0x15')](_0x91af('0x1c'),_0x58c0b4,JSON['stringify'](_0x46bfdf));_0x3b1a07(_0x46bfdf);})['catch'](function(_0x128e62){logger['error'](_0x91af('0x1c'),_0x128e62[_0x91af('0x19')],_0x58c0b4);_0x10b5c5(_0x32e325[_0x91af('0x18')](0x1f4,_0x128e62[_0x91af('0x19')]));});});}; \ No newline at end of file +var _0x5eef=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','attributes','include','map','model','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5eef,0x9c));var _0xf5ee=function(_0x442cb8,_0x3cd762){_0x442cb8=_0x442cb8-0x0;var _0x39f337=_0x5eef[_0x442cb8];return _0x39f337;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5ee('0x0'));var BPromise=require('bluebird');var rs=require(_0xf5ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ee('0x2'))['db'];var utils=require(_0xf5ee('0x3'));var logger=require(_0xf5ee('0x4'))(_0xf5ee('0x5'));var config=require(_0xf5ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf5ee('0x7')]=_[_0xf5ee('0x8')](config['redis'],{'host':_0xf5ee('0x9'),'port':0x18eb});var socket=require(_0xf5ee('0xa'))(new Redis(config[_0xf5ee('0x7')]));require(_0xf5ee('0xb'))[_0xf5ee('0xc')](socket);function respondWithRpcPromise(_0x3cd91c,_0xc0669c,_0x24d0e8){return new BPromise(function(_0x94a2b3,_0x118c7a){return client['request'](_0x3cd91c,_0x24d0e8)[_0xf5ee('0xd')](function(_0x52c7b7){logger[_0xf5ee('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0xc0669c,_0xf5ee('0xf'));logger[_0xf5ee('0x10')](_0xf5ee('0x11'),_0xc0669c,_0xf5ee('0xf'),JSON['stringify'](_0x52c7b7));if(_0x52c7b7[_0xf5ee('0x12')]){if(_0x52c7b7[_0xf5ee('0x12')][_0xf5ee('0x13')]===0x1f4){logger[_0xf5ee('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0xc0669c,_0x52c7b7['error'][_0xf5ee('0x14')]);return _0x118c7a(_0x52c7b7[_0xf5ee('0x12')][_0xf5ee('0x14')]);}logger[_0xf5ee('0x12')](_0xf5ee('0x15'),_0xc0669c,_0x52c7b7['error'][_0xf5ee('0x14')]);return _0x94a2b3(_0x52c7b7[_0xf5ee('0x12')]['message']);}else{logger[_0xf5ee('0xe')](_0xf5ee('0x15'),_0xc0669c,_0xf5ee('0xf'));_0x94a2b3(_0x52c7b7[_0xf5ee('0x16')]['message']);}})[_0xf5ee('0x17')](function(_0xbff68a){logger[_0xf5ee('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0xc0669c,_0xbff68a);_0x118c7a(_0xbff68a);});});}exports[_0xf5ee('0x18')]=function(_0x207578){var _0xe97125=this;return new Promise(function(_0x21a2e3,_0x192d0c){return db[_0xf5ee('0x19')]['find']({'raw':_0x207578['options']?_0x207578[_0xf5ee('0x1a')][_0xf5ee('0x1b')]===undefined?!![]:![]:!![],'where':_0x207578[_0xf5ee('0x1a')]?_0x207578[_0xf5ee('0x1a')]['where']||null:null,'attributes':_0x207578[_0xf5ee('0x1a')]?_0x207578['options'][_0xf5ee('0x1c')]||null:null,'include':_0x207578[_0xf5ee('0x1a')]?_0x207578[_0xf5ee('0x1a')][_0xf5ee('0x1d')]?_[_0xf5ee('0x1e')](_0x207578['options'][_0xf5ee('0x1d')],function(_0x4f46f){return{'model':db[_0x4f46f['model']],'as':_0x4f46f['as'],'attributes':_0x4f46f[_0xf5ee('0x1c')],'include':_0x4f46f[_0xf5ee('0x1d')]?_[_0xf5ee('0x1e')](_0x4f46f[_0xf5ee('0x1d')],function(_0xe647a5){return{'model':db[_0xe647a5[_0xf5ee('0x1f')]],'as':_0xe647a5['as'],'attributes':_0xe647a5[_0xf5ee('0x1c')],'include':_0xe647a5[_0xf5ee('0x1d')]?_[_0xf5ee('0x1e')](_0xe647a5['include'],function(_0x4b1c0c){return{'model':db[_0x4b1c0c[_0xf5ee('0x1f')]],'as':_0x4b1c0c['as'],'attributes':_0x4b1c0c[_0xf5ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf5ee('0xd')](function(_0x54d5d8){logger[_0xf5ee('0xe')](_0xf5ee('0x18'),_0x207578);logger[_0xf5ee('0x10')](_0xf5ee('0x18'),_0x207578,JSON['stringify'](_0x54d5d8));_0x21a2e3(_0x54d5d8);})['catch'](function(_0x1242a5){logger['error'](_0xf5ee('0x18'),_0x1242a5['message'],_0x207578);_0x192d0c(_0xe97125[_0xf5ee('0x12')](0x1f4,_0x1242a5['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index d531446..ec20de7 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 _0x74d3=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','emit','removeListener'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x74d3,0x113));var _0x374d=function(_0x53908a,_0x255910){_0x53908a=_0x53908a-0x0;var _0x41daec=_0x74d3[_0x53908a];return _0x41daec;};'use strict';var WhatsappAccountEvents=require(_0x374d('0x0'));var events=[_0x374d('0x1'),_0x374d('0x2'),'update'];function createListener(_0x376b70,_0x20e730){return function(_0x31c416){_0x20e730[_0x374d('0x3')](_0x376b70,_0x31c416);};}function removeListener(_0x24cb41,_0x4b7c06){return function(){WhatsappAccountEvents[_0x374d('0x4')](_0x24cb41,_0x4b7c06);};}exports[_0x374d('0x5')]=function(_0x570096){for(var _0x5c42de=0x0,_0x415442=events[_0x374d('0x6')];_0x5c42de<_0x415442;_0x5c42de++){var _0x2dcf03=events[_0x5c42de];var _0x1e7d88=createListener(_0x374d('0x7')+_0x2dcf03,_0x570096);WhatsappAccountEvents['on'](_0x2dcf03,_0x1e7d88);}}; \ No newline at end of file +var _0x1b3f=['register','remove','emit','removeListener'];(function(_0x42813c,_0x40b1c7){var _0x544cf2=function(_0x17d2bd){while(--_0x17d2bd){_0x42813c['push'](_0x42813c['shift']());}};_0x544cf2(++_0x40b1c7);}(_0x1b3f,0x1ed));var _0xf1b3=function(_0x26682c,_0x453d86){_0x26682c=_0x26682c-0x0;var _0x803612=_0x1b3f[_0x26682c];return _0x803612;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xf1b3('0x0'),'update'];function createListener(_0x2354b2,_0x50fb9c){return function(_0x4ae2b2){_0x50fb9c[_0xf1b3('0x1')](_0x2354b2,_0x4ae2b2);};}function removeListener(_0x879865,_0x224667){return function(){WhatsappAccountEvents[_0xf1b3('0x2')](_0x879865,_0x224667);};}exports[_0xf1b3('0x3')]=function(_0x44aa84){for(var _0x5e9645=0x0,_0x397089=events['length'];_0x5e9645<_0x397089;_0x5e9645++){var _0x59dcfa=events[_0x5e9645];var _0x2fec48=createListener('whatsappAccount:'+_0x59dcfa,_0x44aa84);WhatsappAccountEvents['on'](_0x59dcfa,_0x2fec48);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 227bc1e..5e7beae 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 _0xf5ea=['./whatsappApplication.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x643b2,_0x14e495){var _0x2e5346=function(_0x3ed065){while(--_0x3ed065){_0x643b2['push'](_0x643b2['shift']());}};_0x2e5346(++_0x14e495);}(_0xf5ea,0xf0));var _0xaf5e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf5ea[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xaf5e('0x0'));var util=require(_0xaf5e('0x1'));var path=require(_0xaf5e('0x2'));var timeout=require(_0xaf5e('0x3'));var express=require('express');var router=express[_0xaf5e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf5e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf5e('0x6'));var controller=require(_0xaf5e('0x7'));router[_0xaf5e('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf5e('0x9')]);router[_0xaf5e('0x8')](_0xaf5e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xaf5e('0xb')]('/',auth[_0xaf5e('0xc')](),controller[_0xaf5e('0xd')]);router[_0xaf5e('0xe')](_0xaf5e('0xa'),auth[_0xaf5e('0xc')](),controller[_0xaf5e('0xf')]);router[_0xaf5e('0x10')](_0xaf5e('0xa'),auth[_0xaf5e('0xc')](),controller[_0xaf5e('0x11')]);module[_0xaf5e('0x12')]=router; \ No newline at end of file +var _0x5390=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','delete','exports','multer','util','connect-timeout'];(function(_0x133f09,_0x26c800){var _0x47126a=function(_0xb47025){while(--_0xb47025){_0x133f09['push'](_0x133f09['shift']());}};_0x47126a(++_0x26c800);}(_0x5390,0x1cd));var _0x0539=function(_0x8cb059,_0xb527bb){_0x8cb059=_0x8cb059-0x0;var _0x16a605=_0x5390[_0x8cb059];return _0x16a605;};'use strict';var multer=require(_0x0539('0x0'));var util=require(_0x0539('0x1'));var path=require('path');var timeout=require(_0x0539('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0539('0x3'));var auth=require(_0x0539('0x4'));var interaction=require(_0x0539('0x5'));var config=require(_0x0539('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x0539('0x7')](),controller[_0x0539('0x8')]);router[_0x0539('0x9')](_0x0539('0xa'),auth[_0x0539('0x7')](),controller[_0x0539('0xb')]);router[_0x0539('0xc')]('/',auth[_0x0539('0x7')](),controller[_0x0539('0xd')]);router['put'](_0x0539('0xa'),auth[_0x0539('0x7')](),controller['update']);router[_0x0539('0xe')](_0x0539('0xa'),auth[_0x0539('0x7')](),controller['destroy']);module[_0x0539('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ec44d4b..44ad850 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 _0x3a71=['noop','STRING','sequelize','exports'];(function(_0x111f26,_0x2f7b7a){var _0x138410=function(_0x41ecc3){while(--_0x41ecc3){_0x111f26['push'](_0x111f26['shift']());}};_0x138410(++_0x2f7b7a);}(_0x3a71,0x66));var _0x13a7=function(_0x2a2edf,_0x57d2c3){_0x2a2edf=_0x2a2edf-0x0;var _0x1feed6=_0x3a71[_0x2a2edf];return _0x1feed6;};'use strict';var Sequelize=require(_0x13a7('0x0'));module[_0x13a7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x13a7('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x13a7('0x3')]},'interval':{'type':Sequelize[_0x13a7('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x34b8=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x34b8,0x178));var _0x834b=function(_0x5611b7,_0x5fd304){_0x5611b7=_0x5611b7-0x0;var _0x8cb5a0=_0x34b8[_0x5611b7];return _0x8cb5a0;};'use strict';var Sequelize=require(_0x834b('0x0'));module[_0x834b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x834b('0x2')],'allowNull':![],'defaultValue':_0x834b('0x3')},'appdata':{'type':Sequelize[_0x834b('0x4')]()},'description':{'type':Sequelize[_0x834b('0x2')]},'interval':{'type':Sequelize[_0x834b('0x2')],'defaultValue':_0x834b('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 0446867..360914e 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 _0xd9fb=['fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','map','options','includeAll','show','params','fields','include','merge','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','WhatsappApplication','rawAttributes'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xd9fb,0x189));var _0xbd9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9fb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xbd9f('0x0'));var rimraf=require(_0xbd9f('0x1'));var zipdir=require(_0xbd9f('0x2'));var jsonpatch=require(_0xbd9f('0x3'));var rp=require(_0xbd9f('0x4'));var moment=require(_0xbd9f('0x5'));var BPromise=require(_0xbd9f('0x6'));var Mustache=require('mustache');var util=require(_0xbd9f('0x7'));var path=require(_0xbd9f('0x8'));var sox=require('sox');var csv=require(_0xbd9f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd9f('0xa'));var _=require(_0xbd9f('0xb'));var squel=require('squel');var crypto=require(_0xbd9f('0xc'));var jsforce=require(_0xbd9f('0xd'));var deskjs=require(_0xbd9f('0xe'));var toCsv=require(_0xbd9f('0x9'));var querystring=require('querystring');var Papa=require(_0xbd9f('0xf'));var Redis=require(_0xbd9f('0x10'));var authService=require(_0xbd9f('0x11'));var qs=require(_0xbd9f('0x12'));var as=require(_0xbd9f('0x13'));var hardwareService=require(_0xbd9f('0x14'));var logger=require(_0xbd9f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbd9f('0x16'))['db'];function respondWithStatusCode(_0x5e800a,_0x16b916){_0x16b916=_0x16b916||0xcc;return function(_0x44672c){if(_0x44672c){return _0x5e800a[_0xbd9f('0x17')](_0x16b916);}return _0x5e800a['status'](_0x16b916)[_0xbd9f('0x18')]();};}function respondWithResult(_0x5beefe,_0x192fbb){_0x192fbb=_0x192fbb||0xc8;return function(_0x699e8f){if(_0x699e8f){return _0x5beefe[_0xbd9f('0x19')](_0x192fbb)[_0xbd9f('0x1a')](_0x699e8f);}};}function respondWithFilteredResult(_0x5ec72a,_0x442253){return function(_0x25557f){if(_0x25557f){var _0x104cfd=typeof _0x442253[_0xbd9f('0x1b')]===_0xbd9f('0x1c')&&typeof _0x442253[_0xbd9f('0x1d')]===_0xbd9f('0x1c');var _0x4f6181=_0x25557f['count'];var _0x35be6d=_0x104cfd?0x0:_0x442253['offset'];var _0x2f52dd=_0x104cfd?_0x25557f[_0xbd9f('0x1e')]:_0x442253[_0xbd9f('0x1b')]+_0x442253[_0xbd9f('0x1d')];var _0x2c276b;if(_0x2f52dd>=_0x4f6181){_0x2f52dd=_0x4f6181;_0x2c276b=0xc8;}else{_0x2c276b=0xce;}_0x5ec72a[_0xbd9f('0x19')](_0x2c276b);return _0x5ec72a[_0xbd9f('0x1f')](_0xbd9f('0x20'),_0x35be6d+'-'+_0x2f52dd+'/'+_0x4f6181)['json'](_0x25557f);}return null;};}function patchUpdates(_0x365775){return function(_0xdb7e4e){try{jsonpatch[_0xbd9f('0x21')](_0xdb7e4e,_0x365775,!![]);}catch(_0x144051){return BPromise[_0xbd9f('0x22')](_0x144051);}return _0xdb7e4e[_0xbd9f('0x23')]();};}function saveUpdates(_0x5f7881,_0x30e745){return function(_0x3d0d68){if(_0x3d0d68){return _0x3d0d68[_0xbd9f('0x24')](_0x5f7881)[_0xbd9f('0x25')](function(_0x4e929d){return _0x4e929d;});}return null;};}function removeEntity(_0x3bde09,_0x10697a){return function(_0x256aec){if(_0x256aec){return _0x256aec[_0xbd9f('0x26')]()['then'](function(){_0x3bde09[_0xbd9f('0x19')](0xcc)[_0xbd9f('0x18')]();});}};}function handleEntityNotFound(_0x278a10,_0x36f503){return function(_0x46fcc0){if(!_0x46fcc0){_0x278a10[_0xbd9f('0x17')](0x194);}return _0x46fcc0;};}function handleError(_0x7fd831,_0x5885d2){_0x5885d2=_0x5885d2||0x1f4;return function(_0xd89fc2){logger[_0xbd9f('0x27')](_0xd89fc2[_0xbd9f('0x28')]);if(_0xd89fc2[_0xbd9f('0x29')]){delete _0xd89fc2[_0xbd9f('0x29')];}_0x7fd831['status'](_0x5885d2)['send'](_0xd89fc2);};}exports[_0xbd9f('0x2a')]=function(_0x2b26bf,_0x1d92fa){var _0x4a8a91={},_0xe884e8={},_0x7fff9={'count':0x0,'rows':[]};var _0x294d81=_['map'](db[_0xbd9f('0x2b')][_0xbd9f('0x2c')],function(_0xcbfaa2){return{'name':_0xcbfaa2[_0xbd9f('0x2d')],'type':_0xcbfaa2[_0xbd9f('0x2e')][_0xbd9f('0x2f')]};});_0xe884e8[_0xbd9f('0x30')]=_['map'](_0x294d81,'name');_0xe884e8[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x2b26bf[_0xbd9f('0x31')]);_0xe884e8[_0xbd9f('0x33')]=_[_0xbd9f('0x34')](_0xe884e8[_0xbd9f('0x30')],_0xe884e8[_0xbd9f('0x31')]);_0x4a8a91[_0xbd9f('0x35')]=_[_0xbd9f('0x34')](_0xe884e8['model'],qs['fields'](_0x2b26bf[_0xbd9f('0x31')]['fields']));_0x4a8a91['attributes']=_0x4a8a91[_0xbd9f('0x35')][_0xbd9f('0x36')]?_0x4a8a91[_0xbd9f('0x35')]:_0xe884e8[_0xbd9f('0x30')];if(!_0x2b26bf[_0xbd9f('0x31')][_0xbd9f('0x37')](_0xbd9f('0x38'))){_0x4a8a91[_0xbd9f('0x1d')]=qs['limit'](_0x2b26bf[_0xbd9f('0x31')][_0xbd9f('0x1d')]);_0x4a8a91[_0xbd9f('0x1b')]=qs['offset'](_0x2b26bf['query'][_0xbd9f('0x1b')]);}_0x4a8a91[_0xbd9f('0x39')]=qs['sort'](_0x2b26bf[_0xbd9f('0x31')]['sort']);_0x4a8a91[_0xbd9f('0x3a')]=qs[_0xbd9f('0x33')](_[_0xbd9f('0x3b')](_0x2b26bf[_0xbd9f('0x31')],_0xe884e8[_0xbd9f('0x33')]),_0x294d81);if(_0x2b26bf['query'][_0xbd9f('0x3c')]){_0x4a8a91[_0xbd9f('0x3a')]=_['merge'](_0x4a8a91[_0xbd9f('0x3a')],{'$or':_[_0xbd9f('0x3d')](_0x294d81,function(_0x356548){if(_0x356548[_0xbd9f('0x2e')]!=='VIRTUAL'){var _0x3ee34e={};_0x3ee34e[_0x356548[_0xbd9f('0x29')]]={'$like':'%'+_0x2b26bf[_0xbd9f('0x31')][_0xbd9f('0x3c')]+'%'};return _0x3ee34e;}})});}_0x4a8a91=_['merge']({},_0x4a8a91,_0x2b26bf[_0xbd9f('0x3e')]);var _0x315291={'where':_0x4a8a91[_0xbd9f('0x3a')]};return db[_0xbd9f('0x2b')]['count'](_0x315291)['then'](function(_0x39eb9e){_0x7fff9[_0xbd9f('0x1e')]=_0x39eb9e;if(_0x2b26bf['query'][_0xbd9f('0x3f')]){_0x4a8a91['include']=[{'all':!![]}];}return db[_0xbd9f('0x2b')]['findAll'](_0x4a8a91);})[_0xbd9f('0x25')](function(_0x342ada){_0x7fff9['rows']=_0x342ada;return _0x7fff9;})['then'](respondWithFilteredResult(_0x1d92fa,_0x4a8a91))['catch'](handleError(_0x1d92fa,null));};exports[_0xbd9f('0x40')]=function(_0x23816d,_0x533339){var _0x5a4739={'raw':!![],'where':{'id':_0x23816d[_0xbd9f('0x41')]['id']}},_0x163e36={};_0x163e36[_0xbd9f('0x30')]=_[_0xbd9f('0x32')](db['WhatsappApplication'][_0xbd9f('0x2c')]);_0x163e36[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x23816d[_0xbd9f('0x31')]);_0x163e36[_0xbd9f('0x33')]=_['intersection'](_0x163e36[_0xbd9f('0x30')],_0x163e36[_0xbd9f('0x31')]);_0x5a4739[_0xbd9f('0x35')]=_[_0xbd9f('0x34')](_0x163e36['model'],qs[_0xbd9f('0x42')](_0x23816d[_0xbd9f('0x31')][_0xbd9f('0x42')]));_0x5a4739['attributes']=_0x5a4739['attributes'][_0xbd9f('0x36')]?_0x5a4739[_0xbd9f('0x35')]:_0x163e36[_0xbd9f('0x30')];if(_0x23816d[_0xbd9f('0x31')]['includeAll']){_0x5a4739[_0xbd9f('0x43')]=[{'all':!![]}];}_0x5a4739=_[_0xbd9f('0x44')]({},_0x5a4739,_0x23816d[_0xbd9f('0x3e')]);return db[_0xbd9f('0x2b')]['find'](_0x5a4739)['then'](handleEntityNotFound(_0x533339,null))[_0xbd9f('0x25')](respondWithResult(_0x533339,null))[_0xbd9f('0x45')](handleError(_0x533339,null));};exports[_0xbd9f('0x46')]=function(_0x585065,_0x381646){return db[_0xbd9f('0x2b')][_0xbd9f('0x46')](_0x585065[_0xbd9f('0x47')],{})[_0xbd9f('0x25')](respondWithResult(_0x381646,0xc9))[_0xbd9f('0x45')](handleError(_0x381646,null));};exports[_0xbd9f('0x24')]=function(_0x2353e0,_0xcaa162){if(_0x2353e0[_0xbd9f('0x47')]['id']){delete _0x2353e0[_0xbd9f('0x47')]['id'];}return db[_0xbd9f('0x2b')][_0xbd9f('0x48')]({'where':{'id':_0x2353e0[_0xbd9f('0x41')]['id']}})[_0xbd9f('0x25')](handleEntityNotFound(_0xcaa162,null))['then'](saveUpdates(_0x2353e0[_0xbd9f('0x47')],null))['then'](respondWithResult(_0xcaa162,null))[_0xbd9f('0x45')](handleError(_0xcaa162,null));};exports[_0xbd9f('0x26')]=function(_0x503991,_0x52a85f){return db[_0xbd9f('0x2b')][_0xbd9f('0x48')]({'where':{'id':_0x503991[_0xbd9f('0x41')]['id']}})[_0xbd9f('0x25')](handleEntityNotFound(_0x52a85f,null))[_0xbd9f('0x25')](removeEntity(_0x52a85f,null))[_0xbd9f('0x45')](handleError(_0x52a85f,null));}; \ No newline at end of file +var _0x323f=['send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show','params','keys','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name'];(function(_0x2a3a73,_0x964fbe){var _0x2cdc58=function(_0xd15e69){while(--_0xd15e69){_0x2a3a73['push'](_0x2a3a73['shift']());}};_0x2cdc58(++_0x964fbe);}(_0x323f,0x1ee));var _0xf323=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x323f[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf323('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x1'));var rp=require(_0xf323('0x2'));var moment=require(_0xf323('0x3'));var BPromise=require(_0xf323('0x4'));var Mustache=require(_0xf323('0x5'));var util=require(_0xf323('0x6'));var path=require(_0xf323('0x7'));var sox=require(_0xf323('0x8'));var csv=require(_0xf323('0x9'));var ejs=require(_0xf323('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0x9'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var as=require(_0xf323('0x15'));var hardwareService=require(_0xf323('0x16'));var logger=require(_0xf323('0x17'))(_0xf323('0x18'));var utils=require(_0xf323('0x19'));var config=require(_0xf323('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf323('0x1b'))['db'];function respondWithStatusCode(_0x7dbd26,_0x26eddb){_0x26eddb=_0x26eddb||0xcc;return function(_0x56b916){if(_0x56b916){return _0x7dbd26[_0xf323('0x1c')](_0x26eddb);}return _0x7dbd26[_0xf323('0x1d')](_0x26eddb)[_0xf323('0x1e')]();};}function respondWithResult(_0x3a829f,_0x22672e){_0x22672e=_0x22672e||0xc8;return function(_0x144db9){if(_0x144db9){return _0x3a829f['status'](_0x22672e)['json'](_0x144db9);}};}function respondWithFilteredResult(_0x874219,_0x447517){return function(_0x38fd4c){if(_0x38fd4c){var _0x3858ee=typeof _0x447517[_0xf323('0x1f')]==='undefined'&&typeof _0x447517[_0xf323('0x20')]===_0xf323('0x21');var _0xb9859f=_0x38fd4c[_0xf323('0x22')];var _0x49b115=_0x3858ee?0x0:_0x447517[_0xf323('0x1f')];var _0x272aec=_0x3858ee?_0x38fd4c[_0xf323('0x22')]:_0x447517[_0xf323('0x1f')]+_0x447517['limit'];var _0x409b16;if(_0x272aec>=_0xb9859f){_0x272aec=_0xb9859f;_0x409b16=0xc8;}else{_0x409b16=0xce;}_0x874219[_0xf323('0x1d')](_0x409b16);return _0x874219['set'](_0xf323('0x23'),_0x49b115+'-'+_0x272aec+'/'+_0xb9859f)[_0xf323('0x24')](_0x38fd4c);}return null;};}function patchUpdates(_0x32a942){return function(_0x183ce0){try{jsonpatch['apply'](_0x183ce0,_0x32a942,!![]);}catch(_0xdc7891){return BPromise[_0xf323('0x25')](_0xdc7891);}return _0x183ce0[_0xf323('0x26')]();};}function saveUpdates(_0x52305d,_0x43e467){return function(_0x375473){if(_0x375473){return _0x375473[_0xf323('0x27')](_0x52305d)[_0xf323('0x28')](function(_0x13ec1f){return _0x13ec1f;});}return null;};}function removeEntity(_0xa3362c,_0x189b23){return function(_0x43bc05){if(_0x43bc05){return _0x43bc05[_0xf323('0x29')]()['then'](function(){_0xa3362c[_0xf323('0x1d')](0xcc)[_0xf323('0x1e')]();});}};}function handleEntityNotFound(_0x33dc52,_0x292ce0){return function(_0x87ec45){if(!_0x87ec45){_0x33dc52[_0xf323('0x1c')](0x194);}return _0x87ec45;};}function handleError(_0x4d737d,_0x30ed93){_0x30ed93=_0x30ed93||0x1f4;return function(_0x56ce33){logger[_0xf323('0x2a')](_0x56ce33[_0xf323('0x2b')]);if(_0x56ce33['name']){delete _0x56ce33[_0xf323('0x2c')];}_0x4d737d[_0xf323('0x1d')](_0x30ed93)[_0xf323('0x2d')](_0x56ce33);};}exports[_0xf323('0x2e')]=function(_0x46e3b1,_0x5b8b60){var _0x44c944={},_0x34b536={},_0x12c7d5={'count':0x0,'rows':[]};var _0x30a5d7=_[_0xf323('0x2f')](db[_0xf323('0x30')][_0xf323('0x31')],function(_0x1723b7){return{'name':_0x1723b7[_0xf323('0x32')],'type':_0x1723b7['type'][_0xf323('0x33')]};});_0x34b536[_0xf323('0x34')]=_[_0xf323('0x2f')](_0x30a5d7,_0xf323('0x2c'));_0x34b536[_0xf323('0x35')]=_['keys'](_0x46e3b1[_0xf323('0x35')]);_0x34b536[_0xf323('0x36')]=_[_0xf323('0x37')](_0x34b536[_0xf323('0x34')],_0x34b536[_0xf323('0x35')]);_0x44c944['attributes']=_[_0xf323('0x37')](_0x34b536[_0xf323('0x34')],qs[_0xf323('0x38')](_0x46e3b1[_0xf323('0x35')]['fields']));_0x44c944[_0xf323('0x39')]=_0x44c944['attributes'][_0xf323('0x3a')]?_0x44c944[_0xf323('0x39')]:_0x34b536['model'];if(!_0x46e3b1[_0xf323('0x35')]['hasOwnProperty'](_0xf323('0x3b'))){_0x44c944['limit']=qs[_0xf323('0x20')](_0x46e3b1['query'][_0xf323('0x20')]);_0x44c944[_0xf323('0x1f')]=qs['offset'](_0x46e3b1['query']['offset']);}_0x44c944[_0xf323('0x3c')]=qs[_0xf323('0x3d')](_0x46e3b1[_0xf323('0x35')][_0xf323('0x3d')]);_0x44c944[_0xf323('0x3e')]=qs['filters'](_['pick'](_0x46e3b1['query'],_0x34b536[_0xf323('0x36')]),_0x30a5d7);if(_0x46e3b1['query'][_0xf323('0x3f')]){_0x44c944['where']=_[_0xf323('0x40')](_0x44c944[_0xf323('0x3e')],{'$or':_[_0xf323('0x2f')](_0x30a5d7,function(_0x325fa9){if(_0x325fa9[_0xf323('0x41')]!=='VIRTUAL'){var _0x3d8ddb={};_0x3d8ddb[_0x325fa9[_0xf323('0x2c')]]={'$like':'%'+_0x46e3b1[_0xf323('0x35')][_0xf323('0x3f')]+'%'};return _0x3d8ddb;}})});}_0x44c944=_[_0xf323('0x40')]({},_0x44c944,_0x46e3b1[_0xf323('0x42')]);var _0x288428={'where':_0x44c944[_0xf323('0x3e')]};return db[_0xf323('0x30')][_0xf323('0x22')](_0x288428)[_0xf323('0x28')](function(_0x45287b){_0x12c7d5[_0xf323('0x22')]=_0x45287b;if(_0x46e3b1[_0xf323('0x35')][_0xf323('0x43')]){_0x44c944[_0xf323('0x44')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x44c944);})[_0xf323('0x28')](function(_0x16ac6d){_0x12c7d5[_0xf323('0x45')]=_0x16ac6d;return _0x12c7d5;})[_0xf323('0x28')](respondWithFilteredResult(_0x5b8b60,_0x44c944))[_0xf323('0x46')](handleError(_0x5b8b60,null));};exports[_0xf323('0x47')]=function(_0x2746e3,_0x125047){var _0x1c0136={'raw':!![],'where':{'id':_0x2746e3[_0xf323('0x48')]['id']}},_0x320592={};_0x320592[_0xf323('0x34')]=_[_0xf323('0x49')](db['WhatsappApplication'][_0xf323('0x31')]);_0x320592['query']=_['keys'](_0x2746e3[_0xf323('0x35')]);_0x320592['filters']=_['intersection'](_0x320592[_0xf323('0x34')],_0x320592[_0xf323('0x35')]);_0x1c0136[_0xf323('0x39')]=_[_0xf323('0x37')](_0x320592[_0xf323('0x34')],qs[_0xf323('0x38')](_0x2746e3[_0xf323('0x35')][_0xf323('0x38')]));_0x1c0136[_0xf323('0x39')]=_0x1c0136[_0xf323('0x39')][_0xf323('0x3a')]?_0x1c0136['attributes']:_0x320592[_0xf323('0x34')];if(_0x2746e3['query'][_0xf323('0x43')]){_0x1c0136[_0xf323('0x44')]=[{'all':!![]}];}_0x1c0136=_[_0xf323('0x40')]({},_0x1c0136,_0x2746e3[_0xf323('0x42')]);return db['WhatsappApplication']['find'](_0x1c0136)[_0xf323('0x28')](handleEntityNotFound(_0x125047,null))['then'](respondWithResult(_0x125047,null))[_0xf323('0x46')](handleError(_0x125047,null));};exports['create']=function(_0x2204f5,_0x8980f){return db['WhatsappApplication'][_0xf323('0x4a')](_0x2204f5[_0xf323('0x4b')],{})[_0xf323('0x28')](respondWithResult(_0x8980f,0xc9))[_0xf323('0x46')](handleError(_0x8980f,null));};exports[_0xf323('0x27')]=function(_0x950009,_0x34268e){if(_0x950009[_0xf323('0x4b')]['id']){delete _0x950009[_0xf323('0x4b')]['id'];}return db[_0xf323('0x30')][_0xf323('0x4c')]({'where':{'id':_0x950009[_0xf323('0x48')]['id']}})[_0xf323('0x28')](handleEntityNotFound(_0x34268e,null))['then'](saveUpdates(_0x950009[_0xf323('0x4b')],null))[_0xf323('0x28')](respondWithResult(_0x34268e,null))[_0xf323('0x46')](handleError(_0x34268e,null));};exports[_0xf323('0x29')]=function(_0x190e85,_0x1288b3){return db['WhatsappApplication'][_0xf323('0x4c')]({'where':{'id':_0x190e85[_0xf323('0x48')]['id']}})['then'](handleEntityNotFound(_0x1288b3,null))[_0xf323('0x28')](removeEntity(_0x1288b3,null))[_0xf323('0x46')](handleError(_0x1288b3,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0e9c76e..459785e 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 _0xc43c=['rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xc43c,0x152));var _0xcc43=function(_0x176945,_0x254207){_0x176945=_0x176945-0x0;var _0x40ec2a=_0xc43c[_0x176945];return _0x40ec2a;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require(_0xcc43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc43('0x6'));var rimraf=require(_0xcc43('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc43('0x8'));module[_0xcc43('0x9')]=function(_0x217a5e,_0x17d1a2){return _0x217a5e[_0xcc43('0xa')](_0xcc43('0xb'),attributes,{'tableName':_0xcc43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc43('0xd'),'collate':_0xcc43('0xe')});}; \ No newline at end of file +var _0xfc76=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappApplication.attributes','define','whatsapp_applications','utf8mb4'];(function(_0x264f02,_0x3f80a2){var _0x302576=function(_0x2ad0d6){while(--_0x2ad0d6){_0x264f02['push'](_0x264f02['shift']());}};_0x302576(++_0x3f80a2);}(_0xfc76,0xb5));var _0x6fc7=function(_0x157b61,_0x4a493b){_0x157b61=_0x157b61-0x0;var _0x1ef3cd=_0xfc76[_0x157b61];return _0x1ef3cd;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var BPromise=require(_0x6fc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc7('0x5'));var rimraf=require(_0x6fc7('0x6'));var config=require('../../config/environment');var attributes=require(_0x6fc7('0x7'));module['exports']=function(_0xe8177b,_0x82a35a){return _0xe8177b[_0x6fc7('0x8')]('WhatsappApplication',attributes,{'tableName':_0x6fc7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6fc7('0xa'),'collate':_0x6fc7('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e1f527e..184727b 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x008c,0x188));var _0xc008=function(_0x2fd56e,_0x168395){_0x2fd56e=_0x2fd56e-0x0;var _0x8562e8=_0x008c[_0x2fd56e];return _0x8562e8;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x436595,_0xaabd13){var _0xb037f9=function(_0x167be6){while(--_0x167be6){_0x436595['push'](_0x436595['shift']());}};_0xb037f9(++_0xaabd13);}(_0x54ef,0x112));var _0xf54e=function(_0x4dfa92,_0x3aa064){_0x4dfa92=_0x4dfa92-0x0;var _0x44d71a=_0x54ef[_0x4dfa92];return _0x44d71a;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 37aa42f..20d6c2e 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 _0x187d=['whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','tracked','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags'];(function(_0x2da60a,_0x42f7f2){var _0x384bf8=function(_0x23ad45){while(--_0x23ad45){_0x2da60a['push'](_0x2da60a['shift']());}};_0x384bf8(++_0x42f7f2);}(_0x187d,0x93));var _0xd187=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x187d[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0xb')](_0xd187('0x10'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0xb')]('/:id/download',auth[_0xd187('0x9')](),controller[_0xd187('0x12')]);router[_0xd187('0x13')]('/',auth['isAuthenticated'](),controller[_0xd187('0x14')]);router[_0xd187('0x13')](_0xd187('0x10'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);router[_0xd187('0x13')](_0xd187('0x16'),auth[_0xd187('0x9')](),interaction['tracked'](_0xd187('0x17'),_0xd187('0x18')),controller[_0xd187('0x19')]);router[_0xd187('0x1a')]('/:id',auth[_0xd187('0x9')](),interaction['tracked']('whatsapp',_0xd187('0x1b')),controller['update']);router['delete'](_0xd187('0xe'),auth[_0xd187('0x9')](),interaction[_0xd187('0x1c')](_0xd187('0x17'),_0xd187('0x1d')),controller[_0xd187('0x1e')]);router[_0xd187('0x1f')](_0xd187('0x16'),auth[_0xd187('0x9')](),controller[_0xd187('0x20')]);module[_0xd187('0x21')]=router; \ No newline at end of file +var _0xda19=['/:id/tags','removeTags','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','whatsappinteraction:addtags','put','/:id','tracked','whatsapp','update','delete'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xda19,0xd5));var _0x9da1=function(_0x4c7182,_0x2db9e4){_0x4c7182=_0x4c7182-0x0;var _0x335cd5=_0xda19[_0x4c7182];return _0x335cd5;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')]('/',auth[_0x9da1('0x8')](),controller[_0x9da1('0x9')]);router[_0x9da1('0x7')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router['get'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xe')]);router[_0x9da1('0x7')](_0x9da1('0xf'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9da1('0x11')]);router['post'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x12')]);router[_0x9da1('0x13')]('/:id/tags',auth[_0x9da1('0x8')](),interaction['tracked']('whatsapp',_0x9da1('0x14')),controller['addTags']);router[_0x9da1('0x15')](_0x9da1('0x16'),auth[_0x9da1('0x8')](),interaction[_0x9da1('0x17')](_0x9da1('0x18'),'whatsappinteraction:update'),controller[_0x9da1('0x19')]);router[_0x9da1('0x1a')](_0x9da1('0x16'),auth[_0x9da1('0x8')](),interaction[_0x9da1('0x17')](_0x9da1('0x18'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x9da1('0x1a')](_0x9da1('0x1b'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x1c')]);module[_0x9da1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index e911d29..345b423 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 _0x10af=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x58331c,_0x151ee3){var _0x2ba2f3=function(_0x37292e){while(--_0x37292e){_0x58331c['push'](_0x58331c['shift']());}};_0x2ba2f3(++_0x151ee3);}(_0x10af,0xfc));var _0xf10a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x10af[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xf10a('0x0'));var moment=require('moment');module[_0xf10a('0x1')]={'closed':{'type':Sequelize[_0xf10a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf10a('0x3')]},'disposition':{'type':Sequelize[_0xf10a('0x4')]},'secondDisposition':{'type':Sequelize[_0xf10a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf10a('0x4')]},'note':{'type':Sequelize[_0xf10a('0x4')]},'phone':{'type':Sequelize[_0xf10a('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xf10a('0x5')]('in',_0xf10a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf10a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf10a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6688=['DATE','STRING','out','BOOLEAN','sequelize','moment','exports'];(function(_0x22e4a5,_0x4b1dc1){var _0x2b3e4a=function(_0x4738d3){while(--_0x4738d3){_0x22e4a5['push'](_0x22e4a5['shift']());}};_0x2b3e4a(++_0x4b1dc1);}(_0x6688,0x10e));var _0x8668=function(_0x1e4817,_0xc9a546){_0x1e4817=_0x1e4817-0x0;var _0x94b227=_0x6688[_0x1e4817];return _0x94b227;};'use strict';var Sequelize=require(_0x8668('0x0'));var moment=require(_0x8668('0x1'));module[_0x8668('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8668('0x3')]},'disposition':{'type':Sequelize[_0x8668('0x4')]},'secondDisposition':{'type':Sequelize[_0x8668('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8668('0x4')]},'note':{'type':Sequelize[_0x8668('0x4')]},'phone':{'type':Sequelize[_0x8668('0x4')]},'read1stAt':{'type':Sequelize[_0x8668('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8668('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8668('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8668('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8668('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 0e8bf5f..3ea9faf 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 _0x23a9=['firstName','lastName','attachments','Attachment','Messages','createdAt','direction','read','Owner','mkdirSync','Whatsapp','N.A.','toString','closed','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','undefined','count','limit','update','then','destroy','end','sendStatus','stack','name','map','WhatsappInteraction','rawAttributes','fieldName','key','findAll','whatsapp','query','user','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','describe','addMessage','findOne','WhatsappMessage','filters','hasOwnProperty','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','setTags','omit','ids','spread','whatsappInteractionTags:save','removeTags','download','unix','root','server','join','files','push','User','fullname','CmContact','Contact'];(function(_0x2166e4,_0x1aee3a){var _0x11021c=function(_0x2b15a1){while(--_0x2b15a1){_0x2166e4['push'](_0x2166e4['shift']());}};_0x11021c(++_0x1aee3a);}(_0x23a9,0x119));var _0x923a=function(_0x199a2a,_0x527a17){_0x199a2a=_0x199a2a-0x0;var _0x2537d4=_0x23a9[_0x199a2a];return _0x2537d4;};'use strict';var rimraf=require(_0x923a('0x0'));var zipdir=require(_0x923a('0x1'));var moment=require(_0x923a('0x2'));var BPromise=require(_0x923a('0x3'));var util=require(_0x923a('0x4'));var path=require(_0x923a('0x5'));var ejs=require(_0x923a('0x6'));var fs=require('fs');var _=require(_0x923a('0x7'));var Redis=require(_0x923a('0x8'));var interaction=require(_0x923a('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x923a('0xa'));var logger=require(_0x923a('0xb'))(_0x923a('0xc'));var config=require(_0x923a('0xd'));var db=require(_0x923a('0xe'))['db'];config[_0x923a('0xf')]=_[_0x923a('0x10')](config['redis'],{'host':_0x923a('0x11'),'port':0x18eb});var socket=require(_0x923a('0x12'))(new Redis(config[_0x923a('0xf')]));require(_0x923a('0x13'))[_0x923a('0x14')](socket);function respondWithStatusCode(_0x109ac2,_0x58f938){_0x58f938=_0x58f938||0xcc;return function(_0x241c15){if(_0x241c15){return _0x109ac2['sendStatus'](_0x58f938);}return _0x109ac2['status'](_0x58f938)['end']();};}function respondWithResult(_0x5ba532,_0x336dd4){_0x336dd4=_0x336dd4||0xc8;return function(_0xb96886){if(_0xb96886){return _0x5ba532[_0x923a('0x15')](_0x336dd4)[_0x923a('0x16')](_0xb96886);}};}function respondWithFilteredResult(_0x5bcc30,_0x339278){return function(_0x5d68dd){if(_0x5d68dd){var _0x1b1429=typeof _0x339278[_0x923a('0x17')]===_0x923a('0x18')&&typeof _0x339278['limit']===_0x923a('0x18');var _0xe41f6e=_0x5d68dd[_0x923a('0x19')];var _0x1532c0=_0x1b1429?0x0:_0x339278[_0x923a('0x17')];var _0x4f15b6=_0x1b1429?_0x5d68dd['count']:_0x339278['offset']+_0x339278[_0x923a('0x1a')];var _0x3ee8e9;if(_0x4f15b6>=_0xe41f6e){_0x4f15b6=_0xe41f6e;_0x3ee8e9=0xc8;}else{_0x3ee8e9=0xce;}_0x5bcc30[_0x923a('0x15')](_0x3ee8e9);return _0x5bcc30['set']('Content-Range',_0x1532c0+'-'+_0x4f15b6+'/'+_0xe41f6e)[_0x923a('0x16')](_0x5d68dd);}return null;};}function saveUpdates(_0x1cdb1c){return function(_0x12d5df){if(_0x12d5df){return _0x12d5df[_0x923a('0x1b')](_0x1cdb1c)[_0x923a('0x1c')](function(_0x295681){return _0x295681;});}return null;};}function removeEntity(_0x14741d){return function(_0x1cddb5){if(_0x1cddb5){return _0x1cddb5[_0x923a('0x1d')]()[_0x923a('0x1c')](function(){_0x14741d['status'](0xcc)[_0x923a('0x1e')]();});}};}function handleEntityNotFound(_0x463c4b){return function(_0x4d4482){if(!_0x4d4482){_0x463c4b[_0x923a('0x1f')](0x194);}return _0x4d4482;};}function handleError(_0x1be567,_0x2421cf){_0x2421cf=_0x2421cf||0x1f4;return function(_0x40efc5){logger['error'](_0x40efc5[_0x923a('0x20')]);if(_0x40efc5[_0x923a('0x21')]){delete _0x40efc5[_0x923a('0x21')];}_0x1be567['status'](_0x2421cf)['send'](_0x40efc5);};}exports['index']=function(_0xaf5987,_0x242964){var _0x224c93={};var _0x17786f=_[_0x923a('0x22')](db[_0x923a('0x23')][_0x923a('0x24')],function(_0x2dd3b5){return{'name':_0x2dd3b5[_0x923a('0x25')],'type':_0x2dd3b5['type'][_0x923a('0x26')]};});_0x224c93=qs['getOptions'](_0x17786f,_0xaf5987);return interaction[_0x923a('0x27')](_0x923a('0x28'),_0xaf5987[_0x923a('0x29')],_0xaf5987[_0x923a('0x2a')],_0x224c93,_0x17786f)[_0x923a('0x1c')](respondWithFilteredResult(_0x242964,_0x224c93))[_0x923a('0x2b')](handleError(_0x242964,null));};exports[_0x923a('0x2c')]=function(_0x216818,_0x18d2a0){var _0x140edf={'raw':![],'where':{'id':_0x216818[_0x923a('0x2d')]['id']}},_0x2544b0={};_0x2544b0[_0x923a('0x2e')]=_[_0x923a('0x2f')](db[_0x923a('0x23')]['rawAttributes']);_0x2544b0[_0x923a('0x29')]=_[_0x923a('0x2f')](_0x216818['query']);_0x2544b0['filters']=_[_0x923a('0x30')](_0x2544b0[_0x923a('0x2e')],_0x2544b0[_0x923a('0x29')]);_0x140edf[_0x923a('0x31')]=_[_0x923a('0x30')](_0x2544b0[_0x923a('0x2e')],qs['fields'](_0x216818[_0x923a('0x29')][_0x923a('0x32')]));_0x140edf[_0x923a('0x31')]=_0x140edf['attributes'][_0x923a('0x33')]?_0x140edf[_0x923a('0x31')]:_0x2544b0[_0x923a('0x2e')];if(_0x216818['query'][_0x923a('0x34')]){_0x140edf[_0x923a('0x35')]=[{'all':!![]}];}_0x140edf=_[_0x923a('0x36')]({},_0x140edf,_0x216818['options']);return db[_0x923a('0x23')][_0x923a('0x37')](_0x140edf)['then'](handleEntityNotFound(_0x18d2a0,null))[_0x923a('0x1c')](respondWithResult(_0x18d2a0,null))[_0x923a('0x2b')](handleError(_0x18d2a0,null));};exports['create']=function(_0x3459fb,_0x966888){return db[_0x923a('0x23')][_0x923a('0x38')](_0x3459fb[_0x923a('0x39')],{})[_0x923a('0x1c')](respondWithResult(_0x966888,0xc9))[_0x923a('0x2b')](handleError(_0x966888,null));};exports['update']=function(_0x3362d4,_0x27e602){if(_0x3362d4[_0x923a('0x39')]['id']){delete _0x3362d4[_0x923a('0x39')]['id'];}return db[_0x923a('0x23')][_0x923a('0x37')]({'where':{'id':_0x3362d4['params']['id']}})['then'](handleEntityNotFound(_0x27e602,null))[_0x923a('0x1c')](saveUpdates(_0x3362d4[_0x923a('0x39')],null))[_0x923a('0x1c')](respondWithResult(_0x27e602,null))[_0x923a('0x2b')](handleError(_0x27e602,null));};exports[_0x923a('0x1d')]=function(_0x373cdf,_0x3d847e){return db[_0x923a('0x23')][_0x923a('0x37')]({'where':{'id':_0x373cdf[_0x923a('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3d847e,null))['then'](removeEntity(_0x3d847e,null))[_0x923a('0x2b')](handleError(_0x3d847e,null));};exports[_0x923a('0x3a')]=function(_0x2f6dba,_0x3168bf){return db[_0x923a('0x23')][_0x923a('0x3a')]()[_0x923a('0x1c')](respondWithResult(_0x3168bf,null))[_0x923a('0x2b')](handleError(_0x3168bf,null));};exports['addMessage']=function(_0x5ec7f1,_0x4a76ae){return db['WhatsappMessage'][_0x923a('0x37')]({'where':{'id':_0x5ec7f1[_0x923a('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4a76ae,null))[_0x923a('0x1c')](function(_0x3af81a){if(_0x3af81a){return _0x3af81a[_0x923a('0x3b')](_0x5ec7f1['body']['ids'],_['omit'](_0x5ec7f1['body'],['ids','id'])||{});}})[_0x923a('0x1c')](respondWithResult(_0x4a76ae,null))[_0x923a('0x2b')](handleError(_0x4a76ae,null));};exports['getMessages']=function(_0x2ff6b0,_0x2ef702){var _0x2dcf60={'raw':![],'where':{}};var _0x355607={};var _0x12bf19={'count':0x0,'rows':[]};return db[_0x923a('0x23')][_0x923a('0x3c')]({'where':{'id':_0x2ff6b0[_0x923a('0x2d')]['id']}})[_0x923a('0x1c')](handleEntityNotFound(_0x2ef702,null))[_0x923a('0x1c')](function(_0x535f6c){if(_0x535f6c){_0x355607[_0x923a('0x2e')]=_[_0x923a('0x2f')](db[_0x923a('0x3d')][_0x923a('0x24')]);_0x355607[_0x923a('0x29')]=_[_0x923a('0x2f')](_0x2ff6b0[_0x923a('0x29')]);_0x355607[_0x923a('0x3e')]=_['intersection'](_0x355607[_0x923a('0x2e')],_0x355607['query']);_0x2dcf60[_0x923a('0x31')]=_[_0x923a('0x30')](_0x355607['model'],qs[_0x923a('0x32')](_0x2ff6b0[_0x923a('0x29')][_0x923a('0x32')]));_0x2dcf60['attributes']=_0x2dcf60[_0x923a('0x31')][_0x923a('0x33')]?_0x2dcf60['attributes']:_0x355607[_0x923a('0x2e')];if(!_0x2ff6b0[_0x923a('0x29')][_0x923a('0x3f')]('nolimit')){_0x2dcf60[_0x923a('0x1a')]=qs['limit'](_0x2ff6b0[_0x923a('0x29')][_0x923a('0x1a')]);_0x2dcf60[_0x923a('0x17')]=qs[_0x923a('0x17')](_0x2ff6b0[_0x923a('0x29')][_0x923a('0x17')]);}_0x2dcf60['order']=qs[_0x923a('0x40')](_0x2ff6b0[_0x923a('0x29')][_0x923a('0x40')]);_0x2dcf60[_0x923a('0x41')]=qs[_0x923a('0x3e')](_[_0x923a('0x42')](_0x2ff6b0['query'],_0x355607[_0x923a('0x3e')]));_0x2dcf60[_0x923a('0x41')][_0x923a('0x43')]=_0x535f6c['id'];if(_0x2ff6b0[_0x923a('0x29')]['filter']){_0x2dcf60['where']=_['merge'](_0x2dcf60['where'],{'$or':_[_0x923a('0x22')](_0x2dcf60[_0x923a('0x31')],function(_0x57d99c){var _0x4f67d7={};_0x4f67d7[_0x57d99c]={'$like':'%'+_0x2ff6b0[_0x923a('0x29')][_0x923a('0x44')]+'%'};return _0x4f67d7;})});}if(_0x2ff6b0[_0x923a('0x29')]['$gte']){var _0x2b2be0=_0x2ff6b0[_0x923a('0x29')][_0x923a('0x45')][_0x923a('0x46')](',');var _0x429a69={};_0x429a69[_0x2b2be0[0x0]]={'$gte':moment(_0x2b2be0[0x1])[_0x923a('0x47')](_0x923a('0x48'))};_0x2dcf60[_0x923a('0x41')]=_[_0x923a('0x36')](_0x2dcf60['where'],_0x429a69);}_0x2dcf60=_[_0x923a('0x36')]({},_0x2dcf60,_0x2ff6b0[_0x923a('0x49')]);return db[_0x923a('0x3d')][_0x923a('0x19')]({'where':_0x2dcf60[_0x923a('0x41')]})['then'](function(_0x3f9fb3){_0x12bf19[_0x923a('0x19')]=_0x3f9fb3;if(_0x2ff6b0['query'][_0x923a('0x34')]){_0x2dcf60[_0x923a('0x35')]=[{'all':!![]}];}return db[_0x923a('0x3d')][_0x923a('0x27')](_0x2dcf60);})[_0x923a('0x1c')](function(_0x4d1147){_0x12bf19['rows']=_0x4d1147;return _0x12bf19;});}})[_0x923a('0x1c')](respondWithFilteredResult(_0x2ef702,_0x2dcf60))[_0x923a('0x2b')](handleError(_0x2ef702,null));};exports['addTags']=function(_0x3085e4,_0xa78b19){return db[_0x923a('0x23')][_0x923a('0x37')]({'where':{'id':_0x3085e4[_0x923a('0x2d')]['id']}})[_0x923a('0x1c')](handleEntityNotFound(_0xa78b19,null))[_0x923a('0x1c')](function(_0x36d895){if(_0x36d895){return _0x36d895[_0x923a('0x4a')](_0x3085e4['body']['ids'],_[_0x923a('0x4b')](_0x3085e4[_0x923a('0x39')],[_0x923a('0x4c'),'id'])||{})[_0x923a('0x4d')](function(){return db['Tag'][_0x923a('0x27')]({'attributes':['id',_0x923a('0x21'),'color'],'where':{'id':_0x3085e4['body'][_0x923a('0x4c')]}});})['then'](function(_0x24c1ee){socket['emit'](_0x923a('0x4e'),{'id':Number(_0x3085e4['params']['id']),'tags':_0x24c1ee||[]});return{'id':Number(_0x3085e4['params']['id']),'tags':_0x24c1ee||[]};});}})[_0x923a('0x1c')](respondWithResult(_0xa78b19,null))['catch'](handleError(_0xa78b19,null));};exports[_0x923a('0x4f')]=function(_0x20e0a0,_0x164c43){return db[_0x923a('0x23')][_0x923a('0x37')]({'where':{'id':_0x20e0a0[_0x923a('0x2d')]['id']}})[_0x923a('0x1c')](handleEntityNotFound(_0x164c43,null))['then'](function(_0x4f54b5){if(_0x4f54b5){return _0x4f54b5[_0x923a('0x4f')](_0x20e0a0[_0x923a('0x29')][_0x923a('0x4c')]);}})[_0x923a('0x1c')](respondWithStatusCode(_0x164c43,null))['catch'](handleError(_0x164c43,null));};exports[_0x923a('0x50')]=function(_0x2e4bc8,_0x16ef92){var _0x45f97c=moment()[_0x923a('0x51')]()['toString']();var _0x5c3b90=path['join'](config[_0x923a('0x52')],_0x923a('0x53'),'files','tmp');var _0x50952e=path[_0x923a('0x54')](config[_0x923a('0x52')],_0x923a('0x53'),_0x923a('0x55'),'attachments');var _0x5ef0a3=path['join'](_0x5c3b90,_0x45f97c);var _0x2ac7f7=util['format']('transcript-%d-%s.zip',_0x2e4bc8[_0x923a('0x2d')]['id'],_0x45f97c);var _0x572497=path[_0x923a('0x54')](_0x5c3b90,_0x2ac7f7);var _0x17266b=[];_0x17266b[_0x923a('0x56')]({'model':db[_0x923a('0x57')],'as':_0x923a('0x57'),'attributes':['id',_0x923a('0x58')],'raw':!![]});_0x17266b[_0x923a('0x56')]({'model':db[_0x923a('0x59')],'as':_0x923a('0x5a'),'attributes':['id',_0x923a('0x5b'),_0x923a('0x5c')],'raw':!![]});if(_0x2e4bc8[_0x923a('0x29')][_0x923a('0x5d')]){_0x17266b['push']({'model':db[_0x923a('0x5e')],'as':_0x923a('0x5e'),'raw':!![]});}var _0x276b44=[{'model':db[_0x923a('0x3d')],'as':_0x923a('0x5f'),'attributes':['id','body',_0x923a('0x60'),_0x923a('0x61'),'secret',_0x923a('0x62')],'include':_0x17266b}];_0x276b44[_0x923a('0x56')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x923a('0x21')]});_0x276b44[_0x923a('0x56')]({'model':db[_0x923a('0x57')],'as':_0x923a('0x63'),'attributes':['id','fullname']});return db[_0x923a('0x23')]['find']({'where':{'id':_0x2e4bc8[_0x923a('0x2d')]['id']},'include':_0x276b44})['then'](handleEntityNotFound(_0x16ef92,null))[_0x923a('0x1c')](function(_0x4e91d8){if(_0x4e91d8){var _0x36ef28=_0x4e91d8['get']({'plain':!![]});fs[_0x923a('0x64')](_0x5ef0a3);var _0x3f5c06={'channel':_0x923a('0x65'),'account':_0x36ef28['Account'][_0x923a('0x21')],'agent':_0x36ef28['Owner']?_0x36ef28['Owner'][_0x923a('0x58')]:_0x923a('0x66'),'createdAt':moment(_0x36ef28['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x923a('0x67')](),'closedAt':_0x36ef28[_0x923a('0x68')]?moment(_0x36ef28[_0x923a('0x69')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x923a('0x67')]():'','disposition':_0x36ef28[_0x923a('0x6a')],'messages':_(_0x36ef28[_0x923a('0x5f')])[_0x923a('0x44')]({'secret':![]})[_0x923a('0x22')](function(_0x13f769){if(_0x13f769[_0x923a('0x5e')]){var _0x42fbbd=path[_0x923a('0x54')](_0x50952e,_0x13f769['Attachment']['basename']);if(fs[_0x923a('0x6b')](_0x42fbbd)){fs[_0x923a('0x6c')](_0x42fbbd)[_0x923a('0x6d')](fs[_0x923a('0x6e')](path[_0x923a('0x54')](_0x5ef0a3,_0x13f769['Attachment'][_0x923a('0x6f')])));}}return{'date':moment(_0x13f769[_0x923a('0x60')])['format'](_0x923a('0x48'))[_0x923a('0x67')](),'sender':_0x13f769[_0x923a('0x61')]===_0x923a('0x70')?_0x13f769[_0x923a('0x57')]?_0x13f769[_0x923a('0x57')][_0x923a('0x58')]:_0x923a('0x71'):_0x13f769[_0x923a('0x5a')][_0x923a('0x5b')]+(_0x13f769[_0x923a('0x5a')][_0x923a('0x5c')]?'\x20'+_0x13f769[_0x923a('0x5a')]['lastName']:''),'body':_0x13f769[_0x923a('0x5e')]?_0x13f769[_0x923a('0x5e')]['basename']:_0x13f769[_0x923a('0x39')],'direction':_0x13f769['direction']==='out'?'A':'C','secret':_0x13f769[_0x923a('0x72')],'read':_0x13f769[_0x923a('0x62')],'attachment':_0x13f769['Attachment']};})[_0x923a('0x73')]()};return ejs[_0x923a('0x74')](path[_0x923a('0x54')](config[_0x923a('0x52')],_0x923a('0x53'),_0x923a('0x75'),_0x923a('0x76')),{'interaction':_0x3f5c06})[_0x923a('0x1c')](function(_0x495dd5){var _0x4bb1b0=path[_0x923a('0x54')](_0x5ef0a3,_0x923a('0x77')+_0x36ef28['id']+'-'+_0x45f97c+_0x923a('0x78'));var _0x2cfb68={'path':_0x4bb1b0,'channel':'Whatsapp','interactionId':_0x36ef28['id']};return pdf['createPdfFromHTML'](_0x495dd5,_0x2cfb68);})[_0x923a('0x1c')](function(){return new BPromise(function(_0x170114,_0x4698c5){zipdir(_0x5ef0a3,{'saveTo':_0x572497},function(_0x3c0897,_0x49e75f){if(_0x3c0897)return _0x4698c5(_0x3c0897);return _0x170114(_0x49e75f);});})[_0x923a('0x1c')](function(){return new BPromise(function(_0x2dfe72,_0x4bcdb6){rimraf(_0x5ef0a3,function(_0x5b0857){if(_0x5b0857)_0x4bcdb6(_0x5b0857);return _0x2dfe72();});});})[_0x923a('0x1c')](function(){return _0x16ef92[_0x923a('0x50')](_0x572497,_0x2ac7f7,function(_0x2d7a4c){if(_0x2d7a4c){console[_0x923a('0x79')](_0x923a('0x7a'),_0x2d7a4c);}else{fs[_0x923a('0x7b')](_0x572497);}});});});}else{return _0x16ef92['sendStatus'](0xc8);}})[_0x923a('0x2b')](handleError(_0x16ef92,null));}; \ No newline at end of file +var _0x0b3a=['transcript-%d-%s.zip','User','fullname','push','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','Owner','get','mkdirSync','Whatsapp','Account','toString','closed','disposition','Attachment','basename','existsSync','createReadStream','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','offset','undefined','count','Content-Range','json','update','then','stack','name','send','rawAttributes','getOptions','findAll','whatsapp','query','catch','show','params','keys','WhatsappInteraction','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','destroy','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','tmp','files','attachments','join'];(function(_0x238733,_0x3d9dc5){var _0x269f89=function(_0x47d16d){while(--_0x47d16d){_0x238733['push'](_0x238733['shift']());}};_0x269f89(++_0x3d9dc5);}(_0x0b3a,0x114));var _0xa0b3=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x0b3a[_0x217ff6];return _0x417c93;};'use strict';var rimraf=require(_0xa0b3('0x0'));var zipdir=require('zip-dir');var moment=require(_0xa0b3('0x1'));var BPromise=require(_0xa0b3('0x2'));var util=require(_0xa0b3('0x3'));var path=require(_0xa0b3('0x4'));var ejs=require(_0xa0b3('0x5'));var fs=require('fs');var _=require(_0xa0b3('0x6'));var Redis=require(_0xa0b3('0x7'));var interaction=require(_0xa0b3('0x8'));var qs=require(_0xa0b3('0x9'));var pdf=require(_0xa0b3('0xa'));var logger=require('../../config/logger')(_0xa0b3('0xb'));var config=require(_0xa0b3('0xc'));var db=require('../../mysqldb')['db'];config[_0xa0b3('0xd')]=_[_0xa0b3('0xe')](config['redis'],{'host':_0xa0b3('0xf'),'port':0x18eb});var socket=require(_0xa0b3('0x10'))(new Redis(config[_0xa0b3('0xd')]));require(_0xa0b3('0x11'))[_0xa0b3('0x12')](socket);function respondWithStatusCode(_0x469f98,_0x11a0fc){_0x11a0fc=_0x11a0fc||0xcc;return function(_0x226bf4){if(_0x226bf4){return _0x469f98[_0xa0b3('0x13')](_0x11a0fc);}return _0x469f98['status'](_0x11a0fc)[_0xa0b3('0x14')]();};}function respondWithResult(_0x3c1242,_0x405c69){_0x405c69=_0x405c69||0xc8;return function(_0x5eac01){if(_0x5eac01){return _0x3c1242[_0xa0b3('0x15')](_0x405c69)['json'](_0x5eac01);}};}function respondWithFilteredResult(_0x279c95,_0x317c05){return function(_0x3debf1){if(_0x3debf1){var _0xe258ac=typeof _0x317c05[_0xa0b3('0x16')]===_0xa0b3('0x17')&&typeof _0x317c05['limit']===_0xa0b3('0x17');var _0x3f23a8=_0x3debf1['count'];var _0x568007=_0xe258ac?0x0:_0x317c05[_0xa0b3('0x16')];var _0x6a79f2=_0xe258ac?_0x3debf1[_0xa0b3('0x18')]:_0x317c05[_0xa0b3('0x16')]+_0x317c05['limit'];var _0x7b079;if(_0x6a79f2>=_0x3f23a8){_0x6a79f2=_0x3f23a8;_0x7b079=0xc8;}else{_0x7b079=0xce;}_0x279c95[_0xa0b3('0x15')](_0x7b079);return _0x279c95['set'](_0xa0b3('0x19'),_0x568007+'-'+_0x6a79f2+'/'+_0x3f23a8)[_0xa0b3('0x1a')](_0x3debf1);}return null;};}function saveUpdates(_0x1e3c39){return function(_0x23e490){if(_0x23e490){return _0x23e490[_0xa0b3('0x1b')](_0x1e3c39)[_0xa0b3('0x1c')](function(_0x4b21a0){return _0x4b21a0;});}return null;};}function removeEntity(_0x426b91){return function(_0x1a6e0b){if(_0x1a6e0b){return _0x1a6e0b['destroy']()[_0xa0b3('0x1c')](function(){_0x426b91[_0xa0b3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d28c5){return function(_0x42e7e0){if(!_0x42e7e0){_0x4d28c5['sendStatus'](0x194);}return _0x42e7e0;};}function handleError(_0x354be1,_0x3f3560){_0x3f3560=_0x3f3560||0x1f4;return function(_0x394a04){logger['error'](_0x394a04[_0xa0b3('0x1d')]);if(_0x394a04[_0xa0b3('0x1e')]){delete _0x394a04[_0xa0b3('0x1e')];}_0x354be1[_0xa0b3('0x15')](_0x3f3560)[_0xa0b3('0x1f')](_0x394a04);};}exports['index']=function(_0x43db5c,_0xca2546){var _0x5f08f0={};var _0x3e8ff0=_['map'](db['WhatsappInteraction'][_0xa0b3('0x20')],function(_0x491638){return{'name':_0x491638['fieldName'],'type':_0x491638['type']['key']};});_0x5f08f0=qs[_0xa0b3('0x21')](_0x3e8ff0,_0x43db5c);return interaction[_0xa0b3('0x22')](_0xa0b3('0x23'),_0x43db5c[_0xa0b3('0x24')],_0x43db5c['user'],_0x5f08f0,_0x3e8ff0)[_0xa0b3('0x1c')](respondWithFilteredResult(_0xca2546,_0x5f08f0))[_0xa0b3('0x25')](handleError(_0xca2546,null));};exports[_0xa0b3('0x26')]=function(_0x383eb2,_0x81fd75){var _0x48ca71={'raw':![],'where':{'id':_0x383eb2[_0xa0b3('0x27')]['id']}},_0x272464={};_0x272464['model']=_[_0xa0b3('0x28')](db[_0xa0b3('0x29')][_0xa0b3('0x20')]);_0x272464['query']=_['keys'](_0x383eb2[_0xa0b3('0x24')]);_0x272464[_0xa0b3('0x2a')]=_[_0xa0b3('0x2b')](_0x272464[_0xa0b3('0x2c')],_0x272464['query']);_0x48ca71[_0xa0b3('0x2d')]=_[_0xa0b3('0x2b')](_0x272464[_0xa0b3('0x2c')],qs[_0xa0b3('0x2e')](_0x383eb2[_0xa0b3('0x24')]['fields']));_0x48ca71[_0xa0b3('0x2d')]=_0x48ca71['attributes'][_0xa0b3('0x2f')]?_0x48ca71[_0xa0b3('0x2d')]:_0x272464[_0xa0b3('0x2c')];if(_0x383eb2[_0xa0b3('0x24')][_0xa0b3('0x30')]){_0x48ca71['include']=[{'all':!![]}];}_0x48ca71=_[_0xa0b3('0x31')]({},_0x48ca71,_0x383eb2[_0xa0b3('0x32')]);return db[_0xa0b3('0x29')][_0xa0b3('0x33')](_0x48ca71)[_0xa0b3('0x1c')](handleEntityNotFound(_0x81fd75,null))[_0xa0b3('0x1c')](respondWithResult(_0x81fd75,null))[_0xa0b3('0x25')](handleError(_0x81fd75,null));};exports[_0xa0b3('0x34')]=function(_0x4b1a73,_0x2b0395){return db['WhatsappInteraction'][_0xa0b3('0x34')](_0x4b1a73[_0xa0b3('0x35')],{})[_0xa0b3('0x1c')](respondWithResult(_0x2b0395,0xc9))[_0xa0b3('0x25')](handleError(_0x2b0395,null));};exports[_0xa0b3('0x1b')]=function(_0x4e7483,_0x4a9361){if(_0x4e7483[_0xa0b3('0x35')]['id']){delete _0x4e7483[_0xa0b3('0x35')]['id'];}return db[_0xa0b3('0x29')][_0xa0b3('0x33')]({'where':{'id':_0x4e7483[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x4a9361,null))[_0xa0b3('0x1c')](saveUpdates(_0x4e7483[_0xa0b3('0x35')],null))['then'](respondWithResult(_0x4a9361,null))[_0xa0b3('0x25')](handleError(_0x4a9361,null));};exports[_0xa0b3('0x36')]=function(_0xb768c9,_0x3c75fb){return db[_0xa0b3('0x29')][_0xa0b3('0x33')]({'where':{'id':_0xb768c9[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x3c75fb,null))[_0xa0b3('0x1c')](removeEntity(_0x3c75fb,null))[_0xa0b3('0x25')](handleError(_0x3c75fb,null));};exports['describe']=function(_0x1ed751,_0x3fc197){return db['WhatsappInteraction']['describe']()[_0xa0b3('0x1c')](respondWithResult(_0x3fc197,null))[_0xa0b3('0x25')](handleError(_0x3fc197,null));};exports[_0xa0b3('0x37')]=function(_0x10495c,_0x58aad4){return db[_0xa0b3('0x38')][_0xa0b3('0x33')]({'where':{'id':_0x10495c[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x58aad4,null))[_0xa0b3('0x1c')](function(_0x3c788c){if(_0x3c788c){return _0x3c788c[_0xa0b3('0x37')](_0x10495c[_0xa0b3('0x35')][_0xa0b3('0x39')],_[_0xa0b3('0x3a')](_0x10495c[_0xa0b3('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x58aad4,null))[_0xa0b3('0x25')](handleError(_0x58aad4,null));};exports[_0xa0b3('0x3b')]=function(_0x58393c,_0x347c87){var _0x4af8ee={'raw':![],'where':{}};var _0x3c240a={};var _0x245323={'count':0x0,'rows':[]};return db[_0xa0b3('0x29')][_0xa0b3('0x3c')]({'where':{'id':_0x58393c[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x347c87,null))[_0xa0b3('0x1c')](function(_0x58db75){if(_0x58db75){_0x3c240a['model']=_[_0xa0b3('0x28')](db[_0xa0b3('0x38')][_0xa0b3('0x20')]);_0x3c240a[_0xa0b3('0x24')]=_['keys'](_0x58393c[_0xa0b3('0x24')]);_0x3c240a['filters']=_[_0xa0b3('0x2b')](_0x3c240a['model'],_0x3c240a['query']);_0x4af8ee[_0xa0b3('0x2d')]=_[_0xa0b3('0x2b')](_0x3c240a[_0xa0b3('0x2c')],qs[_0xa0b3('0x2e')](_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x2e')]));_0x4af8ee[_0xa0b3('0x2d')]=_0x4af8ee[_0xa0b3('0x2d')]['length']?_0x4af8ee[_0xa0b3('0x2d')]:_0x3c240a['model'];if(!_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x3d')](_0xa0b3('0x3e'))){_0x4af8ee[_0xa0b3('0x3f')]=qs[_0xa0b3('0x3f')](_0x58393c[_0xa0b3('0x24')]['limit']);_0x4af8ee[_0xa0b3('0x16')]=qs[_0xa0b3('0x16')](_0x58393c['query'][_0xa0b3('0x16')]);}_0x4af8ee[_0xa0b3('0x40')]=qs['sort'](_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x41')]);_0x4af8ee['where']=qs[_0xa0b3('0x2a')](_['pick'](_0x58393c[_0xa0b3('0x24')],_0x3c240a[_0xa0b3('0x2a')]));_0x4af8ee[_0xa0b3('0x42')]['WhatsappInteractionId']=_0x58db75['id'];if(_0x58393c['query'][_0xa0b3('0x43')]){_0x4af8ee[_0xa0b3('0x42')]=_[_0xa0b3('0x31')](_0x4af8ee[_0xa0b3('0x42')],{'$or':_[_0xa0b3('0x44')](_0x4af8ee[_0xa0b3('0x2d')],function(_0x21b565){var _0x36da16={};_0x36da16[_0x21b565]={'$like':'%'+_0x58393c[_0xa0b3('0x24')]['filter']+'%'};return _0x36da16;})});}if(_0x58393c[_0xa0b3('0x24')]['$gte']){var _0x1c6c1b=_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x45')][_0xa0b3('0x46')](',');var _0x4c752d={};_0x4c752d[_0x1c6c1b[0x0]]={'$gte':moment(_0x1c6c1b[0x1])[_0xa0b3('0x47')](_0xa0b3('0x48'))};_0x4af8ee[_0xa0b3('0x42')]=_[_0xa0b3('0x31')](_0x4af8ee[_0xa0b3('0x42')],_0x4c752d);}_0x4af8ee=_['merge']({},_0x4af8ee,_0x58393c[_0xa0b3('0x32')]);return db[_0xa0b3('0x38')]['count']({'where':_0x4af8ee['where']})[_0xa0b3('0x1c')](function(_0x1f61a4){_0x245323[_0xa0b3('0x18')]=_0x1f61a4;if(_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x30')]){_0x4af8ee[_0xa0b3('0x49')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4af8ee);})[_0xa0b3('0x1c')](function(_0x1d8c1b){_0x245323['rows']=_0x1d8c1b;return _0x245323;});}})['then'](respondWithFilteredResult(_0x347c87,_0x4af8ee))[_0xa0b3('0x25')](handleError(_0x347c87,null));};exports[_0xa0b3('0x4a')]=function(_0x9fc589,_0x4125d4){return db[_0xa0b3('0x29')]['find']({'where':{'id':_0x9fc589['params']['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x4125d4,null))['then'](function(_0x5799d3){if(_0x5799d3){return _0x5799d3['setTags'](_0x9fc589[_0xa0b3('0x35')]['ids'],_[_0xa0b3('0x3a')](_0x9fc589[_0xa0b3('0x35')],[_0xa0b3('0x39'),'id'])||{})['spread'](function(){return db[_0xa0b3('0x4b')]['findAll']({'attributes':['id',_0xa0b3('0x1e'),'color'],'where':{'id':_0x9fc589[_0xa0b3('0x35')][_0xa0b3('0x39')]}});})[_0xa0b3('0x1c')](function(_0x4b76fb){socket[_0xa0b3('0x4c')](_0xa0b3('0x4d'),{'id':Number(_0x9fc589[_0xa0b3('0x27')]['id']),'tags':_0x4b76fb||[]});return{'id':Number(_0x9fc589[_0xa0b3('0x27')]['id']),'tags':_0x4b76fb||[]};});}})[_0xa0b3('0x1c')](respondWithResult(_0x4125d4,null))[_0xa0b3('0x25')](handleError(_0x4125d4,null));};exports[_0xa0b3('0x4e')]=function(_0x19f2ff,_0x6ee749){return db['WhatsappInteraction']['find']({'where':{'id':_0x19f2ff['params']['id']}})['then'](handleEntityNotFound(_0x6ee749,null))[_0xa0b3('0x1c')](function(_0x3787fa){if(_0x3787fa){return _0x3787fa[_0xa0b3('0x4e')](_0x19f2ff[_0xa0b3('0x24')][_0xa0b3('0x39')]);}})[_0xa0b3('0x1c')](respondWithStatusCode(_0x6ee749,null))[_0xa0b3('0x25')](handleError(_0x6ee749,null));};exports[_0xa0b3('0x4f')]=function(_0x27dd76,_0x19bfd2){var _0x47e32a=moment()[_0xa0b3('0x50')]()['toString']();var _0x151b63=path['join'](config[_0xa0b3('0x51')],_0xa0b3('0x52'),'files',_0xa0b3('0x53'));var _0x25693d=path['join'](config[_0xa0b3('0x51')],_0xa0b3('0x52'),_0xa0b3('0x54'),_0xa0b3('0x55'));var _0x2d5651=path[_0xa0b3('0x56')](_0x151b63,_0x47e32a);var _0x891b96=util['format'](_0xa0b3('0x57'),_0x27dd76[_0xa0b3('0x27')]['id'],_0x47e32a);var _0x2a2441=path[_0xa0b3('0x56')](_0x151b63,_0x891b96);var _0x2dc31e=[];_0x2dc31e['push']({'model':db[_0xa0b3('0x58')],'as':'User','attributes':['id',_0xa0b3('0x59')],'raw':!![]});_0x2dc31e[_0xa0b3('0x5a')]({'model':db['CmContact'],'as':_0xa0b3('0x5b'),'attributes':['id',_0xa0b3('0x5c'),_0xa0b3('0x5d')],'raw':!![]});if(_0x27dd76[_0xa0b3('0x24')]['attachments']){_0x2dc31e[_0xa0b3('0x5a')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x348cfc=[{'model':db['WhatsappMessage'],'as':_0xa0b3('0x5e'),'attributes':['id',_0xa0b3('0x35'),_0xa0b3('0x5f'),_0xa0b3('0x60'),_0xa0b3('0x61'),_0xa0b3('0x62')],'include':_0x2dc31e}];_0x348cfc[_0xa0b3('0x5a')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xa0b3('0x1e')]});_0x348cfc[_0xa0b3('0x5a')]({'model':db[_0xa0b3('0x58')],'as':_0xa0b3('0x63'),'attributes':['id',_0xa0b3('0x59')]});return db[_0xa0b3('0x29')]['find']({'where':{'id':_0x27dd76[_0xa0b3('0x27')]['id']},'include':_0x348cfc})[_0xa0b3('0x1c')](handleEntityNotFound(_0x19bfd2,null))[_0xa0b3('0x1c')](function(_0x4d4589){if(_0x4d4589){var _0x4cb3a8=_0x4d4589[_0xa0b3('0x64')]({'plain':!![]});fs[_0xa0b3('0x65')](_0x2d5651);var _0x309a23={'channel':_0xa0b3('0x66'),'account':_0x4cb3a8[_0xa0b3('0x67')][_0xa0b3('0x1e')],'agent':_0x4cb3a8[_0xa0b3('0x63')]?_0x4cb3a8[_0xa0b3('0x63')][_0xa0b3('0x59')]:'N.A.','createdAt':moment(_0x4cb3a8[_0xa0b3('0x5f')])[_0xa0b3('0x47')](_0xa0b3('0x48'))[_0xa0b3('0x68')](),'closedAt':_0x4cb3a8[_0xa0b3('0x69')]?moment(_0x4cb3a8['closedAt'])[_0xa0b3('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa0b3('0x68')]():'','disposition':_0x4cb3a8[_0xa0b3('0x6a')],'messages':_(_0x4cb3a8[_0xa0b3('0x5e')])['filter']({'secret':![]})[_0xa0b3('0x44')](function(_0x64fb06){if(_0x64fb06[_0xa0b3('0x6b')]){var _0x610ad2=path[_0xa0b3('0x56')](_0x25693d,_0x64fb06[_0xa0b3('0x6b')][_0xa0b3('0x6c')]);if(fs[_0xa0b3('0x6d')](_0x610ad2)){fs[_0xa0b3('0x6e')](_0x610ad2)['pipe'](fs[_0xa0b3('0x6f')](path['join'](_0x2d5651,_0x64fb06[_0xa0b3('0x6b')]['basename'])));}}return{'date':moment(_0x64fb06[_0xa0b3('0x5f')])[_0xa0b3('0x47')](_0xa0b3('0x48'))[_0xa0b3('0x68')](),'sender':_0x64fb06[_0xa0b3('0x60')]===_0xa0b3('0x70')?_0x64fb06[_0xa0b3('0x58')]?_0x64fb06[_0xa0b3('0x58')][_0xa0b3('0x59')]:_0xa0b3('0x71'):_0x64fb06[_0xa0b3('0x5b')][_0xa0b3('0x5c')]+(_0x64fb06[_0xa0b3('0x5b')][_0xa0b3('0x5d')]?'\x20'+_0x64fb06[_0xa0b3('0x5b')]['lastName']:''),'body':_0x64fb06[_0xa0b3('0x6b')]?_0x64fb06[_0xa0b3('0x6b')][_0xa0b3('0x6c')]:_0x64fb06[_0xa0b3('0x35')],'direction':_0x64fb06['direction']===_0xa0b3('0x70')?'A':'C','secret':_0x64fb06['secret'],'read':_0x64fb06[_0xa0b3('0x62')],'attachment':_0x64fb06[_0xa0b3('0x6b')]};})['value']()};return ejs[_0xa0b3('0x72')](path[_0xa0b3('0x56')](config[_0xa0b3('0x51')],_0xa0b3('0x52'),_0xa0b3('0x73'),_0xa0b3('0x74')),{'interaction':_0x309a23})[_0xa0b3('0x1c')](function(_0x44361b){var _0x4e2a14=path[_0xa0b3('0x56')](_0x2d5651,_0xa0b3('0x75')+_0x4cb3a8['id']+'-'+_0x47e32a+'.pdf');var _0x37e32f={'path':_0x4e2a14,'channel':_0xa0b3('0x66'),'interactionId':_0x4cb3a8['id']};return pdf[_0xa0b3('0x76')](_0x44361b,_0x37e32f);})[_0xa0b3('0x1c')](function(){return new BPromise(function(_0x281ce9,_0x21fa8e){zipdir(_0x2d5651,{'saveTo':_0x2a2441},function(_0x127274,_0x313797){if(_0x127274)return _0x21fa8e(_0x127274);return _0x281ce9(_0x313797);});})[_0xa0b3('0x1c')](function(){return new BPromise(function(_0x2aee52,_0x169598){rimraf(_0x2d5651,function(_0x6f7a4){if(_0x6f7a4)_0x169598(_0x6f7a4);return _0x2aee52();});});})[_0xa0b3('0x1c')](function(){return _0x19bfd2['download'](_0x2a2441,_0x891b96,function(_0x2f548a){if(_0x2f548a){console['log'](_0xa0b3('0x77'),_0x2f548a);}else{fs[_0xa0b3('0x78')](_0x2a2441);}});});});}else{return _0x19bfd2[_0xa0b3('0x13')](0xc8);}})[_0xa0b3('0x25')](handleError(_0x19bfd2,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 177aa7e..eee7e5a 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 _0xf996=['length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x43653d,_0x290468){var _0x2e6c7c=function(_0x36ed02){while(--_0x36ed02){_0x43653d['push'](_0x43653d['shift']());}};_0x2e6c7c(++_0x290468);}(_0xf996,0x74));var _0x6f99=function(_0xc0213d,_0x4a3b1d){_0xc0213d=_0xc0213d-0x0;var _0x1a93c4=_0xf996[_0xc0213d];return _0x1a93c4;};'use strict';var EventEmitter=require(_0x6f99('0x0'));var WhatsappInteraction=require(_0x6f99('0x1'))['db'][_0x6f99('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x6f99('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f99('0x4'),'afterDestroy':_0x6f99('0x5')};function emitEvent(_0x274f12){return function(_0x3de6be,_0x3ab5e2,_0xf2b5ee){_0x3de6be[_0x6f99('0x6')]({'attributes':['id'],'raw':!![]})[_0x6f99('0x7')](function(_0x123215){_0x3de6be[_0x6f99('0x8')]('Users',_0x123215[_0x6f99('0x9')](function(_0x52e063){return{'id':_0x52e063['id']};}));return WhatsappMessage[_0x6f99('0xa')]({'where':{'WhatsappInteractionId':_0x3de6be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6f99('0x7')](function(_0x41f436){_0x3de6be[_0x6f99('0x8')](_0x6f99('0xb'),_0x41f436[_0x6f99('0xc')]);WhatsappInteractionEvents[_0x6f99('0xd')](_0x274f12+':'+_0x3de6be['id'],_0x3de6be);WhatsappInteractionEvents[_0x6f99('0xd')](_0x274f12,_0x3de6be);_0xf2b5ee(null);})[_0x6f99('0xe')](_0xf2b5ee(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x6f99('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x6e16=['catch','exports','WhatsappInteraction','WhatsappMessage','save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x1aea4,_0x568625){var _0x1e399d=function(_0x2e6643){while(--_0x2e6643){_0x1aea4['push'](_0x1aea4['shift']());}};_0x1e399d(++_0x568625);}(_0x6e16,0x1d3));var _0x66e1=function(_0x1a3d95,_0x34af19){_0x1a3d95=_0x1a3d95-0x0;var _0x23ea57=_0x6e16[_0x1a3d95];return _0x23ea57;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x66e1('0x0')];var WhatsappMessage=require('../../mysqldb')['db'][_0x66e1('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66e1('0x2'),'afterUpdate':_0x66e1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x892e60){return function(_0x59d328,_0x46894a,_0x204db8){_0x59d328[_0x66e1('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37dd64){_0x59d328[_0x66e1('0x5')](_0x66e1('0x6'),_0x37dd64[_0x66e1('0x7')](function(_0x376592){return{'id':_0x376592['id']};}));return WhatsappMessage[_0x66e1('0x8')]({'where':{'WhatsappInteractionId':_0x59d328['id'],'direction':'in','read':![]},'raw':!![]});})[_0x66e1('0x9')](function(_0x216b29){_0x59d328[_0x66e1('0x5')](_0x66e1('0xa'),_0x216b29[_0x66e1('0xb')]);WhatsappInteractionEvents[_0x66e1('0xc')](_0x892e60+':'+_0x59d328['id'],_0x59d328);WhatsappInteractionEvents[_0x66e1('0xc')](_0x892e60,_0x59d328);_0x204db8(null);})[_0x66e1('0xd')](_0x204db8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x66e1('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index b4799d0..d303cb8 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 _0x9f7b=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x18a8d1,_0x4302c4){var _0x3ebf19=function(_0x134653){while(--_0x134653){_0x18a8d1['push'](_0x18a8d1['shift']());}};_0x3ebf19(++_0x4302c4);}(_0x9f7b,0x15e));var _0xb9f7=function(_0x48bb68,_0x4e80c9){_0x48bb68=_0x48bb68-0x0;var _0x20638a=_0x9f7b[_0x48bb68];return _0x20638a;};'use strict';var _=require(_0xb9f7('0x0'));var util=require(_0xb9f7('0x1'));var logger=require(_0xb9f7('0x2'))(_0xb9f7('0x3'));var moment=require(_0xb9f7('0x4'));var BPromise=require(_0xb9f7('0x5'));var rp=require(_0xb9f7('0x6'));var fs=require('fs');var path=require(_0xb9f7('0x7'));var rimraf=require(_0xb9f7('0x8'));var config=require(_0xb9f7('0x9'));var attributes=require(_0xb9f7('0xa'));module[_0xb9f7('0xb')]=function(_0x57f659,_0x646fe9){return _0x57f659[_0xb9f7('0xc')](_0xb9f7('0xd'),attributes,{'tableName':_0xb9f7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xac6e20,_0x35ef3e,_0x2a004e){if(_0xac6e20[_0xb9f7('0xf')]('closed')){_0xac6e20[_0xb9f7('0x10')]=moment()[_0xb9f7('0x11')](_0xb9f7('0x12'));}_0x2a004e(null,_0xac6e20);}}});}; \ No newline at end of file +var _0x5e23=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappInteraction','changed','format','lodash','util','../../config/logger'];(function(_0x2bde97,_0x5bc2e7){var _0x4fde78=function(_0x57e7c){while(--_0x57e7c){_0x2bde97['push'](_0x2bde97['shift']());}};_0x4fde78(++_0x5bc2e7);}(_0x5e23,0x169));var _0x35e2=function(_0x1c8a1e,_0x58717d){_0x1c8a1e=_0x1c8a1e-0x0;var _0x5815b3=_0x5e23[_0x1c8a1e];return _0x5815b3;};'use strict';var _=require(_0x35e2('0x0'));var util=require(_0x35e2('0x1'));var logger=require(_0x35e2('0x2'))('api');var moment=require(_0x35e2('0x3'));var BPromise=require(_0x35e2('0x4'));var rp=require(_0x35e2('0x5'));var fs=require('fs');var path=require(_0x35e2('0x6'));var rimraf=require(_0x35e2('0x7'));var config=require(_0x35e2('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x35e2('0x9')]=function(_0x11e10d,_0x1e355b){return _0x11e10d['define'](_0x35e2('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x281d0f,_0x362e30,_0x34f46a){if(_0x281d0f[_0x35e2('0xb')]('closed')){_0x281d0f['closedAt']=moment()[_0x35e2('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x34f46a(null,_0x281d0f);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index b927a28..d04518e 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 _0x6e20=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','then','stringify','AddTagsToWhatsappInteraction','find','addTags','omit','ids','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1824c6,_0x79fcc3){var _0xbc0e9a=function(_0x4262ef){while(--_0x4262ef){_0x1824c6['push'](_0x1824c6['shift']());}};_0xbc0e9a(++_0x79fcc3);}(_0x6e20,0x13c));var _0x06e2=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x6e20[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x06e2('0x0'));var util=require(_0x06e2('0x1'));var moment=require(_0x06e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x06e2('0x3'));var fs=require('fs');var Redis=require(_0x06e2('0x4'));var db=require(_0x06e2('0x5'))['db'];var utils=require(_0x06e2('0x6'));var logger=require(_0x06e2('0x7'))(_0x06e2('0x8'));var config=require(_0x06e2('0x9'));var jayson=require(_0x06e2('0xa'));var client=jayson[_0x06e2('0xb')][_0x06e2('0xc')]({'port':0x232a});config[_0x06e2('0xd')]=_[_0x06e2('0xe')](config[_0x06e2('0xd')],{'host':_0x06e2('0xf'),'port':0x18eb});var socket=require(_0x06e2('0x10'))(new Redis(config[_0x06e2('0xd')]));require(_0x06e2('0x11'))[_0x06e2('0x12')](socket);function respondWithRpcPromise(_0x51859d,_0x238191,_0x2d0965){return new BPromise(function(_0x4f46c8,_0x42f3a5){return client[_0x06e2('0x13')](_0x51859d,_0x2d0965)['then'](function(_0x11b306){logger[_0x06e2('0x14')](_0x06e2('0x15'),_0x238191,'request\x20sent');logger[_0x06e2('0x16')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x238191,_0x06e2('0x17'),JSON['stringify'](_0x11b306));if(_0x11b306[_0x06e2('0x18')]){if(_0x11b306[_0x06e2('0x18')][_0x06e2('0x19')]===0x1f4){logger[_0x06e2('0x18')](_0x06e2('0x15'),_0x238191,_0x11b306['error'][_0x06e2('0x1a')]);return _0x42f3a5(_0x11b306[_0x06e2('0x18')][_0x06e2('0x1a')]);}logger[_0x06e2('0x18')](_0x06e2('0x15'),_0x238191,_0x11b306['error'][_0x06e2('0x1a')]);return _0x4f46c8(_0x11b306[_0x06e2('0x18')][_0x06e2('0x1a')]);}else{logger[_0x06e2('0x14')](_0x06e2('0x15'),_0x238191,'request\x20sent');_0x4f46c8(_0x11b306[_0x06e2('0x1b')][_0x06e2('0x1a')]);}})['catch'](function(_0x46dfc2){logger[_0x06e2('0x18')](_0x06e2('0x15'),_0x238191,_0x46dfc2);_0x42f3a5(_0x46dfc2);});});}exports[_0x06e2('0x1c')]=function(_0x55ed51){var _0x54b07c=this;return new Promise(function(_0x136847,_0x2b470c){return db[_0x06e2('0x1d')][_0x06e2('0x1e')](_0x55ed51[_0x06e2('0x1f')],{'raw':_0x55ed51['options']?_0x55ed51[_0x06e2('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55ed51[_0x06e2('0x20')]?_0x55ed51[_0x06e2('0x20')][_0x06e2('0x21')]||null:null,'attributes':_0x55ed51[_0x06e2('0x20')]?_0x55ed51[_0x06e2('0x20')][_0x06e2('0x22')]||null:null,'limit':_0x55ed51[_0x06e2('0x20')]?_0x55ed51['options'][_0x06e2('0x23')]||null:null})[_0x06e2('0x24')](function(_0x3d65bb){logger['info']('UpdateWhatsappInteraction',_0x55ed51);logger[_0x06e2('0x16')](_0x06e2('0x1c'),_0x55ed51,JSON[_0x06e2('0x25')](_0x3d65bb));_0x136847(_0x3d65bb);})['catch'](function(_0x487455){logger['error'](_0x06e2('0x1c'),_0x487455[_0x06e2('0x1a')],_0x55ed51);_0x2b470c(_0x54b07c[_0x06e2('0x18')](0x1f4,_0x487455[_0x06e2('0x1a')]));});});};exports[_0x06e2('0x26')]=function(_0xb13f2){return new Promise(function(_0x4850e6,_0x349786){return db[_0x06e2('0x1d')][_0x06e2('0x27')]({'where':_0xb13f2[_0x06e2('0x20')]?_0xb13f2['options'][_0x06e2('0x21')]||null:null})[_0x06e2('0x24')](function(_0x4ecf51){if(_0x4ecf51){return _0x4ecf51[_0x06e2('0x28')](_0xb13f2[_0x06e2('0x1f')]['ids'],_[_0x06e2('0x29')](_0xb13f2[_0x06e2('0x1f')],[_0x06e2('0x2a'),'id'])||{});}})[_0x06e2('0x2b')](function(_0x109e1e){logger['info'](_0x06e2('0x2c'),_0xb13f2);logger[_0x06e2('0x16')]('AddTags',_0xb13f2,JSON[_0x06e2('0x25')](_0x109e1e));_0x4850e6(_0x109e1e);})[_0x06e2('0x2d')](function(_0x294b3c){logger[_0x06e2('0x18')]('AddTags',_0x294b3c[_0x06e2('0x1a')],_0xb13f2);_0x349786(_this['error'](0x1f4,_0x294b3c[_0x06e2('0x1a')]));});});}; \ No newline at end of file +var _0xb7df=['catch','AddTagsToWhatsappInteraction','find','then','addTags','body','ids','AddTags','bluebird','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','raw','options','where','attributes','limit','stringify'];(function(_0x553bc8,_0x481382){var _0xc45407=function(_0x1831ac){while(--_0x1831ac){_0x553bc8['push'](_0x553bc8['shift']());}};_0xc45407(++_0x481382);}(_0xb7df,0x128));var _0xfb7d=function(_0x11eed3,_0x11d4fa){_0x11eed3=_0x11eed3-0x0;var _0x3566da=_0xb7df[_0x11eed3];return _0x3566da;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfb7d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb7d('0x1'));var config=require('../../config/environment');var jayson=require(_0xfb7d('0x2'));var client=jayson[_0xfb7d('0x3')]['http']({'port':0x232a});config[_0xfb7d('0x4')]=_[_0xfb7d('0x5')](config[_0xfb7d('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb7d('0x6'))(new Redis(config['redis']));require(_0xfb7d('0x7'))[_0xfb7d('0x8')](socket);function respondWithRpcPromise(_0x2dfa6d,_0x5ea676,_0x5ddd59){return new BPromise(function(_0x53f20c,_0x2050be){return client[_0xfb7d('0x9')](_0x2dfa6d,_0x5ddd59)['then'](function(_0x53e79c){logger[_0xfb7d('0xa')](_0xfb7d('0xb'),_0x5ea676,'request\x20sent');logger[_0xfb7d('0xc')](_0xfb7d('0xd'),_0x5ea676,_0xfb7d('0xe'),JSON['stringify'](_0x53e79c));if(_0x53e79c[_0xfb7d('0xf')]){if(_0x53e79c[_0xfb7d('0xf')][_0xfb7d('0x10')]===0x1f4){logger[_0xfb7d('0xf')](_0xfb7d('0xb'),_0x5ea676,_0x53e79c[_0xfb7d('0xf')][_0xfb7d('0x11')]);return _0x2050be(_0x53e79c[_0xfb7d('0xf')]['message']);}logger[_0xfb7d('0xf')](_0xfb7d('0xb'),_0x5ea676,_0x53e79c[_0xfb7d('0xf')]['message']);return _0x53f20c(_0x53e79c[_0xfb7d('0xf')][_0xfb7d('0x11')]);}else{logger[_0xfb7d('0xa')](_0xfb7d('0xb'),_0x5ea676,'request\x20sent');_0x53f20c(_0x53e79c[_0xfb7d('0x12')][_0xfb7d('0x11')]);}})['catch'](function(_0x3ecf8d){logger[_0xfb7d('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x5ea676,_0x3ecf8d);_0x2050be(_0x3ecf8d);});});}exports[_0xfb7d('0x13')]=function(_0x4a9022){var _0x4a5fce=this;return new Promise(function(_0x274de8,_0x5dfadb){return db[_0xfb7d('0x14')][_0xfb7d('0x15')](_0x4a9022['body'],{'raw':_0x4a9022['options']?_0x4a9022['options'][_0xfb7d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a9022[_0xfb7d('0x17')]?_0x4a9022[_0xfb7d('0x17')][_0xfb7d('0x18')]||null:null,'attributes':_0x4a9022['options']?_0x4a9022[_0xfb7d('0x17')][_0xfb7d('0x19')]||null:null,'limit':_0x4a9022[_0xfb7d('0x17')]?_0x4a9022[_0xfb7d('0x17')][_0xfb7d('0x1a')]||null:null})['then'](function(_0x707d89){logger[_0xfb7d('0xa')](_0xfb7d('0x13'),_0x4a9022);logger[_0xfb7d('0xc')](_0xfb7d('0x13'),_0x4a9022,JSON[_0xfb7d('0x1b')](_0x707d89));_0x274de8(_0x707d89);})[_0xfb7d('0x1c')](function(_0x3650b1){logger['error']('UpdateWhatsappInteraction',_0x3650b1['message'],_0x4a9022);_0x5dfadb(_0x4a5fce[_0xfb7d('0xf')](0x1f4,_0x3650b1['message']));});});};exports[_0xfb7d('0x1d')]=function(_0x45eeb8){return new Promise(function(_0x270583,_0x4729f3){return db['WhatsappInteraction'][_0xfb7d('0x1e')]({'where':_0x45eeb8[_0xfb7d('0x17')]?_0x45eeb8[_0xfb7d('0x17')][_0xfb7d('0x18')]||null:null})[_0xfb7d('0x1f')](function(_0x177e0c){if(_0x177e0c){return _0x177e0c[_0xfb7d('0x20')](_0x45eeb8[_0xfb7d('0x21')][_0xfb7d('0x22')],_['omit'](_0x45eeb8[_0xfb7d('0x21')],['ids','id'])||{});}})['spread'](function(_0x47b504){logger[_0xfb7d('0xa')](_0xfb7d('0x23'),_0x45eeb8);logger['debug'](_0xfb7d('0x23'),_0x45eeb8,JSON[_0xfb7d('0x1b')](_0x47b504));_0x270583(_0x47b504);})['catch'](function(_0x406a7a){logger[_0xfb7d('0xf')](_0xfb7d('0x23'),_0x406a7a[_0xfb7d('0x11')],_0x45eeb8);_0x4729f3(_this[_0xfb7d('0xf')](0x1f4,_0x406a7a[_0xfb7d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7f59c47..ed7a5e2 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 _0xfe4b=['remove','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x269fab,_0xd72368){var _0x435d6b=function(_0x1bd676){while(--_0x1bd676){_0x269fab['push'](_0x269fab['shift']());}};_0x435d6b(++_0xd72368);}(_0xfe4b,0x116));var _0xbfe4=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0xfe4b[_0x34eb31];return _0x254994;};'use strict';var WhatsappInteractionEvents=require(_0xbfe4('0x0'));var events=[_0xbfe4('0x1'),_0xbfe4('0x2'),'update'];function createListener(_0x3ff073,_0x35eb15){return function(_0x50f935){_0x35eb15[_0xbfe4('0x3')](_0x3ff073,_0x50f935);};}function removeListener(_0x54a361,_0x275674){return function(){WhatsappInteractionEvents[_0xbfe4('0x4')](_0x54a361,_0x275674);};}exports[_0xbfe4('0x5')]=function(_0x3bb394){for(var _0x413f0b=0x0,_0x353345=events[_0xbfe4('0x6')];_0x413f0b<_0x353345;_0x413f0b++){var _0x332fec=events[_0x413f0b];var _0x5f3329=createListener(_0xbfe4('0x7')+_0x332fec,_0x3bb394);WhatsappInteractionEvents['on'](_0x332fec,_0x5f3329);}}; \ No newline at end of file +var _0x0f64=['./whatsappInteraction.events','update','removeListener','length','whatsappInteraction:'];(function(_0x1aa88f,_0x3b186f){var _0x3e0b82=function(_0x1ce00d){while(--_0x1ce00d){_0x1aa88f['push'](_0x1aa88f['shift']());}};_0x3e0b82(++_0x3b186f);}(_0x0f64,0x122));var _0x40f6=function(_0x490c06,_0x45c211){_0x490c06=_0x490c06-0x0;var _0x8cf552=_0x0f64[_0x490c06];return _0x8cf552;};'use strict';var WhatsappInteractionEvents=require(_0x40f6('0x0'));var events=['save','remove',_0x40f6('0x1')];function createListener(_0xab4846,_0x4a417f){return function(_0x3d3f6f){_0x4a417f['emit'](_0xab4846,_0x3d3f6f);};}function removeListener(_0x1fd0b9,_0x423fef){return function(){WhatsappInteractionEvents[_0x40f6('0x2')](_0x1fd0b9,_0x423fef);};}exports['register']=function(_0x254595){for(var _0x2799c4=0x0,_0x11ea14=events[_0x40f6('0x3')];_0x2799c4<_0x11ea14;_0x2799c4++){var _0xfe02f3=events[_0x2799c4];var _0x4e4f5b=createListener(_0x40f6('0x4')+_0xfe02f3,_0x254595);WhatsappInteractionEvents['on'](_0xfe02f3,_0x4e4f5b);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index a9d09a2..9a39324 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 _0x8c6b=['whatsappmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','tracked'];(function(_0x60eaba,_0x26670b){var _0x110fba=function(_0x1f3dfe){while(--_0x1f3dfe){_0x60eaba['push'](_0x60eaba['shift']());}};_0x110fba(++_0x26670b);}(_0x8c6b,0x84));var _0xb8c6=function(_0x73b814,_0x21341a){_0x73b814=_0x73b814-0x0;var _0x3fef90=_0x8c6b[_0x73b814];return _0x3fef90;};'use strict';var multer=require(_0xb8c6('0x0'));var util=require(_0xb8c6('0x1'));var path=require(_0xb8c6('0x2'));var timeout=require('connect-timeout');var express=require(_0xb8c6('0x3'));var router=express[_0xb8c6('0x4')]();var fs_extra=require(_0xb8c6('0x5'));var auth=require(_0xb8c6('0x6'));var interaction=require(_0xb8c6('0x7'));var config=require(_0xb8c6('0x8'));var controller=require(_0xb8c6('0x9'));router[_0xb8c6('0xa')]('/',auth['isAuthenticated'](),controller[_0xb8c6('0xb')]);router[_0xb8c6('0xa')](_0xb8c6('0xc'),auth['isAuthenticated'](),controller[_0xb8c6('0xd')]);router[_0xb8c6('0xa')](_0xb8c6('0xe'),auth[_0xb8c6('0xf')](),controller[_0xb8c6('0x10')]);router['post']('/',auth[_0xb8c6('0xf')](),interaction[_0xb8c6('0x11')]('whatsapp',_0xb8c6('0x12')),controller[_0xb8c6('0x13')]);router[_0xb8c6('0x14')](_0xb8c6('0x15'),controller[_0xb8c6('0x16')]);router[_0xb8c6('0x17')](_0xb8c6('0xe'),auth[_0xb8c6('0xf')](),controller[_0xb8c6('0x18')]);router[_0xb8c6('0x17')](_0xb8c6('0x19'),auth[_0xb8c6('0xf')](),controller[_0xb8c6('0x1a')]);router[_0xb8c6('0x17')](_0xb8c6('0x1b'),auth[_0xb8c6('0xf')](),controller[_0xb8c6('0x1c')]);router[_0xb8c6('0x1d')](_0xb8c6('0xe'),auth[_0xb8c6('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0264=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','post','tracked','create','/:id/status','put','/:id','/:id/accept','/:id/reject','reject','delete','exports'];(function(_0x1280b,_0x73d22){var _0x48f4c8=function(_0x498c45){while(--_0x498c45){_0x1280b['push'](_0x1280b['shift']());}};_0x48f4c8(++_0x73d22);}(_0x0264,0xa8));var _0x4026=function(_0x1650b4,_0x4be91d){_0x1650b4=_0x1650b4-0x0;var _0x3ae2ba=_0x0264[_0x1650b4];return _0x3ae2ba;};'use strict';var multer=require(_0x4026('0x0'));var util=require(_0x4026('0x1'));var path=require(_0x4026('0x2'));var timeout=require(_0x4026('0x3'));var express=require(_0x4026('0x4'));var router=express[_0x4026('0x5')]();var fs_extra=require(_0x4026('0x6'));var auth=require(_0x4026('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4026('0x8'));var controller=require('./whatsappMessage.controller');router[_0x4026('0x9')]('/',auth[_0x4026('0xa')](),controller[_0x4026('0xb')]);router[_0x4026('0x9')]('/describe',auth[_0x4026('0xa')](),controller[_0x4026('0xc')]);router['get']('/:id',auth[_0x4026('0xa')](),controller['show']);router[_0x4026('0xd')]('/',auth['isAuthenticated'](),interaction[_0x4026('0xe')]('whatsapp','whatsappmessage:create'),controller[_0x4026('0xf')]);router[_0x4026('0xd')](_0x4026('0x10'),controller['status']);router[_0x4026('0x11')](_0x4026('0x12'),auth[_0x4026('0xa')](),controller['update']);router[_0x4026('0x11')](_0x4026('0x13'),auth[_0x4026('0xa')](),controller['accept']);router[_0x4026('0x11')](_0x4026('0x14'),auth['isAuthenticated'](),controller[_0x4026('0x15')]);router[_0x4026('0x16')](_0x4026('0x12'),auth[_0x4026('0xa')](),controller['destroy']);module[_0x4026('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index fc14d36..3441c7f 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 _0xec6a=['medium','BOOLEAN','out','STRING','DATE','TEXT','sequelize','exports'];(function(_0x1aed01,_0x3b59f3){var _0x34ccb8=function(_0x1420db){while(--_0x1420db){_0x1aed01['push'](_0x1aed01['shift']());}};_0x34ccb8(++_0x3b59f3);}(_0xec6a,0x1c6));var _0xaec6=function(_0x423604,_0xab1dd){_0x423604=_0x423604-0x0;var _0x54d5c1=_0xec6a[_0x423604];return _0x54d5c1;};'use strict';var Sequelize=require(_0xaec6('0x0'));module[_0xaec6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaec6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaec6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xaec6('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaec6('0x5')](0xbe)},'phone':{'type':Sequelize[_0xaec6('0x5')]},'readAt':{'type':Sequelize[_0xaec6('0x6')]},'secret':{'type':Sequelize[_0xaec6('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaec6('0x5')]},'providerResponse':{'type':Sequelize[_0xaec6('0x7')]}}; \ No newline at end of file +var _0x3ca4=['ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x38a56d,_0x228eae){var _0x1335bc=function(_0x4d10ed){while(--_0x4d10ed){_0x38a56d['push'](_0x38a56d['shift']());}};_0x1335bc(++_0x228eae);}(_0x3ca4,0x17d));var _0x43ca=function(_0x5d953f,_0xa4e0e1){_0x5d953f=_0x5d953f-0x0;var _0x59101b=_0x3ca4[_0x5d953f];return _0x59101b;};'use strict';var Sequelize=require(_0x43ca('0x0'));module[_0x43ca('0x1')]={'body':{'type':Sequelize[_0x43ca('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x43ca('0x3')]('in',_0x43ca('0x4')),'defaultValue':_0x43ca('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x43ca('0x5')](0xbe)},'phone':{'type':Sequelize[_0x43ca('0x5')]},'readAt':{'type':Sequelize[_0x43ca('0x6')]},'secret':{'type':Sequelize[_0x43ca('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x43ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e28eb81..baaed05 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 _0xca50=['merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','agent','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','User','internal','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','end','status','json','offset','limit','count','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x3b53b0,_0x23dc58){var _0x4eddc6=function(_0x46254f){while(--_0x46254f){_0x3b53b0['push'](_0x3b53b0['shift']());}};_0x4eddc6(++_0x23dc58);}(_0xca50,0x161));var _0x0ca5=function(_0x8e4a96,_0x12b2e9){_0x8e4a96=_0x8e4a96-0x0;var _0x326d37=_0xca50[_0x8e4a96];return _0x326d37;};'use strict';var emlformat=require(_0x0ca5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0ca5('0x1'));var rp=require(_0x0ca5('0x2'));var moment=require(_0x0ca5('0x3'));var BPromise=require(_0x0ca5('0x4'));var Mustache=require('mustache');var util=require(_0x0ca5('0x5'));var path=require('path');var sox=require(_0x0ca5('0x6'));var csv=require('to-csv');var ejs=require(_0x0ca5('0x7'));var fs=require('fs');var fs_extra=require(_0x0ca5('0x8'));var _=require('lodash');var squel=require(_0x0ca5('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ca5('0xa'));var toCsv=require(_0x0ca5('0xb'));var querystring=require('querystring');var Papa=require(_0x0ca5('0xc'));var Redis=require('ioredis');var authService=require(_0x0ca5('0xd'));var qs=require(_0x0ca5('0xe'));var as=require(_0x0ca5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ca5('0x10'))(_0x0ca5('0x11'));var utils=require(_0x0ca5('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0ca5('0x13')]=_[_0x0ca5('0x14')](config[_0x0ca5('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ca5('0x15'))(new Redis(config['redis']));require(_0x0ca5('0x16'))['register'](socket);var jayson=require(_0x0ca5('0x17'));var client=jayson[_0x0ca5('0x18')][_0x0ca5('0x19')]({'port':0x232c});var client9002=jayson[_0x0ca5('0x18')][_0x0ca5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x10bd15,_0x391c5c,_0x4a7711,_0x1018ed){return new BPromise(function(_0x403549,_0x378807){var _0x1694fb=_0x1018ed||client;return _0x1694fb[_0x0ca5('0x1a')](_0x10bd15,_0x4a7711)[_0x0ca5('0x1b')](function(_0x4ab578){logger['info'](_0x0ca5('0x1c'),_0x391c5c,'request\x20sent');logger[_0x0ca5('0x1d')](_0x0ca5('0x1e'),_0x391c5c,_0x0ca5('0x1f'),JSON[_0x0ca5('0x20')](_0x4ab578));if(_0x4ab578['error']){if(_0x4ab578['error'][_0x0ca5('0x21')]===0x1f4){logger[_0x0ca5('0x22')](_0x0ca5('0x1c'),_0x391c5c,_0x4ab578[_0x0ca5('0x22')][_0x0ca5('0x23')]);return _0x378807(_0x4ab578[_0x0ca5('0x22')][_0x0ca5('0x23')]);}logger['error'](_0x0ca5('0x1c'),_0x391c5c,_0x4ab578[_0x0ca5('0x22')][_0x0ca5('0x23')]);return _0x403549(_0x4ab578[_0x0ca5('0x22')]['message']);}else{logger[_0x0ca5('0x24')](_0x0ca5('0x1c'),_0x391c5c,'request\x20sent');_0x403549(_0x4ab578[_0x0ca5('0x25')][_0x0ca5('0x23')]);}})[_0x0ca5('0x26')](function(_0x466873){logger[_0x0ca5('0x22')](_0x0ca5('0x1c'),_0x391c5c,_0x466873);_0x378807(_0x466873);});});}function respondWithStatusCode(_0x1f6e20,_0x2810ba){_0x2810ba=_0x2810ba||0xcc;return function(_0x39b039){if(_0x39b039){return _0x1f6e20['sendStatus'](_0x2810ba);}return _0x1f6e20['status'](_0x2810ba)[_0x0ca5('0x27')]();};}function respondWithResult(_0x3ff4cc,_0x386071){_0x386071=_0x386071||0xc8;return function(_0x1c85da){if(_0x1c85da){return _0x3ff4cc[_0x0ca5('0x28')](_0x386071)[_0x0ca5('0x29')](_0x1c85da);}};}function respondWithFilteredResult(_0x47ea28,_0x3dd24b){return function(_0x1d1cdb){if(_0x1d1cdb){var _0x5e749b=typeof _0x3dd24b[_0x0ca5('0x2a')]==='undefined'&&typeof _0x3dd24b[_0x0ca5('0x2b')]==='undefined';var _0x55320b=_0x1d1cdb[_0x0ca5('0x2c')];var _0x2cb49f=_0x5e749b?0x0:_0x3dd24b[_0x0ca5('0x2a')];var _0x5d8056=_0x5e749b?_0x1d1cdb['count']:_0x3dd24b[_0x0ca5('0x2a')]+_0x3dd24b['limit'];var _0x4b2ed0;if(_0x5d8056>=_0x55320b){_0x5d8056=_0x55320b;_0x4b2ed0=0xc8;}else{_0x4b2ed0=0xce;}_0x47ea28[_0x0ca5('0x28')](_0x4b2ed0);return _0x47ea28[_0x0ca5('0x2d')]('Content-Range',_0x2cb49f+'-'+_0x5d8056+'/'+_0x55320b)[_0x0ca5('0x29')](_0x1d1cdb);}return null;};}function patchUpdates(_0x36755b){return function(_0x1da19e){try{jsonpatch[_0x0ca5('0x2e')](_0x1da19e,_0x36755b,!![]);}catch(_0x46a481){return BPromise[_0x0ca5('0x2f')](_0x46a481);}return _0x1da19e[_0x0ca5('0x30')]();};}function saveUpdates(_0x484817,_0x4995da){return function(_0x8f5fee){if(_0x8f5fee){return _0x8f5fee[_0x0ca5('0x31')](_0x484817)[_0x0ca5('0x1b')](function(_0x14cdc){return _0x14cdc;});}return null;};}function removeEntity(_0xee8795,_0x473a9e){return function(_0x2cdda9){if(_0x2cdda9){return _0x2cdda9[_0x0ca5('0x32')]()[_0x0ca5('0x1b')](function(){_0xee8795[_0x0ca5('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26ac8d,_0x3e563f){return function(_0x5b3c47){if(!_0x5b3c47){_0x26ac8d[_0x0ca5('0x33')](0x194);}return _0x5b3c47;};}function handleError(_0x2043dd,_0x5379ea){_0x5379ea=_0x5379ea||0x1f4;return function(_0x1de33d){logger[_0x0ca5('0x22')](_0x1de33d[_0x0ca5('0x34')]);if(_0x1de33d[_0x0ca5('0x35')]){delete _0x1de33d['name'];}_0x2043dd[_0x0ca5('0x28')](_0x5379ea)[_0x0ca5('0x36')](_0x1de33d);};}exports[_0x0ca5('0x37')]=function(_0x4bc22a,_0xe30e8f){var _0x2abd81={},_0x2b54b1={},_0x4d6d0c={'count':0x0,'rows':[]};var _0x4a3aa9=_[_0x0ca5('0x38')](db[_0x0ca5('0x39')]['rawAttributes'],function(_0x1221dc){return{'name':_0x1221dc[_0x0ca5('0x3a')],'type':_0x1221dc['type'][_0x0ca5('0x3b')]};});_0x2b54b1['model']=_[_0x0ca5('0x38')](_0x4a3aa9,_0x0ca5('0x35'));_0x2b54b1[_0x0ca5('0x3c')]=_['keys'](_0x4bc22a[_0x0ca5('0x3c')]);_0x2b54b1[_0x0ca5('0x3d')]=_[_0x0ca5('0x3e')](_0x2b54b1['model'],_0x2b54b1['query']);_0x2abd81[_0x0ca5('0x3f')]=_['intersection'](_0x2b54b1[_0x0ca5('0x40')],qs[_0x0ca5('0x41')](_0x4bc22a[_0x0ca5('0x3c')][_0x0ca5('0x41')]));_0x2abd81[_0x0ca5('0x3f')]=_0x2abd81[_0x0ca5('0x3f')][_0x0ca5('0x42')]?_0x2abd81[_0x0ca5('0x3f')]:_0x2b54b1['model'];if(!_0x4bc22a[_0x0ca5('0x3c')][_0x0ca5('0x43')](_0x0ca5('0x44'))){_0x2abd81['limit']=qs[_0x0ca5('0x2b')](_0x4bc22a[_0x0ca5('0x3c')]['limit']);_0x2abd81['offset']=qs[_0x0ca5('0x2a')](_0x4bc22a[_0x0ca5('0x3c')][_0x0ca5('0x2a')]);}_0x2abd81[_0x0ca5('0x45')]=qs[_0x0ca5('0x46')](_0x4bc22a[_0x0ca5('0x3c')]['sort']);_0x2abd81['where']=qs[_0x0ca5('0x3d')](_[_0x0ca5('0x47')](_0x4bc22a[_0x0ca5('0x3c')],_0x2b54b1[_0x0ca5('0x3d')]),_0x4a3aa9);if(_0x4bc22a[_0x0ca5('0x3c')][_0x0ca5('0x48')]){_0x2abd81['where']=_[_0x0ca5('0x49')](_0x2abd81[_0x0ca5('0x4a')],{'$or':_['map'](_0x4a3aa9,function(_0x4f91cf){if(_0x4f91cf[_0x0ca5('0x4b')]!==_0x0ca5('0x4c')){var _0x5877eb={};_0x5877eb[_0x4f91cf[_0x0ca5('0x35')]]={'$like':'%'+_0x4bc22a[_0x0ca5('0x3c')][_0x0ca5('0x48')]+'%'};return _0x5877eb;}})});}_0x2abd81=_[_0x0ca5('0x49')]({},_0x2abd81,_0x4bc22a[_0x0ca5('0x4d')]);var _0x21e924={'where':_0x2abd81[_0x0ca5('0x4a')]};return db['WhatsappMessage'][_0x0ca5('0x2c')](_0x21e924)[_0x0ca5('0x1b')](function(_0x3227ae){_0x4d6d0c[_0x0ca5('0x2c')]=_0x3227ae;if(_0x4bc22a[_0x0ca5('0x3c')][_0x0ca5('0x4e')]){_0x2abd81[_0x0ca5('0x4f')]=[{'all':!![]}];}return db[_0x0ca5('0x39')][_0x0ca5('0x50')](_0x2abd81);})['then'](function(_0x1b4402){_0x4d6d0c[_0x0ca5('0x51')]=_0x1b4402;return _0x4d6d0c;})[_0x0ca5('0x1b')](respondWithFilteredResult(_0xe30e8f,_0x2abd81))[_0x0ca5('0x26')](handleError(_0xe30e8f,null));};exports[_0x0ca5('0x52')]=function(_0x56da53,_0x3fcec9){var _0x5b78c1={'raw':!![],'where':{'id':_0x56da53[_0x0ca5('0x53')]['id']}},_0x4b5a47={};_0x4b5a47[_0x0ca5('0x40')]=_[_0x0ca5('0x54')](db['WhatsappMessage'][_0x0ca5('0x55')]);_0x4b5a47[_0x0ca5('0x3c')]=_[_0x0ca5('0x54')](_0x56da53[_0x0ca5('0x3c')]);_0x4b5a47[_0x0ca5('0x3d')]=_[_0x0ca5('0x3e')](_0x4b5a47[_0x0ca5('0x40')],_0x4b5a47[_0x0ca5('0x3c')]);_0x5b78c1[_0x0ca5('0x3f')]=_['intersection'](_0x4b5a47[_0x0ca5('0x40')],qs['fields'](_0x56da53[_0x0ca5('0x3c')][_0x0ca5('0x41')]));_0x5b78c1[_0x0ca5('0x3f')]=_0x5b78c1['attributes']['length']?_0x5b78c1[_0x0ca5('0x3f')]:_0x4b5a47[_0x0ca5('0x40')];if(_0x56da53[_0x0ca5('0x3c')][_0x0ca5('0x4e')]){_0x5b78c1['include']=[{'all':!![]}];}_0x5b78c1=_[_0x0ca5('0x49')]({},_0x5b78c1,_0x56da53[_0x0ca5('0x4d')]);return db[_0x0ca5('0x39')][_0x0ca5('0x56')](_0x5b78c1)[_0x0ca5('0x1b')](handleEntityNotFound(_0x3fcec9,null))[_0x0ca5('0x1b')](respondWithResult(_0x3fcec9,null))['catch'](handleError(_0x3fcec9,null));};exports[_0x0ca5('0x57')]=function(_0x7b925c,_0xfba01b){return db[_0x0ca5('0x39')][_0x0ca5('0x57')](_0x7b925c[_0x0ca5('0x58')],{})[_0x0ca5('0x1b')](respondWithResult(_0xfba01b,0xc9))[_0x0ca5('0x26')](handleError(_0xfba01b,null));};exports['update']=function(_0x13a2d0,_0x1cfc95){if(_0x13a2d0[_0x0ca5('0x58')]['id']){delete _0x13a2d0[_0x0ca5('0x58')]['id'];}return db['WhatsappMessage'][_0x0ca5('0x56')]({'where':{'id':_0x13a2d0[_0x0ca5('0x53')]['id']}})['then'](handleEntityNotFound(_0x1cfc95,null))['then'](saveUpdates(_0x13a2d0[_0x0ca5('0x58')],null))['then'](respondWithResult(_0x1cfc95,null))[_0x0ca5('0x26')](handleError(_0x1cfc95,null));};exports[_0x0ca5('0x32')]=function(_0x2a4bcb,_0x55123f){return db[_0x0ca5('0x39')][_0x0ca5('0x56')]({'where':{'id':_0x2a4bcb[_0x0ca5('0x53')]['id']}})[_0x0ca5('0x1b')](handleEntityNotFound(_0x55123f,null))['then'](removeEntity(_0x55123f,null))[_0x0ca5('0x26')](handleError(_0x55123f,null));};exports[_0x0ca5('0x59')]=function(_0x284d8c,_0x5b5996){return db[_0x0ca5('0x39')]['describe']()[_0x0ca5('0x1b')](respondWithResult(_0x5b5996,null))[_0x0ca5('0x26')](handleError(_0x5b5996,null));};var interaction_log=require(_0x0ca5('0x10'))(_0x0ca5('0x5a'));exports['accept']=function(_0x55079b,_0x3dcb9d,_0x3764fc){var _0x39a69f={'agent':{},'channel':_0x0ca5('0x5b')};if(_0x55079b[_0x0ca5('0x58')]['id']){delete _0x55079b[_0x0ca5('0x58')]['id'];}_0x55079b['body'][_0x0ca5('0x5c')]=!![];_0x55079b[_0x0ca5('0x58')][_0x0ca5('0x5d')]=moment()[_0x0ca5('0x5e')](_0x0ca5('0x5f'));_0x55079b[_0x0ca5('0x58')][_0x0ca5('0x60')]=_0x55079b[_0x0ca5('0x58')][_0x0ca5('0x60')]||_0x55079b[_0x0ca5('0x61')]['id'];_0x39a69f['agent']['id']=_0x55079b[_0x0ca5('0x58')]['UserId'];return db[_0x0ca5('0x39')][_0x0ca5('0x56')]({'where':{'id':_0x55079b[_0x0ca5('0x53')]['id'],'UserId':null}})[_0x0ca5('0x1b')](handleEntityNotFound(_0x3dcb9d,null))[_0x0ca5('0x1b')](saveUpdates(_0x55079b[_0x0ca5('0x58')],null))[_0x0ca5('0x1b')](function(_0x4d2e14){if(_0x4d2e14){_0x39a69f[_0x0ca5('0x23')]=_0x4d2e14[_0x0ca5('0x62')]({'plain':!![]});return db[_0x0ca5('0x63')][_0x0ca5('0x56')]({'where':{'id':_0x4d2e14['WhatsappInteractionId']}});}return null;})[_0x0ca5('0x1b')](handleEntityNotFound(_0x3dcb9d,null))['then'](function(_0x25440c){if(_0x25440c){return _0x25440c[_0x0ca5('0x31')]({'UserId':_0x55079b[_0x0ca5('0x58')][_0x0ca5('0x60')],'read1stAt':_[_0x0ca5('0x64')](_0x25440c[_0x0ca5('0x65')])?moment()[_0x0ca5('0x5e')](_0x0ca5('0x5f')):undefined});}return null;})[_0x0ca5('0x1b')](function(_0x2785be){if(_0x2785be){_0x39a69f[_0x0ca5('0x66')]=_0x2785be[_0x0ca5('0x62')]({'plain':!![]});interaction_log['info'](_0x0ca5('0x67'),_0x55079b['user']['id'],_0x55079b['user'][_0x0ca5('0x35')],_0x55079b[_0x0ca5('0x61')][_0x0ca5('0x68')],_0x39a69f[_0x0ca5('0x66')]['id'],_0x55079b[_0x0ca5('0x58')]?JSON[_0x0ca5('0x20')](_0x55079b[_0x0ca5('0x58')]):_0x0ca5('0x69'));return respondWithRpcPromise('AcceptMessage',_0x0ca5('0x6a'),_0x39a69f);}return null;})[_0x0ca5('0x1b')](function(_0x18af67){var _0x20376=_0x0ca5('0x6b')+_0x18af67['message'][_0x0ca5('0x6c')];return db[_0x0ca5('0x6d')][_0x0ca5('0x3c')](_0x20376,{'type':db[_0x0ca5('0x6e')]['QueryTypes'][_0x0ca5('0x6f')],'raw':!![]})[_0x0ca5('0x1b')](function(_0x337195){return _0x337195;});})[_0x0ca5('0x1b')](function(_0x4cdd78){if(_0x4cdd78){_0x39a69f[_0x0ca5('0x23')][_0x0ca5('0x70')]=_0x4cdd78[0x0];if(!_0x55079b[_0x0ca5('0x58')][_0x0ca5('0x60')])return;return db['User']['find']({'where':{'id':_0x55079b[_0x0ca5('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x0ca5('0x35'),_0x0ca5('0x71'),_0x0ca5('0x72'),'internal'],'raw':!![]});}return null;})[_0x0ca5('0x1b')](function(_0x47356c){if(!_0x47356c)return null;_0x39a69f[_0x0ca5('0x23')][_0x0ca5('0x73')]=_0x47356c;return _0x39a69f;})[_0x0ca5('0x1b')](function(_0x1cc20f){if(_0x1cc20f){if(_0x55079b[_0x0ca5('0x58')][_0x0ca5('0x74')]){_0x39a69f['message'][_0x0ca5('0x75')]=util[_0x0ca5('0x5e')](_0x0ca5('0x76'),_0x55079b[_0x0ca5('0x61')][_0x0ca5('0x35')]);_0x39a69f[_0x0ca5('0x23')][_0x0ca5('0x77')]=_0x39a69f[_0x0ca5('0x77')];_0x39a69f[_0x0ca5('0x23')]['motionChannel']=_0x39a69f[_0x0ca5('0x77')];_0x39a69f[_0x0ca5('0x23')][_0x0ca5('0x78')]=_0x0ca5('0x79');return respondWithRpcPromise(_0x0ca5('0x7a'),_0x0ca5('0x7a'),{'event':_0x0ca5('0x7b'),'message':_0x39a69f[_0x0ca5('0x23')]},client9002)[_0x0ca5('0x1b')](function(){return _0x39a69f;});}return _0x39a69f;}return null;})[_0x0ca5('0x1b')](respondWithResult(_0x3dcb9d,null))[_0x0ca5('0x26')](handleError(_0x3dcb9d,null));};var interaction_log=require(_0x0ca5('0x10'))(_0x0ca5('0x5a'));exports['reject']=function(_0x2c3c69,_0x1d80f3,_0x328ef7){var _0x47cfaf={'agent':{},'channel':'whatsapp'};if(_0x2c3c69['body']['id']){delete _0x2c3c69[_0x0ca5('0x58')]['id'];}_0x2c3c69[_0x0ca5('0x58')][_0x0ca5('0x60')]=_0x2c3c69[_0x0ca5('0x58')][_0x0ca5('0x60')]||_0x2c3c69['user']['id'];_0x47cfaf[_0x0ca5('0x73')]['id']=_0x2c3c69['body'][_0x0ca5('0x60')];return db[_0x0ca5('0x39')][_0x0ca5('0x56')]({'where':{'id':_0x2c3c69[_0x0ca5('0x53')]['id'],'UserId':null}})[_0x0ca5('0x1b')](handleEntityNotFound(_0x1d80f3,null))['then'](function(_0x440b01){if(_0x440b01){_0x47cfaf[_0x0ca5('0x23')]=_0x440b01[_0x0ca5('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x0ca5('0x56')]({'where':{'id':_0x440b01[_0x0ca5('0x7c')]}});}return null;})[_0x0ca5('0x1b')](handleEntityNotFound(_0x1d80f3,null))['then'](function(_0x954f89){if(_0x954f89){_0x47cfaf[_0x0ca5('0x66')]=_0x954f89['get']({'plain':!![]});interaction_log[_0x0ca5('0x24')](_0x0ca5('0x7d'),_0x2c3c69[_0x0ca5('0x61')]['id'],_0x2c3c69['user'][_0x0ca5('0x35')],_0x2c3c69[_0x0ca5('0x61')]['role'],_0x47cfaf['interaction']['id'],_0x2c3c69[_0x0ca5('0x58')]?JSON[_0x0ca5('0x20')](_0x2c3c69['body']):_0x0ca5('0x69'));return respondWithRpcPromise('RejectMessage',_0x0ca5('0x7e'),_0x47cfaf);}return null;})['then'](function(_0x15a101){var _0x4a54bd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15a101['message']['ContactId'];return db[_0x0ca5('0x6d')][_0x0ca5('0x3c')](_0x4a54bd,{'type':db['Sequelize'][_0x0ca5('0x7f')][_0x0ca5('0x6f')],'raw':!![]})[_0x0ca5('0x1b')](function(_0x394acb){return _0x394acb;});})[_0x0ca5('0x1b')](function(_0x1efff5){if(_0x1efff5){_0x47cfaf[_0x0ca5('0x23')][_0x0ca5('0x70')]=_0x1efff5[0x0];if(!_0x2c3c69[_0x0ca5('0x58')]['UserId'])return;return db[_0x0ca5('0x80')][_0x0ca5('0x56')]({'where':{'id':_0x2c3c69[_0x0ca5('0x58')][_0x0ca5('0x60')],'role':_0x0ca5('0x73')},'attributes':['id','name',_0x0ca5('0x71'),'email',_0x0ca5('0x81')],'raw':!![]});}return null;})[_0x0ca5('0x1b')](function(_0x3f75e2){if(!_0x3f75e2)return null;_0x47cfaf[_0x0ca5('0x23')][_0x0ca5('0x73')]=_0x3f75e2;return _0x47cfaf;})['then'](function(_0x2fa26c){if(_0x2fa26c){_0x2fa26c[_0x0ca5('0x23')]['interface']=util[_0x0ca5('0x5e')](_0x0ca5('0x76'),_0x2c3c69['user'][_0x0ca5('0x35')]);_0x2fa26c[_0x0ca5('0x23')]['channel']=_0x47cfaf[_0x0ca5('0x77')];_0x2fa26c[_0x0ca5('0x23')][_0x0ca5('0x82')]=_0x47cfaf[_0x0ca5('0x77')];_0x2fa26c[_0x0ca5('0x23')][_0x0ca5('0x78')]=_0x0ca5('0x2f');respondWithRpcPromise(_0x0ca5('0x7a'),_0x0ca5('0x7a'),{'event':_0x0ca5('0x83'),'message':_0x2fa26c[_0x0ca5('0x23')]},client9002);return _0x47cfaf;}return null;})[_0x0ca5('0x1b')](respondWithResult(_0x1d80f3,null))['catch'](handleError(_0x1d80f3,null));};exports[_0x0ca5('0x28')]=function(_0x313fb2,_0x10819a,_0x55af96){if(_0x313fb2[_0x0ca5('0x58')]['id']){delete _0x313fb2[_0x0ca5('0x58')]['id'];}var _0xd01ea0;return db[_0x0ca5('0x39')][_0x0ca5('0x56')]({'where':{'id':_0x313fb2['params']['id']}})['then'](handleEntityNotFound(_0x10819a,null))[_0x0ca5('0x1b')](function(_0x10450e){if(_0x10450e){_0xd01ea0=_0x10450e;return db[_0x0ca5('0x84')]['find']({'where':{'id':_0x10450e[_0x0ca5('0x85')]}});}})[_0x0ca5('0x1b')](handleEntityNotFound(_0x10819a,null))[_0x0ca5('0x1b')](function(_0x45d5de){if(_0x45d5de){logger[_0x0ca5('0x1d')](_0x0ca5('0x86'),_0x0ca5('0x28'),_0x0ca5('0x87'),_0x45d5de[_0x0ca5('0x4b')],util[_0x0ca5('0x88')](_0x313fb2['body'],{'showHidden':![],'depth':null}));switch(_0x45d5de[_0x0ca5('0x4b')]){case _0x0ca5('0x89'):if(_0x313fb2[_0x0ca5('0x58')]['MessageSid']&&_0x313fb2[_0x0ca5('0x58')][_0x0ca5('0x8a')]===_0xd01ea0[_0x0ca5('0x8b')]&&_0x313fb2['body'][_0x0ca5('0x8c')]&&_0x313fb2['body'][_0x0ca5('0x8c')]===_0x0ca5('0x5c')){return _0xd01ea0[_0x0ca5('0x31')]({'read':!![]});}else{logger['error'](_0x0ca5('0x8d'),_0x0ca5('0x28'),'twilio',util['inspect'](_0x313fb2['body'],{'showHidden':![],'depth':null}));}break;}return _0xd01ea0;}})['then'](respondWithResult(_0x10819a,null))[_0x0ca5('0x26')](handleError(_0x10819a,null));}; \ No newline at end of file +var _0x84d3=['client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','map','WhatsappMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','ContactId','contact','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise'];(function(_0x4df434,_0x56ed52){var _0x517013=function(_0x504ad8){while(--_0x504ad8){_0x4df434['push'](_0x4df434['shift']());}};_0x517013(++_0x56ed52);}(_0x84d3,0xfc));var _0x384d=function(_0x2938b5,_0x409ed3){_0x2938b5=_0x2938b5-0x0;var _0x594a7a=_0x84d3[_0x2938b5];return _0x594a7a;};'use strict';var emlformat=require(_0x384d('0x0'));var rimraf=require(_0x384d('0x1'));var zipdir=require(_0x384d('0x2'));var jsonpatch=require(_0x384d('0x3'));var rp=require(_0x384d('0x4'));var moment=require(_0x384d('0x5'));var BPromise=require(_0x384d('0x6'));var Mustache=require(_0x384d('0x7'));var util=require('util');var path=require(_0x384d('0x8'));var sox=require(_0x384d('0x9'));var csv=require('to-csv');var ejs=require(_0x384d('0xa'));var fs=require('fs');var fs_extra=require(_0x384d('0xb'));var _=require('lodash');var squel=require(_0x384d('0xc'));var crypto=require(_0x384d('0xd'));var jsforce=require(_0x384d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x384d('0xf'));var querystring=require(_0x384d('0x10'));var Papa=require(_0x384d('0x11'));var Redis=require(_0x384d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x384d('0x13'));var as=require(_0x384d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x384d('0x15'))(_0x384d('0x16'));var utils=require(_0x384d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x384d('0x18'));var db=require(_0x384d('0x19'))['db'];config[_0x384d('0x1a')]=_[_0x384d('0x1b')](config[_0x384d('0x1a')],{'host':_0x384d('0x1c'),'port':0x18eb});var socket=require(_0x384d('0x1d'))(new Redis(config['redis']));require(_0x384d('0x1e'))['register'](socket);var jayson=require(_0x384d('0x1f'));var client=jayson[_0x384d('0x20')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d781e,_0xc9c247,_0x58e0e6,_0x5cb78e){return new BPromise(function(_0x3e450d,_0x4f0d87){var _0x46509e=_0x5cb78e||client;return _0x46509e[_0x384d('0x21')](_0x1d781e,_0x58e0e6)[_0x384d('0x22')](function(_0x16cb45){logger[_0x384d('0x23')](_0x384d('0x24'),_0xc9c247,'request\x20sent');logger[_0x384d('0x25')](_0x384d('0x26'),_0xc9c247,_0x384d('0x27'),JSON['stringify'](_0x16cb45));if(_0x16cb45['error']){if(_0x16cb45[_0x384d('0x28')]['code']===0x1f4){logger[_0x384d('0x28')](_0x384d('0x24'),_0xc9c247,_0x16cb45[_0x384d('0x28')][_0x384d('0x29')]);return _0x4f0d87(_0x16cb45[_0x384d('0x28')]['message']);}logger['error'](_0x384d('0x24'),_0xc9c247,_0x16cb45[_0x384d('0x28')]['message']);return _0x3e450d(_0x16cb45['error'][_0x384d('0x29')]);}else{logger[_0x384d('0x23')](_0x384d('0x24'),_0xc9c247,_0x384d('0x27'));_0x3e450d(_0x16cb45[_0x384d('0x2a')][_0x384d('0x29')]);}})[_0x384d('0x2b')](function(_0x4168a4){logger[_0x384d('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0xc9c247,_0x4168a4);_0x4f0d87(_0x4168a4);});});}function respondWithStatusCode(_0x1a5f99,_0x5e8598){_0x5e8598=_0x5e8598||0xcc;return function(_0x321df9){if(_0x321df9){return _0x1a5f99[_0x384d('0x2c')](_0x5e8598);}return _0x1a5f99[_0x384d('0x2d')](_0x5e8598)[_0x384d('0x2e')]();};}function respondWithResult(_0x45efca,_0x2d06ca){_0x2d06ca=_0x2d06ca||0xc8;return function(_0x5cbb1c){if(_0x5cbb1c){return _0x45efca[_0x384d('0x2d')](_0x2d06ca)[_0x384d('0x2f')](_0x5cbb1c);}};}function respondWithFilteredResult(_0x53cefe,_0x71dad9){return function(_0x438318){if(_0x438318){var _0x2b4511=typeof _0x71dad9[_0x384d('0x30')]===_0x384d('0x31')&&typeof _0x71dad9[_0x384d('0x32')]===_0x384d('0x31');var _0x341c6c=_0x438318[_0x384d('0x33')];var _0x54c4a3=_0x2b4511?0x0:_0x71dad9[_0x384d('0x30')];var _0xbcfc6=_0x2b4511?_0x438318[_0x384d('0x33')]:_0x71dad9[_0x384d('0x30')]+_0x71dad9['limit'];var _0x55b1a5;if(_0xbcfc6>=_0x341c6c){_0xbcfc6=_0x341c6c;_0x55b1a5=0xc8;}else{_0x55b1a5=0xce;}_0x53cefe[_0x384d('0x2d')](_0x55b1a5);return _0x53cefe[_0x384d('0x34')](_0x384d('0x35'),_0x54c4a3+'-'+_0xbcfc6+'/'+_0x341c6c)[_0x384d('0x2f')](_0x438318);}return null;};}function patchUpdates(_0x364194){return function(_0x3059ec){try{jsonpatch[_0x384d('0x36')](_0x3059ec,_0x364194,!![]);}catch(_0x5d215c){return BPromise[_0x384d('0x37')](_0x5d215c);}return _0x3059ec[_0x384d('0x38')]();};}function saveUpdates(_0x32c7ac,_0x569514){return function(_0x57d3a6){if(_0x57d3a6){return _0x57d3a6[_0x384d('0x39')](_0x32c7ac)[_0x384d('0x22')](function(_0x361ed2){return _0x361ed2;});}return null;};}function removeEntity(_0x288116,_0x3cf7ae){return function(_0x6effda){if(_0x6effda){return _0x6effda['destroy']()['then'](function(){_0x288116[_0x384d('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361178,_0x2c3a92){return function(_0x116906){if(!_0x116906){_0x361178[_0x384d('0x2c')](0x194);}return _0x116906;};}function handleError(_0xfd670a,_0x1108e0){_0x1108e0=_0x1108e0||0x1f4;return function(_0x4441bc){logger[_0x384d('0x28')](_0x4441bc[_0x384d('0x3a')]);if(_0x4441bc[_0x384d('0x3b')]){delete _0x4441bc['name'];}_0xfd670a['status'](_0x1108e0)[_0x384d('0x3c')](_0x4441bc);};}exports['index']=function(_0x2289da,_0x27588c){var _0x249ede={},_0x3998bf={},_0x410088={'count':0x0,'rows':[]};var _0x2dca46=_[_0x384d('0x3d')](db[_0x384d('0x3e')]['rawAttributes'],function(_0x500986){return{'name':_0x500986['fieldName'],'type':_0x500986[_0x384d('0x3f')][_0x384d('0x40')]};});_0x3998bf[_0x384d('0x41')]=_[_0x384d('0x3d')](_0x2dca46,'name');_0x3998bf[_0x384d('0x42')]=_[_0x384d('0x43')](_0x2289da['query']);_0x3998bf[_0x384d('0x44')]=_[_0x384d('0x45')](_0x3998bf['model'],_0x3998bf[_0x384d('0x42')]);_0x249ede[_0x384d('0x46')]=_[_0x384d('0x45')](_0x3998bf[_0x384d('0x41')],qs[_0x384d('0x47')](_0x2289da['query']['fields']));_0x249ede[_0x384d('0x46')]=_0x249ede[_0x384d('0x46')][_0x384d('0x48')]?_0x249ede[_0x384d('0x46')]:_0x3998bf[_0x384d('0x41')];if(!_0x2289da['query'][_0x384d('0x49')](_0x384d('0x4a'))){_0x249ede[_0x384d('0x32')]=qs[_0x384d('0x32')](_0x2289da[_0x384d('0x42')]['limit']);_0x249ede[_0x384d('0x30')]=qs['offset'](_0x2289da[_0x384d('0x42')][_0x384d('0x30')]);}_0x249ede[_0x384d('0x4b')]=qs[_0x384d('0x4c')](_0x2289da[_0x384d('0x42')][_0x384d('0x4c')]);_0x249ede['where']=qs[_0x384d('0x44')](_[_0x384d('0x4d')](_0x2289da['query'],_0x3998bf[_0x384d('0x44')]),_0x2dca46);if(_0x2289da[_0x384d('0x42')][_0x384d('0x4e')]){_0x249ede[_0x384d('0x4f')]=_[_0x384d('0x50')](_0x249ede[_0x384d('0x4f')],{'$or':_[_0x384d('0x3d')](_0x2dca46,function(_0x26683d){if(_0x26683d[_0x384d('0x3f')]!=='VIRTUAL'){var _0x290da4={};_0x290da4[_0x26683d['name']]={'$like':'%'+_0x2289da[_0x384d('0x42')]['filter']+'%'};return _0x290da4;}})});}_0x249ede=_[_0x384d('0x50')]({},_0x249ede,_0x2289da[_0x384d('0x51')]);var _0x4ee5a4={'where':_0x249ede['where']};return db[_0x384d('0x3e')][_0x384d('0x33')](_0x4ee5a4)[_0x384d('0x22')](function(_0x159196){_0x410088['count']=_0x159196;if(_0x2289da[_0x384d('0x42')][_0x384d('0x52')]){_0x249ede[_0x384d('0x53')]=[{'all':!![]}];}return db[_0x384d('0x3e')][_0x384d('0x54')](_0x249ede);})['then'](function(_0x381d8c){_0x410088['rows']=_0x381d8c;return _0x410088;})['then'](respondWithFilteredResult(_0x27588c,_0x249ede))[_0x384d('0x2b')](handleError(_0x27588c,null));};exports[_0x384d('0x55')]=function(_0x4a3fa5,_0x13e019){var _0x5579bb={'raw':!![],'where':{'id':_0x4a3fa5[_0x384d('0x56')]['id']}},_0x5ba58a={};_0x5ba58a[_0x384d('0x41')]=_[_0x384d('0x43')](db[_0x384d('0x3e')]['rawAttributes']);_0x5ba58a[_0x384d('0x42')]=_[_0x384d('0x43')](_0x4a3fa5[_0x384d('0x42')]);_0x5ba58a[_0x384d('0x44')]=_[_0x384d('0x45')](_0x5ba58a[_0x384d('0x41')],_0x5ba58a['query']);_0x5579bb['attributes']=_['intersection'](_0x5ba58a[_0x384d('0x41')],qs['fields'](_0x4a3fa5[_0x384d('0x42')][_0x384d('0x47')]));_0x5579bb['attributes']=_0x5579bb['attributes'][_0x384d('0x48')]?_0x5579bb[_0x384d('0x46')]:_0x5ba58a[_0x384d('0x41')];if(_0x4a3fa5[_0x384d('0x42')][_0x384d('0x52')]){_0x5579bb[_0x384d('0x53')]=[{'all':!![]}];}_0x5579bb=_[_0x384d('0x50')]({},_0x5579bb,_0x4a3fa5[_0x384d('0x51')]);return db['WhatsappMessage'][_0x384d('0x57')](_0x5579bb)['then'](handleEntityNotFound(_0x13e019,null))[_0x384d('0x22')](respondWithResult(_0x13e019,null))[_0x384d('0x2b')](handleError(_0x13e019,null));};exports['create']=function(_0x3c06f4,_0x3818c3){return db[_0x384d('0x3e')][_0x384d('0x58')](_0x3c06f4[_0x384d('0x59')],{})[_0x384d('0x22')](respondWithResult(_0x3818c3,0xc9))[_0x384d('0x2b')](handleError(_0x3818c3,null));};exports[_0x384d('0x39')]=function(_0x3afbe3,_0x559e78){if(_0x3afbe3[_0x384d('0x59')]['id']){delete _0x3afbe3[_0x384d('0x59')]['id'];}return db[_0x384d('0x3e')]['find']({'where':{'id':_0x3afbe3['params']['id']}})[_0x384d('0x22')](handleEntityNotFound(_0x559e78,null))[_0x384d('0x22')](saveUpdates(_0x3afbe3[_0x384d('0x59')],null))[_0x384d('0x22')](respondWithResult(_0x559e78,null))['catch'](handleError(_0x559e78,null));};exports[_0x384d('0x5a')]=function(_0x4fb1cd,_0x23bf61){return db['WhatsappMessage'][_0x384d('0x57')]({'where':{'id':_0x4fb1cd[_0x384d('0x56')]['id']}})[_0x384d('0x22')](handleEntityNotFound(_0x23bf61,null))[_0x384d('0x22')](removeEntity(_0x23bf61,null))[_0x384d('0x2b')](handleError(_0x23bf61,null));};exports[_0x384d('0x5b')]=function(_0x2e546c,_0x3b84ce){return db[_0x384d('0x3e')][_0x384d('0x5b')]()[_0x384d('0x22')](respondWithResult(_0x3b84ce,null))[_0x384d('0x2b')](handleError(_0x3b84ce,null));};var interaction_log=require(_0x384d('0x15'))(_0x384d('0x5c'));exports[_0x384d('0x5d')]=function(_0x1aba7a,_0x6e3df5,_0xb563df){var _0x219b5a={'agent':{},'channel':_0x384d('0x5e')};if(_0x1aba7a[_0x384d('0x59')]['id']){delete _0x1aba7a[_0x384d('0x59')]['id'];}_0x1aba7a[_0x384d('0x59')]['read']=!![];_0x1aba7a[_0x384d('0x59')][_0x384d('0x5f')]=moment()[_0x384d('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')]=_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')]||_0x1aba7a['user']['id'];_0x219b5a[_0x384d('0x62')]['id']=_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')];return db[_0x384d('0x3e')][_0x384d('0x57')]({'where':{'id':_0x1aba7a[_0x384d('0x56')]['id'],'UserId':null}})[_0x384d('0x22')](handleEntityNotFound(_0x6e3df5,null))[_0x384d('0x22')](saveUpdates(_0x1aba7a[_0x384d('0x59')],null))[_0x384d('0x22')](function(_0x14eaac){if(_0x14eaac){_0x219b5a['message']=_0x14eaac[_0x384d('0x63')]({'plain':!![]});return db[_0x384d('0x64')][_0x384d('0x57')]({'where':{'id':_0x14eaac[_0x384d('0x65')]}});}return null;})[_0x384d('0x22')](handleEntityNotFound(_0x6e3df5,null))['then'](function(_0x3b2ec8){if(_0x3b2ec8){return _0x3b2ec8[_0x384d('0x39')]({'UserId':_0x1aba7a['body'][_0x384d('0x61')],'read1stAt':_[_0x384d('0x66')](_0x3b2ec8[_0x384d('0x67')])?moment()[_0x384d('0x60')](_0x384d('0x68')):undefined});}return null;})[_0x384d('0x22')](function(_0x24414e){if(_0x24414e){_0x219b5a[_0x384d('0x69')]=_0x24414e[_0x384d('0x63')]({'plain':!![]});interaction_log[_0x384d('0x23')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1aba7a[_0x384d('0x6a')]['id'],_0x1aba7a['user'][_0x384d('0x3b')],_0x1aba7a[_0x384d('0x6a')]['role'],_0x219b5a[_0x384d('0x69')]['id'],_0x1aba7a[_0x384d('0x59')]?JSON['stringify'](_0x1aba7a[_0x384d('0x59')]):_0x384d('0x6b'));return respondWithRpcPromise(_0x384d('0x6c'),_0x384d('0x6d'),_0x219b5a);}return null;})['then'](function(_0x4bccc1){var _0x569378=_0x384d('0x6e')+_0x4bccc1[_0x384d('0x29')]['ContactId'];return db[_0x384d('0x6f')][_0x384d('0x42')](_0x569378,{'type':db[_0x384d('0x70')][_0x384d('0x71')][_0x384d('0x72')],'raw':!![]})[_0x384d('0x22')](function(_0x152fba){return _0x152fba;});})[_0x384d('0x22')](function(_0xad6089){if(_0xad6089){_0x219b5a['message']['contact']=_0xad6089[0x0];if(!_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')])return;return db[_0x384d('0x73')]['find']({'where':{'id':_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')],'role':_0x384d('0x62')},'attributes':['id',_0x384d('0x3b'),_0x384d('0x74'),_0x384d('0x75'),_0x384d('0x76')],'raw':!![]});}return null;})[_0x384d('0x22')](function(_0x44fd17){if(!_0x44fd17)return null;_0x219b5a[_0x384d('0x29')]['agent']=_0x44fd17;return _0x219b5a;})['then'](function(_0x263709){if(_0x263709){if(_0x1aba7a[_0x384d('0x59')][_0x384d('0x77')]){_0x219b5a[_0x384d('0x29')][_0x384d('0x78')]=util[_0x384d('0x60')](_0x384d('0x79'),_0x1aba7a[_0x384d('0x6a')][_0x384d('0x3b')]);_0x219b5a[_0x384d('0x29')]['channel']=_0x219b5a[_0x384d('0x7a')];_0x219b5a[_0x384d('0x29')]['motionChannel']=_0x219b5a['channel'];_0x219b5a[_0x384d('0x29')][_0x384d('0x7b')]=_0x384d('0x5d');return respondWithRpcPromise(_0x384d('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x219b5a[_0x384d('0x29')]},client9002)['then'](function(){return _0x219b5a;});}return _0x219b5a;}return null;})[_0x384d('0x22')](respondWithResult(_0x6e3df5,null))['catch'](handleError(_0x6e3df5,null));};var interaction_log=require(_0x384d('0x15'))(_0x384d('0x5c'));exports['reject']=function(_0x387ab5,_0x3731b5,_0x3e17a0){var _0x3e1334={'agent':{},'channel':'whatsapp'};if(_0x387ab5['body']['id']){delete _0x387ab5[_0x384d('0x59')]['id'];}_0x387ab5[_0x384d('0x59')]['UserId']=_0x387ab5[_0x384d('0x59')][_0x384d('0x61')]||_0x387ab5[_0x384d('0x6a')]['id'];_0x3e1334[_0x384d('0x62')]['id']=_0x387ab5['body'][_0x384d('0x61')];return db[_0x384d('0x3e')][_0x384d('0x57')]({'where':{'id':_0x387ab5['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3731b5,null))[_0x384d('0x22')](function(_0x565ed1){if(_0x565ed1){_0x3e1334[_0x384d('0x29')]=_0x565ed1['get']({'plain':!![]});return db[_0x384d('0x64')][_0x384d('0x57')]({'where':{'id':_0x565ed1['WhatsappInteractionId']}});}return null;})[_0x384d('0x22')](handleEntityNotFound(_0x3731b5,null))['then'](function(_0x162dd2){if(_0x162dd2){_0x3e1334['interaction']=_0x162dd2[_0x384d('0x63')]({'plain':!![]});interaction_log[_0x384d('0x23')](_0x384d('0x7d'),_0x387ab5['user']['id'],_0x387ab5[_0x384d('0x6a')]['name'],_0x387ab5[_0x384d('0x6a')][_0x384d('0x7e')],_0x3e1334['interaction']['id'],_0x387ab5['body']?JSON[_0x384d('0x7f')](_0x387ab5[_0x384d('0x59')]):_0x384d('0x6b'));return respondWithRpcPromise(_0x384d('0x80'),_0x384d('0x81'),_0x3e1334);}return null;})[_0x384d('0x22')](function(_0x18d5b7){var _0x5e2dd6=_0x384d('0x6e')+_0x18d5b7['message'][_0x384d('0x82')];return db[_0x384d('0x6f')]['query'](_0x5e2dd6,{'type':db['Sequelize'][_0x384d('0x71')]['SELECT'],'raw':!![]})[_0x384d('0x22')](function(_0x5e6ac8){return _0x5e6ac8;});})[_0x384d('0x22')](function(_0x20bbd5){if(_0x20bbd5){_0x3e1334[_0x384d('0x29')][_0x384d('0x83')]=_0x20bbd5[0x0];if(!_0x387ab5['body']['UserId'])return;return db[_0x384d('0x73')][_0x384d('0x57')]({'where':{'id':_0x387ab5[_0x384d('0x59')]['UserId'],'role':_0x384d('0x62')},'attributes':['id',_0x384d('0x3b'),_0x384d('0x74'),_0x384d('0x75'),'internal'],'raw':!![]});}return null;})[_0x384d('0x22')](function(_0x3df03b){if(!_0x3df03b)return null;_0x3e1334[_0x384d('0x29')][_0x384d('0x62')]=_0x3df03b;return _0x3e1334;})[_0x384d('0x22')](function(_0x44f3fc){if(_0x44f3fc){_0x44f3fc[_0x384d('0x29')][_0x384d('0x78')]=util[_0x384d('0x60')](_0x384d('0x79'),_0x387ab5[_0x384d('0x6a')][_0x384d('0x3b')]);_0x44f3fc[_0x384d('0x29')][_0x384d('0x7a')]=_0x3e1334[_0x384d('0x7a')];_0x44f3fc[_0x384d('0x29')][_0x384d('0x84')]=_0x3e1334['channel'];_0x44f3fc[_0x384d('0x29')][_0x384d('0x7b')]=_0x384d('0x37');respondWithRpcPromise(_0x384d('0x7c'),'EventManager',{'event':_0x384d('0x85'),'message':_0x44f3fc[_0x384d('0x29')]},client9002);return _0x3e1334;}return null;})[_0x384d('0x22')](respondWithResult(_0x3731b5,null))[_0x384d('0x2b')](handleError(_0x3731b5,null));};exports['status']=function(_0xeb7c0f,_0x3648af,_0x2ea8af){if(_0xeb7c0f[_0x384d('0x59')]['id']){delete _0xeb7c0f['body']['id'];}var _0x425d59;return db[_0x384d('0x3e')][_0x384d('0x57')]({'where':{'id':_0xeb7c0f[_0x384d('0x56')]['id']}})['then'](handleEntityNotFound(_0x3648af,null))[_0x384d('0x22')](function(_0x703656){if(_0x703656){_0x425d59=_0x703656;return db[_0x384d('0x86')][_0x384d('0x57')]({'where':{'id':_0x703656[_0x384d('0x87')]}});}})['then'](handleEntityNotFound(_0x3648af,null))[_0x384d('0x22')](function(_0x20d290){if(_0x20d290){logger['debug'](_0x384d('0x88'),_0x384d('0x2d'),'received\x20delivery\x20report\x20from',_0x20d290[_0x384d('0x3f')],util[_0x384d('0x89')](_0xeb7c0f[_0x384d('0x59')],{'showHidden':![],'depth':null}));switch(_0x20d290[_0x384d('0x3f')]){case _0x384d('0x8a'):if(_0xeb7c0f[_0x384d('0x59')][_0x384d('0x8b')]&&_0xeb7c0f[_0x384d('0x59')][_0x384d('0x8b')]===_0x425d59['messageId']&&_0xeb7c0f[_0x384d('0x59')][_0x384d('0x8c')]&&_0xeb7c0f['body']['MessageStatus']==='read'){return _0x425d59['update']({'read':!![]});}else{logger[_0x384d('0x28')](_0x384d('0x8d'),'status',_0x384d('0x8a'),util[_0x384d('0x89')](_0xeb7c0f[_0x384d('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x425d59;}})[_0x384d('0x22')](respondWithResult(_0x3648af,null))[_0x384d('0x2b')](handleError(_0x3648af,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 51e30a7..d5e722c 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 _0x9158=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0xea3feb,_0x29a19d){var _0x4871c2=function(_0x389204){while(--_0x389204){_0xea3feb['push'](_0xea3feb['shift']());}};_0x4871c2(++_0x29a19d);}(_0x9158,0x16e));var _0x8915=function(_0x1eb906,_0x16ffff){_0x1eb906=_0x1eb906-0x0;var _0x1cc457=_0x9158[_0x1eb906];return _0x1cc457;};'use strict';var EventEmitter=require(_0x8915('0x0'));var WhatsappMessage=require(_0x8915('0x1'))['db'][_0x8915('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8915('0x3'),'afterUpdate':'update','afterDestroy':_0x8915('0x4')};function emitEvent(_0x488b04){return function(_0x525bfe,_0x151f9c,_0x41d3aa){WhatsappMessageEvents[_0x8915('0x5')](_0x488b04+':'+_0x525bfe['id'],_0x525bfe);WhatsappMessageEvents[_0x8915('0x5')](_0x488b04,_0x525bfe);_0x41d3aa(null);};}for(var e in events){if(events[_0x8915('0x6')](e)){var event=events[e];WhatsappMessage[_0x8915('0x7')](e,emitEvent(event));}}module[_0x8915('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x58a4=['emit','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1e23bd,_0x3072cb){var _0x5e0f24=function(_0x1f9c1a){while(--_0x1f9c1a){_0x1e23bd['push'](_0x1e23bd['shift']());}};_0x5e0f24(++_0x3072cb);}(_0x58a4,0xbf));var _0x458a=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x58a4[_0x10dc64];return _0x9cf98d;};'use strict';var EventEmitter=require(_0x458a('0x0'));var WhatsappMessage=require(_0x458a('0x1'))['db'][_0x458a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x458a('0x3')](0x0);var events={'afterCreate':_0x458a('0x4'),'afterUpdate':_0x458a('0x5'),'afterDestroy':_0x458a('0x6')};function emitEvent(_0xacd5b3){return function(_0x362079,_0x1b4d2e,_0x2fde72){WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3+':'+_0x362079['id'],_0x362079);WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3,_0x362079);_0x2fde72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x458a('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1000fd9..42965b8 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 _0x5d55=['application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','util','api','moment','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','WhatsappInteractionId','then','update','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','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'];(function(_0x3babdc,_0x271f5a){var _0x3662b4=function(_0x3d7723){while(--_0x3d7723){_0x3babdc['push'](_0x3babdc['shift']());}};_0x3662b4(++_0x271f5a);}(_0x5d55,0x1a4));var _0x55d5=function(_0x5ea56b,_0x48fd85){_0x5ea56b=_0x5ea56b-0x0;var _0x491b23=_0x5d55[_0x5ea56b];return _0x491b23;};'use strict';var _=require('lodash');var util=require(_0x55d5('0x0'));var logger=require('../../config/logger')(_0x55d5('0x1'));var moment=require(_0x55d5('0x2'));var BPromise=require('bluebird');var rp=require(_0x55d5('0x3'));var fetch=require(_0x55d5('0x4'));var fs=require('fs');var path=require(_0x55d5('0x5'));var rimraf=require('rimraf');var config=require(_0x55d5('0x6'));var attributes=require(_0x55d5('0x7'));module[_0x55d5('0x8')]=function(_0x35fe43,_0x16d364){return _0x35fe43[_0x55d5('0x9')](_0x55d5('0xa'),attributes,{'tableName':_0x55d5('0xb'),'paranoid':![],'indexes':[{'name':_0x55d5('0xc'),'fields':['messageId']},{'name':_0x55d5('0xd'),'fields':[_0x55d5('0xe')],'type':_0x55d5('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x64f70a,_0xdac85,_0x4db860){var _0x45569e=_0x35fe43['models'];var _0x2b02b2=_0x64f70a[_0x55d5('0x10')]({'plain':!![]});if(_0x2b02b2[_0x55d5('0x11')][_0x55d5('0x12')]()==='in'||_0x2b02b2[_0x55d5('0x11')]['toLowerCase']()===_0x55d5('0x13')&&!_0x2b02b2[_0x55d5('0x14')]&&!_[_0x55d5('0x15')](_0x2b02b2['UserId'])){_0x45569e[_0x55d5('0x16')]['findOne']({'where':{'id':_0x2b02b2[_0x55d5('0x17')]}})[_0x55d5('0x18')](function(_0x2c2da1){if(_0x2c2da1){_0x2c2da1[_0x55d5('0x19')]({'lastMsgAt':_0x2b02b2['createdAt'],'lastMsgDirection':_0x2b02b2[_0x55d5('0x11')][_0x55d5('0x12')]()});}})[_0x55d5('0x1a')](function(_0x4b4502){console[_0x55d5('0x1b')](_0x4b4502);});}if(_0x2b02b2['direction']===_0x55d5('0x13')&&!_0x2b02b2['secret']){var _0x273e51;_0x45569e[_0x55d5('0x1c')]['find']({'where':{'id':_0x2b02b2[_0x55d5('0x1d')]},'raw':!![]})[_0x55d5('0x18')](function(_0x2c0324){_0x273e51=_0x2c0324;if(_0x273e51&&_0x273e51[_0x55d5('0x1e')]){switch(_0x273e51['type']){case _0x55d5('0x1f'):var _0x3f245d=require(_0x55d5('0x1f'));if(_0x273e51[_0x55d5('0x20')]&&_0x273e51[_0x55d5('0x21')]&&_0x273e51[_0x55d5('0x22')]){var _0x5f05b3=new _0x3f245d(_0x273e51[_0x55d5('0x20')],_0x273e51['authToken']);_0x5f05b3[_0x55d5('0x23')][_0x55d5('0x24')]({'body':_0x2b02b2[_0x55d5('0xe')],'to':_0x55d5('0x25')+_0x2b02b2['phone'],'from':_0x55d5('0x25')+_0x273e51[_0x55d5('0x22')],'statusCallback':_0x273e51[_0x55d5('0x26')]+_0x55d5('0x27')+_0x2b02b2['id']+'/status?token='+_0x273e51[_0x55d5('0x28')]})['then'](function(_0x5a0f15){if(_0x5a0f15[_0x55d5('0x29')]){return _0x64f70a[_0x55d5('0x19')]({'messageId':_0x5a0f15['sid']});}})['catch'](function(_0x421cf2){logger[_0x55d5('0x1b')](_0x55d5('0x2a'),_0x55d5('0x2b'),_0x55d5('0x1f'),util[_0x55d5('0x2c')](_0x421cf2,{'showHidden':![],'depth':null}));});}else{logger[_0x55d5('0x1b')](_0x55d5('0x2a'),_0x55d5('0x2b'),'twilio',_0x55d5('0x2d'));}break;case _0x55d5('0x2e'):var _0x5ec2b5=_0x273e51[_0x55d5('0x20')];var _0x47c53c=_0x273e51[_0x55d5('0x21')];var _0x2b2806=_0x273e51[_0x55d5('0x2f')]+_0x55d5('0x30')+_0x5ec2b5+_0x55d5('0x31');var _0x4bd4c7={'to':[_0x2b02b2[_0x55d5('0x22')]],'message':{'type':'text','text':_0x2b02b2['body']}};var _0x797306={'method':_0x55d5('0x32'),'uri':_0x2b2806,'headers':{'Authorization':_0x55d5('0x33')+_0x47c53c,'Content-Type':_0x55d5('0x34')},'body':_0x4bd4c7,'json':!![]};rp(_0x797306)[_0x55d5('0x18')](function(_0x1bc10a){if(_0x1bc10a[_0x55d5('0x35')][0x0][_0x55d5('0x36')]){return _0x64f70a['update']({'messageId':_0x1bc10a[_0x55d5('0x35')][0x0]['message_id']});}})[_0x55d5('0x1a')](function(_0x1e8cdb){logger[_0x55d5('0x37')](_0x55d5('0x38'),_0x1e8cdb);});break;}}})[_0x55d5('0x39')](function(){_0x4db860();});}else{_0x4db860();}}},'charset':_0x55d5('0x3a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x34e7=['../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','baseUrl','/whatsapp/v1/','/messages/','text','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf'];(function(_0x36ef48,_0x5e0395){var _0x191fe8=function(_0x1bd1b1){while(--_0x1bd1b1){_0x36ef48['push'](_0x36ef48['shift']());}};_0x191fe8(++_0x5e0395);}(_0x34e7,0x164));var _0x734e=function(_0x2d8d12,_0x5ec696){_0x2d8d12=_0x2d8d12-0x0;var _0x3c2473=_0x34e7[_0x2d8d12];return _0x3c2473;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var logger=require(_0x734e('0x2'))(_0x734e('0x3'));var moment=require(_0x734e('0x4'));var BPromise=require(_0x734e('0x5'));var rp=require(_0x734e('0x6'));var fetch=require(_0x734e('0x7'));var fs=require('fs');var path=require(_0x734e('0x8'));var rimraf=require(_0x734e('0x9'));var config=require(_0x734e('0xa'));var attributes=require(_0x734e('0xb'));module[_0x734e('0xc')]=function(_0x192562,_0x4f49aa){return _0x192562[_0x734e('0xd')](_0x734e('0xe'),attributes,{'tableName':_0x734e('0xf'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x734e('0x10')]},{'name':'fti_whatsapp_messages','fields':[_0x734e('0x11')],'type':_0x734e('0x12')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eee26,_0x4161e2,_0x37350f){var _0x3d117e=_0x192562['models'];var _0x49be19=_0x3eee26[_0x734e('0x13')]({'plain':!![]});if(_0x49be19[_0x734e('0x14')][_0x734e('0x15')]()==='in'||_0x49be19[_0x734e('0x14')]['toLowerCase']()===_0x734e('0x16')&&!_0x49be19[_0x734e('0x17')]&&!_['isNil'](_0x49be19[_0x734e('0x18')])){_0x3d117e[_0x734e('0x19')][_0x734e('0x1a')]({'where':{'id':_0x49be19[_0x734e('0x1b')]}})[_0x734e('0x1c')](function(_0x4e22b5){if(_0x4e22b5){_0x4e22b5[_0x734e('0x1d')]({'lastMsgAt':_0x49be19[_0x734e('0x1e')],'lastMsgDirection':_0x49be19[_0x734e('0x14')]['toLowerCase']()});}})[_0x734e('0x1f')](function(_0x4cb595){console[_0x734e('0x20')](_0x4cb595);});}if(_0x49be19[_0x734e('0x14')]==='out'&&!_0x49be19[_0x734e('0x17')]){var _0x52b432;_0x3d117e[_0x734e('0x21')]['find']({'where':{'id':_0x49be19[_0x734e('0x22')]},'raw':!![]})[_0x734e('0x1c')](function(_0x207a8f){_0x52b432=_0x207a8f;if(_0x52b432&&_0x52b432[_0x734e('0x23')]){switch(_0x52b432[_0x734e('0x23')]){case _0x734e('0x24'):var _0x138b29=require(_0x734e('0x24'));if(_0x52b432[_0x734e('0x25')]&&_0x52b432['authToken']&&_0x52b432[_0x734e('0x26')]){var _0x47bc5e=new _0x138b29(_0x52b432[_0x734e('0x25')],_0x52b432['authToken']);_0x47bc5e['messages'][_0x734e('0x27')]({'body':_0x49be19['body'],'to':_0x734e('0x28')+_0x49be19['phone'],'from':_0x734e('0x28')+_0x52b432[_0x734e('0x26')],'statusCallback':_0x52b432[_0x734e('0x29')]+_0x734e('0x2a')+_0x49be19['id']+_0x734e('0x2b')+_0x52b432[_0x734e('0x2c')]})[_0x734e('0x1c')](function(_0x3170c5){if(_0x3170c5[_0x734e('0x2d')]){return _0x3eee26['update']({'messageId':_0x3170c5['sid']});}})[_0x734e('0x1f')](function(_0x417961){logger[_0x734e('0x20')](_0x734e('0x2e'),_0x734e('0x2f'),_0x734e('0x24'),util[_0x734e('0x30')](_0x417961,{'showHidden':![],'depth':null}));});}else{logger[_0x734e('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x734e('0x2f'),'twilio',_0x734e('0x31'));}break;case _0x734e('0x32'):var _0x710b4=_0x52b432[_0x734e('0x25')];var _0x50e64c=_0x52b432[_0x734e('0x33')];var _0x273438=_0x52b432[_0x734e('0x34')]+_0x734e('0x35')+_0x710b4+_0x734e('0x36');var _0x51ef7e={'to':[_0x49be19[_0x734e('0x26')]],'message':{'type':_0x734e('0x37'),'text':_0x49be19[_0x734e('0x11')]}};var _0xf9deb1={'method':'POST','uri':_0x273438,'headers':{'Authorization':'Bearer\x20'+_0x50e64c,'Content-Type':'application/json'},'body':_0x51ef7e,'json':!![]};rp(_0xf9deb1)[_0x734e('0x1c')](function(_0xbf389e){if(_0xbf389e[_0x734e('0x38')][0x0][_0x734e('0x39')]){return _0x3eee26[_0x734e('0x1d')]({'messageId':_0xbf389e[_0x734e('0x38')][0x0][_0x734e('0x39')]});}})[_0x734e('0x1f')](function(_0x2a0409){logger['err']('WhatsappMessage,\x20%s',_0x2a0409);});break;}}})[_0x734e('0x3a')](function(){_0x37350f();});}else{_0x37350f();}}},'charset':_0x734e('0x3b'),'collate':_0x734e('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 312c929..44406e8 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 _0xa38b=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa38b,0x1e1));var _0xba38=function(_0x40429f,_0x10e210){_0x40429f=_0x40429f-0x0;var _0x3ba51d=_0xa38b[_0x40429f];return _0x3ba51d;};'use strict';var _=require('lodash');var util=require(_0xba38('0x0'));var moment=require(_0xba38('0x1'));var BPromise=require(_0xba38('0x2'));var rs=require(_0xba38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba38('0x4'))['db'];var utils=require(_0xba38('0x5'));var logger=require(_0xba38('0x6'))(_0xba38('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xba38('0x8')]({'port':0x232a});config[_0xba38('0x9')]=_[_0xba38('0xa')](config[_0xba38('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba38('0x9')]));require(_0xba38('0xb'))[_0xba38('0xc')](socket);function respondWithRpcPromise(_0x4d26a7,_0x505986,_0xe1f244){return new BPromise(function(_0x4b9955,_0x879d44){return client[_0xba38('0xd')](_0x4d26a7,_0xe1f244)[_0xba38('0xe')](function(_0x277cf5){logger['info'](_0xba38('0xf'),_0x505986,_0xba38('0x10'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x505986,_0xba38('0x10'),JSON[_0xba38('0x11')](_0x277cf5));if(_0x277cf5[_0xba38('0x12')]){if(_0x277cf5[_0xba38('0x12')]['code']===0x1f4){logger[_0xba38('0x12')](_0xba38('0xf'),_0x505986,_0x277cf5[_0xba38('0x12')][_0xba38('0x13')]);return _0x879d44(_0x277cf5[_0xba38('0x12')][_0xba38('0x13')]);}logger[_0xba38('0x12')](_0xba38('0xf'),_0x505986,_0x277cf5[_0xba38('0x12')][_0xba38('0x13')]);return _0x4b9955(_0x277cf5[_0xba38('0x12')]['message']);}else{logger[_0xba38('0x14')](_0xba38('0xf'),_0x505986,_0xba38('0x10'));_0x4b9955(_0x277cf5[_0xba38('0x15')][_0xba38('0x13')]);}})['catch'](function(_0x348e87){logger[_0xba38('0x12')](_0xba38('0xf'),_0x505986,_0x348e87);_0x879d44(_0x348e87);});});}exports[_0xba38('0x16')]=function(_0x231a17){var _0x1c459e=this;return new Promise(function(_0x986b24,_0x48ce26){return db[_0xba38('0x17')][_0xba38('0x18')](_0x231a17[_0xba38('0x19')],{'raw':_0x231a17[_0xba38('0x1a')]?_0x231a17['options'][_0xba38('0x1b')]===undefined?!![]:![]:!![]})[_0xba38('0xe')](function(_0x388a54){logger[_0xba38('0x14')](_0xba38('0x16'),_0x231a17);logger[_0xba38('0x1c')](_0xba38('0x16'),_0x231a17,JSON[_0xba38('0x11')](_0x388a54));_0x986b24(_0x388a54);})[_0xba38('0x1d')](function(_0x5386c6){logger['error']('CreateWhatsappMessage',_0x5386c6['message'],_0x231a17);_0x48ce26(_0x1c459e[_0xba38('0x12')](0x1f4,_0x5386c6[_0xba38('0x13')]));});});}; \ No newline at end of file +var _0x40b4=['request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','WhatsappMessage,\x20%s,\x20%s'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0x40b4,0x10d));var _0x440b=function(_0x3dd3ee,_0x3dbf50){_0x3dd3ee=_0x3dd3ee-0x0;var _0x59b7a9=_0x40b4[_0x3dd3ee];return _0x59b7a9;};'use strict';var _=require(_0x440b('0x0'));var util=require(_0x440b('0x1'));var moment=require(_0x440b('0x2'));var BPromise=require(_0x440b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x440b('0x4'));var db=require(_0x440b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x440b('0x6'))(_0x440b('0x7'));var config=require(_0x440b('0x8'));var jayson=require(_0x440b('0x9'));var client=jayson['client'][_0x440b('0xa')]({'port':0x232a});config['redis']=_[_0x440b('0xb')](config[_0x440b('0xc')],{'host':_0x440b('0xd'),'port':0x18eb});var socket=require(_0x440b('0xe'))(new Redis(config['redis']));require(_0x440b('0xf'))[_0x440b('0x10')](socket);function respondWithRpcPromise(_0x172904,_0x10c3d6,_0x16c0de){return new BPromise(function(_0x22ef2c,_0x5a77b9){return client['request'](_0x172904,_0x16c0de)[_0x440b('0x11')](function(_0x16507e){logger['info'](_0x440b('0x12'),_0x10c3d6,_0x440b('0x13'));logger['debug'](_0x440b('0x14'),_0x10c3d6,'request\x20sent',JSON[_0x440b('0x15')](_0x16507e));if(_0x16507e[_0x440b('0x16')]){if(_0x16507e[_0x440b('0x16')]['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x10c3d6,_0x16507e[_0x440b('0x16')][_0x440b('0x17')]);return _0x5a77b9(_0x16507e[_0x440b('0x16')][_0x440b('0x17')]);}logger[_0x440b('0x16')](_0x440b('0x12'),_0x10c3d6,_0x16507e['error'][_0x440b('0x17')]);return _0x22ef2c(_0x16507e[_0x440b('0x16')][_0x440b('0x17')]);}else{logger[_0x440b('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x10c3d6,_0x440b('0x13'));_0x22ef2c(_0x16507e['result'][_0x440b('0x17')]);}})[_0x440b('0x19')](function(_0x497023){logger[_0x440b('0x16')](_0x440b('0x12'),_0x10c3d6,_0x497023);_0x5a77b9(_0x497023);});});}exports[_0x440b('0x1a')]=function(_0x37abcd){var _0xe892e2=this;return new Promise(function(_0x655c0a,_0x326af1){return db[_0x440b('0x1b')][_0x440b('0x1c')](_0x37abcd[_0x440b('0x1d')],{'raw':_0x37abcd['options']?_0x37abcd[_0x440b('0x1e')][_0x440b('0x1f')]===undefined?!![]:![]:!![]})[_0x440b('0x11')](function(_0x597b63){logger['info'](_0x440b('0x1a'),_0x37abcd);logger['debug'](_0x440b('0x1a'),_0x37abcd,JSON[_0x440b('0x15')](_0x597b63));_0x655c0a(_0x597b63);})['catch'](function(_0x24a791){logger['error'](_0x440b('0x1a'),_0x24a791[_0x440b('0x17')],_0x37abcd);_0x326af1(_0xe892e2['error'](0x1f4,_0x24a791[_0x440b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8ab1b44..ae955c9 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 _0xe1aa=['./whatsappMessage.events','save','update','removeListener','length','whatsappMessage:'];(function(_0xb896f1,_0x5ae94b){var _0x113140=function(_0x44be24){while(--_0x44be24){_0xb896f1['push'](_0xb896f1['shift']());}};_0x113140(++_0x5ae94b);}(_0xe1aa,0xa8));var _0xae1a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe1aa[_0x6c993a];return _0x27f547;};'use strict';var WhatsappMessageEvents=require(_0xae1a('0x0'));var events=[_0xae1a('0x1'),'remove',_0xae1a('0x2')];function createListener(_0x507a50,_0x3f263a){return function(_0x3de395){_0x3f263a['emit'](_0x507a50,_0x3de395);};}function removeListener(_0x2a44fe,_0x32bec7){return function(){WhatsappMessageEvents[_0xae1a('0x3')](_0x2a44fe,_0x32bec7);};}exports['register']=function(_0x3c4600){for(var _0xaf0d8c=0x0,_0x5cdd6c=events[_0xae1a('0x4')];_0xaf0d8c<_0x5cdd6c;_0xaf0d8c++){var _0x264dcf=events[_0xaf0d8c];var _0xcec48f=createListener(_0xae1a('0x5')+_0x264dcf,_0x3c4600);WhatsappMessageEvents['on'](_0x264dcf,_0xcec48f);}}; \ No newline at end of file +var _0x10ff=['./whatsappMessage.events','save','remove','update','emit','removeListener','register','whatsappMessage:'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x10ff,0xe8));var _0xf10f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x10ff[_0x40a045];return _0x1a687c;};'use strict';var WhatsappMessageEvents=require(_0xf10f('0x0'));var events=[_0xf10f('0x1'),_0xf10f('0x2'),_0xf10f('0x3')];function createListener(_0x125dae,_0x188dbe){return function(_0x21955e){_0x188dbe[_0xf10f('0x4')](_0x125dae,_0x21955e);};}function removeListener(_0x1aa458,_0x11e1e6){return function(){WhatsappMessageEvents[_0xf10f('0x5')](_0x1aa458,_0x11e1e6);};}exports[_0xf10f('0x6')]=function(_0x57f0e6){for(var _0x5d3f63=0x0,_0x37e143=events['length'];_0x5d3f63<_0x37e143;_0x5d3f63++){var _0x369c4b=events[_0x5d3f63];var _0x126618=createListener(_0xf10f('0x7')+_0x369c4b,_0x57f0e6);WhatsappMessageEvents['on'](_0x369c4b,_0x126618);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 1a164b8..2b2dd49 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 _0xd3ee=['/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','/describe','describe'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xd3ee,0x167));var _0xed3e=function(_0x38a155,_0x2aa026){_0x38a155=_0x38a155-0x0;var _0x269403=_0xd3ee[_0x38a155];return _0x269403;};'use strict';var multer=require(_0xed3e('0x0'));var util=require(_0xed3e('0x1'));var path=require(_0xed3e('0x2'));var timeout=require(_0xed3e('0x3'));var express=require('express');var router=express[_0xed3e('0x4')]();var fs_extra=require(_0xed3e('0x5'));var auth=require(_0xed3e('0x6'));var interaction=require(_0xed3e('0x7'));var config=require(_0xed3e('0x8'));var controller=require(_0xed3e('0x9'));router[_0xed3e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xed3e('0xa')](_0xed3e('0xb'),auth['isAuthenticated'](),controller[_0xed3e('0xc')]);router[_0xed3e('0xa')](_0xed3e('0xd'),auth[_0xed3e('0xe')](),controller[_0xed3e('0xf')]);router['get'](_0xed3e('0x10'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x11')]);router[_0xed3e('0xa')](_0xed3e('0x12'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x13')]);router['get'](_0xed3e('0x14'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x15')]);router[_0xed3e('0x16')]('/',auth[_0xed3e('0xe')](),controller[_0xed3e('0x17')]);router[_0xed3e('0x16')](_0xed3e('0x12'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x18')]);router[_0xed3e('0x16')]('/:id/users',auth[_0xed3e('0xe')](),controller['addAgents']);router[_0xed3e('0x19')](_0xed3e('0xd'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x1a')]);router['delete'](_0xed3e('0xd'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x1b')]);router[_0xed3e('0x1c')](_0xed3e('0x12'),auth['isAuthenticated'](),controller[_0xed3e('0x1d')]);router[_0xed3e('0x1c')](_0xed3e('0x14'),auth[_0xed3e('0xe')](),controller[_0xed3e('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x4135=['post','create','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents'];(function(_0x380c7f,_0x234003){var _0x57f3c2=function(_0x5b0848){while(--_0x5b0848){_0x380c7f['push'](_0x380c7f['shift']());}};_0x57f3c2(++_0x234003);}(_0x4135,0x1b9));var _0x5413=function(_0x22ed33,_0x30116f){_0x22ed33=_0x22ed33-0x0;var _0x2c4cf2=_0x4135[_0x22ed33];return _0x2c4cf2;};'use strict';var multer=require(_0x5413('0x0'));var util=require(_0x5413('0x1'));var path=require(_0x5413('0x2'));var timeout=require(_0x5413('0x3'));var express=require(_0x5413('0x4'));var router=express[_0x5413('0x5')]();var fs_extra=require(_0x5413('0x6'));var auth=require(_0x5413('0x7'));var interaction=require(_0x5413('0x8'));var config=require(_0x5413('0x9'));var controller=require('./whatsappQueue.controller');router[_0x5413('0xa')]('/',auth[_0x5413('0xb')](),controller['index']);router[_0x5413('0xa')](_0x5413('0xc'),auth[_0x5413('0xb')](),controller[_0x5413('0xd')]);router['get'](_0x5413('0xe'),auth['isAuthenticated'](),controller[_0x5413('0xf')]);router[_0x5413('0xa')](_0x5413('0x10'),auth[_0x5413('0xb')](),controller[_0x5413('0x11')]);router[_0x5413('0xa')]('/:id/teams',auth[_0x5413('0xb')](),controller[_0x5413('0x12')]);router['get'](_0x5413('0x13'),auth[_0x5413('0xb')](),controller[_0x5413('0x14')]);router[_0x5413('0x15')]('/',auth[_0x5413('0xb')](),controller[_0x5413('0x16')]);router[_0x5413('0x15')](_0x5413('0x17'),auth[_0x5413('0xb')](),controller[_0x5413('0x18')]);router[_0x5413('0x15')]('/:id/users',auth[_0x5413('0xb')](),controller[_0x5413('0x19')]);router[_0x5413('0x1a')](_0x5413('0xe'),auth[_0x5413('0xb')](),controller[_0x5413('0x1b')]);router['delete']('/:id',auth[_0x5413('0xb')](),controller[_0x5413('0x1c')]);router[_0x5413('0x1d')](_0x5413('0x17'),auth[_0x5413('0xb')](),controller[_0x5413('0x1e')]);router[_0x5413('0x1d')](_0x5413('0x13'),auth[_0x5413('0xb')](),controller[_0x5413('0x1f')]);module[_0x5413('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 39f91ce..bf1cce7 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 _0x132f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xe6cfe9,_0xcce4e){var _0x3809cf=function(_0x1f4c70){while(--_0x1f4c70){_0xe6cfe9['push'](_0xe6cfe9['shift']());}};_0x3809cf(++_0xcce4e);}(_0x132f,0x182));var _0xf132=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x132f[_0x71cd05];return _0x59c9e7;};'use strict';var Sequelize=require(_0xf132('0x0'));module[_0xf132('0x1')]={'name':{'type':Sequelize[_0xf132('0x2')],'unique':_0xf132('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf132('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf132('0x5')]('rrmemory',_0xf132('0x6'),_0xf132('0x7'))},'description':{'type':Sequelize[_0xf132('0x2')]}}; \ No newline at end of file +var _0x668b=['name','INTEGER','rrmemory','roundrobin','STRING','sequelize','exports'];(function(_0x395fa6,_0x2696f3){var _0x3f9bdb=function(_0x12bb0e){while(--_0x12bb0e){_0x395fa6['push'](_0x395fa6['shift']());}};_0x3f9bdb(++_0x2696f3);}(_0x668b,0x140));var _0xb668=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0x668b[_0x5caf7e];return _0x5c3435;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb668('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb668('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb668('0x4'),'beepall',_0xb668('0x5'))},'description':{'type':Sequelize[_0xb668('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 0833912..03baecf 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 _0x1a04=['apply','update','then','destroy','get','WhatsappQueues','sendStatus','error','stack','name','send','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','WhatsappQueue','count','includeAll','findAll','catch','show','params','rawAttributes','include','create','body','user','role','userProfileId','UserProfileResource','find','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','order','WhatsappQueueId','User','findAndCountAll','UserId','createdAt','rows','whatsappPause','updatedAt','getTeams','addTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','Content-Range'];(function(_0x31c6b6,_0xdd33b7){var _0x32b27b=function(_0x32f195){while(--_0x32f195){_0x31c6b6['push'](_0x31c6b6['shift']());}};_0x32b27b(++_0xdd33b7);}(_0x1a04,0xeb));var _0x41a0=function(_0x251def,_0x1901af){_0x251def=_0x251def-0x0;var _0x540231=_0x1a04[_0x251def];return _0x540231;};'use strict';var emlformat=require(_0x41a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x41a0('0x2'));var BPromise=require(_0x41a0('0x3'));var Mustache=require(_0x41a0('0x4'));var util=require('util');var path=require(_0x41a0('0x5'));var sox=require(_0x41a0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41a0('0x7'));var squel=require('squel');var crypto=require(_0x41a0('0x8'));var jsforce=require(_0x41a0('0x9'));var deskjs=require(_0x41a0('0xa'));var toCsv=require(_0x41a0('0xb'));var querystring=require(_0x41a0('0xc'));var Papa=require('papaparse');var Redis=require(_0x41a0('0xd'));var authService=require(_0x41a0('0xe'));var qs=require(_0x41a0('0xf'));var as=require(_0x41a0('0x10'));var hardwareService=require(_0x41a0('0x11'));var logger=require(_0x41a0('0x12'))(_0x41a0('0x13'));var utils=require(_0x41a0('0x14'));var config=require(_0x41a0('0x15'));var licenseUtil=require(_0x41a0('0x16'));var db=require(_0x41a0('0x17'))['db'];config['redis']=_['defaults'](config[_0x41a0('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x41a0('0x19'))(new Redis(config['redis']));require(_0x41a0('0x1a'))[_0x41a0('0x1b')](socket);function respondWithStatusCode(_0x32d260,_0x2c82b7){_0x2c82b7=_0x2c82b7||0xcc;return function(_0xc0c611){if(_0xc0c611){return _0x32d260['sendStatus'](_0x2c82b7);}return _0x32d260[_0x41a0('0x1c')](_0x2c82b7)[_0x41a0('0x1d')]();};}function respondWithResult(_0x3338b4,_0x1687aa){_0x1687aa=_0x1687aa||0xc8;return function(_0x40c627){if(_0x40c627){return _0x3338b4[_0x41a0('0x1c')](_0x1687aa)[_0x41a0('0x1e')](_0x40c627);}};}function respondWithFilteredResult(_0x30f66e,_0x344bdc){return function(_0x342e3c){if(_0x342e3c){var _0x255b61=typeof _0x344bdc[_0x41a0('0x1f')]===_0x41a0('0x20')&&typeof _0x344bdc['limit']==='undefined';var _0x2d159c=_0x342e3c['count'];var _0x3dd772=_0x255b61?0x0:_0x344bdc['offset'];var _0x287bc4=_0x255b61?_0x342e3c['count']:_0x344bdc[_0x41a0('0x1f')]+_0x344bdc[_0x41a0('0x21')];var _0x313d95;if(_0x287bc4>=_0x2d159c){_0x287bc4=_0x2d159c;_0x313d95=0xc8;}else{_0x313d95=0xce;}_0x30f66e[_0x41a0('0x1c')](_0x313d95);return _0x30f66e['set'](_0x41a0('0x22'),_0x3dd772+'-'+_0x287bc4+'/'+_0x2d159c)[_0x41a0('0x1e')](_0x342e3c);}return null;};}function patchUpdates(_0x1c1223){return function(_0x494c03){try{jsonpatch[_0x41a0('0x23')](_0x494c03,_0x1c1223,!![]);}catch(_0x400c8d){return BPromise['reject'](_0x400c8d);}return _0x494c03['save']();};}function saveUpdates(_0xbcbe43,_0x3ca509){return function(_0x385083){if(_0x385083){return _0x385083[_0x41a0('0x24')](_0xbcbe43)[_0x41a0('0x25')](function(_0x35e9f3){return _0x35e9f3;});}return null;};}function removeEntity(_0xf51e48,_0x3fc018){return function(_0x35f486){if(_0x35f486){return _0x35f486[_0x41a0('0x26')]()[_0x41a0('0x25')](function(){var _0x239623=_0x35f486[_0x41a0('0x27')]({'plain':!![]});var _0x3f6b1b=_0x41a0('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3f6b1b,'resourceId':_0x239623['id']}})[_0x41a0('0x25')](function(){return _0x35f486;});})[_0x41a0('0x25')](function(){_0xf51e48['status'](0xcc)[_0x41a0('0x1d')]();});}};}function handleEntityNotFound(_0x461fa6,_0x15149f){return function(_0x548699){if(!_0x548699){_0x461fa6[_0x41a0('0x29')](0x194);}return _0x548699;};}function handleError(_0x2bebf4,_0xe5e872){_0xe5e872=_0xe5e872||0x1f4;return function(_0x1a58af){logger[_0x41a0('0x2a')](_0x1a58af[_0x41a0('0x2b')]);if(_0x1a58af['name']){delete _0x1a58af[_0x41a0('0x2c')];}_0x2bebf4[_0x41a0('0x1c')](_0xe5e872)[_0x41a0('0x2d')](_0x1a58af);};}exports['index']=function(_0x2b9afe,_0x5886bf){var _0x52cf28={},_0xece091={},_0x39f518={'count':0x0,'rows':[]};var _0x354a19=_['map'](db['WhatsappQueue']['rawAttributes'],function(_0x3878e0){return{'name':_0x3878e0['fieldName'],'type':_0x3878e0['type']['key']};});_0xece091[_0x41a0('0x2e')]=_[_0x41a0('0x2f')](_0x354a19,_0x41a0('0x2c'));_0xece091[_0x41a0('0x30')]=_[_0x41a0('0x31')](_0x2b9afe[_0x41a0('0x30')]);_0xece091[_0x41a0('0x32')]=_[_0x41a0('0x33')](_0xece091[_0x41a0('0x2e')],_0xece091[_0x41a0('0x30')]);_0x52cf28[_0x41a0('0x34')]=_['intersection'](_0xece091[_0x41a0('0x2e')],qs[_0x41a0('0x35')](_0x2b9afe[_0x41a0('0x30')]['fields']));_0x52cf28['attributes']=_0x52cf28[_0x41a0('0x34')][_0x41a0('0x36')]?_0x52cf28[_0x41a0('0x34')]:_0xece091['model'];if(!_0x2b9afe[_0x41a0('0x30')]['hasOwnProperty'](_0x41a0('0x37'))){_0x52cf28[_0x41a0('0x21')]=qs[_0x41a0('0x21')](_0x2b9afe['query'][_0x41a0('0x21')]);_0x52cf28[_0x41a0('0x1f')]=qs[_0x41a0('0x1f')](_0x2b9afe[_0x41a0('0x30')][_0x41a0('0x1f')]);}_0x52cf28['order']=qs[_0x41a0('0x38')](_0x2b9afe['query']['sort']);_0x52cf28[_0x41a0('0x39')]=qs[_0x41a0('0x32')](_[_0x41a0('0x3a')](_0x2b9afe[_0x41a0('0x30')],_0xece091[_0x41a0('0x32')]),_0x354a19);if(_0x2b9afe[_0x41a0('0x30')][_0x41a0('0x3b')]){_0x52cf28[_0x41a0('0x39')]=_[_0x41a0('0x3c')](_0x52cf28['where'],{'$or':_[_0x41a0('0x2f')](_0x354a19,function(_0x448acc){if(_0x448acc[_0x41a0('0x3d')]!==_0x41a0('0x3e')){var _0x188480={};_0x188480[_0x448acc['name']]={'$like':'%'+_0x2b9afe['query'][_0x41a0('0x3b')]+'%'};return _0x188480;}})});}_0x52cf28=_['merge']({},_0x52cf28,_0x2b9afe[_0x41a0('0x3f')]);var _0x2d9768={'where':_0x52cf28['where']};return db[_0x41a0('0x40')][_0x41a0('0x41')](_0x2d9768)[_0x41a0('0x25')](function(_0xdedd97){_0x39f518[_0x41a0('0x41')]=_0xdedd97;if(_0x2b9afe[_0x41a0('0x30')][_0x41a0('0x42')]){_0x52cf28['include']=[{'all':!![]}];}return db[_0x41a0('0x40')][_0x41a0('0x43')](_0x52cf28);})['then'](function(_0x50693c){_0x39f518['rows']=_0x50693c;return _0x39f518;})[_0x41a0('0x25')](respondWithFilteredResult(_0x5886bf,_0x52cf28))[_0x41a0('0x44')](handleError(_0x5886bf,null));};exports[_0x41a0('0x45')]=function(_0x3bc716,_0xf1d290){var _0x17cabc={'raw':!![],'where':{'id':_0x3bc716[_0x41a0('0x46')]['id']}},_0x5c96d8={};_0x5c96d8[_0x41a0('0x2e')]=_[_0x41a0('0x31')](db['WhatsappQueue'][_0x41a0('0x47')]);_0x5c96d8[_0x41a0('0x30')]=_[_0x41a0('0x31')](_0x3bc716[_0x41a0('0x30')]);_0x5c96d8[_0x41a0('0x32')]=_[_0x41a0('0x33')](_0x5c96d8[_0x41a0('0x2e')],_0x5c96d8[_0x41a0('0x30')]);_0x17cabc['attributes']=_[_0x41a0('0x33')](_0x5c96d8[_0x41a0('0x2e')],qs[_0x41a0('0x35')](_0x3bc716[_0x41a0('0x30')][_0x41a0('0x35')]));_0x17cabc[_0x41a0('0x34')]=_0x17cabc[_0x41a0('0x34')][_0x41a0('0x36')]?_0x17cabc[_0x41a0('0x34')]:_0x5c96d8[_0x41a0('0x2e')];if(_0x3bc716[_0x41a0('0x30')][_0x41a0('0x42')]){_0x17cabc[_0x41a0('0x48')]=[{'all':!![]}];}_0x17cabc=_[_0x41a0('0x3c')]({},_0x17cabc,_0x3bc716[_0x41a0('0x3f')]);return db[_0x41a0('0x40')]['find'](_0x17cabc)[_0x41a0('0x25')](handleEntityNotFound(_0xf1d290,null))[_0x41a0('0x25')](respondWithResult(_0xf1d290,null))[_0x41a0('0x44')](handleError(_0xf1d290,null));};exports[_0x41a0('0x49')]=function(_0x4120e8,_0xb81b12){return db['WhatsappQueue']['create'](_0x4120e8[_0x41a0('0x4a')],{})[_0x41a0('0x25')](function(_0x308ebb){var _0x923e1a=_0x4120e8[_0x41a0('0x4b')][_0x41a0('0x27')]({'plain':!![]});if(!_0x923e1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x923e1a[_0x41a0('0x4c')]==='user'){var _0x347240=_0x308ebb[_0x41a0('0x27')]({'plain':!![]});var _0x73aaac=_0x41a0('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x73aaac,'userProfileId':_0x923e1a[_0x41a0('0x4d')]},'raw':!![]})[_0x41a0('0x25')](function(_0x5301e2){if(_0x5301e2&&_0x5301e2['autoAssociation']===0x0){return db[_0x41a0('0x4e')][_0x41a0('0x49')]({'name':_0x347240[_0x41a0('0x2c')],'resourceId':_0x347240['id'],'type':_0x5301e2[_0x41a0('0x2c')],'sectionId':_0x5301e2['id']},{})[_0x41a0('0x25')](function(){return _0x308ebb;});}else{return _0x308ebb;}})[_0x41a0('0x44')](function(_0x13f5c8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13f5c8);throw _0x13f5c8;});}return _0x308ebb;})['then'](respondWithResult(_0xb81b12,0xc9))['catch'](handleError(_0xb81b12,null));};exports[_0x41a0('0x24')]=function(_0x16e3d2,_0x3da22a){if(_0x16e3d2[_0x41a0('0x4a')]['id']){delete _0x16e3d2[_0x41a0('0x4a')]['id'];}return db[_0x41a0('0x40')][_0x41a0('0x4f')]({'where':{'id':_0x16e3d2[_0x41a0('0x46')]['id']}})[_0x41a0('0x25')](handleEntityNotFound(_0x3da22a,null))[_0x41a0('0x25')](saveUpdates(_0x16e3d2[_0x41a0('0x4a')],null))[_0x41a0('0x25')](respondWithResult(_0x3da22a,null))['catch'](handleError(_0x3da22a,null));};exports['destroy']=function(_0x1ffac9,_0x1ccf94){return db[_0x41a0('0x40')][_0x41a0('0x4f')]({'where':{'id':_0x1ffac9[_0x41a0('0x46')]['id']}})[_0x41a0('0x25')](handleEntityNotFound(_0x1ccf94,null))[_0x41a0('0x25')](removeEntity(_0x1ccf94,null))[_0x41a0('0x44')](handleError(_0x1ccf94,null));};exports[_0x41a0('0x50')]=function(_0x30c7fb,_0x78d7ae){return db[_0x41a0('0x40')][_0x41a0('0x50')]()[_0x41a0('0x25')](respondWithResult(_0x78d7ae,null))['catch'](handleError(_0x78d7ae,null));};exports[_0x41a0('0x51')]=function(_0x5b9dfa,_0x41fff7,_0x402ee4){var _0x5365f4={'raw':!![],'where':{}},_0x3f04b5={},_0xf79eb4;return db[_0x41a0('0x40')][_0x41a0('0x52')]({'where':{'id':_0x5b9dfa[_0x41a0('0x46')]['id']}})[_0x41a0('0x25')](handleEntityNotFound(_0x41fff7,null))[_0x41a0('0x25')](function(_0xa2a4bb){if(_0xa2a4bb){_0xf79eb4=_0xa2a4bb[_0x41a0('0x27')]({'plain':!![]});_0x3f04b5[_0x41a0('0x2e')]=_[_0x41a0('0x31')](db[_0x41a0('0x53')][_0x41a0('0x47')]);_0x3f04b5[_0x41a0('0x30')]=_[_0x41a0('0x31')](_0x5b9dfa[_0x41a0('0x30')]);_0x3f04b5[_0x41a0('0x32')]=_[_0x41a0('0x33')](_0x3f04b5[_0x41a0('0x2e')],_0x3f04b5['query']);_0x5365f4[_0x41a0('0x34')]=_[_0x41a0('0x33')](_0x3f04b5[_0x41a0('0x2e')],qs[_0x41a0('0x35')](_0x5b9dfa['query'][_0x41a0('0x35')]));_0x5365f4[_0x41a0('0x34')]=_0x5365f4['attributes']['length']?_0x5365f4[_0x41a0('0x34')]:_0x3f04b5[_0x41a0('0x2e')];if(!_0x5b9dfa[_0x41a0('0x30')][_0x41a0('0x54')](_0x41a0('0x37'))){_0x5365f4[_0x41a0('0x21')]=qs[_0x41a0('0x21')](_0x5b9dfa[_0x41a0('0x30')]['limit']);_0x5365f4[_0x41a0('0x1f')]=qs[_0x41a0('0x1f')](_0x5b9dfa[_0x41a0('0x30')]['offset']);}_0x5365f4[_0x41a0('0x55')]=qs[_0x41a0('0x38')](_0x5b9dfa['query'][_0x41a0('0x38')]);_0x5365f4['where']=qs[_0x41a0('0x32')](_['pick'](_0x5b9dfa['query'],_0x3f04b5['filters']));_0x5365f4[_0x41a0('0x39')][_0x41a0('0x56')]=_0xa2a4bb['id'];if(_0x5b9dfa[_0x41a0('0x30')][_0x41a0('0x3b')]){_0x5365f4[_0x41a0('0x39')]=_[_0x41a0('0x3c')](_0x5365f4[_0x41a0('0x39')],{'$or':_[_0x41a0('0x2f')](_0x5365f4[_0x41a0('0x34')],function(_0x1aabd2){var _0x5dbd82={};_0x5dbd82[_0x1aabd2]={'$like':'%'+_0x5b9dfa[_0x41a0('0x30')][_0x41a0('0x3b')]+'%'};return _0x5dbd82;})});}_0x5365f4=_['merge']({},_0x5365f4,_0x5b9dfa[_0x41a0('0x3f')]);return db[_0x41a0('0x53')][_0x41a0('0x43')](_0x5365f4);}})[_0x41a0('0x25')](function(_0x21f59e){if(_0x21f59e){return db[_0x41a0('0x57')][_0x41a0('0x58')]({'where':{'id':_['map'](_0x21f59e,_0x41a0('0x59')),'role':'agent'},'attributes':['id',_0x41a0('0x2c'),'whatsappPause','updatedAt',_0x41a0('0x5a')]});}})[_0x41a0('0x25')](function(_0x11b457){if(_0x11b457){return{'count':_0x11b457[_0x41a0('0x41')],'rows':_[_0x41a0('0x2f')](_0x11b457[_0x41a0('0x5b')],function(_0x497123){return{'membername':_0x497123[_0x41a0('0x2c')],'UserId':_0x497123['id'],'queue_name':_0xf79eb4[_0x41a0('0x2c')],'WhatsappQueueId':_0xf79eb4['id'],'interface':util['format']('%s/%s','SIP',_0x497123['name']),'penalty':0x0,'paused':_0x497123[_0x41a0('0x5c')],'createdAt':_0x497123[_0x41a0('0x5a')],'updatedAt':_0x497123[_0x41a0('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x41a0('0x25')](respondWithFilteredResult(_0x41fff7,_0x5365f4))[_0x41a0('0x44')](handleError(_0x41fff7,null));};exports[_0x41a0('0x5e')]=function(_0x5c2e7b,_0x5d29b5,_0x542b9d){var _0x3e6592={};var _0x1dbbb8={};var _0x35e2ba;var _0x290729;return db[_0x41a0('0x40')][_0x41a0('0x52')]({'where':{'id':_0x5c2e7b[_0x41a0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d29b5,null))[_0x41a0('0x25')](function(_0x4c0167){if(_0x4c0167){_0x35e2ba=_0x4c0167;_0x1dbbb8['model']=_[_0x41a0('0x31')](db['Team'][_0x41a0('0x47')]);_0x1dbbb8[_0x41a0('0x30')]=_[_0x41a0('0x31')](_0x5c2e7b['query']);_0x1dbbb8['filters']=_['intersection'](_0x1dbbb8['model'],_0x1dbbb8[_0x41a0('0x30')]);_0x3e6592[_0x41a0('0x34')]=_[_0x41a0('0x33')](_0x1dbbb8[_0x41a0('0x2e')],qs[_0x41a0('0x35')](_0x5c2e7b[_0x41a0('0x30')]['fields']));_0x3e6592[_0x41a0('0x34')]=_0x3e6592[_0x41a0('0x34')][_0x41a0('0x36')]?_0x3e6592[_0x41a0('0x34')]:_0x1dbbb8[_0x41a0('0x2e')];_0x3e6592[_0x41a0('0x55')]=qs[_0x41a0('0x38')](_0x5c2e7b['query']['sort']);_0x3e6592[_0x41a0('0x39')]=qs[_0x41a0('0x32')](_[_0x41a0('0x3a')](_0x5c2e7b['query'],_0x1dbbb8['filters']));if(_0x5c2e7b[_0x41a0('0x30')][_0x41a0('0x3b')]){_0x3e6592[_0x41a0('0x39')]=_[_0x41a0('0x3c')](_0x3e6592['where'],{'$or':_[_0x41a0('0x2f')](_0x3e6592['attributes'],function(_0x49388c){var _0x29be7c={};_0x29be7c[_0x49388c]={'$like':'%'+_0x5c2e7b['query'][_0x41a0('0x3b')]+'%'};return _0x29be7c;})});}_0x3e6592=_[_0x41a0('0x3c')]({},_0x3e6592,_0x5c2e7b[_0x41a0('0x3f')]);return _0x35e2ba['getTeams'](_0x3e6592);}})[_0x41a0('0x25')](function(_0x39da56){if(_0x39da56){_0x290729=_0x39da56[_0x41a0('0x36')];if(!_0x5c2e7b[_0x41a0('0x30')][_0x41a0('0x54')](_0x41a0('0x37'))){_0x3e6592[_0x41a0('0x21')]=qs[_0x41a0('0x21')](_0x5c2e7b[_0x41a0('0x30')][_0x41a0('0x21')]);_0x3e6592[_0x41a0('0x1f')]=qs['offset'](_0x5c2e7b[_0x41a0('0x30')][_0x41a0('0x1f')]);}return _0x35e2ba[_0x41a0('0x5e')](_0x3e6592);}})[_0x41a0('0x25')](function(_0xd2f5b7){if(_0xd2f5b7){return _0xd2f5b7?{'count':_0x290729,'rows':_0xd2f5b7}:null;}})[_0x41a0('0x25')](respondWithResult(_0x5d29b5,null))[_0x41a0('0x44')](handleError(_0x5d29b5,null));};exports[_0x41a0('0x5f')]=function(_0x561675,_0x31a594,_0x1c29a0){var _0x2eeebc=_0x561675[_0x41a0('0x4a')]['ids'];return db[_0x41a0('0x60')][_0x41a0('0x43')]({'where':{'id':_0x2eeebc},'attributes':['id'],'include':[{'model':db[_0x41a0('0x57')],'as':_0x41a0('0x61'),'attributes':['id',_0x41a0('0x2c'),'online',_0x41a0('0x62'),_0x41a0('0x63')],'raw':!![]}]})['then'](function(_0x483d29){if(_0x483d29){var _0x49dfff=_[_0x41a0('0x64')](_0x483d29,function(_0xddfc8a){var _0x1bf9bf=_0xddfc8a['get']({'plain':!![]});return _0x1bf9bf['Agents'];});return db[_0x41a0('0x40')][_0x41a0('0x4f')]({'where':{'id':_0x561675[_0x41a0('0x46')]['id']}})[_0x41a0('0x25')](function(_0x584bc9){return db[_0x41a0('0x65')][_0x41a0('0x66')](function(_0x2fc95d){return _0x584bc9['addTeams'](_0x2eeebc,{'transaction':_0x2fc95d})[_0x41a0('0x25')](function(){return BPromise['each'](_0x49dfff,function(_0xac55c){return db[_0x41a0('0x53')][_0x41a0('0x67')]({'where':{'UserId':_0xac55c['id'],'WhatsappQueueId':_0x561675[_0x41a0('0x46')]['id']},'transaction':_0x2fc95d});});})[_0x41a0('0x25')](function(){_0x49dfff[_0x41a0('0x68')](function(_0x292598){socket[_0x41a0('0x69')](_0x41a0('0x6a'),{'UserId':_0x292598['id'],'WhatsappQueueId':_0x584bc9['id']});});});});});}})[_0x41a0('0x25')](respondWithStatusCode(_0x31a594,null))[_0x41a0('0x44')](handleError(_0x31a594,null));};exports['removeTeams']=function(_0x2ab534,_0x18d1ec,_0x2de729){return db['Team'][_0x41a0('0x43')]({'where':{'id':_0x2ab534['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x41a0('0x57')],'as':_0x41a0('0x61'),'attributes':['id'],'raw':!![]}]})[_0x41a0('0x25')](handleEntityNotFound(_0x18d1ec,null))[_0x41a0('0x25')](function(_0x1f77b7){var _0x1b1e8d=_['map'](_0x1f77b7,'id');var _0x155198=[];var _0x2f016c=[];var _0x5d4aae=squel[_0x41a0('0x6b')]();_0x5d4aae[_0x41a0('0x6c')](_0x41a0('0x6d'))[_0x41a0('0x6e')](_0x41a0('0x6f'),'tq')[_0x41a0('0x70')](_0x41a0('0x71'),'ut',_0x41a0('0x72'))[_0x41a0('0x39')]('WhatsappQueueId\x20=\x20?',_0x2ab534[_0x41a0('0x46')]['id']);for(var _0x13f75c=0x0;_0x13f75c<_0x1f77b7[_0x41a0('0x36')];_0x13f75c+=0x1){let _0xf6f41a=_0x1f77b7[_0x13f75c];for(var _0xdf0247=0x0;_0xdf0247<_0xf6f41a[_0x41a0('0x61')][_0x41a0('0x36')];_0xdf0247+=0x1){let _0x2a71ba=_0xf6f41a['Agents'][_0xdf0247];var _0xb0c578=_0x5d4aae['clone']();_0xb0c578[_0x41a0('0x39')](_0x41a0('0x73'),_0x2a71ba['id']);_0x2f016c['push'](db[_0x41a0('0x65')][_0x41a0('0x30')](_0xb0c578['toString'](),{'type':db[_0x41a0('0x65')][_0x41a0('0x74')][_0x41a0('0x75')]})['then'](function(_0x47fe89){if(_0x47fe89['length']===0x1){return _0x2a71ba['id'];}else{var _0x2464fc=_[_0x41a0('0x76')](_['map'](_0x47fe89,_0x41a0('0x77')),function(_0x72f90b){return _[_0x41a0('0x78')](_0x1b1e8d,_0x72f90b);});if(_0x2464fc){return _0x2a71ba['id'];}}}));}}return BPromise[_0x41a0('0x79')](_0x2f016c)[_0x41a0('0x25')](function(_0x1811bf){_0x155198=_(_0x155198)[_0x41a0('0x7a')](_0x1811bf)[_0x41a0('0x7b')]()[_0x41a0('0x7c')]();return db['WhatsappQueue'][_0x41a0('0x4f')]({'where':{'id':_0x2ab534['params']['id']}})['then'](function(_0x465ab7){return db[_0x41a0('0x65')][_0x41a0('0x66')](function(_0x4a7eec){return _0x465ab7[_0x41a0('0x7d')](_0x2ab534['query'][_0x41a0('0x7e')],{'transaction':_0x4a7eec})[_0x41a0('0x25')](function(){if(!_[_0x41a0('0x7f')](_0x155198)){return _0x465ab7[_0x41a0('0x80')](_0x155198,{'transaction':_0x4a7eec});}})['then'](function(){_0x155198[_0x41a0('0x68')](function(_0x4301df){socket[_0x41a0('0x69')](_0x41a0('0x81'),{'UserId':_0x4301df,'WhatsappQueueId':_0x465ab7['id']});});});});});});})['then'](respondWithStatusCode(_0x18d1ec,null))[_0x41a0('0x44')](handleError(_0x18d1ec,null));};exports[_0x41a0('0x82')]=function(_0x4f6b9c,_0x15924e,_0x109c16){return db[_0x41a0('0x40')][_0x41a0('0x4f')]({'where':{'id':_0x4f6b9c[_0x41a0('0x46')]['id']}})['then'](handleEntityNotFound(_0x15924e,null))[_0x41a0('0x25')](function(_0x2b87dd){if(_0x2b87dd){return _0x2b87dd['addAgents'](_0x4f6b9c[_0x41a0('0x4a')][_0x41a0('0x7e')],_[_0x41a0('0x83')](_0x4f6b9c[_0x41a0('0x4a')],['ids','id'])||{})[_0x41a0('0x84')](function(_0x418ebc){for(var _0x1df3ff=0x0;_0x1df3ff<_0x4f6b9c[_0x41a0('0x4a')][_0x41a0('0x7e')][_0x41a0('0x36')];_0x1df3ff+=0x1){socket[_0x41a0('0x69')](_0x41a0('0x6a'),{'UserId':Number(_0x4f6b9c['body'][_0x41a0('0x7e')][_0x1df3ff]),'WhatsappQueueId':Number(_0x4f6b9c[_0x41a0('0x46')]['id'])});}return _0x418ebc;});}})['then'](respondWithResult(_0x15924e,null))[_0x41a0('0x44')](handleError(_0x15924e,null));};exports[_0x41a0('0x80')]=function(_0xfa330b,_0xce934c,_0x184c86){return db[_0x41a0('0x40')][_0x41a0('0x4f')]({'where':{'id':_0xfa330b[_0x41a0('0x46')]['id']}})[_0x41a0('0x25')](handleEntityNotFound(_0xce934c,null))['then'](function(_0x17fcd8){if(_0x17fcd8){return _0x17fcd8['removeAgents'](_0xfa330b[_0x41a0('0x30')][_0x41a0('0x7e')])[_0x41a0('0x25')](function(){if(_[_0x41a0('0x85')](_0xfa330b[_0x41a0('0x30')][_0x41a0('0x7e')])){for(var _0x4d05f7=0x0;_0x4d05f7<_0xfa330b['query'][_0x41a0('0x7e')]['length'];_0x4d05f7+=0x1){socket[_0x41a0('0x69')](_0x41a0('0x81'),{'UserId':Number(_0xfa330b[_0x41a0('0x30')][_0x41a0('0x7e')][_0x4d05f7]),'WhatsappQueueId':Number(_0xfa330b[_0x41a0('0x46')]['id'])});}}else{socket[_0x41a0('0x69')](_0x41a0('0x81'),{'UserId':Number(_0xfa330b[_0x41a0('0x30')]['ids']),'WhatsappQueueId':Number(_0xfa330b[_0x41a0('0x46')]['id'])});}});}})[_0x41a0('0x25')](respondWithStatusCode(_0xce934c,null))[_0x41a0('0x44')](handleError(_0xce934c,null));};exports['getAgents']=function(_0x5ecbf7,_0x1ee630,_0x347cb5){var _0x370fd8={};var _0x560544={};var _0x1ae6bd;var _0x51174b;return db[_0x41a0('0x40')][_0x41a0('0x52')]({'where':{'id':_0x5ecbf7[_0x41a0('0x46')]['id']}})[_0x41a0('0x25')](handleEntityNotFound(_0x1ee630,null))[_0x41a0('0x25')](function(_0x1c1375){if(_0x1c1375){_0x1ae6bd=_0x1c1375;_0x560544[_0x41a0('0x2e')]=_[_0x41a0('0x31')](db[_0x41a0('0x57')][_0x41a0('0x47')]);_0x560544['query']=_[_0x41a0('0x31')](_0x5ecbf7[_0x41a0('0x30')]);_0x560544[_0x41a0('0x32')]=_['intersection'](_0x560544[_0x41a0('0x2e')],_0x560544[_0x41a0('0x30')]);_0x370fd8[_0x41a0('0x34')]=_[_0x41a0('0x33')](_0x560544[_0x41a0('0x2e')],qs['fields'](_0x5ecbf7[_0x41a0('0x30')]['fields']));_0x370fd8['attributes']=_0x370fd8[_0x41a0('0x34')][_0x41a0('0x36')]?_0x370fd8[_0x41a0('0x34')]:_0x560544[_0x41a0('0x2e')];_0x370fd8[_0x41a0('0x55')]=qs[_0x41a0('0x38')](_0x5ecbf7[_0x41a0('0x30')][_0x41a0('0x38')]);_0x370fd8[_0x41a0('0x39')]=qs['filters'](_['pick'](_0x5ecbf7[_0x41a0('0x30')],_0x560544[_0x41a0('0x32')]));if(_0x5ecbf7[_0x41a0('0x30')][_0x41a0('0x3b')]){_0x370fd8['where']=_[_0x41a0('0x3c')](_0x370fd8[_0x41a0('0x39')],{'$or':_[_0x41a0('0x2f')](_0x370fd8[_0x41a0('0x34')],function(_0x87d072){var _0x4d9d4d={};_0x4d9d4d[_0x87d072]={'$like':'%'+_0x5ecbf7['query'][_0x41a0('0x3b')]+'%'};return _0x4d9d4d;})});}_0x370fd8=_[_0x41a0('0x3c')]({},_0x370fd8,_0x5ecbf7[_0x41a0('0x3f')]);return _0x1ae6bd['getAgents'](_0x370fd8);}})[_0x41a0('0x25')](function(_0x17ba67){if(_0x17ba67){_0x51174b=_0x17ba67['length'];if(!_0x5ecbf7[_0x41a0('0x30')]['hasOwnProperty'](_0x41a0('0x37'))){_0x370fd8[_0x41a0('0x21')]=qs[_0x41a0('0x21')](_0x5ecbf7[_0x41a0('0x30')][_0x41a0('0x21')]);_0x370fd8[_0x41a0('0x1f')]=qs[_0x41a0('0x1f')](_0x5ecbf7[_0x41a0('0x30')][_0x41a0('0x1f')]);}return _0x1ae6bd[_0x41a0('0x86')](_0x370fd8);}})['then'](function(_0x1cb17d){if(_0x1cb17d){return _0x1cb17d?{'count':_0x51174b,'rows':_0x1cb17d}:null;}})[_0x41a0('0x25')](respondWithResult(_0x1ee630,null))[_0x41a0('0x44')](handleError(_0x1ee630,null));}; \ No newline at end of file +var _0x9b0d=['to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','map','rawAttributes','fieldName','key','filters','model','fields','query','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','WhatsappQueue','includeAll','findAll','rows','catch','params','keys','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','select','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','removeTeams','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x4e518d,_0x32a45d){var _0x458ff2=function(_0xc96c49){while(--_0xc96c49){_0x4e518d['push'](_0x4e518d['shift']());}};_0x458ff2(++_0x32a45d);}(_0x9b0d,0x82));var _0xd9b0=function(_0x1cadcd,_0x7dabc5){_0x1cadcd=_0x1cadcd-0x0;var _0xfbbb2d=_0x9b0d[_0x1cadcd];return _0xfbbb2d;};'use strict';var emlformat=require(_0xd9b0('0x0'));var rimraf=require(_0xd9b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9b0('0x2'));var rp=require('request-promise');var moment=require(_0xd9b0('0x3'));var BPromise=require(_0xd9b0('0x4'));var Mustache=require(_0xd9b0('0x5'));var util=require('util');var path=require(_0xd9b0('0x6'));var sox=require('sox');var csv=require(_0xd9b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9b0('0x8'));var _=require(_0xd9b0('0x9'));var squel=require('squel');var crypto=require(_0xd9b0('0xa'));var jsforce=require(_0xd9b0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd9b0('0x7'));var querystring=require(_0xd9b0('0xc'));var Papa=require('papaparse');var Redis=require(_0xd9b0('0xd'));var authService=require(_0xd9b0('0xe'));var qs=require(_0xd9b0('0xf'));var as=require(_0xd9b0('0x10'));var hardwareService=require(_0xd9b0('0x11'));var logger=require(_0xd9b0('0x12'))(_0xd9b0('0x13'));var utils=require(_0xd9b0('0x14'));var config=require(_0xd9b0('0x15'));var licenseUtil=require(_0xd9b0('0x16'));var db=require(_0xd9b0('0x17'))['db'];config[_0xd9b0('0x18')]=_[_0xd9b0('0x19')](config[_0xd9b0('0x18')],{'host':_0xd9b0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd9b0('0x18')]));require(_0xd9b0('0x1b'))[_0xd9b0('0x1c')](socket);function respondWithStatusCode(_0x5239f7,_0x2d321f){_0x2d321f=_0x2d321f||0xcc;return function(_0x174170){if(_0x174170){return _0x5239f7[_0xd9b0('0x1d')](_0x2d321f);}return _0x5239f7[_0xd9b0('0x1e')](_0x2d321f)[_0xd9b0('0x1f')]();};}function respondWithResult(_0x1d332c,_0x2c32a6){_0x2c32a6=_0x2c32a6||0xc8;return function(_0x13db66){if(_0x13db66){return _0x1d332c[_0xd9b0('0x1e')](_0x2c32a6)[_0xd9b0('0x20')](_0x13db66);}};}function respondWithFilteredResult(_0x33aa88,_0x235750){return function(_0xe301f1){if(_0xe301f1){var _0x82db68=typeof _0x235750[_0xd9b0('0x21')]===_0xd9b0('0x22')&&typeof _0x235750[_0xd9b0('0x23')]===_0xd9b0('0x22');var _0x5c9893=_0xe301f1[_0xd9b0('0x24')];var _0x287174=_0x82db68?0x0:_0x235750[_0xd9b0('0x21')];var _0x1f6a62=_0x82db68?_0xe301f1[_0xd9b0('0x24')]:_0x235750['offset']+_0x235750[_0xd9b0('0x23')];var _0x4f05f0;if(_0x1f6a62>=_0x5c9893){_0x1f6a62=_0x5c9893;_0x4f05f0=0xc8;}else{_0x4f05f0=0xce;}_0x33aa88['status'](_0x4f05f0);return _0x33aa88[_0xd9b0('0x25')]('Content-Range',_0x287174+'-'+_0x1f6a62+'/'+_0x5c9893)[_0xd9b0('0x20')](_0xe301f1);}return null;};}function patchUpdates(_0x504de7){return function(_0x3e376b){try{jsonpatch[_0xd9b0('0x26')](_0x3e376b,_0x504de7,!![]);}catch(_0x1e6f12){return BPromise['reject'](_0x1e6f12);}return _0x3e376b['save']();};}function saveUpdates(_0x580ce7,_0x426618){return function(_0x369168){if(_0x369168){return _0x369168['update'](_0x580ce7)[_0xd9b0('0x27')](function(_0x56874b){return _0x56874b;});}return null;};}function removeEntity(_0x17012f,_0x1fae62){return function(_0x797db2){if(_0x797db2){return _0x797db2[_0xd9b0('0x28')]()[_0xd9b0('0x27')](function(){var _0x3d40e2=_0x797db2[_0xd9b0('0x29')]({'plain':!![]});var _0x4aae32=_0xd9b0('0x2a');return db[_0xd9b0('0x2b')][_0xd9b0('0x28')]({'where':{'type':_0x4aae32,'resourceId':_0x3d40e2['id']}})[_0xd9b0('0x27')](function(){return _0x797db2;});})[_0xd9b0('0x27')](function(){_0x17012f['status'](0xcc)[_0xd9b0('0x1f')]();});}};}function handleEntityNotFound(_0x21d876,_0x3944b8){return function(_0x36396e){if(!_0x36396e){_0x21d876[_0xd9b0('0x1d')](0x194);}return _0x36396e;};}function handleError(_0x5800c4,_0x5853f9){_0x5853f9=_0x5853f9||0x1f4;return function(_0xe14269){logger[_0xd9b0('0x2c')](_0xe14269['stack']);if(_0xe14269[_0xd9b0('0x2d')]){delete _0xe14269[_0xd9b0('0x2d')];}_0x5800c4[_0xd9b0('0x1e')](_0x5853f9)['send'](_0xe14269);};}exports['index']=function(_0x350238,_0x59fca3){var _0x5e1735={},_0x44b7b5={},_0x41393e={'count':0x0,'rows':[]};var _0x514e24=_[_0xd9b0('0x2e')](db['WhatsappQueue'][_0xd9b0('0x2f')],function(_0x12696c){return{'name':_0x12696c[_0xd9b0('0x30')],'type':_0x12696c['type'][_0xd9b0('0x31')]};});_0x44b7b5['model']=_[_0xd9b0('0x2e')](_0x514e24,'name');_0x44b7b5['query']=_['keys'](_0x350238['query']);_0x44b7b5[_0xd9b0('0x32')]=_['intersection'](_0x44b7b5[_0xd9b0('0x33')],_0x44b7b5['query']);_0x5e1735['attributes']=_['intersection'](_0x44b7b5[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x350238[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x5e1735[_0xd9b0('0x36')]=_0x5e1735[_0xd9b0('0x36')][_0xd9b0('0x37')]?_0x5e1735['attributes']:_0x44b7b5[_0xd9b0('0x33')];if(!_0x350238[_0xd9b0('0x35')][_0xd9b0('0x38')]('nolimit')){_0x5e1735['limit']=qs[_0xd9b0('0x23')](_0x350238[_0xd9b0('0x35')][_0xd9b0('0x23')]);_0x5e1735['offset']=qs[_0xd9b0('0x21')](_0x350238[_0xd9b0('0x35')]['offset']);}_0x5e1735[_0xd9b0('0x39')]=qs[_0xd9b0('0x3a')](_0x350238[_0xd9b0('0x35')][_0xd9b0('0x3a')]);_0x5e1735[_0xd9b0('0x3b')]=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x350238[_0xd9b0('0x35')],_0x44b7b5[_0xd9b0('0x32')]),_0x514e24);if(_0x350238[_0xd9b0('0x35')]['filter']){_0x5e1735['where']=_[_0xd9b0('0x3d')](_0x5e1735['where'],{'$or':_[_0xd9b0('0x2e')](_0x514e24,function(_0x3b19d5){if(_0x3b19d5[_0xd9b0('0x3e')]!==_0xd9b0('0x3f')){var _0x4340f8={};_0x4340f8[_0x3b19d5[_0xd9b0('0x2d')]]={'$like':'%'+_0x350238[_0xd9b0('0x35')][_0xd9b0('0x40')]+'%'};return _0x4340f8;}})});}_0x5e1735=_['merge']({},_0x5e1735,_0x350238['options']);var _0xba1c7c={'where':_0x5e1735[_0xd9b0('0x3b')]};return db[_0xd9b0('0x41')]['count'](_0xba1c7c)['then'](function(_0x282dfc){_0x41393e[_0xd9b0('0x24')]=_0x282dfc;if(_0x350238[_0xd9b0('0x35')][_0xd9b0('0x42')]){_0x5e1735['include']=[{'all':!![]}];}return db[_0xd9b0('0x41')][_0xd9b0('0x43')](_0x5e1735);})['then'](function(_0x213a8f){_0x41393e[_0xd9b0('0x44')]=_0x213a8f;return _0x41393e;})[_0xd9b0('0x27')](respondWithFilteredResult(_0x59fca3,_0x5e1735))[_0xd9b0('0x45')](handleError(_0x59fca3,null));};exports['show']=function(_0x1f499a,_0x3ff62a){var _0x4abc71={'raw':!![],'where':{'id':_0x1f499a[_0xd9b0('0x46')]['id']}},_0x241e47={};_0x241e47['model']=_[_0xd9b0('0x47')](db['WhatsappQueue'][_0xd9b0('0x2f')]);_0x241e47[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x1f499a[_0xd9b0('0x35')]);_0x241e47['filters']=_[_0xd9b0('0x48')](_0x241e47['model'],_0x241e47[_0xd9b0('0x35')]);_0x4abc71['attributes']=_[_0xd9b0('0x48')](_0x241e47[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x1f499a[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x4abc71[_0xd9b0('0x36')]=_0x4abc71[_0xd9b0('0x36')][_0xd9b0('0x37')]?_0x4abc71[_0xd9b0('0x36')]:_0x241e47[_0xd9b0('0x33')];if(_0x1f499a['query'][_0xd9b0('0x42')]){_0x4abc71[_0xd9b0('0x49')]=[{'all':!![]}];}_0x4abc71=_[_0xd9b0('0x3d')]({},_0x4abc71,_0x1f499a[_0xd9b0('0x4a')]);return db['WhatsappQueue'][_0xd9b0('0x4b')](_0x4abc71)[_0xd9b0('0x27')](handleEntityNotFound(_0x3ff62a,null))[_0xd9b0('0x27')](respondWithResult(_0x3ff62a,null))['catch'](handleError(_0x3ff62a,null));};exports[_0xd9b0('0x4c')]=function(_0x3d8ee0,_0x3857fe){return db['WhatsappQueue'][_0xd9b0('0x4c')](_0x3d8ee0[_0xd9b0('0x4d')],{})[_0xd9b0('0x27')](function(_0x2f66b4){var _0x738dc6=_0x3d8ee0[_0xd9b0('0x4e')][_0xd9b0('0x29')]({'plain':!![]});if(!_0x738dc6)throw new Error(_0xd9b0('0x4f'));if(_0x738dc6['role']==='user'){var _0x2a6d57=_0x2f66b4[_0xd9b0('0x29')]({'plain':!![]});var _0x44251c=_0xd9b0('0x2a');return db[_0xd9b0('0x50')][_0xd9b0('0x4b')]({'where':{'name':_0x44251c,'userProfileId':_0x738dc6[_0xd9b0('0x51')]},'raw':!![]})[_0xd9b0('0x27')](function(_0x4d30fb){if(_0x4d30fb&&_0x4d30fb[_0xd9b0('0x52')]===0x0){return db[_0xd9b0('0x2b')][_0xd9b0('0x4c')]({'name':_0x2a6d57[_0xd9b0('0x2d')],'resourceId':_0x2a6d57['id'],'type':_0x4d30fb[_0xd9b0('0x2d')],'sectionId':_0x4d30fb['id']},{})[_0xd9b0('0x27')](function(){return _0x2f66b4;});}else{return _0x2f66b4;}})['catch'](function(_0x2ea886){logger[_0xd9b0('0x2c')](_0xd9b0('0x53'),_0x2ea886);throw _0x2ea886;});}return _0x2f66b4;})[_0xd9b0('0x27')](respondWithResult(_0x3857fe,0xc9))[_0xd9b0('0x45')](handleError(_0x3857fe,null));};exports[_0xd9b0('0x54')]=function(_0x39a0a3,_0x980692){if(_0x39a0a3['body']['id']){delete _0x39a0a3[_0xd9b0('0x4d')]['id'];}return db[_0xd9b0('0x41')][_0xd9b0('0x4b')]({'where':{'id':_0x39a0a3[_0xd9b0('0x46')]['id']}})['then'](handleEntityNotFound(_0x980692,null))['then'](saveUpdates(_0x39a0a3['body'],null))[_0xd9b0('0x27')](respondWithResult(_0x980692,null))[_0xd9b0('0x45')](handleError(_0x980692,null));};exports[_0xd9b0('0x28')]=function(_0x584921,_0x5d1724){return db[_0xd9b0('0x41')][_0xd9b0('0x4b')]({'where':{'id':_0x584921[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x5d1724,null))[_0xd9b0('0x27')](removeEntity(_0x5d1724,null))[_0xd9b0('0x45')](handleError(_0x5d1724,null));};exports[_0xd9b0('0x55')]=function(_0x157ec0,_0x5a68e1){return db[_0xd9b0('0x41')][_0xd9b0('0x55')]()[_0xd9b0('0x27')](respondWithResult(_0x5a68e1,null))[_0xd9b0('0x45')](handleError(_0x5a68e1,null));};exports['getMembers']=function(_0x458fd2,_0x5b169c,_0x9fecd2){var _0x51a689={'raw':!![],'where':{}},_0x5ef333={},_0x50f5f1;return db[_0xd9b0('0x41')]['findOne']({'where':{'id':_0x458fd2[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x5b169c,null))[_0xd9b0('0x27')](function(_0x5db130){if(_0x5db130){_0x50f5f1=_0x5db130[_0xd9b0('0x29')]({'plain':!![]});_0x5ef333[_0xd9b0('0x33')]=_[_0xd9b0('0x47')](db[_0xd9b0('0x56')][_0xd9b0('0x2f')]);_0x5ef333[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x458fd2[_0xd9b0('0x35')]);_0x5ef333['filters']=_[_0xd9b0('0x48')](_0x5ef333[_0xd9b0('0x33')],_0x5ef333[_0xd9b0('0x35')]);_0x51a689[_0xd9b0('0x36')]=_[_0xd9b0('0x48')](_0x5ef333[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x458fd2['query']['fields']));_0x51a689[_0xd9b0('0x36')]=_0x51a689[_0xd9b0('0x36')][_0xd9b0('0x37')]?_0x51a689[_0xd9b0('0x36')]:_0x5ef333['model'];if(!_0x458fd2[_0xd9b0('0x35')][_0xd9b0('0x38')](_0xd9b0('0x57'))){_0x51a689[_0xd9b0('0x23')]=qs[_0xd9b0('0x23')](_0x458fd2[_0xd9b0('0x35')]['limit']);_0x51a689[_0xd9b0('0x21')]=qs['offset'](_0x458fd2[_0xd9b0('0x35')][_0xd9b0('0x21')]);}_0x51a689[_0xd9b0('0x39')]=qs[_0xd9b0('0x3a')](_0x458fd2[_0xd9b0('0x35')][_0xd9b0('0x3a')]);_0x51a689['where']=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x458fd2[_0xd9b0('0x35')],_0x5ef333[_0xd9b0('0x32')]));_0x51a689[_0xd9b0('0x3b')][_0xd9b0('0x58')]=_0x5db130['id'];if(_0x458fd2['query']['filter']){_0x51a689[_0xd9b0('0x3b')]=_[_0xd9b0('0x3d')](_0x51a689[_0xd9b0('0x3b')],{'$or':_[_0xd9b0('0x2e')](_0x51a689[_0xd9b0('0x36')],function(_0x5116f1){var _0x182a53={};_0x182a53[_0x5116f1]={'$like':'%'+_0x458fd2[_0xd9b0('0x35')]['filter']+'%'};return _0x182a53;})});}_0x51a689=_[_0xd9b0('0x3d')]({},_0x51a689,_0x458fd2[_0xd9b0('0x4a')]);return db[_0xd9b0('0x56')][_0xd9b0('0x43')](_0x51a689);}})[_0xd9b0('0x27')](function(_0x4c9fbd){if(_0x4c9fbd){return db[_0xd9b0('0x59')][_0xd9b0('0x5a')]({'where':{'id':_[_0xd9b0('0x2e')](_0x4c9fbd,_0xd9b0('0x5b')),'role':_0xd9b0('0x5c')},'attributes':['id',_0xd9b0('0x2d'),_0xd9b0('0x5d'),_0xd9b0('0x5e'),_0xd9b0('0x5f')]});}})[_0xd9b0('0x27')](function(_0x230bb7){if(_0x230bb7){return{'count':_0x230bb7[_0xd9b0('0x24')],'rows':_['map'](_0x230bb7[_0xd9b0('0x44')],function(_0x1b5429){return{'membername':_0x1b5429[_0xd9b0('0x2d')],'UserId':_0x1b5429['id'],'queue_name':_0x50f5f1[_0xd9b0('0x2d')],'WhatsappQueueId':_0x50f5f1['id'],'interface':util[_0xd9b0('0x60')](_0xd9b0('0x61'),_0xd9b0('0x62'),_0x1b5429[_0xd9b0('0x2d')]),'penalty':0x0,'paused':_0x1b5429['whatsappPause'],'createdAt':_0x1b5429[_0xd9b0('0x5f')],'updatedAt':_0x1b5429[_0xd9b0('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9b0('0x27')](respondWithFilteredResult(_0x5b169c,_0x51a689))[_0xd9b0('0x45')](handleError(_0x5b169c,null));};exports['getTeams']=function(_0x5d71e8,_0x11d8c9,_0x1f9ae1){var _0x4d80e0={};var _0xcd810a={};var _0x41bfa9;var _0x3e9366;return db['WhatsappQueue'][_0xd9b0('0x63')]({'where':{'id':_0x5d71e8['params']['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x11d8c9,null))[_0xd9b0('0x27')](function(_0x38cc0a){if(_0x38cc0a){_0x41bfa9=_0x38cc0a;_0xcd810a[_0xd9b0('0x33')]=_['keys'](db[_0xd9b0('0x64')][_0xd9b0('0x2f')]);_0xcd810a[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x5d71e8[_0xd9b0('0x35')]);_0xcd810a['filters']=_[_0xd9b0('0x48')](_0xcd810a[_0xd9b0('0x33')],_0xcd810a[_0xd9b0('0x35')]);_0x4d80e0[_0xd9b0('0x36')]=_[_0xd9b0('0x48')](_0xcd810a[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x5d71e8[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x4d80e0[_0xd9b0('0x36')]=_0x4d80e0['attributes'][_0xd9b0('0x37')]?_0x4d80e0[_0xd9b0('0x36')]:_0xcd810a[_0xd9b0('0x33')];_0x4d80e0[_0xd9b0('0x39')]=qs['sort'](_0x5d71e8[_0xd9b0('0x35')]['sort']);_0x4d80e0[_0xd9b0('0x3b')]=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x5d71e8['query'],_0xcd810a[_0xd9b0('0x32')]));if(_0x5d71e8['query'][_0xd9b0('0x40')]){_0x4d80e0[_0xd9b0('0x3b')]=_[_0xd9b0('0x3d')](_0x4d80e0[_0xd9b0('0x3b')],{'$or':_[_0xd9b0('0x2e')](_0x4d80e0[_0xd9b0('0x36')],function(_0x33b370){var _0x3c3314={};_0x3c3314[_0x33b370]={'$like':'%'+_0x5d71e8['query'][_0xd9b0('0x40')]+'%'};return _0x3c3314;})});}_0x4d80e0=_[_0xd9b0('0x3d')]({},_0x4d80e0,_0x5d71e8[_0xd9b0('0x4a')]);return _0x41bfa9[_0xd9b0('0x65')](_0x4d80e0);}})['then'](function(_0x3340a4){if(_0x3340a4){_0x3e9366=_0x3340a4[_0xd9b0('0x37')];if(!_0x5d71e8[_0xd9b0('0x35')]['hasOwnProperty'](_0xd9b0('0x57'))){_0x4d80e0['limit']=qs[_0xd9b0('0x23')](_0x5d71e8[_0xd9b0('0x35')]['limit']);_0x4d80e0['offset']=qs[_0xd9b0('0x21')](_0x5d71e8[_0xd9b0('0x35')][_0xd9b0('0x21')]);}return _0x41bfa9['getTeams'](_0x4d80e0);}})[_0xd9b0('0x27')](function(_0x8669a5){if(_0x8669a5){return _0x8669a5?{'count':_0x3e9366,'rows':_0x8669a5}:null;}})[_0xd9b0('0x27')](respondWithResult(_0x11d8c9,null))[_0xd9b0('0x45')](handleError(_0x11d8c9,null));};exports[_0xd9b0('0x66')]=function(_0x44fb86,_0x22c93a,_0x1f38bb){var _0x1fccef=_0x44fb86['body'][_0xd9b0('0x67')];return db['Team']['findAll']({'where':{'id':_0x1fccef},'attributes':['id'],'include':[{'model':db[_0xd9b0('0x59')],'as':_0xd9b0('0x68'),'attributes':['id',_0xd9b0('0x2d'),_0xd9b0('0x69'),_0xd9b0('0x6a'),_0xd9b0('0x6b')],'raw':!![]}]})[_0xd9b0('0x27')](function(_0x4bb2fb){if(_0x4bb2fb){var _0x576cf4=_[_0xd9b0('0x6c')](_0x4bb2fb,function(_0x5c2e7a){var _0x1343c1=_0x5c2e7a[_0xd9b0('0x29')]({'plain':!![]});return _0x1343c1['Agents'];});return db[_0xd9b0('0x41')]['find']({'where':{'id':_0x44fb86[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](function(_0x2d8c43){return db[_0xd9b0('0x6d')][_0xd9b0('0x6e')](function(_0xc90ad9){return _0x2d8c43['addTeams'](_0x1fccef,{'transaction':_0xc90ad9})[_0xd9b0('0x27')](function(){return BPromise[_0xd9b0('0x6f')](_0x576cf4,function(_0xd185b7){return db[_0xd9b0('0x56')][_0xd9b0('0x70')]({'where':{'UserId':_0xd185b7['id'],'WhatsappQueueId':_0x44fb86[_0xd9b0('0x46')]['id']},'transaction':_0xc90ad9});});})[_0xd9b0('0x27')](function(){_0x576cf4[_0xd9b0('0x71')](function(_0x4edbc0){socket['emit'](_0xd9b0('0x72'),{'UserId':_0x4edbc0['id'],'WhatsappQueueId':_0x2d8c43['id']});});});});});}})[_0xd9b0('0x27')](respondWithStatusCode(_0x22c93a,null))[_0xd9b0('0x45')](handleError(_0x22c93a,null));};exports['removeTeams']=function(_0x413a46,_0x36611b,_0x1045e4){return db[_0xd9b0('0x64')][_0xd9b0('0x43')]({'where':{'id':_0x413a46[_0xd9b0('0x35')][_0xd9b0('0x67')]},'attributes':['id'],'include':[{'model':db[_0xd9b0('0x59')],'as':_0xd9b0('0x68'),'attributes':['id'],'raw':!![]}]})[_0xd9b0('0x27')](handleEntityNotFound(_0x36611b,null))[_0xd9b0('0x27')](function(_0x357634){var _0x10075a=_[_0xd9b0('0x2e')](_0x357634,'id');var _0x421fd7=[];var _0x2266d3=[];var _0x1140ac=squel[_0xd9b0('0x73')]();_0x1140ac['field']('tq.TeamId')[_0xd9b0('0x74')]('team_has_whatsapp_queues','tq')[_0xd9b0('0x75')](_0xd9b0('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd9b0('0x3b')](_0xd9b0('0x77'),_0x413a46[_0xd9b0('0x46')]['id']);for(var _0x531c3d=0x0;_0x531c3d<_0x357634[_0xd9b0('0x37')];_0x531c3d+=0x1){let _0x4fc15a=_0x357634[_0x531c3d];for(var _0x4bbb3e=0x0;_0x4bbb3e<_0x4fc15a[_0xd9b0('0x68')][_0xd9b0('0x37')];_0x4bbb3e+=0x1){let _0xaff62d=_0x4fc15a[_0xd9b0('0x68')][_0x4bbb3e];var _0x2a442c=_0x1140ac[_0xd9b0('0x78')]();_0x2a442c[_0xd9b0('0x3b')](_0xd9b0('0x79'),_0xaff62d['id']);_0x2266d3[_0xd9b0('0x7a')](db[_0xd9b0('0x6d')][_0xd9b0('0x35')](_0x2a442c[_0xd9b0('0x7b')](),{'type':db[_0xd9b0('0x6d')][_0xd9b0('0x7c')]['SELECT']})[_0xd9b0('0x27')](function(_0x1dd55b){if(_0x1dd55b[_0xd9b0('0x37')]===0x1){return _0xaff62d['id'];}else{var _0x3044a1=_[_0xd9b0('0x7d')](_[_0xd9b0('0x2e')](_0x1dd55b,'TeamId'),function(_0x38ab78){return _['includes'](_0x10075a,_0x38ab78);});if(_0x3044a1){return _0xaff62d['id'];}}}));}}return BPromise[_0xd9b0('0x7e')](_0x2266d3)[_0xd9b0('0x27')](function(_0xebe953){_0x421fd7=_(_0x421fd7)[_0xd9b0('0x7f')](_0xebe953)['compact']()['value']();return db[_0xd9b0('0x41')][_0xd9b0('0x4b')]({'where':{'id':_0x413a46[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](function(_0x316121){return db[_0xd9b0('0x6d')][_0xd9b0('0x6e')](function(_0x464e50){return _0x316121[_0xd9b0('0x80')](_0x413a46['query']['ids'],{'transaction':_0x464e50})[_0xd9b0('0x27')](function(){if(!_[_0xd9b0('0x81')](_0x421fd7)){return _0x316121[_0xd9b0('0x82')](_0x421fd7,{'transaction':_0x464e50});}})[_0xd9b0('0x27')](function(){_0x421fd7['forEach'](function(_0x2e6b58){socket[_0xd9b0('0x83')](_0xd9b0('0x84'),{'UserId':_0x2e6b58,'WhatsappQueueId':_0x316121['id']});});});});});});})[_0xd9b0('0x27')](respondWithStatusCode(_0x36611b,null))[_0xd9b0('0x45')](handleError(_0x36611b,null));};exports['addAgents']=function(_0x12ddce,_0x2737de,_0x35b71f){return db['WhatsappQueue']['find']({'where':{'id':_0x12ddce['params']['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x2737de,null))[_0xd9b0('0x27')](function(_0x3dff3c){if(_0x3dff3c){return _0x3dff3c[_0xd9b0('0x85')](_0x12ddce[_0xd9b0('0x4d')]['ids'],_[_0xd9b0('0x86')](_0x12ddce['body'],[_0xd9b0('0x67'),'id'])||{})['spread'](function(_0x432917){for(var _0x534275=0x0;_0x534275<_0x12ddce[_0xd9b0('0x4d')][_0xd9b0('0x67')][_0xd9b0('0x37')];_0x534275+=0x1){socket[_0xd9b0('0x83')](_0xd9b0('0x72'),{'UserId':Number(_0x12ddce['body']['ids'][_0x534275]),'WhatsappQueueId':Number(_0x12ddce['params']['id'])});}return _0x432917;});}})[_0xd9b0('0x27')](respondWithResult(_0x2737de,null))[_0xd9b0('0x45')](handleError(_0x2737de,null));};exports['removeAgents']=function(_0x53df13,_0x3b44c4,_0x59bb3b){return db[_0xd9b0('0x41')]['find']({'where':{'id':_0x53df13['params']['id']}})['then'](handleEntityNotFound(_0x3b44c4,null))[_0xd9b0('0x27')](function(_0x15e630){if(_0x15e630){return _0x15e630[_0xd9b0('0x82')](_0x53df13[_0xd9b0('0x35')][_0xd9b0('0x67')])[_0xd9b0('0x27')](function(){if(_[_0xd9b0('0x87')](_0x53df13['query']['ids'])){for(var _0x2353b3=0x0;_0x2353b3<_0x53df13[_0xd9b0('0x35')][_0xd9b0('0x67')][_0xd9b0('0x37')];_0x2353b3+=0x1){socket[_0xd9b0('0x83')](_0xd9b0('0x84'),{'UserId':Number(_0x53df13[_0xd9b0('0x35')]['ids'][_0x2353b3]),'WhatsappQueueId':Number(_0x53df13[_0xd9b0('0x46')]['id'])});}}else{socket[_0xd9b0('0x83')](_0xd9b0('0x84'),{'UserId':Number(_0x53df13[_0xd9b0('0x35')]['ids']),'WhatsappQueueId':Number(_0x53df13[_0xd9b0('0x46')]['id'])});}});}})[_0xd9b0('0x27')](respondWithStatusCode(_0x3b44c4,null))[_0xd9b0('0x45')](handleError(_0x3b44c4,null));};exports[_0xd9b0('0x88')]=function(_0x1432db,_0x1949b1,_0x2b05d2){var _0x130cb6={};var _0x1398a6={};var _0x5aed69;var _0x31ba4c;return db[_0xd9b0('0x41')][_0xd9b0('0x63')]({'where':{'id':_0x1432db['params']['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x1949b1,null))['then'](function(_0xd94abd){if(_0xd94abd){_0x5aed69=_0xd94abd;_0x1398a6[_0xd9b0('0x33')]=_[_0xd9b0('0x47')](db[_0xd9b0('0x59')][_0xd9b0('0x2f')]);_0x1398a6[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x1432db[_0xd9b0('0x35')]);_0x1398a6[_0xd9b0('0x32')]=_['intersection'](_0x1398a6[_0xd9b0('0x33')],_0x1398a6['query']);_0x130cb6['attributes']=_['intersection'](_0x1398a6[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x130cb6[_0xd9b0('0x36')]=_0x130cb6['attributes']['length']?_0x130cb6[_0xd9b0('0x36')]:_0x1398a6[_0xd9b0('0x33')];_0x130cb6[_0xd9b0('0x39')]=qs['sort'](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x3a')]);_0x130cb6[_0xd9b0('0x3b')]=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x1432db[_0xd9b0('0x35')],_0x1398a6[_0xd9b0('0x32')]));if(_0x1432db[_0xd9b0('0x35')]['filter']){_0x130cb6[_0xd9b0('0x3b')]=_[_0xd9b0('0x3d')](_0x130cb6[_0xd9b0('0x3b')],{'$or':_[_0xd9b0('0x2e')](_0x130cb6[_0xd9b0('0x36')],function(_0x1dc194){var _0x39f3ec={};_0x39f3ec[_0x1dc194]={'$like':'%'+_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x40')]+'%'};return _0x39f3ec;})});}_0x130cb6=_[_0xd9b0('0x3d')]({},_0x130cb6,_0x1432db[_0xd9b0('0x4a')]);return _0x5aed69['getAgents'](_0x130cb6);}})[_0xd9b0('0x27')](function(_0x35fce5){if(_0x35fce5){_0x31ba4c=_0x35fce5['length'];if(!_0x1432db['query'][_0xd9b0('0x38')](_0xd9b0('0x57'))){_0x130cb6['limit']=qs[_0xd9b0('0x23')](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x23')]);_0x130cb6[_0xd9b0('0x21')]=qs[_0xd9b0('0x21')](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x21')]);}return _0x5aed69[_0xd9b0('0x88')](_0x130cb6);}})[_0xd9b0('0x27')](function(_0x3e41bd){if(_0x3e41bd){return _0x3e41bd?{'count':_0x31ba4c,'rows':_0x3e41bd}:null;}})['then'](respondWithResult(_0x1949b1,null))[_0xd9b0('0x45')](handleError(_0x1949b1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 42f2af8..b8609c4 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 _0xeae6=['../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x439083,_0x18f6e2){var _0x54c089=function(_0x40de42){while(--_0x40de42){_0x439083['push'](_0x439083['shift']());}};_0x54c089(++_0x18f6e2);}(_0xeae6,0x1ea));var _0x6eae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeae6[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6eae('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6eae('0x1')](0x0);var events={'afterCreate':_0x6eae('0x2'),'afterUpdate':_0x6eae('0x3'),'afterDestroy':'remove'};function emitEvent(_0x20bfb0){return function(_0x4a7a7b,_0x566194,_0x4ddef1){WhatsappQueueEvents[_0x6eae('0x4')](_0x20bfb0+':'+_0x4a7a7b['id'],_0x4a7a7b);WhatsappQueueEvents[_0x6eae('0x4')](_0x20bfb0,_0x4a7a7b);_0x4ddef1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6eae('0x5')](e,emitEvent(event));}}module[_0x6eae('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0xcdc4=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x3f5fb6,_0x2f16b1){var _0x2ca27f=function(_0x486cc9){while(--_0x486cc9){_0x3f5fb6['push'](_0x3f5fb6['shift']());}};_0x2ca27f(++_0x2f16b1);}(_0xcdc4,0x14d));var _0x4cdc=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xcdc4[_0x2df724];return _0x1b2504;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x4cdc('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4cdc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4cdc('0x2'),'afterDestroy':_0x4cdc('0x3')};function emitEvent(_0x54f34e){return function(_0x1831ec,_0x4586f0,_0x5ec9b2){WhatsappQueueEvents['emit'](_0x54f34e+':'+_0x1831ec['id'],_0x1831ec);WhatsappQueueEvents[_0x4cdc('0x4')](_0x54f34e,_0x1831ec);_0x5ec9b2(null);};}for(var e in events){if(events[_0x4cdc('0x5')](e)){var event=events[e];WhatsappQueue[_0x4cdc('0x6')](e,emitEvent(event));}}module[_0x4cdc('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 001d1c5..16ca78a 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 _0x1f7d=['../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4c22c3,_0x15bf98){var _0xe7ad56=function(_0x39df9f){while(--_0x39df9f){_0x4c22c3['push'](_0x4c22c3['shift']());}};_0xe7ad56(++_0x15bf98);}(_0x1f7d,0xd5));var _0xd1f7=function(_0x983c2e,_0x211744){_0x983c2e=_0x983c2e-0x0;var _0x525b8e=_0x1f7d[_0x983c2e];return _0x525b8e;};'use strict';var _=require(_0xd1f7('0x0'));var util=require(_0xd1f7('0x1'));var logger=require(_0xd1f7('0x2'))(_0xd1f7('0x3'));var moment=require(_0xd1f7('0x4'));var BPromise=require(_0xd1f7('0x5'));var rp=require(_0xd1f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1f7('0x7'));var config=require(_0xd1f7('0x8'));var attributes=require(_0xd1f7('0x9'));module[_0xd1f7('0xa')]=function(_0x34d5b2,_0x1d0044){return _0x34d5b2[_0xd1f7('0xb')]('WhatsappQueue',attributes,{'tableName':_0xd1f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x744e=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','WhatsappQueue','whatsapp_queues'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x744e,0x190));var _0xe744=function(_0xf68806,_0x5edb76){_0xf68806=_0xf68806-0x0;var _0x59720d=_0x744e[_0xf68806];return _0x59720d;};'use strict';var _=require(_0xe744('0x0'));var util=require(_0xe744('0x1'));var logger=require(_0xe744('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe744('0x3'));var rp=require(_0xe744('0x4'));var fs=require('fs');var path=require(_0xe744('0x5'));var rimraf=require(_0xe744('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0xe744('0x7')]=function(_0xf0ac12,_0xea0dc6){return _0xf0ac12['define'](_0xe744('0x8'),attributes,{'tableName':_0xe744('0x9'),'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 0d7401d..301e237 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 _0xcf52=['result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0xa40ef4,_0x35105b){var _0x5d2550=function(_0x2822f1){while(--_0x2822f1){_0xa40ef4['push'](_0xa40ef4['shift']());}};_0x5d2550(++_0x35105b);}(_0xcf52,0x1ef));var _0x2cf5=function(_0x1fe2e8,_0x947821){_0x1fe2e8=_0x1fe2e8-0x0;var _0x3383c0=_0xcf52[_0x1fe2e8];return _0x3383c0;};'use strict';var _=require('lodash');var util=require(_0x2cf5('0x0'));var moment=require(_0x2cf5('0x1'));var BPromise=require(_0x2cf5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cf5('0x3'))['db'];var utils=require(_0x2cf5('0x4'));var logger=require('../../config/logger')(_0x2cf5('0x5'));var config=require(_0x2cf5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2cf5('0x7')]['http']({'port':0x232a});config[_0x2cf5('0x8')]=_[_0x2cf5('0x9')](config[_0x2cf5('0x8')],{'host':_0x2cf5('0xa'),'port':0x18eb});var socket=require(_0x2cf5('0xb'))(new Redis(config['redis']));require(_0x2cf5('0xc'))[_0x2cf5('0xd')](socket);function respondWithRpcPromise(_0x5428db,_0x18cea0,_0x5b54ed){return new BPromise(function(_0x2cb222,_0x21cd76){return client['request'](_0x5428db,_0x5b54ed)[_0x2cf5('0xe')](function(_0x32c837){logger['info'](_0x2cf5('0xf'),_0x18cea0,'request\x20sent');logger[_0x2cf5('0x10')](_0x2cf5('0x11'),_0x18cea0,_0x2cf5('0x12'),JSON[_0x2cf5('0x13')](_0x32c837));if(_0x32c837[_0x2cf5('0x14')]){if(_0x32c837[_0x2cf5('0x14')]['code']===0x1f4){logger[_0x2cf5('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x18cea0,_0x32c837[_0x2cf5('0x14')][_0x2cf5('0x15')]);return _0x21cd76(_0x32c837[_0x2cf5('0x14')][_0x2cf5('0x15')]);}logger[_0x2cf5('0x14')](_0x2cf5('0xf'),_0x18cea0,_0x32c837['error'][_0x2cf5('0x15')]);return _0x2cb222(_0x32c837[_0x2cf5('0x14')]['message']);}else{logger[_0x2cf5('0x16')](_0x2cf5('0xf'),_0x18cea0,_0x2cf5('0x12'));_0x2cb222(_0x32c837[_0x2cf5('0x17')][_0x2cf5('0x15')]);}})['catch'](function(_0x5339ff){logger[_0x2cf5('0x14')](_0x2cf5('0xf'),_0x18cea0,_0x5339ff);_0x21cd76(_0x5339ff);});});}exports[_0x2cf5('0x18')]=function(_0x24aa04){var _0x3cc5bf=this;return new Promise(function(_0x36cc8f,_0x2c4ea3){return db[_0x2cf5('0x19')][_0x2cf5('0x1a')]({'raw':_0x24aa04[_0x2cf5('0x1b')]?_0x24aa04['options'][_0x2cf5('0x1c')]===undefined?!![]:![]:!![],'where':_0x24aa04[_0x2cf5('0x1b')]?_0x24aa04[_0x2cf5('0x1b')][_0x2cf5('0x1d')]||null:null,'attributes':_0x24aa04[_0x2cf5('0x1b')]?_0x24aa04['options'][_0x2cf5('0x1e')]||null:null,'limit':_0x24aa04[_0x2cf5('0x1b')]?_0x24aa04[_0x2cf5('0x1b')][_0x2cf5('0x1f')]||null:null,'include':_0x24aa04[_0x2cf5('0x1b')]?_0x24aa04[_0x2cf5('0x1b')][_0x2cf5('0x20')]?_[_0x2cf5('0x21')](_0x24aa04['options'][_0x2cf5('0x20')],function(_0x43baf4){return{'model':db[_0x43baf4[_0x2cf5('0x22')]],'as':_0x43baf4['as'],'attributes':_0x43baf4[_0x2cf5('0x1e')],'include':_0x43baf4[_0x2cf5('0x20')]?_[_0x2cf5('0x21')](_0x43baf4['include'],function(_0x89bf6e){return{'model':db[_0x89bf6e[_0x2cf5('0x22')]],'as':_0x89bf6e['as'],'attributes':_0x89bf6e['attributes'],'include':_0x89bf6e[_0x2cf5('0x20')]?_['map'](_0x89bf6e[_0x2cf5('0x20')],function(_0x2d67b5){return{'model':db[_0x2d67b5[_0x2cf5('0x22')]],'as':_0x2d67b5['as'],'attributes':_0x2d67b5[_0x2cf5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2cf5('0xe')](function(_0x5888f7){logger[_0x2cf5('0x16')](_0x2cf5('0x18'),_0x24aa04);logger[_0x2cf5('0x10')](_0x2cf5('0x18'),_0x24aa04,JSON[_0x2cf5('0x13')](_0x5888f7));_0x36cc8f(_0x5888f7);})['catch'](function(_0x5d4e88){logger[_0x2cf5('0x14')](_0x2cf5('0x18'),_0x5d4e88[_0x2cf5('0x15')],_0x24aa04);_0x2c4ea3(_0x3cc5bf[_0x2cf5('0x14')](0x1f4,_0x5d4e88[_0x2cf5('0x15')]));});});};exports[_0x2cf5('0x23')]=function(_0x5f26e4){var _0x1c5f25=this;return new Promise(function(_0x1eebf9,_0x1c943b){return db[_0x2cf5('0x19')][_0x2cf5('0x24')]({'raw':_0x5f26e4['options']?_0x5f26e4[_0x2cf5('0x1b')][_0x2cf5('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f26e4['options']?_0x5f26e4['options'][_0x2cf5('0x1d')]||null:null,'attributes':_0x5f26e4[_0x2cf5('0x1b')]?_0x5f26e4['options'][_0x2cf5('0x1e')]||null:null,'include':_0x5f26e4[_0x2cf5('0x1b')]?_0x5f26e4[_0x2cf5('0x1b')][_0x2cf5('0x20')]?_[_0x2cf5('0x21')](_0x5f26e4[_0x2cf5('0x1b')]['include'],function(_0x406bd4){return{'model':db[_0x406bd4[_0x2cf5('0x22')]],'as':_0x406bd4['as'],'attributes':_0x406bd4[_0x2cf5('0x1e')],'include':_0x406bd4[_0x2cf5('0x20')]?_[_0x2cf5('0x21')](_0x406bd4[_0x2cf5('0x20')],function(_0x3134ab){return{'model':db[_0x3134ab[_0x2cf5('0x22')]],'as':_0x3134ab['as'],'attributes':_0x3134ab[_0x2cf5('0x1e')],'include':_0x3134ab[_0x2cf5('0x20')]?_[_0x2cf5('0x21')](_0x3134ab[_0x2cf5('0x20')],function(_0x1ffa47){return{'model':db[_0x1ffa47[_0x2cf5('0x22')]],'as':_0x1ffa47['as'],'attributes':_0x1ffa47[_0x2cf5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2cf5('0xe')](function(_0x4670b1){logger[_0x2cf5('0x16')]('ShowWhatsappQueue',_0x5f26e4);logger[_0x2cf5('0x10')](_0x2cf5('0x23'),_0x5f26e4,JSON['stringify'](_0x4670b1));_0x1eebf9(_0x4670b1);})['catch'](function(_0x23847f){logger[_0x2cf5('0x14')](_0x2cf5('0x23'),_0x23847f['message'],_0x5f26e4);_0x1c943b(_0x1c5f25[_0x2cf5('0x14')](0x1f4,_0x23847f[_0x2cf5('0x15')]));});});}; \ No newline at end of file +var _0xaf48=['register','request','info','debug','request\x20sent','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowWhatsappQueue','find','moment','bluebird','randomstring','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x43aa7f,_0x9ee684){var _0x140b3f=function(_0x5b9d41){while(--_0x5b9d41){_0x43aa7f['push'](_0x43aa7f['shift']());}};_0x140b3f(++_0x9ee684);}(_0xaf48,0x1ca));var _0x8af4=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xaf48[_0x1762b4];return _0x29beda;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8af4('0x0'));var BPromise=require(_0x8af4('0x1'));var rs=require(_0x8af4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8af4('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x8af4('0x4')][_0x8af4('0x5')]({'port':0x232a});config[_0x8af4('0x6')]=_[_0x8af4('0x7')](config[_0x8af4('0x6')],{'host':_0x8af4('0x8'),'port':0x18eb});var socket=require(_0x8af4('0x9'))(new Redis(config[_0x8af4('0x6')]));require('./whatsappQueue.socket')[_0x8af4('0xa')](socket);function respondWithRpcPromise(_0x2b0bee,_0x530520,_0x11e7d9){return new BPromise(function(_0x179ddb,_0x2efd64){return client[_0x8af4('0xb')](_0x2b0bee,_0x11e7d9)['then'](function(_0x96bdea){logger[_0x8af4('0xc')]('WhatsappQueue,\x20%s,\x20%s',_0x530520,'request\x20sent');logger[_0x8af4('0xd')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x530520,_0x8af4('0xe'),JSON[_0x8af4('0xf')](_0x96bdea));if(_0x96bdea[_0x8af4('0x10')]){if(_0x96bdea[_0x8af4('0x10')][_0x8af4('0x11')]===0x1f4){logger[_0x8af4('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x530520,_0x96bdea[_0x8af4('0x10')][_0x8af4('0x12')]);return _0x2efd64(_0x96bdea[_0x8af4('0x10')][_0x8af4('0x12')]);}logger[_0x8af4('0x10')](_0x8af4('0x13'),_0x530520,_0x96bdea[_0x8af4('0x10')]['message']);return _0x179ddb(_0x96bdea[_0x8af4('0x10')][_0x8af4('0x12')]);}else{logger[_0x8af4('0xc')]('WhatsappQueue,\x20%s,\x20%s',_0x530520,'request\x20sent');_0x179ddb(_0x96bdea[_0x8af4('0x14')][_0x8af4('0x12')]);}})[_0x8af4('0x15')](function(_0x3cdc7a){logger[_0x8af4('0x10')](_0x8af4('0x13'),_0x530520,_0x3cdc7a);_0x2efd64(_0x3cdc7a);});});}exports[_0x8af4('0x16')]=function(_0x2f562b){var _0x492f58=this;return new Promise(function(_0x3d5aa1,_0x40cdff){return db[_0x8af4('0x17')][_0x8af4('0x18')]({'raw':_0x2f562b[_0x8af4('0x19')]?_0x2f562b['options'][_0x8af4('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f562b[_0x8af4('0x19')]?_0x2f562b[_0x8af4('0x19')][_0x8af4('0x1b')]||null:null,'attributes':_0x2f562b[_0x8af4('0x19')]?_0x2f562b['options']['attributes']||null:null,'limit':_0x2f562b[_0x8af4('0x19')]?_0x2f562b[_0x8af4('0x19')][_0x8af4('0x1c')]||null:null,'include':_0x2f562b['options']?_0x2f562b[_0x8af4('0x19')][_0x8af4('0x1d')]?_[_0x8af4('0x1e')](_0x2f562b['options'][_0x8af4('0x1d')],function(_0x4f8997){return{'model':db[_0x4f8997[_0x8af4('0x1f')]],'as':_0x4f8997['as'],'attributes':_0x4f8997[_0x8af4('0x20')],'include':_0x4f8997[_0x8af4('0x1d')]?_['map'](_0x4f8997['include'],function(_0x10f353){return{'model':db[_0x10f353[_0x8af4('0x1f')]],'as':_0x10f353['as'],'attributes':_0x10f353[_0x8af4('0x20')],'include':_0x10f353[_0x8af4('0x1d')]?_['map'](_0x10f353['include'],function(_0x46ef2b){return{'model':db[_0x46ef2b['model']],'as':_0x46ef2b['as'],'attributes':_0x46ef2b[_0x8af4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8af4('0x21')](function(_0x144b71){logger[_0x8af4('0xc')](_0x8af4('0x16'),_0x2f562b);logger['debug'](_0x8af4('0x16'),_0x2f562b,JSON[_0x8af4('0xf')](_0x144b71));_0x3d5aa1(_0x144b71);})[_0x8af4('0x15')](function(_0x2c4482){logger[_0x8af4('0x10')](_0x8af4('0x16'),_0x2c4482[_0x8af4('0x12')],_0x2f562b);_0x40cdff(_0x492f58['error'](0x1f4,_0x2c4482[_0x8af4('0x12')]));});});};exports[_0x8af4('0x22')]=function(_0xc3559b){var _0x493c45=this;return new Promise(function(_0x90c6be,_0x55be1c){return db['WhatsappQueue'][_0x8af4('0x23')]({'raw':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1a')]===undefined?!![]:![]:!![],'where':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1b')]||null:null,'attributes':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x20')]||null:null,'include':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1d')]?_['map'](_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1d')],function(_0x57decb){return{'model':db[_0x57decb[_0x8af4('0x1f')]],'as':_0x57decb['as'],'attributes':_0x57decb[_0x8af4('0x20')],'include':_0x57decb['include']?_['map'](_0x57decb[_0x8af4('0x1d')],function(_0x3cc49a){return{'model':db[_0x3cc49a['model']],'as':_0x3cc49a['as'],'attributes':_0x3cc49a[_0x8af4('0x20')],'include':_0x3cc49a[_0x8af4('0x1d')]?_['map'](_0x3cc49a[_0x8af4('0x1d')],function(_0x1c5f59){return{'model':db[_0x1c5f59[_0x8af4('0x1f')]],'as':_0x1c5f59['as'],'attributes':_0x1c5f59['attributes']};}):[]};}):[]};}):[]:[]})[_0x8af4('0x21')](function(_0x3ab90d){logger['info']('ShowWhatsappQueue',_0xc3559b);logger[_0x8af4('0xd')](_0x8af4('0x22'),_0xc3559b,JSON[_0x8af4('0xf')](_0x3ab90d));_0x90c6be(_0x3ab90d);})['catch'](function(_0x50f838){logger[_0x8af4('0x10')]('ShowWhatsappQueue',_0x50f838[_0x8af4('0x12')],_0xc3559b);_0x55be1c(_0x493c45['error'](0x1f4,_0x50f838[_0x8af4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 47f393d..b37e1b3 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 _0x13b3=['register','./whatsappQueue.events','save'];(function(_0x13a0fb,_0x3ea601){var _0x1526d3=function(_0x528702){while(--_0x528702){_0x13a0fb['push'](_0x13a0fb['shift']());}};_0x1526d3(++_0x3ea601);}(_0x13b3,0x13c));var _0x313b=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x13b3[_0x4fc80b];return _0x119dba;};'use strict';var WhatsappQueueEvents=require(_0x313b('0x0'));var events=[_0x313b('0x1'),'remove','update'];function createListener(_0x43f5ba,_0x350b50){return function(_0x36d62c){_0x350b50['emit'](_0x43f5ba,_0x36d62c);};}function removeListener(_0x521950,_0x42bae5){return function(){WhatsappQueueEvents['removeListener'](_0x521950,_0x42bae5);};}exports[_0x313b('0x2')]=function(_0x629149){for(var _0x33ee9a=0x0,_0x308e78=events['length'];_0x33ee9a<_0x308e78;_0x33ee9a++){var _0x2fea37=events[_0x33ee9a];var _0x12fa91=createListener('whatsappQueue:'+_0x2fea37,_0x629149);WhatsappQueueEvents['on'](_0x2fea37,_0x12fa91);}}; \ No newline at end of file +var _0xc60e=['update','emit','removeListener','register','length','./whatsappQueue.events','save','remove'];(function(_0x481ffc,_0x4acb82){var _0x51d09a=function(_0x2d73e0){while(--_0x2d73e0){_0x481ffc['push'](_0x481ffc['shift']());}};_0x51d09a(++_0x4acb82);}(_0xc60e,0x11d));var _0xec60=function(_0x1b5125,_0x30d5c9){_0x1b5125=_0x1b5125-0x0;var _0x2bf0a8=_0xc60e[_0x1b5125];return _0x2bf0a8;};'use strict';var WhatsappQueueEvents=require(_0xec60('0x0'));var events=[_0xec60('0x1'),_0xec60('0x2'),_0xec60('0x3')];function createListener(_0x4d58bf,_0x22216e){return function(_0x3398b4){_0x22216e[_0xec60('0x4')](_0x4d58bf,_0x3398b4);};}function removeListener(_0x64309,_0x4242f8){return function(){WhatsappQueueEvents[_0xec60('0x5')](_0x64309,_0x4242f8);};}exports[_0xec60('0x6')]=function(_0x1ad8d9){for(var _0x55e550=0x0,_0x248f7=events[_0xec60('0x7')];_0x55e550<_0x248f7;_0x55e550++){var _0x8a3430=events[_0x55e550];var _0xa23689=createListener('whatsappQueue:'+_0x8a3430,_0x1ad8d9);WhatsappQueueEvents['on'](_0x8a3430,_0xa23689);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2dcbc73..622eba4 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 _0xcd36=['destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0xcd36,0x16a));var _0x6cd3=function(_0x29e664,_0x497eda){_0x29e664=_0x29e664-0x0;var _0x5b37c3=_0xcd36[_0x29e664];return _0x5b37c3;};'use strict';var multer=require('multer');var util=require(_0x6cd3('0x0'));var path=require(_0x6cd3('0x1'));var timeout=require('connect-timeout');var express=require(_0x6cd3('0x2'));var router=express['Router']();var fs_extra=require(_0x6cd3('0x3'));var auth=require(_0x6cd3('0x4'));var interaction=require(_0x6cd3('0x5'));var config=require(_0x6cd3('0x6'));var controller=require(_0x6cd3('0x7'));router[_0x6cd3('0x8')]('/',auth[_0x6cd3('0x9')](),controller['index']);router[_0x6cd3('0x8')](_0x6cd3('0xa'),auth[_0x6cd3('0x9')](),controller[_0x6cd3('0xb')]);router['get'](_0x6cd3('0xc'),auth[_0x6cd3('0x9')](),controller[_0x6cd3('0xd')]);router[_0x6cd3('0xe')]('/',auth[_0x6cd3('0x9')](),controller['create']);router[_0x6cd3('0xf')](_0x6cd3('0xc'),auth[_0x6cd3('0x9')](),controller[_0x6cd3('0x10')]);router[_0x6cd3('0x11')](_0x6cd3('0xc'),auth[_0x6cd3('0x9')](),controller[_0x6cd3('0x12')]);module[_0x6cd3('0x13')]=router; \ No newline at end of file +var _0x4ca0=['get','isAuthenticated','index','/describe','show','post','put','/:id','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46f31f,_0x125f19){var _0x10764c=function(_0x309d58){while(--_0x309d58){_0x46f31f['push'](_0x46f31f['shift']());}};_0x10764c(++_0x125f19);}(_0x4ca0,0x16f));var _0x04ca=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x4ca0[_0x1e3671];return _0x48d5f5;};'use strict';var multer=require('multer');var util=require(_0x04ca('0x0'));var path=require(_0x04ca('0x1'));var timeout=require('connect-timeout');var express=require(_0x04ca('0x2'));var router=express['Router']();var fs_extra=require(_0x04ca('0x3'));var auth=require(_0x04ca('0x4'));var interaction=require(_0x04ca('0x5'));var config=require(_0x04ca('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0x04ca('0x7')]('/',auth[_0x04ca('0x8')](),controller[_0x04ca('0x9')]);router['get'](_0x04ca('0xa'),auth[_0x04ca('0x8')](),controller['describe']);router['get']('/:id',auth[_0x04ca('0x8')](),controller[_0x04ca('0xb')]);router[_0x04ca('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x04ca('0xd')](_0x04ca('0xe'),auth[_0x04ca('0x8')](),controller['update']);router[_0x04ca('0xf')]('/:id',auth[_0x04ca('0x8')](),controller[_0x04ca('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 4eab4c4..06aa781 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(_0xa5e291,_0xf95e5f){var _0x248edc=function(_0x3a72dc){while(--_0x3a72dc){_0xa5e291['push'](_0xa5e291['shift']());}};_0x248edc(++_0xf95e5f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x413aa6,_0x44290b){var _0x35cc6d=function(_0x1a9e9b){while(--_0x1a9e9b){_0x413aa6['push'](_0x413aa6['shift']());}};_0x35cc6d(++_0x44290b);}(_0x7a54,0x106));var _0x47a5=function(_0x53e734,_0x4ea68b){_0x53e734=_0x53e734-0x0;var _0x45ac70=_0x7a54[_0x53e734];return _0x45ac70;};'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 b809fa1..2cf3f02 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 _0xd8b0=['model','query','attributes','fields','nolimit','limit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','filters','length','find','create','body','params','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','WhatsappQueueReport','fieldName','type','keys','intersection'];(function(_0x87a205,_0x458012){var _0x1774dc=function(_0x44821f){while(--_0x44821f){_0x87a205['push'](_0x87a205['shift']());}};_0x1774dc(++_0x458012);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={},_0x97050a={},_0x48f24f={'count':0x0,'rows':[]};var _0x2ab00d=_['map'](db[_0x0d8b('0x29')]['rawAttributes'],function(_0x3c8887){return{'name':_0x3c8887[_0x0d8b('0x2a')],'type':_0x3c8887[_0x0d8b('0x2b')]['key']};});_0x97050a['model']=_['map'](_0x2ab00d,_0x0d8b('0x27'));_0x97050a['query']=_[_0x0d8b('0x2c')](_0x59aa83['query']);_0x97050a['filters']=_[_0x0d8b('0x2d')](_0x97050a[_0x0d8b('0x2e')],_0x97050a[_0x0d8b('0x2f')]);_0x4b59e5[_0x0d8b('0x30')]=_[_0x0d8b('0x2d')](_0x97050a[_0x0d8b('0x2e')],qs[_0x0d8b('0x31')](_0x59aa83[_0x0d8b('0x2f')]['fields']));_0x4b59e5[_0x0d8b('0x30')]=_0x4b59e5[_0x0d8b('0x30')]['length']?_0x4b59e5[_0x0d8b('0x30')]:_0x97050a[_0x0d8b('0x2e')];if(!_0x59aa83[_0x0d8b('0x2f')]['hasOwnProperty'](_0x0d8b('0x32'))){_0x4b59e5[_0x0d8b('0x33')]=qs[_0x0d8b('0x33')](_0x59aa83[_0x0d8b('0x2f')][_0x0d8b('0x33')]);_0x4b59e5['offset']=qs[_0x0d8b('0x1c')](_0x59aa83[_0x0d8b('0x2f')]['offset']);}_0x4b59e5[_0x0d8b('0x34')]=qs[_0x0d8b('0x35')](_0x59aa83[_0x0d8b('0x2f')][_0x0d8b('0x35')]);_0x4b59e5[_0x0d8b('0x36')]=qs['filters'](_['pick'](_0x59aa83[_0x0d8b('0x2f')],_0x97050a['filters']),_0x2ab00d);if(_0x59aa83['query'][_0x0d8b('0x37')]){_0x4b59e5[_0x0d8b('0x36')]=_[_0x0d8b('0x38')](_0x4b59e5[_0x0d8b('0x36')],{'$or':_[_0x0d8b('0x39')](_0x2ab00d,function(_0x24c789){if(_0x24c789['type']!==_0x0d8b('0x3a')){var _0x6a02ad={};_0x6a02ad[_0x24c789[_0x0d8b('0x27')]]={'$like':'%'+_0x59aa83[_0x0d8b('0x2f')][_0x0d8b('0x37')]+'%'};return _0x6a02ad;}})});}_0x4b59e5=_[_0x0d8b('0x38')]({},_0x4b59e5,_0x59aa83[_0x0d8b('0x3b')]);var _0x5c980b={'where':_0x4b59e5[_0x0d8b('0x36')]};return db[_0x0d8b('0x29')][_0x0d8b('0x1e')](_0x5c980b)[_0x0d8b('0x24')](function(_0x59d3ad){_0x48f24f[_0x0d8b('0x1e')]=_0x59d3ad;if(_0x59aa83['query'][_0x0d8b('0x3c')]){_0x4b59e5[_0x0d8b('0x3d')]=[{'all':!![]}];}return db[_0x0d8b('0x29')][_0x0d8b('0x3e')](_0x4b59e5);})[_0x0d8b('0x24')](function(_0x3e632e){_0x48f24f[_0x0d8b('0x3f')]=_0x3e632e;return _0x48f24f;})[_0x0d8b('0x24')](respondWithFilteredResult(_0x1b2b59,_0x4b59e5))[_0x0d8b('0x40')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x41')]=function(_0x482069,_0x571acf){var _0x576050={'raw':!![],'where':{'id':_0x482069['params']['id']}},_0x4d0811={};_0x4d0811[_0x0d8b('0x2e')]=_[_0x0d8b('0x2c')](db[_0x0d8b('0x29')]['rawAttributes']);_0x4d0811['query']=_[_0x0d8b('0x2c')](_0x482069[_0x0d8b('0x2f')]);_0x4d0811[_0x0d8b('0x42')]=_['intersection'](_0x4d0811[_0x0d8b('0x2e')],_0x4d0811[_0x0d8b('0x2f')]);_0x576050['attributes']=_['intersection'](_0x4d0811[_0x0d8b('0x2e')],qs['fields'](_0x482069[_0x0d8b('0x2f')]['fields']));_0x576050['attributes']=_0x576050[_0x0d8b('0x30')][_0x0d8b('0x43')]?_0x576050['attributes']:_0x4d0811['model'];if(_0x482069['query']['includeAll']){_0x576050[_0x0d8b('0x3d')]=[{'all':!![]}];}_0x576050=_[_0x0d8b('0x38')]({},_0x576050,_0x482069[_0x0d8b('0x3b')]);return db['WhatsappQueueReport'][_0x0d8b('0x44')](_0x576050)[_0x0d8b('0x24')](handleEntityNotFound(_0x571acf,null))[_0x0d8b('0x24')](respondWithResult(_0x571acf,null))[_0x0d8b('0x40')](handleError(_0x571acf,null));};exports[_0x0d8b('0x45')]=function(_0x2d5246,_0x11d22b){return db[_0x0d8b('0x29')][_0x0d8b('0x45')](_0x2d5246[_0x0d8b('0x46')],{})[_0x0d8b('0x24')](respondWithResult(_0x11d22b,0xc9))[_0x0d8b('0x40')](handleError(_0x11d22b,null));};exports[_0x0d8b('0x23')]=function(_0x3e569b,_0x570af8){if(_0x3e569b[_0x0d8b('0x46')]['id']){delete _0x3e569b[_0x0d8b('0x46')]['id'];}return db[_0x0d8b('0x29')][_0x0d8b('0x44')]({'where':{'id':_0x3e569b['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x570af8,null))['then'](saveUpdates(_0x3e569b['body'],null))[_0x0d8b('0x24')](respondWithResult(_0x570af8,null))[_0x0d8b('0x40')](handleError(_0x570af8,null));};exports[_0x0d8b('0x25')]=function(_0x4396b5,_0x505d22){return db[_0x0d8b('0x29')][_0x0d8b('0x44')]({'where':{'id':_0x4396b5[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x505d22,null))[_0x0d8b('0x24')](removeEntity(_0x505d22,null))['catch'](handleError(_0x505d22,null));};exports['describe']=function(_0x4e4d5f,_0x573f4f){return db[_0x0d8b('0x29')][_0x0d8b('0x48')]()['then'](respondWithResult(_0x573f4f,null))['catch'](handleError(_0x573f4f,null));}; \ No newline at end of file +var _0xda3f=['fields','nolimit','sort','filter','where','merge','type','VIRTUAL','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','destroy','describe','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','map','key','model','query','keys','filters','intersection','attributes'];(function(_0x20af5d,_0x16b78f){var _0x11e122=function(_0x2dabb7){while(--_0x2dabb7){_0x20af5d['push'](_0x20af5d['shift']());}};_0x11e122(++_0x16b78f);}(_0xda3f,0xec));var _0xfda3=function(_0x2cbb42,_0xa7a6d){_0x2cbb42=_0x2cbb42-0x0;var _0x4dc7b5=_0xda3f[_0x2cbb42];return _0x4dc7b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['index']=function(_0x3c1549,_0x4101b1){var _0x301509={},_0x474992={},_0xe21ec6={'count':0x0,'rows':[]};var _0x3cfeb2=_[_0xfda3('0x28')](db['WhatsappQueueReport']['rawAttributes'],function(_0x3aef3c){return{'name':_0x3aef3c['fieldName'],'type':_0x3aef3c['type'][_0xfda3('0x29')]};});_0x474992[_0xfda3('0x2a')]=_[_0xfda3('0x28')](_0x3cfeb2,_0xfda3('0x26'));_0x474992[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x3c1549[_0xfda3('0x2b')]);_0x474992[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x474992['model'],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2f')]=_[_0xfda3('0x2e')](_0x474992[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x301509[_0xfda3('0x2f')]=_0x301509[_0xfda3('0x2f')]['length']?_0x301509['attributes']:_0x474992[_0xfda3('0x2a')];if(!_0x3c1549[_0xfda3('0x2b')]['hasOwnProperty'](_0xfda3('0x31'))){_0x301509[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3c1549['query'][_0xfda3('0x1b')]);_0x301509[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x19')]);}_0x301509['order']=qs[_0xfda3('0x32')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x32')]);_0x301509['where']=qs[_0xfda3('0x2d')](_['pick'](_0x3c1549[_0xfda3('0x2b')],_0x474992[_0xfda3('0x2d')]),_0x3cfeb2);if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x33')]){_0x301509[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x301509[_0xfda3('0x34')],{'$or':_[_0xfda3('0x28')](_0x3cfeb2,function(_0x577be8){if(_0x577be8[_0xfda3('0x36')]!==_0xfda3('0x37')){var _0xd2dde0={};_0xd2dde0[_0x577be8[_0xfda3('0x26')]]={'$like':'%'+_0x3c1549['query'][_0xfda3('0x33')]+'%'};return _0xd2dde0;}})});}_0x301509=_[_0xfda3('0x35')]({},_0x301509,_0x3c1549[_0xfda3('0x38')]);var _0x5bad90={'where':_0x301509['where']};return db[_0xfda3('0x39')][_0xfda3('0x1c')](_0x5bad90)[_0xfda3('0x23')](function(_0x1aaa6c){_0xe21ec6[_0xfda3('0x1c')]=_0x1aaa6c;if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x301509[_0xfda3('0x3b')]=[{'all':!![]}];}return db[_0xfda3('0x39')][_0xfda3('0x3c')](_0x301509);})['then'](function(_0x27200f){_0xe21ec6[_0xfda3('0x3d')]=_0x27200f;return _0xe21ec6;})['then'](respondWithFilteredResult(_0x4101b1,_0x301509))[_0xfda3('0x3e')](handleError(_0x4101b1,null));};exports['show']=function(_0x51a314,_0x4e6886){var _0x2208bc={'raw':!![],'where':{'id':_0x51a314[_0xfda3('0x3f')]['id']}},_0x107fb1={};_0x107fb1[_0xfda3('0x2a')]=_['keys'](db[_0xfda3('0x39')][_0xfda3('0x40')]);_0x107fb1[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x51a314['query']);_0x107fb1[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],_0x107fb1['query']);_0x2208bc['attributes']=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x51a314[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x2208bc[_0xfda3('0x2f')]=_0x2208bc[_0xfda3('0x2f')][_0xfda3('0x41')]?_0x2208bc[_0xfda3('0x2f')]:_0x107fb1[_0xfda3('0x2a')];if(_0x51a314[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x2208bc[_0xfda3('0x3b')]=[{'all':!![]}];}_0x2208bc=_[_0xfda3('0x35')]({},_0x2208bc,_0x51a314['options']);return db['WhatsappQueueReport'][_0xfda3('0x42')](_0x2208bc)[_0xfda3('0x23')](handleEntityNotFound(_0x4e6886,null))[_0xfda3('0x23')](respondWithResult(_0x4e6886,null))[_0xfda3('0x3e')](handleError(_0x4e6886,null));};exports[_0xfda3('0x43')]=function(_0x60a89d,_0x192133){return db[_0xfda3('0x39')][_0xfda3('0x43')](_0x60a89d[_0xfda3('0x44')],{})['then'](respondWithResult(_0x192133,0xc9))[_0xfda3('0x3e')](handleError(_0x192133,null));};exports[_0xfda3('0x22')]=function(_0x481356,_0x36aa3a){if(_0x481356[_0xfda3('0x44')]['id']){delete _0x481356['body']['id'];}return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x481356[_0xfda3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x23')](saveUpdates(_0x481356[_0xfda3('0x44')],null))[_0xfda3('0x23')](respondWithResult(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));};exports[_0xfda3('0x45')]=function(_0x33565d,_0x2f54eb){return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x33565d['params']['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2f54eb,null))['then'](removeEntity(_0x2f54eb,null))[_0xfda3('0x3e')](handleError(_0x2f54eb,null));};exports['describe']=function(_0x1b5e89,_0x6447){return db[_0xfda3('0x39')][_0xfda3('0x46')]()['then'](respondWithResult(_0x6447,null))[_0xfda3('0x3e')](handleError(_0x6447,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index b2323a8..a4a6790 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 _0x8191=['exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8191,0x1a6));var _0x1819=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0x8191[_0x51b661];return _0x5d1971;};'use strict';var _=require(_0x1819('0x0'));var util=require(_0x1819('0x1'));var logger=require(_0x1819('0x2'))(_0x1819('0x3'));var moment=require(_0x1819('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1819('0x5'));var rimraf=require(_0x1819('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x1819('0x7')]=function(_0x1b287a,_0x488419){return _0x1b287a[_0x1819('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x1819('0x9'),'paranoid':![],'indexes':[{'name':_0x1819('0xa'),'fields':[_0x1819('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4fb0=['../../config/logger','moment','request-promise','path','./whatsappQueueReport.attributes','WhatsappQueueReport','uniqueid','lodash','util'];(function(_0x597f7f,_0x587160){var _0x35d5fb=function(_0x5ccb80){while(--_0x5ccb80){_0x597f7f['push'](_0x597f7f['shift']());}};_0x35d5fb(++_0x587160);}(_0x4fb0,0x1ae));var _0x04fb=function(_0x6dd04b,_0xadfde8){_0x6dd04b=_0x6dd04b-0x0;var _0x3d6ff2=_0x4fb0[_0x6dd04b];return _0x3d6ff2;};'use strict';var _=require(_0x04fb('0x0'));var util=require(_0x04fb('0x1'));var logger=require(_0x04fb('0x2'))('api');var moment=require(_0x04fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x04fb('0x4'));var fs=require('fs');var path=require(_0x04fb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04fb('0x6'));module['exports']=function(_0x4d2a50,_0x14a080){return _0x4d2a50['define'](_0x04fb('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x04fb('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 2995ca0..032c830 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 _0xd6fd=['code','message','info','result','catch','WhatsappQueueReport','create','options','raw','then','CreateWhatsappQueueReport','body','where','attributes','limit','UpdateWhatsappQueueReport','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xd6fd,0x110));var _0xdd6f=function(_0x1c88f9,_0x211646){_0x1c88f9=_0x1c88f9-0x0;var _0x1779f7=_0xd6fd[_0x1c88f9];return _0x1779f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd6f('0x0'));var BPromise=require(_0xdd6f('0x1'));var rs=require(_0xdd6f('0x2'));var fs=require('fs');var Redis=require(_0xdd6f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd6f('0x4'));var logger=require('../../config/logger')(_0xdd6f('0x5'));var config=require(_0xdd6f('0x6'));var jayson=require(_0xdd6f('0x7'));var client=jayson[_0xdd6f('0x8')][_0xdd6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x552b2f,_0x5099fb,_0x5f0bcf){return new BPromise(function(_0x1cf9e4,_0x1d30e3){return client[_0xdd6f('0xa')](_0x552b2f,_0x5f0bcf)['then'](function(_0x390595){logger['info'](_0xdd6f('0xb'),_0x5099fb,_0xdd6f('0xc'));logger[_0xdd6f('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5099fb,_0xdd6f('0xc'),JSON[_0xdd6f('0xe')](_0x390595));if(_0x390595[_0xdd6f('0xf')]){if(_0x390595[_0xdd6f('0xf')][_0xdd6f('0x10')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5099fb,_0x390595[_0xdd6f('0xf')][_0xdd6f('0x11')]);return _0x1d30e3(_0x390595[_0xdd6f('0xf')][_0xdd6f('0x11')]);}logger[_0xdd6f('0xf')](_0xdd6f('0xb'),_0x5099fb,_0x390595[_0xdd6f('0xf')]['message']);return _0x1cf9e4(_0x390595[_0xdd6f('0xf')][_0xdd6f('0x11')]);}else{logger[_0xdd6f('0x12')](_0xdd6f('0xb'),_0x5099fb,_0xdd6f('0xc'));_0x1cf9e4(_0x390595[_0xdd6f('0x13')][_0xdd6f('0x11')]);}})[_0xdd6f('0x14')](function(_0x19af9a){logger['error'](_0xdd6f('0xb'),_0x5099fb,_0x19af9a);_0x1d30e3(_0x19af9a);});});}exports['CreateWhatsappQueueReport']=function(_0x2716ab){var _0x451129=this;return new Promise(function(_0x40e15c,_0x2ce04e){return db[_0xdd6f('0x15')][_0xdd6f('0x16')](_0x2716ab['body'],{'raw':_0x2716ab[_0xdd6f('0x17')]?_0x2716ab[_0xdd6f('0x17')][_0xdd6f('0x18')]===undefined?!![]:![]:!![]})[_0xdd6f('0x19')](function(_0x28cae4){logger[_0xdd6f('0x12')]('CreateWhatsappQueueReport',_0x2716ab);logger[_0xdd6f('0xd')](_0xdd6f('0x1a'),_0x2716ab,JSON['stringify'](_0x28cae4));_0x40e15c(_0x28cae4);})['catch'](function(_0x234d3c){logger[_0xdd6f('0xf')](_0xdd6f('0x1a'),_0x234d3c['message'],_0x2716ab);_0x2ce04e(_0x451129[_0xdd6f('0xf')](0x1f4,_0x234d3c[_0xdd6f('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5e71db){var _0xc2e542=this;return new Promise(function(_0x34fb3b,_0x245ebc){return db[_0xdd6f('0x15')]['update'](_0x5e71db[_0xdd6f('0x1b')],{'raw':_0x5e71db['options']?_0x5e71db['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e71db[_0xdd6f('0x17')]?_0x5e71db['options'][_0xdd6f('0x1c')]||null:null,'attributes':_0x5e71db[_0xdd6f('0x17')]?_0x5e71db[_0xdd6f('0x17')][_0xdd6f('0x1d')]||null:null,'limit':_0x5e71db[_0xdd6f('0x17')]?_0x5e71db[_0xdd6f('0x17')][_0xdd6f('0x1e')]||null:null})[_0xdd6f('0x19')](function(_0x128cdd){logger[_0xdd6f('0x12')](_0xdd6f('0x1f'),_0x5e71db);logger['debug'](_0xdd6f('0x1f'),_0x5e71db,JSON[_0xdd6f('0xe')](_0x128cdd));_0x34fb3b(_0x128cdd);})[_0xdd6f('0x14')](function(_0x400041){logger[_0xdd6f('0xf')]('UpdateWhatsappQueueReport',_0x400041[_0xdd6f('0x11')],_0x5e71db);_0x245ebc(_0xc2e542[_0xdd6f('0xf')](0x1f4,_0x400041[_0xdd6f('0x11')]));});});}; \ No newline at end of file +var _0x215c=['attributes','UpdateWhatsappQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','update','raw','where'];(function(_0x1eed90,_0x36df41){var _0x4671b9=function(_0x6d42c6){while(--_0x6d42c6){_0x1eed90['push'](_0x1eed90['shift']());}};_0x4671b9(++_0x36df41);}(_0x215c,0x107));var _0xc215=function(_0x3d3098,_0x3d9b8a){_0x3d3098=_0x3d3098-0x0;var _0x3a95e9=_0x215c[_0x3d3098];return _0x3a95e9;};'use strict';var _=require('lodash');var util=require(_0xc215('0x0'));var moment=require(_0xc215('0x1'));var BPromise=require(_0xc215('0x2'));var rs=require(_0xc215('0x3'));var fs=require('fs');var Redis=require(_0xc215('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc215('0x5'));var logger=require(_0xc215('0x6'))(_0xc215('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc215('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4745d5,_0x6b7060,_0x2e096b){return new BPromise(function(_0x358c38,_0x33a70e){return client[_0xc215('0x9')](_0x4745d5,_0x2e096b)[_0xc215('0xa')](function(_0x5d5189){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x6b7060,'request\x20sent');logger[_0xc215('0xb')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x6b7060,'request\x20sent',JSON[_0xc215('0xc')](_0x5d5189));if(_0x5d5189[_0xc215('0xd')]){if(_0x5d5189['error'][_0xc215('0xe')]===0x1f4){logger[_0xc215('0xd')](_0xc215('0xf'),_0x6b7060,_0x5d5189['error'][_0xc215('0x10')]);return _0x33a70e(_0x5d5189[_0xc215('0xd')]['message']);}logger[_0xc215('0xd')](_0xc215('0xf'),_0x6b7060,_0x5d5189['error'][_0xc215('0x10')]);return _0x358c38(_0x5d5189[_0xc215('0xd')][_0xc215('0x10')]);}else{logger[_0xc215('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x6b7060,'request\x20sent');_0x358c38(_0x5d5189[_0xc215('0x12')][_0xc215('0x10')]);}})[_0xc215('0x13')](function(_0x5e8302){logger[_0xc215('0xd')](_0xc215('0xf'),_0x6b7060,_0x5e8302);_0x33a70e(_0x5e8302);});});}exports[_0xc215('0x14')]=function(_0x4c13ee){var _0x1fbaff=this;return new Promise(function(_0x1da22e,_0x410779){return db[_0xc215('0x15')][_0xc215('0x16')](_0x4c13ee['body'],{'raw':_0x4c13ee[_0xc215('0x17')]?_0x4c13ee[_0xc215('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc215('0xa')](function(_0x36df0a){logger['info']('CreateWhatsappQueueReport',_0x4c13ee);logger['debug'](_0xc215('0x14'),_0x4c13ee,JSON[_0xc215('0xc')](_0x36df0a));_0x1da22e(_0x36df0a);})[_0xc215('0x13')](function(_0x2bc288){logger[_0xc215('0xd')](_0xc215('0x14'),_0x2bc288['message'],_0x4c13ee);_0x410779(_0x1fbaff['error'](0x1f4,_0x2bc288['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x440424){var _0x268eb6=this;return new Promise(function(_0x3f5e9e,_0x357feb){return db[_0xc215('0x15')][_0xc215('0x18')](_0x440424['body'],{'raw':_0x440424[_0xc215('0x17')]?_0x440424[_0xc215('0x17')][_0xc215('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x440424[_0xc215('0x17')]?_0x440424[_0xc215('0x17')][_0xc215('0x1a')]||null:null,'attributes':_0x440424['options']?_0x440424[_0xc215('0x17')][_0xc215('0x1b')]||null:null,'limit':_0x440424[_0xc215('0x17')]?_0x440424[_0xc215('0x17')]['limit']||null:null})[_0xc215('0xa')](function(_0x3a67e4){logger[_0xc215('0x11')]('UpdateWhatsappQueueReport',_0x440424);logger[_0xc215('0xb')](_0xc215('0x1c'),_0x440424,JSON[_0xc215('0xc')](_0x3a67e4));_0x3f5e9e(_0x3a67e4);})[_0xc215('0x13')](function(_0xa7e506){logger['error'](_0xc215('0x1c'),_0xa7e506[_0xc215('0x10')],_0x440424);_0x357feb(_0x268eb6[_0xc215('0xd')](0x1f4,_0xa7e506[_0xc215('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 59c8bcc..a256f75 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 _0xcbe4=['util','path','express','Router','../../components/interaction/service','./whatsappTransferReport.controller','get','describe','/:id','show','post','isAuthenticated','create','put','update','destroy','exports','multer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcbe4,0x10d));var _0x4cbe=function(_0x2a1587,_0x225411){_0x2a1587=_0x2a1587-0x0;var _0x5d87e1=_0xcbe4[_0x2a1587];return _0x5d87e1;};'use strict';var multer=require(_0x4cbe('0x0'));var util=require(_0x4cbe('0x1'));var path=require(_0x4cbe('0x2'));var timeout=require('connect-timeout');var express=require(_0x4cbe('0x3'));var router=express[_0x4cbe('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4cbe('0x5'));var config=require('../../config/environment');var controller=require(_0x4cbe('0x6'));router[_0x4cbe('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4cbe('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x4cbe('0x8')]);router[_0x4cbe('0x7')](_0x4cbe('0x9'),auth['isAuthenticated'](),controller[_0x4cbe('0xa')]);router[_0x4cbe('0xb')]('/',auth[_0x4cbe('0xc')](),controller[_0x4cbe('0xd')]);router[_0x4cbe('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4cbe('0xf')]);router['delete'](_0x4cbe('0x9'),auth[_0x4cbe('0xc')](),controller[_0x4cbe('0x10')]);module[_0x4cbe('0x11')]=router; \ No newline at end of file +var _0x8194=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x2fdb17,_0x2784c4){var _0x1b61e1=function(_0x2daea9){while(--_0x2daea9){_0x2fdb17['push'](_0x2fdb17['shift']());}};_0x1b61e1(++_0x2784c4);}(_0x8194,0x1c9));var _0x4819=function(_0x264e1e,_0x3af804){_0x264e1e=_0x264e1e-0x0;var _0x4b1840=_0x8194[_0x264e1e];return _0x4b1840;};'use strict';var multer=require(_0x4819('0x0'));var util=require(_0x4819('0x1'));var path=require(_0x4819('0x2'));var timeout=require(_0x4819('0x3'));var express=require(_0x4819('0x4'));var router=express[_0x4819('0x5')]();var fs_extra=require(_0x4819('0x6'));var auth=require(_0x4819('0x7'));var interaction=require(_0x4819('0x8'));var config=require(_0x4819('0x9'));var controller=require(_0x4819('0xa'));router[_0x4819('0xb')]('/',auth['isAuthenticated'](),controller[_0x4819('0xc')]);router[_0x4819('0xb')](_0x4819('0xd'),auth[_0x4819('0xe')](),controller[_0x4819('0xf')]);router[_0x4819('0xb')]('/:id',auth[_0x4819('0xe')](),controller[_0x4819('0x10')]);router['post']('/',auth[_0x4819('0xe')](),controller[_0x4819('0x11')]);router[_0x4819('0x12')](_0x4819('0x13'),auth[_0x4819('0xe')](),controller['update']);router[_0x4819('0x14')]('/:id',auth[_0x4819('0xe')](),controller[_0x4819('0x15')]);module[_0x4819('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index bbc35aa..d61d811 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 _0xb10d=['ENUM','account','agent','queue','DATE','sequelize','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb10d,0x17f));var _0xdb10=function(_0x33f184,_0x400ea3){_0x33f184=_0x33f184-0x0;var _0x107e6f=_0xb10d[_0x33f184];return _0x107e6f;};'use strict';var Sequelize=require(_0xdb10('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdb10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdb10('0x2')](_0xdb10('0x3'),_0xdb10('0x4'),_0xdb10('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdb10('0x6')]}}; \ No newline at end of file +var _0x85cf=['STRING','ENUM','account','agent','queue','DATE','exports'];(function(_0x45a38e,_0x55fbad){var _0x2924a1=function(_0x5f2a23){while(--_0x5f2a23){_0x45a38e['push'](_0x45a38e['shift']());}};_0x2924a1(++_0x55fbad);}(_0x85cf,0x76));var _0xf85c=function(_0x1765fa,_0x209fb3){_0x1765fa=_0x1765fa-0x0;var _0x4ea20e=_0x85cf[_0x1765fa];return _0x4ea20e;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'uniqueid':{'type':Sequelize[_0xf85c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf85c('0x2')](_0xf85c('0x3'),_0xf85c('0x4'),_0xf85c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf85c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 5c5f512..861ae44 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 _0xb8ed=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','status','sendStatus','error','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x93308f,_0x51610a){var _0xeacc65=function(_0x5590ee){while(--_0x5590ee){_0x93308f['push'](_0x93308f['shift']());}};_0xeacc65(++_0x51610a);}(_0xb8ed,0xcf));var _0xdb8e=function(_0x7d0149,_0x1b6d23){_0x7d0149=_0x7d0149-0x0;var _0xaabd78=_0xb8ed[_0x7d0149];return _0xaabd78;};'use strict';var emlformat=require(_0xdb8e('0x0'));var rimraf=require(_0xdb8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb8e('0x2'));var rp=require('request-promise');var moment=require(_0xdb8e('0x3'));var BPromise=require(_0xdb8e('0x4'));var Mustache=require(_0xdb8e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdb8e('0x6'));var csv=require(_0xdb8e('0x7'));var ejs=require(_0xdb8e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdb8e('0x9'));var crypto=require(_0xdb8e('0xa'));var jsforce=require(_0xdb8e('0xb'));var deskjs=require(_0xdb8e('0xc'));var toCsv=require(_0xdb8e('0x7'));var querystring=require(_0xdb8e('0xd'));var Papa=require(_0xdb8e('0xe'));var Redis=require(_0xdb8e('0xf'));var authService=require(_0xdb8e('0x10'));var qs=require(_0xdb8e('0x11'));var as=require(_0xdb8e('0x12'));var hardwareService=require(_0xdb8e('0x13'));var logger=require(_0xdb8e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdb8e('0x15'));var licenseUtil=require(_0xdb8e('0x16'));var db=require(_0xdb8e('0x17'))['db'];function respondWithStatusCode(_0x1e6852,_0x184795){_0x184795=_0x184795||0xcc;return function(_0x562443){if(_0x562443){return _0x1e6852['sendStatus'](_0x184795);}return _0x1e6852['status'](_0x184795)[_0xdb8e('0x18')]();};}function respondWithResult(_0x269337,_0x1b4386){_0x1b4386=_0x1b4386||0xc8;return function(_0x42abff){if(_0x42abff){return _0x269337['status'](_0x1b4386)[_0xdb8e('0x19')](_0x42abff);}};}function respondWithFilteredResult(_0x37b689,_0x3d66ac){return function(_0x4d306e){if(_0x4d306e){var _0x38d443=typeof _0x3d66ac['offset']===_0xdb8e('0x1a')&&typeof _0x3d66ac[_0xdb8e('0x1b')]==='undefined';var _0x13eab9=_0x4d306e[_0xdb8e('0x1c')];var _0x50a3ba=_0x38d443?0x0:_0x3d66ac[_0xdb8e('0x1d')];var _0x16c8d4=_0x38d443?_0x4d306e['count']:_0x3d66ac[_0xdb8e('0x1d')]+_0x3d66ac[_0xdb8e('0x1b')];var _0x1df724;if(_0x16c8d4>=_0x13eab9){_0x16c8d4=_0x13eab9;_0x1df724=0xc8;}else{_0x1df724=0xce;}_0x37b689['status'](_0x1df724);return _0x37b689[_0xdb8e('0x1e')](_0xdb8e('0x1f'),_0x50a3ba+'-'+_0x16c8d4+'/'+_0x13eab9)[_0xdb8e('0x19')](_0x4d306e);}return null;};}function patchUpdates(_0x1faa8e){return function(_0x425e17){try{jsonpatch[_0xdb8e('0x20')](_0x425e17,_0x1faa8e,!![]);}catch(_0x173384){return BPromise['reject'](_0x173384);}return _0x425e17[_0xdb8e('0x21')]();};}function saveUpdates(_0x43c80d,_0x16a859){return function(_0x23c031){if(_0x23c031){return _0x23c031['update'](_0x43c80d)['then'](function(_0x576773){return _0x576773;});}return null;};}function removeEntity(_0x1f7977,_0x1b1589){return function(_0x215470){if(_0x215470){return _0x215470['destroy']()['then'](function(){_0x1f7977[_0xdb8e('0x22')](0xcc)[_0xdb8e('0x18')]();});}};}function handleEntityNotFound(_0x37ffea,_0x45f440){return function(_0x4c83f1){if(!_0x4c83f1){_0x37ffea[_0xdb8e('0x23')](0x194);}return _0x4c83f1;};}function handleError(_0x3e23dc,_0x4d0e9c){_0x4d0e9c=_0x4d0e9c||0x1f4;return function(_0x58db78){logger[_0xdb8e('0x24')](_0x58db78['stack']);if(_0x58db78['name']){delete _0x58db78[_0xdb8e('0x25')];}_0x3e23dc[_0xdb8e('0x22')](_0x4d0e9c)['send'](_0x58db78);};}exports[_0xdb8e('0x26')]=function(_0x20843a,_0x3e7c93){var _0x414168={},_0x26dcc3={},_0x4d3a4a={'count':0x0,'rows':[]};var _0x3ab260=_[_0xdb8e('0x27')](db[_0xdb8e('0x28')][_0xdb8e('0x29')],function(_0x50a284){return{'name':_0x50a284[_0xdb8e('0x2a')],'type':_0x50a284[_0xdb8e('0x2b')][_0xdb8e('0x2c')]};});_0x26dcc3[_0xdb8e('0x2d')]=_['map'](_0x3ab260,_0xdb8e('0x25'));_0x26dcc3['query']=_[_0xdb8e('0x2e')](_0x20843a[_0xdb8e('0x2f')]);_0x26dcc3['filters']=_[_0xdb8e('0x30')](_0x26dcc3[_0xdb8e('0x2d')],_0x26dcc3[_0xdb8e('0x2f')]);_0x414168[_0xdb8e('0x31')]=_[_0xdb8e('0x30')](_0x26dcc3[_0xdb8e('0x2d')],qs[_0xdb8e('0x32')](_0x20843a[_0xdb8e('0x2f')][_0xdb8e('0x32')]));_0x414168[_0xdb8e('0x31')]=_0x414168[_0xdb8e('0x31')]['length']?_0x414168[_0xdb8e('0x31')]:_0x26dcc3[_0xdb8e('0x2d')];if(!_0x20843a[_0xdb8e('0x2f')][_0xdb8e('0x33')](_0xdb8e('0x34'))){_0x414168['limit']=qs[_0xdb8e('0x1b')](_0x20843a[_0xdb8e('0x2f')]['limit']);_0x414168[_0xdb8e('0x1d')]=qs[_0xdb8e('0x1d')](_0x20843a[_0xdb8e('0x2f')][_0xdb8e('0x1d')]);}_0x414168['order']=qs[_0xdb8e('0x35')](_0x20843a[_0xdb8e('0x2f')][_0xdb8e('0x35')]);_0x414168['where']=qs[_0xdb8e('0x36')](_[_0xdb8e('0x37')](_0x20843a[_0xdb8e('0x2f')],_0x26dcc3[_0xdb8e('0x36')]),_0x3ab260);if(_0x20843a['query'][_0xdb8e('0x38')]){_0x414168[_0xdb8e('0x39')]=_[_0xdb8e('0x3a')](_0x414168[_0xdb8e('0x39')],{'$or':_[_0xdb8e('0x27')](_0x3ab260,function(_0x267578){if(_0x267578[_0xdb8e('0x2b')]!==_0xdb8e('0x3b')){var _0x51b605={};_0x51b605[_0x267578['name']]={'$like':'%'+_0x20843a[_0xdb8e('0x2f')]['filter']+'%'};return _0x51b605;}})});}_0x414168=_['merge']({},_0x414168,_0x20843a[_0xdb8e('0x3c')]);var _0x11f78c={'where':_0x414168['where']};return db[_0xdb8e('0x28')][_0xdb8e('0x1c')](_0x11f78c)[_0xdb8e('0x3d')](function(_0x50b27f){_0x4d3a4a[_0xdb8e('0x1c')]=_0x50b27f;if(_0x20843a[_0xdb8e('0x2f')][_0xdb8e('0x3e')]){_0x414168[_0xdb8e('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xdb8e('0x40')](_0x414168);})[_0xdb8e('0x3d')](function(_0x4fbdb3){_0x4d3a4a[_0xdb8e('0x41')]=_0x4fbdb3;return _0x4d3a4a;})[_0xdb8e('0x3d')](respondWithFilteredResult(_0x3e7c93,_0x414168))[_0xdb8e('0x42')](handleError(_0x3e7c93,null));};exports['show']=function(_0x2fbaeb,_0x2af81b){var _0xd1354a={'raw':!![],'where':{'id':_0x2fbaeb[_0xdb8e('0x43')]['id']}},_0x78f289={};_0x78f289[_0xdb8e('0x2d')]=_['keys'](db[_0xdb8e('0x28')][_0xdb8e('0x29')]);_0x78f289[_0xdb8e('0x2f')]=_['keys'](_0x2fbaeb['query']);_0x78f289[_0xdb8e('0x36')]=_[_0xdb8e('0x30')](_0x78f289[_0xdb8e('0x2d')],_0x78f289[_0xdb8e('0x2f')]);_0xd1354a[_0xdb8e('0x31')]=_[_0xdb8e('0x30')](_0x78f289[_0xdb8e('0x2d')],qs[_0xdb8e('0x32')](_0x2fbaeb[_0xdb8e('0x2f')]['fields']));_0xd1354a['attributes']=_0xd1354a[_0xdb8e('0x31')]['length']?_0xd1354a[_0xdb8e('0x31')]:_0x78f289[_0xdb8e('0x2d')];if(_0x2fbaeb[_0xdb8e('0x2f')]['includeAll']){_0xd1354a[_0xdb8e('0x3f')]=[{'all':!![]}];}_0xd1354a=_['merge']({},_0xd1354a,_0x2fbaeb[_0xdb8e('0x3c')]);return db[_0xdb8e('0x28')]['find'](_0xd1354a)[_0xdb8e('0x3d')](handleEntityNotFound(_0x2af81b,null))['then'](respondWithResult(_0x2af81b,null))[_0xdb8e('0x42')](handleError(_0x2af81b,null));};exports[_0xdb8e('0x44')]=function(_0x551eac,_0x446632){return db[_0xdb8e('0x28')][_0xdb8e('0x44')](_0x551eac[_0xdb8e('0x45')],{})[_0xdb8e('0x3d')](respondWithResult(_0x446632,0xc9))[_0xdb8e('0x42')](handleError(_0x446632,null));};exports[_0xdb8e('0x46')]=function(_0x48937f,_0x455468){if(_0x48937f[_0xdb8e('0x45')]['id']){delete _0x48937f[_0xdb8e('0x45')]['id'];}return db[_0xdb8e('0x28')]['find']({'where':{'id':_0x48937f['params']['id']}})[_0xdb8e('0x3d')](handleEntityNotFound(_0x455468,null))[_0xdb8e('0x3d')](saveUpdates(_0x48937f[_0xdb8e('0x45')],null))[_0xdb8e('0x3d')](respondWithResult(_0x455468,null))[_0xdb8e('0x42')](handleError(_0x455468,null));};exports['destroy']=function(_0x363c01,_0x189033){return db['WhatsappTransferReport'][_0xdb8e('0x47')]({'where':{'id':_0x363c01['params']['id']}})['then'](handleEntityNotFound(_0x189033,null))[_0xdb8e('0x3d')](removeEntity(_0x189033,null))[_0xdb8e('0x42')](handleError(_0x189033,null));};exports[_0xdb8e('0x48')]=function(_0x2e6b2b,_0x5bb9ec){return db['WhatsappTransferReport']['describe']()[_0xdb8e('0x3d')](respondWithResult(_0x5bb9ec,null))['catch'](handleError(_0x5bb9ec,null));}; \ No newline at end of file +var _0x2d6d=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','WhatsappTransferReport','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','type','key'];(function(_0x225df9,_0x2c7568){var _0x314f41=function(_0x456f1a){while(--_0x456f1a){_0x225df9['push'](_0x225df9['shift']());}};_0x314f41(++_0x2c7568);}(_0x2d6d,0x66));var _0xd2d6=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x2d6d[_0x3cf5a3];return _0x39ba2d;};'use strict';var emlformat=require(_0xd2d6('0x0'));var rimraf=require(_0xd2d6('0x1'));var zipdir=require(_0xd2d6('0x2'));var jsonpatch=require(_0xd2d6('0x3'));var rp=require(_0xd2d6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd2d6('0x5'));var util=require(_0xd2d6('0x6'));var path=require(_0xd2d6('0x7'));var sox=require(_0xd2d6('0x8'));var csv=require(_0xd2d6('0x9'));var ejs=require(_0xd2d6('0xa'));var fs=require('fs');var fs_extra=require(_0xd2d6('0xb'));var _=require(_0xd2d6('0xc'));var squel=require(_0xd2d6('0xd'));var crypto=require('crypto');var jsforce=require(_0xd2d6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd2d6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd2d6('0xf'));var authService=require(_0xd2d6('0x10'));var qs=require(_0xd2d6('0x11'));var as=require(_0xd2d6('0x12'));var hardwareService=require(_0xd2d6('0x13'));var logger=require(_0xd2d6('0x14'))(_0xd2d6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd2d6('0x16'));var db=require(_0xd2d6('0x17'))['db'];function respondWithStatusCode(_0x43dbae,_0x199206){_0x199206=_0x199206||0xcc;return function(_0x38a8be){if(_0x38a8be){return _0x43dbae[_0xd2d6('0x18')](_0x199206);}return _0x43dbae['status'](_0x199206)[_0xd2d6('0x19')]();};}function respondWithResult(_0x1ed2e8,_0xb0a34){_0xb0a34=_0xb0a34||0xc8;return function(_0x439e3d){if(_0x439e3d){return _0x1ed2e8['status'](_0xb0a34)['json'](_0x439e3d);}};}function respondWithFilteredResult(_0x37a6bc,_0x352619){return function(_0x2a4b1a){if(_0x2a4b1a){var _0x8ba7fb=typeof _0x352619[_0xd2d6('0x1a')]===_0xd2d6('0x1b')&&typeof _0x352619['limit']===_0xd2d6('0x1b');var _0x57a7ea=_0x2a4b1a['count'];var _0x568aff=_0x8ba7fb?0x0:_0x352619[_0xd2d6('0x1a')];var _0x322a52=_0x8ba7fb?_0x2a4b1a[_0xd2d6('0x1c')]:_0x352619[_0xd2d6('0x1a')]+_0x352619['limit'];var _0x2d3bcb;if(_0x322a52>=_0x57a7ea){_0x322a52=_0x57a7ea;_0x2d3bcb=0xc8;}else{_0x2d3bcb=0xce;}_0x37a6bc[_0xd2d6('0x1d')](_0x2d3bcb);return _0x37a6bc['set'](_0xd2d6('0x1e'),_0x568aff+'-'+_0x322a52+'/'+_0x57a7ea)[_0xd2d6('0x1f')](_0x2a4b1a);}return null;};}function patchUpdates(_0x4313ae){return function(_0x5666e9){try{jsonpatch[_0xd2d6('0x20')](_0x5666e9,_0x4313ae,!![]);}catch(_0x213e96){return BPromise[_0xd2d6('0x21')](_0x213e96);}return _0x5666e9['save']();};}function saveUpdates(_0x39d3f0,_0x2422c0){return function(_0x5d4f17){if(_0x5d4f17){return _0x5d4f17[_0xd2d6('0x22')](_0x39d3f0)[_0xd2d6('0x23')](function(_0x485ea5){return _0x485ea5;});}return null;};}function removeEntity(_0x47f7a1,_0x1f296e){return function(_0x50544a){if(_0x50544a){return _0x50544a[_0xd2d6('0x24')]()[_0xd2d6('0x23')](function(){_0x47f7a1[_0xd2d6('0x1d')](0xcc)[_0xd2d6('0x19')]();});}};}function handleEntityNotFound(_0x4f52bb,_0x270934){return function(_0x36c70c){if(!_0x36c70c){_0x4f52bb[_0xd2d6('0x18')](0x194);}return _0x36c70c;};}function handleError(_0xb0550d,_0x4ef679){_0x4ef679=_0x4ef679||0x1f4;return function(_0x2e18fd){logger[_0xd2d6('0x25')](_0x2e18fd[_0xd2d6('0x26')]);if(_0x2e18fd[_0xd2d6('0x27')]){delete _0x2e18fd['name'];}_0xb0550d[_0xd2d6('0x1d')](_0x4ef679)['send'](_0x2e18fd);};}exports[_0xd2d6('0x28')]=function(_0x4c1828,_0x8f3083){var _0x88566d={},_0x3b3f81={},_0x3138ad={'count':0x0,'rows':[]};var _0x7784c9=_[_0xd2d6('0x29')](db['WhatsappTransferReport']['rawAttributes'],function(_0x26c198){return{'name':_0x26c198['fieldName'],'type':_0x26c198[_0xd2d6('0x2a')][_0xd2d6('0x2b')]};});_0x3b3f81[_0xd2d6('0x2c')]=_['map'](_0x7784c9,'name');_0x3b3f81[_0xd2d6('0x2d')]=_[_0xd2d6('0x2e')](_0x4c1828['query']);_0x3b3f81[_0xd2d6('0x2f')]=_[_0xd2d6('0x30')](_0x3b3f81[_0xd2d6('0x2c')],_0x3b3f81['query']);_0x88566d['attributes']=_['intersection'](_0x3b3f81[_0xd2d6('0x2c')],qs[_0xd2d6('0x31')](_0x4c1828['query'][_0xd2d6('0x31')]));_0x88566d[_0xd2d6('0x32')]=_0x88566d[_0xd2d6('0x32')][_0xd2d6('0x33')]?_0x88566d[_0xd2d6('0x32')]:_0x3b3f81[_0xd2d6('0x2c')];if(!_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x34')](_0xd2d6('0x35'))){_0x88566d[_0xd2d6('0x36')]=qs[_0xd2d6('0x36')](_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x36')]);_0x88566d[_0xd2d6('0x1a')]=qs[_0xd2d6('0x1a')](_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x1a')]);}_0x88566d[_0xd2d6('0x37')]=qs[_0xd2d6('0x38')](_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x38')]);_0x88566d[_0xd2d6('0x39')]=qs[_0xd2d6('0x2f')](_['pick'](_0x4c1828[_0xd2d6('0x2d')],_0x3b3f81['filters']),_0x7784c9);if(_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x3a')]){_0x88566d[_0xd2d6('0x39')]=_['merge'](_0x88566d[_0xd2d6('0x39')],{'$or':_[_0xd2d6('0x29')](_0x7784c9,function(_0x3252c8){if(_0x3252c8[_0xd2d6('0x2a')]!=='VIRTUAL'){var _0x3d2414={};_0x3d2414[_0x3252c8[_0xd2d6('0x27')]]={'$like':'%'+_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x3a')]+'%'};return _0x3d2414;}})});}_0x88566d=_[_0xd2d6('0x3b')]({},_0x88566d,_0x4c1828['options']);var _0x9e0db2={'where':_0x88566d['where']};return db[_0xd2d6('0x3c')]['count'](_0x9e0db2)['then'](function(_0x1e2f05){_0x3138ad[_0xd2d6('0x1c')]=_0x1e2f05;if(_0x4c1828['query'][_0xd2d6('0x3d')]){_0x88566d[_0xd2d6('0x3e')]=[{'all':!![]}];}return db[_0xd2d6('0x3c')]['findAll'](_0x88566d);})[_0xd2d6('0x23')](function(_0x5baf88){_0x3138ad[_0xd2d6('0x3f')]=_0x5baf88;return _0x3138ad;})[_0xd2d6('0x23')](respondWithFilteredResult(_0x8f3083,_0x88566d))[_0xd2d6('0x40')](handleError(_0x8f3083,null));};exports[_0xd2d6('0x41')]=function(_0x4feac5,_0x55b19a){var _0x28f2a6={'raw':!![],'where':{'id':_0x4feac5[_0xd2d6('0x42')]['id']}},_0x18ed22={};_0x18ed22['model']=_['keys'](db[_0xd2d6('0x3c')][_0xd2d6('0x43')]);_0x18ed22[_0xd2d6('0x2d')]=_['keys'](_0x4feac5['query']);_0x18ed22['filters']=_[_0xd2d6('0x30')](_0x18ed22[_0xd2d6('0x2c')],_0x18ed22['query']);_0x28f2a6['attributes']=_[_0xd2d6('0x30')](_0x18ed22['model'],qs[_0xd2d6('0x31')](_0x4feac5[_0xd2d6('0x2d')][_0xd2d6('0x31')]));_0x28f2a6[_0xd2d6('0x32')]=_0x28f2a6[_0xd2d6('0x32')][_0xd2d6('0x33')]?_0x28f2a6['attributes']:_0x18ed22[_0xd2d6('0x2c')];if(_0x4feac5[_0xd2d6('0x2d')]['includeAll']){_0x28f2a6[_0xd2d6('0x3e')]=[{'all':!![]}];}_0x28f2a6=_[_0xd2d6('0x3b')]({},_0x28f2a6,_0x4feac5[_0xd2d6('0x44')]);return db[_0xd2d6('0x3c')][_0xd2d6('0x45')](_0x28f2a6)[_0xd2d6('0x23')](handleEntityNotFound(_0x55b19a,null))[_0xd2d6('0x23')](respondWithResult(_0x55b19a,null))[_0xd2d6('0x40')](handleError(_0x55b19a,null));};exports[_0xd2d6('0x46')]=function(_0x48e7c9,_0x2720b0){return db['WhatsappTransferReport']['create'](_0x48e7c9[_0xd2d6('0x47')],{})[_0xd2d6('0x23')](respondWithResult(_0x2720b0,0xc9))[_0xd2d6('0x40')](handleError(_0x2720b0,null));};exports[_0xd2d6('0x22')]=function(_0x3c3db5,_0x1e30b2){if(_0x3c3db5[_0xd2d6('0x47')]['id']){delete _0x3c3db5[_0xd2d6('0x47')]['id'];}return db[_0xd2d6('0x3c')][_0xd2d6('0x45')]({'where':{'id':_0x3c3db5[_0xd2d6('0x42')]['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x1e30b2,null))[_0xd2d6('0x23')](saveUpdates(_0x3c3db5[_0xd2d6('0x47')],null))[_0xd2d6('0x23')](respondWithResult(_0x1e30b2,null))[_0xd2d6('0x40')](handleError(_0x1e30b2,null));};exports['destroy']=function(_0x1ae825,_0x268e50){return db[_0xd2d6('0x3c')][_0xd2d6('0x45')]({'where':{'id':_0x1ae825['params']['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x268e50,null))[_0xd2d6('0x23')](removeEntity(_0x268e50,null))[_0xd2d6('0x40')](handleError(_0x268e50,null));};exports[_0xd2d6('0x48')]=function(_0x570d20,_0xdb268d){return db[_0xd2d6('0x3c')][_0xd2d6('0x48')]()[_0xd2d6('0x23')](respondWithResult(_0xdb268d,null))['catch'](handleError(_0xdb268d,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index c0fe06f..56136e6 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 _0x1a43=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1a43,0xa3));var _0x31a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x31a4('0x0'))(_0x31a4('0x1'));var moment=require(_0x31a4('0x2'));var BPromise=require(_0x31a4('0x3'));var rp=require(_0x31a4('0x4'));var fs=require('fs');var path=require(_0x31a4('0x5'));var rimraf=require(_0x31a4('0x6'));var config=require(_0x31a4('0x7'));var attributes=require(_0x31a4('0x8'));module[_0x31a4('0x9')]=function(_0x50aee4,_0x3686b9){return _0x50aee4[_0x31a4('0xa')](_0x31a4('0xb'),attributes,{'tableName':_0x31a4('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x31a4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x02b4=['uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x294985,_0x4171d8){var _0x14494b=function(_0x8cc2a5){while(--_0x8cc2a5){_0x294985['push'](_0x294985['shift']());}};_0x14494b(++_0x4171d8);}(_0x02b4,0x91));var _0x402b=function(_0x317f80,_0x2ec2b3){_0x317f80=_0x317f80-0x0;var _0x13b391=_0x02b4[_0x317f80];return _0x13b391;};'use strict';var _=require('lodash');var util=require(_0x402b('0x0'));var logger=require('../../config/logger')(_0x402b('0x1'));var moment=require(_0x402b('0x2'));var BPromise=require(_0x402b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x402b('0x4'));var rimraf=require(_0x402b('0x5'));var config=require(_0x402b('0x6'));var attributes=require(_0x402b('0x7'));module[_0x402b('0x8')]=function(_0x5f3946,_0x3b1153){return _0x5f3946[_0x402b('0x9')](_0x402b('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x402b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 924e28a..8579d47 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 _0xb8e5=['error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb8e5,0xad));var _0x5b8e=function(_0x46e4fb,_0x254323){_0x46e4fb=_0x46e4fb-0x0;var _0x3efa69=_0xb8e5[_0x46e4fb];return _0x3efa69;};'use strict';var _=require(_0x5b8e('0x0'));var util=require(_0x5b8e('0x1'));var moment=require('moment');var BPromise=require(_0x5b8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b8e('0x3'));var db=require(_0x5b8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b8e('0x5'))('rpc');var config=require(_0x5b8e('0x6'));var jayson=require(_0x5b8e('0x7'));var client=jayson[_0x5b8e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524264,_0x5cb3f4,_0x906a18){return new BPromise(function(_0x569eb0,_0x120522){return client[_0x5b8e('0x9')](_0x524264,_0x906a18)[_0x5b8e('0xa')](function(_0x432eec){logger[_0x5b8e('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5cb3f4,_0x5b8e('0xc'));logger[_0x5b8e('0xd')](_0x5b8e('0xe'),_0x5cb3f4,'request\x20sent',JSON[_0x5b8e('0xf')](_0x432eec));if(_0x432eec[_0x5b8e('0x10')]){if(_0x432eec[_0x5b8e('0x10')][_0x5b8e('0x11')]===0x1f4){logger[_0x5b8e('0x10')](_0x5b8e('0x12'),_0x5cb3f4,_0x432eec[_0x5b8e('0x10')][_0x5b8e('0x13')]);return _0x120522(_0x432eec['error'][_0x5b8e('0x13')]);}logger['error'](_0x5b8e('0x12'),_0x5cb3f4,_0x432eec['error'][_0x5b8e('0x13')]);return _0x569eb0(_0x432eec[_0x5b8e('0x10')]['message']);}else{logger[_0x5b8e('0xb')](_0x5b8e('0x12'),_0x5cb3f4,'request\x20sent');_0x569eb0(_0x432eec[_0x5b8e('0x14')]['message']);}})['catch'](function(_0x3c1eb0){logger[_0x5b8e('0x10')](_0x5b8e('0x12'),_0x5cb3f4,_0x3c1eb0);_0x120522(_0x3c1eb0);});});} \ No newline at end of file +var _0x78bc=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird'];(function(_0x539840,_0x55c212){var _0x245439=function(_0x1bc4da){while(--_0x1bc4da){_0x539840['push'](_0x539840['shift']());}};_0x245439(++_0x55c212);}(_0x78bc,0xee));var _0xc78b=function(_0x79ea1e,_0x21c274){_0x79ea1e=_0x79ea1e-0x0;var _0x1845e5=_0x78bc[_0x79ea1e];return _0x1845e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc78b('0x0'));var BPromise=require(_0xc78b('0x1'));var rs=require(_0xc78b('0x2'));var fs=require('fs');var Redis=require(_0xc78b('0x3'));var db=require(_0xc78b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc78b('0x5'))(_0xc78b('0x6'));var config=require(_0xc78b('0x7'));var jayson=require(_0xc78b('0x8'));var client=jayson[_0xc78b('0x9')][_0xc78b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256da8,_0x900c46,_0x8d1c04){return new BPromise(function(_0x9b9d62,_0x48ed46){return client[_0xc78b('0xb')](_0x256da8,_0x8d1c04)[_0xc78b('0xc')](function(_0x43967e){logger[_0xc78b('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0xc78b('0xe'));logger[_0xc78b('0xf')](_0xc78b('0x10'),_0x900c46,_0xc78b('0xe'),JSON[_0xc78b('0x11')](_0x43967e));if(_0x43967e[_0xc78b('0x12')]){if(_0x43967e['error'][_0xc78b('0x13')]===0x1f4){logger[_0xc78b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);return _0x48ed46(_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);}logger[_0xc78b('0x12')](_0xc78b('0x15'),_0x900c46,_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);return _0x9b9d62(_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);}else{logger[_0xc78b('0xd')](_0xc78b('0x15'),_0x900c46,_0xc78b('0xe'));_0x9b9d62(_0x43967e[_0xc78b('0x16')]['message']);}})[_0xc78b('0x17')](function(_0x474608){logger[_0xc78b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0x474608);_0x48ed46(_0x474608);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index f47c5a8..ea3eac2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc978=['log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','None'];(function(_0x531922,_0x255409){var _0x287a8c=function(_0x259252){while(--_0x259252){_0x531922['push'](_0x531922['shift']());}};_0x287a8c(++_0x255409);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var db=require(_0x8c97('0x1'))['db'];var seedDb=require(_0x8c97('0x2'));var checkLicense=require(_0x8c97('0x3'));var rpc=require(_0x8c97('0x4'));var config=require(_0x8c97('0x5'));var logger=require('./config/logger')(_0x8c97('0x6'));var pm2=require(_0x8c97('0x7'));var pm2Config=require(_0x8c97('0x8'));var schedule=require(_0x8c97('0x9'));var chat=require(_0x8c97('0xa'));var whatsapp=require(_0x8c97('0xb'));var transcribe=require(_0x8c97('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x8c97('0xd')][_0x8c97('0xe')]()[_0x8c97('0xf')](function(){if(config[_0x8c97('0x10')]){return seedDb[_0x8c97('0x11')]();}})[_0x8c97('0xf')](function(){return checkLicense[_0x8c97('0x11')]();})['then'](function(){return rpc[_0x8c97('0x12')]();})[_0x8c97('0xf')](function(_0x1befaf){logger[_0x8c97('0x13')](_0x1befaf);return chat[_0x8c97('0x14')]();})[_0x8c97('0xf')](function(){return whatsapp[_0x8c97('0x14')]();})[_0x8c97('0xf')](function(){return schedule[_0x8c97('0x14')]();})['then'](function(){return transcribe[_0x8c97('0x14')]();})[_0x8c97('0xf')](function(){return provider['start']();})[_0x8c97('0xf')](function(_0x34be9b){logger['info'](_0x34be9b);return pm2[_0x8c97('0x14')](pm2Config);})['then'](function(_0x565a82){var _0x57902c=_0x565a82[_0x8c97('0x15')](function(_0xab3812){return typeof _0xab3812[_0x8c97('0x16')]===_0x8c97('0x17')&&_0xab3812[_0x8c97('0x16')]>=0x0;});if(_0x57902c[_0x8c97('0x18')]>0x0){throw new Error(_0x57902c[_0x8c97('0x18')]+_0x8c97('0x19')+_[_0x8c97('0x1a')](_0x57902c,function(_0x5edbc6){return'\x22'+_0x5edbc6[_0x8c97('0x1b')][_0x8c97('0x1c')]+'\x22';}));}logger[_0x8c97('0x13')](_0x8c97('0x1d'),_[_0x8c97('0x1a')](_[_0x8c97('0x15')](_0x565a82,{'status':_0x8c97('0x1e')}),_0x8c97('0x1c'))[_0x8c97('0x1f')]());logger[_0x8c97('0x13')](_0x8c97('0x20'),_[_0x8c97('0x1a')](_[_0x8c97('0x15')](_0x565a82,function(_0x16e3c4){return _0x16e3c4[_0x8c97('0x21')]!==_0x8c97('0x1e');}),'name')[_0x8c97('0x1f')]()||_0x8c97('0x22'));console[_0x8c97('0x23')]('App\x20Ready!');})['catch'](function(_0xe5268d){console['log'](_0x8c97('0x24'),_0xe5268d);logger[_0x8c97('0x25')](_0x8c97('0x26'),_0xe5268d);process[_0x8c97('0x27')](0x1);});}main(); \ No newline at end of file +var _0x5294=['map','pm2_env','name','Online\x20apps:','filter','join','Offline\x20apps:','status','online','None','log','catch','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0x2e11ab,_0x4e146e){var _0x1dd724=function(_0x4c6abb){while(--_0x4c6abb){_0x2e11ab['push'](_0x2e11ab['shift']());}};_0x1dd724(++_0x4e146e);}(_0x5294,0x111));var _0x4529=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x5294[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x4529('0x0'));var db=require(_0x4529('0x1'))['db'];var seedDb=require(_0x4529('0x2'));var checkLicense=require(_0x4529('0x3'));var rpc=require(_0x4529('0x4'));var config=require(_0x4529('0x5'));var logger=require('./config/logger')(_0x4529('0x6'));var pm2=require(_0x4529('0x7'));var pm2Config=require(_0x4529('0x8'));var schedule=require('./config/schedule');var chat=require(_0x4529('0x9'));var whatsapp=require(_0x4529('0xa'));var transcribe=require(_0x4529('0xb'));var provider=require(_0x4529('0xc'));function main(){return db['sequelize'][_0x4529('0xd')]()[_0x4529('0xe')](function(){if(config[_0x4529('0xf')]){return seedDb['default']();}})['then'](function(){return checkLicense['default']();})[_0x4529('0xe')](function(){return rpc[_0x4529('0x10')]();})[_0x4529('0xe')](function(_0x579574){logger[_0x4529('0x11')](_0x579574);return chat[_0x4529('0x12')]();})[_0x4529('0xe')](function(){return whatsapp[_0x4529('0x12')]();})[_0x4529('0xe')](function(){return schedule[_0x4529('0x12')]();})['then'](function(){return transcribe['start']();})[_0x4529('0xe')](function(){return provider[_0x4529('0x12')]();})['then'](function(_0x2539ea){logger['info'](_0x2539ea);return pm2[_0x4529('0x12')](pm2Config);})[_0x4529('0xe')](function(_0x19dff1){var _0x3313e0=_0x19dff1['filter'](function(_0x3fa1a0){return typeof _0x3fa1a0[_0x4529('0x13')]===_0x4529('0x14')&&_0x3fa1a0['exitCode']>=0x0;});if(_0x3313e0[_0x4529('0x15')]>0x0){throw new Error(_0x3313e0[_0x4529('0x15')]+_0x4529('0x16')+_[_0x4529('0x17')](_0x3313e0,function(_0x4e17dd){return'\x22'+_0x4e17dd[_0x4529('0x18')][_0x4529('0x19')]+'\x22';}));}logger['info'](_0x4529('0x1a'),_[_0x4529('0x17')](_[_0x4529('0x1b')](_0x19dff1,{'status':'online'}),'name')[_0x4529('0x1c')]());logger[_0x4529('0x11')](_0x4529('0x1d'),_[_0x4529('0x17')](_[_0x4529('0x1b')](_0x19dff1,function(_0x5c7e39){return _0x5c7e39[_0x4529('0x1e')]!==_0x4529('0x1f');}),_0x4529('0x19'))[_0x4529('0x1c')]()||_0x4529('0x20'));console[_0x4529('0x21')]('App\x20Ready!');})[_0x4529('0x22')](function(_0xee9870){console[_0x4529('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0xee9870);logger[_0x4529('0x23')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xee9870);process[_0x4529('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index b421860..e3a3fc3 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0x22629d,_0x52081e){var _0x518a87=function(_0x3be34d){while(--_0x3be34d){_0x22629d['push'](_0x22629d['shift']());}};_0x518a87(++_0x52081e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x4b84[_0x4521e3];return _0x46a272;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file +var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x56e2f4,_0x1b6fd1){var _0x12d567=function(_0x1195c4){while(--_0x1195c4){_0x56e2f4['push'](_0x56e2f4['shift']());}};_0x12d567(++_0x1b6fd1);}(_0xa41a,0x6b));var _0xaa41=function(_0x120a9d,_0x3352f4){_0x120a9d=_0x120a9d-0x0;var _0x5b6951=_0xa41a[_0x120a9d];return _0x5b6951;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 0461b89..c9c8826 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 _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x488643,_0x1b4d74){var _0x1c3fb4=function(_0x2444f2){while(--_0x2444f2){_0x488643['push'](_0x488643['shift']());}};_0x1c3fb4(++_0x1b4d74);}(_0xb10b,0x12a));var _0xbb10=function(_0x283cf6,_0x14e096){_0x283cf6=_0x283cf6-0x0;var _0x4b40e5=_0xb10b[_0x283cf6];return _0x4b40e5;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file +var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x55485f,_0x5a6bf5){var _0x220ee1=function(_0x345b08){while(--_0x345b08){_0x55485f['push'](_0x55485f['shift']());}};_0x220ee1(++_0x5a6bf5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x614ef4,_0x28a060){_0x614ef4=_0x614ef4-0x0;var _0x35e8e2=_0x0b0e[_0x614ef4];return _0x35e8e2;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 924fc48..62af393 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 _0xceb0=['c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','fieldType','datetime','DATE','buildExpression','default','text','value','start','end','Tag','map','tags','clause','and','ids','user','skip','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','role','agent','c.ListId\x20IS\x20NULL','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','subqry','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','toString','Tags','clone','COUNT(*)','t.id\x20IN\x20?','query','exports','../interaction/utils','search','ListId','autocomplete','select','from','where','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','email','createdAt','updatedAt','deletedAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xceb0,0x173));var _0x0ceb=function(_0x3f8522,_0x10fcc2){_0x3f8522=_0x3f8522-0x0;var _0x145039=_0xceb0[_0x3f8522];return _0x145039;};'use strict';var _=require('lodash');var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var utils=require(_0x0ceb('0x0'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x1659e3,_0x1925ab){var _0x2e72bb=![];if(_0x1659e3['role']==='agent'&&!_0x1925ab[_0x0ceb('0x1')]&&!_0x1925ab[_0x0ceb('0x2')]&&_0x1925ab[_0x0ceb('0x3')]!=='true'){_0x2e72bb=!![];}return _0x2e72bb;}function getContactsSubquery(){return squel[_0x0ceb('0x4')]()[_0x0ceb('0x5')]('cm_contacts','c')[_0x0ceb('0x6')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x3a1205,_0x3e71f4){var _0x376790=_0x3e71f4?'c':'subqry';_0x3a1205['left_join'](_0x0ceb('0x7'),'uc',_0x0ceb('0x8')+_0x376790+_0x0ceb('0x9'))[_0x0ceb('0xa')](_0x0ceb('0xb'),'ct',_0x0ceb('0xc')+_0x376790+'.id')[_0x0ceb('0xa')](_0x0ceb('0xd'),'t',_0x0ceb('0xe'));return _0x3a1205;}function addFieldsToQuery(_0x26cb7a,_0x41f120,_0xb2a488,_0x1528f0,_0x54f34e){var _0x416fbb=_0x54f34e?'c':'subqry';if(!_0x41f120){_0x41f120=['id','firstName',_0x0ceb('0xf'),_0x0ceb('0x10'),_0x0ceb('0x11'),'fax',_0x0ceb('0x12'),_0x0ceb('0x2'),'CompanyId',_0x0ceb('0x13'),_0x0ceb('0x14'),_0x0ceb('0x15'),_0x0ceb('0x16')];}var _0x18bed1=_0xb2a488&&_0x54f34e||!_0xb2a488&&!_0x54f34e;if(_0x1528f0){_0x18bed1=_0x1528f0&&_0x54f34e||!_0x1528f0&&!_0x54f34e;}_0x41f120[_0x0ceb('0x17')](function(_0x2c5a89){if(_0x2c5a89===_0x0ceb('0x16')){if(_0x18bed1){_0x26cb7a[_0x0ceb('0x18')](_0x0ceb('0x19'),_0x2c5a89);}else if(_0xb2a488||_0x1528f0){_0x26cb7a[_0x0ceb('0x18')](_0x416fbb+'.'+_0x2c5a89);}}else{_0x26cb7a[_0x0ceb('0x18')](_0x416fbb+'.'+_0x2c5a89);}});return _0x26cb7a;}function getSqlClauses(){var _0x10113a={'default':squel[_0x0ceb('0x1a')](),'fields':squel[_0x0ceb('0x1a')](),'filter':squel[_0x0ceb('0x1a')](),'tags':{'clause':squel[_0x0ceb('0x1a')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x10113a;}function parseTagParameter(_0x4eb712){var _0x25c48a=squel[_0x0ceb('0x1a')]();if(_0x4eb712){var _0x5d1235=utils[_0x0ceb('0x1b')](_0x4eb712);_0x5d1235['forEach'](function(_0x38a716){_0x25c48a['or'](_0x0ceb('0x1c'),'%,'+_0x38a716+',%');});}return _0x25c48a;}function parseSearchFilter(_0x28fb61){var _0x17efd7=squel[_0x0ceb('0x1a')]();if(_0x28fb61){var _0x4a2b69=_0x28fb61['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4a2b69[_0x0ceb('0x1d')]('\x20')['length']>0x1){_0x17efd7['or'](_0x0ceb('0x1e'),qs['getFullTextValue'](_0x4a2b69),null);}else{if(qs[_0x0ceb('0x1f')](_0x4a2b69)){_0x17efd7['or'](_0x0ceb('0x20'),_0x4a2b69+'%');_0x17efd7['or'](_0x0ceb('0x21'),_0x4a2b69+'%');_0x17efd7['or'](_0x0ceb('0x22'),_0x4a2b69+'%');_0x17efd7['or']('c.fax\x20LIKE\x20?',_0x4a2b69+'%');}else if(qs[_0x0ceb('0x23')](_0x4a2b69)){_0x17efd7['or'](_0x0ceb('0x24'),_0x4a2b69+'%');}else{_0x17efd7['or'](_0x0ceb('0x25'),'%'+_0x4a2b69+'%');_0x17efd7['or'](_0x0ceb('0x26'),'%'+_0x4a2b69+'%');_0x17efd7['or'](_0x0ceb('0x24'),'%'+_0x4a2b69+'%');}}}return _0x17efd7;}function parseAdvancedSearchFilter(_0x4aa831,_0x2de4f3){var _0x3792bb=getSqlClauses();var _0x3c934b=as[_0x0ceb('0x27')](_0x4aa831);var _0x1ca4cb=_0x3c934b[_0x0ceb('0x28')];for(var _0x58aa8b=0x0;_0x58aa8b<_0x3c934b[_0x0ceb('0x29')][_0x0ceb('0x2a')];_0x58aa8b++){var _0x1b5337=_0x3c934b[_0x0ceb('0x29')][_0x58aa8b];var _0x331e98='c';var _0x128102=_[_0x0ceb('0x2b')](_0x2de4f3,[_0x0ceb('0x2c'),_0x1b5337[_0x0ceb('0x18')]]);if(_0x128102){if(_0x1b5337[_0x0ceb('0x18')]==='dateOfBirth'||_0x128102[_0x0ceb('0x2d')]===_0x0ceb('0x2e')){_0x1b5337['castTo']=_0x0ceb('0x2f');}var _0x19980c=as[_0x0ceb('0x30')](_0x331e98,_0x128102['type'],_0x1b5337);_0x3792bb[_0x0ceb('0x31')][_0x1ca4cb](_0x19980c[_0x0ceb('0x32')],_0x19980c[_0x0ceb('0x33')][_0x0ceb('0x34')],_0x19980c[_0x0ceb('0x33')][_0x0ceb('0x35')]);}else{if(_0x1b5337[_0x0ceb('0x18')]===_0x0ceb('0x36')){var _0x2ad461=_0x1b5337[_0x0ceb('0x33')][_0x0ceb('0x1d')](',')[_0x0ceb('0x37')](function(_0x40b21e){return Number(_0x40b21e);});var _0x540851=parseTagParameter(_0x2ad461);_0x3792bb[_0x0ceb('0x38')][_0x0ceb('0x39')][_0x0ceb('0x3a')](_0x540851);_0x3792bb[_0x0ceb('0x38')][_0x0ceb('0x3b')]=_0x2ad461;}else if(_0x1b5337[_0x0ceb('0x18')]==='User'){_0x3792bb[_0x0ceb('0x3c')]['clause']['and']('uc.UserId\x20=\x20?',_0x1b5337[_0x0ceb('0x33')]);_0x3792bb['user'][_0x0ceb('0x3d')]=!![];}}}return _0x3792bb;}function parseModelFields(_0x2f5e8a,_0x513dc7){var _0x3f730b=squel[_0x0ceb('0x1a')]();var _0x1e3361=_(_0x2f5e8a)['keys']()[_0x0ceb('0x37')](function(_0x2dda09){return _[_0x0ceb('0x3e')](_0x513dc7,[_0x0ceb('0x2c'),_0x2dda09])?_0x2dda09:undefined;})[_0x0ceb('0x3f')]()[_0x0ceb('0x33')]();if(_0x2f5e8a[_0x0ceb('0x40')]){_0x1e3361[_0x0ceb('0x41')](_0x0ceb('0x40'));}if(_0x1e3361[_0x0ceb('0x2a')]>0x0){_0x1e3361[_0x0ceb('0x17')](function(_0x1ff7db){if(_0x1ff7db===_0x0ceb('0x2')){_0x3f730b[_0x0ceb('0x3a')](_0x0ceb('0x42'),[][_0x0ceb('0x43')](_0x2f5e8a[_0x1ff7db]));}else if(_0x1ff7db===_0x0ceb('0x40')){var _0x3de5c7='%'+_0x2f5e8a[_0x1ff7db]+'%';_0x3f730b[_0x0ceb('0x3a')](_0x0ceb('0x44'),_0x3de5c7);}else{_0x3f730b[_0x0ceb('0x3a')]('c.'+_0x1ff7db+_0x0ceb('0x45'),_0x2f5e8a[_0x1ff7db]);}});}return _0x3f730b;}function parseQueryParameters(_0x183720,_0x2a415b){var _0xe65a48=getSqlClauses();return Promise[_0x0ceb('0x46')]()[_0x0ceb('0x47')](function(){return parseModelFields(_0x183720,_0x2a415b);})[_0x0ceb('0x47')](function(_0x568a1c){_0xe65a48[_0x0ceb('0x48')]['and'](_0x568a1c);return parseTagParameter(_0x183720['tag']);})[_0x0ceb('0x47')](function(_0x6ad0e3){_0xe65a48[_0x0ceb('0x38')]['clause']['and'](_0x6ad0e3);return parseSearchFilter(_0x183720[_0x0ceb('0x49')]);})[_0x0ceb('0x47')](function(_0x2cb999){_0xe65a48[_0x0ceb('0x49')]=_0x2cb999;return _0xe65a48;});}function checkListsRestrictions(_0x207908,_0x321ab0,_0x22053c){var _0x177ec7=squel[_0x0ceb('0x1a')]();return Promise['resolve']()[_0x0ceb('0x47')](function(){if(_0x321ab0[_0x0ceb('0x1')]&&_0x207908[_0x0ceb('0x4a')]===_0x0ceb('0x4b')&&!_0x22053c){return _0x207908['getLists']({'attributes':['id'],'raw':!![]});}})[_0x0ceb('0x47')](function(_0x5b4ea8){if(_0x5b4ea8){if(_0x5b4ea8[_0x0ceb('0x2a')]===0x0){_0x177ec7['and'](_0x0ceb('0x4c'));}else{_0x177ec7[_0x0ceb('0x3a')](_0x0ceb('0x42'),_[_0x0ceb('0x37')](_0x5b4ea8,'id'));}}})[_0x0ceb('0x47')](function(){return _0x177ec7;});}function buildContactsQuery(_0x2c03af,_0x6273bb,_0x32bfe3,_0x4e100e,_0x197d4b,_0x31dbd4){if(_0x6273bb){_0x6273bb=_0x32bfe3['attributes'];}_0x2c03af=addFieldsToQuery(_0x2c03af,_0x6273bb,_0x4e100e,_0x31dbd4,!![]);var _0x3898fe=squel[_0x0ceb('0x4')]();_0x3898fe=addFieldsToQuery(_0x3898fe,_0x6273bb,_0x4e100e,_0x31dbd4,![]);if(_0x4e100e||_0x31dbd4){_0x2c03af=applyJoinClauses(_0x2c03af,!![]);_0x2c03af[_0x0ceb('0x4d')](_0x0ceb('0x4e'));if(_0x32bfe3[_0x0ceb('0x4f')]){_0x3898fe['limit'](_0x32bfe3[_0x0ceb('0x4f')]);}if(_0x32bfe3[_0x0ceb('0x50')]){_0x3898fe[_0x0ceb('0x50')](_0x32bfe3[_0x0ceb('0x50')]);}}else{_0x3898fe=applyJoinClauses(_0x3898fe,![]);_0x3898fe[_0x0ceb('0x4d')](_0x0ceb('0x51'));if(_0x32bfe3[_0x0ceb('0x4f')]){_0x2c03af[_0x0ceb('0x4f')](_0x32bfe3[_0x0ceb('0x4f')]);}if(_0x32bfe3['offset']){_0x2c03af[_0x0ceb('0x50')](_0x32bfe3[_0x0ceb('0x50')]);}}_0x3898fe[_0x0ceb('0x52')](_0x197d4b);if(_0x32bfe3[_0x0ceb('0x53')]){_0x32bfe3['order']['forEach'](function(_0x34a427){_0x2c03af[_0x0ceb('0x53')]('c.'+_0x34a427[0x0],_0x34a427[0x1]===_0x0ceb('0x54')?![]:!![]);_0x3898fe[_0x0ceb('0x53')](_0x0ceb('0x55')+_0x34a427[0x0],_0x34a427[0x1]==='DESC'?![]:!![]);});}_0x3898fe[_0x0ceb('0x5')](_0x2c03af,_0x0ceb('0x56'));return _0x3898fe;}function getFilteredContacts(_0x4c420c){var _0x4c70ab=[];return db['Tag'][_0x0ceb('0x57')]({'attributes':['id',_0x0ceb('0x2c'),_0x0ceb('0x58')],'raw':!![]})['then'](function(_0x3d9583){_0x4c70ab=_[_0x0ceb('0x59')](_0x3d9583,'id');var _0x5c8ace={'type':db[_0x0ceb('0x5a')][_0x0ceb('0x5b')][_0x0ceb('0x5c')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x0ceb('0x5d')]['query'](_0x4c420c[_0x0ceb('0x5e')](),_0x5c8ace);})[_0x0ceb('0x47')](function(_0x400db8){_0x400db8[_0x0ceb('0x17')](function(_0x270ebf){if(_0x270ebf['TagIds']){_0x270ebf[_0x0ceb('0x5f')]=[];_0x270ebf[_0x0ceb('0x16')][_0x0ceb('0x1d')](',')[_0x0ceb('0x17')](function(_0xf27696){_0x270ebf[_0x0ceb('0x5f')][_0x0ceb('0x41')](_0x4c70ab[_0xf27696]);});}delete _0x270ebf[_0x0ceb('0x16')];});return _0x400db8;});}function countFilteredContacts(_0x1de0d4,_0x361581){var _0x5a8e86=_0x1de0d4[_0x0ceb('0x60')]();_0x5a8e86[_0x0ceb('0x18')](_0x0ceb('0x61'));_0x5a8e86=applyJoinClauses(_0x5a8e86,!![]);_0x1de0d4[_0x0ceb('0x4d')](_0x0ceb('0x4e'));var _0xd17418=utils[_0x0ceb('0x1b')](_0x361581);if(!_['isEmpty'](_0xd17418)){_0x5a8e86[_0x0ceb('0x6')](_0x0ceb('0x62'),_0xd17418);}var _0x3dd2d5={'type':db[_0x0ceb('0x5a')][_0x0ceb('0x5b')][_0x0ceb('0x5c')],'raw':!![]};return db[_0x0ceb('0x5d')][_0x0ceb('0x63')](_0x5a8e86[_0x0ceb('0x5e')](),_0x3dd2d5)[_0x0ceb('0x47')](function(_0x42a084){return _0x42a084[0x0]['COUNT(*)'];});}module[_0x0ceb('0x64')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xa588=['QueryTypes','SELECT','CmContact','query','Tags','push','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','toString','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','CompanyId','deletedAt','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','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.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','default','text','value','end','Tag','tags','ids','User','user','and','uc.UserId\x20=\x20?','keys','map','some','Contact','forEach','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','fields','clause','filter','then','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','subqry.','DESC','findAll','color','keyBy'];(function(_0x54fda0,_0x15a3a7){var _0x1367da=function(_0x56e6d0){while(--_0x56e6d0){_0x54fda0['push'](_0x54fda0['shift']());}};_0x1367da(++_0x15a3a7);}(_0xa588,0xe1));var _0x8a58=function(_0x2ffad6,_0x137196){_0x2ffad6=_0x2ffad6-0x0;var _0x31cfaa=_0xa588[_0x2ffad6];return _0x31cfaa;};'use strict';var _=require('lodash');var squel=require(_0x8a58('0x0'));var as=require(_0x8a58('0x1'));var qs=require(_0x8a58('0x2'));var utils=require(_0x8a58('0x3'));var db=require(_0x8a58('0x4'))['db'];function skipContactsQuery(_0x2f8787,_0x40bfe3){var _0x88d792=![];if(_0x2f8787[_0x8a58('0x5')]==='agent'&&!_0x40bfe3[_0x8a58('0x6')]&&!_0x40bfe3[_0x8a58('0x7')]&&_0x40bfe3[_0x8a58('0x8')]!==_0x8a58('0x9')){_0x88d792=!![];}return _0x88d792;}function getContactsSubquery(){return squel[_0x8a58('0xa')]()[_0x8a58('0xb')](_0x8a58('0xc'),'c')[_0x8a58('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x336276,_0x39a20e){var _0x3e3cf0=_0x39a20e?'c':_0x8a58('0xe');_0x336276[_0x8a58('0xf')]('cm_user_has_contacts','uc',_0x8a58('0x10')+_0x3e3cf0+_0x8a58('0x11'))[_0x8a58('0xf')](_0x8a58('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x3e3cf0+'.id')[_0x8a58('0xf')]('tools_tags','t',_0x8a58('0x13'));return _0x336276;}function addFieldsToQuery(_0xc5d2fa,_0x4af5a9,_0xf98b8d,_0x15b0d2,_0x56a61d){var _0x3d40a5=_0x56a61d?'c':_0x8a58('0xe');if(!_0x4af5a9){_0x4af5a9=['id','firstName',_0x8a58('0x14'),_0x8a58('0x15'),_0x8a58('0x16'),_0x8a58('0x17'),_0x8a58('0x18'),_0x8a58('0x7'),_0x8a58('0x19'),'createdAt','updatedAt',_0x8a58('0x1a'),_0x8a58('0x1b')];}var _0x18a14d=_0xf98b8d&&_0x56a61d||!_0xf98b8d&&!_0x56a61d;if(_0x15b0d2){_0x18a14d=_0x15b0d2&&_0x56a61d||!_0x15b0d2&&!_0x56a61d;}_0x4af5a9['forEach'](function(_0x282f2d){if(_0x282f2d===_0x8a58('0x1b')){if(_0x18a14d){_0xc5d2fa['field'](_0x8a58('0x1c'),_0x282f2d);}else if(_0xf98b8d||_0x15b0d2){_0xc5d2fa[_0x8a58('0x1d')](_0x3d40a5+'.'+_0x282f2d);}}else{_0xc5d2fa[_0x8a58('0x1d')](_0x3d40a5+'.'+_0x282f2d);}});return _0xc5d2fa;}function getSqlClauses(){var _0x4038f8={'default':squel[_0x8a58('0x1e')](),'fields':squel[_0x8a58('0x1e')](),'filter':squel[_0x8a58('0x1e')](),'tags':{'clause':squel[_0x8a58('0x1e')](),'ids':null},'user':{'clause':squel[_0x8a58('0x1e')](),'skip':![]}};return _0x4038f8;}function parseTagParameter(_0xbf556a){var _0xb20cfe=squel[_0x8a58('0x1e')]();if(_0xbf556a){var _0x3758fa=utils[_0x8a58('0x1f')](_0xbf556a);_0x3758fa['forEach'](function(_0x2fdf20){_0xb20cfe['or'](_0x8a58('0x20'),'%,'+_0x2fdf20+',%');});}return _0xb20cfe;}function parseSearchFilter(_0x20a6c5){var _0x3f07ab=squel[_0x8a58('0x1e')]();if(_0x20a6c5){var _0x415946=_0x20a6c5[_0x8a58('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x415946[_0x8a58('0x22')]('\x20')[_0x8a58('0x23')]>0x1){_0x3f07ab['or'](_0x8a58('0x24'),qs[_0x8a58('0x25')](_0x415946),null);}else{if(qs['isNumeric'](_0x415946)){_0x3f07ab['or'](_0x8a58('0x26'),_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x27'),_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x28'),_0x415946+'%');_0x3f07ab['or']('c.fax\x20LIKE\x20?',_0x415946+'%');}else if(qs[_0x8a58('0x29')](_0x415946)){_0x3f07ab['or'](_0x8a58('0x2a'),_0x415946+'%');}else{_0x3f07ab['or'](_0x8a58('0x2b'),'%'+_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x2c'),'%'+_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x2a'),'%'+_0x415946+'%');}}}return _0x3f07ab;}function parseAdvancedSearchFilter(_0x3e317f,_0x1a411a){var _0x4d5041=getSqlClauses();var _0x433060=as['parseSearch'](_0x3e317f);var _0x501aa1=_0x433060['sqlOperator'];for(var _0x4cfc96=0x0;_0x4cfc96<_0x433060['conditions'][_0x8a58('0x23')];_0x4cfc96++){var _0x175235=_0x433060[_0x8a58('0x2d')][_0x4cfc96];var _0x205b41='c';var _0x5dc010=_[_0x8a58('0x2e')](_0x1a411a,[_0x8a58('0x2f'),_0x175235[_0x8a58('0x1d')]]);if(_0x5dc010){if(_0x175235[_0x8a58('0x1d')]===_0x8a58('0x30')||_0x5dc010[_0x8a58('0x31')]===_0x8a58('0x32')){_0x175235[_0x8a58('0x33')]='DATE';}var _0x330e8a=as[_0x8a58('0x34')](_0x205b41,_0x5dc010[_0x8a58('0x35')],_0x175235);_0x4d5041[_0x8a58('0x36')][_0x501aa1](_0x330e8a[_0x8a58('0x37')],_0x330e8a[_0x8a58('0x38')]['start'],_0x330e8a[_0x8a58('0x38')][_0x8a58('0x39')]);}else{if(_0x175235[_0x8a58('0x1d')]===_0x8a58('0x3a')){var _0x21a9dd=_0x175235[_0x8a58('0x38')][_0x8a58('0x22')](',')['map'](function(_0x3d1fb0){return Number(_0x3d1fb0);});var _0x1692ef=parseTagParameter(_0x21a9dd);_0x4d5041[_0x8a58('0x3b')]['clause']['and'](_0x1692ef);_0x4d5041['tags'][_0x8a58('0x3c')]=_0x21a9dd;}else if(_0x175235[_0x8a58('0x1d')]===_0x8a58('0x3d')){_0x4d5041[_0x8a58('0x3e')]['clause'][_0x8a58('0x3f')](_0x8a58('0x40'),_0x175235[_0x8a58('0x38')]);_0x4d5041[_0x8a58('0x3e')]['skip']=!![];}}}return _0x4d5041;}function parseModelFields(_0x31463f,_0x2a7c70){var _0x5aad83=squel[_0x8a58('0x1e')]();var _0x196fee=_(_0x31463f)[_0x8a58('0x41')]()[_0x8a58('0x42')](function(_0x3ead70){return _[_0x8a58('0x43')](_0x2a7c70,['name',_0x3ead70])?_0x3ead70:undefined;})['compact']()[_0x8a58('0x38')]();if(_0x31463f[_0x8a58('0x44')]){_0x196fee['push'](_0x8a58('0x44'));}if(_0x196fee[_0x8a58('0x23')]>0x0){_0x196fee[_0x8a58('0x45')](function(_0x3dfd34){if(_0x3dfd34===_0x8a58('0x7')){_0x5aad83['and'](_0x8a58('0x46'),[]['concat'](_0x31463f[_0x3dfd34]));}else if(_0x3dfd34===_0x8a58('0x44')){var _0x1ef283='%'+_0x31463f[_0x3dfd34]+'%';_0x5aad83[_0x8a58('0x3f')](_0x8a58('0x47'),_0x1ef283);}else{_0x5aad83[_0x8a58('0x3f')]('c.'+_0x3dfd34+_0x8a58('0x48'),_0x31463f[_0x3dfd34]);}});}return _0x5aad83;}function parseQueryParameters(_0x126a4e,_0x4b2e04){var _0x5cd9d8=getSqlClauses();return Promise[_0x8a58('0x49')]()['then'](function(){return parseModelFields(_0x126a4e,_0x4b2e04);})['then'](function(_0xb9a9ba){_0x5cd9d8[_0x8a58('0x4a')][_0x8a58('0x3f')](_0xb9a9ba);return parseTagParameter(_0x126a4e['tag']);})['then'](function(_0x38357e){_0x5cd9d8['tags'][_0x8a58('0x4b')][_0x8a58('0x3f')](_0x38357e);return parseSearchFilter(_0x126a4e[_0x8a58('0x4c')]);})[_0x8a58('0x4d')](function(_0x4c9c56){_0x5cd9d8[_0x8a58('0x4c')]=_0x4c9c56;return _0x5cd9d8;});}function checkListsRestrictions(_0x42c89e,_0x4cd092,_0x39af37){var _0xba52de=squel[_0x8a58('0x1e')]();return Promise[_0x8a58('0x49')]()['then'](function(){if(_0x4cd092[_0x8a58('0x6')]&&_0x42c89e['role']===_0x8a58('0x4e')&&!_0x39af37){return _0x42c89e[_0x8a58('0x4f')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x218634){if(_0x218634){if(_0x218634['length']===0x0){_0xba52de['and'](_0x8a58('0x50'));}else{_0xba52de[_0x8a58('0x3f')](_0x8a58('0x46'),_[_0x8a58('0x42')](_0x218634,'id'));}}})[_0x8a58('0x4d')](function(){return _0xba52de;});}function buildContactsQuery(_0x44c8df,_0x507423,_0x4bfd66,_0x424207,_0x54e9db,_0x29c5f7){if(_0x507423){_0x507423=_0x4bfd66[_0x8a58('0x51')];}_0x44c8df=addFieldsToQuery(_0x44c8df,_0x507423,_0x424207,_0x29c5f7,!![]);var _0x1ec51b=squel[_0x8a58('0xa')]();_0x1ec51b=addFieldsToQuery(_0x1ec51b,_0x507423,_0x424207,_0x29c5f7,![]);if(_0x424207||_0x29c5f7){_0x44c8df=applyJoinClauses(_0x44c8df,!![]);_0x44c8df[_0x8a58('0x52')](_0x8a58('0x53'));if(_0x4bfd66[_0x8a58('0x54')]){_0x1ec51b[_0x8a58('0x54')](_0x4bfd66[_0x8a58('0x54')]);}if(_0x4bfd66[_0x8a58('0x55')]){_0x1ec51b[_0x8a58('0x55')](_0x4bfd66[_0x8a58('0x55')]);}}else{_0x1ec51b=applyJoinClauses(_0x1ec51b,![]);_0x1ec51b['group'](_0x8a58('0x56'));if(_0x4bfd66[_0x8a58('0x54')]){_0x44c8df[_0x8a58('0x54')](_0x4bfd66[_0x8a58('0x54')]);}if(_0x4bfd66[_0x8a58('0x55')]){_0x44c8df[_0x8a58('0x55')](_0x4bfd66[_0x8a58('0x55')]);}}_0x1ec51b['having'](_0x54e9db);if(_0x4bfd66['order']){_0x4bfd66['order'][_0x8a58('0x45')](function(_0xe0ed75){_0x44c8df[_0x8a58('0x57')]('c.'+_0xe0ed75[0x0],_0xe0ed75[0x1]==='DESC'?![]:!![]);_0x1ec51b[_0x8a58('0x57')](_0x8a58('0x58')+_0xe0ed75[0x0],_0xe0ed75[0x1]===_0x8a58('0x59')?![]:!![]);});}_0x1ec51b[_0x8a58('0xb')](_0x44c8df,_0x8a58('0xe'));return _0x1ec51b;}function getFilteredContacts(_0x1e3f5d){var _0x22f5aa=[];return db[_0x8a58('0x3a')][_0x8a58('0x5a')]({'attributes':['id',_0x8a58('0x2f'),_0x8a58('0x5b')],'raw':!![]})[_0x8a58('0x4d')](function(_0x5c5eee){_0x22f5aa=_[_0x8a58('0x5c')](_0x5c5eee,'id');var _0x2d49d5={'type':db['Sequelize'][_0x8a58('0x5d')][_0x8a58('0x5e')],'model':db[_0x8a58('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x8a58('0x60')](_0x1e3f5d['toString'](),_0x2d49d5);})[_0x8a58('0x4d')](function(_0x3c58e9){_0x3c58e9[_0x8a58('0x45')](function(_0x11566d){if(_0x11566d[_0x8a58('0x1b')]){_0x11566d[_0x8a58('0x61')]=[];_0x11566d[_0x8a58('0x1b')][_0x8a58('0x22')](',')[_0x8a58('0x45')](function(_0x53fbde){_0x11566d[_0x8a58('0x61')][_0x8a58('0x62')](_0x22f5aa[_0x53fbde]);});}delete _0x11566d[_0x8a58('0x1b')];});return _0x3c58e9;});}function countFilteredContacts(_0x3ff9ee,_0x41009d){var _0x57adf4=_0x3ff9ee[_0x8a58('0x63')]();_0x57adf4[_0x8a58('0x1d')](_0x8a58('0x64'));_0x57adf4=applyJoinClauses(_0x57adf4,!![]);_0x3ff9ee[_0x8a58('0x52')](_0x8a58('0x53'));var _0x30a0b0=utils[_0x8a58('0x1f')](_0x41009d);if(!_[_0x8a58('0x65')](_0x30a0b0)){_0x57adf4['where'](_0x8a58('0x66'),_0x30a0b0);}var _0xbf6332={'type':db[_0x8a58('0x67')]['QueryTypes'][_0x8a58('0x5e')],'raw':!![]};return db['sequelize'][_0x8a58('0x60')](_0x57adf4[_0x8a58('0x68')](),_0xbf6332)[_0x8a58('0x4d')](function(_0x19dea6){return _0x19dea6[0x0][_0x8a58('0x64')];});}module[_0x8a58('0x69')]={'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 6cc1175..051d7fd 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 _0x696c=['update','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','secret','utf8','base64','decryptString','crypto','lodash','../../config/logger','app','secrets','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data'];(function(_0x5c2cfc,_0x14612f){var _0x43f153=function(_0x323b2d){while(--_0x323b2d){_0x5c2cfc['push'](_0x5c2cfc['shift']());}};_0x43f153(++_0x14612f);}(_0x696c,0xc8));var _0xc696=function(_0x1d75f7,_0x139d5e){_0x1d75f7=_0x1d75f7-0x0;var _0x307f9a=_0x696c[_0x1d75f7];return _0x307f9a;};'use strict';var crypto=require(_0xc696('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xc696('0x1'));var config=require('../../config/environment');var logger=require(_0xc696('0x2'))(_0xc696('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc696('0x4')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xc696('0x5')};if(config['encrypt']&&config[_0xc696('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xc696('0x6')][_0xc696('0x7')]);if(isSupported){fileOptions[_0xc696('0x7')]=config[_0xc696('0x6')][_0xc696('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xc696('0x8')](config[_0xc696('0x6')][_0xc696('0x7')],_0xc696('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x245acb){return AES_SUPPORTED_RX['test'](_0x245acb);}function getSupportedCiphers(){return crypto[_0xc696('0xa')]()[_0xc696('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x490035){return getSupportedCiphers()[_0xc696('0xc')](_0x490035)>-0x1;}function combineOptions(_0x1a84cc){var _0x2c0265={};for(var _0x44971d in fileOptions){if(fileOptions['hasOwnProperty'](_0x44971d)){_0x2c0265[_0x44971d]=fileOptions[_0x44971d];}}if(_0x1a84cc){for(var _0x4ae25d in _0x1a84cc){if(_0x1a84cc[_0xc696('0xd')](_0x4ae25d)){_0x2c0265[_0x4ae25d]=_0x1a84cc[_0x4ae25d];}}}return _0x2c0265;}exports['encryptFile']=function(_0x1de8fd,_0x3def07,_0x5bfa16,_0x453020){return new BPromise(function(_0x4d181e,_0x4cf514){_0x453020=combineOptions(_0x453020);var _0x354935=new Buffer(_0x5bfa16);var _0x14ee83=fs['createReadStream'](_0x1de8fd);var _0xf46ae=fs[_0xc696('0xe')](_0x3def07);var _0x26ec79=crypto[_0xc696('0xf')](_0x453020[_0xc696('0x7')],_0x354935);_0x14ee83['on'](_0xc696('0x10'),function(_0x975cad){var _0x5d9273=new Buffer(_0x26ec79[_0xc696('0x11')](_0x975cad),_0xc696('0x12'));_0xf46ae['write'](_0x5d9273);});_0x14ee83['on'](_0xc696('0x13'),function(){try{var _0x5351b6=new Buffer(_0x26ec79[_0xc696('0x14')](_0xc696('0x12')),_0xc696('0x12'));_0xf46ae[_0xc696('0x15')](_0x5351b6);_0xf46ae[_0xc696('0x13')]();_0xf46ae['on'](_0xc696('0x16'),function(){return _0x4d181e(_0x3def07);});}catch(_0x2d2c67){fs[_0xc696('0x17')](_0x3def07);return _0x4cf514(_0x2d2c67);}});});};exports[_0xc696('0x18')]=function(_0x3a74de,_0x18dd43,_0x24a9a0,_0x391e54){return new BPromise(function(_0x2be33a,_0x37f245){_0x391e54=combineOptions(_0x391e54);var _0x23bfca=new Buffer(_0x24a9a0);var _0x159a1b=fs[_0xc696('0x19')](_0x3a74de);var _0x10fe7f=fs[_0xc696('0xe')](_0x18dd43);var _0x5986c4=crypto[_0xc696('0x1a')](_0x391e54[_0xc696('0x7')],_0x23bfca);_0x159a1b['on'](_0xc696('0x10'),function(_0x5152d1){var _0x2d7676=new Buffer(_0x5986c4['update'](_0x5152d1),_0xc696('0x12'));_0x10fe7f[_0xc696('0x15')](_0x2d7676);});_0x159a1b['on'](_0xc696('0x13'),function(){try{var _0x400f8b=new Buffer(_0x5986c4['final'](_0xc696('0x12')),_0xc696('0x12'));_0x10fe7f[_0xc696('0x15')](_0x400f8b);_0x10fe7f['end']();_0x10fe7f['on'](_0xc696('0x16'),function(){return _0x2be33a(_0x18dd43);});}catch(_0x4a4feb){fs[_0xc696('0x17')](_0x18dd43);return _0x37f245(_0x4a4feb);}});});};exports['encryptString']=function(_0x23279d,_0xfcbdc7,_0x2accef){var _0x26372a=_0x2accef||stringOptions[_0xc696('0x7')];var _0x4afcbc=_0xfcbdc7||stringOptions[_0xc696('0x1b')];var _0x2b68d9=crypto['createCipher'](_0x26372a,_0x4afcbc);var _0x36e3ed=_0x2b68d9['update'](_0x23279d,_0xc696('0x1c'),_0xc696('0x1d'));_0x36e3ed+=_0x2b68d9['final'](_0xc696('0x1d'));return _0x36e3ed;};exports[_0xc696('0x1e')]=function(_0x1522ef,_0x129782,_0x796bc2){var _0x185baa=_0x796bc2||stringOptions[_0xc696('0x7')];var _0x7a1c2e=_0x129782||stringOptions[_0xc696('0x1b')];var _0x330535=crypto[_0xc696('0x1a')](_0x185baa,_0x7a1c2e);var _0x3823b7=_0x330535[_0xc696('0x11')](_0x1522ef,_0xc696('0x1d'),_0xc696('0x1c'));_0x3823b7+=_0x330535['final'](_0xc696('0x1c'));return _0x3823b7;}; \ No newline at end of file +var _0xb442=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','encryptString','utf8','base64','createDecipher','crypto','lodash','../../config/environment','secrets','session','aes192','encrypt','algorithm','join','error'];(function(_0x3327e2,_0x251554){var _0x59fb5c=function(_0xf092ac){while(--_0xf092ac){_0x3327e2['push'](_0x3327e2['shift']());}};_0x59fb5c(++_0x251554);}(_0xb442,0x1b6));var _0x2b44=function(_0x357386,_0x40d104){_0x357386=_0x357386-0x0;var _0x3a7fa3=_0xb442[_0x357386];return _0x3a7fa3;};'use strict';var crypto=require(_0x2b44('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x2b44('0x1'));var config=require(_0x2b44('0x2'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2b44('0x3')][_0x2b44('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x2b44('0x5')};if(config[_0x2b44('0x6')]&&config[_0x2b44('0x6')][_0x2b44('0x7')]){var isSupported=isAlgorithmSupported(config[_0x2b44('0x6')][_0x2b44('0x7')]);if(isSupported){fileOptions[_0x2b44('0x7')]=config[_0x2b44('0x6')][_0x2b44('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2b44('0x8')](',\x20');logger[_0x2b44('0x9')](config[_0x2b44('0x6')][_0x2b44('0x7')],_0x2b44('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0xaf790f){return AES_SUPPORTED_RX[_0x2b44('0xb')](_0xaf790f);}function getSupportedCiphers(){return crypto[_0x2b44('0xc')]()[_0x2b44('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x2aa4ef){return getSupportedCiphers()['indexOf'](_0x2aa4ef)>-0x1;}function combineOptions(_0x1ecdbb){var _0xaa7e95={};for(var _0x1aa080 in fileOptions){if(fileOptions[_0x2b44('0xe')](_0x1aa080)){_0xaa7e95[_0x1aa080]=fileOptions[_0x1aa080];}}if(_0x1ecdbb){for(var _0x517be5 in _0x1ecdbb){if(_0x1ecdbb[_0x2b44('0xe')](_0x517be5)){_0xaa7e95[_0x517be5]=_0x1ecdbb[_0x517be5];}}}return _0xaa7e95;}exports[_0x2b44('0xf')]=function(_0x41d4e8,_0x1f1e8e,_0x4d1da2,_0x466162){return new BPromise(function(_0x4b4655,_0x3f55c4){_0x466162=combineOptions(_0x466162);var _0x457346=new Buffer(_0x4d1da2);var _0x143143=fs['createReadStream'](_0x41d4e8);var _0x1d773f=fs[_0x2b44('0x10')](_0x1f1e8e);var _0x76970=crypto[_0x2b44('0x11')](_0x466162[_0x2b44('0x7')],_0x457346);_0x143143['on'](_0x2b44('0x12'),function(_0xd70769){var _0x457faa=new Buffer(_0x76970[_0x2b44('0x13')](_0xd70769),_0x2b44('0x14'));_0x1d773f[_0x2b44('0x15')](_0x457faa);});_0x143143['on'](_0x2b44('0x16'),function(){try{var _0x30df42=new Buffer(_0x76970[_0x2b44('0x17')](_0x2b44('0x14')),_0x2b44('0x14'));_0x1d773f['write'](_0x30df42);_0x1d773f[_0x2b44('0x16')]();_0x1d773f['on'](_0x2b44('0x18'),function(){return _0x4b4655(_0x1f1e8e);});}catch(_0xf3143a){fs[_0x2b44('0x19')](_0x1f1e8e);return _0x3f55c4(_0xf3143a);}});});};exports[_0x2b44('0x1a')]=function(_0x496002,_0x422a6c,_0x516047,_0x5b80bb){return new BPromise(function(_0x41d669,_0x53db43){_0x5b80bb=combineOptions(_0x5b80bb);var _0x56d560=new Buffer(_0x516047);var _0x6b2000=fs[_0x2b44('0x1b')](_0x496002);var _0x5d2287=fs['createWriteStream'](_0x422a6c);var _0x4022bd=crypto['createDecipher'](_0x5b80bb[_0x2b44('0x7')],_0x56d560);_0x6b2000['on'](_0x2b44('0x12'),function(_0x14405f){var _0x5d272d=new Buffer(_0x4022bd['update'](_0x14405f),_0x2b44('0x14'));_0x5d2287[_0x2b44('0x15')](_0x5d272d);});_0x6b2000['on'](_0x2b44('0x16'),function(){try{var _0x5cfba4=new Buffer(_0x4022bd['final'](_0x2b44('0x14')),'binary');_0x5d2287['write'](_0x5cfba4);_0x5d2287[_0x2b44('0x16')]();_0x5d2287['on'](_0x2b44('0x18'),function(){return _0x41d669(_0x422a6c);});}catch(_0x5d069d){fs[_0x2b44('0x19')](_0x422a6c);return _0x53db43(_0x5d069d);}});});};exports[_0x2b44('0x1c')]=function(_0xdeef7a,_0x392904,_0x5313c1){var _0x3c0107=_0x5313c1||stringOptions['algorithm'];var _0x571885=_0x392904||stringOptions['secret'];var _0x3ef763=crypto[_0x2b44('0x11')](_0x3c0107,_0x571885);var _0x348c92=_0x3ef763[_0x2b44('0x13')](_0xdeef7a,_0x2b44('0x1d'),_0x2b44('0x1e'));_0x348c92+=_0x3ef763['final']('base64');return _0x348c92;};exports['decryptString']=function(_0x3a0ac3,_0x4791ad,_0x2e4ea9){var _0x376538=_0x2e4ea9||stringOptions[_0x2b44('0x7')];var _0x567c53=_0x4791ad||stringOptions['secret'];var _0x534d27=crypto[_0x2b44('0x1f')](_0x376538,_0x567c53);var _0x448791=_0x534d27[_0x2b44('0x13')](_0x3a0ac3,_0x2b44('0x1e'),_0x2b44('0x1d'));_0x448791+=_0x534d27[_0x2b44('0x17')](_0x2b44('0x1d'));return _0x448791;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 574b077..88dcf9b 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 _0x63e3=['find','split','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','then','num','length','range','isInteger','forEach','push','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0x63e3,0x147));var _0x363e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x63e3[_0x513aa5];return _0x1a1a7c;};'use strict';var util=require(_0x363e('0x0'));var path=require(_0x363e('0x1'));var _=require('lodash');var csv=require(_0x363e('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x363e('0x3'));var db=require(_0x363e('0x4'))['db'];var dbH=require(_0x363e('0x4'))[_0x363e('0x5')];var logger=require(_0x363e('0x6'))(_0x363e('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x363e('0x8')][0x3];var PATH=process[_0x363e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3dd0fb,_0xb872b6){var _0xcedfba={'status':_0x3dd0fb};var _0x3eaa58={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb872b6){_0xcedfba[_0x363e('0x9')]=_0xb872b6;}return db['AnalyticExtractedReport'][_0x363e('0xa')](_0xcedfba,_0x3eaa58);}function main(){var _0x2cf7ad=0x1388;var _0x269471;logger[_0x363e('0xb')](util[_0x363e('0xc')](_0x363e('0xd'),EXTRACTED_REPORT_ID,_0x363e('0xe')));return db[_0x363e('0xf')][_0x363e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x363e('0x11'),_0x363e('0x12')]})['then'](function(_0x27d186){if(_0x27d186){_0x269471=_0x27d186;_0x2cf7ad=_0x269471[_0x363e('0x12')]||0x1388;}})['then'](function(){return dbH[_0x363e('0x13')]['query'](util[_0x363e('0xc')](_0x363e('0x14'),QUERY),{'type':dbH[_0x363e('0x13')]['QueryTypes']['SELECT']});})[_0x363e('0x15')](function(_0x2f855c){if(!_0x2f855c[0x0][_0x363e('0x16')]){return analyticExtractedReport('Empty');}var _0x1aacf4=[];var _0x3ef2bd=0x0;if(_0x269471[_0x363e('0x11')]){if(_0x2f855c&&_0x2f855c[_0x363e('0x17')]){var _0x107860=_[_0x363e('0x18')](_0x2f855c[0x0][_0x363e('0x16')]/_0x2cf7ad);var _0x2b35a8=Number[_0x363e('0x19')](_0x2f855c[0x0]['num']/_0x2cf7ad)?_0x2f855c[0x0][_0x363e('0x16')]%_0x2cf7ad:0x0;_0x107860[_0x363e('0x1a')](function(_0x407d6e){if(_0x407d6e>0x0){_0x3ef2bd+=_0x2cf7ad;}_0x1aacf4[_0x363e('0x1b')](dbH[_0x363e('0x13')][_0x363e('0x1c')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2cf7ad,_0x3ef2bd),{'type':dbH[_0x363e('0x13')]['QueryTypes'][_0x363e('0x1d')]}));});if(_0x2b35a8>0x0){_0x3ef2bd+=_0x2cf7ad;_0x1aacf4['push'](dbH[_0x363e('0x13')][_0x363e('0x1c')](util[_0x363e('0xc')](_0x363e('0x1e'),QUERY,_0x2b35a8,_0x3ef2bd),{'type':dbH['sequelize']['QueryTypes'][_0x363e('0x1d')]}));}}}else{_0x1aacf4[_0x363e('0x1b')](dbH[_0x363e('0x13')][_0x363e('0x1c')](QUERY,{'type':dbH[_0x363e('0x13')][_0x363e('0x1f')][_0x363e('0x1d')]}));}var _0x4e6a25=path[_0x363e('0x20')](PATH);var _0x409499=path[_0x363e('0x21')](PATH,_0x363e('0x22'));var _0x1e30a9=_0x269471[_0x363e('0x11')]&&_0x1aacf4[_0x363e('0x17')]>0x1;var _0x144795=[];if(!fs[_0x363e('0x23')](path['join'](_0x4e6a25,_0x409499))&&_0x1e30a9){fs['mkdirSync'](path[_0x363e('0x24')](_0x4e6a25,_0x409499));}return BPromise[_0x363e('0x25')](_0x1aacf4,function(_0x2feea8){_0x144795['push'](_0x2feea8);})[_0x363e('0x15')](function(){for(var _0x469ff7=0x0;_0x469ff7<_0x144795[_0x363e('0x17')];_0x469ff7+=0x1){var _0x41b652;var _0xc0a245=_0x144795[_0x469ff7];if(_0x1e30a9){_0x41b652=path['join'](_0x4e6a25,_0x409499,util['format']('%s%d.%s',_0x409499,_0x469ff7,_0x363e('0x26')));}else{_0x41b652=path[_0x363e('0x24')](_0x4e6a25,util[_0x363e('0xc')](_0x363e('0x27'),_0x409499,_0x363e('0x26')));}fs[_0x363e('0x28')](_0x41b652,csv(_0xc0a245));}})[_0x363e('0x15')](function(){if(_0x1e30a9){return new Promise(function(_0xe74a77){zipdir(path[_0x363e('0x24')](_0x4e6a25,_0x409499),{'saveTo':path['join'](_0x4e6a25,util[_0x363e('0xc')](_0x363e('0x27'),_0x409499,_0x363e('0x29')))},function(_0x214e3d,_0x2af606){rimraf(path[_0x363e('0x24')](_0x4e6a25,_0x409499),function(){});_0xe74a77(_0x363e('0x2a'));});});}})[_0x363e('0x15')](function(){logger[_0x363e('0xb')](util[_0x363e('0xc')](_0x363e('0x2b'),EXTRACTED_REPORT_ID,_0x363e('0xe')));return analyticExtractedReport(_0x363e('0x2c'),_0x1e30a9?util[_0x363e('0xc')](_0x363e('0x27'),_0x409499,_0x1e30a9?_0x363e('0x29'):'csv'):null);});})[_0x363e('0x2d')](function(_0x2b42fe){logger[_0x363e('0xb')](util[_0x363e('0xc')](_0x363e('0x2e'),EXTRACTED_REPORT_ID,_0x363e('0xe')),util['inspect'](_0x2b42fe,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x363e('0x2f'));})['finally'](function(){process[_0x363e('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0db5=['split','splitSizeCsv','then','sequelize','query','SELECT','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.csv','length','join','each','%s%d.%s','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find'];(function(_0x3d9f68,_0x95d6ce){var _0x4a6db6=function(_0xa3160a){while(--_0xa3160a){_0x3d9f68['push'](_0x3d9f68['shift']());}};_0x4a6db6(++_0x95d6ce);}(_0x0db5,0x15d));var _0x50db=function(_0x1cc89a,_0x176f51){_0x1cc89a=_0x1cc89a-0x0;var _0x7e69d3=_0x0db5[_0x1cc89a];return _0x7e69d3;};'use strict';var util=require(_0x50db('0x0'));var path=require(_0x50db('0x1'));var _=require(_0x50db('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x50db('0x3'));var zipdir=require(_0x50db('0x4'));var rimraf=require(_0x50db('0x5'));var db=require(_0x50db('0x6'))['db'];var dbH=require('../../mysqldb')[_0x50db('0x7')];var logger=require(_0x50db('0x8'))(_0x50db('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x50db('0xa')][0x2]);var QUERY=process[_0x50db('0xa')][0x3];var PATH=process[_0x50db('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3b9146,_0x37fac4){var _0x3ff92b={'status':_0x3b9146};var _0x3a7aec={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x37fac4){_0x3ff92b['savename']=_0x37fac4;}return db[_0x50db('0xb')][_0x50db('0xc')](_0x3ff92b,_0x3a7aec);}function main(){var _0x3321ef=0x1388;var _0x2b862d;logger[_0x50db('0xd')](util[_0x50db('0xe')](_0x50db('0xf'),EXTRACTED_REPORT_ID,_0x50db('0x10')));return db[_0x50db('0x11')][_0x50db('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x50db('0x13'),_0x50db('0x14')]})[_0x50db('0x15')](function(_0x38cc5d){if(_0x38cc5d){_0x2b862d=_0x38cc5d;_0x3321ef=_0x2b862d[_0x50db('0x14')]||0x1388;}})[_0x50db('0x15')](function(){return dbH[_0x50db('0x16')][_0x50db('0x17')](util[_0x50db('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x50db('0x18')]});})[_0x50db('0x15')](function(_0x133f9d){if(!_0x133f9d[0x0][_0x50db('0x19')]){return analyticExtractedReport(_0x50db('0x1a'));}var _0x14779e=[];var _0x513826=0x0;if(_0x2b862d[_0x50db('0x13')]){if(_0x133f9d&&_0x133f9d['length']){var _0xfe207e=_[_0x50db('0x1b')](_0x133f9d[0x0][_0x50db('0x19')]/_0x3321ef);var _0x5d622b=Number[_0x50db('0x1c')](_0x133f9d[0x0]['num']/_0x3321ef)?_0x133f9d[0x0][_0x50db('0x19')]%_0x3321ef:0x0;_0xfe207e[_0x50db('0x1d')](function(_0xbdca16){if(_0xbdca16>0x0){_0x513826+=_0x3321ef;}_0x14779e[_0x50db('0x1e')](dbH[_0x50db('0x16')]['query'](util[_0x50db('0xe')](_0x50db('0x1f'),QUERY,_0x3321ef,_0x513826),{'type':dbH[_0x50db('0x16')][_0x50db('0x20')][_0x50db('0x18')]}));});if(_0x5d622b>0x0){_0x513826+=_0x3321ef;_0x14779e[_0x50db('0x1e')](dbH[_0x50db('0x16')][_0x50db('0x17')](util[_0x50db('0xe')](_0x50db('0x1f'),QUERY,_0x5d622b,_0x513826),{'type':dbH[_0x50db('0x16')][_0x50db('0x20')][_0x50db('0x18')]}));}}}else{_0x14779e[_0x50db('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x50db('0x16')][_0x50db('0x20')][_0x50db('0x18')]}));}var _0x4e4ecb=path[_0x50db('0x21')](PATH);var _0x1acbec=path['basename'](PATH,_0x50db('0x22'));var _0x30c816=_0x2b862d['split']&&_0x14779e[_0x50db('0x23')]>0x1;var _0xd6e605=[];if(!fs['existsSync'](path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec))&&_0x30c816){fs['mkdirSync'](path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec));}return BPromise[_0x50db('0x25')](_0x14779e,function(_0x52bf81){_0xd6e605[_0x50db('0x1e')](_0x52bf81);})[_0x50db('0x15')](function(){for(var _0xf6d957=0x0;_0xf6d957<_0xd6e605[_0x50db('0x23')];_0xf6d957+=0x1){var _0x2ccf4e;var _0x2320d1=_0xd6e605[_0xf6d957];if(_0x30c816){_0x2ccf4e=path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec,util[_0x50db('0xe')](_0x50db('0x26'),_0x1acbec,_0xf6d957,'csv'));}else{_0x2ccf4e=path[_0x50db('0x24')](_0x4e4ecb,util[_0x50db('0xe')](_0x50db('0x27'),_0x1acbec,'csv'));}fs['writeFileSync'](_0x2ccf4e,csv(_0x2320d1));}})[_0x50db('0x15')](function(){if(_0x30c816){return new Promise(function(_0x5b1eb5){zipdir(path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec),{'saveTo':path[_0x50db('0x24')](_0x4e4ecb,util[_0x50db('0xe')]('%s.%s',_0x1acbec,_0x50db('0x28')))},function(_0x18b357,_0x39c79a){rimraf(path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec),function(){});_0x5b1eb5(_0x50db('0x29'));});});}})['then'](function(){logger[_0x50db('0xd')](util[_0x50db('0xe')](_0x50db('0x2a'),EXTRACTED_REPORT_ID,_0x50db('0x10')));return analyticExtractedReport(_0x50db('0x2b'),_0x30c816?util[_0x50db('0xe')](_0x50db('0x27'),_0x1acbec,_0x30c816?_0x50db('0x28'):'csv'):null);});})[_0x50db('0x2c')](function(_0xafe3d0){logger['info'](util[_0x50db('0xe')](_0x50db('0x2d'),EXTRACTED_REPORT_ID,_0x50db('0x10')),util['inspect'](_0xafe3d0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index a1238e5..22bbdaf 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 _0xb414=['Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','body','push','concat','chunk','keys','name','startDate','format','endDate','pageBreak','before','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then','num','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xb414,0x192));var _0x4b41=function(_0x1aafb2,_0x1055ee){_0x1aafb2=_0x1aafb2-0x0;var _0x42e538=_0xb414[_0x1aafb2];return _0x42e538;};'use strict';var _=require(_0x4b41('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x4b41('0x1'));var moment=require(_0x4b41('0x2'));var htmlToPdfmake=require(_0x4b41('0x3'));var PdfPrinter=require(_0x4b41('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x4b41('0x5'));var JSDOM=require(_0x4b41('0x6'))[_0x4b41('0x7')];var window=new JSDOM('')[_0x4b41('0x8')];var BPromise=require(_0x4b41('0x9'));var db=require(_0x4b41('0xa'))['db'];var dbH=require(_0x4b41('0xa'))['dbH'];var logger=require(_0x4b41('0xb'))(_0x4b41('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x4b41('0xd')][0x2]);var QUERY=process[_0x4b41('0xd')][0x3];var PATH=process[_0x4b41('0xd')][0x4];var NAME=process[_0x4b41('0xd')][0x5];var FORMAT=_0x4b41('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x267ed7,_0x474ae0){var _0x12f15a={'status':_0x267ed7};var _0x1f87de={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x474ae0){_0x12f15a['savename']=_0x474ae0;}return db[_0x4b41('0xf')][_0x4b41('0x10')](_0x12f15a,_0x1f87de);}function getHeaders(_0x50a8ce){return _[_0x4b41('0x11')](_0x50a8ce,function(_0x5c3c80){return{'text':_0x5c3c80,'style':_0x4b41('0x12')};});}function getRows(_0x23cb29,_0x1d0e3e){return _[_0x4b41('0x11')](_0x1d0e3e,function(_0x2ed7f5){return _(_0x2ed7f5)['pick'](_0x23cb29)['map'](function(_0x111404){return _0x111404?_[_0x4b41('0x13')](_0x111404):'';})[_0x4b41('0x14')]();});}function createTable(_0x128138,_0x3c3c26){var _0x43a000={'widths':_[_0x4b41('0x15')](Array(_0x128138[_0x4b41('0x16')]),0x91),'heights':function(_0x93c149){return _0x93c149===0x0?_0x4b41('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4a9650=getHeaders(_0x128138);_0x43a000[_0x4b41('0x18')][_0x4b41('0x19')](_0x4a9650);var _0x232400=getRows(_0x128138,_0x3c3c26);_0x43a000[_0x4b41('0x18')]=_0x43a000[_0x4b41('0x18')][_0x4b41('0x1a')](_0x232400);return _0x43a000;}function createTables(_0x456566){var _0x3d68e3=[];var _0xd8a026=_[_0x4b41('0x1b')](Object[_0x4b41('0x1c')](_0x456566[0x0]),0x5);_0xd8a026['forEach'](function(_0x1eb27f){_0x3d68e3['push'](createTable(_0x1eb27f,_0x456566));});return _0x3d68e3;}function getPDFDocDefinition(_0x484c01){var _0x29287e=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x4b41('0x1d')],moment(EXTRACTED_REPORT[_0x4b41('0x1e')])[_0x4b41('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0x4b41('0x20')])[_0x4b41('0x1f')](FORMAT));var _0x4a3a0d=[];for(var _0x5f4678=0x0;_0x5f4678<_0x484c01['length'];_0x5f4678++){var _0x597f47=[];if(_0x5f4678===0x0){_0x597f47[_0x4b41('0x19')]({'text':_0x29287e,'style':'header'});}var _0x2b83fe={'table':_0x484c01[_0x5f4678]};if(_0x5f4678>0x0){_0x2b83fe[_0x4b41('0x21')]=_0x4b41('0x22');_0x2b83fe['margin']=[0x0,0x46,0x0,0x0];}_0x597f47['push'](_0x2b83fe);_0x4a3a0d['push'](_0x597f47);}return{'pageSize':'A4','pageOrientation':_0x4b41('0x23'),'content':_0x4a3a0d,'footer':function(_0x24d6ac,_0x1ec90c){return{'text':_0x24d6ac['toString']()+_0x4b41('0x24')+_0x1ec90c,'style':_0x4b41('0x25')};},'defaultStyle':{'font':_0x4b41('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4b41('0x27')},'footer':{'alignment':_0x4b41('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3ef83e){var _0x3db5c0=0x1388;var _0x4a2857;if(!_0x3ef83e[0x0]['num']){return analyticExtractedReport(_0x4b41('0x29'));}return db[_0x4b41('0x2a')][_0x4b41('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4b41('0x2c'),'splitSizePdf']})['then'](function(_0x2a650e){if(_0x2a650e){_0x4a2857=_0x2a650e;_0x3db5c0=_0x4a2857[_0x4b41('0x2d')]||0x3e8;}})[_0x4b41('0x2e')](function(){var _0x5852ff=[];var _0xcf3f3b=0x0;if(_0x4a2857['split']){if(_0x3ef83e&&_0x3ef83e[_0x4b41('0x16')]){var _0x11d219=_['range'](_0x3ef83e[0x0][_0x4b41('0x2f')]/_0x3db5c0);var _0x35daef=Number['isInteger'](_0x3ef83e[0x0][_0x4b41('0x2f')]/_0x3db5c0)?_0x3ef83e[0x0][_0x4b41('0x2f')]%_0x3db5c0:0x0;_0x11d219[_0x4b41('0x30')](function(_0x5d26a2){if(_0x5d26a2>0x0){_0xcf3f3b+=_0x3db5c0;}_0x5852ff[_0x4b41('0x19')](dbH['sequelize'][_0x4b41('0x31')](util[_0x4b41('0x1f')](_0x4b41('0x32'),QUERY,_0x3db5c0,_0xcf3f3b),{'type':dbH[_0x4b41('0x33')][_0x4b41('0x34')][_0x4b41('0x35')]}));});if(_0x35daef>0x0){_0xcf3f3b+=_0x3db5c0;_0x5852ff[_0x4b41('0x19')](dbH[_0x4b41('0x33')][_0x4b41('0x31')](util[_0x4b41('0x1f')](_0x4b41('0x32'),QUERY,_0x35daef,_0xcf3f3b),{'type':dbH[_0x4b41('0x33')][_0x4b41('0x34')][_0x4b41('0x35')]}));}}}else{_0x5852ff['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x4b41('0x33')]['QueryTypes'][_0x4b41('0x35')]}));}var _0x288109=path[_0x4b41('0x36')](PATH);var _0x37b70e=path[_0x4b41('0x37')](PATH,_0x4b41('0x38'));var _0x51d1ae=_0x4a2857[_0x4b41('0x2c')]&&_0x5852ff[_0x4b41('0x16')]>0x1;var _0x1de030=[];if(!fs[_0x4b41('0x39')](path['join'](_0x288109,_0x37b70e))&&_0x51d1ae){fs[_0x4b41('0x3a')](path[_0x4b41('0x3b')](_0x288109,_0x37b70e));}return BPromise[_0x4b41('0x3c')](_0x5852ff,function(_0x3b27c7){_0x1de030['push'](_0x3b27c7);})[_0x4b41('0x2e')](function(){var _0x4bd6bd=[];for(var _0x1e6f5f=0x0;_0x1e6f5f<_0x1de030['length'];_0x1e6f5f+=0x1){var _0x17c195=_0x1de030[_0x1e6f5f];var _0x1920b2=createTables(_[_0x4b41('0x3d')](_0x17c195));var _0x5e5c06;var _0xe62e97=getPDFDocDefinition(_0x1920b2);var _0x3e40d0=getPDFPrinter();var _0x3619a7=_0x3e40d0[_0x4b41('0x3e')](_0xe62e97);if(_0x51d1ae){_0x5e5c06=path[_0x4b41('0x3b')](_0x288109,_0x37b70e,util[_0x4b41('0x1f')](_0x4b41('0x3f'),_0x37b70e,_0x1e6f5f,_0x4b41('0x40')));}else{_0x5e5c06=path[_0x4b41('0x3b')](_0x288109,util[_0x4b41('0x1f')]('%s.%s',_0x37b70e,'pdf'));}_0x4bd6bd[_0x4b41('0x19')](writePDFDocument(_0x3619a7,_0x5e5c06));}return Promise[_0x4b41('0x41')](_0x4bd6bd);})[_0x4b41('0x2e')](function(){if(_0x51d1ae){return new Promise(function(_0x59a4c0){zipdir(path[_0x4b41('0x3b')](_0x288109,_0x37b70e),{'saveTo':path[_0x4b41('0x3b')](_0x288109,util[_0x4b41('0x1f')](_0x4b41('0x42'),_0x37b70e,'zip'))},function(){rimraf(path[_0x4b41('0x3b')](_0x288109,_0x37b70e),function(){});_0x59a4c0(_0x4b41('0x43'));});});}})[_0x4b41('0x2e')](function(){if(!_0x51d1ae)return;rimraf(path[_0x4b41('0x3b')](_0x288109,_0x37b70e),function(){});})[_0x4b41('0x2e')](function(){logger[_0x4b41('0x44')](util[_0x4b41('0x1f')](_0x4b41('0x45'),EXTRACTED_REPORT_ID,_0x4b41('0x46')));return analyticExtractedReport(_0x4b41('0x47'),_0x51d1ae?util['format'](_0x4b41('0x42'),_0x37b70e,_0x51d1ae?_0x4b41('0x48'):_0x4b41('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x4b41('0x44')](util[_0x4b41('0x1f')](_0x4b41('0x49'),EXTRACTED_REPORT_ID,_0x4b41('0x46')));return db[_0x4b41('0xf')][_0x4b41('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1acae3){EXTRACTED_REPORT=_0x1acae3;return dbH['sequelize'][_0x4b41('0x31')](util[_0x4b41('0x1f')](_0x4b41('0x4b'),QUERY),{'type':dbH[_0x4b41('0x33')][_0x4b41('0x34')][_0x4b41('0x35')]});})[_0x4b41('0x2e')](extractReport)[_0x4b41('0x4c')](function(_0xe42ca6){logger[_0x4b41('0x44')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4b41('0x46')),util[_0x4b41('0x4d')](_0xe42ca6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4b41('0x4e'));})[_0x4b41('0x4f')](function(){process[_0x4b41('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x12e197=new PdfPrinter({'Arial':{'normal':__dirname+_0x4b41('0x51'),'bold':__dirname+_0x4b41('0x52'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x4b41('0x53')}});return _0x12e197;}function getPDFDocDefinitionFromHTML(_0xb35f,_0x2e3ab6){var _0x47329c=util[_0x4b41('0x1f')]('%s\x20#%d',_0x2e3ab6[_0x4b41('0x54')],_0x2e3ab6[_0x4b41('0x55')]);var _0x1e1a85=moment()[_0x4b41('0x1f')](_0x4b41('0x56'))[_0x4b41('0x13')]();var _0x5692a2=htmlToPdfmake(_0xb35f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5692a2],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x4b41('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x4b41('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x4b41('0x57')}},'header':function(){return[{'text':_0x4b41('0x58'),'style':_0x4b41('0x59')}];},'footer':function(_0x46c67c,_0x351853){return[{'text':util[_0x4b41('0x1f')](_0x4b41('0x5a'),_0x47329c,_0x46c67c,_0x351853,_0x1e1a85),'style':'footer'}];}};}function writePDFDocument(_0x53e000,_0x50cf60){return new Promise(function(_0x3d74db,_0x492342){var _0x2db8f9=_0x53e000[_0x4b41('0x5b')](fs[_0x4b41('0x5c')](_0x50cf60));_0x2db8f9['on'](_0x4b41('0x5d'),function(){_0x3d74db(_0x4b41('0x5d'));});_0x2db8f9['on'](_0x4b41('0x5e'),function(_0x169f60){_0x492342(_0x169f60);});_0x53e000[_0x4b41('0x5f')]();});}exports['createPdfFromHTML']=function(_0x302f05,_0x10b3fc){var _0x459b7f=getPDFPrinter();var _0x1d21c5=getPDFDocDefinitionFromHTML(_0x302f05,_0x10b3fc);var _0x24a29b=_0x459b7f['createPdfKitDocument'](_0x1d21c5);return writePDFDocument(_0x24a29b,_0x10b3fc[_0x4b41('0x1')])[_0x4b41('0x4c')](function(_0x3f97d6){throw _0x3f97d6;});}; \ No newline at end of file +var _0xe1a8=['map','tableHeader','value','length','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','Empty','find','split','splitSizePdf','then','isInteger','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','window','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x1a165f,_0xaf7889){var _0x17d3ae=function(_0x392130){while(--_0x392130){_0x1a165f['push'](_0x1a165f['shift']());}};_0x17d3ae(++_0xaf7889);}(_0xe1a8,0x161));var _0x8e1a=function(_0x552102,_0x522dfb){_0x552102=_0x552102-0x0;var _0x4c7422=_0xe1a8[_0x552102];return _0x4c7422;};'use strict';var _=require(_0x8e1a('0x0'));var fs=require('fs');var util=require(_0x8e1a('0x1'));var path=require('path');var moment=require(_0x8e1a('0x2'));var htmlToPdfmake=require(_0x8e1a('0x3'));var PdfPrinter=require(_0x8e1a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x8e1a('0x5'));var JSDOM=require(_0x8e1a('0x6'))['JSDOM'];var window=new JSDOM('')[_0x8e1a('0x7')];var BPromise=require('bluebird');var db=require(_0x8e1a('0x8'))['db'];var dbH=require(_0x8e1a('0x8'))[_0x8e1a('0x9')];var logger=require('../../config/logger')(_0x8e1a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x8e1a('0xb')][0x2]);var QUERY=process[_0x8e1a('0xb')][0x3];var PATH=process[_0x8e1a('0xb')][0x4];var NAME=process[_0x8e1a('0xb')][0x5];var FORMAT=_0x8e1a('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x553cec,_0x5bda72){var _0x563fcb={'status':_0x553cec};var _0x312d33={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5bda72){_0x563fcb[_0x8e1a('0xd')]=_0x5bda72;}return db[_0x8e1a('0xe')]['update'](_0x563fcb,_0x312d33);}function getHeaders(_0x1c69dd){return _[_0x8e1a('0xf')](_0x1c69dd,function(_0x4dd7ea){return{'text':_0x4dd7ea,'style':_0x8e1a('0x10')};});}function getRows(_0x3e64ea,_0x11b870){return _['map'](_0x11b870,function(_0x568eba){return _(_0x568eba)['pick'](_0x3e64ea)[_0x8e1a('0xf')](function(_0x484407){return _0x484407?_['toString'](_0x484407):'';})[_0x8e1a('0x11')]();});}function createTable(_0x2ee4e8,_0x4c5604){var _0x56f633={'widths':_['fill'](Array(_0x2ee4e8[_0x8e1a('0x12')]),0x91),'heights':function(_0x523e07){return _0x523e07===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x128a70=getHeaders(_0x2ee4e8);_0x56f633[_0x8e1a('0x13')][_0x8e1a('0x14')](_0x128a70);var _0x3f7b9f=getRows(_0x2ee4e8,_0x4c5604);_0x56f633['body']=_0x56f633[_0x8e1a('0x13')]['concat'](_0x3f7b9f);return _0x56f633;}function createTables(_0x110507){var _0x158a64=[];var _0x51fa1e=_[_0x8e1a('0x15')](Object[_0x8e1a('0x16')](_0x110507[0x0]),0x5);_0x51fa1e[_0x8e1a('0x17')](function(_0x119ce9){_0x158a64[_0x8e1a('0x14')](createTable(_0x119ce9,_0x110507));});return _0x158a64;}function getPDFDocDefinition(_0x2232df){var _0x2ba57=util[_0x8e1a('0x18')](_0x8e1a('0x19'),NAME,EXTRACTED_REPORT[_0x8e1a('0x1a')],moment(EXTRACTED_REPORT[_0x8e1a('0x1b')])[_0x8e1a('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x8e1a('0x1c')])[_0x8e1a('0x18')](FORMAT));var _0x2e07b6=[];for(var _0x3bc8da=0x0;_0x3bc8da<_0x2232df[_0x8e1a('0x12')];_0x3bc8da++){var _0x18cc47=[];if(_0x3bc8da===0x0){_0x18cc47[_0x8e1a('0x14')]({'text':_0x2ba57,'style':_0x8e1a('0x1d')});}var _0x3e47ff={'table':_0x2232df[_0x3bc8da]};if(_0x3bc8da>0x0){_0x3e47ff[_0x8e1a('0x1e')]=_0x8e1a('0x1f');_0x3e47ff[_0x8e1a('0x20')]=[0x0,0x46,0x0,0x0];}_0x18cc47[_0x8e1a('0x14')](_0x3e47ff);_0x2e07b6[_0x8e1a('0x14')](_0x18cc47);}return{'pageSize':'A4','pageOrientation':_0x8e1a('0x21'),'content':_0x2e07b6,'footer':function(_0x3e357d,_0x37a1bf){return{'text':_0x3e357d[_0x8e1a('0x22')]()+_0x8e1a('0x23')+_0x37a1bf,'style':_0x8e1a('0x24')};},'defaultStyle':{'font':_0x8e1a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8e1a('0x26')},'footer':{'alignment':_0x8e1a('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4bf27c){var _0x406a34=0x1388;var _0x2295fb;if(!_0x4bf27c[0x0]['num']){return analyticExtractedReport(_0x8e1a('0x28'));}return db['Setting'][_0x8e1a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8e1a('0x2a'),_0x8e1a('0x2b')]})[_0x8e1a('0x2c')](function(_0xb9d083){if(_0xb9d083){_0x2295fb=_0xb9d083;_0x406a34=_0x2295fb[_0x8e1a('0x2b')]||0x3e8;}})[_0x8e1a('0x2c')](function(){var _0x16f96d=[];var _0x4d48f5=0x0;if(_0x2295fb[_0x8e1a('0x2a')]){if(_0x4bf27c&&_0x4bf27c[_0x8e1a('0x12')]){var _0x545884=_['range'](_0x4bf27c[0x0]['num']/_0x406a34);var _0x1bb995=Number[_0x8e1a('0x2d')](_0x4bf27c[0x0][_0x8e1a('0x2e')]/_0x406a34)?_0x4bf27c[0x0][_0x8e1a('0x2e')]%_0x406a34:0x0;_0x545884[_0x8e1a('0x17')](function(_0x356b7a){if(_0x356b7a>0x0){_0x4d48f5+=_0x406a34;}_0x16f96d[_0x8e1a('0x14')](dbH[_0x8e1a('0x2f')]['query'](util[_0x8e1a('0x18')](_0x8e1a('0x30'),QUERY,_0x406a34,_0x4d48f5),{'type':dbH[_0x8e1a('0x2f')][_0x8e1a('0x31')]['SELECT']}));});if(_0x1bb995>0x0){_0x4d48f5+=_0x406a34;_0x16f96d[_0x8e1a('0x14')](dbH['sequelize'][_0x8e1a('0x32')](util[_0x8e1a('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1bb995,_0x4d48f5),{'type':dbH['sequelize'][_0x8e1a('0x31')][_0x8e1a('0x33')]}));}}}else{_0x16f96d['push'](dbH[_0x8e1a('0x2f')][_0x8e1a('0x32')](QUERY,{'type':dbH[_0x8e1a('0x2f')][_0x8e1a('0x31')]['SELECT']}));}var _0x1c4b8f=path[_0x8e1a('0x34')](PATH);var _0x19d48e=path[_0x8e1a('0x35')](PATH,_0x8e1a('0x36'));var _0x7aaa1a=_0x2295fb['split']&&_0x16f96d[_0x8e1a('0x12')]>0x1;var _0x2f902d=[];if(!fs[_0x8e1a('0x37')](path['join'](_0x1c4b8f,_0x19d48e))&&_0x7aaa1a){fs[_0x8e1a('0x38')](path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e));}return BPromise[_0x8e1a('0x3a')](_0x16f96d,function(_0x45cd9d){_0x2f902d[_0x8e1a('0x14')](_0x45cd9d);})[_0x8e1a('0x2c')](function(){var _0x54557b=[];for(var _0x2f85a9=0x0;_0x2f85a9<_0x2f902d['length'];_0x2f85a9+=0x1){var _0x103b5c=_0x2f902d[_0x2f85a9];var _0x56c28c=createTables(_[_0x8e1a('0x3b')](_0x103b5c));var _0x5a33cc;var _0x5e6a91=getPDFDocDefinition(_0x56c28c);var _0x1dc8f3=getPDFPrinter();var _0x54bd78=_0x1dc8f3['createPdfKitDocument'](_0x5e6a91);if(_0x7aaa1a){_0x5a33cc=path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e,util[_0x8e1a('0x18')](_0x8e1a('0x3c'),_0x19d48e,_0x2f85a9,_0x8e1a('0x3d')));}else{_0x5a33cc=path[_0x8e1a('0x39')](_0x1c4b8f,util[_0x8e1a('0x18')](_0x8e1a('0x3e'),_0x19d48e,_0x8e1a('0x3d')));}_0x54557b[_0x8e1a('0x14')](writePDFDocument(_0x54bd78,_0x5a33cc));}return Promise[_0x8e1a('0x3f')](_0x54557b);})[_0x8e1a('0x2c')](function(){if(_0x7aaa1a){return new Promise(function(_0x10b857){zipdir(path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e),{'saveTo':path['join'](_0x1c4b8f,util[_0x8e1a('0x18')](_0x8e1a('0x3e'),_0x19d48e,_0x8e1a('0x40')))},function(){rimraf(path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e),function(){});_0x10b857('zip\x20finished');});});}})[_0x8e1a('0x2c')](function(){if(!_0x7aaa1a)return;rimraf(path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e),function(){});})[_0x8e1a('0x2c')](function(){logger[_0x8e1a('0x41')](util[_0x8e1a('0x18')](_0x8e1a('0x42'),EXTRACTED_REPORT_ID,_0x8e1a('0x43')));return analyticExtractedReport(_0x8e1a('0x44'),_0x7aaa1a?util['format']('%s.%s',_0x19d48e,_0x7aaa1a?_0x8e1a('0x40'):_0x8e1a('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8e1a('0x41')](util['format'](_0x8e1a('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x8e1a('0xe')][_0x8e1a('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2b4dd9){EXTRACTED_REPORT=_0x2b4dd9;return dbH[_0x8e1a('0x2f')][_0x8e1a('0x32')](util[_0x8e1a('0x18')](_0x8e1a('0x47'),QUERY),{'type':dbH[_0x8e1a('0x2f')]['QueryTypes'][_0x8e1a('0x33')]});})['then'](extractReport)[_0x8e1a('0x48')](function(_0x38f9f1){logger[_0x8e1a('0x41')](util[_0x8e1a('0x18')](_0x8e1a('0x49'),EXTRACTED_REPORT_ID,_0x8e1a('0x43')),util[_0x8e1a('0x4a')](_0x38f9f1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x8e1a('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3846a1=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x8e1a('0x4c'),'italics':__dirname+_0x8e1a('0x4d'),'bolditalics':__dirname+_0x8e1a('0x4e')}});return _0x3846a1;}function getPDFDocDefinitionFromHTML(_0x388271,_0x3bb16d){var _0x4414a1=util[_0x8e1a('0x18')](_0x8e1a('0x4f'),_0x3bb16d['channel'],_0x3bb16d[_0x8e1a('0x50')]);var _0x9bff92=moment()[_0x8e1a('0x18')](_0x8e1a('0x51'))[_0x8e1a('0x22')]();var _0xe8da5f=htmlToPdfmake(_0x388271,{'window':window,'tableAutoSize':!![]});return{'content':[_0xe8da5f],'defaultStyle':{'font':_0x8e1a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8e1a('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8e1a('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x8e1a('0x53'),'style':_0x8e1a('0x1d')}];},'footer':function(_0x1d3819,_0x31479d){return[{'text':util[_0x8e1a('0x18')](_0x8e1a('0x54'),_0x4414a1,_0x1d3819,_0x31479d,_0x9bff92),'style':_0x8e1a('0x24')}];}};}function writePDFDocument(_0xf2558b,_0x1b6076){return new Promise(function(_0x1afbcb,_0x592c13){var _0x486b19=_0xf2558b[_0x8e1a('0x55')](fs[_0x8e1a('0x56')](_0x1b6076));_0x486b19['on'](_0x8e1a('0x57'),function(){_0x1afbcb(_0x8e1a('0x57'));});_0x486b19['on'](_0x8e1a('0x58'),function(_0x22ff74){_0x592c13(_0x22ff74);});_0xf2558b[_0x8e1a('0x59')]();});}exports[_0x8e1a('0x5a')]=function(_0x1490cd,_0x159421){var _0x4062ef=getPDFPrinter();var _0xf54943=getPDFDocDefinitionFromHTML(_0x1490cd,_0x159421);var _0x595c40=_0x4062ef[_0x8e1a('0x5b')](_0xf54943);return writePDFDocument(_0x595c40,_0x159421['path'])[_0x8e1a('0x48')](function(_0x3e251d){throw _0x3e251d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9e5b03e..15012fe 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 _0xd87d=['Failed','finally','exit','util','lodash','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','update','info','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','split','range','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','QueryTypes','basename','.xlsx','mkdirSync','join','each','length','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x579abe,_0x26f745){var _0x5b35f6=function(_0x1b8c08){while(--_0x1b8c08){_0x579abe['push'](_0x579abe['shift']());}};_0x5b35f6(++_0x26f745);}(_0xd87d,0x16b));var _0xdd87=function(_0x38ac49,_0x461ef4){_0x38ac49=_0x38ac49-0x0;var _0x5be48c=_0xd87d[_0x38ac49];return _0x5be48c;};'use strict';var util=require(_0xdd87('0x0'));var path=require('path');var _=require(_0xdd87('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xdd87('0x2'));var zipdir=require(_0xdd87('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xdd87('0x4'))[_0xdd87('0x5')];var logger=require('../../config/logger')(_0xdd87('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xdd87('0x7')][0x2]);var QUERY=process[_0xdd87('0x7')][0x3];var PATH=process[_0xdd87('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a4ee0,_0x57a2cb){var _0x368e34={'status':_0x2a4ee0};var _0x22f608={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57a2cb){_0x368e34['savename']=_0x57a2cb;}return db['AnalyticExtractedReport'][_0xdd87('0x8')](_0x368e34,_0x22f608);}function main(){var _0x271734=0x1388;var _0x11cd01;logger[_0xdd87('0x9')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xdd87('0xa')));return db[_0xdd87('0xb')][_0xdd87('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdd87('0xd')]})[_0xdd87('0xe')](function(_0x39b484){if(_0x39b484){_0x11cd01=_0x39b484;_0x271734=_0x11cd01[_0xdd87('0xd')]||0x1388;}})[_0xdd87('0xe')](function(){return dbH[_0xdd87('0xf')][_0xdd87('0x10')](util[_0xdd87('0x11')](_0xdd87('0x12'),QUERY),{'type':dbH[_0xdd87('0xf')]['QueryTypes'][_0xdd87('0x13')]});})[_0xdd87('0xe')](function(_0x25127a){if(!_0x25127a[0x0]['num']){return analyticExtractedReport('Empty');}var _0x5f4462=[];var _0x4fb84b=0x0;if(_0x11cd01[_0xdd87('0x14')]){if(_0x25127a&&_0x25127a['length']){var _0x3d99e4=_[_0xdd87('0x15')](_0x25127a[0x0][_0xdd87('0x16')]/_0x271734);var _0x20aaf8=Number['isInteger'](_0x25127a[0x0][_0xdd87('0x16')]/_0x271734)?_0x25127a[0x0]['num']%_0x271734:0x0;_0x3d99e4[_0xdd87('0x17')](function(_0x18b1c6){if(_0x18b1c6>0x0){_0x4fb84b+=_0x271734;}_0x5f4462['push'](dbH['sequelize'][_0xdd87('0x10')](util[_0xdd87('0x11')](_0xdd87('0x18'),QUERY,_0x271734,_0x4fb84b),{'type':dbH[_0xdd87('0xf')]['QueryTypes'][_0xdd87('0x13')]}));});if(_0x20aaf8>0x0){_0x4fb84b+=_0x271734;_0x5f4462[_0xdd87('0x19')](dbH['sequelize']['query'](util[_0xdd87('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20aaf8,_0x4fb84b),{'type':dbH['sequelize'][_0xdd87('0x1a')][_0xdd87('0x13')]}));}}}else{_0x5f4462[_0xdd87('0x19')](dbH[_0xdd87('0xf')][_0xdd87('0x10')](QUERY,{'type':dbH[_0xdd87('0xf')][_0xdd87('0x1a')][_0xdd87('0x13')]}));}var _0x5b6ab2=path['dirname'](PATH);var _0x183502=path[_0xdd87('0x1b')](PATH,_0xdd87('0x1c'));var _0x1c30e7=_0x11cd01[_0xdd87('0x14')]&&_0x5f4462['length']>0x1;var _0x191fe6=[];if(!fs['existsSync'](path['join'](_0x5b6ab2,_0x183502))&&_0x1c30e7){fs[_0xdd87('0x1d')](path[_0xdd87('0x1e')](_0x5b6ab2,_0x183502));}return BPromise[_0xdd87('0x1f')](_0x5f4462,function(_0x500c93){_0x191fe6[_0xdd87('0x19')](_0x500c93);})['then'](function(){for(var _0x1932c6=0x0;_0x1932c6<_0x191fe6[_0xdd87('0x20')];_0x1932c6+=0x1){var _0x164222;var _0x4ce6c4=_0x191fe6[_0x1932c6];if(_0x1c30e7){_0x164222=path['join'](_0x5b6ab2,_0x183502,util[_0xdd87('0x11')](_0xdd87('0x21'),_0x183502,_0x1932c6,_0xdd87('0x22')));}else{_0x164222=path[_0xdd87('0x1e')](_0x5b6ab2,util[_0xdd87('0x11')](_0xdd87('0x23'),_0x183502,_0xdd87('0x22')));}fs[_0xdd87('0x24')](_0x164222,json2xls(_0x4ce6c4),'binary');}})[_0xdd87('0xe')](function(){if(_0x1c30e7){return new Promise(function(_0x71ba1c){zipdir(path[_0xdd87('0x1e')](_0x5b6ab2,_0x183502),{'saveTo':path[_0xdd87('0x1e')](_0x5b6ab2,util['format'](_0xdd87('0x23'),_0x183502,_0xdd87('0x25')))},function(_0x57bcd2,_0x2de53c){rimraf(path[_0xdd87('0x1e')](_0x5b6ab2,_0x183502),function(){});_0x71ba1c('zip\x20finished');});});}})[_0xdd87('0xe')](function(){logger[_0xdd87('0x9')](util[_0xdd87('0x11')](_0xdd87('0x26'),EXTRACTED_REPORT_ID,_0xdd87('0xa')));return analyticExtractedReport(_0xdd87('0x27'),_0x1c30e7?util[_0xdd87('0x11')](_0xdd87('0x23'),_0x183502,_0x1c30e7?'zip':_0xdd87('0x22')):null);});})[_0xdd87('0x28')](function(_0x13e07b){logger[_0xdd87('0x9')](util['format'](_0xdd87('0x29'),EXTRACTED_REPORT_ID,_0xdd87('0xa')),util['inspect'](_0x13e07b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdd87('0x2a'));})[_0xdd87('0x2b')](function(){process[_0xdd87('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc283=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','sequelize','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip'];(function(_0x45c459,_0x3b760a){var _0x2af29a=function(_0x2f7791){while(--_0x2f7791){_0x45c459['push'](_0x45c459['shift']());}};_0x2af29a(++_0x3b760a);}(_0xc283,0x17f));var _0x3c28=function(_0x3bf798,_0x240070){_0x3bf798=_0x3bf798-0x0;var _0x536c6d=_0xc283[_0x3bf798];return _0x536c6d;};'use strict';var util=require(_0x3c28('0x0'));var path=require(_0x3c28('0x1'));var _=require(_0x3c28('0x2'));var fs=require('fs');var json2xls=require(_0x3c28('0x3'));var BPromise=require(_0x3c28('0x4'));var zipdir=require(_0x3c28('0x5'));var rimraf=require(_0x3c28('0x6'));var db=require(_0x3c28('0x7'))['db'];var dbH=require('../../mysqldb')[_0x3c28('0x8')];var logger=require('../../config/logger')(_0x3c28('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x3c28('0xa')][0x2]);var QUERY=process[_0x3c28('0xa')][0x3];var PATH=process[_0x3c28('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x585fb8,_0x51cce0){var _0x44ae7b={'status':_0x585fb8};var _0x21062e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51cce0){_0x44ae7b[_0x3c28('0xb')]=_0x51cce0;}return db[_0x3c28('0xc')]['update'](_0x44ae7b,_0x21062e);}function main(){var _0x1a2542=0x1388;var _0x279672;logger['info'](util[_0x3c28('0xd')](_0x3c28('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x3c28('0xf')][_0x3c28('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3c28('0x11'),'splitSizeXlsx']})[_0x3c28('0x12')](function(_0x5386ca){if(_0x5386ca){_0x279672=_0x5386ca;_0x1a2542=_0x279672[_0x3c28('0x13')]||0x1388;}})[_0x3c28('0x12')](function(){return dbH['sequelize'][_0x3c28('0x14')](util[_0x3c28('0xd')](_0x3c28('0x15'),QUERY),{'type':dbH['sequelize'][_0x3c28('0x16')]['SELECT']});})[_0x3c28('0x12')](function(_0x4b9636){if(!_0x4b9636[0x0][_0x3c28('0x17')]){return analyticExtractedReport(_0x3c28('0x18'));}var _0x1aa6e6=[];var _0x4e1b0e=0x0;if(_0x279672['split']){if(_0x4b9636&&_0x4b9636[_0x3c28('0x19')]){var _0x364aed=_[_0x3c28('0x1a')](_0x4b9636[0x0]['num']/_0x1a2542);var _0x3e967e=Number[_0x3c28('0x1b')](_0x4b9636[0x0][_0x3c28('0x17')]/_0x1a2542)?_0x4b9636[0x0]['num']%_0x1a2542:0x0;_0x364aed[_0x3c28('0x1c')](function(_0x26503d){if(_0x26503d>0x0){_0x4e1b0e+=_0x1a2542;}_0x1aa6e6['push'](dbH[_0x3c28('0x1d')][_0x3c28('0x14')](util[_0x3c28('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1a2542,_0x4e1b0e),{'type':dbH[_0x3c28('0x1d')]['QueryTypes'][_0x3c28('0x1e')]}));});if(_0x3e967e>0x0){_0x4e1b0e+=_0x1a2542;_0x1aa6e6[_0x3c28('0x1f')](dbH[_0x3c28('0x1d')][_0x3c28('0x14')](util[_0x3c28('0xd')](_0x3c28('0x20'),QUERY,_0x3e967e,_0x4e1b0e),{'type':dbH[_0x3c28('0x1d')]['QueryTypes'][_0x3c28('0x1e')]}));}}}else{_0x1aa6e6[_0x3c28('0x1f')](dbH[_0x3c28('0x1d')][_0x3c28('0x14')](QUERY,{'type':dbH[_0x3c28('0x1d')]['QueryTypes'][_0x3c28('0x1e')]}));}var _0xbe8df=path[_0x3c28('0x21')](PATH);var _0x232a88=path[_0x3c28('0x22')](PATH,_0x3c28('0x23'));var _0x57a09e=_0x279672['split']&&_0x1aa6e6[_0x3c28('0x19')]>0x1;var _0x1b70df=[];if(!fs['existsSync'](path[_0x3c28('0x24')](_0xbe8df,_0x232a88))&&_0x57a09e){fs[_0x3c28('0x25')](path['join'](_0xbe8df,_0x232a88));}return BPromise[_0x3c28('0x26')](_0x1aa6e6,function(_0x57d3aa){_0x1b70df[_0x3c28('0x1f')](_0x57d3aa);})[_0x3c28('0x12')](function(){for(var _0x21d343=0x0;_0x21d343<_0x1b70df['length'];_0x21d343+=0x1){var _0x3a9047;var _0x4f25ea=_0x1b70df[_0x21d343];if(_0x57a09e){_0x3a9047=path[_0x3c28('0x24')](_0xbe8df,_0x232a88,util[_0x3c28('0xd')](_0x3c28('0x27'),_0x232a88,_0x21d343,_0x3c28('0x28')));}else{_0x3a9047=path[_0x3c28('0x24')](_0xbe8df,util[_0x3c28('0xd')](_0x3c28('0x29'),_0x232a88,'xlsx'));}fs[_0x3c28('0x2a')](_0x3a9047,json2xls(_0x4f25ea),_0x3c28('0x2b'));}})[_0x3c28('0x12')](function(){if(_0x57a09e){return new Promise(function(_0x451824){zipdir(path[_0x3c28('0x24')](_0xbe8df,_0x232a88),{'saveTo':path[_0x3c28('0x24')](_0xbe8df,util[_0x3c28('0xd')](_0x3c28('0x29'),_0x232a88,'zip'))},function(_0x2ddbb7,_0x324a6a){rimraf(path[_0x3c28('0x24')](_0xbe8df,_0x232a88),function(){});_0x451824('zip\x20finished');});});}})[_0x3c28('0x12')](function(){logger[_0x3c28('0x2c')](util['format'](_0x3c28('0x2d'),EXTRACTED_REPORT_ID,_0x3c28('0x2e')));return analyticExtractedReport(_0x3c28('0x2f'),_0x57a09e?util['format'](_0x3c28('0x29'),_0x232a88,_0x57a09e?_0x3c28('0x30'):_0x3c28('0x28')):null);});})['catch'](function(_0x1f67bd){logger[_0x3c28('0x2c')](util[_0x3c28('0xd')](_0x3c28('0x31'),EXTRACTED_REPORT_ID,_0x3c28('0x2e')),util[_0x3c28('0x32')](_0x1f67bd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3c28('0x33'));})[_0x3c28('0x34')](function(){process[_0x3c28('0x35')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index cc544af..62d9bdb 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 _0xf4a7=['findAll','then','intervals','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','hasOwnProperty','priority','extensions','find','push','Set','format','CDR(type)=%s','type','VoiceExtensionId','inbound','context','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','$[${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)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','sortBy','catch','error','rewrite','lodash','models','Interval'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xf4a7,0x95));var _0x7f4a=function(_0x46a7fe,_0x3e2038){_0x46a7fe=_0x46a7fe-0x0;var _0x586abc=_0xf4a7[_0x46a7fe];return _0x586abc;};'use strict';var _=require(_0x7f4a('0x0'));var util=require('util');function rewrite(_0x3ea833,_0x1e1c5f){var _0x57c88e=this;return _0x3ea833[_0x7f4a('0x1')][_0x7f4a('0x2')][_0x7f4a('0x3')]({'raw':!![]})[_0x7f4a('0x4')](function(_0x5b2e50){_0x57c88e[_0x7f4a('0x5')]=_0x5b2e50;return _0x3ea833[_0x7f4a('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x1e1c5f[_0x7f4a('0x6')]},'raw':!![]});})[_0x7f4a('0x4')](function(_0xf979ed){return _0x3ea833['models']['VoiceExtension'][_0x7f4a('0x3')]({'where':{'exten':{'$in':_[_0x7f4a('0x7')](_[_0x7f4a('0x8')](_0xf979ed,_0x7f4a('0x9')))}},'order':[{'raw':_0x7f4a('0xa')}],'raw':!![]});})['then'](function(_0x407223){var _0x3fa5c4=_['filter'](_0x407223,{'priority':'1'});var _0x4c64db=_['filter'](_0x407223,{'isApp':0x1});var _0x2da9b3=_[_0x7f4a('0xb')](_0x4c64db,_0x7f4a('0x9'));var _0x11b57c=[_0x7f4a('0xc'),'playback'];var _0x4754e8=[];var _0x270388=[];for(var _0x20cfcd in _0x2da9b3){if(_0x2da9b3[_0x7f4a('0xd')](_0x20cfcd)){_0x57c88e[_0x7f4a('0xe')]=0x2;_0x57c88e[_0x7f4a('0xf')]=[];_0x57c88e['extension']=_[_0x7f4a('0x10')](_0x3fa5c4,{'exten':_0x2da9b3[_0x20cfcd][0x0]['exten']});_0x57c88e['extensions'][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0]['type'],'app':_0x7f4a('0x12'),'appdata':util[_0x7f4a('0x13')](_0x7f4a('0x14'),_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')]),'context':_0x2da9b3[_0x20cfcd][0x0]['context'],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e[_0x7f4a('0xe')]++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});if(_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')]===_0x7f4a('0x17')){_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':'Set','appdata':'CDR(routeid)='+_0x2da9b3[_0x20cfcd][0x0]['VoiceExtensionId'],'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e['priority']++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});}else if(_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')]==='outbound'){if(_0x57c88e[_0x7f4a('0x19')]){_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x1a')+(_0x57c88e[_0x7f4a('0x19')][_0x7f4a('0x1b')]?_0x7f4a('0x1c')+_0x57c88e[_0x7f4a('0x19')]['cutdigits']+'}':_0x7f4a('0x1d')),'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e['priority']++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0]['VoiceExtensionId']});}_0x57c88e[_0x7f4a('0xf')]['push']({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x1e')+_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')],'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e[_0x7f4a('0xe')]++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});var _0x5f323b=_0x57c88e[_0x7f4a('0xe')]++;_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5f323b+0x2)+_0x7f4a('0x20')+(_0x5f323b+0x1)+')','context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0]['exten'],'priority':_0x5f323b,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});if(_0x57c88e[_0x7f4a('0x19')]){_0x57c88e['extensions'][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':'Set','appdata':_0x57c88e[_0x7f4a('0x19')]['cutdigits']?_0x7f4a('0x21')+_0x57c88e[_0x7f4a('0x19')][_0x7f4a('0x1b')]+'}':_0x7f4a('0x22'),'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e[_0x7f4a('0xe')]++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});}_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':'outboundrouteid='+_0x2da9b3[_0x20cfcd][0x0]['VoiceExtensionId'],'context':_0x2da9b3[_0x20cfcd][0x0]['context'],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e['priority']++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});if(_0x57c88e[_0x7f4a('0x19')]&&_0x57c88e[_0x7f4a('0x19')]['hasOwnProperty'](_0x7f4a('0x23'))&&_0x57c88e[_0x7f4a('0x19')][_0x7f4a('0x23')]!==_0x7f4a('0x24')){_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':'Set','appdata':_0x7f4a('0x25'),'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0]['exten'],'priority':_0x57c88e['priority']++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0]['type'],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x26')+_0x57c88e[_0x7f4a('0x19')][_0x7f4a('0x23')]||_0x7f4a('0x27'),'context':_0x2da9b3[_0x20cfcd][0x0]['context'],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e[_0x7f4a('0xe')]++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});}}_0x57c88e[_0x7f4a('0xf')]['push']({'type':_0x2da9b3[_0x20cfcd][0x0]['type'],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x28'),'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e['priority']++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x29'),'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e[_0x7f4a('0xe')]++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});_0x57c88e['extensions'][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x2a'),'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'exten':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x9')],'priority':_0x57c88e[_0x7f4a('0xe')]++,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});for(var _0x3066fe=0x0,_0x34a1b0=0x0;_0x3066fe<_0x2da9b3[_0x20cfcd][_0x7f4a('0x2b')];_0x3066fe+=0x1,_0x34a1b0=0x0){var _0x41c4f7=_0x2da9b3[_0x20cfcd][_0x3066fe];if(_0x41c4f7[_0x7f4a('0x15')]){_0x41c4f7[_0x7f4a('0x15')]=_0x41c4f7[_0x7f4a('0x15')][_0x7f4a('0x2c')]();}var _0x3c8df5=[];var _0x223c74=[];delete _0x41c4f7['id'];delete _0x41c4f7[_0x7f4a('0x2d')];delete _0x41c4f7[_0x7f4a('0x2e')];var _0x146601=_0x41c4f7[_0x7f4a('0x2f')]!==_0x7f4a('0x30')?[_0x41c4f7['interval']]:_0x41c4f7['IntervalId']?_[_0x7f4a('0x8')](_['filter'](_0x57c88e[_0x7f4a('0x5')],{'IntervalId':_0x41c4f7[_0x7f4a('0x6')]}),_0x7f4a('0x2f')):[];if(_0x41c4f7['hasOwnProperty']('tag')){if(_0x41c4f7[_0x7f4a('0x31')]&&_0x41c4f7[_0x7f4a('0x31')]!=='--'){_0x3c8df5[_0x7f4a('0x11')]({'type':_0x41c4f7[_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x32')+_0x41c4f7[_0x7f4a('0x31')],'context':_0x41c4f7[_0x7f4a('0x18')],'exten':_0x41c4f7[_0x7f4a('0x9')],'priority':_0x146601[_0x7f4a('0x2b')]+_0x57c88e['priority']+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});}}if(_0x41c4f7[_0x7f4a('0x15')]==='outbound'&&_0x41c4f7[_0x7f4a('0xd')]('callerID')){if(_0x41c4f7['callerID']){_0x3c8df5[_0x7f4a('0x11')]({'type':_0x41c4f7[_0x7f4a('0x15')],'app':_0x7f4a('0x1f'),'appdata':_0x7f4a('0x33')+_0x41c4f7[_0x7f4a('0x34')]+')','context':_0x41c4f7[_0x7f4a('0x18')],'exten':_0x41c4f7[_0x7f4a('0x9')],'priority':_0x146601[_0x7f4a('0x2b')]+_0x57c88e[_0x7f4a('0xe')]+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});}else{_0x3c8df5[_0x7f4a('0x11')]({'type':_0x41c4f7['type'],'app':_0x7f4a('0x1f'),'appdata':_0x7f4a('0x35'),'context':_0x41c4f7[_0x7f4a('0x18')],'exten':_0x41c4f7[_0x7f4a('0x9')],'priority':_0x146601[_0x7f4a('0x2b')]+_0x57c88e['priority']+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});}}if(_0x41c4f7[_0x7f4a('0xd')](_0x7f4a('0x36'))){if(_0x11b57c[_0x7f4a('0x37')](_0x41c4f7[_0x7f4a('0x38')][_0x7f4a('0x2c')]())>=0x0&&_0x41c4f7[_0x7f4a('0x39')]!==_0x7f4a('0x3a')){if(_0x41c4f7[_0x7f4a('0x36')]){_0x3c8df5[_0x7f4a('0x11')]({'type':_0x41c4f7['type'],'app':'ExecIf','appdata':_0x7f4a('0x3b'),'context':_0x41c4f7['context'],'exten':_0x41c4f7[_0x7f4a('0x9')],'priority':_0x146601[_0x7f4a('0x2b')]+_0x57c88e['priority']+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});_0x3c8df5[_0x7f4a('0x11')]({'type':_0x41c4f7[_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x3c'),'context':_0x41c4f7[_0x7f4a('0x18')],'exten':_0x41c4f7[_0x7f4a('0x9')],'priority':_0x146601[_0x7f4a('0x2b')]+_0x57c88e[_0x7f4a('0xe')]+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});}else{_0x3c8df5['push']({'type':_0x41c4f7[_0x7f4a('0x15')],'app':'ExecIf','appdata':_0x7f4a('0x3d'),'context':_0x41c4f7[_0x7f4a('0x18')],'exten':_0x41c4f7[_0x7f4a('0x9')],'priority':_0x146601[_0x7f4a('0x2b')]+_0x57c88e[_0x7f4a('0xe')]+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});_0x3c8df5[_0x7f4a('0x11')]({'type':_0x41c4f7[_0x7f4a('0x15')],'app':_0x7f4a('0x12'),'appdata':_0x7f4a('0x3e'),'context':_0x41c4f7['context'],'exten':_0x41c4f7['exten'],'priority':_0x146601['length']+_0x57c88e[_0x7f4a('0xe')]+_0x34a1b0++,'VoiceExtensionId':_0x41c4f7[_0x7f4a('0x16')]});}}}for(var _0x11539c=0x0;_0x11539c<_0x146601[_0x7f4a('0x2b')];_0x11539c+=0x1){var _0x14af48=_0x57c88e['priority']+_0x146601[_0x7f4a('0x2b')];var _0xe3d7a3=_0x11539c===_0x146601['length']-0x1?_0x57c88e['priority']+_0x3c8df5[_0x7f4a('0x2b')]+_0x223c74[_0x7f4a('0x2b')]+0x2:_0x57c88e[_0x7f4a('0xe')]+_0x11539c+0x1;_0x3c8df5[_0x7f4a('0x3f')](_0x11539c,0x0,{'type':_0x41c4f7[_0x7f4a('0x15')],'app':_0x7f4a('0x40'),'appdata':_0x146601[_0x11539c]+'?'+_0x41c4f7[_0x7f4a('0x18')]+_0x7f4a('0x41')+_0x14af48+':'+_0x41c4f7['context']+',${EXTEN},'+_0xe3d7a3,'exten':_0x41c4f7[_0x7f4a('0x9')],'context':_0x41c4f7[_0x7f4a('0x18')],'priority':_0x57c88e[_0x7f4a('0xe')]+_0x11539c,'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0]['VoiceExtensionId']});}_0x41c4f7[_0x7f4a('0xe')]=_0x3c8df5[_0x7f4a('0x2b')]?_[_0x7f4a('0x42')](_0x3c8df5)['priority']+0x1:_0x57c88e[_0x7f4a('0xe')];_0x57c88e[_0x7f4a('0xe')]=(_0x223c74[_0x7f4a('0x2b')]?_[_0x7f4a('0x42')](_0x223c74)[_0x7f4a('0xe')]:_0x41c4f7[_0x7f4a('0xe')])+0x1;_0x57c88e['extensions']=_[_0x7f4a('0x43')](_0x57c88e[_0x7f4a('0xf')],_0x3c8df5,[_0x41c4f7],_0x223c74);}_0x57c88e[_0x7f4a('0xf')][_0x7f4a('0x11')]({'type':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x15')],'app':_0x7f4a('0x44'),'exten':_0x2da9b3[_0x20cfcd][0x0]['exten'],'context':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x18')],'priority':_0x57c88e['priority'],'VoiceExtensionId':_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]});_0x4754e8[_0x7f4a('0x11')](_0x2da9b3[_0x20cfcd][0x0][_0x7f4a('0x16')]);_0x270388=_[_0x7f4a('0x43')](_0x270388,_0x57c88e[_0x7f4a('0xf')]);}}return _0x3ea833[_0x7f4a('0x45')](function(_0x38e3c8){return _0x3ea833[_0x7f4a('0x1')][_0x7f4a('0x46')][_0x7f4a('0x47')]({'where':{'VoiceExtensionId':{'$in':_0x4754e8}},'transaction':_0x38e3c8})[_0x7f4a('0x4')](function(_0x31203b){return _0x3ea833[_0x7f4a('0x1')][_0x7f4a('0x46')]['bulkCreate'](_[_0x7f4a('0x48')](_0x270388,_0x7f4a('0xe')),{'transaction':_0x38e3c8});});});})[_0x7f4a('0x49')](function(_0x108a21){console[_0x7f4a('0x4a')](_0x108a21);});}exports[_0x7f4a('0x4b')]=rewrite; \ No newline at end of file +var _0x6764=['exten','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','type','format','CDR(type)=%s','context','priority','inbound','Set','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','createdAt','updatedAt','interval','*,*,*,*','map','IntervalId','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq'];(function(_0x29eae1,_0x263fec){var _0x5aac45=function(_0x3121ec){while(--_0x3121ec){_0x29eae1['push'](_0x29eae1['shift']());}};_0x5aac45(++_0x263fec);}(_0x6764,0x196));var _0x4676=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6764[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x4676('0x0'));function rewrite(_0x45018c,_0x13eff4){var _0x510a7a=this;return _0x45018c[_0x4676('0x1')][_0x4676('0x2')][_0x4676('0x3')]({'raw':!![]})[_0x4676('0x4')](function(_0x45157d){_0x510a7a[_0x4676('0x5')]=_0x45157d;return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x3')]({'where':{'IntervalId':_0x13eff4['IntervalId']},'raw':!![]});})[_0x4676('0x4')](function(_0x88c364){return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x3')]({'where':{'exten':{'$in':_[_0x4676('0x7')](_['map'](_0x88c364,_0x4676('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x4676('0x4')](function(_0x28682d){var _0x50159b=_[_0x4676('0x9')](_0x28682d,{'priority':'1'});var _0x9584cf=_[_0x4676('0x9')](_0x28682d,{'isApp':0x1});var _0x39c83c=_[_0x4676('0xa')](_0x9584cf,'exten');var _0x3c5f36=[_0x4676('0xb'),_0x4676('0xc')];var _0x140d76=[];var _0x335ff7=[];for(var _0x57dbda in _0x39c83c){if(_0x39c83c[_0x4676('0xd')](_0x57dbda)){_0x510a7a['priority']=0x2;_0x510a7a[_0x4676('0xe')]=[];_0x510a7a[_0x4676('0xf')]=_[_0x4676('0x10')](_0x50159b,{'exten':_0x39c83c[_0x57dbda][0x0]['exten']});_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Set','appdata':util[_0x4676('0x13')](_0x4676('0x14'),_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')]),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']});if(_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')]===_0x4676('0x17')){_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':'CDR(routeid)='+_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a['priority']++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}else if(_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')]===_0x4676('0x1a')){if(_0x510a7a[_0x4676('0xf')]){_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':_0x4676('0x1b')+(_0x510a7a[_0x4676('0xf')]['cutdigits']?_0x4676('0x1c')+_0x510a7a[_0x4676('0xf')][_0x4676('0x1d')]+'}':_0x4676('0x1e')),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Set','appdata':_0x4676('0x1f')+_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId'],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});var _0x5850ac=_0x510a7a[_0x4676('0x16')]++;_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5850ac+0x2)+_0x4676('0x21')+(_0x5850ac+0x1)+')','context':_0x39c83c[_0x57dbda][0x0]['context'],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x5850ac,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']});if(_0x510a7a[_0x4676('0xf')]){_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':_0x510a7a['extension'][_0x4676('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x510a7a[_0x4676('0xf')]['cutdigits']+'}':_0x4676('0x22'),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':'outboundrouteid='+_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId'],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a['priority']++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});if(_0x510a7a['extension']&&_0x510a7a[_0x4676('0xf')]['hasOwnProperty'](_0x4676('0x23'))&&_0x510a7a[_0x4676('0xf')][_0x4676('0x23')]!==_0x4676('0x24')){_0x510a7a['extensions'][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':'Set','appdata':_0x4676('0x25'),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']});_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':_0x4676('0x26')+_0x510a7a['extension'][_0x4676('0x23')]||'wav','context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a['priority']++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}}_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':_0x4676('0x27'),'context':_0x39c83c[_0x57dbda][0x0]['context'],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Set','appdata':_0x4676('0x28'),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});_0x510a7a['extensions'][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':'MONITOR_OPTIONS=ab','context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});for(var _0x58d2fe=0x0,_0x4eaa7b=0x0;_0x58d2fe<_0x39c83c[_0x57dbda]['length'];_0x58d2fe+=0x1,_0x4eaa7b=0x0){var _0x4a65f8=_0x39c83c[_0x57dbda][_0x58d2fe];if(_0x4a65f8[_0x4676('0x12')]){_0x4a65f8[_0x4676('0x12')]=_0x4a65f8[_0x4676('0x12')]['toLowerCase']();}var _0x413a20=[];var _0x3d04b5=[];delete _0x4a65f8['id'];delete _0x4a65f8[_0x4676('0x29')];delete _0x4a65f8[_0x4676('0x2a')];var _0x2c9390=_0x4a65f8[_0x4676('0x2b')]!==_0x4676('0x2c')?[_0x4a65f8[_0x4676('0x2b')]]:_0x4a65f8['IntervalId']?_[_0x4676('0x2d')](_[_0x4676('0x9')](_0x510a7a['intervals'],{'IntervalId':_0x4a65f8[_0x4676('0x2e')]}),_0x4676('0x2b')):[];if(_0x4a65f8[_0x4676('0xd')](_0x4676('0x2f'))){if(_0x4a65f8[_0x4676('0x2f')]&&_0x4a65f8['tag']!=='--'){_0x413a20['push']({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':_0x4676('0x30')+_0x4a65f8[_0x4676('0x2f')],'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}}if(_0x4a65f8[_0x4676('0x12')]===_0x4676('0x1a')&&_0x4a65f8[_0x4676('0xd')]('callerID')){if(_0x4a65f8['callerID']){_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x4a65f8[_0x4676('0x32')]+')','context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8['exten'],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}else{_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':_0x4676('0x33'),'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8[_0x4676('0x19')]});}}if(_0x4a65f8[_0x4676('0xd')](_0x4676('0x34'))){if(_0x3c5f36['indexOf'](_0x4a65f8['app'][_0x4676('0x35')]())>=0x0&&_0x4a65f8[_0x4676('0x36')]!==_0x4676('0x37')){if(_0x4a65f8[_0x4676('0x34')]){_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':_0x4676('0x38'),'context':_0x4a65f8['context'],'exten':_0x4a65f8['exten'],'priority':_0x2c9390['length']+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8[_0x4676('0x19')]});_0x413a20['push']({'type':_0x4a65f8['type'],'app':_0x4676('0x18'),'appdata':_0x4676('0x39'),'context':_0x4a65f8['context'],'exten':_0x4a65f8['exten'],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}else{_0x413a20['push']({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':_0x4676('0x3a'),'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390['length']+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8['type'],'app':'Set','appdata':_0x4676('0x3b'),'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}}}for(var _0x5e8b5=0x0;_0x5e8b5<_0x2c9390[_0x4676('0x31')];_0x5e8b5+=0x1){var _0x49db4f=_0x510a7a[_0x4676('0x16')]+_0x2c9390['length'];var _0x587692=_0x5e8b5===_0x2c9390[_0x4676('0x31')]-0x1?_0x510a7a[_0x4676('0x16')]+_0x413a20[_0x4676('0x31')]+_0x3d04b5[_0x4676('0x31')]+0x2:_0x510a7a[_0x4676('0x16')]+_0x5e8b5+0x1;_0x413a20[_0x4676('0x3c')](_0x5e8b5,0x0,{'type':_0x4a65f8['type'],'app':'GotoIfTime','appdata':_0x2c9390[_0x5e8b5]+'?'+_0x4a65f8[_0x4676('0x15')]+_0x4676('0x3d')+_0x49db4f+':'+_0x4a65f8[_0x4676('0x15')]+_0x4676('0x3d')+_0x587692,'exten':_0x4a65f8[_0x4676('0x8')],'context':_0x4a65f8[_0x4676('0x15')],'priority':_0x510a7a[_0x4676('0x16')]+_0x5e8b5,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}_0x4a65f8[_0x4676('0x16')]=_0x413a20[_0x4676('0x31')]?_[_0x4676('0x3e')](_0x413a20)['priority']+0x1:_0x510a7a['priority'];_0x510a7a[_0x4676('0x16')]=(_0x3d04b5[_0x4676('0x31')]?_['last'](_0x3d04b5)[_0x4676('0x16')]:_0x4a65f8['priority'])+0x1;_0x510a7a[_0x4676('0xe')]=_[_0x4676('0x3f')](_0x510a7a[_0x4676('0xe')],_0x413a20,[_0x4a65f8],_0x3d04b5);}_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Hangup','exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'priority':_0x510a7a['priority'],'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});_0x140d76[_0x4676('0x11')](_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']);_0x335ff7=_[_0x4676('0x3f')](_0x335ff7,_0x510a7a[_0x4676('0xe')]);}}return _0x45018c['transaction'](function(_0x5cf00e){return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x140d76}},'transaction':_0x5cf00e})[_0x4676('0x4')](function(_0x2fa3b2){return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x41')](_[_0x4676('0x42')](_0x335ff7,'priority'),{'transaction':_0x5cf00e});});});})['catch'](function(_0x40ffb1){console[_0x4676('0x43')](_0x40ffb1);});}exports[_0x4676('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 7688d56..f390cf8 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 _0x23c5=['CmContact','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','ContactId','createdAt','select','field','NOW()','scheduledAt','toString','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','\x20=\x20?','insert','fromQuery','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueue','dialCheckDuplicateType','CmList','Lists','get','always','push','then','onlyIfOpen','sequelize','query','VoiceQueueId','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact'];(function(_0x5e271e,_0x167577){var _0x30afa5=function(_0x423f6b){while(--_0x423f6b){_0x5e271e['push'](_0x5e271e['shift']());}};_0x30afa5(++_0x167577);}(_0x23c5,0x11e));var _0x523c=function(_0x3c2140,_0x5d4bda){_0x3c2140=_0x3c2140-0x0;var _0x1e7568=_0x23c5[_0x3c2140];return _0x1e7568;};'use strict';var BPromise=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x523c('0x2'));var Papa=require(_0x523c('0x3'));var Redis=require('ioredis');var db=require(_0x523c('0x4'))['db'];var config=require(_0x523c('0x5'));var logger=require(_0x523c('0x6'))('api');config[_0x523c('0x7')]=_[_0x523c('0x8')](config[_0x523c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x523c('0x9'))(new Redis(config[_0x523c('0x7')]));require(_0x523c('0xa'))['register'](socket);try{if(!process[_0x523c('0xb')][0x2]||process[_0x523c('0xb')][0x2]===_0x523c('0xc')||process[_0x523c('0xb')][0x2]==='null'){throw new Error(_0x523c('0xd'));}var FILEPATH=process[_0x523c('0xb')][0x2];if(!process[_0x523c('0xb')][0x3]||process[_0x523c('0xb')][0x3]===_0x523c('0xc')||process['argv'][0x3]==='null'||!process[_0x523c('0xb')][0x4]||process['argv'][0x4]===_0x523c('0xc')||process[_0x523c('0xb')][0x4]===_0x523c('0xe')){throw new Error(_0x523c('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x523c('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x523c('0xb')][0x5]||process['argv'][0x5]===_0x523c('0xc')||process[_0x523c('0xb')][0x5]==='null'){throw new Error(_0x523c('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x523c('0xb')][0x6]&&process[_0x523c('0xb')][0x6]!==_0x523c('0xc')&&process[_0x523c('0xb')][0x6]!==_0x523c('0xe')?process[_0x523c('0xb')][0x6]:null;var DUPLICATES=process[_0x523c('0xb')][0x7]&&process[_0x523c('0xb')][0x7]!==_0x523c('0xc')&&process[_0x523c('0xb')][0x7]!==_0x523c('0xe')?process[_0x523c('0xb')][0x7]:null;if(!process[_0x523c('0xb')][0x8]||process[_0x523c('0xb')][0x8]===_0x523c('0xc')||process[_0x523c('0xb')][0x8]===_0x523c('0xe')){throw new Error(_0x523c('0x12'));}var SOCKET_TIMESTAMP=process[_0x523c('0xb')][0x8];}catch(_0x3ce659){logger[_0x523c('0x13')](_0x3ce659);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(_0xa86a9c,_0x2c97eb,_0xa518ba,_0x7ff6b){var _0x3e4750={'message':_0x2c97eb};_0x3e4750[_0xa86a9c]=!![];if(_0xa518ba){_0x3e4750[_0x523c('0x14')]=_0xa518ba;}if(_0x7ff6b){_0x3e4750[_0x523c('0x15')]=_0x7ff6b;}return _0x3e4750;}function isEmail(_0x11465c){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'](_0x11465c);}function checkRow(_0x1ffa76,_0x48e36a,_0x5e216e){return new BPromise(function(_0x5328a3,_0x2c12b2){if(_[_0x523c('0x16')](_0x1ffa76)){return _0x2c12b2(handleCheckRowError('error',_0x523c('0x17'),null,_0x5e216e));}if(_0x1ffa76[_0x523c('0x18')]&&_0x1ffa76[_0x523c('0x18')][_0x523c('0x19')]){var _0x1ef042=_[_0x523c('0x1a')](_0x1ffa76[_0x523c('0x18')],_0x523c('0x1b'))[_0x523c('0x1c')](';');return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),_0x1ef042,null,_0x5e216e));}var _0x10da43={};for(var _0x3b0c10 in FIELDS){if(FIELDS[_0x523c('0x1d')](_0x3b0c10)&&FIELDS[_0x3b0c10]){_0x10da43[_0x3b0c10]=_0x1ffa76['data'][0x0][FIELDS[_0x3b0c10]]||_0x1ffa76[_0x523c('0x1e')][0x0]['\ufeff'+FIELDS[_0x3b0c10]];}}if(!_0x10da43[_0x523c('0x1f')]){return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),'firstName\x20not\x20specified!',null,_0x5e216e));}if(!_0x10da43[_0x523c('0x20')]){return _0x2c12b2(handleCheckRowError('error',_0x523c('0x21'),null,_0x5e216e));}if(_0x10da43[_0x523c('0x22')]){var _0xaaf22e=moment(_0x10da43['birthDate'],_0x523c('0x23'));if(!_0xaaf22e[_0x523c('0x24')]()){return _0x2c12b2(handleCheckRowError('error',_0x523c('0x25'),null,_0x5e216e));}}if(_0x10da43[_0x523c('0x26')]){if(!isEmail(_0x10da43[_0x523c('0x26')])){return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x5e216e));}}_0x10da43[_0x523c('0x27')]=LISTID;_0x10da43[_0x523c('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x48e36a){var _0x359831={};for(var _0x34d1fb=0x0,_0x5a733d=DUPLICATES['length'];_0x34d1fb<_0x5a733d;_0x34d1fb+=0x1){_0x359831[DUPLICATES[_0x34d1fb]]=_0x10da43[DUPLICATES[_0x34d1fb]];}var _0x5232f4=_[_0x523c('0x29')](_0x48e36a,_0x359831);if(_0x5232f4){return _0x2c12b2(handleCheckRowError(_0x523c('0x2a'),_0x523c('0x2b'),_0x5232f4,_0x5e216e));}}return db[_0x523c('0x2c')][_0x523c('0x2d')](_0x10da43,{'raw':!![],'hooks':![],'fields':_[_0x523c('0x2e')](_0x10da43)})['then'](function(_0x10f330){if(DUPLICATES&&DUPLICATES[_0x523c('0x19')]&&_0x48e36a){_0x48e36a['push'](_[_0x523c('0x2f')](_0x10da43,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x10f330['id'];return _0x5328a3();})[_0x523c('0x30')](function(_0x5c357f){return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),_0x523c('0x31')+(_0x5c357f[_0x523c('0x1b')]||JSON[_0x523c('0x32')](_0x5c357f)),null,_0x5e216e));});});}function checkHopper(){function _0x3309f1(){return function(_0x15894d){logger[_0x523c('0x13')](_0x523c('0x33'),_0x523c('0x34'),util[_0x523c('0x35')](_0x15894d,{'showHidden':![],'depth':null}));};}var _0x4bebe3=function(_0x4ccc20,_0x4f3085){var _0x3d93be=squel['insert']()[_0x523c('0x36')](_0x523c('0x37'))['fromQuery']([_0x523c('0x20'),'scheduledAt',_0x523c('0x38'),'ListId',_0x4f3085,_0x523c('0x39'),'updatedAt'],squel[_0x523c('0x3a')]()[_0x523c('0x3b')]('phone',_0x523c('0x20'))['field'](_0x523c('0x3c'),_0x523c('0x3d'))['field']('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x4ccc20['id']['toString'](),_0x4f3085)[_0x523c('0x3b')](_0x523c('0x3c'),_0x523c('0x39'))[_0x523c('0x3b')]('NOW()',_0x523c('0x3f'))['from'](_0x523c('0x40'))[_0x523c('0x41')](_0x523c('0x42'))[_0x523c('0x41')](_0x523c('0x43'),LISTID['toString']())[_0x523c('0x41')](_0x523c('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x523c('0x3a')]()['field'](_0x523c('0x20'))[_0x523c('0x45')](_0x523c('0x37'))[_0x523c('0x41')](_0x4f3085+_0x523c('0x46'),_0x4ccc20['id'][_0x523c('0x3e')]())))['toString']();return _0x3d93be;};var _0x502dcf=function(_0x51220d,_0x9af306){var _0x3e26a4=squel[_0x523c('0x47')]()[_0x523c('0x36')](_0x523c('0x37'))[_0x523c('0x48')](['phone',_0x523c('0x3d'),_0x523c('0x38'),_0x523c('0x27'),_0x9af306,'createdAt','updatedAt'],squel[_0x523c('0x3a')]()['field'](_0x523c('0x20'),_0x523c('0x20'))[_0x523c('0x3b')](_0x523c('0x3c'),_0x523c('0x3d'))[_0x523c('0x3b')]('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x51220d['id'][_0x523c('0x3e')](),_0x9af306)[_0x523c('0x3b')](_0x523c('0x3c'),'createdAt')[_0x523c('0x3b')](_0x523c('0x3c'),'updatedAt')[_0x523c('0x45')](_0x523c('0x40'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x523c('0x43'),LISTID[_0x523c('0x3e')]())[_0x523c('0x41')](_0x523c('0x49'),squel[_0x523c('0x4a')](hopperContacts))[_0x523c('0x41')](_0x523c('0x44'))[_0x523c('0x41')](_0x523c('0x4b'),squel['select']()[_0x523c('0x3b')]('calleridnum')[_0x523c('0x45')](_0x523c('0x4c'))[_0x523c('0x41')](_0x9af306+_0x523c('0x46'),_0x51220d['id'][_0x523c('0x3e')]()))[_0x523c('0x41')](_0x523c('0x4b'),squel[_0x523c('0x3a')]()[_0x523c('0x3b')](_0x523c('0x20'))[_0x523c('0x45')](_0x523c('0x37'))[_0x523c('0x41')](_0x9af306+_0x523c('0x46'),_0x51220d['id'][_0x523c('0x3e')]())))['toString']();return _0x3e26a4;};function _0xe3e24c(_0x489a91,_0x2d1afc){var _0x5dcaa2=squel[_0x523c('0x47')]()[_0x523c('0x36')](_0x523c('0x37'))['fromQuery']([_0x523c('0x20'),'scheduledAt',_0x523c('0x38'),_0x523c('0x27'),_0x2d1afc,'createdAt',_0x523c('0x3f')],squel[_0x523c('0x3a')]()['field'](_0x523c('0x20'),_0x523c('0x20'))[_0x523c('0x3b')](_0x523c('0x3c'),'scheduledAt')[_0x523c('0x3b')]('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x489a91['id'][_0x523c('0x3e')](),_0x2d1afc)['field']('NOW()','createdAt')['field']('NOW()',_0x523c('0x3f'))[_0x523c('0x45')](_0x523c('0x40'))[_0x523c('0x41')](_0x523c('0x42'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x523c('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x523c('0x41')](_0x523c('0x44')))[_0x523c('0x3e')]();return _0x5dcaa2;}function _0x12c3d2(_0x1c27a8,_0x389d23){var _0x5cd3e9=squel[_0x523c('0x47')]()[_0x523c('0x36')]('cm_hopper_black')[_0x523c('0x48')](['phone',_0x523c('0x38'),'ListId',_0x389d23,_0x523c('0x39'),'updatedAt'],squel[_0x523c('0x3a')]()[_0x523c('0x3b')](_0x523c('0x20'),_0x523c('0x20'))[_0x523c('0x3b')]('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x1c27a8['id'][_0x523c('0x3e')](),_0x389d23)[_0x523c('0x3b')](_0x523c('0x3c'),_0x523c('0x39'))['field']('NOW()',_0x523c('0x3f'))[_0x523c('0x45')](_0x523c('0x40'))[_0x523c('0x41')](_0x523c('0x42'))[_0x523c('0x41')](_0x523c('0x43'),LISTID[_0x523c('0x3e')]())[_0x523c('0x41')]('id\x20IN\x20?',squel[_0x523c('0x4a')](hopperContacts))[_0x523c('0x41')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x5cd3e9;}return db[_0x523c('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x523c('0x4e')],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x71edd9){var _0x298929=[];if(_0x71edd9){var _0x305d21;for(var _0x30af87=0x0,_0x4e977a;_0x30af87<_0x71edd9[_0x523c('0x19')];_0x30af87+=0x1){_0x4e977a=_0x71edd9[_0x30af87][_0x523c('0x51')]({'plain':!![]});switch(_0x4e977a[_0x523c('0x4e')]){case _0x523c('0x52'):_0x298929[_0x523c('0x53')](db['sequelize']['query'](_0x502dcf(_0x4e977a,'VoiceQueueId'))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));break;case _0x523c('0x55'):_0x298929['push'](db[_0x523c('0x56')][_0x523c('0x57')](_0x4bebe3(_0x4e977a,_0x523c('0x58')))['then'](function(){})[_0x523c('0x30')](_0x3309f1()));break;default:_0x298929[_0x523c('0x53')](db[_0x523c('0x56')][_0x523c('0x57')](_0xe3e24c(_0x4e977a,_0x523c('0x58')))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));}}}return _0x298929;})[_0x523c('0x59')]()[_0x523c('0x54')](function(){return db[_0x523c('0x4d')][_0x523c('0x5a')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x5b'),'where':{'id':LISTID}}]})[_0x523c('0x54')](function(_0x335c54){var _0x42dc36=[];if(_0x335c54){var _0x424a44;for(var _0x50a670=0x0,_0x3997a2;_0x50a670<_0x335c54['length'];_0x50a670+=0x1){_0x3997a2=_0x335c54[_0x50a670]['get']({'plain':!![]});_0x42dc36[_0x523c('0x53')](db[_0x523c('0x56')][_0x523c('0x57')](_0x12c3d2(_0x3997a2,_0x523c('0x58')))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));}}return _0x42dc36;})[_0x523c('0x59')]();})[_0x523c('0x54')](function(){return db[_0x523c('0x5c')][_0x523c('0x5a')]({'attributes':['id',_0x523c('0x4e')],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x1512df){var _0x4e7c02=[];if(_0x1512df){for(var _0x4af366=0x0,_0x417a8d;_0x4af366<_0x1512df[_0x523c('0x19')];_0x4af366+=0x1){_0x417a8d=_0x1512df[_0x4af366][_0x523c('0x51')]({'plain':!![]});switch(_0x417a8d[_0x523c('0x4e')]){case'always':_0x4e7c02['push'](db[_0x523c('0x56')][_0x523c('0x57')](_0x502dcf(_0x417a8d,_0x523c('0x5d')))[_0x523c('0x54')](function(){})['catch'](_0x3309f1()));break;case _0x523c('0x55'):_0x4e7c02[_0x523c('0x53')](db['sequelize']['query'](_0x4bebe3(_0x417a8d,_0x523c('0x5d')))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));break;default:_0x4e7c02[_0x523c('0x53')](db['sequelize'][_0x523c('0x57')](_0xe3e24c(_0x417a8d,'CampaignId'))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));}}}return _0x4e7c02;})[_0x523c('0x59')]();})[_0x523c('0x54')](function(){return db['Campaign'][_0x523c('0x5a')]({'attributes':['id'],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x5b'),'where':{'id':LISTID}}]})[_0x523c('0x54')](function(_0x2604cb){var _0x449f54=[];if(_0x2604cb){for(var _0xe8d702=0x0,_0xece91d;_0xe8d702<_0x2604cb[_0x523c('0x19')];_0xe8d702+=0x1){_0xece91d=_0x2604cb[_0xe8d702]['get']({'plain':!![]});_0x449f54[_0x523c('0x53')](db[_0x523c('0x56')]['query'](_0x12c3d2(_0xece91d,_0x523c('0x5d')))[_0x523c('0x54')](function(){})['catch'](_0x3309f1()));}}return _0x449f54;})['all']();})[_0x523c('0x30')](function(_0x3b4083){logger['error'](_0x523c('0x5e'),'generalCheckHopper',_0x3b4083[_0x523c('0x1b')]);});}var processPromises=function(_0x1f8af2){return BPromise[_0x523c('0x59')](promises)[_0x523c('0x54')](function(_0x532a09){})['catch'](function(_0x792c62){logger['error'](_0x523c('0x5f'),JSON['stringify'](_0x792c62));})['finally'](function(){socket[_0x523c('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1f8af2){return _0x1f8af2[_0x523c('0x61')]();}});};var endCsv=function(){return BPromise[_0x523c('0x62')]()[_0x523c('0x54')](function(){if(hopperContacts){return checkHopper();}})[_0x523c('0x54')](function(){socket[_0x523c('0x60')](_0x523c('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x523c('0x64')](FILEPATH);}catch(_0x4a895f){logger[_0x523c('0x13')](_0x523c('0x65'),JSON[_0x523c('0x32')](_0x4a895f));}finally{process[_0x523c('0x66')](0x0);}});};process['on'](_0x523c('0x67'),function(){logger[_0x523c('0x68')](_0x523c('0x69'));endCsv();});function main(){return BPromise[_0x523c('0x62')]()[_0x523c('0x54')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x523c('0x2c')][_0x523c('0x5a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x523c('0x54')](function(_0x51be0c){var _0x128bfd=fs[_0x523c('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x523c('0x6b')](_0x128bfd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1d4340,_0x10a6c6){total+=0x1;var _0x433047=total;promises[_0x523c('0x53')](checkRow(_0x1d4340,_0x51be0c,_0x433047)[_0x523c('0x54')](function(){success+=0x1;})['catch'](function(_0x4af966){if(_0x4af966['error']){errors+=0x1;delete _0x4af966['error'];}else if(_0x4af966[_0x523c('0x2a')]){duplicates+=0x1;delete _0x4af966[_0x523c('0x2a')];}rows[_0x523c('0x53')](_0x4af966);}));if(total%0xc8===0x0){_0x10a6c6[_0x523c('0x6c')]();return processPromises(_0x10a6c6);}},'complete':function(){return processPromises()[_0x523c('0x54')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3dca7e,_0x46cda9){logger[_0x523c('0x68')]('CSV\x20parse\x20error',JSON['stringify'](_0x3dca7e));endCsv();}});})['catch'](function(_0x59441d){logger[_0x523c('0x13')](_0x523c('0x6d'),JSON[_0x523c('0x32')](_0x59441d));});}main(); \ No newline at end of file +var _0xe3ca=['id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','query','VoiceQueueId','sequelize','VoiceQueue','BlackLists','all','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x3979bf,_0x167bfc){var _0x238dfa=function(_0x2cf3a0){while(--_0x2cf3a0){_0x3979bf['push'](_0x3979bf['shift']());}};_0x238dfa(++_0x167bfc);}(_0xe3ca,0x17f));var _0xae3c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xe3ca[_0x36eaaa];return _0x461349;};'use strict';var BPromise=require('bluebird');var util=require(_0xae3c('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xae3c('0x1'));var Redis=require(_0xae3c('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xae3c('0x3'));var logger=require(_0xae3c('0x4'))(_0xae3c('0x5'));config[_0xae3c('0x6')]=_[_0xae3c('0x7')](config[_0xae3c('0x6')],{'host':_0xae3c('0x8'),'port':0x18eb});var socket=require(_0xae3c('0x9'))(new Redis(config[_0xae3c('0x6')]));require(_0xae3c('0xa'))[_0xae3c('0xb')](socket);try{if(!process['argv'][0x2]||process[_0xae3c('0xc')][0x2]==='undefined'||process[_0xae3c('0xc')][0x2]==='null'){throw new Error(_0xae3c('0xd'));}var FILEPATH=process[_0xae3c('0xc')][0x2];if(!process[_0xae3c('0xc')][0x3]||process[_0xae3c('0xc')][0x3]===_0xae3c('0xe')||process[_0xae3c('0xc')][0x3]===_0xae3c('0xf')||!process[_0xae3c('0xc')][0x4]||process['argv'][0x4]===_0xae3c('0xe')||process[_0xae3c('0xc')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xae3c('0x10')](process['argv'][0x3]['split'](','),process[_0xae3c('0xc')][0x4][_0xae3c('0x11')](','));if(!process[_0xae3c('0xc')][0x5]||process['argv'][0x5]===_0xae3c('0xe')||process[_0xae3c('0xc')][0x5]===_0xae3c('0xf')){throw new Error(_0xae3c('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xae3c('0xc')][0x6]&&process[_0xae3c('0xc')][0x6]!=='undefined'&&process[_0xae3c('0xc')][0x6]!==_0xae3c('0xf')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xae3c('0xc')][0x7]!=='undefined'&&process[_0xae3c('0xc')][0x7]!==_0xae3c('0xf')?process[_0xae3c('0xc')][0x7]:null;if(!process[_0xae3c('0xc')][0x8]||process[_0xae3c('0xc')][0x8]===_0xae3c('0xe')||process['argv'][0x8]===_0xae3c('0xf')){throw new Error(_0xae3c('0x13'));}var SOCKET_TIMESTAMP=process[_0xae3c('0xc')][0x8];}catch(_0x473f3b){logger[_0xae3c('0x14')](_0x473f3b);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(_0x343b03,_0x13e14,_0x18d676,_0x1c4abb){var _0x1b2391={'message':_0x13e14};_0x1b2391[_0x343b03]=!![];if(_0x18d676){_0x1b2391['contact']=_0x18d676;}if(_0x1c4abb){_0x1b2391[_0xae3c('0x15')]=_0x1c4abb;}return _0x1b2391;}function isEmail(_0x229b05){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))*$/[_0xae3c('0x16')](_0x229b05);}function checkRow(_0x4031f2,_0x520576,_0x1b200b){return new BPromise(function(_0x3aaa05,_0x32a718){if(_[_0xae3c('0x17')](_0x4031f2)){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x18'),null,_0x1b200b));}if(_0x4031f2[_0xae3c('0x19')]&&_0x4031f2['errors'][_0xae3c('0x1a')]){var _0x509aea=_[_0xae3c('0x1b')](_0x4031f2[_0xae3c('0x19')],_0xae3c('0x1c'))[_0xae3c('0x1d')](';');return _0x32a718(handleCheckRowError('error',_0x509aea,null,_0x1b200b));}var _0x362247={};for(var _0x46150f in FIELDS){if(FIELDS[_0xae3c('0x1e')](_0x46150f)&&FIELDS[_0x46150f]){_0x362247[_0x46150f]=_0x4031f2[_0xae3c('0x1f')][0x0][FIELDS[_0x46150f]]||_0x4031f2[_0xae3c('0x1f')][0x0]['\ufeff'+FIELDS[_0x46150f]];}}if(!_0x362247[_0xae3c('0x20')]){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),'firstName\x20not\x20specified!',null,_0x1b200b));}if(!_0x362247[_0xae3c('0x21')]){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x22'),null,_0x1b200b));}if(_0x362247['birthDate']){var _0x1b97bb=moment(_0x362247['birthDate'],_0xae3c('0x23'));if(!_0x1b97bb[_0xae3c('0x24')]()){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x25'),null,_0x1b200b));}}if(_0x362247[_0xae3c('0x26')]){if(!isEmail(_0x362247[_0xae3c('0x26')])){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x27'),null,_0x1b200b));}}_0x362247[_0xae3c('0x28')]=LISTID;_0x362247[_0xae3c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xae3c('0x1a')]&&_0x520576){var _0x5f2620={};for(var _0x4063ac=0x0,_0x12e138=DUPLICATES[_0xae3c('0x1a')];_0x4063ac<_0x12e138;_0x4063ac+=0x1){_0x5f2620[DUPLICATES[_0x4063ac]]=_0x362247[DUPLICATES[_0x4063ac]];}var _0x9e4ada=_[_0xae3c('0x2a')](_0x520576,_0x5f2620);if(_0x9e4ada){return _0x32a718(handleCheckRowError(_0xae3c('0x2b'),_0xae3c('0x2c'),_0x9e4ada,_0x1b200b));}}return db['CmContact']['create'](_0x362247,{'raw':!![],'hooks':![],'fields':_[_0xae3c('0x2d')](_0x362247)})[_0xae3c('0x2e')](function(_0x44b120){if(DUPLICATES&&DUPLICATES[_0xae3c('0x1a')]&&_0x520576){_0x520576['push'](_[_0xae3c('0x2f')](_0x362247,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x44b120['id'];return _0x3aaa05();})[_0xae3c('0x30')](function(_0x513d67){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x31')+(_0x513d67[_0xae3c('0x1c')]||JSON[_0xae3c('0x32')](_0x513d67)),null,_0x1b200b));});});}function checkHopper(){function _0x5a6beb(){return function(_0x16104e){logger[_0xae3c('0x14')](_0xae3c('0x33'),_0xae3c('0x34'),util[_0xae3c('0x35')](_0x16104e,{'showHidden':![],'depth':null}));};}var _0x309434=function(_0x4468ff,_0x574017){var _0x4f0fa8=squel[_0xae3c('0x36')]()[_0xae3c('0x37')](_0xae3c('0x38'))[_0xae3c('0x39')](['phone','scheduledAt',_0xae3c('0x3a'),'ListId',_0x574017,_0xae3c('0x3b'),_0xae3c('0x3c')],squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x21'),_0xae3c('0x21'))['field'](_0xae3c('0x3f'),_0xae3c('0x40'))[_0xae3c('0x3e')]('id','ContactId')[_0xae3c('0x3e')](LISTID[_0xae3c('0x41')](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x4468ff['id']['toString'](),_0x574017)[_0xae3c('0x3e')](_0xae3c('0x3f'),'createdAt')[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3c'))[_0xae3c('0x42')](_0xae3c('0x43'))[_0xae3c('0x44')](_0xae3c('0x45'))['where'](_0xae3c('0x46'),LISTID['toString']())['where'](_0xae3c('0x47'))['where'](_0xae3c('0x48'),squel[_0xae3c('0x3d')]()['field']('phone')[_0xae3c('0x42')](_0xae3c('0x38'))[_0xae3c('0x44')](_0x574017+'\x20=\x20?',_0x4468ff['id'][_0xae3c('0x41')]())))[_0xae3c('0x41')]();return _0x4f0fa8;};var _0x17635b=function(_0x50fe8e,_0x7563b7){var _0x14a12c=squel['insert']()['into'](_0xae3c('0x38'))[_0xae3c('0x39')]([_0xae3c('0x21'),_0xae3c('0x40'),'ContactId','ListId',_0x7563b7,_0xae3c('0x3b'),_0xae3c('0x3c')],squel[_0xae3c('0x3d')]()['field']('phone',_0xae3c('0x21'))[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x40'))[_0xae3c('0x3e')]('id',_0xae3c('0x3a'))[_0xae3c('0x3e')](LISTID[_0xae3c('0x41')](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x50fe8e['id'][_0xae3c('0x41')](),_0x7563b7)[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3b'))[_0xae3c('0x3e')](_0xae3c('0x3f'),'updatedAt')[_0xae3c('0x42')](_0xae3c('0x43'))['where'](_0xae3c('0x45'))['where']('ListId\x20=\x20?',LISTID[_0xae3c('0x41')]())[_0xae3c('0x44')](_0xae3c('0x49'),squel[_0xae3c('0x4a')](hopperContacts))[_0xae3c('0x44')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x4b'))[_0xae3c('0x42')](_0xae3c('0x4c'))['where'](_0x7563b7+'\x20=\x20?',_0x50fe8e['id'][_0xae3c('0x41')]()))[_0xae3c('0x44')](_0xae3c('0x48'),squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x21'))[_0xae3c('0x42')]('cm_hopper')['where'](_0x7563b7+_0xae3c('0x4d'),_0x50fe8e['id'][_0xae3c('0x41')]())))[_0xae3c('0x41')]();return _0x14a12c;};function _0x1a0bd5(_0x365517,_0x28cab0){var _0xf67276=squel[_0xae3c('0x36')]()[_0xae3c('0x37')](_0xae3c('0x38'))[_0xae3c('0x39')](['phone',_0xae3c('0x40'),_0xae3c('0x3a'),_0xae3c('0x28'),_0x28cab0,_0xae3c('0x3b'),'updatedAt'],squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x21'),'phone')[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x40'))[_0xae3c('0x3e')]('id',_0xae3c('0x3a'))[_0xae3c('0x3e')](LISTID['toString'](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x365517['id'][_0xae3c('0x41')](),_0x28cab0)[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3b'))[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3c'))[_0xae3c('0x42')]('cm_contacts')[_0xae3c('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0xae3c('0x46'),LISTID[_0xae3c('0x41')]())[_0xae3c('0x44')](_0xae3c('0x49'),squel[_0xae3c('0x4a')](hopperContacts))[_0xae3c('0x44')](_0xae3c('0x47')))['toString']();return _0xf67276;}function _0x5ebd84(_0x311077,_0x3d43a5){var _0x56a024=squel['insert']()[_0xae3c('0x37')](_0xae3c('0x4e'))[_0xae3c('0x39')](['phone',_0xae3c('0x3a'),_0xae3c('0x28'),_0x3d43a5,_0xae3c('0x3b'),_0xae3c('0x3c')],squel['select']()[_0xae3c('0x3e')](_0xae3c('0x21'),_0xae3c('0x21'))['field']('id',_0xae3c('0x3a'))[_0xae3c('0x3e')](LISTID['toString'](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x311077['id']['toString'](),_0x3d43a5)['field'](_0xae3c('0x3f'),_0xae3c('0x3b'))[_0xae3c('0x3e')](_0xae3c('0x3f'),'updatedAt')[_0xae3c('0x42')]('cm_contacts')[_0xae3c('0x44')](_0xae3c('0x45'))[_0xae3c('0x44')]('ListId\x20=\x20?',LISTID[_0xae3c('0x41')]())[_0xae3c('0x44')](_0xae3c('0x49'),squel['str'](hopperContacts))['where'](_0xae3c('0x47')))[_0xae3c('0x41')]();return _0x56a024;}return db['VoiceQueue'][_0xae3c('0x4f')]({'where':{'type':_0xae3c('0x50')},'attributes':['id',_0xae3c('0x51')],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x53'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x14f385){var _0xfa85d9=[];if(_0x14f385){var _0x5bd0c9;for(var _0x5167f1=0x0,_0x569286;_0x5167f1<_0x14f385[_0xae3c('0x1a')];_0x5167f1+=0x1){_0x569286=_0x14f385[_0x5167f1][_0xae3c('0x54')]({'plain':!![]});switch(_0x569286['dialCheckDuplicateType']){case _0xae3c('0x55'):_0xfa85d9[_0xae3c('0x56')](db['sequelize'][_0xae3c('0x57')](_0x17635b(_0x569286,_0xae3c('0x58')))['then'](function(){})[_0xae3c('0x30')](_0x5a6beb()));break;case'onlyIfOpen':_0xfa85d9[_0xae3c('0x56')](db[_0xae3c('0x59')]['query'](_0x309434(_0x569286,_0xae3c('0x58')))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));break;default:_0xfa85d9[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x1a0bd5(_0x569286,_0xae3c('0x58')))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));}}}return _0xfa85d9;})['all']()[_0xae3c('0x2e')](function(){return db[_0xae3c('0x5a')][_0xae3c('0x4f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x5b'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x32c753){var _0x5a89f1=[];if(_0x32c753){var _0x287d38;for(var _0x2b6ee3=0x0,_0x5738e0;_0x2b6ee3<_0x32c753[_0xae3c('0x1a')];_0x2b6ee3+=0x1){_0x5738e0=_0x32c753[_0x2b6ee3][_0xae3c('0x54')]({'plain':!![]});_0x5a89f1[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x5ebd84(_0x5738e0,_0xae3c('0x58')))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));}}return _0x5a89f1;})[_0xae3c('0x5c')]();})[_0xae3c('0x2e')](function(){return db[_0xae3c('0x5d')][_0xae3c('0x4f')]({'attributes':['id',_0xae3c('0x51')],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x53'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x1c9e97){var _0x186caf=[];if(_0x1c9e97){for(var _0x7d7820=0x0,_0xbfd122;_0x7d7820<_0x1c9e97['length'];_0x7d7820+=0x1){_0xbfd122=_0x1c9e97[_0x7d7820][_0xae3c('0x54')]({'plain':!![]});switch(_0xbfd122['dialCheckDuplicateType']){case _0xae3c('0x55'):_0x186caf[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x17635b(_0xbfd122,_0xae3c('0x5e')))[_0xae3c('0x2e')](function(){})['catch'](_0x5a6beb()));break;case _0xae3c('0x5f'):_0x186caf[_0xae3c('0x56')](db[_0xae3c('0x59')]['query'](_0x309434(_0xbfd122,'CampaignId'))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));break;default:_0x186caf[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x1a0bd5(_0xbfd122,'CampaignId'))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));}}}return _0x186caf;})[_0xae3c('0x5c')]();})[_0xae3c('0x2e')](function(){return db[_0xae3c('0x5d')][_0xae3c('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x5b'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x534010){var _0x32e5e0=[];if(_0x534010){for(var _0x3539aa=0x0,_0x3fc627;_0x3539aa<_0x534010['length'];_0x3539aa+=0x1){_0x3fc627=_0x534010[_0x3539aa][_0xae3c('0x54')]({'plain':!![]});_0x32e5e0[_0xae3c('0x56')](db['sequelize'][_0xae3c('0x57')](_0x5ebd84(_0x3fc627,_0xae3c('0x5e')))[_0xae3c('0x2e')](function(){})['catch'](_0x5a6beb()));}}return _0x32e5e0;})[_0xae3c('0x5c')]();})[_0xae3c('0x30')](function(_0x1902b6){logger[_0xae3c('0x14')](_0xae3c('0x60'),'generalCheckHopper',_0x1902b6['message']);});}var processPromises=function(_0xe34e10){return BPromise[_0xae3c('0x5c')](promises)[_0xae3c('0x2e')](function(_0x55fad2){})['catch'](function(_0x164f88){logger[_0xae3c('0x14')](_0xae3c('0x61'),JSON['stringify'](_0x164f88));})[_0xae3c('0x62')](function(){socket[_0xae3c('0x63')](_0xae3c('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xe34e10){return _0xe34e10[_0xae3c('0x65')]();}});};var endCsv=function(){return BPromise[_0xae3c('0x66')]()[_0xae3c('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xae3c('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xae3c('0x67')](FILEPATH);}catch(_0xf3db41){logger[_0xae3c('0x14')](_0xae3c('0x68'),JSON[_0xae3c('0x32')](_0xf3db41));}finally{process['exit'](0x0);}});};process['on'](_0xae3c('0x69'),function(){logger[_0xae3c('0x6a')](_0xae3c('0x6b'));endCsv();});function main(){return BPromise[_0xae3c('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xae3c('0x11')](',');return db[_0xae3c('0x6c')][_0xae3c('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xae3c('0x2e')](function(_0xe426d){var _0x3ffdbb=fs[_0xae3c('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xae3c('0x6e')](_0x3ffdbb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1636bc,_0x31952b){total+=0x1;var _0x595a7f=total;promises[_0xae3c('0x56')](checkRow(_0x1636bc,_0xe426d,_0x595a7f)[_0xae3c('0x2e')](function(){success+=0x1;})['catch'](function(_0x5a5301){if(_0x5a5301['error']){errors+=0x1;delete _0x5a5301['error'];}else if(_0x5a5301[_0xae3c('0x2b')]){duplicates+=0x1;delete _0x5a5301[_0xae3c('0x2b')];}rows[_0xae3c('0x56')](_0x5a5301);}));if(total%0xc8===0x0){_0x31952b[_0xae3c('0x6f')]();return processPromises(_0x31952b);}},'complete':function(){return processPromises()[_0xae3c('0x2e')](function(){logger[_0xae3c('0x6a')](_0xae3c('0x70'));endCsv();});},'error':function(_0x3d0293,_0x1c1252){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x3d0293));endCsv();}});})[_0xae3c('0x30')](function(_0xbbaabb){logger[_0xae3c('0x14')](_0xae3c('0x71'),JSON[_0xae3c('0x32')](_0xbbaabb));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 09cb213..cfed003 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 _0xb574=['DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','complete','argv','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','../../../mysqldb','../../../config/environment/shared','import','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','field','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','split','length','isNil','CmContactHasItem','findOne','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.phone','fromQuery','cm_hopper_black','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','insert','\x22always\x22','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','Received\x20SIGINT','error','message','exit','code','info','sequelize','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','utcOffset','offset','set','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','includes','header','name','_description','writeFileSync','parse','data','rows','errors','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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()'];(function(_0x9d1971,_0x50b82e){var _0x203469=function(_0x2733b4){while(--_0x2733b4){_0x9d1971['push'](_0x9d1971['shift']());}};_0x203469(++_0x50b82e);}(_0xb574,0x17b));var _0x4b57=function(_0x2f9292,_0x211af0){_0x2f9292=_0x2f9292-0x0;var _0xdaeb9b=_0xb574[_0x2f9292];return _0xdaeb9b;};'use strict';var fs=require('fs');var path=require(_0x4b57('0x0'));var _=require(_0x4b57('0x1'));var Papa=require(_0x4b57('0x2'));var util=require(_0x4b57('0x3'));var BPromise=require(_0x4b57('0x4'));var moment=require(_0x4b57('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x4b57('0x6'))['db'];var config=require('../../../config/environment');var shared=require(_0x4b57('0x7'));var logger=require('../../../config/logger')(_0x4b57('0x8'));config['redis']=_[_0x4b57('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x4b57('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x4b57('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x40771c){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))*$/[_0x4b57('0xd')](_0x40771c);}function selectNotIn(_0x1f600a,_0x3b5911,_0x9a0be0,_0x20365c,_0x1a6635){return squel['select']()[_0x4b57('0xe')](_0x4b57('0xf'))['from'](_0x20365c)[_0x4b57('0x10')](_0x3b5911,null,_0x3b5911+_0x4b57('0x11')+_0x20365c+'.'+_0x9a0be0)[_0x4b57('0x12')](_0x20365c+'.'+_0x9a0be0+'\x20=\x20'+_0x1f600a+'.'+_0x9a0be0)[_0x4b57('0x12')](_0x3b5911+_0x4b57('0x13')+_0x1a6635['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x34e04b,_0x2b4a20){promisesAdditionalPhones=[];return db[_0x4b57('0x14')][_0x4b57('0x15')]({'raw':!![],'attributes':['id',_0x4b57('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x4b57('0x17')](function(_0x259064){if(_0x259064!==null){var _0x4eed64=[];for(var _0x1db541=0x0;_0x1db541<_0x259064['length'];_0x1db541++){var _0x2d2ba3=_0x259064[_0x1db541];_0x4eed64[_0x4b57('0x18')](insertAdditionalPhones(_0x2d2ba3));}}Promise[_0x4b57('0x19')](_0x4eed64)['then'](function(){_0x34e04b({'val':0x1});});});});}function insertAdditionalPhones(_0x525aa9){return new Promise(function(_0x393bcf,_0x26a6c2){var _0x73d3b8=_0x525aa9['AdditionalPhones'];var _0x22be85=_0x73d3b8[_0x4b57('0x1a')](';');var _0x8bdb31=[];orderBy=0x0;for(var _0x349ab0=0x0;_0x349ab0<_0x22be85['length'];_0x349ab0++){_0x8bdb31[_0x4b57('0x18')](splitAdditionalPhone(_0x525aa9['id'],_0x22be85[_0x349ab0]));}Promise[_0x4b57('0x19')](_0x8bdb31)[_0x4b57('0x17')](function(){_0x393bcf({'val':_0x22be85[_0x4b57('0x1b')]});});});}function splitAdditionalPhone(_0x4fa5a7,_0x28a2ef){return new Promise(function(_0x1d8b1d,_0x2aa23a){var _0x220102=_0x28a2ef[_0x4b57('0x1a')](':');var _0x2a29f2=_0x220102[0x0];var _0x469fc1=_0x220102[0x1];if(!_[_0x4b57('0x1c')](_0x469fc1)){var _0x4924cf=_0x469fc1['split']('|');var _0x538558=[];for(var _0x212939=0x0;_0x212939<_0x4924cf[_0x4b57('0x1b')];_0x212939++){if(_0x4924cf[_0x212939]!==''){var _0x454be3=_['filter'](promisesAdditionalPhones,{'contactId':_0x4fa5a7,'phone':_0x4924cf[_0x212939]});if(_0x454be3[_0x4b57('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4fa5a7,'contactTypeId':_0x2a29f2,'phone':_0x4924cf[_0x212939],'orderBy':orderBy});}}}_0x1d8b1d({'ok':0x1});}else _0x1d8b1d({'res':0x0});});}function createAdditionalPhone(_0x3f1055,_0x3f47d0,_0x1192fc,_0xbf3bd2){var _0x2766d6='';var _0x3a3cae='';var _0x34ec90=_0x1192fc[_0x4b57('0x1a')]('§');_0x2766d6=_0x34ec90[0x0];if(_0x34ec90[_0x4b57('0x1b')]==0x2)_0x3a3cae=_0x34ec90[0x1];return new Promise(function(_0x2aaa7f,_0x13b64c){return db[_0x4b57('0x1d')][_0x4b57('0x1e')]({'where':{'CmContactId':_0x3f1055,'item':_0x2766d6}})[_0x4b57('0x17')](function(_0x951bf7){if(_0x951bf7){return db[_0x4b57('0x1d')]['update']({'ItemTypeId':_0x3f47d0,'description':_0x3a3cae,'OrderBy':_0xbf3bd2},{'where':{'CmContactId':_0x3f1055,'item':_0x2766d6}})[_0x4b57('0x17')](function(_0x5e278d){_0x2aaa7f({'res':_0x4b57('0x1f')});});}else{return db[_0x4b57('0x1d')][_0x4b57('0x20')]({'CmContactId':_0x3f1055,'item':_0x2766d6,'description':_0x3a3cae,'ItemTypeId':_0x3f47d0,'OrderBy':_0xbf3bd2,'ItemClass':_0x4b57('0x21')})[_0x4b57('0x17')](function(_0x312997){_0x2aaa7f({'res':_0x4b57('0x22')});});}});});}function insertCmHopper(_0x25e060,_0x59fd3d,_0x29c037,_0x426791,_0x303863){var _0xfe6286=['cm_contacts.phone',_0x4b57('0x23'),_0x4b57('0x24'),_0x4b57('0x25'),_0x59fd3d+'.'+_0x426791,_0x4b57('0x26'),_0x4b57('0x27'),'cm_contacts.priority',_0x4b57('0x28'),'\x22'+_0x303863+'\x22'];return squel['insert']()[_0x4b57('0x29')](_0x4b57('0x2a'))['fromQuery']([_0x4b57('0xf'),_0x4b57('0x2b'),_0x4b57('0x2c'),_0x4b57('0x2d'),_0x426791,_0x4b57('0x2e'),_0x4b57('0x2f'),_0x4b57('0x30'),_0x4b57('0x31'),_0x4b57('0x32')],squel[_0x4b57('0x33')]()[_0x4b57('0x34')](_0xfe6286)[_0x4b57('0x35')](_0x59fd3d)[_0x4b57('0x10')](_0x4b57('0x36'),null,_0x4b57('0x37')+_0x59fd3d+_0x4b57('0x38'))['join'](_0x29c037,null,_0x29c037+_0x4b57('0x11')+_0x59fd3d+'.'+_0x426791)[_0x4b57('0x12')](_0x59fd3d+_0x4b57('0x39'),_0x25e060)[_0x4b57('0x12')](_0x4b57('0x3a'),NOW)[_0x4b57('0x12')](_0x4b57('0x3b'),selectNotIn(_0x59fd3d,_0x29c037,_0x426791,_0x4b57('0x2a'),['\x22always\x22',_0x4b57('0x3c')]))[_0x4b57('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x59fd3d,_0x29c037,_0x426791,_0x4b57('0x2a'),['\x22always\x22'])))[_0x4b57('0x3d')]();}function insertCmHopperBlack(_0x11861b,_0x1c9c97,_0x426817,_0x454456){var _0x355682=[_0x4b57('0x3e'),_0x4b57('0x24'),_0x4b57('0x25'),_0x1c9c97+'.'+_0x454456,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0x4b57('0x29')]('cm_hopper_black')[_0x4b57('0x3f')]([_0x4b57('0xf'),_0x4b57('0x2c'),_0x4b57('0x2d'),_0x454456,_0x4b57('0x2e'),_0x4b57('0x2f')],squel[_0x4b57('0x33')]()[_0x4b57('0x34')](_0x355682)['from'](_0x1c9c97)[_0x4b57('0x10')](_0x4b57('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x1c9c97+_0x4b57('0x38'))[_0x4b57('0x10')](_0x426817,null,_0x426817+_0x4b57('0x11')+_0x1c9c97+'.'+_0x454456)[_0x4b57('0x12')](_0x1c9c97+_0x4b57('0x39'),_0x11861b)['where'](_0x4b57('0x3a'),NOW)[_0x4b57('0x12')](_0x4b57('0x3b'),squel[_0x4b57('0x33')]()[_0x4b57('0xe')](_0x4b57('0xf'))[_0x4b57('0x35')](_0x4b57('0x40'))[_0x4b57('0x12')](_0x4b57('0x41'),_0x11861b)['where'](_0x454456+_0x4b57('0x42')+_0x1c9c97+'.'+_0x454456)))[_0x4b57('0x3d')]();}function insertTzCmHopper(_0x4a0d18,_0x46224c,_0x2269cf,_0x1972c2,_0x262f2e,_0x1ea40c){var _0x47ef48=[_0x4b57('0x3e'),_0x4b57('0x43')+_0x1ea40c+'.offset-cm_contacts.utcOffset\x20minute)',_0x4b57('0x24'),_0x4b57('0x25'),_0x46224c+'.'+_0x1972c2,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x4b57('0x44'),'cm_contacts.UserId','\x22'+_0x262f2e+'\x22'];var _0x448082=squel[_0x4b57('0x45')]()[_0x4b57('0x29')]('cm_hopper')[_0x4b57('0x3f')]([_0x4b57('0xf'),'scheduledat','ContactId','ListId',_0x1972c2,_0x4b57('0x2e'),_0x4b57('0x2f'),_0x4b57('0x30'),_0x4b57('0x31'),_0x4b57('0x32')],squel[_0x4b57('0x33')]()['fields'](_0x47ef48)[_0x4b57('0x35')](_0x46224c)[_0x4b57('0x10')]('cm_contacts',null,_0x4b57('0x37')+_0x46224c+'.CmListId')[_0x4b57('0x10')](_0x2269cf,null,_0x2269cf+_0x4b57('0x11')+_0x46224c+'.'+_0x1972c2)[_0x4b57('0x10')](_0x1ea40c,null,_0x1ea40c+_0x4b57('0x11')+_0x46224c+'.'+_0x1972c2)[_0x4b57('0x12')](_0x46224c+'.CmListId\x20=\x20?',_0x4a0d18)['where'](_0x4b57('0x3a'),NOW)[_0x4b57('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x46224c,_0x2269cf,_0x1972c2,_0x4b57('0x2a'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x4b57('0x12')](_0x4b57('0x3b'),selectNotIn(_0x46224c,_0x2269cf,_0x1972c2,'cm_hopper',[_0x4b57('0x46')])))[_0x4b57('0x3d')]();return _0x448082;}function insertTzCmHopperBlack(_0x25f8d0,_0x132498,_0x3ce93b,_0x3be85a){var _0x19469a=['cm_contacts.phone',_0x4b57('0x24'),_0x4b57('0x25'),_0x132498+'.'+_0x3be85a,_0x4b57('0x26'),'cm_contacts.updatedAt'];return squel[_0x4b57('0x45')]()[_0x4b57('0x29')]('cm_hopper_black')[_0x4b57('0x3f')](['phone',_0x4b57('0x2c'),'ListId',_0x3be85a,_0x4b57('0x2e'),'updatedAt'],squel[_0x4b57('0x33')]()[_0x4b57('0x34')](_0x19469a)[_0x4b57('0x35')](_0x132498)[_0x4b57('0x10')](_0x4b57('0x36'),null,_0x4b57('0x37')+_0x132498+_0x4b57('0x38'))['join'](_0x3ce93b,null,_0x3ce93b+_0x4b57('0x11')+_0x132498+'.'+_0x3be85a)[_0x4b57('0x12')](_0x132498+_0x4b57('0x39'),_0x25f8d0)['where'](_0x4b57('0x3a'),NOW)[_0x4b57('0x12')](_0x4b57('0x3b'),squel[_0x4b57('0x33')]()[_0x4b57('0xe')](_0x4b57('0xf'))[_0x4b57('0x35')]('cm_hopper_black')[_0x4b57('0x12')](_0x4b57('0x41'),_0x25f8d0)[_0x4b57('0x12')](_0x3be85a+'\x20=\x20'+_0x132498+'.'+_0x3be85a)))[_0x4b57('0x3d')]();}function insertCmHopperAdditionalPhones(_0x135cb6){var _0x1bee17=['cm_hopper.id',_0x4b57('0x47'),_0x4b57('0x48'),'cm_contact_has_items.createdAt',_0x4b57('0x49')];return squel['insert']()[_0x4b57('0x29')](_0x4b57('0x4a'))[_0x4b57('0x3f')]([_0x4b57('0x4b'),'phone',_0x4b57('0x4c'),'createdAt',_0x4b57('0x2f')],squel[_0x4b57('0x33')]()['fields'](_0x1bee17)[_0x4b57('0x35')](_0x4b57('0x2a'))[_0x4b57('0x10')](_0x4b57('0x36'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x4b57('0x10')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x4b57('0x12')](_0x4b57('0x4d'),_0x135cb6)[_0x4b57('0x12')](_0x4b57('0x3a'),NOW))[_0x4b57('0x3d')]();}function insertCmContact(_0x4b4585,_0x542753,_0x1c951b,_0x41541c){var _0x38a2a4=_[_0x4b57('0x4e')](_[_0x4b57('0x4f')](_0x41541c),[_0x4b57('0x2d'),_0x4b57('0x50'),'createdAt',_0x4b57('0x2f')]);return squel[_0x4b57('0x45')]()[_0x4b57('0x29')]('cm_contacts')['fromQuery'](_0x38a2a4,squel[_0x4b57('0x33')]()[_0x4b57('0x34')](_0x38a2a4)[_0x4b57('0x35')](_0x542753)[_0x4b57('0x12')]('('+_0x1c951b[_0x4b57('0x10')](',')+_0x4b57('0x51'),squel[_0x4b57('0x33')]()[_0x4b57('0x34')](_0x1c951b)[_0x4b57('0x35')](_0x4b57('0x36'))[_0x4b57('0x12')](_0x4b57('0x41'),_0x4b4585)['where'](_0x4b57('0x52')))[_0x4b57('0x12')](_0x4b57('0x53'),squel['select']()['field']('MIN(id)',_0x4b57('0x54'))['from'](_0x542753)['group'](_0x1c951b[_0x4b57('0x10')](','))))[_0x4b57('0x3d')]();}function handleStop(){logger['info'](_0x4b57('0x55'));stopped=!![];}function handleUncaughtException(_0x2a04db){logger[_0x4b57('0x56')](_0x2a04db[_0x4b57('0x57')]);process[_0x4b57('0x58')](0x1);}function handleError(_0xfa3876,_0x527bc0){stats['errors'][_0x4b57('0x18')]({'name':_0x527bc0[_0x4b57('0x59')],'message':_0x527bc0[_0x4b57('0x57')],'row':_0xfa3876});}function handleQuery(_0x59ab01){logger[_0x4b57('0x5a')](_0x59ab01);return db[_0x4b57('0x5b')]['query'](_0x59ab01)['spread'](function(_0x4e36c0){results[_0x4b57('0x18')](_0x4e36c0);})[_0x4b57('0x5c')](function(_0x1c7c19){logger['error'](_0x1c7c19[_0x4b57('0x57')]);});}function updateTzCampaigns(_0x2740a7){return new Promise(function(_0x37da7d,_0x474d2c){var _0x2ccf04=squel[_0x4b57('0x33')]()[_0x4b57('0x34')]([_0x4b57('0x5d'),_0x4b57('0x5e')])[_0x4b57('0x35')](_0x4b57('0x5f'))[_0x4b57('0x10')](_0x4b57('0x60'),null,_0x4b57('0x61'))['where'](_0x4b57('0x62')+_0x2740a7);db[_0x4b57('0x5b')][_0x4b57('0x63')](_0x2ccf04[_0x4b57('0x3d')]())[_0x4b57('0x64')](function(_0x4eacac){var _0x52512b=[];for(var _0x2393fd=0x0;_0x2393fd<_0x4eacac[_0x4b57('0x1b')];_0x2393fd++){_0x52512b[_0x4b57('0x18')](getTimezoneData(_0x4eacac[_0x2393fd],tmp_campaigns));}BPromise[_0x4b57('0x19')](_0x52512b)[_0x4b57('0x17')](function(){_0x37da7d({'val':0x1});});})[_0x4b57('0x5c')](function(_0x31b2ce){logger[_0x4b57('0x56')](_0x31b2ce['message']);_0x37da7d({'val':0x0});});});}function updateTzVoiceQueues(_0x5a6010){return new Promise(function(_0x2901b8,_0x3a40d2){var _0x2f2cf8=squel[_0x4b57('0x33')]()[_0x4b57('0x34')]([_0x4b57('0x65'),_0x4b57('0x66')])['from'](_0x4b57('0x67'))[_0x4b57('0x10')]('voice_queues_has_cm_lists',null,_0x4b57('0x68'))[_0x4b57('0x12')]('voice_queues_has_cm_lists.CmListId='+_0x5a6010);db['sequelize'][_0x4b57('0x63')](_0x2f2cf8[_0x4b57('0x3d')]())['spread'](function(_0x3fc91d){var _0x15db96=[];for(var _0x2f1d75=0x0;_0x2f1d75<_0x3fc91d[_0x4b57('0x1b')];_0x2f1d75++){_0x15db96[_0x4b57('0x18')](getTimezoneData(_0x3fc91d[_0x2f1d75],tmp_voice_queues));}BPromise[_0x4b57('0x19')](_0x15db96)[_0x4b57('0x17')](function(){_0x2901b8({'val':0x1});});})[_0x4b57('0x5c')](function(_0x180413){logger['error'](_0x180413[_0x4b57('0x57')]);_0x2901b8({'val':0x0});});});}function getTimezoneData(_0x22779c,_0x51e90a){return new Promise(function(_0x40ff6f,_0x2b508c){var _0x4932c8=shared[_0x4b57('0x69')];var _0xa5de5d=_0x4932c8[_0x22779c[_0x4b57('0x6a')]];if(_[_0x4b57('0x1c')](_0xa5de5d)){_0x40ff6f({'ret':0x1});}else{var _0x4b86f0=_0xa5de5d[_0x4b57('0x6b')];var _0x4e5b74=squel[_0x4b57('0x45')]()['into'](_0x51e90a)['set']('id',_0x22779c['id'])['set'](_0x4b57('0x6c'),_0x4b86f0)[_0x4b57('0x6d')](_0x4b57('0x6a'),_0x22779c[_0x4b57('0x6a')])[_0x4b57('0x3d')]();return db[_0x4b57('0x5b')][_0x4b57('0x63')](_0x4e5b74)['spread'](function(_0x2bede3){_0x40ff6f({'ret':0x1});})[_0x4b57('0x5c')](function(_0x5132ff){logger[_0x4b57('0x56')](_0x5132ff[_0x4b57('0x57')]);_0x2b508c({'ret':0x1});});}});}function handleTZQuery(_0x477796){logger[_0x4b57('0x5a')](_0x477796);return db['sequelize'][_0x4b57('0x63')](_0x477796)[_0x4b57('0x64')](function(_0x464480){})[_0x4b57('0x5c')](function(_0x2e2346){logger[_0x4b57('0x56')](_0x2e2346['message']);});}function main(_0x333c3f,_0x4eba4b,_0x3d9807,_0x1eb14c){logger['info'](_0x4b57('0x6e'),_0x333c3f,JSON[_0x4b57('0x6f')](_0x4eba4b));process['send'](_0x4b57('0x70'));var _0x2fb43a=_0x4eba4b[_0x4b57('0x71')];var _0x476ece=_['clone'](_0x2fb43a);var _0x1bbb54=_0x4eba4b[_0x4b57('0x72')];var _0x49f61b=path[_0x4b57('0x10')](config[_0x4b57('0x73')],_0x4b57('0x74'),_0x1bbb54+_0x4b57('0x75'));hasTZ=_['keys'](_0x2fb43a)[_0x4b57('0x76')](_0x4b57('0x6a'));var _0x2aaa71=_[_0x4b57('0x4f')](_0x2fb43a)[_0x4b57('0x10')]();logger[_0x4b57('0x5a')](_0x4b57('0x77'),_0x2aaa71);db['ContactItemType'][_0x4b57('0x15')]({'raw':!![],'attributes':['id',_0x4b57('0x78')]})[_0x4b57('0x17')](function(_0x3be50c){for(var _0x430661=0x0;_0x430661<_0x3be50c[_0x4b57('0x1b')];_0x430661++){if(_0x3be50c[_0x430661]['name']in _0x2fb43a){contactItemTypes[_0x4b57('0x18')](_0x3be50c[_0x430661]);delete _0x476ece[_0x3be50c[_0x430661][_0x4b57('0x78')]];hasAdditionalPhones=!![];}for(var _0x4f1b5f in _0x2fb43a){if(_0x3be50c[_0x430661][_0x4b57('0x78')]+_0x4b57('0x79')===_0x4f1b5f){phoneDescriptions[_0x4b57('0x18')]({'itemTypeId':_0x3be50c[_0x430661]['id'],'description':_0x4f1b5f});delete _0x476ece[_0x4f1b5f];}}}if(hasAdditionalPhones)_0x476ece[_0x4b57('0x16')]='';var _0x540ac1=_['keys'](_0x476ece)['join']();logger['info'](_0x4b57('0x77'),_0x540ac1);fs[_0x4b57('0x7a')](_0x49f61b,_0x540ac1+'\x0a');Papa[_0x4b57('0x7b')](fs['createReadStream'](_0x333c3f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1855d2,_0x1ee939){try{for(var _0x57b668=0x0,_0x301b70=[];_0x57b668<_0x1855d2[_0x4b57('0x7c')][_0x4b57('0x1b')];_0x57b668++){stats[_0x4b57('0x7d')]+=0x1;if(_0x1855d2[_0x4b57('0x7e')][_0x57b668]){handleError(_0x1855d2['data'][_0x57b668],_0x1855d2[_0x4b57('0x7e')][_0x57b668]);}else{var _0x549040=[];var _0x593fc9=[];var _0x2bdb2a={};for(var _0x30a76c in _0x2fb43a){let _0x28d7fd=contactItemTypes[_0x4b57('0x7f')](_0x35bfae=>_0x35bfae[_0x4b57('0x78')]===_0x30a76c);let _0x26389a=contactItemTypes[_0x4b57('0x7f')](_0x3a0832=>_0x3a0832[_0x4b57('0x78')]+_0x4b57('0x79')===_0x30a76c);if(_[_0x4b57('0x1c')](_0x28d7fd)&&_[_0x4b57('0x1c')](_0x26389a)){if(_0x2fb43a[_0x4b57('0x80')](_0x30a76c)){if(_0x1855d2[_0x4b57('0x7c')][_0x57b668][_0x2fb43a[_0x30a76c]]){var _0x473190=_[_0x4b57('0x81')](_0x1855d2['data'][_0x57b668][_0x2fb43a[_0x30a76c]][_0x4b57('0x82')](/"/g,'\x27'));switch(_0x30a76c){case _0x4b57('0x2b'):var _0x2814fc=moment(_0x473190,_0x4b57('0xb'),!![]);if(_0x2814fc['isValid']()){_0x301b70[_0x4b57('0x18')]('\x22'+_0x473190+'\x22');}else{_0x549040[_0x4b57('0x18')](_0x4b57('0x83'));}break;case _0x4b57('0x30'):var _0x3983bc=parseInt(_0x473190);_0x473190=_[_0x4b57('0x84')](_0x3983bc)||_0x3983bc<0x0||_0x3983bc>0x4?_0x1eb14c?0x3:0x2:_0x3983bc;_0x301b70['push']('\x22'+_0x473190+'\x22');break;case _0x4b57('0x31'):var _0x31f504=parseInt(_0x473190);if(_[_0x4b57('0x85')](_0x31f504)&&_['includes'](_0x3d9807,_0x31f504)){_0x301b70[_0x4b57('0x18')]('\x22'+_0x31f504+'\x22');}else{_0x549040[_0x4b57('0x18')](_0x4b57('0x86'));}break;case _0x4b57('0x87'):if(isEmail(_0x473190)){_0x301b70['push']('\x22'+_0x473190+'\x22');}else{_0x549040[_0x4b57('0x18')](_0x4b57('0x88'));}break;case _0x4b57('0x89'):var _0x15b18f=moment(_0x473190,_0x4b57('0x8a'),!![]);if(_0x15b18f[_0x4b57('0x8b')]()){_0x301b70[_0x4b57('0x18')]('\x22'+_0x473190+'\x22');}else{_0x549040[_0x4b57('0x18')](_0x4b57('0x8c'));}break;case _0x4b57('0x6a'):var _0x2aa7ea=shared[_0x4b57('0x69')];var _0x56d6af=_0x2aa7ea[_0x473190];if(!_['isNil'](_0x56d6af)){var _0xbb2e17=_0x56d6af[_0x4b57('0x6b')];_0x301b70[_0x4b57('0x18')]('\x22'+_0x473190+'\x22');_0x301b70[_0x4b57('0x18')]('\x22'+_0xbb2e17+'\x22');}break;default:_0x301b70[_0x4b57('0x18')]('\x22'+_0x473190+'\x22');}}else{switch(_0x30a76c){case _0x4b57('0x8d'):case _0x4b57('0xf'):_0x549040[_0x4b57('0x18')](_0x30a76c+'\x20not\x20specified');break;default:_0x301b70[_0x4b57('0x18')]('\x22\x22');}}}}else{var _0x205a4e='';if(!_[_0x4b57('0x1c')](_0x28d7fd)){if(!_0x2bdb2a['hasOwnProperty'](_0x28d7fd['id'])){if(!_[_0x4b57('0x1c')](_0x1855d2[_0x4b57('0x7c')][_0x57b668][_0x2fb43a[_0x30a76c]])){var _0x473190=_[_0x4b57('0x81')](_0x1855d2[_0x4b57('0x7c')][_0x57b668][_0x2fb43a[_0x30a76c]][_0x4b57('0x82')](/"/g,'\x27'));var _0x10d64f=phoneDescriptions[_0x4b57('0x7f')](_0x350205=>_0x350205[_0x4b57('0x8e')]===_0x28d7fd['id']);if(!_[_0x4b57('0x1c')](_0x10d64f)){var _0x4ca419=_[_0x4b57('0x81')](_0x1855d2['data'][_0x57b668][_0x2fb43a[_0x10d64f[_0x4b57('0x8f')]]]['replace'](/"/g,'\x27'));if(!_[_0x4b57('0x1c')](_0x4ca419))_0x473190=_0x473190+'§'+_0x4ca419;}if(_0x205a4e=='')_0x205a4e=_0x473190;else _0x205a4e+='|'+_0x473190;}_0x593fc9[_0x4b57('0x18')](_0x28d7fd['id']+':'+_0x205a4e);_0x2bdb2a[_0x28d7fd['id']]=0x1;}}}}if(hasAdditionalPhones){_0x301b70[_0x4b57('0x18')]('\x22'+_0x593fc9[_0x4b57('0x10')](';')+'\x22');}if(_0x549040[_0x4b57('0x1b')]){handleError(_0x1855d2[_0x4b57('0x7c')][_0x57b668],{'code':'SystemRow','message':_0x549040[_0x4b57('0x10')]()});}else{fs[_0x4b57('0x90')](_0x49f61b,_0x301b70['join']()+'\x0a');}_0x301b70=[];}if(!(stats[_0x4b57('0x7d')]%0xc8)){socket[_0x4b57('0x91')](_0x4b57('0x92')+_0x1bbb54,stats);stats[_0x4b57('0x7e')]=[];}}if(stopped){logger[_0x4b57('0x5a')](_0x4b57('0x93'));_0x1ee939[_0x4b57('0x94')]();}}catch(_0x579bb8){handleError(_0x1855d2[_0x4b57('0x7c')][_0x57b668],{'code':_0x4b57('0x95'),'message':_0x579bb8['message']});logger['error'](_0x4b57('0x96'),_0x579bb8[_0x4b57('0x57')]);}},'complete':function(){try{var _0x169d5a=[];var _0x418505=[];var _0x1bc2c0='cm_contacts';if(_0x4eba4b[_0x4b57('0x97')]&&_0x4eba4b[_0x4b57('0x97')][_0x4b57('0x1b')]){_0x1bc2c0=_0x4b57('0x98')+_0x1bbb54;_0x169d5a['push'](_0x4b57('0x99')+_0x1bc2c0+_0x4b57('0x9a'));}tmp_campaigns=_0x4b57('0x9b')+_0x1bbb54;tmp_voice_queues=_0x4b57('0x9c')+_0x1bbb54;_0x418505[_0x4b57('0x18')](_0x4b57('0x99')+tmp_campaigns+_0x4b57('0x9d'));_0x418505[_0x4b57('0x18')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x4b57('0x9d'));BPromise[_0x4b57('0x9e')](_0x418505,handleTZQuery)[_0x4b57('0x17')](function(_0x29a399){updateTzCampaigns(_0x4eba4b[_0x4b57('0x2d')])[_0x4b57('0x17')](function(_0x16e81c){updateTzVoiceQueues(_0x4eba4b[_0x4b57('0x2d')])[_0x4b57('0x17')](function(_0x459780){if(hasTZ)_0x540ac1=_0x540ac1['replace']('dialTimezone','dialTimezone,utcOffset');var _0x20c509=util['format'](_0x4b57('0x9f'),_0x49f61b,_0x1bc2c0,_0x540ac1,_0x4eba4b['ListId'],_0x4eba4b[_0x4b57('0x50')]||null,NOW,NOW);if(_[_0x4b57('0x1c')](_0x2fb43a['scheduledat'])){_0x20c509+=_0x4b57('0xa0');}_0x169d5a[_0x4b57('0x18')](_0x20c509);if(_0x4eba4b[_0x4b57('0x97')]&&_0x4eba4b[_0x4b57('0x97')][_0x4b57('0x1b')]){_0x169d5a[_0x4b57('0x18')](insertCmContact(_0x4eba4b[_0x4b57('0x2d')],_0x1bc2c0,_0x4eba4b[_0x4b57('0x97')],_0x2fb43a));_0x169d5a[_0x4b57('0x18')](_0x4b57('0xa1')+_0x1bc2c0+';');}BPromise[_0x4b57('0x9e')](_0x169d5a,handleQuery)[_0x4b57('0x17')](function(_0x385879){BPromise[_0x4b57('0x19')]([handleAdditionalPhones()])['then'](function(){_0x169d5a=[];for(var _0x26ac2e=0x0;_0x26ac2e\x20\x20');}var _0x644f13=path['join'](config[_0x4b57('0x73')],'server/files/tmp',process['argv'][0x2]);if(!fs['existsSync'](_0x644f13)){throw new Error(_0x4b57('0xae'));}var _0x54e8e2={};try{_0x54e8e2=JSON[_0x4b57('0x7b')](process[_0x4b57('0xad')][0x3]);if(!_0x54e8e2[_0x4b57('0x71')]){throw new Error(_0x4b57('0xaf'));}if(!_0x54e8e2[_0x4b57('0x71')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x54e8e2['binding']['firstName']){throw new Error(_0x4b57('0xb0'));}var _0x1dd304=0x0;if(_0x54e8e2[_0x4b57('0x71')][_0x4b57('0x31')]){_0x1dd304=0x1;}if(!_0x54e8e2['ListId']){throw new Error(_0x4b57('0xb1'));}}catch(_0x3569ad){throw new Error('body\x20id\x20mandatory');}var _0x1b2313=[];try{_0x1b2313=_['map'](JSON[_0x4b57('0x7b')](process['argv'][0x4]),'id');}catch(_0x245a99){logger[_0x4b57('0x5a')](_0x4b57('0xb2'));}main(_0x644f13,_0x54e8e2,_0x1b2313,_0x1dd304);}validate();process['on'](_0x4b57('0xb3'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x85f6=['CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues','campaigns','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','then','split','length','all','isNil','push','findOne','update','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','updatedAt','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','cm_contacts.createdAt','phone','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','createdAt','priority','UserId','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','errors','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','main','stringify','send','start','clone','socket_timestamp','server/files/tmp','findAll','name','_description','AdditionalPhones','header','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x85f6,0xdf));var _0x685f=function(_0x519d6c,_0x9092c4){_0x519d6c=_0x519d6c-0x0;var _0x40ec69=_0x85f6[_0x519d6c];return _0x40ec69;};'use strict';var fs=require('fs');var path=require(_0x685f('0x0'));var _=require(_0x685f('0x1'));var Papa=require(_0x685f('0x2'));var util=require(_0x685f('0x3'));var BPromise=require(_0x685f('0x4'));var moment=require(_0x685f('0x5'));var squel=require(_0x685f('0x6'));var Redis=require(_0x685f('0x7'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0x685f('0x8'));var logger=require('../../../config/logger')(_0x685f('0x9'));config[_0x685f('0xa')]=_[_0x685f('0xb')](config[_0x685f('0xa')],{'host':_0x685f('0xc'),'port':0x18eb});var socket=require(_0x685f('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x685f('0xe')](_0x685f('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x685f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x553134){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))*$/[_0x685f('0x10')](_0x553134);}function selectNotIn(_0x3660f6,_0x213aed,_0x732254,_0x8e6ba3,_0x54f1c6){return squel[_0x685f('0x11')]()[_0x685f('0x12')]('phone')[_0x685f('0x13')](_0x8e6ba3)[_0x685f('0x14')](_0x213aed,null,_0x213aed+'.id\x20=\x20'+_0x8e6ba3+'.'+_0x732254)['where'](_0x8e6ba3+'.'+_0x732254+_0x685f('0x15')+_0x3660f6+'.'+_0x732254)['where'](_0x213aed+_0x685f('0x16')+_0x54f1c6[_0x685f('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2510d9,_0x46446f){promisesAdditionalPhones=[];return db[_0x685f('0x17')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x685f('0x18')](function(_0x72f849){if(_0x72f849!==null){var _0x1b0b35=[];for(var _0x35c4c8=0x0;_0x35c4c8<_0x72f849['length'];_0x35c4c8++){var _0x284f33=_0x72f849[_0x35c4c8];_0x1b0b35['push'](insertAdditionalPhones(_0x284f33));}}Promise['all'](_0x1b0b35)[_0x685f('0x18')](function(){_0x2510d9({'val':0x1});});});});}function insertAdditionalPhones(_0x31d01e){return new Promise(function(_0x5d5046,_0x3d5904){var _0x550744=_0x31d01e['AdditionalPhones'];var _0x4140f9=_0x550744[_0x685f('0x19')](';');var _0x3efcff=[];orderBy=0x0;for(var _0x34bd0b=0x0;_0x34bd0b<_0x4140f9[_0x685f('0x1a')];_0x34bd0b++){_0x3efcff['push'](splitAdditionalPhone(_0x31d01e['id'],_0x4140f9[_0x34bd0b]));}Promise[_0x685f('0x1b')](_0x3efcff)[_0x685f('0x18')](function(){_0x5d5046({'val':_0x4140f9[_0x685f('0x1a')]});});});}function splitAdditionalPhone(_0x47cbd4,_0x222045){return new Promise(function(_0x2df8b1,_0x3ea42e){var _0x43395d=_0x222045[_0x685f('0x19')](':');var _0x264a11=_0x43395d[0x0];var _0x5f2c5a=_0x43395d[0x1];if(!_[_0x685f('0x1c')](_0x5f2c5a)){var _0x4ebc28=_0x5f2c5a['split']('|');var _0x7d6680=[];for(var _0x2415eb=0x0;_0x2415eb<_0x4ebc28[_0x685f('0x1a')];_0x2415eb++){if(_0x4ebc28[_0x2415eb]!==''){var _0x56f5b5=_['filter'](promisesAdditionalPhones,{'contactId':_0x47cbd4,'phone':_0x4ebc28[_0x2415eb]});if(_0x56f5b5[_0x685f('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x685f('0x1d')]({'contactId':_0x47cbd4,'contactTypeId':_0x264a11,'phone':_0x4ebc28[_0x2415eb],'orderBy':orderBy});}}}_0x2df8b1({'ok':0x1});}else _0x2df8b1({'res':0x0});});}function createAdditionalPhone(_0x337b06,_0x5707fd,_0x5ffa0e,_0x9e9f16){var _0x2f1a09='';var _0x2ee580='';var _0x19af62=_0x5ffa0e['split']('§');_0x2f1a09=_0x19af62[0x0];if(_0x19af62[_0x685f('0x1a')]==0x2)_0x2ee580=_0x19af62[0x1];return new Promise(function(_0x19c0ff,_0x32b800){return db['CmContactHasItem'][_0x685f('0x1e')]({'where':{'CmContactId':_0x337b06,'item':_0x2f1a09}})[_0x685f('0x18')](function(_0x34ac21){if(_0x34ac21){return db['CmContactHasItem'][_0x685f('0x1f')]({'ItemTypeId':_0x5707fd,'description':_0x2ee580,'OrderBy':_0x9e9f16},{'where':{'CmContactId':_0x337b06,'item':_0x2f1a09}})['then'](function(_0x113653){_0x19c0ff({'res':'updated'});});}else{return db[_0x685f('0x20')][_0x685f('0x21')]({'CmContactId':_0x337b06,'item':_0x2f1a09,'description':_0x2ee580,'ItemTypeId':_0x5707fd,'OrderBy':_0x9e9f16,'ItemClass':_0x685f('0x22')})['then'](function(_0x2af19e){_0x19c0ff({'res':_0x685f('0x23')});});}});});}function insertCmHopper(_0x12cda5,_0x47dadd,_0x262539,_0x40f646,_0x4ed673){var _0x2fd824=[_0x685f('0x24'),'cm_contacts.scheduledat',_0x685f('0x25'),'cm_contacts.ListId',_0x47dadd+'.'+_0x40f646,'cm_contacts.createdAt',_0x685f('0x26'),'cm_contacts.priority',_0x685f('0x27'),'\x22'+_0x4ed673+'\x22'];return squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x2a'))[_0x685f('0x2b')](['phone','scheduledat',_0x685f('0x2c'),_0x685f('0x2d'),_0x40f646,'createdAt',_0x685f('0x2e'),'priority','UserId','recallme'],squel[_0x685f('0x11')]()[_0x685f('0x2f')](_0x2fd824)[_0x685f('0x13')](_0x47dadd)[_0x685f('0x14')](_0x685f('0x30'),null,_0x685f('0x31')+_0x47dadd+_0x685f('0x32'))[_0x685f('0x14')](_0x262539,null,_0x262539+_0x685f('0x33')+_0x47dadd+'.'+_0x40f646)[_0x685f('0x34')](_0x47dadd+_0x685f('0x35'),_0x12cda5)[_0x685f('0x34')](_0x685f('0x36'),NOW)[_0x685f('0x34')](_0x685f('0x37'),selectNotIn(_0x47dadd,_0x262539,_0x40f646,_0x685f('0x2a'),[_0x685f('0x38'),_0x685f('0x39')]))['where'](_0x685f('0x37'),selectNotIn(_0x47dadd,_0x262539,_0x40f646,_0x685f('0x2a'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x1b2030,_0x3ee29d,_0x1db800,_0x440859){var _0x354636=[_0x685f('0x24'),_0x685f('0x25'),_0x685f('0x3a'),_0x3ee29d+'.'+_0x440859,_0x685f('0x3b'),_0x685f('0x26')];return squel[_0x685f('0x28')]()[_0x685f('0x29')]('cm_hopper_black')[_0x685f('0x2b')]([_0x685f('0x3c'),_0x685f('0x2c'),_0x685f('0x2d'),_0x440859,'createdAt','updatedAt'],squel['select']()['fields'](_0x354636)[_0x685f('0x13')](_0x3ee29d)['join'](_0x685f('0x30'),null,_0x685f('0x31')+_0x3ee29d+_0x685f('0x32'))['join'](_0x1db800,null,_0x1db800+_0x685f('0x33')+_0x3ee29d+'.'+_0x440859)['where'](_0x3ee29d+_0x685f('0x35'),_0x1b2030)[_0x685f('0x34')](_0x685f('0x36'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x685f('0x3c'))['from'](_0x685f('0x3d'))[_0x685f('0x34')](_0x685f('0x3e'),_0x1b2030)[_0x685f('0x34')](_0x440859+_0x685f('0x15')+_0x3ee29d+'.'+_0x440859)))['toString']();}function insertTzCmHopper(_0x11e6c2,_0x26304b,_0x34db4e,_0x1ad71f,_0x5351f0,_0x48c0ca){var _0xa5b1a0=[_0x685f('0x24'),_0x685f('0x3f')+_0x48c0ca+_0x685f('0x40'),_0x685f('0x25'),_0x685f('0x3a'),_0x26304b+'.'+_0x1ad71f,'cm_contacts.createdAt',_0x685f('0x26'),_0x685f('0x41'),'cm_contacts.UserId','\x22'+_0x5351f0+'\x22'];var _0xf850bc=squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x2a'))['fromQuery'](['phone','scheduledat','ContactId',_0x685f('0x2d'),_0x1ad71f,_0x685f('0x42'),'updatedAt',_0x685f('0x43'),_0x685f('0x44'),'recallme'],squel[_0x685f('0x11')]()[_0x685f('0x2f')](_0xa5b1a0)[_0x685f('0x13')](_0x26304b)[_0x685f('0x14')](_0x685f('0x30'),null,_0x685f('0x31')+_0x26304b+_0x685f('0x32'))['join'](_0x34db4e,null,_0x34db4e+'.id\x20=\x20'+_0x26304b+'.'+_0x1ad71f)['join'](_0x48c0ca,null,_0x48c0ca+_0x685f('0x33')+_0x26304b+'.'+_0x1ad71f)[_0x685f('0x34')](_0x26304b+'.CmListId\x20=\x20?',_0x11e6c2)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x685f('0x34')](_0x685f('0x37'),selectNotIn(_0x26304b,_0x34db4e,_0x1ad71f,_0x685f('0x2a'),[_0x685f('0x38'),_0x685f('0x39')]))[_0x685f('0x34')](_0x685f('0x37'),selectNotIn(_0x26304b,_0x34db4e,_0x1ad71f,_0x685f('0x2a'),['\x22always\x22'])))[_0x685f('0x45')]();return _0xf850bc;}function insertTzCmHopperBlack(_0x29eda6,_0x169526,_0x5576f8,_0x20c1b9){var _0x2393e3=['cm_contacts.phone',_0x685f('0x25'),_0x685f('0x3a'),_0x169526+'.'+_0x20c1b9,_0x685f('0x3b'),_0x685f('0x26')];return squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x3d'))[_0x685f('0x2b')]([_0x685f('0x3c'),_0x685f('0x2c'),_0x685f('0x2d'),_0x20c1b9,_0x685f('0x42'),_0x685f('0x2e')],squel[_0x685f('0x11')]()[_0x685f('0x2f')](_0x2393e3)[_0x685f('0x13')](_0x169526)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x169526+_0x685f('0x32'))[_0x685f('0x14')](_0x5576f8,null,_0x5576f8+_0x685f('0x33')+_0x169526+'.'+_0x20c1b9)[_0x685f('0x34')](_0x169526+_0x685f('0x35'),_0x29eda6)[_0x685f('0x34')](_0x685f('0x36'),NOW)[_0x685f('0x34')](_0x685f('0x37'),squel[_0x685f('0x11')]()[_0x685f('0x12')]('phone')['from'](_0x685f('0x3d'))[_0x685f('0x34')]('ListId\x20=\x20?',_0x29eda6)['where'](_0x20c1b9+_0x685f('0x15')+_0x169526+'.'+_0x20c1b9)))[_0x685f('0x45')]();}function insertCmHopperAdditionalPhones(_0x5060ed){var _0x4b1c75=[_0x685f('0x46'),_0x685f('0x47'),_0x685f('0x48'),_0x685f('0x49'),_0x685f('0x4a')];return squel[_0x685f('0x28')]()['into'](_0x685f('0x4b'))['fromQuery']([_0x685f('0x4c'),_0x685f('0x3c'),_0x685f('0x4d'),_0x685f('0x42'),_0x685f('0x2e')],squel['select']()[_0x685f('0x2f')](_0x4b1c75)[_0x685f('0x13')]('cm_hopper')[_0x685f('0x14')](_0x685f('0x30'),null,_0x685f('0x4e'))[_0x685f('0x14')](_0x685f('0x4f'),null,_0x685f('0x50'))['where'](_0x685f('0x51'),_0x5060ed)[_0x685f('0x34')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x685f('0x45')]();}function insertCmContact(_0x57d437,_0x2b7e62,_0x239038,_0x47e5c2){var _0x51deaa=_[_0x685f('0x52')](_[_0x685f('0x53')](_0x47e5c2),[_0x685f('0x2d'),_0x685f('0x54'),_0x685f('0x42'),_0x685f('0x2e')]);return squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x30'))[_0x685f('0x2b')](_0x51deaa,squel[_0x685f('0x11')]()['fields'](_0x51deaa)[_0x685f('0x13')](_0x2b7e62)[_0x685f('0x34')]('('+_0x239038[_0x685f('0x14')](',')+_0x685f('0x55'),squel['select']()[_0x685f('0x2f')](_0x239038)[_0x685f('0x13')](_0x685f('0x30'))['where'](_0x685f('0x3e'),_0x57d437)[_0x685f('0x34')](_0x685f('0x56')))['where'](_0x685f('0x57'),squel['select']()[_0x685f('0x12')](_0x685f('0x58'),_0x685f('0x59'))['from'](_0x2b7e62)[_0x685f('0x5a')](_0x239038['join'](','))))[_0x685f('0x45')]();}function handleStop(){logger[_0x685f('0x5b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xb7bd13){logger[_0x685f('0x5c')](_0xb7bd13[_0x685f('0x5d')]);process['exit'](0x1);}function handleError(_0x189914,_0x42837e){stats[_0x685f('0x5e')]['push']({'name':_0x42837e['code'],'message':_0x42837e[_0x685f('0x5d')],'row':_0x189914});}function handleQuery(_0x1ba1cd){logger[_0x685f('0x5b')](_0x1ba1cd);return db[_0x685f('0x5f')]['query'](_0x1ba1cd)[_0x685f('0x60')](function(_0x54f79e){results[_0x685f('0x1d')](_0x54f79e);})[_0x685f('0x61')](function(_0x45d143){logger[_0x685f('0x5c')](_0x45d143[_0x685f('0x5d')]);});}function updateTzCampaigns(_0x77a61f){return new Promise(function(_0x354b36,_0x5e02e2){var _0x350452=squel[_0x685f('0x11')]()['fields']([_0x685f('0x62'),_0x685f('0x63')])[_0x685f('0x13')]('campaigns')[_0x685f('0x14')](_0x685f('0x64'),null,_0x685f('0x65'))[_0x685f('0x34')]('campaigns_has_cm_lists.CmListId='+_0x77a61f);db['sequelize'][_0x685f('0x66')](_0x350452[_0x685f('0x45')]())[_0x685f('0x60')](function(_0x41b04a){var _0x3dfe01=[];for(var _0x40d215=0x0;_0x40d215<_0x41b04a['length'];_0x40d215++){_0x3dfe01[_0x685f('0x1d')](getTimezoneData(_0x41b04a[_0x40d215],tmp_campaigns));}BPromise[_0x685f('0x1b')](_0x3dfe01)[_0x685f('0x18')](function(){_0x354b36({'val':0x1});});})[_0x685f('0x61')](function(_0xb5eb1d){logger[_0x685f('0x5c')](_0xb5eb1d[_0x685f('0x5d')]);_0x354b36({'val':0x0});});});}function updateTzVoiceQueues(_0x5992eb){return new Promise(function(_0x2f9e96,_0x2ac062){var _0x37a16b=squel[_0x685f('0x11')]()[_0x685f('0x2f')]([_0x685f('0x67'),_0x685f('0x68')])[_0x685f('0x13')]('voice_queues')[_0x685f('0x14')]('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x685f('0x34')](_0x685f('0x69')+_0x5992eb);db[_0x685f('0x5f')][_0x685f('0x66')](_0x37a16b['toString']())['spread'](function(_0x1ad013){var _0x32de99=[];for(var _0x2318c4=0x0;_0x2318c4<_0x1ad013[_0x685f('0x1a')];_0x2318c4++){_0x32de99['push'](getTimezoneData(_0x1ad013[_0x2318c4],tmp_voice_queues));}BPromise[_0x685f('0x1b')](_0x32de99)[_0x685f('0x18')](function(){_0x2f9e96({'val':0x1});});})['catch'](function(_0xb3be3c){logger['error'](_0xb3be3c['message']);_0x2f9e96({'val':0x0});});});}function getTimezoneData(_0xbe119c,_0x493a3e){return new Promise(function(_0x5e785c,_0xd8a295){var _0x526bf5=shared[_0x685f('0x6a')];var _0x1e6b62=_0x526bf5[_0xbe119c[_0x685f('0x6b')]];if(_[_0x685f('0x1c')](_0x1e6b62)){_0x5e785c({'ret':0x1});}else{var _0x52ac0f=_0x1e6b62['utcOffset'];var _0x48f85e=squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x493a3e)[_0x685f('0x6c')]('id',_0xbe119c['id'])[_0x685f('0x6c')]('offset',_0x52ac0f)[_0x685f('0x6c')](_0x685f('0x6b'),_0xbe119c['dialTimezone'])[_0x685f('0x45')]();return db['sequelize'][_0x685f('0x66')](_0x48f85e)[_0x685f('0x60')](function(_0x203f7a){_0x5e785c({'ret':0x1});})[_0x685f('0x61')](function(_0x40479b){logger['error'](_0x40479b[_0x685f('0x5d')]);_0xd8a295({'ret':0x1});});}});}function handleTZQuery(_0x3db970){logger[_0x685f('0x5b')](_0x3db970);return db['sequelize'][_0x685f('0x66')](_0x3db970)[_0x685f('0x60')](function(_0x4931d2){})[_0x685f('0x61')](function(_0x5e2662){logger[_0x685f('0x5c')](_0x5e2662[_0x685f('0x5d')]);});}function main(_0x3ae9c3,_0xf4958c,_0xa79254,_0x4bf260){logger[_0x685f('0x5b')](_0x685f('0x6d'),_0x3ae9c3,JSON[_0x685f('0x6e')](_0xf4958c));process[_0x685f('0x6f')](_0x685f('0x70'));var _0x445b05=_0xf4958c['binding'];var _0x3fe932=_[_0x685f('0x71')](_0x445b05);var _0x831c1a=_0xf4958c[_0x685f('0x72')];var _0x7de203=path['join'](config['root'],_0x685f('0x73'),_0x831c1a+'.csv');hasTZ=_[_0x685f('0x53')](_0x445b05)['includes'](_0x685f('0x6b'));var _0x4f6ff5=_[_0x685f('0x53')](_0x445b05)[_0x685f('0x14')]();logger['info']('header',_0x4f6ff5);db['ContactItemType'][_0x685f('0x74')]({'raw':!![],'attributes':['id',_0x685f('0x75')]})[_0x685f('0x18')](function(_0x3ad2b7){for(var _0x427cef=0x0;_0x427cef<_0x3ad2b7['length'];_0x427cef++){if(_0x3ad2b7[_0x427cef][_0x685f('0x75')]in _0x445b05){contactItemTypes[_0x685f('0x1d')](_0x3ad2b7[_0x427cef]);delete _0x3fe932[_0x3ad2b7[_0x427cef]['name']];hasAdditionalPhones=!![];}for(var _0x24d4c0 in _0x445b05){if(_0x3ad2b7[_0x427cef]['name']+_0x685f('0x76')===_0x24d4c0){phoneDescriptions[_0x685f('0x1d')]({'itemTypeId':_0x3ad2b7[_0x427cef]['id'],'description':_0x24d4c0});delete _0x3fe932[_0x24d4c0];}}}if(hasAdditionalPhones)_0x3fe932[_0x685f('0x77')]='';var _0xe606eb=_['keys'](_0x3fe932)[_0x685f('0x14')]();logger[_0x685f('0x5b')](_0x685f('0x78'),_0xe606eb);fs['writeFileSync'](_0x7de203,_0xe606eb+'\x0a');Papa[_0x685f('0x79')](fs[_0x685f('0x7a')](_0x3ae9c3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x536610,_0x491097){try{for(var _0x5d8b14=0x0,_0xee5b40=[];_0x5d8b14<_0x536610[_0x685f('0x7b')][_0x685f('0x1a')];_0x5d8b14++){stats[_0x685f('0x7c')]+=0x1;if(_0x536610[_0x685f('0x5e')][_0x5d8b14]){handleError(_0x536610[_0x685f('0x7b')][_0x5d8b14],_0x536610[_0x685f('0x5e')][_0x5d8b14]);}else{var _0x296799=[];var _0x364877=[];var _0x504ab2={};for(var _0x56767a in _0x445b05){let _0x64633e=contactItemTypes[_0x685f('0x7d')](_0x2969c6=>_0x2969c6[_0x685f('0x75')]===_0x56767a);let _0x24a8f3=contactItemTypes[_0x685f('0x7d')](_0x34f373=>_0x34f373[_0x685f('0x75')]+'_description'===_0x56767a);if(_[_0x685f('0x1c')](_0x64633e)&&_['isNil'](_0x24a8f3)){if(_0x445b05[_0x685f('0x7e')](_0x56767a)){if(_0x536610[_0x685f('0x7b')][_0x5d8b14][_0x445b05[_0x56767a]]){var _0x23a3b9=_[_0x685f('0x7f')](_0x536610['data'][_0x5d8b14][_0x445b05[_0x56767a]][_0x685f('0x80')](/"/g,'\x27'));switch(_0x56767a){case _0x685f('0x81'):var _0x31c44b=moment(_0x23a3b9,_0x685f('0xf'),!![]);if(_0x31c44b[_0x685f('0x82')]()){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}else{_0x296799[_0x685f('0x1d')](_0x685f('0x83'));}break;case _0x685f('0x43'):var _0x2343c2=parseInt(_0x23a3b9);_0x23a3b9=_[_0x685f('0x84')](_0x2343c2)||_0x2343c2<0x0||_0x2343c2>0x4?_0x4bf260?0x3:0x2:_0x2343c2;_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');break;case _0x685f('0x44'):var _0x30cf94=parseInt(_0x23a3b9);if(_[_0x685f('0x85')](_0x30cf94)&&_[_0x685f('0x86')](_0xa79254,_0x30cf94)){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x30cf94+'\x22');}else{_0x296799[_0x685f('0x1d')]('agent\x20not\x20exists');}break;case _0x685f('0x87'):if(isEmail(_0x23a3b9)){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}else{_0x296799['push'](_0x685f('0x88'));}break;case _0x685f('0x89'):var _0x376d27=moment(_0x23a3b9,_0x685f('0x8a'),!![]);if(_0x376d27[_0x685f('0x82')]()){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}else{_0x296799['push'](_0x685f('0x8b'));}break;case _0x685f('0x6b'):var _0x5d79a6=shared[_0x685f('0x6a')];var _0x638f8c=_0x5d79a6[_0x23a3b9];if(!_[_0x685f('0x1c')](_0x638f8c)){var _0x21a72e=_0x638f8c[_0x685f('0x8c')];_0xee5b40['push']('\x22'+_0x23a3b9+'\x22');_0xee5b40[_0x685f('0x1d')]('\x22'+_0x21a72e+'\x22');}break;default:_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}}else{switch(_0x56767a){case _0x685f('0x8d'):case'phone':_0x296799[_0x685f('0x1d')](_0x56767a+_0x685f('0x8e'));break;default:_0xee5b40[_0x685f('0x1d')]('\x22\x22');}}}}else{var _0x1e18f1='';if(!_[_0x685f('0x1c')](_0x64633e)){if(!_0x504ab2['hasOwnProperty'](_0x64633e['id'])){if(!_[_0x685f('0x1c')](_0x536610['data'][_0x5d8b14][_0x445b05[_0x56767a]])){var _0x23a3b9=_[_0x685f('0x7f')](_0x536610[_0x685f('0x7b')][_0x5d8b14][_0x445b05[_0x56767a]][_0x685f('0x80')](/"/g,'\x27'));var _0x24287c=phoneDescriptions[_0x685f('0x7d')](_0x3ab8f4=>_0x3ab8f4[_0x685f('0x8f')]===_0x64633e['id']);if(!_[_0x685f('0x1c')](_0x24287c)){var _0x211541=_['trim'](_0x536610[_0x685f('0x7b')][_0x5d8b14][_0x445b05[_0x24287c[_0x685f('0x90')]]][_0x685f('0x80')](/"/g,'\x27'));if(!_['isNil'](_0x211541))_0x23a3b9=_0x23a3b9+'§'+_0x211541;}if(_0x1e18f1=='')_0x1e18f1=_0x23a3b9;else _0x1e18f1+='|'+_0x23a3b9;}_0x364877[_0x685f('0x1d')](_0x64633e['id']+':'+_0x1e18f1);_0x504ab2[_0x64633e['id']]=0x1;}}}}if(hasAdditionalPhones){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x364877[_0x685f('0x14')](';')+'\x22');}if(_0x296799['length']){handleError(_0x536610[_0x685f('0x7b')][_0x5d8b14],{'code':_0x685f('0x91'),'message':_0x296799['join']()});}else{fs['appendFileSync'](_0x7de203,_0xee5b40[_0x685f('0x14')]()+'\x0a');}_0xee5b40=[];}if(!(stats[_0x685f('0x7c')]%0xc8)){socket[_0x685f('0x92')](_0x685f('0x93')+_0x831c1a,stats);stats[_0x685f('0x5e')]=[];}}if(stopped){logger[_0x685f('0x5b')](_0x685f('0x94'));_0x491097[_0x685f('0x95')]();}}catch(_0x493fde){handleError(_0x536610[_0x685f('0x7b')][_0x5d8b14],{'code':_0x685f('0x96'),'message':_0x493fde['message']});logger[_0x685f('0x5c')](_0x685f('0x97'),_0x493fde['message']);}},'complete':function(){try{var _0x5f2286=[];var _0x1ee614=[];var _0x264cf2='cm_contacts';if(_0xf4958c[_0x685f('0x98')]&&_0xf4958c['duplicates'][_0x685f('0x1a')]){_0x264cf2='cm_contacts_'+_0x831c1a;_0x5f2286[_0x685f('0x1d')](_0x685f('0x99')+_0x264cf2+_0x685f('0x9a'));}tmp_campaigns=_0x685f('0x9b')+_0x831c1a;tmp_voice_queues='voice_queues_'+_0x831c1a;_0x1ee614[_0x685f('0x1d')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x685f('0x9c'));_0x1ee614['push'](_0x685f('0x99')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x1ee614,handleTZQuery)[_0x685f('0x18')](function(_0x1f2aba){updateTzCampaigns(_0xf4958c[_0x685f('0x2d')])[_0x685f('0x18')](function(_0x34872e){updateTzVoiceQueues(_0xf4958c[_0x685f('0x2d')])[_0x685f('0x18')](function(_0x44383e){if(hasTZ)_0xe606eb=_0xe606eb['replace']('dialTimezone',_0x685f('0x9d'));var _0x4f5d0f=util[_0x685f('0xe')](_0x685f('0x9e'),_0x7de203,_0x264cf2,_0xe606eb,_0xf4958c[_0x685f('0x2d')],_0xf4958c['CompanyId']||null,NOW,NOW);if(_[_0x685f('0x1c')](_0x445b05[_0x685f('0x81')])){_0x4f5d0f+=',\x20scheduledAt\x20=\x20NOW()';}_0x5f2286[_0x685f('0x1d')](_0x4f5d0f);if(_0xf4958c[_0x685f('0x98')]&&_0xf4958c[_0x685f('0x98')][_0x685f('0x1a')]){_0x5f2286['push'](insertCmContact(_0xf4958c['ListId'],_0x264cf2,_0xf4958c['duplicates'],_0x445b05));_0x5f2286[_0x685f('0x1d')](_0x685f('0x9f')+_0x264cf2+';');}BPromise[_0x685f('0xa0')](_0x5f2286,handleQuery)[_0x685f('0x18')](function(_0x49ccba){BPromise[_0x685f('0x1b')]([handleAdditionalPhones()])[_0x685f('0x18')](function(){_0x5f2286=[];for(var _0x4af3e6=0x0;_0x4af3e6\x20\x20','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','YYYYMMDDHHmmss','test','select','field','phone','from','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','AdditionalPhones','push','catch','error','message','isNil','split','filter','CmContactHasItem','findOne','then','updated','create','PHONE','inserted','update','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','main','stringify','send','start','binding','clone','root','server/files/tmp','name','header','writeFileSync','parse','createReadStream','rows','data','find'];(function(_0x17bdd1,_0x4e368e){var _0x4f79dc=function(_0x748d7b){while(--_0x748d7b){_0x17bdd1['push'](_0x17bdd1['shift']());}};_0x4f79dc(++_0x4e368e);}(_0x5ed0,0xcb));var _0x05ed=function(_0x33deb0,_0x4619f7){_0x33deb0=_0x33deb0-0x0;var _0x3682c8=_0x5ed0[_0x33deb0];return _0x3682c8;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x05ed('0x0'));var Papa=require(_0x05ed('0x1'));var util=require(_0x05ed('0x2'));var BPromise=require(_0x05ed('0x3'));var moment=require(_0x05ed('0x4'));var squel=require(_0x05ed('0x5'));var Redis=require(_0x05ed('0x6'));var db=require(_0x05ed('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x05ed('0x8'))('import');config['redis']=_[_0x05ed('0x9')](config[_0x05ed('0xa')],{'host':_0x05ed('0xb'),'port':0x18eb});var socket=require(_0x05ed('0xc'))(new Redis(config[_0x05ed('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x05ed('0xd'));var tempTableName='cm_contacts_temp_'+moment()[_0x05ed('0xe')](_0x05ed('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4dd2e4){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))*$/[_0x05ed('0x10')](_0x4dd2e4);}function selectNotIn(_0x1c6502,_0x4fdba5,_0x23e227,_0x2a50e3,_0x18954b){return squel[_0x05ed('0x11')]()[_0x05ed('0x12')](_0x05ed('0x13'))[_0x05ed('0x14')](_0x2a50e3)['join'](_0x4fdba5,null,_0x4fdba5+'.id\x20=\x20'+_0x2a50e3+'.'+_0x23e227)['where'](_0x2a50e3+'.'+_0x23e227+_0x05ed('0x15')+_0x1c6502+'.'+_0x23e227)[_0x05ed('0x16')](_0x4fdba5+_0x05ed('0x17')+_0x18954b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x227853,_0x22aa5c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x05ed('0x18')][_0x05ed('0x19')]('select\x20*\x20from\x20'+tempTableName)[_0x05ed('0x1a')](function(_0x3ccf0b){if(_0x3ccf0b!==null){var _0x19dcff=[];for(var _0x5aa57c=0x0;_0x5aa57c<_0x3ccf0b[_0x05ed('0x1b')];_0x5aa57c++){var _0x258da6=_0x3ccf0b[_0x5aa57c];if(!_['isNil'](_0x258da6[_0x05ed('0x13')])){if(!_['isNil'](_0x258da6[_0x05ed('0x1c')]))_0x19dcff[_0x05ed('0x1d')](insertAdditionalPhones(_0x258da6));promisesContact[_0x05ed('0x1d')]({'contact':_0x258da6});}}}Promise['all'](_0x19dcff)['then'](function(){_0x227853({'val':0x1});});})[_0x05ed('0x1e')](function(_0xe7ee13){logger[_0x05ed('0x1f')](_0xe7ee13[_0x05ed('0x20')]);});});}function insertAdditionalPhones(_0x397a45){return new Promise(function(_0x3b023c,_0xd0e6ba){var _0x4cb6a9=_0x397a45[_0x05ed('0x1c')];if(_[_0x05ed('0x21')](_0x4cb6a9))_0xd0e6ba({'val':0x0});else{var _0x13eba9=_0x4cb6a9['split'](';');var _0x2a3302=[];orderBy=0x0;for(var _0x52aa1a=0x0;_0x52aa1a<_0x13eba9[_0x05ed('0x1b')];_0x52aa1a++){_0x2a3302['push'](splitAdditionalPhone(_0x397a45['id'],_0x13eba9[_0x52aa1a]));}Promise['all'](_0x2a3302)['then'](function(){_0x3b023c({'val':_0x13eba9['length']});});}});}function splitAdditionalPhone(_0x26e6b1,_0x278678){return new Promise(function(_0x3acd60,_0x45e18e){var _0x559b60=_0x278678['split'](':');var _0x3eceda=_0x559b60[0x0];var _0x307321=_0x559b60[0x1];if(_0x307321!==''){var _0x1477c9=_0x307321[_0x05ed('0x22')]('|');var _0x20ff35=[];for(var _0x3c8516=0x0;_0x3c8516<_0x1477c9[_0x05ed('0x1b')];_0x3c8516++){if(_0x1477c9[_0x3c8516]!==''){var _0x141c8f=_[_0x05ed('0x23')](promisesAdditionalPhones,{'contactId':_0x26e6b1,'phone':_0x1477c9[_0x3c8516]});if(_0x141c8f['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x26e6b1,'contactTypeId':_0x3eceda,'phone':_0x1477c9[_0x3c8516],'orderBy':orderBy});}}}_0x3acd60({'ok':0x1});}else _0x3acd60({'res':0x0});});}function createAdditionalPhone(_0x5cfc0d,_0x1400ad,_0x5854cc,_0x23e3e1){var _0x350c15='';var _0x47384f='';var _0x4db7f4=_0x5854cc['split']('§');_0x350c15=_0x4db7f4[0x0];if(_0x4db7f4[_0x05ed('0x1b')]==0x2)_0x47384f=_0x4db7f4[0x1];return new Promise(function(_0x4d2889,_0xc49b2a){return db[_0x05ed('0x24')][_0x05ed('0x25')]({'where':{'CmContactId':_0x5cfc0d,'item':_0x350c15}})[_0x05ed('0x26')](function(_0x548ded){if(_0x548ded){return db[_0x05ed('0x24')]['update']({'ItemTypeId':_0x1400ad,'description':_0x47384f,'OrderBy':_0x23e3e1},{'where':{'CmContactId':_0x5cfc0d,'item':_0x350c15}})['then'](function(_0x3ca946){_0x4d2889({'res':_0x05ed('0x27')});});}else{return db[_0x05ed('0x24')][_0x05ed('0x28')]({'CmContactId':_0x5cfc0d,'item':_0x350c15,'ItemTypeId':_0x1400ad,'description':_0x47384f,'OrderBy':_0x23e3e1,'ItemClass':_0x05ed('0x29')})[_0x05ed('0x26')](function(_0x2d5e62){_0x4d2889({'res':_0x05ed('0x2a')});});}});});}function updateContact(_0x513fc1){return new Promise(function(_0x2343d2,_0x4611cb){var _0x5b7b25=_0x513fc1['id'];delete _0x513fc1['id'];return db['CmContact']['update'](_0x513fc1,{'where':{'id':_0x5b7b25}})[_0x05ed('0x26')](function(_0x26569b){updatedRows+=0x1;return db['CmHopper'][_0x05ed('0x2b')]({'phone':_0x513fc1[_0x05ed('0x13')]},{'where':{'ContactId':_0x5b7b25}})[_0x05ed('0x26')](function(_0x1ac463){_0x2343d2({'ret':'OK'});});});});}function insertCmHopper(_0x151b00,_0x3f3089,_0x3454f7,_0x40bb15,_0x91805d){var _0x13cedb=['cm_contacts.phone','cm_contacts.scheduledat',_0x05ed('0x2c'),_0x05ed('0x2d'),_0x3f3089+'.'+_0x40bb15,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x05ed('0x2e'),_0x05ed('0x2f'),'\x22'+_0x91805d+'\x22'];return squel[_0x05ed('0x30')]()[_0x05ed('0x31')](_0x05ed('0x32'))[_0x05ed('0x33')]([_0x05ed('0x13'),_0x05ed('0x34'),_0x05ed('0x35'),_0x05ed('0x36'),_0x40bb15,_0x05ed('0x37'),_0x05ed('0x38'),_0x05ed('0x39'),_0x05ed('0x3a'),'recallme'],squel[_0x05ed('0x11')]()[_0x05ed('0x3b')](_0x13cedb)[_0x05ed('0x14')](_0x3f3089)[_0x05ed('0x3c')](_0x05ed('0x3d'),null,_0x05ed('0x3e')+_0x3f3089+_0x05ed('0x3f'))[_0x05ed('0x3c')](_0x3454f7,null,_0x3454f7+_0x05ed('0x40')+_0x3f3089+'.'+_0x40bb15)['where'](_0x3f3089+_0x05ed('0x41'),_0x151b00)[_0x05ed('0x16')](_0x05ed('0x42'),NOW)[_0x05ed('0x16')](_0x05ed('0x43'),selectNotIn(_0x3f3089,_0x3454f7,_0x40bb15,_0x05ed('0x32'),[_0x05ed('0x44'),_0x05ed('0x45')]))[_0x05ed('0x16')](_0x05ed('0x43'),selectNotIn(_0x3f3089,_0x3454f7,_0x40bb15,_0x05ed('0x32'),[_0x05ed('0x44')])))[_0x05ed('0x46')]();}function insertCmHopperBlack(_0x43b8c8,_0x1b65ca,_0x4dc982,_0xc6bee3){var _0x40e3c5=[_0x05ed('0x47'),_0x05ed('0x2c'),_0x05ed('0x2d'),_0x1b65ca+'.'+_0xc6bee3,_0x05ed('0x48'),_0x05ed('0x49')];return squel[_0x05ed('0x30')]()[_0x05ed('0x31')](_0x05ed('0x4a'))[_0x05ed('0x33')]([_0x05ed('0x13'),'ContactId','ListId',_0xc6bee3,_0x05ed('0x37'),'updatedAt'],squel[_0x05ed('0x11')]()[_0x05ed('0x3b')](_0x40e3c5)[_0x05ed('0x14')](_0x1b65ca)[_0x05ed('0x3c')](_0x05ed('0x3d'),null,_0x05ed('0x3e')+_0x1b65ca+_0x05ed('0x3f'))[_0x05ed('0x3c')](_0x4dc982,null,_0x4dc982+_0x05ed('0x40')+_0x1b65ca+'.'+_0xc6bee3)[_0x05ed('0x16')](_0x1b65ca+_0x05ed('0x41'),_0x43b8c8)[_0x05ed('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x05ed('0x16')](_0x05ed('0x43'),squel[_0x05ed('0x11')]()[_0x05ed('0x12')](_0x05ed('0x13'))[_0x05ed('0x14')]('cm_hopper_black')[_0x05ed('0x16')]('ListId\x20=\x20?',_0x43b8c8)[_0x05ed('0x16')](_0xc6bee3+_0x05ed('0x4b'),_0x1b65ca+'.'+_0xc6bee3)))[_0x05ed('0x46')]();}function insertCmHopperAdditionalPhones(_0x140ecc){var _0xb4b917=[_0x05ed('0x4c'),_0x05ed('0x4d'),_0x05ed('0x4e'),_0x05ed('0x4f'),_0x05ed('0x50')];return squel['insert']()[_0x05ed('0x31')](_0x05ed('0x51'))['fromQuery']([_0x05ed('0x52'),'phone',_0x05ed('0x53'),'createdAt',_0x05ed('0x38')],squel[_0x05ed('0x11')]()[_0x05ed('0x3b')](_0xb4b917)[_0x05ed('0x14')]('cm_hopper')[_0x05ed('0x3c')](_0x05ed('0x3d'),null,_0x05ed('0x54'))[_0x05ed('0x3c')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x05ed('0x16')]('cm_hopper.ListId\x20=\x20?',_0x140ecc)[_0x05ed('0x16')](_0x05ed('0x42'),NOW))['toString']();}function insertCmContact(_0x208700,_0x16a4ce,_0x13b246,_0x1cfa79){var _0x1fe3eb=_['concat'](_[_0x05ed('0x55')](_0x1cfa79),[_0x05ed('0x36'),_0x05ed('0x56'),_0x05ed('0x37'),_0x05ed('0x38')]);return squel[_0x05ed('0x30')]()[_0x05ed('0x31')](_0x05ed('0x3d'))[_0x05ed('0x33')](_0x1fe3eb,squel[_0x05ed('0x11')]()['fields'](_0x1fe3eb)['from'](_0x16a4ce)[_0x05ed('0x16')]('('+_0x13b246[_0x05ed('0x3c')](',')+_0x05ed('0x57'),squel['select']()[_0x05ed('0x3b')](_0x13b246)[_0x05ed('0x14')](_0x05ed('0x3d'))['where'](_0x05ed('0x58'),_0x208700))[_0x05ed('0x16')](_0x05ed('0x59'),squel['select']()[_0x05ed('0x12')](_0x05ed('0x5a'),_0x05ed('0x5b'))['from'](_0x16a4ce)[_0x05ed('0x5c')](_0x13b246['join'](','))))[_0x05ed('0x46')]();}function handleStop(){logger[_0x05ed('0x5d')](_0x05ed('0x5e'));stopped=!![];}function handleUncaughtException(_0x5ac294){logger['error'](_0x5ac294[_0x05ed('0x20')]);process[_0x05ed('0x5f')](0x1);}function handleError(_0x2d9a61,_0x17729f){stats[_0x05ed('0x60')]['push']({'name':_0x17729f['code'],'message':_0x17729f[_0x05ed('0x20')],'row':_0x2d9a61});}function handleQuery(_0x1c8fd6){logger['info'](_0x1c8fd6);return db[_0x05ed('0x18')][_0x05ed('0x19')](_0x1c8fd6)[_0x05ed('0x1a')](function(_0x30a355){results[_0x05ed('0x1d')](_0x30a355);})[_0x05ed('0x1e')](function(_0x161d48){logger[_0x05ed('0x1f')](_0x161d48['message']);});}function main(_0x4d002e,_0x1bac7a,_0x2e3846,_0x5b5542){logger[_0x05ed('0x5d')](_0x05ed('0x61'),_0x4d002e,JSON[_0x05ed('0x62')](_0x1bac7a));process[_0x05ed('0x63')](_0x05ed('0x64'));var _0x5c4cca=_0x1bac7a[_0x05ed('0x65')];var _0x1da310=_[_0x05ed('0x66')](_0x5c4cca);var _0x319476=_0x1bac7a['socket_timestamp'];var _0x273c75=path['join'](config[_0x05ed('0x67')],_0x05ed('0x68'),_0x319476+'.csv');logger['info']('body',_0x1bac7a);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id','name']})[_0x05ed('0x26')](function(_0x3b611e){for(var _0x1736e3=0x0;_0x1736e3<_0x3b611e[_0x05ed('0x1b')];_0x1736e3++){if(_0x3b611e[_0x1736e3][_0x05ed('0x69')]in _0x5c4cca){contactItemTypes[_0x05ed('0x1d')](_0x3b611e[_0x1736e3]);delete _0x1da310[_0x3b611e[_0x1736e3][_0x05ed('0x69')]];hasAdditionalPhones=!![];}for(var _0x2dfd72 in _0x5c4cca){if(_0x3b611e[_0x1736e3]['name']+'_description'===_0x2dfd72){phoneDescriptions[_0x05ed('0x1d')]({'itemTypeId':_0x3b611e[_0x1736e3]['id'],'description':_0x2dfd72});delete _0x1da310[_0x2dfd72];}}}if(hasAdditionalPhones)_0x1da310[_0x05ed('0x1c')]='';var _0x142fb4=_[_0x05ed('0x55')](_0x1da310)['join']();logger[_0x05ed('0x5d')](_0x05ed('0x6a'),_0x142fb4);fs[_0x05ed('0x6b')](_0x273c75,_0x142fb4+'\x0a');Papa[_0x05ed('0x6c')](fs[_0x05ed('0x6d')](_0x4d002e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x28835c,_0x161c6b){try{for(var _0x230e7f=0x0,_0x2af65c=[];_0x230e7f<_0x28835c['data']['length'];_0x230e7f++){stats[_0x05ed('0x6e')]+=0x1;if(_0x28835c[_0x05ed('0x60')][_0x230e7f]){handleError(_0x28835c[_0x05ed('0x6f')][_0x230e7f],_0x28835c[_0x05ed('0x60')][_0x230e7f]);}else{var _0x1c3fa1=[];var _0x3c98ce=[];var _0x1c2aac={};for(var _0x330fa5 in _0x5c4cca){let _0x1e86ec=contactItemTypes['find'](_0x2c14fa=>_0x2c14fa['name']===_0x330fa5);let _0x591060=contactItemTypes[_0x05ed('0x70')](_0x1f90da=>_0x1f90da[_0x05ed('0x69')]+'_description'===_0x330fa5);if(_[_0x05ed('0x21')](_0x1e86ec)&&_[_0x05ed('0x21')](_0x591060)){if(_0x5c4cca[_0x05ed('0x71')](_0x330fa5)){if(_0x28835c[_0x05ed('0x6f')][_0x230e7f][_0x5c4cca[_0x330fa5]]){var _0x37d73d=_[_0x05ed('0x72')](_0x28835c[_0x05ed('0x6f')][_0x230e7f][_0x5c4cca[_0x330fa5]][_0x05ed('0x73')](/"/g,'\x27'));switch(_0x330fa5){case'scheduledat':var _0x111d98=moment(_0x37d73d,_0x05ed('0xd'),!![]);if(_0x111d98[_0x05ed('0x74')]()){_0x2af65c['push']('\x22'+_0x37d73d+'\x22');}else{_0x1c3fa1['push'](_0x05ed('0x75'));}break;case _0x05ed('0x39'):var _0x168fb6=parseInt(_0x37d73d);_0x37d73d=_[_0x05ed('0x76')](_0x168fb6)||_0x168fb6<0x0||_0x168fb6>0x4?_0x5b5542?0x3:0x2:_0x168fb6;_0x2af65c[_0x05ed('0x1d')]('\x22'+_0x37d73d+'\x22');break;case _0x05ed('0x3a'):var _0x54b71d=parseInt(_0x37d73d);if(_[_0x05ed('0x77')](_0x54b71d)&&_['includes'](_0x2e3846,_0x54b71d)){_0x2af65c[_0x05ed('0x1d')]('\x22'+_0x54b71d+'\x22');}else{_0x1c3fa1['push'](_0x05ed('0x78'));}break;case _0x05ed('0x79'):if(isEmail(_0x37d73d)){_0x2af65c[_0x05ed('0x1d')]('\x22'+_0x37d73d+'\x22');}else{_0x1c3fa1[_0x05ed('0x1d')]('email\x20wrong\x20format');}break;case _0x05ed('0x7a'):var _0x122561=moment(_0x37d73d,_0x05ed('0x7b'),!![]);if(_0x122561[_0x05ed('0x74')]()){_0x2af65c[_0x05ed('0x1d')]('\x22'+_0x37d73d+'\x22');}else{_0x1c3fa1['push'](_0x05ed('0x7c'));}break;default:_0x2af65c[_0x05ed('0x1d')]('\x22'+_0x37d73d+'\x22');}}else{switch(_0x330fa5){case _0x05ed('0x7d'):case _0x05ed('0x13'):_0x1c3fa1[_0x05ed('0x1d')](_0x330fa5+_0x05ed('0x7e'));break;default:_0x2af65c[_0x05ed('0x1d')]('\x22\x22');}}}}else{var _0x523bd6='';if(!_[_0x05ed('0x21')](_0x1e86ec)){if(!_0x1c2aac['hasOwnProperty'](_0x1e86ec['id'])){for(var _0x517f51=0x0;_0x517f51<_0x5c4cca[_0x330fa5]['length'];_0x517f51++){var _0x37d73d=_[_0x05ed('0x72')](_0x28835c[_0x05ed('0x6f')][_0x230e7f][_0x5c4cca[_0x330fa5][_0x517f51]][_0x05ed('0x73')](/"/g,'\x27'));var _0x3a1ef6=phoneDescriptions['find'](_0x58847a=>_0x58847a[_0x05ed('0x7f')]===_0x1e86ec['id']);if(!_[_0x05ed('0x21')](_0x3a1ef6)){var _0x31ba8f=_[_0x05ed('0x72')](_0x28835c[_0x05ed('0x6f')][_0x230e7f][_0x5c4cca[_0x3a1ef6[_0x05ed('0x80')]][0x0]][_0x05ed('0x73')](/"/g,'\x27'));if(!_[_0x05ed('0x21')](_0x31ba8f))_0x37d73d=_0x37d73d+'§'+_0x31ba8f;}if(_0x523bd6=='')_0x523bd6=_0x37d73d;else _0x523bd6+='|'+_0x37d73d;}_0x3c98ce['push'](_0x1e86ec['id']+':'+_0x523bd6);_0x1c2aac[_0x1e86ec['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2af65c['push']('\x22'+_0x3c98ce[_0x05ed('0x3c')](';')+'\x22');}if(_0x1c3fa1[_0x05ed('0x1b')]){handleError(_0x28835c[_0x05ed('0x6f')][_0x230e7f],{'code':_0x05ed('0x81'),'message':_0x1c3fa1[_0x05ed('0x3c')]()});}else{fs['appendFileSync'](_0x273c75,_0x2af65c[_0x05ed('0x3c')]()+'\x0a');}_0x2af65c=[];}if(!(stats[_0x05ed('0x6e')]%0xc8)){socket['emit']('contact:import:'+_0x319476,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x05ed('0x82'));_0x161c6b[_0x05ed('0x83')]();}}catch(_0x315ba3){handleError(_0x28835c[_0x05ed('0x6f')][_0x230e7f],{'code':_0x05ed('0x84'),'message':_0x315ba3[_0x05ed('0x20')]});logger[_0x05ed('0x1f')](_0x05ed('0x85'),_0x315ba3[_0x05ed('0x20')]);}},'complete':function(){try{var _0x26a785=[];var _0x5c0189=tempTableName;_0x26a785[_0x05ed('0x1d')](_0x05ed('0x86')+_0x5c0189+_0x05ed('0x87'));logger[_0x05ed('0x5d')]('CIS\x20len',contactItemTypes['length']);var _0x20592f=util[_0x05ed('0xe')]('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',_0x273c75,_0x5c0189,_0x142fb4,_0x1bac7a[_0x05ed('0x36')],_0x1bac7a[_0x05ed('0x56')]||null,NOW,NOW);if(_[_0x05ed('0x21')](_0x5c4cca[_0x05ed('0x34')])){_0x20592f+=_0x05ed('0x88');}_0x26a785[_0x05ed('0x1d')](_0x20592f);BPromise[_0x05ed('0x89')](_0x26a785,handleQuery)[_0x05ed('0x26')](function(_0x44e236){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x26a785=[];for(var _0x330844=0x0;_0x330844\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf643,0x122));var _0x3f64=function(_0x54e631,_0x3b8396){_0x54e631=_0x54e631-0x0;var _0x3c6b6a=_0xf643[_0x54e631];return _0x3c6b6a;};'use strict';var fs=require('fs');var path=require(_0x3f64('0x0'));var _=require(_0x3f64('0x1'));var Papa=require(_0x3f64('0x2'));var util=require(_0x3f64('0x3'));var BPromise=require('bluebird');var moment=require(_0x3f64('0x4'));var squel=require(_0x3f64('0x5'));var Redis=require('ioredis');var db=require(_0x3f64('0x6'))['db'];var config=require(_0x3f64('0x7'));var logger=require(_0x3f64('0x8'))(_0x3f64('0x9'));config[_0x3f64('0xa')]=_[_0x3f64('0xb')](config[_0x3f64('0xa')],{'host':_0x3f64('0xc'),'port':0x18eb});var socket=require(_0x3f64('0xd'))(new Redis(config[_0x3f64('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()[_0x3f64('0xe')](_0x3f64('0xf'));var tempTableName=_0x3f64('0x10')+moment()[_0x3f64('0xe')](_0x3f64('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4ff35e){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))*$/[_0x3f64('0x12')](_0x4ff35e);}function selectNotIn(_0x3edbce,_0x8aa885,_0x506f2a,_0x3a2c7d,_0x42fb23){return squel[_0x3f64('0x13')]()[_0x3f64('0x14')](_0x3f64('0x15'))[_0x3f64('0x16')](_0x3a2c7d)[_0x3f64('0x17')](_0x8aa885,null,_0x8aa885+_0x3f64('0x18')+_0x3a2c7d+'.'+_0x506f2a)[_0x3f64('0x19')](_0x3a2c7d+'.'+_0x506f2a+_0x3f64('0x1a')+_0x3edbce+'.'+_0x506f2a)[_0x3f64('0x19')](_0x8aa885+_0x3f64('0x1b')+_0x42fb23['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x84d3a9,_0x1af45b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3f64('0x1c')][_0x3f64('0x1d')]('select\x20*\x20from\x20'+tempTableName)[_0x3f64('0x1e')](function(_0x1c17bb){if(_0x1c17bb!==null){var _0x2650a1=[];for(var _0x3e9c46=0x0;_0x3e9c46<_0x1c17bb[_0x3f64('0x1f')];_0x3e9c46++){var _0x26e807=_0x1c17bb[_0x3e9c46];if(!_[_0x3f64('0x20')](_0x26e807['phone'])){if(!_[_0x3f64('0x20')](_0x26e807[_0x3f64('0x21')]))_0x2650a1[_0x3f64('0x22')](insertAdditionalPhones(_0x26e807));promisesContact['push']({'contact':_0x26e807});}}}Promise[_0x3f64('0x23')](_0x2650a1)['then'](function(){_0x84d3a9({'val':0x1});});})['catch'](function(_0xe904d9){logger[_0x3f64('0x24')](_0xe904d9[_0x3f64('0x25')]);});});}function insertAdditionalPhones(_0x5b5d10){return new Promise(function(_0x40e9e8,_0x301d72){var _0x211c91=_0x5b5d10['AdditionalPhones'];if(_[_0x3f64('0x20')](_0x211c91))_0x301d72({'val':0x0});else{var _0xbf2f1=_0x211c91['split'](';');var _0xc72655=[];orderBy=0x0;for(var _0x3faf46=0x0;_0x3faf46<_0xbf2f1['length'];_0x3faf46++){_0xc72655['push'](splitAdditionalPhone(_0x5b5d10['id'],_0xbf2f1[_0x3faf46]));}Promise['all'](_0xc72655)[_0x3f64('0x26')](function(){_0x40e9e8({'val':_0xbf2f1[_0x3f64('0x1f')]});});}});}function splitAdditionalPhone(_0x336b98,_0x1b49fe){return new Promise(function(_0x112906,_0x48be0c){var _0x222097=_0x1b49fe[_0x3f64('0x27')](':');var _0x151f1e=_0x222097[0x0];var _0x142fe5=_0x222097[0x1];if(_0x142fe5!==''){var _0x383780=_0x142fe5[_0x3f64('0x27')]('|');var _0x1f0f91=[];for(var _0x3499ff=0x0;_0x3499ff<_0x383780['length'];_0x3499ff++){if(_0x383780[_0x3499ff]!==''){var _0x8d8f36=_['filter'](promisesAdditionalPhones,{'contactId':_0x336b98,'phone':_0x383780[_0x3499ff]});if(_0x8d8f36[_0x3f64('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0x3f64('0x22')]({'contactId':_0x336b98,'contactTypeId':_0x151f1e,'phone':_0x383780[_0x3499ff],'orderBy':orderBy});}}}_0x112906({'ok':0x1});}else _0x112906({'res':0x0});});}function createAdditionalPhone(_0x43f349,_0x2fac90,_0x191a2d,_0x307efc){var _0x286b2a='';var _0x1bcefe='';var _0x36b338=_0x191a2d[_0x3f64('0x27')]('§');_0x286b2a=_0x36b338[0x0];if(_0x36b338['length']==0x2)_0x1bcefe=_0x36b338[0x1];return new Promise(function(_0x584a48,_0x25ec96){return db['CmContactHasItem'][_0x3f64('0x28')]({'where':{'CmContactId':_0x43f349,'item':_0x286b2a}})[_0x3f64('0x26')](function(_0x211da2){if(_0x211da2){return db[_0x3f64('0x29')]['update']({'ItemTypeId':_0x2fac90,'description':_0x1bcefe,'OrderBy':_0x307efc},{'where':{'CmContactId':_0x43f349,'item':_0x286b2a}})['then'](function(_0x824232){_0x584a48({'res':_0x3f64('0x2a')});});}else{return db[_0x3f64('0x29')][_0x3f64('0x2b')]({'CmContactId':_0x43f349,'item':_0x286b2a,'ItemTypeId':_0x2fac90,'description':_0x1bcefe,'OrderBy':_0x307efc,'ItemClass':'PHONE'})[_0x3f64('0x26')](function(_0x547e46){_0x584a48({'res':'inserted'});});}});});}function updateContact(_0x5d5ce2){return new Promise(function(_0x28989e,_0x581e5f){var _0x320094=_0x5d5ce2['id'];delete _0x5d5ce2['id'];return db['CmContact'][_0x3f64('0x2c')](_0x5d5ce2,{'where':{'id':_0x320094}})[_0x3f64('0x26')](function(_0x22bf5f){updatedRows+=0x1;return db[_0x3f64('0x2d')]['update']({'phone':_0x5d5ce2[_0x3f64('0x15')]},{'where':{'ContactId':_0x320094}})[_0x3f64('0x26')](function(_0x2fe6b5){_0x28989e({'ret':'OK'});});});});}function insertCmHopper(_0x53787a,_0x54648f,_0x275bcf,_0x4a0800,_0xfc1e23){var _0x112940=[_0x3f64('0x2e'),'cm_contacts.scheduledat',_0x3f64('0x2f'),_0x3f64('0x30'),_0x54648f+'.'+_0x4a0800,_0x3f64('0x31'),_0x3f64('0x32'),_0x3f64('0x33'),_0x3f64('0x34'),'\x22'+_0xfc1e23+'\x22'];return squel[_0x3f64('0x35')]()[_0x3f64('0x36')](_0x3f64('0x37'))[_0x3f64('0x38')]([_0x3f64('0x15'),_0x3f64('0x39'),_0x3f64('0x3a'),_0x3f64('0x3b'),_0x4a0800,'createdAt',_0x3f64('0x3c'),_0x3f64('0x3d'),_0x3f64('0x3e'),'recallme'],squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x112940)[_0x3f64('0x16')](_0x54648f)[_0x3f64('0x17')](_0x3f64('0x40'),null,_0x3f64('0x41')+_0x54648f+'.CmListId')[_0x3f64('0x17')](_0x275bcf,null,_0x275bcf+'.id\x20=\x20'+_0x54648f+'.'+_0x4a0800)[_0x3f64('0x19')](_0x54648f+_0x3f64('0x42'),_0x53787a)[_0x3f64('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3f64('0x19')](_0x3f64('0x43'),selectNotIn(_0x54648f,_0x275bcf,_0x4a0800,_0x3f64('0x37'),[_0x3f64('0x44'),'\x22onlyIfOpen\x22']))[_0x3f64('0x19')](_0x3f64('0x43'),selectNotIn(_0x54648f,_0x275bcf,_0x4a0800,_0x3f64('0x37'),[_0x3f64('0x44')])))['toString']();}function insertCmHopperBlack(_0x5c6a22,_0x38b32c,_0x291f70,_0x4f3ddd){var _0x36ad87=[_0x3f64('0x2e'),_0x3f64('0x2f'),'cm_contacts.ListId',_0x38b32c+'.'+_0x4f3ddd,_0x3f64('0x31'),_0x3f64('0x32')];return squel['insert']()[_0x3f64('0x36')](_0x3f64('0x45'))[_0x3f64('0x38')]([_0x3f64('0x15'),_0x3f64('0x3a'),_0x3f64('0x3b'),_0x4f3ddd,_0x3f64('0x46'),_0x3f64('0x3c')],squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x36ad87)[_0x3f64('0x16')](_0x38b32c)[_0x3f64('0x17')](_0x3f64('0x40'),null,'cm_contacts.ListId\x20=\x20'+_0x38b32c+'.CmListId')[_0x3f64('0x17')](_0x291f70,null,_0x291f70+_0x3f64('0x18')+_0x38b32c+'.'+_0x4f3ddd)[_0x3f64('0x19')](_0x38b32c+_0x3f64('0x42'),_0x5c6a22)['where'](_0x3f64('0x47'),NOW)[_0x3f64('0x19')](_0x3f64('0x43'),squel[_0x3f64('0x13')]()[_0x3f64('0x14')](_0x3f64('0x15'))[_0x3f64('0x16')](_0x3f64('0x45'))[_0x3f64('0x19')]('ListId\x20=\x20?',_0x5c6a22)[_0x3f64('0x19')](_0x4f3ddd+_0x3f64('0x48'),_0x38b32c+'.'+_0x4f3ddd)))[_0x3f64('0x49')]();}function insertCmHopperAdditionalPhones(_0xfcbff0){var _0x51b047=[_0x3f64('0x4a'),_0x3f64('0x4b'),'cm_contact_has_items.OrderBy',_0x3f64('0x4c'),_0x3f64('0x4d')];return squel[_0x3f64('0x35')]()[_0x3f64('0x36')](_0x3f64('0x4e'))['fromQuery'](['CmHopperId',_0x3f64('0x15'),'OrderBy',_0x3f64('0x46'),_0x3f64('0x3c')],squel[_0x3f64('0x13')]()['fields'](_0x51b047)[_0x3f64('0x16')](_0x3f64('0x37'))[_0x3f64('0x17')](_0x3f64('0x40'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x3f64('0x17')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x3f64('0x19')](_0x3f64('0x4f'),_0xfcbff0)[_0x3f64('0x19')](_0x3f64('0x47'),NOW))['toString']();}function insertCmContact(_0x36826b,_0x59d824,_0x3a2fb9,_0x52132b){var _0x569613=_[_0x3f64('0x50')](_[_0x3f64('0x51')](_0x52132b),[_0x3f64('0x3b'),_0x3f64('0x52'),_0x3f64('0x46'),_0x3f64('0x3c')]);return squel[_0x3f64('0x35')]()[_0x3f64('0x36')]('cm_contacts')[_0x3f64('0x38')](_0x569613,squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x569613)[_0x3f64('0x16')](_0x59d824)[_0x3f64('0x19')]('('+_0x3a2fb9['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x3a2fb9)[_0x3f64('0x16')](_0x3f64('0x40'))['where'](_0x3f64('0x53'),_0x36826b))[_0x3f64('0x19')](_0x3f64('0x54'),squel[_0x3f64('0x13')]()[_0x3f64('0x14')]('MIN(id)',_0x3f64('0x55'))['from'](_0x59d824)[_0x3f64('0x56')](_0x3a2fb9[_0x3f64('0x17')](','))))[_0x3f64('0x49')]();}function handleStop(){logger['info'](_0x3f64('0x57'));stopped=!![];}function handleUncaughtException(_0x16bf10){logger[_0x3f64('0x24')](_0x16bf10['message']);process[_0x3f64('0x58')](0x1);}function handleError(_0x4321ca,_0x2373ba){stats['errors'][_0x3f64('0x22')]({'name':_0x2373ba[_0x3f64('0x59')],'message':_0x2373ba['message'],'row':_0x4321ca});}function handleQuery(_0x350c5f){logger[_0x3f64('0x5a')](_0x350c5f);return db[_0x3f64('0x1c')]['query'](_0x350c5f)[_0x3f64('0x1e')](function(_0x54c3c9){results['push'](_0x54c3c9);})[_0x3f64('0x5b')](function(_0x125e9b){logger[_0x3f64('0x24')](_0x125e9b[_0x3f64('0x25')]);});}function main(_0x340117,_0x23cd05,_0x24d382,_0x16ccab){logger[_0x3f64('0x5a')]('main',_0x340117,JSON['stringify'](_0x23cd05));process[_0x3f64('0x5c')](_0x3f64('0x5d'));var _0x53e5af=_0x23cd05[_0x3f64('0x5e')];var _0x4ad862=_[_0x3f64('0x5f')](_0x53e5af);var _0x301d3f=_0x23cd05[_0x3f64('0x60')];var _0x356da9=path[_0x3f64('0x17')](config[_0x3f64('0x61')],_0x3f64('0x62'),_0x301d3f+'.csv');logger[_0x3f64('0x5a')](_0x3f64('0x63'),_0x23cd05);db[_0x3f64('0x64')][_0x3f64('0x65')]({'raw':!![],'attributes':['id',_0x3f64('0x66')]})[_0x3f64('0x26')](function(_0x517f40){for(var _0x530197=0x0;_0x530197<_0x517f40[_0x3f64('0x1f')];_0x530197++){if(_0x517f40[_0x530197][_0x3f64('0x66')]in _0x53e5af){contactItemTypes[_0x3f64('0x22')](_0x517f40[_0x530197]);delete _0x4ad862[_0x517f40[_0x530197]['name']];hasAdditionalPhones=!![];}for(var _0x28a021 in _0x53e5af){if(_0x517f40[_0x530197][_0x3f64('0x66')]+_0x3f64('0x67')===_0x28a021){phoneDescriptions[_0x3f64('0x22')]({'itemTypeId':_0x517f40[_0x530197]['id'],'description':_0x28a021});delete _0x4ad862[_0x28a021];}}}if(hasAdditionalPhones)_0x4ad862[_0x3f64('0x21')]='';var _0x5af1ee=_[_0x3f64('0x51')](_0x4ad862)[_0x3f64('0x17')]();logger['info'](_0x3f64('0x68'),_0x5af1ee);fs[_0x3f64('0x69')](_0x356da9,_0x5af1ee+'\x0a');Papa[_0x3f64('0x6a')](fs['createReadStream'](_0x340117),{'header':!![],'skipEmptyLines':!![],'step':function(_0x11efc3,_0x5608a5){try{for(var _0x3c064a=0x0,_0x12611b=[];_0x3c064a<_0x11efc3[_0x3f64('0x6b')][_0x3f64('0x1f')];_0x3c064a++){stats[_0x3f64('0x6c')]+=0x1;if(_0x11efc3[_0x3f64('0x6d')][_0x3c064a]){handleError(_0x11efc3[_0x3f64('0x6b')][_0x3c064a],_0x11efc3['errors'][_0x3c064a]);}else{var _0x4c0949=[];var _0x50d3cf=[];var _0x42acd0={};for(var _0xcf5dd4 in _0x53e5af){let _0x292e83=contactItemTypes[_0x3f64('0x6e')](_0x39c8c2=>_0x39c8c2['name']===_0xcf5dd4);let _0x1c3c8c=contactItemTypes[_0x3f64('0x6e')](_0xac57c6=>_0xac57c6[_0x3f64('0x66')]+'_description'===_0xcf5dd4);if(_[_0x3f64('0x20')](_0x292e83)&&_[_0x3f64('0x20')](_0x1c3c8c)){if(_0x53e5af[_0x3f64('0x6f')](_0xcf5dd4)){if(_0x11efc3['data'][_0x3c064a][_0x53e5af[_0xcf5dd4]]){var _0x4914be=_[_0x3f64('0x70')](_0x11efc3[_0x3f64('0x6b')][_0x3c064a][_0x53e5af[_0xcf5dd4]][_0x3f64('0x71')](/"/g,'\x27'));switch(_0xcf5dd4){case _0x3f64('0x39'):var _0x1d6611=moment(_0x4914be,_0x3f64('0xf'),!![]);if(_0x1d6611[_0x3f64('0x72')]()){_0x12611b['push']('\x22'+_0x4914be+'\x22');}else{_0x4c0949['push'](_0x3f64('0x73'));}break;case _0x3f64('0x3d'):var _0x559399=parseInt(_0x4914be);_0x4914be=_[_0x3f64('0x74')](_0x559399)||_0x559399<0x0||_0x559399>0x4?_0x16ccab?0x3:0x2:_0x559399;_0x12611b[_0x3f64('0x22')]('\x22'+_0x4914be+'\x22');break;case _0x3f64('0x3e'):var _0x4a0274=parseInt(_0x4914be);if(_[_0x3f64('0x75')](_0x4a0274)&&_[_0x3f64('0x76')](_0x24d382,_0x4a0274)){_0x12611b[_0x3f64('0x22')]('\x22'+_0x4a0274+'\x22');}else{_0x4c0949[_0x3f64('0x22')](_0x3f64('0x77'));}break;case _0x3f64('0x78'):if(isEmail(_0x4914be)){_0x12611b[_0x3f64('0x22')]('\x22'+_0x4914be+'\x22');}else{_0x4c0949[_0x3f64('0x22')](_0x3f64('0x79'));}break;case _0x3f64('0x7a'):var _0x5736b1=moment(_0x4914be,'YYYY-MM-DD',!![]);if(_0x5736b1['isValid']()){_0x12611b['push']('\x22'+_0x4914be+'\x22');}else{_0x4c0949[_0x3f64('0x22')](_0x3f64('0x7b'));}break;default:_0x12611b['push']('\x22'+_0x4914be+'\x22');}}else{switch(_0xcf5dd4){case _0x3f64('0x7c'):case _0x3f64('0x15'):_0x4c0949[_0x3f64('0x22')](_0xcf5dd4+_0x3f64('0x7d'));break;default:_0x12611b['push']('\x22\x22');}}}}else{var _0x4f51d5='';if(!_[_0x3f64('0x20')](_0x292e83)){if(!_0x42acd0['hasOwnProperty'](_0x292e83['id'])){for(var _0x6f0dc=0x0;_0x6f0dc<_0x53e5af[_0xcf5dd4]['length'];_0x6f0dc++){var _0x4914be=_[_0x3f64('0x70')](_0x11efc3[_0x3f64('0x6b')][_0x3c064a][_0x53e5af[_0xcf5dd4][_0x6f0dc]][_0x3f64('0x71')](/"/g,'\x27'));var _0x8e8a38=phoneDescriptions[_0x3f64('0x6e')](_0x5d6718=>_0x5d6718[_0x3f64('0x7e')]===_0x292e83['id']);if(!_[_0x3f64('0x20')](_0x8e8a38)){var _0x10d1fc=_[_0x3f64('0x70')](_0x11efc3[_0x3f64('0x6b')][_0x3c064a][_0x53e5af[_0x8e8a38[_0x3f64('0x7f')]][0x0]][_0x3f64('0x71')](/"/g,'\x27'));if(!_[_0x3f64('0x20')](_0x10d1fc))_0x4914be=_0x4914be+'§'+_0x10d1fc;}if(_0x4f51d5=='')_0x4f51d5=_0x4914be;else _0x4f51d5+='|'+_0x4914be;}_0x50d3cf[_0x3f64('0x22')](_0x292e83['id']+':'+_0x4f51d5);_0x42acd0[_0x292e83['id']]=0x1;}}}}if(hasAdditionalPhones){_0x12611b[_0x3f64('0x22')]('\x22'+_0x50d3cf['join'](';')+'\x22');}if(_0x4c0949['length']){handleError(_0x11efc3[_0x3f64('0x6b')][_0x3c064a],{'code':_0x3f64('0x80'),'message':_0x4c0949['join']()});}else{fs['appendFileSync'](_0x356da9,_0x12611b[_0x3f64('0x17')]()+'\x0a');}_0x12611b=[];}if(!(stats[_0x3f64('0x6c')]%0xc8)){socket[_0x3f64('0x81')](_0x3f64('0x82')+_0x301d3f,stats);stats[_0x3f64('0x6d')]=[];}}if(stopped){logger['info'](_0x3f64('0x83'));_0x5608a5[_0x3f64('0x84')]();}}catch(_0x6d6fc7){handleError(_0x11efc3['data'][_0x3c064a],{'code':'SystemError','message':_0x6d6fc7['message']});logger[_0x3f64('0x24')]('step',_0x6d6fc7['message']);}},'complete':function(){try{var _0x5003e5=[];var _0x193b33=tempTableName;_0x5003e5[_0x3f64('0x22')](_0x3f64('0x85')+_0x193b33+_0x3f64('0x86'));logger['info']('CIS\x20len',contactItemTypes[_0x3f64('0x1f')]);var _0x4d2ac7=util['format'](_0x3f64('0x87'),_0x356da9,_0x193b33,_0x5af1ee,_0x23cd05['ListId'],_0x23cd05[_0x3f64('0x52')]||null,NOW,NOW);if(_[_0x3f64('0x20')](_0x53e5af[_0x3f64('0x39')])){_0x4d2ac7+=_0x3f64('0x88');}_0x5003e5[_0x3f64('0x22')](_0x4d2ac7);BPromise[_0x3f64('0x89')](_0x5003e5,handleQuery)[_0x3f64('0x26')](function(_0x5d8b44){BPromise[_0x3f64('0x23')]([handleAdditionalPhones()])[_0x3f64('0x26')](function(){_0x5003e5=[];for(var _0x136c54=0x0;_0x136c54\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy'];(function(_0x5de58a,_0x23d58e){var _0x589a6d=function(_0x4069ec){while(--_0x4069ec){_0x5de58a['push'](_0x5de58a['shift']());}};_0x589a6d(++_0x23d58e);}(_0xfea3,0xaa));var _0x3fea=function(_0x57e774,_0x59b603){_0x57e774=_0x57e774-0x0;var _0x400c9f=_0xfea3[_0x57e774];return _0x400c9f;};'use strict';var _=require(_0x3fea('0x0'));var squel=require(_0x3fea('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0x3fea('0x2')];var utils=require(_0x3fea('0x3'));var db=require(_0x3fea('0x4'))['db'];function skipInteractionsQuery(_0x67a3aa,_0x26b851,_0x3ba0c2){var _0x223e0f=![];var _0x3d8ffb=utils[_0x3fea('0x5')](_0x67a3aa);if(_0x26b851[_0x3fea('0x6')]===_0x3fea('0x7')&&!_0x3ba0c2[_0x3fea('0x8')]&&!_0x3ba0c2[_0x3d8ffb]){_0x223e0f=!![];}return _0x223e0f;}function getTagsQuery(){return squel[_0x3fea('0x9')]()['field']('id')[_0x3fea('0xa')](_0x3fea('0xb'))[_0x3fea('0xa')](_0x3fea('0xc'))[_0x3fea('0xd')](_0x3fea('0xe'));}function getUsersQuery(_0x165a31,_0x36c688){var _0x455ee7=utils['getInteractionFK'](_0x165a31);var _0x1fe186=_0x3fea('0xf')+_0x165a31+_0x3fea('0x10');var _0x37b8dd=squel[_0x3fea('0x9')]()[_0x3fea('0xa')](_0x3fea('0x11'))['field']('u.fullname')[_0x3fea('0xa')](_0x3fea('0x12')+_0x455ee7)[_0x3fea('0xd')](_0x1fe186,'ui')[_0x3fea('0x13')](_0x3fea('0x14'),'u',_0x3fea('0x15'));if(_0x36c688['length']>0x0){_0x37b8dd[_0x3fea('0x16')](_0x3fea('0x12')+_0x455ee7+_0x3fea('0x17'),_[_0x3fea('0x18')](_0x36c688,'id'));}return _0x37b8dd;}function getInteractionsQuery(_0x263e15){var _0x235128=utils['getInteractionsTables'](_0x263e15);var _0x421692=utils[_0x3fea('0x5')](_0x263e15);var _0x100722=utils[_0x3fea('0x19')](_0x263e15);return squel[_0x3fea('0x9')]()[_0x3fea('0xd')](_0x235128[_0x3fea('0x1a')],'i')[_0x3fea('0x13')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x3fea('0x14'),'o',_0x3fea('0x1b'))[_0x3fea('0x13')](_0x235128[_0x3fea('0x1c')],'a',_0x3fea('0x1d')+_0x421692)['left_join'](_0x235128['messages'],'me',_0x3fea('0x1e')+_0x100722+_0x3fea('0x1f'))[_0x3fea('0x13')](_0x235128[_0x3fea('0x20')],'it','it.'+_0x100722+_0x3fea('0x1f'))[_0x3fea('0x13')](_0x3fea('0xe'),'t',_0x3fea('0x21'));}function getSqlClauses(){var _0x2c92fb={'body':squel[_0x3fea('0x22')](),'contact':squel[_0x3fea('0x22')](),'default':squel['expr'](),'fields':squel[_0x3fea('0x22')](),'filter':squel[_0x3fea('0x22')](),'read':squel[_0x3fea('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x3fea('0x22')]()};return _0x2c92fb;}function parseTagParameter(_0x3a1814){var _0x3d397e=squel['expr']();if(_0x3a1814){var _0x5989c0=utils[_0x3fea('0x23')](_0x3a1814);_0x5989c0[_0x3fea('0x24')](function(_0x13330d){_0x3d397e['or'](_0x3fea('0x25'),'%,'+_0x13330d+',%');});}return _0x3d397e;}function parseReadParameter(_0x24e7c3){var _0x5c7afb='';if(_0x24e7c3){_0x5c7afb=_0x3fea('0x26');if(_0x24e7c3==='1'){_0x5c7afb=_0x5c7afb[_0x3fea('0x27')](_0x3fea('0x28'),'=');}else{_0x5c7afb=_0x5c7afb[_0x3fea('0x27')](_0x3fea('0x28'),'>');}}return _0x5c7afb;}function parseSearchFilter(_0xa2065c,_0x2f48e7){var _0x314f8d=squel[_0x3fea('0x22')]();if(_0x2f48e7){var _0x3c3ade=_0x2f48e7[_0x3fea('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3fea('0x29')](_0x3c3ade)){_0x314f8d['or']('i.id\x20LIKE\x20?',_0x3c3ade+'%');if([_0x3fea('0x2a'),_0x3fea('0x2b')][_0x3fea('0x2c')](_0xa2065c)){_0x314f8d['or']('i.phone\x20LIKE\x20?',_0x3c3ade+'%');}else if(_0xa2065c==='fax'){_0x314f8d['or']('i.fax\x20LIKE\x20?',_0x3c3ade+'%');}}else if(_0xa2065c===_0x3fea('0x2d')&&qs[_0x3fea('0x2e')](_0x3c3ade)){_0x314f8d['or'](_0x3fea('0x2f'),_0x3c3ade+'%');}else{if(_0xa2065c===_0x3fea('0x2d')){_0x314f8d['or'](_0x3fea('0x30'),qs[_0x3fea('0x31')](_0x3c3ade))['or'](_0x3fea('0x32'),qs[_0x3fea('0x31')](_0x3c3ade));}else{if(_0xa2065c!==_0x3fea('0x33')){_0x314f8d['or'](_0x3fea('0x34'),qs[_0x3fea('0x31')](_0x3c3ade));}_0x314f8d['or'](_0x3fea('0x35'),_0x3c3ade+'%');if(_0xa2065c===_0x3fea('0x36')){_0x314f8d['or'](_0x3fea('0x37'),_0x3c3ade+'%');}}}}return _0x314f8d;}function parseAdvancedSearchFilter(_0x29bc09,_0x45168a){var _0x5cf272=getSqlClauses();var _0x5501fa=as[_0x3fea('0x38')](_0x29bc09);var _0x274867=_0x5501fa[_0x3fea('0x39')];for(var _0x20ae5d=0x0;_0x20ae5d<_0x5501fa[_0x3fea('0x3a')][_0x3fea('0x3b')];_0x20ae5d++){var _0x1b8207=_0x5501fa[_0x3fea('0x3a')][_0x20ae5d];var _0x36c0c5='i';var _0x58d531=_[_0x3fea('0x3c')](_0x45168a,['name',_0x1b8207[_0x3fea('0xa')]]);if(_0x58d531){var _0x294bae=as['buildExpression'](_0x36c0c5,_0x58d531[_0x3fea('0x3d')],_0x1b8207);_0x5cf272[_0x3fea('0x3e')][_0x274867](_0x294bae[_0x3fea('0x3f')],_0x294bae['value'][_0x3fea('0x40')],_0x294bae[_0x3fea('0x41')][_0x3fea('0x42')]);}else{switch(_0x1b8207[_0x3fea('0xa')]){case'unreadMessages':var _0x711c92=parseReadParameter(_0x1b8207['value']);_0x5cf272['read'][_0x3fea('0x43')](_0x711c92);break;case _0x3fea('0x44'):if(_0x1b8207['operator']===_0x3fea('0x45')){if(_0x1b8207['value']['split']('\x20')['length']>0x1){_0x5cf272[_0x3fea('0x46')][_0x274867](_0x3fea('0x47'),qs['getFullTextValue'](_0x1b8207[_0x3fea('0x41')]),null);}else{var _0x28ddea='%'+_0x1b8207[_0x3fea('0x41')]+'%';_0x5cf272[_0x3fea('0x46')][_0x274867](_0x3fea('0x48'),_0x28ddea,_0x28ddea,_0x28ddea);}}else{_0x58d531=_[_0x3fea('0x3c')](_0x45168a,['name','ContactId']);_0x1b8207['field']=_0x3fea('0x49');_0x294bae=as[_0x3fea('0x4a')](_0x36c0c5,_0x58d531[_0x3fea('0x3d')],_0x1b8207);_0x5cf272[_0x3fea('0x46')][_0x274867](_0x294bae['text'],_0x294bae[_0x3fea('0x41')]['start'],_0x294bae[_0x3fea('0x41')]['end']);}break;case _0x3fea('0x4b'):var _0x184854=_0x1b8207[_0x3fea('0x41')]['split'](',')[_0x3fea('0x18')](function(_0x341b40){return Number(_0x341b40);});var _0x32d634=parseTagParameter(_0x184854);_0x5cf272[_0x3fea('0x4c')][_0x3fea('0x4d')][_0x3fea('0x43')](_0x32d634);_0x5cf272[_0x3fea('0x4c')]['ids']=_0x184854;break;case'User':if(_0x1b8207[_0x3fea('0x4e')]===_0x3fea('0x45')){_0x5cf272['user'][_0x274867]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1b8207[_0x3fea('0x41')]+'%',null);}else{_0x58d531=_[_0x3fea('0x3c')](_0x45168a,['name',_0x3fea('0x4f')]);_0x1b8207['field']=_0x3fea('0x4f');_0x294bae=as[_0x3fea('0x4a')](_0x36c0c5,_0x58d531[_0x3fea('0x3d')],_0x1b8207);_0x5cf272[_0x3fea('0x50')][_0x274867](_0x294bae['text'],_0x294bae['value'][_0x3fea('0x40')],_0x294bae[_0x3fea('0x41')][_0x3fea('0x42')]);}break;case _0x3fea('0x51'):case _0x3fea('0x52'):_0x294bae=as[_0x3fea('0x4a')]('me',null,_0x1b8207);_0x5cf272[_0x3fea('0x51')][_0x274867](_0x294bae[_0x3fea('0x3f')],_0x294bae[_0x3fea('0x41')][_0x3fea('0x40')],_0x294bae[_0x3fea('0x41')][_0x3fea('0x42')]);break;}}}return _0x5cf272;}function parseModelFields(_0x3eb5fc,_0x3fb937,_0x59d43f){var _0x23804e=utils[_0x3fea('0x5')](_0x3eb5fc);var _0x1f0f8f=squel['expr']();var _0x49f623=_(_0x3fb937)[_0x3fea('0x53')]()['map'](function(_0xea4cca){return _[_0x3fea('0x54')](_0x59d43f,['name',_0xea4cca])?_0xea4cca:undefined;})[_0x3fea('0x55')]()[_0x3fea('0x41')]();if(_0x49f623[_0x3fea('0x3b')]>0x0){_0x49f623[_0x3fea('0x24')](function(_0x24b350){if(_0x24b350===_0x23804e){_0x1f0f8f[_0x3fea('0x43')]('i.'+_0x23804e+_0x3fea('0x17'),[][_0x3fea('0x56')](_0x3fb937[_0x24b350]));}else if(_0x24b350===_0x3fea('0x57')){var _0x272aef=JSON[_0x3fea('0x58')](_0x3fb937[_0x24b350])[_0x3fea('0x59')];var _0x37e519=JSON[_0x3fea('0x58')](_0x3fb937[_0x24b350])[_0x3fea('0x5a')];_0x1f0f8f[_0x3fea('0x43')](_0x3fea('0x5b'),_0x272aef,_0x37e519);}else{if(_0x3fb937[_0x24b350]===_0x3fea('0x5c')){_0x1f0f8f[_0x3fea('0x43')]('i.'+_0x24b350+_0x3fea('0x5d'));}else{_0x1f0f8f['and']('i.'+_0x24b350+'\x20=\x20?',_0x3fb937[_0x24b350]);}}});}return _0x1f0f8f;}function parseQueryParameters(_0x218e9d,_0xb8bcfb,_0x5003bc){var _0x3d2aad=getSqlClauses();return Promise[_0x3fea('0x5e')]()[_0x3fea('0x5f')](function(){return parseModelFields(_0x218e9d,_0xb8bcfb,_0x5003bc);})[_0x3fea('0x5f')](function(_0x38032e){_0x3d2aad[_0x3fea('0x60')][_0x3fea('0x43')](_0x38032e);return parseReadParameter(_0xb8bcfb[_0x3fea('0x61')]);})[_0x3fea('0x5f')](function(_0x4976e2){_0x3d2aad['read'][_0x3fea('0x43')](_0x4976e2);return parseTagParameter(_0xb8bcfb[_0x3fea('0x62')]);})[_0x3fea('0x5f')](function(_0x24ee26){_0x3d2aad[_0x3fea('0x4c')][_0x3fea('0x4d')][_0x3fea('0x43')](_0x24ee26);return parseSearchFilter(_0x218e9d,_0xb8bcfb[_0x3fea('0x63')]);})[_0x3fea('0x5f')](function(_0x5d8cbb){_0x3d2aad['filter']=_0x5d8cbb;return _0x3d2aad;});}function checkAccountsRestrictions(_0x206fb7,_0x345e00,_0x4814cd){var _0x4a4a50=utils[_0x3fea('0x5')](_0x206fb7);var _0x5e42d7=_0x3fea('0x64')+_[_0x3fea('0x65')](_0x206fb7)+(_0x206fb7===_0x3fea('0x66')?_0x3fea('0x67'):_0x3fea('0x68'));var _0x177ae0=squel[_0x3fea('0x22')]();return Promise[_0x3fea('0x5e')]()[_0x3fea('0x5f')](function(){if(_0x4814cd[_0x3fea('0x8')]&&_0x345e00[_0x3fea('0x6')]==='agent'){return _0x345e00[_0x5e42d7]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x489bd9){if(_0x489bd9){if(_0x489bd9[_0x3fea('0x3b')]===0x0){_0x177ae0[_0x3fea('0x43')]('i.'+_0x4a4a50+_0x3fea('0x5d'));}else{_0x177ae0[_0x3fea('0x43')]('i.'+_0x4a4a50+_0x3fea('0x17'),_['map'](_0x489bd9,'id'));}}else if(!_0x4814cd[_0x4a4a50]){_0x177ae0[_0x3fea('0x43')]('i.'+_0x4a4a50+_0x3fea('0x69'));}})[_0x3fea('0x5f')](function(){return _0x177ae0;});}function getClosedOrderClause(_0x29dfe3,_0xe6c065){var _0x2f91fc='';var _0x5ebae0=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x29dfe3===_0x3fea('0x2d')){_0x5ebae0['unshift'](_0x3fea('0x6a'));}if(_0xe6c065[_0x3fea('0x6b')]==='0'&&_0x29dfe3==='mail'){_0x2f91fc='i.substatus';}else{if(_0xe6c065[_0x3fea('0x6b')]==='1'){_0x5ebae0[_0x3fea('0x6c')]();}_0x2f91fc=_0x3fea('0x6d')+_0x5ebae0[_0x3fea('0x6e')](',\x20')+')';}return _0x2f91fc;}function getFilteredInteractions(_0x3b4fc2,_0x521b0e,_0x518c2f,_0x6f6515){var _0x1b5832=utils[_0x3fea('0x19')](_0x3b4fc2);var _0x493010=_[_0x3fea('0x65')](_0x3b4fc2)+_0x3fea('0x6f');var _0x578f4d=[];var _0x196841=getTagsQuery();var _0x111331={'type':db[_0x3fea('0x70')][_0x3fea('0x71')][_0x3fea('0x72')],'raw':!![]};var _0x99865f=[];var _0x46de09=[];return db[_0x3fea('0x73')]['query'](_0x196841[_0x3fea('0x74')](),_0x111331)[_0x3fea('0x5f')](function(_0x1a626e){_0x578f4d=_['keyBy'](_0x1a626e,'id');_0x111331=_['merge'](_0x111331,{'model':db[_0x493010],'mapToModel':!![],'nest':!![]});if(_0x518c2f[_0x3fea('0x60')]){_0x6f6515[_0x3fea('0x75')][_0x3fea('0x24')](function(_0x5ce8fe){_0x521b0e[_0x3fea('0xa')]('i.'+_0x5ce8fe);});}else{_0x521b0e[_0x3fea('0xa')](_0x3fea('0x76'),_0x3fea('0x77'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x78'),_0x3fea('0x79'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x7a'),_0x3fea('0x7b'));if(_0x3b4fc2===_0x3fea('0x2d')){_0x521b0e[_0x3fea('0xa')](_0x3fea('0x7c'),'Account.email');_0x521b0e[_0x3fea('0xa')](_0x3fea('0x7d'),'contactName');_0x521b0e[_0x3fea('0xa')](_0x3fea('0x7e'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x7f'));_0x521b0e['field']('i.updatedAt');_0x521b0e[_0x3fea('0xa')](_0x3fea('0x80'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x81'));_0x521b0e[_0x3fea('0xa')]('i.attach');_0x521b0e['field'](_0x3fea('0x82'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x83'));_0x521b0e['field']('i.subject');_0x521b0e[_0x3fea('0xa')](_0x3fea('0x84'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x85'));_0x521b0e['field'](_0x3fea('0x86'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x6a'));_0x521b0e[_0x3fea('0xa')]('i.to');_0x521b0e['field'](_0x3fea('0x87'));_0x521b0e[_0x3fea('0xa')]('i.MailAccountId');_0x521b0e[_0x3fea('0xa')](_0x3fea('0x88'));}else if(_0x3b4fc2==='openchannel'){_0x521b0e['field'](_0x3fea('0x89'),'contactName');}else{_0x521b0e[_0x3fea('0xa')]('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',_0x3fea('0x8a'));}if(_0x3b4fc2!==_0x3fea('0x2d')){_0x521b0e[_0x3fea('0xa')]('i.*');}_0x521b0e[_0x3fea('0xa')](_0x3fea('0x8b'),_0x3fea('0x8c'));_0x521b0e['field'](_0x3fea('0x8d'),_0x3fea('0x8e'));_0x521b0e['field'](_0x3fea('0x8f'),_0x3fea('0x90'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x91'),_0x3fea('0x92'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x93'),_0x3fea('0x94'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x95'),_0x3fea('0x96'));_0x521b0e[_0x3fea('0xa')]('o.fullname',_0x3fea('0x97'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x98'),_0x3fea('0x99'));_0x521b0e[_0x3fea('0xa')](_0x3fea('0x9a'),_0x3fea('0x9b'));}if(_0x6f6515[_0x3fea('0x9c')]){_0x521b0e[_0x3fea('0x9c')](_0x6f6515[_0x3fea('0x9c')]);}if(_0x6f6515['offset']){_0x521b0e[_0x3fea('0x9d')](_0x6f6515[_0x3fea('0x9d')]);}return db[_0x3fea('0x73')][_0x3fea('0x9e')](_0x521b0e[_0x3fea('0x74')](),_0x111331);})[_0x3fea('0x5f')](function(_0xc2716a){_0x99865f=_0xc2716a;var _0x507ba3=getUsersQuery(_0x3b4fc2,_0x99865f);return db[_0x3fea('0x73')][_0x3fea('0x9e')](_0x507ba3[_0x3fea('0x74')](),_0x111331);})[_0x3fea('0x5f')](function(_0x44f1d0){_0x46de09=_[_0x3fea('0x9f')](_0x44f1d0,_0x1b5832);if(_0x3b4fc2===_0x3fea('0x2d')){return db['Setting']['findOne']({'attributes':[_0x3fea('0xa0')],'raw':!![]});}})[_0x3fea('0x5f')](function(_0x3aed74){var _0x274d63=_0x3aed74?_0x3aed74[_0x3fea('0xa0')]:undefined;var _0x3ea4b9=_0x99865f['map'](function(_0x2036c9){return updateInteraction(_0x2036c9,_0x578f4d,_0x46de09,_0x274d63);});return Promise[_0x3fea('0xa1')](_0x3ea4b9);});}function countFilteredInteractions(_0x3643cf,_0x37e7f8){var _0x3846f8=_0x3643cf['clone']();_0x3846f8[_0x3fea('0xa')](_0x3fea('0xa2'));_0x3846f8[_0x3fea('0xa')](_0x3fea('0x76'),_0x3fea('0x77'));var _0x56777f=utils[_0x3fea('0x23')](_0x37e7f8);if(!_['isEmpty'](_0x56777f)){_0x3846f8[_0x3fea('0x16')](_0x3fea('0xa3'),_0x56777f);}var _0x3ce4d7={'type':db['Sequelize'][_0x3fea('0x71')][_0x3fea('0x72')],'raw':!![]};return db[_0x3fea('0x73')][_0x3fea('0x9e')](_0x3846f8[_0x3fea('0x74')](),_0x3ce4d7);}module[_0x3fea('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xa086=['merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.to','i.ContactId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','groupBy','Setting','all','clone','isEmpty','Sequelize','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','color','tools_tags','user_has_','_interactions','u.id','u.fullname','from','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','getInteractionFK','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','interactionsTags','it.','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','i.fax\x20LIKE\x20?','mail','isEmail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.from\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','text','value','start','end','unreadMessages','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','Tag','clause','tags','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','keys','some','compact','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','resolve','then','read','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','QueryTypes','sequelize','toString','keyBy'];(function(_0x4683d2,_0x5c26b2){var _0x552b38=function(_0x15952b){while(--_0x15952b){_0x4683d2['push'](_0x4683d2['shift']());}};_0x552b38(++_0x5c26b2);}(_0xa086,0xd2));var _0x6a08=function(_0x5ee5f2,_0x5b979b){_0x5ee5f2=_0x5ee5f2-0x0;var _0x523a24=_0xa086[_0x5ee5f2];return _0x523a24;};'use strict';var _=require(_0x6a08('0x0'));var squel=require(_0x6a08('0x1'));var as=require(_0x6a08('0x2'));var qs=require(_0x6a08('0x3'));var updateInteraction=require(_0x6a08('0x4'))['updateInteraction'];var utils=require(_0x6a08('0x5'));var db=require(_0x6a08('0x6'))['db'];function skipInteractionsQuery(_0x55b1e8,_0x29bbb7,_0x9d002b){var _0x4d9854=![];var _0x553ed1=utils[_0x6a08('0x7')](_0x55b1e8);if(_0x29bbb7[_0x6a08('0x8')]===_0x6a08('0x9')&&!_0x9d002b[_0x6a08('0xa')]&&!_0x9d002b[_0x553ed1]){_0x4d9854=!![];}return _0x4d9854;}function getTagsQuery(){return squel[_0x6a08('0xb')]()[_0x6a08('0xc')]('id')[_0x6a08('0xc')]('name')[_0x6a08('0xc')](_0x6a08('0xd'))['from'](_0x6a08('0xe'));}function getUsersQuery(_0x77ff6d,_0x104913){var _0x331607=utils['getInteractionFK'](_0x77ff6d);var _0x5715a2=_0x6a08('0xf')+_0x77ff6d+_0x6a08('0x10');var _0x386544=squel['select']()[_0x6a08('0xc')](_0x6a08('0x11'))[_0x6a08('0xc')](_0x6a08('0x12'))[_0x6a08('0xc')]('ui.'+_0x331607)[_0x6a08('0x13')](_0x5715a2,'ui')['left_join'](_0x6a08('0x14'),'u',_0x6a08('0x15'));if(_0x104913[_0x6a08('0x16')]>0x0){_0x386544[_0x6a08('0x17')](_0x6a08('0x18')+_0x331607+_0x6a08('0x19'),_[_0x6a08('0x1a')](_0x104913,'id'));}return _0x386544;}function getInteractionsQuery(_0x581606){var _0x3ad15b=utils[_0x6a08('0x1b')](_0x581606);var _0x3bdccf=utils[_0x6a08('0x7')](_0x581606);var _0x3a9a42=utils[_0x6a08('0x1c')](_0x581606);return squel['select']()[_0x6a08('0x13')](_0x3ad15b['interactions'],'i')[_0x6a08('0x1d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6a08('0x1d')]('users','o',_0x6a08('0x1e'))[_0x6a08('0x1d')](_0x3ad15b['accounts'],'a',_0x6a08('0x1f')+_0x3bdccf)[_0x6a08('0x1d')](_0x3ad15b[_0x6a08('0x20')],'me','me.'+_0x3a9a42+'\x20=\x20i.id')[_0x6a08('0x1d')](_0x3ad15b[_0x6a08('0x21')],'it',_0x6a08('0x22')+_0x3a9a42+'\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x1db052={'body':squel[_0x6a08('0x23')](),'contact':squel['expr'](),'default':squel[_0x6a08('0x23')](),'fields':squel[_0x6a08('0x23')](),'filter':squel[_0x6a08('0x23')](),'read':squel[_0x6a08('0x23')](),'tags':{'clause':squel[_0x6a08('0x23')](),'ids':null},'user':squel['expr']()};return _0x1db052;}function parseTagParameter(_0x366d30){var _0x2a099e=squel[_0x6a08('0x23')]();if(_0x366d30){var _0x55874b=utils[_0x6a08('0x24')](_0x366d30);_0x55874b[_0x6a08('0x25')](function(_0x2d0526){_0x2a099e['or'](_0x6a08('0x26'),'%,'+_0x2d0526+',%');});}return _0x2a099e;}function parseReadParameter(_0x380b9d){var _0x7de2cc='';if(_0x380b9d){_0x7de2cc=_0x6a08('0x27');if(_0x380b9d==='1'){_0x7de2cc=_0x7de2cc['replace'](_0x6a08('0x28'),'=');}else{_0x7de2cc=_0x7de2cc[_0x6a08('0x29')]('{OPERATOR}','>');}}return _0x7de2cc;}function parseSearchFilter(_0x19c3c1,_0x2fc159){var _0x1066a0=squel[_0x6a08('0x23')]();if(_0x2fc159){var _0x2e4e7a=_0x2fc159[_0x6a08('0x29')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6a08('0x2a')](_0x2e4e7a)){_0x1066a0['or'](_0x6a08('0x2b'),_0x2e4e7a+'%');if([_0x6a08('0x2c'),_0x6a08('0x2d')][_0x6a08('0x2e')](_0x19c3c1)){_0x1066a0['or'](_0x6a08('0x2f'),_0x2e4e7a+'%');}else if(_0x19c3c1===_0x6a08('0x30')){_0x1066a0['or'](_0x6a08('0x31'),_0x2e4e7a+'%');}}else if(_0x19c3c1===_0x6a08('0x32')&&qs[_0x6a08('0x33')](_0x2e4e7a)){_0x1066a0['or']('c.email\x20LIKE\x20?',_0x2e4e7a+'%');}else{if(_0x19c3c1==='mail'){_0x1066a0['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6a08('0x34')](_0x2e4e7a))['or'](_0x6a08('0x35'),qs[_0x6a08('0x34')](_0x2e4e7a));}else{if(_0x19c3c1!==_0x6a08('0x30')){_0x1066a0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6a08('0x34')](_0x2e4e7a));}_0x1066a0['or'](_0x6a08('0x36'),_0x2e4e7a+'%');if(_0x19c3c1==='openchannel'){_0x1066a0['or'](_0x6a08('0x37'),_0x2e4e7a+'%');}}}}return _0x1066a0;}function parseAdvancedSearchFilter(_0xb95193,_0x47c9dd){var _0x46ac15=getSqlClauses();var _0x349adc=as[_0x6a08('0x38')](_0xb95193);var _0x70b59c=_0x349adc[_0x6a08('0x39')];for(var _0x23d2d2=0x0;_0x23d2d2<_0x349adc[_0x6a08('0x3a')][_0x6a08('0x16')];_0x23d2d2++){var _0x5974d8=_0x349adc['conditions'][_0x23d2d2];var _0x2d9cf7='i';var _0x5646e3=_[_0x6a08('0x3b')](_0x47c9dd,[_0x6a08('0x3c'),_0x5974d8['field']]);if(_0x5646e3){var _0x21d8e4=as['buildExpression'](_0x2d9cf7,_0x5646e3['type'],_0x5974d8);_0x46ac15['default'][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x3f')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x40')]);}else{switch(_0x5974d8[_0x6a08('0xc')]){case _0x6a08('0x41'):var _0x200655=parseReadParameter(_0x5974d8['value']);_0x46ac15['read'][_0x6a08('0x42')](_0x200655);break;case _0x6a08('0x43'):if(_0x5974d8[_0x6a08('0x44')]===_0x6a08('0x45')){if(_0x5974d8[_0x6a08('0x3e')][_0x6a08('0x46')]('\x20')[_0x6a08('0x16')]>0x1){_0x46ac15[_0x6a08('0x47')][_0x70b59c](_0x6a08('0x48'),qs[_0x6a08('0x34')](_0x5974d8[_0x6a08('0x3e')]),null);}else{var _0x598d74='%'+_0x5974d8[_0x6a08('0x3e')]+'%';_0x46ac15[_0x6a08('0x47')][_0x70b59c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x598d74,_0x598d74,_0x598d74);}}else{_0x5646e3=_[_0x6a08('0x3b')](_0x47c9dd,[_0x6a08('0x3c'),_0x6a08('0x49')]);_0x5974d8[_0x6a08('0xc')]=_0x6a08('0x49');_0x21d8e4=as[_0x6a08('0x4a')](_0x2d9cf7,_0x5646e3[_0x6a08('0x4b')],_0x5974d8);_0x46ac15[_0x6a08('0x47')][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x3f')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x40')]);}break;case _0x6a08('0x4c'):var _0x49d12c=_0x5974d8[_0x6a08('0x3e')][_0x6a08('0x46')](',')[_0x6a08('0x1a')](function(_0x51a834){return Number(_0x51a834);});var _0x417f2b=parseTagParameter(_0x49d12c);_0x46ac15['tags'][_0x6a08('0x4d')]['and'](_0x417f2b);_0x46ac15[_0x6a08('0x4e')]['ids']=_0x49d12c;break;case _0x6a08('0x4f'):if(_0x5974d8[_0x6a08('0x44')]==='$substring'){_0x46ac15[_0x6a08('0x50')][_0x70b59c](_0x6a08('0x51'),'%'+_0x5974d8['value']+'%',null);}else{_0x5646e3=_[_0x6a08('0x3b')](_0x47c9dd,[_0x6a08('0x3c'),_0x6a08('0x52')]);_0x5974d8[_0x6a08('0xc')]=_0x6a08('0x52');_0x21d8e4=as['buildExpression'](_0x2d9cf7,_0x5646e3[_0x6a08('0x4b')],_0x5974d8);_0x46ac15[_0x6a08('0x50')][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')]['start'],_0x21d8e4['value'][_0x6a08('0x40')]);}break;case'body':case _0x6a08('0x53'):_0x21d8e4=as[_0x6a08('0x4a')]('me',null,_0x5974d8);_0x46ac15[_0x6a08('0x54')][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x3f')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x40')]);break;}}}return _0x46ac15;}function parseModelFields(_0x428262,_0x9f13f4,_0x1872eb){var _0x515e58=utils['getAccountFK'](_0x428262);var _0x5ac0ac=squel[_0x6a08('0x23')]();var _0x22ea51=_(_0x9f13f4)[_0x6a08('0x55')]()['map'](function(_0xde423){return _[_0x6a08('0x56')](_0x1872eb,[_0x6a08('0x3c'),_0xde423])?_0xde423:undefined;})[_0x6a08('0x57')]()['value']();if(_0x22ea51['length']>0x0){_0x22ea51[_0x6a08('0x25')](function(_0x195d78){if(_0x195d78===_0x515e58){_0x5ac0ac[_0x6a08('0x42')]('i.'+_0x515e58+_0x6a08('0x19'),[][_0x6a08('0x58')](_0x9f13f4[_0x195d78]));}else if(_0x195d78===_0x6a08('0x59')){var _0x1a72fe=JSON['parse'](_0x9f13f4[_0x195d78])[_0x6a08('0x5a')];var _0x1b6bfe=JSON[_0x6a08('0x5b')](_0x9f13f4[_0x195d78])[_0x6a08('0x5c')];_0x5ac0ac[_0x6a08('0x42')](_0x6a08('0x5d'),_0x1a72fe,_0x1b6bfe);}else{if(_0x9f13f4[_0x195d78]===_0x6a08('0x5e')){_0x5ac0ac[_0x6a08('0x42')]('i.'+_0x195d78+'\x20IS\x20NULL');}else{_0x5ac0ac[_0x6a08('0x42')]('i.'+_0x195d78+_0x6a08('0x5f'),_0x9f13f4[_0x195d78]);}}});}return _0x5ac0ac;}function parseQueryParameters(_0x33acfb,_0x717283,_0x2d27f4){var _0x313903=getSqlClauses();return Promise[_0x6a08('0x60')]()['then'](function(){return parseModelFields(_0x33acfb,_0x717283,_0x2d27f4);})[_0x6a08('0x61')](function(_0x27f3f1){_0x313903['fields']['and'](_0x27f3f1);return parseReadParameter(_0x717283[_0x6a08('0x62')]);})[_0x6a08('0x61')](function(_0x5c2058){_0x313903[_0x6a08('0x62')]['and'](_0x5c2058);return parseTagParameter(_0x717283[_0x6a08('0x63')]);})['then'](function(_0x2629ec){_0x313903['tags'][_0x6a08('0x4d')]['and'](_0x2629ec);return parseSearchFilter(_0x33acfb,_0x717283[_0x6a08('0x64')]);})['then'](function(_0x5d0c76){_0x313903[_0x6a08('0x64')]=_0x5d0c76;return _0x313903;});}function checkAccountsRestrictions(_0x2e9f05,_0x51c531,_0x4c304b){var _0x570754=utils[_0x6a08('0x7')](_0x2e9f05);var _0x4a13a1=_0x6a08('0x65')+_[_0x6a08('0x66')](_0x2e9f05)+(_0x2e9f05===_0x6a08('0x67')?_0x6a08('0x68'):_0x6a08('0x69'));var _0x197f45=squel['expr']();return Promise[_0x6a08('0x60')]()['then'](function(){if(_0x4c304b[_0x6a08('0xa')]&&_0x51c531[_0x6a08('0x8')]==='agent'){return _0x51c531[_0x4a13a1]({'attributes':['id'],'raw':!![]});}})[_0x6a08('0x61')](function(_0x31b60f){if(_0x31b60f){if(_0x31b60f[_0x6a08('0x16')]===0x0){_0x197f45[_0x6a08('0x42')]('i.'+_0x570754+_0x6a08('0x6a'));}else{_0x197f45['and']('i.'+_0x570754+_0x6a08('0x19'),_[_0x6a08('0x1a')](_0x31b60f,'id'));}}else if(!_0x4c304b[_0x570754]){_0x197f45[_0x6a08('0x42')]('i.'+_0x570754+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x197f45;});}function getClosedOrderClause(_0x12b81d,_0x197a3f){var _0x2a4e95='';var _0x50d711=[_0x6a08('0x6b'),_0x6a08('0x6c'),_0x6a08('0x6d')];if(_0x12b81d==='mail'){_0x50d711[_0x6a08('0x6e')](_0x6a08('0x6f'));}if(_0x197a3f['closed']==='0'&&_0x12b81d===_0x6a08('0x32')){_0x2a4e95=_0x6a08('0x6f');}else{if(_0x197a3f[_0x6a08('0x70')]==='1'){_0x50d711['shift']();}_0x2a4e95=_0x6a08('0x71')+_0x50d711[_0x6a08('0x72')](',\x20')+')';}return _0x2a4e95;}function getFilteredInteractions(_0x5124be,_0x277986,_0x149c80,_0x10dc86){var _0x38c0d7=utils[_0x6a08('0x1c')](_0x5124be);var _0x150447=_[_0x6a08('0x66')](_0x5124be)+_0x6a08('0x73');var _0x5505d4=[];var _0x4f6dad=getTagsQuery();var _0x31b557={'type':db['Sequelize'][_0x6a08('0x74')]['SELECT'],'raw':!![]};var _0x4d3f79=[];var _0x3578d2=[];return db[_0x6a08('0x75')]['query'](_0x4f6dad[_0x6a08('0x76')](),_0x31b557)[_0x6a08('0x61')](function(_0x2567d0){_0x5505d4=_[_0x6a08('0x77')](_0x2567d0,'id');_0x31b557=_[_0x6a08('0x78')](_0x31b557,{'model':db[_0x150447],'mapToModel':!![],'nest':!![]});if(_0x149c80['fields']){_0x10dc86['attributes'][_0x6a08('0x25')](function(_0x5a2160){_0x277986[_0x6a08('0xc')]('i.'+_0x5a2160);});}else{_0x277986[_0x6a08('0xc')](_0x6a08('0x79'),_0x6a08('0x41'));_0x277986[_0x6a08('0xc')](_0x6a08('0x7a'),'Account.key');_0x277986['field'](_0x6a08('0x7b'),_0x6a08('0x7c'));if(_0x5124be===_0x6a08('0x32')){_0x277986['field'](_0x6a08('0x7d'),_0x6a08('0x7e'));_0x277986[_0x6a08('0xc')](_0x6a08('0x7f'),_0x6a08('0x80'));_0x277986[_0x6a08('0xc')]('i.id');_0x277986[_0x6a08('0xc')](_0x6a08('0x81'));_0x277986['field'](_0x6a08('0x82'));_0x277986[_0x6a08('0xc')](_0x6a08('0x83'));_0x277986['field'](_0x6a08('0x84'));_0x277986[_0x6a08('0xc')]('i.attach');_0x277986[_0x6a08('0xc')]('i.lastMsgAt');_0x277986['field'](_0x6a08('0x85'));_0x277986['field']('i.subject');_0x277986[_0x6a08('0xc')](_0x6a08('0x6d'));_0x277986['field'](_0x6a08('0x6c'));_0x277986[_0x6a08('0xc')](_0x6a08('0x6b'));_0x277986['field'](_0x6a08('0x6f'));_0x277986[_0x6a08('0xc')](_0x6a08('0x86'));_0x277986[_0x6a08('0xc')](_0x6a08('0x87'));_0x277986['field']('i.MailAccountId');_0x277986['field']('i.UserId');}else if(_0x5124be==='openchannel'){_0x277986[_0x6a08('0xc')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x277986[_0x6a08('0xc')](_0x6a08('0x88'),_0x6a08('0x80'));}if(_0x5124be!==_0x6a08('0x32')){_0x277986[_0x6a08('0xc')](_0x6a08('0x89'));}_0x277986[_0x6a08('0xc')](_0x6a08('0x8a'),_0x6a08('0x8b'));_0x277986[_0x6a08('0xc')](_0x6a08('0x8c'),_0x6a08('0x8d'));_0x277986['field']('c.email',_0x6a08('0x8e'));_0x277986[_0x6a08('0xc')](_0x6a08('0x8f'),_0x6a08('0x90'));_0x277986['field'](_0x6a08('0x91'),_0x6a08('0x92'));_0x277986['field'](_0x6a08('0x93'),_0x6a08('0x94'));_0x277986[_0x6a08('0xc')](_0x6a08('0x95'),_0x6a08('0x96'));_0x277986[_0x6a08('0xc')](_0x6a08('0x97'),_0x6a08('0x98'));_0x277986[_0x6a08('0xc')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6a08('0x99'));}if(_0x10dc86[_0x6a08('0x9a')]){_0x277986[_0x6a08('0x9a')](_0x10dc86[_0x6a08('0x9a')]);}if(_0x10dc86['offset']){_0x277986[_0x6a08('0x9b')](_0x10dc86[_0x6a08('0x9b')]);}return db[_0x6a08('0x75')][_0x6a08('0x9c')](_0x277986['toString'](),_0x31b557);})[_0x6a08('0x61')](function(_0x4423e3){_0x4d3f79=_0x4423e3;var _0x2caa09=getUsersQuery(_0x5124be,_0x4d3f79);return db['sequelize'][_0x6a08('0x9c')](_0x2caa09[_0x6a08('0x76')](),_0x31b557);})[_0x6a08('0x61')](function(_0x15d0af){_0x3578d2=_[_0x6a08('0x9d')](_0x15d0af,_0x38c0d7);if(_0x5124be===_0x6a08('0x32')){return db[_0x6a08('0x9e')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x140b1c){var _0x4ed8fa=_0x140b1c?_0x140b1c['enableEmailPreview']:undefined;var _0x14065a=_0x4d3f79['map'](function(_0x2fd73e){return updateInteraction(_0x2fd73e,_0x5505d4,_0x3578d2,_0x4ed8fa);});return Promise[_0x6a08('0x9f')](_0x14065a);});}function countFilteredInteractions(_0x414d7e,_0x59a95d){var _0x1a6a7d=_0x414d7e[_0x6a08('0xa0')]();_0x1a6a7d[_0x6a08('0xc')]('COUNT(*)');_0x1a6a7d[_0x6a08('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6a08('0x41'));var _0x4d6177=utils[_0x6a08('0x24')](_0x59a95d);if(!_[_0x6a08('0xa1')](_0x4d6177)){_0x1a6a7d['where']('t.id\x20IN\x20?',_0x4d6177);}var _0x27d3c8={'type':db[_0x6a08('0xa2')]['QueryTypes'][_0x6a08('0xa3')],'raw':!![]};return db[_0x6a08('0x75')][_0x6a08('0x9c')](_0x1a6a7d[_0x6a08('0x76')](),_0x27d3c8);}module[_0x6a08('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 5b64f91..c06ffa4 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 _0xa0f3=['plainBody','then','lastMsgText','trimStart','catch','Users','TagIds','lodash','../../mysqldb','split','forEach','push','waiting','talking','unmanaged','abandoned','total','closed','disposition','answered','UserId','findOne'];(function(_0x196925,_0xf3f767){var _0x17384e=function(_0x4a145d){while(--_0x4a145d){_0x196925['push'](_0x196925['shift']());}};_0x17384e(++_0xf3f767);}(_0xa0f3,0x151));var _0x3a0f=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa0f3[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x3a0f('0x0'));var db=require(_0x3a0f('0x1'))['db'];function getInteractionUsers(_0x140f91,_0x4f55d5){return new Promise(function(_0x1d42ff,_0x8b97f6){try{var _0x18426c=[];if(_0x4f55d5[_0x140f91]){_0x18426c=_0x4f55d5[_0x140f91]['map'](function(_0x24b906){return{'id':_0x24b906['id'],'fullname':_0x24b906['fullname']};});}return _0x1d42ff(_0x18426c);}catch(_0x290e57){_0x8b97f6(_0x290e57);}});}function getInteractionTags(_0x2d51ad,_0x428081){var _0x3e985c=[];if(_0x2d51ad){_0x2d51ad[_0x3a0f('0x2')](',')[_0x3a0f('0x3')](function(_0x338379){_0x3e985c[_0x3a0f('0x4')](_0x428081[_0x338379]);});}return _0x3e985c;}function updateWaitingCounter(_0x5dabf5){if(_0x5dabf5[_0x3a0f('0x5')]){_0x5dabf5['waiting']-=0x1;}}function updateInteractionCounters(_0x5115a8){_0x5115a8['waiting']=0x0;_0x5115a8[_0x3a0f('0x6')]=0x0;_0x5115a8['answered']=0x0;_0x5115a8[_0x3a0f('0x7')]=0x0;_0x5115a8[_0x3a0f('0x8')]=0x0;_0x5115a8[_0x3a0f('0x9')]=0x0;if(_0x5115a8[_0x3a0f('0xa')]){if(_0x5115a8[_0x3a0f('0xb')]===_0x3a0f('0x8')){_0x5115a8[_0x3a0f('0x8')]+=0x1;updateWaitingCounter(_0x5115a8);}if(_0x5115a8['UserId']){_0x5115a8[_0x3a0f('0xc')]+=0x1;if(_0x5115a8[_0x3a0f('0x6')]){_0x5115a8[_0x3a0f('0x6')]-=0x1;}}else{if(_0x5115a8[_0x3a0f('0xb')]){_0x5115a8[_0x3a0f('0x7')]+=0x1;updateWaitingCounter(_0x5115a8);}}}else{if(!_0x5115a8['UserId']){_0x5115a8[_0x3a0f('0x5')]+=0x1;}if(_0x5115a8[_0x3a0f('0xd')]){_0x5115a8[_0x3a0f('0x6')]+=0x1;updateWaitingCounter(_0x5115a8);}}_0x5115a8[_0x3a0f('0x9')]+=0x1;return _0x5115a8;}function getLastMessageText(_0x34fdac){return db['MailMessage'][_0x3a0f('0xe')]({'where':{'$and':[{'MailInteractionId':_0x34fdac['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3a0f('0xf')],'order':'-id','raw':!![]})[_0x3a0f('0x10')](function(_0x53fde3){if(_0x53fde3&&_0x53fde3[_0x3a0f('0xf')]){_0x34fdac[_0x3a0f('0x11')]=_[_0x3a0f('0x12')](_0x53fde3['plainBody']);}return _0x34fdac;})[_0x3a0f('0x13')](function(_0x25725b){throw _0x25725b;});}exports['updateInteraction']=function(_0x4959ea,_0x1f25c7,_0x46f796,_0x776325){return new Promise(function(_0x370011,_0x494030){return getInteractionUsers(_0x4959ea['id'],_0x46f796)[_0x3a0f('0x10')](function(_0x32dc04){_0x4959ea[_0x3a0f('0x14')]=_0x32dc04;return getInteractionTags(_0x4959ea[_0x3a0f('0x15')],_0x1f25c7);})[_0x3a0f('0x10')](function(_0xaa8f69){_0x4959ea['Tags']=_0xaa8f69;delete _0x4959ea[_0x3a0f('0x15')];return updateInteractionCounters(_0x4959ea);})[_0x3a0f('0x10')](function(_0x187873){if(_0x776325){return getLastMessageText(_0x187873);}else{return _0x187873;}})[_0x3a0f('0x10')](function(_0x614283){_0x370011(_0x614283);})[_0x3a0f('0x13')](function(_0x50a60b){_0x494030(_0x50a60b);});});}; \ No newline at end of file +var _0x9f37=['Tags','lodash','map','fullname','forEach','waiting','answered','unmanaged','total','closed','disposition','abandoned','talking','UserId','MailMessage','plainBody','-id','then','lastMsgText','Users','TagIds'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x9f37,0x166));var _0x79f3=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9f37[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x79f3('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x423429,_0x34eded){return new Promise(function(_0x164cc4,_0x467936){try{var _0x5c300f=[];if(_0x34eded[_0x423429]){_0x5c300f=_0x34eded[_0x423429][_0x79f3('0x1')](function(_0x565068){return{'id':_0x565068['id'],'fullname':_0x565068[_0x79f3('0x2')]};});}return _0x164cc4(_0x5c300f);}catch(_0x2af4be){_0x467936(_0x2af4be);}});}function getInteractionTags(_0x16d0e2,_0x50bef7){var _0x1c81ff=[];if(_0x16d0e2){_0x16d0e2['split'](',')[_0x79f3('0x3')](function(_0x406bfb){_0x1c81ff['push'](_0x50bef7[_0x406bfb]);});}return _0x1c81ff;}function updateWaitingCounter(_0x5b96f1){if(_0x5b96f1[_0x79f3('0x4')]){_0x5b96f1[_0x79f3('0x4')]-=0x1;}}function updateInteractionCounters(_0x51605e){_0x51605e[_0x79f3('0x4')]=0x0;_0x51605e['talking']=0x0;_0x51605e[_0x79f3('0x5')]=0x0;_0x51605e[_0x79f3('0x6')]=0x0;_0x51605e['abandoned']=0x0;_0x51605e[_0x79f3('0x7')]=0x0;if(_0x51605e[_0x79f3('0x8')]){if(_0x51605e[_0x79f3('0x9')]==='abandoned'){_0x51605e[_0x79f3('0xa')]+=0x1;updateWaitingCounter(_0x51605e);}if(_0x51605e['UserId']){_0x51605e[_0x79f3('0x5')]+=0x1;if(_0x51605e[_0x79f3('0xb')]){_0x51605e[_0x79f3('0xb')]-=0x1;}}else{if(_0x51605e['disposition']){_0x51605e[_0x79f3('0x6')]+=0x1;updateWaitingCounter(_0x51605e);}}}else{if(!_0x51605e[_0x79f3('0xc')]){_0x51605e[_0x79f3('0x4')]+=0x1;}if(_0x51605e[_0x79f3('0xc')]){_0x51605e['talking']+=0x1;updateWaitingCounter(_0x51605e);}}_0x51605e[_0x79f3('0x7')]+=0x1;return _0x51605e;}function getLastMessageText(_0x12f73c){return db[_0x79f3('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x12f73c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x79f3('0xe')],'order':_0x79f3('0xf'),'raw':!![]})[_0x79f3('0x10')](function(_0x516095){if(_0x516095&&_0x516095[_0x79f3('0xe')]){_0x12f73c[_0x79f3('0x11')]=_['trimStart'](_0x516095['plainBody']);}return _0x12f73c;})['catch'](function(_0x48e93f){throw _0x48e93f;});}exports['updateInteraction']=function(_0x4e9b8b,_0x4c1f85,_0x98b8cc,_0x1e9768){return new Promise(function(_0x2a64f6,_0x2074f5){return getInteractionUsers(_0x4e9b8b['id'],_0x98b8cc)[_0x79f3('0x10')](function(_0x11191e){_0x4e9b8b[_0x79f3('0x12')]=_0x11191e;return getInteractionTags(_0x4e9b8b[_0x79f3('0x13')],_0x4c1f85);})['then'](function(_0x3de11a){_0x4e9b8b[_0x79f3('0x14')]=_0x3de11a;delete _0x4e9b8b[_0x79f3('0x13')];return updateInteractionCounters(_0x4e9b8b);})[_0x79f3('0x10')](function(_0x51fef8){if(_0x1e9768){return getLastMessageText(_0x51fef8);}else{return _0x51fef8;}})[_0x79f3('0x10')](function(_0x594dc2){_0x2a64f6(_0x594dc2);})['catch'](function(_0x5db024){_0x2074f5(_0x5db024);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 39140b5..33cbfa3 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 _0xbf2c=['catch','error','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','chat','Account','capitalize','InteractionId','upperFirst','unknown','websites','accounts','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','Interaction','findOne','update','info'];(function(_0x327c0e,_0xcd6344){var _0x3a38b6=function(_0x510db9){while(--_0x510db9){_0x327c0e['push'](_0x327c0e['shift']());}};_0x3a38b6(++_0xcd6344);}(_0xbf2c,0x1d4));var _0xcbf2=function(_0x31a522,_0x5b086f){_0x31a522=_0x31a522-0x0;var _0x3218e5=_0xbf2c[_0x31a522];return _0x3218e5;};'use strict';var _=require(_0xcbf2('0x0'));var db=require(_0xcbf2('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xcbf2('0x2')),'mail':require(_0xcbf2('0x3'))(_0xcbf2('0x4')),'fax':require(_0xcbf2('0x3'))('fax-interactions'),'sms':require(_0xcbf2('0x3'))(_0xcbf2('0x5')),'chat':require(_0xcbf2('0x3'))(_0xcbf2('0x6')),'whatsapp':require(_0xcbf2('0x3'))(_0xcbf2('0x7'))};function getAccountFK(_0x4a6e1f){return _['capitalize'](_0x4a6e1f)+(_0x4a6e1f===_0xcbf2('0x8')?'Website':_0xcbf2('0x9'))+'Id';}function getInteractionFK(_0x233693){return _[_0xcbf2('0xa')](_0x233693)+_0xcbf2('0xb');}function getInteractionId(_0x4bab04,_0x3fdb0d,_0x240ccd){if(_0x4bab04&&_0x4bab04[_['upperFirst'](_0x240ccd)+_0xcbf2('0xb')]){return _0x4bab04[_[_0xcbf2('0xc')](_0x240ccd)+_0xcbf2('0xb')];}else if(_0x4bab04&&_0x4bab04['id']){return _0x4bab04['id'];}else if(_0x3fdb0d&&_0x3fdb0d['id']){return _0x3fdb0d['id'];}else{return _0xcbf2('0xd');}}function getInteractionsTables(_0x520ec0){return{'accounts':_0x520ec0+'_'+(_0x520ec0===_0xcbf2('0x8')?_0xcbf2('0xe'):_0xcbf2('0xf')),'interactions':_0x520ec0+'_interactions','interactionsTags':_0x520ec0+'_interaction_has_tags','messages':_0x520ec0+'_messages','userInteractions':_0xcbf2('0x10')+_0x520ec0+_0xcbf2('0x11')};}function getSelectedTags(_0x45bed7){var _0x142d52=[];if(_0x45bed7){_0x142d52=Array[_0xcbf2('0x12')](_0x45bed7)?_0x45bed7:[_0x45bed7];}return _0x142d52;}function log(_0x40bab2,_0x51e03c,_0x1c1181,_0x4cf21e,_0x1ce2d8,_0x37eedf){loggers[_0x1ce2d8[_0xcbf2('0x13')]()][_0x40bab2](_0xcbf2('0x14'),_0x37eedf[_0xcbf2('0x15')](),_0x51e03c?_0x51e03c['id']:null,_0x51e03c?_0x51e03c[_0xcbf2('0x16')]:null,_0x51e03c?_0x51e03c['role']:null,getInteractionId(_0x1c1181,_0x4cf21e,_0x1ce2d8),_0x1c1181?JSON[_0xcbf2('0x17')](_0x1c1181):'null');}function updateUser(_0x8a18d2,_0x16e377,_0x5a13e5,_0xd7bf1d,_0x43f688){db[_['upperFirst'](_0xd7bf1d)+_0xcbf2('0x18')][_0xcbf2('0x19')]({'where':{'id':getInteractionId(_0x16e377,_0x5a13e5,_0xd7bf1d)}})['then'](function(_0x3da8eb){if(_0x3da8eb){return _0x3da8eb[_0xcbf2('0x1a')]({'UserId':_0x8a18d2?_0x8a18d2['id']:null});}})['then'](function(_0x42b435){if(_0x42b435){log(_0xcbf2('0x1b'),_0x8a18d2,_0x16e377,_0x5a13e5,_0xd7bf1d,_0x43f688);}})[_0xcbf2('0x1c')](function(){log(_0xcbf2('0x1d'),_0x8a18d2,_0x16e377,_0x5a13e5,_0xd7bf1d,_0x43f688);});}module[_0xcbf2('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x10d2=['fax-interactions','sms-interactions','whatsapp-interactions','chat','Account','InteractionId','upperFirst','unknown','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','exports','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x10d2,0x77));var _0x210d=function(_0x502ee2,_0x20d426){_0x502ee2=_0x502ee2-0x0;var _0x1bac51=_0x10d2[_0x502ee2];return _0x1bac51;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x210d('0x0'))('openchannel-interactions'),'mail':require(_0x210d('0x0'))('mail-interactions'),'fax':require(_0x210d('0x0'))(_0x210d('0x1')),'sms':require(_0x210d('0x0'))(_0x210d('0x2')),'chat':require(_0x210d('0x0'))('chat-interactions'),'whatsapp':require(_0x210d('0x0'))(_0x210d('0x3'))};function getAccountFK(_0x533bb5){return _['capitalize'](_0x533bb5)+(_0x533bb5===_0x210d('0x4')?'Website':_0x210d('0x5'))+'Id';}function getInteractionFK(_0xd284cc){return _['capitalize'](_0xd284cc)+_0x210d('0x6');}function getInteractionId(_0x250aef,_0x2ef719,_0x1db66b){if(_0x250aef&&_0x250aef[_[_0x210d('0x7')](_0x1db66b)+'InteractionId']){return _0x250aef[_[_0x210d('0x7')](_0x1db66b)+_0x210d('0x6')];}else if(_0x250aef&&_0x250aef['id']){return _0x250aef['id'];}else if(_0x2ef719&&_0x2ef719['id']){return _0x2ef719['id'];}else{return _0x210d('0x8');}}function getInteractionsTables(_0x4625c7){return{'accounts':_0x4625c7+'_'+(_0x4625c7===_0x210d('0x4')?'websites':_0x210d('0x9')),'interactions':_0x4625c7+'_interactions','interactionsTags':_0x4625c7+_0x210d('0xa'),'messages':_0x4625c7+_0x210d('0xb'),'userInteractions':_0x210d('0xc')+_0x4625c7+_0x210d('0xd')};}function getSelectedTags(_0x495165){var _0x4a341f=[];if(_0x495165){_0x4a341f=Array[_0x210d('0xe')](_0x495165)?_0x495165:[_0x495165];}return _0x4a341f;}function log(_0x4e22b9,_0x3bf882,_0x1b3cf,_0x212ffa,_0x5d0585,_0x3d9bb0){loggers[_0x5d0585[_0x210d('0xf')]()][_0x4e22b9](_0x210d('0x10'),_0x3d9bb0[_0x210d('0x11')](),_0x3bf882?_0x3bf882['id']:null,_0x3bf882?_0x3bf882[_0x210d('0x12')]:null,_0x3bf882?_0x3bf882[_0x210d('0x13')]:null,getInteractionId(_0x1b3cf,_0x212ffa,_0x5d0585),_0x1b3cf?JSON[_0x210d('0x14')](_0x1b3cf):_0x210d('0x15'));}function updateUser(_0x43ffe6,_0x12a005,_0xfef854,_0x3108c6,_0x45b075){db[_[_0x210d('0x7')](_0x3108c6)+_0x210d('0x16')][_0x210d('0x17')]({'where':{'id':getInteractionId(_0x12a005,_0xfef854,_0x3108c6)}})[_0x210d('0x18')](function(_0x320526){if(_0x320526){return _0x320526[_0x210d('0x19')]({'UserId':_0x43ffe6?_0x43ffe6['id']:null});}})[_0x210d('0x18')](function(_0x567fa8){if(_0x567fa8){log(_0x210d('0x1a'),_0x43ffe6,_0x12a005,_0xfef854,_0x3108c6,_0x45b075);}})[_0x210d('0x1b')](function(){log(_0x210d('0x1c'),_0x43ffe6,_0x12a005,_0xfef854,_0x3108c6,_0x45b075);});}module[_0x210d('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 1972c3c..f380e1e 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 _0xcdb4=['update','base64','final','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','%s:%s:%s'];(function(_0x421eb4,_0x4bc6c5){var _0xcdf1b4=function(_0x48d4c4){while(--_0x48d4c4){_0x421eb4['push'](_0x421eb4['shift']());}};_0xcdf1b4(++_0x4bc6c5);}(_0xcdb4,0x122));var _0x4cdb=function(_0x408582,_0x405122){_0x408582=_0x408582-0x0;var _0x366c3d=_0xcdb4[_0x408582];return _0x366c3d;};'use strict';var crypto=require(_0x4cdb('0x0'));var util=require(_0x4cdb('0x1'));var compose=require(_0x4cdb('0x2'));var db=require(_0x4cdb('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1b3c11,_0x25a659){if(_0x1b3c11&&_0x25a659){if(_0x25a659[_0x4cdb('0x4')]&&_0x25a659['license']){var _0x5357a4=_0x25a659[_0x4cdb('0x4')];var _0x2c208d=_0x25a659[_0x4cdb('0x5')];var _0x359568=_0x5357a4[_0x4cdb('0x6')]('-')[0x4];var _0x6ad836=_0x5357a4[_0x4cdb('0x6')]('-')[0x0];var _0x29debe=crypto[_0x4cdb('0x7')]('aes-256-ctr',util['format'](_0x4cdb('0x8'),_0x359568,_0x5357a4,_0x6ad836));var _0x20ba53=_0x29debe[_0x4cdb('0x9')](_0x2c208d,_0x4cdb('0xa'),'utf8');_0x20ba53+=_0x29debe[_0x4cdb('0xb')]('utf8');var _0x150ffb=JSON['parse'](_0x20ba53);return _0x150ffb['hasOwnProperty'](_0x1b3c11)?_0x150ffb[_0x1b3c11]:null;}}return null;}function isLimit(_0x35934b,_0x3f16f5,_0x253d78,_0x3d8f5b){var _0x3343ee=_0x3f16f5;return compose()[_0x4cdb('0xc')](function(_0x8bb227,_0x339954,_0x745e19){return db[_0x4cdb('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x4cdb('0xe')](function(_0x40fb4f){var _0x5ec95f=getValueFromLicense(_0x35934b,_0x40fb4f);return _0x5ec95f?_0x5ec95f:_0x3343ee;})['then'](function(_0x71766d){_0x3343ee=_0x71766d;return _0x253d78[_0x4cdb('0xf')](_0x3d8f5b);})[_0x4cdb('0xe')](function(_0x428f81){if(_0x428f81>=_0x3343ee){return _0x339954[_0x4cdb('0x10')](0x193)[_0x4cdb('0x11')]({'message':util['format'](_0x4cdb('0x12'),_0x35934b)});}_0x745e19();})[_0x4cdb('0x13')](function(_0x524ebf){_0x745e19(_0x524ebf);});});}function isUserLimit(){return isLimit(_0x4cdb('0x14'),0x1,db[_0x4cdb('0x15')],{'where':{'$or':[{'role':_0x4cdb('0x16')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x60a8=['../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','crypto','util','composable-middleware'];(function(_0x735297,_0x5cb20b){var _0x32c47d=function(_0x5f18cc){while(--_0x5f18cc){_0x735297['push'](_0x735297['shift']());}};_0x32c47d(++_0x5cb20b);}(_0x60a8,0xfa));var _0x860a=function(_0x52dc72,_0x3401a6){_0x52dc72=_0x52dc72-0x0;var _0x4ad3b4=_0x60a8[_0x52dc72];return _0x4ad3b4;};'use strict';var crypto=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var compose=require(_0x860a('0x2'));var db=require(_0x860a('0x3'))['db'];var config=require(_0x860a('0x4'));function getValueFromLicense(_0x5ed4bd,_0x217636){if(_0x5ed4bd&&_0x217636){if(_0x217636[_0x860a('0x5')]&&_0x217636[_0x860a('0x6')]){var _0x433719=_0x217636['data1'];var _0x2ce445=_0x217636['license'];var _0x109ee4=_0x433719['split']('-')[0x4];var _0x5eaa6a=_0x433719['split']('-')[0x0];var _0x17e69e=crypto['createDecipher'](_0x860a('0x7'),util[_0x860a('0x8')](_0x860a('0x9'),_0x109ee4,_0x433719,_0x5eaa6a));var _0x1d1fb7=_0x17e69e[_0x860a('0xa')](_0x2ce445,'base64',_0x860a('0xb'));_0x1d1fb7+=_0x17e69e[_0x860a('0xc')](_0x860a('0xb'));var _0x1efb90=JSON[_0x860a('0xd')](_0x1d1fb7);return _0x1efb90['hasOwnProperty'](_0x5ed4bd)?_0x1efb90[_0x5ed4bd]:null;}}return null;}function isLimit(_0x165c89,_0x3eb5f2,_0xe56b5,_0x5c3413){var _0x4f0793=_0x3eb5f2;return compose()['use'](function(_0xa457da,_0x1c67ce,_0x54e4c5){return db['License'][_0x860a('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x860a('0xf')](function(_0x163a16){var _0xf16eb6=getValueFromLicense(_0x165c89,_0x163a16);return _0xf16eb6?_0xf16eb6:_0x4f0793;})[_0x860a('0xf')](function(_0x321854){_0x4f0793=_0x321854;return _0xe56b5['count'](_0x5c3413);})[_0x860a('0xf')](function(_0x382318){if(_0x382318>=_0x4f0793){return _0x1c67ce[_0x860a('0x10')](0x193)[_0x860a('0x11')]({'message':util[_0x860a('0x8')](_0x860a('0x12'),_0x165c89)});}_0x54e4c5();})[_0x860a('0x13')](function(_0x42ef0d){_0x54e4c5(_0x42ef0d);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x860a('0x14')],{'where':{'$or':[{'role':_0x860a('0x15')},{'role':_0x860a('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 6f91335..89354ef 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 _0xa657=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$endsWith','$lt','<\x20?','$gt','<=\x20?','start','$startsWith','pop','utcOffset','add','hours','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','replace','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$notIn','\x20IS\x20NULL)'];(function(_0x533169,_0x53f6d5){var _0x27ccdf=function(_0x5a2eee){while(--_0x5a2eee){_0x533169['push'](_0x533169['shift']());}};_0x27ccdf(++_0x53f6d5);}(_0xa657,0x178));var _0x7a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa657[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a65('0x0'));var moment=require('moment');exports[_0x7a65('0x1')]=function(_0xbdc9f8){var _0x1ebe64={'conditions':[]};_0x1ebe64[_0x7a65('0x2')]=_[_0x7a65('0x3')](_0xbdc9f8,_0x7a65('0x4'))?'or':'and';var _0x20ca55=_0xbdc9f8['replace']('[$and]','')[_0x7a65('0x5')]('[$or]','')[_0x7a65('0x6')]('||');for(var _0x4145ef=0x0;_0x4145ef<_0x20ca55[_0x7a65('0x7')];_0x4145ef++){var _0x43216c=_0x20ca55[_0x4145ef]['split'](':=');var _0x4737f9=_0x43216c[0x0];var _0x391118=_0x43216c[_0x7a65('0x8')](0x1);_0x391118[_0x7a65('0x9')](function(_0x3a65e6){var _0xf592b0=_0x3a65e6[_0x7a65('0x6')]('[')[_0x7a65('0xa')]();var _0x46c92d=_0x3a65e6[_0x7a65('0xb')](/\[(.*?)\]/g);_0x46c92d['forEach'](function(_0x2f9cfe){var _0x5a83c5=_0x2f9cfe[_0x7a65('0x6')]('[')['filter'](function(_0x4a4318){return _0x4a4318[_0x7a65('0xc')](']')>-0x1;})[_0x7a65('0xd')](function(_0x1f6342){return _0x1f6342[_0x7a65('0x6')](']')[0x0];})[0x0];_0x1ebe64[_0x7a65('0xe')][_0x7a65('0xf')]({'field':_0x4737f9,'operator':_0xf592b0,'value':_0x5a83c5});});});}return _0x1ebe64;};exports[_0x7a65('0x10')]=function(_0x541f59,_0x4d69aa,_0x417d11){var _0x243008={};if(_0x4d69aa===_0x7a65('0x11')){if(_0x417d11[_0x7a65('0x12')]===_0x7a65('0x13')){_0x417d11[_0x7a65('0x12')]=_0x7a65('0x14');_0x417d11['value']+=','+_0x417d11[_0x7a65('0x15')];}else if(_[_0x7a65('0x16')](['$gt',_0x7a65('0x17')],_0x417d11[_0x7a65('0x12')])){_0x417d11[_0x7a65('0x15')]=moment(_0x417d11[_0x7a65('0x15')])['add'](0x1,'days')[_0x7a65('0x18')](_0x7a65('0x19'));}}if(_0x417d11[_0x7a65('0x1a')]){_0x4d69aa=_0x417d11['castTo'];_0x243008[_0x7a65('0x1b')]='CAST('+_0x541f59+'.'+_0x417d11[_0x7a65('0x1c')]+_0x7a65('0x1d')+_0x417d11[_0x7a65('0x1a')]+')\x20'+parseOperator(_0x417d11[_0x7a65('0x12')]);}else{_0x243008['text']=_0x541f59+'.'+_0x417d11[_0x7a65('0x1c')]+'\x20'+parseOperator(_0x417d11[_0x7a65('0x12')]);}if(_[_0x7a65('0x16')](['$ne',_0x7a65('0x1e')],_0x417d11[_0x7a65('0x12')]))_0x243008[_0x7a65('0x1b')]='('+_0x243008['text']+'\x20OR\x20'+_0x541f59+'.'+_0x417d11[_0x7a65('0x1c')]+_0x7a65('0x1f');_0x243008[_0x7a65('0x15')]=parseValue(_0x4d69aa,_0x417d11[_0x7a65('0x12')],_0x417d11[_0x7a65('0x15')]);return _0x243008;};function parseOperator(_0x168ea9){var _0x349ceb;switch(_0x168ea9){case _0x7a65('0x20'):_0x349ceb=_0x7a65('0x21');break;case _0x7a65('0x1e'):_0x349ceb=_0x7a65('0x22');break;case _0x7a65('0x13'):_0x349ceb=_0x7a65('0x23');break;case _0x7a65('0x24'):_0x349ceb=_0x7a65('0x25');break;case _0x7a65('0x26'):case'$startsWith':case _0x7a65('0x27'):_0x349ceb='LIKE\x20?';break;case _0x7a65('0x28'):_0x349ceb=_0x7a65('0x29');break;case _0x7a65('0x2a'):_0x349ceb='>\x20?';break;case _0x7a65('0x17'):_0x349ceb=_0x7a65('0x2b');break;case'$gte':_0x349ceb='>=\x20?';break;case'$between':_0x349ceb='BETWEEN\x20?\x20AND\x20?';break;}return _0x349ceb;}function parseValue(_0x163067,_0x2cc40d,_0x2b3f1d){var _0x5885dd={'start':undefined,'end':undefined};switch(_0x2cc40d){case _0x7a65('0x20'):case _0x7a65('0x1e'):_0x5885dd[_0x7a65('0x2c')]=_0x2b3f1d['split'](',');break;case _0x7a65('0x26'):_0x5885dd['start']='%'+_0x2b3f1d+'%';break;case _0x7a65('0x2d'):_0x5885dd[_0x7a65('0x2c')]=_0x2b3f1d+'%';break;case _0x7a65('0x27'):_0x5885dd[_0x7a65('0x2c')]='%'+_0x2b3f1d;break;case'$between':var _0x25ed77=_0x2b3f1d[_0x7a65('0x6')](',');var _0x2b3f1d=_0x25ed77[_0x7a65('0xa')]();var _0xc53ac8=_0x25ed77[_0x7a65('0x2e')]();if(_0x163067===_0x7a65('0x11')){_0x2b3f1d=moment(_0x2b3f1d)['utcOffset'](0x0,!![])[_0x7a65('0x18')]();_0xc53ac8=moment(_0xc53ac8)[_0x7a65('0x2f')](0x0,!![])[_0x7a65('0x30')](0x17,_0x7a65('0x31'))[_0x7a65('0x30')](0x3b,'minutes')[_0x7a65('0x30')](0x3b,_0x7a65('0x32'))[_0x7a65('0x18')]();}_0x5885dd={'start':_0x2b3f1d,'end':_0xc53ac8};break;default:_0x5885dd[_0x7a65('0x2c')]=_0x2b3f1d;break;}return _0x5885dd;} \ No newline at end of file +var _0x9433=['operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','DATE','utcOffset','add','hours','lodash','startsWith','[$or]','replace','[$and]','split','length','forEach','shift','match','filter','indexOf','map','conditions','push','$eq'];(function(_0x864a12,_0x25ba1e){var _0x2af0b1=function(_0xb64868){while(--_0xb64868){_0x864a12['push'](_0x864a12['shift']());}};_0x2af0b1(++_0x25ba1e);}(_0x9433,0xc0));var _0x3943=function(_0x1fbc1c,_0x3e353f){_0x1fbc1c=_0x1fbc1c-0x0;var _0x43f984=_0x9433[_0x1fbc1c];return _0x43f984;};'use strict';var _=require(_0x3943('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x394d6a){var _0x18e6eb={'conditions':[]};_0x18e6eb['sqlOperator']=_[_0x3943('0x1')](_0x394d6a,_0x3943('0x2'))?'or':'and';var _0x2ba547=_0x394d6a[_0x3943('0x3')](_0x3943('0x4'),'')[_0x3943('0x3')](_0x3943('0x2'),'')[_0x3943('0x5')]('||');for(var _0x3c08bf=0x0;_0x3c08bf<_0x2ba547[_0x3943('0x6')];_0x3c08bf++){var _0x28b19e=_0x2ba547[_0x3c08bf][_0x3943('0x5')](':=');var _0x26af98=_0x28b19e[0x0];var _0x40ea77=_0x28b19e['slice'](0x1);_0x40ea77[_0x3943('0x7')](function(_0x301bd2){var _0x425635=_0x301bd2[_0x3943('0x5')]('[')[_0x3943('0x8')]();var _0x8cdf98=_0x301bd2[_0x3943('0x9')](/\[(.*?)\]/g);_0x8cdf98[_0x3943('0x7')](function(_0x5ea439){var _0x2888c7=_0x5ea439[_0x3943('0x5')]('[')[_0x3943('0xa')](function(_0x223fb4){return _0x223fb4[_0x3943('0xb')](']')>-0x1;})[_0x3943('0xc')](function(_0x5cd9b5){return _0x5cd9b5[_0x3943('0x5')](']')[0x0];})[0x0];_0x18e6eb[_0x3943('0xd')][_0x3943('0xe')]({'field':_0x26af98,'operator':_0x425635,'value':_0x2888c7});});});}return _0x18e6eb;};exports['buildExpression']=function(_0x4cf390,_0x557934,_0x5011c7){var _0x581e8c={};if(_0x557934==='DATE'){if(_0x5011c7['operator']===_0x3943('0xf')){_0x5011c7[_0x3943('0x10')]=_0x3943('0x11');_0x5011c7['value']+=','+_0x5011c7[_0x3943('0x12')];}else if(_[_0x3943('0x13')]([_0x3943('0x14'),_0x3943('0x15')],_0x5011c7[_0x3943('0x10')])){_0x5011c7[_0x3943('0x12')]=moment(_0x5011c7['value'])['add'](0x1,_0x3943('0x16'))[_0x3943('0x17')](_0x3943('0x18'));}}if(_0x5011c7[_0x3943('0x19')]){_0x557934=_0x5011c7[_0x3943('0x19')];_0x581e8c['text']=_0x3943('0x1a')+_0x4cf390+'.'+_0x5011c7[_0x3943('0x1b')]+_0x3943('0x1c')+_0x5011c7['castTo']+')\x20'+parseOperator(_0x5011c7['operator']);}else{_0x581e8c[_0x3943('0x1d')]=_0x4cf390+'.'+_0x5011c7['field']+'\x20'+parseOperator(_0x5011c7['operator']);}if(_[_0x3943('0x13')]([_0x3943('0x1e'),_0x3943('0x1f')],_0x5011c7[_0x3943('0x10')]))_0x581e8c[_0x3943('0x1d')]='('+_0x581e8c[_0x3943('0x1d')]+_0x3943('0x20')+_0x4cf390+'.'+_0x5011c7[_0x3943('0x1b')]+_0x3943('0x21');_0x581e8c[_0x3943('0x12')]=parseValue(_0x557934,_0x5011c7['operator'],_0x5011c7[_0x3943('0x12')]);return _0x581e8c;};function parseOperator(_0x16a31d){var _0x47e82d;switch(_0x16a31d){case _0x3943('0x22'):_0x47e82d='IN\x20?';break;case _0x3943('0x1f'):_0x47e82d=_0x3943('0x23');break;case'$eq':_0x47e82d='=\x20?';break;case'$ne':_0x47e82d=_0x3943('0x24');break;case'$substring':case _0x3943('0x25'):case _0x3943('0x26'):_0x47e82d=_0x3943('0x27');break;case _0x3943('0x28'):_0x47e82d=_0x3943('0x29');break;case _0x3943('0x14'):_0x47e82d='>\x20?';break;case _0x3943('0x15'):_0x47e82d=_0x3943('0x2a');break;case _0x3943('0x2b'):_0x47e82d='>=\x20?';break;case _0x3943('0x11'):_0x47e82d=_0x3943('0x2c');break;}return _0x47e82d;}function parseValue(_0x508ef9,_0x4ba363,_0x19d1dc){var _0x158760={'start':undefined,'end':undefined};switch(_0x4ba363){case'$in':case _0x3943('0x1f'):_0x158760[_0x3943('0x2d')]=_0x19d1dc['split'](',');break;case _0x3943('0x2e'):_0x158760[_0x3943('0x2d')]='%'+_0x19d1dc+'%';break;case'$startsWith':_0x158760[_0x3943('0x2d')]=_0x19d1dc+'%';break;case _0x3943('0x26'):_0x158760[_0x3943('0x2d')]='%'+_0x19d1dc;break;case _0x3943('0x11'):var _0x1cf1dd=_0x19d1dc['split'](',');var _0x19d1dc=_0x1cf1dd[_0x3943('0x8')]();var _0x579ddb=_0x1cf1dd[_0x3943('0x2f')]();if(_0x508ef9===_0x3943('0x30')){_0x19d1dc=moment(_0x19d1dc)[_0x3943('0x31')](0x0,!![])['format']();_0x579ddb=moment(_0x579ddb)['utcOffset'](0x0,!![])[_0x3943('0x32')](0x17,_0x3943('0x33'))[_0x3943('0x32')](0x3b,'minutes')[_0x3943('0x32')](0x3b,'seconds')['format']();}_0x158760={'start':_0x19d1dc,'end':_0x579ddb};break;default:_0x158760[_0x3943('0x2d')]=_0x19d1dc;break;}return _0x158760;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d4fdc00..60d2626 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 _0x5fc3=['YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','keys','intersection','attributes','nolimit','offset','order','where','pick','filter','object','value','merge','lower','options','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','find','type','$gte','format'];(function(_0x1166d0,_0x3efab0){var _0x74e247=function(_0x52d868){while(--_0x52d868){_0x1166d0['push'](_0x1166d0['shift']());}};_0x74e247(++_0x3efab0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x5fc3[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x35fc('0x0'));var sequelize=require(_0x35fc('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x253d6e){var _0x2ac6da=['ne'];try{var _0x196bc2=JSON[_0x35fc('0x2')](_0x253d6e);var _0xb4f9ce=Object['keys'](_0x196bc2)[0x0];return _0x2ac6da[_0x35fc('0x3')](_0xb4f9ce);}catch(_0x1d5fec){return![];}}function getOperatorValue(_0x186a06){var _0x5b85ad=JSON['parse'](_0x186a06);var _0x19a0d1=Object['keys'](_0x5b85ad)[0x0];var _0x16e153=_0x5b85ad[_0x19a0d1];return{['$'+_0x19a0d1]:_0x16e153};}exports[_0x35fc('0x4')]=function(_0xc72d93){var _0x1e5f90=null;if(_0xc72d93){_0x1e5f90=_0xc72d93[_0x35fc('0x5')](',');}return _0x1e5f90;};exports[_0x35fc('0x6')]=function(_0x2051ab,_0x565f95){var _0x1083a9={};if(!_[_0x35fc('0x7')](_0x2051ab)){_['forOwn'](_0x2051ab,function(_0x471549,_0x33f491){try{if(_0x565f95){var _0x5021d4=_[_0x35fc('0x8')](_0x565f95,{'name':_0x33f491})||{};if(hasSequelizeOperator(_0x471549)){_0x1083a9[_0x33f491]=getOperatorValue(_0x471549);}else if(_0x5021d4[_0x35fc('0x9')]==='DATE'&&_['isPlainObject'](_0x471549)){var _0x409357=JSON['parse'](_0x471549);var _0x397738={'$gte':moment(moment(_0x409357[_0x35fc('0xa')])[_0x35fc('0xb')](_0x35fc('0xc')))[_0x35fc('0xd')]()['format'](),'$lte':moment(moment(_0x409357['$lte'])['format']('YYYY-MM-DD'))[_0x35fc('0xd')]()[_0x35fc('0xe')](0x1,'s')[_0x35fc('0xb')]()};_0x1083a9[_0x33f491]=_0x397738;}else if(_0x5021d4[_0x35fc('0xf')]===_0x35fc('0x10')){_0x1083a9[_0x33f491]=_0x471549;}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON['parse'](_0x471549);}}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON[_0x35fc('0x2')](_0x471549);}}catch(_0x553677){_0x1083a9[_0x33f491]=_0x471549[_0x35fc('0x5')](',');}});}return _0x1083a9;};exports[_0x35fc('0x12')]=function(_0x2e513b){_0x2e513b=parseInt(_0x2e513b,0xa);if(!_0x2e513b||_0x2e513b<0x0){_0x2e513b=LIMIT_VALUE;}return _0x2e513b;};exports['offset']=function(_0x1a86e9){_0x1a86e9=parseInt(_0x1a86e9,0xa);if(!_0x1a86e9||_0x1a86e9<0x0){_0x1a86e9=0x0;}return _0x1a86e9;};exports[_0x35fc('0x13')]=function(_0x465eb3){var _0x488234,_0x402cff=null;if(_0x465eb3){_0x488234=_0x465eb3[_0x35fc('0x5')](',');_0x402cff=_[_0x35fc('0x14')](_0x488234,function(_0x251a1f){if(_0x251a1f[_0x35fc('0x15')]('-')===0x0){return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),_0x35fc('0x19')):_0x251a1f['substr'](0x1),_0x35fc('0x1a')];}else{return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),'unsigned'):_0x251a1f,_0x35fc('0x1b')];}});}return _0x402cff;};exports[_0x35fc('0x1c')]=function(_0x561bf8,_0x265324){if(_[_0x35fc('0x7')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x11')](_0x561bf8)){for(var _0x51cfec=0x0;_0x51cfec<_0x561bf8[_0x35fc('0x1d')];_0x51cfec+=0x1){_0x561bf8[_0x51cfec]=this['omit'](_0x561bf8[_0x51cfec],_0x265324);}return _0x561bf8;}if(!_[_0x35fc('0x1e')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x1f')](_0x265324)){_0x265324=[_0x265324];}if(!_['isArray'](_0x265324)){return _0x561bf8;}for(var _0x519264=0x0;_0x519264<_0x265324[_0x35fc('0x1d')];_0x519264+=0x1){_['unset'](_0x561bf8,_0x265324[_0x519264]);}for(var _0x274208 in _0x561bf8){if(_0x561bf8[_0x35fc('0x20')](_0x274208)){_0x561bf8[_0x274208]=this['omit'](_0x561bf8[_0x274208],_0x265324);}}return _0x561bf8;};exports[_0x35fc('0x21')]=function(_0x645eac){return _0x645eac[_0x35fc('0x22')](RegExp(_0x35fc('0x23')))?!![]:![];};exports[_0x35fc('0x24')]=function(_0x134dfa){return _0x134dfa[_0x35fc('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x35fc('0x25')]=function(_0x54aedc){var _0x1cd1ae=[];_0x54aedc[_0x35fc('0x5')](/[ ,]+/)[_0x35fc('0x26')](function(_0x52acc5){_0x52acc5=_0x52acc5[_0x35fc('0x27')](/([^:]")"+/g,'$1');_0x52acc5='+'+_0x52acc5+'*';var _0x16f067=/[ `!@#$%^&*()_\-?~]/;if(_0x52acc5[_0x35fc('0x22')](_0x16f067))_0x52acc5='\x22'+_0x52acc5+'\x22';_0x1cd1ae[_0x35fc('0x28')](_0x52acc5);});return _0x1cd1ae[_0x35fc('0x29')]('\x20');};exports[_0x35fc('0x2a')]=function(_0x222ddb,_0x37b435,_0xf4dfab){var _0x127bfc={},_0x57072d={};if(_0x37b435['query'][_0x35fc('0x2b')]){_0x37b435['query']['id']=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];delete _0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];}_0x127bfc[_0x35fc('0x2d')]=_[_0x35fc('0x14')](_0x222ddb,'name');_0x127bfc[_0x35fc('0x2c')]=_[_0x35fc('0x2e')](_0x37b435[_0x35fc('0x2c')]);_0x127bfc[_0x35fc('0x6')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],_0x127bfc['query']);_0x57072d[_0x35fc('0x30')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],this['fields'](_0x37b435[_0x35fc('0x2c')]['fields']));_0x57072d[_0x35fc('0x30')]=_0x57072d[_0x35fc('0x30')][_0x35fc('0x1d')]?_0x57072d[_0x35fc('0x30')]:_0x127bfc['model'];if(!_0x37b435['query']['hasOwnProperty'](_0x35fc('0x31'))){_0x57072d['limit']=this[_0x35fc('0x12')](_0x37b435['query'][_0x35fc('0x12')]);_0x57072d[_0x35fc('0x32')]=this[_0x35fc('0x32')](_0x37b435[_0x35fc('0x2c')][_0x35fc('0x32')]);}_0x57072d[_0x35fc('0x33')]=this[_0x35fc('0x13')](_0x37b435['query'][_0x35fc('0x13')]);_0x57072d[_0x35fc('0x34')]=this['filters'](_[_0x35fc('0x35')](_0x37b435[_0x35fc('0x2c')],_0x127bfc[_0x35fc('0x6')]),_0x222ddb);if(_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]){var _0x31d926=_0x222ddb;var _0x58f25c=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')];if(typeof _0x58f25c===_0x35fc('0x37')){_0x31d926=_['filter'](_0x222ddb,function(_0x17821e){return _[_0x35fc('0x3')](_0x58f25c['columns'],_0x17821e[_0x35fc('0xf')]);});_0x58f25c=_0x58f25c[_0x35fc('0x38')];}_0x57072d[_0x35fc('0x34')]=_[_0x35fc('0x39')](_0x57072d[_0x35fc('0x34')],{'$or':_[_0x35fc('0x14')](_0x31d926,function(_0x211b70){if(_0x211b70[_0x35fc('0x9')]!=='VIRTUAL'){if(_0xf4dfab){return sequelize['where'](sequelize['fn'](_0x35fc('0x3a'),sequelize[_0x35fc('0x18')](_0x211b70['name'])),{'$like':sequelize['fn']('lower','%'+_0x37b435['query'][_0x35fc('0x36')]+'%')});}else{var _0x10f98b={};_0x10f98b[_0x211b70['name']]={'$like':'%'+_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]+'%'};return _0x10f98b;}}})});}_0x57072d=_[_0x35fc('0x39')]({},_0x57072d,_0x37b435[_0x35fc('0x3b')]);return _0x57072d;}; \ No newline at end of file +var _0xcca7=['filter','columns','value','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','name','intersection','model','attributes','hasOwnProperty','offset','order','where'];(function(_0x6a10fa,_0x1712fe){var _0x3b703a=function(_0x47c98d){while(--_0x47c98d){_0x6a10fa['push'](_0x6a10fa['shift']());}};_0x3b703a(++_0x1712fe);}(_0xcca7,0x1aa));var _0x7cca=function(_0x31472c,_0x20f729){_0x31472c=_0x31472c-0x0;var _0x29a615=_0xcca7[_0x31472c];return _0x29a615;};'use strict';var _=require(_0x7cca('0x0'));var sequelize=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33db4f){var _0x5cfce5=['ne'];try{var _0x4c311e=JSON[_0x7cca('0x3')](_0x33db4f);var _0x533b00=Object[_0x7cca('0x4')](_0x4c311e)[0x0];return _0x5cfce5[_0x7cca('0x5')](_0x533b00);}catch(_0x2126f7){return![];}}function getOperatorValue(_0x312e98){var _0x1c6c95=JSON[_0x7cca('0x3')](_0x312e98);var _0x5aec51=Object['keys'](_0x1c6c95)[0x0];var _0x937fad=_0x1c6c95[_0x5aec51];return{['$'+_0x5aec51]:_0x937fad};}exports[_0x7cca('0x6')]=function(_0x1aed1b){var _0x1e8cb9=null;if(_0x1aed1b){_0x1e8cb9=_0x1aed1b[_0x7cca('0x7')](',');}return _0x1e8cb9;};exports[_0x7cca('0x8')]=function(_0x20ffa9,_0x2b8b62){var _0x27323a={};if(!_[_0x7cca('0x9')](_0x20ffa9)){_['forOwn'](_0x20ffa9,function(_0x302367,_0x464911){try{if(_0x2b8b62){var _0x275ab2=_[_0x7cca('0xa')](_0x2b8b62,{'name':_0x464911})||{};if(hasSequelizeOperator(_0x302367)){_0x27323a[_0x464911]=getOperatorValue(_0x302367);}else if(_0x275ab2[_0x7cca('0xb')]==='DATE'&&_[_0x7cca('0xc')](_0x302367)){var _0x41e0a2=JSON[_0x7cca('0x3')](_0x302367);var _0x4d0d6d={'$gte':moment(moment(_0x41e0a2['$gte'])[_0x7cca('0xd')](_0x7cca('0xe')))[_0x7cca('0xf')]()[_0x7cca('0xd')](),'$lte':moment(moment(_0x41e0a2[_0x7cca('0x10')])[_0x7cca('0xd')](_0x7cca('0xe')))['utc']()[_0x7cca('0x11')](0x1,'s')['format']()};_0x27323a[_0x464911]=_0x4d0d6d;}else if(_0x275ab2['name']==='uniqueid'){_0x27323a[_0x464911]=_0x302367;}else{_0x27323a[_0x464911]=_[_0x7cca('0x12')](_0x302367)?_0x302367:JSON[_0x7cca('0x3')](_0x302367);}}else{_0x27323a[_0x464911]=_[_0x7cca('0x12')](_0x302367)?_0x302367:JSON[_0x7cca('0x3')](_0x302367);}}catch(_0x44294b){_0x27323a[_0x464911]=_0x302367['split'](',');}});}return _0x27323a;};exports[_0x7cca('0x13')]=function(_0x4fba9e){_0x4fba9e=parseInt(_0x4fba9e,0xa);if(!_0x4fba9e||_0x4fba9e<0x0){_0x4fba9e=LIMIT_VALUE;}return _0x4fba9e;};exports['offset']=function(_0x5d7ac6){_0x5d7ac6=parseInt(_0x5d7ac6,0xa);if(!_0x5d7ac6||_0x5d7ac6<0x0){_0x5d7ac6=0x0;}return _0x5d7ac6;};exports[_0x7cca('0x14')]=function(_0x25297b){var _0x2beb6c,_0x1a20be=null;if(_0x25297b){_0x2beb6c=_0x25297b[_0x7cca('0x7')](',');_0x1a20be=_[_0x7cca('0x15')](_0x2beb6c,function(_0x2e023c){if(_0x2e023c[_0x7cca('0x16')]('-')===0x0){return[_0x2e023c==='priority'?sequelize[_0x7cca('0x17')](sequelize[_0x7cca('0x18')](_0x7cca('0x19')),_0x7cca('0x1a')):_0x2e023c['substr'](0x1),_0x7cca('0x1b')];}else{return[_0x2e023c===_0x7cca('0x19')?sequelize[_0x7cca('0x17')](sequelize[_0x7cca('0x18')](_0x7cca('0x19')),_0x7cca('0x1a')):_0x2e023c,_0x7cca('0x1c')];}});}return _0x1a20be;};exports[_0x7cca('0x1d')]=function(_0x4b99b6,_0xfe121c){if(_[_0x7cca('0x9')](_0x4b99b6)){return _0x4b99b6;}if(_[_0x7cca('0x12')](_0x4b99b6)){for(var _0xdaf07f=0x0;_0xdaf07f<_0x4b99b6[_0x7cca('0x1e')];_0xdaf07f+=0x1){_0x4b99b6[_0xdaf07f]=this[_0x7cca('0x1d')](_0x4b99b6[_0xdaf07f],_0xfe121c);}return _0x4b99b6;}if(!_[_0x7cca('0x1f')](_0x4b99b6)){return _0x4b99b6;}if(_[_0x7cca('0x20')](_0xfe121c)){_0xfe121c=[_0xfe121c];}if(!_['isArray'](_0xfe121c)){return _0x4b99b6;}for(var _0x2cafe1=0x0;_0x2cafe1<_0xfe121c['length'];_0x2cafe1+=0x1){_[_0x7cca('0x21')](_0x4b99b6,_0xfe121c[_0x2cafe1]);}for(var _0x201fbb in _0x4b99b6){if(_0x4b99b6['hasOwnProperty'](_0x201fbb)){_0x4b99b6[_0x201fbb]=this[_0x7cca('0x1d')](_0x4b99b6[_0x201fbb],_0xfe121c);}}return _0x4b99b6;};exports[_0x7cca('0x22')]=function(_0x5533fb){return _0x5533fb[_0x7cca('0x23')](RegExp(_0x7cca('0x24')))?!![]:![];};exports[_0x7cca('0x25')]=function(_0x52fb40){return _0x52fb40['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7cca('0x26')]=function(_0x13d217){var _0x3797f4=[];_0x13d217[_0x7cca('0x7')](/[ ,]+/)[_0x7cca('0x27')](function(_0xe1ee18){_0xe1ee18=_0xe1ee18[_0x7cca('0x28')](/([^:]")"+/g,'$1');_0xe1ee18='+'+_0xe1ee18+'*';var _0x5a2c7c=/[ `!@#$%^&*()_\-?~]/;if(_0xe1ee18['match'](_0x5a2c7c))_0xe1ee18='\x22'+_0xe1ee18+'\x22';_0x3797f4[_0x7cca('0x29')](_0xe1ee18);});return _0x3797f4[_0x7cca('0x2a')]('\x20');};exports[_0x7cca('0x2b')]=function(_0x4f5fd2,_0x2c4f63,_0x4f8e75){var _0x2061fe={},_0x10558a={};if(_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x2d')]){_0x2c4f63['query']['id']=_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x2d')];delete _0x2c4f63[_0x7cca('0x2c')]['$id'];}_0x2061fe['model']=_['map'](_0x4f5fd2,_0x7cca('0x2e'));_0x2061fe[_0x7cca('0x2c')]=_['keys'](_0x2c4f63[_0x7cca('0x2c')]);_0x2061fe[_0x7cca('0x8')]=_[_0x7cca('0x2f')](_0x2061fe[_0x7cca('0x30')],_0x2061fe[_0x7cca('0x2c')]);_0x10558a[_0x7cca('0x31')]=_[_0x7cca('0x2f')](_0x2061fe['model'],this[_0x7cca('0x6')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x6')]));_0x10558a[_0x7cca('0x31')]=_0x10558a['attributes'][_0x7cca('0x1e')]?_0x10558a[_0x7cca('0x31')]:_0x2061fe[_0x7cca('0x30')];if(!_0x2c4f63['query'][_0x7cca('0x32')]('nolimit')){_0x10558a[_0x7cca('0x13')]=this[_0x7cca('0x13')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x13')]);_0x10558a[_0x7cca('0x33')]=this[_0x7cca('0x33')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x33')]);}_0x10558a[_0x7cca('0x34')]=this['sort'](_0x2c4f63['query'][_0x7cca('0x14')]);_0x10558a[_0x7cca('0x35')]=this['filters'](_['pick'](_0x2c4f63[_0x7cca('0x2c')],_0x2061fe[_0x7cca('0x8')]),_0x4f5fd2);if(_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x36')]){var _0x371c67=_0x4f5fd2;var _0x4cd159=_0x2c4f63[_0x7cca('0x2c')]['filter'];if(typeof _0x4cd159==='object'){_0x371c67=_[_0x7cca('0x36')](_0x4f5fd2,function(_0x33d069){return _['includes'](_0x4cd159[_0x7cca('0x37')],_0x33d069['name']);});_0x4cd159=_0x4cd159[_0x7cca('0x38')];}_0x10558a[_0x7cca('0x35')]=_[_0x7cca('0x39')](_0x10558a['where'],{'$or':_[_0x7cca('0x15')](_0x371c67,function(_0x207250){if(_0x207250[_0x7cca('0xb')]!==_0x7cca('0x3a')){if(_0x4f8e75){return sequelize['where'](sequelize['fn'](_0x7cca('0x3b'),sequelize[_0x7cca('0x18')](_0x207250[_0x7cca('0x2e')])),{'$like':sequelize['fn'](_0x7cca('0x3b'),'%'+_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x36')]+'%')});}else{var _0x57f440={};_0x57f440[_0x207250['name']]={'$like':'%'+_0x2c4f63['query']['filter']+'%'};return _0x57f440;}}})});}_0x10558a=_[_0x7cca('0x39')]({},_0x10558a,_0x2c4f63['options']);return _0x10558a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 5c9990d..d51d852 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 _0xac1e=['faxCurrentCapacity','openchannelStatus','faxStatus','chatStatusTime','openchannelStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','value','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unavailable','voiceStatus','idle','chatStatus','mailStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','result','merge','catch','*pause','busy','isArray','startCase','Queue','map','findOne','getAgents','flatten','includes','getAgentIdsByStatus','resolve','User','name','fullname','mailPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','pause','toLowerCase','sortAgentsByStatus','online','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity'];(function(_0x2f0fa0,_0x574acd){var _0x33bc0d=function(_0x3b51a6){while(--_0x3b51a6){_0x2f0fa0['push'](_0x2f0fa0['shift']());}};_0x33bc0d(++_0x574acd);}(_0xac1e,0x109));var _0xeac1=function(_0x3eb634,_0x322ffe){_0x3eb634=_0x3eb634-0x0;var _0x170d17=_0xac1e[_0x3eb634];return _0x170d17;};'use strict';var _=require(_0xeac1('0x0'));var jayson=require(_0xeac1('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xeac1('0x2')][_0xeac1('0x3')]({'port':0x232c});function isAgentPaused(_0xb0e14,_0x9fe46b){var _0x1c9427=[_0xb0e14[_0xeac1('0x4')],_0xb0e14[_0xeac1('0x5')],_0xb0e14['mailPause'],_0xb0e14[_0xeac1('0x6')],_0xb0e14[_0xeac1('0x7')],_0xb0e14[_0xeac1('0x8')],_0xb0e14[_0xeac1('0x9')]];if(!_0x9fe46b)return _[_0xeac1('0xa')](_0x1c9427);var _0x285d54=_[_0xeac1('0xb')](_0x1c9427);return _0x285d54['length']>0x0&&_0x285d54[_0xeac1('0xc')]<_0x1c9427[_0xeac1('0xc')]?!![]:![];}function isIdle(_0x523066){return _0x523066==='idle'||_0x523066==='unknown'||_0x523066===_0xeac1('0xd')||_0x523066==='ringing'||_['isNil'](_0x523066);}function isAgentIdle(_0x36ca33){if(_0x36ca33[_0xeac1('0xe')]!==_0xeac1('0xf')&&_0x36ca33[_0xeac1('0x8')]){_0x36ca33[_0xeac1('0xe')]='pause';return![];}return _[_0xeac1('0xa')]([_0x36ca33[_0xeac1('0x10')],_0x36ca33['faxStatus'],_0x36ca33[_0xeac1('0x11')],_0x36ca33['openchannelStatus'],_0x36ca33[_0xeac1('0x12')],_0x36ca33['voiceStatus'],_0x36ca33[_0xeac1('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xeac1('0x14')]('Agents',{})[_0xeac1('0x15')](function(_0xd8ae6b){if(_0xd8ae6b[_0xeac1('0x16')]){throw new Error(_0xeac1('0x17'));}var _0x249185=_0xd8ae6b['result'];return routingClient[_0xeac1('0x14')](_0xeac1('0x18'),{})[_0xeac1('0x15')](function(_0x9202d1){if(_0x9202d1[_0xeac1('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x5ba25a=_0x9202d1[_0xeac1('0x19')];return _[_0xeac1('0x1a')]({},_0x249185,_0x5ba25a);});})[_0xeac1('0x1b')](function(_0x1489da){throw _0x1489da;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x3c7a6){var _0x952fc9='unknown';if(isAgentPaused(_0x3c7a6))_0x952fc9='pause';else if(isAgentPaused(_0x3c7a6,!![]))_0x952fc9=_0xeac1('0x1c');else if(isAgentIdle(_0x3c7a6))_0x952fc9=_0xeac1('0xf');else _0x952fc9=_0xeac1('0x1d');return _0x952fc9;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x1a04c7,_0x4553b7){var _0x553b99=_[_0xeac1('0x1e')](_0x1a04c7)?_0x1a04c7:[_0x1a04c7];var _0x3132b1=_[_0xeac1('0x1f')](_0x4553b7)+_0xeac1('0x20');var _0x56f36d=_[_0xeac1('0x21')](_0x553b99,function(_0x16be59){return db[_0x3132b1][_0xeac1('0x22')]({'where':{'id':_0x16be59}})[_0xeac1('0x15')](function(_0x584c09){if(!_0x584c09)return[];return _0x584c09[_0xeac1('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x56f36d)[_0xeac1('0x15')](function(_0x3f3dc4){var _0xa860d9=_(_0x3f3dc4)[_0xeac1('0x24')]()[_0xeac1('0x21')]('id')['uniq']()['value']();return _0xa860d9;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xe26cab,_0x4e8969,_0x37224a){try{if(_0x4e8969[_0xeac1('0xc')]>0x0){_0xe26cab=_0xe26cab[_0xeac1('0xb')](function(_0x3c416c){return _0x4e8969[_0xeac1('0x25')](_0x3c416c['id']);});}var _0x2b1e78=_0xe26cab[_0xeac1('0xb')](function(_0x870820){var _0x1c145e=_0xeac1('0x1d');if(isAgentIdle(_0x870820)){_0x1c145e=_0xeac1('0xf');}return _0x1c145e===_0x37224a;});return _['map'](_0x2b1e78,'id');}catch(_0x5aeaa2){throw _0x5aeaa2;}}exports[_0xeac1('0x26')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xcb2dbf,_0x406f67,_0x12dbc4){return Promise[_0xeac1('0x27')]()['then'](function(){if(_0x406f67[_0xeac1('0xc')]>0x0){_0xcb2dbf=_0xcb2dbf[_0xeac1('0xb')](function(_0x4eb741){return _0x406f67[_0xeac1('0x25')](_0x4eb741['id']);});}return _0xcb2dbf;})[_0xeac1('0x15')](function(){return db[_0xeac1('0x28')]['findAll']({'attributes':['id',_0xeac1('0x29'),_0xeac1('0x2a'),_0xeac1('0x4'),_0xeac1('0x5'),_0xeac1('0x2b'),_0xeac1('0x6'),_0xeac1('0x7'),_0xeac1('0x8'),'whatsappPause',_0xeac1('0x2c')],'where':{'id':{'$in':_[_0xeac1('0x21')](_0xcb2dbf,'id')}},'raw':!![]});})[_0xeac1('0x15')](function(_0x22a73b){return _0x22a73b['map'](function(_0x2ee522){var _0x57e077=_[_0xeac1('0x2d')](_0xcb2dbf,['id',_0x2ee522['id']]);var _0x2a1002=filterAgentAttributes(_0x57e077);_['merge'](_0x2ee522,_0x2a1002);_0x2ee522[_0xeac1('0x2e')]=getAgentStatus(_0x2ee522);return _0x2ee522;});})[_0xeac1('0x15')](function(_0x4aa719){var _0x7e905c=sortAgentsByStatus(_0x4aa719,_0x12dbc4);return _[_0xeac1('0x21')](_0x7e905c,'id');})[_0xeac1('0x1b')](function(_0x50ba2b){throw _0x50ba2b;});}exports[_0xeac1('0x2f')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x15dd72){var _0x472ae7={'fields':[],'order':null};var _0x1864ad=_0x15dd72[_0xeac1('0x30')](',');_0x472ae7[_0xeac1('0x31')]=_[_0xeac1('0xb')](_0x1864ad,function(_0x36720b){if(!_0x36720b[_0xeac1('0x25')](_0xeac1('0x2e'))){return!![];}_0x472ae7[_0xeac1('0x32')]=_[_0xeac1('0x33')](_0x36720b,'-')?_0xeac1('0x34'):'ASC';return![];});return _0x472ae7;}exports[_0xeac1('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x27f186){if(_0x27f186[_0xeac1('0x25')](_0xeac1('0x2a'))&&!_0x27f186[_0xeac1('0x25')](_0xeac1('0x36'))){var _0x20eaf1=_0x27f186[_0xeac1('0x37')](0x0,_0x27f186[_0xeac1('0x38')]('fullname'));_0x27f186+=','+_0x20eaf1+_0xeac1('0x36');}return _0x27f186;}exports[_0xeac1('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x5764af,_0x1410eb){var _0x262de9=_0x5764af['sort'](function(_0x4e4f32,_0x4cc136){if(_0x4e4f32[_0xeac1('0x2e')]===_0x4cc136[_0xeac1('0x2e')]){if(_0x4e4f32[_0xeac1('0x2e')]===_0xeac1('0x3a')){if(_0x1410eb===_0xeac1('0x34')){return(_0x4e4f32[_0xeac1('0x2c')]||'')<(_0x4cc136['pauseType']||'')||_0x4e4f32['fullname']['toLowerCase']()>_0x4cc136['fullname'][_0xeac1('0x3b')]()?0x1:-0x1;}else{return(_0x4e4f32[_0xeac1('0x2c')]||'')<(_0x4cc136[_0xeac1('0x2c')]||'')||_0x4e4f32[_0xeac1('0x2a')][_0xeac1('0x3b')]()>_0x4cc136[_0xeac1('0x2a')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x1410eb===_0xeac1('0x34')){return _0x4e4f32['fullname'][_0xeac1('0x3b')]()<_0x4cc136[_0xeac1('0x2a')][_0xeac1('0x3b')]()?0x1:-0x1;}else{return _0x4e4f32[_0xeac1('0x2a')]['toLowerCase']()<_0x4cc136[_0xeac1('0x2a')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x1410eb===_0xeac1('0x34')){return _0x4e4f32[_0xeac1('0x2e')]<_0x4cc136[_0xeac1('0x2e')]?0x1:-0x1;}else{return _0x4e4f32[_0xeac1('0x2e')]<_0x4cc136[_0xeac1('0x2e')]?-0x1:0x1;}}});return _0x262de9;}exports[_0xeac1('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x29ee05){var _0x1671ac=['userpic',_0xeac1('0x3d'),'lastLoginAt',_0xeac1('0x3e'),_0xeac1('0x2c'),_0xeac1('0x3e'),_0xeac1('0x36'),_0xeac1('0x3f'),'chatPause','openchannelPause',_0xeac1('0x2b'),_0xeac1('0x7'),_0xeac1('0x9'),_0xeac1('0x5'),_0xeac1('0x8'),_0xeac1('0x40'),_0xeac1('0x41'),'mailCapacity',_0xeac1('0x42'),'whatsappCapacity','faxCapacity',_0xeac1('0x43'),'openchannelCurrentCapacity',_0xeac1('0x44'),_0xeac1('0x45'),_0xeac1('0x46'),_0xeac1('0x47'),_0xeac1('0x10'),_0xeac1('0x48'),_0xeac1('0x11'),_0xeac1('0x12'),'whatsappStatus',_0xeac1('0x49'),'voiceStatus',_0xeac1('0x4a'),_0xeac1('0x4b'),'mailStatusTime','smsStatusTime','whatsappStatusTime',_0xeac1('0x4c'),'voiceStatusTime','queue',_0xeac1('0x4d'),_0xeac1('0x4e'),_0xeac1('0x4f'),_0xeac1('0x50'),_0xeac1('0x51')];var _0x4be216=['chatPause',_0xeac1('0x6'),'mailPause','smsPause',_0xeac1('0x9'),_0xeac1('0x5'),'voicePause',_0xeac1('0x3d')];var _0x5691db=_(_0x29ee05)['omit'](_0x4be216)['pick'](_0x1671ac)[_0xeac1('0x52')]();return _0x5691db;}exports[_0xeac1('0x53')]=filterAgentAttributes; \ No newline at end of file +var _0x41df=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','map','findOne','all','flatten','uniq','value','filter','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','faxPause','find','globalStatus','catch','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause','smsPause','whatsappPause','every','length','idle','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result'];(function(_0x3dc06d,_0x34ec1b){var _0x560f2b=function(_0x22a3d7){while(--_0x22a3d7){_0x3dc06d['push'](_0x3dc06d['shift']());}};_0x560f2b(++_0x34ec1b);}(_0x41df,0x14a));var _0xf41d=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x41df[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xf41d('0x0'));var jayson=require(_0xf41d('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf41d('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xf41d('0x2')][_0xf41d('0x3')]({'port':0x232c});function isAgentPaused(_0x2dc4a3,_0x3149d6){var _0x33fad3=[_0x2dc4a3[_0xf41d('0x4')],_0x2dc4a3['faxPause'],_0x2dc4a3[_0xf41d('0x5')],_0x2dc4a3[_0xf41d('0x6')],_0x2dc4a3[_0xf41d('0x7')],_0x2dc4a3['voicePause'],_0x2dc4a3[_0xf41d('0x8')]];if(!_0x3149d6)return _[_0xf41d('0x9')](_0x33fad3);var _0x5e9546=_['filter'](_0x33fad3);return _0x5e9546[_0xf41d('0xa')]>0x0&&_0x5e9546[_0xf41d('0xa')]<_0x33fad3[_0xf41d('0xa')]?!![]:![];}function isIdle(_0x50e303){return _0x50e303===_0xf41d('0xb')||_0x50e303==='unknown'||_0x50e303==='unavailable'||_0x50e303==='ringing'||_[_0xf41d('0xc')](_0x50e303);}function isAgentIdle(_0x4b53d9){if(_0x4b53d9[_0xf41d('0xd')]!==_0xf41d('0xb')&&_0x4b53d9[_0xf41d('0xe')]){_0x4b53d9[_0xf41d('0xd')]=_0xf41d('0xf');return![];}return _['every']([_0x4b53d9[_0xf41d('0x10')],_0x4b53d9[_0xf41d('0x11')],_0x4b53d9[_0xf41d('0x12')],_0x4b53d9[_0xf41d('0x13')],_0x4b53d9[_0xf41d('0x14')],_0x4b53d9['voiceStatus'],_0x4b53d9['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xf41d('0x15')]('Agents',{})[_0xf41d('0x16')](function(_0x4b32da){if(_0x4b32da[_0xf41d('0x17')]){throw new Error(_0xf41d('0x18'));}var _0x165c3d=_0x4b32da[_0xf41d('0x19')];return routingClient[_0xf41d('0x15')]('Agents',{})['then'](function(_0xf22aff){if(_0xf22aff[_0xf41d('0x17')]){throw new Error(_0xf41d('0x1a'));}var _0x2b0a91=_0xf22aff[_0xf41d('0x19')];return _[_0xf41d('0x1b')]({},_0x165c3d,_0x2b0a91);});})['catch'](function(_0x58e4f6){throw _0x58e4f6;});}exports[_0xf41d('0x1c')]=getRealtimeAgents;function getAgentStatus(_0xa8f7ee){var _0x49be93='unknown';if(isAgentPaused(_0xa8f7ee))_0x49be93=_0xf41d('0xf');else if(isAgentPaused(_0xa8f7ee,!![]))_0x49be93=_0xf41d('0x1d');else if(isAgentIdle(_0xa8f7ee))_0x49be93='idle';else _0x49be93=_0xf41d('0x1e');return _0x49be93;}exports[_0xf41d('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x19a2bb,_0x558b13){var _0x15647d=_[_0xf41d('0x20')](_0x19a2bb)?_0x19a2bb:[_0x19a2bb];var _0x5818c9=_[_0xf41d('0x21')](_0x558b13)+'Queue';var _0x33601c=_[_0xf41d('0x22')](_0x15647d,function(_0x5ea24f){return db[_0x5818c9][_0xf41d('0x23')]({'where':{'id':_0x5ea24f}})[_0xf41d('0x16')](function(_0x7e0418){if(!_0x7e0418)return[];return _0x7e0418['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf41d('0x24')](_0x33601c)['then'](function(_0x414a38){var _0x399029=_(_0x414a38)[_0xf41d('0x25')]()[_0xf41d('0x22')]('id')[_0xf41d('0x26')]()[_0xf41d('0x27')]();return _0x399029;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x55166c,_0x31637c,_0x3a6a84){try{if(_0x31637c[_0xf41d('0xa')]>0x0){_0x55166c=_0x55166c[_0xf41d('0x28')](function(_0x38146e){return _0x31637c['includes'](_0x38146e['id']);});}var _0x3bedf1=_0x55166c[_0xf41d('0x28')](function(_0x43da87){var _0x38e479=_0xf41d('0x1e');if(isAgentIdle(_0x43da87)){_0x38e479=_0xf41d('0xb');}return _0x38e479===_0x3a6a84;});return _[_0xf41d('0x22')](_0x3bedf1,'id');}catch(_0x47ec05){throw _0x47ec05;}}exports[_0xf41d('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4a5a6e,_0x5bcae4,_0x431942){return Promise[_0xf41d('0x2a')]()[_0xf41d('0x16')](function(){if(_0x5bcae4[_0xf41d('0xa')]>0x0){_0x4a5a6e=_0x4a5a6e['filter'](function(_0x4e96e5){return _0x5bcae4[_0xf41d('0x2b')](_0x4e96e5['id']);});}return _0x4a5a6e;})[_0xf41d('0x16')](function(){return db[_0xf41d('0x2c')][_0xf41d('0x2d')]({'attributes':['id',_0xf41d('0x2e'),_0xf41d('0x2f'),_0xf41d('0x4'),_0xf41d('0x30'),'mailPause','openchannelPause','smsPause',_0xf41d('0xe'),_0xf41d('0x8'),'pauseType'],'where':{'id':{'$in':_['map'](_0x4a5a6e,'id')}},'raw':!![]});})[_0xf41d('0x16')](function(_0x26c733){return _0x26c733[_0xf41d('0x22')](function(_0xc26ba8){var _0x593953=_[_0xf41d('0x31')](_0x4a5a6e,['id',_0xc26ba8['id']]);var _0x9e3be3=filterAgentAttributes(_0x593953);_[_0xf41d('0x1b')](_0xc26ba8,_0x9e3be3);_0xc26ba8[_0xf41d('0x32')]=getAgentStatus(_0xc26ba8);return _0xc26ba8;});})[_0xf41d('0x16')](function(_0x52d8d7){var _0x12ed67=sortAgentsByStatus(_0x52d8d7,_0x431942);return _[_0xf41d('0x22')](_0x12ed67,'id');})[_0xf41d('0x33')](function(_0x499eaf){throw _0x499eaf;});}exports[_0xf41d('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x101511){var _0x3ece78={'fields':[],'order':null};var _0x28a875=_0x101511['split'](',');_0x3ece78[_0xf41d('0x35')]=_[_0xf41d('0x28')](_0x28a875,function(_0x2b60bf){if(!_0x2b60bf[_0xf41d('0x2b')]('globalStatus')){return!![];}_0x3ece78[_0xf41d('0x36')]=_[_0xf41d('0x37')](_0x2b60bf,'-')?_0xf41d('0x38'):'ASC';return![];});return _0x3ece78;}exports[_0xf41d('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x26f9b9){if(_0x26f9b9[_0xf41d('0x2b')]('fullname')&&!_0x26f9b9[_0xf41d('0x2b')](_0xf41d('0x3a'))){var _0x9cadc4=_0x26f9b9['substring'](0x0,_0x26f9b9[_0xf41d('0x3b')](_0xf41d('0x2f')));_0x26f9b9+=','+_0x9cadc4+'internal';}return _0x26f9b9;}exports[_0xf41d('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x17fee3,_0x42d268){var _0x2d6bbc=_0x17fee3[_0xf41d('0x3d')](function(_0x4425b7,_0x45fb64){if(_0x4425b7['globalStatus']===_0x45fb64['globalStatus']){if(_0x4425b7['globalStatus']==='pause'){if(_0x42d268===_0xf41d('0x38')){return(_0x4425b7[_0xf41d('0x3e')]||'')<(_0x45fb64[_0xf41d('0x3e')]||'')||_0x4425b7[_0xf41d('0x2f')][_0xf41d('0x3f')]()>_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?0x1:-0x1;}else{return(_0x4425b7[_0xf41d('0x3e')]||'')<(_0x45fb64['pauseType']||'')||_0x4425b7[_0xf41d('0x2f')]['toLowerCase']()>_0x45fb64[_0xf41d('0x2f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x42d268===_0xf41d('0x38')){return _0x4425b7[_0xf41d('0x2f')]['toLowerCase']()<_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?0x1:-0x1;}else{return _0x4425b7[_0xf41d('0x2f')][_0xf41d('0x3f')]()<_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?-0x1:0x1;}}}else{if(_0x42d268===_0xf41d('0x38')){return _0x4425b7[_0xf41d('0x32')]<_0x45fb64[_0xf41d('0x32')]?0x1:-0x1;}else{return _0x4425b7[_0xf41d('0x32')]<_0x45fb64[_0xf41d('0x32')]?-0x1:0x1;}}});return _0x2d6bbc;}exports[_0xf41d('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x207154){var _0x142cda=['userpic',_0xf41d('0x41'),_0xf41d('0x42'),'lastPauseAt','pauseType',_0xf41d('0x43'),_0xf41d('0x3a'),'address',_0xf41d('0x4'),_0xf41d('0x6'),'mailPause',_0xf41d('0x7'),_0xf41d('0x8'),_0xf41d('0x30'),_0xf41d('0xe'),_0xf41d('0x44'),_0xf41d('0x45'),'mailCapacity',_0xf41d('0x46'),_0xf41d('0x47'),_0xf41d('0x48'),_0xf41d('0x49'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xf41d('0x4a'),_0xf41d('0x4b'),_0xf41d('0x4c'),_0xf41d('0x10'),_0xf41d('0x13'),_0xf41d('0x12'),'smsStatus',_0xf41d('0x4d'),_0xf41d('0x11'),_0xf41d('0xd'),'chatStatusTime',_0xf41d('0x4e'),_0xf41d('0x4f'),_0xf41d('0x50'),_0xf41d('0x51'),_0xf41d('0x52'),_0xf41d('0x53'),_0xf41d('0x54'),'destconnectedlinenum',_0xf41d('0x55'),_0xf41d('0x56'),_0xf41d('0x57'),_0xf41d('0x58')];var _0x25a2d4=[_0xf41d('0x4'),'openchannelPause',_0xf41d('0x5'),_0xf41d('0x7'),_0xf41d('0x8'),_0xf41d('0x30'),_0xf41d('0xe'),_0xf41d('0x41')];var _0x709cbf=_(_0x207154)['omit'](_0x25a2d4)['pick'](_0x142cda)[_0xf41d('0x27')]();return _0x709cbf;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 569c6cd..e35301d 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(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 0ac2b8a..ac7e4d1 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 _0xec13=['crypto','child_process','networkInterfaces','orderBy','keys','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','digest','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash'];(function(_0x27ee8a,_0x4f35a6){var _0xc6d430=function(_0x24027a){while(--_0x24027a){_0x27ee8a['push'](_0x27ee8a['shift']());}};_0xc6d430(++_0x4f35a6);}(_0xec13,0x9f));var _0x3ec1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xec13[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3ec1('0x0'));var os=require('os');var crypto=require(_0x3ec1('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x3ec1('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x3619d9=[];var _0xe39419=os[_0x3ec1('0x3')]();var _0x28dbd4=_[_0x3ec1('0x4')](_[_0x3ec1('0x5')](_0xe39419));for(var _0x5897ab=0x0;_0x5897ab<_0x28dbd4['length'];_0x5897ab++){var _0x35c89d=_0xe39419[_0x28dbd4[_0x5897ab]][_0x3ec1('0x6')](function(_0x12baec){return _0x12baec[_0x3ec1('0x7')]===_0x3ec1('0x8')&&_0x12baec['internal']===![];});_0x3619d9=_0x3619d9[_0x3ec1('0x9')](_0x35c89d);}return _0x3619d9;}function getFirstInterface(){var _0x170076=_[_0x3ec1('0xa')](getInterfaces());return{'macAddress':_0x170076&&_0x170076[_0x3ec1('0xb')]?_0x170076[_0x3ec1('0xb')]:_0x3ec1('0xc'),'ipAddress':_0x170076&&_0x170076['address']?_0x170076['address']:_0x3ec1('0xd')};}exports[_0x3ec1('0xe')]=getFirstInterface;function getCPUhash(){var _0x516996=_[_0x3ec1('0x4')](os['cpus']()['map'](function(_0x2a1e4a){return _0x2a1e4a[_0x3ec1('0xf')];}))[_0x3ec1('0x10')](':');return crypto[_0x3ec1('0x11')](_0x3ec1('0x12'))[_0x3ec1('0x13')](_0x516996)[_0x3ec1('0x14')](_0x3ec1('0x15'));}exports[_0x3ec1('0x16')]=function(){var _0x2af99b=os['platform']();var _0x5de7c7=/[0-9a-f-]{36}/;if(config[_0x3ec1('0x17')]&&_0x5de7c7[_0x3ec1('0x18')](config['licenseToken'])){return config[_0x3ec1('0x17')];}else if(_0x2af99b==='win32'){return exec(_0x3ec1('0x19'),{'encoding':_0x3ec1('0x1a')})[_0x3ec1('0x1b')]('\x0d\x0a','');}else{var _0x43ee8e=getFirstInterface();var _0x2f68fa=getCPUhash();var _0x2f2cd0=_0x2f68fa+'|'+os[_0x3ec1('0x1c')]()+'|'+_0x43ee8e[_0x3ec1('0x1d')]+'|'+_0x43ee8e[_0x3ec1('0x1e')];var _0x1dea5a=crypto[_0x3ec1('0x11')](_0x3ec1('0x12'))[_0x3ec1('0x13')](_0x2f2cd0)['digest'](_0x3ec1('0x15'));return _0x1dea5a['substring'](0x0,0x8)+'-'+_0x1dea5a[_0x3ec1('0x1f')](0x8,0xc)+'-'+_0x1dea5a[_0x3ec1('0x1f')](0xc,0x10)+'-'+_0x1dea5a[_0x3ec1('0x1f')](0x10,0x14)+'-'+_0x1dea5a['substring'](0x14);}}; \ No newline at end of file +var _0x7ce6=['platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','md5','update','digest','hex','getUuid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ce6,0x109));var _0x67ce=function(_0x49a59d,_0x494d0d){_0x49a59d=_0x49a59d-0x0;var _0x255d19=_0x7ce6[_0x49a59d];return _0x255d19;};'use strict';var _=require(_0x67ce('0x0'));var os=require('os');var crypto=require(_0x67ce('0x1'));var machine=require(_0x67ce('0x2'));var exec=require(_0x67ce('0x3'))[_0x67ce('0x4')];var config=require(_0x67ce('0x5'));function getInterfaces(){var _0x68b49c=[];var _0x44bc18=os[_0x67ce('0x6')]();var _0x4d5176=_['orderBy'](_['keys'](_0x44bc18));for(var _0x43ed18=0x0;_0x43ed18<_0x4d5176['length'];_0x43ed18++){var _0x1b94bf=_0x44bc18[_0x4d5176[_0x43ed18]]['filter'](function(_0x1cf318){return _0x1cf318['family']==='IPv4'&&_0x1cf318[_0x67ce('0x7')]===![];});_0x68b49c=_0x68b49c[_0x67ce('0x8')](_0x1b94bf);}return _0x68b49c;}function getFirstInterface(){var _0x3d5206=_['head'](getInterfaces());return{'macAddress':_0x3d5206&&_0x3d5206[_0x67ce('0x9')]?_0x3d5206['mac']:_0x67ce('0xa'),'ipAddress':_0x3d5206&&_0x3d5206[_0x67ce('0xb')]?_0x3d5206[_0x67ce('0xb')]:'127.0.0.1'};}exports[_0x67ce('0xc')]=getFirstInterface;function getCPUhash(){var _0x192986=_[_0x67ce('0xd')](os[_0x67ce('0xe')]()[_0x67ce('0xf')](function(_0x29adee){return _0x29adee[_0x67ce('0x10')];}))[_0x67ce('0x11')](':');return crypto['createHash'](_0x67ce('0x12'))[_0x67ce('0x13')](_0x192986)[_0x67ce('0x14')](_0x67ce('0x15'));}exports[_0x67ce('0x16')]=function(){var _0x5dbf73=os[_0x67ce('0x17')]();var _0x100209=/[0-9a-f-]{36}/;if(config[_0x67ce('0x18')]&&_0x100209[_0x67ce('0x19')](config['licenseToken'])){return config[_0x67ce('0x18')];}else if(_0x5dbf73===_0x67ce('0x1a')){return exec(_0x67ce('0x1b'),{'encoding':_0x67ce('0x1c')})[_0x67ce('0x1d')]('\x0d\x0a','');}else{var _0x526a7d=getFirstInterface();var _0x154453=getCPUhash();var _0xe5cdf=_0x154453+'|'+os['hostname']()+'|'+_0x526a7d['macAddress']+'|'+_0x526a7d['ipAddress'];var _0x238060=crypto[_0x67ce('0x1e')](_0x67ce('0x12'))[_0x67ce('0x13')](_0xe5cdf)[_0x67ce('0x14')](_0x67ce('0x15'));return _0x238060['substring'](0x0,0x8)+'-'+_0x238060[_0x67ce('0x1f')](0x8,0xc)+'-'+_0x238060[_0x67ce('0x1f')](0xc,0x10)+'-'+_0x238060[_0x67ce('0x1f')](0x10,0x14)+'-'+_0x238060['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index f1a6d7a..6b946bc 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 _0x95cc=['update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x29cdd0,_0x5595fc){var _0x1937af=function(_0x7d37cd){while(--_0x7d37cd){_0x29cdd0['push'](_0x29cdd0['shift']());}};_0x1937af(++_0x5595fc);}(_0x95cc,0x1c0));var _0xc95c=function(_0x4b627a,_0x390c28){_0x4b627a=_0x4b627a-0x0;var _0x2fe234=_0x95cc[_0x4b627a];return _0x2fe234;};'use strict';var util=require(_0xc95c('0x0'));var moment=require(_0xc95c('0x1'));var rp=require(_0xc95c('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xc95c('0x3'))(module,_0xc95c('0x4'));var db=require(_0xc95c('0x5'))['db'];var encryptor=require(_0xc95c('0x6'));var hardware=require('./hardware');var logger=require(_0xc95c('0x7'))('license');var HOST=_0xc95c('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1e2479){return new BPromise(function(_0x2ac8a2,_0x41c2e8){var _0x330249=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x1e2479,module['exports'][_0xc95c('0x4')]);if(oldToken){_0x330249=util[_0xc95c('0x9')](_0xc95c('0xa'),HOST,_0x1e2479,module['exports']['version'],oldToken);}var _0x4a3174={'uri':_0x330249,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4a3174)['then'](function(_0xc09c48){_0x2ac8a2(_0xc09c48);})[_0xc95c('0xb')](function(_0x959074){_0x41c2e8(_0x959074);});});}function manageLicense(_0xa2328e,_0x213f40){var _0x23803b=_0x213f40[_0xc95c('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x23803b[_0xc95c('0xd')]!==_0xa2328e&&!_0x23803b[_0xc95c('0xe')]){oldToken=_0x23803b[_0xc95c('0xd')];}httpRequest(_0xa2328e)[_0xc95c('0xf')](function(_0x5003c8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5003c8[_0xc95c('0x10')]){isOldTokenSent=![];if(!_0x23803b[_0xc95c('0x11')]&&_0x23803b[_0xc95c('0x11')]!=_0x5003c8['license']||_0x23803b['license']&&_0x23803b[_0xc95c('0xe')]){logger[_0xc95c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x23803b[_0xc95c('0x11')]&&!_0x23803b[_0xc95c('0xe')]&&_0x23803b[_0xc95c('0x11')]!=_0x5003c8['license']){logger[_0xc95c('0x12')](_0xc95c('0x13'));}if(_0x23803b[_0xc95c('0x11')]&&!_0x23803b[_0xc95c('0xe')]&&_0x23803b[_0xc95c('0x11')]==_0x5003c8[_0xc95c('0x11')]){return _0x213f40;}return _0x213f40[_0xc95c('0x14')]({'data1':_0xa2328e,'data2':null,'license':_0x5003c8[_0xc95c('0x11')]});}else{if(_0x5003c8[_0xc95c('0x11')]||_0x23803b[_0xc95c('0x11')]){if(!_0x23803b[_0xc95c('0xe')]){if(_0x23803b[_0xc95c('0xd')]==_0xa2328e){GRAY_PERIOD_REASON='Disabled';logger[_0xc95c('0x12')](_0xc95c('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xc95c('0x12')](_0xc95c('0x16'),_0x23803b[_0xc95c('0xd')],_0xa2328e);}logger[_0xc95c('0x12')](_0xc95c('0x17'),GRAY_PERIOD_REASON[_0xc95c('0x18')](),moment()[_0xc95c('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x213f40[_0xc95c('0x14')]({'data2':encryptor[_0xc95c('0x19')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xc95c('0x1a')](encryptor['decryptString'](_0x23803b[_0xc95c('0xe')]),_0xc95c('0x1b'))>DAYS){logger[_0xc95c('0x12')](_0xc95c('0x1c'),moment()['format'](_0xc95c('0x1d')));isOldTokenSent=![];return _0x213f40[_0xc95c('0x14')]({'data1':_0xa2328e,'data2':null,'license':null});}}}else{if(_0x23803b[_0xc95c('0xd')]!=_0xa2328e){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x23803b[_0xc95c('0xd')],_0xa2328e);return _0x213f40[_0xc95c('0x14')]({'data1':_0xa2328e,'data2':null,'license':null});}}}return _0x213f40;})[_0xc95c('0xf')](function(_0x518c5c){_0x213f40=_0x518c5c;})[_0xc95c('0xb')](function(_0x167e10){logger[_0xc95c('0x1e')](_0x167e10['message']);})[_0xc95c('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xc95c('0x20')](),_0x213f40);},TIME);});}function defaultLicense(){var _0x2fbfb7=hardware['getUuid']();if(_0x2fbfb7){return db['License'][_0xc95c('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x2fbfb7}})['spread'](function(_0x1cdcb6,_0x17e461){logger[_0xc95c('0x12')](_0xc95c('0x22'),_0x2fbfb7);manageLicense(_0x2fbfb7,_0x1cdcb6);})[_0xc95c('0xb')](function(_0x1d6d89){logger[_0xc95c('0x1e')](_0x1d6d89[_0xc95c('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x65c2=['exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','License','spread','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x65c2,0x108));var _0x265c=function(_0x3f4683,_0x4062f9){_0x3f4683=_0x3f4683-0x0;var _0x1a80aa=_0x65c2[_0x3f4683];return _0x1a80aa;};'use strict';var util=require(_0x265c('0x0'));var moment=require(_0x265c('0x1'));var rp=require(_0x265c('0x2'));var BPromise=require(_0x265c('0x3'));var pkginfo=require(_0x265c('0x4'))(module,_0x265c('0x5'));var db=require(_0x265c('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x265c('0x7'));var logger=require('../logger')(_0x265c('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4eb61d){return new BPromise(function(_0x406468,_0x250ad4){var _0x1ce50a=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x4eb61d,module[_0x265c('0x9')]['version']);if(oldToken){_0x1ce50a=util[_0x265c('0xa')](_0x265c('0xb'),HOST,_0x4eb61d,module['exports'][_0x265c('0x5')],oldToken);}var _0x461f83={'uri':_0x1ce50a,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x461f83)['then'](function(_0x1eeb3b){_0x406468(_0x1eeb3b);})[_0x265c('0xc')](function(_0x1da2ec){_0x250ad4(_0x1da2ec);});});}function manageLicense(_0x213e21,_0x59f7a6){var _0x499af1=_0x59f7a6[_0x265c('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x499af1[_0x265c('0xe')]!==_0x213e21&&!_0x499af1[_0x265c('0xf')]){oldToken=_0x499af1[_0x265c('0xe')];}httpRequest(_0x213e21)[_0x265c('0x10')](function(_0x46c1e9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x46c1e9[_0x265c('0x11')]){isOldTokenSent=![];if(!_0x499af1['license']&&_0x499af1[_0x265c('0x8')]!=_0x46c1e9[_0x265c('0x8')]||_0x499af1[_0x265c('0x8')]&&_0x499af1[_0x265c('0xf')]){logger[_0x265c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x499af1[_0x265c('0x8')]&&!_0x499af1['data2']&&_0x499af1[_0x265c('0x8')]!=_0x46c1e9[_0x265c('0x8')]){logger[_0x265c('0x12')](_0x265c('0x13'));}if(_0x499af1[_0x265c('0x8')]&&!_0x499af1[_0x265c('0xf')]&&_0x499af1[_0x265c('0x8')]==_0x46c1e9[_0x265c('0x8')]){return _0x59f7a6;}return _0x59f7a6[_0x265c('0x14')]({'data1':_0x213e21,'data2':null,'license':_0x46c1e9[_0x265c('0x8')]});}else{if(_0x46c1e9[_0x265c('0x8')]||_0x499af1[_0x265c('0x8')]){if(!_0x499af1[_0x265c('0xf')]){if(_0x499af1['data1']==_0x213e21){GRAY_PERIOD_REASON=_0x265c('0x15');logger[_0x265c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x265c('0x16');logger[_0x265c('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x499af1['data1'],_0x213e21);}logger['info'](_0x265c('0x17'),GRAY_PERIOD_REASON[_0x265c('0x18')](),moment()[_0x265c('0xa')](_0x265c('0x19')));return _0x59f7a6[_0x265c('0x14')]({'data2':encryptor[_0x265c('0x1a')](moment()[_0x265c('0xa')](_0x265c('0x19')))});}else{if(moment()[_0x265c('0x1b')](encryptor[_0x265c('0x1c')](_0x499af1['data2']),_0x265c('0x1d'))>DAYS){logger[_0x265c('0x12')](_0x265c('0x1e'),moment()[_0x265c('0xa')](_0x265c('0x19')));isOldTokenSent=![];return _0x59f7a6[_0x265c('0x14')]({'data1':_0x213e21,'data2':null,'license':null});}}}else{if(_0x499af1[_0x265c('0xe')]!=_0x213e21){logger[_0x265c('0x12')](_0x265c('0x1f'),_0x499af1[_0x265c('0xe')],_0x213e21);return _0x59f7a6[_0x265c('0x14')]({'data1':_0x213e21,'data2':null,'license':null});}}}return _0x59f7a6;})[_0x265c('0x10')](function(_0x102a09){_0x59f7a6=_0x102a09;})[_0x265c('0xc')](function(_0x14f677){logger[_0x265c('0x20')](_0x14f677['message']);})[_0x265c('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x59f7a6);},TIME);});}function defaultLicense(){var _0x2478cf=hardware[_0x265c('0x22')]();if(_0x2478cf){return db[_0x265c('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2478cf}})[_0x265c('0x24')](function(_0x1874fd,_0x346d87){logger[_0x265c('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2478cf);manageLicense(_0x2478cf,_0x1874fd);})[_0x265c('0xc')](function(_0x9bc5cd){logger['error'](_0x9bc5cd[_0x265c('0x25')]);});}}exports[_0x265c('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 4a23f2a..983069f 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 _0x42e2=['telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','parse','demo','machineUuid','gray','add','changed','disabled','message','User','role','COUNT','col','count','admin','user','telephone','users'];(function(_0x30b547,_0x5b89e9){var _0xab9618=function(_0x2259f2){while(--_0x2259f2){_0x30b547['push'](_0x30b547['shift']());}};_0xab9618(++_0x5b89e9);}(_0x42e2,0x189));var _0x242e=function(_0x42bf0b,_0x465c08){_0x42bf0b=_0x42bf0b-0x0;var _0x3e333f=_0x42e2[_0x42bf0b];return _0x3e333f;};'use strict';var util=require(_0x242e('0x0'));var _=require(_0x242e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x242e('0x2'));var encryptor=require(_0x242e('0x3'));var db=require(_0x242e('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x242e('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x242e('0x6'),'machineUuid':hardware[_0x242e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x242e('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x242e('0x8'),'machineUuid':hardware[_0x242e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x410c65){return new BPromise(function(_0xe8a21d,_0x200e62){return db['License']['find'](_[_0x242e('0x9')](_0x410c65,{'raw':!![],'where':{'id':0x1}}))[_0x242e('0xa')](function(_0x1cc98c){return checkLicense(_0x1cc98c,null);})['then'](function(_0x23ce25){_0xe8a21d(_0x23ce25);return;})[_0x242e('0xb')](function(_0x308d33){_0x200e62(_0x308d33);});});}function checkLicense(_0x124295,_0xa4dcc2){if(!_0x124295){demoLicense[_0x242e('0xc')]=_0x124295[_0x242e('0xd')];return demoLicense;}try{var _0x1fb357=_0xa4dcc2||_0x124295[_0x242e('0xe')];if(_[_0x242e('0xf')](_0x1fb357)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3ee2ed=_0x124295[_0x242e('0xd')];var _0x37f4dd=_0x124295[_0x242e('0x10')];var _0x46b8a8=_0x3ee2ed[_0x242e('0x11')]('-')[0x4];var _0x46fb59=_0x3ee2ed[_0x242e('0x11')]('-')[0x0];var _0x334cca=encryptor[_0x242e('0x12')](_0x1fb357,util[_0x242e('0x13')]('%s:%s:%s',_0x46b8a8,_0x3ee2ed,_0x46fb59));var _0x5f4126=JSON[_0x242e('0x14')](_0x334cca);_0x5f4126[_0x242e('0x15')]=![];_0x5f4126[_0x242e('0xc')]=_0x3ee2ed;_0x5f4126[_0x242e('0x16')]=hardware[_0x242e('0x7')]();if(_0x37f4dd){var _0x5e2a02=encryptor[_0x242e('0x12')](_0x37f4dd);_0x5f4126[_0x242e('0x17')]=_0x5e2a02;_0x5f4126['deadline']=moment(_0x5e2a02)[_0x242e('0x18')](0x7,'days')['format']();_0x5f4126['grayReason']=_0x5f4126['uuid']!=_0x5f4126['machineUuid']?_0x242e('0x19'):_0x242e('0x1a');}return _0x5f4126;}catch(_0x403802){breakingLicense['uuid']=_0x124295['data1'];breakingLicense[_0x242e('0x1b')]=_0x403802[_0x242e('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x850a86,_0x3b8636){getLicense()['then'](function(_0x1c2921){return db[_0x242e('0x1c')]['findAll']({'attributes':[_0x242e('0x1d'),[db['sequelize']['fn'](_0x242e('0x1e'),db['sequelize'][_0x242e('0x1f')]('role')),_0x242e('0x20')]],'group':'role','where':{'role':{'$or':[_0x242e('0x21'),_0x242e('0x22'),_0x242e('0x23')]}},'raw':!![]})[_0x242e('0xa')](function(_0x4df64d){var _0x4e5c08={'user':_0x1c2921[_0x242e('0x24')]||0x0,'telephone':_0x1c2921[_0x242e('0x25')]||0x0};_0x4df64d[_0x242e('0x26')](function(_0x101e9c){var _0x1fed2f=_0x101e9c[_0x242e('0x1d')]===_0x242e('0x21')?_0x242e('0x22'):_0x101e9c['role'];_0x4e5c08[_0x1fed2f]-=_0x101e9c[_0x242e('0x20')];if(_0x4e5c08[_0x1fed2f]<0x0)_0x4e5c08[_0x1fed2f]=0x0;});_0x850a86(_0x4e5c08);return;});})[_0x242e('0xb')](function(_0x13707a){_0x3b8636(_0x13707a);});});}function checkUserLimits(_0xca770c){return new BPromise(function(_0x162e79,_0x4acc94){getLimits()[_0x242e('0xa')](function(_0x196adf){var _0x5848e0=_[_0x242e('0x27')](_[_0x242e('0x28')](_0xca770c,_0x242e('0x1d')),['admin',_0x242e('0x22'),_0x242e('0x23')]);var _0x32b8c1=(_0x5848e0[_0x242e('0x21')]||0x0)+(_0x5848e0[_0x242e('0x22')]||0x0);var _0x37a34e=_0x5848e0['telephone']||0x0;if(_0x32b8c1>_0x196adf['user'])return _0x4acc94('License\x20limit\x20reached\x20for\x20users');if(_0x37a34e>_0x196adf[_0x242e('0x23')])return _0x4acc94(_0x242e('0x29'));return _0x162e79();})[_0x242e('0xb')](function(_0xa03f37){_0x4acc94(_0xa03f37);});});}module[_0x242e('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x0293=['format','%s:%s:%s','parse','demo','uuid','machineUuid','decryptString','add','grayReason','changed','disabled','message','User','findAll','COUNT','sequelize','col','role','count','user','telephones','forEach','admin','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','lodash','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','find','then','catch','data1','license','isEmpty','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0293,0x18d));var _0x3029=function(_0x231d36,_0x13e42f){_0x231d36=_0x231d36-0x0;var _0x25ed4f=_0x0293[_0x231d36];return _0x25ed4f;};'use strict';var util=require('util');var _=require(_0x3029('0x0'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x3029('0x1'));var encryptor=require(_0x3029('0x2'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3029('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x3029('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3029('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x3029('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5b7339){return new BPromise(function(_0x6c1643,_0x48f838){return db[_0x3029('0x5')][_0x3029('0x6')](_['defaults'](_0x5b7339,{'raw':!![],'where':{'id':0x1}}))[_0x3029('0x7')](function(_0x5c358e){return checkLicense(_0x5c358e,null);})[_0x3029('0x7')](function(_0x3b6d32){_0x6c1643(_0x3b6d32);return;})[_0x3029('0x8')](function(_0x1701f9){_0x48f838(_0x1701f9);});});}function checkLicense(_0x492b32,_0x5a22ce){if(!_0x492b32){demoLicense['uuid']=_0x492b32[_0x3029('0x9')];return demoLicense;}try{var _0x3cfff8=_0x5a22ce||_0x492b32[_0x3029('0xa')];if(_[_0x3029('0xb')](_0x3cfff8)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x359bbb=_0x492b32[_0x3029('0x9')];var _0x50a0ff=_0x492b32[_0x3029('0xc')];var _0x1e06f9=_0x359bbb['split']('-')[0x4];var _0x10df35=_0x359bbb['split']('-')[0x0];var _0x12918d=encryptor['decryptString'](_0x3cfff8,util[_0x3029('0xd')](_0x3029('0xe'),_0x1e06f9,_0x359bbb,_0x10df35));var _0x4c7410=JSON[_0x3029('0xf')](_0x12918d);_0x4c7410[_0x3029('0x10')]=![];_0x4c7410[_0x3029('0x11')]=_0x359bbb;_0x4c7410[_0x3029('0x12')]=hardware[_0x3029('0x4')]();if(_0x50a0ff){var _0x1163f3=encryptor[_0x3029('0x13')](_0x50a0ff);_0x4c7410['gray']=_0x1163f3;_0x4c7410['deadline']=moment(_0x1163f3)[_0x3029('0x14')](0x7,'days')[_0x3029('0xd')]();_0x4c7410[_0x3029('0x15')]=_0x4c7410[_0x3029('0x11')]!=_0x4c7410['machineUuid']?_0x3029('0x16'):_0x3029('0x17');}return _0x4c7410;}catch(_0x1eaf60){breakingLicense[_0x3029('0x11')]=_0x492b32['data1'];breakingLicense[_0x3029('0x18')]=_0x1eaf60['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xf55622,_0x2223a0){getLicense()[_0x3029('0x7')](function(_0x45ebd2){return db[_0x3029('0x19')][_0x3029('0x1a')]({'attributes':['role',[db['sequelize']['fn'](_0x3029('0x1b'),db[_0x3029('0x1c')][_0x3029('0x1d')](_0x3029('0x1e'))),_0x3029('0x1f')]],'group':_0x3029('0x1e'),'where':{'role':{'$or':['admin',_0x3029('0x20'),'telephone']}},'raw':!![]})['then'](function(_0x3f0491){var _0x167c56={'user':_0x45ebd2['users']||0x0,'telephone':_0x45ebd2[_0x3029('0x21')]||0x0};_0x3f0491[_0x3029('0x22')](function(_0xb240ae){var _0x1105b2=_0xb240ae[_0x3029('0x1e')]===_0x3029('0x23')?_0x3029('0x20'):_0xb240ae[_0x3029('0x1e')];_0x167c56[_0x1105b2]-=_0xb240ae[_0x3029('0x1f')];if(_0x167c56[_0x1105b2]<0x0)_0x167c56[_0x1105b2]=0x0;});_0xf55622(_0x167c56);return;});})[_0x3029('0x8')](function(_0x101a14){_0x2223a0(_0x101a14);});});}function checkUserLimits(_0x556d31){return new BPromise(function(_0x3bfee0,_0x4b4e5f){getLimits()[_0x3029('0x7')](function(_0x5bd840){var _0x2d2435=_[_0x3029('0x24')](_[_0x3029('0x25')](_0x556d31,_0x3029('0x1e')),[_0x3029('0x23'),_0x3029('0x20'),_0x3029('0x26')]);var _0x440a16=(_0x2d2435[_0x3029('0x23')]||0x0)+(_0x2d2435[_0x3029('0x20')]||0x0);var _0x68e6ea=_0x2d2435[_0x3029('0x26')]||0x0;if(_0x440a16>_0x5bd840[_0x3029('0x20')])return _0x4b4e5f(_0x3029('0x27'));if(_0x68e6ea>_0x5bd840[_0x3029('0x26')])return _0x4b4e5f('License\x20limit\x20reached\x20for\x20telephones');return _0x3bfee0();})['catch'](function(_0x6ce0b1){_0x4b4e5f(_0x6ce0b1);});});}module[_0x3029('0x28')]={'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 fba88e9..17b50b8 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 _0xe2cf=['app-id','http://localhost:9000'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0xe2cf[_0x43776a];return _0x18eb8f;};'use strict';module['exports']={'DOMAIN':_0xfe2c('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xfe2c('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xeb3b=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x414b63,_0x2b5bcf){var _0x50748e=function(_0x59b9e0){while(--_0x59b9e0){_0x414b63['push'](_0x414b63['shift']());}};_0x50748e(++_0x2b5bcf);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xeb3b[_0x1f27df];return _0x286ee2;};'use strict';module[_0xbeb3('0x0')]={'DOMAIN':_0xbeb3('0x1'),'SESSION_SECRET':_0xbeb3('0x2'),'GOOGLE_ID':_0xbeb3('0x3'),'GOOGLE_SECRET':_0xbeb3('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 65b5a3b..cbe06ca 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module['exports']=fileLogger; \ No newline at end of file +var _0x05b2=['fileLogger','exports','../utils/loggers'];(function(_0x201a0e,_0x1463c9){var _0x4e3225=function(_0x27247a){while(--_0x27247a){_0x201a0e['push'](_0x201a0e['shift']());}};_0x4e3225(++_0x1463c9);}(_0x05b2,0x13d));var _0x205b=function(_0x432bc9,_0xf2146c){_0x432bc9=_0x432bc9-0x0;var _0x69a3ad=_0x05b2[_0x432bc9];return _0x69a3ad;};'use strict';var fileLogger=require(_0x205b('0x0'))[_0x205b('0x1')];module[_0x205b('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 22c8552..132fd57 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 _0xeb8b=['../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x404c07,_0x25ce8b){var _0x274c74=function(_0x2582e9){while(--_0x2582e9){_0x404c07['push'](_0x404c07['shift']());}};_0x274c74(++_0x25ce8b);}(_0xeb8b,0x17b));var _0xbeb8=function(_0x265930,_0xcd82d4){_0x265930=_0x265930-0x0;var _0xce86bb=_0xeb8b[_0x265930];return _0xce86bb;};'use strict';var path=require(_0xbeb8('0x0'));var os=require('os');var config={'apps':[{'name':_0xbeb8('0x1'),'script':path[_0xbeb8('0x2')](__dirname,_0xbeb8('0x3'))},{'name':_0xbeb8('0x4'),'script':path[_0xbeb8('0x2')](__dirname,_0xbeb8('0x5'))},{'name':_0xbeb8('0x6'),'script':path[_0xbeb8('0x2')](__dirname,_0xbeb8('0x7'))},{'name':'email','script':path[_0xbeb8('0x2')](__dirname,_0xbeb8('0x8'))},{'name':_0xbeb8('0x9'),'script':path[_0xbeb8('0x2')](__dirname,_0xbeb8('0xa'))},{'name':'xdr','script':path[_0xbeb8('0x2')](__dirname,_0xbeb8('0xb'))}]};module[_0xbeb8('0xc')]=config; \ No newline at end of file +var _0x1f2c=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','express','ami','../../services/ami/index.js','agi','../../services/agi/index.js','join'];(function(_0x3a28e0,_0x38c8c3){var _0x585188=function(_0x5a3b2d){while(--_0x5a3b2d){_0x3a28e0['push'](_0x3a28e0['shift']());}};_0x585188(++_0x38c8c3);}(_0x1f2c,0x1e9));var _0xc1f2=function(_0x5ced8e,_0x1fe4ab){_0x5ced8e=_0x5ced8e-0x0;var _0x16c346=_0x1f2c[_0x5ced8e];return _0x16c346;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc1f2('0x0'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xc1f2('0x1'),'script':path['join'](__dirname,_0xc1f2('0x2'))},{'name':_0xc1f2('0x3'),'script':path['join'](__dirname,_0xc1f2('0x4'))},{'name':'email','script':path[_0xc1f2('0x5')](__dirname,_0xc1f2('0x6'))},{'name':_0xc1f2('0x7'),'script':path[_0xc1f2('0x5')](__dirname,_0xc1f2('0x8'))},{'name':_0xc1f2('0x9'),'script':path[_0xc1f2('0x5')](__dirname,'../../services/xdr/index.js')}]};module[_0xc1f2('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 9f7fb59..c606890 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 _0xb7ab=['stop','disconnect','restart','describe','delete','dump','saved','pm2','./config','connect','connected','start','then'];(function(_0x254dc3,_0x59264f){var _0x2b8403=function(_0x2fb435){while(--_0x2fb435){_0x254dc3['push'](_0x254dc3['shift']());}};_0x2b8403(++_0x59264f);}(_0xb7ab,0xca));var _0xbb7a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7ab[_0x2641f9];return _0x585741;};'use strict';var pm2=require(_0xbb7a('0x0'));var BPromise=require('bluebird');var config=require(_0xbb7a('0x1'));function connect(){return new BPromise(function(_0x7844c9,_0x3cf7cc){return pm2[_0xbb7a('0x2')](function(_0x55f193){if(_0x55f193){return _0x3cf7cc(_0x55f193);}return _0x7844c9(_0xbb7a('0x3'));});});};exports[_0xbb7a('0x4')]=function(_0xd9bee2){return connect()[_0xbb7a('0x5')](function(){return new BPromise(function(_0x57e6ce,_0x977613){return pm2[_0xbb7a('0x4')](_0xd9bee2,function(_0x5ab2d9,_0x52af53){if(_0x5ab2d9){return _0x977613(_0x5ab2d9);}pm2['disconnect']();return _0x57e6ce(_0x52af53);});});});};exports[_0xbb7a('0x6')]=function(_0xc49ecb){return connect()[_0xbb7a('0x5')](function(){return new BPromise(function(_0x2d44ce,_0x1c1d89){return pm2[_0xbb7a('0x6')](_0xc49ecb,function(_0x4f0512,_0x55a63a){if(_0x4f0512){return _0x1c1d89(_0x4f0512);}pm2[_0xbb7a('0x7')]();return _0x2d44ce(_0x55a63a);});});});};exports[_0xbb7a('0x8')]=function(_0x3431fe){return connect()['then'](function(){return new BPromise(function(_0x25762c,_0x2780c5){return pm2[_0xbb7a('0x8')](_0x3431fe,function(_0x5706cc,_0x466b13){if(_0x5706cc){return _0x2780c5(_0x5706cc);}pm2['disconnect']();return _0x25762c(_0x466b13);});});});};exports['list']=function(){return connect()[_0xbb7a('0x5')](function(){return new BPromise(function(_0x5197e6,_0x3578ce){return pm2['list'](function(_0x1a06a2,_0xabc3fc){if(_0x1a06a2){return _0x3578ce(_0x1a06a2);}pm2['disconnect']();return _0x5197e6(_0xabc3fc);});});});};exports['describe']=function(_0x3462f0){return connect()[_0xbb7a('0x5')](function(){return new BPromise(function(_0x18805a,_0x34e40b){return pm2[_0xbb7a('0x9')](_0x3462f0,function(_0x29edbc,_0x48a55d){if(_0x29edbc){return _0x34e40b(_0x29edbc);}pm2['disconnect']();return _0x18805a(_0x48a55d);});});});};exports[_0xbb7a('0xa')]=function(_0x566534){return connect()[_0xbb7a('0x5')](function(){return new BPromise(function(_0xb720a8,_0x4d484e){return pm2[_0xbb7a('0xa')](_0x566534,function(_0x948d63,_0x42dfc0){if(_0x948d63){return _0x4d484e(_0x948d63);}pm2['disconnect']();return _0xb720a8(_0x42dfc0);});});});};exports[_0xbb7a('0xb')]=function(){return connect()[_0xbb7a('0x5')](function(){return new BPromise(function(_0xf7fe5d,_0x3c953d){return pm2[_0xbb7a('0xb')](function(_0x14f1db){if(_0x14f1db){return _0x3c953d(_0x14f1db);}return _0xf7fe5d(_0xbb7a('0xc'));});});});}; \ No newline at end of file +var _0xff14=['pm2','bluebird','./config','connect','connected','then','start','stop','disconnect','restart','list','describe','delete','dump'];(function(_0x10670e,_0xd94269){var _0x4e4f40=function(_0x464c72){while(--_0x464c72){_0x10670e['push'](_0x10670e['shift']());}};_0x4e4f40(++_0xd94269);}(_0xff14,0x1a4));var _0x4ff1=function(_0x5f4f17,_0x4a5909){_0x5f4f17=_0x5f4f17-0x0;var _0x1d9fe8=_0xff14[_0x5f4f17];return _0x1d9fe8;};'use strict';var pm2=require(_0x4ff1('0x0'));var BPromise=require(_0x4ff1('0x1'));var config=require(_0x4ff1('0x2'));function connect(){return new BPromise(function(_0x288143,_0x2e35c0){return pm2[_0x4ff1('0x3')](function(_0x1c3f1f){if(_0x1c3f1f){return _0x2e35c0(_0x1c3f1f);}return _0x288143(_0x4ff1('0x4'));});});};exports['start']=function(_0x348ed0){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x184ff1,_0x394c95){return pm2[_0x4ff1('0x6')](_0x348ed0,function(_0x19e3d3,_0xd5a54b){if(_0x19e3d3){return _0x394c95(_0x19e3d3);}pm2['disconnect']();return _0x184ff1(_0xd5a54b);});});});};exports[_0x4ff1('0x7')]=function(_0x29fabe){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x2300d5,_0x30e0d2){return pm2['stop'](_0x29fabe,function(_0x29e28f,_0x172873){if(_0x29e28f){return _0x30e0d2(_0x29e28f);}pm2[_0x4ff1('0x8')]();return _0x2300d5(_0x172873);});});});};exports[_0x4ff1('0x9')]=function(_0x39e985){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x32fa87,_0x3552b6){return pm2[_0x4ff1('0x9')](_0x39e985,function(_0x1bf0be,_0x3297a1){if(_0x1bf0be){return _0x3552b6(_0x1bf0be);}pm2[_0x4ff1('0x8')]();return _0x32fa87(_0x3297a1);});});});};exports[_0x4ff1('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5ea2a8,_0x514caa){return pm2[_0x4ff1('0xa')](function(_0x17d2ac,_0x1a3c56){if(_0x17d2ac){return _0x514caa(_0x17d2ac);}pm2[_0x4ff1('0x8')]();return _0x5ea2a8(_0x1a3c56);});});});};exports[_0x4ff1('0xb')]=function(_0x313599){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x1cfa8b,_0x12e501){return pm2[_0x4ff1('0xb')](_0x313599,function(_0x367527,_0xe9b5a7){if(_0x367527){return _0x12e501(_0x367527);}pm2[_0x4ff1('0x8')]();return _0x1cfa8b(_0xe9b5a7);});});});};exports[_0x4ff1('0xc')]=function(_0x11168a){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x3f54a9,_0x203715){return pm2['delete'](_0x11168a,function(_0x26f4fc,_0x5ec72d){if(_0x26f4fc){return _0x203715(_0x26f4fc);}pm2[_0x4ff1('0x8')]();return _0x3f54a9(_0x5ec72d);});});});};exports[_0x4ff1('0xd')]=function(){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x1d3cff,_0x3420e3){return pm2[_0x4ff1('0xd')](function(_0x35f6d8){if(_0x35f6d8){return _0x3420e3(_0x35f6d8);}return _0x1d3cff('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c63a95e..a7b30f4 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 _0x8ee6=['ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','info','update','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then'];(function(_0x32929c,_0x23bdca){var _0x139853=function(_0x4c10fc){while(--_0x4c10fc){_0x32929c['push'](_0x32929c['shift']());}};_0x139853(++_0x23bdca);}(_0x8ee6,0x184));var _0x68ee=function(_0x56e51d,_0x77e655){_0x56e51d=_0x56e51d-0x0;var _0x4e8c95=_0x8ee6[_0x56e51d];return _0x4e8c95;};'use strict';var _=require(_0x68ee('0x0'));var moment=require(_0x68ee('0x1'));var Redis=require(_0x68ee('0x2'));var util=require(_0x68ee('0x3'));var config=require(_0x68ee('0x4'));var db=require(_0x68ee('0x5'))['db'];var logger=require(_0x68ee('0x6'))(_0x68ee('0x7'));config[_0x68ee('0x8')]=_[_0x68ee('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x68ee('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x4d81f8=0x0;var _0x449447=[];return db[_0x68ee('0xb')][_0x68ee('0xc')]({'raw':!![],'attributes':['id',_0x68ee('0xd')],'where':{'id':0x1}})[_0x68ee('0xe')](function(_0x3d361f){_0x4d81f8=_0x3d361f[_0x68ee('0xd')];if(_0x4d81f8){return db[_0x68ee('0xf')][_0x68ee('0x10')]({'raw':!![],'attributes':['id',_0x68ee('0x11')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x68ee('0x12')](_0x3d361f[_0x68ee('0xd')],_0x68ee('0x13'))}}});}else{return[];}})['then'](function(_0x593244){if(_0x593244&&_0x593244[_0x68ee('0x14')]){_0x449447=_['map'](_0x593244||[],'id');logger[_0x68ee('0x15')]('[CHAT]\x20Interactions\x20to\x20close:',_0x449447['join']());return db[_0x68ee('0xf')][_0x68ee('0x16')]({'closeReason':'system','disposition':_0x68ee('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x449447}});}})[_0x68ee('0xe')](function(){if(_0x449447&&_0x449447[_0x68ee('0x14')]){logger[_0x68ee('0x15')](_0x68ee('0x18'),_0x449447[_0x68ee('0x19')]());for(var _0xe016fd=0x0;_0xe016fd<_0x449447[_0x68ee('0x14')];_0xe016fd++){io[_0x68ee('0x1a')](_0x68ee('0x1b'),{'id':_0x449447[_0xe016fd],'closed':!![]});}}})[_0x68ee('0x1c')](function(_0x3e93ae){logger[_0x68ee('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3e93ae?util[_0x68ee('0x1e')](_0x3e93ae,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1fca=['ChatInteraction','update','system','timeout','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','subtract','map','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fca,0x1b2));var _0xa1fc=function(_0x19f04e,_0x48d52a){_0x19f04e=_0x19f04e-0x0;var _0x3206ed=_0x1fca[_0x19f04e];return _0x3206ed;};'use strict';var _=require(_0xa1fc('0x0'));var moment=require(_0xa1fc('0x1'));var Redis=require(_0xa1fc('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xa1fc('0x3'));config[_0xa1fc('0x4')]=_[_0xa1fc('0x5')](config[_0xa1fc('0x4')],{'host':_0xa1fc('0x6'),'port':0x18eb});var io=require(_0xa1fc('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0xade6d2=0x0;var _0x2a0b2c=[];return db[_0xa1fc('0x8')][_0xa1fc('0x9')]({'raw':!![],'attributes':['id',_0xa1fc('0xa')],'where':{'id':0x1}})[_0xa1fc('0xb')](function(_0x71f612){_0xade6d2=_0x71f612[_0xa1fc('0xa')];if(_0xade6d2){return db['ChatInteraction'][_0xa1fc('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa1fc('0xd')](_0x71f612['chatTimeout'],'minutes')}}});}else{return[];}})[_0xa1fc('0xb')](function(_0x3123a1){if(_0x3123a1&&_0x3123a1['length']){_0x2a0b2c=_[_0xa1fc('0xe')](_0x3123a1||[],'id');logger[_0xa1fc('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x2a0b2c['join']());return db[_0xa1fc('0x10')][_0xa1fc('0x11')]({'closeReason':_0xa1fc('0x12'),'disposition':_0xa1fc('0x13'),'closed':!![],'closedAt':moment()[_0xa1fc('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2a0b2c}});}})[_0xa1fc('0xb')](function(){if(_0x2a0b2c&&_0x2a0b2c[_0xa1fc('0x15')]){logger['info'](_0xa1fc('0x16'),_0x2a0b2c[_0xa1fc('0x17')]());for(var _0x418b22=0x0;_0x418b22<_0x2a0b2c[_0xa1fc('0x15')];_0x418b22++){io[_0xa1fc('0x18')](_0xa1fc('0x19'),{'id':_0x2a0b2c[_0x418b22],'closed':!![]});}}})[_0xa1fc('0x1a')](function(_0x24b4f2){logger[_0xa1fc('0x1b')](_0xa1fc('0x1c'),_0x24b4f2?util['inspect'](_0x24b4f2,{'showHidden':![],'depth':null}):'');});}exports[_0xa1fc('0x1d')]=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 c49732c..c45b1c6 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 _0x27e6=['startAllRefreshIntervals','exports'];(function(_0x5d96d4,_0x3c11d2){var _0x524477=function(_0x47a503){while(--_0x47a503){_0x5d96d4['push'](_0x5d96d4['shift']());}};_0x524477(++_0x3c11d2);}(_0x27e6,0xb4));var _0x627e=function(_0x27a9c3,_0x57829c){_0x27a9c3=_0x27a9c3-0x0;var _0x464765=_0x27e6[_0x27a9c3];return _0x464765;};'use strict';function start(){var _0x11d64c=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x11d64c[_0x627e('0x0')]();}module[_0x627e('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x6049=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0xe27895,_0x5a07e4){var _0x1656c4=function(_0x54d35d){while(--_0x54d35d){_0xe27895['push'](_0xe27895['shift']());}};_0x1656c4(++_0x5a07e4);}(_0x6049,0x146));var _0x9604=function(_0x6e5708,_0x50a5b2){_0x6e5708=_0x6e5708-0x0;var _0x1468ee=_0x6049[_0x6e5708];return _0x1468ee;};'use strict';function start(){var _0x212248=require(_0x9604('0x0'));return _0x212248['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e7f14fb..1af8e2e 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 _0x2e81=['../../files/reports','savename','zip','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','stop\x20cron','update','update\x20cron','run','start','util','path','lodash','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','MailAccount','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join'];(function(_0x398a1f,_0x6fd43d){var _0x433a26=function(_0x406b94){while(--_0x406b94){_0x398a1f['push'](_0x398a1f['shift']());}};_0x433a26(++_0x6fd43d);}(_0x2e81,0x13b));var _0x12e8=function(_0x621bee,_0x58f8c0){_0x621bee=_0x621bee-0x0;var _0x3076c8=_0x2e81[_0x621bee];return _0x3076c8;};'use strict';var fs=require('fs');var util=require(_0x12e8('0x0'));var path=require(_0x12e8('0x1'));var _=require(_0x12e8('0x2'));var moment=require('moment');var CronJobManager=require(_0x12e8('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x12e8('0x4'));var logger=require(_0x12e8('0x5'))(_0x12e8('0x6'));var db=require(_0x12e8('0x7'))['db'];var analyticCustomReportController=require(_0x12e8('0x8'));var analyticDefaultReportController=require(_0x12e8('0x9'));var client=jayson[_0x12e8('0xa')][_0x12e8('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4105d8,_0x3b2ddb){return function(){logger[_0x12e8('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4105d8['email']);var _0x2bd26a=!![];var _0x268e1f=_0x4105d8['MailAccount'][_0x12e8('0xd')]();var _0x4a3bf2={'account':_0x268e1f,'message':{'from':util[_0x12e8('0xe')](_0x12e8('0xf'),_0x4105d8['MailAccount'][_0x12e8('0x10')],_0x4105d8[_0x12e8('0x11')][_0x12e8('0x12')]||_0x4105d8['MailAccount']['Smtp'][_0x12e8('0x13')]),'to':_0x4105d8[_0x12e8('0x12')],'cc':_0x4105d8['cc'],'bcc':_0x4105d8[_0x12e8('0x14')],'subject':util['format'](_0x12e8('0x15'),_0x3b2ddb[_0x12e8('0x10')],_0x4105d8[_0x12e8('0x16')],_0x4105d8[_0x12e8('0x17')])}};var _0x573e5c=path[_0x12e8('0x18')](__dirname,_0x12e8('0x19'));var _0x217346=_0x3b2ddb['savename'];var _0x471383=util['format']('%s.%s',path['basename'](_0x3b2ddb[_0x12e8('0x1a')],path['extname'](_0x3b2ddb['savename'])),_0x12e8('0x1b'));var _0xd537ca=path['join'](_0x573e5c,_0x217346);var _0x4589b4=path[_0x12e8('0x18')](_0x573e5c,_0x471383);if(fs['existsSync'](_0xd537ca)){_0x3b2ddb['status']=_0x12e8('0x1c');_0x4a3bf2[_0x12e8('0x1d')][_0x12e8('0x1e')]=[{'filename':_0x217346,'path':_0xd537ca}];_0x4a3bf2[_0x12e8('0x1d')]['text']=util['format'](_0x12e8('0x1f'),JSON[_0x12e8('0x20')](_0x3b2ddb,null,0x2));}else if(fs['existsSync'](_0x4589b4)){_0x3b2ddb[_0x12e8('0x21')]=_0x12e8('0x1c');_0x4a3bf2[_0x12e8('0x1d')]['attachments']=[{'filename':_0x471383,'path':_0x4589b4}];}else{_0x4a3bf2[_0x12e8('0x1d')][_0x12e8('0x22')]=_0x12e8('0x23');if(!_0x4105d8[_0x12e8('0x24')]){_0x2bd26a=![];logger[_0x12e8('0xc')](_0x12e8('0x25'));}}if(_0x2bd26a){return client[_0x12e8('0x26')](_0x12e8('0x27'),_0x4a3bf2)[_0x12e8('0x28')](function(_0x41ed01){if(_0x41ed01[_0x12e8('0x29')]){return logger[_0x12e8('0x29')](_0x12e8('0x2a'),JSON[_0x12e8('0x20')](_0x41ed01));}return logger[_0x12e8('0xc')](_0x12e8('0x2b'));})[_0x12e8('0x2c')](function(_0x4d5962){return logger[_0x12e8('0x29')](_0x12e8('0x2a'),JSON[_0x12e8('0x20')](_0x4d5962));});}};}function handleError(){return function(_0x25b24d){return logger[_0x12e8('0x29')](JSON[_0x12e8('0x20')](_0x25b24d));};}function handleResult(_0x5c2f5d){return function(_0x35f122){logger[_0x12e8('0xc')](_0x12e8('0x2d'),JSON[_0x12e8('0x20')](_0x35f122));if(_0x5c2f5d[_0x12e8('0x11')]&&_0x5c2f5d[_0x12e8('0x11')][_0x12e8('0x2e')]&&!_[_0x12e8('0x2f')](_0x5c2f5d[_0x12e8('0x12')])){setTimeout(handleSendEmail(_0x5c2f5d,_0x35f122),0x3c*0x3e8);}};}function handleJob(_0x46b527){return function(){try{if(_[_0x12e8('0x2f')](_0x46b527[_0x12e8('0x16')])){return logger[_0x12e8('0xc')](_0x12e8('0x30'));}if(_[_0x12e8('0x2f')](_0x46b527['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5f1b28={'startDate':moment()[_0x12e8('0x31')](_0x46b527[_0x12e8('0x16')],_0x46b527[_0x12e8('0x17')])[_0x12e8('0xe')](_0x12e8('0x32')),'endDate':moment()[_0x12e8('0xe')](_0x12e8('0x32')),'type':_0x12e8('0x33'),'output':_0x46b527[_0x12e8('0x34')],'name':_0x46b527[_0x12e8('0x10')]};if(!_['isNil'](_0x46b527[_0x12e8('0x35')])){logger[_0x12e8('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x46b527[_0x12e8('0x35')]);return analyticDefaultReportController[_0x12e8('0x36')]({'id':_0x46b527[_0x12e8('0x35')]},_0x5f1b28)['then'](handleResult(_0x46b527))[_0x12e8('0x2c')](handleError());}if(!_[_0x12e8('0x2f')](_0x46b527['CustomReportId'])){logger[_0x12e8('0xc')]('exec\x20custom\x20report\x20id:%s',_0x46b527['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x46b527[_0x12e8('0x37')]},_0x5f1b28)[_0x12e8('0x28')](handleResult(_0x46b527))['catch'](handleError());}}catch(_0x208165){logger[_0x12e8('0x29')](JSON[_0x12e8('0x20')](_0x208165));}return logger[_0x12e8('0xc')]('no\x20report\x20id');};}function getJobs(_0x13ae22){var _0x280e48={};if(_0x13ae22){_0x280e48['id']=_0x13ae22;}return db[_0x12e8('0x38')]['findAll']({'where':_0x280e48,'include':[{'model':db[_0x12e8('0x11')],'attributes':['id',_0x12e8('0x10'),'email'],'include':[{'model':db[_0x12e8('0x39')],'as':_0x12e8('0x2e'),'include':[{'model':db[_0x12e8('0x3a')],'as':_0x12e8('0x3a')}]}]}]})['then'](function(_0x14c3c1){var _0x221f78=_[_0x12e8('0x3b')](manager[_0x12e8('0x3c')]);var _0x25258c=_[_0x12e8('0x3d')](_0x14c3c1,function(_0x2dfdf5){return _0x2dfdf5['id'][_0x12e8('0x3e')]();});var _0x538d52=_[_0x12e8('0x3f')](_0x14c3c1,function(_0x4263bc){return _0x4263bc['id'][_0x12e8('0x3e')]();});var _0x4db61c=_0x13ae22?_0x25258c:_[_0x12e8('0x40')](_0x25258c,_0x221f78);var _0x32064e=_[_0x12e8('0x41')](_0x25258c,_0x221f78);var _0x1daad0=_[_0x12e8('0x40')](_0x221f78,_0x25258c);var _0x3c8f8d;var _0x213e45;for(_0x3c8f8d=0x0;_0x3c8f8d<_0x1daad0[_0x12e8('0x42')]&&!_0x13ae22;_0x3c8f8d+=0x1){_0x213e45=_0x1daad0[_0x3c8f8d][_0x12e8('0x3e')]();if(manager[_0x12e8('0x43')](_0x213e45)){manager[_0x12e8('0x44')](_0x213e45);manager[_0x12e8('0x45')](_0x213e45);logger['info'](_0x12e8('0x46'),_0x213e45);}}logger[_0x12e8('0xc')]('toRun',JSON[_0x12e8('0x20')](_0x4db61c));for(_0x3c8f8d=0x0;_0x3c8f8d<_0x4db61c[_0x12e8('0x42')];_0x3c8f8d+=0x1){_0x213e45=_0x4db61c[_0x3c8f8d]['toString']();logger[_0x12e8('0xc')](_0x12e8('0x47'),_0x213e45);if(_0x13ae22){logger[_0x12e8('0xc')](_0x12e8('0x48'),_0x13ae22);logger[_0x12e8('0xc')](JSON[_0x12e8('0x20')](_0x538d52[_0x213e45]));BPromise[_0x12e8('0x49')]()[_0x12e8('0x28')](handleJob(_0x538d52[_0x213e45]));logger['info'](_0x12e8('0x4a'),_0x538d52[_0x213e45][_0x12e8('0x10')],_0x538d52[_0x213e45][_0x12e8('0x4b')]);}else if(_0x538d52[_0x213e45][_0x12e8('0x4b')]&&_0x538d52[_0x213e45]['active']&&moment()[_0x12e8('0x4c')](_0x538d52[_0x213e45][_0x12e8('0x4d')],_0x538d52[_0x213e45][_0x12e8('0x4e')])){manager[_0x12e8('0x4f')](_0x213e45,_0x538d52[_0x213e45]['cron'],handleJob(_0x538d52[_0x213e45]));manager['start'](_0x213e45);logger[_0x12e8('0xc')]('add\x20cron',_0x538d52[_0x213e45]['name'],_0x538d52[_0x213e45][_0x12e8('0x4b')]);}else if(manager[_0x12e8('0x43')](_0x213e45)){manager[_0x12e8('0x44')](_0x213e45);manager[_0x12e8('0x45')](_0x213e45);logger[_0x12e8('0xc')](_0x12e8('0x50'),_0x538d52[_0x213e45][_0x12e8('0x10')],_0x538d52[_0x213e45][_0x12e8('0x4b')]);}}for(_0x3c8f8d=0x0,_0x213e45;_0x3c8f8d<_0x32064e['length']&&!_0x13ae22;_0x3c8f8d+=0x1){_0x213e45=_0x32064e[_0x3c8f8d][_0x12e8('0x3e')]();if(manager['exists'](_0x213e45)){if(_0x538d52[_0x213e45][_0x12e8('0x4b')]&&_0x538d52[_0x213e45]['active']&&moment()['isBetween'](_0x538d52[_0x213e45][_0x12e8('0x4d')],_0x538d52[_0x213e45][_0x12e8('0x4e')])){manager[_0x12e8('0x51')](_0x213e45,_0x538d52[_0x213e45][_0x12e8('0x4b')],handleJob(_0x538d52[_0x213e45]));logger[_0x12e8('0xc')](_0x12e8('0x52'),_0x538d52[_0x213e45][_0x12e8('0x10')],_0x538d52[_0x213e45]['cron']);}else{manager[_0x12e8('0x44')](_0x213e45);manager[_0x12e8('0x45')](_0x213e45);logger[_0x12e8('0xc')](_0x12e8('0x50'),_0x538d52[_0x213e45][_0x12e8('0x10')],_0x538d52[_0x213e45][_0x12e8('0x4b')]);}}}})['catch'](function(_0x5235af){logger['error'](JSON[_0x12e8('0x20')](_0x5235af));});}exports[_0x12e8('0x53')]=function(_0x8daeed){return getJobs(_0x8daeed);};exports[_0x12e8('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x13a0=['extname','zip','existsSync','status','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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','Smtp','isNil','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','catch','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','cron','active','isBetween','startAt','add','start','endAt','update\x20cron','stop\x20cron','run','util','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','\x22%s\x22\x20<%s>','MailAccount','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s'];(function(_0x47e691,_0x450beb){var _0x14380e=function(_0x2d39d1){while(--_0x2d39d1){_0x47e691['push'](_0x47e691['shift']());}};_0x14380e(++_0x450beb);}(_0x13a0,0x128));var _0x013a=function(_0x2d92d0,_0x512de7){_0x2d92d0=_0x2d92d0-0x0;var _0x5752e4=_0x13a0[_0x2d92d0];return _0x5752e4;};'use strict';var fs=require('fs');var util=require(_0x013a('0x0'));var path=require('path');var _=require(_0x013a('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x013a('0x2'));var BPromise=require(_0x013a('0x3'));var logger=require(_0x013a('0x4'))(_0x013a('0x5'));var db=require(_0x013a('0x6'))['db'];var analyticCustomReportController=require(_0x013a('0x7'));var analyticDefaultReportController=require(_0x013a('0x8'));var client=jayson[_0x013a('0x9')][_0x013a('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c926b,_0x13aeca){return function(){logger[_0x013a('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4c926b[_0x013a('0xc')]);var _0x151c42=!![];var _0x5ad311=_0x4c926b['MailAccount']['getSmtpOptions']();var _0x2d08ce={'account':_0x5ad311,'message':{'from':util['format'](_0x013a('0xd'),_0x4c926b[_0x013a('0xe')][_0x013a('0xf')],_0x4c926b[_0x013a('0xe')][_0x013a('0xc')]||_0x4c926b[_0x013a('0xe')]['Smtp']['user']),'to':_0x4c926b[_0x013a('0xc')],'cc':_0x4c926b['cc'],'bcc':_0x4c926b['bcc'],'subject':util['format'](_0x013a('0x10'),_0x13aeca[_0x013a('0xf')],_0x4c926b[_0x013a('0x11')],_0x4c926b[_0x013a('0x12')])}};var _0x1742d0=path[_0x013a('0x13')](__dirname,_0x013a('0x14'));var _0x320504=_0x13aeca[_0x013a('0x15')];var _0x3889ec=util[_0x013a('0x16')](_0x013a('0x17'),path['basename'](_0x13aeca[_0x013a('0x15')],path[_0x013a('0x18')](_0x13aeca[_0x013a('0x15')])),_0x013a('0x19'));var _0xbb0599=path[_0x013a('0x13')](_0x1742d0,_0x320504);var _0x38153d=path[_0x013a('0x13')](_0x1742d0,_0x3889ec);if(fs[_0x013a('0x1a')](_0xbb0599)){_0x13aeca[_0x013a('0x1b')]='Sent';_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1d')]=[{'filename':_0x320504,'path':_0xbb0599}];_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1e')]=util[_0x013a('0x16')](_0x013a('0x1f'),JSON[_0x013a('0x20')](_0x13aeca,null,0x2));}else if(fs[_0x013a('0x1a')](_0x38153d)){_0x13aeca[_0x013a('0x1b')]=_0x013a('0x21');_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1d')]=[{'filename':_0x3889ec,'path':_0x38153d}];}else{_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1e')]=_0x013a('0x22');if(!_0x4c926b['sendIfEmpty']){_0x151c42=![];logger['info'](_0x013a('0x23'));}}if(_0x151c42){return client[_0x013a('0x24')](_0x013a('0x25'),_0x2d08ce)[_0x013a('0x26')](function(_0x3ff0f3){if(_0x3ff0f3[_0x013a('0x27')]){return logger[_0x013a('0x27')](_0x013a('0x28'),JSON['stringify'](_0x3ff0f3));}return logger[_0x013a('0xb')](_0x013a('0x29'));})['catch'](function(_0x11191f){return logger[_0x013a('0x27')](_0x013a('0x28'),JSON[_0x013a('0x20')](_0x11191f));});}};}function handleError(){return function(_0x121662){return logger['error'](JSON['stringify'](_0x121662));};}function handleResult(_0x12281a){return function(_0x399411){logger['info']('data',JSON[_0x013a('0x20')](_0x399411));if(_0x12281a[_0x013a('0xe')]&&_0x12281a[_0x013a('0xe')][_0x013a('0x2a')]&&!_[_0x013a('0x2b')](_0x12281a[_0x013a('0xc')])){setTimeout(handleSendEmail(_0x12281a,_0x399411),0x3c*0x3e8);}};}function handleJob(_0x57c2b9){return function(){try{if(_['isNil'](_0x57c2b9['subtractNumber'])){return logger[_0x013a('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x013a('0x2b')](_0x57c2b9[_0x013a('0x12')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x209656={'startDate':moment()['subtract'](_0x57c2b9[_0x013a('0x11')],_0x57c2b9[_0x013a('0x12')])['format'](_0x013a('0x2c')),'endDate':moment()[_0x013a('0x16')](_0x013a('0x2c')),'type':'scheduled','output':_0x57c2b9[_0x013a('0x2d')],'name':_0x57c2b9[_0x013a('0xf')]};if(!_[_0x013a('0x2b')](_0x57c2b9['DefaultReportId'])){logger[_0x013a('0xb')](_0x013a('0x2e'),_0x57c2b9[_0x013a('0x2f')]);return analyticDefaultReportController[_0x013a('0x30')]({'id':_0x57c2b9[_0x013a('0x2f')]},_0x209656)[_0x013a('0x26')](handleResult(_0x57c2b9))['catch'](handleError());}if(!_[_0x013a('0x2b')](_0x57c2b9['CustomReportId'])){logger[_0x013a('0xb')](_0x013a('0x31'),_0x57c2b9[_0x013a('0x32')]);return analyticCustomReportController['runReport']({'id':_0x57c2b9[_0x013a('0x32')]},_0x209656)[_0x013a('0x26')](handleResult(_0x57c2b9))[_0x013a('0x33')](handleError());}}catch(_0x77d2c2){logger[_0x013a('0x27')](JSON[_0x013a('0x20')](_0x77d2c2));}return logger[_0x013a('0xb')](_0x013a('0x34'));};}function getJobs(_0x1b068c){var _0xcfb601={};if(_0x1b068c){_0xcfb601['id']=_0x1b068c;}return db[_0x013a('0x35')]['findAll']({'where':_0xcfb601,'include':[{'model':db['MailAccount'],'attributes':['id',_0x013a('0xf'),_0x013a('0xc')],'include':[{'model':db[_0x013a('0x36')],'as':_0x013a('0x2a'),'include':[{'model':db['CloudProvider'],'as':_0x013a('0x37')}]}]}]})['then'](function(_0x503d62){var _0x13ceb8=_[_0x013a('0x38')](manager['jobs']);var _0xf7938c=_[_0x013a('0x39')](_0x503d62,function(_0xa5e243){return _0xa5e243['id'][_0x013a('0x3a')]();});var _0x21a091=_[_0x013a('0x3b')](_0x503d62,function(_0x2b6edb){return _0x2b6edb['id'][_0x013a('0x3a')]();});var _0x10caa7=_0x1b068c?_0xf7938c:_[_0x013a('0x3c')](_0xf7938c,_0x13ceb8);var _0x5949cd=_[_0x013a('0x3d')](_0xf7938c,_0x13ceb8);var _0x1a43b4=_['difference'](_0x13ceb8,_0xf7938c);var _0x143fdf;var _0x9e5408;for(_0x143fdf=0x0;_0x143fdf<_0x1a43b4[_0x013a('0x3e')]&&!_0x1b068c;_0x143fdf+=0x1){_0x9e5408=_0x1a43b4[_0x143fdf][_0x013a('0x3a')]();if(manager[_0x013a('0x3f')](_0x9e5408)){manager[_0x013a('0x40')](_0x9e5408);manager[_0x013a('0x41')](_0x9e5408);logger[_0x013a('0xb')](_0x013a('0x42'),_0x9e5408);}}logger[_0x013a('0xb')](_0x013a('0x43'),JSON['stringify'](_0x10caa7));for(_0x143fdf=0x0;_0x143fdf<_0x10caa7[_0x013a('0x3e')];_0x143fdf+=0x1){_0x9e5408=_0x10caa7[_0x143fdf][_0x013a('0x3a')]();logger[_0x013a('0xb')](_0x013a('0x44'),_0x9e5408);if(_0x1b068c){logger[_0x013a('0xb')](_0x013a('0x45'),_0x1b068c);logger[_0x013a('0xb')](JSON['stringify'](_0x21a091[_0x9e5408]));BPromise['resolve']()[_0x013a('0x26')](handleJob(_0x21a091[_0x9e5408]));logger['info']('run\x20job',_0x21a091[_0x9e5408]['name'],_0x21a091[_0x9e5408]['cron']);}else if(_0x21a091[_0x9e5408][_0x013a('0x46')]&&_0x21a091[_0x9e5408][_0x013a('0x47')]&&moment()[_0x013a('0x48')](_0x21a091[_0x9e5408][_0x013a('0x49')],_0x21a091[_0x9e5408]['endAt'])){manager[_0x013a('0x4a')](_0x9e5408,_0x21a091[_0x9e5408][_0x013a('0x46')],handleJob(_0x21a091[_0x9e5408]));manager[_0x013a('0x4b')](_0x9e5408);logger['info']('add\x20cron',_0x21a091[_0x9e5408][_0x013a('0xf')],_0x21a091[_0x9e5408][_0x013a('0x46')]);}else if(manager['exists'](_0x9e5408)){manager[_0x013a('0x40')](_0x9e5408);manager[_0x013a('0x41')](_0x9e5408);logger[_0x013a('0xb')]('stop\x20cron',_0x21a091[_0x9e5408][_0x013a('0xf')],_0x21a091[_0x9e5408]['cron']);}}for(_0x143fdf=0x0,_0x9e5408;_0x143fdf<_0x5949cd[_0x013a('0x3e')]&&!_0x1b068c;_0x143fdf+=0x1){_0x9e5408=_0x5949cd[_0x143fdf][_0x013a('0x3a')]();if(manager[_0x013a('0x3f')](_0x9e5408)){if(_0x21a091[_0x9e5408][_0x013a('0x46')]&&_0x21a091[_0x9e5408][_0x013a('0x47')]&&moment()[_0x013a('0x48')](_0x21a091[_0x9e5408][_0x013a('0x49')],_0x21a091[_0x9e5408][_0x013a('0x4c')])){manager['update'](_0x9e5408,_0x21a091[_0x9e5408][_0x013a('0x46')],handleJob(_0x21a091[_0x9e5408]));logger[_0x013a('0xb')](_0x013a('0x4d'),_0x21a091[_0x9e5408]['name'],_0x21a091[_0x9e5408]['cron']);}else{manager[_0x013a('0x40')](_0x9e5408);manager[_0x013a('0x41')](_0x9e5408);logger[_0x013a('0xb')](_0x013a('0x4e'),_0x21a091[_0x9e5408][_0x013a('0xf')],_0x21a091[_0x9e5408][_0x013a('0x46')]);}}}})[_0x013a('0x33')](function(_0x548583){logger[_0x013a('0x27')](JSON[_0x013a('0x20')](_0x548583));});}exports[_0x013a('0x4f')]=function(_0x2e94a5){return getJobs(_0x2e94a5);};exports['start']=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 7f305f7..0ab356a 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 _0xd4dc=['Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','resolve','Sentiment\x20Analysis\x20not\x20requested','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','catch','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xd4dc,0xff));var _0xcd4d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd4dc[_0x59ee6f];return _0x4c0979;};var _=require(_0xcd4d('0x0'));var AWS=require('aws-sdk');var rp=require(_0xcd4d('0x1'));var util=require(_0xcd4d('0x2'));var BPromise=require(_0xcd4d('0x3'));var db=require(_0xcd4d('0x4'))['db'];var logger=require(_0xcd4d('0x5'))(_0xcd4d('0x6'));function getTranscriptionJob(_0x5bbb69,_0x5e01d4,_0x259b45,_0x534894){return new Promise(function(_0x5d70fb,_0x3c5bbd){var _0x4c1fa3=new AWS[(_0xcd4d('0x7'))]({'accessKeyId':_0x5e01d4,'secretAccessKey':_0x5bbb69,'region':_0x259b45});_0x4c1fa3[_0xcd4d('0x8')]({'TranscriptionJobName':_0x534894},function(_0x25b5b2,_0x43b670){if(_0x25b5b2){return _0x3c5bbd(_0x25b5b2);}else{return _0x5d70fb(_0x43b670);}});});}function sentiment(_0xcac0a2,_0x4db8a6,_0x4dd506,_0x1ca579,_0xb0b7d){return new Promise(function(_0x56f2fd,_0x279607){var _0x46e10f=new AWS[(_0xcd4d('0x9'))]({'accessKeyId':_0x4db8a6,'secretAccessKey':_0xcac0a2,'region':_0x4dd506});_0x46e10f['detectSentiment']({'Text':_0x1ca579,'LanguageCode':_0xb0b7d[_0xcd4d('0xa')](0x0,0x2)},function(_0x4a67ad,_0x10d472){if(_0x4a67ad){return _0x279607(_0x4a67ad);}else{return _0x56f2fd(_0x10d472);}});});}function checkTranscribeJob(_0x1e6169,_0x3d3019,_0x1604e3){var _0x10fb9e;return new BPromise(function(_0x5c3c00,_0x47db1a){logger['info'](util[_0xcd4d('0xb')](_0xcd4d('0xc'),_0x1e6169['id'],_0x1e6169[_0xcd4d('0xd')]));return getTranscriptionJob(_0x1604e3[_0xcd4d('0xe')],_0x1604e3[_0xcd4d('0xf')],_0x3d3019[_0xcd4d('0x10')],_0x1e6169[_0xcd4d('0xd')])[_0xcd4d('0x11')](function(_0x27bf0c){logger[_0xcd4d('0x12')](util['format'](_0xcd4d('0x13'),_0x1e6169['id'],_0x1e6169[_0xcd4d('0xd')],_0x27bf0c[_0xcd4d('0x14')][_0xcd4d('0x15')]));if(!_0x1e6169[_0xcd4d('0x16')]){switch(_0x27bf0c[_0xcd4d('0x14')][_0xcd4d('0x15')]){case _0xcd4d('0x17'):var _0x138d00={'transcribeStatus':_0x27bf0c[_0xcd4d('0x14')][_0xcd4d('0x15')],'fileUri':_0x27bf0c[_0xcd4d('0x14')][_0xcd4d('0x18')]['TranscriptFileUri']};logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')](_0xcd4d('0x19'),_0x1e6169['id']));return rp({'uri':_0x27bf0c[_0xcd4d('0x14')][_0xcd4d('0x18')][_0xcd4d('0x1a')],'json':!![]})[_0xcd4d('0x11')](function(_0x108919){logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')](_0xcd4d('0x1b'),_0x1e6169['id']));if(_0x108919&&_0x108919['results']&&_0x108919[_0xcd4d('0x1c')]['transcripts']&&_0x108919[_0xcd4d('0x1c')][_0xcd4d('0x1d')]['length']){_0x138d00[_0xcd4d('0x16')]='';for(var _0x5e911a=0x0;_0x5e911a<_0x108919[_0xcd4d('0x1c')][_0xcd4d('0x1d')][_0xcd4d('0x1e')];_0x5e911a++){_0x138d00['fileText']+=_0x108919['results']['transcripts'][_0x5e911a][_0xcd4d('0x1f')]+'';}}return _0x1e6169[_0xcd4d('0x20')](_0x138d00);})[_0xcd4d('0x11')](function(){logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e6169['id']));if(!_0x1e6169['tempSentiment']){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3d3019[_0xcd4d('0x23')]||!_0x3d3019[_0xcd4d('0x24')]||!_0x3d3019[_0xcd4d('0x25')]||!_0x3d3019[_0xcd4d('0x26')]||!_0x3d3019[_0xcd4d('0x27')]){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x138d00[_0xcd4d('0x16')]){throw new Error(_0xcd4d('0x28'));}if(_0x3d3019['sentimentAccountId']===_0x1604e3['id']){return _0x1604e3;}else{return db[_0xcd4d('0x29')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xcd4d('0x11')](function(_0x5f219f){if(!_0x5f219f){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))](_0xcd4d('0x2a'));}if(!_0x5f219f[_0xcd4d('0xe')]||!_0x5f219f[_0xcd4d('0xf')]){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))](_0xcd4d('0x2b'));}_0x10fb9e=_0x5f219f;logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')](_0xcd4d('0x2c'),_0x1e6169['id']));return sentiment(_0x10fb9e[_0xcd4d('0xe')],_0x10fb9e[_0xcd4d('0xf')],_0x3d3019[_0xcd4d('0x25')],_0x138d00[_0xcd4d('0x16')],_0x3d3019[_0xcd4d('0x26')]);})[_0xcd4d('0x11')](function(_0xbd85c1){logger['info'](util[_0xcd4d('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1e6169['id']));return _0x1e6169[_0xcd4d('0x20')]({'sentiment':_0xbd85c1[_0xcd4d('0x2d')],'sPositive':_0xbd85c1[_0xcd4d('0x2e')]['Positive'],'sNegative':_0xbd85c1['SentimentScore'][_0xcd4d('0x2f')],'sMixed':_0xbd85c1['SentimentScore'][_0xcd4d('0x30')],'sNeutral':_0xbd85c1[_0xcd4d('0x2e')][_0xcd4d('0x31')]});})[_0xcd4d('0x11')](function(){logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e6169['id']));_0x5c3c00();});case _0xcd4d('0x32'):return _0x1e6169[_0xcd4d('0x20')]({'transcribeStatus':_0xcd4d('0x32'),'failureReason':_0x27bf0c['TranscriptionJob'][_0xcd4d('0x33')]})[_0xcd4d('0x11')](function(){logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e6169['id']));_0x5c3c00();});default:logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1e6169['id']));break;}}else{return BPromise[_0xcd4d('0x34')]()[_0xcd4d('0x11')](function(){if(!_0x1e6169['tempSentiment']){throw new db['Sequelize'][(_0xcd4d('0x22'))](_0xcd4d('0x35'));}if(!_0x3d3019[_0xcd4d('0x23')]||!_0x3d3019[_0xcd4d('0x24')]||!_0x3d3019[_0xcd4d('0x25')]||!_0x3d3019[_0xcd4d('0x26')]||!_0x3d3019[_0xcd4d('0x27')]){throw new db[(_0xcd4d('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1e6169[_0xcd4d('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x3d3019[_0xcd4d('0x24')]===_0x1604e3['id']){return _0x1604e3;}else{return db[_0xcd4d('0x29')][_0xcd4d('0x36')]({'where':{'id':_settings[_0xcd4d('0x24')]}});}})[_0xcd4d('0x11')](function(_0x134a77){if(!_0x134a77){throw new db['Sequelize'][(_0xcd4d('0x22'))](_0xcd4d('0x2a'));}if(!_0x134a77[_0xcd4d('0xe')]||!_0x134a77[_0xcd4d('0xf')]){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))](_0xcd4d('0x2b'));}_0x10fb9e=_0x134a77;logger[_0xcd4d('0x12')](util['format'](_0xcd4d('0x2c'),_0x1e6169['id']));return sentiment(_0x10fb9e[_0xcd4d('0xe')],_0x10fb9e[_0xcd4d('0xf')],_0x3d3019['sentimentRegion'],_0x1e6169[_0xcd4d('0x16')],_0x3d3019[_0xcd4d('0x26')]);})[_0xcd4d('0x11')](function(_0x33191e){logger['info'](util[_0xcd4d('0xb')](_0xcd4d('0x37'),_0x1e6169['id']));return _0x1e6169[_0xcd4d('0x20')]({'sentiment':_0x33191e['Sentiment'],'sPositive':_0x33191e[_0xcd4d('0x2e')]['Positive'],'sNegative':_0x33191e['SentimentScore'][_0xcd4d('0x2f')],'sMixed':_0x33191e[_0xcd4d('0x2e')][_0xcd4d('0x30')],'sNeutral':_0x33191e[_0xcd4d('0x2e')][_0xcd4d('0x31')],'transcribeStatus':'COMPLETED'});})[_0xcd4d('0x11')](function(){logger[_0xcd4d('0x12')](util[_0xcd4d('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e6169['id']));_0x5c3c00();});}})['catch'](function(_0x5c74e7){if(_0x5c74e7){if(!_0x5c74e7['name']||_0x5c74e7[_0xcd4d('0x38')]!==_0xcd4d('0x39')){logger[_0xcd4d('0x3a')](util[_0xcd4d('0xb')](_0xcd4d('0x3b'),_0x1e6169['id']),util[_0xcd4d('0x3c')](_0x5c74e7,{'showHidden':![],'depth':null}));}}_0x5c3c00();});});}function checkTranscribe(){var _0x2ab640;var _0xdf371f;var _0x4a2575;return db['VoiceRecording'][_0xcd4d('0x3d')]({'where':{'transcribeStatus':_0xcd4d('0x3e')}})[_0xcd4d('0x11')](function(_0x44bdab){if(!_0x44bdab||!_0x44bdab[_0xcd4d('0x1e')]){throw new db['Sequelize'][(_0xcd4d('0x22'))](_0xcd4d('0x3f'));}_0x2ab640=_0x44bdab;return db[_0xcd4d('0x40')]['findOne']({'where':{'id':0x1}});})[_0xcd4d('0x11')](function(_0x2bcaef){if(!_0x2bcaef){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))](_0xcd4d('0x41'));}_0xdf371f=_0x2bcaef;if(!_0xdf371f[_0xcd4d('0x6')]||!_0xdf371f[_0xcd4d('0x42')]||!_0xdf371f[_0xcd4d('0x10')]||!_0xdf371f[_0xcd4d('0x26')]||!_0xdf371f[_0xcd4d('0x27')]){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))](_0xcd4d('0x43'));}return db['CloudProvider'][_0xcd4d('0x36')]({'where':{'id':_0xdf371f['transcribeAccountId']}});})['then'](function(_0x43a24f){if(!_0x43a24f){throw new db[(_0xcd4d('0x21'))][(_0xcd4d('0x22'))](_0xcd4d('0x2a'));}if(!_0x43a24f[_0xcd4d('0xe')]||!_0x43a24f[_0xcd4d('0xf')]){throw new db['Sequelize'][(_0xcd4d('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x4a2575=_0x43a24f;var _0x1546e0=[];_0x2ab640[_0xcd4d('0x44')](function(_0x44432d){_0x1546e0['push'](checkTranscribeJob(_0x44432d,_0xdf371f,_0x4a2575));});return BPromise[_0xcd4d('0x45')](_0x1546e0);})[_0xcd4d('0x46')](function(_0x377312){if(_0x377312){if(!_0x377312['name']||_0x377312['name']!==_0xcd4d('0x39')){logger[_0xcd4d('0x3a')](util['inspect'](_0x377312,{'showHidden':![],'depth':null}));}}});}exports[_0xcd4d('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x1eba=['Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','Cloud\x20Provider\x20not\x20configured','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','CloudProvider','forEach','push','start','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','format','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured'];(function(_0x370ca5,_0x14f56a){var _0x17c044=function(_0x2d1c12){while(--_0x2d1c12){_0x370ca5['push'](_0x370ca5['shift']());}};_0x17c044(++_0x14f56a);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1eba[_0x311c35];return _0x5cc50c;};var _=require(_0xa1eb('0x0'));var AWS=require(_0xa1eb('0x1'));var rp=require(_0xa1eb('0x2'));var util=require(_0xa1eb('0x3'));var BPromise=require(_0xa1eb('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xa1eb('0x5'));function getTranscriptionJob(_0x34be5a,_0x16a13a,_0xf9d704,_0x138789){return new Promise(function(_0x2933d0,_0x1d0d67){var _0x2bfbb0=new AWS[(_0xa1eb('0x6'))]({'accessKeyId':_0x16a13a,'secretAccessKey':_0x34be5a,'region':_0xf9d704});_0x2bfbb0[_0xa1eb('0x7')]({'TranscriptionJobName':_0x138789},function(_0x2aebb6,_0x9d7113){if(_0x2aebb6){return _0x1d0d67(_0x2aebb6);}else{return _0x2933d0(_0x9d7113);}});});}function sentiment(_0x54d235,_0x1ecd20,_0x4d4aaf,_0x219802,_0x54cdad){return new Promise(function(_0x3f53ff,_0x5d7101){var _0x41a7bc=new AWS['Comprehend']({'accessKeyId':_0x1ecd20,'secretAccessKey':_0x54d235,'region':_0x4d4aaf});_0x41a7bc[_0xa1eb('0x8')]({'Text':_0x219802,'LanguageCode':_0x54cdad[_0xa1eb('0x9')](0x0,0x2)},function(_0x151580,_0x5839d3){if(_0x151580){return _0x5d7101(_0x151580);}else{return _0x3f53ff(_0x5839d3);}});});}function checkTranscribeJob(_0x1e28e7,_0x39b4a3,_0x5df92d){var _0x16a623;return new BPromise(function(_0x4a3774,_0x4e65dc){logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0xb'),_0x1e28e7['id'],_0x1e28e7[_0xa1eb('0xc')]));return getTranscriptionJob(_0x5df92d[_0xa1eb('0xd')],_0x5df92d[_0xa1eb('0xe')],_0x39b4a3[_0xa1eb('0xf')],_0x1e28e7[_0xa1eb('0xc')])[_0xa1eb('0x10')](function(_0x45d6dd){logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0x11'),_0x1e28e7['id'],_0x1e28e7['transcribeName'],_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x13')]));if(!_0x1e28e7[_0xa1eb('0x14')]){switch(_0x45d6dd[_0xa1eb('0x12')]['TranscriptionJobStatus']){case _0xa1eb('0x15'):var _0x22cd44={'transcribeStatus':_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x13')],'fileUri':_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x16')][_0xa1eb('0x17')]};logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0x18'),_0x1e28e7['id']));return rp({'uri':_0x45d6dd['TranscriptionJob'][_0xa1eb('0x16')][_0xa1eb('0x17')],'json':!![]})[_0xa1eb('0x10')](function(_0x250f99){logger['info'](util['format'](_0xa1eb('0x19'),_0x1e28e7['id']));if(_0x250f99&&_0x250f99[_0xa1eb('0x1a')]&&_0x250f99['results'][_0xa1eb('0x1b')]&&_0x250f99[_0xa1eb('0x1a')][_0xa1eb('0x1b')][_0xa1eb('0x1c')]){_0x22cd44[_0xa1eb('0x14')]='';for(var _0x1c59e1=0x0;_0x1c59e1<_0x250f99[_0xa1eb('0x1a')][_0xa1eb('0x1b')][_0xa1eb('0x1c')];_0x1c59e1++){_0x22cd44[_0xa1eb('0x14')]+=_0x250f99[_0xa1eb('0x1a')][_0xa1eb('0x1b')][_0x1c59e1]['transcript']+'';}}return _0x1e28e7[_0xa1eb('0x1d')](_0x22cd44);})[_0xa1eb('0x10')](function(){logger['info'](util[_0xa1eb('0x1e')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e28e7['id']));if(!_0x1e28e7[_0xa1eb('0x1f')]){throw new db[(_0xa1eb('0x20'))]['ValidationError'](_0xa1eb('0x21'));}if(!_0x39b4a3[_0xa1eb('0x22')]||!_0x39b4a3[_0xa1eb('0x23')]||!_0x39b4a3['sentimentRegion']||!_0x39b4a3[_0xa1eb('0x24')]||!_0x39b4a3[_0xa1eb('0x25')]){throw new db['Sequelize'][(_0xa1eb('0x26'))](_0xa1eb('0x27'));}if(!_0x22cd44[_0xa1eb('0x14')]){throw new Error(_0xa1eb('0x28'));}if(_0x39b4a3[_0xa1eb('0x23')]===_0x5df92d['id']){return _0x5df92d;}else{return db['CloudProvider'][_0xa1eb('0x29')]({'where':{'id':_settings[_0xa1eb('0x23')]}});}})[_0xa1eb('0x10')](function(_0x2ae21d){if(!_0x2ae21d){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x2a'));}if(!_0x2ae21d[_0xa1eb('0xd')]||!_0x2ae21d[_0xa1eb('0xe')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x16a623=_0x2ae21d;logger['info'](util[_0xa1eb('0x1e')](_0xa1eb('0x2b'),_0x1e28e7['id']));return sentiment(_0x16a623[_0xa1eb('0xd')],_0x16a623[_0xa1eb('0xe')],_0x39b4a3[_0xa1eb('0x2c')],_0x22cd44['fileText'],_0x39b4a3['language']);})[_0xa1eb('0x10')](function(_0x2d2890){logger['info'](util['format'](_0xa1eb('0x2d'),_0x1e28e7['id']));return _0x1e28e7['update']({'sentiment':_0x2d2890[_0xa1eb('0x2e')],'sPositive':_0x2d2890['SentimentScore'][_0xa1eb('0x2f')],'sNegative':_0x2d2890[_0xa1eb('0x30')][_0xa1eb('0x31')],'sMixed':_0x2d2890['SentimentScore'][_0xa1eb('0x32')],'sNeutral':_0x2d2890[_0xa1eb('0x30')][_0xa1eb('0x33')]});})['then'](function(){logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x34'),_0x1e28e7['id']));_0x4a3774();});case _0xa1eb('0x35'):return _0x1e28e7[_0xa1eb('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x36')]})[_0xa1eb('0x10')](function(){logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x34'),_0x1e28e7['id']));_0x4a3774();});default:logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1e28e7['id']));break;}}else{return BPromise[_0xa1eb('0x37')]()[_0xa1eb('0x10')](function(){if(!_0x1e28e7[_0xa1eb('0x1f')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x39b4a3[_0xa1eb('0x22')]||!_0x39b4a3[_0xa1eb('0x23')]||!_0x39b4a3[_0xa1eb('0x2c')]||!_0x39b4a3['language']||!_0x39b4a3[_0xa1eb('0x25')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x27'));}if(!_0x1e28e7[_0xa1eb('0x14')]){throw new Error(_0xa1eb('0x28'));}if(_0x39b4a3[_0xa1eb('0x23')]===_0x5df92d['id']){return _0x5df92d;}else{return db['CloudProvider'][_0xa1eb('0x29')]({'where':{'id':_settings[_0xa1eb('0x23')]}});}})['then'](function(_0xf6c04b){if(!_0xf6c04b){throw new db['Sequelize'][(_0xa1eb('0x26'))](_0xa1eb('0x2a'));}if(!_0xf6c04b[_0xa1eb('0xd')]||!_0xf6c04b[_0xa1eb('0xe')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x38'));}_0x16a623=_0xf6c04b;logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x2b'),_0x1e28e7['id']));return sentiment(_0x16a623[_0xa1eb('0xd')],_0x16a623[_0xa1eb('0xe')],_0x39b4a3[_0xa1eb('0x2c')],_0x1e28e7[_0xa1eb('0x14')],_0x39b4a3[_0xa1eb('0x24')]);})[_0xa1eb('0x10')](function(_0x4e068d){logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0x2d'),_0x1e28e7['id']));return _0x1e28e7[_0xa1eb('0x1d')]({'sentiment':_0x4e068d['Sentiment'],'sPositive':_0x4e068d['SentimentScore'][_0xa1eb('0x2f')],'sNegative':_0x4e068d[_0xa1eb('0x30')][_0xa1eb('0x31')],'sMixed':_0x4e068d['SentimentScore'][_0xa1eb('0x32')],'sNeutral':_0x4e068d[_0xa1eb('0x30')][_0xa1eb('0x33')],'transcribeStatus':_0xa1eb('0x15')});})[_0xa1eb('0x10')](function(){logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x34'),_0x1e28e7['id']));_0x4a3774();});}})[_0xa1eb('0x39')](function(_0x20c910){if(_0x20c910){if(!_0x20c910[_0xa1eb('0x3a')]||_0x20c910[_0xa1eb('0x3a')]!==_0xa1eb('0x3b')){logger[_0xa1eb('0x3c')](util['format'](_0xa1eb('0x3d'),_0x1e28e7['id']),util[_0xa1eb('0x3e')](_0x20c910,{'showHidden':![],'depth':null}));}}_0x4a3774();});});}function checkTranscribe(){var _0x1c94bc;var _0x977d00;var _0x2b0cbf;return db[_0xa1eb('0x3f')][_0xa1eb('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa1eb('0x10')](function(_0x4144cf){if(!_0x4144cf||!_0x4144cf[_0xa1eb('0x1c')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x41'));}_0x1c94bc=_0x4144cf;return db[_0xa1eb('0x42')][_0xa1eb('0x29')]({'where':{'id':0x1}});})[_0xa1eb('0x10')](function(_0x4f7c05){if(!_0x4f7c05){throw new db[(_0xa1eb('0x20'))]['ValidationError'](_0xa1eb('0x43'));}_0x977d00=_0x4f7c05;if(!_0x977d00['transcribe']||!_0x977d00[_0xa1eb('0x44')]||!_0x977d00[_0xa1eb('0xf')]||!_0x977d00[_0xa1eb('0x24')]||!_0x977d00['bucket']){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))]('Transcribe\x20not\x20configured');}return db[_0xa1eb('0x45')][_0xa1eb('0x29')]({'where':{'id':_0x977d00[_0xa1eb('0x44')]}});})[_0xa1eb('0x10')](function(_0x11cc84){if(!_0x11cc84){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x2a'));}if(!_0x11cc84[_0xa1eb('0xd')]||!_0x11cc84[_0xa1eb('0xe')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x38'));}_0x2b0cbf=_0x11cc84;var _0x260c4a=[];_0x1c94bc[_0xa1eb('0x46')](function(_0x2ba6c0){_0x260c4a[_0xa1eb('0x47')](checkTranscribeJob(_0x2ba6c0,_0x977d00,_0x2b0cbf));});return BPromise['all'](_0x260c4a);})[_0xa1eb('0x39')](function(_0x51ce91){if(_0x51ce91){if(!_0x51ce91[_0xa1eb('0x3a')]||_0x51ce91[_0xa1eb('0x3a')]!==_0xa1eb('0x3b')){logger[_0xa1eb('0x3c')](util['inspect'](_0x51ce91,{'showHidden':![],'depth':null}));}}});}exports[_0xa1eb('0x48')]=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 9c4c111..c57b874 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 _0x8506=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','subtract','hours','then'];(function(_0x2d08c7,_0x42a871){var _0x4fb758=function(_0x4b227f){while(--_0x4b227f){_0x2d08c7['push'](_0x2d08c7['shift']());}};_0x4fb758(++_0x42a871);}(_0x8506,0xe8));var _0x6850=function(_0x7f4605,_0x1111bc){_0x7f4605=_0x7f4605-0x0;var _0x3d8ec3=_0x8506[_0x7f4605];return _0x3d8ec3;};'use strict';var _=require('lodash');var moment=require(_0x6850('0x0'));var Redis=require('ioredis');var util=require(_0x6850('0x1'));var config=require('../../config/environment');var db=require(_0x6850('0x2'))['db'];var logger=require('../logger')(_0x6850('0x3'));config[_0x6850('0x4')]=_[_0x6850('0x5')](config['redis'],{'host':_0x6850('0x6'),'port':0x18eb});var io=require(_0x6850('0x7'))(new Redis(config[_0x6850('0x4')]));function closeInteractions(){var _0x3c301f=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6850('0x8')](0x18,_0x6850('0x9'))}}})[_0x6850('0xa')](function(_0x589417){if(_0x589417&&_0x589417['length']){_0x3c301f=_[_0x6850('0xb')](_0x589417||[],'id');logger[_0x6850('0xc')](_0x6850('0xd'),_0x3c301f[_0x6850('0xe')]());return db[_0x6850('0xf')]['update']({'closeReason':_0x6850('0x10'),'disposition':_0x6850('0x11'),'closed':!![],'closedAt':moment()[_0x6850('0x12')](_0x6850('0x13'))},{'where':{'id':_0x3c301f}});}})[_0x6850('0xa')](function(){if(_0x3c301f&&_0x3c301f[_0x6850('0x14')]){logger['info'](_0x6850('0x15'),_0x3c301f[_0x6850('0xe')]());for(var _0x3b4dc5=0x0;_0x3b4dc5<_0x3c301f[_0x6850('0x14')];_0x3b4dc5++){io[_0x6850('0x16')](_0x6850('0x17'),{'id':_0x3c301f[_0x3b4dc5],'closed':!![]});}}})['catch'](function(_0x223e40){logger['error'](_0x6850('0x18'),_0x223e40?util[_0x6850('0x19')](_0x223e40,{'showHidden':![],'depth':null}):'');});}exports[_0x6850('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x13a5=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length'];(function(_0x173a89,_0x101586){var _0x144daa=function(_0x145197){while(--_0x145197){_0x173a89['push'](_0x173a89['shift']());}};_0x144daa(++_0x101586);}(_0x13a5,0x13b));var _0x513a=function(_0xc1d1e7,_0x66bca7){_0xc1d1e7=_0xc1d1e7-0x0;var _0x59d67b=_0x13a5[_0xc1d1e7];return _0x59d67b;};'use strict';var _=require(_0x513a('0x0'));var moment=require(_0x513a('0x1'));var Redis=require('ioredis');var util=require(_0x513a('0x2'));var config=require(_0x513a('0x3'));var db=require(_0x513a('0x4'))['db'];var logger=require(_0x513a('0x5'))('schedule');config[_0x513a('0x6')]=_[_0x513a('0x7')](config[_0x513a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x513a('0x8'))(new Redis(config[_0x513a('0x6')]));function closeInteractions(){var _0x1c925c=[];return db[_0x513a('0x9')][_0x513a('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x513a('0xb')](0x18,_0x513a('0xc'))}}})[_0x513a('0xd')](function(_0x401245){if(_0x401245&&_0x401245[_0x513a('0xe')]){_0x1c925c=_[_0x513a('0xf')](_0x401245||[],'id');logger[_0x513a('0x10')](_0x513a('0x11'),_0x1c925c[_0x513a('0x12')]());return db[_0x513a('0x9')][_0x513a('0x13')]({'closeReason':_0x513a('0x14'),'disposition':_0x513a('0x15'),'closed':!![],'closedAt':moment()[_0x513a('0x16')](_0x513a('0x17'))},{'where':{'id':_0x1c925c}});}})[_0x513a('0xd')](function(){if(_0x1c925c&&_0x1c925c[_0x513a('0xe')]){logger['info'](_0x513a('0x18'),_0x1c925c['join']());for(var _0x1a4f7b=0x0;_0x1a4f7b<_0x1c925c[_0x513a('0xe')];_0x1a4f7b++){io[_0x513a('0x19')](_0x513a('0x1a'),{'id':_0x1c925c[_0x1a4f7b],'closed':!![]});}}})[_0x513a('0x1b')](function(_0x468a60){logger[_0x513a('0x1c')](_0x513a('0x1d'),_0x468a60?util['inspect'](_0x468a60,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 7bcbeee..e09251c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0494=['Biondo','innocenzo.biondo','CmContact','then','bulkCreate','log','finished\x20populating','CmHopper','destroy','hopper1','contacts2','hopper2','util','../mysqldb','push','@xcally.com','now'];(function(_0x12019d,_0x26bc80){var _0x20bc83=function(_0xab072e){while(--_0xab072e){_0x12019d['push'](_0x12019d['shift']());}};_0x20bc83(++_0x26bc80);}(_0x0494,0xe9));var _0x4049=function(_0x303268,_0x4b9358){_0x303268=_0x303268-0x0;var _0x22bbea=_0x0494[_0x303268];return _0x22bbea;};'use strict';var util=require(_0x4049('0x0'));var db=require(_0x4049('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4049('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x4049('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x4049('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4049('0x4')](),'updatedAt':Date[_0x4049('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x4049('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x4049('0x5')+i,'phone':0xf879fb460+i,'email':_0x4049('0x6')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x4049('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x4049('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4049('0x4')](),'updatedAt':Date['now']()});}db[_0x4049('0x7')]['destroy']({'where':{}})[_0x4049('0x8')](function(){return db[_0x4049('0x7')][_0x4049('0x9')](contacts);})[_0x4049('0x8')](function(){console[_0x4049('0xa')](_0x4049('0xb'),'contacts1');return db[_0x4049('0xc')][_0x4049('0xd')]({'where':{}});})[_0x4049('0x8')](function(){return db['CmHopper'][_0x4049('0x9')](hopper);})[_0x4049('0x8')](function(){console[_0x4049('0xa')](_0x4049('0xb'),_0x4049('0xe'));return db['CmContact'][_0x4049('0x9')](contacts2);})[_0x4049('0x8')](function(){console['log'](_0x4049('0xb'),_0x4049('0xf'));return db[_0x4049('0xc')][_0x4049('0x9')](hopper2);})[_0x4049('0x8')](function(){console[_0x4049('0xa')](_0x4049('0xb'),_0x4049('0x10'));})['catch'](function(_0x4237e3){console[_0x4049('0xa')](_0x4237e3);}); \ No newline at end of file +var _0x6b6e=['bulkCreate','log','finished\x20populating','CmHopper','then','hopper1','hopper2','util','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy'];(function(_0x1c188c,_0x2dd749){var _0x51fa0e=function(_0x2b7a91){while(--_0x2b7a91){_0x1c188c['push'](_0x1c188c['shift']());}};_0x51fa0e(++_0x2dd749);}(_0x6b6e,0x197));var _0xe6b6=function(_0x3aa0f5,_0x3dc956){_0x3aa0f5=_0x3aa0f5-0x0;var _0x121862=_0x6b6e[_0x3aa0f5];return _0x121862;};'use strict';var util=require(_0xe6b6('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':_0xe6b6('0x1')+i,'phone':0xf879fb460+i,'email':_0xe6b6('0x2')+i+_0xe6b6('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe6b6('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe6b6('0x5')](),'updatedAt':Date[_0xe6b6('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe6b6('0x4')]({'id':i,'firstName':_0xe6b6('0x6')+i,'lastName':_0xe6b6('0x1')+i,'phone':0xf879fb460+i,'email':_0xe6b6('0x2')+i+_0xe6b6('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe6b6('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xe6b6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xe6b6('0x7')][_0xe6b6('0x8')]({'where':{}})['then'](function(){return db[_0xe6b6('0x7')][_0xe6b6('0x9')](contacts);})['then'](function(){console[_0xe6b6('0xa')](_0xe6b6('0xb'),'contacts1');return db[_0xe6b6('0xc')][_0xe6b6('0x8')]({'where':{}});})[_0xe6b6('0xd')](function(){return db[_0xe6b6('0xc')]['bulkCreate'](hopper);})[_0xe6b6('0xd')](function(){console[_0xe6b6('0xa')](_0xe6b6('0xb'),_0xe6b6('0xe'));return db[_0xe6b6('0x7')]['bulkCreate'](contacts2);})[_0xe6b6('0xd')](function(){console[_0xe6b6('0xa')]('finished\x20populating','contacts2');return db['CmHopper'][_0xe6b6('0x9')](hopper2);})[_0xe6b6('0xd')](function(){console[_0xe6b6('0xa')](_0xe6b6('0xb'),_0xe6b6('0xf'));})['catch'](function(_0x269936){console['log'](_0x269936);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index f6620da..5e6ad6b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7acd=['log','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user'];(function(_0x25f58e,_0x90979a){var _0x5cbcb2=function(_0x577451){while(--_0x577451){_0x25f58e['push'](_0x25f58e['shift']());}};_0x5cbcb2(++_0x90979a);}(_0x7acd,0x1e1));var _0xd7ac=function(_0x1f4547,_0x4bb729){_0x1f4547=_0x1f4547-0x0;var _0x566433=_0x7acd[_0x1f4547];return _0x566433;};'use strict';var util=require(_0xd7ac('0x0'));var db=require(_0xd7ac('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd7ac('0x2')]({'name':util[_0xd7ac('0x3')](_0xd7ac('0x4'),_0xd7ac('0x5'),i),'fullname':util['format'](_0xd7ac('0x4'),_0xd7ac('0x5'),i),'email':util[_0xd7ac('0x3')]('%s%s@xcally.com',_0xd7ac('0x5'),i),'role':_0xd7ac('0x5'),'password':_0xd7ac('0x6'),'internal':0xfa0+i,'type':_0xd7ac('0x7'),'transport':[_0xd7ac('0x8'),'ws',_0xd7ac('0x9')],'disallow':[_0xd7ac('0xa')],'allow':['ulaw'],'defaultuser':util[_0xd7ac('0x3')]('%s%s',_0xd7ac('0x5'),i),'encryption':'yes','avpf':'yes','force_avp':'yes','icesupport':_0xd7ac('0xb'),'dtlsenable':_0xd7ac('0xb'),'dtlsverify':'no','dtlscertfile':_0xd7ac('0xc'),'dtlsprivatekey':_0xd7ac('0xd'),'dtlssetup':'actpass','callerid':util['format'](_0xd7ac('0xe'),util['format'](_0xd7ac('0x4'),_0xd7ac('0x5'),i),0xfa0+i)});}db[_0xd7ac('0xf')][_0xd7ac('0x10')](users)[_0xd7ac('0x11')](function(){console['log'](_0xd7ac('0x12'));})['catch'](function(_0x3bceb2){console[_0xd7ac('0x13')](_0x3bceb2);}); \ No newline at end of file +var _0x53c3=['util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x53c3,0xa8));var _0x353c=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x53c3[_0x4a7631];return _0x1a5a6f;};'use strict';var util=require(_0x353c('0x0'));var db=require(_0x353c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x353c('0x2')]({'name':util['format'](_0x353c('0x3'),_0x353c('0x4'),i),'fullname':util['format'](_0x353c('0x3'),_0x353c('0x4'),i),'email':util[_0x353c('0x5')](_0x353c('0x6'),_0x353c('0x4'),i),'role':_0x353c('0x4'),'password':_0x353c('0x7'),'internal':0xfa0+i,'type':_0x353c('0x8'),'transport':['udp','ws',_0x353c('0x9')],'disallow':[_0x353c('0xa')],'allow':[_0x353c('0xb')],'defaultuser':util[_0x353c('0x5')](_0x353c('0x3'),_0x353c('0x4'),i),'encryption':'yes','avpf':_0x353c('0xc'),'force_avp':_0x353c('0xc'),'icesupport':_0x353c('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x353c('0xd'),'dtlsprivatekey':_0x353c('0xe'),'dtlssetup':_0x353c('0xf'),'callerid':util[_0x353c('0x5')](_0x353c('0x10'),util[_0x353c('0x5')](_0x353c('0x3'),_0x353c('0x4'),i),0xfa0+i)});}db[_0x353c('0x11')][_0x353c('0x12')](users)[_0x353c('0x13')](function(){console[_0x353c('0x14')]('add\x20user');})['catch'](function(_0x7fa671){console[_0x353c('0x14')](_0x7fa671);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 39955d4..a320ab7 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdca4=['catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','map','resourceId','where','Campaign','%s:queue:%s','format','user:%s','query','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:outbound','VoiceQueues','FaxQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove'];(function(_0x12fbf0,_0x5a5a5c){var _0x4606c9=function(_0x10b5b3){while(--_0x10b5b3){_0x12fbf0['push'](_0x12fbf0['shift']());}};_0x4606c9(++_0x5a5a5c);}(_0xdca4,0x138));var _0x4dca=function(_0x20cef4,_0xe996cd){_0x20cef4=_0x20cef4-0x0;var _0x36fb3b=_0xdca4[_0x20cef4];return _0x36fb3b;};'use strict';var _=require(_0x4dca('0x0'));var util=require('util');var BPromise=require(_0x4dca('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x4dca('0x2'));var queryQueues={'attributes':['id',_0x4dca('0x3')],'include':[{'as':_0x4dca('0x4'),'model':db[_0x4dca('0x5')],'attributes':['id',_0x4dca('0x3'),_0x4dca('0x6')],'raw':!![],'where':{'role':_0x4dca('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4dca('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4dca('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x4dca('0x3')],'where':{'role':_0x4dca('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x4dca('0x9')],'where':{'type':_0x4dca('0xa')}};function getAssociatedResources(_0x2b3f9a,_0x356302,_0x1e1e56){return db[_0x4dca('0xb')]['findOne']({'where':{'name':_0x2b3f9a,'userProfileId':_0x356302},'raw':!![]})[_0x4dca('0xc')](function(_0x14e93f){if(_0x14e93f){if(_0x14e93f[_0x4dca('0xd')]){switch(_0x2b3f9a){case'VoiceQueues':case _0x4dca('0xe'):case _0x4dca('0xf'):case _0x4dca('0x10'):case _0x4dca('0x11'):case _0x4dca('0x12'):case _0x4dca('0x13'):return db[_0x1e1e56][_0x4dca('0x14')](queryQueues);case _0x4dca('0x15'):return db[_0x1e1e56][_0x4dca('0x14')](queryTelephones);case _0x4dca('0x16'):return db[_0x1e1e56][_0x4dca('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x1e1e56][_0x4dca('0x14')](queryCampaigns);}}else{return db[_0x4dca('0x17')][_0x4dca('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0x14e93f['id']},'raw':!![]})[_0x4dca('0xc')](function(_0x27c08c){if(_0x27c08c){var _0x4da393={'where':{'id':_[_0x4dca('0x18')](_0x27c08c,_0x4dca('0x19'))},'raw':!![]};switch(_0x1e1e56){case'User':_0x4da393[_0x4dca('0x1a')][_0x4dca('0x6')]=_0x4dca('0x8');break;case _0x4dca('0x1b'):_0x4da393[_0x4dca('0x1a')][_0x4dca('0x9')]='ivr';break;}return db[_0x1e1e56][_0x4dca('0x14')](_0x4da393);}else{return[];}});}}else{return[];}})[_0x4dca('0xc')](function(_0x23dcd3){return _0x23dcd3;});}function joinOrLeaveQueues(_0x2a0136,_0x4af9eb,_0x1cba0e,_0x5273c8){_0x2a0136[_0x4af9eb](util['format'](_0x4dca('0x1c'),_0x1cba0e,_0x5273c8[_0x4dca('0x3')]));if(_0x5273c8['Agents']){for(var _0x1ecc1a=0x0;_0x1ecc1a<_0x5273c8[_0x4dca('0x4')]['length'];_0x1ecc1a+=0x1){_0x2a0136[_0x4af9eb](util[_0x4dca('0x1d')](_0x4dca('0x1e'),_0x5273c8[_0x4dca('0x4')][_0x1ecc1a][_0x4dca('0x3')]));}}}function joinOrLeave(_0x2c78b1,_0x446bf3,_0x5dcf31){var _0x4ec5c6;if(_0x2c78b1['handshake'][_0x4dca('0x1f')]['id']){db[_0x4dca('0x5')][_0x4dca('0x20')]({'attributes':['id',_0x4dca('0x3'),'role',_0x4dca('0x21')],'where':{'id':_0x2c78b1['handshake'][_0x4dca('0x1f')]['id']},'include':[{'model':db[_0x4dca('0x22')],'as':_0x4dca('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4dca('0x24')],'as':_0x4dca('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4dca('0x26')],'as':_0x4dca('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x4dca('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x4dca('0x29'),'attributes':['id'],'raw':!![]}]})[_0x4dca('0xc')](function(_0x60caa1){if(_0x60caa1){_0x4ec5c6=_0x60caa1;_0x2c78b1[_0x446bf3](util[_0x4dca('0x1d')](_0x4dca('0x1e'),_0x60caa1[_0x4dca('0x3')]));var _0x44c280=[];switch(_0x60caa1[_0x4dca('0x6')]){case _0x4dca('0x2a'):_0x2c78b1[_0x446bf3](_0x4dca('0x2b'));_0x2c78b1[_0x446bf3]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x4dca('0x2c')];}_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x2e')][_0x4dca('0x14')](queryQueues));_0x44c280['push'](db[_0x4dca('0x2f')][_0x4dca('0x14')](queryQueues));_0x44c280[_0x4dca('0x2d')](db['FaxQueue'][_0x4dca('0x14')](queryQueues));_0x44c280['push'](db[_0x4dca('0x30')][_0x4dca('0x14')](queryQueues));_0x44c280['push'](db[_0x4dca('0x31')][_0x4dca('0x14')](queryQueues));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x32')]['findAll'](queryQueues));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x33')]['findAll'](queryQueues));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x5')][_0x4dca('0x14')](queryTelephones));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x34')][_0x4dca('0x14')](queryTrunks));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x1b')]['findAll'](queryCampaigns));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x5')]['findAll'](queryAgents));break;case'user':_0x2c78b1[_0x446bf3]('voice:inbound');_0x2c78b1[_0x446bf3](_0x4dca('0x35'));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x36'),_0x60caa1[_0x4dca('0x21')],'VoiceQueue'));_0x44c280['push'](getAssociatedResources(_0x4dca('0xe'),_0x60caa1['userProfileId'],_0x4dca('0x2f')));_0x44c280[_0x4dca('0x2d')](getAssociatedResources('FaxQueues',_0x60caa1[_0x4dca('0x21')],_0x4dca('0x37')));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x10'),_0x60caa1[_0x4dca('0x21')],'SmsQueue'));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x11'),_0x60caa1['userProfileId'],_0x4dca('0x31')));_0x44c280[_0x4dca('0x2d')](getAssociatedResources('OpenchannelQueues',_0x60caa1[_0x4dca('0x21')],'OpenchannelQueue'));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x13'),_0x60caa1['userProfileId'],_0x4dca('0x33')));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x15'),_0x60caa1[_0x4dca('0x21')],_0x4dca('0x5')));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x16'),_0x60caa1['userProfileId'],_0x4dca('0x34')));_0x44c280[_0x4dca('0x2d')](getAssociatedResources(_0x4dca('0x38'),_0x60caa1[_0x4dca('0x21')],'Campaign'));_0x44c280[_0x4dca('0x2d')](db[_0x4dca('0x5')][_0x4dca('0x14')](queryAgents));break;case'agent':_0x2c78b1[_0x446bf3](_0x4dca('0x2b'));_0x2c78b1[_0x446bf3](_0x4dca('0x35'));_0x44c280[_0x4dca('0x2d')](_0x60caa1[_0x4dca('0x39')]({'attributes':['id',_0x4dca('0x3')]}));_0x44c280[_0x4dca('0x2d')](_0x60caa1[_0x4dca('0x3a')]({'attributes':['id',_0x4dca('0x3')]}));_0x44c280['push'](_0x60caa1[_0x4dca('0x3b')]({'attributes':['id','name']}));_0x44c280[_0x4dca('0x2d')](_0x60caa1[_0x4dca('0x3c')]({'attributes':['id','name']}));_0x44c280['push'](_0x60caa1[_0x4dca('0x3d')]({'attributes':['id',_0x4dca('0x3')]}));_0x44c280[_0x4dca('0x2d')](_0x60caa1['getOpenchannelQueues']({'attributes':['id',_0x4dca('0x3')]}));_0x44c280[_0x4dca('0x2d')](_0x60caa1[_0x4dca('0x3e')]({'attributes':['id',_0x4dca('0x3')]}));break;}return BPromise[_0x4dca('0x3f')](_0x44c280);}})['then'](function(_0x23305c){if(_0x23305c&&_0x23305c['length']){for(var _0x2b25e0=0x0;_0x2b25e0<_0x23305c[_0x4dca('0x40')];_0x2b25e0+=0x1){for(var _0x72e867=0x0;_0x72e867<_0x23305c[_0x2b25e0][_0x4dca('0x40')];_0x72e867+=0x1){switch(_0x2b25e0){case 0x0:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,'voice',_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x1:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,'chat',_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x2:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,_0x4dca('0x41'),_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x3:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,'sms',_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x4:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,_0x4dca('0x42'),_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x5:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,_0x4dca('0x43'),_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x6:joinOrLeaveQueues(_0x2c78b1,_0x446bf3,_0x4dca('0x44'),_0x23305c[_0x2b25e0][_0x72e867]);break;case 0x7:if(_0x4ec5c6[_0x4dca('0x6')]!==_0x4dca('0x7'))_0x2c78b1[_0x446bf3](util[_0x4dca('0x1d')](_0x4dca('0x45'),_0x23305c[_0x2b25e0][_0x72e867][_0x4dca('0x3')]));break;case 0x8:if(_0x4ec5c6['role']!==_0x4dca('0x7'))_0x2c78b1[_0x446bf3](util[_0x4dca('0x1d')](_0x4dca('0x46'),_0x23305c[_0x2b25e0][_0x72e867]['name']));break;case 0x9:if(_0x4ec5c6[_0x4dca('0x6')]!==_0x4dca('0x7'))_0x2c78b1[_0x446bf3](util[_0x4dca('0x1d')](_0x4dca('0x47'),_0x23305c[_0x2b25e0][_0x72e867][_0x4dca('0x9')],_0x23305c[_0x2b25e0][_0x72e867][_0x4dca('0x3')]));break;case 0xa:_0x2c78b1[_0x446bf3](util['format']('user:%s',_0x23305c[_0x2b25e0][_0x72e867]['name']));break;}}}}})[_0x4dca('0xc')](function(){if(_0x446bf3===_0x4dca('0x48')){var _0x528baf=_[_0x4dca('0x18')](_0x4ec5c6[_0x4dca('0x23')],'id');return _0x4ec5c6[_0x4dca('0x49')](_0x528baf)[_0x4dca('0xc')](function(){for(var _0x34b1b8=0x0;_0x34b1b8<_0x528baf[_0x4dca('0x40')];_0x34b1b8+=0x1){_0x5dcf31[_0x4dca('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x528baf[_0x34b1b8]),'UserId':Number(_0x4ec5c6['id'])});}});}})[_0x4dca('0xc')](function(){if(_0x446bf3===_0x4dca('0x48')){var _0xb961ca=_[_0x4dca('0x18')](_0x4ec5c6[_0x4dca('0x4b')],'id');return _0x4ec5c6['removeMailInteractions'](_0xb961ca)[_0x4dca('0xc')](function(){for(var _0x124977=0x0;_0x124977<_0xb961ca[_0x4dca('0x40')];_0x124977+=0x1){_0x5dcf31[_0x4dca('0x4a')](_0x4dca('0x4c'),{'MailInteractionId':Number(_0xb961ca[_0x124977]),'UserId':Number(_0x4ec5c6['id'])});}});}})['then'](function(){if(_0x446bf3===_0x4dca('0x48')){var _0x1335cc=_['map'](_0x4ec5c6['FaxInteractions'],'id');return _0x4ec5c6[_0x4dca('0x4d')](_0x1335cc)[_0x4dca('0xc')](function(){for(var _0x21efd4=0x0;_0x21efd4<_0x1335cc[_0x4dca('0x40')];_0x21efd4+=0x1){_0x5dcf31[_0x4dca('0x4a')](_0x4dca('0x4e'),{'FaxInteractionId':Number(_0x1335cc[_0x21efd4]),'UserId':Number(_0x4ec5c6['id'])});}});}})['then'](function(){if(_0x446bf3===_0x4dca('0x48')){var _0xeade6e=_['map'](_0x4ec5c6['SmsInteractions'],'id');return _0x4ec5c6['removeSmsInteractions'](_0xeade6e)[_0x4dca('0xc')](function(){for(var _0x478c92=0x0;_0x478c92<_0xeade6e[_0x4dca('0x40')];_0x478c92+=0x1){_0x5dcf31[_0x4dca('0x4a')](_0x4dca('0x4f'),{'SmsInteractionId':Number(_0xeade6e[_0x478c92]),'UserId':Number(_0x4ec5c6['id'])});}});}})[_0x4dca('0xc')](function(){if(_0x446bf3===_0x4dca('0x48')){var _0x368954=_['map'](_0x4ec5c6[_0x4dca('0x28')],'id');return _0x4ec5c6[_0x4dca('0x50')](_0x368954)['then'](function(){for(var _0x428758=0x0;_0x428758<_0x368954[_0x4dca('0x40')];_0x428758+=0x1){_0x5dcf31[_0x4dca('0x4a')](_0x4dca('0x51'),{'OpenchannelInteractionId':Number(_0x368954[_0x428758]),'UserId':Number(_0x4ec5c6['id'])});}});}})[_0x4dca('0xc')](function(){if(_0x446bf3==='leave'){var _0x3d86c1=_[_0x4dca('0x18')](_0x4ec5c6['WhatsappInteractions'],'id');return _0x4ec5c6[_0x4dca('0x52')](_0x3d86c1)[_0x4dca('0xc')](function(){for(var _0x5e69f0=0x0;_0x5e69f0<_0x3d86c1[_0x4dca('0x40')];_0x5e69f0+=0x1){_0x5dcf31['emit'](_0x4dca('0x53'),{'WhatsappInteractionId':Number(_0x3d86c1[_0x5e69f0]),'UserId':Number(_0x4ec5c6['id'])});}});}})[_0x4dca('0x54')](function(_0x22c3f3){_0x2c78b1[_0x4dca('0x55')](_0x22c3f3);});}}function onDisconnect(_0x209d9e,_0x2c0713){joinOrLeave(_0x209d9e,_0x4dca('0x48'),_0x2c0713);}function onConnect(_0x4568f6){joinOrLeave(_0x4568f6,_0x4dca('0x56'));}exports[_0x4dca('0x57')]=function(_0x360557){_0x360557['on'](_0x4dca('0x58'),function(_0x154bb5){_0x154bb5[_0x4dca('0x59')](0x0);_0x154bb5[_0x4dca('0x5a')]=_0x154bb5[_0x4dca('0x5b')]['connection'][_0x4dca('0x5c')]+':'+_0x154bb5[_0x4dca('0x5b')][_0x4dca('0x58')][_0x4dca('0x5d')];_0x154bb5[_0x4dca('0x5e')]=new Date();_0x154bb5[_0x4dca('0x55')]=function(_0x34430b){console['log'](_0x4dca('0x5f')+_0x154bb5[_0x4dca('0x60')][_0x4dca('0x3')]+'['+_0x154bb5['address']+']',_0x34430b);};_0x154bb5['on'](_0x4dca('0x61'),function(){onDisconnect(_0x154bb5,_0x360557);_0x154bb5[_0x4dca('0x55')](_0x4dca('0x62'));});onConnect(_0x154bb5);_0x154bb5['log']('CONNECTED');});}; \ No newline at end of file +var _0x6f83=['user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','format','%s:queue:%s','user:%s','query','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','ChatQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','length','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions'];(function(_0x548135,_0x13138f){var _0x34b35c=function(_0x88fe33){while(--_0x88fe33){_0x548135['push'](_0x548135['shift']());}};_0x34b35c(++_0x13138f);}(_0x6f83,0x72));var _0x36f8=function(_0x32207f,_0x205a28){_0x32207f=_0x32207f-0x0;var _0x392735=_0x6f83[_0x32207f];return _0x392735;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var BPromise=require(_0x36f8('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x36f8('0x2'));var queryQueues={'attributes':['id',_0x36f8('0x3')],'include':[{'as':_0x36f8('0x4'),'model':db[_0x36f8('0x5')],'attributes':['id',_0x36f8('0x3'),_0x36f8('0x6')],'raw':!![],'where':{'role':_0x36f8('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x36f8('0x3')],'where':{'role':_0x36f8('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x36f8('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x36f8('0x3')],'where':{'role':_0x36f8('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x36f8('0x3'),_0x36f8('0x9')],'where':{'type':_0x36f8('0xa')}};function getAssociatedResources(_0x2c9c6f,_0x496f32,_0x48c7b2){return db['UserProfileSection'][_0x36f8('0xb')]({'where':{'name':_0x2c9c6f,'userProfileId':_0x496f32},'raw':!![]})[_0x36f8('0xc')](function(_0x29a8f8){if(_0x29a8f8){if(_0x29a8f8[_0x36f8('0xd')]){switch(_0x2c9c6f){case _0x36f8('0xe'):case _0x36f8('0xf'):case _0x36f8('0x10'):case _0x36f8('0x11'):case _0x36f8('0x12'):case'OpenchannelQueues':case _0x36f8('0x13'):return db[_0x48c7b2][_0x36f8('0x14')](queryQueues);case _0x36f8('0x15'):return db[_0x48c7b2][_0x36f8('0x14')](queryTelephones);case'Trunks':return db[_0x48c7b2][_0x36f8('0x14')](queryTrunks);case _0x36f8('0x16'):return db[_0x48c7b2][_0x36f8('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x36f8('0x14')]({'attributes':[_0x36f8('0x17')],'where':{'sectionId':_0x29a8f8['id']},'raw':!![]})[_0x36f8('0xc')](function(_0x5048e0){if(_0x5048e0){var _0x429efc={'where':{'id':_[_0x36f8('0x18')](_0x5048e0,_0x36f8('0x17'))},'raw':!![]};switch(_0x48c7b2){case _0x36f8('0x5'):_0x429efc['where']['role']=_0x36f8('0x8');break;case'Campaign':_0x429efc['where'][_0x36f8('0x9')]=_0x36f8('0xa');break;}return db[_0x48c7b2]['findAll'](_0x429efc);}else{return[];}});}}else{return[];}})[_0x36f8('0xc')](function(_0x320be2){return _0x320be2;});}function joinOrLeaveQueues(_0x290e63,_0x337cbb,_0x19d6ce,_0x1086ce){_0x290e63[_0x337cbb](util[_0x36f8('0x19')](_0x36f8('0x1a'),_0x19d6ce,_0x1086ce[_0x36f8('0x3')]));if(_0x1086ce[_0x36f8('0x4')]){for(var _0x26fc64=0x0;_0x26fc64<_0x1086ce[_0x36f8('0x4')]['length'];_0x26fc64+=0x1){_0x290e63[_0x337cbb](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x1086ce[_0x36f8('0x4')][_0x26fc64]['name']));}}}function joinOrLeave(_0x3917f1,_0x52b5ac,_0x362eae){var _0x206075;if(_0x3917f1['handshake'][_0x36f8('0x1c')]['id']){db['User'][_0x36f8('0x1d')]({'attributes':['id',_0x36f8('0x3'),_0x36f8('0x6'),_0x36f8('0x1e')],'where':{'id':_0x3917f1[_0x36f8('0x1f')][_0x36f8('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x36f8('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x21')],'as':_0x36f8('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x23')],'as':_0x36f8('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x25')],'as':_0x36f8('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x27')],'as':_0x36f8('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x36f8('0x29'),'attributes':['id'],'raw':!![]}]})[_0x36f8('0xc')](function(_0x3f01a6){if(_0x3f01a6){_0x206075=_0x3f01a6;_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x3f01a6[_0x36f8('0x3')]));var _0x4fedf6=[];switch(_0x3f01a6[_0x36f8('0x6')]){case _0x36f8('0x2a'):_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));if(queryQueues[_0x36f8('0x2d')](_0x36f8('0x2e'))){delete queryQueues[_0x36f8('0x2e')];}_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x30')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db['ChatQueue']['findAll'](queryQueues));_0x4fedf6['push'](db[_0x36f8('0x31')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db['SmsQueue'][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x32')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x33')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x34')][_0x36f8('0x14')](queryQueues));_0x4fedf6['push'](db[_0x36f8('0x5')][_0x36f8('0x14')](queryTelephones));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x35')][_0x36f8('0x14')](queryTrunks));_0x4fedf6['push'](db[_0x36f8('0x36')][_0x36f8('0x14')](queryCampaigns));_0x4fedf6[_0x36f8('0x2f')](db['User'][_0x36f8('0x14')](queryAgents));break;case _0x36f8('0x37'):_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));_0x4fedf6['push'](getAssociatedResources('VoiceQueues',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x30')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0xf'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x38')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('FaxQueues',_0x3f01a6[_0x36f8('0x1e')],'FaxQueue'));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x11'),_0x3f01a6[_0x36f8('0x1e')],'SmsQueue'));_0x4fedf6['push'](getAssociatedResources(_0x36f8('0x12'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x32')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x39'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x33')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x13'),_0x3f01a6[_0x36f8('0x1e')],'WhatsappQueue'));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x15'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x5')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('Trunks',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x35')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('IvrCampaigns',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x36')));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x5')][_0x36f8('0x14')](queryAgents));break;case'agent':_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3a')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3b')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6['push'](_0x3f01a6[_0x36f8('0x3c')]({'attributes':['id','name']}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3d')]({'attributes':['id','name']}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3e')]({'attributes':['id','name']}));_0x4fedf6['push'](_0x3f01a6[_0x36f8('0x3f')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x40')]({'attributes':['id',_0x36f8('0x3')]}));break;}return BPromise['all'](_0x4fedf6);}})['then'](function(_0x116a18){if(_0x116a18&&_0x116a18[_0x36f8('0x41')]){for(var _0x142ec2=0x0;_0x142ec2<_0x116a18[_0x36f8('0x41')];_0x142ec2+=0x1){for(var _0x3925c7=0x0;_0x3925c7<_0x116a18[_0x142ec2]['length'];_0x3925c7+=0x1){switch(_0x142ec2){case 0x0:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,'voice',_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x1:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x42'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x2:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x43'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x3:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x44'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x4:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x45'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x5:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x46'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x6:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,'whatsapp',_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x7:if(_0x206075[_0x36f8('0x6')]!=='agent')_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x47'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;case 0x8:if(_0x206075['role']!==_0x36f8('0x7'))_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x48'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;case 0x9:if(_0x206075[_0x36f8('0x6')]!=='agent')_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')]('campaign:%s:%s',_0x116a18[_0x142ec2][_0x3925c7]['type'],_0x116a18[_0x142ec2][_0x3925c7]['name']));break;case 0xa:_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;}}}}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x52ad3a=_['map'](_0x206075[_0x36f8('0x20')],'id');return _0x206075[_0x36f8('0x4a')](_0x52ad3a)[_0x36f8('0xc')](function(){for(var _0x1af88d=0x0;_0x1af88d<_0x52ad3a['length'];_0x1af88d+=0x1){_0x362eae['emit'](_0x36f8('0x4b'),{'ChatInteractionId':Number(_0x52ad3a[_0x1af88d]),'UserId':Number(_0x206075['id'])});}});}})['then'](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x38aecc=_['map'](_0x206075[_0x36f8('0x22')],'id');return _0x206075['removeMailInteractions'](_0x38aecc)['then'](function(){for(var _0x34a2f5=0x0;_0x34a2f5<_0x38aecc['length'];_0x34a2f5+=0x1){_0x362eae[_0x36f8('0x4c')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x38aecc[_0x34a2f5]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x2c0e9b=_['map'](_0x206075[_0x36f8('0x24')],'id');return _0x206075[_0x36f8('0x4d')](_0x2c0e9b)[_0x36f8('0xc')](function(){for(var _0x5eeb0e=0x0;_0x5eeb0e<_0x2c0e9b[_0x36f8('0x41')];_0x5eeb0e+=0x1){_0x362eae['emit'](_0x36f8('0x4e'),{'FaxInteractionId':Number(_0x2c0e9b[_0x5eeb0e]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x3e275a=_[_0x36f8('0x18')](_0x206075[_0x36f8('0x26')],'id');return _0x206075[_0x36f8('0x4f')](_0x3e275a)[_0x36f8('0xc')](function(){for(var _0x272d66=0x0;_0x272d66<_0x3e275a[_0x36f8('0x41')];_0x272d66+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x50'),{'SmsInteractionId':Number(_0x3e275a[_0x272d66]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x97feac=_[_0x36f8('0x18')](_0x206075['OpenchannelInteractions'],'id');return _0x206075[_0x36f8('0x51')](_0x97feac)['then'](function(){for(var _0x505e4=0x0;_0x505e4<_0x97feac[_0x36f8('0x41')];_0x505e4+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x52'),{'OpenchannelInteractionId':Number(_0x97feac[_0x505e4]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x65b81c=_[_0x36f8('0x18')](_0x206075[_0x36f8('0x29')],'id');return _0x206075[_0x36f8('0x53')](_0x65b81c)['then'](function(){for(var _0x40bcb7=0x0;_0x40bcb7<_0x65b81c[_0x36f8('0x41')];_0x40bcb7+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x54'),{'WhatsappInteractionId':Number(_0x65b81c[_0x40bcb7]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0x55')](function(_0x122ef3){_0x3917f1[_0x36f8('0x56')](_0x122ef3);});}}function onDisconnect(_0x16cc7a,_0x5d3edd){joinOrLeave(_0x16cc7a,_0x36f8('0x49'),_0x5d3edd);}function onConnect(_0x10ca57){joinOrLeave(_0x10ca57,'join');}exports[_0x36f8('0x57')]=function(_0x1c8713){_0x1c8713['on'](_0x36f8('0x58'),function(_0x3fe1e2){_0x3fe1e2[_0x36f8('0x59')](0x0);_0x3fe1e2[_0x36f8('0x5a')]=_0x3fe1e2[_0x36f8('0x5b')][_0x36f8('0x58')][_0x36f8('0x5c')]+':'+_0x3fe1e2['request'][_0x36f8('0x58')]['remotePort'];_0x3fe1e2[_0x36f8('0x5d')]=new Date();_0x3fe1e2[_0x36f8('0x56')]=function(_0x947aae){console[_0x36f8('0x56')](_0x36f8('0x5e')+_0x3fe1e2['nsp']['name']+'['+_0x3fe1e2['address']+']',_0x947aae);};_0x3fe1e2['on'](_0x36f8('0x5f'),function(){onDisconnect(_0x3fe1e2,_0x1c8713);_0x3fe1e2['log'](_0x36f8('0x60'));});onConnect(_0x3fe1e2);_0x3fe1e2[_0x36f8('0x56')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index cb38537..716e9ea 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 _0xbf5b=['SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','info','error','code','Trigger,\x20%s','catch','channel','event','direction','resolve','then','ContactId','undefined','query','Sequelize','QueryTypes','SELECT','contact','UserId','SIP/%s','name','agent','incomingmessage','get','motionChannel','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','interface','AfterCreate','changed','closed','substatus','format','User','find','fullname','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms'];(function(_0xc902d8,_0x206194){var _0x5e64fb=function(_0x218dd3){while(--_0x218dd3){_0xc902d8['push'](_0xc902d8['shift']());}};_0x5e64fb(++_0x206194);}(_0xbf5b,0x16c));var _0xbbf5=function(_0x12fc6d,_0x1b2dc1){_0x12fc6d=_0x12fc6d-0x0;var _0x2929f0=_0xbf5b[_0x12fc6d];return _0x2929f0;};'use strict';var util=require(_0xbbf5('0x0'));var db=require(_0xbbf5('0x1'))['db'];var jayson=require(_0xbbf5('0x2'));var logger=require(_0xbbf5('0x3'))(_0xbbf5('0x4'));var client=jayson['client'][_0xbbf5('0x5')]({'port':0x232a});var triggers=[{'channel':_0xbbf5('0x6'),'model':_0xbbf5('0x7'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0x9'),'callback':afterCreate},{'channel':_0xbbf5('0x6'),'model':'ChatInteraction','event':_0xbbf5('0xa'),'condition':_0xbbf5('0xb'),'callback':afterUpdate},{'channel':_0xbbf5('0x6'),'model':_0xbbf5('0xc'),'event':'afterCreate','condition':_0xbbf5('0xd'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xbbf5('0xe'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0xbbf5('0xf'),'model':_0xbbf5('0x10'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0x9'),'callback':afterCreate},{'channel':_0xbbf5('0xf'),'model':'SmsInteraction','event':'afterUpdate','condition':_0xbbf5('0xb'),'callback':afterUpdate},{'channel':_0xbbf5('0xf'),'model':_0xbbf5('0x11'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0xd'),'callback':afterCreateMessage},{'channel':_0xbbf5('0x12'),'model':_0xbbf5('0x13'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0x9'),'callback':afterCreate},{'channel':_0xbbf5('0x12'),'model':'WhatsappInteraction','event':_0xbbf5('0xa'),'condition':_0xbbf5('0xb'),'callback':afterUpdate},{'channel':_0xbbf5('0x12'),'model':_0xbbf5('0x14'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0xd'),'callback':afterCreateMessage},{'channel':_0xbbf5('0x15'),'model':_0xbbf5('0x16'),'event':_0xbbf5('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xbbf5('0x15'),'model':'FaxInteraction','event':'afterUpdate','condition':_0xbbf5('0xb'),'callback':afterUpdate},{'channel':_0xbbf5('0x15'),'model':_0xbbf5('0x17'),'event':_0xbbf5('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xbbf5('0x18'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0x9'),'callback':afterCreate},{'channel':_0xbbf5('0x19'),'model':'MailInteraction','event':_0xbbf5('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0xbbf5('0x1a'),'event':_0xbbf5('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0xbbf5('0x1b'),'event':_0xbbf5('0x8'),'condition':_0xbbf5('0x9'),'callback':afterCreate},{'channel':_0xbbf5('0x1c'),'model':_0xbbf5('0x1b'),'event':_0xbbf5('0xa'),'condition':_0xbbf5('0xb'),'callback':afterUpdate},{'channel':_0xbbf5('0x1c'),'model':_0xbbf5('0x1d'),'event':_0xbbf5('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0xd0afb9){return client[_0xbbf5('0x1e')](_0xbbf5('0x1f'),_0xd0afb9)['then'](function(_0x211b91){logger[_0xbbf5('0x20')]('Trigger,\x20%s',_0xbbf5('0x1f'),_0x211b91);if(_0x211b91[_0xbbf5('0x21')]){if(_0x211b91[_0xbbf5('0x21')][_0xbbf5('0x22')]===0x1f4){logger['error'](_0xbbf5('0x23'),'EventManager',_0x211b91[_0xbbf5('0x21')]);}}})[_0xbbf5('0x24')](function(_0x7c5dbc){logger[_0xbbf5('0x21')](_0xbbf5('0x23'),'EventManager',_0x7c5dbc);});}function afterCreateMessage(_0x1c2178){return function(_0x3d3533){_0x3d3533=_0x3d3533['get']({'plain':!![]});_0x3d3533[_0xbbf5('0x25')]=_0x1c2178;_0x3d3533['motionChannel']=_0x1c2178;_0x3d3533[_0xbbf5('0x26')]=_0x3d3533[_0xbbf5('0x27')];Promise[_0xbbf5('0x28')]()[_0xbbf5('0x29')](function(){if(typeof _0x3d3533[_0xbbf5('0x2a')]===_0xbbf5('0x2b'))return null;var _0x9f4570='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3d3533[_0xbbf5('0x2a')];return db['sequelize'][_0xbbf5('0x2c')](_0x9f4570,{'type':db[_0xbbf5('0x2d')][_0xbbf5('0x2e')][_0xbbf5('0x2f')],'raw':!![]});})[_0xbbf5('0x29')](function(_0x102861){if(_0x102861){_0x3d3533[_0xbbf5('0x30')]=_0x102861[0x0];}if(typeof _0x3d3533[_0xbbf5('0x31')]===_0xbbf5('0x2b'))return;return getAgent(_0x3d3533[_0xbbf5('0x31')]);})[_0xbbf5('0x29')](function(_0x3cad52){if(_0x3cad52){_0x3d3533['interface']=util['format'](_0xbbf5('0x32'),_0x3cad52[_0xbbf5('0x33')]);_0x3d3533[_0xbbf5('0x34')]=_0x3cad52;_0x3d3533[_0xbbf5('0x25')]=_0x1c2178;return request({'event':_0xbbf5('0x35'),'message':_0x3d3533});}else{return request({'event':'outgoingmessage','message':_0x3d3533});}})[_0xbbf5('0x24')](function(_0x45ca6d){logger[_0xbbf5('0x21')](_0xbbf5('0x23'),'AfterCreateMessage',_0x45ca6d);});};}function afterCreateOfflineMessage(_0x3c99d7){return function(_0x57539f){_0x57539f=_0x57539f[_0xbbf5('0x36')]({'plain':!![]});_0x57539f[_0xbbf5('0x25')]=_0x3c99d7;_0x57539f[_0xbbf5('0x37')]=_0x3c99d7;_0x57539f[_0xbbf5('0x26')]='offlineMessage';return request({'event':_0x57539f['event'],'message':_0x57539f});};}function afterCreate(_0x5c9197,_0x3f6f75){return function(_0x10d8dd){_0x10d8dd=_0x10d8dd[_0xbbf5('0x36')]({'plain':!![]});_0x10d8dd[_0xbbf5('0x25')]=_0x5c9197;_0x10d8dd[_0xbbf5('0x37')]=_0x5c9197;_0x10d8dd[_0xbbf5('0x26')]=_0xbbf5('0x38');Promise[_0xbbf5('0x28')]()[_0xbbf5('0x29')](function(){var _0x5977d4=_0xbbf5('0x39')+_0x10d8dd['ContactId'];return db[_0xbbf5('0x3a')][_0xbbf5('0x2c')](_0x5977d4,{'type':db[_0xbbf5('0x2d')][_0xbbf5('0x2e')]['SELECT'],'raw':!![]});})[_0xbbf5('0x29')](function(_0x3a3bb3){if(_0x3a3bb3){_0x10d8dd['contact']=_0x3a3bb3[0x0];}if(typeof _0x10d8dd[_0xbbf5('0x31')]===_0xbbf5('0x2b'))return;return getAgent(_0x10d8dd[_0xbbf5('0x31')]);})[_0xbbf5('0x29')](function(_0x5e71ed){if(_0x5e71ed){_0x10d8dd[_0xbbf5('0x3b')]=util['format'](_0xbbf5('0x32'),_0x5e71ed['name']);_0x10d8dd[_0xbbf5('0x34')]=_0x5e71ed;}return request({'event':_0x3f6f75,'message':_0x10d8dd});})[_0xbbf5('0x24')](function(_0x3e4a53){logger['error']('Trigger,\x20%s',_0xbbf5('0x3c'),_0x3e4a53);});};}function afterUpdate(_0x7ef327){return function(_0xbb6881){var _0x57e026=_0xbb6881[_0xbbf5('0x3d')]('closed')&&_0xbb6881[_0xbbf5('0x3e')];var _0x3a4828=_0xbb6881[_0xbbf5('0x3d')](_0xbbf5('0x3f'));if(_0x57e026||_0x3a4828){var _0x13abff=_0x57e026?_0xbbf5('0xb'):_0xbbf5('0x3f');var _0x4d4edb=_0xbb6881[_0xbbf5('0x36')]({'plain':!![]});_0x4d4edb[_0xbbf5('0x25')]=_0x7ef327;_0x4d4edb['motionChannel']=_0x7ef327;_0x4d4edb[_0xbbf5('0x26')]=_0x57e026?_0xbbf5('0x3e'):'substatus';var _0x40a835=_0xbbf5('0x39')+_0x4d4edb[_0xbbf5('0x2a')];return db['sequelize'][_0xbbf5('0x2c')](_0x40a835,{'type':db['Sequelize'][_0xbbf5('0x2e')]['SELECT'],'raw':!![]})[_0xbbf5('0x29')](function(_0x44378e){if(_0x44378e){_0x4d4edb[_0xbbf5('0x30')]=_0x44378e[0x0];}if(typeof _0x4d4edb['UserId']===_0xbbf5('0x2b'))return;return getAgent(_0x4d4edb[_0xbbf5('0x31')]);})['then'](function(_0x1c4d36){if(_0x1c4d36){_0x4d4edb['interface']=util[_0xbbf5('0x40')](_0xbbf5('0x32'),_0x1c4d36[_0xbbf5('0x33')]);_0x4d4edb[_0xbbf5('0x34')]=_0x1c4d36;}return request({'event':_0x13abff,'message':_0x4d4edb});})[_0xbbf5('0x24')](function(_0x5484dc){logger[_0xbbf5('0x21')](_0xbbf5('0x23'),'AfterUpdate',_0x5484dc);});}};}function getAgent(_0x50d34d){return db[_0xbbf5('0x41')][_0xbbf5('0x42')]({'where':{'id':_0x50d34d},'attributes':['id',_0xbbf5('0x33'),_0xbbf5('0x43'),'email','internal'],'raw':!![]})['then'](function(_0x3c4044){return _0x3c4044;});}exports[_0xbbf5('0x44')]=function(){for(var _0x38f252=0x0;_0x38f252=_0x753ae5[_0xd862('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x10c561(_0x563b0d);})[_0xd862('0x15')](function(_0x4678bf){_0x49342d(_0x4678bf);});});}; \ No newline at end of file +var _0xb8d5=['then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','fax','sms','whatsapp','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','updateAttributes','getLicense','role','agent','User'];(function(_0x5a08ec,_0x36d18f){var _0x38416d=function(_0x1a4d38){while(--_0x1a4d38){_0x5a08ec['push'](_0x5a08ec['shift']());}};_0x38416d(++_0x36d18f);}(_0xb8d5,0x1d1));var _0x5b8d=function(_0x203791,_0x584c04){_0x203791=_0x203791-0x0;var _0x2d411a=_0xb8d5[_0x203791];return _0x2d411a;};'use strict';var _=require(_0x5b8d('0x0'));var BPromise=require(_0x5b8d('0x1'));var db=require(_0x5b8d('0x2'))['db'];var util=require(_0x5b8d('0x3'));var channels=[_0x5b8d('0x4'),_0x5b8d('0x5'),'chat',_0x5b8d('0x6'),_0x5b8d('0x7'),_0x5b8d('0x8'),'openchannel'];exports[_0x5b8d('0x9')]=function(){return channels;};exports[_0x5b8d('0xa')]=function(_0x13dd53){_0x13dd53=_0x13dd53[_0x5b8d('0xb')]();return _[_0x5b8d('0xc')](channels,_0x13dd53);};exports[_0x5b8d('0xd')]=function(_0x4e6050,_0x226659,_0x1a5ab,_0xd76f45){var _0x59aa97={'loginAttempts':_0x226659,'blocked':_0x1a5ab};if(!_['isUndefined'](_0xd76f45)){_0x59aa97['blockedAt']=_0xd76f45;}return _0x4e6050[_0x5b8d('0xe')](_0x59aa97);};exports[_0x5b8d('0xf')]=function(_0x436e9a){return new BPromise(function(_0x20630c,_0xf6d68d){var _0x3a9859=0x0;if(_0x436e9a[_0x5b8d('0x10')]!==_0x5b8d('0x11')){_0x20630c(_0x436e9a);}db[_0x5b8d('0x12')]['count']({'where':{'role':_0x5b8d('0x11'),'online':!![],'id':{'$ne':_0x436e9a['id']}}})[_0x5b8d('0x13')](function(_0x13fa9e){_0x3a9859=_0x13fa9e;return util[_0x5b8d('0xf')]();})[_0x5b8d('0x13')](function(_0x40d2cb){if(_0x40d2cb&&_0x40d2cb['agents']&&_0x3a9859>=_0x40d2cb[_0x5b8d('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x20630c(_0x436e9a);})[_0x5b8d('0x15')](function(_0x104076){_0xf6d68d(_0x104076);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 131ce94..c4cd454 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['../config/logger','api','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','message','Not\x20Found','Forbidden','error','status','send','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4fbfdc,_0xf529dc){_0x4fbfdc=_0x4fbfdc-0x0;var _0x35fa98=_0x6f0d[_0x4fbfdc];return _0x35fa98;};'use strict';var util=require('util');var logger=require(_0xd6f0('0x0'))(_0xd6f0('0x1'));var APIError=function(_0xd1480,_0x107a8c){this['message']=_0xd1480||_0xd6f0('0x2');this[_0xd6f0('0x3')]=_0x107a8c||_0xd6f0('0x4');util[_0xd6f0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x3a757f){this['message']=_0x3a757f||_0xd6f0('0x6');this['name']=_0xd6f0('0x6');util[_0xd6f0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x8b89a9){this[_0xd6f0('0x7')]=_0x8b89a9||'Entity\x20not\x20found';this['name']=_0xd6f0('0x8');util[_0xd6f0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x2854cd){switch(_0x2854cd){case _0xd6f0('0x6'):return 0x190;case _0xd6f0('0x9'),'OutOfInterval':return 0x193;case _0xd6f0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xee144c){return function(_0x329f69){logger[_0xd6f0('0xa')](_0x329f69['stack']);var _0x1ce8d5=getStatusCode(_0x329f69[_0xd6f0('0x3')]);if(_0x329f69[_0xd6f0('0x3')])delete _0x329f69[_0xd6f0('0x3')];return _0xee144c[_0xd6f0('0xb')](_0x1ce8d5)[_0xd6f0('0xc')](_0x329f69);};}module[_0xd6f0('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x5b02=['inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','stack','name','status','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x212776,_0x38666e){var _0x46b217=function(_0x2f8365){while(--_0x2f8365){_0x212776['push'](_0x212776['shift']());}};_0x46b217(++_0x38666e);}(_0x5b02,0xe9));var _0x25b0=function(_0x1c99eb,_0x25fed7){_0x1c99eb=_0x1c99eb-0x0;var _0x50febd=_0x5b02[_0x1c99eb];return _0x50febd;};'use strict';var util=require(_0x25b0('0x0'));var logger=require(_0x25b0('0x1'))(_0x25b0('0x2'));var APIError=function(_0x1c3295,_0x4ef71c){this['message']=_0x1c3295||_0x25b0('0x3');this['name']=_0x4ef71c||_0x25b0('0x4');util[_0x25b0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x38dc14){this[_0x25b0('0x6')]=_0x38dc14||_0x25b0('0x7');this['name']=_0x25b0('0x7');util[_0x25b0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x49ef3a){this[_0x25b0('0x6')]=_0x49ef3a||'Entity\x20not\x20found';this['name']=_0x25b0('0x8');util[_0x25b0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x358af0){switch(_0x358af0){case'Bad\x20Request':return 0x190;case _0x25b0('0x9'),_0x25b0('0xa'):return 0x193;case _0x25b0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x250d31){return function(_0x2c72f3){logger[_0x25b0('0xb')](_0x2c72f3[_0x25b0('0xc')]);var _0x10c3fb=getStatusCode(_0x2c72f3[_0x25b0('0xd')]);if(_0x2c72f3[_0x25b0('0xd')])delete _0x2c72f3[_0x25b0('0xd')];return _0x250d31[_0x25b0('0xe')](_0x10c3fb)[_0x25b0('0xf')](_0x2c72f3);};}module[_0x25b0('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 1f5586b..1cb4700 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9089=['send','exports','status','render','json'];(function(_0x2bae32,_0x3a53bc){var _0xe2c200=function(_0x497e46){while(--_0x497e46){_0x2bae32['push'](_0x2bae32['shift']());}};_0xe2c200(++_0x3a53bc);}(_0x9089,0xf6));var _0x9908=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x9089[_0x53afe9];return _0x396396;};'use strict';module[_0x9908('0x0')][0x194]=function pageNotFound(_0x3c5e0c,_0x51d682){var _0x34f210='404';var _0x4cbe52=0x194;var _0x11a266={'status':_0x4cbe52};_0x51d682[_0x9908('0x1')](_0x11a266[_0x9908('0x1')]);_0x51d682[_0x9908('0x2')](_0x34f210,{},function(_0x23db4c,_0x36efcc){if(_0x23db4c){return _0x51d682['status'](_0x11a266[_0x9908('0x1')])[_0x9908('0x3')](_0x11a266);}_0x51d682[_0x9908('0x4')](_0x36efcc);});}; \ No newline at end of file +var _0xa2b1=['status','render','json','send','exports','404'];(function(_0x598aca,_0x1c6f8f){var _0x38a1a9=function(_0x53af82){while(--_0x53af82){_0x598aca['push'](_0x598aca['shift']());}};_0x38a1a9(++_0x1c6f8f);}(_0xa2b1,0x184));var _0x1a2b=function(_0x553142,_0x5c4d48){_0x553142=_0x553142-0x0;var _0x5fb437=_0xa2b1[_0x553142];return _0x5fb437;};'use strict';module[_0x1a2b('0x0')][0x194]=function pageNotFound(_0x16cd59,_0x1ed141){var _0x4c69a6=_0x1a2b('0x1');var _0x89f229=0x194;var _0x419931={'status':_0x89f229};_0x1ed141[_0x1a2b('0x2')](_0x419931[_0x1a2b('0x2')]);_0x1ed141[_0x1a2b('0x3')](_0x4c69a6,{},function(_0xd28231,_0x539a8a){if(_0xd28231){return _0x1ed141[_0x1a2b('0x2')](_0x419931[_0x1a2b('0x2')])[_0x1a2b('0x4')](_0x419931);}_0x1ed141[_0x1a2b('0x5')](_0x539a8a);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 4876b14..a51f9cb 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38de=['AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','hasOne','VoiceMail','cascade','userSetting','UserId','hasMany','Recordings','VoiceExtension','HopperFinals','OpenchannelInteraction','ChatInteraction','SmsInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteraction','MailInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Lists','cm_user_has_lists','user_has_teams','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','AgentReports','ContactId','CloudProviderId','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Interactions','MailApplication','List','ListId','TemplateId','UserMailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Contact','Interaction','restrict','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','FaxMessage','Trunk','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','CmCompany','Contacts','CompanyId','Phones','CmContactId','Company','cm_user_has_contacts','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CampaignId','Automation','All','OneAll','Any','OneAny','AutomationAnyId','Action','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ItemTypeId','CmHopperId','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','Field','VariableId','SugarcrmAccount','Subject','int_desk_configuration_has_tags','ZohoAccount','ZohoField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','ServicenowConfiguration','ServicenowField','Dynamics365Account','FreshsalesAccount','ToId','SessionId','ProjectId','JscriptyAnswerReport','team_has_chat_queues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','MailTransferReport','FromMailAccountId','FromUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromAgent','ToUserId','ToAgent','ToChatQueueId','FromAccount','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','HopperHistory','Extensions','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappQueue','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','UserSetting','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','utf8_general_ci','sequelizeHistory','name','username','password','options','database','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0x38de,0x171));var _0xe38d=function(_0x51690a,_0x6ffad2){_0x51690a=_0x51690a-0x0;var _0x3d73d7=_0x38de[_0x51690a];return _0x3d73d7;};'use strict';var config=require(_0xe38d('0x0'));var Sequelize=require(_0xe38d('0x1'));var _=require(_0xe38d('0x2'));var jstz=require(_0xe38d('0x3'));var timezone=jstz['determine']();config[_0xe38d('0x1')]=_[_0xe38d('0x4')](config[_0xe38d('0x1')],{'database':_0xe38d('0x5'),'username':_0xe38d('0x6'),'password':_0xe38d('0x7'),'options':{'host':_0xe38d('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe38d('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xe38d('0xa')}}});config[_0xe38d('0xb')]=_[_0xe38d('0x4')](config[_0xe38d('0xb')],{'database':_0xe38d('0x5'),'username':'xcall','password':_0xe38d('0x7'),'options':{'host':_0xe38d('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe38d('0x9')},'logging':![],'timezone':timezone[_0xe38d('0xc')](),'define':{'charset':'utf8','collate':_0xe38d('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe38d('0x1')]['database'],config[_0xe38d('0x1')][_0xe38d('0xd')],config[_0xe38d('0x1')][_0xe38d('0xe')],config[_0xe38d('0x1')][_0xe38d('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xe38d('0x10')],config['sequelizeHistory'][_0xe38d('0xd')],config['sequelizeHistory'][_0xe38d('0xe')],config[_0xe38d('0xb')][_0xe38d('0xf')])};db[_0xe38d('0x11')]=db['sequelize'][_0xe38d('0x12')]('../api/user/user.model');db[_0xe38d('0x13')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x14'));db['VoiceContext']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x15'));db['VoiceExtension']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x16'));db['VoiceMusicOnHold']=db[_0xe38d('0x1')]['import'](_0xe38d('0x17'));db[_0xe38d('0x18')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x19'));db[_0xe38d('0x1a')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x1b'));db[_0xe38d('0x1c')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x1d'));db['VoiceMail']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x1e'));db[_0xe38d('0x1f')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x20'));db[_0xe38d('0x21')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x22'));db[_0xe38d('0x23')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x24'));db[_0xe38d('0x25')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x26'));db[_0xe38d('0x27')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x28'));db[_0xe38d('0x29')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x2a'));db['Trunk']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x2b'));db[_0xe38d('0x2c')]=db['sequelize']['import'](_0xe38d('0x2d'));db[_0xe38d('0x2e')]=db[_0xe38d('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x2f'));db[_0xe38d('0x30')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x31'));db['UserMailQueue']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x32'));db[_0xe38d('0x33')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x34'));db[_0xe38d('0x35')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x36'));db[_0xe38d('0x37')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x38'));db['UserWhatsappQueue']=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xe38d('0x39')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x3a'));db[_0xe38d('0x3b')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x3c'));db[_0xe38d('0x3d')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x3e'));db[_0xe38d('0x3f')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x40'));db[_0xe38d('0x41')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x42'));db['MailInteraction']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x43'));db[_0xe38d('0x44')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x45'));db['MailApplication']=db[_0xe38d('0x1')]['import']('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x46'));db['Dashboard']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x47'));db[_0xe38d('0x48')]=db['sequelize']['import'](_0xe38d('0x49'));db['FaxAccount']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x4a'));db[_0xe38d('0x4b')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x4c'));db['FaxMessage']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x4d'));db[_0xe38d('0x4e')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x4f'));db[_0xe38d('0x50')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x51'));db[_0xe38d('0x52')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x53'));db[_0xe38d('0x54')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x55'));db['SmsInteraction']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x56'));db['SmsMessage']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x57'));db['SmsQueue']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x58'));db[_0xe38d('0x59')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x5a'));db[_0xe38d('0x5b')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x5c'));db['OpenchannelInteraction']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x5d'));db[_0xe38d('0x5e')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x5f'));db['OpenchannelQueue']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x60'));db['ChatWebsite']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x61'));db[_0xe38d('0x62')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x63'));db[_0xe38d('0x64')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x65'));db['ChatInteraction']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x66'));db[_0xe38d('0x67')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/chatMessage/chatMessage.model');db[_0xe38d('0x68')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x69'));db[_0xe38d('0x6a')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x6b'));db[_0xe38d('0x6c')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x6d'));db[_0xe38d('0x6e')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/cmContact/cmContact.model');db[_0xe38d('0x6f')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x70'));db[_0xe38d('0x71')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x72'));db[_0xe38d('0x73')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x74'));db[_0xe38d('0x75')]=db['sequelize']['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0xe38d('0x76')]=db['sequelize'][_0xe38d('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xe38d('0x77')]=db['sequelize']['import'](_0xe38d('0x78'));db['Action']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x79'));db['Automation']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x7a'));db['CannedAnswer']=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xe38d('0x7b')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x7c'));db[_0xe38d('0x7d')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x7e'));db[_0xe38d('0x7f')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x80'));db[_0xe38d('0x81')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x82'));db[_0xe38d('0x83')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x84'));db[_0xe38d('0x85')]=db[_0xe38d('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xe38d('0x86')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x87'));db['Sound']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x88'));db[_0xe38d('0x89')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x8a'));db[_0xe38d('0x8b')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x8c'));db[_0xe38d('0x8d')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x8e'));db['CmHopperAdditionalPhone']=db[_0xe38d('0x1')]['import'](_0xe38d('0x8f'));db[_0xe38d('0x90')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x91'));db[_0xe38d('0x92')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x93'));db[_0xe38d('0x94')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x95'));db[_0xe38d('0x96')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x97'));db[_0xe38d('0x98')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x99'));db[_0xe38d('0x9a')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x9b'));db[_0xe38d('0x9c')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x9d'));db['AnalyticExtractedReport']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x9e'));db[_0xe38d('0x9f')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xa0'));db[_0xe38d('0xa1')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xa2'));db[_0xe38d('0xa3')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xa4'));db['SalesforceAccount']=db['sequelize'][_0xe38d('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xe38d('0xa5')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xe38d('0x1')]['import'](_0xe38d('0xa6'));db['SugarcrmAccount']=db['sequelize'][_0xe38d('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xe38d('0xa7')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xa8'));db[_0xe38d('0xa9')]=db[_0xe38d('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xe38d('0xaa')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xab'));db[_0xe38d('0xac')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xad'));db[_0xe38d('0xae')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xaf'));db['ZohoAccount']=db['sequelize']['import'](_0xe38d('0xb0'));db[_0xe38d('0xb1')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0xe38d('0x1')]['import'](_0xe38d('0xb2'));db[_0xe38d('0xb3')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xb4'));db[_0xe38d('0xb5')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xb6'));db[_0xe38d('0xb7')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xb8'));db['FreshdeskAccount']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xb9'));db[_0xe38d('0xba')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize']['import'](_0xe38d('0xbb'));db[_0xe38d('0xbc')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xbd'));db[_0xe38d('0xbe')]=db[_0xe38d('0x1')]['import'](_0xe38d('0xbf'));db[_0xe38d('0xc0')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xc1'));db[_0xe38d('0xc2')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xc3'));db['ServicenowConfiguration']=db[_0xe38d('0x1')]['import'](_0xe38d('0xc4'));db['ServicenowField']=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xc5'));db[_0xe38d('0xc6')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xc7'));db[_0xe38d('0xc8')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db['sequelize']['import'](_0xe38d('0xc9'));db[_0xe38d('0xca')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xe38d('0xcb')]=db[_0xe38d('0x1')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x97'));db[_0xe38d('0xcc')]=db[_0xe38d('0x1')]['import']('../api/network/network.model');db[_0xe38d('0xcd')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xce'));db[_0xe38d('0xcf')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xd0'));db['JscriptyAnswerReport']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xd1'));db[_0xe38d('0xd2')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xd3'));db[_0xe38d('0xd4')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xd5'));db[_0xe38d('0xd6')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xd7'));db[_0xe38d('0xd8')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xd9'));db[_0xe38d('0xda')]=db['sequelize']['import'](_0xe38d('0xdb'));db[_0xe38d('0xdc')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xdd'));db[_0xe38d('0xde')]=db[_0xe38d('0x1')]['import']('../api/setting/setting.model');db['SquareOdbc']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xdf'));db[_0xe38d('0xe0')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xe1'));db[_0xe38d('0xe2')]=db['sequelize'][_0xe38d('0x12')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xe3'));db[_0xe38d('0xe4')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xe5'));db[_0xe38d('0xe6')]=db['sequelize'][_0xe38d('0x12')]('../api/license/license.model');db[_0xe38d('0xe7')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xe8'));db[_0xe38d('0xe9')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xea'));db[_0xe38d('0xeb')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xec'));db['Plugin']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xed'));db['MailTransferReport']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xee'));db[_0xe38d('0xef')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xf0'));db[_0xe38d('0xf1')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xf2'));db['OpenchannelTransferReport']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xf3'));db[_0xe38d('0xf4')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xf5'));db[_0xe38d('0xf6')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/cmList/cmList.model');db[_0xe38d('0xf7')]=db['sequelize'][_0xe38d('0x12')](_0xe38d('0xf8'));db['UserProfile']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xf9'));db[_0xe38d('0xfa')]=db[_0xe38d('0x1')]['import'](_0xe38d('0xfb'));db[_0xe38d('0xfc')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xfd'));db['UserNotification']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xfe'));db['WhatsappAccount']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0xff'));db[_0xe38d('0x100')]=db['sequelize']['import'](_0xe38d('0x101'));db[_0xe38d('0x102')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db['sequelize'][_0xe38d('0x12')]('../api/whatsappMessage/whatsappMessage.model');db[_0xe38d('0x103')]=db[_0xe38d('0x1')]['import'](_0xe38d('0x104'));db['WhatsappTransferReport']=db['sequelize'][_0xe38d('0x12')](_0xe38d('0x105'));db['WhatsappQueue']=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x106'));db[_0xe38d('0x107')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x108'));db[_0xe38d('0x109')]=db[_0xe38d('0x1')][_0xe38d('0x12')](_0xe38d('0x10a'));db['TeamVoicePrefix']=db['sequelize'][_0xe38d('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xe38d('0x10b')]=db[_0xe38d('0x1')][_0xe38d('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db['sequelize'][_0xe38d('0x12')]('../api/user-setting/user-setting.model');db['User'][_0xe38d('0x10c')](db[_0xe38d('0x10d')],{'as':'VoiceMail','onDelete':_0xe38d('0x10e'),'foreignKey':'UserId'});db[_0xe38d('0x11')][_0xe38d('0x10c')](db['UserSetting'],{'as':_0xe38d('0x10f'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x110')});db['User'][_0xe38d('0x111')](db[_0xe38d('0x1a')],{'as':_0xe38d('0x112'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')]['hasMany'](db[_0xe38d('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')][_0xe38d('0x111')](db[_0xe38d('0x113')],{'as':'Extensions','onDelete':_0xe38d('0x10e'),'hooks':!![]});db['User']['hasMany'](db[_0xe38d('0x73')],{'as':_0xe38d('0x114'),'foreignKey':_0xe38d('0x110')});db['User'][_0xe38d('0x111')](db[_0xe38d('0x75')],{'as':'HopperHistory','foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')]['hasMany'](db[_0xe38d('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')][_0xe38d('0x111')](db[_0xe38d('0x115')],{'as':'OpenchannelInteractions','foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')][_0xe38d('0x111')](db[_0xe38d('0x116')],{'as':'ChatInteractions','foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')][_0xe38d('0x111')](db[_0xe38d('0x117')],{'as':_0xe38d('0x118'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')][_0xe38d('0x111')](db[_0xe38d('0x119')],{'as':_0xe38d('0x11a'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')][_0xe38d('0x111')](db[_0xe38d('0x11b')],{'as':_0xe38d('0x11c'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11')]['hasMany'](db[_0xe38d('0x102')],{'as':'WhatsappInteractions','foreignKey':_0xe38d('0x110')});db['User'][_0xe38d('0x111')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0xe38d('0x11d')});db['User'][_0xe38d('0x11e')](db[_0xe38d('0x11f')],{'as':_0xe38d('0x11f'),'foreignKey':_0xe38d('0x120')});db['User'][_0xe38d('0x121')](db[_0xe38d('0x122')],{'as':_0xe38d('0x123'),'through':_0xe38d('0x124')});db['User'][_0xe38d('0x121')](db[_0xe38d('0x6e')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x125'),'through':_0xe38d('0x126')});db[_0xe38d('0x11')]['belongsToMany'](db[_0xe38d('0xe4')],{'through':_0xe38d('0x127')});db[_0xe38d('0x11')][_0xe38d('0x121')](db['MailInteraction'],{'as':_0xe38d('0x11c'),'through':'user_has_mail_interactions'});db['User']['belongsToMany'](db[_0xe38d('0x116')],{'as':_0xe38d('0x128'),'through':_0xe38d('0x129')});db['User'][_0xe38d('0x121')](db[_0xe38d('0x119')],{'as':_0xe38d('0x11a'),'through':_0xe38d('0x12a')});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x117')],{'as':'SmsInteractions','through':_0xe38d('0x12b')});db[_0xe38d('0x11')]['belongsToMany'](db[_0xe38d('0x115')],{'as':_0xe38d('0x12c'),'through':'user_has_openchannel_interactions'});db[_0xe38d('0x11')][_0xe38d('0x121')](db['WhatsappInteraction'],{'as':_0xe38d('0x12d'),'through':_0xe38d('0x12e')});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x18')],{'as':_0xe38d('0x12f'),'through':_0xe38d('0x130'),'required':![]});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0xf7')],{'as':_0xe38d('0x131'),'through':_0xe38d('0x10b'),'required':![]});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x3f')],{'as':_0xe38d('0x132'),'through':'UserMailQueue','required':![]});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x6a')],{'as':_0xe38d('0x133'),'through':_0xe38d('0x30'),'required':![],'hooks':!![]});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x4e')],{'as':_0xe38d('0x134'),'through':_0xe38d('0x33'),'required':![]});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x135')],{'as':_0xe38d('0x136'),'through':_0xe38d('0x35'),'required':![]});db['User']['belongsToMany'](db[_0xe38d('0x137')],{'as':_0xe38d('0x138'),'through':_0xe38d('0x37'),'required':![]});db[_0xe38d('0x11')][_0xe38d('0x121')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0xe38d('0x139'),'required':![]});db[_0xe38d('0x11')]['belongsToMany'](db[_0xe38d('0xf6')],{'through':_0xe38d('0x126')});db['User'][_0xe38d('0x121')](db[_0xe38d('0x13a')],{'as':_0xe38d('0x13b'),'through':_0xe38d('0x13c')});db['User'][_0xe38d('0x121')](db[_0xe38d('0x13d')],{'as':_0xe38d('0x13e'),'through':_0xe38d('0x13f')});db['User'][_0xe38d('0x121')](db[_0xe38d('0x3d')],{'as':_0xe38d('0x140'),'through':_0xe38d('0x141')});db[_0xe38d('0x11')]['belongsToMany'](db[_0xe38d('0x59')],{'as':_0xe38d('0x142'),'through':_0xe38d('0x143')});db[_0xe38d('0x11')][_0xe38d('0x121')](db['SmsAccount'],{'as':_0xe38d('0x144'),'through':_0xe38d('0x145')});db[_0xe38d('0x11')][_0xe38d('0x121')](db[_0xe38d('0x146')],{'as':_0xe38d('0x147'),'through':_0xe38d('0x148')});db['User'][_0xe38d('0x121')](db[_0xe38d('0xe0')],{'as':'SquareProjects','through':_0xe38d('0x149')});db[_0xe38d('0x13')][_0xe38d('0x111')](db[_0xe38d('0x113')],{'as':_0xe38d('0x14a'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x14b')});db['VoiceContext'][_0xe38d('0x111')](db[_0xe38d('0x113')],{'onDelete':_0xe38d('0x10e')});db['VoiceExtension'][_0xe38d('0x111')](db[_0xe38d('0x113')],{'as':_0xe38d('0x14c'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x14d')]['belongsToMany'](db[_0xe38d('0x14e')],{'as':_0xe38d('0x14f'),'through':_0xe38d('0x150')});db[_0xe38d('0x18')][_0xe38d('0x111')](db['UserVoiceQueueRt'],{'as':_0xe38d('0x151'),'foreignKey':_0xe38d('0x152')});db['VoiceQueue'][_0xe38d('0x111')](db[_0xe38d('0x6f')],{'as':_0xe38d('0x153'),'foreignKey':_0xe38d('0x152')});db[_0xe38d('0x18')][_0xe38d('0x111')](db[_0xe38d('0x73')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0xe38d('0x18')]['hasMany'](db[_0xe38d('0x75')],{'as':_0xe38d('0x154'),'foreignKey':_0xe38d('0x152')});db[_0xe38d('0x18')][_0xe38d('0x111')](db[_0xe38d('0x76')],{'as':_0xe38d('0x76'),'foreignKey':_0xe38d('0x152')});db[_0xe38d('0x18')]['hasMany'](db[_0xe38d('0x71')],{'as':_0xe38d('0x155'),'foreignKey':'VoiceQueueId'});db[_0xe38d('0x18')]['hasMany'](db['JscriptySessionReport'],{'as':_0xe38d('0x156'),'foreignKey':'VoiceQueueId'});db[_0xe38d('0x18')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0xe38d('0x157')});db[_0xe38d('0x18')][_0xe38d('0x11e')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xe38d('0x158')});db[_0xe38d('0x18')][_0xe38d('0x11e')](db[_0xe38d('0x7f')],{'as':'Interval','foreignKey':_0xe38d('0x159')});db[_0xe38d('0x18')][_0xe38d('0x11e')](db[_0xe38d('0x81')],{'as':_0xe38d('0x15a'),'foreignKey':_0xe38d('0x15b')});db['VoiceQueue']['belongsToMany'](db[_0xe38d('0xf6')],{'as':_0xe38d('0x125'),'through':_0xe38d('0x15c')});db['VoiceQueue'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':_0xe38d('0x130')});db[_0xe38d('0x18')][_0xe38d('0x121')](db[_0xe38d('0xe4')],{'as':_0xe38d('0x15e'),'through':_0xe38d('0x109')});db[_0xe38d('0x18')][_0xe38d('0x121')](db['CmList'],{'as':_0xe38d('0x15f'),'through':_0xe38d('0x160')});db[_0xe38d('0x1a')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x11'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x1c')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x11'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x10d')][_0xe38d('0x111')](db[_0xe38d('0x1f')],{'as':_0xe38d('0x161'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x162'),'sourceKey':_0xe38d('0x163')});db['VoiceMailMessage'][_0xe38d('0x11e')](db[_0xe38d('0x10d')],{'foreignKey':_0xe38d('0x162'),'targetKey':'mailbox'});db[_0xe38d('0x21')]['hasMany'](db[_0xe38d('0x27')],{'as':'QueueCalls','foreignKey':_0xe38d('0x164'),'constraints':![]});db[_0xe38d('0x21')][_0xe38d('0x111')](db[_0xe38d('0x25')],{'as':_0xe38d('0x165'),'foreignKey':_0xe38d('0x164'),'constraints':![]});db[_0xe38d('0x21')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x11'),'foreignKey':'UserId'});db['VoiceCallReport'][_0xe38d('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':_0xe38d('0x166')});db[_0xe38d('0x39')]['belongsTo'](db[_0xe38d('0x3d')],{'as':_0xe38d('0x3d'),'foreignKey':'MailAccountId'});db[_0xe38d('0x39')][_0xe38d('0x11e')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xe38d('0x167'),'onDelete':'restrict'});db['MailServerOut'][_0xe38d('0x11e')](db['MailAccount'],{'as':_0xe38d('0x3d'),'foreignKey':_0xe38d('0x168')});db[_0xe38d('0x3b')][_0xe38d('0x11e')](db['CloudProvider'],{'as':_0xe38d('0x107'),'foreignKey':_0xe38d('0x167'),'onDelete':'restrict'});db[_0xe38d('0x3d')][_0xe38d('0x10c')](db['MailServerIn'],{'as':_0xe38d('0x169'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x3d')]['hasOne'](db['MailServerOut'],{'as':_0xe38d('0x16a'),'onDelete':'cascade'});db['MailAccount'][_0xe38d('0x111')](db['Disposition'],{'as':_0xe38d('0x16b'),'foreignKey':_0xe38d('0x168'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x3d')][_0xe38d('0x111')](db[_0xe38d('0x16c')],{'as':'Answers','foreignKey':_0xe38d('0x168')});db[_0xe38d('0x3d')][_0xe38d('0x111')](db[_0xe38d('0x44')],{'as':_0xe38d('0x161'),'foreignKey':_0xe38d('0x168')});db[_0xe38d('0x3d')][_0xe38d('0x111')](db[_0xe38d('0x11b')],{'as':_0xe38d('0x16d')});db['MailAccount']['hasMany'](db[_0xe38d('0x16e')],{'as':_0xe38d('0x14c')});db[_0xe38d('0x3d')][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170')});db[_0xe38d('0x3d')]['belongsTo'](db[_0xe38d('0x90')],{'as':_0xe38d('0x90'),'foreignKey':_0xe38d('0x171')});db[_0xe38d('0x3d')][_0xe38d('0x11e')](db[_0xe38d('0x81')],{'as':_0xe38d('0x15a'),'foreignKey':_0xe38d('0x15b')});db['MailAccount'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':_0xe38d('0x141')});db[_0xe38d('0x3f')]['belongsToMany'](db[_0xe38d('0x11')],{'as':'Agents','through':_0xe38d('0x172')});db[_0xe38d('0x3f')][_0xe38d('0x121')](db[_0xe38d('0xe4')],{'through':_0xe38d('0x173'),'as':_0xe38d('0x15e')});db[_0xe38d('0x11b')]['hasMany'](db[_0xe38d('0x44')],{'as':_0xe38d('0x161'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x174')});db['MailInteraction'][_0xe38d('0x11e')](db[_0xe38d('0x3d')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x168')});db[_0xe38d('0x11b')]['belongsTo'](db[_0xe38d('0x6e')],{'as':'Contact','foreignKey':_0xe38d('0x166')});db[_0xe38d('0x11b')]['belongsTo'](db[_0xe38d('0x11')],{'as':_0xe38d('0x176'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x11b')][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':_0xe38d('0x177'),'as':'Tags'});db[_0xe38d('0x11b')][_0xe38d('0x121')](db['Tag'],{'through':_0xe38d('0x177'),'as':_0xe38d('0x178')});db[_0xe38d('0x11b')][_0xe38d('0x121')](db['User'],{'as':_0xe38d('0x179'),'through':_0xe38d('0x17a'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xe38d('0x111')](db['Attachment'],{'as':_0xe38d('0x17b'),'onDelete':'cascade'});db[_0xe38d('0x44')]['belongsTo'](db[_0xe38d('0x11')],{'as':_0xe38d('0x11')});db[_0xe38d('0x44')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17c')});db[_0xe38d('0x44')][_0xe38d('0x11e')](db[_0xe38d('0x11b')],{'as':_0xe38d('0x17d'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xe38d('0x11e')](db[_0xe38d('0x3d')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x168')});db['MailMessage'][_0xe38d('0x11e')](db[_0xe38d('0x13a')],{'as':_0xe38d('0x13a'),'foreignKey':'ChatWebsiteId'});db[_0xe38d('0x44')][_0xe38d('0x11e')](db[_0xe38d('0x68')],{'as':_0xe38d('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0xe38d('0x16e')]['belongsTo'](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x16e')][_0xe38d('0x11e')](db['MailQueue'],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x16e')][_0xe38d('0x11e')](db[_0xe38d('0x3d')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x16e')][_0xe38d('0x11e')](db[_0xe38d('0x7f')],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x159')});db[_0xe38d('0x16e')][_0xe38d('0x11e')](db[_0xe38d('0x89')],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x17f')});db[_0xe38d('0x180')][_0xe38d('0x11e')](db[_0xe38d('0x3d')],{});db[_0xe38d('0x180')][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':'ListId'});db[_0xe38d('0x180')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0x180')][_0xe38d('0x11e')](db[_0xe38d('0x11b')],{});db['MailQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x44')],{});db[_0xe38d('0x180')][_0xe38d('0x11e')](db['User'],{});db[_0xe38d('0x180')][_0xe38d('0x11e')](db[_0xe38d('0x3f')],{});db['Dashboard'][_0xe38d('0x111')](db[_0xe38d('0x48')],{'as':_0xe38d('0x181'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x13d')]['hasMany'](db[_0xe38d('0x7b')],{'as':_0xe38d('0x16b'),'foreignKey':_0xe38d('0x182'),'onDelete':'cascade'});db[_0xe38d('0x13d')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xe38d('0x13d')]['hasMany'](db[_0xe38d('0x119')],{'as':_0xe38d('0x16d')});db[_0xe38d('0x13d')][_0xe38d('0x111')](db[_0xe38d('0x4b')],{'as':_0xe38d('0x14c')});db[_0xe38d('0x13d')][_0xe38d('0x111')](db['VoiceExtension'],{'as':_0xe38d('0x183'),'onDelete':'cascade'});db['FaxAccount'][_0xe38d('0x111')](db[_0xe38d('0x184')],{'as':_0xe38d('0x161')});db[_0xe38d('0x13d')][_0xe38d('0x11e')](db[_0xe38d('0x185')],{'as':_0xe38d('0x185')});db[_0xe38d('0x13d')]['belongsTo'](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170')});db[_0xe38d('0x13d')][_0xe38d('0x11e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe38d('0x15b')});db[_0xe38d('0x13d')][_0xe38d('0x121')](db['User'],{'as':'Agents','through':_0xe38d('0x13f')});db[_0xe38d('0x4b')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x4b')]['belongsTo'](db[_0xe38d('0x4e')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x4b')]['belongsTo'](db[_0xe38d('0x13d')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x4b')][_0xe38d('0x11e')](db['Tag'],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x17f')});db[_0xe38d('0x119')][_0xe38d('0x111')](db[_0xe38d('0x184')],{'as':_0xe38d('0x161'),'onDelete':'cascade','foreignKey':_0xe38d('0x186')});db[_0xe38d('0x119')][_0xe38d('0x11e')](db[_0xe38d('0x13d')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x182')});db[_0xe38d('0x119')]['belongsTo'](db[_0xe38d('0x6e')],{'as':'Contact','foreignKey':_0xe38d('0x166')});db[_0xe38d('0x119')][_0xe38d('0x11e')](db['User'],{'as':_0xe38d('0x176'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x119')]['belongsToMany'](db['Tag'],{'through':_0xe38d('0x187'),'as':_0xe38d('0x188')});db[_0xe38d('0x119')][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':'fax_interaction_has_tags','as':_0xe38d('0x178')});db[_0xe38d('0x119')]['belongsToMany'](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'through':_0xe38d('0x12a'),'foreignKey':_0xe38d('0x186')});db[_0xe38d('0x184')]['belongsTo'](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x11')});db[_0xe38d('0x184')][_0xe38d('0x11e')](db[_0xe38d('0x119')],{'as':_0xe38d('0x17d'),'foreignKey':_0xe38d('0x186')});db['FaxMessage']['belongsTo'](db[_0xe38d('0x6e')],{'onDelete':'cascade','as':_0xe38d('0x17c')});db[_0xe38d('0x184')][_0xe38d('0x11e')](db[_0xe38d('0xeb')],{'as':_0xe38d('0xeb'),'foreignKey':_0xe38d('0x189')});db[_0xe38d('0x184')][_0xe38d('0x11e')](db[_0xe38d('0x13d')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x182')});db[_0xe38d('0x4e')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':'UserFaxQueue'});db[_0xe38d('0x4e')][_0xe38d('0x121')](db['Team'],{'through':_0xe38d('0x18a'),'as':_0xe38d('0x15e')});db['FaxQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x13d')],{});db[_0xe38d('0x50')]['belongsTo'](db[_0xe38d('0xf6')],{'as':'List','foreignKey':_0xe38d('0x170')});db['FaxQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':'Contact','foreignKey':_0xe38d('0x166')});db[_0xe38d('0x50')][_0xe38d('0x11e')](db['FaxInteraction'],{});db[_0xe38d('0x50')][_0xe38d('0x11e')](db[_0xe38d('0x184')],{});db[_0xe38d('0x50')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{});db[_0xe38d('0x50')][_0xe38d('0x11e')](db[_0xe38d('0x4e')],{});db[_0xe38d('0x52')]['hasMany'](db[_0xe38d('0x7b')],{'as':'Dispositions','foreignKey':_0xe38d('0x18b'),'onDelete':'cascade'});db[_0xe38d('0x52')]['hasMany'](db[_0xe38d('0x16c')],{'as':_0xe38d('0x18c'),'foreignKey':_0xe38d('0x18b')});db['SmsAccount'][_0xe38d('0x111')](db[_0xe38d('0x18d')],{'as':_0xe38d('0x161'),'foreignKey':_0xe38d('0x18b')});db[_0xe38d('0x52')][_0xe38d('0x111')](db['SmsInteraction'],{'as':_0xe38d('0x16d')});db[_0xe38d('0x52')]['hasMany'](db[_0xe38d('0x54')],{'as':_0xe38d('0x14c')});db[_0xe38d('0x52')][_0xe38d('0x11e')](db['CmList'],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170')});db[_0xe38d('0x52')]['belongsTo'](db[_0xe38d('0x81')],{'as':_0xe38d('0x15a'),'foreignKey':_0xe38d('0x15b')});db[_0xe38d('0x52')]['belongsToMany'](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':_0xe38d('0x145')});db[_0xe38d('0x54')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x54')][_0xe38d('0x11e')](db[_0xe38d('0x135')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x54')][_0xe38d('0x11e')](db[_0xe38d('0x52')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x54')][_0xe38d('0x11e')](db[_0xe38d('0x7f')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xe38d('0x54')][_0xe38d('0x11e')](db[_0xe38d('0x89')],{'onDelete':_0xe38d('0x17e'),'foreignKey':'TagId'});db['SmsInteraction'][_0xe38d('0x111')](db[_0xe38d('0x18d')],{'as':_0xe38d('0x161'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x18e')});db[_0xe38d('0x117')]['belongsTo'](db[_0xe38d('0x52')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x18b')});db[_0xe38d('0x117')]['belongsTo'](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db['SmsInteraction'][_0xe38d('0x11e')](db['User'],{'as':_0xe38d('0x176'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x117')][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':_0xe38d('0x18f'),'as':'Tags'});db[_0xe38d('0x117')]['belongsToMany'](db[_0xe38d('0x89')],{'through':'sms_interaction_has_tags','as':_0xe38d('0x178')});db[_0xe38d('0x117')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'through':'user_has_sms_interactions','foreignKey':_0xe38d('0x18e')});db[_0xe38d('0x18d')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x11')});db[_0xe38d('0x18d')]['belongsTo'](db[_0xe38d('0x6e')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17c')});db['SmsMessage'][_0xe38d('0x11e')](db[_0xe38d('0x117')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17d'),'foreignKey':_0xe38d('0x18e')});db[_0xe38d('0x18d')]['belongsTo'](db[_0xe38d('0x52')],{'as':'Account','foreignKey':_0xe38d('0x18b')});db[_0xe38d('0x135')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':'UserSmsQueue','foreignKey':_0xe38d('0x190')});db[_0xe38d('0x135')]['belongsToMany'](db['Team'],{'through':_0xe38d('0x191'),'as':_0xe38d('0x15e')});db[_0xe38d('0x59')][_0xe38d('0x111')](db['Disposition'],{'as':_0xe38d('0x16b'),'foreignKey':_0xe38d('0x192'),'onDelete':'cascade'});db[_0xe38d('0x59')]['hasMany'](db[_0xe38d('0x16c')],{'as':_0xe38d('0x18c'),'foreignKey':'OpenchannelAccountId'});db[_0xe38d('0x59')][_0xe38d('0x111')](db[_0xe38d('0x115')],{'as':'Interactions','foreignKey':_0xe38d('0x192')});db['OpenchannelAccount'][_0xe38d('0x111')](db[_0xe38d('0x5e')],{'as':_0xe38d('0x161'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xe38d('0x111')](db[_0xe38d('0x5b')],{'as':_0xe38d('0x14c'),'foreignKey':_0xe38d('0x192')});db['OpenchannelAccount'][_0xe38d('0x11e')](db['CmList'],{'as':_0xe38d('0x16f'),'foreignKey':'ListId'});db[_0xe38d('0x59')][_0xe38d('0x11e')](db['Pause'],{'as':_0xe38d('0x15a'),'foreignKey':_0xe38d('0x15b')});db[_0xe38d('0x59')]['belongsToMany'](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':_0xe38d('0x143')});db[_0xe38d('0x5b')]['belongsTo'](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x5b')][_0xe38d('0x11e')](db[_0xe38d('0x137')],{'onDelete':'restrict','foreignKey':_0xe38d('0x193')});db[_0xe38d('0x5b')][_0xe38d('0x11e')](db[_0xe38d('0x59')],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x192')});db[_0xe38d('0x5b')][_0xe38d('0x11e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xe38d('0x159')});db[_0xe38d('0x5b')][_0xe38d('0x11e')](db[_0xe38d('0x89')],{'onDelete':_0xe38d('0x17e'),'foreignKey':'TagId'});db[_0xe38d('0x115')][_0xe38d('0x111')](db['OpenchannelMessage'],{'as':_0xe38d('0x161'),'onDelete':'cascade','foreignKey':_0xe38d('0x194')});db['OpenchannelInteraction'][_0xe38d('0x11e')](db[_0xe38d('0x59')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x192')});db['OpenchannelInteraction'][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db['OpenchannelInteraction'][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x176'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x115')][_0xe38d('0x121')](db['Tag'],{'through':_0xe38d('0x195'),'as':_0xe38d('0x188')});db['OpenchannelInteraction']['belongsToMany'](db[_0xe38d('0x89')],{'through':_0xe38d('0x195'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'through':_0xe38d('0x196'),'foreignKey':_0xe38d('0x194')});db[_0xe38d('0x5e')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x10e'),'as':'User'});db[_0xe38d('0x5e')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17c')});db['OpenchannelMessage'][_0xe38d('0x11e')](db[_0xe38d('0x115')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17d'),'foreignKey':_0xe38d('0x194')});db[_0xe38d('0x5e')]['belongsTo'](db['Attachment'],{'as':_0xe38d('0xeb'),'foreignKey':_0xe38d('0x189')});db['OpenchannelMessage'][_0xe38d('0x11e')](db[_0xe38d('0x59')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x192')});db[_0xe38d('0x137')][_0xe38d('0x121')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0xe38d('0x193')});db[_0xe38d('0x137')][_0xe38d('0x121')](db[_0xe38d('0xe4')],{'through':_0xe38d('0x197'),'as':_0xe38d('0x15e')});db['ChatWebsite'][_0xe38d('0x111')](db[_0xe38d('0x7b')],{'as':_0xe38d('0x16b'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xe38d('0x13a')][_0xe38d('0x111')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe38d('0x198')});db[_0xe38d('0x13a')][_0xe38d('0x111')](db[_0xe38d('0x6c')],{'as':'ProactiveActions'});db['ChatWebsite'][_0xe38d('0x111')](db[_0xe38d('0x116')],{'as':'Interactions'});db[_0xe38d('0x13a')]['hasMany'](db['ChatApplication'],{'as':_0xe38d('0x14c')});db['ChatWebsite']['hasMany'](db[_0xe38d('0x67')],{'as':_0xe38d('0x161')});db[_0xe38d('0x13a')][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':'ListId'});db[_0xe38d('0x13a')][_0xe38d('0x11e')](db['Interval'],{'as':_0xe38d('0x7f'),'foreignKey':_0xe38d('0x159')});db[_0xe38d('0x13a')]['belongsTo'](db[_0xe38d('0x3d')],{'as':_0xe38d('0x3d'),'foreignKey':_0xe38d('0x168')});db[_0xe38d('0x13a')][_0xe38d('0x11e')](db[_0xe38d('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xe38d('0x15b')});db['ChatWebsite'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':'Agents','through':_0xe38d('0x13c')});db[_0xe38d('0x62')][_0xe38d('0x11e')](db[_0xe38d('0x59')],{});db[_0xe38d('0x62')][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':'ListId'});db[_0xe38d('0x62')]['belongsTo'](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db['OpenchannelQueueReport']['belongsTo'](db[_0xe38d('0x115')],{});db[_0xe38d('0x62')][_0xe38d('0x11e')](db[_0xe38d('0x5e')],{});db[_0xe38d('0x62')]['belongsTo'](db[_0xe38d('0x11')],{});db[_0xe38d('0x62')]['belongsTo'](db['OpenchannelQueue'],{});db['ChatApplication'][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x199'),'foreignKey':_0xe38d('0x110'),'onDelete':_0xe38d('0x17e')});db['ChatApplication'][_0xe38d('0x11e')](db['ChatQueue'],{'as':_0xe38d('0x19a'),'foreignKey':_0xe38d('0x19b'),'onDelete':'restrict'});db[_0xe38d('0x64')]['belongsTo'](db[_0xe38d('0x13a')],{'as':_0xe38d('0x19c'),'foreignKey':_0xe38d('0x198'),'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x64')][_0xe38d('0x11e')](db['Tag'],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x17f')});db[_0xe38d('0x116')][_0xe38d('0x111')](db[_0xe38d('0x67')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe38d('0x19d')});db[_0xe38d('0x116')]['belongsTo'](db[_0xe38d('0x13a')],{'as':'Account','foreignKey':_0xe38d('0x198')});db[_0xe38d('0x116')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0x116')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x176'),'foreignKey':_0xe38d('0x110')});db['ChatInteraction'][_0xe38d('0x121')](db['Tag'],{'through':_0xe38d('0x19e'),'as':_0xe38d('0x188')});db[_0xe38d('0x116')]['belongsToMany'](db[_0xe38d('0x89')],{'through':'chat_interaction_has_tags','as':_0xe38d('0x178')});db['ChatInteraction'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'through':_0xe38d('0x129'),'foreignKey':_0xe38d('0x19d')});db['ChatMessage'][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x11')});db[_0xe38d('0x67')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'onDelete':_0xe38d('0x10e'),'as':'Contact','foreignKey':_0xe38d('0x166')});db[_0xe38d('0x67')][_0xe38d('0x11e')](db[_0xe38d('0x116')],{'onDelete':_0xe38d('0x10e'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xe38d('0x67')][_0xe38d('0x11e')](db['Attachment'],{'as':_0xe38d('0xeb'),'foreignKey':_0xe38d('0x189')});db[_0xe38d('0x67')][_0xe38d('0x11e')](db['ChatWebsite'],{'as':_0xe38d('0x175'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xe38d('0x111')](db[_0xe38d('0xeb')],{'as':_0xe38d('0x17b'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xe38d('0x10e'),'hooks':!![]});db[_0xe38d('0x68')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0xe38d('0x68')][_0xe38d('0x11e')](db['ChatWebsite'],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x198')});db[_0xe38d('0x6a')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':'Agents','through':_0xe38d('0x30'),'hooks':!![]});db[_0xe38d('0x6a')][_0xe38d('0x121')](db[_0xe38d('0xe4')],{'through':'team_has_chat_queues','as':_0xe38d('0x15e')});db['ChatGroup'][_0xe38d('0x111')](db['ChatInternalMessage'],{'as':_0xe38d('0x161'),'foreignKey':_0xe38d('0x19f'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x122')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':'Members','through':_0xe38d('0x124')});db[_0xe38d('0x6c')][_0xe38d('0x11e')](db[_0xe38d('0x13a')],{'as':_0xe38d('0x19c'),'foreignKey':_0xe38d('0x198')});db[_0xe38d('0x1a0')]['hasMany'](db[_0xe38d('0x6e')],{'as':_0xe38d('0x1a1'),'foreignKey':_0xe38d('0x1a2')});db[_0xe38d('0x6e')][_0xe38d('0x111')](db[_0xe38d('0x8d')],{'as':_0xe38d('0x1a3'),'foreignKey':_0xe38d('0x1a4')});db[_0xe38d('0x6e')][_0xe38d('0x111')](db[_0xe38d('0x6f')],{'as':_0xe38d('0x153'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0x6e')][_0xe38d('0x111')](db[_0xe38d('0x73')],{'as':_0xe38d('0x114'),'foreignKey':'ContactId'});db['CmContact'][_0xe38d('0x111')](db[_0xe38d('0x75')],{'as':'HopperHistories','foreignKey':_0xe38d('0x166')});db[_0xe38d('0x6e')][_0xe38d('0x111')](db[_0xe38d('0x76')],{'as':_0xe38d('0x76'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0x6e')][_0xe38d('0x111')](db[_0xe38d('0xd4')],{'as':_0xe38d('0x156'),'foreignKey':_0xe38d('0x166')});db['CmContact'][_0xe38d('0x111')](db[_0xe38d('0x115')],{'as':_0xe38d('0x12c'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xe38d('0x6e')]['hasMany'](db[_0xe38d('0x116')],{'as':_0xe38d('0x128'),'foreignKey':_0xe38d('0x166'),'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x6e')][_0xe38d('0x111')](db[_0xe38d('0x117')],{'as':'SmsInteractions','foreignKey':_0xe38d('0x166'),'onDelete':_0xe38d('0x17e')});db['CmContact'][_0xe38d('0x111')](db['FaxInteraction'],{'as':_0xe38d('0x11a'),'foreignKey':_0xe38d('0x166'),'onDelete':_0xe38d('0x17e')});db['CmContact']['hasMany'](db['MailInteraction'],{'as':_0xe38d('0x11c'),'foreignKey':_0xe38d('0x166'),'onDelete':_0xe38d('0x17e')});db['CmContact'][_0xe38d('0x11e')](db['CmCompany'],{'as':_0xe38d('0x1a5'),'foreignKey':_0xe38d('0x1a2')});db[_0xe38d('0x6e')][_0xe38d('0x11e')](db['CmList'],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x6e')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'through':_0xe38d('0x1a6')});db['CmContact'][_0xe38d('0x121')](db['Tag'],{'as':_0xe38d('0x188'),'through':_0xe38d('0x1a7')});db[_0xe38d('0x6e')][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':_0xe38d('0x1a7'),'as':_0xe38d('0x178')});db['CmHopper'][_0xe38d('0x111')](db[_0xe38d('0x1a8')],{'as':_0xe38d('0x1a9'),'foreignKey':'CmHopperId'});db[_0xe38d('0x6f')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x6f')][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170'),'onDelete':'cascade'});db[_0xe38d('0x6f')][_0xe38d('0x11e')](db['User'],{'as':_0xe38d('0x199'),'foreignKey':_0xe38d('0x110')});db[_0xe38d('0x6f')][_0xe38d('0x11e')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xe38d('0x6f')]['belongsTo'](db[_0xe38d('0xe7')],{'as':_0xe38d('0xe7'),'foreignKey':_0xe38d('0x1aa'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x6f')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x176'),'foreignKey':'OwnerId'});db[_0xe38d('0x71')][_0xe38d('0x11e')](db['CmContact'],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166'),'onDelete':_0xe38d('0x10e')});db['CmHopperBlack'][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':'List','foreignKey':'ListId','onDelete':_0xe38d('0x10e')});db[_0xe38d('0x71')]['belongsTo'](db[_0xe38d('0x18')],{'as':'Queue','foreignKey':_0xe38d('0x152'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x71')][_0xe38d('0x11e')](db['Campaign'],{'as':'Campaign','foreignKey':_0xe38d('0x1aa'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0x1ab')]['hasMany'](db[_0xe38d('0x7d')],{'as':{'plural':_0xe38d('0x1ac'),'singular':_0xe38d('0x1ad')},'foreignKey':'AutomationAllId','onDelete':_0xe38d('0x10e'),'hooks':!![]});db[_0xe38d('0x1ab')][_0xe38d('0x111')](db[_0xe38d('0x7d')],{'as':{'plural':_0xe38d('0x1ae'),'singular':_0xe38d('0x1af')},'foreignKey':_0xe38d('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0xe38d('0x1ab')][_0xe38d('0x111')](db[_0xe38d('0x1b1')],{'as':_0xe38d('0x1b2'),'foreignKey':'AutomationId','onDelete':_0xe38d('0x10e'),'hooks':!![]});db[_0xe38d('0x7b')][_0xe38d('0x111')](db['Disposition'],{'as':_0xe38d('0x16b'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xe38d('0x111')](db[_0xe38d('0x7f')],{'as':_0xe38d('0x1b3'),'foreignKey':'IntervalId','onDelete':_0xe38d('0x10e'),'hooks':!![],'required':![]});db[_0xe38d('0x7f')][_0xe38d('0x111')](db[_0xe38d('0x113')],{'as':'Extensions','foreignKey':_0xe38d('0x159'),'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x7f')]['hasMany'](db['MailApplication'],{'as':_0xe38d('0x1b4'),'foreignKey':_0xe38d('0x159')});db[_0xe38d('0x7f')][_0xe38d('0x111')](db[_0xe38d('0x64')],{'as':_0xe38d('0x1b5'),'foreignKey':_0xe38d('0x159')});db[_0xe38d('0x7f')][_0xe38d('0x111')](db[_0xe38d('0x4b')],{'as':_0xe38d('0x1b6'),'foreignKey':'IntervalId'});db[_0xe38d('0x7f')]['hasMany'](db[_0xe38d('0x54')],{'as':_0xe38d('0x1b7'),'foreignKey':_0xe38d('0x159')});db['Schedule']['belongsTo'](db[_0xe38d('0x3d')],{});db[_0xe38d('0x86')][_0xe38d('0x11e')](db[_0xe38d('0x9c')],{'foreignKey':_0xe38d('0x1b8')});db['Schedule'][_0xe38d('0x11e')](db['AnalyticCustomReport'],{'foreignKey':_0xe38d('0x1b9')});db[_0xe38d('0x14e')][_0xe38d('0x121')](db[_0xe38d('0x14d')],{'as':'Mohs','through':_0xe38d('0x150'),'onDelete':_0xe38d('0x17e')});db['Tag'][_0xe38d('0x121')](db[_0xe38d('0x6e')],{'through':_0xe38d('0x1a7')});db['Tag'][_0xe38d('0x121')](db['ChatInteraction'],{'through':_0xe38d('0x19e')});db['Tag'][_0xe38d('0x121')](db['MailInteraction'],{'through':_0xe38d('0x177')});db[_0xe38d('0x89')][_0xe38d('0x121')](db['SmsInteraction'],{'through':_0xe38d('0x18f')});db[_0xe38d('0x89')]['belongsToMany'](db[_0xe38d('0x119')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xe38d('0x121')](db['OpenchannelInteraction'],{'through':_0xe38d('0x195')});db[_0xe38d('0x89')][_0xe38d('0x121')](db[_0xe38d('0x102')],{'through':_0xe38d('0x1ba')});db[_0xe38d('0x8d')]['belongsTo'](db[_0xe38d('0x8b')],{'as':'ItemType','foreignKey':_0xe38d('0x1bb')});db[_0xe38d('0x1a8')][_0xe38d('0x11e')](db[_0xe38d('0x6f')],{'as':'Hopper','foreignKey':_0xe38d('0x1bc')});db[_0xe38d('0x8d')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':'CmContactId'});db['Trigger'][_0xe38d('0x111')](db[_0xe38d('0x7d')],{'as':{'plural':_0xe38d('0x1bd'),'singular':_0xe38d('0x1be')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xe38d('0x92')]['hasMany'](db['Condition'],{'as':{'plural':_0xe38d('0x1bf'),'singular':_0xe38d('0x1c0')},'foreignKey':_0xe38d('0x1c1'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db[_0xe38d('0x1b1')],{'as':_0xe38d('0x1b2'),'foreignKey':_0xe38d('0x1c2'),'onDelete':_0xe38d('0x10e'),'hooks':!![]});db['AnalyticCustomReport'][_0xe38d('0x111')](db[_0xe38d('0xa1')],{'as':_0xe38d('0x1c3'),'onDelete':'cascade','foreignKey':_0xe38d('0x1b9'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xe38d('0xa1')],{'as':_0xe38d('0x1c3'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1b8')});db[_0xe38d('0x9f')][_0xe38d('0x111')](db[_0xe38d('0xa1')],{'as':_0xe38d('0x1c3'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1c4')});db['AnalyticFieldReport'][_0xe38d('0x11e')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xe38d('0x1c5')][_0xe38d('0x111')](db[_0xe38d('0xa5')],{'as':_0xe38d('0x1c6'),'onDelete':'cascade','foreignKey':_0xe38d('0x1c7')});db['SalesforceConfiguration'][_0xe38d('0x111')](db[_0xe38d('0x1c8')],{'as':_0xe38d('0x1c9'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1ca')});db['SalesforceConfiguration'][_0xe38d('0x111')](db[_0xe38d('0x1c8')],{'as':_0xe38d('0x1cb'),'onDelete':'cascade','foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xa5')][_0xe38d('0x111')](db['SalesforceField'],{'as':_0xe38d('0x1c3'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xa5')][_0xe38d('0x11e')](db[_0xe38d('0x1c5')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db['SalesforceField'][_0xe38d('0x111')](db[_0xe38d('0x1c8')],{'as':'Subject','foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0x1c8')]['hasMany'](db[_0xe38d('0x1c8')],{'as':_0xe38d('0x1ce'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0x1c8')][_0xe38d('0x111')](db[_0xe38d('0x1c8')],{'as':_0xe38d('0x1cf'),'foreignKey':'FieldId'});db[_0xe38d('0x1c8')][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':_0xe38d('0x94'),'foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0x1d1')]['hasMany'](db[_0xe38d('0xa7')],{'as':_0xe38d('0x1c6'),'onDelete':_0xe38d('0x10e'),'foreignKey':'AccountId'});db['SugarcrmConfiguration']['hasMany'](db[_0xe38d('0xa9')],{'as':_0xe38d('0x1c9'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xa7')][_0xe38d('0x111')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xa7')][_0xe38d('0x111')](db[_0xe38d('0xa9')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xa7')]['belongsTo'](db['SugarcrmAccount'],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db['SugarcrmField'][_0xe38d('0x111')](db['SugarcrmField'],{'as':_0xe38d('0x1d2'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xa9')][_0xe38d('0x111')](db[_0xe38d('0xa9')],{'as':_0xe38d('0x1ce'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xa9')][_0xe38d('0x111')](db[_0xe38d('0xa9')],{'as':_0xe38d('0x1cf'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xa9')]['belongsTo'](db[_0xe38d('0x94')],{'as':'Variable','foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0xaa')]['hasMany'](db[_0xe38d('0xac')],{'as':'Configurations','onDelete':_0xe38d('0x10e'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xe38d('0x111')](db[_0xe38d('0xae')],{'as':_0xe38d('0x1c9'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xac')][_0xe38d('0x111')](db[_0xe38d('0xae')],{'as':_0xe38d('0x1cb'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xac')][_0xe38d('0x111')](db[_0xe38d('0xae')],{'as':_0xe38d('0x1c3'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xac')][_0xe38d('0x11e')](db[_0xe38d('0xaa')],{'as':'Account','foreignKey':'AccountId'});db[_0xe38d('0xac')][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':_0xe38d('0x1d3')});db[_0xe38d('0xae')]['hasMany'](db[_0xe38d('0xae')],{'as':_0xe38d('0x1d2'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xae')]['hasMany'](db['DeskField'],{'as':'Description','foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xae')]['hasMany'](db[_0xe38d('0xae')],{'as':'Field','foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xae')][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':_0xe38d('0x94'),'foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0x1d4')][_0xe38d('0x111')](db['ZohoConfiguration'],{'as':_0xe38d('0x1c6'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xb1')]['hasMany'](db[_0xe38d('0x1d5')],{'as':_0xe38d('0x1c9'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xb1')][_0xe38d('0x111')](db[_0xe38d('0x1d5')],{'as':'Descriptions','onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xb1')][_0xe38d('0x111')](db['ZohoField'],{'as':_0xe38d('0x1c3'),'onDelete':'cascade','foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xb1')]['belongsTo'](db[_0xe38d('0x1d4')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0x1d5')][_0xe38d('0x111')](db[_0xe38d('0x1d5')],{'as':'Subject','foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0x1d5')][_0xe38d('0x111')](db['ZohoField'],{'as':_0xe38d('0x1ce'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0x1d5')][_0xe38d('0x111')](db[_0xe38d('0x1d5')],{'as':'Field','foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0x1d5')][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':_0xe38d('0x94'),'foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0xb3')][_0xe38d('0x111')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xb5')][_0xe38d('0x111')](db[_0xe38d('0xb7')],{'as':_0xe38d('0x1c9'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xb5')][_0xe38d('0x111')](db['ZendeskField'],{'as':_0xe38d('0x1cb'),'foreignKey':_0xe38d('0x1cc')});db['ZendeskConfiguration'][_0xe38d('0x111')](db[_0xe38d('0xb7')],{'as':_0xe38d('0x1c3'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xb5')][_0xe38d('0x11e')](db[_0xe38d('0xb3')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xb5')][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':_0xe38d('0x1d6')});db['ZendeskField'][_0xe38d('0x111')](db[_0xe38d('0xb7')],{'as':_0xe38d('0x1d2'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xb7')][_0xe38d('0x111')](db[_0xe38d('0xb7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xe38d('0xb7')][_0xe38d('0x111')](db['ZendeskField'],{'as':_0xe38d('0x1cf'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xb7')][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':_0xe38d('0x94'),'foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0x1d7')][_0xe38d('0x111')](db[_0xe38d('0xba')],{'as':_0xe38d('0x1c6'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xba')]['hasMany'](db['FreshdeskField'],{'as':_0xe38d('0x1c9'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xba')][_0xe38d('0x111')](db['FreshdeskField'],{'as':_0xe38d('0x1cb'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xba')][_0xe38d('0x111')](db[_0xe38d('0x1d8')],{'as':_0xe38d('0x1c3'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xba')][_0xe38d('0x11e')](db[_0xe38d('0x1d7')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db['FreshdeskConfiguration'][_0xe38d('0x121')](db[_0xe38d('0x89')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xe38d('0x1d8')][_0xe38d('0x111')](db[_0xe38d('0x1d8')],{'as':_0xe38d('0x1d2'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0x1d8')]['hasMany'](db[_0xe38d('0x1d8')],{'as':_0xe38d('0x1ce'),'foreignKey':'DescriptionId'});db[_0xe38d('0x1d8')][_0xe38d('0x111')](db[_0xe38d('0x1d8')],{'as':'Field','foreignKey':'FieldId'});db['FreshdeskField'][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':_0xe38d('0x94'),'foreignKey':'VariableId'});db[_0xe38d('0xbc')][_0xe38d('0x111')](db[_0xe38d('0xbe')],{'as':_0xe38d('0x1c6'),'onDelete':'cascade','foreignKey':_0xe38d('0x1c7')});db['VtigerConfiguration'][_0xe38d('0x111')](db[_0xe38d('0xc0')],{'as':_0xe38d('0x1c9'),'foreignKey':_0xe38d('0x1ca')});db['VtigerConfiguration'][_0xe38d('0x111')](db[_0xe38d('0xc0')],{'as':_0xe38d('0x1cb'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xbe')][_0xe38d('0x111')](db[_0xe38d('0xc0')],{'as':_0xe38d('0x1c3'),'foreignKey':_0xe38d('0x1cd')});db['VtigerConfiguration'][_0xe38d('0x11e')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xc0')][_0xe38d('0x111')](db['VtigerField'],{'as':_0xe38d('0x1d2'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xc0')]['hasMany'](db[_0xe38d('0xc0')],{'as':'Description','foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xc0')][_0xe38d('0x111')](db[_0xe38d('0xc0')],{'as':_0xe38d('0x1cf'),'foreignKey':'FieldId'});db[_0xe38d('0xc0')][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':'Variable','foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0xc2')]['hasMany'](db[_0xe38d('0x1d9')],{'as':_0xe38d('0x1c6'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0x1d9')]['hasMany'](db[_0xe38d('0x1da')],{'as':_0xe38d('0x1c9'),'foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0x1d9')]['hasMany'](db[_0xe38d('0x1da')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xe38d('0x1d9')]['hasMany'](db[_0xe38d('0x1da')],{'as':_0xe38d('0x1c3'),'foreignKey':'FieldId'});db[_0xe38d('0x1d9')]['belongsTo'](db[_0xe38d('0xc2')],{'as':'Account','foreignKey':_0xe38d('0x1c7')});db['ServicenowField'][_0xe38d('0x111')](db['ServicenowField'],{'as':'Subject','foreignKey':_0xe38d('0x1ca')});db['ServicenowField'][_0xe38d('0x111')](db[_0xe38d('0x1da')],{'as':_0xe38d('0x1ce'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0x1da')]['hasMany'](db[_0xe38d('0x1da')],{'as':'Field','foreignKey':'FieldId'});db[_0xe38d('0x1da')][_0xe38d('0x11e')](db[_0xe38d('0x94')],{'as':_0xe38d('0x94'),'foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0x1db')][_0xe38d('0x111')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1c7')});db['Dynamics365Account'][_0xe38d('0x11e')](db[_0xe38d('0x107')],{'as':'CloudProvider','foreignKey':_0xe38d('0x167')});db['Dynamics365Configuration']['hasMany'](db[_0xe38d('0xc8')],{'as':_0xe38d('0x1c9'),'onDelete':'cascade','foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xc6')][_0xe38d('0x111')](db[_0xe38d('0xc8')],{'as':_0xe38d('0x1cb'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cc')});db[_0xe38d('0xc6')][_0xe38d('0x111')](db['Dynamics365Field'],{'as':_0xe38d('0x1c3'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1cd')});db['Dynamics365Configuration'][_0xe38d('0x11e')](db[_0xe38d('0x1db')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xc8')]['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xc8')][_0xe38d('0x111')](db[_0xe38d('0xc8')],{'as':_0xe38d('0x1ce'),'foreignKey':_0xe38d('0x1cc')});db['Dynamics365Field'][_0xe38d('0x111')](db[_0xe38d('0xc8')],{'as':_0xe38d('0x1cf'),'foreignKey':'FieldId'});db[_0xe38d('0xc8')]['belongsTo'](db[_0xe38d('0x94')],{'as':'Variable','foreignKey':_0xe38d('0x1d0')});db[_0xe38d('0x1dc')][_0xe38d('0x111')](db['FreshsalesConfiguration'],{'as':_0xe38d('0x1c6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe38d('0xca')][_0xe38d('0x111')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0xe38d('0x1ca')});db[_0xe38d('0xca')]['hasMany'](db[_0xe38d('0xcb')],{'as':_0xe38d('0x1cb'),'foreignKey':'DescriptionId'});db[_0xe38d('0xca')][_0xe38d('0x111')](db[_0xe38d('0xcb')],{'as':_0xe38d('0x1c3'),'foreignKey':_0xe38d('0x1cd')});db[_0xe38d('0xca')][_0xe38d('0x11e')](db[_0xe38d('0x1dc')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x1c7')});db[_0xe38d('0xcb')][_0xe38d('0x111')](db[_0xe38d('0xcb')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xe38d('0xcb')][_0xe38d('0x111')](db[_0xe38d('0xcb')],{'as':_0xe38d('0x1ce'),'foreignKey':_0xe38d('0x1cc')});db['FreshsalesField']['hasMany'](db[_0xe38d('0xcb')],{'as':_0xe38d('0x1cf'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xe38d('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0xe38d('0x1d0')});db['ChatQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x13a')],{});db[_0xe38d('0xcd')][_0xe38d('0x11e')](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170')});db[_0xe38d('0xcd')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':'Contact','foreignKey':_0xe38d('0x166')});db[_0xe38d('0xcd')][_0xe38d('0x11e')](db[_0xe38d('0x116')],{});db[_0xe38d('0xcd')][_0xe38d('0x11e')](db[_0xe38d('0x67')],{});db['ChatQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x11')],{});db[_0xe38d('0xcd')]['belongsTo'](db[_0xe38d('0x6a')],{});db[_0xe38d('0xcf')]['belongsTo'](db[_0xe38d('0x11')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xe38d('0xcf')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x1dd')});db['JscriptySessionReport']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xe38d('0x10e')});db[_0xe38d('0xd4')][_0xe38d('0x111')](db['JscriptyAnswerReport'],{'foreignKey':_0xe38d('0x1de'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0xd6')]['belongsTo'](db[_0xe38d('0x52')],{});db['SmsQueueReport']['belongsTo'](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':'ListId'});db[_0xe38d('0xd6')]['belongsTo'](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0xd6')][_0xe38d('0x11e')](db[_0xe38d('0x117')],{});db[_0xe38d('0xd6')][_0xe38d('0x11e')](db[_0xe38d('0x18d')],{});db['SmsQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x11')],{});db['SmsQueueReport']['belongsTo'](db[_0xe38d('0x135')],{});db[_0xe38d('0xdc')][_0xe38d('0x111')](db['JscriptySessionReport'],{'foreignKey':_0xe38d('0x1df')});db[_0xe38d('0xdc')][_0xe38d('0x111')](db[_0xe38d('0xd2')],{'foreignKey':_0xe38d('0x1df')});db[_0xe38d('0xdc')][_0xe38d('0x111')](db[_0xe38d('0x1e0')],{'foreignKey':_0xe38d('0x1df')});db[_0xe38d('0xe0')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'through':'user_has_square_projects'});db[_0xe38d('0xe4')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':_0xe38d('0x127')});db[_0xe38d('0xe4')][_0xe38d('0x121')](db[_0xe38d('0x18')],{'through':_0xe38d('0x109'),'as':_0xe38d('0x12f')});db[_0xe38d('0xe4')][_0xe38d('0x121')](db[_0xe38d('0x3f')],{'through':'team_has_mail_queues','as':_0xe38d('0x132')});db[_0xe38d('0xe4')][_0xe38d('0x121')](db['ChatQueue'],{'through':_0xe38d('0x1e1'),'as':_0xe38d('0x133')});db[_0xe38d('0xe4')][_0xe38d('0x121')](db[_0xe38d('0x4e')],{'through':_0xe38d('0x18a'),'as':'FaxQueues'});db[_0xe38d('0xe4')]['belongsToMany'](db[_0xe38d('0x135')],{'through':'team_has_sms_queues','as':_0xe38d('0x136')});db[_0xe38d('0xe4')][_0xe38d('0x121')](db['OpenchannelQueue'],{'through':_0xe38d('0x197'),'as':_0xe38d('0x138')});db[_0xe38d('0xe4')]['belongsToMany'](db['WhatsappQueue'],{'through':_0xe38d('0x1e2'),'as':'WhatsappQueues'});db[_0xe38d('0xe4')][_0xe38d('0x121')](db[_0xe38d('0xf7')],{'through':_0xe38d('0x1e3'),'as':_0xe38d('0x131')});db[_0xe38d('0xe7')][_0xe38d('0x111')](db[_0xe38d('0x6f')],{'as':_0xe38d('0x153'),'foreignKey':_0xe38d('0x1aa')});db['Campaign']['hasMany'](db[_0xe38d('0x73')],{'as':_0xe38d('0x114'),'foreignKey':'CampaignId'});db[_0xe38d('0xe7')][_0xe38d('0x111')](db[_0xe38d('0x75')],{'as':'HopperHistories','foreignKey':_0xe38d('0x1aa')});db[_0xe38d('0xe7')][_0xe38d('0x111')](db[_0xe38d('0x71')],{'as':_0xe38d('0x155'),'foreignKey':_0xe38d('0x1aa')});db[_0xe38d('0xe7')][_0xe38d('0x11e')](db[_0xe38d('0x185')],{'as':_0xe38d('0x185'),'foreignKey':_0xe38d('0x157')});db[_0xe38d('0xe7')][_0xe38d('0x11e')](db[_0xe38d('0x185')],{'as':'TrunkBackup','foreignKey':_0xe38d('0x158')});db[_0xe38d('0xe7')]['belongsTo'](db[_0xe38d('0x7f')],{'as':_0xe38d('0x7f'),'foreignKey':_0xe38d('0x159')});db[_0xe38d('0xe7')][_0xe38d('0x11e')](db[_0xe38d('0xe0')],{'as':_0xe38d('0xe0'),'foreignKey':_0xe38d('0x1e4')});db[_0xe38d('0xe7')][_0xe38d('0x121')](db['CmList'],{'as':_0xe38d('0x125'),'through':_0xe38d('0x1e5')});db[_0xe38d('0xe7')]['belongsToMany'](db[_0xe38d('0xf6')],{'as':_0xe38d('0x15f'),'through':_0xe38d('0x1e6')});db[_0xe38d('0xeb')]['belongsTo'](db[_0xe38d('0x68')],{'as':'ChatOfflineMessage','foreignKey':_0xe38d('0x1e7')});db[_0xe38d('0x1e8')][_0xe38d('0x11e')](db[_0xe38d('0x44')],{});db['MailTransferReport'][_0xe38d('0x11e')](db[_0xe38d('0x11b')],{});db[_0xe38d('0x1e8')][_0xe38d('0x11e')](db[_0xe38d('0x3d')],{'foreignKey':_0xe38d('0x1e9'),'as':'FromAccount'});db[_0xe38d('0x1e8')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1ea'),'as':'FromAgent'});db[_0xe38d('0x1e8')]['belongsTo'](db[_0xe38d('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xe38d('0x1e8')][_0xe38d('0x11e')](db[_0xe38d('0x3f')],{'foreignKey':_0xe38d('0x1eb'),'as':_0xe38d('0x1ec')});db[_0xe38d('0x1e8')][_0xe38d('0x11e')](db['MailAccount'],{'foreignKey':_0xe38d('0x1ed'),'as':_0xe38d('0x1ee')});db[_0xe38d('0xef')]['belongsTo'](db['ChatMessage'],{});db[_0xe38d('0xef')][_0xe38d('0x11e')](db[_0xe38d('0x116')],{});db[_0xe38d('0xef')]['belongsTo'](db[_0xe38d('0x13a')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0xe38d('0xef')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1ea'),'as':_0xe38d('0x1ef')});db[_0xe38d('0xef')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1f0'),'as':_0xe38d('0x1f1')});db[_0xe38d('0xef')][_0xe38d('0x11e')](db[_0xe38d('0x6a')],{'foreignKey':_0xe38d('0x1f2'),'as':'ToQueue'});db[_0xe38d('0xef')]['belongsTo'](db[_0xe38d('0x13a')],{'foreignKey':'ToChatWebsiteId','as':_0xe38d('0x1ee')});db['FaxTransferReport'][_0xe38d('0x11e')](db['FaxMessage'],{});db['FaxTransferReport'][_0xe38d('0x11e')](db[_0xe38d('0x119')],{});db[_0xe38d('0xf1')][_0xe38d('0x11e')](db[_0xe38d('0x13d')],{'foreignKey':'FromFaxAccountId','as':_0xe38d('0x1f3')});db[_0xe38d('0xf1')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1ea'),'as':_0xe38d('0x1ef')});db[_0xe38d('0xf1')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':'ToUserId','as':_0xe38d('0x1f1')});db[_0xe38d('0xf1')][_0xe38d('0x11e')](db['FaxQueue'],{'foreignKey':_0xe38d('0x1f4'),'as':_0xe38d('0x1ec')});db[_0xe38d('0xf1')][_0xe38d('0x11e')](db[_0xe38d('0x13d')],{'foreignKey':_0xe38d('0x1f5'),'as':_0xe38d('0x1ee')});db[_0xe38d('0x1f6')][_0xe38d('0x11e')](db[_0xe38d('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xe38d('0x115')],{});db[_0xe38d('0x1f6')][_0xe38d('0x11e')](db[_0xe38d('0x59')],{'foreignKey':_0xe38d('0x1f7'),'as':_0xe38d('0x1f3')});db[_0xe38d('0x1f6')]['belongsTo'](db['User'],{'foreignKey':_0xe38d('0x1ea'),'as':_0xe38d('0x1ef')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1f0'),'as':_0xe38d('0x1f1')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe38d('0x137')],{'foreignKey':_0xe38d('0x1f8'),'as':_0xe38d('0x1ec')});db[_0xe38d('0x1f6')][_0xe38d('0x11e')](db[_0xe38d('0x59')],{'foreignKey':_0xe38d('0x1f9'),'as':_0xe38d('0x1ee')});db[_0xe38d('0xf4')][_0xe38d('0x11e')](db[_0xe38d('0x18d')],{});db[_0xe38d('0xf4')][_0xe38d('0x11e')](db[_0xe38d('0x117')],{});db[_0xe38d('0xf4')][_0xe38d('0x11e')](db[_0xe38d('0x52')],{'foreignKey':_0xe38d('0x1fa'),'as':_0xe38d('0x1f3')});db['SmsTransferReport']['belongsTo'](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1ea'),'as':_0xe38d('0x1ef')});db[_0xe38d('0xf4')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1f0'),'as':'ToAgent'});db[_0xe38d('0xf4')][_0xe38d('0x11e')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0xe38d('0x1ec')});db[_0xe38d('0xf4')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xe38d('0x1fb'),'as':'ToAccount'});db[_0xe38d('0xf6')][_0xe38d('0x111')](db['Disposition'],{'as':_0xe38d('0x16b'),'foreignKey':_0xe38d('0x170'),'onDelete':_0xe38d('0x10e')});db['CmList'][_0xe38d('0x111')](db[_0xe38d('0x77')],{'as':'CustomFields','foreignKey':'ListId'});db['CmList'][_0xe38d('0x111')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x1a1'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x170')});db[_0xe38d('0xf6')][_0xe38d('0x111')](db[_0xe38d('0x73')],{'as':_0xe38d('0x114'),'foreignKey':_0xe38d('0x170')});db['CmList'][_0xe38d('0x111')](db[_0xe38d('0x75')],{'as':_0xe38d('0x1fc'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xe38d('0x76')],{'as':_0xe38d('0x76'),'foreignKey':'ListId'});db[_0xe38d('0xf6')][_0xe38d('0x121')](db[_0xe38d('0x18')],{'as':'Queues','through':_0xe38d('0x15c')});db['CmList']['belongsToMany'](db['User'],{'as':'Agents','through':_0xe38d('0x126')});db[_0xe38d('0xf7')][_0xe38d('0x111')](db[_0xe38d('0x113')],{'as':_0xe38d('0x1fd'),'onDelete':'cascade'});db[_0xe38d('0xf7')][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':'Agents','through':_0xe38d('0x10b')});db[_0xe38d('0xf7')][_0xe38d('0x121')](db[_0xe38d('0xe4')],{'through':_0xe38d('0x1e3'),'as':_0xe38d('0x15e')});db[_0xe38d('0x11f')][_0xe38d('0x111')](db[_0xe38d('0x11')],{'as':_0xe38d('0x179'),'foreignKey':_0xe38d('0x120')});db[_0xe38d('0x11f')][_0xe38d('0x111')](db['UserProfileSection'],{'as':_0xe38d('0x1fe'),'foreignKey':_0xe38d('0x120'),'onDelete':_0xe38d('0x10e')});db[_0xe38d('0xfa')][_0xe38d('0x111')](db['UserProfileResource'],{'as':_0xe38d('0x1ff'),'foreignKey':_0xe38d('0x200'),'onDelete':'cascade'});db[_0xe38d('0x146')][_0xe38d('0x111')](db[_0xe38d('0x7b')],{'as':_0xe38d('0x16b'),'foreignKey':_0xe38d('0x201'),'onDelete':'cascade'});db['WhatsappAccount'][_0xe38d('0x111')](db[_0xe38d('0x16c')],{'as':_0xe38d('0x18c'),'foreignKey':_0xe38d('0x201')});db['WhatsappAccount'][_0xe38d('0x111')](db[_0xe38d('0x202')],{'as':_0xe38d('0x161'),'foreignKey':_0xe38d('0x201')});db[_0xe38d('0x146')][_0xe38d('0x111')](db[_0xe38d('0x102')],{'as':_0xe38d('0x16d')});db[_0xe38d('0x146')]['hasMany'](db[_0xe38d('0x100')],{'as':'Applications'});db[_0xe38d('0x146')][_0xe38d('0x11e')](db['CmList'],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170')});db[_0xe38d('0x146')][_0xe38d('0x11e')](db[_0xe38d('0x81')],{'as':_0xe38d('0x15a'),'foreignKey':_0xe38d('0x15b')});db['WhatsappAccount'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':_0xe38d('0x15d'),'through':_0xe38d('0x148')});db[_0xe38d('0x100')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'onDelete':'restrict'});db[_0xe38d('0x100')][_0xe38d('0x11e')](db[_0xe38d('0x203')],{'onDelete':_0xe38d('0x17e')});db['WhatsappApplication'][_0xe38d('0x11e')](db['WhatsappAccount'],{'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x100')]['belongsTo'](db[_0xe38d('0x7f')],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x159')});db['WhatsappApplication'][_0xe38d('0x11e')](db[_0xe38d('0x89')],{'onDelete':_0xe38d('0x17e'),'foreignKey':_0xe38d('0x17f')});db[_0xe38d('0x102')]['hasMany'](db['WhatsappMessage'],{'as':_0xe38d('0x161'),'onDelete':_0xe38d('0x10e'),'foreignKey':_0xe38d('0x204')});db[_0xe38d('0x102')][_0xe38d('0x11e')](db[_0xe38d('0x146')],{'as':'Account','foreignKey':_0xe38d('0x201')});db[_0xe38d('0x102')][_0xe38d('0x11e')](db[_0xe38d('0x6e')],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0x102')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xe38d('0x110')});db[_0xe38d('0x102')]['belongsToMany'](db[_0xe38d('0x89')],{'through':_0xe38d('0x1ba'),'as':'Tags'});db[_0xe38d('0x102')][_0xe38d('0x121')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0xe38d('0x178')});db['WhatsappInteraction'][_0xe38d('0x121')](db[_0xe38d('0x11')],{'as':'Users','through':_0xe38d('0x12e'),'foreignKey':_0xe38d('0x204')});db[_0xe38d('0x202')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':_0xe38d('0x11')});db['WhatsappMessage'][_0xe38d('0x11e')](db['CmContact'],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17c')});db[_0xe38d('0x202')][_0xe38d('0x11e')](db['WhatsappInteraction'],{'onDelete':_0xe38d('0x10e'),'as':_0xe38d('0x17d'),'foreignKey':_0xe38d('0x204')});db[_0xe38d('0x202')][_0xe38d('0x11e')](db[_0xe38d('0x146')],{'as':_0xe38d('0x175'),'foreignKey':_0xe38d('0x201')});db[_0xe38d('0x103')][_0xe38d('0x11e')](db[_0xe38d('0x146')],{});db[_0xe38d('0x103')]['belongsTo'](db[_0xe38d('0xf6')],{'as':_0xe38d('0x16f'),'foreignKey':_0xe38d('0x170')});db['WhatsappQueueReport'][_0xe38d('0x11e')](db['CmContact'],{'as':_0xe38d('0x17c'),'foreignKey':_0xe38d('0x166')});db[_0xe38d('0x103')][_0xe38d('0x11e')](db[_0xe38d('0x102')],{});db['WhatsappQueueReport'][_0xe38d('0x11e')](db[_0xe38d('0x203')],{});db[_0xe38d('0x103')][_0xe38d('0x11e')](db[_0xe38d('0x202')],{});db[_0xe38d('0x103')]['belongsTo'](db[_0xe38d('0x11')],{});db[_0xe38d('0x205')][_0xe38d('0x11e')](db[_0xe38d('0x202')],{});db[_0xe38d('0x205')][_0xe38d('0x11e')](db[_0xe38d('0x102')],{});db[_0xe38d('0x205')][_0xe38d('0x11e')](db[_0xe38d('0x146')],{'foreignKey':_0xe38d('0x206'),'as':_0xe38d('0x1f3')});db['WhatsappTransferReport'][_0xe38d('0x11e')](db[_0xe38d('0x146')],{'foreignKey':'ToWhatsappAccountId','as':_0xe38d('0x1ee')});db[_0xe38d('0x205')]['belongsTo'](db[_0xe38d('0x203')],{'foreignKey':_0xe38d('0x207'),'as':_0xe38d('0x1ec')});db[_0xe38d('0x205')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1ea'),'as':_0xe38d('0x1ef')});db['WhatsappTransferReport'][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'foreignKey':_0xe38d('0x1f0'),'as':_0xe38d('0x1f1')});db[_0xe38d('0x203')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xe38d('0x139'),'foreignKey':_0xe38d('0x208')});db[_0xe38d('0x203')]['belongsToMany'](db['Team'],{'through':_0xe38d('0x1e2'),'as':_0xe38d('0x15e')});db[_0xe38d('0x209')][_0xe38d('0x11e')](db[_0xe38d('0x11')],{'as':'user','foreignKey':_0xe38d('0x110'),'onDelete':_0xe38d('0x10e'),'hooks':!![]});db[_0xe38d('0x107')][_0xe38d('0x10c')](db[_0xe38d('0x1db')],{'as':_0xe38d('0x1db'),'onDelete':_0xe38d('0x17e')});db[_0xe38d('0x107')]['hasOne'](db[_0xe38d('0x39')],{'as':'Imap','onDelete':'restrict'});db[_0xe38d('0x107')]['hasOne'](db[_0xe38d('0x3b')],{'as':'Smtp','onDelete':_0xe38d('0x17e')});module[_0xe38d('0x20a')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x0e0a=['../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','cascade','hasOne','UserSetting','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','UserVoicePrefix','UserMailQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','SpiedAgents','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','UserVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Answers','Messages','Interactions','Applications','List','Template','TemplateId','Pause','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Teams','Account','ContactId','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','ListId','Dispositions','FaxAccountId','FaxApplication','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','IntervalId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','ChatMessage','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Action','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','SugarcrmAccount','VariableId','DeskField','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZohoField','Subjects','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','FromId','SessionId','JscriptyAnswerReport','ProjectId','JscriptyProject','user_has_square_projects','TeamVoiceQueue','VoiceQueues','MailQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromAgent','ToUserId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToQueue','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','database','username','password','options','User','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue'];(function(_0xde93b5,_0x4a8b84){var _0x1e91f5=function(_0x1a3ebb){while(--_0x1a3ebb){_0xde93b5['push'](_0xde93b5['shift']());}};_0x1e91f5(++_0x4a8b84);}(_0x0e0a,0x1b5));var _0xa0e0=function(_0x2264b7,_0x5a3536){_0x2264b7=_0x2264b7-0x0;var _0x22680e=_0x0e0a[_0x2264b7];return _0x22680e;};'use strict';var config=require(_0xa0e0('0x0'));var Sequelize=require(_0xa0e0('0x1'));var _=require(_0xa0e0('0x2'));var jstz=require(_0xa0e0('0x3'));var timezone=jstz['determine']();config[_0xa0e0('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xa0e0('0x4'),'username':_0xa0e0('0x5'),'password':_0xa0e0('0x6'),'options':{'host':_0xa0e0('0x7'),'port':0xcea,'dialect':_0xa0e0('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xa0e0('0x9')](),'define':{'charset':_0xa0e0('0xa'),'collate':_0xa0e0('0xb')}}});config[_0xa0e0('0xc')]=_['defaultsDeep'](config[_0xa0e0('0xc')],{'database':'motion2','username':_0xa0e0('0x5'),'password':_0xa0e0('0x6'),'options':{'host':_0xa0e0('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa0e0('0xd')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xa0e0('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa0e0('0x1')][_0xa0e0('0xe')],config[_0xa0e0('0x1')][_0xa0e0('0xf')],config[_0xa0e0('0x1')][_0xa0e0('0x10')],config[_0xa0e0('0x1')][_0xa0e0('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa0e0('0xc')]['database'],config[_0xa0e0('0xc')][_0xa0e0('0xf')],config[_0xa0e0('0xc')][_0xa0e0('0x10')],config[_0xa0e0('0xc')][_0xa0e0('0x11')])};db[_0xa0e0('0x12')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/user/user.model');db[_0xa0e0('0x14')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xa0e0('0x15')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x16'));db[_0xa0e0('0x17')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0xa0e0('0x18')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x19'));db[_0xa0e0('0x1a')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x1b'));db[_0xa0e0('0x1c')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x1d'));db[_0xa0e0('0x1e')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x1f'));db[_0xa0e0('0x20')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x21'));db[_0xa0e0('0x22')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x23'));db[_0xa0e0('0x24')]=db['sequelize']['import'](_0xa0e0('0x25'));db[_0xa0e0('0x26')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x27'));db[_0xa0e0('0x28')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x29'));db['Trunk']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x2a'));db[_0xa0e0('0x2b')]=db['sequelize'][_0xa0e0('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0xa0e0('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xa0e0('0x2c')]=db['sequelize']['import'](_0xa0e0('0x2d'));db['UserMailQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x2e'));db[_0xa0e0('0x2f')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0xa0e0('0x30')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x31'));db['UserOpenchannelQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x32'));db['UserWhatsappQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x33'));db[_0xa0e0('0x34')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x35'));db[_0xa0e0('0x36')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x37'));db[_0xa0e0('0x38')]=db['sequelize'][_0xa0e0('0x13')]('../api/mailAccount/mailAccount.model');db[_0xa0e0('0x39')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x3a'));db[_0xa0e0('0x3b')]=db[_0xa0e0('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xa0e0('0x3c')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x3d'));db[_0xa0e0('0x3e')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x3f'));db[_0xa0e0('0x40')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x41'));db[_0xa0e0('0x42')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x43'));db[_0xa0e0('0x44')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/dashboard/dashboard.model');db[_0xa0e0('0x45')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x46'));db[_0xa0e0('0x47')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x48'));db['FaxApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/faxApplication/faxApplication.model');db[_0xa0e0('0x49')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x4a'));db[_0xa0e0('0x4b')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x4c'));db['FaxQueue']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x4d'));db['FaxQueueReport']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x4e'));db[_0xa0e0('0x4f')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x50'));db[_0xa0e0('0x51')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/smsApplication/smsApplication.model');db[_0xa0e0('0x52')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x53'));db[_0xa0e0('0x54')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x55'));db[_0xa0e0('0x56')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x57'));db['OpenchannelAccount']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x58'));db['OpenchannelApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x59'));db[_0xa0e0('0x5a')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x5b'));db[_0xa0e0('0x5c')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xa0e0('0x5d')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x5e'));db[_0xa0e0('0x5f')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x60'));db['ChatApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/chatApplication/chatApplication.model');db[_0xa0e0('0x61')]=db[_0xa0e0('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x62'));db[_0xa0e0('0x63')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x64'));db[_0xa0e0('0x65')]=db['sequelize']['import'](_0xa0e0('0x66'));db[_0xa0e0('0x67')]=db['sequelize'][_0xa0e0('0x13')]('../api/chatGroup/chatGroup.model');db[_0xa0e0('0x68')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x69'));db[_0xa0e0('0x6a')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x6b'));db[_0xa0e0('0x6c')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x6d'));db[_0xa0e0('0x6e')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x6f'));db[_0xa0e0('0x70')]=db['sequelize'][_0xa0e0('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa0e0('0x71')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x72'));db[_0xa0e0('0x73')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x74'));db['ReportAgentPreview']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x75'));db[_0xa0e0('0x76')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x77'));db['Action']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x78'));db[_0xa0e0('0x79')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x7a'));db[_0xa0e0('0x7b')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x7c'));db[_0xa0e0('0x7d')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x7e'));db[_0xa0e0('0x7f')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/condition/condition.model');db[_0xa0e0('0x80')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x81'));db['Pause']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/pause/pause.model');db[_0xa0e0('0x82')]=db['sequelize']['import'](_0xa0e0('0x83'));db[_0xa0e0('0x84')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x85'));db[_0xa0e0('0x86')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x87'));db[_0xa0e0('0x88')]=db[_0xa0e0('0x1')]['import']('../api/sound/sound.model');db['Tag']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x89'));db[_0xa0e0('0x8a')]=db['sequelize'][_0xa0e0('0x13')]('../api/contactItemType/contactItemType.model');db[_0xa0e0('0x8b')]=db['sequelize'][_0xa0e0('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x8c'));db['Template']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x8d'));db['Trigger']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x8e'));db[_0xa0e0('0x8f')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x90'));db['Integration']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x91'));db[_0xa0e0('0x92')]=db['sequelize'][_0xa0e0('0x13')]('../api/integrationReport/integrationReport.model');db[_0xa0e0('0x93')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x94'));db[_0xa0e0('0x95')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x96'));db['AnalyticExtractedReport']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x97'));db['AnalyticMetric']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x98'));db[_0xa0e0('0x99')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x9a'));db[_0xa0e0('0x9b')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x9c'));db[_0xa0e0('0x9d')]=db['sequelize']['import'](_0xa0e0('0x9e'));db[_0xa0e0('0x9f')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xa0'));db[_0xa0e0('0xa1')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xa2'));db['SugarcrmAccount']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xa0e0('0xa3')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xa4'));db[_0xa0e0('0xa5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xa0e0('0xa6')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xa7'));db[_0xa0e0('0xa8')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xa9'));db['DeskField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xaa'));db[_0xa0e0('0xab')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xac'));db['ZohoConfiguration']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xad'));db['ZohoField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intZohoField/intZohoField.model');db[_0xa0e0('0xae')]=db['sequelize']['import'](_0xa0e0('0xaf'));db['ZendeskConfiguration']=db['sequelize']['import'](_0xa0e0('0xb0'));db['ZendeskField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xb1'));db[_0xa0e0('0xb2')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xb3'));db[_0xa0e0('0xb4')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xa0e0('0xb5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa0e0('0xb6')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xb7'));db[_0xa0e0('0xb8')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xb9'));db['VtigerField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xba'));db[_0xa0e0('0xbb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xbc'));db[_0xa0e0('0xbd')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xa0e0('0xbe')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xbf'));db[_0xa0e0('0xc0')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xc1'));db[_0xa0e0('0xc2')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xc3'));db[_0xa0e0('0xc4')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xa0e0('0xc5')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xc6'));db[_0xa0e0('0xc7')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xc8'));db[_0xa0e0('0xc9')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xca'));db[_0xa0e0('0xcb')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x91'));db[_0xa0e0('0xcc')]=db[_0xa0e0('0x1')]['import']('../api/network/network.model');db[_0xa0e0('0xcd')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xce'));db['ChatInternalMessage']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xcf'));db['JscriptyAnswerReport']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xd0'));db[_0xa0e0('0xd1')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd2'));db[_0xa0e0('0xd3')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd4'));db[_0xa0e0('0xd5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa0e0('0xd6')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd7'));db[_0xa0e0('0xd8')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd9'));db['JscriptyProject']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xda'));db[_0xa0e0('0xdb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xdc'));db[_0xa0e0('0xdd')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xde'));db[_0xa0e0('0xdf')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xe0'));db[_0xa0e0('0xe1')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xe2'));db[_0xa0e0('0xe3')]=db[_0xa0e0('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0xa0e0('0xe4')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/team/team.model');db[_0xa0e0('0xe5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xe6'));db[_0xa0e0('0xe7')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xe8'));db[_0xa0e0('0xe9')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xea'));db[_0xa0e0('0xeb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xec'));db[_0xa0e0('0xed')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xee'));db['MailTransferReport']=db['sequelize']['import'](_0xa0e0('0xef'));db['ChatTransferReport']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0xa0e0('0xf0')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xa0e0('0xf1')]=db[_0xa0e0('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xa0e0('0xf2')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xf3'));db[_0xa0e0('0xf4')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xf5'));db[_0xa0e0('0xf6')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xf7'));db[_0xa0e0('0xf8')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xf9'));db[_0xa0e0('0xfa')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0xa0e0('0xfb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xfc'));db[_0xa0e0('0xfd')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xfe'));db[_0xa0e0('0xff')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x100'));db['WhatsappApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa0e0('0x101')]=db['sequelize']['import'](_0xa0e0('0x102'));db[_0xa0e0('0x103')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x104'));db[_0xa0e0('0x105')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x106'));db[_0xa0e0('0x107')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x108'));db[_0xa0e0('0x109')]=db['sequelize'][_0xa0e0('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xa0e0('0x10a')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10b'));db['TeamVoiceQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10c'));db[_0xa0e0('0x10d')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10e'));db['UserSetting']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10f'));db[_0xa0e0('0x12')]['hasOne'](db[_0xa0e0('0x1e')],{'as':_0xa0e0('0x1e'),'onDelete':_0xa0e0('0x110'),'foreignKey':'UserId'});db[_0xa0e0('0x12')][_0xa0e0('0x111')](db[_0xa0e0('0x112')],{'as':'userSetting','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x113')});db['User'][_0xa0e0('0x114')](db['VoiceRecording'],{'as':'Recordings','foreignKey':'UserId'});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x115')],{'as':_0xa0e0('0x116'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db['VoiceExtension'],{'as':_0xa0e0('0x117'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db['User'][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x73')],{'as':_0xa0e0('0x119'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x11b')],{'as':_0xa0e0('0x11c'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x61')],{'as':_0xa0e0('0x11d'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db[_0xa0e0('0x52')],{'as':_0xa0e0('0x11e'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xa0e0('0x113')});db['User'][_0xa0e0('0x114')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x11f'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db[_0xa0e0('0x101')],{'as':_0xa0e0('0x120'),'foreignKey':_0xa0e0('0x113')});db['User'][_0xa0e0('0x114')](db[_0xa0e0('0xfd')],{'as':_0xa0e0('0x121'),'foreignKey':_0xa0e0('0x122')});db[_0xa0e0('0x12')][_0xa0e0('0x123')](db[_0xa0e0('0xf8')],{'as':_0xa0e0('0xf8'),'foreignKey':_0xa0e0('0x124')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['ChatGroup'],{'as':_0xa0e0('0x126'),'through':_0xa0e0('0x127')});db[_0xa0e0('0x12')]['belongsToMany'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x128'),'through':_0xa0e0('0x129')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['CmList'],{'as':'Lists','through':_0xa0e0('0x12a')});db['User'][_0xa0e0('0x125')](db['Team'],{'through':_0xa0e0('0x12b')});db['User'][_0xa0e0('0x125')](db['MailInteraction'],{'as':_0xa0e0('0x11f'),'through':_0xa0e0('0x12c')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x61')],{'as':_0xa0e0('0x11d'),'through':_0xa0e0('0x12d')});db[_0xa0e0('0x12')]['belongsToMany'](db[_0xa0e0('0x49')],{'as':_0xa0e0('0x12e'),'through':'user_has_fax_interactions'});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x52')],{'as':_0xa0e0('0x11e'),'through':_0xa0e0('0x12f')});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x11b')],{'as':_0xa0e0('0x11c'),'through':_0xa0e0('0x130')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xa0e0('0x131')});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x132')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User'][_0xa0e0('0x125')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xa0e0('0x133'),'required':![]});db[_0xa0e0('0x12')]['belongsToMany'](db['MailQueue'],{'as':'MailQueues','through':_0xa0e0('0x134'),'required':![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x65')],{'as':_0xa0e0('0x135'),'through':_0xa0e0('0x2c'),'required':![],'hooks':!![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x136')],{'as':_0xa0e0('0x137'),'through':_0xa0e0('0x2f'),'required':![]});db[_0xa0e0('0x12')]['belongsToMany'](db['SmsQueue'],{'as':_0xa0e0('0x138'),'through':_0xa0e0('0x30'),'required':![]});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x5c')],{'as':_0xa0e0('0x139'),'through':_0xa0e0('0x13a'),'required':![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x109')],{'as':_0xa0e0('0x13b'),'through':_0xa0e0('0x13c'),'required':![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'through':'cm_user_has_lists'});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x13d'),'through':_0xa0e0('0x13e')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['FaxAccount'],{'as':_0xa0e0('0x13f'),'through':_0xa0e0('0x140')});db['User']['belongsToMany'](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x141'),'through':'user_has_mail_accounts'});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x142')],{'as':_0xa0e0('0x143'),'through':_0xa0e0('0x144')});db[_0xa0e0('0x12')]['belongsToMany'](db[_0xa0e0('0x4f')],{'as':'SmsAccounts','through':_0xa0e0('0x145')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0xff')],{'as':_0xa0e0('0x146'),'through':'user_has_whatsapp_accounts'});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0xdf')],{'as':_0xa0e0('0x147'),'through':'user_has_square_projects'});db[_0xa0e0('0x14')][_0xa0e0('0x114')](db[_0xa0e0('0x17')],{'as':_0xa0e0('0x148'),'onDelete':_0xa0e0('0x110'),'foreignKey':'ChanSpyId'});db[_0xa0e0('0x15')]['hasMany'](db[_0xa0e0('0x17')],{'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x17')][_0xa0e0('0x114')](db[_0xa0e0('0x17')],{'as':'Applications','onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x18')][_0xa0e0('0x125')](db[_0xa0e0('0x88')],{'as':_0xa0e0('0x149'),'through':_0xa0e0('0x14a')});db[_0xa0e0('0x132')][_0xa0e0('0x114')](db[_0xa0e0('0x115')],{'as':'Members','foreignKey':_0xa0e0('0x14b')});db[_0xa0e0('0x132')]['hasMany'](db['CmHopper'],{'as':_0xa0e0('0x14c'),'foreignKey':_0xa0e0('0x14b')});db[_0xa0e0('0x132')]['hasMany'](db['CmHopperFinal'],{'as':_0xa0e0('0x118'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xa0e0('0x114')](db[_0xa0e0('0x73')],{'as':_0xa0e0('0x14d'),'foreignKey':'VoiceQueueId'});db[_0xa0e0('0x132')]['hasMany'](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':_0xa0e0('0x14b')});db['VoiceQueue']['hasMany'](db[_0xa0e0('0x70')],{'as':_0xa0e0('0x14e'),'foreignKey':_0xa0e0('0x14b')});db[_0xa0e0('0x132')][_0xa0e0('0x114')](db['JscriptySessionReport'],{'as':_0xa0e0('0x14f'),'foreignKey':'VoiceQueueId'});db[_0xa0e0('0x132')][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x150'),'foreignKey':_0xa0e0('0x151')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0xa0e0('0x152'),'foreignKey':'TrunkBackupId'});db[_0xa0e0('0x132')][_0xa0e0('0x123')](db[_0xa0e0('0x80')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xa0e0('0x132')]['belongsTo'](db['Pause'],{'as':_0xa0e0('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x154'),'through':_0xa0e0('0x155')});db[_0xa0e0('0x132')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x157')});db[_0xa0e0('0x132')][_0xa0e0('0x125')](db[_0xa0e0('0xe4')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0xa0e0('0x132')][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x158'),'through':_0xa0e0('0x159')});db[_0xa0e0('0x1a')]['belongsTo'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x1c')]['belongsTo'](db[_0xa0e0('0x12')],{'as':'User','foreignKey':'UserId'});db[_0xa0e0('0x1e')]['hasMany'](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x15a'),'sourceKey':_0xa0e0('0x15b')});db[_0xa0e0('0x20')][_0xa0e0('0x123')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xa0e0('0x15b')});db[_0xa0e0('0x15c')][_0xa0e0('0x114')](db[_0xa0e0('0x26')],{'as':_0xa0e0('0x15d'),'foreignKey':_0xa0e0('0x15e'),'constraints':![]});db[_0xa0e0('0x15c')]['hasMany'](db[_0xa0e0('0x24')],{'as':_0xa0e0('0x15f'),'foreignKey':_0xa0e0('0x15e'),'constraints':![]});db[_0xa0e0('0x15c')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x15c')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x38'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x34')][_0xa0e0('0x123')](db['CloudProvider'],{'as':_0xa0e0('0x10a'),'foreignKey':_0xa0e0('0x161'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x36')][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x38'),'foreignKey':_0xa0e0('0x163')});db[_0xa0e0('0x36')][_0xa0e0('0x123')](db[_0xa0e0('0x10a')],{'as':_0xa0e0('0x10a'),'foreignKey':_0xa0e0('0x161'),'onDelete':'restrict'});db['MailAccount']['hasOne'](db[_0xa0e0('0x34')],{'as':_0xa0e0('0x164'),'onDelete':_0xa0e0('0x110')});db['MailAccount'][_0xa0e0('0x111')](db[_0xa0e0('0x36')],{'as':_0xa0e0('0x165'),'onDelete':'cascade'});db[_0xa0e0('0x38')]['hasMany'](db[_0xa0e0('0x7d')],{'as':'Dispositions','foreignKey':_0xa0e0('0x163'),'onDelete':'cascade'});db[_0xa0e0('0x38')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x38')][_0xa0e0('0x114')](db['MailMessage'],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x163')});db[_0xa0e0('0x38')][_0xa0e0('0x114')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x168')});db['MailAccount'][_0xa0e0('0x114')](db['MailApplication'],{'as':_0xa0e0('0x169')});db[_0xa0e0('0x38')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':'ListId'});db[_0xa0e0('0x38')]['belongsTo'](db[_0xa0e0('0x16b')],{'as':'Template','foreignKey':_0xa0e0('0x16c')});db[_0xa0e0('0x38')]['belongsTo'](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x38')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x16f')});db['MailQueue'][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x134')});db['MailQueue'][_0xa0e0('0x125')](db[_0xa0e0('0xe4')],{'through':_0xa0e0('0x170'),'as':_0xa0e0('0x171')});db['MailInteraction'][_0xa0e0('0x114')](db[_0xa0e0('0x3e')],{'as':_0xa0e0('0x167'),'onDelete':_0xa0e0('0x110'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x172'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x3c')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x3c')]['belongsTo'](db[_0xa0e0('0x12')],{'as':'Owner','foreignKey':_0xa0e0('0x113')});db['MailInteraction'][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':'mail_interaction_has_tags','as':_0xa0e0('0x175')});db[_0xa0e0('0x3c')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x176'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x3c')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':'user_has_mail_interactions','foreignKey':_0xa0e0('0x179')});db[_0xa0e0('0x3e')]['hasMany'](db[_0xa0e0('0xeb')],{'as':_0xa0e0('0x17a'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x160')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x179')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x172'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x5d'),'foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x63')],{'as':_0xa0e0('0x63'),'foreignKey':_0xa0e0('0x17d')});db[_0xa0e0('0x40')][_0xa0e0('0x123')](db['User'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x40')][_0xa0e0('0x123')](db[_0xa0e0('0x39')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x40')][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'onDelete':'restrict'});db[_0xa0e0('0x40')]['belongsTo'](db[_0xa0e0('0x80')],{'onDelete':_0xa0e0('0x162'),'foreignKey':'IntervalId'});db[_0xa0e0('0x40')]['belongsTo'](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x17e')});db['MailQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x42')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0x3c')],{});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0x3e')],{});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db['MailQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x39')],{});db[_0xa0e0('0x44')][_0xa0e0('0x114')](db[_0xa0e0('0x45')],{'as':'Items','onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x47')][_0xa0e0('0x114')](db['Disposition'],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x181'),'onDelete':'cascade'});db[_0xa0e0('0x47')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x181')});db['FaxAccount']['hasMany'](db[_0xa0e0('0x49')],{'as':_0xa0e0('0x168')});db['FaxAccount']['hasMany'](db[_0xa0e0('0x182')],{'as':_0xa0e0('0x169')});db[_0xa0e0('0x47')]['hasMany'](db[_0xa0e0('0x17')],{'as':_0xa0e0('0x183'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x47')][_0xa0e0('0x114')](db[_0xa0e0('0x4b')],{'as':_0xa0e0('0x167')});db['FaxAccount'][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x150')});db[_0xa0e0('0x47')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db['FaxAccount'][_0xa0e0('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x47')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x140')});db[_0xa0e0('0x182')][_0xa0e0('0x123')](db['User'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x182')][_0xa0e0('0x123')](db[_0xa0e0('0x136')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x182')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x182')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa0e0('0x17e')});db[_0xa0e0('0x49')][_0xa0e0('0x114')](db['FaxMessage'],{'as':_0xa0e0('0x167'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x184')});db[_0xa0e0('0x49')][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x181')});db['FaxInteraction'][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':'ContactId'});db[_0xa0e0('0x49')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x49')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':'fax_interaction_has_tags','as':_0xa0e0('0x175')});db[_0xa0e0('0x49')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x186'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x49')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x187'),'foreignKey':_0xa0e0('0x184')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':'cascade','as':_0xa0e0('0x12')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0x49')],{'as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x184')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':'cascade','as':_0xa0e0('0x160')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0xeb')],{'as':'Attachment','foreignKey':_0xa0e0('0x188')});db['FaxMessage'][_0xa0e0('0x123')](db['FaxAccount'],{'as':'Account','foreignKey':_0xa0e0('0x181')});db[_0xa0e0('0x136')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':'Agents','through':_0xa0e0('0x2f')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0xa0e0('0x189'),'as':'Teams'});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{});db['FaxQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':'ListId'});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x49')],{});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x4b')],{});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db['FaxQueue'],{});db['SmsAccount'][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x18b'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x4f')]['hasMany'](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x18b')});db[_0xa0e0('0x4f')]['hasMany'](db[_0xa0e0('0x54')],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x18b')});db[_0xa0e0('0x4f')]['hasMany'](db[_0xa0e0('0x52')],{'as':'Interactions'});db['SmsAccount']['hasMany'](db[_0xa0e0('0x51')],{'as':_0xa0e0('0x169')});db[_0xa0e0('0x4f')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x4f')][_0xa0e0('0x123')](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x4f')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x145')});db['SmsApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x162')});db['SmsApplication'][_0xa0e0('0x123')](db['SmsQueue'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x51')]['belongsTo'](db[_0xa0e0('0x4f')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x51')][_0xa0e0('0x123')](db[_0xa0e0('0x80')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0x51')][_0xa0e0('0x123')](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x17e')});db['SmsInteraction']['hasMany'](db['SmsMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x4f')],{'as':_0xa0e0('0x172'),'foreignKey':'SmsAccountId'});db[_0xa0e0('0x52')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x52')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':'UserId'});db[_0xa0e0('0x52')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x18d'),'as':_0xa0e0('0x175')});db[_0xa0e0('0x52')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x18d'),'as':_0xa0e0('0x177')});db['SmsInteraction'][_0xa0e0('0x125')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0xa0e0('0x18e')});db[_0xa0e0('0x54')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12')});db[_0xa0e0('0x54')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x160')});db['SmsMessage']['belongsTo'](db[_0xa0e0('0x52')],{'onDelete':'cascade','as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x18e')});db[_0xa0e0('0x54')]['belongsTo'](db[_0xa0e0('0x4f')],{'as':_0xa0e0('0x172'),'foreignKey':'SmsAccountId'});db[_0xa0e0('0x56')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x30'),'foreignKey':_0xa0e0('0x18f')});db[_0xa0e0('0x56')][_0xa0e0('0x125')](db['Team'],{'through':_0xa0e0('0x190'),'as':'Teams'});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x191'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x142')]['hasMany'](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db[_0xa0e0('0x11b')],{'as':_0xa0e0('0x168'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db[_0xa0e0('0x192')],{'as':_0xa0e0('0x169'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x123')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xa0e0('0x142')][_0xa0e0('0x123')](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x142')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xa0e0('0x162')});db['OpenchannelApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x5c')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x193')});db['OpenchannelApplication'][_0xa0e0('0x123')](db['OpenchannelAccount'],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x192')]['belongsTo'](db[_0xa0e0('0x80')],{'onDelete':_0xa0e0('0x162'),'foreignKey':'IntervalId'});db[_0xa0e0('0x192')][_0xa0e0('0x123')](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x17e')});db[_0xa0e0('0x11b')]['hasMany'](db[_0xa0e0('0x5a')],{'as':_0xa0e0('0x167'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xa0e0('0x11b')][_0xa0e0('0x123')](db[_0xa0e0('0x142')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x11b')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa0e0('0x11b')][_0xa0e0('0x123')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xa0e0('0x11b')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x194'),'as':_0xa0e0('0x175')});db[_0xa0e0('0x11b')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xa0e0('0x11b')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x130'),'foreignKey':_0xa0e0('0x195')});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db['User'],{'onDelete':_0xa0e0('0x110'),'as':'User'});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db['CmContact'],{'onDelete':'cascade','as':_0xa0e0('0x160')});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db[_0xa0e0('0x11b')],{'onDelete':_0xa0e0('0x110'),'as':'Interaction','foreignKey':_0xa0e0('0x195')});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db[_0xa0e0('0xeb')],{'as':_0xa0e0('0xeb'),'foreignKey':_0xa0e0('0x188')});db['OpenchannelMessage'][_0xa0e0('0x123')](db[_0xa0e0('0x142')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x5c')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x13a'),'foreignKey':_0xa0e0('0x193')});db[_0xa0e0('0x5c')][_0xa0e0('0x125')](db[_0xa0e0('0xe4')],{'through':_0xa0e0('0x196'),'as':_0xa0e0('0x171')});db[_0xa0e0('0x5d')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x5d')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x5d')]['hasMany'](db['ChatProactiveAction'],{'as':_0xa0e0('0x197')});db['ChatWebsite'][_0xa0e0('0x114')](db[_0xa0e0('0x61')],{'as':_0xa0e0('0x168')});db['ChatWebsite']['hasMany'](db[_0xa0e0('0x198')],{'as':_0xa0e0('0x169')});db['ChatWebsite'][_0xa0e0('0x114')](db[_0xa0e0('0x199')],{'as':_0xa0e0('0x167')});db[_0xa0e0('0x5d')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x5d')][_0xa0e0('0x123')](db[_0xa0e0('0x80')],{'as':_0xa0e0('0x80'),'foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0x5d')]['belongsTo'](db[_0xa0e0('0x38')],{'as':'MailAccount','foreignKey':_0xa0e0('0x163')});db[_0xa0e0('0x5d')]['belongsTo'](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x5d')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':'Agents','through':_0xa0e0('0x13e')});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db[_0xa0e0('0x142')],{});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db['CmList'],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x5f')]['belongsTo'](db[_0xa0e0('0x11b')],{});db['OpenchannelQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x5a')],{});db['OpenchannelQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x19a'),'foreignKey':_0xa0e0('0x113'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x198')][_0xa0e0('0x123')](db['ChatQueue'],{'as':_0xa0e0('0x19b'),'foreignKey':_0xa0e0('0x19c'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x198')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0xa0e0('0x17c'),'onDelete':_0xa0e0('0x162')});db['ChatApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':'TagId'});db[_0xa0e0('0x61')][_0xa0e0('0x114')](db[_0xa0e0('0x199')],{'as':_0xa0e0('0x167'),'onDelete':'cascade','foreignKey':_0xa0e0('0x19d')});db['ChatInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':'Account','foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x61')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x61')][_0xa0e0('0x123')](db['User'],{'as':_0xa0e0('0x185'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x61')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x19e'),'as':_0xa0e0('0x175')});db[_0xa0e0('0x61')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x19e'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x61')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':'user_has_chat_interactions','foreignKey':_0xa0e0('0x19d')});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':'cascade','as':_0xa0e0('0x12')});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':'cascade','as':_0xa0e0('0x160'),'foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0xa0e0('0x61')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x19d')});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db['Attachment'],{'as':_0xa0e0('0xeb'),'foreignKey':'AttachmentId'});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x63')][_0xa0e0('0x114')](db['Attachment'],{'as':_0xa0e0('0x17a'),'foreignKey':_0xa0e0('0x17d'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x63')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x63')]['belongsTo'](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x172'),'foreignKey':'ChatWebsiteId'});db[_0xa0e0('0x65')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x2c'),'hooks':!![]});db[_0xa0e0('0x65')]['belongsToMany'](db['Team'],{'through':_0xa0e0('0x19f'),'as':_0xa0e0('0x171')});db['ChatGroup']['hasMany'](db[_0xa0e0('0x1a0')],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x1a1'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x67')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':'Members','through':_0xa0e0('0x127')});db[_0xa0e0('0x68')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x1a2'),'foreignKey':_0xa0e0('0x17c')});db['CmCompany']['hasMany'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x128'),'foreignKey':_0xa0e0('0x1a3')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x8b')],{'as':_0xa0e0('0x1a4'),'foreignKey':_0xa0e0('0x1a5')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x6e')],{'as':_0xa0e0('0x14c'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':'ContactId'});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x73')],{'as':_0xa0e0('0x14d'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':'ContactId'});db[_0xa0e0('0x6c')]['hasMany'](db[_0xa0e0('0xd3')],{'as':_0xa0e0('0x14f'),'foreignKey':'ContactId'});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db['OpenchannelInteraction'],{'as':_0xa0e0('0x11c'),'foreignKey':'ContactId','onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x162')});db['CmContact'][_0xa0e0('0x114')](db[_0xa0e0('0x52')],{'as':_0xa0e0('0x11e'),'foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x162')});db['CmContact'][_0xa0e0('0x114')](db[_0xa0e0('0x49')],{'as':'FaxInteractions','foreignKey':_0xa0e0('0x173'),'onDelete':'restrict'});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x11f'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa0e0('0x6c')][_0xa0e0('0x123')](db[_0xa0e0('0x6a')],{'as':_0xa0e0('0x1a6'),'foreignKey':_0xa0e0('0x1a3')});db[_0xa0e0('0x6c')]['belongsTo'](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db['CmContact']['belongsToMany'](db['User'],{'as':'Users','through':_0xa0e0('0x129')});db[_0xa0e0('0x6c')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'as':_0xa0e0('0x175'),'through':_0xa0e0('0x1a7')});db[_0xa0e0('0x6c')]['belongsToMany'](db[_0xa0e0('0x174')],{'through':'cm_contact_has_tags','as':_0xa0e0('0x177')});db[_0xa0e0('0x6e')][_0xa0e0('0x114')](db[_0xa0e0('0x1a8')],{'as':'AdditionalPhones','foreignKey':_0xa0e0('0x1a9')});db[_0xa0e0('0x6e')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x6e')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f'),'onDelete':_0xa0e0('0x110')});db['CmHopper'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x19a'),'foreignKey':_0xa0e0('0x113')});db['CmHopper'][_0xa0e0('0x123')](db[_0xa0e0('0x132')],{'as':_0xa0e0('0x19b'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xa0e0('0x6e')][_0xa0e0('0x123')](db[_0xa0e0('0xe7')],{'as':_0xa0e0('0xe7'),'foreignKey':_0xa0e0('0x1aa'),'onDelete':_0xa0e0('0x110')});db['CmHopper'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':_0xa0e0('0x1ab')});db[_0xa0e0('0x70')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x110')});db['CmHopperBlack'][_0xa0e0('0x123')](db['CmList'],{'as':_0xa0e0('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xa0e0('0x70')]['belongsTo'](db[_0xa0e0('0x132')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xa0e0('0x70')][_0xa0e0('0x123')](db[_0xa0e0('0xe7')],{'as':_0xa0e0('0xe7'),'foreignKey':_0xa0e0('0x1aa'),'onDelete':'cascade'});db['Automation'][_0xa0e0('0x114')](db[_0xa0e0('0x7f')],{'as':{'plural':'All','singular':_0xa0e0('0x1ac')},'foreignKey':_0xa0e0('0x1ad'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x79')]['hasMany'](db[_0xa0e0('0x7f')],{'as':{'plural':_0xa0e0('0x1ae'),'singular':_0xa0e0('0x1af')},'foreignKey':_0xa0e0('0x1b0'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x79')][_0xa0e0('0x114')](db['Action'],{'as':_0xa0e0('0x1b1'),'foreignKey':_0xa0e0('0x1b2'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x7d')][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x1b3'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x80')][_0xa0e0('0x114')](db[_0xa0e0('0x80')],{'as':_0xa0e0('0x1b4'),'foreignKey':_0xa0e0('0x18c'),'onDelete':_0xa0e0('0x110'),'hooks':!![],'required':![]});db['Interval'][_0xa0e0('0x114')](db[_0xa0e0('0x17')],{'as':'Extensions','foreignKey':_0xa0e0('0x18c'),'onDelete':_0xa0e0('0x162')});db['Interval'][_0xa0e0('0x114')](db[_0xa0e0('0x40')],{'as':_0xa0e0('0x1b5'),'foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0x80')]['hasMany'](db[_0xa0e0('0x198')],{'as':_0xa0e0('0x1b6'),'foreignKey':_0xa0e0('0x18c')});db['Interval'][_0xa0e0('0x114')](db[_0xa0e0('0x182')],{'as':_0xa0e0('0x1b7'),'foreignKey':'IntervalId'});db['Interval'][_0xa0e0('0x114')](db['SmsApplication'],{'as':_0xa0e0('0x1b8'),'foreignKey':'IntervalId'});db[_0xa0e0('0x86')]['belongsTo'](db['MailAccount'],{});db['Schedule'][_0xa0e0('0x123')](db['AnalyticDefaultReport'],{'foreignKey':_0xa0e0('0x1b9')});db[_0xa0e0('0x86')]['belongsTo'](db[_0xa0e0('0x93')],{'foreignKey':_0xa0e0('0x1ba')});db[_0xa0e0('0x88')][_0xa0e0('0x125')](db[_0xa0e0('0x18')],{'as':_0xa0e0('0x1bb'),'through':_0xa0e0('0x14a'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x174')][_0xa0e0('0x125')](db[_0xa0e0('0x6c')],{'through':_0xa0e0('0x1a7')});db['Tag']['belongsToMany'](db[_0xa0e0('0x61')],{'through':_0xa0e0('0x19e')});db[_0xa0e0('0x174')]['belongsToMany'](db[_0xa0e0('0x3c')],{'through':_0xa0e0('0x176')});db['Tag'][_0xa0e0('0x125')](db[_0xa0e0('0x52')],{'through':_0xa0e0('0x18d')});db[_0xa0e0('0x174')][_0xa0e0('0x125')](db[_0xa0e0('0x49')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xa0e0('0x125')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xa0e0('0x174')][_0xa0e0('0x125')](db[_0xa0e0('0x101')],{'through':_0xa0e0('0x1bc')});db[_0xa0e0('0x8b')]['belongsTo'](db[_0xa0e0('0x8a')],{'as':'ItemType','foreignKey':_0xa0e0('0x1bd')});db[_0xa0e0('0x1a8')]['belongsTo'](db['CmHopper'],{'as':_0xa0e0('0x1be'),'foreignKey':_0xa0e0('0x1a9')});db[_0xa0e0('0x8b')][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x1a5')});db[_0xa0e0('0x1bf')][_0xa0e0('0x114')](db[_0xa0e0('0x7f')],{'as':{'plural':'AllConditions','singular':_0xa0e0('0x1c0')},'foreignKey':_0xa0e0('0x1c1'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x1bf')][_0xa0e0('0x114')](db[_0xa0e0('0x7f')],{'as':{'plural':_0xa0e0('0x1c2'),'singular':_0xa0e0('0x1c3')},'foreignKey':'TriggerAnyId','onDelete':_0xa0e0('0x110'),'hooks':!![]});db['Trigger'][_0xa0e0('0x114')](db[_0xa0e0('0x1c4')],{'as':_0xa0e0('0x1b1'),'foreignKey':_0xa0e0('0x1c5'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x93')][_0xa0e0('0x114')](db[_0xa0e0('0x99')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xa0e0('0x114')](db[_0xa0e0('0x99')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':'DefaultReportId'});db[_0xa0e0('0x1c7')][_0xa0e0('0x114')](db['AnalyticFieldReport'],{'as':_0xa0e0('0x1c6'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1c8')});db[_0xa0e0('0x99')][_0xa0e0('0x123')](db[_0xa0e0('0x1c7')],{'foreignKey':_0xa0e0('0x1c8')});db[_0xa0e0('0x9d')][_0xa0e0('0x114')](db['SalesforceConfiguration'],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db['SalesforceConfiguration'][_0xa0e0('0x114')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cb')});db['SalesforceConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1cc'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x9f')]['hasMany'](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0x9f')]['belongsTo'](db[_0xa0e0('0x9d')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db['SalesforceField']['hasMany'](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xa1')][_0xa0e0('0x114')](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xa1')][_0xa0e0('0x114')](db[_0xa0e0('0xa1')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db['SalesforceField'][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':'VariableId'});db[_0xa0e0('0x1d1')][_0xa0e0('0x114')](db[_0xa0e0('0xa3')],{'as':'Configurations','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xa3')][_0xa0e0('0x114')](db[_0xa0e0('0xa5')],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xa3')]['hasMany'](db['SugarcrmField'],{'as':_0xa0e0('0x1cc'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xa3')][_0xa0e0('0x114')](db[_0xa0e0('0xa5')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xa3')][_0xa0e0('0x123')](db[_0xa0e0('0x1d1')],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db[_0xa0e0('0xa5')][_0xa0e0('0x114')](db['SugarcrmField'],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xa5')][_0xa0e0('0x114')](db[_0xa0e0('0xa5')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xa5')]['hasMany'](db[_0xa0e0('0xa5')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xa5')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xa0e0('0x1d2')});db['DeskAccount'][_0xa0e0('0x114')](db[_0xa0e0('0xa8')],{'as':'Configurations','onDelete':_0xa0e0('0x110'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':'SubjectId'});db[_0xa0e0('0xa8')][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':_0xa0e0('0x1cc'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1cd')});db['DeskConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xa8')][_0xa0e0('0x123')](db[_0xa0e0('0xa6')],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db[_0xa0e0('0xa8')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1d4')});db[_0xa0e0('0x1d3')][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa0e0('0x1d3')][_0xa0e0('0x114')](db['DeskField'],{'as':'Description','foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x1d3')][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0x1d3')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':'Variable','foreignKey':'VariableId'});db['ZohoAccount'][_0xa0e0('0x114')](db['ZohoConfiguration'],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1d6')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1d8'),'onDelete':_0xa0e0('0x110'),'foreignKey':'SubjectId'});db[_0xa0e0('0x1d6')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1cc'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x1d6')][_0xa0e0('0x114')](db['ZohoField'],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0x1d6')][_0xa0e0('0x123')](db[_0xa0e0('0xab')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1d7')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0x1d7')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1d0'),'foreignKey':'DescriptionId'});db[_0xa0e0('0x1d7')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0x1d7')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db['ZendeskAccount'][_0xa0e0('0x114')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1d9')]['hasMany'](db[_0xa0e0('0x1da')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xa0e0('0x1d9')][_0xa0e0('0x114')](db['ZendeskField'],{'as':_0xa0e0('0x1cc'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x1d9')][_0xa0e0('0x114')](db[_0xa0e0('0x1da')],{'as':_0xa0e0('0x1c6'),'foreignKey':'FieldId'});db[_0xa0e0('0x1d9')][_0xa0e0('0x123')](db['ZendeskAccount'],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1db')});db[_0xa0e0('0x1da')]['hasMany'](db[_0xa0e0('0x1da')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0x1da')][_0xa0e0('0x114')](db[_0xa0e0('0x1da')],{'as':_0xa0e0('0x1d0'),'foreignKey':'DescriptionId'});db[_0xa0e0('0x1da')][_0xa0e0('0x114')](db[_0xa0e0('0x1da')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db['ZendeskField'][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db[_0xa0e0('0xb2')][_0xa0e0('0x114')](db[_0xa0e0('0xb4')],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':'SubjectId'});db[_0xa0e0('0xb4')][_0xa0e0('0x114')](db[_0xa0e0('0xb5')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xb4')]['hasMany'](db[_0xa0e0('0xb5')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xb4')][_0xa0e0('0x123')](db[_0xa0e0('0xb2')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xb4')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x1dc')});db['FreshdeskField'][_0xa0e0('0x114')](db[_0xa0e0('0xb5')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xb5')][_0xa0e0('0x114')](db[_0xa0e0('0xb5')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xb5')][_0xa0e0('0x114')](db['FreshdeskField'],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0xb5')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':'Variable','foreignKey':_0xa0e0('0x1d2')});db['VtigerAccount'][_0xa0e0('0x114')](db[_0xa0e0('0xb8')],{'as':_0xa0e0('0x1c9'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1ca')});db['VtigerConfiguration'][_0xa0e0('0x114')](db['VtigerField'],{'as':_0xa0e0('0x1d8'),'foreignKey':'SubjectId'});db['VtigerConfiguration']['hasMany'](db[_0xa0e0('0x1dd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xa0e0('0xb8')]['hasMany'](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1c6'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xb8')][_0xa0e0('0x123')](db['VtigerAccount'],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1dd')][_0xa0e0('0x114')](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db['VtigerField'][_0xa0e0('0x114')](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db['VtigerField'][_0xa0e0('0x114')](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0x1dd')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db[_0xa0e0('0xbb')][_0xa0e0('0x114')](db[_0xa0e0('0xbd')],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xbd')]['hasMany'](db[_0xa0e0('0xbe')],{'as':'Subjects','foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xbd')][_0xa0e0('0x114')](db[_0xa0e0('0xbe')],{'as':_0xa0e0('0x1cc'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xbd')][_0xa0e0('0x114')](db['ServicenowField'],{'as':'Fields','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xbd')][_0xa0e0('0x123')](db[_0xa0e0('0xbb')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xbe')][_0xa0e0('0x114')](db['ServicenowField'],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xbe')][_0xa0e0('0x114')](db[_0xa0e0('0xbe')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xbe')][_0xa0e0('0x114')](db[_0xa0e0('0xbe')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0xbe')]['belongsTo'](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':'VariableId'});db[_0xa0e0('0xc0')][_0xa0e0('0x114')](db['Dynamics365Configuration'],{'as':_0xa0e0('0x1c9'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xc0')][_0xa0e0('0x123')](db['CloudProvider'],{'as':_0xa0e0('0x10a'),'foreignKey':'CloudProviderId'});db[_0xa0e0('0xc2')][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1d8'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xc2')][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1cc'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1cd')});db['Dynamics365Configuration'][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1c6'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xc2')]['belongsTo'](db[_0xa0e0('0xc0')],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db['Dynamics365Field']['hasMany'](db[_0xa0e0('0xc4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa0e0('0xc4')]['hasMany'](db[_0xa0e0('0xc4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa0e0('0xc4')][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1d5'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xc4')]['belongsTo'](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db[_0xa0e0('0xc5')][_0xa0e0('0x114')](db[_0xa0e0('0xc7')],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':'AccountId'});db[_0xa0e0('0xc7')][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':_0xa0e0('0x1d8'),'foreignKey':'SubjectId'});db[_0xa0e0('0xc7')][_0xa0e0('0x114')](db['FreshsalesField'],{'as':_0xa0e0('0x1cc'),'foreignKey':_0xa0e0('0x1cd')});db['FreshsalesConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':_0xa0e0('0x1c6'),'foreignKey':'FieldId'});db[_0xa0e0('0xc7')][_0xa0e0('0x123')](db['FreshsalesAccount'],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xc9')][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':'Subject','foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xc9')][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db['FreshsalesField'][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xc9')]['belongsTo'](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':'VariableId'});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{});db[_0xa0e0('0xcd')]['belongsTo'](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db[_0xa0e0('0x61')],{});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db[_0xa0e0('0x12')],{});db['ChatQueueReport']['belongsTo'](db[_0xa0e0('0x65')],{});db[_0xa0e0('0x1a0')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1de')});db[_0xa0e0('0x1a0')]['belongsTo'](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x110'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xa0e0('0x114')](db[_0xa0e0('0xd1')],{'foreignKey':_0xa0e0('0x1df'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0xd3')][_0xa0e0('0x114')](db[_0xa0e0('0x1e0')],{'foreignKey':_0xa0e0('0x1df'),'onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0xa0e0('0x4f')],{});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db[_0xa0e0('0x52')],{});db['SmsQueueReport'][_0xa0e0('0x123')](db['SmsMessage'],{});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db['SmsQueueReport']['belongsTo'](db[_0xa0e0('0x56')],{});db['JscriptyProject'][_0xa0e0('0x114')](db[_0xa0e0('0xd3')],{'foreignKey':_0xa0e0('0x1e1')});db[_0xa0e0('0x1e2')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xa0e0('0x1e2')][_0xa0e0('0x114')](db[_0xa0e0('0x1e0')],{'foreignKey':_0xa0e0('0x1e1')});db[_0xa0e0('0xdf')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x1e3')});db['Team']['belongsToMany'](db['User'],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x12b')});db[_0xa0e0('0xe4')]['belongsToMany'](db[_0xa0e0('0x132')],{'through':_0xa0e0('0x1e4'),'as':_0xa0e0('0x1e5')});db[_0xa0e0('0xe4')]['belongsToMany'](db[_0xa0e0('0x39')],{'through':_0xa0e0('0x170'),'as':_0xa0e0('0x1e6')});db['Team']['belongsToMany'](db[_0xa0e0('0x65')],{'through':'team_has_chat_queues','as':_0xa0e0('0x135')});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x136')],{'through':'team_has_fax_queues','as':_0xa0e0('0x137')});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x56')],{'through':_0xa0e0('0x190'),'as':'SmsQueues'});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x5c')],{'through':_0xa0e0('0x196'),'as':'OpenchannelQueues'});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x109')],{'through':_0xa0e0('0x1e7'),'as':'WhatsappQueues'});db[_0xa0e0('0xe4')]['belongsToMany'](db[_0xa0e0('0xf6')],{'through':_0xa0e0('0x10d'),'as':'VoicePrefixes'});db[_0xa0e0('0xe7')][_0xa0e0('0x114')](db['CmHopper'],{'as':_0xa0e0('0x14c'),'foreignKey':'CampaignId'});db[_0xa0e0('0xe7')][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':_0xa0e0('0x1aa')});db[_0xa0e0('0xe7')][_0xa0e0('0x114')](db['CmHopperHistory'],{'as':_0xa0e0('0x14d'),'foreignKey':_0xa0e0('0x1aa')});db[_0xa0e0('0xe7')]['hasMany'](db[_0xa0e0('0x70')],{'as':_0xa0e0('0x14e'),'foreignKey':'CampaignId'});db[_0xa0e0('0xe7')][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x150'),'foreignKey':_0xa0e0('0x151')});db[_0xa0e0('0xe7')][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x152'),'foreignKey':_0xa0e0('0x1e8')});db[_0xa0e0('0xe7')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0xe7')]['belongsTo'](db[_0xa0e0('0xdf')],{'as':_0xa0e0('0xdf'),'foreignKey':_0xa0e0('0x1e9')});db['Campaign'][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x154'),'through':_0xa0e0('0x1ea')});db['Campaign'][_0xa0e0('0x125')](db['CmList'],{'as':_0xa0e0('0x158'),'through':_0xa0e0('0x1eb')});db['Attachment'][_0xa0e0('0x123')](db[_0xa0e0('0x63')],{'as':_0xa0e0('0x63'),'foreignKey':_0xa0e0('0x17d')});db['MailTransferReport'][_0xa0e0('0x123')](db['MailMessage'],{});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0xa0e0('0x38')],{'foreignKey':'FromMailAccountId','as':_0xa0e0('0x1ed')});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':'FromUserId','as':_0xa0e0('0x1ee')});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1ef'),'as':'ToAgent'});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db[_0xa0e0('0x39')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport']['belongsTo'](db[_0xa0e0('0x38')],{'foreignKey':'ToMailAccountId','as':_0xa0e0('0x1f0')});db[_0xa0e0('0x1f1')][_0xa0e0('0x123')](db[_0xa0e0('0x199')],{});db[_0xa0e0('0x1f1')][_0xa0e0('0x123')](db[_0xa0e0('0x61')],{});db['ChatTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'foreignKey':_0xa0e0('0x1f2'),'as':_0xa0e0('0x1ed')});db[_0xa0e0('0x1f1')]['belongsTo'](db[_0xa0e0('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db['ChatTransferReport'][_0xa0e0('0x123')](db['User'],{'foreignKey':_0xa0e0('0x1ef'),'as':'ToAgent'});db[_0xa0e0('0x1f1')][_0xa0e0('0x123')](db[_0xa0e0('0x65')],{'foreignKey':_0xa0e0('0x1f3'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db[_0xa0e0('0x5d')],{'foreignKey':_0xa0e0('0x1f4'),'as':_0xa0e0('0x1f0')});db['FaxTransferReport'][_0xa0e0('0x123')](db['FaxMessage'],{});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x49')],{});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{'foreignKey':_0xa0e0('0x1f5'),'as':_0xa0e0('0x1ed')});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1f6'),'as':_0xa0e0('0x1ee')});db[_0xa0e0('0xf0')]['belongsTo'](db[_0xa0e0('0x12')],{'foreignKey':'ToUserId','as':_0xa0e0('0x1f7')});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x136')],{'foreignKey':_0xa0e0('0x1f8'),'as':'ToQueue'});db['FaxTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{'foreignKey':_0xa0e0('0x1f9'),'as':_0xa0e0('0x1f0')});db[_0xa0e0('0xf1')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xa0e0('0xf1')][_0xa0e0('0x123')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xa0e0('0x123')](db['OpenchannelAccount'],{'foreignKey':_0xa0e0('0x1fa'),'as':_0xa0e0('0x1ed')});db['OpenchannelTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa0e0('0xf1')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1ef'),'as':_0xa0e0('0x1f7')});db[_0xa0e0('0xf1')][_0xa0e0('0x123')](db[_0xa0e0('0x5c')],{'foreignKey':_0xa0e0('0x1fb'),'as':_0xa0e0('0x1fc')});db[_0xa0e0('0xf1')]['belongsTo'](db[_0xa0e0('0x142')],{'foreignKey':_0xa0e0('0x1fd'),'as':_0xa0e0('0x1f0')});db[_0xa0e0('0xf2')]['belongsTo'](db[_0xa0e0('0x54')],{});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x52')],{});db[_0xa0e0('0xf2')]['belongsTo'](db[_0xa0e0('0x4f')],{'foreignKey':_0xa0e0('0x1fe'),'as':_0xa0e0('0x1ed')});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1f6'),'as':'FromAgent'});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db['User'],{'foreignKey':_0xa0e0('0x1ef'),'as':_0xa0e0('0x1f7')});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x56')],{'foreignKey':'ToSmsQueueId','as':_0xa0e0('0x1fc')});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x4f')],{'foreignKey':_0xa0e0('0x1ff'),'as':_0xa0e0('0x1f0')});db['CmList'][_0xa0e0('0x114')](db['Disposition'],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x17f'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db[_0xa0e0('0x76')],{'as':_0xa0e0('0x200'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db[_0xa0e0('0x6c')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xa0e0('0x17f')});db['CmList'][_0xa0e0('0x114')](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')]['belongsToMany'](db['VoiceQueue'],{'as':_0xa0e0('0x201'),'through':_0xa0e0('0x155')});db[_0xa0e0('0xf4')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x12a')});db[_0xa0e0('0xf6')]['hasMany'](db['VoiceExtension'],{'as':_0xa0e0('0x117'),'onDelete':'cascade'});db[_0xa0e0('0xf6')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':'Agents','through':_0xa0e0('0x133')});db[_0xa0e0('0xf6')]['belongsToMany'](db[_0xa0e0('0xe4')],{'through':'TeamVoicePrefix','as':_0xa0e0('0x171')});db[_0xa0e0('0xf8')][_0xa0e0('0x114')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'foreignKey':_0xa0e0('0x124')});db[_0xa0e0('0xf8')][_0xa0e0('0x114')](db[_0xa0e0('0xfa')],{'as':'UserProfileSections','foreignKey':_0xa0e0('0x124'),'onDelete':_0xa0e0('0x110')});db['UserProfileSection'][_0xa0e0('0x114')](db[_0xa0e0('0xfb')],{'as':'Resources','foreignKey':_0xa0e0('0x202'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x203'),'onDelete':'cascade'});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x203')});db[_0xa0e0('0xff')]['hasMany'](db[_0xa0e0('0x103')],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x203')});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x101')],{'as':_0xa0e0('0x168')});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x204')],{'as':_0xa0e0('0x169')});db[_0xa0e0('0xff')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xff')][_0xa0e0('0x123')](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0xff')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':'user_has_whatsapp_accounts'});db[_0xa0e0('0x204')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x162')});db['WhatsappApplication']['belongsTo'](db[_0xa0e0('0x109')],{'onDelete':'restrict'});db[_0xa0e0('0x204')][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x204')]['belongsTo'](db['Interval'],{'onDelete':_0xa0e0('0x162'),'foreignKey':'IntervalId'});db[_0xa0e0('0x204')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa0e0('0x17e')});db[_0xa0e0('0x101')][_0xa0e0('0x114')](db[_0xa0e0('0x103')],{'as':_0xa0e0('0x167'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x205')});db['WhatsappInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xa0e0('0x101')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db['WhatsappInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':'UserId'});db[_0xa0e0('0x101')]['belongsToMany'](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1bc'),'as':'Tags'});db[_0xa0e0('0x101')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1bc'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x101')][_0xa0e0('0x125')](db['User'],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x131'),'foreignKey':'WhatsappInteractionId'});db[_0xa0e0('0x103')][_0xa0e0('0x123')](db['User'],{'as':_0xa0e0('0x12')});db[_0xa0e0('0x103')]['belongsTo'](db[_0xa0e0('0x6c')],{'onDelete':'cascade','as':_0xa0e0('0x160')});db['WhatsappMessage'][_0xa0e0('0x123')](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa0e0('0x205')});db[_0xa0e0('0x103')]['belongsTo'](db['WhatsappAccount'],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x203')});db['WhatsappQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{});db[_0xa0e0('0x105')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db['WhatsappQueueReport']['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x105')][_0xa0e0('0x123')](db[_0xa0e0('0x101')],{});db['WhatsappQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x109')],{});db[_0xa0e0('0x105')][_0xa0e0('0x123')](db[_0xa0e0('0x103')],{});db[_0xa0e0('0x105')]['belongsTo'](db[_0xa0e0('0x12')],{});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0x103')],{});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db['WhatsappInteraction'],{});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{'foreignKey':_0xa0e0('0x206'),'as':_0xa0e0('0x1ed')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xa0e0('0x207'),'as':_0xa0e0('0x1f0')});db['WhatsappTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x109')],{'foreignKey':_0xa0e0('0x208'),'as':'ToQueue'});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1f6'),'as':_0xa0e0('0x1ee')});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1ef'),'as':'ToAgent'});db[_0xa0e0('0x109')][_0xa0e0('0x125')](db['User'],{'as':_0xa0e0('0x156'),'through':'UserWhatsappQueue','foreignKey':_0xa0e0('0x209')});db['WhatsappQueue']['belongsToMany'](db['Team'],{'through':_0xa0e0('0x1e7'),'as':_0xa0e0('0x171')});db[_0xa0e0('0x112')]['belongsTo'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x20a'),'foreignKey':'UserId','onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x10a')][_0xa0e0('0x111')](db[_0xa0e0('0xc0')],{'as':'Dynamics365Account','onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x10a')][_0xa0e0('0x111')](db[_0xa0e0('0x34')],{'as':_0xa0e0('0x164'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x10a')]['hasOne'](db[_0xa0e0('0x36')],{'as':_0xa0e0('0x165'),'onDelete':_0xa0e0('0x162')});module[_0xa0e0('0x20b')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 88869c3..8ec0ba3 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0156=['./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./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/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/version','/api/system','./api/system','./api/pm2','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields'];(function(_0x5af808,_0x190a84){var _0x552ca9=function(_0x12ce75){while(--_0x12ce75){_0x5af808['push'](_0x5af808['shift']());}};_0x552ca9(++_0x190a84);}(_0x0156,0x68));var _0x6015=function(_0x37ded0,_0x58a30b){_0x37ded0=_0x37ded0-0x0;var _0xc788d8=_0x0156[_0x37ded0];return _0xc788d8;};'use strict';var path=require(_0x6015('0x0'));var express=require(_0x6015('0x1'));var errors=require(_0x6015('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x6015('0x3')];var clientSideLogs=require(_0x6015('0x4'));exports[_0x6015('0x5')]=function(_0x23cc37){return setupLoggers(_0x23cc37)[_0x6015('0x6')](function(){_0x23cc37[_0x6015('0x7')](_0x6015('0x8'),require('./api/user'));_0x23cc37[_0x6015('0x7')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x23cc37[_0x6015('0x7')](_0x6015('0x9'),require(_0x6015('0xa')));_0x23cc37[_0x6015('0x7')]('/api/voice/extensions',require(_0x6015('0xb')));_0x23cc37[_0x6015('0x7')](_0x6015('0xc'),require(_0x6015('0xd')));_0x23cc37[_0x6015('0x7')](_0x6015('0xe'),require(_0x6015('0xf')));_0x23cc37[_0x6015('0x7')]('/api/voice/recordings',require(_0x6015('0x10')));_0x23cc37['use'](_0x6015('0x11'),require(_0x6015('0x12')));_0x23cc37[_0x6015('0x7')](_0x6015('0x13'),require(_0x6015('0x14')));_0x23cc37[_0x6015('0x7')]('/api/voice/mails/messages',require(_0x6015('0x15')));_0x23cc37[_0x6015('0x7')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0x16'),require(_0x6015('0x17')));_0x23cc37[_0x6015('0x7')]('/api/voice/agents/reports',require(_0x6015('0x18')));_0x23cc37[_0x6015('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0x19'),require(_0x6015('0x1a')));_0x23cc37[_0x6015('0x7')](_0x6015('0x1b'),require(_0x6015('0x1c')));_0x23cc37[_0x6015('0x7')](_0x6015('0x1d'),require(_0x6015('0x1e')));_0x23cc37[_0x6015('0x7')](_0x6015('0x1f'),require(_0x6015('0x20')));_0x23cc37[_0x6015('0x7')](_0x6015('0x21'),require(_0x6015('0x22')));_0x23cc37['use']('/api/mail/queues',require(_0x6015('0x23')));_0x23cc37[_0x6015('0x7')](_0x6015('0x24'),require(_0x6015('0x25')));_0x23cc37[_0x6015('0x7')]('/api/mail/interactions',require('./api/mailInteraction'));_0x23cc37[_0x6015('0x7')](_0x6015('0x26'),require(_0x6015('0x27')));_0x23cc37[_0x6015('0x7')](_0x6015('0x28'),require(_0x6015('0x29')));_0x23cc37[_0x6015('0x7')](_0x6015('0x2a'),require(_0x6015('0x2b')));_0x23cc37[_0x6015('0x7')](_0x6015('0x2c'),require(_0x6015('0x2d')));_0x23cc37[_0x6015('0x7')](_0x6015('0x2e'),require('./api/dashboardItem'));_0x23cc37['use'](_0x6015('0x2f'),require(_0x6015('0x30')));_0x23cc37[_0x6015('0x7')](_0x6015('0x31'),require(_0x6015('0x32')));_0x23cc37[_0x6015('0x7')](_0x6015('0x33'),require('./api/faxInteraction'));_0x23cc37[_0x6015('0x7')](_0x6015('0x34'),require(_0x6015('0x35')));_0x23cc37['use'](_0x6015('0x36'),require(_0x6015('0x37')));_0x23cc37[_0x6015('0x7')]('/api/fax/reports/queue',require(_0x6015('0x38')));_0x23cc37[_0x6015('0x7')](_0x6015('0x39'),require(_0x6015('0x3a')));_0x23cc37[_0x6015('0x7')](_0x6015('0x3b'),require('./api/smsApplication'));_0x23cc37['use'](_0x6015('0x3c'),require('./api/smsInteraction'));_0x23cc37[_0x6015('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x23cc37['use']('/api/sms/queues',require(_0x6015('0x3d')));_0x23cc37[_0x6015('0x7')](_0x6015('0x3e'),require(_0x6015('0x3f')));_0x23cc37[_0x6015('0x7')](_0x6015('0x40'),require(_0x6015('0x41')));_0x23cc37['use'](_0x6015('0x42'),require(_0x6015('0x43')));_0x23cc37['use']('/api/openchannel/messages',require('./api/openchannelMessage'));_0x23cc37[_0x6015('0x7')](_0x6015('0x44'),require(_0x6015('0x45')));_0x23cc37['use']('/api/chat/websites',require(_0x6015('0x46')));_0x23cc37[_0x6015('0x7')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x23cc37[_0x6015('0x7')]('/api/chat/applications',require('./api/chatApplication'));_0x23cc37[_0x6015('0x7')](_0x6015('0x47'),require(_0x6015('0x48')));_0x23cc37[_0x6015('0x7')](_0x6015('0x49'),require(_0x6015('0x4a')));_0x23cc37['use'](_0x6015('0x4b'),require(_0x6015('0x4c')));_0x23cc37[_0x6015('0x7')]('/api/chat/queues',require(_0x6015('0x4d')));_0x23cc37['use']('/api/chat/groups',require(_0x6015('0x4e')));_0x23cc37[_0x6015('0x7')]('/api/chat/proactive_actions',require(_0x6015('0x4f')));_0x23cc37[_0x6015('0x7')](_0x6015('0x50'),require(_0x6015('0x51')));_0x23cc37[_0x6015('0x7')](_0x6015('0x52'),require(_0x6015('0x53')));_0x23cc37[_0x6015('0x7')](_0x6015('0x54'),require(_0x6015('0x55')));_0x23cc37[_0x6015('0x7')](_0x6015('0x56'),require(_0x6015('0x57')));_0x23cc37['use']('/api/cm/hopper_final',require(_0x6015('0x58')));_0x23cc37[_0x6015('0x7')](_0x6015('0x59'),require(_0x6015('0x5a')));_0x23cc37[_0x6015('0x7')](_0x6015('0x5b'),require(_0x6015('0x5c')));_0x23cc37[_0x6015('0x7')](_0x6015('0x5d'),require(_0x6015('0x5e')));_0x23cc37[_0x6015('0x7')]('/api/automations',require('./api/automation'));_0x23cc37[_0x6015('0x7')]('/api/canned_answers',require(_0x6015('0x5f')));_0x23cc37[_0x6015('0x7')](_0x6015('0x60'),require(_0x6015('0x61')));_0x23cc37['use'](_0x6015('0x62'),require(_0x6015('0x63')));_0x23cc37[_0x6015('0x7')](_0x6015('0x64'),require(_0x6015('0x65')));_0x23cc37[_0x6015('0x7')](_0x6015('0x66'),require(_0x6015('0x67')));_0x23cc37[_0x6015('0x7')]('/api/cdr',require(_0x6015('0x68')));_0x23cc37[_0x6015('0x7')](_0x6015('0x69'),require(_0x6015('0x6a')));_0x23cc37['use']('/api/schedules',require(_0x6015('0x6b')));_0x23cc37[_0x6015('0x7')](_0x6015('0x6c'),require(_0x6015('0x6d')));_0x23cc37['use'](_0x6015('0x6e'),require('./api/tag'));_0x23cc37[_0x6015('0x7')](_0x6015('0x6f'),require(_0x6015('0x70')));_0x23cc37[_0x6015('0x7')](_0x6015('0x71'),require(_0x6015('0x72')));_0x23cc37[_0x6015('0x7')](_0x6015('0x73'),require(_0x6015('0x74')));_0x23cc37[_0x6015('0x7')](_0x6015('0x75'),require('./api/template'));_0x23cc37['use'](_0x6015('0x76'),require(_0x6015('0x77')));_0x23cc37[_0x6015('0x7')](_0x6015('0x78'),require(_0x6015('0x79')));_0x23cc37[_0x6015('0x7')]('/api/integrations',require(_0x6015('0x7a')));_0x23cc37[_0x6015('0x7')](_0x6015('0x7b'),require('./api/integrationReport'));_0x23cc37[_0x6015('0x7')]('/api/analytics/custom_reports',require(_0x6015('0x7c')));_0x23cc37[_0x6015('0x7')](_0x6015('0x7d'),require('./api/analyticDefaultReport'));_0x23cc37[_0x6015('0x7')]('/api/analytics/extracted_reports',require(_0x6015('0x7e')));_0x23cc37[_0x6015('0x7')](_0x6015('0x7f'),require('./api/analyticMetric'));_0x23cc37[_0x6015('0x7')](_0x6015('0x80'),require(_0x6015('0x81')));_0x23cc37[_0x6015('0x7')](_0x6015('0x82'),require('./api/analyticTreeReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0x83'),require(_0x6015('0x84')));_0x23cc37[_0x6015('0x7')](_0x6015('0x85'),require(_0x6015('0x86')));_0x23cc37[_0x6015('0x7')]('/api/integrations/salesforce/fields',require(_0x6015('0x87')));_0x23cc37[_0x6015('0x7')](_0x6015('0x88'),require(_0x6015('0x89')));_0x23cc37[_0x6015('0x7')](_0x6015('0x8a'),require(_0x6015('0x8b')));_0x23cc37[_0x6015('0x7')](_0x6015('0x8c'),require('./api/intSugarcrmField'));_0x23cc37[_0x6015('0x7')](_0x6015('0x8d'),require(_0x6015('0x8e')));_0x23cc37[_0x6015('0x7')](_0x6015('0x8f'),require(_0x6015('0x90')));_0x23cc37[_0x6015('0x7')](_0x6015('0x91'),require(_0x6015('0x92')));_0x23cc37[_0x6015('0x7')]('/api/integrations/zoho/accounts',require(_0x6015('0x93')));_0x23cc37[_0x6015('0x7')](_0x6015('0x94'),require(_0x6015('0x95')));_0x23cc37[_0x6015('0x7')](_0x6015('0x96'),require('./api/intZohoField'));_0x23cc37[_0x6015('0x7')]('/api/integrations/zendesk/accounts',require(_0x6015('0x97')));_0x23cc37[_0x6015('0x7')]('/api/integrations/zendesk/configurations',require(_0x6015('0x98')));_0x23cc37[_0x6015('0x7')]('/api/integrations/zendesk/fields',require(_0x6015('0x99')));_0x23cc37['use'](_0x6015('0x9a'),require(_0x6015('0x9b')));_0x23cc37[_0x6015('0x7')](_0x6015('0x9c'),require('./api/intFreshdeskConfiguration'));_0x23cc37[_0x6015('0x7')]('/api/integrations/freshdesk/fields',require(_0x6015('0x9d')));_0x23cc37['use'](_0x6015('0x9e'),require(_0x6015('0x9f')));_0x23cc37['use']('/api/integrations/vtiger/configurations',require(_0x6015('0xa0')));_0x23cc37[_0x6015('0x7')](_0x6015('0xa1'),require(_0x6015('0xa2')));_0x23cc37[_0x6015('0x7')](_0x6015('0xa3'),require(_0x6015('0xa4')));_0x23cc37[_0x6015('0x7')](_0x6015('0xa5'),require(_0x6015('0xa6')));_0x23cc37[_0x6015('0x7')](_0x6015('0xa7'),require('./api/intServicenowField'));_0x23cc37[_0x6015('0x7')](_0x6015('0xa8'),require('./api/intDynamics365Account'));_0x23cc37[_0x6015('0x7')](_0x6015('0xa9'),require(_0x6015('0xaa')));_0x23cc37['use'](_0x6015('0xab'),require(_0x6015('0xac')));_0x23cc37[_0x6015('0x7')](_0x6015('0xad'),require('./api/intFreshsalesAccount'));_0x23cc37[_0x6015('0x7')](_0x6015('0xae'),require(_0x6015('0xaf')));_0x23cc37[_0x6015('0x7')]('/api/integrations/freshsales/fields',require(_0x6015('0xb0')));_0x23cc37['use'](_0x6015('0xb1'),require(_0x6015('0xb2')));_0x23cc37[_0x6015('0x7')](_0x6015('0xb3'),require('./api/chatQueueReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0xb4'),require(_0x6015('0xb5')));_0x23cc37[_0x6015('0x7')](_0x6015('0xb6'),require(_0x6015('0xb7')));_0x23cc37[_0x6015('0x7')](_0x6015('0xb8'),require(_0x6015('0xb9')));_0x23cc37[_0x6015('0x7')]('/api/jscripty/sessions/reports',require(_0x6015('0xba')));_0x23cc37[_0x6015('0x7')](_0x6015('0xbb'),require(_0x6015('0xbc')));_0x23cc37['use'](_0x6015('0xbd'),require('./api/squareReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0xbe'),require('./api/squareReportDetail'));_0x23cc37['use']('/api/jscripty/projects',require(_0x6015('0xbf')));_0x23cc37['use'](_0x6015('0xc0'),require(_0x6015('0xc1')));_0x23cc37[_0x6015('0x7')]('/api/square/odbc',require(_0x6015('0xc2')));_0x23cc37[_0x6015('0x7')](_0x6015('0xc3'),require(_0x6015('0xc4')));_0x23cc37['use'](_0x6015('0xc5'),require(_0x6015('0xc6')));_0x23cc37['use'](_0x6015('0xc7'),require(_0x6015('0xc8')));_0x23cc37['use']('/api/teams',require('./api/team'));_0x23cc37['use'](_0x6015('0xc9'),require(_0x6015('0xca')));_0x23cc37[_0x6015('0x7')](_0x6015('0xcb'),require(_0x6015('0xcc')));_0x23cc37['use']('/api/migrations',require(_0x6015('0xcd')));_0x23cc37[_0x6015('0x7')](_0x6015('0xce'),require(_0x6015('0xcf')));_0x23cc37[_0x6015('0x7')]('/api/plugins',require(_0x6015('0xd0')));_0x23cc37[_0x6015('0x7')]('/api/mail/reports/transfer',require(_0x6015('0xd1')));_0x23cc37[_0x6015('0x7')]('/api/chat/reports/transfer',require(_0x6015('0xd2')));_0x23cc37['use'](_0x6015('0xd3'),require('./api/faxTransferReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0xd4'),require('./api/openchannelTransferReport'));_0x23cc37[_0x6015('0x7')](_0x6015('0xd5'),require(_0x6015('0xd6')));_0x23cc37['use']('/api/cm/lists',require(_0x6015('0xd7')));_0x23cc37[_0x6015('0x7')]('/api/voice/prefixes',require(_0x6015('0xd8')));_0x23cc37['use'](_0x6015('0xd9'),require(_0x6015('0xda')));_0x23cc37[_0x6015('0x7')](_0x6015('0xdb'),require(_0x6015('0xdc')));_0x23cc37[_0x6015('0x7')](_0x6015('0xdd'),require(_0x6015('0xde')));_0x23cc37[_0x6015('0x7')](_0x6015('0xdf'),require(_0x6015('0xe0')));_0x23cc37['use'](_0x6015('0xe1'),require('./api/whatsappAccount'));_0x23cc37[_0x6015('0x7')](_0x6015('0xe2'),require(_0x6015('0xe3')));_0x23cc37['use'](_0x6015('0xe4'),require(_0x6015('0xe5')));_0x23cc37['use']('/api/whatsapp/messages',require(_0x6015('0xe6')));_0x23cc37[_0x6015('0x7')](_0x6015('0xe7'),require(_0x6015('0xe8')));_0x23cc37[_0x6015('0x7')](_0x6015('0xe9'),require(_0x6015('0xea')));_0x23cc37[_0x6015('0x7')](_0x6015('0xeb'),require('./api/whatsappQueue'));_0x23cc37[_0x6015('0x7')](_0x6015('0xec'),require(_0x6015('0xed')));_0x23cc37['use'](_0x6015('0xee'),require(_0x6015('0xef')));_0x23cc37[_0x6015('0x7')](_0x6015('0xf0'),require(_0x6015('0xf1')));_0x23cc37[_0x6015('0x7')]('/api/auth/local',require('./api/authLocal'));_0x23cc37[_0x6015('0x7')]('/api/auth/google',require('./api/authGoogle'));_0x23cc37[_0x6015('0x7')](_0x6015('0xf2'),require(_0x6015('0xf3')));_0x23cc37['use'](_0x6015('0xf4'),require(_0x6015('0xf5')));_0x23cc37[_0x6015('0x7')](_0x6015('0xf6'),require('./api/rpc'));_0x23cc37['use']('/api/version',require(_0x6015('0xf7')));_0x23cc37[_0x6015('0x7')](_0x6015('0xf8'),require(_0x6015('0xf9')));_0x23cc37[_0x6015('0x7')]('/api/pm2',require(_0x6015('0xfa')));_0x23cc37[_0x6015('0x7')]('/api/webbar',require('./api/webbar'));_0x23cc37[_0x6015('0x7')](_0x6015('0xfb'),clientSideLogs);_0x23cc37[_0x6015('0x7')](_0x6015('0xfc'),express[_0x6015('0xfd')](path[_0x6015('0xfe')](config[_0x6015('0xff')],_0x6015('0xfc'))));_0x23cc37[_0x6015('0x7')](_0x6015('0x100'),express[_0x6015('0xfd')](path[_0x6015('0xfe')](config['root'],_0x6015('0x100'))));_0x23cc37[_0x6015('0x7')](_0x6015('0x101'),express[_0x6015('0xfd')](path['join'](config[_0x6015('0xff')],_0x6015('0x101'))));_0x23cc37[_0x6015('0x7')](_0x6015('0x102'),express[_0x6015('0xfd')](path[_0x6015('0xfe')](config['root'],'snippet','3.0.0')));_0x23cc37[_0x6015('0x7')](_0x6015('0x103'),express[_0x6015('0xfd')](path[_0x6015('0xfe')](config[_0x6015('0xff')],'/server/files/plugins')));_0x23cc37['route'](_0x6015('0x104'))['get'](errors[0x194]);_0x23cc37['route']('/*')[_0x6015('0x105')](function(_0x538c46,_0x22ac87){_0x22ac87[_0x6015('0x106')](path[_0x6015('0x107')](_0x23cc37['get'](_0x6015('0x108'))+_0x6015('0x109')));});return _0x23cc37;});}; \ No newline at end of file +var _0xb9c7=['./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/cmContactHasItem','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./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/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authActiveDirectory','/api/rpc','./api/rpc','./api/version','./api/system','/api/pm2','/api/webbar','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','default','then','/api/users','use','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals'];(function(_0x23df26,_0x37c0e9){var _0x21a6fc=function(_0x30b976){while(--_0x30b976){_0x23df26['push'](_0x23df26['shift']());}};_0x21a6fc(++_0x37c0e9);}(_0xb9c7,0x19c));var _0x7b9c=function(_0x439f4c,_0x47891a){_0x439f4c=_0x439f4c-0x0;var _0x431d55=_0xb9c7[_0x439f4c];return _0x431d55;};'use strict';var path=require(_0x7b9c('0x0'));var express=require(_0x7b9c('0x1'));var errors=require(_0x7b9c('0x2'));var config=require(_0x7b9c('0x3'));var setupLoggers=require(_0x7b9c('0x4'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x7b9c('0x5')]=function(_0x5b071d){return setupLoggers(_0x5b071d)[_0x7b9c('0x6')](function(){_0x5b071d['use'](_0x7b9c('0x7'),require('./api/user'));_0x5b071d[_0x7b9c('0x8')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9'),require('./api/voiceContext'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xa'),require(_0x7b9c('0xb')));_0x5b071d['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc'),require(_0x7b9c('0xd')));_0x5b071d[_0x7b9c('0x8')]('/api/voice/recordings',require(_0x7b9c('0xe')));_0x5b071d['use'](_0x7b9c('0xf'),require('./api/screenRecording'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x10'),require(_0x7b9c('0x11')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x12'),require(_0x7b9c('0x13')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x14'),require('./api/voiceCallReport'));_0x5b071d[_0x7b9c('0x8')]('/api/voice/dials/reports',require(_0x7b9c('0x15')));_0x5b071d['use'](_0x7b9c('0x16'),require(_0x7b9c('0x17')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x18'),require(_0x7b9c('0x19')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x1a'),require(_0x7b9c('0x1b')));_0x5b071d['use'](_0x7b9c('0x1c'),require(_0x7b9c('0x1d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x1e'),require(_0x7b9c('0x1f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x20'),require('./api/mailServerOut'));_0x5b071d[_0x7b9c('0x8')]('/api/mail/accounts',require(_0x7b9c('0x21')));_0x5b071d[_0x7b9c('0x8')]('/api/mail/queues',require(_0x7b9c('0x22')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x23'),require(_0x7b9c('0x24')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x25'),require(_0x7b9c('0x26')));_0x5b071d[_0x7b9c('0x8')]('/api/mail/messages',require(_0x7b9c('0x27')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x28'),require('./api/mailApplication'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x29'),require(_0x7b9c('0x2a')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x2b'),require(_0x7b9c('0x2c')));_0x5b071d['use'](_0x7b9c('0x2d'),require(_0x7b9c('0x2e')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x2f'),require(_0x7b9c('0x30')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x31'),require(_0x7b9c('0x32')));_0x5b071d[_0x7b9c('0x8')]('/api/fax/interactions',require('./api/faxInteraction'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x33'),require(_0x7b9c('0x34')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x35'),require(_0x7b9c('0x36')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x37'),require(_0x7b9c('0x38')));_0x5b071d['use'](_0x7b9c('0x39'),require(_0x7b9c('0x3a')));_0x5b071d['use']('/api/sms/applications',require(_0x7b9c('0x3b')));_0x5b071d[_0x7b9c('0x8')]('/api/sms/interactions',require(_0x7b9c('0x3c')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x3d'),require(_0x7b9c('0x3e')));_0x5b071d['use'](_0x7b9c('0x3f'),require('./api/smsQueue'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x40'),require('./api/openchannelAccount'));_0x5b071d[_0x7b9c('0x8')]('/api/openchannel/applications',require(_0x7b9c('0x41')));_0x5b071d['use'](_0x7b9c('0x42'),require(_0x7b9c('0x43')));_0x5b071d['use'](_0x7b9c('0x44'),require('./api/openchannelMessage'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x45'),require(_0x7b9c('0x46')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x47'),require(_0x7b9c('0x48')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x49'),require('./api/openchannelQueueReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x4a'),require(_0x7b9c('0x4b')));_0x5b071d['use']('/api/chat/interactions',require(_0x7b9c('0x4c')));_0x5b071d['use']('/api/chat/messages',require(_0x7b9c('0x4d')));_0x5b071d['use'](_0x7b9c('0x4e'),require('./api/chatOfflineMessage'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x4f'),require('./api/chatQueue'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x50'),require('./api/chatGroup'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x51'),require(_0x7b9c('0x52')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x53'),require('./api/cmCompany'));_0x5b071d['use'](_0x7b9c('0x54'),require(_0x7b9c('0x55')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x56'),require('./api/cmHopper'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x57'),require('./api/cmHopperBlack'));_0x5b071d[_0x7b9c('0x8')]('/api/cm/hopper_final',require(_0x7b9c('0x58')));_0x5b071d['use']('/api/cm/hopper_history',require(_0x7b9c('0x59')));_0x5b071d['use']('/api/cm/custom_fields',require(_0x7b9c('0x5a')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x5b'),require('./api/action'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x5c'),require(_0x7b9c('0x5d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x5e'),require(_0x7b9c('0x5f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x60'),require('./api/disposition'));_0x5b071d['use'](_0x7b9c('0x61'),require(_0x7b9c('0x62')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x63'),require(_0x7b9c('0x64')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x65'),require('./api/pause'));_0x5b071d['use'](_0x7b9c('0x66'),require(_0x7b9c('0x67')));_0x5b071d['use'](_0x7b9c('0x68'),require(_0x7b9c('0x69')));_0x5b071d['use'](_0x7b9c('0x6a'),require(_0x7b9c('0x6b')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x6c'),require(_0x7b9c('0x6d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x6e'),require(_0x7b9c('0x6f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x70'),require('./api/contactItemType'));_0x5b071d['use']('/api/cm_contact_has_items',require(_0x7b9c('0x71')));_0x5b071d[_0x7b9c('0x8')]('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x5b071d['use']('/api/templates',require('./api/template'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x72'),require(_0x7b9c('0x73')));_0x5b071d['use'](_0x7b9c('0x74'),require(_0x7b9c('0x75')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations',require(_0x7b9c('0x76')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x77'),require(_0x7b9c('0x78')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x79'),require(_0x7b9c('0x7a')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x7b'),require('./api/analyticDefaultReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x7c'),require(_0x7b9c('0x7d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x7e'),require(_0x7b9c('0x7f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x80'),require(_0x7b9c('0x81')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x82'),require(_0x7b9c('0x83')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/salesforce/accounts',require(_0x7b9c('0x84')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x85'),require('./api/intSalesforceConfiguration'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x86'),require(_0x7b9c('0x87')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x7b9c('0x88')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x89'),require(_0x7b9c('0x8a')));_0x5b071d['use'](_0x7b9c('0x8b'),require(_0x7b9c('0x8c')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x8d'),require(_0x7b9c('0x8e')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x8f'),require(_0x7b9c('0x90')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x91'),require(_0x7b9c('0x92')));_0x5b071d['use'](_0x7b9c('0x93'),require('./api/intZohoAccount'));_0x5b071d['use'](_0x7b9c('0x94'),require(_0x7b9c('0x95')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/zoho/fields',require(_0x7b9c('0x96')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/zendesk/accounts',require(_0x7b9c('0x97')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x98'),require(_0x7b9c('0x99')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9a'),require(_0x7b9c('0x9b')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/freshdesk/accounts',require(_0x7b9c('0x9c')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9d'),require('./api/intFreshdeskConfiguration'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9e'),require('./api/intFreshdeskField'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9f'),require(_0x7b9c('0xa0')));_0x5b071d['use']('/api/integrations/vtiger/configurations',require(_0x7b9c('0xa1')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xa2'),require(_0x7b9c('0xa3')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/servicenow/accounts',require(_0x7b9c('0xa4')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/servicenow/configurations',require(_0x7b9c('0xa5')));_0x5b071d['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x5b071d['use'](_0x7b9c('0xa6'),require(_0x7b9c('0xa7')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/dynamics365/configurations',require(_0x7b9c('0xa8')));_0x5b071d['use'](_0x7b9c('0xa9'),require(_0x7b9c('0xaa')));_0x5b071d['use'](_0x7b9c('0xab'),require('./api/intFreshsalesAccount'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xac'),require('./api/intFreshsalesConfiguration'));_0x5b071d['use']('/api/integrations/freshsales/fields',require(_0x7b9c('0xad')));_0x5b071d[_0x7b9c('0x8')]('/api/networks',require('./api/network'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xae'),require(_0x7b9c('0xaf')));_0x5b071d[_0x7b9c('0x8')]('/api/chat/internal/messages',require(_0x7b9c('0xb0')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xb1'),require(_0x7b9c('0xb2')));_0x5b071d[_0x7b9c('0x8')]('/api/jscripty/questions/reports',require(_0x7b9c('0xb3')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xb4'),require(_0x7b9c('0xb5')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xb6'),require(_0x7b9c('0xb7')));_0x5b071d[_0x7b9c('0x8')]('/api/square/reports',require(_0x7b9c('0xb8')));_0x5b071d[_0x7b9c('0x8')]('/api/square/details/reports',require(_0x7b9c('0xb9')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xba'),require(_0x7b9c('0xbb')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xbc'),require('./api/setting'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xbd'),require(_0x7b9c('0xbe')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xbf'),require(_0x7b9c('0xc0')));_0x5b071d[_0x7b9c('0x8')]('/api/square/recordings',require(_0x7b9c('0xc1')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc2'),require('./api/squareMessage'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc3'),require(_0x7b9c('0xc4')));_0x5b071d[_0x7b9c('0x8')]('/api/license',require('./api/license'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc5'),require(_0x7b9c('0xc6')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc7'),require(_0x7b9c('0xc8')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc9'),require(_0x7b9c('0xca')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xcb'),require('./api/plugin'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xcc'),require(_0x7b9c('0xcd')));_0x5b071d['use'](_0x7b9c('0xce'),require('./api/chatTransferReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xcf'),require(_0x7b9c('0xd0')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd1'),require('./api/openchannelTransferReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd2'),require(_0x7b9c('0xd3')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd4'),require('./api/cmList'));_0x5b071d['use']('/api/voice/prefixes',require(_0x7b9c('0xd5')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd6'),require(_0x7b9c('0xd7')));_0x5b071d['use'](_0x7b9c('0xd8'),require('./api/userProfileSection'));_0x5b071d[_0x7b9c('0x8')]('/api/userProfile/resources',require(_0x7b9c('0xd9')));_0x5b071d['use'](_0x7b9c('0xda'),require('./api/userNotification'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xdb'),require('./api/whatsappAccount'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xdc'),require('./api/whatsappApplication'));_0x5b071d[_0x7b9c('0x8')]('/api/whatsapp/interactions',require(_0x7b9c('0xdd')));_0x5b071d['use']('/api/whatsapp/messages',require(_0x7b9c('0xde')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xdf'),require(_0x7b9c('0xe0')));_0x5b071d[_0x7b9c('0x8')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xe1'),require(_0x7b9c('0xe2')));_0x5b071d['use']('/api/cloudProviders',require(_0x7b9c('0xe3')));_0x5b071d[_0x7b9c('0x8')]('/api/realtime',require(_0x7b9c('0xe4')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xe5'),require(_0x7b9c('0xe6')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xe7'),require('./api/authLocal'));_0x5b071d[_0x7b9c('0x8')]('/api/auth/google',require('./api/authGoogle'));_0x5b071d[_0x7b9c('0x8')]('/api/auth/activedirectory',require(_0x7b9c('0xe8')));_0x5b071d[_0x7b9c('0x8')]('/api/jira',require('./api/jira'));_0x5b071d['use'](_0x7b9c('0xe9'),require(_0x7b9c('0xea')));_0x5b071d['use']('/api/version',require(_0x7b9c('0xeb')));_0x5b071d[_0x7b9c('0x8')]('/api/system',require(_0x7b9c('0xec')));_0x5b071d['use'](_0x7b9c('0xed'),require('./api/pm2'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xee'),require('./api/webbar'));_0x5b071d[_0x7b9c('0x8')]('/api/logs',clientSideLogs);_0x5b071d['use'](_0x7b9c('0xef'),express[_0x7b9c('0xf0')](path[_0x7b9c('0xf1')](config['root'],_0x7b9c('0xef'))));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xf2'),express['static'](path[_0x7b9c('0xf1')](config[_0x7b9c('0xf3')],_0x7b9c('0xf2'))));_0x5b071d['use'](_0x7b9c('0xf4'),express['static'](path[_0x7b9c('0xf1')](config['root'],_0x7b9c('0xf4'))));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xf5'),express[_0x7b9c('0xf0')](path[_0x7b9c('0xf1')](config[_0x7b9c('0xf3')],_0x7b9c('0xf6'),_0x7b9c('0xf7'))));_0x5b071d['use'](_0x7b9c('0xf8'),express[_0x7b9c('0xf0')](path[_0x7b9c('0xf1')](config[_0x7b9c('0xf3')],_0x7b9c('0xf9'))));_0x5b071d[_0x7b9c('0xfa')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x7b9c('0xfb')](errors[0x194]);_0x5b071d[_0x7b9c('0xfa')]('/*')['get'](function(_0x414c7d,_0x1ba434){_0x1ba434[_0x7b9c('0xfc')](path[_0x7b9c('0xfd')](_0x5b071d[_0x7b9c('0xfb')](_0x7b9c('0xfe'))+_0x7b9c('0xff')));});return _0x5b071d;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 03fb2c4..779ca10 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf81=['../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','port','rpc','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/mailServerIn/mailServerIn.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/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xdf81,0x92));var _0x1df8=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xdf81[_0x476bf4];return _0x788ffe;};'use strict';var jayson=require('jayson/promise');var _=require(_0x1df8('0x0'));var config=require(_0x1df8('0x1'));exports[_0x1df8('0x2')]=function(){return new Promise(function(_0x2e5055,_0x3b4579){var _0x4aac3e={};_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x3')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x5')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x6')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x7')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4aac3e=_['merge'](_0x4aac3e,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x8')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/memberReport/memberReport.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/trunk/trunk.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x9')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0xa')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0xb')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/mailInteraction/mailInteraction.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0xc')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0xd')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0xe')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0xf')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x10')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x11')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x12')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4aac3e=_['merge'](_0x4aac3e,require('../api/smsAccount/smsAccount.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x13')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x14')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x15')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x16')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x17')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x18')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x19')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x1a')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x1b')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x1c')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x1d')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x1e')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x1f')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x20')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x21')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x22')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x23')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x24')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x25')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x26')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x27')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/variable/variable.rpc'));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x28')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x29')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x2a')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x2b')));_0x4aac3e=_['merge'](_0x4aac3e,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x2c')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x2d')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x2e')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x2f')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x30')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x31')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x32')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x33')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/setting/setting.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x34')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x35')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x36')));_0x4aac3e=_['merge'](_0x4aac3e,require(_0x1df8('0x37')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/campaign/campaign.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require('../api/attachment/attachment.rpc'));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x38')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x39')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x3a')));_0x4aac3e=_[_0x1df8('0x4')](_0x4aac3e,require(_0x1df8('0x3b')));_0x4aac3e=_['merge'](_0x4aac3e,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4aac3e=_['merge'](_0x4aac3e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3c46bb=jayson['server'](_0x4aac3e)['http']();var _0x2c33e4=config['rpc']['port']||config[_0x1df8('0x3c')]+0x1;var _0x26824e=config[_0x1df8('0x3d')]['ip']||'localhost';_0x3c46bb['on']('error',function(_0x388583){return _0x3b4579(_0x388583);});_0x3c46bb[_0x1df8('0x2')](_0x2c33e4,_0x26824e,function(){console[_0x1df8('0x3e')](_0x1df8('0x3f'),_0x26824e,_0x2c33e4);require(_0x1df8('0x40'))[_0x1df8('0x41')]();return _0x2e5055('RPC\x20listening\x20on\x20'+_0x26824e+':'+_0x2c33e4);});});}; \ No newline at end of file +var _0xb815=['../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/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/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb815,0x160));var _0x5b81=function(_0x2e1810,_0x38e361){_0x2e1810=_0x2e1810-0x0;var _0x80139f=_0xb815[_0x2e1810];return _0x80139f;};'use strict';var jayson=require(_0x5b81('0x0'));var _=require(_0x5b81('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x2ec5d4,_0x5ae6ff){var _0x3cab0b={};_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/voiceExtension/voiceExtension.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x4')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x5')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x6')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x7')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x8')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x9')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/memberReport/memberReport.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xa')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0xb')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xc')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0xd')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xe')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xf')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x10')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x11')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x12')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x13')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x14')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x15')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x16')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x17')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x18')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x19')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x1a')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x1b')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1c')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1d')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1e')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1f')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x20')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x21')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x22')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/chatInteraction/chatInteraction.rpc'));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x23')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x24')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x25')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x26')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x27')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x28')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x29')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x2a')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2b')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2c')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2d')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2e')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2f')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x30')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x31')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x32')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x33')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x34')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x35')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x36')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x37')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x38')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x39')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3a')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x3b')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3c')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3d')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3e')));_0x3cab0b=_['merge'](_0x3cab0b,require('../api/attachment/attachment.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3f')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x40')));_0x3cab0b=_['merge'](_0x3cab0b,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x41')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x42')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x301280=jayson[_0x5b81('0x43')](_0x3cab0b)['http']();var _0x486035=config['rpc']['port']||config['port']+0x1;var _0x8e449c=config[_0x5b81('0x44')]['ip']||'localhost';_0x301280['on']('error',function(_0x367ee9){return _0x5ae6ff(_0x367ee9);});_0x301280[_0x5b81('0x45')](_0x486035,_0x8e449c,function(){console['log'](_0x5b81('0x46'),_0x8e449c,_0x486035);require(_0x5b81('0x47'))['default']();return _0x2ec5d4(_0x5b81('0x48')+_0x8e449c+':'+_0x486035);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0e794b2..ff59f11 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 _0xfb0b=['events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','substr','indexOf','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe','destroy','inherits','prototype','command','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash'];(function(_0x456f35,_0x124842){var _0x2e65dd=function(_0x39e30c){while(--_0x39e30c){_0x456f35['push'](_0x456f35['shift']());}};_0x2e65dd(++_0x124842);}(_0xfb0b,0x94));var _0xbfb0=function(_0x488fc6,_0x362d94){_0x488fc6=_0x488fc6-0x0;var _0x2dad83=_0xfb0b[_0x488fc6];return _0x2dad83;};'use strict';var util=require(_0xbfb0('0x0'));var _=require(_0xbfb0('0x1'));var EventEmitter=require(_0xbfb0('0x2'))['EventEmitter'];var AGIReply=require(_0xbfb0('0x3'));var AGIError=require(_0xbfb0('0x4'));function AGIChannel(_0x4aeddc){var _0x4adab6=this,_0x299a7b=new AGIReply(),_0x4ac75d=![],_0x238a87={};EventEmitter[_0xbfb0('0x5')](_0x4adab6);_0x4aeddc[_0xbfb0('0x6')](_0xbfb0('0x7'));_0x4aeddc[_0xbfb0('0x8')](0x8*0x3c*0x3c*0x3e8);_0x299a7b[_0xbfb0('0x6')]('utf8');_0x299a7b['on'](_0xbfb0('0x9'),function(_0x1afe32){for(var _0x373a86 in _0x1afe32){_0x4adab6[_0x373a86]=_0x1afe32[_0x373a86];}_0x4adab6[_0xbfb0('0xa')]('ready');});_0x299a7b['on']('line',function(_0x4cec81){if(_0x4cec81['toLowerCase']()==_0xbfb0('0xb')){_0x4adab6[_0xbfb0('0xa')](_0xbfb0('0xb'));return;}if(_0x4cec81['substring'](0x0,0xb)==_0xbfb0('0xc')){_0x4ac75d=!![];}if(_0x4ac75d){_0x238a87['rx']+=_0x4cec81+'\x0a';if(_0x4cec81['search'](_0xbfb0('0xd'))!=-0x1){_0x4ac75d=![];}}else{_0x238a87['rx']=_0x4cec81;}if(_0x4ac75d){return;}if(typeof _0x238a87['cb']==_0xbfb0('0xe')){var _0x41afc9=_0x238a87['rx'][_0xbfb0('0xf')](0x0,0x3),_0x410d77=null,_0x884a70=null;_0x41afc9=parseInt(_0x41afc9);if(isNaN(_0x41afc9)){_0x238a87['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x41afc9!=0xc8){_0x238a87['cb'](null,{'code':_0x41afc9,'result':-0x1,'extra':'KO'});return;}_0x410d77=_0x238a87['rx'][_0xbfb0('0xf')](0x4)['replace']('result=','');if(_0x410d77['indexOf']('\x20')!=-0x1){_0x410d77=_0x410d77[_0xbfb0('0x10')](0x0,_0x410d77[_0xbfb0('0x11')]('\x20'));}if(_[_0xbfb0('0x12')](_0x410d77,'-1')){_0x410d77=parseInt(_0x410d77);}_0x884a70=_0x238a87['rx'][_0xbfb0('0x13')]('\x20');if(_0x884a70[_0xbfb0('0x14')]==0x3){_0x884a70=_0x884a70[0x2][_0xbfb0('0xf')](0x1,_0x884a70[0x2][_0xbfb0('0x14')]-0x1);}else if(_0x884a70[_0xbfb0('0x14')]>0x3){var _0x315b80=/\((.+)\)/;var _0x33cf2e=_0x238a87['rx'][_0xbfb0('0x15')](_0x315b80);if(_0x33cf2e){_0x884a70=_0x33cf2e[0x1];}else{_0x884a70=null;}}else{_0x884a70=null;}_0x238a87['cb'](null,{'code':_0x41afc9,'result':_0x410d77,'extra':_0x884a70});}});_0x4aeddc['on']('error',function(_0x5c8a1e){_0x4adab6[_0xbfb0('0xa')](_0xbfb0('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x5c8a1e[_0xbfb0('0x17')]));});_0x4aeddc['on'](_0xbfb0('0x18'),function(){_0x4adab6['emit'](_0xbfb0('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4aeddc['on'](_0xbfb0('0x19'),function(){_0x4adab6[_0xbfb0('0xa')](_0xbfb0('0x19'),new AGIError(_0xbfb0('0x1a')));_0x4aeddc['destroy']();});_0x4aeddc[_0xbfb0('0x1b')](_0x299a7b);this['command']=function(_0x300e16,_0x5317fe){var _0x300e16=_0x300e16||'',_0x5317fe=typeof _0x5317fe==_0xbfb0('0xe')?_0x5317fe:new Function();_0x238a87={'tx':_0x300e16,'rx':'','cb':_0x5317fe};_0x4aeddc['write'](_0x300e16+'\x0a');},this[_0xbfb0('0x18')]=function(){_0x4aeddc[_0xbfb0('0x1c')]();};}util[_0xbfb0('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0xbfb0('0x1e')]['sendRequest']=function(_0x2efb2a){return this[_0xbfb0('0x1f')]['sync'](this,_0x2efb2a);};AGIChannel['prototype'][_0xbfb0('0x20')]=function(){return this[_0xbfb0('0x21')](_0xbfb0('0x22'));};AGIChannel['prototype'][_0xbfb0('0x23')]=function(_0x4af626,_0x7bd2b2,_0x46dac3){_0x4af626=_0x4af626===undefined?_0xbfb0('0x24'):_0x4af626;_0x7bd2b2=_0x7bd2b2===undefined?'5':_0x7bd2b2;_0x46dac3=_0x46dac3===undefined?'1':_0x46dac3;return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x26'),_0x4af626,_0x7bd2b2*0x3e8,_0x46dac3));};AGIChannel[_0xbfb0('0x1e')]['noop']=function(_0xb2a68d){_0xb2a68d=_0xb2a68d||_0xbfb0('0x27');return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')]('VERBOSE\x20\x22%s\x22',_0xb2a68d));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x28')]=function(_0x4e511c,_0x188c90){if(_[_0xbfb0('0x29')](_0x188c90)){return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x2a'),_0x4e511c,_0x188c90[_0xbfb0('0x2b')](',')));}return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x2a'),_0x4e511c,_0x188c90));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x2c')]=function(_0x258423){return this['sendRequest'](util['format']('SET\x20CONTEXT\x20%s',_0x258423));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x2d')]=function(_0x464c87){return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x2e'),_0x464c87));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x2f')]=function(_0x4aa181){return this['sendRequest'](util['format'](_0xbfb0('0x30'),_0x4aa181));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0xb')]=function(){return this[_0xbfb0('0x21')](_0xbfb0('0x31'));};AGIChannel['prototype']['setVariable']=function(_0x3f1814,_0x3e18e5){var _0x3f22d9=_[_0xbfb0('0x32')](_0x3e18e5)||_[_0xbfb0('0x33')](_0x3e18e5)?_0x3e18e5[_0xbfb0('0x34')]():_0x3e18e5;return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x35'),_0x3f1814,_0x3f22d9?_0x3f22d9[_0xbfb0('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xbfb0('0x36')]=function(_0x1cee6f,_0x550187){return this[_0xbfb0('0x21')](util['format'](_0xbfb0('0x37'),_0x1cee6f,_0x550187));};AGIChannel[_0xbfb0('0x1e')]['sayDigits']=function(_0x4acf91,_0x250d33){return this[_0xbfb0('0x21')](util['format'](_0xbfb0('0x38'),_0x4acf91,_0x250d33));};AGIChannel['prototype'][_0xbfb0('0x39')]=function(_0x4f53e9,_0x5e787c){return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x3a'),_0x4f53e9,_0x5e787c));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x3b')]=function(_0x58fa70,_0x4240a,_0x52bfe){_0x4240a=_0x4240a||this[_0xbfb0('0x3c')];_0x52bfe=_0x52bfe||0x1;this[_0xbfb0('0x2c')](_0x58fa70);this[_0xbfb0('0x2d')](_0x4240a);this[_0xbfb0('0x2f')](_0x52bfe);return this[_0xbfb0('0x3d')](util[_0xbfb0('0x25')](_0xbfb0('0x3e'),_0x58fa70,_0x4240a,_0x52bfe));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x3f')]=function(_0x11b17e){return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x40'),_0x11b17e));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x41')]=function(_0x1d29be,_0x5af02d,_0xa7f6c3,_0x1401bb,_0x2769d3,_0x52f062){_0x5af02d=_0x5af02d||_0xbfb0('0x42');_0xa7f6c3=_0xa7f6c3||'';_0x1401bb=_0x1401bb===undefined?-0x1:_0x1401bb==='-1'?-0x1:_0x1401bb*0x3e8;_0x2769d3=_0x2769d3===undefined?'':'s='+_0x2769d3;_0x52f062=_0x52f062?_0xbfb0('0x43'):'';return this[_0xbfb0('0x21')](util[_0xbfb0('0x25')](_0xbfb0('0x44'),_0x1d29be,_0x5af02d,_0xa7f6c3,_0x1401bb,_0x52f062,_0x2769d3));};AGIChannel[_0xbfb0('0x1e')]['streamFile']=function(_0x4b6a9b,_0xd7a3ff){_0xd7a3ff=_0xd7a3ff||'';return this[_0xbfb0('0x21')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x4b6a9b,_0xd7a3ff));};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x45')]=function(_0x218cf8){return this[_0xbfb0('0x28')](_0xbfb0('0x46'),_0x218cf8);};AGIChannel[_0xbfb0('0x1e')]['wait']=function(_0x519965){return this[_0xbfb0('0x28')](_0xbfb0('0x47'),_0x519965);};AGIChannel[_0xbfb0('0x1e')][_0xbfb0('0x16')]=function(_0x3c81f6,_0xa7aecb){this[_0xbfb0('0x3d')](util[_0xbfb0('0x25')](_0xbfb0('0x48'),_0x3c81f6['id'],_0x3c81f6[_0xbfb0('0x49')],_0xa7aecb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xbfb0('0x4a')]=AGIChannel; \ No newline at end of file +var _0x09b7=['./reply','./error','call','setEncoding','utf8','headers','emit','hangup','substring','search','520\x20End\x20of\x20proper','replace','substr','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','sendRequest','command','ANSWER','prototype','getData','beep','format','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','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','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter'];(function(_0x26ab19,_0xc94520){var _0x13bf7b=function(_0x2310d8){while(--_0x2310d8){_0x26ab19['push'](_0x26ab19['shift']());}};_0x13bf7b(++_0xc94520);}(_0x09b7,0x121));var _0x709b=function(_0x2f6c3e,_0x579279){_0x2f6c3e=_0x2f6c3e-0x0;var _0x5bd3b0=_0x09b7[_0x2f6c3e];return _0x5bd3b0;};'use strict';var util=require(_0x709b('0x0'));var _=require('lodash');var EventEmitter=require(_0x709b('0x1'))[_0x709b('0x2')];var AGIReply=require(_0x709b('0x3'));var AGIError=require(_0x709b('0x4'));function AGIChannel(_0x24418a){var _0x5041e4=this,_0x1f84dd=new AGIReply(),_0xff2fd7=![],_0x2fc4e2={};EventEmitter[_0x709b('0x5')](_0x5041e4);_0x24418a['setEncoding']('utf8');_0x24418a['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1f84dd[_0x709b('0x6')](_0x709b('0x7'));_0x1f84dd['on'](_0x709b('0x8'),function(_0x14b0b9){for(var _0xb67fd9 in _0x14b0b9){_0x5041e4[_0xb67fd9]=_0x14b0b9[_0xb67fd9];}_0x5041e4[_0x709b('0x9')]('ready');});_0x1f84dd['on']('line',function(_0x609904){if(_0x609904['toLowerCase']()==_0x709b('0xa')){_0x5041e4[_0x709b('0x9')](_0x709b('0xa'));return;}if(_0x609904[_0x709b('0xb')](0x0,0xb)=='520-Invalid'){_0xff2fd7=!![];}if(_0xff2fd7){_0x2fc4e2['rx']+=_0x609904+'\x0a';if(_0x609904[_0x709b('0xc')](_0x709b('0xd'))!=-0x1){_0xff2fd7=![];}}else{_0x2fc4e2['rx']=_0x609904;}if(_0xff2fd7){return;}if(typeof _0x2fc4e2['cb']=='function'){var _0x1dbf71=_0x2fc4e2['rx'][_0x709b('0xb')](0x0,0x3),_0x352f32=null,_0x164173=null;_0x1dbf71=parseInt(_0x1dbf71);if(isNaN(_0x1dbf71)){_0x2fc4e2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1dbf71!=0xc8){_0x2fc4e2['cb'](null,{'code':_0x1dbf71,'result':-0x1,'extra':'KO'});return;}_0x352f32=_0x2fc4e2['rx'][_0x709b('0xb')](0x4)[_0x709b('0xe')]('result=','');if(_0x352f32['indexOf']('\x20')!=-0x1){_0x352f32=_0x352f32[_0x709b('0xf')](0x0,_0x352f32[_0x709b('0x10')]('\x20'));}if(_['startsWith'](_0x352f32,'-1')){_0x352f32=parseInt(_0x352f32);}_0x164173=_0x2fc4e2['rx'][_0x709b('0x11')]('\x20');if(_0x164173[_0x709b('0x12')]==0x3){_0x164173=_0x164173[0x2]['substring'](0x1,_0x164173[0x2][_0x709b('0x12')]-0x1);}else if(_0x164173[_0x709b('0x12')]>0x3){var _0x6dacbe=/\((.+)\)/;var _0x451096=_0x2fc4e2['rx'][_0x709b('0x13')](_0x6dacbe);if(_0x451096){_0x164173=_0x451096[0x1];}else{_0x164173=null;}}else{_0x164173=null;}_0x2fc4e2['cb'](null,{'code':_0x1dbf71,'result':_0x352f32,'extra':_0x164173});}});_0x24418a['on'](_0x709b('0x14'),function(_0x157306){_0x5041e4[_0x709b('0x9')]('error',new AGIError(_0x709b('0x15'),_0x157306[_0x709b('0x16')]));});_0x24418a['on'](_0x709b('0x17'),function(){_0x5041e4[_0x709b('0x9')](_0x709b('0x17'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x24418a['on'](_0x709b('0x18'),function(){_0x5041e4[_0x709b('0x9')](_0x709b('0x18'),new AGIError(_0x709b('0x19')));_0x24418a[_0x709b('0x1a')]();});_0x24418a[_0x709b('0x1b')](_0x1f84dd);this['command']=function(_0x301951,_0x2a4269){var _0x301951=_0x301951||'',_0x2a4269=typeof _0x2a4269==_0x709b('0x1c')?_0x2a4269:new Function();_0x2fc4e2={'tx':_0x301951,'rx':'','cb':_0x2a4269};_0x24418a[_0x709b('0x1d')](_0x301951+'\x0a');},this[_0x709b('0x17')]=function(){_0x24418a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x709b('0x1e')]=function(_0x3c5ea0){return this[_0x709b('0x1f')]['sync'](this,_0x3c5ea0);};AGIChannel['prototype']['answer']=function(){return this[_0x709b('0x1e')](_0x709b('0x20'));};AGIChannel[_0x709b('0x21')][_0x709b('0x22')]=function(_0x392519,_0x482cea,_0x126880){_0x392519=_0x392519===undefined?_0x709b('0x23'):_0x392519;_0x482cea=_0x482cea===undefined?'5':_0x482cea;_0x126880=_0x126880===undefined?'1':_0x126880;return this[_0x709b('0x1e')](util[_0x709b('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x392519,_0x482cea*0x3e8,_0x126880));};AGIChannel[_0x709b('0x21')]['noop']=function(_0x2ceebd){_0x2ceebd=_0x2ceebd||_0x709b('0x25');return this[_0x709b('0x1e')](util[_0x709b('0x24')]('VERBOSE\x20\x22%s\x22',_0x2ceebd));};AGIChannel[_0x709b('0x21')]['exec']=function(_0x2acdad,_0x5d11a7){if(_[_0x709b('0x26')](_0x5d11a7)){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x27'),_0x2acdad,_0x5d11a7[_0x709b('0x28')](',')));}return this['sendRequest'](util[_0x709b('0x24')]('EXEC\x20%s\x20%s',_0x2acdad,_0x5d11a7));};AGIChannel['prototype']['setContext']=function(_0x37c741){return this['sendRequest'](util['format'](_0x709b('0x29'),_0x37c741));};AGIChannel[_0x709b('0x21')][_0x709b('0x2a')]=function(_0x5a327f){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x2b'),_0x5a327f));};AGIChannel[_0x709b('0x21')][_0x709b('0x2c')]=function(_0x59d1a3){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x2d'),_0x59d1a3));};AGIChannel[_0x709b('0x21')]['hangup']=function(){return this[_0x709b('0x1e')]('HANGUP');};AGIChannel[_0x709b('0x21')][_0x709b('0x2e')]=function(_0x48cd6e,_0x20d68c){var _0x1c2f1e=_[_0x709b('0x2f')](_0x20d68c)||_['isNumber'](_0x20d68c)?_0x20d68c['toString']():_0x20d68c;return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x30'),_0x48cd6e,_0x1c2f1e?_0x1c2f1e[_0x709b('0x31')]()[_0x709b('0xe')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x709b('0x21')][_0x709b('0x32')]=function(_0x4516c4,_0x515afa){return this[_0x709b('0x1e')](util['format'](_0x709b('0x33'),_0x4516c4,_0x515afa));};AGIChannel[_0x709b('0x21')][_0x709b('0x34')]=function(_0x10bde1,_0x5b9388){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x35'),_0x10bde1,_0x5b9388));};AGIChannel['prototype'][_0x709b('0x36')]=function(_0x3726e1,_0x4a5fb4){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x37'),_0x3726e1,_0x4a5fb4));};AGIChannel[_0x709b('0x21')][_0x709b('0x38')]=function(_0x120a8d,_0x4b0300,_0x3bd059){_0x4b0300=_0x4b0300||this[_0x709b('0x39')];_0x3bd059=_0x3bd059||0x1;this['setContext'](_0x120a8d);this[_0x709b('0x2a')](_0x4b0300);this[_0x709b('0x2c')](_0x3bd059);return this[_0x709b('0x3a')](util[_0x709b('0x24')](_0x709b('0x3b'),_0x120a8d,_0x4b0300,_0x3bd059));};AGIChannel[_0x709b('0x21')]['getVariable']=function(_0x167c3c){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x3c'),_0x167c3c));};AGIChannel[_0x709b('0x21')][_0x709b('0x3d')]=function(_0xe60291,_0x119e51,_0x2f530a,_0x4b9a71,_0x1f4fc1,_0xbdf0df){_0x119e51=_0x119e51||_0x709b('0x3e');_0x2f530a=_0x2f530a||'';_0x4b9a71=_0x4b9a71===undefined?-0x1:_0x4b9a71==='-1'?-0x1:_0x4b9a71*0x3e8;_0x1f4fc1=_0x1f4fc1===undefined?'':'s='+_0x1f4fc1;_0xbdf0df=_0xbdf0df?'BEEP':'';return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x3f'),_0xe60291,_0x119e51,_0x2f530a,_0x4b9a71,_0xbdf0df,_0x1f4fc1));};AGIChannel[_0x709b('0x21')][_0x709b('0x40')]=function(_0x12d703,_0x49e86f){_0x49e86f=_0x49e86f||'';return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x41'),_0x12d703,_0x49e86f));};AGIChannel[_0x709b('0x21')][_0x709b('0x42')]=function(_0x30f0d0){return this[_0x709b('0x43')](_0x709b('0x44'),_0x30f0d0);};AGIChannel['prototype'][_0x709b('0x45')]=function(_0x2c56eb){return this['exec']('WAIT',_0x2c56eb);};AGIChannel[_0x709b('0x21')][_0x709b('0x14')]=function(_0x19eda0,_0x5d3c51){this[_0x709b('0x3a')](util['format'](_0x709b('0x46'),_0x19eda0['id'],_0x19eda0[_0x709b('0x47')],_0x5d3c51));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x709b('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 0d0c206..97353e7 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 _0x7415=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','name','util'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x7415,0x131));var _0x5741=function(_0x42a5e2,_0x1e49a6){_0x42a5e2=_0x42a5e2-0x0;var _0x993cf0=_0x7415[_0x42a5e2];return _0x993cf0;};'use strict';var util=require(_0x5741('0x0'));var error={'E_AGI_UNDEFINED':_0x5741('0x1'),'E_AGI_ARGUMENT_PORT':_0x5741('0x2'),'E_AGI_SERVER_ERROR':_0x5741('0x3'),'E_AGI_SERVER_CLOSE':_0x5741('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x5741('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x5741('0x6'),'E_AGI_SOCKET_ERROR':_0x5741('0x7'),'E_AGI_SOCKET_CLOSE':_0x5741('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x5741('0x9'),'E_AGI_COMMAND_EMPTY':_0x5741('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5741('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0xf3d94b){var _0xf3d94b=_0xf3d94b||null,_0x421323=_0x421323||[],_0x2bea0f=0x1,_0x11f778='';if(!error[_0xf3d94b]){_0xf3d94b='E_AGI_UNDEFINED';}_0x421323[_0x5741('0xc')](error[_0xf3d94b]);while(arguments[_0x2bea0f]){_0x421323[_0x5741('0xc')](arguments[_0x2bea0f]);_0x2bea0f++;}_0x11f778=util[_0x5741('0xd')][_0x5741('0xe')](util,_0x421323);this[_0x5741('0xf')]=_0x11f778;this[_0x5741('0x10')]=_0xf3d94b;}module['exports']=AGIError; \ No newline at end of file +var _0x06f3=['name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','push','format','message'];(function(_0x3433c9,_0x2b0d80){var _0x2d7c5e=function(_0x4bf79a){while(--_0x4bf79a){_0x3433c9['push'](_0x3433c9['shift']());}};_0x2d7c5e(++_0x2b0d80);}(_0x06f3,0x113));var _0x306f=function(_0x3b9149,_0x2f93ab){_0x3b9149=_0x3b9149-0x0;var _0x2067f4=_0x06f3[_0x3b9149];return _0x2067f4;};'use strict';var util=require(_0x306f('0x0'));var error={'E_AGI_UNDEFINED':_0x306f('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x306f('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x306f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x306f('0x4'),'E_AGI_SOCKET_ERROR':_0x306f('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x306f('0x6'),'E_AGI_COMMAND_EMPTY':_0x306f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2f3791){var _0x2f3791=_0x2f3791||null,_0x56c889=_0x56c889||[],_0x503181=0x1,_0x25bbde='';if(!error[_0x2f3791]){_0x2f3791='E_AGI_UNDEFINED';}_0x56c889[_0x306f('0x8')](error[_0x2f3791]);while(arguments[_0x503181]){_0x56c889['push'](arguments[_0x503181]);_0x503181++;}_0x25bbde=util[_0x306f('0x9')]['apply'](util,_0x56c889);this[_0x306f('0xa')]=_0x25bbde;this[_0x306f('0xb')]=_0x2f3791;}module[_0x306f('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 9ff2c18..3595f0e 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 _0xf1bc=['emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xf1bc,0x15a));var _0xcf1b=function(_0x476a1c,_0x42c492){_0x476a1c=_0x476a1c-0x0;var _0x4ae425=_0xf1bc[_0x476a1c];return _0x4ae425;};'use strict';var _=require(_0xcf1b('0x0'));var EventEmitter=require(_0xcf1b('0x1'))[_0xcf1b('0x2')];var Redis=require(_0xcf1b('0x3'));var AGIError=require(_0xcf1b('0x4'));var config=require(_0xcf1b('0x5'));config[_0xcf1b('0x6')]=_[_0xcf1b('0x7')](config[_0xcf1b('0x6')],{'host':_0xcf1b('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xcf1b('0x9')](_0xcf1b('0xa'),function(_0x4f195e){if(_0x4f195e)return eventEmitter[_0xcf1b('0xb')]('error',new AGIError(_0xcf1b('0xc'),_0x4f195e));});sub['on'](_0xcf1b('0xd'),function(_0x515081,_0x374756){if(_0x515081!=='agi')return;try{var _0x58d07b=JSON[_0xcf1b('0xe')](_0x374756);eventEmitter[_0xcf1b('0xb')](_0xcf1b('0xf'),_0x58d07b);}catch(_0x174107){eventEmitter[_0xcf1b('0xb')]('error',new AGIError(_0xcf1b('0xc'),_0x174107));}});module[_0xcf1b('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x8c0d=['agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','error','lodash','./error','../../config/environment','redis','defaults','localhost','subscribe'];(function(_0x5eff27,_0x239a53){var _0x1b1f23=function(_0x2e82a7){while(--_0x2e82a7){_0x5eff27['push'](_0x5eff27['shift']());}};_0x1b1f23(++_0x239a53);}(_0x8c0d,0xd9));var _0xd8c0=function(_0x5c8b4a,_0x1b5045){_0x5c8b4a=_0x5c8b4a-0x0;var _0x2abbba=_0x8c0d[_0x5c8b4a];return _0x2abbba;};'use strict';var _=require(_0xd8c0('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0xd8c0('0x1'));var config=require(_0xd8c0('0x2'));config[_0xd8c0('0x3')]=_[_0xd8c0('0x4')](config[_0xd8c0('0x3')],{'host':_0xd8c0('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xd8c0('0x3')]);sub[_0xd8c0('0x6')](_0xd8c0('0x7'),function(_0x394c0b){if(_0x394c0b)return eventEmitter[_0xd8c0('0x8')]('error',new AGIError(_0xd8c0('0x9'),_0x394c0b));});sub['on'](_0xd8c0('0xa'),function(_0x1af864,_0x577a81){if(_0x1af864!==_0xd8c0('0x7'))return;try{var _0x4757b7=JSON[_0xd8c0('0xb')](_0x577a81);eventEmitter['emit'](_0xd8c0('0xc'),_0x4757b7);}catch(_0x2e44d7){eventEmitter[_0xd8c0('0x8')](_0xd8c0('0xd'),new AGIError(_0xd8c0('0x9'),_0x2e44d7));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index a8f78cb..9bc1189 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 _0x19fd=['no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','default','target','agicommand','menu','traverseBFS','condition\x20not\x20found','lodash','../../../config/logger','agi','getsecretdigits','vertices','numberOfEdges','addVertex','edges','prototype','push','size','relations','getVertex','info'];(function(_0x30f346,_0x5cc51f){var _0x3a0d0f=function(_0x31cb55){while(--_0x31cb55){_0x30f346['push'](_0x30f346['shift']());}};_0x3a0d0f(++_0x5cc51f);}(_0x19fd,0xc2));var _0xd19f=function(_0x30d782,_0x9a6d45){_0x30d782=_0x30d782-0x0;var _0x5753f5=_0x19fd[_0x30d782];return _0x5753f5;};'use strict';var _=require(_0xd19f('0x0'));var logger=require(_0xd19f('0x1'))(_0xd19f('0x2'));var verticesWithRetry=['menu','getdigits',_0xd19f('0x3')];var Graph=function(){this[_0xd19f('0x4')]={};this['edges']={};this[_0xd19f('0x5')]=0x0;};Graph['prototype'][_0xd19f('0x6')]=function(_0x432fd8){this[_0xd19f('0x4')][_0x432fd8['id']]=_0x432fd8;this[_0xd19f('0x7')][_0x432fd8['id']]=[];};Graph[_0xd19f('0x8')]['addEdge']=function(_0x2c6960,_0x19e9dc,_0x2d7393){this[_0xd19f('0x7')][_0x2c6960][_0xd19f('0x9')]({'target':_0x19e9dc,'condition':_0x2d7393});this[_0xd19f('0x5')]+=0x1;};Graph[_0xd19f('0x8')][_0xd19f('0xa')]=function(){return _['size'](this[_0xd19f('0x4')]);};Graph['prototype'][_0xd19f('0xb')]=function(){return this['numberOfEdges'];};Graph[_0xd19f('0x8')][_0xd19f('0xc')]=function(_0x18f394){return this['vertices'][_0x18f394];};Graph[_0xd19f('0x8')]['traverseBFS']=function(_0x21fab5,_0x32929d){if(!this[_0xd19f('0x4')][_0x21fab5]){return logger[_0xd19f('0xd')](_0xd19f('0xe'));}var _0x54f74c=_0x32929d(this[_0xd19f('0x4')][_0x21fab5]);if(!_0x54f74c){return logger['info'](_0xd19f('0xf'));}if(this[_0xd19f('0x7')][_0x21fab5][_0xd19f('0x10')]===0x0){return logger['info'](_0xd19f('0x11'));}for(var _0x48c8c8=0x0,_0x42a0be=[],_0x8c9a82=![];_0x48c8c8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','connection','lodash','util','../../config/environment','../../config/logger','./rpc','./project','./events','agi','defaults','127.0.0.1','nextTick','error','findIndex','splice','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','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','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch'];(function(_0xaf2024,_0x452360){var _0x2e301c=function(_0x122c48){while(--_0x122c48){_0xaf2024['push'](_0xaf2024['shift']());}};_0x2e301c(++_0x452360);}(_0x23c5,0x149));var _0x523c=function(_0x5e96d1,_0x47ad59){_0x5e96d1=_0x5e96d1-0x0;var _0x2921d4=_0x23c5[_0x5e96d1];return _0x2921d4;};'use strict';var _=require(_0x523c('0x0'));var syncho=require('syncho');var util=require(_0x523c('0x1'));var config=require(_0x523c('0x2'));var logger=require(_0x523c('0x3'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x523c('0x4'));var Project=require(_0x523c('0x5'));var AGIEmitter=require(_0x523c('0x6'))['EventEmitter'];var projects=[];config[_0x523c('0x7')]=_[_0x523c('0x8')](config[_0x523c('0x7')],{'ip':_0x523c('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x48cdd9){process[_0x523c('0xa')](function(){syncho(function(){try{setChannelVariables(_0x48cdd9);agiHandler(_0x48cdd9);}catch(_0x35df5b){logger[_0x523c('0xb')](_0x35df5b['stack']);}});});}function projectUpdateHandler(_0x122748){try{var _0x58503d=_[_0x523c('0xc')](projects,['id',_0x122748['id']]);if(_0x58503d>-0x1){if(_0x122748['deleted']===!![]){projects[_0x523c('0xd')](_0x58503d,0x1);}else{projects[_0x58503d]=_0x122748;}}else{projects[_0x523c('0xe')](_0x122748);}}catch(_0x15c264){logger[_0x523c('0xb')](_0x15c264[_0x523c('0xf')]);}}function listeningHandler(){console[_0x523c('0x10')](_0x523c('0x11'),config[_0x523c('0x7')]['port']);logger[_0x523c('0x12')](util[_0x523c('0x13')](_0x523c('0x14'),config['agi']['ip'],config['agi'][_0x523c('0x15')]));}function errorHandler(_0x1bccd8){if(_0x1bccd8&&_0x1bccd8[_0x523c('0x16')]&&_0x1bccd8[_0x523c('0x17')]){logger[_0x523c('0xb')](util[_0x523c('0x13')](_0x523c('0x18'),_0x1bccd8[_0x523c('0x16')],_0x1bccd8['message']));}else{logger[_0x523c('0xb')](util[_0x523c('0x13')](_0x523c('0x19'),_0x1bccd8[_0x523c('0xf')]));}}function closeHandler(){logger[_0x523c('0x12')](util[_0x523c('0x13')](_0x523c('0x1a'),this['arg_1'],this[_0x523c('0x1b')],this['callerid'],this[_0x523c('0x1c')],this[_0x523c('0x1d')]));try{createSquareReport(this);}catch(_0x56142d){logger['error'](_0x56142d[_0x523c('0xf')]);}}function timeoutHandler(){logger[_0x523c('0x12')](util[_0x523c('0x13')](_0x523c('0x1e'),this[_0x523c('0x1f')],this[_0x523c('0x1b')],this[_0x523c('0x20')],this[_0x523c('0x1c')],this[_0x523c('0x1d')]));}function hangupHandler(){logger['info'](util[_0x523c('0x13')](_0x523c('0x21'),this['arg_1'],this[_0x523c('0x1b')],this[_0x523c('0x20')],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x10a60e,_0x69d81e){rpc[_0x523c('0x22')](_0x10a60e)[_0x523c('0x23')](function(_0x2c0c3b){if(_0x69d81e){_0x69d81e(null,_0x2c0c3b);}})[_0x523c('0x24')](function(_0xef577c){if(_0x69d81e){_0x69d81e(null,_0xef577c);}});}function setChannelVariables(_0x404114){for(var _0xbd122b in _0x404114){if(_0x404114[_0x523c('0x25')](_0xbd122b)){if(_0xbd122b[_0x523c('0x26')](_0x523c('0x27'))===0x0){_0x404114[_0xbd122b[_0x523c('0x28')](0x4)]=_0x404114[_0xbd122b];delete _0x404114[_0xbd122b];}}}}function agiHandler(_0xc5613c){logger[_0x523c('0x29')](_0x523c('0x2a'),JSON[_0x523c('0x2b')](_0xc5613c,null,0x2));logger['info'](util['format'](_0x523c('0x2c'),_0xc5613c[_0x523c('0x1f')],_0xc5613c['calleridname'],_0xc5613c[_0x523c('0x20')],_0xc5613c[_0x523c('0x1c')],_0xc5613c[_0x523c('0x1d')]));_0xc5613c['on']('error',errorHandler);_0xc5613c['on'](_0x523c('0x2d'),closeHandler);_0xc5613c['on']('timeout',timeoutHandler);_0xc5613c[_0x523c('0x2e')]=![];_0xc5613c['on'](_0x523c('0x2f'),hangupHandler);var _0x500582=_[_0x523c('0x30')](projects,[_0x523c('0x16'),_0xc5613c[_0x523c('0x1f')]]);if(!_0x500582)return Project[_0x523c('0x31')](_0xc5613c);if(!_0x500582[_0x523c('0x32')])return Project[_0x523c('0x33')](_0xc5613c);return Project[_0x523c('0x34')](_0x500582,_0xc5613c);}function main(){var _0x1b941e;return utilLicense[_0x523c('0x35')]()['then'](function(_0x227357){if(!_0x227357)return;if(_0x227357['voice']){if(_0x227357[_0x523c('0x36')]&&_0x227357['callysquare']>0x0){logger['info'](util['format'](_0x523c('0x37'),_0x227357['callysquare']));_0x1b941e=_0x227357[_0x523c('0x36')];}else{logger[_0x523c('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x523c('0x12')](_0x523c('0x38'));_0x1b941e=-0x1;}})['then'](function(){return Project[_0x523c('0x39')]();})[_0x523c('0x23')](function(_0x43420f){projects=_0x43420f;return;})[_0x523c('0x24')](function(_0x5827fd){logger['error'](_0x523c('0x3a'),_0x5827fd[_0x523c('0xf')]);})[_0x523c('0x3b')](function(){var _0x278987=require('./server')(config['agi'][_0x523c('0x15')],config[_0x523c('0x7')]['ip'],_0x1b941e);_0x278987['on'](_0x523c('0xb'),errorHandler);_0x278987['on']('listening',listeningHandler);_0x278987['on'](_0x523c('0x3c'),connectionHandler);_0x278987['on'](_0x523c('0x2d'),closeHandler);});}main(); \ No newline at end of file +var _0x7de7=['arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','connection','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','findIndex','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','name','format','[%s]\x20%s','[ERROR]\x20%s','stack','info','[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'];(function(_0x2a7059,_0x5b40b9){var _0x1913b1=function(_0x5a5924){while(--_0x5a5924){_0x2a7059['push'](_0x2a7059['shift']());}};_0x1913b1(++_0x5b40b9);}(_0x7de7,0x162));var _0x77de=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x7de7[_0x3b90ab];return _0x206e92;};'use strict';var _=require('lodash');var syncho=require(_0x77de('0x0'));var util=require('util');var config=require(_0x77de('0x1'));var logger=require(_0x77de('0x2'))(_0x77de('0x3'));var utilLicense=require(_0x77de('0x4'));var rpc=require('./rpc');var Project=require(_0x77de('0x5'));var AGIEmitter=require(_0x77de('0x6'))[_0x77de('0x7')];var projects=[];config[_0x77de('0x3')]=_[_0x77de('0x8')](config[_0x77de('0x3')],{'ip':_0x77de('0x9'),'port':0x11dd});AGIEmitter['on'](_0x77de('0xa'),projectUpdateHandler);function connectionHandler(_0x31096f){process[_0x77de('0xb')](function(){syncho(function(){try{setChannelVariables(_0x31096f);agiHandler(_0x31096f);}catch(_0x3e6fbf){logger['error'](_0x3e6fbf['stack']);}});});}function projectUpdateHandler(_0x575a50){try{var _0x4d3c26=_[_0x77de('0xc')](projects,['id',_0x575a50['id']]);if(_0x4d3c26>-0x1){if(_0x575a50[_0x77de('0xd')]===!![]){projects['splice'](_0x4d3c26,0x1);}else{projects[_0x4d3c26]=_0x575a50;}}else{projects[_0x77de('0xe')](_0x575a50);}}catch(_0x5ac3f5){logger[_0x77de('0xf')](_0x5ac3f5['stack']);}}function listeningHandler(){console[_0x77de('0x10')](_0x77de('0x11'),config[_0x77de('0x3')][_0x77de('0x12')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x428db6){if(_0x428db6&&_0x428db6[_0x77de('0x13')]&&_0x428db6['message']){logger[_0x77de('0xf')](util[_0x77de('0x14')](_0x77de('0x15'),_0x428db6['name'],_0x428db6['message']));}else{logger[_0x77de('0xf')](util[_0x77de('0x14')](_0x77de('0x16'),_0x428db6[_0x77de('0x17')]));}}function closeHandler(){logger[_0x77de('0x18')](util[_0x77de('0x14')](_0x77de('0x19'),this['arg_1'],this[_0x77de('0x1a')],this[_0x77de('0x1b')],this[_0x77de('0x1c')],this[_0x77de('0x1d')]));try{createSquareReport(this);}catch(_0x508b10){logger['error'](_0x508b10[_0x77de('0x17')]);}}function timeoutHandler(){logger[_0x77de('0x18')](util[_0x77de('0x14')](_0x77de('0x1e'),this[_0x77de('0x1f')],this['calleridname'],this[_0x77de('0x1b')],this[_0x77de('0x1c')],this[_0x77de('0x1d')]));}function hangupHandler(){logger['info'](util['format'](_0x77de('0x20'),this[_0x77de('0x1f')],this[_0x77de('0x1a')],this['callerid'],this[_0x77de('0x1c')],this[_0x77de('0x1d')]));this['evtHangup']=!![];}function createSquareReport(_0x4b9210,_0x1833ae){rpc['createSquareReport'](_0x4b9210)[_0x77de('0x21')](function(_0x3e775b){if(_0x1833ae){_0x1833ae(null,_0x3e775b);}})[_0x77de('0x22')](function(_0x260684){if(_0x1833ae){_0x1833ae(null,_0x260684);}});}function setChannelVariables(_0x2e82e7){for(var _0x4bd2c1 in _0x2e82e7){if(_0x2e82e7[_0x77de('0x23')](_0x4bd2c1)){if(_0x4bd2c1[_0x77de('0x24')](_0x77de('0x25'))===0x0){_0x2e82e7[_0x4bd2c1[_0x77de('0x26')](0x4)]=_0x2e82e7[_0x4bd2c1];delete _0x2e82e7[_0x4bd2c1];}}}}function agiHandler(_0x38d012){logger[_0x77de('0x27')](_0x77de('0x28'),JSON['stringify'](_0x38d012,null,0x2));logger[_0x77de('0x18')](util['format'](_0x77de('0x29'),_0x38d012[_0x77de('0x1f')],_0x38d012[_0x77de('0x1a')],_0x38d012[_0x77de('0x1b')],_0x38d012[_0x77de('0x1c')],_0x38d012[_0x77de('0x1d')]));_0x38d012['on'](_0x77de('0xf'),errorHandler);_0x38d012['on'](_0x77de('0x2a'),closeHandler);_0x38d012['on'](_0x77de('0x2b'),timeoutHandler);_0x38d012[_0x77de('0x2c')]=![];_0x38d012['on']('hangup',hangupHandler);var _0x20f96b=_['find'](projects,['name',_0x38d012[_0x77de('0x1f')]]);if(!_0x20f96b)return Project['handleNotFound'](_0x38d012);if(!_0x20f96b['production'])return Project['handleUnpublished'](_0x38d012);return Project[_0x77de('0x2d')](_0x20f96b,_0x38d012);}function main(){var _0x4e59d0;return utilLicense['getLicense']()[_0x77de('0x21')](function(_0x3fd31e){if(!_0x3fd31e)return;if(_0x3fd31e[_0x77de('0x2e')]){if(_0x3fd31e['callysquare']&&_0x3fd31e[_0x77de('0x2f')]>0x0){logger[_0x77de('0x18')](util[_0x77de('0x14')](_0x77de('0x30'),_0x3fd31e[_0x77de('0x2f')]));_0x4e59d0=_0x3fd31e[_0x77de('0x2f')];}else{logger[_0x77de('0x18')](_0x77de('0x31'));}}else{logger['info'](_0x77de('0x32'));_0x4e59d0=-0x1;}})[_0x77de('0x21')](function(){return Project['getAll']();})[_0x77de('0x21')](function(_0x1a400a){projects=_0x1a400a;return;})['catch'](function(_0x8fcdbc){logger['error'](_0x77de('0x33'),_0x8fcdbc['stack']);})[_0x77de('0x34')](function(){var _0x5ea783=require(_0x77de('0x35'))(config[_0x77de('0x3')]['port'],config[_0x77de('0x3')]['ip'],_0x4e59d0);_0x5ea783['on'](_0x77de('0xf'),errorHandler);_0x5ea783['on']('listening',listeningHandler);_0x5ea783['on'](_0x77de('0x36'),connectionHandler);_0x5ea783['on'](_0x77de('0x2a'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 044c459..572f954 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 _0x014d=['jayson/promise','client','request','error','message','sendMailMessage','SendMail'];(function(_0x525829,_0x6fafe){var _0x2e69ba=function(_0x1a1cb5){while(--_0x1a1cb5){_0x525829['push'](_0x525829['shift']());}};_0x2e69ba(++_0x6fafe);}(_0x014d,0x8c));var _0xd014=function(_0x3586d1,_0x44c92f){_0x3586d1=_0x3586d1-0x0;var _0x402651=_0x014d[_0x3586d1];return _0x402651;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xd014('0x0'));var client=jayson[_0xd014('0x1')]['http']({'port':0x232b});function request(_0x3ff2de,_0x4dea81){return new BPromise(function(_0x569c8c,_0x136fb5){return client[_0xd014('0x2')](_0x3ff2de,_0x4dea81)['then'](function(_0x1e1c6e){if(_0x1e1c6e[_0xd014('0x3')]){return _0x136fb5(_0x1e1c6e[_0xd014('0x3')][_0xd014('0x4')]);}else{return _0x569c8c(_0x1e1c6e['result']);}})['catch'](function(_0x186b61){return _0x136fb5(_0x186b61);});});}exports[_0xd014('0x5')]=function(_0x4904ac,_0x164305){return request(_0xd014('0x6'),{'account':_0x4904ac,'message':_0x164305});}; \ No newline at end of file +var _0xae82=['result','catch','sendMailMessage','SendMail','bluebird','client','http','request','then','error','message'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xae82,0x93));var _0x2ae8=function(_0x543b7e,_0x3e1448){_0x543b7e=_0x543b7e-0x0;var _0x49e0d1=_0xae82[_0x543b7e];return _0x49e0d1;};'use strict';var BPromise=require(_0x2ae8('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2ae8('0x1')][_0x2ae8('0x2')]({'port':0x232b});function request(_0x3b87be,_0x506bf5){return new BPromise(function(_0x588874,_0x57837d){return client[_0x2ae8('0x3')](_0x3b87be,_0x506bf5)[_0x2ae8('0x4')](function(_0x4a5a3a){if(_0x4a5a3a[_0x2ae8('0x5')]){return _0x57837d(_0x4a5a3a[_0x2ae8('0x5')][_0x2ae8('0x6')]);}else{return _0x588874(_0x4a5a3a[_0x2ae8('0x7')]);}})[_0x2ae8('0x8')](function(_0x4f241c){return _0x57837d(_0x4f241c);});});}exports[_0x2ae8('0x9')]=function(_0x4caaf5,_0x4edc6d){return request(_0x2ae8('0xa'),{'account':_0x4caaf5,'message':_0x4edc6d});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index d54ea7d..017fed0 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 _0xb931=['code','result','evtHangup','toString','response','agicommand\x20not\x20found','traverseBFS','finally','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','./vertices','catch','error','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','inspect','production','start','root','stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','clear','debug','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority'];(function(_0x493588,_0x196836){var _0x4a38c5=function(_0x282082){while(--_0x282082){_0x493588['push'](_0x493588['shift']());}};_0x4a38c5(++_0x196836);}(_0xb931,0x189));var _0x1b93=function(_0x4a19c7,_0x6cfd4c){_0x4a19c7=_0x4a19c7-0x0;var _0x98b6c8=_0xb931[_0x4a19c7];return _0x98b6c8;};'use strict';var _=require(_0x1b93('0x0'));var moment=require(_0x1b93('0x1'));var parser=require(_0x1b93('0x2'));var util=require(_0x1b93('0x3'));var logger=require(_0x1b93('0x4'))('agi');var rpc=require(_0x1b93('0x5'));var mailRpc=require(_0x1b93('0x6'));var Graph=require('./graph');var Vertices=require(_0x1b93('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x1b93('0x8')](function(_0x3daf4f){logger[_0x1b93('0x9')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x3daf4f[_0x1b93('0xa')]);return[];});}function addVertex(_0x42f568,_0x344f76,_0x513664){_0x344f76[_0x1b93('0xb')]=_0x513664;if(_0x344f76[_0x1b93('0xc')](_0x1b93('0xd'))){_0x344f76[_0x1b93('0xe')]=parseInt(_0x344f76[_0x1b93('0xd')],0xa);}_0x42f568[_0x1b93('0xf')](_[_0x1b93('0x10')](_0x344f76,_0x1b93('0x11')));}function initGraph(_0x2567b4,_0x27513d){var _0x445276=new Graph();for(var _0xa2fb02 in _0x2567b4){if(_0x2567b4[_0x1b93('0xc')](_0xa2fb02)){if(_[_0x1b93('0x12')](_0x2567b4[_0xa2fb02])){for(var _0xbde4bc=0x0;_0xbde4bc<_0x2567b4[_0xa2fb02][_0x1b93('0x13')];_0xbde4bc+=0x1){addVertex(_0x445276,_0x2567b4[_0xa2fb02][_0xbde4bc],_0xa2fb02);}}else{addVertex(_0x445276,_0x2567b4[_0xa2fb02],_0xa2fb02);}}}for(var _0x413277=0x0;_0x413277<_0x27513d[_0x1b93('0x13')];_0x413277+=0x1){if(_0x27513d[_0x413277][_0x1b93('0x14')]&&_0x27513d[_0x413277][_0x1b93('0x15')]){_0x445276[_0x1b93('0x16')](_0x27513d[_0x413277][_0x1b93('0x14')],_0x27513d[_0x413277][_0x1b93('0x15')],_0x27513d[_0x413277][_0x1b93('0x17')]);}}return _0x445276;}function getRoot(_0xb1925d){return parser[_0x1b93('0x18')](_0xb1925d,{'object':!![]})[_0x1b93('0x19')]['root'];}function inspect(_0x2e4401){return util[_0x1b93('0x1a')](_0x2e4401,{'showHidden':![],'depth':null});}function initialize(_0x328758,_0x1f8064){var _0x1b10db=getRoot(_0x328758[_0x1b93('0x1b')]);if(!_0x1b10db||!_0x1b10db[_0x1b93('0x1c')])return;var _0x2dda05,_0x36d49f,_0x1d76e6;logger['debug'](_0x1b93('0x1d'),JSON[_0x1b93('0x1e')](_0x1b10db,null,0x2));_0x1f8064['joinAt']=moment()[_0x1b93('0x1f')](_0x1b93('0x20'));_0x2dda05=initGraph(_[_0x1b93('0x10')](_0x1b10db,'mxCell'),_0x1b10db[_0x1b93('0x11')]);_0x36d49f=new Vertices(_0x1f8064,rpc,mailRpc);logger[_0x1b93('0x21')](util[_0x1b93('0x1f')](_0x1b93('0x22'),_0x1f8064[_0x1b93('0x23')],_0x1f8064[_0x1b93('0x24')],_0x1f8064[_0x1b93('0x25')],_0x1f8064[_0x1b93('0x26')],_0x1f8064[_0x1b93('0x27')]));_0x2dda05['traverseBFS'](_0x1b10db['start']['id'],function(_0x2abe89){try{_0x2abe89=_0x36d49f[_0x1b93('0x28')](_0x2abe89);logger[_0x1b93('0x29')](_0x1b93('0x2a'),JSON[_0x1b93('0x1e')](_0x2abe89,null,0x2));if(_0x2abe89[_0x1b93('0xb')]===_0x1b93('0x2b')){logger['info'](_0x1b93('0x2c'));_0x1f8064[_0x1b93('0x2d')]=_0x2abe89[_0x1b93('0x2d')]||_0x1f8064[_0x1b93('0x2d')];_0x1f8064[_0x1b93('0x2e')]=_0x2abe89[_0x1b93('0x2e')];_0x1f8064['priority']=_0x2abe89['priority']?_0x2abe89[_0x1b93('0x2f')]-0x1:0x1;return null;}else if(_0x2abe89&&_0x36d49f[_0x2abe89[_0x1b93('0xb')]]){_0x1d76e6=_0x36d49f[_0x2abe89['agicommand']](_0x2abe89);logger[_0x1b93('0x21')]('response',JSON[_0x1b93('0x1e')](_0x1d76e6,null,0x2));if(_0x1d76e6&&_0x1d76e6[_0x1b93('0x30')]===AGI_CODE_SUCCESS&&_0x1d76e6[_0x1b93('0x31')]!==AGI_RESULT_ERROR&&!_0x1f8064[_0x1b93('0x32')]){logger[_0x1b93('0x29')]('response',inspect(_0x1d76e6));return _['isUndefined'](_0x1d76e6[_0x1b93('0x31')])?null:_0x1d76e6[_0x1b93('0x31')][_0x1b93('0x33')]();}else{logger[_0x1b93('0x9')](_0x1b93('0x34'),inspect(_0x1d76e6));return null;}}else{logger[_0x1b93('0x9')](_0x1b93('0x35'));return null;}}catch(_0x40c98e){logger[_0x1b93('0x9')](_0x40c98e[_0x1b93('0xa')]);return null;}});if(_0x1b10db['finally']){logger[_0x1b93('0x21')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1f8064[_0x1b93('0x23')],_0x1f8064[_0x1b93('0x24')],_0x1f8064[_0x1b93('0x25')],_0x1f8064[_0x1b93('0x26')],_0x1f8064['uniqueid']));_0x2dda05[_0x1b93('0x36')](_0x1b10db[_0x1b93('0x37')]['id'],function(_0x22abe6){try{_0x22abe6=_0x36d49f[_0x1b93('0x28')](_0x22abe6);logger[_0x1b93('0x29')](_0x1b93('0x2a'),JSON[_0x1b93('0x1e')](_0x22abe6,null,0x2));if(_0x22abe6&&_0x36d49f[_0x22abe6[_0x1b93('0xb')]]){_0x1d76e6=_0x36d49f[_0x22abe6[_0x1b93('0xb')]](_0x22abe6);if(_0x1d76e6){logger['debug'](_0x1b93('0x34'),inspect(_0x1d76e6));return _[_0x1b93('0x38')](_0x1d76e6[_0x1b93('0x31')])?null:_0x1d76e6['result'][_0x1b93('0x33')]();}else{logger[_0x1b93('0x9')](_0x1b93('0x34'),inspect(_0x1d76e6));return null;}}else{logger['error'](_0x1b93('0x35'));return null;}}catch(_0x1ac75b){logger[_0x1b93('0x9')](_0x1ac75b['stack']);return null;}});}logger['info'](util[_0x1b93('0x1f')](_0x1b93('0x39'),_0x1f8064[_0x1b93('0x23')],_0x1f8064['calleridname'],_0x1f8064[_0x1b93('0x25')],_0x1f8064[_0x1b93('0x26')],_0x1f8064[_0x1b93('0x27')]));logger['info'](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1f8064[_0x1b93('0x2d')],_0x1f8064['extension'],parseInt(_0x1f8064[_0x1b93('0x2f')],0xa)+0x1));_0x1f8064[_0x1b93('0x3a')](_0x1f8064[_0x1b93('0x2d')],_0x1f8064[_0x1b93('0x2e')],parseInt(_0x1f8064[_0x1b93('0x2f')],0xa)+0x1);_0x1f8064[_0x1b93('0x3b')]();}function handleNotFound(_0x5415db){logger[_0x1b93('0x9')](util[_0x1b93('0x1f')](_0x1b93('0x3c'),_0x5415db[_0x1b93('0x23')]));_0x5415db[_0x1b93('0x3a')](_0x5415db[_0x1b93('0x2d')],_0x5415db['extension'],parseInt(_0x5415db[_0x1b93('0x2f')],0xa)+0x1);_0x5415db['close']();}function handleUnpublished(_0x4ed343){logger[_0x1b93('0x9')](util[_0x1b93('0x1f')](_0x1b93('0x3d'),_0x4ed343[_0x1b93('0x23')]));_0x4ed343[_0x1b93('0x3a')](_0x4ed343[_0x1b93('0x2d')],_0x4ed343[_0x1b93('0x2e')],parseInt(_0x4ed343[_0x1b93('0x2f')],0xa)+0x1);_0x4ed343[_0x1b93('0x3b')]();}module[_0x1b93('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xa97d=['root','inspect','production','start','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','evtHangup','debug','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','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','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel'];(function(_0x2afdfa,_0x42acad){var _0x56c624=function(_0x386bad){while(--_0x386bad){_0x2afdfa['push'](_0x2afdfa['shift']());}};_0x56c624(++_0x42acad);}(_0xa97d,0x122));var _0xda97=function(_0x565610,_0x1a4085){_0x565610=_0x565610-0x0;var _0x89951f=_0xa97d[_0x565610];return _0x89951f;};'use strict';var _=require(_0xda97('0x0'));var moment=require(_0xda97('0x1'));var parser=require('xml2json');var util=require(_0xda97('0x2'));var logger=require(_0xda97('0x3'))('agi');var rpc=require('./rpc');var mailRpc=require(_0xda97('0x4'));var Graph=require(_0xda97('0x5'));var Vertices=require(_0xda97('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xda97('0x7')]()[_0xda97('0x8')](function(_0x5c57de){logger[_0xda97('0x9')](_0xda97('0xa'),_0x5c57de[_0xda97('0xb')]);return[];});}function addVertex(_0x2a37a6,_0x17152c,_0x1cb16e){_0x17152c['agicommand']=_0x1cb16e;if(_0x17152c[_0xda97('0xc')](_0xda97('0xd'))){_0x17152c[_0xda97('0xe')]=parseInt(_0x17152c[_0xda97('0xd')],0xa);}_0x2a37a6[_0xda97('0xf')](_['omit'](_0x17152c,_0xda97('0x10')));}function initGraph(_0x41035b,_0x777c2d){var _0x18c934=new Graph();for(var _0x169888 in _0x41035b){if(_0x41035b['hasOwnProperty'](_0x169888)){if(_[_0xda97('0x11')](_0x41035b[_0x169888])){for(var _0x79b7c=0x0;_0x79b7c<_0x41035b[_0x169888][_0xda97('0x12')];_0x79b7c+=0x1){addVertex(_0x18c934,_0x41035b[_0x169888][_0x79b7c],_0x169888);}}else{addVertex(_0x18c934,_0x41035b[_0x169888],_0x169888);}}}for(var _0x4fbd2f=0x0;_0x4fbd2f<_0x777c2d[_0xda97('0x12')];_0x4fbd2f+=0x1){if(_0x777c2d[_0x4fbd2f][_0xda97('0x13')]&&_0x777c2d[_0x4fbd2f][_0xda97('0x14')]){_0x18c934[_0xda97('0x15')](_0x777c2d[_0x4fbd2f][_0xda97('0x13')],_0x777c2d[_0x4fbd2f][_0xda97('0x14')],_0x777c2d[_0x4fbd2f][_0xda97('0x16')]);}}return _0x18c934;}function getRoot(_0x22e630){return parser[_0xda97('0x17')](_0x22e630,{'object':!![]})[_0xda97('0x18')][_0xda97('0x19')];}function inspect(_0xc4ff5b){return util[_0xda97('0x1a')](_0xc4ff5b,{'showHidden':![],'depth':null});}function initialize(_0x13cca2,_0x4d19c2){var _0x57aef8=getRoot(_0x13cca2[_0xda97('0x1b')]);if(!_0x57aef8||!_0x57aef8[_0xda97('0x1c')])return;var _0x1ae6cc,_0x239470,_0x3d5472;logger['debug'](_0xda97('0x19'),JSON[_0xda97('0x1d')](_0x57aef8,null,0x2));_0x4d19c2[_0xda97('0x1e')]=moment()[_0xda97('0x1f')](_0xda97('0x20'));_0x1ae6cc=initGraph(_[_0xda97('0x21')](_0x57aef8,'mxCell'),_0x57aef8['mxCell']);_0x239470=new Vertices(_0x4d19c2,rpc,mailRpc);logger[_0xda97('0x22')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d19c2[_0xda97('0x23')],_0x4d19c2[_0xda97('0x24')],_0x4d19c2[_0xda97('0x25')],_0x4d19c2['dnid'],_0x4d19c2[_0xda97('0x26')]));_0x1ae6cc[_0xda97('0x27')](_0x57aef8[_0xda97('0x1c')]['id'],function(_0x16ad49){try{_0x16ad49=_0x239470[_0xda97('0x28')](_0x16ad49);logger['debug'](_0xda97('0x29'),JSON[_0xda97('0x1d')](_0x16ad49,null,0x2));if(_0x16ad49[_0xda97('0x2a')]==='gotoc'){logger[_0xda97('0x22')](_0xda97('0x2b'));_0x4d19c2[_0xda97('0x2c')]=_0x16ad49['context']||_0x4d19c2[_0xda97('0x2c')];_0x4d19c2[_0xda97('0x2d')]=_0x16ad49['extension'];_0x4d19c2[_0xda97('0x2e')]=_0x16ad49[_0xda97('0x2e')]?_0x16ad49[_0xda97('0x2e')]-0x1:0x1;return null;}else if(_0x16ad49&&_0x239470[_0x16ad49[_0xda97('0x2a')]]){_0x3d5472=_0x239470[_0x16ad49[_0xda97('0x2a')]](_0x16ad49);logger[_0xda97('0x22')]('response',JSON['stringify'](_0x3d5472,null,0x2));if(_0x3d5472&&_0x3d5472['code']===AGI_CODE_SUCCESS&&_0x3d5472['result']!==AGI_RESULT_ERROR&&!_0x4d19c2[_0xda97('0x2f')]){logger[_0xda97('0x30')](_0xda97('0x31'),inspect(_0x3d5472));return _[_0xda97('0x32')](_0x3d5472[_0xda97('0x33')])?null:_0x3d5472[_0xda97('0x33')][_0xda97('0x34')]();}else{logger[_0xda97('0x9')]('response',inspect(_0x3d5472));return null;}}else{logger['error'](_0xda97('0x35'));return null;}}catch(_0x48544a){logger[_0xda97('0x9')](_0x48544a['stack']);return null;}});if(_0x57aef8[_0xda97('0x36')]){logger[_0xda97('0x22')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d19c2['arg_1'],_0x4d19c2[_0xda97('0x24')],_0x4d19c2[_0xda97('0x25')],_0x4d19c2[_0xda97('0x37')],_0x4d19c2['uniqueid']));_0x1ae6cc[_0xda97('0x27')](_0x57aef8[_0xda97('0x36')]['id'],function(_0x62a9d){try{_0x62a9d=_0x239470[_0xda97('0x28')](_0x62a9d);logger[_0xda97('0x30')](_0xda97('0x29'),JSON[_0xda97('0x1d')](_0x62a9d,null,0x2));if(_0x62a9d&&_0x239470[_0x62a9d[_0xda97('0x2a')]]){_0x3d5472=_0x239470[_0x62a9d[_0xda97('0x2a')]](_0x62a9d);if(_0x3d5472){logger[_0xda97('0x30')]('response',inspect(_0x3d5472));return _[_0xda97('0x32')](_0x3d5472[_0xda97('0x33')])?null:_0x3d5472[_0xda97('0x33')][_0xda97('0x34')]();}else{logger['error'](_0xda97('0x31'),inspect(_0x3d5472));return null;}}else{logger[_0xda97('0x9')](_0xda97('0x35'));return null;}}catch(_0x3c22b5){logger[_0xda97('0x9')](_0x3c22b5[_0xda97('0xb')]);return null;}});}logger[_0xda97('0x22')](util[_0xda97('0x1f')](_0xda97('0x38'),_0x4d19c2[_0xda97('0x23')],_0x4d19c2['calleridname'],_0x4d19c2[_0xda97('0x25')],_0x4d19c2[_0xda97('0x37')],_0x4d19c2['uniqueid']));logger[_0xda97('0x22')](util['format'](_0xda97('0x39'),_0x4d19c2[_0xda97('0x2c')],_0x4d19c2[_0xda97('0x2d')],parseInt(_0x4d19c2[_0xda97('0x2e')],0xa)+0x1));_0x4d19c2[_0xda97('0x3a')](_0x4d19c2['context'],_0x4d19c2[_0xda97('0x2d')],parseInt(_0x4d19c2[_0xda97('0x2e')],0xa)+0x1);_0x4d19c2['close']();}function handleNotFound(_0x11cc4f){logger[_0xda97('0x9')](util[_0xda97('0x1f')](_0xda97('0x3b'),_0x11cc4f[_0xda97('0x23')]));_0x11cc4f[_0xda97('0x3a')](_0x11cc4f[_0xda97('0x2c')],_0x11cc4f[_0xda97('0x2d')],parseInt(_0x11cc4f['priority'],0xa)+0x1);_0x11cc4f[_0xda97('0x3c')]();}function handleUnpublished(_0x3537a2){logger['error'](util[_0xda97('0x1f')](_0xda97('0x3d'),_0x3537a2['arg_1']));_0x3537a2[_0xda97('0x3a')](_0x3537a2[_0xda97('0x2c')],_0x3537a2[_0xda97('0x2d')],parseInt(_0x3537a2['priority'],0xa)+0x1);_0x3537a2[_0xda97('0x3c')]();}module[_0xda97('0x3e')]={'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 51bf48d..9aea36f 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 _0x6005=['_localBuffer','_transform','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','call'];(function(_0x39ad51,_0x3b1d16){var _0xd01aa3=function(_0x5bfab9){while(--_0x5bfab9){_0x39ad51['push'](_0x39ad51['shift']());}};_0xd01aa3(++_0x3b1d16);}(_0x6005,0x11e));var _0x5600=function(_0x23c4bc,_0x1812d7){_0x23c4bc=_0x23c4bc-0x0;var _0x62a55d=_0x6005[_0x23c4bc];return _0x62a55d;};'use strict';var util=require(_0x5600('0x0'));var Transform=require(_0x5600('0x1'))['Transform'];function AGIReply(_0x2a254c){Transform[_0x5600('0x2')](this,_0x2a254c);this[_0x5600('0x3')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x5600('0x4')]=function(_0x2e7bf7,_0x49c5a4,_0xe0948c){var _0x474367='\x0a',_0x13ebe8=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x34b276=-0x1,_0x45cb2e=-0x1,_0x45594d='',_0x531aca=0x0,_0x556df7='',_0x16e68c='';this[_0x5600('0x3')]+=_0x2e7bf7[_0x5600('0x5')]();_0x556df7=this[_0x5600('0x3')];if(!this[_0x5600('0x6')]){_0x531aca=0x0;while(_0x13ebe8[_0x531aca]){while((_0x45cb2e=_0x556df7[_0x5600('0x7')](_0x13ebe8[_0x531aca]))!=-0x1){_0x45594d=_0x13ebe8[_0x531aca];_0x16e68c=_0x556df7[_0x5600('0x8')](0x0,_0x45cb2e);_0x556df7=_0x556df7['substring'](_0x45cb2e+_0x45594d[_0x5600('0x9')]);var _0x2e9c54=_0x16e68c[_0x5600('0xa')](_0x474367),_0x29b572=0x0,_0x58d5e7={},_0x3fdbda='',_0x4c0a9e='',_0x2a1311=-0x1;while(_0x2e9c54[_0x29b572]){_0x2a1311=_0x2e9c54[_0x29b572][_0x5600('0x7')](':');if(_0x2a1311!=-0x1){_0x3fdbda=_0x2e9c54[_0x29b572][_0x5600('0xb')](0x0,_0x2a1311)[_0x5600('0xc')]();_0x4c0a9e=_0x2e9c54[_0x29b572][_0x5600('0xb')](_0x2a1311+0x1)[_0x5600('0xc')]();if(_0x3fdbda[_0x5600('0x9')]>0x0){_0x58d5e7[_0x3fdbda]=_0x4c0a9e;}}else{}_0x29b572++;}this[_0x5600('0xd')](_0x5600('0xe'),_0x58d5e7);this[_0x5600('0x6')]=!![];}_0x531aca++;}this['_localBuffer']=_0x556df7;}else{while((_0x34b276=_0x556df7[_0x5600('0x7')](_0x474367))!=-0x1){_0x16e68c=_0x556df7[_0x5600('0x8')](0x0,_0x34b276);this[_0x5600('0xd')](_0x5600('0xf'),_0x16e68c);_0x556df7=_0x556df7[_0x5600('0x8')](_0x34b276+_0x474367[_0x5600('0x9')]);}this[_0x5600('0x3')]=_0x556df7;}_0xe0948c();};module[_0x5600('0x10')]=AGIReply; \ No newline at end of file +var _0x93f1=['\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','Transform','call','_localBuffer','inherits','_transform'];(function(_0x1f8923,_0x9b9d55){var _0x1b9bc3=function(_0x5016f4){while(--_0x5016f4){_0x1f8923['push'](_0x1f8923['shift']());}};_0x1b9bc3(++_0x9b9d55);}(_0x93f1,0x1b1));var _0x193f=function(_0x82234a,_0xa94c50){_0x82234a=_0x82234a-0x0;var _0x54702e=_0x93f1[_0x82234a];return _0x54702e;};'use strict';var util=require(_0x193f('0x0'));var Transform=require(_0x193f('0x1'))[_0x193f('0x2')];function AGIReply(_0x537c90){Transform[_0x193f('0x3')](this,_0x537c90);this[_0x193f('0x4')]='';this['_inBody']=![];}util[_0x193f('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x193f('0x6')]=function(_0x54529c,_0x31af60,_0x5670ea){var _0xd9bc2d='\x0a',_0xddcb90=['\x0a\x0a',_0x193f('0x7')],_0x21c670=-0x1,_0xf6027d=-0x1,_0x186e72='',_0x56059d=0x0,_0x269aa2='',_0x2ee15b='';this[_0x193f('0x4')]+=_0x54529c[_0x193f('0x8')]();_0x269aa2=this[_0x193f('0x4')];if(!this[_0x193f('0x9')]){_0x56059d=0x0;while(_0xddcb90[_0x56059d]){while((_0xf6027d=_0x269aa2[_0x193f('0xa')](_0xddcb90[_0x56059d]))!=-0x1){_0x186e72=_0xddcb90[_0x56059d];_0x2ee15b=_0x269aa2[_0x193f('0xb')](0x0,_0xf6027d);_0x269aa2=_0x269aa2[_0x193f('0xb')](_0xf6027d+_0x186e72[_0x193f('0xc')]);var _0xa9fc53=_0x2ee15b[_0x193f('0xd')](_0xd9bc2d),_0x34268f=0x0,_0x197fe3={},_0xa04d4e='',_0x1187c7='',_0x1765bd=-0x1;while(_0xa9fc53[_0x34268f]){_0x1765bd=_0xa9fc53[_0x34268f][_0x193f('0xa')](':');if(_0x1765bd!=-0x1){_0xa04d4e=_0xa9fc53[_0x34268f][_0x193f('0xe')](0x0,_0x1765bd)['trim']();_0x1187c7=_0xa9fc53[_0x34268f][_0x193f('0xe')](_0x1765bd+0x1)[_0x193f('0xf')]();if(_0xa04d4e['length']>0x0){_0x197fe3[_0xa04d4e]=_0x1187c7;}}else{}_0x34268f++;}this[_0x193f('0x10')](_0x193f('0x11'),_0x197fe3);this[_0x193f('0x9')]=!![];}_0x56059d++;}this[_0x193f('0x4')]=_0x269aa2;}else{while((_0x21c670=_0x269aa2[_0x193f('0xa')](_0xd9bc2d))!=-0x1){_0x2ee15b=_0x269aa2[_0x193f('0xb')](0x0,_0x21c670);this[_0x193f('0x10')](_0x193f('0x12'),_0x2ee15b);_0x269aa2=_0x269aa2[_0x193f('0xb')](_0x21c670+_0xd9bc2d[_0x193f('0xc')]);}this['_localBuffer']=_0x269aa2;}_0x5670ea();};module[_0x193f('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 073779b..60dbe91 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 _0xc818=['Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','Interval'];(function(_0x1a9bd2,_0xb116b1){var _0x2eb654=function(_0x3d415c){while(--_0x3d415c){_0x1a9bd2['push'](_0x1a9bd2['shift']());}};_0x2eb654(++_0xb116b1);}(_0xc818,0x1e3));var _0x8c81=function(_0x491803,_0x3c0c06){_0x491803=_0x491803-0x0;var _0x47c9ef=_0xc818[_0x491803];return _0x47c9ef;};'use strict';var _=require(_0x8c81('0x0'));var moment=require(_0x8c81('0x1'));var jayson=require(_0x8c81('0x2'));var client=jayson[_0x8c81('0x3')]['http']({'port':0x2329});function request(_0x461c5f,_0x7a8137){return new Promise(function(_0x40b19e,_0x7e329f){return client[_0x8c81('0x4')](_0x461c5f,_0x7a8137)[_0x8c81('0x5')](function(_0x377b23){if(_0x377b23['error']){return _0x7e329f(_0x377b23[_0x8c81('0x6')][_0x8c81('0x7')]);}else{return _0x40b19e(_0x377b23[_0x8c81('0x8')]);}})[_0x8c81('0x9')](function(_0x501240){return _0x7e329f(_0x501240);});});}exports[_0x8c81('0xa')]=function(){return request(_0x8c81('0xb'),{'options':{'raw':![],'attributes':['id',_0x8c81('0xc'),_0x8c81('0xd')]}});};exports[_0x8c81('0xe')]=function(_0x2ce097){return request(_0x8c81('0xf'),{'options':{'raw':![],'where':{'name':_0x2ce097},'attributes':['production']}});};exports[_0x8c81('0x10')]=function(_0x37dbb4){return request(_0x8c81('0x11'),{'options':{'raw':![],'where':{'id':_0x37dbb4},'include':[{'model':_0x8c81('0x12'),'as':'Smtp','include':[{'model':_0x8c81('0x13'),'as':_0x8c81('0x13')}]}],'attributes':['id',_0x8c81('0xc'),_0x8c81('0x14')],'smtp':!![]}});};exports[_0x8c81('0x15')]=function(_0x112be6){return request(_0x8c81('0xf'),{'options':{'where':{'id':_0x112be6},'attributes':[_0x8c81('0xc')]}});};exports[_0x8c81('0x16')]=function(_0x5a6e72){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5a6e72},'attributes':[_0x8c81('0xc')]}});};exports[_0x8c81('0x17')]=function(_0x238ce5){return request(_0x8c81('0x18'),{'options':{'where':{'id':_0x238ce5},'attributes':[_0x8c81('0xc')]}});};exports[_0x8c81('0x19')]=function(_0x4f7180){return request(_0x8c81('0x1a'),{'options':{'where':{'id':_0x4f7180},'attributes':[_0x8c81('0x1b')]}});};exports[_0x8c81('0x1c')]=function(_0x1fc95b){return request(_0x8c81('0x1d'),{'options':{'where':{'id':_0x1fc95b},'attributes':['name']}});};exports[_0x8c81('0x1e')]=function(_0x4d0b75){return request('GetContactByPhone',{'options':{'where':{'phone':_0x4d0b75['phone']},'attributes':['id']}});};exports[_0x8c81('0x1f')]=function(_0x13e312){return request(_0x8c81('0x20'),{'options':{'where':{'id':_0x13e312},'attributes':['name']}});};exports[_0x8c81('0x21')]=function(_0x2312d5){return request(_0x8c81('0x22'),{'options':{'where':{'id':_0x2312d5},'attributes':['save_name']}});};exports[_0x8c81('0x23')]=function(_0x16c71a){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x16c71a},'include':[{'model':_0x8c81('0x24'),'as':_0x8c81('0x25')}]}});};exports['getSmsAccountById']=function(_0x566cfc){return request(_0x8c81('0x26'),{'options':{'where':{'id':_0x566cfc},'attributes':['id',_0x8c81('0xc')]}});};exports[_0x8c81('0x27')]=function(_0x49cedc){return request(_0x8c81('0x28'),{'body':_0x49cedc});};exports[_0x8c81('0x29')]=function(_0x2ccd2f){return request(_0x8c81('0x2a'),{'body':_0x2ccd2f});};exports[_0x8c81('0x2b')]=function(_0x2bc6b7){return request(_0x8c81('0x2c'),{'body':_[_0x8c81('0x2d')](_0x2bc6b7,{'project_name':_0x2bc6b7['arg_1'],'prev_project_name':_0x2bc6b7['arg_2']||'','is_subproject':_0x2bc6b7[_0x8c81('0x2e')]?!![]:![],'leaveAt':moment()[_0x8c81('0x2f')](_0x8c81('0x30'))})});};exports[_0x8c81('0x31')]=function(_0x3e5ed1){return request(_0x8c81('0x32'),{'body':_0x3e5ed1});};exports[_0x8c81('0x33')]=function(_0x1d30d5){return request(_0x8c81('0x34'),{'body':_0x1d30d5});};exports[_0x8c81('0x35')]=function(_0x477a9e){return request(_0x8c81('0x36'),{'options':{'raw':![],'where':{'phone':_0x477a9e[_0x8c81('0x37')],'ListId':_0x477a9e['ListId']}}})[_0x8c81('0x5')](function(_0xc9de87){if(_0xc9de87){return _0xc9de87;}return request(_0x8c81('0x38'),{'body':_0x477a9e});});};exports[_0x8c81('0x39')]=function(_0x428aba){return request(_0x8c81('0x3a'),{'options':{'where':{'id':_0x428aba},'attributes':[_0x8c81('0xc')]}});};exports[_0x8c81('0x3b')]=function(_0x2f419f,_0x54ca62){return request(_0x8c81('0x3c'),{'body':{'interface':_0x54ca62},'options':{'where':_0x2f419f}});};exports[_0x8c81('0x3d')]=function(_0x23c0be,_0x25654d,_0x1d931f){return request('PauseUser',{'body':{'type':_0x25654d,'uniqueid':_0x1d931f},'options':{'where':_0x23c0be}});};exports[_0x8c81('0x3e')]=function(_0x15d5c4){return request(_0x8c81('0x3f'),{'body':{},'options':{'where':_0x15d5c4}});};exports[_0x8c81('0x40')]=function(_0x267c01){return request('LogoutUser',{'body':{},'options':{'where':_0x267c01}});}; \ No newline at end of file +var _0xcb81=['createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','request','then','error','message','catch','getSquareProjects','name','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xcb81,0x154));var _0x1cb8=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0xcb81[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x1cb8('0x0'));var moment=require(_0x1cb8('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x1cb8('0x2')]['http']({'port':0x2329});function request(_0x5e8697,_0x55f3a0){return new Promise(function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x3')](_0x5e8697,_0x55f3a0)[_0x1cb8('0x4')](function(_0x41b867){if(_0x41b867['error']){return _0x33a8f2(_0x41b867[_0x1cb8('0x5')][_0x1cb8('0x6')]);}else{return _0x38c3ea(_0x41b867['result']);}})[_0x1cb8('0x7')](function(_0x39b4ad){return _0x33a8f2(_0x39b4ad);});});}exports[_0x1cb8('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x1cb8('0x9'),'production']}});};exports['getSquareProject']=function(_0x29e901){return request(_0x1cb8('0xa'),{'options':{'raw':![],'where':{'name':_0x29e901},'attributes':[_0x1cb8('0xb')]}});};exports[_0x1cb8('0xc')]=function(_0x267dde){return request(_0x1cb8('0xd'),{'options':{'raw':![],'where':{'id':_0x267dde},'include':[{'model':_0x1cb8('0xe'),'as':_0x1cb8('0xf'),'include':[{'model':'CloudProvider','as':_0x1cb8('0x10')}]}],'attributes':['id',_0x1cb8('0x9'),_0x1cb8('0x11')],'smtp':!![]}});};exports[_0x1cb8('0x12')]=function(_0x1371cb){return request('ShowSquareProject',{'options':{'where':{'id':_0x1371cb},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x13')]=function(_0xcb6ad1){return request(_0x1cb8('0x14'),{'options':{'where':{'id':_0xcb6ad1},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x15')]=function(_0x339ad0){return request(_0x1cb8('0x16'),{'options':{'where':{'id':_0x339ad0},'attributes':['name']}});};exports[_0x1cb8('0x17')]=function(_0x4b4917){return request(_0x1cb8('0x18'),{'options':{'where':{'id':_0x4b4917},'attributes':[_0x1cb8('0x19')]}});};exports[_0x1cb8('0x1a')]=function(_0x46abd0){return request(_0x1cb8('0x1b'),{'options':{'where':{'id':_0x46abd0},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x1c')]=function(_0x9f0adb){return request(_0x1cb8('0x1d'),{'options':{'where':{'phone':_0x9f0adb[_0x1cb8('0x1e')]},'attributes':['id']}});};exports[_0x1cb8('0x1f')]=function(_0x3cda27){return request('ShowTrunk',{'options':{'where':{'id':_0x3cda27},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x20')]=function(_0x170f34){return request(_0x1cb8('0x21'),{'options':{'where':{'id':_0x170f34},'attributes':['save_name']}});};exports[_0x1cb8('0x22')]=function(_0x4f9220){return request(_0x1cb8('0x23'),{'options':{'raw':![],'where':{'id':_0x4f9220},'include':[{'model':_0x1cb8('0x24'),'as':_0x1cb8('0x25')}]}});};exports[_0x1cb8('0x26')]=function(_0x559916){return request('ShowSmsAccount',{'options':{'where':{'id':_0x559916},'attributes':['id',_0x1cb8('0x9')]}});};exports[_0x1cb8('0x27')]=function(_0x22dafe){return request(_0x1cb8('0x28'),{'body':_0x22dafe});};exports[_0x1cb8('0x29')]=function(_0x30985c){return request(_0x1cb8('0x2a'),{'body':_0x30985c});};exports['createSquareReport']=function(_0x1ec384){return request(_0x1cb8('0x2b'),{'body':_[_0x1cb8('0x2c')](_0x1ec384,{'project_name':_0x1ec384[_0x1cb8('0x2d')],'prev_project_name':_0x1ec384[_0x1cb8('0x2e')]||'','is_subproject':_0x1ec384[_0x1cb8('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0x1cb8('0x2f'))})});};exports[_0x1cb8('0x30')]=function(_0xfdfb31){return request(_0x1cb8('0x31'),{'body':_0xfdfb31});};exports[_0x1cb8('0x32')]=function(_0x4a9b74){return request(_0x1cb8('0x33'),{'body':_0x4a9b74});};exports[_0x1cb8('0x34')]=function(_0x3a8b53){return request(_0x1cb8('0x35'),{'options':{'raw':![],'where':{'phone':_0x3a8b53['phone'],'ListId':_0x3a8b53[_0x1cb8('0x36')]}}})[_0x1cb8('0x4')](function(_0x3a6a67){if(_0x3a6a67){return _0x3a6a67;}return request('CreateCmContact',{'body':_0x3a8b53});});};exports[_0x1cb8('0x37')]=function(_0x2a6da9){return request(_0x1cb8('0x38'),{'options':{'where':{'id':_0x2a6da9},'attributes':['name']}});};exports[_0x1cb8('0x39')]=function(_0x3e2af4,_0x239c62){return request(_0x1cb8('0x3a'),{'body':{'interface':_0x239c62},'options':{'where':_0x3e2af4}});};exports[_0x1cb8('0x3b')]=function(_0x54278d,_0x2607f0,_0x1de806){return request(_0x1cb8('0x3c'),{'body':{'type':_0x2607f0,'uniqueid':_0x1de806},'options':{'where':_0x54278d}});};exports[_0x1cb8('0x3d')]=function(_0x18fe1b){return request(_0x1cb8('0x3e'),{'body':{},'options':{'where':_0x18fe1b}});};exports[_0x1cb8('0x3f')]=function(_0x18cc99){return request(_0x1cb8('0x40'),{'body':{},'options':{'where':_0x18cc99}});}; \ 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 7560848..245f0d5 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 _0xb0df=['exports','./lex'];(function(_0x2edc3b,_0x7111f1){var _0x231f9e=function(_0x401f5d){while(--_0x401f5d){_0x2edc3b['push'](_0x2edc3b['shift']());}};_0x231f9e(++_0x7111f1);}(_0xb0df,0x85));var _0xfb0d=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xb0df[_0x483ab9];return _0x35043b;};var polly=require('./polly');var lex=require(_0xfb0d('0x0'));module[_0xfb0d('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x8be8=['./polly','./lex','exports'];(function(_0xa39e0a,_0x25f6a5){var _0x1f036a=function(_0x293cff){while(--_0x293cff){_0xa39e0a['push'](_0xa39e0a['shift']());}};_0x1f036a(++_0x25f6a5);}(_0x8be8,0xf6));var _0x88be=function(_0x45d9f1,_0x282339){_0x45d9f1=_0x45d9f1-0x0;var _0x421048=_0x8be8[_0x45d9f1];return _0x421048;};var polly=require(_0x88be('0x0'));var lex=require(_0x88be('0x1'));module[_0x88be('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 32420eb..abfdc3d 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 _0x6f0d=['exports'];(function(_0xd6634d,_0x3e73ca){var _0x1209b6=function(_0x4e8c4a){while(--_0x4e8c4a){_0xd6634d['push'](_0xd6634d['shift']());}};_0x1209b6(++_0x3e73ca);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x8f6ad3,_0x254c82){_0x8f6ad3=_0x8f6ad3-0x0;var _0x11ca4a=_0x6f0d[_0x8f6ad3];return _0x11ca4a;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ No newline at end of file +var _0x4483=['exports','./lib/api'];(function(_0x502fda,_0x464a03){var _0x3aa971=function(_0x13b3dd){while(--_0x13b3dd){_0x502fda['push'](_0x502fda['shift']());}};_0x3aa971(++_0x464a03);}(_0x4483,0x1a3));var _0x3448=function(_0x379f13,_0x4e544a){_0x379f13=_0x379f13-0x0;var _0xac314e=_0x4483[_0x379f13];return _0xac314e;};'use strict';var lex=require(_0x3448('0x0'));module[_0x3448('0x1')]=function(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178){return lex(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178);}; \ 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 bb2368c..beb7c2e 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(_0x22f901,_0x3f3a32){var _0x394317=function(_0x59eac0){while(--_0x59eac0){_0x22f901['push'](_0x22f901['shift']());}};_0x394317(++_0x3f3a32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x10fc38,_0x55bb49){var _0x207c54=function(_0x259aab){while(--_0x259aab){_0x10fc38['push'](_0x10fc38['shift']());}};_0x207c54(++_0x55bb49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 83b267e..2a2c709 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 _0x63b0=['exports','./lib/api'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x63b0,0x1d1));var _0x063b=function(_0x506c00,_0x1bbb3d){_0x506c00=_0x506c00-0x0;var _0x59ab36=_0x63b0[_0x506c00];return _0x59ab36;};'use strict';var polly=require(_0x063b('0x0'));module[_0x063b('0x1')]=function(_0xa2b0,_0x3564f2,_0x120f69,_0x54e2f8,_0x2151af,_0x579623,_0x75f900){return polly(_0xa2b0,_0x3564f2,_0x120f69,_0x54e2f8,_0x2151af,_0x579623,_0x75f900);}; \ No newline at end of file +var _0x069b=['./lib/api'];(function(_0x21afd3,_0x299177){var _0x504a2f=function(_0x384d29){while(--_0x384d29){_0x21afd3['push'](_0x21afd3['shift']());}};_0x504a2f(++_0x299177);}(_0x069b,0x177));var _0xb069=function(_0x190c7f,_0x2f1129){_0x190c7f=_0x190c7f-0x0;var _0x12c1f6=_0x069b[_0x190c7f];return _0x12c1f6;};'use strict';var polly=require(_0xb069('0x0'));module['exports']=function(_0x518af5,_0x486547,_0x1d5038,_0x2e6e2d,_0x18438e,_0x3ff48b,_0x179f69){return polly(_0x518af5,_0x486547,_0x1d5038,_0x2e6e2d,_0x18438e,_0x3ff48b,_0x179f69);}; \ 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 eba6460..6edad69 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 _0x8bc1=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','randomstring'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8bc1,0x1ae));var _0x18bc=function(_0x394e95,_0x2fbca4){_0x394e95=_0x394e95-0x0;var _0x1e47f9=_0x8bc1[_0x394e95];return _0x1e47f9;};'use strict';var fs=require('fs');var path=require(_0x18bc('0x0'));var BPromise=require('bluebird');var rs=require(_0x18bc('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x148b52,_0x46966b,_0x2c7dfb){return new BPromise(function(_0xcc96ea,_0x35e428){_0x148b52[_0x18bc('0x2')](_0x46966b,function(_0x5aec28,_0x1f50db){if(_0x5aec28){_0x35e428(_0x5aec28);}else if(_0x1f50db){if(_0x1f50db['AudioStream']instanceof Buffer){fs[_0x18bc('0x3')](_0x2c7dfb,_0x1f50db[_0x18bc('0x4')],function(_0x4aeb7f){if(_0x4aeb7f){_0x35e428(_0x4aeb7f);}else{_0xcc96ea();}});}else{_0x35e428(new Error(_0x18bc('0x5')));}}else{_0x35e428(new Error(_0x18bc('0x6')));}});});}module['exports']=function(_0x517e45,_0x50fd95,_0x40dc23,_0x10c892,_0x12da8a,_0xc57b14,_0x334c6d){var _0x11bbf9=new AWS['Polly']({'accessKeyId':_0x517e45,'secretAccessKey':_0x50fd95,'region':_0x40dc23});var _0x5ac826={'Text':_0x12da8a,'TextType':_0xc57b14||_0x18bc('0x7'),'OutputFormat':_0x18bc('0x8'),'VoiceId':_0x10c892};return pollyResult(_0x11bbf9,_0x5ac826,_0x334c6d);}; \ No newline at end of file +var _0xf42b=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xf42b,0x80));var _0xbf42=function(_0x294ba2,_0x17be38){_0x294ba2=_0x294ba2-0x0;var _0xd857e6=_0xf42b[_0x294ba2];return _0xd857e6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xbf42('0x0'));var rs=require(_0xbf42('0x1'));var AWS=require(_0xbf42('0x2'));function pollyResult(_0x4d45f5,_0x189519,_0x151ecf){return new BPromise(function(_0x1e772f,_0x3e5375){_0x4d45f5['synthesizeSpeech'](_0x189519,function(_0x2fb637,_0x121f38){if(_0x2fb637){_0x3e5375(_0x2fb637);}else if(_0x121f38){if(_0x121f38[_0xbf42('0x3')]instanceof Buffer){fs[_0xbf42('0x4')](_0x151ecf,_0x121f38['AudioStream'],function(_0xdb6436){if(_0xdb6436){_0x3e5375(_0xdb6436);}else{_0x1e772f();}});}else{_0x3e5375(new Error(_0xbf42('0x5')));}}else{_0x3e5375(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xbf42('0x6')]=function(_0x444bac,_0x5332a0,_0x5864e5,_0x220dd3,_0x52360f,_0x1cfd1f,_0x4b9ba7){var _0x348649=new AWS[(_0xbf42('0x7'))]({'accessKeyId':_0x444bac,'secretAccessKey':_0x5332a0,'region':_0x5864e5});var _0x29588c={'Text':_0x52360f,'TextType':_0x1cfd1f||_0xbf42('0x8'),'OutputFormat':_0xbf42('0x9'),'VoiceId':_0x220dd3};return pollyResult(_0x348649,_0x29588c,_0x4b9ba7);}; \ 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 70c8546..ee88bef 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 _0xf94f=['./lib/api','exports'];(function(_0x21eef3,_0x19f189){var _0x33943a=function(_0x8bb792){while(--_0x8bb792){_0x21eef3['push'](_0x21eef3['shift']());}};_0x33943a(++_0x19f189);}(_0xf94f,0x100));var _0xff94=function(_0x502061,_0x35ce81){_0x502061=_0x502061-0x0;var _0x21438b=_0xf94f[_0x502061];return _0x21438b;};'use strict';var asr=require(_0xff94('0x0'));module[_0xff94('0x1')]=function(_0x25cd98,_0x19d78e,_0x5c42b9,_0x5443fe){return asr(_0x25cd98,_0x19d78e,_0x5c42b9);}; \ No newline at end of file +var _0x73ec=['./lib/api','exports'];(function(_0x16c1d9,_0x2a1270){var _0x85293b=function(_0x2c3479){while(--_0x2c3479){_0x16c1d9['push'](_0x16c1d9['shift']());}};_0x85293b(++_0x2a1270);}(_0x73ec,0x1a2));var _0xc73e=function(_0x1747b8,_0x29720f){_0x1747b8=_0x1747b8-0x0;var _0x39b3d6=_0x73ec[_0x1747b8];return _0x39b3d6;};'use strict';var asr=require(_0xc73e('0x0'));module[_0xc73e('0x1')]=function(_0x3d004b,_0x90b349,_0x32b091,_0x40efd4){return asr(_0x3d004b,_0x90b349,_0x32b091);}; \ 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 cf5da30..2fb5982 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 _0x37f8=['bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x37f8,0xd2));var _0x837f=function(_0x560153,_0x18cb8a){_0x560153=_0x560153-0x0;var _0x3ca9bd=_0x37f8[_0x560153];return _0x3ca9bd;};'use strict';var url=require('url');var BPromise=require(_0x837f('0x0'));var fs=require('fs');var host=_0x837f('0x1');module[_0x837f('0x2')]=function(_0x2b4e2c,_0x4b8b19,_0x16bb5c){return new BPromise(function(_0x5184ad,_0x5f2d01){var _0x5a04e7;if(typeof _0x2b4e2c!=='string'||_0x2b4e2c['length']===0x0){return _0x5f2d01(_0x837f('0x3'));}if(typeof _0x4b8b19!==_0x837f('0x4')||_0x4b8b19[_0x837f('0x5')]===0x0){return _0x5f2d01(_0x837f('0x6'));}if(typeof _0x16bb5c!==_0x837f('0x7')&&(typeof _0x16bb5c!==_0x837f('0x4')||_0x16bb5c[_0x837f('0x5')]===0x0)){return _0x5f2d01(_0x837f('0x8'));}try{_0x5a04e7=fs[_0x837f('0x9')](_0x2b4e2c)[_0x837f('0xa')](_0x837f('0xb'));}catch(_0x1aea1e){return _0x5f2d01(_0x1aea1e);}return _0x5184ad({'method':_0x837f('0xc'),'uri':host+_0x837f('0xd')+_0x4b8b19,'body':{'config':{'encoding':_0x837f('0xe'),'sampleRateHertz':'8000','languageCode':_0x16bb5c},'audio':{'content':_0x5a04e7}},'json':!![]});});}; \ No newline at end of file +var _0xbd3b=['POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x455fea,_0x51f808){_0x455fea=_0x455fea-0x0;var _0x32f39b=_0xbd3b[_0x455fea];return _0x32f39b;};'use strict';var url=require(_0xbbd3('0x0'));var BPromise=require(_0xbbd3('0x1'));var fs=require('fs');var host=_0xbbd3('0x2');module['exports']=function(_0x5e9577,_0xe94b7b,_0x1cf5ef){return new BPromise(function(_0x13b296,_0x4e911b){var _0x173684;if(typeof _0x5e9577!==_0xbbd3('0x3')||_0x5e9577['length']===0x0){return _0x4e911b(_0xbbd3('0x4'));}if(typeof _0xe94b7b!=='string'||_0xe94b7b[_0xbbd3('0x5')]===0x0){return _0x4e911b(_0xbbd3('0x6'));}if(typeof _0x1cf5ef!==_0xbbd3('0x7')&&(typeof _0x1cf5ef!=='string'||_0x1cf5ef[_0xbbd3('0x5')]===0x0)){return _0x4e911b(_0xbbd3('0x8'));}try{_0x173684=fs[_0xbbd3('0x9')](_0x5e9577)[_0xbbd3('0xa')]('base64');}catch(_0xeade3a){return _0x4e911b(_0xeade3a);}return _0x13b296({'method':_0xbbd3('0xb'),'uri':host+_0xbbd3('0xc')+_0xe94b7b,'body':{'config':{'encoding':_0xbbd3('0xd'),'sampleRateHertz':'8000','languageCode':_0x1cf5ef},'audio':{'content':_0x173684}},'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 a966e03..d90cc9c 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 _0x70dd=['./asr','exports'];(function(_0x144bfc,_0x3a8c7c){var _0x576941=function(_0x3e2a46){while(--_0x3e2a46){_0x144bfc['push'](_0x144bfc['shift']());}};_0x576941(++_0x3a8c7c);}(_0x70dd,0x1ce));var _0xd70d=function(_0x5d711c,_0xe3d6c8){_0x5d711c=_0x5d711c-0x0;var _0xe2c631=_0x70dd[_0x5d711c];return _0xe2c631;};var asr=require(_0xd70d('0x0'));module[_0xd70d('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe3cd=['./asr','exports'];(function(_0x23f416,_0x402a72){var _0x572b5a=function(_0x3b1300){while(--_0x3b1300){_0x23f416['push'](_0x23f416['shift']());}};_0x572b5a(++_0x402a72);}(_0xe3cd,0x136));var _0xde3c=function(_0x101dcc,_0x2a3cf9){_0x101dcc=_0x101dcc-0x0;var _0x24ac96=_0xe3cd[_0x101dcc];return _0x24ac96;};var asr=require(_0xde3c('0x0'));module[_0xde3c('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 a9e827a..252f8b5 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 _0xc314=['uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','resolvedQuery','result','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','action','queryResult','diagnosticInfo','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','channelData','CustomAction','CustomActionData','Data','audiofile','dirName','bluebird','dialogflow','https','md5','request-promise','randomstring','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','end','https:','path','data','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','generate','writeFileSync','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','tmp','.mp3','from','audioContent','base64','writeFile','.wav','777','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr'];(function(_0x192331,_0x535ca2){var _0x403fb4=function(_0x135216){while(--_0x135216){_0x192331['push'](_0x192331['shift']());}};_0x403fb4(++_0x535ca2);}(_0xc314,0x14f));var _0x4c31=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc314[_0x432682];return _0x463d05;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x4c31('0x0'));var dialogflow=require(_0x4c31('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x4c31('0x2'));var md5=require(_0x4c31('0x3'));var path=require('path');var querystring=require('querystring');var rp=require(_0x4c31('0x4'));var rs=require(_0x4c31('0x5'));var sox=require('sox');var tts=require(_0x4c31('0x6'));var urlParse=require(_0x4c31('0x7'))[_0x4c31('0x8')];var util=require('util');var aws=require(_0x4c31('0x9'));var google=require(_0x4c31('0xa'));var sestek=require(_0x4c31('0xb'));var tilde=require(_0x4c31('0xc'));var logger=require(_0x4c31('0xd'))(_0x4c31('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x21f993,_0x59b7fe){return new BPromise(function(_0x702507,_0x5d871e){var _0x5e8faa=urlParse(_0x21f993);var _0x27851b=_0x5e8faa[_0x4c31('0xf')]==='https:'?https:http;var _0x5e60d1={'host':_0x5e8faa[_0x4c31('0x10')],'path':_0x5e8faa['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x27851b[_0x4c31('0x11')](_0x5e60d1,function(_0xa34855){if(_0xa34855[_0x4c31('0x12')]!==0xc8){logger[_0x4c31('0x13')](_0x4c31('0x14')+_0x21f993+_0x4c31('0x15')+_0xa34855[_0x4c31('0x12')]+'\x20('+_0xa34855[_0x4c31('0x16')]+')');_0x5d871e(new Error(_0x4c31('0x14')+_0x21f993+_0x4c31('0x15')+_0xa34855[_0x4c31('0x12')]+'\x20('+_0xa34855['statusMessage']+')'));return;}var _0x54b46a=fs[_0x4c31('0x17')](_0x59b7fe);_0x54b46a['on'](_0x4c31('0x18'),function(){logger['info'](_0x4c31('0x19'));_0x54b46a[_0x4c31('0x1a')](_0x702507);});_0x54b46a['on'](_0x4c31('0x13'),function(_0x32f897){fs[_0x4c31('0x1b')](_0x59b7fe);logger[_0x4c31('0x13')]('download\x20error',_0x32f897);_0x5d871e(_0x32f897);});_0xa34855['pipe'](_0x54b46a);})['on']('error',function(_0x3713a3){logger['error'](_0x3713a3);_0x5d871e(_0x3713a3);})[_0x4c31('0x1c')]();});}function uploadFile(_0x4d9584){return new BPromise(function(_0x15c505,_0x28dea3){var _0x3ca8de=urlParse(_0x4d9584);var _0x1e5b8d=_0x3ca8de[_0x4c31('0xf')]===_0x4c31('0x1d')?https:http;var _0x3675fc={'host':_0x3ca8de[_0x4c31('0x10')],'path':_0x3ca8de[_0x4c31('0x1e')],'headers':{'user-agent':'WHAT_EVER'}};_0x1e5b8d[_0x4c31('0x11')](_0x3675fc,function(_0x1aac2a){if(_0x1aac2a['statusCode']!==0xc8){_0x28dea3(new Error(_0x4c31('0x14')+_0x4d9584+_0x4c31('0x15')+_0x1aac2a['statusCode']+'\x20('+_0x1aac2a['statusMessage']+')'));return;}var _0x1e825f='';_0x1aac2a['on'](_0x4c31('0x1f'),function(_0x4d4abb){_0x1e825f+=_0x4d4abb;});_0x1aac2a['on'](_0x4c31('0x1c'),function(){_0x15c505(_0x1e825f);});})['on'](_0x4c31('0x13'),function(_0x127394){_0x28dea3(_0x127394);})[_0x4c31('0x1c')]();});}function convertFile(_0x9bff3f,_0x2789a9){return new BPromise(function(_0x4e599e,_0x4db5bf){var _0x48c85c=sox['transcode'](_0x9bff3f,_0x2789a9,{'sampleRate':0x1f40,'format':_0x4c31('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x48c85c['on'](_0x4c31('0x13'),function(_0xb97921){logger[_0x4c31('0x13')](_0x4c31('0x21'),_0xb97921);_0x4db5bf(_0xb97921);});_0x48c85c['on'](_0x4c31('0x1c'),function(){logger[_0x4c31('0x22')](_0x4c31('0x23'));_0x4e599e();});_0x48c85c[_0x4c31('0x24')]();});}function base64Decode(_0x120097,_0x4ada6b){var _0x361081=path[_0x4c31('0x25')](__dirname,'tmp',rs[_0x4c31('0x26')](0x4)+'.wav');fs[_0x4c31('0x27')](_0x361081,_0x120097,'base64');return convertFile(_0x361081,_0x4ada6b)[_0x4c31('0x28')](function(){try{fs['unlink'](_0x361081);fs[_0x4c31('0x29')](_0x4ada6b,'777');}catch(_0x5729d4){logger[_0x4c31('0x13')](_0x5729d4);}return _0x4ada6b[_0x4c31('0x2a')]('.')[0x0];});}function base64Encode(_0x1752e6){var _0x399d4e=fs[_0x4c31('0x2b')](_0x1752e6);return new Buffer(_0x399d4e)[_0x4c31('0x2c')]('base64');}exports[_0x4c31('0x2d')]=function(_0x6ee971,_0x4463d6,_0x5b99e8,_0x233d40,_0x2dd162,_0x3a8a8f){var _0x703fe4,_0x2a6a1c;var _0x67068e=_0x4c31('0x2e');var _0x1405dd='?key='+_0x6ee971;var _0xb1c282={};if(_0x4463d6===_0x4c31('0x2f')){_0xb1c282['input']={'ssml':_0x5b99e8};}else{_0xb1c282[_0x4c31('0x30')]={'text':_0x5b99e8};};_0xb1c282['voice']={'languageCode':_0x233d40,'ssmlGender':_0x2dd162};_0xb1c282[_0x4c31('0x31')]={'audioEncoding':_0x4c31('0x32'),'sampleRateHertz':0x1f40};var _0x4f958a={'url':_0x67068e+'text:synthesize'+_0x1405dd,'method':'POST','json':!![],'body':_0xb1c282};return rp(_0x4f958a)[_0x4c31('0x28')](function(_0x5eb5a7){return new BPromise(function(_0x4fde4a,_0xd07a09){_0x703fe4=path[_0x4c31('0x25')](__dirname,_0x4c31('0x33'),rs[_0x4c31('0x26')](0x4)+_0x4c31('0x34'));var _0x6b1f8b=Buffer[_0x4c31('0x35')](_0x5eb5a7[_0x4c31('0x36')],_0x4c31('0x37'));return fs[_0x4c31('0x38')](_0x703fe4,_0x6b1f8b,function(_0x47ca93){_0xd07a09(_0x47ca93);},function(_0x302874){fs['chmodSync'](_0x703fe4,'777');_0x4fde4a(_0x302874);});});})[_0x4c31('0x28')](function(_0x51f522){_0x2a6a1c=path[_0x4c31('0x25')](__dirname,_0x4c31('0x33'),rs['generate'](0x4)+_0x4c31('0x39'));return convertFile(_0x703fe4,_0x2a6a1c);})[_0x4c31('0x28')](function(){try{fs[_0x4c31('0x1b')](_0x703fe4);fs[_0x4c31('0x29')](_0x2a6a1c,_0x4c31('0x3a'));}catch(_0x69f1ab){logger[_0x4c31('0x13')](_0x69f1ab);}logger['info']('googleCloudTTS\x20path',_0x2a6a1c[_0x4c31('0x2a')]('.')[0x0]);return _0x2a6a1c['split']('.')[0x0];});};exports[_0x4c31('0x3b')]=function(_0x326f58,_0x1434c8){var _0x558e64=_0x4c31('0x3c');var _0x14d281,_0x31a646;var _0x34b5a4;var _0x5822a3={'encoding':_0x4c31('0x3d'),'method':_0x4c31('0x3e'),'timeout':0x2710,'url':_0x558e64,'headers':{'Content-Type':_0x4c31('0x3f')},'body':_0x4c31('0x40')+encodeURIComponent(JSON[_0x4c31('0x41')]([[[_0x4c31('0x42'),JSON['stringify']([_0x326f58,_0x1434c8||'en',![],_0x4c31('0x43')]),null,_0x4c31('0x44')]]]))};return rp(_0x5822a3)[_0x4c31('0x28')](function(_0x526a37){try{_0x34b5a4=eval(_0x526a37[_0x4c31('0x45')](0x5))[0x0][0x2];}catch(_0x47e279){throw new Error('parse\x20response\x20failed:\x0a'+_0x526a37[_0x4c31('0x1f')]);}if(!_0x34b5a4){if(_0x326f58[_0x4c31('0x46')]>0xc8){throw new Error(_0x4c31('0x47'));}else{throw new Error(_0x4c31('0x48')+_0x1434c8+_0x4c31('0x49'));}}try{_0x34b5a4=eval(_0x34b5a4)[0x0];}catch(_0x36625f){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x4c31('0x1f')]);}const _0x21812a=_0x34b5a4;_0x14d281=path[_0x4c31('0x25')](__dirname,_0x4c31('0x33'),rs['generate'](0x4)+_0x4c31('0x34'));fs[_0x4c31('0x27')](_0x14d281,_0x34b5a4,{'encoding':'base64'});_0x31a646=path[_0x4c31('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x4c31('0x39'));return convertFile(_0x14d281,_0x31a646);})[_0x4c31('0x28')](function(){try{fs[_0x4c31('0x1b')](_0x14d281);fs[_0x4c31('0x29')](_0x31a646,_0x4c31('0x3a'));}catch(_0x2f9082){logger[_0x4c31('0x13')](_0x2f9082);}logger['info'](_0x4c31('0x4a'),_0x31a646[_0x4c31('0x2a')]('.')[0x0]);return _0x31a646[_0x4c31('0x2a')]('.')[0x0];});};exports['googleASR']=function(_0x86b87c,_0x45c890,_0x57c242){return google[_0x4c31('0x4b')](_0x86b87c,_0x45c890,_0x57c242)['then'](function(_0x2da37a){logger['info'](_0x2da37a[_0x4c31('0x4c')]);return rp(_0x2da37a);})[_0x4c31('0x28')](function(_0x4dc76f){var _0x541a6a='';var _0x4f19fc=0x0;try{fs[_0x4c31('0x1b')](_0x86b87c);}catch(_0x3d6144){logger[_0x4c31('0x13')](_0x3d6144);}if(_0x4dc76f&&_0x4dc76f['results']){_0x541a6a=_0x4dc76f[_0x4c31('0x4d')][_0x4c31('0x4e')](function(_0x207366){return _0x207366&&_0x207366[_0x4c31('0x4f')][0x0]&&_0x207366['alternatives'][0x0]['transcript']?_0x207366[_0x4c31('0x4f')][0x0][_0x4c31('0x50')]:'';})[_0x4c31('0x51')]('\x0a');_0x4f19fc=_0x4dc76f[_0x4c31('0x4d')][_0x4c31('0x4e')](function(_0x5c1957){return _0x5c1957&&_0x5c1957['alternatives'][0x0]&&_0x5c1957[_0x4c31('0x4f')][0x0][_0x4c31('0x52')]?_0x5c1957[_0x4c31('0x4f')][0x0][_0x4c31('0x52')]:0x0;})[_0x4c31('0x51')]('\x0a');}logger[_0x4c31('0x22')](_0x4c31('0x53'),_0x541a6a);logger['info'](_0x4c31('0x54'),_0x4f19fc);return{'transcript':_0x541a6a,'confidence':_0x4f19fc};})[_0x4c31('0x55')](function(_0x2bcfa6){logger[_0x4c31('0x13')](_0x4c31('0x56'),_0x2bcfa6[_0x4c31('0x12')],_0x2bcfa6[_0x4c31('0x57')],_0x2bcfa6[_0x4c31('0x58')]);});};exports[_0x4c31('0x59')]=function(_0x5da20a,_0x89de2b,_0x2abc61,_0x533ebd){var _0x202f74=apiai(_0x89de2b,{'language':_0x533ebd||'en'});return _0x202f74[_0x4c31('0x5a')](_0x2abc61,{'sessionId':md5(_0x5da20a)})[_0x4c31('0x28')](function(_0x43c1e5){logger[_0x4c31('0x22')](JSON['stringify'](_0x43c1e5));return{'source':_0x43c1e5['result'][_0x4c31('0x5b')],'resolvedQuery':_0x43c1e5['result'][_0x4c31('0x5c')],'action':_0x43c1e5['result']['action'],'actionIncomplete':_0x43c1e5[_0x4c31('0x5d')]['actionIncomplete'],'speech':_0x43c1e5[_0x4c31('0x5d')][_0x4c31('0x5e')][_0x4c31('0x5f')],'score':_0x43c1e5[_0x4c31('0x5d')][_0x4c31('0x60')],'statusCode':_0x43c1e5[_0x4c31('0x61')][_0x4c31('0x62')],'endConversation':_0x43c1e5[_0x4c31('0x5d')][_0x4c31('0x63')][_0x4c31('0x64')]||![],'isFallbackIntent':_0x43c1e5[_0x4c31('0x5d')][_0x4c31('0x63')][_0x4c31('0x65')]};});};exports[_0x4c31('0x66')]=function(_0x3b6647,_0x5ed19d,_0x7a73ee,_0x17bd42,_0x2e9678,_0x4227b0){var _0x265fc4=_0x17bd42[_0x4c31('0x67')](/\\n/g,'\x0a');var _0x1d6fe3={'credentials':{'private_key':_0x265fc4,'client_email':_0x7a73ee}};var _0x531570=new dialogflow[(_0x4c31('0x68'))](_0x1d6fe3);var _0x393e61=_0x531570[_0x4c31('0x69')](_0x5ed19d,md5(_0x3b6647));var _0x33f0d0={'session':_0x393e61,'queryInput':{'text':{'text':_0x2e9678,'languageCode':_0x4227b0}}};return _0x531570[_0x4c31('0x6a')](_0x33f0d0)['then'](function(_0x359249){if(_0x359249&&_0x359249[_0x4c31('0x46')]){logger[_0x4c31('0x22')]('Dialogflow\x20V2\x20response:',JSON[_0x4c31('0x41')](_0x359249));var _0x581d91=_0x359249[0x0];if(_0x581d91){var _0x259d03={'action':_0x581d91['queryResult'][_0x4c31('0x6b')],'allRequiredParamsPresent':_0x581d91[_0x4c31('0x6c')]['allRequiredParamsPresent'],'endConversation':_0x581d91['queryResult'][_0x4c31('0x6d')]&&_0x581d91[_0x4c31('0x6c')]['diagnosticInfo']['fields']?_0x581d91[_0x4c31('0x6c')][_0x4c31('0x6d')]['fields'][_0x4c31('0x6e')][_0x4c31('0x6f')]:![],'fulfillmentText':_0x581d91[_0x4c31('0x6c')]['fulfillmentText'],'intentName':_0x581d91[_0x4c31('0x6c')][_0x4c31('0x70')][_0x4c31('0x57')],'intentDisplayName':_0x581d91[_0x4c31('0x6c')]['intent'][_0x4c31('0x71')],'isFallbackIntent':_0x581d91[_0x4c31('0x6c')][_0x4c31('0x70')][_0x4c31('0x72')],'languageCode':_0x581d91['queryResult'][_0x4c31('0x73')],'queryText':_0x581d91[_0x4c31('0x6c')][_0x4c31('0x74')],'responseId':_0x581d91[_0x4c31('0x75')],'score':_0x581d91[_0x4c31('0x6c')][_0x4c31('0x76')],'speech':_0x581d91[_0x4c31('0x6c')][_0x4c31('0x77')],'providerResponse':JSON['stringify'](_0x359249)};return _0x259d03;}}});};exports[_0x4c31('0x78')]=function(_0x403340,_0x36e4c3,_0x1a911e,_0x41cf59){return tilde[_0x4c31('0x4b')](_0x403340,_0x36e4c3,_0x1a911e,_0x41cf59)['then'](function(_0x3a66c1){try{fs[_0x4c31('0x1b')](_0x403340);}catch(_0x4aa3de){logger[_0x4c31('0x13')](_0x4aa3de);}logger[_0x4c31('0x22')](_0x4c31('0x79'),_0x3a66c1[_0x4c31('0x50')]);logger[_0x4c31('0x22')](_0x4c31('0x7a'),_0x3a66c1[_0x4c31('0x52')]);return _0x3a66c1;});};exports['awsPolly']=function(_0x4ad22d,_0x5c1806,_0x325056,_0x57687d,_0x1bf47a,_0x18bd39){var _0x476ce4=path[_0x4c31('0x25')](__dirname,'tmp',rs[_0x4c31('0x26')](0x4)+'.mp3');var _0x7927af;return aws[_0x4c31('0x7b')](_0x4ad22d,_0x5c1806,_0x325056,_0x57687d,_0x1bf47a,_0x18bd39,_0x476ce4)[_0x4c31('0x28')](function(){_0x7927af=path[_0x4c31('0x25')](__dirname,'tmp',rs[_0x4c31('0x26')](0x4)+_0x4c31('0x39'));return convertFile(_0x476ce4,_0x7927af);})[_0x4c31('0x28')](function(){try{fs[_0x4c31('0x1b')](_0x476ce4);fs[_0x4c31('0x29')](_0x7927af,_0x4c31('0x3a'));}catch(_0x4ea035){logger[_0x4c31('0x13')](_0x4ea035);}return _0x7927af[_0x4c31('0x2a')]('.')[0x0];});};exports[_0x4c31('0x7c')]=function(_0x296161,_0x485034,_0x2ec73c,_0x135c07,_0x33b880,_0x406544){return aws['lex'](_0x296161,_0x485034,_0x2ec73c,_0x135c07,_0x33b880,_0x406544)['then'](function(_0x3ae031){logger[_0x4c31('0x22')](JSON[_0x4c31('0x41')](_0x3ae031));return _0x3ae031;});};exports['ispeechTTS']=function(_0x26deb8,_0x25101f,_0x4b0d63,_0xdb7e9c){var _0x411686=util[_0x4c31('0x7d')](_0x4c31('0x7e'),ISPEECH_API,_0x26deb8,encodeURIComponent(_0x25101f),_0x4b0d63,_0xdb7e9c);var _0x521c35=path[_0x4c31('0x25')](__dirname,_0x4c31('0x33'),rs[_0x4c31('0x26')](0x4)+'.mp3');var _0x12d14a;return downloadFile(_0x411686,_0x521c35)[_0x4c31('0x28')](function(){_0x12d14a=path[_0x4c31('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x4c31('0x39'));return convertFile(_0x521c35,_0x12d14a);})['then'](function(){try{fs[_0x4c31('0x1b')](_0x521c35);fs[_0x4c31('0x29')](_0x12d14a,_0x4c31('0x3a'));}catch(_0x1496ac){logger[_0x4c31('0x13')](_0x1496ac);}return _0x12d14a[_0x4c31('0x2a')]('.')[0x0];});};exports[_0x4c31('0x7f')]=function(_0x470cce,_0x1958e2,_0x17569a,_0x1cd2b2){var _0x2e6e3a=util[_0x4c31('0x7d')](_0x4c31('0x80'),ISPEECH_API,_0x1958e2,_0x17569a,base64Encode(_0x470cce),_0x1cd2b2?util[_0x4c31('0x7d')](_0x4c31('0x81'),encodeURIComponent(_0x1cd2b2)):'freeform=3');return uploadFile(_0x2e6e3a)[_0x4c31('0x28')](function(_0x3d7da6){return querystring[_0x4c31('0x8')](_0x3d7da6);});};exports[_0x4c31('0x82')]=function(_0xa4f729,_0x7ec8c7){return sestek['nda'](_0xa4f729,_0x7ec8c7)[_0x4c31('0x28')](function(_0x209c6d){logger['info'](JSON[_0x4c31('0x41')](_0x209c6d));var _0x3bd781={'speech':_0x209c6d['text'],'action':_0x209c6d['channelData']?_0x209c6d[_0x4c31('0x83')][_0x4c31('0x84')]:undefined,'actiondata':_0x209c6d[_0x4c31('0x83')]?_0x209c6d[_0x4c31('0x83')][_0x4c31('0x85')]:undefined};if(_0x209c6d['channelData']&&_0x209c6d[_0x4c31('0x83')]['AudioFromTts']){return base64Decode(_0x209c6d['channelData']['AudioFromTts'][_0x4c31('0x86')],path[_0x4c31('0x25')](__dirname,_0x4c31('0x33'),rs['generate'](0x4)+_0x4c31('0x39')))[_0x4c31('0x28')](function(_0x4168d3){_0x3bd781[_0x4c31('0x87')]=_0x4168d3;return _0x3bd781;});}return _0x3bd781;});};exports[_0x4c31('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0xa42b=['error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','close','unlink','pipe','end','host','transcode','finish\x20to\x20convert','start','resolve','tmp','.wav','base64','then','chmodSync','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','generate','.mp3','from','audioContent','writeFile','777','split','googleTTS','POST','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','textRequest','result','source','action','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','CustomAction','channelData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode'];(function(_0x7f1f41,_0xe619cb){var _0x3cb836=function(_0x98ea5b){while(--_0x98ea5b){_0x7f1f41['push'](_0x7f1f41['shift']());}};_0x3cb836(++_0xe619cb);}(_0xa42b,0x16e));var _0xba42=function(_0x307bba,_0xa8d407){_0x307bba=_0x307bba-0x0;var _0x1cd54=_0xa42b[_0x307bba];return _0x1cd54;};'use strict';var apiai=require(_0xba42('0x0'));var BPromise=require(_0xba42('0x1'));var dialogflow=require(_0xba42('0x2'));var fs=require('fs');var http=require(_0xba42('0x3'));var https=require(_0xba42('0x4'));var md5=require('md5');var path=require(_0xba42('0x5'));var querystring=require(_0xba42('0x6'));var rp=require(_0xba42('0x7'));var rs=require(_0xba42('0x8'));var sox=require(_0xba42('0x9'));var tts=require(_0xba42('0xa'));var urlParse=require(_0xba42('0xb'))[_0xba42('0xc')];var util=require(_0xba42('0xd'));var aws=require(_0xba42('0xe'));var google=require('./google');var sestek=require(_0xba42('0xf'));var tilde=require(_0xba42('0x10'));var logger=require(_0xba42('0x11'))(_0xba42('0x12'));var ISPEECH_API=_0xba42('0x13');function downloadFile(_0x5c69f2,_0x3cc6d7){return new BPromise(function(_0x177dc1,_0x215e55){var _0x5b73cf=urlParse(_0x5c69f2);var _0x4d659b=_0x5b73cf[_0xba42('0x14')]===_0xba42('0x15')?https:http;var _0x2d63d2={'host':_0x5b73cf['host'],'path':_0x5b73cf[_0xba42('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4d659b[_0xba42('0x16')](_0x2d63d2,function(_0x400385){if(_0x400385[_0xba42('0x17')]!==0xc8){logger[_0xba42('0x18')](_0xba42('0x19')+_0x5c69f2+'\x20failed,\x20status\x20code\x20=\x20'+_0x400385['statusCode']+'\x20('+_0x400385[_0xba42('0x1a')]+')');_0x215e55(new Error('request\x20to\x20'+_0x5c69f2+_0xba42('0x1b')+_0x400385[_0xba42('0x17')]+'\x20('+_0x400385[_0xba42('0x1a')]+')'));return;}var _0x366fc5=fs['createWriteStream'](_0x3cc6d7);_0x366fc5['on'](_0xba42('0x1c'),function(){logger[_0xba42('0x1d')](_0xba42('0x1e'));_0x366fc5[_0xba42('0x1f')](_0x177dc1);});_0x366fc5['on'](_0xba42('0x18'),function(_0x4ac67c){fs[_0xba42('0x20')](_0x3cc6d7);logger[_0xba42('0x18')]('download\x20error',_0x4ac67c);_0x215e55(_0x4ac67c);});_0x400385[_0xba42('0x21')](_0x366fc5);})['on']('error',function(_0xc4ad72){logger['error'](_0xc4ad72);_0x215e55(_0xc4ad72);})[_0xba42('0x22')]();});}function uploadFile(_0x2ac4d0){return new BPromise(function(_0x44e3be,_0x4015a7){var _0x1cdda7=urlParse(_0x2ac4d0);var _0x5d8be5=_0x1cdda7[_0xba42('0x14')]===_0xba42('0x15')?https:http;var _0x1b367f={'host':_0x1cdda7[_0xba42('0x23')],'path':_0x1cdda7['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x5d8be5[_0xba42('0x16')](_0x1b367f,function(_0xe06562){if(_0xe06562[_0xba42('0x17')]!==0xc8){_0x4015a7(new Error(_0xba42('0x19')+_0x2ac4d0+_0xba42('0x1b')+_0xe06562['statusCode']+'\x20('+_0xe06562[_0xba42('0x1a')]+')'));return;}var _0xe12b66='';_0xe06562['on']('data',function(_0xedf2b0){_0xe12b66+=_0xedf2b0;});_0xe06562['on'](_0xba42('0x22'),function(){_0x44e3be(_0xe12b66);});})['on'](_0xba42('0x18'),function(_0x4b4204){_0x4015a7(_0x4b4204);})[_0xba42('0x22')]();});}function convertFile(_0x3e749f,_0x650511){return new BPromise(function(_0xe8baeb,_0x511ab5){var _0x137d49=sox[_0xba42('0x24')](_0x3e749f,_0x650511,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x137d49['on'](_0xba42('0x18'),function(_0x2f8c52){logger[_0xba42('0x18')]('error\x20convert',_0x2f8c52);_0x511ab5(_0x2f8c52);});_0x137d49['on'](_0xba42('0x22'),function(){logger[_0xba42('0x1d')](_0xba42('0x25'));_0xe8baeb();});_0x137d49[_0xba42('0x26')]();});}function base64Decode(_0x1435d0,_0x1993e3){var _0x1b93c7=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs['generate'](0x4)+_0xba42('0x29'));fs['writeFileSync'](_0x1b93c7,_0x1435d0,_0xba42('0x2a'));return convertFile(_0x1b93c7,_0x1993e3)[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x1b93c7);fs[_0xba42('0x2c')](_0x1993e3,'777');}catch(_0x182d0f){logger['error'](_0x182d0f);}return _0x1993e3['split']('.')[0x0];});}function base64Encode(_0x333076){var _0x12bf52=fs[_0xba42('0x2d')](_0x333076);return new Buffer(_0x12bf52)[_0xba42('0x2e')](_0xba42('0x2a'));}exports[_0xba42('0x2f')]=function(_0xf6125a,_0x26eb09,_0x28c331,_0x38a76b,_0x241b7c,_0x2d198b){var _0x4408b2,_0x57974c;var _0x366814=_0xba42('0x30');var _0x5d3f5d=_0xba42('0x31')+_0xf6125a;var _0x3284af={};if(_0x26eb09===_0xba42('0x32')){_0x3284af[_0xba42('0x33')]={'ssml':_0x28c331};}else{_0x3284af['input']={'text':_0x28c331};};_0x3284af[_0xba42('0x34')]={'languageCode':_0x38a76b,'ssmlGender':_0x241b7c};_0x3284af[_0xba42('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x1b8662={'url':_0x366814+'text:synthesize'+_0x5d3f5d,'method':'POST','json':!![],'body':_0x3284af};return rp(_0x1b8662)['then'](function(_0x257068){return new BPromise(function(_0x5169ca,_0x302eda){_0x4408b2=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x37'));var _0x4dc2d8=Buffer[_0xba42('0x38')](_0x257068[_0xba42('0x39')],'base64');return fs[_0xba42('0x3a')](_0x4408b2,_0x4dc2d8,function(_0x1cbeb4){_0x302eda(_0x1cbeb4);},function(_0x17c9bd){fs['chmodSync'](_0x4408b2,_0xba42('0x3b'));_0x5169ca(_0x17c9bd);});});})[_0xba42('0x2b')](function(_0x4d3ac5){_0x57974c=path['resolve'](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x29'));return convertFile(_0x4408b2,_0x57974c);})[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x4408b2);fs['chmodSync'](_0x57974c,_0xba42('0x3b'));}catch(_0x5903b3){logger[_0xba42('0x18')](_0x5903b3);}logger[_0xba42('0x1d')]('googleCloudTTS\x20path',_0x57974c[_0xba42('0x3c')]('.')[0x0]);return _0x57974c[_0xba42('0x3c')]('.')[0x0];});};exports[_0xba42('0x3d')]=function(_0x2b1ba2,_0x5c4264){var _0xf0d8b8='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x413c40,_0x1295d6;var _0x1e7fd4;var _0x44d89a={'encoding':'utf8','method':_0xba42('0x3e'),'timeout':0x2710,'url':_0xf0d8b8,'headers':{'Content-Type':_0xba42('0x3f')},'body':_0xba42('0x40')+encodeURIComponent(JSON[_0xba42('0x41')]([[['jQ1olc',JSON[_0xba42('0x41')]([_0x2b1ba2,_0x5c4264||'en',![],_0xba42('0x42')]),null,_0xba42('0x43')]]]))};return rp(_0x44d89a)[_0xba42('0x2b')](function(_0x14ad35){try{_0x1e7fd4=eval(_0x14ad35[_0xba42('0x44')](0x5))[0x0][0x2];}catch(_0x3b421a){throw new Error('parse\x20response\x20failed:\x0a'+_0x14ad35[_0xba42('0x45')]);}if(!_0x1e7fd4){if(_0x2b1ba2[_0xba42('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xba42('0x47')+_0x5c4264+_0xba42('0x48'));}}try{_0x1e7fd4=eval(_0x1e7fd4)[0x0];}catch(_0x43f452){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0xb53620=_0x1e7fd4;_0x413c40=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x37'));fs[_0xba42('0x49')](_0x413c40,_0x1e7fd4,{'encoding':'base64'});_0x1295d6=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xba42('0x29'));return convertFile(_0x413c40,_0x1295d6);})[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x413c40);fs[_0xba42('0x2c')](_0x1295d6,_0xba42('0x3b'));}catch(_0x16d028){logger[_0xba42('0x18')](_0x16d028);}logger[_0xba42('0x1d')](_0xba42('0x4a'),_0x1295d6[_0xba42('0x3c')]('.')[0x0]);return _0x1295d6[_0xba42('0x3c')]('.')[0x0];});};exports[_0xba42('0x4b')]=function(_0x58e61c,_0x1075c3,_0x59c661){return google[_0xba42('0x4c')](_0x58e61c,_0x1075c3,_0x59c661)['then'](function(_0x4e71cc){logger[_0xba42('0x1d')](_0x4e71cc['uri']);return rp(_0x4e71cc);})[_0xba42('0x2b')](function(_0x27723a){var _0x18b3da='';var _0x27e83b=0x0;try{fs[_0xba42('0x20')](_0x58e61c);}catch(_0x27323d){logger['error'](_0x27323d);}if(_0x27723a&&_0x27723a['results']){_0x18b3da=_0x27723a[_0xba42('0x4d')]['map'](function(_0x3a2cf8){return _0x3a2cf8&&_0x3a2cf8[_0xba42('0x4e')][0x0]&&_0x3a2cf8[_0xba42('0x4e')][0x0][_0xba42('0x4f')]?_0x3a2cf8['alternatives'][0x0][_0xba42('0x4f')]:'';})['join']('\x0a');_0x27e83b=_0x27723a['results']['map'](function(_0x428cc9){return _0x428cc9&&_0x428cc9[_0xba42('0x4e')][0x0]&&_0x428cc9[_0xba42('0x4e')][0x0][_0xba42('0x50')]?_0x428cc9['alternatives'][0x0]['confidence']:0x0;})[_0xba42('0x51')]('\x0a');}logger[_0xba42('0x1d')](_0xba42('0x52'),_0x18b3da);logger[_0xba42('0x1d')](_0xba42('0x53'),_0x27e83b);return{'transcript':_0x18b3da,'confidence':_0x27e83b};})[_0xba42('0x54')](function(_0x39f134){logger[_0xba42('0x18')]('[%s]\x20%s:%s',_0x39f134['statusCode'],_0x39f134[_0xba42('0x55')],_0x39f134[_0xba42('0x56')]);});};exports['googleDialogflow']=function(_0xff4649,_0x34c7de,_0x82ca9,_0x1844ae){var _0x1b3219=apiai(_0x34c7de,{'language':_0x1844ae||'en'});return _0x1b3219[_0xba42('0x57')](_0x82ca9,{'sessionId':md5(_0xff4649)})['then'](function(_0x132330){logger['info'](JSON['stringify'](_0x132330));return{'source':_0x132330[_0xba42('0x58')][_0xba42('0x59')],'resolvedQuery':_0x132330[_0xba42('0x58')]['resolvedQuery'],'action':_0x132330[_0xba42('0x58')][_0xba42('0x5a')],'actionIncomplete':_0x132330[_0xba42('0x58')]['actionIncomplete'],'speech':_0x132330['result'][_0xba42('0x5b')][_0xba42('0x5c')],'score':_0x132330['result'][_0xba42('0x5d')],'statusCode':_0x132330['status']['code'],'endConversation':_0x132330[_0xba42('0x58')][_0xba42('0x5e')][_0xba42('0x5f')]||![],'isFallbackIntent':_0x132330['result']['metadata'][_0xba42('0x60')]};});};exports[_0xba42('0x61')]=function(_0x17c2d1,_0x2c6db5,_0xd48009,_0x270bfe,_0x9f30dc,_0x54dd22){var _0x1bbdb7=_0x270bfe[_0xba42('0x62')](/\\n/g,'\x0a');var _0x1b512f={'credentials':{'private_key':_0x1bbdb7,'client_email':_0xd48009}};var _0xea878a=new dialogflow[(_0xba42('0x63'))](_0x1b512f);var _0x5d7ed3=_0xea878a[_0xba42('0x64')](_0x2c6db5,md5(_0x17c2d1));var _0xd73c57={'session':_0x5d7ed3,'queryInput':{'text':{'text':_0x9f30dc,'languageCode':_0x54dd22}}};return _0xea878a[_0xba42('0x65')](_0xd73c57)[_0xba42('0x2b')](function(_0x501e2a){if(_0x501e2a&&_0x501e2a[_0xba42('0x46')]){logger[_0xba42('0x1d')]('Dialogflow\x20V2\x20response:',JSON[_0xba42('0x41')](_0x501e2a));var _0xb4ec76=_0x501e2a[0x0];if(_0xb4ec76){var _0x9a0502={'action':_0xb4ec76[_0xba42('0x66')][_0xba42('0x5a')],'allRequiredParamsPresent':_0xb4ec76[_0xba42('0x66')]['allRequiredParamsPresent'],'endConversation':_0xb4ec76[_0xba42('0x66')]['diagnosticInfo']&&_0xb4ec76[_0xba42('0x66')][_0xba42('0x67')][_0xba42('0x68')]?_0xb4ec76[_0xba42('0x66')][_0xba42('0x67')][_0xba42('0x68')][_0xba42('0x69')][_0xba42('0x6a')]:![],'fulfillmentText':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6b')],'intentName':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6c')][_0xba42('0x55')],'intentDisplayName':_0xb4ec76[_0xba42('0x66')]['intent'][_0xba42('0x6d')],'isFallbackIntent':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6c')]['isFallback'],'languageCode':_0xb4ec76['queryResult'][_0xba42('0x6e')],'queryText':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6f')],'responseId':_0xb4ec76['responseId'],'score':_0xb4ec76['queryResult'][_0xba42('0x70')],'speech':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6b')],'providerResponse':JSON['stringify'](_0x501e2a)};return _0x9a0502;}}});};exports[_0xba42('0x71')]=function(_0x586670,_0x2ad7f9,_0x21bf74,_0x1637d0){return tilde[_0xba42('0x4c')](_0x586670,_0x2ad7f9,_0x21bf74,_0x1637d0)[_0xba42('0x2b')](function(_0x25686f){try{fs[_0xba42('0x20')](_0x586670);}catch(_0x5ae693){logger[_0xba42('0x18')](_0x5ae693);}logger['info'](_0xba42('0x72'),_0x25686f[_0xba42('0x4f')]);logger[_0xba42('0x1d')](_0xba42('0x73'),_0x25686f['confidence']);return _0x25686f;});};exports[_0xba42('0x74')]=function(_0x51d5b3,_0x428906,_0x1d0de0,_0x4bf36f,_0x4c3831,_0x4e37f4){var _0x453176=path[_0xba42('0x27')](__dirname,'tmp',rs[_0xba42('0x36')](0x4)+_0xba42('0x37'));var _0x40ceb1;return aws['polly'](_0x51d5b3,_0x428906,_0x1d0de0,_0x4bf36f,_0x4c3831,_0x4e37f4,_0x453176)[_0xba42('0x2b')](function(){_0x40ceb1=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x29'));return convertFile(_0x453176,_0x40ceb1);})[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x453176);fs[_0xba42('0x2c')](_0x40ceb1,'777');}catch(_0x1824b9){logger[_0xba42('0x18')](_0x1824b9);}return _0x40ceb1[_0xba42('0x3c')]('.')[0x0];});};exports[_0xba42('0x75')]=function(_0x328feb,_0x199a35,_0x28678d,_0x5b7333,_0x16bd61,_0x1d8437){return aws[_0xba42('0x76')](_0x328feb,_0x199a35,_0x28678d,_0x5b7333,_0x16bd61,_0x1d8437)['then'](function(_0x177f59){logger['info'](JSON[_0xba42('0x41')](_0x177f59));return _0x177f59;});};exports[_0xba42('0x77')]=function(_0x521a21,_0x413f6e,_0x299b33,_0x5303a6){var _0x4f30f9=util[_0xba42('0x78')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x521a21,encodeURIComponent(_0x413f6e),_0x299b33,_0x5303a6);var _0x3eb054=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xba42('0x37'));var _0x341195;return downloadFile(_0x4f30f9,_0x3eb054)[_0xba42('0x2b')](function(){_0x341195=path[_0xba42('0x27')](__dirname,'tmp',rs[_0xba42('0x36')](0x4)+_0xba42('0x29'));return convertFile(_0x3eb054,_0x341195);})[_0xba42('0x2b')](function(){try{fs['unlink'](_0x3eb054);fs[_0xba42('0x2c')](_0x341195,_0xba42('0x3b'));}catch(_0x480f50){logger[_0xba42('0x18')](_0x480f50);}return _0x341195['split']('.')[0x0];});};exports['ispeechASR']=function(_0x25853b,_0x17dbcb,_0x255ae5,_0xc6a7e){var _0x3f1467=util[_0xba42('0x78')](_0xba42('0x79'),ISPEECH_API,_0x17dbcb,_0x255ae5,base64Encode(_0x25853b),_0xc6a7e?util[_0xba42('0x78')](_0xba42('0x7a'),encodeURIComponent(_0xc6a7e)):'freeform=3');return uploadFile(_0x3f1467)['then'](function(_0x2dcef6){return querystring[_0xba42('0xc')](_0x2dcef6);});};exports[_0xba42('0x7b')]=function(_0x1ab3df,_0x223ac6){return sestek['nda'](_0x1ab3df,_0x223ac6)[_0xba42('0x2b')](function(_0x45ca41){logger[_0xba42('0x1d')](JSON[_0xba42('0x41')](_0x45ca41));var _0x10dc4e={'speech':_0x45ca41[_0xba42('0x7c')],'action':_0x45ca41['channelData']?_0x45ca41['channelData'][_0xba42('0x7d')]:undefined,'actiondata':_0x45ca41[_0xba42('0x7e')]?_0x45ca41['channelData']['CustomActionData']:undefined};if(_0x45ca41[_0xba42('0x7e')]&&_0x45ca41[_0xba42('0x7e')][_0xba42('0x7f')]){return base64Decode(_0x45ca41[_0xba42('0x7e')]['AudioFromTts'][_0xba42('0x80')],path[_0xba42('0x27')](__dirname,'tmp',rs[_0xba42('0x36')](0x4)+'.wav'))[_0xba42('0x2b')](function(_0x54cd11){_0x10dc4e['audiofile']=_0x54cd11;return _0x10dc4e;});}return _0x10dc4e;});};exports[_0xba42('0x81')]=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 403b34f..42bf175 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 _0x957c=['./nda'];(function(_0xe92f2f,_0x577a10){var _0x1b795e=function(_0x5f8cf6){while(--_0x5f8cf6){_0xe92f2f['push'](_0xe92f2f['shift']());}};_0x1b795e(++_0x577a10);}(_0x957c,0x11a));var _0xc957=function(_0x497949,_0x167a75){_0x497949=_0x497949-0x0;var _0xf3578b=_0x957c[_0x497949];return _0xf3578b;};var nda=require(_0xc957('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x3dee=['exports','./nda'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x3dee,0xe5));var _0xe3de=function(_0x1aa9b6,_0x4a3719){_0x1aa9b6=_0x1aa9b6-0x0;var _0x4434f2=_0x3dee[_0x1aa9b6];return _0x4434f2;};var nda=require(_0xe3de('0x0'));module[_0xe3de('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 6296658..039378f 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 _0x8d08=['stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','calleridname','extension','text','Bearer\x20','channelData','ProjectName','project','AudioOutputSettings','audio/wav','body','CustomAction','custom_action','CustomActionData','custom_action_data'];(function(_0x80e230,_0x3f7502){var _0x47bd96=function(_0x5c12a3){while(--_0x5c12a3){_0x80e230['push'](_0x80e230['shift']());}};_0x47bd96(++_0x3f7502);}(_0x8d08,0x118));var _0x88d0=function(_0x15f236,_0x59a12b){_0x15f236=_0x15f236-0x0;var _0x3645c0=_0x8d08[_0x15f236];return _0x3645c0;};'use strict';var rp=require(_0x88d0('0x0'));var url=require(_0x88d0('0x1'));var logger=require(_0x88d0('0x2'))(_0x88d0('0x3'));module[_0x88d0('0x4')]=function(_0x2c31dd,_0x371bdb){var _0x2f99b6={'method':_0x88d0('0x5'),'uri':url[_0x88d0('0x6')](_0x371bdb[_0x88d0('0x7')],_0x88d0('0x8')),'form':{'grant_type':'password','username':_0x371bdb[_0x88d0('0x9')],'password':_0x371bdb[_0x88d0('0xa')]},'json':!![]};return rp(_0x2f99b6)['then'](function(_0x42ceda){var _0x511c4a={'method':_0x88d0('0x5'),'uri':url['resolve'](_0x371bdb[_0x88d0('0xb')],_0x88d0('0xc')),'body':{'type':_0x371bdb[_0x88d0('0xd')]||'message','channelId':_0x88d0('0xe'),'conversation':{'id':_0x2c31dd[_0x88d0('0xf')]},'from':{'id':_0x2c31dd['callerid'],'name':_0x2c31dd[_0x88d0('0x10')]},'recipient':{'id':_0x2c31dd['dnid'],'name':_0x2c31dd[_0x88d0('0x11')]},'text':_0x371bdb[_0x88d0('0x12')],'channelData':{}},'headers':{'Authorization':_0x88d0('0x13')+_0x42ceda['access_token']},'json':!![]};if(_0x371bdb['project']){_0x511c4a['body'][_0x88d0('0x14')][_0x88d0('0x15')]=_0x371bdb[_0x88d0('0x16')];}if(_0x371bdb['ndagenerate_audio']=='1'){_0x511c4a['body']['channelData'][_0x88d0('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x88d0('0x18')};}if(_0x371bdb['custom_action']){_0x511c4a[_0x88d0('0x19')][_0x88d0('0x14')][_0x88d0('0x1a')]=_0x371bdb[_0x88d0('0x1b')];if(_0x371bdb['custom_action_data']){_0x511c4a[_0x88d0('0x19')][_0x88d0('0x14')][_0x88d0('0x1c')]=_0x371bdb[_0x88d0('0x1d')];}}logger['info'](JSON[_0x88d0('0x1e')](_0x511c4a));return rp(_0x511c4a);});}; \ No newline at end of file +var _0xb98f=['ndaactivity_type','message','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password'];(function(_0x1a4f6e,_0x15cf08){var _0x12f84b=function(_0x10af9b){while(--_0x10af9b){_0x1a4f6e['push'](_0x1a4f6e['shift']());}};_0x12f84b(++_0x15cf08);}(_0xb98f,0xce));var _0xfb98=function(_0x2000c6,_0x2485ec){_0x2000c6=_0x2000c6-0x0;var _0x4509b9=_0xb98f[_0x2000c6];return _0x4509b9;};'use strict';var rp=require(_0xfb98('0x0'));var url=require(_0xfb98('0x1'));var logger=require(_0xfb98('0x2'))(_0xfb98('0x3'));module[_0xfb98('0x4')]=function(_0x4f16b2,_0x5570ce){var _0x593d54={'method':_0xfb98('0x5'),'uri':url[_0xfb98('0x6')](_0x5570ce[_0xfb98('0x7')],_0xfb98('0x8')),'form':{'grant_type':'password','username':_0x5570ce[_0xfb98('0x9')],'password':_0x5570ce[_0xfb98('0xa')]},'json':!![]};return rp(_0x593d54)['then'](function(_0x27b394){var _0x4d06fc={'method':'POST','uri':url['resolve'](_0x5570ce['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5570ce[_0xfb98('0xb')]||_0xfb98('0xc'),'channelId':'Nda','conversation':{'id':_0x4f16b2['uniqueid']},'from':{'id':_0x4f16b2[_0xfb98('0xd')],'name':_0x4f16b2['calleridname']},'recipient':{'id':_0x4f16b2[_0xfb98('0xe')],'name':_0x4f16b2[_0xfb98('0xf')]},'text':_0x5570ce[_0xfb98('0x10')],'channelData':{}},'headers':{'Authorization':_0xfb98('0x11')+_0x27b394[_0xfb98('0x12')]},'json':!![]};if(_0x5570ce[_0xfb98('0x13')]){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x16')]=_0x5570ce[_0xfb98('0x13')];}if(_0x5570ce[_0xfb98('0x17')]=='1'){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5570ce[_0xfb98('0x19')]){_0x4d06fc['body'][_0xfb98('0x15')][_0xfb98('0x1a')]=_0x5570ce[_0xfb98('0x19')];if(_0x5570ce[_0xfb98('0x1b')]){_0x4d06fc[_0xfb98('0x14')]['channelData'][_0xfb98('0x1c')]=_0x5570ce[_0xfb98('0x1b')];}}logger[_0xfb98('0x1d')](JSON[_0xfb98('0x1e')](_0x4d06fc));return rp(_0x4d06fc);});}; \ 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 4f58094..81aa20c 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 _0x1269=['exports','./lib/api'];(function(_0x4edbd6,_0x5e1e76){var _0x10fa22=function(_0x554dee){while(--_0x554dee){_0x4edbd6['push'](_0x4edbd6['shift']());}};_0x10fa22(++_0x5e1e76);}(_0x1269,0x8b));var _0x9126=function(_0x561a36,_0x4226d4){_0x561a36=_0x561a36-0x0;var _0x44353b=_0x1269[_0x561a36];return _0x44353b;};'use strict';var asr=require(_0x9126('0x0'));module[_0x9126('0x1')]=function(_0x5a6a90,_0x1f92b0,_0x52e663,_0x3274e2){return asr(_0x5a6a90,_0x1f92b0,_0x52e663,_0x3274e2);}; \ No newline at end of file +var _0x6cfd=['exports','./lib/api'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x6cfd,0x12f));var _0xd6cf=function(_0x1dd9dc,_0x2ebff9){_0x1dd9dc=_0x1dd9dc-0x0;var _0x87961a=_0x6cfd[_0x1dd9dc];return _0x87961a;};'use strict';var asr=require(_0xd6cf('0x0'));module[_0xd6cf('0x1')]=function(_0x5218b4,_0x39438c,_0x427373,_0x500287){return asr(_0x5218b4,_0x39438c,_0x427373,_0x500287);}; \ 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 206a38b..33ef209 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 _0xe075=['terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error'];(function(_0x391c5c,_0x534ad7){var _0x3c6772=function(_0x38987d){while(--_0x38987d){_0x391c5c['push'](_0x391c5c['shift']());}};_0x3c6772(++_0x534ad7);}(_0xe075,0x13a));var _0x5e07=function(_0x5581f9,_0x29ca4f){_0x5581f9=_0x5581f9-0x0;var _0x2d2e07=_0xe075[_0x5581f9];return _0x2d2e07;};'use strict';var BPromise=require(_0x5e07('0x0'));var _=require(_0x5e07('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5e07('0x2'));var crypto=require(_0x5e07('0x3'));var logger=require(_0x5e07('0x4'))(_0x5e07('0x5'));module[_0x5e07('0x6')]=function(_0x3deb08,_0x4c6b41,_0x26313c,_0x3afedf){return new BPromise(function(_0x4a8860,_0x14351b){logger[_0x5e07('0x7')](_0x5e07('0x8'),_0x3afedf||_0x5e07('0x9'));var _0x1f7b58=new WebSocket(_0x3afedf||_0x5e07('0x9'),{'perMessageDeflate':![]});var _0x84e4b8='';var _0x2a43fc='0';var _0x5dc06d='1';var _0x488809='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x529539(_0x3c05a5){var _0x6122ab=crypto[_0x5e07('0xa')](_0x5e07('0xb'));_0x6122ab[_0x5e07('0xc')](_0x3c05a5);return _0x6122ab['digest'](_0x5e07('0xd'));}function _0x2c66cc(){try{logger['info'](_0x5e07('0xe'));var _0x20ea37=moment()[_0x5e07('0xf')]();var _0x302393=_0x529539(_0x20ea37+_0x4c6b41+_0x26313c);_0x1f7b58[_0x5e07('0x10')](JSON[_0x5e07('0x11')]({'appID':_0x4c6b41,'timestamp':_0x20ea37,'appKey':_0x302393}));var _0x25ef71=fs['createReadStream'](_0x3deb08);_0x25ef71['on'](_0x5e07('0x12'),function(_0x405540){_0x1f7b58['send'](_0x405540);});_0x25ef71['on'](_0x5e07('0x13'),function(){_0x1f7b58[_0x5e07('0x10')](_0x5e07('0x14'));});}catch(_0xd77122){logger['error'](_0x5e07('0x15'),JSON[_0x5e07('0x11')](_0xd77122));_0x1f7b58[_0x5e07('0x16')]();}}function _0x9d1cbf(_0xf2dd50){try{if(_0xf2dd50){var _0x25d004=JSON[_0x5e07('0x17')](_0xf2dd50);switch(_0x25d004[_0x5e07('0x18')]){case 0x0:if(_0x25d004['result']){if(_0x25d004[_0x5e07('0x19')][_0x5e07('0x1a')]){logger[_0x5e07('0x7')](_0x5e07('0x1b'),JSON[_0x5e07('0x11')](_0x25d004[_0x5e07('0x19')]['hypotheses']));_0x84e4b8=_0x25d004[_0x5e07('0x19')]['hypotheses'][0x0][_0x5e07('0x1c')];_0x2a43fc=_0x25d004[_0x5e07('0x19')][_0x5e07('0x1d')][0x0][_0x5e07('0x1e')];_0x5dc06d='0';_0x488809=_0x5e07('0x1f');_0x1f7b58[_0x5e07('0x16')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5dc06d='1';_0x488809=_0x5e07('0x20');break;case 0x2:logger[_0x5e07('0x7')](_0x5e07('0x21'));_0x5dc06d='2';_0x488809=_0x5e07('0x21');break;case 0x9:logger[_0x5e07('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x5dc06d='9';_0x488809=_0x5e07('0x22');break;case 0xa:logger[_0x5e07('0x7')](_0x5e07('0x23'));_0x5dc06d='10';_0x488809=_0x5e07('0x23');break;case 0xb:logger[_0x5e07('0x7')](_0x5e07('0x24'));_0x5dc06d='11';_0x488809=_0x5e07('0x24');}}}catch(_0x53d769){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x5e07('0x11')](_0x53d769));_0x1f7b58[_0x5e07('0x16')]();}}function _0xeb2adc(){logger[_0x5e07('0x7')](_0x5e07('0x25'));_0x4a8860({'transcript':_0x84e4b8,'confidence':_0x2a43fc,'status':_0x5dc06d,'status_message':_0x488809});}function _0x4079b9(_0x5dd197){logger['error'](_0x5e07('0x26'));if(!_[_0x5e07('0x27')](_0x5dd197)){logger['error'](_[_0x5e07('0x28')](_0x5dd197)?JSON[_0x5e07('0x11')](_0x5dd197):_0x5dd197);}}_0x1f7b58['on'](_0x5e07('0x29'),_0x2c66cc);_0x1f7b58['on']('message',_0x9d1cbf);_0x1f7b58['on'](_0x5e07('0x13'),_0xeb2adc);_0x1f7b58['on']('error',_0x4079b9);});}; \ No newline at end of file +var _0xf80b=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','unix','stringify','createReadStream','data','close','send','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','isNil','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xf80b,0x19a));var _0xbf80=function(_0x4f223c,_0x360f21){_0x4f223c=_0x4f223c-0x0;var _0x452058=_0xf80b[_0x4f223c];return _0x452058;};'use strict';var BPromise=require(_0xbf80('0x0'));var _=require(_0xbf80('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xbf80('0x2'));var crypto=require('crypto');var logger=require(_0xbf80('0x3'))(_0xbf80('0x4'));module[_0xbf80('0x5')]=function(_0x4a1ec5,_0x368a82,_0x46a883,_0x4f7dae){return new BPromise(function(_0x41c5f8,_0x3933ed){logger['info'](_0xbf80('0x6'),_0x4f7dae||_0xbf80('0x7'));var _0x41ea05=new WebSocket(_0x4f7dae||_0xbf80('0x7'),{'perMessageDeflate':![]});var _0x1ddc43='';var _0x3cdaf8='0';var _0xca97d0='1';var _0x1800d5=_0xbf80('0x8');function _0x339035(_0x5cc00f){var _0x21815b=crypto[_0xbf80('0x9')](_0xbf80('0xa'));_0x21815b[_0xbf80('0xb')](_0x5cc00f);return _0x21815b[_0xbf80('0xc')](_0xbf80('0xd'));}function _0x3b1d9d(){try{logger[_0xbf80('0xe')]('Open\x20Tilde\x20ASR\x20socket');var _0x252892=moment()[_0xbf80('0xf')]();var _0x4086ad=_0x339035(_0x252892+_0x368a82+_0x46a883);_0x41ea05['send'](JSON[_0xbf80('0x10')]({'appID':_0x368a82,'timestamp':_0x252892,'appKey':_0x4086ad}));var _0x374879=fs[_0xbf80('0x11')](_0x4a1ec5);_0x374879['on'](_0xbf80('0x12'),function(_0x55744a){_0x41ea05['send'](_0x55744a);});_0x374879['on'](_0xbf80('0x13'),function(){_0x41ea05[_0xbf80('0x14')](_0xbf80('0x15'));});}catch(_0x15674f){logger[_0xbf80('0x16')](_0xbf80('0x17'),JSON['stringify'](_0x15674f));_0x41ea05[_0xbf80('0x18')]();}}function _0x4380db(_0x15d08c){try{if(_0x15d08c){var _0x5ad3ce=JSON[_0xbf80('0x19')](_0x15d08c);switch(_0x5ad3ce[_0xbf80('0x1a')]){case 0x0:if(_0x5ad3ce[_0xbf80('0x1b')]){if(_0x5ad3ce[_0xbf80('0x1b')][_0xbf80('0x1c')]){logger[_0xbf80('0xe')](_0xbf80('0x1d'),JSON['stringify'](_0x5ad3ce[_0xbf80('0x1b')]['hypotheses']));_0x1ddc43=_0x5ad3ce[_0xbf80('0x1b')]['hypotheses'][0x0][_0xbf80('0x1e')];_0x3cdaf8=_0x5ad3ce[_0xbf80('0x1b')]['hypotheses'][0x0][_0xbf80('0x1f')];_0xca97d0='0';_0x1800d5='Success.';_0x41ea05[_0xbf80('0x18')]();}}break;case 0x1:logger['info'](_0xbf80('0x8'));_0xca97d0='1';_0x1800d5=_0xbf80('0x8');break;case 0x2:logger[_0xbf80('0xe')](_0xbf80('0x20'));_0xca97d0='2';_0x1800d5='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xbf80('0x21'));_0xca97d0='9';_0x1800d5=_0xbf80('0x21');break;case 0xa:logger[_0xbf80('0xe')]('Authentication\x20failed.');_0xca97d0='10';_0x1800d5='Authentication\x20failed.';break;case 0xb:logger['info'](_0xbf80('0x22'));_0xca97d0='11';_0x1800d5=_0xbf80('0x22');}}}catch(_0x560036){logger[_0xbf80('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xbf80('0x10')](_0x560036));_0x41ea05[_0xbf80('0x18')]();}}function _0x1147dc(){logger[_0xbf80('0xe')]('Close\x20Tilde\x20ASR\x20socket');_0x41c5f8({'transcript':_0x1ddc43,'confidence':_0x3cdaf8,'status':_0xca97d0,'status_message':_0x1800d5});}function _0x1a4618(_0x54f25c){logger[_0xbf80('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xbf80('0x23')](_0x54f25c)){logger[_0xbf80('0x16')](_['isObject'](_0x54f25c)?JSON['stringify'](_0x54f25c):_0x54f25c);}}_0x41ea05['on'](_0xbf80('0x24'),_0x3b1d9d);_0x41ea05['on'](_0xbf80('0x25'),_0x4380db);_0x41ea05['on'](_0xbf80('0x13'),_0x1147dc);_0x41ea05['on'](_0xbf80('0x16'),_0x1a4618);});}; \ 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 2cd16f0..10cb4be 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 _0xa673=['./asr'];(function(_0x249d60,_0x4ca7d8){var _0x5d0a19=function(_0x5589d6){while(--_0x5589d6){_0x249d60['push'](_0x249d60['shift']());}};_0x5d0a19(++_0x4ca7d8);}(_0xa673,0x116));var _0x3a67=function(_0x4873e1,_0x5e4cbe){_0x4873e1=_0x4873e1-0x0;var _0x453c0a=_0xa673[_0x4873e1];return _0x453c0a;};var asr=require(_0x3a67('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var asr=require('./asr');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 346da93..5bbeb7a 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 2cb1bcc..5456c29 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 _0xc788=['Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','false','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','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','failure','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','no\x20file\x20audio\x20selected','pause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','%s_%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','%s_STATUS_CODE','statusMessage','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','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','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','split','join','exports','util','lodash','shelljs','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','prototype','getVoiceQueue','getVoiceQueueById','then','name','getSquareProjectById','getSquareOdbcById','catch','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','label','agicommand','arg_1','callerid','uniqueid','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','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','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','hasOwnProperty','%s.%s','replaceAll','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','no\x20grammar\x20configured','grammar','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','callback_priority','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','keys','forEach','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial'];(function(_0xac63f5,_0x2f1df7){var _0x354310=function(_0x30232e){while(--_0x30232e){_0xac63f5['push'](_0xac63f5['shift']());}};_0x354310(++_0x2f1df7);}(_0xc788,0xc4));var _0x8c78=function(_0xea2f6,_0xae7361){_0xea2f6=_0xea2f6-0x0;var _0x4b113c=_0xc788[_0xea2f6];return _0x4b113c;};'use strict';var fs=require('fs');var util=require(_0x8c78('0x0'));var _=require(_0x8c78('0x1'));var sh=require(_0x8c78('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x8c78('0x3'));var Mustache=require(_0x8c78('0x4'));var rp=require(_0x8c78('0x5'));var logger=require(_0x8c78('0x6'))(_0x8c78('0x7'));var config=require('../../config/environment');var shared=require(_0x8c78('0x8'));var scripts=require(_0x8c78('0x9'));var FILES_PATH=_0x8c78('0xa');var recursiveMapAttributes=[_0x8c78('0xb'),_0x8c78('0xc')];var verticesWithRetry=['menu',_0x8c78('0xd'),_0x8c78('0xe')];var AGIVertices=function(_0x9bc075,_0x39c0e5,_0xdb0c17){this[_0x8c78('0xf')]=_0x9bc075;this['rpc']=_0x39c0e5;this[_0x8c78('0x10')]=_0xdb0c17;};AGIVertices['prototype'][_0x8c78('0x11')]=function(_0x45935a,_0x4f6169){this[_0x8c78('0x12')][_0x8c78('0x13')](_0x45935a)['then'](function(_0x3a673c){_0x4f6169(null,_0x3a673c?_0x3a673c['name']:![]);})['catch'](function(_0x349dfa){_0x4f6169(_0x349dfa);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x15')]=function(_0x106bf2,_0x2eedff){this[_0x8c78('0x12')][_0x8c78('0x16')](_0x106bf2)[_0x8c78('0x17')](function(_0x2f44af){_0x2eedff(null,_0x2f44af?_0x2f44af[_0x8c78('0x18')]:![]);})['catch'](function(_0x1fa78e){_0x2eedff(_0x1fa78e);});};AGIVertices[_0x8c78('0x14')]['getSquareProject']=function(_0x45b85f,_0x554464){this[_0x8c78('0x12')][_0x8c78('0x19')](_0x45b85f)[_0x8c78('0x17')](function(_0x461eff){_0x554464(null,_0x461eff?_0x461eff['name']:![]);})['catch'](function(_0x339d04){_0x554464(_0x339d04);});};AGIVertices['prototype']['getSquareOdbc']=function(_0xece4f0,_0x56c191){this[_0x8c78('0x12')][_0x8c78('0x1a')](_0xece4f0)['then'](function(_0x6c9a12){_0x56c191(null,_0x6c9a12?_0x6c9a12['dsn']:![]);})[_0x8c78('0x1b')](function(_0x3af73c){_0x56c191(_0x3af73c);});};AGIVertices['prototype'][_0x8c78('0x1c')]=function(_0x188cc3,_0x499603){this[_0x8c78('0x12')][_0x8c78('0x1d')](_0x188cc3)[_0x8c78('0x17')](function(_0x9581c6){_0x499603(null,_0x9581c6?_0x9581c6[_0x8c78('0x18')]:![]);})[_0x8c78('0x1b')](function(_0xbfdf6f){_0x499603(_0xbfdf6f);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x1e')]=function(_0x4a7d20,_0x93c78d){this[_0x8c78('0x12')][_0x8c78('0x1f')](_0x4a7d20)['then'](function(_0x331bfe){_0x93c78d(null,_0x331bfe?_0x331bfe['name']:![]);})[_0x8c78('0x1b')](function(_0x24f9a7){_0x93c78d(_0x24f9a7);});};AGIVertices[_0x8c78('0x14')]['getSound']=function(_0x583a74,_0x2568d5){var _0x4be49d=this;this[_0x8c78('0x12')][_0x8c78('0x20')](_0x583a74)[_0x8c78('0x17')](function(_0x36e8e5){_0x2568d5(null,_0x36e8e5?_0x4be49d[_0x8c78('0x21')](_0x36e8e5[_0x8c78('0x22')]):![]);})['catch'](function(_0x1c3039){_0x2568d5(_0x1c3039);});};AGIVertices['prototype'][_0x8c78('0x23')]=function(_0x17f4c8,_0xb69c52){this['rpc'][_0x8c78('0x24')](_0x17f4c8)[_0x8c78('0x17')](function(_0x4f0005){_0xb69c52(null,_0x4f0005?_0x4f0005:![]);})[_0x8c78('0x1b')](function(_0x119368){_0xb69c52(_0x119368);});};AGIVertices[_0x8c78('0x14')]['sendMailMessage']=function(_0x36ece0,_0x63307e,_0x373d52){this['mailRpc'][_0x8c78('0x25')](_0x36ece0,_0x63307e)[_0x8c78('0x17')](function(){_0x373d52(null);})['catch'](function(_0x331938){_0x373d52(_0x331938);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x26')]=function(_0x13942f,_0x3c8c6c){this[_0x8c78('0x12')][_0x8c78('0x27')](_0x13942f)[_0x8c78('0x17')](function(_0x201a43){if(_0x201a43){if(_0x201a43[_0x8c78('0x28')]){_0x3c8c6c(null,[_0x201a43['interval']]);}else{_0x3c8c6c(null,_[_0x8c78('0x29')](_0x201a43[_0x8c78('0x2a')],_0x8c78('0x2b')));}}else{_0x3c8c6c(null,![]);}})[_0x8c78('0x1b')](function(_0x34481a){_0x3c8c6c(_0x34481a);});};AGIVertices['prototype'][_0x8c78('0x21')]=function(_0xc4d0cf){return util[_0x8c78('0x2c')]('%s/sounds/converted/%s',FILES_PATH,_0xc4d0cf);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x2d')]=function(_0x58d7b8,_0x3cc886,_0x588a54){odbc[_0x8c78('0x2e')](_0x58d7b8,function(_0xf6cc5f){if(_0xf6cc5f){logger[_0x8c78('0x2f')](_0x8c78('0x30'),_0xf6cc5f);_0x588a54(_0xf6cc5f);}else{logger['info'](_0x8c78('0x31'));odbc['query'](_0x3cc886,function(_0x3b8f4f,_0x3730dd){if(_0x3b8f4f){logger[_0x8c78('0x32')]('Error\x20executing\x20query\x20%s',_0x3cc886);_0x588a54(_0x3b8f4f);}else{logger['info'](_0x8c78('0x33'),_0x3cc886);odbc[_0x8c78('0x34')](function(_0x203df0){if(_0x203df0){logger[_0x8c78('0x2f')](_0x8c78('0x35'),_0x203df0);}_0x588a54(null,_0x3730dd);});}});}});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x36')]=function(_0x314679,_0x1f0a2b){this[_0x8c78('0x12')][_0x8c78('0x37')](_0x314679)[_0x8c78('0x17')](function(_0x234d0e){_0x1f0a2b(null,_0x234d0e?_0x234d0e:![]);})['catch'](function(_0x3995f4){_0x1f0a2b(_0x3995f4);});};AGIVertices[_0x8c78('0x14')]['createSmsMessage']=function(_0x5c51c3,_0x358d3f){this[_0x8c78('0x12')]['createSmsMessage'](_0x5c51c3)[_0x8c78('0x17')](function(_0x57ff42){_0x358d3f(null,_0x57ff42);})['catch'](function(_0x348a2f){_0x358d3f(_0x348a2f);});};AGIVertices[_0x8c78('0x14')]['createSquareDetailsReport']=function(_0x10d521,_0x24a8ea,_0x1222fd){this[_0x8c78('0x12')][_0x8c78('0x38')]({'uniqueid':this['channel']['uniqueid'],'node':_0x10d521[_0x8c78('0x39')],'application':_0x10d521[_0x8c78('0x3a')],'data':_0x24a8ea||null,'project_name':this[_0x8c78('0xf')][_0x8c78('0x3b')],'callerid':this[_0x8c78('0xf')][_0x8c78('0x3c')]})[_0x8c78('0x17')](function(_0x6c977c){if(_0x1222fd){_0x1222fd(null,_0x6c977c);}})[_0x8c78('0x1b')](function(_0xb525c8){if(_0x1222fd){_0x1222fd(_0xb525c8);}});};AGIVertices[_0x8c78('0x14')]['createSquareRecording']=function(_0x1015bf,_0x2ef756,_0x960e0d,_0x36bca0){this[_0x8c78('0x12')]['createSquareRecording']({'uniqueid':this[_0x8c78('0xf')][_0x8c78('0x3d')],'callerid':this[_0x8c78('0xf')][_0x8c78('0x3c')],'calleridname':this[_0x8c78('0xf')]['calleridname'],'context':this[_0x8c78('0xf')]['context'],'extension':this['channel'][_0x8c78('0x3e')],'priority':this[_0x8c78('0xf')][_0x8c78('0x3f')],'accountcode':this['channel'][_0x8c78('0x40')],'dnid':this[_0x8c78('0xf')][_0x8c78('0x41')],'projectName':this[_0x8c78('0xf')][_0x8c78('0x3b')],'saveName':_0x2ef756,'filename':_0x1015bf[_0x8c78('0x42')]||_0x2ef756,'savePath':_0x960e0d})[_0x8c78('0x17')](function(_0x1f5cdb){_0x36bca0(null,_0x1f5cdb);})[_0x8c78('0x1b')](function(_0x4da90f){_0x36bca0(_0x4da90f);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x43')]=function(_0xba0de6,_0x2cbee8,_0x55cef3,_0x2fa61e,_0x1a38d4){this[_0x8c78('0x12')][_0x8c78('0x43')]({'uniqueid':this['channel'][_0x8c78('0x3d')],'body':_0xba0de6,'direction':_0x2cbee8,'providerName':_0x55cef3,'providerResponse':_0x2fa61e})[_0x8c78('0x17')](function(_0x1b9380){if(_0x1a38d4){_0x1a38d4(null,_0x1b9380);}})['catch'](function(_0x169efd){if(_0x1a38d4){_0x1a38d4(_0x169efd);}});};AGIVertices['prototype'][_0x8c78('0x44')]=function(_0xe6325b,_0x402faa){this[_0x8c78('0x12')][_0x8c78('0x44')]({'firstName':_[_0x8c78('0x45')](_0xe6325b[_0x8c78('0x18')])||_[_0x8c78('0x46')](_0xe6325b[_0x8c78('0x18')])?_0x8c78('0x47')+Math[_0x8c78('0x48')]():_0xe6325b[_0x8c78('0x18')],'lastName':_[_0x8c78('0x45')](_0xe6325b[_0x8c78('0x49')])||_['isNil'](_0xe6325b[_0x8c78('0x49')])?null:_0xe6325b[_0x8c78('0x49')],'phone':_0xe6325b[_0x8c78('0x4a')],'ListId':_0xe6325b[_0x8c78('0x4b')],'scheduledat':_0xe6325b['scheduledAt'],'callbackUniqueid':this[_0x8c78('0xf')][_0x8c78('0x3d')],'tags':_0x8c78('0x4c'),'description':_0x8c78('0x4d')+_0xe6325b[_0x8c78('0x4e')][_0x8c78('0x4f')](),'priority':_0xe6325b['callback_priority']})[_0x8c78('0x17')](function(_0x42a34e){_0x402faa(null,_0x42a34e);})['catch'](function(_0x334432){_0x402faa(_0x334432);});};AGIVertices['prototype'][_0x8c78('0x50')]=function(_0x2a7149,_0x257533){this[_0x8c78('0x12')][_0x8c78('0x51')](_0x2a7149)[_0x8c78('0x17')](function(_0x416a05){_0x257533(null,_0x416a05?_0x416a05['name']:![]);})[_0x8c78('0x1b')](function(_0x3e7e32){_0x257533(_0x3e7e32);});};AGIVertices['prototype'][_0x8c78('0x52')]=function(_0x3529aa,_0x577361,_0x425994){var _0x2307d1={'role':_0x8c78('0x53')};_0x2307d1[_0x3529aa]=this[_0x8c78('0xf')][_0x8c78('0x3c')];this[_0x8c78('0x12')][_0x8c78('0x52')](_0x2307d1,_0x577361,this[_0x8c78('0xf')][_0x8c78('0x3d')])[_0x8c78('0x17')](function(_0x25b8bc){_0x425994(null,_[_0x8c78('0x46')](_0x25b8bc)?![]:!![]);})[_0x8c78('0x1b')](function(_0x108f7f){logger['error'](_0x108f7f);_0x425994(null,![]);});};AGIVertices[_0x8c78('0x14')]['agentUnpause']=function(_0x4424a4,_0x4a69ca){var _0x54372a={'role':'agent'};_0x54372a[_0x4424a4]=this[_0x8c78('0xf')]['callerid'];this['rpc']['agentUnpause'](_0x54372a)[_0x8c78('0x17')](function(_0x1276cf){_0x4a69ca(null,_[_0x8c78('0x46')](_0x1276cf)?![]:!![]);})[_0x8c78('0x1b')](function(_0x4d0b26){logger[_0x8c78('0x2f')](_0x4d0b26);_0x4a69ca(null,![]);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x54')]=function(_0x3a1277,_0x334d0a){var _0x3c3332={'role':_0x8c78('0x53')};_0x3c3332[_0x3a1277]=this[_0x8c78('0xf')][_0x8c78('0x3c')];this[_0x8c78('0x12')][_0x8c78('0x54')](_0x3c3332)[_0x8c78('0x17')](function(_0x3e1ee0){_0x334d0a(null,_[_0x8c78('0x46')](_0x3e1ee0)?![]:!![]);})['catch'](function(_0x46f57b){logger['error'](_0x46f57b);_0x334d0a(null,![]);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x55')]=function(_0x420ccf,_0x4e8038){var _0x97df9c={'role':_0x8c78('0x53')};_0x97df9c[_0x420ccf]=this[_0x8c78('0xf')]['callerid'];var _0x1fa8a4=_0x420ccf!=_0x8c78('0x56')?util['format'](_0x8c78('0x57'),_0x8c78('0x58'),this[_0x8c78('0xf')]['callerid']):undefined;this[_0x8c78('0x12')][_0x8c78('0x55')](_0x97df9c,_0x1fa8a4)[_0x8c78('0x17')](function(_0xcf1dfd){_0x4e8038(null,_[_0x8c78('0x46')](_0xcf1dfd)?![]:!![]);})[_0x8c78('0x1b')](function(_0x259d43){logger[_0x8c78('0x2f')](_0x259d43);_0x4e8038(null,![]);});};AGIVertices[_0x8c78('0x14')]['shellCommand']=function(_0x1f2b8f,_0x21b400){sh[_0x8c78('0x59')](_[_0x8c78('0x5a')](_0x1f2b8f),function(_0x35d4fa,_0x6ab646){var _0x33b1e4=_0x6ab646[_0x8c78('0x5b')](/(\r\n|\n|\r)/gm,'');_0x21b400(null,_0x33b1e4);});};AGIVertices[_0x8c78('0x14')]['googleCloudTTS']=function(_0x3dcee2,_0x2908a5){scripts['googleCloudTTS'](_0x3dcee2['apiKey'],_0x3dcee2[_0x8c78('0x5c')]||'text',_0x3dcee2[_0x8c78('0x5d')],_0x3dcee2[_0x8c78('0x5e')]||_0x8c78('0x5f'),_0x3dcee2[_0x8c78('0x60')]||_0x8c78('0x61'),_0x3dcee2[_0x8c78('0x62')]||'MP3')['then'](function(_0x3e0e40){_0x2908a5(null,_0x3e0e40);})[_0x8c78('0x1b')](function(_0x44c309){_0x2908a5(_0x44c309);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x63')]=function(_0x4c09fd,_0x41adf0){scripts[_0x8c78('0x63')](_0x4c09fd[_0x8c78('0x5d')],_0x4c09fd[_0x8c78('0x64')]||'en',0x1)[_0x8c78('0x17')](function(_0x9e1f41){_0x41adf0(null,_0x9e1f41);})['catch'](function(_0x3a4c7a){_0x41adf0(_0x3a4c7a);});};AGIVertices[_0x8c78('0x14')]['restAPI']=function(_0x3f6ae5,_0x13205e){var _0xae45a8={'uri':_0x3f6ae5[_0x8c78('0x65')],'method':_0x3f6ae5[_0x8c78('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3f6ae5[_0x8c78('0x67')])===_0x8c78('0x68')&&parseInt(_0x3f6ae5[_0x8c78('0x67')])>=0x1?parseInt(_0x3f6ae5[_0x8c78('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x8c78('0x69')]([_0x8c78('0x6a'),_0x8c78('0x6b')],_0xae45a8[_0x8c78('0x66')][_0x8c78('0x6c')]())){try{_0xae45a8[_0x8c78('0x6d')]=_0x3f6ae5[_0x8c78('0xc')]?JSON[_0x8c78('0x6e')](_0x3f6ae5['rawBody']):{};}catch(_0x2b367c){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2b367c);}}try{_0xae45a8[_0x8c78('0x6f')]=_0x3f6ae5[_0x8c78('0xb')]?JSON[_0x8c78('0x6e')](_0x3f6ae5[_0x8c78('0xb')]):{};}catch(_0x49fd34){logger[_0x8c78('0x2f')](_0x8c78('0x70'),_0x49fd34);}if(_0x3f6ae5[_0x8c78('0x71')]){try{var _0x52cf81=require(_0x3f6ae5[_0x8c78('0x71')])[_0x8c78('0x72')](this,_0xae45a8);_0xae45a8[_0x8c78('0x73')]=Mustache[_0x8c78('0x74')](_0x3f6ae5['url'],_0x52cf81,{},['$$','$$']);if(_0xae45a8[_0x8c78('0x6f')]){_0xae45a8[_0x8c78('0x6f')]=JSON['parse'](Mustache['render'](JSON['stringify'](_0xae45a8[_0x8c78('0x6f')]),_0x52cf81,{},['$$','$$']));}if(_0xae45a8[_0x8c78('0x6d')]){_0xae45a8[_0x8c78('0x6d')]=JSON[_0x8c78('0x6e')](Mustache['render'](JSON[_0x8c78('0x75')](_0xae45a8['body']),_0x52cf81,{},['$$','$$']));}}catch(_0x2f6e82){logger[_0x8c78('0x2f')](_0x8c78('0x76'),_0x2f6e82);}}rp(_0xae45a8)[_0x8c78('0x17')](function(_0x37059a){var _0x15dc4a={'statusCode':_0x37059a['statusCode']||0xc8,'statusMessage':_0x37059a['statusMessage']||'OK','headers':_0x37059a['headers']||{},'body':_0x37059a[_0x8c78('0x6d')]||{}};_0x13205e(null,_0x15dc4a);})[_0x8c78('0x1b')](function(_0x53b653){var _0xb40796={'statusCode':_0x53b653[_0x8c78('0x77')]||0x1f4,'statusMessage':_0x53b653[_0x8c78('0x78')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x53b653[_0x8c78('0x79')]['headers']||{},'body':_0x53b653[_0x8c78('0x79')][_0x8c78('0x6d')]||{}};_0x13205e(null,_0xb40796);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x7a')]=function(_0x475b0f,_0x3e14c8){scripts[_0x8c78('0x7a')](this[_0x8c78('0xf')][_0x8c78('0x3d')],_0x475b0f[_0x8c78('0x7b')],_0x475b0f[_0x8c78('0x5d')],_0x475b0f[_0x8c78('0x7c')]||'en')['then'](function(_0x2c32ed){_0x3e14c8(null,_0x2c32ed);})[_0x8c78('0x1b')](function(_0x367ce3){_0x3e14c8(_0x367ce3);});};AGIVertices['prototype'][_0x8c78('0x7d')]=function(_0x1ba75a,_0x2eeaa){scripts[_0x8c78('0x7d')](this['channel'][_0x8c78('0x3d')],_0x1ba75a[_0x8c78('0x7e')],_0x1ba75a[_0x8c78('0x7f')],_0x1ba75a['private_key'],_0x1ba75a[_0x8c78('0x5d')],_0x1ba75a[_0x8c78('0x80')]||'en')[_0x8c78('0x17')](function(_0x2a10fa){_0x2eeaa(null,_0x2a10fa);})[_0x8c78('0x1b')](function(_0x43d1b2){_0x2eeaa(_0x43d1b2);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x81')]=function(_0x3da02b,_0x50c852){scripts['sestekNDA'](this[_0x8c78('0xf')],_0x3da02b)['then'](function(_0x2bc79c){_0x50c852(null,_0x2bc79c);})[_0x8c78('0x1b')](function(_0x146d92){_0x50c852(_0x146d92);});};AGIVertices[_0x8c78('0x14')]['ispeechTTS']=function(_0x3f121d,_0x3bc043){scripts[_0x8c78('0x82')](_0x3f121d[_0x8c78('0x7b')],_0x3f121d[_0x8c78('0x5d')],_0x3f121d[_0x8c78('0x83')]||_0x8c78('0x5f'),_0x3f121d['speed'])[_0x8c78('0x17')](function(_0x11697f){_0x3bc043(null,_0x11697f);})['catch'](function(_0x13c36e){_0x3bc043(_0x13c36e);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x84')]=function(_0x42f362,_0x2340a3,_0x1e0fe9){scripts[_0x8c78('0x84')](_0x2340a3,_0x42f362[_0x8c78('0x7b')],_0x42f362[_0x8c78('0x85')]||'en-US',this[_0x8c78('0x86')](_0x42f362[_0x8c78('0x87')])?_0x42f362[_0x8c78('0x87')]:undefined)[_0x8c78('0x17')](function(_0x11baca){_0x1e0fe9(null,_0x11baca);})[_0x8c78('0x1b')](function(_0x19aec3){_0x1e0fe9(_0x19aec3);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x88')]=function(_0x19b409,_0x180f81){scripts[_0x8c78('0x88')](_0x19b409['aws_access_key_id'],_0x19b409[_0x8c78('0x89')],_0x19b409[_0x8c78('0x8a')],_0x19b409[_0x8c78('0x8b')]||'Amy',_0x19b409[_0x8c78('0x5d')],_0x19b409['aws_text_type']||_0x8c78('0x5d'))[_0x8c78('0x17')](function(_0x2bb0a8){_0x180f81(null,_0x2bb0a8);})['catch'](function(_0x4b7a5f){_0x180f81(_0x4b7a5f);});};AGIVertices['prototype'][_0x8c78('0x8c')]=function(_0x4f23a0,_0x226781){scripts['awsLex'](this[_0x8c78('0xf')][_0x8c78('0x3d')],_0x4f23a0[_0x8c78('0x8d')],_0x4f23a0[_0x8c78('0x89')],_0x4f23a0[_0x8c78('0x8e')],_0x4f23a0[_0x8c78('0x5d')],_0x4f23a0[_0x8c78('0x8f')])['then'](function(_0x340569){_0x226781(null,_0x340569);})[_0x8c78('0x1b')](function(_0x4d067b){_0x226781(_0x4d067b);});};AGIVertices['prototype']['googleASR']=function(_0x54a580,_0x4b886c,_0x7cdf32){scripts[_0x8c78('0x90')](_0x4b886c,_0x54a580[_0x8c78('0x7b')],_0x54a580['google_asr_language']||_0x8c78('0x5f'))[_0x8c78('0x17')](function(_0x38c19a){_0x7cdf32(null,_0x38c19a);})[_0x8c78('0x1b')](function(_0x54ffbc){_0x7cdf32(_0x54ffbc);});};AGIVertices[_0x8c78('0x14')]['tildeASR']=function(_0x1d3d29,_0x590aa3,_0x245035){scripts[_0x8c78('0x91')](_0x590aa3,_0x1d3d29[_0x8c78('0x92')],_0x1d3d29[_0x8c78('0x93')],_0x1d3d29[_0x8c78('0x73')])[_0x8c78('0x17')](function(_0xcf48ba){_0x245035(null,_0xcf48ba);})['catch'](function(_0x53a506){_0x245035(_0x53a506);});};AGIVertices[_0x8c78('0x14')][_0x8c78('0x94')]=function(_0x20fe16){var _0x1722bd=_[_0x8c78('0x69')](verticesWithRetry,_0x20fe16[_0x8c78('0x3a')])?_0x20fe16:_['clone'](_0x20fe16);for(var _0x2ca2d1 in _0x1722bd){if(_0x1722bd['hasOwnProperty'](_0x2ca2d1)){if(_0x1722bd[_0x2ca2d1]&&_[_0x8c78('0x95')](_0x1722bd[_0x2ca2d1])){if(_[_0x8c78('0x69')](recursiveMapAttributes,_0x2ca2d1)){_0x1722bd[_0x2ca2d1]=this[_0x8c78('0x96')](_0x1722bd[_0x2ca2d1]);}else{_0x1722bd[_0x2ca2d1]=this[_0x8c78('0x97')](_0x1722bd[_0x2ca2d1]);}}}}return _0x1722bd;};AGIVertices[_0x8c78('0x14')][_0x8c78('0x98')]=function(_0x43d9b0){for(var _0x33babd in _0x43d9b0){if(_0x43d9b0['hasOwnProperty'](_0x33babd)){if(_[_0x8c78('0x99')](_0x43d9b0[_0x33babd])){this[_0x8c78('0x98')](_0x43d9b0[_0x33babd]);}else if(_[_0x8c78('0x9a')](_0x43d9b0[_0x33babd])){for(var _0x39a706=0x0;_0x39a706<_0x43d9b0[_0x33babd][_0x8c78('0x9b')];_0x39a706++){this[_0x8c78('0x98')](_0x43d9b0[_0x33babd][_0x39a706]);}}else if(_[_0x8c78('0x95')](_0x43d9b0[_0x33babd])){_0x43d9b0[_0x33babd]=this[_0x8c78('0x97')](_0x43d9b0[_0x33babd]);}}}};AGIVertices[_0x8c78('0x14')][_0x8c78('0x9c')]=function(_0xf6cf9,_0x314707){for(var _0x2cd845 in _0xf6cf9){if(_0xf6cf9[_0x8c78('0x9d')](_0x2cd845)){if(_[_0x8c78('0x99')](_0xf6cf9[_0x2cd845])){if(!_[_0x8c78('0x45')](_0xf6cf9[_0x2cd845])){this[_0x8c78('0x9c')](_0xf6cf9[_0x2cd845],util[_0x8c78('0x2c')]('%s.%s',_0x314707,_0x2cd845));}}else if(_['isArray'](_0xf6cf9[_0x2cd845])){for(var _0xff6087=0x0;_0xff6087<_0xf6cf9[_0x2cd845][_0x8c78('0x9b')];_0xff6087++){this['saveRestApiResult'](_0xf6cf9[_0x2cd845][_0xff6087],util[_0x8c78('0x2c')]('%s.%s',_0x314707,_0x2cd845+'['+_0xff6087+']'));}}else{if(!_['isNil'](_0xf6cf9[_0x2cd845])){this[_0x8c78('0xf')]['setVariable'](util[_0x8c78('0x2c')](_0x8c78('0x9e'),_0x314707,_0x2cd845),_0xf6cf9[_0x2cd845]);}}}}};AGIVertices[_0x8c78('0x14')]['replaceObjectAllVariables']=function(_0x2d011f){try{var _0x3d6306=JSON[_0x8c78('0x6e')](_0x2d011f);this['recursiveNodeIndex'](_0x3d6306);return JSON[_0x8c78('0x75')](_0x3d6306);}catch(_0x59da60){return this[_0x8c78('0x97')](_0x2d011f);}};AGIVertices[_0x8c78('0x14')][_0x8c78('0x97')]=function(_0x3f969f){var _0x32c25e=_0x3f969f['split']('{');for(var _0x157dd4=0x1;_0x157dd4<_0x32c25e[_0x8c78('0x9b')];_0x157dd4+=0x1){var _0x2263c5=_0x32c25e[_0x157dd4]['split']('}');if(_0x2263c5[_0x8c78('0x9b')]>0x1){_0x3f969f=_0x3f969f[_0x8c78('0x9f')]('{'+_0x2263c5[0x0]+'}',this[_0x8c78('0xf')][_0x8c78('0x11')](_0x2263c5[0x0])[_0x8c78('0xa0')]||_0x2263c5[0x0]);}}if(_0x32c25e['length']===0x1){return _0x3f969f[_0x8c78('0x4f')]();}return this[_0x8c78('0x97')](_0x3f969f);};AGIVertices[_0x8c78('0x14')]['getAndSetVariable']=function(_0x2de809,_0x31aa82){var _0x57a367=this[_0x8c78('0xf')][_0x8c78('0x11')](_0x2de809);if(_0x57a367['result']===-0x1){return _0x57a367;}logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0xa1'),_0x31aa82,_0x57a367[_0x8c78('0xa0')]));return this[_0x8c78('0xf')]['setVariable'](_0x31aa82,_0x57a367[_0x8c78('0xa0')]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x86')]=function(_0x19c580){return _0x19c580&&_0x19c580!=='0'&&_0x19c580!=='-1'&&_0x19c580!=='';};AGIVertices['prototype'][_0x8c78('0xa2')]=function(_0x5b3722){this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x5b3722,'-');_0x5b3722[_0x8c78('0xa3')]=_0x5b3722['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8c78('0x14')]['mrcpsynth']=function(_0xabf913){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0xa4'),_0xabf913[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0xabf913[_0x8c78('0x5d')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xa6'));}var _0x8c05aa='\x22'+_0xabf913[_0x8c78('0x5d')]+'\x22';if(this['isConfigured'](_0xabf913[_0x8c78('0x79')])){_0x8c05aa+=','+_0xabf913[_0x8c78('0x79')];}var _0x1baa14=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x8c78('0xa7'),_0x8c05aa);if(_0x1baa14[_0x8c78('0xa8')]===-0x1){return _0x1baa14;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xa9'),_0x8c05aa));};AGIVertices[_0x8c78('0x14')]['mrcprecog']=function(_0x41067d){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x41067d[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x41067d['grammar'])){return this['channel']['noop'](_0x8c78('0xaa'));}var _0x296dc9=_0x41067d[_0x8c78('0xab')];if(this[_0x8c78('0x86')](_0x41067d[_0x8c78('0x79')])){_0x296dc9+=','+_0x41067d[_0x8c78('0x79')];}var _0x44b65c=this[_0x8c78('0xf')]['exec']('MRCPRecog',_0x296dc9);if(_0x44b65c[_0x8c78('0xa8')]===-0x1){return _0x44b65c;}var _0x5a27ac=this[_0x8c78('0xac')](_0x8c78('0xad'),_0x8c78('0xae'));if(_0x5a27ac[_0x8c78('0xa8')]===-0x1){return _0x5a27ac;}var _0x21416c=this[_0x8c78('0xac')](_0x8c78('0xaf'),'MRCP_RECOG_TRANSCRIPT');if(_0x21416c['result']===-0x1){return _0x21416c;}var _0x28a89d=this[_0x8c78('0xac')](_0x8c78('0xb0'),'MRCP_RECOG_INSTANCE');if(_0x28a89d[_0x8c78('0xa8')]===-0x1){return _0x28a89d;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xb1'),_0x296dc9));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x7')]=function(_0x559f6a){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0xb2'),_0x559f6a[_0x8c78('0x39')]));return this[_0x8c78('0xf')]['agi']([_0x559f6a[_0x8c78('0xb3')],_0x559f6a[_0x8c78('0xb4')]]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0xb5')]=function(_0x46f313){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0xb6'),_0x46f313[_0x8c78('0x39')]));if(this['isConfigured'](_0x46f313[_0x8c78('0x67')])){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x46f313[_0x8c78('0x67')]));var _0x1339c3=this[_0x8c78('0xf')]['wait'](_0x46f313[_0x8c78('0x67')]);if(_0x1339c3[_0x8c78('0xa8')]===-0x1){return _0x1339c3;}}return this[_0x8c78('0xf')][_0x8c78('0xb5')]();};AGIVertices[_0x8c78('0x14')][_0x8c78('0x4c')]=function(_0xaaeff1){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0xb7'),_0xaaeff1[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0xaaeff1[_0x8c78('0x4b')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0xaaeff1,_0x8c78('0xb8'));}_0xaaeff1[_0x8c78('0x4e')]=moment();if(this['isConfigured'](_0xaaeff1[_0x8c78('0xb9')])){_0xaaeff1[_0x8c78('0x4e')]=moment()[_0x8c78('0xba')](_0xaaeff1[_0x8c78('0xb9')],_0x8c78('0xbb'));}if(!this[_0x8c78('0x86')](_0xaaeff1[_0x8c78('0xbc')])){_0xaaeff1[_0x8c78('0xbc')]=0x2;}this['createCmContact']['sync'](this,_0xaaeff1);return this['channel'][_0x8c78('0xa5')](util[_0x8c78('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xaaeff1[_0x8c78('0x4a')],_0xaaeff1[_0x8c78('0x4b')],_0xaaeff1[_0x8c78('0x4e')]));};AGIVertices[_0x8c78('0x14')]['custom_app']=function(_0x4fa5f8){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4fa5f8['label']));var _0x54ac46=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x4fa5f8[_0x8c78('0xbd')],_0x4fa5f8['options']);if(_0x54ac46[_0x8c78('0xa8')]===-0x1){return _0x54ac46;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xbe'),_0x4fa5f8['application'],_0x4fa5f8[_0x8c78('0x79')]));};AGIVertices['prototype'][_0x8c78('0xbf')]=function(_0x5975fe){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0xc0'),_0x5975fe[_0x8c78('0x39')]));if(!this['isConfigured'](_0x5975fe[_0x8c78('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x23a5b6='\x22'+_0x5975fe[_0x8c78('0x5d')]+'\x22';if(this[_0x8c78('0x86')](_0x5975fe[_0x8c78('0x79')])){_0x23a5b6+=','+_0x5975fe[_0x8c78('0x79')];}var _0x263da8=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x8c78('0xa7'),_0x23a5b6);if(_0x263da8[_0x8c78('0xa8')]===-0x1){return _0x263da8;}return this[_0x8c78('0xf')]['noop'](util[_0x8c78('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x23a5b6));};AGIVertices['prototype'][_0x8c78('0xc1')]=function(_0xcc2a3){logger['info'](util['format'](_0x8c78('0xc2'),_0xcc2a3['label']));if(!this[_0x8c78('0x86')](_0xcc2a3[_0x8c78('0x5d')])){return this[_0x8c78('0xf')]['noop'](_0x8c78('0xa6'));}var _0x39097d='\x22'+_0xcc2a3[_0x8c78('0x5d')]+'\x22';if(this[_0x8c78('0x86')](_0xcc2a3[_0x8c78('0x79')])){_0x39097d+=','+_0xcc2a3[_0x8c78('0x79')];}var _0xaeb7a9=this['channel'][_0x8c78('0x59')](_0x8c78('0xa7'),_0x39097d);if(_0xaeb7a9[_0x8c78('0xa8')]===-0x1){return _0xaeb7a9;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x39097d));};AGIVertices[_0x8c78('0x14')]['lumenvoxasr']=function(_0x21f80b){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0xc3'),_0x21f80b[_0x8c78('0x39')]));if(!this['isConfigured'](_0x21f80b[_0x8c78('0xab')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xaa'));}var _0x1d2a02=_0x21f80b[_0x8c78('0xab')];if(this['isConfigured'](_0x21f80b[_0x8c78('0x79')])){_0x1d2a02+=','+_0x21f80b[_0x8c78('0x79')];}var _0x1c5587=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x8c78('0xc4'),_0x1d2a02);if(_0x1c5587['result']===-0x1){return _0x1c5587;}var _0x5dc8ea=this[_0x8c78('0xac')](_0x8c78('0xad'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5dc8ea[_0x8c78('0xa8')]===-0x1){return _0x5dc8ea;}var _0x24d8f0=this[_0x8c78('0xac')](_0x8c78('0xaf'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x24d8f0[_0x8c78('0xa8')]===-0x1){return _0x24d8f0;}var _0x49cb7f=this[_0x8c78('0xac')](_0x8c78('0xb0'),_0x8c78('0xc5'));if(_0x49cb7f['result']===-0x1){return _0x49cb7f;}return this[_0x8c78('0xf')]['noop'](util['format'](_0x8c78('0xb1'),_0x1d2a02));};AGIVertices[_0x8c78('0x14')][_0x8c78('0xc6')]=function(_0x4878e5){logger[_0x8c78('0x32')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x4878e5['label']));if(!this[_0x8c78('0x86')](_0x4878e5[_0x8c78('0xab')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xaa'));}var _0x43519c=_0x4878e5['grammar'];if(this['isConfigured'](_0x4878e5[_0x8c78('0x79')])){_0x43519c+=','+_0x4878e5[_0x8c78('0x79')];}var _0x243352=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x8c78('0xc4'),_0x43519c);if(_0x243352[_0x8c78('0xa8')]===-0x1){return _0x243352;}var _0x39a5d7=this[_0x8c78('0xac')](_0x8c78('0xad'),'SESTEK_ASR_CONFIDENCE');if(_0x39a5d7[_0x8c78('0xa8')]===-0x1){return _0x39a5d7;}var _0x67848f=this[_0x8c78('0xac')]('RECOG_INPUT()',_0x8c78('0xc7'));if(_0x67848f[_0x8c78('0xa8')]===-0x1){return _0x67848f;}var _0x4917b0=this[_0x8c78('0xac')](_0x8c78('0xb0'),_0x8c78('0xc8'));if(_0x4917b0[_0x8c78('0xa8')]===-0x1){return _0x4917b0;}return this['channel'][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xb1'),_0x43519c));};AGIVertices[_0x8c78('0x14')][_0x8c78('0xc9')]=function(_0x3f0deb){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3f0deb[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x3f0deb[_0x8c78('0xca')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3f0deb,_0x8c78('0xcb'));}var _0x13682a=this[_0x8c78('0xcc')]['sync'](this,_0x3f0deb[_0x8c78('0xca')]);if(!_0x13682a){return this['channel'][_0x8c78('0x2f')](_0x3f0deb,_0x8c78('0xcd'));}if(!this[_0x8c78('0x86')](_0x3f0deb[_0x8c78('0xce')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3f0deb,_0x8c78('0xcf'));}var _0x8f5dd3=_0x3f0deb[_0x8c78('0xce')][_0x8c78('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x8c78('0xa5')](util['format'](_0x8c78('0xd0'),_0x8f5dd3));var _0x377a46=this[_0x8c78('0x2d')][_0x8c78('0x72')](this,_0x13682a,_0x8f5dd3);this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x3f0deb,_0x8f5dd3);if(!this[_0x8c78('0x86')](_0x3f0deb['variable_id'])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xd1'));}var _0x48c4de=this[_0x8c78('0x11')][_0x8c78('0x72')](this,_0x3f0deb[_0x8c78('0xd2')]);if(!_0x48c4de){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3f0deb,'no\x20variable\x20found');}var _0x5a815f=this;_0x377a46['forEach'](function(_0xb133de,_0x55ee93){Object[_0x8c78('0xd3')](_0xb133de)[_0x8c78('0xd4')](function(_0x57ad6d){_0x5a815f[_0x8c78('0xf')][_0x8c78('0xd5')](util['format']('%s[%s][%s]',_0x48c4de,_0x55ee93,_0x57ad6d),_0xb133de[_0x57ad6d]);});});this[_0x8c78('0xf')][_0x8c78('0xd5')](util[_0x8c78('0x2c')](_0x8c78('0xd6'),_0x48c4de),_0x377a46[_0x8c78('0x9b')]);return this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format'](_0x8c78('0xd7'),_0x48c4de));};AGIVertices[_0x8c78('0x14')][_0x8c78('0xd8')]=function(_0x3af427){logger['debug'](util[_0x8c78('0x2c')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3af427[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x3af427['sip_id'])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3af427,_0x8c78('0xd9'));}var _0x422007=this[_0x8c78('0x1c')][_0x8c78('0x72')](this,_0x3af427[_0x8c78('0xda')]);if(!_0x422007){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3af427,_0x8c78('0xdb'));}var _0x83b0e9=this['channel'][_0x8c78('0x59')](_0x8c78('0xdc'),[util[_0x8c78('0x2c')](_0x8c78('0xdd'),_0x422007),_0x3af427[_0x8c78('0x67')],_0x3af427[_0x8c78('0xde')],_0x3af427[_0x8c78('0x65')]]);if(_0x83b0e9[_0x8c78('0xa8')]===-0x1){return _0x83b0e9;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xdf'),'DIAL'));};AGIVertices[_0x8c78('0x14')][_0x8c78('0xe0')]=function(_0x2c7dd1){logger[_0x8c78('0x32')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2c7dd1[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x2c7dd1[_0x8c78('0x7b')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xe1'));}if(!this[_0x8c78('0x86')](_0x2c7dd1[_0x8c78('0x5d')])){return this['channel'][_0x8c78('0xa5')](_0x8c78('0xa6'));}this['channel'][_0x8c78('0xe2')]=!![];this[_0x8c78('0x38')](_0x2c7dd1);this[_0x8c78('0x43')](_0x2c7dd1[_0x8c78('0x5d')],'in','','');this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xe3'),_0x2c7dd1[_0x8c78('0x5d')]));var _0x2bf5e2=this[_0x8c78('0x7a')][_0x8c78('0x72')](this,_0x2c7dd1);if(_0x2bf5e2){for(var _0x3058f8 in _0x2bf5e2){if(_0x2bf5e2[_0x8c78('0x9d')](_0x3058f8)){this['channel'][_0x8c78('0xd5')](util['format'](_0x8c78('0xe4'),_0x3058f8['toUpperCase']()),_0x2bf5e2[_0x3058f8]);}}this['createSquareMessage'](_0x2bf5e2['speech'],_0x8c78('0xe5'),_0x8c78('0xe0'),'');return this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format'](_0x8c78('0xe6'),_0x2bf5e2[_0x8c78('0xe7')]));}return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x2c7dd1,_0x8c78('0xe8'));};AGIVertices[_0x8c78('0x14')][_0x8c78('0xe9')]=function(_0x5415c5){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0xea'),_0x5415c5[_0x8c78('0x39')]));if(!this['isConfigured'](_0x5415c5[_0x8c78('0x7e')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xeb'));}if(!this[_0x8c78('0x86')](_0x5415c5[_0x8c78('0x7f')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xec'));}if(!this[_0x8c78('0x86')](_0x5415c5['private_key'])){return this[_0x8c78('0xf')]['noop'](_0x8c78('0xed'));}if(!this[_0x8c78('0x86')](_0x5415c5[_0x8c78('0x80')])){return this['channel']['noop'](_0x8c78('0xee'));}if(!this[_0x8c78('0x86')](_0x5415c5[_0x8c78('0x5d')])){return this['channel'][_0x8c78('0xa5')]('no\x20text\x20configured');}this[_0x8c78('0xf')][_0x8c78('0xe2')]=!![];this[_0x8c78('0x38')](_0x5415c5);this[_0x8c78('0x43')](_0x5415c5[_0x8c78('0x5d')],'in','','');this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xef'),_0x5415c5[_0x8c78('0x5d')]));var _0x1859cf=this[_0x8c78('0x7d')][_0x8c78('0x72')](this,_0x5415c5);if(_0x1859cf){for(var _0x462f56 in _0x1859cf){if(_0x1859cf[_0x8c78('0x9d')](_0x462f56)){if(_0x462f56!=='providerResponse'){this['channel'][_0x8c78('0xd5')](util[_0x8c78('0x2c')](_0x8c78('0xe4'),_0x462f56[_0x8c78('0x6c')]()),_0x1859cf[_0x462f56]);}}}this[_0x8c78('0x43')](_0x1859cf[_0x8c78('0xe7')],_0x8c78('0xe5'),'dialogflowV2',_0x1859cf[_0x8c78('0xf0')]);return this[_0x8c78('0xf')]['noop'](util[_0x8c78('0x2c')](_0x8c78('0xf1'),_0x1859cf[_0x8c78('0xe7')]));}return this['channel'][_0x8c78('0x2f')](_0x5415c5,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x8c78('0x14')]['sesteknda']=function(_0xeef5fc){logger[_0x8c78('0x32')](util['format'](_0x8c78('0xf2'),_0xeef5fc['label']));if(!this['isConfigured'](_0xeef5fc[_0x8c78('0xf3')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x8c78('0x86')](_0xeef5fc[_0x8c78('0xf4')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xf5'));}if(!this[_0x8c78('0x86')](_0xeef5fc[_0x8c78('0xf6')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xf7'));}if(!this[_0x8c78('0x86')](_0xeef5fc[_0x8c78('0xf8')])){return this['channel'][_0x8c78('0xa5')](_0x8c78('0xa6'));}this[_0x8c78('0xf')]['bot']=!![];this[_0x8c78('0x38')](_0xeef5fc);this['createSquareMessage'](_0xeef5fc[_0x8c78('0x5d')],'in','','');this[_0x8c78('0xf')]['noop'](util[_0x8c78('0x2c')](_0x8c78('0xf9'),_0xeef5fc[_0x8c78('0x5d')]));var _0xb8ef39=this[_0x8c78('0x81')][_0x8c78('0x72')](this,_0xeef5fc);if(_0xb8ef39){for(var _0x40202c in _0xb8ef39){if(_0xb8ef39[_0x8c78('0x9d')](_0x40202c)){this[_0x8c78('0xf')][_0x8c78('0xd5')](util[_0x8c78('0x2c')](_0x8c78('0xfa'),_0x40202c[_0x8c78('0x6c')]()),_0xb8ef39[_0x40202c]);}}this['createSquareMessage'](_0xb8ef39[_0x8c78('0xe7')],_0x8c78('0xe5'),_0x8c78('0xfb'),'');if(_0xb8ef39[_0x8c78('0xfc')]){this['channel']['noop'](util[_0x8c78('0x2c')](_0x8c78('0xfd'),_0xb8ef39[_0x8c78('0xfc')]));var _0x387e47=this[_0x8c78('0xf')][_0x8c78('0xfe')](_0xb8ef39['audiofile']);try{fs['unlink'](_0xb8ef39[_0x8c78('0xfc')]+_0x8c78('0xff'));}catch(_0x3f1ea9){logger[_0x8c78('0x2f')](_0x3f1ea9);}return _0x387e47;}else{return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x100'),_0xb8ef39['speech']));}}return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0xeef5fc,_0x8c78('0x101'));};AGIVertices['prototype'][_0x8c78('0x102')]=function(_0x5c4f2f){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x103'),_0x5c4f2f['label']));return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0x102'));};AGIVertices['prototype'][_0x8c78('0x104')]=function(_0x50e6b5){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x105'),_0x50e6b5[_0x8c78('0x39')]));var _0xc1a106='';if(_0x50e6b5[_0x8c78('0x106')]){if(!this[_0x8c78('0x86')](_0x50e6b5[_0x8c78('0x106')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x50e6b5,'no\x20trunk\x20selected');}else{var _0x412fbe=parseInt(_0x50e6b5[_0x8c78('0x106')],0xa);if(isNaN(_0x412fbe)){_0xc1a106=_0x50e6b5[_0x8c78('0x106')];}else{_0xc1a106=this['getTrunk'][_0x8c78('0x72')](this,_0x50e6b5['trunk_id']);if(!_0xc1a106){return this[_0x8c78('0xf')]['error'](_0x50e6b5,'no\x20trunk\x20found');}}}}else if(_0x50e6b5[_0x8c78('0x107')]){_0xc1a106=_0x50e6b5[_0x8c78('0x107')];}else{return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x50e6b5,_0x8c78('0x108'));}var _0x2008f1=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x8c78('0xdc'),[util[_0x8c78('0x2c')](_0x8c78('0x109'),_0xc1a106,_0x50e6b5['phone']),_0x50e6b5[_0x8c78('0x67')],_0x50e6b5[_0x8c78('0xde')],_0x50e6b5[_0x8c78('0x65')]]);if(_0x2008f1[_0x8c78('0xa8')]===-0x1){return _0x2008f1;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xdf'),_0x8c78('0xdc')));};AGIVertices['prototype'][_0x8c78('0x10a')]=function(_0x59f98e){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x10b'),_0x59f98e['label']));return this['channel'][_0x8c78('0xa5')](_0x8c78('0x10a'));};AGIVertices['prototype'][_0x8c78('0xd')]=function(_0x3c9a48){logger['info'](util['format'](_0x8c78('0x10c'),_0x3c9a48[_0x8c78('0x39')]));if(_0x3c9a48['retry']===0x0){return this['maxRetry'](_0x3c9a48);}_0x3c9a48[_0x8c78('0xa3')]-=0x1;if(!this[_0x8c78('0x86')](_0x3c9a48[_0x8c78('0x10d')])){return this['channel']['error'](_0x3c9a48,'no\x20file\x20audio\x20selected');}var _0x4758b7=this[_0x8c78('0x10e')]['sync'](this,_0x3c9a48['file_id']);if(!_0x4758b7){return this['channel'][_0x8c78('0x2f')](_0x3c9a48,_0x8c78('0x10f'));}if(!this[_0x8c78('0x86')](_0x3c9a48[_0x8c78('0xd2')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x8c78('0xd1'));}var _0x5618a4=this[_0x8c78('0xf')][_0x8c78('0x110')](_0x4758b7,_0x3c9a48[_0x8c78('0x111')],_0x3c9a48['maxdigit']);var _0xbac240=_0x5618a4[_0x8c78('0xa8')]?_0x5618a4[_0x8c78('0xa8')][_0x8c78('0x4f')]():'';logger[_0x8c78('0x32')](_0x8c78('0x112'),JSON[_0x8c78('0x75')](_0x5618a4));if(_0x5618a4[_0x8c78('0xa8')]===-0x1){this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x3c9a48,_0xbac240);return _0x5618a4;}else if(_0x5618a4['extra']==='timeout'){_0x5618a4[_0x8c78('0xa8')]=_0xbac240['length']>=parseInt(_0x3c9a48[_0x8c78('0x113')])?'x':'i';}else{_0x5618a4[_0x8c78('0xa8')]=_0xbac240[_0x8c78('0x9b')]>=parseInt(_0x3c9a48[_0x8c78('0x113')])&&_0xbac240[_0x8c78('0x9b')]<=parseInt(_0x3c9a48[_0x8c78('0x114')])?'x':'i';}var _0x5d6256=this['getVariable'][_0x8c78('0x72')](this,_0x3c9a48['variable_id']);if(!_0x5d6256){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3c9a48,_0x8c78('0x115'));}this[_0x8c78('0xf')][_0x8c78('0xd5')](_0x5d6256,_0xbac240);if(this[_0x8c78('0x86')](_0x3c9a48[_0x8c78('0x116')])){var _0x22bf31=parseInt(_0x3c9a48[_0x8c78('0x116')],0xa);var _0x1da08a=rs[_0x8c78('0x117')]({'charset':'*','length':_0x22bf31});var _0x2eef2b=_0xbac240['length'];if(_0x2eef2b>0x0){if(_0x2eef2b>_0x22bf31){this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x3c9a48,_0x3c9a48['hiddendigitspos']===_0x8c78('0x118')?_0x1da08a+_0xbac240[_0x8c78('0x119')](_0x22bf31):_0xbac240[_0x8c78('0x119')](0x0,_0x2eef2b-_0x22bf31)+_0x1da08a);}else{this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x3c9a48,rs[_0x8c78('0x117')]({'charset':'*','length':_0x2eef2b}));}}else{this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x3c9a48,'');}}else{this[_0x8c78('0x38')]['sync'](this,_0x3c9a48,_0xbac240);}return _0x5618a4;};AGIVertices[_0x8c78('0x14')][_0x8c78('0xe')]=function(_0x16af2f){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x11a'),_0x16af2f['label']));return this['getdigits'](_0x16af2f);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x11b')]=function(_0x46c362){logger['info'](util['format'](_0x8c78('0x11c'),_0x46c362[_0x8c78('0x39')]));this[_0x8c78('0x38')]['sync'](this,_0x46c362,_0x46c362[_0x8c78('0x11d')]);return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')]('GOAL\x20%s',_0x46c362[_0x8c78('0x11d')]));};AGIVertices['prototype'][_0x8c78('0x11e')]=function(_0x1b39b1){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x11f'),_0x1b39b1[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x1b39b1['aws_access_key_id'])||!this[_0x8c78('0x86')](_0x1b39b1['aws_secret_access_key'])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0x120'));}if(!this[_0x8c78('0x86')](_0x1b39b1[_0x8c78('0x5d')])){return this['channel'][_0x8c78('0xa5')](_0x8c78('0xa6'));}this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format'](_0x8c78('0x121'),_0x1b39b1[_0x8c78('0x5d')]));var _0x1dd894=this[_0x8c78('0x88')][_0x8c78('0x72')](this,_0x1b39b1);if(_0x1dd894){this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x122'),_0x1dd894));var _0x5531cb=this[_0x8c78('0xf')][_0x8c78('0xfe')](_0x1dd894);try{fs[_0x8c78('0x123')](_0x1dd894+'.wav');}catch(_0x3236b3){logger[_0x8c78('0x2f')](_0x3236b3);}return _0x5531cb;}return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x1b39b1,_0x8c78('0x124'));};AGIVertices[_0x8c78('0x14')]['awslex']=function(_0x42a602){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x125'),_0x42a602[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x42a602[_0x8c78('0x8d')])||!this[_0x8c78('0x86')](_0x42a602[_0x8c78('0x89')])){return this['channel'][_0x8c78('0xa5')](_0x8c78('0x120'));}if(!this[_0x8c78('0x86')](_0x42a602[_0x8c78('0x8f')])){return this['channel'][_0x8c78('0xa5')]('no\x20bot\x20name\x20configured');}if(!this[_0x8c78('0x86')](_0x42a602[_0x8c78('0x5d')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xa6'));}this[_0x8c78('0xf')][_0x8c78('0xe2')]=!![];this[_0x8c78('0x38')](_0x42a602);this['createSquareMessage'](_0x42a602['text'],'in','','');this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x126'),_0x42a602['text']));var _0x17d742=this[_0x8c78('0x8c')]['sync'](this,_0x42a602);if(_0x17d742){for(var _0x5a606d in _0x17d742){if(_0x17d742['hasOwnProperty'](_0x5a606d)&&_[_0x8c78('0x95')](_0x17d742[_0x5a606d])){this['channel'][_0x8c78('0xd5')](util[_0x8c78('0x2c')](_0x8c78('0x127'),_0x5a606d[_0x8c78('0x6c')]()),_0x17d742[_0x5a606d]);}}if(_[_0x8c78('0x46')](_0x17d742[_0x8c78('0x78')])){return this[_0x8c78('0xf')]['noop'](_0x8c78('0x128'));}else{this[_0x8c78('0x43')](_0x17d742[_0x8c78('0x78')],_0x8c78('0xe5'),_0x8c78('0x129'),'');return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x12a'),_0x17d742[_0x8c78('0x78')]));}}return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x42a602,_0x8c78('0x12b'));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x12c')]=function(_0x50356c){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x12d'),_0x50356c[_0x8c78('0x39')],_0x50356c[_0x8c78('0x67')]));if(!this[_0x8c78('0x86')](_0x50356c[_0x8c78('0x7b')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xe1'));}var _0x258ca8=_0x8c78('0x12e');var _0x5e0d2d=util['format'](_0x8c78('0x12f'),FILES_PATH,rs[_0x8c78('0x117')](0x4));var _0x29ecc7=util[_0x8c78('0x2c')](_0x8c78('0x9e'),_0x5e0d2d,_0x258ca8);var _0x1814c3=!![];if(_0x50356c[_0x8c78('0x130')]===_0x8c78('0x131')){_0x1814c3=![];}var _0xd60e60=this[_0x8c78('0xf')][_0x8c78('0x132')](_0x5e0d2d,_0x258ca8,_0x50356c[_0x8c78('0x133')],_0x50356c[_0x8c78('0x67')],undefined,_0x1814c3);if(_0xd60e60[_0x8c78('0xa8')]!==-0x1){this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format'](_0x8c78('0x134'),_0x29ecc7));var _0x109439=this[_0x8c78('0x90')][_0x8c78('0x72')](this,_0x50356c,_0x29ecc7);if(_0x109439){for(var _0x45ce08 in _0x109439){if(_0x109439[_0x8c78('0x9d')](_0x45ce08)){this[_0x8c78('0xf')][_0x8c78('0xd5')](util[_0x8c78('0x2c')]('GOOGLE_ASR_%s',_0x45ce08[_0x8c78('0x6c')]()),_0x109439[_0x45ce08]);}}return this[_0x8c78('0xf')]['noop'](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x8c78('0x75')](_0x109439)));}}return _0xd60e60;};AGIVertices[_0x8c78('0x14')][_0x8c78('0x135')]=function(_0x4ba435){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x136'),_0x4ba435[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x4ba435[_0x8c78('0x92')])){return this[_0x8c78('0xf')]['noop'](_0x8c78('0x137'));}if(!this[_0x8c78('0x86')](_0x4ba435[_0x8c78('0x93')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')]('no\x20appsecret\x20configured');}var _0x5eda65=_0x8c78('0x12e');var _0x34d3b7=util[_0x8c78('0x2c')](_0x8c78('0x12f'),FILES_PATH,rs[_0x8c78('0x117')](0x4));var _0x535533=util[_0x8c78('0x2c')](_0x8c78('0x9e'),_0x34d3b7,_0x5eda65);var _0x351632=!![];if(_0x4ba435['beep']==='NOBEEP'){_0x351632=![];}var _0x3452ed=this[_0x8c78('0xf')][_0x8c78('0x132')](_0x34d3b7,_0x5eda65,_0x4ba435[_0x8c78('0x133')],_0x4ba435[_0x8c78('0x67')],undefined,_0x351632);if(_0x3452ed[_0x8c78('0xa8')]!==-0x1){this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x138'),_0x535533));var _0x4183ec=this[_0x8c78('0x91')][_0x8c78('0x72')](this,_0x4ba435,_0x535533);if(_0x4183ec){for(var _0x45b55e in _0x4183ec){if(_0x4183ec[_0x8c78('0x9d')](_0x45b55e)){this[_0x8c78('0xf')]['setVariable'](util[_0x8c78('0x2c')]('TILDE_ASR_%s',_0x45b55e[_0x8c78('0x6c')]()),_0x4183ec[_0x45b55e]);}}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x139'),JSON[_0x8c78('0x75')](_0x4183ec)));}}return _0x3452ed;};AGIVertices[_0x8c78('0x14')][_0x8c78('0x13a')]=function(_0x100ded){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x13b'),_0x100ded[_0x8c78('0x39')]));return this[_0x8c78('0xf')][_0x8c78('0x13c')](_0x100ded[_0x8c78('0x13d')],_0x100ded['extension'],_0x100ded[_0x8c78('0x3f')]);};AGIVertices['prototype'][_0x8c78('0x13e')]=function(_0x1bffd0){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x13f'),_0x1bffd0[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x1bffd0['condition'])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x1bffd0,_0x8c78('0x140'));}try{var _0x48bf86=eval(_0x1bffd0['condition'])?'true':_0x8c78('0x141');this[_0x8c78('0xf')]['noop'](util[_0x8c78('0x2c')]('EVAL\x20CONDITION\x20%s\x20%s',_0x1bffd0['condition'],_0x48bf86));return{'code':0xc8,'result':_0x48bf86};}catch(_0x708dfd){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x8c78('0x14')][_0x8c78('0x142')]=function(_0x5e6183){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x143'),_0x5e6183[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x5e6183[_0x8c78('0x144')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x5e6183,_0x8c78('0x145'));}var _0x2ef499=this[_0x8c78('0x26')][_0x8c78('0x72')](this,_0x5e6183[_0x8c78('0x144')]);if(!_0x2ef499){return this['channel'][_0x8c78('0x2f')](_0x5e6183,_0x8c78('0x146'));}for(var _0x3ddb91=0x0;_0x3ddb91<_0x2ef499[_0x8c78('0x9b')];_0x3ddb91+=0x1){var _0xff5ef7=this[_0x8c78('0xf')][_0x8c78('0x11')](util[_0x8c78('0x2c')](_0x8c78('0x147'),_0x2ef499[_0x3ddb91]));if(_0xff5ef7['result']===-0x1){return _0xff5ef7;}logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x148'),_0x2ef499[_0x3ddb91],_0xff5ef7[_0x8c78('0xa0')]));if(_0xff5ef7[_0x8c78('0xa0')]===_0x8c78('0x149')){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x148'),_0x2ef499[_0x3ddb91],_0x8c78('0x149')));this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x148'),_0x2ef499[_0x3ddb91],_0x8c78('0x149')));return{'code':0xc8,'result':'true'};}else{logger[_0x8c78('0x32')](util['format']('IFTIME\x20%s\x20%s',_0x2ef499[_0x3ddb91],_0x8c78('0x141')));this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format']('IFTIME\x20%s\x20%s',_0x2ef499[_0x3ddb91],_0x8c78('0x141')));}}return{'code':0xc8,'result':_0x8c78('0x141')};};AGIVertices['prototype']['hangup']=function(_0x4ba210){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x14a'),_0x4ba210[_0x8c78('0x39')]));return this[_0x8c78('0xf')][_0x8c78('0x14b')]();};AGIVertices[_0x8c78('0x14')][_0x8c78('0x14c')]=function(_0x5a236b){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x14d'),_0x5a236b['label']));if(!this[_0x8c78('0x86')](_0x5a236b[_0x8c78('0x7b')])){return this[_0x8c78('0xf')]['noop']('no\x20key\x20configured');}var _0x44c242=_0x8c78('0x12e');var _0x3eb008=util[_0x8c78('0x2c')](_0x8c78('0x12f'),FILES_PATH,rs[_0x8c78('0x117')](0x4));var _0x221986=util[_0x8c78('0x2c')](_0x8c78('0x9e'),_0x3eb008,_0x44c242);var _0x2f5815=!![];if(_0x5a236b['beep']===_0x8c78('0x131')){_0x2f5815=![];}var _0x101f69=this[_0x8c78('0xf')][_0x8c78('0x132')](_0x3eb008,_0x44c242,_0x5a236b[_0x8c78('0x133')],_0x5a236b['timeout'],undefined,_0x2f5815);if(_0x101f69['result']!==-0x1){this['channel']['noop'](util['format'](_0x8c78('0x14e'),_0x221986));var _0x46ce74=this['ispeechASR'][_0x8c78('0x72')](this,_0x5a236b,_0x221986);if(_0x46ce74){for(var _0x40c943 in _0x46ce74){if(_0x46ce74[_0x8c78('0x9d')](_0x40c943)){this[_0x8c78('0xf')][_0x8c78('0xd5')](util[_0x8c78('0x2c')]('ISPEECH_ASR_%s',_0x40c943[_0x8c78('0x6c')]()),_0x46ce74[_0x40c943]);}}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x14f'),JSON[_0x8c78('0x75')](_0x46ce74)));}}return _0x101f69;};AGIVertices[_0x8c78('0x14')][_0x8c78('0x150')]=function(_0x486800){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x151'),_0x486800['label']));if(!this[_0x8c78('0x86')](_0x486800[_0x8c78('0x7b')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xe1'));}if(!this[_0x8c78('0x86')](_0x486800[_0x8c78('0x5d')])){return this['channel'][_0x8c78('0xa5')](_0x8c78('0xa6'));}this['channel'][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x152'),_0x486800[_0x8c78('0x5d')]));var _0x282708=this[_0x8c78('0x82')][_0x8c78('0x72')](this,_0x486800);if(_0x282708){this['channel']['noop'](util['format'](_0x8c78('0x14e'),_0x282708));var _0x2ead40=this[_0x8c78('0xf')][_0x8c78('0xfe')](_0x282708,_0x486800[_0x8c78('0x133')]);try{fs[_0x8c78('0x123')](_0x282708+'.wav');}catch(_0x5268e5){logger[_0x8c78('0x2f')](_0x5268e5);}return _0x2ead40;}return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x486800,_0x8c78('0x153'));};AGIVertices[_0x8c78('0x14')]['login']=function(_0x160429){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x154'),_0x160429[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x160429[_0x8c78('0x155')])){return this[_0x8c78('0xf')]['error'](_0x160429,'no\x20find\x20by\x20configured');}logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x156'),this['channel'][_0x8c78('0x3c')],_0x160429[_0x8c78('0x155')]));var _0x1a2629=this[_0x8c78('0x55')]['sync'](this,_0x160429['findBy']);if(_0x1a2629){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x160429[_0x8c78('0x155')]));this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8c78('0x3c')],_0x160429[_0x8c78('0x155')]));return{'code':0xc8,'result':_0x8c78('0x158')};}else{logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x159'),this['channel'][_0x8c78('0x3c')],_0x160429['findBy']));this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x159'),this[_0x8c78('0xf')]['callerid'],_0x160429['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8c78('0x14')]['logout']=function(_0x5569ca){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x15a'),_0x5569ca[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x5569ca[_0x8c78('0x155')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x5569ca,_0x8c78('0x15b'));}logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8c78('0xf')]['callerid'],_0x5569ca[_0x8c78('0x155')]));var _0x31bc69=this[_0x8c78('0x54')][_0x8c78('0x72')](this,_0x5569ca[_0x8c78('0x155')]);if(_0x31bc69){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x157'),this['channel'][_0x8c78('0x3c')],_0x5569ca['findBy']));this['channel'][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x5569ca[_0x8c78('0x155')]));return{'code':0xc8,'result':_0x8c78('0x158')};}else{logger[_0x8c78('0x32')](util['format'](_0x8c78('0x159'),this[_0x8c78('0xf')]['callerid'],_0x5569ca['findBy']));this['channel']['noop'](util['format'](_0x8c78('0x159'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x5569ca[_0x8c78('0x155')]));return{'code':0xc8,'result':_0x8c78('0x15c')};}};AGIVertices['prototype']['math']=function(_0x479fd9){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x479fd9['label']));if(!this[_0x8c78('0x86')](_0x479fd9[_0x8c78('0x15d')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x479fd9,_0x8c78('0x15e'));}this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x15f'),_0x479fd9[_0x8c78('0x15d')]));var _0x1fc280=eval(_0x479fd9[_0x8c78('0x15d')]);if(!this[_0x8c78('0x86')](_0x479fd9[_0x8c78('0xd2')])){return this[_0x8c78('0xf')]['noop'](_0x8c78('0xd1'));}var _0x110327=this[_0x8c78('0x11')][_0x8c78('0x72')](this,_0x479fd9[_0x8c78('0xd2')]);if(!_0x110327){return this['channel'][_0x8c78('0x2f')](_0x479fd9,_0x8c78('0x115'));}if(_[_0x8c78('0x9a')](_0x1fc280)){var _0x41d88d=this;_0x1fc280[_0x8c78('0xd4')](function(_0x164cbb,_0x3cb264){_0x41d88d[_0x8c78('0xf')][_0x8c78('0xd5')](util['format'](_0x8c78('0x160'),_0x110327,_0x3cb264),_0x164cbb);});return this[_0x8c78('0xf')]['noop'](util[_0x8c78('0x2c')]('variable\x20%s[key]\x20set',_0x110327));}else{return this[_0x8c78('0xf')][_0x8c78('0xd5')](_0x110327,_0x1fc280);}};AGIVertices[_0x8c78('0x14')][_0x8c78('0x161')]=function(_0x59f4c9){logger[_0x8c78('0x32')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x59f4c9['label']));if(_0x59f4c9[_0x8c78('0xa3')]===0x0){return this[_0x8c78('0xa2')](_0x59f4c9);}_0x59f4c9['retry']-=0x1;if(!this[_0x8c78('0x86')](_0x59f4c9[_0x8c78('0x10d')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x59f4c9,_0x8c78('0x162'));}var _0xf85636=this[_0x8c78('0x10e')][_0x8c78('0x72')](this,_0x59f4c9[_0x8c78('0x10d')]);if(!_0xf85636){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x59f4c9,_0x8c78('0x10f'));}var _0x43ce51=this[_0x8c78('0xf')][_0x8c78('0x110')](_0xf85636,_0x59f4c9[_0x8c78('0x111')],_0x59f4c9['digit']);var _0x39faf2=_0x43ce51[_0x8c78('0xa8')];if(_0x43ce51['result']===-0x1){this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x59f4c9,'-1');return _0x43ce51;}else if(_0x43ce51[_0x8c78('0xa0')]===_0x8c78('0x67')){_0x43ce51[_0x8c78('0xa8')]=_0x43ce51['result'][_0x8c78('0x9b')]>0x0?_0x43ce51[_0x8c78('0xa8')]:'t';}else if(_[_0x8c78('0x45')](_0x43ce51[_0x8c78('0xa8')])){_0x43ce51[_0x8c78('0xa8')]='#';_0x39faf2='#';}if(!this[_0x8c78('0x86')](_0x59f4c9[_0x8c78('0xd2')])){this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xd1'));}else{var _0x304a58=this['getVariable']['sync'](this,_0x59f4c9[_0x8c78('0xd2')]);if(!_0x304a58){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x59f4c9,_0x8c78('0x115'));}this[_0x8c78('0xf')][_0x8c78('0xd5')](_0x304a58,_0x39faf2);}this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x59f4c9,_0x39faf2);return _0x43ce51;};AGIVertices[_0x8c78('0x14')][_0x8c78('0xa5')]=function(_0x346ee3){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x346ee3[_0x8c78('0x39')]));return this[_0x8c78('0xf')]['noop'](_0x346ee3['output']||_0x346ee3[_0x8c78('0x39')]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x163')]=function(_0x4180e2){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4180e2[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x4180e2['findBy'])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x4180e2,_0x8c78('0x15b'));}logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x156'),this['channel'][_0x8c78('0x3c')],_0x4180e2[_0x8c78('0x155')]));var _0x255b33=this[_0x8c78('0x50')][_0x8c78('0x72')](this,_0x4180e2['pause_id']);var _0x5c66cb=this[_0x8c78('0x52')][_0x8c78('0x72')](this,_0x4180e2[_0x8c78('0x155')],_0x255b33);if(_0x5c66cb){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this['channel'][_0x8c78('0x3c')],_0x4180e2[_0x8c78('0x155')]));this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x4180e2[_0x8c78('0x155')]));return{'code':0xc8,'result':_0x8c78('0x158')};}else{logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x159'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x4180e2[_0x8c78('0x155')]));this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this[_0x8c78('0xf')]['callerid'],_0x4180e2['findBy']));return{'code':0xc8,'result':_0x8c78('0x15c')};}};AGIVertices['prototype'][_0x8c78('0x164')]=function(_0x3fe822){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x165'),_0x3fe822[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x3fe822[_0x8c78('0x10d')])){return this[_0x8c78('0xf')]['error'](_0x3fe822,'no\x20file\x20audio\x20selected');}var _0x46fd03=this[_0x8c78('0x10e')]['sync'](this,_0x3fe822['file_id']);if(!_0x46fd03){return this['channel']['error'](_0x3fe822,_0x8c78('0x10f'));}var _0xcd63f=this[_0x8c78('0xf')][_0x8c78('0x59')](_0x8c78('0x166'),[_0x46fd03,_0x3fe822[_0x8c78('0xde')]]);if(_0xcd63f[_0x8c78('0xa8')]===-0x1){return _0xcd63f;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xbe'),_0x8c78('0x166'),_0x46fd03));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x167')]=function(_0x5f5c78){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x168'),_0x5f5c78[_0x8c78('0x39')]));if(!this['isConfigured'](_0x5f5c78[_0x8c78('0x169')])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x5f5c78,_0x8c78('0x16a'));}var _0x57146e='';var _0x1941f8=parseInt(_0x5f5c78[_0x8c78('0x169')],0xa);if(isNaN(_0x1941f8)){_0x57146e=_0x5f5c78['queue_id'];}else{_0x57146e=this[_0x8c78('0x15')][_0x8c78('0x72')](this,_0x5f5c78[_0x8c78('0x169')]);if(!_0x57146e){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x5f5c78,'no\x20queue\x20found');}}var _0x2361eb='';if(this['isConfigured'](_0x5f5c78[_0x8c78('0x10d')])){var _0x29053e=this['getSound']['sync'](this,_0x5f5c78[_0x8c78('0x10d')]);if(_0x29053e){_0x2361eb=_0x29053e;}}this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x5f5c78,_0x57146e);if(_0x5f5c78['opts'][_0x8c78('0x16b')]('x')<0x0){_0x5f5c78[_0x8c78('0xde')]+='x';}if(_0x5f5c78['opts'][_0x8c78('0x16b')]('X')<0x0){_0x5f5c78[_0x8c78('0xde')]+='X';}this[_0x8c78('0xf')][_0x8c78('0xd5')](_0x8c78('0x16c'),_0x57146e?_0x57146e['toLowerCase']():'');var _0x267abe=this[_0x8c78('0xf')]['exec'](_0x8c78('0x16d'),[_0x57146e,_0x5f5c78[_0x8c78('0xde')],_0x5f5c78[_0x8c78('0x65')],_0x2361eb,_0x5f5c78[_0x8c78('0x67')],_0x5f5c78[_0x8c78('0x7')],_0x5f5c78[_0x8c78('0x16e')],_0x5f5c78[_0x8c78('0x16f')],'',_0x5f5c78[_0x8c78('0x170')]]);if(_0x267abe[_0x8c78('0xa8')]===-0x1){return _0x267abe;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0xbe'),_0x8c78('0x16d'),_0x57146e));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x171')]=function(_0x2e202f){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2e202f[_0x8c78('0x39')]));var _0x4a270f=_0x2e202f['recordingFormat']||_0x8c78('0x12e');var _0x1dee0b=util[_0x8c78('0x2c')](_0x8c78('0x172'),this[_0x8c78('0xf')][_0x8c78('0x3d')],rs[_0x8c78('0x117')](0x5));var _0x343765=util[_0x8c78('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x1dee0b,_0x4a270f);var _0x37f54d=util[_0x8c78('0x2c')]('%s/recordings/%s',FILES_PATH,_0x1dee0b);this[_0x8c78('0x173')][_0x8c78('0x72')](this,_0x2e202f,_0x1dee0b,_0x343765);this[_0x8c78('0xf')][_0x8c78('0xd5')](_0x8c78('0x174'),_0x1dee0b);logger[_0x8c78('0x32')](_0x8c78('0x175'),_0x37f54d,_0x4a270f,_0x2e202f['escape_digits'],_0x2e202f['timeout']);return this[_0x8c78('0xf')]['recordFile'](_0x37f54d,_0x4a270f,_0x2e202f[_0x8c78('0x176')],_0x2e202f[_0x8c78('0x67')],undefined,!![]);};AGIVertices[_0x8c78('0x14')]['restapi']=function(_0xdb8d6b){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x177'),_0xdb8d6b[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0xdb8d6b[_0x8c78('0x65')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0x178'));}var _0x3ae2d4=this[_0x8c78('0x179')][_0x8c78('0x72')](this,_0xdb8d6b);logger[_0x8c78('0x32')](util['format'](_0x8c78('0x17a'),util[_0x8c78('0x17b')](_0x3ae2d4,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0xdb8d6b[_0x8c78('0xd2')])){return this['channel'][_0x8c78('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x298655=this[_0x8c78('0x11')][_0x8c78('0x72')](this,_0xdb8d6b[_0x8c78('0xd2')]);if(!_0x298655){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0xdb8d6b,_0x8c78('0x115'));}this[_0x8c78('0xf')][_0x8c78('0xd5')](util[_0x8c78('0x2c')](_0x8c78('0x17c'),_0x298655),_0x3ae2d4[_0x8c78('0x77')]?_0x3ae2d4[_0x8c78('0x77')]:'200');this[_0x8c78('0xf')][_0x8c78('0xd5')](util[_0x8c78('0x2c')]('%s_STATUS_MESSAGE',_0x298655),_0x3ae2d4[_0x8c78('0x17d')]?_0x3ae2d4['statusMessage']:'OK');if(_0x3ae2d4[_0x8c78('0x6d')]){try{this[_0x8c78('0x9c')](_0x3ae2d4[_0x8c78('0x6d')],_0x298655);}catch(_0x6c3ce0){logger['error'](util[_0x8c78('0x2c')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x298655));}}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format'](_0x8c78('0xd7'),_0x298655));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x17e')]=function(_0x4b8f0f){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x4b8f0f[_0x8c78('0x39')]));return this[_0x8c78('0xf')][_0x8c78('0x17f')](_0x4b8f0f[_0x8c78('0x180')]['replace'](/\s+/g,''),_0x4b8f0f[_0x8c78('0x176')]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x181')]=function(_0x43a0f8){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x182'),_0x43a0f8['label']));return this[_0x8c78('0xf')][_0x8c78('0x183')](_0x43a0f8[_0x8c78('0x68')][_0x8c78('0x5b')](/\s+/g,''),_0x43a0f8[_0x8c78('0x176')]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x184')]=function(_0x56d486){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x56d486[_0x8c78('0x39')]));return this[_0x8c78('0xf')][_0x8c78('0x185')](_0x56d486[_0x8c78('0x5d')],_0x56d486[_0x8c78('0x176')]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x186')]=function(_0x209119){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x187'),_0x209119[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x209119[_0x8c78('0x188')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0x189'));}var _0x13dde9=this[_0x8c78('0x23')][_0x8c78('0x72')](this,_0x209119[_0x8c78('0x188')]);if(!_0x13dde9||!_0x13dde9['Smtp']){return this[_0x8c78('0xf')]['error'](_0x209119,'no\x20mail\x20account\x20found');}var _0x2964c4={'from':util[_0x8c78('0x2c')](_0x8c78('0x18a'),_0x13dde9[_0x8c78('0x18')],_0x13dde9[_0x8c78('0x18b')]||_0x13dde9[_0x8c78('0x18c')][_0x8c78('0x18d')]),'to':_0x209119['to']||'','cc':_0x209119['cc']||'','bcc':_0x209119[_0x8c78('0x18e')]||'','subject':_0x209119[_0x8c78('0x18f')],'html':_0x209119[_0x8c78('0x5d')],'text':_0x209119[_0x8c78('0x5d')]};if(this[_0x8c78('0x86')](_0x209119[_0x8c78('0x190')])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x2964c4));this['createSquareDetailsReport'][_0x8c78('0x72')](this,_0x209119,_0x209119['account_id']);this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x191'),_0x13dde9[_0x8c78('0x18')]));this[_0x8c78('0x25')][_0x8c78('0x72')](this,_0x13dde9[_0x8c78('0x192')],_0x2964c4);return this[_0x8c78('0xf')][_0x8c78('0xa5')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x8c78('0x193')]=function(_0x4e3f32){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x194'),_0x4e3f32[_0x8c78('0x39')]));return this['channel'][_0x8c78('0xa5')](_0x8c78('0x195'));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x196')]=function(_0x2f3384){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x197'),_0x2f3384[_0x8c78('0x39')]));if(!this['isConfigured'](_0x2f3384[_0x8c78('0x198')])){return this[_0x8c78('0xf')]['noop']('no\x20sms\x20account\x20configured');}var _0x4e9d96=this[_0x8c78('0x36')][_0x8c78('0x72')](this,_0x2f3384[_0x8c78('0x198')]);if(!_0x4e9d96){return this[_0x8c78('0xf')]['error'](_0x2f3384,_0x8c78('0x199'));}var _0x95b2af={'body':_0x2f3384[_0x8c78('0x19a')],'phone':_0x2f3384['to']||'','SmsAccountId':_0x4e9d96['id']};logger['debug'](_0x8c78('0x19b'),JSON[_0x8c78('0x75')](_0x95b2af));this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x2f3384,_0x2f3384[_0x8c78('0x198')]);this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x19c'),_0x4e9d96[_0x8c78('0x18')]));this[_0x8c78('0x19d')][_0x8c78('0x72')](this,_0x95b2af);return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0x19e'));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x19f')]=function(_0x144926){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x1a0'),_0x144926['label']));if(!this['isConfigured'](_0x144926[_0x8c78('0xd2')])){return this['channel'][_0x8c78('0x2f')](_0x144926,_0x8c78('0x1a1'));}var _0xd5da63=this[_0x8c78('0x11')][_0x8c78('0x72')](this,_0x144926[_0x8c78('0xd2')]);if(!_0xd5da63){return this[_0x8c78('0xf')]['error'](_0x144926,'no\x20variable\x20found');}return this[_0x8c78('0xf')][_0x8c78('0xd5')](_0xd5da63,_0x144926[_0x8c78('0x1a2')]);};AGIVertices[_0x8c78('0x14')][_0x8c78('0x1a3')]=function(_0x1abff1){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x1a4'),_0x1abff1[_0x8c78('0x39')]));this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0x1a5'));if(_0x1abff1['answer']===_0x8c78('0x1a6')){this['channel']['noop'](_0x8c78('0x1a7'));return this[_0x8c78('0xf')]['answer']();}return this[_0x8c78('0xf')][_0x8c78('0xa5')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x8c78('0x1a8')]=function(_0x54aaff){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x1a9'),_0x54aaff[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x54aaff[_0x8c78('0x1aa')])){return this['channel'][_0x8c78('0x2f')](_0x54aaff,_0x8c78('0x1ab'));}var _0x4fd7e4=this[_0x8c78('0x1ac')][_0x8c78('0x72')](this,_0x54aaff[_0x8c78('0x1aa')]);if(!this[_0x8c78('0x86')](_0x4fd7e4)){return this['channel']['error'](_0x54aaff,util[_0x8c78('0x2c')](_0x8c78('0x1ad'),_0x54aaff[_0x8c78('0x1aa')]));}if(_0x4fd7e4===this[_0x8c78('0xf')]['arg_1']){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x54aaff,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x54aaff,_0x4fd7e4);var _0x487fec=this['channel'][_0x8c78('0x59')](_0x8c78('0x1ae'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x8c78('0x1af')]||_0x8c78('0x1b0'),_0x4fd7e4,this['channel'][_0x8c78('0x3b')]));if(_0x487fec[_0x8c78('0xa8')]===-0x1){return _0x487fec;}return this[_0x8c78('0xf')]['noop'](util[_0x8c78('0x2c')](_0x8c78('0xbe'),'AGI',_0x4fd7e4));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x1b1')]=function(_0x169062){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x1b2'),_0x169062[_0x8c78('0x39')]));var _0x4b8a74=this[_0x8c78('0x1b3')][_0x8c78('0x72')](this,_0x169062[_0x8c78('0xb3')]);this[_0x8c78('0x38')][_0x8c78('0x72')](this,_0x169062,_0x169062['command']);if(this[_0x8c78('0x86')](_0x169062[_0x8c78('0xd2')])){var _0x59abf8=this[_0x8c78('0x11')][_0x8c78('0x72')](this,_0x169062['variable_id']);if(_0x59abf8){this['channel'][_0x8c78('0xd5')](_0x59abf8,_0x4b8a74);return this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x169062[_0x8c78('0xb3')],_0x59abf8));}}return this[_0x8c78('0xf')]['noop'](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x169062[_0x8c78('0xb3')]));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x1b4')]=function(_0x3446ae){logger[_0x8c78('0x32')](util['format'](_0x8c78('0x1b5'),_0x3446ae['label']));_0x3446ae[_0x8c78('0x5d')]=_0x3446ae[_0x8c78('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8c78('0x86')](_0x3446ae[_0x8c78('0x1b6')])){return this['channel'][_0x8c78('0xa5')]('no\x20apiKey\x20configured');}if(!this[_0x8c78('0x86')](_0x3446ae[_0x8c78('0x5d')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')]('no\x20text\x20configured');}this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x3446ae['text']));var _0x459e27=this['googleCloudTTS']['sync'](this,_0x3446ae);if(_0x459e27){this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x1b7'),_0x459e27));var _0x3c636e=this[_0x8c78('0xf')][_0x8c78('0xfe')](_0x459e27);try{fs[_0x8c78('0x123')](_0x459e27+_0x8c78('0xff'));}catch(_0x2fe00f){logger['error'](_0x2fe00f);}return _0x3c636e;}return this['channel'][_0x8c78('0x2f')](_0x3446ae,_0x8c78('0x1b8'));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x1b9')]=function(_0xd2c075){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x1ba'),_0xd2c075[_0x8c78('0x39')]));_0xd2c075[_0x8c78('0x5d')]=_0xd2c075[_0x8c78('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8c78('0x86')](_0xd2c075[_0x8c78('0x5d')])){return this[_0x8c78('0xf')][_0x8c78('0xa5')](_0x8c78('0xa6'));}this['channel'][_0x8c78('0xa5')](util['format'](_0x8c78('0x1bb'),_0xd2c075['text']));var _0x1a701e=this['googleTTS'][_0x8c78('0x72')](this,_0xd2c075);if(_0x1a701e){this['channel'][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x1bc'),_0x1a701e));var _0x283928=this['channel']['streamFile'](_0x1a701e);try{fs['unlink'](_0x1a701e+_0x8c78('0xff'));}catch(_0x5b2066){logger['error'](_0x5b2066);}return _0x283928;}return this['channel'][_0x8c78('0x2f')](_0xd2c075,_0x8c78('0x1bd'));};AGIVertices['prototype'][_0x8c78('0x1be')]=function(_0x44b92a){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x1bf'),_0x44b92a[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x44b92a[_0x8c78('0x155')])){return this['channel'][_0x8c78('0x2f')](_0x44b92a,_0x8c78('0x15b'));}logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x156'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x44b92a['findBy']));var _0x322da4=this[_0x8c78('0x1c0')][_0x8c78('0x72')](this,_0x44b92a[_0x8c78('0x155')]);if(_0x322da4){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x44b92a[_0x8c78('0x155')]));this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x157'),this[_0x8c78('0xf')][_0x8c78('0x3c')],_0x44b92a[_0x8c78('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8c78('0x32')](util[_0x8c78('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8c78('0xf')]['callerid'],_0x44b92a[_0x8c78('0x155')]));this[_0x8c78('0xf')][_0x8c78('0xa5')](util[_0x8c78('0x2c')](_0x8c78('0x159'),this[_0x8c78('0xf')]['callerid'],_0x44b92a[_0x8c78('0x155')]));return{'code':0xc8,'result':_0x8c78('0x15c')};}};AGIVertices[_0x8c78('0x14')]['voicemail']=function(_0x5729f2){logger[_0x8c78('0x32')](util[_0x8c78('0x2c')](_0x8c78('0x1c1'),_0x5729f2[_0x8c78('0x39')]));var _0x3d6178=this['channel']['exec'](_0x8c78('0x1c2'),[_0x5729f2[_0x8c78('0x1c3')],_0x5729f2[_0x8c78('0x79')]]);if(_0x3d6178[_0x8c78('0xa8')]===-0x1){return _0x3d6178;}return this[_0x8c78('0xf')][_0x8c78('0xa5')](util['format'](_0x8c78('0xbe'),'VOICEMAIL',_0x5729f2[_0x8c78('0x1c3')]));};AGIVertices[_0x8c78('0x14')][_0x8c78('0x1c4')]=function(_0x3e1ba8){logger['info'](util[_0x8c78('0x2c')](_0x8c78('0x1c5'),_0x3e1ba8[_0x8c78('0x39')]));if(!this[_0x8c78('0x86')](_0x3e1ba8['variable_id'])){return this[_0x8c78('0xf')][_0x8c78('0x2f')](_0x3e1ba8,_0x8c78('0x1a1'));}var _0x4ab5bc=this[_0x8c78('0x11')][_0x8c78('0x72')](this,_0x3e1ba8[_0x8c78('0xd2')]);if(!_0x4ab5bc){return this[_0x8c78('0xf')]['error'](_0x3e1ba8,'no\x20variable\x20found');}var _0x3d5326=this['channel']['getVariable'](_0x4ab5bc);return{'code':0xc8,'result':_0x3d5326[_0x8c78('0xa0')]?_0x3d5326['extra']:'-'};};String['prototype']['replaceAll']=function(_0x221634,_0x1a85b3){return this[_0x8c78('0x1c6')](_0x221634)[_0x8c78('0x1c7')](_0x1a85b3);};module[_0x8c78('0x1c8')]=AGIVertices; \ No newline at end of file +var _0xe6d7=['getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','getIntervals','IntervalId','map','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','arg_1','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','error','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','url','method','timeout','POST','PUT','body','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','parse','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_bot_name','googleASR','tildeASR','appid','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','getAndSetVariable','result','extra','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','scheduledAt','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','query:\x20%s','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','no\x20file\x20audio\x20found','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','recordingFormat','%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','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','exports','lodash','odbc','randomstring','moment','mustache','../../config/logger','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc'];(function(_0x1f02bc,_0x4cdada){var _0x378387=function(_0x1e89c5){while(--_0x1e89c5){_0x1f02bc['push'](_0x1f02bc['shift']());}};_0x378387(++_0x4cdada);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x4ec328,_0x31e00c){_0x4ec328=_0x4ec328-0x0;var _0x565272=_0xe6d7[_0x4ec328];return _0x565272;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x7e6d('0x0'));var sh=require('shelljs');var odbc=require(_0x7e6d('0x1'))();var rs=require(_0x7e6d('0x2'));var moment=require(_0x7e6d('0x3'));var Mustache=require(_0x7e6d('0x4'));var rp=require('request-promise');var logger=require(_0x7e6d('0x5'))('agi');var config=require('../../config/environment');var shared=require(_0x7e6d('0x6'));var scripts=require(_0x7e6d('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x7e6d('0x8'),_0x7e6d('0x9')];var verticesWithRetry=[_0x7e6d('0xa'),_0x7e6d('0xb'),_0x7e6d('0xc')];var AGIVertices=function(_0x285e8e,_0x215c69,_0x2ffe91){this[_0x7e6d('0xd')]=_0x285e8e;this[_0x7e6d('0xe')]=_0x215c69;this['mailRpc']=_0x2ffe91;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x10')]=function(_0x2baeba,_0x28f390){this['rpc'][_0x7e6d('0x11')](_0x2baeba)[_0x7e6d('0x12')](function(_0x5bc7b5){_0x28f390(null,_0x5bc7b5?_0x5bc7b5[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x39fc7d){_0x28f390(_0x39fc7d);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x15')]=function(_0x2bab2e,_0x38c3e4){this[_0x7e6d('0xe')][_0x7e6d('0x16')](_0x2bab2e)[_0x7e6d('0x12')](function(_0x5cad83){_0x38c3e4(null,_0x5cad83?_0x5cad83['name']:![]);})[_0x7e6d('0x14')](function(_0x265a56){_0x38c3e4(_0x265a56);});};AGIVertices['prototype'][_0x7e6d('0x17')]=function(_0x52596b,_0x169144){this[_0x7e6d('0xe')][_0x7e6d('0x18')](_0x52596b)[_0x7e6d('0x12')](function(_0x5b154b){_0x169144(null,_0x5b154b?_0x5b154b[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x534e9d){_0x169144(_0x534e9d);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x19')]=function(_0x3d3d1b,_0x287b1d){this['rpc'][_0x7e6d('0x1a')](_0x3d3d1b)[_0x7e6d('0x12')](function(_0x21dd03){_0x287b1d(null,_0x21dd03?_0x21dd03['dsn']:![]);})[_0x7e6d('0x14')](function(_0x42a000){_0x287b1d(_0x42a000);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1b')]=function(_0x554768,_0x18168e){this[_0x7e6d('0xe')][_0x7e6d('0x1c')](_0x554768)['then'](function(_0x1ce7bb){_0x18168e(null,_0x1ce7bb?_0x1ce7bb[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x188739){_0x18168e(_0x188739);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1d')]=function(_0x3edbef,_0x2a7cca){this[_0x7e6d('0xe')][_0x7e6d('0x1e')](_0x3edbef)[_0x7e6d('0x12')](function(_0x20dfe2){_0x2a7cca(null,_0x20dfe2?_0x20dfe2[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x1004f4){_0x2a7cca(_0x1004f4);});};AGIVertices[_0x7e6d('0xf')]['getSound']=function(_0x5a23ab,_0x477394){var _0x31977d=this;this['rpc'][_0x7e6d('0x1f')](_0x5a23ab)[_0x7e6d('0x12')](function(_0x19933d){_0x477394(null,_0x19933d?_0x31977d[_0x7e6d('0x20')](_0x19933d['save_name']):![]);})[_0x7e6d('0x14')](function(_0x8602fb){_0x477394(_0x8602fb);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x21')]=function(_0x113d27,_0x31f642){this[_0x7e6d('0xe')][_0x7e6d('0x22')](_0x113d27)[_0x7e6d('0x12')](function(_0x5b79ea){_0x31f642(null,_0x5b79ea?_0x5b79ea:![]);})['catch'](function(_0x2f8fb6){_0x31f642(_0x2f8fb6);});};AGIVertices[_0x7e6d('0xf')]['sendMailMessage']=function(_0x56599c,_0x2acac9,_0x3ac54d){this['mailRpc']['sendMailMessage'](_0x56599c,_0x2acac9)['then'](function(){_0x3ac54d(null);})[_0x7e6d('0x14')](function(_0x297439){_0x3ac54d(_0x297439);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x23')]=function(_0x16ccc5,_0xbadd1f){this['rpc']['getIntervalById'](_0x16ccc5)[_0x7e6d('0x12')](function(_0x3f9e52){if(_0x3f9e52){if(_0x3f9e52[_0x7e6d('0x24')]){_0xbadd1f(null,[_0x3f9e52['interval']]);}else{_0xbadd1f(null,_[_0x7e6d('0x25')](_0x3f9e52['Intervals'],_0x7e6d('0x26')));}}else{_0xbadd1f(null,![]);}})[_0x7e6d('0x14')](function(_0x3c3e59){_0xbadd1f(_0x3c3e59);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x20')]=function(_0x338f68){return util[_0x7e6d('0x27')](_0x7e6d('0x28'),FILES_PATH,_0x338f68);};AGIVertices['prototype'][_0x7e6d('0x29')]=function(_0x386e01,_0x145f53,_0x2597a7){odbc[_0x7e6d('0x2a')](_0x386e01,function(_0x15abd3){if(_0x15abd3){logger['error'](_0x7e6d('0x2b'),_0x15abd3);_0x2597a7(_0x15abd3);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x145f53,function(_0x539143,_0x113b8d){if(_0x539143){logger[_0x7e6d('0x2c')](_0x7e6d('0x2d'),_0x145f53);_0x2597a7(_0x539143);}else{logger['info'](_0x7e6d('0x2e'),_0x145f53);odbc[_0x7e6d('0x2f')](function(_0x4a49a3){if(_0x4a49a3){logger['error'](_0x7e6d('0x30'),_0x4a49a3);}_0x2597a7(null,_0x113b8d);});}});}});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x31')]=function(_0x21e47a,_0x25beea){this[_0x7e6d('0xe')]['getSmsAccountById'](_0x21e47a)['then'](function(_0x38ea0c){_0x25beea(null,_0x38ea0c?_0x38ea0c:![]);})[_0x7e6d('0x14')](function(_0x18fb13){_0x25beea(_0x18fb13);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x32')]=function(_0x3d9122,_0x4c5fab){this['rpc'][_0x7e6d('0x32')](_0x3d9122)[_0x7e6d('0x12')](function(_0x4d6953){_0x4c5fab(null,_0x4d6953);})['catch'](function(_0x3d2b89){_0x4c5fab(_0x3d2b89);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x33')]=function(_0x126f10,_0x202d00,_0x852eeb){this[_0x7e6d('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x7e6d('0xd')]['uniqueid'],'node':_0x126f10[_0x7e6d('0x34')],'application':_0x126f10[_0x7e6d('0x35')],'data':_0x202d00||null,'project_name':this[_0x7e6d('0xd')]['arg_1'],'callerid':this[_0x7e6d('0xd')][_0x7e6d('0x36')]})[_0x7e6d('0x12')](function(_0xb3157e){if(_0x852eeb){_0x852eeb(null,_0xb3157e);}})[_0x7e6d('0x14')](function(_0x5c30e1){if(_0x852eeb){_0x852eeb(_0x5c30e1);}});};AGIVertices[_0x7e6d('0xf')]['createSquareRecording']=function(_0x5a65d9,_0x1fd849,_0x5dadea,_0x135470){this['rpc'][_0x7e6d('0x37')]({'uniqueid':this[_0x7e6d('0xd')]['uniqueid'],'callerid':this['channel'][_0x7e6d('0x36')],'calleridname':this['channel'][_0x7e6d('0x38')],'context':this[_0x7e6d('0xd')][_0x7e6d('0x39')],'extension':this['channel'][_0x7e6d('0x3a')],'priority':this[_0x7e6d('0xd')]['priority'],'accountcode':this[_0x7e6d('0xd')][_0x7e6d('0x3b')],'dnid':this[_0x7e6d('0xd')][_0x7e6d('0x3c')],'projectName':this[_0x7e6d('0xd')][_0x7e6d('0x3d')],'saveName':_0x1fd849,'filename':_0x5a65d9['file']||_0x1fd849,'savePath':_0x5dadea})[_0x7e6d('0x12')](function(_0x189d7a){_0x135470(null,_0x189d7a);})[_0x7e6d('0x14')](function(_0x1e9d5b){_0x135470(_0x1e9d5b);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3f84f0,_0x118edf,_0x2f60cb,_0x577823,_0x375f78){this[_0x7e6d('0xe')][_0x7e6d('0x3e')]({'uniqueid':this['channel'][_0x7e6d('0x3f')],'body':_0x3f84f0,'direction':_0x118edf,'providerName':_0x2f60cb,'providerResponse':_0x577823})['then'](function(_0x5de709){if(_0x375f78){_0x375f78(null,_0x5de709);}})[_0x7e6d('0x14')](function(_0xcf1c5f){if(_0x375f78){_0x375f78(_0xcf1c5f);}});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x40')]=function(_0x64f4ab,_0x396d3b){this['rpc'][_0x7e6d('0x40')]({'firstName':_[_0x7e6d('0x41')](_0x64f4ab[_0x7e6d('0x13')])||_[_0x7e6d('0x42')](_0x64f4ab['name'])?_0x7e6d('0x43')+Math[_0x7e6d('0x44')]():_0x64f4ab[_0x7e6d('0x13')],'lastName':_[_0x7e6d('0x41')](_0x64f4ab[_0x7e6d('0x45')])||_[_0x7e6d('0x42')](_0x64f4ab['lastName'])?null:_0x64f4ab[_0x7e6d('0x45')],'phone':_0x64f4ab[_0x7e6d('0x46')],'ListId':_0x64f4ab[_0x7e6d('0x47')],'scheduledat':_0x64f4ab['scheduledAt'],'callbackUniqueid':this[_0x7e6d('0xd')][_0x7e6d('0x3f')],'tags':_0x7e6d('0x48'),'description':_0x7e6d('0x49')+_0x64f4ab['scheduledAt'][_0x7e6d('0x4a')](),'priority':_0x64f4ab[_0x7e6d('0x4b')]})['then'](function(_0x249a61){_0x396d3b(null,_0x249a61);})[_0x7e6d('0x14')](function(_0x2522b9){_0x396d3b(_0x2522b9);});};AGIVertices['prototype'][_0x7e6d('0x4c')]=function(_0x1b4a0a,_0x2db212){this['rpc'][_0x7e6d('0x4d')](_0x1b4a0a)[_0x7e6d('0x12')](function(_0x56f4b4){_0x2db212(null,_0x56f4b4?_0x56f4b4[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x18632c){_0x2db212(_0x18632c);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x4e')]=function(_0xb71d53,_0x22dae4,_0x32b15a){var _0x1fb1dd={'role':_0x7e6d('0x4f')};_0x1fb1dd[_0xb71d53]=this['channel'][_0x7e6d('0x36')];this[_0x7e6d('0xe')][_0x7e6d('0x4e')](_0x1fb1dd,_0x22dae4,this['channel'][_0x7e6d('0x3f')])[_0x7e6d('0x12')](function(_0x5cad18){_0x32b15a(null,_[_0x7e6d('0x42')](_0x5cad18)?![]:!![]);})[_0x7e6d('0x14')](function(_0x3c0f3a){logger[_0x7e6d('0x50')](_0x3c0f3a);_0x32b15a(null,![]);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x51')]=function(_0x49103f,_0xdae377){var _0x4b4b8c={'role':_0x7e6d('0x4f')};_0x4b4b8c[_0x49103f]=this[_0x7e6d('0xd')][_0x7e6d('0x36')];this[_0x7e6d('0xe')]['agentUnpause'](_0x4b4b8c)[_0x7e6d('0x12')](function(_0x2e576a){_0xdae377(null,_[_0x7e6d('0x42')](_0x2e576a)?![]:!![]);})['catch'](function(_0x1d159d){logger['error'](_0x1d159d);_0xdae377(null,![]);});};AGIVertices['prototype'][_0x7e6d('0x52')]=function(_0xb22d8c,_0x4ad6e2){var _0x266a0f={'role':_0x7e6d('0x4f')};_0x266a0f[_0xb22d8c]=this[_0x7e6d('0xd')][_0x7e6d('0x36')];this[_0x7e6d('0xe')][_0x7e6d('0x52')](_0x266a0f)[_0x7e6d('0x12')](function(_0x3843c9){_0x4ad6e2(null,_[_0x7e6d('0x42')](_0x3843c9)?![]:!![]);})[_0x7e6d('0x14')](function(_0x4313ae){logger[_0x7e6d('0x50')](_0x4313ae);_0x4ad6e2(null,![]);});};AGIVertices[_0x7e6d('0xf')]['agentLogin']=function(_0x1e65f6,_0x12891f){var _0x5c81bf={'role':_0x7e6d('0x4f')};_0x5c81bf[_0x1e65f6]=this[_0x7e6d('0xd')]['callerid'];var _0x1d0406=_0x1e65f6!=_0x7e6d('0x53')?util['format'](_0x7e6d('0x54'),_0x7e6d('0x55'),this['channel']['callerid']):undefined;this[_0x7e6d('0xe')][_0x7e6d('0x56')](_0x5c81bf,_0x1d0406)[_0x7e6d('0x12')](function(_0x5db9e0){_0x12891f(null,_['isNil'](_0x5db9e0)?![]:!![]);})[_0x7e6d('0x14')](function(_0x27ac69){logger[_0x7e6d('0x50')](_0x27ac69);_0x12891f(null,![]);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x57')]=function(_0x4c36b8,_0x1a3640){sh[_0x7e6d('0x58')](_[_0x7e6d('0x59')](_0x4c36b8),function(_0x36be81,_0x449139){var _0x176880=_0x449139[_0x7e6d('0x5a')](/(\r\n|\n|\r)/gm,'');_0x1a3640(null,_0x176880);});};AGIVertices[_0x7e6d('0xf')]['googleCloudTTS']=function(_0xf235e0,_0x3e33ff){scripts[_0x7e6d('0x5b')](_0xf235e0['apiKey'],_0xf235e0['google_cloud_tts_text_type']||_0x7e6d('0x5c'),_0xf235e0[_0x7e6d('0x5c')],_0xf235e0[_0x7e6d('0x5d')]||_0x7e6d('0x5e'),_0xf235e0[_0x7e6d('0x5f')]||'MALE',_0xf235e0[_0x7e6d('0x60')]||_0x7e6d('0x61'))['then'](function(_0x26d979){_0x3e33ff(null,_0x26d979);})[_0x7e6d('0x14')](function(_0x3e4443){_0x3e33ff(_0x3e4443);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x62')]=function(_0x360203,_0x19d44a){scripts['googleTTS'](_0x360203[_0x7e6d('0x5c')],_0x360203['google_tts_language']||'en',0x1)[_0x7e6d('0x12')](function(_0xfbfd2e){_0x19d44a(null,_0xfbfd2e);})['catch'](function(_0x48dbbc){_0x19d44a(_0x48dbbc);});};AGIVertices[_0x7e6d('0xf')]['restAPI']=function(_0x42f968,_0x55103f){var _0x410715={'uri':_0x42f968[_0x7e6d('0x63')],'method':_0x42f968[_0x7e6d('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x42f968['timeout'])==='number'&&parseInt(_0x42f968[_0x7e6d('0x65')])>=0x1?parseInt(_0x42f968[_0x7e6d('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x7e6d('0x66'),_0x7e6d('0x67')],_0x410715[_0x7e6d('0x64')]['toUpperCase']())){try{_0x410715[_0x7e6d('0x68')]=_0x42f968[_0x7e6d('0x9')]?JSON['parse'](_0x42f968[_0x7e6d('0x9')]):{};}catch(_0x57b698){logger[_0x7e6d('0x50')](_0x7e6d('0x69'),_0x57b698);}}try{_0x410715[_0x7e6d('0x6a')]=_0x42f968[_0x7e6d('0x8')]?JSON['parse'](_0x42f968[_0x7e6d('0x8')]):{};}catch(_0x3b0597){logger[_0x7e6d('0x50')](_0x7e6d('0x6b'),_0x3b0597);}if(_0x42f968['computedVariables']){try{var _0x127149=require(_0x42f968[_0x7e6d('0x6c')])[_0x7e6d('0x6d')](this,_0x410715);_0x410715[_0x7e6d('0x6e')]=Mustache['render'](_0x42f968[_0x7e6d('0x63')],_0x127149,{},['$$','$$']);if(_0x410715[_0x7e6d('0x6a')]){_0x410715[_0x7e6d('0x6a')]=JSON[_0x7e6d('0x6f')](Mustache[_0x7e6d('0x70')](JSON['stringify'](_0x410715[_0x7e6d('0x6a')]),_0x127149,{},['$$','$$']));}if(_0x410715[_0x7e6d('0x68')]){_0x410715['body']=JSON[_0x7e6d('0x6f')](Mustache['render'](JSON[_0x7e6d('0x71')](_0x410715['body']),_0x127149,{},['$$','$$']));}}catch(_0x3d22e1){logger[_0x7e6d('0x50')](_0x7e6d('0x72'),_0x3d22e1);}}rp(_0x410715)[_0x7e6d('0x12')](function(_0x33f2ed){var _0x4843be={'statusCode':_0x33f2ed[_0x7e6d('0x73')]||0xc8,'statusMessage':_0x33f2ed[_0x7e6d('0x74')]||'OK','headers':_0x33f2ed[_0x7e6d('0x6a')]||{},'body':_0x33f2ed[_0x7e6d('0x68')]||{}};_0x55103f(null,_0x4843be);})[_0x7e6d('0x14')](function(_0x314e81){var _0x3613c7={'statusCode':_0x314e81[_0x7e6d('0x73')]||0x1f4,'statusMessage':_0x314e81['message']||_0x7e6d('0x75'),'headers':_0x314e81[_0x7e6d('0x76')][_0x7e6d('0x6a')]||{},'body':_0x314e81['options']['body']||{}};_0x55103f(null,_0x3613c7);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x77')]=function(_0x2b5c64,_0x691a59){scripts[_0x7e6d('0x77')](this['channel'][_0x7e6d('0x3f')],_0x2b5c64[_0x7e6d('0x78')],_0x2b5c64['text'],_0x2b5c64[_0x7e6d('0x79')]||'en')[_0x7e6d('0x12')](function(_0x579dc9){_0x691a59(null,_0x579dc9);})[_0x7e6d('0x14')](function(_0x29e7b2){_0x691a59(_0x29e7b2);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x7a')]=function(_0x33eccf,_0x4be346){scripts[_0x7e6d('0x7a')](this[_0x7e6d('0xd')][_0x7e6d('0x3f')],_0x33eccf['dialogflowV2_project_id'],_0x33eccf['client_email'],_0x33eccf[_0x7e6d('0x7b')],_0x33eccf[_0x7e6d('0x5c')],_0x33eccf[_0x7e6d('0x7c')]||'en')['then'](function(_0x6cd645){_0x4be346(null,_0x6cd645);})[_0x7e6d('0x14')](function(_0x312fde){_0x4be346(_0x312fde);});};AGIVertices['prototype']['sestekNDA']=function(_0x462b8b,_0x42d17d){scripts['sestekNDA'](this['channel'],_0x462b8b)[_0x7e6d('0x12')](function(_0x3fc4f5){_0x42d17d(null,_0x3fc4f5);})[_0x7e6d('0x14')](function(_0x45ff7f){_0x42d17d(_0x45ff7f);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x7d')]=function(_0x1a5461,_0x441cb1){scripts[_0x7e6d('0x7d')](_0x1a5461[_0x7e6d('0x78')],_0x1a5461[_0x7e6d('0x5c')],_0x1a5461[_0x7e6d('0x7e')]||_0x7e6d('0x5e'),_0x1a5461[_0x7e6d('0x7f')])[_0x7e6d('0x12')](function(_0x5fd26a){_0x441cb1(null,_0x5fd26a);})[_0x7e6d('0x14')](function(_0xe192c){_0x441cb1(_0xe192c);});};AGIVertices['prototype'][_0x7e6d('0x80')]=function(_0x27e5fc,_0x22722e,_0x35e3d0){scripts[_0x7e6d('0x80')](_0x22722e,_0x27e5fc[_0x7e6d('0x78')],_0x27e5fc[_0x7e6d('0x81')]||'en-US',this[_0x7e6d('0x82')](_0x27e5fc['model'])?_0x27e5fc[_0x7e6d('0x83')]:undefined)['then'](function(_0x4929d8){_0x35e3d0(null,_0x4929d8);})[_0x7e6d('0x14')](function(_0x55831e){_0x35e3d0(_0x55831e);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x84')]=function(_0x261d62,_0x328ded){scripts['awsPolly'](_0x261d62[_0x7e6d('0x85')],_0x261d62[_0x7e6d('0x86')],_0x261d62[_0x7e6d('0x87')],_0x261d62[_0x7e6d('0x88')]||_0x7e6d('0x89'),_0x261d62['text'],_0x261d62['aws_text_type']||_0x7e6d('0x5c'))[_0x7e6d('0x12')](function(_0x2867af){_0x328ded(null,_0x2867af);})[_0x7e6d('0x14')](function(_0x5311b1){_0x328ded(_0x5311b1);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x8a')]=function(_0x8f5496,_0x4c0a2f){scripts[_0x7e6d('0x8a')](this[_0x7e6d('0xd')][_0x7e6d('0x3f')],_0x8f5496[_0x7e6d('0x85')],_0x8f5496[_0x7e6d('0x86')],_0x8f5496['aws_lex_region'],_0x8f5496[_0x7e6d('0x5c')],_0x8f5496[_0x7e6d('0x8b')])[_0x7e6d('0x12')](function(_0x41a9fe){_0x4c0a2f(null,_0x41a9fe);})[_0x7e6d('0x14')](function(_0x5813ee){_0x4c0a2f(_0x5813ee);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x8c')]=function(_0x44af27,_0x36d1f2,_0x3a9b6b){scripts['googleASR'](_0x36d1f2,_0x44af27[_0x7e6d('0x78')],_0x44af27['google_asr_language']||_0x7e6d('0x5e'))[_0x7e6d('0x12')](function(_0x32ecb8){_0x3a9b6b(null,_0x32ecb8);})[_0x7e6d('0x14')](function(_0x4895b4){_0x3a9b6b(_0x4895b4);});};AGIVertices['prototype']['tildeASR']=function(_0x2d7622,_0xcb4e38,_0x270e50){scripts[_0x7e6d('0x8d')](_0xcb4e38,_0x2d7622[_0x7e6d('0x8e')],_0x2d7622['appsecret'],_0x2d7622[_0x7e6d('0x6e')])['then'](function(_0x2aa57d){_0x270e50(null,_0x2aa57d);})[_0x7e6d('0x14')](function(_0x3960a2){_0x270e50(_0x3960a2);});};AGIVertices['prototype'][_0x7e6d('0x8f')]=function(_0xb4102a){var _0xbf5b17=_[_0x7e6d('0x90')](verticesWithRetry,_0xb4102a['agicommand'])?_0xb4102a:_[_0x7e6d('0x91')](_0xb4102a);for(var _0x41d527 in _0xbf5b17){if(_0xbf5b17[_0x7e6d('0x92')](_0x41d527)){if(_0xbf5b17[_0x41d527]&&_['isString'](_0xbf5b17[_0x41d527])){if(_['includes'](recursiveMapAttributes,_0x41d527)){_0xbf5b17[_0x41d527]=this[_0x7e6d('0x93')](_0xbf5b17[_0x41d527]);}else{_0xbf5b17[_0x41d527]=this[_0x7e6d('0x94')](_0xbf5b17[_0x41d527]);}}}}return _0xbf5b17;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x95')]=function(_0x952d8a){for(var _0x12df3e in _0x952d8a){if(_0x952d8a[_0x7e6d('0x92')](_0x12df3e)){if(_[_0x7e6d('0x96')](_0x952d8a[_0x12df3e])){this[_0x7e6d('0x95')](_0x952d8a[_0x12df3e]);}else if(_[_0x7e6d('0x97')](_0x952d8a[_0x12df3e])){for(var _0x39c5b6=0x0;_0x39c5b6<_0x952d8a[_0x12df3e][_0x7e6d('0x98')];_0x39c5b6++){this[_0x7e6d('0x95')](_0x952d8a[_0x12df3e][_0x39c5b6]);}}else if(_[_0x7e6d('0x99')](_0x952d8a[_0x12df3e])){_0x952d8a[_0x12df3e]=this[_0x7e6d('0x94')](_0x952d8a[_0x12df3e]);}}}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x9a')]=function(_0x4b6417,_0x361072){for(var _0x2f8eb1 in _0x4b6417){if(_0x4b6417[_0x7e6d('0x92')](_0x2f8eb1)){if(_[_0x7e6d('0x96')](_0x4b6417[_0x2f8eb1])){if(!_[_0x7e6d('0x41')](_0x4b6417[_0x2f8eb1])){this['saveRestApiResult'](_0x4b6417[_0x2f8eb1],util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x361072,_0x2f8eb1));}}else if(_[_0x7e6d('0x97')](_0x4b6417[_0x2f8eb1])){for(var _0x54f01e=0x0;_0x54f01e<_0x4b6417[_0x2f8eb1][_0x7e6d('0x98')];_0x54f01e++){this[_0x7e6d('0x9a')](_0x4b6417[_0x2f8eb1][_0x54f01e],util[_0x7e6d('0x27')]('%s.%s',_0x361072,_0x2f8eb1+'['+_0x54f01e+']'));}}else{if(!_[_0x7e6d('0x42')](_0x4b6417[_0x2f8eb1])){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x361072,_0x2f8eb1),_0x4b6417[_0x2f8eb1]);}}}}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x93')]=function(_0x2920d2){try{var _0x16988f=JSON[_0x7e6d('0x6f')](_0x2920d2);this[_0x7e6d('0x95')](_0x16988f);return JSON[_0x7e6d('0x71')](_0x16988f);}catch(_0x1cf61a){return this[_0x7e6d('0x94')](_0x2920d2);}};AGIVertices['prototype'][_0x7e6d('0x94')]=function(_0x56ac3d){var _0x2cd475=_0x56ac3d['split']('{');for(var _0x124d3f=0x1;_0x124d3f<_0x2cd475['length'];_0x124d3f+=0x1){var _0x6d5e11=_0x2cd475[_0x124d3f][_0x7e6d('0x9d')]('}');if(_0x6d5e11[_0x7e6d('0x98')]>0x1){_0x56ac3d=_0x56ac3d['replaceAll']('{'+_0x6d5e11[0x0]+'}',this[_0x7e6d('0xd')][_0x7e6d('0x10')](_0x6d5e11[0x0])['extra']||_0x6d5e11[0x0]);}}if(_0x2cd475[_0x7e6d('0x98')]===0x1){return _0x56ac3d[_0x7e6d('0x4a')]();}return this[_0x7e6d('0x94')](_0x56ac3d);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x9e')]=function(_0x420aca,_0x468e2c){var _0x178502=this[_0x7e6d('0xd')][_0x7e6d('0x10')](_0x420aca);if(_0x178502[_0x7e6d('0x9f')]===-0x1){return _0x178502;}logger['info'](util[_0x7e6d('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x468e2c,_0x178502[_0x7e6d('0xa0')]));return this[_0x7e6d('0xd')]['setVariable'](_0x468e2c,_0x178502[_0x7e6d('0xa0')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x82')]=function(_0x536a3e){return _0x536a3e&&_0x536a3e!=='0'&&_0x536a3e!=='-1'&&_0x536a3e!=='';};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xa1')]=function(_0x3d9fb7){this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d9fb7,'-');_0x3d9fb7[_0x7e6d('0xa2')]=_0x3d9fb7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x3b6bf4){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xa3'),_0x3b6bf4['label']));if(!this[_0x7e6d('0x82')](_0x3b6bf4[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}var _0x40543d='\x22'+_0x3b6bf4[_0x7e6d('0x5c')]+'\x22';if(this[_0x7e6d('0x82')](_0x3b6bf4[_0x7e6d('0x76')])){_0x40543d+=','+_0x3b6bf4[_0x7e6d('0x76')];}var _0x35e20d=this[_0x7e6d('0xd')]['exec'](_0x7e6d('0xa6'),_0x40543d);if(_0x35e20d['result']===-0x1){return _0x35e20d;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xa7'),_0x40543d));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xa8')]=function(_0x4d6d67){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xa9'),_0x4d6d67['label']));if(!this[_0x7e6d('0x82')](_0x4d6d67[_0x7e6d('0xaa')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20grammar\x20configured');}var _0x48ba6d=_0x4d6d67['grammar'];if(this[_0x7e6d('0x82')](_0x4d6d67[_0x7e6d('0x76')])){_0x48ba6d+=','+_0x4d6d67['options'];}var _0x434987=this[_0x7e6d('0xd')][_0x7e6d('0x58')]('MRCPRecog',_0x48ba6d);if(_0x434987['result']===-0x1){return _0x434987;}var _0x43682d=this[_0x7e6d('0x9e')](_0x7e6d('0xab'),_0x7e6d('0xac'));if(_0x43682d[_0x7e6d('0x9f')]===-0x1){return _0x43682d;}var _0x408a4e=this[_0x7e6d('0x9e')](_0x7e6d('0xad'),_0x7e6d('0xae'));if(_0x408a4e[_0x7e6d('0x9f')]===-0x1){return _0x408a4e;}var _0x1835a9=this[_0x7e6d('0x9e')](_0x7e6d('0xaf'),_0x7e6d('0xb0'));if(_0x1835a9[_0x7e6d('0x9f')]===-0x1){return _0x1835a9;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xb1'),_0x48ba6d));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xb2')]=function(_0x246c44){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xb3'),_0x246c44[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['agi']([_0x246c44[_0x7e6d('0xb4')],_0x246c44['args']]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xb5')]=function(_0x349ae8){logger[_0x7e6d('0x2c')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x349ae8[_0x7e6d('0x34')]));if(this['isConfigured'](_0x349ae8[_0x7e6d('0x65')])){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x349ae8[_0x7e6d('0x65')]));var _0xf2bcc=this[_0x7e6d('0xd')][_0x7e6d('0xb6')](_0x349ae8[_0x7e6d('0x65')]);if(_0xf2bcc[_0x7e6d('0x9f')]===-0x1){return _0xf2bcc;}}return this[_0x7e6d('0xd')]['answer']();};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x48')]=function(_0x113dc7){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xb7'),_0x113dc7[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x113dc7[_0x7e6d('0x47')])){return this[_0x7e6d('0xd')]['error'](_0x113dc7,_0x7e6d('0xb8'));}_0x113dc7['scheduledAt']=moment();if(this[_0x7e6d('0x82')](_0x113dc7[_0x7e6d('0xb9')])){_0x113dc7[_0x7e6d('0xba')]=moment()[_0x7e6d('0xbb')](_0x113dc7[_0x7e6d('0xb9')],'minutes');}if(!this['isConfigured'](_0x113dc7[_0x7e6d('0x4b')])){_0x113dc7['callback_priority']=0x2;}this[_0x7e6d('0x40')][_0x7e6d('0x6d')](this,_0x113dc7);return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xbc'),_0x113dc7[_0x7e6d('0x46')],_0x113dc7[_0x7e6d('0x47')],_0x113dc7[_0x7e6d('0xba')]));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xbd')]=function(_0x2b1faa){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xbe'),_0x2b1faa[_0x7e6d('0x34')]));var _0x513800=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x2b1faa[_0x7e6d('0xbf')],_0x2b1faa[_0x7e6d('0x76')]);if(_0x513800[_0x7e6d('0x9f')]===-0x1){return _0x513800;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),_0x2b1faa[_0x7e6d('0xbf')],_0x2b1faa[_0x7e6d('0x76')]));};AGIVertices['prototype'][_0x7e6d('0xc1')]=function(_0x118f0f){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xc2'),_0x118f0f['label']));if(!this[_0x7e6d('0x82')](_0x118f0f['text'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}var _0x11ceca='\x22'+_0x118f0f['text']+'\x22';if(this[_0x7e6d('0x82')](_0x118f0f['options'])){_0x11ceca+=','+_0x118f0f[_0x7e6d('0x76')];}var _0x5b6e35=this[_0x7e6d('0xd')][_0x7e6d('0x58')]('MRCPSynth',_0x11ceca);if(_0x5b6e35[_0x7e6d('0x9f')]===-0x1){return _0x5b6e35;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xa7'),_0x11ceca));};AGIVertices['prototype'][_0x7e6d('0xc3')]=function(_0x1b5980){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xc4'),_0x1b5980['label']));if(!this[_0x7e6d('0x82')](_0x1b5980[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}var _0x3a1675='\x22'+_0x1b5980[_0x7e6d('0x5c')]+'\x22';if(this['isConfigured'](_0x1b5980[_0x7e6d('0x76')])){_0x3a1675+=','+_0x1b5980[_0x7e6d('0x76')];}var _0x20f6c1=this['channel'][_0x7e6d('0x58')](_0x7e6d('0xa6'),_0x3a1675);if(_0x20f6c1[_0x7e6d('0x9f')]===-0x1){return _0x20f6c1;}return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xa7'),_0x3a1675));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xc5')]=function(_0x5b704f){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xc6'),_0x5b704f['label']));if(!this[_0x7e6d('0x82')](_0x5b704f[_0x7e6d('0xaa')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xc7'));}var _0x1d07bf=_0x5b704f[_0x7e6d('0xaa')];if(this[_0x7e6d('0x82')](_0x5b704f['options'])){_0x1d07bf+=','+_0x5b704f['options'];}var _0x42189d=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0xc8'),_0x1d07bf);if(_0x42189d[_0x7e6d('0x9f')]===-0x1){return _0x42189d;}var _0x56d3c9=this[_0x7e6d('0x9e')](_0x7e6d('0xab'),_0x7e6d('0xc9'));if(_0x56d3c9[_0x7e6d('0x9f')]===-0x1){return _0x56d3c9;}var _0x2a6228=this[_0x7e6d('0x9e')](_0x7e6d('0xad'),_0x7e6d('0xca'));if(_0x2a6228[_0x7e6d('0x9f')]===-0x1){return _0x2a6228;}var _0x3fa03=this[_0x7e6d('0x9e')](_0x7e6d('0xaf'),_0x7e6d('0xcb'));if(_0x3fa03[_0x7e6d('0x9f')]===-0x1){return _0x3fa03;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xb1'),_0x1d07bf));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xcc')]=function(_0x5612fe){logger[_0x7e6d('0x2c')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5612fe[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x5612fe[_0x7e6d('0xaa')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xc7'));}var _0xe7b4be=_0x5612fe[_0x7e6d('0xaa')];if(this[_0x7e6d('0x82')](_0x5612fe[_0x7e6d('0x76')])){_0xe7b4be+=','+_0x5612fe[_0x7e6d('0x76')];}var _0x1cb51f=this[_0x7e6d('0xd')][_0x7e6d('0x58')]('MRCPRecog',_0xe7b4be);if(_0x1cb51f[_0x7e6d('0x9f')]===-0x1){return _0x1cb51f;}var _0x2aa267=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x2aa267[_0x7e6d('0x9f')]===-0x1){return _0x2aa267;}var _0xf10c14=this[_0x7e6d('0x9e')](_0x7e6d('0xad'),_0x7e6d('0xcd'));if(_0xf10c14[_0x7e6d('0x9f')]===-0x1){return _0xf10c14;}var _0x4f8c7f=this[_0x7e6d('0x9e')](_0x7e6d('0xaf'),'SESTEK_ASR_INSTANCE');if(_0x4f8c7f[_0x7e6d('0x9f')]===-0x1){return _0x4f8c7f;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0xe7b4be));};AGIVertices['prototype'][_0x7e6d('0xce')]=function(_0x254a8f){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xcf'),_0x254a8f['label']));if(!this[_0x7e6d('0x82')](_0x254a8f[_0x7e6d('0xd0')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x254a8f,_0x7e6d('0xd1'));}var _0x2d3672=this[_0x7e6d('0x19')][_0x7e6d('0x6d')](this,_0x254a8f['odbc_id']);if(!_0x2d3672){return this['channel'][_0x7e6d('0x50')](_0x254a8f,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x254a8f[_0x7e6d('0xd2')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x254a8f,'no\x20query\x20configured');}var _0x761089=_0x254a8f[_0x7e6d('0xd2')][_0x7e6d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xd3'),_0x761089));var _0x3eefd8=this['getQueryOdbc'][_0x7e6d('0x6d')](this,_0x2d3672,_0x761089);this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x254a8f,_0x761089);if(!this[_0x7e6d('0x82')](_0x254a8f[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x44b185=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x254a8f[_0x7e6d('0xd4')]);if(!_0x44b185){return this['channel'][_0x7e6d('0x50')](_0x254a8f,'no\x20variable\x20found');}var _0x4c89a3=this;_0x3eefd8[_0x7e6d('0xd5')](function(_0x424bbe,_0x10ae78){Object[_0x7e6d('0xd6')](_0x424bbe)[_0x7e6d('0xd5')](function(_0x23d1e9){_0x4c89a3['channel'][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0xd7'),_0x44b185,_0x10ae78,_0x23d1e9),_0x424bbe[_0x23d1e9]);});});this[_0x7e6d('0xd')]['setVariable'](util[_0x7e6d('0x27')](_0x7e6d('0xd8'),_0x44b185),_0x3eefd8[_0x7e6d('0x98')]);return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0xd9'),_0x44b185));};AGIVertices['prototype'][_0x7e6d('0xda')]=function(_0x5aeeb0){logger[_0x7e6d('0xdb')](util[_0x7e6d('0x27')](_0x7e6d('0xdc'),_0x5aeeb0[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x5aeeb0[_0x7e6d('0xdd')])){return this['channel']['error'](_0x5aeeb0,_0x7e6d('0xde'));}var _0x3e34e4=this['getUser'][_0x7e6d('0x6d')](this,_0x5aeeb0[_0x7e6d('0xdd')]);if(!_0x3e34e4){return this['channel'][_0x7e6d('0x50')](_0x5aeeb0,_0x7e6d('0xdf'));}var _0x118b85=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0xe0'),[util[_0x7e6d('0x27')](_0x7e6d('0xe1'),_0x3e34e4),_0x5aeeb0['timeout'],_0x5aeeb0[_0x7e6d('0xe2')],_0x5aeeb0[_0x7e6d('0x63')]]);if(_0x118b85[_0x7e6d('0x9f')]===-0x1){return _0x118b85;}return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('Executed\x20command\x20%s',_0x7e6d('0xe0')));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xe3')]=function(_0x262908){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xe4'),_0x262908['label']));if(!this[_0x7e6d('0x82')](_0x262908[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20key\x20configured');}if(!this[_0x7e6d('0x82')](_0x262908[_0x7e6d('0x5c')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this['channel'][_0x7e6d('0xe5')]=!![];this[_0x7e6d('0x33')](_0x262908);this[_0x7e6d('0x3e')](_0x262908[_0x7e6d('0x5c')],'in','','');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xe6'),_0x262908[_0x7e6d('0x5c')]));var _0x5b16e4=this[_0x7e6d('0x77')]['sync'](this,_0x262908);if(_0x5b16e4){for(var _0x867770 in _0x5b16e4){if(_0x5b16e4['hasOwnProperty'](_0x867770)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0xe7'),_0x867770[_0x7e6d('0xe8')]()),_0x5b16e4[_0x867770]);}}this[_0x7e6d('0x3e')](_0x5b16e4[_0x7e6d('0xe9')],_0x7e6d('0xea'),_0x7e6d('0xe3'),'');return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xeb'),_0x5b16e4['speech']));}return this['channel'][_0x7e6d('0x50')](_0x262908,_0x7e6d('0xec'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xed')]=function(_0xbc9ee3){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xee'),_0xbc9ee3[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0xef')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xf0'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0xf1')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xf2'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3['private_key'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xf3'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0x7c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xf4'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0x5c')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xe5')]=!![];this[_0x7e6d('0x33')](_0xbc9ee3);this[_0x7e6d('0x3e')](_0xbc9ee3[_0x7e6d('0x5c')],'in','','');this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xf5'),_0xbc9ee3[_0x7e6d('0x5c')]));var _0x5e04b8=this[_0x7e6d('0x7a')][_0x7e6d('0x6d')](this,_0xbc9ee3);if(_0x5e04b8){for(var _0x41a77f in _0x5e04b8){if(_0x5e04b8[_0x7e6d('0x92')](_0x41a77f)){if(_0x41a77f!=='providerResponse'){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0xe7'),_0x41a77f[_0x7e6d('0xe8')]()),_0x5e04b8[_0x41a77f]);}}}this[_0x7e6d('0x3e')](_0x5e04b8[_0x7e6d('0xe9')],_0x7e6d('0xea'),'dialogflowV2',_0x5e04b8['providerResponse']);return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xf6'),_0x5e04b8[_0x7e6d('0xe9')]));}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0xbc9ee3,_0x7e6d('0xf7'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xf8')]=function(_0x125bfc){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0xf9'),_0x125bfc[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x125bfc['ndauth_url'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xfa'));}if(!this['isConfigured'](_0x125bfc[_0x7e6d('0xfb')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xfc'));}if(!this['isConfigured'](_0x125bfc['password'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xfd'));}if(!this[_0x7e6d('0x82')](_0x125bfc[_0x7e6d('0xfe')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')]['bot']=!![];this[_0x7e6d('0x33')](_0x125bfc);this[_0x7e6d('0x3e')](_0x125bfc[_0x7e6d('0x5c')],'in','','');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xff'),_0x125bfc['text']));var _0x23f808=this['sestekNDA'][_0x7e6d('0x6d')](this,_0x125bfc);if(_0x23f808){for(var _0x34547c in _0x23f808){if(_0x23f808['hasOwnProperty'](_0x34547c)){this[_0x7e6d('0xd')]['setVariable'](util[_0x7e6d('0x27')](_0x7e6d('0x100'),_0x34547c['toUpperCase']()),_0x23f808[_0x34547c]);}}this['createSquareMessage'](_0x23f808['speech'],'out',_0x7e6d('0xf8'),'');if(_0x23f808[_0x7e6d('0x101')]){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x102'),_0x23f808[_0x7e6d('0x101')]));var _0x4b0fc1=this[_0x7e6d('0xd')]['streamFile'](_0x23f808[_0x7e6d('0x101')]);try{fs[_0x7e6d('0x103')](_0x23f808[_0x7e6d('0x101')]+_0x7e6d('0x104'));}catch(_0x221bba){logger[_0x7e6d('0x50')](_0x221bba);}return _0x4b0fc1;}else{return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x105'),_0x23f808[_0x7e6d('0xe9')]));}}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x125bfc,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x106')]=function(_0x4741ae){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x107'),_0x4741ae[_0x7e6d('0x34')]));return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x106'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x108')]=function(_0x233bdc){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x109'),_0x233bdc[_0x7e6d('0x34')]));var _0xaeb6c5='';if(_0x233bdc[_0x7e6d('0x10a')]){if(!this[_0x7e6d('0x82')](_0x233bdc[_0x7e6d('0x10a')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x233bdc,_0x7e6d('0x10b'));}else{var _0x40286=parseInt(_0x233bdc[_0x7e6d('0x10a')],0xa);if(isNaN(_0x40286)){_0xaeb6c5=_0x233bdc[_0x7e6d('0x10a')];}else{_0xaeb6c5=this[_0x7e6d('0x1d')][_0x7e6d('0x6d')](this,_0x233bdc[_0x7e6d('0x10a')]);if(!_0xaeb6c5){return this[_0x7e6d('0xd')]['error'](_0x233bdc,_0x7e6d('0x10c'));}}}}else if(_0x233bdc[_0x7e6d('0x10d')]){_0xaeb6c5=_0x233bdc[_0x7e6d('0x10d')];}else{return this[_0x7e6d('0xd')]['error'](_0x233bdc,_0x7e6d('0x10b'));}var _0xbbaf3c=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0xe0'),[util[_0x7e6d('0x27')]('SIP/%s/%s',_0xaeb6c5,_0x233bdc[_0x7e6d('0x46')]),_0x233bdc['timeout'],_0x233bdc[_0x7e6d('0xe2')],_0x233bdc[_0x7e6d('0x63')]]);if(_0xbbaf3c[_0x7e6d('0x9f')]===-0x1){return _0xbbaf3c;}return this[_0x7e6d('0xd')]['noop'](util['format'](_0x7e6d('0x10e'),'DIAL'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x10f')]=function(_0x357f6b){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x110'),_0x357f6b[_0x7e6d('0x34')]));return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x10f'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xb')]=function(_0x3d0795){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x111'),_0x3d0795['label']));if(_0x3d0795['retry']===0x0){return this['maxRetry'](_0x3d0795);}_0x3d0795[_0x7e6d('0xa2')]-=0x1;if(!this[_0x7e6d('0x82')](_0x3d0795[_0x7e6d('0x112')])){return this['channel'][_0x7e6d('0x50')](_0x3d0795,_0x7e6d('0x113'));}var _0x57e68b=this[_0x7e6d('0x114')][_0x7e6d('0x6d')](this,_0x3d0795['file_id']);if(!_0x57e68b){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x3d0795,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3d0795[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x7e6d('0x115'));}var _0xd51ff5=this['channel'][_0x7e6d('0x116')](_0x57e68b,_0x3d0795[_0x7e6d('0x117')],_0x3d0795[_0x7e6d('0x118')]);var _0x121808=_0xd51ff5[_0x7e6d('0x9f')]?_0xd51ff5[_0x7e6d('0x9f')][_0x7e6d('0x4a')]():'';logger['info'](_0x7e6d('0x119'),JSON[_0x7e6d('0x71')](_0xd51ff5));if(_0xd51ff5[_0x7e6d('0x9f')]===-0x1){this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d0795,_0x121808);return _0xd51ff5;}else if(_0xd51ff5[_0x7e6d('0xa0')]===_0x7e6d('0x65')){_0xd51ff5[_0x7e6d('0x9f')]=_0x121808[_0x7e6d('0x98')]>=parseInt(_0x3d0795[_0x7e6d('0x11a')])?'x':'i';}else{_0xd51ff5['result']=_0x121808[_0x7e6d('0x98')]>=parseInt(_0x3d0795[_0x7e6d('0x11a')])&&_0x121808[_0x7e6d('0x98')]<=parseInt(_0x3d0795['maxdigit'])?'x':'i';}var _0x6d480b=this[_0x7e6d('0x10')]['sync'](this,_0x3d0795[_0x7e6d('0xd4')]);if(!_0x6d480b){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x3d0795,_0x7e6d('0x11b'));}this['channel'][_0x7e6d('0x9c')](_0x6d480b,_0x121808);if(this[_0x7e6d('0x82')](_0x3d0795[_0x7e6d('0x11c')])){var _0x52f9a7=parseInt(_0x3d0795[_0x7e6d('0x11c')],0xa);var _0x5586d9=rs[_0x7e6d('0x11d')]({'charset':'*','length':_0x52f9a7});var _0x4c33a1=_0x121808['length'];if(_0x4c33a1>0x0){if(_0x4c33a1>_0x52f9a7){this['createSquareDetailsReport'][_0x7e6d('0x6d')](this,_0x3d0795,_0x3d0795['hiddendigitspos']===_0x7e6d('0x11e')?_0x5586d9+_0x121808[_0x7e6d('0x11f')](_0x52f9a7):_0x121808[_0x7e6d('0x11f')](0x0,_0x4c33a1-_0x52f9a7)+_0x5586d9);}else{this['createSquareDetailsReport']['sync'](this,_0x3d0795,rs[_0x7e6d('0x11d')]({'charset':'*','length':_0x4c33a1}));}}else{this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d0795,'');}}else{this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d0795,_0x121808);}return _0xd51ff5;};AGIVertices['prototype'][_0x7e6d('0xc')]=function(_0x3c06cb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x3c06cb[_0x7e6d('0x34')]));return this['getdigits'](_0x3c06cb);};AGIVertices['prototype'][_0x7e6d('0x120')]=function(_0x3fd659){logger['info'](util['format'](_0x7e6d('0x121'),_0x3fd659['label']));this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3fd659,_0x3fd659['goalname']);return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x122'),_0x3fd659['goalname']));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x123')]=function(_0x32e4e5){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x32e4e5['label']));if(!this[_0x7e6d('0x82')](_0x32e4e5[_0x7e6d('0x85')])||!this[_0x7e6d('0x82')](_0x32e4e5['aws_secret_access_key'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x124'));}if(!this[_0x7e6d('0x82')](_0x32e4e5[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20text\x20configured');}this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x125'),_0x32e4e5['text']));var _0x221b68=this[_0x7e6d('0x84')][_0x7e6d('0x6d')](this,_0x32e4e5);if(_0x221b68){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0x126'),_0x221b68));var _0x545bab=this[_0x7e6d('0xd')][_0x7e6d('0x127')](_0x221b68);try{fs[_0x7e6d('0x103')](_0x221b68+_0x7e6d('0x104'));}catch(_0x4a9a6a){logger[_0x7e6d('0x50')](_0x4a9a6a);}return _0x545bab;}return this['channel']['error'](_0x32e4e5,_0x7e6d('0x128'));};AGIVertices[_0x7e6d('0xf')]['awslex']=function(_0xd308bb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0xd308bb['label']));if(!this[_0x7e6d('0x82')](_0xd308bb[_0x7e6d('0x85')])||!this[_0x7e6d('0x82')](_0xd308bb[_0x7e6d('0x86')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x124'));}if(!this['isConfigured'](_0xd308bb['aws_bot_name'])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x129'));}if(!this[_0x7e6d('0x82')](_0xd308bb['text'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xe5')]=!![];this['createSquareDetailsReport'](_0xd308bb);this[_0x7e6d('0x3e')](_0xd308bb[_0x7e6d('0x5c')],'in','','');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('Trying\x20Amazon\x20Lex:\x20%s',_0xd308bb[_0x7e6d('0x5c')]));var _0x470308=this[_0x7e6d('0x8a')][_0x7e6d('0x6d')](this,_0xd308bb);if(_0x470308){for(var _0x149ecc in _0x470308){if(_0x470308['hasOwnProperty'](_0x149ecc)&&_['isString'](_0x470308[_0x149ecc])){this['channel']['setVariable'](util['format'](_0x7e6d('0x12a'),_0x149ecc['toUpperCase']()),_0x470308[_0x149ecc]);}}if(_[_0x7e6d('0x42')](_0x470308[_0x7e6d('0x12b')])){return this['channel']['noop'](_0x7e6d('0x12c'));}else{this[_0x7e6d('0x3e')](_0x470308[_0x7e6d('0x12b')],_0x7e6d('0xea'),'amazonlex','');return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x12d'),_0x470308[_0x7e6d('0x12b')]));}}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0xd308bb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x7e6d('0x12e')]=function(_0x16f707){logger['info'](util['format'](_0x7e6d('0x12f'),_0x16f707[_0x7e6d('0x34')],_0x16f707['timeout']));if(!this['isConfigured'](_0x16f707[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x130'));}var _0x404bfb=_0x7e6d('0x131');var _0x5f5826=util[_0x7e6d('0x27')](_0x7e6d('0x132'),FILES_PATH,rs[_0x7e6d('0x11d')](0x4));var _0x290644=util['format'](_0x7e6d('0x9b'),_0x5f5826,_0x404bfb);var _0xa008b=!![];if(_0x16f707[_0x7e6d('0x133')]===_0x7e6d('0x134')){_0xa008b=![];}var _0x32bf0f=this[_0x7e6d('0xd')]['recordFile'](_0x5f5826,_0x404bfb,_0x16f707[_0x7e6d('0x135')],_0x16f707[_0x7e6d('0x65')],undefined,_0xa008b);if(_0x32bf0f['result']!==-0x1){this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('google\x20%s\x20file\x20created',_0x290644));var _0x41ed5e=this[_0x7e6d('0x8c')]['sync'](this,_0x16f707,_0x290644);if(_0x41ed5e){for(var _0x142799 in _0x41ed5e){if(_0x41ed5e[_0x7e6d('0x92')](_0x142799)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util['format'](_0x7e6d('0x136'),_0x142799[_0x7e6d('0xe8')]()),_0x41ed5e[_0x142799]);}}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x137'),JSON[_0x7e6d('0x71')](_0x41ed5e)));}}return _0x32bf0f;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x138')]=function(_0x107732){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x139'),_0x107732[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x107732[_0x7e6d('0x8e')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x13a'));}if(!this[_0x7e6d('0x82')](_0x107732['appsecret'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x13b'));}var _0x223e4a=_0x7e6d('0x131');var _0x1541c2=util[_0x7e6d('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x7e6d('0x11d')](0x4));var _0x1aeb94=util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x1541c2,_0x223e4a);var _0x1ec370=!![];if(_0x107732['beep']==='NOBEEP'){_0x1ec370=![];}var _0x16907e=this[_0x7e6d('0xd')][_0x7e6d('0x13c')](_0x1541c2,_0x223e4a,_0x107732['intKey'],_0x107732[_0x7e6d('0x65')],undefined,_0x1ec370);if(_0x16907e[_0x7e6d('0x9f')]!==-0x1){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x13d'),_0x1aeb94));var _0x3343b0=this[_0x7e6d('0x8d')][_0x7e6d('0x6d')](this,_0x107732,_0x1aeb94);if(_0x3343b0){for(var _0x3d8efc in _0x3343b0){if(_0x3343b0[_0x7e6d('0x92')](_0x3d8efc)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')]('TILDE_ASR_%s',_0x3d8efc['toUpperCase']()),_0x3343b0[_0x3d8efc]);}}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x13e'),JSON['stringify'](_0x3343b0)));}}return _0x16907e;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x13f')]=function(_0x267695){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x140'),_0x267695[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['continueAt'](_0x267695[_0x7e6d('0x39')],_0x267695['extension'],_0x267695[_0x7e6d('0x141')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x142')]=function(_0x57c51b){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x143'),_0x57c51b[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x57c51b[_0x7e6d('0x144')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x57c51b,_0x7e6d('0x145'));}try{var _0x5c396f=eval(_0x57c51b['condition'])?_0x7e6d('0x146'):_0x7e6d('0x147');this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x148'),_0x57c51b[_0x7e6d('0x144')],_0x5c396f));return{'code':0xc8,'result':_0x5c396f};}catch(_0x402603){return{'code':0xc8,'result':_0x7e6d('0x147')};}};AGIVertices['prototype'][_0x7e6d('0x149')]=function(_0x17e526){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x14a'),_0x17e526['label']));if(!this[_0x7e6d('0x82')](_0x17e526[_0x7e6d('0x14b')])){return this[_0x7e6d('0xd')]['error'](_0x17e526,_0x7e6d('0x14c'));}var _0x346fda=this[_0x7e6d('0x23')]['sync'](this,_0x17e526[_0x7e6d('0x14b')]);if(!_0x346fda){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x17e526,_0x7e6d('0x14d'));}for(var _0x1916ed=0x0;_0x1916ed<_0x346fda[_0x7e6d('0x98')];_0x1916ed+=0x1){var _0x2d0e24=this[_0x7e6d('0xd')][_0x7e6d('0x10')](util[_0x7e6d('0x27')]('IFTIME(%s?true:false)',_0x346fda[_0x1916ed]));if(_0x2d0e24[_0x7e6d('0x9f')]===-0x1){return _0x2d0e24;}logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('IFTIME\x20%s\x20%s',_0x346fda[_0x1916ed],_0x2d0e24[_0x7e6d('0xa0')]));if(_0x2d0e24[_0x7e6d('0xa0')]===_0x7e6d('0x146')){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x14e'),_0x346fda[_0x1916ed],'true'));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('IFTIME\x20%s\x20%s',_0x346fda[_0x1916ed],'true'));return{'code':0xc8,'result':_0x7e6d('0x146')};}else{logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x14e'),_0x346fda[_0x1916ed],'false'));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x14e'),_0x346fda[_0x1916ed],'false'));}}return{'code':0xc8,'result':_0x7e6d('0x147')};};AGIVertices['prototype']['hangup']=function(_0x447a01){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x447a01[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')][_0x7e6d('0x14f')]();};AGIVertices['prototype'][_0x7e6d('0x150')]=function(_0x27b05b){logger['info'](util[_0x7e6d('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x27b05b[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x27b05b[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x130'));}var _0x3f8d53='wav';var _0x147e82=util[_0x7e6d('0x27')](_0x7e6d('0x132'),FILES_PATH,rs[_0x7e6d('0x11d')](0x4));var _0x1278d7=util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x147e82,_0x3f8d53);var _0x27c8cb=!![];if(_0x27b05b[_0x7e6d('0x133')]==='NOBEEP'){_0x27c8cb=![];}var _0x29ce46=this[_0x7e6d('0xd')][_0x7e6d('0x13c')](_0x147e82,_0x3f8d53,_0x27b05b[_0x7e6d('0x135')],_0x27b05b[_0x7e6d('0x65')],undefined,_0x27c8cb);if(_0x29ce46[_0x7e6d('0x9f')]!==-0x1){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format']('ispeech\x20%s\x20file\x20created',_0x1278d7));var _0x1437f4=this[_0x7e6d('0x80')][_0x7e6d('0x6d')](this,_0x27b05b,_0x1278d7);if(_0x1437f4){for(var _0x52b039 in _0x1437f4){if(_0x1437f4['hasOwnProperty'](_0x52b039)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')]('ISPEECH_ASR_%s',_0x52b039[_0x7e6d('0xe8')]()),_0x1437f4[_0x52b039]);}}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x151'),JSON[_0x7e6d('0x71')](_0x1437f4)));}}return _0x29ce46;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x152')]=function(_0x2b8934){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x153'),_0x2b8934['label']));if(!this[_0x7e6d('0x82')](_0x2b8934[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x130'));}if(!this[_0x7e6d('0x82')](_0x2b8934['text'])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x154'),_0x2b8934[_0x7e6d('0x5c')]));var _0x20fd8a=this[_0x7e6d('0x7d')][_0x7e6d('0x6d')](this,_0x2b8934);if(_0x20fd8a){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('ispeech\x20%s\x20file\x20created',_0x20fd8a));var _0x379e2c=this[_0x7e6d('0xd')]['streamFile'](_0x20fd8a,_0x2b8934['intKey']);try{fs[_0x7e6d('0x103')](_0x20fd8a+'.wav');}catch(_0x1b0a06){logger[_0x7e6d('0x50')](_0x1b0a06);}return _0x379e2c;}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x2b8934,_0x7e6d('0x155'));};AGIVertices['prototype'][_0x7e6d('0x156')]=function(_0x59520d){logger['info'](util[_0x7e6d('0x27')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x59520d['label']));if(!this['isConfigured'](_0x59520d['findBy'])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x59520d,_0x7e6d('0x157'));}logger[_0x7e6d('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7e6d('0xd')]['callerid'],_0x59520d['findBy']));var _0x40f548=this[_0x7e6d('0x56')][_0x7e6d('0x6d')](this,_0x59520d[_0x7e6d('0x158')]);if(_0x40f548){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x159'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x59520d['findBy']));this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this['channel'][_0x7e6d('0x36')],_0x59520d[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger['info'](util[_0x7e6d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x59520d[_0x7e6d('0x158')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this['channel'][_0x7e6d('0x36')],_0x59520d[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices['prototype'][_0x7e6d('0x15d')]=function(_0x5430f5){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15e'),_0x5430f5[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x5430f5[_0x7e6d('0x158')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x5430f5,_0x7e6d('0x157'));}logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15f'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x5430f5[_0x7e6d('0x158')]));var _0x472773=this[_0x7e6d('0x52')][_0x7e6d('0x6d')](this,_0x5430f5[_0x7e6d('0x158')]);if(_0x472773){logger[_0x7e6d('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7e6d('0xd')]['callerid'],_0x5430f5[_0x7e6d('0x158')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x5430f5[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x5430f5['findBy']));this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this['channel']['callerid'],_0x5430f5[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices['prototype'][_0x7e6d('0x160')]=function(_0x5fbca2){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5fbca2[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x5fbca2['operation'])){return this[_0x7e6d('0xd')]['error'](_0x5fbca2,'no\x20operation\x20configured');}this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x161'),_0x5fbca2[_0x7e6d('0x162')]));var _0xa5fef5=eval(_0x5fbca2['operation']);if(!this['isConfigured'](_0x5fbca2[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x115'));}var _0x53c86a=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x5fbca2['variable_id']);if(!_0x53c86a){return this['channel'][_0x7e6d('0x50')](_0x5fbca2,_0x7e6d('0x11b'));}if(_[_0x7e6d('0x97')](_0xa5fef5)){var _0x3966dc=this;_0xa5fef5['forEach'](function(_0x5e6ee4,_0x5abc67){_0x3966dc['channel'][_0x7e6d('0x9c')](util[_0x7e6d('0x27')]('%s[%s]',_0x53c86a,_0x5abc67),_0x5e6ee4);});return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('variable\x20%s[key]\x20set',_0x53c86a));}else{return this[_0x7e6d('0xd')][_0x7e6d('0x9c')](_0x53c86a,_0xa5fef5);}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xa')]=function(_0x19c2e1){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x163'),_0x19c2e1['label']));if(_0x19c2e1[_0x7e6d('0xa2')]===0x0){return this[_0x7e6d('0xa1')](_0x19c2e1);}_0x19c2e1[_0x7e6d('0xa2')]-=0x1;if(!this['isConfigured'](_0x19c2e1[_0x7e6d('0x112')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x19c2e1,_0x7e6d('0x113'));}var _0x403c71=this[_0x7e6d('0x114')]['sync'](this,_0x19c2e1[_0x7e6d('0x112')]);if(!_0x403c71){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x19c2e1,'no\x20file\x20audio\x20found');}var _0x3b3cab=this[_0x7e6d('0xd')][_0x7e6d('0x116')](_0x403c71,_0x19c2e1[_0x7e6d('0x117')],_0x19c2e1[_0x7e6d('0x164')]);var _0xe07ec3=_0x3b3cab[_0x7e6d('0x9f')];if(_0x3b3cab[_0x7e6d('0x9f')]===-0x1){this[_0x7e6d('0x33')]['sync'](this,_0x19c2e1,'-1');return _0x3b3cab;}else if(_0x3b3cab[_0x7e6d('0xa0')]==='timeout'){_0x3b3cab['result']=_0x3b3cab[_0x7e6d('0x9f')]['length']>0x0?_0x3b3cab[_0x7e6d('0x9f')]:'t';}else if(_['isEmpty'](_0x3b3cab[_0x7e6d('0x9f')])){_0x3b3cab[_0x7e6d('0x9f')]='#';_0xe07ec3='#';}if(!this[_0x7e6d('0x82')](_0x19c2e1['variable_id'])){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x115'));}else{var _0x30c9b3=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x19c2e1[_0x7e6d('0xd4')]);if(!_0x30c9b3){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x19c2e1,_0x7e6d('0x11b'));}this[_0x7e6d('0xd')]['setVariable'](_0x30c9b3,_0xe07ec3);}this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x19c2e1,_0xe07ec3);return _0x3b3cab;};AGIVertices[_0x7e6d('0xf')]['noop']=function(_0x505718){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x165'),_0x505718[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['noop'](_0x505718[_0x7e6d('0x166')]||_0x505718[_0x7e6d('0x34')]);};AGIVertices[_0x7e6d('0xf')]['pause']=function(_0x43dd39){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x167'),_0x43dd39[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x43dd39[_0x7e6d('0x158')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x43dd39,_0x7e6d('0x157'));}logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x15f'),this['channel']['callerid'],_0x43dd39[_0x7e6d('0x158')]));var _0x38fc53=this[_0x7e6d('0x4c')][_0x7e6d('0x6d')](this,_0x43dd39[_0x7e6d('0x168')]);var _0x148fbb=this[_0x7e6d('0x4e')]['sync'](this,_0x43dd39[_0x7e6d('0x158')],_0x38fc53);if(_0x148fbb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this['channel'][_0x7e6d('0x36')],_0x43dd39['findBy']));this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this[_0x7e6d('0xd')]['callerid'],_0x43dd39[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x43dd39[_0x7e6d('0x158')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0x159'),this['channel'][_0x7e6d('0x36')],_0x43dd39[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x169')]=function(_0x4b6994){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4b6994['label']));if(!this['isConfigured'](_0x4b6994[_0x7e6d('0x112')])){return this['channel'][_0x7e6d('0x50')](_0x4b6994,_0x7e6d('0x113'));}var _0x23cca4=this['getSound'][_0x7e6d('0x6d')](this,_0x4b6994[_0x7e6d('0x112')]);if(!_0x23cca4){return this['channel'][_0x7e6d('0x50')](_0x4b6994,_0x7e6d('0x16a'));}var _0x22f349=this[_0x7e6d('0xd')]['exec'](_0x7e6d('0x16b'),[_0x23cca4,_0x4b6994[_0x7e6d('0xe2')]]);if(_0x22f349[_0x7e6d('0x9f')]===-0x1){return _0x22f349;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),'PLAYBACK',_0x23cca4));};AGIVertices[_0x7e6d('0xf')]['queue']=function(_0x42e495){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x16c'),_0x42e495[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x42e495[_0x7e6d('0x16d')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x42e495,'no\x20queue\x20selected');}var _0x3d3f5e='';var _0x52009f=parseInt(_0x42e495[_0x7e6d('0x16d')],0xa);if(isNaN(_0x52009f)){_0x3d3f5e=_0x42e495[_0x7e6d('0x16d')];}else{_0x3d3f5e=this[_0x7e6d('0x15')]['sync'](this,_0x42e495[_0x7e6d('0x16d')]);if(!_0x3d3f5e){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x42e495,_0x7e6d('0x16e'));}}var _0x42e2a4='';if(this[_0x7e6d('0x82')](_0x42e495['file_id'])){var _0x4b1033=this['getSound'][_0x7e6d('0x6d')](this,_0x42e495[_0x7e6d('0x112')]);if(_0x4b1033){_0x42e2a4=_0x4b1033;}}this['createSquareDetailsReport'][_0x7e6d('0x6d')](this,_0x42e495,_0x3d3f5e);if(_0x42e495['opts'][_0x7e6d('0x16f')]('x')<0x0){_0x42e495[_0x7e6d('0xe2')]+='x';}if(_0x42e495[_0x7e6d('0xe2')][_0x7e6d('0x16f')]('X')<0x0){_0x42e495[_0x7e6d('0xe2')]+='X';}this['channel'][_0x7e6d('0x9c')](_0x7e6d('0x170'),_0x3d3f5e?_0x3d3f5e[_0x7e6d('0x171')]():'');var _0x18ec22=this['channel']['exec'](_0x7e6d('0x172'),[_0x3d3f5e,_0x42e495['opts'],_0x42e495[_0x7e6d('0x63')],_0x42e2a4,_0x42e495['timeout'],_0x42e495[_0x7e6d('0xb2')],_0x42e495[_0x7e6d('0x173')],_0x42e495['gosub'],'',_0x42e495[_0x7e6d('0x174')]]);if(_0x18ec22[_0x7e6d('0x9f')]===-0x1){return _0x18ec22;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),'QUEUE',_0x3d3f5e));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x175')]=function(_0x5e15eb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5e15eb[_0x7e6d('0x34')]));var _0x180ab5=_0x5e15eb[_0x7e6d('0x176')]||'wav';var _0x2161da=util['format'](_0x7e6d('0x177'),this[_0x7e6d('0xd')]['uniqueid'],rs[_0x7e6d('0x11d')](0x5));var _0x5a350f=util[_0x7e6d('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x2161da,_0x180ab5);var _0x22a86f=util[_0x7e6d('0x27')]('%s/recordings/%s',FILES_PATH,_0x2161da);this[_0x7e6d('0x37')][_0x7e6d('0x6d')](this,_0x5e15eb,_0x2161da,_0x5a350f);this[_0x7e6d('0xd')][_0x7e6d('0x9c')](_0x7e6d('0x178'),_0x2161da);logger['info'](_0x7e6d('0x179'),_0x22a86f,_0x180ab5,_0x5e15eb[_0x7e6d('0x17a')],_0x5e15eb[_0x7e6d('0x65')]);return this[_0x7e6d('0xd')][_0x7e6d('0x13c')](_0x22a86f,_0x180ab5,_0x5e15eb[_0x7e6d('0x17a')],_0x5e15eb[_0x7e6d('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x7e6d('0x17b')]=function(_0x1a6a69){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x17c'),_0x1a6a69[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x1a6a69[_0x7e6d('0x63')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x17d'));}var _0x311138=this[_0x7e6d('0x17e')][_0x7e6d('0x6d')](this,_0x1a6a69);logger['info'](util['format'](_0x7e6d('0x17f'),util['inspect'](_0x311138,{'showHidden':![],'depth':null})));if(!this[_0x7e6d('0x82')](_0x1a6a69[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x180'));}var _0x22e222=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x1a6a69[_0x7e6d('0xd4')]);if(!_0x22e222){return this[_0x7e6d('0xd')]['error'](_0x1a6a69,_0x7e6d('0x11b'));}this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0x181'),_0x22e222),_0x311138[_0x7e6d('0x73')]?_0x311138[_0x7e6d('0x73')]:_0x7e6d('0x182'));this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util['format']('%s_STATUS_MESSAGE',_0x22e222),_0x311138[_0x7e6d('0x74')]?_0x311138[_0x7e6d('0x74')]:'OK');if(_0x311138['body']){try{this[_0x7e6d('0x9a')](_0x311138[_0x7e6d('0x68')],_0x22e222);}catch(_0x3abf97){logger[_0x7e6d('0x50')](util[_0x7e6d('0x27')](_0x7e6d('0x183'),_0x22e222));}}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')]('variable\x20%s\x20set',_0x22e222));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x184')]=function(_0xe8bc0b){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x185'),_0xe8bc0b[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['sayDigits'](_0xe8bc0b[_0x7e6d('0x186')][_0x7e6d('0x5a')](/\s+/g,''),_0xe8bc0b[_0x7e6d('0x17a')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x187')]=function(_0x51a5dd){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x188'),_0x51a5dd[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')][_0x7e6d('0x189')](_0x51a5dd[_0x7e6d('0x18a')][_0x7e6d('0x5a')](/\s+/g,''),_0x51a5dd[_0x7e6d('0x17a')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x18b')]=function(_0x5ad7d0){logger['info'](util[_0x7e6d('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5ad7d0[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')][_0x7e6d('0x18c')](_0x5ad7d0[_0x7e6d('0x5c')],_0x5ad7d0[_0x7e6d('0x17a')]);};AGIVertices['prototype']['sendMail']=function(_0x57dbb1){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x18d'),_0x57dbb1[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x57dbb1[_0x7e6d('0x18e')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x18f'));}var _0x301659=this['getMailAccount'][_0x7e6d('0x6d')](this,_0x57dbb1[_0x7e6d('0x18e')]);if(!_0x301659||!_0x301659[_0x7e6d('0x190')]){return this['channel'][_0x7e6d('0x50')](_0x57dbb1,_0x7e6d('0x191'));}var _0x3e0125={'from':util[_0x7e6d('0x27')]('\x22%s\x22\x20<%s>',_0x301659[_0x7e6d('0x13')],_0x301659[_0x7e6d('0x192')]||_0x301659[_0x7e6d('0x190')][_0x7e6d('0x193')]),'to':_0x57dbb1['to']||'','cc':_0x57dbb1['cc']||'','bcc':_0x57dbb1['bcc']||'','subject':_0x57dbb1[_0x7e6d('0x194')],'html':_0x57dbb1[_0x7e6d('0x5c')],'text':_0x57dbb1['text']};if(this['isConfigured'](_0x57dbb1[_0x7e6d('0x195')])){}logger['debug'](_0x7e6d('0x196'),JSON[_0x7e6d('0x71')](_0x3e0125));this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x57dbb1,_0x57dbb1[_0x7e6d('0x18e')]);this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x197'),_0x301659[_0x7e6d('0x13')]));this[_0x7e6d('0x198')][_0x7e6d('0x6d')](this,_0x301659[_0x7e6d('0x199')],_0x3e0125);return this['channel']['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x19a')]=function(_0x438779){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x19b'),_0x438779[_0x7e6d('0x34')]));return this['channel'][_0x7e6d('0xa4')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x19c')]=function(_0x34d109){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x19d'),_0x34d109[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x34d109['sms_account_id'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x19e'));}var _0x18a8cd=this[_0x7e6d('0x31')][_0x7e6d('0x6d')](this,_0x34d109[_0x7e6d('0x19f')]);if(!_0x18a8cd){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x34d109,_0x7e6d('0x1a0'));}var _0x466929={'body':_0x34d109[_0x7e6d('0x1a1')],'phone':_0x34d109['to']||'','SmsAccountId':_0x18a8cd['id']};logger['debug']('sendSMS\x20message',JSON['stringify'](_0x466929));this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x34d109,_0x34d109[_0x7e6d('0x19f')]);this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1a2'),_0x18a8cd[_0x7e6d('0x13')]));this[_0x7e6d('0x32')]['sync'](this,_0x466929);return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x7e6d('0xf')]['set']=function(_0x437375){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1a3'),_0x437375[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x437375[_0x7e6d('0xd4')])){return this['channel']['error'](_0x437375,'no\x20variable\x20selected');}var _0x526c2e=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x437375[_0x7e6d('0xd4')]);if(!_0x526c2e){return this['channel'][_0x7e6d('0x50')](_0x437375,_0x7e6d('0x11b'));}return this[_0x7e6d('0xd')]['setVariable'](_0x526c2e,_0x437375[_0x7e6d('0x1a4')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1a5')]=function(_0x2a80d1){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1a6'),_0x2a80d1[_0x7e6d('0x34')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x1a7'));if(_0x2a80d1[_0x7e6d('0xb5')]===_0x7e6d('0x1a8')){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x1a9'));return this[_0x7e6d('0xd')][_0x7e6d('0xb5')]();}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x1aa'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1ab')]=function(_0x2cda56){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1ac'),_0x2cda56[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x2cda56[_0x7e6d('0x1ad')])){return this['channel'][_0x7e6d('0x50')](_0x2cda56,_0x7e6d('0x1ae'));}var _0x659956=this[_0x7e6d('0x17')][_0x7e6d('0x6d')](this,_0x2cda56['project_id']);if(!this['isConfigured'](_0x659956)){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x2cda56,util[_0x7e6d('0x27')](_0x7e6d('0x1af'),_0x2cda56[_0x7e6d('0x1ad')]));}if(_0x659956===this['channel'][_0x7e6d('0x3d')]){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x2cda56,_0x7e6d('0x1b0'));}this['createSquareDetailsReport']['sync'](this,_0x2cda56,_0x659956);var _0x25994d=this['channel']['exec'](_0x7e6d('0x1b1'),util[_0x7e6d('0x27')](_0x7e6d('0x1b2'),config[_0x7e6d('0xb2')]['host']||_0x7e6d('0x1b3'),_0x659956,this['channel'][_0x7e6d('0x3d')]));if(_0x25994d['result']===-0x1){return _0x25994d;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),'AGI',_0x659956));};AGIVertices[_0x7e6d('0xf')]['system']=function(_0x37c613){logger['info'](util['format'](_0x7e6d('0x1b4'),_0x37c613[_0x7e6d('0x34')]));var _0x3b72d7=this[_0x7e6d('0x57')][_0x7e6d('0x6d')](this,_0x37c613[_0x7e6d('0xb4')]);this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x37c613,_0x37c613[_0x7e6d('0xb4')]);if(this[_0x7e6d('0x82')](_0x37c613[_0x7e6d('0xd4')])){var _0x2084a3=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x37c613[_0x7e6d('0xd4')]);if(_0x2084a3){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](_0x2084a3,_0x3b72d7);return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0x1b5'),_0x37c613[_0x7e6d('0xb4')],_0x2084a3));}}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x1b6'),_0x37c613[_0x7e6d('0xb4')]));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1b7')]=function(_0x284fb3){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x1b8'),_0x284fb3[_0x7e6d('0x34')]));_0x284fb3[_0x7e6d('0x5c')]=_0x284fb3[_0x7e6d('0x5c')][_0x7e6d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7e6d('0x82')](_0x284fb3['apiKey'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0x7e6d('0x82')](_0x284fb3[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1b9'),_0x284fb3[_0x7e6d('0x5c')]));var _0x5bfacc=this[_0x7e6d('0x5b')][_0x7e6d('0x6d')](this,_0x284fb3);if(_0x5bfacc){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1ba'),_0x5bfacc));var _0x335fc3=this[_0x7e6d('0xd')][_0x7e6d('0x127')](_0x5bfacc);try{fs['unlink'](_0x5bfacc+'.wav');}catch(_0xfd8d8f){logger[_0x7e6d('0x50')](_0xfd8d8f);}return _0x335fc3;}return this[_0x7e6d('0xd')]['error'](_0x284fb3,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1bb')]=function(_0x52fee5){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1bc'),_0x52fee5[_0x7e6d('0x34')]));_0x52fee5[_0x7e6d('0x5c')]=_0x52fee5[_0x7e6d('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7e6d('0x82')](_0x52fee5[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1bd'),_0x52fee5[_0x7e6d('0x5c')]));var _0x35147f=this[_0x7e6d('0x62')][_0x7e6d('0x6d')](this,_0x52fee5);if(_0x35147f){this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x35147f));var _0x6f5600=this[_0x7e6d('0xd')][_0x7e6d('0x127')](_0x35147f);try{fs[_0x7e6d('0x103')](_0x35147f+_0x7e6d('0x104'));}catch(_0x22279c){logger['error'](_0x22279c);}return _0x6f5600;}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x52fee5,_0x7e6d('0x1be'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1bf')]=function(_0x3c8ac0){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1c0'),_0x3c8ac0[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x3c8ac0['findBy'])){return this['channel'][_0x7e6d('0x50')](_0x3c8ac0,_0x7e6d('0x157'));}logger['info'](util['format'](_0x7e6d('0x15f'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x3c8ac0['findBy']));var _0x5289ef=this['agentUnpause'][_0x7e6d('0x6d')](this,_0x3c8ac0[_0x7e6d('0x158')]);if(_0x5289ef){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7e6d('0x36')],_0x3c8ac0[_0x7e6d('0x158')]));this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this['channel']['callerid'],_0x3c8ac0[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x3c8ac0['findBy']));this['channel']['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x3c8ac0[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1c1')]=function(_0x15041b){logger['info'](util['format'](_0x7e6d('0x1c2'),_0x15041b['label']));var _0x35beec=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0x1c3'),[_0x15041b[_0x7e6d('0x1c4')],_0x15041b[_0x7e6d('0x76')]]);if(_0x35beec['result']===-0x1){return _0x35beec;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),_0x7e6d('0x1c3'),_0x15041b[_0x7e6d('0x1c4')]));};AGIVertices[_0x7e6d('0xf')]['vswitch']=function(_0x5d3cdd){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1c5'),_0x5d3cdd['label']));if(!this[_0x7e6d('0x82')](_0x5d3cdd[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x5d3cdd,'no\x20variable\x20selected');}var _0x18f9c0=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x5d3cdd[_0x7e6d('0xd4')]);if(!_0x18f9c0){return this['channel'][_0x7e6d('0x50')](_0x5d3cdd,_0x7e6d('0x11b'));}var _0x1fe23e=this[_0x7e6d('0xd')]['getVariable'](_0x18f9c0);return{'code':0xc8,'result':_0x1fe23e[_0x7e6d('0xa0')]?_0x1fe23e['extra']:'-'};};String[_0x7e6d('0xf')][_0x7e6d('0x1c6')]=function(_0x207b92,_0x35786d){return this[_0x7e6d('0x9d')](_0x207b92)['join'](_0x35786d);};module[_0x7e6d('0x1c7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 1a08ddd..b201513 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 _0x6a02=['QueuePause','then','voicePause','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20%s','message','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x2a9d6b,_0x4fb63d){var _0x302af2=function(_0x250a33){while(--_0x250a33){_0x2a9d6b['push'](_0x2a9d6b['shift']());}};_0x302af2(++_0x4fb63d);}(_0x6a02,0xd6));var _0x26a0=function(_0xcd0ce5,_0x88e357){_0xcd0ce5=_0xcd0ce5-0x0;var _0x5b22cd=_0x6a02[_0xcd0ce5];return _0x5b22cd;};'use strict';var util=require(_0x26a0('0x0'));var _=require(_0x26a0('0x1'));var moment=require(_0x26a0('0x2'));var ami=require(_0x26a0('0x3'));var logger=require(_0x26a0('0x4'))(_0x26a0('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x26a0('0x6'));function Acw(_0x3f9bbf){this[_0x26a0('0x7')]=_0x3f9bbf['voiceQueues'];this[_0x26a0('0x8')]=_0x3f9bbf['agents'];this[_0x26a0('0x9')]=_0x3f9bbf[_0x26a0('0x9')];this[_0x26a0('0xa')]={};ami['on']('agentconnect',this[_0x26a0('0xb')][_0x26a0('0xc')](this));ami['on'](_0x26a0('0xd'),this['syncHangupRequest'][_0x26a0('0xc')](this));ami['on'](_0x26a0('0xe'),this[_0x26a0('0xf')][_0x26a0('0xc')](this));ami['on'](_0x26a0('0x10'),this['syncAgentRingNoAnswer'][_0x26a0('0xc')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x26a0('0xc')](this));ami['on']('blindtransfer',this[_0x26a0('0x11')]['bind'](this));ami['on'](_0x26a0('0x12'),this[_0x26a0('0x13')][_0x26a0('0xc')](this));}function getDiff(_0x3f167b){var _0x5b1ed8=moment()[_0x26a0('0x14')](0x0);var _0x33b2b3=moment(_0x3f167b)[_0x26a0('0x14')](0x0);return _0x5b1ed8[_0x26a0('0x15')](_0x33b2b3,_0x26a0('0x16'));}Acw['prototype'][_0x26a0('0x17')]=function(_0x12c2b7){try{var _0x1f7ac8=this;var _0x5a842c=this[_0x26a0('0xa')][_0x12c2b7][_0x26a0('0x18')];var _0x44f37a=this['channels'][_0x12c2b7][_0x26a0('0x19')];var _0x1370ae=this[_0x26a0('0x7')][_0x44f37a];var _0x35b391=![];var _0x363b0b=_0x26a0('0x1a');if(_0x1370ae[_0x26a0('0x1b')]){if(_0x1370ae[_0x26a0('0x1c')]['name']){_0x35b391=!![];_0x363b0b=_0x1370ae[_0x26a0('0x1c')]['name'];}}ami['Action']({'action':_0x26a0('0x1d'),'interface':_0x5a842c,'paused':!![],'reason':_0x363b0b})[_0x26a0('0x1e')](function(_0xab1cdf){if(_0x1f7ac8[_0x26a0('0x8')][_0x5a842c]){return RpcUser['getAgent'](_0x1f7ac8[_0x26a0('0x8')][_0x5a842c]['id'])[_0x26a0('0x1e')](function(_0x3cd235){if(_0x3cd235&&!_0x3cd235[_0x26a0('0x1f')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x12c2b7,_0x5a842c,_0x44f37a);var _0x1e461d=_0x1f7ac8[_0x26a0('0xa')][_0x12c2b7]['attended']&&_0x1f7ac8[_0x26a0('0xa')][_0x12c2b7]['destlinkedid']?_0x1f7ac8[_0x26a0('0xa')][_0x12c2b7][_0x26a0('0x20')]:_0x12c2b7;return RpcUser['savePause'](_0x1f7ac8[_0x26a0('0x8')][_0x5a842c],_0x363b0b,_0x1e461d)[_0x26a0('0x1e')](function(_0x1d4496){if(!_0x35b391){_0x1f7ac8['timers'][_0x5a842c]={};logger[_0x26a0('0x21')](_0x26a0('0x22'),_0x12c2b7,_0x1f7ac8['voiceQueues'][_0x44f37a][_0x26a0('0x23')],_0x5a842c,_0x44f37a);_0x1f7ac8[_0x26a0('0x9')][_0x5a842c]['timer']=setTimeout(_0x1f7ac8[_0x26a0('0x24')][_0x26a0('0xc')](_0x1f7ac8,_0x5a842c),_0x1f7ac8[_0x26a0('0x7')][_0x44f37a][_0x26a0('0x23')]*0x3e8);_0x1f7ac8[_0x26a0('0x9')][_0x5a842c][_0x26a0('0x25')]=moment()[_0x26a0('0x26')](_0x26a0('0x27'));_0x1f7ac8[_0x26a0('0x9')][_0x5a842c][_0x26a0('0x28')]=_0x12c2b7;_0x1f7ac8['timers'][_0x5a842c][_0x26a0('0x19')]=_0x44f37a;_0x1f7ac8['timers'][_0x5a842c][_0x26a0('0x29')]=function(){var _0x4907e1=getDiff(_0x1f7ac8[_0x26a0('0x9')][_0x5a842c]['lastPauseAt']);clearTimeout(_0x1f7ac8[_0x26a0('0x9')][_0x5a842c]['timer']);_0x1f7ac8[_0x26a0('0x9')][_0x5a842c][_0x26a0('0x2a')]=![];RpcVoiceAgentReport[_0x26a0('0x2b')]({'acwtime':_0x4907e1},_0x1f7ac8[_0x26a0('0x9')][_0x5a842c][_0x26a0('0x28')],_0x5a842c)['then'](function(_0x1772ef){logger[_0x26a0('0x21')](_0x26a0('0x2c'),_0x12c2b7,_0x4907e1,_0x1772ef);})['catch'](function(_0x4646a0){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x12c2b7,_0x4646a0);});delete _0x1f7ac8[_0x26a0('0x9')][_0x5a842c];};}});}else{logger[_0x26a0('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x12c2b7,_0x5a842c,_0x44f37a);}});}})[_0x26a0('0x2d')](function(_0x5d10bd){logger[_0x26a0('0x2e')](_0x26a0('0x22'),_0x12c2b7,_0x1f7ac8[_0x26a0('0x7')][_0x44f37a]['acwTimeout'],_0x5a842c,_0x44f37a);})[_0x26a0('0x2f')](function(){delete _0x1f7ac8[_0x26a0('0xa')][_0x12c2b7];});}catch(_0x40a4bf){logger['error'](_0x26a0('0x30'),_0x40a4bf['message']);}};Acw[_0x26a0('0x31')][_0x26a0('0x24')]=function(_0x4f7849){try{var _0x355a6c=this;if(_0x355a6c[_0x26a0('0x9')][_0x4f7849]){_0x355a6c[_0x26a0('0x9')][_0x4f7849][_0x26a0('0x2a')]=![];var _0x2775a7=_0x355a6c[_0x26a0('0x9')][_0x4f7849][_0x26a0('0x28')];var _0x16d1c1=_0x355a6c[_0x26a0('0x9')][_0x4f7849][_0x26a0('0x19')];var _0x2e05cb=_0x355a6c[_0x26a0('0x7')][_0x16d1c1][_0x26a0('0x23')];logger[_0x26a0('0x21')](_0x26a0('0x32'),_0x2775a7,_0x4f7849);RpcUser[_0x26a0('0x33')](this[_0x26a0('0x8')][_0x4f7849]);RpcVoiceAgentReport[_0x26a0('0x2b')]({'acwtime':_0x2e05cb,'agentacw':!![]},_0x2775a7,_0x4f7849)[_0x26a0('0x1e')](function(_0x8f55a0){logger['info'](_0x26a0('0x2c'),_0x2775a7,_0x2e05cb,_0x8f55a0);})['catch'](function(_0x363474){logger[_0x26a0('0x2e')](_0x26a0('0x34'),_0x2775a7,_0x363474);});}else{logger[_0x26a0('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4f7849);if(_0x355a6c[_0x26a0('0x9')]){logger[_0x26a0('0x21')]('[ACW][TIMERS]',JSON['stringify'](_0x355a6c[_0x26a0('0x9')]));}}}catch(_0x358633){logger[_0x26a0('0x2e')](_0x26a0('0x35'),_0x358633['message']);}};Acw['prototype'][_0x26a0('0xb')]=function(_0x32f809){try{if(this[_0x26a0('0x7')][_0x32f809[_0x26a0('0x19')]]&&(this[_0x26a0('0x7')][_0x32f809[_0x26a0('0x19')]][_0x26a0('0x5')]||this['voiceQueues'][_0x32f809[_0x26a0('0x19')]][_0x26a0('0x1b')])){if(this[_0x26a0('0x8')][_0x32f809[_0x26a0('0x18')]]){this[_0x26a0('0xa')][_0x32f809['uniqueid']]={'queue':_0x32f809['queue'],'interface':_0x32f809[_0x26a0('0x18')],'destlinkedid':_0x32f809[_0x26a0('0x20')]};}}}catch(_0x2567cb){logger[_0x26a0('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x2567cb[_0x26a0('0x36')]);}};Acw[_0x26a0('0x31')][_0x26a0('0x13')]=function(_0x3c23e5){try{if(this[_0x26a0('0x7')][_0x3c23e5[_0x26a0('0x19')]]&&(this[_0x26a0('0x7')][_0x3c23e5[_0x26a0('0x19')]][_0x26a0('0x5')]||this[_0x26a0('0x7')][_0x3c23e5[_0x26a0('0x19')]][_0x26a0('0x1b')])){if(this['agents'][_0x3c23e5[_0x26a0('0x18')]]){this['channels'][_0x3c23e5['uniqueid']]={'queue':_0x3c23e5[_0x26a0('0x19')],'interface':_0x3c23e5[_0x26a0('0x18')]};}}}catch(_0x20e2a5){logger[_0x26a0('0x2e')]('[ACW][syncAgentConnectPreview]\x20%s',_0x20e2a5[_0x26a0('0x36')]);}};Acw[_0x26a0('0x31')][_0x26a0('0x37')]=function(_0x38c131){try{if(this[_0x26a0('0xa')][_0x38c131[_0x26a0('0x28')]]&&_[_0x26a0('0x38')](this[_0x26a0('0xa')][_0x38c131[_0x26a0('0x28')]][_0x26a0('0x39')])){logger[_0x26a0('0x21')](_0x26a0('0x3a'),_0x38c131[_0x26a0('0x28')]);this[_0x26a0('0x17')](_0x38c131[_0x26a0('0x28')]);}else if(this['channels'][_0x38c131[_0x26a0('0x3b')]]&&_[_0x26a0('0x38')](this[_0x26a0('0xa')][_0x38c131[_0x26a0('0x3b')]][_0x26a0('0x39')])){logger[_0x26a0('0x21')](_0x26a0('0x3c'),_0x38c131['linkedid']);this[_0x26a0('0x17')](_0x38c131['linkedid']);}}catch(_0x317780){logger[_0x26a0('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x317780[_0x26a0('0x36')]);}};Acw['prototype'][_0x26a0('0xf')]=function(_0x4faf63){try{if(this['channels'][_0x4faf63['uniqueid']]&&this[_0x26a0('0xa')][_0x4faf63[_0x26a0('0x28')]]['attended']){logger[_0x26a0('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4faf63[_0x26a0('0x28')]);this[_0x26a0('0x17')](_0x4faf63[_0x26a0('0x28')]);}else if(this['channels'][_0x4faf63['linkedid']]&&this['channels'][_0x4faf63[_0x26a0('0x3b')]][_0x26a0('0x39')]){logger[_0x26a0('0x21')](_0x26a0('0x3d'),_0x4faf63['linkedid']);this[_0x26a0('0x17')](_0x4faf63[_0x26a0('0x3b')]);}}catch(_0x15007a){logger[_0x26a0('0x2e')](_0x26a0('0x3e'),_0x15007a[_0x26a0('0x36')]);}};Acw[_0x26a0('0x31')][_0x26a0('0x3f')]=function(_0x4a8841){try{if(!_['isNil'](this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x40')]])){this['startAcw'](_0x4a8841[_0x26a0('0x40')]);if(this['channels'][_0x4a8841[_0x26a0('0x41')]]){this['channels'][_0x4a8841[_0x26a0('0x41')]][_0x26a0('0x39')]=!![];this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x42')]]=this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x41')]];delete this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x41')]];}}else if(!_[_0x26a0('0x43')](this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x42')]])){this[_0x26a0('0x17')](_0x4a8841[_0x26a0('0x42')]);if(this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x44')]]){this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x44')]]['attended']=!![];this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x40')]]=this['channels'][_0x4a8841[_0x26a0('0x44')]];delete this[_0x26a0('0xa')][_0x4a8841[_0x26a0('0x44')]];}}}catch(_0x5c6fc7){logger[_0x26a0('0x2e')]('[ACW][syncAttendedTransfer]\x20%s',_0x5c6fc7[_0x26a0('0x36')]);}};Acw[_0x26a0('0x31')][_0x26a0('0x11')]=function(_0x23d75b){try{if(this[_0x26a0('0xa')][_0x23d75b[_0x26a0('0x45')]]){logger[_0x26a0('0x21')](_0x26a0('0x46'),JSON[_0x26a0('0x47')](_0x23d75b[_0x26a0('0x45')]));this[_0x26a0('0x17')](_0x23d75b[_0x26a0('0x45')]);}else if(this[_0x26a0('0xa')][_0x23d75b[_0x26a0('0x48')]]){logger['info'](_0x26a0('0x49'),JSON[_0x26a0('0x47')](_0x23d75b[_0x26a0('0x48')]));this['startAcw'](_0x23d75b[_0x26a0('0x48')]);}}catch(_0x201a09){logger[_0x26a0('0x2e')](_0x26a0('0x4a'),_0x201a09[_0x26a0('0x36')]);}};Acw[_0x26a0('0x31')][_0x26a0('0x4b')]=function(_0x1a128e){try{if(this[_0x26a0('0x7')][_0x1a128e[_0x26a0('0x19')]]&&this[_0x26a0('0x7')][_0x1a128e[_0x26a0('0x19')]]['autopause']===_0x26a0('0x4c')){if(this[_0x26a0('0x8')][_0x1a128e[_0x26a0('0x18')]]){logger[_0x26a0('0x21')](_0x26a0('0x4d'),_0x1a128e['uniqueid'],_0x1a128e[_0x26a0('0x18')],_0x1a128e[_0x26a0('0x19')]);return RpcUser['savePause'](this[_0x26a0('0x8')][_0x1a128e[_0x26a0('0x18')]],_0x26a0('0x4e'),_0x1a128e[_0x26a0('0x28')]);}}}catch(_0x25c93c){logger['error'](_0x26a0('0x4f'),_0x25c93c['message']);}};module[_0x26a0('0x50')]=Acw; \ No newline at end of file +var _0x5fb1=['update','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[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]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','acwTimeout','timer','stopAcw','lastPauseAt','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause'];(function(_0x393ad5,_0x2a7a68){var _0x31f723=function(_0x4877c){while(--_0x4877c){_0x393ad5['push'](_0x393ad5['shift']());}};_0x31f723(++_0x2a7a68);}(_0x5fb1,0x74));var _0x15fb=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x5fb1[_0x3cae69];return _0x3128eb;};'use strict';var util=require(_0x15fb('0x0'));var _=require(_0x15fb('0x1'));var moment=require(_0x15fb('0x2'));var ami=require('../ami');var logger=require(_0x15fb('0x3'))(_0x15fb('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x15fb('0x5'));function Acw(_0x9be408){this[_0x15fb('0x6')]=_0x9be408[_0x15fb('0x6')];this['agents']=_0x9be408[_0x15fb('0x7')];this[_0x15fb('0x8')]=_0x9be408[_0x15fb('0x8')];this[_0x15fb('0x9')]={};ami['on'](_0x15fb('0xa'),this[_0x15fb('0xb')][_0x15fb('0xc')](this));ami['on'](_0x15fb('0xd'),this[_0x15fb('0xe')][_0x15fb('0xc')](this));ami['on'](_0x15fb('0xf'),this[_0x15fb('0x10')]['bind'](this));ami['on'](_0x15fb('0x11'),this[_0x15fb('0x12')][_0x15fb('0xc')](this));ami['on'](_0x15fb('0x13'),this[_0x15fb('0x14')][_0x15fb('0xc')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0x15fb('0x15'),this[_0x15fb('0x16')][_0x15fb('0xc')](this));}function getDiff(_0x11e111){var _0x122ef0=moment()['milliseconds'](0x0);var _0x2430ec=moment(_0x11e111)[_0x15fb('0x17')](0x0);return _0x122ef0[_0x15fb('0x18')](_0x2430ec,_0x15fb('0x19'));}Acw[_0x15fb('0x1a')][_0x15fb('0x1b')]=function(_0x2f461b){try{var _0x200f44=this;var _0x31c714=this[_0x15fb('0x9')][_0x2f461b][_0x15fb('0x1c')];var _0x5e6ca1=this['channels'][_0x2f461b][_0x15fb('0x1d')];var _0xffe5cc=this['voiceQueues'][_0x5e6ca1];var _0x425526=![];var _0x9f0e82='ACW';if(_0xffe5cc[_0x15fb('0x1e')]){if(_0xffe5cc[_0x15fb('0x1f')][_0x15fb('0x20')]){_0x425526=!![];_0x9f0e82=_0xffe5cc[_0x15fb('0x1f')]['name'];}}ami[_0x15fb('0x21')]({'action':_0x15fb('0x22'),'interface':_0x31c714,'paused':!![],'reason':_0x9f0e82})[_0x15fb('0x23')](function(_0x59a7c9){if(_0x200f44[_0x15fb('0x7')][_0x31c714]){return RpcUser[_0x15fb('0x24')](_0x200f44[_0x15fb('0x7')][_0x31c714]['id'])[_0x15fb('0x23')](function(_0x4477e4){if(_0x4477e4&&!_0x4477e4['voicePause']){logger[_0x15fb('0x25')](_0x15fb('0x26'),_0x2f461b,_0x31c714,_0x5e6ca1);var _0x53d50a=_0x200f44[_0x15fb('0x9')][_0x2f461b][_0x15fb('0x27')]&&_0x200f44['channels'][_0x2f461b]['destlinkedid']?_0x200f44[_0x15fb('0x9')][_0x2f461b]['destlinkedid']:_0x2f461b;return RpcUser[_0x15fb('0x28')](_0x200f44[_0x15fb('0x7')][_0x31c714],_0x9f0e82,_0x53d50a)[_0x15fb('0x23')](function(_0x27f64e){if(!_0x425526){_0x200f44[_0x15fb('0x8')][_0x31c714]={};logger[_0x15fb('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2f461b,_0x200f44[_0x15fb('0x6')][_0x5e6ca1][_0x15fb('0x29')],_0x31c714,_0x5e6ca1);_0x200f44['timers'][_0x31c714][_0x15fb('0x2a')]=setTimeout(_0x200f44[_0x15fb('0x2b')][_0x15fb('0xc')](_0x200f44,_0x31c714),_0x200f44['voiceQueues'][_0x5e6ca1][_0x15fb('0x29')]*0x3e8);_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x200f44['timers'][_0x31c714][_0x15fb('0x2d')]=_0x2f461b;_0x200f44['timers'][_0x31c714][_0x15fb('0x1d')]=_0x5e6ca1;_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2e')]=function(){var _0xd8cbde=getDiff(_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2c')]);clearTimeout(_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2a')]);_0x200f44['timers'][_0x31c714]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0xd8cbde},_0x200f44[_0x15fb('0x8')][_0x31c714]['uniqueid'],_0x31c714)[_0x15fb('0x23')](function(_0x467ae1){logger[_0x15fb('0x25')](_0x15fb('0x2f'),_0x2f461b,_0xd8cbde,_0x467ae1);})['catch'](function(_0x16c73e){logger[_0x15fb('0x30')](_0x15fb('0x31'),_0x2f461b,_0x16c73e);});delete _0x200f44[_0x15fb('0x8')][_0x31c714];};}});}else{logger[_0x15fb('0x25')](_0x15fb('0x32'),_0x2f461b,_0x31c714,_0x5e6ca1);}});}})['catch'](function(_0x18aca4){logger[_0x15fb('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2f461b,_0x200f44[_0x15fb('0x6')][_0x5e6ca1][_0x15fb('0x29')],_0x31c714,_0x5e6ca1);})[_0x15fb('0x33')](function(){delete _0x200f44[_0x15fb('0x9')][_0x2f461b];});}catch(_0x512059){logger['error'](_0x15fb('0x34'),_0x512059[_0x15fb('0x35')]);}};Acw[_0x15fb('0x1a')][_0x15fb('0x2b')]=function(_0x4a32b9){try{var _0x50759b=this;if(_0x50759b[_0x15fb('0x8')][_0x4a32b9]){_0x50759b['timers'][_0x4a32b9]['timer']=![];var _0x48b53a=_0x50759b[_0x15fb('0x8')][_0x4a32b9][_0x15fb('0x2d')];var _0x286218=_0x50759b[_0x15fb('0x8')][_0x4a32b9][_0x15fb('0x1d')];var _0x564eb9=_0x50759b[_0x15fb('0x6')][_0x286218]['acwTimeout'];logger[_0x15fb('0x25')](_0x15fb('0x36'),_0x48b53a,_0x4a32b9);RpcUser[_0x15fb('0x37')](this[_0x15fb('0x7')][_0x4a32b9]);RpcVoiceAgentReport[_0x15fb('0x38')]({'acwtime':_0x564eb9,'agentacw':!![]},_0x48b53a,_0x4a32b9)[_0x15fb('0x23')](function(_0x33c9ea){logger[_0x15fb('0x25')](_0x15fb('0x2f'),_0x48b53a,_0x564eb9,_0x33c9ea);})[_0x15fb('0x39')](function(_0x41cdbb){logger[_0x15fb('0x30')](_0x15fb('0x31'),_0x48b53a,_0x41cdbb);});}else{logger[_0x15fb('0x30')](_0x15fb('0x3a'),_0x4a32b9);if(_0x50759b[_0x15fb('0x8')]){logger['info'](_0x15fb('0x3b'),JSON[_0x15fb('0x3c')](_0x50759b[_0x15fb('0x8')]));}}}catch(_0x350469){logger['error']('[ACW][STOP]\x20%s',_0x350469[_0x15fb('0x35')]);}};Acw['prototype']['syncAgentConnect']=function(_0x4094ba){try{if(this[_0x15fb('0x6')][_0x4094ba[_0x15fb('0x1d')]]&&(this[_0x15fb('0x6')][_0x4094ba[_0x15fb('0x1d')]][_0x15fb('0x4')]||this[_0x15fb('0x6')][_0x4094ba[_0x15fb('0x1d')]]['mandatoryDisposition'])){if(this['agents'][_0x4094ba[_0x15fb('0x1c')]]){this['channels'][_0x4094ba[_0x15fb('0x2d')]]={'queue':_0x4094ba['queue'],'interface':_0x4094ba[_0x15fb('0x1c')],'destlinkedid':_0x4094ba['destlinkedid']};}}}catch(_0x36cfce){logger[_0x15fb('0x30')](_0x15fb('0x3d'),_0x36cfce[_0x15fb('0x35')]);}};Acw[_0x15fb('0x1a')][_0x15fb('0x16')]=function(_0x5da583){try{if(this[_0x15fb('0x6')][_0x5da583[_0x15fb('0x1d')]]&&(this['voiceQueues'][_0x5da583['queue']][_0x15fb('0x4')]||this[_0x15fb('0x6')][_0x5da583[_0x15fb('0x1d')]][_0x15fb('0x1e')])){if(this[_0x15fb('0x7')][_0x5da583[_0x15fb('0x1c')]]){this[_0x15fb('0x9')][_0x5da583[_0x15fb('0x2d')]]={'queue':_0x5da583[_0x15fb('0x1d')],'interface':_0x5da583[_0x15fb('0x1c')]};}}}catch(_0x448a22){logger[_0x15fb('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0x448a22['message']);}};Acw[_0x15fb('0x1a')][_0x15fb('0xe')]=function(_0x25742b){try{if(this[_0x15fb('0x9')][_0x25742b[_0x15fb('0x2d')]]&&_['isUndefined'](this['channels'][_0x25742b['uniqueid']][_0x15fb('0x27')])){logger[_0x15fb('0x25')](_0x15fb('0x3e'),_0x25742b[_0x15fb('0x2d')]);this[_0x15fb('0x1b')](_0x25742b[_0x15fb('0x2d')]);}else if(this[_0x15fb('0x9')][_0x25742b[_0x15fb('0x3f')]]&&_[_0x15fb('0x40')](this[_0x15fb('0x9')][_0x25742b[_0x15fb('0x3f')]][_0x15fb('0x27')])){logger[_0x15fb('0x25')](_0x15fb('0x41'),_0x25742b[_0x15fb('0x3f')]);this[_0x15fb('0x1b')](_0x25742b[_0x15fb('0x3f')]);}}catch(_0x3d0e23){logger[_0x15fb('0x30')](_0x15fb('0x42'),_0x3d0e23[_0x15fb('0x35')]);}};Acw['prototype']['syncHangup']=function(_0x77d71){try{if(this[_0x15fb('0x9')][_0x77d71['uniqueid']]&&this['channels'][_0x77d71['uniqueid']][_0x15fb('0x27')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x77d71['uniqueid']);this[_0x15fb('0x1b')](_0x77d71[_0x15fb('0x2d')]);}else if(this['channels'][_0x77d71[_0x15fb('0x3f')]]&&this['channels'][_0x77d71['linkedid']][_0x15fb('0x27')]){logger['info'](_0x15fb('0x43'),_0x77d71[_0x15fb('0x3f')]);this['startAcw'](_0x77d71[_0x15fb('0x3f')]);}}catch(_0xacf362){logger[_0x15fb('0x30')](_0x15fb('0x44'),_0xacf362['message']);}};Acw['prototype'][_0x15fb('0x14')]=function(_0x51d382){try{if(!_[_0x15fb('0x45')](this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x46')]])){this[_0x15fb('0x1b')](_0x51d382[_0x15fb('0x46')]);if(this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]]){this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]]['attended']=!![];this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x48')]]=this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]];delete this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]];}}else if(!_[_0x15fb('0x45')](this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x48')]])){this[_0x15fb('0x1b')](_0x51d382[_0x15fb('0x48')]);if(this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]]){this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]][_0x15fb('0x27')]=!![];this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x46')]]=this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]];delete this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]];}}}catch(_0x408aa4){logger['error'](_0x15fb('0x4a'),_0x408aa4['message']);}};Acw[_0x15fb('0x1a')][_0x15fb('0x4b')]=function(_0x5d5a6c){try{if(this[_0x15fb('0x9')][_0x5d5a6c[_0x15fb('0x4c')]]){logger[_0x15fb('0x25')](_0x15fb('0x4d'),JSON[_0x15fb('0x3c')](_0x5d5a6c[_0x15fb('0x4c')]));this[_0x15fb('0x1b')](_0x5d5a6c[_0x15fb('0x4c')]);}else if(this[_0x15fb('0x9')][_0x5d5a6c[_0x15fb('0x4e')]]){logger['info'](_0x15fb('0x4f'),JSON[_0x15fb('0x3c')](_0x5d5a6c[_0x15fb('0x4e')]));this['startAcw'](_0x5d5a6c[_0x15fb('0x4e')]);}}catch(_0x2afd30){logger[_0x15fb('0x30')](_0x15fb('0x50'),_0x2afd30[_0x15fb('0x35')]);}};Acw[_0x15fb('0x1a')][_0x15fb('0x12')]=function(_0x1c1abd){try{if(this[_0x15fb('0x6')][_0x1c1abd[_0x15fb('0x1d')]]&&this[_0x15fb('0x6')][_0x1c1abd[_0x15fb('0x1d')]][_0x15fb('0x51')]==='all'){if(this['agents'][_0x1c1abd['interface']]){logger[_0x15fb('0x25')](_0x15fb('0x52'),_0x1c1abd[_0x15fb('0x2d')],_0x1c1abd[_0x15fb('0x1c')],_0x1c1abd[_0x15fb('0x1d')]);return RpcUser[_0x15fb('0x28')](this[_0x15fb('0x7')][_0x1c1abd[_0x15fb('0x1c')]],_0x15fb('0x53'),_0x1c1abd[_0x15fb('0x2d')]);}}}catch(_0x5edd93){logger[_0x15fb('0x30')](_0x15fb('0x54'),_0x5edd93['message']);}};module[_0x15fb('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3a71e85..0d14d99 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 _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x4a5469,_0x4b415c){var _0x50d5ab=function(_0x381c3d){while(--_0x381c3d){_0x4a5469['push'](_0x4a5469['shift']());}};_0x50d5ab(++_0x4b415c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x4e6708,_0x161453){var _0x44264e=function(_0x48c4ae){while(--_0x48c4ae){_0x4e6708['push'](_0x4e6708['shift']());}};_0x44264e(++_0x161453);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 211a79e..6ef3a9a 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 _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x344b4e,_0x4d4e2f){var _0x5eec96=function(_0x13ef16){while(--_0x13ef16){_0x344b4e['push'](_0x344b4e['shift']());}};_0x5eec96(++_0x4d4e2f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3296b6,_0x54567f){_0x3296b6=_0x3296b6-0x0;var _0x2a67f2=_0x9ffd[_0x3296b6];return _0x2a67f2;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x114af6,_0x1817cf){var _0xe19601=function(_0x2e3d4a){while(--_0x2e3d4a){_0x114af6['push'](_0x114af6['shift']());}};_0xe19601(++_0x1817cf);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x57fc06,_0x127721){_0x57fc06=_0x57fc06-0x0;var _0x2162a9=_0xbdb7[_0x57fc06];return _0x2162a9;};'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/action.js b/server/services/ami/dialer/action.js index f4f4dfe..0fb205f 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7566=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime'];(function(_0x5cbc92,_0x56f7ff){var _0x3dcd54=function(_0x4032ce){while(--_0x4032ce){_0x5cbc92['push'](_0x5cbc92['shift']());}};_0x3dcd54(++_0x56f7ff);}(_0x7566,0x1bb));var _0x6756=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7566[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x6756('0x0'));var _=require(_0x6756('0x1'));var moment=require(_0x6756('0x2'));function checkNameSurname(_0xb235db,_0x515d22,_0x37526c){var _0x16b03b='';if(!_[_0x6756('0x3')](_0x515d22)&&_0x6756('0x4')===typeof _0x515d22){_0x16b03b+=_0x515d22;}if(!_[_0x6756('0x3')](_0x37526c)&&_0x6756('0x4')===typeof _0x37526c){_0x16b03b+='\x20'+_0x37526c;}if(_0x16b03b!==''){return _0x16b03b;}return _0xb235db;}function Action(_0x4ba8d2,_0x454d6d,_0x259f96){this[_0x6756('0x5')]=_0x4ba8d2;this[_0x6756('0x6')]=_0x259f96||undefined;this[_0x6756('0x7')]=checkNameSurname(_0x454d6d['Contact'][_0x6756('0x8')],_0x454d6d[_0x6756('0x9')][_0x6756('0xa')],_0x454d6d[_0x6756('0x9')][_0x6756('0xb')]);this[_0x6756('0xc')]=_0x454d6d[_0x6756('0x8')];this[_0x6756('0xd')]=_0x4ba8d2[_0x6756('0x7')];this['active']=_0x454d6d['active']||![];this['type']=_0x4ba8d2['type'];this['dialQueueTimeout']=_0x4ba8d2[_0x6756('0xe')]||0x3;this['scheduledat']=_0x454d6d[_0x6756('0xf')];this[_0x6756('0x10')]=_0x454d6d['countbusyretry'];this[_0x6756('0x11')]=_0x454d6d[_0x6756('0x11')];this[_0x6756('0x12')]=_0x454d6d[_0x6756('0x12')];this[_0x6756('0x13')]=_0x454d6d[_0x6756('0x13')];this['countdropretry']=_0x454d6d[_0x6756('0x14')];this[_0x6756('0x15')]=_0x454d6d[_0x6756('0x15')];this[_0x6756('0x16')]=_0x454d6d[_0x6756('0x16')];this[_0x6756('0x17')]=_0x454d6d[_0x6756('0x17')];this['ContactId']=_0x454d6d['ContactId'];this['ListId']=_0x454d6d[_0x6756('0x18')];this[_0x6756('0x19')]=_0x454d6d[_0x6756('0x19')];this['VoiceQueueId']=_0x454d6d[_0x6756('0x1a')];this[_0x6756('0x1b')]=_0x454d6d[_0x6756('0x1b')];this['idHopper']=_0x454d6d['id'];this[_0x6756('0x1c')]=_0x454d6d[_0x6756('0x9')][_0x6756('0xa')]||'';this[_0x6756('0x1d')]=moment()['format'](_0x6756('0x1e'));this['callback']=_0x454d6d[_0x6756('0x1f')];this[_0x6756('0x20')]=_0x454d6d[_0x6756('0x20')];this[_0x6756('0x21')]=_0x454d6d['callbackat'];this[_0x6756('0x22')]=_0x454d6d[_0x6756('0x22')];this[_0x6756('0x23')]='';this[_0x6756('0x24')]='';}Action[_0x6756('0x25')][_0x6756('0x26')]=function(){return util[_0x6756('0x27')](_0x6756('0x28'),this[_0x6756('0x7')],this[_0x6756('0x5')]['dialCutDigit']>0x0?this[_0x6756('0xc')]['substring'](this[_0x6756('0x5')][_0x6756('0x29')]):this[_0x6756('0xc')]);};Action['prototype'][_0x6756('0x2a')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x9a89=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','string','voiceQueue','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9a89,0xb4));var _0x99a8=function(_0x4dd980,_0x2f9a68){_0x4dd980=_0x4dd980-0x0;var _0x3340ae=_0x9a89[_0x4dd980];return _0x3340ae;};'use strict';var util=require(_0x99a8('0x0'));var _=require(_0x99a8('0x1'));var moment=require('moment');function checkNameSurname(_0x2b1a30,_0x33f4c2,_0x2c8806){var _0x290f42='';if(!_['isNil'](_0x33f4c2)&&_0x99a8('0x2')===typeof _0x33f4c2){_0x290f42+=_0x33f4c2;}if(!_['isNil'](_0x2c8806)&&_0x99a8('0x2')===typeof _0x2c8806){_0x290f42+='\x20'+_0x2c8806;}if(_0x290f42!==''){return _0x290f42;}return _0x2b1a30;}function Action(_0x104104,_0x39e8e6,_0x21e0e6){this[_0x99a8('0x3')]=_0x104104;this['uniqueid']=_0x21e0e6||undefined;this[_0x99a8('0x4')]=checkNameSurname(_0x39e8e6[_0x99a8('0x5')][_0x99a8('0x6')],_0x39e8e6[_0x99a8('0x5')]['firstName'],_0x39e8e6[_0x99a8('0x5')][_0x99a8('0x7')]);this['number']=_0x39e8e6['phone'];this[_0x99a8('0x8')]=_0x104104[_0x99a8('0x4')];this[_0x99a8('0x9')]=_0x39e8e6[_0x99a8('0x9')]||![];this['type']=_0x104104[_0x99a8('0xa')];this[_0x99a8('0xb')]=_0x104104[_0x99a8('0xb')]||0x3;this[_0x99a8('0xc')]=_0x39e8e6[_0x99a8('0xc')];this[_0x99a8('0xd')]=_0x39e8e6[_0x99a8('0xd')];this['countcongestionretry']=_0x39e8e6['countcongestionretry'];this['countnoanswerretry']=_0x39e8e6[_0x99a8('0xe')];this['countnosuchnumberretry']=_0x39e8e6[_0x99a8('0xf')];this[_0x99a8('0x10')]=_0x39e8e6[_0x99a8('0x10')];this['countabandonedretry']=_0x39e8e6[_0x99a8('0x11')];this[_0x99a8('0x12')]=_0x39e8e6[_0x99a8('0x12')];this[_0x99a8('0x13')]=_0x39e8e6[_0x99a8('0x13')];this[_0x99a8('0x14')]=_0x39e8e6[_0x99a8('0x14')];this[_0x99a8('0x15')]=_0x39e8e6[_0x99a8('0x15')];this[_0x99a8('0x16')]=_0x39e8e6['UserId'];this[_0x99a8('0x17')]=_0x39e8e6['VoiceQueueId'];this[_0x99a8('0x18')]=_0x39e8e6[_0x99a8('0x18')];this[_0x99a8('0x19')]=_0x39e8e6['id'];this[_0x99a8('0x1a')]=_0x39e8e6[_0x99a8('0x5')][_0x99a8('0x1b')]||'';this[_0x99a8('0x1c')]=moment()[_0x99a8('0x1d')](_0x99a8('0x1e'));this[_0x99a8('0x1f')]=_0x39e8e6[_0x99a8('0x1f')];this[_0x99a8('0x20')]=_0x39e8e6[_0x99a8('0x20')];this[_0x99a8('0x21')]=_0x39e8e6[_0x99a8('0x21')];this[_0x99a8('0x22')]=_0x39e8e6[_0x99a8('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x99a8('0x23')]['getCaller']=function(){return util[_0x99a8('0x1d')](_0x99a8('0x24'),this[_0x99a8('0x4')],this['voiceQueue'][_0x99a8('0x25')]>0x0?this[_0x99a8('0x26')][_0x99a8('0x27')](this[_0x99a8('0x3')]['dialCutDigit']):this[_0x99a8('0x26')]);};Action[_0x99a8('0x23')][_0x99a8('0x28')]=function(){return this[_0x99a8('0x8')];};module[_0x99a8('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 3d20c85..21e0b02 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2695=['YYYY-MM-DD\x20HH:mm:ss','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','endtime','format'];(function(_0x2f2f99,_0x49f83b){var _0x54ded1=function(_0x4b1816){while(--_0x4b1816){_0x2f2f99['push'](_0x2f2f99['shift']());}};_0x54ded1(++_0x49f83b);}(_0x2695,0x126));var _0x5269=function(_0x2fdf57,_0x3309c2){_0x2fdf57=_0x2fdf57-0x0;var _0x26834f=_0x2695[_0x2fdf57];return _0x26834f;};'use strict';var util=require(_0x5269('0x0'));var _=require(_0x5269('0x1'));var moment=require(_0x5269('0x2'));function getSeconds(_0x3dc320,_0x243a9b){var _0x2a85d8=moment(_0x3dc320)[_0x5269('0x3')](0x0);var _0x47444c=moment(_0x243a9b)[_0x5269('0x3')](0x0);return _0x2a85d8[_0x5269('0x4')](_0x47444c,_0x5269('0x5'));}function AgentComplete(_0x14d988,_0x57e4a1){this['state']=0x4;this['statedesc']=_0x5269('0x6');this[_0x5269('0x7')]=_0x14d988[_0x5269('0x7')];this['type']=_0x14d988[_0x5269('0x8')];this['campaigntype']=_0x14d988['type']==='outbound'?_0x5269('0x9'):_0x14d988[_0x5269('0x8')];this[_0x5269('0xa')]=_0x14d988[_0x5269('0xa')];this['countcongestionretry']=_0x14d988[_0x5269('0xb')];this['countnoanswerretry']=_0x14d988[_0x5269('0xc')];this['countglobal']=_0x14d988[_0x5269('0xa')]+_0x14d988[_0x5269('0xb')]+_0x14d988[_0x5269('0xc')]+_0x14d988[_0x5269('0xd')]+_0x14d988['countdropretry']+_0x14d988[_0x5269('0xe')]+_0x14d988[_0x5269('0xf')]+_0x14d988['countagentrejectretry'];this[_0x5269('0xd')]=_0x14d988[_0x5269('0xd')];this[_0x5269('0x10')]=_0x14d988[_0x5269('0x10')];this[_0x5269('0xe')]=_0x14d988[_0x5269('0xe')];this['countmachineretry']=_0x14d988[_0x5269('0xf')];this['countagentrejectretry']=_0x14d988[_0x5269('0x11')];this[_0x5269('0x12')]=_0x57e4a1[_0x5269('0x12')];this['calleridname']=_0x14d988['name'];this[_0x5269('0x13')]=_0x14d988[_0x5269('0x14')];this[_0x5269('0x15')]=_0x14d988[_0x5269('0x15')];this[_0x5269('0x16')]=_0x14d988['responsetime'];this[_0x5269('0x17')]=_0x14d988[_0x5269('0x17')];this[_0x5269('0x18')]=moment()[_0x5269('0x19')](_0x5269('0x1a'));this['ringtime']=getSeconds(_0x14d988[_0x5269('0x16')],_0x14d988[_0x5269('0x15')]);this['holdtime']=getSeconds(_0x14d988[_0x5269('0x17')],_0x14d988['responsetime']);this['talktime']=getSeconds(this['endtime'],_0x14d988[_0x5269('0x17')]);this[_0x5269('0x9')]=_0x57e4a1[_0x5269('0x9')];this[_0x5269('0x1b')]=_0x57e4a1['membername'];this[_0x5269('0x1c')]=_0x57e4a1[_0x5269('0x1c')];this['callback']=_0x14d988['callback'];this[_0x5269('0x1d')]=_0x14d988['callbackuniqueid'];this[_0x5269('0x1e')]=_0x14d988['callbackat'];this[_0x5269('0x1f')]=_0x14d988[_0x5269('0x1f')];this[_0x5269('0x20')]=_0x14d988[_0x5269('0x20')];this[_0x5269('0x21')]=_0x14d988['ListId'];this[_0x5269('0x22')]=_0x14d988['UserId'];this[_0x5269('0x23')]=_0x14d988[_0x5269('0x23')];this[_0x5269('0x24')]=_0x14d988[_0x5269('0x24')];this['originatecalleridnum']=_0x14d988[_0x5269('0x25')]||'';this[_0x5269('0x26')]=_0x14d988['originatecalleridname']||'';}module[_0x5269('0x27')]=AgentComplete; \ No newline at end of file +var _0x9b97=['answertime','endtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','seconds','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','starttime','responsetime'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x9b97,0xe7));var _0x79b9=function(_0x49325d,_0x171f5e){_0x49325d=_0x49325d-0x0;var _0x5c80d3=_0x9b97[_0x49325d];return _0x5c80d3;};'use strict';var util=require('util');var _=require(_0x79b9('0x0'));var moment=require('moment');function getSeconds(_0x357587,_0x4406d7){var _0x299454=moment(_0x357587)['milliseconds'](0x0);var _0x3fdc4c=moment(_0x4406d7)['milliseconds'](0x0);return _0x299454[_0x79b9('0x1')](_0x3fdc4c,_0x79b9('0x2'));}function AgentComplete(_0x19e196,_0x5eb57d){this['state']=0x4;this[_0x79b9('0x3')]='Answer';this['scheduledat']=_0x19e196[_0x79b9('0x4')];this[_0x79b9('0x5')]=_0x19e196['type'];this['campaigntype']=_0x19e196[_0x79b9('0x5')]===_0x79b9('0x6')?_0x79b9('0x7'):_0x19e196[_0x79b9('0x5')];this[_0x79b9('0x8')]=_0x19e196[_0x79b9('0x8')];this[_0x79b9('0x9')]=_0x19e196[_0x79b9('0x9')];this[_0x79b9('0xa')]=_0x19e196[_0x79b9('0xa')];this[_0x79b9('0xb')]=_0x19e196['countbusyretry']+_0x19e196['countcongestionretry']+_0x19e196['countnoanswerretry']+_0x19e196[_0x79b9('0xc')]+_0x19e196[_0x79b9('0xd')]+_0x19e196[_0x79b9('0xe')]+_0x19e196[_0x79b9('0xf')]+_0x19e196[_0x79b9('0x10')];this['countnosuchnumberretry']=_0x19e196[_0x79b9('0xc')];this[_0x79b9('0xd')]=_0x19e196[_0x79b9('0xd')];this[_0x79b9('0xe')]=_0x19e196[_0x79b9('0xe')];this['countmachineretry']=_0x19e196[_0x79b9('0xf')];this[_0x79b9('0x10')]=_0x19e196[_0x79b9('0x10')];this[_0x79b9('0x11')]=_0x5eb57d[_0x79b9('0x11')];this['calleridname']=_0x19e196[_0x79b9('0x12')];this['calleridnum']=_0x19e196['number'];this[_0x79b9('0x13')]=_0x19e196[_0x79b9('0x13')];this['responsetime']=_0x19e196[_0x79b9('0x14')];this[_0x79b9('0x15')]=_0x19e196[_0x79b9('0x15')];this[_0x79b9('0x16')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x19e196['responsetime'],_0x19e196[_0x79b9('0x13')]);this['holdtime']=getSeconds(_0x19e196[_0x79b9('0x15')],_0x19e196[_0x79b9('0x14')]);this[_0x79b9('0x17')]=getSeconds(this[_0x79b9('0x16')],_0x19e196[_0x79b9('0x15')]);this[_0x79b9('0x7')]=_0x5eb57d[_0x79b9('0x7')];this['membername']=_0x5eb57d['membername'];this['reason']=_0x5eb57d['reason'];this['callback']=_0x19e196[_0x79b9('0x18')];this[_0x79b9('0x19')]=_0x19e196[_0x79b9('0x19')];this[_0x79b9('0x1a')]=_0x19e196['callbackat'];this[_0x79b9('0x1b')]=_0x19e196['recallme'];this[_0x79b9('0x1c')]=_0x19e196[_0x79b9('0x1c')];this[_0x79b9('0x1d')]=_0x19e196[_0x79b9('0x1d')];this[_0x79b9('0x1e')]=_0x19e196[_0x79b9('0x1e')];this[_0x79b9('0x1f')]=_0x19e196[_0x79b9('0x1f')];this['CampaignId']=_0x19e196[_0x79b9('0x20')];this[_0x79b9('0x21')]=_0x19e196['originatecalleridnum']||'';this[_0x79b9('0x22')]=_0x19e196['originatecalleridname']||'';}module[_0x79b9('0x23')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 80f1b7b..c9c334e 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf767=['callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime'];(function(_0x518c1b,_0x2cd854){var _0x5e6764=function(_0x4a3576){while(--_0x4a3576){_0x518c1b['push'](_0x518c1b['shift']());}};_0x5e6764(++_0x2cd854);}(_0xf767,0x76));var _0x7f76=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xf767[_0x55ff3e];return _0x2709eb;};'use strict';var util=require('util');var _=require(_0x7f76('0x0'));var moment=require(_0x7f76('0x1'));function getSeconds(_0x39149,_0x23f0c3){var _0x90398d=moment(_0x39149)['milliseconds'](0x0);var _0x396137=moment(_0x23f0c3)[_0x7f76('0x2')](0x0);return _0x90398d[_0x7f76('0x3')](_0x396137,_0x7f76('0x4'));}function Final(_0x5922e5){this[_0x7f76('0x5')]=_0x5922e5[_0x7f76('0x5')];this[_0x7f76('0x6')]=_0x5922e5[_0x7f76('0x6')];this[_0x7f76('0x7')]=_0x5922e5['type'];this[_0x7f76('0x8')]=_0x5922e5[_0x7f76('0x7')]===_0x7f76('0x9')?_0x7f76('0xa'):_0x5922e5['type'];this[_0x7f76('0xb')]=_0x5922e5['countbusyretry'];this[_0x7f76('0xc')]=_0x5922e5[_0x7f76('0xc')];this[_0x7f76('0xd')]=_0x5922e5[_0x7f76('0xd')];this[_0x7f76('0xe')]=_0x5922e5[_0x7f76('0xb')]+_0x5922e5['countcongestionretry']+_0x5922e5[_0x7f76('0xd')]+_0x5922e5[_0x7f76('0xf')]+_0x5922e5[_0x7f76('0x10')]+_0x5922e5[_0x7f76('0x11')]+_0x5922e5[_0x7f76('0x12')]+_0x5922e5['countagentrejectretry'];this[_0x7f76('0xf')]=_0x5922e5['countnosuchnumberretry'];this[_0x7f76('0x10')]=_0x5922e5[_0x7f76('0x10')];this['countabandonedretry']=_0x5922e5['countabandonedretry'];this['countmachineretry']=_0x5922e5[_0x7f76('0x12')];this[_0x7f76('0x13')]=_0x5922e5[_0x7f76('0x13')];this['queue']=_0x5922e5[_0x7f76('0xa')];this['calleridname']=_0x5922e5[_0x7f76('0x14')];this[_0x7f76('0x15')]=_0x5922e5[_0x7f76('0x15')];this['starttime']=_0x5922e5['starttime'];this['responsetime']=_0x5922e5['responsetime'];this['endtime']=_0x5922e5[_0x7f76('0x16')];this[_0x7f76('0x17')]=_0x5922e5[_0x7f76('0x17')]||0x0;this[_0x7f76('0x18')]=_0x5922e5['holdtime']||0x0;this[_0x7f76('0x19')]=_0x5922e5['talktime']||0x0;this[_0x7f76('0x1a')]=_0x5922e5[_0x7f76('0x1a')];this['callbackuniqueid']=_0x5922e5['callbackuniqueid'];this[_0x7f76('0x1b')]=_0x5922e5[_0x7f76('0x1b')];this['recallme']=_0x5922e5[_0x7f76('0x1c')];this['ContactId']=_0x5922e5[_0x7f76('0x1d')];this[_0x7f76('0x1e')]=_0x5922e5[_0x7f76('0x1e')];this[_0x7f76('0x1f')]=_0x5922e5[_0x7f76('0x1f')];this['VoiceQueueId']=_0x5922e5[_0x7f76('0x20')];this['CampaignId']=_0x5922e5['CampaignId'];this[_0x7f76('0x21')]=_0x5922e5[_0x7f76('0x21')]||'';this[_0x7f76('0x22')]=_0x5922e5['originatecalleridname']||'';}module[_0x7f76('0x23')]=Final; \ No newline at end of file +var _0x202c=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','ContactId','ListId'];(function(_0x3e25c7,_0x12b983){var _0x1208c5=function(_0x458119){while(--_0x458119){_0x3e25c7['push'](_0x3e25c7['shift']());}};_0x1208c5(++_0x12b983);}(_0x202c,0x178));var _0xc202=function(_0x4c96e4,_0x2fe2ea){_0x4c96e4=_0x4c96e4-0x0;var _0x2dd5d2=_0x202c[_0x4c96e4];return _0x2dd5d2;};'use strict';var util=require(_0xc202('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1cf3fd,_0x1ab6a1){var _0x27b3b2=moment(_0x1cf3fd)['milliseconds'](0x0);var _0x215161=moment(_0x1ab6a1)[_0xc202('0x1')](0x0);return _0x27b3b2[_0xc202('0x2')](_0x215161,_0xc202('0x3'));}function Final(_0x4b4368){this[_0xc202('0x4')]=_0x4b4368[_0xc202('0x4')];this['scheduledat']=_0x4b4368[_0xc202('0x5')];this['type']=_0x4b4368[_0xc202('0x6')];this[_0xc202('0x7')]=_0x4b4368[_0xc202('0x6')]===_0xc202('0x8')?_0xc202('0x9'):_0x4b4368[_0xc202('0x6')];this[_0xc202('0xa')]=_0x4b4368[_0xc202('0xa')];this[_0xc202('0xb')]=_0x4b4368[_0xc202('0xb')];this[_0xc202('0xc')]=_0x4b4368[_0xc202('0xc')];this[_0xc202('0xd')]=_0x4b4368['countbusyretry']+_0x4b4368[_0xc202('0xb')]+_0x4b4368[_0xc202('0xc')]+_0x4b4368[_0xc202('0xe')]+_0x4b4368[_0xc202('0xf')]+_0x4b4368[_0xc202('0x10')]+_0x4b4368[_0xc202('0x11')]+_0x4b4368[_0xc202('0x12')];this['countnosuchnumberretry']=_0x4b4368[_0xc202('0xe')];this[_0xc202('0xf')]=_0x4b4368['countdropretry'];this['countabandonedretry']=_0x4b4368['countabandonedretry'];this[_0xc202('0x11')]=_0x4b4368['countmachineretry'];this[_0xc202('0x12')]=_0x4b4368['countagentrejectretry'];this[_0xc202('0x9')]=_0x4b4368[_0xc202('0x9')];this[_0xc202('0x13')]=_0x4b4368[_0xc202('0x13')];this[_0xc202('0x14')]=_0x4b4368[_0xc202('0x14')];this[_0xc202('0x15')]=_0x4b4368['starttime'];this[_0xc202('0x16')]=_0x4b4368[_0xc202('0x16')];this[_0xc202('0x17')]=_0x4b4368['responsetime'];this['ringtime']=_0x4b4368[_0xc202('0x18')]||0x0;this[_0xc202('0x19')]=_0x4b4368[_0xc202('0x19')]||0x0;this[_0xc202('0x1a')]=_0x4b4368[_0xc202('0x1a')]||0x0;this['callback']=_0x4b4368['callback'];this[_0xc202('0x1b')]=_0x4b4368['callbackuniqueid'];this[_0xc202('0x1c')]=_0x4b4368[_0xc202('0x1c')];this['recallme']=_0x4b4368['recallme'];this[_0xc202('0x1d')]=_0x4b4368['ContactId'];this[_0xc202('0x1e')]=_0x4b4368[_0xc202('0x1e')];this[_0xc202('0x1f')]=_0x4b4368[_0xc202('0x1f')];this[_0xc202('0x20')]=_0x4b4368['VoiceQueueId'];this['CampaignId']=_0x4b4368[_0xc202('0x21')];this[_0xc202('0x22')]=_0x4b4368[_0xc202('0x22')]||'';this['originatecalleridname']=_0x4b4368[_0xc202('0x23')]||'';}module[_0xc202('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8cfdce1..c1d5b16 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8ef=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','moment','seconds','state','statedesc'];(function(_0x2f7c2e,_0x156bad){var _0x2289e9=function(_0x58693f){while(--_0x58693f){_0x2f7c2e['push'](_0x2f7c2e['shift']());}};_0x2289e9(++_0x156bad);}(_0xf8ef,0x14b));var _0xff8e=function(_0x1669d0,_0x599eb7){_0x1669d0=_0x1669d0-0x0;var _0x20c1af=_0xf8ef[_0x1669d0];return _0x20c1af;};'use strict';var util=require(_0xff8e('0x0'));var _=require('lodash');var moment=require(_0xff8e('0x1'));function getSeconds(_0x2a945a,_0x51234b){var _0x3942b3=moment(_0x2a945a)['milliseconds'](0x0);var _0x565479=moment(_0x51234b)['milliseconds'](0x0);return _0x3942b3['diff'](_0x565479,_0xff8e('0x2'));}function Hangup(_0x476c97,_0x50855b){this[_0xff8e('0x3')]=0x4;this[_0xff8e('0x4')]='Answer';this['scheduledat']=_0x476c97[_0xff8e('0x5')];this[_0xff8e('0x6')]=_0x476c97[_0xff8e('0x6')];this[_0xff8e('0x7')]=_0x476c97[_0xff8e('0x6')]==='outbound'?_0xff8e('0x8'):_0x476c97[_0xff8e('0x6')];this[_0xff8e('0x9')]=_0x476c97[_0xff8e('0x9')];this[_0xff8e('0xa')]=_0x476c97[_0xff8e('0xa')];this['countnoanswerretry']=_0x476c97[_0xff8e('0xb')];this[_0xff8e('0xc')]=_0x476c97[_0xff8e('0x9')]+_0x476c97[_0xff8e('0xa')]+_0x476c97[_0xff8e('0xb')]+_0x476c97['countnosuchnumberretry']+_0x476c97[_0xff8e('0xd')]+_0x476c97[_0xff8e('0xe')]+_0x476c97[_0xff8e('0xf')]+_0x476c97[_0xff8e('0x10')];this[_0xff8e('0x11')]=_0x476c97['countnosuchnumberretry'];this['countdropretry']=_0x476c97[_0xff8e('0xd')];this['countabandonedretry']=_0x476c97['countabandonedretry'];this[_0xff8e('0xf')]=_0x476c97[_0xff8e('0xf')];this[_0xff8e('0x10')]=_0x476c97[_0xff8e('0x10')];this[_0xff8e('0x12')]=_0x50855b['uniqueid'];this[_0xff8e('0x13')]=_0x476c97[_0xff8e('0x14')];this[_0xff8e('0x15')]=_0x476c97['number'];this[_0xff8e('0x16')]=_0x476c97[_0xff8e('0x16')];this['responsetime']=_0x476c97[_0xff8e('0x17')];this['endtime']=moment()[_0xff8e('0x18')](_0xff8e('0x19'));this[_0xff8e('0x1a')]=getSeconds(_0x476c97[_0xff8e('0x17')],_0x476c97[_0xff8e('0x16')]);this[_0xff8e('0x1b')]=0x0;this[_0xff8e('0x1c')]=getSeconds(this[_0xff8e('0x1d')],_0x476c97[_0xff8e('0x17')]);this[_0xff8e('0x8')]=_0x476c97[_0xff8e('0x8')];this[_0xff8e('0x1e')]=_0xff8e('0x1f');this['reason']=_0x50855b[_0xff8e('0x20')];this[_0xff8e('0x21')]=_0x476c97[_0xff8e('0x21')];this[_0xff8e('0x22')]=_0x476c97['callbackuniqueid'];this[_0xff8e('0x23')]=_0x476c97[_0xff8e('0x23')];this[_0xff8e('0x24')]=_0x476c97[_0xff8e('0x24')];this[_0xff8e('0x25')]=_0x476c97[_0xff8e('0x25')];this[_0xff8e('0x26')]=_0x476c97['ListId'];this[_0xff8e('0x27')]=_0x476c97[_0xff8e('0x27')];this[_0xff8e('0x28')]=_0x476c97[_0xff8e('0x28')];this[_0xff8e('0x29')]=_0x476c97[_0xff8e('0x29')];}module['exports']=Hangup; \ No newline at end of file +var _0x0986=['callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','reason','cause-txt','callback'];(function(_0x2cb8a1,_0x3c31e8){var _0xb5638=function(_0x3a00b9){while(--_0x3a00b9){_0x2cb8a1['push'](_0x2cb8a1['shift']());}};_0xb5638(++_0x3c31e8);}(_0x0986,0x194));var _0x6098=function(_0x5098c2,_0x240233){_0x5098c2=_0x5098c2-0x0;var _0x80f752=_0x0986[_0x5098c2];return _0x80f752;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6098('0x0'));function getSeconds(_0x225426,_0x48849a){var _0x32a408=moment(_0x225426)['milliseconds'](0x0);var _0x9eb457=moment(_0x48849a)[_0x6098('0x1')](0x0);return _0x32a408[_0x6098('0x2')](_0x9eb457,_0x6098('0x3'));}function Hangup(_0x288d86,_0x1d23e8){this[_0x6098('0x4')]=0x4;this[_0x6098('0x5')]=_0x6098('0x6');this['scheduledat']=_0x288d86[_0x6098('0x7')];this['type']=_0x288d86[_0x6098('0x8')];this[_0x6098('0x9')]=_0x288d86[_0x6098('0x8')]===_0x6098('0xa')?_0x6098('0xb'):_0x288d86[_0x6098('0x8')];this[_0x6098('0xc')]=_0x288d86[_0x6098('0xc')];this[_0x6098('0xd')]=_0x288d86[_0x6098('0xd')];this['countnoanswerretry']=_0x288d86['countnoanswerretry'];this['countglobal']=_0x288d86['countbusyretry']+_0x288d86[_0x6098('0xd')]+_0x288d86[_0x6098('0xe')]+_0x288d86['countnosuchnumberretry']+_0x288d86['countdropretry']+_0x288d86['countabandonedretry']+_0x288d86[_0x6098('0xf')]+_0x288d86['countagentrejectretry'];this[_0x6098('0x10')]=_0x288d86['countnosuchnumberretry'];this['countdropretry']=_0x288d86[_0x6098('0x11')];this[_0x6098('0x12')]=_0x288d86[_0x6098('0x12')];this[_0x6098('0xf')]=_0x288d86['countmachineretry'];this['countagentrejectretry']=_0x288d86[_0x6098('0x13')];this[_0x6098('0x14')]=_0x1d23e8['uniqueid'];this['calleridname']=_0x288d86[_0x6098('0x15')];this[_0x6098('0x16')]=_0x288d86[_0x6098('0x17')];this['starttime']=_0x288d86[_0x6098('0x18')];this[_0x6098('0x19')]=_0x288d86['responsetime'];this[_0x6098('0x1a')]=moment()[_0x6098('0x1b')](_0x6098('0x1c'));this['ringtime']=getSeconds(_0x288d86[_0x6098('0x19')],_0x288d86['starttime']);this[_0x6098('0x1d')]=0x0;this[_0x6098('0x1e')]=getSeconds(this['endtime'],_0x288d86[_0x6098('0x19')]);this['queue']=_0x288d86[_0x6098('0xb')];this[_0x6098('0x1f')]=_0x6098('0x20');this[_0x6098('0x21')]=_0x1d23e8[_0x6098('0x22')];this[_0x6098('0x23')]=_0x288d86['callback'];this[_0x6098('0x24')]=_0x288d86[_0x6098('0x24')];this[_0x6098('0x25')]=_0x288d86['callbackat'];this['recallme']=_0x288d86[_0x6098('0x26')];this[_0x6098('0x27')]=_0x288d86['ContactId'];this[_0x6098('0x28')]=_0x288d86[_0x6098('0x28')];this['UserId']=_0x288d86['UserId'];this[_0x6098('0x29')]=_0x288d86[_0x6098('0x29')];this[_0x6098('0x2a')]=_0x288d86[_0x6098('0x2a')];}module[_0x6098('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 1e0f6f2..7498b2b 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe10=['countmachineretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x264da3,_0x5b79d6){var _0x3af924=function(_0x24defa){while(--_0x24defa){_0x264da3['push'](_0x264da3['shift']());}};_0x3af924(++_0x5b79d6);}(_0xbe10,0x1d2));var _0x0be1=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xbe10[_0x29d94e];return _0x106237;};'use strict';var util=require(_0x0be1('0x0'));var _=require('lodash');var moment=require(_0x0be1('0x1'));function getSeconds(_0x423f8b,_0x423398){var _0x424d5f=moment(_0x423f8b)['milliseconds'](0x0);var _0x2bd151=moment(_0x423398)[_0x0be1('0x2')](0x0);return _0x424d5f[_0x0be1('0x3')](_0x2bd151,_0x0be1('0x4'));}function History(_0x124ae3){this[_0x0be1('0x5')]=_0x124ae3[_0x0be1('0x5')];this['scheduledat']=_0x124ae3[_0x0be1('0x6')]||undefined;this[_0x0be1('0x7')]=_0x124ae3[_0x0be1('0x7')];this[_0x0be1('0x8')]=_0x124ae3[_0x0be1('0x7')]==='outbound'?'queue':_0x124ae3[_0x0be1('0x7')];this[_0x0be1('0x9')]=_0x124ae3['countbusyretry'];this[_0x0be1('0xa')]=_0x124ae3[_0x0be1('0xa')];this['countnoanswerretry']=_0x124ae3['countnoanswerretry'];this['countglobal']=_0x124ae3[_0x0be1('0x9')]+_0x124ae3['countcongestionretry']+_0x124ae3[_0x0be1('0xb')]+_0x124ae3[_0x0be1('0xc')]+_0x124ae3[_0x0be1('0xd')]+_0x124ae3[_0x0be1('0xe')]+_0x124ae3['countmachineretry']+_0x124ae3['countagentrejectretry'];this[_0x0be1('0xc')]=_0x124ae3[_0x0be1('0xc')];this[_0x0be1('0xd')]=_0x124ae3[_0x0be1('0xd')];this[_0x0be1('0xe')]=_0x124ae3[_0x0be1('0xe')];this['countmachineretry']=_0x124ae3[_0x0be1('0xf')];this['countagentrejectretry']=_0x124ae3['countagentrejectretry'];this[_0x0be1('0x10')]=_0x124ae3['queue'];this['calleridname']=_0x124ae3[_0x0be1('0x11')];this[_0x0be1('0x12')]=_0x124ae3[_0x0be1('0x13')];this[_0x0be1('0x14')]=_0x124ae3[_0x0be1('0x14')];this[_0x0be1('0x15')]=_0x124ae3[_0x0be1('0x15')];this[_0x0be1('0x16')]=_0x124ae3[_0x0be1('0x15')];this[_0x0be1('0x17')]=getSeconds(_0x124ae3[_0x0be1('0x15')],_0x124ae3['starttime']);this[_0x0be1('0x18')]=0x0;this[_0x0be1('0x19')]=0x0;this[_0x0be1('0x1a')]=_0x124ae3[_0x0be1('0x1a')];this[_0x0be1('0x1b')]=_0x124ae3['callbackuniqueid'];this[_0x0be1('0x1c')]=_0x124ae3[_0x0be1('0x1c')];this[_0x0be1('0x1d')]=_0x124ae3[_0x0be1('0x1d')];this[_0x0be1('0x1e')]=_0x124ae3['ContactId'];this['ListId']=_0x124ae3[_0x0be1('0x1f')];this[_0x0be1('0x20')]=_0x124ae3[_0x0be1('0x20')];this[_0x0be1('0x21')]=_0x124ae3[_0x0be1('0x21')];this[_0x0be1('0x22')]=_0x124ae3[_0x0be1('0x22')];this[_0x0be1('0x23')]=_0x124ae3['originatecalleridnum']||'';this['originatecalleridname']=_0x124ae3[_0x0be1('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0xd561=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x10f735,_0x25c954){var _0x1ae684=function(_0x162196){while(--_0x162196){_0x10f735['push'](_0x10f735['shift']());}};_0x1ae684(++_0x25c954);}(_0xd561,0xc7));var _0x1d56=function(_0x3884c4,_0x49e5c4){_0x3884c4=_0x3884c4-0x0;var _0x4ffe67=_0xd561[_0x3884c4];return _0x4ffe67;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x5cf740,_0x2aad12){var _0x55fe14=moment(_0x5cf740)[_0x1d56('0x0')](0x0);var _0x1f3ee0=moment(_0x2aad12)[_0x1d56('0x0')](0x0);return _0x55fe14['diff'](_0x1f3ee0,_0x1d56('0x1'));}function History(_0xa1c5e9){this['uniqueid']=_0xa1c5e9[_0x1d56('0x2')];this[_0x1d56('0x3')]=_0xa1c5e9[_0x1d56('0x3')]||undefined;this[_0x1d56('0x4')]=_0xa1c5e9[_0x1d56('0x4')];this['campaigntype']=_0xa1c5e9[_0x1d56('0x4')]===_0x1d56('0x5')?'queue':_0xa1c5e9[_0x1d56('0x4')];this['countbusyretry']=_0xa1c5e9[_0x1d56('0x6')];this['countcongestionretry']=_0xa1c5e9[_0x1d56('0x7')];this[_0x1d56('0x8')]=_0xa1c5e9[_0x1d56('0x8')];this['countglobal']=_0xa1c5e9[_0x1d56('0x6')]+_0xa1c5e9[_0x1d56('0x7')]+_0xa1c5e9[_0x1d56('0x8')]+_0xa1c5e9[_0x1d56('0x9')]+_0xa1c5e9[_0x1d56('0xa')]+_0xa1c5e9[_0x1d56('0xb')]+_0xa1c5e9[_0x1d56('0xc')]+_0xa1c5e9[_0x1d56('0xd')];this[_0x1d56('0x9')]=_0xa1c5e9[_0x1d56('0x9')];this[_0x1d56('0xa')]=_0xa1c5e9[_0x1d56('0xa')];this[_0x1d56('0xb')]=_0xa1c5e9[_0x1d56('0xb')];this[_0x1d56('0xc')]=_0xa1c5e9['countmachineretry'];this[_0x1d56('0xd')]=_0xa1c5e9['countagentrejectretry'];this['queue']=_0xa1c5e9[_0x1d56('0xe')];this[_0x1d56('0xf')]=_0xa1c5e9[_0x1d56('0x10')];this[_0x1d56('0x11')]=_0xa1c5e9[_0x1d56('0x12')];this[_0x1d56('0x13')]=_0xa1c5e9['starttime'];this[_0x1d56('0x14')]=_0xa1c5e9[_0x1d56('0x14')];this[_0x1d56('0x15')]=_0xa1c5e9['responsetime'];this[_0x1d56('0x16')]=getSeconds(_0xa1c5e9[_0x1d56('0x14')],_0xa1c5e9[_0x1d56('0x13')]);this[_0x1d56('0x17')]=0x0;this[_0x1d56('0x18')]=0x0;this[_0x1d56('0x19')]=_0xa1c5e9['callback'];this[_0x1d56('0x1a')]=_0xa1c5e9[_0x1d56('0x1a')];this['callbackat']=_0xa1c5e9[_0x1d56('0x1b')];this[_0x1d56('0x1c')]=_0xa1c5e9[_0x1d56('0x1c')];this[_0x1d56('0x1d')]=_0xa1c5e9['ContactId'];this[_0x1d56('0x1e')]=_0xa1c5e9[_0x1d56('0x1e')];this[_0x1d56('0x1f')]=_0xa1c5e9[_0x1d56('0x1f')];this['VoiceQueueId']=_0xa1c5e9[_0x1d56('0x20')];this[_0x1d56('0x21')]=_0xa1c5e9[_0x1d56('0x21')];this['originatecalleridnum']=_0xa1c5e9[_0x1d56('0x22')]||'';this[_0x1d56('0x23')]=_0xa1c5e9[_0x1d56('0x23')]||'';}module[_0x1d56('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index d140a31..d6f9f70 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 _0x068e=['length','unlockRR','[booked][RR]','Agent:\x20','pick','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','interval','content','indexOf','true','iftime\x20%s,%s','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','throttle','filter','online','reachable','map','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','variables','SIP/%s/%s%s','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','callProgressDetecting','[callProgressDetecting]\x20','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','averageHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','booked','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','ACTIVE','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','uuid','moment','md5','ioredis','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/setting','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','statedesc','endtime','clearZombieChannels','[uniqueid]','actions','[actions]','enqueue','isNil','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','checkIsBlackList','catch','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','notFound','saveInDb','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact]','SIP/%s','unmonitored','variable','xcally-motion-dialer','value','HANGUP','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','dialAMDActive','state','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countabandonedretry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','starttime','calleridnum','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','calleridname','actionid','locked','paused','stateinterface','queueBooked','push','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x068e,0xfa));var _0xe068=function(_0xbfc720,_0x4357f8){_0xbfc720=_0xbfc720-0x0;var _0x15f6c1=_0x068e[_0xbfc720];return _0x15f6c1;};'use strict';var util=require('util');var _=require(_0xe068('0x0'));var uuid=require(_0xe068('0x1'));var moment=require(_0xe068('0x2'));var rr=require('rr');var md5=require(_0xe068('0x3'));var Redis=require(_0xe068('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0xe068('0x5'))(_0xe068('0x6'));var loggerBooked=require(_0xe068('0x5'))('booked');var loggerPredictive=require(_0xe068('0x5'))(_0xe068('0x7'));var loggerPredictiveCalls=require(_0xe068('0x5'))(_0xe068('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xe068('0x9'));var ami=require('../ami');config[_0xe068('0xa')]=_[_0xe068('0xb')](config[_0xe068('0xa')],{'host':_0xe068('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xe068('0xd'));var cmHopperHistory=require(_0xe068('0xe'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xe068('0xf'));var RpcSetting=require(_0xe068('0x10'));var Action=require('./action');var History=require(_0xe068('0x11'));var Final=require(_0xe068('0x12'));var AgentComplete=require(_0xe068('0x13'));var QueueCallerAbandon=require(_0xe068('0x14'));var Hangup=require(_0xe068('0x15'));var ipAgi=process[_0xe068('0x16')][_0xe068('0x17')]||_0xe068('0x18');var strategy={'rrmemory':_0xe068('0x19'),'roundrobin':_0xe068('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe068('0x1b')]['enqueue']=function(_0x4db049){this[_0xe068('0x1c')]=this['tail']?this[_0xe068('0x1c')]['finally'](_0x4db049):_0x4db049();};function Dialer(_0x174690,_0x2a2da5){this[_0xe068('0x1d')]=new Sequence();this['preview']=_0x2a2da5;this[_0xe068('0x1e')]=_0x174690[_0xe068('0x1e')];this[_0xe068('0x1f')]=_0x174690[_0xe068('0x1f')];this[_0xe068('0x20')]=_0x174690['agents'];this['trunks']=_0x174690[_0xe068('0x21')];this[_0xe068('0x22')]=config['maxNumberOriginate']||0x2;this[_0xe068('0x23')]={};this['actions']={};this[_0xe068('0x24')]={};this[_0xe068('0x25')]={};this['optionPredictive']={};this[_0xe068('0x26')]={};this[_0xe068('0x27')]={};this[_0xe068('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xe068('0x29')][_0xe068('0x2a')](this));ami['on'](_0xe068('0x2b'),this[_0xe068('0x2c')]['bind'](this));ami['on']('originateresponse',this[_0xe068('0x2d')][_0xe068('0x2a')](this));ami['on'](_0xe068('0x2e'),this[_0xe068('0x2f')]['bind'](this));ami['on']('custom:queuesummary',this[_0xe068('0x9')][_0xe068('0x2a')](this));ami['on'](_0xe068('0x30'),this[_0xe068('0x31')][_0xe068('0x2a')](this));ami['on'](_0xe068('0x32'),this['syncHangup'][_0xe068('0x2a')](this));ami['on'](_0xe068('0x33'),this[_0xe068('0x34')][_0xe068('0x2a')](this));ami['on'](_0xe068('0x35'),this[_0xe068('0x36')]['bind'](this));ami['on'](_0xe068('0x37'),this[_0xe068('0x38')][_0xe068('0x2a')](this));ami['on']('queuestatuscomplete',this[_0xe068('0x39')][_0xe068('0x2a')](this));this[_0xe068('0x3a')]();this[_0xe068('0x3b')]();RpcSetting[_0xe068('0x3c')]()[_0xe068('0x3d')](function(_0x3431a1){previewRecallmeReminderInterval=_0x3431a1[_0xe068('0x3e')];});}function isNotNull(_0x434d97){return _0x434d97!==null&&!_[_0xe068('0x3f')](_0x434d97);}function checkIsLoggedIn(_0x55794d,_0x55e10f){return function(){if(_0x55e10f<=0x0){_0x55794d[_0xe068('0x40')]=_0xe068('0x41');throw _0x55794d['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0xd58b99){return _0xd58b99;}function checkIsActive(_0x1e4841,_0x21e990){return function(){if(!isActive(_0x21e990)){_0x1e4841[_0xe068('0x40')]='NOT_ACTIVE';throw _0x1e4841[_0xe068('0x42')]+_0xe068('0x43');}};}function checkInterval(_0x39adb8){return function(){if(!isNotNull(_0x39adb8[_0xe068('0x44')])){_0x39adb8[_0xe068('0x40')]=_0xe068('0x45');throw _0x39adb8[_0xe068('0x42')]+_0xe068('0x46');}if(!isNotNull(_0x39adb8[_0xe068('0x44')][_0xe068('0x47')])){_0x39adb8[_0xe068('0x40')]=_0xe068('0x45');throw _0x39adb8[_0xe068('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xe068('0x48')](_0x39adb8[_0xe068('0x44')][_0xe068('0x47')]))){_0x39adb8[_0xe068('0x40')]=_0xe068('0x45');throw _0x39adb8[_0xe068('0x42')]+_0xe068('0x46');}};}function msgResponse(_0x38f713,_0x13568e,_0x101a4a){return{'action':_0x38f713,'response':_0x13568e,'message':_0x101a4a,'stack':_0x101a4a};}function myreject(_0x4097a8){return function(_0x1cb0ca){return _0x4097a8(msgResponse(_0xe068('0x49'),_0xe068('0x4a'),JSON[_0xe068('0x4b')](_0x1cb0ca)));};}function getSeconds(_0x518e23,_0x1b19ae){var _0x2d922d=moment(_0x518e23)[_0xe068('0x4c')](0x0);var _0x534591=moment(_0x1b19ae)[_0xe068('0x4c')](0x0);return _0x2d922d[_0xe068('0x4d')](_0x534591,_0xe068('0x4e'));}function emit(_0x46387b,_0x7077c3,_0x4f979e){io['to'](_0x46387b)[_0xe068('0x4f')](_0x7077c3,_0x4f979e);}function emitVoiceQueueSummary(_0x36c4e0){if(_0x36c4e0[_0xe068('0x50')]===_0xe068('0x51')){var _0x431c06={'id':_0x36c4e0['id'],'name':_0x36c4e0[_0xe068('0x42')],'strategy':_0x36c4e0[_0xe068('0x52')],'answered':_0x36c4e0[_0xe068('0x53')],'available':_0x36c4e0[_0xe068('0x54')],'loggedIn':_0x36c4e0['loggedIn'],'pTalking':_0x36c4e0[_0xe068('0x55')],'sumBillable':_0x36c4e0[_0xe068('0x56')],'sumDuration':_0x36c4e0[_0xe068('0x57')],'sumHoldTime':_0x36c4e0[_0xe068('0x58')]||0x0,'talking':_0x36c4e0[_0xe068('0x59')],'total':_0x36c4e0['total'],'type':_0x36c4e0[_0xe068('0x50')],'unmanaged':_0x36c4e0[_0xe068('0x5a')],'abandoned':_0x36c4e0[_0xe068('0x5b')],'waiting':_0x36c4e0[_0xe068('0x5c')],'loggedInDb':_0x36c4e0[_0xe068('0x5d')],'dialActive':_0x36c4e0[_0xe068('0x5e')],'dialMethod':_0x36c4e0['dialMethod'],'dialOriginateCallerIdName':_0x36c4e0[_0xe068('0x5f')],'dialOriginateCallerIdNumber':_0x36c4e0[_0xe068('0x60')],'dialOriginateTimeout':_0x36c4e0[_0xe068('0x61')],'dialPrefix':_0x36c4e0[_0xe068('0x62')],'outboundAnswerAgiCallsDay':_0x36c4e0[_0xe068('0x63')],'outboundAnswerCallsDay':_0x36c4e0[_0xe068('0x64')],'outboundBlacklistCallsDay':_0x36c4e0['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x36c4e0[_0xe068('0x65')],'outboundCongestionCallsDay':_0x36c4e0['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x36c4e0[_0xe068('0x66')],'outboundDropCallsDayCallersExit':_0x36c4e0[_0xe068('0x67')],'outboundDropCallsDayTimeout':_0x36c4e0[_0xe068('0x68')],'outboundNoAnswerCallsDay':_0x36c4e0['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x36c4e0['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x36c4e0[_0xe068('0x69')],'outboundReCallsDay':_0x36c4e0[_0xe068('0x6a')],'outboundRejectCallsDay':_0x36c4e0[_0xe068('0x6b')],'outboundUnknownCallsDay':_0x36c4e0[_0xe068('0x6c')],'predictiveIntervalAnsweredCalls':_0x36c4e0['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x36c4e0[_0xe068('0x6d')],'predictiveIntervalAvgTalktime':_0x36c4e0[_0xe068('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x36c4e0[_0xe068('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x36c4e0['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x36c4e0[_0xe068('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x36c4e0['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x36c4e0['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x36c4e0[_0xe068('0x71')],'predictiveIntervalPauses':_0x36c4e0['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x36c4e0[_0xe068('0x72')],'predictiveIntervalTotalCalls':_0x36c4e0['predictiveIntervalTotalCalls'],'message':_0x36c4e0['message'],'originated':_0x36c4e0['originated'],'erlangCalls':_0x36c4e0[_0xe068('0x73')],'erlangCallToSecond':_0x36c4e0[_0xe068('0x74')],'erlangAbandonmentRate':_0x36c4e0[_0xe068('0x75')],'erlangBusyFactor':_0x36c4e0[_0xe068('0x76')],'startPredictive':_0x36c4e0[_0xe068('0x26')],'startProgressive':_0x36c4e0[_0xe068('0x27')]};if(_0x36c4e0[_0xe068('0x77')]){_0x431c06[_0xe068('0x77')]={'id':_0x36c4e0['Trunk']['id'],'name':_0x36c4e0[_0xe068('0x77')][_0xe068('0x42')],'active':_0x36c4e0[_0xe068('0x77')][_0xe068('0x78')],'callerid':_0x36c4e0[_0xe068('0x77')][_0xe068('0x79')]};}if(_0x36c4e0[_0xe068('0x44')]){_0x431c06[_0xe068('0x44')]={'id':_0x36c4e0[_0xe068('0x44')]['id'],'name':_0x36c4e0[_0xe068('0x44')][_0xe068('0x42')]};}var _0x42f4b3=md5(JSON[_0xe068('0x4b')](_0x431c06));if(_0x36c4e0[_0xe068('0x3')]!==_0x42f4b3){_0x36c4e0[_0xe068('0x3')]=_0x42f4b3;emit(util[_0xe068('0x7a')]('voice:queue:%s',_0x431c06[_0xe068('0x42')]),_0xe068('0x7b'),_0x431c06);}}}function emitCampaignSummary(_0x19feb3){if(_0x19feb3['type']===_0xe068('0x7c')){emit(util[_0xe068('0x7a')](_0xe068('0x7d'),_0x19feb3[_0xe068('0x42')]),_0xe068('0x7e'),_0x19feb3);}}function checkGetDataPredictive(_0x136cbb){if(isNotNull(_0x136cbb)&&!_[_0xe068('0x48')](_0x136cbb)){loggerPredictive[_0xe068('0x7f')](_0xe068('0x80'));loggerPredictive[_0xe068('0x7f')](_0xe068('0x81'),_0x136cbb[_0xe068('0x82')]);loggerPredictive[_0xe068('0x7f')](_0xe068('0x83'),_0x136cbb['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xe068('0x7f')](_0xe068('0x84'),_0x136cbb['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe068('0x7f')](_0xe068('0x85'),_0x136cbb[_0xe068('0x6f')]);loggerPredictive[_0xe068('0x7f')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x136cbb[_0xe068('0x6d')]);loggerPredictive[_0xe068('0x7f')](_0xe068('0x86'),_0x136cbb['predictiveIntervalAvgTalktime']);loggerPredictive[_0xe068('0x7f')](_0xe068('0x87'));if(_0x136cbb['predictiveIntervalTotalCalls']>0x0){if(!_[_0xe068('0x3f')](_0x136cbb[_0xe068('0x6e')])&&_0x136cbb['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0xe068('0x88'));if(!_[_0xe068('0x3f')](_0x136cbb[_0xe068('0x6d')])&&_0x136cbb[_0xe068('0x6d')]>0x0){return!![];}loggerPredictive[_0xe068('0x7f')](_0xe068('0x89'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0xe068('0x8a'));}return![];}function mergeDataErlangB(_0x145f05){return function(_0x4d5e27){loggerPredictive['info'](_0xe068('0x8b'));loggerPredictive[_0xe068('0x7f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d5e27[_0xe068('0x73')]);loggerPredictive[_0xe068('0x7f')](_0xe068('0x8c'),_0x4d5e27['erlangCallToSecond']);loggerPredictive['info'](_0xe068('0x8d'),_0x4d5e27['erlangAbandonmentRate']);loggerPredictive[_0xe068('0x7f')](_0xe068('0x8e'),_0x4d5e27[_0xe068('0x76')]);loggerPredictive[_0xe068('0x7f')](_0xe068('0x8d'),_0x4d5e27[_0xe068('0x75')]);loggerPredictive[_0xe068('0x7f')](_0xe068('0x87'));_[_0xe068('0x8f')](_0x145f05,_0x4d5e27);};}function getDiff(_0x5b7c10){var _0x4f65fb=moment()['milliseconds'](0x0);var _0x4a45ce=moment(_0x5b7c10)[_0xe068('0x4c')](0x0);return _0x4f65fb[_0xe068('0x4d')](_0x4a45ce,_0xe068('0x4e'));}function ifInterval(_0x143d37,_0xac59dd){if(_[_0xe068('0x3f')](_0xac59dd)){return![];}return getDiff(_0xac59dd)<_0x143d37*0x3c;}function freeVariablesPredictive(_0x1a5e9a){if(isNotNull(_0x1a5e9a)){if(!_[_0xe068('0x3f')](_0x1a5e9a['startProgressive'])){_0x1a5e9a[_0xe068('0x27')]=undefined;loggerPredictive[_0xe068('0x7f')](_0x1a5e9a['name'],_0xe068('0x90'));}if(!_[_0xe068('0x3f')](_0x1a5e9a[_0xe068('0x26')])){_0x1a5e9a['startPredictive']=undefined;loggerPredictive['info'](_0x1a5e9a[_0xe068('0x42')],_0xe068('0x91'));}if(!_['isUndefined'](_0x1a5e9a[_0xe068('0x92')])){clearInterval(_0x1a5e9a[_0xe068('0x92')]);_0x1a5e9a[_0xe068('0x92')]=undefined;loggerPredictive[_0xe068('0x7f')](_0x1a5e9a[_0xe068('0x42')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x15e93d,_0x1960a5){if(_0x1960a5===0x0){return 0x0;}var _0x30d609=0x1;for(var _0x4acb0b=0x1;_0x4acb0b<=_0x1960a5;_0x4acb0b+=0x1){_0x30d609=0x1+_0x30d609*_0x4acb0b/_0x15e93d;}return 0x1/_0x30d609;}function isVoiceQueueOutbound(_0x48635e){return _0x48635e==='outbound';}function isNotPreview(_0x2f2aa8){return _0x2f2aa8!==_0xe068('0x93');}function isCampaignIvr(_0xd52f8a){return _0xd52f8a===_0xe068('0x7c');}function getCallerId(_0x3cc319,_0x4c5e76,_0x1b31d6){if(!_[_0xe068('0x3f')](_0x1b31d6)&&typeof _0x1b31d6===_0xe068('0x94')&&!_['isEmpty'](_0x1b31d6)){if(!_[_0xe068('0x3f')](_0x4c5e76)&&typeof _0x4c5e76===_0xe068('0x94')&&!_[_0xe068('0x48')](_0x4c5e76)){return util[_0xe068('0x7a')]('\x22%s\x22\x20<%s>',_0x4c5e76,_0x1b31d6);}return util[_0xe068('0x7a')](_0xe068('0x95'),_0x1b31d6,_0x1b31d6);}if(!_[_0xe068('0x3f')](_0x3cc319)&&typeof _0x3cc319===_0xe068('0x94')&&!_[_0xe068('0x48')](_0x3cc319)){return _0x3cc319;}return _0xe068('0x96');}function loggerCatchQueueSummary(_0x3d29ad,_0x53334c){return function(_0x320e68){freeVariablesPredictive(_0x53334c);emitVoiceQueueSummary(_0x53334c);emitCampaignSummary(_0x53334c);loggerSyncQueueSummary[_0xe068('0x97')](_0x3d29ad,util[_0xe068('0x98')](_0x320e68,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5b1091,_0x5d1b1d){return function(_0x108254){loggerPredictive[_0xe068('0x99')](_0x5d1b1d['name'],_0x5b1091);loggerPredictive[_0xe068('0x99')](_0x108254[_0xe068('0x9a')]);freeVariablesPredictive(_0x5d1b1d);};}function loggerCatch(_0x4b7c09){return function(_0x1f754c){logger[_0xe068('0x99')](_0x4b7c09,util[_0xe068('0x98')](_0x1f754c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x182659){return _0x182659&&!_['isUndefined'](_0x182659)&&_0x182659['length']>0x0;}function decremetOriginate(_0x65ae6){if(!_['isUndefined'](_0x65ae6)&&_0x65ae6!==null){if(typeof _0x65ae6[_0xe068('0x9b')]!==_0xe068('0x9c')){if(_0x65ae6[_0xe068('0x9b')]>0x0){_0x65ae6[_0xe068('0x9b')]-=0x1;}else{logger[_0xe068('0x99')](_0xe068('0x9d'));}}}else{logger[_0xe068('0x99')](_0xe068('0x9e'));}}function checkContactLowerLimitOriginate(_0xb3d4c,_0x196eb3,_0x2d1885){if(_0x196eb3>_0x2d1885){for(var _0x281c24=0x0;_0x281c24<_0x196eb3-_0x2d1885;_0x281c24+=0x1){decremetOriginate(_0xb3d4c);}}}function loggerGetContactDialer(_0x352c53,_0xac5a1b,_0x458e00){return function(_0x29c4fc){checkContactLowerLimitOriginate(_0xac5a1b,_0x458e00,0x0);logger[_0xe068('0x99')](_0x352c53,util['inspect'](_0x29c4fc,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3f8a94){return function(_0xf9a828){if(isNotNull(_0xf9a828)&&isNotNull(_0xf9a828[0x0])){if(_0xf9a828[0x0]['contactsRescheduled']>0x0){_0x3f8a94[_0xe068('0x40')]=_0xe068('0x9f');logger[_0xe068('0x7f')](_0xe068('0xa0')+_0x3f8a94[_0xe068('0x42')],_0xf9a828[0x0]['contactsRescheduled'],_0xe068('0xa1'));}else{_0x3f8a94['message']=_0xe068('0xa2');logger[_0xe068('0x7f')](_0xe068('0xa3')+_0x3f8a94['name']);}}};}function notSendMessagesQueue(_0x471097){if(_0x471097[_0xe068('0xa4')]){freeVariablesPredictive(_0x471097);if(_0x471097[_0xe068('0x9b')]===0x0&&_0x471097['talking']===0x0&&_0x471097['waiting']===0x0&&(_0x471097[_0xe068('0x55')]||0x0)===0x0){_0x471097[_0xe068('0xa4')]=![];_0x471097[_0xe068('0x54')]=0x0;_0x471097[_0xe068('0x40')]=_0xe068('0xa5');loggerSyncQueueSummary[_0xe068('0x97')](_0xe068('0xa6'),_0x471097[_0xe068('0x42')],_0xe068('0xa7'));}else{_0x471097[_0xe068('0x40')]='IS_DISACTIVED';loggerSyncQueueSummary['debug'](_0xe068('0xa6'),_0x471097[_0xe068('0x42')],_0xe068('0xa8'));}emitVoiceQueueSummary(_0x471097);}}function notSendMessagesCampaign(_0x3df741){if(_0x3df741[_0xe068('0xa4')]){if(_0x3df741['originated']===0x0){_0x3df741['sendMessageOneNotActive']=![];_0x3df741[_0xe068('0x40')]=_0xe068('0xa5');loggerSyncQueueSummary['debug'](_0xe068('0xa9'),_0x3df741['name'],_0xe068('0xa7'));}else{_0x3df741['message']=_0xe068('0xaa');loggerSyncQueueSummary[_0xe068('0x97')](_0xe068('0xa9'),_0x3df741[_0xe068('0x42')],_0xe068('0xa8'));}emitCampaignSummary(_0x3df741);}}function createObjHistory(_0x2505c2,_0x219109,_0x8cc43a,_0x1f1cf9,_0x1c623b){_0x2505c2[_0xe068('0x40')]=_0x8cc43a;var _0x371b74=new Action(_0x2505c2,_0x219109);var _0x4b7c38=new History(_0x371b74);_0x4b7c38['state']=_0x1f1cf9;_0x4b7c38[_0xe068('0xab')]=_0x1c623b;_0x4b7c38[_0xe068('0xac')]=_0x371b74['starttime'];return _0x4b7c38;}Dialer['prototype'][_0xe068('0x3b')]=function(){var _0x326137=this;setInterval(function(){_0x326137[_0xe068('0xad')](_0x326137[_0xe068('0x25')],_0xe068('0xae'));_0x326137[_0xe068('0xad')](_0x326137[_0xe068('0xaf')],_0xe068('0xb0'));},0x32c8);};Dialer[_0xe068('0x1b')]['clearZombieChannels']=function(_0x1e22cb,_0x254369){var _0x393277=this;for(var _0x5487bb in _0x1e22cb){if(typeof _0x1e22cb[_0x5487bb]!==_0xe068('0x9c')){this[_0xe068('0x1d')][_0xe068('0xb1')](function(){if(!_[_0xe068('0xb2')](_0x1e22cb[_0x5487bb])){return ami['Action']({'action':_0xe068('0xb3'),'channel':_0x1e22cb[_0x5487bb][_0xe068('0xb4')]})['catch'](function(_0x1f9d9d){if(_0x1f9d9d[_0xe068('0x40')]===_0xe068('0xb5')){setTimeout(function(){if(_0x1e22cb[_0x5487bb]&&_0x1e22cb[_0x5487bb][_0xe068('0x50')]!==_0xe068('0x7c')){_0x393277[_0xe068('0xb6')](_0x393277[_0xe068('0x1e')][_0x1e22cb[_0x5487bb][_0xe068('0xb7')]]);logger['error'](_0xe068('0xb8'),_0x254369,_0x5487bb,_0x1e22cb[_0x5487bb]['queue']);delete _0x1e22cb[_0x5487bb];}if(_0x1e22cb[_0x5487bb]&&_0x1e22cb[_0x5487bb][_0xe068('0x50')]===_0xe068('0x7c')){_0x393277[_0xe068('0xb6')](_0x393277[_0xe068('0x1f')][_0x1e22cb[_0x5487bb][_0xe068('0xb7')]]);logger['error'](_0xe068('0xb9'),_0x254369,_0x5487bb,_0x1e22cb[_0x5487bb][_0xe068('0xb7')]);delete _0x1e22cb[_0x5487bb];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x23360e){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopper[_0xe068('0xbb')](_0x23360e))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xe068('0x1b')][_0xe068('0xbc')]=function(_0x52dd43){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopperBlack['checkIsBlackList'](_0x52dd43))[_0xe068('0xbd')](loggerCatch(_0xe068('0xbe')));};Dialer['prototype'][_0xe068('0xbf')]=function(_0x5da365,_0x4b0ca4,_0x3d94ce){return Promise[_0xe068('0xba')]()['then'](cmHopperAdditionalPhone[_0xe068('0xbf')](_0x5da365,_0x4b0ca4,_0x3d94ce))[_0xe068('0xbd')](loggerCatch(_0xe068('0xc0')));};Dialer[_0xe068('0x1b')][_0xe068('0xc1')]=function(_0x35766d,_0x495fa4,_0x58e36d){return Promise['resolve']()[_0xe068('0x3d')](cmHopperAdditionalPhone[_0xe068('0xc1')](_0x35766d,_0x495fa4,_0x58e36d))['catch'](loggerCatch(_0xe068('0xc2')));};Dialer[_0xe068('0x1b')][_0xe068('0xc3')]=function(_0x468b4c){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopperBlack['checkIsBlackListIvr'](_0x468b4c))[_0xe068('0xbd')](loggerCatch(_0xe068('0xc4')));};Dialer[_0xe068('0x1b')]['averageHandleTime']=function(_0x4643ce){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopperHistory[_0xe068('0xc5')](_0x4643ce))['catch'](loggerCatch(_0xe068('0xc6')));};Dialer[_0xe068('0x1b')][_0xe068('0xc7')]=function(_0x3e24f3){return Promise['resolve']()[_0xe068('0x3d')](cmHopper['rescheduleContact'](_0x3e24f3))[_0xe068('0xbd')](loggerCatch(_0xe068('0xc8')));};Dialer[_0xe068('0x1b')][_0xe068('0xc9')]=function(_0x66ca97,_0x5930e5,_0x49322a){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopper['unlockContact'](_0x66ca97,_0x5930e5,_0x49322a))['catch'](loggerCatch(_0xe068('0xca')));};Dialer[_0xe068('0x1b')][_0xe068('0xcb')]=function(_0x3f2a91,_0x1d5765,_0x204129,_0x56fc5a,_0x4a0f95){return Promise[_0xe068('0xba')]()['then'](cmHopper[_0xe068('0xcb')](_0x3f2a91,_0x1d5765,_0x204129,_0x56fc5a))[_0xe068('0xbd')](function(_0x268b7a){_0x4a0f95[_0xe068('0xcc')]-=_0x204129;_0x4a0f95[_0xe068('0xcc')]=_0x4a0f95[_0xe068('0xcc')]>0x0?_0x4a0f95[_0xe068('0xcc')]:0x0;loggerCatch(_0xe068('0xcd'))(_0x268b7a);});};Dialer[_0xe068('0x1b')][_0xe068('0xce')]=function(_0x51f84a,_0x389b33,_0x4c0abb,_0x68490b){return Promise[_0xe068('0xba')]()['then'](cmHopper[_0xe068('0xce')](_0x51f84a,_0x389b33,_0x4c0abb))[_0xe068('0xbd')](function(_0x34ec30){_0x68490b[_0xe068('0xcc')]-=_0x389b33;_0x68490b['temp']=_0x68490b[_0xe068('0xcc')]>0x0?_0x68490b[_0xe068('0xcc')]:0x0;loggerCatch(_0xe068('0xcf'))(_0x34ec30);});};Dialer[_0xe068('0x1b')]['getVoiceQueueRtPauses']=function(_0xc8cab7){return Promise['resolve']()['then'](voiceQueueRt[_0xe068('0xd0')](_0xc8cab7))[_0xe068('0xbd')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xe068('0x1b')][_0xe068('0xd1')]=function(_0x3769af){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopper['moveContactManagedDialer'](_0x3769af))[_0xe068('0xbd')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0xe068('0xd2')]=function(_0x1acfe1){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopperHistory['createHistory'](_0x1acfe1))[_0xe068('0xbd')](loggerCatch('[createHistory]\x20'));};Dialer[_0xe068('0x1b')]['updateOriginated']=function(_0x1771d9){if(!_[_0xe068('0x3f')](_0x1771d9)&&_0x1771d9!==null){if(typeof _0x1771d9[_0xe068('0x9b')]!=='undefined'){if(_0x1771d9[_0xe068('0x9b')]>0x0){_0x1771d9[_0xe068('0x9b')]-=0x1;}else{logger[_0xe068('0x99')](_0xe068('0xd3'));}}}else{logger[_0xe068('0x99')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xe068('0x1b')]['loggerHandler']=function(_0x51878a,_0x12af4c){var _0x2998af=this;return function(_0x35f10e){_0x2998af[_0xe068('0xb6')](_0x12af4c);logger[_0xe068('0x99')](_0x51878a,util[_0xe068('0x98')](_0x35f10e,{'showHidden':![],'depth':null}));};};Dialer[_0xe068('0x1b')]['emptyContact']=function(_0x2429dc,_0x157039,_0x2da519){var _0x577423={'state':0x19,'statedesc':_0xe068('0xd4')};this['updateOriginated'](_0x157039);this[_0xe068('0xd5')](_[_0xe068('0x8f')](_0x577423,_['pick'](_0x2da519,[_0xe068('0xd6'),_0xe068('0xd7'),'UserId',_0xe068('0xd8'),_0xe068('0xd9')])),'[emptyContact][createHistory]',_0xe068('0xda'));logger[_0xe068('0x99')](_0x2429dc);};Dialer['prototype']['isSuccess']=function(_0x269327){return _0x269327==='Success';};Dialer[_0xe068('0x1b')]['isTrunkReachable']=function(_0xa91bdf){return!_[_0xe068('0x3f')](_0xa91bdf)&&_0xa91bdf&&!_[_0xe068('0x3f')](_0xa91bdf[_0xe068('0x42')])&&!_['isUndefined'](_0xa91bdf[_0xe068('0x78')])&&_0xa91bdf[_0xe068('0x78')]&&(this[_0xe068('0x21')][util[_0xe068('0x7a')]('SIP/%s',_0xa91bdf['name'])][_0xe068('0xb3')]==='reachable'||this['trunks'][util[_0xe068('0x7a')](_0xe068('0xdb'),_0xa91bdf[_0xe068('0x42')])]['status']===_0xe068('0xdc'));};Dialer['prototype']['saveInDb']=function(_0x5415af,_0x54a16e,_0x108ba2){this[_0xe068('0xd2')](_0x5415af)[_0xe068('0xbd')](loggerCatch(_0x54a16e));this[_0xe068('0xd1')](_0x5415af)[_0xe068('0xbd')](loggerCatch(_0x108ba2));};Dialer[_0xe068('0x1b')][_0xe068('0x36')]=function(_0x1fdbac){var _0x1ca14e=this;var _0x53b1c3=this[_0xe068('0x25')][_0x1fdbac['uniqueid']];var _0x44ef7a;if(!_[_0xe068('0xb2')](_0x1fdbac)&&!_[_0xe068('0xb2')](_0x1fdbac[_0xe068('0xdd')])&&!_[_0xe068('0xb2')](_0x1fdbac[_0xe068('0xdd')]['amdstatus'])&&_0x1fdbac['exten']===_0xe068('0xde')&&_0x53b1c3){if(_0x53b1c3['type']!==_0xe068('0x7c')&&this['voiceQueues'][_0x53b1c3[_0xe068('0xb7')]]['dialAMDActive']&&_0x1fdbac[_0xe068('0xdf')]===_0xe068('0xe0')){delete this[_0xe068('0x25')][_0x1fdbac[_0xe068('0xe1')]];this['updateOriginated'](this[_0xe068('0x1e')][_0x53b1c3[_0xe068('0xb7')]]);this[_0xe068('0x1e')][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0x64')]+=0x1;this[_0xe068('0x1e')][_0x53b1c3['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x44ef7a=new Hangup(_0x53b1c3,_0x1fdbac);_0x44ef7a['state']=0x12;_0x44ef7a['statedesc']=_0xe068('0xe2');_0x44ef7a[_0xe068('0xe3')]=_0xe068('0xe4');ami['emit'](_0xe068('0xe5'),ut[_0xe068('0xe6')](_0x44ef7a,_0xe068('0xe7')));this[_0xe068('0xd5')](_0x44ef7a,'[syncHangupInAMD][createHistory]',_0xe068('0xe8'));}if(_0x53b1c3[_0xe068('0x50')]!==_0xe068('0x7c')&&this[_0xe068('0x1e')][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0xe9')]&&_0x1fdbac[_0xe068('0xdf')]==='MACHINE'){return new Promise(function(_0x55f1ec,_0x6c8435){delete _0x1ca14e[_0xe068('0x25')][_0x1fdbac[_0xe068('0xe1')]];_0x1ca14e['updateOriginated'](_0x1ca14e[_0xe068('0x1e')][_0x53b1c3[_0xe068('0xb7')]]);_0x1ca14e[_0xe068('0x1e')][_0x53b1c3['queue']][_0xe068('0x64')]+=0x1;_0x1ca14e['voiceQueues'][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0x63')]+=0x1;var _0x8e8100=_0x1ca14e['voiceQueues'][_0x53b1c3['queue']];var _0x1be754=new Hangup(_0x53b1c3,_0x1fdbac);_0x1be754[_0xe068('0xea')]=0x13;_0x1be754['statedesc']='Machine';_0x1be754[_0xe068('0xe3')]=_0xe068('0xe4');_0x1be754[_0xe068('0xeb')]+=0x1;_0x1be754[_0xe068('0xec')]+=0x1;_0x1be754[_0xe068('0xe7')]=!![];ami[_0xe068('0x4f')](_0xe068('0xe5'),ut[_0xe068('0xe6')](_0x1be754,_0xe068('0xe7')));_0x1ca14e[_0xe068('0xd2')](_0x1be754)['catch'](loggerCatch(_0xe068('0xed')));if(_0x1be754[_0xe068('0xee')]+_0x1be754['countcongestionretry']+_0x1be754[_0xe068('0xef')]+_0x1be754[_0xe068('0xf0')]+_0x1be754[_0xe068('0xf1')]+_0x1be754['countabandonedretry']+_0x1be754[_0xe068('0xeb')]+_0x1be754[_0xe068('0xf2')]>=_0x8e8100[_0xe068('0xf3')]){_0x1ca14e[_0xe068('0xf4')](_0x1be754,_0x55f1ec,_0x6c8435,_0xe068('0xf5'));}else{if(_0x1be754['countmachineretry']>=_0x8e8100[_0xe068('0xf6')]){_0x1ca14e[_0xe068('0xf7')](_0x1be754,_0x55f1ec,_0x6c8435,_0xe068('0xf8'));}else{_0x1ca14e[_0xe068('0xc7')]({'active':![],'countmachineretry':_0x1be754[_0xe068('0xeb')],'scheduledat':moment()[_0xe068('0xf9')](_0x8e8100[_0xe068('0xfa')],_0xe068('0xfb'))[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x1be754[_0xe068('0xd6')],'ListId':_0x1be754['ListId'],'VoiceQueueId':_0x1be754[_0xe068('0xd8')]||undefined,'CampaignId':_0x1be754[_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0xfd')));_0x55f1ec({'reschedule':0x1});}}});}if(_0x53b1c3[_0xe068('0x50')]===_0xe068('0x7c')&&this[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0xe9')]&&_0x1fdbac[_0xe068('0xdf')]===_0xe068('0xe0')){delete this[_0xe068('0x25')][_0x1fdbac['uniqueid']];this['updateOriginated'](this[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]]);_0x44ef7a=new Hangup(_0x53b1c3,_0x1fdbac);_0x44ef7a[_0xe068('0xea')]=0x12;_0x44ef7a[_0xe068('0xab')]='HangupInAMD';_0x44ef7a[_0xe068('0xe3')]=_0xe068('0xe4');ami['emit'](_0xe068('0xe5'),ut[_0xe068('0xe6')](_0x44ef7a,_0xe068('0xe7')));this[_0xe068('0xd5')](_0x44ef7a,_0xe068('0xfe'),_0xe068('0xff'));}if(_0x53b1c3['type']===_0xe068('0x7c')&&this[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0xe9')]&&_0x1fdbac['value']===_0xe068('0x100')){return new Promise(function(_0x274008,_0x5bba6e){delete _0x1ca14e[_0xe068('0x25')][_0x1fdbac[_0xe068('0xe1')]];_0x1ca14e['updateOriginated'](_0x1ca14e[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]]);_0x1ca14e[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0x64')]+=0x1;_0x1ca14e[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]][_0xe068('0x63')]+=0x1;var _0x5c937e=_0x1ca14e[_0xe068('0x1f')][_0x53b1c3[_0xe068('0xb7')]];var _0x1a7701=new Hangup(_0x53b1c3,_0x1fdbac);_0x1a7701[_0xe068('0xea')]=0x13;_0x1a7701[_0xe068('0xab')]='Machine';_0x1a7701[_0xe068('0xe3')]=_0xe068('0xe4');_0x1a7701['countmachineretry']+=0x1;_0x1a7701[_0xe068('0xec')]+=0x1;_0x1a7701['amd']=!![];ami[_0xe068('0x4f')](_0xe068('0xe5'),ut[_0xe068('0xe6')](_0x1a7701,_0xe068('0xe7')));_0x1ca14e[_0xe068('0xd2')](_0x1a7701)[_0xe068('0xbd')](loggerCatch(_0xe068('0xed')));if(_0x1a7701['countbusyretry']+_0x1a7701['countcongestionretry']+_0x1a7701['countnoanswerretry']+_0x1a7701[_0xe068('0xf0')]+_0x1a7701[_0xe068('0xf1')]+_0x1a7701[_0xe068('0x101')]+_0x1a7701[_0xe068('0xeb')]+_0x1a7701[_0xe068('0xf2')]>=_0x5c937e[_0xe068('0xf3')]){_0x1ca14e[_0xe068('0xf4')](_0x1a7701,_0x274008,_0x5bba6e,_0xe068('0xf5'));}else{if(_0x1a7701[_0xe068('0xeb')]>=_0x5c937e['dialMachineMaxRetry']){_0x1ca14e[_0xe068('0xf7')](_0x1a7701,_0x274008,_0x5bba6e,'reason\x2019\x20machine....');}else{_0x1ca14e[_0xe068('0xc7')]({'active':![],'countmachineretry':_0x1a7701[_0xe068('0xeb')],'scheduledat':moment()[_0xe068('0xf9')](_0x5c937e[_0xe068('0xfa')],_0xe068('0xfb'))[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x1a7701[_0xe068('0xd6')],'ListId':_0x1a7701[_0xe068('0xd7')],'VoiceQueueId':_0x1a7701[_0xe068('0xd8')]||undefined,'CampaignId':_0x1a7701['CampaignId']||undefined})[_0xe068('0xbd')](loggerCatch('[rescheduleContact][Machine]'));_0x274008({'reschedule':0x1});}}});}}};Dialer[_0xe068('0x1b')][_0xe068('0x102')]=function(_0xf45902){var _0x445030=this['uniqueId'][_0xf45902[_0xe068('0xe1')]];var _0x38c085;if(_0x445030&&_0x445030[_0xe068('0x50')]===_0xe068('0x7c')){delete this[_0xe068('0x25')][_0xf45902['uniqueid']];this[_0xe068('0xb6')](this[_0xe068('0x1f')][_0x445030[_0xe068('0xb7')]]);this[_0xe068('0x1f')][_0x445030[_0xe068('0xb7')]][_0xe068('0x103')]+=0x1;_0x38c085=new Hangup(_0x445030,_0xf45902);this[_0xe068('0xd2')](_0x38c085)['catch'](loggerCatch(_0xe068('0x104')));this['moveContactManagedDialer'](_0x38c085)['catch'](loggerCatch(_0xe068('0x105')));}if(_0x445030&&_0x445030[_0xe068('0x50')]!=='ivr'&&isNotNull(this[_0xe068('0x1e')][_0x445030[_0xe068('0xb7')]][_0xe068('0x106')])){delete this['uniqueId'][_0xf45902[_0xe068('0xe1')]];this['updateOriginated'](this['voiceQueues'][_0x445030['queue']]);this[_0xe068('0x1e')][_0x445030[_0xe068('0xb7')]][_0xe068('0x64')]+=0x1;this['voiceQueues'][_0x445030[_0xe068('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;_0x38c085=new Hangup(_0x445030,_0xf45902);_0x38c085[_0xe068('0xea')]=0x10;_0x38c085['statedesc']=_0xe068('0x107');_0x38c085[_0xe068('0xe3')]=_0xe068('0x108');this['createHistory'](_0x38c085)[_0xe068('0xbd')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xe068('0xd1')](_0x38c085)[_0xe068('0xbd')](loggerCatch(_0xe068('0x105')));}if(_0x445030&&_0x445030[_0xe068('0x50')]!==_0xe068('0x7c')&&!isNotNull(this[_0xe068('0x1e')][_0x445030['queue']]['dialQueueProject'])){delete this[_0xe068('0x25')][_0xf45902[_0xe068('0xe1')]];this[_0xe068('0xb6')](this[_0xe068('0x1e')][_0x445030[_0xe068('0xb7')]]);this[_0xe068('0x1e')][_0x445030['queue']][_0xe068('0x6c')]+=0x1;_0x38c085=new Hangup(_0x445030,_0xf45902);_0x38c085['state']=0xc;_0x38c085['statedesc']=_0xf45902[_0xe068('0x109')];_0x38c085[_0xe068('0xe3')]=_0xe068('0x10a');this['createHistory'](_0x38c085)['catch'](loggerCatch(_0xe068('0x104')));this[_0xe068('0xd1')](_0x38c085)[_0xe068('0xbd')](loggerCatch(_0xe068('0x105')));}};Dialer[_0xe068('0x1b')][_0xe068('0x2f')]=function(_0x4bbbe9){var _0x50f3e2=this[_0xe068('0x25')][_0x4bbbe9['uniqueid']];if(this[_0xe068('0x1e')][_0x4bbbe9[_0xe068('0xb7')]]){if(_0x50f3e2&&_0x50f3e2[_0xe068('0x50')]!==_0xe068('0x7c')){delete this[_0xe068('0x25')][_0x4bbbe9[_0xe068('0xe1')]];this['voiceQueues'][_0x4bbbe9['queue']]['outboundAnswerCallsDay']+=0x1;var _0x3dff2b=new AgentComplete(_0x50f3e2,_0x4bbbe9);if(_0x4bbbe9[_0xe068('0x10b')]==='agent'){_0x3dff2b[_0xe068('0x10c')]=this[_0xe068('0x1e')][_0x4bbbe9[_0xe068('0xb7')]][_0xe068('0x10d')]&&this[_0xe068('0x1e')][_0x4bbbe9[_0xe068('0xb7')]][_0xe068('0x10e')]?moment()[_0xe068('0x7a')](_0xe068('0xfc')):undefined;}this[_0xe068('0xd2')](_0x3dff2b)[_0xe068('0xbd')](loggerCatch(_0xe068('0x10f')));this[_0xe068('0xd1')](_0x3dff2b)[_0xe068('0xbd')](loggerCatch(_0xe068('0x110')));}}};Dialer[_0xe068('0x1b')][_0xe068('0x29')]=function(_0x396d31){if(this[_0xe068('0x1e')][_0x396d31['queue']]){if(this['uniqueId'][_0x396d31[_0xe068('0xe1')]]&&this['uniqueId'][_0x396d31[_0xe068('0xe1')]][_0xe068('0x50')]!==_0xe068('0x7c')){this['updateOriginated'](this['voiceQueues'][_0x396d31[_0xe068('0xb7')]]);this[_0xe068('0x25')][_0x396d31[_0xe068('0xe1')]]['answertime']=moment()[_0xe068('0x7a')](_0xe068('0xfc'));}}};Dialer[_0xe068('0x1b')][_0xe068('0x111')]=function(_0x497810,_0x454764){this[_0xe068('0xd2')](_0x497810)['catch'](loggerCatch(_0xe068('0x10f')));if(_0x454764==0x0){this[_0xe068('0xd1')](_0x497810)[_0xe068('0xbd')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xe068('0x1b')][_0xe068('0x2c')]=function(_0x39ba96){var _0x1e9709=this[_0xe068('0x25')][_0x39ba96[_0xe068('0xe1')]];var _0x2fd8e6=this;var _0x5f1ddc=![];var _0x3248f7;var _0x9da9ce;if(this['voiceQueues'][_0x39ba96['queue']]){if(_0x1e9709&&_0x1e9709[_0xe068('0x50')]!=='ivr'){delete this[_0xe068('0x25')][_0x39ba96['uniqueid']];this[_0xe068('0xb6')](this['voiceQueues'][_0x39ba96[_0xe068('0xb7')]]);_0x1e9709[_0xe068('0x112')]=moment()[_0xe068('0x7a')](_0xe068('0xfc'));var _0x34622f=new QueueCallerAbandon(_0x1e9709,_0x39ba96);if(getSeconds(_0x1e9709[_0xe068('0x112')],_0x1e9709[_0xe068('0x113')])>=_0x1e9709[_0xe068('0x114')]){this[_0xe068('0x1e')][_0x39ba96['queue']][_0xe068('0x115')]+=0x1;this[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x68')]+=0x1;this[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x116')]+=0x1;_0x34622f[_0xe068('0xea')]=0xa;_0x34622f[_0xe068('0xab')]=_0xe068('0x117');_0x34622f['dropreason']=_0xe068('0x118');_0x34622f['agiafterat']=this[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x10d')]?moment()[_0xe068('0x7a')](_0xe068('0xfc')):undefined;_0x34622f[_0xe068('0xf1')]+=0x1;_0x34622f['countglobal']+=0x1;_0x3248f7=this[_0xe068('0x1e')][_0x39ba96['queue']][_0xe068('0x119')];_0x9da9ce=this['voiceQueues'][_0x39ba96['queue']][_0xe068('0x11a')];_0x2fd8e6[_0xe068('0xbf')](_0x34622f,_0x34622f[_0xe068('0xea')],_0x1e9709[_0xe068('0x11b')])['then'](function(_0x2164d3){_0x5f1ddc=_0x2164d3[_0xe068('0x11c')]==0x1;if(_0x34622f[_0xe068('0xf1')]>=_0x2fd8e6[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x11d')]){_0x2fd8e6['queueCallerAbandonCreateState'](_0x34622f,_0x2164d3[_0xe068('0x11c')]);}else{_0x2fd8e6[_0xe068('0xc7')]({'active':![],'countdropretry':_0x34622f['countdropretry'],'scheduledat':moment()[_0xe068('0xf9')](_0x2fd8e6['voiceQueues'][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x119')],'minutes')[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x1e9709[_0xe068('0xd6')],'ListId':_0x1e9709[_0xe068('0xd7')],'VoiceQueueId':_0x1e9709[_0xe068('0xd8')]||undefined,'CampaignId':_0x1e9709['CampaignId']||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x11e')));var _0x4f7d94=new History(_0x34622f);_0x4f7d94[_0xe068('0xea')]=0xa;_0x4f7d94[_0xe068('0xab')]='Drop';_0x4f7d94[_0xe068('0x11f')]=moment()['format'](_0xe068('0xfc'));_0x4f7d94[_0xe068('0xac')]=_0x4f7d94[_0xe068('0x11f')];_0x4f7d94['calleridname']=_0x34622f['calleridname'];_0x4f7d94['calleridnum']=_0x34622f[_0xe068('0x120')];_0x2fd8e6[_0xe068('0xd2')](_0x4f7d94)[_0xe068('0xbd')](loggerCatch(_0xe068('0x121')));}})[_0xe068('0x3d')](function(){if(_0x5f1ddc)_0x2fd8e6['swapAdditionalPhones'](_0x34622f,_0x3248f7,_0x9da9ce)[_0xe068('0x3d')](function(){return 0x1;});});}else{this['voiceQueues'][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x6f')]+=0x1;this[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]]['outboundDropCallsDayCallersExit']+=0x1;_0x34622f['state']=0xb;_0x34622f[_0xe068('0xab')]='Abandoned';_0x34622f[_0xe068('0x122')]=_0xe068('0x123');_0x34622f[_0xe068('0x101')]+=0x1;_0x34622f['countglobal']+=0x1;_0x3248f7=this[_0xe068('0x1e')][_0x39ba96['queue']][_0xe068('0x124')];_0x9da9ce=this[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]]['callAdditionalPhoneAfterMin'];_0x2fd8e6['verifyAdditionalPhones'](_0x34622f,_0x34622f[_0xe068('0xea')],_0x1e9709['voiceQueue'])[_0xe068('0x3d')](function(_0x449939){if(_0x34622f[_0xe068('0x101')]>=_0x2fd8e6[_0xe068('0x1e')][_0x39ba96[_0xe068('0xb7')]]['dialAbandonedMaxRetry']){_0x2fd8e6[_0xe068('0x111')](_0x34622f,_0x449939['additional']);}else{_0x2fd8e6[_0xe068('0xc7')]({'active':![],'countabandonedretry':_0x34622f[_0xe068('0x101')],'scheduledat':moment()['add'](_0x2fd8e6['voiceQueues'][_0x39ba96[_0xe068('0xb7')]][_0xe068('0x124')],_0xe068('0xfb'))[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x1e9709[_0xe068('0xd6')],'ListId':_0x1e9709[_0xe068('0xd7')],'VoiceQueueId':_0x1e9709[_0xe068('0xd8')]||undefined,'CampaignId':_0x1e9709[_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x125')));var _0x411603=new History(_0x34622f);_0x411603[_0xe068('0xea')]=0xb;_0x411603[_0xe068('0xab')]=_0xe068('0x126');_0x411603[_0xe068('0x11f')]=moment()[_0xe068('0x7a')](_0xe068('0xfc'));_0x411603['endtime']=_0x411603[_0xe068('0x11f')];_0x411603[_0xe068('0x127')]=_0x34622f[_0xe068('0x127')];_0x411603[_0xe068('0x120')]=_0x34622f[_0xe068('0x120')];_0x2fd8e6[_0xe068('0xd2')](_0x411603)[_0xe068('0xbd')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xe068('0x3d')](function(){if(_0x5f1ddc)_0x2fd8e6['swapAdditionalPhones'](_0x34622f,_0x3248f7,_0x9da9ce)['then'](function(){return 0x1;});});}}}};Dialer[_0xe068('0x1b')][_0xe068('0x34')]=function(_0x2602cd){if(this[_0xe068('0xaf')][_0x2602cd[_0xe068('0xe1')]]){this[_0xe068('0xaf')][_0x2602cd[_0xe068('0xe1')]][_0xe068('0xb4')]=_0x2602cd[_0xe068('0xb4')];}if(this[_0xe068('0x25')][_0x2602cd[_0xe068('0xe1')]]){this[_0xe068('0x25')][_0x2602cd[_0xe068('0xe1')]][_0xe068('0xb4')]=_0x2602cd[_0xe068('0xb4')];}};Dialer[_0xe068('0x1b')]['syncQueueMember']=function(_0x84a015){if(strategy[this[_0xe068('0x1e')][this[_0xe068('0xaf')][_0x84a015[_0xe068('0x128')]][_0xe068('0xb7')]][_0xe068('0x52')]]==='roundrobin'){if(this['actions'][_0x84a015[_0xe068('0x128')]]&&_[_0xe068('0xb2')](this['actions'][_0x84a015['actionid']][_0xe068('0x129')])&&_0x84a015[_0xe068('0xb3')]==='1'&&_0x84a015[_0xe068('0x12a')]==='0'){if(this[_0xe068('0x20')][_0x84a015[_0xe068('0x12b')]]){if(!this[_0xe068('0x20')][_0x84a015['stateinterface']][_0xe068('0x129')]){this[_0xe068('0x20')][_0x84a015[_0xe068('0x12b')]][_0xe068('0x129')]=!![];this[_0xe068('0xaf')][_0x84a015[_0xe068('0x128')]][_0xe068('0x129')]=!![];this[_0xe068('0xaf')][_0x84a015[_0xe068('0x128')]][_0xe068('0x12b')]=_0x84a015[_0xe068('0x12b')];}}}}else if((strategy[this[_0xe068('0x1e')][this[_0xe068('0xaf')][_0x84a015['actionid']][_0xe068('0xb7')]]['strategy']]||_0xe068('0x19'))===_0xe068('0x19')){if(this[_0xe068('0xaf')][_0x84a015[_0xe068('0x128')]]){if(this[_0xe068('0x20')][_0x84a015[_0xe068('0x12b')]]){this[_0xe068('0xaf')][_0x84a015['actionid']][_0xe068('0x12b')]=_0x84a015[_0xe068('0x12b')];if(_[_0xe068('0xb2')](this[_0xe068('0x12c')][this[_0xe068('0xaf')][_0x84a015['actionid']]['queue']])){this['queueBooked'][this[_0xe068('0xaf')][_0x84a015[_0xe068('0x128')]][_0xe068('0xb7')]]=[];}this['queueBooked'][this['actions'][_0x84a015[_0xe068('0x128')]][_0xe068('0xb7')]][_0xe068('0x12d')](_[_0xe068('0x8f')](_['pick'](this[_0xe068('0xaf')][_0x84a015[_0xe068('0x128')]],['idHopper',_0xe068('0x12b')]),{'status':_0x84a015[_0xe068('0xb3')],'paused':_0x84a015[_0xe068('0x12a')]}));}}}};function unlockQueueStatus(_0x9d9330,_0x500c50){setTimeout(function(){if(_[_0xe068('0x3f')](_0x9d9330['queueStatusComplete'])){loggerBooked[_0xe068('0x99')](_0xe068('0x12e'),_0x500c50);}_0x9d9330['queueStatusComplete']=!![];loggerBooked[_0xe068('0x7f')](_0xe068('0x12f'),_0x500c50,JSON[_0xe068('0x4b')](_['pick'](_0x9d9330,[_0xe068('0x42'),_0xe068('0x130')])));},0x1f3);}Dialer[_0xe068('0x1b')][_0xe068('0x39')]=function(_0x3bdc5a){var _0x4748ff=this;var _0x25fca0=_0x4748ff[_0xe068('0x1e')][_0x4748ff[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]];if(strategy[this[_0xe068('0x1e')][this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]]['queue']][_0xe068('0x52')]]===_0xe068('0x1a')){if(this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]]&&this['actions'][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0x12b')]){this[_0xe068('0x93')][_0xe068('0x131')](this['actions'][_0x3bdc5a['actionid']][_0xe068('0x132')],this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0x12b')])[_0xe068('0xbd')](function(_0x4c212b){logger[_0xe068('0x99')](_0xe068('0x133'),util[_0xe068('0x98')](_0x4c212b,{'showHidden':![],'depth':null}));})[_0xe068('0x134')](function(){_0x4748ff[_0xe068('0xb6')](_0x4748ff[_0xe068('0x1e')][_0x4748ff[_0xe068('0xaf')][_0x3bdc5a['actionid']][_0xe068('0xb7')]]);_0x4748ff[_0xe068('0x20')][_0x4748ff['actions'][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0x12b')]][_0xe068('0x129')]=![];delete _0x4748ff[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]];unlockQueueStatus(_0x25fca0);});}else{this['updateOriginated'](this[_0xe068('0x1e')][this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xd6')],'ListId':this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xd7')],'VoiceQueueId':this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x135')));delete this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]];unlockQueueStatus(_0x25fca0);}}else if((strategy[this[_0xe068('0x1e')][this[_0xe068('0xaf')][_0x3bdc5a['actionid']][_0xe068('0xb7')]][_0xe068('0x52')]]||'rrmemory')===_0xe068('0x19')){var _0x4b0bd6;if(this['actions'][_0x3bdc5a[_0xe068('0x128')]]&&!_[_0xe068('0x48')](this[_0xe068('0x12c')][this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]])){if(this[_0xe068('0x136')][_0x4748ff[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]]){this[_0xe068('0x136')][_0x4748ff[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]]=this['queueBookedRR'][this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]]?this[_0xe068('0x136')][this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]]['queue']]:this['queueBooked'][this[_0xe068('0xaf')][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]]?this[_0xe068('0x12c')][this['actions'][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]][_0xe068('0x137')]||0x0:0x0;}this[_0xe068('0x12c')][this['actions'][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]][_0xe068('0x137')]=this[_0xe068('0x136')][this['actions'][_0x3bdc5a[_0xe068('0x128')]][_0xe068('0xb7')]];for(var _0x22b7ec=0x0;_0x22b7ec=0x0;})[_0xe068('0xbd')](myreject(_0x4f7ee6)));}}else{_0x556c17['push'](ami[_0xe068('0x14f')]({'action':'command','command':util['format'](_0xe068('0x155'),_0x10df36,!_[_0xe068('0x3f')](config[_0xe068('0x14b')][_0x54d579])?_0x54d579:'')})['then'](function(_0x294329){return _0x294329[_0xe068('0x152')][_0xe068('0x153')](_0xe068('0x154'))>=0x0;})[_0xe068('0xbd')](myreject(_0x4f7ee6)));}Promise[_0xe068('0x156')](_0x556c17)['then'](function(_0x356512){var _0x1336e5=_['some'](_0x356512);if(_0x1336e5){return _0x5580e2(_0x1336e5);}else{_0xfd4b9['message']=_0x5c7ab1?_0xe068('0x157'):_0xe068('0x158');return _0x4f7ee6(msgResponse(_0xe068('0x159'),'Failure','Global:\x20'+_0x5c7ab1+'\x20'+_0x28bcd2+_0xe068('0x15a')+util[_0xe068('0x98')](_0x10df36,{'showHidden':![],'depth':null})+_0xe068('0x15b')+_0x54d579));}})[_0xe068('0xbd')](function(_0x2d2fb2){return _0x4f7ee6(msgResponse(_0xe068('0x147'),_0xe068('0x148'),JSON[_0xe068('0x4b')](_0x2d2fb2)));});});};Dialer[_0xe068('0x1b')][_0xe068('0x15c')]=function(_0x5ac6a4){var _0x57283e=this;return function(){switch(_0x5ac6a4[_0xe068('0x15d')]){case _0xe068('0x15e'):freeVariablesPredictive(_0x5ac6a4);_0x57283e[_0xe068('0x15f')](_0x5ac6a4,0x1);break;case _0xe068('0x160'):freeVariablesPredictive(_0x5ac6a4);_0x57283e[_0xe068('0x15f')](_0x5ac6a4,_0x5ac6a4['dialPowerLevel']);break;case _0xe068('0x7'):_0x57283e[_0xe068('0x7')](_0x5ac6a4);break;case'booked':freeVariablesPredictive(_0x5ac6a4);_0x57283e['handlePower'](_0x5ac6a4,0x1);break;default:freeVariablesPredictive(_0x5ac6a4);logger['error']('Queue',_0x5ac6a4[_0xe068('0x42')],_0xe068('0x161'));}};};Dialer[_0xe068('0x1b')][_0xe068('0x162')]=function(_0x2c2e46){return Promise['resolve']()[_0xe068('0x3d')](cmHopper[_0xe068('0x163')](_0x2c2e46['id'],previewRecallmeReminderInterval))['then'](function(_0x44c2c6){for(var _0x4433cd=0x0;_0x4433cd<_0x44c2c6[_0xe068('0x138')];_0x4433cd++){var _0x7379dd=_0x44c2c6[_0x4433cd][_0xe068('0x164')][_0xe068('0x42')];if(_0x7379dd)io['to'](util[_0xe068('0x7a')](_0xe068('0x165'),_0x7379dd))['emit'](_0xe068('0x166'),{'hopper':_0x44c2c6[_0x4433cd]});}})[_0xe068('0xbd')](function(){});};Dialer[_0xe068('0x1b')][_0xe068('0x167')]=function(_0x1b0ef0){var _0x2202bb=this;return function(){_0x2202bb['handleIvr'](_0x1b0ef0);};};Dialer[_0xe068('0x1b')][_0xe068('0x9')]=function(_0x15a4df){var _0x579c46=this;if(isNotPreview(_0x15a4df[_0xe068('0x15d')])){if(isVoiceQueueOutbound(_0x15a4df[_0xe068('0x50')])&&isActive(_0x15a4df['dialActive'])){_0x15a4df[_0xe068('0xa4')]=!![];Promise[_0xe068('0xba')]()['then'](checkIsLoggedIn(_0x15a4df,_0x15a4df[_0xe068('0x168')]))[_0xe068('0x3d')](checkIsActive(_0x15a4df,_0x15a4df[_0xe068('0x5e')]))['then'](checkInterval(_0x15a4df))[_0xe068('0x3d')](_0x579c46[_0xe068('0x143')](_0x15a4df))[_0xe068('0x3d')](_0x579c46['checkIfTime'](_0x15a4df[_0xe068('0x169')],_0x15a4df[_0xe068('0x16a')],_0x15a4df[_0xe068('0x42')],_0x15a4df))[_0xe068('0x3d')](_0x579c46[_0xe068('0x16b')](_0x15a4df[_0xe068('0x44')],_0x15a4df[_0xe068('0x16a')],_0x15a4df[_0xe068('0x42')],_0x15a4df))[_0xe068('0x3d')](_0x579c46[_0xe068('0x15c')](_0x15a4df))['catch'](loggerCatchQueueSummary(_0xe068('0x16c'),_0x15a4df));}else{notSendMessagesQueue(_0x15a4df);}}else{freeVariablesPredictive(_0x15a4df);}};Dialer['prototype']['syncQueueSummaryComplete']=_[_0xe068('0x16d')](function(){var _0x5c88f6=_[_0xe068('0x16e')](this[_0xe068('0x1e')],function(_0xf4d834){return _0xf4d834['dialPreviewRecallmeReminder'];});var _0x58c9d8=_[_0xe068('0x16e')](this[_0xe068('0x20')],function(_0x13701d){return _0x13701d[_0xe068('0x16f')]&&_0x13701d[_0xe068('0xb3')]===_0xe068('0x170');});if(_0x5c88f6['length']>0x0&&_0x58c9d8[_0xe068('0x138')]>0x0){return Promise[_0xe068('0xba')]()[_0xe068('0x3d')](cmHopper[_0xe068('0x163')](_[_0xe068('0x171')](_0x5c88f6,'id'),previewRecallmeReminderInterval,_[_0xe068('0x171')](_0x58c9d8,'id')))[_0xe068('0x3d')](function(_0x770ba5){for(var _0x2928b0=0x0;_0x2928b0<_0x770ba5[_0xe068('0x138')];_0x2928b0++){var _0x3202da=_0x770ba5[_0x2928b0][_0xe068('0x164')][_0xe068('0x42')];if(_0x3202da)io['to'](util[_0xe068('0x7a')](_0xe068('0x165'),_0x3202da))[_0xe068('0x4f')](_0xe068('0x166'),{'hopper':_0x770ba5[_0x2928b0]});}})[_0xe068('0xbd')](function(_0x219bef){logger[_0xe068('0x99')](_0xe068('0x162'),_0x219bef);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xe068('0x1b')][_0xe068('0x142')]=function(){var _0x14feeb=this;var _0x5c43af;for(var _0x5f5b7d in this[_0xe068('0x1f')]){if(typeof this[_0xe068('0x1f')][_0x5f5b7d]!==_0xe068('0x9c')){_0x5c43af=this[_0xe068('0x1f')][_0x5f5b7d];if(isCampaignIvr(_0x5c43af[_0xe068('0x50')])&&isActive(_0x5c43af[_0xe068('0x78')])){_0x5c43af[_0xe068('0xa4')]=!![];Promise['resolve']()['then'](checkIsActive(_0x5c43af,_0x5c43af[_0xe068('0x78')]))[_0xe068('0x3d')](checkInterval(_0x5c43af))[_0xe068('0x3d')](_0x14feeb[_0xe068('0x143')](_0x5c43af))[_0xe068('0x3d')](_0x14feeb[_0xe068('0x146')](_0x5c43af[_0xe068('0x169')],_0x5c43af[_0xe068('0x16a')],_0x5c43af[_0xe068('0x42')],_0x5c43af))['then'](_0x14feeb[_0xe068('0x16b')](_0x5c43af[_0xe068('0x44')],_0x5c43af['dialTimezone'],_0x5c43af[_0xe068('0x42')],_0x5c43af))['then'](_0x14feeb[_0xe068('0x167')](_0x5c43af))['catch'](loggerCatchQueueSummary(_0xe068('0x172'),_0x5c43af));}else{notSendMessagesCampaign(_0x5c43af);}}}};function getCallerIdRandom(_0x4ec7a3,_0x3f98ca){var _0x4a3c0d;var _0xe2d3c5;var _0x375428;if(_0x3f98ca<=0x0){_0x3f98ca=0x1;}_0x4a3c0d=new RegExp(_0xe068('0x173')+_0x3f98ca+'}$');_0xe2d3c5=Math['pow'](0xa,_0x3f98ca-0x1);_0x375428=Math[_0xe068('0x174')](0xa,_0x3f98ca)-0x1;return util[_0xe068('0x7a')]('%s',_[_0xe068('0x175')](_0x4ec7a3,_0x4a3c0d,_[_0xe068('0x176')](_0xe2d3c5,_0x375428)));}function extractCalleridName(_0x28f9e2){var _0x2adb00=_0x28f9e2[_0xe068('0x177')](/"(.*?)"/);return _0x2adb00?_0x2adb00[0x1]:_0x28f9e2;}Dialer[_0xe068('0x1b')][_0xe068('0x178')]=function(_0x348982,_0xded5c){var _0x2997dc=this;var _0x263db2=uuid['v4']();this[_0xe068('0xaf')][_0x263db2]=new Action(_0x348982,_0xded5c,_0x263db2);return new Promise(function(_0x174db6,_0x508b4a){if(_[_0xe068('0x3f')](_0x348982)&&typeof _0x348982!=='object'){return _0x508b4a(msgResponse(_0xe068('0x179'),'Failure',_0xe068('0x17a')));}if(_[_0xe068('0x3f')](_0xded5c[_0xe068('0x17b')])||_0xded5c['phone']===null){return _0x508b4a(msgResponse(_0xe068('0x179'),_0xe068('0x148'),_0xe068('0x17c')));}var _0x3a11eb={'XMD-CALLERID':_0x2997dc[_0xe068('0xaf')][_0x263db2][_0xe068('0x17d')](),'XMD-AGI':_0x348982['dialQueueProject']?util[_0xe068('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x348982[_0xe068('0x106')]):_0xe068('0x17e'),'XMD-AGIAFTER':_0x348982[_0xe068('0x10d')]?util[_0xe068('0x7a')](_0xe068('0x17f'),ipAgi,_0x348982[_0xe068('0x10d')]):_0xe068('0x17e'),'XMD-QUEUE':_0x348982['type']===_0xe068('0x51')?util[_0xe068('0x7a')]('\x22%s,%s%s,,,%s\x22',_0x348982[_0xe068('0x42')],_0x348982[_0xe068('0x180')]||'',_0x348982[_0xe068('0x10e')]?'c':'',_0x348982[_0xe068('0x114')]||0x3):_0xe068('0x17e'),'XMD-CONTACTID':_0xded5c['ContactId'],'XMD-CDRTYPE':_0xe068('0x6'),'CALLERID(all)':_0x2997dc[_0xe068('0xaf')][_0x263db2][_0xe068('0x17d')](),'XMD-AMD':_0x348982[_0xe068('0xe9')]?'ACTIVE':_0xe068('0x17e'),'XMD-DESTINATION':_0xe068('0xde')};if(_0x348982['dialAMDActive']){_0x3a11eb[_0xe068('0x181')]=_0x348982[_0xe068('0x182')]||0x9c4;_0x3a11eb[_0xe068('0x183')]=_0x348982[_0xe068('0x184')]||0x5dc;_0x3a11eb[_0xe068('0x185')]=_0x348982[_0xe068('0x186')]||0x320;_0x3a11eb[_0xe068('0x187')]=_0x348982[_0xe068('0x188')]||0x1388;_0x3a11eb['XMD-AMDMINWORDLENGTH']=_0x348982[_0xe068('0x189')]||0x64;_0x3a11eb[_0xe068('0x18a')]=_0x348982[_0xe068('0x18b')]||0x32;_0x3a11eb[_0xe068('0x18c')]=_0x348982[_0xe068('0x18d')]||0x3;_0x3a11eb[_0xe068('0x18e')]=_0x348982['dialAMDSilenceThreshold']||0x100;_0x3a11eb[_0xe068('0x18f')]=_0x348982[_0xe068('0x190')]||0x1388;}if(_0x348982[_0xe068('0x50')]==='outbound'){_0x3a11eb[_0xe068('0x191')]=_0xded5c[_0xe068('0xd8')];}else{_0x3a11eb[_0xe068('0x192')]=_0xded5c['CampaignId'];}for(var _0x10f11f in _0xded5c[_0xe068('0x193')]){if(typeof _0xded5c[_0xe068('0x193')][_0x10f11f]!=='undefined'){if(isNotNull(_0xded5c[_0xe068('0x193')][_0x10f11f])&&_0x10f11f!=='id'&&_0x10f11f!=='tags'&&_0x10f11f!==_0xe068('0x194')&&_0x10f11f!=='updatedAt'){_0x3a11eb[util[_0xe068('0x7a')](_0xe068('0x195'),'XMD-',_['toUpper'](_0x10f11f))]=_0xded5c[_0xe068('0x193')][_0x10f11f];}}}var _0x3453a9=_0x2997dc[_0xe068('0x144')](_0x348982[_0xe068('0x77')])?getCallerId(_0x348982[_0xe068('0x77')][_0xe068('0x79')],_0x348982[_0xe068('0x5f')],_0x348982[_0xe068('0x196')]>0x0?getCallerIdRandom(_0x348982[_0xe068('0x60')],_0x348982[_0xe068('0x196')]):_0x348982[_0xe068('0x60')]):getCallerId(_['isNil'](_0x348982[_0xe068('0x145')])?_0x348982[_0xe068('0x77')][_0xe068('0x79')]:_0x348982[_0xe068('0x145')]['callerid'],_0x348982[_0xe068('0x5f')],_0x348982[_0xe068('0x196')]>0x0?getCallerIdRandom(_0x348982[_0xe068('0x60')],_0x348982[_0xe068('0x196')]):_0x348982[_0xe068('0x60')]);if(_0x3453a9){_0x3a11eb[_0xe068('0x197')]=_0x2997dc[_0xe068('0xaf')][_0x263db2][_0xe068('0x198')]=extractCalleridName(_0x3453a9);_0x3a11eb['XMD-ORIGINATECALLERIDNUM']=_0xded5c['phone'];}_0x348982[_0xe068('0x199')]=_0x3a11eb;return ami[_0xe068('0x14f')]({'actionid':_0x263db2,'action':_0xe068('0x179'),'channel':_0x2997dc[_0xe068('0x144')](_0x348982[_0xe068('0x77')])?util[_0xe068('0x7a')](_0xe068('0x19a'),_0x348982[_0xe068('0x77')][_0xe068('0x42')],isNotNull(_0x348982[_0xe068('0x62')])?_0x348982[_0xe068('0x62')]['trim']()||'':'',_0x348982[_0xe068('0x19b')]>0x0?_0xded5c[_0xe068('0x17b')]['substring'](_0x348982[_0xe068('0x19b')]):_0xded5c[_0xe068('0x17b')]):util['format'](_0xe068('0x19a'),_[_0xe068('0xb2')](_0x348982[_0xe068('0x145')])?_0x348982[_0xe068('0x77')][_0xe068('0x42')]:_0x348982[_0xe068('0x145')][_0xe068('0x42')],isNotNull(_0x348982[_0xe068('0x62')])?_0x348982[_0xe068('0x62')]['trim']()||'':'',_0x348982[_0xe068('0x19b')]>0x0?_0xded5c[_0xe068('0x17b')][_0xe068('0x19c')](_0x348982[_0xe068('0x19b')]):_0xded5c[_0xe068('0x17b')]),'callerid':_0x3453a9,'Exten':_0xe068('0xde'),'Context':_0xe068('0x19d'),'Priority':'1','variable':_0x3a11eb,'timeout':(_0x348982[_0xe068('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x263db2})['then'](function(_0x63d813){return _0x174db6(_0x63d813);})[_0xe068('0xbd')](function(_0x1578f7){_0x348982[_0xe068('0x69')]+=0x1;var _0x897ffc=new History(_0x2997dc[_0xe068('0xaf')][_0x263db2]);logger['error'](util[_0xe068('0x7a')](_0xe068('0x19e'),JSON[_0xe068('0x4b')](_0x1578f7)));_0x897ffc[_0xe068('0xea')]=0xe;_0x897ffc[_0xe068('0xab')]=_0xe068('0x19f');_0x897ffc['starttime']=moment()[_0xe068('0x7a')](_0xe068('0xfc'));_0x897ffc[_0xe068('0xac')]=_0x897ffc[_0xe068('0x11f')];_0x2997dc[_0xe068('0xd2')](_0x897ffc)[_0xe068('0xbd')](loggerCatch(_0xe068('0x1a0')));_0x2997dc[_0xe068('0xd1')](_0x897ffc)[_0xe068('0xbd')](loggerCatch(_0xe068('0x1a0')))[_0xe068('0x134')](function(){delete _0x2997dc[_0xe068('0xaf')][_0x263db2];return _0x508b4a(msgResponse(_0xe068('0x179'),'Error',_0xe068('0x1a1')));});});});};Dialer[_0xe068('0x1b')]['syncOriginateResponse']=function(_0x608bd1){var _0x4ded24=this['actions'][_0x608bd1[_0xe068('0x128')]];if(_0x4ded24){delete this[_0xe068('0xaf')][_0x608bd1[_0xe068('0x128')]];_0x4ded24[_0xe068('0x113')]=moment()[_0xe068('0x7a')](_0xe068('0xfc'));var _0x4f2c64=_0x4ded24[_0xe068('0x50')]===_0xe068('0x7c')?this[_0xe068('0x1f')][_0x4ded24['queue']]:this['voiceQueues'][_0x4ded24[_0xe068('0x1a2')]()];if(!this[_0xe068('0x1a3')](_0x608bd1['response'])){this[_0xe068('0xb6')](_0x4f2c64);return this[_0xe068('0x1a4')](_0x4ded24,_0x4f2c64,_0x608bd1)[_0xe068('0xbd')](loggerCatch(_0xe068('0x1a5')));}this[_0xe068('0x25')][_0x608bd1[_0xe068('0xe1')]]=_0x4ded24;}};Dialer[_0xe068('0x1b')]['checkRetriveMax']=function(_0x42d723,_0xf89ab1,_0x20def7){var _0x5d7609=new History(_0xf89ab1);if(_0x5d7609[_0xe068('0xee')]+_0x5d7609[_0xe068('0x1a6')]+_0x5d7609['countnoanswerretry']+_0x5d7609[_0xe068('0xf0')]+_0x5d7609[_0xe068('0xf1')]+_0x5d7609[_0xe068('0x101')]+_0x5d7609['countmachineretry']+_0x5d7609[_0xe068('0xf2')]>=_0x20def7[_0xe068('0xf3')]-0x1){return!![];}switch(_0x42d723){case 0x3:if(_0x5d7609['countnoanswerretry']>=_0x20def7[_0xe068('0x1a7')]-0x1){return!![];}this[_0xe068('0xc7')]({'active':![],'countnoanswerretry':_0x5d7609[_0xe068('0xef')]+=0x1,'scheduledat':moment()[_0xe068('0xf9')](_0x20def7[_0xe068('0x1a8')],_0xe068('0xfb'))[_0xe068('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d7609[_0xe068('0xd6')],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609[_0xe068('0xd8')]||undefined,'CampaignId':_0x5d7609[_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x1a9')));break;case 0x5:if(_0x5d7609['countbusyretry']>=_0x20def7[_0xe068('0x1aa')]-0x1){return!![];}this[_0xe068('0xc7')]({'active':![],'countbusyretry':_0x5d7609[_0xe068('0xee')]+=0x1,'scheduledat':moment()[_0xe068('0xf9')](_0x20def7[_0xe068('0x1ab')],'minutes')['format'](_0xe068('0xfc')),'ContactId':_0x5d7609[_0xe068('0xd6')],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609[_0xe068('0xd8')]||undefined,'CampaignId':_0x5d7609['CampaignId']||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x1ac')));break;case 0x8:if(_0x5d7609['countcongestionretry']>=_0x20def7[_0xe068('0x1ad')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x5d7609[_0xe068('0x1a6')]+=0x1,'scheduledat':moment()['add'](_0x20def7[_0xe068('0x1ae')],_0xe068('0xfb'))['format'](_0xe068('0xfc')),'ContactId':_0x5d7609['ContactId'],'ListId':_0x5d7609['ListId'],'VoiceQueueId':_0x5d7609['VoiceQueueId']||undefined,'CampaignId':_0x5d7609[_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x1af')));break;case 0x0:if(_0x5d7609[_0xe068('0xf0')]>=_0x20def7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xe068('0xc7')]({'active':![],'countnosuchnumberretry':_0x5d7609[_0xe068('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x20def7['dialNoSuchNumberRetryFrequency'],_0xe068('0xfb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d7609[_0xe068('0xd6')],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609[_0xe068('0xd8')]||undefined,'CampaignId':_0x5d7609['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x5d7609[_0xe068('0xf1')]>=_0x20def7[_0xe068('0x11d')]-0x1){return!![];}this[_0xe068('0xc7')]({'active':![],'countdropretry':_0x5d7609[_0xe068('0xf1')]+=0x1,'scheduledat':moment()[_0xe068('0xf9')](_0x20def7['dialDropRetryFrequency'],_0xe068('0xfb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d7609['ContactId'],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609['VoiceQueueId']||undefined,'CampaignId':_0x5d7609[_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5d7609[_0xe068('0x101')]>=_0x20def7[_0xe068('0x1b0')]-0x1){return!![];}this[_0xe068('0xc7')]({'active':![],'countabandonedretry':_0x5d7609[_0xe068('0x101')]+=0x1,'scheduledat':moment()[_0xe068('0xf9')](_0x20def7[_0xe068('0x124')],_0xe068('0xfb'))[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x5d7609['ContactId'],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609['VoiceQueueId']||undefined,'CampaignId':_0x5d7609[_0xe068('0xd9')]||undefined})['catch'](loggerCatch(_0xe068('0x125')));break;case 0x13:if(_0x5d7609[_0xe068('0xeb')]>=_0x20def7[_0xe068('0xf6')]-0x1){return!![];}this[_0xe068('0xc7')]({'active':![],'countmachineretry':_0x5d7609['countmachineretry']+=0x1,'scheduledat':moment()[_0xe068('0xf9')](_0x20def7[_0xe068('0xfa')],_0xe068('0xfb'))[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x5d7609[_0xe068('0xd6')],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609['VoiceQueueId']||undefined,'CampaignId':_0x5d7609['CampaignId']||undefined})['catch'](loggerCatch(_0xe068('0xfd')));break;case 0x14:if(_0x5d7609[_0xe068('0xf2')]>=_0x20def7['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xe068('0xc7')]({'active':![],'countagentrejectretry':_0x5d7609[_0xe068('0xf2')]+=0x1,'scheduledat':moment()[_0xe068('0xf9')](_0x20def7[_0xe068('0x1b1')],_0xe068('0xfb'))[_0xe068('0x7a')](_0xe068('0xfc')),'ContactId':_0x5d7609[_0xe068('0xd6')],'ListId':_0x5d7609[_0xe068('0xd7')],'VoiceQueueId':_0x5d7609['VoiceQueueId']||undefined,'CampaignId':_0x5d7609['CampaignId']||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x1b2')));break;default:return!![];}};Dialer[_0xe068('0x1b')][_0xe068('0x1a4')]=function(_0x4eea14,_0x22d66e,_0x3cfb2b){var _0x3720a6=this;var _0x119a9e=new History(_0x4eea14);var _0x305d08=![];var _0x262024;var _0x2155b7;return new Promise(function(_0x43a31f,_0x1fe0bd){if(_[_0xe068('0x3f')](_0x22d66e)&&typeof _0x22d66e!==_0xe068('0x1b3')){return _0x1fe0bd(msgResponse(_0xe068('0x1b4'),'Failure',_0xe068('0x1b5')));}if(_[_0xe068('0x3f')](_0x3cfb2b)&&typeof _0x3cfb2b!=='object'){return _0x1fe0bd(msgResponse(_0xe068('0x1b4'),_0xe068('0x148'),_0xe068('0x1b6')));}_0x3720a6[_0xe068('0xbf')](_0x119a9e,_0x3cfb2b[_0xe068('0x10b')],_0x22d66e)[_0xe068('0x3d')](function(_0x562808){if(_0x562808[_0xe068('0x11c')]==0x1)_0x305d08=!![];switch(_0x3cfb2b[_0xe068('0x10b')]){case'0':_0x22d66e['outboundNoSuchCallsDay']+=0x1;_0x119a9e[_0xe068('0xea')]=0x0;_0x119a9e[_0xe068('0xab')]=_0xe068('0x1b7');_0x119a9e[_0xe068('0xf0')]+=0x1;_0x119a9e['countglobal']+=0x1;ami[_0xe068('0x4f')](_0xe068('0x1b8'),ut[_0xe068('0xe6')](_0x4eea14,_0xe068('0x1b9')));_0x262024=_0x22d66e[_0xe068('0x1ba')];_0x2155b7=_0x22d66e[_0xe068('0x11a')];_0x3720a6['createHistory'](_0x119a9e)[_0xe068('0xbd')](loggerCatch(_0xe068('0xed')));if(_0x3720a6['checkRetriveMax'](0x0,_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e[_0xe068('0xf0')]>=_0x22d66e['dialNoSuchNumberMaxRetry']){_0x3720a6[_0xe068('0xf7')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1bb'));}else{_0x3720a6[_0xe068('0xf4')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1bb'));}}break;case'3':_0x22d66e[_0xe068('0x1bc')]+=0x1;_0x119a9e[_0xe068('0xea')]=0x3;_0x119a9e[_0xe068('0xab')]=_0xe068('0x1bd');_0x119a9e[_0xe068('0xef')]+=0x1;_0x119a9e[_0xe068('0xec')]+=0x1;var _0x5d325a=ut[_0xe068('0x1be')](_0x4eea14,_0x22d66e);ami['emit'](_0xe068('0x1bf'),_0x5d325a);_0x262024=_0x22d66e['dialNoAnswerRetryFrequency'];_0x2155b7=_0x22d66e[_0xe068('0x11a')];_0x3720a6['createHistory'](_0x119a9e)[_0xe068('0xbd')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3720a6[_0xe068('0x1c0')](0x3,_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e[_0xe068('0xef')]>=_0x22d66e[_0xe068('0x1a7')]){_0x3720a6[_0xe068('0xf7')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1c1'));}else{_0x3720a6[_0xe068('0xf4')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1c1'));}}break;case'5':_0x22d66e[_0xe068('0x65')]+=0x1;_0x119a9e[_0xe068('0xea')]=0x5;_0x119a9e[_0xe068('0xab')]=_0xe068('0x1c2');_0x119a9e[_0xe068('0xee')]+=0x1;_0x119a9e[_0xe068('0xec')]+=0x1;ami[_0xe068('0x4f')](_0xe068('0x1c3'),ut[_0xe068('0xe6')](_0x4eea14,_0xe068('0x1c4')));_0x262024=_0x22d66e[_0xe068('0x1ab')];_0x2155b7=_0x22d66e['callAdditionalPhoneAfterMin'];_0x3720a6[_0xe068('0xd2')](_0x119a9e)[_0xe068('0xbd')](loggerCatch(_0xe068('0x1c5')));if(_0x3720a6[_0xe068('0x1c0')](0x5,_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e['countbusyretry']>=_0x22d66e[_0xe068('0x1aa')]){_0x3720a6[_0xe068('0xf7')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1c6'));}else{_0x3720a6['stateGlobal'](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1c6'));}}break;case'8':_0x22d66e[_0xe068('0x1c7')]+=0x1;_0x119a9e[_0xe068('0xea')]=0x8;_0x119a9e[_0xe068('0xab')]=_0xe068('0x1c8');_0x119a9e[_0xe068('0x1a6')]+=0x1;_0x119a9e['countglobal']+=0x1;_0x262024=_0x22d66e[_0xe068('0x1ae')];_0x2155b7=_0x22d66e[_0xe068('0x11a')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x4eea14,'congestion'));_0x3720a6['createHistory'](_0x119a9e)[_0xe068('0xbd')](loggerCatch(_0xe068('0x1c9')));if(_0x3720a6[_0xe068('0x1c0')](0x8,_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e[_0xe068('0x1a6')]>=_0x22d66e[_0xe068('0x1ad')]){_0x3720a6['createStateFinal'](_0x119a9e,_0x43a31f,_0x1fe0bd,'reason\x208\x20congestion');}else{_0x3720a6[_0xe068('0xf4')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1ca'));}}break;case'11':_0x22d66e[_0xe068('0x1cb')]+=0x1;_0x119a9e[_0xe068('0xea')]=0xb;_0x119a9e[_0xe068('0xab')]=_0xe068('0x126');_0x119a9e[_0xe068('0x101')]+=0x1;_0x119a9e[_0xe068('0xec')]+=0x1;_0x262024=_0x22d66e[_0xe068('0x124')];_0x2155b7=_0x22d66e['callAdditionalPhoneAfterMin'];_0x3720a6['createHistory'](_0x119a9e)['catch'](loggerCatch(_0xe068('0x1cc')));if(_0x3720a6['checkRetriveMax'](0xb,_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e[_0xe068('0x101')]>=_0x22d66e['dialAbandonedMaxRetry']){_0x3720a6[_0xe068('0xf7')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1cd'));}else{_0x3720a6[_0xe068('0xf4')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1cd'));}}break;case'20':_0x22d66e[_0xe068('0x6b')]+=0x1;_0x119a9e[_0xe068('0xea')]=0x14;_0x119a9e[_0xe068('0xab')]='AgentReject';_0x119a9e[_0xe068('0xf2')]+=0x1;_0x119a9e[_0xe068('0xec')]+=0x1;_0x262024=_0x22d66e[_0xe068('0x1b1')];_0x2155b7=_0x22d66e[_0xe068('0x11a')];ami[_0xe068('0x4f')](_0xe068('0x1ce'),ut['buildObj'](_0x4eea14,_0xe068('0x1cf')));_0x3720a6[_0xe068('0xd2')](_0x119a9e)[_0xe068('0xbd')](loggerCatch(_0xe068('0x1d0')));if(_0x3720a6[_0xe068('0x1c0')](0x14,_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e[_0xe068('0xf2')]>=_0x22d66e[_0xe068('0x1d1')]){_0x3720a6['createStateFinal'](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1d2'));}else{_0x3720a6[_0xe068('0xf4')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0xe068('0x1d2'));}}break;default:_0x22d66e[_0xe068('0x6c')]+=0x1;_0x119a9e['state']=0xc;_0x119a9e[_0xe068('0xab')]=_0x3cfb2b['reason'];_0x262024=_0x22d66e[_0xe068('0x1b1')];_0x2155b7=_0x22d66e[_0xe068('0x11a')];_0x3720a6['createHistory'](_0x119a9e)[_0xe068('0xbd')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3720a6[_0xe068('0x1c0')](_0x3cfb2b['reason'],_0x4eea14,_0x22d66e)&&!_0x305d08){if(_0x119a9e[_0xe068('0xee')]+_0x119a9e[_0xe068('0x1a6')]+_0x119a9e[_0xe068('0xef')]+_0x119a9e[_0xe068('0xf0')]+_0x119a9e['countdropretry']+_0x119a9e['countabandonedretry']+_0x119a9e['countmachineretry']+_0x119a9e[_0xe068('0xf2')]>=_0x22d66e[_0xe068('0xf3')]){_0x3720a6['stateGlobal'](_0x119a9e,_0x43a31f,_0x1fe0bd,_0x3cfb2b[_0xe068('0x10b')]);}else{_0x3720a6[_0xe068('0xf7')](_0x119a9e,_0x43a31f,_0x1fe0bd,_0x3cfb2b[_0xe068('0x10b')]);}}}})[_0xe068('0x3d')](function(){if(_0x305d08){_0x3720a6[_0xe068('0xc1')](_0x119a9e,_0x262024,_0x2155b7)[_0xe068('0x3d')](function(){return _0x43a31f(0x1);});}});});};Dialer[_0xe068('0x1b')][_0xe068('0xf4')]=function(_0x45006b,_0x54b33b,_0x2ac310,_0x5770aa){var _0x142886=new Final(_0x45006b);_0x142886[_0xe068('0xea')]=0xf;_0x142886[_0xe068('0xab')]=_0xe068('0x1d3');this[_0xe068('0xf7')](_0x142886,_0x54b33b,_0x2ac310,_0x5770aa);};Dialer['prototype'][_0xe068('0xf7')]=function(_0x47bc33,_0x117161,_0x4b6913,_0x361747){this[_0xe068('0xd1')](_0x47bc33)[_0xe068('0x3d')](function(){return _0x117161(msgResponse('[callProgressDetecting]',_0xe068('0x1d4'),_0x361747));})[_0xe068('0xbd')](function(){return _0x4b6913(msgResponse(_0xe068('0x1d5'),_0xe068('0x148'),_0xe068('0x1d6')));});};Dialer[_0xe068('0x1b')][_0xe068('0x7')]=function(_0x2c9359){var _0x118c61=_0x2c9359[_0xe068('0x1d7')]/0x64;var _0x495970=_0x2c9359[_0xe068('0x68')]/(_0x2c9359[_0xe068('0x68')]+_0x2c9359['outboundAnswerCallsDay']);var _0x4080d1=Math[_0xe068('0x1d8')](_0x2c9359[_0xe068('0x72')]*(_0x2c9359[_0xe068('0x1d9')]/0x64));var _0x2e8fbe=Math['round'](_0x2c9359[_0xe068('0x72')]*(_0x2c9359[_0xe068('0x1da')]/0x64));var _0x6465b6=_0x2c9359[_0xe068('0x54')]+_0x2c9359[_0xe068('0x59')];var _0x4e5e21=Math['floor'](_0x2c9359[_0xe068('0x73')]*_0x2c9359[_0xe068('0x75')]*_0x2c9359[_0xe068('0x1db')]*_0x2c9359[_0xe068('0x71')]);if(_[_0xe068('0x3f')](_0x2c9359['startProgressive'])){if(!_['isUndefined'](_0x2c9359[_0xe068('0x26')])){_0x2c9359[_0xe068('0x26')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xe068('0x1dc'));}if(!_[_0xe068('0x3f')](_0x2c9359[_0xe068('0x92')])){loggerPredictive[_0xe068('0x99')](_0xe068('0x1dd'),_0xe068('0x1de'));clearInterval(_0x2c9359['handlePredictive']);_0x2c9359[_0xe068('0x92')]=undefined;}_0x2c9359['startProgressive']=moment()[_0xe068('0x7a')](_0xe068('0xfc'));loggerPredictive[_0xe068('0x7f')](_0x2c9359['name'],'collection\x20data\x20in\x20progressive\x20at',_0x2c9359[_0xe068('0x27')]);this[_0xe068('0x15f')](_0x2c9359,0x1);}else if(ifInterval(_0x2c9359[_0xe068('0x1df')],_0x2c9359['startProgressive'])){this[_0xe068('0x15f')](_0x2c9359,0x1);loggerPredictiveCalls[_0xe068('0x7f')](_0xe068('0x1e0'),_0x2c9359[_0xe068('0x27')],_0x2c9359['name']);_0x2c9359[_0xe068('0x73')]=0x0;_0x2c9359[_0xe068('0x116')]=0x0;}else if(_0x118c61<_0x495970&&_0x2c9359['dialPredictiveOptimization']===_0xe068('0x1e1')){freeVariablesPredictive(_0x2c9359);loggerPredictive[_0xe068('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x495970,_0xe068('0x27'),_0x2c9359['name']);}else if(_0x4e5e21<_0x2c9359['predictiveIntervalErlangCallsDroppedCalls']&&_0x2c9359['dialPredictiveOptimization']===_0xe068('0x1e1')){freeVariablesPredictive(_0x2c9359);loggerPredictive[_0xe068('0x7f')](_0xe068('0x1e2'),_0xe068('0x1e3'),_0x4e5e21,_0xe068('0x1e4'),_0x2c9359[_0xe068('0x116')],_0xe068('0x27'),_0x2c9359[_0xe068('0x42')]);}else if(!ifInterval(_0x2c9359[_0xe068('0x1df')],_0x2c9359['startProgressive'])&&_[_0xe068('0x3f')](_0x2c9359[_0xe068('0x26')])&&!_[_0xe068('0x3f')](_0x2c9359['startProgressive'])){_0x2c9359[_0xe068('0x26')]=moment()[_0xe068('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe068('0x7f')](_0x2c9359['name'],'started\x20in\x20predictive\x20at',_0x2c9359['startPredictive']);this['averageHandleTime'](_0x2c9359[_0xe068('0x1df')])[_0xe068('0x3d')](this[_0xe068('0x1e5')](_0x2c9359))[_0xe068('0x3d')](mergeDataErlangB(_0x2c9359))[_0xe068('0x3d')](this[_0xe068('0x1e6')](_0x2c9359))[_0xe068('0xbd')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c9359));}else if(!ifInterval(_0x2c9359['dialPredictiveInterval'],_0x2c9359[_0xe068('0x26')])){_0x2c9359[_0xe068('0x116')]=0x0;_0x2c9359[_0xe068('0x26')]=moment()[_0xe068('0x7a')](_0xe068('0xfc'));loggerPredictive[_0xe068('0x7f')](_0x2c9359['name'],_0xe068('0x1e7'),_0x2c9359[_0xe068('0x26')]);clearInterval(_0x2c9359[_0xe068('0x92')]);_0x2c9359[_0xe068('0x92')]=undefined;this[_0xe068('0x1e8')](_0x2c9359[_0xe068('0x1df')])[_0xe068('0x3d')](this[_0xe068('0x1e5')](_0x2c9359))['then'](mergeDataErlangB(_0x2c9359))[_0xe068('0x3d')](this[_0xe068('0x1e6')](_0x2c9359))['catch'](loggerCatchPredictive(_0xe068('0x1e9'),_0x2c9359));}else if(_0x2c9359[_0xe068('0x72')]&&_0x6465b6<_0x2c9359['predictiveIntervalAvailable']-_0x2e8fbe){freeVariablesPredictive(_0x2c9359);loggerPredictive[_0xe068('0x7f')](_0x2c9359[_0xe068('0x42')],_0xe068('0x1ea'),_0x6465b6,_0xe068('0x1eb'),_0x2c9359[_0xe068('0x72')],'-',_0x2e8fbe,'=',_0x2c9359['predictiveIntervalAvailable']-_0x2e8fbe,')');}else if(_0x2c9359[_0xe068('0x72')]&&_0x6465b6>_0x2c9359[_0xe068('0x72')]+_0x4080d1){freeVariablesPredictive(_0x2c9359);loggerPredictive['info'](_0x2c9359[_0xe068('0x42')],_0xe068('0x1ea'),_0x6465b6,_0xe068('0x1ec'),_0x2c9359[_0xe068('0x72')],'+',_0x4080d1,'=',_0x2c9359[_0xe068('0x72')]+_0x4080d1,')');}};Dialer[_0xe068('0x1b')]['getDataPredictive']=function(_0x263599){var _0x4fa402=this;return function(_0x4e42e8){return new Promise(function(_0x218414,_0x2f57b3){_[_0xe068('0x8f')](_0x263599,_0x4e42e8[0x0]);if(checkGetDataPredictive(_0x4e42e8[0x0])){var _0x138b7c=_0x263599[_0xe068('0x72')]=_0x263599[_0xe068('0x59')]+_0x263599[_0xe068('0x54')];var _0x6be359=_0x263599[_0xe068('0x1df')]*0x3c;var _0x538747=_0x4e42e8[0x0][_0xe068('0x6e')]+_0x4e42e8[0x0]['predictiveIntervalAvgHoldtime'];var _0x54d272=(_0x4e42e8[0x0][_0xe068('0x1ed')]+_0x4e42e8[0x0][_0xe068('0x115')]+_0x4e42e8[0x0][_0xe068('0x6f')])/_0x4e42e8[0x0][_0xe068('0x82')];_0x263599[_0xe068('0x1db')]=_0x54d272>0x0?_0x54d272:0x1;switch(_0x263599['dialPredictiveOptimization']){case _0xe068('0x1e1'):var _0x414c84=_0x263599[_0xe068('0x1d7')]/0x64;return _0x4fa402[_0xe068('0x1ee')](_0x138b7c,_0x6be359,_0x538747,_0x54d272,_0x414c84)[_0xe068('0x3d')](function(_0xd3907e){return _0x218414(_0xd3907e);});case _0xe068('0x1ef'):var _0x4b5452=_0x263599[_0xe068('0x1d7')]/0x64;return _0x4fa402[_0xe068('0x1f0')](_0x138b7c,_0x6be359,_0x538747,_0x54d272,_0x4b5452)[_0xe068('0x3d')](function(_0x37d336){return _0x218414(_0x37d336);});default:return _0x2f57b3(msgResponse(_0xe068('0x1f1'),_0xe068('0x148'),'Unknown\x20Predictive'));}}else{return _0x2f57b3(msgResponse(_0xe068('0x1f1'),_0xe068('0x148'),_0xe068('0x1f2')));}});};};Dialer[_0xe068('0x1b')]['getDataPredictiveOld']=function(_0x10dbe9){var _0x1c50e1=this;return function(_0x49c73b){return new Promise(function(_0x3ffd3e,_0xe9c635){_[_0xe068('0x8f')](_0x10dbe9,_0x49c73b[0x0]);if(checkGetDataPredictive(_0x49c73b[0x0])){loggerPredictive[_0xe068('0x7f')](JSON['stringify'](_0x49c73b[0x0]));if(_0x10dbe9['dialPredictiveOptimization']===_0xe068('0x1e1')){return _0x1c50e1[_0xe068('0xd0')](_0x10dbe9['id'])[_0xe068('0x3d')](function(_0x1388b6){var _0x4075dd=_0x10dbe9[_0xe068('0x168')]-_0x1388b6[0x0][_0xe068('0x1f3')];var _0x21af08=_0x10dbe9[_0xe068('0x1df')]*0x3c;var _0x268871=_0x49c73b[0x0][_0xe068('0x6e')]+_0x49c73b[0x0][_0xe068('0x6d')];var _0x3e7b78=(_0x49c73b[0x0][_0xe068('0x1ed')]+_0x49c73b[0x0][_0xe068('0x115')]+_0x49c73b[0x0][_0xe068('0x6f')])/_0x49c73b[0x0][_0xe068('0x82')];var _0x471807=_0x10dbe9[_0xe068('0x1d7')]/0x64;_0x10dbe9[_0xe068('0x1f4')]=_0x1388b6[0x0][_0xe068('0x1f3')]||0x0;_0x10dbe9['predictiveIntervalHitRate']=_0x3e7b78>0x0?_0x3e7b78:0x1;return _0x1c50e1[_0xe068('0x1ee')](_0x4075dd,_0x21af08,_0x268871,_0x3e7b78,_0x471807);})[_0xe068('0x3d')](function(_0x2baa7c){return _0x3ffd3e(_0x2baa7c);})['catch'](function(_0x35b818){return _0xe9c635(msgResponse(_0xe068('0x1f5'),_0xe068('0x148'),JSON[_0xe068('0x4b')](_0x35b818)));});}if(_0x10dbe9['dialPredictiveOptimization']==='agentBusyFactor'){return _0x1c50e1[_0xe068('0xd0')](_0x10dbe9['id'])[_0xe068('0x3d')](function(_0x3f6105){var _0x3c87e4=_0x10dbe9[_0xe068('0x168')]-_0x3f6105[0x0][_0xe068('0x1f3')];var _0x4a2a43=_0x10dbe9[_0xe068('0x1df')]*0x3c;var _0x5e8d87=_0x49c73b[0x0][_0xe068('0x6e')]+_0x49c73b[0x0][_0xe068('0x6d')];var _0x28fc0f=(_0x49c73b[0x0][_0xe068('0x1ed')]+_0x49c73b[0x0][_0xe068('0x115')]+_0x49c73b[0x0][_0xe068('0x6f')])/_0x49c73b[0x0][_0xe068('0x82')];var _0x2fe7ea=_0x10dbe9['dialPredictiveOptimizationPercentage']/0x64;_0x10dbe9['predictiveIntervalPauses']=_0x3f6105[0x0][_0xe068('0x1f3')]||0x0;_0x10dbe9['predictiveIntervalHitRate']=_0x28fc0f>0x0?_0x28fc0f:0x1;return _0x1c50e1['busyFactor'](_0x3c87e4,_0x4a2a43,_0x5e8d87,_0x28fc0f,_0x2fe7ea);})[_0xe068('0x3d')](function(_0x4b6bc9){return _0x3ffd3e(_0x4b6bc9);})['catch'](function(_0x48837a){return _0xe9c635(msgResponse(_0xe068('0x1f5'),'Failure',JSON[_0xe068('0x4b')](_0x48837a)));});}}else{return _0xe9c635(msgResponse(_0xe068('0x1f1'),_0xe068('0x148'),_0xe068('0x1f2')));}});};};Dialer['prototype'][_0xe068('0x1e6')]=function(_0x966749){var _0x16143a=this;return function(){var _0x2ddebf=0x0;var _0x776d64=Math['floor'](_0x966749['erlangCallToSecond']*0x3e8);if(_0x776d64>0x0){_0x776d64=_0x776d64<0x64?0x64:_0x776d64;loggerPredictive[_0xe068('0x7f')](_0x966749['name'],'one\x20call\x20every:',_0x776d64,_0xe068('0x4c'));_0x966749[_0xe068('0x92')]=setInterval(function(){_0x16143a[_0xe068('0x92')](_0x966749);loggerPredictiveCalls[_0xe068('0x7f')](_0xe068('0x1f6'),_0x2ddebf+=0x1);},_0x776d64);}else{loggerPredictive['info'](_0x966749[_0xe068('0x42')],_0xe068('0x1f7'));}};};Dialer[_0xe068('0x1b')][_0xe068('0x1f8')]=function(_0x2f9bfb,_0x3dda00){var _0xdbd3fe=this;return function(_0x3e8253){if(_[_0xe068('0x48')](_0x3e8253)){if(_[_0xe068('0xb2')](_0x3dda00[_0xe068('0x1f9')])||!_0x3dda00[_0xe068('0x1fa')]){if(_0x2f9bfb['dialMethod']===_0xe068('0x1fb')){_0x2f9bfb[_0xe068('0x130')]=_[_0xe068('0x3f')](_0x2f9bfb[_0xe068('0x130')])?!![]:_0x2f9bfb[_0xe068('0x130')];var _0x1368fe=uuid['v4']();_0xdbd3fe['actions'][_0x1368fe]=new Action(_0x2f9bfb,_0x3dda00,_0x1368fe);loggerBooked['info']('[booked][checkContactBlack]',_0x1368fe,'queueStatusComplete:\x20',JSON[_0xe068('0x4b')](_0x2f9bfb[_0xe068('0x130')]),_0xe068('0x1fc'),_0x2f9bfb[_0xe068('0x42')]);if(_0x2f9bfb['queueStatusComplete']){_0x2f9bfb[_0xe068('0x130')]=![];_0xdbd3fe[_0xe068('0x12c')][_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xb7')]]=[];ami[_0xe068('0x14f')]({'actionid':_0x1368fe,'action':_0xe068('0x1fd'),'queue':_0x2f9bfb[_0xe068('0x42')]})[_0xe068('0xbd')](function(){_0xdbd3fe[_0xe068('0xb6')](_0x2f9bfb);_0xdbd3fe[_0xe068('0xc7')]({'active':![],'ContactId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xd6')],'ListId':_0xdbd3fe['actions'][_0x1368fe]['ListId'],'VoiceQueueId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xd8')]||undefined,'CampaignId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xd9')]||undefined})[_0xe068('0xbd')](loggerCatch(_0xe068('0x1fe')));delete _0xdbd3fe[_0xe068('0xaf')][_0x1368fe];});}else{loggerBooked['info'](_0xe068('0x1ff'),JSON[_0xe068('0x4b')](_0x2f9bfb['queueStatusComplete']),_0xe068('0x1fc'),_0x2f9bfb[_0xe068('0x42')]);_0xdbd3fe['updateOriginated'](_0x2f9bfb);_0xdbd3fe[_0xe068('0xc7')]({'active':![],'ContactId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xd6')],'ListId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xd7')],'VoiceQueueId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe][_0xe068('0xd8')]||undefined,'CampaignId':_0xdbd3fe[_0xe068('0xaf')][_0x1368fe]['CampaignId']||undefined})['catch'](loggerCatch(_0xe068('0x1fe')));delete _0xdbd3fe[_0xe068('0xaf')][_0x1368fe];}}else{return _0xdbd3fe[_0xe068('0x178')](_0x2f9bfb,_0x3dda00);}}else{if(getDiff(_0x3dda00['scheduledat'])<_0x2f9bfb['dialRecallMeTimeout']*0x3c){if(_0x3dda00[_0xe068('0x164')]&&!_0x3dda00[_0xe068('0x164')][_0xe068('0x200')]){_0xdbd3fe[_0xe068('0x93')][_0xe068('0x131')](_0x3dda00['id'])[_0xe068('0x134')](function(){_0xdbd3fe[_0xe068('0xb6')](_0x2f9bfb);});}else{_0xdbd3fe[_0xe068('0xc9')]({'active':![]},_0x3dda00['id'],0x1)['finally'](function(){_0xdbd3fe[_0xe068('0xb6')](_0x2f9bfb);});}}else{_0x2f9bfb['outboundReCallsDay']+=0x1;_0xdbd3fe['updateOriginated'](_0x2f9bfb);if(_0x2f9bfb[_0xe068('0x201')]){_0xdbd3fe[_0xe068('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3dda00[_0xe068('0xd6')],'ListId':_0x3dda00[_0xe068('0xd7')],'VoiceQueueId':_0x3dda00['VoiceQueueId']||undefined,'CampaignId':_0x3dda00[_0xe068('0xd9')]||undefined})['catch'](loggerCatch(_0xe068('0x202')));_0xdbd3fe[_0xe068('0xd2')](createObjHistory(_0x2f9bfb,_0x3dda00,_0xe068('0x203'),0x17,_0xe068('0x204')))['catch'](loggerCatch(_0xe068('0x205')));}else{_0xdbd3fe[_0xe068('0xd5')](createObjHistory(_0x2f9bfb,_0x3dda00,_0xe068('0x206'),0x16,_0xe068('0x207')),_0xe068('0x208'),_0xe068('0x209'));}}}}else{_0x2f9bfb[_0xe068('0x20a')]+=0x1;_0xdbd3fe[_0xe068('0xd5')](createObjHistory(_0x2f9bfb,_0x3dda00,_0xe068('0x20b'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0xe068('0x20c'));throw _0xe068('0x20d');}};};Dialer[_0xe068('0x1b')][_0xe068('0x20e')]=function(_0x4ed086){var _0x15c906=this;var _0x442348=_0x4ed086[_0xe068('0x20f')]-_0x4ed086[_0xe068('0x9b')]-_0x4ed086[_0xe068('0xcc')];emitCampaignSummary(_0x4ed086);if(_0x442348>0x0){if(_0x442348>this[_0xe068('0x22')]){_0x442348=this['maxNumberOriginate'];}_0x4ed086[_0xe068('0xcc')]+=_0x442348;this[_0xe068('0xce')](_0x4ed086['id'],_0x442348,_0x4ed086[_0xe068('0x210')],_0x4ed086)[_0xe068('0x3d')](function(_0x3ded01){_0x4ed086[_0xe068('0xcc')]-=_0x442348;_0x4ed086[_0xe068('0xcc')]=_0x4ed086[_0xe068('0xcc')]>0x0?_0x4ed086[_0xe068('0xcc')]:0x0;if(!checkContactEmpty(_0x3ded01)){_0x4ed086[_0xe068('0x40')]=_0xe068('0xa2');logger[_0xe068('0x7f')](_0xe068('0x211')+_0x4ed086[_0xe068('0x42')]);}else{_0x4ed086[_0xe068('0x9b')]+=_0x3ded01[_0xe068('0x138')];_0x4ed086['message']=_0xe068('0x212');for(var _0x45c461=0x0;_0x45c461<_0x3ded01['length'];_0x45c461+=0x1){_0x4ed086[_0xe068('0x213')]+=0x1;if(_[_0xe068('0xb2')](_0x3ded01[_0x45c461])||_['isNil'](_0x3ded01[_0x45c461][_0xe068('0x193')])||_[_0xe068('0xb2')](_0x3ded01[_0x45c461][_0xe068('0x17b')])){_0x15c906[_0xe068('0x214')](_0xe068('0x215'),_0x4ed086,_0x3ded01[_0x45c461]);}else{_0x15c906[_0xe068('0xc3')](_[_0xe068('0x13c')](_0x3ded01[_0x45c461],['CampaignId','Contact.phone']))[_0xe068('0x3d')](_0x15c906[_0xe068('0x1f8')](_0x4ed086,_0x3ded01[_0x45c461]))[_0xe068('0xbd')](_0x15c906[_0xe068('0x216')](_0xe068('0x217'),_0x4ed086));}}}})[_0xe068('0xbd')](loggerGetContactDialer(_0xe068('0x218'),_0x4ed086,_0x442348));}};Dialer[_0xe068('0x1b')][_0xe068('0x15f')]=function(_0x5bd92e,_0x2e1de2){var _0x25c306=this;var _0x467336=[];var _0x4579d0=_0x2e1de2>=0x1?_0x2e1de2:0x1;if(_0x5bd92e[_0xe068('0x15d')]===_0xe068('0x1fb')){_0x4579d0=0x1;}var _0x127ad7=Math[_0xe068('0x219')](_0x5bd92e[_0xe068('0x54')]*_0x4579d0)-_0x5bd92e['originated']-_0x5bd92e[_0xe068('0xcc')];emitVoiceQueueSummary(_0x5bd92e);if(_0x5bd92e[_0xe068('0x21a')]>0x0){var _0x48dc72=_0x5bd92e[_0xe068('0x21a')]-_0x5bd92e[_0xe068('0x9b')]-_0x5bd92e['talking']-_0x5bd92e[_0xe068('0xcc')]-_0x5bd92e[_0xe068('0x55')];if(_0x127ad7>_0x48dc72){_0x127ad7=_0x48dc72;}}if(_0x127ad7>0x0){if(_0x5bd92e[_0xe068('0x15d')]==='booked'){_0x127ad7=0x1;}if(_0x127ad7>this[_0xe068('0x22')]){_0x127ad7=this[_0xe068('0x22')];}_0x5bd92e[_0xe068('0xcc')]+=_0x127ad7;for(var _0x42372f in this[_0xe068('0x20')]){if(typeof this[_0xe068('0x20')][_0x42372f]!==_0xe068('0x9c')){if(this[_0xe068('0x20')][_0x42372f][_0xe068('0xea')]===_0xe068('0x21b')&&this[_0xe068('0x20')][_0x42372f][_0xe068('0xb3')]==='reachable'){_0x467336[_0xe068('0x12d')](this[_0xe068('0x20')][_0x42372f]['id']);}}}this[_0xe068('0xcb')](_0x5bd92e['id'],_0x467336,_0x127ad7,_0x5bd92e[_0xe068('0x210')],_0x5bd92e)['then'](function(_0x48df59){_0x5bd92e['temp']-=_0x127ad7;_0x5bd92e[_0xe068('0xcc')]=_0x5bd92e[_0xe068('0xcc')]>0x0?_0x5bd92e[_0xe068('0xcc')]:0x0;if(!checkContactEmpty(_0x48df59)){_0x25c306[_0xe068('0xbb')](_0x5bd92e)['then'](sendMessageReschedule(_0x5bd92e))[_0xe068('0xbd')](loggerCatch('[countReScheduled]\x20'));}else{_0x5bd92e[_0xe068('0x9b')]+=_0x48df59[_0xe068('0x138')];_0x5bd92e[_0xe068('0x40')]=_0x5bd92e['dialMethod']===_0xe068('0x1fb')?_0xe068('0x21c'):_0xe068('0x212');for(var _0x1149c5=0x0;_0x1149c5<_0x48df59[_0xe068('0x138')];_0x1149c5+=0x1){if(_[_0xe068('0xb2')](_0x48df59[_0x1149c5])||_[_0xe068('0xb2')](_0x48df59[_0x1149c5][_0xe068('0x193')])||_['isNil'](_0x48df59[_0x1149c5][_0xe068('0x17b')])){_0x25c306[_0xe068('0x214')](_0xe068('0x215'),_0x5bd92e,_0x48df59[_0x1149c5]);}else{_0x25c306[_0xe068('0xbc')](_['pick'](_0x48df59[_0x1149c5],[_0xe068('0xd8'),_0xe068('0x21d')]))[_0xe068('0x3d')](_0x25c306[_0xe068('0x1f8')](_0x5bd92e,_0x48df59[_0x1149c5]))[_0xe068('0xbd')](_0x25c306[_0xe068('0x216')](_0xe068('0x215'),_0x5bd92e));}}}})[_0xe068('0xbd')](loggerGetContactDialer('[getContactDialer2]',_0x5bd92e,_0x127ad7));}};Dialer[_0xe068('0x1b')]['handlePredictive']=function(_0x45846c){if(_0x45846c[_0xe068('0x21a')]>0x0){var _0x42ffa3=_0x45846c[_0xe068('0x21a')]-_0x45846c[_0xe068('0x9b')]-_0x45846c['talking'];if(_0x42ffa3>0x0){this[_0xe068('0x21e')](_0x45846c);}else{loggerPredictiveCalls['info'](_0xe068('0x21f'));}}else{this[_0xe068('0x21e')](_0x45846c);}};Dialer[_0xe068('0x1b')]['tryOriginatePredictive']=function(_0x12e732){var _0x5c3996=this;var _0x47b805=[];_0x12e732[_0xe068('0x9b')]+=0x1;for(var _0x26e244 in this[_0xe068('0x20')]){if(typeof this[_0xe068('0x20')][_0x26e244]!==_0xe068('0x9c')){if(this['agents'][_0x26e244][_0xe068('0xea')]===_0xe068('0x21b')&&this[_0xe068('0x20')][_0x26e244]['status']==='reachable'){_0x47b805[_0xe068('0x12d')](this[_0xe068('0x20')][_0x26e244]['id']);}}}this[_0xe068('0xcb')](_0x12e732['id'],_0x47b805,0x1,_0x12e732[_0xe068('0x210')],_0x12e732)['then'](function(_0x58e7fe){if(!checkContactEmpty(_0x58e7fe)){checkContactLowerLimitOriginate(_0x12e732,0x1,0x0);_0x5c3996['countReScheduled'](_0x12e732)[_0xe068('0x3d')](sendMessageReschedule(_0x12e732))[_0xe068('0xbd')](loggerCatch(_0xe068('0x220')));}else{_0x12e732['message']=_0xe068('0x212');if(_['isNil'](_0x58e7fe[0x0])||_['isNil'](_0x58e7fe[0x0][_0xe068('0x193')])||_['isNil'](_0x58e7fe[0x0][_0xe068('0x17b')])){_0x5c3996[_0xe068('0x214')]('[actionOriginate]\x20',_0x12e732,_0x58e7fe[0x0]);}else{_0x5c3996[_0xe068('0xbc')](_[_0xe068('0x13c')](_0x58e7fe[0x0],[_0xe068('0xd8'),_0xe068('0x21d')]))[_0xe068('0x3d')](_0x5c3996[_0xe068('0x1f8')](_0x12e732,_0x58e7fe[0x0]))[_0xe068('0xbd')](_0x5c3996[_0xe068('0x216')](_0xe068('0x221'),_0x12e732));}}})[_0xe068('0xbd')](loggerGetContactDialer(_0xe068('0x222'),_0x12e732,0x1));emitVoiceQueueSummary(_0x12e732);};Dialer[_0xe068('0x1b')][_0xe068('0x1ee')]=function(_0x5d4b2c,_0x5cd7b5,_0xc83bfe,_0x418dcc,_0x54328e,_0x4388e8){loggerPredictive[_0xe068('0x7f')](_0xe068('0x223'));loggerPredictive['info'](_0xe068('0x224'),_0x5d4b2c);loggerPredictive[_0xe068('0x7f')](_0xe068('0x225'),_0x5cd7b5);loggerPredictive['info'](_0xe068('0x226'),_0xc83bfe);loggerPredictive[_0xe068('0x7f')](_0xe068('0x227'),_0x418dcc);loggerPredictive['info'](_0xe068('0x228'),_0x54328e);loggerPredictive['info'](_0xe068('0x87'));return new Promise(function(_0x57a817,_0x2a433c){if(_0x5d4b2c<=0x0||isNaN(_0x5d4b2c)){return _0x2a433c(msgResponse(_0xe068('0x229'),_0xe068('0x4a'),_0xe068('0x22a')+_0x5d4b2c));}if(_0xc83bfe<=0x0||isNaN(_0xc83bfe)){return _0x2a433c(msgResponse(_0xe068('0x229'),_0xe068('0x4a'),_0xe068('0x22b')+_0xc83bfe));}if(_0x418dcc<=0x0||isNaN(_0x418dcc)){return _0x2a433c(msgResponse(_0xe068('0x229'),_0xe068('0x4a'),_0xe068('0x22c')+_0x418dcc));}if(_0x5cd7b5<=0x0||isNaN(_0x5cd7b5)){return _0x2a433c(msgResponse(_0xe068('0x229'),'Error',_0xe068('0x22d')+_0x5cd7b5));}if(_0x54328e<=0x0||isNaN(_0x54328e)){return _0x2a433c(msgResponse(_0xe068('0x229'),_0xe068('0x4a'),_0xe068('0x22e')+_0x54328e));}_0x4388e8=_0x4388e8||0x0;var _0x2b4feb=0x1/_0xc83bfe;var _0x419fa5=0x0;var _0x18ac39=0x0;var _0x5245db=0x0;var _0x1237ce=0x0;for(var _0x3bc7a4=0x0;_0x5245db<_0x54328e;_0x3bc7a4+=0x1){_0x18ac39=_0x3bc7a4/_0x5cd7b5;_0x419fa5=(_0x418dcc*_0x18ac39+_0x4388e8)/_0x2b4feb;_0x5245db=erlangb(_0x419fa5,_0x5d4b2c);_0x1237ce=_0x419fa5/_0x5d4b2c*(0x1-erlangb(_0x419fa5,_0x5d4b2c));}return _0x57a817({'erlangCalls':_0x3bc7a4,'erlangCallToSecond':_0x5cd7b5/_0x3bc7a4,'erlangAbandonmentRate':_0x5245db,'erlangBusyFactor':_0x1237ce});});};Dialer[_0xe068('0x1b')][_0xe068('0x1f0')]=function(_0x5ac68e,_0x399668,_0x3aeb76,_0x8ac11e,_0x33f1d1,_0x144b81){loggerPredictive[_0xe068('0x7f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xe068('0x7f')](_0xe068('0x224'),_0x5ac68e);loggerPredictive['info'](_0xe068('0x225'),_0x399668);loggerPredictive[_0xe068('0x7f')](_0xe068('0x226'),_0x3aeb76);loggerPredictive[_0xe068('0x7f')](_0xe068('0x227'),_0x8ac11e);loggerPredictive[_0xe068('0x7f')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33f1d1);loggerPredictive[_0xe068('0x7f')](_0xe068('0x87'));return new Promise(function(_0x446957,_0x1fc77a){if(_0x5ac68e<=0x0||isNaN(_0x5ac68e)){return _0x1fc77a(msgResponse(_0xe068('0x22f'),'Error',_0xe068('0x22a')+_0x5ac68e));}if(_0x3aeb76<=0x0||isNaN(_0x3aeb76)){return _0x1fc77a(msgResponse('[busyFactor]',_0xe068('0x4a'),_0xe068('0x22b')+_0x3aeb76));}if(_0x8ac11e<=0x0||isNaN(_0x8ac11e)){return _0x1fc77a(msgResponse('[busyFactor]',_0xe068('0x4a'),_0xe068('0x22c')+_0x8ac11e));}if(_0x399668<=0x0||isNaN(_0x399668)){return _0x1fc77a(msgResponse(_0xe068('0x22f'),'Error',_0xe068('0x22d')+_0x399668));}if(_0x33f1d1<=0x0||isNaN(_0x33f1d1)){return _0x1fc77a(msgResponse('[busyFactor]','Error',_0xe068('0x230')+_0x33f1d1));}_0x144b81=_0x144b81||0x0;var _0x13a528=0x1/_0x3aeb76;var _0x5d0c01=0x0;var _0x199d5e=0x0;var _0xd505c1=0x0;var _0x1e6dcd=0x0;for(var _0x1b9c70=0x0;_0x1e6dcd<_0x33f1d1;_0x1b9c70+=0x1){_0x199d5e=_0x1b9c70/_0x399668;_0x5d0c01=(_0x8ac11e*_0x199d5e+_0x144b81)/_0x13a528;_0xd505c1=erlangb(_0x5d0c01,_0x5ac68e);_0x1e6dcd=_0x5d0c01/_0x5ac68e*(0x1-erlangb(_0x5d0c01,_0x5ac68e));}return _0x446957({'erlangCalls':_0x1b9c70,'erlangCallToSecond':_0x399668/_0x1b9c70,'erlangAbandonmentRate':_0xd505c1,'erlangBusyFactor':_0x1e6dcd});});};module[_0xe068('0x231')]=Dialer; \ No newline at end of file +var _0x3d01=['[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','add','dialMachineRetryFrequency','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','TIMEOUT','voiceQueue','additional','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','locked','stateinterface','rrmemory','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','Agent:\x20','contactAgent-idHopper:\x20','unlockRR','[booked][RR][finaly]','stringify','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','%s%s','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','originate','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','Error','responsetime','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','[CatchErlangB]','outboundQueuePauses','check\x20failure','erlangCallToSecond','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','uuid','moment','ioredis','../preview/util/util','dialer','../../../config/logger','booked','predictive','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INTERVAL_IS_NULL','[ifTime][Action]','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','erlangCalls','erlangBusyFactor','Trunk','active','md5','format','voice:queue:%s','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','\x22%s\x22\x20<%s>','debug','inspect','stack','error','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','enqueue','isNil','status','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','resolve','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','SIP/%s','unmonitored','createHistory','amdstatus','exten','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','membername','AMD','buildObj','amd','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','HangupInAMD','custom:amd'];(function(_0xf3108c,_0x17b335){var _0xc9dd76=function(_0x4b1cbb){while(--_0x4b1cbb){_0xf3108c['push'](_0xf3108c['shift']());}};_0xc9dd76(++_0x17b335);}(_0x3d01,0x128));var _0x13d0=function(_0x9f8611,_0x14a3cb){_0x9f8611=_0x9f8611-0x0;var _0x18695b=_0x3d01[_0x9f8611];return _0x18695b;};'use strict';var util=require(_0x13d0('0x0'));var _=require('lodash');var uuid=require(_0x13d0('0x1'));var moment=require(_0x13d0('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x13d0('0x3'));var ut=require(_0x13d0('0x4'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x13d0('0x5'));var loggerBooked=require(_0x13d0('0x6'))(_0x13d0('0x7'));var loggerPredictive=require(_0x13d0('0x6'))(_0x13d0('0x8'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x13d0('0x6'))(_0x13d0('0x9'));var ami=require('../ami');config[_0x13d0('0xa')]=_[_0x13d0('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x13d0('0xc'))(new Redis(config[_0x13d0('0xa')]));var cmHopper=require(_0x13d0('0xd'));var cmHopperHistory=require(_0x13d0('0xe'));var cmHopperAdditionalPhone=require(_0x13d0('0xf'));var cmHopperBlack=require(_0x13d0('0x10'));var voiceQueueRt=require(_0x13d0('0x11'));var RpcSetting=require(_0x13d0('0x12'));var Action=require(_0x13d0('0x13'));var History=require(_0x13d0('0x14'));var Final=require(_0x13d0('0x15'));var AgentComplete=require(_0x13d0('0x16'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x13d0('0x17')][_0x13d0('0x18')]||_0x13d0('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x13d0('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x13d0('0x1b')]['enqueue']=function(_0x1ba77c){this[_0x13d0('0x1c')]=this[_0x13d0('0x1c')]?this[_0x13d0('0x1c')][_0x13d0('0x1d')](_0x1ba77c):_0x1ba77c();};function Dialer(_0x22966b,_0x2b061a){this[_0x13d0('0x1e')]=new Sequence();this[_0x13d0('0x1f')]=_0x2b061a;this[_0x13d0('0x20')]=_0x22966b[_0x13d0('0x20')];this[_0x13d0('0x21')]=_0x22966b['campaigns'];this[_0x13d0('0x22')]=_0x22966b[_0x13d0('0x22')];this[_0x13d0('0x23')]=_0x22966b[_0x13d0('0x23')];this['maxNumberOriginate']=config[_0x13d0('0x24')]||0x2;this[_0x13d0('0x25')]={};this['actions']={};this['contactsId']={};this[_0x13d0('0x26')]={};this[_0x13d0('0x27')]={};this[_0x13d0('0x28')]={};this[_0x13d0('0x29')]={};this[_0x13d0('0x2a')]={};this[_0x13d0('0x2b')]={};this[_0x13d0('0x2c')]={};ami['on'](_0x13d0('0x2d'),this['syncAgentConnect'][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x2f'),this[_0x13d0('0x30')][_0x13d0('0x2e')](this));ami['on']('originateresponse',this[_0x13d0('0x31')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x32'),this[_0x13d0('0x33')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x34'),this[_0x13d0('0x9')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x35'),this[_0x13d0('0x36')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x37'),this[_0x13d0('0x38')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x39'),this[_0x13d0('0x3a')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x3b'),this[_0x13d0('0x3c')][_0x13d0('0x2e')](this));ami['on']('queuemember',this[_0x13d0('0x3d')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x3e'),this[_0x13d0('0x3f')]['bind'](this));this['loopCampaigns']();this[_0x13d0('0x40')]();RpcSetting[_0x13d0('0x41')]()[_0x13d0('0x42')](function(_0x538bb1){previewRecallmeReminderInterval=_0x538bb1[_0x13d0('0x43')];});}function isNotNull(_0x39b670){return _0x39b670!==null&&!_[_0x13d0('0x44')](_0x39b670);}function checkIsLoggedIn(_0x267dfb,_0x5239dc){return function(){if(_0x5239dc<=0x0){_0x267dfb[_0x13d0('0x45')]=_0x13d0('0x46');throw _0x267dfb['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3c1098){return _0x3c1098;}function checkIsActive(_0x353bd1,_0x30040d){return function(){if(!isActive(_0x30040d)){_0x353bd1[_0x13d0('0x45')]=_0x13d0('0x47');throw _0x353bd1[_0x13d0('0x48')]+_0x13d0('0x49');}};}function checkInterval(_0x4282fd){return function(){if(!isNotNull(_0x4282fd[_0x13d0('0x4a')])){_0x4282fd[_0x13d0('0x45')]='INTERVAL_IS_NULL';throw _0x4282fd['name']+_0x13d0('0x4b');}if(!isNotNull(_0x4282fd['Interval'][_0x13d0('0x4c')])){_0x4282fd['message']='INTERVAL_IS_NULL';throw _0x4282fd[_0x13d0('0x48')]+_0x13d0('0x4b');}if(!isNotNull(_[_0x13d0('0x4d')](_0x4282fd[_0x13d0('0x4a')][_0x13d0('0x4c')]))){_0x4282fd['message']=_0x13d0('0x4e');throw _0x4282fd['name']+_0x13d0('0x4b');}};}function msgResponse(_0x460ff1,_0x36aa20,_0x5a50da){return{'action':_0x460ff1,'response':_0x36aa20,'message':_0x5a50da,'stack':_0x5a50da};}function myreject(_0x3fd74c){return function(_0x45f812){return _0x3fd74c(msgResponse(_0x13d0('0x4f'),'Error',JSON['stringify'](_0x45f812)));};}function getSeconds(_0x2a9347,_0x28c8fc){var _0x2998c9=moment(_0x2a9347)[_0x13d0('0x50')](0x0);var _0x573839=moment(_0x28c8fc)[_0x13d0('0x50')](0x0);return _0x2998c9[_0x13d0('0x51')](_0x573839,_0x13d0('0x52'));}function emit(_0x280d9c,_0x50c2e4,_0x2d4900){io['to'](_0x280d9c)[_0x13d0('0x53')](_0x50c2e4,_0x2d4900);}function emitVoiceQueueSummary(_0x5a2b03){if(_0x5a2b03[_0x13d0('0x54')]===_0x13d0('0x55')){var _0x2622d8={'id':_0x5a2b03['id'],'name':_0x5a2b03[_0x13d0('0x48')],'strategy':_0x5a2b03[_0x13d0('0x56')],'answered':_0x5a2b03[_0x13d0('0x57')],'available':_0x5a2b03[_0x13d0('0x58')],'loggedIn':_0x5a2b03[_0x13d0('0x59')],'pTalking':_0x5a2b03[_0x13d0('0x5a')],'sumBillable':_0x5a2b03[_0x13d0('0x5b')],'sumDuration':_0x5a2b03[_0x13d0('0x5c')],'sumHoldTime':_0x5a2b03[_0x13d0('0x5d')]||0x0,'talking':_0x5a2b03['talking'],'total':_0x5a2b03[_0x13d0('0x5e')],'type':_0x5a2b03[_0x13d0('0x54')],'unmanaged':_0x5a2b03[_0x13d0('0x5f')],'abandoned':_0x5a2b03[_0x13d0('0x60')],'waiting':_0x5a2b03['waiting'],'loggedInDb':_0x5a2b03[_0x13d0('0x61')],'dialActive':_0x5a2b03[_0x13d0('0x62')],'dialMethod':_0x5a2b03[_0x13d0('0x63')],'dialOriginateCallerIdName':_0x5a2b03['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5a2b03[_0x13d0('0x64')],'dialOriginateTimeout':_0x5a2b03[_0x13d0('0x65')],'dialPrefix':_0x5a2b03[_0x13d0('0x66')],'outboundAnswerAgiCallsDay':_0x5a2b03['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5a2b03[_0x13d0('0x67')],'outboundBlacklistCallsDay':_0x5a2b03[_0x13d0('0x68')],'outboundBusyCallsDay':_0x5a2b03['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5a2b03[_0x13d0('0x69')],'outboundDropCallsDayACS':_0x5a2b03[_0x13d0('0x6a')],'outboundDropCallsDayCallersExit':_0x5a2b03[_0x13d0('0x6b')],'outboundDropCallsDayTimeout':_0x5a2b03[_0x13d0('0x6c')],'outboundNoAnswerCallsDay':_0x5a2b03[_0x13d0('0x6d')],'outboundNoSuchCallsDay':_0x5a2b03[_0x13d0('0x6e')],'outboundOriginateFailureCallsDay':_0x5a2b03[_0x13d0('0x6f')],'outboundReCallsDay':_0x5a2b03['outboundReCallsDay'],'outboundRejectCallsDay':_0x5a2b03[_0x13d0('0x70')],'outboundUnknownCallsDay':_0x5a2b03[_0x13d0('0x71')],'predictiveIntervalAnsweredCalls':_0x5a2b03[_0x13d0('0x72')],'predictiveIntervalAvgHoldtime':_0x5a2b03[_0x13d0('0x73')],'predictiveIntervalAvgTalktime':_0x5a2b03[_0x13d0('0x74')],'predictiveIntervalDroppedCallsCallersExit':_0x5a2b03['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5a2b03['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5a2b03[_0x13d0('0x75')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a2b03[_0x13d0('0x76')],'predictiveIntervalHitRate':_0x5a2b03[_0x13d0('0x77')],'predictiveIntervalMultiplicativeFactor':_0x5a2b03[_0x13d0('0x78')],'predictiveIntervalPauses':_0x5a2b03[_0x13d0('0x79')],'predictiveIntervalAvailable':_0x5a2b03['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5a2b03['predictiveIntervalTotalCalls'],'message':_0x5a2b03[_0x13d0('0x45')],'originated':_0x5a2b03['originated'],'erlangCalls':_0x5a2b03[_0x13d0('0x7a')],'erlangCallToSecond':_0x5a2b03['erlangCallToSecond'],'erlangAbandonmentRate':_0x5a2b03['erlangAbandonmentRate'],'erlangBusyFactor':_0x5a2b03[_0x13d0('0x7b')],'startPredictive':_0x5a2b03[_0x13d0('0x28')],'startProgressive':_0x5a2b03[_0x13d0('0x29')]};if(_0x5a2b03[_0x13d0('0x7c')]){_0x2622d8[_0x13d0('0x7c')]={'id':_0x5a2b03[_0x13d0('0x7c')]['id'],'name':_0x5a2b03[_0x13d0('0x7c')][_0x13d0('0x48')],'active':_0x5a2b03[_0x13d0('0x7c')][_0x13d0('0x7d')],'callerid':_0x5a2b03[_0x13d0('0x7c')]['callerid']};}if(_0x5a2b03[_0x13d0('0x4a')]){_0x2622d8[_0x13d0('0x4a')]={'id':_0x5a2b03[_0x13d0('0x4a')]['id'],'name':_0x5a2b03[_0x13d0('0x4a')]['name']};}var _0x219160=md5(JSON['stringify'](_0x2622d8));if(_0x5a2b03[_0x13d0('0x7e')]!==_0x219160){_0x5a2b03[_0x13d0('0x7e')]=_0x219160;emit(util[_0x13d0('0x7f')](_0x13d0('0x80'),_0x2622d8[_0x13d0('0x48')]),'voice_queue:save',_0x2622d8);}}}function emitCampaignSummary(_0x5245f3){if(_0x5245f3['type']==='ivr'){emit(util['format'](_0x13d0('0x81'),_0x5245f3['name']),_0x13d0('0x82'),_0x5245f3);}}function checkGetDataPredictive(_0x4641f8){if(isNotNull(_0x4641f8)&&!_[_0x13d0('0x4d')](_0x4641f8)){loggerPredictive['info'](_0x13d0('0x83'));loggerPredictive[_0x13d0('0x84')](_0x13d0('0x85'),_0x4641f8[_0x13d0('0x86')]);loggerPredictive['info'](_0x13d0('0x87'),_0x4641f8[_0x13d0('0x72')]);loggerPredictive[_0x13d0('0x84')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4641f8[_0x13d0('0x88')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x89'),_0x4641f8[_0x13d0('0x8a')]);loggerPredictive['info'](_0x13d0('0x8b'),_0x4641f8[_0x13d0('0x73')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x8c'),_0x4641f8[_0x13d0('0x74')]);loggerPredictive['info']('---------------------------');if(_0x4641f8['predictiveIntervalTotalCalls']>0x0){if(!_[_0x13d0('0x44')](_0x4641f8[_0x13d0('0x74')])&&_0x4641f8['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x13d0('0x84')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x4641f8[_0x13d0('0x73')])&&_0x4641f8[_0x13d0('0x73')]>0x0){return!![];}loggerPredictive[_0x13d0('0x84')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x13d0('0x8d'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x28e930){return function(_0x3451bb){loggerPredictive[_0x13d0('0x84')](_0x13d0('0x8e'));loggerPredictive[_0x13d0('0x84')](_0x13d0('0x8f'),_0x3451bb[_0x13d0('0x7a')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x90'),_0x3451bb['erlangCallToSecond']);loggerPredictive['info'](_0x13d0('0x91'),_0x3451bb[_0x13d0('0x92')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x93'),_0x3451bb[_0x13d0('0x7b')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x91'),_0x3451bb[_0x13d0('0x92')]);loggerPredictive['info'](_0x13d0('0x94'));_[_0x13d0('0x95')](_0x28e930,_0x3451bb);};}function getDiff(_0x528fdc){var _0x2be806=moment()['milliseconds'](0x0);var _0xef733=moment(_0x528fdc)[_0x13d0('0x50')](0x0);return _0x2be806[_0x13d0('0x51')](_0xef733,_0x13d0('0x52'));}function ifInterval(_0x4e636e,_0x3f624e){if(_['isUndefined'](_0x3f624e)){return![];}return getDiff(_0x3f624e)<_0x4e636e*0x3c;}function freeVariablesPredictive(_0x312f46){if(isNotNull(_0x312f46)){if(!_[_0x13d0('0x44')](_0x312f46[_0x13d0('0x29')])){_0x312f46['startProgressive']=undefined;loggerPredictive['info'](_0x312f46['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x13d0('0x44')](_0x312f46[_0x13d0('0x28')])){_0x312f46[_0x13d0('0x28')]=undefined;loggerPredictive[_0x13d0('0x84')](_0x312f46[_0x13d0('0x48')],_0x13d0('0x96'));}if(!_['isUndefined'](_0x312f46[_0x13d0('0x97')])){clearInterval(_0x312f46[_0x13d0('0x97')]);_0x312f46[_0x13d0('0x97')]=undefined;loggerPredictive['info'](_0x312f46[_0x13d0('0x48')],_0x13d0('0x98'));}}}function erlangb(_0x4f1e81,_0x1d963d){if(_0x1d963d===0x0){return 0x0;}var _0x672724=0x1;for(var _0x13c4ca=0x1;_0x13c4ca<=_0x1d963d;_0x13c4ca+=0x1){_0x672724=0x1+_0x672724*_0x13c4ca/_0x4f1e81;}return 0x1/_0x672724;}function isVoiceQueueOutbound(_0x590657){return _0x590657===_0x13d0('0x55');}function isNotPreview(_0x1825a2){return _0x1825a2!==_0x13d0('0x1f');}function isCampaignIvr(_0x426ee1){return _0x426ee1===_0x13d0('0x99');}function getCallerId(_0x389993,_0x4ac689,_0x248aeb){if(!_['isUndefined'](_0x248aeb)&&typeof _0x248aeb==='string'&&!_[_0x13d0('0x4d')](_0x248aeb)){if(!_[_0x13d0('0x44')](_0x4ac689)&&typeof _0x4ac689==='string'&&!_[_0x13d0('0x4d')](_0x4ac689)){return util['format'](_0x13d0('0x9a'),_0x4ac689,_0x248aeb);}return util[_0x13d0('0x7f')](_0x13d0('0x9a'),_0x248aeb,_0x248aeb);}if(!_[_0x13d0('0x44')](_0x389993)&&typeof _0x389993==='string'&&!_[_0x13d0('0x4d')](_0x389993)){return _0x389993;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x87ef14,_0x34fa17){return function(_0x13a5b8){freeVariablesPredictive(_0x34fa17);emitVoiceQueueSummary(_0x34fa17);emitCampaignSummary(_0x34fa17);loggerSyncQueueSummary[_0x13d0('0x9b')](_0x87ef14,util[_0x13d0('0x9c')](_0x13a5b8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3507a6,_0x3aed52){return function(_0x3f1afd){loggerPredictive['error'](_0x3aed52['name'],_0x3507a6);loggerPredictive['error'](_0x3f1afd[_0x13d0('0x9d')]);freeVariablesPredictive(_0x3aed52);};}function loggerCatch(_0x40beee){return function(_0x4d167c){logger[_0x13d0('0x9e')](_0x40beee,util[_0x13d0('0x9c')](_0x4d167c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1ee509){return _0x1ee509&&!_[_0x13d0('0x44')](_0x1ee509)&&_0x1ee509[_0x13d0('0x9f')]>0x0;}function decremetOriginate(_0x4cfb03){if(!_[_0x13d0('0x44')](_0x4cfb03)&&_0x4cfb03!==null){if(typeof _0x4cfb03[_0x13d0('0xa0')]!==_0x13d0('0xa1')){if(_0x4cfb03[_0x13d0('0xa0')]>0x0){_0x4cfb03['originated']-=0x1;}else{logger[_0x13d0('0x9e')](_0x13d0('0xa2'));}}}else{logger[_0x13d0('0x9e')](_0x13d0('0xa3'));}}function checkContactLowerLimitOriginate(_0x461dfd,_0x2f4e2d,_0xf304f){if(_0x2f4e2d>_0xf304f){for(var _0x503987=0x0;_0x503987<_0x2f4e2d-_0xf304f;_0x503987+=0x1){decremetOriginate(_0x461dfd);}}}function loggerGetContactDialer(_0x27f147,_0x3e547c,_0x351989){return function(_0xcecc4c){checkContactLowerLimitOriginate(_0x3e547c,_0x351989,0x0);logger['error'](_0x27f147,util[_0x13d0('0x9c')](_0xcecc4c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x526c40){return function(_0x1011eb){if(isNotNull(_0x1011eb)&&isNotNull(_0x1011eb[0x0])){if(_0x1011eb[0x0][_0x13d0('0xa4')]>0x0){_0x526c40['message']=_0x13d0('0xa5');logger['info'](_0x13d0('0xa6')+_0x526c40[_0x13d0('0x48')],_0x1011eb[0x0][_0x13d0('0xa4')],'contacts');}else{_0x526c40['message']=_0x13d0('0xa7');logger[_0x13d0('0x84')](_0x13d0('0xa8')+_0x526c40['name']);}}};}function notSendMessagesQueue(_0x51eec9){if(_0x51eec9[_0x13d0('0xa9')]){freeVariablesPredictive(_0x51eec9);if(_0x51eec9[_0x13d0('0xa0')]===0x0&&_0x51eec9[_0x13d0('0xaa')]===0x0&&_0x51eec9[_0x13d0('0xab')]===0x0&&(_0x51eec9[_0x13d0('0x5a')]||0x0)===0x0){_0x51eec9[_0x13d0('0xa9')]=![];_0x51eec9[_0x13d0('0x58')]=0x0;_0x51eec9['message']=_0x13d0('0x47');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xac'),_0x51eec9['name'],_0x13d0('0xad'));}else{_0x51eec9['message']=_0x13d0('0xae');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xac'),_0x51eec9[_0x13d0('0x48')],_0x13d0('0xaf'));}emitVoiceQueueSummary(_0x51eec9);}}function notSendMessagesCampaign(_0x4f515f){if(_0x4f515f[_0x13d0('0xa9')]){if(_0x4f515f[_0x13d0('0xa0')]===0x0){_0x4f515f[_0x13d0('0xa9')]=![];_0x4f515f[_0x13d0('0x45')]=_0x13d0('0x47');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xb0'),_0x4f515f['name'],_0x13d0('0xad'));}else{_0x4f515f['message']=_0x13d0('0xae');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xb0'),_0x4f515f[_0x13d0('0x48')],_0x13d0('0xaf'));}emitCampaignSummary(_0x4f515f);}}function createObjHistory(_0x3685d9,_0x468f8d,_0x3776fe,_0x81faeb,_0x5bb142){_0x3685d9[_0x13d0('0x45')]=_0x3776fe;var _0x3143f1=new Action(_0x3685d9,_0x468f8d);var _0x3159ab=new History(_0x3143f1);_0x3159ab[_0x13d0('0xb1')]=_0x81faeb;_0x3159ab[_0x13d0('0xb2')]=_0x5bb142;_0x3159ab['endtime']=_0x3143f1[_0x13d0('0xb3')];return _0x3159ab;}Dialer['prototype'][_0x13d0('0x40')]=function(){var _0x32071c=this;setInterval(function(){_0x32071c['clearZombieChannels'](_0x32071c[_0x13d0('0x26')],_0x13d0('0xb4'));_0x32071c[_0x13d0('0xb5')](_0x32071c[_0x13d0('0xb6')],_0x13d0('0xb7'));},0x32c8);};Dialer[_0x13d0('0x1b')][_0x13d0('0xb5')]=function(_0x5ab305,_0x2c301a){var _0x52c7be=this;for(var _0x460558 in _0x5ab305){if(typeof _0x5ab305[_0x460558]!==_0x13d0('0xa1')){this['sequence'][_0x13d0('0xb8')](function(){if(!_[_0x13d0('0xb9')](_0x5ab305[_0x460558])){return ami['Action']({'action':_0x13d0('0xba'),'channel':_0x5ab305[_0x460558][_0x13d0('0xbb')]})['catch'](function(_0x3bad04){if(_0x3bad04[_0x13d0('0x45')]===_0x13d0('0xbc')){setTimeout(function(){if(_0x5ab305[_0x460558]&&_0x5ab305[_0x460558][_0x13d0('0x54')]!==_0x13d0('0x99')){_0x52c7be['updateOriginated'](_0x52c7be[_0x13d0('0x20')][_0x5ab305[_0x460558][_0x13d0('0xbd')]]);logger[_0x13d0('0x9e')](_0x13d0('0xbe'),_0x2c301a,_0x460558,_0x5ab305[_0x460558][_0x13d0('0xbd')]);delete _0x5ab305[_0x460558];}if(_0x5ab305[_0x460558]&&_0x5ab305[_0x460558][_0x13d0('0x54')]===_0x13d0('0x99')){_0x52c7be[_0x13d0('0xbf')](_0x52c7be[_0x13d0('0x21')][_0x5ab305[_0x460558][_0x13d0('0xbd')]]);logger[_0x13d0('0x9e')](_0x13d0('0xc0'),_0x2c301a,_0x460558,_0x5ab305[_0x460558][_0x13d0('0xbd')]);delete _0x5ab305[_0x460558];}},0x2328);}});}});}}};Dialer[_0x13d0('0x1b')]['countReScheduled']=function(_0x211940){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopper[_0x13d0('0xc2')](_0x211940))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xc4')));};Dialer['prototype'][_0x13d0('0xc5')]=function(_0x49d02f){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperBlack['checkIsBlackList'](_0x49d02f))['catch'](loggerCatch(_0x13d0('0xc6')));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x1b7c4d,_0x3a7b93,_0x19fd0b){return Promise[_0x13d0('0xc1')]()['then'](cmHopperAdditionalPhone[_0x13d0('0xc7')](_0x1b7c4d,_0x3a7b93,_0x19fd0b))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xc8')));};Dialer[_0x13d0('0x1b')]['swapAdditionalPhones']=function(_0x117678,_0x2dd6c2,_0x2c977a){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperAdditionalPhone[_0x13d0('0xc9')](_0x117678,_0x2dd6c2,_0x2c977a))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xca')));};Dialer[_0x13d0('0x1b')][_0x13d0('0xcb')]=function(_0x188709){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperBlack['checkIsBlackListIvr'](_0x188709))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xcc')));};Dialer['prototype'][_0x13d0('0xcd')]=function(_0x21006f){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperHistory[_0x13d0('0xce')](_0x21006f))['catch'](loggerCatch(_0x13d0('0xcf')));};Dialer[_0x13d0('0x1b')][_0x13d0('0xd0')]=function(_0xa32f8f){return Promise['resolve']()[_0x13d0('0x42')](cmHopper[_0x13d0('0xd0')](_0xa32f8f))[_0x13d0('0xc3')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x13d0('0xd1')]=function(_0x1385fe,_0x30d4e0,_0x57db17){return Promise[_0x13d0('0xc1')]()['then'](cmHopper[_0x13d0('0xd1')](_0x1385fe,_0x30d4e0,_0x57db17))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xd2')));};Dialer[_0x13d0('0x1b')][_0x13d0('0xd3')]=function(_0x5c608c,_0x644dc,_0x2aaf24,_0x233efc,_0x2bc2cc){return Promise['resolve']()[_0x13d0('0x42')](cmHopper[_0x13d0('0xd3')](_0x5c608c,_0x644dc,_0x2aaf24,_0x233efc))[_0x13d0('0xc3')](function(_0x452ab9){_0x2bc2cc[_0x13d0('0xd4')]-=_0x2aaf24;_0x2bc2cc[_0x13d0('0xd4')]=_0x2bc2cc[_0x13d0('0xd4')]>0x0?_0x2bc2cc[_0x13d0('0xd4')]:0x0;loggerCatch(_0x13d0('0xd5'))(_0x452ab9);});};Dialer[_0x13d0('0x1b')][_0x13d0('0xd6')]=function(_0x2873bd,_0x5507bb,_0x1ca352,_0x39c174){return Promise[_0x13d0('0xc1')]()['then'](cmHopper['getContactDialerIvr'](_0x2873bd,_0x5507bb,_0x1ca352))[_0x13d0('0xc3')](function(_0x4db323){_0x39c174['temp']-=_0x5507bb;_0x39c174[_0x13d0('0xd4')]=_0x39c174[_0x13d0('0xd4')]>0x0?_0x39c174[_0x13d0('0xd4')]:0x0;loggerCatch(_0x13d0('0xd7'))(_0x4db323);});};Dialer['prototype'][_0x13d0('0xd8')]=function(_0x41a164){return Promise['resolve']()[_0x13d0('0x42')](voiceQueueRt['getVoiceQueueRtPauses'](_0x41a164))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xd9')));};Dialer['prototype'][_0x13d0('0xda')]=function(_0x5a6a05){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopper[_0x13d0('0xda')](_0x5a6a05))[_0x13d0('0xc3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x13d0('0x1b')]['createHistory']=function(_0xdef186){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperHistory['createHistory'](_0xdef186))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xdb')));};Dialer[_0x13d0('0x1b')]['updateOriginated']=function(_0x412307){if(!_[_0x13d0('0x44')](_0x412307)&&_0x412307!==null){if(typeof _0x412307[_0x13d0('0xa0')]!==_0x13d0('0xa1')){if(_0x412307[_0x13d0('0xa0')]>0x0){_0x412307[_0x13d0('0xa0')]-=0x1;}else{logger[_0x13d0('0x9e')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x13d0('0xdc'));}};Dialer[_0x13d0('0x1b')][_0x13d0('0xdd')]=function(_0x2ff38b,_0x4480be){var _0x3fd591=this;return function(_0x575745){_0x3fd591['updateOriginated'](_0x4480be);logger[_0x13d0('0x9e')](_0x2ff38b,util[_0x13d0('0x9c')](_0x575745,{'showHidden':![],'depth':null}));};};Dialer[_0x13d0('0x1b')][_0x13d0('0xde')]=function(_0x46ed44,_0x1ea178,_0x25bde2){var _0x56b233={'state':0x19,'statedesc':_0x13d0('0xdf')};this[_0x13d0('0xbf')](_0x1ea178);this[_0x13d0('0xe0')](_[_0x13d0('0x95')](_0x56b233,_[_0x13d0('0xe1')](_0x25bde2,[_0x13d0('0xe2'),'ListId',_0x13d0('0xe3'),_0x13d0('0xe4'),_0x13d0('0xe5')])),_0x13d0('0xe6'),_0x13d0('0xe7'));logger['error'](_0x46ed44);};Dialer['prototype']['isSuccess']=function(_0x2763ba){return _0x2763ba===_0x13d0('0xe8');};Dialer['prototype']['isTrunkReachable']=function(_0x5eacf1){return!_['isUndefined'](_0x5eacf1)&&_0x5eacf1&&!_[_0x13d0('0x44')](_0x5eacf1[_0x13d0('0x48')])&&!_[_0x13d0('0x44')](_0x5eacf1[_0x13d0('0x7d')])&&_0x5eacf1[_0x13d0('0x7d')]&&(this[_0x13d0('0x23')][util[_0x13d0('0x7f')](_0x13d0('0xe9'),_0x5eacf1[_0x13d0('0x48')])][_0x13d0('0xba')]==='reachable'||this[_0x13d0('0x23')][util[_0x13d0('0x7f')](_0x13d0('0xe9'),_0x5eacf1[_0x13d0('0x48')])]['status']===_0x13d0('0xea'));};Dialer[_0x13d0('0x1b')]['saveInDb']=function(_0x4d0311,_0x5df6f4,_0x35e26c){this[_0x13d0('0xeb')](_0x4d0311)[_0x13d0('0xc3')](loggerCatch(_0x5df6f4));this[_0x13d0('0xda')](_0x4d0311)[_0x13d0('0xc3')](loggerCatch(_0x35e26c));};Dialer[_0x13d0('0x1b')][_0x13d0('0x3c')]=function(_0x33c511){var _0x23ca49=this;var _0x304389=this[_0x13d0('0x26')][_0x33c511['uniqueid']];var _0x5b9feb;if(!_[_0x13d0('0xb9')](_0x33c511)&&!_['isNil'](_0x33c511['variable'])&&!_[_0x13d0('0xb9')](_0x33c511['variable'][_0x13d0('0xec')])&&_0x33c511[_0x13d0('0xed')]==='xcally-motion-dialer'&&_0x304389){if(_0x304389['type']!==_0x13d0('0x99')&&this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]]['dialAMDActive']&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xef')){delete this['uniqueId'][_0x33c511[_0x13d0('0xf0')]];this['updateOriginated'](this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]]);this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0x67')]+=0x1;this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf1')]+=0x1;_0x5b9feb=new Hangup(_0x304389,_0x33c511);_0x5b9feb[_0x13d0('0xb1')]=0x12;_0x5b9feb['statedesc']='HangupInAMD';_0x5b9feb[_0x13d0('0xf2')]=_0x13d0('0xf3');ami[_0x13d0('0x53')]('custom:amd',ut[_0x13d0('0xf4')](_0x5b9feb,_0x13d0('0xf5')));this['saveInDb'](_0x5b9feb,'[syncHangupInAMD][createHistory]',_0x13d0('0xf6'));}if(_0x304389[_0x13d0('0x54')]!==_0x13d0('0x99')&&this['voiceQueues'][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf7')]&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xf8')){return new Promise(function(_0x4aef4f,_0xebc040){delete _0x23ca49[_0x13d0('0x26')][_0x33c511['uniqueid']];_0x23ca49['updateOriginated'](_0x23ca49['voiceQueues'][_0x304389[_0x13d0('0xbd')]]);_0x23ca49[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0x67')]+=0x1;_0x23ca49[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xef91a2=_0x23ca49[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]];var _0x78ea1c=new Hangup(_0x304389,_0x33c511);_0x78ea1c[_0x13d0('0xb1')]=0x13;_0x78ea1c['statedesc']=_0x13d0('0xf9');_0x78ea1c['membername']=_0x13d0('0xf3');_0x78ea1c['countmachineretry']+=0x1;_0x78ea1c[_0x13d0('0xfa')]+=0x1;_0x78ea1c['amd']=!![];ami[_0x13d0('0x53')]('custom:amd',ut[_0x13d0('0xf4')](_0x78ea1c,'amd'));_0x23ca49[_0x13d0('0xeb')](_0x78ea1c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xfb')));if(_0x78ea1c[_0x13d0('0xfc')]+_0x78ea1c[_0x13d0('0xfd')]+_0x78ea1c[_0x13d0('0xfe')]+_0x78ea1c[_0x13d0('0xff')]+_0x78ea1c[_0x13d0('0x100')]+_0x78ea1c[_0x13d0('0x101')]+_0x78ea1c[_0x13d0('0x102')]+_0x78ea1c[_0x13d0('0x103')]>=_0xef91a2['dialGlobalMaxRetry']){_0x23ca49[_0x13d0('0x104')](_0x78ea1c,_0x4aef4f,_0xebc040,_0x13d0('0x105'));}else{if(_0x78ea1c[_0x13d0('0x102')]>=_0xef91a2[_0x13d0('0x106')]){_0x23ca49[_0x13d0('0x107')](_0x78ea1c,_0x4aef4f,_0xebc040,_0x13d0('0x108'));}else{_0x23ca49[_0x13d0('0xd0')]({'active':![],'countmachineretry':_0x78ea1c[_0x13d0('0x102')],'scheduledat':moment()['add'](_0xef91a2['dialMachineRetryFrequency'],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x78ea1c[_0x13d0('0xe2')],'ListId':_0x78ea1c[_0x13d0('0x10b')],'VoiceQueueId':_0x78ea1c[_0x13d0('0xe4')]||undefined,'CampaignId':_0x78ea1c['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x10c')));_0x4aef4f({'reschedule':0x1});}}});}if(_0x304389[_0x13d0('0x54')]==='ivr'&&this['campaigns'][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf7')]&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xef')){delete this['uniqueId'][_0x33c511['uniqueid']];this[_0x13d0('0xbf')](this[_0x13d0('0x21')][_0x304389['queue']]);_0x5b9feb=new Hangup(_0x304389,_0x33c511);_0x5b9feb[_0x13d0('0xb1')]=0x12;_0x5b9feb[_0x13d0('0xb2')]=_0x13d0('0x10d');_0x5b9feb[_0x13d0('0xf2')]=_0x13d0('0xf3');ami[_0x13d0('0x53')](_0x13d0('0x10e'),ut[_0x13d0('0xf4')](_0x5b9feb,_0x13d0('0xf5')));this[_0x13d0('0xe0')](_0x5b9feb,_0x13d0('0x10f'),_0x13d0('0x110'));}if(_0x304389[_0x13d0('0x54')]===_0x13d0('0x99')&&this[_0x13d0('0x21')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf7')]&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xf8')){return new Promise(function(_0x1f59e0,_0x837b18){delete _0x23ca49[_0x13d0('0x26')][_0x33c511['uniqueid']];_0x23ca49[_0x13d0('0xbf')](_0x23ca49[_0x13d0('0x21')][_0x304389[_0x13d0('0xbd')]]);_0x23ca49['campaigns'][_0x304389['queue']][_0x13d0('0x67')]+=0x1;_0x23ca49[_0x13d0('0x21')][_0x304389[_0x13d0('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xf3405f=_0x23ca49[_0x13d0('0x21')][_0x304389['queue']];var _0x21109a=new Hangup(_0x304389,_0x33c511);_0x21109a['state']=0x13;_0x21109a[_0x13d0('0xb2')]=_0x13d0('0xf9');_0x21109a[_0x13d0('0xf2')]=_0x13d0('0xf3');_0x21109a[_0x13d0('0x102')]+=0x1;_0x21109a[_0x13d0('0xfa')]+=0x1;_0x21109a[_0x13d0('0xf5')]=!![];ami[_0x13d0('0x53')](_0x13d0('0x10e'),ut[_0x13d0('0xf4')](_0x21109a,_0x13d0('0xf5')));_0x23ca49['createHistory'](_0x21109a)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xfb')));if(_0x21109a[_0x13d0('0xfc')]+_0x21109a[_0x13d0('0xfd')]+_0x21109a[_0x13d0('0xfe')]+_0x21109a[_0x13d0('0xff')]+_0x21109a['countdropretry']+_0x21109a['countabandonedretry']+_0x21109a[_0x13d0('0x102')]+_0x21109a[_0x13d0('0x103')]>=_0xf3405f['dialGlobalMaxRetry']){_0x23ca49[_0x13d0('0x104')](_0x21109a,_0x1f59e0,_0x837b18,_0x13d0('0x105'));}else{if(_0x21109a[_0x13d0('0x102')]>=_0xf3405f['dialMachineMaxRetry']){_0x23ca49[_0x13d0('0x107')](_0x21109a,_0x1f59e0,_0x837b18,_0x13d0('0x108'));}else{_0x23ca49[_0x13d0('0xd0')]({'active':![],'countmachineretry':_0x21109a['countmachineretry'],'scheduledat':moment()[_0x13d0('0x111')](_0xf3405f[_0x13d0('0x112')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x21109a['ContactId'],'ListId':_0x21109a['ListId'],'VoiceQueueId':_0x21109a[_0x13d0('0xe4')]||undefined,'CampaignId':_0x21109a[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x10c')));_0x1f59e0({'reschedule':0x1});}}});}}};Dialer[_0x13d0('0x1b')][_0x13d0('0x38')]=function(_0x5e5a82){var _0x3aaf52=this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];var _0x57d86c;if(_0x3aaf52&&_0x3aaf52['type']===_0x13d0('0x99')){delete this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this[_0x13d0('0x21')][_0x3aaf52[_0x13d0('0xbd')]]);this[_0x13d0('0x21')][_0x3aaf52[_0x13d0('0xbd')]]['ivrAnswerCallsDay']+=0x1;_0x57d86c=new Hangup(_0x3aaf52,_0x5e5a82);this[_0x13d0('0xeb')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x113')));this[_0x13d0('0xda')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x114')));}if(_0x3aaf52&&_0x3aaf52[_0x13d0('0x54')]!==_0x13d0('0x99')&&isNotNull(this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]][_0x13d0('0x115')])){delete this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this['voiceQueues'][_0x3aaf52[_0x13d0('0xbd')]]);this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]][_0x13d0('0x67')]+=0x1;this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;_0x57d86c=new Hangup(_0x3aaf52,_0x5e5a82);_0x57d86c['state']=0x10;_0x57d86c[_0x13d0('0xb2')]=_0x13d0('0x116');_0x57d86c[_0x13d0('0xf2')]='AGI';this[_0x13d0('0xeb')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x113')));this[_0x13d0('0xda')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch('[syncHangupIvr]'));}if(_0x3aaf52&&_0x3aaf52[_0x13d0('0x54')]!==_0x13d0('0x99')&&!isNotNull(this[_0x13d0('0x20')][_0x3aaf52['queue']]['dialQueueProject'])){delete this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this['voiceQueues'][_0x3aaf52[_0x13d0('0xbd')]]);this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]][_0x13d0('0x71')]+=0x1;_0x57d86c=new Hangup(_0x3aaf52,_0x5e5a82);_0x57d86c[_0x13d0('0xb1')]=0xc;_0x57d86c[_0x13d0('0xb2')]=_0x5e5a82[_0x13d0('0x117')];_0x57d86c['membername']=_0x13d0('0x118');this[_0x13d0('0xeb')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x113')));this['moveContactManagedDialer'](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x114')));}};Dialer[_0x13d0('0x1b')]['syncAgentComplete']=function(_0x506e66){var _0x138150=this[_0x13d0('0x26')][_0x506e66[_0x13d0('0xf0')]];if(this[_0x13d0('0x20')][_0x506e66[_0x13d0('0xbd')]]){if(_0x138150&&_0x138150['type']!==_0x13d0('0x99')){delete this[_0x13d0('0x26')][_0x506e66['uniqueid']];this[_0x13d0('0x20')][_0x506e66['queue']][_0x13d0('0x67')]+=0x1;var _0x18817e=new AgentComplete(_0x138150,_0x506e66);if(_0x506e66['reason']==='agent'){_0x18817e[_0x13d0('0x119')]=this[_0x13d0('0x20')][_0x506e66[_0x13d0('0xbd')]][_0x13d0('0x11a')]&&this['voiceQueues'][_0x506e66[_0x13d0('0xbd')]][_0x13d0('0x11b')]?moment()[_0x13d0('0x7f')](_0x13d0('0x10a')):undefined;}this[_0x13d0('0xeb')](_0x18817e)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x11c')));this[_0x13d0('0xda')](_0x18817e)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x13d0('0x1b')][_0x13d0('0x11d')]=function(_0x423417){if(this[_0x13d0('0x20')][_0x423417[_0x13d0('0xbd')]]){if(this['uniqueId'][_0x423417[_0x13d0('0xf0')]]&&this[_0x13d0('0x26')][_0x423417[_0x13d0('0xf0')]][_0x13d0('0x54')]!=='ivr'){this[_0x13d0('0xbf')](this[_0x13d0('0x20')][_0x423417[_0x13d0('0xbd')]]);this[_0x13d0('0x26')][_0x423417[_0x13d0('0xf0')]][_0x13d0('0x11e')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));}}};Dialer[_0x13d0('0x1b')][_0x13d0('0x11f')]=function(_0x161f24,_0x5edc36){this['createHistory'](_0x161f24)['catch'](loggerCatch(_0x13d0('0x11c')));if(_0x5edc36==0x0){this[_0x13d0('0xda')](_0x161f24)['catch'](loggerCatch(_0x13d0('0x120')));}};Dialer['prototype'][_0x13d0('0x30')]=function(_0x7307e1){var _0x15f0c3=this[_0x13d0('0x26')][_0x7307e1[_0x13d0('0xf0')]];var _0x3ce5de=this;var _0x504040=![];var _0x2f44a0;var _0x5d942a;if(this['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]){if(_0x15f0c3&&_0x15f0c3[_0x13d0('0x54')]!==_0x13d0('0x99')){delete this[_0x13d0('0x26')][_0x7307e1[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]]);_0x15f0c3[_0x13d0('0x121')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));var _0x44ec82=new QueueCallerAbandon(_0x15f0c3,_0x7307e1);if(getSeconds(_0x15f0c3[_0x13d0('0x121')],_0x15f0c3['responsetime'])>=_0x15f0c3[_0x13d0('0x122')]){this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x88')]+=0x1;this[_0x13d0('0x20')][_0x7307e1['queue']][_0x13d0('0x6c')]+=0x1;this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x76')]+=0x1;_0x44ec82[_0x13d0('0xb1')]=0xa;_0x44ec82['statedesc']='Drop';_0x44ec82['dropreason']=_0x13d0('0x123');_0x44ec82[_0x13d0('0x119')]=this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x11a')]?moment()[_0x13d0('0x7f')](_0x13d0('0x10a')):undefined;_0x44ec82['countdropretry']+=0x1;_0x44ec82['countglobal']+=0x1;_0x2f44a0=this[_0x13d0('0x20')][_0x7307e1['queue']]['dialDropRetryFrequency'];_0x5d942a=this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]]['callAdditionalPhoneAfterMin'];_0x3ce5de[_0x13d0('0xc7')](_0x44ec82,_0x44ec82[_0x13d0('0xb1')],_0x15f0c3[_0x13d0('0x124')])[_0x13d0('0x42')](function(_0x2c2ef9){_0x504040=_0x2c2ef9['additional']==0x1;if(_0x44ec82['countdropretry']>=_0x3ce5de['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]['dialDropMaxRetry']){_0x3ce5de[_0x13d0('0x11f')](_0x44ec82,_0x2c2ef9[_0x13d0('0x125')]);}else{_0x3ce5de[_0x13d0('0xd0')]({'active':![],'countdropretry':_0x44ec82[_0x13d0('0x100')],'scheduledat':moment()[_0x13d0('0x111')](_0x3ce5de['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x126')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x15f0c3[_0x13d0('0xe2')],'ListId':_0x15f0c3['ListId'],'VoiceQueueId':_0x15f0c3[_0x13d0('0xe4')]||undefined,'CampaignId':_0x15f0c3[_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x127')));var _0x25d5dc=new History(_0x44ec82);_0x25d5dc[_0x13d0('0xb1')]=0xa;_0x25d5dc[_0x13d0('0xb2')]='Drop';_0x25d5dc[_0x13d0('0xb3')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));_0x25d5dc[_0x13d0('0x128')]=_0x25d5dc['starttime'];_0x25d5dc[_0x13d0('0x129')]=_0x44ec82['calleridname'];_0x25d5dc[_0x13d0('0x12a')]=_0x44ec82[_0x13d0('0x12a')];_0x3ce5de['createHistory'](_0x25d5dc)['catch'](loggerCatch(_0x13d0('0x12b')));}})[_0x13d0('0x42')](function(){if(_0x504040)_0x3ce5de['swapAdditionalPhones'](_0x44ec82,_0x2f44a0,_0x5d942a)[_0x13d0('0x42')](function(){return 0x1;});});}else{this['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x13d0('0x20')][_0x7307e1['queue']][_0x13d0('0x6b')]+=0x1;_0x44ec82[_0x13d0('0xb1')]=0xb;_0x44ec82[_0x13d0('0xb2')]=_0x13d0('0x12c');_0x44ec82[_0x13d0('0x12d')]=_0x13d0('0x12e');_0x44ec82[_0x13d0('0x101')]+=0x1;_0x44ec82['countglobal']+=0x1;_0x2f44a0=this['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]['dialAbandonedRetryFrequency'];_0x5d942a=this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x12f')];_0x3ce5de[_0x13d0('0xc7')](_0x44ec82,_0x44ec82[_0x13d0('0xb1')],_0x15f0c3[_0x13d0('0x124')])['then'](function(_0x53e014){if(_0x44ec82[_0x13d0('0x101')]>=_0x3ce5de['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x130')]){_0x3ce5de[_0x13d0('0x11f')](_0x44ec82,_0x53e014[_0x13d0('0x125')]);}else{_0x3ce5de['rescheduleContact']({'active':![],'countabandonedretry':_0x44ec82[_0x13d0('0x101')],'scheduledat':moment()['add'](_0x3ce5de[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x131')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x15f0c3['ContactId'],'ListId':_0x15f0c3[_0x13d0('0x10b')],'VoiceQueueId':_0x15f0c3[_0x13d0('0xe4')]||undefined,'CampaignId':_0x15f0c3[_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x132')));var _0x3b162e=new History(_0x44ec82);_0x3b162e[_0x13d0('0xb1')]=0xb;_0x3b162e['statedesc']=_0x13d0('0x12c');_0x3b162e[_0x13d0('0xb3')]=moment()[_0x13d0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b162e['endtime']=_0x3b162e[_0x13d0('0xb3')];_0x3b162e['calleridname']=_0x44ec82['calleridname'];_0x3b162e[_0x13d0('0x12a')]=_0x44ec82[_0x13d0('0x12a')];_0x3ce5de['createHistory'](_0x3b162e)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x133')));}})[_0x13d0('0x42')](function(){if(_0x504040)_0x3ce5de[_0x13d0('0xc9')](_0x44ec82,_0x2f44a0,_0x5d942a)[_0x13d0('0x42')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0xec184a){if(this[_0x13d0('0xb6')][_0xec184a[_0x13d0('0xf0')]]){this[_0x13d0('0xb6')][_0xec184a[_0x13d0('0xf0')]][_0x13d0('0xbb')]=_0xec184a[_0x13d0('0xbb')];}if(this[_0x13d0('0x26')][_0xec184a[_0x13d0('0xf0')]]){this[_0x13d0('0x26')][_0xec184a[_0x13d0('0xf0')]]['channel']=_0xec184a[_0x13d0('0xbb')];}};Dialer[_0x13d0('0x1b')][_0x13d0('0x3d')]=function(_0x1dfd1c){if(strategy[this['voiceQueues'][this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0xbd')]][_0x13d0('0x56')]]===_0x13d0('0x1a')){if(this['actions'][_0x1dfd1c['actionid']]&&_[_0x13d0('0xb9')](this['actions'][_0x1dfd1c[_0x13d0('0x134')]]['locked'])&&_0x1dfd1c[_0x13d0('0xba')]==='1'&&_0x1dfd1c[_0x13d0('0x135')]==='0'){if(this[_0x13d0('0x22')][_0x1dfd1c['stateinterface']]){if(!this['agents'][_0x1dfd1c['stateinterface']][_0x13d0('0x136')]){this[_0x13d0('0x22')][_0x1dfd1c[_0x13d0('0x137')]][_0x13d0('0x136')]=!![];this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0x136')]=!![];this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0x137')]=_0x1dfd1c[_0x13d0('0x137')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0xbd')]]['strategy']]||'rrmemory')===_0x13d0('0x138')){if(this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]]){if(this[_0x13d0('0x22')][_0x1dfd1c[_0x13d0('0x137')]]){this['actions'][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0x137')]=_0x1dfd1c[_0x13d0('0x137')];if(_[_0x13d0('0xb9')](this['queueBooked'][this['actions'][_0x1dfd1c['actionid']][_0x13d0('0xbd')]])){this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]]['queue']]=[];}this[_0x13d0('0x2b')][this['actions'][_0x1dfd1c['actionid']]['queue']]['push'](_['merge'](_[_0x13d0('0xe1')](this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]],[_0x13d0('0x139'),'stateinterface']),{'status':_0x1dfd1c[_0x13d0('0xba')],'paused':_0x1dfd1c[_0x13d0('0x135')]}));}}}};function unlockQueueStatus(_0x229404,_0x2be965){setTimeout(function(){if(_[_0x13d0('0x44')](_0x229404[_0x13d0('0x13a')])){loggerBooked['error'](_0x13d0('0x13b'),_0x2be965);}_0x229404[_0x13d0('0x13a')]=!![];loggerBooked[_0x13d0('0x84')](_0x13d0('0x13c'),_0x2be965,JSON['stringify'](_['pick'](_0x229404,['name',_0x13d0('0x13a')])));},0x1f3);}Dialer['prototype'][_0x13d0('0x3f')]=function(_0x18f02e){var _0x6ebdd2=this;var _0x58eb88=_0x6ebdd2[_0x13d0('0x20')][_0x6ebdd2['actions'][_0x18f02e['actionid']][_0x13d0('0xbd')]];if(strategy[this[_0x13d0('0x20')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]][_0x13d0('0x56')]]===_0x13d0('0x1a')){if(this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]]&&this[_0x13d0('0xb6')][_0x18f02e['actionid']][_0x13d0('0x137')]){this['preview'][_0x13d0('0x13d')](this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0x139')],this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0x137')])['catch'](function(_0x456bf1){logger[_0x13d0('0x9e')](_0x13d0('0x13e'),util[_0x13d0('0x9c')](_0x456bf1,{'showHidden':![],'depth':null}));})[_0x13d0('0x1d')](function(){_0x6ebdd2[_0x13d0('0xbf')](_0x6ebdd2[_0x13d0('0x20')][_0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]);_0x6ebdd2[_0x13d0('0x22')][_0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0x137')]]['locked']=![];delete _0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]];unlockQueueStatus(_0x58eb88);});}else{this[_0x13d0('0xbf')](this['voiceQueues'][this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xe2')],'ListId':this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]]['ListId'],'VoiceQueueId':this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xe4')]||undefined,'CampaignId':this['actions'][_0x18f02e['actionid']][_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x13f')));delete this['actions'][_0x18f02e[_0x13d0('0x134')]];unlockQueueStatus(_0x58eb88);}}else if((strategy[this[_0x13d0('0x20')][this[_0x13d0('0xb6')][_0x18f02e['actionid']]['queue']][_0x13d0('0x56')]]||'rrmemory')===_0x13d0('0x138')){var _0x4f583c;if(this[_0x13d0('0xb6')][_0x18f02e['actionid']]&&!_[_0x13d0('0x4d')](this[_0x13d0('0x2b')][this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]])){if(this[_0x13d0('0x2c')][_0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]]['queue']]){this[_0x13d0('0x2c')][_0x6ebdd2['actions'][_0x18f02e['actionid']][_0x13d0('0xbd')]]=this[_0x13d0('0x2c')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]?this[_0x13d0('0x2c')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]:this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]?this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]][_0x13d0('0x140')]||0x0:0x0;}this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x18f02e['actionid']][_0x13d0('0xbd')]][_0x13d0('0x140')]=this[_0x13d0('0x2c')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]];for(var _0x4b6780=0x0;_0x4b6780=0x0;})[_0x13d0('0xc3')](myreject(_0x11aa2b)));}}else{_0x1e139c[_0x13d0('0x159')](ami['Action']({'action':_0x13d0('0x15b'),'command':util[_0x13d0('0x7f')](_0x13d0('0x15c'),_0x1f42c5,!_[_0x13d0('0x44')](config[_0x13d0('0x156')][_0x20527f])?_0x20527f:'')})['then'](function(_0xf7e0da){return _0xf7e0da['content']['indexOf']('true')>=0x0;})[_0x13d0('0xc3')](myreject(_0x11aa2b)));}Promise[_0x13d0('0x161')](_0x1e139c)['then'](function(_0x5560fb){var _0x3ac60d=_[_0x13d0('0x162')](_0x5560fb);if(_0x3ac60d){return _0x2961c8(_0x3ac60d);}else{_0x49e622[_0x13d0('0x45')]=_0x57eb01?_0x13d0('0x163'):'INTERVAL_IS_OVERTIME';return _0x11aa2b(msgResponse(_0x13d0('0x164'),_0x13d0('0x152'),_0x13d0('0x165')+_0x57eb01+'\x20'+_0x182497+_0x13d0('0x166')+util[_0x13d0('0x9c')](_0x1f42c5,{'showHidden':![],'depth':null})+_0x13d0('0x167')+_0x20527f));}})[_0x13d0('0xc3')](function(_0x23180d){return _0x11aa2b(msgResponse(_0x13d0('0x151'),_0x13d0('0x152'),JSON[_0x13d0('0x145')](_0x23180d)));});});};Dialer[_0x13d0('0x1b')][_0x13d0('0x168')]=function(_0x5dd2fd){var _0x1c311e=this;return function(){switch(_0x5dd2fd[_0x13d0('0x63')]){case _0x13d0('0x169'):freeVariablesPredictive(_0x5dd2fd);_0x1c311e[_0x13d0('0x16a')](_0x5dd2fd,0x1);break;case'power':freeVariablesPredictive(_0x5dd2fd);_0x1c311e[_0x13d0('0x16a')](_0x5dd2fd,_0x5dd2fd[_0x13d0('0x16b')]);break;case _0x13d0('0x8'):_0x1c311e['predictive'](_0x5dd2fd);break;case'booked':freeVariablesPredictive(_0x5dd2fd);_0x1c311e[_0x13d0('0x16a')](_0x5dd2fd,0x1);break;default:freeVariablesPredictive(_0x5dd2fd);logger[_0x13d0('0x9e')](_0x13d0('0x16c'),_0x5dd2fd[_0x13d0('0x48')],_0x13d0('0x16d'));}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x5b7f10){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopper[_0x13d0('0x16e')](_0x5b7f10['id'],previewRecallmeReminderInterval))[_0x13d0('0x42')](function(_0x1362b0){for(var _0x4d1913=0x0;_0x4d1913<_0x1362b0[_0x13d0('0x9f')];_0x4d1913++){var _0x5a7fd1=_0x1362b0[_0x4d1913][_0x13d0('0x16f')][_0x13d0('0x48')];if(_0x5a7fd1)io['to'](util['format'](_0x13d0('0x170'),_0x5a7fd1))[_0x13d0('0x53')](_0x13d0('0x171'),{'hopper':_0x1362b0[_0x4d1913]});}})[_0x13d0('0xc3')](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x330c49){var _0x17910b=this;return function(){_0x17910b['handleIvr'](_0x330c49);};};Dialer[_0x13d0('0x1b')][_0x13d0('0x9')]=function(_0x381c70){var _0x5d7f5e=this;if(isNotPreview(_0x381c70[_0x13d0('0x63')])){if(isVoiceQueueOutbound(_0x381c70['type'])&&isActive(_0x381c70[_0x13d0('0x62')])){_0x381c70[_0x13d0('0xa9')]=!![];Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](checkIsLoggedIn(_0x381c70,_0x381c70['loggedIn']))[_0x13d0('0x42')](checkIsActive(_0x381c70,_0x381c70['dialActive']))[_0x13d0('0x42')](checkInterval(_0x381c70))['then'](_0x5d7f5e[_0x13d0('0x14b')](_0x381c70))['then'](_0x5d7f5e[_0x13d0('0x14f')](_0x381c70[_0x13d0('0x172')],_0x381c70['dialTimezone'],_0x381c70['name'],_0x381c70))[_0x13d0('0x42')](_0x5d7f5e[_0x13d0('0x150')](_0x381c70['Interval'],_0x381c70[_0x13d0('0x173')],_0x381c70[_0x13d0('0x48')],_0x381c70))[_0x13d0('0x42')](_0x5d7f5e[_0x13d0('0x168')](_0x381c70))['catch'](loggerCatchQueueSummary(_0x13d0('0x174'),_0x381c70));}else{notSendMessagesQueue(_0x381c70);}}else{freeVariablesPredictive(_0x381c70);}};Dialer[_0x13d0('0x1b')][_0x13d0('0x36')]=_[_0x13d0('0x175')](function(){var _0x473993=_['filter'](this[_0x13d0('0x20')],function(_0x75b7f5){return _0x75b7f5[_0x13d0('0x176')];});var _0x57490c=_[_0x13d0('0x177')](this[_0x13d0('0x22')],function(_0x516d08){return _0x516d08[_0x13d0('0x178')]&&_0x516d08[_0x13d0('0xba')]===_0x13d0('0x179');});if(_0x473993['length']>0x0&&_0x57490c['length']>0x0){return Promise[_0x13d0('0xc1')]()['then'](cmHopper[_0x13d0('0x16e')](_['map'](_0x473993,'id'),previewRecallmeReminderInterval,_[_0x13d0('0x17a')](_0x57490c,'id')))['then'](function(_0x5b2f38){for(var _0x1ef21e=0x0;_0x1ef21e<_0x5b2f38[_0x13d0('0x9f')];_0x1ef21e++){var _0x14d3fd=_0x5b2f38[_0x1ef21e][_0x13d0('0x16f')][_0x13d0('0x48')];if(_0x14d3fd)io['to'](util[_0x13d0('0x7f')](_0x13d0('0x170'),_0x14d3fd))[_0x13d0('0x53')](_0x13d0('0x171'),{'hopper':_0x5b2f38[_0x1ef21e]});}})[_0x13d0('0xc3')](function(_0x269b5e){logger[_0x13d0('0x9e')]('checkPreviewRecallReminder',_0x269b5e);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x13d0('0x1b')][_0x13d0('0x14a')]=function(){var _0x4ce7ec=this;var _0x1490d8;for(var _0xdd9173 in this[_0x13d0('0x21')]){if(typeof this[_0x13d0('0x21')][_0xdd9173]!==_0x13d0('0xa1')){_0x1490d8=this[_0x13d0('0x21')][_0xdd9173];if(isCampaignIvr(_0x1490d8[_0x13d0('0x54')])&&isActive(_0x1490d8['active'])){_0x1490d8[_0x13d0('0xa9')]=!![];Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](checkIsActive(_0x1490d8,_0x1490d8[_0x13d0('0x7d')]))[_0x13d0('0x42')](checkInterval(_0x1490d8))[_0x13d0('0x42')](_0x4ce7ec['checkIsTrunkReachable'](_0x1490d8))[_0x13d0('0x42')](_0x4ce7ec['checkIfTime'](_0x1490d8[_0x13d0('0x172')],_0x1490d8[_0x13d0('0x173')],_0x1490d8['name'],_0x1490d8))['then'](_0x4ce7ec[_0x13d0('0x150')](_0x1490d8[_0x13d0('0x4a')],_0x1490d8['dialTimezone'],_0x1490d8[_0x13d0('0x48')],_0x1490d8))[_0x13d0('0x42')](_0x4ce7ec[_0x13d0('0x17b')](_0x1490d8))['catch'](loggerCatchQueueSummary(_0x13d0('0x17c'),_0x1490d8));}else{notSendMessagesCampaign(_0x1490d8);}}}};function getCallerIdRandom(_0x488a57,_0x487011){var _0x130679;var _0x4f2075;var _0x43292d;if(_0x487011<=0x0){_0x487011=0x1;}_0x130679=new RegExp(_0x13d0('0x17d')+_0x487011+'}$');_0x4f2075=Math[_0x13d0('0x17e')](0xa,_0x487011-0x1);_0x43292d=Math[_0x13d0('0x17e')](0xa,_0x487011)-0x1;return util[_0x13d0('0x7f')]('%s',_['replace'](_0x488a57,_0x130679,_[_0x13d0('0x17f')](_0x4f2075,_0x43292d)));}function extractCalleridName(_0x30f98){var _0x1fbb10=_0x30f98[_0x13d0('0x180')](/"(.*?)"/);return _0x1fbb10?_0x1fbb10[0x1]:_0x30f98;}Dialer[_0x13d0('0x1b')][_0x13d0('0x181')]=function(_0x4b924a,_0x32e661){var _0x1092a3=this;var _0xd1dfe6=uuid['v4']();this[_0x13d0('0xb6')][_0xd1dfe6]=new Action(_0x4b924a,_0x32e661,_0xd1dfe6);return new Promise(function(_0xf5ffc3,_0x506936){if(_[_0x13d0('0x44')](_0x4b924a)&&typeof _0x4b924a!==_0x13d0('0x182')){return _0x506936(msgResponse('originate',_0x13d0('0x152'),_0x13d0('0x183')));}if(_[_0x13d0('0x44')](_0x32e661[_0x13d0('0x184')])||_0x32e661[_0x13d0('0x184')]===null){return _0x506936(msgResponse('originate',_0x13d0('0x152'),_0x13d0('0x185')));}var _0x14b434={'XMD-CALLERID':_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6]['getCaller'](),'XMD-AGI':_0x4b924a[_0x13d0('0x115')]?util[_0x13d0('0x7f')](_0x13d0('0x186'),ipAgi,_0x4b924a[_0x13d0('0x115')]):_0x13d0('0x187'),'XMD-AGIAFTER':_0x4b924a[_0x13d0('0x11a')]?util[_0x13d0('0x7f')](_0x13d0('0x186'),ipAgi,_0x4b924a['dialQueueProject2']):_0x13d0('0x187'),'XMD-QUEUE':_0x4b924a[_0x13d0('0x54')]===_0x13d0('0x55')?util[_0x13d0('0x7f')]('\x22%s,%s%s,,,%s\x22',_0x4b924a[_0x13d0('0x48')],_0x4b924a[_0x13d0('0x188')]||'',_0x4b924a[_0x13d0('0x11b')]?'c':'',_0x4b924a[_0x13d0('0x122')]||0x3):_0x13d0('0x187'),'XMD-CONTACTID':_0x32e661[_0x13d0('0xe2')],'XMD-CDRTYPE':_0x13d0('0x5'),'CALLERID(all)':_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6]['getCaller'](),'XMD-AMD':_0x4b924a[_0x13d0('0xf7')]?_0x13d0('0x189'):_0x13d0('0x187'),'XMD-DESTINATION':_0x13d0('0x18a')};if(_0x4b924a['dialAMDActive']){_0x14b434[_0x13d0('0x18b')]=_0x4b924a[_0x13d0('0x18c')]||0x9c4;_0x14b434['XMD-AMDGREETING']=_0x4b924a[_0x13d0('0x18d')]||0x5dc;_0x14b434['XMD-AMDAFTERGREETINGSILENCE']=_0x4b924a[_0x13d0('0x18e')]||0x320;_0x14b434[_0x13d0('0x18f')]=_0x4b924a['dialAMDTotalAnalysisTime']||0x1388;_0x14b434['XMD-AMDMINWORDLENGTH']=_0x4b924a[_0x13d0('0x190')]||0x64;_0x14b434[_0x13d0('0x191')]=_0x4b924a['dialAMDBetweenWordsSilence']||0x32;_0x14b434[_0x13d0('0x192')]=_0x4b924a[_0x13d0('0x193')]||0x3;_0x14b434[_0x13d0('0x194')]=_0x4b924a[_0x13d0('0x195')]||0x100;_0x14b434['XMD-AMDMAXIMUMWORDLENGTH']=_0x4b924a[_0x13d0('0x196')]||0x1388;}if(_0x4b924a['type']===_0x13d0('0x55')){_0x14b434[_0x13d0('0x197')]=_0x32e661[_0x13d0('0xe4')];}else{_0x14b434[_0x13d0('0x198')]=_0x32e661['CampaignId'];}for(var _0xe5d02c in _0x32e661[_0x13d0('0x199')]){if(typeof _0x32e661[_0x13d0('0x199')][_0xe5d02c]!==_0x13d0('0xa1')){if(isNotNull(_0x32e661[_0x13d0('0x199')][_0xe5d02c])&&_0xe5d02c!=='id'&&_0xe5d02c!=='tags'&&_0xe5d02c!==_0x13d0('0x19a')&&_0xe5d02c!=='updatedAt'){_0x14b434[util[_0x13d0('0x7f')](_0x13d0('0x19b'),'XMD-',_[_0x13d0('0x19c')](_0xe5d02c))]=_0x32e661[_0x13d0('0x199')][_0xe5d02c];}}}var _0x26f68e=_0x1092a3[_0x13d0('0x14c')](_0x4b924a[_0x13d0('0x7c')])?getCallerId(_0x4b924a['Trunk'][_0x13d0('0x19d')],_0x4b924a[_0x13d0('0x19e')],_0x4b924a[_0x13d0('0x19f')]>0x0?getCallerIdRandom(_0x4b924a[_0x13d0('0x64')],_0x4b924a[_0x13d0('0x19f')]):_0x4b924a[_0x13d0('0x64')]):getCallerId(_[_0x13d0('0xb9')](_0x4b924a[_0x13d0('0x14d')])?_0x4b924a['Trunk'][_0x13d0('0x19d')]:_0x4b924a[_0x13d0('0x14d')][_0x13d0('0x19d')],_0x4b924a['dialOriginateCallerIdName'],_0x4b924a[_0x13d0('0x19f')]>0x0?getCallerIdRandom(_0x4b924a[_0x13d0('0x64')],_0x4b924a['dialRandomLastDigitCallerIdNumber']):_0x4b924a['dialOriginateCallerIdNumber']);if(_0x26f68e){_0x14b434[_0x13d0('0x1a0')]=_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6][_0x13d0('0x1a1')]=extractCalleridName(_0x26f68e);_0x14b434[_0x13d0('0x1a2')]=_0x32e661['phone'];}_0x4b924a[_0x13d0('0x1a3')]=_0x14b434;return ami[_0x13d0('0x15a')]({'actionid':_0xd1dfe6,'action':_0x13d0('0x1a4'),'channel':_0x1092a3['isTrunkReachable'](_0x4b924a[_0x13d0('0x7c')])?util['format']('SIP/%s/%s%s',_0x4b924a['Trunk'][_0x13d0('0x48')],isNotNull(_0x4b924a['dialPrefix'])?_0x4b924a['dialPrefix'][_0x13d0('0x1a5')]()||'':'',_0x4b924a['dialCutDigit']>0x0?_0x32e661['phone'][_0x13d0('0x1a6')](_0x4b924a[_0x13d0('0x1a7')]):_0x32e661[_0x13d0('0x184')]):util[_0x13d0('0x7f')]('SIP/%s/%s%s',_['isNil'](_0x4b924a['TrunkBackup'])?_0x4b924a['Trunk'][_0x13d0('0x48')]:_0x4b924a[_0x13d0('0x14d')][_0x13d0('0x48')],isNotNull(_0x4b924a[_0x13d0('0x66')])?_0x4b924a[_0x13d0('0x66')][_0x13d0('0x1a5')]()||'':'',_0x4b924a[_0x13d0('0x1a7')]>0x0?_0x32e661[_0x13d0('0x184')]['substring'](_0x4b924a[_0x13d0('0x1a7')]):_0x32e661['phone']),'callerid':_0x26f68e,'Exten':_0x13d0('0x18a'),'Context':_0x13d0('0x1a8'),'Priority':'1','variable':_0x14b434,'timeout':(_0x4b924a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xd1dfe6})['then'](function(_0x46431c){return _0xf5ffc3(_0x46431c);})[_0x13d0('0xc3')](function(_0x365d62){_0x4b924a[_0x13d0('0x6f')]+=0x1;var _0x191dff=new History(_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6]);logger['error'](util[_0x13d0('0x7f')](_0x13d0('0x1a9'),JSON[_0x13d0('0x145')](_0x365d62)));_0x191dff[_0x13d0('0xb1')]=0xe;_0x191dff[_0x13d0('0xb2')]='OriginateError';_0x191dff['starttime']=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));_0x191dff['endtime']=_0x191dff['starttime'];_0x1092a3['createHistory'](_0x191dff)[_0x13d0('0xc3')](loggerCatch('[originate][error]'));_0x1092a3[_0x13d0('0xda')](_0x191dff)[_0x13d0('0xc3')](loggerCatch('[originate][error]'))[_0x13d0('0x1d')](function(){delete _0x1092a3[_0x13d0('0xb6')][_0xd1dfe6];return _0x506936(msgResponse(_0x13d0('0x1a4'),_0x13d0('0x1aa'),'originate\x20action\x20Error'));});});});};Dialer[_0x13d0('0x1b')]['syncOriginateResponse']=function(_0x174537){var _0x20664d=this[_0x13d0('0xb6')][_0x174537['actionid']];if(_0x20664d){delete this[_0x13d0('0xb6')][_0x174537[_0x13d0('0x134')]];_0x20664d[_0x13d0('0x1ab')]=moment()[_0x13d0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2999d1=_0x20664d[_0x13d0('0x54')]===_0x13d0('0x99')?this['campaigns'][_0x20664d['queue']]:this[_0x13d0('0x20')][_0x20664d[_0x13d0('0x1ac')]()];if(!this[_0x13d0('0x1ad')](_0x174537[_0x13d0('0x1ae')])){this[_0x13d0('0xbf')](_0x2999d1);return this[_0x13d0('0x1af')](_0x20664d,_0x2999d1,_0x174537)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1b0')));}this[_0x13d0('0x26')][_0x174537[_0x13d0('0xf0')]]=_0x20664d;}};Dialer[_0x13d0('0x1b')][_0x13d0('0x1b1')]=function(_0x441705,_0x3a946a,_0x2cb1b1){var _0x3fe17d=new History(_0x3a946a);if(_0x3fe17d['countbusyretry']+_0x3fe17d[_0x13d0('0xfd')]+_0x3fe17d[_0x13d0('0xfe')]+_0x3fe17d[_0x13d0('0xff')]+_0x3fe17d[_0x13d0('0x100')]+_0x3fe17d['countabandonedretry']+_0x3fe17d[_0x13d0('0x102')]+_0x3fe17d[_0x13d0('0x103')]>=_0x2cb1b1[_0x13d0('0x1b2')]-0x1){return!![];}switch(_0x441705){case 0x3:if(_0x3fe17d[_0x13d0('0xfe')]>=_0x2cb1b1[_0x13d0('0x1b3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3fe17d[_0x13d0('0xfe')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1b4')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d['VoiceQueueId']||undefined,'CampaignId':_0x3fe17d[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1b5')));break;case 0x5:if(_0x3fe17d[_0x13d0('0xfc')]>=_0x2cb1b1[_0x13d0('0x1b6')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countbusyretry':_0x3fe17d[_0x13d0('0xfc')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1b7')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d['ListId'],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1b8')));break;case 0x8:if(_0x3fe17d[_0x13d0('0xfd')]>=_0x2cb1b1[_0x13d0('0x1b9')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countcongestionretry':_0x3fe17d[_0x13d0('0xfd')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1ba')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x3fe17d['ContactId'],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1bb')));break;case 0x0:if(_0x3fe17d[_0x13d0('0xff')]>=_0x2cb1b1['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3fe17d['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x2cb1b1['dialNoSuchNumberRetryFrequency'],_0x13d0('0x109'))['format'](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d['ListId'],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3fe17d['countdropretry']>=_0x2cb1b1[_0x13d0('0x1bc')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x3fe17d[_0x13d0('0x100')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x126')],_0x13d0('0x109'))['format'](_0x13d0('0x10a')),'ContactId':_0x3fe17d['ContactId'],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d['VoiceQueueId']||undefined,'CampaignId':_0x3fe17d[_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x127')));break;case 0xb:if(_0x3fe17d[_0x13d0('0x101')]>=_0x2cb1b1[_0x13d0('0x130')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countabandonedretry':_0x3fe17d[_0x13d0('0x101')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x131')],_0x13d0('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d['ListId'],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x132')));break;case 0x13:if(_0x3fe17d['countmachineretry']>=_0x2cb1b1[_0x13d0('0x106')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3fe17d[_0x13d0('0x102')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x112')],_0x13d0('0x109'))[_0x13d0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x10c')));break;case 0x14:if(_0x3fe17d[_0x13d0('0x103')]>=_0x2cb1b1[_0x13d0('0x1bd')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countagentrejectretry':_0x3fe17d[_0x13d0('0x103')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1be')],_0x13d0('0x109'))['format'](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1bf')));break;default:return!![];}};Dialer[_0x13d0('0x1b')][_0x13d0('0x1af')]=function(_0x29324d,_0x434e19,_0xc7e69d){var _0x30df4b=this;var _0x66dda6=new History(_0x29324d);var _0x17cfe6=![];var _0x5bfb1d;var _0x510a77;return new Promise(function(_0x26c465,_0x5b70aa){if(_[_0x13d0('0x44')](_0x434e19)&&typeof _0x434e19!=='object'){return _0x5b70aa(msgResponse('[callProgressDetecting]',_0x13d0('0x152'),_0x13d0('0x1c0')));}if(_[_0x13d0('0x44')](_0xc7e69d)&&typeof _0xc7e69d!=='object'){return _0x5b70aa(msgResponse(_0x13d0('0x1c1'),'Failure',_0x13d0('0x1c2')));}_0x30df4b[_0x13d0('0xc7')](_0x66dda6,_0xc7e69d['reason'],_0x434e19)[_0x13d0('0x42')](function(_0x4f27d9){if(_0x4f27d9['additional']==0x1)_0x17cfe6=!![];switch(_0xc7e69d['reason']){case'0':_0x434e19[_0x13d0('0x6e')]+=0x1;_0x66dda6[_0x13d0('0xb1')]=0x0;_0x66dda6['statedesc']='NoSuchNumber';_0x66dda6[_0x13d0('0xff')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;ami[_0x13d0('0x53')](_0x13d0('0x1c3'),ut[_0x13d0('0xf4')](_0x29324d,_0x13d0('0x1c4')));_0x5bfb1d=_0x434e19[_0x13d0('0x1c5')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xfb')));if(_0x30df4b[_0x13d0('0x1b1')](0x0,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xff')]>=_0x434e19[_0x13d0('0x1c6')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1c7'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1c7'));}}break;case'3':_0x434e19[_0x13d0('0x6d')]+=0x1;_0x66dda6['state']=0x3;_0x66dda6[_0x13d0('0xb2')]=_0x13d0('0x1c8');_0x66dda6[_0x13d0('0xfe')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;var _0x2881e4=ut['buildNoAnswerEventPayload'](_0x29324d,_0x434e19);ami[_0x13d0('0x53')](_0x13d0('0x1c9'),_0x2881e4);_0x5bfb1d=_0x434e19[_0x13d0('0x1b4')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b['createHistory'](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1ca')));if(_0x30df4b[_0x13d0('0x1b1')](0x3,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6['countnoanswerretry']>=_0x434e19[_0x13d0('0x1b3')]){_0x30df4b['createStateFinal'](_0x66dda6,_0x26c465,_0x5b70aa,'reason\x203\x20ringing\x20no\x20answer');}else{_0x30df4b['stateGlobal'](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1cb'));}}break;case'5':_0x434e19[_0x13d0('0x1cc')]+=0x1;_0x66dda6[_0x13d0('0xb1')]=0x5;_0x66dda6[_0x13d0('0xb2')]='Busy';_0x66dda6[_0x13d0('0xfc')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;ami[_0x13d0('0x53')](_0x13d0('0x1cd'),ut[_0x13d0('0xf4')](_0x29324d,'busy'));_0x5bfb1d=_0x434e19[_0x13d0('0x1b7')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)['catch'](loggerCatch(_0x13d0('0x1ce')));if(_0x30df4b[_0x13d0('0x1b1')](0x5,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xfc')]>=_0x434e19[_0x13d0('0x1b6')]){_0x30df4b['createStateFinal'](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1cf'));}else{_0x30df4b['stateGlobal'](_0x66dda6,_0x26c465,_0x5b70aa,'reason\x205\x20busy');}}break;case'8':_0x434e19['outboundCongestionCallsDay']+=0x1;_0x66dda6['state']=0x8;_0x66dda6['statedesc']=_0x13d0('0x1d0');_0x66dda6['countcongestionretry']+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;_0x5bfb1d=_0x434e19[_0x13d0('0x1ba')];_0x510a77=_0x434e19[_0x13d0('0x12f')];ami[_0x13d0('0x53')](_0x13d0('0x1d1'),ut[_0x13d0('0xf4')](_0x29324d,_0x13d0('0x1d2')));_0x30df4b[_0x13d0('0xeb')](_0x66dda6)['catch'](loggerCatch(_0x13d0('0x1d3')));if(_0x30df4b[_0x13d0('0x1b1')](0x8,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xfd')]>=_0x434e19[_0x13d0('0x1b9')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d4'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d4'));}}break;case'11':_0x434e19[_0x13d0('0x1d5')]+=0x1;_0x66dda6['state']=0xb;_0x66dda6[_0x13d0('0xb2')]=_0x13d0('0x12c');_0x66dda6[_0x13d0('0x101')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;_0x5bfb1d=_0x434e19[_0x13d0('0x131')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x133')));if(_0x30df4b['checkRetriveMax'](0xb,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0x101')]>=_0x434e19[_0x13d0('0x130')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d6'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d6'));}}break;case'20':_0x434e19[_0x13d0('0x70')]+=0x1;_0x66dda6[_0x13d0('0xb1')]=0x14;_0x66dda6[_0x13d0('0xb2')]=_0x13d0('0x1d7');_0x66dda6[_0x13d0('0x103')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;_0x5bfb1d=_0x434e19[_0x13d0('0x1be')];_0x510a77=_0x434e19[_0x13d0('0x12f')];ami[_0x13d0('0x53')](_0x13d0('0x1d8'),ut[_0x13d0('0xf4')](_0x29324d,_0x13d0('0x1d9')));_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x30df4b[_0x13d0('0x1b1')](0x14,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6['countagentrejectretry']>=_0x434e19[_0x13d0('0x1bd')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1da'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1da'));}}break;default:_0x434e19[_0x13d0('0x71')]+=0x1;_0x66dda6['state']=0xc;_0x66dda6[_0x13d0('0xb2')]=_0xc7e69d[_0x13d0('0x1db')];_0x5bfb1d=_0x434e19[_0x13d0('0x1be')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1dc')));if(_0x30df4b[_0x13d0('0x1b1')](_0xc7e69d[_0x13d0('0x1db')],_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xfc')]+_0x66dda6[_0x13d0('0xfd')]+_0x66dda6[_0x13d0('0xfe')]+_0x66dda6[_0x13d0('0xff')]+_0x66dda6[_0x13d0('0x100')]+_0x66dda6[_0x13d0('0x101')]+_0x66dda6[_0x13d0('0x102')]+_0x66dda6[_0x13d0('0x103')]>=_0x434e19['dialGlobalMaxRetry']){_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0xc7e69d[_0x13d0('0x1db')]);}else{_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0xc7e69d[_0x13d0('0x1db')]);}}}})[_0x13d0('0x42')](function(){if(_0x17cfe6){_0x30df4b[_0x13d0('0xc9')](_0x66dda6,_0x5bfb1d,_0x510a77)['then'](function(){return _0x26c465(0x1);});}});});};Dialer[_0x13d0('0x1b')]['stateGlobal']=function(_0x3eda2,_0x58ad36,_0x34be72,_0x2478c2){var _0x475b89=new Final(_0x3eda2);_0x475b89['state']=0xf;_0x475b89[_0x13d0('0xb2')]=_0x13d0('0x1dd');this['createStateFinal'](_0x475b89,_0x58ad36,_0x34be72,_0x2478c2);};Dialer[_0x13d0('0x1b')]['createStateFinal']=function(_0x4e6699,_0x2c39f6,_0x6ba8bf,_0x1ebb2c){this[_0x13d0('0xda')](_0x4e6699)[_0x13d0('0x42')](function(){return _0x2c39f6(msgResponse(_0x13d0('0x1c1'),_0x13d0('0xe8'),_0x1ebb2c));})[_0x13d0('0xc3')](function(){return _0x6ba8bf(msgResponse(_0x13d0('0x1de'),_0x13d0('0x152'),_0x13d0('0x1df')));});};Dialer[_0x13d0('0x1b')][_0x13d0('0x8')]=function(_0x447b4f){var _0x149bb0=_0x447b4f[_0x13d0('0x1e0')]/0x64;var _0x4d808f=_0x447b4f[_0x13d0('0x6c')]/(_0x447b4f['outboundDropCallsDayTimeout']+_0x447b4f['outboundAnswerCallsDay']);var _0x2c36f1=Math[_0x13d0('0x1e1')](_0x447b4f[_0x13d0('0x1e2')]*(_0x447b4f[_0x13d0('0x1e3')]/0x64));var _0x4ce835=Math[_0x13d0('0x1e1')](_0x447b4f[_0x13d0('0x1e2')]*(_0x447b4f[_0x13d0('0x1e4')]/0x64));var _0x3b66c5=_0x447b4f[_0x13d0('0x58')]+_0x447b4f[_0x13d0('0xaa')];var _0x591208=Math[_0x13d0('0x1e5')](_0x447b4f['erlangCalls']*_0x447b4f['erlangAbandonmentRate']*_0x447b4f[_0x13d0('0x77')]*_0x447b4f[_0x13d0('0x78')]);if(_['isUndefined'](_0x447b4f[_0x13d0('0x29')])){if(!_['isUndefined'](_0x447b4f[_0x13d0('0x28')])){_0x447b4f[_0x13d0('0x28')]=undefined;loggerPredictive['error'](_0x13d0('0x1e6'),_0x13d0('0x1e7'));}if(!_[_0x13d0('0x44')](_0x447b4f['handlePredictive'])){loggerPredictive[_0x13d0('0x9e')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x447b4f['handlePredictive']);_0x447b4f[_0x13d0('0x97')]=undefined;}_0x447b4f['startProgressive']=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));loggerPredictive[_0x13d0('0x84')](_0x447b4f['name'],'collection\x20data\x20in\x20progressive\x20at',_0x447b4f[_0x13d0('0x29')]);this['handlePower'](_0x447b4f,0x1);}else if(ifInterval(_0x447b4f[_0x13d0('0x1e8')],_0x447b4f[_0x13d0('0x29')])){this[_0x13d0('0x16a')](_0x447b4f,0x1);loggerPredictiveCalls['info'](_0x13d0('0x1e9'),_0x447b4f[_0x13d0('0x29')],_0x447b4f[_0x13d0('0x48')]);_0x447b4f['erlangCalls']=0x0;_0x447b4f[_0x13d0('0x76')]=0x0;}else if(_0x149bb0<_0x4d808f&&_0x447b4f[_0x13d0('0x1ea')]===_0x13d0('0x1eb')){freeVariablesPredictive(_0x447b4f);loggerPredictive[_0x13d0('0x84')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x13d0('0x1ec'),_0x4d808f,'startProgressive',_0x447b4f[_0x13d0('0x48')]);}else if(_0x591208<_0x447b4f[_0x13d0('0x76')]&&_0x447b4f[_0x13d0('0x1ea')]===_0x13d0('0x1eb')){freeVariablesPredictive(_0x447b4f);loggerPredictive['info'](_0x13d0('0x1ed'),_0x13d0('0x1ee'),_0x591208,_0x13d0('0x1ef'),_0x447b4f[_0x13d0('0x76')],_0x13d0('0x29'),_0x447b4f[_0x13d0('0x48')]);}else if(!ifInterval(_0x447b4f[_0x13d0('0x1e8')],_0x447b4f[_0x13d0('0x29')])&&_['isUndefined'](_0x447b4f[_0x13d0('0x28')])&&!_['isUndefined'](_0x447b4f[_0x13d0('0x29')])){_0x447b4f['startPredictive']=moment()['format'](_0x13d0('0x10a'));loggerPredictive['info'](_0x447b4f[_0x13d0('0x48')],'started\x20in\x20predictive\x20at',_0x447b4f['startPredictive']);this[_0x13d0('0xcd')](_0x447b4f['dialPredictiveInterval'])[_0x13d0('0x42')](this[_0x13d0('0x1f0')](_0x447b4f))[_0x13d0('0x42')](mergeDataErlangB(_0x447b4f))[_0x13d0('0x42')](this[_0x13d0('0x1f1')](_0x447b4f))[_0x13d0('0xc3')](loggerCatchPredictive(_0x13d0('0x1f2'),_0x447b4f));}else if(!ifInterval(_0x447b4f[_0x13d0('0x1e8')],_0x447b4f[_0x13d0('0x28')])){_0x447b4f[_0x13d0('0x76')]=0x0;_0x447b4f[_0x13d0('0x28')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));loggerPredictive[_0x13d0('0x84')](_0x447b4f[_0x13d0('0x48')],_0x13d0('0x1f3'),_0x447b4f[_0x13d0('0x28')]);clearInterval(_0x447b4f[_0x13d0('0x97')]);_0x447b4f[_0x13d0('0x97')]=undefined;this['averageHandleTime'](_0x447b4f['dialPredictiveInterval'])[_0x13d0('0x42')](this[_0x13d0('0x1f0')](_0x447b4f))[_0x13d0('0x42')](mergeDataErlangB(_0x447b4f))[_0x13d0('0x42')](this[_0x13d0('0x1f1')](_0x447b4f))[_0x13d0('0xc3')](loggerCatchPredictive(_0x13d0('0x1f4'),_0x447b4f));}else if(_0x447b4f[_0x13d0('0x1e2')]&&_0x3b66c5<_0x447b4f[_0x13d0('0x1e2')]-_0x4ce835){freeVariablesPredictive(_0x447b4f);loggerPredictive[_0x13d0('0x84')](_0x447b4f[_0x13d0('0x48')],_0x13d0('0x1f5'),_0x3b66c5,_0x13d0('0x1f6'),_0x447b4f['predictiveIntervalAvailable'],'-',_0x4ce835,'=',_0x447b4f[_0x13d0('0x1e2')]-_0x4ce835,')');}else if(_0x447b4f[_0x13d0('0x1e2')]&&_0x3b66c5>_0x447b4f[_0x13d0('0x1e2')]+_0x2c36f1){freeVariablesPredictive(_0x447b4f);loggerPredictive[_0x13d0('0x84')](_0x447b4f[_0x13d0('0x48')],_0x13d0('0x1f5'),_0x3b66c5,')\x20are\x20more\x20than\x20threshold\x20(',_0x447b4f['predictiveIntervalAvailable'],'+',_0x2c36f1,'=',_0x447b4f[_0x13d0('0x1e2')]+_0x2c36f1,')');}};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f0')]=function(_0x11c0df){var _0x2106c0=this;return function(_0x3fcc03){return new Promise(function(_0x53402e,_0x5bb337){_['merge'](_0x11c0df,_0x3fcc03[0x0]);if(checkGetDataPredictive(_0x3fcc03[0x0])){var _0x1428e4=_0x11c0df[_0x13d0('0x1e2')]=_0x11c0df[_0x13d0('0xaa')]+_0x11c0df[_0x13d0('0x58')];var _0x51ea5f=_0x11c0df['dialPredictiveInterval']*0x3c;var _0x5ce963=_0x3fcc03[0x0]['predictiveIntervalAvgTalktime']+_0x3fcc03[0x0]['predictiveIntervalAvgHoldtime'];var _0x312be8=(_0x3fcc03[0x0][_0x13d0('0x72')]+_0x3fcc03[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3fcc03[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3fcc03[0x0][_0x13d0('0x86')];_0x11c0df[_0x13d0('0x77')]=_0x312be8>0x0?_0x312be8:0x1;switch(_0x11c0df[_0x13d0('0x1ea')]){case _0x13d0('0x1eb'):var _0x1493a7=_0x11c0df[_0x13d0('0x1e0')]/0x64;return _0x2106c0[_0x13d0('0x1f7')](_0x1428e4,_0x51ea5f,_0x5ce963,_0x312be8,_0x1493a7)['then'](function(_0x1ec26d){return _0x53402e(_0x1ec26d);});case _0x13d0('0x1f8'):var _0x4e14e0=_0x11c0df['dialPredictiveOptimizationPercentage']/0x64;return _0x2106c0[_0x13d0('0x1f9')](_0x1428e4,_0x51ea5f,_0x5ce963,_0x312be8,_0x4e14e0)[_0x13d0('0x42')](function(_0x5c849b){return _0x53402e(_0x5c849b);});default:return _0x5bb337(msgResponse(_0x13d0('0x1fa'),_0x13d0('0x152'),'Unknown\x20Predictive'));}}else{return _0x5bb337(msgResponse(_0x13d0('0x1fa'),'Failure','check\x20failure'));}});};};Dialer[_0x13d0('0x1b')]['getDataPredictiveOld']=function(_0x9bc516){var _0xfd7970=this;return function(_0x31b772){return new Promise(function(_0x5a9922,_0x3aeb8f){_[_0x13d0('0x95')](_0x9bc516,_0x31b772[0x0]);if(checkGetDataPredictive(_0x31b772[0x0])){loggerPredictive[_0x13d0('0x84')](JSON['stringify'](_0x31b772[0x0]));if(_0x9bc516[_0x13d0('0x1ea')]===_0x13d0('0x1eb')){return _0xfd7970[_0x13d0('0xd8')](_0x9bc516['id'])[_0x13d0('0x42')](function(_0x5389e8){var _0x43d1b4=_0x9bc516[_0x13d0('0x59')]-_0x5389e8[0x0]['outboundQueuePauses'];var _0x1418af=_0x9bc516[_0x13d0('0x1e8')]*0x3c;var _0x47b6af=_0x31b772[0x0]['predictiveIntervalAvgTalktime']+_0x31b772[0x0][_0x13d0('0x73')];var _0x5b2ce3=(_0x31b772[0x0]['predictiveIntervalAnsweredCalls']+_0x31b772[0x0][_0x13d0('0x88')]+_0x31b772[0x0][_0x13d0('0x8a')])/_0x31b772[0x0]['predictiveIntervalTotalCalls'];var _0x31484a=_0x9bc516['dialPredictiveOptimizationPercentage']/0x64;_0x9bc516[_0x13d0('0x79')]=_0x5389e8[0x0]['outboundQueuePauses']||0x0;_0x9bc516['predictiveIntervalHitRate']=_0x5b2ce3>0x0?_0x5b2ce3:0x1;return _0xfd7970[_0x13d0('0x1f7')](_0x43d1b4,_0x1418af,_0x47b6af,_0x5b2ce3,_0x31484a);})[_0x13d0('0x42')](function(_0x23f393){return _0x5a9922(_0x23f393);})[_0x13d0('0xc3')](function(_0x522c66){return _0x3aeb8f(msgResponse(_0x13d0('0x1fb'),_0x13d0('0x152'),JSON[_0x13d0('0x145')](_0x522c66)));});}if(_0x9bc516[_0x13d0('0x1ea')]===_0x13d0('0x1f8')){return _0xfd7970['getVoiceQueueRtPauses'](_0x9bc516['id'])['then'](function(_0x51650d){var _0x455ee8=_0x9bc516['loggedIn']-_0x51650d[0x0][_0x13d0('0x1fc')];var _0x28451a=_0x9bc516['dialPredictiveInterval']*0x3c;var _0x3d2702=_0x31b772[0x0][_0x13d0('0x74')]+_0x31b772[0x0][_0x13d0('0x73')];var _0x9d14cb=(_0x31b772[0x0][_0x13d0('0x72')]+_0x31b772[0x0][_0x13d0('0x88')]+_0x31b772[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x31b772[0x0][_0x13d0('0x86')];var _0x5b654b=_0x9bc516['dialPredictiveOptimizationPercentage']/0x64;_0x9bc516[_0x13d0('0x79')]=_0x51650d[0x0]['outboundQueuePauses']||0x0;_0x9bc516['predictiveIntervalHitRate']=_0x9d14cb>0x0?_0x9d14cb:0x1;return _0xfd7970['busyFactor'](_0x455ee8,_0x28451a,_0x3d2702,_0x9d14cb,_0x5b654b);})[_0x13d0('0x42')](function(_0x298a17){return _0x5a9922(_0x298a17);})[_0x13d0('0xc3')](function(_0x2e7efb){return _0x3aeb8f(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x2e7efb)));});}}else{return _0x3aeb8f(msgResponse(_0x13d0('0x1fa'),_0x13d0('0x152'),_0x13d0('0x1fd')));}});};};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f1')]=function(_0xad5784){var _0x270e96=this;return function(){var _0x398f88=0x0;var _0x14a369=Math[_0x13d0('0x1e5')](_0xad5784[_0x13d0('0x1fe')]*0x3e8);if(_0x14a369>0x0){_0x14a369=_0x14a369<0x64?0x64:_0x14a369;loggerPredictive['info'](_0xad5784[_0x13d0('0x48')],_0x13d0('0x1ff'),_0x14a369,_0x13d0('0x50'));_0xad5784[_0x13d0('0x97')]=setInterval(function(){_0x270e96[_0x13d0('0x97')](_0xad5784);loggerPredictiveCalls[_0x13d0('0x84')]('[handlePredictive]',_0x398f88+=0x1);},_0x14a369);}else{loggerPredictive['info'](_0xad5784[_0x13d0('0x48')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x13d0('0x200')]=function(_0x3d8e16,_0x4d790b){var _0x18cca5=this;return function(_0x4e7546){if(_[_0x13d0('0x4d')](_0x4e7546)){if(_['isNil'](_0x4d790b[_0x13d0('0xe3')])||!_0x4d790b[_0x13d0('0x201')]){if(_0x3d8e16[_0x13d0('0x63')]===_0x13d0('0x7')){_0x3d8e16[_0x13d0('0x13a')]=_['isUndefined'](_0x3d8e16[_0x13d0('0x13a')])?!![]:_0x3d8e16[_0x13d0('0x13a')];var _0x4bd823=uuid['v4']();_0x18cca5[_0x13d0('0xb6')][_0x4bd823]=new Action(_0x3d8e16,_0x4d790b,_0x4bd823);loggerBooked[_0x13d0('0x84')](_0x13d0('0x202'),_0x4bd823,'queueStatusComplete:\x20',JSON[_0x13d0('0x145')](_0x3d8e16[_0x13d0('0x13a')]),_0x13d0('0x203'),_0x3d8e16['name']);if(_0x3d8e16[_0x13d0('0x13a')]){_0x3d8e16[_0x13d0('0x13a')]=![];_0x18cca5[_0x13d0('0x2b')][_0x18cca5['actions'][_0x4bd823][_0x13d0('0xbd')]]=[];ami[_0x13d0('0x15a')]({'actionid':_0x4bd823,'action':'queuestatus','queue':_0x3d8e16[_0x13d0('0x48')]})[_0x13d0('0xc3')](function(){_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);_0x18cca5[_0x13d0('0xd0')]({'active':![],'ContactId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823]['ContactId'],'ListId':_0x18cca5['actions'][_0x4bd823]['ListId'],'VoiceQueueId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe4')]||undefined,'CampaignId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x204')));delete _0x18cca5['actions'][_0x4bd823];});}else{loggerBooked[_0x13d0('0x84')](_0x13d0('0x205'),JSON['stringify'](_0x3d8e16['queueStatusComplete']),_0x13d0('0x203'),_0x3d8e16[_0x13d0('0x48')]);_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);_0x18cca5[_0x13d0('0xd0')]({'active':![],'ContactId':_0x18cca5['actions'][_0x4bd823][_0x13d0('0xe2')],'ListId':_0x18cca5['actions'][_0x4bd823][_0x13d0('0x10b')],'VoiceQueueId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe4')]||undefined,'CampaignId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x204')));delete _0x18cca5['actions'][_0x4bd823];}}else{return _0x18cca5[_0x13d0('0x181')](_0x3d8e16,_0x4d790b);}}else{if(getDiff(_0x4d790b[_0x13d0('0x206')])<_0x3d8e16['dialRecallMeTimeout']*0x3c){if(_0x4d790b[_0x13d0('0x16f')]&&!_0x4d790b[_0x13d0('0x16f')][_0x13d0('0x207')]){_0x18cca5[_0x13d0('0x1f')][_0x13d0('0x13d')](_0x4d790b['id'])['finally'](function(){_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);});}else{_0x18cca5[_0x13d0('0xd1')]({'active':![]},_0x4d790b['id'],0x1)['finally'](function(){_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);});}}else{_0x3d8e16[_0x13d0('0x208')]+=0x1;_0x18cca5['updateOriginated'](_0x3d8e16);if(_0x3d8e16[_0x13d0('0x209')]){_0x18cca5[_0x13d0('0xd0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d790b[_0x13d0('0xe2')],'ListId':_0x4d790b['ListId'],'VoiceQueueId':_0x4d790b['VoiceQueueId']||undefined,'CampaignId':_0x4d790b[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x20a')));_0x18cca5[_0x13d0('0xeb')](createObjHistory(_0x3d8e16,_0x4d790b,'RECALLINQUEUE',0x17,_0x13d0('0x20b')))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x20c')));}else{_0x18cca5[_0x13d0('0xe0')](createObjHistory(_0x3d8e16,_0x4d790b,_0x13d0('0x20d'),0x16,_0x13d0('0x20e')),_0x13d0('0x20f'),_0x13d0('0x210'));}}}}else{_0x3d8e16['outboundBlacklistCallsDay']+=0x1;_0x18cca5[_0x13d0('0xe0')](createObjHistory(_0x3d8e16,_0x4d790b,_0x13d0('0x211'),0xd,_0x13d0('0x212')),_0x13d0('0x213'),_0x13d0('0x214'));throw _0x13d0('0x215');}};};Dialer[_0x13d0('0x1b')][_0x13d0('0x216')]=function(_0x32baf2){var _0x3c2053=this;var _0x187e8d=_0x32baf2[_0x13d0('0x217')]-_0x32baf2[_0x13d0('0xa0')]-_0x32baf2[_0x13d0('0xd4')];emitCampaignSummary(_0x32baf2);if(_0x187e8d>0x0){if(_0x187e8d>this[_0x13d0('0x24')]){_0x187e8d=this[_0x13d0('0x24')];}_0x32baf2[_0x13d0('0xd4')]+=_0x187e8d;this[_0x13d0('0xd6')](_0x32baf2['id'],_0x187e8d,_0x32baf2[_0x13d0('0x218')],_0x32baf2)[_0x13d0('0x42')](function(_0x2abd1c){_0x32baf2[_0x13d0('0xd4')]-=_0x187e8d;_0x32baf2[_0x13d0('0xd4')]=_0x32baf2[_0x13d0('0xd4')]>0x0?_0x32baf2[_0x13d0('0xd4')]:0x0;if(!checkContactEmpty(_0x2abd1c)){_0x32baf2[_0x13d0('0x45')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x13d0('0x84')](_0x13d0('0x219')+_0x32baf2[_0x13d0('0x48')]);}else{_0x32baf2['originated']+=_0x2abd1c['length'];_0x32baf2[_0x13d0('0x45')]=_0x13d0('0x21a');for(var _0xef6482=0x0;_0xef6482<_0x2abd1c[_0x13d0('0x9f')];_0xef6482+=0x1){_0x32baf2[_0x13d0('0x21b')]+=0x1;if(_['isNil'](_0x2abd1c[_0xef6482])||_[_0x13d0('0xb9')](_0x2abd1c[_0xef6482][_0x13d0('0x199')])||_[_0x13d0('0xb9')](_0x2abd1c[_0xef6482][_0x13d0('0x184')])){_0x3c2053['emptyContact'](_0x13d0('0x21c'),_0x32baf2,_0x2abd1c[_0xef6482]);}else{_0x3c2053['checkIsBlackListIvr'](_['pick'](_0x2abd1c[_0xef6482],[_0x13d0('0xe5'),_0x13d0('0x21d')]))[_0x13d0('0x42')](_0x3c2053[_0x13d0('0x200')](_0x32baf2,_0x2abd1c[_0xef6482]))[_0x13d0('0xc3')](_0x3c2053[_0x13d0('0xdd')](_0x13d0('0x21e'),_0x32baf2));}}}})[_0x13d0('0xc3')](loggerGetContactDialer(_0x13d0('0x21f'),_0x32baf2,_0x187e8d));}};Dialer[_0x13d0('0x1b')][_0x13d0('0x16a')]=function(_0x1976cc,_0x27e104){var _0x3eccb3=this;var _0x4ef7f2=[];var _0x42274b=_0x27e104>=0x1?_0x27e104:0x1;if(_0x1976cc[_0x13d0('0x63')]===_0x13d0('0x7')){_0x42274b=0x1;}var _0x2c1afd=Math['floor'](_0x1976cc[_0x13d0('0x58')]*_0x42274b)-_0x1976cc[_0x13d0('0xa0')]-_0x1976cc[_0x13d0('0xd4')];emitVoiceQueueSummary(_0x1976cc);if(_0x1976cc['dialLimitQueue']>0x0){var _0x31c178=_0x1976cc[_0x13d0('0x220')]-_0x1976cc[_0x13d0('0xa0')]-_0x1976cc[_0x13d0('0xaa')]-_0x1976cc[_0x13d0('0xd4')]-_0x1976cc['pTalking'];if(_0x2c1afd>_0x31c178){_0x2c1afd=_0x31c178;}}if(_0x2c1afd>0x0){if(_0x1976cc[_0x13d0('0x63')]===_0x13d0('0x7')){_0x2c1afd=0x1;}if(_0x2c1afd>this['maxNumberOriginate']){_0x2c1afd=this[_0x13d0('0x24')];}_0x1976cc[_0x13d0('0xd4')]+=_0x2c1afd;for(var _0x45b37c in this[_0x13d0('0x22')]){if(typeof this['agents'][_0x45b37c]!==_0x13d0('0xa1')){if(this[_0x13d0('0x22')][_0x45b37c][_0x13d0('0xb1')]===_0x13d0('0x221')&&this[_0x13d0('0x22')][_0x45b37c]['status']===_0x13d0('0x179')){_0x4ef7f2[_0x13d0('0x159')](this['agents'][_0x45b37c]['id']);}}}this['getContactDialer'](_0x1976cc['id'],_0x4ef7f2,_0x2c1afd,_0x1976cc[_0x13d0('0x218')],_0x1976cc)['then'](function(_0x17ba86){_0x1976cc[_0x13d0('0xd4')]-=_0x2c1afd;_0x1976cc[_0x13d0('0xd4')]=_0x1976cc[_0x13d0('0xd4')]>0x0?_0x1976cc['temp']:0x0;if(!checkContactEmpty(_0x17ba86)){_0x3eccb3['countReScheduled'](_0x1976cc)[_0x13d0('0x42')](sendMessageReschedule(_0x1976cc))[_0x13d0('0xc3')](loggerCatch('[countReScheduled]\x20'));}else{_0x1976cc['originated']+=_0x17ba86[_0x13d0('0x9f')];_0x1976cc['message']=_0x1976cc[_0x13d0('0x63')]===_0x13d0('0x7')?'ACTIVE':'RUNNING';for(var _0x565147=0x0;_0x565147<_0x17ba86['length'];_0x565147+=0x1){if(_['isNil'](_0x17ba86[_0x565147])||_['isNil'](_0x17ba86[_0x565147]['Contact'])||_[_0x13d0('0xb9')](_0x17ba86[_0x565147][_0x13d0('0x184')])){_0x3eccb3[_0x13d0('0xde')]('[actionOriginate]\x20',_0x1976cc,_0x17ba86[_0x565147]);}else{_0x3eccb3[_0x13d0('0xc5')](_[_0x13d0('0xe1')](_0x17ba86[_0x565147],[_0x13d0('0xe4'),_0x13d0('0x21d')]))[_0x13d0('0x42')](_0x3eccb3[_0x13d0('0x200')](_0x1976cc,_0x17ba86[_0x565147]))[_0x13d0('0xc3')](_0x3eccb3[_0x13d0('0xdd')](_0x13d0('0x21c'),_0x1976cc));}}}})[_0x13d0('0xc3')](loggerGetContactDialer(_0x13d0('0x222'),_0x1976cc,_0x2c1afd));}};Dialer[_0x13d0('0x1b')]['handlePredictive']=function(_0x431705){if(_0x431705[_0x13d0('0x220')]>0x0){var _0x2a50fe=_0x431705[_0x13d0('0x220')]-_0x431705[_0x13d0('0xa0')]-_0x431705['talking'];if(_0x2a50fe>0x0){this[_0x13d0('0x223')](_0x431705);}else{loggerPredictiveCalls[_0x13d0('0x84')](_0x13d0('0x224'));}}else{this['tryOriginatePredictive'](_0x431705);}};Dialer[_0x13d0('0x1b')][_0x13d0('0x223')]=function(_0x35a1d1){var _0x38a2f1=this;var _0x46f054=[];_0x35a1d1[_0x13d0('0xa0')]+=0x1;for(var _0xaf9af1 in this[_0x13d0('0x22')]){if(typeof this[_0x13d0('0x22')][_0xaf9af1]!=='undefined'){if(this[_0x13d0('0x22')][_0xaf9af1][_0x13d0('0xb1')]===_0x13d0('0x221')&&this[_0x13d0('0x22')][_0xaf9af1][_0x13d0('0xba')]===_0x13d0('0x179')){_0x46f054[_0x13d0('0x159')](this[_0x13d0('0x22')][_0xaf9af1]['id']);}}}this['getContactDialer'](_0x35a1d1['id'],_0x46f054,0x1,_0x35a1d1[_0x13d0('0x218')],_0x35a1d1)[_0x13d0('0x42')](function(_0x47ffcb){if(!checkContactEmpty(_0x47ffcb)){checkContactLowerLimitOriginate(_0x35a1d1,0x1,0x0);_0x38a2f1[_0x13d0('0xc2')](_0x35a1d1)[_0x13d0('0x42')](sendMessageReschedule(_0x35a1d1))[_0x13d0('0xc3')](loggerCatch('[countReScheduled]\x20'));}else{_0x35a1d1[_0x13d0('0x45')]='RUNNING';if(_[_0x13d0('0xb9')](_0x47ffcb[0x0])||_[_0x13d0('0xb9')](_0x47ffcb[0x0][_0x13d0('0x199')])||_['isNil'](_0x47ffcb[0x0][_0x13d0('0x184')])){_0x38a2f1[_0x13d0('0xde')](_0x13d0('0x21c'),_0x35a1d1,_0x47ffcb[0x0]);}else{_0x38a2f1[_0x13d0('0xc5')](_[_0x13d0('0xe1')](_0x47ffcb[0x0],['VoiceQueueId',_0x13d0('0x21d')]))[_0x13d0('0x42')](_0x38a2f1[_0x13d0('0x200')](_0x35a1d1,_0x47ffcb[0x0]))[_0x13d0('0xc3')](_0x38a2f1[_0x13d0('0xdd')](_0x13d0('0x225'),_0x35a1d1));}}})['catch'](loggerGetContactDialer(_0x13d0('0x226'),_0x35a1d1,0x1));emitVoiceQueueSummary(_0x35a1d1);};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f7')]=function(_0x3ef584,_0x389d35,_0x5bfc40,_0x5969f6,_0x142b1a,_0x7d8551){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x13d0('0x84')](_0x13d0('0x227'),_0x3ef584);loggerPredictive[_0x13d0('0x84')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x389d35);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x228'),_0x5bfc40);loggerPredictive[_0x13d0('0x84')]('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',_0x5969f6);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x229'),_0x142b1a);loggerPredictive[_0x13d0('0x84')]('---------------------------');return new Promise(function(_0x4e7617,_0x51c2e2){if(_0x3ef584<=0x0||isNaN(_0x3ef584)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22b')+_0x3ef584));}if(_0x5bfc40<=0x0||isNaN(_0x5bfc40)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22c')+_0x5bfc40));}if(_0x5969f6<=0x0||isNaN(_0x5969f6)){return _0x51c2e2(msgResponse('[abandonmentRate]',_0x13d0('0x1aa'),'p\x20=\x20'+_0x5969f6));}if(_0x389d35<=0x0||isNaN(_0x389d35)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22d')+_0x389d35));}if(_0x142b1a<=0x0||isNaN(_0x142b1a)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22e')+_0x142b1a));}_0x7d8551=_0x7d8551||0x0;var _0x576092=0x1/_0x5bfc40;var _0x56bc42=0x0;var _0x41bd0b=0x0;var _0x40cbbe=0x0;var _0x3151eb=0x0;for(var _0x58b495=0x0;_0x40cbbe<_0x142b1a;_0x58b495+=0x1){_0x41bd0b=_0x58b495/_0x389d35;_0x56bc42=(_0x5969f6*_0x41bd0b+_0x7d8551)/_0x576092;_0x40cbbe=erlangb(_0x56bc42,_0x3ef584);_0x3151eb=_0x56bc42/_0x3ef584*(0x1-erlangb(_0x56bc42,_0x3ef584));}return _0x4e7617({'erlangCalls':_0x58b495,'erlangCallToSecond':_0x389d35/_0x58b495,'erlangAbandonmentRate':_0x40cbbe,'erlangBusyFactor':_0x3151eb});});};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f9')]=function(_0x8acd8c,_0x18c5e2,_0xb26e47,_0x3fbbb3,_0x4c07af,_0x31881d){loggerPredictive['info'](_0x13d0('0x22f'));loggerPredictive[_0x13d0('0x84')](_0x13d0('0x227'),_0x8acd8c);loggerPredictive['info'](_0x13d0('0x230'),_0x18c5e2);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x228'),_0xb26e47);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x231'),_0x3fbbb3);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x232'),_0x4c07af);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x94'));return new Promise(function(_0x54fb1b,_0xc62303){if(_0x8acd8c<=0x0||isNaN(_0x8acd8c)){return _0xc62303(msgResponse(_0x13d0('0x233'),'Error',_0x13d0('0x22b')+_0x8acd8c));}if(_0xb26e47<=0x0||isNaN(_0xb26e47)){return _0xc62303(msgResponse('[busyFactor]',_0x13d0('0x1aa'),_0x13d0('0x22c')+_0xb26e47));}if(_0x3fbbb3<=0x0||isNaN(_0x3fbbb3)){return _0xc62303(msgResponse('[busyFactor]',_0x13d0('0x1aa'),_0x13d0('0x234')+_0x3fbbb3));}if(_0x18c5e2<=0x0||isNaN(_0x18c5e2)){return _0xc62303(msgResponse('[busyFactor]',_0x13d0('0x1aa'),'interval\x20=\x20'+_0x18c5e2));}if(_0x4c07af<=0x0||isNaN(_0x4c07af)){return _0xc62303(msgResponse('[busyFactor]','Error',_0x13d0('0x235')+_0x4c07af));}_0x31881d=_0x31881d||0x0;var _0x231084=0x1/_0xb26e47;var _0x5286be=0x0;var _0x21e297=0x0;var _0x18907c=0x0;var _0x119479=0x0;for(var _0x2ecaa1=0x0;_0x119479<_0x4c07af;_0x2ecaa1+=0x1){_0x21e297=_0x2ecaa1/_0x18c5e2;_0x5286be=(_0x3fbbb3*_0x21e297+_0x31881d)/_0x231084;_0x18907c=erlangb(_0x5286be,_0x8acd8c);_0x119479=_0x5286be/_0x8acd8c*(0x1-erlangb(_0x5286be,_0x8acd8c));}return _0x54fb1b({'erlangCalls':_0x2ecaa1,'erlangCallToSecond':_0x18c5e2/_0x2ecaa1,'erlangAbandonmentRate':_0x18907c,'erlangBusyFactor':_0x119479});});};module[_0x13d0('0x236')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index a0f4a79..b017292 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf15d=['originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x3b14ad,_0x5e4401){var _0x392677=function(_0x4c9139){while(--_0x4c9139){_0x3b14ad['push'](_0x3b14ad['shift']());}};_0x392677(++_0x5e4401);}(_0xf15d,0x122));var _0xdf15=function(_0x5ade1f,_0x1dc916){_0x5ade1f=_0x5ade1f-0x0;var _0x357d1f=_0xf15d[_0x5ade1f];return _0x357d1f;};'use strict';var util=require(_0xdf15('0x0'));var _=require(_0xdf15('0x1'));var moment=require(_0xdf15('0x2'));function getSeconds(_0x4aa09e,_0x433a95){var _0x39d67b=moment(_0x4aa09e)[_0xdf15('0x3')](0x0);var _0x5b98ef=moment(_0x433a95)[_0xdf15('0x3')](0x0);return _0x39d67b['diff'](_0x5b98ef,'seconds');}function QueueCallerAbandon(_0x44f5ba,_0x26c243){this['scheduledat']=_0x44f5ba[_0xdf15('0x4')];this[_0xdf15('0x5')]=_0x44f5ba[_0xdf15('0x5')];this[_0xdf15('0x6')]=_0x44f5ba[_0xdf15('0x5')]==='outbound'?_0xdf15('0x7'):_0x44f5ba[_0xdf15('0x5')];this['countbusyretry']=_0x44f5ba['countbusyretry'];this[_0xdf15('0x8')]=_0x44f5ba['countcongestionretry'];this[_0xdf15('0x9')]=_0x44f5ba[_0xdf15('0x9')];this[_0xdf15('0xa')]=_0x44f5ba[_0xdf15('0xb')]+_0x44f5ba[_0xdf15('0x8')]+_0x44f5ba[_0xdf15('0x9')]+_0x44f5ba[_0xdf15('0xc')]+_0x44f5ba[_0xdf15('0xd')]+_0x44f5ba[_0xdf15('0xe')]+_0x44f5ba[_0xdf15('0xf')]+_0x44f5ba[_0xdf15('0x10')];this['countnosuchnumberretry']=_0x44f5ba[_0xdf15('0xc')];this[_0xdf15('0xd')]=_0x44f5ba[_0xdf15('0xd')];this['countabandonedretry']=_0x44f5ba['countabandonedretry'];this[_0xdf15('0xf')]=_0x44f5ba[_0xdf15('0xf')];this[_0xdf15('0x10')]=_0x44f5ba['countagentrejectretry'];this[_0xdf15('0x11')]=_0x26c243['uniqueid'];this[_0xdf15('0x12')]=_0x44f5ba[_0xdf15('0x13')];this[_0xdf15('0x14')]=_0x44f5ba[_0xdf15('0x15')];this['starttime']=_0x44f5ba[_0xdf15('0x16')];this[_0xdf15('0x17')]=_0x44f5ba[_0xdf15('0x17')];this[_0xdf15('0x18')]=_0x44f5ba[_0xdf15('0x18')];this[_0xdf15('0x19')]=this[_0xdf15('0x18')];this['ringtime']=getSeconds(_0x44f5ba[_0xdf15('0x17')],_0x44f5ba[_0xdf15('0x16')]);this[_0xdf15('0x1a')]=getSeconds(this[_0xdf15('0x18')],_0x44f5ba['responsetime']);this['talktime']=0x0;this[_0xdf15('0x7')]=_0x26c243[_0xdf15('0x7')];this[_0xdf15('0x1b')]=_0x26c243['connectedlinename'];this[_0xdf15('0x1c')]=_0x26c243['reason'];this['callback']=_0x44f5ba[_0xdf15('0x1d')];this[_0xdf15('0x1e')]=_0x44f5ba[_0xdf15('0x1e')];this[_0xdf15('0x1f')]=_0x44f5ba[_0xdf15('0x1f')];this['recallme']=_0x44f5ba[_0xdf15('0x20')];this[_0xdf15('0x21')]=_0x44f5ba[_0xdf15('0x21')];this[_0xdf15('0x22')]=_0x44f5ba[_0xdf15('0x22')];this[_0xdf15('0x23')]=_0x44f5ba[_0xdf15('0x23')];this[_0xdf15('0x24')]=_0x44f5ba[_0xdf15('0x24')];this[_0xdf15('0x25')]=_0x44f5ba[_0xdf15('0x25')];this[_0xdf15('0x26')]=_0x44f5ba['originatecalleridnum']||'';this[_0xdf15('0x27')]=_0x44f5ba['originatecalleridname']||'';}module[_0xdf15('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x2fa9=['calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid'];(function(_0x23423f,_0x59858f){var _0x3b4572=function(_0x3cce35){while(--_0x3cce35){_0x23423f['push'](_0x23423f['shift']());}};_0x3b4572(++_0x59858f);}(_0x2fa9,0x1e9));var _0x92fa=function(_0x179c43,_0x1d3e72){_0x179c43=_0x179c43-0x0;var _0x4df92b=_0x2fa9[_0x179c43];return _0x4df92b;};'use strict';var util=require(_0x92fa('0x0'));var _=require(_0x92fa('0x1'));var moment=require('moment');function getSeconds(_0x4f9102,_0x123f1f){var _0x2c4883=moment(_0x4f9102)[_0x92fa('0x2')](0x0);var _0x2a8f40=moment(_0x123f1f)[_0x92fa('0x2')](0x0);return _0x2c4883[_0x92fa('0x3')](_0x2a8f40,'seconds');}function QueueCallerAbandon(_0x31d87c,_0x58e34e){this[_0x92fa('0x4')]=_0x31d87c['scheduledat'];this[_0x92fa('0x5')]=_0x31d87c[_0x92fa('0x5')];this['campaigntype']=_0x31d87c['type']===_0x92fa('0x6')?_0x92fa('0x7'):_0x31d87c[_0x92fa('0x5')];this[_0x92fa('0x8')]=_0x31d87c[_0x92fa('0x8')];this[_0x92fa('0x9')]=_0x31d87c[_0x92fa('0x9')];this[_0x92fa('0xa')]=_0x31d87c['countnoanswerretry'];this[_0x92fa('0xb')]=_0x31d87c[_0x92fa('0x8')]+_0x31d87c[_0x92fa('0x9')]+_0x31d87c[_0x92fa('0xa')]+_0x31d87c['countnosuchnumberretry']+_0x31d87c['countdropretry']+_0x31d87c[_0x92fa('0xc')]+_0x31d87c[_0x92fa('0xd')]+_0x31d87c[_0x92fa('0xe')];this['countnosuchnumberretry']=_0x31d87c[_0x92fa('0xf')];this[_0x92fa('0x10')]=_0x31d87c[_0x92fa('0x10')];this[_0x92fa('0xc')]=_0x31d87c['countabandonedretry'];this[_0x92fa('0xd')]=_0x31d87c[_0x92fa('0xd')];this[_0x92fa('0xe')]=_0x31d87c['countagentrejectretry'];this[_0x92fa('0x11')]=_0x58e34e[_0x92fa('0x11')];this[_0x92fa('0x12')]=_0x31d87c[_0x92fa('0x13')];this['calleridnum']=_0x31d87c[_0x92fa('0x14')];this[_0x92fa('0x15')]=_0x31d87c[_0x92fa('0x15')];this[_0x92fa('0x16')]=_0x31d87c['responsetime'];this['droptime']=_0x31d87c[_0x92fa('0x17')];this[_0x92fa('0x18')]=this[_0x92fa('0x17')];this[_0x92fa('0x19')]=getSeconds(_0x31d87c['responsetime'],_0x31d87c[_0x92fa('0x15')]);this[_0x92fa('0x1a')]=getSeconds(this['droptime'],_0x31d87c[_0x92fa('0x16')]);this['talktime']=0x0;this[_0x92fa('0x7')]=_0x58e34e[_0x92fa('0x7')];this['membername']=_0x58e34e[_0x92fa('0x1b')];this[_0x92fa('0x1c')]=_0x58e34e[_0x92fa('0x1c')];this['callback']=_0x31d87c['callback'];this[_0x92fa('0x1d')]=_0x31d87c[_0x92fa('0x1d')];this[_0x92fa('0x1e')]=_0x31d87c[_0x92fa('0x1e')];this[_0x92fa('0x1f')]=_0x31d87c[_0x92fa('0x1f')];this[_0x92fa('0x20')]=_0x31d87c['ContactId'];this['ListId']=_0x31d87c[_0x92fa('0x21')];this[_0x92fa('0x22')]=_0x31d87c[_0x92fa('0x22')];this[_0x92fa('0x23')]=_0x31d87c[_0x92fa('0x23')];this['CampaignId']=_0x31d87c[_0x92fa('0x24')];this['originatecalleridnum']=_0x31d87c['originatecalleridnum']||'';this[_0x92fa('0x25')]=_0x31d87c['originatecalleridname']||'';}module[_0x92fa('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 145aa12..01643fd 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(_0x33b718,_0x134497){var _0xb7e013=function(_0x1e2e91){while(--_0x1e2e91){_0x33b718['push'](_0x33b718['shift']());}};_0xb7e013(++_0x134497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x2084b6,_0x2f9ed6){var _0x17f293=function(_0x257df1){while(--_0x257df1){_0x2084b6['push'](_0x2084b6['shift']());}};_0x17f293(++_0x2f9ed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 0943858..574ac71 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 _0x8a74=['Empty\x20path','Is\x20Valid','exports','util','bluebird','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','variable','syncNewState','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','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','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]'];(function(_0x17d975,_0x1f548b){var _0x36a22e=function(_0x2e33e6){while(--_0x2e33e6){_0x17d975['push'](_0x17d975['shift']());}};_0x36a22e(++_0x1f548b);}(_0x8a74,0x1e3));var _0x48a7=function(_0x202912,_0xf398e3){_0x202912=_0x202912-0x0;var _0x8bfbeb=_0x8a74[_0x202912];return _0x8bfbeb;};'use strict';var util=require(_0x48a7('0x0'));var _=require('lodash');var BPromise=require(_0x48a7('0x1'));var uuid=require('uuid');var moment=require(_0x48a7('0x2'));var path=require(_0x48a7('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x48a7('0x4'));var logger=require(_0x48a7('0x5'))(_0x48a7('0x6'));var ami=require(_0x48a7('0x7'));var rpcDb=require(_0x48a7('0x8'));var Channel=require(_0x48a7('0x9'));var ut=require(_0x48a7('0xa'));var Action=require(_0x48a7('0xb'));var faxAccount=require(_0x48a7('0xc'));var attachment=require(_0x48a7('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2f6204){this[_0x48a7('0xe')]={};this[_0x48a7('0xf')]=_0x2f6204[_0x48a7('0xf')];this[_0x48a7('0x10')]=_0x2f6204[_0x48a7('0x10')];this[_0x48a7('0x11')]={};ami['on'](_0x48a7('0x12'),this['syncNewchannel'][_0x48a7('0x13')](this));ami['on'](_0x48a7('0x14'),this[_0x48a7('0x15')][_0x48a7('0x13')](this));ami['on']('newstate',this['syncNewState'][_0x48a7('0x13')](this));ami['on'](_0x48a7('0x16'),this[_0x48a7('0x17')]['bind'](this));ami['on']('faxstatus',this[_0x48a7('0x18')]['bind'](this));ami['on']('receivefax',this[_0x48a7('0x19')]['bind'](this));ami['on'](_0x48a7('0x1a'),this[_0x48a7('0x1b')]['bind'](this));ami['on'](_0x48a7('0x1c'),this[_0x48a7('0x1d')]['bind'](this));}Fax[_0x48a7('0x1e')][_0x48a7('0x1f')]=function(_0x5584c6){if(_0x5584c6[_0x48a7('0x20')]==='from-voip-provider'){for(var _0x13a944 in this[_0x48a7('0xf')]){if(this[_0x48a7('0xf')][_0x48a7('0x21')](_0x13a944)){if(_0x5584c6[_0x48a7('0x22')]===this['faxAccounts'][_0x13a944][_0x48a7('0x23')]){this['channels'][_0x5584c6[_0x48a7('0x24')]]={};this[_0x48a7('0xe')][_0x5584c6[_0x48a7('0x24')]]['channel']=_0x5584c6[_0x48a7('0x25')];this['channels'][_0x5584c6[_0x48a7('0x24')]]['id']=this[_0x48a7('0xf')][_0x13a944]['id'];this['channels'][_0x5584c6[_0x48a7('0x24')]][_0x48a7('0x26')]=this[_0x48a7('0xf')][_0x13a944][_0x48a7('0x26')];logger[_0x48a7('0x27')](_0x5584c6[_0x48a7('0x24')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x5584c6[_0x48a7('0x24')]]){this[_0x48a7('0xe')][_0x5584c6[_0x48a7('0x24')]]={};this['channels'][_0x5584c6[_0x48a7('0x24')]][_0x48a7('0x25')]=_0x5584c6[_0x48a7('0x25')];logger[_0x48a7('0x27')](_0x5584c6[_0x48a7('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x48a7('0x1e')][_0x48a7('0x15')]=function(_0x98b11f){if(this[_0x48a7('0xe')][_0x98b11f[_0x48a7('0x24')]]){for(var _0x3aea1a in _0x98b11f[_0x48a7('0x28')]){if(_0x98b11f[_0x48a7('0x28')][_0x48a7('0x21')](_0x3aea1a)){this[_0x48a7('0xe')][_0x98b11f[_0x48a7('0x24')]][_0x3aea1a]=_0x98b11f['value'];}}}};Fax[_0x48a7('0x1e')][_0x48a7('0x29')]=function(_0x5bc9dd){if(this[_0x48a7('0xe')][_0x5bc9dd[_0x48a7('0x24')]]){this['channels'][_0x5bc9dd[_0x48a7('0x24')]]['channelstate']=_0x5bc9dd[_0x48a7('0x2a')];this['channels'][_0x5bc9dd[_0x48a7('0x24')]][_0x48a7('0x2b')]=_0x5bc9dd[_0x48a7('0x2b')];}};Fax['prototype']['syncNewExten']=function(_0x3cafa0){if(this['channels'][_0x3cafa0[_0x48a7('0x24')]]){for(var _0x147f49 in _0x3cafa0[_0x48a7('0x28')]){if(_0x3cafa0[_0x48a7('0x28')]['hasOwnProperty'](_0x147f49)){this['channels'][_0x3cafa0[_0x48a7('0x24')]][_0x147f49]=_0x3cafa0[_0x48a7('0x2c')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x1b7edd){if(this[_0x48a7('0xe')][_0x1b7edd[_0x48a7('0x24')]]){this['channels'][_0x1b7edd[_0x48a7('0x24')]][_0x48a7('0x2d')]=_0x1b7edd[_0x48a7('0x2d')];this[_0x48a7('0xe')][_0x1b7edd['uniqueid']][_0x48a7('0x2e')]=_0x1b7edd['status'];this[_0x48a7('0xe')][_0x1b7edd[_0x48a7('0x24')]][_0x48a7('0x23')]=_0x1b7edd[_0x48a7('0x23')];this[_0x48a7('0xe')][_0x1b7edd[_0x48a7('0x24')]][_0x48a7('0x2f')]=_0x1b7edd['filename'];logger[_0x48a7('0x27')](_0x1b7edd[_0x48a7('0x24')],_0x48a7('0x30'));}};Fax['prototype'][_0x48a7('0x19')]=function(_0x1d64fc){var _0x1eeac5=this;if(this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]]){var _0x504639=this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]]['id'];this['channels'][_0x1d64fc[_0x48a7('0x24')]][_0x48a7('0x31')]=_0x1d64fc[_0x48a7('0x31')];this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]][_0x48a7('0x32')]=_0x1d64fc['pagestransferred'];this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]][_0x48a7('0x23')]=_0x1d64fc[_0x48a7('0x23')];this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]][_0x48a7('0x33')]=_0x1d64fc[_0x48a7('0x33')];this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]][_0x48a7('0x34')]=_0x1d64fc[_0x48a7('0x34')];this[_0x48a7('0xe')][_0x1d64fc[_0x48a7('0x24')]][_0x48a7('0x2f')]=_0x1d64fc[_0x48a7('0x2f')];this[_0x48a7('0xe')][_0x1d64fc['uniqueid']][_0x48a7('0x35')]=_0x1d64fc[_0x48a7('0x35')];if(this[_0x48a7('0xe')][_0x1d64fc['uniqueid']][_0x48a7('0x32')]>0x0){tiff2pdf(_0x1d64fc['filename'],_0x48a7('0x36'),function(_0x5666b3){logger[_0x48a7('0x27')](_0x1d64fc['uniqueid'],_0x48a7('0x37'),_0x5666b3[_0x48a7('0x38')]);attachment['create']({'name':path[_0x48a7('0x39')](_0x1d64fc[_0x48a7('0x2f')])['name'],'basename':path['parse'](_0x1d64fc[_0x48a7('0x2f')])['name']+_0x48a7('0x3a'),'type':_0x48a7('0x3b')})['then'](function(_0x5a8dfc){faxAccount[_0x48a7('0x3c')](_0x504639,{'from':_0x1d64fc['calleridnum'],'mapKey':_0x48a7('0x6'),'body':path[_0x48a7('0x39')](_0x1d64fc['filename'])[_0x48a7('0x26')]+_0x48a7('0x3a'),'AttachmentId':_0x5a8dfc['id']})[_0x48a7('0x3d')](function(_0x3a4b88){logger[_0x48a7('0x3e')](_0x1d64fc[_0x48a7('0x24')],_0x48a7('0x3f'),JSON[_0x48a7('0x40')](_0x3a4b88));});})[_0x48a7('0x3d')](function(_0xcb4a46){logger[_0x48a7('0x3e')](_0x1d64fc[_0x48a7('0x24')],_0x48a7('0x41'),JSON[_0x48a7('0x40')](_0xcb4a46));});});}logger[_0x48a7('0x27')](_0x1d64fc['uniqueid'],_0x48a7('0x41'));}};Fax['prototype'][_0x48a7('0x1d')]=function(_0x10fb7e){if(this['actions'][_0x10fb7e['uniqueid']]){_['merge'](this[_0x48a7('0xe')][_0x10fb7e['uniqueid']],_[_0x48a7('0x42')](_0x10fb7e,[_0x48a7('0x43'),_0x48a7('0x44')]));}};function updateStatus(_0xdfdceb){if(_0xdfdceb[_0x48a7('0x45')]){faxMessage[_0x48a7('0x46')](_0xdfdceb[_0x48a7('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x48a7('0x47')](function(_0x13d002){ut[_0x48a7('0x48')](_0x48a7('0x49'),_0x13d002);})[_0x48a7('0x3d')](function(_0x265631){ut['logger'](_0x48a7('0x4a'),_0x265631);});}else{ut[_0x48a7('0x48')](_0x48a7('0x4b'));}}Fax[_0x48a7('0x1e')][_0x48a7('0x4c')]=function(_0x34257e,_0x321856,_0x4b6af4){var _0x3a37ac=this;var _0x3a10b1={};if(_0x321856){_0x3a10b1={'read':_0x321856};}else{_0x3a10b1={'failMessage':_0x4b6af4};}if(this[_0x48a7('0x11')][_0x34257e]['AttachmentId']){faxMessage[_0x48a7('0x46')](this[_0x48a7('0x11')][_0x34257e][_0x48a7('0x45')],_0x3a10b1)[_0x48a7('0x47')](function(_0x34ee33){ut['logger']('[Fax][Message][Updated]',_0x34ee33);})[_0x48a7('0x3d')](function(_0x3f4149){ut[_0x48a7('0x48')]('[Fax][Message][NoUpdate1]',_0x3f4149);})[_0x48a7('0x4d')](function(){delete _0x3a37ac[_0x48a7('0xe')][_0x34257e];delete _0x3a37ac[_0x48a7('0x11')][_0x34257e];});}else{ut[_0x48a7('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x48a7('0xe')][_0x34257e];delete this[_0x48a7('0x11')][_0x34257e];}};Fax[_0x48a7('0x1e')][_0x48a7('0x1b')]=function(_0x1259b7){var _0x5d66bb=this;if(this[_0x48a7('0xe')][_0x1259b7['uniqueid']]){if(this[_0x48a7('0x11')][_0x1259b7[_0x48a7('0x24')]]){this['channels'][_0x1259b7[_0x48a7('0x24')]]['id']=this[_0x48a7('0x11')][_0x1259b7[_0x48a7('0x24')]]['id'];this[_0x48a7('0xe')][_0x1259b7[_0x48a7('0x24')]]['name']=this[_0x48a7('0x11')][_0x1259b7['uniqueid']]['name'];}logger['info'](_0x1259b7[_0x48a7('0x24')],this[_0x48a7('0x11')][_0x1259b7[_0x48a7('0x24')]]?_0x48a7('0x4e'):_0x48a7('0x4f'),JSON[_0x48a7('0x40')](this[_0x48a7('0xe')][_0x1259b7['uniqueid']]));if(this['actions'][_0x1259b7[_0x48a7('0x24')]]){if(this['channels'][_0x1259b7[_0x48a7('0x24')]][_0x48a7('0x50')]>0x0&&this['channels'][_0x1259b7['uniqueid']][_0x48a7('0x51')]==='SUCCESS'){this[_0x48a7('0x4c')](_0x1259b7['uniqueid'],!![]);}else{this[_0x48a7('0x4c')](_0x1259b7[_0x48a7('0x24')],![],this[_0x48a7('0xe')][_0x1259b7[_0x48a7('0x24')]]['faxstatusstring']?_0x48a7('0x52')+this['channels'][_0x1259b7[_0x48a7('0x24')]][_0x48a7('0x53')]:_0x48a7('0x54'));}}}};Fax[_0x48a7('0x1e')][_0x48a7('0x55')]=function(_0x24a416){var _0x47470b=this;return new BPromise(function(_0x2420fd,_0x243973){_0x47470b[_0x48a7('0x56')](_0x24a416,_0x47470b['faxAccounts'][_0x24a416[_0x48a7('0x57')]])['then'](function(_0x3fe6c7){ut[_0x48a7('0x48')](_0x48a7('0x58'),_0x3fe6c7);_0x2420fd(ut[_0x48a7('0x38')]('Fax\x20received'));})[_0x48a7('0x3d')](function(_0x536424){ut[_0x48a7('0x48')](_0x48a7('0x59'),_0x536424);updateStatus(_0x24a416);_0x243973(ut[_0x48a7('0x38')](_0x48a7('0x5a')));});});};Fax[_0x48a7('0x1e')][_0x48a7('0x5b')]=function(_0xcdf65a){var _0x39e1b1=this;return new BPromise(function(_0x5779fa,_0x248c29){var _0x3ac282=_0x39e1b1['checkTrunk'](_0x39e1b1[_0x48a7('0xf')][_0xcdf65a[_0x48a7('0x57')]][_0x48a7('0x5c')],_0xcdf65a);if(_0x3ac282['isValid']){_0x5779fa(ut[_0x48a7('0x38')](_0x48a7('0x5d')));}else{_0x248c29(ut[_0x48a7('0x38')](_0x3ac282[_0x48a7('0x38')]));}});};function originate(_0x5f3e84,_0x3be125,_0x28006e){return new BPromise(function(_0x42e4ad,_0x8d0c9a){if(_0x28006e){var _0x4c03d8=util[_0x48a7('0x5e')](_0x48a7('0x5f'),path['parse'](_0x5f3e84[_0x48a7('0x3')])[_0x48a7('0x26')],_0x5f3e84[_0x48a7('0x3')]);gs[_0x48a7('0x60')](_0x4c03d8)[_0x48a7('0x47')](function(){_0x5f3e84[_0x48a7('0x3')]=util['format'](_0x48a7('0x61'),path[_0x48a7('0x39')](_0x5f3e84[_0x48a7('0x3')])[_0x48a7('0x62')],path[_0x48a7('0x39')](_0x5f3e84[_0x48a7('0x3')])[_0x48a7('0x26')]);_0x3be125[_0x48a7('0x63')]=_0x5f3e84['path'];ut[_0x48a7('0x48')](_0x48a7('0x64'),'');ami[_0x48a7('0x65')](ut[_0x48a7('0x66')](_0x5f3e84,_0x3be125))[_0x48a7('0x47')](function(_0x14d282){_0x42e4ad(_0x14d282);})[_0x48a7('0x3d')](function(_0x238850){_0x8d0c9a(_0x238850);});})[_0x48a7('0x3d')](function(_0x3d3df5){_0x8d0c9a(_0x3d3df5);});}else{ami['Action'](ut[_0x48a7('0x66')](_0x5f3e84,_0x3be125))[_0x48a7('0x47')](function(_0x1585af){_0x42e4ad(_0x1585af);})[_0x48a7('0x3d')](function(_0x26c8d9){_0x8d0c9a(_0x26c8d9);});}});}Fax[_0x48a7('0x1e')][_0x48a7('0x56')]=function(_0x2d028d,_0x14d59f){var _0x2b350b=this;return new BPromise(function(_0x507302,_0x362727){var _0xe35cb6=uuid['v4']();var _0x3d584e=ut[_0x48a7('0x67')](_0x2d028d,_0x14d59f);_0x2b350b[_0x48a7('0x11')][_0xe35cb6]=new Action(_0xe35cb6,_0x14d59f,_0x2d028d);var _0x3c6943=_0x2b350b['actions'][_0xe35cb6];if(path[_0x48a7('0x39')](_0x2d028d[_0x48a7('0x3')])[_0x48a7('0x68')]==='.pdf'){originate(_0x3c6943,_0x3d584e,!![])[_0x48a7('0x47')](function(_0x17ecfe){_0x507302(_0x17ecfe);})['catch'](function(_0x17bc44){_0x362727(_0x17bc44);});}else{originate(_0x3c6943,_0x3d584e,![])[_0x48a7('0x47')](function(_0x1c5e77){_0x507302(_0x1c5e77);})[_0x48a7('0x3d')](function(_0x424c00){_0x362727(_0x424c00);});}});};Fax['prototype'][_0x48a7('0x69')]=function(_0x28f1c4){return!_['isNil'](_0x28f1c4)&&!_[_0x48a7('0x6a')](_0x28f1c4['name'])&&!_[_0x48a7('0x6a')](_0x28f1c4[_0x48a7('0x6b')])&&_0x28f1c4[_0x48a7('0x6b')]&&!_['isNil'](this[_0x48a7('0x10')][util[_0x48a7('0x5e')]('SIP/%s',_0x28f1c4['name'])])&&!_[_0x48a7('0x6a')](this[_0x48a7('0x10')][util[_0x48a7('0x5e')](_0x48a7('0x6c'),_0x28f1c4[_0x48a7('0x26')])][_0x48a7('0x2e')])&&(this[_0x48a7('0x10')][util[_0x48a7('0x5e')](_0x48a7('0x6c'),_0x28f1c4['name'])][_0x48a7('0x2e')]==='reachable'||this[_0x48a7('0x10')][util[_0x48a7('0x5e')]('SIP/%s',_0x28f1c4[_0x48a7('0x26')])]['status']===_0x48a7('0x6d'));};Fax['prototype'][_0x48a7('0x6e')]=function(_0x29ec3a,_0x1cf7dd){if(!this[_0x48a7('0x69')](_0x29ec3a)){ut[_0x48a7('0x48')](_0x48a7('0x6f'),_['isNil'](_0x29ec3a)?'':_0x29ec3a[_0x48a7('0x26')]+_0x48a7('0x70'));return{'isValid':![],'message':_0x48a7('0x71')};}if(_[_0x48a7('0x6a')](_0x1cf7dd[_0x48a7('0x6')])){ut[_0x48a7('0x48')](_0x48a7('0x72'),JSON[_0x48a7('0x40')](_0x1cf7dd));return{'isValid':![],'message':_0x48a7('0x73')};}if(_[_0x48a7('0x6a')](_0x1cf7dd['path'])){ut[_0x48a7('0x48')](_0x48a7('0x74'),JSON[_0x48a7('0x40')](_0x1cf7dd));return{'isValid':![],'message':_0x48a7('0x75')};}return{'isValid':!![],'message':_0x48a7('0x76')};};module[_0x48a7('0x77')]=Fax; \ No newline at end of file +var _0x26c2=['path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','prototype','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','actions','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','moment'];(function(_0x3d0a87,_0x5654a0){var _0xe5659e=function(_0x2ef050){while(--_0x2ef050){_0x3d0a87['push'](_0x3d0a87['shift']());}};_0xe5659e(++_0x5654a0);}(_0x26c2,0x74));var _0x226c=function(_0x37d805,_0x3ff049){_0x37d805=_0x37d805-0x0;var _0x3d7cb8=_0x26c2[_0x37d805];return _0x3d7cb8;};'use strict';var util=require('util');var _=require(_0x226c('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x226c('0x1'));var path=require(_0x226c('0x2'));var tiff2pdf=require(_0x226c('0x3'));var gs=require('./util/gs');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var ami=require(_0x226c('0x6'));var rpcDb=require(_0x226c('0x7'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x226c('0x8'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x226c('0x9'));var faxMessage=require(_0x226c('0xa'));function Fax(_0x4e4944){this[_0x226c('0xb')]={};this[_0x226c('0xc')]=_0x4e4944[_0x226c('0xc')];this[_0x226c('0xd')]=_0x4e4944['trunks'];this['actions']={};ami['on'](_0x226c('0xe'),this[_0x226c('0xf')]['bind'](this));ami['on'](_0x226c('0x10'),this[_0x226c('0x11')][_0x226c('0x12')](this));ami['on'](_0x226c('0x13'),this['syncNewState'][_0x226c('0x12')](this));ami['on']('newexten',this[_0x226c('0x14')]['bind'](this));ami['on']('faxstatus',this[_0x226c('0x15')][_0x226c('0x12')](this));ami['on'](_0x226c('0x16'),this[_0x226c('0x17')]['bind'](this));ami['on'](_0x226c('0x18'),this[_0x226c('0x19')][_0x226c('0x12')](this));ami['on'](_0x226c('0x1a'),this[_0x226c('0x1b')][_0x226c('0x12')](this));}Fax['prototype'][_0x226c('0xf')]=function(_0x22e34d){if(_0x22e34d[_0x226c('0x1c')]===_0x226c('0x1d')){for(var _0x4069e7 in this[_0x226c('0xc')]){if(this[_0x226c('0xc')]['hasOwnProperty'](_0x4069e7)){if(_0x22e34d[_0x226c('0x1e')]===this[_0x226c('0xc')][_0x4069e7][_0x226c('0x1f')]){this[_0x226c('0xb')][_0x22e34d[_0x226c('0x20')]]={};this['channels'][_0x22e34d[_0x226c('0x20')]][_0x226c('0x21')]=_0x22e34d[_0x226c('0x21')];this['channels'][_0x22e34d[_0x226c('0x20')]]['id']=this[_0x226c('0xc')][_0x4069e7]['id'];this[_0x226c('0xb')][_0x22e34d[_0x226c('0x20')]][_0x226c('0x22')]=this[_0x226c('0xc')][_0x4069e7]['name'];logger[_0x226c('0x23')](_0x22e34d[_0x226c('0x20')],_0x226c('0x24'));}}}}if(this['actions'][_0x22e34d['uniqueid']]){this[_0x226c('0xb')][_0x22e34d[_0x226c('0x20')]]={};this['channels'][_0x22e34d[_0x226c('0x20')]][_0x226c('0x21')]=_0x22e34d['channel'];logger[_0x226c('0x23')](_0x22e34d['uniqueid'],_0x226c('0x24'));}};Fax['prototype'][_0x226c('0x11')]=function(_0x9ab765){if(this['channels'][_0x9ab765['uniqueid']]){for(var _0x1688b1 in _0x9ab765[_0x226c('0x25')]){if(_0x9ab765[_0x226c('0x25')][_0x226c('0x26')](_0x1688b1)){this[_0x226c('0xb')][_0x9ab765[_0x226c('0x20')]][_0x1688b1]=_0x9ab765[_0x226c('0x27')];}}}};Fax[_0x226c('0x28')][_0x226c('0x29')]=function(_0x424644){if(this[_0x226c('0xb')][_0x424644[_0x226c('0x20')]]){this[_0x226c('0xb')][_0x424644['uniqueid']][_0x226c('0x2a')]=_0x424644[_0x226c('0x2a')];this[_0x226c('0xb')][_0x424644[_0x226c('0x20')]][_0x226c('0x2b')]=_0x424644[_0x226c('0x2b')];}};Fax[_0x226c('0x28')][_0x226c('0x14')]=function(_0x47381f){if(this[_0x226c('0xb')][_0x47381f['uniqueid']]){for(var _0x3743d6 in _0x47381f[_0x226c('0x25')]){if(_0x47381f[_0x226c('0x25')]['hasOwnProperty'](_0x3743d6)){this[_0x226c('0xb')][_0x47381f[_0x226c('0x20')]][_0x3743d6]=_0x47381f[_0x226c('0x27')];}}}};Fax[_0x226c('0x28')][_0x226c('0x15')]=function(_0x4cf454){if(this[_0x226c('0xb')][_0x4cf454[_0x226c('0x20')]]){this['channels'][_0x4cf454[_0x226c('0x20')]][_0x226c('0x2c')]=_0x4cf454[_0x226c('0x2c')];this[_0x226c('0xb')][_0x4cf454['uniqueid']][_0x226c('0x2d')]=_0x4cf454[_0x226c('0x2d')];this[_0x226c('0xb')][_0x4cf454[_0x226c('0x20')]]['localstationid']=_0x4cf454[_0x226c('0x1f')];this['channels'][_0x4cf454['uniqueid']][_0x226c('0x2e')]=_0x4cf454[_0x226c('0x2e')];logger[_0x226c('0x23')](_0x4cf454[_0x226c('0x20')],_0x226c('0x2f'));}};Fax[_0x226c('0x28')][_0x226c('0x17')]=function(_0x4192b4){var _0x26497f=this;if(this[_0x226c('0xb')][_0x4192b4[_0x226c('0x20')]]){var _0x53d221=this[_0x226c('0xb')][_0x4192b4['uniqueid']]['id'];this['channels'][_0x4192b4[_0x226c('0x20')]][_0x226c('0x30')]=_0x4192b4[_0x226c('0x30')];this[_0x226c('0xb')][_0x4192b4['uniqueid']][_0x226c('0x31')]=_0x4192b4[_0x226c('0x31')];this['channels'][_0x4192b4[_0x226c('0x20')]][_0x226c('0x1f')]=_0x4192b4[_0x226c('0x1f')];this[_0x226c('0xb')][_0x4192b4[_0x226c('0x20')]]['resolution']=_0x4192b4[_0x226c('0x32')];this['channels'][_0x4192b4['uniqueid']][_0x226c('0x33')]=_0x4192b4['transferrate'];this[_0x226c('0xb')][_0x4192b4['uniqueid']][_0x226c('0x2e')]=_0x4192b4[_0x226c('0x2e')];this[_0x226c('0xb')][_0x4192b4[_0x226c('0x20')]][_0x226c('0x34')]=_0x4192b4[_0x226c('0x34')];if(this[_0x226c('0xb')][_0x4192b4['uniqueid']][_0x226c('0x31')]>0x0){tiff2pdf(_0x4192b4[_0x226c('0x2e')],_0x226c('0x35'),function(_0x335c1c){logger[_0x226c('0x23')](_0x4192b4[_0x226c('0x20')],'\x20result\x20conversion\x20file\x20',_0x335c1c['message']);attachment[_0x226c('0x36')]({'name':path['parse'](_0x4192b4['filename'])[_0x226c('0x22')],'basename':path[_0x226c('0x37')](_0x4192b4['filename'])[_0x226c('0x22')]+_0x226c('0x38'),'type':_0x226c('0x39')})[_0x226c('0x3a')](function(_0x52ae1a){faxAccount[_0x226c('0x3b')](_0x53d221,{'from':_0x4192b4['calleridnum'],'mapKey':'fax','body':path[_0x226c('0x37')](_0x4192b4[_0x226c('0x2e')])['name']+_0x226c('0x38'),'AttachmentId':_0x52ae1a['id']})[_0x226c('0x3c')](function(_0x59f11f){logger[_0x226c('0x3d')](_0x4192b4[_0x226c('0x20')],_0x226c('0x3e'),JSON[_0x226c('0x3f')](_0x59f11f));});})[_0x226c('0x3c')](function(_0x42294a){logger[_0x226c('0x3d')](_0x4192b4[_0x226c('0x20')],'\x20receiveFax\x20',JSON['stringify'](_0x42294a));});});}logger[_0x226c('0x23')](_0x4192b4[_0x226c('0x20')],_0x226c('0x40'));}};Fax['prototype'][_0x226c('0x1b')]=function(_0x31f1e0){if(this[_0x226c('0x41')][_0x31f1e0[_0x226c('0x20')]]){_[_0x226c('0x42')](this[_0x226c('0xb')][_0x31f1e0[_0x226c('0x20')]],_[_0x226c('0x43')](_0x31f1e0,[_0x226c('0x44'),_0x226c('0x45')]));}};function updateStatus(_0x4a81fe){if(_0x4a81fe[_0x226c('0x46')]){faxMessage[_0x226c('0x47')](_0x4a81fe['AttachmentId'],{'failMessage':_0x226c('0x48')})['then'](function(_0x1c981c){ut[_0x226c('0x49')]('[Fax][Message][Error][Updated]',_0x1c981c);})[_0x226c('0x3c')](function(_0x44e14c){ut[_0x226c('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x44e14c);});}else{ut[_0x226c('0x49')](_0x226c('0x4a'));}}Fax[_0x226c('0x28')][_0x226c('0x4b')]=function(_0x14d24b,_0x55fba3,_0x5eedaf){var _0x3541b1=this;var _0x2e9955={};if(_0x55fba3){_0x2e9955={'read':_0x55fba3};}else{_0x2e9955={'failMessage':_0x5eedaf};}if(this[_0x226c('0x41')][_0x14d24b][_0x226c('0x46')]){faxMessage[_0x226c('0x47')](this[_0x226c('0x41')][_0x14d24b][_0x226c('0x46')],_0x2e9955)[_0x226c('0x3a')](function(_0xb9fd8c){ut['logger'](_0x226c('0x4c'),_0xb9fd8c);})[_0x226c('0x3c')](function(_0x4e430b){ut['logger'](_0x226c('0x4d'),_0x4e430b);})[_0x226c('0x4e')](function(){delete _0x3541b1[_0x226c('0xb')][_0x14d24b];delete _0x3541b1[_0x226c('0x41')][_0x14d24b];});}else{ut[_0x226c('0x49')](_0x226c('0x4f'));delete this[_0x226c('0xb')][_0x14d24b];delete this[_0x226c('0x41')][_0x14d24b];}};Fax[_0x226c('0x28')][_0x226c('0x19')]=function(_0x4b5d8a){var _0x47e235=this;if(this['channels'][_0x4b5d8a[_0x226c('0x20')]]){if(this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]){this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]]['id']=this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]['id'];this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]][_0x226c('0x22')]=this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]['name'];}logger['info'](_0x4b5d8a['uniqueid'],this[_0x226c('0x41')][_0x4b5d8a['uniqueid']]?_0x226c('0x50'):_0x226c('0x51'),JSON['stringify'](this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]]));if(this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]){if(this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]][_0x226c('0x52')]>0x0&&this['channels'][_0x4b5d8a['uniqueid']][_0x226c('0x53')]===_0x226c('0x54')){this[_0x226c('0x4b')](_0x4b5d8a[_0x226c('0x20')],!![]);}else{this['updateStatus'](_0x4b5d8a[_0x226c('0x20')],![],this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]][_0x226c('0x55')]?_0x226c('0x56')+this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x226c('0x28')][_0x226c('0x57')]=function(_0x38d43b){var _0x37377d=this;return new BPromise(function(_0x300866,_0x19b6b1){_0x37377d[_0x226c('0x58')](_0x38d43b,_0x37377d[_0x226c('0xc')][_0x38d43b[_0x226c('0x59')]])[_0x226c('0x3a')](function(_0x4d6b97){ut[_0x226c('0x49')](_0x226c('0x5a'),_0x4d6b97);_0x300866(ut['message']('Fax\x20received'));})[_0x226c('0x3c')](function(_0x1ba17d){ut['logger'](_0x226c('0x5b'),_0x1ba17d);updateStatus(_0x38d43b);_0x19b6b1(ut[_0x226c('0x5c')](_0x226c('0x5d')));});});};Fax['prototype'][_0x226c('0x5e')]=function(_0x240eaf){var _0x46bcd7=this;return new BPromise(function(_0x14ab10,_0x4ccb9f){var _0x26e47e=_0x46bcd7[_0x226c('0x5f')](_0x46bcd7[_0x226c('0xc')][_0x240eaf[_0x226c('0x59')]][_0x226c('0x60')],_0x240eaf);if(_0x26e47e[_0x226c('0x61')]){_0x14ab10(ut[_0x226c('0x5c')]('Trunk\x20Reachable'));}else{_0x4ccb9f(ut[_0x226c('0x5c')](_0x26e47e[_0x226c('0x5c')]));}});};function originate(_0x304fc3,_0x122ef1,_0xbf902b){return new BPromise(function(_0x341b29,_0x4d38df){if(_0xbf902b){var _0x494ade=util[_0x226c('0x62')](_0x226c('0x63'),path[_0x226c('0x37')](_0x304fc3[_0x226c('0x2')])[_0x226c('0x22')],_0x304fc3[_0x226c('0x2')]);gs[_0x226c('0x64')](_0x494ade)['then'](function(){_0x304fc3['path']=util[_0x226c('0x62')](_0x226c('0x65'),path[_0x226c('0x37')](_0x304fc3[_0x226c('0x2')])['dir'],path[_0x226c('0x37')](_0x304fc3[_0x226c('0x2')])['name']);_0x122ef1[_0x226c('0x66')]=_0x304fc3[_0x226c('0x2')];ut[_0x226c('0x49')](_0x226c('0x67'),'');ami[_0x226c('0x68')](ut[_0x226c('0x69')](_0x304fc3,_0x122ef1))['then'](function(_0x3c7913){_0x341b29(_0x3c7913);})[_0x226c('0x3c')](function(_0x41dcb5){_0x4d38df(_0x41dcb5);});})[_0x226c('0x3c')](function(_0x20cf7a){_0x4d38df(_0x20cf7a);});}else{ami[_0x226c('0x68')](ut[_0x226c('0x69')](_0x304fc3,_0x122ef1))[_0x226c('0x3a')](function(_0x5d649f){_0x341b29(_0x5d649f);})[_0x226c('0x3c')](function(_0x1df225){_0x4d38df(_0x1df225);});}});}Fax[_0x226c('0x28')][_0x226c('0x58')]=function(_0x555f2c,_0x24f588){var _0x3e47d1=this;return new BPromise(function(_0x1704f9,_0x79311d){var _0x12e35b=uuid['v4']();var _0x5bc65f=ut[_0x226c('0x6a')](_0x555f2c,_0x24f588);_0x3e47d1['actions'][_0x12e35b]=new Action(_0x12e35b,_0x24f588,_0x555f2c);var _0x311d7f=_0x3e47d1[_0x226c('0x41')][_0x12e35b];if(path[_0x226c('0x37')](_0x555f2c[_0x226c('0x2')])[_0x226c('0x6b')]===_0x226c('0x38')){originate(_0x311d7f,_0x5bc65f,!![])[_0x226c('0x3a')](function(_0x308b79){_0x1704f9(_0x308b79);})[_0x226c('0x3c')](function(_0x4e25fa){_0x79311d(_0x4e25fa);});}else{originate(_0x311d7f,_0x5bc65f,![])['then'](function(_0xcb8ee0){_0x1704f9(_0xcb8ee0);})[_0x226c('0x3c')](function(_0x438dea){_0x79311d(_0x438dea);});}});};Fax[_0x226c('0x28')][_0x226c('0x6c')]=function(_0x58e9a4){return!_['isNil'](_0x58e9a4)&&!_[_0x226c('0x6d')](_0x58e9a4[_0x226c('0x22')])&&!_[_0x226c('0x6d')](_0x58e9a4['active'])&&_0x58e9a4['active']&&!_[_0x226c('0x6d')](this['trunks'][util[_0x226c('0x62')](_0x226c('0x6e'),_0x58e9a4['name'])])&&!_['isNil'](this[_0x226c('0xd')][util['format'](_0x226c('0x6e'),_0x58e9a4[_0x226c('0x22')])][_0x226c('0x2d')])&&(this[_0x226c('0xd')][util[_0x226c('0x62')](_0x226c('0x6e'),_0x58e9a4['name'])][_0x226c('0x2d')]===_0x226c('0x6f')||this[_0x226c('0xd')][util[_0x226c('0x62')]('SIP/%s',_0x58e9a4[_0x226c('0x22')])][_0x226c('0x2d')]===_0x226c('0x70'));};Fax[_0x226c('0x28')][_0x226c('0x5f')]=function(_0x49c61d,_0xaf1996){if(!this['isTrunkReachable'](_0x49c61d)){ut[_0x226c('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x226c('0x6d')](_0x49c61d)?'':_0x49c61d[_0x226c('0x22')]+_0x226c('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0xaf1996[_0x226c('0x5')])){ut[_0x226c('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x226c('0x3f')](_0xaf1996));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x226c('0x6d')](_0xaf1996[_0x226c('0x2')])){ut[_0x226c('0x49')](_0x226c('0x72'),JSON[_0x226c('0x3f')](_0xaf1996));return{'isValid':![],'message':_0x226c('0x73')};}return{'isValid':!![],'message':_0x226c('0x74')};};module[_0x226c('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 4fefa93..de107f4 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 _0xc95b=['inspect','notify','resolve','then','catch','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x2fad2b,_0xcae30e){var _0x39f1ee=function(_0x4c748d){while(--_0x4c748d){_0x2fad2b['push'](_0x2fad2b['shift']());}};_0x39f1ee(++_0xcae30e);}(_0xc95b,0x1e9));var _0xbc95=function(_0x50c140,_0x52abe1){_0x50c140=_0x50c140-0x0;var _0x2528aa=_0xc95b[_0x50c140];return _0x2528aa;};'use strict';var util=require(_0xbc95('0x0'));var BPromise=require('bluebird');var logger=require(_0xbc95('0x1'))(_0xbc95('0x2'));var _=require(_0xbc95('0x3'));var faxAccount=require(_0xbc95('0x4'));function loggerCatch(_0x2d8d50){return function(_0x4bbd43){logger[_0xbc95('0x5')](_0x2d8d50,util[_0xbc95('0x6')](_0x4bbd43,{'showHidden':![],'depth':null}));};}exports[_0xbc95('0x7')]=function(_0x1c0be3,_0x54d474){return BPromise[_0xbc95('0x8')]()[_0xbc95('0x9')](faxAccount[_0xbc95('0x7')](_0x1c0be3,_0x54d474))[_0xbc95('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x9f38=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger'];(function(_0x3786bd,_0x2bb68b){var _0x2a43c5=function(_0x1218b5){while(--_0x1218b5){_0x3786bd['push'](_0x3786bd['shift']());}};_0x2a43c5(++_0x2bb68b);}(_0x9f38,0x169));var _0x89f3=function(_0x4db2ee,_0x249f7f){_0x4db2ee=_0x4db2ee-0x0;var _0x1ceb42=_0x9f38[_0x4db2ee];return _0x1ceb42;};'use strict';var util=require('util');var BPromise=require(_0x89f3('0x0'));var logger=require(_0x89f3('0x1'))('preview');var _=require(_0x89f3('0x2'));var faxAccount=require(_0x89f3('0x3'));function loggerCatch(_0x1b549a){return function(_0x102648){logger[_0x89f3('0x4')](_0x1b549a,util[_0x89f3('0x5')](_0x102648,{'showHidden':![],'depth':null}));};}exports[_0x89f3('0x6')]=function(_0x2ad375,_0xeb5668){return BPromise[_0x89f3('0x7')]()[_0x89f3('0x8')](faxAccount['notify'](_0x2ad375,_0xeb5668))[_0x89f3('0x9')](loggerCatch(_0x89f3('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 ed8340b..96f7677 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 _0xbc2c=['child_process','info','Exec\x20gs','\x20Error\x20:','inspect','util','fax','bluebird'];(function(_0x4f7add,_0x17a0a7){var _0x463e06=function(_0x4537c8){while(--_0x4537c8){_0x4f7add['push'](_0x4f7add['shift']());}};_0x463e06(++_0x17a0a7);}(_0xbc2c,0x65));var _0xcbc2=function(_0x276204,_0x4ad6f3){_0x276204=_0x276204-0x0;var _0x137d07=_0xbc2c[_0x276204];return _0x137d07;};'use strict';var util=require(_0xcbc2('0x0'));var logger=require('../../../../config/logger')(_0xcbc2('0x1'));var BPromise=require(_0xcbc2('0x2'));var exec=require(_0xcbc2('0x3'))['exec'];exports['execute']=function(_0x1cb29c){return new BPromise(function(_0x4c1abe,_0x43b2fb){exec(_0x1cb29c,function(_0x2ce550,_0x24b03e,_0x42252d){logger[_0xcbc2('0x4')](_0xcbc2('0x5'),_0x24b03e);if(_0x2ce550){logger[_0xcbc2('0x4')](_0xcbc2('0x5'),_0xcbc2('0x6'),util[_0xcbc2('0x7')](_0x2ce550,{'showHidden':![],'depth':null}),_0x24b03e,_0x42252d);_0x43b2fb(_0x2ce550);}_0x4c1abe(_0x24b03e);});});}; \ No newline at end of file +var _0x59f8=['child_process','info','Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x3b6c03,_0x5a8aa7){var _0x5ccad9=function(_0xb5d4e4){while(--_0xb5d4e4){_0x3b6c03['push'](_0x3b6c03['shift']());}};_0x5ccad9(++_0x5a8aa7);}(_0x59f8,0x164));var _0x859f=function(_0x2509f1,_0x14deca){_0x2509f1=_0x2509f1-0x0;var _0x1953cf=_0x59f8[_0x2509f1];return _0x1953cf;};'use strict';var util=require(_0x859f('0x0'));var logger=require(_0x859f('0x1'))(_0x859f('0x2'));var BPromise=require(_0x859f('0x3'));var exec=require(_0x859f('0x4'))['exec'];exports['execute']=function(_0x114a2c){return new BPromise(function(_0x3b5e7d,_0x295ee6){exec(_0x114a2c,function(_0x403152,_0x37d572,_0x19f334){logger[_0x859f('0x5')](_0x859f('0x6'),_0x37d572);if(_0x403152){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0x859f('0x7')](_0x403152,{'showHidden':![],'depth':null}),_0x37d572,_0x19f334);_0x295ee6(_0x403152);}_0x3b5e7d(_0x37d572);});});}; \ 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 1e412de..77a795d 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 _0x7f68=['../../../../config/logger','fax','logger','info','inspect','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','moment'];(function(_0x39304b,_0x30a033){var _0x21160c=function(_0x3b51a9){while(--_0x3b51a9){_0x39304b['push'](_0x39304b['shift']());}};_0x21160c(++_0x30a033);}(_0x7f68,0x19c));var _0x87f6=function(_0x513b9e,_0x5aeb09){_0x513b9e=_0x513b9e-0x0;var _0x36338c=_0x7f68[_0x513b9e];return _0x36338c;};'use strict';var util=require(_0x87f6('0x0'));var _=require('lodash');var moment=require(_0x87f6('0x1'));var logger=require(_0x87f6('0x2'))(_0x87f6('0x3'));exports['message']=function(_0x3272ca){return{'message':_0x3272ca};};exports[_0x87f6('0x4')]=function(_0x253245,_0x19d6ee){logger[_0x87f6('0x5')](_0x253245,util[_0x87f6('0x6')](_0x19d6ee,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2aa70c,_0x152412){var _0xfa21c9={'XMF-ECM':_0x152412[_0x87f6('0x7')],'XMF-HEADERINFO':_0x152412[_0x87f6('0x8')],'XMF-MINRATE':_0x152412[_0x87f6('0x9')],'XMF-MAXRATE':_0x152412['maxrate'],'XMF-MODEM':util[_0x87f6('0xa')](_0x87f6('0xb'),_0x152412[_0x87f6('0xc')]),'XMF-GATEWAY':_0x152412[_0x87f6('0xd')],'XMF-FAXDETECT':_0x152412['faxdetect'],'XMF-T38TIMEOUT':_0x152412['t38timeout'],'XMF-LOCALSTATIONID':_0x152412[_0x87f6('0xe')],'XMF-PATH':_0x2aa70c[_0x87f6('0xf')]};return _0xfa21c9;};exports[_0x87f6('0x10')]=function(_0x4732f6,_0x53e6ce){return{'actionid':_0x4732f6['uniqueid'],'action':_0x87f6('0x11'),'channel':_0x4732f6[_0x87f6('0x12')],'Exten':_0x87f6('0x13'),'Context':_0x87f6('0x14'),'Priority':'1','callerid':util['format'](_0x87f6('0x15'),_0x4732f6[_0x87f6('0x8')]?_0x4732f6['headerinfo']:'',_0x4732f6[_0x87f6('0xe')]),'variable':_0x53e6ce,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4732f6[_0x87f6('0x16')]};}; \ No newline at end of file +var _0xd773=['inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','moment','../../../../config/logger','message','logger','info'];(function(_0x56ba8b,_0x5f0021){var _0x528ea2=function(_0x23fb86){while(--_0x23fb86){_0x56ba8b['push'](_0x56ba8b['shift']());}};_0x528ea2(++_0x5f0021);}(_0xd773,0xd2));var _0x3d77=function(_0x57bb5a,_0x30e3c6){_0x57bb5a=_0x57bb5a-0x0;var _0x351ac2=_0xd773[_0x57bb5a];return _0x351ac2;};'use strict';var util=require(_0x3d77('0x0'));var _=require('lodash');var moment=require(_0x3d77('0x1'));var logger=require(_0x3d77('0x2'))('fax');exports[_0x3d77('0x3')]=function(_0xdb9b14){return{'message':_0xdb9b14};};exports[_0x3d77('0x4')]=function(_0x21447b,_0x3d89a7){logger[_0x3d77('0x5')](_0x21447b,util[_0x3d77('0x6')](_0x3d89a7,{'showHidden':![],'depth':null}));};exports[_0x3d77('0x7')]=function(_0x4e54f5,_0x3a1ec5){var _0xc17fc7={'XMF-ECM':_0x3a1ec5[_0x3d77('0x8')],'XMF-HEADERINFO':_0x3a1ec5[_0x3d77('0x9')],'XMF-MINRATE':_0x3a1ec5[_0x3d77('0xa')],'XMF-MAXRATE':_0x3a1ec5[_0x3d77('0xb')],'XMF-MODEM':util[_0x3d77('0xc')](_0x3d77('0xd'),_0x3a1ec5[_0x3d77('0xe')]),'XMF-GATEWAY':_0x3a1ec5[_0x3d77('0xf')],'XMF-FAXDETECT':_0x3a1ec5[_0x3d77('0x10')],'XMF-T38TIMEOUT':_0x3a1ec5[_0x3d77('0x11')],'XMF-LOCALSTATIONID':_0x3a1ec5[_0x3d77('0x12')],'XMF-PATH':_0x4e54f5[_0x3d77('0x13')]};return _0xc17fc7;};exports[_0x3d77('0x14')]=function(_0x1676e1,_0x2d80c7){return{'actionid':_0x1676e1['uniqueid'],'action':_0x3d77('0x15'),'channel':_0x1676e1[_0x3d77('0x16')],'Exten':_0x3d77('0x17'),'Context':_0x3d77('0x18'),'Priority':'1','callerid':util[_0x3d77('0xc')](_0x3d77('0x19'),_0x1676e1[_0x3d77('0x9')]?_0x1676e1[_0x3d77('0x9')]:'',_0x1676e1['localstationid']),'variable':_0x2d80c7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1676e1[_0x3d77('0x1a')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 3301940..35de835 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 _0x9736=['bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','[index.js][initParams]','listen','catch','inspect'];(function(_0x2db6a8,_0x44f144){var _0x47abb1=function(_0x5a3ad8){while(--_0x5a3ad8){_0x2db6a8['push'](_0x2db6a8['shift']());}};_0x47abb1(++_0x44f144);}(_0x9736,0x7a));var _0x6973=function(_0x24e9f8,_0x1b0073){_0x24e9f8=_0x24e9f8-0x0;var _0x5f0d3d=_0x9736[_0x24e9f8];return _0x5f0d3d;};'use strict';var BPromise=require(_0x6973('0x0'));var util=require(_0x6973('0x1'));var moment=require(_0x6973('0x2'));var server=require(_0x6973('0x3'));var Realtime=require(_0x6973('0x4'));var Report=require(_0x6973('0x5'));var Acw=require(_0x6973('0x6'));var Trigger=require(_0x6973('0x7'));var Dialer=require('./dialer');var Preview=require(_0x6973('0x8'));var Fax=require(_0x6973('0x9'));var user=require(_0x6973('0xa'));var voiceQueue=require(_0x6973('0xb'));var voiceQueueReport=require(_0x6973('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x6973('0xd'));var trigger=require(_0x6973('0xe'));var template=require(_0x6973('0xf'));var cmHopperHistory=require(_0x6973('0x10'));var campaign=require(_0x6973('0x11'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x6973('0x12'));var salesforce=require(_0x6973('0x13'));var sugarcrm=require(_0x6973('0x14'));var freshdesk=require(_0x6973('0x15'));var desk=require(_0x6973('0x16'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x6973('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x6973('0x18'));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(_0x6973('0x19'))(_0x6973('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6973('0x1b')](_0x6973('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6973('0x1b')](_0x6973('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6973('0x1d')]()[_0x6973('0x1e')](user[_0x6973('0x1f')]())[_0x6973('0x1e')](realtime[_0x6973('0x20')]())[_0x6973('0x1e')](user['getTelephones']())[_0x6973('0x1e')](realtime['initTelephones']())[_0x6973('0x1e')](trunk['getTrunks']())[_0x6973('0x1e')](realtime[_0x6973('0x21')]())[_0x6973('0x1e')](voiceQueue[_0x6973('0x22')]())['then'](realtime[_0x6973('0x23')]())[_0x6973('0x1e')](trigger[_0x6973('0x24')]())['then'](realtime['initTriggers']())[_0x6973('0x1e')](template[_0x6973('0x25')]())['then'](realtime[_0x6973('0x26')]())['then'](zendesk[_0x6973('0x27')]())[_0x6973('0x1e')](realtime[_0x6973('0x28')]())['then'](salesforce[_0x6973('0x29')]())[_0x6973('0x1e')](realtime['initSalesforceAccounts']())['then'](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x6973('0x2a')]())[_0x6973('0x1e')](freshdesk['getFreshdeskAccounts']())[_0x6973('0x1e')](realtime[_0x6973('0x2b')]())[_0x6973('0x1e')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x6973('0x1e')](vtiger[_0x6973('0x2c')]())['then'](realtime['initVtigerAccounts']())[_0x6973('0x1e')](freshsales[_0x6973('0x2d')]())['then'](realtime['initFreshsalesAccounts']())[_0x6973('0x1e')](servicenow[_0x6973('0x2e')]())[_0x6973('0x1e')](realtime[_0x6973('0x2f')]())[_0x6973('0x1e')](dynamics365['getDynamics365Accounts']())[_0x6973('0x1e')](realtime['initDynamics365Accounts']())[_0x6973('0x1e')](campaign[_0x6973('0x30')]())[_0x6973('0x1e')](realtime['initCampaigns']())[_0x6973('0x1e')](voiceExtension['getVoiceExtensions']())[_0x6973('0x1e')](realtime[_0x6973('0x31')]())[_0x6973('0x1e')](faxAccount[_0x6973('0x32')]())[_0x6973('0x1e')](realtime[_0x6973('0x33')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x6973('0x1d')]()[_0x6973('0x1e')](voiceQueueReport[_0x6973('0x34')]())['then'](realtime['initVoiceQueueReports']())[_0x6973('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x6973('0x1e')](realtime[_0x6973('0x35')]())['then'](cmHopperHistory[_0x6973('0x36')]())['then'](realtime[_0x6973('0x37')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x6973('0x1e')](realtime[_0x6973('0x38')]())['catch'](function(_0x48b8c1){logger['error'](_0x6973('0x39'),util['inspect'](_0x48b8c1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6973('0x3a')](realtime,preview,fax)['then'](function(_0x41c18c){return initRealtime();})[_0x6973('0x1e')](function(){return initParams();})[_0x6973('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x6973('0x3b')](function(_0x4bc9c9){logger['error']('[index.js][main]',util[_0x6973('0x3c')](_0x4bc9c9,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x12b1=['initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','bluebird','util','moment','./server','./report','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory'];(function(_0x348069,_0x415153){var _0x7bfaa8=function(_0x1bff06){while(--_0x1bff06){_0x348069['push'](_0x348069['shift']());}};_0x7bfaa8(++_0x415153);}(_0x12b1,0x90));var _0x112b=function(_0x1e4d78,_0x4460cd){_0x1e4d78=_0x1e4d78-0x0;var _0x595a6b=_0x12b1[_0x1e4d78];return _0x595a6b;};'use strict';var BPromise=require(_0x112b('0x0'));var util=require(_0x112b('0x1'));var moment=require(_0x112b('0x2'));var server=require(_0x112b('0x3'));var Realtime=require('./realtime');var Report=require(_0x112b('0x4'));var Acw=require(_0x112b('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x112b('0x6'));var Preview=require(_0x112b('0x7'));var Fax=require('./fax');var user=require(_0x112b('0x8'));var voiceQueue=require(_0x112b('0x9'));var voiceQueueReport=require(_0x112b('0xa'));var voiceCallReport=require(_0x112b('0xb'));var trunk=require(_0x112b('0xc'));var trigger=require(_0x112b('0xd'));var template=require(_0x112b('0xe'));var cmHopperHistory=require(_0x112b('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x112b('0x10'));var zendesk=require(_0x112b('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x112b('0x12'));var freshdesk=require(_0x112b('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x112b('0x14'));var vtiger=require(_0x112b('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x112b('0x16'));var dynamics365=require(_0x112b('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x112b('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x112b('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x112b('0x19')](_0x112b('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x112b('0x1b')]()[_0x112b('0x1c')](user[_0x112b('0x1d')]())[_0x112b('0x1c')](realtime[_0x112b('0x1e')]())[_0x112b('0x1c')](user[_0x112b('0x1f')]())['then'](realtime[_0x112b('0x20')]())['then'](trunk[_0x112b('0x21')]())[_0x112b('0x1c')](realtime[_0x112b('0x22')]())[_0x112b('0x1c')](voiceQueue[_0x112b('0x23')]())[_0x112b('0x1c')](realtime['initVoiceQueues']())[_0x112b('0x1c')](trigger[_0x112b('0x24')]())[_0x112b('0x1c')](realtime[_0x112b('0x25')]())[_0x112b('0x1c')](template[_0x112b('0x26')]())[_0x112b('0x1c')](realtime[_0x112b('0x27')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x112b('0x28')]())['then'](salesforce[_0x112b('0x29')]())[_0x112b('0x1c')](realtime['initSalesforceAccounts']())[_0x112b('0x1c')](sugarcrm[_0x112b('0x2a')]())[_0x112b('0x1c')](realtime[_0x112b('0x2b')]())[_0x112b('0x1c')](freshdesk[_0x112b('0x2c')]())[_0x112b('0x1c')](realtime[_0x112b('0x2d')]())[_0x112b('0x1c')](desk[_0x112b('0x2e')]())['then'](realtime['initDeskAccounts']())[_0x112b('0x1c')](zoho[_0x112b('0x2f')]())[_0x112b('0x1c')](realtime[_0x112b('0x30')]())[_0x112b('0x1c')](vtiger[_0x112b('0x31')]())[_0x112b('0x1c')](realtime['initVtigerAccounts']())[_0x112b('0x1c')](freshsales[_0x112b('0x32')]())[_0x112b('0x1c')](realtime['initFreshsalesAccounts']())['then'](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x112b('0x33')]())['then'](realtime['initDynamics365Accounts']())[_0x112b('0x1c')](campaign[_0x112b('0x34')]())[_0x112b('0x1c')](realtime[_0x112b('0x35')]())[_0x112b('0x1c')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x112b('0x36')]())['then'](faxAccount['getFaxAccounts']())[_0x112b('0x1c')](realtime[_0x112b('0x37')]())[_0x112b('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x112b('0x1b')]()[_0x112b('0x1c')](voiceQueueReport[_0x112b('0x38')]())[_0x112b('0x1c')](realtime[_0x112b('0x39')]())[_0x112b('0x1c')](cmHopperHistory[_0x112b('0x3a')]())[_0x112b('0x1c')](realtime[_0x112b('0x3b')]())[_0x112b('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0x112b('0x1c')](realtime[_0x112b('0x3c')]())['then'](voiceCallReport[_0x112b('0x3d')]())[_0x112b('0x1c')](realtime['initVoiceCallReports']())[_0x112b('0x3e')](function(_0x4f1cd7){logger[_0x112b('0x3f')](_0x112b('0x40'),util['inspect'](_0x4f1cd7,{'showHidden':![],'depth':null}));});}function main(){return server[_0x112b('0x41')](realtime,preview,fax)['then'](function(_0x49591d){return initRealtime();})[_0x112b('0x1c')](function(){return initParams();})[_0x112b('0x1c')](function(){report[_0x112b('0x42')]();setInterval(initRealtime,0x1388);})[_0x112b('0x3e')](function(_0x3ae72b){logger[_0x112b('0x3f')](_0x112b('0x43'),util['inspect'](_0x3ae72b,{'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 6ed1a72..e3d006c 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x475b3e,_0x7f5292){var _0x22c070=function(_0x205ff6){while(--_0x205ff6){_0x475b3e['push'](_0x475b3e['shift']());}};_0x22c070(++_0x7f5292);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x40f4a7,_0x232f9d){var _0x4f4f53=function(_0x3515c4){while(--_0x3515c4){_0x40f4a7['push'](_0x40f4a7['shift']());}};_0x4f4f53(++_0x232f9d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('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 4a5950b..23cc676 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 _0x6c88=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC'];(function(_0x1bedd5,_0xa85b7f){var _0x3a9289=function(_0x5924df){while(--_0x5924df){_0x1bedd5['push'](_0x1bedd5['shift']());}};_0x3a9289(++_0xa85b7f);}(_0x6c88,0x189));var _0x86c8=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x6c88[_0x21205e];return _0x136ebb;};'use strict';function Campaign(_0x266f2c){this['id']=_0x266f2c['id']||0x0;this['name']=_0x266f2c['name']||'';this[_0x86c8('0x0')]=_0x266f2c[_0x86c8('0x0')]||_0x86c8('0x1');this[_0x86c8('0x2')]=0x0;this['temp']=0x0;this[_0x86c8('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x86c8('0x4')]='';this[_0x86c8('0x5')]=!![];this['active']=_0x266f2c[_0x86c8('0x6')];this[_0x86c8('0x7')]=_0x266f2c[_0x86c8('0x7')];this[_0x86c8('0x8')]=_0x266f2c['dialTimezone']||null;this[_0x86c8('0x9')]=_0x266f2c[_0x86c8('0x9')]?_0x266f2c[_0x86c8('0x9')]:null;this[_0x86c8('0xa')]=_0x266f2c['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x266f2c['dialOriginateCallerIdNumber'];this[_0x86c8('0xb')]=_0x266f2c[_0x86c8('0xb')]||0x1e;this[_0x86c8('0xc')]=_0x266f2c[_0x86c8('0xc')];this[_0x86c8('0xd')]=_0x266f2c[_0x86c8('0xd')];this['dialBusyMaxRetry']=_0x266f2c['dialBusyMaxRetry'];this[_0x86c8('0xe')]=_0x266f2c[_0x86c8('0xe')];this[_0x86c8('0xf')]=_0x266f2c['dialNoAnswerMaxRetry'];this[_0x86c8('0x10')]=_0x266f2c[_0x86c8('0x10')];this[_0x86c8('0x11')]=_0x266f2c[_0x86c8('0x11')];this['dialNoSuchNumberMaxRetry']=_0x266f2c[_0x86c8('0x12')]||0x3;this[_0x86c8('0x13')]=_0x266f2c[_0x86c8('0x13')]||0x96;this[_0x86c8('0x14')]=_0x266f2c[_0x86c8('0x14')]||0x3;this[_0x86c8('0x15')]=_0x266f2c['dialDropRetryFrequency']||0x96;this[_0x86c8('0x16')]=_0x266f2c[_0x86c8('0x16')]||0x3;this[_0x86c8('0x17')]=_0x266f2c[_0x86c8('0x17')]||0x96;this[_0x86c8('0x18')]=_0x266f2c[_0x86c8('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x266f2c[_0x86c8('0x19')]||0x96;this[_0x86c8('0x1a')]=_0x266f2c[_0x86c8('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x266f2c[_0x86c8('0x1b')]||0x96;this[_0x86c8('0x1c')]=_0x266f2c['dialOrderByScheduledAt']||_0x86c8('0x1d');this['dialPrefix']=_0x266f2c['dialPrefix']||undefined;this[_0x86c8('0x1e')]=_0x266f2c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x86c8('0x1f')]=_0x266f2c[_0x86c8('0x1f')]||undefined;this[_0x86c8('0x20')]=_0x266f2c['TrunkBackup']?_0x266f2c[_0x86c8('0x20')]:undefined;this['Trunk']=_0x266f2c[_0x86c8('0x21')]?_0x266f2c[_0x86c8('0x21')]:undefined;this[_0x86c8('0x22')]=_0x266f2c[_0x86c8('0x22')]?_0x266f2c[_0x86c8('0x22')]:undefined;this[_0x86c8('0x23')]=_0x266f2c[_0x86c8('0x23')]?_0x266f2c[_0x86c8('0x23')]:undefined;this['dialQueueProject']=_0x266f2c[_0x86c8('0x23')]?_0x266f2c[_0x86c8('0x23')]['name']:undefined;this[_0x86c8('0x24')]=_0x266f2c[_0x86c8('0x24')]||![];this[_0x86c8('0x25')]=_0x266f2c[_0x86c8('0x25')];this[_0x86c8('0x26')]=_0x266f2c[_0x86c8('0x26')];this[_0x86c8('0x27')]=_0x266f2c[_0x86c8('0x27')];this[_0x86c8('0x28')]=_0x266f2c[_0x86c8('0x28')];this['dialAMDMinWordLength']=_0x266f2c[_0x86c8('0x29')];this[_0x86c8('0x2a')]=_0x266f2c[_0x86c8('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x266f2c[_0x86c8('0x2b')];this[_0x86c8('0x2c')]=_0x266f2c[_0x86c8('0x2c')];this[_0x86c8('0x2d')]=_0x266f2c['dialAMDMaximumWordLength'];}module[_0x86c8('0x2e')]=Campaign; \ No newline at end of file +var _0x7300=['dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x5e2185,_0x44f71c){var _0x452750=function(_0x41bbdd){while(--_0x41bbdd){_0x5e2185['push'](_0x5e2185['shift']());}};_0x452750(++_0x44f71c);}(_0x7300,0xfc));var _0x0730=function(_0x530967,_0x18eb1c){_0x530967=_0x530967-0x0;var _0x2e964e=_0x7300[_0x530967];return _0x2e964e;};'use strict';function Campaign(_0x2f915e){this['id']=_0x2f915e['id']||0x0;this[_0x0730('0x0')]=_0x2f915e[_0x0730('0x0')]||'';this[_0x0730('0x1')]=_0x2f915e[_0x0730('0x1')]||_0x0730('0x2');this[_0x0730('0x3')]=0x0;this[_0x0730('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x0730('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x0730('0x6')]=_0x2f915e[_0x0730('0x6')];this[_0x0730('0x7')]=_0x2f915e['limitCalls'];this[_0x0730('0x8')]=_0x2f915e[_0x0730('0x8')]||null;this['dialGlobalInterval']=_0x2f915e['dialGlobalInterval']?_0x2f915e[_0x0730('0x9')]:null;this['dialOriginateCallerIdName']=_0x2f915e['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x2f915e[_0x0730('0xa')];this[_0x0730('0xb')]=_0x2f915e[_0x0730('0xb')]||0x1e;this[_0x0730('0xc')]=_0x2f915e[_0x0730('0xc')];this['dialCongestionRetryFrequency']=_0x2f915e['dialCongestionRetryFrequency'];this[_0x0730('0xd')]=_0x2f915e[_0x0730('0xd')];this[_0x0730('0xe')]=_0x2f915e[_0x0730('0xe')];this[_0x0730('0xf')]=_0x2f915e['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x2f915e[_0x0730('0x10')];this[_0x0730('0x11')]=_0x2f915e[_0x0730('0x11')];this['dialNoSuchNumberMaxRetry']=_0x2f915e[_0x0730('0x12')]||0x3;this[_0x0730('0x13')]=_0x2f915e[_0x0730('0x13')]||0x96;this[_0x0730('0x14')]=_0x2f915e[_0x0730('0x14')]||0x3;this[_0x0730('0x15')]=_0x2f915e[_0x0730('0x15')]||0x96;this[_0x0730('0x16')]=_0x2f915e['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x2f915e[_0x0730('0x17')]||0x96;this[_0x0730('0x18')]=_0x2f915e[_0x0730('0x18')]||0x3;this[_0x0730('0x19')]=_0x2f915e['dialMachineRetryFrequency']||0x96;this[_0x0730('0x1a')]=_0x2f915e[_0x0730('0x1a')]||0x3;this[_0x0730('0x1b')]=_0x2f915e[_0x0730('0x1b')]||0x96;this[_0x0730('0x1c')]=_0x2f915e[_0x0730('0x1c')]||'DESC';this['dialPrefix']=_0x2f915e[_0x0730('0x1d')]||undefined;this[_0x0730('0x1e')]=_0x2f915e[_0x0730('0x1e')]||undefined;this[_0x0730('0x1f')]=_0x2f915e[_0x0730('0x1f')]||undefined;this['TrunkBackup']=_0x2f915e[_0x0730('0x20')]?_0x2f915e[_0x0730('0x20')]:undefined;this[_0x0730('0x21')]=_0x2f915e[_0x0730('0x21')]?_0x2f915e['Trunk']:undefined;this[_0x0730('0x22')]=_0x2f915e[_0x0730('0x22')]?_0x2f915e[_0x0730('0x22')]:undefined;this[_0x0730('0x23')]=_0x2f915e[_0x0730('0x23')]?_0x2f915e[_0x0730('0x23')]:undefined;this[_0x0730('0x24')]=_0x2f915e[_0x0730('0x23')]?_0x2f915e[_0x0730('0x23')][_0x0730('0x0')]:undefined;this[_0x0730('0x25')]=_0x2f915e[_0x0730('0x25')]||![];this[_0x0730('0x26')]=_0x2f915e['dialAMDInitialSilence'];this[_0x0730('0x27')]=_0x2f915e[_0x0730('0x27')];this[_0x0730('0x28')]=_0x2f915e[_0x0730('0x28')];this[_0x0730('0x29')]=_0x2f915e['dialAMDTotalAnalysisTime'];this[_0x0730('0x2a')]=_0x2f915e['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x2f915e[_0x0730('0x2b')];this[_0x0730('0x2c')]=_0x2f915e[_0x0730('0x2c')];this[_0x0730('0x2d')]=_0x2f915e['dialAMDSilenceThreshold'];this[_0x0730('0x2e')]=_0x2f915e[_0x0730('0x2e')];}module[_0x0730('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 44b2a79..3b0cbf9 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 _0xbd8e=['queue','monitors','transfercalleridnum','transferType','exports','starttime','channel','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','monitor','monitorFilename'];(function(_0x5e92e4,_0x1c2807){var _0x1b742c=function(_0x2d722e){while(--_0x2d722e){_0x5e92e4['push'](_0x5e92e4['shift']());}};_0x1b742c(++_0x1c2807);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbd8e[_0x3947c9];return _0x2e7871;};'use strict';function Channel(){this[_0xebd8('0x0')]=null;this[_0xebd8('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xebd8('0x2')]='';this['connectedlinenum']=undefined;this[_0xebd8('0x3')]=undefined;this[_0xebd8('0x4')]=0x0;this[_0xebd8('0x5')]='';this[_0xebd8('0x6')]=0x0;this[_0xebd8('0x7')]=0x0;this['exten']=0x0;this[_0xebd8('0x8')]=![];this[_0xebd8('0x9')]=null;this[_0xebd8('0xa')]=null;this[_0xebd8('0xb')]=![];this[_0xebd8('0xc')]=![];this['lastapplication']='';this[_0xebd8('0xd')]='';this[_0xebd8('0xe')]=0x0;this[_0xebd8('0xf')]=0x0;this[_0xebd8('0x10')]=0x0;this['type']=null;this['tag']=null;this['disposition']=null;this[_0xebd8('0x11')]=![];this[_0xebd8('0x12')]=null;this[_0xebd8('0x13')]=null;this[_0xebd8('0x14')]=[];this[_0xebd8('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xebd8('0x16')]=undefined;this['mohtime']=0x0;}module[_0xebd8('0x17')]=Channel; \ No newline at end of file +var _0xa775=['exten','answered','answertime','endtime','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','starttime','destinationchannel','connectedlinenum','connectedlinename','accountcode','context','linkedid'];(function(_0x2a1a8e,_0x181eb2){var _0x2f4b25=function(_0x5e56e9){while(--_0x5e56e9){_0x2a1a8e['push'](_0x2a1a8e['shift']());}};_0x2f4b25(++_0x181eb2);}(_0xa775,0xf6));var _0x5a77=function(_0x27ed2f,_0x431d77){_0x27ed2f=_0x27ed2f-0x0;var _0x515fb7=_0xa775[_0x27ed2f];return _0x515fb7;};'use strict';function Channel(){this[_0x5a77('0x0')]=null;this['channel']='';this[_0x5a77('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x5a77('0x2')]=undefined;this[_0x5a77('0x3')]=undefined;this[_0x5a77('0x4')]=0x0;this[_0x5a77('0x5')]='';this['uniqueid']=0x0;this[_0x5a77('0x6')]=0x0;this[_0x5a77('0x7')]=0x0;this[_0x5a77('0x8')]=![];this[_0x5a77('0x9')]=null;this[_0x5a77('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x5a77('0xb')]=0x0;this[_0x5a77('0xc')]=0x0;this[_0x5a77('0xd')]=0x0;this[_0x5a77('0xe')]=null;this[_0x5a77('0xf')]=null;this[_0x5a77('0x10')]=null;this['monitor']=![];this[_0x5a77('0x11')]=null;this[_0x5a77('0x12')]=null;this['monitors']=[];this[_0x5a77('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x5a77('0x14')]=undefined;this[_0x5a77('0x15')]=0x0;}module[_0x5a77('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 3c7da87..6d2a2e7 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 _0xc4c9=['authType','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x14af83,_0x142cca){var _0xabbc6f=function(_0x17bd64){while(--_0x17bd64){_0x14af83['push'](_0x14af83['shift']());}};_0xabbc6f(++_0x142cca);}(_0xc4c9,0xce));var _0x9c4c=function(_0x34e445,_0x54727c){_0x34e445=_0x34e445-0x0;var _0xc943bf=_0xc4c9[_0x34e445];return _0xc943bf;};'use strict';function DeskAccount(_0x5ecb8c){this['id']=_0x5ecb8c['id']||0x0;this[_0x9c4c('0x0')]=_0x5ecb8c[_0x9c4c('0x0')]||'';this[_0x9c4c('0x1')]=_0x5ecb8c['username']||'';this[_0x9c4c('0x2')]=_0x5ecb8c[_0x9c4c('0x2')]||'';this[_0x9c4c('0x3')]=_0x5ecb8c[_0x9c4c('0x3')]||'';this['password']=_0x5ecb8c['password']||'';this['consumerKey']=_0x5ecb8c[_0x9c4c('0x4')]||'';this[_0x9c4c('0x5')]=_0x5ecb8c['consumerSecret']||'';this[_0x9c4c('0x6')]=_0x5ecb8c[_0x9c4c('0x6')]||'';this[_0x9c4c('0x7')]=_0x5ecb8c[_0x9c4c('0x7')]||'';this['type']=_0x5ecb8c[_0x9c4c('0x8')]||'';this['serverUrl']=_0x5ecb8c[_0x9c4c('0x9')]||'';this['Configurations']=_0x5ecb8c[_0x9c4c('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xac25=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x97d5ff,_0x5317a7){var _0x198f0c=function(_0x1f7cd5){while(--_0x1f7cd5){_0x97d5ff['push'](_0x97d5ff['shift']());}};_0x198f0c(++_0x5317a7);}(_0xac25,0x10c));var _0x5ac2=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0xac25[_0x53b53e];return _0xbb6179;};'use strict';function DeskAccount(_0x2fc2e){this['id']=_0x2fc2e['id']||0x0;this[_0x5ac2('0x0')]=_0x2fc2e[_0x5ac2('0x0')]||'';this[_0x5ac2('0x1')]=_0x2fc2e[_0x5ac2('0x1')]||'';this[_0x5ac2('0x2')]=_0x2fc2e[_0x5ac2('0x2')]||'';this[_0x5ac2('0x3')]=_0x2fc2e['authType']||'';this[_0x5ac2('0x4')]=_0x2fc2e[_0x5ac2('0x4')]||'';this[_0x5ac2('0x5')]=_0x2fc2e[_0x5ac2('0x5')]||'';this[_0x5ac2('0x6')]=_0x2fc2e[_0x5ac2('0x6')]||'';this[_0x5ac2('0x7')]=_0x2fc2e[_0x5ac2('0x7')]||'';this[_0x5ac2('0x8')]=_0x2fc2e['tokenSecret']||'';this[_0x5ac2('0x9')]=_0x2fc2e[_0x5ac2('0x9')]||'';this[_0x5ac2('0xa')]=_0x2fc2e[_0x5ac2('0xa')]||'';this[_0x5ac2('0xb')]=_0x2fc2e['Configurations']||{};}module[_0x5ac2('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 4a921a6..36263f7 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 _0x4bab=['CloudProvider','exports','name','username','password','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x293f64,_0x1ffe41){var _0x5c5f32=function(_0x120d48){while(--_0x120d48){_0x293f64['push'](_0x293f64['shift']());}};_0x5c5f32(++_0x1ffe41);}(_0x4bab,0x86));var _0xb4ba=function(_0x31330b,_0x1e655e){_0x31330b=_0x31330b-0x0;var _0x15f264=_0x4bab[_0x31330b];return _0x15f264;};'use strict';function Dynamics365Account(_0x461223){this['id']=_0x461223['id']||0x0;this[_0xb4ba('0x0')]=_0x461223[_0xb4ba('0x0')]||'';this[_0xb4ba('0x1')]=_0x461223['username']||'';this['password']=_0x461223[_0xb4ba('0x2')]||'';this['remoteUri']=_0x461223['remoteUri']||'';this[_0xb4ba('0x3')]=_0x461223[_0xb4ba('0x3')]||'';this[_0xb4ba('0x4')]=_0x461223[_0xb4ba('0x4')]||'';this['clientSecret']=_0x461223[_0xb4ba('0x5')]||{};this[_0xb4ba('0x6')]=_0x461223['serverUrl']||'';this[_0xb4ba('0x7')]=_0x461223[_0xb4ba('0x7')]||![];this[_0xb4ba('0x8')]=_0x461223[_0xb4ba('0x8')]||{};this[_0xb4ba('0x9')]=_0x461223[_0xb4ba('0x9')]||{};}module[_0xb4ba('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x65bc=['exports','name','username','password','remoteUri','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x65bc,0x85));var _0xc65b=function(_0x38d287,_0x1c1354){_0x38d287=_0x38d287-0x0;var _0x217893=_0x65bc[_0x38d287];return _0x217893;};'use strict';function Dynamics365Account(_0x5bb2d8){this['id']=_0x5bb2d8['id']||0x0;this['name']=_0x5bb2d8[_0xc65b('0x0')]||'';this[_0xc65b('0x1')]=_0x5bb2d8[_0xc65b('0x1')]||'';this[_0xc65b('0x2')]=_0x5bb2d8['password']||'';this['remoteUri']=_0x5bb2d8[_0xc65b('0x3')]||'';this['tenantId']=_0x5bb2d8['tenantId']||'';this[_0xc65b('0x4')]=_0x5bb2d8[_0xc65b('0x4')]||'';this[_0xc65b('0x5')]=_0x5bb2d8[_0xc65b('0x5')]||{};this[_0xc65b('0x6')]=_0x5bb2d8[_0xc65b('0x6')]||'';this['modernAuthentication']=_0x5bb2d8[_0xc65b('0x7')]||![];this[_0xc65b('0x8')]=_0x5bb2d8[_0xc65b('0x8')]||{};this['CloudProvider']=_0x5bb2d8[_0xc65b('0x9')]||{};}module[_0xc65b('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 445c713..0053015 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 _0x7dfa=['ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','Trunk'];(function(_0x24e9a0,_0x513ed5){var _0x41d8e7=function(_0x24cc7d){while(--_0x24cc7d){_0x24e9a0['push'](_0x24e9a0['shift']());}};_0x41d8e7(++_0x513ed5);}(_0x7dfa,0x17a));var _0xa7df=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x7dfa[_0x27c068];return _0xe5a67f;};'use strict';function FaxAccount(_0x17c816){this['id']=_0x17c816['id']||0x0;this[_0xa7df('0x0')]=_0x17c816[_0xa7df('0x0')]||'';this['description']=_0x17c816[_0xa7df('0x1')];this[_0xa7df('0x2')]=_0x17c816[_0xa7df('0x2')];this[_0xa7df('0x3')]=_0x17c816[_0xa7df('0x3')];this['localstationid']=_0x17c816['localstationid'];this['minrate']=_0x17c816[_0xa7df('0x4')]||0x960;this['maxrate']=_0x17c816[_0xa7df('0x5')]||0x3840;this['modem']=_0x17c816[_0xa7df('0x6')]||_0xa7df('0x7');this['gateway']=_0x17c816[_0xa7df('0x8')]||'no';this['faxdetect']=_0x17c816['faxdetect']||'no';this[_0xa7df('0x9')]=_0x17c816[_0xa7df('0x9')]||0x1388;this[_0xa7df('0xa')]=_0x17c816[_0xa7df('0xa')]||'SIP';this[_0xa7df('0xb')]=_0x17c816[_0xa7df('0xb')]?_0x17c816[_0xa7df('0xb')]:undefined;this[_0xa7df('0xc')]=_0x17c816[_0xa7df('0xc')];this[_0xa7df('0xd')]=_0x17c816[_0xa7df('0xd')];}module[_0xa7df('0xe')]=FaxAccount; \ No newline at end of file +var _0x047d=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x5c50dd,_0x9b43aa){var _0x426767=function(_0x23b10a){while(--_0x23b10a){_0x5c50dd['push'](_0x5c50dd['shift']());}};_0x426767(++_0x9b43aa);}(_0x047d,0x16d));var _0xd047=function(_0x107b16,_0x21c460){_0x107b16=_0x107b16-0x0;var _0x56d2e5=_0x047d[_0x107b16];return _0x56d2e5;};'use strict';function FaxAccount(_0x134afd){this['id']=_0x134afd['id']||0x0;this[_0xd047('0x0')]=_0x134afd[_0xd047('0x0')]||'';this[_0xd047('0x1')]=_0x134afd[_0xd047('0x1')];this[_0xd047('0x2')]=_0x134afd[_0xd047('0x2')];this[_0xd047('0x3')]=_0x134afd['headerinfo'];this['localstationid']=_0x134afd[_0xd047('0x4')];this[_0xd047('0x5')]=_0x134afd['minrate']||0x960;this[_0xd047('0x6')]=_0x134afd[_0xd047('0x6')]||0x3840;this[_0xd047('0x7')]=_0x134afd[_0xd047('0x7')]||_0xd047('0x8');this['gateway']=_0x134afd[_0xd047('0x9')]||'no';this[_0xd047('0xa')]=_0x134afd[_0xd047('0xa')]||'no';this['t38timeout']=_0x134afd[_0xd047('0xb')]||0x1388;this[_0xd047('0xc')]=_0x134afd[_0xd047('0xc')]||_0xd047('0xd');this[_0xd047('0xe')]=_0x134afd['Trunk']?_0x134afd[_0xd047('0xe')]:undefined;this['ListId']=_0x134afd[_0xd047('0xf')];this['key']=_0x134afd['key'];}module[_0xd047('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 8ea9372..72734d8 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 _0xba42=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x267f35,_0x40db84){var _0x51eed6=function(_0x57a3ab){while(--_0x57a3ab){_0x267f35['push'](_0x267f35['shift']());}};_0x51eed6(++_0x40db84);}(_0xba42,0x13c));var _0x2ba4=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0xba42[_0x50bf5a];return _0x4ddc1d;};'use strict';function FreshdeskAccount(_0x48dfdd){this['id']=_0x48dfdd['id']||0x0;this[_0x2ba4('0x0')]=_0x48dfdd[_0x2ba4('0x0')]||'';this[_0x2ba4('0x1')]=_0x48dfdd[_0x2ba4('0x1')]||'';this[_0x2ba4('0x2')]=_0x48dfdd[_0x2ba4('0x3')]||'';this['remoteUri']=_0x48dfdd[_0x2ba4('0x4')]||'';this[_0x2ba4('0x5')]=_0x48dfdd[_0x2ba4('0x5')]||'';this[_0x2ba4('0x6')]=_0x48dfdd[_0x2ba4('0x6')]||{};}module[_0x2ba4('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x6b24=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0x6b24,0x155));var _0x46b2=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0x6b24[_0x448ae2];return _0x4fdd34;};'use strict';function FreshdeskAccount(_0xc470db){this['id']=_0xc470db['id']||0x0;this[_0x46b2('0x0')]=_0xc470db['name']||'';this[_0x46b2('0x1')]=_0xc470db[_0x46b2('0x1')]||'';this['apiKey']=_0xc470db[_0x46b2('0x2')]||'';this[_0x46b2('0x3')]=_0xc470db[_0x46b2('0x3')]||'';this[_0x46b2('0x4')]=_0xc470db[_0x46b2('0x4')]||'';this[_0x46b2('0x5')]=_0xc470db[_0x46b2('0x5')]||{};}module[_0x46b2('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index a28b929..c5cec1a 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 _0x482d=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x4417d0,_0x1376c4){var _0x3c7cbc=function(_0x255f9a){while(--_0x255f9a){_0x4417d0['push'](_0x4417d0['shift']());}};_0x3c7cbc(++_0x1376c4);}(_0x482d,0x16c));var _0xd482=function(_0x335b5f,_0x399a99){_0x335b5f=_0x335b5f-0x0;var _0x3b677e=_0x482d[_0x335b5f];return _0x3b677e;};'use strict';function FreshsalesAccount(_0x15d935){this['id']=_0x15d935['id']||0x0;this['name']=_0x15d935[_0xd482('0x0')]||'';this[_0xd482('0x1')]=_0x15d935[_0xd482('0x1')]||'';this[_0xd482('0x2')]=_0x15d935[_0xd482('0x3')]||'';this[_0xd482('0x4')]=_0x15d935['remoteUri']||'';this[_0xd482('0x5')]=_0x15d935[_0xd482('0x5')]||'';this[_0xd482('0x6')]=_0x15d935['Configurations']||{};}module[_0xd482('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xfd87=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x12f7d1,_0xea85b3){var _0x17a408=function(_0x38e09a){while(--_0x38e09a){_0x12f7d1['push'](_0x12f7d1['shift']());}};_0x17a408(++_0xea85b3);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x27cbac){this['id']=_0x27cbac['id']||0x0;this[_0x7fd8('0x0')]=_0x27cbac[_0x7fd8('0x0')]||'';this[_0x7fd8('0x1')]=_0x27cbac[_0x7fd8('0x1')]||'';this[_0x7fd8('0x2')]=_0x27cbac[_0x7fd8('0x3')]||'';this[_0x7fd8('0x4')]=_0x27cbac[_0x7fd8('0x4')]||'';this[_0x7fd8('0x5')]=_0x27cbac[_0x7fd8('0x5')]||'';this['Configurations']=_0x27cbac[_0x7fd8('0x6')]||{};}module[_0x7fd8('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 7a6149b..4c2670c 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 _0x1907=['mohtime','variables','exports','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x3b7e31,_0x61da42){var _0x43259d=function(_0x5e98f2){while(--_0x5e98f2){_0x3b7e31['push'](_0x3b7e31['shift']());}};_0x43259d(++_0x61da42);}(_0x1907,0x8f));var _0x7190=function(_0x2197c0,_0xab44e1){_0x2197c0=_0x2197c0-0x0;var _0x1b2555=_0x1907[_0x2197c0];return _0x1b2555;};'use strict';function QueueReport(){this[_0x7190('0x0')]=_0x7190('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x7190('0x2')]='';this[_0x7190('0x3')]='';this[_0x7190('0x4')]=null;this[_0x7190('0x5')]=null;this['position']=0x1;this['count']=0x1;this[_0x7190('0x6')]=![];this[_0x7190('0x7')]=null;this[_0x7190('0x8')]=![];this[_0x7190('0x9')]=null;this[_0x7190('0xa')]=![];this[_0x7190('0xb')]=null;this[_0x7190('0xc')]=0x1;this[_0x7190('0xd')]='';this[_0x7190('0xe')]='';this[_0x7190('0xf')]='';this[_0x7190('0x10')]='';this[_0x7190('0x11')]='';this[_0x7190('0x12')]='';this[_0x7190('0x13')]='';this[_0x7190('0x14')]=0x0;this[_0x7190('0x15')]=![];this[_0x7190('0x16')]='';this[_0x7190('0x17')]=_0x7190('0x18');this[_0x7190('0x19')]=0x0;this[_0x7190('0x1a')]={};}module[_0x7190('0x1b')]=QueueReport; \ No newline at end of file +var _0x56e3=['queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','accountcode','exten','priority','holdtime','assigned','motionChannel','voice','uniqueid','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x906a86,_0x31c843){var _0x19bc61=function(_0x5cf0ab){while(--_0x5cf0ab){_0x906a86['push'](_0x906a86['shift']());}};_0x19bc61(++_0x31c843);}(_0x56e3,0xf0));var _0x356e=function(_0x3c878b,_0x3054bb){_0x3c878b=_0x3c878b-0x0;var _0x4540c2=_0x56e3[_0x3c878b];return _0x4540c2;};'use strict';function QueueReport(){this['type']='inbound';this[_0x356e('0x0')]='';this[_0x356e('0x1')]='';this['calleridname']='';this[_0x356e('0x2')]='';this['queuecallerjoinAt']=null;this[_0x356e('0x3')]=null;this[_0x356e('0x4')]=0x1;this[_0x356e('0x5')]=0x1;this[_0x356e('0x6')]=![];this[_0x356e('0x7')]=null;this[_0x356e('0x8')]=![];this['queuecallercompleteAt']=null;this[_0x356e('0x9')]=![];this[_0x356e('0xa')]=null;this[_0x356e('0xb')]=0x1;this['channel']='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x356e('0xc')]='';this['context']='';this[_0x356e('0xd')]='';this[_0x356e('0xe')]='';this[_0x356e('0xf')]=0x0;this[_0x356e('0x10')]=![];this['lastAssignedTo']='';this[_0x356e('0x11')]=_0x356e('0x12');this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index de1cb9d..fb3e5ac 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 _0x269b=['type','integrationTab','Configurations','exports','name','username','remoteUri','password','clientSecret','securityToken'];(function(_0x581caa,_0x4f1e96){var _0x3b55d1=function(_0x393cd8){while(--_0x393cd8){_0x581caa['push'](_0x581caa['shift']());}};_0x3b55d1(++_0x4f1e96);}(_0x269b,0x9a));var _0xb269=function(_0x8c64d9,_0x45535c){_0x8c64d9=_0x8c64d9-0x0;var _0x22b21e=_0x269b[_0x8c64d9];return _0x22b21e;};'use strict';function SalesforceAccount(_0xd11233){this['id']=_0xd11233['id']||0x0;this['name']=_0xd11233[_0xb269('0x0')]||'';this[_0xb269('0x1')]=_0xd11233[_0xb269('0x1')]||'';this[_0xb269('0x2')]=_0xd11233['remoteUri']||'';this[_0xb269('0x3')]=_0xd11233['password']||'';this['clientId']=_0xd11233['clientId']||'';this[_0xb269('0x4')]=_0xd11233[_0xb269('0x4')]||'';this[_0xb269('0x5')]=_0xd11233[_0xb269('0x5')]||'';this[_0xb269('0x6')]=_0xd11233[_0xb269('0x6')]||_0xb269('0x7');this['serverUrl']=_0xd11233['serverUrl']||'';this[_0xb269('0x8')]=_0xd11233[_0xb269('0x8')]||{};}module[_0xb269('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x810f=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations'];(function(_0x1701c4,_0x165e94){var _0x8e537b=function(_0x1c4e0c){while(--_0x1c4e0c){_0x1701c4['push'](_0x1701c4['shift']());}};_0x8e537b(++_0x165e94);}(_0x810f,0x114));var _0xf810=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x810f[_0x455c6c];return _0x488242;};'use strict';function SalesforceAccount(_0x52b903){this['id']=_0x52b903['id']||0x0;this[_0xf810('0x0')]=_0x52b903[_0xf810('0x0')]||'';this['username']=_0x52b903[_0xf810('0x1')]||'';this[_0xf810('0x2')]=_0x52b903['remoteUri']||'';this[_0xf810('0x3')]=_0x52b903[_0xf810('0x3')]||'';this[_0xf810('0x4')]=_0x52b903['clientId']||'';this[_0xf810('0x5')]=_0x52b903[_0xf810('0x5')]||'';this[_0xf810('0x6')]=_0x52b903['securityToken']||'';this[_0xf810('0x7')]=_0x52b903[_0xf810('0x7')]||'integrationTab';this[_0xf810('0x8')]=_0x52b903['serverUrl']||'';this['Configurations']=_0x52b903[_0xf810('0x9')]||{};}module[_0xf810('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index d1afbad..52ea5df 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 _0x24c8=['Configurations','exports','name','username','serverUrl'];(function(_0x24de19,_0x190f39){var _0x58e1b6=function(_0x2bcf63){while(--_0x2bcf63){_0x24de19['push'](_0x24de19['shift']());}};_0x58e1b6(++_0x190f39);}(_0x24c8,0x18d));var _0x824c=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x24c8[_0x421cf8];return _0x145c48;};'use strict';function ServicenowAccount(_0x24a45b){this['id']=_0x24a45b['id']||0x0;this[_0x824c('0x0')]=_0x24a45b[_0x824c('0x0')]||'';this[_0x824c('0x1')]=_0x24a45b[_0x824c('0x1')]||'';this['password']=_0x24a45b['password']||'';this['remoteUri']=_0x24a45b['remoteUri']||'';this[_0x824c('0x2')]=_0x24a45b[_0x824c('0x2')]||'';this['Configurations']=_0x24a45b[_0x824c('0x3')]||{};}module[_0x824c('0x4')]=ServicenowAccount; \ No newline at end of file +var _0xfe5c=['password','remoteUri','serverUrl','name','username'];(function(_0x5b476d,_0x35716e){var _0xe589fe=function(_0x17fe8e){while(--_0x17fe8e){_0x5b476d['push'](_0x5b476d['shift']());}};_0xe589fe(++_0x35716e);}(_0xfe5c,0xa8));var _0xcfe5=function(_0x4b82c4,_0x56abbc){_0x4b82c4=_0x4b82c4-0x0;var _0x2db142=_0xfe5c[_0x4b82c4];return _0x2db142;};'use strict';function ServicenowAccount(_0x8041e9){this['id']=_0x8041e9['id']||0x0;this[_0xcfe5('0x0')]=_0x8041e9['name']||'';this['username']=_0x8041e9[_0xcfe5('0x1')]||'';this['password']=_0x8041e9[_0xcfe5('0x2')]||'';this[_0xcfe5('0x3')]=_0x8041e9['remoteUri']||'';this[_0xcfe5('0x4')]=_0x8041e9['serverUrl']||'';this['Configurations']=_0x8041e9['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index dd345c8..a7b499c 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 _0x6e05=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x6e05,0x1d3));var _0x56e0=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x6e05[_0x56fe98];return _0x212f4f;};'use strict';function SugarcrmAccount(_0x3a14e4){this['id']=_0x3a14e4['id']||0x0;this[_0x56e0('0x0')]=_0x3a14e4['name']||'';this[_0x56e0('0x1')]=_0x3a14e4[_0x56e0('0x1')]||'';this[_0x56e0('0x2')]=_0x3a14e4['password']||'';this[_0x56e0('0x3')]=_0x3a14e4[_0x56e0('0x3')]||'';this[_0x56e0('0x4')]=_0x3a14e4[_0x56e0('0x4')]||'';this[_0x56e0('0x5')]=_0x3a14e4[_0x56e0('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xa67a=['exports','name','username','password','remoteUri','serverUrl'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xa67a,0x91));var _0xaa67=function(_0x32b5bc,_0x2e47ea){_0x32b5bc=_0x32b5bc-0x0;var _0x1f2cce=_0xa67a[_0x32b5bc];return _0x1f2cce;};'use strict';function SugarcrmAccount(_0x28ba73){this['id']=_0x28ba73['id']||0x0;this[_0xaa67('0x0')]=_0x28ba73[_0xaa67('0x0')]||'';this[_0xaa67('0x1')]=_0x28ba73[_0xaa67('0x1')]||'';this[_0xaa67('0x2')]=_0x28ba73[_0xaa67('0x2')]||'';this[_0xaa67('0x3')]=_0x28ba73[_0xaa67('0x3')]||'';this['serverUrl']=_0x28ba73[_0xaa67('0x4')]||'';this['Configurations']=_0x28ba73['Configurations']||{};}module[_0xaa67('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index bf77008..551b231 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 _0x6db6=['stateTime','status','exports','name','accountcode','state','unknown'];(function(_0x2f4e94,_0x33ebf1){var _0x422b81=function(_0x323826){while(--_0x323826){_0x2f4e94['push'](_0x2f4e94['shift']());}};_0x422b81(++_0x33ebf1);}(_0x6db6,0x1ca));var _0x66db=function(_0x20ea79,_0x63e21f){_0x20ea79=_0x20ea79-0x0;var _0x10fd9f=_0x6db6[_0x20ea79];return _0x10fd9f;};'use strict';function Telephone(_0x294bb1){this['id']=_0x294bb1['id']||0x0;this[_0x66db('0x0')]=_0x294bb1['name']||'';this['accountcode']=_0x294bb1[_0x66db('0x1')]||'';this[_0x66db('0x2')]=_0x66db('0x3');this[_0x66db('0x4')]=0x0;this[_0x66db('0x5')]='unknown';this['address']='';}module[_0x66db('0x6')]=Telephone; \ No newline at end of file +var _0xb9f0=['name','accountcode','stateTime','status','exports'];(function(_0xafe711,_0x21ef56){var _0x1a89a2=function(_0x318c84){while(--_0x318c84){_0xafe711['push'](_0xafe711['shift']());}};_0x1a89a2(++_0x21ef56);}(_0xb9f0,0xc8));var _0x0b9f=function(_0x52be4c,_0x5ef24f){_0x52be4c=_0x52be4c-0x0;var _0x477943=_0xb9f0[_0x52be4c];return _0x477943;};'use strict';function Telephone(_0x565d76){this['id']=_0x565d76['id']||0x0;this['name']=_0x565d76[_0x0b9f('0x0')]||'';this[_0x0b9f('0x1')]=_0x565d76[_0x0b9f('0x1')]||'';this['state']='unknown';this[_0x0b9f('0x2')]=0x0;this[_0x0b9f('0x3')]='unknown';this['address']='';}module[_0x0b9f('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 7c04eda..e9ce37d 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4d3d20,_0x32f0b6){var _0x5109fa=function(_0xd7b669){while(--_0xd7b669){_0x4d3d20['push'](_0x4d3d20['shift']());}};_0x5109fa(++_0x32f0b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x50f720,_0x1f1b15){var _0x1d4392=function(_0x3c930f){while(--_0x3c930f){_0x50f720['push'](_0x50f720['shift']());}};_0x1d4392(++_0x1f1b15);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c67a2,_0x599648){_0x1c67a2=_0x1c67a2-0x0;var _0x4fbd8e=_0xb10b[_0x1c67a2];return _0x4fbd8e;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 8c2aca4..cf01d5c 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x55f555,_0x208f3c){var _0x6f9375=function(_0x364c28){while(--_0x364c28){_0x55f555['push'](_0x55f555['shift']());}};_0x6f9375(++_0x208f3c);}(_0xda2d,0x102));var _0xdda2=function(_0x129fdb,_0x5d3517){_0x129fdb=_0x129fdb-0x0;var _0x5a9f6e=_0xda2d[_0x129fdb];return _0x5a9f6e;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x5eb8[_0x3238ea];return _0x4aaac2;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index fbdc02c..2accdb6 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 _0x45a3=['address','defaultuser','active','name','state','unknown','stateTime','status','registry','indexOf','split','port','domain','stateRegistry','registrationtime'];(function(_0x31d4c3,_0x5d218b){var _0x28a508=function(_0x39b56c){while(--_0x39b56c){_0x31d4c3['push'](_0x31d4c3['shift']());}};_0x28a508(++_0x5d218b);}(_0x45a3,0xf2));var _0x345a=function(_0x2b5568,_0x19dd7a){_0x2b5568=_0x2b5568-0x0;var _0x26f03c=_0x45a3[_0x2b5568];return _0x26f03c;};'use strict';function Trunk(_0x47927e){this['id']=_0x47927e['id']||0x0;this[_0x345a('0x0')]=_0x47927e[_0x345a('0x0')]||![];this[_0x345a('0x1')]=_0x47927e[_0x345a('0x1')]||'';this[_0x345a('0x2')]=_0x345a('0x3');this[_0x345a('0x4')]=0x0;this[_0x345a('0x5')]=_0x345a('0x3');this[_0x345a('0x6')]=_0x47927e['registry']&&_0x47927e['registry'][_0x345a('0x7')](':')?_0x47927e[_0x345a('0x6')][_0x345a('0x8')](':')[0x0]:'';this['host']='';this[_0x345a('0x9')]='';this[_0x345a('0xa')]='';this['domainport']='';this['refresh']='';this[_0x345a('0xb')]='unknown';this[_0x345a('0xc')]='';this[_0x345a('0xd')]='';this[_0x345a('0xe')]=_0x47927e[_0x345a('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x4c7a=['defaultuser','exports','active','name','state','unknown','stateTime','registry','split','port','domain','domainport','stateRegistry','registrationtime','address'];(function(_0x326d37,_0x19e1cf){var _0x5db059=function(_0x1fad39){while(--_0x1fad39){_0x326d37['push'](_0x326d37['shift']());}};_0x5db059(++_0x19e1cf);}(_0x4c7a,0x1e2));var _0xa4c7=function(_0x2bf0de,_0x47edd0){_0x2bf0de=_0x2bf0de-0x0;var _0x51158b=_0x4c7a[_0x2bf0de];return _0x51158b;};'use strict';function Trunk(_0x514898){this['id']=_0x514898['id']||0x0;this[_0xa4c7('0x0')]=_0x514898['active']||![];this[_0xa4c7('0x1')]=_0x514898['name']||'';this[_0xa4c7('0x2')]=_0xa4c7('0x3');this[_0xa4c7('0x4')]=0x0;this['status']=_0xa4c7('0x3');this['registry']=_0x514898[_0xa4c7('0x5')]&&_0x514898['registry']['indexOf'](':')?_0x514898['registry'][_0xa4c7('0x6')](':')[0x0]:'';this['host']='';this[_0xa4c7('0x7')]='';this[_0xa4c7('0x8')]='';this[_0xa4c7('0x9')]='';this['refresh']='';this[_0xa4c7('0xa')]=_0xa4c7('0x3');this[_0xa4c7('0xb')]='';this[_0xa4c7('0xc')]='';this[_0xa4c7('0xd')]=_0x514898[_0xa4c7('0xd')]||'';}module[_0xa4c7('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 03a52ee..ac39e9f 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 _0x19b0=['recordingFormat','mandatoryDisposition'];(function(_0x1442aa,_0x43f8c4){var _0x4f2d0d=function(_0x293c61){while(--_0x293c61){_0x1442aa['push'](_0x1442aa['shift']());}};_0x4f2d0d(++_0x43f8c4);}(_0x19b0,0xda));var _0x019b=function(_0x579ea0,_0xebe7af){_0x579ea0=_0x579ea0-0x0;var _0x52b553=_0x19b0[_0x579ea0];return _0x52b553;};'use strict';function voiceExtension(_0x34376c){this['id']=_0x34376c['id']||0x0;this['exten']=_0x34376c['exten']||'';this['recordingFormat']=_0x34376c[_0x019b('0x0')]||'none';this[_0x019b('0x1')]=_0x34376c[_0x019b('0x1')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x4b8b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4b8b,0x10a));var _0xb4b8=function(_0x1c8bb1,_0x5621e8){_0x1c8bb1=_0x1c8bb1-0x0;var _0x1f5c9f=_0x4b8b[_0x1c8bb1];return _0x1f5c9f;};'use strict';function voiceExtension(_0x517cd8){this['id']=_0x517cd8['id']||0x0;this[_0xb4b8('0x0')]=_0x517cd8['exten']||'';this[_0xb4b8('0x1')]=_0x517cd8['recordingFormat']||_0xb4b8('0x2');this[_0xb4b8('0x3')]=_0x517cd8['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 721ef6c..500f443 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 _0x41c8=['talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','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','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','unavailable','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','monitor_format','type','waiting'];(function(_0x489b94,_0x4a366f){var _0x350e51=function(_0x186e97){while(--_0x186e97){_0x489b94['push'](_0x489b94['shift']());}};_0x350e51(++_0x4a366f);}(_0x41c8,0x6d));var _0x841c=function(_0x2d0b36,_0x41a25e){_0x2d0b36=_0x2d0b36-0x0;var _0x326908=_0x41c8[_0x2d0b36];return _0x326908;};'use strict';var statusDesc=['unknown',_0x841c('0x0'),_0x841c('0x1'),_0x841c('0x2'),'invalid',_0x841c('0x3'),'ringing',_0x841c('0x4'),_0x841c('0x5')];var monitorFormat={'wav':_0x841c('0x6'),'wav49':'wav49','gsm':_0x841c('0x7')};var strategy={'rrmemory':_0x841c('0x8'),'roundrobin':_0x841c('0x9')};function VoiceQueue(_0x233ce4){this['id']=_0x233ce4['id']||0x0;this['name']=_0x233ce4['name']||'';this[_0x841c('0xa')]=_0x233ce4['monitor_format']||'';this[_0x841c('0xb')]=_0x233ce4[_0x841c('0xb')]||'inbound';this[_0x841c('0xc')]=0x0;this[_0x841c('0xd')]=0x0;this['total']=0x0;this[_0x841c('0xe')]=0x0;this[_0x841c('0xf')]=0x0;this[_0x841c('0x10')]=0x0;this[_0x841c('0x11')]=0x0;this[_0x841c('0x12')]=0x0;this['abandoned']=0x0;this[_0x841c('0x13')]=0x0;this[_0x841c('0x14')]=0x0;this['acw']=_0x233ce4['acw']||![];this[_0x841c('0x15')]=_0x233ce4[_0x841c('0x15')]||0xa;this[_0x841c('0x16')]=_0x233ce4['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x841c('0x17')]='';this[_0x841c('0x18')]=0x0;this[_0x841c('0x19')]=0x0;this[_0x841c('0x1a')]=_0x233ce4[_0x841c('0x1a')]||null;this['dialGlobalInterval']=_0x233ce4[_0x841c('0x1b')]?_0x233ce4[_0x841c('0x1b')]:null;this['dialActive']=_0x233ce4[_0x841c('0x1c')];this[_0x841c('0x1d')]=_0x233ce4[_0x841c('0x1d')]||_0x841c('0x1e');this[_0x841c('0x1f')]=_0x233ce4[_0x841c('0x1f')]||0x0;this[_0x841c('0x20')]=_0x233ce4['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x233ce4[_0x841c('0x21')]||0x1;this[_0x841c('0x22')]=_0x233ce4[_0x841c('0x22')]||_0x841c('0x23');this[_0x841c('0x24')]=_0x233ce4[_0x841c('0x24')]||0.03;this['dialPredictiveInterval']=_0x233ce4['dialPredictiveInterval']||0x258;this[_0x841c('0x25')]=_0x233ce4['dialOriginateCallerIdName']||_0x841c('0x26');this[_0x841c('0x27')]=_0x233ce4[_0x841c('0x27')]||'anonymous';this['dialOriginateTimeout']=_0x233ce4[_0x841c('0x28')]||0x1e;this[_0x841c('0x29')]=_0x233ce4[_0x841c('0x29')]||_0x841c('0x2a');this['dialQueueTimeout']=_0x233ce4[_0x841c('0x2b')]||0x3;this[_0x841c('0x2c')]=_0x233ce4['dialQueueProject']||undefined;this[_0x841c('0x2d')]=_0x233ce4[_0x841c('0x2d')]||0x3;this[_0x841c('0x2e')]=_0x233ce4[_0x841c('0x2e')]||0x96;this[_0x841c('0x2f')]=_0x233ce4[_0x841c('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x233ce4['dialBusyRetryFrequency']||0x96;this[_0x841c('0x30')]=_0x233ce4['dialNoAnswerMaxRetry']||0x3;this[_0x841c('0x31')]=_0x233ce4[_0x841c('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x233ce4['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x233ce4[_0x841c('0x32')]||0x96;this[_0x841c('0x33')]=_0x233ce4[_0x841c('0x33')]||0x3;this[_0x841c('0x34')]=_0x233ce4[_0x841c('0x34')]||0x96;this[_0x841c('0x35')]=_0x233ce4[_0x841c('0x35')]||0x3;this[_0x841c('0x36')]=_0x233ce4['dialAbandonedRetryFrequency']||0x96;this[_0x841c('0x37')]=_0x233ce4[_0x841c('0x37')]||0x3;this[_0x841c('0x38')]=_0x233ce4['dialMachineRetryFrequency']||0x96;this[_0x841c('0x39')]=_0x233ce4['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x233ce4[_0x841c('0x3a')]||0x96;this[_0x841c('0x3b')]=_0x233ce4[_0x841c('0x3b')]||0x3;this[_0x841c('0x3c')]=_0x233ce4[_0x841c('0x3c')]||0x4;this[_0x841c('0x3d')]=_0x233ce4['Trunk']?_0x233ce4[_0x841c('0x3d')]:undefined;this[_0x841c('0x3e')]=_0x233ce4[_0x841c('0x3e')]?_0x233ce4[_0x841c('0x3e')]:undefined;this[_0x841c('0x3f')]=_0x233ce4[_0x841c('0x3f')]||undefined;this[_0x841c('0x40')]=_0x233ce4[_0x841c('0x40')]?_0x233ce4[_0x841c('0x40')]:undefined;this['dialOrderByScheduledAt']=_0x233ce4[_0x841c('0x41')]||_0x841c('0x42');this[_0x841c('0x43')]=_0x233ce4[_0x841c('0x43')]||undefined;this[_0x841c('0x44')]=_0x233ce4[_0x841c('0x44')]||undefined;this[_0x841c('0x45')]=strategy[_0x233ce4[_0x841c('0x45')]]||_0x841c('0x8');this[_0x841c('0x46')]=!![];this[_0x841c('0x47')]=_0x233ce4[_0x841c('0x47')]||![];this[_0x841c('0x48')]=_0x233ce4[_0x841c('0x48')];this[_0x841c('0x49')]=_0x233ce4['dialAMDGreeting'];this[_0x841c('0x4a')]=_0x233ce4[_0x841c('0x4a')];this['dialAMDTotalAnalysisTime']=_0x233ce4[_0x841c('0x4b')];this[_0x841c('0x4c')]=_0x233ce4['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x233ce4[_0x841c('0x4d')];this[_0x841c('0x4e')]=_0x233ce4[_0x841c('0x4e')];this['dialAMDSilenceThreshold']=_0x233ce4[_0x841c('0x4f')];this[_0x841c('0x50')]=_0x233ce4[_0x841c('0x50')];this[_0x841c('0x51')]=0x0;this['pTalking']=0x0;this['timeout']=_0x233ce4[_0x841c('0x52')];this[_0x841c('0x53')]=0x0;this[_0x841c('0x54')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x841c('0x55')]=0x0;this[_0x841c('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x841c('0x57')]=0x0;this[_0x841c('0x58')]=0x0;this[_0x841c('0x59')]=0x0;this[_0x841c('0x5a')]=0x0;this[_0x841c('0x5b')]=0x0;this[_0x841c('0x5c')]=0x0;this['outboundReCallsDay']=0x0;this[_0x841c('0x5d')]=0x0;this[_0x841c('0x5e')]=undefined;this[_0x841c('0x5f')]=undefined;this[_0x841c('0x60')]=undefined;this[_0x841c('0x61')]=1.05;this[_0x841c('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x841c('0x63')]=0x0;this[_0x841c('0x64')]=0x0;this[_0x841c('0x65')]=0x0;this[_0x841c('0x66')]=0x0;this[_0x841c('0x67')]=0x0;this[_0x841c('0x68')]=0x0;this[_0x841c('0x69')]=_0x233ce4[_0x841c('0x6a')]||0x14;this[_0x841c('0x6b')]=_0x233ce4[_0x841c('0x6a')]||0xa;this[_0x841c('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x841c('0x6d')]=0x1;this[_0x841c('0x6e')]=0x0;this[_0x841c('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x841c('0x70')]=0x0;this['dialRecallMeTimeout']=_0x233ce4[_0x841c('0x71')]||0x1e;this['dialRecallInQueue']=_0x233ce4[_0x841c('0x72')]||![];this[_0x841c('0x73')]=!!_0x233ce4[_0x841c('0x73')]||![];this[_0x841c('0x74')]=!!_0x233ce4['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x233ce4[_0x841c('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x233ce4[_0x841c('0x76')]||![];this['dialAgiAfterHangupAgent']=_0x233ce4['dialAgiAfterHangupAgent']||![];this[_0x841c('0xa')]=monitorFormat[_0x233ce4['monitor_format']]?monitorFormat[_0x233ce4[_0x841c('0xa')]]:undefined;this[_0x841c('0x77')]=_0x233ce4['mandatoryDisposition']||![];this[_0x841c('0x78')]=_0x233ce4[_0x841c('0x78')]?_0x233ce4[_0x841c('0x78')]:undefined;}module[_0x841c('0x79')]=VoiceQueue; \ No newline at end of file +var _0xdac1=['wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','exports','unknown','not_inuse','inuse','invalid','ringinuse','onhold'];(function(_0xe116d2,_0x2a6d46){var _0x3e4d69=function(_0x259744){while(--_0x259744){_0xe116d2['push'](_0xe116d2['shift']());}};_0x3e4d69(++_0x2a6d46);}(_0xdac1,0x1ce));var _0x1dac=function(_0x3647ce,_0x30febf){_0x3647ce=_0x3647ce-0x0;var _0x17397e=_0xdac1[_0x3647ce];return _0x17397e;};'use strict';var statusDesc=[_0x1dac('0x0'),_0x1dac('0x1'),_0x1dac('0x2'),'busy',_0x1dac('0x3'),'unavailable','ringing',_0x1dac('0x4'),_0x1dac('0x5')];var monitorFormat={'wav':_0x1dac('0x6'),'wav49':'wav49','gsm':_0x1dac('0x7')};var strategy={'rrmemory':_0x1dac('0x8'),'roundrobin':_0x1dac('0x9')};function VoiceQueue(_0x45b02f){this['id']=_0x45b02f['id']||0x0;this[_0x1dac('0xa')]=_0x45b02f['name']||'';this['monitor_format']=_0x45b02f[_0x1dac('0xb')]||'';this[_0x1dac('0xc')]=_0x45b02f[_0x1dac('0xc')]||_0x1dac('0xd');this['waiting']=0x0;this['talking']=0x0;this['total']=0x0;this[_0x1dac('0xe')]=0x0;this[_0x1dac('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0x1dac('0x10')]=0x0;this[_0x1dac('0x11')]=0x0;this[_0x1dac('0x12')]=0x0;this[_0x1dac('0x13')]=0x0;this[_0x1dac('0x14')]=0x0;this[_0x1dac('0x15')]=_0x45b02f[_0x1dac('0x15')]||![];this[_0x1dac('0x16')]=_0x45b02f['acwTimeout']||0xa;this[_0x1dac('0x17')]=_0x45b02f[_0x1dac('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0x1dac('0x18')]='';this[_0x1dac('0x19')]=0x0;this[_0x1dac('0x1a')]=0x0;this[_0x1dac('0x1b')]=_0x45b02f['dialTimezone']||null;this[_0x1dac('0x1c')]=_0x45b02f['dialGlobalInterval']?_0x45b02f['dialGlobalInterval']:null;this['dialActive']=_0x45b02f['dialActive'];this['dialMethod']=_0x45b02f['dialMethod']||_0x1dac('0x1d');this[_0x1dac('0x1e')]=_0x45b02f['dialLimitChannel']||0x0;this[_0x1dac('0x1f')]=_0x45b02f[_0x1dac('0x1f')]||0x0;this['dialPowerLevel']=_0x45b02f[_0x1dac('0x20')]||0x1;this[_0x1dac('0x21')]=_0x45b02f['dialPredictiveOptimization']||_0x1dac('0x22');this[_0x1dac('0x23')]=_0x45b02f[_0x1dac('0x23')]||0.03;this[_0x1dac('0x24')]=_0x45b02f[_0x1dac('0x24')]||0x258;this[_0x1dac('0x25')]=_0x45b02f[_0x1dac('0x25')]||_0x1dac('0x26');this['dialOriginateCallerIdNumber']=_0x45b02f[_0x1dac('0x27')]||_0x1dac('0x26');this['dialOriginateTimeout']=_0x45b02f[_0x1dac('0x28')]||0x1e;this['dialQueueOptions']=_0x45b02f[_0x1dac('0x29')]||_0x1dac('0x2a');this[_0x1dac('0x2b')]=_0x45b02f[_0x1dac('0x2b')]||0x3;this[_0x1dac('0x2c')]=_0x45b02f[_0x1dac('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x45b02f['dialCongestionMaxRetry']||0x3;this[_0x1dac('0x2d')]=_0x45b02f[_0x1dac('0x2d')]||0x96;this[_0x1dac('0x2e')]=_0x45b02f[_0x1dac('0x2e')]||0x3;this[_0x1dac('0x2f')]=_0x45b02f[_0x1dac('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x45b02f[_0x1dac('0x30')]||0x3;this[_0x1dac('0x31')]=_0x45b02f[_0x1dac('0x31')]||0x96;this[_0x1dac('0x32')]=_0x45b02f[_0x1dac('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x45b02f[_0x1dac('0x33')]||0x96;this[_0x1dac('0x34')]=_0x45b02f[_0x1dac('0x34')]||0x3;this[_0x1dac('0x35')]=_0x45b02f[_0x1dac('0x35')]||0x96;this[_0x1dac('0x36')]=_0x45b02f[_0x1dac('0x36')]||0x3;this[_0x1dac('0x37')]=_0x45b02f[_0x1dac('0x37')]||0x96;this['dialMachineMaxRetry']=_0x45b02f['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x45b02f[_0x1dac('0x38')]||0x96;this[_0x1dac('0x39')]=_0x45b02f[_0x1dac('0x39')]||0x3;this[_0x1dac('0x3a')]=_0x45b02f[_0x1dac('0x3a')]||0x96;this[_0x1dac('0x3b')]=_0x45b02f['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x45b02f['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x45b02f[_0x1dac('0x3c')]?_0x45b02f[_0x1dac('0x3c')]:undefined;this[_0x1dac('0x3d')]=_0x45b02f[_0x1dac('0x3d')]?_0x45b02f[_0x1dac('0x3d')]:undefined;this[_0x1dac('0x3e')]=_0x45b02f[_0x1dac('0x3e')]||undefined;this[_0x1dac('0x3f')]=_0x45b02f['Interval']?_0x45b02f['Interval']:undefined;this['dialOrderByScheduledAt']=_0x45b02f[_0x1dac('0x40')]||_0x1dac('0x41');this[_0x1dac('0x42')]=_0x45b02f[_0x1dac('0x42')]||undefined;this[_0x1dac('0x43')]=_0x45b02f['dialCutDigit']||undefined;this[_0x1dac('0x44')]=strategy[_0x45b02f['strategy']]||_0x1dac('0x8');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x45b02f[_0x1dac('0x45')]||![];this['dialAMDInitialSilence']=_0x45b02f[_0x1dac('0x46')];this['dialAMDGreeting']=_0x45b02f[_0x1dac('0x47')];this[_0x1dac('0x48')]=_0x45b02f['dialAMDAfterGreetingSilence'];this[_0x1dac('0x49')]=_0x45b02f[_0x1dac('0x49')];this[_0x1dac('0x4a')]=_0x45b02f['dialAMDMinWordLength'];this[_0x1dac('0x4b')]=_0x45b02f[_0x1dac('0x4b')];this[_0x1dac('0x4c')]=_0x45b02f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x45b02f['dialAMDSilenceThreshold'];this[_0x1dac('0x4d')]=_0x45b02f[_0x1dac('0x4d')];this['outboundRejectCallsDay']=0x0;this[_0x1dac('0x4e')]=0x0;this['timeout']=_0x45b02f[_0x1dac('0x4f')];this[_0x1dac('0x50')]=0x0;this[_0x1dac('0x51')]=0x0;this[_0x1dac('0x52')]=0x0;this[_0x1dac('0x53')]=0x0;this[_0x1dac('0x54')]=0x0;this[_0x1dac('0x55')]=0x0;this[_0x1dac('0x56')]=0x0;this[_0x1dac('0x57')]=0x0;this[_0x1dac('0x58')]=0x0;this[_0x1dac('0x59')]=0x0;this[_0x1dac('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x1dac('0x5b')]=0x0;this[_0x1dac('0x5c')]=0x0;this[_0x1dac('0x5d')]=undefined;this[_0x1dac('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x1dac('0x5f')]=1.05;this[_0x1dac('0x60')]=0x0;this[_0x1dac('0x61')]=0x0;this[_0x1dac('0x62')]=0x0;this[_0x1dac('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x1dac('0x64')]=_0x45b02f['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x1dac('0x65')]=_0x45b02f['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x1dac('0x66')]=0x0;this[_0x1dac('0x67')]=0x0;this[_0x1dac('0x68')]=0x1;this[_0x1dac('0x69')]=0x0;this[_0x1dac('0x6a')]=0x0;this[_0x1dac('0x6b')]=0x0;this[_0x1dac('0x6c')]=0x0;this[_0x1dac('0x6d')]=_0x45b02f[_0x1dac('0x6d')]||0x1e;this[_0x1dac('0x6e')]=_0x45b02f['dialRecallInQueue']||![];this[_0x1dac('0x6f')]=!!_0x45b02f[_0x1dac('0x6f')]||![];this[_0x1dac('0x70')]=!!_0x45b02f[_0x1dac('0x70')]||![];this[_0x1dac('0x71')]=_0x45b02f[_0x1dac('0x71')]||undefined;this[_0x1dac('0x72')]=_0x45b02f['dialAgiAfterHangupClient']||![];this[_0x1dac('0x73')]=_0x45b02f[_0x1dac('0x73')]||![];this[_0x1dac('0xb')]=monitorFormat[_0x45b02f[_0x1dac('0xb')]]?monitorFormat[_0x45b02f['monitor_format']]:undefined;this['mandatoryDisposition']=_0x45b02f['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x45b02f['mandatoryDispositionPause']?_0x45b02f['mandatoryDispositionPause']:undefined;}module[_0x1dac('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 955a440..7efc596 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 _0x6b6e=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x195ea8,_0x3abf24){var _0x4599aa=function(_0x32af5d){while(--_0x32af5d){_0x195ea8['push'](_0x195ea8['shift']());}};_0x4599aa(++_0x3abf24);}(_0x6b6e,0x100));var _0xe6b6=function(_0x24acb0,_0x5bdfbf){_0x24acb0=_0x24acb0-0x0;var _0x23bd09=_0x6b6e[_0x24acb0];return _0x23bd09;};'use strict';function VtigerAccount(_0xbd34de){this['id']=_0xbd34de['id']||0x0;this[_0xe6b6('0x0')]=_0xbd34de[_0xe6b6('0x0')]||'';this[_0xe6b6('0x1')]=_0xbd34de[_0xe6b6('0x1')]||'';this[_0xe6b6('0x2')]=_0xbd34de[_0xe6b6('0x2')]||'';this[_0xe6b6('0x3')]=_0xbd34de[_0xe6b6('0x3')]||'';this[_0xe6b6('0x4')]=_0xbd34de[_0xe6b6('0x4')]||'';this['Configurations']=_0xbd34de[_0xe6b6('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xc122=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x1f809e,_0x1040bb){var _0x4f96ab=function(_0x2611f7){while(--_0x2611f7){_0x1f809e['push'](_0x1f809e['shift']());}};_0x4f96ab(++_0x1040bb);}(_0xc122,0x1cf));var _0x2c12=function(_0x9606be,_0x2dcfff){_0x9606be=_0x9606be-0x0;var _0x4be344=_0xc122[_0x9606be];return _0x4be344;};'use strict';function VtigerAccount(_0x4dac9e){this['id']=_0x4dac9e['id']||0x0;this[_0x2c12('0x0')]=_0x4dac9e[_0x2c12('0x0')]||'';this['username']=_0x4dac9e[_0x2c12('0x1')]||'';this[_0x2c12('0x2')]=_0x4dac9e[_0x2c12('0x2')]||'';this[_0x2c12('0x3')]=_0x4dac9e[_0x2c12('0x3')]||'';this[_0x2c12('0x4')]=_0x4dac9e[_0x2c12('0x4')]||'';this[_0x2c12('0x5')]=_0x4dac9e[_0x2c12('0x5')]||{};}module[_0x2c12('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 0fbd5dc..5ba10ff 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 _0xe015=['type','integrationTab','serverUrl','name','username','password','token','remoteUri'];(function(_0x53ad5f,_0x165793){var _0x61e1da=function(_0x5d51a1){while(--_0x5d51a1){_0x53ad5f['push'](_0x53ad5f['shift']());}};_0x61e1da(++_0x165793);}(_0xe015,0x17b));var _0x5e01=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe015[_0x21a9d9];return _0x46adce;};'use strict';function ZendeskAccount(_0x11e142){this['id']=_0x11e142['id']||0x0;this[_0x5e01('0x0')]=_0x11e142['name']||'';this[_0x5e01('0x1')]=_0x11e142[_0x5e01('0x1')]||'';this[_0x5e01('0x2')]=_0x11e142['password']||'';this[_0x5e01('0x3')]=_0x11e142[_0x5e01('0x3')]||'';this[_0x5e01('0x4')]=_0x11e142[_0x5e01('0x4')]||'';this['authType']=_0x11e142['authType']||'';this['type']=_0x11e142[_0x5e01('0x5')]||_0x5e01('0x6');this['serverUrl']=_0x11e142[_0x5e01('0x7')]||'';this['Configurations']=_0x11e142['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xea0a=['remoteUri','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x4cce67,_0x219de4){var _0x453e03=function(_0x2f99d2){while(--_0x2f99d2){_0x4cce67['push'](_0x4cce67['shift']());}};_0x453e03(++_0x219de4);}(_0xea0a,0x128));var _0xaea0=function(_0x42d825,_0x1045d0){_0x42d825=_0x42d825-0x0;var _0x417c63=_0xea0a[_0x42d825];return _0x417c63;};'use strict';function ZendeskAccount(_0x69efa0){this['id']=_0x69efa0['id']||0x0;this[_0xaea0('0x0')]=_0x69efa0[_0xaea0('0x0')]||'';this[_0xaea0('0x1')]=_0x69efa0[_0xaea0('0x1')]||'';this['password']=_0x69efa0[_0xaea0('0x2')]||'';this[_0xaea0('0x3')]=_0x69efa0[_0xaea0('0x3')]||'';this[_0xaea0('0x4')]=_0x69efa0['remoteUri']||'';this['authType']=_0x69efa0['authType']||'';this['type']=_0x69efa0[_0xaea0('0x5')]||_0xaea0('0x6');this[_0xaea0('0x7')]=_0x69efa0[_0xaea0('0x7')]||'';this['Configurations']=_0x69efa0[_0xaea0('0x8')]||{};}module[_0xaea0('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index d0c0da8..aa6bd2b 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 _0x5066=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x250c5d,_0x57f696){var _0x52ae60=function(_0x1718c1){while(--_0x1718c1){_0x250c5d['push'](_0x250c5d['shift']());}};_0x52ae60(++_0x57f696);}(_0x5066,0x76));var _0x6506=function(_0x458edc,_0x9baf98){_0x458edc=_0x458edc-0x0;var _0x44af29=_0x5066[_0x458edc];return _0x44af29;};'use strict';function ZohoAccount(_0x3430e3){this['id']=_0x3430e3['id']||0x0;this[_0x6506('0x0')]=_0x3430e3[_0x6506('0x0')]||'';this[_0x6506('0x1')]=_0x3430e3['description']||'';this[_0x6506('0x2')]=_0x3430e3[_0x6506('0x2')]||'';this[_0x6506('0x3')]=_0x3430e3['zone']||'';this['clientId']=_0x3430e3[_0x6506('0x4')]||'';this[_0x6506('0x5')]=_0x3430e3['clientSecret']||'';this[_0x6506('0x6')]=_0x3430e3['serverUrl']||'';this[_0x6506('0x7')]=_0x3430e3[_0x6506('0x7')]||'';this[_0x6506('0x8')]=_0x3430e3[_0x6506('0x8')]||'';this[_0x6506('0x9')]=_0x3430e3[_0x6506('0x9')]||{};}module[_0x6506('0xa')]=ZohoAccount; \ No newline at end of file +var _0x3861=['name','description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x5a4cd2,_0x15cd81){var _0x4e7207=function(_0x2cdce4){while(--_0x2cdce4){_0x5a4cd2['push'](_0x5a4cd2['shift']());}};_0x4e7207(++_0x15cd81);}(_0x3861,0xdc));var _0x1386=function(_0x153eb6,_0x149a99){_0x153eb6=_0x153eb6-0x0;var _0x4a636c=_0x3861[_0x153eb6];return _0x4a636c;};'use strict';function ZohoAccount(_0x2c3159){this['id']=_0x2c3159['id']||0x0;this[_0x1386('0x0')]=_0x2c3159[_0x1386('0x0')]||'';this['description']=_0x2c3159[_0x1386('0x1')]||'';this['host']=_0x2c3159[_0x1386('0x2')]||'';this[_0x1386('0x3')]=_0x2c3159[_0x1386('0x3')]||'';this[_0x1386('0x4')]=_0x2c3159[_0x1386('0x4')]||'';this['clientSecret']=_0x2c3159['clientSecret']||'';this[_0x1386('0x5')]=_0x2c3159[_0x1386('0x5')]||'';this[_0x1386('0x6')]=_0x2c3159['code']||'';this[_0x1386('0x7')]=_0x2c3159[_0x1386('0x7')]||'';this[_0x1386('0x8')]=_0x2c3159[_0x1386('0x8')]||{};}module[_0x1386('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index cac425e..1793568 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 _0x1399=['type','queue','dialAnswer','Agent','name','channelAgent','membername','calleridname','phone','Contact','firstName','active','scheduledat','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact'];(function(_0x469f6a,_0x256589){var _0x4901f9=function(_0x184d38){while(--_0x184d38){_0x469f6a['push'](_0x469f6a['shift']());}};_0x4901f9(++_0x256589);}(_0x1399,0x16c));var _0x9139=function(_0x576e92,_0x165314){_0x576e92=_0x576e92-0x0;var _0x24c32e=_0x1399[_0x576e92];return _0x24c32e;};'use strict';var util=require(_0x9139('0x0'));var _=require(_0x9139('0x1'));var moment=require('moment');function checkNameSurname(_0x474911,_0x4f01ae,_0x10c98f){var _0x8bba08='';if(!_[_0x9139('0x2')](_0x4f01ae)&&_0x9139('0x3')===typeof _0x4f01ae){_0x8bba08+=_0x4f01ae;}if(!_[_0x9139('0x2')](_0x10c98f)&&_0x9139('0x3')===typeof _0x10c98f){_0x8bba08+='\x20'+_0x10c98f;}if(_0x8bba08!==''){return _0x8bba08;}return _0x474911;}function Action(_0x5ac80b,_0x54af2d,_0x8f086b,_0x11d2ed,_0x4d5d1e){this['uniqueid']=_0x8f086b||undefined;this[_0x9139('0x4')]=_0x5ac80b['id'];this['queue']=_0x54af2d['name'];this[_0x9139('0x5')]=_0x54af2d[_0x9139('0x5')];this['campaigntype']=_0x9139('0x6');this[_0x9139('0x7')]=![];this['membername']=_['isNil'](_0x5ac80b[_0x9139('0x8')])?undefined:_0x5ac80b[_0x9139('0x8')][_0x9139('0x9')];this[_0x9139('0xa')]=this[_0x9139('0xb')]?util['format']('SIP/%s',this['membername']):_0x11d2ed||undefined;this[_0x9139('0xc')]=checkNameSurname(_0x5ac80b['Contact'][_0x9139('0xd')],_0x5ac80b[_0x9139('0xe')][_0x9139('0xf')],_0x5ac80b[_0x9139('0xe')]['lastName']);this[_0x9139('0x10')]=_0x5ac80b['active']||![];this['calleridnum']=_0x5ac80b['phone'];this[_0x9139('0x11')]=_0x5ac80b[_0x9139('0x11')];this[_0x9139('0x12')]=_0x5ac80b[_0x9139('0x12')]||0x0;this[_0x9139('0x13')]=_0x5ac80b[_0x9139('0x13')]||0x0;this['countnoanswerretry']=_0x5ac80b['countnoanswerretry']||0x0;this[_0x9139('0x14')]=(_0x5ac80b[_0x9139('0x12')]||0x0)+(_0x5ac80b['countcongestionretry']||0x0)+(_0x5ac80b['countnoanswerretry']||0x0)+(_0x5ac80b[_0x9139('0x15')]||0x0)+(_0x5ac80b[_0x9139('0x16')]||0x0)+(_0x5ac80b['countabandonedretry']||0x0)+(_0x5ac80b[_0x9139('0x17')]||0x0)+(_0x5ac80b[_0x9139('0x18')]||0x0);this[_0x9139('0x15')]=_0x5ac80b[_0x9139('0x15')]||0x0;this[_0x9139('0x16')]=_0x5ac80b[_0x9139('0x16')]||0x0;this[_0x9139('0x19')]=_0x5ac80b[_0x9139('0x19')]||0x0;this[_0x9139('0x17')]=_0x5ac80b[_0x9139('0x17')]||0x0;this[_0x9139('0x18')]=_0x5ac80b[_0x9139('0x18')]||0x0;this[_0x9139('0x1a')]=_0x5ac80b[_0x9139('0x1a')];this[_0x9139('0x1b')]=_0x5ac80b[_0x9139('0x1b')];this[_0x9139('0x1c')]=_0x5ac80b[_0x9139('0x1c')];this[_0x9139('0x1d')]=_0x5ac80b['recallme'];this[_0x9139('0x1e')]=_0x5ac80b[_0x9139('0x1e')];this['ListId']=_0x5ac80b[_0x9139('0x1f')];this[_0x9139('0x20')]=_[_0x9139('0x2')](_0x5ac80b['Agent'])?_0x5ac80b[_0x9139('0x20')]:_0x5ac80b[_0x9139('0x8')]['id'];this['VoiceQueueId']=_0x5ac80b[_0x9139('0x21')];this[_0x9139('0x22')]='';this[_0x9139('0x23')]='';}Action['prototype'][_0x9139('0x24')]=function(){return util[_0x9139('0x25')](_0x9139('0x26'),this[_0x9139('0xc')],this[_0x9139('0x27')]);};module[_0x9139('0x28')]=Action; \ No newline at end of file +var _0x2da6=['queue','type','campaigntype','membername','Agent','name','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x2c7900,_0x44f3b6){var _0x35c02f=function(_0x343749){while(--_0x343749){_0x2c7900['push'](_0x2c7900['shift']());}};_0x35c02f(++_0x44f3b6);}(_0x2da6,0x1dd));var _0x62da=function(_0x5e75f2,_0x32c033){_0x5e75f2=_0x5e75f2-0x0;var _0x526f38=_0x2da6[_0x5e75f2];return _0x526f38;};'use strict';var util=require(_0x62da('0x0'));var _=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));function checkNameSurname(_0xbbb39b,_0xd62c5c,_0x12b8ad){var _0x19081e='';if(!_[_0x62da('0x3')](_0xd62c5c)&&'string'===typeof _0xd62c5c){_0x19081e+=_0xd62c5c;}if(!_['isNil'](_0x12b8ad)&&_0x62da('0x4')===typeof _0x12b8ad){_0x19081e+='\x20'+_0x12b8ad;}if(_0x19081e!==''){return _0x19081e;}return _0xbbb39b;}function Action(_0x3163df,_0x3a59f8,_0x30437f,_0x100e73,_0x9d9139){this[_0x62da('0x5')]=_0x30437f||undefined;this[_0x62da('0x6')]=_0x3163df['id'];this[_0x62da('0x7')]=_0x3a59f8['name'];this[_0x62da('0x8')]=_0x3a59f8[_0x62da('0x8')];this[_0x62da('0x9')]=_0x62da('0x7');this['dialAnswer']=![];this[_0x62da('0xa')]=_[_0x62da('0x3')](_0x3163df[_0x62da('0xb')])?undefined:_0x3163df[_0x62da('0xb')][_0x62da('0xc')];this['channelAgent']=this[_0x62da('0xa')]?util[_0x62da('0xd')](_0x62da('0xe'),this[_0x62da('0xa')]):_0x100e73||undefined;this[_0x62da('0xf')]=checkNameSurname(_0x3163df['Contact']['phone'],_0x3163df[_0x62da('0x10')][_0x62da('0x11')],_0x3163df[_0x62da('0x10')][_0x62da('0x12')]);this[_0x62da('0x13')]=_0x3163df[_0x62da('0x13')]||![];this[_0x62da('0x14')]=_0x3163df[_0x62da('0x15')];this[_0x62da('0x16')]=_0x3163df[_0x62da('0x16')];this[_0x62da('0x17')]=_0x3163df[_0x62da('0x17')]||0x0;this[_0x62da('0x18')]=_0x3163df[_0x62da('0x18')]||0x0;this['countnoanswerretry']=_0x3163df['countnoanswerretry']||0x0;this[_0x62da('0x19')]=(_0x3163df['countbusyretry']||0x0)+(_0x3163df[_0x62da('0x18')]||0x0)+(_0x3163df[_0x62da('0x1a')]||0x0)+(_0x3163df[_0x62da('0x1b')]||0x0)+(_0x3163df['countdropretry']||0x0)+(_0x3163df[_0x62da('0x1c')]||0x0)+(_0x3163df['countmachineretry']||0x0)+(_0x3163df[_0x62da('0x1d')]||0x0);this[_0x62da('0x1b')]=_0x3163df[_0x62da('0x1b')]||0x0;this[_0x62da('0x1e')]=_0x3163df[_0x62da('0x1e')]||0x0;this[_0x62da('0x1c')]=_0x3163df[_0x62da('0x1c')]||0x0;this[_0x62da('0x1f')]=_0x3163df[_0x62da('0x1f')]||0x0;this['countagentrejectretry']=_0x3163df[_0x62da('0x1d')]||0x0;this[_0x62da('0x20')]=_0x3163df[_0x62da('0x20')];this[_0x62da('0x21')]=_0x3163df[_0x62da('0x21')];this[_0x62da('0x22')]=_0x3163df[_0x62da('0x22')];this['recallme']=_0x3163df['recallme'];this['ContactId']=_0x3163df[_0x62da('0x23')];this[_0x62da('0x24')]=_0x3163df[_0x62da('0x24')];this[_0x62da('0x25')]=_['isNil'](_0x3163df[_0x62da('0xb')])?_0x3163df[_0x62da('0x25')]:_0x3163df['Agent']['id'];this[_0x62da('0x26')]=_0x3163df[_0x62da('0x26')];this[_0x62da('0x27')]='';this['originatecalleridname']='';}Action[_0x62da('0x28')][_0x62da('0x29')]=function(){return util[_0x62da('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x62da('0x2a')]);};module[_0x62da('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index d2c593d..f2721d2 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 _0xbefd=['dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','Answer','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','BUSY','countbusyretry','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','idContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','amd','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','active','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variables','variablesAction','OriginateError','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','filterKey','keys','variable','error','transfertargetlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','enqueue','tail','finally','sequence','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','\x20is\x20not\x20active','DEACTIVATED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','syncCampaigns','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','size','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbefd,0xaf));var _0xdbef=function(_0x46da42,_0x5f5738){_0x46da42=_0x46da42-0x0;var _0x465ff6=_0xbefd[_0x46da42];return _0x465ff6;};'use strict';var util=require(_0xdbef('0x0'));var _=require(_0xdbef('0x1'));var uuid=require(_0xdbef('0x2'));var moment=require(_0xdbef('0x3'));var md5=require(_0xdbef('0x4'));var Redis=require(_0xdbef('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xdbef('0x6'));var loggerAction=require(_0xdbef('0x7'))(_0xdbef('0x8'));var ami=require(_0xdbef('0x9'));var rpcDb=require(_0xdbef('0xa'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xdbef('0xb'));var ut=require(_0xdbef('0xc'));config['redis']=_[_0xdbef('0xd')](config[_0xdbef('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdbef('0xe')]));var Sequence=function(){};Sequence['prototype'][_0xdbef('0xf')]=function(_0x43f2b7){this[_0xdbef('0x10')]=this['tail']?this[_0xdbef('0x10')][_0xdbef('0x11')](_0x43f2b7):_0x43f2b7();};function Preview(_0x3d17f5){this[_0xdbef('0x12')]=new Sequence();this['campaignsPreview']=_0x3d17f5['voiceQueues'];this[_0xdbef('0x13')]=_0x3d17f5[_0xdbef('0x13')];this[_0xdbef('0x14')]={};this[_0xdbef('0x15')]=_0x3d17f5[_0xdbef('0x15')];this[_0xdbef('0x16')]=0x0;ami['on'](_0xdbef('0x17'),this[_0xdbef('0x18')][_0xdbef('0x19')](this));ami['on'](_0xdbef('0x1a'),this[_0xdbef('0x1b')]['bind'](this));ami['on']('hanguprequest',this[_0xdbef('0x1c')]['bind'](this));ami['on']('dialend',this[_0xdbef('0x1d')]['bind'](this));ami['on']('newexten',this[_0xdbef('0x1e')][_0xdbef('0x19')](this));ami['on'](_0xdbef('0x1f'),this[_0xdbef('0x20')][_0xdbef('0x19')](this));ami['on'](_0xdbef('0x21'),this[_0xdbef('0x22')][_0xdbef('0x19')](this));ami['on']('blindtransfer',this[_0xdbef('0x23')][_0xdbef('0x19')](this));this[_0xdbef('0x24')](this[_0xdbef('0x25')]);}function emit(_0x24eb8e,_0xaafb50,_0x6b0193){io['to'](_0x24eb8e)[_0xdbef('0x26')](_0xaafb50,_0x6b0193);}function emitCampaignPreview(_0x2a1e9c){if(_0x2a1e9c[_0xdbef('0x27')]==='outbound'){var _0x252ef2={'id':_0x2a1e9c['id'],'name':_0x2a1e9c['name'],'strategy':_0x2a1e9c[_0xdbef('0x28')],'answered':_0x2a1e9c[_0xdbef('0x29')],'available':_0x2a1e9c['available'],'loggedIn':_0x2a1e9c[_0xdbef('0x2a')],'pTalking':_0x2a1e9c[_0xdbef('0x2b')],'sumBillable':_0x2a1e9c[_0xdbef('0x2c')],'sumDuration':_0x2a1e9c[_0xdbef('0x2d')],'sumHoldTime':_0x2a1e9c[_0xdbef('0x2e')]||0x0,'talking':_0x2a1e9c['talking'],'total':_0x2a1e9c[_0xdbef('0x2f')],'type':_0x2a1e9c[_0xdbef('0x27')],'unmanaged':_0x2a1e9c[_0xdbef('0x30')],'abandoned':_0x2a1e9c['abandoned'],'waiting':_0x2a1e9c[_0xdbef('0x31')],'loggedInDb':_0x2a1e9c[_0xdbef('0x32')],'dialActive':_0x2a1e9c[_0xdbef('0x33')],'dialMethod':_0x2a1e9c[_0xdbef('0x34')],'dialOriginateCallerIdName':_0x2a1e9c[_0xdbef('0x35')],'dialOriginateCallerIdNumber':_0x2a1e9c[_0xdbef('0x36')],'dialOriginateTimeout':_0x2a1e9c[_0xdbef('0x37')],'dialPrefix':_0x2a1e9c[_0xdbef('0x38')],'outboundAnswerAgiCallsDay':_0x2a1e9c[_0xdbef('0x39')],'outboundAnswerCallsDay':_0x2a1e9c['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2a1e9c[_0xdbef('0x3a')],'outboundBusyCallsDay':_0x2a1e9c[_0xdbef('0x3b')],'outboundCongestionCallsDay':_0x2a1e9c[_0xdbef('0x3c')],'outboundDropCallsDayACS':_0x2a1e9c[_0xdbef('0x3d')],'outboundDropCallsDayCallersExit':_0x2a1e9c['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2a1e9c[_0xdbef('0x3e')],'outboundNoAnswerCallsDay':_0x2a1e9c['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2a1e9c[_0xdbef('0x3f')],'outboundOriginateFailureCallsDay':_0x2a1e9c[_0xdbef('0x40')],'outboundReCallsDay':_0x2a1e9c[_0xdbef('0x41')],'outboundRejectCallsDay':_0x2a1e9c[_0xdbef('0x42')],'outboundUnknownCallsDay':_0x2a1e9c['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x2a1e9c[_0xdbef('0x43')],'predictiveIntervalAnsweredCalls':_0x2a1e9c[_0xdbef('0x44')],'predictiveIntervalAvgHoldtime':_0x2a1e9c['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2a1e9c[_0xdbef('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x2a1e9c[_0xdbef('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x2a1e9c[_0xdbef('0x47')],'predictiveIntervalErlangCalls':_0x2a1e9c[_0xdbef('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x2a1e9c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2a1e9c[_0xdbef('0x49')],'predictiveIntervalMultiplicativeFactor':_0x2a1e9c[_0xdbef('0x4a')],'predictiveIntervalPauses':_0x2a1e9c[_0xdbef('0x4b')],'predictiveIntervalAvailable':_0x2a1e9c[_0xdbef('0x4c')],'predictiveIntervalTotalCalls':_0x2a1e9c[_0xdbef('0x4d')],'message':_0x2a1e9c[_0xdbef('0x4e')],'originated':_0x2a1e9c[_0xdbef('0x4f')],'erlangCalls':_0x2a1e9c['erlangCalls'],'erlangCallToSecond':_0x2a1e9c[_0xdbef('0x50')],'erlangAbandonmentRate':_0x2a1e9c[_0xdbef('0x51')],'erlangBusyFactor':_0x2a1e9c[_0xdbef('0x52')],'startPredictive':_0x2a1e9c[_0xdbef('0x53')],'startProgressive':_0x2a1e9c[_0xdbef('0x54')]};if(_0x2a1e9c[_0xdbef('0x55')]){_0x252ef2['Trunk']={'id':_0x2a1e9c[_0xdbef('0x55')]['id'],'name':_0x2a1e9c['Trunk'][_0xdbef('0x56')],'active':_0x2a1e9c[_0xdbef('0x55')]['active'],'callerid':_0x2a1e9c['Trunk']['callerid']};}if(_0x2a1e9c[_0xdbef('0x57')]){_0x252ef2['Interval']={'id':_0x2a1e9c[_0xdbef('0x57')]['id'],'name':_0x2a1e9c[_0xdbef('0x57')][_0xdbef('0x56')]};}var _0xe5a93b=md5(JSON[_0xdbef('0x58')](_0x252ef2));if(_0x2a1e9c[_0xdbef('0x4')]!==_0xe5a93b){_0x2a1e9c['md5']=_0xe5a93b;emit(util[_0xdbef('0x59')](_0xdbef('0x5a'),_0x252ef2[_0xdbef('0x56')]),_0xdbef('0x5b'),_0x252ef2);}}}function emitVoiceQueueChannelRemove(_0x4b6f6b){logger['info'](_0xdbef('0x5c'),JSON['stringify'](_0x4b6f6b));emit(util[_0xdbef('0x59')](_0xdbef('0x5a'),_0x4b6f6b[_0xdbef('0x56')]),_0xdbef('0x5d'),_0x4b6f6b);io[_0xdbef('0x26')](_0xdbef('0x5e'),_0x4b6f6b);}function notSendMessagesQueue(_0x491bbb){if(_0x491bbb['sendMessageOneNotActive']){if(_0x491bbb['originated']===0x0&&_0x491bbb[_0xdbef('0x2b')]===0x0){_0x491bbb[_0xdbef('0x5f')]=![];_0x491bbb[_0xdbef('0x60')]=0x0;_0x491bbb[_0xdbef('0x61')]=0x0;_0x491bbb[_0xdbef('0x4e')]=_0xdbef('0x62');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x491bbb['name']+_0xdbef('0x63'));}else{_0x491bbb[_0xdbef('0x4e')]=_0xdbef('0x64');ut[_0xdbef('0x65')](_0xdbef('0x66'),_0x491bbb['name']+'\x20is\x20deactivated');}emitCampaignPreview(_0x491bbb);}}Preview[_0xdbef('0x67')][_0xdbef('0x24')]=function(){var _0xb2304c=this;setInterval(function(){_0xb2304c[_0xdbef('0x68')]();},0x7cf);};Preview[_0xdbef('0x67')]['syncCampaigns']=function(){var _0x436a72=this['campaignsPreview'];this[_0xdbef('0x16')]+=0x1;for(var _0x1b9816 in _0x436a72){if(_0x436a72[_0xdbef('0x69')](_0x1b9816)&&(_0x436a72[_0x1b9816][_0xdbef('0x34')]==='preview'||_0x436a72[_0x1b9816][_0xdbef('0x34')]===_0xdbef('0x6a'))&&_0x436a72[_0x1b9816]['type']===_0xdbef('0x6b')){if(this[_0xdbef('0x16')]>0x7){this[_0xdbef('0x16')]=0x0;this[_0xdbef('0x6c')]();}}if(_0x436a72['hasOwnProperty'](_0x1b9816)&&_0x436a72[_0x1b9816][_0xdbef('0x34')]===_0xdbef('0x6')&&_0x436a72[_0x1b9816][_0xdbef('0x27')]===_0xdbef('0x6b')){if(_0x436a72[_0x1b9816][_0xdbef('0x33')]){this[_0xdbef('0x6d')](_0x436a72[_0x1b9816]);if(_0x436a72[_0x1b9816][_0xdbef('0x6e')])this[_0xdbef('0x6f')](_0x436a72[_0x1b9816]);}else{notSendMessagesQueue(_0x436a72[_0x1b9816]);}}}};Preview[_0xdbef('0x67')][_0xdbef('0x70')]=function(_0x2ca706){var _0x3710d2=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x3710d2[_0xdbef('0x14')][_0x2ca706])){loggerAction['info'](_0xdbef('0x71'),_0x2ca706,_0xdbef('0x72'),_0x3710d2['actions'][_0x2ca706]['queue'],'originated:\x20',JSON[_0xdbef('0x58')](_0x3710d2[_0xdbef('0x25')][_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x73')]]['originated']),_0xdbef('0x74'),JSON['stringify'](_0x3710d2['campaignsPreview'][_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x73')]][_0xdbef('0x2b')]),JSON[_0xdbef('0x58')](_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x75')]),JSON['stringify'](_[_0xdbef('0x76')](_0x3710d2['actions'][_0x2ca706],[_0xdbef('0x77'),'UserId',_0xdbef('0x78'),_0xdbef('0x79')])));return ami[_0xdbef('0x7a')]({'action':_0xdbef('0x7b'),'channel':_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x7c')]})[_0xdbef('0x7d')](function(_0x450e56){if(_0x450e56['message']===_0xdbef('0x7e')){setTimeout(function(){if(_0x3710d2[_0xdbef('0x14')][_0x2ca706]){ut[_0xdbef('0x7f')](_0x3710d2[_0xdbef('0x25')][_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x73')]],'[clearZombieChannel]');if(_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x75')]===!![]){ut[_0xdbef('0x80')](_0x3710d2[_0xdbef('0x25')][_0x3710d2['actions'][_0x2ca706][_0xdbef('0x73')]],_0xdbef('0x81'));ut[_0xdbef('0x82')](_0xdbef('0x83')+_0x2ca706,_0x3710d2[_0xdbef('0x14')][_0x2ca706]['queue']);}ut['loggerError'](_0xdbef('0x84')+_0x2ca706,_0x3710d2[_0xdbef('0x14')][_0x2ca706][_0xdbef('0x73')]);delete _0x3710d2[_0xdbef('0x14')][_0x2ca706];}},0x2328);}});}});};Preview[_0xdbef('0x67')][_0xdbef('0x6c')]=function(){var _0x549880=this;loggerAction[_0xdbef('0x85')](_0xdbef('0x86'),_[_0xdbef('0x87')](this[_0xdbef('0x14')]));for(var _0x1c64a9 in this[_0xdbef('0x14')]){if(_0x549880[_0xdbef('0x14')][_0xdbef('0x69')](_0x1c64a9)){_0x549880[_0xdbef('0x70')](_0x1c64a9);}}};Preview['prototype'][_0xdbef('0x6f')]=function(_0x31d203){var _0x5254d7=this;rpcDb['getContactRecallMe'](_0x31d203['id'],ut[_0xdbef('0x88')](this[_0xdbef('0x15')]))[_0xdbef('0x89')](function(_0x5e703f){if(!_[_0xdbef('0x8a')](_0x5e703f)){for(var _0x29251e=0x0;_0x29251e<_0x5e703f[_0xdbef('0x8b')];_0x29251e+=0x1){if(ut[_0xdbef('0x8c')](_0x5e703f[_0x29251e][_0xdbef('0x8d')])<_0x31d203[_0xdbef('0x8e')]*0x3c){if(_0x5e703f[_0x29251e][_0xdbef('0x8f')]&&!_0x5e703f[_0x29251e][_0xdbef('0x8f')][_0xdbef('0x90')]){_0x5254d7[_0xdbef('0x91')](_0x5e703f[_0x29251e]['id'])[_0xdbef('0x89')](ut[_0xdbef('0x92')](_0xdbef('0x93')))[_0xdbef('0x7d')](ut['logger2'](_0xdbef('0x93')));}else{rpcDb[_0xdbef('0x94')](_0x5e703f[_0x29251e]['id']);}}else{var _0x19c2f8=new Action(_0x5e703f[_0x29251e],_0x31d203);_0x19c2f8[_0xdbef('0x95')]=moment()['format'](_0xdbef('0x96'));_0x31d203[_0xdbef('0x41')]+=0x1;ut[_0xdbef('0x97')](_0x19c2f8,0x17,'RecallInQueue');if(_0x31d203[_0xdbef('0x98')]){rpcDb[_0xdbef('0x99')](ut['createBody'](_0x5e703f[_0x29251e]));rpcDb[_0xdbef('0x9a')](_0x19c2f8,_0xdbef('0x9b'));}else{ut[_0xdbef('0x97')](_0x19c2f8,0x16,_0xdbef('0x9c'));rpcDb[_0xdbef('0x9a')](_0x19c2f8,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x19c2f8,_0xdbef('0x9d'));}}}}})[_0xdbef('0x7d')](ut[_0xdbef('0x92')](_0xdbef('0x9e')));};Preview['prototype'][_0xdbef('0x6d')]=function(_0x265fe0){_0x265fe0[_0xdbef('0x5f')]=!![];if(ut[_0xdbef('0x9f')](_0x265fe0['loggedIn'])){_0x265fe0[_0xdbef('0x4e')]=_0xdbef('0xa0');}else if(!ut['isActive'](_0x265fe0['dialActive'])){_0x265fe0[_0xdbef('0x4e')]=_0xdbef('0x62');}else if(!this[_0xdbef('0xa1')](_0x265fe0[_0xdbef('0x55')])){if(!this[_0xdbef('0xa1')](_0x265fe0[_0xdbef('0xa2')])){_0x265fe0[_0xdbef('0x4e')]='TRUNK_IS_NOT_REACHABLE';}else{_0x265fe0[_0xdbef('0x4e')]=_0xdbef('0xa3');}}else{_0x265fe0[_0xdbef('0x4e')]='ACTIVE';}emitCampaignPreview(_0x265fe0);};Preview['prototype'][_0xdbef('0xa4')]=function(_0x5057b7,_0x4f8fc3,_0x14158){var _0x557d25=this;var _0x15bd34=this['actions'][_0x4f8fc3];var _0x4b05ae=this['campaignsPreview'][_0x15bd34[_0xdbef('0x73')]];var _0x512b30;var _0xa2ec38=![];var _0x2599ee=0x2;var _0x1a6ca8=0x3;if(_0x4b05ae){switch(_0x14158){case'1':_0x4b05ae[_0xdbef('0x3f')]+=0x1;_0x15bd34['countnosuchnumberretry']+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut[_0xdbef('0xa6')](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x0,'NoSuchNumber');ami[_0xdbef('0x26')](_0xdbef('0xa7'),ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xa9')));rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xaa'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'0',_0x4b05ae)[_0xdbef('0x89')](function(_0x51c5f6){_0xa2ec38=_0x51c5f6[_0xdbef('0xac')]==0x1;_0x2599ee=_0x4b05ae[_0xdbef('0xad')];_0x1a6ca8=_0x4b05ae['callAdditionalPhoneAfterMin'];if(!_0xa2ec38){if(ut[_0xdbef('0xa6')](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut[_0xdbef('0xaf')](_0x15bd34,0xf,_0xdbef('0xb0'));rpcDb[_0xdbef('0xb1')](_0x512b30,_0xdbef('0xb2'));}else{if(_0x15bd34[_0xdbef('0xb3')]>=_0x4b05ae[_0xdbef('0xb4')]){rpcDb[_0xdbef('0xb1')](_0x15bd34,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x15bd34,_0xdbef('0xb3'),_0x4b05ae['dialNoSuchNumberRetryFrequency']),_0x15bd34['unlockAgent'],_0x15bd34['activeContact']);}}delete this[_0xdbef('0x14')][_0x5057b7['linkedid']];}else{_0x15bd34['countnosuchnumberretry']++;logger[_0xdbef('0x85')]('actioncountonusuch',_0x15bd34['countnosuchnumberretry']);logger['info']('id',_0x15bd34['idContact']);_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34['idContact'],'field':{'countnosuchnumberretry':_0x15bd34['countnosuchnumberretry']}})[_0xdbef('0x89')](function(){_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});break;case _0xdbef('0xb7'):var _0x1081ef=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x15bd34[_0xdbef('0xb8')]=_0x1081ef;_0x15bd34['answertime']=_0x1081ef;_0x15bd34['dialAnswer']=!![];_0x4b05ae[_0xdbef('0x2b')]+=0x1;logger[_0xdbef('0x85')](_0xdbef('0xb9'),_0x15bd34[_0xdbef('0xba')],'\x20Queue',_0x4b05ae[_0xdbef('0x56')],_0xdbef('0x74'),_0x4b05ae[_0xdbef('0x2b')]);ami[_0xdbef('0x26')](_0xdbef('0xbb'),ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xbc'),this[_0xdbef('0x25')][_0x15bd34[_0xdbef('0x73')]]));if(_0x4b05ae[_0xdbef('0xbd')]){ami['emit'](_0xdbef('0xbe'),ut['buildAcw'](_0x15bd34));}break;case'16':ami[_0xdbef('0x26')](_0xdbef('0xbf'),ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xc0'),this[_0xdbef('0x25')][_0x15bd34[_0xdbef('0x73')]]));emitVoiceQueueChannelRemove(ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xc0')));_0x4b05ae[_0xdbef('0xc1')]+=0x1;_0x4b05ae['total']+=0x1;_0x4b05ae[_0xdbef('0x29')]+=0x1;ut[_0xdbef('0x80')](_0x4b05ae,'[16]');_0x15bd34[_0xdbef('0xa5')]=ut[_0xdbef('0xa6')](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x4,_0xdbef('0xc2'));rpcDb[_0xdbef('0x9a')](_0x15bd34,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x15bd34,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x15bd34);_0x4b05ae[_0xdbef('0x2d')]+=_0x15bd34['talktime'];_0x4b05ae['sumBillable']+=_0x15bd34[_0xdbef('0xc3')];logger['info'](_0xdbef('0xc4'),_0x15bd34[_0xdbef('0xba')],_0xdbef('0xc5'),_0x4b05ae[_0xdbef('0x56')],_0xdbef('0x74'),_0x4b05ae[_0xdbef('0x2b')]);delete this[_0xdbef('0x14')][_0x5057b7[_0xdbef('0xc6')]];break;case _0xdbef('0xc7'):_0x4b05ae[_0xdbef('0x3b')]+=0x1;_0x15bd34[_0xdbef('0xc8')]+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut['totalGlobal'](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x5,'Busy');_0x2599ee=_0x4b05ae['dialBusyRetryFrequency'];_0x1a6ca8=_0x4b05ae[_0xdbef('0xc9')];ami[_0xdbef('0x26')]('custom:agentbusy',ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xca')));rpcDb['createCustomerHistory'](_0x15bd34,_0xdbef('0xcb'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'5',_0x4b05ae)['then'](function(_0x4ab929){_0xa2ec38=_0x4ab929[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut[_0xdbef('0xa6')](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut['cloneAction'](_0x15bd34,0xf,_0xdbef('0xb0'));rpcDb['createCustomerFinal'](_0x512b30,_0xdbef('0xcc'));}else{if(_0x15bd34[_0xdbef('0xc8')]>=_0x4b05ae[_0xdbef('0xcd')]){rpcDb['createCustomerFinal'](_0x15bd34,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xdbef('0xce')](ut[_0xdbef('0xcf')](_0x15bd34,_0xdbef('0xc8'),_0x4b05ae[_0xdbef('0xd0')]),_0x15bd34[_0xdbef('0xd1')],_0x15bd34[_0xdbef('0xd2')]);}}}else{_0x15bd34[_0xdbef('0xc8')]++;_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34[_0xdbef('0xd3')],'field':{'countbusyretry':_0x15bd34[_0xdbef('0xc8')]}})[_0xdbef('0x89')](function(){_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});break;case _0xdbef('0xd4'):_0x4b05ae[_0xdbef('0xd5')]+=0x1;_0x15bd34[_0xdbef('0xd6')]+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut[_0xdbef('0xa6')](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x3,'NoAnswer');_0x2599ee=_0x4b05ae[_0xdbef('0xd7')];_0x1a6ca8=_0x4b05ae['callAdditionalPhoneAfterMin'];var _0x33fba3=ut['buildNoAnswerEventPayload'](_0x15bd34,_0x4b05ae);ami['emit'](_0xdbef('0xd8'),_0x33fba3);rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xd9'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'3',_0x4b05ae)[_0xdbef('0x89')](function(_0x5b3e4c){_0xa2ec38=_0x5b3e4c[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut[_0xdbef('0xa6')](_0x15bd34)>=_0x4b05ae['dialGlobalMaxRetry']){_0x512b30=ut[_0xdbef('0xaf')](_0x15bd34,0xf,'Global');rpcDb[_0xdbef('0xb1')](_0x512b30,_0xdbef('0xda'));}else{if(_0x15bd34['countnoanswerretry']>=_0x4b05ae['dialNoAnswerMaxRetry']){rpcDb[_0xdbef('0xb1')](_0x15bd34,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xdbef('0xce')](ut['scheduledAt'](_0x15bd34,_0xdbef('0xd6'),_0x4b05ae[_0xdbef('0xd7')]),_0x15bd34[_0xdbef('0xd1')],_0x15bd34[_0xdbef('0xd2')]);}}}else{_0x15bd34['countnoanswerretry']++;_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34[_0xdbef('0xd3')],'field':{'countnoanswerretry':_0x15bd34[_0xdbef('0xd6')]}})['then'](function(){_0x557d25['swapAdditionalPhones'](_0x15bd34,_0x2599ee,_0x1a6ca8)['then'](function(){});});}});break;case _0xdbef('0xdb'):_0x4b05ae['outboundCongestionCallsDay']+=0x1;_0x15bd34[_0xdbef('0xdc')]+=0x1;_0x15bd34['countglobal']=ut[_0xdbef('0xa6')](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x8,_0xdbef('0xdd'));_0x2599ee=_0x4b05ae['dialCongestionRetryFrequency'];_0x1a6ca8=_0x4b05ae[_0xdbef('0xc9')];ami[_0xdbef('0x26')](_0xdbef('0xde'),ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xdf')));rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xe0'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'8',_0x4b05ae)[_0xdbef('0x89')](function(_0x185ec9){_0xa2ec38=_0x185ec9[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut['totalGlobal'](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut['cloneAction'](_0x15bd34,0xf,_0xdbef('0xb0'));rpcDb[_0xdbef('0xb1')](_0x512b30,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x15bd34[_0xdbef('0xdc')]>=_0x4b05ae[_0xdbef('0xe1')]){rpcDb[_0xdbef('0xb1')](_0x15bd34,_0xdbef('0xe0'));}else{rpcDb['rescheduleContact'](ut[_0xdbef('0xcf')](_0x15bd34,_0xdbef('0xdc'),_0x4b05ae['dialBusyRetryFrequency']),_0x15bd34['unlockAgent'],_0x15bd34[_0xdbef('0xd2')]);}}}else{_0x15bd34[_0xdbef('0xdc')]++;_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34[_0xdbef('0xd3')],'field':{'countcongestionretry':_0x15bd34[_0xdbef('0xdc')]}})[_0xdbef('0x89')](function(){_0x557d25['swapAdditionalPhones'](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});break;case _0xdbef('0xe2'):_0x4b05ae[_0xdbef('0x42')]+=0x1;_0x15bd34['countagentrejectretry']+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut['totalGlobal'](_0x15bd34);ut['logCustomer'](_0x15bd34,0x14,'AgentReject');_0x2599ee=_0x4b05ae[_0xdbef('0xe3')];_0x1a6ca8=_0x4b05ae[_0xdbef('0xc9')];ami['emit'](_0xdbef('0xe4'),ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xe5')));rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xe6'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'20',_0x4b05ae)['then'](function(_0x2adcf5){_0xa2ec38=_0x2adcf5['additional']==0x1;if(!_0xa2ec38){if(ut['totalGlobal'](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut[_0xdbef('0xaf')](_0x15bd34,0x14,_0xdbef('0xe7'));rpcDb['createCustomerFinal'](_0x512b30,_0xdbef('0xe8'));}else{if(_0x15bd34[_0xdbef('0xe9')]>=_0x4b05ae[_0xdbef('0xea')]){rpcDb[_0xdbef('0xb1')](_0x15bd34,_0xdbef('0xe8'));}else{rpcDb[_0xdbef('0xce')](ut['scheduledAt'](_0x15bd34,_0xdbef('0xe9'),_0x4b05ae['dialAgentRejectRetryFrequency']),_0x15bd34[_0xdbef('0xd1')],_0x15bd34[_0xdbef('0xd2')]);}}}else{_0x15bd34[_0xdbef('0xd6')]++;_0x557d25['incrementPreviewCounters']({'id':_0x15bd34['idContact'],'field':{'countnoanswerretry':_0x15bd34[_0xdbef('0xd6')]}})['then'](function(){_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});break;case'ABANDONED':_0x4b05ae[_0xdbef('0x43')]+=0x1;_0x15bd34[_0xdbef('0xeb')]+=0x1;_0x15bd34['countglobal']=ut[_0xdbef('0xa6')](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0xb,_0xdbef('0xec'));rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xed'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'11',_0x4b05ae)['then'](function(_0x18b0b9){_0xa2ec38=_0x18b0b9[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut['totalGlobal'](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut['cloneAction'](_0x15bd34,0xf,_0xdbef('0xb0'));rpcDb['createCustomerFinal'](_0x512b30,_0xdbef('0xed'));}else{if(_0x15bd34[_0xdbef('0xee')]>=_0x4b05ae['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x15bd34,_0xdbef('0xed'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x15bd34,_0xdbef('0xeb'),_0x4b05ae[_0xdbef('0xef')]),_0x15bd34[_0xdbef('0xd1')],_0x15bd34['activeContact']);}}}else{_0x15bd34['countnoanswerretry']++;_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34[_0xdbef('0xd3')],'field':{'countnoanswerretry':_0x15bd34[_0xdbef('0xd6')]}})[_0xdbef('0x89')](function(){_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});break;case'18':_0x4b05ae[_0xdbef('0xf0')]+=0x1;_0x15bd34[_0xdbef('0xf1')]+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut['totalGlobal'](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x12,_0x5057b7['cause-txt']||_0x5057b7[_0xdbef('0xf2')]);ami[_0xdbef('0x26')](_0xdbef('0xf3'),ut['buildObj'](_0x15bd34,'amd'));rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xf4'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'18',_0x4b05ae)[_0xdbef('0x89')](function(_0x11358b){_0xa2ec38=_0x11358b[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut['totalGlobal'](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut[_0xdbef('0xaf')](_0x15bd34,0x12,_0xdbef('0xb0'));rpcDb[_0xdbef('0xb1')](_0x512b30,_0xdbef('0xf4'));}else{rpcDb['createCustomerFinal'](_0x15bd34,_0xdbef('0xf4'));}}else{_0x15bd34['countnoanswerretry']++;_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34['idContact'],'field':{'countnoanswerretry':_0x15bd34[_0xdbef('0xd6')]}})[_0xdbef('0x89')](function(){_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});delete this['actions'][_0x5057b7['linkedid']];break;case'19':_0x4b05ae[_0xdbef('0xf0')]+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut[_0xdbef('0xa6')](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0x13,_0x5057b7[_0xdbef('0xf5')]||_0x5057b7['dialstatus']);ami[_0xdbef('0x26')](_0xdbef('0xf3'),ut[_0xdbef('0xa8')](_0x15bd34,_0xdbef('0xf6')));rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xf7'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'18',_0x4b05ae)[_0xdbef('0x89')](function(_0x506937){_0xa2ec38=_0x506937[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut[_0xdbef('0xa6')](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut[_0xdbef('0xaf')](_0x15bd34,0xf,_0xdbef('0xb0'));rpcDb['createCustomerFinal'](_0x512b30,_0xdbef('0xf7'));}else{rpcDb[_0xdbef('0xb1')](_0x15bd34,_0xdbef('0xf7'));}}else{_0x15bd34['countnoanswerretry']++;_0x557d25[_0xdbef('0xb5')]({'id':_0x15bd34['idContact'],'field':{'countnoanswerretry':_0x15bd34['countnoanswerretry']}})[_0xdbef('0x89')](function(){_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});});}});delete this['actions'][_0x5057b7[_0xdbef('0xc6')]];break;default:if(_0x15bd34[_0xdbef('0x75')]){ut[_0xdbef('0x80')](_0x4b05ae,'[default]');ut[_0xdbef('0x82')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4b05ae[_0xdbef('0x56')],_0x5057b7);}_0x4b05ae[_0xdbef('0xf0')]+=0x1;_0x15bd34[_0xdbef('0xa5')]=ut['totalGlobal'](_0x15bd34);ut[_0xdbef('0x97')](_0x15bd34,0xc,_0x5057b7['cause-txt']||_0x5057b7['dialstatus']);_0x2599ee=_0x4b05ae[_0xdbef('0xe3')];_0x1a6ca8=_0x4b05ae['callAdditionalPhoneAfterMin'];rpcDb[_0xdbef('0x9a')](_0x15bd34,_0xdbef('0xf8'));_0x557d25[_0xdbef('0xab')](_0x15bd34,'20',_0x4b05ae)[_0xdbef('0x89')](function(_0x2841c4){_0xa2ec38=_0x2841c4[_0xdbef('0xac')]==0x1;if(!_0xa2ec38){if(ut[_0xdbef('0xa6')](_0x15bd34)>=_0x4b05ae[_0xdbef('0xae')]){_0x512b30=ut[_0xdbef('0xaf')](_0x15bd34,0xf,_0xdbef('0xb0'));rpcDb[_0xdbef('0xb1')](_0x512b30,_0xdbef('0xf9'));}else{rpcDb['createCustomerFinal'](_0x15bd34,_0xdbef('0xf9'));}delete this[_0xdbef('0x14')][_0x5057b7[_0xdbef('0xc6')]];}else{_0x557d25[_0xdbef('0xb6')](_0x15bd34,_0x2599ee,_0x1a6ca8)[_0xdbef('0x89')](function(){});}});}if(!(_0x15bd34[_0xdbef('0x75')]&&_0x14158==='16')){ut['updateOriginated'](_0x4b05ae,_0xdbef('0xfa'));logger[_0xdbef('0x85')](_0xdbef('0xfb'),_0x15bd34[_0xdbef('0xba')],'\x20Queue',_0x4b05ae[_0xdbef('0x56')],_0xdbef('0xfc'),_0x4b05ae[_0xdbef('0x4f')]);}if(_0x14158!==_0xdbef('0xb7')){delete this['actions'][_0x5057b7[_0xdbef('0xc6')]];delete this[_0xdbef('0x14')][_0x5057b7['destlinkedid']];}}};Preview[_0xdbef('0x67')][_0xdbef('0xfd')]=function(_0x1c52c8,_0x30a0da,_0x277b03){if(_[_0xdbef('0xfe')](_0x30a0da)&&'object'!==typeof _0x30a0da){return;}if(_[_0xdbef('0xfe')](_0x277b03)&&'object'!==typeof _0x277b03){return;}switch(_0x277b03[_0xdbef('0xff')]){case'0':ut[_0xdbef('0x100')](_0x1c52c8,0x0,_0xdbef('0x101'));rpcDb[_0xdbef('0x102')](_0x1c52c8,_0xdbef('0x103'));break;case'3':ut[_0xdbef('0x100')](_0x1c52c8,0x3,_0xdbef('0x104'));rpcDb['createAgentHistory'](_0x1c52c8,_0xdbef('0x105'));break;case'5':ut['logAgent'](_0x1c52c8,0x5,_0xdbef('0x106'));rpcDb['createAgentHistory'](_0x1c52c8,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xdbef('0x100')](_0x1c52c8,0x8,_0xdbef('0xdd'));rpcDb[_0xdbef('0x102')](_0x1c52c8,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xdbef('0x100')](_0x1c52c8,0x16,'AnswerAGI');rpcDb[_0xdbef('0x102')](_0x1c52c8,_0xdbef('0x107'));break;default:ut[_0xdbef('0x100')](_0x1c52c8,0xc,_0x277b03['reason']);rpcDb['createAgentHistory'](_0x1c52c8,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdbef('0x7f')](_0x30a0da,_0xdbef('0x108'));logger[_0xdbef('0x85')](_0xdbef('0x109'),_0x1c52c8[_0xdbef('0xba')],_0xdbef('0xc5'),_0x30a0da['name'],'originated:\x20',_0x30a0da[_0xdbef('0x4f')]);delete this['actions'][_0x1c52c8[_0xdbef('0xba')]];};Preview[_0xdbef('0x67')][_0xdbef('0xab')]=function(_0x5f202b,_0x46c158,_0x1cd173){return Promise[_0xdbef('0x10a')]()[_0xdbef('0x89')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5f202b,_0x46c158,_0x1cd173))[_0xdbef('0x7d')](logger[_0xdbef('0x85')](_0xdbef('0x10b')));};Preview[_0xdbef('0x67')]['swapAdditionalPhones']=function(_0x367a3,_0x286c84,_0x5db34e){return Promise[_0xdbef('0x10a')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x367a3,_0x286c84,_0x5db34e))[_0xdbef('0x7d')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0xdbef('0x67')][_0xdbef('0xb5')]=function(_0x2eccfe){return Promise['resolve']()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x2eccfe))['catch'](logger[_0xdbef('0x85')](_0xdbef('0x10c')));};Preview[_0xdbef('0x67')]['checkInBlack']=function(_0x2219db,_0x10f523,_0xf3e830,_0xfac87e,_0x29b0c0){var _0x4014a8=this;return new Promise(function(_0x51caea,_0x5ccb1c){if(_['isNil'](_0x10f523)||_[_0xdbef('0x8a')](_0x10f523[_0xdbef('0x10d')])||_['isNil'](_0x10f523[_0xdbef('0x10e')])||_['isNil'](_0x10f523[_0xdbef('0x78')])){_0x5ccb1c(ut[_0xdbef('0x4e')](_0xdbef('0x10f'),_0xfac87e,_0x29b0c0));return;}var _0x47d992=uuid['v4']();var _0x3c8b9f=_0x4014a8[_0xdbef('0x25')][_0x10f523[_0xdbef('0x72')][_0xdbef('0x56')]];var _0x355369=_0xf3e830?_0x4014a8[_0xdbef('0x15')][_0xf3e830]['id']:undefined;_0x4014a8['actions'][_0x47d992]=new Action(_0x10f523,_0x3c8b9f,_0x47d992,_0xf3e830,_0x355369);var _0x34fec1=_0x4014a8[_0xdbef('0x14')][_0x47d992];_0x34fec1[_0xdbef('0xd1')]=_0xfac87e;_0x34fec1['activeContact']=_0x29b0c0;_0x34fec1[_0xdbef('0x110')]=_0xf3e830;if(_[_0xdbef('0x111')](_0x2219db)){_0x4014a8[_0xdbef('0x112')](_0x34fec1,_0x3c8b9f,_0x10f523,_0xf3e830)[_0xdbef('0x89')](function(_0x56e053){logger[_0xdbef('0x85')](_0xdbef('0x113'),_0xdbef('0x114')+_0x34fec1[_0xdbef('0x73')]+_0xdbef('0x115')+_0x34fec1[_0xdbef('0xd3')],JSON[_0xdbef('0x58')](_0x56e053));ami[_0xdbef('0x26')](_0xdbef('0x116'),ut[_0xdbef('0xa8')](_0x34fec1,_0xdbef('0x117'),_0x4014a8[_0xdbef('0x25')][_0x34fec1[_0xdbef('0x73')]]));_0x51caea(ut['message'](_0xdbef('0x118')));})[_0xdbef('0x7d')](function(_0x3d4010){ut[_0xdbef('0x65')](_0xdbef('0x119'),_0x3d4010);_0x5ccb1c(ut['message']('Call\x20failed',_0xfac87e,_0x29b0c0));});}else{_0x3c8b9f[_0xdbef('0x3a')]+=0x1;ut[_0xdbef('0x11a')](_0x34fec1);rpcDb['createHistory'](_0x34fec1,_0xdbef('0x11b'));delete _0x4014a8[_0xdbef('0x14')][_0x47d992];_0x5ccb1c(ut[_0xdbef('0x4e')]('Contact\x20in\x20black\x20List',_0xfac87e,_0x29b0c0));}});};Preview[_0xdbef('0x67')][_0xdbef('0xa1')]=function(_0x2d1280){return!_[_0xdbef('0x8a')](_0x2d1280)&&!_[_0xdbef('0x8a')](_0x2d1280[_0xdbef('0x56')])&&!_[_0xdbef('0x8a')](_0x2d1280[_0xdbef('0x11c')])&&_0x2d1280['active']&&!_[_0xdbef('0x8a')](this[_0xdbef('0x13')][util[_0xdbef('0x59')]('SIP/%s',_0x2d1280[_0xdbef('0x56')])])&&!_[_0xdbef('0x8a')](this[_0xdbef('0x13')][util[_0xdbef('0x59')](_0xdbef('0x11d'),_0x2d1280[_0xdbef('0x56')])][_0xdbef('0x7b')])&&(this[_0xdbef('0x13')][util[_0xdbef('0x59')](_0xdbef('0x11d'),_0x2d1280['name'])][_0xdbef('0x7b')]==='reachable'||this[_0xdbef('0x13')][util[_0xdbef('0x59')](_0xdbef('0x11d'),_0x2d1280[_0xdbef('0x56')])][_0xdbef('0x7b')]===_0xdbef('0x11e'));};Preview[_0xdbef('0x67')][_0xdbef('0x91')]=function(_0x256c53,_0x464890){var _0x5ee467=this;return new Promise(function(_0x188412,_0x3f5aa8){_0x5ee467[_0xdbef('0x11f')](_0x256c53,_0x464890)[_0xdbef('0x89')](function(_0xbd5f95){_0x188412(_[_0xdbef('0x76')](_0xbd5f95,[_0xdbef('0x4e')]));})['catch'](function(_0x383298){if(_0x383298[_0xdbef('0x120')]){rpcDb[_0xdbef('0x121')](_0x256c53);}if(_0x383298['active']){rpcDb['disableContact'](_0x256c53);}_0x3f5aa8(_[_0xdbef('0x76')](_0x383298,[_0xdbef('0x4e')]));});});};Preview[_0xdbef('0x67')][_0xdbef('0x11f')]=function(_0x5dac19,_0x330d56){var _0x3ddae8=this;return new Promise(function(_0x3c5338,_0x27739e){var _0x380a18,_0x26ec6c;rpcDb['getContactPreview'](_0x5dac19)[_0xdbef('0x89')](function(_0x1fb663){if(!_['isNil'](_0x1fb663[0x0])){_0x26ec6c=_0x1fb663[0x0][_0xdbef('0x122')]?![]:!![];_0x380a18=_0x1fb663[0x0][_0xdbef('0x122')]?!![]:![];_0x380a18=_0x330d56?!![]:_0x380a18;}var _0x27126d=_0x3ddae8[_0xdbef('0x123')](_0x1fb663);if(_0x27126d['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x1fb663[0x0],['VoiceQueueId',_0xdbef('0x10e')]))[_0xdbef('0x89')](function(_0x315349){_0x3ddae8[_0xdbef('0x124')](_0x315349,_0x1fb663[0x0],_0x330d56,_0x26ec6c,_0x380a18)[_0xdbef('0x89')](function(_0x1c2148){_0x3c5338(_0x1c2148);})[_0xdbef('0x7d')](function(_0x3274f2){_0x27739e(_0x3274f2);});})['catch'](function(_0x39abf4){ut['logger'](_0xdbef('0x125'),_0x39abf4);_0x27739e(ut[_0xdbef('0x4e')]('Call\x20unsuccessful',_0x26ec6c,_0x380a18));});}else{_0x27739e(ut[_0xdbef('0x4e')](_0x27126d['message'],_0x26ec6c,_0x380a18));}})['catch'](function(_0x2f0ac1){ut['logger'](_0xdbef('0x126'),_0x2f0ac1);_0x27739e(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xdbef('0x123')]=function(_0x4a4a02){if(_[_0xdbef('0x8a')](_0x4a4a02)||_[_0xdbef('0x111')](_0x4a4a02)||!_['isNil'](_0x4a4a02[0x0][_0xdbef('0x8f')])&&_[_0xdbef('0x8a')](_0x4a4a02[0x0][_0xdbef('0x8f')][_0xdbef('0x56')])){ut[_0xdbef('0x65')](_0xdbef('0x127'),_0x4a4a02);return{'isValid':![],'message':_0xdbef('0x128')};}var _0x5d9ff8=this[_0xdbef('0x25')][_0x4a4a02[0x0][_0xdbef('0x72')][_0xdbef('0x56')]];_0x5d9ff8[_0xdbef('0x4e')]=_0xdbef('0xa3');if(_[_0xdbef('0x8a')](_0x5d9ff8)){ut[_0xdbef('0x65')](_0xdbef('0x129'),_0x5d9ff8);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xdbef('0xa1')](_0x5d9ff8[_0xdbef('0x55')])){ut[_0xdbef('0x65')](_0xdbef('0x12a'),_0xdbef('0x12b')+_0x5d9ff8[_0xdbef('0x56')]+_0xdbef('0x12c'));if(!this[_0xdbef('0xa1')](_0x5d9ff8[_0xdbef('0xa2')])){ut['logger'](_0xdbef('0x12a'),_0x5d9ff8['name']+_0xdbef('0x12d'));return{'isValid':![],'message':_0xdbef('0x12e')};}}if(!ut[_0xdbef('0x12f')](_0x5d9ff8[_0xdbef('0x33')])){ut['logger'](_0xdbef('0x130'),_0x5d9ff8['name']+_0xdbef('0x131'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x5d9ff8[_0xdbef('0x56')]+_0xdbef('0x131')};}return{'isValid':!![],'message':_0xdbef('0x132')};};Preview[_0xdbef('0x67')][_0xdbef('0x112')]=function(_0x40baf8,_0x3c1cf3,_0x1ceb63,_0x2fef2e){var _0x563ff1=this;return new Promise(function(_0x4fa59e,_0x466d33){var _0x2bec24=_0x40baf8[_0xdbef('0xba')];var _0x517cb1=_0x563ff1[_0xdbef('0xa1')](_0x3c1cf3['Trunk'])?util[_0xdbef('0x59')](_0xdbef('0x133'),_0x3c1cf3['Trunk'][_0xdbef('0x56')],_[_0xdbef('0x8a')](_0x3c1cf3[_0xdbef('0x38')])?'':_0x3c1cf3[_0xdbef('0x38')]['trim']()||'',_0x3c1cf3[_0xdbef('0x134')]>0x0?_0x1ceb63[_0xdbef('0x10e')][_0xdbef('0x135')](_0x3c1cf3[_0xdbef('0x134')]):_0x1ceb63[_0xdbef('0x10e')]):util['format'](_0xdbef('0x133'),_[_0xdbef('0x8a')](_0x3c1cf3[_0xdbef('0xa2')])?_0x3c1cf3[_0xdbef('0x55')][_0xdbef('0x56')]:_0x3c1cf3[_0xdbef('0xa2')]['name'],_[_0xdbef('0x8a')](_0x3c1cf3[_0xdbef('0x38')])?'':_0x3c1cf3[_0xdbef('0x38')][_0xdbef('0x136')]()||'',_0x3c1cf3[_0xdbef('0x134')]>0x0?_0x1ceb63[_0xdbef('0x10e')]['substring'](_0x3c1cf3[_0xdbef('0x134')]):_0x1ceb63[_0xdbef('0x10e')]);var _0x45eb2d=_0x563ff1[_0xdbef('0xa1')](_0x3c1cf3[_0xdbef('0x55')])?ut[_0xdbef('0x137')](_0x3c1cf3[_0xdbef('0x55')][_0xdbef('0x138')],_0x3c1cf3[_0xdbef('0x35')],_0x3c1cf3[_0xdbef('0x139')]>0x0?ut[_0xdbef('0x13a')](_0x3c1cf3['dialOriginateCallerIdNumber'],_0x3c1cf3[_0xdbef('0x139')]):_0x3c1cf3[_0xdbef('0x36')]):ut['getCallerId'](_[_0xdbef('0x8a')](_0x3c1cf3[_0xdbef('0xa2')])?_0x3c1cf3[_0xdbef('0x55')]['callerid']:_0x3c1cf3[_0xdbef('0xa2')][_0xdbef('0x138')],_0x3c1cf3['dialOriginateCallerIdName'],_0x3c1cf3[_0xdbef('0x139')]>0x0?ut[_0xdbef('0x13a')](_0x3c1cf3[_0xdbef('0x36')],_0x3c1cf3[_0xdbef('0x139')]):_0x3c1cf3['dialOriginateCallerIdNumber']);if(_0x45eb2d){_0x40baf8[_0xdbef('0x13b')]=ut[_0xdbef('0x13c')](_0x45eb2d);_0x40baf8[_0xdbef('0x13d')]=ut['extractCalleridNumber'](_0x45eb2d);}var _0x454b28=ut[_0xdbef('0x13e')](_0x3c1cf3,_0x1ceb63,_0x517cb1,_0x45eb2d,_0x2bec24,_0x40baf8);_[_0xdbef('0x13f')](_0x40baf8,ut[_0xdbef('0x140')](_0x454b28));_0x40baf8[_0xdbef('0x95')]=moment()['format'](_0xdbef('0x96'));_0x3c1cf3[_0xdbef('0x141')]=_0x454b28;ami[_0xdbef('0x7a')](ut[_0xdbef('0x142')](_0x40baf8,_0x3c1cf3,_0x454b28,_0x40baf8[_0xdbef('0xd2')],_0x2fef2e))['then'](function(_0x38c947){_0x3c1cf3[_0xdbef('0x4f')]+=0x1;logger[_0xdbef('0x85')]('[originated][increment]',_0x2bec24,'\x20Queue',_0x3c1cf3[_0xdbef('0x56')],'originated:\x20',_0x3c1cf3['originated']);_0x4fa59e(_0x38c947);})[_0xdbef('0x7d')](function(_0x5f580a){ut[_0xdbef('0x100')](_0x40baf8,0xe,_0xdbef('0x143'));rpcDb[_0xdbef('0x102')](_0x40baf8,'[originateFailure][logOriginateFailure]');_0x466d33(_0x5f580a);});});};Preview[_0xdbef('0x67')]['syncNewExten']=function(_0x26bc1a){if(this['actions'][_0x26bc1a[_0xdbef('0xc6')]]){this[_0xdbef('0x14')][_0x26bc1a[_0xdbef('0xc6')]][_0xdbef('0x7c')]=_0x26bc1a[_0xdbef('0x7c')];}};Preview[_0xdbef('0x67')][_0xdbef('0x18')]=function(_0x267f9a){var _0x120941=this;var _0x101812=this[_0xdbef('0x14')][_0x267f9a[_0xdbef('0x144')]];if(_0x101812){if(_0x101812['lookAgent']&&this[_0xdbef('0x15')][_0x101812[_0xdbef('0x110')]]){ut[_0xdbef('0x145')](_0x101812,this[_0xdbef('0x15')][_0x101812[_0xdbef('0x110')]][_0xdbef('0x56')],this[_0xdbef('0x15')][_0x101812[_0xdbef('0x110')]]['id']);}var _0x45eeba=_[_0xdbef('0x146')](_0x101812);_0x45eeba[_0xdbef('0xb8')]=moment()['format'](_0xdbef('0x96'));var _0x209115=_0x120941[_0xdbef('0x25')][_0x101812['queue']];if(ut[_0xdbef('0x147')](_0x267f9a[_0xdbef('0x148')])){if(_0x101812[_0xdbef('0xd1')]){rpcDb[_0xdbef('0x121')](_0x101812[_0xdbef('0xd3')]);}if(_0x101812[_0xdbef('0xd2')]){rpcDb[_0xdbef('0x94')](_0x101812[_0xdbef('0xd3')]);}ami['emit'](_0xdbef('0x149'),ut[_0xdbef('0xa8')](_0x101812,_0xdbef('0x14a'),this[_0xdbef('0x25')][_0x101812[_0xdbef('0x73')]]));this[_0xdbef('0xfd')](_0x45eeba,_0x209115,_0x267f9a);}else{_0x101812[_0xdbef('0x95')]=moment()[_0xdbef('0x59')](_0xdbef('0x96'));ut[_0xdbef('0x100')](_0x45eeba,0x4,'Answer');rpcDb['createAgentHistory'](_0x45eeba,_0xdbef('0x14b'));}}};Preview[_0xdbef('0x67')][_0xdbef('0x1b')]=function(_0x133282){var _0x4e36c2=this[_0xdbef('0x14')][_0x133282[_0xdbef('0xc6')]];var _0x356bb5;if(_0x4e36c2){_0x356bb5=this[_0xdbef('0x25')][_0x4e36c2['queue']];logger[_0xdbef('0x85')](_0xdbef('0x14c'),_0x133282[_0xdbef('0xc6')],'\x20Queue',_0x356bb5[_0xdbef('0x56')],_0xdbef('0x74'),_0x356bb5[_0xdbef('0x2b')]);}if(this[_0xdbef('0x14')][_0x133282[_0xdbef('0xc6')]]&&_0x133282['linkedid']!==_0x133282[_0xdbef('0xba')]){if(_0x133282[_0xdbef('0x14d')]==='16'&&this[_0xdbef('0x14')][_0x133282[_0xdbef('0xc6')]]['dialAnswer']){this[_0xdbef('0xa4')](_0x133282,_0x133282[_0xdbef('0xc6')],_0x133282[_0xdbef('0x14d')]);}else if(this[_0xdbef('0x14')][_0x133282[_0xdbef('0xc6')]][_0xdbef('0x75')]){logger[_0xdbef('0x85')](_0xdbef('0x14e'),_0x133282[_0xdbef('0xc6')],_0x133282[_0xdbef('0x14d')],_0xdbef('0xc5'),_0x356bb5[_0xdbef('0x56')],'pTalking:\x20',_0x356bb5[_0xdbef('0x2b')]);this[_0xdbef('0xa4')](_0x133282,_0x133282[_0xdbef('0xc6')],_0x133282['cause']);}}else if(_0x4e36c2&&_[_0xdbef('0x8a')](_0x4e36c2['statedesc'])&&_0x356bb5[_0xdbef('0x14f')]&&_0x133282[_0xdbef('0xc6')]===_0x133282['uniqueid']&&_['isNil'](_0x133282['reason'])&&_0x133282[_0xdbef('0x14d')]==='16'&&_0x133282[_0xdbef('0x150')]==='6'&&_[_0xdbef('0xfe')](_0x4e36c2[_0xdbef('0x151')])){if(_0x4e36c2[_0xdbef('0xd1')]){rpcDb['unlockContact'](_0x4e36c2[_0xdbef('0xd3')]);}if(_0x4e36c2[_0xdbef('0xd2')]){rpcDb[_0xdbef('0x94')](_0x4e36c2['idContact']);}_0x133282['reason']='22';this[_0xdbef('0xfd')](_0x4e36c2,_0x356bb5,_0x133282);}else if(_0x4e36c2&&_0x4e36c2['transfer']){if(_0x133282[_0xdbef('0x14d')]==='16'&&this[_0xdbef('0x14')][_0x133282[_0xdbef('0xc6')]]['dialAnswer']){logger[_0xdbef('0x85')](_0xdbef('0x152'),_0x133282[_0xdbef('0xc6')],_0x133282[_0xdbef('0x14d')],'\x20Queue',_0x356bb5[_0xdbef('0x56')],_0xdbef('0x74'),_0x356bb5['pTalking']);this[_0xdbef('0xa4')](_0x133282,_0x133282['linkedid'],_0x133282[_0xdbef('0x14d')]);}else if(this['actions'][_0x133282[_0xdbef('0xc6')]]['dialAnswer']){logger[_0xdbef('0x85')](_0xdbef('0x14e'),_0x133282[_0xdbef('0xc6')],_0x133282['cause'],_0xdbef('0xc5'),_0x356bb5[_0xdbef('0x56')],_0xdbef('0x74'),_0x356bb5[_0xdbef('0x2b')]);this['callProgressDetectingCustomer'](_0x133282,_0x133282[_0xdbef('0xc6')],_0x133282['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x3baf1a){if(this[_0xdbef('0x14')][_0x3baf1a[_0xdbef('0x153')]]&&_0x3baf1a['destlinkedid']!==_0x3baf1a[_0xdbef('0x154')]){this[_0xdbef('0xa4')](_0x3baf1a,_0x3baf1a[_0xdbef('0x153')],_0x3baf1a[_0xdbef('0xf2')]);}};Preview[_0xdbef('0x67')]['syncHangupRequest']=function(_0x5bbdbd){if(this[_0xdbef('0x14')][_0x5bbdbd[_0xdbef('0xc6')]]&&_0x5bbdbd[_0xdbef('0xc6')]!==_0x5bbdbd['uniqueid']&&!this[_0xdbef('0x14')][_0x5bbdbd[_0xdbef('0xc6')]][_0xdbef('0x75')]){if(_0x5bbdbd[_0xdbef('0x14d')]==='1'){this[_0xdbef('0xa4')](_0x5bbdbd,_0x5bbdbd[_0xdbef('0xc6')],_0x5bbdbd[_0xdbef('0x14d')]);}}};Preview[_0xdbef('0x67')][_0xdbef('0x155')]=function(_0x2b4dc7,_0x3ba91a,_0x4dfd54){if(this['actions'][_0x2b4dc7]){if(_[_0xdbef('0x8a')](this[_0xdbef('0x14')][_0x2b4dc7][_0xdbef('0x141')])){this['actions'][_0x2b4dc7][_0xdbef('0x141')]={};}this['actions'][_0x2b4dc7]['variables'][_0x3ba91a]=_0x4dfd54;}};Preview[_0xdbef('0x67')][_0xdbef('0x20')]=function(_0x5dbad0){try{if(!_[_0xdbef('0x8a')](_0x5dbad0)){if(ut[_0xdbef('0x156')](_[_0xdbef('0x157')](_0x5dbad0[_0xdbef('0x158')])[0x0])){this[_0xdbef('0x155')](_0x5dbad0['uniqueid'],_[_0xdbef('0x157')](_0x5dbad0[_0xdbef('0x158')])[0x0],_0x5dbad0['value']);}}}catch(_0x3a8678){logger[_0xdbef('0x159')]('[syncVarSet][Preview]',util['inspect'](_0x3a8678,{'showHidden':![],'depth':null}));}};Preview[_0xdbef('0x67')][_0xdbef('0x22')]=function(_0x27e423){if(_0x27e423){if(this[_0xdbef('0x14')][_0x27e423[_0xdbef('0x15a')]]){this[_0xdbef('0x14')][_0x27e423[_0xdbef('0x15a')]][_0xdbef('0x151')]=!![];}}};Preview[_0xdbef('0x67')]['syncBlindTransfer']=function(_0x123a3e){if(_0x123a3e){if(this[_0xdbef('0x14')][_0x123a3e['transfererlinkedid']]){this[_0xdbef('0x14')][_0x123a3e['transfererlinkedid']][_0xdbef('0x151')]=!![];}}};module[_0xdbef('0x15b')]=Preview; \ No newline at end of file +var _0x0330=['outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','logger','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','SIP/%s','reachable','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridNumber','merge','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','unlockContact','disableContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay'];(function(_0x5516c7,_0x3d46e4){var _0x314076=function(_0x3e3b38){while(--_0x3e3b38){_0x5516c7['push'](_0x5516c7['shift']());}};_0x314076(++_0x3d46e4);}(_0x0330,0x11f));var _0x0033=function(_0x5dcd6a,_0x484a00){_0x5dcd6a=_0x5dcd6a-0x0;var _0x135b5e=_0x0330[_0x5dcd6a];return _0x135b5e;};'use strict';var util=require(_0x0033('0x0'));var _=require(_0x0033('0x1'));var uuid=require('uuid');var moment=require(_0x0033('0x2'));var md5=require(_0x0033('0x3'));var Redis=require(_0x0033('0x4'));var config=require(_0x0033('0x5'));var logger=require(_0x0033('0x6'))('preview');var loggerAction=require('../../../config/logger')(_0x0033('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require('./util/util');config['redis']=_['defaults'](config[_0x0033('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0033('0x8')]));var Sequence=function(){};Sequence[_0x0033('0x9')][_0x0033('0xa')]=function(_0x1bb335){this[_0x0033('0xb')]=this[_0x0033('0xb')]?this[_0x0033('0xb')][_0x0033('0xc')](_0x1bb335):_0x1bb335();};function Preview(_0x16f251){this[_0x0033('0xd')]=new Sequence();this[_0x0033('0xe')]=_0x16f251[_0x0033('0xf')];this[_0x0033('0x10')]=_0x16f251['trunks'];this[_0x0033('0x11')]={};this[_0x0033('0x12')]=_0x16f251['agents'];this[_0x0033('0x13')]=0x0;ami['on'](_0x0033('0x14'),this[_0x0033('0x15')]['bind'](this));ami['on']('hangup',this[_0x0033('0x16')][_0x0033('0x17')](this));ami['on'](_0x0033('0x18'),this[_0x0033('0x19')][_0x0033('0x17')](this));ami['on'](_0x0033('0x1a'),this[_0x0033('0x1b')][_0x0033('0x17')](this));ami['on'](_0x0033('0x1c'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x0033('0x1d')][_0x0033('0x17')](this));ami['on']('attendedtransfer',this[_0x0033('0x1e')][_0x0033('0x17')](this));ami['on'](_0x0033('0x1f'),this[_0x0033('0x20')]['bind'](this));this[_0x0033('0x21')](this['campaignsPreview']);}function emit(_0x3e638a,_0x5902e4,_0x3240d1){io['to'](_0x3e638a)[_0x0033('0x22')](_0x5902e4,_0x3240d1);}function emitCampaignPreview(_0x1b8127){if(_0x1b8127[_0x0033('0x23')]===_0x0033('0x24')){var _0x27bd37={'id':_0x1b8127['id'],'name':_0x1b8127[_0x0033('0x25')],'strategy':_0x1b8127[_0x0033('0x26')],'answered':_0x1b8127[_0x0033('0x27')],'available':_0x1b8127[_0x0033('0x28')],'loggedIn':_0x1b8127[_0x0033('0x29')],'pTalking':_0x1b8127['pTalking'],'sumBillable':_0x1b8127['sumBillable'],'sumDuration':_0x1b8127[_0x0033('0x2a')],'sumHoldTime':_0x1b8127[_0x0033('0x2b')]||0x0,'talking':_0x1b8127[_0x0033('0x2c')],'total':_0x1b8127[_0x0033('0x2d')],'type':_0x1b8127['type'],'unmanaged':_0x1b8127[_0x0033('0x2e')],'abandoned':_0x1b8127[_0x0033('0x2f')],'waiting':_0x1b8127[_0x0033('0x30')],'loggedInDb':_0x1b8127[_0x0033('0x31')],'dialActive':_0x1b8127[_0x0033('0x32')],'dialMethod':_0x1b8127['dialMethod'],'dialOriginateCallerIdName':_0x1b8127['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1b8127[_0x0033('0x33')],'dialOriginateTimeout':_0x1b8127[_0x0033('0x34')],'dialPrefix':_0x1b8127['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1b8127[_0x0033('0x35')],'outboundAnswerCallsDay':_0x1b8127[_0x0033('0x36')],'outboundBlacklistCallsDay':_0x1b8127[_0x0033('0x37')],'outboundBusyCallsDay':_0x1b8127['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1b8127['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1b8127[_0x0033('0x38')],'outboundDropCallsDayCallersExit':_0x1b8127['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1b8127[_0x0033('0x39')],'outboundNoAnswerCallsDay':_0x1b8127['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1b8127[_0x0033('0x3a')],'outboundOriginateFailureCallsDay':_0x1b8127[_0x0033('0x3b')],'outboundReCallsDay':_0x1b8127[_0x0033('0x3c')],'outboundRejectCallsDay':_0x1b8127[_0x0033('0x3d')],'outboundUnknownCallsDay':_0x1b8127[_0x0033('0x3e')],'outboundAbandonedCallsDay':_0x1b8127[_0x0033('0x3f')],'predictiveIntervalAnsweredCalls':_0x1b8127[_0x0033('0x40')],'predictiveIntervalAvgHoldtime':_0x1b8127[_0x0033('0x41')],'predictiveIntervalAvgTalktime':_0x1b8127[_0x0033('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x1b8127[_0x0033('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x1b8127[_0x0033('0x44')],'predictiveIntervalErlangCalls':_0x1b8127[_0x0033('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x1b8127['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1b8127[_0x0033('0x46')],'predictiveIntervalMultiplicativeFactor':_0x1b8127[_0x0033('0x47')],'predictiveIntervalPauses':_0x1b8127['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1b8127[_0x0033('0x48')],'predictiveIntervalTotalCalls':_0x1b8127[_0x0033('0x49')],'message':_0x1b8127[_0x0033('0x4a')],'originated':_0x1b8127[_0x0033('0x4b')],'erlangCalls':_0x1b8127[_0x0033('0x4c')],'erlangCallToSecond':_0x1b8127[_0x0033('0x4d')],'erlangAbandonmentRate':_0x1b8127['erlangAbandonmentRate'],'erlangBusyFactor':_0x1b8127['erlangBusyFactor'],'startPredictive':_0x1b8127[_0x0033('0x4e')],'startProgressive':_0x1b8127[_0x0033('0x4f')]};if(_0x1b8127['Trunk']){_0x27bd37['Trunk']={'id':_0x1b8127['Trunk']['id'],'name':_0x1b8127[_0x0033('0x50')][_0x0033('0x25')],'active':_0x1b8127[_0x0033('0x50')][_0x0033('0x51')],'callerid':_0x1b8127[_0x0033('0x50')]['callerid']};}if(_0x1b8127[_0x0033('0x52')]){_0x27bd37['Interval']={'id':_0x1b8127['Interval']['id'],'name':_0x1b8127['Interval'][_0x0033('0x25')]};}var _0x3b8654=md5(JSON[_0x0033('0x53')](_0x27bd37));if(_0x1b8127[_0x0033('0x3')]!==_0x3b8654){_0x1b8127[_0x0033('0x3')]=_0x3b8654;emit(util[_0x0033('0x54')](_0x0033('0x55'),_0x27bd37[_0x0033('0x25')]),_0x0033('0x56'),_0x27bd37);}}}function emitVoiceQueueChannelRemove(_0x28df01){logger['info'](_0x0033('0x57'),JSON[_0x0033('0x53')](_0x28df01));emit(util['format']('voice:queue:%s',_0x28df01['name']),_0x0033('0x58'),_0x28df01);io['emit']('voice_queue_presence:remove',_0x28df01);}function notSendMessagesQueue(_0x21225d){if(_0x21225d[_0x0033('0x59')]){if(_0x21225d[_0x0033('0x4b')]===0x0&&_0x21225d[_0x0033('0x5a')]===0x0){_0x21225d[_0x0033('0x59')]=![];_0x21225d[_0x0033('0x28')]=0x0;_0x21225d[_0x0033('0x5b')]=0x0;_0x21225d[_0x0033('0x4a')]='NOT_ACTIVE';ut['logger'](_0x0033('0x5c'),_0x21225d[_0x0033('0x25')]+_0x0033('0x5d'));}else{_0x21225d[_0x0033('0x4a')]=_0x0033('0x5e');ut[_0x0033('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x21225d['name']+'\x20is\x20deactivated');}emitCampaignPreview(_0x21225d);}}Preview[_0x0033('0x9')][_0x0033('0x21')]=function(){var _0x357a0a=this;setInterval(function(){_0x357a0a[_0x0033('0x60')]();},0x7cf);};Preview[_0x0033('0x9')][_0x0033('0x60')]=function(){var _0x1477ff=this[_0x0033('0xe')];this[_0x0033('0x13')]+=0x1;for(var _0x5b4a64 in _0x1477ff){if(_0x1477ff[_0x0033('0x61')](_0x5b4a64)&&(_0x1477ff[_0x5b4a64][_0x0033('0x62')]===_0x0033('0x63')||_0x1477ff[_0x5b4a64][_0x0033('0x62')]===_0x0033('0x64'))&&_0x1477ff[_0x5b4a64][_0x0033('0x23')]===_0x0033('0x24')){if(this['clockClearZombieChannels']>0x7){this[_0x0033('0x13')]=0x0;this[_0x0033('0x65')]();}}if(_0x1477ff[_0x0033('0x61')](_0x5b4a64)&&_0x1477ff[_0x5b4a64][_0x0033('0x62')]===_0x0033('0x63')&&_0x1477ff[_0x5b4a64][_0x0033('0x23')]===_0x0033('0x24')){if(_0x1477ff[_0x5b4a64][_0x0033('0x32')]){this[_0x0033('0x66')](_0x1477ff[_0x5b4a64]);if(_0x1477ff[_0x5b4a64][_0x0033('0x67')])this[_0x0033('0x68')](_0x1477ff[_0x5b4a64]);}else{notSendMessagesQueue(_0x1477ff[_0x5b4a64]);}}}};Preview[_0x0033('0x9')][_0x0033('0x69')]=function(_0x33af12){var _0x2ce825=this;this[_0x0033('0xd')][_0x0033('0xa')](function(){if(!_[_0x0033('0x6a')](_0x2ce825[_0x0033('0x11')][_0x33af12])){loggerAction[_0x0033('0x6b')]('[clearZombieChannels][talking]',_0x33af12,_0x0033('0x6c'),_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')],_0x0033('0x6e'),JSON[_0x0033('0x53')](_0x2ce825['campaignsPreview'][_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]][_0x0033('0x4b')]),_0x0033('0x6f'),JSON[_0x0033('0x53')](_0x2ce825[_0x0033('0xe')][_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]][_0x0033('0x5a')]),JSON[_0x0033('0x53')](_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x70')]),JSON['stringify'](_[_0x0033('0x71')](_0x2ce825['actions'][_0x33af12],[_0x0033('0x72'),_0x0033('0x73'),'VoiceQueueId','ListId'])));return ami[_0x0033('0x74')]({'action':_0x0033('0x75'),'channel':_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x76')]})[_0x0033('0x77')](function(_0x39de18){if(_0x39de18[_0x0033('0x4a')]===_0x0033('0x78')){setTimeout(function(){if(_0x2ce825['actions'][_0x33af12]){ut[_0x0033('0x79')](_0x2ce825['campaignsPreview'][_0x2ce825['actions'][_0x33af12]['queue']],_0x0033('0x7a'));if(_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x70')]===!![]){ut[_0x0033('0x7b')](_0x2ce825[_0x0033('0xe')][_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]],'[clearZombieChannel]');ut['loggerError'](_0x0033('0x7c')+_0x33af12,_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]);}ut['loggerError'](_0x0033('0x7d')+_0x33af12,_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]);delete _0x2ce825[_0x0033('0x11')][_0x33af12];}},0x2328);}});}});};Preview[_0x0033('0x9')]['clearZombieChannels']=function(){var _0x298c78=this;loggerAction[_0x0033('0x6b')](_0x0033('0x7e'),_[_0x0033('0x7f')](this['actions']));for(var _0xa29bb9 in this[_0x0033('0x11')]){if(_0x298c78['actions'][_0x0033('0x61')](_0xa29bb9)){_0x298c78[_0x0033('0x69')](_0xa29bb9);}}};Preview[_0x0033('0x9')][_0x0033('0x68')]=function(_0x5e9a60){var _0xb8912c=this;rpcDb['getContactRecallMe'](_0x5e9a60['id'],ut[_0x0033('0x80')](this[_0x0033('0x12')]))[_0x0033('0x81')](function(_0x4f95af){if(!_['isNil'](_0x4f95af)){for(var _0x4df190=0x0;_0x4df190<_0x4f95af[_0x0033('0x82')];_0x4df190+=0x1){if(ut[_0x0033('0x83')](_0x4f95af[_0x4df190]['scheduledat'])<_0x5e9a60[_0x0033('0x84')]*0x3c){if(_0x4f95af[_0x4df190][_0x0033('0x85')]&&!_0x4f95af[_0x4df190]['Agent'][_0x0033('0x86')]){_0xb8912c[_0x0033('0x87')](_0x4f95af[_0x4df190]['id'])[_0x0033('0x81')](ut[_0x0033('0x88')](_0x0033('0x89')))[_0x0033('0x77')](ut[_0x0033('0x88')](_0x0033('0x89')));}else{rpcDb['disableContact'](_0x4f95af[_0x4df190]['id']);}}else{var _0x2ce61c=new Action(_0x4f95af[_0x4df190],_0x5e9a60);_0x2ce61c[_0x0033('0x8a')]=moment()[_0x0033('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e9a60[_0x0033('0x3c')]+=0x1;ut[_0x0033('0x8b')](_0x2ce61c,0x17,_0x0033('0x8c'));if(_0x5e9a60[_0x0033('0x8d')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x4f95af[_0x4df190]));rpcDb['createCustomerHistory'](_0x2ce61c,_0x0033('0x8e'));}else{ut[_0x0033('0x8b')](_0x2ce61c,0x16,_0x0033('0x8f'));rpcDb[_0x0033('0x90')](_0x2ce61c,'[HistoryRecallClose]');rpcDb[_0x0033('0x91')](_0x2ce61c,_0x0033('0x92'));}}}}})[_0x0033('0x77')](ut[_0x0033('0x88')](_0x0033('0x93')));};Preview[_0x0033('0x9')]['setMessage']=function(_0x2ff3b4){_0x2ff3b4['sendMessageOneNotActive']=!![];if(ut[_0x0033('0x94')](_0x2ff3b4[_0x0033('0x29')])){_0x2ff3b4[_0x0033('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x2ff3b4[_0x0033('0x32')])){_0x2ff3b4[_0x0033('0x4a')]=_0x0033('0x95');}else if(!this['isTrunkReachable'](_0x2ff3b4[_0x0033('0x50')])){if(!this[_0x0033('0x96')](_0x2ff3b4[_0x0033('0x97')])){_0x2ff3b4[_0x0033('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2ff3b4['message']=_0x0033('0x98');}}else{_0x2ff3b4[_0x0033('0x4a')]=_0x0033('0x98');}emitCampaignPreview(_0x2ff3b4);};Preview['prototype'][_0x0033('0x99')]=function(_0x43561a,_0x15e9fb,_0x4f8a25){var _0x5004ba=this;var _0x61d585=this[_0x0033('0x11')][_0x15e9fb];var _0x46462b=this['campaignsPreview'][_0x61d585['queue']];var _0x564f43;var _0x1ec947=![];var _0xdba9e0=0x2;var _0x4dce31=0x3;if(_0x46462b){switch(_0x4f8a25){case'1':_0x46462b[_0x0033('0x3a')]+=0x1;_0x61d585[_0x0033('0x9a')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut['totalGlobal'](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x0,_0x0033('0x9c'));ami[_0x0033('0x22')]('custom:agentnosuchnumber',ut[_0x0033('0x9d')](_0x61d585,_0x0033('0x9e')));rpcDb[_0x0033('0x90')](_0x61d585,'[callProgressDetectingCustomer][logNoSuch]');_0x5004ba['verifyAdditionalPhones'](_0x61d585,'0',_0x46462b)[_0x0033('0x81')](function(_0x55e224){_0x1ec947=_0x55e224[_0x0033('0x9f')]==0x1;_0xdba9e0=_0x46462b[_0x0033('0xa0')];_0x4dce31=_0x46462b[_0x0033('0xa1')];if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut['cloneAction'](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x61d585[_0x0033('0x9a')]>=_0x46462b['dialNoSuchNumberMaxRetry']){rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xa5'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0x9a'),_0x46462b[_0x0033('0xa0')]),_0x61d585[_0x0033('0xa8')],_0x61d585['activeContact']);}}delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];}else{_0x61d585[_0x0033('0x9a')]++;logger[_0x0033('0x6b')](_0x0033('0xaa'),_0x61d585[_0x0033('0x9a')]);logger[_0x0033('0x6b')]('id',_0x61d585[_0x0033('0xab')]);_0x5004ba[_0x0033('0xac')]({'id':_0x61d585[_0x0033('0xab')],'field':{'countnosuchnumberretry':_0x61d585[_0x0033('0x9a')]}})['then'](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xad'):var _0x54565d=moment()[_0x0033('0x54')](_0x0033('0xae'));_0x61d585[_0x0033('0xaf')]=_0x54565d;_0x61d585[_0x0033('0xb0')]=_0x54565d;_0x61d585[_0x0033('0x70')]=!![];_0x46462b[_0x0033('0x5a')]+=0x1;logger[_0x0033('0x6b')](_0x0033('0xb1'),_0x61d585[_0x0033('0xb2')],_0x0033('0xb3'),_0x46462b[_0x0033('0x25')],_0x0033('0x6f'),_0x46462b['pTalking']);ami[_0x0033('0x22')](_0x0033('0xb4'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xb5'),this[_0x0033('0xe')][_0x61d585[_0x0033('0x6d')]]));if(_0x46462b['acw']){ami[_0x0033('0x22')](_0x0033('0xb6'),ut[_0x0033('0xb7')](_0x61d585));}break;case'16':ami[_0x0033('0x22')](_0x0033('0xb8'),ut['buildObj'](_0x61d585,_0x0033('0xb9'),this['campaignsPreview'][_0x61d585[_0x0033('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x0033('0x9d')](_0x61d585,'complete'));_0x46462b['outboundAnswerCallsDay']+=0x1;_0x46462b[_0x0033('0x2d')]+=0x1;_0x46462b[_0x0033('0x27')]+=0x1;ut['decrementTalkink'](_0x46462b,_0x0033('0xba'));_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x4,_0x0033('0xbb'));rpcDb[_0x0033('0x90')](_0x61d585,_0x0033('0xbc'));rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xbd'));rpcDb[_0x0033('0xbe')](_0x61d585);_0x46462b['sumDuration']+=_0x61d585[_0x0033('0xbf')];_0x46462b['sumBillable']+=_0x61d585[_0x0033('0xbf')];logger['info'](_0x0033('0xc0'),_0x61d585[_0x0033('0xb2')],_0x0033('0xb3'),_0x46462b[_0x0033('0x25')],_0x0033('0x6f'),_0x46462b[_0x0033('0x5a')]);delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];break;case'BUSY':_0x46462b[_0x0033('0xc1')]+=0x1;_0x61d585[_0x0033('0xc2')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x5,_0x0033('0xc3'));_0xdba9e0=_0x46462b[_0x0033('0xc4')];_0x4dce31=_0x46462b[_0x0033('0xa1')];ami[_0x0033('0x22')]('custom:agentbusy',ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xc5')));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xc6'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'5',_0x46462b)[_0x0033('0x81')](function(_0x181634){_0x1ec947=_0x181634[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,'Global');rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xc9'));}else{if(_0x61d585[_0x0033('0xc2')]>=_0x46462b[_0x0033('0xca')]){rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xc6'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0xc2'),_0x46462b[_0x0033('0xc4')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xc2')]++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585[_0x0033('0xab')],'field':{'countbusyretry':_0x61d585['countbusyretry']}})['then'](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xcd'):_0x46462b[_0x0033('0xce')]+=0x1;_0x61d585[_0x0033('0xcf')]+=0x1;_0x61d585['countglobal']=ut[_0x0033('0xa2')](_0x61d585);ut['logCustomer'](_0x61d585,0x3,_0x0033('0xd0'));_0xdba9e0=_0x46462b[_0x0033('0xd1')];_0x4dce31=_0x46462b[_0x0033('0xa1')];var _0x107f91=ut[_0x0033('0xd2')](_0x61d585,_0x46462b);ami[_0x0033('0x22')]('custom:agentnoanswer',_0x107f91);rpcDb[_0x0033('0x90')](_0x61d585,_0x0033('0xd3'));_0x5004ba['verifyAdditionalPhones'](_0x61d585,'3',_0x46462b)[_0x0033('0x81')](function(_0x525749){_0x1ec947=_0x525749[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut['cloneAction'](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xd4'));}else{if(_0x61d585['countnoanswerretry']>=_0x46462b[_0x0033('0xd5')]){rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xd3'));}else{rpcDb[_0x0033('0xa6')](ut['scheduledAt'](_0x61d585,_0x0033('0xcf'),_0x46462b[_0x0033('0xd1')]),_0x61d585['unlockAgent'],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba[_0x0033('0xac')]({'id':_0x61d585['idContact'],'field':{'countnoanswerretry':_0x61d585[_0x0033('0xcf')]}})['then'](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xd6'):_0x46462b['outboundCongestionCallsDay']+=0x1;_0x61d585[_0x0033('0xd7')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut['totalGlobal'](_0x61d585);ut['logCustomer'](_0x61d585,0x8,_0x0033('0xd8'));_0xdba9e0=_0x46462b[_0x0033('0xd9')];_0x4dce31=_0x46462b[_0x0033('0xa1')];ami[_0x0033('0x22')](_0x0033('0xda'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xdb')));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xdc'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'8',_0x46462b)[_0x0033('0x81')](function(_0x5bf83b){_0x1ec947=_0x5bf83b[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xdd'));}else{if(_0x61d585['countcongestionretry']>=_0x46462b[_0x0033('0xde')]){rpcDb['createCustomerFinal'](_0x61d585,_0x0033('0xdc'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,'countcongestionretry',_0x46462b[_0x0033('0xc4')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585['countcongestionretry']++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585[_0x0033('0xab')],'field':{'countcongestionretry':_0x61d585['countcongestionretry']}})[_0x0033('0x81')](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)['then'](function(){});});}});break;case'CANCEL':_0x46462b['outboundRejectCallsDay']+=0x1;_0x61d585[_0x0033('0xdf')]+=0x1;_0x61d585['countglobal']=ut['totalGlobal'](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x14,'AgentReject');_0xdba9e0=_0x46462b[_0x0033('0xe0')];_0x4dce31=_0x46462b[_0x0033('0xa1')];ami[_0x0033('0x22')](_0x0033('0xe1'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xe2')));rpcDb[_0x0033('0x90')](_0x61d585,_0x0033('0xe3'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'20',_0x46462b)['then'](function(_0x3ea5e7){_0x1ec947=_0x3ea5e7[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0x14,'AgentReject');rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xe4'));}else{if(_0x61d585['countagentrejectretry']>=_0x46462b[_0x0033('0xe5')]){rpcDb['createCustomerFinal'](_0x61d585,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0xdf'),_0x46462b[_0x0033('0xe0')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba[_0x0033('0xac')]({'id':_0x61d585[_0x0033('0xab')],'field':{'countnoanswerretry':_0x61d585['countnoanswerretry']}})['then'](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xe6'):_0x46462b[_0x0033('0x3f')]+=0x1;_0x61d585['countabandonedretry']+=0x1;_0x61d585['countglobal']=ut['totalGlobal'](_0x61d585);ut['logCustomer'](_0x61d585,0xb,_0x0033('0xe7'));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xe8'));_0x5004ba['verifyAdditionalPhones'](_0x61d585,'11',_0x46462b)[_0x0033('0x81')](function(_0x594451){_0x1ec947=_0x594451[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut['totalGlobal'](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xe8'));}else{if(_0x61d585[_0x0033('0xe9')]>=_0x46462b[_0x0033('0xea')]){rpcDb['createCustomerFinal'](_0x61d585,_0x0033('0xe8'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0xeb'),_0x46462b[_0x0033('0xec')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585[_0x0033('0xab')],'field':{'countnoanswerretry':_0x61d585[_0x0033('0xcf')]}})[_0x0033('0x81')](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case'18':_0x46462b[_0x0033('0x3e')]+=0x1;_0x61d585[_0x0033('0xed')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut['totalGlobal'](_0x61d585);ut['logCustomer'](_0x61d585,0x12,_0x43561a['cause-txt']||_0x43561a[_0x0033('0xee')]);ami[_0x0033('0x22')](_0x0033('0xef'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xf0')));rpcDb[_0x0033('0x90')](_0x61d585,'[callProgressDetectingCustomer][hangupInAMD]');_0x5004ba[_0x0033('0xc7')](_0x61d585,'18',_0x46462b)[_0x0033('0x81')](function(_0x5bc70e){_0x1ec947=_0x5bc70e[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0x12,_0x0033('0xa4'));rpcDb['createCustomerFinal'](_0x564f43,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xf1'));}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba[_0x0033('0xac')]({'id':_0x61d585[_0x0033('0xab')],'field':{'countnoanswerretry':_0x61d585['countnoanswerretry']}})[_0x0033('0x81')](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];break;case'19':_0x46462b[_0x0033('0x3e')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x13,_0x43561a[_0x0033('0xf2')]||_0x43561a[_0x0033('0xee')]);ami[_0x0033('0x22')]('custom:amd',ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xf0')));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xf3'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'18',_0x46462b)[_0x0033('0x81')](function(_0x2ad279){_0x1ec947=_0x2ad279[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut['cloneAction'](_0x61d585,0xf,_0x0033('0xa4'));rpcDb['createCustomerFinal'](_0x564f43,_0x0033('0xf3'));}else{rpcDb['createCustomerFinal'](_0x61d585,_0x0033('0xf3'));}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585['idContact'],'field':{'countnoanswerretry':_0x61d585[_0x0033('0xcf')]}})[_0x0033('0x81')](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)['then'](function(){});});}});delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];break;default:if(_0x61d585[_0x0033('0x70')]){ut[_0x0033('0x7b')](_0x46462b,_0x0033('0xf4'));ut[_0x0033('0xf5')](_0x0033('0xf6')+_0x46462b['name'],_0x43561a);}_0x46462b[_0x0033('0x3e')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut['logCustomer'](_0x61d585,0xc,_0x43561a['cause-txt']||_0x43561a[_0x0033('0xee')]);_0xdba9e0=_0x46462b['dialAgentRejectRetryFrequency'];_0x4dce31=_0x46462b[_0x0033('0xa1')];rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xf7'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'20',_0x46462b)[_0x0033('0x81')](function(_0x280969){_0x1ec947=_0x280969['additional']==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xf8'));}else{rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xf8'));}delete this['actions'][_0x43561a[_0x0033('0xa9')]];}else{_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});}});}if(!(_0x61d585[_0x0033('0x70')]&&_0x4f8a25==='16')){ut[_0x0033('0x79')](_0x46462b,_0x0033('0xf9'));logger[_0x0033('0x6b')](_0x0033('0xfa'),_0x61d585[_0x0033('0xb2')],_0x0033('0xb3'),_0x46462b[_0x0033('0x25')],_0x0033('0x6e'),_0x46462b['originated']);}if(_0x4f8a25!==_0x0033('0xad')){delete this['actions'][_0x43561a[_0x0033('0xa9')]];delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xfb')]];}}};Preview[_0x0033('0x9')]['callProgressDetectingAgent']=function(_0x198e83,_0x5aac98,_0x488559){if(_[_0x0033('0xfc')](_0x5aac98)&&'object'!==typeof _0x5aac98){return;}if(_[_0x0033('0xfc')](_0x488559)&&_0x0033('0xfd')!==typeof _0x488559){return;}switch(_0x488559[_0x0033('0xfe')]){case'0':ut[_0x0033('0xff')](_0x198e83,0x0,'NoSuchNumber');rpcDb[_0x0033('0x100')](_0x198e83,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0033('0xff')](_0x198e83,0x3,_0x0033('0xd0'));rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x101'));break;case'5':ut[_0x0033('0xff')](_0x198e83,0x5,_0x0033('0xc3'));rpcDb[_0x0033('0x100')](_0x198e83,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0033('0xff')](_0x198e83,0x8,'Congestion');rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x102'));break;case'22':ut[_0x0033('0xff')](_0x198e83,0x16,_0x0033('0x103'));rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x104'));break;default:ut[_0x0033('0xff')](_0x198e83,0xc,_0x488559['reason']);rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x102'));}ut[_0x0033('0x79')](_0x5aac98,_0x0033('0x105'));logger[_0x0033('0x6b')]('[originated][decrement][callProgressDetectingAgent]',_0x198e83[_0x0033('0xb2')],'\x20Queue',_0x5aac98['name'],_0x0033('0x6e'),_0x5aac98['originated']);delete this[_0x0033('0x11')][_0x198e83[_0x0033('0xb2')]];};Preview[_0x0033('0x9')][_0x0033('0xc7')]=function(_0x38c749,_0x4d98b9,_0x59020b){return Promise[_0x0033('0x106')]()[_0x0033('0x81')](cmHopperAdditionalPhone[_0x0033('0xc7')](_0x38c749,_0x4d98b9,_0x59020b))[_0x0033('0x77')](logger[_0x0033('0x6b')](_0x0033('0x107')));};Preview[_0x0033('0x9')][_0x0033('0xcc')]=function(_0x3bb179,_0x4ca4b0,_0x241207){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x0033('0xcc')](_0x3bb179,_0x4ca4b0,_0x241207))[_0x0033('0x77')](logger[_0x0033('0x6b')](_0x0033('0x108')));};Preview[_0x0033('0x9')][_0x0033('0xac')]=function(_0x3f1eec){return Promise[_0x0033('0x106')]()[_0x0033('0x81')](cmHopperAdditionalPhone[_0x0033('0xac')](_0x3f1eec))[_0x0033('0x77')](logger[_0x0033('0x6b')](_0x0033('0x109')));};Preview[_0x0033('0x9')][_0x0033('0x10a')]=function(_0x2223bd,_0x4ed7c8,_0x2465e6,_0x4749cf,_0x59fa55){var _0x4be0ea=this;return new Promise(function(_0x5b5349,_0x3fd6f3){if(_['isNil'](_0x4ed7c8)||_[_0x0033('0x6a')](_0x4ed7c8['Contact'])||_['isNil'](_0x4ed7c8['phone'])||_[_0x0033('0x6a')](_0x4ed7c8[_0x0033('0x10b')])){_0x3fd6f3(ut[_0x0033('0x4a')](_0x0033('0x10c'),_0x4749cf,_0x59fa55));return;}var _0x5b8c2b=uuid['v4']();var _0x17efb9=_0x4be0ea[_0x0033('0xe')][_0x4ed7c8[_0x0033('0x6c')][_0x0033('0x25')]];var _0x7fa88c=_0x2465e6?_0x4be0ea[_0x0033('0x12')][_0x2465e6]['id']:undefined;_0x4be0ea[_0x0033('0x11')][_0x5b8c2b]=new Action(_0x4ed7c8,_0x17efb9,_0x5b8c2b,_0x2465e6,_0x7fa88c);var _0x1c82c3=_0x4be0ea[_0x0033('0x11')][_0x5b8c2b];_0x1c82c3[_0x0033('0xa8')]=_0x4749cf;_0x1c82c3[_0x0033('0xcb')]=_0x59fa55;_0x1c82c3[_0x0033('0x10d')]=_0x2465e6;if(_[_0x0033('0x10e')](_0x2223bd)){_0x4be0ea['execCall'](_0x1c82c3,_0x17efb9,_0x4ed7c8,_0x2465e6)[_0x0033('0x81')](function(_0x117f64){logger['info'](_0x0033('0x10f'),_0x0033('0x110')+_0x1c82c3[_0x0033('0x6d')]+_0x0033('0x111')+_0x1c82c3[_0x0033('0xab')],JSON[_0x0033('0x53')](_0x117f64));ami[_0x0033('0x22')](_0x0033('0x112'),ut[_0x0033('0x9d')](_0x1c82c3,_0x0033('0x113'),_0x4be0ea[_0x0033('0xe')][_0x1c82c3[_0x0033('0x6d')]]));_0x5b5349(ut[_0x0033('0x4a')](_0x0033('0x114')));})[_0x0033('0x77')](function(_0x50716b){ut[_0x0033('0x5f')](_0x0033('0x115'),_0x50716b);_0x3fd6f3(ut[_0x0033('0x4a')]('Call\x20failed',_0x4749cf,_0x59fa55));});}else{_0x17efb9[_0x0033('0x37')]+=0x1;ut[_0x0033('0x116')](_0x1c82c3);rpcDb[_0x0033('0x117')](_0x1c82c3,'[Blacklist][error]');delete _0x4be0ea[_0x0033('0x11')][_0x5b8c2b];_0x3fd6f3(ut[_0x0033('0x4a')]('Contact\x20in\x20black\x20List',_0x4749cf,_0x59fa55));}});};Preview[_0x0033('0x9')][_0x0033('0x96')]=function(_0x1ad5d2){return!_[_0x0033('0x6a')](_0x1ad5d2)&&!_['isNil'](_0x1ad5d2[_0x0033('0x25')])&&!_[_0x0033('0x6a')](_0x1ad5d2[_0x0033('0x51')])&&_0x1ad5d2[_0x0033('0x51')]&&!_[_0x0033('0x6a')](this[_0x0033('0x10')][util['format']('SIP/%s',_0x1ad5d2[_0x0033('0x25')])])&&!_[_0x0033('0x6a')](this['trunks'][util[_0x0033('0x54')]('SIP/%s',_0x1ad5d2['name'])][_0x0033('0x75')])&&(this[_0x0033('0x10')][util[_0x0033('0x54')](_0x0033('0x118'),_0x1ad5d2[_0x0033('0x25')])][_0x0033('0x75')]===_0x0033('0x119')||this['trunks'][util[_0x0033('0x54')](_0x0033('0x118'),_0x1ad5d2[_0x0033('0x25')])][_0x0033('0x75')]==='unmonitored');};Preview[_0x0033('0x9')][_0x0033('0x87')]=function(_0x3baafe,_0x229f89){var _0x3f5452=this;return new Promise(function(_0x134bde,_0x5e8774){_0x3f5452[_0x0033('0x11a')](_0x3baafe,_0x229f89)[_0x0033('0x81')](function(_0x59dc3a){_0x134bde(_[_0x0033('0x71')](_0x59dc3a,[_0x0033('0x4a')]));})[_0x0033('0x77')](function(_0x2c90c9){if(_0x2c90c9['unlock']){rpcDb['unlockContact'](_0x3baafe);}if(_0x2c90c9['active']){rpcDb['disableContact'](_0x3baafe);}_0x5e8774(_[_0x0033('0x71')](_0x2c90c9,[_0x0033('0x4a')]));});});};Preview[_0x0033('0x9')]['execRun']=function(_0x30b062,_0x47d18c){var _0x2f50c9=this;return new Promise(function(_0x163b55,_0x8aa5b0){var _0x327169,_0x51ffb1;rpcDb[_0x0033('0x11b')](_0x30b062)['then'](function(_0x408e93){if(!_[_0x0033('0x6a')](_0x408e93[0x0])){_0x51ffb1=_0x408e93[0x0][_0x0033('0x11c')]?![]:!![];_0x327169=_0x408e93[0x0]['recallme']?!![]:![];_0x327169=_0x47d18c?!![]:_0x327169;}var _0x1af52a=_0x2f50c9[_0x0033('0x11d')](_0x408e93);if(_0x1af52a[_0x0033('0x11e')]){rpcDb[_0x0033('0x11f')](_[_0x0033('0x71')](_0x408e93[0x0],['VoiceQueueId',_0x0033('0x120')]))[_0x0033('0x81')](function(_0x92f025){_0x2f50c9[_0x0033('0x10a')](_0x92f025,_0x408e93[0x0],_0x47d18c,_0x51ffb1,_0x327169)[_0x0033('0x81')](function(_0x456b1f){_0x163b55(_0x456b1f);})['catch'](function(_0x21b526){_0x8aa5b0(_0x21b526);});})['catch'](function(_0x106e65){ut[_0x0033('0x5f')](_0x0033('0x121'),_0x106e65);_0x8aa5b0(ut[_0x0033('0x4a')](_0x0033('0x122'),_0x51ffb1,_0x327169));});}else{_0x8aa5b0(ut[_0x0033('0x4a')](_0x1af52a[_0x0033('0x4a')],_0x51ffb1,_0x327169));}})['catch'](function(_0x4f4462){ut[_0x0033('0x5f')](_0x0033('0x123'),_0x4f4462);_0x8aa5b0(ut['message'](_0x0033('0x122'),![],!![]));});});};Preview[_0x0033('0x9')][_0x0033('0x11d')]=function(_0x183b04){if(_[_0x0033('0x6a')](_0x183b04)||_[_0x0033('0x10e')](_0x183b04)||!_[_0x0033('0x6a')](_0x183b04[0x0]['Agent'])&&_[_0x0033('0x6a')](_0x183b04[0x0][_0x0033('0x85')]['name'])){ut['logger'](_0x0033('0x124'),_0x183b04);return{'isValid':![],'message':_0x0033('0x125')};}var _0x19c704=this[_0x0033('0xe')][_0x183b04[0x0][_0x0033('0x6c')][_0x0033('0x25')]];_0x19c704[_0x0033('0x4a')]=_0x0033('0x98');if(_['isNil'](_0x19c704)){ut[_0x0033('0x5f')](_0x0033('0x126'),_0x19c704);return{'isValid':![],'message':_0x0033('0x127')};}if(!this['isTrunkReachable'](_0x19c704[_0x0033('0x50')])){ut[_0x0033('0x5f')](_0x0033('0x128'),_0x0033('0x129')+_0x19c704[_0x0033('0x25')]+_0x0033('0x12a'));if(!this['isTrunkReachable'](_0x19c704[_0x0033('0x97')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x19c704[_0x0033('0x25')]+_0x0033('0x12b'));return{'isValid':![],'message':_0x0033('0x12c')};}}if(!ut['isActive'](_0x19c704[_0x0033('0x32')])){ut[_0x0033('0x5f')]('[Preview][validateContact][Campaign\x20Active]',_0x19c704[_0x0033('0x25')]+_0x0033('0x12d'));return{'isValid':![],'message':_0x0033('0x129')+_0x19c704[_0x0033('0x25')]+_0x0033('0x12d')};}return{'isValid':!![],'message':_0x0033('0x12e')};};Preview['prototype']['execCall']=function(_0x2d3681,_0x1d6734,_0xd8945a,_0x46fb4d){var _0x304602=this;return new Promise(function(_0x3ed6f5,_0x2b1e05){var _0x3e3220=_0x2d3681[_0x0033('0xb2')];var _0xfe92f3=_0x304602[_0x0033('0x96')](_0x1d6734[_0x0033('0x50')])?util['format'](_0x0033('0x12f'),_0x1d6734['Trunk'][_0x0033('0x25')],_[_0x0033('0x6a')](_0x1d6734[_0x0033('0x130')])?'':_0x1d6734['dialPrefix'][_0x0033('0x131')]()||'',_0x1d6734[_0x0033('0x132')]>0x0?_0xd8945a[_0x0033('0x120')][_0x0033('0x133')](_0x1d6734[_0x0033('0x132')]):_0xd8945a[_0x0033('0x120')]):util[_0x0033('0x54')](_0x0033('0x12f'),_[_0x0033('0x6a')](_0x1d6734[_0x0033('0x97')])?_0x1d6734[_0x0033('0x50')][_0x0033('0x25')]:_0x1d6734[_0x0033('0x97')][_0x0033('0x25')],_['isNil'](_0x1d6734[_0x0033('0x130')])?'':_0x1d6734[_0x0033('0x130')][_0x0033('0x131')]()||'',_0x1d6734[_0x0033('0x132')]>0x0?_0xd8945a[_0x0033('0x120')]['substring'](_0x1d6734[_0x0033('0x132')]):_0xd8945a[_0x0033('0x120')]);var _0x24fcd3=_0x304602[_0x0033('0x96')](_0x1d6734[_0x0033('0x50')])?ut[_0x0033('0x134')](_0x1d6734[_0x0033('0x50')][_0x0033('0x135')],_0x1d6734[_0x0033('0x136')],_0x1d6734['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0033('0x137')](_0x1d6734[_0x0033('0x33')],_0x1d6734[_0x0033('0x138')]):_0x1d6734['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x0033('0x6a')](_0x1d6734[_0x0033('0x97')])?_0x1d6734[_0x0033('0x50')][_0x0033('0x135')]:_0x1d6734[_0x0033('0x97')][_0x0033('0x135')],_0x1d6734[_0x0033('0x136')],_0x1d6734[_0x0033('0x138')]>0x0?ut[_0x0033('0x137')](_0x1d6734[_0x0033('0x33')],_0x1d6734[_0x0033('0x138')]):_0x1d6734[_0x0033('0x33')]);if(_0x24fcd3){_0x2d3681[_0x0033('0x139')]=ut['extractCalleridName'](_0x24fcd3);_0x2d3681['originatecalleridnum']=ut[_0x0033('0x13a')](_0x24fcd3);}var _0x58c4f6=ut['addVariables'](_0x1d6734,_0xd8945a,_0xfe92f3,_0x24fcd3,_0x3e3220,_0x2d3681);_[_0x0033('0x13b')](_0x2d3681,ut['toLowerVariables'](_0x58c4f6));_0x2d3681[_0x0033('0x8a')]=moment()['format'](_0x0033('0xae'));_0x1d6734[_0x0033('0x13c')]=_0x58c4f6;ami['Action'](ut['variablesAction'](_0x2d3681,_0x1d6734,_0x58c4f6,_0x2d3681[_0x0033('0xcb')],_0x46fb4d))['then'](function(_0x19a8e3){_0x1d6734[_0x0033('0x4b')]+=0x1;logger[_0x0033('0x6b')](_0x0033('0x13d'),_0x3e3220,_0x0033('0xb3'),_0x1d6734['name'],_0x0033('0x6e'),_0x1d6734['originated']);_0x3ed6f5(_0x19a8e3);})[_0x0033('0x77')](function(_0x393afc){ut[_0x0033('0xff')](_0x2d3681,0xe,_0x0033('0x13e'));rpcDb[_0x0033('0x100')](_0x2d3681,_0x0033('0x13f'));_0x2b1e05(_0x393afc);});});};Preview[_0x0033('0x9')][_0x0033('0x140')]=function(_0x444c66){if(this[_0x0033('0x11')][_0x444c66[_0x0033('0xa9')]]){this[_0x0033('0x11')][_0x444c66[_0x0033('0xa9')]][_0x0033('0x76')]=_0x444c66[_0x0033('0x76')];}};Preview[_0x0033('0x9')]['syncOriginateResponse']=function(_0x1c3ccb){var _0x1c24de=this;var _0x15163d=this[_0x0033('0x11')][_0x1c3ccb[_0x0033('0x141')]];if(_0x15163d){if(_0x15163d[_0x0033('0x10d')]&&this[_0x0033('0x12')][_0x15163d['lookAgent']]){ut[_0x0033('0x142')](_0x15163d,this[_0x0033('0x12')][_0x15163d[_0x0033('0x10d')]][_0x0033('0x25')],this[_0x0033('0x12')][_0x15163d['lookAgent']]['id']);}var _0x56fb21=_[_0x0033('0x143')](_0x15163d);_0x56fb21[_0x0033('0xaf')]=moment()['format'](_0x0033('0xae'));var _0x5dd4ac=_0x1c24de[_0x0033('0xe')][_0x15163d['queue']];if(ut[_0x0033('0x144')](_0x1c3ccb[_0x0033('0x145')])){if(_0x15163d[_0x0033('0xa8')]){rpcDb[_0x0033('0x146')](_0x15163d[_0x0033('0xab')]);}if(_0x15163d[_0x0033('0xcb')]){rpcDb[_0x0033('0x147')](_0x15163d[_0x0033('0xab')]);}ami[_0x0033('0x22')](_0x0033('0x148'),ut['buildObj'](_0x15163d,_0x0033('0x149'),this['campaignsPreview'][_0x15163d[_0x0033('0x6d')]]));this[_0x0033('0x14a')](_0x56fb21,_0x5dd4ac,_0x1c3ccb);}else{_0x15163d['starttime']=moment()[_0x0033('0x54')](_0x0033('0xae'));ut[_0x0033('0xff')](_0x56fb21,0x4,_0x0033('0xbb'));rpcDb['createAgentHistory'](_0x56fb21,_0x0033('0x14b'));}}};Preview[_0x0033('0x9')][_0x0033('0x16')]=function(_0x1653c9){var _0x49e464=this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]];var _0x2d5f4d;if(_0x49e464){_0x2d5f4d=this[_0x0033('0xe')][_0x49e464[_0x0033('0x6d')]];logger[_0x0033('0x6b')]('[syncHangup][talking]',_0x1653c9[_0x0033('0xa9')],'\x20Queue',_0x2d5f4d['name'],'pTalking:\x20',_0x2d5f4d[_0x0033('0x5a')]);}if(this[_0x0033('0x11')][_0x1653c9['linkedid']]&&_0x1653c9[_0x0033('0xa9')]!==_0x1653c9[_0x0033('0xb2')]){if(_0x1653c9['cause']==='16'&&this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]][_0x0033('0x70')]){this['callProgressDetectingCustomer'](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}else if(this['actions'][_0x1653c9['linkedid']]['dialAnswer']){logger[_0x0033('0x6b')]('[syncHangup][talking][cause]',_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')],_0x0033('0xb3'),_0x2d5f4d['name'],_0x0033('0x6f'),_0x2d5f4d[_0x0033('0x5a')]);this[_0x0033('0x99')](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}}else if(_0x49e464&&_[_0x0033('0x6a')](_0x49e464['statedesc'])&&_0x2d5f4d[_0x0033('0x14d')]&&_0x1653c9['linkedid']===_0x1653c9[_0x0033('0xb2')]&&_[_0x0033('0x6a')](_0x1653c9[_0x0033('0xfe')])&&_0x1653c9['cause']==='16'&&_0x1653c9[_0x0033('0x14e')]==='6'&&_[_0x0033('0xfc')](_0x49e464[_0x0033('0x14f')])){if(_0x49e464[_0x0033('0xa8')]){rpcDb['unlockContact'](_0x49e464[_0x0033('0xab')]);}if(_0x49e464[_0x0033('0xcb')]){rpcDb['disableContact'](_0x49e464['idContact']);}_0x1653c9[_0x0033('0xfe')]='22';this[_0x0033('0x14a')](_0x49e464,_0x2d5f4d,_0x1653c9);}else if(_0x49e464&&_0x49e464['transfer']){if(_0x1653c9['cause']==='16'&&this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]]['dialAnswer']){logger[_0x0033('0x6b')](_0x0033('0x150'),_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')],_0x0033('0xb3'),_0x2d5f4d['name'],_0x0033('0x6f'),_0x2d5f4d['pTalking']);this[_0x0033('0x99')](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}else if(this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]]['dialAnswer']){logger[_0x0033('0x6b')]('[syncHangup][talking][cause]',_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')],'\x20Queue',_0x2d5f4d[_0x0033('0x25')],_0x0033('0x6f'),_0x2d5f4d['pTalking']);this[_0x0033('0x99')](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}}};Preview[_0x0033('0x9')][_0x0033('0x1b')]=function(_0x5abf4d){if(this[_0x0033('0x11')][_0x5abf4d[_0x0033('0xfb')]]&&_0x5abf4d['destlinkedid']!==_0x5abf4d[_0x0033('0x151')]){this[_0x0033('0x99')](_0x5abf4d,_0x5abf4d[_0x0033('0xfb')],_0x5abf4d['dialstatus']);}};Preview[_0x0033('0x9')]['syncHangupRequest']=function(_0x3e4d06){if(this['actions'][_0x3e4d06['linkedid']]&&_0x3e4d06['linkedid']!==_0x3e4d06['uniqueid']&&!this[_0x0033('0x11')][_0x3e4d06[_0x0033('0xa9')]][_0x0033('0x70')]){if(_0x3e4d06[_0x0033('0x14c')]==='1'){this[_0x0033('0x99')](_0x3e4d06,_0x3e4d06['linkedid'],_0x3e4d06[_0x0033('0x14c')]);}}};Preview[_0x0033('0x9')][_0x0033('0x152')]=function(_0x597359,_0x29b573,_0xf5ecfa){if(this[_0x0033('0x11')][_0x597359]){if(_[_0x0033('0x6a')](this[_0x0033('0x11')][_0x597359][_0x0033('0x13c')])){this[_0x0033('0x11')][_0x597359][_0x0033('0x13c')]={};}this[_0x0033('0x11')][_0x597359][_0x0033('0x13c')][_0x29b573]=_0xf5ecfa;}};Preview[_0x0033('0x9')][_0x0033('0x1d')]=function(_0x38f648){try{if(!_[_0x0033('0x6a')](_0x38f648)){if(ut['filterKey'](_[_0x0033('0x153')](_0x38f648['variable'])[0x0])){this[_0x0033('0x152')](_0x38f648[_0x0033('0xb2')],_[_0x0033('0x153')](_0x38f648['variable'])[0x0],_0x38f648[_0x0033('0x154')]);}}}catch(_0x4c571b){logger[_0x0033('0x155')](_0x0033('0x156'),util[_0x0033('0x157')](_0x4c571b,{'showHidden':![],'depth':null}));}};Preview[_0x0033('0x9')][_0x0033('0x1e')]=function(_0x35a1a9){if(_0x35a1a9){if(this['actions'][_0x35a1a9[_0x0033('0x158')]]){this[_0x0033('0x11')][_0x35a1a9['transfertargetlinkedid']][_0x0033('0x14f')]=!![];}}};Preview[_0x0033('0x9')][_0x0033('0x20')]=function(_0x10fe2c){if(_0x10fe2c){if(this['actions'][_0x10fe2c[_0x0033('0x159')]]){this['actions'][_0x10fe2c[_0x0033('0x159')]][_0x0033('0x14f')]=!![];}}};module[_0x0033('0x15a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index eb230ee..055d337 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 _0xa8a5=['then','createHistory','catch','[createHistory]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','resolve'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xa8a5,0x19c));var _0x5a8a=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xa8a5[_0x541ea6];return _0x3c3e84;};'use strict';var util=require(_0x5a8a('0x0'));var BPromise=require('bluebird');var logger=require(_0x5a8a('0x1'))(_0x5a8a('0x2'));var _=require(_0x5a8a('0x3'));var cmHopper=require(_0x5a8a('0x4'));var cmHopperFinal=require(_0x5a8a('0x5'));var cmHopperHistory=require(_0x5a8a('0x6'));var cmHopperBlack=require(_0x5a8a('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5a8a('0x8'));function loggerCatch(_0x4bafc6){return function(_0x29e75f){logger[_0x5a8a('0x9')](_0x4bafc6,util[_0x5a8a('0xa')](_0x29e75f,{'showHidden':![],'depth':null}));};}function create(_0x13b3c2){return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](cmHopperHistory[_0x5a8a('0xd')](_0x13b3c2))[_0x5a8a('0xe')](loggerCatch(_0x5a8a('0xf')));}function createAgent(_0x4fea18){return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](agentReportPreview[_0x5a8a('0xd')](_0x4fea18))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2ae8a1){return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](cmHopper['moveContactManagedDialer'](_0x2ae8a1,!![]))[_0x5a8a('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x5a8a('0x10')]=function(_0xd216c3){return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](cmHopperBlack[_0x5a8a('0x10')](_0xd216c3))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x2b43bc){return BPromise[_0x5a8a('0xb')]()['then'](cmHopper[_0x5a8a('0x11')](_0x2b43bc))['catch'](loggerCatch(_0x5a8a('0x12')));};exports[_0x5a8a('0xd')]=function(_0x4ac807,_0x1acacf){create(_0x4ac807)[_0x5a8a('0xe')](loggerCatch(_0x1acacf));moveContact(_0x4ac807)[_0x5a8a('0xe')](loggerCatch(_0x1acacf));};exports[_0x5a8a('0x13')]=function(_0x59d37d,_0x6815b2){createAgent(_0x59d37d)[_0x5a8a('0xe')](loggerCatch(_0x6815b2));};exports[_0x5a8a('0x14')]=function(_0x19c7de,_0x4f21cf){create(_0x19c7de)[_0x5a8a('0xe')](loggerCatch(_0x4f21cf));};exports[_0x5a8a('0x15')]=function(_0x7abcb9,_0x23968f){moveContact(_0x7abcb9)[_0x5a8a('0xe')](loggerCatch(_0x23968f));};exports['rescheduleContact']=function(_0x2b88fc,_0x1ed5db,_0x19eb95){if(_0x1ed5db){_0x2b88fc['UserId']=null;}if(_0x19eb95){_0x2b88fc[_0x5a8a('0x16')]=![];}return BPromise[_0x5a8a('0xb')]()['then'](cmHopper[_0x5a8a('0x17')](_0x2b88fc))['catch'](loggerCatch(_0x5a8a('0x18')));};exports['countReScheduled']=function(_0x3454f0){return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](cmHopper[_0x5a8a('0x19')](_0x3454f0))[_0x5a8a('0xe')](loggerCatch(_0x5a8a('0x1a')));};exports[_0x5a8a('0x1b')]=function(_0x297669){return BPromise['resolve']()[_0x5a8a('0xc')](cmHopper[_0x5a8a('0x1b')]({'UserId':null},_0x297669,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x5a8a('0x1c')]=function(_0x3fcb19){return BPromise['resolve']()[_0x5a8a('0xc')](cmHopper[_0x5a8a('0x1b')]({'active':![]},_0x3fcb19,0x1))[_0x5a8a('0xe')](loggerCatch(_0x5a8a('0x1d')));};exports['crateCustomerReportQueue']=function(_0x20e897){var _0x33fd2c={};_0x33fd2c[_0x5a8a('0x1e')]=_0x20e897[_0x5a8a('0x1e')];_0x33fd2c[_0x5a8a('0x1f')]=_0x20e897[_0x5a8a('0x1f')];_0x33fd2c[_0x5a8a('0x20')]=_0x20e897[_0x5a8a('0x20')];_0x33fd2c['calleridname']=_0x20e897[_0x5a8a('0x21')];_0x33fd2c[_0x5a8a('0x22')]=_0x20e897[_0x5a8a('0x22')];_0x33fd2c[_0x5a8a('0x23')]=_0x20e897['answertime'];_0x33fd2c[_0x5a8a('0x24')]=_0x20e897[_0x5a8a('0x25')];_0x33fd2c[_0x5a8a('0x26')]=0x1;_0x33fd2c['queuecallercompleteAt']=_0x20e897[_0x5a8a('0x27')];_0x33fd2c[_0x5a8a('0x28')]=_0x20e897[_0x5a8a('0x29')];_0x33fd2c['context']='from-sip';_0x33fd2c[_0x5a8a('0x2a')]=_0x5a8a('0x2b');_0x33fd2c[_0x5a8a('0x2c')]=0x0;_0x33fd2c[_0x5a8a('0x2d')]=0x1;_0x33fd2c['lastAssignedTo']=_0x20e897[_0x5a8a('0x29')];_0x33fd2c[_0x5a8a('0x2e')]=_0x5a8a('0x2f');return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](voiceQueueReport['create'](_0x33fd2c))[_0x5a8a('0xe')](loggerCatch(_0x5a8a('0x30')));};exports[_0x5a8a('0x31')]=function(_0x381aea,_0x369a85){return BPromise['resolve']()[_0x5a8a('0xc')](cmHopper['getContactRecallMe'](_0x381aea,_0x369a85))[_0x5a8a('0xe')](loggerCatch(_0x5a8a('0x32')));};exports[_0x5a8a('0x33')]=function(_0x4325eb){return BPromise[_0x5a8a('0xb')]()[_0x5a8a('0xc')](cmHopper[_0x5a8a('0x17')](_0x4325eb,!![],!![]))[_0x5a8a('0xe')](loggerCatch(_0x5a8a('0x34')));}; \ No newline at end of file +var _0x2861=['[voiceQueueReport]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','create'];(function(_0x27c3f0,_0x198aa2){var _0x11e51c=function(_0x2a48ec){while(--_0x2a48ec){_0x27c3f0['push'](_0x27c3f0['shift']());}};_0x11e51c(++_0x198aa2);}(_0x2861,0x10c));var _0x1286=function(_0x7a68b8,_0x3b74d7){_0x7a68b8=_0x7a68b8-0x0;var _0x4cfd30=_0x2861[_0x7a68b8];return _0x4cfd30;};'use strict';var util=require('util');var BPromise=require(_0x1286('0x0'));var logger=require('../../../config/logger')(_0x1286('0x1'));var _=require(_0x1286('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x1286('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1286('0x4'));var voiceQueueRt=require(_0x1286('0x5'));var agentReportPreview=require(_0x1286('0x6'));var voiceQueueReport=require(_0x1286('0x7'));function loggerCatch(_0x2f9971){return function(_0x430e7c){logger[_0x1286('0x8')](_0x2f9971,util[_0x1286('0x9')](_0x430e7c,{'showHidden':![],'depth':null}));};}function create(_0x46e789){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopperHistory['createHistory'](_0x46e789))[_0x1286('0xc')](loggerCatch(_0x1286('0xd')));}function createAgent(_0x2763d9){return BPromise[_0x1286('0xa')]()['then'](agentReportPreview[_0x1286('0xe')](_0x2763d9))[_0x1286('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x16f5ab){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0xf')](_0x16f5ab,!![]))[_0x1286('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x1286('0x10')]=function(_0x2d7dc9){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopperBlack[_0x1286('0x10')](_0x2d7dc9))[_0x1286('0xc')](loggerCatch(_0x1286('0x11')));};exports[_0x1286('0x12')]=function(_0x42cbf6){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0x12')](_0x42cbf6))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x1286('0xe')]=function(_0x1088aa,_0x2e302d){create(_0x1088aa)['catch'](loggerCatch(_0x2e302d));moveContact(_0x1088aa)[_0x1286('0xc')](loggerCatch(_0x2e302d));};exports[_0x1286('0x13')]=function(_0x273669,_0x19d48c){createAgent(_0x273669)['catch'](loggerCatch(_0x19d48c));};exports[_0x1286('0x14')]=function(_0x54ef19,_0x5e3064){create(_0x54ef19)['catch'](loggerCatch(_0x5e3064));};exports[_0x1286('0x15')]=function(_0x5d8f33,_0x2f69c0){moveContact(_0x5d8f33)['catch'](loggerCatch(_0x2f69c0));};exports[_0x1286('0x16')]=function(_0x1c934e,_0x822658,_0xaec8aa){if(_0x822658){_0x1c934e[_0x1286('0x17')]=null;}if(_0xaec8aa){_0x1c934e[_0x1286('0x18')]=![];}return BPromise[_0x1286('0xa')]()['then'](cmHopper[_0x1286('0x16')](_0x1c934e))['catch'](loggerCatch(_0x1286('0x19')));};exports[_0x1286('0x1a')]=function(_0x5f2916){return BPromise[_0x1286('0xa')]()['then'](cmHopper['countReScheduled'](_0x5f2916))[_0x1286('0xc')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x414347){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper['unlockContact']({'UserId':null},_0x414347,0x1))[_0x1286('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x1286('0x1b')]=function(_0x2f4423){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0x1c')]({'active':![]},_0x2f4423,0x1))[_0x1286('0xc')](loggerCatch(_0x1286('0x1d')));};exports[_0x1286('0x1e')]=function(_0x3aadd6){var _0x40d990={};_0x40d990[_0x1286('0x1f')]=_0x3aadd6[_0x1286('0x1f')];_0x40d990[_0x1286('0x20')]=_0x3aadd6[_0x1286('0x20')];_0x40d990[_0x1286('0x21')]=_0x3aadd6[_0x1286('0x21')];_0x40d990['calleridname']=_0x3aadd6[_0x1286('0x22')];_0x40d990[_0x1286('0x23')]=_0x3aadd6['queue'];_0x40d990[_0x1286('0x24')]=_0x3aadd6['answertime'];_0x40d990[_0x1286('0x25')]=_0x3aadd6[_0x1286('0x26')];_0x40d990[_0x1286('0x27')]=0x1;_0x40d990['queuecallercompleteAt']=_0x3aadd6[_0x1286('0x28')];_0x40d990[_0x1286('0x29')]=_0x3aadd6[_0x1286('0x2a')];_0x40d990[_0x1286('0x2b')]=_0x1286('0x2c');_0x40d990['exten']=_0x1286('0x2d');_0x40d990[_0x1286('0x2e')]=0x0;_0x40d990[_0x1286('0x2f')]=0x1;_0x40d990['lastAssignedTo']=_0x3aadd6[_0x1286('0x2a')];_0x40d990[_0x1286('0x30')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x1286('0x31')](_0x40d990))[_0x1286('0xc')](loggerCatch(_0x1286('0x32')));};exports['getContactRecallMe']=function(_0x20f98b,_0x30e598){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper['getContactRecallMe'](_0x20f98b,_0x30e598))[_0x1286('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x1286('0x33')]=function(_0x284529){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0x16')](_0x284529,!![],!![]))[_0x1286('0xc')](loggerCatch(_0x1286('0x34')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index f5dfe8c..5c10f91 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 _0xaba0=['string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','scheduledAt','active','scheduledat','minutes','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','calleridnum','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','keys','variables','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined'];(function(_0x2153a6,_0xe90466){var _0x3b9a59=function(_0x33dd9a){while(--_0x33dd9a){_0x2153a6['push'](_0x2153a6['shift']());}};_0x3b9a59(++_0xe90466);}(_0xaba0,0x1aa));var _0x0aba=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaba0[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x0aba('0x0'));var _=require(_0x0aba('0x1'));var moment=require(_0x0aba('0x2'));var logger=require(_0x0aba('0x3'))(_0x0aba('0x4'));var ipAgi=process['env'][_0x0aba('0x5')]||'127.0.0.1';function getSeconds(_0x105ba3,_0xeb3b9e){var _0x501592=moment(_0x105ba3)[_0x0aba('0x6')](0x0);var _0x5185d6=moment(_0xeb3b9e)['milliseconds'](0x0);return _0x501592[_0x0aba('0x7')](_0x5185d6,_0x0aba('0x8'));}exports[_0x0aba('0x9')]=function(_0x36671b){return function(_0x5c55da){logger[_0x0aba('0xa')](_0x36671b,util[_0x0aba('0xb')](_0x5c55da,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x565e3d,_0x5a0ecc){logger[_0x0aba('0xc')](_0x565e3d,util['inspect'](_0x5a0ecc,{'showHidden':![],'depth':null}));};exports[_0x0aba('0xd')]=function(_0x45bbe4,_0x358aba){logger[_0x0aba('0xa')](_0x45bbe4,util[_0x0aba('0xb')](_0x358aba,{'showHidden':![],'depth':null}));};exports[_0x0aba('0xe')]=function(_0x13553f){return function(_0x3ad7e0){logger[_0x0aba('0xc')](_0x13553f,util[_0x0aba('0xb')](_0x3ad7e0,{'showHidden':![],'depth':null}));};};exports[_0x0aba('0xf')]=function(_0x2dabcb,_0x12f49a,_0x1d4efe){return{'message':_0x2dabcb,'unlock':_0x12f49a,'active':_0x1d4efe};};exports[_0x0aba('0x10')]=function(_0x5de493,_0x796b00,_0x3509b1){if(!_[_0x0aba('0x11')](_0x3509b1)&&_0x0aba('0x12')===typeof _0x3509b1&&!_[_0x0aba('0x13')](_0x3509b1)){if(!_['isUndefined'](_0x796b00)&&_0x0aba('0x12')===typeof _0x796b00&&!_[_0x0aba('0x13')](_0x796b00)){return util[_0x0aba('0x14')]('\x22%s\x22\x20<%s>',_0x796b00,_0x3509b1);}return util[_0x0aba('0x14')](_0x0aba('0x15'),_0x3509b1,_0x3509b1);}if(!_[_0x0aba('0x11')](_0x5de493)&&_0x0aba('0x12')===typeof _0x5de493&&!_['isEmpty'](_0x5de493)){return _0x5de493;}return _0x0aba('0x16');};exports[_0x0aba('0x17')]=function(_0x2fdf1b){if(_[_0x0aba('0x18')](_0x2fdf1b)){return![];}return _0x2fdf1b;};exports[_0x0aba('0x19')]=function(_0xd6e19c,_0x15039c,_0x38656c,_0x111609,_0x3c5ff6,_0x440e36){var _0x39ff6f={'XMD-QUEUE':_0x15039c['Queue']?_0x15039c[_0x0aba('0x1a')][_0x0aba('0x1b')]:'','XMD-CALLERID':_0x111609,'XMD-CALLERID-PREVIEW':_0x440e36?util[_0x0aba('0x14')](_0x0aba('0x15'),_0x440e36[_0x0aba('0x1c')],_0x440e36['calleridnum']):_0x111609,'XMD-DIALID':_0x3c5ff6,'XMD-CONTACTID':_0x15039c['ContactId'],'XMD-CDRTYPE':_0x0aba('0x1d'),'CALLERID(all)':_0x111609,'XMD-VOICEQUEUEID':_0x15039c['VoiceQueueId'],'XMD-DIALCHANNEL':_0x38656c,'XMD-DIALTIMEOUT':_0xd6e19c[_0x0aba('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x0aba('0x14')](_0x0aba('0x1f'),_0xd6e19c['dialQueueProject2']?'g':'',_[_0x0aba('0x13')](_0xd6e19c[_0x0aba('0x20')])?'':_0x0aba('0x21')),'XMD-DIALURL':_0xd6e19c[_0x0aba('0x22')]||'','XMD-AGI':_0xd6e19c[_0x0aba('0x23')]?util[_0x0aba('0x14')](_0x0aba('0x24'),ipAgi,_0xd6e19c[_0x0aba('0x23')]):_0x0aba('0x25'),'XMD-AGIAFTER':_0xd6e19c['dialQueueProject2']?util[_0x0aba('0x14')](_0x0aba('0x24'),ipAgi,_0xd6e19c[_0x0aba('0x26')]):_0x0aba('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x440e36?_0x440e36[_0x0aba('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x440e36?_0x440e36[_0x0aba('0x28')]:'','XMD-DESTINATION':_0x0aba('0x29'),'SIPADDHEADER':_0x0aba('0x2a')};if(!_[_0x0aba('0x13')](_0xd6e19c[_0x0aba('0x20')])){_0x39ff6f[util[_0x0aba('0x14')]('%s',_0x0aba('0x2b'))]=_0xd6e19c['monitor_format'];_0x39ff6f[util[_0x0aba('0x14')]('%s',_0x0aba('0x2c'))]=_0x3c5ff6;}if(_0x15039c&&_0x15039c[_0x0aba('0x2d')]){for(var _0x109b85 in _0x15039c[_0x0aba('0x2d')]){if(_0x15039c[_0x0aba('0x2d')]['hasOwnProperty'](_0x109b85)){if(!_[_0x0aba('0x18')](_0x15039c['Contact'][_0x109b85])&&_0x109b85!=='id'&&_0x109b85!==_0x0aba('0x2e')&&_0x109b85!==_0x0aba('0x2f')&&_0x109b85!==_0x0aba('0x30')){_0x39ff6f[util[_0x0aba('0x14')](_0x0aba('0x31'),_0x0aba('0x32'),_[_0x0aba('0x33')](_0x109b85))]=_0x15039c[_0x0aba('0x2d')][_0x109b85];}}}}return _0x39ff6f;};exports[_0x0aba('0x34')]=function(_0xe42b56){var _0x19838d={};for(var _0x53f3aa in _0xe42b56){if(_0xe42b56[_0x0aba('0x35')](_0x53f3aa)){_0x19838d[util[_0x0aba('0x14')]('%s',_[_0x0aba('0x36')](_0x53f3aa))]=_0xe42b56[_0x53f3aa];}}return{'variables':_0x19838d};};exports[_0x0aba('0x37')]=function(_0x3905a0,_0x435dd7){if(!_[_0x0aba('0x18')](_0x3905a0)){if(_0x3905a0[_0x0aba('0x35')](_0x0aba('0x38'))){if(_0x3905a0['originated']>0x0){_0x3905a0[_0x0aba('0x38')]-=0x1;}else{logger[_0x0aba('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x435dd7);}}}else{logger[_0x0aba('0xa')](_0x0aba('0x39'),_0x435dd7);}};exports[_0x0aba('0x3a')]=function(_0x3708da){var _0x152cac=moment()[_0x0aba('0x14')](_0x0aba('0x3b'));_0x3708da['state']=0xd;_0x3708da[_0x0aba('0x3c')]=_0x0aba('0x3d');_0x3708da[_0x0aba('0x3e')]=_0x152cac;_0x3708da[_0x0aba('0x3f')]=_0x152cac;_0x3708da[_0x0aba('0x40')]=_0x152cac;};exports[_0x0aba('0x41')]=function(_0x384ef7,_0x4352d3,_0x2a1780){var _0x17aea2=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x384ef7[_0x0aba('0x42')]=_0x4352d3;_0x384ef7['statedesc']=_0x2a1780;_0x384ef7[_0x0aba('0x3f')]=_0x17aea2;_0x384ef7[_0x0aba('0x43')]=getSeconds(_0x384ef7[_0x0aba('0x3f')],_0x384ef7[_0x0aba('0x3e')]);};exports[_0x0aba('0x44')]=function(_0x4616e3,_0x53ce00,_0x5f2fe1){_0x4616e3[_0x0aba('0x45')]=_0x53ce00;_0x4616e3['UserId']=_0x5f2fe1;};exports[_0x0aba('0x46')]=function(_0x4c8a9c,_0x4eef8e,_0x412bae){var _0x4eebc0=moment()['format'](_0x0aba('0x3b'));_0x4c8a9c[_0x0aba('0x42')]=_0x4eef8e;_0x4c8a9c[_0x0aba('0x3c')]=_0x412bae;_0x4c8a9c[_0x0aba('0x3f')]=_0x4c8a9c[_0x0aba('0x3f')]?_0x4c8a9c[_0x0aba('0x3f')]:_0x4eebc0;_0x4c8a9c[_0x0aba('0x40')]=_0x4c8a9c['endtime']?_0x4c8a9c[_0x0aba('0x40')]:_0x4eebc0;_0x4c8a9c[_0x0aba('0x43')]=getSeconds(_0x4c8a9c[_0x0aba('0x3f')]||0x0,_0x4c8a9c['starttime']||0x0);_0x4c8a9c[_0x0aba('0x47')]=_0x4c8a9c[_0x0aba('0x48')]?getSeconds(_0x4c8a9c[_0x0aba('0x40')],_0x4c8a9c[_0x0aba('0x48')]):0x0;};exports[_0x0aba('0x49')]=function(_0x237431){return _0x237431===_0x0aba('0x4a');};exports[_0x0aba('0x4b')]=function(_0x1dde7d,_0xd5bb30,_0x45118e,_0x3f7820,_0x483437){var _0x4aeb86=_0x3f7820?_0x0aba('0x4c'):_0x1dde7d[_0x0aba('0x1c')];_0x4aeb86=_0x483437?_0x0aba('0x4d'):_0x4aeb86;return{'actionid':_0x1dde7d[_0x0aba('0x4e')],'action':'originate','channel':_0x1dde7d[_0x0aba('0x4f')],'callerid':util['format'](_0x0aba('0x15'),_0x4aeb86,_0x1dde7d['calleridnum']),'Exten':_0x0aba('0x29'),'Context':_0x0aba('0x50'),'Priority':'1','variable':_0x45118e,'timeout':(_0xd5bb30[_0x0aba('0x51')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1dde7d[_0x0aba('0x4e')]};};exports[_0x0aba('0x52')]=function(_0x102874){return _0x102874[_0x0aba('0x53')]+_0x102874[_0x0aba('0x54')]+_0x102874[_0x0aba('0x55')]+_0x102874['countagentrejectretry']+_0x102874[_0x0aba('0x56')];};exports[_0x0aba('0x57')]=function(_0x318ee){var _0x53f063=_['clone'](_0x318ee);_0x53f063[_0x0aba('0x42')]=0xf;_0x53f063[_0x0aba('0x3c')]='Global';return _0x53f063;};exports[_0x0aba('0x58')]=function(_0x5d4fbf,_0x3ba5bb,_0x1b41f4){var _0x169f5d={};_0x169f5d[_0x3ba5bb]=_0x5d4fbf[_0x3ba5bb];_0x169f5d[_0x0aba('0x59')]=![];_0x169f5d[_0x0aba('0x5a')]=moment()['add'](_0x1b41f4,_0x0aba('0x5b'))[_0x0aba('0x14')](_0x0aba('0x3b'));_0x169f5d[_0x0aba('0x5c')]=_0x5d4fbf[_0x0aba('0x5c')];_0x169f5d[_0x0aba('0x5d')]=_0x5d4fbf['ListId'];_0x169f5d[_0x0aba('0x5e')]=_0x5d4fbf[_0x0aba('0x5e')]||undefined;return _0x169f5d;};exports['decrementTalkink']=function(_0x2a12e5,_0x49c6b5){if(!_[_0x0aba('0x18')](_0x2a12e5)){if(_0x2a12e5['pTalking']>0x0){_0x2a12e5[_0x0aba('0x5f')]-=0x1;}else{logger[_0x0aba('0xa')](_0x49c6b5,_0x0aba('0x60'));}}else{logger['error'](_0x49c6b5,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x4d8354){if(_0x4d8354<=0x0){return!![];}return![];};function buildObj(_0x6b9896,_0x12ae60,_0x238fe1){_0x6b9896[_0x0aba('0x61')]=_0x12ae60;_0x6b9896[_0x0aba('0x1b')]=_0x6b9896[_0x0aba('0x62')];_0x6b9896[_0x0aba('0x63')]=_0x6b9896[_0x0aba('0x4f')];_0x6b9896['motionChannel']=_0x0aba('0x64');if(_0x238fe1){_0x6b9896[_0x0aba('0x65')]=_0x238fe1[_0x0aba('0x65')];}return _0x6b9896;}exports['buildObj']=buildObj;exports[_0x0aba('0x66')]=function(_0x598e97){var _0x45dfd9={};_0x45dfd9['queue']=_0x598e97[_0x0aba('0x62')];_0x45dfd9[_0x0aba('0x63')]=_0x598e97[_0x0aba('0x4f')];_0x45dfd9[_0x0aba('0x4e')]=_0x598e97[_0x0aba('0x4e')];return _0x45dfd9;};exports[_0x0aba('0x67')]=function(_0x40da5a){var _0x207f01=[];for(var _0x2c7216 in _0x40da5a){if(_0x40da5a[_0x0aba('0x35')](_0x2c7216)){if(!_['isNil'](_0x40da5a[_0x2c7216])&&_0x40da5a[_0x2c7216][_0x0aba('0x42')]===_0x0aba('0x68')&&_0x40da5a[_0x2c7216][_0x0aba('0x69')]===_0x0aba('0x6a')){_0x207f01['push'](_0x40da5a[_0x2c7216]['id']);}}}return _0x207f01;};exports[_0x0aba('0x6b')]=function(_0x34ce24){var _0x34491d=moment()['milliseconds'](0x0);var _0x438a5a=moment(_0x34ce24)['milliseconds'](0x0);return _0x34491d[_0x0aba('0x7')](_0x438a5a,_0x0aba('0x8'));};exports[_0x0aba('0x6c')]=function(_0x31f68d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x31f68d[_0x0aba('0x5c')],'ListId':_0x31f68d['ListId'],'VoiceQueueId':_0x31f68d['VoiceQueueId']||undefined,'CampaignId':_0x31f68d[_0x0aba('0x6d')]||undefined};};exports[_0x0aba('0x6e')]=function(_0x182ff5){if(_0x182ff5===_0x0aba('0x4e')||_0x182ff5===_0x0aba('0x6f')||_0x182ff5===_0x0aba('0x62')||_0x182ff5===_0x0aba('0x70')||_0x182ff5===_0x0aba('0x71')||_0x182ff5==='dialAnswer'||_0x182ff5===_0x0aba('0x45')||_0x182ff5==='channelAgent'||_0x182ff5===_0x0aba('0x1c')||_0x182ff5===_0x0aba('0x59')||_0x182ff5===_0x0aba('0x72')||_0x182ff5===_0x0aba('0x5a')||_0x182ff5===_0x0aba('0x53')||_0x182ff5==='countcongestionretry'||_0x182ff5===_0x0aba('0x55')||_0x182ff5===_0x0aba('0x73')||_0x182ff5===_0x0aba('0x74')||_0x182ff5===_0x0aba('0x75')||_0x182ff5===_0x0aba('0x76')||_0x182ff5===_0x0aba('0x77')||_0x182ff5===_0x0aba('0x5c')||_0x182ff5===_0x0aba('0x5d')||_0x182ff5===_0x0aba('0x78')||_0x182ff5==='VoiceQueueId'||_0x182ff5===_0x0aba('0x79')||_0x182ff5===_0x0aba('0x7a')||_0x182ff5==='xmd-queue'||_0x182ff5==='xmd-phone'||_0x182ff5===_0x0aba('0x7b')||_0x182ff5===_0x0aba('0x7c')||_0x182ff5===_0x0aba('0x7d')||_0x182ff5==='xmd-dialoptions'||_0x182ff5==='xmd-dialid'||_0x182ff5==='xmd-dialchannel'||_0x182ff5===_0x0aba('0x7e')||_0x182ff5==='xmd-cdrtype'||_0x182ff5==='xmd-callerid'||_0x182ff5===_0x0aba('0x7f')||_0x182ff5===_0x0aba('0x80')||_0x182ff5==='rtpaudioqos'||_0x182ff5===_0x0aba('0x81')||_0x182ff5==='rtpaudioqosjitter'||_0x182ff5===_0x0aba('0x82')||_0x182ff5===_0x0aba('0x83')||_0x182ff5===_0x0aba('0x84')||_0x182ff5===_0x0aba('0x85')||_0x182ff5==='rtpaudioqosrttbridged'||_0x182ff5===_0x0aba('0x86')||_0x182ff5===_0x0aba('0x81')||_0x182ff5==='rtpaudioqosjitter'||_0x182ff5===_0x0aba('0x82')||_0x182ff5===_0x0aba('0x83')||_0x182ff5===_0x0aba('0x84')||_0x182ff5===_0x0aba('0x85')||_0x182ff5===_0x0aba('0x87')||_0x182ff5===_0x0aba('0x88')||_0x182ff5===_0x0aba('0x89')||_0x182ff5===_0x0aba('0x42')||_0x182ff5===_0x0aba('0x3c')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4712ca,_0x375303){var _0x2032e0,_0x881700,_0x139844;if(_0x375303<=0x0){_0x375303=0x1;}_0x2032e0=new RegExp(_0x0aba('0x8a')+_0x375303+'}$');_0x881700=Math[_0x0aba('0x8b')](0xa,_0x375303-0x1);_0x139844=Math[_0x0aba('0x8b')](0xa,_0x375303)-0x1;return util[_0x0aba('0x14')]('%s',_[_0x0aba('0x8c')](_0x4712ca,_0x2032e0,_[_0x0aba('0x8d')](_0x881700,_0x139844)));};exports[_0x0aba('0x8e')]=function(_0x186324){var _0x4e6314=_0x186324[_0x0aba('0x8f')](/"(.*?)"/);return _0x4e6314?_0x4e6314[0x1]:_0x186324;};exports['extractCalleridNumber']=function(_0x1177ed){var _0x358c93=_0x1177ed[_0x0aba('0x8f')](/<(.*?)>/);return _0x358c93?_0x358c93[0x1]:_0x1177ed;};function buildNoAnswerEventPayload(_0x112abb,_0x55325e){var _0xbd727d=buildObj(_0x112abb,'noanswer');if(!_['isEmpty'](_0x55325e['variables'])){Object[_0x0aba('0x90')](_0x55325e[_0x0aba('0x91')])['forEach'](function(_0x268a04){_0xbd727d[_0x268a04[_0x0aba('0x92')]()]=_0x55325e[_0x0aba('0x91')][_0x268a04];});}return _0xbd727d;}exports[_0x0aba('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x096c=['variablesAction','RECALL','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','motionChannel','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','keys','variables','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x096c,0x172));var _0xc096=function(_0x193156,_0x1df464){_0x193156=_0x193156-0x0;var _0x31540f=_0x096c[_0x193156];return _0x31540f;};'use strict';var util=require(_0xc096('0x0'));var _=require(_0xc096('0x1'));var moment=require(_0xc096('0x2'));var logger=require(_0xc096('0x3'))('preview');var ipAgi=process[_0xc096('0x4')]['XCALLY_IP_AGI']||_0xc096('0x5');function getSeconds(_0x255ca8,_0x5984b7){var _0x1afe79=moment(_0x255ca8)[_0xc096('0x6')](0x0);var _0x4e7bbe=moment(_0x5984b7)[_0xc096('0x6')](0x0);return _0x1afe79['diff'](_0x4e7bbe,'seconds');}exports['loggerCatch']=function(_0x246fe2){return function(_0x356069){logger[_0xc096('0x7')](_0x246fe2,util['inspect'](_0x356069,{'showHidden':![],'depth':null}));};};exports[_0xc096('0x8')]=function(_0xe3710f,_0x1de638){logger[_0xc096('0x9')](_0xe3710f,util[_0xc096('0xa')](_0x1de638,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1b7e11,_0x33c45f){logger[_0xc096('0x7')](_0x1b7e11,util[_0xc096('0xa')](_0x33c45f,{'showHidden':![],'depth':null}));};exports[_0xc096('0xb')]=function(_0x6d969e){return function(_0x2e03af){logger[_0xc096('0x9')](_0x6d969e,util[_0xc096('0xa')](_0x2e03af,{'showHidden':![],'depth':null}));};};exports[_0xc096('0xc')]=function(_0x16421a,_0x4639e2,_0x4de6bd){return{'message':_0x16421a,'unlock':_0x4639e2,'active':_0x4de6bd};};exports[_0xc096('0xd')]=function(_0x4a4bb2,_0x39f11d,_0x142f7f){if(!_[_0xc096('0xe')](_0x142f7f)&&_0xc096('0xf')===typeof _0x142f7f&&!_[_0xc096('0x10')](_0x142f7f)){if(!_['isUndefined'](_0x39f11d)&&'string'===typeof _0x39f11d&&!_[_0xc096('0x10')](_0x39f11d)){return util[_0xc096('0x11')](_0xc096('0x12'),_0x39f11d,_0x142f7f);}return util[_0xc096('0x11')](_0xc096('0x12'),_0x142f7f,_0x142f7f);}if(!_[_0xc096('0xe')](_0x4a4bb2)&&_0xc096('0xf')===typeof _0x4a4bb2&&!_[_0xc096('0x10')](_0x4a4bb2)){return _0x4a4bb2;}return'\x22\x22\x20<>';};exports[_0xc096('0x13')]=function(_0x32e1a5){if(_[_0xc096('0x14')](_0x32e1a5)){return![];}return _0x32e1a5;};exports[_0xc096('0x15')]=function(_0x59a761,_0xa591a7,_0x5b8b16,_0x28d7af,_0x1b8363,_0x3e85fa){var _0x171b04={'XMD-QUEUE':_0xa591a7[_0xc096('0x16')]?_0xa591a7[_0xc096('0x16')]['name']:'','XMD-CALLERID':_0x28d7af,'XMD-CALLERID-PREVIEW':_0x3e85fa?util['format'](_0xc096('0x12'),_0x3e85fa[_0xc096('0x17')],_0x3e85fa[_0xc096('0x18')]):_0x28d7af,'XMD-DIALID':_0x1b8363,'XMD-CONTACTID':_0xa591a7[_0xc096('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x28d7af,'XMD-VOICEQUEUEID':_0xa591a7['VoiceQueueId'],'XMD-DIALCHANNEL':_0x5b8b16,'XMD-DIALTIMEOUT':_0x59a761[_0xc096('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xc096('0x11')](_0xc096('0x1b'),_0x59a761['dialQueueProject2']?'g':'',_[_0xc096('0x10')](_0x59a761[_0xc096('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x59a761[_0xc096('0x1d')]||'','XMD-AGI':_0x59a761[_0xc096('0x1e')]?util[_0xc096('0x11')](_0xc096('0x1f'),ipAgi,_0x59a761[_0xc096('0x1e')]):_0xc096('0x20'),'XMD-AGIAFTER':_0x59a761[_0xc096('0x21')]?util[_0xc096('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x59a761['dialQueueProject2']):_0xc096('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x3e85fa?_0x3e85fa[_0xc096('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e85fa?_0x3e85fa[_0xc096('0x23')]:'','XMD-DESTINATION':_0xc096('0x24'),'SIPADDHEADER':_0xc096('0x25')};if(!_[_0xc096('0x10')](_0x59a761[_0xc096('0x1c')])){_0x171b04[util[_0xc096('0x11')]('%s',_0xc096('0x26'))]=_0x59a761['monitor_format'];_0x171b04[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1b8363;}if(_0xa591a7&&_0xa591a7[_0xc096('0x27')]){for(var _0x2f5409 in _0xa591a7['Contact']){if(_0xa591a7[_0xc096('0x27')]['hasOwnProperty'](_0x2f5409)){if(!_[_0xc096('0x14')](_0xa591a7['Contact'][_0x2f5409])&&_0x2f5409!=='id'&&_0x2f5409!=='tags'&&_0x2f5409!=='createdAt'&&_0x2f5409!=='updatedAt'){_0x171b04[util['format'](_0xc096('0x28'),_0xc096('0x29'),_[_0xc096('0x2a')](_0x2f5409))]=_0xa591a7[_0xc096('0x27')][_0x2f5409];}}}}return _0x171b04;};exports[_0xc096('0x2b')]=function(_0x1dc70b){var _0x390eac={};for(var _0x47ebdc in _0x1dc70b){if(_0x1dc70b[_0xc096('0x2c')](_0x47ebdc)){_0x390eac[util[_0xc096('0x11')]('%s',_[_0xc096('0x2d')](_0x47ebdc))]=_0x1dc70b[_0x47ebdc];}}return{'variables':_0x390eac};};exports[_0xc096('0x2e')]=function(_0x2760ec,_0x52a655){if(!_[_0xc096('0x14')](_0x2760ec)){if(_0x2760ec[_0xc096('0x2c')](_0xc096('0x2f'))){if(_0x2760ec['originated']>0x0){_0x2760ec[_0xc096('0x2f')]-=0x1;}else{logger[_0xc096('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x52a655);}}}else{logger['error'](_0xc096('0x30'),_0x52a655);}};exports[_0xc096('0x31')]=function(_0x314b89){var _0x27c0e8=moment()[_0xc096('0x11')](_0xc096('0x32'));_0x314b89[_0xc096('0x33')]=0xd;_0x314b89[_0xc096('0x34')]='Blacklist';_0x314b89[_0xc096('0x35')]=_0x27c0e8;_0x314b89['responsetime']=_0x27c0e8;_0x314b89[_0xc096('0x36')]=_0x27c0e8;};exports['logAgent']=function(_0x51f97c,_0x2e9f69,_0x150499){var _0x545800=moment()[_0xc096('0x11')](_0xc096('0x32'));_0x51f97c[_0xc096('0x33')]=_0x2e9f69;_0x51f97c['statedesc']=_0x150499;_0x51f97c[_0xc096('0x37')]=_0x545800;_0x51f97c[_0xc096('0x38')]=getSeconds(_0x51f97c[_0xc096('0x37')],_0x51f97c[_0xc096('0x35')]);};exports[_0xc096('0x39')]=function(_0x539435,_0x3d97d7,_0x517f48){_0x539435[_0xc096('0x3a')]=_0x3d97d7;_0x539435[_0xc096('0x3b')]=_0x517f48;};exports[_0xc096('0x3c')]=function(_0x15ea8f,_0x50e711,_0x1d1628){var _0x2fb5ae=moment()[_0xc096('0x11')](_0xc096('0x32'));_0x15ea8f[_0xc096('0x33')]=_0x50e711;_0x15ea8f[_0xc096('0x34')]=_0x1d1628;_0x15ea8f[_0xc096('0x37')]=_0x15ea8f['responsetime']?_0x15ea8f[_0xc096('0x37')]:_0x2fb5ae;_0x15ea8f[_0xc096('0x36')]=_0x15ea8f[_0xc096('0x36')]?_0x15ea8f['endtime']:_0x2fb5ae;_0x15ea8f['ringtime']=getSeconds(_0x15ea8f[_0xc096('0x37')]||0x0,_0x15ea8f[_0xc096('0x35')]||0x0);_0x15ea8f[_0xc096('0x3d')]=_0x15ea8f[_0xc096('0x3e')]?getSeconds(_0x15ea8f[_0xc096('0x36')],_0x15ea8f[_0xc096('0x3e')]):0x0;};exports[_0xc096('0x3f')]=function(_0xa2bc88){return _0xa2bc88===_0xc096('0x40');};exports[_0xc096('0x41')]=function(_0x5452c9,_0x29ceae,_0x29e90d,_0x2d78f2,_0x3ea5fc){var _0x32a18d=_0x2d78f2?_0xc096('0x42'):_0x5452c9[_0xc096('0x17')];_0x32a18d=_0x3ea5fc?'BOOKED':_0x32a18d;return{'actionid':_0x5452c9['uniqueid'],'action':_0xc096('0x43'),'channel':_0x5452c9[_0xc096('0x44')],'callerid':util['format'](_0xc096('0x12'),_0x32a18d,_0x5452c9['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xc096('0x45'),'Priority':'1','variable':_0x29e90d,'timeout':(_0x29ceae[_0xc096('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5452c9[_0xc096('0x47')]};};exports[_0xc096('0x48')]=function(_0x45c402){return _0x45c402[_0xc096('0x49')]+_0x45c402[_0xc096('0x4a')]+_0x45c402[_0xc096('0x4b')]+_0x45c402[_0xc096('0x4c')]+_0x45c402[_0xc096('0x4d')];};exports[_0xc096('0x4e')]=function(_0x10ebe2){var _0x40954e=_['clone'](_0x10ebe2);_0x40954e[_0xc096('0x33')]=0xf;_0x40954e[_0xc096('0x34')]=_0xc096('0x4f');return _0x40954e;};exports[_0xc096('0x50')]=function(_0x9527b3,_0x573717,_0x390011){var _0x3d261c={};_0x3d261c[_0x573717]=_0x9527b3[_0x573717];_0x3d261c[_0xc096('0x51')]=![];_0x3d261c[_0xc096('0x52')]=moment()[_0xc096('0x53')](_0x390011,_0xc096('0x54'))[_0xc096('0x11')](_0xc096('0x32'));_0x3d261c[_0xc096('0x19')]=_0x9527b3[_0xc096('0x19')];_0x3d261c[_0xc096('0x55')]=_0x9527b3[_0xc096('0x55')];_0x3d261c[_0xc096('0x56')]=_0x9527b3[_0xc096('0x56')]||undefined;return _0x3d261c;};exports[_0xc096('0x57')]=function(_0x50bcfc,_0x33c36e){if(!_[_0xc096('0x14')](_0x50bcfc)){if(_0x50bcfc[_0xc096('0x58')]>0x0){_0x50bcfc[_0xc096('0x58')]-=0x1;}else{logger[_0xc096('0x7')](_0x33c36e,_0xc096('0x59'));}}else{logger[_0xc096('0x7')](_0x33c36e,_0xc096('0x5a'));}};exports[_0xc096('0x5b')]=function(_0x16501b){if(_0x16501b<=0x0){return!![];}return![];};function buildObj(_0x36ee4a,_0x18d864,_0x4bcd98){_0x36ee4a['lastevent']=_0x18d864;_0x36ee4a[_0xc096('0x5c')]=_0x36ee4a[_0xc096('0x5d')];_0x36ee4a[_0xc096('0x5e')]=_0x36ee4a['channelAgent'];_0x36ee4a[_0xc096('0x5f')]='voice';if(_0x4bcd98){_0x36ee4a['mandatoryDisposition']=_0x4bcd98[_0xc096('0x60')];}return _0x36ee4a;}exports[_0xc096('0x61')]=buildObj;exports['buildAcw']=function(_0x3b7675){var _0x15ebde={};_0x15ebde[_0xc096('0x5d')]=_0x3b7675[_0xc096('0x5d')];_0x15ebde[_0xc096('0x5e')]=_0x3b7675[_0xc096('0x44')];_0x15ebde['uniqueid']=_0x3b7675[_0xc096('0x47')];return _0x15ebde;};exports[_0xc096('0x62')]=function(_0x1529ad){var _0x47349e=[];for(var _0x548e7f in _0x1529ad){if(_0x1529ad['hasOwnProperty'](_0x548e7f)){if(!_['isNil'](_0x1529ad[_0x548e7f])&&_0x1529ad[_0x548e7f][_0xc096('0x33')]===_0xc096('0x63')&&_0x1529ad[_0x548e7f][_0xc096('0x64')]===_0xc096('0x65')){_0x47349e[_0xc096('0x66')](_0x1529ad[_0x548e7f]['id']);}}}return _0x47349e;};exports[_0xc096('0x67')]=function(_0x375bd0){var _0x4c3b1c=moment()[_0xc096('0x6')](0x0);var _0x50ab59=moment(_0x375bd0)['milliseconds'](0x0);return _0x4c3b1c[_0xc096('0x68')](_0x50ab59,_0xc096('0x69'));};exports[_0xc096('0x6a')]=function(_0x35e7f8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x35e7f8[_0xc096('0x19')],'ListId':_0x35e7f8[_0xc096('0x55')],'VoiceQueueId':_0x35e7f8[_0xc096('0x56')]||undefined,'CampaignId':_0x35e7f8[_0xc096('0x6b')]||undefined};};exports[_0xc096('0x6c')]=function(_0x3438d5){if(_0x3438d5===_0xc096('0x47')||_0x3438d5===_0xc096('0x6d')||_0x3438d5===_0xc096('0x5d')||_0x3438d5===_0xc096('0x6e')||_0x3438d5===_0xc096('0x6f')||_0x3438d5===_0xc096('0x70')||_0x3438d5==='membername'||_0x3438d5===_0xc096('0x44')||_0x3438d5===_0xc096('0x17')||_0x3438d5==='active'||_0x3438d5===_0xc096('0x18')||_0x3438d5===_0xc096('0x52')||_0x3438d5==='countbusyretry'||_0x3438d5===_0xc096('0x4a')||_0x3438d5===_0xc096('0x4b')||_0x3438d5==='countglobal'||_0x3438d5===_0xc096('0x71')||_0x3438d5==='callbackuniqueid'||_0x3438d5===_0xc096('0x72')||_0x3438d5==='recallme'||_0x3438d5===_0xc096('0x19')||_0x3438d5===_0xc096('0x55')||_0x3438d5==='UserId'||_0x3438d5===_0xc096('0x56')||_0x3438d5===_0xc096('0x73')||_0x3438d5===_0xc096('0x74')||_0x3438d5===_0xc096('0x75')||_0x3438d5===_0xc096('0x76')||_0x3438d5===_0xc096('0x77')||_0x3438d5===_0xc096('0x78')||_0x3438d5===_0xc096('0x79')||_0x3438d5===_0xc096('0x7a')||_0x3438d5===_0xc096('0x7b')||_0x3438d5===_0xc096('0x7c')||_0x3438d5==='xmd-contactid'||_0x3438d5===_0xc096('0x7d')||_0x3438d5==='xmd-callerid'||_0x3438d5===_0xc096('0x7e')||_0x3438d5===_0xc096('0x7f')||_0x3438d5===_0xc096('0x80')||_0x3438d5==='rtpaudioqosbridged'||_0x3438d5==='rtpaudioqosjitter'||_0x3438d5===_0xc096('0x81')||_0x3438d5===_0xc096('0x82')||_0x3438d5===_0xc096('0x83')||_0x3438d5==='rtpaudioqosrtt'||_0x3438d5===_0xc096('0x84')||_0x3438d5===_0xc096('0x80')||_0x3438d5==='rtpaudioqosbridged'||_0x3438d5==='rtpaudioqosjitter'||_0x3438d5===_0xc096('0x81')||_0x3438d5===_0xc096('0x82')||_0x3438d5===_0xc096('0x83')||_0x3438d5===_0xc096('0x85')||_0x3438d5===_0xc096('0x84')||_0x3438d5===_0xc096('0x86')||_0x3438d5===_0xc096('0x87')||_0x3438d5==='state'||_0x3438d5===_0xc096('0x34')){return![];}return!![];};exports[_0xc096('0x88')]=function(_0x5d2041,_0x530e50){var _0x3c1f82,_0x243f2f,_0x51d2f7;if(_0x530e50<=0x0){_0x530e50=0x1;}_0x3c1f82=new RegExp('\x5cw{0,'+_0x530e50+'}$');_0x243f2f=Math[_0xc096('0x89')](0xa,_0x530e50-0x1);_0x51d2f7=Math['pow'](0xa,_0x530e50)-0x1;return util[_0xc096('0x11')]('%s',_[_0xc096('0x8a')](_0x5d2041,_0x3c1f82,_[_0xc096('0x8b')](_0x243f2f,_0x51d2f7)));};exports['extractCalleridName']=function(_0x30f67e){var _0xb9df35=_0x30f67e[_0xc096('0x8c')](/"(.*?)"/);return _0xb9df35?_0xb9df35[0x1]:_0x30f67e;};exports['extractCalleridNumber']=function(_0x42ef22){var _0x549f3a=_0x42ef22['match'](/<(.*?)>/);return _0x549f3a?_0x549f3a[0x1]:_0x42ef22;};function buildNoAnswerEventPayload(_0x1f493a,_0x242c86){var _0x19d576=buildObj(_0x1f493a,'noanswer');if(!_[_0xc096('0x10')](_0x242c86['variables'])){Object[_0xc096('0x8d')](_0x242c86[_0xc096('0x8e')])['forEach'](function(_0x572906){_0x19d576[_0x572906[_0xc096('0x8f')]()]=_0x242c86[_0xc096('0x8e')][_0x572906];});}return _0x19d576;}exports[_0xc096('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ef9e359..ac0f6fa 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 _0xa66f=['queuepause','reload','voicechannel','voicequeuechannelredirect','string','number','boolean'];(function(_0xff79aa,_0x12b995){var _0x27de0a=function(_0x23881b){while(--_0x23881b){_0xff79aa['push'](_0xff79aa['shift']());}};_0x27de0a(++_0x12b995);}(_0xa66f,0x6d));var _0xfa66=function(_0x1bf8e7,_0x53f0ec){_0x1bf8e7=_0x1bf8e7-0x0;var _0x55f190=_0xa66f[_0x1bf8e7];return _0x55f190;};'use strict';exports['queueadd']={'queue':{'type':_0xfa66('0x0'),'required':!![]},'interface':{'type':_0xfa66('0x0'),'required':!![]},'membername':{'type':_0xfa66('0x0'),'required':!![]},'penalty':{'type':_0xfa66('0x1'),'required':![]},'paused':{'type':_0xfa66('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xfa66('0x0'),'required':!![]},'interface':{'type':_0xfa66('0x0'),'required':!![]}};exports[_0xfa66('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xfa66('0x2')},'reason':{'type':_0xfa66('0x0'),'required':![]}};exports[_0xfa66('0x4')]={'module':{'type':_0xfa66('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xfa66('0x0'),'required':!![]}};exports[_0xfa66('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xfa66('0x0')},'mixmonitorid':{'type':_0xfa66('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xfa66('0x0'),'required':!![]}};exports[_0xfa66('0x6')]={'uniqueid':{'type':_0xfa66('0x0'),'required':!![]},'exten':{'type':_0xfa66('0x0'),'required':!![]},'context':{'type':_0xfa66('0x0')}}; \ No newline at end of file +var _0x0dd6=['number','boolean','queuepause','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x571852,_0x34ae1f){var _0x1ec365=function(_0x398fe5){while(--_0x398fe5){_0x571852['push'](_0x571852['shift']());}};_0x1ec365(++_0x34ae1f);}(_0x0dd6,0x196));var _0x60dd=function(_0x3e9fdb,_0x40622){_0x3e9fdb=_0x3e9fdb-0x0;var _0xf847c4=_0x0dd6[_0x3e9fdb];return _0xf847c4;};'use strict';exports[_0x60dd('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x60dd('0x1'),'required':!![]},'membername':{'type':_0x60dd('0x1'),'required':!![]},'penalty':{'type':_0x60dd('0x2'),'required':![]},'paused':{'type':_0x60dd('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x60dd('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x60dd('0x4')]={'interface':{'type':_0x60dd('0x1'),'required':!![]},'paused':{'type':_0x60dd('0x3')},'reason':{'type':_0x60dd('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x60dd('0x5')]={'uniqueid':{'type':_0x60dd('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x60dd('0x1')},'mixmonitorid':{'type':_0x60dd('0x1')}};exports[_0x60dd('0x6')]={'uniqueid':{'type':_0x60dd('0x1'),'required':!![]}};exports[_0x60dd('0x7')]={'uniqueid':{'type':_0x60dd('0x1'),'required':!![]},'exten':{'type':_0x60dd('0x1'),'required':!![]},'context':{'type':_0x60dd('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index e478ea5..7de7ec2 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 _0x9e8a=['outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','telephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay'];(function(_0x3d12b5,_0x3c47b1){var _0x4724a3=function(_0x54465b){while(--_0x54465b){_0x3d12b5['push'](_0x3d12b5['shift']());}};_0x4724a3(++_0x3c47b1);}(_0x9e8a,0x112));var _0xa9e8=function(_0x43c23b,_0x136f62){_0x43c23b=_0x43c23b-0x0;var _0x3c1613=_0x9e8a[_0x43c23b];return _0x3c1613;};'use strict';var util=require(_0xa9e8('0x0'));var _=require(_0xa9e8('0x1'));var moment=require(_0xa9e8('0x2'));var Agent=require(_0xa9e8('0x3'));var Telephone=require(_0xa9e8('0x4'));var Trunk=require(_0xa9e8('0x5'));var VoiceQueue=require(_0xa9e8('0x6'));var Trigger=require(_0xa9e8('0x7'));var Template=require(_0xa9e8('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa9e8('0x9'));var SugarcrmAccount=require(_0xa9e8('0xa'));var ZohoAccount=require(_0xa9e8('0xb'));var DeskAccount=require(_0xa9e8('0xc'));var VtigerAccount=require(_0xa9e8('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xa9e8('0xe'));var FreshsalesAccount=require(_0xa9e8('0xf'));var FaxAccount=require(_0xa9e8('0x10'));var Realtime=function(){this[_0xa9e8('0x11')]={};this['telephones']={};this[_0xa9e8('0x12')]={};this[_0xa9e8('0x13')]={};this[_0xa9e8('0x14')]={};this[_0xa9e8('0x15')]={};this['templates']={};this[_0xa9e8('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xa9e8('0x17')]={};this[_0xa9e8('0x18')]={};this[_0xa9e8('0x19')]={};this[_0xa9e8('0x1a')]={};this[_0xa9e8('0x1b')]={};this[_0xa9e8('0x1c')]={};this[_0xa9e8('0x1d')]={};this['salesforceAccounts']={};this[_0xa9e8('0x1e')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0xa9e8('0x1f')]={};this[_0xa9e8('0x20')]={};this[_0xa9e8('0x21')]={};};function freeIsNotKey(_0x403645,_0x1c3c3f,_0x2dfef7){var _0x541831=_[_0xa9e8('0x22')](_0x403645,function(_0x5db208,_0x5617e6){return _0x5db208[_0x2dfef7];});for(var _0x524e4e in _0x1c3c3f){if(_0x1c3c3f[_0xa9e8('0x23')](_0x524e4e)){if(!_0x541831[_0x524e4e]){delete _0x1c3c3f[_0x524e4e];}}}}function freeIsNotKeySip(_0x757a54,_0x434ac9){var _0x5ea1bc=_[_0xa9e8('0x22')](_0x757a54,function(_0x29b91b,_0x33b317){return util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x29b91b[_0xa9e8('0x26')]);});for(var _0x266d07 in _0x434ac9){if(_0x434ac9[_0xa9e8('0x23')](_0x266d07)){if(!_0x5ea1bc[_0x266d07]){delete _0x434ac9[_0x266d07];}}}}function freeIsNotKeyAgent(_0x1ee38b,_0x1f9fbb){var _0xb42f29=_['mapKeys'](_0x1ee38b,function(_0x51ee03,_0x40b9ea){var _0x6b6fab=_[_0xa9e8('0x27')](_0x51ee03[_0xa9e8('0x28')])?util[_0xa9e8('0x24')]('SIP/%s',_0x51ee03[_0xa9e8('0x26')]):_0x51ee03['interface'];return _0x6b6fab;});for(var _0x1f2acd in _0x1f9fbb){if(_0x1f9fbb[_0xa9e8('0x23')](_0x1f2acd)){if(!_0xb42f29[_0x1f2acd]){delete _0x1f9fbb[_0x1f2acd];}}}}function clearVoiceCallReports(_0x1739f7){_0x1739f7[_0xa9e8('0x29')]=0x0;_0x1739f7[_0xa9e8('0x2a')]=0x0;_0x1739f7[_0xa9e8('0x2b')]=0x0;_0x1739f7['sumDuration']=0x0;_0x1739f7[_0xa9e8('0x2c')]=0x0;}function clearCampaigns(_0x5bc39b){if(!_[_0xa9e8('0x2d')](_0x5bc39b)){for(var _0x3a7b7a in _0x5bc39b){if(_0x5bc39b['hasOwnProperty'](_0x3a7b7a)){_0x5bc39b[_0x3a7b7a][_0xa9e8('0x2e')]=0x0;_0x5bc39b[_0x3a7b7a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x3a206f){if(!_[_0xa9e8('0x2d')](_0x3a206f)){for(var _0x76ea32 in _0x3a206f){if(_0x3a206f['hasOwnProperty'](_0x76ea32)){_0x3a206f[_0x76ea32][_0xa9e8('0x29')]=0x0;_0x3a206f[_0x76ea32]['answered']=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x2f')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x30')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x2b')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x31')]=0x0;_0x3a206f[_0x76ea32]['sumBillable']=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x32')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x33')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x34')]=0x0;_0x3a206f[_0x76ea32]['outboundCongestionCallsDay']=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x35')]=0x0;_0x3a206f[_0x76ea32]['outboundUnknownCallsDay']=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x36')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x37')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x38')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x39')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x3a')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x3b')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x32')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x3c')]=0x0;_0x3a206f[_0x76ea32][_0xa9e8('0x3d')]=!![];}}}}Realtime[_0xa9e8('0x3e')][_0xa9e8('0x3f')]=function(_0x152387,_0x77b9d5){for(var _0x51ee3b in _0x77b9d5){if(_0x152387[_0xa9e8('0x23')](_0x51ee3b)){_0x152387[_0x51ee3b]=_0x77b9d5[_0x51ee3b];}}};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x40')]=function(){var _0x59c46f=this;return function(_0x49984e){if(_0x49984e){freeIsNotKeyAgent(_0x49984e,_0x59c46f[_0xa9e8('0x11')]);for(var _0x1f3225=0x0,_0x13f80f={},_0xc1b64d={};_0x1f3225<_0x49984e[_0xa9e8('0x41')];_0x1f3225+=0x1){_0x13f80f=_0x49984e[_0x1f3225];var _0x2f906e=_[_0xa9e8('0x27')](_0x13f80f[_0xa9e8('0x28')])?util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x13f80f[_0xa9e8('0x26')]):_0x13f80f[_0xa9e8('0x28')];if(_[_0xa9e8('0x42')](_0x59c46f[_0xa9e8('0x11')][_0x2f906e])){_0x59c46f[_0xa9e8('0x11')][_0x2f906e]=new Agent(_0x13f80f);}else{_0x59c46f[_0xa9e8('0x3f')](_0x59c46f[_0xa9e8('0x11')][_0x2f906e],_0x13f80f);}}}return _0x59c46f[_0xa9e8('0x11')];};};Realtime[_0xa9e8('0x3e')]['initTelephones']=function(){var _0x589a76=this;return function(_0x3b1aef){if(_0x3b1aef){freeIsNotKeySip(_0x3b1aef,_0x589a76['telephones']);for(var _0x42886f=0x0,_0x228335={},_0x1d2dc4={};_0x42886f<_0x3b1aef[_0xa9e8('0x41')];_0x42886f+=0x1){_0x228335=_0x3b1aef[_0x42886f];if(_[_0xa9e8('0x42')](_0x589a76['telephones'][util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x228335[_0xa9e8('0x26')])])){_0x589a76[_0xa9e8('0x43')][util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x228335[_0xa9e8('0x26')])]=new Telephone(_0x228335);}else{_0x589a76[_0xa9e8('0x3f')](_0x589a76[_0xa9e8('0x43')][util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x228335[_0xa9e8('0x26')])],_0x228335);}}}return _0x589a76[_0xa9e8('0x43')];};};Realtime['prototype'][_0xa9e8('0x44')]=function(){var _0x38c83d=this;return function(_0x31c643){if(_0x31c643){freeIsNotKeySip(_0x31c643,_0x38c83d[_0xa9e8('0x12')]);for(var _0x37396c=0x0,_0x4d9c1a={},_0x544a11={};_0x37396c<_0x31c643['length'];_0x37396c+=0x1){_0x4d9c1a=_0x31c643[_0x37396c];if(_[_0xa9e8('0x42')](_0x38c83d[_0xa9e8('0x12')][util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x4d9c1a['name'])])){_0x38c83d[_0xa9e8('0x12')][util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x4d9c1a[_0xa9e8('0x26')])]=new Trunk(_0x4d9c1a);}else{_0x38c83d[_0xa9e8('0x3f')](_0x38c83d[_0xa9e8('0x12')][util[_0xa9e8('0x24')](_0xa9e8('0x25'),_0x4d9c1a[_0xa9e8('0x26')])],_0x4d9c1a);}}}return _0x38c83d['trunks'];};};Realtime['prototype'][_0xa9e8('0x45')]=function(){var _0x4e26e3=this;return function(_0x4e84bb){if(_0x4e84bb){freeIsNotKey(_0x4e84bb,_0x4e26e3[_0xa9e8('0x13')],'name');for(var _0x105e88=0x0,_0x3e198a={},_0x1b89cb={};_0x105e88<_0x4e84bb['length'];_0x105e88+=0x1){_0x3e198a=_0x4e84bb[_0x105e88];if(_[_0xa9e8('0x42')](_0x4e26e3[_0xa9e8('0x13')][_0x3e198a[_0xa9e8('0x26')]])){_0x4e26e3['voiceQueues'][_0x3e198a[_0xa9e8('0x26')]]=new VoiceQueue(_0x3e198a);}else{_0x4e26e3[_0xa9e8('0x3f')](_0x4e26e3['voiceQueues'][_0x3e198a[_0xa9e8('0x26')]],_0x3e198a);}}}return _0x4e26e3['voiceQueues'];};};Realtime['prototype'][_0xa9e8('0x46')]=function(){var _0x4299ab=this;return function(_0x26f10e){if(_0x26f10e){freeIsNotKey(_0x26f10e,_0x4299ab[_0xa9e8('0x14')],'id');for(var _0x11e617=0x0,_0x23d648={},_0x4eee07={};_0x11e617<_0x26f10e[_0xa9e8('0x41')];_0x11e617+=0x1){_0x23d648=_0x26f10e[_0x11e617];if(_[_0xa9e8('0x42')](_0x4299ab[_0xa9e8('0x14')][_0x23d648['id']])){_0x4299ab[_0xa9e8('0x14')][_0x23d648['id']]=new Trigger(_0x23d648);}else{_0x4299ab[_0xa9e8('0x3f')](_0x4299ab[_0xa9e8('0x14')][_0x23d648['id']],_0x23d648);}}}return _0x4299ab[_0xa9e8('0x14')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x47')]=function(){var _0x25f55c=this;return function(_0x1bdd8f){if(_0x1bdd8f){freeIsNotKey(_0x1bdd8f,_0x25f55c[_0xa9e8('0x48')],'id');for(var _0x17341c=0x0,_0x25944f={},_0x2ec75b={};_0x17341c<_0x1bdd8f[_0xa9e8('0x41')];_0x17341c+=0x1){_0x25944f=_0x1bdd8f[_0x17341c];if(_[_0xa9e8('0x42')](_0x25f55c[_0xa9e8('0x48')][_0x25944f['id']])){_0x25f55c[_0xa9e8('0x48')][_0x25944f['id']]=new Template(_0x25944f);}else{_0x25f55c[_0xa9e8('0x3f')](_0x25f55c['templates'][_0x25944f['id']],_0x25944f);}}}return _0x25f55c[_0xa9e8('0x48')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x49')]=function(){var _0x2526cc=this;return function(_0x541c09){if(_0x541c09){freeIsNotKey(_0x541c09,_0x2526cc[_0xa9e8('0x1d')],'id');for(var _0x387ad2=0x0,_0x15ff9b={},_0x160f18={};_0x387ad2<_0x541c09[_0xa9e8('0x41')];_0x387ad2+=0x1){_0x15ff9b=_0x541c09[_0x387ad2];if(_[_0xa9e8('0x42')](_0x2526cc[_0xa9e8('0x1d')][_0x15ff9b['id']])){_0x2526cc['zendeskAccounts'][_0x15ff9b['id']]=new ZendeskAccount(_0x15ff9b);}else{_0x2526cc['mergeFromDatabase'](_0x2526cc[_0xa9e8('0x1d')][_0x15ff9b['id']],_0x15ff9b);}}}return _0x2526cc[_0xa9e8('0x1d')];};};Realtime['prototype'][_0xa9e8('0x4a')]=function(){var _0x14b408=this;return function(_0x5429a6){if(_0x5429a6){freeIsNotKey(_0x5429a6,_0x14b408[_0xa9e8('0x4b')],'id');for(var _0x28af2b=0x0,_0x13f098={},_0x5f14b7={};_0x28af2b<_0x5429a6[_0xa9e8('0x41')];_0x28af2b+=0x1){_0x13f098=_0x5429a6[_0x28af2b];if(_[_0xa9e8('0x42')](_0x14b408[_0xa9e8('0x4b')][_0x13f098['id']])){_0x14b408[_0xa9e8('0x4b')][_0x13f098['id']]=new SalesforceAccount(_0x13f098);}else{_0x14b408['mergeFromDatabase'](_0x14b408['salesforceAccounts'][_0x13f098['id']],_0x13f098);}}}return _0x14b408[_0xa9e8('0x4b')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x4c')]=function(){var _0xb710d7=this;return function(_0x3855d){if(_0x3855d){freeIsNotKey(_0x3855d,_0xb710d7[_0xa9e8('0x4d')],'id');for(var _0x244534=0x0,_0x3787af={},_0x104b37={};_0x244534<_0x3855d['length'];_0x244534+=0x1){_0x3787af=_0x3855d[_0x244534];if(_[_0xa9e8('0x42')](_0xb710d7[_0xa9e8('0x4d')][_0x3787af['id']])){_0xb710d7[_0xa9e8('0x4d')][_0x3787af['id']]=new FreshdeskAccount(_0x3787af);}else{_0xb710d7[_0xa9e8('0x3f')](_0xb710d7['freshdeskAccounts'][_0x3787af['id']],_0x3787af);}}}return _0xb710d7[_0xa9e8('0x4d')];};};Realtime['prototype'][_0xa9e8('0x4e')]=function(){var _0x4723ba=this;return function(_0xd10be4){if(_0xd10be4){freeIsNotKey(_0xd10be4,_0x4723ba[_0xa9e8('0x4f')],'id');for(var _0x2bdc82=0x0,_0x42da3c={},_0x162929={};_0x2bdc82<_0xd10be4[_0xa9e8('0x41')];_0x2bdc82+=0x1){_0x42da3c=_0xd10be4[_0x2bdc82];if(_['isUndefined'](_0x4723ba[_0xa9e8('0x4f')][_0x42da3c['id']])){_0x4723ba[_0xa9e8('0x4f')][_0x42da3c['id']]=new ZohoAccount(_0x42da3c);}else{_0x4723ba[_0xa9e8('0x3f')](_0x4723ba[_0xa9e8('0x4f')][_0x42da3c['id']],_0x42da3c);}}}return _0x4723ba[_0xa9e8('0x4f')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x50')]=function(){var _0x38a199=this;return function(_0x7281dc){if(_0x7281dc){freeIsNotKey(_0x7281dc,_0x38a199[_0xa9e8('0x51')],'id');for(var _0xe390a9=0x0,_0x3e4177={},_0x3f1597={};_0xe390a9<_0x7281dc['length'];_0xe390a9+=0x1){_0x3e4177=_0x7281dc[_0xe390a9];if(_[_0xa9e8('0x42')](_0x38a199[_0xa9e8('0x51')][_0x3e4177['id']])){_0x38a199['deskAccounts'][_0x3e4177['id']]=new DeskAccount(_0x3e4177);}else{_0x38a199[_0xa9e8('0x3f')](_0x38a199['deskAccounts'][_0x3e4177['id']],_0x3e4177);}}}return _0x38a199[_0xa9e8('0x51')];};};Realtime[_0xa9e8('0x3e')]['initSugarcrmAccounts']=function(){var _0x657a15=this;return function(_0x1e9c6e){if(_0x1e9c6e){freeIsNotKey(_0x1e9c6e,_0x657a15[_0xa9e8('0x1e')],'id');for(var _0x42b0e5=0x0,_0x54afda={},_0x17fcf6={};_0x42b0e5<_0x1e9c6e[_0xa9e8('0x41')];_0x42b0e5+=0x1){_0x54afda=_0x1e9c6e[_0x42b0e5];if(_[_0xa9e8('0x42')](_0x657a15[_0xa9e8('0x1e')][_0x54afda['id']])){_0x657a15[_0xa9e8('0x1e')][_0x54afda['id']]=new SugarcrmAccount(_0x54afda);}else{_0x657a15[_0xa9e8('0x3f')](_0x657a15['sugarcrmAccounts'][_0x54afda['id']],_0x54afda);}}}return _0x657a15[_0xa9e8('0x1e')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x52')]=function(){var _0x4429a4=this;return function(_0x4ad491){if(_0x4ad491){freeIsNotKey(_0x4ad491,_0x4429a4[_0xa9e8('0x53')],'id');for(var _0x7f846c=0x0,_0xbe65f7={},_0x5d20e7={};_0x7f846c<_0x4ad491['length'];_0x7f846c+=0x1){_0xbe65f7=_0x4ad491[_0x7f846c];if(_['isUndefined'](_0x4429a4[_0xa9e8('0x53')][_0xbe65f7['id']])){_0x4429a4['vtigerAccounts'][_0xbe65f7['id']]=new VtigerAccount(_0xbe65f7);}else{_0x4429a4[_0xa9e8('0x3f')](_0x4429a4['vtigerAccounts'][_0xbe65f7['id']],_0xbe65f7);}}}return _0x4429a4[_0xa9e8('0x53')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x54')]=function(){var _0x209b86=this;return function(_0x4d8022){if(_0x4d8022){freeIsNotKey(_0x4d8022,_0x209b86[_0xa9e8('0x55')],'id');for(var _0x4ac6c4=0x0,_0x3ffe46={},_0x2f6981={};_0x4ac6c4<_0x4d8022[_0xa9e8('0x41')];_0x4ac6c4+=0x1){_0x3ffe46=_0x4d8022[_0x4ac6c4];if(_[_0xa9e8('0x42')](_0x209b86[_0xa9e8('0x55')][_0x3ffe46['id']])){_0x209b86['servicenowAccounts'][_0x3ffe46['id']]=new ServicenowAccount(_0x3ffe46);}else{_0x209b86[_0xa9e8('0x3f')](_0x209b86[_0xa9e8('0x55')][_0x3ffe46['id']],_0x3ffe46);}}}return _0x209b86['servicenowAccounts'];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x56')]=function(){var _0x11984b=this;return function(_0x388115){if(_0x388115){freeIsNotKey(_0x388115,_0x11984b[_0xa9e8('0x1f')],'id');for(var _0x134e8f=0x0,_0x578acb={},_0x4b81b4={};_0x134e8f<_0x388115[_0xa9e8('0x41')];_0x134e8f+=0x1){_0x578acb=_0x388115[_0x134e8f];if(_['isUndefined'](_0x11984b[_0xa9e8('0x1f')][_0x578acb['id']])){_0x11984b[_0xa9e8('0x1f')][_0x578acb['id']]=new Dynamics365Account(_0x578acb);}else{_0x11984b[_0xa9e8('0x3f')](_0x11984b['dynamics365Accounts'][_0x578acb['id']],_0x578acb);}}}return _0x11984b['dynamics365Accounts'];};};Realtime['prototype'][_0xa9e8('0x57')]=function(){var _0x4e3b0d=this;return function(_0x45e831){if(_0x45e831){freeIsNotKey(_0x45e831,_0x4e3b0d['freshsalesAccounts'],'id');for(var _0x53acc6=0x0,_0x1adb8f={},_0x3d9699={};_0x53acc6<_0x45e831[_0xa9e8('0x41')];_0x53acc6+=0x1){_0x1adb8f=_0x45e831[_0x53acc6];if(_['isUndefined'](_0x4e3b0d['freshsalesAccounts'][_0x1adb8f['id']])){_0x4e3b0d['freshsalesAccounts'][_0x1adb8f['id']]=new FreshsalesAccount(_0x1adb8f);}else{_0x4e3b0d['mergeFromDatabase'](_0x4e3b0d[_0xa9e8('0x20')][_0x1adb8f['id']],_0x1adb8f);}}}return _0x4e3b0d['freshsalesAccounts'];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x58')]=function(){var _0x16c5d1=this;return function(_0x4f3d50){for(var _0x48c216=0x0;_0x48c216<_0x4f3d50[_0xa9e8('0x41')];_0x48c216+=0x1){_[_0xa9e8('0x59')](_0x16c5d1[_0xa9e8('0x13')][_0x4f3d50[_0x48c216]['name']],_0x4f3d50[_0x48c216]);}return _0x16c5d1[_0xa9e8('0x13')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x5a')]=function(){var _0x28c307=this;return function(_0xc81c40){clearVoiceQueues(_0x28c307[_0xa9e8('0x13')]);if(_0xc81c40){_0xc81c40=_[_0xa9e8('0x5b')](_0xc81c40,'uniqueid');for(var _0x7c869f in _0xc81c40){if(_0xc81c40[_0xa9e8('0x23')](_0x7c869f)){var _0x112e79={};for(var _0x1cec6c=0x0;_0x1cec6c<_0xc81c40[_0x7c869f][_0xa9e8('0x41')];_0x1cec6c+=0x1){var _0x3c60f0=_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x5c')];if(_0x28c307['voiceQueues'][_0x3c60f0]){if(_0xc81c40[_0x7c869f][_0x1cec6c]['queuecallerexit']){_0x28c307[_0xa9e8('0x13')][_0x3c60f0]['unmanaged']+=0x1;}if(_0xc81c40[_0x7c869f][_0x1cec6c]['queuecallerabandon']){_0x28c307[_0xa9e8('0x13')][_0x3c60f0][_0xa9e8('0x30')]+=0x1;}_0x28c307[_0xa9e8('0x13')][_0x3c60f0][_0xa9e8('0x2b')]+=moment(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x5d')])['diff'](moment(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x5e')]),_0xa9e8('0x5f'))||0x0;if(_0x1cec6c===_0xc81c40[_0x7c869f]['length']-0x1){_0x28c307[_0xa9e8('0x13')][_0x3c60f0][_0xa9e8('0x31')]+=moment(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x60')]||_0xc81c40[_0x7c869f][_0x1cec6c]['queuecallerabandonAt']||_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x61')])[_0xa9e8('0x62')](moment(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x5e')]),_0xa9e8('0x5f'))||0x0;_0x28c307[_0xa9e8('0x13')][_0x3c60f0][_0xa9e8('0x29')]+=0x1;if(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x63')]){_0x28c307[_0xa9e8('0x13')][_0x3c60f0]['answered']+=0x1;_0x28c307[_0xa9e8('0x13')][_0x3c60f0][_0xa9e8('0x2c')]+=moment(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x60')])[_0xa9e8('0x62')](moment(_0xc81c40[_0x7c869f][_0x1cec6c][_0xa9e8('0x5d')]),'seconds')||0x0;}}else{_0x28c307['voiceQueues'][_0x3c60f0][_0xa9e8('0x31')]+=_0x28c307['voiceQueues'][_0x3c60f0][_0xa9e8('0x2b')]||0x0;}}}}}}return _0x28c307['voiceQueues'];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x64')]=function(){var _0x17ab49=this;return function(_0x532e50){clearVoiceCallReports(_0x17ab49['outbound']);if(_0x532e50){for(var _0x44f085=0x0;_0x44f085<_0x532e50[_0xa9e8('0x41')];_0x44f085+=0x1){_0x17ab49[_0xa9e8('0x16')][_0xa9e8('0x29')]+=0x1;_0x17ab49['outbound'][_0xa9e8('0x31')]+=_0x532e50[_0x44f085]['duration'];if(_0x532e50[_0x44f085][_0xa9e8('0x65')]===_0xa9e8('0x66')){_0x17ab49[_0xa9e8('0x16')]['answered']+=0x1;_0x17ab49[_0xa9e8('0x16')]['sumHoldTime']+=_0x532e50[_0x44f085][_0xa9e8('0x67')]-_0x532e50[_0x44f085][_0xa9e8('0x68')]||0x0;_0x17ab49[_0xa9e8('0x16')][_0xa9e8('0x2c')]+=_0x532e50[_0x44f085][_0xa9e8('0x68')];}}}return _0x17ab49[_0xa9e8('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x2b2dd7=this;return function(_0x4c465d){if(_0x4c465d){freeIsNotKey(_0x4c465d,_0x2b2dd7[_0xa9e8('0x15')],_0xa9e8('0x26'));for(var _0x4e833d=0x0,_0x2ada3f={};_0x4e833d<_0x4c465d[_0xa9e8('0x41')];_0x4e833d+=0x1){_0x2ada3f=_0x4c465d[_0x4e833d];if(_[_0xa9e8('0x42')](_0x2b2dd7[_0xa9e8('0x15')][_0x2ada3f['name']])){_0x2b2dd7[_0xa9e8('0x15')][_0x2ada3f[_0xa9e8('0x26')]]=new Campaign(_0x2ada3f);}else{_0x2b2dd7[_0xa9e8('0x3f')](_0x2b2dd7[_0xa9e8('0x15')][_0x2ada3f[_0xa9e8('0x26')]],_0x2ada3f);_0x2b2dd7['campaigns'][_0x2ada3f[_0xa9e8('0x26')]][_0xa9e8('0x69')]=_0x2ada3f[_0xa9e8('0x6a')]?_0x2ada3f[_0xa9e8('0x6a')]['name']:undefined;}}}return _0x2b2dd7[_0xa9e8('0x15')];};};Realtime['prototype'][_0xa9e8('0x6b')]=function(){var _0x4040a9=this;return function(_0x51bf5c){if(_0x51bf5c){freeIsNotKey(_0x51bf5c,_0x4040a9['voiceExtensions'],'id');for(var _0x37b25d=0x0,_0x11ed22={};_0x37b25d<_0x51bf5c[_0xa9e8('0x41')];_0x37b25d+=0x1){_0x11ed22=_0x51bf5c[_0x37b25d];if(_[_0xa9e8('0x42')](_0x4040a9['voiceExtensions'][_0x11ed22['id']])){_0x4040a9[_0xa9e8('0x17')][_0x11ed22['id']]=new VoiceExtension(_0x11ed22);}else{_0x4040a9[_0xa9e8('0x3f')](_0x4040a9[_0xa9e8('0x17')][_0x11ed22['id']],_0x11ed22);}}}return _0x4040a9['voiceExtensions'];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x6c')]=function(){var _0x1ec7c8=this;return function(_0x171573){clearCampaigns(_0x1ec7c8['campaigns']);for(var _0x438630=0x0;_0x438630<_0x171573[_0xa9e8('0x41')];_0x438630+=0x1){_['merge'](_0x1ec7c8[_0xa9e8('0x15')][_0x171573[_0x438630][_0xa9e8('0x26')]],_0x171573[_0x438630]);}return _0x1ec7c8[_0xa9e8('0x15')];};};Realtime[_0xa9e8('0x3e')][_0xa9e8('0x6d')]=function(){var _0x5bbaa7=this;return function(_0x5b743f){if(_0x5b743f){freeIsNotKey(_0x5b743f,_0x5bbaa7[_0xa9e8('0x21')],'id');for(var _0x21446a=0x0,_0x56a46e={},_0x479aa5={};_0x21446a<_0x5b743f[_0xa9e8('0x41')];_0x21446a+=0x1){_0x56a46e=_0x5b743f[_0x21446a];if(_['isUndefined'](_0x5bbaa7[_0xa9e8('0x21')][_0x56a46e['id']])){_0x5bbaa7[_0xa9e8('0x21')][_0x56a46e['id']]=new FaxAccount(_0x56a46e);}else{_0x5bbaa7[_0xa9e8('0x3f')](_0x5bbaa7[_0xa9e8('0x21')][_0x56a46e['id']],_0x56a46e);}}}return _0x5bbaa7[_0xa9e8('0x21')];};};module[_0xa9e8('0x6e')]=Realtime; \ No newline at end of file +var _0xc5c8=['faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','total','answered','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','agents','length','interface','isUndefined','initTelephones','voiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','uniqueid','queue','queuecallerabandon','diff','seconds','sumDuration','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','outbound','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','util','lodash','moment','../model/telephone','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','telephones','trunks','campaigns','templates','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','freshsalesAccounts'];(function(_0x3d5859,_0x1be169){var _0xce6e80=function(_0xa16cb5){while(--_0xa16cb5){_0x3d5859['push'](_0x3d5859['shift']());}};_0xce6e80(++_0x1be169);}(_0xc5c8,0x118));var _0x8c5c=function(_0x20dd26,_0x2b0c02){_0x20dd26=_0x20dd26-0x0;var _0x5f2bed=_0xc5c8[_0x20dd26];return _0x5f2bed;};'use strict';var util=require(_0x8c5c('0x0'));var _=require(_0x8c5c('0x1'));var moment=require(_0x8c5c('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x8c5c('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x8c5c('0x4'));var Template=require(_0x8c5c('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x8c5c('0x6'));var ZendeskAccount=require(_0x8c5c('0x7'));var SalesforceAccount=require(_0x8c5c('0x8'));var FreshdeskAccount=require(_0x8c5c('0x9'));var SugarcrmAccount=require(_0x8c5c('0xa'));var ZohoAccount=require(_0x8c5c('0xb'));var DeskAccount=require(_0x8c5c('0xc'));var VtigerAccount=require(_0x8c5c('0xd'));var ServicenowAccount=require(_0x8c5c('0xe'));var Dynamics365Account=require(_0x8c5c('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0x8c5c('0x10')]={};this[_0x8c5c('0x11')]={};this['voiceQueues']={};this['triggers']={};this[_0x8c5c('0x12')]={};this[_0x8c5c('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x8c5c('0x14')]={};this[_0x8c5c('0x15')]={};this['outboundChannels']={};this['timers']={};this[_0x8c5c('0x16')]={};this[_0x8c5c('0x17')]={};this[_0x8c5c('0x18')]={};this['sugarcrmAccounts']={};this[_0x8c5c('0x19')]={};this[_0x8c5c('0x1a')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x8c5c('0x1b')]={};this['dynamics365Accounts']={};this[_0x8c5c('0x1c')]={};this[_0x8c5c('0x1d')]={};};function freeIsNotKey(_0x2e820a,_0x3a3104,_0x535bb0){var _0x32e5cb=_[_0x8c5c('0x1e')](_0x2e820a,function(_0x107835,_0x189ddb){return _0x107835[_0x535bb0];});for(var _0x10614e in _0x3a3104){if(_0x3a3104['hasOwnProperty'](_0x10614e)){if(!_0x32e5cb[_0x10614e]){delete _0x3a3104[_0x10614e];}}}}function freeIsNotKeySip(_0x5d8dd3,_0x51ff6b){var _0x56a434=_[_0x8c5c('0x1e')](_0x5d8dd3,function(_0x53c6ad,_0x2c1e97){return util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x53c6ad[_0x8c5c('0x21')]);});for(var _0x21d0de in _0x51ff6b){if(_0x51ff6b[_0x8c5c('0x22')](_0x21d0de)){if(!_0x56a434[_0x21d0de]){delete _0x51ff6b[_0x21d0de];}}}}function freeIsNotKeyAgent(_0xc174a4,_0xac22f9){var _0x4a6618=_[_0x8c5c('0x1e')](_0xc174a4,function(_0x542b61,_0x2f3ef3){var _0x34f24e=_[_0x8c5c('0x23')](_0x542b61['interface'])?util[_0x8c5c('0x1f')]('SIP/%s',_0x542b61['name']):_0x542b61['interface'];return _0x34f24e;});for(var _0x32a426 in _0xac22f9){if(_0xac22f9[_0x8c5c('0x22')](_0x32a426)){if(!_0x4a6618[_0x32a426]){delete _0xac22f9[_0x32a426];}}}}function clearVoiceCallReports(_0x19389f){_0x19389f[_0x8c5c('0x24')]=0x0;_0x19389f[_0x8c5c('0x25')]=0x0;_0x19389f['sumHoldTime']=0x0;_0x19389f['sumDuration']=0x0;_0x19389f['sumBillable']=0x0;}function clearCampaigns(_0x19820f){if(!_[_0x8c5c('0x26')](_0x19820f)){for(var _0x2fc2f7 in _0x19820f){if(_0x19820f[_0x8c5c('0x22')](_0x2fc2f7)){_0x19820f[_0x2fc2f7][_0x8c5c('0x27')]=0x0;_0x19820f[_0x2fc2f7][_0x8c5c('0x28')]=0x0;}}}}function clearVoiceQueues(_0x40057e){if(!_[_0x8c5c('0x26')](_0x40057e)){for(var _0x140c21 in _0x40057e){if(_0x40057e[_0x8c5c('0x22')](_0x140c21)){_0x40057e[_0x140c21][_0x8c5c('0x24')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x25')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x29')]=0x0;_0x40057e[_0x140c21]['abandoned']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2a')]=0x0;_0x40057e[_0x140c21]['sumDuration']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2b')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2c')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2d')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2e')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2f')]=0x0;_0x40057e[_0x140c21]['outboundNoSuchCallsDay']=0x0;_0x40057e[_0x140c21]['outboundUnknownCallsDay']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x30')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x31')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x32')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x33')]=0x0;_0x40057e[_0x140c21]['outboundRejectCallsDay']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x34')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2c')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x35')]=0x0;_0x40057e[_0x140c21]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x8c5c('0x36')]=function(_0x5a8d42,_0x402404){for(var _0x184c34 in _0x402404){if(_0x5a8d42['hasOwnProperty'](_0x184c34)){_0x5a8d42[_0x184c34]=_0x402404[_0x184c34];}}};Realtime[_0x8c5c('0x37')][_0x8c5c('0x38')]=function(){var _0x15fddb=this;return function(_0x39d054){if(_0x39d054){freeIsNotKeyAgent(_0x39d054,_0x15fddb[_0x8c5c('0x39')]);for(var _0xc2c85c=0x0,_0x5e6f23={},_0x20bc66={};_0xc2c85c<_0x39d054[_0x8c5c('0x3a')];_0xc2c85c+=0x1){_0x5e6f23=_0x39d054[_0xc2c85c];var _0x161313=_[_0x8c5c('0x23')](_0x5e6f23[_0x8c5c('0x3b')])?util[_0x8c5c('0x1f')]('SIP/%s',_0x5e6f23[_0x8c5c('0x21')]):_0x5e6f23[_0x8c5c('0x3b')];if(_[_0x8c5c('0x3c')](_0x15fddb['agents'][_0x161313])){_0x15fddb[_0x8c5c('0x39')][_0x161313]=new Agent(_0x5e6f23);}else{_0x15fddb[_0x8c5c('0x36')](_0x15fddb[_0x8c5c('0x39')][_0x161313],_0x5e6f23);}}}return _0x15fddb[_0x8c5c('0x39')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x3d')]=function(){var _0x2d9273=this;return function(_0x91c4dd){if(_0x91c4dd){freeIsNotKeySip(_0x91c4dd,_0x2d9273[_0x8c5c('0x10')]);for(var _0x1098fb=0x0,_0x52c12b={},_0x163054={};_0x1098fb<_0x91c4dd[_0x8c5c('0x3a')];_0x1098fb+=0x1){_0x52c12b=_0x91c4dd[_0x1098fb];if(_[_0x8c5c('0x3c')](_0x2d9273[_0x8c5c('0x10')][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x52c12b['name'])])){_0x2d9273[_0x8c5c('0x10')][util[_0x8c5c('0x1f')]('SIP/%s',_0x52c12b[_0x8c5c('0x21')])]=new Telephone(_0x52c12b);}else{_0x2d9273['mergeFromDatabase'](_0x2d9273['telephones'][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x52c12b['name'])],_0x52c12b);}}}return _0x2d9273[_0x8c5c('0x10')];};};Realtime[_0x8c5c('0x37')]['initTrunks']=function(){var _0xbcc60c=this;return function(_0x3fa3f1){if(_0x3fa3f1){freeIsNotKeySip(_0x3fa3f1,_0xbcc60c[_0x8c5c('0x11')]);for(var _0x120182=0x0,_0x196fdc={},_0x834a33={};_0x120182<_0x3fa3f1[_0x8c5c('0x3a')];_0x120182+=0x1){_0x196fdc=_0x3fa3f1[_0x120182];if(_['isUndefined'](_0xbcc60c[_0x8c5c('0x11')][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x196fdc['name'])])){_0xbcc60c['trunks'][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x196fdc[_0x8c5c('0x21')])]=new Trunk(_0x196fdc);}else{_0xbcc60c['mergeFromDatabase'](_0xbcc60c[_0x8c5c('0x11')][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x196fdc['name'])],_0x196fdc);}}}return _0xbcc60c[_0x8c5c('0x11')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x238e24=this;return function(_0x5818a8){if(_0x5818a8){freeIsNotKey(_0x5818a8,_0x238e24[_0x8c5c('0x3e')],'name');for(var _0x3a7847=0x0,_0x1e00ba={},_0x31c52d={};_0x3a7847<_0x5818a8[_0x8c5c('0x3a')];_0x3a7847+=0x1){_0x1e00ba=_0x5818a8[_0x3a7847];if(_['isUndefined'](_0x238e24[_0x8c5c('0x3e')][_0x1e00ba['name']])){_0x238e24['voiceQueues'][_0x1e00ba['name']]=new VoiceQueue(_0x1e00ba);}else{_0x238e24[_0x8c5c('0x36')](_0x238e24[_0x8c5c('0x3e')][_0x1e00ba[_0x8c5c('0x21')]],_0x1e00ba);}}}return _0x238e24[_0x8c5c('0x3e')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x3f')]=function(){var _0x538bd9=this;return function(_0x44f33e){if(_0x44f33e){freeIsNotKey(_0x44f33e,_0x538bd9['triggers'],'id');for(var _0x222809=0x0,_0x3d2571={},_0x189938={};_0x222809<_0x44f33e[_0x8c5c('0x3a')];_0x222809+=0x1){_0x3d2571=_0x44f33e[_0x222809];if(_[_0x8c5c('0x3c')](_0x538bd9['triggers'][_0x3d2571['id']])){_0x538bd9[_0x8c5c('0x40')][_0x3d2571['id']]=new Trigger(_0x3d2571);}else{_0x538bd9[_0x8c5c('0x36')](_0x538bd9[_0x8c5c('0x40')][_0x3d2571['id']],_0x3d2571);}}}return _0x538bd9[_0x8c5c('0x40')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x41')]=function(){var _0x3ea922=this;return function(_0x173b8c){if(_0x173b8c){freeIsNotKey(_0x173b8c,_0x3ea922['templates'],'id');for(var _0x5f199f=0x0,_0x5d269d={},_0x338208={};_0x5f199f<_0x173b8c[_0x8c5c('0x3a')];_0x5f199f+=0x1){_0x5d269d=_0x173b8c[_0x5f199f];if(_[_0x8c5c('0x3c')](_0x3ea922['templates'][_0x5d269d['id']])){_0x3ea922[_0x8c5c('0x13')][_0x5d269d['id']]=new Template(_0x5d269d);}else{_0x3ea922[_0x8c5c('0x36')](_0x3ea922['templates'][_0x5d269d['id']],_0x5d269d);}}}return _0x3ea922[_0x8c5c('0x13')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x42')]=function(){var _0xae8f89=this;return function(_0x3fe87c){if(_0x3fe87c){freeIsNotKey(_0x3fe87c,_0xae8f89['zendeskAccounts'],'id');for(var _0xb1ef34=0x0,_0x141c60={},_0xdfb51d={};_0xb1ef34<_0x3fe87c[_0x8c5c('0x3a')];_0xb1ef34+=0x1){_0x141c60=_0x3fe87c[_0xb1ef34];if(_[_0x8c5c('0x3c')](_0xae8f89[_0x8c5c('0x17')][_0x141c60['id']])){_0xae8f89[_0x8c5c('0x17')][_0x141c60['id']]=new ZendeskAccount(_0x141c60);}else{_0xae8f89[_0x8c5c('0x36')](_0xae8f89[_0x8c5c('0x17')][_0x141c60['id']],_0x141c60);}}}return _0xae8f89[_0x8c5c('0x17')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x43')]=function(){var _0x354685=this;return function(_0x8a22df){if(_0x8a22df){freeIsNotKey(_0x8a22df,_0x354685[_0x8c5c('0x18')],'id');for(var _0x54a967=0x0,_0x321acf={},_0x51da3d={};_0x54a967<_0x8a22df[_0x8c5c('0x3a')];_0x54a967+=0x1){_0x321acf=_0x8a22df[_0x54a967];if(_[_0x8c5c('0x3c')](_0x354685['salesforceAccounts'][_0x321acf['id']])){_0x354685[_0x8c5c('0x18')][_0x321acf['id']]=new SalesforceAccount(_0x321acf);}else{_0x354685[_0x8c5c('0x36')](_0x354685[_0x8c5c('0x18')][_0x321acf['id']],_0x321acf);}}}return _0x354685[_0x8c5c('0x18')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x44')]=function(){var _0x11b2b1=this;return function(_0x3a689f){if(_0x3a689f){freeIsNotKey(_0x3a689f,_0x11b2b1['freshdeskAccounts'],'id');for(var _0x2d1050=0x0,_0x4ea6b4={},_0x23d412={};_0x2d1050<_0x3a689f[_0x8c5c('0x3a')];_0x2d1050+=0x1){_0x4ea6b4=_0x3a689f[_0x2d1050];if(_[_0x8c5c('0x3c')](_0x11b2b1[_0x8c5c('0x19')][_0x4ea6b4['id']])){_0x11b2b1['freshdeskAccounts'][_0x4ea6b4['id']]=new FreshdeskAccount(_0x4ea6b4);}else{_0x11b2b1[_0x8c5c('0x36')](_0x11b2b1[_0x8c5c('0x19')][_0x4ea6b4['id']],_0x4ea6b4);}}}return _0x11b2b1[_0x8c5c('0x19')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x45')]=function(){var _0x233347=this;return function(_0x4c531e){if(_0x4c531e){freeIsNotKey(_0x4c531e,_0x233347[_0x8c5c('0x1a')],'id');for(var _0x5e0bde=0x0,_0x5d5141={},_0x30c11d={};_0x5e0bde<_0x4c531e[_0x8c5c('0x3a')];_0x5e0bde+=0x1){_0x5d5141=_0x4c531e[_0x5e0bde];if(_[_0x8c5c('0x3c')](_0x233347[_0x8c5c('0x1a')][_0x5d5141['id']])){_0x233347[_0x8c5c('0x1a')][_0x5d5141['id']]=new ZohoAccount(_0x5d5141);}else{_0x233347[_0x8c5c('0x36')](_0x233347['zohoAccounts'][_0x5d5141['id']],_0x5d5141);}}}return _0x233347[_0x8c5c('0x1a')];};};Realtime['prototype'][_0x8c5c('0x46')]=function(){var _0x3a483e=this;return function(_0x283474){if(_0x283474){freeIsNotKey(_0x283474,_0x3a483e[_0x8c5c('0x47')],'id');for(var _0x1dab40=0x0,_0x4fdab7={},_0x522b3a={};_0x1dab40<_0x283474[_0x8c5c('0x3a')];_0x1dab40+=0x1){_0x4fdab7=_0x283474[_0x1dab40];if(_[_0x8c5c('0x3c')](_0x3a483e[_0x8c5c('0x47')][_0x4fdab7['id']])){_0x3a483e['deskAccounts'][_0x4fdab7['id']]=new DeskAccount(_0x4fdab7);}else{_0x3a483e['mergeFromDatabase'](_0x3a483e[_0x8c5c('0x47')][_0x4fdab7['id']],_0x4fdab7);}}}return _0x3a483e[_0x8c5c('0x47')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x54b872=this;return function(_0x2dd1e3){if(_0x2dd1e3){freeIsNotKey(_0x2dd1e3,_0x54b872[_0x8c5c('0x48')],'id');for(var _0x218bb4=0x0,_0x2b6c24={},_0x5dcd19={};_0x218bb4<_0x2dd1e3['length'];_0x218bb4+=0x1){_0x2b6c24=_0x2dd1e3[_0x218bb4];if(_[_0x8c5c('0x3c')](_0x54b872[_0x8c5c('0x48')][_0x2b6c24['id']])){_0x54b872['sugarcrmAccounts'][_0x2b6c24['id']]=new SugarcrmAccount(_0x2b6c24);}else{_0x54b872[_0x8c5c('0x36')](_0x54b872[_0x8c5c('0x48')][_0x2b6c24['id']],_0x2b6c24);}}}return _0x54b872[_0x8c5c('0x48')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x49')]=function(){var _0x3701de=this;return function(_0x630905){if(_0x630905){freeIsNotKey(_0x630905,_0x3701de[_0x8c5c('0x4a')],'id');for(var _0x880686=0x0,_0x2e8420={},_0x3c27f4={};_0x880686<_0x630905[_0x8c5c('0x3a')];_0x880686+=0x1){_0x2e8420=_0x630905[_0x880686];if(_[_0x8c5c('0x3c')](_0x3701de[_0x8c5c('0x4a')][_0x2e8420['id']])){_0x3701de['vtigerAccounts'][_0x2e8420['id']]=new VtigerAccount(_0x2e8420);}else{_0x3701de['mergeFromDatabase'](_0x3701de[_0x8c5c('0x4a')][_0x2e8420['id']],_0x2e8420);}}}return _0x3701de[_0x8c5c('0x4a')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x4b')]=function(){var _0x3d13f2=this;return function(_0x305566){if(_0x305566){freeIsNotKey(_0x305566,_0x3d13f2['servicenowAccounts'],'id');for(var _0x2803be=0x0,_0x41cded={},_0x355952={};_0x2803be<_0x305566[_0x8c5c('0x3a')];_0x2803be+=0x1){_0x41cded=_0x305566[_0x2803be];if(_['isUndefined'](_0x3d13f2[_0x8c5c('0x1b')][_0x41cded['id']])){_0x3d13f2[_0x8c5c('0x1b')][_0x41cded['id']]=new ServicenowAccount(_0x41cded);}else{_0x3d13f2[_0x8c5c('0x36')](_0x3d13f2['servicenowAccounts'][_0x41cded['id']],_0x41cded);}}}return _0x3d13f2['servicenowAccounts'];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x4c')]=function(){var _0x482cfd=this;return function(_0x2ac4e7){if(_0x2ac4e7){freeIsNotKey(_0x2ac4e7,_0x482cfd[_0x8c5c('0x4d')],'id');for(var _0x29df6f=0x0,_0x47aaf0={},_0x1bc68d={};_0x29df6f<_0x2ac4e7['length'];_0x29df6f+=0x1){_0x47aaf0=_0x2ac4e7[_0x29df6f];if(_['isUndefined'](_0x482cfd[_0x8c5c('0x4d')][_0x47aaf0['id']])){_0x482cfd['dynamics365Accounts'][_0x47aaf0['id']]=new Dynamics365Account(_0x47aaf0);}else{_0x482cfd[_0x8c5c('0x36')](_0x482cfd[_0x8c5c('0x4d')][_0x47aaf0['id']],_0x47aaf0);}}}return _0x482cfd[_0x8c5c('0x4d')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x4e')]=function(){var _0x1af882=this;return function(_0x283577){if(_0x283577){freeIsNotKey(_0x283577,_0x1af882[_0x8c5c('0x1c')],'id');for(var _0x3098e0=0x0,_0x5a2483={},_0x10d926={};_0x3098e0<_0x283577[_0x8c5c('0x3a')];_0x3098e0+=0x1){_0x5a2483=_0x283577[_0x3098e0];if(_[_0x8c5c('0x3c')](_0x1af882[_0x8c5c('0x1c')][_0x5a2483['id']])){_0x1af882['freshsalesAccounts'][_0x5a2483['id']]=new FreshsalesAccount(_0x5a2483);}else{_0x1af882['mergeFromDatabase'](_0x1af882[_0x8c5c('0x1c')][_0x5a2483['id']],_0x5a2483);}}}return _0x1af882[_0x8c5c('0x1c')];};};Realtime['prototype'][_0x8c5c('0x4f')]=function(){var _0x307f8c=this;return function(_0x2ae638){for(var _0x5a851b=0x0;_0x5a851b<_0x2ae638['length'];_0x5a851b+=0x1){_['merge'](_0x307f8c[_0x8c5c('0x3e')][_0x2ae638[_0x5a851b][_0x8c5c('0x21')]],_0x2ae638[_0x5a851b]);}return _0x307f8c[_0x8c5c('0x3e')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0xc0129a=this;return function(_0x3f4c05){clearVoiceQueues(_0xc0129a[_0x8c5c('0x3e')]);if(_0x3f4c05){_0x3f4c05=_['groupBy'](_0x3f4c05,_0x8c5c('0x50'));for(var _0xfd5319 in _0x3f4c05){if(_0x3f4c05['hasOwnProperty'](_0xfd5319)){var _0x193c42={};for(var _0x9eea0d=0x0;_0x9eea0d<_0x3f4c05[_0xfd5319][_0x8c5c('0x3a')];_0x9eea0d+=0x1){var _0x555682=_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x51')];if(_0xc0129a[_0x8c5c('0x3e')][_0x555682]){if(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerexit']){_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x29')]+=0x1;}if(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x52')]){_0xc0129a['voiceQueues'][_0x555682]['abandoned']+=0x1;}_0xc0129a['voiceQueues'][_0x555682][_0x8c5c('0x2a')]+=moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerleaveAt'])[_0x8c5c('0x53')](moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerjoinAt']),_0x8c5c('0x54'))||0x0;if(_0x9eea0d===_0x3f4c05[_0xfd5319][_0x8c5c('0x3a')]-0x1){_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x55')]+=moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallercompleteAt']||_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x56')]||_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerexitAt'])[_0x8c5c('0x53')](moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerjoinAt']),'seconds')||0x0;_0xc0129a['voiceQueues'][_0x555682][_0x8c5c('0x24')]+=0x1;if(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x57')]){_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x25')]+=0x1;_0xc0129a[_0x8c5c('0x3e')][_0x555682]['sumBillable']+=moment(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x58')])[_0x8c5c('0x53')](moment(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x59')]),'seconds')||0x0;}}else{_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x55')]+=_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x2a')]||0x0;}}}}}}return _0xc0129a[_0x8c5c('0x3e')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x5a')]=function(){var _0x14f334=this;return function(_0x1bbb76){clearVoiceCallReports(_0x14f334[_0x8c5c('0x5b')]);if(_0x1bbb76){for(var _0x504825=0x0;_0x504825<_0x1bbb76[_0x8c5c('0x3a')];_0x504825+=0x1){_0x14f334[_0x8c5c('0x5b')][_0x8c5c('0x24')]+=0x1;_0x14f334['outbound'][_0x8c5c('0x55')]+=_0x1bbb76[_0x504825][_0x8c5c('0x5c')];if(_0x1bbb76[_0x504825]['disposition']===_0x8c5c('0x5d')){_0x14f334[_0x8c5c('0x5b')]['answered']+=0x1;_0x14f334[_0x8c5c('0x5b')][_0x8c5c('0x2a')]+=_0x1bbb76[_0x504825][_0x8c5c('0x5c')]-_0x1bbb76[_0x504825][_0x8c5c('0x5e')]||0x0;_0x14f334[_0x8c5c('0x5b')]['sumBillable']+=_0x1bbb76[_0x504825][_0x8c5c('0x5e')];}}}return _0x14f334[_0x8c5c('0x5b')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x5f')]=function(){var _0x2d6568=this;return function(_0xcf14bf){if(_0xcf14bf){freeIsNotKey(_0xcf14bf,_0x2d6568[_0x8c5c('0x12')],_0x8c5c('0x21'));for(var _0x3735d0=0x0,_0x468b11={};_0x3735d0<_0xcf14bf[_0x8c5c('0x3a')];_0x3735d0+=0x1){_0x468b11=_0xcf14bf[_0x3735d0];if(_['isUndefined'](_0x2d6568[_0x8c5c('0x12')][_0x468b11[_0x8c5c('0x21')]])){_0x2d6568['campaigns'][_0x468b11[_0x8c5c('0x21')]]=new Campaign(_0x468b11);}else{_0x2d6568['mergeFromDatabase'](_0x2d6568[_0x8c5c('0x12')][_0x468b11[_0x8c5c('0x21')]],_0x468b11);_0x2d6568[_0x8c5c('0x12')][_0x468b11['name']][_0x8c5c('0x60')]=_0x468b11['SquareProject']?_0x468b11[_0x8c5c('0x61')]['name']:undefined;}}}return _0x2d6568['campaigns'];};};Realtime['prototype'][_0x8c5c('0x62')]=function(){var _0x32e2ed=this;return function(_0x5800c4){if(_0x5800c4){freeIsNotKey(_0x5800c4,_0x32e2ed['voiceExtensions'],'id');for(var _0x56512f=0x0,_0x1ba8c8={};_0x56512f<_0x5800c4['length'];_0x56512f+=0x1){_0x1ba8c8=_0x5800c4[_0x56512f];if(_['isUndefined'](_0x32e2ed[_0x8c5c('0x63')][_0x1ba8c8['id']])){_0x32e2ed[_0x8c5c('0x63')][_0x1ba8c8['id']]=new VoiceExtension(_0x1ba8c8);}else{_0x32e2ed[_0x8c5c('0x36')](_0x32e2ed[_0x8c5c('0x63')][_0x1ba8c8['id']],_0x1ba8c8);}}}return _0x32e2ed[_0x8c5c('0x63')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x64')]=function(){var _0x1c0e37=this;return function(_0x2fb27d){clearCampaigns(_0x1c0e37[_0x8c5c('0x12')]);for(var _0x5c214d=0x0;_0x5c214d<_0x2fb27d[_0x8c5c('0x3a')];_0x5c214d+=0x1){_[_0x8c5c('0x65')](_0x1c0e37[_0x8c5c('0x12')][_0x2fb27d[_0x5c214d]['name']],_0x2fb27d[_0x5c214d]);}return _0x1c0e37[_0x8c5c('0x12')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x66')]=function(){var _0x36faa2=this;return function(_0x4a1b3e){if(_0x4a1b3e){freeIsNotKey(_0x4a1b3e,_0x36faa2[_0x8c5c('0x1d')],'id');for(var _0x5c87f1=0x0,_0x242e23={},_0xf1daf1={};_0x5c87f1<_0x4a1b3e['length'];_0x5c87f1+=0x1){_0x242e23=_0x4a1b3e[_0x5c87f1];if(_[_0x8c5c('0x3c')](_0x36faa2[_0x8c5c('0x1d')][_0x242e23['id']])){_0x36faa2[_0x8c5c('0x1d')][_0x242e23['id']]=new FaxAccount(_0x242e23);}else{_0x36faa2[_0x8c5c('0x36')](_0x36faa2[_0x8c5c('0x1d')][_0x242e23['id']],_0x242e23);}}}return _0x36faa2[_0x8c5c('0x1d')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index ed02540..bbd7d8d 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 _0x9f95=['SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','internal','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','\x22%s\x22\x20<%s>','transfers','transfereelinkedid','uniqueid','linkedid','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','prototype','findAgent','accountcode','name','isNil','find','interface','format'];(function(_0x46d60b,_0x36d554){var _0x171af8=function(_0x13d82c){while(--_0x13d82c){_0x46d60b['push'](_0x46d60b['shift']());}};_0x171af8(++_0x36d554);}(_0x9f95,0x1bf));var _0x59f9=function(_0x306f2a,_0x57fc16){_0x306f2a=_0x306f2a-0x0;var _0x2fe087=_0x9f95[_0x306f2a];return _0x2fe087;};'use strict';var _=require('lodash');var moment=require(_0x59f9('0x0'));var util=require(_0x59f9('0x1'));var config=require(_0x59f9('0x2'));var ami=require(_0x59f9('0x3'));var RpcVoiceAgentReport=require(_0x59f9('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x59f9('0x5'));var RpcMemberReport=require(_0x59f9('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x59f9('0x7'));var RpcVoiceTransferReport=require(_0x59f9('0x8'));var VoiceQueueReport=require(_0x59f9('0x9'));var VoiceCallReport=require(_0x59f9('0xa'));var VoiceAgentReport=require(_0x59f9('0xb'));var VoiceDialReport=require(_0x59f9('0xc'));var UserReport=require('./userReport');function Report(_0x452eaa){this[_0x59f9('0xd')]=_0x452eaa;this[_0x59f9('0xe')]=_0x452eaa[_0x59f9('0xe')];this['telephones']=_0x452eaa[_0x59f9('0xf')];}Report['prototype'][_0x59f9('0x10')]=function(_0x29faca){var _0x88d114=new VoiceQueueReport(this[_0x59f9('0xd')]);var _0x3e520e=new VoiceAgentReport(this[_0x59f9('0xd')]);var _0x1120d3=new VoiceDialReport(this[_0x59f9('0xd')]);var _0x4c3c5c=new VoiceCallReport(this[_0x59f9('0xd')]);var _0x44d335=new UserReport(this['realtime']);if(config[_0x59f9('0x11')]&&config[_0x59f9('0x11')][_0x59f9('0x12')]){ami['on'](_0x59f9('0x13'),this[_0x59f9('0x14')]['bind'](this));ami['on'](_0x59f9('0x15'),this[_0x59f9('0x16')][_0x59f9('0x17')](this));ami['on'](_0x59f9('0x18'),this[_0x59f9('0x19')][_0x59f9('0x17')](this));ami['on'](_0x59f9('0x1a'),this[_0x59f9('0x1b')][_0x59f9('0x17')](this));ami['on'](_0x59f9('0x1c'),this[_0x59f9('0x1d')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x59f9('0x17')](this));}};Report[_0x59f9('0x1e')][_0x59f9('0x1f')]=function(_0x568c9d){var _0x2509d9;_0x2509d9=_['find'](this[_0x59f9('0xe')],function(_0x24f87b){return _0x24f87b[_0x59f9('0x20')]==_0x568c9d||_0x24f87b[_0x59f9('0x21')]==_0x568c9d;});if(_[_0x59f9('0x22')](_0x2509d9)){var _0x4ff24a=_[_0x59f9('0x23')](this[_0x59f9('0xf')],function(_0x552bde){return _0x552bde[_0x59f9('0x20')]==_0x568c9d||_0x552bde[_0x59f9('0x21')]==_0x568c9d;});if(_0x4ff24a){_0x2509d9=_[_0x59f9('0x23')](this[_0x59f9('0xe')],function(_0x5e4f22){return _0x5e4f22[_0x59f9('0x24')]==util[_0x59f9('0x25')](_0x59f9('0x26'),_0x4ff24a[_0x59f9('0x21')]);});}}return _0x2509d9;};Report['prototype'][_0x59f9('0x14')]=function(_0xc115da){for(var _0x2cdd5f=0x0;_0x2cdd5f<_0xc115da[_0x59f9('0x27')];_0x2cdd5f+=0x1){var _0x1067d5=this['findAgent'](_0xc115da[_0x2cdd5f][_0x59f9('0x28')]);if(_0x1067d5){_0xc115da[_0x2cdd5f]['accountcode']=_0x1067d5[_0x59f9('0x20')];_0xc115da[_0x2cdd5f][_0x59f9('0x29')]=!![];_0xc115da[_0x2cdd5f][_0x59f9('0x2a')]=_0x1067d5[_0x59f9('0x21')];_0xc115da[_0x2cdd5f][_0x59f9('0x24')]=_[_0x59f9('0x22')](_0x1067d5[_0x59f9('0x24')])?util[_0x59f9('0x25')](_0x59f9('0x26'),_0x1067d5['name']):_0x1067d5[_0x59f9('0x24')];if(_0xc115da[_0x2cdd5f][_0x59f9('0x2b')]){_0xc115da[_0x2cdd5f][_0x59f9('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0xc115da[_0x2cdd5f][_0x59f9('0x2d')]){_0xc115da[_0x2cdd5f][_0x59f9('0x2e')]=moment()['format'](_0x59f9('0x2f'));}RpcMemberReport['voiceQueueReport'](_0xc115da[_0x2cdd5f]);}RpcVoiceQueueReport[_0x59f9('0x30')](_0xc115da[_0x2cdd5f]);}};function extractCalleridNumber(_0x4bec4b){var _0x36761f=_0x4bec4b['match'](/<(.*?)>/);return _0x36761f?_0x36761f[0x1]:_0x4bec4b;}Report[_0x59f9('0x1e')]['getAgentByInternal']=function(_0x341230){for(var _0x482295=0x0;_0x482295','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','split','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','voiceAgentReport','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','voiceQueueReport'];(function(_0x146904,_0x424b32){var _0x236889=function(_0x215f21){while(--_0x215f21){_0x146904['push'](_0x146904['shift']());}};_0x236889(++_0x424b32);}(_0xea3e,0x107));var _0xeea3=function(_0x200140,_0x4fe93a){_0x200140=_0x200140-0x0;var _0x3bf111=_0xea3e[_0x200140];return _0x3bf111;};'use strict';var _=require('lodash');var moment=require(_0xeea3('0x0'));var util=require(_0xeea3('0x1'));var config=require('../../../config/environment');var ami=require(_0xeea3('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xeea3('0x3'));var RpcVoiceDialReport=require(_0xeea3('0x4'));var RpcMemberReport=require(_0xeea3('0x5'));var RpcVoiceQueueReport=require(_0xeea3('0x6'));var RpcVoiceRecording=require(_0xeea3('0x7'));var RpcVoiceTransferReport=require(_0xeea3('0x8'));var VoiceQueueReport=require(_0xeea3('0x9'));var VoiceCallReport=require(_0xeea3('0xa'));var VoiceAgentReport=require(_0xeea3('0xb'));var VoiceDialReport=require(_0xeea3('0xc'));var UserReport=require(_0xeea3('0xd'));function Report(_0x181441){this['realtime']=_0x181441;this[_0xeea3('0xe')]=_0x181441[_0xeea3('0xe')];this[_0xeea3('0xf')]=_0x181441[_0xeea3('0xf')];}Report[_0xeea3('0x10')][_0xeea3('0x11')]=function(_0x4361ae){var _0x42360b=new VoiceQueueReport(this['realtime']);var _0xf77443=new VoiceAgentReport(this[_0xeea3('0x12')]);var _0x52b40b=new VoiceDialReport(this[_0xeea3('0x12')]);var _0x4e4cd7=new VoiceCallReport(this[_0xeea3('0x12')]);var _0x40bd80=new UserReport(this[_0xeea3('0x12')]);if(config[_0xeea3('0x13')]&&config['xdr'][_0xeea3('0x14')]){ami['on']('custom:voiceQueueReport',this[_0xeea3('0x15')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x17'),this[_0xeea3('0x18')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x19'),this['voiceAgentReport'][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x1a'),this[_0xeea3('0x1b')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x1c'),this[_0xeea3('0x1d')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x1e'),this[_0xeea3('0x1f')][_0xeea3('0x16')](this));}};Report[_0xeea3('0x10')][_0xeea3('0x20')]=function(_0x1f3f0e){var _0x1a29f1;_0x1a29f1=_[_0xeea3('0x21')](this[_0xeea3('0xe')],function(_0x442be6){return _0x442be6[_0xeea3('0x22')]==_0x1f3f0e||_0x442be6[_0xeea3('0x23')]==_0x1f3f0e;});if(_[_0xeea3('0x24')](_0x1a29f1)){var _0x15546b=_['find'](this['telephones'],function(_0x174c14){return _0x174c14[_0xeea3('0x22')]==_0x1f3f0e||_0x174c14[_0xeea3('0x23')]==_0x1f3f0e;});if(_0x15546b){_0x1a29f1=_['find'](this[_0xeea3('0xe')],function(_0x4ae354){return _0x4ae354[_0xeea3('0x25')]==util['format'](_0xeea3('0x26'),_0x15546b[_0xeea3('0x23')]);});}}return _0x1a29f1;};Report[_0xeea3('0x10')]['voiceQueueReport']=function(_0x4d9d39){for(var _0x482c1b=0x0;_0x482c1b<_0x4d9d39[_0xeea3('0x27')];_0x482c1b+=0x1){var _0x18d8e5=this['findAgent'](_0x4d9d39[_0x482c1b][_0xeea3('0x28')]);if(_0x18d8e5){_0x4d9d39[_0x482c1b][_0xeea3('0x22')]=_0x18d8e5[_0xeea3('0x22')];_0x4d9d39[_0x482c1b]['assigned']=!![];_0x4d9d39[_0x482c1b][_0xeea3('0x29')]=_0x18d8e5[_0xeea3('0x23')];_0x4d9d39[_0x482c1b][_0xeea3('0x25')]=_[_0xeea3('0x24')](_0x18d8e5[_0xeea3('0x25')])?util[_0xeea3('0x2a')](_0xeea3('0x26'),_0x18d8e5['name']):_0x18d8e5[_0xeea3('0x25')];if(_0x4d9d39[_0x482c1b][_0xeea3('0x2b')]){_0x4d9d39[_0x482c1b][_0xeea3('0x2c')]=moment()[_0xeea3('0x2a')](_0xeea3('0x2d'));}if(_0x4d9d39[_0x482c1b]['queuecallerexit']){_0x4d9d39[_0x482c1b][_0xeea3('0x2e')]=moment()['format'](_0xeea3('0x2d'));}RpcMemberReport[_0xeea3('0x15')](_0x4d9d39[_0x482c1b]);}RpcVoiceQueueReport[_0xeea3('0x2f')](_0x4d9d39[_0x482c1b]);}};function extractCalleridNumber(_0x1977e7){var _0x2967dd=_0x1977e7['match'](/<(.*?)>/);return _0x2967dd?_0x2967dd[0x1]:_0x1977e7;}Report[_0xeea3('0x10')]['getAgentByInternal']=function(_0x47459f){for(var _0x128818=0x0;_0x1288180x0?_0xbe0a32:0x0;this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]][_0x7076('0x30')]=this['voiceQueues'][_0x3030e8[_0x7076('0x68')]][_0x7076('0x30')]>_[_0x7076('0x6d')](_0x3030e8[_0x7076('0x6e')])?_[_0x7076('0x6d')](_0x3030e8['loggedin']):this['voiceQueues'][_0x3030e8[_0x7076('0x68')]]['talking'];this['emitVoiceQueueSummary'](this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]],'queuesummary');}logger[_0x7076('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x7076('0x3c')](this[_0x7076('0x13')][_0x3030e8['queue']],{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0x6f'),this[_0x7076('0x13')][_0x3030e8['queue']]);}}}catch(_0x18ad08){logger['error'](_0x7076('0x70'),util[_0x7076('0x3c')](_0x18ad08,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7076('0x1a')]=function(_0x537f98){logger['debug'](_0x7076('0x71'),util[_0x7076('0x3c')](_0x537f98,{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0x72'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x1b')]=function(_0x2d0b9b){try{if(this[_0x7076('0x73')](_0x2d0b9b)){logger[_0x7076('0x45')](_0x7076('0x74'),_0x2d0b9b[_0x7076('0x48')],util['inspect'](_0x2d0b9b,{'showHidden':![],'depth':null}));if(_[_0x7076('0x75')](this['queueReports'][_0x2d0b9b[_0x7076('0x48')]]))this[_0x7076('0x3d')][_0x2d0b9b[_0x7076('0x48')]]=[];if(_[_0x7076('0x75')](this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]))this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]={};var _0x14f166=new QueueReport();_0x14f166['name']=_0x2d0b9b['queue'];_0x14f166[_0x7076('0x52')]=this[_0x7076('0x13')][_0x14f166[_0x7076('0x4f')]]&&this['voiceQueues'][_0x14f166[_0x7076('0x4f')]][_0x7076('0x52')]?this[_0x7076('0x13')][_0x14f166[_0x7076('0x4f')]]['type']||_0x7076('0x76'):_0x7076('0x76');_0x14f166['queue']=_0x2d0b9b[_0x7076('0x68')];_0x14f166[_0x7076('0x77')]=moment()['format'](_0x7076('0x78'));_0x14f166[_0x7076('0x79')]=_0x2d0b9b[_0x7076('0x79')];_0x14f166[_0x7076('0x7a')]=_0x2d0b9b[_0x7076('0x7a')];_0x14f166[_0x7076('0x48')]=_0x2d0b9b[_0x7076('0x48')];_0x14f166[_0x7076('0x7b')]=this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]['routealias'];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x14f166[_0x7076('0x4f')],_0x14f166['type']);_[_0x7076('0x7c')](_0x14f166,_[_0x7076('0x7d')](_0x2d0b9b,_['keys'](_0x14f166)));this[_0x7076('0x3d')][_0x2d0b9b[_0x7076('0x48')]][_0x7076('0x7e')](_0x14f166);this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]=_0x14f166;this['emitVoiceQueueChannelSave'](_0x14f166,_0x7076('0x7f'));}}catch(_0x4c1cb7){logger[_0x7076('0x3a')](_0x7076('0x74'),_0x2d0b9b[_0x7076('0x48')],util[_0x7076('0x3c')](_0x4c1cb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x1d')]=function(_0x1f7e12){try{if(this[_0x7076('0x73')](_0x1f7e12)){logger['debug'](_0x7076('0x80'),_0x1f7e12[_0x7076('0x48')],util[_0x7076('0x3c')](_0x1f7e12,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x1f7e12[_0x7076('0x48')]]){var _0x35c041=_['last'](this[_0x7076('0x3d')][_0x1f7e12[_0x7076('0x48')]]);_0x35c041[_0x7076('0x81')]=![];_0x35c041[_0x7076('0x82')]=null;_0x35c041['holdtime']=_0x1f7e12['holdtime'];_0x35c041[_0x7076('0x83')]=_0x1f7e12[_0x7076('0x83')];_0x35c041[_0x7076('0x1c')]=!![];_0x35c041[_0x7076('0x84')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));_0x35c041[_0x7076('0x85')]=_0x7076('0x86');_0x35c041[_0x7076('0x87')]=null;logger[_0x7076('0x6a')](_0x7076('0x88'),_0x35c041['name'],_0x35c041[_0x7076('0x52')]);this[_0x7076('0x11')][_0x1f7e12[_0x7076('0x48')]]=_0x35c041;this[_0x7076('0x42')](_0x35c041,'queuecallerabandon');}}}catch(_0x3cfac0){logger[_0x7076('0x3a')](_0x7076('0x80'),_0x1f7e12[_0x7076('0x48')],util[_0x7076('0x3c')](_0x3cfac0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')]['syncQueueCallerLeave']=function(_0x86e8cc){try{if(this[_0x7076('0x73')](_0x86e8cc)){logger[_0x7076('0x45')](_0x7076('0x89'),_0x86e8cc['uniqueid'],util['inspect'](_0x86e8cc,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x86e8cc[_0x7076('0x48')]]){var _0x30245c=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x86e8cc[_0x7076('0x48')]]);_0x30245c[_0x7076('0x8b')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));_0x30245c[_0x7076('0x8c')]=_0x86e8cc['connectedlinenum'];_0x30245c[_0x7076('0x8d')]=_0x86e8cc[_0x7076('0x8d')];logger[_0x7076('0x6a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x30245c['name'],_0x30245c[_0x7076('0x52')],_0x86e8cc[_0x7076('0x8c')],_0x86e8cc[_0x7076('0x8d')]);this[_0x7076('0x11')][_0x86e8cc[_0x7076('0x48')]]=_0x30245c;this[_0x7076('0x44')](_0x30245c,'queuecallerleave');}}}catch(_0x74ffa8){logger['error'](_0x7076('0x89'),_0x86e8cc[_0x7076('0x48')],util[_0x7076('0x3c')](_0x74ffa8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x21')]=function(_0x54977c){try{if(this[_0x7076('0x73')](_0x54977c)){logger['debug'](_0x7076('0x8e'),_0x54977c[_0x7076('0x48')],util['inspect'](_0x54977c,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x54977c['uniqueid']]){var _0x4a7ec1=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x54977c[_0x7076('0x48')]]);_0x4a7ec1['queuecallercomplete']=!![];_0x4a7ec1[_0x7076('0x85')]=_0x7076('0x8f');logger[_0x7076('0x6a')](_0x7076('0x90'),_0x4a7ec1[_0x7076('0x4f')],_0x4a7ec1[_0x7076('0x52')]);}}}catch(_0xe8d176){logger[_0x7076('0x3a')](_0x7076('0x8e'),_0x54977c[_0x7076('0x48')],util['inspect'](_0xe8d176,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x91')]=function(_0x4861fa){try{if(this[_0x7076('0x73')](_0x4861fa)){logger[_0x7076('0x45')](_0x7076('0x92'),_0x4861fa[_0x7076('0x48')],util['inspect'](_0x4861fa,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x48')]]){var _0x4fdb2d=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x48')]]);_0x4fdb2d[_0x7076('0x1c')]=![];_0x4fdb2d['queuecallerabandonAt']=null;_0x4fdb2d[_0x7076('0x93')]=!![];_0x4fdb2d[_0x7076('0x87')]=_0x4861fa[_0x7076('0x94')];_0x4fdb2d[_0x7076('0x95')]=_0x4861fa[_0x7076('0x95')];_0x4fdb2d[_0x7076('0x81')]=!![];_0x4fdb2d[_0x7076('0x96')]=![];_0x4fdb2d[_0x7076('0x97')]=null;if(!_0x4fdb2d[_0x7076('0x98')]){if(_0x4861fa[_0x7076('0x99')]==_0x7076('0x98')){_0x4fdb2d[_0x7076('0x85')]=_0x7076('0x9a');logger[_0x7076('0x6a')](_0x7076('0x9b'),_0x4fdb2d[_0x7076('0x4f')],_0x4fdb2d[_0x7076('0x52')]);}else{if(_[_0x7076('0x9c')](_0x4861fa[_0x7076('0x37')][_0x7076('0x9d')](),_0x7076('0x9e'))){if(this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x9f')]]){var _0x16bd9c=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x4861fa['linkedid']]);_0x16bd9c[_0x7076('0x81')]=![];_0x16bd9c[_0x7076('0x96')]=!![];_0x16bd9c[_0x7076('0x97')]=moment(_0x4fdb2d['queuecallerjoinAt'])[_0x7076('0xa0')](_0x4861fa['holdtime'],_0x7076('0xa1'))[_0x7076('0x4a')](_0x7076('0x78'));_0x16bd9c[_0x7076('0x85')]=_0x7076('0xa2');_0x16bd9c['transfer']=!![];_0x16bd9c[_0x7076('0xa3')]='FORWARD';_0x16bd9c[_0x7076('0xa4')]=_0x4861fa[_0x7076('0xa5')];_0x16bd9c[_0x7076('0xa6')]=_0x4861fa[_0x7076('0x48')];logger[_0x7076('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x16bd9c[_0x7076('0x4f')],_0x16bd9c[_0x7076('0x52')]);var _0x45419f=this['queueReports'][_0x4861fa[_0x7076('0x9f')]];this[_0x7076('0x3d')][_0x4861fa['linkedid']]=this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x48')]];this['queueReports'][_0x4861fa[_0x7076('0x48')]]=_0x45419f;}}else{_0x4fdb2d[_0x7076('0x85')]=_0x7076('0xa7')+_0x4861fa[_0x7076('0x99')]['toUpperCase']();logger[_0x7076('0x6a')](_0x7076('0xa8'),_0x4fdb2d[_0x7076('0x4f')],_0x4fdb2d['type'],_0x4fdb2d[_0x7076('0x85')]);}}}this[_0x7076('0x11')][_0x4861fa[_0x7076('0x48')]]=_0x4fdb2d;this[_0x7076('0x42')](_0x4fdb2d,_0x7076('0xa9'));}}}catch(_0x5ba851){logger[_0x7076('0x3a')](_0x7076('0x92'),_0x4861fa['uniqueid'],util[_0x7076('0x3c')](_0x5ba851,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7076('0x22')]=function(_0x59a6b7){try{if(this['isNotNull'](_0x59a6b7)){logger['debug'](_0x7076('0xaa'),_0x59a6b7['uniqueid'],util[_0x7076('0x3c')](_0x59a6b7,{'showHidden':![],'depth':null}));this[_0x7076('0xab')](_0x59a6b7['uniqueid'],_['keys'](_0x59a6b7[_0x7076('0xac')])[0x0],_0x59a6b7[_0x7076('0xad')]);if(this['queueReports'][_0x59a6b7['uniqueid']]){var _0x121f42=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x59a6b7[_0x7076('0x48')]]);if(_0x121f42){if(this[_0x7076('0x73')](_0x59a6b7[_0x7076('0xac')])&&this[_0x7076('0x73')](_0x59a6b7[_0x7076('0xac')][_0x7076('0xae')])){switch(_0x59a6b7['value']){case _0x7076('0xaf'):_0x121f42[_0x7076('0x96')]=![];_0x121f42[_0x7076('0x97')]=null;break;case _0x7076('0xb0'):_0x121f42[_0x7076('0xb1')]='timeout';_0x121f42[_0x7076('0x96')]=!![];_0x121f42[_0x7076('0x97')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));_0x121f42['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7076('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x59a6b7[_0x7076('0x48')],util['inspect'](_0x121f42,{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0xb2'),_0x121f42);break;default:_0x121f42[_0x7076('0x96')]=!![];_0x121f42[_0x7076('0x97')]=moment()[_0x7076('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x121f42[_0x7076('0x8b')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));}_0x121f42[_0x7076('0x1c')]=![];_0x121f42[_0x7076('0x84')]=null;_0x121f42[_0x7076('0x85')]=_0x59a6b7[_0x7076('0xad')];this[_0x7076('0x11')][_0x59a6b7[_0x7076('0x48')]]=_0x121f42;this[_0x7076('0x42')](_0x121f42,_0x7076('0xb3'));}else if(this[_0x7076('0x73')](_0x59a6b7['variable'])&&this['isNotNull'](_0x59a6b7['variable'][_0x7076('0xb4')])){if(!_0x121f42[_0x7076('0x1c')]){_0x121f42[_0x7076('0x96')]=!![];_0x121f42[_0x7076('0x97')]=moment()[_0x7076('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x121f42[_0x7076('0x85')]='EXITWITHKEY';_0x121f42['queuecallerleaveAt']=moment()[_0x7076('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7076('0x11')][_0x59a6b7[_0x7076('0x48')]]=_0x121f42;}}logger[_0x7076('0x6a')](_0x7076('0xb5'),_0x59a6b7[_0x7076('0x48')],_0x121f42['name'],_0x121f42['type'],_[_0x7076('0xb6')](_0x59a6b7[_0x7076('0xac')])[0x0],_0x59a6b7['value']);_0x121f42[_0x7076('0x15')]=this['variables'][_0x59a6b7[_0x7076('0x48')]];}}}}catch(_0x7427d8){logger[_0x7076('0x3a')](_0x7076('0xaa'),_0x59a6b7[_0x7076('0x48')],util[_0x7076('0x3c')](_0x7427d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0xab')]=function(_0x59b867,_0x3ec449,_0x30875c){var _0x4e7ebc=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0x7076('0xb7'),'rtpaudioqosloss',_0x7076('0xb8'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x7076('0xb9'),_0x7076('0xba'),_0x7076('0xbb'),_0x7076('0xbc'),'membercalls',_0x7076('0xbd'),'memberinterface',_0x7076('0xbe'),_0x7076('0x94'),_0x7076('0xbf'),_0x7076('0xc0')];if(!_['isNil'](_0x3ec449)&&!_[_0x7076('0xc1')](_0x4e7ebc,_0x3ec449)){if(_[_0x7076('0x75')](this['variables'][_0x59b867])){this[_0x7076('0x15')][_0x59b867]={};}this[_0x7076('0x15')][_0x59b867][_0x3ec449]=_0x30875c;}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0xc2')]=function(_0x1ada92,_0x5da54a,_0x3ab2d2){var _0x5b9153={};for(var _0x24c645=0x0;_0x24c6450x0?_0x58f90f:0x0;this[_0x68fe('0x10')][_0x4d3731[_0x68fe('0x60')]][_0x68fe('0x2e')]=this[_0x68fe('0x10')][_0x4d3731['queue']][_0x68fe('0x2e')]>_[_0x68fe('0x64')](_0x4d3731[_0x68fe('0x67')])?_[_0x68fe('0x64')](_0x4d3731[_0x68fe('0x67')]):this[_0x68fe('0x10')][_0x4d3731[_0x68fe('0x60')]][_0x68fe('0x2e')];this[_0x68fe('0x4d')](this[_0x68fe('0x10')][_0x4d3731['queue']],_0x68fe('0x14'));}logger[_0x68fe('0x3f')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x68fe('0x38')](this['voiceQueues'][_0x4d3731[_0x68fe('0x60')]],{'showHidden':![],'depth':null}));ami[_0x68fe('0x3e')](_0x68fe('0x68'),this['voiceQueues'][_0x4d3731[_0x68fe('0x60')]]);}}}catch(_0x37c9f0){logger['error']('[voiceQueueReport][queuesummary]',util[_0x68fe('0x38')](_0x37c9f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x68fe('0x69')]=function(_0x26aea6){logger[_0x68fe('0x3f')](_0x68fe('0x6a'),util[_0x68fe('0x38')](_0x26aea6,{'showHidden':![],'depth':null}));ami[_0x68fe('0x3e')](_0x68fe('0x6b'),{});this[_0x68fe('0x11')]=!![];};VoiceQueueReport[_0x68fe('0x9')]['syncQueueCallerJoin']=function(_0x1f5447){try{if(this[_0x68fe('0x5d')](_0x1f5447)){logger[_0x68fe('0x3f')](_0x68fe('0x6c'),_0x1f5447['uniqueid'],util['inspect'](_0x1f5447,{'showHidden':![],'depth':null}));if(_[_0x68fe('0x5e')](this['queueReports'][_0x1f5447[_0x68fe('0x42')]]))this[_0x68fe('0x39')][_0x1f5447[_0x68fe('0x42')]]=[];if(_[_0x68fe('0x5e')](this[_0x68fe('0xe')][_0x1f5447[_0x68fe('0x42')]]))this[_0x68fe('0xe')][_0x1f5447[_0x68fe('0x42')]]={};var _0x2a93ab=new QueueReport();_0x2a93ab[_0x68fe('0x45')]=_0x1f5447[_0x68fe('0x60')];_0x2a93ab[_0x68fe('0x54')]=this[_0x68fe('0x10')][_0x2a93ab[_0x68fe('0x45')]]&&this[_0x68fe('0x10')][_0x2a93ab[_0x68fe('0x45')]][_0x68fe('0x54')]?this[_0x68fe('0x10')][_0x2a93ab['name']][_0x68fe('0x54')]||_0x68fe('0x4e'):_0x68fe('0x4e');_0x2a93ab[_0x68fe('0x60')]=_0x1f5447[_0x68fe('0x60')];_0x2a93ab[_0x68fe('0x6d')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0x2a93ab[_0x68fe('0x6f')]=_0x1f5447[_0x68fe('0x6f')];_0x2a93ab[_0x68fe('0x70')]=_0x1f5447[_0x68fe('0x70')];_0x2a93ab[_0x68fe('0x42')]=_0x1f5447[_0x68fe('0x42')];_0x2a93ab[_0x68fe('0x71')]=this[_0x68fe('0xe')][_0x1f5447[_0x68fe('0x42')]][_0x68fe('0x71')];logger[_0x68fe('0x62')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2a93ab[_0x68fe('0x45')],_0x2a93ab['type']);_[_0x68fe('0x72')](_0x2a93ab,_[_0x68fe('0x73')](_0x1f5447,_[_0x68fe('0x74')](_0x2a93ab)));this[_0x68fe('0x39')][_0x1f5447['uniqueid']][_0x68fe('0x75')](_0x2a93ab);this[_0x68fe('0xe')][_0x1f5447['uniqueid']]=_0x2a93ab;this[_0x68fe('0x76')](_0x2a93ab,_0x68fe('0x18'));}}catch(_0x54e91a){logger['error'](_0x68fe('0x6c'),_0x1f5447[_0x68fe('0x42')],util['inspect'](_0x54e91a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')]['syncQueueCallerAbandon']=function(_0x27500f){try{if(this[_0x68fe('0x5d')](_0x27500f)){logger[_0x68fe('0x3f')](_0x68fe('0x77'),_0x27500f[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x27500f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x27500f[_0x68fe('0x42')]]){var _0x3d7bcd=_[_0x68fe('0x78')](this[_0x68fe('0x39')][_0x27500f[_0x68fe('0x42')]]);_0x3d7bcd[_0x68fe('0x79')]=![];_0x3d7bcd[_0x68fe('0x7a')]=null;_0x3d7bcd[_0x68fe('0x7b')]=_0x27500f[_0x68fe('0x7b')];_0x3d7bcd[_0x68fe('0x7c')]=_0x27500f[_0x68fe('0x7c')];_0x3d7bcd['queuecallerabandon']=!![];_0x3d7bcd['queuecallerabandonAt']=moment()[_0x68fe('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d7bcd[_0x68fe('0x4a')]=_0x68fe('0x7d');_0x3d7bcd[_0x68fe('0x7e')]=null;logger[_0x68fe('0x62')](_0x68fe('0x7f'),_0x3d7bcd['name'],_0x3d7bcd[_0x68fe('0x54')]);this[_0x68fe('0xe')][_0x27500f[_0x68fe('0x42')]]=_0x3d7bcd;this[_0x68fe('0x48')](_0x3d7bcd,_0x68fe('0x19'));}}}catch(_0x30ca17){logger[_0x68fe('0x3a')](_0x68fe('0x77'),_0x27500f['uniqueid'],util[_0x68fe('0x38')](_0x30ca17,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x1c')]=function(_0x976495){try{if(this['isNotNull'](_0x976495)){logger[_0x68fe('0x3f')](_0x68fe('0x80'),_0x976495['uniqueid'],util['inspect'](_0x976495,{'showHidden':![],'depth':null}));if(this[_0x68fe('0x39')][_0x976495[_0x68fe('0x42')]]){var _0xf8997e=_[_0x68fe('0x78')](this['queueReports'][_0x976495[_0x68fe('0x42')]]);_0xf8997e[_0x68fe('0x81')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0xf8997e[_0x68fe('0x82')]=_0x976495[_0x68fe('0x82')];_0xf8997e[_0x68fe('0x83')]=_0x976495[_0x68fe('0x83')];logger[_0x68fe('0x62')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xf8997e[_0x68fe('0x45')],_0xf8997e['type'],_0x976495[_0x68fe('0x82')],_0x976495['connectedlinename']);this[_0x68fe('0xe')][_0x976495[_0x68fe('0x42')]]=_0xf8997e;this[_0x68fe('0x76')](_0xf8997e,_0x68fe('0x1b'));}}}catch(_0x4ecc1d){logger[_0x68fe('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x976495['uniqueid'],util['inspect'](_0x4ecc1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x1f')]=function(_0x2c4765){try{if(this[_0x68fe('0x5d')](_0x2c4765)){logger['debug'](_0x68fe('0x84'),_0x2c4765[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x2c4765,{'showHidden':![],'depth':null}));if(this[_0x68fe('0x39')][_0x2c4765[_0x68fe('0x42')]]){var _0x1e70ff=_[_0x68fe('0x78')](this[_0x68fe('0x39')][_0x2c4765[_0x68fe('0x42')]]);_0x1e70ff[_0x68fe('0x79')]=!![];_0x1e70ff[_0x68fe('0x4a')]='COMPLETEDBYAGENT';logger[_0x68fe('0x62')](_0x68fe('0x85'),_0x1e70ff[_0x68fe('0x45')],_0x1e70ff[_0x68fe('0x54')]);}}}catch(_0x2c3713){logger['error'](_0x68fe('0x84'),_0x2c4765[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x2c3713,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x86')]=function(_0xb47937){try{if(this['isNotNull'](_0xb47937)){logger[_0x68fe('0x3f')](_0x68fe('0x87'),_0xb47937['uniqueid'],util[_0x68fe('0x38')](_0xb47937,{'showHidden':![],'depth':null}));if(this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]]){var _0x917669=_['last'](this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]]);_0x917669[_0x68fe('0x19')]=![];_0x917669[_0x68fe('0x88')]=null;_0x917669[_0x68fe('0x89')]=!![];_0x917669[_0x68fe('0x7e')]=_0xb47937[_0x68fe('0x8a')];_0x917669[_0x68fe('0x7b')]=_0xb47937[_0x68fe('0x7b')];_0x917669[_0x68fe('0x79')]=!![];_0x917669[_0x68fe('0x8b')]=![];_0x917669[_0x68fe('0x8c')]=null;if(!_0x917669['transfer']){if(_0xb47937[_0x68fe('0x8d')]==_0x68fe('0x8e')){_0x917669['queuecallerexitreason']=_0x68fe('0x8f');logger[_0x68fe('0x62')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x917669[_0x68fe('0x45')],_0x917669[_0x68fe('0x54')]);}else{if(_[_0x68fe('0x90')](_0xb47937[_0x68fe('0x35')][_0x68fe('0x91')](),_0x68fe('0x92'))){if(this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x93')]]){var _0x10e164=_[_0x68fe('0x78')](this['queueReports'][_0xb47937['linkedid']]);_0x10e164[_0x68fe('0x79')]=![];_0x10e164[_0x68fe('0x8b')]=!![];_0x10e164['queuecallerexitAt']=moment(_0x917669[_0x68fe('0x6d')])['add'](_0xb47937['holdtime'],_0x68fe('0x94'))[_0x68fe('0x43')](_0x68fe('0x6e'));_0x10e164['queuecallerexitreason']=_0x68fe('0x95');_0x10e164[_0x68fe('0x8e')]=!![];_0x10e164[_0x68fe('0x96')]='FORWARD';_0x10e164[_0x68fe('0x97')]=_0xb47937[_0x68fe('0x98')];_0x10e164['transferuniqueid']=_0xb47937[_0x68fe('0x42')];logger['info'](_0x68fe('0x99'),_0x10e164[_0x68fe('0x45')],_0x10e164[_0x68fe('0x54')]);var _0x1c7263=this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x93')]];this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x93')]]=this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]];this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]]=_0x1c7263;}}else{_0x917669['queuecallerexitreason']=_0x68fe('0x9a')+_0xb47937[_0x68fe('0x8d')][_0x68fe('0x9b')]();logger[_0x68fe('0x62')](_0x68fe('0x9c'),_0x917669[_0x68fe('0x45')],_0x917669[_0x68fe('0x54')],_0x917669['queuecallerexitreason']);}}}this[_0x68fe('0xe')][_0xb47937[_0x68fe('0x42')]]=_0x917669;this['emitVoiceQueueChannelRemove'](_0x917669,_0x68fe('0x1d'));}}}catch(_0x1e9076){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0xb47937['uniqueid'],util['inspect'](_0x1e9076,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x21')]=function(_0x2c0446){try{if(this[_0x68fe('0x5d')](_0x2c0446)){logger[_0x68fe('0x3f')](_0x68fe('0x9d'),_0x2c0446['uniqueid'],util[_0x68fe('0x38')](_0x2c0446,{'showHidden':![],'depth':null}));this[_0x68fe('0x9e')](_0x2c0446['uniqueid'],_[_0x68fe('0x74')](_0x2c0446['variable'])[0x0],_0x2c0446[_0x68fe('0x9f')]);if(this[_0x68fe('0x39')][_0x2c0446[_0x68fe('0x42')]]){var _0x3935fe=_['last'](this[_0x68fe('0x39')][_0x2c0446[_0x68fe('0x42')]]);if(_0x3935fe){if(this[_0x68fe('0x5d')](_0x2c0446[_0x68fe('0xa0')])&&this[_0x68fe('0x5d')](_0x2c0446[_0x68fe('0xa0')]['queuestatus'])){switch(_0x2c0446['value']){case _0x68fe('0xa1'):_0x3935fe['queuecallerexit']=![];_0x3935fe['queuecallerexitAt']=null;break;case _0x68fe('0xa2'):_0x3935fe['lastevent']='timeout';_0x3935fe[_0x68fe('0x8b')]=!![];_0x3935fe[_0x68fe('0x8c')]=moment()['format'](_0x68fe('0x6e'));_0x3935fe[_0x68fe('0x81')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));logger[_0x68fe('0x3f')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2c0446['uniqueid'],util[_0x68fe('0x38')](_0x3935fe,{'showHidden':![],'depth':null}));ami[_0x68fe('0x3e')](_0x68fe('0xa3'),_0x3935fe);break;default:_0x3935fe[_0x68fe('0x8b')]=!![];_0x3935fe['queuecallerexitAt']=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0x3935fe['queuecallerleaveAt']=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));}_0x3935fe['queuecallerabandon']=![];_0x3935fe[_0x68fe('0x88')]=null;_0x3935fe[_0x68fe('0x4a')]=_0x2c0446[_0x68fe('0x9f')];this[_0x68fe('0xe')][_0x2c0446[_0x68fe('0x42')]]=_0x3935fe;this[_0x68fe('0x48')](_0x3935fe,_0x68fe('0x20'));}else if(this['isNotNull'](_0x2c0446[_0x68fe('0xa0')])&&this[_0x68fe('0x5d')](_0x2c0446['variable'][_0x68fe('0xa4')])){if(!_0x3935fe[_0x68fe('0x19')]){_0x3935fe['queuecallerexit']=!![];_0x3935fe[_0x68fe('0x8c')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0x3935fe[_0x68fe('0x4a')]='EXITWITHKEY';_0x3935fe[_0x68fe('0x81')]=moment()[_0x68fe('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2c0446[_0x68fe('0x42')]]=_0x3935fe;}}logger[_0x68fe('0x62')](_0x68fe('0xa5'),_0x2c0446[_0x68fe('0x42')],_0x3935fe[_0x68fe('0x45')],_0x3935fe['type'],_['keys'](_0x2c0446[_0x68fe('0xa0')])[0x0],_0x2c0446['value']);_0x3935fe[_0x68fe('0x13')]=this['variables'][_0x2c0446[_0x68fe('0x42')]];}}}}catch(_0x38fa65){logger[_0x68fe('0x3a')](_0x68fe('0x9d'),_0x2c0446[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x38fa65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x9e')]=function(_0x18c211,_0x115ab,_0x5a7a3f){var _0x3ac258=['rtpaudioqos',_0x68fe('0xa6'),_0x68fe('0xa7'),_0x68fe('0xa8'),_0x68fe('0xa9'),_0x68fe('0xaa'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x68fe('0xab'),'sipuri','bridgepeer',_0x68fe('0xac'),_0x68fe('0xad'),'memberdynamic','memberinterface',_0x68fe('0xae'),_0x68fe('0x8a'),_0x68fe('0xaf'),'memberrealtime'];if(!_['isNil'](_0x115ab)&&!_[_0x68fe('0xb0')](_0x3ac258,_0x115ab)){if(_['isUndefined'](this[_0x68fe('0x13')][_0x18c211])){this['variables'][_0x18c211]={};}this['variables'][_0x18c211][_0x115ab]=_0x5a7a3f;}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0xb1')]=function(_0x2bde6d,_0x4a3ca2,_0x230400){var _0x83efea={};for(var _0x347e20=0x0;_0x347e20=0x0?moment(_0x3ecb71['endtime'])[_0x9be4('0xc')](_0x3ecb71[_0x9be4('0x14')],_0x9be4('0xd')):null,'data1':_0x9be4('0x15'),'data2':_0x3ecb71['accountcode'],'data3':_0x3ecb71[_0x9be4('0x10')],'data4':_0x3ecb71[_0x9be4('0x16')]||null,'role':_0x9be4('0x12'),'internal':_0x3ecb71[_0x9be4('0x13')]?_[_0x9be4('0x17')](_0x3ecb71[_0x9be4('0x13')]):undefined,'uniqueid':_0x3ecb71['uniqueid']},'log':_0x9be4('0x4')});}; \ No newline at end of file +var _0x16a9=['interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','calleridnum','exten','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','uniqueid','moment','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo'];(function(_0x53165a,_0x5ac25e){var _0x43c841=function(_0x40ab55){while(--_0x40ab55){_0x53165a['push'](_0x53165a['shift']());}};_0x43c841(++_0x5ac25e);}(_0x16a9,0xea));var _0x916a=function(_0xf78258,_0x5e781c){_0xf78258=_0xf78258-0x0;var _0x20c78e=_0x16a9[_0xf78258];return _0x20c78e;};'use strict';var moment=require(_0x916a('0x0'));var _=require('lodash');var util=require('util');var client=require(_0x916a('0x1'));exports[_0x916a('0x2')]=function(_0x3d2e9f){var _0x4889fd=_0x3d2e9f[_0x916a('0x3')]||_0x3d2e9f[_0x916a('0x4')];return client[_0x916a('0x5')](_0x916a('0x6'),{'body':{'channel':_0x916a('0x7'),'membername':_0x3d2e9f[_0x916a('0x8')],'interface':_['isNil'](_0x3d2e9f[_0x916a('0x9')])?util[_0x916a('0xa')](_0x916a('0xb'),_0x3d2e9f['lastAssignedTo']):_0x3d2e9f['interface'],'type':_0x916a('0xc'),'enterAt':_0x3d2e9f[_0x916a('0xd')],'exitAt':_0x4889fd,'duration':moment(_0x4889fd)['diff'](_0x3d2e9f[_0x916a('0xd')],_0x916a('0xe')),'data1':'inbound','data2':_0x3d2e9f[_0x916a('0xf')],'data3':_0x3d2e9f[_0x916a('0x10')],'data4':null,'data5':_0x3d2e9f['queue'],'role':'agent','internal':_0x3d2e9f[_0x916a('0x11')]?_[_0x916a('0x12')](_0x3d2e9f[_0x916a('0x11')]):undefined,'uniqueid':_0x3d2e9f['uniqueid']},'log':_0x916a('0x6')});};exports[_0x916a('0x13')]=function(_0x160b07){return client['Request'](_0x916a('0x6'),{'body':{'channel':_0x916a('0x7'),'membername':_0x160b07[_0x916a('0x14')],'interface':_0x160b07['interface'],'type':_0x916a('0xc'),'enterAt':_0x160b07[_0x916a('0x15')],'exitAt':_0x160b07[_0x916a('0x16')],'duration':moment(_0x160b07['endtime'])[_0x916a('0x17')](_0x160b07[_0x916a('0x15')],_0x916a('0xe'))>=0x0?moment(_0x160b07['endtime'])[_0x916a('0x17')](_0x160b07[_0x916a('0x15')],_0x916a('0xe')):null,'data1':_0x916a('0x18'),'data2':_0x160b07['accountcode'],'data3':_0x160b07[_0x916a('0x10')],'data4':_0x160b07[_0x916a('0x19')]||null,'role':'agent','internal':_0x160b07[_0x916a('0x11')]?_[_0x916a('0x12')](_0x160b07[_0x916a('0x11')]):undefined,'uniqueid':_0x160b07[_0x916a('0x1a')]},'log':_0x916a('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 96db513..84463ab 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 _0xe5b5=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x5f4c7e,_0xde2e8b){var _0x28052b=function(_0x556cb9){while(--_0x556cb9){_0x5f4c7e['push'](_0x5f4c7e['shift']());}};_0x28052b(++_0xde2e8b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0xe5b5[_0x2e6c19];return _0x52885d;};'use strict';var client=require(_0x5e5b('0x0'));exports[_0x5e5b('0x1')]=function(){return client[_0x5e5b('0x2')](_0x5e5b('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5e5b('0x4'),_0x5e5b('0x5')]},'log':_0x5e5b('0x6')});}; \ No newline at end of file +var _0xca1d=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2eecef,_0x193bf1){var _0x230c65=function(_0x1a440a){while(--_0x1a440a){_0x2eecef['push'](_0x2eecef['shift']());}};_0x230c65(++_0x193bf1);}(_0xca1d,0x1e6));var _0xdca1=function(_0x1b6db5,_0x27fedf){_0x1b6db5=_0x1b6db5-0x0;var _0x57169e=_0xca1d[_0x1b6db5];return _0x57169e;};'use strict';var client=require(_0xdca1('0x0'));exports[_0xdca1('0x1')]=function(){return client[_0xdca1('0x2')](_0xdca1('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xdca1('0x4'),_0xdca1('0x5')]},'log':_0xdca1('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ba37b3d..421c33d 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 _0x9afa=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x2bdcda,_0x4ff3f4){var _0x55100f=function(_0x22fb48){while(--_0x22fb48){_0x2bdcda['push'](_0x2bdcda['shift']());}};_0x55100f(++_0x4ff3f4);}(_0x9afa,0x1af));var _0xa9af=function(_0x361244,_0x100205){_0x361244=_0x361244-0x0;var _0x3d49b3=_0x9afa[_0x361244];return _0x3d49b3;};'use strict';var client=require(_0xa9af('0x0'));exports[_0xa9af('0x1')]=function(_0x2501e9){return function(_0x1fffc5){return client[_0xa9af('0x2')](_0xa9af('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa9af('0x4'),_0xa9af('0x5')]},'log':_0xa9af('0x3')});};}; \ No newline at end of file +var _0xa400=['GetTemplate','name','html','../client','Request'];(function(_0x5ca6b5,_0x48a6dd){var _0x9adb46=function(_0x1fb723){while(--_0x1fb723){_0x5ca6b5['push'](_0x5ca6b5['shift']());}};_0x9adb46(++_0x48a6dd);}(_0xa400,0x1cf));var _0x0a40=function(_0x5b8334,_0x341c4b){_0x5b8334=_0x5b8334-0x0;var _0x17a341=_0xa400[_0x5b8334];return _0x17a341;};'use strict';var client=require(_0x0a40('0x0'));exports['getTemplates']=function(_0x5d1f1e){return function(_0x4d7efa){return client[_0x0a40('0x1')](_0x0a40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0a40('0x3'),_0x0a40('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ae8fbfb..73edc2a 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 _0x9fa4=['operator','value','Action','Actions','action','data2','data3','data4','data6','data7','../client','getTriggers','Request','name','channel','status','Condition','AnyConditions'];(function(_0x3c0afd,_0x51cb41){var _0x3d942a=function(_0x3edb92){while(--_0x3edb92){_0x3c0afd['push'](_0x3c0afd['shift']());}};_0x3d942a(++_0x51cb41);}(_0x9fa4,0xf4));var _0x49fa=function(_0x385b7c,_0x749402){_0x385b7c=_0x385b7c-0x0;var _0x3c30f7=_0x9fa4[_0x385b7c];return _0x3c30f7;};'use strict';var client=require(_0x49fa('0x0'));exports[_0x49fa('0x1')]=function(_0x457f66){return function(_0x1a373c){return client[_0x49fa('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x49fa('0x3'),_0x49fa('0x4'),_0x49fa('0x5')],'include':[{'model':_0x49fa('0x6'),'as':'AllConditions','attributes':['id','field','operator','value']},{'model':_0x49fa('0x6'),'as':_0x49fa('0x7'),'attributes':['id','field',_0x49fa('0x8'),_0x49fa('0x9')]},{'model':_0x49fa('0xa'),'as':_0x49fa('0xb'),'attributes':['id',_0x49fa('0xc'),'data1',_0x49fa('0xd'),_0x49fa('0xe'),_0x49fa('0xf'),'data5',_0x49fa('0x10'),_0x49fa('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x9ae8=['data4','data5','data7','../client','getTriggers','Request','name','channel','AllConditions','field','operator','value','Condition','AnyConditions','Action','action','data1','data2','data3'];(function(_0xf5d73f,_0x9a2f9c){var _0x5479ca=function(_0x4d32f7){while(--_0x4d32f7){_0xf5d73f['push'](_0xf5d73f['shift']());}};_0x5479ca(++_0x9a2f9c);}(_0x9ae8,0x9b));var _0x89ae=function(_0x5f00b8,_0x2e4642){_0x5f00b8=_0x5f00b8-0x0;var _0x41fb38=_0x9ae8[_0x5f00b8];return _0x41fb38;};'use strict';var client=require(_0x89ae('0x0'));exports[_0x89ae('0x1')]=function(_0x470037){return function(_0x3d8d08){return client[_0x89ae('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x89ae('0x3'),_0x89ae('0x4'),'status'],'include':[{'model':'Condition','as':_0x89ae('0x5'),'attributes':['id',_0x89ae('0x6'),_0x89ae('0x7'),_0x89ae('0x8')]},{'model':_0x89ae('0x9'),'as':_0x89ae('0xa'),'attributes':['id',_0x89ae('0x6'),_0x89ae('0x7'),_0x89ae('0x8')]},{'model':_0x89ae('0xb'),'as':'Actions','attributes':['id',_0x89ae('0xc'),_0x89ae('0xd'),_0x89ae('0xe'),_0x89ae('0xf'),_0x89ae('0x10'),_0x89ae('0x11'),'data6',_0x89ae('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7936e99..257aa93 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 _0x18ea=['../client','getTrunks','Request','GetTrunk','registry'];(function(_0x1b19d6,_0x56ec99){var _0x21e1ef=function(_0x4279c9){while(--_0x4279c9){_0x1b19d6['push'](_0x1b19d6['shift']());}};_0x21e1ef(++_0x56ec99);}(_0x18ea,0xbe));var _0xa18e=function(_0x47f8fe,_0xe0505a){_0x47f8fe=_0x47f8fe-0x0;var _0x2723e3=_0x18ea[_0x47f8fe];return _0x2723e3;};'use strict';var client=require(_0xa18e('0x0'));exports[_0xa18e('0x1')]=function(_0x4b3cf6){return function(_0x5ea202){return client[_0xa18e('0x2')](_0xa18e('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xa18e('0x4'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xc5b1=['GetTrunk','defaultuser','../client','getTrunks'];(function(_0x32abf8,_0x3e0374){var _0x20bcdf=function(_0x4ae592){while(--_0x4ae592){_0x32abf8['push'](_0x32abf8['shift']());}};_0x20bcdf(++_0x3e0374);}(_0xc5b1,0x106));var _0x1c5b=function(_0x5863b8,_0x22f9eb){_0x5863b8=_0x5863b8-0x0;var _0x531413=_0xc5b1[_0x5863b8];return _0x531413;};'use strict';var client=require(_0x1c5b('0x0'));exports[_0x1c5b('0x1')]=function(_0x140f1d){return function(_0x5a9bb3){return client['Request'](_0x1c5b('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x1c5b('0x3')]},'log':_0x1c5b('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index eda2828..e98b274 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x43588b,_0x4ef53a){var _0x333d63=function(_0x2fe52c){while(--_0x2fe52c){_0x43588b['push'](_0x43588b['shift']());}};_0x333d63(++_0x4ef53a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1d5e03,_0x35f91a){var _0x52ea3d=function(_0x54c32b){while(--_0x54c32b){_0x1d5e03['push'](_0x1d5e03['shift']());}};_0x52ea3d(++_0x35f91a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index a14144b..066247f 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 _0x76ff=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x347d10,_0x2d798f){var _0x1154c5=function(_0x201ce9){while(--_0x201ce9){_0x347d10['push'](_0x347d10['shift']());}};_0x1154c5(++_0x2d798f);}(_0x76ff,0xc4));var _0xf76f=function(_0x20b80e,_0x1c61e9){_0x20b80e=_0x20b80e-0x0;var _0xcc904b=_0x76ff[_0x20b80e];return _0xcc904b;};'use strict';var client=require('../client');exports[_0xf76f('0x0')]=function(_0x1ed857){return client[_0xf76f('0x1')](_0xf76f('0x2'),{'body':_0x1ed857,'log':_0xf76f('0x2')});};exports['update']=function(_0x513a1a,_0x284176,_0x16f162){return client[_0xf76f('0x1')]('UpdateVoiceAgentReport',{'body':_0x513a1a,'options':{'where':{'uniqueid':_0x284176,'interface':_0x16f162,'agentcomplete':!![]}},'log':_0xf76f('0x3')});}; \ No newline at end of file +var _0x544d=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x45f835,_0x548fa7){var _0x21d213=function(_0x56d780){while(--_0x56d780){_0x45f835['push'](_0x45f835['shift']());}};_0x21d213(++_0x548fa7);}(_0x544d,0xb5));var _0xd544=function(_0x4f3070,_0xa0e620){_0x4f3070=_0x4f3070-0x0;var _0x4c4675=_0x544d[_0x4f3070];return _0x4c4675;};'use strict';var client=require(_0xd544('0x0'));exports['create']=function(_0x37e12d){return client[_0xd544('0x1')](_0xd544('0x2'),{'body':_0x37e12d,'log':_0xd544('0x2')});};exports[_0xd544('0x3')]=function(_0x1b93e8,_0x240b1e,_0x20a47c){return client[_0xd544('0x1')]('UpdateVoiceAgentReport',{'body':_0x1b93e8,'options':{'where':{'uniqueid':_0x240b1e,'interface':_0x20a47c,'agentcomplete':!![]}},'log':_0xd544('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d4a9a73..1d39698 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 _0xcf7c=['lodash','../client','Request','CreateVoiceCallReport','calleridnum','getVoiceCallReports','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x31615d,_0x54f1b0){var _0x444451=function(_0x5d2b08){while(--_0x5d2b08){_0x31615d['push'](_0x31615d['shift']());}};_0x444451(++_0x54f1b0);}(_0xcf7c,0x1ae));var _0xccf7=function(_0x57eebd,_0x561057){_0x57eebd=_0x57eebd-0x0;var _0x343a79=_0xcf7c[_0x57eebd];return _0x343a79;};'use strict';var moment=require(_0xccf7('0x0'));var util=require(_0xccf7('0x1'));var _=require(_0xccf7('0x2'));var client=require(_0xccf7('0x3'));exports['create']=function(_0x421145){return client[_0xccf7('0x4')](_0xccf7('0x5'),{'body':_['merge'](_0x421145,{'source':_0x421145[_0xccf7('0x6')],'destinationcontext':_0x421145['context'],'callerid':_0x421145['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xccf7('0x7')]=function(){return function(){return client[_0xccf7('0x4')](_0xccf7('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xccf7('0x9')]('day')[_0xccf7('0xa')](_0xccf7('0xb')),moment()[_0xccf7('0xc')](_0xccf7('0xd'))['format'](_0xccf7('0xb'))]}},'attributes':[_0xccf7('0xe'),_0xccf7('0xf'),'duration',_0xccf7('0x10')]},'log':_0xccf7('0x11')});};}; \ No newline at end of file +var _0xdb9d=['format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','outbound','day'];(function(_0x3fea87,_0x5917e4){var _0x5c5a53=function(_0x3b8ceb){while(--_0x3b8ceb){_0x3fea87['push'](_0x3fea87['shift']());}};_0x5c5a53(++_0x5917e4);}(_0xdb9d,0x198));var _0xddb9=function(_0x59c86e,_0x38ce57){_0x59c86e=_0x59c86e-0x0;var _0x48a50e=_0xdb9d[_0x59c86e];return _0x48a50e;};'use strict';var moment=require(_0xddb9('0x0'));var util=require(_0xddb9('0x1'));var _=require(_0xddb9('0x2'));var client=require('../client');exports['create']=function(_0x3adce9){return client[_0xddb9('0x3')](_0xddb9('0x4'),{'body':_[_0xddb9('0x5')](_0x3adce9,{'source':_0x3adce9[_0xddb9('0x6')],'destinationcontext':_0x3adce9[_0xddb9('0x7')],'callerid':_0x3adce9['callerid'],'amaflags':_0xddb9('0x8')}),'log':_0xddb9('0x4')});};exports[_0xddb9('0x9')]=function(){return function(){return client[_0xddb9('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xddb9('0xa')],'createdAt':{'$between':[moment()['startOf'](_0xddb9('0xb'))[_0xddb9('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xddb9('0xd')](_0xddb9('0xb'))[_0xddb9('0xc')](_0xddb9('0xe'))]}},'attributes':[_0xddb9('0xf'),_0xddb9('0x10'),_0xddb9('0x11'),_0xddb9('0x12')]},'log':_0xddb9('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c5ffc10..1bc8338 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 _0xa6c1=['create','Request','CreateVoiceDialReport','../client'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xa6c1,0xab));var _0x1a6c=function(_0x34b1b8,_0x54c9bf){_0x34b1b8=_0x34b1b8-0x0;var _0x542dd8=_0xa6c1[_0x34b1b8];return _0x542dd8;};'use strict';var client=require(_0x1a6c('0x0'));exports[_0x1a6c('0x1')]=function(_0x19b09d){return client[_0x1a6c('0x2')](_0x1a6c('0x3'),{'body':_0x19b09d,'log':_0x1a6c('0x3')});}; \ No newline at end of file +var _0x6ebb=['CreateVoiceDialReport','Request'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x6ebb,0xfb));var _0xb6eb=function(_0x2c4d54,_0x33e012){_0x2c4d54=_0x2c4d54-0x0;var _0x3c9e0e=_0x6ebb[_0x2c4d54];return _0x3c9e0e;};'use strict';var client=require('../client');exports['create']=function(_0x390505){return client[_0xb6eb('0x0')](_0xb6eb('0x1'),{'body':_0x390505,'log':_0xb6eb('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 881a801..fca18ce 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 _0xa1fd=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x4b8ab7,_0x37c8bd){_0x4b8ab7=_0x4b8ab7-0x0;var _0x3f6c00=_0xa1fd[_0x4b8ab7];return _0x3f6c00;};'use strict';var client=require(_0xda1f('0x0'));exports[_0xda1f('0x1')]=function(){return function(){return client[_0xda1f('0x2')](_0xda1f('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xda1f('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xda1f('0x1')});};}; \ No newline at end of file +var _0x0fd9=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x30ca97,_0x2603d4){var _0x4ec15e=function(_0x391650){while(--_0x391650){_0x30ca97['push'](_0x30ca97['shift']());}};_0x4ec15e(++_0x2603d4);}(_0x0fd9,0xa3));var _0x90fd=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0x0fd9[_0x2300c7];return _0x23f720;};'use strict';var client=require('../client');exports[_0x90fd('0x0')]=function(){return function(){return client[_0x90fd('0x1')](_0x90fd('0x2'),{'options':{'raw':!![],'attributes':['id',_0x90fd('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 01494e8..8003a94 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 _0xc449=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions'];(function(_0x480f2d,_0x247f7b){var _0x46acd2=function(_0xb47efe){while(--_0xb47efe){_0x480f2d['push'](_0x480f2d['shift']());}};_0x46acd2(++_0x247f7b);}(_0xc449,0x6f));var _0x9c44=function(_0x41c4d9,_0x5d24cb){_0x41c4d9=_0x41c4d9-0x0;var _0x40f211=_0xc449[_0x41c4d9];return _0x40f211;};'use strict';var client=require(_0x9c44('0x0'));exports[_0x9c44('0x1')]=function(){return function(){return client[_0x9c44('0x2')](_0x9c44('0x3'),{'options':{'raw':![],'attributes':['id',_0x9c44('0x4'),_0x9c44('0x5'),_0x9c44('0x6'),'autopause',_0x9c44('0x7'),_0x9c44('0x8'),'dialActive','dialMethod',_0x9c44('0x9'),'dialLimitQueue',_0x9c44('0xa'),'dialPredictiveOptimization',_0x9c44('0xb'),_0x9c44('0xc'),'dialOriginateCallerIdName',_0x9c44('0xd'),'dialOriginateTimeout',_0x9c44('0xe'),'dialQueueTimeout','dialQueueProject',_0x9c44('0xf'),_0x9c44('0x10'),_0x9c44('0x11'),'dialBusyRetryFrequency',_0x9c44('0x12'),_0x9c44('0x13'),_0x9c44('0x14'),_0x9c44('0x15'),_0x9c44('0x16'),_0x9c44('0x17'),_0x9c44('0x18'),_0x9c44('0x19'),_0x9c44('0x1a'),'dialAMDGreeting',_0x9c44('0x1b'),_0x9c44('0x1c'),_0x9c44('0x1d'),_0x9c44('0x1e'),_0x9c44('0x1f'),'dialAMDSilenceThreshold',_0x9c44('0x20'),_0x9c44('0x21'),_0x9c44('0x22'),_0x9c44('0x23'),_0x9c44('0x24'),_0x9c44('0x25'),_0x9c44('0x26'),_0x9c44('0x27'),_0x9c44('0x7'),'strategy',_0x9c44('0x28'),_0x9c44('0x29'),_0x9c44('0x2a'),_0x9c44('0x2b'),_0x9c44('0x2c'),_0x9c44('0x2d'),'dialAbandonedMaxRetry',_0x9c44('0x2e'),_0x9c44('0x2f'),_0x9c44('0x30'),_0x9c44('0x31'),_0x9c44('0x32'),_0x9c44('0x33'),_0x9c44('0x34'),'dialPredictiveIntervalMinThreshold',_0x9c44('0x35'),'dialPreviewRecallmeReminder',_0x9c44('0x36')],'include':[{'model':_0x9c44('0x37'),'as':_0x9c44('0x37'),'attributes':['id',_0x9c44('0x4'),_0x9c44('0x38'),'active']},{'model':_0x9c44('0x39'),'as':_0x9c44('0x3a'),'attributes':['id',_0x9c44('0x4')]},{'model':_0x9c44('0x37'),'as':_0x9c44('0x3b'),'attributes':['id',_0x9c44('0x4'),_0x9c44('0x38'),_0x9c44('0x3c')]},{'model':'Interval','as':_0x9c44('0x3d'),'attributes':['id',_0x9c44('0x4')],'include':[{'model':_0x9c44('0x3d'),'as':_0x9c44('0x3e'),'attributes':['id',_0x9c44('0x4'),'interval']}]}]},'log':_0x9c44('0x1')});};}; \ No newline at end of file +var _0x9d71=['dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0x9d71,0xd4));var _0x19d7=function(_0x4abd12,_0x2732dd){_0x4abd12=_0x4abd12-0x0;var _0x1d4d92=_0x9d71[_0x4abd12];return _0x1d4d92;};'use strict';var client=require(_0x19d7('0x0'));exports[_0x19d7('0x1')]=function(){return function(){return client[_0x19d7('0x2')](_0x19d7('0x3'),{'options':{'raw':![],'attributes':['id',_0x19d7('0x4'),_0x19d7('0x5'),_0x19d7('0x6'),_0x19d7('0x7'),_0x19d7('0x8'),_0x19d7('0x9'),_0x19d7('0xa'),_0x19d7('0xb'),_0x19d7('0xc'),'dialLimitQueue','dialPowerLevel',_0x19d7('0xd'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0x19d7('0xe'),_0x19d7('0xf'),_0x19d7('0x10'),_0x19d7('0x11'),_0x19d7('0x12'),_0x19d7('0x13'),'dialCongestionRetryFrequency',_0x19d7('0x14'),_0x19d7('0x15'),'dialNoAnswerMaxRetry',_0x19d7('0x16'),_0x19d7('0x17'),_0x19d7('0x18'),'dialGlobalInterval',_0x19d7('0x19'),_0x19d7('0x1a'),_0x19d7('0x1b'),'dialAMDInitialSilence',_0x19d7('0x1c'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x19d7('0x1d'),_0x19d7('0x1e'),_0x19d7('0x1f'),_0x19d7('0x20'),'dialAMDMaximumWordLength',_0x19d7('0x21'),_0x19d7('0x22'),'dialRecallInQueue','dialOrderByScheduledAt',_0x19d7('0x23'),'dialAgiAfterHangupClient',_0x19d7('0x24'),'monitor_format',_0x19d7('0x25'),_0x19d7('0x26'),'dialCutDigit',_0x19d7('0x27'),'dialNoSuchNumberRetryFrequency',_0x19d7('0x28'),_0x19d7('0x29'),_0x19d7('0x2a'),'dialAbandonedRetryFrequency',_0x19d7('0x2b'),_0x19d7('0x2c'),_0x19d7('0x2d'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x19d7('0x2e'),_0x19d7('0x2f'),_0x19d7('0x30'),'dialPreviewRecallmeReminder',_0x19d7('0x31')],'include':[{'model':_0x19d7('0x32'),'as':_0x19d7('0x32'),'attributes':['id','name',_0x19d7('0x33'),_0x19d7('0x34')]},{'model':_0x19d7('0x35'),'as':_0x19d7('0x36'),'attributes':['id',_0x19d7('0x4')]},{'model':_0x19d7('0x32'),'as':_0x19d7('0x37'),'attributes':['id',_0x19d7('0x4'),_0x19d7('0x33'),_0x19d7('0x34')]},{'model':_0x19d7('0x38'),'as':_0x19d7('0x38'),'attributes':['id',_0x19d7('0x4')],'include':[{'model':'Interval','as':_0x19d7('0x39'),'attributes':['id','name',_0x19d7('0x3a')]}]}]},'log':_0x19d7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 0645f63..c196167 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(_0x50ad81,_0x245fc3){var _0x743c7a=function(_0x413133){while(--_0x413133){_0x50ad81['push'](_0x50ad81['shift']());}};_0x743c7a(++_0x245fc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x193826,_0x5f400d){var _0x4d9c6b=function(_0x559c8c){while(--_0x559c8c){_0x193826['push'](_0x193826['shift']());}};_0x4d9c6b(++_0x5f400d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 4460c87..a7a696e 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 _0x4323=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x4323,0xa3));var _0x3432=function(_0x4348cf,_0x3c5e31){_0x4348cf=_0x4348cf-0x0;var _0xa33ff3=_0x4323[_0x4348cf];return _0xa33ff3;};'use strict';var client=require(_0x3432('0x0'));exports['getVoiceQueueRtPauses']=function(_0x22f53f){return function(){return client[_0x3432('0x1')](_0x3432('0x2'),{'options':{'where':{'VoiceQueueId':_0x22f53f,'paused':!![]},'raw':!![]},'log':_0x3432('0x3')});};}; \ No newline at end of file +var _0x3574=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2f653f,_0x1cef4e){var _0x479836=function(_0x4182c2){while(--_0x4182c2){_0x2f653f['push'](_0x2f653f['shift']());}};_0x479836(++_0x1cef4e);}(_0x3574,0x132));var _0x4357=function(_0x2cee5e,_0x62bcf5){_0x2cee5e=_0x2cee5e-0x0;var _0x394970=_0x3574[_0x2cee5e];return _0x394970;};'use strict';var client=require('../client');exports[_0x4357('0x0')]=function(_0x400536){return function(){return client[_0x4357('0x1')](_0x4357('0x2'),{'options':{'where':{'VoiceQueueId':_0x400536,'paused':!![]},'raw':!![]},'log':_0x4357('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 30379bb..0f7365d 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x300a6d,_0x20c711){var _0x18fd7a=function(_0x2c0621){while(--_0x2c0621){_0x300a6d['push'](_0x300a6d['shift']());}};_0x18fd7a(++_0x20c711);}(_0x7a54,0x106));var _0x47a5=function(_0x466adf,_0x442429){_0x466adf=_0x466adf-0x0;var _0x144c58=_0x7a54[_0x466adf];return _0x144c58;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x381acb,_0x1cd68c){var _0x56db71=function(_0x97d0ca){while(--_0x97d0ca){_0x381acb['push'](_0x381acb['shift']());}};_0x56db71(++_0x1cd68c);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5d0a,_0x1c6920){_0x4a5d0a=_0x4a5d0a-0x0;var _0x4adb50=_0x7a54[_0x4a5d0a];return _0x4adb50;};'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 30606c1..edb7589 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 _0xe098=['origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','Request','origtransfererchannel'];(function(_0x2e10b0,_0x3a9ab9){var _0x51fd9b=function(_0x3438e9){while(--_0x3438e9){_0x2e10b0['push'](_0x2e10b0['shift']());}};_0x51fd9b(++_0x3a9ab9);}(_0xe098,0xf2));var _0x8e09=function(_0x312f95,_0x27911d){_0x312f95=_0x312f95-0x0;var _0x4c1891=_0xe098[_0x312f95];return _0x4c1891;};'use strict';var client=require(_0x8e09('0x0'));exports[_0x8e09('0x1')]={};exports[_0x8e09('0x2')]=function(_0x466e69){return client['Request'](_0x8e09('0x3'),{'body':{'result':_0x466e69[_0x8e09('0x4')],'transfererchannel':_0x466e69['transfererchannel'],'transferercalleridnum':_0x466e69[_0x8e09('0x5')],'transferercalleridname':_0x466e69[_0x8e09('0x6')],'transfererconnectedlinenum':_0x466e69[_0x8e09('0x7')],'transfererconnectedlinename':_0x466e69[_0x8e09('0x8')],'transfereraccountcode':_0x466e69[_0x8e09('0x9')],'transferercontext':_0x466e69['transferercontext'],'transfererexten':_0x466e69['transfererexten'],'transfererlinkedid':_0x466e69[_0x8e09('0xa')],'transfereechannel':_0x466e69[_0x8e09('0xb')],'transfereecalleridnum':_0x466e69[_0x8e09('0xc')],'transfereecalleridname':_0x466e69[_0x8e09('0xd')],'transfereeconnectedlinenum':_0x466e69[_0x8e09('0xe')],'transfereeconnectedlinename':_0x466e69[_0x8e09('0xf')],'transfereeaccountcode':_0x466e69[_0x8e09('0x10')],'transfereecontext':_0x466e69['transfereecontext'],'transfereeexten':_0x466e69[_0x8e09('0x11')],'transfereelinkedid':_0x466e69[_0x8e09('0x12')],'isexternal':_0x466e69[_0x8e09('0x13')],'context':_0x466e69[_0x8e09('0x14')],'extension':_0x466e69['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x8e09('0x15')]=function(_0x1457ab){return client[_0x8e09('0x16')](_0x8e09('0x3'),{'body':{'result':_0x1457ab['result'],'transfererchannel':_0x1457ab[_0x8e09('0x17')],'transferercalleridnum':_0x1457ab['origtransferercalleridnum'],'transferercalleridname':_0x1457ab[_0x8e09('0x18')],'transfererconnectedlinenum':_0x1457ab['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1457ab[_0x8e09('0x19')],'transfereraccountcode':_0x1457ab[_0x8e09('0x1a')],'transferercontext':_0x1457ab['secondtransferercontext'],'transfererexten':_0x1457ab['secondtransfererexten'],'transfererlinkedid':_0x1457ab[_0x8e09('0x1b')],'transfereechannel':_0x1457ab['transfertargetchannel'],'transfereecalleridnum':_0x1457ab[_0x8e09('0x1c')],'transfereecalleridname':_0x1457ab[_0x8e09('0x1d')],'transfereeconnectedlinenum':_0x1457ab[_0x8e09('0x1e')],'transfereeconnectedlinename':_0x1457ab[_0x8e09('0x1f')],'transfereeaccountcode':_0x1457ab[_0x8e09('0x20')],'transfereecontext':_0x1457ab[_0x8e09('0x21')],'transfereeexten':_0x1457ab[_0x8e09('0x22')],'transfereelinkedid':_0x1457ab[_0x8e09('0x23')],'isexternal':_0x1457ab[_0x8e09('0x13')],'context':_0x1457ab[_0x8e09('0x24')],'extension':_0x1457ab[_0x8e09('0x25')],'type':'attended'},'log':_0x8e09('0x3')});}; \ No newline at end of file +var _0x35d0=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum'];(function(_0x32c5ec,_0x413832){var _0x3a16bf=function(_0x26f83d){while(--_0x26f83d){_0x32c5ec['push'](_0x32c5ec['shift']());}};_0x3a16bf(++_0x413832);}(_0x35d0,0x193));var _0x035d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x35d0[_0x3e5086];return _0xfeb102;};'use strict';var client=require('../client');exports[_0x035d('0x0')]={};exports[_0x035d('0x1')]=function(_0x337e7b){return client[_0x035d('0x2')](_0x035d('0x3'),{'body':{'result':_0x337e7b[_0x035d('0x4')],'transfererchannel':_0x337e7b[_0x035d('0x5')],'transferercalleridnum':_0x337e7b[_0x035d('0x6')],'transferercalleridname':_0x337e7b['transferercalleridname'],'transfererconnectedlinenum':_0x337e7b[_0x035d('0x7')],'transfererconnectedlinename':_0x337e7b[_0x035d('0x8')],'transfereraccountcode':_0x337e7b[_0x035d('0x9')],'transferercontext':_0x337e7b[_0x035d('0xa')],'transfererexten':_0x337e7b[_0x035d('0xb')],'transfererlinkedid':_0x337e7b[_0x035d('0xc')],'transfereechannel':_0x337e7b[_0x035d('0xd')],'transfereecalleridnum':_0x337e7b[_0x035d('0xe')],'transfereecalleridname':_0x337e7b[_0x035d('0xf')],'transfereeconnectedlinenum':_0x337e7b[_0x035d('0x10')],'transfereeconnectedlinename':_0x337e7b[_0x035d('0x11')],'transfereeaccountcode':_0x337e7b[_0x035d('0x12')],'transfereecontext':_0x337e7b[_0x035d('0x13')],'transfereeexten':_0x337e7b[_0x035d('0x14')],'transfereelinkedid':_0x337e7b[_0x035d('0x15')],'isexternal':_0x337e7b['isexternal'],'context':_0x337e7b[_0x035d('0x16')],'extension':_0x337e7b[_0x035d('0x17')],'type':_0x035d('0x18')},'log':_0x035d('0x3')});};exports['attendedTransfer']=function(_0x37e92a){return client[_0x035d('0x2')](_0x035d('0x3'),{'body':{'result':_0x37e92a['result'],'transfererchannel':_0x37e92a[_0x035d('0x19')],'transferercalleridnum':_0x37e92a[_0x035d('0x1a')],'transferercalleridname':_0x37e92a[_0x035d('0x1b')],'transfererconnectedlinenum':_0x37e92a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x37e92a[_0x035d('0x1c')],'transfereraccountcode':_0x37e92a[_0x035d('0x1d')],'transferercontext':_0x37e92a['secondtransferercontext'],'transfererexten':_0x37e92a[_0x035d('0x1e')],'transfererlinkedid':_0x37e92a[_0x035d('0x1f')],'transfereechannel':_0x37e92a[_0x035d('0x20')],'transfereecalleridnum':_0x37e92a[_0x035d('0x21')],'transfereecalleridname':_0x37e92a[_0x035d('0x22')],'transfereeconnectedlinenum':_0x37e92a[_0x035d('0x23')],'transfereeconnectedlinename':_0x37e92a[_0x035d('0x24')],'transfereeaccountcode':_0x37e92a[_0x035d('0x25')],'transfereecontext':_0x37e92a[_0x035d('0x26')],'transfereeexten':_0x37e92a['transfertargetexten'],'transfereelinkedid':_0x37e92a['transfertargetlinkedid'],'isexternal':_0x37e92a['isexternal'],'context':_0x37e92a['origtransferercontext'],'extension':_0x37e92a[_0x035d('0x27')],'type':_0x035d('0x28')},'log':_0x035d('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index c657a73..f77f812 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 _0x131e=['sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','uniqueid','channel','format','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','127.0.0.1','log','RPC\x20listening\x20on\x20port:','validate','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','isConnected','error','asterisk','username','ami\x20disconnected','join','Action','then','message','pick','command','Command','content','catch','voiceQueues','name','answered','available','loggedIn'];(function(_0x47656c,_0x369dd6){var _0x384149=function(_0x361375){while(--_0x361375){_0x47656c['push'](_0x47656c['shift']());}};_0x384149(++_0x369dd6);}(_0x131e,0x1ec));var _0xe131=function(_0x463af6,_0x2a7ed0){_0x463af6=_0x463af6-0x0;var _0x54cc5e=_0x131e[_0x463af6];return _0x54cc5e;};'use strict';var _=require('lodash');var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xe131('0x0'));var moment=require(_0xe131('0x1'));var config=require(_0xe131('0x2'));var properties=require(_0xe131('0x3'));var ami=require(_0xe131('0x4'));exports[_0xe131('0x5')]=function(_0x4ff7f7,_0x2fc440,_0x344903){return new Promise(function(_0x2de969,_0x1eb0df){var _0x1002a6={'QueuePause':function(_0x48a90e){return new Promise(function(_0x5c4eb5){var _0x562617=util['format'](_0xe131('0x6'),_0xe131('0x7'),_0x48a90e['name']);if(_0x4ff7f7[_0xe131('0x8')]&&_0x4ff7f7['timers'][_0x562617]&&_0x4ff7f7[_0xe131('0x8')][_0x562617][_0xe131('0x9')]){_0x4ff7f7[_0xe131('0x8')][_0x562617][_0xe131('0xa')]();}if(_0x4ff7f7[_0xe131('0xb')][_0x562617]){_0x4ff7f7[_0xe131('0xb')][_0x562617][_0xe131('0xc')]({'statePause':_0x48a90e['pause']?!![]:![]});}_0x5c4eb5({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x554db6){var _0x5f0434=this;return new Promise(function(_0x14ed9a,_0x1714db){if(ami[_0xe131('0xd')]()==![]){return _0x1714db(_0x5f0434[_0xe131('0xe')](0x1f4,[config[_0xe131('0xf')]['ip'],config[_0xe131('0xf')][_0xe131('0x10')],_0xe131('0x11')][_0xe131('0x12')]('\x20')));}_0x554db6=_['pick'](_0x554db6,_['keys'](properties['module']));_0x554db6['action']='Reload';return ami[_0xe131('0x13')](_0x554db6)[_0xe131('0x14')](function(_0xd02b90){_0x14ed9a({'code':0xc8,'message':_0xd02b90['message']});})['catch'](function(_0x400f6b){_0x1714db(_0x5f0434[_0xe131('0xe')](0x1f5,_0x400f6b[_0xe131('0x15')]));});});},'Command':function(_0x1a1e03){var _0x317200=this;return new Promise(function(_0x76fd26,_0x512570){if(ami[_0xe131('0xd')]()==![]){return _0x512570(_0x317200[_0xe131('0xe')](0x1f4,[config[_0xe131('0xf')]['ip'],config[_0xe131('0xf')][_0xe131('0x10')],'ami\x20disconnected']['join']('\x20')));}_0x1a1e03=_[_0xe131('0x16')](_0x1a1e03,_0xe131('0x17'));_0x1a1e03['action']=_0xe131('0x18');return ami['Action'](_0x1a1e03)['then'](function(_0x19d141){_0x76fd26({'code':0xc8,'message':_0x19d141[_0xe131('0x19')]});})[_0xe131('0x1a')](function(_0xecb533){_0x512570(_0x317200[_0xe131('0xe')](0x1f5,_0xecb533[_0xe131('0x15')]));});});},'VoiceQueues':function(){return new Promise(function(_0x2bcb68){var _0x52c546=[];for(var _0x2be2df in _0x4ff7f7[_0xe131('0x1b')]){if(_0x4ff7f7['voiceQueues']['hasOwnProperty'](_0x2be2df)){var _0x330638=_0x4ff7f7['voiceQueues'][_0x2be2df];var _0x41c386={'id':_0x330638['id'],'name':_0x330638[_0xe131('0x1c')],'strategy':_0x330638['strategy'],'answered':_0x330638[_0xe131('0x1d')],'available':_0x330638[_0xe131('0x1e')],'loggedIn':_0x330638[_0xe131('0x1f')],'pTalking':_0x330638['pTalking'],'sumBillable':_0x330638[_0xe131('0x20')],'sumDuration':_0x330638[_0xe131('0x21')],'sumHoldTime':_0x330638[_0xe131('0x22')]||0x0,'talking':_0x330638[_0xe131('0x23')],'total':_0x330638[_0xe131('0x24')],'type':_0x330638[_0xe131('0x25')],'unmanaged':_0x330638[_0xe131('0x26')],'abandoned':_0x330638[_0xe131('0x27')],'waiting':_0x330638[_0xe131('0x28')],'loggedInDb':_0x330638[_0xe131('0x29')]};if(_0x330638['type']===_0xe131('0x2a')){_0x41c386['dialActive']=_0x330638[_0xe131('0x2b')];_0x41c386['dialMethod']=_0x330638[_0xe131('0x2c')];_0x41c386['dialOriginateCallerIdName']=_0x330638[_0xe131('0x2d')];_0x41c386[_0xe131('0x2e')]=_0x330638[_0xe131('0x2e')];_0x41c386['dialOriginateTimeout']=_0x330638['dialOriginateTimeout'];_0x41c386[_0xe131('0x2f')]=_0x330638[_0xe131('0x2f')];_0x41c386[_0xe131('0x30')]=_0x330638[_0xe131('0x30')];_0x41c386[_0xe131('0x31')]=_0x330638[_0xe131('0x31')];_0x41c386[_0xe131('0x32')]=_0x330638[_0xe131('0x32')];_0x41c386['outboundBlacklistCallsDay']=_0x330638['outboundBlacklistCallsDay'];_0x41c386[_0xe131('0x33')]=_0x330638[_0xe131('0x33')];_0x41c386[_0xe131('0x34')]=_0x330638[_0xe131('0x34')];_0x41c386[_0xe131('0x35')]=_0x330638[_0xe131('0x35')];_0x41c386[_0xe131('0x36')]=_0x330638['outboundDropCallsDayCallersExit'];_0x41c386['outboundDropCallsDayTimeout']=_0x330638[_0xe131('0x37')];_0x41c386['outboundNoAnswerCallsDay']=_0x330638[_0xe131('0x38')];_0x41c386['outboundNoSuchCallsDay']=_0x330638[_0xe131('0x39')];_0x41c386['outboundOriginateFailureCallsDay']=_0x330638[_0xe131('0x3a')];_0x41c386['outboundReCallsDay']=_0x330638[_0xe131('0x3b')];_0x41c386[_0xe131('0x3c')]=_0x330638[_0xe131('0x3c')];_0x41c386[_0xe131('0x3d')]=_0x330638[_0xe131('0x3d')];_0x41c386[_0xe131('0x3e')]=_0x330638['predictiveIntervalAnsweredCalls'];_0x41c386[_0xe131('0x3f')]=_0x330638['predictiveIntervalAvgHoldtime'];_0x41c386[_0xe131('0x40')]=_0x330638['predictiveIntervalAvgTalktime'];_0x41c386[_0xe131('0x41')]=_0x330638[_0xe131('0x41')];_0x41c386[_0xe131('0x42')]=_0x330638[_0xe131('0x42')];_0x41c386[_0xe131('0x43')]=_0x330638[_0xe131('0x43')];_0x41c386[_0xe131('0x44')]=_0x330638['predictiveIntervalErlangCallsDroppedCalls'];_0x41c386[_0xe131('0x45')]=_0x330638['predictiveIntervalHitRate'];_0x41c386[_0xe131('0x46')]=_0x330638[_0xe131('0x46')];_0x41c386['predictiveIntervalPauses']=_0x330638['predictiveIntervalPauses'];_0x41c386[_0xe131('0x47')]=_0x330638['predictiveIntervalAvailable'];_0x41c386['predictiveIntervalTotalCalls']=_0x330638[_0xe131('0x48')];_0x41c386['message']=_0x330638[_0xe131('0x15')];_0x41c386[_0xe131('0x49')]=_0x330638['originated'];_0x41c386[_0xe131('0x4a')]=_0x330638[_0xe131('0x4a')];_0x41c386[_0xe131('0x4b')]=_0x330638[_0xe131('0x4b')];_0x41c386[_0xe131('0x4c')]=_0x330638['erlangAbandonmentRate'];_0x41c386['erlangBusyFactor']=_0x330638[_0xe131('0x4d')];_0x41c386[_0xe131('0x4e')]=_0x330638[_0xe131('0x4e')];_0x41c386['startProgressive']=_0x330638[_0xe131('0x4f')];}if(_0x330638[_0xe131('0x50')]){_0x41c386[_0xe131('0x50')]={'id':_0x330638['Trunk']['id'],'name':_0x330638[_0xe131('0x50')][_0xe131('0x1c')],'active':_0x330638[_0xe131('0x50')]['active'],'callerid':_0x330638[_0xe131('0x50')][_0xe131('0x51')]};}if(_0x330638[_0xe131('0x52')]){_0x41c386['Interval']={'id':_0x330638[_0xe131('0x52')]['id'],'name':_0x330638[_0xe131('0x52')][_0xe131('0x1c')]};}_0x52c546[_0xe131('0x53')](_0x41c386);}}_0x2bcb68({'count':_0x52c546[_0xe131('0x54')],'rows':_0x52c546});});},'UpdateVoiceQueue':function(_0x408702){return new Promise(function(_0x1192f1,_0x4c5298){var _0x49fc3f=_[_0xe131('0x55')](_0x4ff7f7[_0xe131('0x1b')],{'id':parseInt(_0x408702['id'])});var _0x406905=_[_0xe131('0x56')](_0x408702,['id']);if(_0x49fc3f){for(var _0xb1c607 in _0x406905){if(typeof _0x406905[_0xb1c607]!==_0xe131('0x57')&&typeof _0x49fc3f[_0xb1c607]!=='undefined'){_0x49fc3f[_0xb1c607]=_0x406905[_0xb1c607];}}_0x1192f1(_0x49fc3f);}else{_0x4c5298();}});},'VoiceChannels':function(){return new Promise(function(_0x2a825e){var _0x3e4d48=_[_0xe131('0x58')](_0x4ff7f7[_0xe131('0x59')]);_0x2a825e({'count':_0x3e4d48[_0xe131('0x54')],'rows':_0x3e4d48});});},'VoiceChannelMixMonitor':function(_0x9cb89){var _0x4c28df=this;return new Promise(function(_0x20481b,_0x1ce9b7){if(ami[_0xe131('0xd')]()==![]){return _0x1ce9b7(_0x4c28df[_0xe131('0xe')](0x1f4,[config[_0xe131('0xf')]['ip'],config[_0xe131('0xf')][_0xe131('0x10')],_0xe131('0x11')][_0xe131('0x12')]('\x20')));}var _0x320699=schema(properties[_0xe131('0x5a')])['validate'](_0x9cb89);if(_0x320699[_0xe131('0x54')]>0x0){return _0x1ce9b7(_0x4c28df['error'](0x1f4,_['map'](_0x320699,_0xe131('0x15'))[_0xe131('0x12')](',\x20')));}var _0x18a34d=_[_0xe131('0x55')](_0x4ff7f7[_0xe131('0x59')],{'uniqueid':_0x9cb89[_0xe131('0x5b')]});if(_0x18a34d&&_0x18a34d[_0xe131('0x5c')]){var _0x398c39=util[_0xe131('0x5d')](_0xe131('0x5e'),_0x9cb89[_0xe131('0x5f')]||_0x9cb89['uniqueid'],_0x9cb89['format']||_0xe131('0x60'));return ami[_0xe131('0x13')]({'action':'MixMonitor','channel':_0x18a34d['channel'],'file':_0x398c39,'options':_0xe131('0x61')})['then'](function(_0x5b0ab5){var _0xe0d786=_[_0xe131('0x55')](_0x18a34d[_0xe131('0x62')],{'filename':_0xe131('0x63')+_0x398c39[_0xe131('0x64')]()});if(_[_0xe131('0x65')](_0xe0d786)){_0x18a34d['monitors']['push']({'filename':_0xe131('0x63')+_0x398c39[_0xe131('0x64')](),'createdAt':moment()['format'](_0xe131('0x66')),'mixmonitorid':_0x5b0ab5[_0xe131('0x67')],'status':_0xe131('0x68')});}else{_0xe0d786[_0xe131('0x67')]=_0x5b0ab5[_0xe131('0x67')];_0xe0d786[_0xe131('0x69')]='rec';}_0x20481b({'code':0xc8,'message':[_0x9cb89[_0xe131('0x5b')],'MixMonitor\x20Success',_0x5b0ab5['mixmonitorid']][_0xe131('0x12')]('\x20'),'mixmonitorid':_0x5b0ab5[_0xe131('0x67')]});})['catch'](function(_0x5babde){_0x1ce9b7(_0x4c28df[_0xe131('0xe')](0x1f5,[_0x9cb89[_0xe131('0x5b')],_0x5babde[_0xe131('0x15')]['toLowerCase']()][_0xe131('0x12')]('\x20')));});}else{return _0x1ce9b7(_0x4c28df[_0xe131('0xe')](0x1f5,_0xe131('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x1f0126){var _0x2a65fd=this;return new Promise(function(_0x5e61c5,_0x25eec7){if(ami['isConnected']()==![]){return _0x25eec7(_0x2a65fd[_0xe131('0xe')](0x1f4,[config[_0xe131('0xf')]['ip'],config[_0xe131('0xf')][_0xe131('0x10')],'ami\x20disconnected']['join']('\x20')));}var _0x4dfed7=schema(properties[_0xe131('0x5a')])['validate'](_0x1f0126);if(_0x4dfed7[_0xe131('0x54')]>0x0){return _0x25eec7(_0x2a65fd[_0xe131('0xe')](0x1f4,_[_0xe131('0x6b')](_0x4dfed7,_0xe131('0x15'))[_0xe131('0x12')](',\x20')));}var _0x3f8f72=_[_0xe131('0x55')](_0x4ff7f7[_0xe131('0x59')],{'uniqueid':_0x1f0126[_0xe131('0x5b')]});if(_0x3f8f72){return Promise[_0xe131('0x6c')]()['then'](function(){if(_0x3f8f72['channel']){return ami['Action']({'action':_0xe131('0x6d'),'channel':_0x3f8f72[_0xe131('0x5c')],'mixmonitorid':_0x1f0126[_0xe131('0x67')]})[_0xe131('0x1a')](function(){});}})['then'](function(){if(_0x3f8f72[_0xe131('0x6e')]){return ami[_0xe131('0x13')]({'action':_0xe131('0x6d'),'channel':_0x3f8f72[_0xe131('0x6e')],'mixmonitorid':_0x1f0126[_0xe131('0x67')]})[_0xe131('0x1a')](function(){});}})['then'](function(){var _0x589074=_[_0xe131('0x55')](_0x3f8f72['monitors'],{'mixmonitorid':_0x1f0126['mixmonitorid']});if(_0x589074){_0x589074['status']=_0xe131('0x6f');}})['then'](function(){var _0x2e6f99=util['format'](_0xe131('0x5e'),_0x1f0126[_0xe131('0x5f')]||_0x1f0126[_0xe131('0x5b')],_0x1f0126[_0xe131('0x5d')]||'wav');var _0x32abb6=_[_0xe131('0x55')](_0x3f8f72[_0xe131('0x62')],{'filename':_0xe131('0x63')+_0x2e6f99[_0xe131('0x64')]()});if(_0x32abb6){_0x32abb6[_0xe131('0x69')]='stop';}})[_0xe131('0x14')](function(){_0x5e61c5({'code':0xc8,'message':[_0x1f0126[_0xe131('0x5b')],'StopMixMonitor\x20Success'][_0xe131('0x12')]('\x20')});})['catch'](function(_0x52af0f){_0x25eec7(_0x2a65fd[_0xe131('0xe')](0x1f5,[_0x1f0126['uniqueid'],_0x52af0f[_0xe131('0x15')][_0xe131('0x64')]()][_0xe131('0x12')]('\x20')));});}else{return _0x25eec7(_0x2a65fd['error'](0x1f5,_0xe131('0x6a')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x307cc6){var _0x240c33=_[_0xe131('0x58')](_0x4ff7f7[_0xe131('0x70')]);_0x307cc6({'count':_0x240c33[_0xe131('0x54')],'rows':_0x240c33});});},'VoiceQueuesChannel':function(_0x50a320){var _0x592750=this;return new Promise(function(_0x68f7c3,_0x50725b){var _0x10b7b9=schema(properties['voicequeuechannel'])[_0xe131('0x0')](_0x50a320);if(_0x10b7b9[_0xe131('0x54')]>0x0){return _0x50725b(_0x592750[_0xe131('0xe')](0x1f4,_[_0xe131('0x6b')](_0x10b7b9,_0xe131('0x15'))[_0xe131('0x12')](',\x20')));}var _0x59beee=_[_0xe131('0x55')](_0x4ff7f7[_0xe131('0x70')],{'uniqueid':_0x50a320[_0xe131('0x5b')]});if(_0x59beee){_0x68f7c3(_0x59beee);}else{return _0x50725b(_0x592750[_0xe131('0xe')](0x1f5,_0xe131('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x22f00f){var _0x2def41=this;return new Promise(function(_0x3dc08e,_0x1bcaba){if(ami[_0xe131('0xd')]()==![]){return _0x1bcaba(_0x2def41[_0xe131('0xe')](0x1f4,[config[_0xe131('0xf')]['ip'],config['asterisk'][_0xe131('0x10')],_0xe131('0x11')]['join']('\x20')));}var _0x305916=schema(properties[_0xe131('0x71')])[_0xe131('0x0')](_0x22f00f);if(_0x305916['length']>0x0){return _0x1bcaba(_0x2def41[_0xe131('0xe')](0x1f4,_[_0xe131('0x6b')](_0x305916,_0xe131('0x15'))[_0xe131('0x12')](',\x20')));}var _0xc2e591=_[_0xe131('0x55')](_0x4ff7f7[_0xe131('0x70')],{'uniqueid':_0x22f00f[_0xe131('0x5b')]});if(_0xc2e591&&_0xc2e591[_0xe131('0x5c')]){return ami[_0xe131('0x13')]({'action':_0xe131('0x72'),'channel':_0xc2e591[_0xe131('0x5c')]})[_0xe131('0x14')](function(_0x37bfab){_0x3dc08e({'code':0xc8,'message':[_0x22f00f[_0xe131('0x5b')],_0x37bfab['message']['toLowerCase']()][_0xe131('0x12')]('\x20')});})['catch'](function(_0x41d788){_0x1bcaba(_0x2def41[_0xe131('0xe')](0x1f5,[_0x22f00f[_0xe131('0x5b')],_0x41d788[_0xe131('0x15')][_0xe131('0x64')]()]['join']('\x20')));});}else{return _0x1bcaba(_0x2def41[_0xe131('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2352de){var _0x23f9a8=this;return new Promise(function(_0x60bcd5,_0x22a1cf){if(ami['isConnected']()==![]){return _0x22a1cf(_0x23f9a8[_0xe131('0xe')](0x1f4,[config[_0xe131('0xf')]['ip'],config[_0xe131('0xf')][_0xe131('0x10')],_0xe131('0x11')]['join']('\x20')));}var _0x4a3000=schema(properties[_0xe131('0x73')])[_0xe131('0x0')](_0x2352de);if(_0x4a3000[_0xe131('0x54')]>0x0){return _0x22a1cf(_0x23f9a8['error'](0x1f4,_['map'](_0x4a3000,_0xe131('0x15'))[_0xe131('0x12')](',\x20')));}var _0x2e7536=_[_0xe131('0x55')](_0x4ff7f7[_0xe131('0x70')],{'uniqueid':_0x2352de[_0xe131('0x5b')]});if(_0x2e7536&&_0x2e7536['channel']){return ami[_0xe131('0x13')]({'action':_0xe131('0x74'),'channel':_0x2e7536[_0xe131('0x5c')],'exten':_0x2352de[_0xe131('0x75')],'context':_0x2352de['context']||_0x2e7536[_0xe131('0x76')],'priority':0x1})['then'](function(_0x18032c){_0x60bcd5({'code':0xc8,'message':[_0x2352de[_0xe131('0x5b')],_0x18032c[_0xe131('0x15')]['toLowerCase']()]['join']('\x20')});})[_0xe131('0x1a')](function(_0x32913e){_0x22a1cf(_0x23f9a8[_0xe131('0xe')](0x1f5,[_0x2352de[_0xe131('0x5b')],_0x32913e[_0xe131('0x15')][_0xe131('0x64')]()][_0xe131('0x12')]('\x20')));});}else{return _0x22a1cf(_0x23f9a8[_0xe131('0xe')](0x1f5,_0xe131('0x6a')));}});},'Agents':function(_0x1eca1f){return new Promise(function(_0x1dec93){var _0x1576e4=_[_0xe131('0x58')](_0x4ff7f7['agents']);if(_0x1eca1f&&_0x1eca1f['id']){var _0x19acea=_[_0xe131('0x55')](_0x1576e4,function(_0x55012){return _0x55012['id']===_0x1eca1f['id'];});_0x1dec93(_0x19acea);}else{_0x1dec93({'count':_0x1576e4[_0xe131('0x54')],'rows':_0x1576e4});}});},'Telephones':function(){return new Promise(function(_0x5bab1b){var _0x3a9777=_[_0xe131('0x58')](_0x4ff7f7[_0xe131('0x77')]);_0x5bab1b({'count':_0x3a9777[_0xe131('0x54')],'rows':_0x3a9777});});},'Trunks':function(){return new Promise(function(_0x519657){var _0x92e509=_[_0xe131('0x58')](_0x4ff7f7[_0xe131('0x78')]);_0x519657({'count':_0x92e509['length'],'rows':_0x92e509});});},'OutboundChannels':function(){return new Promise(function(_0x3a1bac){var _0x5ad03e=_[_0xe131('0x58')](_0x4ff7f7['outboundChannels']);_0x3a1bac({'count':_0x5ad03e['length'],'rows':_0x5ad03e});});},'Outbound':function(){return new Promise(function(_0x3304f6){_0x3304f6(_0x4ff7f7[_0xe131('0x2a')]);});},'Campaigns':function(){return new Promise(function(_0x4cbce6){var _0x3adc5e=_[_0xe131('0x58')](_0x4ff7f7['campaigns']);_0x4cbce6({'count':_0x3adc5e[_0xe131('0x54')],'rows':_0x3adc5e});});},'VoiceQueuesPreview':function(_0x3e8bdc){var _0x2955b7=this;return new Promise(function(_0xa5cc3,_0x3eb76c){_0x2fc440[_0xe131('0x79')](_0x3e8bdc['id'])[_0xe131('0x14')](function(_0x5e573a){_0xa5cc3({'code':0xc8,'message':_0x5e573a[_0xe131('0x15')]});})[_0xe131('0x1a')](function(_0x44b2ae){_0x3eb76c(_0x2955b7['error'](0x1f4,_0x44b2ae[_0xe131('0x15')]));});});},'EventManager':function(_0x576fe5){var _0x30861b=this;return new Promise(function(_0x4b07fd,_0x4e16dc){if(!_0x576fe5[_0xe131('0x7a')]){return _0x4e16dc(_0x30861b[_0xe131('0xe')](0x1f4,_0xe131('0x7b')));}ami['emit'](_0xe131('0x7c')+_0x576fe5[_0xe131('0x7a')],_0x576fe5['message']);_0x4b07fd({'code':0xc8,'message':_0x576fe5});});},'FaxAccounts':function(){return new Promise(function(_0x4f6435){var _0x333ebe=_['values'](_0x4ff7f7[_0xe131('0x7d')]);_0x4f6435({'count':_0x333ebe[_0xe131('0x54')],'rows':_0x333ebe});});},'SendFax':function(_0x76a31b){var _0x3ea6cf=this;return new Promise(function(_0xed7f03,_0x1b97ab){_0x344903[_0xe131('0x7e')](_0x76a31b)['then'](function(_0x133230){_0xed7f03({'code':0xc8,'message':_0x133230[_0xe131('0x15')]});})[_0xe131('0x1a')](function(_0x106307){_0x1b97ab(_0x3ea6cf['error'](0x1f4,_0x106307[_0xe131('0x15')]));});});},'CheckAfterSend':function(_0x599600){var _0x1c530d=this;return new Promise(function(_0x1d8afd,_0x205a07){_0x344903[_0xe131('0x7f')](_0x599600)[_0xe131('0x14')](function(_0x4276f7){_0x1d8afd({'code':0xc8,'message':_0x4276f7[_0xe131('0x15')]});})[_0xe131('0x1a')](function(_0x258213){_0x205a07(_0x1c530d[_0xe131('0xe')](0x1f4,_0x258213[_0xe131('0x15')]));});});}};var _0x16cb23=jayson['server'](_0x1002a6)['http']();_0x16cb23['on'](_0xe131('0xe'),function(_0x792154){return _0x1eb0df(_0x792154);});_0x16cb23[_0xe131('0x5')](0x232a,_0xe131('0x80'),function(){console[_0xe131('0x81')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x2de969(_0xe131('0x82')+0x232a);});});}; \ No newline at end of file +var _0x4058=['queueChannels','Redirect','exten','context','trunks','outboundChannels','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','asterisk','ami\x20disconnected','join','pick','keys','action','Reload','Action','then','message','catch','error','isConnected','username','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumDuration','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','wav','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0x4058,0x129));var _0x8405=function(_0xa3b3ac,_0x355966){_0xa3b3ac=_0xa3b3ac-0x0;var _0x4bc57c=_0x4058[_0xa3b3ac];return _0x4bc57c;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var jayson=require(_0x8405('0x2'));var schema=require(_0x8405('0x3'));var moment=require(_0x8405('0x4'));var config=require(_0x8405('0x5'));var properties=require(_0x8405('0x6'));var ami=require(_0x8405('0x7'));exports[_0x8405('0x8')]=function(_0x4948b2,_0x5ebf0e,_0x57fb07){return new Promise(function(_0x1db7ea,_0x257d43){var _0x3d9bf6={'QueuePause':function(_0x1322e5){return new Promise(function(_0x1cb061){var _0x479c97=util[_0x8405('0x9')](_0x8405('0xa'),_0x8405('0xb'),_0x1322e5['name']);if(_0x4948b2[_0x8405('0xc')]&&_0x4948b2['timers'][_0x479c97]&&_0x4948b2[_0x8405('0xc')][_0x479c97][_0x8405('0xd')]){_0x4948b2['timers'][_0x479c97][_0x8405('0xe')]();}if(_0x4948b2[_0x8405('0xf')][_0x479c97]){_0x4948b2['agents'][_0x479c97]['updateStatusRealtime']({'statePause':_0x1322e5['pause']?!![]:![]});}_0x1cb061({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x262d32){var _0x575fcb=this;return new Promise(function(_0x495190,_0x4e6477){if(ami['isConnected']()==![]){return _0x4e6477(_0x575fcb['error'](0x1f4,[config[_0x8405('0x10')]['ip'],config[_0x8405('0x10')]['username'],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}_0x262d32=_[_0x8405('0x13')](_0x262d32,_[_0x8405('0x14')](properties['module']));_0x262d32[_0x8405('0x15')]=_0x8405('0x16');return ami[_0x8405('0x17')](_0x262d32)[_0x8405('0x18')](function(_0x135190){_0x495190({'code':0xc8,'message':_0x135190[_0x8405('0x19')]});})[_0x8405('0x1a')](function(_0x358633){_0x4e6477(_0x575fcb[_0x8405('0x1b')](0x1f5,_0x358633[_0x8405('0x19')]));});});},'Command':function(_0x34c79c){var _0x21376d=this;return new Promise(function(_0x131857,_0x241000){if(ami[_0x8405('0x1c')]()==![]){return _0x241000(_0x21376d[_0x8405('0x1b')](0x1f4,[config[_0x8405('0x10')]['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}_0x34c79c=_[_0x8405('0x13')](_0x34c79c,_0x8405('0x1e'));_0x34c79c[_0x8405('0x15')]=_0x8405('0x1f');return ami[_0x8405('0x17')](_0x34c79c)['then'](function(_0x4b0786){_0x131857({'code':0xc8,'message':_0x4b0786[_0x8405('0x20')]});})[_0x8405('0x1a')](function(_0x14436a){_0x241000(_0x21376d['error'](0x1f5,_0x14436a[_0x8405('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5d51a9){var _0x48c5ea=[];for(var _0x480ad2 in _0x4948b2[_0x8405('0x21')]){if(_0x4948b2[_0x8405('0x21')][_0x8405('0x22')](_0x480ad2)){var _0x4450eb=_0x4948b2[_0x8405('0x21')][_0x480ad2];var _0x3e5b4c={'id':_0x4450eb['id'],'name':_0x4450eb[_0x8405('0x23')],'strategy':_0x4450eb[_0x8405('0x24')],'answered':_0x4450eb[_0x8405('0x25')],'available':_0x4450eb[_0x8405('0x26')],'loggedIn':_0x4450eb[_0x8405('0x27')],'pTalking':_0x4450eb[_0x8405('0x28')],'sumBillable':_0x4450eb['sumBillable'],'sumDuration':_0x4450eb[_0x8405('0x29')],'sumHoldTime':_0x4450eb['sumHoldTime']||0x0,'talking':_0x4450eb['talking'],'total':_0x4450eb[_0x8405('0x2a')],'type':_0x4450eb[_0x8405('0x2b')],'unmanaged':_0x4450eb[_0x8405('0x2c')],'abandoned':_0x4450eb[_0x8405('0x2d')],'waiting':_0x4450eb[_0x8405('0x2e')],'loggedInDb':_0x4450eb[_0x8405('0x2f')]};if(_0x4450eb[_0x8405('0x2b')]===_0x8405('0x30')){_0x3e5b4c[_0x8405('0x31')]=_0x4450eb[_0x8405('0x31')];_0x3e5b4c[_0x8405('0x32')]=_0x4450eb[_0x8405('0x32')];_0x3e5b4c[_0x8405('0x33')]=_0x4450eb['dialOriginateCallerIdName'];_0x3e5b4c[_0x8405('0x34')]=_0x4450eb[_0x8405('0x34')];_0x3e5b4c['dialOriginateTimeout']=_0x4450eb[_0x8405('0x35')];_0x3e5b4c[_0x8405('0x36')]=_0x4450eb[_0x8405('0x36')];_0x3e5b4c['temp']=_0x4450eb[_0x8405('0x37')];_0x3e5b4c[_0x8405('0x38')]=_0x4450eb[_0x8405('0x38')];_0x3e5b4c['outboundAnswerCallsDay']=_0x4450eb[_0x8405('0x39')];_0x3e5b4c[_0x8405('0x3a')]=_0x4450eb['outboundBlacklistCallsDay'];_0x3e5b4c[_0x8405('0x3b')]=_0x4450eb['outboundBusyCallsDay'];_0x3e5b4c[_0x8405('0x3c')]=_0x4450eb[_0x8405('0x3c')];_0x3e5b4c[_0x8405('0x3d')]=_0x4450eb[_0x8405('0x3d')];_0x3e5b4c[_0x8405('0x3e')]=_0x4450eb[_0x8405('0x3e')];_0x3e5b4c[_0x8405('0x3f')]=_0x4450eb[_0x8405('0x3f')];_0x3e5b4c[_0x8405('0x40')]=_0x4450eb[_0x8405('0x40')];_0x3e5b4c[_0x8405('0x41')]=_0x4450eb[_0x8405('0x41')];_0x3e5b4c['outboundOriginateFailureCallsDay']=_0x4450eb[_0x8405('0x42')];_0x3e5b4c['outboundReCallsDay']=_0x4450eb['outboundReCallsDay'];_0x3e5b4c[_0x8405('0x43')]=_0x4450eb[_0x8405('0x43')];_0x3e5b4c['outboundUnknownCallsDay']=_0x4450eb[_0x8405('0x44')];_0x3e5b4c[_0x8405('0x45')]=_0x4450eb[_0x8405('0x45')];_0x3e5b4c[_0x8405('0x46')]=_0x4450eb[_0x8405('0x46')];_0x3e5b4c['predictiveIntervalAvgTalktime']=_0x4450eb[_0x8405('0x47')];_0x3e5b4c[_0x8405('0x48')]=_0x4450eb[_0x8405('0x48')];_0x3e5b4c[_0x8405('0x49')]=_0x4450eb[_0x8405('0x49')];_0x3e5b4c['predictiveIntervalErlangCalls']=_0x4450eb[_0x8405('0x4a')];_0x3e5b4c[_0x8405('0x4b')]=_0x4450eb[_0x8405('0x4b')];_0x3e5b4c[_0x8405('0x4c')]=_0x4450eb[_0x8405('0x4c')];_0x3e5b4c[_0x8405('0x4d')]=_0x4450eb['predictiveIntervalMultiplicativeFactor'];_0x3e5b4c[_0x8405('0x4e')]=_0x4450eb[_0x8405('0x4e')];_0x3e5b4c[_0x8405('0x4f')]=_0x4450eb[_0x8405('0x4f')];_0x3e5b4c[_0x8405('0x50')]=_0x4450eb[_0x8405('0x50')];_0x3e5b4c[_0x8405('0x19')]=_0x4450eb['message'];_0x3e5b4c[_0x8405('0x51')]=_0x4450eb['originated'];_0x3e5b4c[_0x8405('0x52')]=_0x4450eb[_0x8405('0x52')];_0x3e5b4c['erlangCallToSecond']=_0x4450eb[_0x8405('0x53')];_0x3e5b4c[_0x8405('0x54')]=_0x4450eb[_0x8405('0x54')];_0x3e5b4c[_0x8405('0x55')]=_0x4450eb[_0x8405('0x55')];_0x3e5b4c[_0x8405('0x56')]=_0x4450eb[_0x8405('0x56')];_0x3e5b4c[_0x8405('0x57')]=_0x4450eb[_0x8405('0x57')];}if(_0x4450eb[_0x8405('0x58')]){_0x3e5b4c['Trunk']={'id':_0x4450eb['Trunk']['id'],'name':_0x4450eb[_0x8405('0x58')]['name'],'active':_0x4450eb[_0x8405('0x58')][_0x8405('0x59')],'callerid':_0x4450eb[_0x8405('0x58')]['callerid']};}if(_0x4450eb[_0x8405('0x5a')]){_0x3e5b4c[_0x8405('0x5a')]={'id':_0x4450eb['Interval']['id'],'name':_0x4450eb[_0x8405('0x5a')][_0x8405('0x23')]};}_0x48c5ea[_0x8405('0x5b')](_0x3e5b4c);}}_0x5d51a9({'count':_0x48c5ea[_0x8405('0x5c')],'rows':_0x48c5ea});});},'UpdateVoiceQueue':function(_0x55d189){return new Promise(function(_0x3b68b4,_0x336927){var _0x4fec13=_['find'](_0x4948b2['voiceQueues'],{'id':parseInt(_0x55d189['id'])});var _0x84020b=_[_0x8405('0x5d')](_0x55d189,['id']);if(_0x4fec13){for(var _0x1c0350 in _0x84020b){if(typeof _0x84020b[_0x1c0350]!==_0x8405('0x5e')&&typeof _0x4fec13[_0x1c0350]!=='undefined'){_0x4fec13[_0x1c0350]=_0x84020b[_0x1c0350];}}_0x3b68b4(_0x4fec13);}else{_0x336927();}});},'VoiceChannels':function(){return new Promise(function(_0x51ffcc){var _0x3c4ab2=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x60')]);_0x51ffcc({'count':_0x3c4ab2[_0x8405('0x5c')],'rows':_0x3c4ab2});});},'VoiceChannelMixMonitor':function(_0x2eced5){var _0x3c516f=this;return new Promise(function(_0x11a2d5,_0x600035){if(ami['isConnected']()==![]){return _0x600035(_0x3c516f[_0x8405('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}var _0x9a0ffe=schema(properties[_0x8405('0x61')])[_0x8405('0x3')](_0x2eced5);if(_0x9a0ffe[_0x8405('0x5c')]>0x0){return _0x600035(_0x3c516f['error'](0x1f4,_[_0x8405('0x62')](_0x9a0ffe,_0x8405('0x19'))[_0x8405('0x12')](',\x20')));}var _0x3e4473=_['find'](_0x4948b2['channels'],{'uniqueid':_0x2eced5[_0x8405('0x63')]});if(_0x3e4473&&_0x3e4473[_0x8405('0x64')]){var _0x152757=util[_0x8405('0x9')](_0x8405('0x65'),_0x2eced5[_0x8405('0x66')]||_0x2eced5[_0x8405('0x63')],_0x2eced5['format']||'wav');return ami[_0x8405('0x17')]({'action':'MixMonitor','channel':_0x3e4473[_0x8405('0x64')],'file':_0x152757,'options':_0x8405('0x67')})[_0x8405('0x18')](function(_0x4b8443){var _0x5b8a93=_[_0x8405('0x68')](_0x3e4473['monitors'],{'filename':_0x8405('0x69')+_0x152757[_0x8405('0x6a')]()});if(_[_0x8405('0x6b')](_0x5b8a93)){_0x3e4473[_0x8405('0x6c')][_0x8405('0x5b')]({'filename':_0x8405('0x69')+_0x152757[_0x8405('0x6a')](),'createdAt':moment()[_0x8405('0x9')](_0x8405('0x6d')),'mixmonitorid':_0x4b8443['mixmonitorid'],'status':_0x8405('0x6e')});}else{_0x5b8a93[_0x8405('0x6f')]=_0x4b8443[_0x8405('0x6f')];_0x5b8a93[_0x8405('0x70')]='rec';}_0x11a2d5({'code':0xc8,'message':[_0x2eced5[_0x8405('0x63')],_0x8405('0x71'),_0x4b8443[_0x8405('0x6f')]][_0x8405('0x12')]('\x20'),'mixmonitorid':_0x4b8443[_0x8405('0x6f')]});})[_0x8405('0x1a')](function(_0x4a2381){_0x600035(_0x3c516f[_0x8405('0x1b')](0x1f5,[_0x2eced5[_0x8405('0x63')],_0x4a2381[_0x8405('0x19')]['toLowerCase']()][_0x8405('0x12')]('\x20')));});}else{return _0x600035(_0x3c516f[_0x8405('0x1b')](0x1f5,_0x8405('0x72')));}});},'VoiceChannelStopMixMonitor':function(_0x2b8334){var _0x9b3747=this;return new Promise(function(_0x3bbdc5,_0x283dcb){if(ami[_0x8405('0x1c')]()==![]){return _0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f4,[config[_0x8405('0x10')]['ip'],config['asterisk'][_0x8405('0x1d')],'ami\x20disconnected'][_0x8405('0x12')]('\x20')));}var _0x4f96f8=schema(properties[_0x8405('0x61')])[_0x8405('0x3')](_0x2b8334);if(_0x4f96f8[_0x8405('0x5c')]>0x0){return _0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x4f96f8,'message')[_0x8405('0x12')](',\x20')));}var _0x48f7a7=_['find'](_0x4948b2[_0x8405('0x60')],{'uniqueid':_0x2b8334['uniqueid']});if(_0x48f7a7){return Promise[_0x8405('0x73')]()[_0x8405('0x18')](function(){if(_0x48f7a7[_0x8405('0x64')]){return ami['Action']({'action':_0x8405('0x74'),'channel':_0x48f7a7[_0x8405('0x64')],'mixmonitorid':_0x2b8334[_0x8405('0x6f')]})[_0x8405('0x1a')](function(){});}})[_0x8405('0x18')](function(){if(_0x48f7a7[_0x8405('0x75')]){return ami['Action']({'action':_0x8405('0x74'),'channel':_0x48f7a7[_0x8405('0x75')],'mixmonitorid':_0x2b8334[_0x8405('0x6f')]})['catch'](function(){});}})['then'](function(){var _0x230e33=_[_0x8405('0x68')](_0x48f7a7[_0x8405('0x6c')],{'mixmonitorid':_0x2b8334[_0x8405('0x6f')]});if(_0x230e33){_0x230e33[_0x8405('0x70')]='stop';}})['then'](function(){var _0x5cd043=util[_0x8405('0x9')](_0x8405('0x65'),_0x2b8334[_0x8405('0x66')]||_0x2b8334[_0x8405('0x63')],_0x2b8334[_0x8405('0x9')]||_0x8405('0x76'));var _0x1a4861=_[_0x8405('0x68')](_0x48f7a7[_0x8405('0x6c')],{'filename':_0x8405('0x69')+_0x5cd043[_0x8405('0x6a')]()});if(_0x1a4861){_0x1a4861[_0x8405('0x70')]='stop';}})[_0x8405('0x18')](function(){_0x3bbdc5({'code':0xc8,'message':[_0x2b8334[_0x8405('0x63')],'StopMixMonitor\x20Success'][_0x8405('0x12')]('\x20')});})[_0x8405('0x1a')](function(_0x2c0413){_0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f5,[_0x2b8334[_0x8405('0x63')],_0x2c0413[_0x8405('0x19')][_0x8405('0x6a')]()][_0x8405('0x12')]('\x20')));});}else{return _0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x1db269){var _0x4732dc=_[_0x8405('0x5f')](_0x4948b2['queueChannels']);_0x1db269({'count':_0x4732dc[_0x8405('0x5c')],'rows':_0x4732dc});});},'VoiceQueuesChannel':function(_0x320b03){var _0x20e9ac=this;return new Promise(function(_0x211e38,_0x27f1ef){var _0x4d9f1f=schema(properties[_0x8405('0x77')])[_0x8405('0x3')](_0x320b03);if(_0x4d9f1f[_0x8405('0x5c')]>0x0){return _0x27f1ef(_0x20e9ac[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x4d9f1f,_0x8405('0x19'))[_0x8405('0x12')](',\x20')));}var _0x83a45b=_[_0x8405('0x68')](_0x4948b2['queueChannels'],{'uniqueid':_0x320b03[_0x8405('0x63')]});if(_0x83a45b){_0x211e38(_0x83a45b);}else{return _0x27f1ef(_0x20e9ac['error'](0x1f5,_0x8405('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x8390dc){var _0x52592c=this;return new Promise(function(_0x4f203d,_0x5f4bb6){if(ami['isConnected']()==![]){return _0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}var _0x372ca9=schema(properties[_0x8405('0x78')])[_0x8405('0x3')](_0x8390dc);if(_0x372ca9['length']>0x0){return _0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x372ca9,'message')['join'](',\x20')));}var _0x48b045=_['find'](_0x4948b2['queueChannels'],{'uniqueid':_0x8390dc['uniqueid']});if(_0x48b045&&_0x48b045[_0x8405('0x64')]){return ami[_0x8405('0x17')]({'action':_0x8405('0x79'),'channel':_0x48b045[_0x8405('0x64')]})[_0x8405('0x18')](function(_0x5a6844){_0x4f203d({'code':0xc8,'message':[_0x8390dc[_0x8405('0x63')],_0x5a6844[_0x8405('0x19')][_0x8405('0x6a')]()][_0x8405('0x12')]('\x20')});})[_0x8405('0x1a')](function(_0x5c1bdb){_0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f5,[_0x8390dc[_0x8405('0x63')],_0x5c1bdb[_0x8405('0x19')][_0x8405('0x6a')]()][_0x8405('0x12')]('\x20')));});}else{return _0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f5,_0x8405('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x1b2737){var _0x575115=this;return new Promise(function(_0x42049d,_0x132a09){if(ami[_0x8405('0x1c')]()==![]){return _0x132a09(_0x575115[_0x8405('0x1b')](0x1f4,[config[_0x8405('0x10')]['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}var _0x2be89b=schema(properties[_0x8405('0x7a')])[_0x8405('0x3')](_0x1b2737);if(_0x2be89b[_0x8405('0x5c')]>0x0){return _0x132a09(_0x575115[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x2be89b,_0x8405('0x19'))['join'](',\x20')));}var _0x2562c8=_[_0x8405('0x68')](_0x4948b2[_0x8405('0x7b')],{'uniqueid':_0x1b2737['uniqueid']});if(_0x2562c8&&_0x2562c8[_0x8405('0x64')]){return ami[_0x8405('0x17')]({'action':_0x8405('0x7c'),'channel':_0x2562c8[_0x8405('0x64')],'exten':_0x1b2737[_0x8405('0x7d')],'context':_0x1b2737[_0x8405('0x7e')]||_0x2562c8[_0x8405('0x7e')],'priority':0x1})[_0x8405('0x18')](function(_0x352112){_0x42049d({'code':0xc8,'message':[_0x1b2737[_0x8405('0x63')],_0x352112['message']['toLowerCase']()][_0x8405('0x12')]('\x20')});})[_0x8405('0x1a')](function(_0x5e6b24){_0x132a09(_0x575115[_0x8405('0x1b')](0x1f5,[_0x1b2737[_0x8405('0x63')],_0x5e6b24[_0x8405('0x19')]['toLowerCase']()]['join']('\x20')));});}else{return _0x132a09(_0x575115['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x151b4f){return new Promise(function(_0x337233){var _0x37a642=_['values'](_0x4948b2[_0x8405('0xf')]);if(_0x151b4f&&_0x151b4f['id']){var _0x35607a=_[_0x8405('0x68')](_0x37a642,function(_0x73c924){return _0x73c924['id']===_0x151b4f['id'];});_0x337233(_0x35607a);}else{_0x337233({'count':_0x37a642['length'],'rows':_0x37a642});}});},'Telephones':function(){return new Promise(function(_0x4bc83b){var _0x31b673=_[_0x8405('0x5f')](_0x4948b2['telephones']);_0x4bc83b({'count':_0x31b673[_0x8405('0x5c')],'rows':_0x31b673});});},'Trunks':function(){return new Promise(function(_0x1bbb21){var _0xc1f4ec=_['values'](_0x4948b2[_0x8405('0x7f')]);_0x1bbb21({'count':_0xc1f4ec[_0x8405('0x5c')],'rows':_0xc1f4ec});});},'OutboundChannels':function(){return new Promise(function(_0x23022d){var _0x360e0a=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x80')]);_0x23022d({'count':_0x360e0a[_0x8405('0x5c')],'rows':_0x360e0a});});},'Outbound':function(){return new Promise(function(_0x2ca863){_0x2ca863(_0x4948b2[_0x8405('0x30')]);});},'Campaigns':function(){return new Promise(function(_0x9aa5a6){var _0x488a7f=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x81')]);_0x9aa5a6({'count':_0x488a7f[_0x8405('0x5c')],'rows':_0x488a7f});});},'VoiceQueuesPreview':function(_0x4ea2bf){var _0x57adfd=this;return new Promise(function(_0x572981,_0x13c442){_0x5ebf0e[_0x8405('0x82')](_0x4ea2bf['id'])[_0x8405('0x18')](function(_0x279bd1){_0x572981({'code':0xc8,'message':_0x279bd1['message']});})[_0x8405('0x1a')](function(_0x1a3cc6){_0x13c442(_0x57adfd[_0x8405('0x1b')](0x1f4,_0x1a3cc6[_0x8405('0x19')]));});});},'EventManager':function(_0x9d6230){var _0x1f3e97=this;return new Promise(function(_0xbd79a0,_0x40da84){if(!_0x9d6230[_0x8405('0x83')]){return _0x40da84(_0x1f3e97[_0x8405('0x1b')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x8405('0x84')+_0x9d6230[_0x8405('0x83')],_0x9d6230[_0x8405('0x19')]);_0xbd79a0({'code':0xc8,'message':_0x9d6230});});},'FaxAccounts':function(){return new Promise(function(_0x3d855d){var _0x689ca1=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x85')]);_0x3d855d({'count':_0x689ca1[_0x8405('0x5c')],'rows':_0x689ca1});});},'SendFax':function(_0x2300d3){var _0x4c2153=this;return new Promise(function(_0x264c5d,_0x1c1d17){_0x57fb07[_0x8405('0x86')](_0x2300d3)['then'](function(_0x36cf2b){_0x264c5d({'code':0xc8,'message':_0x36cf2b[_0x8405('0x19')]});})[_0x8405('0x1a')](function(_0x4cc691){_0x1c1d17(_0x4c2153['error'](0x1f4,_0x4cc691['message']));});});},'CheckAfterSend':function(_0x6d0055){var _0x5c1a48=this;return new Promise(function(_0x57b076,_0x66c9f9){_0x57fb07[_0x8405('0x87')](_0x6d0055)['then'](function(_0x2dc00f){_0x57b076({'code':0xc8,'message':_0x2dc00f[_0x8405('0x19')]});})[_0x8405('0x1a')](function(_0x273e11){_0x66c9f9(_0x5c1a48[_0x8405('0x1b')](0x1f4,_0x273e11['message']));});});}};var _0x49ecf0=jayson[_0x8405('0x88')](_0x3d9bf6)['http']();_0x49ecf0['on'](_0x8405('0x1b'),function(_0x19dca3){return _0x257d43(_0x19dca3);});_0x49ecf0[_0x8405('0x8')](0x232a,_0x8405('0x89'),function(){console['log'](_0x8405('0x8a'),0x232a);return _0x1db7ea(_0x8405('0x8b')+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 1ac44e4..b71df2c 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 _0x568a=['merge','lodash','bluebird','ioredis','util','../../../../config/environment','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','isNil','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','ListId','createdAt','updatedAt','union','resolve','then','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','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','action','toLowerCase'];(function(_0x571d85,_0xda439c){var _0x3c2e07=function(_0x2d2144){while(--_0x2d2144){_0x571d85['push'](_0x571d85['shift']());}};_0x3c2e07(++_0xda439c);}(_0x568a,0xcd));var _0xa568=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x568a[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xa568('0x0'));var BPromise=require(_0xa568('0x1'));var Redis=require(_0xa568('0x2'));var util=require(_0xa568('0x3'));var config=require(_0xa568('0x4'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xa568('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa568('0x6'))(new Redis(config[_0xa568('0x5')]));function emit(_0x12160d,_0x1cf69c,_0x4ae3ee,_0x2643d9,_0x11b9ae){logger[_0xa568('0x7')](_0xa568('0x8'),_0x12160d,_0x1cf69c['id'],_0x4ae3ee,_0x2643d9,JSON[_0xa568('0x9')](_0x11b9ae));io['to'](_0x4ae3ee)['emit'](_0x2643d9,_0x11b9ae);}exports[_0xa568('0xa')]=function(_0x472727,_0x678c1a,_0x4c557c,_0x59be39){var _0x1c81ef,_0x29a977;var _0x3a9898={};var _0x28270e;var _0x34c8cd=Number(_0x4c557c[_0xa568('0xb')]);var _0x214324=_0x4c557c['data2']?Boolean(Number(_0x4c557c['data2'])):![];var _0x26c892;var _0x9fc55d=![];if(!_[_0xa568('0xc')](_0x4c557c[_0xa568('0xd')])){if(_0x4c557c[_0xa568('0xd')]=='1')_0x9fc55d=!![];}if(!_0x9fc55d){if(_0x59be39[_0xa568('0xe')]){_0x3a9898['id']=_0x59be39[_0xa568('0xe')];}}if(!_0x3a9898['id']){_0x3a9898['ListId']=_0x34c8cd;_0x26c892=_0x4c557c['data3']&&_0x4c557c[_0xa568('0xf')]!=='0'?_0x4c557c[_0xa568('0xf')][_0xa568('0x10')](','):[_0xa568('0x11')];_0x3a9898[_0xa568('0x12')]=_['map'](_0x26c892,function(_0xdf0a0d){var _0x237385={};_0x237385[_0xdf0a0d]=_0x59be39[_0xa568('0x13')]?_0x59be39[_0xa568('0x14')]:_0x59be39[_0xa568('0x15')];return _0x237385;});_0x28270e=_0x59be39[_0xa568('0x13')]?_0x59be39['destcalleridnum']:_0x59be39[_0xa568('0x15')];}var _0x45b41f=['id',_0xa568('0x16'),_0xa568('0x17'),'phone',_0xa568('0x18'),'fax',_0xa568('0x19'),_0xa568('0x1a'),'scheduledAt',_0xa568('0x1b')];var _0x5c23d1=_[_0xa568('0x1c')](_0x45b41f,_0x26c892);BPromise[_0xa568('0x1d')]()[_0xa568('0x1e')](cmContactRpc['getContacts']({'attributes':_0x5c23d1,'where':_0x3a9898,'phone':_0x28270e}))[_0xa568('0x1e')](function(_0x61cea4){_0x29a977=_0x61cea4;if(!_['isEmpty'](_0x29a977)){if(_0x29a977[_0xa568('0x1f')]===0x1){_0x1c81ef=_0x29a977[0x0];logger[_0xa568('0x7')](_0xa568('0x20'),_0x59be39[_0xa568('0x21')],_0x678c1a['id'],_0x1c81ef['id']);}else{logger[_0xa568('0x7')](_0xa568('0x22'),_0x59be39['uniqueid'],_0x678c1a['id'],_['map'](_0x29a977,'id')['join'](','));}return;}else{logger[_0xa568('0x7')](_0xa568('0x23'),_0x59be39[_0xa568('0x21')],_0x678c1a['id']);var _0x1c443d={'ListId':_0x34c8cd};var _0x3ea21f=_0x4c557c['data4']&&_0x4c557c['data4']!=='0'?_0x4c557c[_0xa568('0x24')]:_0xa568('0x11');if(_0x214324){logger[_0xa568('0x7')](_0xa568('0x25'),_0x59be39[_0xa568('0x21')],_0x678c1a['id']);_0x1c443d[_0x3ea21f]=_[_0xa568('0xc')](_0x59be39[_0xa568('0x13')])?_0x59be39[_0xa568('0x15')]:_0x59be39[_0xa568('0x14')];if(_['isNil'](_0x59be39[_0xa568('0x13')])){_0x1c443d[_0xa568('0x16')]=_0x59be39[_0xa568('0x26')]&&_0x59be39[_0xa568('0x26')]!==_0xa568('0x27')?_0x59be39[_0xa568('0x26')]:'Unknown';}else{_0x1c443d[_0xa568('0x16')]=_0x59be39[_0xa568('0x28')]&&_0x59be39['destcalleridname']!==_0xa568('0x27')?_0x59be39['destcalleridname']:_0xa568('0x29');}return BPromise['resolve']()['then'](cmContactRpc[_0xa568('0x2a')](_0x1c443d))[_0xa568('0x1e')](function(_0xba4796){_0x1c81ef=_0xba4796;_0x29a977[_0xa568('0x2b')](_0xba4796);if(_0x1c81ef){logger[_0xa568('0x7')](_0xa568('0x2c'),_0x59be39[_0xa568('0x21')],_0x678c1a['id'],_0x1c81ef['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x59be39[_0xa568('0x21')],_0x678c1a['id']);_0x1c443d[_0x3ea21f]=_['isNil'](_0x59be39[_0xa568('0x13')])?_0x59be39[_0xa568('0x15')]:_0x59be39[_0xa568('0x14')];if(_[_0xa568('0xc')](_0x59be39['routeId'])){_0x1c443d['firstName']=_0x59be39[_0xa568('0x26')]&&_0x59be39['calleridname']!==_0xa568('0x27')?_0x59be39['calleridname']:_0xa568('0x29');}else{_0x1c443d['firstName']=_0x59be39['destcalleridname']&&_0x59be39[_0xa568('0x28')]!==''?_0x59be39[_0xa568('0x28')]:_0xa568('0x29');}_0x1c81ef=_0x1c443d;_0x29a977[_0xa568('0x2b')](_0x1c443d);return;}}})[_0xa568('0x1e')](function(){if(_0x472727){emit(_0x59be39[_0xa568('0x21')],_0x678c1a,util[_0xa568('0x2d')](_0xa568('0x2e'),_0x472727[_0xa568('0x2f')]),util[_0xa568('0x2d')]('trigger:%s',_0x4c557c[_0xa568('0x30')][_0xa568('0x31')]()),{'evt':_[_0xa568('0x32')](_0x59be39,{'autoCreate':_0x214324}),'contact':_0x1c81ef===undefined?{}:_0x1c81ef,'contacts':_0x29a977['length']===0x0?undefined:_0x29a977});}});}; \ No newline at end of file +var _0xd23a=['socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','toLowerCase','merge','length','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost'];(function(_0x50336b,_0x5e54b4){var _0x1ea65b=function(_0xe99ef0){while(--_0xe99ef0){_0x50336b['push'](_0x50336b['shift']());}};_0x1ea65b(++_0x5e54b4);}(_0xd23a,0xe7));var _0xad23=function(_0x439041,_0x17225c){_0x439041=_0x439041-0x0;var _0x330200=_0xd23a[_0x439041];return _0x330200;};'use strict';var _=require(_0xad23('0x0'));var BPromise=require('bluebird');var Redis=require(_0xad23('0x1'));var util=require(_0xad23('0x2'));var config=require(_0xad23('0x3'));var logger=require(_0xad23('0x4'))(_0xad23('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xad23('0x6')]=_[_0xad23('0x7')](config['redis'],{'host':_0xad23('0x8'),'port':0x18eb});var io=require(_0xad23('0x9'))(new Redis(config[_0xad23('0x6')]));function emit(_0x17b224,_0x5248b9,_0x40fccc,_0x1b421e,_0x54891a){logger[_0xad23('0xa')](_0xad23('0xb'),_0x17b224,_0x5248b9['id'],_0x40fccc,_0x1b421e,JSON[_0xad23('0xc')](_0x54891a));io['to'](_0x40fccc)[_0xad23('0xd')](_0x1b421e,_0x54891a);}exports['exec']=function(_0x5c66aa,_0x3f3954,_0x25a158,_0x3da922){var _0x42e719,_0x5c35b5;var _0xb171e7={};var _0x20a019;var _0x7d1145=Number(_0x25a158[_0xad23('0xe')]);var _0x36d948=_0x25a158[_0xad23('0xf')]?Boolean(Number(_0x25a158[_0xad23('0xf')])):![];var _0x474922;var _0x2ab8ee=![];if(!_[_0xad23('0x10')](_0x25a158[_0xad23('0x11')])){if(_0x25a158['data5']=='1')_0x2ab8ee=!![];}if(!_0x2ab8ee){if(_0x3da922[_0xad23('0x12')]){_0xb171e7['id']=_0x3da922[_0xad23('0x12')];}}if(!_0xb171e7['id']){_0xb171e7[_0xad23('0x13')]=_0x7d1145;_0x474922=_0x25a158[_0xad23('0x14')]&&_0x25a158[_0xad23('0x14')]!=='0'?_0x25a158[_0xad23('0x14')][_0xad23('0x15')](','):[_0xad23('0x16')];_0xb171e7[_0xad23('0x17')]=_[_0xad23('0x18')](_0x474922,function(_0x54d1e3){var _0x34a1a3={};_0x34a1a3[_0x54d1e3]=_0x3da922[_0xad23('0x19')]?_0x3da922[_0xad23('0x1a')]:_0x3da922[_0xad23('0x1b')];return _0x34a1a3;});_0x20a019=_0x3da922[_0xad23('0x19')]?_0x3da922[_0xad23('0x1a')]:_0x3da922[_0xad23('0x1b')];}var _0x577c1b=['id','firstName',_0xad23('0x1c'),'phone',_0xad23('0x1d'),'fax',_0xad23('0x13'),_0xad23('0x1e'),_0xad23('0x1f'),_0xad23('0x20')];var _0x559981=_[_0xad23('0x21')](_0x577c1b,_0x474922);BPromise['resolve']()[_0xad23('0x22')](cmContactRpc[_0xad23('0x23')]({'attributes':_0x559981,'where':_0xb171e7,'phone':_0x20a019}))[_0xad23('0x22')](function(_0x204e6b){_0x5c35b5=_0x204e6b;if(!_[_0xad23('0x24')](_0x5c35b5)){if(_0x5c35b5['length']===0x1){_0x42e719=_0x5c35b5[0x0];logger[_0xad23('0xa')](_0xad23('0x25'),_0x3da922[_0xad23('0x26')],_0x3f3954['id'],_0x42e719['id']);}else{logger[_0xad23('0xa')](_0xad23('0x27'),_0x3da922[_0xad23('0x26')],_0x3f3954['id'],_[_0xad23('0x18')](_0x5c35b5,'id')[_0xad23('0x28')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x3da922[_0xad23('0x26')],_0x3f3954['id']);var _0x927e77={'ListId':_0x7d1145};var _0x43f184=_0x25a158['data4']&&_0x25a158[_0xad23('0x29')]!=='0'?_0x25a158['data4']:'phone';if(_0x36d948){logger['info'](_0xad23('0x2a'),_0x3da922[_0xad23('0x26')],_0x3f3954['id']);_0x927e77[_0x43f184]=_['isNil'](_0x3da922[_0xad23('0x19')])?_0x3da922[_0xad23('0x1b')]:_0x3da922[_0xad23('0x1a')];if(_[_0xad23('0x10')](_0x3da922[_0xad23('0x19')])){_0x927e77[_0xad23('0x2b')]=_0x3da922[_0xad23('0x2c')]&&_0x3da922[_0xad23('0x2c')]!==_0xad23('0x2d')?_0x3da922[_0xad23('0x2c')]:_0xad23('0x2e');}else{_0x927e77[_0xad23('0x2b')]=_0x3da922[_0xad23('0x2f')]&&_0x3da922[_0xad23('0x2f')]!==_0xad23('0x2d')?_0x3da922['destcalleridname']:_0xad23('0x2e');}return BPromise[_0xad23('0x30')]()[_0xad23('0x22')](cmContactRpc[_0xad23('0x31')](_0x927e77))[_0xad23('0x22')](function(_0x45c1d3){_0x42e719=_0x45c1d3;_0x5c35b5[_0xad23('0x32')](_0x45c1d3);if(_0x42e719){logger[_0xad23('0xa')](_0xad23('0x33'),_0x3da922[_0xad23('0x26')],_0x3f3954['id'],_0x42e719['id']);}return;});}else{logger[_0xad23('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x3da922[_0xad23('0x26')],_0x3f3954['id']);_0x927e77[_0x43f184]=_['isNil'](_0x3da922[_0xad23('0x19')])?_0x3da922[_0xad23('0x1b')]:_0x3da922['destcalleridnum'];if(_['isNil'](_0x3da922[_0xad23('0x19')])){_0x927e77['firstName']=_0x3da922[_0xad23('0x2c')]&&_0x3da922[_0xad23('0x2c')]!==''?_0x3da922['calleridname']:_0xad23('0x2e');}else{_0x927e77[_0xad23('0x2b')]=_0x3da922[_0xad23('0x2f')]&&_0x3da922[_0xad23('0x2f')]!==_0xad23('0x2d')?_0x3da922[_0xad23('0x2f')]:'Unknown';}_0x42e719=_0x927e77;_0x5c35b5[_0xad23('0x32')](_0x927e77);return;}}})[_0xad23('0x22')](function(){if(_0x5c66aa){emit(_0x3da922[_0xad23('0x26')],_0x3f3954,util[_0xad23('0x34')](_0xad23('0x35'),_0x5c66aa[_0xad23('0x36')]),util['format'](_0xad23('0x37'),_0x25a158[_0xad23('0x38')][_0xad23('0x39')]()),{'evt':_[_0xad23('0x3a')](_0x3da922,{'autoCreate':_0x36d948}),'contact':_0x42e719===undefined?{}:_0x42e719,'contacts':_0x5c35b5[_0xad23('0x3b')]===0x0?undefined:_0x5c35b5});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index db53e95..e0293d1 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 _0x2687=['account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','undefined','created','equals','exports','util','lodash','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','trigger','../ami','redis','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','data5','windowHeight','data6','600','winApplication','render','winArguments','format','name','toLowerCase','user:%s','trigger:%s','integration','exec','queue','routeId','parse','query','replace','AllConditions','checkConditions','channel','AnyConditions','some'];(function(_0x48521f,_0x5bfb83){var _0x541f9b=function(_0x5b5c5e){while(--_0x5b5c5e){_0x48521f['push'](_0x48521f['shift']());}};_0x541f9b(++_0x5bfb83);}(_0x2687,0x8f));var _0x7268=function(_0x5e78e7,_0x50be14){_0x5e78e7=_0x5e78e7-0x0;var _0xfa445f=_0x2687[_0x5e78e7];return _0xfa445f;};'use strict';var util=require(_0x7268('0x0'));var _=require(_0x7268('0x1'));var url=require('url');var Mustache=require(_0x7268('0x2'));var Redis=require(_0x7268('0x3'));var urlforward=require(_0x7268('0x4'));var integration=require('./integration');var cmContact=require(_0x7268('0x5'));var script=require(_0x7268('0x6'));var config=require(_0x7268('0x7'));var logger=require('../../../config/logger')(_0x7268('0x8'));var ami=require(_0x7268('0x9'));config[_0x7268('0xa')]=_['defaults'](config['redis'],{'host':_0x7268('0xb'),'port':0x18eb});var io=require(_0x7268('0xc'))(new Redis(config[_0x7268('0xa')]));var operators={'equals':function(_0x3b25f8,_0x32885e){return _0x3b25f8==_0x32885e;},'not_equals':function(_0x116b3f,_0x57c35a){return _0x116b3f!=_0x57c35a;}};var barAndWebActions=[_0x7268('0xd'),_0x7268('0xe'),_0x7268('0xf')];function Trigger(_0x19db51){this[_0x7268('0x10')]=_0x19db51[_0x7268('0x10')];this[_0x7268('0x11')]=_0x19db51['agents'];this[_0x7268('0x12')]=_0x19db51[_0x7268('0x12')];this[_0x7268('0x13')]=_0x19db51[_0x7268('0x13')];this[_0x7268('0x14')]=_0x19db51[_0x7268('0x14')];this['zendeskAccounts']=_0x19db51['zendeskAccounts'];this['freshdeskAccounts']=_0x19db51[_0x7268('0x15')];this[_0x7268('0x16')]=_0x19db51[_0x7268('0x16')];this[_0x7268('0x17')]=_0x19db51[_0x7268('0x17')];this[_0x7268('0x18')]=_0x19db51[_0x7268('0x18')];this[_0x7268('0x19')]=_0x19db51['deskAccounts'];this[_0x7268('0x1a')]=_0x19db51['vtigerAccounts'];this[_0x7268('0x1b')]=_0x19db51[_0x7268('0x1b')];this['dynamics365Accounts']=_0x19db51[_0x7268('0x1c')];this[_0x7268('0x1d')]=_0x19db51['freshsalesAccounts'];this[_0x7268('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x7268('0x16')],'freshdesk':this[_0x7268('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x7268('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x7268('0x1a')],'dynamics365':this[_0x7268('0x1c')],'freshsales':this[_0x7268('0x1d')],'servicenow':this[_0x7268('0x1b')]};ami['on']('custom:agentcalled',this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x21'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x22'),this['syncCustomEvent'][_0x7268('0x20')](this));ami['on'](_0x7268('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x24'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x25'),this[_0x7268('0x1f')]['bind'](this));ami['on'](_0x7268('0x26'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x27'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x28'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x29'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x2a'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x2b'),this[_0x7268('0x2c')][_0x7268('0x20')](this));ami['on'](_0x7268('0x2d'),this[_0x7268('0x2c')][_0x7268('0x20')](this));ami['on'](_0x7268('0x2e'),this[_0x7268('0x2c')][_0x7268('0x20')](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x7268('0x2f'),this[_0x7268('0x1f')][_0x7268('0x20')](this));ami['on'](_0x7268('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7268('0x31'),this['syncCustomEvent'][_0x7268('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x7268('0x1f')]['bind'](this));ami['on'](_0x7268('0x32'),this['syncCustomEvent'][_0x7268('0x20')](this));ami['on'](_0x7268('0x33'),this['syncCustomEvent'][_0x7268('0x20')](this));ami['on'](_0x7268('0x34'),this[_0x7268('0x1f')]['bind'](this));}Trigger[_0x7268('0x35')][_0x7268('0x36')]=function(_0x28fc39,_0x53d722,_0x5630af){logger[_0x7268('0x37')](_0x28fc39,_0x53d722,JSON['stringify'](_0x5630af));io['to'](_0x28fc39)[_0x7268('0x36')](_0x53d722,_0x5630af);};Trigger[_0x7268('0x35')][_0x7268('0x1f')]=function(_0x4cf14d){var _0x1e5cee=_[_0x7268('0x38')](_0x4cf14d);if(typeof _0x1e5cee[_0x7268('0x39')]==='undefined'){_0x1e5cee[_0x7268('0x39')]=_0x7268('0x3a');}this[_0x7268('0x3b')](_0x1e5cee);};Trigger['prototype'][_0x7268('0x2c')]=function(_0x5e9209){if(this[_0x7268('0x11')][_0x5e9209[_0x7268('0x3c')]]){this[_0x7268('0x1f')](_0x5e9209);}};Trigger[_0x7268('0x35')]['checkTriggers']=function(_0x29310a){var _0x2e01da;for(var _0x10ac0e in this[_0x7268('0x10')]){if(this['triggers'][_0x7268('0x3d')](_0x10ac0e)){if(this['triggers'][_0x10ac0e][_0x7268('0x3e')]){_0x2e01da=this[_0x7268('0x3f')](this[_0x7268('0x10')][_0x10ac0e],_0x29310a);if(_0x2e01da){_[_0x7268('0x40')](_0x29310a,_0x29310a[_0x7268('0x41')]);for(var _0x295598=0x0,_0x204f91,_0x2e05fa,_0x4cb400;_0x2955980x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x5fc3[_0x30d87a];return _0x48f64b;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ 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 b347fd6..d958a23 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 _0x05df=['defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data5','POST','clientId','username','password','clientSecret','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','then','value','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','nameField','idField','substring','indexOf','incident','incidents','getString','Subjects','Fields','phonecall','queue','/contacts(','callDirection','phonecalls','assign','Descriptions','ticketType','ticketId','user:%s','emit','stripTrailingSlash','serverUrl','format','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x05df,0xcc));var _0xf05d=function(_0x280899,_0x4a5aa3){_0x280899=_0x280899-0x0;var _0x346365=_0x05df[_0x280899];return _0x346365;};'use strict';var _=require(_0xf05d('0x0'));var rp=require(_0xf05d('0x1'));var util=require(_0xf05d('0x2'));var intUtil=require(_0xf05d('0x3'));var md5=require(_0xf05d('0x4'));var Redis=require(_0xf05d('0x5'));var logger=require(_0xf05d('0x6'))(_0xf05d('0x7'));var config=require(_0xf05d('0x8'));config[_0xf05d('0x9')]=_[_0xf05d('0xa')](config['redis'],{'host':_0xf05d('0xb'),'port':0x18eb});var io=require(_0xf05d('0xc'))(new Redis(config[_0xf05d('0x9')]));function getAuthToken(_0x47efd4,_0x1df89b,_0x2fba2e){if(_0x47efd4[_0xf05d('0xd')]){_0x47efd4[_0xf05d('0xe')]=_0x47efd4[_0xf05d('0xf')][_0xf05d('0x10')];_0x47efd4[_0xf05d('0x11')]=_0x47efd4[_0xf05d('0xf')]['data2'];return Promise['resolve'](_0x47efd4[_0xf05d('0xf')][_0xf05d('0x12')]);}var _0x214835={'method':_0xf05d('0x13'),'uri':_0x1df89b,'form':{'client_id':_0x47efd4[_0xf05d('0x14')],'resource':_0x47efd4['remoteUri'],'username':_0x47efd4[_0xf05d('0x15')],'password':_0x47efd4[_0xf05d('0x16')],'grant_type':_0xf05d('0x16'),'client_secret':_0x47efd4[_0xf05d('0x17')]},'json':!![]};return rp(_0x214835)['then'](function(_0x2d2350){return _0x2d2350['access_token'];})[_0xf05d('0x18')](function(_0x4bff32){logger['error']('['+[_0x2fba2e['toUpperCase']()]+_0xf05d('0x19'));return _0x4bff32[_0xf05d('0x1a')];});}function getUser(_0x195155,_0x111386,_0x1e072e,_0x1ed13e,_0x4dfd5f,_0x110931){return new Promise(function(_0x1956da,_0x38f5b5){return getAuthToken(_0x111386,_0x1ed13e,_0x110931)['then'](function(_0x591f00){var _0x535f68={'method':_0xf05d('0x1b'),'uri':_0x4dfd5f+_0xf05d('0x1c'),'headers':{'Authorization':_0xf05d('0x1d')+_0x591f00,'OData-Version':_0xf05d('0x1e')},'json':!![]};return rp(_0x535f68);})[_0xf05d('0x1f')](function(_0x20f6e4){var _0x31c47f=_0x20f6e4[_0xf05d('0x20')];var _0x1f1d7d=![];var _0x41e2c4=null;if(!_['isNil'](_0x1e072e)){if(intUtil[_0xf05d('0x21')](_0x1e072e['email'])){_0x195155[_0xf05d('0x22')]=_0x1e072e[_0xf05d('0x23')];for(_0x41e2c4=0x0;_0x41e2c4<_0x31c47f[_0xf05d('0x24')];_0x41e2c4++){if(_0x31c47f[_0x41e2c4][_0xf05d('0x25')]===_0x1e072e['email']&&!_0x31c47f[_0x41e2c4][_0xf05d('0x26')]){_0x1f1d7d=!![];logger[_0xf05d('0x27')]('['+[_0x110931[_0xf05d('0x28')]()]+']\x20Agent\x20found\x20'+_0x31c47f[_0x41e2c4][_0xf05d('0x29')]+'!');_0x195155[_0xf05d('0x2a')]=_0x31c47f[_0x41e2c4][_0xf05d('0x29')];}}}}if(!_0x1f1d7d){logger[_0xf05d('0x27')]('['+[_0x110931[_0xf05d('0x28')]()]+_0xf05d('0x2b'));_0x195155[_0xf05d('0x22')]=_0x111386[_0xf05d('0x15')];for(_0x41e2c4=0x0;_0x41e2c4<_0x31c47f['length'];_0x41e2c4++){if(_0x31c47f[_0x41e2c4][_0xf05d('0x25')]===_0x111386[_0xf05d('0x15')]){_0x195155[_0xf05d('0x2a')]=_0x31c47f[_0x41e2c4][_0xf05d('0x29')];}}}_0x1956da(_0x195155);})['catch'](function(_0x13eafc){_0x38f5b5(_0x13eafc['message']);});});}function createEndUser(_0x3c8e42,_0x26f776,_0x56629e,_0x451f17,_0x4ad23e,_0x4d4ce2,_0x116ab5){return new Promise(function(_0x42b0aa,_0xed4dfc){return getAuthToken(_0x26f776,_0x56629e,_0x4d4ce2)[_0xf05d('0x1f')](function(_0x22f5f4){var _0x1e18c4=_0x4d4ce2[_0xf05d('0x2c')]()==='outbound'?_0x4ad23e[_0xf05d('0x2d')]:_0x4ad23e[_0xf05d('0x2e')];var _0x1ce707={'method':_0xf05d('0x13'),'uri':_0x451f17+_0xf05d('0x2f'),'body':{'fullname':_0x1e18c4,'firstname':_0x1e18c4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf05d('0x30')+_0x3c8e42[_0xf05d('0x2a')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x22f5f4,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x1ce707['body'][_0x116ab5]=_0x1e18c4;return rp(_0x1ce707);})[_0xf05d('0x1f')](function(_0x4fa477){var _0x39f2b1=_0x4fa477[_0xf05d('0x31')][_0xf05d('0x32')];var _0xb662ad=_0x39f2b1['substring'](_0x39f2b1[_0xf05d('0x33')]('(')+0x1,_0x39f2b1['lastIndexOf'](')'));_0x3c8e42[_0xf05d('0x34')]=_0xb662ad;_0x42b0aa(_0x3c8e42);})['catch'](function(_0x15b45c){_0xed4dfc(_0x15b45c[_0xf05d('0x1a')]);});});}function getEndUser(_0x33bf0f,_0x119ddd,_0x1cffff,_0x116ef3,_0x27fd8f,_0x54723c,_0x3a22dc,_0x5926e6){var _0x57b934=_0x54723c[_0xf05d('0x2c')]()===_0xf05d('0x35')?_0x27fd8f[_0xf05d('0x2d')]:_0x27fd8f[_0xf05d('0x2e')];return getAuthToken(_0x119ddd,_0x1cffff,_0x54723c)[_0xf05d('0x1f')](function(_0x20ea69){_0x5926e6=_0x5926e6?_0x5926e6:_0xf05d('0x36');var _0x1933e8={'method':_0xf05d('0x1b'),'uri':_0x116ef3+_0xf05d('0x37')+_0x5926e6+_0xf05d('0x38')+_0x5926e6+_0xf05d('0x39')+_0x57b934[_0xf05d('0x3a')]('+',_0xf05d('0x3b'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x20ea69,'If-None-Match':null,'OData-Version':_0xf05d('0x1e')},'json':!![]};return rp(_0x1933e8);})[_0xf05d('0x1f')](function(_0x124022){var _0x3cb900=![];if(!_0x124022)return _0x3cb900;var _0x1cda05=_0x124022[_0xf05d('0x20')];for(var _0x13c363=0x0;_0x13c363<_0x1cda05[_0xf05d('0x24')];_0x13c363++){if(_0x1cda05[_0x13c363][_0x5926e6]===_0x57b934){_0x3cb900=!![];_0x33bf0f[_0xf05d('0x34')]=_0x1cda05[_0x13c363][_0xf05d('0x3c')];}}return _0x3cb900;})[_0xf05d('0x1f')](function(_0x42c3b8){if(_0x42c3b8)return _0x33bf0f;if(_0x3a22dc===_0xf05d('0x3d')){logger['info']('['+[_0x54723c[_0xf05d('0x28')]()]+_0xf05d('0x3e'));return _0x33bf0f;}return createEndUser(_0x33bf0f,_0x119ddd,_0x1cffff,_0x116ef3,_0x27fd8f,_0x54723c,_0x5926e6)['then'](function(_0x373aee){logger[_0xf05d('0x27')]('['+[_0x54723c[_0xf05d('0x28')]()]+_0xf05d('0x3f'),_0x373aee['enduserId']);return _0x373aee;});});}function getCustomFields(_0x540ced,_0xf3beb,_0x4939e1){var _0x56ccaa={};if(_0x540ced[_0xf05d('0x24')]>0x0){_[_0xf05d('0x40')](_0x540ced,function(_0x4bcc19){if(_['includes'](['string','picklist'],_0x4bcc19['type'])&&_0x4bcc19[_0xf05d('0x41')]&&!_0x4bcc19['customField']){var _0x4bcb7f=_0x4bcc19[_0xf05d('0x42')][_0xf05d('0x2c')]();var _0x5215be=_0x4bcb7f[_0xf05d('0x43')](0x0,_0x4bcb7f[_0xf05d('0x44')]('_'));var _0x4c4d3a=_0x4bcb7f[_0xf05d('0x43')](_0x4bcb7f[_0xf05d('0x44')]('_')+0x1);if(_0x5215be===_0x4939e1){_0x56ccaa[_0x4c4d3a]=_0x4bcc19['content'];}}});}return _0x56ccaa;}function getTicket(_0x43fe0d,_0xa5e2ec,_0x4577c2,_0x1ab71b,_0x2fa40a,_0x1e5870,_0x31450d){return new Promise(function(_0x50f71f,_0x23f812){var _0x3a1420;return getAuthToken(_0xa5e2ec,_0x4577c2,_0x31450d)[_0xf05d('0x1f')](function(_0x6d86e3){if(_0x1e5870['ticketType']===_0xf05d('0x45')){_0x3a1420={'method':_0xf05d('0x13'),'uri':_0x1ab71b+_0xf05d('0x46'),'body':Object['assign']({},{'title':intUtil[_0xf05d('0x47')](_0x1e5870[_0xf05d('0x48')],_0x2fa40a,'\x20'),'description':intUtil[_0xf05d('0x47')](_0x1e5870['Descriptions'],_0x2fa40a,'\x0a'),'customerid_contact@odata.bind':_0x43fe0d[_0xf05d('0x34')]?'/contacts('+_0x43fe0d[_0xf05d('0x34')]+')':undefined,'ownerid@odata.bind':_0xf05d('0x30')+_0x43fe0d[_0xf05d('0x2a')]+')','caseorigincode':'1'},getCustomFields(_0x1e5870[_0xf05d('0x49')],_0x2fa40a,_0x1e5870['ticketType'])),'headers':{'Authorization':_0xf05d('0x1d')+_0x6d86e3,'OData-Version':_0xf05d('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1e5870['ticketType']===_0xf05d('0x4a')){var _0x3ea801=_0x43fe0d[_0xf05d('0x34')]?[{'partyid_systemuser@odata.bind':_0xf05d('0x30')+_0x43fe0d[_0xf05d('0x2a')]+')','participationtypemask':_0x43fe0d['callDirection']===_0xf05d('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0xf05d('0x4c')+_0x43fe0d['enduserId']+')','participationtypemask':_0x43fe0d['callDirection']===_0xf05d('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xf05d('0x30')+_0x43fe0d['userId']+')','participationtypemask':_0x43fe0d[_0xf05d('0x4d')]==='queue'?0x2:0x1}];_0x3a1420={'method':'POST','uri':_0x1ab71b+_0xf05d('0x4e'),'body':Object[_0xf05d('0x4f')]({},{'subject':intUtil[_0xf05d('0x47')](_0x1e5870[_0xf05d('0x48')],_0x2fa40a,'\x20'),'phonenumber':String(_0x2fa40a[_0xf05d('0x2e')]),'description':intUtil[_0xf05d('0x47')](_0x1e5870[_0xf05d('0x50')],_0x2fa40a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x43fe0d[_0xf05d('0x34')]?_0xf05d('0x4c')+_0x43fe0d[_0xf05d('0x34')]+')':undefined,'ownerid@odata.bind':_0xf05d('0x30')+_0x43fe0d[_0xf05d('0x2a')]+')','directioncode':_0x43fe0d[_0xf05d('0x4d')]===_0xf05d('0x4b')?![]:!![],'phonecall_activity_parties':_0x3ea801},getCustomFields(_0x1e5870[_0xf05d('0x49')],_0x2fa40a,_0x1e5870[_0xf05d('0x51')])),'headers':{'Authorization':_0xf05d('0x1d')+_0x6d86e3,'OData-Version':_0xf05d('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3a1420);})[_0xf05d('0x1f')](function(_0x3951b4){var _0x3adfe5=_0x3951b4[_0xf05d('0x31')]['odata-entityid'];var _0x2df47f=_0x3adfe5[_0xf05d('0x43')](_0x3adfe5[_0xf05d('0x33')]('(')+0x1,_0x3adfe5[_0xf05d('0x33')](')'));_0x43fe0d[_0xf05d('0x52')]=_0x2df47f;_0x50f71f(_0x43fe0d);})[_0xf05d('0x18')](function(_0x3ef34e){_0x23f812(_0x3ef34e[_0xf05d('0x1a')]);});});}function emit(_0x2d19f1,_0x26a736,_0x42cf2d,_0x4b7202){var _0x525ebf={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2d19f1,_0x42cf2d,_0x4b7202)};io['to'](util['format'](_0xf05d('0x53'),_0x26a736))[_0xf05d('0x54')]('trigger:browser:url',_0x525ebf);}exports['cs']=function(_0x3157d4,_0x4d5e2b,_0x4eb5ba,_0x329200,_0xe12587,_0x4c8cbf,_0x22f513,_0x2b9897){var _0xd9c765={};_0x4c8cbf[_0xf05d('0xe')]=_0x4c8cbf[_0xf05d('0xd')]?intUtil[_0xf05d('0x55')](_0x4c8cbf[_0xf05d('0xf')][_0xf05d('0x10')]):intUtil[_0xf05d('0x55')](_0x4c8cbf[_0xf05d('0xe')]);_0x4c8cbf[_0xf05d('0x56')]=intUtil['stripTrailingSlash'](_0x4c8cbf[_0xf05d('0x56')]);_0xd9c765[_0xf05d('0x4d')]=_0x2b9897===_0xf05d('0x4b')||_0x2b9897==='unmanaged'?_0xf05d('0x4b'):_0xf05d('0x35');var _0x1f6948=_0x4c8cbf[_0xf05d('0xd')]?util[_0xf05d('0x57')](_0xf05d('0x58'),_0x4c8cbf['CloudProvider'][_0xf05d('0x10')]):util[_0xf05d('0x57')](_0xf05d('0x58'),_0x4c8cbf[_0xf05d('0xe')]);var _0x1ab012=util[_0xf05d('0x57')]('https://login.microsoftonline.com/%s/oauth2/token',_0x4c8cbf[_0xf05d('0x11')]);var _0x1a5fb9=util[_0xf05d('0x57')](_0xf05d('0x59'),_0x4c8cbf[_0xf05d('0x56')],_0x4d5e2b['uniqueid'],md5(_0x4d5e2b['uniqueid']));if(_0xe12587&&_0xe12587[_0xf05d('0x5a')]){logger[_0xf05d('0x27')](_0xf05d('0x5b'),'Recording\x20is\x20enabled!');_0x4d5e2b[_0xf05d('0x5c')]=_0x1a5fb9;}else if(_0x22f513&&_0x22f513[_0xf05d('0x5d')]&&_0x22f513['recordingFormat']!==_0xf05d('0x5e')){logger[_0xf05d('0x27')](_0xf05d('0x5f'),'Recording\x20is\x20enabled!');_0x4d5e2b[_0xf05d('0x5c')]=_0x1a5fb9;}else{_0x4d5e2b['recordingURL']='';}return getUser(_0xd9c765,_0x4c8cbf,_0x329200,_0x1ab012,_0x1f6948,_0x2b9897)['then'](function(_0x4930bb){logger[_0xf05d('0x27')]('['+_0x2b9897[_0xf05d('0x28')]()+_0xf05d('0x60'),_0x4930bb[_0xf05d('0x2a')]);logger[_0xf05d('0x27')]('['+_0x2b9897[_0xf05d('0x28')]()+']\x20The\x20User\x20email\x20is:',_0x4930bb[_0xf05d('0x22')]);return getEndUser(_0x4930bb,_0x4c8cbf,_0x1ab012,_0x1f6948,_0x4d5e2b,_0x2b9897,_0x4eb5ba[_0xf05d('0x61')],_0x4eb5ba[_0xf05d('0x62')]);})[_0xf05d('0x1f')](function(_0x54326f){logger[_0xf05d('0x27')]('['+_0x2b9897['toUpperCase']()+_0xf05d('0x63'),_0x54326f['enduserId']);logger[_0xf05d('0x27')]('['+_0x2b9897[_0xf05d('0x28')]()+_0xf05d('0x64'),_0x4d5e2b[_0xf05d('0x2e')]);return getTicket(_0x54326f,_0x4c8cbf,_0x1ab012,_0x1f6948,_0x4d5e2b,_0x4eb5ba,_0x2b9897);})[_0xf05d('0x1f')](function(_0x509193){logger[_0xf05d('0x27')](util[_0xf05d('0x57')]('['+_0x2b9897[_0xf05d('0x28')]()+_0xf05d('0x65'),_0x4eb5ba[_0xf05d('0x51')],_0x509193[_0xf05d('0x52')]));logger[_0xf05d('0x27')](util['format']('['+_0x2b9897[_0xf05d('0x28')]()+_0xf05d('0x66'),_0x2b9897));if(_0x2b9897!=='unmanaged'&&_0x4eb5ba['openNewTab']){logger['info']('['+_0x2b9897[_0xf05d('0x28')]()+']',_0xf05d('0x67'));emit(_0x4c8cbf[_0xf05d('0xe')],_0x329200['name'],_0x4eb5ba['ticketType'],_0x509193[_0xf05d('0x52')]);}})[_0xf05d('0x18')](function(_0x5706eb){logger[_0xf05d('0x68')]('['+_0x2b9897[_0xf05d('0x28')]()+_0xf05d('0x69'),_0x5706eb[_0xf05d('0x1a')]);console[_0xf05d('0x68')](_0xf05d('0x6a'),_0x5706eb);});}; \ No newline at end of file +var _0x0763=['ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','resolve','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','internalemailaddress','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf'];(function(_0x9148ba,_0x2cb1b5){var _0x355e3b=function(_0x134846){while(--_0x134846){_0x9148ba['push'](_0x9148ba['shift']());}};_0x355e3b(++_0x2cb1b5);}(_0x0763,0x169));var _0x3076=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x0763[_0xe1b5f6];return _0x44636e;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0x3076('0x0'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x3076('0x1'));var logger=require(_0x3076('0x2'))(_0x3076('0x3'));var config=require(_0x3076('0x4'));config[_0x3076('0x5')]=_['defaults'](config[_0x3076('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x3076('0x6'))(new Redis(config[_0x3076('0x5')]));function getAuthToken(_0x23404b,_0x56e2ae,_0x259b43){if(_0x23404b[_0x3076('0x7')]){_0x23404b['remoteUri']=_0x23404b[_0x3076('0x8')]['data7'];_0x23404b[_0x3076('0x9')]=_0x23404b['CloudProvider']['data2'];return Promise[_0x3076('0xa')](_0x23404b[_0x3076('0x8')]['data5']);}var _0x50205f={'method':_0x3076('0xb'),'uri':_0x56e2ae,'form':{'client_id':_0x23404b[_0x3076('0xc')],'resource':_0x23404b[_0x3076('0xd')],'username':_0x23404b[_0x3076('0xe')],'password':_0x23404b[_0x3076('0xf')],'grant_type':'password','client_secret':_0x23404b[_0x3076('0x10')]},'json':!![]};return rp(_0x50205f)[_0x3076('0x11')](function(_0x52edd1){return _0x52edd1[_0x3076('0x12')];})[_0x3076('0x13')](function(_0x45d160){logger[_0x3076('0x14')]('['+[_0x259b43[_0x3076('0x15')]()]+_0x3076('0x16'));return _0x45d160[_0x3076('0x17')];});}function getUser(_0x12f1bc,_0x421fb2,_0x11da1a,_0x2b2418,_0x5928e4,_0x272578){return new Promise(function(_0x8103c7,_0x47c9a6){return getAuthToken(_0x421fb2,_0x2b2418,_0x272578)[_0x3076('0x11')](function(_0x52119b){var _0x50b415={'method':_0x3076('0x18'),'uri':_0x5928e4+_0x3076('0x19'),'headers':{'Authorization':_0x3076('0x1a')+_0x52119b,'OData-Version':'4.0'},'json':!![]};return rp(_0x50b415);})[_0x3076('0x11')](function(_0x3f465c){var _0x19bd86=_0x3f465c[_0x3076('0x1b')];var _0x455651=![];var _0x206d37=null;if(!_[_0x3076('0x1c')](_0x11da1a)){if(intUtil[_0x3076('0x1d')](_0x11da1a[_0x3076('0x1e')])){_0x12f1bc[_0x3076('0x1f')]=_0x11da1a[_0x3076('0x1e')];for(_0x206d37=0x0;_0x206d37<_0x19bd86['length'];_0x206d37++){if(_0x19bd86[_0x206d37][_0x3076('0x20')]===_0x11da1a[_0x3076('0x1e')]&&!_0x19bd86[_0x206d37]['isdisabled']){_0x455651=!![];logger[_0x3076('0x21')]('['+[_0x272578[_0x3076('0x15')]()]+']\x20Agent\x20found\x20'+_0x19bd86[_0x206d37][_0x3076('0x22')]+'!');_0x12f1bc['userId']=_0x19bd86[_0x206d37][_0x3076('0x22')];}}}}if(!_0x455651){logger['info']('['+[_0x272578[_0x3076('0x15')]()]+_0x3076('0x23'));_0x12f1bc[_0x3076('0x1f')]=_0x421fb2[_0x3076('0xe')];for(_0x206d37=0x0;_0x206d37<_0x19bd86[_0x3076('0x24')];_0x206d37++){if(_0x19bd86[_0x206d37]['internalemailaddress']===_0x421fb2[_0x3076('0xe')]){_0x12f1bc[_0x3076('0x25')]=_0x19bd86[_0x206d37][_0x3076('0x22')];}}}_0x8103c7(_0x12f1bc);})['catch'](function(_0x1e2f45){_0x47c9a6(_0x1e2f45[_0x3076('0x17')]);});});}function createEndUser(_0x5b737a,_0xcf0d27,_0x5e4369,_0x5af8af,_0x3d3f62,_0x4abed6,_0x588e00){return new Promise(function(_0x503cc3,_0x866060){return getAuthToken(_0xcf0d27,_0x5e4369,_0x4abed6)['then'](function(_0x3a4d88){var _0x10024b=_0x4abed6[_0x3076('0x26')]()===_0x3076('0x27')?_0x3d3f62[_0x3076('0x28')]:_0x3d3f62[_0x3076('0x29')];var _0x311955={'method':_0x3076('0xb'),'uri':_0x5af8af+'contacts','body':{'fullname':_0x10024b,'firstname':_0x10024b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3076('0x2a')+_0x5b737a[_0x3076('0x25')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x3a4d88,'OData-Version':_0x3076('0x2b')},'json':!![],'resolveWithFullResponse':!![]};_0x311955[_0x3076('0x2c')][_0x588e00]=_0x10024b;return rp(_0x311955);})[_0x3076('0x11')](function(_0xfa6b79){var _0x4f94bb=_0xfa6b79[_0x3076('0x2d')][_0x3076('0x2e')];var _0x147272=_0x4f94bb[_0x3076('0x2f')](_0x4f94bb[_0x3076('0x30')]('(')+0x1,_0x4f94bb[_0x3076('0x30')](')'));_0x5b737a[_0x3076('0x31')]=_0x147272;_0x503cc3(_0x5b737a);})[_0x3076('0x13')](function(_0x428382){_0x866060(_0x428382['message']);});});}function getEndUser(_0x3bff7d,_0x1abaa0,_0x2ecfd4,_0x270e70,_0x370274,_0x42aebc,_0x321b93,_0x1c51c1){var _0x5e9392=_0x42aebc['toLowerCase']()===_0x3076('0x27')?_0x370274['destcalleridnum']:_0x370274['calleridnum'];return getAuthToken(_0x1abaa0,_0x2ecfd4,_0x42aebc)[_0x3076('0x11')](function(_0x4b797c){_0x1c51c1=_0x1c51c1?_0x1c51c1:_0x3076('0x32');var _0x4e431a={'method':'GET','uri':_0x270e70+_0x3076('0x33')+_0x1c51c1+_0x3076('0x34')+_0x1c51c1+_0x3076('0x35')+_0x5e9392[_0x3076('0x36')]('+','%2b')+'\x27','headers':{'Authorization':_0x3076('0x1a')+_0x4b797c,'If-None-Match':null,'OData-Version':_0x3076('0x2b')},'json':!![]};return rp(_0x4e431a);})[_0x3076('0x11')](function(_0x382512){var _0x2af339=![];if(!_0x382512)return _0x2af339;var _0x343ef5=_0x382512[_0x3076('0x1b')];for(var _0x4aa972=0x0;_0x4aa972<_0x343ef5[_0x3076('0x24')];_0x4aa972++){if(_0x343ef5[_0x4aa972][_0x1c51c1]===_0x5e9392){_0x2af339=!![];_0x3bff7d['enduserId']=_0x343ef5[_0x4aa972][_0x3076('0x37')];}}return _0x2af339;})['then'](function(_0x8fb43f){if(_0x8fb43f)return _0x3bff7d;if(_0x321b93==='nothing'){logger[_0x3076('0x21')]('['+[_0x42aebc[_0x3076('0x15')]()]+_0x3076('0x38'));return _0x3bff7d;}return createEndUser(_0x3bff7d,_0x1abaa0,_0x2ecfd4,_0x270e70,_0x370274,_0x42aebc,_0x1c51c1)[_0x3076('0x11')](function(_0x24cf42){logger[_0x3076('0x21')]('['+[_0x42aebc[_0x3076('0x15')]()]+_0x3076('0x39'),_0x24cf42['enduserId']);return _0x24cf42;});});}function getCustomFields(_0x1dca1c,_0x2b76cc,_0xec860){var _0x7c36d8={};if(_0x1dca1c[_0x3076('0x24')]>0x0){_[_0x3076('0x3a')](_0x1dca1c,function(_0x31ed60){if(_[_0x3076('0x3b')]([_0x3076('0x3c'),_0x3076('0x3d')],_0x31ed60[_0x3076('0x3e')])&&_0x31ed60[_0x3076('0x3f')]&&!_0x31ed60[_0x3076('0x40')]){var _0x40d3d1=_0x31ed60[_0x3076('0x41')][_0x3076('0x26')]();var _0x153b47=_0x40d3d1[_0x3076('0x2f')](0x0,_0x40d3d1[_0x3076('0x42')]('_'));var _0x55dfe6=_0x40d3d1[_0x3076('0x2f')](_0x40d3d1[_0x3076('0x42')]('_')+0x1);if(_0x153b47===_0xec860){_0x7c36d8[_0x55dfe6]=_0x31ed60['content'];}}});}return _0x7c36d8;}function getTicket(_0x48a67d,_0x3bfaca,_0x5afdcd,_0x39a635,_0x2cf74e,_0x297023,_0x53d47a){return new Promise(function(_0x4cac58,_0x54fc52){var _0x4dc677;return getAuthToken(_0x3bfaca,_0x5afdcd,_0x53d47a)['then'](function(_0x38f865){if(_0x297023[_0x3076('0x43')]===_0x3076('0x44')){_0x4dc677={'method':_0x3076('0xb'),'uri':_0x39a635+_0x3076('0x45'),'body':Object[_0x3076('0x46')]({},{'title':intUtil['getString'](_0x297023[_0x3076('0x47')],_0x2cf74e,'\x20'),'description':intUtil[_0x3076('0x48')](_0x297023[_0x3076('0x49')],_0x2cf74e,'\x0a'),'customerid_contact@odata.bind':_0x48a67d[_0x3076('0x31')]?_0x3076('0x4a')+_0x48a67d['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x48a67d['userId']+')','caseorigincode':'1'},getCustomFields(_0x297023[_0x3076('0x4b')],_0x2cf74e,_0x297023['ticketType'])),'headers':{'Authorization':_0x3076('0x1a')+_0x38f865,'OData-Version':_0x3076('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x297023[_0x3076('0x43')]===_0x3076('0x4c')){var _0x39a669=_0x48a67d['enduserId']?[{'partyid_systemuser@odata.bind':_0x3076('0x2a')+_0x48a67d[_0x3076('0x25')]+')','participationtypemask':_0x48a67d[_0x3076('0x4d')]===_0x3076('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x3076('0x4a')+_0x48a67d[_0x3076('0x31')]+')','participationtypemask':_0x48a67d[_0x3076('0x4d')]===_0x3076('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3076('0x2a')+_0x48a67d[_0x3076('0x25')]+')','participationtypemask':_0x48a67d['callDirection']===_0x3076('0x4e')?0x2:0x1}];_0x4dc677={'method':'POST','uri':_0x39a635+_0x3076('0x4f'),'body':Object[_0x3076('0x46')]({},{'subject':intUtil['getString'](_0x297023[_0x3076('0x47')],_0x2cf74e,'\x20'),'phonenumber':String(_0x2cf74e['calleridnum']),'description':intUtil[_0x3076('0x48')](_0x297023[_0x3076('0x49')],_0x2cf74e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x48a67d[_0x3076('0x31')]?_0x3076('0x4a')+_0x48a67d[_0x3076('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x48a67d[_0x3076('0x25')]+')','directioncode':_0x48a67d[_0x3076('0x4d')]==='queue'?![]:!![],'phonecall_activity_parties':_0x39a669},getCustomFields(_0x297023[_0x3076('0x4b')],_0x2cf74e,_0x297023[_0x3076('0x43')])),'headers':{'Authorization':_0x3076('0x1a')+_0x38f865,'OData-Version':_0x3076('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4dc677);})[_0x3076('0x11')](function(_0x53262b){var _0x122970=_0x53262b[_0x3076('0x2d')][_0x3076('0x2e')];var _0x5aff51=_0x122970['substring'](_0x122970[_0x3076('0x30')]('(')+0x1,_0x122970['lastIndexOf'](')'));_0x48a67d[_0x3076('0x50')]=_0x5aff51;_0x4cac58(_0x48a67d);})[_0x3076('0x13')](function(_0x44b585){_0x54fc52(_0x44b585[_0x3076('0x17')]);});});}function emit(_0x40754e,_0xc83591,_0x3ea73d,_0x236a4a){var _0x2f1b95={'uri':util['format'](_0x3076('0x51'),_0x40754e,_0x3ea73d,_0x236a4a)};io['to'](util[_0x3076('0x52')](_0x3076('0x53'),_0xc83591))[_0x3076('0x54')](_0x3076('0x55'),_0x2f1b95);}exports['cs']=function(_0x4e8e3d,_0x1c411e,_0x4a213d,_0x2acbe2,_0x392237,_0x506f5b,_0x28b4df,_0x5111f3){var _0xa76277={};_0x506f5b[_0x3076('0xd')]=_0x506f5b['modernAuthentication']?intUtil['stripTrailingSlash'](_0x506f5b['CloudProvider'][_0x3076('0x56')]):intUtil['stripTrailingSlash'](_0x506f5b['remoteUri']);_0x506f5b[_0x3076('0x57')]=intUtil['stripTrailingSlash'](_0x506f5b[_0x3076('0x57')]);_0xa76277['callDirection']=_0x5111f3===_0x3076('0x4e')||_0x5111f3===_0x3076('0x58')?_0x3076('0x4e'):_0x3076('0x27');var _0x24a715=_0x506f5b[_0x3076('0x7')]?util[_0x3076('0x52')](_0x3076('0x59'),_0x506f5b['CloudProvider'][_0x3076('0x56')]):util[_0x3076('0x52')](_0x3076('0x59'),_0x506f5b[_0x3076('0xd')]);var _0x2e9a7f=util[_0x3076('0x52')](_0x3076('0x5a'),_0x506f5b['tenantId']);var _0x56cadb=util['format'](_0x3076('0x5b'),_0x506f5b[_0x3076('0x57')],_0x1c411e[_0x3076('0x5c')],md5(_0x1c411e[_0x3076('0x5c')]));if(_0x392237&&_0x392237[_0x3076('0x5d')]){logger[_0x3076('0x21')]('[QUEUE]',_0x3076('0x5e'));_0x1c411e[_0x3076('0x5f')]=_0x56cadb;}else if(_0x28b4df&&_0x28b4df['recordingFormat']&&_0x28b4df['recordingFormat']!==_0x3076('0x60')){logger[_0x3076('0x21')](_0x3076('0x61'),'Recording\x20is\x20enabled!');_0x1c411e[_0x3076('0x5f')]=_0x56cadb;}else{_0x1c411e[_0x3076('0x5f')]='';}return getUser(_0xa76277,_0x506f5b,_0x2acbe2,_0x2e9a7f,_0x24a715,_0x5111f3)[_0x3076('0x11')](function(_0x5d6edb){logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x62'),_0x5d6edb[_0x3076('0x25')]);logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x63'),_0x5d6edb['userEmail']);return getEndUser(_0x5d6edb,_0x506f5b,_0x2e9a7f,_0x24a715,_0x1c411e,_0x5111f3,_0x4a213d[_0x3076('0x64')],_0x4a213d['additionalSearchContact']);})[_0x3076('0x11')](function(_0x44e85e){logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x65'),_0x44e85e['enduserId']);logger[_0x3076('0x21')]('['+_0x5111f3['toUpperCase']()+_0x3076('0x66'),_0x1c411e[_0x3076('0x29')]);return getTicket(_0x44e85e,_0x506f5b,_0x2e9a7f,_0x24a715,_0x1c411e,_0x4a213d,_0x5111f3);})[_0x3076('0x11')](function(_0x354113){logger[_0x3076('0x21')](util[_0x3076('0x52')]('['+_0x5111f3[_0x3076('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4a213d['ticketType'],_0x354113[_0x3076('0x50')]));logger[_0x3076('0x21')](util[_0x3076('0x52')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x67'),_0x5111f3));if(_0x5111f3!==_0x3076('0x58')&&_0x4a213d[_0x3076('0x68')]){logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x506f5b[_0x3076('0xd')],_0x2acbe2['name'],_0x4a213d['ticketType'],_0x354113[_0x3076('0x50')]);}})[_0x3076('0x13')](function(_0x378632){logger[_0x3076('0x14')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x69'),_0x378632[_0x3076('0x17')]);console['error'](_0x3076('0x6a'),_0x378632);});}; \ 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 d9bbfc6..bc94cc6 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 _0xc882=['includes','string','picklist','type','nameField','customField','idField','push','variableName','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','%s/helpdesk/tickets/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','GET','forEach'];(function(_0x2dd02a,_0x47b9a9){var _0x42eda4=function(_0xdc0de6){while(--_0xdc0de6){_0x2dd02a['push'](_0x2dd02a['shift']());}};_0x42eda4(++_0x47b9a9);}(_0xc882,0x187));var _0x2c88=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc882[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var rp=require(_0x2c88('0x0'));var md5=require(_0x2c88('0x1'));var util=require('util');var Redis=require(_0x2c88('0x2'));var intUtil=require('./util');var config=require(_0x2c88('0x3'));var logger=require(_0x2c88('0x4'))(_0x2c88('0x5'));config[_0x2c88('0x6')]=_[_0x2c88('0x7')](config[_0x2c88('0x6')],{'host':_0x2c88('0x8'),'port':0x18eb});var io=require(_0x2c88('0x9'))(new Redis(config[_0x2c88('0x6')]));var headers={'Content-Type':_0x2c88('0xa'),'Accept':_0x2c88('0xa')};function emit(_0x530db4,_0x59cb12,_0x5a6f5d){io['to'](_0x530db4)['emit'](_0x59cb12,_0x5a6f5d);}function getTicket(_0x2332fc,_0x1eb9b6,_0x9f992f,_0x2bd807,_0x2a877b){logger['info'](_0x2c88('0xb'));var _0x33ae80=_[_0x2c88('0xc')]({'responder_id':_0x1eb9b6['id'],'requester_id':_0x9f992f['id'],'name':util[_0x2c88('0xd')](_0x2c88('0xe'),_0x2a877b[_0x2c88('0xf')]),'phone':_0x2a877b[_0x2c88('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2c88('0x11')](_0x2bd807[_0x2c88('0x12')],_0x2a877b,'\x20'),'description':intUtil['getString'](_0x2bd807['Descriptions'],_0x2a877b,'
'),'tags':getTags(_0x2bd807[_0x2c88('0x13')],'name')},getCustomFields(_0x2bd807[_0x2c88('0x14')],_0x2a877b));_0x33ae80[_0x2c88('0x15')]=_[_0x2c88('0x16')](_[_0x2c88('0x17')](_0x33ae80[_0x2c88('0x15')],'id'),_0x2c88('0x18'));return request({'uri':util[_0x2c88('0xd')](_0x2c88('0x19'),_0x2332fc['remoteUri']),'method':'POST','body':_0x33ae80})[_0x2c88('0x1a')](function(_0x459b43){logger[_0x2c88('0x1b')](_0x2c88('0x1c'));return _0x459b43;});}function getUser(_0x55b1d8,_0x266410){if(intUtil[_0x2c88('0x1d')](_0x266410)){return request({'uri':util[_0x2c88('0xd')](_0x2c88('0x1e'),_0x55b1d8[_0x2c88('0x1f')]),'qs':{'email':_0x266410}})['then'](function(_0x1fe08c){if(_0x1fe08c['length']){logger['info'](_0x2c88('0x20'));return _[_0x2c88('0x21')](_0x1fe08c,function(_0x2fc842){return _0x2fc842[_0x2c88('0x22')][_0x2c88('0x23')]===_0x266410;});}else{logger[_0x2c88('0x1b')](_0x2c88('0x24'));return request({'uri':util['format'](_0x2c88('0x25'),_0x55b1d8[_0x2c88('0x1f')])})[_0x2c88('0x1a')](function(_0x117bf9){logger[_0x2c88('0x1b')](_0x2c88('0x26'));return _0x117bf9;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2c88('0xd')](_0x2c88('0x25'),_0x55b1d8['remoteUri'])})[_0x2c88('0x1a')](function(_0x45a824){logger[_0x2c88('0x1b')](_0x2c88('0x26'));return _0x45a824;});}}function getEndUser(_0x413130,_0x5b5aa5,_0x2517db){logger[_0x2c88('0x1b')]('Searching\x20enduser\x20with\x20phone',_0x2517db);return request({'uri':util['format'](_0x2c88('0x27'),_0x413130[_0x2c88('0x1f')]),'qs':{'phone':_0x2517db}})[_0x2c88('0x1a')](function(_0x12a449){if(_0x12a449[_0x2c88('0x28')]){logger[_0x2c88('0x1b')](_0x2c88('0x29'));return _[_0x2c88('0x21')](_0x12a449,{'phone':_0x2517db});}else{logger[_0x2c88('0x1b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2c88('0xd')](_0x2c88('0x27'),_0x413130[_0x2c88('0x1f')]),'method':'POST','body':{'name':_0x5b5aa5,'phone':_0x2517db}})['then'](function(_0x51594d){logger[_0x2c88('0x1b')](_0x2c88('0x2a'));return _0x51594d;});}});}function getAuth(_0x2853c3){return util['format'](_0x2c88('0x2b'),new Buffer(_0x2853c3[_0x2c88('0x2c')]+':X')[_0x2c88('0x2d')]('base64'));}function request(_0x25350b){logger[_0x2c88('0x2e')]('[HTTP]',JSON['stringify'](_0x25350b));return rp(_['defaults'](_0x25350b,{'method':_0x2c88('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x51bab5,_0x2e07f7){var _0x3304c3=[];if(_0x51bab5&&_0x51bab5[_0x2c88('0x28')]>0x0){_0x3304c3=_['map'](_0x51bab5,_0x2e07f7);}return _0x3304c3;}function getCustomFields(_0x420f1a,_0x2ed002){var _0x5595a2=[];var _0x4d1a37={'custom_fields':[]};if(_0x420f1a[_0x2c88('0x28')]>0x0){_[_0x2c88('0x30')](_0x420f1a,function(_0x866138){if(_[_0x2c88('0x31')]([_0x2c88('0x32'),_0x2c88('0x33')],_0x866138[_0x2c88('0x34')])&&_0x866138[_0x2c88('0x35')]&&!_0x866138[_0x2c88('0x36')]){_0x4d1a37[_0x866138[_0x2c88('0x35')]['toLowerCase']()]=_0x866138['content'][_0x2c88('0x2d')]();}else if(_['includes']([_0x2c88('0x32'),'picklist'],_0x866138[_0x2c88('0x34')])&&_0x866138[_0x2c88('0x37')]&&_0x866138[_0x2c88('0x36')]){_0x4d1a37[_0x2c88('0x15')][_0x2c88('0x38')]({'id':_0x866138[_0x2c88('0x37')],'value':_0x866138['content'][_0x2c88('0x2d')]()});}else if(_0x866138[_0x2c88('0x34')]==='variable'&&_0x866138[_0x2c88('0x39')]&&_0x866138[_0x2c88('0x37')]&&_0x866138[_0x2c88('0x36')]){_0x2ed002[_0x866138[_0x2c88('0x39')]]&&_0x4d1a37[_0x2c88('0x15')]['push']({'id':_0x866138['idField'],'value':_0x2ed002[_0x866138[_0x2c88('0x39')]][_0x2c88('0x2d')]()});}else if(_0x866138[_0x2c88('0x34')]==='customVariable'&&_0x866138['Variable']&&_0x866138[_0x2c88('0x3a')][_0x2c88('0x3b')]&&_0x866138[_0x2c88('0x37')]&&_0x866138[_0x2c88('0x36')]){_0x2ed002[_0x866138[_0x2c88('0x3a')]['name'][_0x2c88('0x3c')]()]&&_0x4d1a37[_0x2c88('0x15')][_0x2c88('0x38')]({'id':_0x866138['idField'],'value':_0x2ed002[_0x866138[_0x2c88('0x3a')][_0x2c88('0x3b')][_0x2c88('0x3c')]()][_0x2c88('0x2d')]()});}});}return _0x4d1a37;}exports[_0x2c88('0x3d')]=function(_0x11ccc7,_0x214c72,_0x1c72c8,_0x4729e4,_0x3b1726,_0xf2595c){var _0x21ba51,_0x85a39e;_0xf2595c[_0x2c88('0x1f')]=intUtil[_0x2c88('0x3e')](_0xf2595c[_0x2c88('0x1f')]);_0xf2595c[_0x2c88('0x3f')]=intUtil[_0x2c88('0x3e')](_0xf2595c[_0x2c88('0x3f')]);if(_0x3b1726&&_0x3b1726[_0x2c88('0x40')]){logger['info']('[QUEUE]',_0x2c88('0x41'));_0x214c72[_0x2c88('0x42')]=util[_0x2c88('0xd')](_0x2c88('0x43'),_0xf2595c['serverUrl'],_0x214c72[_0x2c88('0x44')],md5(_0x214c72[_0x2c88('0x44')]));}else{_0x214c72[_0x2c88('0x42')]='';}headers[_0x2c88('0x45')]=getAuth(_0xf2595c);return getUser(_0xf2595c,_0x4729e4[_0x2c88('0x23')])['then'](function(_0x1e431f){_0x21ba51=_0x1e431f;logger['info'](_0x2c88('0x46'),_0x21ba51['id']);return getEndUser(_0xf2595c,_0x214c72[_0x2c88('0xf')],_0x214c72[_0x2c88('0x10')]);})['then'](function(_0x195423){_0x85a39e=_0x195423;logger[_0x2c88('0x1b')](_0x2c88('0x47'),_0x85a39e['id']);return getTicket(_0xf2595c,_0x21ba51,_0x85a39e,_0x1c72c8,_0x214c72);})['then'](function(_0x450415){if(_0x450415&&_0x450415['id']){logger['info'](_0x2c88('0x1c'));logger[_0x2c88('0x1b')](_0x2c88('0x48'),_0x450415['id']);logger[_0x2c88('0x1b')](_0x2c88('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2c88('0xd')](_0x2c88('0x4a'),_0x4729e4[_0x2c88('0x3b')]),'trigger:browser:url',{'uri':util[_0x2c88('0xd')](_0x2c88('0x4b'),_0xf2595c[_0x2c88('0x1f')],_0x450415['id'])});}})[_0x2c88('0x4c')](function(_0x188d90){logger[_0x2c88('0x4d')](_0x2c88('0x49'),JSON[_0x2c88('0x4e')](_0x188d90));});};exports['outbound']=function(_0x3923ee,_0x193a01,_0x5bedb9,_0x496352,_0x54c9de,_0x5400ff,_0xb5ff97){var _0x19b868,_0x287df4;_0x5400ff['remoteUri']=intUtil[_0x2c88('0x3e')](_0x5400ff[_0x2c88('0x1f')]);_0x5400ff['serverUrl']=intUtil['stripTrailingSlash'](_0x5400ff[_0x2c88('0x3f')]);if(_0xb5ff97&&_0xb5ff97[_0x2c88('0x4f')]&&_0xb5ff97[_0x2c88('0x4f')]!==_0x2c88('0x50')){logger[_0x2c88('0x1b')](_0x2c88('0x51'),_0x2c88('0x41'));_0x193a01[_0x2c88('0x42')]=util[_0x2c88('0xd')](_0x2c88('0x43'),_0x5400ff[_0x2c88('0x3f')],_0x193a01[_0x2c88('0x44')],md5(_0x193a01[_0x2c88('0x44')]));}headers[_0x2c88('0x45')]=getAuth(_0x5400ff);return getUser(_0x5400ff,_0x496352[_0x2c88('0x23')])[_0x2c88('0x1a')](function(_0x3c0a39){_0x19b868=_0x3c0a39;logger['info']('The\x20User\x20ID\x20is:',_0x19b868['id']);return getEndUser(_0x5400ff,_0x193a01['destcalleridname'],_0x193a01[_0x2c88('0x52')]);})[_0x2c88('0x1a')](function(_0x469bb9){_0x287df4=_0x469bb9;logger[_0x2c88('0x1b')](_0x2c88('0x47'),_0x287df4['id']);return getTicket(_0x5400ff,_0x19b868,_0x287df4,_0x5bedb9,_0x193a01);})['then'](function(_0x1cd748){if(_0x1cd748&&_0x1cd748['id']){logger[_0x2c88('0x1b')](_0x2c88('0x1c'));logger[_0x2c88('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x1cd748['id']);logger[_0x2c88('0x1b')]('[OUTBOUND]',_0x2c88('0x53'));emit(util[_0x2c88('0xd')]('user:%s',_0x496352[_0x2c88('0x3b')]),_0x2c88('0x54'),{'uri':util['format'](_0x2c88('0x4b'),_0x5400ff[_0x2c88('0x1f')],_0x1cd748['id'])});}})[_0x2c88('0x4c')](function(_0x7b70dd){logger[_0x2c88('0x4d')](_0x2c88('0x51'),JSON[_0x2c88('0x4e')](_0x7b70dd));});};exports[_0x2c88('0x55')]=function(_0x128f86,_0x14478e,_0x442ec9,_0x2d51aa,_0xb0fa56,_0x2c6204){var _0x5038ff,_0x11a3a4;_0x2c6204['remoteUri']=intUtil['stripTrailingSlash'](_0x2c6204[_0x2c88('0x1f')]);_0x2c6204[_0x2c88('0x3f')]=intUtil[_0x2c88('0x3e')](_0x2c6204[_0x2c88('0x3f')]);if(_0xb0fa56&&_0xb0fa56['monitor_format']){logger['info']('['+_0x14478e[_0x2c88('0x56')][_0x2c88('0x57')]()+']',_0x2c88('0x41'));_0x14478e['recordingURL']=util[_0x2c88('0xd')](_0x2c88('0x43'),_0x2c6204['serverUrl'],_0x14478e['uniqueid'],md5(_0x14478e[_0x2c88('0x44')]));}else{_0x14478e['recordingURL']='';}headers[_0x2c88('0x45')]=getAuth(_0x2c6204);return getUser(_0x2c6204,'')[_0x2c88('0x1a')](function(_0x1f8120){_0x5038ff=_0x1f8120;logger['info']('The\x20User\x20ID\x20is:',_0x5038ff['id']);return getEndUser(_0x2c6204,_0x14478e[_0x2c88('0xf')],_0x14478e[_0x2c88('0x10')]);})[_0x2c88('0x1a')](function(_0x29274f){_0x11a3a4=_0x29274f;logger[_0x2c88('0x1b')](_0x2c88('0x47'),_0x11a3a4['id']);return getTicket(_0x2c6204,_0x5038ff,_0x11a3a4,_0x442ec9,_0x14478e);})[_0x2c88('0x1a')](function(_0x1a9324){if(_0x1a9324){logger[_0x2c88('0x1b')]('Ticket\x20created!');logger[_0x2c88('0x1b')](_0x2c88('0x48'),_0x1a9324['id']);}})[_0x2c88('0x4c')](function(_0x153c52){logger[_0x2c88('0x4d')]('['+_0x14478e['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x153c52));});}; \ No newline at end of file +var _0x9c24=['toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','localhost','socket.io-emitter','redis','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','custom_fields','value','format','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','contact','email','%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.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','length','map','forEach','string','nameField','toLowerCase','content','includes','picklist','type','idField','customField','variableName','push','Variable','name','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','error','unmanaged','stripTrailingSlash','lastevent'];(function(_0x2a5a16,_0x1dc1e4){var _0x10ecaa=function(_0x4d7707){while(--_0x4d7707){_0x2a5a16['push'](_0x2a5a16['shift']());}};_0x10ecaa(++_0x1dc1e4);}(_0x9c24,0x1ca));var _0x49c2=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x9c24[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x49c2('0x0'));var rp=require('request-promise');var md5=require(_0x49c2('0x1'));var util=require(_0x49c2('0x2'));var Redis=require('ioredis');var intUtil=require(_0x49c2('0x3'));var config=require(_0x49c2('0x4'));var logger=require(_0x49c2('0x5'))(_0x49c2('0x6'));config['redis']=_[_0x49c2('0x7')](config['redis'],{'host':_0x49c2('0x8'),'port':0x18eb});var io=require(_0x49c2('0x9'))(new Redis(config[_0x49c2('0xa')]));var headers={'Content-Type':_0x49c2('0xb'),'Accept':_0x49c2('0xb')};function emit(_0x4e07ad,_0x2cec8d,_0x2b2894){io['to'](_0x4e07ad)[_0x49c2('0xc')](_0x2cec8d,_0x2b2894);}function getTicket(_0x2aa191,_0x6db5a8,_0x55bd32,_0x4e0c6b,_0x23e58f){logger[_0x49c2('0xd')](_0x49c2('0xe'));var _0xdd2ed6=_['merge']({'responder_id':_0x6db5a8['id'],'requester_id':_0x55bd32['id'],'name':util['format'](_0x49c2('0xf'),_0x23e58f[_0x49c2('0x10')]),'phone':_0x23e58f[_0x49c2('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x49c2('0x12')](_0x4e0c6b[_0x49c2('0x13')],_0x23e58f,'\x20'),'description':intUtil[_0x49c2('0x12')](_0x4e0c6b[_0x49c2('0x14')],_0x23e58f,_0x49c2('0x15')),'tags':getTags(_0x4e0c6b[_0x49c2('0x16')],'name')},getCustomFields(_0x4e0c6b['Fields'],_0x23e58f));_0xdd2ed6[_0x49c2('0x17')]=_['mapValues'](_['keyBy'](_0xdd2ed6[_0x49c2('0x17')],'id'),_0x49c2('0x18'));return request({'uri':util[_0x49c2('0x19')]('%s/api/v2/tickets',_0x2aa191[_0x49c2('0x1a')]),'method':_0x49c2('0x1b'),'body':_0xdd2ed6})[_0x49c2('0x1c')](function(_0x488377){logger['info'](_0x49c2('0x1d'));return _0x488377;});}function getUser(_0x50a044,_0x42fb88){if(intUtil[_0x49c2('0x1e')](_0x42fb88)){return request({'uri':util[_0x49c2('0x19')](_0x49c2('0x1f'),_0x50a044['remoteUri']),'qs':{'email':_0x42fb88}})['then'](function(_0x359b08){if(_0x359b08['length']){logger[_0x49c2('0xd')](_0x49c2('0x20'));return _['find'](_0x359b08,function(_0x3cead5){return _0x3cead5[_0x49c2('0x21')][_0x49c2('0x22')]===_0x42fb88;});}else{logger[_0x49c2('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x49c2('0x19')](_0x49c2('0x23'),_0x50a044[_0x49c2('0x1a')])})[_0x49c2('0x1c')](function(_0x553965){logger[_0x49c2('0xd')](_0x49c2('0x24'));return _0x553965;});}});}else{logger[_0x49c2('0xd')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x49c2('0x23'),_0x50a044[_0x49c2('0x1a')])})[_0x49c2('0x1c')](function(_0x54ab75){logger[_0x49c2('0xd')](_0x49c2('0x24'));return _0x54ab75;});}}function getEndUser(_0x3d1c0f,_0x52abff,_0x4917b5){logger[_0x49c2('0xd')](_0x49c2('0x25'),_0x4917b5);return request({'uri':util['format'](_0x49c2('0x26'),_0x3d1c0f['remoteUri']),'qs':{'phone':_0x4917b5}})[_0x49c2('0x1c')](function(_0x3ad705){if(_0x3ad705['length']){logger[_0x49c2('0xd')]('Enduser\x20found!');return _['find'](_0x3ad705,{'phone':_0x4917b5});}else{logger[_0x49c2('0xd')](_0x49c2('0x27'));return request({'uri':util[_0x49c2('0x19')](_0x49c2('0x26'),_0x3d1c0f[_0x49c2('0x1a')]),'method':_0x49c2('0x1b'),'body':{'name':_0x52abff,'phone':_0x4917b5}})[_0x49c2('0x1c')](function(_0x2a856f){logger[_0x49c2('0xd')](_0x49c2('0x28'));return _0x2a856f;});}});}function getAuth(_0x1c2e46){return util[_0x49c2('0x19')](_0x49c2('0x29'),new Buffer(_0x1c2e46[_0x49c2('0x2a')]+':X')[_0x49c2('0x2b')](_0x49c2('0x2c')));}function request(_0x55cb2f){logger['debug'](_0x49c2('0x2d'),JSON[_0x49c2('0x2e')](_0x55cb2f));return rp(_[_0x49c2('0x7')](_0x55cb2f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x41054a,_0x3fc77b){var _0x449a77=[];if(_0x41054a&&_0x41054a[_0x49c2('0x2f')]>0x0){_0x449a77=_[_0x49c2('0x30')](_0x41054a,_0x3fc77b);}return _0x449a77;}function getCustomFields(_0x426f9b,_0x34275b){var _0x57806b=[];var _0x337a83={'custom_fields':[]};if(_0x426f9b['length']>0x0){_[_0x49c2('0x31')](_0x426f9b,function(_0x1dee17){if(_['includes']([_0x49c2('0x32'),'picklist'],_0x1dee17['type'])&&_0x1dee17[_0x49c2('0x33')]&&!_0x1dee17['customField']){_0x337a83[_0x1dee17[_0x49c2('0x33')][_0x49c2('0x34')]()]=_0x1dee17[_0x49c2('0x35')]['toString']();}else if(_[_0x49c2('0x36')]([_0x49c2('0x32'),_0x49c2('0x37')],_0x1dee17[_0x49c2('0x38')])&&_0x1dee17[_0x49c2('0x39')]&&_0x1dee17[_0x49c2('0x3a')]){_0x337a83[_0x49c2('0x17')]['push']({'id':_0x1dee17[_0x49c2('0x39')],'value':_0x1dee17['content'][_0x49c2('0x2b')]()});}else if(_0x1dee17['type']==='variable'&&_0x1dee17[_0x49c2('0x3b')]&&_0x1dee17[_0x49c2('0x39')]&&_0x1dee17[_0x49c2('0x3a')]){_0x34275b[_0x1dee17[_0x49c2('0x3b')]]&&_0x337a83[_0x49c2('0x17')][_0x49c2('0x3c')]({'id':_0x1dee17[_0x49c2('0x39')],'value':_0x34275b[_0x1dee17[_0x49c2('0x3b')]][_0x49c2('0x2b')]()});}else if(_0x1dee17[_0x49c2('0x38')]==='customVariable'&&_0x1dee17[_0x49c2('0x3d')]&&_0x1dee17[_0x49c2('0x3d')][_0x49c2('0x3e')]&&_0x1dee17[_0x49c2('0x39')]&&_0x1dee17[_0x49c2('0x3a')]){_0x34275b[_0x1dee17[_0x49c2('0x3d')]['name'][_0x49c2('0x34')]()]&&_0x337a83['custom_fields'][_0x49c2('0x3c')]({'id':_0x1dee17[_0x49c2('0x39')],'value':_0x34275b[_0x1dee17[_0x49c2('0x3d')][_0x49c2('0x3e')][_0x49c2('0x34')]()][_0x49c2('0x2b')]()});}});}return _0x337a83;}exports[_0x49c2('0x3f')]=function(_0x1af7de,_0x34a644,_0x188f71,_0x2048d8,_0x328fbd,_0x1cc112){var _0x2697f6,_0x1ed67b;_0x1cc112[_0x49c2('0x1a')]=intUtil['stripTrailingSlash'](_0x1cc112['remoteUri']);_0x1cc112[_0x49c2('0x40')]=intUtil['stripTrailingSlash'](_0x1cc112[_0x49c2('0x40')]);if(_0x328fbd&&_0x328fbd[_0x49c2('0x41')]){logger[_0x49c2('0xd')](_0x49c2('0x42'),'Recording\x20is\x20enabled!');_0x34a644[_0x49c2('0x43')]=util[_0x49c2('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1cc112['serverUrl'],_0x34a644[_0x49c2('0x44')],md5(_0x34a644[_0x49c2('0x44')]));}else{_0x34a644[_0x49c2('0x43')]='';}headers[_0x49c2('0x45')]=getAuth(_0x1cc112);return getUser(_0x1cc112,_0x2048d8[_0x49c2('0x22')])[_0x49c2('0x1c')](function(_0x33a3c4){_0x2697f6=_0x33a3c4;logger[_0x49c2('0xd')]('The\x20User\x20ID\x20is:',_0x2697f6['id']);return getEndUser(_0x1cc112,_0x34a644[_0x49c2('0x10')],_0x34a644[_0x49c2('0x11')]);})['then'](function(_0x1c01e0){_0x1ed67b=_0x1c01e0;logger[_0x49c2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1ed67b['id']);return getTicket(_0x1cc112,_0x2697f6,_0x1ed67b,_0x188f71,_0x34a644);})['then'](function(_0x166288){if(_0x166288&&_0x166288['id']){logger[_0x49c2('0xd')](_0x49c2('0x1d'));logger['info'](_0x49c2('0x46'),_0x166288['id']);logger[_0x49c2('0xd')]('[QUEUE]',_0x49c2('0x47'));emit(util[_0x49c2('0x19')](_0x49c2('0x48'),_0x2048d8['name']),_0x49c2('0x49'),{'uri':util[_0x49c2('0x19')](_0x49c2('0x4a'),_0x1cc112[_0x49c2('0x1a')],_0x166288['id'])});}})[_0x49c2('0x4b')](function(_0x3de123){logger['error'](_0x49c2('0x42'),JSON[_0x49c2('0x2e')](_0x3de123));});};exports[_0x49c2('0x4c')]=function(_0x3d346e,_0x13a3a0,_0x279549,_0x4dfca4,_0x1840b6,_0x54564b,_0x496e3a){var _0x2e5e18,_0x1249cf;_0x54564b['remoteUri']=intUtil['stripTrailingSlash'](_0x54564b[_0x49c2('0x1a')]);_0x54564b[_0x49c2('0x40')]=intUtil['stripTrailingSlash'](_0x54564b['serverUrl']);if(_0x496e3a&&_0x496e3a[_0x49c2('0x4d')]&&_0x496e3a['recordingFormat']!==_0x49c2('0x4e')){logger[_0x49c2('0xd')](_0x49c2('0x4f'),_0x49c2('0x50'));_0x13a3a0[_0x49c2('0x43')]=util[_0x49c2('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54564b['serverUrl'],_0x13a3a0['uniqueid'],md5(_0x13a3a0[_0x49c2('0x44')]));}headers['Authorization']=getAuth(_0x54564b);return getUser(_0x54564b,_0x4dfca4[_0x49c2('0x22')])['then'](function(_0x17cdb1){_0x2e5e18=_0x17cdb1;logger['info']('The\x20User\x20ID\x20is:',_0x2e5e18['id']);return getEndUser(_0x54564b,_0x13a3a0[_0x49c2('0x51')],_0x13a3a0[_0x49c2('0x52')]);})[_0x49c2('0x1c')](function(_0x9427b2){_0x1249cf=_0x9427b2;logger[_0x49c2('0xd')](_0x49c2('0x53'),_0x1249cf['id']);return getTicket(_0x54564b,_0x2e5e18,_0x1249cf,_0x279549,_0x13a3a0);})['then'](function(_0x35558a){if(_0x35558a&&_0x35558a['id']){logger[_0x49c2('0xd')](_0x49c2('0x1d'));logger[_0x49c2('0xd')]('The\x20Ticket\x20ID\x20is:',_0x35558a['id']);logger[_0x49c2('0xd')]('[OUTBOUND]',_0x49c2('0x47'));emit(util[_0x49c2('0x19')](_0x49c2('0x48'),_0x4dfca4[_0x49c2('0x3e')]),_0x49c2('0x49'),{'uri':util[_0x49c2('0x19')](_0x49c2('0x4a'),_0x54564b['remoteUri'],_0x35558a['id'])});}})['catch'](function(_0x2ec9e6){logger[_0x49c2('0x54')](_0x49c2('0x4f'),JSON[_0x49c2('0x2e')](_0x2ec9e6));});};exports[_0x49c2('0x55')]=function(_0x11dde7,_0xcdfac,_0x2b3a31,_0x2ab712,_0x26a356,_0x32e8c4){var _0x471f8c,_0x304ca4;_0x32e8c4[_0x49c2('0x1a')]=intUtil[_0x49c2('0x56')](_0x32e8c4[_0x49c2('0x1a')]);_0x32e8c4[_0x49c2('0x40')]=intUtil['stripTrailingSlash'](_0x32e8c4[_0x49c2('0x40')]);if(_0x26a356&&_0x26a356['monitor_format']){logger['info']('['+_0xcdfac[_0x49c2('0x57')][_0x49c2('0x58')]()+']','Recording\x20is\x20enabled!');_0xcdfac[_0x49c2('0x43')]=util[_0x49c2('0x19')](_0x49c2('0x59'),_0x32e8c4[_0x49c2('0x40')],_0xcdfac[_0x49c2('0x44')],md5(_0xcdfac[_0x49c2('0x44')]));}else{_0xcdfac[_0x49c2('0x43')]='';}headers['Authorization']=getAuth(_0x32e8c4);return getUser(_0x32e8c4,'')[_0x49c2('0x1c')](function(_0x1c1dd3){_0x471f8c=_0x1c1dd3;logger[_0x49c2('0xd')](_0x49c2('0x5a'),_0x471f8c['id']);return getEndUser(_0x32e8c4,_0xcdfac[_0x49c2('0x10')],_0xcdfac['calleridnum']);})[_0x49c2('0x1c')](function(_0x12a5bf){_0x304ca4=_0x12a5bf;logger[_0x49c2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x304ca4['id']);return getTicket(_0x32e8c4,_0x471f8c,_0x304ca4,_0x2b3a31,_0xcdfac);})[_0x49c2('0x1c')](function(_0x239d1c){if(_0x239d1c){logger[_0x49c2('0xd')](_0x49c2('0x1d'));logger[_0x49c2('0xd')](_0x49c2('0x46'),_0x239d1c['id']);}})[_0x49c2('0x4b')](function(_0x97d45a){logger['error']('['+_0xcdfac[_0x49c2('0x57')][_0x49c2('0x58')]()+']',JSON['stringify'](_0x97d45a));});}; \ 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 b0d040c..e4f7800 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 _0x0cd2=['adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','userId','Admin\x20selected','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','error','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','./util','../../../../config/environment','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','length'];(function(_0x15c8e0,_0x332c04){var _0xcf223b=function(_0x1dbadb){while(--_0x1dbadb){_0x15c8e0['push'](_0x15c8e0['shift']());}};_0xcf223b(++_0x332c04);}(_0x0cd2,0x18d));var _0x20cd=function(_0x242fd5,_0xfdc4e){_0x242fd5=_0x242fd5-0x0;var _0x440d39=_0x0cd2[_0x242fd5];return _0x440d39;};'use strict';var _=require(_0x20cd('0x0'));var rp=require(_0x20cd('0x1'));var md5=require(_0x20cd('0x2'));var util=require('util');var moment=require(_0x20cd('0x3'));var Promise=require(_0x20cd('0x4'));var Redis=require('ioredis');var intUtil=require(_0x20cd('0x5'));var config=require(_0x20cd('0x6'));var logger=require('../../../../config/logger')(_0x20cd('0x7'));config['redis']=_['defaults'](config[_0x20cd('0x8')],{'host':_0x20cd('0x9'),'port':0x18eb});var io=require(_0x20cd('0xa'))(new Redis(config['redis']));function getAdminId(_0x400b4d,_0x50be65,_0x243a5d,_0x126b11){return new Promise(function(_0x40f8f3,_0x5d1de0){var _0xdc748f=![];var _0x1373e7={'method':_0x20cd('0xb'),'uri':_0x126b11+_0x20cd('0xc'),'json':!![]};_0x1373e7[_0x20cd('0xd')]=_0x243a5d;logger[_0x20cd('0xe')]('Getting\x20admin\x20information');return rp(_0x1373e7)[_0x20cd('0xf')](function(_0x4f1edf){if(_0x4f1edf){var _0x4cab8e=_0x4f1edf[_0x20cd('0x10')];var _0x4f9e3e=null;for(_0x4f9e3e=0x0;_0x4f9e3e<_0x4cab8e[_0x20cd('0x11')];_0x4f9e3e++){if(_0x4cab8e[_0x4f9e3e]['email']===_0x400b4d[_0x20cd('0x12')]){_0x400b4d[_0x20cd('0x13')]=_0x4cab8e[_0x4f9e3e]['id'];_0xdc748f=!![];}}if(_0xdc748f){logger[_0x20cd('0xe')](_0x20cd('0x14'),_0x400b4d[_0x20cd('0x13')]);_0x40f8f3(_0x400b4d);}else{_0x5d1de0({'statusCode':0x194,'message':_0x20cd('0x15')});}}else{_0x5d1de0({'statusCode':0x194,'message':_0x20cd('0x15')});}})[_0x20cd('0x16')](function(_0x5c5cbe){logger['error']('['+[_0x50be65[_0x20cd('0x17')]()]+']',_0x5c5cbe[_0x20cd('0x18')]);_0x5d1de0(_0x5c5cbe);});});}function getUser(_0x327137,_0x24a90f,_0x436f2d){return function(_0x2c496f){return new Promise(function(_0x23473e,_0x3cb1f4){var _0x3bb244={'method':'GET','uri':_0x436f2d+_0x20cd('0xc'),'json':!![]};_0x3bb244[_0x20cd('0xd')]=_0x24a90f;logger[_0x20cd('0xe')](_0x20cd('0x19'));return rp(_0x3bb244)[_0x20cd('0xf')](function(_0x31c695){if(_0x31c695){var _0x384740=_0x31c695[_0x20cd('0x10')];var _0x49b527=![];var _0x3cb4d4=null;if(_0x2c496f[_0x20cd('0x1a')]!==null){logger[_0x20cd('0xe')]('Getting\x20user\x20with\x20email',_0x2c496f['agentEmail']);_0x2c496f[_0x20cd('0x1b')]=_0x2c496f[_0x20cd('0x1a')];for(_0x3cb4d4=0x0;_0x3cb4d4<_0x384740[_0x20cd('0x11')];_0x3cb4d4++){if(_0x384740[_0x3cb4d4]['email']===_0x2c496f[_0x20cd('0x1a')]){_0x49b527=!![];_0x2c496f[_0x20cd('0x1c')]=_0x384740[_0x3cb4d4]['id'];logger['info']('User\x20found:',_0x2c496f[_0x20cd('0x1c')]);}}}if(!_0x49b527){logger['info'](_0x20cd('0x1d'));_0x2c496f[_0x20cd('0x1b')]=_0x2c496f[_0x20cd('0x12')];_0x2c496f['userId']=_0x2c496f[_0x20cd('0x13')];_0x49b527=!![];}if(_0x49b527){_0x23473e(_0x2c496f);}else{_0x3cb1f4({'statusCode':0x194,'message':_0x20cd('0x15')});}}else{_0x3cb1f4({'statusCode':0x194,'message':_0x20cd('0x15')});}})[_0x20cd('0x16')](function(_0x4c7fb8){logger['error']('['+[_0x327137['toUpperCase']()]+']',_0x4c7fb8[_0x20cd('0x18')]);_0x3cb1f4(_0x4c7fb8);});});};}function searchContact(_0x443a3c,_0x43e753,_0x52aa34,_0x2e36b2){return new Promise(function(_0x4833ad,_0x56b534){var _0x2dc571={'method':_0x20cd('0xb'),'headers':_0x43e753,'uri':_0x443a3c+_0x20cd('0x1e')+_0x2e36b2+_0x20cd('0x1f')+_0x52aa34+'&entities=contact','json':!![]};rp(_0x2dc571)[_0x20cd('0xf')](function(_0xa22254){var _0x10b98=_[_0x20cd('0x20')](_0xa22254['contacts'][_0x20cd('0x21')],[_0x52aa34,_0x2e36b2]);_0x4833ad(_0x10b98);})[_0x20cd('0x16')](function(_0x5e0af4){_0x56b534(_0x5e0af4);});});}function getEndUser(_0x41ed97,_0x69194,_0x1512b8){return function(_0x598b53){return new Promise(function(_0x2d5ac3,_0x69b789){logger[_0x20cd('0xe')](util[_0x20cd('0x22')](_0x20cd('0x23'),_0x598b53[_0x20cd('0x24')]));searchContact(_0x1512b8,_0x69194,_0x20cd('0x25'),_0x598b53[_0x20cd('0x24')])[_0x20cd('0xf')](function(_0x1cbd87){if(_0x1cbd87){_0x598b53[_0x20cd('0x26')]=_0x1cbd87['id'];logger[_0x20cd('0xe')]('Contact\x20found\x20mobile_number:',_0x598b53[_0x20cd('0x26')]);return _0x2d5ac3(_0x598b53);}searchContact(_0x1512b8,_0x69194,_0x20cd('0x27'),_0x598b53[_0x20cd('0x24')])['then'](function(_0x4aadaa){if(_0x4aadaa){_0x598b53[_0x20cd('0x26')]=_0x4aadaa['id'];logger[_0x20cd('0xe')](_0x20cd('0x28'),_0x598b53[_0x20cd('0x26')]);return _0x2d5ac3(_0x598b53);}createEndUser(_0x598b53,_0x41ed97,_0x69194,_0x1512b8)[_0x20cd('0xf')](function(_0x4caa29){logger['info']('Contact\x20created:',_0x4caa29[_0x20cd('0x26')]);return _0x2d5ac3(_0x4caa29);});});})[_0x20cd('0x16')](function(_0x392455){_0x69b789(_0x392455);});});};}function createEndUser(_0x665016,_0x1639b0,_0x421e11,_0x4bbdcf){return new Promise(function(_0x4428b4,_0x49cf3a){var _0x57a76=moment();var _0x95ccc8={'method':_0x20cd('0x29'),'uri':_0x4bbdcf+_0x20cd('0x2a'),'body':{'contact':{'last_name':_0x665016['contactNumber'],'work_number':_0x665016[_0x20cd('0x24')],'mobile_number':_0x665016[_0x20cd('0x24')],'owner_id':_0x665016['userId'],'created_at':_0x57a76[_0x20cd('0x22')](_0x20cd('0x2b'))}},'json':!![]};_0x95ccc8['headers']=_0x421e11;logger[_0x20cd('0xe')](_0x20cd('0x2c'));return rp(_0x95ccc8)[_0x20cd('0xf')](function(_0x4efd65){_0x665016[_0x20cd('0x26')]=_0x4efd65[_0x20cd('0x2d')]['id'];_0x4428b4(_0x665016);})[_0x20cd('0x16')](function(_0x496995){logger[_0x20cd('0x2e')]('['+[_0x1639b0[_0x20cd('0x17')]()]+']',_0x496995[_0x20cd('0x18')]);_0x49cf3a(_0x496995[_0x20cd('0x18')]);});});}function getTicket(_0xd92697,_0x2a620d,_0x50b60b,_0xf37fd,_0x2bca9a){return function(_0x444ed9){logger[_0x20cd('0xe')](_0x20cd('0x2f'));return new Promise(function(_0x57a43e,_0x27a107){var _0x184856=moment();var _0x38d0ff={'method':_0x20cd('0x29'),'uri':_0x50b60b+_0x20cd('0x30'),'body':{'title':intUtil[_0x20cd('0x31')](_0xf37fd[_0x20cd('0x32')],_0x2bca9a,'\x20'),'description':intUtil[_0x20cd('0x31')](_0xf37fd['Descriptions'],_0x2bca9a,'\x0a'),'owner_id':_0x444ed9[_0x20cd('0x1c')],'creater_id':_0x444ed9[_0x20cd('0x13')],'targetable_id':_0x444ed9[_0x20cd('0x26')],'targetable_type':_0x20cd('0x33'),'created_at':_0x184856['format'](_0x20cd('0x2b')),'due_date':_0x184856[_0x20cd('0x34')](0x1e,'m')[_0x20cd('0x22')](_0x20cd('0x2b'))},'json':!![]};_0x38d0ff[_0x20cd('0xd')]=_0x2a620d;return rp(_0x38d0ff)[_0x20cd('0xf')](function(_0x2076d3){_0x444ed9[_0x20cd('0x35')]=_0x2076d3['task']['id'];logger[_0x20cd('0xe')](_0x20cd('0x36'),_0x444ed9[_0x20cd('0x35')]);_0x57a43e(_0x444ed9);})['catch'](function(_0x20c6a5){logger[_0x20cd('0x2e')]('['+[_0xd92697[_0x20cd('0x17')]()]+']',_0x20c6a5[_0x20cd('0x18')]);_0x27a107(_0x20c6a5[_0x20cd('0x18')]);});});};}function emit(_0x19d206,_0x3e1602,_0x200471){var _0x4fe847={'uri':_0x19d206+_0x20cd('0x37')+_0x200471};io['to'](util[_0x20cd('0x22')](_0x20cd('0x38'),_0x3e1602))[_0x20cd('0x39')](_0x20cd('0x3a'),_0x4fe847);}exports['cs']=function(_0x54ff57,_0x273165,_0x97996e,_0x26ef8c,_0x5a33d4,_0x5ae417,_0x579700,_0x55d615){var _0x16d9ba={};var _0x21f137={'Authorization':_0x20cd('0x3b')+_0x5ae417[_0x20cd('0x3c')]};_0x5ae417[_0x20cd('0x3d')]=intUtil['stripTrailingSlash'](_0x5ae417[_0x20cd('0x3d')]);_0x5ae417[_0x20cd('0x3e')]=intUtil['stripTrailingSlash'](_0x5ae417[_0x20cd('0x3e')]);var _0x131cc9=_0x5ae417[_0x20cd('0x3d')];_0x16d9ba[_0x20cd('0x12')]=_0x5ae417[_0x20cd('0x3f')];_0x16d9ba[_0x20cd('0x24')]=_0x55d615[_0x20cd('0x40')]()===_0x20cd('0x41')?_0x273165[_0x20cd('0x42')]:_0x273165[_0x20cd('0x43')];_0x16d9ba[_0x20cd('0x44')]=_0x55d615==='queue'||_0x55d615===_0x20cd('0x45')?_0x20cd('0x46'):'outbound';if(_0x26ef8c){_0x16d9ba[_0x20cd('0x1a')]=_0x26ef8c[_0x20cd('0x47')];}var _0x3a19ed=util[_0x20cd('0x22')](_0x20cd('0x48'),_0x5ae417[_0x20cd('0x3e')],_0x273165[_0x20cd('0x49')],md5(_0x273165['uniqueid']));if(_0x5a33d4&&_0x5a33d4[_0x20cd('0x4a')]){logger[_0x20cd('0xe')](_0x20cd('0x4b'),'Recording\x20is\x20enabled!');_0x273165['recordingURL']=_0x3a19ed;}else if(_0x579700&&_0x579700['recordingFormat']&&_0x579700[_0x20cd('0x4c')]!==_0x20cd('0x4d')){logger[_0x20cd('0xe')]('[OUTBOUND]',_0x20cd('0x4e'));_0x273165[_0x20cd('0x4f')]=_0x3a19ed;}else{_0x273165[_0x20cd('0x4f')]='';}return getAdminId(_0x16d9ba,_0x55d615,_0x21f137,_0x131cc9)[_0x20cd('0xf')](getUser(_0x55d615,_0x21f137,_0x131cc9))[_0x20cd('0xf')](getEndUser(_0x55d615,_0x21f137,_0x131cc9))[_0x20cd('0xf')](getTicket(_0x55d615,_0x21f137,_0x131cc9,_0x97996e,_0x273165))['then'](function(_0x19fba3){logger[_0x20cd('0xe')](util[_0x20cd('0x22')]('The\x20ticket\x20ID\x20is:\x20%s',_0x19fba3[_0x20cd('0x35')]));if(_0x55d615!==_0x20cd('0x45')){logger['info']('['+[_0x55d615[_0x20cd('0x17')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x131cc9,_0x26ef8c[_0x20cd('0x50')],_0x19fba3[_0x20cd('0x26')]);}})['catch'](function(_0x2e3297){logger['error']('['+[_0x55d615[_0x20cd('0x17')]()]+_0x20cd('0x51'),util[_0x20cd('0x52')](_0x2e3297,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd79c=['./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','error','toUpperCase','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','user:%s','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis'];(function(_0x34edec,_0x228935){var _0x2d276d=function(_0x1e1888){while(--_0x1e1888){_0x34edec['push'](_0x34edec['shift']());}};_0x2d276d(++_0x228935);}(_0xd79c,0xee));var _0xcd79=function(_0x2c6249,_0x4fc5d1){_0x2c6249=_0x2c6249-0x0;var _0x2eae85=_0xd79c[_0x2c6249];return _0x2eae85;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xcd79('0x0'));var util=require(_0xcd79('0x1'));var moment=require(_0xcd79('0x2'));var Promise=require(_0xcd79('0x3'));var Redis=require(_0xcd79('0x4'));var intUtil=require(_0xcd79('0x5'));var config=require(_0xcd79('0x6'));var logger=require(_0xcd79('0x7'))('freshsales');config['redis']=_[_0xcd79('0x8')](config['redis'],{'host':_0xcd79('0x9'),'port':0x18eb});var io=require(_0xcd79('0xa'))(new Redis(config[_0xcd79('0xb')]));function getAdminId(_0x226a7f,_0x3b00fa,_0x29ead1,_0x27652a){return new Promise(function(_0x2012bf,_0x5a2c63){var _0x3de8b0=![];var _0x412dca={'method':_0xcd79('0xc'),'uri':_0x27652a+_0xcd79('0xd'),'json':!![]};_0x412dca[_0xcd79('0xe')]=_0x29ead1;logger[_0xcd79('0xf')]('Getting\x20admin\x20information');return rp(_0x412dca)['then'](function(_0x58c18a){if(_0x58c18a){var _0x137056=_0x58c18a[_0xcd79('0x10')];var _0x10202b=null;for(_0x10202b=0x0;_0x10202b<_0x137056['length'];_0x10202b++){if(_0x137056[_0x10202b][_0xcd79('0x11')]===_0x226a7f[_0xcd79('0x12')]){_0x226a7f[_0xcd79('0x13')]=_0x137056[_0x10202b]['id'];_0x3de8b0=!![];}}if(_0x3de8b0){logger[_0xcd79('0xf')](_0xcd79('0x14'),_0x226a7f['adminId']);_0x2012bf(_0x226a7f);}else{_0x5a2c63({'statusCode':0x194,'message':_0xcd79('0x15')});}}else{_0x5a2c63({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xcd79('0x16')](function(_0x1aeba2){logger['error']('['+[_0x3b00fa['toUpperCase']()]+']',_0x1aeba2[_0xcd79('0x17')]);_0x5a2c63(_0x1aeba2);});});}function getUser(_0x40f2ac,_0x6b75dd,_0x3968f5){return function(_0x4945d0){return new Promise(function(_0x49b053,_0xc7d174){var _0x2258ff={'method':_0xcd79('0xc'),'uri':_0x3968f5+_0xcd79('0xd'),'json':!![]};_0x2258ff[_0xcd79('0xe')]=_0x6b75dd;logger['info'](_0xcd79('0x18'));return rp(_0x2258ff)[_0xcd79('0x19')](function(_0x51c64a){if(_0x51c64a){var _0x5e0bff=_0x51c64a[_0xcd79('0x10')];var _0x1a280f=![];var _0x24edcc=null;if(_0x4945d0[_0xcd79('0x1a')]!==null){logger['info'](_0xcd79('0x1b'),_0x4945d0[_0xcd79('0x1a')]);_0x4945d0[_0xcd79('0x1c')]=_0x4945d0[_0xcd79('0x1a')];for(_0x24edcc=0x0;_0x24edcc<_0x5e0bff[_0xcd79('0x1d')];_0x24edcc++){if(_0x5e0bff[_0x24edcc][_0xcd79('0x11')]===_0x4945d0[_0xcd79('0x1a')]){_0x1a280f=!![];_0x4945d0['userId']=_0x5e0bff[_0x24edcc]['id'];logger[_0xcd79('0xf')](_0xcd79('0x1e'),_0x4945d0[_0xcd79('0x1f')]);}}}if(!_0x1a280f){logger[_0xcd79('0xf')]('Admin\x20selected');_0x4945d0[_0xcd79('0x1c')]=_0x4945d0[_0xcd79('0x12')];_0x4945d0[_0xcd79('0x1f')]=_0x4945d0[_0xcd79('0x13')];_0x1a280f=!![];}if(_0x1a280f){_0x49b053(_0x4945d0);}else{_0xc7d174({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xc7d174({'statusCode':0x194,'message':_0xcd79('0x15')});}})['catch'](function(_0x57f887){logger[_0xcd79('0x20')]('['+[_0x40f2ac[_0xcd79('0x21')]()]+']',_0x57f887[_0xcd79('0x17')]);_0xc7d174(_0x57f887);});});};}function searchContact(_0x519f7b,_0x3c9615,_0x91067d,_0x3f7807){return new Promise(function(_0x34c120,_0x26e4ad){var _0xd7b9a8={'method':_0xcd79('0xc'),'headers':_0x3c9615,'uri':_0x519f7b+_0xcd79('0x22')+_0x3f7807+'&f='+_0x91067d+_0xcd79('0x23'),'json':!![]};rp(_0xd7b9a8)[_0xcd79('0x19')](function(_0x173db4){var _0x4ff156=_[_0xcd79('0x24')](_0x173db4[_0xcd79('0x25')][_0xcd79('0x25')],[_0x91067d,_0x3f7807]);_0x34c120(_0x4ff156);})[_0xcd79('0x16')](function(_0x2864a1){_0x26e4ad(_0x2864a1);});});}function getEndUser(_0x1397f7,_0x59699b,_0x21ee85){return function(_0x3ff30c){return new Promise(function(_0x29ac6a,_0x141cfc){logger[_0xcd79('0xf')](util[_0xcd79('0x26')](_0xcd79('0x27'),_0x3ff30c[_0xcd79('0x28')]));searchContact(_0x21ee85,_0x59699b,_0xcd79('0x29'),_0x3ff30c[_0xcd79('0x28')])[_0xcd79('0x19')](function(_0x4c9d6d){if(_0x4c9d6d){_0x3ff30c[_0xcd79('0x2a')]=_0x4c9d6d['id'];logger[_0xcd79('0xf')](_0xcd79('0x2b'),_0x3ff30c[_0xcd79('0x2a')]);return _0x29ac6a(_0x3ff30c);}searchContact(_0x21ee85,_0x59699b,_0xcd79('0x2c'),_0x3ff30c[_0xcd79('0x28')])['then'](function(_0x596680){if(_0x596680){_0x3ff30c['endUserId']=_0x596680['id'];logger[_0xcd79('0xf')]('Contact\x20found\x20work_number:',_0x3ff30c[_0xcd79('0x2a')]);return _0x29ac6a(_0x3ff30c);}createEndUser(_0x3ff30c,_0x1397f7,_0x59699b,_0x21ee85)[_0xcd79('0x19')](function(_0xec62f1){logger['info'](_0xcd79('0x2d'),_0xec62f1[_0xcd79('0x2a')]);return _0x29ac6a(_0xec62f1);});});})['catch'](function(_0x1ac174){_0x141cfc(_0x1ac174);});});};}function createEndUser(_0xdf0377,_0x42fe96,_0x631ab7,_0x3727cd){return new Promise(function(_0xa00da6,_0x255645){var _0x4b4d7d=moment();var _0x1cc761={'method':_0xcd79('0x2e'),'uri':_0x3727cd+_0xcd79('0x2f'),'body':{'contact':{'last_name':_0xdf0377['contactNumber'],'work_number':_0xdf0377[_0xcd79('0x28')],'mobile_number':_0xdf0377[_0xcd79('0x28')],'owner_id':_0xdf0377[_0xcd79('0x1f')],'created_at':_0x4b4d7d[_0xcd79('0x26')](_0xcd79('0x30'))}},'json':!![]};_0x1cc761[_0xcd79('0xe')]=_0x631ab7;logger['info'](_0xcd79('0x31'));return rp(_0x1cc761)['then'](function(_0x22f4aa){_0xdf0377['endUserId']=_0x22f4aa[_0xcd79('0x32')]['id'];_0xa00da6(_0xdf0377);})['catch'](function(_0x411803){logger[_0xcd79('0x20')]('['+[_0x42fe96['toUpperCase']()]+']',_0x411803[_0xcd79('0x17')]);_0x255645(_0x411803[_0xcd79('0x17')]);});});}function getTicket(_0x1a4168,_0x49a7d4,_0xd47d7b,_0x41a774,_0x359931){return function(_0x146683){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x111089,_0x1b0294){var _0x2075da=moment();var _0x1ed2fb={'method':_0xcd79('0x2e'),'uri':_0xd47d7b+'/api/tasks','body':{'title':intUtil[_0xcd79('0x33')](_0x41a774[_0xcd79('0x34')],_0x359931,'\x20'),'description':intUtil[_0xcd79('0x33')](_0x41a774[_0xcd79('0x35')],_0x359931,'\x0a'),'owner_id':_0x146683[_0xcd79('0x1f')],'creater_id':_0x146683[_0xcd79('0x13')],'targetable_id':_0x146683[_0xcd79('0x2a')],'targetable_type':_0xcd79('0x36'),'created_at':_0x2075da[_0xcd79('0x26')](_0xcd79('0x30')),'due_date':_0x2075da[_0xcd79('0x37')](0x1e,'m')[_0xcd79('0x26')](_0xcd79('0x30'))},'json':!![]};_0x1ed2fb[_0xcd79('0xe')]=_0x49a7d4;return rp(_0x1ed2fb)[_0xcd79('0x19')](function(_0x5cef7a){_0x146683['ticketId']=_0x5cef7a['task']['id'];logger[_0xcd79('0xf')](_0xcd79('0x38'),_0x146683[_0xcd79('0x39')]);_0x111089(_0x146683);})['catch'](function(_0xce4ab8){logger[_0xcd79('0x20')]('['+[_0x1a4168[_0xcd79('0x21')]()]+']',_0xce4ab8[_0xcd79('0x17')]);_0x1b0294(_0xce4ab8['message']);});});};}function emit(_0x23c028,_0x43b155,_0x3c0c1d){var _0x3bdfa7={'uri':_0x23c028+'/contacts/'+_0x3c0c1d};io['to'](util[_0xcd79('0x26')](_0xcd79('0x3a'),_0x43b155))['emit']('trigger:browser:url',_0x3bdfa7);}exports['cs']=function(_0x4b4f36,_0x32f642,_0x5b0679,_0x35fa5,_0x14577f,_0x1bba6b,_0x100f42,_0xcdda18){var _0x4f390f={};var _0x539f96={'Authorization':_0xcd79('0x3b')+_0x1bba6b['apiKey']};_0x1bba6b[_0xcd79('0x3c')]=intUtil[_0xcd79('0x3d')](_0x1bba6b['remoteUri']);_0x1bba6b[_0xcd79('0x3e')]=intUtil['stripTrailingSlash'](_0x1bba6b[_0xcd79('0x3e')]);var _0x5e251c=_0x1bba6b[_0xcd79('0x3c')];_0x4f390f[_0xcd79('0x12')]=_0x1bba6b[_0xcd79('0x3f')];_0x4f390f['contactNumber']=_0xcdda18[_0xcd79('0x40')]()===_0xcd79('0x41')?_0x32f642['destcalleridnum']:_0x32f642[_0xcd79('0x42')];_0x4f390f[_0xcd79('0x43')]=_0xcdda18===_0xcd79('0x44')||_0xcdda18===_0xcd79('0x45')?_0xcd79('0x44'):_0xcd79('0x41');if(_0x35fa5){_0x4f390f['agentEmail']=_0x35fa5[_0xcd79('0x11')];}var _0x2bee61=util[_0xcd79('0x26')](_0xcd79('0x46'),_0x1bba6b[_0xcd79('0x3e')],_0x32f642[_0xcd79('0x47')],md5(_0x32f642['uniqueid']));if(_0x14577f&&_0x14577f['monitor_format']){logger['info'](_0xcd79('0x48'),_0xcd79('0x49'));_0x32f642['recordingURL']=_0x2bee61;}else if(_0x100f42&&_0x100f42[_0xcd79('0x4a')]&&_0x100f42[_0xcd79('0x4a')]!==_0xcd79('0x4b')){logger[_0xcd79('0xf')](_0xcd79('0x4c'),_0xcd79('0x49'));_0x32f642[_0xcd79('0x4d')]=_0x2bee61;}else{_0x32f642[_0xcd79('0x4d')]='';}return getAdminId(_0x4f390f,_0xcdda18,_0x539f96,_0x5e251c)[_0xcd79('0x19')](getUser(_0xcdda18,_0x539f96,_0x5e251c))[_0xcd79('0x19')](getEndUser(_0xcdda18,_0x539f96,_0x5e251c))[_0xcd79('0x19')](getTicket(_0xcdda18,_0x539f96,_0x5e251c,_0x5b0679,_0x32f642))[_0xcd79('0x19')](function(_0x3133d9){logger[_0xcd79('0xf')](util[_0xcd79('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3133d9[_0xcd79('0x39')]));if(_0xcdda18!==_0xcd79('0x45')){logger['info']('['+[_0xcdda18[_0xcd79('0x21')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x5e251c,_0x35fa5[_0xcd79('0x4e')],_0x3133d9['endUserId']);}})[_0xcd79('0x16')](function(_0x66ede0){logger[_0xcd79('0x20')]('['+[_0xcdda18[_0xcd79('0x21')]()]+_0xcd79('0x4f'),util[_0xcd79('0x50')](_0x66ede0,{'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 4b19d70..15eaaa8 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 _0x3083=['freshsales','servicenow','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','data1','salesforce','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./dynamics365','./freshsales','zendesk','freshdesk','zoho','desk','vtiger'];(function(_0x5ab743,_0x825c78){var _0x4d9a5d=function(_0x3ea33e){while(--_0x3ea33e){_0x5ab743['push'](_0x5ab743['shift']());}};_0x4d9a5d(++_0x825c78);}(_0x3083,0x136));var _0x3308=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x3083[_0x2431d6];return _0x4d0f9b;};'use strict';var _=require(_0x3308('0x0'));var util=require(_0x3308('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x3308('0x2'));var sugarcrm=require(_0x3308('0x3'));var freshdesk=require(_0x3308('0x4'));var zoho=require('./zoho');var desk=require(_0x3308('0x5'));var vtiger=require(_0x3308('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x3308('0x7'));var freshsales=require(_0x3308('0x8'));var integrations=[_0x3308('0x9'),'salesforce','sugarcrm',_0x3308('0xa'),_0x3308('0xb'),_0x3308('0xc'),_0x3308('0xd'),'dynamics365',_0x3308('0xe'),_0x3308('0xf')];exports['exec']=function(_0xd1e8ef,_0x25b614,_0x25d8a0,_0x505404,_0x1d19ca,_0x455652){if(_0x25d8a0){if(_['includes'](integrations,_0xd1e8ef['data1'][_0x3308('0x10')]())){try{var _0x19150e=null;var _0x4750e4='';var _0x527d5c=_0x25d8a0[_0xd1e8ef['data1'][_0x3308('0x10')]()];if(_0x527d5c){var _0x307721=_0x527d5c[_0xd1e8ef[_0x3308('0x11')]];if(_0x307721){var _0x263d4c=_[_0x3308('0x12')](_0x307721[_0x3308('0x13')],{'id':parseInt(_0xd1e8ef[_0x3308('0x14')],0xa)});if(_0x263d4c){if(_0x505404){if(_0x1d19ca&&_0x25b614[_0x3308('0x15')]){_0x4750e4=_0x3308('0x15');}else if(_0x25b614[_0x3308('0x16')]){_0x4750e4=_0x3308('0x17');}else{console[_0x3308('0x18')](_0x3308('0x19'),_0x25b614);}}else{_0x4750e4=_0x3308('0x1a');}switch(_0xd1e8ef[_0x3308('0x1b')][_0x3308('0x10')]()){case _0x3308('0x9'):zendesk[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case _0x3308('0x1c'):salesforce[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case'sugarcrm':sugarcrm[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case _0x3308('0xa'):freshdesk[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case _0x3308('0xb'):zoho[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case _0x3308('0xc'):desk[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case _0x3308('0xd'):vtiger[_0x4750e4](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652);break;case'freshsales':freshsales['cs'](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652,_0x4750e4);break;case _0x3308('0xf'):servicenow['cs'](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652,_0x4750e4);break;case _0x3308('0x1d'):dynamics365['cs'](_0xd1e8ef,_0x25b614,_0x263d4c,_0x505404,_0x1d19ca,_0x307721,_0x455652,_0x4750e4);break;default:console[_0x3308('0x18')](_0x3308('0x1e'));}}else{_0x19150e=require(_0x3308('0x1f'))(_0xd1e8ef[_0x3308('0x1b')]['toLowerCase']());_0x19150e[_0x3308('0x20')](_0x3308('0x21'),util[_0x3308('0x22')](_0x3308('0x23'),_0xd1e8ef[_0x3308('0x1b')][_0x3308('0x10')](),_0xd1e8ef[_0x3308('0x14')]));}}else{_0x19150e=require('../../../../config/logger')(_0xd1e8ef['data1'][_0x3308('0x10')]());_0x19150e['error'](_0x3308('0x21'),util[_0x3308('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0xd1e8ef[_0x3308('0x1b')][_0x3308('0x10')](),_0xd1e8ef[_0x3308('0x11')]));}}else{}}catch(_0x48b62d){console[_0x3308('0x20')](_0x48b62d);}}}}; \ No newline at end of file +var _0x9637=['unmanaged','data1','zoho','servicenow','log','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','error','format','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','exec','includes','toLowerCase','queue','routeId','outbound','EVENT\x20UNKNOWN'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x9637,0x1bb));var _0x7963=function(_0x41fd6b,_0x462549){_0x41fd6b=_0x41fd6b-0x0;var _0x7dc11e=_0x9637[_0x41fd6b];return _0x7dc11e;};'use strict';var _=require('lodash');var util=require(_0x7963('0x0'));var zendesk=require(_0x7963('0x1'));var salesforce=require(_0x7963('0x2'));var sugarcrm=require(_0x7963('0x3'));var freshdesk=require(_0x7963('0x4'));var zoho=require(_0x7963('0x5'));var desk=require(_0x7963('0x6'));var vtiger=require(_0x7963('0x7'));var servicenow=require(_0x7963('0x8'));var dynamics365=require(_0x7963('0x9'));var freshsales=require('./freshsales');var integrations=[_0x7963('0xa'),_0x7963('0xb'),_0x7963('0xc'),_0x7963('0xd'),'zoho',_0x7963('0xe'),_0x7963('0xf'),_0x7963('0x10'),_0x7963('0x11'),'servicenow'];exports[_0x7963('0x12')]=function(_0x5b612a,_0x44e4ea,_0x2804f7,_0x378a4b,_0xe85e02,_0x3d310d){if(_0x2804f7){if(_[_0x7963('0x13')](integrations,_0x5b612a['data1'][_0x7963('0x14')]())){try{var _0xa4f874=null;var _0x4d755e='';var _0x39a22e=_0x2804f7[_0x5b612a['data1']['toLowerCase']()];if(_0x39a22e){var _0x183dd4=_0x39a22e[_0x5b612a['data2']];if(_0x183dd4){var _0x2e1f39=_['find'](_0x183dd4['Configurations'],{'id':parseInt(_0x5b612a['data3'],0xa)});if(_0x2e1f39){if(_0x378a4b){if(_0xe85e02&&_0x44e4ea[_0x7963('0x15')]){_0x4d755e=_0x7963('0x15');}else if(_0x44e4ea[_0x7963('0x16')]){_0x4d755e=_0x7963('0x17');}else{console['log'](_0x7963('0x18'),_0x44e4ea);}}else{_0x4d755e=_0x7963('0x19');}switch(_0x5b612a[_0x7963('0x1a')][_0x7963('0x14')]()){case _0x7963('0xa'):zendesk[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0xb'):salesforce[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0xc'):sugarcrm[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case'freshdesk':freshdesk[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0x1b'):zoho[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0xe'):desk[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case'vtiger':vtiger[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0x11'):freshsales['cs'](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d,_0x4d755e);break;case _0x7963('0x1c'):servicenow['cs'](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d,_0x4d755e);break;case _0x7963('0x10'):dynamics365['cs'](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d,_0x4d755e);break;default:console[_0x7963('0x1d')]('unknown\x20integration');}}else{_0xa4f874=require(_0x7963('0x1e'))(_0x5b612a[_0x7963('0x1a')][_0x7963('0x14')]());_0xa4f874['error'](_0x7963('0x1f'),util['format'](_0x7963('0x20'),_0x5b612a[_0x7963('0x1a')]['toLowerCase'](),_0x5b612a[_0x7963('0x21')]));}}else{_0xa4f874=require('../../../../config/logger')(_0x5b612a['data1'][_0x7963('0x14')]());_0xa4f874[_0x7963('0x22')]('[EXEC]',util[_0x7963('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x5b612a[_0x7963('0x1a')][_0x7963('0x14')](),_0x5b612a['data2']));}}else{}}catch(_0x4868af){console[_0x7963('0x22')](_0x4868af);}}}}; \ 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 573cd58..91daf6f 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 _0xeb83=['localhost','emit','assign','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','additionalSearchLead','merge','$or','Lead','account_contact_lead','Account','additionalSearchAccount','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','instanceUrl','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults'];(function(_0x3a6bc1,_0x52f887){var _0x39a901=function(_0x23f893){while(--_0x23f893){_0x3a6bc1['push'](_0x3a6bc1['shift']());}};_0x39a901(++_0x52f887);}(_0xeb83,0x75));var _0x3eb8=function(_0x10ac22,_0x59d87a){_0x10ac22=_0x10ac22-0x0;var _0x3e5b35=_0xeb83[_0x10ac22];return _0x3e5b35;};'use strict';var _=require(_0x3eb8('0x0'));var rp=require(_0x3eb8('0x1'));var moment=require(_0x3eb8('0x2'));var BPromise=require(_0x3eb8('0x3'));var md5=require(_0x3eb8('0x4'));var jsforce=require(_0x3eb8('0x5'));var util=require(_0x3eb8('0x6'));var Redis=require(_0x3eb8('0x7'));var intUtil=require(_0x3eb8('0x8'));var config=require('../../../../config/environment');var logger=require(_0x3eb8('0x9'))(_0x3eb8('0xa'));config[_0x3eb8('0xb')]=_[_0x3eb8('0xc')](config[_0x3eb8('0xb')],{'host':_0x3eb8('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x12d861,_0x1fb088,_0x3490e4){io['to'](_0x12d861)[_0x3eb8('0xe')](_0x1fb088,_0x3490e4);}function getTicket(_0x170550,_0x371989,_0x35314b,_0x185e2e,_0xc9cb75,_0x50c71c,_0x233cbe,_0x5b0538){var _0x16b30e=Object[_0x3eb8('0xf')]({},{'OwnerId':_0x371989['id'],'Subject':intUtil[_0x3eb8('0x10')](_0x185e2e['Subjects'],_0xc9cb75,'\x20'),'Description':intUtil[_0x3eb8('0x10')](_0x185e2e['Descriptions'],_0xc9cb75,'\x0a')},getCustomFields(_0x50c71c,_0xc9cb75));if(_0x35314b){if(_0x185e2e[_0x3eb8('0x11')]===_0x3eb8('0x12')){_0x16b30e[_0x3eb8('0x13')]=moment[_0x3eb8('0x14')]();_0x16b30e[_0x3eb8('0x15')]=![];_0x16b30e[_0x3eb8('0x16')]=![];if(_0x35314b[_0x3eb8('0x17')]===_0x3eb8('0x18')||_0x35314b[_0x3eb8('0x17')]===_0x3eb8('0x19')){_0x16b30e['WhoId']=_0x35314b['id'];}else if(_0x35314b[_0x3eb8('0x17')]===_0x3eb8('0x1a')){_0x16b30e['WhatId']=_0x35314b['id'];}}else if(_0x185e2e[_0x3eb8('0x11')]===_0x3eb8('0x1b')){if(_0x35314b['endUserType']==='contact'){_0x16b30e[_0x3eb8('0x1c')]=_0x35314b['id'];}else if(_0x35314b[_0x3eb8('0x17')]===_0x3eb8('0x1a')){_0x16b30e[_0x3eb8('0x1d')]=_0x35314b['id'];}else if(_0x35314b['endUserType']===_0x3eb8('0x19')&&_0x185e2e['leadId']){_0x16b30e[_0x185e2e[_0x3eb8('0x1e')]]=_0x35314b['id'];}else{logger[_0x3eb8('0x1f')](_0x3eb8('0x20'));}}}return _0x233cbe[_0x3eb8('0x21')](_0x185e2e[_0x3eb8('0x11')])[_0x3eb8('0x22')](_0x16b30e);}function getUser(_0x580026,_0x2da576,_0x286c03){if(!_['isNil'](_0x2da576)&&intUtil[_0x3eb8('0x23')](_0x2da576)){var _0x2c56cd={'Email':_0x2da576};var _0x25d796={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x286c03[_0x3eb8('0x21')]('User')[_0x3eb8('0x24')](_0x2c56cd,_0x25d796)[_0x3eb8('0x25')]()[_0x3eb8('0x26')](function(_0x2f1b6a){if(_0x2f1b6a[_0x3eb8('0x27')]){var _0x839120=_[_0x3eb8('0x24')](_0x2f1b6a,function(_0x545be4){return _0x545be4[_0x3eb8('0x28')]===_0x2da576;});if(_0x839120){logger[_0x3eb8('0x1f')](_0x3eb8('0x29'),_0x2da576);return BPromise[_0x3eb8('0x2a')]({'id':_0x839120['Id'],'name':_0x839120[_0x3eb8('0x2b')]});}}else{logger[_0x3eb8('0x1f')](_0x3eb8('0x2c'),_0x2da576);return _0x286c03[_0x3eb8('0x2d')]()[_0x3eb8('0x26')](function(_0x351cbb){return BPromise[_0x3eb8('0x2a')]({'id':_0x351cbb['user_id'],'name':_0x351cbb[_0x3eb8('0x2e')]});});}});}else{logger['info'](_0x3eb8('0x2c'),_0x2da576);return _0x286c03[_0x3eb8('0x2d')]()[_0x3eb8('0x26')](function(_0x884e0b){return BPromise['resolve']({'id':_0x884e0b[_0x3eb8('0x2f')],'name':_0x884e0b[_0x3eb8('0x2e')]});});}}function getEndUser(_0x1eda17,_0x3a472a,_0x439068,_0x3a4154,_0x16320d){var _0x501a00={'$or':{'Phone':_0x3a4154}};var _0x43ddd9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3eb8('0x2a')]()[_0x3eb8('0x26')](function(){logger[_0x3eb8('0x1f')](_0x3eb8('0x30'),_0x3a4154,_0x3a472a['moduleSearch']);switch(_0x3a472a[_0x3eb8('0x31')]){case _0x3eb8('0x32'):var _0x27fec6=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a[_0x3eb8('0x34')]){var _0x385b52={};_0x385b52[_0x3a472a[_0x3eb8('0x34')]]=_0x3a4154;_['merge'](_0x27fec6['$or'],_0x385b52);}return _0x16320d[_0x3eb8('0x21')]('Contact')[_0x3eb8('0x24')](_0x27fec6,_0x43ddd9)[_0x3eb8('0x25')]()[_0x3eb8('0x26')](function(_0x454b08){if(_0x454b08&&_0x454b08[_0x3eb8('0x27')]){return _0x454b08;}else{var _0x291805=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a[_0x3eb8('0x35')]){var _0x3df359={};_0x3df359[_0x3a472a['additionalSearchLead']]=_0x3a4154;_[_0x3eb8('0x36')](_0x291805[_0x3eb8('0x37')],_0x3df359);}return _0x16320d['sobject'](_0x3eb8('0x38'))[_0x3eb8('0x24')](_0x291805,_0x43ddd9);}});case _0x3eb8('0x39'):var _0x2546e7=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a['additionalSearchAccount']){var _0x385b52={};_0x385b52[_0x3a472a['additionalSearchAccount']]=_0x3a4154;_[_0x3eb8('0x36')](_0x2546e7[_0x3eb8('0x37')],_0x385b52);}return _0x16320d[_0x3eb8('0x21')](_0x3eb8('0x3a'))[_0x3eb8('0x24')](_0x2546e7,_0x43ddd9)[_0x3eb8('0x25')]()[_0x3eb8('0x26')](function(_0x33bd53){if(_0x33bd53&&_0x33bd53[_0x3eb8('0x27')]){return _0x33bd53;}else{var _0x35d428=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a[_0x3eb8('0x34')]){var _0x406d02={};_0x406d02[_0x3a472a['additionalSearchContact']]=_0x3a4154;_[_0x3eb8('0x36')](_0x35d428[_0x3eb8('0x37')],_0x406d02);}return _0x16320d[_0x3eb8('0x21')]('Contact')[_0x3eb8('0x24')](_0x35d428,_0x43ddd9)['then'](function(_0x4cdb15){if(_0x4cdb15&&_0x4cdb15['length']){return _0x4cdb15;}else{var _0x2c4945=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a[_0x3eb8('0x35')]){var _0x45d3fa={};_0x45d3fa[_0x3a472a[_0x3eb8('0x35')]]=_0x3a4154;_['merge'](_0x2c4945[_0x3eb8('0x37')],_0x45d3fa);}return _0x16320d[_0x3eb8('0x21')](_0x3eb8('0x38'))['find'](_0x2c4945,_0x43ddd9);}});}});case _0x3eb8('0x18'):var _0x27fec6=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a[_0x3eb8('0x34')]){var _0x385b52={};_0x385b52[_0x3a472a['additionalSearchContact']]=_0x3a4154;_[_0x3eb8('0x36')](_0x27fec6[_0x3eb8('0x37')],_0x385b52);}return _0x16320d[_0x3eb8('0x21')]('Contact')[_0x3eb8('0x24')](_0x27fec6,_0x43ddd9)[_0x3eb8('0x25')]();case _0x3eb8('0x19'):var _0x387726=_['cloneDeep'](_0x501a00);if(_0x3a472a[_0x3eb8('0x35')]){var _0x385b52={};_0x385b52[_0x3a472a[_0x3eb8('0x35')]]=_0x3a4154;_[_0x3eb8('0x36')](_0x387726[_0x3eb8('0x37')],_0x385b52);}return _0x16320d[_0x3eb8('0x21')]('Lead')[_0x3eb8('0x24')](_0x387726,_0x43ddd9);case _0x3eb8('0x1a'):var _0x2546e7=_[_0x3eb8('0x33')](_0x501a00);if(_0x3a472a[_0x3eb8('0x3b')]){var _0x385b52={};_0x385b52[_0x3a472a[_0x3eb8('0x3b')]]=_0x3a4154;_[_0x3eb8('0x36')](_0x2546e7[_0x3eb8('0x37')],_0x385b52);}return _0x16320d['sobject'](_0x3eb8('0x3a'))[_0x3eb8('0x24')](_0x2546e7,_0x43ddd9);default:return null;}})[_0x3eb8('0x26')](function(_0x18f402){if(_0x18f402&&_0x18f402[_0x3eb8('0x27')]){var _0x4c778c=_['first'](_0x18f402);if(_0x4c778c){return BPromise['resolve']({'id':_0x4c778c['Id'],'name':_0x4c778c[_0x3eb8('0x2b')],'phone':_0x4c778c[_0x3eb8('0x3c')],'endUserType':_0x4c778c[_0x3eb8('0x3d')][_0x3eb8('0x3e')][_0x3eb8('0x3f')]()});}}})['then'](function(_0x26cb03){if(_0x26cb03){logger[_0x3eb8('0x1f')](_0x3eb8('0x40'),_0x26cb03[_0x3eb8('0x17')],_0x3a4154);return BPromise[_0x3eb8('0x2a')](_0x26cb03);}else{logger[_0x3eb8('0x1f')](_0x3eb8('0x41'),_0x3a4154);var _0x729aa5={'Phone':_0x3a4154};if(_0x3a472a[_0x3eb8('0x42')]){if(_0x3a472a[_0x3eb8('0x42')]===_0x3eb8('0x18')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3a4154,_0x3a472a[_0x3eb8('0x42')]);_0x729aa5[_0x3eb8('0x43')]=_0x439068!==_0x3eb8('0x44')?_0x439068:util[_0x3eb8('0x45')](_0x3eb8('0x46'),_0x3a4154);}else if(_0x3a472a[_0x3eb8('0x42')]===_0x3eb8('0x19')){logger[_0x3eb8('0x1f')](_0x3eb8('0x47'),_0x3a4154,_0x3a472a['moduleCreate']);_0x729aa5[_0x3eb8('0x43')]=_0x439068!==_0x3eb8('0x44')?_0x439068:util[_0x3eb8('0x45')]('Caller\x20-\x20%s',_0x3a4154);_0x729aa5[_0x3eb8('0x48')]=_0x3eb8('0x49');}else if(_0x3a472a['moduleCreate']===_0x3eb8('0x1a')){logger[_0x3eb8('0x1f')](_0x3eb8('0x47'),_0x3a4154,_0x3a472a['moduleCreate']);_0x729aa5['Name']=_0x439068!==''?_0x439068:util['format'](_0x3eb8('0x46'),_0x3a4154);}else{return null;}}return _0x16320d['sobject'](_[_0x3eb8('0x4a')](_0x3a472a[_0x3eb8('0x42')]))['create'](_0x729aa5)[_0x3eb8('0x26')](function(_0x98f8f8){return BPromise[_0x3eb8('0x2a')]({'id':_0x98f8f8['id'],'endUserType':_0x3a472a[_0x3eb8('0x42')]});});}});}function getCustomFields(_0x5c1afc,_0x33368c){var _0x482607={};if(_0x5c1afc[_0x3eb8('0x27')]>0x0){_[_0x3eb8('0x4b')](_0x5c1afc,function(_0xc2b12a){if(_[_0x3eb8('0x4c')]([_0x3eb8('0x4d'),'picklist'],_0xc2b12a[_0x3eb8('0x3e')])&&_0xc2b12a[_0x3eb8('0x4e')]){_0x482607[_0xc2b12a[_0x3eb8('0x4e')]]=_0xc2b12a[_0x3eb8('0x4f')][_0x3eb8('0x50')]();}else if(_0xc2b12a[_0x3eb8('0x3e')]===_0x3eb8('0x51')&&_0xc2b12a[_0x3eb8('0x52')]&&_0xc2b12a['idField']){_0x33368c[_0xc2b12a[_0x3eb8('0x52')]]&&(_0x482607[_0xc2b12a[_0x3eb8('0x4e')]]=_0x33368c[_0xc2b12a[_0x3eb8('0x52')]][_0x3eb8('0x50')]());}else if(_0xc2b12a['type']===_0x3eb8('0x53')&&_0xc2b12a[_0x3eb8('0x54')]&&_0xc2b12a[_0x3eb8('0x54')][_0x3eb8('0x55')]&&_0xc2b12a['idField']){_0x33368c[_0xc2b12a[_0x3eb8('0x54')][_0x3eb8('0x55')][_0x3eb8('0x3f')]()]&&(_0x482607[_0xc2b12a[_0x3eb8('0x4e')]]=_0x33368c[_0xc2b12a[_0x3eb8('0x54')]['name'][_0x3eb8('0x3f')]()][_0x3eb8('0x50')]());}});}return _0x482607;}function getConnection(_0x5c0097){var _0x38c6f2=_0x5c0097[_0x3eb8('0x56')][_0x3eb8('0x57')](_0x5c0097[_0x3eb8('0x58')]);var _0x373c32=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5c0097[_0x3eb8('0x59')]||_0x3eb8('0x5a'),'clientId':_0x5c0097[_0x3eb8('0x5b')],'clientSecret':_0x5c0097['clientSecret']}});return _0x373c32[_0x3eb8('0x5c')](_0x5c0097['username'],_0x38c6f2)['then'](function(){logger['info'](_0x3eb8('0x5d'));return _0x373c32;});}exports[_0x3eb8('0x5e')]=function(_0x310bb6,_0x1d676b,_0x26542a,_0x3eac96,_0x3ad761,_0x4c21c7){var _0x165bfd,_0x31cd16,_0x2f72f,_0x2ae327;_0x4c21c7[_0x3eb8('0x5f')]=intUtil[_0x3eb8('0x60')](_0x4c21c7[_0x3eb8('0x5f')]);_0x4c21c7[_0x3eb8('0x59')]=intUtil['stripTrailingSlash'](_0x4c21c7[_0x3eb8('0x59')]);if(_0x3ad761&&_0x3ad761[_0x3eb8('0x61')]){logger['info'](_0x3eb8('0x62'),_0x3eb8('0x63'));_0x1d676b[_0x3eb8('0x64')]=util[_0x3eb8('0x45')](_0x3eb8('0x65'),_0x4c21c7[_0x3eb8('0x5f')],_0x1d676b[_0x3eb8('0x66')],md5(_0x1d676b[_0x3eb8('0x66')]));}else{_0x1d676b[_0x3eb8('0x64')]='';}return getConnection(_0x4c21c7)[_0x3eb8('0x26')](function(_0x34d1b7){_0x2ae327=_0x34d1b7;return getUser(_0x4c21c7,_0x3eac96['email'],_0x2ae327);})[_0x3eb8('0x26')](function(_0x3dbb1f){_0x165bfd=_0x3dbb1f;return getEndUser(_0x4c21c7,_0x26542a,_0x1d676b[_0x3eb8('0x67')],_0x1d676b[_0x3eb8('0x68')],_0x2ae327);})[_0x3eb8('0x26')](function(_0x1c776d){_0x31cd16=_0x1c776d;return getTicket(_0x4c21c7,_0x165bfd,_0x31cd16,_0x26542a,_0x1d676b,_0x26542a[_0x3eb8('0x69')],_0x2ae327,_0x3eb8('0x5e'));})[_0x3eb8('0x26')](function(_0x4c210a){_0x2f72f=_0x4c210a;logger[_0x3eb8('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x2f72f['id']);logger['info'](_0x3eb8('0x6a'),_0x2f72f['id'],_0x3eac96[_0x3eb8('0x55')],_0x4c21c7[_0x3eb8('0x3e')]);switch(_0x4c21c7[_0x3eb8('0x3e')]){case _0x3eb8('0x6b'):emit(util[_0x3eb8('0x45')]('user:%s',_0x3eac96[_0x3eb8('0x55')]),_0x3eb8('0x6c'),{'recordId':_0x2f72f['id']});break;case _0x3eb8('0x6d'):emit(util[_0x3eb8('0x45')](_0x3eb8('0x6e'),_0x3eac96[_0x3eb8('0x55')]),_0x3eb8('0x6f'),{'uri':util[_0x3eb8('0x45')]('%s/%s/e',_0x2ae327['instanceUrl'],_0x2f72f['id'])});break;default:logger['error'](_0x3eb8('0x70'));}})[_0x3eb8('0x71')](function(_0x33cd9c){logger[_0x3eb8('0x72')](_0x3eb8('0x62'),_0x33cd9c);});};exports[_0x3eb8('0x73')]=function(_0x1c64dc,_0x1542b7,_0x2ee67e,_0x50998c,_0x4f44c9,_0xc4b464,_0x406159){var _0x491f3f,_0x43e277,_0x45f1c6,_0x557e4b;_0xc4b464[_0x3eb8('0x5f')]=intUtil[_0x3eb8('0x60')](_0xc4b464['serverUrl']);_0xc4b464[_0x3eb8('0x59')]=intUtil['stripTrailingSlash'](_0xc4b464['remoteUri']);if(_0x406159&&_0x406159[_0x3eb8('0x74')]&&_0x406159['recordingFormat']!==_0x3eb8('0x75')){logger['info'](_0x3eb8('0x76'),_0x3eb8('0x63'));_0x1542b7[_0x3eb8('0x64')]=util[_0x3eb8('0x45')](_0x3eb8('0x65'),_0xc4b464[_0x3eb8('0x5f')],_0x1542b7[_0x3eb8('0x66')],md5(_0x1542b7[_0x3eb8('0x66')]));}return getConnection(_0xc4b464)[_0x3eb8('0x26')](function(_0x51846b){_0x557e4b=_0x51846b;return getUser(_0xc4b464,_0x50998c[_0x3eb8('0x77')],_0x557e4b);})['then'](function(_0x459b7a){_0x491f3f=_0x459b7a;return getEndUser(_0xc4b464,_0x2ee67e,_0x1542b7[_0x3eb8('0x78')],_0x1542b7[_0x3eb8('0x79')],_0x557e4b);})['then'](function(_0x1942f1){_0x43e277=_0x1942f1;return getTicket(_0xc4b464,_0x491f3f,_0x43e277,_0x2ee67e,_0x1542b7,_0x2ee67e[_0x3eb8('0x69')],_0x557e4b,_0x3eb8('0x73'));})[_0x3eb8('0x26')](function(_0x5335be){_0x45f1c6=_0x5335be;logger['info'](_0x3eb8('0x7a'),_0x45f1c6['id']);logger[_0x3eb8('0x1f')](_0x3eb8('0x7b'),_0x45f1c6['id'],_0x50998c['name'],_0xc4b464[_0x3eb8('0x3e')]);switch(_0xc4b464[_0x3eb8('0x3e')]){case _0x3eb8('0x6b'):emit(util[_0x3eb8('0x45')](_0x3eb8('0x6e'),_0x50998c['name']),'trigger:salesforce:display',{'recordId':_0x45f1c6['id']});break;case _0x3eb8('0x6d'):emit(util[_0x3eb8('0x45')](_0x3eb8('0x6e'),_0x50998c[_0x3eb8('0x55')]),_0x3eb8('0x6f'),{'uri':util['format'](_0x3eb8('0x7c'),_0x557e4b[_0x3eb8('0x7d')],_0x45f1c6['id'])});break;default:logger[_0x3eb8('0x72')](_0x3eb8('0x76'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x3d463d){logger[_0x3eb8('0x72')](_0x3eb8('0x76'),_0x3d463d);});};exports[_0x3eb8('0x7e')]=function(_0x5a5367,_0x446332,_0x559b87,_0x462799,_0x25970b,_0x4ef1cd){var _0x3f68fc,_0x138ca3,_0x12f1ec,_0x379625;_0x4ef1cd['serverUrl']=intUtil[_0x3eb8('0x60')](_0x4ef1cd['serverUrl']);_0x4ef1cd[_0x3eb8('0x59')]=intUtil[_0x3eb8('0x60')](_0x4ef1cd[_0x3eb8('0x59')]);if(_0x25970b&&_0x25970b['monitor_format']){logger['info']('['+_0x446332[_0x3eb8('0x7f')][_0x3eb8('0x80')]()+']','Recording\x20is\x20enabled!');_0x446332['recordingURL']=util[_0x3eb8('0x45')](_0x3eb8('0x65'),_0x4ef1cd[_0x3eb8('0x5f')],_0x446332[_0x3eb8('0x66')],md5(_0x446332[_0x3eb8('0x66')]));}else{_0x446332['recordingURL']='';}return getConnection(_0x4ef1cd)['then'](function(_0x343f78){_0x379625=_0x343f78;if(!_['isNil'](_0x462799)){return getUser(_0x4ef1cd,_0x462799['name'],_0x379625);}else{return getUser(_0x4ef1cd,null,_0x379625);}})[_0x3eb8('0x26')](function(_0x38642c){_0x3f68fc=_0x38642c;return getEndUser(_0x4ef1cd,_0x559b87,_0x446332[_0x3eb8('0x67')],_0x446332['calleridnum'],_0x379625);})[_0x3eb8('0x26')](function(_0x196914){_0x138ca3=_0x196914;return getTicket(_0x4ef1cd,_0x3f68fc,_0x138ca3,_0x559b87,_0x446332,_0x559b87[_0x3eb8('0x69')],_0x379625);})[_0x3eb8('0x26')](function(_0x46f74d){_0x12f1ec=_0x46f74d;logger[_0x3eb8('0x1f')]('['+_0x446332[_0x3eb8('0x7f')][_0x3eb8('0x80')]()+']\x20Ticket\x20%s\x20created.',_0x12f1ec['id']);logger[_0x3eb8('0x1f')]('['+_0x446332['lastevent']['toUpperCase']()+_0x3eb8('0x81'),_0x4ef1cd['type']);})[_0x3eb8('0x71')](function(_0x49286c){logger['error']('['+_0x446332['lastevent']['toUpperCase']()+']',_0x49286c);});}; \ No newline at end of file +var _0x64c9=['merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','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','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','util','./util','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','account','WhatId','ticketType','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','execute','find','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact'];(function(_0x12ae74,_0x9e2b08){var _0x2794bc=function(_0x5bf594){while(--_0x5bf594){_0x12ae74['push'](_0x12ae74['shift']());}};_0x2794bc(++_0x9e2b08);}(_0x64c9,0x1bc));var _0x964c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64c9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x964c('0x0'));var rp=require(_0x964c('0x1'));var moment=require(_0x964c('0x2'));var BPromise=require(_0x964c('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x964c('0x4'));var Redis=require('ioredis');var intUtil=require(_0x964c('0x5'));var config=require('../../../../config/environment');var logger=require(_0x964c('0x6'))(_0x964c('0x7'));config['redis']=_[_0x964c('0x8')](config[_0x964c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x964c('0xa'))(new Redis(config[_0x964c('0x9')]));function emit(_0x29e2f0,_0x44a5ef,_0x2244e0){io['to'](_0x29e2f0)['emit'](_0x44a5ef,_0x2244e0);}function getTicket(_0x31c27c,_0x4ba179,_0x270bab,_0x5b3364,_0x2456e7,_0x3daa19,_0x300d0e,_0x3d2ef2){var _0xd07424=Object[_0x964c('0xb')]({},{'OwnerId':_0x4ba179['id'],'Subject':intUtil[_0x964c('0xc')](_0x5b3364[_0x964c('0xd')],_0x2456e7,'\x20'),'Description':intUtil[_0x964c('0xc')](_0x5b3364[_0x964c('0xe')],_0x2456e7,'\x0a')},getCustomFields(_0x3daa19,_0x2456e7));if(_0x270bab){if(_0x5b3364['ticketType']===_0x964c('0xf')){_0xd07424[_0x964c('0x10')]=moment[_0x964c('0x11')]();_0xd07424['IsReminderSet']=![];_0xd07424[_0x964c('0x12')]=![];if(_0x270bab[_0x964c('0x13')]===_0x964c('0x14')||_0x270bab['endUserType']==='lead'){_0xd07424['WhoId']=_0x270bab['id'];}else if(_0x270bab[_0x964c('0x13')]===_0x964c('0x15')){_0xd07424[_0x964c('0x16')]=_0x270bab['id'];}}else if(_0x5b3364[_0x964c('0x17')]==='Case'){if(_0x270bab[_0x964c('0x13')]===_0x964c('0x14')){_0xd07424[_0x964c('0x18')]=_0x270bab['id'];}else if(_0x270bab['endUserType']==='account'){_0xd07424['AccountId']=_0x270bab['id'];}else if(_0x270bab[_0x964c('0x13')]===_0x964c('0x19')&&_0x5b3364[_0x964c('0x1a')]){_0xd07424[_0x5b3364[_0x964c('0x1a')]]=_0x270bab['id'];}else{logger[_0x964c('0x1b')](_0x964c('0x1c'));}}}return _0x300d0e['sobject'](_0x5b3364[_0x964c('0x17')])[_0x964c('0x1d')](_0xd07424);}function getUser(_0x4f377d,_0x5633ce,_0x1c87a1){if(!_[_0x964c('0x1e')](_0x5633ce)&&intUtil[_0x964c('0x1f')](_0x5633ce)){var _0x40e83a={'Email':_0x5633ce};var _0x14476c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c87a1[_0x964c('0x20')](_0x964c('0x21'))['find'](_0x40e83a,_0x14476c)[_0x964c('0x22')]()['then'](function(_0x407295){if(_0x407295['length']){var _0x2fc6d7=_[_0x964c('0x23')](_0x407295,function(_0xb032a9){return _0xb032a9['Email']===_0x5633ce;});if(_0x2fc6d7){logger[_0x964c('0x1b')](_0x964c('0x24'),_0x5633ce);return BPromise['resolve']({'id':_0x2fc6d7['Id'],'name':_0x2fc6d7[_0x964c('0x25')]});}}else{logger['info'](_0x964c('0x26'),_0x5633ce);return _0x1c87a1['identity']()[_0x964c('0x27')](function(_0x1865e3){return BPromise['resolve']({'id':_0x1865e3[_0x964c('0x28')],'name':_0x1865e3[_0x964c('0x29')]});});}});}else{logger[_0x964c('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5633ce);return _0x1c87a1['identity']()['then'](function(_0x430bb2){return BPromise[_0x964c('0x2a')]({'id':_0x430bb2[_0x964c('0x28')],'name':_0x430bb2[_0x964c('0x29')]});});}}function getEndUser(_0xd01f3f,_0x14ced5,_0x4dbfdc,_0x5a918b,_0x5a17e5){var _0x1447e7={'$or':{'Phone':_0x5a918b}};var _0x4e27ba={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x964c('0x2a')]()[_0x964c('0x27')](function(){logger[_0x964c('0x1b')](_0x964c('0x2b'),_0x5a918b,_0x14ced5[_0x964c('0x2c')]);switch(_0x14ced5[_0x964c('0x2c')]){case _0x964c('0x2d'):var _0xef3d2c=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5[_0x964c('0x2f')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x2f')]]=_0x5a918b;_[_0x964c('0x30')](_0xef3d2c[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x32'))[_0x964c('0x23')](_0xef3d2c,_0x4e27ba)['execute']()[_0x964c('0x27')](function(_0x376f56){if(_0x376f56&&_0x376f56['length']){return _0x376f56;}else{var _0x295569=_['cloneDeep'](_0x1447e7);if(_0x14ced5[_0x964c('0x33')]){var _0x26237d={};_0x26237d[_0x14ced5['additionalSearchLead']]=_0x5a918b;_[_0x964c('0x30')](_0x295569['$or'],_0x26237d);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x34'))[_0x964c('0x23')](_0x295569,_0x4e27ba);}});case _0x964c('0x35'):var _0x1dd770=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5[_0x964c('0x36')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x36')]]=_0x5a918b;_[_0x964c('0x30')](_0x1dd770[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x37'))[_0x964c('0x23')](_0x1dd770,_0x4e27ba)[_0x964c('0x22')]()['then'](function(_0x28a7d8){if(_0x28a7d8&&_0x28a7d8['length']){return _0x28a7d8;}else{var _0x912878=_['cloneDeep'](_0x1447e7);if(_0x14ced5[_0x964c('0x2f')]){var _0x1c95e9={};_0x1c95e9[_0x14ced5[_0x964c('0x2f')]]=_0x5a918b;_[_0x964c('0x30')](_0x912878[_0x964c('0x31')],_0x1c95e9);}return _0x5a17e5['sobject'](_0x964c('0x32'))[_0x964c('0x23')](_0x912878,_0x4e27ba)['then'](function(_0x2b5707){if(_0x2b5707&&_0x2b5707['length']){return _0x2b5707;}else{var _0x36aec1=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5['additionalSearchLead']){var _0x4f10cc={};_0x4f10cc[_0x14ced5['additionalSearchLead']]=_0x5a918b;_[_0x964c('0x30')](_0x36aec1[_0x964c('0x31')],_0x4f10cc);}return _0x5a17e5['sobject'](_0x964c('0x34'))['find'](_0x36aec1,_0x4e27ba);}});}});case _0x964c('0x14'):var _0xef3d2c=_['cloneDeep'](_0x1447e7);if(_0x14ced5[_0x964c('0x2f')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x2f')]]=_0x5a918b;_[_0x964c('0x30')](_0xef3d2c[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x32'))['find'](_0xef3d2c,_0x4e27ba)['execute']();case _0x964c('0x19'):var _0x41e6ec=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5[_0x964c('0x33')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x33')]]=_0x5a918b;_[_0x964c('0x30')](_0x41e6ec[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x34'))[_0x964c('0x23')](_0x41e6ec,_0x4e27ba);case _0x964c('0x15'):var _0x1dd770=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5['additionalSearchAccount']){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x36')]]=_0x5a918b;_['merge'](_0x1dd770[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x37'))[_0x964c('0x23')](_0x1dd770,_0x4e27ba);default:return null;}})[_0x964c('0x27')](function(_0x13b6d2){if(_0x13b6d2&&_0x13b6d2['length']){var _0x2aac71=_['first'](_0x13b6d2);if(_0x2aac71){return BPromise[_0x964c('0x2a')]({'id':_0x2aac71['Id'],'name':_0x2aac71[_0x964c('0x25')],'phone':_0x2aac71['Phone'],'endUserType':_0x2aac71['attributes'][_0x964c('0x38')][_0x964c('0x39')]()});}}})[_0x964c('0x27')](function(_0x56220e){if(_0x56220e){logger[_0x964c('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x56220e[_0x964c('0x13')],_0x5a918b);return BPromise[_0x964c('0x2a')](_0x56220e);}else{logger[_0x964c('0x1b')](_0x964c('0x3a'),_0x5a918b);var _0x5719eb={'Phone':_0x5a918b};if(_0x14ced5[_0x964c('0x3b')]){if(_0x14ced5[_0x964c('0x3b')]===_0x964c('0x14')){logger['info'](_0x964c('0x3c'),_0x5a918b,_0x14ced5[_0x964c('0x3b')]);_0x5719eb[_0x964c('0x3d')]=_0x4dbfdc!==_0x964c('0x3e')?_0x4dbfdc:util[_0x964c('0x3f')]('Caller\x20-\x20%s',_0x5a918b);}else if(_0x14ced5[_0x964c('0x3b')]===_0x964c('0x19')){logger[_0x964c('0x1b')](_0x964c('0x3c'),_0x5a918b,_0x14ced5[_0x964c('0x3b')]);_0x5719eb['LastName']=_0x4dbfdc!==_0x964c('0x3e')?_0x4dbfdc:util[_0x964c('0x3f')](_0x964c('0x40'),_0x5a918b);_0x5719eb[_0x964c('0x41')]=_0x964c('0x42');}else if(_0x14ced5[_0x964c('0x3b')]==='account'){logger['info'](_0x964c('0x3c'),_0x5a918b,_0x14ced5[_0x964c('0x3b')]);_0x5719eb[_0x964c('0x25')]=_0x4dbfdc!==''?_0x4dbfdc:util['format'](_0x964c('0x40'),_0x5a918b);}else{return null;}}return _0x5a17e5['sobject'](_[_0x964c('0x43')](_0x14ced5['moduleCreate']))[_0x964c('0x1d')](_0x5719eb)[_0x964c('0x27')](function(_0x211d52){return BPromise['resolve']({'id':_0x211d52['id'],'endUserType':_0x14ced5[_0x964c('0x3b')]});});}});}function getCustomFields(_0x202aa9,_0x331d9d){var _0x269455={};if(_0x202aa9['length']>0x0){_[_0x964c('0x44')](_0x202aa9,function(_0x1deefc){if(_[_0x964c('0x45')]([_0x964c('0x46'),_0x964c('0x47')],_0x1deefc[_0x964c('0x38')])&&_0x1deefc[_0x964c('0x48')]){_0x269455[_0x1deefc[_0x964c('0x48')]]=_0x1deefc[_0x964c('0x49')][_0x964c('0x4a')]();}else if(_0x1deefc[_0x964c('0x38')]===_0x964c('0x4b')&&_0x1deefc[_0x964c('0x4c')]&&_0x1deefc[_0x964c('0x48')]){_0x331d9d[_0x1deefc['variableName']]&&(_0x269455[_0x1deefc[_0x964c('0x48')]]=_0x331d9d[_0x1deefc[_0x964c('0x4c')]][_0x964c('0x4a')]());}else if(_0x1deefc[_0x964c('0x38')]===_0x964c('0x4d')&&_0x1deefc[_0x964c('0x4e')]&&_0x1deefc[_0x964c('0x4e')][_0x964c('0x4f')]&&_0x1deefc[_0x964c('0x48')]){_0x331d9d[_0x1deefc[_0x964c('0x4e')][_0x964c('0x4f')][_0x964c('0x39')]()]&&(_0x269455[_0x1deefc[_0x964c('0x48')]]=_0x331d9d[_0x1deefc[_0x964c('0x4e')][_0x964c('0x4f')][_0x964c('0x39')]()]['toString']());}});}return _0x269455;}function getConnection(_0x48bd07){var _0x37ceae=_0x48bd07[_0x964c('0x50')][_0x964c('0x51')](_0x48bd07[_0x964c('0x52')]);var _0x3bffb8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x48bd07['remoteUri']||'https://login.salesforce.com','clientId':_0x48bd07[_0x964c('0x53')],'clientSecret':_0x48bd07[_0x964c('0x54')]}});return _0x3bffb8[_0x964c('0x55')](_0x48bd07['username'],_0x37ceae)[_0x964c('0x27')](function(){logger[_0x964c('0x1b')](_0x964c('0x56'));return _0x3bffb8;});}exports[_0x964c('0x57')]=function(_0x31a6c0,_0x164c34,_0x447c9f,_0x3dcb60,_0x102da8,_0x474dfe){var _0x3f201b,_0x2c779f,_0x3e9b6d,_0x2dbd9f;_0x474dfe[_0x964c('0x58')]=intUtil[_0x964c('0x59')](_0x474dfe['serverUrl']);_0x474dfe[_0x964c('0x5a')]=intUtil[_0x964c('0x59')](_0x474dfe[_0x964c('0x5a')]);if(_0x102da8&&_0x102da8[_0x964c('0x5b')]){logger[_0x964c('0x1b')](_0x964c('0x5c'),_0x964c('0x5d'));_0x164c34[_0x964c('0x5e')]=util[_0x964c('0x3f')](_0x964c('0x5f'),_0x474dfe[_0x964c('0x58')],_0x164c34[_0x964c('0x60')],md5(_0x164c34[_0x964c('0x60')]));}else{_0x164c34[_0x964c('0x5e')]='';}return getConnection(_0x474dfe)[_0x964c('0x27')](function(_0x2928bf){_0x2dbd9f=_0x2928bf;return getUser(_0x474dfe,_0x3dcb60[_0x964c('0x61')],_0x2dbd9f);})['then'](function(_0x16b860){_0x3f201b=_0x16b860;return getEndUser(_0x474dfe,_0x447c9f,_0x164c34[_0x964c('0x62')],_0x164c34[_0x964c('0x63')],_0x2dbd9f);})[_0x964c('0x27')](function(_0x140ec4){_0x2c779f=_0x140ec4;return getTicket(_0x474dfe,_0x3f201b,_0x2c779f,_0x447c9f,_0x164c34,_0x447c9f[_0x964c('0x64')],_0x2dbd9f,_0x964c('0x57'));})[_0x964c('0x27')](function(_0x1c4e46){_0x3e9b6d=_0x1c4e46;logger[_0x964c('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3e9b6d['id']);logger['info'](_0x964c('0x65'),_0x3e9b6d['id'],_0x3dcb60[_0x964c('0x4f')],_0x474dfe[_0x964c('0x38')]);switch(_0x474dfe[_0x964c('0x38')]){case _0x964c('0x66'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x3dcb60[_0x964c('0x4f')]),_0x964c('0x68'),{'recordId':_0x3e9b6d['id']});break;case _0x964c('0x69'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x3dcb60[_0x964c('0x4f')]),_0x964c('0x6a'),{'uri':util['format'](_0x964c('0x6b'),_0x2dbd9f[_0x964c('0x6c')],_0x3e9b6d['id'])});break;default:logger[_0x964c('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x964c('0x6e')](function(_0x3ae61e){logger[_0x964c('0x6d')](_0x964c('0x5c'),_0x3ae61e);});};exports[_0x964c('0x6f')]=function(_0x367ca1,_0xe70933,_0x32d9d4,_0x525b5b,_0x2d3243,_0x52b5ba,_0x5ee65b){var _0xfb8db2,_0x9265b7,_0x3ea348,_0x5ab761;_0x52b5ba['serverUrl']=intUtil[_0x964c('0x59')](_0x52b5ba['serverUrl']);_0x52b5ba[_0x964c('0x5a')]=intUtil[_0x964c('0x59')](_0x52b5ba['remoteUri']);if(_0x5ee65b&&_0x5ee65b[_0x964c('0x70')]&&_0x5ee65b[_0x964c('0x70')]!==_0x964c('0x71')){logger['info'](_0x964c('0x72'),_0x964c('0x5d'));_0xe70933[_0x964c('0x5e')]=util[_0x964c('0x3f')](_0x964c('0x5f'),_0x52b5ba['serverUrl'],_0xe70933['uniqueid'],md5(_0xe70933['uniqueid']));}return getConnection(_0x52b5ba)[_0x964c('0x27')](function(_0x430c93){_0x5ab761=_0x430c93;return getUser(_0x52b5ba,_0x525b5b[_0x964c('0x61')],_0x5ab761);})['then'](function(_0x231e8b){_0xfb8db2=_0x231e8b;return getEndUser(_0x52b5ba,_0x32d9d4,_0xe70933['destcalleridname'],_0xe70933[_0x964c('0x73')],_0x5ab761);})['then'](function(_0x4f055e){_0x9265b7=_0x4f055e;return getTicket(_0x52b5ba,_0xfb8db2,_0x9265b7,_0x32d9d4,_0xe70933,_0x32d9d4[_0x964c('0x64')],_0x5ab761,_0x964c('0x6f'));})[_0x964c('0x27')](function(_0x4573e6){_0x3ea348=_0x4573e6;logger[_0x964c('0x1b')](_0x964c('0x74'),_0x3ea348['id']);logger[_0x964c('0x1b')](_0x964c('0x75'),_0x3ea348['id'],_0x525b5b[_0x964c('0x4f')],_0x52b5ba[_0x964c('0x38')]);switch(_0x52b5ba[_0x964c('0x38')]){case _0x964c('0x66'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x525b5b[_0x964c('0x4f')]),_0x964c('0x68'),{'recordId':_0x3ea348['id']});break;case _0x964c('0x69'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x525b5b[_0x964c('0x4f')]),_0x964c('0x6a'),{'uri':util[_0x964c('0x3f')]('%s/%s/e',_0x5ab761[_0x964c('0x6c')],_0x3ea348['id'])});break;default:logger[_0x964c('0x6d')](_0x964c('0x72'),_0x964c('0x76'));}})[_0x964c('0x6e')](function(_0x4d1c59){logger[_0x964c('0x6d')]('[OUTBOUND]',_0x4d1c59);});};exports[_0x964c('0x77')]=function(_0x5ea1ea,_0xb7195c,_0x41d6c4,_0x195df2,_0x8b019e,_0x423061){var _0x1ac403,_0xc642c6,_0x3f99de,_0x24d0ce;_0x423061[_0x964c('0x58')]=intUtil['stripTrailingSlash'](_0x423061[_0x964c('0x58')]);_0x423061[_0x964c('0x5a')]=intUtil[_0x964c('0x59')](_0x423061[_0x964c('0x5a')]);if(_0x8b019e&&_0x8b019e['monitor_format']){logger['info']('['+_0xb7195c[_0x964c('0x78')][_0x964c('0x79')]()+']',_0x964c('0x5d'));_0xb7195c[_0x964c('0x5e')]=util[_0x964c('0x3f')](_0x964c('0x5f'),_0x423061[_0x964c('0x58')],_0xb7195c[_0x964c('0x60')],md5(_0xb7195c['uniqueid']));}else{_0xb7195c[_0x964c('0x5e')]='';}return getConnection(_0x423061)[_0x964c('0x27')](function(_0x2715fc){_0x24d0ce=_0x2715fc;if(!_[_0x964c('0x1e')](_0x195df2)){return getUser(_0x423061,_0x195df2[_0x964c('0x4f')],_0x24d0ce);}else{return getUser(_0x423061,null,_0x24d0ce);}})[_0x964c('0x27')](function(_0x2c5237){_0x1ac403=_0x2c5237;return getEndUser(_0x423061,_0x41d6c4,_0xb7195c[_0x964c('0x62')],_0xb7195c['calleridnum'],_0x24d0ce);})['then'](function(_0x5452be){_0xc642c6=_0x5452be;return getTicket(_0x423061,_0x1ac403,_0xc642c6,_0x41d6c4,_0xb7195c,_0x41d6c4[_0x964c('0x64')],_0x24d0ce);})[_0x964c('0x27')](function(_0x2f4dbd){_0x3f99de=_0x2f4dbd;logger[_0x964c('0x1b')]('['+_0xb7195c['lastevent'][_0x964c('0x79')]()+']\x20Ticket\x20%s\x20created.',_0x3f99de['id']);logger[_0x964c('0x1b')]('['+_0xb7195c['lastevent'][_0x964c('0x79')]()+_0x964c('0x7a'),_0x423061[_0x964c('0x38')]);})[_0x964c('0x6e')](function(_0x1ac3ed){logger[_0x964c('0x6d')]('['+_0xb7195c['lastevent']['toUpperCase']()+']',_0x1ac3ed);});}; \ 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 baa23fa..a0e0e6d 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 _0x95ae=['socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','endUserId','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','toString','string','idField','content','variable','variableName','customVariable','Variable','name','outbound','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketNumber','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','username','sysparm_limit=1','remoteUri','stripTrailingSlash','%s/api/now/table/','email','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95ae,0x18d));var _0xe95a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x95ae[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xe95a('0x0'));var Promise=require('bluebird');var rp=require(_0xe95a('0x1'));var util=require('util');var md5=require(_0xe95a('0x2'));var Redis=require('ioredis');var intUtil=require(_0xe95a('0x3'));var config=require(_0xe95a('0x4'));var logger=require(_0xe95a('0x5'))('servicenow');config[_0xe95a('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe95a('0x7'))(new Redis(config[_0xe95a('0x6')]));function getAdminUser(_0x5df3c5,_0x27fd69,_0x62e9cb,_0x59dad8,_0x5ba5ae,_0x2b83bf){return new Promise(function(_0x3f2c52,_0x33eead){var _0x46be83={'method':_0xe95a('0x8'),'uri':_0x59dad8+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5ba5ae+'&'+_0x2b83bf,'auth':_0x27fd69,'json':!![]};return rp(_0x46be83)[_0xe95a('0x9')](function(_0x48a487){if(_0x48a487[_0xe95a('0xa')][_0xe95a('0xb')]>0x0){_0x62e9cb[_0xe95a('0xc')]=_0x48a487['result'][0x0][_0xe95a('0xd')];}logger[_0xe95a('0xe')]('['+[_0x5df3c5[_0xe95a('0xf')]()]+_0xe95a('0x10'),_0x62e9cb);_0x3f2c52(_0x62e9cb);})[_0xe95a('0x11')](function(_0x4cc2e5){logger[_0xe95a('0x12')]('['+[_0x5df3c5[_0xe95a('0xf')]()]+']',_0x4cc2e5[_0xe95a('0x13')]);_0x33eead(_0x4cc2e5[_0xe95a('0x13')]);});});}function getUser(_0x1ed302,_0x55fda2,_0x193dfe,_0x3bca3c,_0x46ed58){return function(_0x58d8cb){logger[_0xe95a('0xe')]('['+[_0x1ed302[_0xe95a('0xf')]()]+_0xe95a('0x14'),_0x58d8cb);return new Promise(function(_0xe081a,_0x27ae03){if(intUtil[_0xe95a('0x15')](_0x58d8cb[_0xe95a('0x16')])){var _0x30fc2b={'method':_0xe95a('0x8'),'uri':_0x193dfe+_0xe95a('0x17')+_0x58d8cb[_0xe95a('0x16')]+'&'+_0x3bca3c+'&'+_0x46ed58,'auth':_0x55fda2,'json':!![]};logger[_0xe95a('0xe')]('['+[_0x1ed302[_0xe95a('0xf')]()]+_0xe95a('0x18'),_0x30fc2b);return rp(_0x30fc2b)[_0xe95a('0x9')](function(_0x5b66de){logger[_0xe95a('0xe')]('['+[_0x1ed302[_0xe95a('0xf')]()]+_0xe95a('0x19'),_0x5b66de);if(_0x5b66de[_0xe95a('0xa')][_0xe95a('0xb')]>0x0&&String(_0x5b66de[_0xe95a('0xa')][0x0]['active'])===_0xe95a('0x1a')){_0x58d8cb[_0xe95a('0x1b')]=_0x5b66de[_0xe95a('0xa')][0x0][_0xe95a('0xd')];}else{_0x58d8cb[_0xe95a('0x1b')]=_0x58d8cb['adminId'];_0x58d8cb[_0xe95a('0x16')]=_0x58d8cb[_0xe95a('0x1c')];}logger['info']('['+[_0x1ed302[_0xe95a('0xf')]()]+'],\x20getUser\x20crm',_0x58d8cb);_0xe081a(_0x58d8cb);})['catch'](function(_0x2c3848){logger['error']('['+[_0x1ed302[_0xe95a('0xf')]()]+']',_0x2c3848['message']);_0x27ae03(_0x2c3848[_0xe95a('0x13')]);});}else{logger['info']('['+[_0x1ed302[_0xe95a('0xf')]()]+_0xe95a('0x1d'));_0x58d8cb[_0xe95a('0x1b')]=_0x58d8cb['adminId'];_0x58d8cb['userEmail']=_0x58d8cb[_0xe95a('0x1c')];_0xe081a(_0x58d8cb);}});};}function createEndUser(_0x28032c,_0x2625d9,_0x5ba508,_0xd160ee,_0x49b706){logger['info']('['+[_0x28032c[_0xe95a('0xf')]()]+_0xe95a('0x1e'),_0x5ba508);return new Promise(function(_0xdae841,_0x89bf6f){var _0x1a4bff={'method':'POST','uri':_0xd160ee+_0xe95a('0x1f')+_0x49b706,'body':{'user_name':_0x5ba508[_0xe95a('0x20')],'roles':_0xe95a('0x21'),'first_name':_0x5ba508[_0xe95a('0x20')],'active':_0xe95a('0x1a'),'date_format':'System','phone':_0x5ba508['endUserNumber']},'auth':_0x2625d9,'json':!![]};return rp(_0x1a4bff)[_0xe95a('0x9')](function(_0x339c77){logger['info']('['+[_0x28032c[_0xe95a('0xf')]()]+'],\x20EndUser\x20schema',_0x339c77['result']);_0x5ba508[_0xe95a('0x22')]=_0x339c77[_0xe95a('0xa')]['sys_id'];_0xdae841(_0x5ba508);})[_0xe95a('0x11')](function(_0x299058){logger[_0xe95a('0x12')]('['+[_0x28032c[_0xe95a('0xf')]()]+']',_0x299058[_0xe95a('0x13')]);_0x89bf6f(_0x299058[_0xe95a('0x13')]);});});}function getEndUser(_0x54871e,_0x1b7615,_0x5cd614,_0x4d4824,_0x195357){return function(_0x3ff9c9){logger[_0xe95a('0xe')]('['+[_0x54871e[_0xe95a('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x3ff9c9);return new Promise(function(_0x2537f2,_0x586574){var _0x5c8bec={'method':_0xe95a('0x8'),'uri':_0x5cd614+'sys_user?sysparm_query=phone%3D'+_0x3ff9c9[_0xe95a('0x20')]+'&'+_0x4d4824+'&'+_0x195357,'auth':_0x1b7615,'json':!![]};return rp(_0x5c8bec)['then'](function(_0x48cb01){if(_0x48cb01[_0xe95a('0xa')][_0xe95a('0xb')]>0x0){_0x3ff9c9['endUserId']=_0x48cb01[_0xe95a('0xa')][0x0][_0xe95a('0xd')];logger[_0xe95a('0xe')]('['+[_0x54871e[_0xe95a('0xf')]()]+_0xe95a('0x23'),_0x3ff9c9);_0x2537f2(_0x3ff9c9);}else{return createEndUser(_0x54871e,_0x1b7615,_0x3ff9c9,_0x5cd614,_0x4d4824)[_0xe95a('0x9')](function(_0x5b96e5){logger[_0xe95a('0xe')]('['+[_0x54871e[_0xe95a('0xf')]()]+'],\x20createEndUser\x20crm',_0x5b96e5);_0x2537f2(_0x5b96e5);});}})['catch'](function(_0x342617){logger[_0xe95a('0x12')]('['+[_0x54871e['toUpperCase']()]+']',_0x342617[_0xe95a('0x13')]);_0x586574(_0x342617['message']);});});};}function getCustomFields(_0xf19610,_0x47e2e4){var _0x1db030={};if(_0xf19610[_0xe95a('0xb')]>0x0){_[_0xe95a('0x24')](_0xf19610,function(_0x1b18d1){if(_[_0xe95a('0x25')](['string',_0xe95a('0x26')],_0x1b18d1[_0xe95a('0x27')])&&_0x1b18d1[_0xe95a('0x28')]&&!_0x1b18d1[_0xe95a('0x29')]){_0x1db030[_0x1b18d1[_0xe95a('0x28')][_0xe95a('0x2a')]()]=_0x1b18d1['content'][_0xe95a('0x2b')]();}else if(_[_0xe95a('0x25')]([_0xe95a('0x2c'),_0xe95a('0x26')],_0x1b18d1[_0xe95a('0x27')])&&_0x1b18d1[_0xe95a('0x2d')]&&_0x1b18d1[_0xe95a('0x29')]){_0x1db030[_0x1b18d1[_0xe95a('0x2d')]['toLowerCase']()]=_0x1b18d1[_0xe95a('0x2e')][_0xe95a('0x2b')]();}else if(_0x1b18d1[_0xe95a('0x27')]===_0xe95a('0x2f')&&_0x1b18d1[_0xe95a('0x30')]&&_0x1b18d1['idField']&&_0x1b18d1['customField']){_0x1db030[_0x1b18d1[_0xe95a('0x2d')][_0xe95a('0x2a')]()]=_0x47e2e4[_0x1b18d1[_0xe95a('0x30')]][_0xe95a('0x2b')]();}else if(_0x1b18d1['type']===_0xe95a('0x31')&&_0x1b18d1[_0xe95a('0x32')]&&_0x1b18d1['Variable'][_0xe95a('0x33')]&&_0x1b18d1[_0xe95a('0x2d')]&&_0x1b18d1[_0xe95a('0x29')]){_0x1db030[_0x1b18d1[_0xe95a('0x2d')][_0xe95a('0x2a')]()]=_0x47e2e4[_0x1b18d1[_0xe95a('0x32')][_0xe95a('0x33')]['toLowerCase']()][_0xe95a('0x2b')]();}});}return _0x1db030;}function getTicket(_0x156dea,_0x595b60,_0x2f2ae0,_0x3a262d,_0x1b239e,_0x199711){return function(_0x41114e){logger[_0xe95a('0xe')]('['+[_0x156dea['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x41114e);return new Promise(function(_0x4693b2,_0x7259ed){var _0x3855ab=_0x156dea[_0xe95a('0x2a')]()===_0xe95a('0x34')?_0x41114e['userId']:_0x41114e[_0xe95a('0x22')];var _0x19bdfd={'method':_0xe95a('0x35'),'uri':_0x2f2ae0+_0xe95a('0x36')+'?'+_0x199711,'body':Object['assign']({},{'active':_0xe95a('0x1a'),'caller_id':_0x3855ab,'assigned_to':_0x41114e['userId'],'short_description':intUtil[_0xe95a('0x37')](_0x3a262d[_0xe95a('0x38')],_0x1b239e,'\x20'),'description':intUtil[_0xe95a('0x37')](_0x3a262d[_0xe95a('0x39')],_0x1b239e,'\x0a')},getCustomFields(_0x3a262d[_0xe95a('0x3a')],_0x1b239e)),'auth':_0x595b60,'json':!![]};return rp(_0x19bdfd)['then'](function(_0x3674e9){logger[_0xe95a('0xe')]('['+[_0x156dea['toUpperCase']()]+_0xe95a('0x3b'),_0x3674e9[_0xe95a('0xa')]);_0x41114e[_0xe95a('0x3c')]=_0x3674e9[_0xe95a('0xa')][_0xe95a('0xd')];_0x41114e['ticketNumber']=_0x3674e9[_0xe95a('0xa')][_0xe95a('0x3d')];logger['info']('['+[_0x156dea['toUpperCase']()]+_0xe95a('0x3e'),_0x41114e);_0x4693b2(_0x41114e);})[_0xe95a('0x11')](function(_0x44f2ee){logger[_0xe95a('0x12')]('['+[_0x156dea['toUpperCase']()]+']',_0x44f2ee['message']);_0x7259ed(_0x44f2ee[_0xe95a('0x13')]);});});};}function createRemoteTag(_0x4b2f43,_0x111700,_0x1ff3f8,_0xdf028c){return new Promise(function(_0x3f846c,_0x893680){var _0x26befe={'method':_0xe95a('0x35'),'uri':_0x1ff3f8+_0xe95a('0x3f')+'?'+_0xdf028c,'body':{'short_description':_0x4b2f43,'global':!![],'active':!![],'name':_0x4b2f43},'auth':_0x111700,'json':!![]};return rp(_0x26befe)[_0xe95a('0x9')](function(_0x10774c){var _0x3db4ef=_0x10774c['result'][_0xe95a('0xd')];_0x3f846c(_0x3db4ef);});});}function getRemoteTag(_0x2cdca8,_0x1bbbc2,_0x3d79b0,_0x4f8568,_0x2ab3e4){return new Promise(function(_0x1238a1,_0x4f85ab){var _0x4e577d={'method':_0xe95a('0x8'),'uri':_0x3d79b0+'label'+_0xe95a('0x40')+_0x2cdca8+'&'+_0x4f8568,'auth':_0x1bbbc2,'json':!![]};return rp(_0x4e577d)[_0xe95a('0x9')](function(_0x5b8155){if(_0x5b8155['result'][_0xe95a('0xb')]>0x0){var _0x42b4c0=_0x5b8155[_0xe95a('0xa')][0x0][_0xe95a('0xd')];_0x1238a1(_0x42b4c0);}else{return createRemoteTag(_0x2cdca8,_0x1bbbc2,_0x3d79b0,_0x4f8568)[_0xe95a('0x9')](function(_0x1c45ab){_0x1238a1(_0x1c45ab);});}});});}function assignTagToIncident(_0x4b0af6,_0x40eb74,_0x46b777,_0x183ed6,_0x3b58cf){return new Promise(function(_0x2e1d53,_0xecea45){var _0x1f9c1b={'method':_0xe95a('0x35'),'uri':_0x46b777+_0xe95a('0x41')+'?'+_0x3b58cf,'body':{'label':_0x4b0af6,'table':'incident','id_type':_0xe95a('0x42'),'table_key':_0x183ed6[_0xe95a('0x3c')],'title':'Incident\x20-\x20'+_0x183ed6[_0xe95a('0x43')],'id_display':_0x183ed6[_0xe95a('0x43')]},'auth':_0x40eb74,'json':!![]};return rp(_0x1f9c1b)[_0xe95a('0x9')](function(_0x18570b){_0x2e1d53();})[_0xe95a('0x11')](function(){_0x2e1d53();});});}function manageTags(_0x18033a,_0x395bf8,_0x1d10b9,_0x18b909,_0x2785c3,_0x2d2d7b,_0x4f3610){return new Promise(function(_0x57310a,_0x4aee40){var _0x292470=[];_0x395bf8[_0xe95a('0x24')](function(_0x4bf221){_0x292470[_0xe95a('0x44')](getRemoteTag(_0x4bf221,_0x1d10b9,_0x18b909,_0x2d2d7b,_0x4f3610));});return Promise[_0xe95a('0x45')](_0x292470)['then'](function(_0x4e1c11){if(_0x4e1c11[_0xe95a('0xb')]){logger[_0xe95a('0xe')]('['+[_0x18033a['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4e1c11);var _0x1d49a7=[];_0x4e1c11['forEach'](function(_0x33652b){_0x1d49a7[_0xe95a('0x44')](assignTagToIncident(_0x33652b,_0x1d10b9,_0x18b909,_0x2785c3,_0x2d2d7b));});return Promise[_0xe95a('0x45')](_0x1d49a7)[_0xe95a('0x9')](function(){_0x57310a();})[_0xe95a('0x11')](function(){_0x57310a();});}else{_0x57310a();}});});}function getTags(_0x1f2e82,_0x975170,_0x55d8a6,_0x8bbf75,_0x1ad97c,_0x11e23){return function(_0x134543){return new Promise(function(_0x4c06d4,_0x55d4eb){var _0xa13c8=[];var _0x4810d2=_0x8bbf75[_0xe95a('0x46')];if(_0x4810d2&&_0x4810d2[_0xe95a('0xb')]>0x0){_0xa13c8=_[_0xe95a('0x47')](_0x4810d2,_0xe95a('0x33'));}if(_0xa13c8[_0xe95a('0xb')]>0x0){return manageTags(_0x1f2e82,_0xa13c8,_0x975170,_0x55d8a6,_0x134543,_0x1ad97c,_0x11e23)['then'](function(){_0x4c06d4(_0x134543);});}else{_0x4c06d4(_0x134543);}});};}function emit(_0x41e184,_0x39ea57,_0x32a8e0){var _0x5de0b3=_0xe95a('0x48')+_0xe95a('0x49')+_0xe95a('0x4a')+_0xe95a('0x4b');var _0x120cd2={'uri':_0x41e184+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x32a8e0+_0x5de0b3};io['to'](util[_0xe95a('0x4c')](_0xe95a('0x4d'),_0x39ea57))['emit']('trigger:browser:url',_0x120cd2);}exports['cs']=function(_0x387a36,_0x2cf99b,_0x3b92ca,_0x128937,_0x531b08,_0x12a8f0,_0x58731f,_0x2bae84){var _0x25a066={};var _0x441220={'user':_0x12a8f0[_0xe95a('0x4e')],'pass':_0x12a8f0['password']};var _0x1f91d1=_0xe95a('0x4f');var _0x2e4aeb='sysparm_display_value=true';_0x12a8f0[_0xe95a('0x50')]=intUtil[_0xe95a('0x51')](_0x12a8f0['remoteUri']);_0x12a8f0['serverUrl']=intUtil['stripTrailingSlash'](_0x12a8f0['serverUrl']);var _0x184c58=util[_0xe95a('0x4c')](_0xe95a('0x52'),_0x12a8f0['remoteUri']);_0x25a066[_0xe95a('0x16')]=!_['isNil'](_0x128937)?_0x128937['email']:null;_0x25a066[_0xe95a('0x1c')]=_0x12a8f0[_0xe95a('0x53')];_0x25a066[_0xe95a('0x20')]=_0x2bae84[_0xe95a('0x2a')]()===_0xe95a('0x34')?_0x2cf99b['destcalleridnum']:_0x2cf99b[_0xe95a('0x54')];_0x25a066['callDirection']=_0x2bae84==='queue'||_0x2bae84==='unmanaged'?_0xe95a('0x55'):_0xe95a('0x34');var _0x17b0e7=util[_0xe95a('0x4c')](_0xe95a('0x56'),_0x12a8f0[_0xe95a('0x57')],_0x2cf99b[_0xe95a('0x58')],md5(_0x2cf99b['uniqueid']));if(_0x531b08&&_0x531b08[_0xe95a('0x59')]){logger[_0xe95a('0xe')](_0xe95a('0x5a'),_0xe95a('0x5b'));_0x2cf99b['recordingURL']=_0x17b0e7;}else if(_0x58731f&&_0x58731f['recordingFormat']&&_0x58731f[_0xe95a('0x5c')]!==_0xe95a('0x5d')){logger[_0xe95a('0xe')](_0xe95a('0x5e'),_0xe95a('0x5b'));_0x2cf99b[_0xe95a('0x5f')]=_0x17b0e7;}else{_0x2cf99b['recordingURL']='';}return getAdminUser(_0x2bae84,_0x441220,_0x25a066,_0x184c58,_0x2e4aeb,_0x1f91d1)[_0xe95a('0x9')](getUser(_0x2bae84,_0x441220,_0x184c58,_0x2e4aeb,_0x1f91d1))[_0xe95a('0x9')](getEndUser(_0x2bae84,_0x441220,_0x184c58,_0x2e4aeb,_0x1f91d1))['then'](getTicket(_0x2bae84,_0x441220,_0x184c58,_0x3b92ca,_0x2cf99b,_0x2e4aeb))['then'](function(_0x2ec531){logger[_0xe95a('0xe')](util['format'](_0xe95a('0x60'),_0x2ec531[_0xe95a('0x3c')]));logger[_0xe95a('0xe')](util['format'](_0xe95a('0x61'),_0x2bae84));if(_0x2bae84!==_0xe95a('0x62')){logger[_0xe95a('0xe')]('['+[_0x2bae84[_0xe95a('0xf')]()]+']',_0xe95a('0x63'));emit(_0x12a8f0['remoteUri'],_0x128937['name'],_0x2ec531[_0xe95a('0x3c')]);}})[_0xe95a('0x11')](function(_0x41d7e6){logger[_0xe95a('0x12')]('['+[_0x2bae84[_0xe95a('0xf')]()]+_0xe95a('0x64'),util['inspect'](_0x41d7e6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcc4e=['sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','nameField','toLowerCase','content','includes','string','idField','customField','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','Incident','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','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','./util','../../../../config/environment','servicenow','defaults','redis','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','POST'];(function(_0x2ace8e,_0x5b7a3d){var _0x19d576=function(_0x184b02){while(--_0x184b02){_0x2ace8e['push'](_0x2ace8e['shift']());}};_0x19d576(++_0x5b7a3d);}(_0xcc4e,0x19d));var _0xecc4=function(_0x4f8cef,_0x511202){_0x4f8cef=_0x4f8cef-0x0;var _0x18d9b8=_0xcc4e[_0x4f8cef];return _0x18d9b8;};'use strict';var _=require(_0xecc4('0x0'));var Promise=require(_0xecc4('0x1'));var rp=require('request-promise');var util=require(_0xecc4('0x2'));var md5=require(_0xecc4('0x3'));var Redis=require('ioredis');var intUtil=require(_0xecc4('0x4'));var config=require(_0xecc4('0x5'));var logger=require('../../../../config/logger')(_0xecc4('0x6'));config['redis']=_[_0xecc4('0x7')](config[_0xecc4('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xecc4('0x9'))(new Redis(config[_0xecc4('0x8')]));function getAdminUser(_0x3883a7,_0x540d68,_0x550b86,_0x562acf,_0x5dce6e,_0x138d8a){return new Promise(function(_0x24fdc6,_0x180d68){var _0x221d6a={'method':'GET','uri':_0x562acf+_0xecc4('0xa')+'&'+_0x5dce6e+'&'+_0x138d8a,'auth':_0x540d68,'json':!![]};return rp(_0x221d6a)['then'](function(_0x228e9e){if(_0x228e9e['result'][_0xecc4('0xb')]>0x0){_0x550b86[_0xecc4('0xc')]=_0x228e9e[_0xecc4('0xd')][0x0][_0xecc4('0xe')];}logger[_0xecc4('0xf')]('['+[_0x3883a7[_0xecc4('0x10')]()]+_0xecc4('0x11'),_0x550b86);_0x24fdc6(_0x550b86);})[_0xecc4('0x12')](function(_0xaa6f0b){logger[_0xecc4('0x13')]('['+[_0x3883a7[_0xecc4('0x10')]()]+']',_0xaa6f0b[_0xecc4('0x14')]);_0x180d68(_0xaa6f0b[_0xecc4('0x14')]);});});}function getUser(_0x5aeb05,_0x1f3cfc,_0x2cb512,_0x20f182,_0x24fffd){return function(_0x4d9d54){logger[_0xecc4('0xf')]('['+[_0x5aeb05[_0xecc4('0x10')]()]+_0xecc4('0x15'),_0x4d9d54);return new Promise(function(_0x5c0314,_0x2eed83){if(intUtil[_0xecc4('0x16')](_0x4d9d54[_0xecc4('0x17')])){var _0x2d10da={'method':_0xecc4('0x18'),'uri':_0x2cb512+_0xecc4('0x19')+_0x4d9d54[_0xecc4('0x17')]+'&'+_0x20f182+'&'+_0x24fffd,'auth':_0x1f3cfc,'json':!![]};logger[_0xecc4('0xf')]('['+[_0x5aeb05[_0xecc4('0x10')]()]+_0xecc4('0x1a'),_0x2d10da);return rp(_0x2d10da)[_0xecc4('0x1b')](function(_0x4e93ee){logger[_0xecc4('0xf')]('['+[_0x5aeb05['toUpperCase']()]+_0xecc4('0x1c'),_0x4e93ee);if(_0x4e93ee[_0xecc4('0xd')][_0xecc4('0xb')]>0x0&&String(_0x4e93ee[_0xecc4('0xd')][0x0][_0xecc4('0x1d')])===_0xecc4('0x1e')){_0x4d9d54[_0xecc4('0x1f')]=_0x4e93ee[_0xecc4('0xd')][0x0][_0xecc4('0xe')];}else{_0x4d9d54[_0xecc4('0x1f')]=_0x4d9d54[_0xecc4('0xc')];_0x4d9d54[_0xecc4('0x17')]=_0x4d9d54[_0xecc4('0x20')];}logger[_0xecc4('0xf')]('['+[_0x5aeb05['toUpperCase']()]+_0xecc4('0x21'),_0x4d9d54);_0x5c0314(_0x4d9d54);})[_0xecc4('0x12')](function(_0x52cced){logger[_0xecc4('0x13')]('['+[_0x5aeb05['toUpperCase']()]+']',_0x52cced[_0xecc4('0x14')]);_0x2eed83(_0x52cced['message']);});}else{logger[_0xecc4('0xf')]('['+[_0x5aeb05[_0xecc4('0x10')]()]+']\x20using\x20admin\x20profile');_0x4d9d54[_0xecc4('0x1f')]=_0x4d9d54[_0xecc4('0xc')];_0x4d9d54[_0xecc4('0x17')]=_0x4d9d54[_0xecc4('0x20')];_0x5c0314(_0x4d9d54);}});};}function createEndUser(_0x580a69,_0x40fc3a,_0x1cdccd,_0x1d12a1,_0x314f5d){logger['info']('['+[_0x580a69[_0xecc4('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x1cdccd);return new Promise(function(_0x1b5c2c,_0x39a92c){var _0x1472ef={'method':_0xecc4('0x22'),'uri':_0x1d12a1+_0xecc4('0x23')+_0x314f5d,'body':{'user_name':_0x1cdccd[_0xecc4('0x24')],'roles':_0xecc4('0x25'),'first_name':_0x1cdccd[_0xecc4('0x24')],'active':_0xecc4('0x1e'),'date_format':_0xecc4('0x26'),'phone':_0x1cdccd[_0xecc4('0x24')]},'auth':_0x40fc3a,'json':!![]};return rp(_0x1472ef)[_0xecc4('0x1b')](function(_0xc41eb3){logger[_0xecc4('0xf')]('['+[_0x580a69[_0xecc4('0x10')]()]+_0xecc4('0x27'),_0xc41eb3['result']);_0x1cdccd['endUserId']=_0xc41eb3[_0xecc4('0xd')][_0xecc4('0xe')];_0x1b5c2c(_0x1cdccd);})[_0xecc4('0x12')](function(_0x4821a3){logger[_0xecc4('0x13')]('['+[_0x580a69[_0xecc4('0x10')]()]+']',_0x4821a3['message']);_0x39a92c(_0x4821a3[_0xecc4('0x14')]);});});}function getEndUser(_0x2ecba3,_0x2108eb,_0x3e4b37,_0x860c97,_0x273902){return function(_0x3f7b9a){logger[_0xecc4('0xf')]('['+[_0x2ecba3[_0xecc4('0x10')]()]+_0xecc4('0x28'),_0x3f7b9a);return new Promise(function(_0x2ab90f,_0x170801){var _0x358214={'method':_0xecc4('0x18'),'uri':_0x3e4b37+_0xecc4('0x29')+_0x3f7b9a[_0xecc4('0x24')]+'&'+_0x860c97+'&'+_0x273902,'auth':_0x2108eb,'json':!![]};return rp(_0x358214)[_0xecc4('0x1b')](function(_0x20e058){if(_0x20e058[_0xecc4('0xd')]['length']>0x0){_0x3f7b9a['endUserId']=_0x20e058[_0xecc4('0xd')][0x0]['sys_id'];logger['info']('['+[_0x2ecba3['toUpperCase']()]+_0xecc4('0x2a'),_0x3f7b9a);_0x2ab90f(_0x3f7b9a);}else{return createEndUser(_0x2ecba3,_0x2108eb,_0x3f7b9a,_0x3e4b37,_0x860c97)[_0xecc4('0x1b')](function(_0x15416c){logger[_0xecc4('0xf')]('['+[_0x2ecba3[_0xecc4('0x10')]()]+_0xecc4('0x2b'),_0x15416c);_0x2ab90f(_0x15416c);});}})[_0xecc4('0x12')](function(_0x2e9c58){logger['error']('['+[_0x2ecba3['toUpperCase']()]+']',_0x2e9c58['message']);_0x170801(_0x2e9c58['message']);});});};}function getCustomFields(_0x22b260,_0x5abd40){var _0xc7e1d3={};if(_0x22b260[_0xecc4('0xb')]>0x0){_[_0xecc4('0x2c')](_0x22b260,function(_0x4a163e){if(_['includes'](['string',_0xecc4('0x2d')],_0x4a163e[_0xecc4('0x2e')])&&_0x4a163e['nameField']&&!_0x4a163e['customField']){_0xc7e1d3[_0x4a163e[_0xecc4('0x2f')][_0xecc4('0x30')]()]=_0x4a163e[_0xecc4('0x31')]['toString']();}else if(_[_0xecc4('0x32')]([_0xecc4('0x33'),'picklist'],_0x4a163e[_0xecc4('0x2e')])&&_0x4a163e[_0xecc4('0x34')]&&_0x4a163e[_0xecc4('0x35')]){_0xc7e1d3[_0x4a163e['idField'][_0xecc4('0x30')]()]=_0x4a163e['content'][_0xecc4('0x36')]();}else if(_0x4a163e[_0xecc4('0x2e')]==='variable'&&_0x4a163e[_0xecc4('0x37')]&&_0x4a163e[_0xecc4('0x34')]&&_0x4a163e['customField']){_0xc7e1d3[_0x4a163e['idField'][_0xecc4('0x30')]()]=_0x5abd40[_0x4a163e[_0xecc4('0x37')]][_0xecc4('0x36')]();}else if(_0x4a163e[_0xecc4('0x2e')]===_0xecc4('0x38')&&_0x4a163e[_0xecc4('0x39')]&&_0x4a163e['Variable'][_0xecc4('0x3a')]&&_0x4a163e['idField']&&_0x4a163e[_0xecc4('0x35')]){_0xc7e1d3[_0x4a163e[_0xecc4('0x34')][_0xecc4('0x30')]()]=_0x5abd40[_0x4a163e[_0xecc4('0x39')][_0xecc4('0x3a')][_0xecc4('0x30')]()][_0xecc4('0x36')]();}});}return _0xc7e1d3;}function getTicket(_0x413ee7,_0x2dbaa3,_0x4b0b30,_0x3e06fa,_0x193c2f,_0x998b68){return function(_0x20017d){logger['info']('['+[_0x413ee7[_0xecc4('0x10')]()]+_0xecc4('0x3b'),_0x20017d);return new Promise(function(_0x5b6b3d,_0x1b441f){var _0x3bf075=_0x413ee7['toLowerCase']()===_0xecc4('0x3c')?_0x20017d[_0xecc4('0x1f')]:_0x20017d[_0xecc4('0x3d')];var _0x46007e={'method':_0xecc4('0x22'),'uri':_0x4b0b30+_0xecc4('0x3e')+'?'+_0x998b68,'body':Object[_0xecc4('0x3f')]({},{'active':_0xecc4('0x1e'),'caller_id':_0x3bf075,'assigned_to':_0x20017d['userId'],'short_description':intUtil[_0xecc4('0x40')](_0x3e06fa[_0xecc4('0x41')],_0x193c2f,'\x20'),'description':intUtil[_0xecc4('0x40')](_0x3e06fa['Descriptions'],_0x193c2f,'\x0a')},getCustomFields(_0x3e06fa[_0xecc4('0x42')],_0x193c2f)),'auth':_0x2dbaa3,'json':!![]};return rp(_0x46007e)['then'](function(_0x19e8ca){logger[_0xecc4('0xf')]('['+[_0x413ee7['toUpperCase']()]+_0xecc4('0x43'),_0x19e8ca[_0xecc4('0xd')]);_0x20017d[_0xecc4('0x44')]=_0x19e8ca[_0xecc4('0xd')][_0xecc4('0xe')];_0x20017d[_0xecc4('0x45')]=_0x19e8ca[_0xecc4('0xd')]['number'];logger[_0xecc4('0xf')]('['+[_0x413ee7[_0xecc4('0x10')]()]+']\x20getTicket\x20crm',_0x20017d);_0x5b6b3d(_0x20017d);})[_0xecc4('0x12')](function(_0x1090a9){logger[_0xecc4('0x13')]('['+[_0x413ee7['toUpperCase']()]+']',_0x1090a9[_0xecc4('0x14')]);_0x1b441f(_0x1090a9['message']);});});};}function createRemoteTag(_0x4d1a16,_0x18aa81,_0x2ebd25,_0x132ee9){return new Promise(function(_0x8489ae,_0x14ea40){var _0x30db59={'method':_0xecc4('0x22'),'uri':_0x2ebd25+_0xecc4('0x46')+'?'+_0x132ee9,'body':{'short_description':_0x4d1a16,'global':!![],'active':!![],'name':_0x4d1a16},'auth':_0x18aa81,'json':!![]};return rp(_0x30db59)[_0xecc4('0x1b')](function(_0xd167c5){var _0x3c1c19=_0xd167c5[_0xecc4('0xd')]['sys_id'];_0x8489ae(_0x3c1c19);});});}function getRemoteTag(_0x1f0b25,_0x1b908a,_0x30cdca,_0x33bcd5,_0x497044){return new Promise(function(_0x3aeb1,_0x27729e){var _0x23051e={'method':'GET','uri':_0x30cdca+'label'+'?sysparm_query=name%3D'+_0x1f0b25+'&'+_0x33bcd5,'auth':_0x1b908a,'json':!![]};return rp(_0x23051e)[_0xecc4('0x1b')](function(_0x3ed77a){if(_0x3ed77a[_0xecc4('0xd')][_0xecc4('0xb')]>0x0){var _0x2cb217=_0x3ed77a[_0xecc4('0xd')][0x0][_0xecc4('0xe')];_0x3aeb1(_0x2cb217);}else{return createRemoteTag(_0x1f0b25,_0x1b908a,_0x30cdca,_0x33bcd5)['then'](function(_0x20ad26){_0x3aeb1(_0x20ad26);});}});});}function assignTagToIncident(_0xcdfba4,_0x189343,_0x149b8d,_0x135a29,_0x5b7f77){return new Promise(function(_0x1c730f,_0x196403){var _0x2832e5={'method':'POST','uri':_0x149b8d+'label_entry'+'?'+_0x5b7f77,'body':{'label':_0xcdfba4,'table':'incident','id_type':_0xecc4('0x47'),'table_key':_0x135a29[_0xecc4('0x44')],'title':_0xecc4('0x48')+_0x135a29[_0xecc4('0x45')],'id_display':_0x135a29['ticketNumber']},'auth':_0x189343,'json':!![]};return rp(_0x2832e5)[_0xecc4('0x1b')](function(_0x78ed9){_0x1c730f();})[_0xecc4('0x12')](function(){_0x1c730f();});});}function manageTags(_0x3e70fd,_0x2af038,_0x5fd21,_0x304c5e,_0x42acbf,_0x22e109,_0x3db0de){return new Promise(function(_0x4652ce,_0x556349){var _0xc41bf2=[];_0x2af038[_0xecc4('0x2c')](function(_0x235dac){_0xc41bf2[_0xecc4('0x49')](getRemoteTag(_0x235dac,_0x5fd21,_0x304c5e,_0x22e109,_0x3db0de));});return Promise[_0xecc4('0x4a')](_0xc41bf2)[_0xecc4('0x1b')](function(_0x16b648){if(_0x16b648[_0xecc4('0xb')]){logger[_0xecc4('0xf')]('['+[_0x3e70fd[_0xecc4('0x10')]()]+_0xecc4('0x4b'),_0x16b648);var _0x1958f9=[];_0x16b648[_0xecc4('0x2c')](function(_0x3000e5){_0x1958f9[_0xecc4('0x49')](assignTagToIncident(_0x3000e5,_0x5fd21,_0x304c5e,_0x42acbf,_0x22e109));});return Promise['all'](_0x1958f9)[_0xecc4('0x1b')](function(){_0x4652ce();})[_0xecc4('0x12')](function(){_0x4652ce();});}else{_0x4652ce();}});});}function getTags(_0x324233,_0xef90f9,_0x58dd00,_0x5c319a,_0x10e105,_0x2c6d5b){return function(_0x43d060){return new Promise(function(_0x561e53,_0x54a559){var _0x145a77=[];var _0x59e9ec=_0x5c319a[_0xecc4('0x4c')];if(_0x59e9ec&&_0x59e9ec[_0xecc4('0xb')]>0x0){_0x145a77=_[_0xecc4('0x4d')](_0x59e9ec,_0xecc4('0x3a'));}if(_0x145a77['length']>0x0){return manageTags(_0x324233,_0x145a77,_0xef90f9,_0x58dd00,_0x43d060,_0x10e105,_0x2c6d5b)[_0xecc4('0x1b')](function(){_0x561e53(_0x43d060);});}else{_0x561e53(_0x43d060);}});};}function emit(_0x34151f,_0x4a9f7e,_0x2ba512){var _0x244036=_0xecc4('0x4e')+_0xecc4('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xecc4('0x50');var _0x8d40e2={'uri':_0x34151f+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2ba512+_0x244036};io['to'](util[_0xecc4('0x51')](_0xecc4('0x52'),_0x4a9f7e))[_0xecc4('0x53')]('trigger:browser:url',_0x8d40e2);}exports['cs']=function(_0x185f7f,_0x5f58c8,_0x220767,_0x2b229b,_0x524fc9,_0x47c027,_0x18be59,_0x4122f5){var _0x36e255={};var _0x269e03={'user':_0x47c027[_0xecc4('0x54')],'pass':_0x47c027[_0xecc4('0x55')]};var _0x936c17=_0xecc4('0x56');var _0x1a694b=_0xecc4('0x57');_0x47c027[_0xecc4('0x58')]=intUtil[_0xecc4('0x59')](_0x47c027[_0xecc4('0x58')]);_0x47c027[_0xecc4('0x5a')]=intUtil[_0xecc4('0x59')](_0x47c027[_0xecc4('0x5a')]);var _0x458bb5=util[_0xecc4('0x51')]('%s/api/now/table/',_0x47c027['remoteUri']);_0x36e255['userEmail']=!_[_0xecc4('0x5b')](_0x2b229b)?_0x2b229b[_0xecc4('0x5c')]:null;_0x36e255['adminEmail']=_0x47c027['email'];_0x36e255[_0xecc4('0x24')]=_0x4122f5['toLowerCase']()===_0xecc4('0x3c')?_0x5f58c8[_0xecc4('0x5d')]:_0x5f58c8[_0xecc4('0x5e')];_0x36e255[_0xecc4('0x5f')]=_0x4122f5===_0xecc4('0x60')||_0x4122f5===_0xecc4('0x61')?_0xecc4('0x60'):'outbound';var _0x394fe7=util[_0xecc4('0x51')](_0xecc4('0x62'),_0x47c027[_0xecc4('0x5a')],_0x5f58c8[_0xecc4('0x63')],md5(_0x5f58c8[_0xecc4('0x63')]));if(_0x524fc9&&_0x524fc9[_0xecc4('0x64')]){logger[_0xecc4('0xf')](_0xecc4('0x65'),_0xecc4('0x66'));_0x5f58c8['recordingURL']=_0x394fe7;}else if(_0x18be59&&_0x18be59[_0xecc4('0x67')]&&_0x18be59[_0xecc4('0x67')]!==_0xecc4('0x68')){logger[_0xecc4('0xf')](_0xecc4('0x69'),_0xecc4('0x66'));_0x5f58c8[_0xecc4('0x6a')]=_0x394fe7;}else{_0x5f58c8[_0xecc4('0x6a')]='';}return getAdminUser(_0x4122f5,_0x269e03,_0x36e255,_0x458bb5,_0x1a694b,_0x936c17)['then'](getUser(_0x4122f5,_0x269e03,_0x458bb5,_0x1a694b,_0x936c17))[_0xecc4('0x1b')](getEndUser(_0x4122f5,_0x269e03,_0x458bb5,_0x1a694b,_0x936c17))[_0xecc4('0x1b')](getTicket(_0x4122f5,_0x269e03,_0x458bb5,_0x220767,_0x5f58c8,_0x1a694b))[_0xecc4('0x1b')](function(_0x3fe0d7){logger[_0xecc4('0xf')](util['format'](_0xecc4('0x6b'),_0x3fe0d7[_0xecc4('0x44')]));logger[_0xecc4('0xf')](util[_0xecc4('0x51')](_0xecc4('0x6c'),_0x4122f5));if(_0x4122f5!=='unmanaged'){logger[_0xecc4('0xf')]('['+[_0x4122f5[_0xecc4('0x10')]()]+']',_0xecc4('0x6d'));emit(_0x47c027[_0xecc4('0x58')],_0x2b229b[_0xecc4('0x3a')],_0x3fe0d7[_0xecc4('0x44')]);}})[_0xecc4('0x12')](function(_0x373ea5){logger['error']('['+[_0x4122f5[_0xecc4('0x10')]()]+_0xecc4('0x6e'),util[_0xecc4('0x6f')](_0x373ea5,{'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 5b35a11..0c62a87 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 _0xe038=['Searching\x20enduser\x20with\x20phone','find','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','debug','[HTTP]','length','type','nameField','customField','custom_fields','idField','content','toString','variable','customVariable','Variable','toLowerCase','login','username','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','users','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','lastevent','toUpperCase','calleridname','Inbound','Ticket\x20created!','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','parent_name','name','direction','forEach','variableName','push','set_entry','JSON','stringify','format','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','value','name_value_list','resolve','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!'];(function(_0x2592c5,_0x36fe86){var _0x5f4989=function(_0xf281ef){while(--_0xf281ef){_0x2592c5['push'](_0x2592c5['shift']());}};_0x5f4989(++_0x36fe86);}(_0xe038,0x1a6));var _0x8e03=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe038[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x8e03('0x0'));var rp=require(_0x8e03('0x1'));var BPromise=require(_0x8e03('0x2'));var md5=require(_0x8e03('0x3'));var util=require(_0x8e03('0x4'));var Redis=require(_0x8e03('0x5'));var intUtil=require(_0x8e03('0x6'));var config=require('../../../../config/environment');var logger=require(_0x8e03('0x7'))(_0x8e03('0x8'));config['redis']=_[_0x8e03('0x9')](config['redis'],{'host':_0x8e03('0xa'),'port':0x18eb});var io=require(_0x8e03('0xb'))(new Redis(config[_0x8e03('0xc')]));var def={'method':_0x8e03('0xd'),'json':!![]};function emit(_0x5ecfea,_0x30b017,_0x360fd7){io['to'](_0x5ecfea)[_0x8e03('0xe')](_0x30b017,_0x360fd7);}function getTicket(_0x506a82,_0x2f68f8,_0x1daff4,_0x566b26,_0x259ea2,_0x5ac0cc,_0x501a01,_0x2b988c){logger[_0x8e03('0xf')](_0x8e03('0x10'));var _0x580985=new Date();var _0x3c1183=[{'name':'name','value':intUtil['getString'](_0x566b26[_0x8e03('0x11')],_0x259ea2,'\x20')},{'name':_0x8e03('0x12'),'value':_0x2f68f8['id']},{'name':'created_by','value':_0x2f68f8['id']},{'name':_0x8e03('0x13'),'value':intUtil[_0x8e03('0x14')](_0x566b26[_0x8e03('0x15')],_0x259ea2,'\x0a')},{'name':_0x8e03('0x16'),'value':_0x580985[_0x8e03('0x17')]()[_0x8e03('0x18')](0x0,0x13)[_0x8e03('0x19')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x8e03('0x1a'),'value':'15'},{'name':_0x8e03('0x1b'),'value':_0x1daff4['id']},{'name':'parent_type','value':_0x8e03('0x1c')},{'name':_0x8e03('0x1d'),'value':_0x1daff4[_0x8e03('0x1e')]},{'name':_0x8e03('0x1f'),'value':_0x2b988c}];if(_0x5ac0cc['length']){_[_0x8e03('0x20')](_0x5ac0cc,function(_0x3a3725){if(_0x259ea2[_0x3a3725[_0x8e03('0x21')]]){_0x3c1183[_0x8e03('0x22')]({'name':_0x3a3725['idField'],'value':_0x259ea2[_0x3a3725[_0x8e03('0x21')]]});}});}return request({'form':{'method':_0x8e03('0x23'),'input_type':_0x8e03('0x24'),'response_type':_0x8e03('0x24'),'rest_data':JSON[_0x8e03('0x25')]({'session':_0x501a01['id'],'module_name':'Calls','name_value_list':_0x3c1183})}});}function getAuth(_0x345e95){return util[_0x8e03('0x26')]('Basic\x20%s',new Buffer(_0x345e95['apiKey']+':X')['toString'](_0x8e03('0x27')));}function getServerInfo(_0x459140){return request({'form':{'method':_0x8e03('0x28'),'input_type':'JSON','response_type':_0x8e03('0x24'),'rest_data':JSON[_0x8e03('0x25')]({'session':_0x459140['id']})}});}function getUser(_0x3c5e51,_0x5bfea2,_0x48c73b){if(!_[_0x8e03('0x29')](_0x5bfea2)){logger[_0x8e03('0xf')](_0x8e03('0x2a'),_0x5bfea2);return request({'form':{'method':_0x8e03('0x2b'),'input_type':_0x8e03('0x24'),'response_type':_0x8e03('0x24'),'rest_data':JSON[_0x8e03('0x25')]({'session':_0x48c73b['id'],'module_name':_0x8e03('0x2c'),'query':util[_0x8e03('0x26')](_0x8e03('0x2d'),_0x5bfea2),'order_by':'','offset':'0','select_fields':['id',_0x8e03('0x1e'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8e03('0x2e')](function(_0x5387d2){if(_0x5387d2['entry_list']['length']){var _0x652233=_['find'](_0x5387d2[_0x8e03('0x2f')],function(_0x3bd4e5){return _0x3bd4e5['name_value_list']['user_name'][_0x8e03('0x30')]===_0x5bfea2;});if(_0x652233){logger[_0x8e03('0xf')]('Agent\x20found!');return BPromise['resolve']({'id':_0x652233[_0x8e03('0x31')]['id'][_0x8e03('0x30')],'name':_0x652233[_0x8e03('0x31')][_0x8e03('0x1e')]['value']});}}logger[_0x8e03('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x8e03('0x32')]({'id':_0x48c73b[_0x8e03('0x31')][_0x8e03('0x33')][_0x8e03('0x30')],'name':_0x48c73b['name_value_list'][_0x8e03('0x34')][_0x8e03('0x30')]});});}else{logger[_0x8e03('0xf')](_0x8e03('0x35'));return BPromise[_0x8e03('0x32')]({'id':_0x48c73b[_0x8e03('0x31')][_0x8e03('0x33')][_0x8e03('0x30')],'name':_0x48c73b[_0x8e03('0x31')]['user_name'][_0x8e03('0x30')]});}}function getEndUser(_0x4bc97f,_0x1b7e31,_0x47b57b,_0x57c994){logger[_0x8e03('0xf')](_0x8e03('0x36'),_0x47b57b);return request({'form':{'method':'get_entry_list','input_type':_0x8e03('0x24'),'response_type':_0x8e03('0x24'),'rest_data':JSON['stringify']({'session':_0x57c994['id'],'module_name':_0x8e03('0x1c'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x47b57b),'order_by':'','offset':'0','select_fields':['id',_0x8e03('0x1e'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8e03('0x2e')](function(_0x249f95){if(_0x249f95['entry_list']['length']){var _0x2317b3=_[_0x8e03('0x37')](_0x249f95[_0x8e03('0x2f')],function(_0x2b8f0c){return _0x2b8f0c[_0x8e03('0x31')][_0x8e03('0x38')][_0x8e03('0x30')]===_0x47b57b;});if(_0x2317b3){logger[_0x8e03('0xf')](_0x8e03('0x39'));return BPromise[_0x8e03('0x32')]({'id':_0x2317b3[_0x8e03('0x31')]['id'][_0x8e03('0x30')],'name':_0x2317b3[_0x8e03('0x31')][_0x8e03('0x1e')][_0x8e03('0x30')],'phone':_0x2317b3[_0x8e03('0x31')][_0x8e03('0x38')]['value']});}}else{logger[_0x8e03('0xf')](_0x8e03('0x3a'));return request({'form':{'method':'set_entry','input_type':_0x8e03('0x24'),'response_type':'JSON','rest_data':JSON[_0x8e03('0x25')]({'session':_0x57c994['id'],'module_name':'Contacts','name_value_list':[{'name':_0x8e03('0x3b'),'value':_0x1b7e31!==''?_0x1b7e31:util[_0x8e03('0x26')]('Caller\x20-\x20%s',_0x47b57b)},{'name':'phone_home','value':_0x47b57b}]})}})[_0x8e03('0x2e')](function(_0x565657){logger[_0x8e03('0xf')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x565657['id'],'name':_0x565657['entry_list'][_0x8e03('0x3b')][_0x8e03('0x30')],'phone':_0x565657['entry_list'][_0x8e03('0x38')][_0x8e03('0x30')]});});}});}function request(_0x2ae622){logger[_0x8e03('0x3c')](_0x8e03('0x3d'),JSON[_0x8e03('0x25')](_0x2ae622));return rp(_['merge'](def,_0x2ae622));}function getTags(_0x512f82,_0x3201bf){var _0x3ccec6=[];if(_0x512f82&&_0x512f82[_0x8e03('0x3e')]>0x0){_0x3ccec6=_['map'](_0x512f82,_0x3201bf);}return _0x3ccec6;}function getCustomFields(_0x385b4c,_0x439c9a){var _0x3973b4=[];var _0x4ddd04={'custom_fields':[]};if(_0x385b4c[_0x8e03('0x3e')]>0x0){_['forEach'](_0x385b4c,function(_0x2c1435){if(_0x2c1435[_0x8e03('0x3f')]==='string'&&_0x2c1435[_0x8e03('0x40')]&&!_0x2c1435[_0x8e03('0x41')]){_0x4ddd04[_0x2c1435[_0x8e03('0x40')]['toLowerCase']()]=_0x2c1435['content']['toString']();}else if(_0x2c1435[_0x8e03('0x3f')]==='string'&&_0x2c1435['idField']&&_0x2c1435['customField']){_0x4ddd04[_0x8e03('0x42')]['push']({'id':_0x2c1435[_0x8e03('0x43')],'value':_0x2c1435[_0x8e03('0x44')][_0x8e03('0x45')]()});}else if(_0x2c1435['type']===_0x8e03('0x46')&&_0x2c1435['variableName']&&_0x2c1435[_0x8e03('0x43')]&&_0x2c1435[_0x8e03('0x41')]){_0x439c9a[_0x2c1435[_0x8e03('0x21')]]&&_0x4ddd04['custom_fields'][_0x8e03('0x22')]({'id':_0x2c1435[_0x8e03('0x43')],'value':_0x439c9a[_0x2c1435[_0x8e03('0x21')]]['toString']()});}else if(_0x2c1435[_0x8e03('0x3f')]===_0x8e03('0x47')&&_0x2c1435[_0x8e03('0x48')]&&_0x2c1435[_0x8e03('0x48')][_0x8e03('0x1e')]&&_0x2c1435[_0x8e03('0x43')]&&_0x2c1435['customField']){_0x439c9a[_0x2c1435[_0x8e03('0x48')]['name'][_0x8e03('0x49')]()]&&_0x4ddd04[_0x8e03('0x42')][_0x8e03('0x22')]({'id':_0x2c1435[_0x8e03('0x43')],'value':_0x439c9a[_0x2c1435[_0x8e03('0x48')][_0x8e03('0x1e')][_0x8e03('0x49')]()][_0x8e03('0x45')]()});}});}return _0x4ddd04;}function getConnection(_0x587849){return request({'method':_0x8e03('0xd'),'form':{'method':_0x8e03('0x4a'),'input_type':_0x8e03('0x24'),'response_type':_0x8e03('0x24'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x587849[_0x8e03('0x4b')],'password':_0x587849['password'],'encryption':_0x8e03('0x4c')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8e03('0x2e')](function(_0x4f4a86){var _0x49685b=_0x4f4a86;if(_0x49685b['id']){def[_0x8e03('0x4d')]=_0x49685b['id'];return BPromise['resolve'](_0x49685b);}else{throw new Error(util['format'](_0x8e03('0x4e'),_0x587849['id']));}});}function setRelationship(_0x35bee6,_0x419143,_0x4a144f,_0x5bd040){return request({'form':{'method':_0x8e03('0x4f'),'input_type':_0x8e03('0x24'),'response_type':_0x8e03('0x24'),'rest_data':JSON[_0x8e03('0x25')]({'session':_0x35bee6['id'],'module_name':_0x8e03('0x50'),'module_id':_0x4a144f['id'],'link_field_name':_0x5bd040,'related_ids':[_0x419143['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8e03('0x51')]=function(_0x2112c0,_0x1f9ae1,_0x68e657,_0x160406,_0x9b02cf,_0x4ec0fc){var _0x514fa9,_0x841e6b,_0x1b2f3c,_0x354ed7;_0x4ec0fc[_0x8e03('0x52')]=intUtil[_0x8e03('0x53')](_0x4ec0fc[_0x8e03('0x52')]);_0x4ec0fc[_0x8e03('0x54')]=intUtil[_0x8e03('0x53')](_0x4ec0fc[_0x8e03('0x54')]);def['uri']=util['format'](_0x8e03('0x55'),_0x4ec0fc['remoteUri']);if(_0x9b02cf&&_0x9b02cf[_0x8e03('0x56')]){logger['info'](_0x8e03('0x57'),_0x8e03('0x58'));_0x1f9ae1[_0x8e03('0x59')]=util[_0x8e03('0x26')](_0x8e03('0x5a'),_0x4ec0fc['serverUrl'],_0x1f9ae1[_0x8e03('0x5b')],md5(_0x1f9ae1[_0x8e03('0x5b')]));}else{_0x1f9ae1['recordingURL']='';}return getConnection(_0x4ec0fc)[_0x8e03('0x2e')](function(_0x3d3162){_0x354ed7=_0x3d3162;return getUser(_0x4ec0fc,_0x160406[_0x8e03('0x1e')],_0x354ed7);})['then'](function(_0x517382){_0x514fa9=_0x517382;logger[_0x8e03('0xf')]('The\x20User\x20ID\x20is:',_0x514fa9['id']);return getEndUser(_0x4ec0fc,_0x1f9ae1['calleridname'],_0x1f9ae1[_0x8e03('0x5c')],_0x354ed7);})[_0x8e03('0x2e')](function(_0xdf3eda){_0x841e6b=_0xdf3eda;logger[_0x8e03('0xf')](_0x8e03('0x5d'),_0x841e6b['id']);return getTicket(_0x4ec0fc,_0x514fa9,_0x841e6b,_0x68e657,_0x1f9ae1,_0x68e657[_0x8e03('0x5e')],_0x354ed7,'Inbound');})[_0x8e03('0x2e')](function(_0x233078){_0x1b2f3c=_0x233078;logger[_0x8e03('0xf')]('Ticket\x20created!');logger[_0x8e03('0xf')](_0x8e03('0x5f'),_0x1b2f3c['id']);return setRelationship(_0x354ed7,_0x514fa9,_0x1b2f3c,_0x8e03('0x60'));})['then'](function(){return setRelationship(_0x354ed7,_0x841e6b,_0x1b2f3c,'contacts');})[_0x8e03('0x2e')](function(){return getServerInfo(_0x354ed7);})[_0x8e03('0x2e')](function(_0x2558cf){var _0x15cc91=parseInt(_0x2558cf['version'][_0x8e03('0x61')](0x0));var _0x1a486f=util[_0x8e03('0x26')](_0x8e03('0x62'),_0x4ec0fc[_0x8e03('0x52')],_0x1b2f3c['id']);if(_0x15cc91>0x6){_0x1a486f=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4ec0fc['remoteUri'],_0x1b2f3c['id']);}logger[_0x8e03('0xf')](_0x8e03('0x57'),_0x8e03('0x63'));emit(util[_0x8e03('0x26')]('user:%s',_0x160406[_0x8e03('0x1e')]),_0x8e03('0x64'),{'uri':_0x1a486f});})[_0x8e03('0x65')](function(_0x510779){logger[_0x8e03('0x66')]('[QUEUE]',JSON[_0x8e03('0x25')](_0x510779));});};exports[_0x8e03('0x67')]=function(_0x43173e,_0x1f1f37,_0x38a507,_0x27ccb1,_0xc0f0aa,_0x3f171a,_0x365783){var _0x44ae7b,_0x428188,_0x2c42ef,_0x56f0cf;_0x3f171a[_0x8e03('0x52')]=intUtil[_0x8e03('0x53')](_0x3f171a['remoteUri']);_0x3f171a[_0x8e03('0x54')]=intUtil['stripTrailingSlash'](_0x3f171a[_0x8e03('0x54')]);def[_0x8e03('0x68')]=util[_0x8e03('0x26')]('%s/service/v4_1/rest.php',_0x3f171a[_0x8e03('0x52')]);if(_0x365783&&_0x365783[_0x8e03('0x69')]&&_0x365783[_0x8e03('0x69')]!==_0x8e03('0x6a')){logger[_0x8e03('0xf')](_0x8e03('0x6b'),_0x8e03('0x58'));_0x1f1f37['recordingURL']=util[_0x8e03('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f171a[_0x8e03('0x54')],_0x1f1f37['uniqueid'],md5(_0x1f1f37[_0x8e03('0x5b')]));}return getConnection(_0x3f171a)[_0x8e03('0x2e')](function(_0x194cf7){_0x56f0cf=_0x194cf7;return getUser(_0x3f171a,_0x27ccb1[_0x8e03('0x1e')],_0x56f0cf);})[_0x8e03('0x2e')](function(_0x2297e9){_0x44ae7b=_0x2297e9;logger['info'](_0x8e03('0x6c'),_0x44ae7b['id']);return getEndUser(_0x3f171a,_0x1f1f37['destcalleridname'],_0x1f1f37[_0x8e03('0x6d')],_0x56f0cf);})['then'](function(_0x331e27){_0x428188=_0x331e27;logger[_0x8e03('0xf')]('The\x20Enduser\x20ID\x20is:',_0x428188['id']);return getTicket(_0x3f171a,_0x44ae7b,_0x428188,_0x38a507,_0x1f1f37,_0x38a507['Fields'],_0x56f0cf,'Outbound');})[_0x8e03('0x2e')](function(_0x19f387){_0x2c42ef=_0x19f387;logger[_0x8e03('0xf')]('Ticket\x20created!');logger[_0x8e03('0xf')]('The\x20Ticket\x20ID\x20is:',_0x2c42ef['id']);return setRelationship(_0x56f0cf,_0x44ae7b,_0x2c42ef,_0x8e03('0x60'));})[_0x8e03('0x2e')](function(){return setRelationship(_0x56f0cf,_0x428188,_0x2c42ef,_0x8e03('0x6e'));})[_0x8e03('0x2e')](function(){return getServerInfo(_0x56f0cf);})[_0x8e03('0x2e')](function(_0x115cde){var _0x1af5e3=parseInt(_0x115cde[_0x8e03('0x6f')]['charAt'](0x0));var _0x1bc7a5=util['format'](_0x8e03('0x62'),_0x3f171a['remoteUri'],_0x2c42ef['id']);if(_0x1af5e3>0x6){_0x1bc7a5=util[_0x8e03('0x26')](_0x8e03('0x70'),_0x3f171a[_0x8e03('0x52')],_0x2c42ef['id']);}logger[_0x8e03('0xf')]('[OUTBOUND]',_0x8e03('0x63'));emit(util['format'](_0x8e03('0x71'),_0x27ccb1[_0x8e03('0x1e')]),'trigger:browser:url',{'uri':_0x1bc7a5});})[_0x8e03('0x65')](function(_0xea63be){logger[_0x8e03('0x66')](_0x8e03('0x6b'),JSON['stringify'](_0xea63be));});};exports['unmanaged']=function(_0x572fd2,_0x27666c,_0x38320a,_0xc49b74,_0x30727a,_0x278614){var _0x56b922,_0x1e1136,_0x37fec5,_0x5763cf;_0x278614['remoteUri']=intUtil[_0x8e03('0x53')](_0x278614[_0x8e03('0x52')]);_0x278614['serverUrl']=intUtil['stripTrailingSlash'](_0x278614[_0x8e03('0x54')]);def[_0x8e03('0x68')]=util['format'](_0x8e03('0x55'),_0x278614[_0x8e03('0x52')]);if(_0x30727a&&_0x30727a[_0x8e03('0x56')]){logger[_0x8e03('0xf')]('['+_0x27666c[_0x8e03('0x72')][_0x8e03('0x73')]()+']',_0x8e03('0x58'));_0x27666c[_0x8e03('0x59')]=util['format'](_0x8e03('0x5a'),_0x278614[_0x8e03('0x54')],_0x27666c[_0x8e03('0x5b')],md5(_0x27666c[_0x8e03('0x5b')]));}else{_0x27666c['recordingURL']='';}return getConnection(_0x278614)[_0x8e03('0x2e')](function(_0x15d71f){_0x5763cf=_0x15d71f;if(!_[_0x8e03('0x29')](_0xc49b74)){return getUser(_0x278614,_0xc49b74[_0x8e03('0x1e')],_0x5763cf);}else{return getUser(_0x278614,null,_0x5763cf);}})[_0x8e03('0x2e')](function(_0x49d3d8){_0x56b922=_0x49d3d8;logger[_0x8e03('0xf')](_0x8e03('0x6c'),_0x56b922['id']);return getEndUser(_0x278614,_0x27666c[_0x8e03('0x74')],_0x27666c['calleridnum'],_0x5763cf);})['then'](function(_0x334fcf){_0x1e1136=_0x334fcf;logger['info'](_0x8e03('0x5d'),_0x1e1136['id']);return getTicket(_0x278614,_0x56b922,_0x1e1136,_0x38320a,_0x27666c,_0x38320a[_0x8e03('0x5e')],_0x5763cf,_0x8e03('0x75'));})[_0x8e03('0x2e')](function(_0x1f4601){_0x37fec5=_0x1f4601;logger['info'](_0x8e03('0x76'));logger['info'](_0x8e03('0x5f'),_0x37fec5['id']);return setRelationship(_0x5763cf,_0x56b922,_0x37fec5,_0x8e03('0x60'));})[_0x8e03('0x2e')](function(){return setRelationship(_0x5763cf,_0x1e1136,_0x37fec5,'contacts');})[_0x8e03('0x2e')](function(){return getServerInfo(_0x5763cf);})['catch'](function(_0x3f07d0){logger[_0x8e03('0x66')]('['+_0x27666c['lastevent'][_0x8e03('0x73')]()+']',JSON[_0x8e03('0x25')](_0x3f07d0));});}; \ No newline at end of file +var _0x2939=['parent_id','Contacts','parent_name','name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','Basic\x20%s','toString','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','length','find','entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','','Enduser\x20created.','[HTTP]','map','type','nameField','customField','toLowerCase','content','string','variable','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','then','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','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','[QUEUE]','user:%s','catch','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','recordingURL','uniqueid','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','lastevent','toUpperCase','lodash','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','socket.io-emitter','redis','POST','emit','Subjects','assigned_user_id','description','getString','Descriptions','date_start','duration_minutes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2939,0x1b1));var _0x9293=function(_0x446098,_0x33eb6c){_0x446098=_0x446098-0x0;var _0x3c7a2c=_0x2939[_0x446098];return _0x3c7a2c;};'use strict';var _=require(_0x9293('0x0'));var rp=require('request-promise');var BPromise=require(_0x9293('0x1'));var md5=require(_0x9293('0x2'));var util=require(_0x9293('0x3'));var Redis=require(_0x9293('0x4'));var intUtil=require(_0x9293('0x5'));var config=require('../../../../config/environment');var logger=require(_0x9293('0x6'))(_0x9293('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9293('0x8'))(new Redis(config[_0x9293('0x9')]));var def={'method':_0x9293('0xa'),'json':!![]};function emit(_0x479b4c,_0xa4beee,_0x6b823f){io['to'](_0x479b4c)[_0x9293('0xb')](_0xa4beee,_0x6b823f);}function getTicket(_0x210d78,_0x534bf2,_0xd550c3,_0x436954,_0x2a9ce1,_0x5b58bf,_0x5c0d80,_0x5e603e){logger['info']('Creating\x20new\x20ticket...');var _0x374020=new Date();var _0x5aef6f=[{'name':'name','value':intUtil['getString'](_0x436954[_0x9293('0xc')],_0x2a9ce1,'\x20')},{'name':_0x9293('0xd'),'value':_0x534bf2['id']},{'name':'created_by','value':_0x534bf2['id']},{'name':_0x9293('0xe'),'value':intUtil[_0x9293('0xf')](_0x436954[_0x9293('0x10')],_0x2a9ce1,'\x0a')},{'name':_0x9293('0x11'),'value':_0x374020['toISOString']()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x9293('0x12'),'value':'15'},{'name':_0x9293('0x13'),'value':_0xd550c3['id']},{'name':'parent_type','value':_0x9293('0x14')},{'name':_0x9293('0x15'),'value':_0xd550c3[_0x9293('0x16')]},{'name':_0x9293('0x17'),'value':_0x5e603e}];if(_0x5b58bf['length']){_[_0x9293('0x18')](_0x5b58bf,function(_0x48b942){if(_0x2a9ce1[_0x48b942[_0x9293('0x19')]]){_0x5aef6f[_0x9293('0x1a')]({'name':_0x48b942[_0x9293('0x1b')],'value':_0x2a9ce1[_0x48b942[_0x9293('0x19')]]});}});}return request({'form':{'method':_0x9293('0x1c'),'input_type':'JSON','response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0x5c0d80['id'],'module_name':'Calls','name_value_list':_0x5aef6f})}});}function getAuth(_0x401a68){return util['format'](_0x9293('0x1f'),new Buffer(_0x401a68['apiKey']+':X')[_0x9293('0x20')](_0x9293('0x21')));}function getServerInfo(_0xe47b1b){return request({'form':{'method':'get_server_info','input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0xe47b1b['id']})}});}function getUser(_0x2ff39a,_0x1a0b4a,_0xcd1125){if(!_[_0x9293('0x22')](_0x1a0b4a)){logger[_0x9293('0x23')](_0x9293('0x24'),_0x1a0b4a);return request({'form':{'method':_0x9293('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9293('0x1e')]({'session':_0xcd1125['id'],'module_name':_0x9293('0x26'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1a0b4a),'order_by':'','offset':'0','select_fields':['id',_0x9293('0x16'),_0x9293('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3a3420){if(_0x3a3420['entry_list'][_0x9293('0x28')]){var _0x13f92a=_[_0x9293('0x29')](_0x3a3420[_0x9293('0x2a')],function(_0x236403){return _0x236403[_0x9293('0x2b')]['user_name'][_0x9293('0x2c')]===_0x1a0b4a;});if(_0x13f92a){logger[_0x9293('0x23')]('Agent\x20found!');return BPromise[_0x9293('0x2d')]({'id':_0x13f92a[_0x9293('0x2b')]['id'][_0x9293('0x2c')],'name':_0x13f92a[_0x9293('0x2b')][_0x9293('0x16')][_0x9293('0x2c')]});}}logger[_0x9293('0x23')](_0x9293('0x2e'));return BPromise[_0x9293('0x2d')]({'id':_0xcd1125[_0x9293('0x2b')][_0x9293('0x2f')]['value'],'name':_0xcd1125[_0x9293('0x2b')][_0x9293('0x27')][_0x9293('0x2c')]});});}else{logger[_0x9293('0x23')](_0x9293('0x30'));return BPromise[_0x9293('0x2d')]({'id':_0xcd1125[_0x9293('0x2b')][_0x9293('0x2f')][_0x9293('0x2c')],'name':_0xcd1125[_0x9293('0x2b')]['user_name'][_0x9293('0x2c')]});}}function getEndUser(_0x19eccb,_0xf561ce,_0x57c700,_0x26c57c){logger['info'](_0x9293('0x31'),_0x57c700);return request({'form':{'method':_0x9293('0x25'),'input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0x26c57c['id'],'module_name':'Contacts','query':util[_0x9293('0x32')](_0x9293('0x33'),_0x57c700),'order_by':'','offset':'0','select_fields':['id','name',_0x9293('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x37d3e7){if(_0x37d3e7[_0x9293('0x2a')][_0x9293('0x28')]){var _0x57d22b=_[_0x9293('0x29')](_0x37d3e7['entry_list'],function(_0x4472c3){return _0x4472c3[_0x9293('0x2b')]['phone_home'][_0x9293('0x2c')]===_0x57c700;});if(_0x57d22b){logger[_0x9293('0x23')](_0x9293('0x35'));return BPromise[_0x9293('0x2d')]({'id':_0x57d22b[_0x9293('0x2b')]['id'][_0x9293('0x2c')],'name':_0x57d22b[_0x9293('0x2b')]['name'][_0x9293('0x2c')],'phone':_0x57d22b['name_value_list'][_0x9293('0x34')]['value']});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x9293('0x1c'),'input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0x26c57c['id'],'module_name':_0x9293('0x14'),'name_value_list':[{'name':'first_name','value':_0xf561ce!==_0x9293('0x36')?_0xf561ce:util['format']('Caller\x20-\x20%s',_0x57c700)},{'name':'phone_home','value':_0x57c700}]})}})['then'](function(_0x5049e8){logger[_0x9293('0x23')](_0x9293('0x37'));return BPromise[_0x9293('0x2d')]({'id':_0x5049e8['id'],'name':_0x5049e8['entry_list']['first_name'][_0x9293('0x2c')],'phone':_0x5049e8['entry_list'][_0x9293('0x34')][_0x9293('0x2c')]});});}});}function request(_0x374023){logger['debug'](_0x9293('0x38'),JSON[_0x9293('0x1e')](_0x374023));return rp(_['merge'](def,_0x374023));}function getTags(_0x50e133,_0xd2f6){var _0x12f408=[];if(_0x50e133&&_0x50e133[_0x9293('0x28')]>0x0){_0x12f408=_[_0x9293('0x39')](_0x50e133,_0xd2f6);}return _0x12f408;}function getCustomFields(_0x323aaf,_0x4948f8){var _0x38784c=[];var _0x52fbf9={'custom_fields':[]};if(_0x323aaf['length']>0x0){_[_0x9293('0x18')](_0x323aaf,function(_0xf27376){if(_0xf27376[_0x9293('0x3a')]==='string'&&_0xf27376[_0x9293('0x3b')]&&!_0xf27376[_0x9293('0x3c')]){_0x52fbf9[_0xf27376[_0x9293('0x3b')][_0x9293('0x3d')]()]=_0xf27376[_0x9293('0x3e')][_0x9293('0x20')]();}else if(_0xf27376[_0x9293('0x3a')]===_0x9293('0x3f')&&_0xf27376[_0x9293('0x1b')]&&_0xf27376[_0x9293('0x3c')]){_0x52fbf9['custom_fields'][_0x9293('0x1a')]({'id':_0xf27376[_0x9293('0x1b')],'value':_0xf27376[_0x9293('0x3e')][_0x9293('0x20')]()});}else if(_0xf27376[_0x9293('0x3a')]===_0x9293('0x40')&&_0xf27376[_0x9293('0x19')]&&_0xf27376[_0x9293('0x1b')]&&_0xf27376[_0x9293('0x3c')]){_0x4948f8[_0xf27376[_0x9293('0x19')]]&&_0x52fbf9[_0x9293('0x41')][_0x9293('0x1a')]({'id':_0xf27376[_0x9293('0x1b')],'value':_0x4948f8[_0xf27376[_0x9293('0x19')]][_0x9293('0x20')]()});}else if(_0xf27376[_0x9293('0x3a')]===_0x9293('0x42')&&_0xf27376[_0x9293('0x43')]&&_0xf27376[_0x9293('0x43')][_0x9293('0x16')]&&_0xf27376['idField']&&_0xf27376[_0x9293('0x3c')]){_0x4948f8[_0xf27376[_0x9293('0x43')]['name'][_0x9293('0x3d')]()]&&_0x52fbf9[_0x9293('0x41')][_0x9293('0x1a')]({'id':_0xf27376['idField'],'value':_0x4948f8[_0xf27376['Variable'][_0x9293('0x16')]['toLowerCase']()][_0x9293('0x20')]()});}});}return _0x52fbf9;}function getConnection(_0x54ec67){return request({'method':_0x9293('0xa'),'form':{'method':_0x9293('0x44'),'input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'user_auth':{'user_name':_0x54ec67[_0x9293('0x45')],'password':_0x54ec67[_0x9293('0x46')],'encryption':_0x9293('0x47')},'application':_0x9293('0x48')})}})['then'](function(_0x8adab9){var _0x4ca041=_0x8adab9;if(_0x4ca041['id']){def[_0x9293('0x49')]=_0x4ca041['id'];return BPromise[_0x9293('0x2d')](_0x4ca041);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x54ec67['id']));}});}function setRelationship(_0x4a7212,_0x46284c,_0x475880,_0x6d20b7){return request({'form':{'method':_0x9293('0x4a'),'input_type':_0x9293('0x1d'),'response_type':'JSON','rest_data':JSON[_0x9293('0x1e')]({'session':_0x4a7212['id'],'module_name':_0x9293('0x4b'),'module_id':_0x475880['id'],'link_field_name':_0x6d20b7,'related_ids':[_0x46284c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9293('0x4c')]=function(_0x4b8391,_0x219e9,_0x40695b,_0x28401a,_0x517e47,_0x180bab){var _0x176d37,_0x5452ef,_0x2e9b94,_0xd9cf82;_0x180bab[_0x9293('0x4d')]=intUtil[_0x9293('0x4e')](_0x180bab['remoteUri']);_0x180bab[_0x9293('0x4f')]=intUtil['stripTrailingSlash'](_0x180bab[_0x9293('0x4f')]);def[_0x9293('0x50')]=util[_0x9293('0x32')]('%s/service/v4_1/rest.php',_0x180bab[_0x9293('0x4d')]);if(_0x517e47&&_0x517e47['monitor_format']){logger[_0x9293('0x23')]('[QUEUE]',_0x9293('0x51'));_0x219e9['recordingURL']=util['format'](_0x9293('0x52'),_0x180bab[_0x9293('0x4f')],_0x219e9['uniqueid'],md5(_0x219e9['uniqueid']));}else{_0x219e9['recordingURL']='';}return getConnection(_0x180bab)[_0x9293('0x53')](function(_0x64c2bd){_0xd9cf82=_0x64c2bd;return getUser(_0x180bab,_0x28401a[_0x9293('0x16')],_0xd9cf82);})[_0x9293('0x53')](function(_0x55ba18){_0x176d37=_0x55ba18;logger['info'](_0x9293('0x54'),_0x176d37['id']);return getEndUser(_0x180bab,_0x219e9[_0x9293('0x55')],_0x219e9[_0x9293('0x56')],_0xd9cf82);})['then'](function(_0x4f4aad){_0x5452ef=_0x4f4aad;logger[_0x9293('0x23')](_0x9293('0x57'),_0x5452ef['id']);return getTicket(_0x180bab,_0x176d37,_0x5452ef,_0x40695b,_0x219e9,_0x40695b[_0x9293('0x58')],_0xd9cf82,'Inbound');})['then'](function(_0x57733a){_0x2e9b94=_0x57733a;logger[_0x9293('0x23')]('Ticket\x20created!');logger[_0x9293('0x23')](_0x9293('0x59'),_0x2e9b94['id']);return setRelationship(_0xd9cf82,_0x176d37,_0x2e9b94,_0x9293('0x5a'));})['then'](function(){return setRelationship(_0xd9cf82,_0x5452ef,_0x2e9b94,_0x9293('0x5b'));})[_0x9293('0x53')](function(){return getServerInfo(_0xd9cf82);})['then'](function(_0x5c3d8e){var _0x5ea00f=parseInt(_0x5c3d8e[_0x9293('0x5c')][_0x9293('0x5d')](0x0));var _0x1b4942=util[_0x9293('0x32')](_0x9293('0x5e'),_0x180bab[_0x9293('0x4d')],_0x2e9b94['id']);if(_0x5ea00f>0x6){_0x1b4942=util[_0x9293('0x32')](_0x9293('0x5f'),_0x180bab[_0x9293('0x4d')],_0x2e9b94['id']);}logger[_0x9293('0x23')](_0x9293('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9293('0x61'),_0x28401a[_0x9293('0x16')]),'trigger:browser:url',{'uri':_0x1b4942});})[_0x9293('0x62')](function(_0x3e460d){logger['error'](_0x9293('0x60'),JSON[_0x9293('0x1e')](_0x3e460d));});};exports['outbound']=function(_0x2bcd23,_0x56088a,_0x573333,_0x5f1202,_0xfeac72,_0x30b521,_0x1e07fc){var _0x598b84,_0x122637,_0x5a217f,_0x4b105b;_0x30b521[_0x9293('0x4d')]=intUtil[_0x9293('0x4e')](_0x30b521['remoteUri']);_0x30b521[_0x9293('0x4f')]=intUtil['stripTrailingSlash'](_0x30b521[_0x9293('0x4f')]);def[_0x9293('0x50')]=util[_0x9293('0x32')](_0x9293('0x63'),_0x30b521[_0x9293('0x4d')]);if(_0x1e07fc&&_0x1e07fc[_0x9293('0x64')]&&_0x1e07fc['recordingFormat']!=='none'){logger[_0x9293('0x23')](_0x9293('0x65'),_0x9293('0x51'));_0x56088a[_0x9293('0x66')]=util['format'](_0x9293('0x52'),_0x30b521['serverUrl'],_0x56088a[_0x9293('0x67')],md5(_0x56088a[_0x9293('0x67')]));}return getConnection(_0x30b521)[_0x9293('0x53')](function(_0x2d740d){_0x4b105b=_0x2d740d;return getUser(_0x30b521,_0x5f1202[_0x9293('0x16')],_0x4b105b);})[_0x9293('0x53')](function(_0x1eba6f){_0x598b84=_0x1eba6f;logger[_0x9293('0x23')]('The\x20User\x20ID\x20is:',_0x598b84['id']);return getEndUser(_0x30b521,_0x56088a[_0x9293('0x68')],_0x56088a[_0x9293('0x69')],_0x4b105b);})[_0x9293('0x53')](function(_0x90b67){_0x122637=_0x90b67;logger['info'](_0x9293('0x57'),_0x122637['id']);return getTicket(_0x30b521,_0x598b84,_0x122637,_0x573333,_0x56088a,_0x573333[_0x9293('0x58')],_0x4b105b,_0x9293('0x6a'));})[_0x9293('0x53')](function(_0x19a47c){_0x5a217f=_0x19a47c;logger[_0x9293('0x23')](_0x9293('0x6b'));logger['info'](_0x9293('0x59'),_0x5a217f['id']);return setRelationship(_0x4b105b,_0x598b84,_0x5a217f,_0x9293('0x5a'));})[_0x9293('0x53')](function(){return setRelationship(_0x4b105b,_0x122637,_0x5a217f,'contacts');})[_0x9293('0x53')](function(){return getServerInfo(_0x4b105b);})[_0x9293('0x53')](function(_0x291a04){var _0x4ae5a3=parseInt(_0x291a04[_0x9293('0x5c')]['charAt'](0x0));var _0x170ff8=util[_0x9293('0x32')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x30b521[_0x9293('0x4d')],_0x5a217f['id']);if(_0x4ae5a3>0x6){_0x170ff8=util[_0x9293('0x32')](_0x9293('0x5f'),_0x30b521[_0x9293('0x4d')],_0x5a217f['id']);}logger[_0x9293('0x23')](_0x9293('0x65'),_0x9293('0x6c'));emit(util[_0x9293('0x32')]('user:%s',_0x5f1202[_0x9293('0x16')]),_0x9293('0x6d'),{'uri':_0x170ff8});})[_0x9293('0x62')](function(_0x1a00e4){logger[_0x9293('0x6e')](_0x9293('0x65'),JSON[_0x9293('0x1e')](_0x1a00e4));});};exports['unmanaged']=function(_0x12a28b,_0x16b278,_0x41dd66,_0x2bf1c2,_0x1bfdb2,_0x46f202){var _0x365def,_0x1f743c,_0x1de41d,_0x489811;_0x46f202['remoteUri']=intUtil['stripTrailingSlash'](_0x46f202['remoteUri']);_0x46f202[_0x9293('0x4f')]=intUtil[_0x9293('0x4e')](_0x46f202[_0x9293('0x4f')]);def[_0x9293('0x50')]=util['format'](_0x9293('0x63'),_0x46f202[_0x9293('0x4d')]);if(_0x1bfdb2&&_0x1bfdb2['monitor_format']){logger[_0x9293('0x23')]('['+_0x16b278[_0x9293('0x6f')]['toUpperCase']()+']',_0x9293('0x51'));_0x16b278[_0x9293('0x66')]=util[_0x9293('0x32')](_0x9293('0x52'),_0x46f202[_0x9293('0x4f')],_0x16b278[_0x9293('0x67')],md5(_0x16b278[_0x9293('0x67')]));}else{_0x16b278[_0x9293('0x66')]='';}return getConnection(_0x46f202)[_0x9293('0x53')](function(_0x522350){_0x489811=_0x522350;if(!_[_0x9293('0x22')](_0x2bf1c2)){return getUser(_0x46f202,_0x2bf1c2[_0x9293('0x16')],_0x489811);}else{return getUser(_0x46f202,null,_0x489811);}})[_0x9293('0x53')](function(_0x3faf4d){_0x365def=_0x3faf4d;logger['info']('The\x20User\x20ID\x20is:',_0x365def['id']);return getEndUser(_0x46f202,_0x16b278['calleridname'],_0x16b278[_0x9293('0x56')],_0x489811);})[_0x9293('0x53')](function(_0x970864){_0x1f743c=_0x970864;logger[_0x9293('0x23')]('The\x20Enduser\x20ID\x20is:',_0x1f743c['id']);return getTicket(_0x46f202,_0x365def,_0x1f743c,_0x41dd66,_0x16b278,_0x41dd66[_0x9293('0x58')],_0x489811,'Inbound');})[_0x9293('0x53')](function(_0x5b6f26){_0x1de41d=_0x5b6f26;logger[_0x9293('0x23')]('Ticket\x20created!');logger[_0x9293('0x23')]('The\x20Ticket\x20ID\x20is:',_0x1de41d['id']);return setRelationship(_0x489811,_0x365def,_0x1de41d,_0x9293('0x5a'));})[_0x9293('0x53')](function(){return setRelationship(_0x489811,_0x1f743c,_0x1de41d,'contacts');})[_0x9293('0x53')](function(){return getServerInfo(_0x489811);})[_0x9293('0x62')](function(_0x42d9cb){logger[_0x9293('0x6e')]('['+_0x16b278[_0x9293('0x6f')][_0x9293('0x70')]()+']',JSON['stringify'](_0x42d9cb));});}; \ 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 9c8ac1b..90af6f8 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 _0x761d=['key','%s:\x20%s','keyContent','keyType','format','slice','substring','lastIndexOf','validateEmail','isNil','test','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase'];(function(_0x2f8db3,_0x24b6c6){var _0x50b153=function(_0x3e4106){while(--_0x3e4106){_0x2f8db3['push'](_0x2f8db3['shift']());}};_0x50b153(++_0x24b6c6);}(_0x761d,0xcb));var _0xd761=function(_0x5cdc25,_0x2d1308){_0x5cdc25=_0x5cdc25-0x0;var _0x54d663=_0x761d[_0x5cdc25];return _0x54d663;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x40ed4b,_0x2413f8,_0x4af9fc){var _0x1907ca=[];if(_0x40ed4b[_0xd761('0x0')]>0x0){var _0x375635=_[_0xd761('0x1')](_0x40ed4b,['id']);for(var _0x156ac9=0x0;_0x156ac9<_0x375635[_0xd761('0x0')];_0x156ac9++){var _0xe93f4a=_0x375635[_0x156ac9];if(_0xe93f4a['type']===_0xd761('0x2')){_0x1907ca[_0xd761('0x3')](_0xe93f4a[_0xd761('0x4')]);}else if(_0xe93f4a[_0xd761('0x5')]===_0xd761('0x6')&&_0xe93f4a[_0xd761('0x7')]){_0x2413f8[_0xe93f4a[_0xd761('0x7')]]&&_0x1907ca[_0xd761('0x3')](_0x2413f8[_0xe93f4a['variableName']][_0xd761('0x8')]());}else if(_0xe93f4a['type']===_0xd761('0x9')&&_0xe93f4a['Variable']&&_0xe93f4a[_0xd761('0xa')][_0xd761('0xb')]){_0x2413f8[_0xe93f4a[_0xd761('0xa')][_0xd761('0xb')][_0xd761('0xc')]()]&&_0x1907ca[_0xd761('0x3')](_0x2413f8[_0xe93f4a['Variable'][_0xd761('0xb')][_0xd761('0xc')]()][_0xd761('0x8')]());}else if(_0xe93f4a['type']==='keyValue'){if(_0xe93f4a['keyType']===_0xd761('0x2')&&_0xe93f4a[_0xd761('0xd')]){_0x1907ca['push'](util['format'](_0xd761('0xe'),_0xe93f4a[_0xd761('0xd')],_0xe93f4a[_0xd761('0xf')]));}else if(_0xe93f4a[_0xd761('0x10')]===_0xd761('0x6')&&_0xe93f4a[_0xd761('0x7')]&&_0xe93f4a[_0xd761('0xd')]){_0x2413f8[_0xe93f4a[_0xd761('0x7')]]&&_0x1907ca[_0xd761('0x3')](util[_0xd761('0x11')](_0xd761('0xe'),_0xe93f4a[_0xd761('0xd')],_0x2413f8[_0xe93f4a['variableName']]));}else if(_0xe93f4a[_0xd761('0x10')]===_0xd761('0x9')&&_0xe93f4a['Variable']&&_0xe93f4a['Variable'][_0xd761('0xb')]&&_0xe93f4a[_0xd761('0xd')]){_0x2413f8[_0xe93f4a[_0xd761('0xa')][_0xd761('0xb')][_0xd761('0xc')]()]&&_0x1907ca[_0xd761('0x3')](util['format'](_0xd761('0xe'),_0xe93f4a[_0xd761('0xd')],_0x2413f8[_0xe93f4a['Variable'][_0xd761('0xb')][_0xd761('0xc')]()]));}}}}return _0x1907ca['join'](_0x4af9fc);};exports['stripTrailingSlash']=function(_0x1e6bd9){var _0x448efb=_0x1e6bd9[_0xd761('0x12')](-0x1);if(_0x448efb==='/'){_0x1e6bd9=_0x1e6bd9[_0xd761('0x13')](0x0,_0x1e6bd9[_0xd761('0x14')](_0x448efb));}return _0x1e6bd9;};exports[_0xd761('0x15')]=function(_0x129ffd){if(!_[_0xd761('0x16')](_0x129ffd)&&_0x129ffd!==''){var _0x20d1ff=/^(([^<>()\[\]\\.,;:\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 _0x20d1ff[_0xd761('0x17')](String(_0x129ffd)[_0xd761('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x9add=['format','%s:\x20%s','keyContent','keyType','key','toLowerCase','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','keyValue'];(function(_0x3639da,_0x13c52c){var _0x3e2785=function(_0x27be25){while(--_0x27be25){_0x3639da['push'](_0x3639da['shift']());}};_0x3e2785(++_0x13c52c);}(_0x9add,0x151));var _0xd9ad=function(_0x2f5cdb,_0x364528){_0x2f5cdb=_0x2f5cdb-0x0;var _0x1412fb=_0x9add[_0x2f5cdb];return _0x1412fb;};'use strict';var _=require(_0xd9ad('0x0'));var util=require('util');exports[_0xd9ad('0x1')]=function(_0x3cc90a,_0xf59ecc,_0x595b38){var _0x370d7f=[];if(_0x3cc90a[_0xd9ad('0x2')]>0x0){var _0x51e87e=_[_0xd9ad('0x3')](_0x3cc90a,['id']);for(var _0x478c10=0x0;_0x478c10<_0x51e87e[_0xd9ad('0x2')];_0x478c10++){var _0x437b7=_0x51e87e[_0x478c10];if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0x5')){_0x370d7f[_0xd9ad('0x6')](_0x437b7['content']);}else if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0x7')&&_0x437b7[_0xd9ad('0x8')]){_0xf59ecc[_0x437b7[_0xd9ad('0x8')]]&&_0x370d7f['push'](_0xf59ecc[_0x437b7[_0xd9ad('0x8')]][_0xd9ad('0x9')]());}else if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0xa')&&_0x437b7[_0xd9ad('0xb')]&&_0x437b7[_0xd9ad('0xb')]['name']){_0xf59ecc[_0x437b7[_0xd9ad('0xb')]['name']['toLowerCase']()]&&_0x370d7f[_0xd9ad('0x6')](_0xf59ecc[_0x437b7[_0xd9ad('0xb')][_0xd9ad('0xc')]['toLowerCase']()][_0xd9ad('0x9')]());}else if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0xd')){if(_0x437b7['keyType']==='string'&&_0x437b7['key']){_0x370d7f[_0xd9ad('0x6')](util[_0xd9ad('0xe')](_0xd9ad('0xf'),_0x437b7['key'],_0x437b7[_0xd9ad('0x10')]));}else if(_0x437b7[_0xd9ad('0x11')]===_0xd9ad('0x7')&&_0x437b7['variableName']&&_0x437b7[_0xd9ad('0x12')]){_0xf59ecc[_0x437b7[_0xd9ad('0x8')]]&&_0x370d7f['push'](util[_0xd9ad('0xe')](_0xd9ad('0xf'),_0x437b7[_0xd9ad('0x12')],_0xf59ecc[_0x437b7[_0xd9ad('0x8')]]));}else if(_0x437b7[_0xd9ad('0x11')]===_0xd9ad('0xa')&&_0x437b7[_0xd9ad('0xb')]&&_0x437b7['Variable'][_0xd9ad('0xc')]&&_0x437b7['key']){_0xf59ecc[_0x437b7[_0xd9ad('0xb')][_0xd9ad('0xc')][_0xd9ad('0x13')]()]&&_0x370d7f[_0xd9ad('0x6')](util[_0xd9ad('0xe')](_0xd9ad('0xf'),_0x437b7['key'],_0xf59ecc[_0x437b7[_0xd9ad('0xb')][_0xd9ad('0xc')]['toLowerCase']()]));}}}}return _0x370d7f[_0xd9ad('0x14')](_0x595b38);};exports[_0xd9ad('0x15')]=function(_0x118877){var _0x291110=_0x118877[_0xd9ad('0x16')](-0x1);if(_0x291110==='/'){_0x118877=_0x118877[_0xd9ad('0x17')](0x0,_0x118877[_0xd9ad('0x18')](_0x291110));}return _0x118877;};exports[_0xd9ad('0x19')]=function(_0x3eff85){if(!_['isNil'](_0x3eff85)&&_0x3eff85!==''){var _0x59e4d6=/^(([^<>()\[\]\\.,;:\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 _0x59e4d6[_0xd9ad('0x1a')](String(_0x3eff85)[_0xd9ad('0x13')]());}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 a80bbb2..a2b40f8 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(_0x14380f,_0x2084cc){var _0x5028e9=function(_0x3dc3fd){while(--_0x3dc3fd){_0x14380f['push'](_0x14380f['shift']());}};_0x5028e9(++_0x2084cc);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 18f7453..7fc1dc2 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 _0x6780=['Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','name','getString','Descriptions','Fields','then','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','username','Basic\x20%s','toString','base64','stringify','map','includes','string','picklist','type','nameField','content','idField','customField','custom_fields','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x11b04f,_0x129fbd){var _0x43ac42=function(_0x52fb47){while(--_0x52fb47){_0x11b04f['push'](_0x11b04f['shift']());}};_0x43ac42(++_0x129fbd);}(_0x6780,0x1c8));var _0x0678=function(_0x306f32,_0xd0685a){_0x306f32=_0x306f32-0x0;var _0x2161fb=_0x6780[_0x306f32];return _0x2161fb;};'use strict';var _=require(_0x0678('0x0'));var rp=require(_0x0678('0x1'));var md5=require(_0x0678('0x2'));var util=require(_0x0678('0x3'));var Redis=require(_0x0678('0x4'));var intUtil=require(_0x0678('0x5'));var config=require(_0x0678('0x6'));var logger=require('../../../../config/logger')('zendesk');config[_0x0678('0x7')]=_[_0x0678('0x8')](config[_0x0678('0x7')],{'host':_0x0678('0x9'),'port':0x18eb});var io=require(_0x0678('0xa'))(new Redis(config[_0x0678('0x7')]));function emit(_0x441281,_0x2348c3,_0x33add2){io['to'](_0x441281)['emit'](_0x2348c3,_0x33add2);}var headers={'Content-Type':_0x0678('0xb'),'Accept':_0x0678('0xb')};function getTicket(_0x416481,_0x4a6238,_0x47bdd1,_0x5b0856,_0x5d75b7){logger[_0x0678('0xc')](_0x0678('0xd'));return request({'uri':util[_0x0678('0xe')](_0x0678('0xf'),_0x416481[_0x0678('0x10')]),'method':_0x0678('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x47bdd1['id'],'submitter_id':_0x4a6238?_0x4a6238['id']:undefined,'assignee_id':_0x4a6238?_0x4a6238['id']:undefined,'tags':getTags(_0x5b0856['Tags'],_0x0678('0x12')),'subject':intUtil[_0x0678('0x13')](_0x5b0856['Subjects'],_0x5d75b7,'\x20'),'description':intUtil[_0x0678('0x13')](_0x5b0856['Descriptions'],_0x5d75b7,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0678('0x13')](_0x5b0856[_0x0678('0x14')],_0x5d75b7,'\x0a')}},getCustomFields(_0x5b0856[_0x0678('0x15')],_0x5d75b7))}})[_0x0678('0x16')](function(_0x23b28f){logger[_0x0678('0xc')]('Ticket\x20created!');return _0x23b28f['ticket'];});}function getUser(_0x28560d,_0x4f5cb7){if(intUtil['validateEmail'](_0x4f5cb7)){logger[_0x0678('0xc')](_0x0678('0x17'),_0x4f5cb7);return request({'uri':util[_0x0678('0xe')]('%s/search.json',_0x28560d[_0x0678('0x10')]),'qs':{'query':util[_0x0678('0xe')](_0x0678('0x18'),_0x4f5cb7)}})[_0x0678('0x16')](function(_0x4d5af2){if(_0x4d5af2[_0x0678('0x19')]){logger[_0x0678('0xc')](_0x0678('0x1a'));return _[_0x0678('0x1b')](_0x4d5af2[_0x0678('0x1c')],{'email':_0x4f5cb7,'role':'agent'});}else{logger[_0x0678('0xc')](_0x0678('0x1d'));return request({'uri':util[_0x0678('0xe')](_0x0678('0x1e'),_0x28560d[_0x0678('0x10')])})[_0x0678('0x16')](function(_0x37b5d9){logger[_0x0678('0xc')]('Admin\x20account\x20selected.');return _0x37b5d9['user'];});}});}else{logger[_0x0678('0xc')](_0x0678('0x1d'));return request({'uri':util[_0x0678('0xe')](_0x0678('0x1e'),_0x28560d[_0x0678('0x10')])})[_0x0678('0x16')](function(_0x4e82ae){logger['info']('Admin\x20account\x20selected.');return _0x4e82ae[_0x0678('0x1f')];});}}function getEndUser(_0x4f4566,_0xe88179,_0x2b1ae5){logger[_0x0678('0xc')]('Searching\x20enduser\x20with\x20phone',_0x2b1ae5);return request({'uri':util[_0x0678('0xe')](_0x0678('0x20'),_0x4f4566[_0x0678('0x10')]),'qs':{'query':util['format'](_0x0678('0x21'),_0x2b1ae5)}})['then'](function(_0x3ce6a2){var _0x4cbd3d;if(_0x3ce6a2[_0x0678('0x1c')][_0x0678('0x22')]){_0x3ce6a2['results']=_['filter'](_0x3ce6a2[_0x0678('0x1c')],{'suspended':![],'role':'end-user'});if(_0x3ce6a2[_0x0678('0x1c')][_0x0678('0x22')]){_0x4cbd3d=_['first'](_0x3ce6a2[_0x0678('0x1c')]);}}if(_0x4cbd3d){logger[_0x0678('0xc')](_0x0678('0x23'));return _0x4cbd3d;}else{logger['info'](_0x0678('0x24'));return request({'uri':util[_0x0678('0xe')](_0x0678('0x25'),_0x4f4566['remoteUri']),'method':_0x0678('0x11'),'body':{'user':{'role':_0x0678('0x26'),'name':util['format'](_0x0678('0x27'),_0xe88179||_0x2b1ae5),'phone':_0x2b1ae5}}})[_0x0678('0x16')](function(_0x36501a){logger[_0x0678('0xc')](_0x0678('0x28'));return _0x36501a[_0x0678('0x1f')];});}});}function getAuth(_0x5e2867){var _0x87c9ba;if(_0x5e2867[_0x0678('0x29')]===_0x0678('0x2a')){_0x87c9ba=util[_0x0678('0xe')](_0x0678('0x2b'),_0x5e2867['username'],_0x5e2867[_0x0678('0x2a')]);}else if(_0x5e2867['authType']===_0x0678('0x2c')){_0x87c9ba=util[_0x0678('0xe')]('%s/token:%s',_0x5e2867[_0x0678('0x2d')],_0x5e2867['token']);}return util[_0x0678('0xe')](_0x0678('0x2e'),new Buffer(_0x87c9ba)[_0x0678('0x2f')](_0x0678('0x30')));}function request(_0x5ac695){logger['debug']('[HTTP]',JSON[_0x0678('0x31')](_0x5ac695));return rp(_['defaults'](_0x5ac695,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x10c925,_0x305d2d){var _0x2b0273=[];if(_0x10c925&&_0x10c925[_0x0678('0x22')]>0x0){_0x2b0273=_[_0x0678('0x32')](_0x10c925,_0x305d2d);}return _0x2b0273;}function getCustomFields(_0x23c454,_0x116706){var _0xf825dd=[];var _0x297d01={'custom_fields':[]};if(_0x23c454['length']>0x0){_['forEach'](_0x23c454,function(_0x3a81f3){if(_[_0x0678('0x33')]([_0x0678('0x34'),_0x0678('0x35')],_0x3a81f3[_0x0678('0x36')])&&_0x3a81f3[_0x0678('0x37')]&&!_0x3a81f3['customField']){_0x297d01[_0x3a81f3['nameField']['toLowerCase']()]=_0x3a81f3[_0x0678('0x38')][_0x0678('0x2f')]();}else if(_['includes']([_0x0678('0x34'),_0x0678('0x35')],_0x3a81f3['type'])&&_0x3a81f3[_0x0678('0x39')]&&_0x3a81f3[_0x0678('0x3a')]){_0x297d01[_0x0678('0x3b')]['push']({'id':_0x3a81f3[_0x0678('0x39')],'value':_0x3a81f3['content'][_0x0678('0x2f')]()});}else if(_0x3a81f3[_0x0678('0x36')]===_0x0678('0x3c')&&_0x3a81f3['variableName']&&_0x3a81f3[_0x0678('0x39')]&&_0x3a81f3[_0x0678('0x3a')]){_0x116706[_0x3a81f3[_0x0678('0x3d')]]&&_0x297d01['custom_fields'][_0x0678('0x3e')]({'id':_0x3a81f3[_0x0678('0x39')],'value':_0x116706[_0x3a81f3[_0x0678('0x3d')]][_0x0678('0x2f')]()});}else if(_0x3a81f3['type']===_0x0678('0x3f')&&_0x3a81f3[_0x0678('0x40')]&&_0x3a81f3[_0x0678('0x40')][_0x0678('0x12')]&&_0x3a81f3['idField']&&_0x3a81f3[_0x0678('0x3a')]){_0x116706[_0x3a81f3[_0x0678('0x40')][_0x0678('0x12')][_0x0678('0x41')]()]&&_0x297d01['custom_fields'][_0x0678('0x3e')]({'id':_0x3a81f3['idField'],'value':_0x116706[_0x3a81f3[_0x0678('0x40')][_0x0678('0x12')]['toLowerCase']()][_0x0678('0x2f')]()});}});}return _0x297d01;}exports[_0x0678('0x42')]=function(_0x58313e,_0x1e9f65,_0x3609b5,_0x28a331,_0x19ccb1,_0x10841b){var _0x243d1c,_0x562040;_0x10841b[_0x0678('0x10')]=intUtil[_0x0678('0x43')](_0x10841b[_0x0678('0x10')]);_0x10841b[_0x0678('0x44')]=intUtil[_0x0678('0x43')](_0x10841b[_0x0678('0x44')]);if(_0x19ccb1&&_0x19ccb1[_0x0678('0x45')]){logger[_0x0678('0xc')](_0x0678('0x46'),_0x0678('0x47'));_0x1e9f65['recordingURL']=util['format'](_0x0678('0x48'),_0x10841b[_0x0678('0x44')],_0x1e9f65[_0x0678('0x49')],md5(_0x1e9f65[_0x0678('0x49')]));}else{_0x1e9f65['recordingURL']='';}headers[_0x0678('0x4a')]=getAuth(_0x10841b);return getUser(_0x10841b,_0x28a331[_0x0678('0x4b')])['then'](function(_0x3970a4){_0x243d1c=_0x3970a4;logger[_0x0678('0xc')](_0x0678('0x4c'),_0x243d1c['id']);return getEndUser(_0x10841b,_0x1e9f65[_0x0678('0x4d')],_0x1e9f65[_0x0678('0x4e')]);})[_0x0678('0x16')](function(_0x16fe23){_0x562040=_0x16fe23;logger[_0x0678('0xc')](_0x0678('0x4f'),_0x562040['id']);return getTicket(_0x10841b,_0x243d1c,_0x562040,_0x3609b5,_0x1e9f65);})[_0x0678('0x16')](function(_0x482f62){if(_0x482f62){logger[_0x0678('0xc')](_0x0678('0x50'),_0x482f62['id']);switch(_0x10841b['type']){case _0x0678('0x51'):logger[_0x0678('0xc')](_0x0678('0x46'),_0x0678('0x52'));return request({'uri':util['format'](_0x0678('0x53'),_0x10841b['remoteUri'],_0x243d1c['id'],_0x482f62['id']),'method':_0x0678('0x11')});case _0x0678('0x54'):logger['info']('[QUEUE]',_0x0678('0x55'));emit(util['format'](_0x0678('0x56'),_0x28a331['name']),_0x0678('0x57'),{'uri':util[_0x0678('0xe')](_0x0678('0x58'),_0x10841b['remoteUri'][_0x0678('0x59')](_0x0678('0x5a'),''),_0x482f62['id'])});break;default:logger[_0x0678('0x5b')](_0x0678('0x46'),_0x0678('0x5c'));}}})[_0x0678('0x5d')](function(_0x3f106b){logger[_0x0678('0x5b')](_0x0678('0x5e'),util[_0x0678('0x5f')](_0x3f106b,{'showHidden':!![],'depth':null}));});};exports[_0x0678('0x60')]=function(_0x232ae2,_0x51dfca,_0x4bbe84,_0x17ddf0,_0x514ca9,_0x1916c4,_0x280840){var _0x12a8d8,_0x34c576;_0x1916c4[_0x0678('0x10')]=intUtil[_0x0678('0x43')](_0x1916c4[_0x0678('0x10')]);_0x1916c4[_0x0678('0x44')]=intUtil[_0x0678('0x43')](_0x1916c4['serverUrl']);if(_0x280840&&_0x280840[_0x0678('0x61')]&&_0x280840[_0x0678('0x61')]!==_0x0678('0x62')){logger[_0x0678('0xc')](_0x0678('0x63'),_0x0678('0x47'));_0x51dfca[_0x0678('0x64')]=util[_0x0678('0xe')](_0x0678('0x48'),_0x1916c4['serverUrl'],_0x51dfca[_0x0678('0x49')],md5(_0x51dfca[_0x0678('0x49')]));}headers[_0x0678('0x4a')]=getAuth(_0x1916c4);return getUser(_0x1916c4,_0x17ddf0[_0x0678('0x4b')])[_0x0678('0x16')](function(_0x4f36b4){_0x12a8d8=_0x4f36b4;logger[_0x0678('0xc')](_0x0678('0x4c'),_0x12a8d8['id']);return getEndUser(_0x1916c4,_0x51dfca['destcalleridname'],_0x51dfca[_0x0678('0x65')]);})['then'](function(_0x2b966f){_0x34c576=_0x2b966f;logger[_0x0678('0xc')](_0x0678('0x4f'),_0x34c576['id']);return getTicket(_0x1916c4,_0x12a8d8,_0x34c576,_0x4bbe84,_0x51dfca);})[_0x0678('0x16')](function(_0x4c264c){if(_0x4c264c){logger['info'](_0x0678('0x50'),_0x4c264c['id']);switch(_0x1916c4[_0x0678('0x36')]){case _0x0678('0x51'):logger[_0x0678('0xc')](_0x0678('0x63'),_0x0678('0x52'));return request({'uri':util['format'](_0x0678('0x53'),_0x1916c4[_0x0678('0x10')],_0x12a8d8['id'],_0x4c264c['id']),'method':_0x0678('0x11')});case _0x0678('0x54'):logger[_0x0678('0xc')](_0x0678('0x63'),_0x0678('0x55'));emit(util['format'](_0x0678('0x56'),_0x17ddf0[_0x0678('0x12')]),_0x0678('0x57'),{'uri':util[_0x0678('0xe')]('%s/agent/tickets/%s',_0x1916c4[_0x0678('0x10')][_0x0678('0x59')](_0x0678('0x5a'),''),_0x4c264c['id'])});break;default:logger[_0x0678('0x5b')](_0x0678('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1ed642){logger[_0x0678('0x5b')](_0x0678('0x66'),util[_0x0678('0x5f')](_0x1ed642,{'showHidden':!![],'depth':null}));});};exports[_0x0678('0x67')]=function(_0x4dbe0e,_0x32ed6f,_0x536124,_0x5baf06,_0x4837c4,_0x1fd74f){var _0x953aa5,_0x47ad3e;_0x1fd74f[_0x0678('0x10')]=intUtil[_0x0678('0x43')](_0x1fd74f[_0x0678('0x10')]);_0x1fd74f[_0x0678('0x44')]=intUtil['stripTrailingSlash'](_0x1fd74f['serverUrl']);if(_0x4837c4&&_0x4837c4['monitor_format']){logger[_0x0678('0xc')]('['+_0x32ed6f['lastevent'][_0x0678('0x68')]()+']',_0x0678('0x47'));_0x32ed6f['recordingURL']=util[_0x0678('0xe')](_0x0678('0x48'),_0x1fd74f[_0x0678('0x44')],_0x32ed6f['uniqueid'],md5(_0x32ed6f[_0x0678('0x49')]));}else{_0x32ed6f['recordingURL']='';}headers[_0x0678('0x4a')]=getAuth(_0x1fd74f);return getUser(_0x1fd74f)[_0x0678('0x16')](function(_0x3ad50d){_0x953aa5=_0x3ad50d;logger[_0x0678('0xc')](_0x0678('0x4c'),_0x953aa5['id']);return getEndUser(_0x1fd74f,_0x32ed6f[_0x0678('0x4d')],_0x32ed6f[_0x0678('0x4e')]);})[_0x0678('0x16')](function(_0x455232){_0x47ad3e=_0x455232;logger[_0x0678('0xc')]('The\x20Enduser\x20ID\x20is:',_0x47ad3e['id']);return getTicket(_0x1fd74f,_0x953aa5,_0x47ad3e,_0x536124,_0x32ed6f);})['then'](function(_0x224eaa){if(_0x224eaa){logger[_0x0678('0xc')](_0x0678('0x50'),_0x224eaa['id']);}})[_0x0678('0x5d')](function(_0x3cec57){logger[_0x0678('0x5b')]('['+_0x32ed6f[_0x0678('0x69')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x0678('0x5f')](_0x3cec57,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0965=['results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','filter','end-user','length','first','%s/users.json','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','type','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','toString','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','request-promise','util','ioredis','../../../../config/environment','redis','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find'];(function(_0x3f6e68,_0x53142a){var _0x234f16=function(_0x4e3b50){while(--_0x4e3b50){_0x3f6e68['push'](_0x3f6e68['shift']());}};_0x234f16(++_0x53142a);}(_0x0965,0xb4));var _0x5096=function(_0x16037f,_0x375f3b){_0x16037f=_0x16037f-0x0;var _0x569806=_0x0965[_0x16037f];return _0x569806;};'use strict';var _=require('lodash');var rp=require(_0x5096('0x0'));var md5=require('md5');var util=require(_0x5096('0x1'));var Redis=require(_0x5096('0x2'));var intUtil=require('./util');var config=require(_0x5096('0x3'));var logger=require('../../../../config/logger')('zendesk');config[_0x5096('0x4')]=_['defaults'](config[_0x5096('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x842dcd,_0x195660,_0x50bfea){io['to'](_0x842dcd)[_0x5096('0x5')](_0x195660,_0x50bfea);}var headers={'Content-Type':_0x5096('0x6'),'Accept':'application/json'};function getTicket(_0xd697d6,_0x5f311f,_0x3a8812,_0x55facb,_0xb65175){logger[_0x5096('0x7')](_0x5096('0x8'));return request({'uri':util['format'](_0x5096('0x9'),_0xd697d6[_0x5096('0xa')]),'method':_0x5096('0xb'),'body':{'ticket':_[_0x5096('0xc')]({'requester_id':_0x3a8812['id'],'submitter_id':_0x5f311f?_0x5f311f['id']:undefined,'assignee_id':_0x5f311f?_0x5f311f['id']:undefined,'tags':getTags(_0x55facb[_0x5096('0xd')],_0x5096('0xe')),'subject':intUtil[_0x5096('0xf')](_0x55facb[_0x5096('0x10')],_0xb65175,'\x20'),'description':intUtil[_0x5096('0xf')](_0x55facb['Descriptions'],_0xb65175,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5096('0xf')](_0x55facb[_0x5096('0x11')],_0xb65175,'\x0a')}},getCustomFields(_0x55facb['Fields'],_0xb65175))}})[_0x5096('0x12')](function(_0x1231de){logger['info'](_0x5096('0x13'));return _0x1231de[_0x5096('0x14')];});}function getUser(_0x212ecd,_0x1123fe){if(intUtil[_0x5096('0x15')](_0x1123fe)){logger[_0x5096('0x7')](_0x5096('0x16'),_0x1123fe);return request({'uri':util[_0x5096('0x17')]('%s/search.json',_0x212ecd[_0x5096('0xa')]),'qs':{'query':util[_0x5096('0x17')](_0x5096('0x18'),_0x1123fe)}})[_0x5096('0x12')](function(_0x5b1a42){if(_0x5b1a42[_0x5096('0x19')]){logger[_0x5096('0x7')](_0x5096('0x1a'));return _[_0x5096('0x1b')](_0x5b1a42[_0x5096('0x1c')],{'email':_0x1123fe,'role':'agent'});}else{logger['info'](_0x5096('0x1d'));return request({'uri':util[_0x5096('0x17')](_0x5096('0x1e'),_0x212ecd[_0x5096('0xa')])})[_0x5096('0x12')](function(_0x737cbe){logger['info'](_0x5096('0x1f'));return _0x737cbe['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5096('0x17')](_0x5096('0x1e'),_0x212ecd[_0x5096('0xa')])})[_0x5096('0x12')](function(_0x4c098f){logger['info'](_0x5096('0x1f'));return _0x4c098f[_0x5096('0x20')];});}}function getEndUser(_0xb8bb82,_0x395dea,_0x64207f){logger[_0x5096('0x7')](_0x5096('0x21'),_0x64207f);return request({'uri':util[_0x5096('0x17')]('%s/search.json',_0xb8bb82[_0x5096('0xa')]),'qs':{'query':util[_0x5096('0x17')]('type:user\x20role:end-user\x20phone:%s',_0x64207f)}})['then'](function(_0xa715e1){var _0xeb230e;if(_0xa715e1[_0x5096('0x1c')]['length']){_0xa715e1[_0x5096('0x1c')]=_[_0x5096('0x22')](_0xa715e1[_0x5096('0x1c')],{'suspended':![],'role':_0x5096('0x23')});if(_0xa715e1[_0x5096('0x1c')][_0x5096('0x24')]){_0xeb230e=_[_0x5096('0x25')](_0xa715e1[_0x5096('0x1c')]);}}if(_0xeb230e){logger[_0x5096('0x7')]('Enduser\x20found!');return _0xeb230e;}else{logger[_0x5096('0x7')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5096('0x17')](_0x5096('0x26'),_0xb8bb82['remoteUri']),'method':_0x5096('0xb'),'body':{'user':{'role':_0x5096('0x23'),'name':util[_0x5096('0x17')]('Caller\x20-\x20%s',_0x395dea||_0x64207f),'phone':_0x64207f}}})['then'](function(_0x2b1a2a){logger['info'](_0x5096('0x27'));return _0x2b1a2a['user'];});}});}function getAuth(_0x3185c9){var _0x158e1b;if(_0x3185c9[_0x5096('0x28')]===_0x5096('0x29')){_0x158e1b=util[_0x5096('0x17')]('%s:%s',_0x3185c9[_0x5096('0x2a')],_0x3185c9[_0x5096('0x29')]);}else if(_0x3185c9[_0x5096('0x28')]===_0x5096('0x2b')){_0x158e1b=util[_0x5096('0x17')](_0x5096('0x2c'),_0x3185c9[_0x5096('0x2a')],_0x3185c9[_0x5096('0x2b')]);}return util[_0x5096('0x17')](_0x5096('0x2d'),new Buffer(_0x158e1b)['toString'](_0x5096('0x2e')));}function request(_0x487fca){logger[_0x5096('0x2f')](_0x5096('0x30'),JSON[_0x5096('0x31')](_0x487fca));return rp(_[_0x5096('0x32')](_0x487fca,{'method':_0x5096('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x57a45d,_0x2836fe){var _0x4088b1=[];if(_0x57a45d&&_0x57a45d[_0x5096('0x24')]>0x0){_0x4088b1=_[_0x5096('0x34')](_0x57a45d,_0x2836fe);}return _0x4088b1;}function getCustomFields(_0x3a2c24,_0x1fa1a0){var _0x3109f8=[];var _0x2b5fe5={'custom_fields':[]};if(_0x3a2c24[_0x5096('0x24')]>0x0){_[_0x5096('0x35')](_0x3a2c24,function(_0x20c87b){if(_[_0x5096('0x36')]([_0x5096('0x37'),'picklist'],_0x20c87b[_0x5096('0x38')])&&_0x20c87b[_0x5096('0x39')]&&!_0x20c87b['customField']){_0x2b5fe5[_0x20c87b[_0x5096('0x39')][_0x5096('0x3a')]()]=_0x20c87b[_0x5096('0x3b')]['toString']();}else if(_['includes']([_0x5096('0x37'),_0x5096('0x3c')],_0x20c87b[_0x5096('0x38')])&&_0x20c87b[_0x5096('0x3d')]&&_0x20c87b[_0x5096('0x3e')]){_0x2b5fe5[_0x5096('0x3f')]['push']({'id':_0x20c87b['idField'],'value':_0x20c87b[_0x5096('0x3b')][_0x5096('0x40')]()});}else if(_0x20c87b[_0x5096('0x38')]==='variable'&&_0x20c87b[_0x5096('0x41')]&&_0x20c87b[_0x5096('0x3d')]&&_0x20c87b[_0x5096('0x3e')]){_0x1fa1a0[_0x20c87b['variableName']]&&_0x2b5fe5[_0x5096('0x3f')][_0x5096('0x42')]({'id':_0x20c87b['idField'],'value':_0x1fa1a0[_0x20c87b[_0x5096('0x41')]]['toString']()});}else if(_0x20c87b[_0x5096('0x38')]===_0x5096('0x43')&&_0x20c87b[_0x5096('0x44')]&&_0x20c87b[_0x5096('0x44')][_0x5096('0xe')]&&_0x20c87b['idField']&&_0x20c87b[_0x5096('0x3e')]){_0x1fa1a0[_0x20c87b[_0x5096('0x44')][_0x5096('0xe')][_0x5096('0x3a')]()]&&_0x2b5fe5[_0x5096('0x3f')][_0x5096('0x42')]({'id':_0x20c87b[_0x5096('0x3d')],'value':_0x1fa1a0[_0x20c87b['Variable'][_0x5096('0xe')][_0x5096('0x3a')]()][_0x5096('0x40')]()});}});}return _0x2b5fe5;}exports[_0x5096('0x45')]=function(_0xd4b57d,_0x41a9d1,_0x5c5291,_0x34ea2a,_0x4215f1,_0x2d0842){var _0x375e33,_0x24174b;_0x2d0842[_0x5096('0xa')]=intUtil[_0x5096('0x46')](_0x2d0842[_0x5096('0xa')]);_0x2d0842[_0x5096('0x47')]=intUtil[_0x5096('0x46')](_0x2d0842[_0x5096('0x47')]);if(_0x4215f1&&_0x4215f1[_0x5096('0x48')]){logger[_0x5096('0x7')](_0x5096('0x49'),_0x5096('0x4a'));_0x41a9d1[_0x5096('0x4b')]=util[_0x5096('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2d0842[_0x5096('0x47')],_0x41a9d1[_0x5096('0x4c')],md5(_0x41a9d1[_0x5096('0x4c')]));}else{_0x41a9d1[_0x5096('0x4b')]='';}headers[_0x5096('0x4d')]=getAuth(_0x2d0842);return getUser(_0x2d0842,_0x34ea2a['email'])[_0x5096('0x12')](function(_0x2dfef2){_0x375e33=_0x2dfef2;logger[_0x5096('0x7')](_0x5096('0x4e'),_0x375e33['id']);return getEndUser(_0x2d0842,_0x41a9d1['calleridname'],_0x41a9d1[_0x5096('0x4f')]);})[_0x5096('0x12')](function(_0x323a61){_0x24174b=_0x323a61;logger[_0x5096('0x7')](_0x5096('0x50'),_0x24174b['id']);return getTicket(_0x2d0842,_0x375e33,_0x24174b,_0x5c5291,_0x41a9d1);})[_0x5096('0x12')](function(_0x115365){if(_0x115365){logger[_0x5096('0x7')](_0x5096('0x51'),_0x115365['id']);switch(_0x2d0842['type']){case _0x5096('0x52'):logger[_0x5096('0x7')](_0x5096('0x49'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5096('0x17')](_0x5096('0x53'),_0x2d0842[_0x5096('0xa')],_0x375e33['id'],_0x115365['id']),'method':_0x5096('0xb')});case _0x5096('0x54'):logger['info'](_0x5096('0x49'),_0x5096('0x55'));emit(util[_0x5096('0x17')](_0x5096('0x56'),_0x34ea2a[_0x5096('0xe')]),'trigger:browser:url',{'uri':util[_0x5096('0x17')](_0x5096('0x57'),_0x2d0842['remoteUri'][_0x5096('0x58')](_0x5096('0x59'),''),_0x115365['id'])});break;default:logger[_0x5096('0x5a')](_0x5096('0x49'),_0x5096('0x5b'));}}})[_0x5096('0x5c')](function(_0x2a210b){logger[_0x5096('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5096('0x5d')](_0x2a210b,{'showHidden':!![],'depth':null}));});};exports[_0x5096('0x5e')]=function(_0x24d96b,_0x5a50dd,_0x1ebff1,_0x5b7437,_0x59a7c2,_0x4bd4e8,_0x2233ef){var _0x5a8e9d,_0x259432;_0x4bd4e8[_0x5096('0xa')]=intUtil[_0x5096('0x46')](_0x4bd4e8['remoteUri']);_0x4bd4e8[_0x5096('0x47')]=intUtil[_0x5096('0x46')](_0x4bd4e8[_0x5096('0x47')]);if(_0x2233ef&&_0x2233ef[_0x5096('0x5f')]&&_0x2233ef['recordingFormat']!==_0x5096('0x60')){logger[_0x5096('0x7')](_0x5096('0x61'),_0x5096('0x4a'));_0x5a50dd[_0x5096('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bd4e8[_0x5096('0x47')],_0x5a50dd[_0x5096('0x4c')],md5(_0x5a50dd[_0x5096('0x4c')]));}headers[_0x5096('0x4d')]=getAuth(_0x4bd4e8);return getUser(_0x4bd4e8,_0x5b7437['email'])['then'](function(_0x3383b5){_0x5a8e9d=_0x3383b5;logger['info'](_0x5096('0x4e'),_0x5a8e9d['id']);return getEndUser(_0x4bd4e8,_0x5a50dd[_0x5096('0x62')],_0x5a50dd['destcalleridnum']);})[_0x5096('0x12')](function(_0x57d8e0){_0x259432=_0x57d8e0;logger['info'](_0x5096('0x50'),_0x259432['id']);return getTicket(_0x4bd4e8,_0x5a8e9d,_0x259432,_0x1ebff1,_0x5a50dd);})['then'](function(_0x1ea10f){if(_0x1ea10f){logger[_0x5096('0x7')](_0x5096('0x51'),_0x1ea10f['id']);switch(_0x4bd4e8[_0x5096('0x38')]){case _0x5096('0x52'):logger['info'](_0x5096('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5096('0x17')](_0x5096('0x53'),_0x4bd4e8['remoteUri'],_0x5a8e9d['id'],_0x1ea10f['id']),'method':_0x5096('0xb')});case _0x5096('0x54'):logger[_0x5096('0x7')](_0x5096('0x61'),_0x5096('0x55'));emit(util['format']('user:%s',_0x5b7437[_0x5096('0xe')]),_0x5096('0x63'),{'uri':util[_0x5096('0x17')](_0x5096('0x57'),_0x4bd4e8[_0x5096('0xa')]['replace']('/api/v2',''),_0x1ea10f['id'])});break;default:logger[_0x5096('0x5a')](_0x5096('0x61'),_0x5096('0x5b'));}}})[_0x5096('0x5c')](function(_0x406b4e){logger[_0x5096('0x5a')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5096('0x5d')](_0x406b4e,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2af256,_0x39164b,_0xee1a60,_0x3baa59,_0xf0342,_0x4e2b5b){var _0x324e79,_0x37680d;_0x4e2b5b['remoteUri']=intUtil[_0x5096('0x46')](_0x4e2b5b[_0x5096('0xa')]);_0x4e2b5b['serverUrl']=intUtil[_0x5096('0x46')](_0x4e2b5b[_0x5096('0x47')]);if(_0xf0342&&_0xf0342['monitor_format']){logger['info']('['+_0x39164b[_0x5096('0x64')][_0x5096('0x65')]()+']',_0x5096('0x4a'));_0x39164b['recordingURL']=util[_0x5096('0x17')](_0x5096('0x66'),_0x4e2b5b[_0x5096('0x47')],_0x39164b[_0x5096('0x4c')],md5(_0x39164b[_0x5096('0x4c')]));}else{_0x39164b[_0x5096('0x4b')]='';}headers[_0x5096('0x4d')]=getAuth(_0x4e2b5b);return getUser(_0x4e2b5b)[_0x5096('0x12')](function(_0x2ca580){_0x324e79=_0x2ca580;logger[_0x5096('0x7')](_0x5096('0x4e'),_0x324e79['id']);return getEndUser(_0x4e2b5b,_0x39164b[_0x5096('0x67')],_0x39164b[_0x5096('0x4f')]);})[_0x5096('0x12')](function(_0x2b783c){_0x37680d=_0x2b783c;logger[_0x5096('0x7')]('The\x20Enduser\x20ID\x20is:',_0x37680d['id']);return getTicket(_0x4e2b5b,_0x324e79,_0x37680d,_0xee1a60,_0x39164b);})[_0x5096('0x12')](function(_0x410a8b){if(_0x410a8b){logger['info'](_0x5096('0x51'),_0x410a8b['id']);}})[_0x5096('0x5c')](function(_0x35f135){logger['error']('['+_0x39164b[_0x5096('0x64')][_0x5096('0x65')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x35f135,{'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 8113993..217da6c 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 _0x073e=['/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','uniqueid','email','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','request-promise','md5','util','bluebird','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','string','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','clientSecret','refresh_token','add','seconds','catch','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','isArrayLikeObject','users','Agent\x20found!','findIndex','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri'];(function(_0x1c12fa,_0x5448ce){var _0x2fbdc9=function(_0x25f783){while(--_0x25f783){_0x1c12fa['push'](_0x1c12fa['shift']());}};_0x2fbdc9(++_0x5448ce);}(_0x073e,0x181));var _0xe073=function(_0x52e58c,_0x443bb3){_0x52e58c=_0x52e58c-0x0;var _0x3646af=_0x073e[_0x52e58c];return _0x3646af;};'use strict';var _=require(_0xe073('0x0'));var rp=require(_0xe073('0x1'));var md5=require(_0xe073('0x2'));var util=require(_0xe073('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xe073('0x4'));var config=require(_0xe073('0x5'));var logger=require(_0xe073('0x6'))('zoho');config['redis']=_['defaults'](config[_0xe073('0x7')],{'host':_0xe073('0x8'),'port':0x18eb});var io=require(_0xe073('0x9'))(new Redis(config[_0xe073('0x7')]));function emit(_0x373bf6,_0x1a93da,_0x483f85){io['to'](_0x373bf6)[_0xe073('0xa')](_0x1a93da,_0x483f85);}function request(_0x7a1f21){logger[_0xe073('0xb')](_0xe073('0xc'),JSON['stringify'](_0x7a1f21));return rp(_0x7a1f21);}function getCustomFields(_0x47ac27,_0x32878f){var _0x34d9aa={};if(_0x47ac27[_0xe073('0xd')]>0x0){_[_0xe073('0xe')](_0x47ac27,function(_0x3ae5f3){if(_['includes']([_0xe073('0xf'),'picklist'],_0x3ae5f3[_0xe073('0x10')])&&_0x3ae5f3['idField']){_0x34d9aa[_0x3ae5f3[_0xe073('0x11')]]=_0x3ae5f3['content'][_0xe073('0x12')]();}else if(_0x3ae5f3[_0xe073('0x10')]===_0xe073('0x13')&&_0x3ae5f3[_0xe073('0x14')]&&_0x3ae5f3[_0xe073('0x11')]&&_0x32878f[_0x3ae5f3[_0xe073('0x14')]]){_0x34d9aa[_0x3ae5f3[_0xe073('0x11')]]=_0x32878f[_0x3ae5f3[_0xe073('0x14')]][_0xe073('0x12')]();}else if(_0x3ae5f3[_0xe073('0x10')]===_0xe073('0x15')&&_0x3ae5f3['Variable']&&_0x3ae5f3['Variable']['name']&&_0x3ae5f3[_0xe073('0x11')]&&_0x32878f[_0x3ae5f3[_0xe073('0x16')][_0xe073('0x17')][_0xe073('0x18')]()]){_0x34d9aa[_0x3ae5f3['idField']]=_0x32878f[_0x3ae5f3[_0xe073('0x16')][_0xe073('0x17')][_0xe073('0x18')]()]['toString']();}});}return _0x34d9aa;}function getName(_0x21c02e){if(_0x21c02e[_0xe073('0x19')]('\x20')>0x0){var _0x1e11e5=_0x21c02e[_0xe073('0x1a')](/ (.+)/);if(_0x1e11e5[0x1]){return _0x1e11e5;}}return[_0x21c02e,_0x21c02e];}var accountsTokens={};function getAccessToken(_0x43668e){return new Promise(function(_0x17dd4b,_0x41639a){if(!_[_0xe073('0x1b')](accountsTokens[_0x43668e['id']])&&!_[_0xe073('0x1b')](accountsTokens[_0x43668e['id']][_0xe073('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x43668e['id']][_0xe073('0x1d')])){_0x17dd4b(accountsTokens[_0x43668e['id']][_0xe073('0x1c')]);}}var _0x419703;switch(_0x43668e[_0xe073('0x1e')]){case'US':_0x419703=_0xe073('0x1f');break;case'AU':_0x419703=_0xe073('0x20');break;case'EU':_0x419703='https://accounts.zoho.eu';break;case'IN':_0x419703='https://accounts.zoho.in';break;case'CN':_0x419703=_0xe073('0x21');break;default:_0x419703='https://accounts.zoho.eu';break;}var _0x5e3b16={'method':'POST','uri':_0x419703+'/oauth/v2/token','qs':{'refresh_token':_0x43668e['refreshToken'],'client_id':_0x43668e['clientId'],'client_secret':_0x43668e[_0xe073('0x22')],'grant_type':_0xe073('0x23')},'json':!![]};return rp(_0x5e3b16)['then'](function(_0x1fca27){accountsTokens[_0x43668e['id']]={'access_token':_0x1fca27[_0xe073('0x1c')],'expires_in':moment()[_0xe073('0x24')](_0x1fca27['expires_in'],_0xe073('0x25'))};_0x17dd4b(_0x1fca27['access_token']);})[_0xe073('0x26')](function(_0x2e5fac){logger['error']('Failing\x20creating\x20the\x20access_token',_0x2e5fac[_0xe073('0x27')]);_0x41639a(_0x2e5fac);});});}function getUser(_0x859ed8,_0x278fbb,_0x2f1cd2,_0x20fabe){logger[_0xe073('0x28')](_0xe073('0x29'));return request({'method':_0xe073('0x2a'),'uri':util['format'](_0xe073('0x2b'),_0x278fbb),'qs':{'type':_0xe073('0x2c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x859ed8},'json':!![]})['then'](function(_0x417dbb){if(_0x417dbb['users']){var _0x3f6564=-0x1;if(_[_0xe073('0x2d')](_0x417dbb[_0xe073('0x2e')])){if(!_['isNil'](_0x20fabe)){_0x3f6564=_['findIndex'](_0x417dbb[_0xe073('0x2e')],function(_0xd17323){return _0xd17323['email']===_0x20fabe;});}if(_0x3f6564>=0x0){logger[_0xe073('0x28')](_0xe073('0x2f'));}else{logger[_0xe073('0x28')]('Using\x20the\x20admin\x20account!');_0x3f6564=_[_0xe073('0x30')](_0x417dbb['users'],function(_0x497a04){return _0x497a04[_0xe073('0x31')][_0xe073('0x17')]===_0xe073('0x32');});}return _0x417dbb['users'][_0x3f6564];}else{if(_0x417dbb[_0xe073('0x33')][_0xe073('0x31')][_0xe073('0x17')]==='Administrator'){logger[_0xe073('0x28')](_0xe073('0x34'));user=_0x417dbb[_0xe073('0x33')];return user;}else{logger[_0xe073('0x35')](_0xe073('0x36'),JSON[_0xe073('0x37')](_0x417dbb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xe073('0x37')](_0x417dbb));}}}else{logger[_0xe073('0x35')](_0xe073('0x36'),JSON['stringify'](_0x417dbb));throw new Error(_0xe073('0x38')+JSON[_0xe073('0x37')](_0x417dbb));}})[_0xe073('0x26')](function(_0xc348b1){console[_0xe073('0x35')](_0xc348b1);});}function getZohoUser(_0x4de55f,_0x2b7cc3){return new BPromise(function(_0x5abc09,_0x2c20a5){request(_0x4de55f)[_0xe073('0x39')](function(_0x469537){var _0x5874b7=null;if(_0x469537){_0x5874b7=_0x469537[_0xe073('0x3a')][0x0];_0x5874b7[_0xe073('0x3b')]=_0x2b7cc3;}_0x5abc09(_0x5874b7);})[_0xe073('0x26')](function(_0x254d2f){_0x2c20a5(_0x254d2f);});});}function createEndUser(_0x23a210,_0x3d29e5,_0x12976c,_0x300ef8,_0x16be1a,_0x4f7b2b){var _0x12976c=getName(_0x12976c);return request({'method':'POST','uri':_0xe073('0x3c')+_0x3d29e5+_0xe073('0x3d')+_[_0xe073('0x3e')](_0x4f7b2b[_0xe073('0x3f')])+'s','body':{'data':[{'Last_Name':_0x12976c[0x1],'First_Name':_0x12976c[0x0],'Phone':_0x300ef8,'Owner':{'name':!_['isNil'](_0x16be1a[_0xe073('0x40')][_0xe073('0x17')])?_0x16be1a[_0xe073('0x40')][_0xe073('0x17')]:!_[_0xe073('0x1b')](_0x16be1a['first_name'])?_0x16be1a[_0xe073('0x41')]+'\x20'+_0x16be1a['last_name']:_0x16be1a[_0xe073('0x42')],'id':_0x16be1a['id']}}]},'headers':{'Authorization':_0xe073('0x43')+_0x23a210},'json':!![]})[_0xe073('0x39')](function(_0x76ae2e){if(_0x76ae2e&&_0x76ae2e[_0xe073('0x3a')][0x0][_0xe073('0x44')]===_0xe073('0x45')){var _0x2f4939=_0x76ae2e[_0xe073('0x3a')][0x0][_0xe073('0x46')];_0x2f4939[_0xe073('0x3b')]=_['startCase'](_0x4f7b2b['moduleCreate'])+'s';return _0x2f4939;}logger[_0xe073('0x35')](_0xe073('0x36'),JSON[_0xe073('0x37')](data));throw new Error(_0xe073('0x47')+JSON[_0xe073('0x37')](data));})['catch'](function(_0xb93fc9){console[_0xe073('0x48')](_0xe073('0x49'),_0xb93fc9);});}function getEndUser(_0xb60a8c,_0x1ea75a,_0x59273a,_0x62ed73,_0x498b5f,_0x5aad64,_0x122f82){var _0x2b1f2a={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xb60a8c},'json':!![]};switch(_0x122f82[_0xe073('0x4a')]){case _0xe073('0x4b'):_0x2b1f2a[_0xe073('0x4c')]=_0xe073('0x3c')+_0x1ea75a+_0xe073('0x4d')+_0x498b5f+'))';return getZohoUser(_0x2b1f2a,_0xe073('0x4e'))[_0xe073('0x39')](function(_0x5c7c66){if(_0x5c7c66)return _0x5c7c66;_0x2b1f2a[_0xe073('0x4c')]='https://www.zohoapis.'+_0x1ea75a+_0xe073('0x4f')+_0x498b5f+'))';return getZohoUser(_0x2b1f2a,_0xe073('0x50'))[_0xe073('0x39')](function(_0x4e1f1d){if(_0x4e1f1d)return _0x4e1f1d;if(_0x122f82['moduleCreate']!=_0xe073('0x51')){return createEndUser(_0xb60a8c,_0x1ea75a,_0x62ed73,_0x498b5f,_0x5aad64,_0x122f82);}else{return{};}});});break;case _0xe073('0x52'):_0x2b1f2a[_0xe073('0x4c')]='https://www.zohoapis.'+_0x1ea75a+_0xe073('0x4d')+_0x498b5f+'))';return getZohoUser(_0x2b1f2a,_0xe073('0x4e'))[_0xe073('0x39')](function(_0x3a4fc1){if(_0x3a4fc1)return _0x3a4fc1;if(_0x122f82[_0xe073('0x3f')]!=_0xe073('0x51')){return createEndUser(_0xb60a8c,_0x1ea75a,_0x62ed73,_0x498b5f,_0x5aad64,_0x122f82);}else{return{};}});break;case _0xe073('0x53'):_0x2b1f2a[_0xe073('0x4c')]=_0xe073('0x3c')+_0x1ea75a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x498b5f+'))';return getZohoUser(_0x2b1f2a,_0xe073('0x50'))['then'](function(_0x145bff){if(_0x145bff)return _0x145bff;if(_0x122f82['moduleCreate']!=_0xe073('0x51')){return createEndUser(_0xb60a8c,_0x1ea75a,_0x62ed73,_0x498b5f,_0x5aad64,_0x122f82);}else{return{};}});break;}}function getCall(_0x202687,_0x22e72a,_0xc7ff7c,_0x527a35,_0x2a3d65,_0x1090c4,_0x191005,_0x48a470){logger['info'](_0xe073('0x54'));var _0x1b12f8={};_0x1b12f8[_0xe073('0x55')]={'name':!_[_0xe073('0x1b')](_0x527a35[_0xe073('0x40')]['name'])&&!_[_0xe073('0x1b')](_0x527a35[_0xe073('0x31')][_0xe073('0x17')])&&_0x527a35[_0xe073('0x31')][_0xe073('0x17')]===_0xe073('0x56')?_0x527a35[_0xe073('0x40')][_0xe073('0x17')]:!_[_0xe073('0x1b')](_0x527a35[_0xe073('0x41')])?_0x527a35['first_name']+'\x20'+_0x527a35[_0xe073('0x42')]:_0x527a35['last_name'],'id':_0x527a35['id']};_0x1b12f8['Subject']=intUtil[_0xe073('0x57')](_0x1090c4[_0xe073('0x58')],_0x191005,'\x20');_0x1b12f8[_0xe073('0x59')]=intUtil['getString'](_0x1090c4[_0xe073('0x5a')],_0x191005,'\x0a');if(_0x2a3d65[_0xe073('0x3b')]===_0xe073('0x4e')){_0x1b12f8['Who_Id']={'name':!_[_0xe073('0x1b')](_0x2a3d65['Full_Name'])?_0x2a3d65[_0xe073('0x5b')]:!_[_0xe073('0x1b')](_0x2a3d65[_0xe073('0x5c')])?_0x2a3d65[_0xe073('0x5c')]+'\x20'+_0x2a3d65[_0xe073('0x5d')]:_0x2a3d65[_0xe073('0x5d')],'id':_0x2a3d65['id']};}if(_0x2a3d65[_0xe073('0x3b')]===_0xe073('0x50')){_0x1b12f8[_0xe073('0x5e')]={'name':!_[_0xe073('0x1b')](_0x2a3d65[_0xe073('0x5b')])?_0x2a3d65[_0xe073('0x5b')]:!_[_0xe073('0x1b')](_0x2a3d65[_0xe073('0x5c')])?_0x2a3d65[_0xe073('0x5c')]+'\x20'+_0x2a3d65[_0xe073('0x5d')]:_0x2a3d65[_0xe073('0x5d')],'id':_0x2a3d65['id']};_0x1b12f8[_0xe073('0x5f')]=_[_0xe073('0x3e')](_0x2a3d65[_0xe073('0x3b')]);}if(_0x191005[_0xe073('0x60')]){_0x1b12f8[_0xe073('0x61')]=moment[_0xe073('0x62')](parseInt(_0x191005[_0xe073('0x60')])*0x3e8)[_0xe073('0x63')](_0xe073('0x64'));}else if(_0x191005['answertime']&&_0x191005[_0xe073('0x65')]){_0x1b12f8[_0xe073('0x61')]=moment[_0xe073('0x62')](moment(_0x191005[_0xe073('0x65')],_0xe073('0x66'))['diff'](moment(_0x191005[_0xe073('0x67')],'YYYY-MM-DDTHH:mm:ss')))[_0xe073('0x63')](_0xe073('0x64'));}switch(_0x191005[_0xe073('0x68')]){case _0xe073('0x69'):_0x1b12f8[_0xe073('0x6a')]=_0xe073('0x6b');break;case'complete':case _0xe073('0x6c'):_0x1b12f8['Call_Result']=_0xe073('0x6d');break;case'rejected':_0x1b12f8[_0xe073('0x6a')]=_0xe073('0x6e');break;case _0xe073('0x6f'):_0x1b12f8[_0xe073('0x6a')]=_0xe073('0x70');break;case _0xe073('0x71'):_0x1b12f8[_0xe073('0x6a')]=_0xe073('0x72');default:}_0x1b12f8[_0xe073('0x73')]=(_0x48a470===_0xe073('0x74')?moment(_0x191005[_0xe073('0x67')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x191005[_0xe073('0x75')])[_0xe073('0x63')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xe073('0x66'));_0x1b12f8[_0xe073('0x76')]=_0x48a470||_0xe073('0x77');_0x1b12f8=_[_0xe073('0x78')](_0x1b12f8,getCustomFields(_0x1090c4[_0xe073('0x79')],_0x191005));return request({'method':'POST','uri':_0xe073('0x3c')+_0x22e72a+_0xe073('0x7a'),'headers':{'Authorization':_0xe073('0x43')+_0x202687},'body':{'data':[_0x1b12f8]},'json':!![]})[_0xe073('0x39')](function(_0x1dd337){if(_0x1dd337&&_0x1dd337[_0xe073('0x3a')][0x0][_0xe073('0x44')]===_0xe073('0x45')){logger[_0xe073('0x28')](_0xe073('0x7b'));return{'id':_0x1dd337['data'][0x0][_0xe073('0x46')]['id']};}})['catch'](function(_0x4c0335){logger[_0xe073('0x28')](_0xe073('0x7c'),_0x4c0335[_0xe073('0x27')]);console[_0xe073('0x48')](_0xe073('0x7c'),_0x4c0335);});}exports[_0xe073('0x7d')]=function(_0x31a0e2,_0x148dd4,_0x1b4e7a,_0x9e5d1b,_0x5d4f1a,_0x2b8cf9){var _0x1c054f,_0x3b1e06,_0x654c64;_0x2b8cf9[_0xe073('0x7e')]=intUtil['stripTrailingSlash'](_0x2b8cf9['host']);_0x2b8cf9[_0xe073('0x7f')]=intUtil[_0xe073('0x80')](_0x2b8cf9[_0xe073('0x7f')]);if(_0x5d4f1a&&_0x5d4f1a[_0xe073('0x81')]){logger['info']('[QUEUE]',_0xe073('0x82'));_0x148dd4[_0xe073('0x83')]=_0x2b8cf9[_0xe073('0x7f')]+_0xe073('0x84')+_0x148dd4['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x148dd4['uniqueid']);}else{_0x148dd4[_0xe073('0x83')]='';}var _0x1a6025=_0x2b8cf9[_0xe073('0x7e')]===_0xe073('0x85')?'eu':_0xe073('0x86');return getAccessToken(_0x2b8cf9)[_0xe073('0x39')](function(_0x3fd893){_0x654c64=_0x3fd893;return getUser(_0x654c64,_0x1a6025,_0x2b8cf9,_0x9e5d1b['email']);})['then'](function(_0x4e1b13){_0x1c054f=_0x4e1b13;logger[_0xe073('0x28')](_0xe073('0x87'),_0x1c054f['id']);return getEndUser(_0x654c64,_0x1a6025,_0x2b8cf9,_0x148dd4[_0xe073('0x88')],_0x148dd4[_0xe073('0x89')],_0x1c054f,_0x1b4e7a);})['then'](function(_0x3be285){_0x3b1e06=_0x3be285;return getCall(_0x654c64,_0x1a6025,_0x2b8cf9,_0x1c054f,_0x3b1e06,_0x1b4e7a,_0x148dd4,'Inbound');})['then'](function(_0x11b8fe){if(_0x11b8fe){logger[_0xe073('0x28')](_0xe073('0x8a'),_0x11b8fe['id']);logger[_0xe073('0x28')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe073('0x63')](_0xe073('0x8b'),_0x9e5d1b['name']),_0xe073('0x8c'),{'uri':_0xe073('0x8d')+_0x2b8cf9[_0xe073('0x7e')]+_0xe073('0x8e')+_0x11b8fe['id']});}})['catch'](function(_0x16eb14){logger[_0xe073('0x35')]('[QUEUE]',JSON[_0xe073('0x37')](_0x16eb14));});};exports[_0xe073('0x74')]=function(_0x499a4c,_0xb09228,_0x1d5f26,_0x1c6523,_0x41176d,_0x453a47,_0x5e1243){var _0x2d2dde,_0xff2a4c,_0x5102ac;_0x453a47[_0xe073('0x7e')]=intUtil[_0xe073('0x80')](_0x453a47[_0xe073('0x7e')]);_0x453a47[_0xe073('0x7f')]=intUtil[_0xe073('0x80')](_0x453a47[_0xe073('0x7f')]);if(_0x5e1243&&_0x5e1243[_0xe073('0x8f')]&&_0x5e1243[_0xe073('0x8f')]!==_0xe073('0x90')){logger['info'](_0xe073('0x91'),'Recording\x20is\x20enabled!');_0xb09228[_0xe073('0x83')]=_0x453a47[_0xe073('0x7f')]+_0xe073('0x84')+_0xb09228['uniqueid']+_0xe073('0x92')+md5(_0xb09228[_0xe073('0x93')]);}var _0x498e4e=_0x453a47[_0xe073('0x7e')]===_0xe073('0x85')?'eu':_0xe073('0x86');return getAccessToken(_0x453a47)[_0xe073('0x39')](function(_0x13f1da){_0x5102ac=_0x13f1da;return getUser(_0x5102ac,_0x498e4e,_0x453a47,_0x1c6523[_0xe073('0x94')]);})[_0xe073('0x39')](function(_0x55360a){_0x2d2dde=_0x55360a;logger[_0xe073('0x28')]('The\x20User\x20ID\x20is:',_0x2d2dde['id']);return getEndUser(_0x5102ac,_0x498e4e,_0x453a47,_0xb09228[_0xe073('0x95')],_0xb09228[_0xe073('0x96')],_0x2d2dde,_0x1d5f26);})[_0xe073('0x39')](function(_0x13fdef){_0xff2a4c=_0x13fdef;return getCall(_0x5102ac,_0x498e4e,_0x453a47,_0x2d2dde,_0xff2a4c,_0x1d5f26,_0xb09228,_0xe073('0x97'));})[_0xe073('0x39')](function(_0x18e696){if(_0x18e696){logger['info'](_0xe073('0x8a'),_0x18e696['id']);logger['info'](_0xe073('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe073('0x63')](_0xe073('0x8b'),_0x1c6523['name']),_0xe073('0x8c'),{'uri':_0xe073('0x8d')+_0x453a47[_0xe073('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x18e696['id']});}})[_0xe073('0x26')](function(_0x1eaad5){logger[_0xe073('0x35')](_0xe073('0x91'),JSON[_0xe073('0x37')](_0x1eaad5));});};exports[_0xe073('0x98')]=function(_0x2c02e0,_0x34762b,_0x3a2bc4,_0xf818cd,_0x33ad08,_0x11bc08){var _0x28946b,_0x232577,_0x5b26ed;_0x11bc08[_0xe073('0x7e')]=intUtil[_0xe073('0x80')](_0x11bc08['host']);_0x11bc08[_0xe073('0x7f')]=intUtil[_0xe073('0x80')](_0x11bc08[_0xe073('0x7f')]);if(_0x33ad08&&_0x33ad08['monitor_format']){logger[_0xe073('0x28')]('['+_0x34762b[_0xe073('0x68')][_0xe073('0x99')]()+']',_0xe073('0x82'));_0x34762b[_0xe073('0x83')]=_0x11bc08[_0xe073('0x7f')]+_0xe073('0x84')+_0x34762b[_0xe073('0x93')]+_0xe073('0x92')+md5(_0x34762b[_0xe073('0x93')]);}else{_0x34762b[_0xe073('0x83')]='';}var _0x4fd5d8=_0x11bc08[_0xe073('0x7e')]===_0xe073('0x85')?'eu':_0xe073('0x86');return getAccessToken(_0x11bc08)[_0xe073('0x39')](function(_0x264c15){_0x5b26ed=_0x264c15;return getUser(_0x5b26ed,_0x4fd5d8,_0x11bc08);})[_0xe073('0x39')](function(_0x3ac9e2){_0x28946b=_0x3ac9e2;logger['info'](_0xe073('0x87'),_0x28946b['id']);return getEndUser(_0x5b26ed,_0x4fd5d8,_0x11bc08,_0x34762b[_0xe073('0x88')],_0x34762b['calleridnum'],_0x28946b,_0x3a2bc4);})[_0xe073('0x39')](function(_0x7ce7ba){_0x232577=_0x7ce7ba;return getCall(_0x5b26ed,_0x4fd5d8,_0x11bc08,_0x28946b,_0x232577,_0x3a2bc4,_0x34762b,_0xe073('0x77'));})['then'](function(_0x1ec64d){if(_0x1ec64d){logger['info'](_0xe073('0x8a'),_0x1ec64d['id']);}})[_0xe073('0x26')](function(_0x182298){logger[_0xe073('0x35')]('['+_0x34762b['lastevent'][_0xe073('0x99')]()+']',JSON[_0xe073('0x37')](_0x182298));});}; \ No newline at end of file +var _0x7602=['outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridnum','Outbound','user:%s','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','info','error','The\x20failing\x20result\x20is','catch','data','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','startCase','talktime','answertime','endtime','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time'];(function(_0xb08125,_0x561acb){var _0x2ace23=function(_0x50dbbf){while(--_0x50dbbf){_0xb08125['push'](_0xb08125['shift']());}};_0x2ace23(++_0x561acb);}(_0x7602,0x15e));var _0x2760=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x7602[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x2760('0x0'));var rp=require(_0x2760('0x1'));var md5=require(_0x2760('0x2'));var util=require(_0x2760('0x3'));var intUtil=require(_0x2760('0x4'));var moment=require(_0x2760('0x5'));var Redis=require(_0x2760('0x6'));var BPromise=require(_0x2760('0x7'));var config=require(_0x2760('0x8'));var logger=require(_0x2760('0x9'))(_0x2760('0xa'));config[_0x2760('0xb')]=_[_0x2760('0xc')](config[_0x2760('0xb')],{'host':_0x2760('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5e0ac6,_0x41ad79,_0x4dd9b3){io['to'](_0x5e0ac6)['emit'](_0x41ad79,_0x4dd9b3);}function request(_0x1cea59){logger[_0x2760('0xe')](_0x2760('0xf'),JSON[_0x2760('0x10')](_0x1cea59));return rp(_0x1cea59);}function getCustomFields(_0x3f0911,_0x1473cc){var _0x558ad5={};if(_0x3f0911[_0x2760('0x11')]>0x0){_[_0x2760('0x12')](_0x3f0911,function(_0x49d740){if(_['includes']([_0x2760('0x13'),_0x2760('0x14')],_0x49d740[_0x2760('0x15')])&&_0x49d740[_0x2760('0x16')]){_0x558ad5[_0x49d740[_0x2760('0x16')]]=_0x49d740['content'][_0x2760('0x17')]();}else if(_0x49d740[_0x2760('0x15')]===_0x2760('0x18')&&_0x49d740[_0x2760('0x19')]&&_0x49d740[_0x2760('0x16')]&&_0x1473cc[_0x49d740[_0x2760('0x19')]]){_0x558ad5[_0x49d740['idField']]=_0x1473cc[_0x49d740['variableName']][_0x2760('0x17')]();}else if(_0x49d740['type']==='customVariable'&&_0x49d740['Variable']&&_0x49d740[_0x2760('0x1a')][_0x2760('0x1b')]&&_0x49d740[_0x2760('0x16')]&&_0x1473cc[_0x49d740[_0x2760('0x1a')][_0x2760('0x1b')][_0x2760('0x1c')]()]){_0x558ad5[_0x49d740[_0x2760('0x16')]]=_0x1473cc[_0x49d740['Variable'][_0x2760('0x1b')][_0x2760('0x1c')]()][_0x2760('0x17')]();}});}return _0x558ad5;}function getName(_0x4cd1ce){if(_0x4cd1ce[_0x2760('0x1d')]('\x20')>0x0){var _0x593e9f=_0x4cd1ce['split'](/ (.+)/);if(_0x593e9f[0x1]){return _0x593e9f;}}return[_0x4cd1ce,_0x4cd1ce];}var accountsTokens={};function getAccessToken(_0xd54f5a){return new Promise(function(_0x5b9222,_0x4dad1e){if(!_['isNil'](accountsTokens[_0xd54f5a['id']])&&!_[_0x2760('0x1e')](accountsTokens[_0xd54f5a['id']][_0x2760('0x1f')])){if(moment()[_0x2760('0x20')](accountsTokens[_0xd54f5a['id']][_0x2760('0x21')])){_0x5b9222(accountsTokens[_0xd54f5a['id']][_0x2760('0x1f')]);}}var _0x26dde4;switch(_0xd54f5a['zone']){case'US':_0x26dde4=_0x2760('0x22');break;case'AU':_0x26dde4=_0x2760('0x23');break;case'EU':_0x26dde4='https://accounts.zoho.eu';break;case'IN':_0x26dde4='https://accounts.zoho.in';break;case'CN':_0x26dde4=_0x2760('0x24');break;default:_0x26dde4='https://accounts.zoho.eu';break;}var _0x49cc4a={'method':_0x2760('0x25'),'uri':_0x26dde4+_0x2760('0x26'),'qs':{'refresh_token':_0xd54f5a['refreshToken'],'client_id':_0xd54f5a[_0x2760('0x27')],'client_secret':_0xd54f5a[_0x2760('0x28')],'grant_type':_0x2760('0x29')},'json':!![]};return rp(_0x49cc4a)[_0x2760('0x2a')](function(_0x4569dd){accountsTokens[_0xd54f5a['id']]={'access_token':_0x4569dd[_0x2760('0x1f')],'expires_in':moment()['add'](_0x4569dd[_0x2760('0x21')],_0x2760('0x2b'))};_0x5b9222(_0x4569dd['access_token']);})['catch'](function(_0x1e3ae5){logger['error'](_0x2760('0x2c'),_0x1e3ae5[_0x2760('0x2d')]);_0x4dad1e(_0x1e3ae5);});});}function getUser(_0x15f7bf,_0x365a1d,_0x37b882,_0xb69fe7){logger['info'](_0x2760('0x2e'));return request({'method':'GET','uri':util[_0x2760('0x2f')](_0x2760('0x30'),_0x365a1d),'qs':{'type':_0x2760('0x31')},'headers':{'Authorization':_0x2760('0x32')+_0x15f7bf},'json':!![]})[_0x2760('0x2a')](function(_0x5d181e){if(_0x5d181e[_0x2760('0x33')]){var _0x1a5470=-0x1;if(_[_0x2760('0x34')](_0x5d181e[_0x2760('0x33')])){if(!_['isNil'](_0xb69fe7)){_0x1a5470=_[_0x2760('0x35')](_0x5d181e[_0x2760('0x33')],function(_0x539f95){return _0x539f95[_0x2760('0x36')]===_0xb69fe7;});}if(_0x1a5470>=0x0){logger['info'](_0x2760('0x37'));}else{logger['info'](_0x2760('0x38'));_0x1a5470=_[_0x2760('0x35')](_0x5d181e[_0x2760('0x33')],function(_0x8defaf){return _0x8defaf[_0x2760('0x39')][_0x2760('0x1b')]===_0x2760('0x3a');});}return _0x5d181e[_0x2760('0x33')][_0x1a5470];}else{if(_0x5d181e[_0x2760('0x3b')][_0x2760('0x39')][_0x2760('0x1b')]===_0x2760('0x3a')){logger[_0x2760('0x3c')](_0x2760('0x38'));user=_0x5d181e[_0x2760('0x3b')];return user;}else{logger[_0x2760('0x3d')](_0x2760('0x3e'),JSON['stringify'](_0x5d181e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2760('0x10')](_0x5d181e));}}}else{logger[_0x2760('0x3d')](_0x2760('0x3e'),JSON[_0x2760('0x10')](_0x5d181e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2760('0x10')](_0x5d181e));}})[_0x2760('0x3f')](function(_0x3676d2){console[_0x2760('0x3d')](_0x3676d2);});}function getZohoUser(_0x3e4a96,_0x381a4f){return new BPromise(function(_0x628fe4,_0x52e278){request(_0x3e4a96)[_0x2760('0x2a')](function(_0x3857b0){var _0x322970=null;if(_0x3857b0){_0x322970=_0x3857b0[_0x2760('0x40')][0x0];_0x322970['enduserType']=_0x381a4f;}_0x628fe4(_0x322970);})['catch'](function(_0x348cfe){_0x52e278(_0x348cfe);});});}function createEndUser(_0x188ae2,_0xb8ad3,_0x37dbdb,_0x3001c0,_0x551c52,_0x14e786){var _0x37dbdb=getName(_0x37dbdb);return request({'method':_0x2760('0x25'),'uri':_0x2760('0x41')+_0xb8ad3+'/crm/v2/'+_['startCase'](_0x14e786[_0x2760('0x42')])+'s','body':{'data':[{'Last_Name':_0x37dbdb[0x1],'First_Name':_0x37dbdb[0x0],'Phone':_0x3001c0,'Owner':{'name':!_[_0x2760('0x1e')](_0x551c52[_0x2760('0x43')]['name'])?_0x551c52[_0x2760('0x43')][_0x2760('0x1b')]:!_[_0x2760('0x1e')](_0x551c52[_0x2760('0x44')])?_0x551c52[_0x2760('0x44')]+'\x20'+_0x551c52['last_name']:_0x551c52[_0x2760('0x45')],'id':_0x551c52['id']}}]},'headers':{'Authorization':_0x2760('0x32')+_0x188ae2},'json':!![]})['then'](function(_0x2b02f0){if(_0x2b02f0&&_0x2b02f0[_0x2760('0x40')][0x0][_0x2760('0x46')]===_0x2760('0x47')){var _0x4f40e9=_0x2b02f0['data'][0x0]['details'];_0x4f40e9['enduserType']=_['startCase'](_0x14e786['moduleCreate'])+'s';return _0x4f40e9;}logger[_0x2760('0x3d')](_0x2760('0x3e'),JSON[_0x2760('0x10')](data));throw new Error(_0x2760('0x48')+JSON[_0x2760('0x10')](data));})[_0x2760('0x3f')](function(_0x322c43){console['log']('CREATE\x20ERROR',_0x322c43);});}function getEndUser(_0x5ecedf,_0x5141fc,_0x42a6cf,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b){var _0x5a98c5={'method':_0x2760('0x49'),'uri':'','headers':{'Authorization':_0x2760('0x32')+_0x5ecedf},'json':!![]};switch(_0x1d041b[_0x2760('0x4a')]){case _0x2760('0x4b'):_0x5a98c5['uri']=_0x2760('0x41')+_0x5141fc+_0x2760('0x4c')+_0x59af72+'))';return getZohoUser(_0x5a98c5,_0x2760('0x4d'))[_0x2760('0x2a')](function(_0x183dee){if(_0x183dee)return _0x183dee;_0x5a98c5[_0x2760('0x4e')]=_0x2760('0x41')+_0x5141fc+_0x2760('0x4f')+_0x59af72+'))';return getZohoUser(_0x5a98c5,'Leads')[_0x2760('0x2a')](function(_0x2857dc){if(_0x2857dc)return _0x2857dc;if(_0x1d041b[_0x2760('0x42')]!=_0x2760('0x50')){return createEndUser(_0x5ecedf,_0x5141fc,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b);}else{return{};}});});break;case'contact':_0x5a98c5[_0x2760('0x4e')]=_0x2760('0x41')+_0x5141fc+_0x2760('0x4c')+_0x59af72+'))';return getZohoUser(_0x5a98c5,_0x2760('0x4d'))[_0x2760('0x2a')](function(_0x19c1b1){if(_0x19c1b1)return _0x19c1b1;if(_0x1d041b[_0x2760('0x42')]!=_0x2760('0x50')){return createEndUser(_0x5ecedf,_0x5141fc,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b);}else{return{};}});break;case _0x2760('0x51'):_0x5a98c5['uri']=_0x2760('0x41')+_0x5141fc+_0x2760('0x4f')+_0x59af72+'))';return getZohoUser(_0x5a98c5,_0x2760('0x52'))[_0x2760('0x2a')](function(_0x65ce44){if(_0x65ce44)return _0x65ce44;if(_0x1d041b[_0x2760('0x42')]!=_0x2760('0x50')){return createEndUser(_0x5ecedf,_0x5141fc,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b);}else{return{};}});break;}}function getCall(_0x5cb8f0,_0x2eb78a,_0x35b6ad,_0x48eab1,_0x144e77,_0x3ffbe9,_0x26805a,_0x276288){logger[_0x2760('0x3c')](_0x2760('0x53'));var _0x347cab={};_0x347cab[_0x2760('0x54')]={'name':!_[_0x2760('0x1e')](_0x48eab1[_0x2760('0x43')][_0x2760('0x1b')])&&!_['isNil'](_0x48eab1[_0x2760('0x39')]['name'])&&_0x48eab1[_0x2760('0x39')]['name']===_0x2760('0x55')?_0x48eab1[_0x2760('0x43')][_0x2760('0x1b')]:!_[_0x2760('0x1e')](_0x48eab1[_0x2760('0x44')])?_0x48eab1[_0x2760('0x44')]+'\x20'+_0x48eab1['last_name']:_0x48eab1[_0x2760('0x45')],'id':_0x48eab1['id']};_0x347cab['Subject']=intUtil[_0x2760('0x56')](_0x3ffbe9[_0x2760('0x57')],_0x26805a,'\x20');_0x347cab[_0x2760('0x58')]=intUtil[_0x2760('0x56')](_0x3ffbe9[_0x2760('0x59')],_0x26805a,'\x0a');if(_0x144e77[_0x2760('0x5a')]===_0x2760('0x4d')){_0x347cab[_0x2760('0x5b')]={'name':!_[_0x2760('0x1e')](_0x144e77[_0x2760('0x5c')])?_0x144e77[_0x2760('0x5c')]:!_[_0x2760('0x1e')](_0x144e77[_0x2760('0x5d')])?_0x144e77['First_Name']+'\x20'+_0x144e77['Last_Name']:_0x144e77[_0x2760('0x5e')],'id':_0x144e77['id']};}if(_0x144e77['enduserType']===_0x2760('0x52')){_0x347cab[_0x2760('0x5f')]={'name':!_['isNil'](_0x144e77[_0x2760('0x5c')])?_0x144e77[_0x2760('0x5c')]:!_[_0x2760('0x1e')](_0x144e77[_0x2760('0x5d')])?_0x144e77['First_Name']+'\x20'+_0x144e77[_0x2760('0x5e')]:_0x144e77[_0x2760('0x5e')],'id':_0x144e77['id']};_0x347cab['$se_module']=_[_0x2760('0x60')](_0x144e77[_0x2760('0x5a')]);}if(_0x26805a[_0x2760('0x61')]){_0x347cab['Call_Duration']=moment['utc'](parseInt(_0x26805a[_0x2760('0x61')])*0x3e8)[_0x2760('0x2f')]('mm:ss');}else if(_0x26805a[_0x2760('0x62')]&&_0x26805a[_0x2760('0x63')]){_0x347cab['Call_Duration']=moment[_0x2760('0x64')](moment(_0x26805a['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x2760('0x65')](moment(_0x26805a['starttime'],_0x2760('0x66'))))[_0x2760('0x2f')]('mm:ss');}switch(_0x26805a[_0x2760('0x67')]){case _0x2760('0x68'):_0x347cab[_0x2760('0x69')]='Called';break;case _0x2760('0x6a'):case _0x2760('0x6b'):_0x347cab[_0x2760('0x69')]=_0x2760('0x6c');break;case _0x2760('0x6d'):_0x347cab['Call_Result']=_0x2760('0x6e');break;case _0x2760('0x6f'):_0x347cab['Call_Result']=_0x2760('0x70');break;case'timeout':_0x347cab['Call_Result']=_0x2760('0x71');default:}_0x347cab[_0x2760('0x72')]=(_0x276288===_0x2760('0x73')?moment(_0x26805a[_0x2760('0x74')])[_0x2760('0x2f')](_0x2760('0x66')):moment(_0x26805a[_0x2760('0x75')])[_0x2760('0x2f')](_0x2760('0x66')))||moment()[_0x2760('0x2f')](_0x2760('0x66'));_0x347cab[_0x2760('0x76')]=_0x276288||_0x2760('0x77');_0x347cab=_[_0x2760('0x78')](_0x347cab,getCustomFields(_0x3ffbe9[_0x2760('0x79')],_0x26805a));return request({'method':'POST','uri':_0x2760('0x41')+_0x2eb78a+_0x2760('0x7a'),'headers':{'Authorization':_0x2760('0x32')+_0x5cb8f0},'body':{'data':[_0x347cab]},'json':!![]})[_0x2760('0x2a')](function(_0x1a6bc6){if(_0x1a6bc6&&_0x1a6bc6[_0x2760('0x40')][0x0][_0x2760('0x46')]===_0x2760('0x47')){logger['info'](_0x2760('0x7b'));return{'id':_0x1a6bc6[_0x2760('0x40')][0x0]['details']['id']};}})[_0x2760('0x3f')](function(_0x43e918){logger[_0x2760('0x3c')](_0x2760('0x7c'),_0x43e918[_0x2760('0x2d')]);console[_0x2760('0x7d')](_0x2760('0x7c'),_0x43e918);});}exports[_0x2760('0x7e')]=function(_0x28ddec,_0x28f412,_0x3d60c2,_0x4c6faa,_0x5905e9,_0x2918b4){var _0x3996da,_0x513e5e,_0x42b06e;_0x2918b4[_0x2760('0x7f')]=intUtil[_0x2760('0x80')](_0x2918b4[_0x2760('0x7f')]);_0x2918b4[_0x2760('0x81')]=intUtil[_0x2760('0x80')](_0x2918b4[_0x2760('0x81')]);if(_0x5905e9&&_0x5905e9[_0x2760('0x82')]){logger[_0x2760('0x3c')](_0x2760('0x83'),_0x2760('0x84'));_0x28f412[_0x2760('0x85')]=_0x2918b4['serverUrl']+'/api/voice/recordings/'+_0x28f412[_0x2760('0x86')]+_0x2760('0x87')+md5(_0x28f412[_0x2760('0x86')]);}else{_0x28f412[_0x2760('0x85')]='';}var _0x294138=_0x2918b4[_0x2760('0x7f')]===_0x2760('0x88')?'eu':_0x2760('0x89');return getAccessToken(_0x2918b4)[_0x2760('0x2a')](function(_0x2af6c2){_0x42b06e=_0x2af6c2;return getUser(_0x42b06e,_0x294138,_0x2918b4,_0x4c6faa['email']);})[_0x2760('0x2a')](function(_0x34b7e8){_0x3996da=_0x34b7e8;logger[_0x2760('0x3c')](_0x2760('0x8a'),_0x3996da['id']);return getEndUser(_0x42b06e,_0x294138,_0x2918b4,_0x28f412[_0x2760('0x8b')],_0x28f412[_0x2760('0x8c')],_0x3996da,_0x3d60c2);})[_0x2760('0x2a')](function(_0x3c01e8){_0x513e5e=_0x3c01e8;return getCall(_0x42b06e,_0x294138,_0x2918b4,_0x3996da,_0x513e5e,_0x3d60c2,_0x28f412,_0x2760('0x77'));})[_0x2760('0x2a')](function(_0x1697f9){if(_0x1697f9){logger[_0x2760('0x3c')](_0x2760('0x8d'),_0x1697f9['id']);logger['info'](_0x2760('0x83'),_0x2760('0x8e'));emit(util['format']('user:%s',_0x4c6faa[_0x2760('0x1b')]),'trigger:browser:url',{'uri':_0x2760('0x8f')+_0x2918b4[_0x2760('0x7f')]+_0x2760('0x90')+_0x1697f9['id']});}})['catch'](function(_0x9f6d){logger['error']('[QUEUE]',JSON[_0x2760('0x10')](_0x9f6d));});};exports[_0x2760('0x73')]=function(_0x16bce5,_0x15a2a4,_0x4455f6,_0x41e950,_0x301c6d,_0x1a704f,_0x2e22cb){var _0x5e276a,_0x52716b,_0x25b795;_0x1a704f[_0x2760('0x7f')]=intUtil[_0x2760('0x80')](_0x1a704f[_0x2760('0x7f')]);_0x1a704f[_0x2760('0x81')]=intUtil[_0x2760('0x80')](_0x1a704f[_0x2760('0x81')]);if(_0x2e22cb&&_0x2e22cb[_0x2760('0x91')]&&_0x2e22cb[_0x2760('0x91')]!==_0x2760('0x92')){logger['info'](_0x2760('0x93'),'Recording\x20is\x20enabled!');_0x15a2a4[_0x2760('0x85')]=_0x1a704f[_0x2760('0x81')]+_0x2760('0x94')+_0x15a2a4['uniqueid']+_0x2760('0x87')+md5(_0x15a2a4[_0x2760('0x86')]);}var _0x234da0=_0x1a704f[_0x2760('0x7f')]===_0x2760('0x88')?'eu':_0x2760('0x89');return getAccessToken(_0x1a704f)['then'](function(_0x17ba28){_0x25b795=_0x17ba28;return getUser(_0x25b795,_0x234da0,_0x1a704f,_0x41e950['email']);})['then'](function(_0x492dd4){_0x5e276a=_0x492dd4;logger[_0x2760('0x3c')](_0x2760('0x8a'),_0x5e276a['id']);return getEndUser(_0x25b795,_0x234da0,_0x1a704f,_0x15a2a4['destcalleridname'],_0x15a2a4[_0x2760('0x95')],_0x5e276a,_0x4455f6);})[_0x2760('0x2a')](function(_0x4a7aea){_0x52716b=_0x4a7aea;return getCall(_0x25b795,_0x234da0,_0x1a704f,_0x5e276a,_0x52716b,_0x4455f6,_0x15a2a4,_0x2760('0x96'));})[_0x2760('0x2a')](function(_0x241e00){if(_0x241e00){logger['info'](_0x2760('0x8d'),_0x241e00['id']);logger['info'](_0x2760('0x93'),_0x2760('0x8e'));emit(util[_0x2760('0x2f')](_0x2760('0x97'),_0x41e950[_0x2760('0x1b')]),_0x2760('0x98'),{'uri':'https://crm.'+_0x1a704f[_0x2760('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x241e00['id']});}})[_0x2760('0x3f')](function(_0x36d0fb){logger[_0x2760('0x3d')](_0x2760('0x93'),JSON[_0x2760('0x10')](_0x36d0fb));});};exports[_0x2760('0x99')]=function(_0x97408e,_0x1b4e71,_0x28232b,_0x1072d8,_0x40b051,_0x4bb5f7){var _0xa34ad1,_0x470999,_0x4fe312;_0x4bb5f7[_0x2760('0x7f')]=intUtil['stripTrailingSlash'](_0x4bb5f7['host']);_0x4bb5f7[_0x2760('0x81')]=intUtil[_0x2760('0x80')](_0x4bb5f7[_0x2760('0x81')]);if(_0x40b051&&_0x40b051[_0x2760('0x82')]){logger[_0x2760('0x3c')]('['+_0x1b4e71['lastevent'][_0x2760('0x9a')]()+']','Recording\x20is\x20enabled!');_0x1b4e71[_0x2760('0x85')]=_0x4bb5f7['serverUrl']+_0x2760('0x94')+_0x1b4e71[_0x2760('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x1b4e71[_0x2760('0x86')]);}else{_0x1b4e71['recordingURL']='';}var _0x337757=_0x4bb5f7[_0x2760('0x7f')]==='zoho.eu'?'eu':_0x2760('0x89');return getAccessToken(_0x4bb5f7)[_0x2760('0x2a')](function(_0x19a002){_0x4fe312=_0x19a002;return getUser(_0x4fe312,_0x337757,_0x4bb5f7);})['then'](function(_0x302aa5){_0xa34ad1=_0x302aa5;logger[_0x2760('0x3c')](_0x2760('0x8a'),_0xa34ad1['id']);return getEndUser(_0x4fe312,_0x337757,_0x4bb5f7,_0x1b4e71['calleridname'],_0x1b4e71['calleridnum'],_0xa34ad1,_0x28232b);})[_0x2760('0x2a')](function(_0x51a842){_0x470999=_0x51a842;return getCall(_0x4fe312,_0x337757,_0x4bb5f7,_0xa34ad1,_0x470999,_0x28232b,_0x1b4e71,_0x2760('0x77'));})[_0x2760('0x2a')](function(_0x279470){if(_0x279470){logger[_0x2760('0x3c')](_0x2760('0x8d'),_0x279470['id']);}})[_0x2760('0x3f')](function(_0x46a0f){logger[_0x2760('0x3d')]('['+_0x1b4e71[_0x2760('0x67')]['toUpperCase']()+']',JSON[_0x2760('0x10')](_0x46a0f));});}; \ 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 c3f7295..71fb1ed 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 _0xc3ae=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','render','error'];(function(_0x27aa83,_0x47fe56){var _0x5aea95=function(_0x4021ec){while(--_0x4021ec){_0x27aa83['push'](_0x27aa83['shift']());}};_0x5aea95(++_0x47fe56);}(_0xc3ae,0x12f));var _0xec3a=function(_0x50e7ae,_0x56ec40){_0x50e7ae=_0x50e7ae-0x0;var _0x5da781=_0xc3ae[_0x50e7ae];return _0x5da781;};'use strict';var util=require('util');var sh=require(_0xec3a('0x0'));var Mustache=require(_0xec3a('0x1'));var logger=require(_0xec3a('0x2'))(_0xec3a('0x3'));exports[_0xec3a('0x4')]=function(_0x43679f,_0x1f7e9d){var _0x4efa5b=_0x43679f[_0xec3a('0x5')]?_0x43679f[_0xec3a('0x5')]:'Script';var _0x3fc964=_0x43679f[_0xec3a('0x6')]?Mustache[_0xec3a('0x7')](_0x43679f['data3'],_0x1f7e9d):_0x1f7e9d;sh[_0xec3a('0x4')](_0x3fc964,function(_0x46bf4f,_0x5b1f02,_0x4c0561){if(_0x46bf4f!==0x0){logger[_0xec3a('0x8')](util[_0xec3a('0x9')](_0xec3a('0xa'),_0x4efa5b,_0x3fc964,_0x46bf4f,_0x4c0561));}else{logger[_0xec3a('0xb')](util[_0xec3a('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4efa5b,_0x3fc964,_0x5b1f02));}});}; \ No newline at end of file +var _0xac31=['error','format','info','util','../../../../config/logger','data2','Script','data3','exec'];(function(_0x380b8f,_0x32271d){var _0x646c69=function(_0x57c77f){while(--_0x57c77f){_0x380b8f['push'](_0x380b8f['shift']());}};_0x646c69(++_0x32271d);}(_0xac31,0x16b));var _0x1ac3=function(_0x179b96,_0x74bb85){_0x179b96=_0x179b96-0x0;var _0x52f631=_0xac31[_0x179b96];return _0x52f631;};'use strict';var util=require(_0x1ac3('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x1ac3('0x1'))('trigger');exports['exec']=function(_0x213d21,_0x23f139){var _0x56098c=_0x213d21[_0x1ac3('0x2')]?_0x213d21[_0x1ac3('0x2')]:_0x1ac3('0x3');var _0x21e16b=_0x213d21['data3']?Mustache['render'](_0x213d21[_0x1ac3('0x4')],_0x23f139):_0x23f139;sh[_0x1ac3('0x5')](_0x21e16b,function(_0x2b71ce,_0x55298d,_0x30f94a){if(_0x2b71ce!==0x0){logger[_0x1ac3('0x6')](util[_0x1ac3('0x7')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x56098c,_0x21e16b,_0x2b71ce,_0x30f94a));}else{logger[_0x1ac3('0x8')](util[_0x1ac3('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x56098c,_0x21e16b,_0x55298d));}});}; \ 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 237671a..e5b6477 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 _0xd331=['object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','render','error','GET','DELETE','POST','PUT','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20'];(function(_0x37f7aa,_0x1b2ea8){var _0x11dd86=function(_0x3bd4c5){while(--_0x3bd4c5){_0x37f7aa['push'](_0x37f7aa['shift']());}};_0x11dd86(++_0x1b2ea8);}(_0xd331,0xb5));var _0x1d33=function(_0x3eeeca,_0x2dc8a1){_0x3eeeca=_0x3eeeca-0x0;var _0x2636c8=_0xd331[_0x3eeeca];return _0x2636c8;};'use strict';var rp=require('request-promise');var util=require(_0x1d33('0x0'));var _=require(_0x1d33('0x1'));var Mustache=require('mustache');var logger=require(_0x1d33('0x2'))(_0x1d33('0x3'));exports[_0x1d33('0x4')]=function(_0x495fef,_0x4fd522){var _0x49c57a,_0xd95f26;var _0x3a0a0e={'method':_0x495fef[_0x1d33('0x5')][_0x1d33('0x6')](),'uri':Mustache['render'](_0x495fef[_0x1d33('0x7')],_0x4fd522),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x495fef[_0x1d33('0x8')])===_0x1d33('0x9')&&parseInt(_0x495fef[_0x1d33('0x8')])>=0x1&&parseInt(_0x495fef['data5'])<=0xa?parseInt(_0x495fef[_0x1d33('0x8')])*0x3e8:0x5*0x3e8};try{_0x3a0a0e[_0x1d33('0xa')]=_0x495fef[_0x1d33('0xb')]?JSON[_0x1d33('0xc')](Mustache[_0x1d33('0xd')](_0x495fef[_0x1d33('0xb')],_0x4fd522)):{};}catch(_0x51bd77){logger[_0x1d33('0xe')](_0x51bd77['stack']);}switch(_0x495fef[_0x1d33('0x5')][_0x1d33('0x6')]()){case _0x1d33('0xf'):case _0x1d33('0x10'):_0x49c57a=null;_0x3a0a0e['qs']=_0x4fd522;break;case _0x1d33('0x11'):case _0x1d33('0x12'):if(_0x495fef[_0x1d33('0x13')]){try{_0x49c57a=JSON[_0x1d33('0xc')](Mustache['render'](_0x495fef[_0x1d33('0x13')],_0x4fd522));_0x3a0a0e['body']=_0x49c57a;}catch(_0x3f38e2){logger[_0x1d33('0xe')](_0x3f38e2[_0x1d33('0x14')]);logger[_0x1d33('0xe')](_0x1d33('0x15'));}}else{_0x49c57a=_0x4fd522;_0x3a0a0e[_0x1d33('0x16')]=_0x49c57a;}break;}logger['info'](util[_0x1d33('0x17')](_0x1d33('0x18'),_0x495fef[_0x1d33('0x5')],_0x495fef[_0x1d33('0x7')],JSON[_0x1d33('0x19')](_0x3a0a0e)));rp(_0x3a0a0e)[_0x1d33('0x1a')](function(_0x3c999c){_0x49c57a=!_[_0x1d33('0x1b')](_0x49c57a)?_0x1d33('0x1c')+_0x49c57a:'';_0xd95f26=typeof _0x3c999c['body']===_0x1d33('0x1d')?JSON[_0x1d33('0x19')](_0x3c999c['body']):_0x3c999c['body'];logger[_0x1d33('0x1e')](util[_0x1d33('0x17')](_0x1d33('0x1f'),_0x495fef[_0x1d33('0x5')],_0x495fef[_0x1d33('0x7')],_0x3c999c['statusCode'],_0xd95f26));})[_0x1d33('0x20')](function(_0xf47a01){logger[_0x1d33('0xe')](util['format'](_0x1d33('0x21'),_0x495fef[_0x1d33('0x5')],_0x495fef[_0x1d33('0x7')],_0xf47a01['statusCode'],_0xf47a01[_0x1d33('0x22')],_0xf47a01['message']));});}; \ No newline at end of file +var _0x2c74=['statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data5','number','headers','parse','error','stack','data1','DELETE','POST','PUT','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2'];(function(_0x2cfc34,_0x467114){var _0x37a4bc=function(_0x4b059c){while(--_0x4b059c){_0x2cfc34['push'](_0x2cfc34['shift']());}};_0x37a4bc(++_0x467114);}(_0x2c74,0x12e));var _0x42c7=function(_0x36bb0f,_0x5c49d5){_0x36bb0f=_0x36bb0f-0x0;var _0x3b68a8=_0x2c74[_0x36bb0f];return _0x3b68a8;};'use strict';var rp=require('request-promise');var util=require(_0x42c7('0x0'));var _=require('lodash');var Mustache=require(_0x42c7('0x1'));var logger=require(_0x42c7('0x2'))(_0x42c7('0x3'));exports[_0x42c7('0x4')]=function(_0x265a9d,_0xa5de0f){var _0x408aa6,_0x495319;var _0x41bb4c={'method':_0x265a9d['data1'][_0x42c7('0x5')](),'uri':Mustache[_0x42c7('0x6')](_0x265a9d['data2'],_0xa5de0f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x265a9d[_0x42c7('0x7')])===_0x42c7('0x8')&&parseInt(_0x265a9d[_0x42c7('0x7')])>=0x1&&parseInt(_0x265a9d[_0x42c7('0x7')])<=0xa?parseInt(_0x265a9d[_0x42c7('0x7')])*0x3e8:0x5*0x3e8};try{_0x41bb4c[_0x42c7('0x9')]=_0x265a9d['data6']?JSON[_0x42c7('0xa')](Mustache[_0x42c7('0x6')](_0x265a9d['data6'],_0xa5de0f)):{};}catch(_0x25f9ef){logger[_0x42c7('0xb')](_0x25f9ef[_0x42c7('0xc')]);}switch(_0x265a9d[_0x42c7('0xd')]['toUpperCase']()){case'GET':case _0x42c7('0xe'):_0x408aa6=null;_0x41bb4c['qs']=_0xa5de0f;break;case _0x42c7('0xf'):case _0x42c7('0x10'):if(_0x265a9d['data7']){try{_0x408aa6=JSON['parse'](Mustache['render'](_0x265a9d['data7'],_0xa5de0f));_0x41bb4c[_0x42c7('0x11')]=_0x408aa6;}catch(_0x22344f){logger[_0x42c7('0xb')](_0x22344f[_0x42c7('0xc')]);logger[_0x42c7('0xb')](_0x42c7('0x12'));}}else{_0x408aa6=_0xa5de0f;_0x41bb4c[_0x42c7('0x11')]=_0x408aa6;}break;}logger['info'](util[_0x42c7('0x13')](_0x42c7('0x14'),_0x265a9d[_0x42c7('0xd')],_0x265a9d['data2'],JSON['stringify'](_0x41bb4c)));rp(_0x41bb4c)['then'](function(_0x1215e9){_0x408aa6=!_[_0x42c7('0x15')](_0x408aa6)?_0x42c7('0x16')+_0x408aa6:'';_0x495319=typeof _0x1215e9[_0x42c7('0x11')]===_0x42c7('0x17')?JSON[_0x42c7('0x18')](_0x1215e9[_0x42c7('0x11')]):_0x1215e9[_0x42c7('0x11')];logger[_0x42c7('0x19')](util[_0x42c7('0x13')](_0x42c7('0x1a'),_0x265a9d[_0x42c7('0xd')],_0x265a9d[_0x42c7('0x1b')],_0x1215e9[_0x42c7('0x1c')],_0x495319));})[_0x42c7('0x1d')](function(_0x46312d){logger[_0x42c7('0xb')](util[_0x42c7('0x13')](_0x42c7('0x1e'),_0x265a9d[_0x42c7('0xd')],_0x265a9d[_0x42c7('0x1b')],_0x46312d[_0x42c7('0x1c')],_0x46312d[_0x42c7('0x1f')],_0x46312d[_0x42c7('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 815c3d4..38398bc 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 _0x8216=['request','then','debug','error','rpc','routing','message','result','catch','exports','jayson/promise','bluebird','client','http','Request'];(function(_0x419a11,_0x248644){var _0x4d2146=function(_0x1f0a8e){while(--_0x1f0a8e){_0x419a11['push'](_0x419a11['shift']());}};_0x4d2146(++_0x248644);}(_0x8216,0x118));var _0x6821=function(_0x13abba,_0x19fc98){_0x13abba=_0x13abba-0x0;var _0x8428b6=_0x8216[_0x13abba];return _0x8428b6;};'use strict';var jayson=require(_0x6821('0x0'));var BPromise=require(_0x6821('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x6821('0x2')][_0x6821('0x3')]({'port':0x2329});client[_0x6821('0x4')]=function(_0x3d58b1,_0x12f490){return new BPromise(function(_0x201e75,_0x280d98){return client[_0x6821('0x5')](_0x3d58b1,_0x12f490)[_0x6821('0x6')](function(_0x11e0b0){logger[_0x6821('0x7')]('rpc','routing',_0x3d58b1,_0x12f490,_0x11e0b0);if(_0x11e0b0[_0x6821('0x8')]){logger[_0x6821('0x8')](_0x6821('0x9'),_0x6821('0xa'),_0x3d58b1,_0x11e0b0[_0x6821('0x8')][_0x6821('0xb')],_0x12f490);return _0x280d98(_0x11e0b0[_0x6821('0x8')][_0x6821('0xb')]);}else{return _0x201e75(_0x11e0b0[_0x6821('0xc')]);}})[_0x6821('0xd')](function(_0x3b6dcc){logger[_0x6821('0x8')](_0x6821('0x9'),'routing',_0x3d58b1,_0x3b6dcc,_0x12f490);return _0x280d98(_0x3b6dcc);});});};module[_0x6821('0xe')]=client; \ No newline at end of file +var _0x7830=['jayson/promise','../../config/logger','routing','http','request','then','rpc','error','message','result','catch','exports'];(function(_0x48a435,_0x426db1){var _0x510583=function(_0x104c40){while(--_0x104c40){_0x48a435['push'](_0x48a435['shift']());}};_0x510583(++_0x426db1);}(_0x7830,0x1e0));var _0x0783=function(_0x2a9163,_0x4436c4){_0x2a9163=_0x2a9163-0x0;var _0x80b227=_0x7830[_0x2a9163];return _0x80b227;};'use strict';var jayson=require(_0x0783('0x0'));var BPromise=require('bluebird');var logger=require(_0x0783('0x1'))(_0x0783('0x2'));var client=jayson['client'][_0x0783('0x3')]({'port':0x2329});client['Request']=function(_0x216cdf,_0x4ae196){return new BPromise(function(_0xceb1a9,_0x1c1725){return client[_0x0783('0x4')](_0x216cdf,_0x4ae196)[_0x0783('0x5')](function(_0x5d34d5){logger['debug'](_0x0783('0x6'),'routing',_0x216cdf,_0x4ae196,_0x5d34d5);if(_0x5d34d5[_0x0783('0x7')]){logger['error'](_0x0783('0x6'),_0x0783('0x2'),_0x216cdf,_0x5d34d5[_0x0783('0x7')][_0x0783('0x8')],_0x4ae196);return _0x1c1725(_0x5d34d5[_0x0783('0x7')][_0x0783('0x8')]);}else{return _0xceb1a9(_0x5d34d5[_0x0783('0x9')]);}})[_0x0783('0xa')](function(_0x362e4b){logger['error'](_0x0783('0x6'),_0x0783('0x2'),_0x216cdf,_0x362e4b,_0x4ae196);return _0x1c1725(_0x362e4b);});});};module[_0x0783('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 07926dd..1a5cb26 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 _0x813b=['./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization'];(function(_0x205328,_0x12c15a){var _0x4a30eb=function(_0x226d48){while(--_0x226d48){_0x205328['push'](_0x205328['shift']());}};_0x4a30eb(++_0x12c15a);}(_0x813b,0xee));var _0xb813=function(_0x1e7919,_0x48e39e){_0x1e7919=_0x1e7919-0x0;var _0x25119b=_0x813b[_0x1e7919];return _0x25119b;};'use strict';var server=require(_0xb813('0x0'));var Realtime=require(_0xb813('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xb813('0x2'));var setting=require(_0xb813('0x3'));var logger=require(_0xb813('0x4'))(_0xb813('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb813('0x6')]()[_0xb813('0x7')](mailAccount[_0xb813('0x8')]())['then'](realtime[_0xb813('0x9')]())[_0xb813('0x7')](function(){email[_0xb813('0xa')](realtime[_0xb813('0xb')]);return realtime;});}function main(){return server[_0xb813('0xc')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xb813('0xd')]();})[_0xb813('0x7')](function(_0x1171c3){return setInterval(initRealtime,_0x1171c3[_0xb813('0xe')]*0x3e8);})[_0xb813('0xf')](function(_0x14abe7){logger['error'](_0xb813('0x10'),_0x14abe7);});}main(); \ No newline at end of file +var _0xbbe4=['email','then','refresh','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x5198a7,_0x3ecd00){var _0x24dba6=function(_0x248669){while(--_0x248669){_0x5198a7['push'](_0x5198a7['shift']());}};_0x24dba6(++_0x3ecd00);}(_0xbbe4,0x13f));var _0x4bbe=function(_0x29a707,_0x342505){_0x29a707=_0x29a707-0x0;var _0x229e83=_0xbbe4[_0x29a707];return _0x229e83;};'use strict';var server=require(_0x4bbe('0x0'));var Realtime=require(_0x4bbe('0x1'));var EmailChannel=require(_0x4bbe('0x2'));var mailAccount=require(_0x4bbe('0x3'));var setting=require(_0x4bbe('0x4'));var logger=require('../../config/logger')(_0x4bbe('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x4bbe('0x6')](mailAccount['getMailAccounts']())[_0x4bbe('0x6')](realtime['initMailAccounts']())[_0x4bbe('0x6')](function(){email[_0x4bbe('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x4bbe('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0x4bbe('0x8')]();})[_0x4bbe('0x6')](function(_0x121605){return setInterval(initRealtime,_0x121605[_0x4bbe('0x9')]*0x3e8);})['catch'](function(_0x41028b){logger[_0x4bbe('0xa')](_0x4bbe('0xb'),_0x41028b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 40e115e..fc2da54 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 _0x87bd=['stringify','md5','emit','mailAccount:update','hasOwnProperty','active','service','custom','provider','imapAccounts','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','messages','total','info','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','smtp','exports','lodash','moment','bluebird','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','prototype','name','key','status','Imap','isNil'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x87bd,0x117));var _0xd87b=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x87bd[_0x874cf1];return _0x233579;};'use strict';var _=require(_0xd87b('0x0'));var moment=require(_0xd87b('0x1'));var BPromise=require(_0xd87b('0x2'));var md5=require('md5');var Redis=require(_0xd87b('0x3'));var config=require('../../../config/environment');var logger=require(_0xd87b('0x4'))(_0xd87b('0x5'));config[_0xd87b('0x6')]=_[_0xd87b('0x7')](config[_0xd87b('0x6')],{'host':_0xd87b('0x8'),'port':0x18eb});var io=require(_0xd87b('0x9'))(new Redis(config[_0xd87b('0x6')]));var EmailImap=require(_0xd87b('0xa'));var EmailSmtp=require(_0xd87b('0xb'));var mailAccount=require(_0xd87b('0xc'));var md5Accounts={};function EmailChannel(_0x1f25c4){logger['info'](_0xd87b('0xd'));this[_0xd87b('0xe')]=_0x1f25c4[_0xd87b('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xd87b('0xf')]['emit']=function(_0x5dd330){var _0x44f3d9=this[_0xd87b('0xe')][_0x5dd330];var _0x339ad7={'id':_0x44f3d9['id'],'name':_0x44f3d9[_0xd87b('0x10')],'key':_0x44f3d9[_0xd87b('0x11')],'active':_0x44f3d9['active'],'Imap':{'status':_0x44f3d9['Imap'][_0xd87b('0x12')],'messageStatus':_0x44f3d9[_0xd87b('0x13')]['messageStatus'],'total':_0x44f3d9[_0xd87b('0x13')]['total']}};if(_[_0xd87b('0x14')](md5Accounts[_0x5dd330])){md5Accounts[_0x5dd330]={};}var _0x1aeaba=md5(JSON[_0xd87b('0x15')](_0x339ad7));if(md5Accounts[_0x5dd330][_0xd87b('0x16')]!==_0x1aeaba){md5Accounts[_0x5dd330]['md5']=_0x1aeaba;io[_0xd87b('0x17')](_0xd87b('0x18'),_0x339ad7);}};EmailChannel[_0xd87b('0xf')]['refresh']=function(_0x241d17){for(var _0x2d91cf in _0x241d17){if(_0x241d17[_0xd87b('0x19')](_0x2d91cf)){if(_0x241d17[_0x2d91cf][_0xd87b('0x13')]&&_0x241d17[_0x2d91cf][_0xd87b('0x1a')]){var _0x42390b=_0x241d17[_0x2d91cf][_0xd87b('0x13')];if(!_0x42390b[_0xd87b('0x1b')]&&_0x241d17[_0x2d91cf]['provider']!==_0xd87b('0x1c'))_0x42390b[_0xd87b('0x1b')]=_0x241d17[_0x2d91cf][_0xd87b('0x1d')];if(!this[_0xd87b('0x1e')]['hasOwnProperty'](_0x42390b['id'])){this[_0xd87b('0x1e')][_0x42390b['id']]=new EmailImap(_0x42390b,_0x241d17[_0x2d91cf]['email']);this[_0xd87b('0x1e')][_0x42390b['id']]['on'](_0xd87b('0x1f'),this[_0xd87b('0x20')][_0xd87b('0x21')](this,_0x2d91cf));this[_0xd87b('0x1e')][_0x42390b['id']]['on'](_0xd87b('0x5'),this['handleImapEmail'][_0xd87b('0x21')](this,_0x2d91cf));this[_0xd87b('0x1e')][_0x42390b['id']]['on'](_0xd87b('0x22'),this[_0xd87b('0x23')]['bind'](this,_0x2d91cf));this[_0xd87b('0x1e')][_0x42390b['id']]['on'](_0xd87b('0x24'),this[_0xd87b('0x25')]['bind'](this,_0x2d91cf));}}else{if(_[_0xd87b('0x14')](this[_0xd87b('0xe')][_0x2d91cf][_0xd87b('0x13')])){this[_0xd87b('0xe')][_0x2d91cf][_0xd87b('0x13')]={};}this['mailAccounts'][_0x2d91cf][_0xd87b('0x13')][_0xd87b('0x12')]=_0xd87b('0x26');this[_0xd87b('0xe')][_0x2d91cf]['Imap'][_0xd87b('0x27')]='';this[_0xd87b('0x17')](_0x2d91cf);}}}};EmailChannel['prototype'][_0xd87b('0x20')]=function(_0xa423ec,_0x4b857b){if(this['mailAccounts'][_0xa423ec]){this[_0xd87b('0xe')][_0xa423ec]['Imap'][_0xd87b('0x12')]=_0xd87b('0x28');this[_0xd87b('0xe')][_0xa423ec][_0xd87b('0x13')]['messageStatus']=_0x4b857b[_0xd87b('0x10')];if(_0x4b857b[_0xd87b('0x29')]){this[_0xd87b('0xe')][_0xa423ec][_0xd87b('0x13')][_0xd87b('0x2a')]=_0x4b857b[_0xd87b('0x29')][_0xd87b('0x2a')];}return this[_0xd87b('0x17')](_0xa423ec);}};EmailChannel[_0xd87b('0xf')]['handleImapEmail']=function(_0x2bfcb9,_0x3fd56f){logger[_0xd87b('0x2b')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3fd56f['firstName'],_0x3fd56f[_0xd87b('0x2c')],_0x3fd56f[_0xd87b('0x2d')],_0x2bfcb9);if(this[_0xd87b('0xe')][_0x2bfcb9]){return mailAccount[_0xd87b('0x2e')](_0x2bfcb9,_0x3fd56f)[_0xd87b('0x2f')](function(_0xcbbbd9){if(_0xcbbbd9){logger[_0xd87b('0x2b')](_0xd87b('0x30'));}})[_0xd87b('0x31')](function(_0x406e65){logger['error'](_0xd87b('0x32'),JSON['stringify'](_0x406e65));});}};EmailChannel[_0xd87b('0xf')][_0xd87b('0x23')]=function(_0x107cc9){if(this['mailAccounts'][_0x107cc9]&&this['mailAccounts'][_0x107cc9][_0xd87b('0x13')]){if(this['imapAccounts'][this['mailAccounts'][_0x107cc9][_0xd87b('0x13')]['id']]){delete this[_0xd87b('0x1e')][this[_0xd87b('0xe')][_0x107cc9][_0xd87b('0x13')]['id']];}this['mailAccounts'][_0x107cc9][_0xd87b('0x13')][_0xd87b('0x33')]=moment();this[_0xd87b('0x17')](_0x107cc9);}};EmailChannel[_0xd87b('0xf')][_0xd87b('0x25')]=function(_0x1d913f,_0x2ae8af){if(this[_0xd87b('0xe')][_0x1d913f]){this[_0xd87b('0xe')][_0x1d913f][_0xd87b('0x13')]['status']='error';this[_0xd87b('0xe')][_0x1d913f][_0xd87b('0x13')]['messageStatus']=_0x2ae8af;return this[_0xd87b('0x17')](_0x1d913f);}};EmailChannel[_0xd87b('0xf')][_0xd87b('0x34')]=function(_0x311f4f,_0x3707f4){return this['smtp'][_0xd87b('0x35')](_0x311f4f,_0x3707f4);};EmailChannel[_0xd87b('0xf')][_0xd87b('0x36')]=function(_0x2463b9){var _0xab80ab=this;if(this['mailAccounts'][_0x2463b9['id']]){if(_[_0xd87b('0x14')](this['mailAccounts'][_0x2463b9['id']][_0xd87b('0x37')])){this['mailAccounts'][_0x2463b9['id']][_0xd87b('0x37')]={};}this[_0xd87b('0xe')][_0x2463b9['id']][_0xd87b('0x37')][_0xd87b('0x33')]=moment();return new BPromise(function(_0x1bdf8a,_0x314d81){return _0xab80ab['smtp'][_0xd87b('0x38')](_0x2463b9)[_0xd87b('0x2f')](function(_0x47b1cd){_0xab80ab['mailAccounts'][_0x2463b9['id']]['Smtp'][_0xd87b('0x12')]=_0xd87b('0x39');_0xab80ab['mailAccounts'][_0x2463b9['id']][_0xd87b('0x37')]['messageStatus']='';_0xab80ab[_0xd87b('0x17')](_0x2463b9['id']);_0x1bdf8a(_0x47b1cd);})[_0xd87b('0x31')](function(_0x2b8e91){_0xab80ab[_0xd87b('0xe')][_0x2463b9['id']]['Smtp']['status']='error';_0xab80ab[_0xd87b('0xe')][_0x2463b9['id']][_0xd87b('0x37')][_0xd87b('0x27')]=_0x2b8e91;_0xab80ab[_0xd87b('0x17')](_0x2463b9['id']);_0x314d81(_0x2b8e91);});});}return this[_0xd87b('0x3a')][_0xd87b('0x38')](_0x2463b9);};module[_0xd87b('0x3b')]=EmailChannel; \ No newline at end of file +var _0x5853=['handleImapEnd','error','handleImapError','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','Smtp','lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail'];(function(_0x44b14c,_0x2f77af){var _0x5e5548=function(_0x2330e8){while(--_0x2330e8){_0x44b14c['push'](_0x44b14c['shift']());}};_0x5e5548(++_0x2f77af);}(_0x5853,0xc2));var _0x3585=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x5853[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x3585('0x0'));var moment=require(_0x3585('0x1'));var BPromise=require(_0x3585('0x2'));var md5=require(_0x3585('0x3'));var Redis=require(_0x3585('0x4'));var config=require(_0x3585('0x5'));var logger=require(_0x3585('0x6'))(_0x3585('0x7'));config[_0x3585('0x8')]=_[_0x3585('0x9')](config[_0x3585('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3585('0xa'))(new Redis(config[_0x3585('0x8')]));var EmailImap=require(_0x3585('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3585('0xc'));var md5Accounts={};function EmailChannel(_0x3317bd){logger[_0x3585('0xd')](_0x3585('0xe'));this[_0x3585('0xf')]=_0x3317bd['mailAccounts'];this[_0x3585('0x10')]={};this[_0x3585('0x11')]=new EmailSmtp();}EmailChannel[_0x3585('0x12')]['emit']=function(_0x1f4b2c){var _0x3f725f=this[_0x3585('0xf')][_0x1f4b2c];var _0x4b83d3={'id':_0x3f725f['id'],'name':_0x3f725f[_0x3585('0x13')],'key':_0x3f725f[_0x3585('0x14')],'active':_0x3f725f[_0x3585('0x15')],'Imap':{'status':_0x3f725f[_0x3585('0x16')][_0x3585('0x17')],'messageStatus':_0x3f725f[_0x3585('0x16')]['messageStatus'],'total':_0x3f725f[_0x3585('0x16')][_0x3585('0x18')]}};if(_[_0x3585('0x19')](md5Accounts[_0x1f4b2c])){md5Accounts[_0x1f4b2c]={};}var _0x4c77d8=md5(JSON[_0x3585('0x1a')](_0x4b83d3));if(md5Accounts[_0x1f4b2c][_0x3585('0x3')]!==_0x4c77d8){md5Accounts[_0x1f4b2c][_0x3585('0x3')]=_0x4c77d8;io[_0x3585('0x1b')](_0x3585('0x1c'),_0x4b83d3);}};EmailChannel[_0x3585('0x12')][_0x3585('0x1d')]=function(_0x19ad7a){for(var _0x2de4a9 in _0x19ad7a){if(_0x19ad7a[_0x3585('0x1e')](_0x2de4a9)){if(_0x19ad7a[_0x2de4a9][_0x3585('0x16')]&&_0x19ad7a[_0x2de4a9][_0x3585('0x15')]){var _0x32853f=_0x19ad7a[_0x2de4a9]['Imap'];if(!_0x32853f[_0x3585('0x1f')]&&_0x19ad7a[_0x2de4a9][_0x3585('0x20')]!==_0x3585('0x21'))_0x32853f[_0x3585('0x1f')]=_0x19ad7a[_0x2de4a9]['provider'];if(!this[_0x3585('0x10')][_0x3585('0x1e')](_0x32853f['id'])){this['imapAccounts'][_0x32853f['id']]=new EmailImap(_0x32853f,_0x19ad7a[_0x2de4a9][_0x3585('0x7')]);this[_0x3585('0x10')][_0x32853f['id']]['on'](_0x3585('0x22'),this[_0x3585('0x23')][_0x3585('0x24')](this,_0x2de4a9));this[_0x3585('0x10')][_0x32853f['id']]['on'](_0x3585('0x7'),this[_0x3585('0x25')][_0x3585('0x24')](this,_0x2de4a9));this[_0x3585('0x10')][_0x32853f['id']]['on']('end',this[_0x3585('0x26')][_0x3585('0x24')](this,_0x2de4a9));this['imapAccounts'][_0x32853f['id']]['on'](_0x3585('0x27'),this[_0x3585('0x28')]['bind'](this,_0x2de4a9));}}else{if(_[_0x3585('0x19')](this[_0x3585('0xf')][_0x2de4a9][_0x3585('0x16')])){this[_0x3585('0xf')][_0x2de4a9][_0x3585('0x16')]={};}this['mailAccounts'][_0x2de4a9][_0x3585('0x16')][_0x3585('0x17')]=_0x3585('0x29');this[_0x3585('0xf')][_0x2de4a9]['Imap'][_0x3585('0x2a')]='';this[_0x3585('0x1b')](_0x2de4a9);}}}};EmailChannel[_0x3585('0x12')]['handleImapBox']=function(_0x2281c9,_0x39c024){if(this[_0x3585('0xf')][_0x2281c9]){this[_0x3585('0xf')][_0x2281c9]['Imap'][_0x3585('0x17')]='connected';this['mailAccounts'][_0x2281c9]['Imap'][_0x3585('0x2a')]=_0x39c024['name'];if(_0x39c024['messages']){this[_0x3585('0xf')][_0x2281c9]['Imap'][_0x3585('0x18')]=_0x39c024[_0x3585('0x2b')][_0x3585('0x18')];}return this[_0x3585('0x1b')](_0x2281c9);}};EmailChannel['prototype'][_0x3585('0x25')]=function(_0x4f12cc,_0x4982bc){logger['info'](_0x3585('0x2c'),_0x4982bc[_0x3585('0x2d')],_0x4982bc[_0x3585('0x2e')],_0x4982bc[_0x3585('0x2f')],_0x4f12cc);if(this[_0x3585('0xf')][_0x4f12cc]){return mailAccount[_0x3585('0x30')](_0x4f12cc,_0x4982bc)[_0x3585('0x31')](function(_0x4ce127){if(_0x4ce127){logger[_0x3585('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0x3585('0x32')](function(_0x5cf850){logger[_0x3585('0x27')](_0x3585('0x33'),JSON[_0x3585('0x1a')](_0x5cf850));});}};EmailChannel['prototype'][_0x3585('0x26')]=function(_0x541bfa){if(this[_0x3585('0xf')][_0x541bfa]&&this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]){if(this[_0x3585('0x10')][this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]['id']]){delete this[_0x3585('0x10')][this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]['id']];}this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]['lastSync']=moment();this[_0x3585('0x1b')](_0x541bfa);}};EmailChannel[_0x3585('0x12')][_0x3585('0x28')]=function(_0x1f355c,_0x3f3923){if(this[_0x3585('0xf')][_0x1f355c]){this['mailAccounts'][_0x1f355c]['Imap'][_0x3585('0x17')]='error';this[_0x3585('0xf')][_0x1f355c]['Imap']['messageStatus']=_0x3f3923;return this['emit'](_0x1f355c);}};EmailChannel['prototype'][_0x3585('0x34')]=function(_0x464275,_0x51ca9b){return this[_0x3585('0x11')][_0x3585('0x35')](_0x464275,_0x51ca9b);};EmailChannel['prototype']['verifySmtp']=function(_0x49aed8){var _0x20276d=this;if(this[_0x3585('0xf')][_0x49aed8['id']]){if(_[_0x3585('0x19')](this[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')])){this['mailAccounts'][_0x49aed8['id']][_0x3585('0x36')]={};}this[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')][_0x3585('0x37')]=moment();return new BPromise(function(_0x49569f,_0x42f561){return _0x20276d[_0x3585('0x11')][_0x3585('0x38')](_0x49aed8)[_0x3585('0x31')](function(_0x5ed29e){_0x20276d[_0x3585('0xf')][_0x49aed8['id']]['Smtp'][_0x3585('0x17')]=_0x3585('0x39');_0x20276d[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')][_0x3585('0x2a')]='';_0x20276d[_0x3585('0x1b')](_0x49aed8['id']);_0x49569f(_0x5ed29e);})[_0x3585('0x32')](function(_0x5b4f92){_0x20276d[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')]['status']=_0x3585('0x27');_0x20276d[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')]['messageStatus']=_0x5b4f92;_0x20276d[_0x3585('0x1b')](_0x49aed8['id']);_0x42f561(_0x5b4f92);});});}return this[_0x3585('0x11')][_0x3585('0x38')](_0x49aed8);};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 226b26e..b7f549b 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 _0xfdbd=['error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','account','handleFetchEnd','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','getAccount','once','ready','handleReady','bind','handleEnd'];(function(_0x15a101,_0x1b8ecd){var _0x1f0f01=function(_0x521e9f){while(--_0x521e9f){_0x15a101['push'](_0x15a101['shift']());}};_0x1f0f01(++_0x1b8ecd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xfdbd[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var Imap=require(_0xdfdb('0x2'));var simpleParser=require(_0xdfdb('0x3'))[_0xdfdb('0x4')];var Iconv=require(_0xdfdb('0x5'))[_0xdfdb('0x6')];var EventEmitter=require(_0xdfdb('0x7'))[_0xdfdb('0x8')];var utils=require('./utils');var logger=require(_0xdfdb('0x9'))('email');function EmailImap(_0x453ef6,_0x41bd5e){this['mailbox']='INBOX';this['account']=this[_0xdfdb('0xa')](_0x453ef6,_0x41bd5e);this[_0xdfdb('0x2')]=new Imap(this['account']);this[_0xdfdb('0x2')][_0xdfdb('0xb')](_0xdfdb('0xc'),this[_0xdfdb('0xd')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0xb')]('end',this[_0xdfdb('0xf')][_0xdfdb('0xe')](this));this['imap']['on'](_0xdfdb('0x10'),this[_0xdfdb('0x11')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0x12')]();}util[_0xdfdb('0x13')](EmailImap,EventEmitter);EmailImap[_0xdfdb('0x14')][_0xdfdb('0xa')]=function(_0x51162f,_0x48a66a){var _0x2c44dc={'connTimeout':_0x51162f['connTimeout']?_0x51162f[_0xdfdb('0x15')]*0x3e8:0x2710,'authTimeout':_0x51162f[_0xdfdb('0x16')]?_0x51162f[_0xdfdb('0x16')]*0x3e8:0x1388};if(_0x51162f[_0xdfdb('0x17')]){_0x2c44dc[_0xdfdb('0x18')]=_0x51162f[_0xdfdb('0x18')];_0x2c44dc['email']=_0x48a66a||_0x51162f['user']||_0xdfdb('0x19');if(_0x51162f[_0xdfdb('0x1a')]){_0x2c44dc[_0xdfdb('0x1b')]=utils['generateXOAuth2Token'](_0x51162f[_0xdfdb('0x1c')][_0xdfdb('0x1d')],_0x51162f[_0xdfdb('0x18')]);}else{_0x2c44dc[_0xdfdb('0x1e')]=_0x51162f[_0xdfdb('0x1e')];}}else{if(_0x51162f[_0xdfdb('0x1f')]){_0x2c44dc[_0xdfdb('0x18')]=_0x51162f[_0xdfdb('0x18')];_0x2c44dc['password']=_0x51162f[_0xdfdb('0x1e')];}}_0x2c44dc[_0xdfdb('0x20')]=_0x51162f[_0xdfdb('0x20')];_0x2c44dc['port']=_0x51162f[_0xdfdb('0x21')]||0x3e1;if(_0x51162f[_0xdfdb('0x22')]){_0x2c44dc[_0xdfdb('0x22')]=!![];}else{_0x2c44dc['tls']=![];_0x2c44dc[_0xdfdb('0x23')]=_0xdfdb('0x24');}return _0x2c44dc;};EmailImap[_0xdfdb('0x14')]['handleReady']=function(){this[_0xdfdb('0x2')]['openBox'](this[_0xdfdb('0x25')],![],this[_0xdfdb('0x26')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleOpenBox']=function(_0x4c253e,_0x4363d8){if(_0x4c253e){this[_0xdfdb('0x11')](_0x4c253e,!![]);}else{this[_0xdfdb('0x27')](_0xdfdb('0x28'),_0x4363d8);this[_0xdfdb('0x29')]();}};EmailImap['prototype'][_0xdfdb('0x2a')]=function(_0x2d5fe2){if(_0x2d5fe2){this[_0xdfdb('0x11')](_0x2d5fe2,!![]);}else{this['imap'][_0xdfdb('0x2b')]();}};EmailImap['prototype'][_0xdfdb('0x29')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x2c')](['UNSEEN'],this['handleReadUnseen'][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2d')]=function(_0x3a2ec3,_0x371b69){if(_0x3a2ec3){this[_0xdfdb('0x11')](_0x3a2ec3,!![]);}else{if(_0x371b69['length']){try{var _0xf396d5=this[_0xdfdb('0x2')][_0xdfdb('0x2e')](_0x371b69,{'bodies':'','markSeen':!![]});_0xf396d5['on'](_0xdfdb('0x2f'),this[_0xdfdb('0x30')][_0xdfdb('0xe')](this));_0xf396d5[_0xdfdb('0xb')](_0xdfdb('0x10'),this[_0xdfdb('0x31')][_0xdfdb('0xe')](this));_0xf396d5[_0xdfdb('0xb')]('end',this['handleFetchEnd'][_0xdfdb('0xe')](this));}catch(_0x5288a1){logger[_0xdfdb('0x10')](_0x5288a1);}}else{this[_0xdfdb('0x2')][_0xdfdb('0x32')](!![],this[_0xdfdb('0x2a')]['bind'](this));}}};EmailImap[_0xdfdb('0x14')]['handleFetchMessage']=function(_0x341f0d){_0x341f0d['on'](_0xdfdb('0x33'),this[_0xdfdb('0x34')][_0xdfdb('0xe')](this));_0x341f0d[_0xdfdb('0xb')](_0xdfdb('0x35'),this['handleMessageAttributes'][_0xdfdb('0xe')](this));_0x341f0d[_0xdfdb('0xb')]('end',this[_0xdfdb('0x36')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x34')]=function(_0x439f32){simpleParser(_0x439f32,{'Iconv':Iconv},this[_0xdfdb('0x37')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x38')]=function(){};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x36')]=function(){};EmailImap['prototype'][_0xdfdb('0x37')]=function(_0x2e65b9,_0x3d3807){if(_0x2e65b9){logger[_0xdfdb('0x10')](_0x2e65b9);}else{var _0x2ac83d=this;utils[_0xdfdb('0x39')](this[_0xdfdb('0x3a')],_0x3d3807,function(_0x30a56e){_0x2ac83d['emit']('email',_0x30a56e);});}};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x3b')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x32')](!![],this[_0xdfdb('0x2a')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x31')]=function(_0xcee274){this['handleError'](_0xcee274);this[_0xdfdb('0x2')][_0xdfdb('0x32')](!![],this[_0xdfdb('0x2a')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleEnd']=function(){this[_0xdfdb('0x27')](_0xdfdb('0x2b'));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x11')]=function(_0x431004,_0x58842e){logger[_0xdfdb('0x10')](_0xdfdb('0x11'),this[_0xdfdb('0x3a')]['email'],JSON[_0xdfdb('0x3c')](_0x431004));var _0x539294='';if(_0x431004){if(_0x431004[_0xdfdb('0x3d')]){_0x539294=_0x431004['textCode'];}else{for(var _0x15b0c6 in _0x431004){if(_0x431004[_0xdfdb('0x3e')](_0x15b0c6)){_0x539294+=_['upperFirst'](_0x15b0c6)+':\x20'+_0x431004[_0x15b0c6]+'\x0a';}}}}if(_0x58842e){this[_0xdfdb('0x2')]['end']();}else{this[_0xdfdb('0x27')](_0xdfdb('0x10'),_0x539294);this[_0xdfdb('0x27')](_0xdfdb('0x2b'));}};module[_0xdfdb('0x3f')]=EmailImap; \ No newline at end of file +var _0x3e24=['handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','parser','account','stringify','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','once','handleReady','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen'];(function(_0x2c6ee7,_0x10f17c){var _0x1239d7=function(_0x42f4ec){while(--_0x42f4ec){_0x2c6ee7['push'](_0x2c6ee7['shift']());}};_0x1239d7(++_0x10f17c);}(_0x3e24,0x167));var _0x43e2=function(_0x38aec6,_0x2ad06a){_0x38aec6=_0x38aec6-0x0;var _0x56a203=_0x3e24[_0x38aec6];return _0x56a203;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var Imap=require(_0x43e2('0x2'));var simpleParser=require(_0x43e2('0x3'))[_0x43e2('0x4')];var Iconv=require('iconv')[_0x43e2('0x5')];var EventEmitter=require(_0x43e2('0x6'))['EventEmitter'];var utils=require(_0x43e2('0x7'));var logger=require(_0x43e2('0x8'))(_0x43e2('0x9'));function EmailImap(_0x28b144,_0x43b5a7){this[_0x43e2('0xa')]=_0x43e2('0xb');this['account']=this[_0x43e2('0xc')](_0x28b144,_0x43b5a7);this[_0x43e2('0x2')]=new Imap(this['account']);this[_0x43e2('0x2')][_0x43e2('0xd')]('ready',this[_0x43e2('0xe')][_0x43e2('0xf')](this));this['imap'][_0x43e2('0xd')]('end',this['handleEnd']['bind'](this));this[_0x43e2('0x2')]['on'](_0x43e2('0x10'),this[_0x43e2('0x11')][_0x43e2('0xf')](this));this[_0x43e2('0x2')][_0x43e2('0x12')]();}util[_0x43e2('0x13')](EmailImap,EventEmitter);EmailImap[_0x43e2('0x14')][_0x43e2('0xc')]=function(_0x218ae7,_0x377097){var _0x3ccccd={'connTimeout':_0x218ae7['connTimeout']?_0x218ae7[_0x43e2('0x15')]*0x3e8:0x2710,'authTimeout':_0x218ae7[_0x43e2('0x16')]?_0x218ae7[_0x43e2('0x16')]*0x3e8:0x1388};if(_0x218ae7[_0x43e2('0x17')]){_0x3ccccd['user']=_0x218ae7['user'];_0x3ccccd[_0x43e2('0x9')]=_0x377097||_0x218ae7[_0x43e2('0x18')]||_0x43e2('0x19');if(_0x218ae7[_0x43e2('0x1a')]){_0x3ccccd[_0x43e2('0x1b')]=utils[_0x43e2('0x1c')](_0x218ae7[_0x43e2('0x1d')][_0x43e2('0x1e')],_0x218ae7[_0x43e2('0x18')]);}else{_0x3ccccd[_0x43e2('0x1f')]=_0x218ae7['password'];}}else{if(_0x218ae7[_0x43e2('0x20')]){_0x3ccccd[_0x43e2('0x18')]=_0x218ae7['user'];_0x3ccccd[_0x43e2('0x1f')]=_0x218ae7['password'];}}_0x3ccccd[_0x43e2('0x21')]=_0x218ae7[_0x43e2('0x21')];_0x3ccccd[_0x43e2('0x22')]=_0x218ae7[_0x43e2('0x22')]||0x3e1;if(_0x218ae7[_0x43e2('0x23')]){_0x3ccccd['tls']=!![];}else{_0x3ccccd[_0x43e2('0x23')]=![];_0x3ccccd[_0x43e2('0x24')]=_0x43e2('0x25');}return _0x3ccccd;};EmailImap['prototype'][_0x43e2('0xe')]=function(){this[_0x43e2('0x2')][_0x43e2('0x26')](this[_0x43e2('0xa')],![],this['handleOpenBox'][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x27')]=function(_0x3b7b22,_0x178223){if(_0x3b7b22){this[_0x43e2('0x11')](_0x3b7b22,!![]);}else{this[_0x43e2('0x28')](_0x43e2('0x29'),_0x178223);this[_0x43e2('0x2a')]();}};EmailImap[_0x43e2('0x14')][_0x43e2('0x2b')]=function(_0x1de7e1){if(_0x1de7e1){this['handleError'](_0x1de7e1,!![]);}else{this[_0x43e2('0x2')][_0x43e2('0x2c')]();}};EmailImap['prototype'][_0x43e2('0x2a')]=function(){this[_0x43e2('0x2')][_0x43e2('0x2d')]([_0x43e2('0x2e')],this[_0x43e2('0x2f')]['bind'](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x2f')]=function(_0x1779f9,_0x3d8e16){if(_0x1779f9){this[_0x43e2('0x11')](_0x1779f9,!![]);}else{if(_0x3d8e16[_0x43e2('0x30')]){try{var _0x53f797=this['imap'][_0x43e2('0x31')](_0x3d8e16,{'bodies':'','markSeen':!![]});_0x53f797['on'](_0x43e2('0x32'),this[_0x43e2('0x33')][_0x43e2('0xf')](this));_0x53f797[_0x43e2('0xd')]('error',this[_0x43e2('0x34')][_0x43e2('0xf')](this));_0x53f797[_0x43e2('0xd')](_0x43e2('0x2c'),this[_0x43e2('0x35')][_0x43e2('0xf')](this));}catch(_0x2fcdd4){logger['error'](_0x2fcdd4);}}else{this['imap'][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')]['bind'](this));}}};EmailImap[_0x43e2('0x14')][_0x43e2('0x33')]=function(_0x4e79ed){_0x4e79ed['on'](_0x43e2('0x37'),this['handleMessageBody']['bind'](this));_0x4e79ed['once'](_0x43e2('0x38'),this['handleMessageAttributes'][_0x43e2('0xf')](this));_0x4e79ed[_0x43e2('0xd')](_0x43e2('0x2c'),this[_0x43e2('0x39')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x3a')]=function(_0x13be86){simpleParser(_0x13be86,{'Iconv':Iconv},this[_0x43e2('0x3b')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x3c')]=function(){};EmailImap[_0x43e2('0x14')][_0x43e2('0x39')]=function(){};EmailImap[_0x43e2('0x14')][_0x43e2('0x3b')]=function(_0x16fac0,_0x47f74c){if(_0x16fac0){logger['error'](_0x16fac0);}else{var _0x4c3f7d=this;utils[_0x43e2('0x3d')](this[_0x43e2('0x3e')],_0x47f74c,function(_0x490f4d){_0x4c3f7d['emit'](_0x43e2('0x9'),_0x490f4d);});}};EmailImap[_0x43e2('0x14')][_0x43e2('0x35')]=function(){this[_0x43e2('0x2')][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x34')]=function(_0x39bf87){this[_0x43e2('0x11')](_0x39bf87);this[_0x43e2('0x2')][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')]['bind'](this));};EmailImap[_0x43e2('0x14')]['handleEnd']=function(){this[_0x43e2('0x28')]('end');};EmailImap[_0x43e2('0x14')][_0x43e2('0x11')]=function(_0x273323,_0x4918bc){logger[_0x43e2('0x10')]('handleError',this[_0x43e2('0x3e')][_0x43e2('0x9')],JSON[_0x43e2('0x3f')](_0x273323));var _0x169a61='';if(_0x273323){if(_0x273323['textCode']){_0x169a61=_0x273323['textCode'];}else{for(var _0x95b22f in _0x273323){if(_0x273323[_0x43e2('0x40')](_0x95b22f)){_0x169a61+=_[_0x43e2('0x41')](_0x95b22f)+':\x20'+_0x273323[_0x95b22f]+'\x0a';}}}}if(_0x4918bc){this[_0x43e2('0x2')]['end']();}else{this[_0x43e2('0x28')](_0x43e2('0x10'),_0x169a61);this[_0x43e2('0x28')](_0x43e2('0x2c'));}};module[_0x43e2('0x42')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e0847ed..87eb8a4 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 _0x5c4d=['nodemailer','nodemailer-plugin-inline-base64','createTransport','use','compile','sendMail','verify','Not\x20verifired'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x5c4d,0x120));var _0xd5c4=function(_0x14bc03,_0x1f858b){_0x14bc03=_0x14bc03-0x0;var _0x9af4a1=_0x5c4d[_0x14bc03];return _0x9af4a1;};'use strict';var nodemailer=require(_0xd5c4('0x0'));var inlineBase64=require(_0xd5c4('0x1'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x62803f,_0x367a22){return new Promise(function(_0x2f2032,_0x4f02a0){var _0x5a1d51=nodemailer[_0xd5c4('0x2')](_0x62803f);_0x5a1d51[_0xd5c4('0x3')](_0xd5c4('0x4'),inlineBase64());_0x5a1d51[_0xd5c4('0x5')](_0x367a22,function(_0x45ee3e,_0x270a0e){if(_0x45ee3e){_0x4f02a0(_0x45ee3e['toString']());}else{_0x2f2032(_0x270a0e);}});});};EmailSmtp['prototype'][_0xd5c4('0x6')]=function(_0x3a7c3f){return new Promise(function(_0x107ea3,_0x3f6462){var _0x478dd6=nodemailer[_0xd5c4('0x2')](_0x3a7c3f);_0x478dd6[_0xd5c4('0x6')](function(_0x4a560f,_0x387b5c){if(_0x4a560f){_0x3f6462(_0x4a560f['toString']());}else{if(_0x387b5c){_0x107ea3(_0x387b5c);}else{_0x3f6462(_0xd5c4('0x7'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x44b0=['sendMail','toString','verify','createTransport','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','compile'];(function(_0x359842,_0xd7d82d){var _0x317362=function(_0x5cc5fb){while(--_0x5cc5fb){_0x359842['push'](_0x359842['shift']());}};_0x317362(++_0xd7d82d);}(_0x44b0,0xd8));var _0x044b=function(_0x131246,_0x38752b){_0x131246=_0x131246-0x0;var _0x332465=_0x44b0[_0x131246];return _0x332465;};'use strict';var nodemailer=require(_0x044b('0x0'));var inlineBase64=require(_0x044b('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x044b('0x2')]=function(_0x32872b,_0x2cf2e7){return new Promise(function(_0x546867,_0x311ede){var _0xcbdf71=nodemailer['createTransport'](_0x32872b);_0xcbdf71['use'](_0x044b('0x3'),inlineBase64());_0xcbdf71[_0x044b('0x4')](_0x2cf2e7,function(_0x1e91ed,_0x27f29a){if(_0x1e91ed){_0x311ede(_0x1e91ed[_0x044b('0x5')]());}else{_0x546867(_0x27f29a);}});});};EmailSmtp['prototype'][_0x044b('0x6')]=function(_0x590f2b){return new Promise(function(_0x3329b6,_0x139a98){var _0x331819=nodemailer[_0x044b('0x7')](_0x590f2b);_0x331819[_0x044b('0x6')](function(_0x141d27,_0x53cdda){if(_0x141d27){_0x139a98(_0x141d27[_0x044b('0x5')]());}else{if(_0x53cdda){_0x3329b6(_0x53cdda);}else{_0x139a98(_0x044b('0x8'));}}});});};module[_0x044b('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 6d4ad3c..2f12a42 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 _0xb6fd=['line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','

Empty\x20message

','Attachments','Data','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','generate','@xcally.com','name','substring','indexOf','split','join','length','pop','isEmpty','anonymous','html','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x5328af['slice'](0x0,-0x1)[_0xdb6f('0x11')]('\x20'):_0x577f9a[_0xdb6f('0xd')];}return'Anonymous';}function getLastName(_0x2c7231){var _0x3fd7b0=_[_0xdb6f('0x8')](_0x2c7231[_0xdb6f('0x9')]);if(_0x3fd7b0&&_0x3fd7b0['name']){var _0x1fc3bb=_0x3fd7b0[_0xdb6f('0xd')][_0xdb6f('0x10')](/\s+/);return _0x1fc3bb[_0xdb6f('0x12')]>0x1?_0x1fc3bb[_0xdb6f('0x13')]():'';}return'';}function getMails(_0x261a0a,_0x592506){var _0x3fda97='';for(var _0x2dbf90=0x0;_0x2dbf90<_0x592506[_0xdb6f('0x9')][_0xdb6f('0x12')];_0x2dbf90+=0x1){if(_0x592506[_0xdb6f('0x9')][_0x2dbf90][_0xdb6f('0xa')]!==_0x261a0a){if(!_[_0xdb6f('0x14')](_0x3fda97)){_0x3fda97+=',';}_0x3fda97+=_0x592506[_0xdb6f('0x9')][_0x2dbf90]['name']||_0x592506[_0xdb6f('0x9')][_0x2dbf90][_0xdb6f('0xa')]||'';_0x3fda97+='\x20<';_0x3fda97+=_0x592506[_0xdb6f('0x9')][_0x2dbf90][_0xdb6f('0xa')]?_0x592506[_0xdb6f('0x9')][_0x2dbf90][_0xdb6f('0xa')]:_0xdb6f('0x15')+random[_0xdb6f('0xb')](0x6)+_0xdb6f('0xc');_0x3fda97+='>';}}return _0x3fda97;}function parseEmail(_0x22a7fc,_0x298471,_0x5788eb){if(_0x298471[_0xdb6f('0x16')]){var _0x12c4dc=/)<[^<]*)*<\/script>/gi;while(_0x12c4dc['test'](_0x298471[_0xdb6f('0x16')])){_0x298471[_0xdb6f('0x16')]=_0x298471['html'][_0xdb6f('0x17')](_0x12c4dc,'');}if(_0x298471[_0xdb6f('0x16')][_0xdb6f('0x18')](_0xdb6f('0x19'))){var _0x1d8b97=[];_0x298471['attachments'][_0xdb6f('0x1a')](_0xbe4641=>{_0x1d8b97['push'](_0xbe4641[_0xdb6f('0x1b')]);});var _0x2e0546=/]+>/g;var _0x1f71eb=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x47d1a6=_0x298471['html'][_0xdb6f('0x17')](_0x1f71eb,_0xdb6f('0x1c'));var _0x53769a=_0x47d1a6[_0xdb6f('0x17')](_0x2e0546,'_IMG');for(let _0x3eaf41=0x0;_0x3eaf41<_0x1d8b97[_0xdb6f('0x12')];_0x3eaf41++){var _0x186c7b=_0x53769a[_0xdb6f('0x17')]('_IMG',_0xdb6f('0x1d')+_0x1d8b97[_0x3eaf41]+'\x20]');_0x53769a=_0x186c7b;}_0x298471['html']=_0x53769a;}_0x5788eb['body']=_0x298471[_0xdb6f('0x16')];}else{_0x5788eb[_0xdb6f('0x1e')]=_0x298471[_0xdb6f('0x1f')];}if(_0x5788eb['body']){_0x5788eb[_0xdb6f('0x1e')]=_0x5788eb[_0xdb6f('0x1e')]['replace'](/0x0){var _0x5d4c94=[_0xdb6f('0x33'),_0xdb6f('0x34'),'Precedence:\x20auto_reply'];for(var _0x10d1cd=0x0;_0x10d1cd<_0x298471[_0xdb6f('0x32')][_0xdb6f('0x12')];_0x10d1cd++){var _0x4c18f8=_['indexOf'](_0x5d4c94,_0x298471[_0xdb6f('0x32')][_0x10d1cd][_0xdb6f('0x35')]);if(_0x4c18f8>=0x0){_0x5788eb[_0xdb6f('0x36')]=!![];}}}return _0x5788eb;}exports[_0xdb6f('0x37')]=function(_0x2cd9b6,_0x24ea45,_0x2aa1db){var _0xc4bce6={'from':getAddress(_0x24ea45[_0xdb6f('0x38')]),'firstName':getFirstName(_0x24ea45[_0xdb6f('0x38')]),'lastName':getLastName(_0x24ea45[_0xdb6f('0x38')]),'mapKey':_0xdb6f('0x7'),'message':{'from':getMails(_0x2cd9b6[_0xdb6f('0x7')],_0x24ea45[_0xdb6f('0x38')]),'to':_0x2cd9b6['email'],'cc':'','subject':_0x24ea45[_0xdb6f('0x39')]||'','messageId':_0x24ea45[_0xdb6f('0x3a')],'inReplyTo':_0x24ea45[_0xdb6f('0x3b')],'sentAt':moment(_0x24ea45[_0xdb6f('0x3c')])[_0xdb6f('0x29')](_0xdb6f('0x3d')),'attach':![],'attachments':[]}};if(!_0x24ea45[_0xdb6f('0x16')]&&!_0x24ea45[_0xdb6f('0x1f')]){var _0x1da4dd=_['filter'](_0x24ea45[_0xdb6f('0x25')],{'contentType':'application/ms-tnef'});if(_0x1da4dd[_0xdb6f('0x12')]){logger[_0xdb6f('0x3e')](util[_0xdb6f('0x29')](_0xdb6f('0x3f'),_0x24ea45[_0xdb6f('0x3a')]));tnef['parseBuffer'](_[_0xdb6f('0x40')](_0x1da4dd)['content'],function(_0x27599a,_0x369058){if(_0x369058){_0x24ea45[_0xdb6f('0x16')]=_0x369058[_0xdb6f('0x41')]||_0xdb6f('0x42');if(_0x369058[_0xdb6f('0x43')]){for(var _0x38c0f4=0x0;_0x38c0f4<_0x369058['Attachments'][_0xdb6f('0x12')];_0x38c0f4++){var _0x4f82da=_0x369058['Attachments'][_0x38c0f4];_0xc4bce6['message'][_0xdb6f('0x25')][_0xdb6f('0x30')]({'filename':_0x4f82da['Title'],'content':Buffer['from'](_0x4f82da[_0xdb6f('0x44')])});}}}_0x2aa1db(parseEmail(_0x2cd9b6,_0x24ea45,_0xc4bce6));});}else{_0x24ea45[_0xdb6f('0x16')]=_0xdb6f('0x42');_0x2aa1db(parseEmail(_0x2cd9b6,_0x24ea45,_0xc4bce6));}}else{_0x2aa1db(parseEmail(_0x2cd9b6,_0x24ea45,_0xc4bce6));}};exports['generateXOAuth2Token']=function(_0x4d7060,_0x33330b){var _0x3cebef=[_0xdb6f('0x45')+(_0x33330b||''),_0xdb6f('0x46')+_0x4d7060,'',''];return Buffer[_0xdb6f('0x38')](_0x3cebef[_0xdb6f('0x11')](''),_0xdb6f('0x47'))[_0xdb6f('0x48')](_0xdb6f('0x49'));}; \ No newline at end of file +var _0xe2d9=['../../../config/environment','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','head','isEmpty','anonymous','html','replace','includes','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','utf-8','toString','base64','lodash','randomstring','path','util','email'];(function(_0x4bebef,_0x1a55f7){var _0x4d74e5=function(_0x5691a9){while(--_0x5691a9){_0x4bebef['push'](_0x4bebef['shift']());}};_0x4d74e5(++_0x1a55f7);}(_0xe2d9,0x193));var _0x9e2d=function(_0xb2e457,_0x305895){_0xb2e457=_0xb2e457-0x0;var _0x375570=_0xe2d9[_0xb2e457];return _0x375570;};'use strict';var _=require(_0x9e2d('0x0'));var moment=require('moment');var random=require(_0x9e2d('0x1'));var fs=require('fs');var path=require(_0x9e2d('0x2'));var util=require(_0x9e2d('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x9e2d('0x4'));var config=require(_0x9e2d('0x5'));function getAddress(_0x3d9f2d){var _0x4caa88=_['head'](_0x3d9f2d[_0x9e2d('0x6')]);return _0x4caa88&&_0x4caa88[_0x9e2d('0x7')]?_0x4caa88['address']:'anonymous'+random[_0x9e2d('0x8')](0x6)+_0x9e2d('0x9');}function getFirstName(_0x1d634d){var _0x43d15d=_['head'](_0x1d634d[_0x9e2d('0x6')]);if(_0x43d15d&&_0x43d15d[_0x9e2d('0xa')]){if(_0x43d15d[_0x9e2d('0xa')]==_0x43d15d[_0x9e2d('0x7')]){return _0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xb')](0x0,_0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xc')]('@'));}var _0xca12de=_0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xd')](/\s+/);return _0xca12de[_0x9e2d('0xe')]>0x1?_0xca12de[_0x9e2d('0xf')](0x0,-0x1)['join']('\x20'):_0x43d15d[_0x9e2d('0xa')];}return _0x9e2d('0x10');}function getLastName(_0x3ca201){var _0x229efe=_[_0x9e2d('0x11')](_0x3ca201[_0x9e2d('0x6')]);if(_0x229efe&&_0x229efe['name']){var _0x544a91=_0x229efe[_0x9e2d('0xa')]['split'](/\s+/);return _0x544a91['length']>0x1?_0x544a91['pop']():'';}return'';}function getMails(_0x2513aa,_0x3d7823){var _0xcd69c4='';for(var _0x597ebb=0x0;_0x597ebb<_0x3d7823['value'][_0x9e2d('0xe')];_0x597ebb+=0x1){if(_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]!==_0x2513aa){if(!_[_0x9e2d('0x12')](_0xcd69c4)){_0xcd69c4+=',';}_0xcd69c4+=_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0xa')]||_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]||'';_0xcd69c4+='\x20<';_0xcd69c4+=_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]?_0x3d7823[_0x9e2d('0x6')][_0x597ebb]['address']:_0x9e2d('0x13')+random[_0x9e2d('0x8')](0x6)+'@xcally.com';_0xcd69c4+='>';}}return _0xcd69c4;}function parseEmail(_0x42d451,_0x51ea51,_0xdbceca){if(_0x51ea51['html']){var _0x147dde=/)<[^<]*)*<\/script>/gi;while(_0x147dde['test'](_0x51ea51[_0x9e2d('0x14')])){_0x51ea51[_0x9e2d('0x14')]=_0x51ea51['html'][_0x9e2d('0x15')](_0x147dde,'');}if(_0x51ea51[_0x9e2d('0x14')][_0x9e2d('0x16')]('{_0x334b34[_0x9e2d('0x18')](_0x5468bd[_0x9e2d('0x19')]);});var _0x294891=/]+>/g;var _0x4b99ee=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5330db=_0x51ea51[_0x9e2d('0x14')][_0x9e2d('0x15')](_0x4b99ee,_0x9e2d('0x1a'));var _0x3454e8=_0x5330db[_0x9e2d('0x15')](_0x294891,_0x9e2d('0x1b'));for(let _0x3eef11=0x0;_0x3eef11<_0x334b34['length'];_0x3eef11++){var _0x15870c=_0x3454e8['replace'](_0x9e2d('0x1b'),_0x9e2d('0x1c')+_0x334b34[_0x3eef11]+_0x9e2d('0x1d'));_0x3454e8=_0x15870c;}_0x51ea51[_0x9e2d('0x14')]=_0x3454e8;}_0xdbceca[_0x9e2d('0x1e')]=_0x51ea51[_0x9e2d('0x14')];}else{_0xdbceca['body']=_0x51ea51[_0x9e2d('0x1f')];}if(_0xdbceca[_0x9e2d('0x1e')]){_0xdbceca[_0x9e2d('0x1e')]=_0xdbceca['body']['replace'](/0x0){var _0x19b17f=['Auto-Submitted:\x20auto-replied',_0x9e2d('0x30'),_0x9e2d('0x31')];for(var _0x557c2c=0x0;_0x557c2c<_0x51ea51['headerLines'][_0x9e2d('0xe')];_0x557c2c++){var _0x231a33=_[_0x9e2d('0xc')](_0x19b17f,_0x51ea51[_0x9e2d('0x2f')][_0x557c2c][_0x9e2d('0x32')]);if(_0x231a33>=0x0){_0xdbceca[_0x9e2d('0x33')]=!![];}}}return _0xdbceca;}exports['parser']=function(_0x42aac9,_0x181816,_0x251649){var _0x5d17fc={'from':getAddress(_0x181816['from']),'firstName':getFirstName(_0x181816[_0x9e2d('0x34')]),'lastName':getLastName(_0x181816[_0x9e2d('0x34')]),'mapKey':_0x9e2d('0x4'),'message':{'from':getMails(_0x42aac9['email'],_0x181816['from']),'to':_0x42aac9[_0x9e2d('0x4')],'cc':'','subject':_0x181816[_0x9e2d('0x35')]||'','messageId':_0x181816[_0x9e2d('0x36')],'inReplyTo':_0x181816['inReplyTo'],'sentAt':moment(_0x181816[_0x9e2d('0x37')])[_0x9e2d('0x28')](_0x9e2d('0x38')),'attach':![],'attachments':[]}};if(!_0x181816['html']&&!_0x181816[_0x9e2d('0x1f')]){var _0x3dbb9b=_[_0x9e2d('0x39')](_0x181816[_0x9e2d('0x25')],{'contentType':'application/ms-tnef'});if(_0x3dbb9b[_0x9e2d('0xe')]){logger[_0x9e2d('0x3a')](util[_0x9e2d('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x181816[_0x9e2d('0x36')]));tnef[_0x9e2d('0x3b')](_[_0x9e2d('0x3c')](_0x3dbb9b)['content'],function(_0x107177,_0x4197ee){if(_0x4197ee){_0x181816[_0x9e2d('0x14')]=_0x4197ee['BodyHTML']||_0x9e2d('0x3d');if(_0x4197ee[_0x9e2d('0x3e')]){for(var _0x47cc9e=0x0;_0x47cc9e<_0x4197ee['Attachments'][_0x9e2d('0xe')];_0x47cc9e++){var _0x2378ba=_0x4197ee[_0x9e2d('0x3e')][_0x47cc9e];_0x5d17fc['message']['attachments'][_0x9e2d('0x18')]({'filename':_0x2378ba[_0x9e2d('0x3f')],'content':Buffer[_0x9e2d('0x34')](_0x2378ba[_0x9e2d('0x40')])});}}}_0x251649(parseEmail(_0x42aac9,_0x181816,_0x5d17fc));});}else{_0x181816[_0x9e2d('0x14')]=_0x9e2d('0x3d');_0x251649(parseEmail(_0x42aac9,_0x181816,_0x5d17fc));}}else{_0x251649(parseEmail(_0x42aac9,_0x181816,_0x5d17fc));}};exports['generateXOAuth2Token']=function(_0x431495,_0x5b46cb){var _0x571450=['user='+(_0x5b46cb||''),'auth=Bearer\x20'+_0x431495,'',''];return Buffer['from'](_0x571450[_0x9e2d('0x2b')](''),_0x9e2d('0x41'))[_0x9e2d('0x42')](_0x9e2d('0x43'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 1bc6331..a762147 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 _0xa066=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xa066,0x1ac));var _0x6a06=function(_0x18ab9b,_0x5de071){_0x18ab9b=_0x18ab9b-0x0;var _0x15087=_0xa066[_0x18ab9b];return _0x15087;};'use strict';var _=require(_0x6a06('0x0'));function MailAccount(_0x42c8b8){this['id']=_0x42c8b8['id']||0x0;this[_0x6a06('0x1')]=_0x42c8b8['name']||_0x6a06('0x2');this[_0x6a06('0x3')]=_0x42c8b8[_0x6a06('0x3')]||_0x6a06('0x4');this[_0x6a06('0x5')]=_0x42c8b8['active']||![];this[_0x6a06('0x6')]=_0x42c8b8[_0x6a06('0x6')]||[];this[_0x6a06('0x7')]=_0x42c8b8['Smtp']||[];}module[_0x6a06('0x8')]=MailAccount; \ No newline at end of file +var _0xc9ab=['SERV','Smtp','exports','lodash','name','Service','key'];(function(_0x2a21f1,_0x5b6d1a){var _0x19b89a=function(_0x3c7a42){while(--_0x3c7a42){_0x2a21f1['push'](_0x2a21f1['shift']());}};_0x19b89a(++_0x5b6d1a);}(_0xc9ab,0x7a));var _0xbc9a=function(_0x41f84f,_0x52fc4f){_0x41f84f=_0x41f84f-0x0;var _0x415877=_0xc9ab[_0x41f84f];return _0x415877;};'use strict';var _=require(_0xbc9a('0x0'));function MailAccount(_0x38a0c7){this['id']=_0x38a0c7['id']||0x0;this[_0xbc9a('0x1')]=_0x38a0c7[_0xbc9a('0x1')]||_0xbc9a('0x2');this[_0xbc9a('0x3')]=_0x38a0c7['key']||_0xbc9a('0x4');this['active']=_0x38a0c7['active']||![];this['Imap']=_0x38a0c7['Imap']||[];this[_0xbc9a('0x5')]=_0x38a0c7[_0xbc9a('0x5')]||[];}module[_0xbc9a('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 27f17f5..65d23ac 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 _0xee71=['merge','exports','lodash','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','length','isUndefined'];(function(_0x3c12cc,_0x1a574e){var _0xf52be2=function(_0x1fc636){while(--_0x1fc636){_0x3c12cc['push'](_0x3c12cc['shift']());}};_0xf52be2(++_0x1a574e);}(_0xee71,0x1e2));var _0x1ee7=function(_0x296411,_0x1d009d){_0x296411=_0x296411-0x0;var _0x17a0c4=_0xee71[_0x296411];return _0x17a0c4;};'use strict';var _=require(_0x1ee7('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x1ee7('0x1')]={};};function freeIsNotKey(_0x47509e,_0x1a137e,_0x124db8){var _0x25f98c=_[_0x1ee7('0x2')](_0x47509e,function(_0x5601ac,_0x1e5f32){return _0x5601ac[_0x124db8];});for(var _0x5da25e in _0x1a137e){if(_0x1a137e['hasOwnProperty'](_0x5da25e)){if(!_0x25f98c[_0x5da25e]){delete _0x1a137e[_0x5da25e];}}}}Realtime[_0x1ee7('0x3')][_0x1ee7('0x4')]=function(_0xd05ca3,_0x122ce3){for(var _0x124319 in _0x122ce3){if(_0xd05ca3[_0x1ee7('0x5')](_0x124319)){_0xd05ca3[_0x124319]=_0x122ce3[_0x124319];}}};Realtime[_0x1ee7('0x3')]['initMailAccounts']=function(){var _0x587495=this;return function(_0x592832){if(_0x592832){freeIsNotKey(_0x592832,_0x587495[_0x1ee7('0x1')],'id');for(var _0xc635f=0x0,_0x1b5a77={},_0x5df1f4={};_0xc635f<_0x592832[_0x1ee7('0x6')];_0xc635f+=0x1){_0x1b5a77=_0x592832[_0xc635f];if(_[_0x1ee7('0x7')](_0x587495[_0x1ee7('0x1')][_0x1b5a77['id']])){_0x587495[_0x1ee7('0x1')][_0x1b5a77['id']]=new MailAccount(_0x1b5a77);}else{_[_0x1ee7('0x8')](_0x587495['mailAccounts'][_0x1b5a77['id']],_0x1b5a77);}}}return _0x587495['mailAccounts'];};};module[_0x1ee7('0x9')]=Realtime; \ No newline at end of file +var _0xd539=['hasOwnProperty','prototype','mergeFromDatabase','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xd539,0xcd));var _0x9d53=function(_0x4b0091,_0x3321dd){_0x4b0091=_0x4b0091-0x0;var _0x581ae6=_0xd539[_0x4b0091];return _0x581ae6;};'use strict';var _=require(_0x9d53('0x0'));var MailAccount=require(_0x9d53('0x1'));var Realtime=function(){this[_0x9d53('0x2')]={};};function freeIsNotKey(_0xc59e44,_0x43bd4c,_0x16685c){var _0x243a8c=_['mapKeys'](_0xc59e44,function(_0x11060d,_0x4c7b08){return _0x11060d[_0x16685c];});for(var _0x204942 in _0x43bd4c){if(_0x43bd4c[_0x9d53('0x3')](_0x204942)){if(!_0x243a8c[_0x204942]){delete _0x43bd4c[_0x204942];}}}}Realtime[_0x9d53('0x4')][_0x9d53('0x5')]=function(_0x1cc2f3,_0x30a8f7){for(var _0x32e53a in _0x30a8f7){if(_0x1cc2f3['hasOwnProperty'](_0x32e53a)){_0x1cc2f3[_0x32e53a]=_0x30a8f7[_0x32e53a];}}};Realtime[_0x9d53('0x4')]['initMailAccounts']=function(){var _0x1b4488=this;return function(_0x584a20){if(_0x584a20){freeIsNotKey(_0x584a20,_0x1b4488[_0x9d53('0x2')],'id');for(var _0x3b3ab9=0x0,_0x568828={},_0x33c670={};_0x3b3ab9<_0x584a20['length'];_0x3b3ab9+=0x1){_0x568828=_0x584a20[_0x3b3ab9];if(_['isUndefined'](_0x1b4488['mailAccounts'][_0x568828['id']])){_0x1b4488[_0x9d53('0x2')][_0x568828['id']]=new MailAccount(_0x568828);}else{_[_0x9d53('0x6')](_0x1b4488[_0x9d53('0x2')][_0x568828['id']],_0x568828);}}}return _0x1b4488[_0x9d53('0x2')];};};module[_0x9d53('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 6df93ee..425f4d1 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 _0xc55e=['type','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','ListId','MailServerIn','Imap','CloudProvider','data5','MailServerOut','Smtp'];(function(_0x18c6d3,_0x3b1f15){var _0x449980=function(_0x3a0593){while(--_0x3a0593){_0x18c6d3['push'](_0x18c6d3['shift']());}};_0x449980(++_0x3b1f15);}(_0xc55e,0x146));var _0xec55=function(_0xfe0abd,_0x72dd16){_0xfe0abd=_0xfe0abd-0x0;var _0x594ca2=_0xc55e[_0xfe0abd];return _0x594ca2;};'use strict';var client=require(_0xec55('0x0'));exports[_0xec55('0x1')]=function(){return function(){return client[_0xec55('0x2')](_0xec55('0x3'),{'options':{'attributes':['id',_0xec55('0x4'),'provider',_0xec55('0x5'),_0xec55('0x6'),_0xec55('0x7'),_0xec55('0x8'),_0xec55('0x9'),'TemplateId'],'raw':![],'include':[{'model':_0xec55('0xa'),'as':_0xec55('0xb'),'include':[{'model':_0xec55('0xc'),'attributes':['id','name','service','type',_0xec55('0xd')],'as':_0xec55('0xc')}]},{'model':_0xec55('0xe'),'as':_0xec55('0xf'),'include':[{'model':_0xec55('0xc'),'attributes':['id','name',_0xec55('0x5'),_0xec55('0x10'),_0xec55('0xd')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x9d358,_0x16fa06){return client[_0xec55('0x2')]('NotifyMailAccount',{'account':{'id':_0x9d358},'body':_0x16fa06,'log':_0xec55('0x11')});}; \ No newline at end of file +var _0x35f5=['NotifyMailAccount','../client','Request','GetMailAccount','name','provider','key','ListId','MailServerIn','CloudProvider','type','MailServerOut','Smtp','service','data5','getMailAccount','notify'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x35f5,0x100));var _0x535f=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0x35f5[_0x403fc7];return _0x5d0827;};'use strict';var client=require(_0x535f('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x535f('0x1')](_0x535f('0x2'),{'options':{'attributes':['id',_0x535f('0x3'),_0x535f('0x4'),'service','email','active',_0x535f('0x5'),_0x535f('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x535f('0x7'),'as':'Imap','include':[{'model':_0x535f('0x8'),'attributes':['id',_0x535f('0x3'),'service',_0x535f('0x9'),'data5'],'as':_0x535f('0x8')}]},{'model':_0x535f('0xa'),'as':_0x535f('0xb'),'include':[{'model':_0x535f('0x8'),'attributes':['id',_0x535f('0x3'),_0x535f('0xc'),_0x535f('0x9'),_0x535f('0xd')],'as':'CloudProvider'}]}]},'log':_0x535f('0xe')});};};exports[_0x535f('0xf')]=function(_0x1e1c58,_0x336e28){return client[_0x535f('0x1')](_0x535f('0x10'),{'account':{'id':_0x1e1c58},'body':_0x336e28,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3bce425..17dc0eb 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 _0x31b8=['GetSettings','../client','getSettings','ShowSetting','loginMailFrequency'];(function(_0x239904,_0x4b11e2){var _0x259609=function(_0x41d52a){while(--_0x41d52a){_0x239904['push'](_0x239904['shift']());}};_0x259609(++_0x4b11e2);}(_0x31b8,0xc4));var _0x831b=function(_0x3cf923,_0x144333){_0x3cf923=_0x3cf923-0x0;var _0x20853e=_0x31b8[_0x3cf923];return _0x20853e;};'use strict';var client=require(_0x831b('0x0'));exports[_0x831b('0x1')]=function(){return client['Request'](_0x831b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x831b('0x3')]},'log':_0x831b('0x4')});}; \ No newline at end of file +var _0xe4c3=['ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x397ff2,_0x3453b2){var _0x3752e2=function(_0x48a4c5){while(--_0x48a4c5){_0x397ff2['push'](_0x397ff2['shift']());}};_0x3752e2(++_0x3453b2);}(_0xe4c3,0x18b));var _0x3e4c=function(_0x1efe71,_0x539317){_0x1efe71=_0x1efe71-0x0;var _0x315970=_0xe4c3[_0x1efe71];return _0x315970;};'use strict';var client=require('../client');exports[_0x3e4c('0x0')]=function(){return client['Request'](_0x3e4c('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3e4c('0x2')]},'log':_0x3e4c('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index f36993c..883e55a 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 e069bd2..ba4d6dd 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 _0xd8a7=['log','exports','lodash','http','express','ioredis','../../config/environment','createServer','listen','port','socket.io','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening'];(function(_0x30a398,_0x172792){var _0x1a5dd1=function(_0x1291a1){while(--_0x1291a1){_0x30a398['push'](_0x30a398['shift']());}};_0x1a5dd1(++_0x172792);}(_0xd8a7,0x14c));var _0x7d8a=function(_0xef8d1b,_0xfcc085){_0xef8d1b=_0xef8d1b-0x0;var _0x4139b8=_0xd8a7[_0xef8d1b];return _0x4139b8;};'use strict';var _=require(_0x7d8a('0x0'));var http=require(_0x7d8a('0x1'));var express=require(_0x7d8a('0x2'));var sticky=require('sticky-session');var Redis=require(_0x7d8a('0x3'));var config=require(_0x7d8a('0x4'));var app=express();var server=http[_0x7d8a('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x7d8a('0x6')](server,config[_0x7d8a('0x7')])){var socketio=require(_0x7d8a('0x8'))(server,{'transports':['websocket','polling']});config[_0x7d8a('0x9')]=_[_0x7d8a('0xa')](config[_0x7d8a('0x9')],{'host':_0x7d8a('0xb'),'port':0x18eb});socketio[_0x7d8a('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x7d8a('0x9')]),'subClient':new Redis(config['redis'])}));require(_0x7d8a('0xd'))[_0x7d8a('0xe')]();require(_0x7d8a('0xf'))[_0x7d8a('0xe')](socketio);require(_0x7d8a('0x10'))[_0x7d8a('0xe')](app);require(_0x7d8a('0x11'))[_0x7d8a('0xe')](app);}else{server[_0x7d8a('0x12')](_0x7d8a('0x13'),function(){console[_0x7d8a('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x7d8a('0x7')]);});}exports=module[_0x7d8a('0x15')]=app; \ No newline at end of file +var _0x1a1b=['defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','createServer','listen','port','socket.io','polling','redis'];(function(_0xf64792,_0x32ce6c){var _0x4fb7d7=function(_0x4ea996){while(--_0x4ea996){_0xf64792['push'](_0xf64792['shift']());}};_0x4fb7d7(++_0x32ce6c);}(_0x1a1b,0x1aa));var _0xb1a1=function(_0x2c26e8,_0x392265){_0x2c26e8=_0x2c26e8-0x0;var _0x25d356=_0x1a1b[_0x2c26e8];return _0x25d356;};'use strict';var _=require(_0xb1a1('0x0'));var http=require(_0xb1a1('0x1'));var express=require(_0xb1a1('0x2'));var sticky=require('sticky-session');var Redis=require(_0xb1a1('0x3'));var config=require(_0xb1a1('0x4'));var app=express();var server=http[_0xb1a1('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0xb1a1('0x6')](server,config[_0xb1a1('0x7')])){var socketio=require(_0xb1a1('0x8'))(server,{'transports':['websocket',_0xb1a1('0x9')]});config[_0xb1a1('0xa')]=_[_0xb1a1('0xb')](config[_0xb1a1('0xa')],{'host':_0xb1a1('0xc'),'port':0x18eb});socketio[_0xb1a1('0xd')](require(_0xb1a1('0xe'))({'pubClient':new Redis(config[_0xb1a1('0xa')]),'subClient':new Redis(config[_0xb1a1('0xa')])}));require(_0xb1a1('0xf'))[_0xb1a1('0x10')]();require(_0xb1a1('0x11'))[_0xb1a1('0x10')](socketio);require(_0xb1a1('0x12'))[_0xb1a1('0x10')](app);require(_0xb1a1('0x13'))[_0xb1a1('0x10')](app);}else{server['once']('listening',function(){console[_0xb1a1('0x14')](_0xb1a1('0x15'),config['port']);});}exports=module[_0xb1a1('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3d303ff..b9bc197 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 _0x64f5=['then','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x64f5,0xf2));var _0x564f=function(_0x4920a1,_0x5bc215){_0x4920a1=_0x4920a1-0x0;var _0x25ae52=_0x64f5[_0x4920a1];return _0x25ae52;};'use strict';var jayson=require(_0x564f('0x0'));var BPromise=require(_0x564f('0x1'));var logger=require(_0x564f('0x2'))('routing');var client=jayson['client'][_0x564f('0x3')]({'port':0x2329});client['Request']=function(_0x5a7bfc,_0x1c73b2){return new BPromise(function(_0x32efb5,_0x47be19){return client[_0x564f('0x4')](_0x5a7bfc,_0x1c73b2)[_0x564f('0x5')](function(_0x5141c2){logger['debug'](_0x564f('0x6'),_0x564f('0x7'),_0x5a7bfc,_0x1c73b2,_0x5141c2);if(_0x5141c2[_0x564f('0x8')]){logger[_0x564f('0x8')](_0x564f('0x6'),_0x564f('0x7'),_0x5a7bfc,_0x5141c2[_0x564f('0x8')][_0x564f('0x9')],_0x1c73b2);return _0x47be19(_0x5141c2[_0x564f('0x8')][_0x564f('0x9')]);}else{return _0x32efb5(_0x5141c2[_0x564f('0xa')]);}})[_0x564f('0xb')](function(_0x5544b5){logger['error'](_0x564f('0x6'),_0x564f('0x7'),_0x5a7bfc,_0x5544b5,_0x1c73b2);return _0x47be19(_0x5544b5);});});};module[_0x564f('0xc')]=client; \ No newline at end of file +var _0x40ad=['Request','request','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client'];(function(_0x48d0be,_0x40cdb6){var _0x48901a=function(_0x562c42){while(--_0x562c42){_0x48d0be['push'](_0x48d0be['shift']());}};_0x48901a(++_0x40cdb6);}(_0x40ad,0x8b));var _0xd40a=function(_0x141380,_0x39a064){_0x141380=_0x141380-0x0;var _0x184ed8=_0x40ad[_0x141380];return _0x184ed8;};'use strict';var jayson=require(_0xd40a('0x0'));var BPromise=require(_0xd40a('0x1'));var logger=require('../../config/logger')(_0xd40a('0x2'));var client=jayson[_0xd40a('0x3')]['http']({'port':0x2329});client[_0xd40a('0x4')]=function(_0x691621,_0x4be846){return new BPromise(function(_0x56a158,_0x488f23){return client[_0xd40a('0x5')](_0x691621,_0x4be846)['then'](function(_0x5415fc){logger[_0xd40a('0x6')](_0xd40a('0x7'),_0xd40a('0x2'),_0x691621,_0x4be846,_0x5415fc);if(_0x5415fc['error']){logger['error'](_0xd40a('0x7'),'routing',_0x691621,_0x5415fc[_0xd40a('0x8')]['message'],_0x4be846);return _0x488f23(_0x5415fc[_0xd40a('0x8')][_0xd40a('0x9')]);}else{return _0x56a158(_0x5415fc[_0xd40a('0xa')]);}})[_0xd40a('0xb')](function(_0x31e614){logger[_0xd40a('0x8')](_0xd40a('0x7'),'routing',_0x691621,_0x31e614,_0x4be846);return _0x488f23(_0x31e614);});});};module[_0xd40a('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 1c2eb04..a8baafc 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 _0x83df=['./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x83df,0xe3));var _0xf83d=function(_0x2673a4,_0x4d0b8d){_0x2673a4=_0x2673a4-0x0;var _0x5e3a6a=_0x83df[_0x2673a4];return _0x5e3a6a;};'use strict';var BPromise=require(_0xf83d('0x0'));var server=require(_0xf83d('0x1'));var Realtime=require('./realtime');var user=require(_0xf83d('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xf83d('0x3'));var chatQueue=require(_0xf83d('0x4'));var smsQueue=require(_0xf83d('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xf83d('0x6'));var whatsappQueue=require(_0xf83d('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf83d('0x8')]()['then'](user[_0xf83d('0x9')]())[_0xf83d('0xa')](realtime[_0xf83d('0xb')]())['then'](interval[_0xf83d('0xc')]())[_0xf83d('0xa')](realtime[_0xf83d('0xd')]())[_0xf83d('0xa')](openchannelQueue[_0xf83d('0xe')]())[_0xf83d('0xa')](realtime[_0xf83d('0xf')]())[_0xf83d('0xa')](chatQueue[_0xf83d('0x10')]())[_0xf83d('0xa')](realtime[_0xf83d('0x11')]())['then'](smsQueue[_0xf83d('0x12')]())['then'](realtime['initSmsQueues']())[_0xf83d('0xa')](mailQueue[_0xf83d('0x13')]())[_0xf83d('0xa')](realtime[_0xf83d('0x14')]())[_0xf83d('0xa')](faxQueue['getFaxQueues']())[_0xf83d('0xa')](realtime[_0xf83d('0x15')]())[_0xf83d('0xa')](whatsappQueue[_0xf83d('0x16')]())[_0xf83d('0xa')](realtime[_0xf83d('0x17')]())[_0xf83d('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xf83d('0xa')](function(_0x21a9b0){return initRealtime();})[_0xf83d('0xa')](function(_0x2d9113){return setInterval(initRealtime,0x1388);})[_0xf83d('0x18')](function(_0x138dbd){console[_0xf83d('0x19')](_0x138dbd);});}main(); \ No newline at end of file +var _0x5f95=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals'];(function(_0x1f3ea3,_0x34f96a){var _0x805512=function(_0x135804){while(--_0x135804){_0x1f3ea3['push'](_0x1f3ea3['shift']());}};_0x805512(++_0x34f96a);}(_0x5f95,0x142));var _0x55f9=function(_0x4dffbd,_0x101fa3){_0x4dffbd=_0x4dffbd-0x0;var _0x21d414=_0x5f95[_0x4dffbd];return _0x21d414;};'use strict';var BPromise=require(_0x55f9('0x0'));var server=require(_0x55f9('0x1'));var Realtime=require('./realtime');var user=require(_0x55f9('0x2'));var interval=require(_0x55f9('0x3'));var openchannelQueue=require(_0x55f9('0x4'));var chatQueue=require(_0x55f9('0x5'));var smsQueue=require(_0x55f9('0x6'));var mailQueue=require(_0x55f9('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x55f9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x55f9('0x9')]()['then'](user[_0x55f9('0xa')]())[_0x55f9('0xb')](realtime[_0x55f9('0xc')]())[_0x55f9('0xb')](interval[_0x55f9('0xd')]())[_0x55f9('0xb')](realtime[_0x55f9('0xe')]())[_0x55f9('0xb')](openchannelQueue[_0x55f9('0xf')]())[_0x55f9('0xb')](realtime[_0x55f9('0x10')]())[_0x55f9('0xb')](chatQueue[_0x55f9('0x11')]())[_0x55f9('0xb')](realtime[_0x55f9('0x12')]())[_0x55f9('0xb')](smsQueue[_0x55f9('0x13')]())['then'](realtime['initSmsQueues']())[_0x55f9('0xb')](mailQueue[_0x55f9('0x14')]())[_0x55f9('0xb')](realtime[_0x55f9('0x15')]())[_0x55f9('0xb')](faxQueue[_0x55f9('0x16')]())[_0x55f9('0xb')](realtime[_0x55f9('0x17')]())[_0x55f9('0xb')](whatsappQueue[_0x55f9('0x18')]())[_0x55f9('0xb')](realtime['initWhatsappQueues']())[_0x55f9('0xb')](function(){return realtime;});}function main(){return server[_0x55f9('0x19')](realtime)['then'](function(_0x497c03){return initRealtime();})['then'](function(_0x23b416){return setInterval(initRealtime,0x1388);})[_0x55f9('0x1a')](function(_0x57e6ae){console[_0x55f9('0x1b')](_0x57e6ae);});}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 29a54ed..3386c40 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x18656a,_0x279775){var _0x10da7c=function(_0x1ada37){while(--_0x1ada37){_0x18656a['push'](_0x18656a['shift']());}};_0x10da7c(++_0x279775);}(_0xe14b,0x93));var _0xbe14=function(_0x4d2702,_0x5dc0a8){_0x4d2702=_0x4d2702-0x0;var _0x253400=_0xe14b[_0x4d2702];return _0x253400;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x469b4d,_0x1b748f){var _0xa08f41=function(_0xf2e50a){while(--_0xf2e50a){_0x469b4d['push'](_0x469b4d['shift']());}};_0xa08f41(++_0x1b748f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 63fc0f5..666adf8 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 _0x29d9=['http','request','error','bluebird','jayson/promise'];(function(_0x2fa434,_0x51a933){var _0x4d015f=function(_0x67441){while(--_0x67441){_0x2fa434['push'](_0x2fa434['shift']());}};_0x4d015f(++_0x51a933);}(_0x29d9,0x80));var _0x929d=function(_0x76c9d0,_0x133c1e){_0x76c9d0=_0x76c9d0-0x0;var _0x755691=_0x29d9[_0x76c9d0];return _0x755691;};'use strict';var BPromise=require(_0x929d('0x0'));var jayson=require(_0x929d('0x1'));var client=jayson['client'][_0x929d('0x2')]({'port':0x232b});function request(_0x1eee59,_0x42e6a3){return new BPromise(function(_0x579a52,_0x588e4f){return client[_0x929d('0x3')](_0x1eee59,_0x42e6a3)['then'](function(_0x3461d9){if(_0x3461d9[_0x929d('0x4')]){return _0x588e4f(_0x3461d9[_0x929d('0x4')]['message']);}else{return _0x579a52(_0x3461d9['result']);}})['catch'](function(_0x20c624){return _0x588e4f(_0x20c624);});});}exports['sendMailMessage']=function(_0x363633,_0x47f556){return request('SendMail',{'account':_0x363633,'message':_0x47f556});}; \ No newline at end of file +var _0x16c2=['message','result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then','error'];(function(_0x5cabcf,_0x37ac71){var _0x46896d=function(_0x4f24ec){while(--_0x4f24ec){_0x5cabcf['push'](_0x5cabcf['shift']());}};_0x46896d(++_0x37ac71);}(_0x16c2,0x94));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x216c('0x0'));var client=jayson[_0x216c('0x1')][_0x216c('0x2')]({'port':0x232b});function request(_0x4ffbf6,_0x37ea34){return new BPromise(function(_0x23bee9,_0x331817){return client[_0x216c('0x3')](_0x4ffbf6,_0x37ea34)[_0x216c('0x4')](function(_0x4b7ce9){if(_0x4b7ce9[_0x216c('0x5')]){return _0x331817(_0x4b7ce9['error'][_0x216c('0x6')]);}else{return _0x23bee9(_0x4b7ce9[_0x216c('0x7')]);}})[_0x216c('0x8')](function(_0x528846){return _0x331817(_0x528846);});});}exports[_0x216c('0x9')]=function(_0x1cd165,_0x55fd5c){return request(_0x216c('0xa'),{'account':_0x1cd165,'message':_0x55fd5c});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 47e3d07..45f016e 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 _0x9972=['online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailStatus','unknown','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','whatsappStatusTime','busy','emit','user:save','exports','lodash','moment','md5','ioredis','redis','socket.io-emitter','name'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x9972,0xaa));var _0x2997=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9972[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x2997('0x0'));var moment=require(_0x2997('0x1'));var md5=require(_0x2997('0x2'));var Redis=require(_0x2997('0x3'));var config=require('../../../config/environment');config[_0x2997('0x4')]=_['defaults'](config[_0x2997('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x2997('0x5'))(new Redis(config[_0x2997('0x4')]));function Agent(_0x5ad5a6){this['id']=_0x5ad5a6['id']||0x0;this[_0x2997('0x6')]=_0x5ad5a6[_0x2997('0x6')]||'';this[_0x2997('0x7')]=_0x5ad5a6['online']||!![];this[_0x2997('0x8')]=_0x5ad5a6[_0x2997('0x8')]||![];this[_0x2997('0x9')]=_0x5ad5a6[_0x2997('0x9')]||![];this[_0x2997('0xa')]=_0x5ad5a6[_0x2997('0xa')]||![];this['faxPause']=_0x5ad5a6[_0x2997('0xb')]||![];this[_0x2997('0xc')]=_0x5ad5a6['smsPause']||![];this[_0x2997('0xd')]=_0x5ad5a6['openchannelPause']||![];this[_0x2997('0xe')]='unknown';this[_0x2997('0xf')]=0x0;this[_0x2997('0x10')]=_0x5ad5a6[_0x2997('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x2997('0x11')]=_0x2997('0x12');this['mailStatusTime']=0x0;this[_0x2997('0x13')]=_0x5ad5a6[_0x2997('0x13')]||0x0;this[_0x2997('0x14')]=0x0;this[_0x2997('0x15')]=_0x2997('0x12');this[_0x2997('0x16')]=0x0;this[_0x2997('0x17')]=_0x5ad5a6['faxCapacity']||0x0;this[_0x2997('0x18')]=0x0;this[_0x2997('0x19')]=_0x2997('0x12');this['smsStatusTime']=0x0;this[_0x2997('0x1a')]=_0x5ad5a6[_0x2997('0x1a')]||0x0;this[_0x2997('0x1b')]=0x0;this[_0x2997('0x1c')]=_0x2997('0x12');this['whatsappStatusTime']=0x0;this[_0x2997('0x1d')]=_0x5ad5a6['whatsappCapacity']||0x0;this[_0x2997('0x1e')]=0x0;this[_0x2997('0x1f')]='unknown';this[_0x2997('0x20')]=0x0;this[_0x2997('0x21')]=_0x5ad5a6[_0x2997('0x21')]||0x0;this[_0x2997('0x22')]=0x0;this['busy']=![];this[_0x2997('0x23')]=undefined;this[_0x2997('0x2')]='';this[_0x2997('0x24')]();}Agent[_0x2997('0x25')]['getChannelStatus']=function(_0x555b5c){if(this[_0x555b5c+_0x2997('0x26')]>0x0){if(this[_0x555b5c+_0x2997('0x27')]>0x0&&this[_0x555b5c+_0x2997('0x26')]>=this[_0x555b5c+'Capacity']){return'maxcapacity';}else{return _0x2997('0x28');}}else{return _0x2997('0x29');}};Agent[_0x2997('0x25')][_0x2997('0x24')]=function(){var _0x8b69a4=[_0x2997('0x2a'),_0x2997('0x2b'),_0x2997('0x2c'),_0x2997('0x2d'),_0x2997('0x2e'),_0x2997('0x2f')];for(var _0x56eebd=0x0;_0x56eebd<_0x8b69a4[_0x2997('0x30')];_0x56eebd+=0x1){var _0x4f4fef=this[_0x2997('0x31')](_0x8b69a4[_0x56eebd]);if(this[_0x8b69a4[_0x56eebd]+_0x2997('0x32')]!==_0x4f4fef){this[_0x8b69a4[_0x56eebd]+_0x2997('0x33')]=_[_0x2997('0x34')](moment()[_0x2997('0x35')]('x'));}this[_0x8b69a4[_0x56eebd]+'Status']=_0x4f4fef;}var _0x6639be={'id':this['id'],'name':this['name'],'online':this[_0x2997('0x7')],'voicePause':this[_0x2997('0x8')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x2997('0xc')],'faxPause':this[_0x2997('0xb')],'openchannelPause':this[_0x2997('0xd')],'chatStatus':this[_0x2997('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x2997('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x2997('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x2997('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x2997('0x17')],'faxCurrentCapacity':this[_0x2997('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x2997('0x1a')],'smsCurrentCapacity':this[_0x2997('0x1b')],'whatsappStatus':this[_0x2997('0x1c')],'whatsappStatusTime':this[_0x2997('0x36')],'whatsappCapacity':this[_0x2997('0x1d')],'whatsappCurrentCapacity':this[_0x2997('0x1e')],'openchannelStatus':this[_0x2997('0x1f')],'openchannelStatusTime':this[_0x2997('0x20')],'openchannelCapacity':this[_0x2997('0x21')],'openchannelCurrentCapacity':this[_0x2997('0x22')],'busy':this[_0x2997('0x37')],'busyQueue':this['busyQueue']};var _0x50be57=md5(JSON['stringify'](_0x6639be));if(this[_0x2997('0x2')]!==_0x50be57){this[_0x2997('0x2')]=_0x50be57;io[_0x2997('0x38')](_0x2997('0x39'),_0x6639be);}};module[_0x2997('0x3a')]=Agent; \ No newline at end of file +var _0x5217=['chat','sms','whatsapp','length','StatusTime','format','Status','chatStatusTime','smsStatus','smsCurrentCapacity','busyQueue','stringify','user:save','lodash','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail'];(function(_0x486af0,_0x189ef2){var _0x436434=function(_0x10ece9){while(--_0x10ece9){_0x486af0['push'](_0x486af0['shift']());}};_0x436434(++_0x189ef2);}(_0x5217,0xbb));var _0x7521=function(_0x113c57,_0x554616){_0x113c57=_0x113c57-0x0;var _0x21d656=_0x5217[_0x113c57];return _0x21d656;};'use strict';var _=require(_0x7521('0x0'));var moment=require('moment');var md5=require(_0x7521('0x1'));var Redis=require('ioredis');var config=require(_0x7521('0x2'));config[_0x7521('0x3')]=_[_0x7521('0x4')](config[_0x7521('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7521('0x5'))(new Redis(config['redis']));function Agent(_0x588408){this['id']=_0x588408['id']||0x0;this['name']=_0x588408[_0x7521('0x6')]||'';this[_0x7521('0x7')]=_0x588408['online']||!![];this[_0x7521('0x8')]=_0x588408[_0x7521('0x8')]||![];this['chatPause']=_0x588408[_0x7521('0x9')]||![];this[_0x7521('0xa')]=_0x588408[_0x7521('0xa')]||![];this[_0x7521('0xb')]=_0x588408[_0x7521('0xb')]||![];this[_0x7521('0xc')]=_0x588408['smsPause']||![];this[_0x7521('0xd')]=_0x588408['openchannelPause']||![];this[_0x7521('0xe')]=_0x7521('0xf');this['chatStatusTime']=0x0;this[_0x7521('0x10')]=_0x588408[_0x7521('0x10')]||0x0;this[_0x7521('0x11')]=0x0;this[_0x7521('0x12')]='unknown';this[_0x7521('0x13')]=0x0;this[_0x7521('0x14')]=_0x588408[_0x7521('0x14')]||0x0;this[_0x7521('0x15')]=0x0;this[_0x7521('0x16')]=_0x7521('0xf');this[_0x7521('0x17')]=0x0;this[_0x7521('0x18')]=_0x588408[_0x7521('0x18')]||0x0;this[_0x7521('0x19')]=0x0;this['smsStatus']=_0x7521('0xf');this[_0x7521('0x1a')]=0x0;this['smsCapacity']=_0x588408[_0x7521('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x7521('0x1c')]='unknown';this[_0x7521('0x1d')]=0x0;this[_0x7521('0x1e')]=_0x588408[_0x7521('0x1e')]||0x0;this[_0x7521('0x1f')]=0x0;this[_0x7521('0x20')]=_0x7521('0xf');this[_0x7521('0x21')]=0x0;this[_0x7521('0x22')]=_0x588408['openchannelCapacity']||0x0;this[_0x7521('0x23')]=0x0;this[_0x7521('0x24')]=![];this['busyQueue']=undefined;this[_0x7521('0x1')]='';this[_0x7521('0x25')]();}Agent[_0x7521('0x26')][_0x7521('0x27')]=function(_0x4048c5){if(this[_0x4048c5+_0x7521('0x28')]>0x0){if(this[_0x4048c5+_0x7521('0x29')]>0x0&&this[_0x4048c5+_0x7521('0x28')]>=this[_0x4048c5+_0x7521('0x29')]){return _0x7521('0x2a');}else{return _0x7521('0x2b');}}else{return'idle';}};Agent[_0x7521('0x26')][_0x7521('0x25')]=function(){var _0x36cb70=[_0x7521('0x2c'),_0x7521('0x2d'),'openchannel','fax',_0x7521('0x2e'),_0x7521('0x2f')];for(var _0x264ed2=0x0;_0x264ed2<_0x36cb70[_0x7521('0x30')];_0x264ed2+=0x1){var _0x27d856=this[_0x7521('0x27')](_0x36cb70[_0x264ed2]);if(this[_0x36cb70[_0x264ed2]+'Status']!==_0x27d856){this[_0x36cb70[_0x264ed2]+_0x7521('0x31')]=_['toNumber'](moment()[_0x7521('0x32')]('x'));}this[_0x36cb70[_0x264ed2]+_0x7521('0x33')]=_0x27d856;}var _0x1bf2aa={'id':this['id'],'name':this[_0x7521('0x6')],'online':this[_0x7521('0x7')],'voicePause':this[_0x7521('0x8')],'chatPause':this[_0x7521('0x9')],'mailPause':this[_0x7521('0xa')],'smsPause':this[_0x7521('0xc')],'faxPause':this[_0x7521('0xb')],'openchannelPause':this[_0x7521('0xd')],'chatStatus':this[_0x7521('0xe')],'chatStatusTime':this[_0x7521('0x34')],'chatCapacity':this[_0x7521('0x10')],'chatCurrentCapacity':this[_0x7521('0x11')],'mailStatus':this[_0x7521('0x12')],'mailStatusTime':this[_0x7521('0x13')],'mailCapacity':this[_0x7521('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x7521('0x16')],'faxStatusTime':this[_0x7521('0x17')],'faxCapacity':this[_0x7521('0x18')],'faxCurrentCapacity':this[_0x7521('0x19')],'smsStatus':this[_0x7521('0x35')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x7521('0x1b')],'smsCurrentCapacity':this[_0x7521('0x36')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x7521('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x7521('0x1f')],'openchannelStatus':this[_0x7521('0x20')],'openchannelStatusTime':this[_0x7521('0x21')],'openchannelCapacity':this[_0x7521('0x22')],'openchannelCurrentCapacity':this[_0x7521('0x23')],'busy':this[_0x7521('0x24')],'busyQueue':this[_0x7521('0x37')]};var _0x5efb60=md5(JSON[_0x7521('0x38')](_0x1bf2aa));if(this['md5']!==_0x5efb60){this[_0x7521('0x1')]=_0x5efb60;io['emit'](_0x7521('0x39'),_0x1bf2aa);}};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 65916c7..d3f2bd9 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 _0x7a39=['waiting','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','prototype','updateRouting','_rr','map','Agents','updateRealtime','length','online','loggedIn','chatPause','paused','available'];(function(_0x10eacc,_0x3e08fd){var _0x44546e=function(_0x4842c6){while(--_0x4842c6){_0x10eacc['push'](_0x10eacc['shift']());}};_0x44546e(++_0x3e08fd);}(_0x7a39,0x13c));var _0x97a3=function(_0x1a098e,_0x7b12d9){_0x1a098e=_0x1a098e-0x0;var _0x503b6c=_0x7a39[_0x1a098e];return _0x503b6c;};'use strict';var _=require(_0x97a3('0x0'));var md5=require(_0x97a3('0x1'));var util=require(_0x97a3('0x2'));var Redis=require(_0x97a3('0x3'));var config=require(_0x97a3('0x4'));config[_0x97a3('0x5')]=_['defaults'](config['redis'],{'host':_0x97a3('0x6'),'port':0x18eb});var io=require(_0x97a3('0x7'))(new Redis(config[_0x97a3('0x5')]));function ChatQueue(_0x5bdd30){this['id']=_0x5bdd30['id']||0x0;this[_0x97a3('0x8')]=_0x5bdd30[_0x97a3('0x8')]||'';this[_0x97a3('0x9')]=_0x5bdd30['timeout']||0xa;this[_0x97a3('0xa')]=_0x5bdd30[_0x97a3('0xa')]||_0x97a3('0xb');this['Agents']=_0x5bdd30['Agents'];this[_0x97a3('0xc')]={};this['waiting']=0x0;this[_0x97a3('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x97a3('0xd')][_0x97a3('0xe')]=function(){var _0x1d1dc0=this[_0x97a3('0xc')][_0x97a3('0xf')];this[_0x97a3('0xc')]=_[_0x97a3('0x10')](this[_0x97a3('0x11')],'id');this[_0x97a3('0xc')][_0x97a3('0xf')]=_0x1d1dc0;};ChatQueue[_0x97a3('0xd')][_0x97a3('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x58988f=0x0;_0x58988f=0x0?this[_0x97a3('0x18')]:0x0;var _0x384b41={'id':this['id'],'available':this['available'],'loggedIn':this[_0x97a3('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x97a3('0x19')]};var _0x462d8a=md5(JSON[_0x97a3('0x1a')](_0x384b41));if(this['md5']!==_0x462d8a){this['md5']=_0x462d8a;io['to'](util[_0x97a3('0x1b')](_0x97a3('0x1c'),_0x384b41[_0x97a3('0x8')]))[_0x97a3('0x1d')]('chat_queue:save',_0x384b41);}};module[_0x97a3('0x1e')]=ChatQueue; \ No newline at end of file +var _0x5c63=['updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','waiting'];(function(_0x3d9769,_0x2f397d){var _0x4ab054=function(_0x1684ac){while(--_0x1684ac){_0x3d9769['push'](_0x3d9769['shift']());}};_0x4ab054(++_0x2f397d);}(_0x5c63,0xe7));var _0x35c6=function(_0x36ddc9,_0x5e8282){_0x36ddc9=_0x36ddc9-0x0;var _0x4b5b11=_0x5c63[_0x36ddc9];return _0x4b5b11;};'use strict';var _=require('lodash');var md5=require(_0x35c6('0x0'));var util=require(_0x35c6('0x1'));var Redis=require(_0x35c6('0x2'));var config=require(_0x35c6('0x3'));config[_0x35c6('0x4')]=_[_0x35c6('0x5')](config[_0x35c6('0x4')],{'host':_0x35c6('0x6'),'port':0x18eb});var io=require(_0x35c6('0x7'))(new Redis(config[_0x35c6('0x4')]));function ChatQueue(_0x42a9c3){this['id']=_0x42a9c3['id']||0x0;this[_0x35c6('0x8')]=_0x42a9c3[_0x35c6('0x8')]||'';this['timeout']=_0x42a9c3['timeout']||0xa;this[_0x35c6('0x9')]=_0x42a9c3[_0x35c6('0x9')]||'beepall';this[_0x35c6('0xa')]=_0x42a9c3[_0x35c6('0xa')];this['mapAgentsId']={};this[_0x35c6('0xb')]=0x0;this[_0x35c6('0x0')]='';this['updateRouting']();this[_0x35c6('0xc')]();}ChatQueue['prototype']['updateRouting']=function(){var _0xad8937=this[_0x35c6('0xd')][_0x35c6('0xe')];this['mapAgentsId']=_[_0x35c6('0xf')](this['Agents'],'id');this[_0x35c6('0xd')]['_rr']=_0xad8937;};ChatQueue[_0x35c6('0x10')][_0x35c6('0xc')]=function(){this[_0x35c6('0x11')]=0x0;this[_0x35c6('0x12')]=0x0;for(var _0x18f3ac=0x0;_0x18f3ac=0x0?this[_0x35c6('0x16')]:0x0;var _0x592d6f={'id':this['id'],'available':this[_0x35c6('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x35c6('0x8')],'paused':this[_0x35c6('0x12')],'waiting':this[_0x35c6('0xb')]};var _0x134988=md5(JSON['stringify'](_0x592d6f));if(this[_0x35c6('0x0')]!==_0x134988){this[_0x35c6('0x0')]=_0x134988;io['to'](util[_0x35c6('0x17')](_0x35c6('0x18'),_0x592d6f[_0x35c6('0x8')]))[_0x35c6('0x19')](_0x35c6('0x1a'),_0x592d6f);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 02313cf..40b4e44 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 _0xfbd3=['loggedIn','faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','length'];(function(_0x3bb643,_0x576591){var _0xada98d=function(_0x1d639d){while(--_0x1d639d){_0x3bb643['push'](_0x3bb643['shift']());}};_0xada98d(++_0x576591);}(_0xfbd3,0x1cc));var _0x3fbd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfbd3[_0x432682];return _0x463d05;};'use strict';var _=require(_0x3fbd('0x0'));var md5=require(_0x3fbd('0x1'));var util=require(_0x3fbd('0x2'));var Redis=require(_0x3fbd('0x3'));var config=require('../../../config/environment');config[_0x3fbd('0x4')]=_[_0x3fbd('0x5')](config['redis'],{'host':_0x3fbd('0x6'),'port':0x18eb});var io=require(_0x3fbd('0x7'))(new Redis(config[_0x3fbd('0x4')]));function FaxQueue(_0x22994d){this['id']=_0x22994d['id']||0x0;this[_0x3fbd('0x8')]=_0x22994d[_0x3fbd('0x8')]||'';this[_0x3fbd('0x9')]=_0x22994d['timeout']||0xa;this[_0x3fbd('0xa')]=_0x22994d[_0x3fbd('0xa')]||_0x3fbd('0xb');this['Agents']=_0x22994d[_0x3fbd('0xc')];this[_0x3fbd('0xd')]={};this[_0x3fbd('0xe')]=0x0;this[_0x3fbd('0x1')]='';this[_0x3fbd('0xf')]();this[_0x3fbd('0x10')]();}FaxQueue[_0x3fbd('0x11')]['updateRouting']=function(){var _0x56229c=this['mapAgentsId'][_0x3fbd('0x12')];this[_0x3fbd('0xd')]=_['map'](this[_0x3fbd('0xc')],'id');this['mapAgentsId'][_0x3fbd('0x12')]=_0x56229c;};FaxQueue[_0x3fbd('0x11')][_0x3fbd('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x45806f=0x0;_0x45806f=0x0?this['available']:0x0;var _0x470ddd={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3fbd('0x14')],'name':this['name'],'paused':this[_0x3fbd('0x16')],'waiting':this[_0x3fbd('0xe')]};var _0x2aa269=md5(JSON[_0x3fbd('0x18')](_0x470ddd));if(this[_0x3fbd('0x1')]!==_0x2aa269){this['md5']=_0x2aa269;io['to'](util[_0x3fbd('0x19')](_0x3fbd('0x1a'),_0x470ddd['name']))[_0x3fbd('0x1b')](_0x3fbd('0x1c'),_0x470ddd);}};module[_0x3fbd('0x1d')]=FaxQueue; \ No newline at end of file +var _0xc3b1=['loggedIn','paused','faxPause','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x37729f,_0x1e7d52){var _0x37a2e6=function(_0x4b1928){while(--_0x4b1928){_0x37729f['push'](_0x37729f['shift']());}};_0x37a2e6(++_0x1e7d52);}(_0xc3b1,0xeb));var _0x1c3b=function(_0x12610b,_0xc1a936){_0x12610b=_0x12610b-0x0;var _0x492008=_0xc3b1[_0x12610b];return _0x492008;};'use strict';var _=require(_0x1c3b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1c3b('0x1'));var config=require(_0x1c3b('0x2'));config['redis']=_[_0x1c3b('0x3')](config['redis'],{'host':_0x1c3b('0x4'),'port':0x18eb});var io=require(_0x1c3b('0x5'))(new Redis(config['redis']));function FaxQueue(_0x31f4f5){this['id']=_0x31f4f5['id']||0x0;this['name']=_0x31f4f5[_0x1c3b('0x6')]||'';this[_0x1c3b('0x7')]=_0x31f4f5[_0x1c3b('0x7')]||0xa;this['strategy']=_0x31f4f5[_0x1c3b('0x8')]||'beepall';this[_0x1c3b('0x9')]=_0x31f4f5['Agents'];this[_0x1c3b('0xa')]={};this[_0x1c3b('0xb')]=0x0;this['md5']='';this[_0x1c3b('0xc')]();this[_0x1c3b('0xd')]();}FaxQueue[_0x1c3b('0xe')][_0x1c3b('0xc')]=function(){var _0x26807c=this['mapAgentsId'][_0x1c3b('0xf')];this[_0x1c3b('0xa')]=_[_0x1c3b('0x10')](this[_0x1c3b('0x9')],'id');this['mapAgentsId'][_0x1c3b('0xf')]=_0x26807c;};FaxQueue['prototype'][_0x1c3b('0xd')]=function(){this[_0x1c3b('0x11')]=0x0;this[_0x1c3b('0x12')]=0x0;for(var _0x1f153c=0x0;_0x1f153c=0x0?this[_0x1c3b('0x14')]:0x0;var _0x46a56d={'id':this['id'],'available':this[_0x1c3b('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x1c3b('0x6')],'paused':this[_0x1c3b('0x12')],'waiting':this[_0x1c3b('0xb')]};var _0x1049cf=md5(JSON[_0x1c3b('0x15')](_0x46a56d));if(this['md5']!==_0x1049cf){this[_0x1c3b('0x16')]=_0x1049cf;io['to'](util[_0x1c3b('0x17')](_0x1c3b('0x18'),_0x46a56d[_0x1c3b('0x6')]))[_0x1c3b('0x19')](_0x1c3b('0x1a'),_0x46a56d);}};module[_0x1c3b('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 2bbddef..1e44e9b 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 _0xa64a=['name','Intervals','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa64a,0x1bc));var _0xaa64=function(_0x2880e5,_0x41636a){_0x2880e5=_0x2880e5-0x0;var _0x6213a4=_0xa64a[_0x2880e5];return _0x6213a4;};'use strict';function Interval(_0x188fa7){this['id']=_0x188fa7['id']||0x0;this[_0xaa64('0x0')]=_0x188fa7[_0xaa64('0x0')]||'';this[_0xaa64('0x1')]=_0x188fa7['Intervals']||{};}module[_0xaa64('0x2')]=Interval; \ No newline at end of file +var _0x7c12=['Intervals','name'];(function(_0x2939dc,_0x18b149){var _0x1fbc58=function(_0x45fa2c){while(--_0x45fa2c){_0x2939dc['push'](_0x2939dc['shift']());}};_0x1fbc58(++_0x18b149);}(_0x7c12,0x16f));var _0x27c1=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x7c12[_0x2f54b6];return _0x169f21;};'use strict';function Interval(_0x2f7d58){this['id']=_0x2f7d58['id']||0x0;this[_0x27c1('0x0')]=_0x2f7d58[_0x27c1('0x0')]||'';this[_0x27c1('0x1')]=_0x2f7d58[_0x27c1('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index f3d0deb..c3a0400 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 _0xf5ec=['mail:queue:%s','emit','mail_queue:save','exports','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','paused','length','mailPause','available','loggedIn','stringify'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xf5ec,0x109));var _0xcf5e=function(_0x218ea3,_0x36f59c){_0x218ea3=_0x218ea3-0x0;var _0x49265e=_0xf5ec[_0x218ea3];return _0x49265e;};'use strict';var _=require('lodash');var md5=require(_0xcf5e('0x0'));var util=require('util');var Redis=require(_0xcf5e('0x1'));var config=require(_0xcf5e('0x2'));config['redis']=_[_0xcf5e('0x3')](config['redis'],{'host':_0xcf5e('0x4'),'port':0x18eb});var io=require(_0xcf5e('0x5'))(new Redis(config[_0xcf5e('0x6')]));function MailQueue(_0x340209){this['id']=_0x340209['id']||0x0;this['name']=_0x340209[_0xcf5e('0x7')]||'';this[_0xcf5e('0x8')]=_0x340209[_0xcf5e('0x8')]||0xa;this[_0xcf5e('0x9')]=_0x340209[_0xcf5e('0x9')]||_0xcf5e('0xa');this[_0xcf5e('0xb')]=_0x340209[_0xcf5e('0xb')];this[_0xcf5e('0xc')]={};this[_0xcf5e('0xd')]=0x0;this[_0xcf5e('0x0')]='';this[_0xcf5e('0xe')]();this[_0xcf5e('0xf')]();}MailQueue['prototype'][_0xcf5e('0xe')]=function(){var _0x594930=this[_0xcf5e('0xc')][_0xcf5e('0x10')];this['mapAgentsId']=_[_0xcf5e('0x11')](this['Agents'],'id');this[_0xcf5e('0xc')][_0xcf5e('0x10')]=_0x594930;};MailQueue[_0xcf5e('0x12')][_0xcf5e('0xf')]=function(){this['loggedIn']=0x0;this[_0xcf5e('0x13')]=0x0;for(var _0x282816=0x0;_0x282816=0x0?this[_0xcf5e('0x16')]:0x0;var _0x5897e8={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcf5e('0x17')],'name':this[_0xcf5e('0x7')],'paused':this[_0xcf5e('0x13')],'waiting':this[_0xcf5e('0xd')]};var _0x348bfb=md5(JSON[_0xcf5e('0x18')](_0x5897e8));if(this[_0xcf5e('0x0')]!==_0x348bfb){this[_0xcf5e('0x0')]=_0x348bfb;io['to'](util['format'](_0xcf5e('0x19'),_0x5897e8[_0xcf5e('0x7')]))[_0xcf5e('0x1a')](_0xcf5e('0x1b'),_0x5897e8);}};module[_0xcf5e('0x1c')]=MailQueue; \ No newline at end of file +var _0x62d2=['mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','Agents','mailPause','available','stringify','mail:queue:%s','emit'];(function(_0x167c44,_0xe53cd5){var _0x22ab56=function(_0x38f89a){while(--_0x38f89a){_0x167c44['push'](_0x167c44['shift']());}};_0x22ab56(++_0xe53cd5);}(_0x62d2,0x1e8));var _0x262d=function(_0x5815af,_0x361f0b){_0x5815af=_0x5815af-0x0;var _0x3f14cb=_0x62d2[_0x5815af];return _0x3f14cb;};'use strict';var _=require(_0x262d('0x0'));var md5=require(_0x262d('0x1'));var util=require(_0x262d('0x2'));var Redis=require(_0x262d('0x3'));var config=require(_0x262d('0x4'));config['redis']=_[_0x262d('0x5')](config[_0x262d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x262d('0x6')]));function MailQueue(_0x227774){this['id']=_0x227774['id']||0x0;this['name']=_0x227774[_0x262d('0x7')]||'';this['timeout']=_0x227774[_0x262d('0x8')]||0xa;this['strategy']=_0x227774[_0x262d('0x9')]||_0x262d('0xa');this['Agents']=_0x227774['Agents'];this[_0x262d('0xb')]={};this[_0x262d('0xc')]=0x0;this[_0x262d('0x1')]='';this[_0x262d('0xd')]();this[_0x262d('0xe')]();}MailQueue['prototype']['updateRouting']=function(){var _0xb63ea1=this[_0x262d('0xb')][_0x262d('0xf')];this[_0x262d('0xb')]=_['map'](this['Agents'],'id');this[_0x262d('0xb')]['_rr']=_0xb63ea1;};MailQueue[_0x262d('0x10')]['updateRealtime']=function(){this[_0x262d('0x11')]=0x0;this[_0x262d('0x12')]=0x0;for(var _0x3cad0b=0x0;_0x3cad0b=0x0?this['available']:0x0;var _0x57b21a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x262d('0x11')],'name':this['name'],'paused':this[_0x262d('0x12')],'waiting':this[_0x262d('0xc')]};var _0x5c7f33=md5(JSON[_0x262d('0x16')](_0x57b21a));if(this[_0x262d('0x1')]!==_0x5c7f33){this['md5']=_0x5c7f33;io['to'](util['format'](_0x262d('0x17'),_0x57b21a['name']))[_0x262d('0x18')](_0x262d('0x19'),_0x57b21a);}};module[_0x262d('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a27df0d..ba00ed1 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 _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(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x1261,0x144));var _0x1126=function(_0x4a055e,_0x59b80a){_0x4a055e=_0x4a055e-0x0;var _0x328a29=_0x1261[_0x4a055e];return _0x328a29;};'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 +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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index a78f565..be172b1 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 _0xb332=['map','loggedIn','length','online','smsPause','paused','available','stringify','md5','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0x424057,_0x3e660c){var _0x150fba=function(_0x3aed67){while(--_0x3aed67){_0x424057['push'](_0x424057['shift']());}};_0x150fba(++_0x3e660c);}(_0xb332,0xd9));var _0x2b33=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0xb332[_0x4df6f9];return _0x4b1a73;};'use strict';var _=require(_0x2b33('0x0'));var md5=require('md5');var util=require(_0x2b33('0x1'));var Redis=require(_0x2b33('0x2'));var config=require('../../../config/environment');config[_0x2b33('0x3')]=_['defaults'](config[_0x2b33('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x2b33('0x4'))(new Redis(config['redis']));function SmsQueue(_0xf9b9c2){this['id']=_0xf9b9c2['id']||0x0;this[_0x2b33('0x5')]=_0xf9b9c2[_0x2b33('0x5')]||'';this[_0x2b33('0x6')]=_0xf9b9c2['timeout']||0xa;this['strategy']=_0xf9b9c2[_0x2b33('0x7')]||'beepall';this[_0x2b33('0x8')]=_0xf9b9c2[_0x2b33('0x8')];this[_0x2b33('0x9')]={};this[_0x2b33('0xa')]=0x0;this['md5']='';this[_0x2b33('0xb')]();this[_0x2b33('0xc')]();}SmsQueue[_0x2b33('0xd')][_0x2b33('0xb')]=function(){var _0x1989f3=this[_0x2b33('0x9')][_0x2b33('0xe')];this[_0x2b33('0x9')]=_[_0x2b33('0xf')](this[_0x2b33('0x8')],'id');this[_0x2b33('0x9')]['_rr']=_0x1989f3;};SmsQueue[_0x2b33('0xd')][_0x2b33('0xc')]=function(){this[_0x2b33('0x10')]=0x0;this['paused']=0x0;for(var _0x173c75=0x0;_0x173c75=0x0?this['available']:0x0;var _0x4041bd={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x2b33('0x5')],'paused':this[_0x2b33('0x14')],'waiting':this[_0x2b33('0xa')]};var _0x539c5f=md5(JSON[_0x2b33('0x16')](_0x4041bd));if(this['md5']!==_0x539c5f){this[_0x2b33('0x17')]=_0x539c5f;io['to'](util[_0x2b33('0x18')](_0x2b33('0x19'),_0x4041bd[_0x2b33('0x5')]))[_0x2b33('0x1a')](_0x2b33('0x1b'),_0x4041bd);}};module[_0x2b33('0x1c')]=SmsQueue; \ No newline at end of file +var _0x3e74=['paused','online','available','waiting','stringify','md5','format','emit','exports','lodash','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','loggedIn'];(function(_0x198247,_0x491c12){var _0x2b18bc=function(_0x4a43e2){while(--_0x4a43e2){_0x198247['push'](_0x198247['shift']());}};_0x2b18bc(++_0x491c12);}(_0x3e74,0x175));var _0x43e7=function(_0x5043a5,_0x3e79eb){_0x5043a5=_0x5043a5-0x0;var _0x18312a=_0x3e74[_0x5043a5];return _0x18312a;};'use strict';var _=require(_0x43e7('0x0'));var md5=require('md5');var util=require(_0x43e7('0x1'));var Redis=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));config['redis']=_['defaults'](config[_0x43e7('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x43e7('0x5'))(new Redis(config[_0x43e7('0x4')]));function SmsQueue(_0xe78cb7){this['id']=_0xe78cb7['id']||0x0;this[_0x43e7('0x6')]=_0xe78cb7[_0x43e7('0x6')]||'';this['timeout']=_0xe78cb7[_0x43e7('0x7')]||0xa;this[_0x43e7('0x8')]=_0xe78cb7[_0x43e7('0x8')]||_0x43e7('0x9');this[_0x43e7('0xa')]=_0xe78cb7['Agents'];this[_0x43e7('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x43e7('0xc')]();this[_0x43e7('0xd')]();}SmsQueue['prototype'][_0x43e7('0xc')]=function(){var _0x513707=this[_0x43e7('0xb')][_0x43e7('0xe')];this['mapAgentsId']=_[_0x43e7('0xf')](this[_0x43e7('0xa')],'id');this[_0x43e7('0xb')][_0x43e7('0xe')]=_0x513707;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x43e7('0x10')]=0x0;this[_0x43e7('0x11')]=0x0;for(var _0x44b0bd=0x0;_0x44b0bd=0x0?this[_0x43e7('0x13')]:0x0;var _0x1ca758={'id':this['id'],'available':this[_0x43e7('0x13')],'loggedIn':this[_0x43e7('0x10')],'name':this[_0x43e7('0x6')],'paused':this[_0x43e7('0x11')],'waiting':this[_0x43e7('0x14')]};var _0x1441ef=md5(JSON[_0x43e7('0x15')](_0x1ca758));if(this[_0x43e7('0x16')]!==_0x1441ef){this[_0x43e7('0x16')]=_0x1441ef;io['to'](util[_0x43e7('0x17')]('sms:queue:%s',_0x1ca758[_0x43e7('0x6')]))[_0x43e7('0x18')]('sms_queue:save',_0x1ca758);}};module[_0x43e7('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 3854e6d..581847c 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 _0x63f0=['loggedIn','paused','length','online','whatsappPause','available','waiting','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','_rr'];(function(_0xc206ed,_0x155f32){var _0x383541=function(_0x219466){while(--_0x219466){_0xc206ed['push'](_0xc206ed['shift']());}};_0x383541(++_0x155f32);}(_0x63f0,0x184));var _0x063f=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x63f0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x063f('0x0'));var md5=require(_0x063f('0x1'));var util=require('util');var Redis=require(_0x063f('0x2'));var config=require(_0x063f('0x3'));config[_0x063f('0x4')]=_[_0x063f('0x5')](config[_0x063f('0x4')],{'host':_0x063f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x063f('0x4')]));function WhatsappQueue(_0x51e556){this['id']=_0x51e556['id']||0x0;this['name']=_0x51e556[_0x063f('0x7')]||'';this[_0x063f('0x8')]=_0x51e556[_0x063f('0x8')]||0xa;this[_0x063f('0x9')]=_0x51e556[_0x063f('0x9')]||_0x063f('0xa');this[_0x063f('0xb')]=_0x51e556['Agents'];this[_0x063f('0xc')]={};this['waiting']=0x0;this[_0x063f('0x1')]='';this['updateRouting']();this[_0x063f('0xd')]();}WhatsappQueue[_0x063f('0xe')][_0x063f('0xf')]=function(){var _0x3fda5a=this[_0x063f('0xc')]['_rr'];this['mapAgentsId']=_[_0x063f('0x10')](this['Agents'],'id');this[_0x063f('0xc')][_0x063f('0x11')]=_0x3fda5a;};WhatsappQueue[_0x063f('0xe')][_0x063f('0xd')]=function(){this[_0x063f('0x12')]=0x0;this[_0x063f('0x13')]=0x0;for(var _0x5723a2=0x0;_0x5723a2=0x0?this['available']:0x0;var _0x149f17={'id':this['id'],'available':this[_0x063f('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x063f('0x7')],'paused':this[_0x063f('0x13')],'waiting':this[_0x063f('0x18')]};var _0x3ca169=md5(JSON[_0x063f('0x19')](_0x149f17));if(this[_0x063f('0x1')]!==_0x3ca169){this['md5']=_0x3ca169;io['to'](util['format'](_0x063f('0x1a'),_0x149f17[_0x063f('0x7')]))[_0x063f('0x1b')](_0x063f('0x1c'),_0x149f17);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xaeed=['format','whatsapp:queue:%s','emit','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','_rr','map','mapAgentsId','updateRealtime','loggedIn','paused','length','online','available','stringify'];(function(_0x20d761,_0xf72fd){var _0x529b98=function(_0x28689a){while(--_0x28689a){_0x20d761['push'](_0x20d761['shift']());}};_0x529b98(++_0xf72fd);}(_0xaeed,0x1f1));var _0xdaee=function(_0x150216,_0x1e9d2f){_0x150216=_0x150216-0x0;var _0x5a9031=_0xaeed[_0x150216];return _0x5a9031;};'use strict';var _=require(_0xdaee('0x0'));var md5=require(_0xdaee('0x1'));var util=require('util');var Redis=require(_0xdaee('0x2'));var config=require('../../../config/environment');config[_0xdaee('0x3')]=_[_0xdaee('0x4')](config[_0xdaee('0x3')],{'host':_0xdaee('0x5'),'port':0x18eb});var io=require(_0xdaee('0x6'))(new Redis(config[_0xdaee('0x3')]));function WhatsappQueue(_0x1a4ed9){this['id']=_0x1a4ed9['id']||0x0;this[_0xdaee('0x7')]=_0x1a4ed9[_0xdaee('0x7')]||'';this[_0xdaee('0x8')]=_0x1a4ed9[_0xdaee('0x8')]||0xa;this[_0xdaee('0x9')]=_0x1a4ed9[_0xdaee('0x9')]||_0xdaee('0xa');this['Agents']=_0x1a4ed9[_0xdaee('0xb')];this['mapAgentsId']={};this[_0xdaee('0xc')]=0x0;this[_0xdaee('0x1')]='';this[_0xdaee('0xd')]();this['updateRealtime']();}WhatsappQueue[_0xdaee('0xe')][_0xdaee('0xd')]=function(){var _0x2a29da=this['mapAgentsId'][_0xdaee('0xf')];this['mapAgentsId']=_[_0xdaee('0x10')](this['Agents'],'id');this[_0xdaee('0x11')][_0xdaee('0xf')]=_0x2a29da;};WhatsappQueue[_0xdaee('0xe')][_0xdaee('0x12')]=function(){this[_0xdaee('0x13')]=0x0;this[_0xdaee('0x14')]=0x0;for(var _0x47bf02=0x0;_0x47bf02=0x0?this['available']:0x0;var _0x2a0806={'id':this['id'],'available':this[_0xdaee('0x17')],'loggedIn':this[_0xdaee('0x13')],'name':this[_0xdaee('0x7')],'paused':this['paused'],'waiting':this[_0xdaee('0xc')]};var _0x474138=md5(JSON[_0xdaee('0x18')](_0x2a0806));if(this[_0xdaee('0x1')]!==_0x474138){this[_0xdaee('0x1')]=_0x474138;io['to'](util[_0xdaee('0x19')](_0xdaee('0x1a'),_0x2a0806[_0xdaee('0x7')]))[_0xdaee('0x1b')]('whatsapp_queue:save',_0x2a0806);}};module[_0xdaee('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 760f86c..1f4b7b6 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(_0x484522,_0x3313ea){var _0x34f984=function(_0x5a5b67){while(--_0x5a5b67){_0x484522['push'](_0x484522['shift']());}};_0x34f984(++_0x3313ea);}(_0xb10b,0x12a));var _0xbb10=function(_0x1194ad,_0x435140){_0x1194ad=_0x1194ad-0x0;var _0x5f374d=_0xb10b[_0x1194ad];return _0x5f374d;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 1ec8b13..6d8a220 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 _0x641a=['UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','Request'];(function(_0xf5645f,_0x6ce38a){var _0xf97ffe=function(_0x52a053){while(--_0x52a053){_0xf5645f['push'](_0xf5645f['shift']());}};_0xf97ffe(++_0x6ce38a);}(_0x641a,0x171));var _0xa641=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x641a[_0x3c504b];return _0x2e5354;};'use strict';var client=require('../client');exports['update']=function(_0x27b653,_0x3d9fa2){return client[_0xa641('0x0')](_0xa641('0x1'),{'body':_0x3d9fa2,'options':{'where':{'id':_0x27b653}},'log':'updateChatInteraction'});};exports[_0xa641('0x2')]=function(_0x20179e,_0x416b0c){return client[_0xa641('0x0')](_0xa641('0x3'),{'body':_0x416b0c,'options':{'where':{'id':_0x20179e}},'log':_0xa641('0x4')});}; \ No newline at end of file +var _0x5781=['update','UpdateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0xf2af61,_0x5c7551){var _0x4acae6=function(_0x1bfab2){while(--_0x1bfab2){_0xf2af61['push'](_0xf2af61['shift']());}};_0x4acae6(++_0x5c7551);}(_0x5781,0xdf));var _0x1578=function(_0x2d6780,_0x46cd62){_0x2d6780=_0x2d6780-0x0;var _0x3f1b8f=_0x5781[_0x2d6780];return _0x3f1b8f;};'use strict';var client=require(_0x1578('0x0'));exports[_0x1578('0x1')]=function(_0x2c9f24,_0xe11a95){return client['Request'](_0x1578('0x2'),{'body':_0xe11a95,'options':{'where':{'id':_0x2c9f24}},'log':'updateChatInteraction'});};exports[_0x1578('0x3')]=function(_0x15bc3b,_0xd815d8){return client[_0x1578('0x4')](_0x1578('0x5'),{'body':_0xd815d8,'options':{'where':{'id':_0x15bc3b}},'log':_0x1578('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4c29362..136f413 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 _0x8431=['create','Request','../client'];(function(_0xc4abe9,_0x196da8){var _0x159f80=function(_0x133706){while(--_0x133706){_0xc4abe9['push'](_0xc4abe9['shift']());}};_0x159f80(++_0x196da8);}(_0x8431,0x1f1));var _0x1843=function(_0x52350d,_0x522740){_0x52350d=_0x52350d-0x0;var _0x22cbec=_0x8431[_0x52350d];return _0x22cbec;};'use strict';var client=require(_0x1843('0x0'));exports[_0x1843('0x1')]=function(_0x36715e){return client[_0x1843('0x2')]('CreateChatMessage',{'body':_0x36715e,'log':'createChatMessage'});}; \ No newline at end of file +var _0x542d=['Request','CreateChatMessage','../client','create'];(function(_0x5d6b48,_0x2ab8d9){var _0x40b71c=function(_0x3ff761){while(--_0x3ff761){_0x5d6b48['push'](_0x5d6b48['shift']());}};_0x40b71c(++_0x2ab8d9);}(_0x542d,0x1d6));var _0xd542=function(_0x5e2250,_0x47097d){_0x5e2250=_0x5e2250-0x0;var _0x2e063a=_0x542d[_0x5e2250];return _0x2e063a;};'use strict';var client=require(_0xd542('0x0'));exports[_0xd542('0x1')]=function(_0x425a66){return client[_0xd542('0x2')](_0xd542('0x3'),{'body':_0x425a66,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f92a953..3c6d5de 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 _0x873a=['online','chatPause','../client','getChatQueues','Request','name','User','Agents'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x873a,0x1c2));var _0xa873=function(_0x5ed25e,_0x86de4f){_0x5ed25e=_0x5ed25e-0x0;var _0x27335e=_0x873a[_0x5ed25e];return _0x27335e;};'use strict';var client=require(_0xa873('0x0'));exports[_0xa873('0x1')]=function(){return function(){return client[_0xa873('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xa873('0x3'),'timeout','strategy'],'include':[{'model':_0xa873('0x4'),'as':_0xa873('0x5'),'attributes':['id','name',_0xa873('0x6'),_0xa873('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xf0ba=['GetChatQueue','name','strategy','User','chatPause','../client','getChatQueues','Request'];(function(_0x5967c0,_0x452377){var _0x2ad249=function(_0x7eb26){while(--_0x7eb26){_0x5967c0['push'](_0x5967c0['shift']());}};_0x2ad249(++_0x452377);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaf0b('0x0'));exports[_0xaf0b('0x1')]=function(){return function(){return client[_0xaf0b('0x2')](_0xaf0b('0x3'),{'options':{'raw':![],'attributes':['id',_0xaf0b('0x4'),'timeout',_0xaf0b('0x5')],'include':[{'model':_0xaf0b('0x6'),'as':'Agents','attributes':['id',_0xaf0b('0x4'),'online',_0xaf0b('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9af2814..3f9dfb7 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 _0x9aea=['DESC','../client','CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x575351,_0x1e6645){var _0x3ba898=function(_0x457a70){while(--_0x457a70){_0x575351['push'](_0x575351['shift']());}};_0x3ba898(++_0x1e6645);}(_0x9aea,0xdd));var _0xa9ae=function(_0x3691c0,_0x27907e){_0x3691c0=_0x3691c0-0x0;var _0x1378ac=_0x9aea[_0x3691c0];return _0x1378ac;};'use strict';var client=require(_0xa9ae('0x0'));exports['create']=function(_0x45ec16){return client['Request'](_0xa9ae('0x1'),{'body':_0x45ec16,'log':_0xa9ae('0x1')});};exports['update']=function(_0x414638,_0x115593){return client[_0xa9ae('0x2')](_0xa9ae('0x3'),{'body':_0x115593,'options':{'where':{'uniqueid':_0x414638},'order':[['id',_0xa9ae('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x049e=['Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client','create'];(function(_0x47598d,_0x1735ea){var _0x40acd0=function(_0xea85cf){while(--_0xea85cf){_0x47598d['push'](_0x47598d['shift']());}};_0x40acd0(++_0x1735ea);}(_0x049e,0x16a));var _0xe049=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x049e[_0x7d62cb];return _0x3a6266;};'use strict';var client=require(_0xe049('0x0'));exports[_0xe049('0x1')]=function(_0x5efb24){return client[_0xe049('0x2')]('CreateChatQueueReport',{'body':_0x5efb24,'log':_0xe049('0x3')});};exports[_0xe049('0x4')]=function(_0xb492b8,_0x4001a8){return client[_0xe049('0x2')]('UpdateChatQueueReport',{'body':_0x4001a8,'options':{'where':{'uniqueid':_0xb492b8},'order':[['id',_0xe049('0x5')]],'limit':0x1},'log':_0xe049('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 86fe36b..c307e7b 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x497e32,_0x56453c){var _0x237cb1=function(_0x106784){while(--_0x106784){_0x497e32['push'](_0x497e32['shift']());}};_0x237cb1(++_0x56453c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x7a54,0x106));var _0x47a5=function(_0x27b6ec,_0x213e7b){_0x27b6ec=_0x27b6ec-0x0;var _0x15bf41=_0x7a54[_0x27b6ec];return _0x15bf41;};'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 644aef2..1bf9894 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 _0x41ad=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x386984,_0x410210){var _0x214fc5=function(_0x5ec8cd){while(--_0x5ec8cd){_0x386984['push'](_0x386984['shift']());}};_0x214fc5(++_0x410210);}(_0x41ad,0x12a));var _0xd41a=function(_0x316c00,_0x3b85d2){_0x316c00=_0x316c00-0x0;var _0x17d2ef=_0x41ad[_0x316c00];return _0x17d2ef;};'use strict';var client=require(_0xd41a('0x0'));exports[_0xd41a('0x1')]=function(_0x2d421e){return client[_0xd41a('0x2')](_0xd41a('0x3'),{'body':_0x2d421e,'log':_0xd41a('0x4')});}; \ No newline at end of file +var _0xb975=['Request','createFaxMessage','../client','create'];(function(_0x385bac,_0x33f57d){var _0x253209=function(_0x427d12){while(--_0x427d12){_0x385bac['push'](_0x385bac['shift']());}};_0x253209(++_0x33f57d);}(_0xb975,0x162));var _0x5b97=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xb975[_0x307d86];return _0x361745;};'use strict';var client=require(_0x5b97('0x0'));exports[_0x5b97('0x1')]=function(_0x15bc4e){return client[_0x5b97('0x2')]('CreateFaxMessage',{'body':_0x15bc4e,'log':_0x5b97('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4125980..1b92e04 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 _0x56b3=['User','Agents','online','faxPause','getFaxQueues','Request','name','timeout','strategy'];(function(_0x37d782,_0x1f22a5){var _0x4e6939=function(_0x4528f8){while(--_0x4528f8){_0x37d782['push'](_0x37d782['shift']());}};_0x4e6939(++_0x1f22a5);}(_0x56b3,0x11b));var _0x356b=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x56b3[_0x1304c6];return _0x2e6654;};'use strict';var client=require('../client');exports[_0x356b('0x0')]=function(){return function(){return client[_0x356b('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x356b('0x2'),_0x356b('0x3'),_0x356b('0x4')],'include':[{'model':_0x356b('0x5'),'as':_0x356b('0x6'),'attributes':['id',_0x356b('0x2'),_0x356b('0x7'),_0x356b('0x8')]}]},'log':_0x356b('0x0')});};}; \ No newline at end of file +var _0x681f=['online','faxPause','getFaxQueues','Request','GetFaxQueue','timeout','Agents','name'];(function(_0x43379c,_0x271d36){var _0x495648=function(_0x3f4652){while(--_0x3f4652){_0x43379c['push'](_0x43379c['shift']());}};_0x495648(++_0x271d36);}(_0x681f,0xd2));var _0xf681=function(_0x5488ee,_0x19366c){_0x5488ee=_0x5488ee-0x0;var _0x3d21b9=_0x681f[_0x5488ee];return _0x3d21b9;};'use strict';var client=require('../client');exports[_0xf681('0x0')]=function(){return function(){return client[_0xf681('0x1')](_0xf681('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf681('0x3'),'strategy'],'include':[{'model':'User','as':_0xf681('0x4'),'attributes':['id',_0xf681('0x5'),_0xf681('0x6'),_0xf681('0x7')]}]},'log':_0xf681('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3463751..347ac7c 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 _0x7b0c=['DESC','UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0x388253,_0x58f4af){var _0x3eb6c8=function(_0x52574d){while(--_0x52574d){_0x388253['push'](_0x388253['shift']());}};_0x3eb6c8(++_0x58f4af);}(_0x7b0c,0xd4));var _0xc7b0=function(_0x291bf3,_0x34c0cd){_0x291bf3=_0x291bf3-0x0;var _0x526e69=_0x7b0c[_0x291bf3];return _0x526e69;};'use strict';var client=require(_0xc7b0('0x0'));exports['create']=function(_0x1bf2c7){return client[_0xc7b0('0x1')]('CreateFaxQueueReport',{'body':_0x1bf2c7,'log':_0xc7b0('0x2')});};exports[_0xc7b0('0x3')]=function(_0x3cd6fb,_0x116387){return client[_0xc7b0('0x1')]('UpdateFaxQueueReport',{'body':_0x116387,'options':{'where':{'uniqueid':_0x3cd6fb},'order':[['id',_0xc7b0('0x4')]],'limit':0x1},'log':_0xc7b0('0x5')});}; \ No newline at end of file +var _0xc67e=['CreateFaxQueueReport','../client','create','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc67e,0xd9));var _0xec67=function(_0x2faca4,_0x4467a0){_0x2faca4=_0x2faca4-0x0;var _0x4703ed=_0xc67e[_0x2faca4];return _0x4703ed;};'use strict';var client=require(_0xec67('0x0'));exports[_0xec67('0x1')]=function(_0x9c1080){return client[_0xec67('0x2')](_0xec67('0x3'),{'body':_0x9c1080,'log':_0xec67('0x3')});};exports['update']=function(_0x3c2c92,_0x121bff){return client['Request']('UpdateFaxQueueReport',{'body':_0x121bff,'options':{'where':{'uniqueid':_0x3c2c92},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 95e8aa8..15ad7d8 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 _0x7442=['name','Interval','interval','../client','getIntervals','Request','GetInterval'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x7442,0x1ae));var _0x2744=function(_0x494f4d,_0x2807fa){_0x494f4d=_0x494f4d-0x0;var _0x3e7dfc=_0x7442[_0x494f4d];return _0x3e7dfc;};'use strict';var client=require(_0x2744('0x0'));exports[_0x2744('0x1')]=function(){return function(){return client[_0x2744('0x2')](_0x2744('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2744('0x4')],'include':[{'model':_0x2744('0x5'),'as':'Intervals','attributes':['id',_0x2744('0x4'),_0x2744('0x6')]}]},'log':_0x2744('0x1')});};}; \ No newline at end of file +var _0x89e7=['getIntervals','Request','name','Interval','Intervals','../client'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x89e7,0xb3));var _0x789e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x89e7[_0x1928c9];return _0x51b5fb;};'use strict';var client=require(_0x789e('0x0'));exports[_0x789e('0x1')]=function(){return function(){return client[_0x789e('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x789e('0x3')],'include':[{'model':_0x789e('0x4'),'as':_0x789e('0x5'),'attributes':['id',_0x789e('0x3'),'interval']}]},'log':_0x789e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index dcdc766..ba50942 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 _0x1a85=['AddTagsToMailInteraction','Request','addTags'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1a85,0x178));var _0x51a8=function(_0x19a206,_0x1d7556){_0x19a206=_0x19a206-0x0;var _0x7514ac=_0x1a85[_0x19a206];return _0x7514ac;};'use strict';var client=require('../client');exports['update']=function(_0x305f18,_0x382cb8){return client[_0x51a8('0x0')]('UpdateMailInteraction',{'body':_0x382cb8,'options':{'where':{'id':_0x305f18}},'log':'updateMailInteraction'});};exports[_0x51a8('0x1')]=function(_0x1377a4,_0x99e371){return client['Request'](_0x51a8('0x2'),{'body':_0x99e371,'options':{'where':{'id':_0x1377a4}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xa30a=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x4064d0,_0x3edc47){var _0x4a84d6=function(_0x1ade3a){while(--_0x1ade3a){_0x4064d0['push'](_0x4064d0['shift']());}};_0x4a84d6(++_0x3edc47);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaa30('0x0'));exports[_0xaa30('0x1')]=function(_0x25634b,_0x4dfa7e){return client[_0xaa30('0x2')](_0xaa30('0x3'),{'body':_0x4dfa7e,'options':{'where':{'id':_0x25634b}},'log':_0xaa30('0x4')});};exports[_0xaa30('0x5')]=function(_0x2a9b06,_0x271425){return client[_0xaa30('0x2')]('AddTagsToMailInteraction',{'body':_0x271425,'options':{'where':{'id':_0x2a9b06}},'log':_0xaa30('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index cadb73c..f566af6 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 _0x240e=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x47d959,_0x410162){var _0x326de1=function(_0x3a5c85){while(--_0x3a5c85){_0x47d959['push'](_0x47d959['shift']());}};_0x326de1(++_0x410162);}(_0x240e,0x141));var _0xe240=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x240e[_0x47e7cb];return _0x2a8874;};'use strict';var client=require(_0xe240('0x0'));exports[_0xe240('0x1')]=function(_0xac5c28){return client[_0xe240('0x2')](_0xe240('0x3'),{'body':_0xac5c28,'log':_0xe240('0x4')});}; \ No newline at end of file +var _0x9e6f=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0xb1c914,_0x214919){var _0x29cabe=function(_0x54dacd){while(--_0x54dacd){_0xb1c914['push'](_0xb1c914['shift']());}};_0x29cabe(++_0x214919);}(_0x9e6f,0x135));var _0xf9e6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9e6f[_0x1969a7];return _0x3d665f;};'use strict';var client=require(_0xf9e6('0x0'));exports[_0xf9e6('0x1')]=function(_0x1ed259){return client[_0xf9e6('0x2')](_0xf9e6('0x3'),{'body':_0x1ed259,'log':_0xf9e6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 3d7cb6a..4ed6096 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 _0xcba7=['name','timeout','User','Agents','online','mailPause','getMailQueues','Request','GetMailQueue'];(function(_0x3ba8f2,_0x4d8bd0){var _0xc2cc84=function(_0xe939d6){while(--_0xe939d6){_0x3ba8f2['push'](_0x3ba8f2['shift']());}};_0xc2cc84(++_0x4d8bd0);}(_0xcba7,0x11d));var _0x7cba=function(_0xed6f46,_0x1c9006){_0xed6f46=_0xed6f46-0x0;var _0x5b267c=_0xcba7[_0xed6f46];return _0x5b267c;};'use strict';var client=require('../client');exports[_0x7cba('0x0')]=function(){return function(){return client[_0x7cba('0x1')](_0x7cba('0x2'),{'options':{'raw':![],'attributes':['id',_0x7cba('0x3'),_0x7cba('0x4'),'strategy'],'include':[{'model':_0x7cba('0x5'),'as':_0x7cba('0x6'),'attributes':['id',_0x7cba('0x3'),_0x7cba('0x7'),_0x7cba('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x35d4=['../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents','online'];(function(_0x2dc93b,_0xb41657){var _0x509f05=function(_0x342d0c){while(--_0x342d0c){_0x2dc93b['push'](_0x2dc93b['shift']());}};_0x509f05(++_0xb41657);}(_0x35d4,0x195));var _0x435d=function(_0x18175c,_0x39e841){_0x18175c=_0x18175c-0x0;var _0x49cb1f=_0x35d4[_0x18175c];return _0x49cb1f;};'use strict';var client=require(_0x435d('0x0'));exports[_0x435d('0x1')]=function(){return function(){return client[_0x435d('0x2')](_0x435d('0x3'),{'options':{'raw':![],'attributes':['id',_0x435d('0x4'),_0x435d('0x5'),_0x435d('0x6')],'include':[{'model':'User','as':_0x435d('0x7'),'attributes':['id','name',_0x435d('0x8'),'mailPause']}]},'log':_0x435d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f5e46cd..74c3c4b 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 _0x65a8=['Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','create'];(function(_0x35476f,_0x19720e){var _0x16889d=function(_0x37639c){while(--_0x37639c){_0x35476f['push'](_0x35476f['shift']());}};_0x16889d(++_0x19720e);}(_0x65a8,0xfa));var _0x865a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x65a8[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0x865a('0x0'));exports[_0x865a('0x1')]=function(_0x4adc1b){return client[_0x865a('0x2')](_0x865a('0x3'),{'body':_0x4adc1b,'log':_0x865a('0x3')});};exports['update']=function(_0x379cf5,_0x13ee5e){return client[_0x865a('0x2')](_0x865a('0x4'),{'body':_0x13ee5e,'options':{'where':{'uniqueid':_0x379cf5},'order':[['id',_0x865a('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x54ff=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport','update'];(function(_0x9d53ec,_0x121155){var _0x1addfb=function(_0x388cea){while(--_0x388cea){_0x9d53ec['push'](_0x9d53ec['shift']());}};_0x1addfb(++_0x121155);}(_0x54ff,0x1a0));var _0xf54f=function(_0x568a45,_0x2999ca){_0x568a45=_0x568a45-0x0;var _0x44b093=_0x54ff[_0x568a45];return _0x44b093;};'use strict';var client=require(_0xf54f('0x0'));exports['create']=function(_0x161ac3){return client[_0xf54f('0x1')](_0xf54f('0x2'),{'body':_0x161ac3,'log':'CreateMailQueueReport'});};exports[_0xf54f('0x3')]=function(_0x366f7f,_0x4d194b){return client[_0xf54f('0x1')](_0xf54f('0x4'),{'body':_0x4d194b,'options':{'where':{'uniqueid':_0x366f7f},'order':[['id',_0xf54f('0x5')]],'limit':0x1},'log':_0xf54f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 867348b..249d739 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 _0x77e9=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x35c2fc,_0xabea37){var _0x4727fd=function(_0x4eccfe){while(--_0x4eccfe){_0x35c2fc['push'](_0x35c2fc['shift']());}};_0x4727fd(++_0xabea37);}(_0x77e9,0x102));var _0x977e=function(_0x134a8e,_0x2b7f77){_0x134a8e=_0x134a8e-0x0;var _0x13eb84=_0x77e9[_0x134a8e];return _0x13eb84;};'use strict';var client=require(_0x977e('0x0'));exports[_0x977e('0x1')]=function(_0x5c2cc7,_0x1a720d){return client[_0x977e('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1a720d,'options':{'where':{'id':_0x5c2cc7}},'log':_0x977e('0x3')});};exports[_0x977e('0x4')]=function(_0x45bf7d,_0x78ff92){return client[_0x977e('0x2')](_0x977e('0x5'),{'body':_0x78ff92,'options':{'where':{'id':_0x45bf7d}},'log':_0x977e('0x6')});}; \ No newline at end of file +var _0x364e=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x2e8565,_0xaeec59){var _0x2c6e56=function(_0xaaa7ca){while(--_0xaaa7ca){_0x2e8565['push'](_0x2e8565['shift']());}};_0x2c6e56(++_0xaeec59);}(_0x364e,0xcd));var _0xe364=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x364e[_0xd0b415];return _0x2bdf2c;};'use strict';var client=require(_0xe364('0x0'));exports[_0xe364('0x1')]=function(_0x36794b,_0x531004){return client[_0xe364('0x2')](_0xe364('0x3'),{'body':_0x531004,'options':{'where':{'id':_0x36794b}},'log':'updateOpenchannelInteraction'});};exports[_0xe364('0x4')]=function(_0x4c9d8b,_0x271ad3){return client['Request'](_0xe364('0x5'),{'body':_0x271ad3,'options':{'where':{'id':_0x4c9d8b}},'log':_0xe364('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index f485294..f60acb9 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 _0xd961=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x3fd380,_0x5cda25){var _0x2b3c30=function(_0x5a4594){while(--_0x5a4594){_0x3fd380['push'](_0x3fd380['shift']());}};_0x2b3c30(++_0x5cda25);}(_0xd961,0x19a));var _0x1d96=function(_0x3873ab,_0x152776){_0x3873ab=_0x3873ab-0x0;var _0x42f6ed=_0xd961[_0x3873ab];return _0x42f6ed;};'use strict';var client=require(_0x1d96('0x0'));exports[_0x1d96('0x1')]=function(_0x20ca41){return client['Request'](_0x1d96('0x2'),{'body':_0x20ca41,'log':_0x1d96('0x3')});}; \ No newline at end of file +var _0xf37a=['../client','create'];(function(_0x1cb36e,_0x27194d){var _0x4ad32c=function(_0x5bdae8){while(--_0x5bdae8){_0x1cb36e['push'](_0x1cb36e['shift']());}};_0x4ad32c(++_0x27194d);}(_0xf37a,0x1dc));var _0xaf37=function(_0x108902,_0x7b318c){_0x108902=_0x108902-0x0;var _0x28271e=_0xf37a[_0x108902];return _0x28271e;};'use strict';var client=require(_0xaf37('0x0'));exports[_0xaf37('0x1')]=function(_0x58921d){return client['Request']('CreateOpenchannelMessage',{'body':_0x58921d,'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 92312b4..69c6b10 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 _0x15ea=['timeout','strategy','Agents','online','openchannelPause','../client','getOpenchannelQueues','name'];(function(_0x1283d4,_0x36b6f1){var _0x433643=function(_0x4c9fbe){while(--_0x4c9fbe){_0x1283d4['push'](_0x1283d4['shift']());}};_0x433643(++_0x36b6f1);}(_0x15ea,0x6d));var _0xa15e=function(_0x476778,_0x2ae12e){_0x476778=_0x476778-0x0;var _0x111535=_0x15ea[_0x476778];return _0x111535;};'use strict';var client=require(_0xa15e('0x0'));exports[_0xa15e('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xa15e('0x2'),_0xa15e('0x3'),_0xa15e('0x4')],'include':[{'model':'User','as':_0xa15e('0x5'),'attributes':['id','name',_0xa15e('0x6'),_0xa15e('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x6177=['online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','User','Agents'];(function(_0x29b997,_0x3f7266){var _0x18fe58=function(_0x11ba28){while(--_0x11ba28){_0x29b997['push'](_0x29b997['shift']());}};_0x18fe58(++_0x3f7266);}(_0x6177,0x192));var _0x7617=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6177[_0x187ee1];return _0x388160;};'use strict';var client=require('../client');exports[_0x7617('0x0')]=function(){return function(){return client[_0x7617('0x1')](_0x7617('0x2'),{'options':{'raw':![],'attributes':['id',_0x7617('0x3'),'timeout','strategy'],'include':[{'model':_0x7617('0x4'),'as':_0x7617('0x5'),'attributes':['id',_0x7617('0x3'),_0x7617('0x6'),_0x7617('0x7')]}]},'log':_0x7617('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 1a9bc02..bae93e5 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 _0x89b9=['UpdateOpenchannelQueueReport','DESC','create','Request'];(function(_0x49c4f9,_0x3545a0){var _0x292c26=function(_0x32a4c7){while(--_0x32a4c7){_0x49c4f9['push'](_0x49c4f9['shift']());}};_0x292c26(++_0x3545a0);}(_0x89b9,0x9e));var _0x989b=function(_0x51b5c4,_0x777291){_0x51b5c4=_0x51b5c4-0x0;var _0x499a45=_0x89b9[_0x51b5c4];return _0x499a45;};'use strict';var client=require('../client');exports[_0x989b('0x0')]=function(_0x4723fa){return client[_0x989b('0x1')]('CreateOpenchannelQueueReport',{'body':_0x4723fa,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x1210da,_0x5abeb7){return client[_0x989b('0x1')](_0x989b('0x2'),{'body':_0x5abeb7,'options':{'where':{'uniqueid':_0x1210da},'order':[['id',_0x989b('0x3')]],'limit':0x1},'log':_0x989b('0x2')});}; \ No newline at end of file +var _0xef6a=['UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport'];(function(_0x131013,_0x2b2b73){var _0x244ba0=function(_0x4d8158){while(--_0x4d8158){_0x131013['push'](_0x131013['shift']());}};_0x244ba0(++_0x2b2b73);}(_0xef6a,0x1e9));var _0xaef6=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xef6a[_0x68c979];return _0x4f0001;};'use strict';var client=require(_0xaef6('0x0'));exports[_0xaef6('0x1')]=function(_0x338995){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x338995,'log':_0xaef6('0x2')});};exports['update']=function(_0x3ecb34,_0xab465){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0xab465,'options':{'where':{'uniqueid':_0x3ecb34},'order':[['id','DESC']],'limit':0x1},'log':_0xaef6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 428be25..cea935c 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 _0x04de=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','../client'];(function(_0x271c34,_0x266fa2){var _0x3d60d1=function(_0x3e6781){while(--_0x3e6781){_0x271c34['push'](_0x271c34['shift']());}};_0x3d60d1(++_0x266fa2);}(_0x04de,0x107));var _0xe04d=function(_0x5b5cf6,_0x183b17){_0x5b5cf6=_0x5b5cf6-0x0;var _0x47f6a7=_0x04de[_0x5b5cf6];return _0x47f6a7;};'use strict';var client=require(_0xe04d('0x0'));exports[_0xe04d('0x1')]=function(_0x398778,_0x299552){return client[_0xe04d('0x2')](_0xe04d('0x3'),{'body':_0x299552,'options':{'where':{'id':_0x398778}},'log':_0xe04d('0x4')});};exports[_0xe04d('0x5')]=function(_0x2593a4,_0x70ead0){return client[_0xe04d('0x2')]('AddTagsToSmsInteraction',{'body':_0x70ead0,'options':{'where':{'id':_0x2593a4}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xe2cc=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x464f41,_0x37162c){var _0x110898=function(_0x503a1d){while(--_0x503a1d){_0x464f41['push'](_0x464f41['shift']());}};_0x110898(++_0x37162c);}(_0xe2cc,0x69));var _0xce2c=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xe2cc[_0x4154a6];return _0x3b2786;};'use strict';var client=require(_0xce2c('0x0'));exports[_0xce2c('0x1')]=function(_0x59c9fc,_0x4a4c87){return client[_0xce2c('0x2')](_0xce2c('0x3'),{'body':_0x4a4c87,'options':{'where':{'id':_0x59c9fc}},'log':_0xce2c('0x4')});};exports[_0xce2c('0x5')]=function(_0x25e41a,_0x1a7c4e){return client[_0xce2c('0x2')](_0xce2c('0x6'),{'body':_0x1a7c4e,'options':{'where':{'id':_0x25e41a}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index a009018..efb2882 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 _0xa586=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xa586,0x15e));var _0x6a58=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xa586[_0x55abd9];return _0x3e5669;};'use strict';var client=require(_0x6a58('0x0'));exports[_0x6a58('0x1')]=function(_0x5d75ca){return client[_0x6a58('0x2')](_0x6a58('0x3'),{'body':_0x5d75ca,'log':_0x6a58('0x4')});}; \ No newline at end of file +var _0x703d=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x543406,_0x2571fa){var _0x50c0d2=function(_0x28117b){while(--_0x28117b){_0x543406['push'](_0x543406['shift']());}};_0x50c0d2(++_0x2571fa);}(_0x703d,0x194));var _0xd703=function(_0x2e02db,_0x1b8bc5){_0x2e02db=_0x2e02db-0x0;var _0x29d103=_0x703d[_0x2e02db];return _0x29d103;};'use strict';var client=require('../client');exports[_0xd703('0x0')]=function(_0x10842c){return client[_0xd703('0x1')](_0xd703('0x2'),{'body':_0x10842c,'log':_0xd703('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 7f0dbd9..b4a9135 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 _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x383ee9,_0x3e04d0){var _0x131486=function(_0x3f28be){while(--_0x3f28be){_0x383ee9['push'](_0x383ee9['shift']());}};_0x131486(++_0x3e04d0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb7e7[_0x166d93];return _0xba708;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x21c24d,_0x1de17c){var _0x552f96=function(_0x3b5cc5){while(--_0x3b5cc5){_0x21c24d['push'](_0x21c24d['shift']());}};_0x552f96(++_0x1de17c);}(_0xe706,0xa3));var _0x6e70=function(_0x288788,_0x13b561){_0x288788=_0x288788-0x0;var _0x71cb99=_0xe706[_0x288788];return _0x71cb99;};'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 060f697..c71b1de 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(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0xedd9,0xfc));var _0x9edd=function(_0x5ac98e,_0xd19ec){_0x5ac98e=_0x5ac98e-0x0;var _0x59df45=_0xedd9[_0x5ac98e];return _0x59df45;};'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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x4c9494,_0x15d8fa){var _0x5371a6=function(_0x17248){while(--_0x17248){_0x4c9494['push'](_0x4c9494['shift']());}};_0x5371a6(++_0x15d8fa);}(_0x55ca,0x126));var _0xa55c=function(_0x2bc7bc,_0x827ea){_0x2bc7bc=_0x2bc7bc-0x0;var _0xbae862=_0x55ca[_0x2bc7bc];return _0xbae862;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2757a93..35499c0 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(_0x397bb2,_0x98192){var _0xab0416=function(_0x203b94){while(--_0x203b94){_0x397bb2['push'](_0x397bb2['shift']());}};_0xab0416(++_0x98192);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x1e67d0,_0x13b2c1){var _0x54f7de=function(_0x32fa45){while(--_0x32fa45){_0x1e67d0['push'](_0x1e67d0['shift']());}};_0x54f7de(++_0x13b2c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 83d4e21..43da6b8 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 _0x972c=['Request','AddTagsToWhatsappInteraction','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x221a6f,_0x1674c8){var _0x3db53d=function(_0x4706a6){while(--_0x4706a6){_0x221a6f['push'](_0x221a6f['shift']());}};_0x3db53d(++_0x1674c8);}(_0x972c,0xf2));var _0xc972=function(_0x5e87a3,_0x348a63){_0x5e87a3=_0x5e87a3-0x0;var _0x100362=_0x972c[_0x5e87a3];return _0x100362;};'use strict';var client=require('../client');exports['update']=function(_0x3429a4,_0x19626d){return client['Request'](_0xc972('0x0'),{'body':_0x19626d,'options':{'where':{'id':_0x3429a4}},'log':_0xc972('0x1')});};exports['addTags']=function(_0x511ad4,_0x140e13){return client[_0xc972('0x2')](_0xc972('0x3'),{'body':_0x140e13,'options':{'where':{'id':_0x511ad4}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x01d9=['addTags','Request','AddTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5a080f,_0x5ca651){var _0x3597ca=function(_0x4dbcd4){while(--_0x4dbcd4){_0x5a080f['push'](_0x5a080f['shift']());}};_0x3597ca(++_0x5ca651);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x901d('0x0'));exports[_0x901d('0x1')]=function(_0x30eba2,_0x209575){return client['Request'](_0x901d('0x2'),{'body':_0x209575,'options':{'where':{'id':_0x30eba2}},'log':_0x901d('0x3')});};exports[_0x901d('0x4')]=function(_0x8f7b4,_0x214f38){return client[_0x901d('0x5')](_0x901d('0x6'),{'body':_0x214f38,'options':{'where':{'id':_0x8f7b4}},'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 5449104..1195b81 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 _0x9d61=['create','Request','CreateWhatsappMessage','../client'];(function(_0x5c50fc,_0x116329){var _0x194de8=function(_0x3c1aa7){while(--_0x3c1aa7){_0x5c50fc['push'](_0x5c50fc['shift']());}};_0x194de8(++_0x116329);}(_0x9d61,0x13f));var _0x19d6=function(_0x41d31a,_0x5742cb){_0x41d31a=_0x41d31a-0x0;var _0x460c28=_0x9d61[_0x41d31a];return _0x460c28;};'use strict';var client=require(_0x19d6('0x0'));exports[_0x19d6('0x1')]=function(_0x52de75){return client[_0x19d6('0x2')](_0x19d6('0x3'),{'body':_0x52de75,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xd358=['create','Request'];(function(_0x16c56b,_0x42f208){var _0xa2b5ae=function(_0x373e3a){while(--_0x373e3a){_0x16c56b['push'](_0x16c56b['shift']());}};_0xa2b5ae(++_0x42f208);}(_0xd358,0x12c));var _0x8d35=function(_0xa053b3,_0x34db1d){_0xa053b3=_0xa053b3-0x0;var _0x2c321d=_0xd358[_0xa053b3];return _0x2c321d;};'use strict';var client=require('../client');exports[_0x8d35('0x0')]=function(_0x175656){return client[_0x8d35('0x1')]('CreateWhatsappMessage',{'body':_0x175656,'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 2c8ac69..3b6be79 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 _0x51d4=['Request','name','timeout','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x51d4,0xbb));var _0x451d=function(_0x41795d,_0x2c5800){_0x41795d=_0x41795d-0x0;var _0x158e33=_0x51d4[_0x41795d];return _0x158e33;};'use strict';var client=require(_0x451d('0x0'));exports[_0x451d('0x1')]=function(){return function(){return client[_0x451d('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x451d('0x3'),_0x451d('0x4'),'strategy'],'include':[{'model':_0x451d('0x5'),'as':_0x451d('0x6'),'attributes':['id','name',_0x451d('0x7'),_0x451d('0x8')]}]},'log':_0x451d('0x1')});};}; \ No newline at end of file +var _0x1b44=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online'];(function(_0x1a6f7f,_0x45eaf1){var _0x4a09c2=function(_0x5a808c){while(--_0x5a808c){_0x1a6f7f['push'](_0x1a6f7f['shift']());}};_0x4a09c2(++_0x45eaf1);}(_0x1b44,0x16c));var _0x41b4=function(_0x5980b4,_0x324826){_0x5980b4=_0x5980b4-0x0;var _0x46f597=_0x1b44[_0x5980b4];return _0x46f597;};'use strict';var client=require(_0x41b4('0x0'));exports[_0x41b4('0x1')]=function(){return function(){return client[_0x41b4('0x2')](_0x41b4('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x41b4('0x4'),_0x41b4('0x5')],'include':[{'model':_0x41b4('0x6'),'as':_0x41b4('0x7'),'attributes':['id',_0x41b4('0x8'),_0x41b4('0x9'),_0x41b4('0xa')]}]},'log':_0x41b4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 3740b82..1784695 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 _0xdc1f=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0xc7ccb5,_0x566d5b){var _0xbbe824=function(_0x3db7e1){while(--_0x3db7e1){_0xc7ccb5['push'](_0xc7ccb5['shift']());}};_0xbbe824(++_0x566d5b);}(_0xdc1f,0x12c));var _0xfdc1=function(_0x38681b,_0x2ab817){_0x38681b=_0x38681b-0x0;var _0x2c35f6=_0xdc1f[_0x38681b];return _0x2c35f6;};'use strict';var client=require(_0xfdc1('0x0'));exports[_0xfdc1('0x1')]=function(_0x546ee){return client[_0xfdc1('0x2')](_0xfdc1('0x3'),{'body':_0x546ee,'log':_0xfdc1('0x3')});};exports[_0xfdc1('0x4')]=function(_0x15e9d5,_0x1c7e71){return client[_0xfdc1('0x2')](_0xfdc1('0x5'),{'body':_0x1c7e71,'options':{'where':{'uniqueid':_0x15e9d5},'order':[['id',_0xfdc1('0x6')]],'limit':0x1},'log':_0xfdc1('0x5')});}; \ No newline at end of file +var _0x4881=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client'];(function(_0x3b4f36,_0x3c2547){var _0x1b3386=function(_0x170ade){while(--_0x170ade){_0x3b4f36['push'](_0x3b4f36['shift']());}};_0x1b3386(++_0x3c2547);}(_0x4881,0xd1));var _0x1488=function(_0x51a6e4,_0x1dbcee){_0x51a6e4=_0x51a6e4-0x0;var _0xbed624=_0x4881[_0x51a6e4];return _0xbed624;};'use strict';var client=require(_0x1488('0x0'));exports['create']=function(_0x4f10e1){return client[_0x1488('0x1')](_0x1488('0x2'),{'body':_0x4f10e1,'log':'CreateWhatsappQueueReport'});};exports[_0x1488('0x3')]=function(_0x1034c1,_0x239d0){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x239d0,'options':{'where':{'uniqueid':_0x1034c1},'order':[['id','DESC']],'limit':0x1},'log':_0x1488('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 5cdfe3d..16b3e4d 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 _0x01ff=['timeout','createQueue','atimeout','channel','format','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','join','stop','find','agents'];(function(_0x367b37,_0xecb6d9){var _0x56776b=function(_0x87b0d6){while(--_0x87b0d6){_0x367b37['push'](_0x367b37['shift']());}};_0x56776b(++_0xecb6d9);}(_0x01ff,0x167));var _0xf01f=function(_0x42ccd8,_0x204285){_0x42ccd8=_0x42ccd8-0x0;var _0x54334a=_0x01ff[_0x42ccd8];return _0x54334a;};'use strict';var schema=require(_0xf01f('0x0'));var _=require(_0xf01f('0x1'));var util=require(_0xf01f('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xf01f('0x3'))(_0xf01f('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xf01f('0x5'),'required':!![],'message':_0xf01f('0x6')},'timeout':{'type':_0xf01f('0x7'),'message':_0xf01f('0x8')}});function writeLog(_0xfa4041,_0x57a4ed,_0x4125e3){return logger[_0xf01f('0x9')](util['format'](_0xf01f('0xa'),_0xfa4041,_0x57a4ed[_0xf01f('0xb')],_0x4125e3));}function handleFindAgent(_0x1a8498){return function(_0x514ac7){return _0x514ac7[_0xf01f('0xb')][_0xf01f('0xc')]()===_0x1a8498[_0xf01f('0xc')]();};}exports[_0xf01f('0xd')]=function(_0x52c3f4,_0x511693,_0x28d559,_0xdf6981){return function(_0x19b1ec){try{var _0x30f74f={'name':_0x511693[0x0],'timeout':_0x511693[0x1]};var _0x114834=queue[_0xf01f('0x0')](_0x30f74f,{'typecast':!![]});if(_0x114834[_0xf01f('0xe')]){logger[_0xf01f('0xf')](_0xf01f('0x10'),_0x52c3f4,_['map'](_0x114834,'message')[_0xf01f('0x11')](',\x20'));_0x19b1ec[_0xf01f('0x12')]();}else{var _0x747494=_[_0xf01f('0x13')](_0x28d559[_0xf01f('0x14')],handleFindAgent(_0x30f74f[_0xf01f('0xb')]));if(_0x747494){var _0x473241=(_0x30f74f[_0xf01f('0x15')]||0xa)*0x3e8;var _0x2f8293,_0x35eb3b;var _0x30772d=seqqueue[_0xf01f('0x16')](_0x473241);_0x30772d['id']=_0x52c3f4;_0x30772d[_0xf01f('0x17')]=_0x473241;_0x30772d[_0xf01f('0x18')]=_0xdf6981[_0xf01f('0x18')];writeLog(_0x52c3f4,_0x747494,util[_0xf01f('0x19')]('START:%s',_0x473241));_0x28d559[_0xf01f('0x1a')][_0x52c3f4]['on'](_0xf01f('0x1b'),function(){logger[_0xf01f('0x9')](_0xf01f('0x1c'),_0x52c3f4);clearTimeout(_0x35eb3b);_0x35eb3b=undefined;_0x30772d[_0xf01f('0x1d')]();if(_0x28d559[_0xf01f('0x1a')][_0x52c3f4]){delete _0x28d559[_0xf01f('0x1a')][_0x52c3f4];}_0x19b1ec['stop']();});_0x28d559[_0xf01f('0x1a')][_0x52c3f4]['on'](_0xf01f('0x1e'),function(){if(_0x28d559[_0xf01f('0x1a')][_0x52c3f4]){delete _0x28d559[_0xf01f('0x1a')][_0x52c3f4];}});_0x35eb3b=setTimeout(function(){logger['info'](_0xf01f('0x1f'),_0x52c3f4);clearTimeout(_0x35eb3b);_0x30772d[_0xf01f('0x1d')]();_0x19b1ec[_0xf01f('0x20')]();},_0x473241);strategy[_0xf01f('0x21')](_0x30772d,_0x747494,_0x28d559,_0xdf6981);}else{logger[_0xf01f('0xf')](_0xf01f('0x22'),_0x52c3f4,_0x30f74f[_0xf01f('0xb')]);_0x19b1ec[_0xf01f('0x12')]();}}}catch(_0x5664e0){console[_0xf01f('0x23')](_0x5664e0);logger[_0xf01f('0xf')](_0xf01f('0x24'),_0x52c3f4,_0x5664e0[_0xf01f('0x25')]);_0x19b1ec[_0xf01f('0x12')]();}};}; \ No newline at end of file +var _0x4264=['number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','agents','createQueue','atimeout','channel','format','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','close','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'];(function(_0x4996eb,_0x56041c){var _0x4ca9b9=function(_0x238802){while(--_0x238802){_0x4996eb['push'](_0x4996eb['shift']());}};_0x4ca9b9(++_0x56041c);}(_0x4264,0x6c));var _0x4426=function(_0x91045d,_0x1d9d27){_0x91045d=_0x91045d-0x0;var _0x18da9e=_0x4264[_0x91045d];return _0x18da9e;};'use strict';var schema=require(_0x4426('0x0'));var _=require(_0x4426('0x1'));var util=require(_0x4426('0x2'));var seqqueue=require(_0x4426('0x3'));var logger=require(_0x4426('0x4'))(_0x4426('0x5'));var strategy=require(_0x4426('0x6'));var queue=schema({'name':{'type':_0x4426('0x7'),'required':!![],'message':_0x4426('0x8')},'timeout':{'type':_0x4426('0x9'),'message':_0x4426('0xa')}});function writeLog(_0x1a8925,_0x11dd79,_0x23b44e){return logger['info'](util['format'](_0x4426('0xb'),_0x1a8925,_0x11dd79['name'],_0x23b44e));}function handleFindAgent(_0x884b10){return function(_0x4766d9){return _0x4766d9[_0x4426('0xc')][_0x4426('0xd')]()===_0x884b10[_0x4426('0xd')]();};}exports[_0x4426('0xe')]=function(_0x3250b1,_0x152981,_0x416c35,_0x303051){return function(_0x4dfb9a){try{var _0x33f9ac={'name':_0x152981[0x0],'timeout':_0x152981[0x1]};var _0xeefab6=queue[_0x4426('0x0')](_0x33f9ac,{'typecast':!![]});if(_0xeefab6[_0x4426('0xf')]){logger['error'](_0x4426('0x10'),_0x3250b1,_[_0x4426('0x11')](_0xeefab6,_0x4426('0x12'))[_0x4426('0x13')](',\x20'));_0x4dfb9a[_0x4426('0x14')]();}else{var _0xe820c3=_['find'](_0x416c35[_0x4426('0x15')],handleFindAgent(_0x33f9ac[_0x4426('0xc')]));if(_0xe820c3){var _0x4ff221=(_0x33f9ac['timeout']||0xa)*0x3e8;var _0xca5753,_0x464728;var _0xbada4f=seqqueue[_0x4426('0x16')](_0x4ff221);_0xbada4f['id']=_0x3250b1;_0xbada4f[_0x4426('0x17')]=_0x4ff221;_0xbada4f['channel']=_0x303051[_0x4426('0x18')];writeLog(_0x3250b1,_0xe820c3,util[_0x4426('0x19')]('START:%s',_0x4ff221));_0x416c35[_0x4426('0x1a')][_0x3250b1]['on'](_0x4426('0x1b'),function(){logger[_0x4426('0x1c')](_0x4426('0x1d'),_0x3250b1);clearTimeout(_0x464728);_0x464728=undefined;_0xbada4f['close']();if(_0x416c35[_0x4426('0x1a')][_0x3250b1]){delete _0x416c35[_0x4426('0x1a')][_0x3250b1];}_0x4dfb9a[_0x4426('0x14')]();});_0x416c35[_0x4426('0x1a')][_0x3250b1]['on'](_0x4426('0x1e'),function(){if(_0x416c35[_0x4426('0x1a')][_0x3250b1]){delete _0x416c35[_0x4426('0x1a')][_0x3250b1];}});_0x464728=setTimeout(function(){logger[_0x4426('0x1c')]('[%s][AGENT]\x20ROUTING\x20END',_0x3250b1);clearTimeout(_0x464728);_0xbada4f[_0x4426('0x1f')]();_0x4dfb9a[_0x4426('0x20')]();},_0x4ff221);strategy[_0x4426('0x21')](_0xbada4f,_0xe820c3,_0x416c35,_0x303051);}else{logger[_0x4426('0x22')](_0x4426('0x23'),_0x3250b1,_0x33f9ac[_0x4426('0xc')]);_0x4dfb9a[_0x4426('0x14')]();}}}catch(_0x5dab89){console[_0x4426('0x24')](_0x5dab89);logger['error'](_0x4426('0x25'),_0x3250b1,_0x5dab89[_0x4426('0x26')]);_0x4dfb9a[_0x4426('0x14')]();}};}; \ 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 1f9ee64..fa8e4c7 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 _0xc7ec=['amazonlex','providerName','dialogState','Failed','error','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','interaction','phone','chat','ChatWebsiteId','upperFirst','account','created','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','postText'];(function(_0x426257,_0x4d0f32){var _0x2c4ace=function(_0x3cd93d){while(--_0x3cd93d){_0x426257['push'](_0x426257['shift']());}};_0x2c4ace(++_0x4d0f32);}(_0xc7ec,0x1a3));var _0xcc7e=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0xc7ec[_0x1809c5];return _0x5254a4;};'use strict';var _=require(_0xcc7e('0x0'));var moment=require(_0xcc7e('0x1'));var AWS=require(_0xcc7e('0x2'));var utils=require(_0xcc7e('0x3'));var logger=require(_0xcc7e('0x4'))(_0xcc7e('0x5'));var rpc={'chatMessage':require(_0xcc7e('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcc7e('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xcc7e('0x8'))};exports[_0xcc7e('0x9')]=function(_0x5dba35,_0xe100e6){return function(_0x12e4b6){try{if(!_[_0xcc7e('0xa')](this['interaction'][_0xcc7e('0xb')])){logger[_0xcc7e('0xc')](_0xcc7e('0xd'),_0x5dba35,_0xcc7e('0xe'));return _0x12e4b6[_0xcc7e('0xf')]();}var _0x593d7b={'ContactId':this[_0xcc7e('0x10')]['id'],'sentAt':moment()[_0xcc7e('0x11')](_0xcc7e('0x12')),'direction':_0xcc7e('0x13')};if(this[_0xcc7e('0x14')]===_0xcc7e('0x15')||this[_0xcc7e('0x14')]==='whatsapp'){_0x593d7b['phone']=this[_0xcc7e('0x16')][_0xcc7e('0x17')];}var _0x33bc98=this[_0xcc7e('0x14')];if(_0x33bc98===_0xcc7e('0x18')){_0x593d7b[_0xcc7e('0x19')]=this['account']['id'];}else{_0x593d7b[_[_0xcc7e('0x1a')](_0x33bc98)+'AccountId']=this[_0xcc7e('0x1b')]['id'];}_0x593d7b[_[_0xcc7e('0x1a')](_0x33bc98)+'InteractionId']=this[_0xcc7e('0x16')]['id'];if(this[_0xcc7e('0x16')][_0xcc7e('0x1c')]){var _0x4d4d3e=_0xe100e6[0x4];if(!_['isEmpty'](_0x4d4d3e)){_0x593d7b[_0xcc7e('0x1d')]=utils[_0xcc7e('0x1e')](_0x4d4d3e,this);return rpc[_0x33bc98+_0xcc7e('0x1f')][_0xcc7e('0x20')](_0x593d7b)[_0xcc7e('0x21')](function(_0x16c254){logger[_0xcc7e('0xc')](_0xcc7e('0xd'),_0x5dba35,_0x593d7b['body']);})[_0xcc7e('0x22')](function(_0x459496){logger['error'](_0xcc7e('0xd'),_0x5dba35,JSON[_0xcc7e('0x23')](_0x459496));})[_0xcc7e('0x24')](function(){logger[_0xcc7e('0xc')](_0xcc7e('0x25'),_0x5dba35);_0x12e4b6[_0xcc7e('0x26')]();});}else{logger[_0xcc7e('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5dba35);_0x12e4b6[_0xcc7e('0x26')]();}}else{var _0x47ffb2=this;var _0x1f92f8=new AWS['LexRuntime']({'accessKeyId':_0xe100e6[0x0],'secretAccessKey':_0xe100e6[0x1],'region':_0xe100e6[0x2]});var _0x47d78d={'botAlias':'$LATEST','botName':_0xe100e6[0x3],'inputText':this[_0xcc7e('0x27')][_0xcc7e('0x1d')],'userId':this['channel']+':'+this[_0xcc7e('0x16')]['id']['toString']()};_0x1f92f8[_0xcc7e('0x28')](_0x47d78d,function(_0x801b89,_0x43a2e8){if(_0x801b89){logger['error'](_0xcc7e('0xd'),_0x5dba35,_0x801b89[_0xcc7e('0x27')]);_0x12e4b6[_0xcc7e('0xf')]();}else if(_0x43a2e8&&_0x43a2e8[_0xcc7e('0x27')]){_0x47ffb2[_0xcc7e('0x1d')][_0xcc7e('0x29')]=_0x43a2e8;_0x593d7b[_0xcc7e('0x1d')]=_0x43a2e8[_0xcc7e('0x27')];_0x593d7b[_0xcc7e('0x2a')]=_0xcc7e('0x29');_0x593d7b['providerResponse']=JSON[_0xcc7e('0x23')](_0x43a2e8);return rpc[_0x33bc98+_0xcc7e('0x1f')][_0xcc7e('0x20')](_0x593d7b)['then'](function(_0xb0cb50){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5dba35,_0x593d7b[_0xcc7e('0x1d')]);if(_0x43a2e8[_0xcc7e('0x2b')]==_0xcc7e('0x2c')){_0x12e4b6[_0xcc7e('0xf')]();}else{_0x12e4b6[_0xcc7e('0x26')]();}})[_0xcc7e('0x22')](function(_0x3993a8){logger[_0xcc7e('0x2d')]('[%s][AMAZONLEX]\x20%s',_0x5dba35,JSON[_0xcc7e('0x23')](_0x3993a8));_0x12e4b6[_0xcc7e('0xf')]();});}else{_0x12e4b6[_0xcc7e('0xf')]();}});}}catch(_0x4eab69){logger[_0xcc7e('0x2d')]('[%s][AMAZONLEX]\x20%s',_0x5dba35,JSON['stringify'](_0x4eab69));_0x12e4b6[_0xcc7e('0x26')]();}};}; \ No newline at end of file +var _0x779e=['account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','then','info','catch','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','[%s][AMAZONLEX]\x20%s','amazonlex','providerResponse','stringify','dialogState','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId'];(function(_0x498580,_0x784ee2){var _0x4ab3ee=function(_0x1be591){while(--_0x1be591){_0x498580['push'](_0x498580['shift']());}};_0x4ab3ee(++_0x784ee2);}(_0x779e,0x170));var _0xe779=function(_0x18a16d,_0x199976){_0x18a16d=_0x18a16d-0x0;var _0x21cf0c=_0x779e[_0x18a16d];return _0x21cf0c;};'use strict';var _=require(_0xe779('0x0'));var moment=require('moment');var AWS=require(_0xe779('0x1'));var utils=require(_0xe779('0x2'));var logger=require(_0xe779('0x3'))(_0xe779('0x4'));var rpc={'chatMessage':require(_0xe779('0x5')),'openchannelMessage':require(_0xe779('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xe779('0x7')]=function(_0x402f4b,_0x2beec0){return function(_0x4679e8){try{if(!_['isNil'](this[_0xe779('0x8')][_0xe779('0x9')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x402f4b,_0xe779('0xa'));return _0x4679e8[_0xe779('0xb')]();}var _0x5e15eb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xe779('0xc')),'direction':_0xe779('0xd')};if(this[_0xe779('0xe')]===_0xe779('0xf')||this[_0xe779('0xe')]===_0xe779('0x10')){_0x5e15eb[_0xe779('0x11')]=this[_0xe779('0x8')][_0xe779('0x11')];}var _0x191586=this[_0xe779('0xe')];if(_0x191586==='chat'){_0x5e15eb[_0xe779('0x12')]=this[_0xe779('0x13')]['id'];}else{_0x5e15eb[_[_0xe779('0x14')](_0x191586)+_0xe779('0x15')]=this[_0xe779('0x13')]['id'];}_0x5e15eb[_[_0xe779('0x14')](_0x191586)+_0xe779('0x16')]=this[_0xe779('0x8')]['id'];if(this['interaction'][_0xe779('0x17')]){var _0x18f780=_0x2beec0[0x4];if(!_[_0xe779('0x18')](_0x18f780)){_0x5e15eb[_0xe779('0x19')]=utils['getMustacheRender'](_0x18f780,this);return rpc[_0x191586+_0xe779('0x1a')][_0xe779('0x1b')](_0x5e15eb)[_0xe779('0x1c')](function(_0x23ba48){logger[_0xe779('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x402f4b,_0x5e15eb[_0xe779('0x19')]);})[_0xe779('0x1e')](function(_0xf23bb3){logger[_0xe779('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x402f4b,JSON['stringify'](_0xf23bb3));})[_0xe779('0x20')](function(){logger[_0xe779('0x1d')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x402f4b);_0x4679e8[_0xe779('0x21')]();});}else{logger['info'](_0xe779('0x22'),_0x402f4b);_0x4679e8[_0xe779('0x21')]();}}else{var _0x3a8d0b=this;var _0x3fc2a0=new AWS[(_0xe779('0x23'))]({'accessKeyId':_0x2beec0[0x0],'secretAccessKey':_0x2beec0[0x1],'region':_0x2beec0[0x2]});var _0x5e7abb={'botAlias':_0xe779('0x24'),'botName':_0x2beec0[0x3],'inputText':this[_0xe779('0x25')][_0xe779('0x19')],'userId':this[_0xe779('0xe')]+':'+this['interaction']['id']['toString']()};_0x3fc2a0['postText'](_0x5e7abb,function(_0x3daf35,_0x109d38){if(_0x3daf35){logger['error'](_0xe779('0x26'),_0x402f4b,_0x3daf35[_0xe779('0x25')]);_0x4679e8[_0xe779('0xb')]();}else if(_0x109d38&&_0x109d38[_0xe779('0x25')]){_0x3a8d0b[_0xe779('0x19')][_0xe779('0x27')]=_0x109d38;_0x5e15eb['body']=_0x109d38[_0xe779('0x25')];_0x5e15eb['providerName']=_0xe779('0x27');_0x5e15eb[_0xe779('0x28')]=JSON[_0xe779('0x29')](_0x109d38);return rpc[_0x191586+_0xe779('0x1a')][_0xe779('0x1b')](_0x5e15eb)[_0xe779('0x1c')](function(_0x109b12){logger[_0xe779('0x1d')](_0xe779('0x26'),_0x402f4b,_0x5e15eb[_0xe779('0x19')]);if(_0x109d38[_0xe779('0x2a')]=='Failed'){_0x4679e8[_0xe779('0xb')]();}else{_0x4679e8[_0xe779('0x21')]();}})['catch'](function(_0x231a4f){logger['error'](_0xe779('0x26'),_0x402f4b,JSON[_0xe779('0x29')](_0x231a4f));_0x4679e8[_0xe779('0xb')]();});}else{_0x4679e8['next']();}});}}catch(_0x58a2af){logger[_0xe779('0x1f')](_0xe779('0x26'),_0x402f4b,JSON[_0xe779('0x29')](_0x58a2af));_0x4679e8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index e425144..c847d34 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 _0xe008=['stop','lodash','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:\x20','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html','replace','','headers','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xe008,0xfd));var _0x8e00=function(_0x41ef1d,_0x43844c){_0x41ef1d=_0x41ef1d-0x0;var _0x53c577=_0xe008[_0x41ef1d];return _0x53c577;};'use strict';var _=require(_0x8e00('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x8e00('0x1'));var rpc={'chatMessage':require(_0x8e00('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8e00('0x3')),'smsMessage':require(_0x8e00('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8e00('0x5')),'chatInteraction':require(_0x8e00('0x6')),'openchannelInteraction':require(_0x8e00('0x7')),'mailInteraction':require(_0x8e00('0x8')),'smsInteraction':require(_0x8e00('0x9')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x8e00('0xa'))};var mailRpc=require('../../mailRpc');exports[_0x8e00('0xb')]=function(_0x496a97,_0x1659e6,_0x41b68a,_0x26b25a){return function(_0x1c7681){try{var _0x3cfdf6=this['channel'];if(_0x3cfdf6===_0x8e00('0xc')&&_0x26b25a[_0x8e00('0xd')][_0x8e00('0xe')]){logger['info'](_0x8e00('0xf'),_0x496a97,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1c7681['next']();}if(_0x1659e6[0x0]==='1'&&(_[_0x8e00('0x10')](this[_0x8e00('0x11')]['created'])||!this[_0x8e00('0x11')][_0x8e00('0x12')])){logger[_0x8e00('0x13')]('[%s][AUTOREPLY]\x20%s',_0x496a97,_0x8e00('0x14'));return _0x1c7681[_0x8e00('0x15')]();}if(_0x1659e6[0x0]==='2'&&this[_0x8e00('0x11')][_0x8e00('0x16')]){logger[_0x8e00('0x13')](_0x8e00('0x17'),_0x496a97,_0x8e00('0x18'));return _0x1c7681[_0x8e00('0x15')]();}var _0x2875a0={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8e00('0x19')](_0x8e00('0x1a')),'direction':_0x8e00('0x1b')};if(this['channel']==='mail'){_0x2875a0[_0x8e00('0xd')]=utils['getMustacheRender'](_0x1659e6[0x2],this);}else{_0x2875a0['body']=utils['getMustacheRender'](_0x1659e6[0x1],this);}if(this[_0x8e00('0x1c')]){_0x2875a0['to']=this['message'][_0x8e00('0x1d')]||'';if(this['channel']===_0x8e00('0xc')&&_0x1659e6[0x1]==='1'){_0x2875a0['cc']=this[_0x8e00('0x1c')]['cc']||'';}_0x2875a0[_0x8e00('0x1d')]=this[_0x8e00('0x1c')]['to']||'';_0x2875a0['phone']=this[_0x8e00('0x1c')][_0x8e00('0x1e')]||'';_0x2875a0[_0x8e00('0x1f')]=!![];if(this['message'][_0x8e00('0x20')]){_0x2875a0[_0x8e00('0x20')]='';_0x2875a0[_0x8e00('0x20')]+=_[_0x8e00('0x21')](this[_0x8e00('0x1c')][_0x8e00('0x20')],'Re:')?'':_0x8e00('0x22');_0x2875a0['subject']+=this[_0x8e00('0x1c')][_0x8e00('0x20')];}}if(this[_0x8e00('0x23')]===_0x8e00('0x24')){_0x2875a0[_0x8e00('0x25')]=this[_0x8e00('0x26')]['id'];}else{_0x2875a0[_[_0x8e00('0x27')](this['channel'])+'AccountId']=this[_0x8e00('0x26')]['id'];}_0x2875a0[_[_0x8e00('0x27')](this[_0x8e00('0x23')])+_0x8e00('0x28')]=this[_0x8e00('0x11')]['id'];var _0x14a031=this['interaction'];if(rpc[this[_0x8e00('0x23')]+_0x8e00('0x29')]){if(this['channel']===_0x8e00('0xc')){_0x2875a0[_0x8e00('0x2a')]=this[_0x8e00('0x1c')][_0x8e00('0x2b')];_0x2875a0[_0x8e00('0x2c')]=''+_[_0x8e00('0x2d')](_0x2875a0[_0x8e00('0xd')],'','replace','';_0x5d5a2e[_0xcfe0('0x31')]={'Auto-Submitted':_0xcfe0('0x32'),'X-Auto-Response-Suppress':_0xcfe0('0x33'),'Precedence':'auto_reply'};return mailRpc[_0xcfe0('0x34')](this[_0xcfe0('0x26')][_0xcfe0('0x35')],_0x5d5a2e)[_0xcfe0('0x36')](function(_0x1f5829){logger['info'](_0xcfe0('0x37'),_0x2ed311);_0x5d5a2e[_0xcfe0('0x2b')]=_0x1f5829[_0xcfe0('0x1d')][_0xcfe0('0x2b')];return rpc[_0x536f38+_0xcfe0('0x2a')]['create'](_0x5d5a2e);})['then'](function(_0x5e0fa9){logger['info'](_0xcfe0('0x38'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x5e0fa9));})[_0xcfe0('0x3a')](function(_0x49fefa){logger['error'](_0xcfe0('0x3b'),_0x2ed311,JSON['stringify'](_0x49fefa));})['finally'](function(){Promise['resolve']()['then'](function(){if(_0x10c20a[0x0]!=='2'||_0x27eba9['autoreplyExecuted'])return;return rpc[_0x536f38+_0xcfe0('0x3c')][_0xcfe0('0x3d')](_0x27eba9['id'],{'autoreplyExecuted':!![]})[_0xcfe0('0x36')](function(_0x8aa457){logger['info'](_0xcfe0('0x17'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x8aa457));})[_0xcfe0('0x3a')](function(_0x4e0b97){logger[_0xcfe0('0x3e')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ed311,JSON[_0xcfe0('0x39')](_0x4e0b97));});})[_0xcfe0('0x36')](function(){_0x80f187['next']();});});}else{return rpc[this[_0xcfe0('0xe')]+_0xcfe0('0x2a')][_0xcfe0('0x3f')](_0x5d5a2e)[_0xcfe0('0x36')](function(){logger[_0xcfe0('0x11')](_0xcfe0('0x38'),_0x2ed311,_0x5d5a2e[_0xcfe0('0xf')]);})[_0xcfe0('0x3a')](function(_0x2c4b3e){logger['error'](_0xcfe0('0x38'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x2c4b3e));})['finally'](function(){Promise['resolve']()[_0xcfe0('0x36')](function(){if(_0x10c20a[0x0]!=='2'||_0x27eba9[_0xcfe0('0x40')])return;return rpc[_0x536f38+_0xcfe0('0x3c')][_0xcfe0('0x3d')](_0x27eba9['id'],{'autoreplyExecuted':!![]})[_0xcfe0('0x36')](function(_0x21590a){logger[_0xcfe0('0x11')](_0xcfe0('0x17'),_0x2ed311,JSON['stringify'](_0x21590a));})['catch'](function(_0x4fab09){logger[_0xcfe0('0x3e')](_0xcfe0('0x41'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x4fab09));});})[_0xcfe0('0x36')](function(){_0x80f187[_0xcfe0('0x12')]();});});}}}catch(_0x262b7b){logger['error'](_0xcfe0('0x38'),_0x2ed311,JSON['stringify'](_0x262b7b));_0x80f187[_0xcfe0('0x42')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 90e2955..9bb6a4e 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4365=['../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x4365,0x176));var _0x5436=function(_0x444b29,_0x127582){_0x444b29=_0x444b29-0x0;var _0x428314=_0x4365[_0x444b29];return _0x428314;};'use strict';var moment=require(_0x5436('0x0'));var logger=require(_0x5436('0x1'))('routing');var rpc={'chatInteraction':require(_0x5436('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x5436('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x5436('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x5436('0x5')]=function(_0x4d65c1,_0x2bbde0,_0x56ed19,_0x19b008){return function(_0x1cd2cc){try{logger[_0x5436('0x6')](_0x5436('0x7'),_0x4d65c1,_0x2bbde0[0x0]);var _0x31a028={'closed':0x1,'closedAt':moment()[_0x5436('0x8')](_0x5436('0x9')),'closeReason':_0x5436('0xa'),'disposition':_0x2bbde0[0x0]};if(rpc[_0x19b008[_0x5436('0xb')]+_0x5436('0xc')]){rpc[_0x19b008[_0x5436('0xb')]+_0x5436('0xc')][_0x5436('0xd')](_0x19b008['interaction']['id'],_0x31a028)[_0x5436('0xe')](function(_0x13fb47){logger[_0x5436('0x6')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4d65c1,_0x19b008['interaction']['id']);})[_0x5436('0xf')](function(_0x186c8b){logger[_0x5436('0x10')]('[%s][CLOSE]\x20%s',_0x4d65c1,JSON[_0x5436('0x11')](_0x186c8b));})[_0x5436('0x12')](function(){_0x1cd2cc[_0x5436('0x13')]();});}}catch(_0x4a1023){logger[_0x5436('0x10')](_0x5436('0x14'),_0x4d65c1,JSON[_0x5436('0x11')](_0x4a1023));_0x1cd2cc[_0x5436('0x13')]();}};}; \ No newline at end of file +var _0xd591=['routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger'];(function(_0x1ae861,_0x3d11ad){var _0x121d0d=function(_0x9f27ac){while(--_0x9f27ac){_0x1ae861['push'](_0x1ae861['shift']());}};_0x121d0d(++_0x3d11ad);}(_0xd591,0x176));var _0x1d59=function(_0x344346,_0x685e03){_0x344346=_0x344346-0x0;var _0x3defd2=_0xd591[_0x344346];return _0x3defd2;};'use strict';var moment=require('moment');var logger=require(_0x1d59('0x0'))(_0x1d59('0x1'));var rpc={'chatInteraction':require(_0x1d59('0x2')),'openchannelInteraction':require(_0x1d59('0x3')),'smsInteraction':require(_0x1d59('0x4')),'mailInteraction':require(_0x1d59('0x5')),'faxInteraction':require(_0x1d59('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x1d59('0x7')]=function(_0x1b5a44,_0x2d386c,_0xe0b596,_0x327e40){return function(_0x126ca1){try{logger[_0x1d59('0x8')](_0x1d59('0x9'),_0x1b5a44,_0x2d386c[0x0]);var _0x16fafc={'closed':0x1,'closedAt':moment()[_0x1d59('0xa')](_0x1d59('0xb')),'closeReason':_0x1d59('0xc'),'disposition':_0x2d386c[0x0]};if(rpc[_0x327e40['channel']+_0x1d59('0xd')]){rpc[_0x327e40[_0x1d59('0xe')]+'Interaction'][_0x1d59('0xf')](_0x327e40['interaction']['id'],_0x16fafc)[_0x1d59('0x10')](function(_0x3a9fbb){logger[_0x1d59('0x8')](_0x1d59('0x11'),_0x1b5a44,_0x327e40[_0x1d59('0x12')]['id']);})[_0x1d59('0x13')](function(_0x30a173){logger[_0x1d59('0x14')](_0x1d59('0x15'),_0x1b5a44,JSON[_0x1d59('0x16')](_0x30a173));})[_0x1d59('0x17')](function(){_0x126ca1[_0x1d59('0x18')]();});}}catch(_0x2806ec){logger[_0x1d59('0x14')](_0x1d59('0x15'),_0x1b5a44,JSON[_0x1d59('0x16')](_0x2806ec));_0x126ca1[_0x1d59('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 51ddc6e..15b956d 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe944=['InteractionId','interaction','created','isEmpty','body','getMustacheRender','then','info','error','stringify','stop','textRequest','message','dialogflow','result','speech','providerResponse','create','metadata','catch','lodash','md5','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account'];(function(_0x33e241,_0x18a695){var _0x2cc5be=function(_0x49d0ca){while(--_0x49d0ca){_0x33e241['push'](_0x33e241['shift']());}};_0x2cc5be(++_0x18a695);}(_0xe944,0x174));var _0x4e94=function(_0x37f90e,_0x2a6318){_0x37f90e=_0x37f90e-0x0;var _0x2f7cd6=_0xe944[_0x37f90e];return _0x2f7cd6;};'use strict';var _=require(_0x4e94('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x4e94('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x4e94('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4e94('0x3')),'smsMessage':require(_0x4e94('0x4')),'faxMessage':require(_0x4e94('0x5')),'whatsappMessage':require(_0x4e94('0x6'))};exports['consequence']=function(_0x44a2cd,_0x28a1fd){return function(_0x175b42){try{if(!_[_0x4e94('0x7')](this['interaction'][_0x4e94('0x8')])){logger['info'](_0x4e94('0x9'),_0x44a2cd,_0x4e94('0xa'));return _0x175b42[_0x4e94('0xb')]();}var _0x37dfdc={'ContactId':this['contact']['id'],'sentAt':moment()[_0x4e94('0xc')](_0x4e94('0xd')),'direction':_0x4e94('0xe')};if(this[_0x4e94('0xf')]===_0x4e94('0x10')||this[_0x4e94('0xf')]===_0x4e94('0x11')){_0x37dfdc['phone']=this['interaction'][_0x4e94('0x12')];}var _0x1b4eac=this[_0x4e94('0xf')];if(_0x1b4eac===_0x4e94('0x13')){_0x37dfdc[_0x4e94('0x14')]=this['account']['id'];}else{_0x37dfdc[_[_0x4e94('0x15')](_0x1b4eac)+_0x4e94('0x16')]=this[_0x4e94('0x17')]['id'];}_0x37dfdc[_[_0x4e94('0x15')](_0x1b4eac)+_0x4e94('0x18')]=this[_0x4e94('0x19')]['id'];if(this[_0x4e94('0x19')][_0x4e94('0x1a')]){var _0xab0a8a=_0x28a1fd[0x2];if(!_[_0x4e94('0x1b')](_0xab0a8a)){_0x37dfdc[_0x4e94('0x1c')]=utils[_0x4e94('0x1d')](_0xab0a8a,this);return rpc[_0x1b4eac+'Message']['create'](_0x37dfdc)[_0x4e94('0x1e')](function(_0x950aba){logger[_0x4e94('0x1f')](_0x4e94('0x9'),_0x44a2cd,_0x37dfdc[_0x4e94('0x1c')]);})['catch'](function(_0x2af7e1){logger[_0x4e94('0x20')](_0x4e94('0x9'),_0x44a2cd,JSON[_0x4e94('0x21')](_0x2af7e1));})['finally'](function(){logger[_0x4e94('0x1f')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x44a2cd);_0x175b42[_0x4e94('0x22')]();});}else{logger[_0x4e94('0x1f')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x44a2cd);_0x175b42['stop']();}}else{var _0xf03522=this;var _0xe3ad9c=apiai(_0x28a1fd[0x0],{'language':_0x28a1fd[0x1]||'en'});return _0xe3ad9c[_0x4e94('0x23')](this[_0x4e94('0x24')][_0x4e94('0x1c')],{'sessionId':md5(this[_0x4e94('0x19')]['id'])})[_0x4e94('0x1e')](function(_0x1ea50b){_0xf03522['body'][_0x4e94('0x25')]=_0x1ea50b;_0x37dfdc[_0x4e94('0x1c')]=_0x1ea50b[_0x4e94('0x26')]['fulfillment'][_0x4e94('0x27')];_0x37dfdc['providerName']='dialogflow';_0x37dfdc[_0x4e94('0x28')]=JSON[_0x4e94('0x21')](_0x1ea50b);return rpc[_0x1b4eac+'Message'][_0x4e94('0x29')](_0x37dfdc)[_0x4e94('0x1e')](function(_0x2a6188){logger['info'](_0x4e94('0x9'),_0x44a2cd,_0x37dfdc[_0x4e94('0x1c')]);if(_0x1ea50b[_0x4e94('0x26')][_0x4e94('0x2a')]['endConversation']){_0x175b42[_0x4e94('0xb')]();}else{_0x175b42[_0x4e94('0x22')]();}})[_0x4e94('0x2b')](function(_0xa7d015){logger[_0x4e94('0x20')](_0x4e94('0x9'),_0x44a2cd,JSON[_0x4e94('0x21')](_0xa7d015));_0x175b42[_0x4e94('0xb')]();});})[_0x4e94('0x2b')](function(_0x5efd77){logger[_0x4e94('0x20')](_0x4e94('0x9'),_0x44a2cd,_0x5efd77[_0x4e94('0x24')]);_0x175b42[_0x4e94('0xb')]();});}}catch(_0x46766d){logger[_0x4e94('0x20')](_0x4e94('0x9'),_0x44a2cd,JSON['stringify'](_0x46766d));_0x175b42[_0x4e94('0x22')]();}};}; \ No newline at end of file +var _0xc1fc=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','Message','create','body','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','then','dialogflow','fulfillment','speech','providerName','providerResponse','result','metadata','message','moment','apiai-promise','./utils'];(function(_0x2c5918,_0x4af7a0){var _0x347aff=function(_0x1424e5){while(--_0x1424e5){_0x2c5918['push'](_0x2c5918['shift']());}};_0x347aff(++_0x4af7a0);}(_0xc1fc,0x93));var _0xcc1f=function(_0x4b5776,_0x186db0){_0x4b5776=_0x4b5776-0x0;var _0xd64b67=_0xc1fc[_0x4b5776];return _0xd64b67;};'use strict';var _=require('lodash');var moment=require(_0xcc1f('0x0'));var apiai=require(_0xcc1f('0x1'));var md5=require('md5');var utils=require(_0xcc1f('0x2'));var logger=require(_0xcc1f('0x3'))(_0xcc1f('0x4'));var rpc={'chatMessage':require(_0xcc1f('0x5')),'openchannelMessage':require(_0xcc1f('0x6')),'mailMessage':require(_0xcc1f('0x7')),'smsMessage':require(_0xcc1f('0x8')),'faxMessage':require(_0xcc1f('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x376348,_0x4516e3){return function(_0x431ca8){try{if(!_[_0xcc1f('0xa')](this[_0xcc1f('0xb')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x376348,_0xcc1f('0xc'));return _0x431ca8[_0xcc1f('0xd')]();}var _0x256283={'ContactId':this[_0xcc1f('0xe')]['id'],'sentAt':moment()[_0xcc1f('0xf')](_0xcc1f('0x10')),'direction':_0xcc1f('0x11')};if(this[_0xcc1f('0x12')]===_0xcc1f('0x13')||this['channel']===_0xcc1f('0x14')){_0x256283[_0xcc1f('0x15')]=this[_0xcc1f('0xb')][_0xcc1f('0x15')];}var _0x9842de=this[_0xcc1f('0x12')];if(_0x9842de===_0xcc1f('0x16')){_0x256283['ChatWebsiteId']=this[_0xcc1f('0x17')]['id'];}else{_0x256283[_[_0xcc1f('0x18')](_0x9842de)+_0xcc1f('0x19')]=this[_0xcc1f('0x17')]['id'];}_0x256283[_[_0xcc1f('0x18')](_0x9842de)+_0xcc1f('0x1a')]=this[_0xcc1f('0xb')]['id'];if(this[_0xcc1f('0xb')][_0xcc1f('0x1b')]){var _0x7bad52=_0x4516e3[0x2];if(!_['isEmpty'](_0x7bad52)){_0x256283['body']=utils[_0xcc1f('0x1c')](_0x7bad52,this);return rpc[_0x9842de+_0xcc1f('0x1d')][_0xcc1f('0x1e')](_0x256283)['then'](function(_0x314d9d){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x376348,_0x256283[_0xcc1f('0x1f')]);})[_0xcc1f('0x20')](function(_0x5ed11c){logger[_0xcc1f('0x21')](_0xcc1f('0x22'),_0x376348,JSON[_0xcc1f('0x23')](_0x5ed11c));})[_0xcc1f('0x24')](function(){logger[_0xcc1f('0x25')](_0xcc1f('0x26'),_0x376348);_0x431ca8['stop']();});}else{logger[_0xcc1f('0x25')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x376348);_0x431ca8[_0xcc1f('0x27')]();}}else{var _0x310c2e=this;var _0x1a00d4=apiai(_0x4516e3[0x0],{'language':_0x4516e3[0x1]||'en'});return _0x1a00d4[_0xcc1f('0x28')](this['message'][_0xcc1f('0x1f')],{'sessionId':md5(this[_0xcc1f('0xb')]['id'])})[_0xcc1f('0x29')](function(_0x257e7f){_0x310c2e[_0xcc1f('0x1f')][_0xcc1f('0x2a')]=_0x257e7f;_0x256283[_0xcc1f('0x1f')]=_0x257e7f['result'][_0xcc1f('0x2b')][_0xcc1f('0x2c')];_0x256283[_0xcc1f('0x2d')]=_0xcc1f('0x2a');_0x256283[_0xcc1f('0x2e')]=JSON[_0xcc1f('0x23')](_0x257e7f);return rpc[_0x9842de+_0xcc1f('0x1d')][_0xcc1f('0x1e')](_0x256283)['then'](function(_0x4461d5){logger[_0xcc1f('0x25')](_0xcc1f('0x22'),_0x376348,_0x256283[_0xcc1f('0x1f')]);if(_0x257e7f[_0xcc1f('0x2f')][_0xcc1f('0x30')]['endConversation']){_0x431ca8[_0xcc1f('0xd')]();}else{_0x431ca8[_0xcc1f('0x27')]();}})['catch'](function(_0x3bd35c){logger['error'](_0xcc1f('0x22'),_0x376348,JSON[_0xcc1f('0x23')](_0x3bd35c));_0x431ca8[_0xcc1f('0xd')]();});})[_0xcc1f('0x20')](function(_0x54211b){logger['error'](_0xcc1f('0x22'),_0x376348,_0x54211b[_0xcc1f('0x31')]);_0x431ca8[_0xcc1f('0xd')]();});}}catch(_0x53220d){logger[_0xcc1f('0x21')](_0xcc1f('0x22'),_0x376348,JSON[_0xcc1f('0x23')](_0x53220d));_0x431ca8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 44f8087..76f3086 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e89=['stringify','consequence','isNil','interaction','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','getMustacheRender','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','md5','moment','bluebird','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s'];(function(_0x23e367,_0x521c59){var _0x1404a5=function(_0x1c9a65){while(--_0x1c9a65){_0x23e367['push'](_0x23e367['shift']());}};_0x1404a5(++_0x521c59);}(_0x7e89,0x181));var _0x97e8=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x7e89[_0x4f431d];return _0x4f31e1;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x97e8('0x0'));var moment=require(_0x97e8('0x1'));var Promise=require(_0x97e8('0x2'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x97e8('0x3'));var rpc={'chatMessage':require(_0x97e8('0x4')),'openchannelMessage':require(_0x97e8('0x5')),'mailMessage':require(_0x97e8('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x97e8('0x7')),'whatsappMessage':require(_0x97e8('0x8'))};function createMessage(_0x543a6e,_0x543a45,_0x1f4cca,_0x23f864){return new Promise(function(_0x2a9326,_0x2b8aff){var _0x3c9e8a=_[_0x97e8('0x9')](_0x1f4cca);_0x3c9e8a[_0x97e8('0xa')]=_0x23f864;return rpc[_0x543a45+'Message'][_0x97e8('0xb')](_0x3c9e8a)[_0x97e8('0xc')](function(){logger[_0x97e8('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x543a6e,_0x3c9e8a[_0x97e8('0xa')]);_0x2a9326();})[_0x97e8('0xe')](function(_0x37fd36){logger[_0x97e8('0xf')](_0x97e8('0x10'),_0x543a6e,JSON[_0x97e8('0x11')](_0x37fd36));_0x2b8aff(_0x37fd36);});});}exports[_0x97e8('0x12')]=function(_0x23b2fc,_0x4c23fd){return function(_0x2a9120){try{if(!_[_0x97e8('0x13')](this[_0x97e8('0x14')][_0x97e8('0x15')])){logger[_0x97e8('0xd')](_0x97e8('0x10'),_0x23b2fc,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2a9120[_0x97e8('0x16')]();}var _0x2ffdf1={'ContactId':this[_0x97e8('0x17')]['id'],'sentAt':moment()['format'](_0x97e8('0x18')),'direction':_0x97e8('0x19')};if(this['channel']==='sms'||this[_0x97e8('0x1a')]===_0x97e8('0x1b')){_0x2ffdf1[_0x97e8('0x1c')]=this[_0x97e8('0x14')][_0x97e8('0x1c')];}var _0x2413a7=this[_0x97e8('0x1a')];if(_0x2413a7===_0x97e8('0x1d')){_0x2ffdf1[_0x97e8('0x1e')]=this[_0x97e8('0x1f')]['id'];}else{_0x2ffdf1[_['upperFirst'](_0x2413a7)+'AccountId']=this[_0x97e8('0x1f')]['id'];}_0x2ffdf1[_[_0x97e8('0x20')](_0x2413a7)+'InteractionId']=this[_0x97e8('0x14')]['id'];if(this[_0x97e8('0x14')][_0x97e8('0x21')]){var _0x12e7ff=_0x4c23fd[0x4];if(!_[_0x97e8('0x22')](_0x12e7ff)){_0x2ffdf1[_0x97e8('0xa')]=utils[_0x97e8('0x23')](_0x12e7ff,this);return rpc[_0x2413a7+_0x97e8('0x24')][_0x97e8('0xb')](_0x2ffdf1)[_0x97e8('0xc')](function(_0x49f652){logger[_0x97e8('0xd')](_0x97e8('0x10'),_0x23b2fc,_0x2ffdf1[_0x97e8('0xa')]);})['catch'](function(_0x122fdc){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x23b2fc,JSON[_0x97e8('0x11')](_0x122fdc));})[_0x97e8('0x25')](function(){logger[_0x97e8('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x23b2fc);_0x2a9120['stop']();});}else{logger[_0x97e8('0xd')](_0x97e8('0x26'),_0x23b2fc);_0x2a9120['stop']();}}else{var _0x18b14f=this;var _0xb08816=_0x4c23fd[0x2][_0x97e8('0x27')](/\\n/g,'\x0a');var _0x24c4fc={'credentials':{'private_key':_0xb08816,'client_email':_0x4c23fd[0x1]}};var _0x543462=new dialogflow['SessionsClient'](_0x24c4fc);var _0x46da6a=_0x543462[_0x97e8('0x28')](_0x4c23fd[0x0],md5(_0x18b14f[_0x97e8('0x14')]['id']));var _0x3dc578={'session':_0x46da6a,'queryInput':{'text':{'text':_0x18b14f[_0x97e8('0x29')]['body'],'languageCode':_0x4c23fd[0x3]||'en'}}};return _0x543462[_0x97e8('0x2a')](_0x3dc578)['then'](function(_0x3a54e1){if(_0x3a54e1&&_0x3a54e1[_0x97e8('0x2b')]){_0x18b14f['body'][_0x97e8('0x2c')]=_0x3a54e1;var _0x5d941c=_0x3a54e1[0x0];var _0x404904=_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x2e')]&&_0x5d941c[_0x97e8('0x2d')]['diagnosticInfo'][_0x97e8('0x2f')]?_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x2e')][_0x97e8('0x2f')][_0x97e8('0x30')][_0x97e8('0x31')]:![];_0x18b14f[_0x97e8('0xa')][_0x97e8('0x32')]=_0x5d941c['queryResult']['action'];_0x18b14f['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x33')];_0x18b14f['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x5d941c['queryResult']['diagnosticInfo']&&_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x2e')][_0x97e8('0x2f')]?_0x5d941c[_0x97e8('0x2d')]['diagnosticInfo']['fields']['end_conversation'][_0x97e8('0x31')]:![];_0x18b14f[_0x97e8('0xa')][_0x97e8('0x34')]=_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x35')][_0x97e8('0x36')];_0x18b14f[_0x97e8('0xa')][_0x97e8('0x37')]=_0x5d941c['queryResult'][_0x97e8('0x35')][_0x97e8('0x38')];_0x18b14f[_0x97e8('0xa')][_0x97e8('0x39')]=_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x35')][_0x97e8('0x3a')];_0x18b14f['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x5d941c[_0x97e8('0x2d')]['languageCode'];_0x18b14f['body'][_0x97e8('0x3b')]=_0x5d941c['queryResult']['queryText'];_0x18b14f[_0x97e8('0xa')][_0x97e8('0x3c')]=_0x5d941c[_0x97e8('0x2d')][_0x97e8('0x3d')];_0x2ffdf1[_0x97e8('0x3e')]=_0x97e8('0x2c');_0x2ffdf1[_0x97e8('0x3f')]=JSON[_0x97e8('0x11')](_0x3a54e1);var _0x4596a8=[];for(var _0x519d46=0x0;_0x519d46<_0x3a54e1[_0x97e8('0x2b')];_0x519d46++){var _0xb4e97d=_0x3a54e1[_0x519d46];if(_0xb4e97d&&_0xb4e97d[_0x97e8('0x2d')]&&_0xb4e97d[_0x97e8('0x2d')][_0x97e8('0x40')]){_0x4596a8[_0x97e8('0x41')](createMessage(_0x23b2fc,_0x2413a7,_0x2ffdf1,_0xb4e97d[_0x97e8('0x2d')][_0x97e8('0x40')]));}}return Promise[_0x97e8('0x42')](_0x4596a8)[_0x97e8('0xc')](function(){if(_0x404904){_0x2a9120[_0x97e8('0x16')]();}else{_0x2a9120['stop']();}})[_0x97e8('0xe')](function(_0x46e637){logger[_0x97e8('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x23b2fc,JSON[_0x97e8('0x11')](_0x46e637));_0x2a9120[_0x97e8('0x16')]();});}})['catch'](function(_0x514288){logger[_0x97e8('0xf')](_0x97e8('0x10'),_0x23b2fc,_0x514288['message']);_0x2a9120[_0x97e8('0x16')]();});}}catch(_0x253240){logger['error'](_0x97e8('0x10'),_0x23b2fc,JSON['stringify'](_0x253240));_0x2a9120['stop']();}};}; \ No newline at end of file +var _0x7a55=['stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','next','lodash','dialogflow','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','phone','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','getMustacheRender','then','catch','finally'];(function(_0x10e0c9,_0x581719){var _0x236f61=function(_0x27aaec){while(--_0x27aaec){_0x10e0c9['push'](_0x10e0c9['shift']());}};_0x236f61(++_0x581719);}(_0x7a55,0x173));var _0x57a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a55[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57a5('0x0'));var dialogflow=require(_0x57a5('0x1'));var md5=require('md5');var moment=require(_0x57a5('0x2'));var Promise=require('bluebird');var logger=require(_0x57a5('0x3'))(_0x57a5('0x4'));var utils=require(_0x57a5('0x5'));var rpc={'chatMessage':require(_0x57a5('0x6')),'openchannelMessage':require(_0x57a5('0x7')),'mailMessage':require(_0x57a5('0x8')),'smsMessage':require(_0x57a5('0x9')),'faxMessage':require(_0x57a5('0xa')),'whatsappMessage':require(_0x57a5('0xb'))};function createMessage(_0x10a878,_0x5bd5fc,_0x2e2098,_0x54fbd3){return new Promise(function(_0x22f21b,_0x1eea2b){var _0x3c2863=_[_0x57a5('0xc')](_0x2e2098);_0x3c2863[_0x57a5('0xd')]=_0x54fbd3;return rpc[_0x5bd5fc+_0x57a5('0xe')][_0x57a5('0xf')](_0x3c2863)['then'](function(){logger[_0x57a5('0x10')](_0x57a5('0x11'),_0x10a878,_0x3c2863[_0x57a5('0xd')]);_0x22f21b();})['catch'](function(_0x27505d){logger[_0x57a5('0x12')](_0x57a5('0x11'),_0x10a878,JSON[_0x57a5('0x13')](_0x27505d));_0x1eea2b(_0x27505d);});});}exports[_0x57a5('0x14')]=function(_0x1a38fd,_0x2c5da7){return function(_0x258680){try{if(!_[_0x57a5('0x15')](this[_0x57a5('0x16')]['UserId'])){logger[_0x57a5('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x1a38fd,_0x57a5('0x17'));return _0x258680['next']();}var _0x529066={'ContactId':this[_0x57a5('0x18')]['id'],'sentAt':moment()['format'](_0x57a5('0x19')),'direction':'out'};if(this[_0x57a5('0x1a')]==='sms'||this[_0x57a5('0x1a')]==='whatsapp'){_0x529066[_0x57a5('0x1b')]=this[_0x57a5('0x16')]['phone'];}var _0x402580=this[_0x57a5('0x1a')];if(_0x402580==='chat'){_0x529066[_0x57a5('0x1c')]=this[_0x57a5('0x1d')]['id'];}else{_0x529066[_['upperFirst'](_0x402580)+'AccountId']=this['account']['id'];}_0x529066[_[_0x57a5('0x1e')](_0x402580)+_0x57a5('0x1f')]=this[_0x57a5('0x16')]['id'];if(this[_0x57a5('0x16')]['created']){var _0x34d05d=_0x2c5da7[0x4];if(!_[_0x57a5('0x20')](_0x34d05d)){_0x529066[_0x57a5('0xd')]=utils[_0x57a5('0x21')](_0x34d05d,this);return rpc[_0x402580+'Message']['create'](_0x529066)[_0x57a5('0x22')](function(_0x346178){logger[_0x57a5('0x10')](_0x57a5('0x11'),_0x1a38fd,_0x529066[_0x57a5('0xd')]);})[_0x57a5('0x23')](function(_0x52b0c8){logger['error'](_0x57a5('0x11'),_0x1a38fd,JSON[_0x57a5('0x13')](_0x52b0c8));})[_0x57a5('0x24')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1a38fd);_0x258680['stop']();});}else{logger[_0x57a5('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1a38fd);_0x258680[_0x57a5('0x25')]();}}else{var _0x529702=this;var _0x90e01f=_0x2c5da7[0x2][_0x57a5('0x26')](/\\n/g,'\x0a');var _0x23d1ec={'credentials':{'private_key':_0x90e01f,'client_email':_0x2c5da7[0x1]}};var _0x145cf7=new dialogflow[(_0x57a5('0x27'))](_0x23d1ec);var _0x21ac49=_0x145cf7[_0x57a5('0x28')](_0x2c5da7[0x0],md5(_0x529702['interaction']['id']));var _0x2faa0f={'session':_0x21ac49,'queryInput':{'text':{'text':_0x529702[_0x57a5('0x29')][_0x57a5('0xd')],'languageCode':_0x2c5da7[0x3]||'en'}}};return _0x145cf7[_0x57a5('0x2a')](_0x2faa0f)[_0x57a5('0x22')](function(_0x150a53){if(_0x150a53&&_0x150a53[_0x57a5('0x2b')]){_0x529702[_0x57a5('0xd')][_0x57a5('0x2c')]=_0x150a53;var _0x7da220=_0x150a53[0x0];var _0x342f60=_0x7da220['queryResult'][_0x57a5('0x2d')]&&_0x7da220[_0x57a5('0x2e')][_0x57a5('0x2d')][_0x57a5('0x2f')]?_0x7da220['queryResult']['diagnosticInfo'][_0x57a5('0x2f')][_0x57a5('0x30')][_0x57a5('0x31')]:![];_0x529702[_0x57a5('0xd')][_0x57a5('0x32')]=_0x7da220['queryResult'][_0x57a5('0x33')];_0x529702[_0x57a5('0xd')][_0x57a5('0x34')]=_0x7da220['queryResult'][_0x57a5('0x35')];_0x529702['body'][_0x57a5('0x36')]=_0x7da220[_0x57a5('0x2e')][_0x57a5('0x2d')]&&_0x7da220[_0x57a5('0x2e')][_0x57a5('0x2d')][_0x57a5('0x2f')]?_0x7da220[_0x57a5('0x2e')][_0x57a5('0x2d')][_0x57a5('0x2f')][_0x57a5('0x30')][_0x57a5('0x31')]:![];_0x529702['body']['DIALOGFLOWV2_INTENTNAME']=_0x7da220['queryResult'][_0x57a5('0x37')][_0x57a5('0x38')];_0x529702[_0x57a5('0xd')][_0x57a5('0x39')]=_0x7da220['queryResult'][_0x57a5('0x37')]['displayName'];_0x529702['body'][_0x57a5('0x3a')]=_0x7da220[_0x57a5('0x2e')]['intent']['isFallback'];_0x529702['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x7da220[_0x57a5('0x2e')][_0x57a5('0x3b')];_0x529702['body'][_0x57a5('0x3c')]=_0x7da220[_0x57a5('0x2e')]['queryText'];_0x529702['body']['DIALOGFLOWV2_SCORE']=_0x7da220[_0x57a5('0x2e')][_0x57a5('0x3d')];_0x529066[_0x57a5('0x3e')]='dialogflowV2';_0x529066[_0x57a5('0x3f')]=JSON[_0x57a5('0x13')](_0x150a53);var _0x1ece19=[];for(var _0x125fa9=0x0;_0x125fa9<_0x150a53['length'];_0x125fa9++){var _0x5e946b=_0x150a53[_0x125fa9];if(_0x5e946b&&_0x5e946b[_0x57a5('0x2e')]&&_0x5e946b[_0x57a5('0x2e')][_0x57a5('0x40')]){_0x1ece19[_0x57a5('0x41')](createMessage(_0x1a38fd,_0x402580,_0x529066,_0x5e946b['queryResult'][_0x57a5('0x40')]));}}return Promise[_0x57a5('0x42')](_0x1ece19)[_0x57a5('0x22')](function(){if(_0x342f60){_0x258680[_0x57a5('0x43')]();}else{_0x258680[_0x57a5('0x25')]();}})[_0x57a5('0x23')](function(_0x5a53c2){logger[_0x57a5('0x12')](_0x57a5('0x11'),_0x1a38fd,JSON[_0x57a5('0x13')](_0x5a53c2));_0x258680[_0x57a5('0x43')]();});}})['catch'](function(_0x308b04){logger['error'](_0x57a5('0x11'),_0x1a38fd,_0x308b04['message']);_0x258680[_0x57a5('0x43')]();});}}catch(_0x1972df){logger[_0x57a5('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x1a38fd,JSON[_0x57a5('0x13')](_0x1972df));_0x258680['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 7d928c4..2095281 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb32e=['validate','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','stop','priorityTrue','priorityFalse','info','condition','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify'];(function(_0x59b058,_0x5f4c38){var _0x5cb986=function(_0x54ee4c){while(--_0x54ee4c){_0x59b058['push'](_0x59b058['shift']());}};_0x5cb986(++_0x5f4c38);}(_0xb32e,0x145));var _0xeb32=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb32e[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0xeb32('0x0'));var _=require(_0xeb32('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xeb32('0x2'));var logger=require(_0xeb32('0x3'))(_0xeb32('0x4'));var gotoif=schema({'condition':{'type':_0xeb32('0x5'),'required':!![],'message':_0xeb32('0x6')},'priorityTrue':{'type':_0xeb32('0x7'),'message':_0xeb32('0x8')},'priorityFalse':{'type':'number','message':_0xeb32('0x9')}});exports[_0xeb32('0xa')]=function(_0x3b35a0,_0x2d4347){return function(_0xd95531){try{var _0x1b13f7={'condition':htmlToText[_0xeb32('0xb')](utils['getMustacheRender'](_0x2d4347[0x0],this),{'wordwrap':![]})[_0xeb32('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2d4347[0x1],'priorityFalse':_0x2d4347[0x2]};var _0x50b996=gotoif['validate'](_0x1b13f7,{'typecast':!![]});if(_0x50b996[_0xeb32('0xd')]){logger[_0xeb32('0xe')](_0xeb32('0xf'),_0x3b35a0,_['map'](_0x50b996,'message')['join'](',\x20'));_0xd95531[_0xeb32('0x10')]();}else{try{var _0x44d3fd=eval('('+_0x1b13f7['condition']+')');var _0x246f54=_0x44d3fd?_0x1b13f7[_0xeb32('0x11')]:_0x1b13f7[_0xeb32('0x12')];logger[_0xeb32('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x3b35a0,_0x1b13f7[_0xeb32('0x14')],_0x44d3fd,_0x246f54||'next');if(_0x246f54){var _0x4a158b=_['findIndex'](_0xd95531[_0xeb32('0x15')](),{'p':_0x246f54});if(_0x4a158b>=0x0){logger[_0xeb32('0x13')](_0xeb32('0x16'),_0x3b35a0,_0x246f54||_0xeb32('0x17'),_0x4a158b);_0xd95531[_0xeb32('0x17')](_0x4a158b);}else{logger[_0xeb32('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3b35a0,_0x246f54||_0xeb32('0x17'));_0xd95531[_0xeb32('0x10')]();}}else{_0xd95531[_0xeb32('0x17')]();}}catch(_0x18844f){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3b35a0,_0x18844f['message']);_0xd95531[_0xeb32('0x10')]();}}}catch(_0x5e5a05){logger[_0xeb32('0xe')]('[%s][GOTOIF]\x20%s',_0x3b35a0,JSON[_0xeb32('0x18')](_0x5e5a05));_0xd95531[_0xeb32('0x10')]();}};}; \ No newline at end of file +var _0xde9d=['../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','info','validate','./utils'];(function(_0x52ef2d,_0x462c7d){var _0x1f48c3=function(_0x2f1d00){while(--_0x2f1d00){_0x52ef2d['push'](_0x52ef2d['shift']());}};_0x1f48c3(++_0x462c7d);}(_0xde9d,0x11e));var _0xdde9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde9d[_0x17d9e3];return _0x14192d;};'use strict';var schema=require(_0xdde9('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xdde9('0x1'));var logger=require(_0xdde9('0x2'))(_0xdde9('0x3'));var gotoif=schema({'condition':{'type':_0xdde9('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xdde9('0x5'),'message':_0xdde9('0x6')},'priorityFalse':{'type':_0xdde9('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xdde9('0x7')]=function(_0x14baf8,_0x5a6d3c){return function(_0xc89050){try{var _0x17b6b8={'condition':htmlToText[_0xdde9('0x8')](utils['getMustacheRender'](_0x5a6d3c[0x0],this),{'wordwrap':![]})[_0xdde9('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5a6d3c[0x1],'priorityFalse':_0x5a6d3c[0x2]};var _0x466303=gotoif['validate'](_0x17b6b8,{'typecast':!![]});if(_0x466303[_0xdde9('0xa')]){logger[_0xdde9('0xb')](_0xdde9('0xc'),_0x14baf8,_[_0xdde9('0xd')](_0x466303,_0xdde9('0xe'))[_0xdde9('0xf')](',\x20'));_0xc89050[_0xdde9('0x10')]();}else{try{var _0x150887=eval('('+_0x17b6b8['condition']+')');var _0x547159=_0x150887?_0x17b6b8['priorityTrue']:_0x17b6b8[_0xdde9('0x11')];logger['info'](_0xdde9('0x12'),_0x14baf8,_0x17b6b8[_0xdde9('0x13')],_0x150887,_0x547159||_0xdde9('0x14'));if(_0x547159){var _0x4c51e6=_[_0xdde9('0x15')](_0xc89050[_0xdde9('0x16')](),{'p':_0x547159});if(_0x4c51e6>=0x0){logger[_0xdde9('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x14baf8,_0x547159||_0xdde9('0x14'),_0x4c51e6);_0xc89050[_0xdde9('0x14')](_0x4c51e6);}else{logger[_0xdde9('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x14baf8,_0x547159||_0xdde9('0x14'));_0xc89050[_0xdde9('0x10')]();}}else{_0xc89050[_0xdde9('0x14')]();}}catch(_0x2899e6){logger[_0xdde9('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x14baf8,_0x2899e6['message']);_0xc89050['stop']();}}}catch(_0xe242a9){logger['error'](_0xdde9('0xc'),_0x14baf8,JSON['stringify'](_0xe242a9));_0xc89050[_0xdde9('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index f82bd97..2a7af1d 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 _0xc280=['[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','stop','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x296b79,_0x108f37){var _0x231f29=function(_0x66cf0c){while(--_0x66cf0c){_0x296b79['push'](_0x296b79['shift']());}};_0x231f29(++_0x108f37);}(_0xc280,0x1d8));var _0x0c28=function(_0x156f80,_0x531503){_0x156f80=_0x156f80-0x0;var _0x2dccd6=_0xc280[_0x156f80];return _0x2dccd6;};'use strict';var schema=require(_0x0c28('0x0'));var _=require(_0x0c28('0x1'));var logger=require('../../../../config/logger')(_0x0c28('0x2'));var gotop=schema({'priority':{'type':_0x0c28('0x3'),'required':!![],'message':_0x0c28('0x4')}});exports[_0x0c28('0x5')]=function(_0x3778e4,_0x1da073){return function(_0x72101){try{var _0x485a4a={'priority':_0x1da073[0x0]};var _0x29f7b0=gotop[_0x0c28('0x0')](_0x485a4a,{'typecast':!![]});if(_0x29f7b0[_0x0c28('0x6')]){logger[_0x0c28('0x7')](_0x0c28('0x8'),_0x3778e4,_[_0x0c28('0x9')](_0x29f7b0,_0x0c28('0xa'))[_0x0c28('0xb')](',\x20'));_0x72101['stop']();}else{logger[_0x0c28('0xc')](_0x0c28('0xd'),_0x3778e4,_0x485a4a[_0x0c28('0xe')]);if(_0x485a4a[_0x0c28('0xe')]){var _0x13f593=_[_0x0c28('0xf')](_0x72101[_0x0c28('0x10')](),{'p':_0x485a4a[_0x0c28('0xe')]});if(_0x13f593>=0x0){logger[_0x0c28('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3778e4,_0x485a4a[_0x0c28('0xe')]||_0x0c28('0x11'),_0x13f593);_0x72101[_0x0c28('0x11')](_0x13f593);}else{logger[_0x0c28('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3778e4,_0x485a4a[_0x0c28('0xe')]||_0x0c28('0x11'));_0x72101[_0x0c28('0x12')]();}}else{_0x72101[_0x0c28('0x11')]();}}}catch(_0x98837a){logger[_0x0c28('0x7')](_0x0c28('0x8'),_0x3778e4,JSON[_0x0c28('0x13')](_0x98837a));_0x72101[_0x0c28('0x12')]();}};}; \ No newline at end of file +var _0x97be=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','map','join','stop','info'];(function(_0x48e612,_0x1f04a8){var _0x40681f=function(_0x27d926){while(--_0x27d926){_0x48e612['push'](_0x48e612['shift']());}};_0x40681f(++_0x1f04a8);}(_0x97be,0x14b));var _0xe97b=function(_0x2b6ab2,_0x530aa5){_0x2b6ab2=_0x2b6ab2-0x0;var _0x48ecb9=_0x97be[_0x2b6ab2];return _0x48ecb9;};'use strict';var schema=require(_0xe97b('0x0'));var _=require('lodash');var logger=require(_0xe97b('0x1'))(_0xe97b('0x2'));var gotop=schema({'priority':{'type':_0xe97b('0x3'),'required':!![],'message':_0xe97b('0x4')}});exports['consequence']=function(_0x1211ce,_0x2ea71d){return function(_0x26819b){try{var _0x5e60c8={'priority':_0x2ea71d[0x0]};var _0x5e4707=gotop[_0xe97b('0x0')](_0x5e60c8,{'typecast':!![]});if(_0x5e4707[_0xe97b('0x5')]){logger[_0xe97b('0x6')]('[%s][GOTOP]\x20%s',_0x1211ce,_[_0xe97b('0x7')](_0x5e4707,'message')[_0xe97b('0x8')](',\x20'));_0x26819b[_0xe97b('0x9')]();}else{logger[_0xe97b('0xa')](_0xe97b('0xb'),_0x1211ce,_0x5e60c8[_0xe97b('0xc')]);if(_0x5e60c8[_0xe97b('0xc')]){var _0x3f9cac=_[_0xe97b('0xd')](_0x26819b[_0xe97b('0xe')](),{'p':_0x5e60c8[_0xe97b('0xc')]});if(_0x3f9cac>=0x0){logger[_0xe97b('0xa')](_0xe97b('0xf'),_0x1211ce,_0x5e60c8[_0xe97b('0xc')]||'next',_0x3f9cac);_0x26819b[_0xe97b('0x10')](_0x3f9cac);}else{logger[_0xe97b('0xa')](_0xe97b('0x11'),_0x1211ce,_0x5e60c8['priority']||_0xe97b('0x10'));_0x26819b[_0xe97b('0x9')]();}}else{_0x26819b['next']();}}}catch(_0x467a86){logger[_0xe97b('0x6')]('[%s][GOTOP]\x20%s',_0x1211ce,JSON['stringify'](_0x467a86));_0x26819b[_0xe97b('0x9')]();}};}; \ 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 c598fa4..8dfaca5 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 _0xa177=['contact','channel','chat','ChatWebsiteId','account','upperFirst','Message','create','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x41f15f,_0x1a39ef){var _0x269a71=function(_0x52c50e){while(--_0x52c50e){_0x41f15f['push'](_0x41f15f['shift']());}};_0x269a71(++_0x1a39ef);}(_0xa177,0x143));var _0x7a17=function(_0x5a8bbd,_0x8d6d5f){_0x5a8bbd=_0x5a8bbd-0x0;var _0x17ebed=_0xa177[_0x5a8bbd];return _0x17ebed;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x7a17('0x0'))('routing');var rpc={'chatMessage':require(_0x7a17('0x1')),'openchannelMessage':require(_0x7a17('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7a17('0x3')),'faxMessage':require(_0x7a17('0x4')),'whatsappMessage':require(_0x7a17('0x5'))};exports[_0x7a17('0x6')]=function(_0x25afb3,_0x35e3f9){return function(_0x9ad53){try{var _0x5542c6={'body':utils['getMustacheRender'](_0x35e3f9[0x0],this),'ContactId':this[_0x7a17('0x7')]['id']};if(this[_0x7a17('0x8')]===_0x7a17('0x9')){_0x5542c6[_0x7a17('0xa')]=this[_0x7a17('0xb')]['id'];}else{_0x5542c6[_[_0x7a17('0xc')](this[_0x7a17('0x8')])+'AccountId']=this[_0x7a17('0xb')]['id'];}_0x5542c6[_[_0x7a17('0xc')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x7a17('0x8')]+_0x7a17('0xd')]){return rpc[this[_0x7a17('0x8')]+_0x7a17('0xd')][_0x7a17('0xe')](_0x5542c6)['then'](function(_0x167b25){logger[_0x7a17('0xf')](_0x7a17('0x10'),_0x25afb3,_0x5542c6[_0x7a17('0x11')]);_0x9ad53['next']();})[_0x7a17('0x12')](function(_0x4e8d61){logger[_0x7a17('0x13')](_0x7a17('0x10'),_0x25afb3,JSON[_0x7a17('0x14')](_0x4e8d61));_0x9ad53[_0x7a17('0x15')]();});}}catch(_0x1922bd){logger[_0x7a17('0x13')](_0x7a17('0x10'),_0x25afb3,JSON[_0x7a17('0x14')](_0x1922bd));_0x9ad53['stop']();}};}; \ No newline at end of file +var _0xaeaa=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xaeaa,0xf3));var _0xaaea=function(_0x360939,_0x29a94d){_0x360939=_0x360939-0x0;var _0x2a3366=_0xaeaa[_0x360939];return _0x2a3366;};'use strict';var _=require('lodash');var utils=require(_0xaaea('0x0'));var logger=require(_0xaaea('0x1'))(_0xaaea('0x2'));var rpc={'chatMessage':require(_0xaaea('0x3')),'openchannelMessage':require(_0xaaea('0x4')),'mailMessage':require(_0xaaea('0x5')),'smsMessage':require(_0xaaea('0x6')),'faxMessage':require(_0xaaea('0x7')),'whatsappMessage':require(_0xaaea('0x8'))};exports[_0xaaea('0x9')]=function(_0x18c591,_0x4390fd){return function(_0x132bd5){try{var _0x1e0ba3={'body':utils[_0xaaea('0xa')](_0x4390fd[0x0],this),'ContactId':this[_0xaaea('0xb')]['id']};if(this[_0xaaea('0xc')]===_0xaaea('0xd')){_0x1e0ba3[_0xaaea('0xe')]=this[_0xaaea('0xf')]['id'];}else{_0x1e0ba3[_[_0xaaea('0x10')](this[_0xaaea('0xc')])+_0xaaea('0x11')]=this[_0xaaea('0xf')]['id'];}_0x1e0ba3[_[_0xaaea('0x10')](this[_0xaaea('0xc')])+_0xaaea('0x12')]=this['interaction']['id'];if(rpc[this[_0xaaea('0xc')]+_0xaaea('0x13')]){return rpc[this['channel']+_0xaaea('0x13')]['create'](_0x1e0ba3)['then'](function(_0x162dd8){logger[_0xaaea('0x14')](_0xaaea('0x15'),_0x18c591,_0x1e0ba3[_0xaaea('0x16')]);_0x132bd5['next']();})[_0xaaea('0x17')](function(_0x19ddc1){logger[_0xaaea('0x18')]('[%s][MESSAGE]\x20%s',_0x18c591,JSON['stringify'](_0x19ddc1));_0x132bd5[_0xaaea('0x19')]();});}}catch(_0x24f949){logger[_0xaaea('0x18')]('[%s][MESSAGE]\x20%s',_0x18c591,JSON[_0xaaea('0x1a')](_0x24f949));_0x132bd5[_0xaaea('0x19')]();}};}; \ 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 614a482..0dc3001 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 _0xa561=['error','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x2eaf13,_0x40770a){var _0x3245ef=function(_0x2b0a19){while(--_0x2b0a19){_0x2eaf13['push'](_0x2eaf13['shift']());}};_0x3245ef(++_0x40770a);}(_0xa561,0xbe));var _0x1a56=function(_0x11a70f,_0x4e960f){_0x11a70f=_0x11a70f-0x0;var _0x7f1c63=_0xa561[_0x11a70f];return _0x7f1c63;};'use strict';var utils=require(_0x1a56('0x0'));var logger=require(_0x1a56('0x1'))(_0x1a56('0x2'));exports[_0x1a56('0x3')]=function(_0x467e13,_0x9e5c7d){return function(_0x5b1b54){try{logger['info'](_0x1a56('0x4'),_0x467e13,utils[_0x1a56('0x5')](_0x9e5c7d[0x0],this));_0x5b1b54['next']();}catch(_0x5c4ff8){logger[_0x1a56('0x6')](_0x1a56('0x4'),_0x467e13,JSON['stringify'](_0x5c4ff8));_0x5b1b54['stop']();}};}; \ No newline at end of file +var _0x03db=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','next','error','stop','./utils'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x03db,0x1dc));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xb03d('0x0'));var logger=require(_0xb03d('0x1'))(_0xb03d('0x2'));exports[_0xb03d('0x3')]=function(_0x34d0ba,_0x5680f4){return function(_0x29930b){try{logger[_0xb03d('0x4')](_0xb03d('0x5'),_0x34d0ba,utils['getMustacheRender'](_0x5680f4[0x0],this));_0x29930b[_0xb03d('0x6')]();}catch(_0x35dc87){logger[_0xb03d('0x7')](_0xb03d('0x5'),_0x34d0ba,JSON['stringify'](_0x35dc87));_0x29930b[_0xb03d('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 4a84f32..7e4ee21 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 _0xb369=['close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','from','joinAt','emit','queue_id','queue','format','%s:queue:%s','%s_queue_waiting_interaction:%s','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED'];(function(_0x5df637,_0x3c15d3){var _0x1702d6=function(_0x567fce){while(--_0x567fce){_0x5df637['push'](_0x5df637['shift']());}};_0x1702d6(++_0x3c15d3);}(_0xb369,0x146));var _0x9b36=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb369[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0x9b36('0x0'));var _=require(_0x9b36('0x1'));var util=require(_0x9b36('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x9b36('0x3'));var Redis=require('ioredis');var config=require(_0x9b36('0x4'));var logger=require(_0x9b36('0x5'))(_0x9b36('0x6'));var strategy=require(_0x9b36('0x7'));config[_0x9b36('0x8')]=_['defaults'](config[_0x9b36('0x8')],{'host':_0x9b36('0x9'),'port':0x18eb});var io=require(_0x9b36('0xa'))(new Redis(config[_0x9b36('0x8')]));var attributes=['id','queue_id',_0x9b36('0xb'),'queue',_0x9b36('0xc'),_0x9b36('0xd')];function emit(_0x20a57b,_0x4692b8,_0x3cf0b4){io['to'](_0x20a57b)[_0x9b36('0xe')](_0x4692b8,_0x3cf0b4);}function emitChannelQueueInteraction(_0x210339,_0x52bb12,_0x504c80,_0x2b53d4,_0x45e417,_0x42581b,_0x23390a,_0x1c18e6){var _0x463f05=_['clone'](_0x504c80);_0x463f05[_0x9b36('0xf')]=_0x1c18e6;_0x463f05[_0x9b36('0x10')]=_0x52bb12;_0x463f05['account']=_0x2b53d4;_0x463f05['id']=_0x45e417;if(_0x42581b){_0x23390a[util[_0x9b36('0x11')]('%sQueuesWaitingInteractions',_0x210339)][_0x45e417]=_['pick'](_0x463f05,attributes);}else{delete _0x23390a[util[_0x9b36('0x11')]('%sQueuesWaitingInteractions',_0x210339)][_0x45e417];}emit(util[_0x9b36('0x11')](_0x9b36('0x12'),_0x210339,_0x52bb12),util['format'](_0x9b36('0x13'),_0x210339,_0x42581b?'save':'remove'),_[_0x9b36('0x14')](_0x463f05,attributes));}var rpc={'openchannelQueueReport':require(_0x9b36('0x15')),'mailQueueReport':require(_0x9b36('0x16')),'chatQueueReport':require(_0x9b36('0x17')),'smsQueueReport':require(_0x9b36('0x18')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x9b36('0x19'),'required':!![],'message':_0x9b36('0x1a')},'timeout':{'type':_0x9b36('0x1b'),'message':_0x9b36('0x1c')}});function startRouting(_0x4d6db9,_0x57fb7d,_0x140f08,_0x50bbd8){if(_0x4d6db9&&_0x57fb7d&&_0x140f08){_0x57fb7d['waiting']+=0x1;var _0x4f2db1={'uniqueid':_0x4d6db9,'from':_0x140f08[_0x9b36('0x1d')]?_0x140f08[_0x9b36('0x1d')][_0x9b36('0xc')]:'','joinAt':moment()['format'](_0x9b36('0x1e')),'ContactId':_0x140f08[_0x9b36('0x1f')]?_0x140f08[_0x9b36('0x1f')]['id']:null,'ListId':_0x140f08[_0x9b36('0x20')]?_0x140f08[_0x9b36('0x20')]['id']:null};_0x4f2db1[_[_0x9b36('0x21')](_0x140f08[_0x9b36('0x22')])+_0x9b36('0x23')]=_0x57fb7d['id']||null;_0x4f2db1[_[_0x9b36('0x21')](_0x140f08[_0x9b36('0x22')])+_0x9b36('0x24')]=_0x140f08['interaction']?_0x140f08['interaction']['id']:null;_0x4f2db1[_[_0x9b36('0x21')](_0x140f08[_0x9b36('0x22')])+_0x9b36('0x25')]=_0x140f08[_0x9b36('0x26')]?_0x140f08[_0x9b36('0x26')]['id']:null;_0x4f2db1[_[_0x9b36('0x21')](_0x140f08[_0x9b36('0x22')])+(_0x140f08['channel']!=='chat'?_0x9b36('0x27'):_0x9b36('0x28'))]=_0x140f08['account']?_0x140f08[_0x9b36('0xb')]['id']:null;logger[_0x9b36('0x29')](util[_0x9b36('0x11')](_0x9b36('0x2a'),_0x4d6db9,_0x57fb7d['name']));emitChannelQueueInteraction(_0x140f08[_0x9b36('0x22')],_0x57fb7d[_0x9b36('0x2b')],_0x4f2db1,_0x140f08[_0x9b36('0xb')]['name'],_0x140f08[_0x9b36('0x26')]['id'],!![],_0x50bbd8,_0x57fb7d['id']);if(rpc[_0x140f08['channel']+_0x9b36('0x2c')]){return rpc[_0x140f08[_0x9b36('0x22')]+_0x9b36('0x2c')][_0x9b36('0x2d')](_0x4f2db1)[_0x9b36('0x2e')](function(_0x3024c9){logger['error'](_0x9b36('0x2f'));});}}}function stopRouting(_0x5c5d30,_0x2b47a1,_0x3ffa98,_0x44e0b1){if(_0x5c5d30&&_0x2b47a1){_0x2b47a1[_0x9b36('0x30')]-=0x1;var _0x4cf22c={'leaveAt':moment()[_0x9b36('0x11')](_0x9b36('0x1e')),'acceptAt':moment()[_0x9b36('0x11')](_0x9b36('0x1e')),'reason':_0x9b36('0x31')};logger[_0x9b36('0x29')](util[_0x9b36('0x11')](_0x9b36('0x32'),_0x5c5d30,_0x2b47a1[_0x9b36('0x2b')]));emitChannelQueueInteraction(_0x3ffa98[_0x9b36('0x22')],_0x2b47a1[_0x9b36('0x2b')],_0x3ffa98['body'],_0x3ffa98[_0x9b36('0xb')][_0x9b36('0x2b')],_0x3ffa98['message']['id'],![],_0x44e0b1,_0x2b47a1['id']);if(rpc[_0x3ffa98[_0x9b36('0x22')]+_0x9b36('0x2c')]){return rpc[_0x3ffa98[_0x9b36('0x22')]+_0x9b36('0x2c')][_0x9b36('0x33')](_0x5c5d30,_0x4cf22c)[_0x9b36('0x2e')](function(_0x5d6a74){logger[_0x9b36('0x34')](_0x9b36('0x35'));});}}}function endRouting(_0x49380b,_0x5ab641,_0x505c6d,_0x21d2bc){if(_0x49380b&&_0x5ab641){_0x5ab641[_0x9b36('0x30')]-=0x1;var _0x417f15={'leaveAt':moment()[_0x9b36('0x11')](_0x9b36('0x1e')),'exitAt':moment()[_0x9b36('0x11')](_0x9b36('0x1e')),'reason':'timeout'};logger['info'](util[_0x9b36('0x11')](_0x9b36('0x36'),_0x49380b,_0x5ab641[_0x9b36('0x2b')]));emitChannelQueueInteraction(_0x505c6d[_0x9b36('0x22')],_0x5ab641[_0x9b36('0x2b')],_0x505c6d[_0x9b36('0x1d')],_0x505c6d[_0x9b36('0xb')]['name'],_0x505c6d[_0x9b36('0x26')]['id'],![],_0x21d2bc);if(rpc[_0x505c6d[_0x9b36('0x22')]+_0x9b36('0x2c')]){return rpc[_0x505c6d['channel']+_0x9b36('0x2c')]['update'](_0x49380b,_0x417f15)['catch'](function(_0x20db76){logger['error'](_0x9b36('0x35'));});}}}function handleFindQueue(_0x451d3a){return function(_0x397ae7){return _0x397ae7[_0x9b36('0x2b')][_0x9b36('0x37')]()===_0x451d3a[_0x9b36('0x37')]();};}exports[_0x9b36('0x38')]=function(_0x6ca764,_0x13bb77,_0x87923e,_0x4faa4e){return function(_0x3c0c57){try{var _0x1bfbf2={'name':_0x13bb77[0x0],'timeout':_0x13bb77[0x1]};var _0x5ab9e3=queue['validate'](_0x1bfbf2,{'typecast':!![]});if(_0x5ab9e3[_0x9b36('0x39')]){logger[_0x9b36('0x34')](_0x9b36('0x3a'),_0x6ca764,_[_0x9b36('0x3b')](_0x5ab9e3,_0x9b36('0x26'))[_0x9b36('0x3c')](',\x20'));_0x3c0c57[_0x9b36('0x3d')]();}else{var _0x468095=_[_0x9b36('0x3e')](_0x87923e[_0x4faa4e['channel']+_0x9b36('0x3f')],handleFindQueue(_0x1bfbf2['name']));if(_0x468095){startRouting(_0x6ca764,_0x468095,_0x4faa4e,_0x87923e);var _0x2ce187=(_0x468095['timeout']||0xa)*0x3e8;var _0x3e6d8d=(_0x1bfbf2[_0x9b36('0x40')]||0x14)*0x3e8;var _0x256198,_0x442a74;if(_0x2ce187>_0x3e6d8d){_0x3e6d8d=_0x2ce187;}var _0x35ad5e=seqqueue[_0x9b36('0x41')](_0x2ce187);_0x35ad5e['id']=_0x6ca764;_0x35ad5e['atimeout']=_0x2ce187;_0x35ad5e[_0x9b36('0x42')]=_0x3e6d8d;_0x35ad5e[_0x9b36('0x22')]=_0x4faa4e[_0x9b36('0x22')];_0x87923e['rules'][_0x6ca764]['on'](_0x9b36('0x43'),function(){logger['info'](_0x9b36('0x44'),_0x6ca764);stopRouting(_0x6ca764,_0x468095,_0x4faa4e,_0x87923e);clearTimeout(_0x256198);_0x256198=undefined;_0x35ad5e[_0x9b36('0x45')](!![]);if(_0x87923e[_0x9b36('0x46')][_0x6ca764]){delete _0x87923e[_0x9b36('0x46')][_0x6ca764];}_0x3c0c57[_0x9b36('0x3d')]();});_0x87923e[_0x9b36('0x46')][_0x6ca764]['on'](_0x9b36('0x47'),function(){if(_0x87923e[_0x9b36('0x46')][_0x6ca764]){delete _0x87923e['rules'][_0x6ca764];}});_0x256198=setTimeout(function(){logger[_0x9b36('0x29')](_0x9b36('0x48'),_0x6ca764);endRouting(_0x6ca764,_0x468095,_0x4faa4e,_0x87923e);clearTimeout(_0x256198);_0x35ad5e[_0x9b36('0x45')](!![]);_0x3c0c57[_0x9b36('0x49')]();},_0x3e6d8d);switch(_0x468095[_0x9b36('0x4a')]){case _0x9b36('0x4b'):strategy[_0x9b36('0x4b')](_0x35ad5e,_0x468095,_0x87923e,_0x4faa4e);break;default:strategy['beepall'](_0x35ad5e,_0x468095,_0x87923e,_0x4faa4e);}}else{logger[_0x9b36('0x34')](_0x9b36('0x4c'),_0x6ca764,_0x1bfbf2[_0x9b36('0x2b')]);_0x3c0c57['stop']();}}}catch(_0x6061f2){console[_0x9b36('0x4d')](_0x6061f2);logger[_0x9b36('0x34')](_0x9b36('0x3a'),_0x6ca764,_0x6061f2[_0x9b36('0x4e')]);_0x3c0c57['stop']();}};}; \ No newline at end of file +var _0x1f38=['complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','map','stop','find','Queues','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x1c7ced,_0x23f7d5){var _0x1000b8=function(_0x5a994b){while(--_0x5a994b){_0x1c7ced['push'](_0x1c7ced['shift']());}};_0x1000b8(++_0x23f7d5);}(_0x1f38,0x192));var _0x81f3=function(_0x1ee358,_0x42fdfb){_0x1ee358=_0x1ee358-0x0;var _0x4d01b9=_0x1f38[_0x1ee358];return _0x4d01b9;};'use strict';var schema=require('validate');var _=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var seqqueue=require(_0x81f3('0x2'));var moment=require(_0x81f3('0x3'));var Redis=require(_0x81f3('0x4'));var config=require('../../../../config/environment');var logger=require(_0x81f3('0x5'))(_0x81f3('0x6'));var strategy=require('./strategy');config[_0x81f3('0x7')]=_[_0x81f3('0x8')](config[_0x81f3('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x81f3('0x9'))(new Redis(config['redis']));var attributes=['id',_0x81f3('0xa'),_0x81f3('0xb'),_0x81f3('0xc'),_0x81f3('0xd'),_0x81f3('0xe')];function emit(_0x4dd0c,_0x48ca8f,_0x13dcf7){io['to'](_0x4dd0c)[_0x81f3('0xf')](_0x48ca8f,_0x13dcf7);}function emitChannelQueueInteraction(_0x55206e,_0x544bc4,_0x5002e6,_0x263be9,_0x5084d5,_0x1402aa,_0x55d05a,_0x55044d){var _0x53b1a2=_['clone'](_0x5002e6);_0x53b1a2['queue_id']=_0x55044d;_0x53b1a2['queue']=_0x544bc4;_0x53b1a2['account']=_0x263be9;_0x53b1a2['id']=_0x5084d5;if(_0x1402aa){_0x55d05a[util[_0x81f3('0x10')]('%sQueuesWaitingInteractions',_0x55206e)][_0x5084d5]=_[_0x81f3('0x11')](_0x53b1a2,attributes);}else{delete _0x55d05a[util[_0x81f3('0x10')](_0x81f3('0x12'),_0x55206e)][_0x5084d5];}emit(util[_0x81f3('0x10')](_0x81f3('0x13'),_0x55206e,_0x544bc4),util['format'](_0x81f3('0x14'),_0x55206e,_0x1402aa?'save':_0x81f3('0x15')),_['pick'](_0x53b1a2,attributes));}var rpc={'openchannelQueueReport':require(_0x81f3('0x16')),'mailQueueReport':require(_0x81f3('0x17')),'chatQueueReport':require(_0x81f3('0x18')),'smsQueueReport':require(_0x81f3('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x81f3('0x1a'))};var queue=schema({'name':{'type':_0x81f3('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x81f3('0x1c'),'message':_0x81f3('0x1d')}});function startRouting(_0xbbe1ea,_0x4b8af5,_0x4a4a77,_0x2a12ea){if(_0xbbe1ea&&_0x4b8af5&&_0x4a4a77){_0x4b8af5[_0x81f3('0x1e')]+=0x1;var _0x2ddf6f={'uniqueid':_0xbbe1ea,'from':_0x4a4a77['body']?_0x4a4a77['body'][_0x81f3('0xd')]:'','joinAt':moment()['format'](_0x81f3('0x1f')),'ContactId':_0x4a4a77[_0x81f3('0x20')]?_0x4a4a77['contact']['id']:null,'ListId':_0x4a4a77[_0x81f3('0x21')]?_0x4a4a77[_0x81f3('0x21')]['id']:null};_0x2ddf6f[_[_0x81f3('0x22')](_0x4a4a77[_0x81f3('0x23')])+_0x81f3('0x24')]=_0x4b8af5['id']||null;_0x2ddf6f[_[_0x81f3('0x22')](_0x4a4a77[_0x81f3('0x23')])+_0x81f3('0x25')]=_0x4a4a77[_0x81f3('0x26')]?_0x4a4a77[_0x81f3('0x26')]['id']:null;_0x2ddf6f[_['upperFirst'](_0x4a4a77[_0x81f3('0x23')])+_0x81f3('0x27')]=_0x4a4a77['message']?_0x4a4a77[_0x81f3('0x28')]['id']:null;_0x2ddf6f[_[_0x81f3('0x22')](_0x4a4a77[_0x81f3('0x23')])+(_0x4a4a77[_0x81f3('0x23')]!==_0x81f3('0x29')?'AccountId':_0x81f3('0x2a'))]=_0x4a4a77['account']?_0x4a4a77['account']['id']:null;logger[_0x81f3('0x2b')](util['format'](_0x81f3('0x2c'),_0xbbe1ea,_0x4b8af5['name']));emitChannelQueueInteraction(_0x4a4a77[_0x81f3('0x23')],_0x4b8af5[_0x81f3('0x2d')],_0x2ddf6f,_0x4a4a77[_0x81f3('0xb')][_0x81f3('0x2d')],_0x4a4a77[_0x81f3('0x28')]['id'],!![],_0x2a12ea,_0x4b8af5['id']);if(rpc[_0x4a4a77['channel']+_0x81f3('0x2e')]){return rpc[_0x4a4a77['channel']+_0x81f3('0x2e')][_0x81f3('0x2f')](_0x2ddf6f)[_0x81f3('0x30')](function(_0x23dcce){logger[_0x81f3('0x31')](_0x81f3('0x32'));});}}}function stopRouting(_0x10c22b,_0x471e3e,_0x170c6c,_0x3183cb){if(_0x10c22b&&_0x471e3e){_0x471e3e['waiting']-=0x1;var _0x4ee300={'leaveAt':moment()['format'](_0x81f3('0x1f')),'acceptAt':moment()[_0x81f3('0x10')](_0x81f3('0x1f')),'reason':_0x81f3('0x33')};logger[_0x81f3('0x2b')](util[_0x81f3('0x10')](_0x81f3('0x34'),_0x10c22b,_0x471e3e[_0x81f3('0x2d')]));emitChannelQueueInteraction(_0x170c6c[_0x81f3('0x23')],_0x471e3e[_0x81f3('0x2d')],_0x170c6c[_0x81f3('0x35')],_0x170c6c['account']['name'],_0x170c6c[_0x81f3('0x28')]['id'],![],_0x3183cb,_0x471e3e['id']);if(rpc[_0x170c6c['channel']+'QueueReport']){return rpc[_0x170c6c[_0x81f3('0x23')]+_0x81f3('0x2e')][_0x81f3('0x36')](_0x10c22b,_0x4ee300)[_0x81f3('0x30')](function(_0x12d9ce){logger[_0x81f3('0x31')](_0x81f3('0x37'));});}}}function endRouting(_0x3a709d,_0x1d8aa3,_0x53d786,_0x311c82){if(_0x3a709d&&_0x1d8aa3){_0x1d8aa3['waiting']-=0x1;var _0x53c710={'leaveAt':moment()[_0x81f3('0x10')](_0x81f3('0x1f')),'exitAt':moment()[_0x81f3('0x10')](_0x81f3('0x1f')),'reason':'timeout'};logger[_0x81f3('0x2b')](util[_0x81f3('0x10')](_0x81f3('0x38'),_0x3a709d,_0x1d8aa3[_0x81f3('0x2d')]));emitChannelQueueInteraction(_0x53d786[_0x81f3('0x23')],_0x1d8aa3[_0x81f3('0x2d')],_0x53d786[_0x81f3('0x35')],_0x53d786[_0x81f3('0xb')]['name'],_0x53d786[_0x81f3('0x28')]['id'],![],_0x311c82);if(rpc[_0x53d786[_0x81f3('0x23')]+_0x81f3('0x2e')]){return rpc[_0x53d786[_0x81f3('0x23')]+_0x81f3('0x2e')]['update'](_0x3a709d,_0x53c710)[_0x81f3('0x30')](function(_0x2d4b52){logger[_0x81f3('0x31')](_0x81f3('0x37'));});}}}function handleFindQueue(_0x5966a7){return function(_0xece5d4){return _0xece5d4[_0x81f3('0x2d')][_0x81f3('0x39')]()===_0x5966a7[_0x81f3('0x39')]();};}exports[_0x81f3('0x3a')]=function(_0x1f1282,_0x1ee9a3,_0x43e8c2,_0x25f4b2){return function(_0x25d24f){try{var _0x4f903a={'name':_0x1ee9a3[0x0],'timeout':_0x1ee9a3[0x1]};var _0x2ada45=queue[_0x81f3('0x3b')](_0x4f903a,{'typecast':!![]});if(_0x2ada45['length']){logger[_0x81f3('0x31')](_0x81f3('0x3c'),_0x1f1282,_[_0x81f3('0x3d')](_0x2ada45,_0x81f3('0x28'))['join'](',\x20'));_0x25d24f[_0x81f3('0x3e')]();}else{var _0x16fd08=_[_0x81f3('0x3f')](_0x43e8c2[_0x25f4b2[_0x81f3('0x23')]+_0x81f3('0x40')],handleFindQueue(_0x4f903a[_0x81f3('0x2d')]));if(_0x16fd08){startRouting(_0x1f1282,_0x16fd08,_0x25f4b2,_0x43e8c2);var _0x47f140=(_0x16fd08[_0x81f3('0x41')]||0xa)*0x3e8;var _0x239238=(_0x4f903a[_0x81f3('0x41')]||0x14)*0x3e8;var _0x4cefcb,_0x4770fd;if(_0x47f140>_0x239238){_0x239238=_0x47f140;}var _0x1f9de9=seqqueue['createQueue'](_0x47f140);_0x1f9de9['id']=_0x1f1282;_0x1f9de9[_0x81f3('0x42')]=_0x47f140;_0x1f9de9[_0x81f3('0x43')]=_0x239238;_0x1f9de9[_0x81f3('0x23')]=_0x25f4b2[_0x81f3('0x23')];_0x43e8c2[_0x81f3('0x44')][_0x1f1282]['on'](_0x81f3('0x45'),function(){logger[_0x81f3('0x2b')](_0x81f3('0x46'),_0x1f1282);stopRouting(_0x1f1282,_0x16fd08,_0x25f4b2,_0x43e8c2);clearTimeout(_0x4cefcb);_0x4cefcb=undefined;_0x1f9de9[_0x81f3('0x47')](!![]);if(_0x43e8c2[_0x81f3('0x44')][_0x1f1282]){delete _0x43e8c2[_0x81f3('0x44')][_0x1f1282];}_0x25d24f[_0x81f3('0x3e')]();});_0x43e8c2[_0x81f3('0x44')][_0x1f1282]['on'](_0x81f3('0x48'),function(){if(_0x43e8c2[_0x81f3('0x44')][_0x1f1282]){delete _0x43e8c2[_0x81f3('0x44')][_0x1f1282];}});_0x4cefcb=setTimeout(function(){logger['info'](_0x81f3('0x49'),_0x1f1282);endRouting(_0x1f1282,_0x16fd08,_0x25f4b2,_0x43e8c2);clearTimeout(_0x4cefcb);_0x1f9de9[_0x81f3('0x47')](!![]);_0x25d24f[_0x81f3('0x4a')]();},_0x239238);switch(_0x16fd08[_0x81f3('0x4b')]){case _0x81f3('0x4c'):strategy[_0x81f3('0x4c')](_0x1f9de9,_0x16fd08,_0x43e8c2,_0x25f4b2);break;default:strategy['beepall'](_0x1f9de9,_0x16fd08,_0x43e8c2,_0x25f4b2);}}else{logger[_0x81f3('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1f1282,_0x4f903a[_0x81f3('0x2d')]);_0x25d24f[_0x81f3('0x3e')]();}}}catch(_0x416997){console[_0x81f3('0x4d')](_0x416997);logger[_0x81f3('0x31')](_0x81f3('0x3c'),_0x1f1282,_0x416997[_0x81f3('0x4e')]);_0x25d24f[_0x81f3('0x3e')]();}};}; \ 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 e32e50e..55c11e7 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 _0x0095=['hideNotification','busy','STOP','exports','./util','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x2fe7cb,_0x133204){var _0x3edb82=function(_0x303cd0){while(--_0x303cd0){_0x2fe7cb['push'](_0x2fe7cb['shift']());}};_0x3edb82(++_0x133204);}(_0x0095,0x170));var _0x5009=function(_0x4f38f5,_0x197c21){_0x4f38f5=_0x4f38f5-0x0;var _0xf77def=_0x0095[_0x4f38f5];return _0xf77def;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x5009('0x0'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x24b215,_0x16cb73,_0x5762b5,_0x29f232){this[_0x5009('0x1')]=uuid['v4']();this[_0x5009('0x2')]=_0x24b215;this[_0x5009('0x3')]=_0x16cb73;this[_0x5009('0x4')]=_0x5762b5;this[_0x5009('0x5')]=_0x29f232;this['squeue'][_0x5009('0x6')](this[_0x5009('0x7')][_0x5009('0x8')](this),this[_0x5009('0x9')][_0x5009('0x8')](this));this[_0x5009('0x2')]['on'](_0x5009('0xa'),this[_0x5009('0x9')][_0x5009('0x8')](this));this[_0x5009('0x2')]['on']('drained',this[_0x5009('0xb')][_0x5009('0x8')](this));};Agent['prototype'][_0x5009('0x6')]=function(){this[_0x5009('0x2')][_0x5009('0x6')](this[_0x5009('0x7')]['bind'](this),this[_0x5009('0x9')][_0x5009('0x8')](this));};Agent[_0x5009('0xc')]['handleDrained']=function(){this[_0x5009('0x9')](!![]);};Agent[_0x5009('0xc')]['handleRun']=function(){logger[_0x5009('0xd')](_0x5009('0xe'),this[_0x5009('0x2')]['id'],this[_0x5009('0x3')]['id']);if(_['isNil'](this[_0x5009('0x4')]['agents'][this[_0x5009('0x3')]['id']])){logger['debug'](_0x5009('0xf'),this[_0x5009('0x2')]['id'],this[_0x5009('0x3')]['id']);setTimeout(this[_0x5009('0x6')]['bind'](this),0x3e8);}else{if(this[_0x5009('0x5')][_0x5009('0x10')]||util['isAgentAvailable'](this[_0x5009('0x2')]['id'],this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']],this[_0x5009('0x2')][_0x5009('0x12')],![])){this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']]['busy']=!![];this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']][_0x5009('0x13')]=undefined;util[_0x5009('0x14')](this[_0x5009('0x1')],this[_0x5009('0x2')]['id'],this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']],null,this['routing']);util[_0x5009('0x15')](this[_0x5009('0x2')]['id'],this['realtime']['agents'][this[_0x5009('0x3')]['id']],'RINGING'+(this[_0x5009('0x5')][_0x5009('0x10')]?_0x5009('0x16'):''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x5009('0x2')]['id'],this[_0x5009('0x3')]['id']);setTimeout(this[_0x5009('0x6')][_0x5009('0x8')](this),0x3e8);}}};Agent[_0x5009('0xc')][_0x5009('0x9')]=function(_0x34d172){if(_['isNil'](this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']])){return logger[_0x5009('0xd')](_0x5009('0xf'),this[_0x5009('0x2')]['id'],this[_0x5009('0x3')]['id']);}else{logger[_0x5009('0xd')](_0x5009('0x17'),this[_0x5009('0x2')]['id'],this[_0x5009('0x3')]['id']);util[_0x5009('0x18')](this['notificationId'],this[_0x5009('0x2')]['id'],this[_0x5009('0x4')][_0x5009('0x11')][this['agent']['id']],null,this[_0x5009('0x5')]);this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']][_0x5009('0x19')]=![];this[_0x5009('0x4')][_0x5009('0x11')][this['agent']['id']]['busyQueue']=undefined;util['writeLog'](this[_0x5009('0x2')]['id'],this[_0x5009('0x4')][_0x5009('0x11')][this[_0x5009('0x3')]['id']],_0x34d172?_0x5009('0x1a'):'TIMEOUT');}if(!_0x34d172){setTimeout(this['push'][_0x5009('0x8')](this),0x3e8);}};function agent(_0x5a1b6c,_0x421cb3,_0xd17f98,_0x533940){return new Agent(_0x5a1b6c,_0x421cb3,_0xd17f98,_0x533940);}module[_0x5009('0x1b')]=agent; \ No newline at end of file +var _0x12d7=['handleRun','handleTimeout','drained','handleDrained','bind','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','notificationId','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','squeue','agent'];(function(_0x1cf5c0,_0x1a8a6f){var _0x16efce=function(_0x2ab81b){while(--_0x2ab81b){_0x1cf5c0['push'](_0x1cf5c0['shift']());}};_0x16efce(++_0x1a8a6f);}(_0x12d7,0xda));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x712d('0x0'));var uuid=require('uuid');var util=require(_0x712d('0x1'));var logger=require(_0x712d('0x2'))(_0x712d('0x3'));var Agent=function(_0xfabbe6,_0x56683d,_0x1155b6,_0x2e0c40){this['notificationId']=uuid['v4']();this[_0x712d('0x4')]=_0xfabbe6;this[_0x712d('0x5')]=_0x56683d;this['realtime']=_0x1155b6;this[_0x712d('0x3')]=_0x2e0c40;this['squeue']['push'](this[_0x712d('0x6')]['bind'](this),this['handleTimeout']['bind'](this));this['squeue']['on']('timeout',this[_0x712d('0x7')]['bind'](this));this[_0x712d('0x4')]['on'](_0x712d('0x8'),this[_0x712d('0x9')][_0x712d('0xa')](this));};Agent[_0x712d('0xb')][_0x712d('0xc')]=function(){this[_0x712d('0x4')][_0x712d('0xc')](this['handleRun'][_0x712d('0xa')](this),this[_0x712d('0x7')][_0x712d('0xa')](this));};Agent[_0x712d('0xb')][_0x712d('0x9')]=function(){this[_0x712d('0x7')](!![]);};Agent[_0x712d('0xb')]['handleRun']=function(){logger['debug'](_0x712d('0xd'),this[_0x712d('0x4')]['id'],this['agent']['id']);if(_[_0x712d('0xe')](this[_0x712d('0xf')][_0x712d('0x10')][this[_0x712d('0x5')]['id']])){logger[_0x712d('0x11')](_0x712d('0x12'),this[_0x712d('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x712d('0xc')][_0x712d('0xa')](this),0x3e8);}else{if(this[_0x712d('0x3')][_0x712d('0x13')]||util[_0x712d('0x14')](this[_0x712d('0x4')]['id'],this[_0x712d('0xf')][_0x712d('0x10')][this['agent']['id']],this['squeue'][_0x712d('0x15')],![])){this['realtime']['agents'][this[_0x712d('0x5')]['id']][_0x712d('0x16')]=!![];this['realtime']['agents'][this[_0x712d('0x5')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x712d('0x17')],this[_0x712d('0x4')]['id'],this['realtime'][_0x712d('0x10')][this[_0x712d('0x5')]['id']],null,this[_0x712d('0x3')]);util[_0x712d('0x18')](this[_0x712d('0x4')]['id'],this['realtime']['agents'][this[_0x712d('0x5')]['id']],'RINGING'+(this[_0x712d('0x3')][_0x712d('0x13')]?':FORCED':''));}else{logger['debug'](_0x712d('0x19'),this['squeue']['id'],this[_0x712d('0x5')]['id']);setTimeout(this[_0x712d('0xc')][_0x712d('0xa')](this),0x3e8);}}};Agent[_0x712d('0xb')][_0x712d('0x7')]=function(_0x5c4270){if(_[_0x712d('0xe')](this[_0x712d('0xf')]['agents'][this['agent']['id']])){return logger['debug'](_0x712d('0x12'),this[_0x712d('0x4')]['id'],this[_0x712d('0x5')]['id']);}else{logger['debug'](_0x712d('0x1a'),this['squeue']['id'],this['agent']['id']);util[_0x712d('0x1b')](this['notificationId'],this['squeue']['id'],this[_0x712d('0xf')][_0x712d('0x10')][this[_0x712d('0x5')]['id']],null,this[_0x712d('0x3')]);this[_0x712d('0xf')]['agents'][this[_0x712d('0x5')]['id']]['busy']=![];this[_0x712d('0xf')]['agents'][this[_0x712d('0x5')]['id']][_0x712d('0x1c')]=undefined;util[_0x712d('0x18')](this[_0x712d('0x4')]['id'],this[_0x712d('0xf')][_0x712d('0x10')][this['agent']['id']],_0x5c4270?_0x712d('0x1d'):_0x712d('0x1e'));}if(!_0x5c4270){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x325948,_0x45a8c4,_0x5d0ad9,_0x3be1ca){return new Agent(_0x325948,_0x45a8c4,_0x5d0ad9,_0x3be1ca);}module[_0x712d('0x1f')]=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 ef6c367..9f2f659 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 _0x938c=['handleTimeout','bind','timeout','drained','handleDrained','prototype','isNil','length','Agents','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busyQueue','name','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','lodash','uuid','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun'];(function(_0x33be9d,_0x41618e){var _0x4a9267=function(_0x4f0e70){while(--_0x4f0e70){_0x33be9d['push'](_0x33be9d['shift']());}};_0x4a9267(++_0x41618e);}(_0x938c,0x11f));var _0xc938=function(_0x2014a4,_0x2f186a){_0x2014a4=_0x2014a4-0x0;var _0x751df3=_0x938c[_0x2014a4];return _0x751df3;};'use strict';var _=require(_0xc938('0x0'));var uuid=require(_0xc938('0x1'));var util=require('./util');var logger=require(_0xc938('0x2'))('routing');var Beepall=function(_0x502809,_0x257b7c,_0x48217b,_0x15a960){this[_0xc938('0x3')]=uuid['v4']();this[_0xc938('0x4')]=_0x502809;this[_0xc938('0x5')]=_0x257b7c;this[_0xc938('0x6')]=_0x48217b;this[_0xc938('0x7')]=_0x15a960;this['squeue'][_0xc938('0x8')](this[_0xc938('0x9')]['bind'](this),this[_0xc938('0xa')][_0xc938('0xb')](this));this['squeue']['on'](_0xc938('0xc'),this['handleTimeout']['bind'](this));this[_0xc938('0x4')]['on'](_0xc938('0xd'),this[_0xc938('0xe')]['bind'](this));};Beepall[_0xc938('0xf')][_0xc938('0x8')]=function(){this['squeue'][_0xc938('0x8')](this['handleRun'][_0xc938('0xb')](this),this[_0xc938('0xa')][_0xc938('0xb')](this));};Beepall['prototype'][_0xc938('0xe')]=function(){this[_0xc938('0xa')](!![]);};Beepall[_0xc938('0xf')]['handleRun']=function(){var _0x4bc776=!![];if(!_['isNil'](this[_0xc938('0x5')])&&!_[_0xc938('0x10')](this[_0xc938('0x5')]['Agents'])&&this[_0xc938('0x5')]['Agents'][_0xc938('0x11')]>0x0){for(var _0x4b68be=0x0,_0x5251ed;_0x4b68be0x0){for(var _0x13ee00=0x0,_0x1bfe08;_0x13ee000x0&&_0x4d3e84[_0x5a2492+_0x8eff('0x24')]>=_0x4d3e84[_0x5a2492+_0x8eff('0x22')]){writeLog(_0x1ca2e6,_0x4d3e84,_0x5a2492[_0x8eff('0x25')]()+_0x8eff('0x26'));return![];}}return!![];};exports[_0x8eff('0x27')]=function(_0x6359df,_0x2e8067,_0x516173,_0x3e1607,_0x323ffa){return sendNotification(!![],_0x6359df,_0x2e8067,_0x516173,_0x3e1607,_0x323ffa);};exports[_0x8eff('0x28')]=function(_0xb88ce9,_0x45803c,_0x85cccb,_0x4cc146,_0x4ed3b8){return sendNotification(![],_0xb88ce9,_0x45803c,_0x85cccb,_0x4cc146,_0x4ed3b8);};exports[_0x8eff('0x29')]=writeLog; \ No newline at end of file +var _0xf2ca=['body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','message','user:%s','emit','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','format','name','user:save','split','account','notificationSound','notificationShake'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0xf2ca[_0x264b61];return _0x8fff4f;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var utils=require(_0xaf2c('0x2'));var Redis=require('ioredis');var config=require(_0xaf2c('0x3'));var logger=require(_0xaf2c('0x4'))(_0xaf2c('0x5'));config[_0xaf2c('0x6')]=_[_0xaf2c('0x7')](config[_0xaf2c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xaf2c('0x8'))(new Redis(config[_0xaf2c('0x6')]));function sendNotification(_0x297740,_0x1f9531,_0x58351f,_0x37fedd,_0x3c0421,_0x4a7397){io['to'](util[_0xaf2c('0x9')]('user:%s',_0x37fedd[_0xaf2c('0xa')]))['emit'](_0xaf2c('0xb'),_0x37fedd);var _0x144a7a=_0x4a7397||{};var _0x2e04e5=_0x58351f[_0xaf2c('0xc')]('.');var _0x5ad9b0={'uniqueid':_0x1f9531,'channel':_0x2e04e5[0x0],'id':_0x2e04e5[0x1],'title':_0x2e04e5[0x0]+'\x20interaction','interactionId':_0x2e04e5[0x2],'queue':_0x3c0421?_0x3c0421[_0xaf2c('0xa')]:null,'sound':_0x144a7a[_0xaf2c('0xd')][_0xaf2c('0xe')],'shake':_0x144a7a[_0xaf2c('0xd')][_0xaf2c('0xf')]};try{if(!_0x144a7a['body']){_0x144a7a['body']={};}if(_0x3c0421){_0x144a7a[_0xaf2c('0x10')][_0xaf2c('0x11')]=_0x3c0421;}else if(_0x144a7a[_0xaf2c('0x10')][_0xaf2c('0x11')]){delete _0x144a7a[_0xaf2c('0x10')][_0xaf2c('0x11')];}_0x5ad9b0[_0xaf2c('0x12')]=utils[_0xaf2c('0x13')](_0x144a7a[_0xaf2c('0xd')][_0xaf2c('0x14')],_0x144a7a);}catch(_0x6ac8e){_0x5ad9b0[_0xaf2c('0x12')]=_0xaf2c('0x15');logger[_0xaf2c('0x16')](util[_0xaf2c('0x9')]('[%s][QUEUE]\x20%s',_0x1f9531,_0x6ac8e[_0xaf2c('0x17')]));}io['to'](util['format'](_0xaf2c('0x18'),_0x37fedd[_0xaf2c('0xa')]))[_0xaf2c('0x19')](util['format'](_0xaf2c('0x1a'),_0x297740?_0xaf2c('0x1b'):_0xaf2c('0x1c')),_0x5ad9b0);}function writeLog(_0x20000b,_0x3f977c,_0x1b7f07){return logger['debug'](util[_0xaf2c('0x9')](_0xaf2c('0x1d'),_0x20000b,_0x3f977c[_0xaf2c('0xa')],_0x1b7f07));}exports[_0xaf2c('0x1e')]=function(_0x237318,_0x486de2,_0x396646,_0xbf6f62){if(_0x486de2[_0xaf2c('0x1f')]){writeLog(_0x237318,_0x486de2,'BUSY');return![];}if(!_0x486de2['online']){writeLog(_0x237318,_0x486de2,_0xaf2c('0x20'));return![];}if(_0x486de2[_0x396646+_0xaf2c('0x21')]){writeLog(_0x237318,_0x486de2,_0xaf2c('0x22'));return![];}if(_0xbf6f62&&_0x486de2[_0xaf2c('0x23')](_0x396646+'Capacity')&&_0x486de2[_0xaf2c('0x23')](_0x396646+_0xaf2c('0x24'))){if(_0x486de2[_0x396646+_0xaf2c('0x25')]>0x0&&_0x486de2[_0x396646+_0xaf2c('0x24')]>=_0x486de2[_0x396646+_0xaf2c('0x25')]){writeLog(_0x237318,_0x486de2,_0x396646[_0xaf2c('0x26')]()+_0xaf2c('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x29f8b0,_0x2051be,_0x36f37c,_0x410536,_0x4b7cf2){return sendNotification(!![],_0x29f8b0,_0x2051be,_0x36f37c,_0x410536,_0x4b7cf2);};exports[_0xaf2c('0x28')]=function(_0x589d47,_0x38db1b,_0x42f980,_0x15466b,_0x5d685a){return sendNotification(![],_0x589d47,_0x38db1b,_0x42f980,_0x15466b,_0x5d685a);};exports[_0xaf2c('0x29')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 5307e16..6bb27a2 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 _0x79d3=['isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','body','error'];(function(_0x4e67a8,_0x3d2273){var _0x53dbb3=function(_0x34bd3b){while(--_0x34bd3b){_0x4e67a8['push'](_0x4e67a8['shift']());}};_0x53dbb3(++_0x3d2273);}(_0x79d3,0x179));var _0x379d=function(_0x34105a,_0xb17783){_0x34105a=_0x34105a-0x0;var _0x3c53f9=_0x79d3[_0x34105a];return _0x3c53f9;};'use strict';var schema=require(_0x379d('0x0'));var sh=require(_0x379d('0x1'));var _=require(_0x379d('0x2'));var utils=require(_0x379d('0x3'));var logger=require(_0x379d('0x4'))(_0x379d('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x379d('0x6')}});exports[_0x379d('0x7')]=function(_0x5bf587,_0x4b9fb2){return function(_0x5fba32){try{var _0x18b0be={'command':_0x4b9fb2[0x0]};var _0x2a0f02=system[_0x379d('0x0')](_0x18b0be,{'typecast':!![]});if(_0x2a0f02[_0x379d('0x8')]){logger['error'](_0x379d('0x9'),_0x5bf587,_[_0x379d('0xa')](_0x2a0f02,_0x379d('0xb'))['join'](',\x20'));logger['info'](_0x379d('0xc'),_0x5bf587);_0x5fba32[_0x379d('0xd')]();}else{var _0x55a729=this;var _0x15c47f=utils[_0x379d('0xe')](_0x4b9fb2[0x0],this);logger[_0x379d('0xf')](_0x379d('0x10'),_0x5bf587,_0x15c47f);sh['exec'](_[_0x379d('0x11')](_0x15c47f),function(_0x3396f9,_0x5b86ba){logger[_0x379d('0xf')](_0x379d('0x12'),_0x5bf587,_0x3396f9);if(_0x3396f9==0x0){var _0x4fae63=_0x5b86ba['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x379d('0x13')](_0x4b9fb2[0x1])||_['isEmpty'](_0x4b9fb2[0x1])){logger['info'](_0x379d('0x14'),_0x5bf587);_0x55a729['body'][_0x4b9fb2[0x1]]=_0x4fae63;}else{logger[_0x379d('0xf')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5bf587,_0x4b9fb2[0x1],_0x4fae63);_0x55a729[_0x379d('0x15')][_0x4b9fb2[0x1]]=_0x4fae63;}}_0x5fba32[_0x379d('0xd')]();});}}catch(_0x1afe8e){logger[_0x379d('0x16')](_0x379d('0x9'),_0x5bf587,_[_0x379d('0x17')](_0x1afe8e)?JSON[_0x379d('0x18')](_0x1afe8e):_0x1afe8e);logger[_0x379d('0xf')](_0x379d('0xc'),_0x5bf587);_0x5fba32[_0x379d('0xd')]();}};}; \ No newline at end of file +var _0x6a72=['error','map','message','join','info','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x4f0b7d,_0x515942){var _0x599cf3=function(_0x496712){while(--_0x496712){_0x4f0b7d['push'](_0x4f0b7d['shift']());}};_0x599cf3(++_0x515942);}(_0x6a72,0x118));var _0x26a7=function(_0x3768f3,_0x4a40f1){_0x3768f3=_0x3768f3-0x0;var _0x526a13=_0x6a72[_0x3768f3];return _0x526a13;};'use strict';var schema=require(_0x26a7('0x0'));var sh=require(_0x26a7('0x1'));var _=require(_0x26a7('0x2'));var utils=require('./utils');var logger=require(_0x26a7('0x3'))('routing');var system=schema({'command':{'type':_0x26a7('0x4'),'required':!![],'message':_0x26a7('0x5')}});exports[_0x26a7('0x6')]=function(_0x113515,_0x3c326e){return function(_0x3f8f56){try{var _0x4751bb={'command':_0x3c326e[0x0]};var _0x27c9b0=system['validate'](_0x4751bb,{'typecast':!![]});if(_0x27c9b0[_0x26a7('0x7')]){logger[_0x26a7('0x8')]('[%s][SYSTEM]\x20%s',_0x113515,_[_0x26a7('0x9')](_0x27c9b0,_0x26a7('0xa'))[_0x26a7('0xb')](',\x20'));logger[_0x26a7('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x113515);_0x3f8f56[_0x26a7('0xd')]();}else{var _0x28115a=this;var _0x4a639f=utils['getMustacheRender'](_0x3c326e[0x0],this);logger[_0x26a7('0xc')](_0x26a7('0xe'),_0x113515,_0x4a639f);sh[_0x26a7('0xf')](_['trim'](_0x4a639f),function(_0x1d16e1,_0x3460ca){logger[_0x26a7('0xc')](_0x26a7('0x10'),_0x113515,_0x1d16e1);if(_0x1d16e1==0x0){var _0x193766=_0x3460ca['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x26a7('0x11')](_0x3c326e[0x1])||_['isEmpty'](_0x3c326e[0x1])){logger[_0x26a7('0xc')](_0x26a7('0x12'),_0x113515);_0x28115a[_0x26a7('0x13')][_0x3c326e[0x1]]=_0x193766;}else{logger[_0x26a7('0xc')](_0x26a7('0x14'),_0x113515,_0x3c326e[0x1],_0x193766);_0x28115a[_0x26a7('0x13')][_0x3c326e[0x1]]=_0x193766;}}_0x3f8f56[_0x26a7('0xd')]();});}}catch(_0x399795){logger[_0x26a7('0x8')](_0x26a7('0x15'),_0x113515,_[_0x26a7('0x16')](_0x399795)?JSON[_0x26a7('0x17')](_0x399795):_0x399795);logger[_0x26a7('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x113515);_0x3f8f56[_0x26a7('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 994a10b..a97490b 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 _0xd823=['validate','length','error','[%s][TAG]\x20%s','map','message','info','next','channel','Interaction','interaction','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xd823,0x143));var _0x3d82=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0xd823[_0x28fbe3];return _0x45db6a;};'use strict';var schema=require('validate');var _=require(_0x3d82('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3d82('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x3d82('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x3d82('0x3'))(_0x3d82('0x4'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x3d82('0x5')}});exports[_0x3d82('0x6')]=function(_0x5dbb94,_0x225225,_0x7d424c,_0x2a8df){return function(_0x5cdb56){try{var _0x17e528={'tag':_0x225225[0x0]};var _0x4da043=tag[_0x3d82('0x7')](_0x17e528,{'typecast':!![]});if(_0x4da043[_0x3d82('0x8')]){logger[_0x3d82('0x9')](_0x3d82('0xa'),_0x5dbb94,_[_0x3d82('0xb')](_0x4da043,_0x3d82('0xc'))['join'](',\x20'));logger[_0x3d82('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5dbb94);_0x5cdb56[_0x3d82('0xe')]();}else{var _0x2e1728={'ids':[_0x225225[0x0]]};if(rpc[_0x2a8df[_0x3d82('0xf')]+_0x3d82('0x10')]){rpc[_0x2a8df[_0x3d82('0xf')]+_0x3d82('0x10')]['addTags'](_0x2a8df[_0x3d82('0x11')]['id'],_0x2e1728)['then'](function(_0x34bef9){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x5dbb94,_0x225225[0x1],_0x2a8df[_0x3d82('0xf')],_0x2a8df['interaction']['id']);})['catch'](function(_0x168a0e){logger['error'](_0x3d82('0xa'),_0x5dbb94,JSON[_0x3d82('0x12')](_0x168a0e));logger[_0x3d82('0xd')](_0x3d82('0x13'),_0x5dbb94);})[_0x3d82('0x14')](function(){_0x5cdb56['next']();});}}}catch(_0x434217){logger['error'](_0x3d82('0xa'),_0x5dbb94,_[_0x3d82('0x15')](_0x434217)?JSON['stringify'](_0x434217):_0x434217);logger[_0x3d82('0xd')](_0x3d82('0x13'),_0x5dbb94);_0x5cdb56['next']();}};}; \ No newline at end of file +var _0x25b5=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','../../rpc/chatInteraction'];(function(_0x489ad5,_0x2937b2){var _0x44d8b3=function(_0x78def8){while(--_0x78def8){_0x489ad5['push'](_0x489ad5['shift']());}};_0x44d8b3(++_0x2937b2);}(_0x25b5,0xf8));var _0x525b=function(_0x5fc6c3,_0x3b4a0){_0x5fc6c3=_0x5fc6c3-0x0;var _0x49c48a=_0x25b5[_0x5fc6c3];return _0x49c48a;};'use strict';var schema=require(_0x525b('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x525b('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x525b('0x2')),'mailInteraction':require(_0x525b('0x3')),'faxInteraction':require(_0x525b('0x4')),'whatsappInteraction':require(_0x525b('0x5'))};var logger=require(_0x525b('0x6'))(_0x525b('0x7'));var tag=schema({'tag':{'type':_0x525b('0x8'),'required':!![],'message':_0x525b('0x9')}});exports[_0x525b('0xa')]=function(_0x3cb781,_0x696afb,_0x4e2234,_0x555975){return function(_0x505a60){try{var _0xd2fce2={'tag':_0x696afb[0x0]};var _0x1354a8=tag[_0x525b('0x0')](_0xd2fce2,{'typecast':!![]});if(_0x1354a8['length']){logger[_0x525b('0xb')](_0x525b('0xc'),_0x3cb781,_['map'](_0x1354a8,_0x525b('0xd'))['join'](',\x20'));logger[_0x525b('0xe')](_0x525b('0xf'),_0x3cb781);_0x505a60[_0x525b('0x10')]();}else{var _0x1023c9={'ids':[_0x696afb[0x0]]};if(rpc[_0x555975[_0x525b('0x11')]+_0x525b('0x12')]){rpc[_0x555975[_0x525b('0x11')]+_0x525b('0x12')][_0x525b('0x13')](_0x555975[_0x525b('0x14')]['id'],_0x1023c9)['then'](function(_0x159d22){logger['info'](_0x525b('0x15'),_0x3cb781,_0x696afb[0x1],_0x555975[_0x525b('0x11')],_0x555975['interaction']['id']);})[_0x525b('0x16')](function(_0x2dac80){logger[_0x525b('0xb')](_0x525b('0xc'),_0x3cb781,JSON[_0x525b('0x17')](_0x2dac80));logger[_0x525b('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3cb781);})[_0x525b('0x18')](function(){_0x505a60[_0x525b('0x10')]();});}}}catch(_0x1a9bca){logger[_0x525b('0xb')]('[%s][TAG]\x20%s',_0x3cb781,_['isObject'](_0x1a9bca)?JSON[_0x525b('0x17')](_0x1a9bca):_0x1a9bca);logger['info'](_0x525b('0xf'),_0x3cb781);_0x505a60[_0x525b('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 1e196d8..e685a80 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 _0xd4b0=['next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','params','stringify','utf8','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','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'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xd4b0,0x8d));var _0x0d4b=function(_0x1c4869,_0x47198d){_0x1c4869=_0x1c4869-0x0;var _0x214119=_0xd4b0[_0x1c4869];return _0x214119;};'use strict';var rp=require(_0x0d4b('0x0'));var logger=require(_0x0d4b('0x1'))(_0x0d4b('0x2'));var _=require('lodash');var arr=[];exports[_0x0d4b('0x3')]=function(_0x15c7df,_0x177988){return function(_0x428525){var _0x5b3ad5=_0x177988[0xa];var _0xd92fd9=_0x177988[0xb];var _0x5344f1=_0x177988[0xc];var _0x2ceccd=_0x177988[0xd];var _0x15ad4e=_0x177988[0xe];var _0x20d67f=_0x177988[0xf]['replace'](/\n/g,_0x0d4b('0x4'));var _0x26bbcd=_0x177988[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x0d4b('0x5')](_0xd92fd9)){arr[_0x0d4b('0x6')](_0xd92fd9);var _0x2faeed=_0x177988[0x3];var _0x8cc0e3=_0x177988[0x4];var _0x4dead6=_0x177988[0x1];var _0x443f8a=_0x177988[0x0];var _0x27e23b={};_0x27e23b[_0x0d4b('0x7')]=_0x177988[0x8]+_0x0d4b('0x8')+_0x5344f1+'|'+_0x5b3ad5+'|'+_0x2ceccd+'|'+_0xd92fd9+'|'+_0x15ad4e;_0x27e23b[_0x0d4b('0x9')]=_0x177988[0x7]+_0x0d4b('0x8')+_0x5344f1+'|'+_0x5b3ad5+'|'+_0x2ceccd+'|'+_0xd92fd9+'|'+_0x15ad4e+'|'+_0x20d67f+'|'+_0x26bbcd;_0x27e23b[_0x0d4b('0xa')]=_0x177988[0x9];var _0x30ec40={};_0x30ec40[_0x0d4b('0xb')]='2.0';_0x30ec40[_0x0d4b('0xc')]=_0x0d4b('0xd');var _0x58f0e6=[];_0x58f0e6[_0x0d4b('0x6')](_0x177988[0x2]);_0x58f0e6[_0x0d4b('0x6')](_0x177988[0x5]);_0x58f0e6[_0x0d4b('0x6')](_0x177988[0x6]);_0x30ec40[_0x0d4b('0xe')]=_0x58f0e6;_0x30ec40['id']=0x1;var _0x21b2b5=JSON[_0x0d4b('0xf')](_0x30ec40);var _0x28e1fc={'encoding':_0x0d4b('0x10'),'method':_0x0d4b('0x11'),'timeout':0x2710,'url':_0x2faeed,'headers':{'Content-Type':'application/json-rpc'},'body':_0x21b2b5};return rp(_0x28e1fc)[_0x0d4b('0x12')](function(_0xaf80b0){const _0x507275=JSON[_0x0d4b('0x13')](_0xaf80b0);if(!_0x507275[_0x0d4b('0x14')][_0x0d4b('0x15')]){throw new Error(_0x0d4b('0x16'));}var _0x512478=_0xd92fd9;var _0x211371=_0x0d4b('0x17')+_0x4dead6+_0x0d4b('0x18')+_0x443f8a+_0x0d4b('0x19')+_0x512478+'&data='+JSON[_0x0d4b('0xf')](_0x27e23b);var _0x18a65d=_0x8cc0e3+'?'+_0x211371;return rp(_0x18a65d);})[_0x0d4b('0x12')](function(_0x4edda0){logger[_0x0d4b('0x1a')](_0x0d4b('0x1b'),_0x15c7df,_0x4edda0);_0x428525[_0x0d4b('0x1c')]();})[_0x0d4b('0x1d')](function(_0x2f5840){logger[_0x0d4b('0x1e')](_0x0d4b('0x1f'),_0x15c7df,_[_0x0d4b('0x20')](_0x2f5840)?JSON[_0x0d4b('0xf')](_0x2f5840):_0x2f5840);_0x428525['stop']();});}else{logger['info'](_0x0d4b('0x21'),_0x15c7df);_0x428525[_0x0d4b('0x22')]();}};}; \ No newline at end of file +var _0x725b=['&serviceId=','&sessionId=','&data=','info','catch','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','push','title','jsonrpc','2.0','params','stringify','utf8','POST','then','parse','logged','channelId='];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x725b,0x173));var _0xb725=function(_0x2d99d4,_0x32db5a){_0x2d99d4=_0x2d99d4-0x0;var _0x137524=_0x725b[_0x2d99d4];return _0x137524;};'use strict';var rp=require(_0xb725('0x0'));var logger=require(_0xb725('0x1'))(_0xb725('0x2'));var _=require(_0xb725('0x3'));var arr=[];exports['consequence']=function(_0x1e4dd0,_0x5eb678){return function(_0x96257a){var _0x59e8a2=_0x5eb678[0xa];var _0x4fb5f1=_0x5eb678[0xb];var _0x4a2b3e=_0x5eb678[0xc];var _0x198857=_0x5eb678[0xd];var _0x2fd844=_0x5eb678[0xe];var _0x59d19e=_0x5eb678[0xf]['replace'](/\n/g,_0xb725('0x4'));var _0x566914=_0x5eb678[0x10][_0xb725('0x5')](/\n/g,'\x20');if(!arr[_0xb725('0x6')](_0x4fb5f1)){arr[_0xb725('0x7')](_0x4fb5f1);var _0x400373=_0x5eb678[0x3];var _0x1e046e=_0x5eb678[0x4];var _0x12f6b1=_0x5eb678[0x1];var _0x3c94b4=_0x5eb678[0x0];var _0x216fe6={};_0x216fe6['urlOnAnswer']=_0x5eb678[0x8]+'?params='+_0x4a2b3e+'|'+_0x59e8a2+'|'+_0x198857+'|'+_0x4fb5f1+'|'+_0x2fd844;_0x216fe6['urlOnRing']=_0x5eb678[0x7]+'?params='+_0x4a2b3e+'|'+_0x59e8a2+'|'+_0x198857+'|'+_0x4fb5f1+'|'+_0x2fd844+'|'+_0x59d19e+'|'+_0x566914;_0x216fe6[_0xb725('0x8')]=_0x5eb678[0x9];var _0x41b622={};_0x41b622[_0xb725('0x9')]=_0xb725('0xa');_0x41b622['method']='login';var _0x213f32=[];_0x213f32[_0xb725('0x7')](_0x5eb678[0x2]);_0x213f32[_0xb725('0x7')](_0x5eb678[0x5]);_0x213f32[_0xb725('0x7')](_0x5eb678[0x6]);_0x41b622[_0xb725('0xb')]=_0x213f32;_0x41b622['id']=0x1;var _0x424e2d=JSON[_0xb725('0xc')](_0x41b622);var _0x2f46d3={'encoding':_0xb725('0xd'),'method':_0xb725('0xe'),'timeout':0x2710,'url':_0x400373,'headers':{'Content-Type':'application/json-rpc'},'body':_0x424e2d};return rp(_0x2f46d3)[_0xb725('0xf')](function(_0x34f466){const _0x2ea82c=JSON[_0xb725('0x10')](_0x34f466);if(!_0x2ea82c['result'][_0xb725('0x11')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x635699=_0x4fb5f1;var _0x59dd3b=_0xb725('0x12')+_0x12f6b1+_0xb725('0x13')+_0x3c94b4+_0xb725('0x14')+_0x635699+_0xb725('0x15')+JSON[_0xb725('0xc')](_0x216fe6);var _0x1ca251=_0x1e046e+'?'+_0x59dd3b;return rp(_0x1ca251);})[_0xb725('0xf')](function(_0x3e90b4){logger[_0xb725('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1e4dd0,_0x3e90b4);_0x96257a['stop']();})[_0xb725('0x17')](function(_0x30b3ea){logger[_0xb725('0x18')](_0xb725('0x19'),_0x1e4dd0,_[_0xb725('0x1a')](_0x30b3ea)?JSON[_0xb725('0xc')](_0x30b3ea):_0x30b3ea);_0x96257a[_0xb725('0x1b')]();});}else{logger['info'](_0xb725('0x1c'),_0x1e4dd0);_0x96257a[_0xb725('0x1d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 873f2a0..1479bf5 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x558578,_0x474c27){var _0x55b75e=function(_0x2226e4){while(--_0x2226e4){_0x558578['push'](_0x558578['shift']());}};_0x55b75e(++_0x474c27);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x3c50d6,_0x5911ef){var _0xd01d68=function(_0x5857f6){while(--_0x5857f6){_0x3c50d6['push'](_0x3c50d6['shift']());}};_0xd01d68(++_0x5911ef);}(_0xe706,0xa3));var _0x6e70=function(_0x3768f3,_0x4a40f1){_0x3768f3=_0x3768f3-0x0;var _0x526a13=_0xe706[_0x3768f3];return _0x526a13;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index bdf9ec8..04b2f54 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 _0x9b87=['routing\x20is\x20empty','agent','agents','busyQueue','channel','end','QueueReport','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','IntervalId','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','tvox','getMustacheRender','account','ChatWebsiteId','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','emit','complete','No\x20applications\x20to\x20execute','stack'];(function(_0x1a8eb0,_0x4380f4){var _0xec7ffc=function(_0x3ca41f){while(--_0x3ca41f){_0x1a8eb0['push'](_0x1a8eb0['shift']());}};_0xec7ffc(++_0x4380f4);}(_0x9b87,0x8e));var _0x79b8=function(_0x27bf93,_0x70e684){_0x27bf93=_0x27bf93-0x0;var _0x33f008=_0x9b87[_0x27bf93];return _0x33f008;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var path=require(_0x79b8('0x2'));var fs=require('fs');var jayson=require(_0x79b8('0x3'));var BPromise=require(_0x79b8('0x4'));var utils=require(_0x79b8('0x5'));var logger=require(_0x79b8('0x6'))(_0x79b8('0x7'));var rpc={'openchannelQueueReport':require(_0x79b8('0x8')),'mailQueueReport':require(_0x79b8('0x9')),'chatQueueReport':require(_0x79b8('0xa')),'smsQueueReport':require(_0x79b8('0xb')),'faxQueueReport':require(_0x79b8('0xc')),'whatsappQueueReport':require(_0x79b8('0xd'))};var RuleEngine=require(_0x79b8('0xe'));function getId(_0xf5e0f2,_0x5e10fe,_0x4e0dd8){return util['format']('%s.%s.%s',_0xf5e0f2,_0x5e10fe||0x0,_0x4e0dd8||0x0);}function getIntervals(_0x1caae2,_0x317e29){var _0x2f3453=[];if(!_['isNil'](_0x317e29[_0x79b8('0xf')])&&!_[_0x79b8('0x10')](_0x1caae2[_0x317e29[_0x79b8('0xf')]])&&!_['isNil'](_0x1caae2[_0x317e29['IntervalId']][_0x79b8('0x11')])){_0x2f3453=_[_0x79b8('0x12')](_0x1caae2[_0x317e29[_0x79b8('0xf')]][_0x79b8('0x11')],_0x79b8('0x13'));}else if(!_[_0x79b8('0x10')](_0x317e29[_0x79b8('0x13')])){_0x2f3453=[_0x317e29[_0x79b8('0x13')]];}return _0x2f3453;}exports[_0x79b8('0x14')]=function(_0x1614fe){_0x1614fe[_0x79b8('0x15')]={};return new BPromise(function(_0x59e229,_0x150fb7){var _0x4d5cd7={'Start':function(_0x565b54){var _0x3142e9=this;return new Promise(function(_0x21aae0,_0x57a248){if(_0x565b54){try{var _0x5ddab5=[];var _0x3e3de3=getId(_0x565b54['channel'],_0x565b54['message']?_0x565b54[_0x79b8('0x16')]['id']:0x0,_0x565b54[_0x79b8('0x17')]?_0x565b54[_0x79b8('0x17')]['id']:0x0);if(_0x565b54[_0x79b8('0x18')]&&_[_0x79b8('0x19')](_0x565b54[_0x79b8('0x18')])&&_0x565b54['applications'][_0x79b8('0x1a')]){for(var _0x5bdfb9=0x0;_0x5bdfb9<_0x565b54['applications'][_0x79b8('0x1a')];_0x5bdfb9+=0x1){var _0x131d04=_0x565b54[_0x79b8('0x18')][_0x5bdfb9];if(fs[_0x79b8('0x1b')](path[_0x79b8('0x1c')](__dirname,_0x79b8('0x18'),_0x131d04[_0x79b8('0x1d')]+_0x79b8('0x1e')))){var _0x2e1a65=[];switch(_0x131d04['app'][_0x79b8('0x1f')]()){case _0x79b8('0x20'):var _0x4dbfcf=_0x131d04[_0x79b8('0x21')][_0x79b8('0x22')](',');if(_0x565b54['channel']===_0x79b8('0x23')){_0x2e1a65['push'](_0x4dbfcf[0x0]);_0x2e1a65['push'](_0x4dbfcf[0x1]);_0x2e1a65[_0x79b8('0x24')](_0x4dbfcf[_0x79b8('0x25')](0x2,_0x4dbfcf[_0x79b8('0x1a')])[_0x79b8('0x1c')](','));}else{_0x2e1a65[_0x79b8('0x24')](_0x4dbfcf[0x0]);_0x2e1a65['push'](_0x4dbfcf[_0x79b8('0x25')](0x1,_0x4dbfcf[_0x79b8('0x1a')])[_0x79b8('0x1c')](','));}break;case _0x79b8('0x26'):var _0x4bbbf8=_0x131d04[_0x79b8('0x21')][_0x79b8('0x22')](',');_0x2e1a65[_0x79b8('0x24')](_0x4bbbf8[0x0]);_0x2e1a65['push'](_0x4bbbf8[0x1]);_0x2e1a65[_0x79b8('0x24')](_0x4bbbf8[_0x79b8('0x25')](0x2,_0x4bbbf8[_0x79b8('0x1a')])[_0x79b8('0x1c')](','));break;case _0x79b8('0x27'):var _0x23483f=_0x131d04['appdata'][_0x79b8('0x22')](',');_0x2e1a65['push'](_0x23483f[0x0]);_0x2e1a65[_0x79b8('0x24')](_0x23483f[0x1]);_0x2e1a65['push'](_0x23483f[0x2]);_0x2e1a65[_0x79b8('0x24')](_0x23483f[0x3]);_0x2e1a65[_0x79b8('0x24')](_0x23483f[_0x79b8('0x25')](0x4,_0x23483f['length'])[_0x79b8('0x1c')](','));break;case _0x79b8('0x28'):var _0x252472=_0x131d04[_0x79b8('0x21')]['split'](',');_0x2e1a65[_0x79b8('0x24')](_0x252472[0x0]);_0x2e1a65['push'](_0x252472[0x1]);_0x2e1a65['push'](_0x252472[0x2]);_0x2e1a65[_0x79b8('0x24')](_0x252472[0x3]);_0x2e1a65[_0x79b8('0x24')](_0x252472['slice'](0x4,_0x252472[_0x79b8('0x1a')])['join'](','));break;case'message':_0x2e1a65[_0x79b8('0x24')](_0x131d04['appdata']);break;case _0x79b8('0x29'):_0x2e1a65[_0x79b8('0x24')](_0x131d04['TagId']);_0x2e1a65[_0x79b8('0x24')](_0x131d04[_0x79b8('0x21')]);break;case _0x79b8('0x2a'):var _0x1e5bd9=utils[_0x79b8('0x2b')](_0x565b54[_0x79b8('0x2c')]['notificationTemplate'],_0x565b54);var _0x2ed1a3=_0x131d04[_0x79b8('0x21')][_0x79b8('0x22')](',');_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x0]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x1]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x2]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x3]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x4]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x5]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x6]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x7]);_0x2e1a65['push'](_0x2ed1a3[0x8]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0x9]);_0x2e1a65[_0x79b8('0x24')](_0x2ed1a3[0xa]);_0x2e1a65[_0x79b8('0x24')](_0x565b54['interaction']['id']);_0x2e1a65[_0x79b8('0x24')](_0x565b54[_0x79b8('0x16')]['id']);_0x2e1a65[_0x79b8('0x24')](_0x131d04[_0x79b8('0x2d')]);_0x2e1a65[_0x79b8('0x24')](_0x565b54[_0x79b8('0x17')]['ContactId']);_0x2e1a65[_0x79b8('0x24')](_0x565b54['body']['body']);_0x2e1a65[_0x79b8('0x24')](_0x1e5bd9);break;default:_0x2e1a65=_['isNil'](_0x131d04['appdata'])?[]:_0x131d04[_0x79b8('0x21')][_0x79b8('0x22')](',');}var _0x422c56={'id':util[_0x79b8('0x2e')](_0x79b8('0x2f'),_0x3e3de3,_0x131d04['id'],_0x131d04[_0x79b8('0x1d')]),'condition':require(_0x79b8('0x30'))[_0x79b8('0x31')](_0x3e3de3,getIntervals(_0x1614fe[_0x79b8('0x32')],_0x131d04),_0x1614fe),'consequence':require(_0x79b8('0x33')+_0x131d04[_0x79b8('0x1d')])[_0x79b8('0x34')](_0x3e3de3,_0x2e1a65,_0x1614fe,_0x565b54),'p':_0x131d04[_0x79b8('0x35')]||0x0};logger['info'](_0x79b8('0x36'),_0x422c56['id'],_0x79b8('0x37'),getIntervals(_0x1614fe['intervals'],_0x131d04)[_0x79b8('0x1c')](_0x79b8('0x38')));_0x5ddab5['push'](_0x422c56);}else{logger[_0x79b8('0x39')](_0x79b8('0x3a'),path[_0x79b8('0x1c')](__dirname,_0x79b8('0x18'),_0x131d04[_0x79b8('0x1d')]+_0x79b8('0x1e')));}}_0x1614fe[_0x79b8('0x15')][_0x3e3de3]=new RuleEngine(_0x5ddab5);_0x1614fe[_0x79b8('0x15')][_0x3e3de3][_0x79b8('0x3b')](_0x565b54,function(_0x37ca43){logger[_0x79b8('0x3c')](_0x79b8('0x3d'),JSON['stringify'](_0x37ca43['matchPath']));if(_0x1614fe[_0x79b8('0x15')][_0x3e3de3]){_0x1614fe[_0x79b8('0x15')][_0x3e3de3][_0x79b8('0x3e')](_0x79b8('0x3f'));}});return _0x21aae0({'code':0xc8,'message':_0x565b54});}else{logger['info'](_0x79b8('0x40'));return _0x21aae0({'code':0xc8,'message':_0x565b54});}}catch(_0x45d7d7){logger[_0x79b8('0x39')](_0x45d7d7[_0x79b8('0x41')]);return _0x57a248(_0x3142e9['error'](0x1f4,_0x45d7d7));}}return _0x57a248(_0x79b8('0x42'));});},'AcceptMessage':function(_0xa52611){var _0x18176e=this;return new Promise(function(_0x24297e,_0x49d365){if(_0xa52611[_0x79b8('0x43')]&&_0xa52611[_0x79b8('0x43')]['id']){if(_0x1614fe[_0x79b8('0x44')][_0xa52611[_0x79b8('0x43')]['id']]){_0x1614fe[_0x79b8('0x44')][_0xa52611[_0x79b8('0x43')]['id']]['busy']=![];_0x1614fe[_0x79b8('0x44')][_0xa52611[_0x79b8('0x43')]['id']][_0x79b8('0x45')]=undefined;}}if(_0xa52611[_0x79b8('0x16')]&&_0xa52611['message']['id']){try{var _0x49ec63=getId(_0xa52611[_0x79b8('0x46')],_0xa52611[_0x79b8('0x16')]?_0xa52611[_0x79b8('0x16')]['id']:0x0,_0xa52611[_0x79b8('0x17')]?_0xa52611[_0x79b8('0x17')]['id']:0x0);if(_0x1614fe[_0x79b8('0x15')][_0x49ec63]){_0x1614fe[_0x79b8('0x15')][_0x49ec63][_0x79b8('0x3e')](_0x79b8('0x47'));if(rpc[_0xa52611['channel']+_0x79b8('0x48')]){rpc[_0xa52611[_0x79b8('0x46')]+_0x79b8('0x48')]['update'](_0x49ec63,{'UserId':_0xa52611[_0x79b8('0x16')]['UserId']})['catch'](function(){logger[_0x79b8('0x39')](_0x79b8('0x49'));});}}return _0x24297e({'code':0xc8,'message':_0xa52611});}catch(_0x5b4d56){logger[_0x79b8('0x39')](_0x5b4d56['stack']);return _0x49d365(_0x18176e['error'](0x1f4,_0x5b4d56));}}logger[_0x79b8('0x39')](_0x79b8('0x4a'));return _0x49d365(_0x18176e[_0x79b8('0x39')](0x1f4,_0x79b8('0x4a')));});},'RejectMessage':function(_0x2ff973){var _0xcfb9c2=this;return new Promise(function(_0x3f3ffc,_0x3d1078){if(_0x2ff973[_0x79b8('0x43')]&&_0x2ff973[_0x79b8('0x43')]['id']){try{if(_0x1614fe[_0x79b8('0x44')][_0x2ff973[_0x79b8('0x43')]['id']]){_0x1614fe[_0x79b8('0x44')][_0x2ff973[_0x79b8('0x43')]['id']]['busy']=![];_0x1614fe[_0x79b8('0x44')][_0x2ff973[_0x79b8('0x43')]['id']][_0x79b8('0x45')]=undefined;}return _0x3f3ffc({'code':0xc8,'message':_0x2ff973});}catch(_0x2bbe40){logger['error'](_0x2bbe40['stack']);return _0x3d1078(_0xcfb9c2[_0x79b8('0x39')](0x1f4,_0x2bbe40));}}logger[_0x79b8('0x39')](_0x79b8('0x4a'));return _0x3d1078(_0xcfb9c2[_0x79b8('0x39')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x34e57f){var _0x2dd536=this;return new Promise(function(_0x58c737,_0x8e0f70){if(_0x34e57f[_0x79b8('0x46')]&&_0x34e57f[_0x79b8('0x17')]&&_0x34e57f['interaction']['id']){try{var _0x152a80=getId(_0x34e57f['channel'],_0x34e57f[_0x79b8('0x16')]?_0x34e57f[_0x79b8('0x16')]['id']:0x0,_0x34e57f[_0x79b8('0x17')]?_0x34e57f[_0x79b8('0x17')]['id']:0x0);if(_0x1614fe[_0x79b8('0x15')][_0x152a80]){_0x1614fe[_0x79b8('0x15')][_0x152a80][_0x79b8('0x3e')](_0x79b8('0x47'));}return _0x58c737({'code':0xc8,'message':_0x34e57f});}catch(_0xe0d55d){logger[_0x79b8('0x39')](_0xe0d55d['stack']);return _0x8e0f70(_0x2dd536[_0x79b8('0x39')](0x1f4,_0xe0d55d));}}logger['error'](_0x79b8('0x4a'));return _0x8e0f70(_0x2dd536['error'](0x1f4,_0x79b8('0x4a')));});},'AgentCapacity':function(_0x13a87f){var _0x4146b0=this;return new Promise(function(_0x20b2f3,_0x2fcd4e){if(_0x1614fe[_0x79b8('0x44')][_0x79b8('0x4b')](_0x13a87f['id'])){for(var _0x57d73d in _0x13a87f[_0x79b8('0x4c')]){if(_0x13a87f[_0x79b8('0x4c')][_0x79b8('0x4b')](_0x57d73d)){if(_0x1614fe[_0x79b8('0x44')][_0x13a87f['id']][_0x79b8('0x4b')](_0x57d73d+_0x79b8('0x4d'))){_0x1614fe['agents'][_0x13a87f['id']][_0x57d73d+_0x79b8('0x4d')]=parseInt(_0x13a87f[_0x79b8('0x4c')][_0x57d73d],0xa);}}}_0x1614fe['agents'][_0x13a87f['id']][_0x79b8('0x4e')]();return _0x20b2f3({'code':0xc8,'message':_0x1614fe['agents'][_0x13a87f['id']]});}else{return _0x2fcd4e(_0x4146b0[_0x79b8('0x39')](0x1f4,_0x79b8('0x4f')));}});},'Agents':function(_0x5bcdde){return new Promise(function(_0xecf12a){var _0x11c26a=_['values'](_0x1614fe[_0x79b8('0x44')]);if(_0x5bcdde&&_0x5bcdde['id']){var _0x4b197b=_[_0x79b8('0x50')](_0x11c26a,function(_0x5d2bfc){return _0x5d2bfc['id']===_0x5bcdde['id'];});_0xecf12a(_0x4b197b);}else{_0xecf12a({'count':_0x11c26a[_0x79b8('0x1a')],'rows':_0x11c26a});}});},'ChatQueues':function(){return new Promise(function(_0x1e101d){var _0x41f243=[];for(var _0x26722c in _0x1614fe[_0x79b8('0x51')]){if(_0x1614fe[_0x79b8('0x51')]['hasOwnProperty'](_0x26722c)){var _0x291ef1=_0x1614fe[_0x79b8('0x51')][_0x26722c];var _0x5c02a7={'id':_0x291ef1['id'],'available':_0x291ef1['available'],'loggedIn':_0x291ef1[_0x79b8('0x52')],'name':_0x291ef1[_0x79b8('0x53')],'paused':_0x291ef1['paused'],'waiting':_0x291ef1[_0x79b8('0x54')]};_0x41f243[_0x79b8('0x24')](_0x5c02a7);}}_0x1e101d({'count':_0x41f243[_0x79b8('0x1a')],'rows':_0x41f243});});},'MailQueues':function(){return new Promise(function(_0x57787f){var _0x1a15ac=[];for(var _0x1f98ea in _0x1614fe[_0x79b8('0x55')]){if(_0x1614fe[_0x79b8('0x55')][_0x79b8('0x4b')](_0x1f98ea)){var _0x441aad=_0x1614fe['mailQueues'][_0x1f98ea];var _0x33d1f6={'id':_0x441aad['id'],'available':_0x441aad[_0x79b8('0x56')],'loggedIn':_0x441aad[_0x79b8('0x52')],'name':_0x441aad['name'],'paused':_0x441aad[_0x79b8('0x57')],'waiting':_0x441aad[_0x79b8('0x54')]};_0x1a15ac[_0x79b8('0x24')](_0x33d1f6);}}_0x57787f({'count':_0x1a15ac['length'],'rows':_0x1a15ac});});},'OpenchannelQueues':function(){return new Promise(function(_0xfd5147){var _0x2e3b8c=[];for(var _0x4f47e9 in _0x1614fe['openchannelQueues']){if(_0x1614fe[_0x79b8('0x58')][_0x79b8('0x4b')](_0x4f47e9)){var _0x172532=_0x1614fe[_0x79b8('0x58')][_0x4f47e9];var _0xd39bc0={'id':_0x172532['id'],'available':_0x172532[_0x79b8('0x56')],'loggedIn':_0x172532[_0x79b8('0x52')],'name':_0x172532[_0x79b8('0x53')],'paused':_0x172532['paused'],'waiting':_0x172532[_0x79b8('0x54')]};_0x2e3b8c['push'](_0xd39bc0);}}_0xfd5147({'count':_0x2e3b8c['length'],'rows':_0x2e3b8c});});},'SmsQueues':function(){return new Promise(function(_0xbb092e){var _0x54e855=[];for(var _0x3cd784 in _0x1614fe[_0x79b8('0x59')]){if(_0x1614fe[_0x79b8('0x59')]['hasOwnProperty'](_0x3cd784)){var _0x7795d5=_0x1614fe[_0x79b8('0x59')][_0x3cd784];var _0xcd4ac5={'id':_0x7795d5['id'],'available':_0x7795d5[_0x79b8('0x56')],'loggedIn':_0x7795d5[_0x79b8('0x52')],'name':_0x7795d5[_0x79b8('0x53')],'paused':_0x7795d5[_0x79b8('0x57')],'waiting':_0x7795d5[_0x79b8('0x54')]};_0x54e855[_0x79b8('0x24')](_0xcd4ac5);}}_0xbb092e({'count':_0x54e855[_0x79b8('0x1a')],'rows':_0x54e855});});},'FaxQueues':function(){return new Promise(function(_0x3c6ad8){var _0x65f178=[];for(var _0x57c6e5 in _0x1614fe[_0x79b8('0x5a')]){if(_0x1614fe[_0x79b8('0x5a')][_0x79b8('0x4b')](_0x57c6e5)){var _0x2fda2d=_0x1614fe[_0x79b8('0x5a')][_0x57c6e5];var _0x39ef00={'id':_0x2fda2d['id'],'available':_0x2fda2d[_0x79b8('0x56')],'loggedIn':_0x2fda2d[_0x79b8('0x52')],'name':_0x2fda2d[_0x79b8('0x53')],'paused':_0x2fda2d[_0x79b8('0x57')],'waiting':_0x2fda2d[_0x79b8('0x54')]};_0x65f178['push'](_0x39ef00);}}_0x3c6ad8({'count':_0x65f178[_0x79b8('0x1a')],'rows':_0x65f178});});},'WhatsappQueues':function(){return new Promise(function(_0x4a8cd0){var _0x5b785b=[];for(var _0x211575 in _0x1614fe[_0x79b8('0x5b')]){if(_0x1614fe[_0x79b8('0x5b')][_0x79b8('0x4b')](_0x211575)){var _0x211c60=_0x1614fe[_0x79b8('0x5b')][_0x211575];var _0x233b9c={'id':_0x211c60['id'],'available':_0x211c60[_0x79b8('0x56')],'loggedIn':_0x211c60['loggedIn'],'name':_0x211c60['name'],'paused':_0x211c60['paused'],'waiting':_0x211c60[_0x79b8('0x54')]};_0x5b785b[_0x79b8('0x24')](_0x233b9c);}}_0x4a8cd0({'count':_0x5b785b[_0x79b8('0x1a')],'rows':_0x5b785b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x722630){var _0x3bbb52=_[_0x79b8('0x5c')](_0x1614fe[_0x79b8('0x5d')]);_0x722630({'count':_0x3bbb52[_0x79b8('0x1a')],'rows':_0x3bbb52});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x397830){var _0x5c1ca=_[_0x79b8('0x5c')](_0x1614fe[_0x79b8('0x5e')]);_0x397830({'count':_0x5c1ca['length'],'rows':_0x5c1ca});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1fbf40){var _0x439006=_['values'](_0x1614fe[_0x79b8('0x5f')]);_0x1fbf40({'count':_0x439006[_0x79b8('0x1a')],'rows':_0x439006});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4208cc){var _0x371ecc=_[_0x79b8('0x5c')](_0x1614fe[_0x79b8('0x60')]);_0x4208cc({'count':_0x371ecc[_0x79b8('0x1a')],'rows':_0x371ecc});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2c7eb4){var _0x5f4420=_['values'](_0x1614fe[_0x79b8('0x61')]);_0x2c7eb4({'count':_0x5f4420[_0x79b8('0x1a')],'rows':_0x5f4420});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x446735){var _0x1617af=_[_0x79b8('0x5c')](_0x1614fe[_0x79b8('0x62')]);_0x446735({'count':_0x1617af[_0x79b8('0x1a')],'rows':_0x1617af});});}};var _0x376fb8=jayson[_0x79b8('0x63')](_0x4d5cd7)[_0x79b8('0x64')]();_0x376fb8['on']('error',function(_0x56f946){logger['error'](JSON['stringify'](_0x56f946));return _0x150fb7(_0x56f946);});_0x376fb8[_0x79b8('0x14')](0x232c,_0x79b8('0x65'),function(){console['log'](_0x79b8('0x66'),0x232c);return _0x59e229(_0x79b8('0x67')+0x232c);});});}; \ No newline at end of file +var _0xb469=['update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','name','paused','mailQueues','loggedIn','waiting','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','app','.js','toLowerCase','appdata','channel','push','slice','length','join','dialogflow','split','dialogflowv2','amazonlex','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agents','agent','busy','busyQueue','end','QueueReport'];(function(_0x48f210,_0xe6508c){var _0xe4a6af=function(_0x21e61b){while(--_0x21e61b){_0x48f210['push'](_0x48f210['shift']());}};_0xe4a6af(++_0xe6508c);}(_0xb469,0x13b));var _0x9b46=function(_0x334c68,_0x388a86){_0x334c68=_0x334c68-0x0;var _0x3ee650=_0xb469[_0x334c68];return _0x3ee650;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var path=require(_0x9b46('0x2'));var fs=require('fs');var jayson=require(_0x9b46('0x3'));var BPromise=require(_0x9b46('0x4'));var utils=require(_0x9b46('0x5'));var logger=require(_0x9b46('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x9b46('0x7')),'mailQueueReport':require(_0x9b46('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x9b46('0x9')),'faxQueueReport':require(_0x9b46('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x9b46('0xb'));function getId(_0x5bd834,_0x4c1ed9,_0x34c0de){return util['format'](_0x9b46('0xc'),_0x5bd834,_0x4c1ed9||0x0,_0x34c0de||0x0);}function getIntervals(_0xb9d1b5,_0x43a112){var _0x47adeb=[];if(!_[_0x9b46('0xd')](_0x43a112['IntervalId'])&&!_[_0x9b46('0xd')](_0xb9d1b5[_0x43a112['IntervalId']])&&!_[_0x9b46('0xd')](_0xb9d1b5[_0x43a112['IntervalId']][_0x9b46('0xe')])){_0x47adeb=_[_0x9b46('0xf')](_0xb9d1b5[_0x43a112['IntervalId']][_0x9b46('0xe')],_0x9b46('0x10'));}else if(!_['isNil'](_0x43a112[_0x9b46('0x10')])){_0x47adeb=[_0x43a112[_0x9b46('0x10')]];}return _0x47adeb;}exports[_0x9b46('0x11')]=function(_0x467086){_0x467086[_0x9b46('0x12')]={};return new BPromise(function(_0x35c5c1,_0x2136bc){var _0x2e70c3={'Start':function(_0x3f2b28){var _0x178293=this;return new Promise(function(_0xbc1ba6,_0x135cc2){if(_0x3f2b28){try{var _0x1e6911=[];var _0x559bdf=getId(_0x3f2b28['channel'],_0x3f2b28['message']?_0x3f2b28[_0x9b46('0x13')]['id']:0x0,_0x3f2b28[_0x9b46('0x14')]?_0x3f2b28[_0x9b46('0x14')]['id']:0x0);if(_0x3f2b28['applications']&&_['isArray'](_0x3f2b28[_0x9b46('0x15')])&&_0x3f2b28['applications']['length']){for(var _0xfeb1b9=0x0;_0xfeb1b9<_0x3f2b28[_0x9b46('0x15')]['length'];_0xfeb1b9+=0x1){var _0x2fd8f9=_0x3f2b28[_0x9b46('0x15')][_0xfeb1b9];if(fs['existsSync'](path['join'](__dirname,_0x9b46('0x15'),_0x2fd8f9[_0x9b46('0x16')]+_0x9b46('0x17')))){var _0x4e4c7d=[];switch(_0x2fd8f9['app'][_0x9b46('0x18')]()){case'autoreply':var _0x21dacb=_0x2fd8f9[_0x9b46('0x19')]['split'](',');if(_0x3f2b28[_0x9b46('0x1a')]==='mail'){_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[0x1]);_0x4e4c7d['push'](_0x21dacb[_0x9b46('0x1c')](0x2,_0x21dacb[_0x9b46('0x1d')])[_0x9b46('0x1e')](','));}else{_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[_0x9b46('0x1c')](0x1,_0x21dacb[_0x9b46('0x1d')])['join'](','));}break;case _0x9b46('0x1f'):var _0x3ac37e=_0x2fd8f9[_0x9b46('0x19')][_0x9b46('0x20')](',');_0x4e4c7d[_0x9b46('0x1b')](_0x3ac37e[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x3ac37e[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x3ac37e['slice'](0x2,_0x3ac37e[_0x9b46('0x1d')])[_0x9b46('0x1e')](','));break;case _0x9b46('0x21'):var _0x376ccc=_0x2fd8f9[_0x9b46('0x19')][_0x9b46('0x20')](',');_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x2]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x3]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc['slice'](0x4,_0x376ccc[_0x9b46('0x1d')])[_0x9b46('0x1e')](','));break;case _0x9b46('0x22'):var _0x1ce069=_0x2fd8f9[_0x9b46('0x19')][_0x9b46('0x20')](',');_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x2]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x3]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069['slice'](0x4,_0x1ce069[_0x9b46('0x1d')])['join'](','));break;case _0x9b46('0x13'):_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x19')]);break;case'tag':_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x23')]);_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x19')]);break;case _0x9b46('0x24'):var _0x5cb73f=utils['getMustacheRender'](_0x3f2b28[_0x9b46('0x25')][_0x9b46('0x26')],_0x3f2b28);var _0x47367a=_0x2fd8f9[_0x9b46('0x19')]['split'](',');_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x0]);_0x4e4c7d['push'](_0x47367a[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x2]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x3]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x4]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x5]);_0x4e4c7d['push'](_0x47367a[0x6]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x7]);_0x4e4c7d['push'](_0x47367a[0x8]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x9]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0xa]);_0x4e4c7d[_0x9b46('0x1b')](_0x3f2b28[_0x9b46('0x14')]['id']);_0x4e4c7d[_0x9b46('0x1b')](_0x3f2b28[_0x9b46('0x13')]['id']);_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x27')]);_0x4e4c7d[_0x9b46('0x1b')](_0x3f2b28[_0x9b46('0x14')][_0x9b46('0x28')]);_0x4e4c7d['push'](_0x3f2b28[_0x9b46('0x29')]['body']);_0x4e4c7d[_0x9b46('0x1b')](_0x5cb73f);break;default:_0x4e4c7d=_[_0x9b46('0xd')](_0x2fd8f9['appdata'])?[]:_0x2fd8f9[_0x9b46('0x19')]['split'](',');}var _0x416538={'id':util['format'](_0x9b46('0x2a'),_0x559bdf,_0x2fd8f9['id'],_0x2fd8f9[_0x9b46('0x16')]),'condition':require(_0x9b46('0x2b'))[_0x9b46('0x2c')](_0x559bdf,getIntervals(_0x467086[_0x9b46('0x2d')],_0x2fd8f9),_0x467086),'consequence':require('./applications/'+_0x2fd8f9['app'])[_0x9b46('0x2e')](_0x559bdf,_0x4e4c7d,_0x467086,_0x3f2b28),'p':_0x2fd8f9['priority']||0x0};logger['info']('Push\x20new\x20rule',_0x416538['id'],'on\x20interval',getIntervals(_0x467086[_0x9b46('0x2d')],_0x2fd8f9)['join'](_0x9b46('0x2f')));_0x1e6911['push'](_0x416538);}else{logger[_0x9b46('0x30')](_0x9b46('0x31'),path[_0x9b46('0x1e')](__dirname,_0x9b46('0x15'),_0x2fd8f9[_0x9b46('0x16')]+_0x9b46('0x17')));}}_0x467086[_0x9b46('0x12')][_0x559bdf]=new RuleEngine(_0x1e6911);_0x467086[_0x9b46('0x12')][_0x559bdf][_0x9b46('0x32')](_0x3f2b28,function(_0x5602a9){logger[_0x9b46('0x33')](_0x9b46('0x34'),JSON[_0x9b46('0x35')](_0x5602a9[_0x9b46('0x36')]));if(_0x467086[_0x9b46('0x12')][_0x559bdf]){_0x467086[_0x9b46('0x12')][_0x559bdf][_0x9b46('0x37')](_0x9b46('0x38'));}});return _0xbc1ba6({'code':0xc8,'message':_0x3f2b28});}else{logger[_0x9b46('0x33')](_0x9b46('0x39'));return _0xbc1ba6({'code':0xc8,'message':_0x3f2b28});}}catch(_0x1f3b2b){logger[_0x9b46('0x30')](_0x1f3b2b[_0x9b46('0x3a')]);return _0x135cc2(_0x178293[_0x9b46('0x30')](0x1f4,_0x1f3b2b));}}return _0x135cc2('routing\x20is\x20empty');});},'AcceptMessage':function(_0x4a62c6){var _0xf81543=this;return new Promise(function(_0x23df60,_0x309a4f){if(_0x4a62c6['agent']&&_0x4a62c6['agent']['id']){if(_0x467086[_0x9b46('0x3b')][_0x4a62c6[_0x9b46('0x3c')]['id']]){_0x467086[_0x9b46('0x3b')][_0x4a62c6[_0x9b46('0x3c')]['id']][_0x9b46('0x3d')]=![];_0x467086[_0x9b46('0x3b')][_0x4a62c6['agent']['id']][_0x9b46('0x3e')]=undefined;}}if(_0x4a62c6[_0x9b46('0x13')]&&_0x4a62c6[_0x9b46('0x13')]['id']){try{var _0x47a938=getId(_0x4a62c6[_0x9b46('0x1a')],_0x4a62c6['message']?_0x4a62c6[_0x9b46('0x13')]['id']:0x0,_0x4a62c6[_0x9b46('0x14')]?_0x4a62c6[_0x9b46('0x14')]['id']:0x0);if(_0x467086['rules'][_0x47a938]){_0x467086[_0x9b46('0x12')][_0x47a938][_0x9b46('0x37')](_0x9b46('0x3f'));if(rpc[_0x4a62c6[_0x9b46('0x1a')]+_0x9b46('0x40')]){rpc[_0x4a62c6[_0x9b46('0x1a')]+'QueueReport'][_0x9b46('0x41')](_0x47a938,{'UserId':_0x4a62c6[_0x9b46('0x13')][_0x9b46('0x42')]})[_0x9b46('0x43')](function(){logger[_0x9b46('0x30')](_0x9b46('0x44'));});}}return _0x23df60({'code':0xc8,'message':_0x4a62c6});}catch(_0x4a1df0){logger[_0x9b46('0x30')](_0x4a1df0['stack']);return _0x309a4f(_0xf81543[_0x9b46('0x30')](0x1f4,_0x4a1df0));}}logger[_0x9b46('0x30')](_0x9b46('0x45'));return _0x309a4f(_0xf81543[_0x9b46('0x30')](0x1f4,_0x9b46('0x45')));});},'RejectMessage':function(_0x5f5ce9){var _0x15dbb0=this;return new Promise(function(_0x1c7e5d,_0x3d65ad){if(_0x5f5ce9[_0x9b46('0x3c')]&&_0x5f5ce9[_0x9b46('0x3c')]['id']){try{if(_0x467086[_0x9b46('0x3b')][_0x5f5ce9[_0x9b46('0x3c')]['id']]){_0x467086[_0x9b46('0x3b')][_0x5f5ce9[_0x9b46('0x3c')]['id']][_0x9b46('0x3d')]=![];_0x467086[_0x9b46('0x3b')][_0x5f5ce9['agent']['id']]['busyQueue']=undefined;}return _0x1c7e5d({'code':0xc8,'message':_0x5f5ce9});}catch(_0x496006){logger[_0x9b46('0x30')](_0x496006['stack']);return _0x3d65ad(_0x15dbb0[_0x9b46('0x30')](0x1f4,_0x496006));}}logger['error'](_0x9b46('0x45'));return _0x3d65ad(_0x15dbb0['error'](0x1f4,_0x9b46('0x45')));});},'AbandonInteraction':function(_0x443ccd){var _0x15e3d6=this;return new Promise(function(_0x52463b,_0x35f71d){if(_0x443ccd['channel']&&_0x443ccd[_0x9b46('0x14')]&&_0x443ccd[_0x9b46('0x14')]['id']){try{var _0x2c77d2=getId(_0x443ccd[_0x9b46('0x1a')],_0x443ccd[_0x9b46('0x13')]?_0x443ccd['message']['id']:0x0,_0x443ccd['interaction']?_0x443ccd[_0x9b46('0x14')]['id']:0x0);if(_0x467086[_0x9b46('0x12')][_0x2c77d2]){_0x467086[_0x9b46('0x12')][_0x2c77d2][_0x9b46('0x37')](_0x9b46('0x3f'));}return _0x52463b({'code':0xc8,'message':_0x443ccd});}catch(_0x164167){logger[_0x9b46('0x30')](_0x164167[_0x9b46('0x3a')]);return _0x35f71d(_0x15e3d6['error'](0x1f4,_0x164167));}}logger[_0x9b46('0x30')](_0x9b46('0x45'));return _0x35f71d(_0x15e3d6[_0x9b46('0x30')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x46dffa){var _0x145200=this;return new Promise(function(_0x1aa8c6,_0x12d825){if(_0x467086[_0x9b46('0x3b')][_0x9b46('0x46')](_0x46dffa['id'])){for(var _0x4b79a4 in _0x46dffa[_0x9b46('0x47')]){if(_0x46dffa[_0x9b46('0x47')][_0x9b46('0x46')](_0x4b79a4)){if(_0x467086[_0x9b46('0x3b')][_0x46dffa['id']][_0x9b46('0x46')](_0x4b79a4+_0x9b46('0x48'))){_0x467086['agents'][_0x46dffa['id']][_0x4b79a4+_0x9b46('0x48')]=parseInt(_0x46dffa['capacity'][_0x4b79a4],0xa);}}}_0x467086[_0x9b46('0x3b')][_0x46dffa['id']]['updateRealtime']();return _0x1aa8c6({'code':0xc8,'message':_0x467086[_0x9b46('0x3b')][_0x46dffa['id']]});}else{return _0x12d825(_0x145200[_0x9b46('0x30')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x171ad2){return new Promise(function(_0x1cc2f3){var _0x3abe23=_[_0x9b46('0x49')](_0x467086[_0x9b46('0x3b')]);if(_0x171ad2&&_0x171ad2['id']){var _0x5b9ec2=_[_0x9b46('0x4a')](_0x3abe23,function(_0x343a1e){return _0x343a1e['id']===_0x171ad2['id'];});_0x1cc2f3(_0x5b9ec2);}else{_0x1cc2f3({'count':_0x3abe23['length'],'rows':_0x3abe23});}});},'ChatQueues':function(){return new Promise(function(_0x4cf4ba){var _0x3aca4b=[];for(var _0x2801bb in _0x467086[_0x9b46('0x4b')]){if(_0x467086[_0x9b46('0x4b')][_0x9b46('0x46')](_0x2801bb)){var _0x1a6516=_0x467086[_0x9b46('0x4b')][_0x2801bb];var _0x19aa34={'id':_0x1a6516['id'],'available':_0x1a6516['available'],'loggedIn':_0x1a6516['loggedIn'],'name':_0x1a6516[_0x9b46('0x4c')],'paused':_0x1a6516[_0x9b46('0x4d')],'waiting':_0x1a6516['waiting']};_0x3aca4b[_0x9b46('0x1b')](_0x19aa34);}}_0x4cf4ba({'count':_0x3aca4b['length'],'rows':_0x3aca4b});});},'MailQueues':function(){return new Promise(function(_0x33d1ab){var _0x501544=[];for(var _0xf6f92 in _0x467086[_0x9b46('0x4e')]){if(_0x467086[_0x9b46('0x4e')]['hasOwnProperty'](_0xf6f92)){var _0x271ae8=_0x467086[_0x9b46('0x4e')][_0xf6f92];var _0xad2666={'id':_0x271ae8['id'],'available':_0x271ae8['available'],'loggedIn':_0x271ae8[_0x9b46('0x4f')],'name':_0x271ae8[_0x9b46('0x4c')],'paused':_0x271ae8[_0x9b46('0x4d')],'waiting':_0x271ae8[_0x9b46('0x50')]};_0x501544[_0x9b46('0x1b')](_0xad2666);}}_0x33d1ab({'count':_0x501544['length'],'rows':_0x501544});});},'OpenchannelQueues':function(){return new Promise(function(_0x5321c1){var _0x5386ef=[];for(var _0x533a4f in _0x467086['openchannelQueues']){if(_0x467086[_0x9b46('0x51')][_0x9b46('0x46')](_0x533a4f)){var _0x11243a=_0x467086[_0x9b46('0x51')][_0x533a4f];var _0x368cd2={'id':_0x11243a['id'],'available':_0x11243a[_0x9b46('0x52')],'loggedIn':_0x11243a[_0x9b46('0x4f')],'name':_0x11243a[_0x9b46('0x4c')],'paused':_0x11243a['paused'],'waiting':_0x11243a[_0x9b46('0x50')]};_0x5386ef[_0x9b46('0x1b')](_0x368cd2);}}_0x5321c1({'count':_0x5386ef['length'],'rows':_0x5386ef});});},'SmsQueues':function(){return new Promise(function(_0xb3e39e){var _0x4ea405=[];for(var _0x1f3e9e in _0x467086[_0x9b46('0x53')]){if(_0x467086[_0x9b46('0x53')][_0x9b46('0x46')](_0x1f3e9e)){var _0x453a53=_0x467086['smsQueues'][_0x1f3e9e];var _0x4e1175={'id':_0x453a53['id'],'available':_0x453a53[_0x9b46('0x52')],'loggedIn':_0x453a53['loggedIn'],'name':_0x453a53[_0x9b46('0x4c')],'paused':_0x453a53[_0x9b46('0x4d')],'waiting':_0x453a53['waiting']};_0x4ea405['push'](_0x4e1175);}}_0xb3e39e({'count':_0x4ea405['length'],'rows':_0x4ea405});});},'FaxQueues':function(){return new Promise(function(_0x2978aa){var _0x4a4e9a=[];for(var _0x56b870 in _0x467086[_0x9b46('0x54')]){if(_0x467086[_0x9b46('0x54')][_0x9b46('0x46')](_0x56b870)){var _0x1fa19d=_0x467086['faxQueues'][_0x56b870];var _0x46a294={'id':_0x1fa19d['id'],'available':_0x1fa19d[_0x9b46('0x52')],'loggedIn':_0x1fa19d[_0x9b46('0x4f')],'name':_0x1fa19d['name'],'paused':_0x1fa19d['paused'],'waiting':_0x1fa19d[_0x9b46('0x50')]};_0x4a4e9a[_0x9b46('0x1b')](_0x46a294);}}_0x2978aa({'count':_0x4a4e9a[_0x9b46('0x1d')],'rows':_0x4a4e9a});});},'WhatsappQueues':function(){return new Promise(function(_0x4fa1ad){var _0x2f60a3=[];for(var _0x3a1e1e in _0x467086['whatsappQueues']){if(_0x467086[_0x9b46('0x55')][_0x9b46('0x46')](_0x3a1e1e)){var _0x346a6c=_0x467086[_0x9b46('0x55')][_0x3a1e1e];var _0x4de02d={'id':_0x346a6c['id'],'available':_0x346a6c['available'],'loggedIn':_0x346a6c[_0x9b46('0x4f')],'name':_0x346a6c['name'],'paused':_0x346a6c[_0x9b46('0x4d')],'waiting':_0x346a6c[_0x9b46('0x50')]};_0x2f60a3['push'](_0x4de02d);}}_0x4fa1ad({'count':_0x2f60a3['length'],'rows':_0x2f60a3});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x536083){var _0x8bf222=_['values'](_0x467086[_0x9b46('0x56')]);_0x536083({'count':_0x8bf222[_0x9b46('0x1d')],'rows':_0x8bf222});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1f52c5){var _0x18006a=_['values'](_0x467086[_0x9b46('0x57')]);_0x1f52c5({'count':_0x18006a[_0x9b46('0x1d')],'rows':_0x18006a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xf1bc8d){var _0x195cf0=_[_0x9b46('0x49')](_0x467086['openchannelQueuesWaitingInteractions']);_0xf1bc8d({'count':_0x195cf0[_0x9b46('0x1d')],'rows':_0x195cf0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x591820){var _0x254c71=_[_0x9b46('0x49')](_0x467086['smsQueuesWaitingInteractions']);_0x591820({'count':_0x254c71[_0x9b46('0x1d')],'rows':_0x254c71});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4ffaee){var _0x3c0b46=_[_0x9b46('0x49')](_0x467086['faxQueuesWaitingInteractions']);_0x4ffaee({'count':_0x3c0b46[_0x9b46('0x1d')],'rows':_0x3c0b46});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x526e70){var _0x2cbca2=_[_0x9b46('0x49')](_0x467086[_0x9b46('0x58')]);_0x526e70({'count':_0x2cbca2['length'],'rows':_0x2cbca2});});}};var _0xe27fd6=jayson[_0x9b46('0x59')](_0x2e70c3)[_0x9b46('0x5a')]();_0xe27fd6['on'](_0x9b46('0x30'),function(_0x48f236){logger[_0x9b46('0x30')](JSON['stringify'](_0x48f236));return _0x2136bc(_0x48f236);});_0xe27fd6[_0x9b46('0x11')](0x232c,_0x9b46('0x5b'),function(){console[_0x9b46('0x5c')](_0x9b46('0x5d'),0x232c);return _0x35c5c1(_0x9b46('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b76c304..f3840a4 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 _0x855c=['client','http','request','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','then','message','indexOf','[%s][INTERVAL]\x20%s','all','some','info','join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x24fae9,_0xb56c59){var _0x581267=function(_0xcdb6c2){while(--_0xcdb6c2){_0x24fae9['push'](_0x24fae9['shift']());}};_0x581267(++_0xb56c59);}(_0x855c,0x1db));var _0xc855=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x855c[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0xc855('0x0'));var BPromise=require('bluebird');var jayson=require(_0xc855('0x1'));var _=require(_0xc855('0x2'));var logger=require(_0xc855('0x3'))(_0xc855('0x4'));var client=jayson[_0xc855('0x5')][_0xc855('0x6')]({'port':0x232a});function request(_0x15ecc0,_0x2d3b0b){return new BPromise(function(_0x2446af,_0x5c8e28){return client[_0xc855('0x7')](_0x15ecc0,_0x2d3b0b)['then'](function(_0x2f7bec){if(_0x2f7bec[_0xc855('0x8')]){return _0x5c8e28(_0x2f7bec[_0xc855('0x8')]['message']);}else{return _0x2446af(_0x2f7bec[_0xc855('0x9')]);}})[_0xc855('0xa')](function(_0x3d6e55){return _0x5c8e28(_0x3d6e55);});});}exports[_0xc855('0xb')]=function(_0x2b0dd7,_0x2ae3a3,_0x54f6a4){return function(_0x2eb20e){if(_0x54f6a4[_0xc855('0xc')]&&!_0x54f6a4['rules'][_0x2b0dd7]){logger['info'](_0xc855('0xd'),_0x2b0dd7);return _0x2eb20e[_0xc855('0xe')]();}var _0x6124f4=[];for(var _0x57bc8b=0x0;_0x57bc8b<_0x2ae3a3[_0xc855('0xf')];_0x57bc8b+=0x1){_0x6124f4['push'](request(_0xc855('0x10'),{'command':util['format'](_0xc855('0x11'),_0x2ae3a3[_0x57bc8b])})[_0xc855('0x12')](function(_0x1827ca){return _0x1827ca&&_0x1827ca['message']&&_0x1827ca[_0xc855('0x13')][_0xc855('0x14')]('true')>=0x0?!![]:![];})[_0xc855('0xa')](function(_0x459a3c){logger[_0xc855('0x8')](_0xc855('0x15'),_0x2b0dd7,_0x2ae3a3[_0x57bc8b]);}));}BPromise[_0xc855('0x16')](_0x6124f4)[_0xc855('0x12')](function(_0x2bca15){var _0x28958e=_[_0xc855('0x17')](_0x2bca15);logger[_0xc855('0x18')]('[%s][INTERVAL]\x20%s\x20%s',_0x2b0dd7,_0x2ae3a3[_0xc855('0x19')](_0xc855('0x1a')),_0x28958e);_0x2eb20e[_0xc855('0x1b')](_0x28958e);})[_0xc855('0xa')](function(_0x3121ee){console[_0xc855('0x1c')](_0x3121ee);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x2b0dd7,_0x2ae3a3[_0xc855('0x19')](_0xc855('0x1a')),_0x3121ee[_0xc855('0x1d')]);_0x2eb20e[_0xc855('0xe')]();});};}; \ No newline at end of file +var _0xf51b=['join','\x20|\x20','stack','stop','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','when','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0xf51b,0x154));var _0xbf51=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf51b[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var BPromise=require(_0xbf51('0x0'));var jayson=require(_0xbf51('0x1'));var _=require(_0xbf51('0x2'));var logger=require(_0xbf51('0x3'))(_0xbf51('0x4'));var client=jayson[_0xbf51('0x5')]['http']({'port':0x232a});function request(_0x3aa8bf,_0x638bce){return new BPromise(function(_0x21e850,_0x220b69){return client['request'](_0x3aa8bf,_0x638bce)[_0xbf51('0x6')](function(_0x35cf52){if(_0x35cf52[_0xbf51('0x7')]){return _0x220b69(_0x35cf52[_0xbf51('0x7')][_0xbf51('0x8')]);}else{return _0x21e850(_0x35cf52['result']);}})[_0xbf51('0x9')](function(_0x395e38){return _0x220b69(_0x395e38);});});}exports[_0xbf51('0xa')]=function(_0x26adb8,_0x40be4a,_0x584d9a){return function(_0x71633){if(_0x584d9a[_0xbf51('0xb')]&&!_0x584d9a[_0xbf51('0xb')][_0x26adb8]){logger[_0xbf51('0xc')](_0xbf51('0xd'),_0x26adb8);return _0x71633['stop']();}var _0x553139=[];for(var _0x6661bf=0x0;_0x6661bf<_0x40be4a[_0xbf51('0xe')];_0x6661bf+=0x1){_0x553139['push'](request(_0xbf51('0xf'),{'command':util[_0xbf51('0x10')](_0xbf51('0x11'),_0x40be4a[_0x6661bf])})[_0xbf51('0x6')](function(_0x2b2e99){return _0x2b2e99&&_0x2b2e99[_0xbf51('0x8')]&&_0x2b2e99['message']['indexOf'](_0xbf51('0x12'))>=0x0?!![]:![];})[_0xbf51('0x9')](function(_0x2bd809){logger['error'](_0xbf51('0x13'),_0x26adb8,_0x40be4a[_0x6661bf]);}));}BPromise[_0xbf51('0x14')](_0x553139)[_0xbf51('0x6')](function(_0x5f5168){var _0x3edb9e=_[_0xbf51('0x15')](_0x5f5168);logger[_0xbf51('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x26adb8,_0x40be4a['join']('\x20|\x20'),_0x3edb9e);_0x71633[_0xbf51('0x16')](_0x3edb9e);})[_0xbf51('0x9')](function(_0x4588c2){console['log'](_0x4588c2);logger['error'](_0xbf51('0x17'),_0x26adb8,_0x40be4a[_0xbf51('0x18')](_0xbf51('0x19')),_0x4588c2[_0xbf51('0x1a')]);_0x71633[_0xbf51('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 24e555f..0e1d07b 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 _0x3f8c=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','./utils','info','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','rejected','indexOf','splice','agent'];(function(_0x170add,_0x206e45){var _0x1249f1=function(_0x3dc950){while(--_0x3dc950){_0x170add['push'](_0x170add['shift']());}};_0x1249f1(++_0x206e45);}(_0x3f8c,0x104));var _0xc3f8=function(_0x372ad1,_0x404682){_0x372ad1=_0x372ad1-0x0;var _0x26982c=_0x3f8c[_0x372ad1];return _0x26982c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc3f8('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1f6a,_0x2e70c4){utils[_0xc3f8('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1f6a['uniqueid'],_0x3a1f6a['channel'],_0x3a1f6a['queue'],_0x3a1f6a[_0xc3f8('0x2')],_0x3a1f6a[_0xc3f8('0x3')],_0x3a1f6a[_0xc3f8('0x4')],_0x3a1f6a[_0xc3f8('0x5')],_0x3a1f6a[_0xc3f8('0x6')]));if(_0x3a1f6a[_0xc3f8('0x7')]){utils['getVoiceQueueByName'](_0x3a1f6a[_0xc3f8('0x7')])[_0xc3f8('0x8')](function(_0x15cb3b){if(_0x15cb3b){_0x3a1f6a[_0xc3f8('0x9')]=_0x15cb3b[_0xc3f8('0x9')];_0x3a1f6a[_0xc3f8('0xa')]=_0x3a1f6a[_0xc3f8('0xb')]?_0x15cb3b['acw']:![];_0x3a1f6a[_0xc3f8('0xc')]=_0x3a1f6a[_0xc3f8('0xa')]?_0x15cb3b[_0xc3f8('0xd')]:0x0;}utils[_0xc3f8('0xe')]('CreateVoiceAgentReport',_0x3a1f6a);});}else{utils[_0xc3f8('0xe')](_0xc3f8('0xf'),_0x3a1f6a);}if(_0x2e70c4){delete transfers[_0x3a1f6a[_0xc3f8('0x10')]];}else{delete agents[_0x3a1f6a[_0xc3f8('0x11')]];}}exports['agentcalled']=function(_0x84f489){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x14'),_0x84f489[_0xc3f8('0x10')]),_0x84f489);agents[_0x84f489[_0xc3f8('0x11')]]=_0x84f489;agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x17');agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinenum']=null;agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinename']=null;utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x18'),_0x84f489[_0xc3f8('0x10')],agents[_0x84f489[_0xc3f8('0x11')]]['membername'],_0x84f489[_0xc3f8('0x11')]));}catch(_0x1db809){utils['error'](util[_0xc3f8('0x13')]('[%s][agents][agentcalled]',_0x84f489[_0xc3f8('0x10')]),_0x1db809);}};exports[_0xc3f8('0x19')]=function(_0x3b2e98){try{if(!_['isNil'](agents[_0x3b2e98['destuniqueid']])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98[_0xc3f8('0x10')]),_0x3b2e98);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x1b'),_0x3b2e98[_0xc3f8('0x10')],agents[_0x3b2e98['destuniqueid']]['membername'],_0x3b2e98['destuniqueid']));agents[_0x3b2e98[_0xc3f8('0x11')]]['agentringnoanswer']=!![];agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1c')]=utils['now']();agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1f')]=_0x3b2e98[_0xc3f8('0x20')]?parseInt(_0x3b2e98[_0xc3f8('0x20')])/0x3e8:0x0;agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x21')]=0x0;unanswered[_0xc3f8('0x22')](_0x3b2e98[_0xc3f8('0x11')]);}}catch(_0x59e4dd){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98['uniqueid']),_0x59e4dd);}};exports[_0xc3f8('0x24')]=function(_0x4d39a0){try{_[_0xc3f8('0x25')](agents,function(_0x32343e,_0x47ab53){if(_0x32343e['uniqueid']==_0x4d39a0[_0xc3f8('0x10')]&&!_[_0xc3f8('0x26')](unanswered,_0x32343e[_0xc3f8('0x11')])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0[_0xc3f8('0x10')]),_0x4d39a0);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x28'),_0x4d39a0['uniqueid'],_0x32343e[_0xc3f8('0x2')],_0x32343e[_0xc3f8('0x11')]));_0x32343e[_0xc3f8('0x19')]=!![];_0x32343e[_0xc3f8('0x1c')]=utils[_0xc3f8('0x16')]();_0x32343e['lastevent']='abandoned';_0x32343e[_0xc3f8('0x1e')]=_0xc3f8('0x29');_0x32343e[_0xc3f8('0x1f')]=_0x4d39a0[_0xc3f8('0x1f')];_0x32343e[_0xc3f8('0x21')]=0x0;writeDB(_0x32343e);}});}catch(_0x4e51ac){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0['uniqueid']),_0x4e51ac);}};exports[_0xc3f8('0x2a')]=function(_0x11ecc2){try{if(agents[_0x11ecc2[_0xc3f8('0x11')]]){utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x11ecc2);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x2c'),_0x11ecc2[_0xc3f8('0x10')],agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x11ecc2['destuniqueid']));agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x5')]=_0x11ecc2['connectedlinenum'];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2e')]=_0x11ecc2[_0xc3f8('0x2e')];agents[_0x11ecc2['destuniqueid']][_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x6')]='connect';_[_0xc3f8('0x25')](agents,function(_0x45d416,_0x2df096){if(_0x45d416[_0xc3f8('0x11')]!=_0x11ecc2['destuniqueid']&&_0x45d416[_0xc3f8('0x10')]==_0x11ecc2['uniqueid']){_0x45d416['talktime']=0x0;_0x45d416[_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];_0x45d416[_0xc3f8('0x19')]=!![];_0x45d416[_0xc3f8('0x1c')]=utils['now']();_0x45d416['lastevent']=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x1e')]=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x30')]=_0x11ecc2[_0xc3f8('0x11')];_0x45d416[_0xc3f8('0x31')]=_0x11ecc2[_0xc3f8('0x2')];writeDB(_0x45d416);}});}}catch(_0x45e6ea){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x45e6ea);}};exports[_0xc3f8('0xb')]=function(_0x22e9b3){try{if(!_['isNil'](agents[_0x22e9b3[_0xc3f8('0x11')]])){utils[_0xc3f8('0x12')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0x22e9b3);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x33'),_0x22e9b3[_0xc3f8('0x10')],agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x22e9b3[_0xc3f8('0x11')]));agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0xb')]=!![];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x34')],agents[_0x22e9b3['destuniqueid']]['agentconnectAt']);agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0x22e9b3[_0xc3f8('0x1e')];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x36');writeDB(agents[_0x22e9b3[_0xc3f8('0x11')]]);}}catch(_0xe3d5c4){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0xe3d5c4);}};exports['blindtransfer']=function(_0x1becae){try{if(!_[_0xc3f8('0x37')](agents[_0x1becae[_0xc3f8('0x38')]])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae[_0xc3f8('0x10')]),_0x1becae);utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x3a'),_0x1becae['uniqueid'],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x2')],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')]));agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3b')]=!![];agents[_0x1becae[_0xc3f8('0x38')]]['transfertype']=_0xc3f8('0x3c');agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3d')]=_0x1becae[_0xc3f8('0x3e')];agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3f')]=agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')];}}catch(_0x4fc02c){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae['uniqueid']),_0x4fc02c);}};exports['attendedtransfer']=function(_0x773d56){try{utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x773d56);if(_0x773d56['origtransfereruniqueid']==_0x773d56[_0xc3f8('0x42')]){if(!_['isNil'](agents[_0x773d56['secondtransfereruniqueid']])){utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x44')]]['membername']));agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56['secondtransfereruniqueid']]['transferexten']=_0x773d56[_0xc3f8('0x47')];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3f')]=_0x773d56[_0xc3f8('0x41')];}if(_0x773d56[_0xc3f8('0x48')]&&agents[_0x773d56['transfereeuniqueid']]){agents[_0x773d56[_0xc3f8('0x48')]]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x48')]]=_[_0xc3f8('0x49')](agents[_0x773d56[_0xc3f8('0x48')]]);transfers[_0x773d56[_0xc3f8('0x48')]]['calleridnum']=agents[_0x773d56[_0xc3f8('0x44')]]['calleridnum'];transfers[_0x773d56['transfereeuniqueid']]['calleridname']=agents[_0x773d56['secondtransfereruniqueid']][_0xc3f8('0x4a')];transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x4b')]=0x2;}}else if(_0x773d56[_0xc3f8('0x44')]==_0x773d56[_0xc3f8('0x4c')]){if(!_[_0xc3f8('0x37')](agents[_0x773d56['origtransfereruniqueid']])){utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x41')]]['membername']));agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56[_0xc3f8('0x41')]]['transferexten']=_0x773d56[_0xc3f8('0x4d')];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3f')]=_0x773d56['secondtransfereruniqueid'];}if(_0x773d56[_0xc3f8('0x4e')]&&agents[_0x773d56[_0xc3f8('0x4e')]]){agents[_0x773d56['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x4e')]]=_[_0xc3f8('0x49')](agents[_0x773d56['transfertargetuniqueid']]);transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4')];transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4a')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4a')];transfers[_0x773d56['transfertargetuniqueid']]['agentcalledAt']=utils[_0xc3f8('0x16')]();transfers[_0x773d56['transfertargetuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x773d56['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4b')]=0x2;}}}catch(_0x188d39){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x188d39);}};exports['hangup']=function(_0x3b9b47){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')]('[%s][agents][hangup]',_0x3b9b47[_0xc3f8('0x10')]),_0x3b9b47);if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47['uniqueid']]['reason']===_0xc3f8('0x1d')){if(_0x3b9b47[_0xc3f8('0x4f')]==='21'){agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')]=_0xc3f8('0x50');agents[_0x3b9b47['uniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x50');}utils['info'](util[_0xc3f8('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47[_0xc3f8('0x10')]]['membername'],agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],agents[_0x3b9b47[_0xc3f8('0x10')]]['lastevent']));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);var _0x5de19e=unanswered[_0xc3f8('0x51')](_0x3b9b47['uniqueid']);if(_0x5de19e>-0x1){unanswered[_0xc3f8('0x52')](_0x5de19e,0x1);}}if(transfers[_0x3b9b47[_0xc3f8('0x10')]]){transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0xb')]=!![];transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x21')]=utils['diffTime'](transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]);transfers[_0x3b9b47[_0xc3f8('0x10')]]['reason']=_0xc3f8('0x53');transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],transfers[_0x3b9b47[_0xc3f8('0x10')]]['membername'],transfers[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(transfers[_0x3b9b47[_0xc3f8('0x10')]],!![]);}if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]){agents[_0x3b9b47[_0xc3f8('0x10')]]['agentcomplete']=!![];agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils['now']();agents[_0x3b9b47['uniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x3b9b47['uniqueid']][_0xc3f8('0x34')],agents[_0x3b9b47[_0xc3f8('0x10')]]['agentconnectAt']);agents[_0x3b9b47[_0xc3f8('0x10')]]['reason']=agents[_0x3b9b47[_0xc3f8('0x10')]]['transfer']?_0xc3f8('0x3b'):_0xc3f8('0x53');agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47['uniqueid']]['membername'],agents[_0x3b9b47[_0xc3f8('0x10')]]['reason'],agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);}}catch(_0xfb05eb){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x55'),_0x3b9b47[_0xc3f8('0x10')]),_0xfb05eb);}}; \ No newline at end of file +var _0x1be1=['destuniqueid','agentcalled','debug','called','error','[%s][agents][agentcalled]','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','lastevent','timeout','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','reason','holdtime','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request'];(function(_0x31c410,_0x465c95){var _0x47b5c4=function(_0x307ba7){while(--_0x307ba7){_0x31c410['push'](_0x31c410['shift']());}};_0x47b5c4(++_0x465c95);}(_0x1be1,0x192));var _0x11be=function(_0x383b0e,_0x362b29){_0x383b0e=_0x383b0e-0x0;var _0x5070cf=_0x1be1[_0x383b0e];return _0x5070cf;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x11be('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x33a55d,_0x5527b3){utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x3'),_0x33a55d[_0x11be('0x4')],_0x33a55d['channel'],_0x33a55d[_0x11be('0x5')],_0x33a55d[_0x11be('0x6')],_0x33a55d[_0x11be('0x7')],_0x33a55d['calleridnum'],_0x33a55d[_0x11be('0x8')],_0x33a55d['lastevent']));if(_0x33a55d[_0x11be('0x5')]){utils[_0x11be('0x9')](_0x33a55d[_0x11be('0x5')])[_0x11be('0xa')](function(_0x162eaa){if(_0x162eaa){_0x33a55d['type']=_0x162eaa[_0x11be('0xb')];_0x33a55d[_0x11be('0xc')]=_0x33a55d['agentcomplete']?_0x162eaa[_0x11be('0xd')]:![];_0x33a55d[_0x11be('0xe')]=_0x33a55d[_0x11be('0xc')]?_0x162eaa[_0x11be('0xf')]:0x0;}utils['request'](_0x11be('0x10'),_0x33a55d);});}else{utils[_0x11be('0x11')](_0x11be('0x10'),_0x33a55d);}if(_0x5527b3){delete transfers[_0x33a55d['uniqueid']];}else{delete agents[_0x33a55d[_0x11be('0x12')]];}}exports[_0x11be('0x13')]=function(_0x4ce3ae){try{utils[_0x11be('0x14')](util['format']('[%s][agents][agentcalled]',_0x4ce3ae['uniqueid']),_0x4ce3ae);agents[_0x4ce3ae['destuniqueid']]=_0x4ce3ae;agents[_0x4ce3ae['destuniqueid']]['agentcalledAt']=utils['now']();agents[_0x4ce3ae[_0x11be('0x12')]]['lastevent']=_0x11be('0x15');agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x8')]=null;agents[_0x4ce3ae[_0x11be('0x12')]]['connectedlinename']=null;utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4ce3ae[_0x11be('0x4')],agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x6')],_0x4ce3ae['destuniqueid']));}catch(_0x51ba82){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x17'),_0x4ce3ae[_0x11be('0x4')]),_0x51ba82);}};exports['agentringnoanswer']=function(_0x12a5bd){try{if(!_[_0x11be('0x18')](agents[_0x12a5bd[_0x11be('0x12')]])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x19'),_0x12a5bd[_0x11be('0x4')]),_0x12a5bd);utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x1a'),_0x12a5bd['uniqueid'],agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x6')],_0x12a5bd[_0x11be('0x12')]));agents[_0x12a5bd['destuniqueid']]['agentringnoanswer']=!![];agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x1b')]=utils[_0x11be('0x1c')]();agents[_0x12a5bd['destuniqueid']][_0x11be('0x1d')]='timeout';agents[_0x12a5bd[_0x11be('0x12')]]['reason']=_0x11be('0x1e');agents[_0x12a5bd[_0x11be('0x12')]]['holdtime']=_0x12a5bd[_0x11be('0x1f')]?parseInt(_0x12a5bd[_0x11be('0x1f')])/0x3e8:0x0;agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x20')]=0x0;unanswered[_0x11be('0x21')](_0x12a5bd[_0x11be('0x12')]);}}catch(_0xf5a6ac){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][agentringnoanswer]',_0x12a5bd[_0x11be('0x4')]),_0xf5a6ac);}};exports['queuecallerabandon']=function(_0x182f6b){try{_[_0x11be('0x22')](agents,function(_0x510476,_0x584d4c){if(_0x510476[_0x11be('0x4')]==_0x182f6b[_0x11be('0x4')]&&!_[_0x11be('0x23')](unanswered,_0x510476[_0x11be('0x12')])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x24'),_0x182f6b[_0x11be('0x4')]),_0x182f6b);utils[_0x11be('0x1')](util['format'](_0x11be('0x25'),_0x182f6b[_0x11be('0x4')],_0x510476[_0x11be('0x6')],_0x510476[_0x11be('0x12')]));_0x510476[_0x11be('0x26')]=!![];_0x510476[_0x11be('0x1b')]=utils['now']();_0x510476[_0x11be('0x1d')]=_0x11be('0x27');_0x510476[_0x11be('0x28')]=_0x11be('0x27');_0x510476[_0x11be('0x29')]=_0x182f6b['holdtime'];_0x510476[_0x11be('0x20')]=0x0;writeDB(_0x510476);}});}catch(_0x254be5){utils[_0x11be('0x16')](util['format'](_0x11be('0x24'),_0x182f6b['uniqueid']),_0x254be5);}};exports['agentconnect']=function(_0x4c1f4d){try{if(agents[_0x4c1f4d['destuniqueid']]){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x4c1f4d);utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4c1f4d[_0x11be('0x4')],agents[_0x4c1f4d['destuniqueid']][_0x11be('0x6')],_0x4c1f4d['destuniqueid']));agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();agents[_0x4c1f4d[_0x11be('0x12')]]['connectedlinenum']=_0x4c1f4d[_0x11be('0x8')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2c')]=_0x4c1f4d[_0x11be('0x2c')];agents[_0x4c1f4d['destuniqueid']][_0x11be('0x29')]=_0x4c1f4d[_0x11be('0x1f')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x1d')]=_0x11be('0x2d');_[_0x11be('0x22')](agents,function(_0x5742d1,_0x5ee47c){if(_0x5742d1[_0x11be('0x12')]!=_0x4c1f4d[_0x11be('0x12')]&&_0x5742d1['uniqueid']==_0x4c1f4d[_0x11be('0x4')]){_0x5742d1[_0x11be('0x20')]=0x0;_0x5742d1['holdtime']=_0x4c1f4d[_0x11be('0x1f')];_0x5742d1['agentringnoanswer']=!![];_0x5742d1[_0x11be('0x1b')]=utils['now']();_0x5742d1[_0x11be('0x1d')]=_0x11be('0x2e');_0x5742d1['reason']=_0x11be('0x2e');_0x5742d1['answeredelsewheredestinationuniqueid']=_0x4c1f4d[_0x11be('0x12')];_0x5742d1[_0x11be('0x2f')]=_0x4c1f4d[_0x11be('0x6')];writeDB(_0x5742d1);}});}}catch(_0x383604){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x383604);}};exports[_0x11be('0x30')]=function(_0x18cddf){try{if(!_[_0x11be('0x18')](agents[_0x18cddf[_0x11be('0x12')]])){utils['debug'](util['format']('[%s][agents][agentcomplete]',_0x18cddf[_0x11be('0x4')]),_0x18cddf);utils['info'](util[_0x11be('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x18cddf[_0x11be('0x4')],agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x6')],_0x18cddf[_0x11be('0x12')]));agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x30')]=!![];agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt']=utils[_0x11be('0x1c')]();agents[_0x18cddf['destuniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt'],agents[_0x18cddf['destuniqueid']]['agentconnectAt']);agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x28')]=_0x18cddf['reason'];agents[_0x18cddf['destuniqueid']]['lastevent']=_0x11be('0x32');writeDB(agents[_0x18cddf[_0x11be('0x12')]]);}}catch(_0x2cdf2a){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x33'),_0x18cddf[_0x11be('0x4')]),_0x2cdf2a);}};exports[_0x11be('0x34')]=function(_0x2ce110){try{if(!_[_0x11be('0x18')](agents[_0x2ce110[_0x11be('0x35')]])){utils['debug'](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x2ce110);utils['info'](util['format'](_0x11be('0x37'),_0x2ce110['uniqueid'],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x6')],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x4')]));agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x38')]=!![];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x39')]=_0x11be('0x3a');agents[_0x2ce110['transfereruniqueid']][_0x11be('0x3b')]=_0x2ce110['extension'];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x3c')]=agents[_0x2ce110['transfereruniqueid']][_0x11be('0x4')];}}catch(_0x1164a4){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x1164a4);}};exports['attendedtransfer']=function(_0x46764d){try{utils[_0x11be('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x46764d[_0x11be('0x3d')]),_0x46764d);if(_0x46764d[_0x11be('0x3d')]==_0x46764d[_0x11be('0x3e')]){if(!_['isNil'](agents[_0x46764d['secondtransfereruniqueid']])){utils['info'](util[_0x11be('0x2')](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d['secondtransfereruniqueid']]['membername']));agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x39')]='ATTENDED';agents[_0x46764d[_0x11be('0x40')]]['transferexten']=_0x46764d['origtransfererexten'];agents[_0x46764d['secondtransfereruniqueid']]['transferuniqueid']=_0x46764d[_0x11be('0x3d')];}if(_0x46764d[_0x11be('0x41')]&&agents[_0x46764d[_0x11be('0x41')]]){agents[_0x46764d[_0x11be('0x41')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x41')]]=_[_0x11be('0x43')](agents[_0x46764d['transfereeuniqueid']]);transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x44')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x46')]=utils['now']();transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x41')]]['agententerreason']=0x2;}}else if(_0x46764d['secondtransfereruniqueid']==_0x46764d[_0x11be('0x47')]){if(!_[_0x11be('0x18')](agents[_0x46764d[_0x11be('0x3d')]])){utils[_0x11be('0x1')](util['format'](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x6')]));agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x39')]=_0x11be('0x48');agents[_0x46764d['origtransfereruniqueid']]['transferexten']=_0x46764d[_0x11be('0x49')];agents[_0x46764d[_0x11be('0x3d')]]['transferuniqueid']=_0x46764d[_0x11be('0x40')];}if(_0x46764d[_0x11be('0x4a')]&&agents[_0x46764d[_0x11be('0x4a')]]){agents[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x4a')]]=_[_0x11be('0x43')](agents[_0x46764d['transfertargetuniqueid']]);transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x44')];transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x46')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x2;}}}catch(_0x464459){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][attendedtransfer]',_0x46764d['origtransfereruniqueid']),_0x464459);}};exports[_0x11be('0x4b')]=function(_0x554aba){try{utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x4c'),_0x554aba[_0x11be('0x4')]),_0x554aba);if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')]===_0x11be('0x1e')){if(_0x554aba[_0x11be('0x4d')]==='21'){agents[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x4e');agents[_0x554aba[_0x11be('0x4')]]['lastevent']=_0x11be('0x4e');}utils[_0x11be('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba['uniqueid']][_0x11be('0x6')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]));writeDB(agents[_0x554aba['uniqueid']]);var _0x2c80b7=unanswered[_0x11be('0x4f')](_0x554aba[_0x11be('0x4')]);if(_0x2c80b7>-0x1){unanswered[_0x11be('0x50')](_0x2c80b7,0x1);}}if(transfers[_0x554aba[_0x11be('0x4')]]){transfers[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();transfers[_0x554aba['uniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]);transfers[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x52');transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils[_0x11be('0x1')](util['format'](_0x11be('0x53'),_0x554aba[_0x11be('0x4')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x6')],transfers[_0x554aba['uniqueid']][_0x11be('0x28')],transfers[_0x554aba[_0x11be('0x4')]]['lastevent']));writeDB(transfers[_0x554aba[_0x11be('0x4')]],!![]);}if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]){agents[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x554aba[_0x11be('0x4')]]['agentcompleteAt'],agents[_0x554aba[_0x11be('0x4')]]['agentconnectAt']);agents[_0x554aba['uniqueid']][_0x11be('0x28')]=agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x38')]?_0x11be('0x38'):_0x11be('0x52');agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils['info'](util[_0x11be('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba[_0x11be('0x4')]]['membername'],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba['uniqueid']][_0x11be('0x1d')]));writeDB(agents[_0x554aba[_0x11be('0x4')]]);}}catch(_0x56d8d7){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][hangup]',_0x554aba[_0x11be('0x4')]),_0x56d8d7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8843ebc..438b25e 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 _0x1488=['lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','[%s][calls][newexten]','lodash','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','getUserByInternal','accountcode','UserId','request','CreateVoiceCallReport','recording','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','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','xmcs-queue','Queue'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1488,0x88));var _0x8148=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0x1488[_0x4cefc3];return _0x1cc779;};'use strict';var _=require(_0x8148('0x0'));var util=require('util');var utils=require(_0x8148('0x1'));var transfers=require(_0x8148('0x2'));var dispositions=[_0x8148('0x3'),'FAILED','FAILED',_0x8148('0x3'),'NO\x20ANSWER',_0x8148('0x3'),_0x8148('0x4'),_0x8148('0x5'),_0x8148('0x6'),_0x8148('0x6'),_0x8148('0x6')];var channels={};function writeDB(_0x696c2c){var _0x1254e9;if(transfers['blinds'][_0x696c2c[_0x8148('0x7')]]){_0x1254e9=_0x696c2c[_0x8148('0x7')];_0x696c2c[_0x8148('0x7')]=transfers[_0x8148('0x8')][_0x696c2c[_0x8148('0x7')]][_0x8148('0x9')];}utils[_0x8148('0xa')](util[_0x8148('0xb')](_0x8148('0xc'),_0x696c2c[_0x8148('0x7')],_0x696c2c[_0x8148('0xd')],_0x696c2c[_0x8148('0xe')],_0x696c2c['membername'],_0x696c2c[_0x8148('0xf')],_0x696c2c[_0x8148('0x10')],_0x696c2c[_0x8148('0x11')],_0x696c2c['lastevent']));if(_0x696c2c['accountcode']){utils[_0x8148('0x12')](_0x696c2c[_0x8148('0x13')])['then'](function(_0x1bf571){if(_0x1bf571){_0x696c2c[_0x8148('0x14')]=_0x1bf571['id'];}utils[_0x8148('0x15')](_0x8148('0x16'),_0x696c2c);});}else{utils[_0x8148('0x15')]('CreateVoiceCallReport',_0x696c2c);}if(channels[_0x696c2c[_0x8148('0x7')]]){delete channels[_0x696c2c['uniqueid']];}else if(_0x1254e9&&channels[_0x1254e9]){if(!transfers['blinds'][_0x1254e9][_0x8148('0x17')])delete transfers['blinds'][_0x1254e9];delete channels[_0x1254e9];}}exports['newchannel']=function(_0xdb0ed1){try{utils['debug'](util['format']('[%s][calls][newchannel]',_0xdb0ed1[_0x8148('0x7')]),_0xdb0ed1);if(_0xdb0ed1['uniqueid']==_0xdb0ed1['linkedid']&&_0xdb0ed1[_0x8148('0xd')]!='OutgoingSpoolFailed'){utils[_0x8148('0xa')](util['format'](_0x8148('0x18'),_0xdb0ed1[_0x8148('0x7')],_0xdb0ed1[_0x8148('0x19')],_0xdb0ed1[_0x8148('0x1a')]));channels[_0xdb0ed1[_0x8148('0x7')]]={'uniqueid':_0xdb0ed1[_0x8148('0x7')],'accountcode':_0xdb0ed1[_0x8148('0x13')],'source':_0xdb0ed1[_0x8148('0x10')],'destination':_0xdb0ed1[_0x8148('0x1a')],'destinationcontext':_0xdb0ed1[_0x8148('0x19')],'channel':_0xdb0ed1[_0x8148('0xd')],'starttime':utils[_0x8148('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x8148('0x3'),'amaflags':_0x8148('0x1c')};}}catch(_0x5b128a){utils[_0x8148('0x1d')](util[_0x8148('0xb')]('[%s][calls][newchannel]',_0xdb0ed1['uniqueid']),_0x5b128a);}};exports[_0x8148('0x1e')]=function(_0x4bb8a2){try{utils[_0x8148('0x1f')](util[_0x8148('0xb')](_0x8148('0x20'),_0x4bb8a2['uniqueid']),_0x4bb8a2);if(!_['isNil'](channels[_0x4bb8a2[_0x8148('0x7')]])&&_0x4bb8a2[_0x8148('0x21')]==0x6){utils['info'](util[_0x8148('0xb')](_0x8148('0x22'),_0x4bb8a2['uniqueid'],_0x4bb8a2[_0x8148('0x19')],_0x4bb8a2[_0x8148('0xd')]));if(_[_0x8148('0x23')](channels[_0x4bb8a2['uniqueid']][_0x8148('0x24')])){channels[_0x4bb8a2[_0x8148('0x7')]][_0x8148('0x24')]=utils[_0x8148('0x1b')]();}}else if(!_['isNil'](channels[_0x4bb8a2[_0x8148('0x25')]])&&_0x4bb8a2['channelstate']==0x6&&_0x4bb8a2['context']!=_0x8148('0x26')){utils['info'](util[_0x8148('0xb')](_0x8148('0x27'),_0x4bb8a2[_0x8148('0x7')],_0x4bb8a2[_0x8148('0x25')],_0x4bb8a2[_0x8148('0x19')],_0x4bb8a2[_0x8148('0xd')]));channels[_0x4bb8a2[_0x8148('0x25')]]['accountcode']=_0x4bb8a2[_0x8148('0x13')];channels[_0x4bb8a2[_0x8148('0x25')]][_0x8148('0x28')]=_0x4bb8a2['channel'];if(_[_0x8148('0x23')](channels[_0x4bb8a2[_0x8148('0x25')]][_0x8148('0x29')])){channels[_0x4bb8a2[_0x8148('0x25')]][_0x8148('0x29')]=utils['now']();}channels[_0x4bb8a2[_0x8148('0x25')]][_0x8148('0x2a')]=dispositions[_[_0x8148('0x2b')](_0x4bb8a2[_0x8148('0x21')])]||_0x8148('0x4');}}catch(_0x31c765){utils[_0x8148('0x1d')](util[_0x8148('0xb')](_0x8148('0x20'),_0x4bb8a2[_0x8148('0x7')]),_0x31c765);}};exports['hangup']=function(_0x3bcc5c){try{if(!_[_0x8148('0x23')](channels[_0x3bcc5c[_0x8148('0x7')]])){utils[_0x8148('0x1f')](util[_0x8148('0xb')](_0x8148('0x2c'),_0x3bcc5c['uniqueid']),_0x3bcc5c);if(_[_0x8148('0x23')](channels[_0x3bcc5c['uniqueid']]['callerid'])){channels[_0x3bcc5c[_0x8148('0x7')]][_0x8148('0x2d')]=_0x3bcc5c[_0x8148('0x2e')]+'\x20<'+_0x3bcc5c[_0x8148('0x10')]+'>';}utils['info'](util[_0x8148('0xb')](_0x8148('0x2f'),_0x3bcc5c[_0x8148('0x7')],channels[_0x3bcc5c[_0x8148('0x7')]][_0x8148('0x2d')],_0x3bcc5c[_0x8148('0x30')]));channels[_0x3bcc5c['uniqueid']][_0x8148('0x31')]=utils[_0x8148('0x1b')]();channels[_0x3bcc5c[_0x8148('0x7')]][_0x8148('0x32')]=utils['diffTime'](channels[_0x3bcc5c['uniqueid']][_0x8148('0x31')],channels[_0x3bcc5c[_0x8148('0x7')]][_0x8148('0x33')]);channels[_0x3bcc5c['uniqueid']][_0x8148('0x34')]=channels[_0x3bcc5c[_0x8148('0x7')]][_0x8148('0x29')]?utils[_0x8148('0x35')](channels[_0x3bcc5c['uniqueid']][_0x8148('0x31')],channels[_0x3bcc5c['uniqueid']][_0x8148('0x29')]):0x0;writeDB(channels[_0x3bcc5c[_0x8148('0x7')]]);}}catch(_0x320a03){utils['error'](util[_0x8148('0xb')]('[%s][calls][hangup]',_0x3bcc5c[_0x8148('0x7')]),_0x320a03);}};exports['attendedtransfer']=function(_0x3fa045){try{if(!_[_0x8148('0x23')](channels[_0x3fa045[_0x8148('0x36')]])){utils[_0x8148('0x1f')](util[_0x8148('0xb')](_0x8148('0x37'),_0x3fa045[_0x8148('0x38')]),_0x3fa045);if(channels[_0x3fa045[_0x8148('0x36')]][_0x8148('0xd')]==_0x3fa045[_0x8148('0x39')]){utils[_0x8148('0xa')](util['format'](_0x8148('0x3a'),_0x3fa045[_0x8148('0x38')],_0x3fa045[_0x8148('0x36')],_0x3fa045['secondtransfererchannel']));channels[_0x3fa045[_0x8148('0x36')]]['destinationchannel']=_0x3fa045['secondtransfererchannel'];channels[_0x3fa045['localtwolinkedid']][_0x8148('0x3b')]=_0x8148('0x3c');}else if(channels[_0x3fa045['localtwolinkedid']][_0x8148('0xd')]=_0x3fa045['transfertargetchannel']){utils['info'](util[_0x8148('0xb')](_0x8148('0x3a'),_0x3fa045['origtransfereruniqueid'],_0x3fa045[_0x8148('0x36')],_0x3fa045[_0x8148('0x3d')]));channels[_0x3fa045['localtwolinkedid']]['destinationchannel']=_0x3fa045[_0x8148('0x3d')];channels[_0x3fa045[_0x8148('0x36')]][_0x8148('0x3b')]=_0x8148('0x3c');}}}catch(_0x164034){utils[_0x8148('0x1d')](util[_0x8148('0xb')]('[%s][calls][attendedtransfer]',_0x3fa045[_0x8148('0x38')]),_0x164034);}};exports[_0x8148('0x3e')]=function(_0x7aae8e){try{if(!_[_0x8148('0x23')](channels[_0x7aae8e[_0x8148('0x7')]])){utils[_0x8148('0x1f')](util[_0x8148('0xb')](_0x8148('0x3f'),_0x7aae8e[_0x8148('0x7')]),_0x7aae8e);channels[_0x7aae8e['uniqueid']][_0x8148('0x40')]=utils[_0x8148('0x1b')]();utils[_0x8148('0xa')](util[_0x8148('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x7aae8e[_0x8148('0x7')],channels[_0x7aae8e[_0x8148('0x7')]][_0x8148('0x40')]));}}catch(_0x5cd911){utils['error'](util[_0x8148('0xb')](_0x8148('0x3f'),_0x7aae8e[_0x8148('0x7')]),_0x5cd911);}};exports[_0x8148('0x41')]=function(_0x586e73){try{if(!_[_0x8148('0x23')](channels[_0x586e73[_0x8148('0x7')]])){utils['debug'](util['format']('[%s][calls][musiconholdstop]',_0x586e73[_0x8148('0x7')]),_0x586e73);if(!_[_0x8148('0x23')](channels[_0x586e73['uniqueid']]['musiconholdstartAt'])){channels[_0x586e73['uniqueid']][_0x8148('0x42')]+=utils['diffTime'](utils[_0x8148('0x1b')](),channels[_0x586e73[_0x8148('0x7')]][_0x8148('0x40')]);utils[_0x8148('0xa')](util[_0x8148('0xb')](_0x8148('0x43'),_0x586e73[_0x8148('0x7')],channels[_0x586e73[_0x8148('0x7')]][_0x8148('0x42')]));delete channels[_0x586e73[_0x8148('0x7')]][_0x8148('0x40')];}}}catch(_0x725b1e){utils['error'](util['format'](_0x8148('0x44'),_0x586e73[_0x8148('0x7')]),_0x725b1e);}};exports[_0x8148('0x45')]=function(_0x5e1704){try{if(!_[_0x8148('0x23')](channels[_0x5e1704[_0x8148('0x7')]])){utils['debug'](util[_0x8148('0xb')](_0x8148('0x46'),_0x5e1704[_0x8148('0x7')]),_0x5e1704);if(!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')][_0x8148('0x48')])){utils[_0x8148('0xa')](util[_0x8148('0xb')](_0x8148('0x49'),_0x5e1704[_0x8148('0x7')],_0x5e1704[_0x8148('0x4a')]));channels[_0x5e1704[_0x8148('0x7')]]['source']=_0x5e1704['value'];}if(!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')][_0x8148('0x4b')])){utils[_0x8148('0xa')](util[_0x8148('0xb')](_0x8148('0x4c'),_0x5e1704['uniqueid'],_0x5e1704['value']));channels[_0x5e1704['uniqueid']][_0x8148('0x4d')]=_0x5e1704[_0x8148('0x4a')];channels[_0x5e1704[_0x8148('0x7')]][_0x8148('0x2d')]='\x22'+_0x5e1704[_0x8148('0x4a')]+'\x22\x20<'+_0x5e1704[_0x8148('0x4a')]+'>';}if(!_['isNil'](_0x5e1704['variable'][_0x8148('0x4e')])||!_[_0x8148('0x23')](_0x5e1704['variable'][_0x8148('0x4f')])){utils['info'](util[_0x8148('0xb')](_0x8148('0x50'),_0x5e1704[_0x8148('0x7')],!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')][_0x8148('0x4e')])?_0x8148('0x4e'):_0x8148('0x4f'),_0x5e1704[_0x8148('0x4a')]));channels[_0x5e1704[_0x8148('0x7')]][_0x8148('0x2d')]=_0x5e1704[_0x8148('0x4a')];}if(!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')][_0x8148('0x51')])||!_['isNil'](_0x5e1704[_0x8148('0x47')][_0x8148('0x52')])){utils[_0x8148('0xa')](util[_0x8148('0xb')](_0x8148('0x50'),_0x5e1704['uniqueid'],!_[_0x8148('0x23')](_0x5e1704['variable'][_0x8148('0x51')])?'xmd-queue':'xmcs-queue',_0x5e1704['value']));channels[_0x5e1704[_0x8148('0x7')]]['lastapplication']=_0x8148('0x53');channels[_0x5e1704[_0x8148('0x7')]][_0x8148('0x54')]=_0x5e1704[_0x8148('0x4a')];channels[_0x5e1704[_0x8148('0x7')]]['queue']=!![];}if(!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')]['xmd-contactid'])){utils['info'](util[_0x8148('0xb')](_0x8148('0x55'),_0x5e1704[_0x8148('0x7')],_0x5e1704['value']));channels[_0x5e1704['uniqueid']][_0x8148('0x56')]=_0x5e1704[_0x8148('0x4a')];}if(!_['isNil'](_0x5e1704[_0x8148('0x47')][_0x8148('0x57')])){utils['info'](util[_0x8148('0xb')](_0x8148('0x58'),_0x5e1704[_0x8148('0x7')],_0x5e1704[_0x8148('0x4a')]));channels[_0x5e1704[_0x8148('0x7')]]['type']=_0x5e1704['value'];}if(!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')][_0x8148('0x59')])){utils['info'](util[_0x8148('0xb')](_0x8148('0x5a'),_0x5e1704[_0x8148('0x7')],_0x5e1704['value']));channels[_0x5e1704[_0x8148('0x7')]][_0x8148('0x5b')]=_0x5e1704[_0x8148('0x4a')];}if(!_[_0x8148('0x23')](_0x5e1704[_0x8148('0x47')][_0x8148('0x5c')])){utils[_0x8148('0xa')](util[_0x8148('0xb')](_0x8148('0x5d'),_0x5e1704[_0x8148('0x7')],_0x5e1704['value']));channels[_0x5e1704[_0x8148('0x7')]][_0x8148('0x5c')]=_0x5e1704['value'];}}}catch(_0x3bd224){utils[_0x8148('0x1d')](util['format']('[%s][calls][varset]',_0x5e1704[_0x8148('0x7')]),_0x3bd224);}};exports[_0x8148('0x5e')]=function(_0xe216ee){try{if(!_[_0x8148('0x23')](channels[_0xe216ee[_0x8148('0x7')]])){utils[_0x8148('0x1f')](util[_0x8148('0xb')]('[%s][calls][newexten]',_0xe216ee['uniqueid']),_0xe216ee);utils['info'](util['format'](_0x8148('0x5f'),_0xe216ee[_0x8148('0x7')],_0xe216ee[_0x8148('0x60')],_0xe216ee[_0x8148('0x61')]));if(_0xe216ee[_0x8148('0x60')][_0x8148('0x62')]()==_0x8148('0x63')&&_['startsWith'](_0xe216ee['appdata'][_0x8148('0x62')](),_0x8148('0x64'))){var _0x3a07e1=_0xe216ee['appdata'][_0x8148('0x65')]('=');var _0x365fcb=_0x3a07e1[0x0][_0x8148('0x66')](_0x3a07e1[0x0][_0x8148('0x67')]('(')+0x1,_0x3a07e1[0x0][_0x8148('0x67')](')'));var _0x354f93=_0x3a07e1[0x1];channels[_0xe216ee[_0x8148('0x7')]][_0x365fcb]=_0x354f93;}if(!_[_0x8148('0x68')]([_0x8148('0x69'),_0x8148('0x6a'),_0x8148('0x6b'),'set',_0x8148('0x6c')],_0xe216ee[_0x8148('0x60')][_0x8148('0x62')]())){channels[_0xe216ee[_0x8148('0x7')]]['lastapplication']=_0xe216ee[_0x8148('0x60')];channels[_0xe216ee[_0x8148('0x7')]][_0x8148('0x54')]=_0xe216ee[_0x8148('0x61')];}}}catch(_0x4b1926){utils['error'](util[_0x8148('0xb')](_0x8148('0x6d'),_0xe216ee[_0x8148('0x7')]),_0x4b1926);}}; \ No newline at end of file +var _0x4e99=['channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','endtime','duration','diffTime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','gotoif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','format','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil'];(function(_0x5ed2e5,_0x13ae2e){var _0x578fc6=function(_0x55d796){while(--_0x55d796){_0x5ed2e5['push'](_0x5ed2e5['shift']());}};_0x578fc6(++_0x13ae2e);}(_0x4e99,0x122));var _0x94e9=function(_0x46b58b,_0x4002db){_0x46b58b=_0x46b58b-0x0;var _0x332218=_0x4e99[_0x46b58b];return _0x332218;};'use strict';var _=require('lodash');var util=require(_0x94e9('0x0'));var utils=require(_0x94e9('0x1'));var transfers=require(_0x94e9('0x2'));var dispositions=[_0x94e9('0x3'),'FAILED',_0x94e9('0x4'),'NO\x20ANSWER',_0x94e9('0x3'),_0x94e9('0x3'),_0x94e9('0x5'),'BUSY',_0x94e9('0x4'),'FAILED',_0x94e9('0x4')];var channels={};function writeDB(_0x368e50){var _0x3986a4;if(transfers['blinds'][_0x368e50[_0x94e9('0x6')]]){_0x3986a4=_0x368e50[_0x94e9('0x6')];_0x368e50['uniqueid']=transfers[_0x94e9('0x7')][_0x368e50['uniqueid']][_0x94e9('0x8')];}utils[_0x94e9('0x9')](util['format'](_0x94e9('0xa'),_0x368e50[_0x94e9('0x6')],_0x368e50[_0x94e9('0xb')],_0x368e50[_0x94e9('0xc')],_0x368e50[_0x94e9('0xd')],_0x368e50[_0x94e9('0xe')],_0x368e50[_0x94e9('0xf')],_0x368e50[_0x94e9('0x10')],_0x368e50[_0x94e9('0x11')]));if(_0x368e50[_0x94e9('0x12')]){utils[_0x94e9('0x13')](_0x368e50[_0x94e9('0x12')])[_0x94e9('0x14')](function(_0x4550a7){if(_0x4550a7){_0x368e50[_0x94e9('0x15')]=_0x4550a7['id'];}utils[_0x94e9('0x16')](_0x94e9('0x17'),_0x368e50);});}else{utils[_0x94e9('0x16')]('CreateVoiceCallReport',_0x368e50);}if(channels[_0x368e50[_0x94e9('0x6')]]){delete channels[_0x368e50[_0x94e9('0x6')]];}else if(_0x3986a4&&channels[_0x3986a4]){if(!transfers[_0x94e9('0x7')][_0x3986a4]['recording'])delete transfers['blinds'][_0x3986a4];delete channels[_0x3986a4];}}exports['newchannel']=function(_0x4e8d64){try{utils[_0x94e9('0x18')](util[_0x94e9('0x19')]('[%s][calls][newchannel]',_0x4e8d64[_0x94e9('0x6')]),_0x4e8d64);if(_0x4e8d64['uniqueid']==_0x4e8d64[_0x94e9('0x1a')]&&_0x4e8d64['channel']!=_0x94e9('0x1b')){utils[_0x94e9('0x9')](util['format'](_0x94e9('0x1c'),_0x4e8d64['uniqueid'],_0x4e8d64[_0x94e9('0x1d')],_0x4e8d64['exten']));channels[_0x4e8d64[_0x94e9('0x6')]]={'uniqueid':_0x4e8d64['uniqueid'],'accountcode':_0x4e8d64[_0x94e9('0x12')],'source':_0x4e8d64[_0x94e9('0xf')],'destination':_0x4e8d64[_0x94e9('0x1e')],'destinationcontext':_0x4e8d64[_0x94e9('0x1d')],'channel':_0x4e8d64[_0x94e9('0xb')],'starttime':utils[_0x94e9('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x94e9('0x3'),'amaflags':_0x94e9('0x20')};}}catch(_0x4f7088){utils[_0x94e9('0x21')](util[_0x94e9('0x19')]('[%s][calls][newchannel]',_0x4e8d64['uniqueid']),_0x4f7088);}};exports[_0x94e9('0x22')]=function(_0x38f889){try{utils['debug'](util['format'](_0x94e9('0x23'),_0x38f889[_0x94e9('0x6')]),_0x38f889);if(!_[_0x94e9('0x24')](channels[_0x38f889[_0x94e9('0x6')]])&&_0x38f889[_0x94e9('0x25')]==0x6){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x26'),_0x38f889[_0x94e9('0x6')],_0x38f889['context'],_0x38f889[_0x94e9('0xb')]));if(_[_0x94e9('0x24')](channels[_0x38f889[_0x94e9('0x6')]][_0x94e9('0x27')])){channels[_0x38f889[_0x94e9('0x6')]][_0x94e9('0x27')]=utils[_0x94e9('0x1f')]();}}else if(!_['isNil'](channels[_0x38f889['linkedid']])&&_0x38f889[_0x94e9('0x25')]==0x6&&_0x38f889[_0x94e9('0x1d')]!=_0x94e9('0x28')){utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x38f889[_0x94e9('0x6')],_0x38f889[_0x94e9('0x1a')],_0x38f889['context'],_0x38f889['channel']));channels[_0x38f889[_0x94e9('0x1a')]][_0x94e9('0x12')]=_0x38f889[_0x94e9('0x12')];channels[_0x38f889['linkedid']][_0x94e9('0x29')]=_0x38f889['channel'];if(_[_0x94e9('0x24')](channels[_0x38f889['linkedid']][_0x94e9('0x2a')])){channels[_0x38f889[_0x94e9('0x1a')]][_0x94e9('0x2a')]=utils['now']();}channels[_0x38f889[_0x94e9('0x1a')]][_0x94e9('0x2b')]=dispositions[_[_0x94e9('0x2c')](_0x38f889[_0x94e9('0x25')])]||_0x94e9('0x5');}}catch(_0xd5971f){utils[_0x94e9('0x21')](util[_0x94e9('0x19')]('[%s][calls][newstate]',_0x38f889[_0x94e9('0x6')]),_0xd5971f);}};exports[_0x94e9('0x2d')]=function(_0x44b014){try{if(!_[_0x94e9('0x24')](channels[_0x44b014[_0x94e9('0x6')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')]('[%s][calls][hangup]',_0x44b014['uniqueid']),_0x44b014);if(_[_0x94e9('0x24')](channels[_0x44b014['uniqueid']][_0x94e9('0x2e')])){channels[_0x44b014['uniqueid']]['callerid']=_0x44b014[_0x94e9('0x2f')]+'\x20<'+_0x44b014[_0x94e9('0xf')]+'>';}utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x44b014['uniqueid'],channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x2e')],_0x44b014['cause-txt']));channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x30')]=utils['now']();channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x31')]=utils[_0x94e9('0x32')](channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x30')],channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x33')]);channels[_0x44b014[_0x94e9('0x6')]]['billableseconds']=channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x2a')]?utils[_0x94e9('0x32')](channels[_0x44b014['uniqueid']]['endtime'],channels[_0x44b014['uniqueid']][_0x94e9('0x2a')]):0x0;writeDB(channels[_0x44b014[_0x94e9('0x6')]]);}}catch(_0x4edf27){utils[_0x94e9('0x21')](util[_0x94e9('0x19')](_0x94e9('0x34'),_0x44b014['uniqueid']),_0x4edf27);}};exports[_0x94e9('0x35')]=function(_0x569973){try{if(!_[_0x94e9('0x24')](channels[_0x569973[_0x94e9('0x36')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')]('[%s][calls][attendedtransfer]',_0x569973[_0x94e9('0x37')]),_0x569973);if(channels[_0x569973[_0x94e9('0x36')]][_0x94e9('0xb')]==_0x569973[_0x94e9('0x38')]){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x39'),_0x569973[_0x94e9('0x37')],_0x569973[_0x94e9('0x36')],_0x569973[_0x94e9('0x3a')]));channels[_0x569973[_0x94e9('0x36')]][_0x94e9('0x29')]=_0x569973[_0x94e9('0x3a')];channels[_0x569973[_0x94e9('0x36')]][_0x94e9('0x3b')]=_0x94e9('0x3c');}else if(channels[_0x569973['localtwolinkedid']][_0x94e9('0xb')]=_0x569973[_0x94e9('0x3d')]){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x39'),_0x569973[_0x94e9('0x37')],_0x569973[_0x94e9('0x36')],_0x569973[_0x94e9('0x3e')]));channels[_0x569973[_0x94e9('0x36')]]['destinationchannel']=_0x569973[_0x94e9('0x3e')];channels[_0x569973[_0x94e9('0x36')]]['userfield']='_attended';}}}catch(_0x254f82){utils['error'](util[_0x94e9('0x19')]('[%s][calls][attendedtransfer]',_0x569973[_0x94e9('0x37')]),_0x254f82);}};exports[_0x94e9('0x3f')]=function(_0x5c9565){try{if(!_[_0x94e9('0x24')](channels[_0x5c9565[_0x94e9('0x6')]])){utils['debug'](util[_0x94e9('0x19')]('[%s][calls][musiconholdstart]',_0x5c9565[_0x94e9('0x6')]),_0x5c9565);channels[_0x5c9565[_0x94e9('0x6')]][_0x94e9('0x40')]=utils[_0x94e9('0x1f')]();utils['info'](util[_0x94e9('0x19')](_0x94e9('0x41'),_0x5c9565['uniqueid'],channels[_0x5c9565[_0x94e9('0x6')]][_0x94e9('0x40')]));}}catch(_0x28c469){utils[_0x94e9('0x21')](util[_0x94e9('0x19')](_0x94e9('0x42'),_0x5c9565['uniqueid']),_0x28c469);}};exports[_0x94e9('0x43')]=function(_0x349582){try{if(!_[_0x94e9('0x24')](channels[_0x349582[_0x94e9('0x6')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')](_0x94e9('0x44'),_0x349582['uniqueid']),_0x349582);if(!_[_0x94e9('0x24')](channels[_0x349582[_0x94e9('0x6')]][_0x94e9('0x40')])){channels[_0x349582[_0x94e9('0x6')]][_0x94e9('0x45')]+=utils[_0x94e9('0x32')](utils['now'](),channels[_0x349582[_0x94e9('0x6')]]['musiconholdstartAt']);utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x46'),_0x349582['uniqueid'],channels[_0x349582[_0x94e9('0x6')]][_0x94e9('0x45')]));delete channels[_0x349582['uniqueid']]['musiconholdstartAt'];}}}catch(_0x459ac9){utils[_0x94e9('0x21')](util['format'](_0x94e9('0x44'),_0x349582[_0x94e9('0x6')]),_0x459ac9);}};exports[_0x94e9('0x47')]=function(_0x51adf2){try{if(!_['isNil'](channels[_0x51adf2[_0x94e9('0x6')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')](_0x94e9('0x48'),_0x51adf2['uniqueid']),_0x51adf2);if(!_[_0x94e9('0x24')](_0x51adf2['variable'][_0x94e9('0x49')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x4b')]=_0x51adf2[_0x94e9('0x4a')];}if(!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x4d')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x4e'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x4f')]=_0x51adf2[_0x94e9('0x4a')];channels[_0x51adf2['uniqueid']][_0x94e9('0x2e')]='\x22'+_0x51adf2[_0x94e9('0x4a')]+_0x94e9('0x50')+_0x51adf2[_0x94e9('0x4a')]+'>';}if(!_['isNil'](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x51')])||!_[_0x94e9('0x24')](_0x51adf2['variable'][_0x94e9('0x52')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x53'),_0x51adf2['uniqueid'],!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x51')])?_0x94e9('0x51'):_0x94e9('0x52'),_0x51adf2['value']));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x2e')]=_0x51adf2['value'];}if(!_[_0x94e9('0x24')](_0x51adf2['variable'][_0x94e9('0x54')])||!_['isNil'](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x55')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x53'),_0x51adf2['uniqueid'],!_['isNil'](_0x51adf2['variable']['xmd-queue'])?_0x94e9('0x54'):'xmcs-queue',_0x51adf2['value']));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x56')]=_0x94e9('0x57');channels[_0x51adf2['uniqueid']][_0x94e9('0x58')]=_0x51adf2['value'];channels[_0x51adf2['uniqueid']][_0x94e9('0xc')]=!![];}if(!_[_0x94e9('0x24')](_0x51adf2['variable']['xmd-contactid'])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x59'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]]['ContactId']=_0x51adf2[_0x94e9('0x4a')];}if(!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')]['xmd-cdrtype'])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x5a')]=_0x51adf2['value'];}if(!_['isNil'](_0x51adf2['variable'][_0x94e9('0x5b')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x5c'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x5d')]=_0x51adf2[_0x94e9('0x4a')];}if(!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x5e')])){utils['info'](util[_0x94e9('0x19')](_0x94e9('0x5f'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2['uniqueid']][_0x94e9('0x5e')]=_0x51adf2[_0x94e9('0x4a')];}}}catch(_0x3ad04a){utils[_0x94e9('0x21')](util[_0x94e9('0x19')]('[%s][calls][varset]',_0x51adf2[_0x94e9('0x6')]),_0x3ad04a);}};exports[_0x94e9('0x60')]=function(_0x4b0898){try{if(!_[_0x94e9('0x24')](channels[_0x4b0898['uniqueid']])){utils['debug'](util[_0x94e9('0x19')](_0x94e9('0x61'),_0x4b0898[_0x94e9('0x6')]),_0x4b0898);utils['info'](util[_0x94e9('0x19')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4b0898['uniqueid'],_0x4b0898[_0x94e9('0x62')],_0x4b0898['appdata']));if(_0x4b0898[_0x94e9('0x62')][_0x94e9('0x63')]()==_0x94e9('0x64')&&_[_0x94e9('0x65')](_0x4b0898[_0x94e9('0x66')][_0x94e9('0x63')](),_0x94e9('0x67'))){var _0x344614=_0x4b0898['appdata'][_0x94e9('0x68')]('=');var _0x49309b=_0x344614[0x0][_0x94e9('0x69')](_0x344614[0x0][_0x94e9('0x6a')]('(')+0x1,_0x344614[0x0][_0x94e9('0x6a')](')'));var _0x27e7cc=_0x344614[0x1];channels[_0x4b0898[_0x94e9('0x6')]][_0x49309b]=_0x27e7cc;}if(!_['includes']([_0x94e9('0x2d'),_0x94e9('0x6b'),'execif','set',_0x94e9('0x6c')],_0x4b0898['application'][_0x94e9('0x63')]())){channels[_0x4b0898[_0x94e9('0x6')]][_0x94e9('0x56')]=_0x4b0898[_0x94e9('0x62')];channels[_0x4b0898[_0x94e9('0x6')]][_0x94e9('0x58')]=_0x4b0898['appdata'];}}}catch(_0x393405){utils[_0x94e9('0x21')](util[_0x94e9('0x19')](_0x94e9('0x61'),_0x4b0898[_0x94e9('0x6')]),_0x393405);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 39edead..2e721b3 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 _0xa994=['managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close'];(function(_0x2bb3e8,_0x1ca208){var _0x16855d=function(_0x3efdb5){while(--_0x3efdb5){_0x2bb3e8['push'](_0x2bb3e8['shift']());}};_0x16855d(++_0x1ca208);}(_0xa994,0x173));var _0x4a99=function(_0x1db190,_0x39b180){_0x1db190=_0x1db190-0x0;var _0x193e30=_0xa994[_0x1db190];return _0x193e30;};'use strict';var utils=require(_0x4a99('0x0'));exports[_0x4a99('0x1')]=function(){utils[_0x4a99('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils['info'](_0x4a99('0x3'));};exports[_0x4a99('0x4')]=function(){utils[_0x4a99('0x2')](_0x4a99('0x5'));};exports['error']=function(_0x5e1322){utils[_0x4a99('0x6')]('[core]\x20error',_0x5e1322);};exports[_0x4a99('0x7')]=function(){utils[_0x4a99('0x2')](_0x4a99('0x8'));};exports[_0x4a99('0x9')]=function(_0x552ca8){}; \ No newline at end of file +var _0xacc6=['[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0xacc6,0x11d));var _0x6acc=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xacc6[_0x272638];return _0x19d027;};'use strict';var utils=require(_0x6acc('0x0'));exports[_0x6acc('0x1')]=function(){utils[_0x6acc('0x2')](_0x6acc('0x3'));};exports[_0x6acc('0x4')]=function(){utils[_0x6acc('0x2')]('[core]\x20shutdown');};exports[_0x6acc('0x5')]=function(){utils[_0x6acc('0x2')](_0x6acc('0x6'));};exports[_0x6acc('0x7')]=function(_0x3db805){utils[_0x6acc('0x7')](_0x6acc('0x8'),_0x3db805);};exports[_0x6acc('0x9')]=function(){utils['info'](_0x6acc('0xa'));};exports[_0x6acc('0xb')]=function(_0x2e7648){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 1737b8b..34c2565 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 _0xa63a=['cause-txt','complete','duration','diffTime','endtime','holdtime','util','./utils','info','format','uniqueid','calleridnum','dialstatus','request','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname'];(function(_0x411f4d,_0x2a29e0){var _0x4cc9c0=function(_0xeeb98d){while(--_0xeeb98d){_0x411f4d['push'](_0x411f4d['shift']());}};_0x4cc9c0(++_0x2a29e0);}(_0xa63a,0x15d));var _0xaa63=function(_0x4c1b76,_0x2cdc2d){_0x4c1b76=_0x4c1b76-0x0;var _0x3ace6b=_0xa63a[_0x4c1b76];return _0x3ace6b;};'use strict';var _=require('lodash');var util=require(_0xaa63('0x0'));var utils=require(_0xaa63('0x1'));var dials={};function writeDB(_0x84007){utils[_0xaa63('0x2')](util[_0xaa63('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x84007[_0xaa63('0x4')],_0x84007['channel'],_0x84007['dialstring'],_0x84007[_0xaa63('0x5')],_0x84007['connectedlinenum'],_0x84007[_0xaa63('0x6')]));utils[_0xaa63('0x7')]('CreateVoiceDialReport',_0x84007);delete dials[_0x84007[_0xaa63('0x4')]];}exports[_0xaa63('0x8')]=function(_0x3fd11b){try{utils[_0xaa63('0x9')](util['format'](_0xaa63('0xa'),_0x3fd11b[_0xaa63('0x4')]),_0x3fd11b);utils[_0xaa63('0x2')](util[_0xaa63('0x3')](_0xaa63('0xb'),_0x3fd11b[_0xaa63('0x4')],_0x3fd11b[_0xaa63('0xc')],_0x3fd11b[_0xaa63('0xd')]));if(_0x3fd11b['application'][_0xaa63('0xe')]()==_0xaa63('0xf')&&_[_0xaa63('0x10')](_0x3fd11b[_0xaa63('0xd')][_0xaa63('0xe')](),'cdr(routeid)')){var _0x26d01c=_0x3fd11b[_0xaa63('0xd')][_0xaa63('0x11')]('=');dials[_0x3fd11b['uniqueid']]={'routeId':_0x26d01c[0x1]};}}catch(_0x1fbdfe){utils[_0xaa63('0x12')](util[_0xaa63('0x3')]('[%s][dials][newexten]',_0x3fd11b[_0xaa63('0x4')]),_0x1fbdfe);}};exports[_0xaa63('0x13')]=function(_0xe11d86){try{utils[_0xaa63('0x9')](util[_0xaa63('0x3')]('[%s][dials][varset]',_0xe11d86[_0xaa63('0x4')]),_0xe11d86);if(!_[_0xaa63('0x14')](_0xe11d86[_0xaa63('0x15')][_0xaa63('0x16')])){utils[_0xaa63('0x2')](util[_0xaa63('0x3')](_0xaa63('0x17'),_0xe11d86[_0xaa63('0x4')],_0xe11d86[_0xaa63('0x18')]));dials[_0xe11d86['uniqueid']]={'routeId':_0xe11d86[_0xaa63('0x18')]};}}catch(_0x4a9f43){utils[_0xaa63('0x12')](util[_0xaa63('0x3')](_0xaa63('0x19'),_0xe11d86['uniqueid']),_0x4a9f43);}};exports[_0xaa63('0x1a')]=function(_0x1a0522){try{if(!_[_0xaa63('0x14')](dials[_0x1a0522[_0xaa63('0x4')]])){utils[_0xaa63('0x9')](util[_0xaa63('0x3')](_0xaa63('0x1b'),_0x1a0522[_0xaa63('0x4')]),_0x1a0522);dials[_0x1a0522[_0xaa63('0x4')]]=_[_0xaa63('0x1c')](dials[_0x1a0522['uniqueid']],_0x1a0522);dials[_0x1a0522[_0xaa63('0x4')]][_0xaa63('0x1d')]=utils['now']();dials[_0x1a0522['uniqueid']][_0xaa63('0x1e')]=_0xaa63('0x1f');utils[_0xaa63('0x2')](util['format'](_0xaa63('0x20'),_0x1a0522['uniqueid'],dials[_0x1a0522[_0xaa63('0x4')]][_0xaa63('0x1d')]));}}catch(_0x27b5ae){utils[_0xaa63('0x12')](util[_0xaa63('0x3')](_0xaa63('0x1b'),_0x1a0522['uniqueid']),_0x27b5ae);}};exports[_0xaa63('0x21')]=function(_0x52316e){try{if(!_[_0xaa63('0x14')](dials[_0x52316e[_0xaa63('0x4')]])){utils[_0xaa63('0x9')](util['format']('[%s][dials][dialend]',_0x52316e[_0xaa63('0x4')]),_0x52316e);dials[_0x52316e[_0xaa63('0x4')]][_0xaa63('0x6')]=_0x52316e[_0xaa63('0x6')];if(_0x52316e[_0xaa63('0x6')]==_0xaa63('0x22')){dials[_0x52316e[_0xaa63('0x4')]]=_[_0xaa63('0x1c')](dials[_0x52316e[_0xaa63('0x4')]],_0x52316e);dials[_0x52316e[_0xaa63('0x4')]][_0xaa63('0x23')]=utils[_0xaa63('0x24')]();dials[_0x52316e[_0xaa63('0x4')]][_0xaa63('0x1e')]=_0xaa63('0x25');utils[_0xaa63('0x2')](util[_0xaa63('0x3')](_0xaa63('0x26'),_0x52316e[_0xaa63('0x4')],_0x52316e[_0xaa63('0x6')],dials[_0x52316e[_0xaa63('0x4')]]['answertime']));}else{utils[_0xaa63('0x2')](util[_0xaa63('0x3')](_0xaa63('0x27'),_0x52316e[_0xaa63('0x4')],_0x52316e['dialstatus']));}}}catch(_0x193d6f){utils[_0xaa63('0x12')](util['format']('[%s][dials][dialend]',_0x52316e[_0xaa63('0x4')]),_0x193d6f);}};exports[_0xaa63('0x28')]=function(_0x3e05bf){try{if(!_[_0xaa63('0x14')](dials[_0x3e05bf[_0xaa63('0x4')]])){utils[_0xaa63('0x9')](util[_0xaa63('0x3')](_0xaa63('0x29'),_0x3e05bf[_0xaa63('0x4')]),_0x3e05bf);utils[_0xaa63('0x2')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x3e05bf['uniqueid'],_0x3e05bf[_0xaa63('0x5')],_0x3e05bf[_0xaa63('0x2a')],_0x3e05bf[_0xaa63('0x2b')]));dials[_0x3e05bf['uniqueid']]=_[_0xaa63('0x1c')](dials[_0x3e05bf[_0xaa63('0x4')]],{'endtime':utils['now'](),'lastevent':_0xaa63('0x2c')});dials[_0x3e05bf[_0xaa63('0x4')]][_0xaa63('0x2d')]=utils[_0xaa63('0x2e')](dials[_0x3e05bf[_0xaa63('0x4')]][_0xaa63('0x2f')],dials[_0x3e05bf['uniqueid']]['starttime']);dials[_0x3e05bf[_0xaa63('0x4')]][_0xaa63('0x30')]=utils[_0xaa63('0x2e')](dials[_0x3e05bf['uniqueid']][_0xaa63('0x23')]||dials[_0x3e05bf[_0xaa63('0x4')]][_0xaa63('0x2f')],dials[_0x3e05bf[_0xaa63('0x4')]]['starttime']);dials[_0x3e05bf[_0xaa63('0x4')]]['billableseconds']=dials[_0x3e05bf[_0xaa63('0x4')]]['answertime']?utils[_0xaa63('0x2e')](dials[_0x3e05bf[_0xaa63('0x4')]]['endtime'],dials[_0x3e05bf[_0xaa63('0x4')]][_0xaa63('0x23')]):0x0;writeDB(dials[_0x3e05bf[_0xaa63('0x4')]]);}}catch(_0x5b662e){utils['error'](util[_0xaa63('0x3')]('[%s][dials][hangup]',_0x3e05bf[_0xaa63('0x4')]),_0x5b662e);}}; \ No newline at end of file +var _0xc173=['request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','cause-txt','complete','diffTime','billableseconds','[%s][dials][hangup]','./utils','info','format','uniqueid','channel','dialstring','dialstatus'];(function(_0x57d895,_0x19c3cd){var _0x445702=function(_0x1fa774){while(--_0x1fa774){_0x57d895['push'](_0x57d895['shift']());}};_0x445702(++_0x19c3cd);}(_0xc173,0x1d9));var _0x3c17=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc173[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3c17('0x0'));var dials={};function writeDB(_0x1aea6c){utils[_0x3c17('0x1')](util[_0x3c17('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1aea6c[_0x3c17('0x3')],_0x1aea6c[_0x3c17('0x4')],_0x1aea6c[_0x3c17('0x5')],_0x1aea6c['calleridnum'],_0x1aea6c['connectedlinenum'],_0x1aea6c[_0x3c17('0x6')]));utils[_0x3c17('0x7')](_0x3c17('0x8'),_0x1aea6c);delete dials[_0x1aea6c[_0x3c17('0x3')]];}exports[_0x3c17('0x9')]=function(_0x418a46){try{utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0xb'),_0x418a46[_0x3c17('0x3')]),_0x418a46);utils[_0x3c17('0x1')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x418a46[_0x3c17('0x3')],_0x418a46[_0x3c17('0xc')],_0x418a46[_0x3c17('0xd')]));if(_0x418a46['application'][_0x3c17('0xe')]()==_0x3c17('0xf')&&_[_0x3c17('0x10')](_0x418a46[_0x3c17('0xd')][_0x3c17('0xe')](),_0x3c17('0x11'))){var _0x173235=_0x418a46[_0x3c17('0xd')][_0x3c17('0x12')]('=');dials[_0x418a46[_0x3c17('0x3')]]={'routeId':_0x173235[0x1]};}}catch(_0x3fff1f){utils[_0x3c17('0x13')](util['format'](_0x3c17('0xb'),_0x418a46[_0x3c17('0x3')]),_0x3fff1f);}};exports[_0x3c17('0x14')]=function(_0x55ed73){try{utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0x15'),_0x55ed73['uniqueid']),_0x55ed73);if(!_[_0x3c17('0x16')](_0x55ed73[_0x3c17('0x17')][_0x3c17('0x18')])){utils[_0x3c17('0x1')](util['format'](_0x3c17('0x19'),_0x55ed73[_0x3c17('0x3')],_0x55ed73[_0x3c17('0x1a')]));dials[_0x55ed73[_0x3c17('0x3')]]={'routeId':_0x55ed73[_0x3c17('0x1a')]};}}catch(_0x30703a){utils['error'](util[_0x3c17('0x2')](_0x3c17('0x15'),_0x55ed73[_0x3c17('0x3')]),_0x30703a);}};exports['dialbegin']=function(_0x266e3e){try{if(!_[_0x3c17('0x16')](dials[_0x266e3e['uniqueid']])){utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0x1b'),_0x266e3e[_0x3c17('0x3')]),_0x266e3e);dials[_0x266e3e[_0x3c17('0x3')]]=_[_0x3c17('0x1c')](dials[_0x266e3e[_0x3c17('0x3')]],_0x266e3e);dials[_0x266e3e[_0x3c17('0x3')]][_0x3c17('0x1d')]=utils['now']();dials[_0x266e3e[_0x3c17('0x3')]]['lastevent']=_0x3c17('0x1e');utils['info'](util['format'](_0x3c17('0x1f'),_0x266e3e[_0x3c17('0x3')],dials[_0x266e3e[_0x3c17('0x3')]][_0x3c17('0x1d')]));}}catch(_0x2da5e5){utils[_0x3c17('0x13')](util[_0x3c17('0x2')](_0x3c17('0x1b'),_0x266e3e[_0x3c17('0x3')]),_0x2da5e5);}};exports['dialend']=function(_0x5118f8){try{if(!_[_0x3c17('0x16')](dials[_0x5118f8['uniqueid']])){utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0x20'),_0x5118f8[_0x3c17('0x3')]),_0x5118f8);dials[_0x5118f8[_0x3c17('0x3')]]['dialstatus']=_0x5118f8[_0x3c17('0x6')];if(_0x5118f8[_0x3c17('0x6')]==_0x3c17('0x21')){dials[_0x5118f8['uniqueid']]=_['assign'](dials[_0x5118f8[_0x3c17('0x3')]],_0x5118f8);dials[_0x5118f8[_0x3c17('0x3')]]['answertime']=utils[_0x3c17('0x22')]();dials[_0x5118f8[_0x3c17('0x3')]][_0x3c17('0x23')]=_0x3c17('0x24');utils[_0x3c17('0x1')](util[_0x3c17('0x2')](_0x3c17('0x25'),_0x5118f8['uniqueid'],_0x5118f8[_0x3c17('0x6')],dials[_0x5118f8[_0x3c17('0x3')]][_0x3c17('0x26')]));}else{utils[_0x3c17('0x1')](util[_0x3c17('0x2')](_0x3c17('0x27'),_0x5118f8[_0x3c17('0x3')],_0x5118f8[_0x3c17('0x6')]));}}}catch(_0x31ec16){utils[_0x3c17('0x13')](util[_0x3c17('0x2')]('[%s][dials][dialend]',_0x5118f8[_0x3c17('0x3')]),_0x31ec16);}};exports[_0x3c17('0x28')]=function(_0x3ea118){try{if(!_[_0x3c17('0x16')](dials[_0x3ea118[_0x3c17('0x3')]])){utils[_0x3c17('0xa')](util[_0x3c17('0x2')]('[%s][dials][hangup]',_0x3ea118[_0x3c17('0x3')]),_0x3ea118);utils[_0x3c17('0x1')](util[_0x3c17('0x2')](_0x3c17('0x29'),_0x3ea118[_0x3c17('0x3')],_0x3ea118[_0x3c17('0x2a')],_0x3ea118['calleridname'],_0x3ea118[_0x3c17('0x2b')]));dials[_0x3ea118[_0x3c17('0x3')]]=_[_0x3c17('0x1c')](dials[_0x3ea118[_0x3c17('0x3')]],{'endtime':utils[_0x3c17('0x22')](),'lastevent':_0x3c17('0x2c')});dials[_0x3ea118[_0x3c17('0x3')]]['duration']=utils[_0x3c17('0x2d')](dials[_0x3ea118[_0x3c17('0x3')]]['endtime'],dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x1d')]);dials[_0x3ea118[_0x3c17('0x3')]]['holdtime']=utils['diffTime'](dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x26')]||dials[_0x3ea118[_0x3c17('0x3')]]['endtime'],dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x1d')]);dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x2e')]=dials[_0x3ea118['uniqueid']]['answertime']?utils[_0x3c17('0x2d')](dials[_0x3ea118['uniqueid']]['endtime'],dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x26')]):0x0;writeDB(dials[_0x3ea118[_0x3c17('0x3')]]);}}catch(_0x123e74){utils[_0x3c17('0x13')](util[_0x3c17('0x2')](_0x3c17('0x2f'),_0x3ea118[_0x3c17('0x3')]),_0x123e74);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 643a168..fd35791 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 _0x366b=['agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][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','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','debug','uniqueid'];(function(_0x11d2e1,_0x4bc6c2){var _0x1e4835=function(_0x48f7a5){while(--_0x48f7a5){_0x11d2e1['push'](_0x11d2e1['shift']());}};_0x1e4835(++_0x4bc6c2);}(_0x366b,0xab));var _0xb366=function(_0x2d9f88,_0x1b68e6){_0x2d9f88=_0x2d9f88-0x0;var _0x53541a=_0x366b[_0x2d9f88];return _0x53541a;};var AsteriskManager=require(_0xb366('0x0'));var config=require(_0xb366('0x1'));var utils=require(_0xb366('0x2'));var util=require(_0xb366('0x3'));var isXDREnabled=config[_0xb366('0x4')]&&config[_0xb366('0x4')][_0xb366('0x5')]?!config[_0xb366('0x4')][_0xb366('0x5')]:!![];var isProduction=config['env']===_0xb366('0x6')||![];var isLocalAsterisk=config[_0xb366('0x4')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0xb366('0x7')][_0xb366('0x8')],config['asterisk']['ip'],config[_0xb366('0x7')][_0xb366('0x9')],config[_0xb366('0x7')][_0xb366('0xa')],!![]);ami[_0xb366('0xb')]();if(!isXDREnabled){utils[_0xb366('0xc')](_0xb366('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xb366('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xb366('0xe'));var calls=require(_0xb366('0xf'));var queues=require('./queues.controller');var recordings=require(_0xb366('0x10'));var members=require(_0xb366('0x11'));var dials=require('./dials.controller');var transfers=require(_0xb366('0x12'));var core=require(_0xb366('0x13'));ami['on'](_0xb366('0x14'),core['connect']);ami['on'](_0xb366('0x15'),core[_0xb366('0x15')]);ami['on'](_0xb366('0x16'),core[_0xb366('0x16')]);ami['on'](_0xb366('0x17'),core[_0xb366('0x17')]);ami['on'](_0xb366('0x18'),core['close']);ami['on'](_0xb366('0x19'),core[_0xb366('0x19')]);ami['on'](_0xb366('0x1a'),function(_0x3a6121){try{utils['debug'](util['format'](_0xb366('0x1b'),_0x3a6121[_0xb366('0x1c')]),_0x3a6121);members[_0xb366('0x1a')](_0x3a6121);}catch(_0x263427){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x1b'),_0x3a6121[_0xb366('0x1c')]),_0x263427);}});ami['on'](_0xb366('0x1e'),function(_0x46c286){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')]('[%s][index][agentcalled]',_0x46c286[_0xb366('0x20')]),_0x46c286);agents[_0xb366('0x1e')](_0x46c286);}catch(_0x174a50){utils[_0xb366('0x17')](util[_0xb366('0x1d')]('[%s][index][agentcalled]',_0x46c286[_0xb366('0x20')]),_0x174a50);}});ami['on'](_0xb366('0x21'),function(_0x455375){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x22'),_0x455375[_0xb366('0x20')]),_0x455375);agents[_0xb366('0x21')](_0x455375);}catch(_0x53f6aa){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x22'),_0x455375[_0xb366('0x20')]),_0x53f6aa);}});ami['on'](_0xb366('0x23'),function(_0x340d4f){try{utils['debug'](util[_0xb366('0x1d')](_0xb366('0x24'),_0x340d4f['uniqueid']),_0x340d4f);agents[_0xb366('0x23')](_0x340d4f);queues[_0xb366('0x23')](_0x340d4f);}catch(_0x6054c4){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x24'),_0x340d4f[_0xb366('0x20')]),_0x6054c4);}});ami['on'](_0xb366('0x25'),function(_0x38fe6b){try{utils['debug'](util[_0xb366('0x1d')](_0xb366('0x26'),_0x38fe6b[_0xb366('0x20')]),_0x38fe6b);agents['agentcomplete'](_0x38fe6b);queues['agentcomplete'](_0x38fe6b);members[_0xb366('0x25')](_0x38fe6b);}catch(_0x4c59fc){utils['error'](util[_0xb366('0x1d')](_0xb366('0x26'),_0x38fe6b[_0xb366('0x20')]),_0x4c59fc);}});ami['on'](_0xb366('0x27'),function(_0x146e0c){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x28'),_0x146e0c[_0xb366('0x20')]),_0x146e0c);agents[_0xb366('0x27')](_0x146e0c);queues[_0xb366('0x27')](_0x146e0c);}catch(_0xec3cfb){utils[_0xb366('0x17')](util['format'](_0xb366('0x28'),_0x146e0c[_0xb366('0x20')]),_0xec3cfb);}});ami['on'](_0xb366('0x29'),function(_0x2602ba){try{utils['debug'](util[_0xb366('0x1d')](_0xb366('0x2a'),_0x2602ba[_0xb366('0x20')]),_0x2602ba);queues[_0xb366('0x29')](_0x2602ba);recordings['queuecallerjoin'](_0x2602ba);}catch(_0x5f6959){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x2a'),_0x2602ba[_0xb366('0x20')]),_0x5f6959);}});ami['on'](_0xb366('0x2b'),function(_0x2ea83a){try{utils[_0xb366('0x1f')](util['format'](_0xb366('0x2c'),_0x2ea83a['uniqueid']),_0x2ea83a);queues['queuecallerleave'](_0x2ea83a);}catch(_0x8fb6d3){utils[_0xb366('0x17')](util[_0xb366('0x1d')]('[%s][index][queuecallerleave]',_0x2ea83a[_0xb366('0x20')]),_0x8fb6d3);}});ami['on'](_0xb366('0x2d'),function(_0x53a5d4){try{utils[_0xb366('0x1f')](util['format'](_0xb366('0x2e'),_0x53a5d4[_0xb366('0x20')]),_0x53a5d4);queues[_0xb366('0x2d')](_0x53a5d4);calls[_0xb366('0x2d')](_0x53a5d4);}catch(_0x49fd94){utils[_0xb366('0x17')](util['format']('[%s][index][musiconholdstart]',_0x53a5d4[_0xb366('0x20')]),_0x49fd94);}});ami['on'](_0xb366('0x2f'),function(_0x13afa8){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x30'),_0x13afa8[_0xb366('0x20')]),_0x13afa8);queues[_0xb366('0x2f')](_0x13afa8);calls['musiconholdstop'](_0x13afa8);}catch(_0x2b8625){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x30'),_0x13afa8[_0xb366('0x20')]),_0x2b8625);}});ami['on'](_0xb366('0x31'),function(_0x3b8b38){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x32'),_0x3b8b38[_0xb366('0x20')]),_0x3b8b38);calls['newstate'](_0x3b8b38);recordings[_0xb366('0x31')](_0x3b8b38);}catch(_0x1a4c3d){utils['error'](util[_0xb366('0x1d')](_0xb366('0x32'),_0x3b8b38[_0xb366('0x20')]),_0x1a4c3d);}});ami['on'](_0xb366('0x33'),function(_0x460396){try{utils['debug'](util['format']('[%s][index][hangup]',_0x460396['uniqueid']),_0x460396);calls['hangup'](_0x460396);recordings['hangup'](_0x460396);dials[_0xb366('0x33')](_0x460396);agents[_0xb366('0x33')](_0x460396);queues['hangup'](_0x460396);}catch(_0x5c7d18){utils['error'](util[_0xb366('0x1d')](_0xb366('0x34'),_0x460396[_0xb366('0x20')]),_0x5c7d18);}});ami['on'](_0xb366('0x35'),function(_0x545b1b){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x36'),_0x545b1b[_0xb366('0x20')]),_0x545b1b);members[_0xb366('0x35')](_0x545b1b);}catch(_0x1f08e8){utils[_0xb366('0x17')](util['format'](_0xb366('0x36'),_0x545b1b['uniqueid']),_0x1f08e8);}});ami['on'](_0xb366('0x37'),function(_0x16d38e){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x38'),_0x16d38e[_0xb366('0x20')]),_0x16d38e);queues[_0xb366('0x37')](_0x16d38e);agents['blindtransfer'](_0x16d38e);transfers['blindtransfer'](_0x16d38e);recordings[_0xb366('0x37')](_0x16d38e);}catch(_0x15e2e7){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x38'),_0x16d38e['uniqueid']),_0x15e2e7);}});ami['on'](_0xb366('0x39'),function(_0x2a05ca){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x3a'),_0x2a05ca['origtransfereruniqueid']),_0x2a05ca);queues[_0xb366('0x39')](_0x2a05ca);transfers[_0xb366('0x39')](_0x2a05ca);agents['attendedtransfer'](_0x2a05ca);calls['attendedtransfer'](_0x2a05ca);}catch(_0x59756c){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x3a'),_0x2a05ca['origtransfereruniqueid']),_0x59756c);}});ami['on'](_0xb366('0x3b'),function(_0x351111){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x3c'),_0x351111[_0xb366('0x20')]),_0x351111);queues[_0xb366('0x3b')](_0x351111);recordings['varset'](_0x351111);calls[_0xb366('0x3b')](_0x351111);dials[_0xb366('0x3b')](_0x351111);}catch(_0x3ce321){utils['error'](util[_0xb366('0x1d')](_0xb366('0x3c'),_0x351111[_0xb366('0x20')]),_0x3ce321);}});ami['on'](_0xb366('0x3d'),function(_0x28cef2){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')](_0xb366('0x3e'),_0x28cef2[_0xb366('0x20')]),_0x28cef2);calls[_0xb366('0x3d')](_0x28cef2);recordings[_0xb366('0x3d')](_0x28cef2);dials[_0xb366('0x3d')](_0x28cef2);}catch(_0x422413){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x3e'),_0x28cef2[_0xb366('0x20')]),_0x422413);}});ami['on'](_0xb366('0x3f'),function(_0x487627){try{utils['debug'](util[_0xb366('0x1d')](_0xb366('0x40'),_0x487627['uniqueid']),_0x487627);calls[_0xb366('0x3f')](_0x487627);recordings['newchannel'](_0x487627);}catch(_0x84e4fa){utils[_0xb366('0x17')](util[_0xb366('0x1d')]('[%s][index][newchannel]',_0x487627[_0xb366('0x20')]),_0x84e4fa);}});ami['on'](_0xb366('0x41'),function(_0x471786){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')]('[%s][index][dialbegin]',_0x471786[_0xb366('0x20')]),_0x471786);dials['dialbegin'](_0x471786);}catch(_0x5c65e6){utils[_0xb366('0x17')](util[_0xb366('0x1d')]('[%s]dialbegin',_0x471786[_0xb366('0x20')]),_0x5c65e6);}});ami['on'](_0xb366('0x42'),function(_0x1a93f3){try{utils[_0xb366('0x1f')](util[_0xb366('0x1d')]('[%s][index][dialend]',_0x1a93f3[_0xb366('0x20')]),_0x1a93f3);dials[_0xb366('0x42')](_0x1a93f3);}catch(_0x3d8dc7){utils[_0xb366('0x17')](util[_0xb366('0x1d')](_0xb366('0x43'),_0x1a93f3[_0xb366('0x20')]),_0x3d8dc7);}});} \ No newline at end of file +var _0x2675=['./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','error','debug','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x4dd943,_0x5f379e){var _0x4e06ee=function(_0x2c1747){while(--_0x2c1747){_0x4dd943['push'](_0x4dd943['shift']());}};_0x4e06ee(++_0x5f379e);}(_0x2675,0x14b));var _0x5267=function(_0x9b711f,_0xe1b9dd){_0x9b711f=_0x9b711f-0x0;var _0x28608d=_0x2675[_0x9b711f];return _0x28608d;};var AsteriskManager=require(_0x5267('0x0'));var config=require('../../config/environment');var utils=require(_0x5267('0x1'));var util=require(_0x5267('0x2'));var isXDREnabled=config['xdr']&&config[_0x5267('0x3')][_0x5267('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x5267('0x5')]===_0x5267('0x6')||![];var isLocalAsterisk=config[_0x5267('0x3')]&&config[_0x5267('0x3')][_0x5267('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x5267('0x8')][_0x5267('0x9')],config[_0x5267('0x8')]['ip'],config[_0x5267('0x8')][_0x5267('0xa')],config[_0x5267('0x8')][_0x5267('0xb')],!![]);ami[_0x5267('0xc')]();if(!isXDREnabled){utils['info'](_0x5267('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x5267('0xe'));}else{var agents=require('./agents.controller');var calls=require(_0x5267('0xf'));var queues=require(_0x5267('0x10'));var recordings=require(_0x5267('0x11'));var members=require(_0x5267('0x12'));var dials=require(_0x5267('0x13'));var transfers=require(_0x5267('0x14'));var core=require(_0x5267('0x15'));ami['on'](_0x5267('0x16'),core[_0x5267('0x16')]);ami['on']('shutdown',core[_0x5267('0x17')]);ami['on'](_0x5267('0x18'),core[_0x5267('0x18')]);ami['on']('error',core['error']);ami['on']('close',core[_0x5267('0x19')]);ami['on'](_0x5267('0x1a'),core[_0x5267('0x1a')]);ami['on'](_0x5267('0x1b'),function(_0x5091dd){try{utils['debug'](util['format'](_0x5267('0x1c'),_0x5091dd[_0x5267('0x1d')]),_0x5091dd);members[_0x5267('0x1b')](_0x5091dd);}catch(_0x5c8855){utils[_0x5267('0x1e')](util['format']('[%s][index][devicestatechange]',_0x5091dd[_0x5267('0x1d')]),_0x5c8855);}});ami['on']('agentcalled',function(_0x57ecbf){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x21'),_0x57ecbf[_0x5267('0x22')]),_0x57ecbf);agents['agentcalled'](_0x57ecbf);}catch(_0x3cf95b){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x21'),_0x57ecbf[_0x5267('0x22')]),_0x3cf95b);}});ami['on'](_0x5267('0x23'),function(_0x13e951){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x24'),_0x13e951[_0x5267('0x22')]),_0x13e951);agents[_0x5267('0x23')](_0x13e951);}catch(_0x51a946){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x24'),_0x13e951[_0x5267('0x22')]),_0x51a946);}});ami['on'](_0x5267('0x25'),function(_0xdc519b){try{utils['debug'](util['format']('[%s][index][agentconnect]',_0xdc519b[_0x5267('0x22')]),_0xdc519b);agents['agentconnect'](_0xdc519b);queues[_0x5267('0x25')](_0xdc519b);}catch(_0x24c884){utils['error'](util[_0x5267('0x20')](_0x5267('0x26'),_0xdc519b[_0x5267('0x22')]),_0x24c884);}});ami['on'](_0x5267('0x27'),function(_0xce8a0a){try{utils['debug'](util[_0x5267('0x20')]('[%s][index][agentcomplete]',_0xce8a0a[_0x5267('0x22')]),_0xce8a0a);agents[_0x5267('0x27')](_0xce8a0a);queues[_0x5267('0x27')](_0xce8a0a);members[_0x5267('0x27')](_0xce8a0a);}catch(_0x4dce95){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][agentcomplete]',_0xce8a0a[_0x5267('0x22')]),_0x4dce95);}});ami['on']('queuecallerabandon',function(_0x163e8b){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x28'),_0x163e8b[_0x5267('0x22')]),_0x163e8b);agents['queuecallerabandon'](_0x163e8b);queues['queuecallerabandon'](_0x163e8b);}catch(_0x461dfc){utils['error'](util[_0x5267('0x20')]('[%s][index][queuecallerabandon]',_0x163e8b['uniqueid']),_0x461dfc);}});ami['on']('queuecallerjoin',function(_0x4fbd02){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x29'),_0x4fbd02[_0x5267('0x22')]),_0x4fbd02);queues['queuecallerjoin'](_0x4fbd02);recordings[_0x5267('0x2a')](_0x4fbd02);}catch(_0x319af7){utils['error'](util[_0x5267('0x20')]('[%s][index][queuecallerjoin]',_0x4fbd02[_0x5267('0x22')]),_0x319af7);}});ami['on'](_0x5267('0x2b'),function(_0x1050a9){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x2c'),_0x1050a9[_0x5267('0x22')]),_0x1050a9);queues[_0x5267('0x2b')](_0x1050a9);}catch(_0x2fc479){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][queuecallerleave]',_0x1050a9[_0x5267('0x22')]),_0x2fc479);}});ami['on'](_0x5267('0x2d'),function(_0x31a90a){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x2e'),_0x31a90a[_0x5267('0x22')]),_0x31a90a);queues[_0x5267('0x2d')](_0x31a90a);calls[_0x5267('0x2d')](_0x31a90a);}catch(_0x3b2b36){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][musiconholdstart]',_0x31a90a[_0x5267('0x22')]),_0x3b2b36);}});ami['on'](_0x5267('0x2f'),function(_0x461b09){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')]('[%s][index][musiconholdstop]',_0x461b09[_0x5267('0x22')]),_0x461b09);queues[_0x5267('0x2f')](_0x461b09);calls[_0x5267('0x2f')](_0x461b09);}catch(_0x5be7c8){utils['error'](util[_0x5267('0x20')](_0x5267('0x30'),_0x461b09[_0x5267('0x22')]),_0x5be7c8);}});ami['on'](_0x5267('0x31'),function(_0x31bf70){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')]('[%s][index][newstate]',_0x31bf70[_0x5267('0x22')]),_0x31bf70);calls[_0x5267('0x31')](_0x31bf70);recordings[_0x5267('0x31')](_0x31bf70);}catch(_0x5cdc98){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x32'),_0x31bf70[_0x5267('0x22')]),_0x5cdc98);}});ami['on']('hangup',function(_0x5a323f){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x33'),_0x5a323f[_0x5267('0x22')]),_0x5a323f);calls[_0x5267('0x34')](_0x5a323f);recordings[_0x5267('0x34')](_0x5a323f);dials['hangup'](_0x5a323f);agents[_0x5267('0x34')](_0x5a323f);queues[_0x5267('0x34')](_0x5a323f);}catch(_0x313fef){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][hangup]',_0x5a323f[_0x5267('0x22')]),_0x313fef);}});ami['on'](_0x5267('0x35'),function(_0xf0865d){try{utils[_0x5267('0x1f')](util['format']('[%s][index][cdr]',_0xf0865d['uniqueid']),_0xf0865d);members['cdr'](_0xf0865d);}catch(_0x1ba042){utils[_0x5267('0x1e')](util['format'](_0x5267('0x36'),_0xf0865d['uniqueid']),_0x1ba042);}});ami['on'](_0x5267('0x37'),function(_0x27859){try{utils[_0x5267('0x1f')](util['format'](_0x5267('0x38'),_0x27859['uniqueid']),_0x27859);queues[_0x5267('0x37')](_0x27859);agents[_0x5267('0x37')](_0x27859);transfers['blindtransfer'](_0x27859);recordings[_0x5267('0x37')](_0x27859);}catch(_0x43f40e){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x38'),_0x27859[_0x5267('0x22')]),_0x43f40e);}});ami['on']('attendedtransfer',function(_0x499963){try{utils[_0x5267('0x1f')](util['format'](_0x5267('0x39'),_0x499963[_0x5267('0x3a')]),_0x499963);queues[_0x5267('0x3b')](_0x499963);transfers[_0x5267('0x3b')](_0x499963);agents['attendedtransfer'](_0x499963);calls[_0x5267('0x3b')](_0x499963);}catch(_0x440845){utils[_0x5267('0x1e')](util['format'](_0x5267('0x39'),_0x499963[_0x5267('0x3a')]),_0x440845);}});ami['on'](_0x5267('0x3c'),function(_0x329e2a){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x3d'),_0x329e2a[_0x5267('0x22')]),_0x329e2a);queues[_0x5267('0x3c')](_0x329e2a);recordings[_0x5267('0x3c')](_0x329e2a);calls[_0x5267('0x3c')](_0x329e2a);dials[_0x5267('0x3c')](_0x329e2a);}catch(_0x41b23f){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x3d'),_0x329e2a[_0x5267('0x22')]),_0x41b23f);}});ami['on'](_0x5267('0x3e'),function(_0x77a431){try{utils[_0x5267('0x1f')](util['format'](_0x5267('0x3f'),_0x77a431['uniqueid']),_0x77a431);calls[_0x5267('0x3e')](_0x77a431);recordings['newexten'](_0x77a431);dials['newexten'](_0x77a431);}catch(_0x5cc372){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][newexten]',_0x77a431[_0x5267('0x22')]),_0x5cc372);}});ami['on'](_0x5267('0x40'),function(_0xca2ed1){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x41'),_0xca2ed1['uniqueid']),_0xca2ed1);calls[_0x5267('0x40')](_0xca2ed1);recordings[_0x5267('0x40')](_0xca2ed1);}catch(_0x55cb10){utils['error'](util['format']('[%s][index][newchannel]',_0xca2ed1['uniqueid']),_0x55cb10);}});ami['on'](_0x5267('0x42'),function(_0x40332e){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x43'),_0x40332e['uniqueid']),_0x40332e);dials[_0x5267('0x42')](_0x40332e);}catch(_0x4cb1b9){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s]dialbegin',_0x40332e[_0x5267('0x22')]),_0x4cb1b9);}});ami['on'](_0x5267('0x44'),function(_0xc939c8){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')]('[%s][index][dialend]',_0xc939c8['uniqueid']),_0xc939c8);dials[_0x5267('0x44')](_0xc939c8);}catch(_0x23961e){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x45'),_0xc939c8[_0x5267('0x22')]),_0x23961e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 88e2186..0bdcefc 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 _0x208d=['assign','error','cdr','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','startsWith','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s'];(function(_0x181589,_0x1eedd9){var _0x2e4edd=function(_0x3d574a){while(--_0x3d574a){_0x181589['push'](_0x181589['shift']());}};_0x2e4edd(++_0x1eedd9);}(_0x208d,0xa4));var _0xd208=function(_0x55c307,_0x22b2ce){_0x55c307=_0x55c307-0x0;var _0xcca0a9=_0x208d[_0x55c307];return _0xcca0a9;};'use strict';var _=require(_0xd208('0x0'));var util=require(_0xd208('0x1'));var utils=require(_0xd208('0x2'));var members={};var exclude=[_0xd208('0x3'),'Queue:'];function writeDB(_0x4dc46e){utils['info'](util[_0xd208('0x4')](_0xd208('0x5'),_0x4dc46e[_0xd208('0x6')],_0x4dc46e[_0xd208('0x7')],_0x4dc46e[_0xd208('0x8')],_0x4dc46e['data2'],_0x4dc46e[_0xd208('0x9')],_0x4dc46e[_0xd208('0xa')]));if(_0x4dc46e[_0xd208('0x7')]){utils['getUserByInterface'](_0x4dc46e[_0xd208('0x7')])[_0xd208('0xb')](function(_0x5b5f42){if(_0x5b5f42){_0x4dc46e[_0xd208('0x9')]=_0x5b5f42[_0xd208('0xc')];_0x4dc46e['internal']=_0x5b5f42[_0xd208('0xd')];utils[_0xd208('0xe')](_0xd208('0xf'),_0x4dc46e);}else{utils[_0xd208('0x10')](_0x4dc46e['interface'][_0xd208('0x11')]('/')[0x1])[_0xd208('0xb')](function(_0x57f362){if(_0x57f362){_0x4dc46e[_0xd208('0x9')]=_0x57f362[_0xd208('0xc')];_0x4dc46e[_0xd208('0xd')]=_0x57f362[_0xd208('0xd')];utils[_0xd208('0xe')](_0xd208('0xf'),_0x4dc46e);}});}})[_0xd208('0x12')](function(_0x4ff72e){utils['error'](util[_0xd208('0x4')](_0xd208('0x13'),_0x4dc46e[_0xd208('0x6')]),_0x4ff72e);});}delete members[_0x4dc46e[_0xd208('0x7')]];}function startsWith(_0x324bac,_0x14e6c5){return _['some'](_0x324bac,function(_0x21a27b){return _[_0xd208('0x14')](_0x14e6c5,_0x21a27b);});}exports['devicestatechange']=function(_0x6ac23e){try{utils['debug'](util[_0xd208('0x4')](_0xd208('0x15'),members[_0x6ac23e[_0xd208('0x16')]]?members[_0x6ac23e[_0xd208('0x16')]][_0xd208('0x6')]:_0x6ac23e[_0xd208('0x16')]),_0x6ac23e);utils[_0xd208('0x17')](util[_0xd208('0x4')](_0xd208('0x18'),members[_0x6ac23e['device']]?members[_0x6ac23e[_0xd208('0x16')]]['uniqueid']:_0x6ac23e[_0xd208('0x16')],_0x6ac23e['state'],_0x6ac23e[_0xd208('0x16')]));switch(_0x6ac23e[_0xd208('0x19')]){case _0xd208('0x1a'):case _0xd208('0x1b'):if(!startsWith(exclude,_0x6ac23e[_0xd208('0x16')])){members[_0x6ac23e['device']]={'channel':_0xd208('0x1c'),'interface':_0x6ac23e[_0xd208('0x16')],'type':'TALKING','enterAt':utils[_0xd208('0x1d')](),'role':_0xd208('0x1e')};}break;case _0xd208('0x1f'):if(!_[_0xd208('0x20')](members[_0x6ac23e[_0xd208('0x16')]])){members[_0x6ac23e[_0xd208('0x16')]]['exitAt']=utils[_0xd208('0x1d')]();members[_0x6ac23e[_0xd208('0x16')]][_0xd208('0x21')]=utils[_0xd208('0x22')](members[_0x6ac23e[_0xd208('0x16')]][_0xd208('0x23')],members[_0x6ac23e['device']]['enterAt']);if(members[_0x6ac23e['device']]['uniqueid']){writeDB(members[_0x6ac23e[_0xd208('0x16')]]);}}break;default:break;}}catch(_0x4b29c0){utils['error'](util['format'](_0xd208('0x15'),members[_0x6ac23e[_0xd208('0x16')]]?members[_0x6ac23e['device']][_0xd208('0x6')]:_0x6ac23e['device']),_0x4b29c0);}};exports[_0xd208('0x24')]=function(_0x2d8562){try{if(!_[_0xd208('0x20')](members[_0x2d8562[_0xd208('0x7')]])){utils[_0xd208('0x25')](util[_0xd208('0x4')](_0xd208('0x26'),_0x2d8562[_0xd208('0x6')]),_0x2d8562);utils[_0xd208('0x17')](util['format'](_0xd208('0x27'),_0x2d8562[_0xd208('0x6')],_0x2d8562[_0xd208('0x7')],_0x2d8562['queue']));members[_0x2d8562[_0xd208('0x7')]]=_[_0xd208('0x28')](members[_0x2d8562['interface']],{'data4':_0x2d8562['queue'],'uniqueid':_0x2d8562[_0xd208('0x6')]});}}catch(_0x1b343a){utils[_0xd208('0x29')](util['format'](_0xd208('0x26'),_0x2d8562[_0xd208('0x6')]),_0x1b343a);}};exports[_0xd208('0x2a')]=function(_0x13726b){try{utils[_0xd208('0x25')](util['format']('[%s][members][cdr]',_0x13726b[_0xd208('0x6')]),_0x13726b);if(_0x13726b[_0xd208('0x8')]){var _0xffe4b5=_0x13726b[_0xd208('0x8')][_0xd208('0x11')]('-')[0x0];if(!_[_0xd208('0x20')](members[_0xffe4b5])){members[_0xffe4b5]=_[_0xd208('0x28')](members[_0xffe4b5],{'data1':members[_0xffe4b5][_0xd208('0x2b')]||_0x13726b[_0xd208('0xa')],'data2':members[_0xffe4b5][_0xd208('0x2c')]||_0x13726b[_0xd208('0x2d')],'data3':members[_0xffe4b5][_0xd208('0x2e')]||_0x13726b['destination'],'uniqueid':members[_0xffe4b5][_0xd208('0x6')]||_0x13726b[_0xd208('0x6')]});utils[_0xd208('0x17')](util[_0xd208('0x4')](_0xd208('0x2f'),_0x13726b[_0xd208('0x6')],members[_0xffe4b5][_0xd208('0x2b')],members[_0xffe4b5][_0xd208('0x2c')],members[_0xffe4b5][_0xd208('0x2e')]));if(members[_0xffe4b5][_0xd208('0x23')]){writeDB(members[_0xffe4b5]);}}}if(_0x13726b[_0xd208('0x30')]){var _0x5c0646=_0x13726b[_0xd208('0x30')][_0xd208('0x11')]('-')[0x0];if(!_[_0xd208('0x20')](members[_0x5c0646])){members[_0x5c0646]=_['assign'](members[_0x5c0646],{'data1':members[_0x5c0646]['data1']||_0x13726b[_0xd208('0xa')],'data2':members[_0x5c0646]['data2']||_0x13726b[_0xd208('0x2d')],'data3':members[_0x5c0646][_0xd208('0x2e')]||_0x13726b[_0xd208('0x31')],'uniqueid':members[_0x5c0646][_0xd208('0x6')]||_0x13726b[_0xd208('0x6')]});utils[_0xd208('0x17')](util['format'](_0xd208('0x2f'),_0x13726b[_0xd208('0x6')],members[_0x5c0646][_0xd208('0x2b')],members[_0x5c0646][_0xd208('0x2c')],members[_0x5c0646][_0xd208('0x2e')]));if(members[_0x5c0646][_0xd208('0x23')]){writeDB(members[_0x5c0646]);}}}}catch(_0x56b48f){utils['error'](util[_0xd208('0x4')](_0xd208('0x32'),_0x13726b[_0xd208('0x6')]),_0x56b48f);}}; \ No newline at end of file +var _0x4e3c=['devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','membername','error','[%s][members][writeDB]','some'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4e3c,0x1b4));var _0xc4e3=function(_0x4a18f0,_0x903c50){_0x4a18f0=_0x4a18f0-0x0;var _0x158316=_0x4e3c[_0x4a18f0];return _0x158316;};'use strict';var _=require('lodash');var util=require(_0xc4e3('0x0'));var utils=require(_0xc4e3('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xc4e3('0x2')];function writeDB(_0x29269c){utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x5'),_0x29269c[_0xc4e3('0x6')],_0x29269c[_0xc4e3('0x7')],_0x29269c[_0xc4e3('0x8')],_0x29269c[_0xc4e3('0x9')],_0x29269c['membername'],_0x29269c[_0xc4e3('0xa')]));if(_0x29269c['interface']){utils[_0xc4e3('0xb')](_0x29269c['interface'])[_0xc4e3('0xc')](function(_0x5bf803){if(_0x5bf803){_0x29269c['membername']=_0x5bf803[_0xc4e3('0xd')];_0x29269c['internal']=_0x5bf803[_0xc4e3('0xe')];utils[_0xc4e3('0xf')](_0xc4e3('0x10'),_0x29269c);}else{utils[_0xc4e3('0x11')](_0x29269c[_0xc4e3('0x7')][_0xc4e3('0x12')]('/')[0x1])['then'](function(_0x4420d8){if(_0x4420d8){_0x29269c[_0xc4e3('0x13')]=_0x4420d8[_0xc4e3('0xd')];_0x29269c[_0xc4e3('0xe')]=_0x4420d8['internal'];utils[_0xc4e3('0xf')](_0xc4e3('0x10'),_0x29269c);}});}})['catch'](function(_0x24b2c1){utils[_0xc4e3('0x14')](util[_0xc4e3('0x4')](_0xc4e3('0x15'),_0x29269c[_0xc4e3('0x6')]),_0x24b2c1);});}delete members[_0x29269c[_0xc4e3('0x7')]];}function startsWith(_0x3f4a79,_0x27b6c0){return _[_0xc4e3('0x16')](_0x3f4a79,function(_0x229425){return _['startsWith'](_0x27b6c0,_0x229425);});}exports[_0xc4e3('0x17')]=function(_0x1920f8){try{utils[_0xc4e3('0x18')](util[_0xc4e3('0x4')](_0xc4e3('0x19'),members[_0x1920f8[_0xc4e3('0x1a')]]?members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x6')]:_0x1920f8['device']),_0x1920f8);utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x1b'),members[_0x1920f8[_0xc4e3('0x1a')]]?members[_0x1920f8[_0xc4e3('0x1a')]]['uniqueid']:_0x1920f8[_0xc4e3('0x1a')],_0x1920f8[_0xc4e3('0x1c')],_0x1920f8[_0xc4e3('0x1a')]));switch(_0x1920f8[_0xc4e3('0x1c')]){case _0xc4e3('0x1d'):case _0xc4e3('0x1e'):if(!startsWith(exclude,_0x1920f8['device'])){members[_0x1920f8[_0xc4e3('0x1a')]]={'channel':_0xc4e3('0x1f'),'interface':_0x1920f8[_0xc4e3('0x1a')],'type':_0xc4e3('0x20'),'enterAt':utils[_0xc4e3('0x21')](),'role':_0xc4e3('0x22')};}break;case'NOT_INUSE':if(!_[_0xc4e3('0x23')](members[_0x1920f8[_0xc4e3('0x1a')]])){members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x24')]=utils['now']();members[_0x1920f8['device']][_0xc4e3('0x25')]=utils['diffTime'](members[_0x1920f8['device']][_0xc4e3('0x24')],members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x26')]);if(members[_0x1920f8[_0xc4e3('0x1a')]]['uniqueid']){writeDB(members[_0x1920f8[_0xc4e3('0x1a')]]);}}break;default:break;}}catch(_0xa0f471){utils[_0xc4e3('0x14')](util['format'](_0xc4e3('0x19'),members[_0x1920f8[_0xc4e3('0x1a')]]?members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x6')]:_0x1920f8[_0xc4e3('0x1a')]),_0xa0f471);}};exports['agentcomplete']=function(_0x59234a){try{if(!_[_0xc4e3('0x23')](members[_0x59234a[_0xc4e3('0x7')]])){utils['debug'](util[_0xc4e3('0x4')](_0xc4e3('0x27'),_0x59234a[_0xc4e3('0x6')]),_0x59234a);utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x28'),_0x59234a['uniqueid'],_0x59234a['interface'],_0x59234a[_0xc4e3('0x29')]));members[_0x59234a[_0xc4e3('0x7')]]=_[_0xc4e3('0x2a')](members[_0x59234a['interface']],{'data4':_0x59234a[_0xc4e3('0x29')],'uniqueid':_0x59234a[_0xc4e3('0x6')]});}}catch(_0x3b7596){utils[_0xc4e3('0x14')](util['format'](_0xc4e3('0x27'),_0x59234a[_0xc4e3('0x6')]),_0x3b7596);}};exports[_0xc4e3('0x2b')]=function(_0xc3f60f){try{utils[_0xc4e3('0x18')](util[_0xc4e3('0x4')](_0xc4e3('0x2c'),_0xc3f60f[_0xc4e3('0x6')]),_0xc3f60f);if(_0xc3f60f[_0xc4e3('0x8')]){var _0x2ca0c1=_0xc3f60f[_0xc4e3('0x8')][_0xc4e3('0x12')]('-')[0x0];if(!_['isNil'](members[_0x2ca0c1])){members[_0x2ca0c1]=_['assign'](members[_0x2ca0c1],{'data1':members[_0x2ca0c1][_0xc4e3('0x2d')]||_0xc3f60f[_0xc4e3('0xa')],'data2':members[_0x2ca0c1]['data2']||_0xc3f60f[_0xc4e3('0x2e')],'data3':members[_0x2ca0c1][_0xc4e3('0x2f')]||_0xc3f60f[_0xc4e3('0x30')],'uniqueid':members[_0x2ca0c1]['uniqueid']||_0xc3f60f['uniqueid']});utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x31'),_0xc3f60f[_0xc4e3('0x6')],members[_0x2ca0c1]['data1'],members[_0x2ca0c1][_0xc4e3('0x9')],members[_0x2ca0c1][_0xc4e3('0x2f')]));if(members[_0x2ca0c1][_0xc4e3('0x24')]){writeDB(members[_0x2ca0c1]);}}}if(_0xc3f60f[_0xc4e3('0x32')]){var _0x216a21=_0xc3f60f['destinationchannel'][_0xc4e3('0x12')]('-')[0x0];if(!_[_0xc4e3('0x23')](members[_0x216a21])){members[_0x216a21]=_[_0xc4e3('0x2a')](members[_0x216a21],{'data1':members[_0x216a21][_0xc4e3('0x2d')]||_0xc3f60f[_0xc4e3('0xa')],'data2':members[_0x216a21][_0xc4e3('0x9')]||_0xc3f60f['source'],'data3':members[_0x216a21][_0xc4e3('0x2f')]||_0xc3f60f['destination'],'uniqueid':members[_0x216a21][_0xc4e3('0x6')]||_0xc3f60f[_0xc4e3('0x6')]});utils[_0xc4e3('0x3')](util['format'](_0xc4e3('0x31'),_0xc3f60f[_0xc4e3('0x6')],members[_0x216a21][_0xc4e3('0x2d')],members[_0x216a21][_0xc4e3('0x9')],members[_0x216a21][_0xc4e3('0x2f')]));if(members[_0x216a21][_0xc4e3('0x24')]){writeDB(members[_0x216a21]);}}}}catch(_0x460a17){utils[_0xc4e3('0x14')](util[_0xc4e3('0x4')](_0xc4e3('0x2c'),_0xc3f60f[_0xc4e3('0x6')]),_0x460a17);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 6de76e7..8ab12e5 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 _0xf6b8=['hangup','isNil','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','name','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','accountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','[%s][queues][queuecallerjoin]'];(function(_0x3178c1,_0xb55057){var _0x472523=function(_0x3a036c){while(--_0x3a036c){_0x3178c1['push'](_0x3178c1['shift']());}};_0x472523(++_0xb55057);}(_0xf6b8,0x190));var _0x8f6b=function(_0x34528e,_0x482db5){_0x34528e=_0x34528e-0x0;var _0x2b4f16=_0xf6b8[_0x34528e];return _0x2b4f16;};'use strict';var _=require('lodash');var util=require(_0x8f6b('0x0'));var utils=require(_0x8f6b('0x1'));var queues={};function writeDB(_0x51cbe1){utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x4'),_0x51cbe1['uniqueid'],_0x51cbe1[_0x8f6b('0x5')],_0x51cbe1[_0x8f6b('0x6')],_0x51cbe1[_0x8f6b('0x7')],_0x51cbe1[_0x8f6b('0x8')],_0x51cbe1['accountcode'],_0x51cbe1[_0x8f6b('0x9')]));if(_0x51cbe1[_0x8f6b('0x6')]){utils[_0x8f6b('0xa')](_0x51cbe1['queue'])[_0x8f6b('0xb')](function(_0x27fcaa){if(_0x27fcaa){_0x51cbe1[_0x8f6b('0xc')]=_0x27fcaa[_0x8f6b('0xc')];}utils[_0x8f6b('0xd')](_0x8f6b('0xe'),_0x51cbe1);});}else{utils['request'](_0x8f6b('0xe'),_0x51cbe1);}if(_0x51cbe1[_0x8f6b('0xf')]){delete queues[_0x51cbe1[_0x8f6b('0xf')]];}else{delete queues[_0x51cbe1['uniqueid']];}}exports['queuecallerjoin']=function(_0x73fbe9){try{utils[_0x8f6b('0x10')](util[_0x8f6b('0x3')]('[%s][queues][queuecallerjoin]',_0x73fbe9[_0x8f6b('0x11')]),_0x73fbe9);utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x12'),_0x73fbe9['uniqueid'],_0x73fbe9[_0x8f6b('0x6')],_0x73fbe9['position']));queues[_0x73fbe9[_0x8f6b('0x11')]]=_[_0x8f6b('0x13')](_0x73fbe9,{'originalposition':_0x73fbe9[_0x8f6b('0x14')],'queuecallerjoinAt':utils[_0x8f6b('0x15')](),'mohtime':0x0});}catch(_0x46243e){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x17'),_0x73fbe9[_0x8f6b('0x11')]),_0x46243e);}};exports[_0x8f6b('0x18')]=function(_0x4eb8f6){try{if(!_[_0x8f6b('0x19')](queues[_0x4eb8f6['uniqueid']])){utils[_0x8f6b('0x10')](util['format']('[%s][queues][hangup]',_0x4eb8f6[_0x8f6b('0x11')]),_0x4eb8f6);if(queues[_0x4eb8f6[_0x8f6b('0x11')]]['queuecallerleaveAt']){if(!queues[_0x4eb8f6[_0x8f6b('0x11')]]['queuecallerabandon']&&!queues[_0x4eb8f6[_0x8f6b('0x11')]][_0x8f6b('0x1a')]){queues[_0x4eb8f6['uniqueid']][_0x8f6b('0x1b')]=!![];queues[_0x4eb8f6[_0x8f6b('0x11')]][_0x8f6b('0x1c')]=utils[_0x8f6b('0x15')]();queues[_0x4eb8f6['uniqueid']][_0x8f6b('0x9')]=_0x8f6b('0x1d');}utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x1e'),_0x4eb8f6[_0x8f6b('0x11')],queues[_0x4eb8f6[_0x8f6b('0x11')]]['name'],queues[_0x4eb8f6['uniqueid']][_0x8f6b('0x9')]));writeDB(queues[_0x4eb8f6[_0x8f6b('0x11')]]);}else if(queues[_0x4eb8f6[_0x8f6b('0x11')]]['transfereduniqueid']){utils['info'](util[_0x8f6b('0x3')](_0x8f6b('0x1f'),_0x4eb8f6[_0x8f6b('0x11')],queues[_0x4eb8f6['uniqueid']]['name'],queues[_0x4eb8f6[_0x8f6b('0x11')]][_0x8f6b('0xf')]));queues[queues[_0x4eb8f6[_0x8f6b('0x11')]][_0x8f6b('0xf')]]=queues[_0x4eb8f6[_0x8f6b('0x11')]];queues[queues[_0x4eb8f6[_0x8f6b('0x11')]][_0x8f6b('0xf')]][_0x8f6b('0x20')]=0x2;delete queues[_0x4eb8f6[_0x8f6b('0x11')]];}}}catch(_0x4cbd6e){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')]('[%s][queues][hangup]',_0x4eb8f6['uniqueid']),_0x4cbd6e);}};exports[_0x8f6b('0x21')]=function(_0x2c8075){try{utils['debug'](util[_0x8f6b('0x3')](_0x8f6b('0x22'),_0x2c8075[_0x8f6b('0x11')]),_0x2c8075);if(!_['isNil'](_0x2c8075[_0x8f6b('0x23')][_0x8f6b('0x24')])&&_0x2c8075[_0x8f6b('0x25')][_0x8f6b('0x26')]()!==_0x8f6b('0x27')){if(!_['isNil'](queues[_0x2c8075[_0x8f6b('0x11')]])){queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x28')]=![];queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x29')]=null;queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x1a')]=!![];queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x2a')]=utils[_0x8f6b('0x15')]();queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x9')]=_0x2c8075[_0x8f6b('0x25')][_0x8f6b('0x26')]();utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x2b'),_0x2c8075[_0x8f6b('0x11')],queues[_0x2c8075['uniqueid']]['name'],_0x2c8075[_0x8f6b('0x25')],queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x9')]));writeDB(queues[_0x2c8075[_0x8f6b('0x11')]]);}}else if(!_[_0x8f6b('0x19')](_0x2c8075[_0x8f6b('0x23')]['queueposition'])){if(!_[_0x8f6b('0x19')](queues[_0x2c8075['uniqueid']])&&!queues[_0x2c8075['uniqueid']][_0x8f6b('0x28')]){queues[_0x2c8075['uniqueid']][_0x8f6b('0x28')]=![];queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x29')]=null;queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x1a')]=!![];queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x2a')]=utils[_0x8f6b('0x15')]();queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x9')]=_0x8f6b('0x2c');utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x2d'),_0x2c8075[_0x8f6b('0x11')],queues[_0x2c8075[_0x8f6b('0x11')]][_0x8f6b('0x2e')],_0x2c8075[_0x8f6b('0x25')],queues[_0x2c8075[_0x8f6b('0x11')]]['queuecallerexitreason']));}}}catch(_0x4379e5){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x22'),_0x2c8075[_0x8f6b('0x11')]),_0x4379e5);}};exports[_0x8f6b('0x28')]=function(_0x30f668){try{if(!_[_0x8f6b('0x19')](queues[_0x30f668[_0x8f6b('0x11')]])){utils['debug'](util[_0x8f6b('0x3')]('[%s][queues][queuecallerabandon]',_0x30f668[_0x8f6b('0x11')]),_0x30f668);queues[_0x30f668['uniqueid']][_0x8f6b('0x1a')]=![];queues[_0x30f668[_0x8f6b('0x11')]][_0x8f6b('0x2a')]=null;queues[_0x30f668[_0x8f6b('0x11')]][_0x8f6b('0x28')]=!![];queues[_0x30f668[_0x8f6b('0x11')]][_0x8f6b('0x29')]=utils[_0x8f6b('0x15')]();queues[_0x30f668['uniqueid']][_0x8f6b('0x9')]='ABANDONED';utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x2f'),_0x30f668['uniqueid'],queues[_0x30f668[_0x8f6b('0x11')]][_0x8f6b('0x2e')],queues[_0x30f668[_0x8f6b('0x11')]][_0x8f6b('0x9')]));}}catch(_0x8bac8c){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x30'),_0x30f668[_0x8f6b('0x11')]),_0x8bac8c);}};exports[_0x8f6b('0x31')]=function(_0x1f2793){try{if(!_['isNil'](queues[_0x1f2793['uniqueid']])){utils['debug'](util[_0x8f6b('0x3')]('[%s][queues][queuecallerleave]',_0x1f2793[_0x8f6b('0x11')]),_0x1f2793);utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x32'),_0x1f2793['uniqueid'],queues[_0x1f2793[_0x8f6b('0x11')]][_0x8f6b('0x2e')],_0x1f2793[_0x8f6b('0x33')],_0x1f2793['connectedlinename']));queues[_0x1f2793[_0x8f6b('0x11')]]['queuecallerleave']=!![];queues[_0x1f2793[_0x8f6b('0x11')]][_0x8f6b('0x34')]=utils[_0x8f6b('0x15')]();queues[_0x1f2793[_0x8f6b('0x11')]]['holdtime']=utils[_0x8f6b('0x35')](queues[_0x1f2793[_0x8f6b('0x11')]]['queuecallerleaveAt'],queues[_0x1f2793[_0x8f6b('0x11')]][_0x8f6b('0x36')]);queues[_0x1f2793['uniqueid']][_0x8f6b('0x14')]=_0x1f2793['position'];queues[_0x1f2793[_0x8f6b('0x11')]][_0x8f6b('0x37')]=_0x1f2793[_0x8f6b('0x37')];queues[_0x1f2793[_0x8f6b('0x11')]][_0x8f6b('0x33')]=_0x1f2793[_0x8f6b('0x33')];queues[_0x1f2793[_0x8f6b('0x11')]][_0x8f6b('0x38')]=_0x1f2793[_0x8f6b('0x38')];}}catch(_0x12a485){utils[_0x8f6b('0x16')](util['format'](_0x8f6b('0x39'),_0x1f2793[_0x8f6b('0x11')]),_0x12a485);}};exports[_0x8f6b('0x3a')]=function(_0x524229){try{if(!_[_0x8f6b('0x19')](queues[_0x524229[_0x8f6b('0x11')]])){utils['debug'](util['format'](_0x8f6b('0x3b'),_0x524229[_0x8f6b('0x11')]),_0x524229);utils['info'](util['format'](_0x8f6b('0x3c'),_0x524229[_0x8f6b('0x11')],queues[_0x524229[_0x8f6b('0x11')]][_0x8f6b('0x2e')],_0x524229[_0x8f6b('0x3d')],_0x524229[_0x8f6b('0x3e')]));queues[_0x524229[_0x8f6b('0x11')]][_0x8f6b('0x28')]=![];queues[_0x524229['uniqueid']][_0x8f6b('0x28')]=![];queues[_0x524229['uniqueid']]['queuecallerabandonAt']=null;queues[_0x524229[_0x8f6b('0x11')]][_0x8f6b('0x1a')]=![];queues[_0x524229[_0x8f6b('0x11')]][_0x8f6b('0x9')]=null;queues[_0x524229[_0x8f6b('0x11')]]['queuecallerexitAt']=null;queues[_0x524229[_0x8f6b('0x11')]]['assigned']=!![];queues[_0x524229[_0x8f6b('0x11')]][_0x8f6b('0x3f')]=_0x524229[_0x8f6b('0x3e')];queues[_0x524229[_0x8f6b('0x11')]][_0x8f6b('0x7')]=_0x524229[_0x8f6b('0x3d')];}}catch(_0x568f68){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x3b'),_0x524229[_0x8f6b('0x11')]),_0x568f68);}};exports[_0x8f6b('0x40')]=function(_0x414815){try{if(!_[_0x8f6b('0x19')](queues[_0x414815[_0x8f6b('0x11')]])){if(queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x34')]){utils['debug'](util[_0x8f6b('0x3')](_0x8f6b('0x41'),_0x414815[_0x8f6b('0x11')]),_0x414815);queues[_0x414815['uniqueid']][_0x8f6b('0x28')]=![];queues[_0x414815['uniqueid']][_0x8f6b('0x28')]=![];queues[_0x414815['uniqueid']][_0x8f6b('0x29')]=null;queues[_0x414815[_0x8f6b('0x11')]]['queuecallerexit']=![];queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x2a')]=null;queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x42')]=!![];queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x7')]=_0x414815[_0x8f6b('0x3d')];queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x1b')]=!![];queues[_0x414815['uniqueid']]['queuecallercompleteAt']=utils[_0x8f6b('0x15')]();if(_0x414815['reason']==_0x8f6b('0x43')){if(!queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x43')]){queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x9')]=_0x8f6b('0x44');}}else{queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x9')]=_0x8f6b('0x45')+_0x414815[_0x8f6b('0x46')][_0x8f6b('0x26')]();}utils['info'](util['format'](_0x8f6b('0x47'),_0x414815[_0x8f6b('0x11')],queues[_0x414815['uniqueid']][_0x8f6b('0x2e')],_0x414815['membername'],queues[_0x414815[_0x8f6b('0x11')]][_0x8f6b('0x9')]));writeDB(queues[_0x414815[_0x8f6b('0x11')]]);}}}catch(_0x351aed){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x41'),_0x414815[_0x8f6b('0x11')]),_0x351aed);}};exports[_0x8f6b('0x48')]=function(_0x3f934d){try{if(!_[_0x8f6b('0x19')](queues[_0x3f934d[_0x8f6b('0x49')]])){utils[_0x8f6b('0x10')](util[_0x8f6b('0x3')](_0x8f6b('0x4a'),_0x3f934d['uniqueid']),_0x3f934d);queues[_0x3f934d[_0x8f6b('0x49')]][_0x8f6b('0x43')]=!![];queues[_0x3f934d[_0x8f6b('0x49')]][_0x8f6b('0x4b')]='BLIND';queues[_0x3f934d['transfereeuniqueid']][_0x8f6b('0x4c')]=_0x3f934d['extension'];queues[_0x3f934d[_0x8f6b('0x49')]][_0x8f6b('0x4d')]=_0x3f934d[_0x8f6b('0x49')];queues[_0x3f934d[_0x8f6b('0x49')]][_0x8f6b('0x9')]=_0x8f6b('0x4e');utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x4f'),_0x3f934d['uniqueid'],queues[_0x3f934d[_0x8f6b('0x49')]][_0x8f6b('0x2e')],_0x3f934d[_0x8f6b('0x49')],_0x3f934d[_0x8f6b('0x50')]));}}catch(_0x3b1ccb){utils['error'](util['format'](_0x8f6b('0x4a'),_0x3f934d['uniqueid']),_0x3b1ccb);}};exports['attendedtransfer']=function(_0x335b8a){try{utils[_0x8f6b('0x10')](util[_0x8f6b('0x3')](_0x8f6b('0x51'),_0x335b8a[_0x8f6b('0x52')]),_0x335b8a);if(_0x335b8a['origtransfereruniqueid']==_0x335b8a[_0x8f6b('0x53')]){if(!_['isNil'](queues[_0x335b8a[_0x8f6b('0x54')]])){utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x55'),_0x335b8a[_0x8f6b('0x52')],queues[_0x335b8a[_0x8f6b('0x54')]]['name'],_0x335b8a[_0x8f6b('0x56')]));queues[_0x335b8a[_0x8f6b('0x54')]]['transfer']=!![];queues[_0x335b8a[_0x8f6b('0x54')]][_0x8f6b('0x4b')]=_0x8f6b('0x57');queues[_0x335b8a[_0x8f6b('0x54')]]['transferexten']=_0x335b8a[_0x8f6b('0x56')];queues[_0x335b8a[_0x8f6b('0x54')]][_0x8f6b('0x4d')]=_0x335b8a['origtransfereruniqueid'];queues[_0x335b8a[_0x8f6b('0x54')]][_0x8f6b('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x8f6b('0x19')](queues[_0x335b8a[_0x8f6b('0x53')]])){if(_0x335b8a[_0x8f6b('0x58')]&&queues[_0x335b8a['transfereelinkedid']]){queues[_0x335b8a[_0x8f6b('0x58')]]['queuecallerenterreason']=0x1;queues[_0x335b8a[_0x8f6b('0x49')]]=_['clone'](queues[_0x335b8a[_0x8f6b('0x58')]]);queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0xf')]=_0x335b8a['transfertargetuniqueid'];queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0x20')]=0x2;queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0x8')]=queues[_0x335b8a[_0x8f6b('0x54')]]['calleridnum'];queues[_0x335b8a['transfereeuniqueid']][_0x8f6b('0x59')]=queues[_0x335b8a[_0x8f6b('0x54')]][_0x8f6b('0x59')];queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0x36')]=utils[_0x8f6b('0x15')]();queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0x34')]=utils[_0x8f6b('0x15')]();queues[_0x335b8a['transfereeuniqueid']]['holdtime']=0x0;queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0x5a')]=0x0;utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x5b'),_0x335b8a[_0x8f6b('0x52')],queues[_0x335b8a['transfereeuniqueid']][_0x8f6b('0x2e')],queues[_0x335b8a['transfereeuniqueid']]['calleridnum'],queues[_0x335b8a[_0x8f6b('0x49')]][_0x8f6b('0x59')]));}else{utils['info'](util[_0x8f6b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x335b8a['origtransfereruniqueid'],queues[_0x335b8a['origtransfererlinkedid']][_0x8f6b('0x2e')],_0x335b8a[_0x8f6b('0x54')]));queues[_0x335b8a[_0x8f6b('0x53')]]['transfereduniqueid']=_0x335b8a['secondtransfererlinkedid'];}}}else if(_0x335b8a[_0x8f6b('0x5c')]==_0x335b8a['secondtransfererlinkedid']){if(!_[_0x8f6b('0x19')](queues[_0x335b8a[_0x8f6b('0x53')]])){utils[_0x8f6b('0x2')](util['format'](_0x8f6b('0x5d'),_0x335b8a[_0x8f6b('0x52')],queues[_0x335b8a['origtransfererlinkedid']][_0x8f6b('0x2e')],_0x335b8a['secondtransfereruniqueid'],_0x335b8a[_0x8f6b('0x5e')]));queues[_0x335b8a[_0x8f6b('0x53')]]['transfer']=!![];queues[_0x335b8a[_0x8f6b('0x53')]][_0x8f6b('0x4b')]='ATTENDED';queues[_0x335b8a[_0x8f6b('0x53')]][_0x8f6b('0x4c')]=_0x335b8a[_0x8f6b('0x5e')];queues[_0x335b8a[_0x8f6b('0x53')]][_0x8f6b('0x4d')]=_0x335b8a[_0x8f6b('0x5c')];queues[_0x335b8a[_0x8f6b('0x53')]][_0x8f6b('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x8f6b('0x19')](queues[_0x335b8a['secondtransfererlinkedid']])){if(_0x335b8a[_0x8f6b('0x5f')]&&queues[_0x335b8a[_0x8f6b('0x5f')]]){queues[_0x335b8a[_0x8f6b('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x335b8a[_0x8f6b('0x60')]]=_[_0x8f6b('0x61')](queues[_0x335b8a[_0x8f6b('0x5f')]]);queues[_0x335b8a[_0x8f6b('0x60')]]['transfereduniqueid']=_0x335b8a['transfertargetuniqueid'];queues[_0x335b8a[_0x8f6b('0x60')]][_0x8f6b('0x20')]=0x2;queues[_0x335b8a[_0x8f6b('0x60')]][_0x8f6b('0x8')]=queues[_0x335b8a[_0x8f6b('0x53')]][_0x8f6b('0x8')];queues[_0x335b8a[_0x8f6b('0x60')]]['calleridname']=queues[_0x335b8a['origtransfererlinkedid']][_0x8f6b('0x59')];queues[_0x335b8a['transfertargetuniqueid']][_0x8f6b('0x36')]=utils[_0x8f6b('0x15')]();queues[_0x335b8a[_0x8f6b('0x60')]][_0x8f6b('0x34')]=utils['now']();queues[_0x335b8a['transfertargetuniqueid']][_0x8f6b('0x62')]=0x0;queues[_0x335b8a[_0x8f6b('0x60')]][_0x8f6b('0x5a')]=0x0;utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x63'),_0x335b8a[_0x8f6b('0x52')],queues[_0x335b8a[_0x8f6b('0x60')]][_0x8f6b('0x2e')],queues[_0x335b8a['transfertargetuniqueid']][_0x8f6b('0xf')],queues[_0x335b8a['transfertargetuniqueid']][_0x8f6b('0x8')],queues[_0x335b8a[_0x8f6b('0x60')]]['calleridname']));}else{utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x64'),_0x335b8a['origtransfereruniqueid'],queues[_0x335b8a['secondtransfererlinkedid']][_0x8f6b('0x2e')],_0x335b8a[_0x8f6b('0x53')]));queues[_0x335b8a['secondtransfererlinkedid']]['transfereduniqueid']=_0x335b8a[_0x8f6b('0x53')];}}}}catch(_0x203378){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x51'),_0x335b8a[_0x8f6b('0x52')]),_0x203378);}};exports['musiconholdstart']=function(_0x2bcb5e){try{if(!_[_0x8f6b('0x19')](queues[_0x2bcb5e[_0x8f6b('0x11')]])){utils['debug'](util[_0x8f6b('0x3')](_0x8f6b('0x65'),_0x2bcb5e[_0x8f6b('0x11')]),_0x2bcb5e);queues[_0x2bcb5e[_0x8f6b('0x11')]][_0x8f6b('0x66')]=utils[_0x8f6b('0x15')]();utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x67'),_0x2bcb5e[_0x8f6b('0x11')],queues[_0x2bcb5e[_0x8f6b('0x11')]][_0x8f6b('0x2e')],queues[_0x2bcb5e[_0x8f6b('0x11')]][_0x8f6b('0x66')]));}}catch(_0x250ca3){utils['error'](util[_0x8f6b('0x3')](_0x8f6b('0x65'),_0x2bcb5e['uniqueid']),_0x250ca3);}};exports['musiconholdstop']=function(_0x1c0c04){try{if(!_[_0x8f6b('0x19')](queues[_0x1c0c04[_0x8f6b('0x11')]])){if(!_[_0x8f6b('0x19')](queues[_0x1c0c04[_0x8f6b('0x11')]]['musiconholdstartAt'])){utils[_0x8f6b('0x10')](util[_0x8f6b('0x3')]('[%s][queues][musiconholdstop]',_0x1c0c04[_0x8f6b('0x11')]),_0x1c0c04);queues[_0x1c0c04[_0x8f6b('0x11')]][_0x8f6b('0x5a')]+=utils[_0x8f6b('0x35')](utils[_0x8f6b('0x15')](),queues[_0x1c0c04[_0x8f6b('0x11')]]['musiconholdstartAt']);utils[_0x8f6b('0x2')](util[_0x8f6b('0x3')](_0x8f6b('0x68'),_0x1c0c04[_0x8f6b('0x11')],queues[_0x1c0c04[_0x8f6b('0x11')]][_0x8f6b('0x2e')],queues[_0x1c0c04[_0x8f6b('0x11')]]['mohtime']));delete queues[_0x1c0c04['uniqueid']][_0x8f6b('0x66')];}}}catch(_0x918e1){utils[_0x8f6b('0x16')](util[_0x8f6b('0x3')](_0x8f6b('0x69'),_0x1c0c04[_0x8f6b('0x11')]),_0x918e1);}}; \ No newline at end of file +var _0xc580=['[%s][queues][varset]','queuestatus','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','holdtime','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','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','format','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','transfereduniqueid','error'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0xc580,0x1e4));var _0x0c58=function(_0x4bec28,_0x178142){_0x4bec28=_0x4bec28-0x0;var _0x4ac8fe=_0xc580[_0x4bec28];return _0x4ac8fe;};'use strict';var _=require('lodash');var util=require(_0x0c58('0x0'));var utils=require(_0x0c58('0x1'));var queues={};function writeDB(_0x4560e4){utils[_0x0c58('0x2')](util['format'](_0x0c58('0x3'),_0x4560e4[_0x0c58('0x4')],_0x4560e4['channel'],_0x4560e4[_0x0c58('0x5')],_0x4560e4[_0x0c58('0x6')],_0x4560e4[_0x0c58('0x7')],_0x4560e4[_0x0c58('0x8')],_0x4560e4['queuecallerexitreason']));if(_0x4560e4[_0x0c58('0x5')]){utils['getVoiceQueueByName'](_0x4560e4[_0x0c58('0x5')])['then'](function(_0x4c2c7c){if(_0x4c2c7c){_0x4560e4[_0x0c58('0x9')]=_0x4c2c7c[_0x0c58('0x9')];}utils[_0x0c58('0xa')]('CreateVoiceQueueReport',_0x4560e4);});}else{utils[_0x0c58('0xa')](_0x0c58('0xb'),_0x4560e4);}if(_0x4560e4['transfereduniqueid']){delete queues[_0x4560e4['transfereduniqueid']];}else{delete queues[_0x4560e4['uniqueid']];}}exports[_0x0c58('0xc')]=function(_0x310aff){try{utils[_0x0c58('0xd')](util[_0x0c58('0xe')]('[%s][queues][queuecallerjoin]',_0x310aff['uniqueid']),_0x310aff);utils[_0x0c58('0x2')](util[_0x0c58('0xe')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x310aff[_0x0c58('0x4')],_0x310aff[_0x0c58('0x5')],_0x310aff[_0x0c58('0xf')]));queues[_0x310aff[_0x0c58('0x4')]]=_[_0x0c58('0x10')](_0x310aff,{'originalposition':_0x310aff['position'],'queuecallerjoinAt':utils[_0x0c58('0x11')](),'mohtime':0x0});}catch(_0x1eddf3){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x310aff[_0x0c58('0x4')]),_0x1eddf3);}};exports[_0x0c58('0x12')]=function(_0x982ea0){try{if(!_[_0x0c58('0x13')](queues[_0x982ea0[_0x0c58('0x4')]])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x14'),_0x982ea0['uniqueid']),_0x982ea0);if(queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x15')]){if(!queues[_0x982ea0['uniqueid']]['queuecallerabandon']&&!queues[_0x982ea0[_0x0c58('0x4')]]['queuecallerexit']){queues[_0x982ea0['uniqueid']][_0x0c58('0x16')]=!![];queues[_0x982ea0['uniqueid']][_0x0c58('0x17')]=utils[_0x0c58('0x11')]();queues[_0x982ea0['uniqueid']]['queuecallerexitreason']=_0x0c58('0x18');}utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x19'),_0x982ea0[_0x0c58('0x4')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1b')]));writeDB(queues[_0x982ea0[_0x0c58('0x4')]]);}else if(queues[_0x982ea0[_0x0c58('0x4')]]['transfereduniqueid']){utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x1c'),_0x982ea0[_0x0c58('0x4')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1d')]));queues[queues[_0x982ea0['uniqueid']][_0x0c58('0x1d')]]=queues[_0x982ea0[_0x0c58('0x4')]];queues[queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1d')]]['queuecallerenterreason']=0x2;delete queues[_0x982ea0[_0x0c58('0x4')]];}}}catch(_0x6dd9e0){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')](_0x0c58('0x14'),_0x982ea0['uniqueid']),_0x6dd9e0);}};exports['varset']=function(_0x120bcd){try{utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x1f'),_0x120bcd['uniqueid']),_0x120bcd);if(!_[_0x0c58('0x13')](_0x120bcd['variable'][_0x0c58('0x20')])&&_0x120bcd['value']['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x120bcd[_0x0c58('0x4')]])){queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x21')]=![];queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x22')]=null;queues[_0x120bcd['uniqueid']][_0x0c58('0x23')]=!![];queues[_0x120bcd['uniqueid']][_0x0c58('0x24')]=utils['now']();queues[_0x120bcd[_0x0c58('0x4')]]['queuecallerexitreason']=_0x120bcd[_0x0c58('0x25')]['toUpperCase']();utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x26'),_0x120bcd['uniqueid'],queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x1a')],_0x120bcd[_0x0c58('0x25')],queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x1b')]));writeDB(queues[_0x120bcd[_0x0c58('0x4')]]);}}else if(!_[_0x0c58('0x13')](_0x120bcd[_0x0c58('0x27')][_0x0c58('0x28')])){if(!_[_0x0c58('0x13')](queues[_0x120bcd[_0x0c58('0x4')]])&&!queues[_0x120bcd[_0x0c58('0x4')]]['queuecallerabandon']){queues[_0x120bcd['uniqueid']][_0x0c58('0x21')]=![];queues[_0x120bcd['uniqueid']]['queuecallerabandonAt']=null;queues[_0x120bcd['uniqueid']][_0x0c58('0x23')]=!![];queues[_0x120bcd['uniqueid']][_0x0c58('0x24')]=utils[_0x0c58('0x11')]();queues[_0x120bcd['uniqueid']][_0x0c58('0x1b')]=_0x0c58('0x29');utils['info'](util[_0x0c58('0xe')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x120bcd['uniqueid'],queues[_0x120bcd['uniqueid']][_0x0c58('0x1a')],_0x120bcd[_0x0c58('0x25')],queues[_0x120bcd[_0x0c58('0x4')]]['queuecallerexitreason']));}}}catch(_0x5c1180){utils['error'](util[_0x0c58('0xe')]('[%s][queues][varset]',_0x120bcd['uniqueid']),_0x5c1180);}};exports[_0x0c58('0x21')]=function(_0x4d6141){try{if(!_[_0x0c58('0x13')](queues[_0x4d6141['uniqueid']])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x2a'),_0x4d6141[_0x0c58('0x4')]),_0x4d6141);queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x23')]=![];queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x24')]=null;queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x21')]=!![];queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x22')]=utils[_0x0c58('0x11')]();queues[_0x4d6141['uniqueid']][_0x0c58('0x1b')]='ABANDONED';utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x2b'),_0x4d6141[_0x0c58('0x4')],queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x4d6141['uniqueid']]['queuecallerexitreason']));}}catch(_0x5e2262){utils['error'](util[_0x0c58('0xe')]('[%s][queues][queuecallerabandon]',_0x4d6141[_0x0c58('0x4')]),_0x5e2262);}};exports[_0x0c58('0x2c')]=function(_0x8b2af4){try{if(!_[_0x0c58('0x13')](queues[_0x8b2af4[_0x0c58('0x4')]])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x2d'),_0x8b2af4[_0x0c58('0x4')]),_0x8b2af4);utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x2e'),_0x8b2af4[_0x0c58('0x4')],queues[_0x8b2af4[_0x0c58('0x4')]]['name'],_0x8b2af4[_0x0c58('0x2f')],_0x8b2af4[_0x0c58('0x30')]));queues[_0x8b2af4[_0x0c58('0x4')]][_0x0c58('0x2c')]=!![];queues[_0x8b2af4[_0x0c58('0x4')]]['queuecallerleaveAt']=utils['now']();queues[_0x8b2af4[_0x0c58('0x4')]]['holdtime']=utils[_0x0c58('0x31')](queues[_0x8b2af4[_0x0c58('0x4')]][_0x0c58('0x15')],queues[_0x8b2af4[_0x0c58('0x4')]]['queuecallerjoinAt']);queues[_0x8b2af4[_0x0c58('0x4')]]['position']=_0x8b2af4['position'];queues[_0x8b2af4['uniqueid']][_0x0c58('0x32')]=_0x8b2af4[_0x0c58('0x32')];queues[_0x8b2af4[_0x0c58('0x4')]][_0x0c58('0x2f')]=_0x8b2af4[_0x0c58('0x2f')];queues[_0x8b2af4['uniqueid']][_0x0c58('0x30')]=_0x8b2af4[_0x0c58('0x30')];}}catch(_0x57e2f9){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][queuecallerleave]',_0x8b2af4[_0x0c58('0x4')]),_0x57e2f9);}};exports[_0x0c58('0x33')]=function(_0x4606d){try{if(!_[_0x0c58('0x13')](queues[_0x4606d[_0x0c58('0x4')]])){utils['debug'](util[_0x0c58('0xe')](_0x0c58('0x34'),_0x4606d['uniqueid']),_0x4606d);utils[_0x0c58('0x2')](util['format'](_0x0c58('0x35'),_0x4606d[_0x0c58('0x4')],queues[_0x4606d['uniqueid']][_0x0c58('0x1a')],_0x4606d[_0x0c58('0x36')],_0x4606d[_0x0c58('0x37')]));queues[_0x4606d[_0x0c58('0x4')]][_0x0c58('0x21')]=![];queues[_0x4606d[_0x0c58('0x4')]]['queuecallerabandon']=![];queues[_0x4606d[_0x0c58('0x4')]][_0x0c58('0x22')]=null;queues[_0x4606d[_0x0c58('0x4')]][_0x0c58('0x23')]=![];queues[_0x4606d['uniqueid']][_0x0c58('0x1b')]=null;queues[_0x4606d[_0x0c58('0x4')]]['queuecallerexitAt']=null;queues[_0x4606d['uniqueid']]['assigned']=!![];queues[_0x4606d[_0x0c58('0x4')]]['accountcode']=_0x4606d[_0x0c58('0x37')];queues[_0x4606d[_0x0c58('0x4')]]['lastAssignedTo']=_0x4606d['membername'];}}catch(_0x248361){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')](_0x0c58('0x34'),_0x4606d[_0x0c58('0x4')]),_0x248361);}};exports[_0x0c58('0x38')]=function(_0x22c15d){try{if(!_['isNil'](queues[_0x22c15d['uniqueid']])){if(queues[_0x22c15d[_0x0c58('0x4')]]['queuecallerleaveAt']){utils['debug'](util[_0x0c58('0xe')](_0x0c58('0x39'),_0x22c15d['uniqueid']),_0x22c15d);queues[_0x22c15d['uniqueid']][_0x0c58('0x21')]=![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x21')]=![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x22')]=null;queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x23')]=![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x24')]=null;queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x3a')]=!![];queues[_0x22c15d[_0x0c58('0x4')]]['lastAssignedTo']=_0x22c15d[_0x0c58('0x36')];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x16')]=!![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x17')]=utils[_0x0c58('0x11')]();if(_0x22c15d['reason']==_0x0c58('0x3b')){if(!queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x3b')]){queues[_0x22c15d[_0x0c58('0x4')]]['queuecallerexitreason']=_0x0c58('0x3c');}}else{queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x1b')]=_0x0c58('0x3d')+_0x22c15d[_0x0c58('0x3e')][_0x0c58('0x3f')]();}utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x40'),_0x22c15d['uniqueid'],queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x1a')],_0x22c15d[_0x0c58('0x36')],queues[_0x22c15d[_0x0c58('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x22c15d['uniqueid']]);}}}catch(_0x510369){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][agentcomplete]',_0x22c15d[_0x0c58('0x4')]),_0x510369);}};exports[_0x0c58('0x41')]=function(_0x2fc751){try{if(!_[_0x0c58('0x13')](queues[_0x2fc751[_0x0c58('0x42')]])){utils[_0x0c58('0xd')](util['format']('[%s][queues][blindtransfer]',_0x2fc751[_0x0c58('0x4')]),_0x2fc751);queues[_0x2fc751[_0x0c58('0x42')]][_0x0c58('0x3b')]=!![];queues[_0x2fc751[_0x0c58('0x42')]]['transfertype']=_0x0c58('0x43');queues[_0x2fc751[_0x0c58('0x42')]][_0x0c58('0x44')]=_0x2fc751['extension'];queues[_0x2fc751['transfereeuniqueid']][_0x0c58('0x45')]=_0x2fc751[_0x0c58('0x42')];queues[_0x2fc751['transfereeuniqueid']][_0x0c58('0x1b')]=_0x0c58('0x46');utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x47'),_0x2fc751['uniqueid'],queues[_0x2fc751[_0x0c58('0x42')]][_0x0c58('0x1a')],_0x2fc751[_0x0c58('0x42')],_0x2fc751[_0x0c58('0x48')]));}}catch(_0xd49582){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][blindtransfer]',_0x2fc751[_0x0c58('0x4')]),_0xd49582);}};exports[_0x0c58('0x49')]=function(_0x535ac0){try{utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x4a'),_0x535ac0[_0x0c58('0x4b')]),_0x535ac0);if(_0x535ac0[_0x0c58('0x4b')]==_0x535ac0['origtransfererlinkedid']){if(!_[_0x0c58('0x13')](queues[_0x535ac0[_0x0c58('0x4c')]])){utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x4d'),_0x535ac0['origtransfereruniqueid'],queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x1a')],_0x535ac0[_0x0c58('0x4e')]));queues[_0x535ac0['secondtransfererlinkedid']][_0x0c58('0x3b')]=!![];queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x4f')]=_0x0c58('0x50');queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x44')]=_0x535ac0['origtransfererexten'];queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x45')]=_0x535ac0[_0x0c58('0x4b')];queues[_0x535ac0['secondtransfererlinkedid']]['queuecallerexitreason']=_0x0c58('0x51');}if(!_[_0x0c58('0x13')](queues[_0x535ac0[_0x0c58('0x52')]])){if(_0x535ac0[_0x0c58('0x53')]&&queues[_0x535ac0['transfereelinkedid']]){queues[_0x535ac0[_0x0c58('0x53')]][_0x0c58('0x54')]=0x1;queues[_0x535ac0[_0x0c58('0x42')]]=_[_0x0c58('0x55')](queues[_0x535ac0[_0x0c58('0x53')]]);queues[_0x535ac0['transfereeuniqueid']][_0x0c58('0x1d')]=_0x535ac0[_0x0c58('0x56')];queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x54')]=0x2;queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x7')]=queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x7')];queues[_0x535ac0['transfereeuniqueid']][_0x0c58('0x57')]=queues[_0x535ac0[_0x0c58('0x4c')]]['calleridname'];queues[_0x535ac0[_0x0c58('0x42')]]['queuecallerjoinAt']=utils[_0x0c58('0x11')]();queues[_0x535ac0[_0x0c58('0x42')]]['queuecallerleaveAt']=utils[_0x0c58('0x11')]();queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x58')]=0x0;queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x59')]=0x0;utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x5a'),_0x535ac0[_0x0c58('0x4b')],queues[_0x535ac0['transfereeuniqueid']]['name'],queues[_0x535ac0[_0x0c58('0x42')]]['calleridnum'],queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x57')]));}else{utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x5b'),_0x535ac0[_0x0c58('0x4b')],queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x1a')],_0x535ac0[_0x0c58('0x4c')]));queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x1d')]=_0x535ac0[_0x0c58('0x4c')];}}}else if(_0x535ac0[_0x0c58('0x5c')]==_0x535ac0['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x535ac0[_0x0c58('0x52')]])){utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x5d'),_0x535ac0['origtransfereruniqueid'],queues[_0x535ac0[_0x0c58('0x52')]]['name'],_0x535ac0['secondtransfereruniqueid'],_0x535ac0[_0x0c58('0x5e')]));queues[_0x535ac0['origtransfererlinkedid']][_0x0c58('0x3b')]=!![];queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x4f')]='ATTENDED';queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x44')]=_0x535ac0[_0x0c58('0x5e')];queues[_0x535ac0[_0x0c58('0x52')]]['transferuniqueid']=_0x535ac0['secondtransfereruniqueid'];queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x1b')]=_0x0c58('0x51');}if(!_[_0x0c58('0x13')](queues[_0x535ac0[_0x0c58('0x4c')]])){if(_0x535ac0[_0x0c58('0x5f')]&&queues[_0x535ac0[_0x0c58('0x5f')]]){queues[_0x535ac0[_0x0c58('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x535ac0[_0x0c58('0x56')]]=_[_0x0c58('0x55')](queues[_0x535ac0[_0x0c58('0x5f')]]);queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x1d')]=_0x535ac0[_0x0c58('0x56')];queues[_0x535ac0['transfertargetuniqueid']][_0x0c58('0x54')]=0x2;queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x7')]=queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x7')];queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x57')]=queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x57')];queues[_0x535ac0['transfertargetuniqueid']][_0x0c58('0x60')]=utils[_0x0c58('0x11')]();queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x15')]=utils[_0x0c58('0x11')]();queues[_0x535ac0['transfertargetuniqueid']][_0x0c58('0x58')]=0x0;queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x59')]=0x0;utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x61'),_0x535ac0['origtransfereruniqueid'],queues[_0x535ac0[_0x0c58('0x56')]]['name'],queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x1d')],queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x7')],queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x57')]));}else{utils[_0x0c58('0x2')](util[_0x0c58('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x535ac0[_0x0c58('0x4b')],queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x1a')],_0x535ac0[_0x0c58('0x52')]));queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x1d')]=_0x535ac0['origtransfererlinkedid'];}}}}catch(_0x142e17){utils['error'](util[_0x0c58('0xe')]('[%s][queues][attendedtransfer]',_0x535ac0[_0x0c58('0x4b')]),_0x142e17);}};exports['musiconholdstart']=function(_0x1c5317){try{if(!_['isNil'](queues[_0x1c5317[_0x0c58('0x4')]])){utils[_0x0c58('0xd')](util['format']('[%s][queues][musiconholdstart]',_0x1c5317[_0x0c58('0x4')]),_0x1c5317);queues[_0x1c5317[_0x0c58('0x4')]][_0x0c58('0x62')]=utils['now']();utils['info'](util['format'](_0x0c58('0x63'),_0x1c5317[_0x0c58('0x4')],queues[_0x1c5317[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x1c5317[_0x0c58('0x4')]][_0x0c58('0x62')]));}}catch(_0x294840){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][musiconholdstart]',_0x1c5317[_0x0c58('0x4')]),_0x294840);}};exports[_0x0c58('0x64')]=function(_0x333216){try{if(!_[_0x0c58('0x13')](queues[_0x333216[_0x0c58('0x4')]])){if(!_[_0x0c58('0x13')](queues[_0x333216[_0x0c58('0x4')]][_0x0c58('0x62')])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')]('[%s][queues][musiconholdstop]',_0x333216['uniqueid']),_0x333216);queues[_0x333216['uniqueid']]['mohtime']+=utils[_0x0c58('0x31')](utils[_0x0c58('0x11')](),queues[_0x333216[_0x0c58('0x4')]][_0x0c58('0x62')]);utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x65'),_0x333216[_0x0c58('0x4')],queues[_0x333216['uniqueid']]['name'],queues[_0x333216[_0x0c58('0x4')]][_0x0c58('0x59')]));delete queues[_0x333216[_0x0c58('0x4')]]['musiconholdstartAt'];}}}catch(_0x136a04){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')](_0x0c58('0x66'),_0x333216[_0x0c58('0x4')]),_0x136a04);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5406f81..b02d69c 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 _0xd7f5=['[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','monitors','forEach','clone','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','[%s][recordings][newchannel]','info','exten','context','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','varset','variable','mixmonitor_filename','[%s][recordings][varset]'];(function(_0x50fa87,_0x27927b){var _0x5b1434=function(_0x49d712){while(--_0x49d712){_0x50fa87['push'](_0x50fa87['shift']());}};_0x5b1434(++_0x27927b);}(_0xd7f5,0x70));var _0x5d7f=function(_0x9e575,_0x5894d4){_0x9e575=_0x9e575-0x0;var _0x522277=_0xd7f5[_0x9e575];return _0x522277;};'use strict';var _=require(_0x5d7f('0x0'));var util=require(_0x5d7f('0x1'));var utils=require('./utils');var transfers=require(_0x5d7f('0x2'));var recordings={};function writeDB(_0x202d35){var _0x521e2b;utils['info'](util[_0x5d7f('0x3')](_0x5d7f('0x4'),_0x202d35[_0x5d7f('0x5')]));if(transfers['blinds'][_0x202d35[_0x5d7f('0x5')]]){_0x521e2b=_0x202d35[_0x5d7f('0x5')];_0x202d35['uniqueid']=transfers['blinds'][_0x202d35[_0x5d7f('0x5')]][_0x5d7f('0x6')];}if(_0x202d35[_0x5d7f('0x7')]){utils[_0x5d7f('0x8')](_0x202d35[_0x5d7f('0x7')])[_0x5d7f('0x9')](function(_0x7fbeb4){if(_0x7fbeb4){_0x202d35[_0x5d7f('0xa')]=_0x7fbeb4[_0x5d7f('0xb')];_0x202d35[_0x5d7f('0xc')]=_0x7fbeb4['id'];}utils[_0x5d7f('0xd')](_0x5d7f('0xe'),_0x202d35);});}else{utils[_0x5d7f('0xd')](_0x5d7f('0xe'),_0x202d35);}if(_0x521e2b)delete transfers[_0x5d7f('0xf')][_0x521e2b];}exports[_0x5d7f('0x10')]=function(_0x11d9a7){try{utils[_0x5d7f('0x11')](util[_0x5d7f('0x3')](_0x5d7f('0x12'),_0x11d9a7['uniqueid']),_0x11d9a7);if(_0x11d9a7['uniqueid']==_0x11d9a7['linkedid']){utils[_0x5d7f('0x13')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x11d9a7[_0x5d7f('0x5')],_0x11d9a7['context'],_0x11d9a7[_0x5d7f('0x14')]));recordings[_0x11d9a7[_0x5d7f('0x5')]]={'uniqueid':_0x11d9a7['uniqueid'],'accountcode':_0x11d9a7[_0x5d7f('0x7')],'exten':_0x11d9a7[_0x5d7f('0x14')],'context':_0x11d9a7[_0x5d7f('0x15')],'channel':_0x11d9a7['channel'],'monitors':[]};}}catch(_0x5f20e4){utils[_0x5d7f('0x16')](util[_0x5d7f('0x3')](_0x5d7f('0x12'),_0x11d9a7['uniqueid']),_0x5f20e4);}};exports[_0x5d7f('0x17')]=function(_0x193887){try{utils[_0x5d7f('0x11')](util['format'](_0x5d7f('0x18'),_0x193887[_0x5d7f('0x5')]),_0x193887);if(!_[_0x5d7f('0x19')](recordings[_0x193887[_0x5d7f('0x5')]])&&_0x193887[_0x5d7f('0x1a')]==0x6){utils[_0x5d7f('0x13')](util[_0x5d7f('0x3')](_0x5d7f('0x1b'),_0x193887[_0x5d7f('0x5')],_0x193887[_0x5d7f('0x15')],_0x193887['channel']));}else if(!_[_0x5d7f('0x19')](recordings[_0x193887[_0x5d7f('0x1c')]])&&_0x193887['channelstate']==0x6&&_0x193887[_0x5d7f('0x15')]!=_0x5d7f('0x1d')){utils[_0x5d7f('0x13')](util[_0x5d7f('0x3')](_0x5d7f('0x1e'),_0x193887[_0x5d7f('0x5')],_0x193887['linkedid'],_0x193887['context'],_0x193887[_0x5d7f('0x1f')]));recordings[_0x193887[_0x5d7f('0x1c')]]['accountcode']=_0x193887['accountcode'];}}catch(_0x4b4123){utils[_0x5d7f('0x16')](util[_0x5d7f('0x3')]('[%s][recordings][newstate]',_0x193887[_0x5d7f('0x5')]),_0x4b4123);}};exports[_0x5d7f('0x20')]=function(_0x124db3){try{if(!_[_0x5d7f('0x19')](_0x124db3[_0x5d7f('0x21')])&&!_['isNil'](_0x124db3['variable'][_0x5d7f('0x22')])){utils[_0x5d7f('0x11')](util[_0x5d7f('0x3')](_0x5d7f('0x23'),_0x124db3[_0x5d7f('0x5')]),_0x124db3);utils['info'](util[_0x5d7f('0x3')](_0x5d7f('0x24'),_0x124db3[_0x5d7f('0x5')],_0x124db3[_0x5d7f('0x21')],_0x124db3[_0x5d7f('0x25')]));if(_[_0x5d7f('0x26')](_0x124db3['value'],_0x5d7f('0x27'))){_0x124db3['value']=_0x124db3[_0x5d7f('0x25')][_0x5d7f('0x28')](_0x5d7f('0x27'),_0x5d7f('0x29'));}if(recordings[_0x124db3['linkedid']]){var _0x5bfa6e=_[_0x5d7f('0x2a')](recordings[_0x124db3['linkedid']]['monitors'],{'value':_0x124db3[_0x5d7f('0x25')]});if(_[_0x5d7f('0x19')](_0x5bfa6e)){recordings[_0x124db3[_0x5d7f('0x1c')]]['monitors']['push']({'value':_0x124db3[_0x5d7f('0x25')]});}}}}catch(_0x3aa0c7){utils[_0x5d7f('0x16')](util['format'](_0x5d7f('0x23'),_0x124db3[_0x5d7f('0x5')]),_0x3aa0c7);}};exports['hangup']=function(_0x4c8e59){try{if(!_[_0x5d7f('0x19')](recordings[_0x4c8e59[_0x5d7f('0x5')]])){utils[_0x5d7f('0x11')](util['format'](_0x5d7f('0x2b'),_0x4c8e59['uniqueid']),_0x4c8e59);utils[_0x5d7f('0x13')](util[_0x5d7f('0x3')](_0x5d7f('0x2c'),_0x4c8e59[_0x5d7f('0x5')],_0x4c8e59[_0x5d7f('0x2d')],_0x4c8e59[_0x5d7f('0x2e')],_0x4c8e59[_0x5d7f('0x2f')]));recordings[_0x4c8e59[_0x5d7f('0x5')]]['calleridnum']=_0x4c8e59[_0x5d7f('0x2d')];recordings[_0x4c8e59['uniqueid']][_0x5d7f('0x2e')]=_0x4c8e59[_0x5d7f('0x2e')];recordings[_0x4c8e59[_0x5d7f('0x5')]][_0x5d7f('0x30')]=_0x4c8e59[_0x5d7f('0x30')];recordings[_0x4c8e59[_0x5d7f('0x5')]]['connectedlinename']=_0x4c8e59[_0x5d7f('0x31')];if(recordings[_0x4c8e59[_0x5d7f('0x5')]][_0x5d7f('0x32')]=='outbound'&&recordings[_0x4c8e59[_0x5d7f('0x5')]][_0x5d7f('0x7')]){recordings[_0x4c8e59['uniqueid']][_0x5d7f('0x30')]=recordings[_0x4c8e59[_0x5d7f('0x5')]][_0x5d7f('0x7')];recordings[_0x4c8e59[_0x5d7f('0x5')]]['connectedlinename']='';}recordings[_0x4c8e59[_0x5d7f('0x5')]][_0x5d7f('0x33')][_0x5d7f('0x34')](function(_0x3ef7ad){var _0x3ae99b=_[_0x5d7f('0x35')](recordings[_0x4c8e59[_0x5d7f('0x5')]]);_0x3ae99b[_0x5d7f('0x25')]=_0x3ef7ad[_0x5d7f('0x25')];writeDB(_0x3ae99b);});delete recordings[_0x4c8e59[_0x5d7f('0x5')]];}}catch(_0x248c80){utils[_0x5d7f('0x16')](util[_0x5d7f('0x3')](_0x5d7f('0x2b'),_0x4c8e59['uniqueid']),_0x248c80);}};exports['newexten']=function(_0x5c640d){try{if(!_[_0x5d7f('0x19')](recordings[_0x5c640d[_0x5d7f('0x5')]])){utils[_0x5d7f('0x11')](util[_0x5d7f('0x3')](_0x5d7f('0x36'),_0x5c640d['uniqueid']),_0x5c640d);utils[_0x5d7f('0x13')](util[_0x5d7f('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5c640d[_0x5d7f('0x5')],_0x5c640d[_0x5d7f('0x37')],_0x5c640d[_0x5d7f('0x38')]));if(_0x5c640d['application'][_0x5d7f('0x39')]()==_0x5d7f('0x3a')&&_[_0x5d7f('0x3b')](_0x5c640d['appdata'][_0x5d7f('0x39')](),_0x5d7f('0x3c'))){var _0x510ab0=_0x5c640d[_0x5d7f('0x38')][_0x5d7f('0x3d')]('=');var _0x237bfe=_0x510ab0[0x0][_0x5d7f('0x3e')](_0x510ab0[0x0][_0x5d7f('0x3f')]('(')+0x1,_0x510ab0[0x0][_0x5d7f('0x3f')](')'));var _0x140a41=_0x510ab0[0x1];recordings[_0x5c640d['uniqueid']][_0x237bfe]=_0x140a41;}}}catch(_0xe5c9cc){utils[_0x5d7f('0x16')](util[_0x5d7f('0x3')]('[%s][recordings][newexten]',_0x5c640d[_0x5d7f('0x5')]),_0xe5c9cc);}};exports[_0x5d7f('0x40')]=function(_0x35f144){try{if(!_[_0x5d7f('0x19')](recordings[_0x35f144['uniqueid']])){utils['debug'](util[_0x5d7f('0x3')](_0x5d7f('0x41'),_0x35f144[_0x5d7f('0x5')]),_0x35f144);utils['info'](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x35f144[_0x5d7f('0x5')],_0x35f144[_0x5d7f('0x42')]));recordings[_0x35f144[_0x5d7f('0x5')]][_0x5d7f('0x42')]=_0x35f144[_0x5d7f('0x42')];}}catch(_0x384252){utils[_0x5d7f('0x16')](util['format'](_0x5d7f('0x41'),_0x35f144[_0x5d7f('0x5')]),_0x384252);}};exports[_0x5d7f('0x43')]=function(_0x3df48a){try{utils[_0x5d7f('0x11')](util[_0x5d7f('0x3')](_0x5d7f('0x44'),_0x3df48a[_0x5d7f('0x5')]),_0x3df48a);utils[_0x5d7f('0x13')](util[_0x5d7f('0x3')](_0x5d7f('0x45'),_0x3df48a[_0x5d7f('0x5')],_0x3df48a['transferercalleridnum'],_0x3df48a[_0x5d7f('0x46')],_0x3df48a[_0x5d7f('0x47')],_0x3df48a['transfereecalleridname']));if(recordings[_0x3df48a[_0x5d7f('0x48')]]&&transfers[_0x5d7f('0xf')][_0x3df48a[_0x5d7f('0x48')]]){transfers[_0x5d7f('0xf')][_0x3df48a[_0x5d7f('0x48')]][_0x5d7f('0x49')]=!![];}}catch(_0x32aaaf){utils[_0x5d7f('0x16')](util[_0x5d7f('0x3')](_0x5d7f('0x44'),_0x3df48a[_0x5d7f('0x5')]),_0x32aaaf);}}; \ No newline at end of file +var _0xc7d6=['debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','util','./transfers.controller','info','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xc7d6,0x1e3));var _0x6c7d=function(_0x589352,_0x131683){_0x589352=_0x589352-0x0;var _0x3f4137=_0xc7d6[_0x589352];return _0x3f4137;};'use strict';var _=require('lodash');var util=require(_0x6c7d('0x0'));var utils=require('./utils');var transfers=require(_0x6c7d('0x1'));var recordings={};function writeDB(_0x5938c8){var _0x1e9f6b;utils[_0x6c7d('0x2')](util['format']('[%s][recordings][writeDB]',_0x5938c8[_0x6c7d('0x3')]));if(transfers['blinds'][_0x5938c8[_0x6c7d('0x3')]]){_0x1e9f6b=_0x5938c8[_0x6c7d('0x3')];_0x5938c8[_0x6c7d('0x3')]=transfers[_0x6c7d('0x4')][_0x5938c8['uniqueid']][_0x6c7d('0x5')];}if(_0x5938c8[_0x6c7d('0x6')]){utils['getUserByInternal'](_0x5938c8[_0x6c7d('0x6')])[_0x6c7d('0x7')](function(_0x8493e1){if(_0x8493e1){_0x5938c8[_0x6c7d('0x8')]=_0x8493e1[_0x6c7d('0x9')];_0x5938c8[_0x6c7d('0xa')]=_0x8493e1['id'];}utils[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x5938c8);});}else{utils[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x5938c8);}if(_0x1e9f6b)delete transfers[_0x6c7d('0x4')][_0x1e9f6b];}exports[_0x6c7d('0xd')]=function(_0x29441f){try{utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x10'),_0x29441f[_0x6c7d('0x3')]),_0x29441f);if(_0x29441f[_0x6c7d('0x3')]==_0x29441f[_0x6c7d('0x11')]){utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')](_0x6c7d('0x12'),_0x29441f[_0x6c7d('0x3')],_0x29441f[_0x6c7d('0x13')],_0x29441f['exten']));recordings[_0x29441f[_0x6c7d('0x3')]]={'uniqueid':_0x29441f[_0x6c7d('0x3')],'accountcode':_0x29441f[_0x6c7d('0x6')],'exten':_0x29441f[_0x6c7d('0x14')],'context':_0x29441f[_0x6c7d('0x13')],'channel':_0x29441f[_0x6c7d('0x15')],'monitors':[]};}}catch(_0x26584b){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')]('[%s][recordings][newchannel]',_0x29441f[_0x6c7d('0x3')]),_0x26584b);}};exports[_0x6c7d('0x17')]=function(_0x46ffba){try{utils[_0x6c7d('0xe')](util['format'](_0x6c7d('0x18'),_0x46ffba[_0x6c7d('0x3')]),_0x46ffba);if(!_[_0x6c7d('0x19')](recordings[_0x46ffba['uniqueid']])&&_0x46ffba['channelstate']==0x6){utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x46ffba['uniqueid'],_0x46ffba['context'],_0x46ffba['channel']));}else if(!_['isNil'](recordings[_0x46ffba['linkedid']])&&_0x46ffba['channelstate']==0x6&&_0x46ffba['context']!=_0x6c7d('0x1a')){utils['info'](util[_0x6c7d('0xf')](_0x6c7d('0x1b'),_0x46ffba[_0x6c7d('0x3')],_0x46ffba[_0x6c7d('0x11')],_0x46ffba[_0x6c7d('0x13')],_0x46ffba['channel']));recordings[_0x46ffba[_0x6c7d('0x11')]][_0x6c7d('0x6')]=_0x46ffba[_0x6c7d('0x6')];}}catch(_0x185251){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')]('[%s][recordings][newstate]',_0x46ffba[_0x6c7d('0x3')]),_0x185251);}};exports[_0x6c7d('0x1c')]=function(_0x37cabe){try{if(!_[_0x6c7d('0x19')](_0x37cabe[_0x6c7d('0x1d')])&&!_[_0x6c7d('0x19')](_0x37cabe[_0x6c7d('0x1d')][_0x6c7d('0x1e')])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x1f'),_0x37cabe[_0x6c7d('0x3')]),_0x37cabe);utils['info'](util[_0x6c7d('0xf')](_0x6c7d('0x20'),_0x37cabe[_0x6c7d('0x3')],_0x37cabe[_0x6c7d('0x1d')],_0x37cabe[_0x6c7d('0x21')]));if(_[_0x6c7d('0x22')](_0x37cabe[_0x6c7d('0x21')],_0x6c7d('0x23'))){_0x37cabe['value']=_0x37cabe[_0x6c7d('0x21')][_0x6c7d('0x24')]('.wav49',_0x6c7d('0x25'));}if(recordings[_0x37cabe[_0x6c7d('0x11')]]){var _0x392928=_[_0x6c7d('0x26')](recordings[_0x37cabe[_0x6c7d('0x11')]]['monitors'],{'value':_0x37cabe[_0x6c7d('0x21')]});if(_['isNil'](_0x392928)){recordings[_0x37cabe['linkedid']][_0x6c7d('0x27')][_0x6c7d('0x28')]({'value':_0x37cabe[_0x6c7d('0x21')]});}}}}catch(_0x538c87){utils['error'](util[_0x6c7d('0xf')]('[%s][recordings][varset]',_0x37cabe[_0x6c7d('0x3')]),_0x538c87);}};exports['hangup']=function(_0x510541){try{if(!_[_0x6c7d('0x19')](recordings[_0x510541['uniqueid']])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x29'),_0x510541['uniqueid']),_0x510541);utils[_0x6c7d('0x2')](util['format'](_0x6c7d('0x2a'),_0x510541[_0x6c7d('0x3')],_0x510541['calleridnum'],_0x510541['calleridname'],_0x510541[_0x6c7d('0x2b')]));recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x2c')]=_0x510541['calleridnum'];recordings[_0x510541['uniqueid']][_0x6c7d('0x2d')]=_0x510541[_0x6c7d('0x2d')];recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x2e')]=_0x510541[_0x6c7d('0x2e')];recordings[_0x510541['uniqueid']][_0x6c7d('0x2f')]=_0x510541['connectedlinename'];if(recordings[_0x510541[_0x6c7d('0x3')]]['type']==_0x6c7d('0x30')&&recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x6')]){recordings[_0x510541['uniqueid']][_0x6c7d('0x2e')]=recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x6')];recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x2f')]='';}recordings[_0x510541['uniqueid']][_0x6c7d('0x27')][_0x6c7d('0x31')](function(_0x39256f){var _0x2b8828=_['clone'](recordings[_0x510541[_0x6c7d('0x3')]]);_0x2b8828[_0x6c7d('0x21')]=_0x39256f[_0x6c7d('0x21')];writeDB(_0x2b8828);});delete recordings[_0x510541[_0x6c7d('0x3')]];}}catch(_0x2d25fd){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')](_0x6c7d('0x29'),_0x510541[_0x6c7d('0x3')]),_0x2d25fd);}};exports['newexten']=function(_0x56738b){try{if(!_[_0x6c7d('0x19')](recordings[_0x56738b[_0x6c7d('0x3')]])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')]('[%s][recordings][newexten]',_0x56738b[_0x6c7d('0x3')]),_0x56738b);utils['info'](util[_0x6c7d('0xf')](_0x6c7d('0x32'),_0x56738b['uniqueid'],_0x56738b[_0x6c7d('0x33')],_0x56738b['appdata']));if(_0x56738b[_0x6c7d('0x33')][_0x6c7d('0x34')]()==_0x6c7d('0x35')&&_[_0x6c7d('0x36')](_0x56738b[_0x6c7d('0x37')][_0x6c7d('0x34')](),_0x6c7d('0x38'))){var _0x32d470=_0x56738b['appdata'][_0x6c7d('0x39')]('=');var _0x371ca7=_0x32d470[0x0]['substring'](_0x32d470[0x0][_0x6c7d('0x3a')]('(')+0x1,_0x32d470[0x0][_0x6c7d('0x3a')](')'));var _0x4e2edc=_0x32d470[0x1];recordings[_0x56738b[_0x6c7d('0x3')]][_0x371ca7]=_0x4e2edc;}}}catch(_0x1db4ef){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')](_0x6c7d('0x3b'),_0x56738b[_0x6c7d('0x3')]),_0x1db4ef);}};exports[_0x6c7d('0x3c')]=function(_0x44042f){try{if(!_[_0x6c7d('0x19')](recordings[_0x44042f['uniqueid']])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x3d'),_0x44042f[_0x6c7d('0x3')]),_0x44042f);utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')](_0x6c7d('0x3e'),_0x44042f[_0x6c7d('0x3')],_0x44042f[_0x6c7d('0x3f')]));recordings[_0x44042f['uniqueid']][_0x6c7d('0x3f')]=_0x44042f[_0x6c7d('0x3f')];}}catch(_0x29121f){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')](_0x6c7d('0x3d'),_0x44042f[_0x6c7d('0x3')]),_0x29121f);}};exports[_0x6c7d('0x40')]=function(_0x52d8ab){try{utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x41'),_0x52d8ab[_0x6c7d('0x3')]),_0x52d8ab);utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x52d8ab['uniqueid'],_0x52d8ab[_0x6c7d('0x42')],_0x52d8ab[_0x6c7d('0x43')],_0x52d8ab[_0x6c7d('0x44')],_0x52d8ab['transfereecalleridname']));if(recordings[_0x52d8ab[_0x6c7d('0x45')]]&&transfers[_0x6c7d('0x4')][_0x52d8ab[_0x6c7d('0x45')]]){transfers[_0x6c7d('0x4')][_0x52d8ab[_0x6c7d('0x45')]][_0x6c7d('0x46')]=!![];}}catch(_0x51add1){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')]('[%s][recordings][blindtransfer]',_0x52d8ab['uniqueid']),_0x51add1);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 008989e..db10341 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 _0x143a=['transferercalleridname','transfereecalleridnum','transfereecalleridname','blinds','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum'];(function(_0x5ad0e7,_0x29055b){var _0x590a85=function(_0x508bfb){while(--_0x508bfb){_0x5ad0e7['push'](_0x5ad0e7['shift']());}};_0x590a85(++_0x29055b);}(_0x143a,0x102));var _0xa143=function(_0x861a71,_0x2c66f7){_0x861a71=_0x861a71-0x0;var _0x523734=_0x143a[_0x861a71];return _0x523734;};'use strict';var _=require('lodash');var util=require(_0xa143('0x0'));var utils=require(_0xa143('0x1'));function writeDB(_0x5d061d){utils[_0xa143('0x2')](util[_0xa143('0x3')](_0xa143('0x4'),_0x5d061d[_0xa143('0x5')]===_0xa143('0x6')?_0x5d061d[_0xa143('0x7')]:_0x5d061d[_0xa143('0x8')],_0x5d061d['type']));utils[_0xa143('0x9')](_0xa143('0xa'),_0x5d061d);}exports['blinds']={};exports[_0xa143('0xb')]=function(_0x5a31e5){try{utils[_0xa143('0xc')](util['format'](_0xa143('0xd'),_0x5a31e5[_0xa143('0x8')]),_0x5a31e5);utils[_0xa143('0x2')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5a31e5[_0xa143('0x8')],_0x5a31e5[_0xa143('0xe')],_0x5a31e5[_0xa143('0xf')],_0x5a31e5[_0xa143('0x10')],_0x5a31e5[_0xa143('0x11')]));_0x5a31e5[_0xa143('0x5')]='blind';exports[_0xa143('0x12')][_0x5a31e5['transfereruniqueid']]=_0x5a31e5;writeDB(_0x5a31e5);}catch(_0x3e4270){utils[_0xa143('0x13')](util[_0xa143('0x3')](_0xa143('0xd'),_0x5a31e5[_0xa143('0x8')]),_0x3e4270);}};exports[_0xa143('0x14')]=function(_0x42dd20){try{utils[_0xa143('0xc')](util[_0xa143('0x3')](_0xa143('0x15'),_0x42dd20['origtransfereruniqueid']),_0x42dd20);utils['info'](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x42dd20[_0xa143('0x7')],_0x42dd20[_0xa143('0x16')],_0x42dd20[_0xa143('0x17')],_0x42dd20[_0xa143('0x18')],_0x42dd20['transfertargetcalleridname']));_0x42dd20=_['assign'](_0x42dd20,{'transfererchannel':_0x42dd20[_0xa143('0x19')],'transferercalleridnum':_0x42dd20[_0xa143('0x16')],'transferercalleridname':_0x42dd20[_0xa143('0x17')],'transfererconnectedlinenum':_0x42dd20[_0xa143('0x1a')],'transfererconnectedlinename':_0x42dd20['secondtransfererconnectedlinename'],'transfereraccountcode':_0x42dd20['origtransfereraccountcode'],'transferercontext':_0x42dd20['secondtransferercontext'],'transfererexten':_0x42dd20[_0xa143('0x1b')],'transfererlinkedid':_0x42dd20[_0xa143('0x1c')],'context':_0x42dd20[_0xa143('0x1d')],'extension':_0x42dd20[_0xa143('0x1e')],'type':_0xa143('0x6')});if(_['isNil'](_0x42dd20['transfereechannel'])){_0x42dd20=_[_0xa143('0x1f')](_0x42dd20,{'transfereechannel':_0x42dd20[_0xa143('0x20')],'transfereecalleridnum':_0x42dd20['transfertargetcalleridnum'],'transfereecalleridname':_0x42dd20[_0xa143('0x21')],'transfereeconnectedlinenum':_0x42dd20[_0xa143('0x22')],'transfereeconnectedlinename':_0x42dd20[_0xa143('0x23')],'transfereeaccountcode':_0x42dd20[_0xa143('0x24')],'transfereecontext':_0x42dd20[_0xa143('0x25')],'transfereeexten':_0x42dd20['transfertargetexten'],'transfereelinkedid':_0x42dd20[_0xa143('0x26')]});}writeDB(_0x42dd20);}catch(_0x49840f){utils[_0xa143('0x13')](util[_0xa143('0x3')](_0xa143('0x15'),_0x42dd20[_0xa143('0x7')]),_0x49840f);}}; \ No newline at end of file +var _0x5ff9=['transfertargetexten','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5ff9,0x17e));var _0x95ff=function(_0x21c857,_0x1f9812){_0x21c857=_0x21c857-0x0;var _0x2e6516=_0x5ff9[_0x21c857];return _0x2e6516;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var utils=require('./utils');function writeDB(_0x8db227){utils[_0x95ff('0x2')](util[_0x95ff('0x3')](_0x95ff('0x4'),_0x8db227[_0x95ff('0x5')]===_0x95ff('0x6')?_0x8db227[_0x95ff('0x7')]:_0x8db227['uniqueid'],_0x8db227['type']));utils[_0x95ff('0x8')]('CreateVoiceTransferReport',_0x8db227);}exports[_0x95ff('0x9')]={};exports['blindtransfer']=function(_0xd32ee3){try{utils[_0x95ff('0xa')](util['format'](_0x95ff('0xb'),_0xd32ee3['uniqueid']),_0xd32ee3);utils['info'](util[_0x95ff('0x3')](_0x95ff('0xc'),_0xd32ee3[_0x95ff('0xd')],_0xd32ee3[_0x95ff('0xe')],_0xd32ee3[_0x95ff('0xf')],_0xd32ee3['transfereecalleridnum'],_0xd32ee3[_0x95ff('0x10')]));_0xd32ee3['type']=_0x95ff('0x11');exports[_0x95ff('0x9')][_0xd32ee3[_0x95ff('0x12')]]=_0xd32ee3;writeDB(_0xd32ee3);}catch(_0x34afb9){utils['error'](util[_0x95ff('0x3')]('[%s][transfers][blindtransfer]',_0xd32ee3[_0x95ff('0xd')]),_0x34afb9);}};exports['attendedtransfer']=function(_0x41d6ef){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x41d6ef['origtransfereruniqueid']),_0x41d6ef);utils['info'](util[_0x95ff('0x3')](_0x95ff('0x13'),_0x41d6ef[_0x95ff('0x7')],_0x41d6ef[_0x95ff('0x14')],_0x41d6ef[_0x95ff('0x15')],_0x41d6ef[_0x95ff('0x16')],_0x41d6ef['transfertargetcalleridname']));_0x41d6ef=_[_0x95ff('0x17')](_0x41d6ef,{'transfererchannel':_0x41d6ef[_0x95ff('0x18')],'transferercalleridnum':_0x41d6ef[_0x95ff('0x14')],'transferercalleridname':_0x41d6ef[_0x95ff('0x15')],'transfererconnectedlinenum':_0x41d6ef[_0x95ff('0x19')],'transfererconnectedlinename':_0x41d6ef[_0x95ff('0x1a')],'transfereraccountcode':_0x41d6ef[_0x95ff('0x1b')],'transferercontext':_0x41d6ef[_0x95ff('0x1c')],'transfererexten':_0x41d6ef['secondtransfererexten'],'transfererlinkedid':_0x41d6ef[_0x95ff('0x1d')],'context':_0x41d6ef['origtransferercontext'],'extension':_0x41d6ef[_0x95ff('0x1e')],'type':_0x95ff('0x6')});if(_[_0x95ff('0x1f')](_0x41d6ef[_0x95ff('0x20')])){_0x41d6ef=_[_0x95ff('0x17')](_0x41d6ef,{'transfereechannel':_0x41d6ef['transfertargetchannel'],'transfereecalleridnum':_0x41d6ef[_0x95ff('0x16')],'transfereecalleridname':_0x41d6ef[_0x95ff('0x21')],'transfereeconnectedlinenum':_0x41d6ef['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x41d6ef[_0x95ff('0x22')],'transfereeaccountcode':_0x41d6ef[_0x95ff('0x23')],'transfereecontext':_0x41d6ef['transfertargetcontext'],'transfereeexten':_0x41d6ef[_0x95ff('0x24')],'transfereelinkedid':_0x41d6ef[_0x95ff('0x25')]});}writeDB(_0x41d6ef);}catch(_0x361720){utils['error'](util[_0x95ff('0x3')]('[%s][transfers][attendedtransfer]',_0x41d6ef[_0x95ff('0x7')]),_0x361720);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 99f30c6..9c76994 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 _0x9ce0=['getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','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','interface','[utils][getUser]\x20where:%s','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]'];(function(_0x1b8d05,_0x473e49){var _0x47b2a0=function(_0xd8a337){while(--_0xd8a337){_0x1b8d05['push'](_0x1b8d05['shift']());}};_0x47b2a0(++_0x473e49);}(_0x9ce0,0x183));var _0x09ce=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9ce0[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0x09ce('0x0'));var jayson=require(_0x09ce('0x1'));var moment=require(_0x09ce('0x2'));var util=require(_0x09ce('0x3'));var client=jayson[_0x09ce('0x4')][_0x09ce('0x5')]({'port':0x2329});var logger=require(_0x09ce('0x6'))(_0x09ce('0x7'));exports[_0x09ce('0x8')]=function(_0x1174e1,_0x252869){logger[_0x09ce('0x8')](_0x1174e1,_0x252869?util[_0x09ce('0x9')](_0x252869,{'showHidden':![],'depth':null}):'');};exports[_0x09ce('0xa')]=function(_0x375ba6,_0xaeed2e){logger[_0x09ce('0xa')](_0x375ba6,_0xaeed2e?util[_0x09ce('0x9')](_0xaeed2e,{'showHidden':![],'depth':null}):'');};exports[_0x09ce('0xb')]=function(_0x31950f,_0x439232){logger[_0x09ce('0xb')](_0x31950f,_0x439232?util[_0x09ce('0x9')](_0x439232,{'showHidden':![],'depth':null}):'');};exports[_0x09ce('0xc')]=function(_0x5ef728,_0x4d8fa3){return client[_0x09ce('0xc')](_0x5ef728,{'body':_0x4d8fa3})[_0x09ce('0xd')](function(_0x625bc1){logger[_0x09ce('0xa')](_0x09ce('0xe'),_0x5ef728,_0x625bc1?util[_0x09ce('0x9')](_0x625bc1,{'showHidden':![],'depth':null}):'');})[_0x09ce('0xf')](function(_0x43555b){logger[_0x09ce('0xb')](_0x09ce('0xe'),_0x5ef728,_0x43555b?util[_0x09ce('0x9')](_0x43555b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x352879){return client[_0x09ce('0xc')](_0x09ce('0x10'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x09ce('0x11')],'where':_0x352879,'limit':0x1}})[_0x09ce('0xd')](function(_0x4c5c70){logger[_0x09ce('0xa')](_0x09ce('0x12'),JSON['stringify'](_0x352879),_0x4c5c70?util[_0x09ce('0x9')](_0x4c5c70,{'showHidden':![],'depth':null}):'');return _0x4c5c70[_0x09ce('0x13')]['length']?_0x4c5c70[_0x09ce('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x29203d){return new BPromise(function(_0x46b337,_0x3565d6){if(_0x29203d){return getUser({'internal':_0x29203d})[_0x09ce('0xd')](function(_0x2e456){logger[_0x09ce('0x8')](_0x09ce('0x14'),_0x29203d,_0x2e456?_0x09ce('0x15'):_0x09ce('0x16'));return _0x46b337(_0x2e456);})[_0x09ce('0xf')](function(_0x116acb){logger['error'](_0x09ce('0x17'),_0x116acb?util[_0x09ce('0x9')](_0x116acb,{'showHidden':![],'depth':null}):'');return _0x46b337(null);});}return _0x46b337(null);});};exports[_0x09ce('0x18')]=function(_0x51be6e){return new BPromise(function(_0x59942c,_0x246b23){if(_0x51be6e){return getUser({'interface':_0x51be6e})[_0x09ce('0xd')](function(_0x2788b8){logger['info'](_0x09ce('0x19'),_0x51be6e,_0x2788b8?'found':_0x09ce('0x16'));return _0x59942c(_0x2788b8);})[_0x09ce('0xf')](function(_0x82c758){logger[_0x09ce('0xb')]('[utils][getUserByInterface]',_0x82c758?util[_0x09ce('0x9')](_0x82c758,{'showHidden':![],'depth':null}):'');return _0x59942c(null);});}return _0x59942c(null);});};exports[_0x09ce('0x1a')]=function(_0x2c22a2){return new BPromise(function(_0x48615e,_0x1584df){if(_0x2c22a2){return getUser({'name':_0x2c22a2})[_0x09ce('0xd')](function(_0x23d189){logger[_0x09ce('0x8')](_0x09ce('0x1b'),_0x2c22a2,_0x23d189?_0x09ce('0x15'):_0x09ce('0x16'));return _0x48615e(_0x23d189);})[_0x09ce('0xf')](function(_0x273924){logger[_0x09ce('0xb')](_0x09ce('0x1c'),_0x273924?util['inspect'](_0x273924,{'showHidden':![],'depth':null}):'');return _0x48615e(null);});}return _0x48615e(null);});};exports[_0x09ce('0x1d')]=function(_0x4057b8){return new BPromise(function(_0x5c27e5,_0x3dc815){if(_0x4057b8){return client[_0x09ce('0xc')](_0x09ce('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x09ce('0x1f'),_0x09ce('0x20'),_0x09ce('0x21'),_0x09ce('0x22')],'where':{'name':_0x4057b8},'limit':0x1}})[_0x09ce('0xd')](function(_0x3c7bc2){logger[_0x09ce('0xa')](_0x09ce('0x23'),_0x4057b8,_0x3c7bc2?util[_0x09ce('0x9')](_0x3c7bc2,{'showHidden':![],'depth':null}):'');logger['info'](_0x09ce('0x24'),_0x4057b8,_0x3c7bc2?_0x09ce('0x15'):_0x09ce('0x16'));return _0x5c27e5(_0x3c7bc2[_0x09ce('0x13')][_0x09ce('0x25')]?_0x3c7bc2[_0x09ce('0x13')][0x0]:null);})[_0x09ce('0xf')](function(_0x452e2c){logger[_0x09ce('0xb')](_0x09ce('0x26'),_0x452e2c?util['inspect'](_0x452e2c,{'showHidden':![],'depth':null}):'');return _0x5c27e5(null);});}return _0x5c27e5(null);});};exports[_0x09ce('0x27')]=function(_0x112aad,_0x3b5e11){return moment(_0x112aad)[_0x09ce('0x28')](_0x3b5e11,_0x09ce('0x29'))[_0x09ce('0x2a')](_0x09ce('0x2b'));};exports[_0x09ce('0x2c')]=function(_0xc9d982,_0x2f3b2d){return moment(_0xc9d982)[_0x09ce('0x2d')](_0x2f3b2d,_0x09ce('0x29'))[_0x09ce('0x2a')](_0x09ce('0x2b'));};exports[_0x09ce('0x2e')]=function(_0xf8f36c,_0x5108de){return moment(_0xf8f36c)[_0x09ce('0x2f')](moment(_0x5108de),'seconds');};exports[_0x09ce('0x30')]=function(_0x1933e2,_0x35fef2){return parseInt(_0x1933e2,0xa)+parseInt(_0x35fef2,0xa);};exports[_0x09ce('0x31')]=function(){return moment()['format'](_0x09ce('0x2b'));};exports[_0x09ce('0x32')]=function(_0x5e14e6,_0x977791){if(_0x977791){return moment(_0x5e14e6)[_0x09ce('0x32')](_0x977791);}return!![];};exports[_0x09ce('0x33')]=function(_0x270893,_0x3f6cac){if(_0x3f6cac){return moment(_0x270893)[_0x09ce('0x33')](_0x3f6cac);}else if(_0x270893){return!![];}return![];}; \ No newline at end of file +var _0xd1ad=['stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s'];(function(_0xa2a82d,_0x5f293b){var _0x157cf4=function(_0x26ffcc){while(--_0x26ffcc){_0xa2a82d['push'](_0xa2a82d['shift']());}};_0x157cf4(++_0x5f293b);}(_0xd1ad,0x1d7));var _0xdd1a=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0xd1ad[_0x46b22a];return _0x44c2e8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xdd1a('0x0'));var moment=require(_0xdd1a('0x1'));var util=require(_0xdd1a('0x2'));var client=jayson[_0xdd1a('0x3')][_0xdd1a('0x4')]({'port':0x2329});var logger=require(_0xdd1a('0x5'))(_0xdd1a('0x6'));exports[_0xdd1a('0x7')]=function(_0x3bbd1c,_0x3091cc){logger[_0xdd1a('0x7')](_0x3bbd1c,_0x3091cc?util[_0xdd1a('0x8')](_0x3091cc,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x1f0675,_0x3a1927){logger['debug'](_0x1f0675,_0x3a1927?util[_0xdd1a('0x8')](_0x3a1927,{'showHidden':![],'depth':null}):'');};exports[_0xdd1a('0x9')]=function(_0x226672,_0x500e57){logger['error'](_0x226672,_0x500e57?util['inspect'](_0x500e57,{'showHidden':![],'depth':null}):'');};exports[_0xdd1a('0xa')]=function(_0xf52d5,_0x5dcaf9){return client[_0xdd1a('0xa')](_0xf52d5,{'body':_0x5dcaf9})[_0xdd1a('0xb')](function(_0xe0957c){logger[_0xdd1a('0xc')](_0xdd1a('0xd'),_0xf52d5,_0xe0957c?util['inspect'](_0xe0957c,{'showHidden':![],'depth':null}):'');})[_0xdd1a('0xe')](function(_0x2138c5){logger[_0xdd1a('0x9')]('[utils][request]\x20name:%s',_0xf52d5,_0x2138c5?util[_0xdd1a('0x8')](_0x2138c5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x21c47a){return client[_0xdd1a('0xa')](_0xdd1a('0xf'),{'options':{'raw':!![],'attributes':['id',_0xdd1a('0x10'),_0xdd1a('0x11'),'interface'],'where':_0x21c47a,'limit':0x1}})[_0xdd1a('0xb')](function(_0x1cc747){logger[_0xdd1a('0xc')](_0xdd1a('0x12'),JSON[_0xdd1a('0x13')](_0x21c47a),_0x1cc747?util['inspect'](_0x1cc747,{'showHidden':![],'depth':null}):'');return _0x1cc747[_0xdd1a('0x14')][_0xdd1a('0x15')]?_0x1cc747['result'][0x0]:null;});}exports[_0xdd1a('0x16')]=function(_0x1c275b){return new BPromise(function(_0x1f66e2,_0x29d42f){if(_0x1c275b){return getUser({'internal':_0x1c275b})['then'](function(_0x3cd1f9){logger['info'](_0xdd1a('0x17'),_0x1c275b,_0x3cd1f9?_0xdd1a('0x18'):_0xdd1a('0x19'));return _0x1f66e2(_0x3cd1f9);})[_0xdd1a('0xe')](function(_0x57f907){logger[_0xdd1a('0x9')](_0xdd1a('0x1a'),_0x57f907?util[_0xdd1a('0x8')](_0x57f907,{'showHidden':![],'depth':null}):'');return _0x1f66e2(null);});}return _0x1f66e2(null);});};exports['getUserByInterface']=function(_0x3d62c5){return new BPromise(function(_0x931d37,_0xe04c39){if(_0x3d62c5){return getUser({'interface':_0x3d62c5})[_0xdd1a('0xb')](function(_0x23bedb){logger[_0xdd1a('0x7')](_0xdd1a('0x1b'),_0x3d62c5,_0x23bedb?'found':_0xdd1a('0x19'));return _0x931d37(_0x23bedb);})[_0xdd1a('0xe')](function(_0x33e67b){logger['error'](_0xdd1a('0x1c'),_0x33e67b?util[_0xdd1a('0x8')](_0x33e67b,{'showHidden':![],'depth':null}):'');return _0x931d37(null);});}return _0x931d37(null);});};exports[_0xdd1a('0x1d')]=function(_0x60f617){return new BPromise(function(_0x24527e,_0x3deb27){if(_0x60f617){return getUser({'name':_0x60f617})[_0xdd1a('0xb')](function(_0x3a9522){logger[_0xdd1a('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x60f617,_0x3a9522?_0xdd1a('0x18'):_0xdd1a('0x19'));return _0x24527e(_0x3a9522);})['catch'](function(_0x5f172f){logger['error'](_0xdd1a('0x1e'),_0x5f172f?util[_0xdd1a('0x8')](_0x5f172f,{'showHidden':![],'depth':null}):'');return _0x24527e(null);});}return _0x24527e(null);});};exports[_0xdd1a('0x1f')]=function(_0x1e970c){return new BPromise(function(_0x18df8f,_0x3f338e){if(_0x1e970c){return client['request'](_0xdd1a('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0xdd1a('0x21'),_0xdd1a('0x22'),_0xdd1a('0x23')],'where':{'name':_0x1e970c},'limit':0x1}})[_0xdd1a('0xb')](function(_0x18fd78){logger[_0xdd1a('0xc')](_0xdd1a('0x24'),_0x1e970c,_0x18fd78?util[_0xdd1a('0x8')](_0x18fd78,{'showHidden':![],'depth':null}):'');logger[_0xdd1a('0x7')](_0xdd1a('0x25'),_0x1e970c,_0x18fd78?_0xdd1a('0x18'):_0xdd1a('0x19'));return _0x18df8f(_0x18fd78['result']['length']?_0x18fd78['result'][0x0]:null);})['catch'](function(_0xce2a58){logger[_0xdd1a('0x9')](_0xdd1a('0x26'),_0xce2a58?util[_0xdd1a('0x8')](_0xce2a58,{'showHidden':![],'depth':null}):'');return _0x18df8f(null);});}return _0x18df8f(null);});};exports['addTime']=function(_0x456d6d,_0x4679c6){return moment(_0x456d6d)[_0xdd1a('0x27')](_0x4679c6,_0xdd1a('0x28'))[_0xdd1a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdd1a('0x2a')]=function(_0x4908b2,_0x5edbe1){return moment(_0x4908b2)[_0xdd1a('0x2b')](_0x5edbe1,_0xdd1a('0x28'))['format'](_0xdd1a('0x2c'));};exports['diffTime']=function(_0x535518,_0x5c2f38){return moment(_0x535518)['diff'](moment(_0x5c2f38),_0xdd1a('0x28'));};exports[_0xdd1a('0x2d')]=function(_0x5de46a,_0x37d243){return parseInt(_0x5de46a,0xa)+parseInt(_0x37d243,0xa);};exports[_0xdd1a('0x2e')]=function(){return moment()[_0xdd1a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdd1a('0x2f')]=function(_0x3c5eb0,_0x36bc36){if(_0x36bc36){return moment(_0x3c5eb0)['isAfter'](_0x36bc36);}return!![];};exports[_0xdd1a('0x30')]=function(_0x10e608,_0x3c93f3){if(_0x3c93f3){return moment(_0x10e608)[_0xdd1a('0x30')](_0x3c93f3);}else if(_0x10e608){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 f8a8418..1f62f50 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 _0xdbcf=['agent_name','test','lodash','express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','name','then','client','catch','user','no-user','timestamp','error','api','auth','set','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','headers','x-forwarded-for','connection','url','statusCode','responseTime','inspect','logger','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)','remoteAddress','other'];(function(_0x2c13ed,_0xedbb71){var _0x1f433d=function(_0x924421){while(--_0x924421){_0x2c13ed['push'](_0x2c13ed['shift']());}};_0x1f433d(++_0xedbb71);}(_0xdbcf,0x1e6));var _0xfdbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbcf[_0x3dd15e];return _0x231fd0;};var fs=require('fs-extra');var _=require(_0xfdbc('0x0'));var ewinston=require(_0xfdbc('0x1'));var path=require(_0xfdbc('0x2'));var util=require(_0xfdbc('0x3'));var fileLogger=require('./loggers')[_0xfdbc('0x4')];var safeTemplate=require('./safe-template')[_0xfdbc('0x5')];var maskSensitiveData=require(_0xfdbc('0x6'))[_0xfdbc('0x7')];function ClientSideLogger(){function _0x6c680b(_0x165c2a){var _0x2a1d27=path[_0xfdbc('0x8')](_0xfdbc('0x9'),_0xfdbc('0xa'),_0xfdbc('0xb'));var _0x1c097a=path[_0xfdbc('0x8')]('client',_0x165c2a[_0xfdbc('0xc')]+'-'+_0x165c2a[_0xfdbc('0xd')]);return fs['ensureDir'](path[_0xfdbc('0x8')](_0x2a1d27,_0x1c097a))[_0xfdbc('0xe')](function(){var _0x186bd4=fileLogger(_0xfdbc('0xf'),path[_0xfdbc('0x8')](_0x2a1d27,_0x1c097a));return _0x186bd4;})[_0xfdbc('0x10')](function(_0x1f7779){throw _0x1f7779;});}this[_0xfdbc('0xa')]=function(_0x1cb420,_0x183eae,_0x336c4f,_0x51d8c7){return _0x6c680b(_0x1cb420[_0xfdbc('0x11')])[_0xfdbc('0xe')](function(_0x2ce390){var _0x6c2583=_0x2ce390[_0x183eae];return _0x6c2583;})[_0xfdbc('0xe')](function(_0x142865){var _0x3e3bb2=_0x1cb420[_0xfdbc('0x11')]?_0x1cb420[_0xfdbc('0x11')]['id']:_0xfdbc('0x12');var _0x7fe9c6=_0x51d8c7['data'];var _0x38eeed=_0x51d8c7[_0xfdbc('0x13')];var _0x6f12d4=new Date(Number(_0x38eeed));return _0x142865(_0x3e3bb2,_0x6f12d4,_0x336c4f,_0x7fe9c6);})[_0xfdbc('0x10')](function(_0x1c7e88){fileLogger(_0xfdbc('0xf'))[_0xfdbc('0x14')](_0x1c7e88);});};}function setupLoggers(_0x93f837){return new Promise(function(_0x46ac93){var _0x40597e=new ClientSideLogger();var _0x3133c0=fileLogger(_0xfdbc('0x15'));var _0x2eb8f5=fileLogger(_0xfdbc('0x16'));_0x93f837[_0xfdbc('0x17')]('client-side-logger',_0x40597e);_0x93f837['use'](ewinston['logger']({'winstonInstance':_0x3133c0,'meta':![],'statusLevels':!![],'msg':function(_0x3a2cea,_0x5de3f6){var _0x239e77=_0xfdbc('0x18');if(!_[_0xfdbc('0x19')](_0x3a2cea['body'])){_0x239e77+=_0xfdbc('0x1a');var _0xb37d85=_0x3a2cea[_0xfdbc('0x1b')];maskSensitiveData(_0xb37d85);}return safeTemplate(util[_0xfdbc('0x1c')](_0x239e77,_0x3a2cea['method'],_0x3a2cea[_0xfdbc('0x1d')][_0xfdbc('0x1e')]?_0x3a2cea[_0xfdbc('0x1d')][_0xfdbc('0x1e')]:_0x3a2cea[_0xfdbc('0x1f')]['remoteAddress']||_0x3a2cea['ip'],_0x3a2cea[_0xfdbc('0x20')],_0x5de3f6[_0xfdbc('0x21')],_0x5de3f6[_0xfdbc('0x22')],_0x3a2cea[_0xfdbc('0x11')]?_0x3a2cea[_0xfdbc('0x11')]['id']:null,_0x3a2cea[_0xfdbc('0x11')]?_0x3a2cea[_0xfdbc('0x11')][_0xfdbc('0xd')]:null,_0x3a2cea[_0xfdbc('0x11')]?_0x3a2cea[_0xfdbc('0x11')][_0xfdbc('0xc')]:null,_0xb37d85?util[_0xfdbc('0x23')](_0xb37d85,![],null):''));}}));_0x93f837['use'](ewinston[_0xfdbc('0x24')]({'winstonInstance':_0x2eb8f5,'meta':![],'statusLevels':!![],'msg':function(_0x32e691,_0x46a4ad){var _0x1d1650='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x32e691[_0xfdbc('0x1b')]&&_0x32e691['body'][_0xfdbc('0x25')]&&_0x32e691[_0xfdbc('0x1b')][_0xfdbc('0x26')]){_0x1d1650=_0xfdbc('0x27');}return util['format'](_0x1d1650,_0x32e691['method'],_0x32e691[_0xfdbc('0x1d')][_0xfdbc('0x1e')]?_0x32e691[_0xfdbc('0x1d')][_0xfdbc('0x1e')]:_0x32e691[_0xfdbc('0x1f')][_0xfdbc('0x28')]||_0x32e691['ip'],_0x32e691['url'],_0x46a4ad[_0xfdbc('0x21')],_0x46a4ad['responseTime'],_0x32e691[_0xfdbc('0x11')]?_0x32e691[_0xfdbc('0x11')]['id']:null,_0x32e691[_0xfdbc('0x11')]?_0x32e691[_0xfdbc('0x11')][_0xfdbc('0xd')]:null,_0x32e691[_0xfdbc('0x11')]?_0x32e691[_0xfdbc('0x11')][_0xfdbc('0xc')]:null,_0x32e691[_0xfdbc('0x1b')]&&_0x32e691[_0xfdbc('0x1b')][_0xfdbc('0x25')]?_0x32e691[_0xfdbc('0x1b')][_0xfdbc('0x25')]:_0xfdbc('0x29'),_0x32e691[_0xfdbc('0x1b')]&&_0x32e691['body'][_0xfdbc('0x26')]?_0x32e691[_0xfdbc('0x1b')][_0xfdbc('0x26')]:'',_0x32e691[_0xfdbc('0x1b')]&&_0x32e691['body']['agent_name']?_0x32e691[_0xfdbc('0x1b')][_0xfdbc('0x2a')]:'');},'ignoreRoute':function(_0x91c924){var _0x4b4d08=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4b4d08[_0xfdbc('0x2b')](_0x91c924[_0xfdbc('0x20')]);}}));return _0x46ac93();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x4b2c=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','remoteAddress','role','other','agent_id','agent_name','test','setupLoggers','lodash','express-winston','util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','name','ensureDir','then','user','no-user','timestamp','catch','error','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','url','responseTime','inspect'];(function(_0x2767c3,_0x4077be){var _0x2658c7=function(_0x49c582){while(--_0x49c582){_0x2767c3['push'](_0x2767c3['shift']());}};_0x2658c7(++_0x4077be);}(_0x4b2c,0x1e1));var _0xc4b2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4b2c[_0x2dafbe];return _0x58a45a;};var fs=require('fs-extra');var _=require(_0xc4b2('0x0'));var ewinston=require(_0xc4b2('0x1'));var path=require('path');var util=require(_0xc4b2('0x2'));var fileLogger=require(_0xc4b2('0x3'))[_0xc4b2('0x4')];var safeTemplate=require('./safe-template')[_0xc4b2('0x5')];var maskSensitiveData=require(_0xc4b2('0x6'))[_0xc4b2('0x7')];function ClientSideLogger(){function _0x3e87ae(_0x49d9d2){var _0x26a025=path['join'](_0xc4b2('0x8'),_0xc4b2('0x9'),_0xc4b2('0xa'));var _0x289907=path[_0xc4b2('0xb')](_0xc4b2('0xc'),_0x49d9d2['role']+'-'+_0x49d9d2[_0xc4b2('0xd')]);return fs[_0xc4b2('0xe')](path['join'](_0x26a025,_0x289907))[_0xc4b2('0xf')](function(){var _0x5cede0=fileLogger(_0xc4b2('0xc'),path['join'](_0x26a025,_0x289907));return _0x5cede0;})['catch'](function(_0x33b377){throw _0x33b377;});}this['log']=function(_0x3cd1d9,_0x66a735,_0x1fda6d,_0x570fe4){return _0x3e87ae(_0x3cd1d9[_0xc4b2('0x10')])[_0xc4b2('0xf')](function(_0x1c01fc){var _0x4d03f8=_0x1c01fc[_0x66a735];return _0x4d03f8;})[_0xc4b2('0xf')](function(_0x2386bf){var _0x4cf984=_0x3cd1d9[_0xc4b2('0x10')]?_0x3cd1d9[_0xc4b2('0x10')]['id']:_0xc4b2('0x11');var _0x345bc4=_0x570fe4['data'];var _0x4a155e=_0x570fe4[_0xc4b2('0x12')];var _0x8fa4f7=new Date(Number(_0x4a155e));return _0x2386bf(_0x4cf984,_0x8fa4f7,_0x1fda6d,_0x345bc4);})[_0xc4b2('0x13')](function(_0x337e60){fileLogger('client')[_0xc4b2('0x14')](_0x337e60);});};}function setupLoggers(_0x109cda){return new Promise(function(_0x3bba86){var _0x4484b6=new ClientSideLogger();var _0x4c9e13=fileLogger('api');var _0x531dd3=fileLogger('auth');_0x109cda[_0xc4b2('0x15')](_0xc4b2('0x16'),_0x4484b6);_0x109cda[_0xc4b2('0x17')](ewinston[_0xc4b2('0x18')]({'winstonInstance':_0x4c9e13,'meta':![],'statusLevels':!![],'msg':function(_0x5920f1,_0xc1c079){var _0x4d1989=_0xc4b2('0x19');if(!_[_0xc4b2('0x1a')](_0x5920f1[_0xc4b2('0x1b')])){_0x4d1989+=_0xc4b2('0x1c');var _0x29e577=_0x5920f1['body'];maskSensitiveData(_0x29e577);}return safeTemplate(util[_0xc4b2('0x1d')](_0x4d1989,_0x5920f1['method'],_0x5920f1[_0xc4b2('0x1e')][_0xc4b2('0x1f')]?_0x5920f1[_0xc4b2('0x1e')][_0xc4b2('0x1f')]:_0x5920f1[_0xc4b2('0x20')]['remoteAddress']||_0x5920f1['ip'],_0x5920f1[_0xc4b2('0x21')],_0xc1c079['statusCode'],_0xc1c079[_0xc4b2('0x22')],_0x5920f1[_0xc4b2('0x10')]?_0x5920f1[_0xc4b2('0x10')]['id']:null,_0x5920f1[_0xc4b2('0x10')]?_0x5920f1[_0xc4b2('0x10')][_0xc4b2('0xd')]:null,_0x5920f1[_0xc4b2('0x10')]?_0x5920f1[_0xc4b2('0x10')]['role']:null,_0x29e577?util[_0xc4b2('0x23')](_0x29e577,![],null):''));}}));_0x109cda['use'](ewinston[_0xc4b2('0x18')]({'winstonInstance':_0x531dd3,'meta':![],'statusLevels':!![],'msg':function(_0x215596,_0x5a3534){var _0xc13e54=_0xc4b2('0x24');if(_0x215596[_0xc4b2('0x1b')]&&_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x25')]&&_0x215596[_0xc4b2('0x1b')]['agent_id']){_0xc13e54=_0xc4b2('0x26');}return util['format'](_0xc13e54,_0x215596[_0xc4b2('0x27')],_0x215596[_0xc4b2('0x1e')][_0xc4b2('0x1f')]?_0x215596['headers'][_0xc4b2('0x1f')]:_0x215596['connection'][_0xc4b2('0x28')]||_0x215596['ip'],_0x215596['url'],_0x5a3534['statusCode'],_0x5a3534['responseTime'],_0x215596[_0xc4b2('0x10')]?_0x215596[_0xc4b2('0x10')]['id']:null,_0x215596[_0xc4b2('0x10')]?_0x215596[_0xc4b2('0x10')][_0xc4b2('0xd')]:null,_0x215596[_0xc4b2('0x10')]?_0x215596[_0xc4b2('0x10')][_0xc4b2('0x29')]:null,_0x215596['body']&&_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x25')]?_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x25')]:_0xc4b2('0x2a'),_0x215596[_0xc4b2('0x1b')]&&_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x2b')]?_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x2b')]:'',_0x215596[_0xc4b2('0x1b')]&&_0x215596['body'][_0xc4b2('0x2c')]?_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x2c')]:'');},'ignoreRoute':function(_0x293e7b){var _0x1efa23=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1efa23[_0xc4b2('0x2d')](_0x293e7b['url']);}}));return _0x3bba86();});}exports[_0xc4b2('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 1aa3a66..75a8356 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187c=['YYYY-MM-DD\x20HH:mm:ss','level','{{{','keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}'];(function(_0x4374be,_0x38c59b){var _0x3353a1=function(_0x237b8b){while(--_0x237b8b){_0x4374be['push'](_0x4374be['shift']());}};_0x3353a1(++_0x38c59b);}(_0x187c,0x129));var _0xc187=function(_0x33a786,_0x11d98b){_0x33a786=_0x33a786-0x0;var _0x4fc991=_0x187c[_0x33a786];return _0x4fc991;};'use strict';var path=require(_0xc187('0x0'));var util=require(_0xc187('0x1'));var moment=require(_0xc187('0x2'));var winston=require(_0xc187('0x3'));var config=require(_0xc187('0x4'));var debugLevel=config[_0xc187('0x5')]?config[_0xc187('0x5')][_0xc187('0x6')]():_0xc187('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':'redBG\x20white','error':'red','warn':_0xc187('0x8'),'info':_0xc187('0x9'),'print':'bold\x20white','success':_0xc187('0xa'),'http':_0xc187('0xb'),'verbose':_0xc187('0xc'),'debug':_0xc187('0xd'),'silly':_0xc187('0xe')};winston[_0xc187('0xf')](XC_LOG_COLORS);function getLogFileName(_0x37d42d,_0x404792,_0x28a165){var _0x3753d1=_0x37d42d||_0xc187('0x10');return path[_0xc187('0x11')](_0x3753d1,util[_0xc187('0x12')](_0xc187('0x13'),_0x404792,_0x28a165));}function formatter(_0x149c7b,_0x34f8b8){_0x34f8b8[_0xc187('0x14')]=_0x34f8b8[_0xc187('0x14')][_0xc187('0x15')](/@@{/g,'{{{')['replace'](/}@@/g,_0xc187('0x16'))[_0xc187('0x15')](/@{/g,'{{')[_0xc187('0x15')](/}@/g,'}}');return util[_0xc187('0x12')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xc187('0x12')](_0xc187('0x17')),_0x34f8b8[_0xc187('0x18')]['toUpperCase'](),_0x149c7b,_0x34f8b8[_0xc187('0x14')]);}function fileFormat(_0x100f95,_0xfa61a4){_0xfa61a4[_0xc187('0x14')]=_0xfa61a4['message'][_0xc187('0x15')](/@@{/g,_0xc187('0x19'))[_0xc187('0x15')](/}@@/g,_0xc187('0x16'))[_0xc187('0x15')](/@{/g,'{{')[_0xc187('0x15')](/}@/g,'}}');var _0x2df756=_0xfa61a4['meta']&&Object[_0xc187('0x1a')](_0xfa61a4[_0xc187('0x1b')])[_0xc187('0x1c')]?'\x0a\x09'+JSON[_0xc187('0x1d')](_0xfa61a4[_0xc187('0x1b')]):'';return util['format'](_0xc187('0x1e'),moment()[_0xc187('0x12')](_0xc187('0x17')),_0xfa61a4['level']['toUpperCase'](),_0x100f95,_0xfa61a4[_0xc187('0x14')],_0x2df756);}function consoleLogger(){var _0x92da28=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc187('0x1f'))][(_0xc187('0x20'))]({'level':_0xc187('0x21'),'json':![],'formatter':function(_0x321501){return formatter('',_0x321501);}})]});return _0x92da28;}function fileLogger(_0xc5a50a,_0x42a738){var _0x1bb108=new winston[(_0xc187('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc187('0x1f'))][(_0xc187('0x23'))]({'name':util[_0xc187('0x12')](_0xc187('0x24'),_0xc5a50a,_0xc187('0x25')),'filename':getLogFileName(_0x42a738,_0xc5a50a,_0xc187('0x25')),'level':_0xc187('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5e07c3){return fileFormat(_0xc5a50a,_0x5e07c3);}}),new winston[(_0xc187('0x1f'))]['File']({'name':util['format'](_0xc187('0x24'),_0xc5a50a,debugLevel),'filename':getLogFileName(_0x42a738,_0xc5a50a,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x36b288){return fileFormat(_0xc5a50a,_0x36b288);}}),new winston['transports'][(_0xc187('0x20'))]({'level':'warn','json':![],'formatter':function(_0x223390){return fileFormat(_0xc5a50a,_0x223390);}})]});return _0x1bb108;}exports[_0xc187('0x26')]=consoleLogger;exports[_0xc187('0x27')]=fileLogger; \ No newline at end of file +var _0x4ff6=['consoleLogger','fileLogger','moment','winston','../config/environment','debugLevel','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','keys','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','File','%s-%s','error'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x4ff6,0x11a));var _0x64ff=function(_0x16e61a,_0x3150ac){_0x16e61a=_0x16e61a-0x0;var _0x31fbb2=_0x4ff6[_0x16e61a];return _0x31fbb2;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x64ff('0x0'));var winston=require(_0x64ff('0x1'));var config=require(_0x64ff('0x2'));var debugLevel=config['debugLevel']?config[_0x64ff('0x3')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x64ff('0x4'),'warn':_0x64ff('0x5'),'info':_0x64ff('0x6'),'print':_0x64ff('0x7'),'success':_0x64ff('0x8'),'http':'gray','verbose':_0x64ff('0x9'),'debug':_0x64ff('0xa'),'silly':_0x64ff('0xb')};winston[_0x64ff('0xc')](XC_LOG_COLORS);function getLogFileName(_0xb0e0b2,_0x561f5e,_0x1cb153){var _0x514858=_0xb0e0b2||_0x64ff('0xd');return path[_0x64ff('0xe')](_0x514858,util[_0x64ff('0xf')]('%s-%s.log',_0x561f5e,_0x1cb153));}function formatter(_0x36be0b,_0x4075bd){_0x4075bd[_0x64ff('0x10')]=_0x4075bd[_0x64ff('0x10')][_0x64ff('0x11')](/@@{/g,'{{{')[_0x64ff('0x11')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x64ff('0x11')](/}@/g,'}}');return util[_0x64ff('0xf')](_0x64ff('0x12'),moment()[_0x64ff('0xf')](_0x64ff('0x13')),_0x4075bd[_0x64ff('0x14')][_0x64ff('0x15')](),_0x36be0b,_0x4075bd[_0x64ff('0x10')]);}function fileFormat(_0x4624ca,_0x1bffef){_0x1bffef[_0x64ff('0x10')]=_0x1bffef[_0x64ff('0x10')]['replace'](/@@{/g,_0x64ff('0x16'))[_0x64ff('0x11')](/}@@/g,'}}}')[_0x64ff('0x11')](/@{/g,'{{')[_0x64ff('0x11')](/}@/g,'}}');var _0x347418=_0x1bffef['meta']&&Object[_0x64ff('0x17')](_0x1bffef[_0x64ff('0x18')])['length']?'\x0a\x09'+JSON[_0x64ff('0x19')](_0x1bffef[_0x64ff('0x18')]):'';return util['format'](_0x64ff('0x1a'),moment()[_0x64ff('0xf')](_0x64ff('0x13')),_0x1bffef[_0x64ff('0x14')][_0x64ff('0x15')](),_0x4624ca,_0x1bffef[_0x64ff('0x10')],_0x347418);}function consoleLogger(){var _0x458548=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x64ff('0x1b'))][(_0x64ff('0x1c'))]({'level':_0x64ff('0x1d'),'json':![],'formatter':function(_0x23df69){return formatter('',_0x23df69);}})]});return _0x458548;}function fileLogger(_0x1f2399,_0x22cad1){var _0x2dbbca=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x64ff('0x1e'))]({'name':util[_0x64ff('0xf')](_0x64ff('0x1f'),_0x1f2399,_0x64ff('0x20')),'filename':getLogFileName(_0x22cad1,_0x1f2399,_0x64ff('0x20')),'level':_0x64ff('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10f891){return fileFormat(_0x1f2399,_0x10f891);}}),new winston[(_0x64ff('0x1b'))][(_0x64ff('0x1e'))]({'name':util[_0x64ff('0xf')](_0x64ff('0x1f'),_0x1f2399,debugLevel),'filename':getLogFileName(_0x22cad1,_0x1f2399,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd967c4){return fileFormat(_0x1f2399,_0xd967c4);}}),new winston[(_0x64ff('0x1b'))][(_0x64ff('0x1c'))]({'level':_0x64ff('0x1d'),'json':![],'formatter':function(_0xc14ed9){return fileFormat(_0x1f2399,_0xc14ed9);}})]});return _0x2dbbca;}exports[_0x64ff('0x21')]=consoleLogger;exports[_0x64ff('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index eee7da9..d6e4bc9 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x58e937,_0x55c1ce){var _0x462ee7=function(_0x942d50){while(--_0x942d50){_0x58e937['push'](_0x58e937['shift']());}};_0x462ee7(++_0x55c1ce);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x2b94a1,_0x134a4d){var _0x3a7615=function(_0x169404){while(--_0x169404){_0x2b94a1['push'](_0x2b94a1['shift']());}};_0x3a7615(++_0x134a4d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x593bb6,_0x4ccbed){_0x593bb6=_0x593bb6-0x0;var _0x208dad=_0x5f2f[_0x593bb6];return _0x208dad;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7bd8225..0306304 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 _0x9ffd=['{\x20{\x20','string','replace','map','keys','reduce','exports','safeTemplate','lodash'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4c9c17,_0x389165){_0x4c9c17=_0x4c9c17-0x0;var _0xf77333=_0x9ffd[_0x4c9c17];return _0xf77333;};var _=require(_0xd9ff('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x413161){return _0x413161==='{{'?_0xd9ff('0x1'):'\x20}\x20}';}function safeTemplate(_0x3480c0){var _0x1530b1=_0x3480c0;if(typeof _0x3480c0===_0xd9ff('0x2')){_0x1530b1=_0x3480c0[_0xd9ff('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x3480c0)){_0x1530b1=_0x3480c0[_0xd9ff('0x4')](function(_0x111697){return safeTemplate(_0x111697);});}else if(_['isPlainObject'](_0x3480c0)){_0x1530b1=Object[_0xd9ff('0x5')](_0x3480c0)[_0xd9ff('0x6')](function(_0x13ea8c,_0x270eb2){_0x13ea8c[_0x270eb2]=safeTemplate(_0x3480c0[_0x270eb2]);return _0x13ea8c;},{});}return _0x1530b1;}module[_0xd9ff('0x7')][_0xd9ff('0x8')]=safeTemplate; \ No newline at end of file +var _0x757a=['isArray','map','isPlainObject','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0x53c89d,_0x46e997){var _0x4a30a1=function(_0x10347c){while(--_0x10347c){_0x53c89d['push'](_0x53c89d['shift']());}};_0x4a30a1(++_0x46e997);}(_0x757a,0xde));var _0xa757=function(_0x41269a,_0x3ad3b6){_0x41269a=_0x41269a-0x0;var _0x199af1=_0x757a[_0x41269a];return _0x199af1;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24afaf){return _0x24afaf==='{{'?_0xa757('0x0'):'\x20}\x20}';}function safeTemplate(_0x5c03c3){var _0x5709ed=_0x5c03c3;if(typeof _0x5c03c3===_0xa757('0x1')){_0x5709ed=_0x5c03c3[_0xa757('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa757('0x3')](_0x5c03c3)){_0x5709ed=_0x5c03c3[_0xa757('0x4')](function(_0x32630d){return safeTemplate(_0x32630d);});}else if(_[_0xa757('0x5')](_0x5c03c3)){_0x5709ed=Object['keys'](_0x5c03c3)[_0xa757('0x6')](function(_0x4343b6,_0x53be0e){_0x4343b6[_0x53be0e]=safeTemplate(_0x5c03c3[_0x53be0e]);return _0x4343b6;},{});}return _0x5709ed;}module[_0xa757('0x7')][_0xa757('0x8')]=safeTemplate; \ No newline at end of file -- 1.7.1